diff -Nru a/CREDITS b/CREDITS
--- a/CREDITS	Tue Feb  3 19:45:34 2004
+++ b/CREDITS	Tue Feb  3 19:45:34 2004
@@ -1394,7 +1394,9 @@
 N: Marcel Holtmann
 E: marcel@holtmann.org
 W: http://www.holtmann.org
+D: Maintainer of the Linux Bluetooth Subsystem
 D: Author and maintainer of the various Bluetooth HCI drivers
+D: Author and maintainer of the CAPI message transport protocol driver
 D: Various other Bluetooth related patches, cleanups and fixes
 S: Germany
 
@@ -2670,9 +2672,9 @@
 S: Finland
 
 N: Luca Risolia
-E: luca_ing@libero.it
-D: V4L driver for W996[87]CF JPEG USB Dual Mode Camera Chip
-S: Via LibertÃ  41/a
+E: luca.risolia@studio.unibo.it
+D: V4L driver for W996[87]CF JPEG USB Dual Mode Camera Chips
+S: Via Liberta' 41/A
 S: Osio Sotto, 24046, Bergamo
 S: Italy
 
diff -Nru a/Documentation/BK-usage/00-INDEX b/Documentation/BK-usage/00-INDEX
--- a/Documentation/BK-usage/00-INDEX	Tue Feb  3 19:45:17 2004
+++ b/Documentation/BK-usage/00-INDEX	Tue Feb  3 19:45:17 2004
@@ -17,6 +17,14 @@
 which compresses its input, and then outputs the uu-/base64-encoded
 version of the compressed input.
 
+cpcset: Copy changeset between unrelated repositories.
+Attempts to preserve changeset user, user address, description, in
+addition to the changeset (the patch) itself.
+Typical usage:
+	cd my-updated-repo
+	bk changes	# looking for a changeset...
+	cpcset 1.1511 . ../another-repo
+
 csets-to-patches: Produces a delta of two BK repositories, in the form
 of individual files, each containing a single cset as a GNU patch.
 Output is several files, each with the filename "/tmp/rev-$REV.patch"
@@ -32,6 +40,11 @@
 	cd my-updated-repo
 	bk changes -L ~/repo/original-repo 2>&1 | \
 		perl cset-to-linus > summary.txt
+
+gcapatch:  Generates patch containing changes in local repository.
+Typical usage:
+	cd my-updated-repo
+	gcapatch > foo.patch
 
 unbz64wrap: Reverse an encoded, compressed data stream created by
 bz64wrap into an uncompressed, typically text/plain output.
diff -Nru a/Documentation/BK-usage/cpcset b/Documentation/BK-usage/cpcset
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/BK-usage/cpcset	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# Purpose: Copy changeset patch and description from one
+#	   repository to another, unrelated one.
+#
+# usage:  cpcset [revision] [from-repository] [to-repository]
+#
+
+REV=$1
+FROM=$2
+TO=$3
+TMPF=/tmp/cpcset.$$
+
+rm -f $TMPF*
+
+CWD_SAVE=`pwd`
+cd $FROM
+bk changes -r$REV			|	\
+	grep -v '^ChangeSet'		|	\
+	sed -e 's/^  //g' > $TMPF.log
+
+USERHOST=`bk changes -r$REV | grep '^ChangeSet' | awk '{print $4}'`
+export BK_USER=`echo $USERHOST | awk '-F@' '{print $1}'`
+export BK_HOST=`echo $USERHOST | awk '-F@' '{print $2}'`
+
+bk export -tpatch -hdu -r$REV > $TMPF.patch && \
+cd $CWD_SAVE && \
+cd $TO && \
+bk import -tpatch -CFR -y"`cat $TMPF.log`" $TMPF.patch . && \
+bk commit -y"`cat $TMPF.log`"
+
+rm -f $TMPF*
+
+echo changeset $REV copied.
+echo ""
+
diff -Nru a/Documentation/BK-usage/gcapatch b/Documentation/BK-usage/gcapatch
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/BK-usage/gcapatch	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# Purpose: Generate GNU diff of local changes versus canonical top-of-tree
+#
+# Usage: gcapatch > foo.patch
+#
+
+bk export -tpatch -hdu -r`bk repogca bk://linux.bkbits.net/linux-2.5`,+
diff -Nru a/Documentation/DocBook/kernel-locking.tmpl b/Documentation/DocBook/kernel-locking.tmpl
--- a/Documentation/DocBook/kernel-locking.tmpl	Tue Feb  3 19:45:17 2004
+++ b/Documentation/DocBook/kernel-locking.tmpl	Tue Feb  3 19:45:17 2004
@@ -66,6 +66,7 @@
      fundamentals of concurrency and locking for
      <firstterm linkend="gloss-smp"><acronym>SMP</acronym></firstterm>.
    </para>
+  </chapter>
 
    <chapter id="races">
     <title>The Problem With Concurrency</title>
@@ -193,6 +194,7 @@
       And then there are the unfriendly primitives, but I'll pretend
       they don't exist.
     </para>
+    </sect1>
   </chapter>
 
   <chapter id="locks">
@@ -657,6 +659,7 @@
 </TBODY>
 </TGROUP>
 </TABLE>
+</sect1>
 </chapter>
 
   <chapter id="Examples">
@@ -1110,6 +1113,7 @@
          return obj;
  }
 </programlisting>
+</sect2>
 </sect1>
 
    <sect1 id="examples-lock-per-obj">
@@ -1229,6 +1233,7 @@
 behavior of the code, and can be hard to gain from just reading.  And
 as Alan Cox says, <quote>Lock data, not code</quote>.
 </para>
+</sect1>
 </chapter>
 
    <chapter id="common-problems">
@@ -1317,6 +1322,7 @@
       The two CPUs will spin forever, waiting for the other to give up
       their lock.  It will look, smell, and feel like a crash.
     </para>
+    </sect1>
 
     <sect1 id="techs-deadlock-prevent">
      <title>Preventing Deadlock</title>
@@ -1886,6 +1892,7 @@
       </para>
      </listitem>
     </itemizedlist>
+   </sect1>
 
    <sect1 id="dont-sleep">
     <title>Some Functions Which Don't Sleep</title>
diff -Nru a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
--- a/Documentation/SubmittingPatches	Tue Feb  3 19:45:16 2004
+++ b/Documentation/SubmittingPatches	Tue Feb  3 19:45:16 2004
@@ -20,16 +20,18 @@
 
 
 
-1) "diff -u"
+1) "diff -up"
 ------------
 
-Use "diff -u" or "diff -urN" to create patches.
+Use "diff -up" or "diff -uprN" to create patches.
 
 All changes to the Linux kernel occur in the form of patches, as
 generated by diff(1).  When creating your patch, make sure to create it
 in "unified diff" format, as supplied by the '-u' argument to diff(1).
-Patches should be based in the root kernel source directory, not in
-any lower subdirectory.
+Also, please use the '-p' argument which shows which C function each
+change is in - that makes the resultant diff a lot easier to read.
+Patches should be based in the root kernel source directory,
+not in any lower subdirectory.
 
 To create a patch for a single file, it is often sufficient to do:
 
@@ -39,7 +41,7 @@
 	cd $SRCTREE
 	cp $MYFILE $MYFILE.orig
 	vi $MYFILE	# make your change
-	diff -u $MYFILE.orig $MYFILE > /tmp/patch
+	diff -up $MYFILE.orig $MYFILE > /tmp/patch
 
 To create a patch for multiple files, you should unpack a "vanilla",
 or unmodified kernel source tree, and generate a diff against your
@@ -50,7 +52,7 @@
 	tar xvfz linux-2.4.0-test11.tar.gz
 	mv linux linux-vanilla
 	wget http://www.moses.uklinux.net/patches/dontdiff
-	diff -urN -X dontdiff linux-vanilla $MYSRC > /tmp/patch
+	diff -uprN -X dontdiff linux-vanilla $MYSRC > /tmp/patch
 	rm -f dontdiff
 
 "dontdiff" is a list of files which are generated by the kernel during
diff -Nru a/Documentation/arm/SA1100/CERF b/Documentation/arm/SA1100/CERF
--- a/Documentation/arm/SA1100/CERF	Tue Feb  3 19:45:16 2004
+++ b/Documentation/arm/SA1100/CERF	Tue Feb  3 19:45:16 2004
@@ -1,3 +1,5 @@
+*** The StrongARM version of the CerfBoard/Cube has been discontinued ***
+
 The Intrinsyc CerfBoard is a StrongARM 1110-based computer on a board
 that measures approximately 2" square. It includes an Ethernet
 controller, an RS232-compatible serial port, a USB function port, and
@@ -5,7 +7,7 @@
 Intrinsyc website, http://www.intrinsyc.com.
 
 This document describes the support in the Linux kernel for the
-Intrinsyc CerfBoard as of version 2.4.0-test4-np1.
+Intrinsyc CerfBoard.
 
 Supported in this version:
    - CompactFlash+ slot (select PCMCIA in General Setup and any options
@@ -14,24 +16,14 @@
      Network Devices)
    - Serial ports with a serial console (hardcoded to 38400 8N1)
 
-Not supported in this version (yet):
-   - LCD driver/touchscreen interface
-   - UDC (a driver exists right now, but is unstable and slow and only
-     works with the Linux USB)
-
 In order to get this kernel onto your Cerf, you need a server that runs
 both BOOTP and TFTP. Detailed instructions should have come with your
 evaluation kit on how to use the bootloader. This series of commands
 will suffice:
 
-   make cerf_config
-   make xconfig
-   make zImage
+   make ARCH=arm CROSS_COMPILE=arm-linux- cerfcube_defconfig
+   make ARCH=arm CROSS_COMPILE=arm-linux- zImage
+   make ARCH=arm CROSS_COMPILE=arm-linux- modules
    cp arch/arm/boot/zImage <TFTP directory>
 
-The default config uses a 4MB RAM disk located at 0xc0500000 as root.
-Setting the board to mount root from a NFS partition works, too.
-
-
-I-Gene Leong, Intrinsyc Software Inc.
-ileong@intrinsyc.com
+support@intrinsyc.com
diff -Nru a/Documentation/devices.txt b/Documentation/devices.txt
--- a/Documentation/devices.txt	Tue Feb  3 19:45:17 2004
+++ b/Documentation/devices.txt	Tue Feb  3 19:45:17 2004
@@ -2526,15 +2526,15 @@
 		  1 = /dev/dri/card1		Second graphics card
 		    ...
 
-227 char	IBM 3270 terminal block-mode access
+227 char	IBM 3270 terminal Unix tty access
+		  1 = /dev/3270/tty1		First 3270 terminal
+		  2 = /dev/3270/tty2		Seconds 3270 terminal
+		    ...
+
+228 char	IBM 3270 terminal block-mode access
 		  0 = /dev/3270/tub		Controlling interface
 		  1 = /dev/3270/tub1		First 3270 terminal
 		  2 = /dev/3270/tub2		Second 3270 terminal
-		    ...
-
-228 char	IBM 3270 terminal Unix tty access
-		  1 = /dev/3270/tty1		First 3270 terminal
-		  2 = /dev/3270/tty2		Seconds 3270 terminal
 		    ...
 
 229 char	IBM iSeries virtual console
diff -Nru a/Documentation/dvb/contributors.txt b/Documentation/dvb/contributors.txt
--- a/Documentation/dvb/contributors.txt	Tue Feb  3 19:45:17 2004
+++ b/Documentation/dvb/contributors.txt	Tue Feb  3 19:45:17 2004
@@ -8,7 +8,7 @@
 
 Marcus Metzler <mocm@metzlerbros.de>
 Ralph Metzler <rjkm@metzlerbros.de>
-  for their contining work on the DVB driver
+  for their continuing work on the DVB driver
 
 Michael Holzt <kju@debian.org>
   for his contributions to the dvb-net driver
@@ -58,5 +58,9 @@
   for his work on the budget drivers, the demux code,
   the module unloading problems, ...
   
+Hans-Frieder Vogt <hfvogt@arcor.de>
+  for his work on calculating and checking the crc's for the
+  TechnoTrend/Hauppauge DEC driver firmware
+
 (If you think you should be in this list, but you are not, drop a
  line to the DVB mailing list)
diff -Nru a/Documentation/dvb/ttusb-dec.txt b/Documentation/dvb/ttusb-dec.txt
--- a/Documentation/dvb/ttusb-dec.txt	Tue Feb  3 19:45:43 2004
+++ b/Documentation/dvb/ttusb-dec.txt	Tue Feb  3 19:45:43 2004
@@ -14,6 +14,7 @@
 	Hotplug firmware loader under 2.6 kernels
 
 In Progress:
+	DEC2540-t
 	DEC3000-s
 
 To Do:
@@ -23,21 +24,34 @@
 
 Getting the Firmware
 --------------------
-Currently, the driver only works with v2.15a of the firmware.  The firmwares
-can be obtained in this way:
+The firmware can be found in the software update zip files on this page:
+http://www.hauppauge.de/sw_dec.htm
 
-wget http://hauppauge.lightpath.net/de/dec215a.exe
-unzip -j dec215a.exe Software/Oem/STB/App/Boot/STB_PC_T.bin
-unzip -j dec215a.exe Software/Oem/STB/App/Boot/STB_PC_S.bin
+The firmwares are named as follows:
+DEC2000-t:	STB_PC_T.bin
+DEC2540-t:	STB_PC_X.bin
+DEC3000-s:	STB_PC_S.bin
+
+Note that firmwares since version 2.16 beta2 for the DEC2000-t give the device
+the USB ID of the DEC3000-s.  The driver copes with this.
+
+Instructions follow for retrieving version 2.16 of the firmware:
+
+wget http://hauppauge.lightpath.net/de/dec216.exe
+unzip -j dec216.exe software/OEM/STB/App/Boot/STB_PC_T.bin
+unzip -j dec216.exe software/OEM/STB/App/Boot/STB_PC_X.bin
+unzip -j dec216.exe software/OEM/STB/App/Boot/STB_PC_S.bin
 
 
 Compilation Notes for 2.4 kernels
 ---------------------------------
 For 2.4 kernels the firmware for the DECs is compiled into the driver itself.
-The firmwares are expected to be in /etc/dvb at compilation time.
+The firmwares are expected to be in the build-2.4 directory at compilation
+time.
 
-mv STB_PC_T.bin /etc/dvb/dec2000t.bin
-mv STB_PC_S.bin /etc/dvb/dec3000s.bin
+mv STB_PC_T.bin build-2.4/dvb-ttusb-dec-2000t.fw
+mv STB_PC_X.bin build-2.4/dvb-ttusb-dec-2540t.fw
+mv STB_PC_S.bin build-2.4/dvb-ttusb-dec-3000s.fw
 
 
 Hotplug Firmware Loading for 2.6 kernels
@@ -45,5 +59,6 @@
 For 2.6 kernels the firmware is loaded at the point that the driver module is
 loaded.  See linux/Documentation/dvb/firmware.txt for more information.
 
-mv STB_PC_T.bin /usr/lib/hotplug/firmware/dvb-ttusb-dec-2000t-2.15a.fw
-mv STB_PC_S.bin /usr/lib/hotplug/firmware/dvb-ttusb-dec-3000s-2.15a.fw
+mv STB_PC_T.bin /usr/lib/hotplug/firmware/dvb-ttusb-dec-2000t.fw
+mv STB_PC_X.bin /usr/lib/hotplug/firmware/dvb-ttusb-dec-2540t.fw
+mv STB_PC_S.bin /usr/lib/hotplug/firmware/dvb-ttusb-dec-3000s.fw
diff -Nru a/Documentation/fb/modedb.txt b/Documentation/fb/modedb.txt
--- a/Documentation/fb/modedb.txt	Tue Feb  3 19:45:35 2004
+++ b/Documentation/fb/modedb.txt	Tue Feb  3 19:45:35 2004
@@ -51,10 +51,11 @@
     Drivers that support modedb boot options
     Boot Name	  Cards Supported
 
-    ami		- Amiga chipset frame buffer
+    amifb	- Amiga chipset frame buffer
     aty128fb	- ATI Rage128 / Pro frame buffer
     atyfb	- ATI Mach64 frame buffer
-    tdfx	- 3D Fx frame buffer
+    tdfxfb	- 3D Fx frame buffer
+    tridentfb	- Trident (Cyber)blade chipset frame buffer
 
 BTW, only a few drivers use this at the moment. Others are to follow
 (feel free to send patches).
diff -Nru a/Documentation/fb/tridentfb.txt b/Documentation/fb/tridentfb.txt
--- a/Documentation/fb/tridentfb.txt	Tue Feb  3 19:45:17 2004
+++ b/Documentation/fb/tridentfb.txt	Tue Feb  3 19:45:17 2004
@@ -11,10 +11,15 @@
 
 How to use it?
 ==============
-Just do your usual console work :)
 
-When booting you can pass the following parameters
-==================================================
+When booting you can pass the video parameter.
+video=tridentfb
+
+The parameters for tridentfb are concatenated with a ':' as in this example.
+
+video=tridentfb:800x600,bpp=16,noaccel
+
+The second level parameters that tridentfb understands are:
 
 noaccel - turns off acceleration (when it doesn't work for your card)
 accel - force text acceleration (for boards which by default are noacceled)
diff -Nru a/Documentation/filesystems/ntfs.txt b/Documentation/filesystems/ntfs.txt
--- a/Documentation/filesystems/ntfs.txt	Tue Feb  3 19:45:28 2004
+++ b/Documentation/filesystems/ntfs.txt	Tue Feb  3 19:45:28 2004
@@ -272,6 +272,9 @@
 
 Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog.
 
+2.1.6:
+	- Fix minor bug in handling of compressed directories that fixes the
+	  erroneous "du" and "stat" output people reported.
 2.1.5:
 	- Minor bug fix in attribute list attribute handling that fixes the
 	  I/O errors on "ls" of certain fragmented files found by at least two
diff -Nru a/Documentation/i386/usb-legacy-support.txt b/Documentation/i386/usb-legacy-support.txt
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/i386/usb-legacy-support.txt	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,44 @@
+USB Legacy support
+~~~~~~~~~~~~~~~~~~
+
+Vojtech Pavlik <vojtech@suse.cz>, January 2004
+
+
+Also known as "USB Keyboard" or "USB Mouse support" in the BIOS Setup is a
+feature that allows one to use the USB mouse and keyboard as if they were
+their classic PS/2 counterparts.  This means one can use an USB keyboard to
+type in LILO for example.
+
+It has several drawbacks, though:
+
+1) On some machines, the emulated PS/2 mouse takes over even when no USB
+   mouse is present and a real PS/2 mouse is present.  In that case the extra
+   features (wheel, extra buttons, touchpad mode) of the real PS/2 mouse may
+   not be available.
+
+2) If CONFIG_HIGHMEM64G is enabled, the PS/2 mouse emulation can cause
+   system crashes, because the SMM BIOS is not expecting to be in PAE mode.
+   The Intel E7505 is a typical machine where this happens.
+
+3) If AMD64 64-bit mode is enabled, again system crashes often happen,
+   because the SMM BIOS isn't expecting the CPU to be in 64-bit mode.  The
+   BIOS manufacturers only test with Windows, and Windows doesn't do 64-bit
+   yet.
+
+Solutions:
+
+Problem 1) can be solved by loading the USB drivers prior to loading the
+PS/2 mouse driver. Since the PS/2 mouse driver is in 2.6 compiled into
+the kernel unconditionally, this means the USB drivers need to be
+compiled-in, too.
+
+Problem 2) can currently only be solved by either disabling HIGHMEM64G
+in the kernel config or USB Legacy support in the BIOS. A BIOS update
+could help, but so far no such update exists.
+
+Problem 3) is usually fixed by a BIOS update. Check the board
+manufacturers web site. If an update is not available, disable USB
+Legacy support in the BIOS. If this alone doesn't help, try also adding
+idle=poll on the kernel command line. The BIOS may be entering the SMM
+on the HLT instruction as well.
+
diff -Nru a/Documentation/i386/zero-page.txt b/Documentation/i386/zero-page.txt
--- a/Documentation/i386/zero-page.txt	Tue Feb  3 19:45:17 2004
+++ b/Documentation/i386/zero-page.txt	Tue Feb  3 19:45:17 2004
@@ -28,8 +28,13 @@
 
  0xa0	16 bytes	System description table truncated to 16 bytes.
 			( struct sys_desc_table_struct )
- 0xb0 - 0x1df		Free. Add more parameters here if you really need them.
+ 0xb0 - 0x1c3		Free. Add more parameters here if you really need them.
 
+0x1c4	unsigned long	EFI system table pointer
+0x1c8	unsigned long	EFI memory descriptor size
+0x1cc	unsigned long	EFI memory descriptor version
+0x1d0	unsigned long	EFI memory descriptor map pointer
+0x1d4	unsigned long	EFI memory descriptor map size
 0x1e0	unsigned long	ALT_MEM_K, alternative mem check, in Kb
 0x1e8	char		number of entries in E820MAP (below)
 0x1e9	unsigned char	number of entries in EDDBUF (below)
diff -Nru a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
--- a/Documentation/kernel-parameters.txt	Tue Feb  3 19:45:43 2004
+++ b/Documentation/kernel-parameters.txt	Tue Feb  3 19:45:43 2004
@@ -37,7 +37,7 @@
 	MCA	MCA bus support is enabled.
 	MDA	MDA console support is enabled.
 	MOUSE	Appropriate mouse support is enabled.
-	MTD	MTD support is nebaled.
+	MTD	MTD support is enabled.
 	NET	Appropriate network support is enabled.
 	NFS	Appropriate NFS support is enabled.
 	OSS	OSS sound support is enabled.
@@ -57,6 +57,7 @@
 	SMP	The kernel is an SMP kernel.
 	SPARC	Sparc architecture is enabled.
 	SWSUSP	Software suspension is enabled.
+	TS	Appropriate touchscreen support is enabled.
 	USB	USB support is enabled.
 	V4L	Video For Linux support is enabled.
 	VGA	The VGA console has been enabled.
@@ -85,6 +86,9 @@
 			See header of drivers/scsi/53c7xx.c.
 			See also Documentation/scsi/ncr53c7xx.txt.
 
+	98busmouse.irq=	[HW,MOUSE] PC-9801 Bus Mouse Driver
+			Format: <irq>, default is 13
+
 	acpi=		[HW,ACPI] Advanced Configuration and Power Interface 
 			Format: { force | off | ht }
 			force -- enables ACPI for systems with default off
@@ -92,6 +96,23 @@
 			ht -- run only enough ACPI to enable Hyper Threading
 			See also Documentation/pm.txt.
  
+	acpi_pic_sci=	[HW,ACPI] ACPI System Control Interrupt trigger mode
+			Format: { level | edge }
+			level   Force PIC-mode SCI to Level Trigger (default)
+			edge    Force PIC-mode SCI to Edge Trigge
+
+	acpi_irq_balance	[HW,ACPI] ACPI will balance active IRQs
+				default in APIC mode
+
+	acpi_irq_nobalance	[HW,ACPI] ACPI will not move active IRQs (default)
+				default in PIC mode
+
+	acpi_irq_pci=	[HW,ACPI] If irq_balance, Clear listed IRQs for use by PCI
+			Format: <irq>,<irq>...
+
+	acpi_irq_isa=	[HW,ACPI] If irq_balance, Mark listed IRQs used by ISA
+			Format: <irq>,<irq>...
+
 	ad1816=		[HW,OSS]
 			Format: <io>,<irq>,<dma>,<dma2>
 			See also Documentation/sound/oss/AD1816.
@@ -153,10 +174,11 @@
 
 	atascsi=	[HW,SCSI] Atari SCSI
 
-	atkbd_set=	[HW] Select keyboard code set
+	atkbd.set=	[HW] Select keyboard code set
 			Format: <int>
-
-	atkbd_reset	[HW] Reset keyboard during initialization
+	atkbd.softrepeat=
+			[HW] Use software keyboard repeat
+	atkbd.reset=	[HW] Reset keyboard during initialization
 
 	autotest	[IA64]
 
@@ -372,13 +394,15 @@
 
 	noirqbalance	[IA-32,SMP,KNL] Disable kernel irq balancing
 
-	i8042_direct	[HW] Keyboard has been put into non-translated mode 
-			by BIOS
-	i8042_dumbkbd	[HW] Don't attempt to blink the leds
-	i8042_noaux	[HW] Don't check for auxiliary (== mouse) port
-	i8042_nomux
-	i8042_reset	[HW] Reset the controller during init and cleanup
-	i8042_unlock	[HW] Unlock (ignore) the keylock
+	i8042.direct	[HW] Put keyboard port into non-translated mode
+	i8042.dumbkbd	[HW] Pretend that controlled can only read data from
+			     keyboard and can not control its state
+			     (Don't attempt to blink the leds)
+	i8042.noaux	[HW] Don't check for auxiliary (== mouse) port
+	i8042.nomux	[HW] Don't check presence of an active multiplexing
+			     controller
+	i8042.reset	[HW] Reset the controller during init and cleanup
+	i8042.unlock	[HW] Unlock (ignore) the keylock
 
 	i810=		[HW,DRM]
 
@@ -414,7 +438,7 @@
 
 	initrd=		[BOOT] Specify the location of the initial ramdisk
 
-	inport_irq=	[HW] Inport (ATI XL and Microsoft) busmouse driver
+	inport.irq=	[HW] Inport (ATI XL and Microsoft) busmouse driver
 			Format: <irq>
 
 	inttest=	[IA64]
@@ -462,7 +486,7 @@
 
 	lockd.tcpport=	[NFS]
 
-	logibm_irq=	[HW,MOUSE] Logitech Bus Mouse Driver
+	logibm.irq=	[HW,MOUSE] Logitech Bus Mouse Driver
 			Format: <irq>
 
 	log_buf_len=n	Sets the size of the printk ring buffer, in bytes.
@@ -562,6 +586,11 @@
 
 	mga=		[HW,DRM]
 
+	mousedev.xres	[MOUSE] Horizontal screen resolution, used for devices
+			reporting absolute coordinates, such as tablets
+	mousedev.yres	[MOUSE] Vertical screen resolution, used for devices
+			reporting absolute coordinates, such as tablets
+
 	mpu401=		[HW,OSS]
 			Format: <io>,<irq>
 
@@ -795,12 +824,18 @@
 			before loading.
 			See Documentation/ramdisk.txt.
 
-	psmouse_proto=  [HW,MOUSE] Highest PS2 mouse protocol extension to
+	psmouse.proto=  [HW,MOUSE] Highest PS2 mouse protocol extension to
 			probe for (bare|imps|exps).
-
-	psmouse_resetafter=
+	psmouse.rate=	[HW,MOUSE] Set desired mouse report rate, in reports
+			per second.
+	psmouse.resetafter=
 			[HW,MOUSE] Try to reset Synaptics Touchpad after so many
 			bad packets (0 = never).
+	psmouse.resolution=
+			[HW,MOUSE] Set desired mouse resolution, in dpi.
+	psmouse.smartscroll=
+			[HW,MOUSE] Controls Logitech smartscroll autorepeat,
+			0 = disabled, 1 = enabled (default).
 
 	pss=		[HW,OSS] Personal Sound System (ECHO ESC614)
 			Format: <io>,<mss_io>,<mss_irq>,<mss_dma>,<mpu_io>,<mpu_irq>
@@ -1118,6 +1153,9 @@
 	trix=		[HW,OSS] MediaTrix AudioTrix Pro
 			Format: <io>,<irq>,<dma>,<dma2>,<sb_io>,<sb_irq>,<sb_dma>,<mpu_io>,<mpu_irq>
  
+	tsdev.xres	[TS] Horizontal screen resolution.
+	tsdev.yres	[TS] Vertical screen resolution.
+
 	u14-34f=	[HW,SCSI] UltraStor 14F/34F SCSI host adapter
 			See header of drivers/scsi/u14-34f.c.
 
diff -Nru a/Documentation/m68k/00-INDEX b/Documentation/m68k/00-INDEX
--- a/Documentation/m68k/00-INDEX	Tue Feb  3 19:45:17 2004
+++ b/Documentation/m68k/00-INDEX	Tue Feb  3 19:45:17 2004
@@ -1,7 +1,5 @@
 00-INDEX
 	- this file
-framebuffer.txt
-	- info about the Linux/m68k frame buffer device
 kernel-options.txt
 	- command line options for Linux/m68k
 
diff -Nru a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
--- a/Documentation/networking/ip-sysctl.txt	Tue Feb  3 19:45:17 2004
+++ b/Documentation/networking/ip-sysctl.txt	Tue Feb  3 19:45:17 2004
@@ -667,6 +667,13 @@
 	valid temporary addresses.
 	Default: 5
 
+max_addresses - INTEGER
+	Number of maximum addresses per interface.  0 disables limitation.
+	It is recommended not set too large value (or 0) because it would 
+	be too easy way to crash kernel to allow to create too much of 
+	autoconfigured addresses.
+	Default: 16
+
 icmp/*:
 ratelimit - INTEGER
 	Limit the maximal rates for sending ICMPv6 packets.
diff -Nru a/Documentation/networking/sk98lin.txt b/Documentation/networking/sk98lin.txt
--- a/Documentation/networking/sk98lin.txt	Tue Feb  3 19:45:33 2004
+++ b/Documentation/networking/sk98lin.txt	Tue Feb  3 19:45:33 2004
@@ -2,9 +2,9 @@
 All rights reserved
 ===========================================================================
 
-sk98lin.txt created 23-Sep-2003
+sk98lin.txt created 15-Dec-2003
 
-Readme File for sk98lin v6.18
+Readme File for sk98lin v6.21
 Marvell Yukon/SysKonnect SK-98xx Gigabit Ethernet Adapter family driver for LINUX
 
 This file contains
@@ -466,7 +466,7 @@
 Link Aggregation according to IEEE standards 802.1, 802.1q, and 802.3ad. 
 These features are only available after installation of open source 
 modules available on the Internet:
-For VLAN go to: http://scry.wanfear.com/~greear/vlan.html
+For VLAN go to: http://www.candelatech.com/~greear/vlan.html
 For Link Aggregation go to: http://www.st.rim.or.jp/~yumo
 
 NOTE: SysKonnect GmbH does not offer any support for these open source 
diff -Nru a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt
--- a/Documentation/power/swsusp.txt	Tue Feb  3 19:45:16 2004
+++ b/Documentation/power/swsusp.txt	Tue Feb  3 19:45:16 2004
@@ -17,13 +17,30 @@
 You need to append resume=/dev/your_swap_partition to kernel command
 line. Then you suspend by echo 4 > /proc/acpi/sleep.
 
-[Notice. Rest docs is pretty outdated (see date!) It should be safe to
-use swsusp on ext3/reiserfs these days.]
+Pavel's unreliable guide to swsusp mess
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+There are currently two versions of swap suspend in the kernel, the old
+"Pavel's" version in kernel/power/swsusp.c and the new "Patrick's"
+version in kernel/power/pmdisk.c. They provide the same functionality;
+the old version looks ugly but was tested, while the new version looks
+nicer but did not receive so much testing. echo 4 > /proc/acpi/sleep
+calls the old version, echo disk > /sys/power/state calls the new one.
+
+[In the future, when the new version is stable enough, two things can
+happen:
+
+* the new version is moved into swsusp.c, and swsusp is renamed to swap
+  suspend (Pavel prefers this)
+
+* pmdisk is kept as is and swsusp.c is removed from the kernel]
+
 
 
 Article about goals and implementation of Software Suspend for Linux
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Author: G‚ábor Kuti
-Last revised: 2002-04-08
+Last revised: 2003-10-20 by Pavel Machek
 
 Idea and goals to achieve
 
@@ -36,84 +53,23 @@
 interrupt our programs so processes that are calculating something for a long
 time shouldn't need to be written interruptible.
 
-On desk machines the power saving function isn't as important as it is in
-laptops but we really may benefit from the second one. Nowadays the number of
-desk machines supporting suspend function in their APM is going up but there
-are (and there will still be for a long time) machines that don't even support
-APM of any kind. On the other hand it is reported that using APM's suspend
-some irqs (e.g. ATA disk irq) is lost and it is annoying for the user until
-the Linux kernel resets the device.
-
-So I started thinking about implementing Software Suspend which doesn't need
-any APM support and - since it uses pretty near only high-level routines - is
-supposed to be architecture independent code.
-
 Using the code
 
-The code is experimental right now - testers, extra eyes are welcome. To
-compile this support into the kernel, you need CONFIG_EXPERIMENTAL, 
-and then CONFIG_SOFTWARE_SUSPEND in menu General Setup to be  enabled. It
-cannot be used as a module and I don't think it will ever be needed.
-
-You have two ways to use this code. The first one is if you've compiled in
-sysrq support then you may press Sysrq-D to request suspend. The other way
-is with a patched SysVinit (my patch is against 2.76 and available at my
-home page). You might call 'swsusp' or 'shutdown -z <time>'. Next way is to
-echo 4 > /proc/acpi/sleep.
+You have two ways to use this code. The first one is is with a patched
+SysVinit (my patch is against 2.76 and available at my home page). You
+might call 'swsusp' or 'shutdown -z <time>'. Next way is to echo 4 >
+/proc/acpi/sleep.
 
 Either way it saves the state of the machine into active swaps and then
 reboots.  You must explicitly specify the swap partition to resume from with
 ``resume='' kernel option. If signature is found it loads and restores saved
 state. If the option ``noresume'' is specified as a boot parameter, it skips
-the resuming.  Warning! Look at section ``Things to implement'' to see what
-isn't yet implemented.  Also I strongly suggest you to list all active swaps
-in /etc/fstab. Firstly because you don't have to specify anything to resume
-and secondly if you have more than one swap area you can't decide which one
-has the 'root' signature. 
+the resuming.
 
 In the meantime while the system is suspended you should not touch any of the
 hardware!
 
 About the code
-Goals reached
-
-The code can be downloaded from
-http://falcon.sch.bme.hu/~seasons/linux/. It mainly works but there are still
-some of XXXs, TODOs, FIXMEs in the code which seem not to be too important. It
-should work all right except for the problems listed in ``Things to
-implement''. Notes about the code are really welcome.
-
-How the code works
-
-When suspending is triggered it immediately wakes up process bdflush. Bdflush
-checks whether we have anything in our run queue tq_bdflush. Since we queued up
-function do_software_suspend, it is called. Here we shrink everything including
-dcache, inodes, buffers and memory (here mainly processes are swapped out). We
-count how many pages we need to duplicate (we have to be atomical!) then we
-create an appropriate sized page directory. It will point to the original and
-the new (copied) address of the page. We get the free pages by
-__get_free_pages() but since it changes state we have to be able to track it
-later so it also flips in a bit in page's flags (a new Nosave flag). We
-duplicate pages and then mark them as used (so atomicity is ensured). After
-this we write out the image to swaps, do another sync and the machine may
-reboot. We also save registers to stack.
-
-By resuming an ``inverse'' method is executed. The image if exists is loaded,
-loadling is either triggered by ``resume='' kernel option.  We
-change our task to bdflush (it is needed because if we don't do this init does
-an oops when it is waken up later) and then pages are copied back to their
-original location. We restore registers, free previously allocated memory,
-activate memory context and task information. Here we should restore hardware
-state but even without this the machine is restored and processes are continued
-to work. I think hardware state should be restored by some list (using
-notify_chain) and probably by some userland program (run-parts?) for users'
-pleasure. Check out my patch at the same location for the sysvinit patch.
-
-WARNINGS!
-- It does not like pcmcia cards. And this is logical: pcmcia cards need
-  cardmgr to be initialized. they are not initialized during singleuser boot,
-  but "resumed" kernel does expect them to be initialized. That leads to
-  armagedon. You should eject any pcmcia cards before suspending.
 
 Things to implement
 - SMP support. I've done an SMP support but since I don't have access to a kind
@@ -122,34 +78,14 @@
   interrupts AFAIK..
 - We should only make a copy of data related to kernel segment, since any
   process data won't be changed.
-- Hardware state restoring.  Now there's support for notifying via the notify
-  chain, event handlers are welcome. Some devices may have microcodes loaded
-  into them. We should have event handlers for them as well.
-- We should support other architectures (There are really only some arch
-  related functions..)
-- We should also restore original state of swaps if the ``noresume'' kernel
-  option is specified.. Or do we need such a feature to save state for some
-  other time? Do we need some kind of ``several saved states''?  (Linux-HA
-  people?). There's been some discussion about checkpointing on linux-future.
 - Should make more sanity checks. Or are these enough?
 
 Not so important ideas for implementing
 
 - If a real time process is running then don't suspend the machine.
-- Support for power.conf file as in Solaris, autoshutdown, special
-  devicetypes support, maybe in sysctl.
-- Introduce timeout for SMP locking. But first locking ought to work :O
-- Pre-detect if we don't have enough swap space or free it instead of
-  calling panic.
 - Support for adding/removing hardware while suspended?
 - We should not free pages at the beginning so aggressively, most of them
   go there anyway..
-- If X is active while suspending then by resuming calling svgatextmode
-  corrupts the virtual console of X.. (Maybe this has been fixed AFAIK).
-
-Drivers we support
-- IDE disks are okay
-- vesafb
 
 Drivers that need support
 - pc_keyb -- perhaps we can wait for vojtech's input patches
diff -Nru a/Documentation/power/video.txt b/Documentation/power/video.txt
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/power/video.txt	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,36 @@
+
+		Video issues with S3 resume
+		~~~~~~~~~~~~~~~~~~~~~~~~~~~
+		     2003, Pavel Machek
+
+During S3 resume, hardware needs to be reinitialized. For most
+devices, this is easy, and kernel driver knows how to do
+it. Unfortunately there's one exception: video card. Those are usually
+initialized by BIOS, and kernel does not have enough information to
+boot video card. (Kernel usually does not even contain video card
+driver -- vesafb and vgacon are widely used).
+
+This is not problem for swsusp, because during swsusp resume, BIOS is
+run normally so video card is normally initialized.
+
+There are three types of systems where video works after S3 resume:
+
+* systems where video state is preserved over S3. (HP Omnibook xe3)
+
+* systems that initialize video card into vga text mode and where BIOS
+  works well enough to be able to set video mode. Use
+  acpi_sleep=s3_mode on these. (Toshiba 4030cdt)
+
+* systems where it is possible to call video bios during S3
+  resume. Unfortunately, it is not correct to call video BIOS at that
+  point, but it happens to work on some machines. Use
+  acpi_sleep=s3_bios (Athlon64 desktop system)
+
+Now, if you pass acpi_sleep=something, and it does not work with your
+bios, you'll get hard crash during resume. Be carefull.
+
+You may have system where none of above works. At that point you
+either invent another ugly hack that works, or write proper driver for
+your video card (good luck getting docs :-(). Maybe suspending from X
+(proper X, knowing your hardware, not XF68_FBcon) might have better
+chance of working.
diff -Nru a/Documentation/s390/driver-model.txt b/Documentation/s390/driver-model.txt
--- a/Documentation/s390/driver-model.txt	Tue Feb  3 19:45:16 2004
+++ b/Documentation/s390/driver-model.txt	Tue Feb  3 19:45:16 2004
@@ -32,6 +32,9 @@
 devtype:    The device type / model, if applicable.
 
 online:     An interface to set the device online and offline.
+	    In the special case of the device being disconnected (see the
+	    notify function under 1.2), piping 0 to online will focibly delete
+	    the device.
 
 The device drivers can add entries to export per-device data and interfaces.
 
@@ -82,6 +85,7 @@
 	int (*remove) (struct ccw_device *);
 	int (*set_online) (struct ccw_device *);
 	int (*set_offline) (struct ccw_device *);
+	int (*notify) (struct ccw_device *, int);
 	struct device_driver driver;
 	char *name;
 };
@@ -142,6 +146,28 @@
 Parameters:   cdev       - the device to be deactivated. The common layer has
 			   verified that the device is online.
 
+
+notify: This function is called by the common I/O layer for some state changes
+	of the device.
+	Signalled to the driver are:
+	* In online state, device detached (CIO_GONE) or last path gone
+	  (CIO_NO_PATH). The driver must return !0 to keep the device; for
+	  return code 0, the device will be deleted as usual (also when no
+	  notify function is registerd). If the driver wants to keep the
+	  device, it is moved into disconnected state.
+	* In disconnected state, device operational again (CIO_OPER). The
+	  common I/O layer performs some sanity checks on device number and
+	  Device / CU to be reasonably sure if it is still the same device.
+	  If not, the old device is removed and a new one registered. By the
+	  return code of the notify function the device driver signals if it
+	  wants the device back: !0 for keeping, 0 to make the device being
+	  removed and re-registered.
+	
+int (*notify) (struct ccw_device *, int);
+
+Parameters:   cdev    - the device whose state changed.
+	      event   - the event that happened. This can be one of CIO_GONE,
+		        CIO_NO_PATH or CIO_OPER.
 
 The handler field of the struct ccw_device is meant to be set to the interrupt
 handler for the device. In order to accommodate drivers which use several 
diff -Nru a/Documentation/scsi/qla2xxx.revision.notes b/Documentation/scsi/qla2xxx.revision.notes
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/scsi/qla2xxx.revision.notes	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,457 @@
+/*
+ * QLogic ISP2200 and ISP2300 Linux Driver Revision List File.
+ *
+ ********************************************************************
+ *
+ * Revision History
+ *
+ *  Rev  8.00.00b8	December 5, 2003	AV
+ *	- Instruct mid-layer to perform initial scan.
+ *
+ *  Rev  8.00.00b7	December 5, 2003	AV
+ *	- Resync with Linux Kernel 2.6.0-test11.
+ *	- Add basic NVRAM parser (extras/qla_nvr).
+ *
+ *  Rev  8.00.00b7-pre11 December 3, 2003	AV
+ *	- Sanitize the scsi_qla_host structure:
+ *	  - Purge unused elements.
+ *	  - Reorganize high-priority members (cache coherency).
+ *	- Add support for NVRAM access via a sysfs binary attribute:
+ *	  - Consolidate semaphore locking access.
+ *	- Fix more PCI posting issues.
+ *	- Add extras directory for dump/NVRAM tools.
+ *	- Remove unused qla_vendor.c file.
+ *
+ *  Rev  8.00.00b7-pre11 November 26, 2003	DG/AV
+ *	- Merge several patches from Christoph Hellwig [hch@lst.de]:
+ *	  - in Linux 2.6 both pci and the scsi layer use the generic
+ *	    dma direction bits, use them directly instead of the scsi
+ *	    and pci variants and the (noop) conversion routines.
+ *	- Fix _IOXX_BAD() usage for external IOCTL interface.
+ *	- Use atomic construct for HA loop_state member.
+ *	- Add generic model description text for HBA types.
+ *
+ *  Rev  8.00.00b7-pre5	November 17, 2003	AV
+ *	- Merge several patches from Christoph Hellwig [hch@lst.de]:
+ *	  - patch to split the driver into a common qla2xxx.ko and a
+ *	    qla2?00.ko for each HBA type - the latter modules are
+ *	    only very small wrappers, mostly for the firmware
+ *	    images, all the meat is in the common qla2xxx.ko.
+ *	  - make the failover code optional.
+ *	  - kill useless lock_kernel in dpc thread startup.
+ *	  - no need for modversions hacks in 2.6 (or 2.4).
+ *	  - kill qla2x00_register_with_Linux.
+ *	  - simplify EH code, cmd or it's hostdata can't be NULL, no
+ *	    need to search whether the host it's ours, the midlayer
+ *	    makes sure it won't call into a driver for some else
+ *	    host.
+ *	- Merge several patches from Jes Sorensen
+ *	  [jes@wildopensource.com]:
+ *	  - Call qla2x00_config_dma_addressing() before performing
+ *	    any consistent allocations. This is required since the
+ *	    dma mask settings will affect the memory
+ *	    pci_alloc_consistent() will return.
+ *	  - Call pci_set_consistent_dma_mask() to allow for 64 bit
+ *	    consistent allocations, required on some platforms such
+ *	    as the SN2.
+ *	  - Wait 20 usecs (not sure how long is really necessary,
+ *	    but this seems safe) after setting CSR_ISP_SOFT_RESET in
+ *	    the ctrl_status register as the card doesn't respond to
+ *	    PCI reads while in reset state. This causes a machine
+ *	    check on some architectures.
+ *	  - Flush PCI writes before calling udelay() to ensure the
+ *	    write is not sitting idle in-flight for a while before
+ *	    hitting the hardware.
+ *	  - Include linux/vmalloc.h in qla_os.c since it uses
+ *	    vmalloc().
+ *	  - Use auto-negotiate link speed when using default
+ *	    parameters rather than NVRAM settings. Disable NVRAM
+ *	    reading on SN2 since it's not possible to execute the
+ *	    HBA's BIOS on an SN2. I suggest doing something similar
+ *	    for all architectures that do not provide x86 BIOS
+ *	    emulation.
+ *	- Clean-up slab-cache allocations:
+ *	  - locking.
+ *	  - mempool allocations in case of low-memory situations.
+ *	- Fallback to GA_NXT scan if GID_PT call returns more than
+ *	  MAX_FIBRE_DEVICES.
+ *	- Preserve iterating port ID across GA_NXT calls in
+ *	  qla2x00_find_all_fabric_devs().
+ *	- Pre-calculate ASCII firmware dump length as to not incur the
+ *	  cost-to-calculate at each invocation of a read().
+ *
+ *  Rev  8.00.00b6	November 4, 2003	AV
+ *	- Add new 2300 TPX firmware (3.02.18).
+ *
+ *  Rev  8.00.00b6-pre25 October 20, 2003	RA/AV
+ *	- Resync with Linux Kernel 2.6.0-test9.
+ *	- Rework firmware dump process:
+ *	  - Use binary attribute within sysfs tree.
+ *	  - Add user-space tool (gdump.sh) to retrieve formatted
+ *	    buffer.
+ *	  - Add ISP2100 support.
+ *	- Use a slab cache for SRB allocations to reduce memory
+ *	  pressure.
+ *	- Initial conversion of driver logging methods to a new
+ *	  qla_printk() function which uses dev_printk (Daniel
+ *	  Stekloff, IBM).
+ *	- Further reduce stack usage in qla2x00_configure_local_loop()
+ *	  and qla2x00_find_all_fabric_devs().
+ *	- Separate port state used for routing of I/O's from port
+ *	  mgmt-login retry etc.
+ *
+ *  Rev  8.00.00b6-pre19 October 13, 2003	AV
+ *	- Resync with Linux Kernel 2.6.0-test7-bk5.
+ *	- Add intelligent RSCN event handling:
+ *	  - reduce scan time during 'port' RSCN events by only
+ *	    querying specified port ids.
+ *	  - Available on ISP23xx cards only.
+ *	- Increase maximum number of recognizable targets from 256
+ *	  to 512.
+ *	  - Backend changes were previously added to support TPX
+ *	    (2K logins) firmware.  Mid-layer can now scan for targets
+ *	    (H, B, T, L) where 512 < T >= 0.
+ *	- Remove IP support from driver.
+ *	  - Switch firmware types from IP->TP for ISP22xx and
+ *	    IPX->TPX for ISP23xx cards.
+ *	  - Remove files qla_ip.[ch].
+ *	- Remove type designations from firmware filenames.
+ *
+ *  Rev  8.00.00b6-pre11 September 15, 2003	DG/AV
+ *	- Resync with 6.06.00.
+ *	- Resync with Linux Kernel 2.6.0-test5-bk3.
+ *	- Add new 2300 IPX firmware (3.02.15).
+ *
+ *  Rev  8.00.00b5	July 31, 2003		AV
+ *	- Always create an fc_lun_t entry for lun 0 - as the mid-
+ *	  layer requires access to this lun for discovery to occur.
+ *	- General sanitizing:
+ *	  - Add generic firmware option definitions.
+ *	  - Generalize retrieval/update of firmware options.
+ *	  - Fix compile errors which occur with extended debug.
+ *	  - Handle failure cases for scsi_add_host() and
+ *	    down_interruptible().
+ *	- Host template updates:
+ *	  - Use standard bios_param callback function.
+ *	  - Disable clustering.
+ *	  - Remove unchecked_is_dma entry.
+ *
+ *  Rev  8.00.00b5-pre5	July 29, 2003		DG/AV
+ *	- Resync with 6.06.00b13.
+ *	- Resync with Linux Kernel 2.6.0-test2.
+ *	- Pass the complete loop_id, not the masked (0xff) value
+ *	  while issuing mailbox commands (qla_mbx.c/qla_fo.c/
+ *	  qla_iocb.c/qla_init.c).
+ *	- Properly handle zero-length return status for an RLC CDB.
+ *	- Create an fclun_t structure for 'disconnected' luns,
+ *	  peripheral-qualifier of 001b.
+ *	- Remove unused LIP-sequence register access during AE 8010.
+ *	- Generalize qla2x00_mark_device_lost() to handle forced 
+ *	  login request -- modify all direct/indirect invocations 
+ *	  with proper flag.
+ *	- Save RSCN notification (AE 8015h) data in a proper and 
+ *	  consistent format (domain, area, al_pa).
+ *	- General sanitizing:
+ *	  - scsi_qla_host structure member reordering for cache-line
+ *	    coherency.
+ *	  - Remove unused SCSI opcodes, endian-swap definitions.
+ *	  - Remove CMD_* pre-processor defines.
+ *	  - Remove unused SCSIFCHOTSWAP/GAMAP/MULTIHOST codes.
+ *	- Backout patch which added a per-scsi_qla_host scsi host
+ *	  spinlock, since mid-layer already defines one.
+ *	- Add new 2300 IPX firmware (3.02.15).
+ *
+ *  Rev  8.00.00b4	July 14, 2003		RA/DG/AV
+ *	- Resync with 6.06.00b12.
+ *	- Resync with Linux Kernel 2.6.0-test1.
+ *	- Remove IOCB throttling code -- originally #if'd.
+ *	- Remove apidev_*() routines since proc_mknod() has been
+ *	  removed -- need alternate IOCTL interface.
+ *	- Merge several performance/fix patches from Arjan van de
+ *	  Ven:
+ *	  - Undefined operation >> 32.
+ *	  - No need to acquire mid-layer lock during command
+ *	    callback. 
+ *	  - Use a per-HBA mid-layer lock.
+ *	  - Use a non-locked cycle for setting the count of the
+ *	    newly allocated sp (qla2x00_get_new_sp()).
+ *	  - Modify semantic behavior of qla2x00_queuecommand():
+ *	    - Reduce cacheline bouncing by having I/Os submitted
+ *	      by the IRQ handler.
+ *	    - Remove extraneous calls to qla2x00_next() during I/O
+ *	      queuing.
+ *	  - Use list_splice_init() during qla2x00_done() handling
+ *	    of commands to reduce list_lock contention.
+ *	  - RIO mode support for ISP2200:
+ *	    - Implementation differs slightly from original patch.
+ *	  - Do not use bottom-half handler (tasklet/work queue)
+ *	    for qla2x00_done() processing.
+ *
+ *  Rev  8.00.00b4-pre22 July 12, 2003		AV
+ *	- Check for 'Process Response Queue' requests early during
+ *	  the Host Status check.
+ *	- General sanitizing:
+ *	  - srb_t structure rewrite, removal of unused members.
+ *	  - Remove unused fcdev array, fabricid, and PORT_*
+ *	    definitions.
+ *	  - Remove unused config_reg_t PCI definitions.
+ *	- Add new 2200 IP firmware (2.02.06).
+ *	- Add new 2300 IPX firmware (3.02.14).
+ *
+ *  Rev  8.00.00b4-pre19 June 30, 2003		AV
+ *	- Resync with Linux Kernel 2.5.73-bk8.
+ *	- Rework IOCB command queuing methods:
+ *	  - Upper-layer driver *MUST* properly set the direction
+ *	    bit of SCSI commands.
+ *	  - Generalize 32bit/64bit queuing path functions.
+ *	  - Remove costly page-boundary cross check when using
+ *	    64bit address capable IOCBs.
+ *
+ *  Rev  8.00.00b4-pre15 June 19, 2003		AV
+ *	- Resync with 6.06.00b11.
+ *	- Continue fcport list consolidation work:
+ *	  - Updated IOCTL implementations to use new fcports 
+ *	    list.
+ *	- Modified product ID check to not verify ISP chip
+ *	  revision -- ISP2312 v3 (qla2x00_chip_diag()).
+ *	- Add new 2300 IPX firmware (3.02.13):
+ *
+ *  Rev  8.00.00b4-pre13 June 19, 2003		AV
+ *	- Fix build process for qla2100 driver -- no support
+ *	  for IP.
+ *	- SCSI host template modifications:
+ *	  - Set sg_tablesize based on the derived DMA mask.
+ *	  - Increase max_sectors since only limit within RISC
+ *	    is transfer of (((2^32) - 1) >> 9) sectors.
+ *
+ *  Rev  8.00.00b4-pre12 June 18, 2003		RA, DG, RL, AV
+ *	- Resync with 6.06.00b10.
+ *	- Resync with Linux Kernel 2.5.72.
+ *	- Initial fcport list consolidation work:
+ *	  - fcports/fcinitiators/fcdev/fc_ip --> ha->fcports
+ *	    list.
+ *
+ *  Rev  8.00.00b4-pre7	 June 05, 2003		AV
+ *	- Properly release PCI resouces in init-failure case.
+ *	- Reconcile disparite function return code definitions.
+ *
+ *  Rev  8.00.00b4-pre4	 June 03, 2003		AV
+ *	- Resync with Linux Kernel 2.5.70-bk8:
+ *	  - SHT proc_info() changes.
+ *	- Restructure SNS Generic Services routines:
+ *	  - Add qla_gs.c file to driver distribution.
+ *	- Configure PCI latency timer for ISP23xx.
+ *
+ *  Rev  8.00.00b4-pre3	 June 02, 2003		RA, DG, RL, AV
+ *	- Resync with 6.06.00b5.
+ *	- Rework (again) PCI I/O space configuration
+ *	  (Anton Blanchard):
+ *	  - Use pci_set_mwi() routine;
+ *	    - Remove uneeded qla2x00_set_cache_line() function.
+ *	  - Remove extraneous modification of PCI_COMMAND word.
+ *
+ *  Rev  8.00.00b3 	 May 29, 2003		AV
+ *	- Resync with Linux Kernel 2.5.70.
+ *	- Move RISC paused check from ISR fast-path.
+ *
+ *  Rev  8.00.00b3-pre8 May 26, 2003		AV
+ *	- Add new 2300 IPX firmware (3.02.12):
+ *	- Rework PCI I/O space configuration.
+ *
+ *  Rev  8.00.00b3-pre6	May 22, 2003		RA, DG, RL, AV
+ *	- Resync with 6.06.00b3.
+ *
+ *  Rev  8.00.00b3-pre4	May 21 2003		AV
+ *	- Add new 2300 IPX firmware (3.02.11):
+ *	  - Remove 2300 TPX firmware from distribution.
+ *
+ *  Rev  8.00.00b3-pre3	May 21 2003		AV
+ *	- Properly setup PCI configuation space during
+ *	  initialization:
+ *	  - Properly configure Memory-Mapped I/O during early
+ *	    configuration stage.
+ *	- Rework IP functionality to support 2k logins.
+ *	- Add new 2300 IPX firmware (3.02.11):
+ *	  - Remove 2300 TPX firmware from distribution.
+ *
+ *  Rev  8.00.00b3-pre2	May ??, 2003		RA, DG, RL, AV
+ *	- Resync with 6.06.00b1.
+ *
+ *  Rev  8.00.00b3-pre1	May ??, 2003		RA, DG, RL, AV
+ *	- Resync with 6.05.00.
+ *
+ *  Rev  8.00.00b2	May 19, 2003		AV
+ *	- Simplify dma_addr_t handling during command queuing given
+ *	  new block-layer defined restrictions:
+ *	  - Physical addresses not spanning 4GB boundaries.
+ *	- Firmware versions: 2100 TP (1.19.24), 2200 IP (2.02.05),
+ *	  2300 TPX (3.02.10).
+ *
+ *  Rev  8.00.00b2-pre1	May 13, 2003		AV
+ *	- Add support for new 'Hotplug initialization' model. 
+ *	- Simplify host template by removing unused callbacks.
+ *	- Use scsicam facilities to determine geometry.
+ *	- Fix compilation issues for non-ISP23xx builds:
+ *	  - Correct register references in qla_dbg.c.
+ *	  - Correct Makefile build process.
+ *
+ *  Rev  8.00.00b1	May 05, 2003		AV
+ *	- Resync with Linux Kernel 2.5.69.
+ *	- Firmware versions: 2100 TP (1.19.24), 2200 TP (2.02.05),
+ *	  2300 TPX (3.02.10).
+ *
+ *  Rev  8.00.00b1-pre45 April ??, 2003		AV
+ *	- Resync with Linux Kernel 2.5.68-bk11:
+ *	- Fix improper return-code assignment during fabric
+ *	  discovery.
+ *	- Remove additional extraneous #defines from
+ *	  qla_settings.h.
+ *	  - USE_PORTNAME -- FO will always use portname.
+ *	- Default queue depth size set to 64.
+ *
+ *  Rev  8.00.00b1-pre42 April ??, 2003		AV
+ *	- Convert bottom-half tasklet to a work_queue.
+ *	- Initial basic coding of dynamic queue depth handling
+ *	  during QUEUE FULL statuses.
+ *	- Fix mailbox interface problem with
+ *	  qla2x00_get_retry_cnt().
+ *
+ *  Rev  8.00.00b1-pre41 April ??, 2003		AV
+ *	- Convert build defines qla2[1|2|3]00 macros to
+ *	  qla2[1|2|3]xx due to module name stringification clashes.
+ *	- Add additional ISP2322 checks during board configuration.
+ *
+ *  Rev  8.00.00b1-pre40 April ??, 2003		AV
+ *	- Resync with Linux Kernel 2.5.68-bk8:
+ *	  - Updated IRQ handler interface.
+ *	- Add ISP dump code (stub) in case of SYSTEM_ERROR on
+ *	  ISP2100.
+ *	- Add new 2200 IP firmware (2.02.05).
+ *
+ *  Rev  8.00.00b1-pre39 April ??, 2003		AV
+ *	- Resync with Linux Kernel 2.5.68.
+ *	- Add simple build.sh script to aid in external compilation.
+ *	- Clean-break with Kernel 2.4 compatibility.
+ *	  - Rework DPC routine -- completion routines for signaling.
+ *	- Re-add HBAAPI character device node for IOCTL support.
+ *	- Remove residual QLA2X_PERFORMANCE defines.
+ *	- Allocate SP pool via __get_free_pages() rather than
+ *	  individual kmalloc()'s.
+ *	- Inform SCSI mid-layer of 16-byte CDB support
+ *	  (host->max_cmd_len):
+ *	  - Remove unecessary 'more_cdb' handling code from
+ *	    qla_iocb.c and qla_xioct.c.
+ *	- Reduce duplicate code in fabric scanning logic (MS IOCB
+ *	  preparation).
+ *	- Add ISP dump code in case of SYSTEM_ERROR.
+ *	- Remove 2300 VIX firmware from distribution:
+ *	  - Add initial code for IPX support.
+ *	- Add new 2300 TPX firmware (3.02.10).
+ *
+ *  Rev  8.00.00b1-pre34 April ??, 2003		AV
+ *	- Resync with Linux Kernel 2.5.67.
+ *	- Use domain/area/al_pa fields when displaying PortID 
+ *	  values -- addresses endianess issues.
+ *	- Rework large case statement to check 'common' CDB commands
+ *	  early in qla2x00_get_cmd_direction().
+ *
+ *  Rev  8.00.00b1-pre31 April ??, 2003		AV
+ *	- Update makefile to support PPC64 build.
+ *	- Retool NVRAM configuration routine and structures:
+ *	  - Consoldate ISP21xx/ISP22xx/ISP23xx configuration
+ *	    (struct nvram_t).
+ *	  - Remove big/little endian support structures in favor of
+ *	    simplified bit-operations within byte fields.
+ *	- Fix long-standing 'static' buffer sharing problem in 
+ *	  qla2x00_configure_fabric().
+ *
+ *  Rev  8.00.00b1-pre30 April ??, 2003		AV
+ *	- Complete implementation of GID_PT scan.
+ *	- Use consistent MS IOCB invocation method to query SNS:
+ *	  - Add RNN_ID and RSNN_NN registrations in a fabric.
+ *	- Remove unused Mailbox Command 6Eh (Send SNS) support
+ *	  structures.
+ *	- Use 64bit safe IOCBs while issuing INQUIRY and RLC during
+ *	  topology scan.
+ *	- Until reimplementation of fcdev_t/fcport list
+ *	  consolidation, valid loop_id ranges are still limited from
+ *	  0x00 through 0xFF -- enforce this within the code.
+ *
+ *  Rev  8.00.00b1-pre27 March ??, 2003		AV
+ *	- Resync with 6.05.00b9.
+ *	- Retool HBA PCI configuration -- qla2x00_pci_config().
+ *	- Remove inconsistent use of delay routines (UDELAY/SYS*).
+ *	- Continue to teardown/clean/add comments and debug
+ *	  routines.
+ *	- Properly swap bytes of the device's nodename in
+ *	  qla2x00_configure_local_loop().
+ *
+ *  Rev  8.00.00b1-pre25 March ??, 2003		AV
+ *	- Resync with 6.05.00b8.
+ *
+ *  Rev  8.00.00b1-pre23 March ??, 2003		AV
+ *	- Remove (#define) IOCB usage throttling.
+ *	- Abstract interrupt polling with qla2x00_poll().
+ *	- Modify lun scanning logic:
+ *	  - If the device does not support the SCSI Report Luns
+ *	    command, the driver will now only scan from 0 to the
+ *	    max#-luns as defined in the NVRAM (BIOS), rather than
+ *	    blindly scanning from 0 to 255 -- which could result in
+ *	    an increase in startup time when running against slow
+ *	    (JBOD) devices.
+ *	- Rework reset logic in qla2x00_reset_chip() (spec).
+ *
+ *  Rev  8.00.00b1-pre22 March ??, 2003		AV
+ *	- Resync with 6.05.00b7.
+ *	- Cleanup (rewrite) ISR handler.
+ *	- Rename kmem_zalloc --> qla2x00_kmem_zalloc():
+ *	  - This function will eventually be removed.
+ *	- Add new 2300 VIX firmware (3.02.09):
+ *	  - Support for Tape, Fabric, 2K logins, IP, and VI.
+ *
+ *  Rev  8.00.00b1-pre18 March ??, 2003		AV
+ *	- Support 232x type ISPs.
+ *	- Support single firmware for each ISP type:
+ *	  - Restructure brd_info/fw_info methods.
+ *	  - Streamline firmware load process.
+ *	  - Properly query firmware for version information.
+ *	- Remove extraneous scsi_qla_host members:
+ *	  - device_id ==> pdev->device
+ *	- Fix fc4 features (RFF_ID) registration.
+ *	- Convert kmem_zalloc --> qla2x00_kmem_zalloc().
+ *	- Remove unused/extraneous #defines (USE_PORTNAME).
+ *
+ *  Rev  8.00.00b1-pre14 March ??, 2003		AV
+ *	- Resync with 6.05.00b6.
+ *	- Initial source-code restructuring effort.
+ *	  - Build procedure.
+ *	  - Source file layout -- intuitive component layout.
+ *	  - Remove unused #defines (*PERFORMANCE, WORD_FW_LOAD, etc).
+ *	- Add support for 2K logins (TPX -- firmware).
+ *	- Add module parameter ql2xsuspendcount.
+ *	- Add new 2200 IP/TP firmware (2.02.04).
+ *
+ *  Rev  8.00.00b1-pre9	March ??, 2003	RL/DG/RA/AV
+ *	- Use kernel struct list_head for fcport and fclun lists.
+ *	- Remove extraneous (L|M)S_64BITS() and QL21_64*() defines.
+ *
+ *  Rev  8.00.00b1-pre8	February 28, 2003	RL/DG/RA/AV
+ *	- Resync with 6.05.00b3.
+ *
+ *  Rev  8.00.00b1-pre7	February 23, 2003	RL/DG/RA/AV
+ *	- Add alternate fabric scanning logic (GID_PT/GNN_ID/GPN_ID).
+ *	- Remove use of deprecated function check_region().
+ *	- Add new 2300 IP/TP firmware (3.02.08).
+ *
+ *  Rev  8.00.00b1-pre5	January 28, 2003	RL/DG/RA/AV
+ *	- Resync with 6.05.00b3.
+ *	- Consolidate device_reg structure definitions for ISP types.
+ *	- Add support for new queue-depth selection.
+ *	- Add new 2300 IP/TP firmware (3.02.07).
+ *
+ *  Rev  8.00.00b1-pre1	January 17, 2003	AV
+ *	- Initial branch from 6.04.00b8 driver.
+ *	- Remove VMWARE specific code.
+ *	- Add support for pci_driver interface.
+ *
+ ********************************************************************/
diff -Nru a/Documentation/sh/kgdb.txt b/Documentation/sh/kgdb.txt
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/sh/kgdb.txt	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,179 @@
+
+This file describes the configuration and behavior of KGDB for the SH
+kernel. Based on a description from Henry Bell <henry.bell@st.com>, it
+has been modified to account for quirks in the current implementation.
+
+Version
+=======
+
+This version of KGDB was written for 2.4.xx kernels for the SH architecture.
+Further documentation is available from the linux-sh project website.
+
+
+Debugging Setup: Host
+======================
+
+The two machines will be connected together via a serial line - this
+should be a null modem cable i.e. with a twist.
+
+On your DEVELOPMENT machine, go to your kernel source directory and
+build the kernel, enabling KGDB support in the "kernel hacking" section.
+This includes the KGDB code, and also makes the kernel be compiled with
+the "-g" option set -- necessary for debugging.
+
+To install this new kernel, use the following installation procedure.
+
+Decide on which tty port you want the machines to communicate, then
+cable them up back-to-back using the null modem.  On the DEVELOPMENT
+machine, you may wish to create an initialization file called .gdbinit
+(in the kernel source directory or in your home directory) to execute 
+commonly-used commands at startup.
+
+A minimal .gdbinit might look like this:
+
+  file vmlinux
+  set remotebaud 115200
+  target remote /dev/ttyS0
+
+Change the "target" definition so that it specifies the tty port that
+you intend to use.  Change the "remotebaud" definition to match the
+data rate that you are going to use for the com line (115200 is the
+default). 
+
+Debugging Setup: Target
+========================
+
+By default, the KGDB stub will communicate with the host GDB using
+ttySC1 at 115200 baud, 8 databits, no parity; these defaults can be
+changed in the kernel configuration. As the kernel starts up, KGDB will
+initialize so that breakpoints, kernel segfaults, and so forth will
+generally enter the debugger.
+
+This behavior can be modified by including the "kgdb" option in the
+kernel command line; this option has the general form:
+
+  kgdb=<ttyspec>,<action>
+
+The <ttyspec> indicates the port to use, and can optionally specify
+baud, parity and databits -- e.g. "ttySC0,9600N8" or "ttySC1,19200".
+
+The <action> can be "halt" or "disabled".  The "halt" action enters the
+debugger via a breakpoint as soon as kgdb is initialized; the "disabled"
+action causes kgdb to ignore kernel segfaults and such until explicitly
+entered by a breakpoint in the code or by external action (sysrq or NMI). 
+
+(Both <ttyspec> and <action> can appear alone, w/o the separating comma.)
+
+For example, if you wish to debug early in kernel startup code, you
+might specify the halt option:
+
+  kgdb=halt
+
+Boot the TARGET machinem, which will appear to hang. 
+
+On your DEVELOPMENT machine, cd to the source directory and run the gdb
+program.  (This is likely to be a cross GDB which runs on your host but
+is built for an SH target.) If everything is working correctly you
+should see gdb print out a few lines indicating that a breakpoint has
+been taken.  It will actually show a line of code in the target kernel
+inside the gdbstub activation code.
+
+NOTE: BE SURE TO TERMINATE OR SUSPEND any other host application which
+may be using the same serial port (for example, a terminal emulator you
+have been using to connect to the target boot code.)  Otherwise, data
+from the target may not all get to GDB!
+
+You can now use whatever gdb commands you like to set breakpoints.
+Enter "continue" to start your target machine executing again.  At this
+point the target system will run at full speed until it encounters
+your breakpoint or gets a segment violation in the kernel, or whatever.
+
+Serial Ports: KGDB, Console
+============================
+
+This version of KGDB may not gracefully handle conflict with other
+drivers in the kernel using the same port. If KGDB is configured on the
+same port (and with the same parameters) as the kernel console, or if
+CONFIG_SH_KGDB_CONSOLE is configured, things should be fine (though in
+some cases console messages may appear twice through GDB).  But if the
+KGDB port is not the kernel console and used by another serial driver
+which assumes different serial parameters (e.g. baud rate) KGDB may not
+recover.
+
+Also, when KGDB is entered via sysrq-g (requires CONFIG_KGDB_SYSRQ) and
+the kgdb port uses the same port as the console, detaching GDB will not
+restore the console to working order without the port being re-opened.
+
+Another serious consequence of this is that GDB currently CANNOT break
+into KGDB externally (e.g. via ^C or <BREAK>); unless a breakpoint or
+error is encountered, the only way to enter KGDB after the initial halt
+(see above) is via NMI (CONFIG_KGDB_NMI) or sysrq-g (CONFIG_KGDB_SYSRQ).
+
+Code is included for the basic Hitachi Solution Engine boards to allow
+the use of ttyS0 for KGDB if desired; this is less robust, but may be
+useful in some cases.  (This cannot be selected using the config file, 
+but only through the kernel command line, e.g. "kgdb=ttyS0", though the
+configured defaults for baud rate etc. still apply if not overridden.)
+
+If gdbstub Does Not Work
+========================
+
+If it doesn't work, you will have to troubleshoot it.  Do the easy
+things first like double checking your cabling and data rates.  You
+might try some non-kernel based programs to see if the back-to-back
+connection works properly.  Just something simple like cat /etc/hosts
+/dev/ttyS0 on one machine and cat /dev/ttyS0 on the other will tell you
+if you can send data from one machine to the other.  There is no point
+in tearing out your hair in the kernel if the line doesn't work.
+
+If you need to debug the GDB/KGDB communication itself, the gdb commands
+"set debug remote 1" and "set debug serial 1" may be useful, but be
+warned: they produce a lot of output.
+
+Threads
+=======
+
+Each process in a target machine is seen as a gdb thread. gdb thread related
+commands (info threads, thread n) can be used. CONFIG_KGDB_THREAD must
+be defined for this to work.
+
+In this version, kgdb reports PID_MAX (32768) as the process ID for the
+idle process (pid 0), since GDB does not accept 0 as an ID.
+
+Detaching (exiting KGDB)
+=========================
+
+There are two ways to resume full-speed target execution: "continue" and
+"detach". With "continue", GDB inserts any specified breakpoints in the
+target code and resumes execution; the target is still in "gdb mode".
+If a breakpoint or other debug event (e.g. NMI) happens, the target
+halts and communicates with GDB again, which is waiting for it.
+
+With "detach", GDB does *not* insert any breakpoints; target execution
+is resumed and GDB stops communicating (does not wait for the target).
+In this case, the target is no longer in "gdb mode" -- for example,
+console messages no longer get sent separately to the KGDB port, or
+encapsulated for GDB.  If a debug event (e.g. NMI) occurs, the target
+will re-enter "gdb mode" and will display this fact on the console; you
+must give a new "target remote" command to gdb.
+
+NOTE: TO AVOID LOSSING CONSOLE MESSAGES IN CASE THE KERNEL CONSOLE AND
+KGDB USING THE SAME PORT, THE TARGET WAITS FOR ANY INPUT CHARACTER ON
+THE KGDB PORT AFTER A DETACH COMMAND.  For example, after the detach you
+could start a terminal emulator on the same host port and enter a <cr>;
+however, this program must then be terminated or suspended in order to
+use GBD again if KGDB is re-entered.
+
+
+Acknowledgements
+================
+
+This code was mostly generated by Henry Bell <henry.bell@st.com>;
+largely from KGDB by Amit S. Kale <akale@veritas.com> - extracts from
+code by Glenn Engel, Jim Kingdon, David Grothe <dave@gcom.com>, Tigran
+Aivazian <tigran@sco.com>, William Gatliff <bgat@open-widgets.com>, Ben
+Lee, Steve Chamberlain and Benoit Miller <fulg@iname.com> are also
+included. 
+
+Jeremy Siegel
+<jsiegel@mvista.com>
diff -Nru a/Documentation/sh/new-machine.txt b/Documentation/sh/new-machine.txt
--- a/Documentation/sh/new-machine.txt	Tue Feb  3 19:45:33 2004
+++ b/Documentation/sh/new-machine.txt	Tue Feb  3 19:45:33 2004
@@ -1,6 +1,162 @@
-The multiple machine support relies on redirecting all functions which will
-need to be machine specific through a table of function pointers, the
-machvec. These functions fall into a number of categories:
+
+                Adding a new board to LinuxSH
+               ================================
+
+               Paul Mundt <lethal@linux-sh.org>
+
+This document attempts to outline what steps are necessary to add support
+for new boards to the LinuxSH port under the new 2.5 and 2.6 kernels. This
+also attempts to outline some of the noticeable changes between the 2.4
+and the 2.5/2.6 SH backend.
+
+1. New Directory Structure
+==========================
+
+The first thing to note is the new directory structure. Under 2.4, most
+of the board-specific code (with the exception of stboards) ended up
+in arch/sh/kernel/ directly, with board-specific headers ending up in
+include/asm-sh/. For the new kernel, things are broken out by board type,
+companion chip type, and CPU type. Looking at a tree view of this directory
+heirarchy looks like the following:
+
+Board-specific code:
+
+.
+|-- arch
+|   `-- sh
+|       `-- boards
+|           |-- adx
+|           |   `-- board-specific files
+|           |-- bigsur
+|           |   `-- board-specific files
+|           |
+|           ... more boards here ...
+|
+`-- include
+    `-- asm-sh
+        |-- adx
+        |   `-- board-specific headers
+        |-- bigsur
+        |   `-- board-specific headers
+        |
+	.. more boards here ...
+
+It should also be noted that each board is required to have some certain
+headers. At the time of this writing, io.h is the only thing that needs
+to be provided for each board, and can generally just reference generic
+functions (with the exception of isa_port2addr).
+
+Next, for companion chips:
+.
+`-- arch
+    `-- sh
+        `-- cchips
+            `-- hd6446x
+                |-- hd64461
+                |   `-- cchip-specific files
+                `-- hd64465
+                    `-- cchip-specific files
+
+... and so on. Headers for the companion chips are treated the same way as
+board-specific headers. Thus, include/asm-sh/hd64461 is home to all of the
+hd64461-specific headers.
+
+Finally, CPU family support is also abstracted:
+.
+|-- arch
+|   `-- sh
+|       |-- kernel
+|       |   `-- cpu
+|       |       |-- sh2
+|       |       |   `-- SH-2 generic files
+|       |       |-- sh3
+|       |       |   `-- SH-3 generic files
+|       |       `-- sh4
+|       |           `-- SH-4 generic files
+|       `-- mm
+|           `-- This is also broken out per CPU family, so each family can
+|               have their own set of cache/tlb functions.
+|
+`-- include
+    `-- asm-sh
+        |-- cpu-sh2
+        |   `-- SH-2 specific headers
+        |-- cpu-sh3
+        |   `-- SH-3 specific headers
+        `-- cpu-sh4
+            `-- SH-4 specific headers
+
+It should be noted that CPU subtypes are _not_ abstracted. Thus, these still
+need to be dealt with by the CPU family specific code.
+
+2. Adding a New Board
+=====================
+
+The first thing to determine is whether the board you are adding will be
+isolated, or whether it will be part of a family of boards that can mostly
+share the same board-specific code with minor differences.
+
+In the first case, this is just a matter of making a directory for your
+board in arch/sh/boards/ and adding rules to hook your board in with the
+build system (more on this in the next section). However, for board families
+it makes more sense to have a common top-level arch/sh/boards/ directory
+and then populate that with sub-directories for each member of the family.
+Both the Solution Engine and the hp6xx boards are an example of this.
+
+After you have setup your new arch/sh/boards/ directory, remember that you
+also must add a directory in include/asm-sh for headers localized to this
+board. In order to interoperate seamlessly with the build system, it's best
+to have this directory the same as the arch/sh/boards/ directory name,
+though if your board is again part of a family, the build system has ways
+of dealing with this, and you can feel free to name the directory after
+the family member itself.
+
+There are a few things that each board is required to have, both in the
+arch/sh/boards and the include/asm-sh/ heirarchy. In order to better
+explain this, we use some examples for adding an imaginary board. For
+setup code, we're required at the very least to provide definitions for
+get_system_type() and platform_setup(). For our imaginary board, this
+might look something like:
+
+/*
+ * arch/sh/boards/vapor/setup.c - Setup code for imaginary board
+ */
+#include <linux/init.h>
+
+const char *get_system_type(void)
+{
+	return "FooTech Vaporboard";
+}
+
+int __init platform_setup(void)
+{
+  	/*
+	 * If our hardware actually existed, we would do real
+	 * setup here. Though it's also sane to leave this empty
+	 * if there's no real init work that has to be done for
+	 * this board.
+	 */
+
+  	/* 
+	 * Presume all FooTech boards have the same broken timer,
+	 * and also presume that we've defined foo_timer_init to
+	 * do something useful.
+	 */
+  	board_time_init = foo_timer_init;
+
+	/* Start-up imaginary PCI ... */
+
+	/* And whatever else ... */
+
+	return 0;
+}
+
+Our new imaginary board will also have to tie into the machvec in order for it
+to be of any use. Currently the machvec is slowly on its way out, but is still
+required for the time being. As such, let us take a look at what needs to be
+done for the machvec assignment.
+
+machvec functions fall into a number of categories:
 
  - I/O functions to IO memory (inb etc) and PCI/main memory (readb etc).
  - I/O remapping functions (ioremap etc)
@@ -27,16 +183,16 @@
    can be read from/written to directly.
 
 Thus adding a new machine involves the following steps (I will assume I am
-adding a machine called fred):
+adding a machine called vapor):
 
- - add a new file include/asm-sh/io_fred.h which contains prototypes for
+ - add a new file include/asm-sh/vapor/io.h which contains prototypes for
    any machine specific IO functions prefixed with the machine name, for
-   example fred_inb. These will be needed when filling out the machine
+   example vapor_inb. These will be needed when filling out the machine
    vector. In addition, a section is required which defines what to do when
    building a machine specific version. For example:
 
      #ifdef __WANT_IO_DEF
-     #define inb  fred_inb
+     #define inb  vapor_inb
      ...
      #endif
 
@@ -47,18 +203,18 @@
    functions will still be needed, so that a module built for a generic
    setup can be loaded.
 
- - add a new file arch/sh/kernel/mach_fred.c. This contains the definition
+ - add a new file arch/sh/boards/vapor/mach.c. This contains the definition
    of the machine vector. When building the machine specific version, this
    will be the real machine vector (via an alias), while in the generic
    version is used to initialise the machine vector, and then freed, by
    making it initdata. This should be defined as:
 
-     struct sh_machine_vector mv_fred __initmv = {
-       mv_name: "Fred"
+     struct sh_machine_vector mv_vapor __initmv = {
+       .mv_name = "vapor",
      }
-     ALIAS_MV(se)
+     ALIAS_MV(vapor)
 
- - finally add a file arch/sh/kernel/io_fred.c, which contains
+ - finally add a file arch/sh/boards/vapor/io.c, which contains
    definitions of the machine specific io functions.
 
 A note about initialisation functions. Three initialisation functions are
@@ -75,3 +231,82 @@
 so a flag can be added to the machine vector which will be set on those
 machines which have the hardware in question, reducing the probe to a
 single conditional.
+
+3. Hooking into the Build System
+================================
+
+Now that we have the corresponding directories setup, and all of the
+board-specific code is in place, it's time to look at how to get the
+whole mess to fit into the build system.
+
+Large portions of the build system are now entirely dynamic, and merely
+require the proper entry here and there in order to get things done.
+
+The first thing to do is to add an entry to arch/sh/Kconfig, under the
+"System type" menu:
+
+config SH_VAPOR
+	bool "Vapor"
+	help
+	  select Vapor if configuring for a FooTech Vaporboard.
+
+next, this has to be added into arch/sh/Makefile. All boards require a
+machdir-y entry in order to be built. This entry needs to be the name of
+the board directory as it appears in arch/sh/boards, even if it is in a
+sub-directory (in which case, all parent directories below arch/sh/boards/
+need to be listed). For our new board, this entry can look like:
+
+machdir-$(CONFIG_SH_VAPOR)	+= vapor
+
+provided that we've placed everything in the arch/sh/boards/vapor/ directory.
+
+Next, the build system assumes that your include/asm-sh directory will also
+be named the same. If this is not the case (as is the case with multiple
+boards belonging to a common family), then the directory name needs to be
+implicitly appended to incdir-y. The existing code manages this for the
+Solution Engine and hp6xx boards, so see these for an example.
+
+Once that is taken care of, it's time to add an entry for the mach type.
+This is done by adding an entry to the end of the arch/sh/tools/mach-types
+list. The method for doing this is self explanatory, and so we won't waste
+space restating it here. After this is done, you will be able to use
+implicit checks for your board if you need this somewhere throughout the
+common code, such as:
+
+	/* Make sure we're on the FooTech Vaporboard */
+	if (!mach_is_vapor())
+		return -ENODEV;
+
+also note that the mach_is_boardname() check will be implicitly forced to
+lowercase, regardless of the fact that the mach-types entries are all
+uppercase. You can read the script if you really care, but it's pretty ugly,
+so you probably don't want to do that.
+
+Now all that's left to do is providing a defconfig for your new board. This
+way, other people who end up with this board can simply use this config
+for reference instead of trying to guess what settings are supposed to be
+used on it.
+
+Also, as soon as you have copied over a sample .config for your new board
+(assume arch/sh/configs/defconfig-vapor), you can also use this directly as a
+build target, and it will be implicitly listed as such in the help text.
+
+Looking at the 'make help' output, you should now see something like:
+
+Architecture specific targets (sh):
+  zImage                  - Compressed kernel image (arch/sh/boot/zImage)
+  defconfig-adx           - Build for adx
+  defconfig-cqreek        - Build for cqreek
+  defconfig-dreamcast     - Build for dreamcast
+...
+  defconfig-vapor         - Build for vapor
+
+which then allows you to do:
+
+$ make ARCH=sh CROSS_COMPILE=sh4-linux- defconfig-vapor vmlinux
+
+which will in turn copy the defconfig for this board, run it through
+oldconfig (prompting you for any new options since the time of creation),
+and start you on your way to having a functional kernel for your new
+board.
+
diff -Nru a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
--- a/Documentation/sysctl/kernel.txt	Tue Feb  3 19:45:28 2004
+++ b/Documentation/sysctl/kernel.txt	Tue Feb  3 19:45:28 2004
@@ -251,6 +251,25 @@
 
 ==============================================================
 
+printk_ratelimit:
+
+Some warning messages are rate limited. printk_ratelimit specifies
+the minimum length of time between these messages, by default we
+allow one every 5 seconds.
+
+A value of 0 will disable rate limiting.
+
+==============================================================
+
+printk_ratelimit_burst:
+
+While long term we enforce one message per printk_ratelimit
+seconds, we do allow a burst of messages to pass through.
+printk_ratelimit_burst specifies the number of messages we can
+send before ratelimiting kicks in.
+
+==============================================================
+
 reboot-cmd: (Sparc only)
 
 ??? This seems to be a way to give an argument to the Sparc
diff -Nru a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
--- a/Documentation/sysctl/vm.txt	Tue Feb  3 19:45:35 2004
+++ b/Documentation/sysctl/vm.txt	Tue Feb  3 19:45:35 2004
@@ -53,7 +53,7 @@
 The default value is 0.
 
 See Documentation/vm/overcommit-accounting and
-mm/mmap.c::vm_enough_memory() for more information.
+security/commoncap.c::cap_vm_enough_memory() for more information.
 
 ==============================================================
 
diff -Nru a/Documentation/usb/w9968cf.txt b/Documentation/usb/w9968cf.txt
--- a/Documentation/usb/w9968cf.txt	Tue Feb  3 19:45:34 2004
+++ b/Documentation/usb/w9968cf.txt	Tue Feb  3 19:45:34 2004
@@ -1,6 +1,7 @@
 
-         W996[87]CF JPEG USB Dual Mode Camera Chip driver for Linux 2.6
-         ==============================================================
+                   W996[87]CF JPEG USB Dual Mode Camera Chip 
+                     Driver for Linux 2.6 (basic version)
+                   =========================================
 
                                - Documentation -
 
@@ -11,15 +12,16 @@
 2. License
 3. Overview
 4. Supported devices
-5. Kernel configuration and third-part module compilation
+5. Module dependencies
 6. Module loading
 7. Module paramaters
-8. Credits
+8. Contact information
+9. Credits
 
 
 1. Copyright
 ============
-Copyright (C) 2002 2003 by Luca Risolia <luca_ing@libero.it>
+Copyright (C) 2002-2004 by Luca Risolia <luca.risolia@studio.unibo.it>
 
 
 2. License
@@ -43,23 +45,25 @@
 ===========
 This driver supports the video streaming capabilities of the devices mounting
 Winbond W9967CF and Winbond W9968CF JPEG USB Dual Mode Camera Chips, when they
-are being commanded by USB.
+are being commanded by USB. OV681 based cameras should be supported as well.
 
-The driver relies on the Video4Linux, USB and I2C core modules of the Linux
-kernel, version 2.6.0 or greater, and is not compatible in any way with
-previous versions. It has been designed to run properly on SMP systems
-as well. At the moment, an additional module, "ovcamchip", is mandatory; it
-provides support for some OmniVision CMOS sensors connected to the W996[87]CF
-chips.
-
-The driver is split into two modules: the basic one, "w9968cf", is needed for
+The driver is divided into two modules: the basic one, "w9968cf", is needed for
 the supported devices to work; the second one, "w9968cf-vpp", is an optional
 module, which provides some useful video post-processing functions like video
-decoding, up-scaling and colour conversions. These routines can't be included
-into official kernels for performance purposes. Once the driver is installed,
+decoding, up-scaling and colour conversions. Once the driver is installed,
 every time an application tries to open a recognized device, "w9968cf" checks
 the presence of the "w9968cf-vpp" module and loads it automatically by default.
 
+Please keep in mind that official kernels do NOT include the second module for
+performance purposes. However it is always recommended to download and install
+the latest and complete release of the driver, replacing the existing one, if
+present: it will be still even possible not to load the "w9968cf-vpp" module at
+all, if you ever want to.
+
+The latest and full-featured version of the W996[87]CF driver can be found at:
+http://go.lamarinapunto.com/ . Please refer to the documentation included in
+that package, if you are going to use it.
+
 Up to 32 cameras can be handled at the same time. They can be connected and
 disconnected from the host many times without turning off the computer, if
 your system supports the hotplug facility.
@@ -67,18 +71,21 @@
 To change the default settings for each camera, many paramaters can be passed
 through command line when the module is loaded into memory.
 
-The latest and full featured version of the W996[87]CF driver can be found at:
-http://go.lamarinapunto.com/
+The driver relies on the Video4Linux, USB and I2C core modules of the official
+Linux kernels. It has been designed to run properly on SMP systems as well.
+At the moment, an additional module, "ovcamchip", is mandatory; it provides
+support for some OmniVision CMOS sensors connected to the W996[87]CF chips.
 
-The "ovcamchip" module is part of the OV511 driver, version 2.25, which can be
+The "ovcamchip" module is part of the OV511 driver, version 2.27, which can be
 downloaded from internet:
 http://alpha.dyndns.org/ov511/
-To know how to patch, compile and load it, read the paragraphs below.
+To know how to compile it, read the documentation included in the OV511 
+package.
 
 
 4. Supported devices
 ====================
-At the moment, known W996[87]CF based devices are:
+At the moment, known W996[87]CF and OV681 based devices are:
 - Aroma Digi Pen ADG-5000 Refurbished
 - AVerTV USB
 - Creative Labs Video Blaster WebCam Go
@@ -87,27 +94,26 @@
 - Ezonics EZ-802 EZMega Cam
 - OPCOM Digi Pen VGA Dual Mode Pen Camera
 
-If you know any other W996[87]CF based cameras, please contact me.
+If you know any other W996[87]CF or OV681 based cameras, please contact me.
 
 The list above does NOT imply that all those devices work with this driver: up
 until now only webcams that have a CMOS sensor supported by the "ovcamchip"
 module work. 
-For a list of supported CMOS sensors, please visit the module author homepage:
-http://alpha.dyndns.org/ov511/
+For a list of supported CMOS sensors, please visit the author's homepage on
+this module: http://alpha.dyndns.org/ov511/
 
 Possible external microcontrollers of those webcams are not supported: this
-means that still images can't be downloaded from the device memory.
+means that still images cannot be downloaded from the device memory.
 
 Furthermore, it's worth to note that I was only able to run tests on my
 "Creative Labs Video Blaster WebCam Go". Donations of other models, for
 additional testing and full support, would be much appreciated.
 
 
-5. Kernel configuration and third-part module compilation
-=========================================================
-As noted above, kernel 2.6.0 is the minimum for this driver; for it to work
-properly, the driver needs kernel support for Video4Linux, USB and I2C, and a
-third-part module for the CMOS sensor.
+5. Module dependencies
+======================
+For it to work properly, the driver needs kernel support for Video4Linux, 
+USB and I2C, and a third-party module for the CMOS sensor.
 
 The following options of the kernel configuration file must be enabled and
 corresponding modules must be compiled:
@@ -126,7 +132,7 @@
 	#
 	CONFIG_USB=m
 
-In addition, depending on the hardware being used, just one of the modules
+In addition, depending on the hardware being used, only one of the modules
 below is necessary:
 
 	# USB Host Controller Drivers
@@ -137,31 +143,16 @@
 
 Also, make sure "Enforce bandwidth allocation" is NOT enabled.
 
+And finally:
+
 	# USB Multimedia devices
 	#
 	CONFIG_USB_W9968CF=m
 
 The last module we need is "ovcamchip.o". To obtain it, you have to download
-the OV511 driver, version 2.25 - don't use other versions - which is available
-at http://alpha.dyndns.org/ov511/ . Then you have to download the latest 
-version of the full featured W996[87]CF driver, which contains a patch for the
-"ovcamchip" module; it is available at http://go.lamarinapunto.com .
-Once you have obtained the packages, decompress, patch and compile the 
-"ovcamchip" module. In other words:
-
-	[user@localhost home]$ tar xvzf w9968cf-x.x.tar.gz
-	[user@localhost home]$ tar xvjf ov511-2.25.tar.bz2
-	[user@localhost home]$ cd ov511-2.25
-	[user@localhost ov511-2.25]$ patch -p1 <                              \
-	                             /path/to/w9968cf-x.x/ov511-2.25.patch
-	[user@localhost ov511-2.25]$ make
-
-It's worth to note that the full featured version of the W996[87]CF driver
-can also be installed overwriting the one in the kernel; in this case, read the
-documentation included in the package.
-
-If everything went well, the W996[87]CF driver can be immediatly used (see next
-paragraph).
+the OV511 package, version 2.27 - don't use other versions - and compile it
+according to its documentation. 
+The package is available at http://alpha.dyndns.org/ov511/ .
 
 
 6. Module loading
@@ -169,7 +160,7 @@
 To use the driver, it is necessary to load the "w9968cf" module into memory
 after every other module required.
 
-For example, loading can be done this way, as root:
+Loading can be done this way, from root:
 
 	[root@localhost home]# modprobe usbcore
 	[root@localhost home]# modprobe i2c-core
@@ -191,11 +182,10 @@
 
 7. Module paramaters
 ====================
-
 Module paramaters are listed below:
 -------------------------------------------------------------------------------
 Name:           vppmod_load
-Type:           int
+Type:           bool
 Syntax:         <0|1>
 Description:    Automatic 'w9968cf-vpp' module loading: 0 disabled, 1 enabled.
                 If enabled, every time an application attempts to open a
@@ -219,7 +209,7 @@
 Description:    Specify V4L minor mode number.
                 -1 = use next available
                  n = use minor number n
-                You can specify 32 cameras this way.
+                You can specify up to 32 cameras this way.
                 For example:
                 video_nr=-1,2,-1 would assign minor number 2 to the second
                 recognized camera and use auto for the first one and for every
@@ -236,22 +226,22 @@
 Name:           max_buffers
 Type:           int array (min = 0, max = 32)
 Syntax:         <n[,...]>
-Description:    Only for advanced users.
+Description:    For advanced users.
                 Specify the maximum number of video frame buffers to allocate
                 for each device, from 2 to 32.
 Default:        2
 -------------------------------------------------------------------------------
 Name:           double_buffer
-Type:           int array (min = 0, max = 32)
+Type:           bool array (min = 0, max = 32)
 Syntax:         <0|1[,...]> 
 Description:    Hardware double buffering: 0 disabled, 1 enabled.
                 It should be enabled if you want smooth video output: if you
-                obtain out of sync. video, disable it at all, or try to
+                obtain out of sync. video, disable it, or try to
                 decrease the 'clockdiv' module paramater value.
 Default:        1 for every device.
 -------------------------------------------------------------------------------
 Name:           clamping
-Type:           int array (min = 0, max = 32)
+Type:           bool array (min = 0, max = 32)
 Syntax:         <0|1[,...]> 
 Description:    Video data clamping: 0 disabled, 1 enabled.
 Default:        0 for every device.
@@ -266,13 +256,13 @@
 Default:        0 for every device.
 -------------------------------------------------------------------------------
 Name:           largeview
-Type:           int array (min = 0, max = 32)
+Type:           bool array (min = 0, max = 32)
 Syntax:         <0|1[,...]> 
 Description:    Large view: 0 disabled, 1 enabled.
 Default:        1 for every device.
 -------------------------------------------------------------------------------
 Name:           upscaling
-Type:           int array (min = 0, max = 32)
+Type:           bool array (min = 0, max = 32)
 Syntax:         <0|1[,...]> 
 Description:    Software scaling (for non-compressed video only):
                 0 disabled, 1 enabled.
@@ -319,7 +309,7 @@
 Note:           If 'w9968cf-vpp' is not loaded, this paramater is set to 9.
 -------------------------------------------------------------------------------
 Name:           force_rgb
-Type:           int array (min = 0, max = 32)
+Type:           bool array (min = 0, max = 32)
 Syntax:         <0|1[,...]>
 Description:    Read RGB video data instead of BGR:
                 1 = use RGB component ordering.
@@ -328,28 +318,28 @@
 Default:        0 for every device.
 -------------------------------------------------------------------------------
 Name:           autobright
-Type:           long array (min = 0, max = 32)
+Type:           bool array (min = 0, max = 32)
 Syntax:         <0|1[,...]>
 Description:    CMOS sensor automatically changes brightness:
                 0 = no, 1 = yes
 Default:        0 for every device.
 -------------------------------------------------------------------------------
 Name:           autoexp
-Type:           long array (min = 0, max = 32)
+Type:           bool array (min = 0, max = 32)
 Syntax:         <0|1[,...]>
 Description:    CMOS sensor automatically changes exposure:
                 0 = no, 1 = yes
 Default:        1 for every device.
 -------------------------------------------------------------------------------
 Name:           lightfreq
-Type:           long array (min = 0, max = 32)
+Type:           int array (min = 0, max = 32)
 Syntax:         <50|60[,...]>
 Description:    Light frequency in Hz:
                 50 for European and Asian lighting, 60 for American lighting.
 Default:        50 for every device.
 -------------------------------------------------------------------------------
 Name:           bandingfilter
-Type:           long array (min = 0, max = 32)
+Type:           bool array (min = 0, max = 32)
 Syntax:         <0|1[,...]> 
 Description:    Banding filter to reduce effects of fluorescent 
                 lighting:
@@ -359,7 +349,7 @@
 Default:        0 for every device.
 -------------------------------------------------------------------------------
 Name:           clockdiv
-Type:           long array (min = 0, max = 32)
+Type:           int array (min = 0, max = 32)
 Syntax:         <-1|n[,...]>
 Description:    Force pixel clock divisor to a specific value (for experts):
                 n may vary from 0 to 127.
@@ -368,21 +358,21 @@
 Default:        -1 for every device.
 -------------------------------------------------------------------------------
 Name:           backlight
-Type:           long array (min = 0, max = 32)
+Type:           bool array (min = 0, max = 32)
 Syntax:         <0|1[,...]>
 Description:    Objects are lit from behind:
                 0 = no, 1 = yes
 Default:        0 for every device.
 -------------------------------------------------------------------------------
 Name:           mirror
-Type:           long array (min = 0, max = 32)
+Type:           bool array (min = 0, max = 32)
 Syntax:         <0|1[,...]>
 Description:    Reverse image horizontally:
                 0 = no, 1 = yes
 Default:        0 for every device.
 -------------------------------------------------------------------------------
-Name:           sensor_mono
-Type:           long array (min = 0, max = 32)
+Name:           monochrome
+Type:           bool array (min = 0, max = 32)
 Syntax:         <0|1[,...]> 
 Description:    The CMOS sensor is monochrome:
                 0 = no, 1 = yes
@@ -423,7 +413,7 @@
 Type:           int
 Syntax:         <n> 
 Description:    Debugging information level, from 0 to 6:
-                0 = none (be cautious)
+                0 = none (use carefully)
                 1 = critical errors
                 2 = significant informations
                 3 = configuration or general messages
@@ -435,7 +425,7 @@
 Default:        2
 -------------------------------------------------------------------------------
 Name:           specific_debug
-Type:           int
+Type:           bool
 Syntax:         <0|1>
 Description:    Enable or disable specific debugging messages:
                 0 = print messages concerning every level <= 'debug' level.
@@ -444,7 +434,16 @@
 -------------------------------------------------------------------------------
 
 
-8. Credits
+8. Contact information
+======================
+I may be contacted by e-mail at <luca.risolia@studio.unibo.it>.
+
+I can accept GPG/PGP encrypted e-mail. My GPG key ID is 'FCE635A4'.
+My public 1024-bit key should be available at your keyserver; the fingerprint
+is: '88E8 F32F 7244 68BA 3958  5D40 99DA 5D2A FCE6 35A4'.
+
+
+9. Credits
 ==========
 The development would not have proceed much further without having looked at
 the source code of other drivers and without the help of several persons; in
@@ -456,8 +455,6 @@
 - memory management code has been copied from the bttv driver by Ralph Metzler,
   Marcus Metzler and Gerd Knorr;
 
-- the low-level I2C read function has been written by FrÃ©dÃ©ric Jouault, who
-  also gave me commented logs about sniffed USB traffic taken from another
-  driver for another system;
+- the low-level I2C read function has been written by Frederic Jouault;
 
-- the low-level I2C fast write function has been written by Piotr Czerczak;
+- the low-level I2C fast write function has been written by Piotr Czerczak.
diff -Nru a/Documentation/video4linux/CARDLIST.bttv b/Documentation/video4linux/CARDLIST.bttv
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/video4linux/CARDLIST.bttv	Tue Feb  3 19:45:16 2004
@@ -0,0 +1,115 @@
+card=0 -  *** UNKNOWN/GENERIC *** 
+card=1 - MIRO PCTV
+card=2 - Hauppauge (bt848)
+card=3 - STB, Gateway P/N 6000699 (bt848)
+card=4 - Intel Create and Share PCI/ Smart Video Recorder III
+card=5 - Diamond DTV2000
+card=6 - AVerMedia TVPhone
+card=7 - MATRIX-Vision MV-Delta
+card=8 - Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26
+card=9 - IMS/IXmicro TurboTV
+card=10 - Hauppauge (bt878)
+card=11 - MIRO PCTV pro
+card=12 - ADS Technologies Channel Surfer TV (bt848)
+card=13 - AVerMedia TVCapture 98
+card=14 - Aimslab Video Highway Xtreme (VHX)
+card=15 - Zoltrix TV-Max
+card=16 - Prolink Pixelview PlayTV (bt878)
+card=17 - Leadtek WinView 601
+card=18 - AVEC Intercapture
+card=19 - Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)
+card=20 - CEI Raffles Card
+card=21 - Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50
+card=22 - Askey CPH050/ Phoebe Tv Master + FM
+card=23 - Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878
+card=24 - Askey CPH05X/06X (bt878) [many vendors]
+card=25 - Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar
+card=26 - Hauppauge WinCam newer (bt878)
+card=27 - Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50
+card=28 - Terratec TerraTV+ Version 1.1 (bt878)
+card=29 - Imagenation PXC200
+card=30 - Lifeview FlyVideo 98 LR50
+card=31 - Formac iProTV, Formac ProTV I (bt848)
+card=32 - Intel Create and Share PCI/ Smart Video Recorder III
+card=33 - Terratec TerraTValue Version Bt878
+card=34 - Leadtek WinFast 2000/ WinFast 2000 XP
+card=35 - Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II
+card=36 - Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner
+card=37 - Prolink PixelView PlayTV pro
+card=38 - Askey CPH06X TView99
+card=39 - Pinnacle PCTV Studio/Rave
+card=40 - STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100
+card=41 - AVerMedia TVPhone 98
+card=42 - ProVideo PV951
+card=43 - Little OnAir TV
+card=44 - Sigma TVII-FM
+card=45 - MATRIX-Vision MV-Delta 2
+card=46 - Zoltrix Genie TV/FM
+card=47 - Terratec TV/Radio+
+card=48 - Askey CPH03x/ Dynalink Magic TView
+card=49 - IODATA GV-BCTV3/PCI
+card=50 - Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP
+card=51 - Eagle Wireless Capricorn2 (bt878A)
+card=52 - Pinnacle PCTV Studio Pro
+card=53 - Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS
+card=54 - Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]
+card=55 - Askey CPH031/ BESTBUY Easy TV
+card=56 - Lifeview FlyVideo 98FM LR50
+card=57 - GrandTec 'Grand Video Capture' (Bt848)
+card=58 - Askey CPH060/ Phoebe TV Master Only (No FM)
+card=59 - Askey CPH03x TV Capturer
+card=60 - Modular Technology MM100PCTV
+card=61 - AG Electronics GMV1
+card=62 - Askey CPH061/ BESTBUY Easy TV (bt878)
+card=63 - ATI TV-Wonder
+card=64 - ATI TV-Wonder VE
+card=65 - Lifeview FlyVideo 2000S LR90
+card=66 - Terratec TValueRadio
+card=67 - IODATA GV-BCTV4/PCI
+card=68 - 3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA)
+card=69 - Active Imaging AIMMS
+card=70 - Prolink Pixelview PV-BT878P+ (Rev.4C,8E)
+card=71 - Lifeview FlyVideo 98EZ (capture only) LR51
+card=72 - Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)
+card=73 - Sensoray 311
+card=74 - RemoteVision MX (RV605)
+card=75 - Powercolor MTV878/ MTV878R/ MTV878F
+card=76 - Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)
+card=77 - GrandTec Multi Capture Card (Bt878)
+card=78 - Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF
+card=79 - DSP Design TCVIDEO
+card=80 - Hauppauge WinTV PVR
+card=81 - IODATA GV-BCTV5/PCI
+card=82 - Osprey 100/150 (878)
+card=83 - Osprey 100/150 (848)
+card=84 - Osprey 101 (848)
+card=85 - Osprey 101/151
+card=86 - Osprey 101/151 w/ svid
+card=87 - Osprey 200/201/250/251
+card=88 - Osprey 200/250
+card=89 - Osprey 210/220
+card=90 - Osprey 500
+card=91 - Osprey 540
+card=92 - Osprey 2000
+card=93 - IDS Eagle
+card=94 - Pinnacle PCTV Sat
+card=95 - Formac ProTV II (bt878)
+card=96 - MachTV
+card=97 - Euresys Picolo
+card=98 - ProVideo PV150
+card=99 - AD-TVK503
+card=100 - Hercules Smart TV Stereo
+card=101 - Pace TV & Radio Card
+card=102 - IVC-200
+card=103 - Grand X-Guard / Trust 814PCI
+card=104 - Nebula Electronics DigiTV
+card=105 - ProVideo PV143
+card=106 - PHYTEC VD-009-X1 MiniDIN (bt878)
+card=107 - PHYTEC VD-009-X1 Combi (bt878)
+card=108 - PHYTEC VD-009 MiniDIN (bt878)
+card=109 - PHYTEC VD-009 Combi (bt878)
+card=110 - IVC-100
+card=111 - IVC-120G
+card=112 - pcHDTV HD-2000 TV
+card=113 - Twinhan DST + clones
+card=114 - Winfast VC100
diff -Nru a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/video4linux/CARDLIST.saa7134	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,23 @@
+  0 -> UNKNOWN/GENERIC                         
+  1 -> Proteus Pro [philips reference design]   [1131:2001,1131:2001]
+  2 -> LifeView FlyVIDEO3000                    [5168:0138]
+  3 -> LifeView FlyVIDEO2000                    [5168:0138]
+  4 -> EMPRESS                                  [1131:6752]
+  5 -> SKNet Monster TV                         [1131:4e85]
+  6 -> Tevion MD 9717                          
+  7 -> KNC One TV-Station RDS / Typhoon TV+Radio 90031 [1131:fe01]
+  8 -> Terratec Cinergy 400 TV                  [153B:1142]
+  9 -> Medion 5044                             
+ 10 -> Kworld/KuroutoShikou SAA7130-TVPCI      
+ 11 -> Terratec Cinergy 600 TV                  [153B:1143]
+ 12 -> Medion 7134                              [16be:0003]
+ 13 -> ELSA EX-VISION 300TV                     [1048:226b]
+ 14 -> ELSA EX-VISION 500TV                     [1048:226b]
+ 15 -> ASUS TV-FM 7134                          [PCI_VENDOR_ID_ASUSTEK:4842,PCI_VENDOR_ID_ASUSTEK:4830]
+ 16 -> AOPEN VA1000 POWER                       [1131:7133]
+ 17 -> 10MOONS PCI TV CAPTURE CARD              [1131:2001]
+ 18 -> BMK MPEX No Tuner                       
+ 19 -> Compro VideoMate TV                      [185b:c100]
+ 20 -> Matrox CronosPlus                        [PCI_VENDOR_ID_MATROX:48d0]
+ 21 -> Medion 2819                              [1461:a70b]
+ 22 -> BMK MPEX Tuner                          
diff -Nru a/Documentation/video4linux/CARDLIST.tuner b/Documentation/video4linux/CARDLIST.tuner
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/video4linux/CARDLIST.tuner	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,43 @@
+tuner=0 - Temic PAL (4002 FH5)
+tuner=1 - Philips PAL_I (FI1246 and compatibles)
+tuner=2 - Philips NTSC (FI1236,FM1236 and compatibles)
+tuner=3 - Philips (SECAM+PAL_BG) (FI1216MF, FM1216MF, FR1216MF)
+tuner=4 - NoTuner
+tuner=5 - Philips PAL_BG (FI1216 and compatibles)
+tuner=6 - Temic NTSC (4032 FY5)
+tuner=7 - Temic PAL_I (4062 FY5)
+tuner=8 - Temic NTSC (4036 FY5)
+tuner=9 - Alps HSBH1
+tuner=10 - Alps TSBE1
+tuner=11 - Alps TSBB5
+tuner=12 - Alps TSBE5
+tuner=13 - Alps TSBC5
+tuner=14 - Temic PAL_BG (4006FH5)
+tuner=15 - Alps TSCH6
+tuner=16 - Temic PAL_DK (4016 FY5)
+tuner=17 - Philips NTSC_M (MK2)
+tuner=18 - Temic PAL_I (4066 FY5)
+tuner=19 - Temic PAL* auto (4006 FN5)
+tuner=20 - Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)
+tuner=21 - Temic NTSC (4039 FR5)
+tuner=22 - Temic PAL/SECAM multi (4046 FM5)
+tuner=23 - Philips PAL_DK (FI1256 and compatibles)
+tuner=24 - Philips PAL/SECAM multi (FQ1216ME)
+tuner=25 - LG PAL_I+FM (TAPC-I001D)
+tuner=26 - LG PAL_I (TAPC-I701D)
+tuner=27 - LG NTSC+FM (TPI8NSR01F)
+tuner=28 - LG PAL_BG+FM (TPI8PSB01D)
+tuner=29 - LG PAL_BG (TPI8PSB11D)
+tuner=30 - Temic PAL* auto + FM (4009 FN5)
+tuner=31 - SHARP NTSC_JP (2U5JF5540)
+tuner=32 - Samsung PAL TCPM9091PD27
+tuner=33 - MT2032 universal
+tuner=34 - Temic PAL_BG (4106 FH5)
+tuner=35 - Temic PAL_DK/SECAM_L (4012 FY5)
+tuner=36 - Temic NTSC (4136 FY5)
+tuner=37 - LG PAL (newer TAPC series)
+tuner=38 - Philips PAL/SECAM multi (FM1216ME MK3)
+tuner=39 - LG NTSC (newer TAPC series)
+tuner=40 - HITACHI V7-J180AT
+tuner=41 - Philips PAL_MK (FI1216 MK)
+tuner=42 - Philips 1236D ATSC/NTSC daul in
diff -Nru a/Documentation/video4linux/README.cx88 b/Documentation/video4linux/README.cx88
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/video4linux/README.cx88	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,59 @@
+
+cx8800 release notes
+====================
+
+This is a v4l2 device driver for the cx2388x chip.
+
+
+current status
+==============
+
+video
+	Basically works.  Some minor quality glitches.  For now
+	only capture, overlay support isn't completed yet.
+
+audio
+	Doesn't work.  Also the chip specs for the on-chip TV sound
+	decoder are next to useless :-/
+	Most tuner chips do provide mono sound, which may or may not
+	be useable depending on the board design.  With the Hauppauge
+	cards it works, so there is at least mono sound.  Not nice,
+	but better than nothing.
+
+vbi
+	not implemented yet (but I don't expect problems here, just
+	found no time for that yet).
+
+
+how to add support for new cards
+================================
+
+The driver needs some config info for the TV cards.  This stuff is in
+cx88-cards.c.  If the driver doesn't work well you likely need a new
+entry for your card in that file.  Check the kernel log (using dmesg)
+to see whenever the driver knows your card or not.  There is a line
+like this one:
+
+	cx8800[0]: subsystem: 0070:3400, board: Hauppauge WinTV \
+		34xxx models [card=1,autodetected]
+
+If your card is listed as "board: UNKNOWN/GENERIC" it is unknown to
+the driver.
+
+You can try to create a new entry yourself, or you can mail me the
+config information.  I need at least the following informations to
+add the card:
+
+ * the PCI Subsystem ID ("0070:3400" from the line above, "lspci -v"
+   output is fine too).
+ * the tuner type used by the card.  You can try to find one by
+   trial-and-error using the tuner=<n> insmod option.  If you
+   know which one the card has you can also have a look at the
+   list in CARDLIST.tuner
+
+Have fun,
+
+  Gerd
+
+-- 
+Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
diff -Nru a/Documentation/video4linux/README.ir b/Documentation/video4linux/README.ir
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/video4linux/README.ir	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,72 @@
+
+infrared remote control support in video4linux drivers
+======================================================
+
+
+basics
+------
+
+Current versions use the linux input layer to support infrared
+remote controls.  I suggest to download my input layer tools
+from http://bytesex.org/snapshot/input-<date>.tar.gz
+
+Modules you have to load:
+
+  saa7134	statically built in, i.e. just the driver :)
+  bttv		ir-kbd-gpio or ir-kbd-i2c depending on your
+		card.
+
+ir-kbd-gpio and ir-kbd-i2c don't support all cards lirc supports
+(yet), mainly for the reason that the code of lirc_i2c and lirc_gpio
+was very confusing and I decided to basically start over from scratch.
+Feel free to contact me in case of trouble.  Note that the ir-kbd-*
+modules work on 2.6.x kernels only through ...
+
+
+how it works
+------------
+
+The modules register the remote as keyboard within the linux input
+layer, i.e. you'll see the keys of the remote as normal key strokes
+(if CONFIG_INPUT_KEYBOARD is enabled).
+
+Using the event devices (CONFIG_INPUT_EVDEV) it is possible for
+applications to access the remote via /dev/input/event<n> devices.
+You might have to create the special files using "/sbin/MAKEDEV
+input".  The input layer tools mentioned above use the event device.
+
+The input layer tools are nice for trouble shooting, i.e. to check
+whenever the input device is really present, which of the devices it
+is, check whenever pressing keys on the remote actually generates
+events and the like.  You can also use the kbd utility to change the
+keymaps (2.6.x kernels only through).
+
+
+using with lircd
+================
+
+The cvs version of the lircd daemon supports reading events from the
+linux input layer (via event device).  The input layer tools tarball
+comes with a lircd config file.
+
+
+using without lircd
+===================
+
+XFree86 likely can be configured to recognise the remote keys.  Once I
+simply tried to configure one of the multimedia keyboards as input
+device, which had the effect that XFree86 recognised some of the keys
+of my remote control and passed volume up/down key presses as
+XF86AudioRaiseVolume and XF86AudioLowerVolume key events to the X11
+clients.
+
+It likely is possible to make that fly with a nice xkb config file,
+I know next to nothing about that through.
+
+
+Have fun,
+
+  Gerd
+
+--
+Gerd Knorr <kraxel@bytesex.org>
diff -Nru a/Documentation/video4linux/README.saa7134 b/Documentation/video4linux/README.saa7134
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/video4linux/README.saa7134	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,73 @@
+
+
+What is it?
+===========
+
+This is a v4l2/oss device driver for saa7130/33/34/35 based capture / TV
+boards.  See http://www.semiconductors.philips.com/pip/saa7134hl for a
+description.
+
+
+Status
+======
+
+Almost everything is working.  video, sound, tuner, radio, mpeg ts, ...
+
+As with bttv, card-specific tweaks are needed.  Check CARDLIST for a
+list of known TV cards and saa7134-cards.c for the drivers card
+configuration info.
+
+
+Build
+=====
+
+Pick up videodev + v4l2 patches from http://bytesex.org/patches/.
+Configure, build, install + boot the new kernel.  You'll need at least
+these config options:
+
+	CONFIG_I2C=m
+	CONFIG_VIDEO_DEV=m
+
+Type "make" to build the driver now.  "make install" installs the
+driver.  "modprobe saa7134" should load it.  Depending on the card you
+might have to pass card=<nr> as insmod option, check CARDLIST for
+valid choices.
+
+
+Changes / Fixes
+===============
+
+Please mail me unified diffs ("diff -u") with your changes, and don't
+forget to tell me what it changes / which problem it fixes / whatever
+it is good for ...
+
+
+Known Problems
+==============
+
+* The tuner for the flyvideos isn't detected automatically and the
+  default might not work for you depending on which version you have.
+  There is a tuner= insmod option to override the driver's default.
+
+Card Variations:
+================
+
+Cards can use either of these two crystals (xtal):
+ - 32.11 MHz -> .audio_clock=0x187de7
+ - 24.576MHz -> .audio_clock=0x200000
+(xtal * .audio_clock = 51539600)
+
+
+Credits
+=======
+
+andrew.stevens@philips.com + werner.leeb@philips.com for providing
+saa7134 hardware specs and sample board.
+
+
+Have fun,
+
+  Gerd
+
+-- 
+Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
diff -Nru a/Documentation/video4linux/bttv/CARDLIST b/Documentation/video4linux/bttv/CARDLIST
--- a/Documentation/video4linux/bttv/CARDLIST	Tue Feb  3 19:45:16 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,141 +0,0 @@
-bttv.o
-  card=0 -  *** UNKNOWN/GENERIC *** 
-  card=1 - MIRO PCTV
-  card=2 - Hauppauge (bt848)
-  card=3 - STB, Gateway P/N 6000699 (bt848)
-  card=4 - Intel Create and Share PCI/ Smart Video Recorder III
-  card=5 - Diamond DTV2000
-  card=6 - AVerMedia TVPhone
-  card=7 - MATRIX-Vision MV-Delta
-  card=8 - Lifeview FlyVideo II (Bt848) LR26
-  card=9 - IMS/IXmicro TurboTV
-  card=10 - Hauppauge (bt878)
-  card=11 - MIRO PCTV pro
-  card=12 - ADS Technologies Channel Surfer TV (bt848)
-  card=13 - AVerMedia TVCapture 98
-  card=14 - Aimslab Video Highway Xtreme (VHX)
-  card=15 - Zoltrix TV-Max
-  card=16 - Prolink Pixelview PlayTV (bt878)
-  card=17 - Leadtek WinView 601
-  card=18 - AVEC Intercapture
-  card=19 - Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)
-  card=20 - CEI Raffles Card
-  card=21 - Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50
-  card=22 - Askey CPH050/ Phoebe Tv Master + FM
-  card=23 - Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878
-  card=24 - Askey CPH05X/06X (bt878) [many vendors]
-  card=25 - Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar
-  card=26 - Hauppauge WinCam newer (bt878)
-  card=27 - Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50
-  card=28 - Terratec TerraTV+ Version 1.1 (bt878)
-  card=29 - Imagenation PXC200
-  card=30 - Lifeview FlyVideo 98 LR50
-  card=31 - Formac iProTV
-  card=32 - Intel Create and Share PCI/ Smart Video Recorder III
-  card=33 - Terratec TerraTValue Version Bt878
-  card=34 - Leadtek WinFast 2000/ WinFast 2000 XP
-  card=35 - Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II
-  card=36 - Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner
-  card=37 - Prolink PixelView PlayTV pro
-  card=38 - Askey CPH06X TView99
-  card=39 - Pinnacle PCTV Studio/Rave
-  card=40 - STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100
-  card=41 - AVerMedia TVPhone 98
-  card=42 - ProVideo PV951
-  card=43 - Little OnAir TV
-  card=44 - Sigma TVII-FM
-  card=45 - MATRIX-Vision MV-Delta 2
-  card=46 - Zoltrix Genie TV/FM
-  card=47 - Terratec TV/Radio+
-  card=48 - Askey CPH03x/ Dynalink Magic TView
-  card=49 - IODATA GV-BCTV3/PCI
-  card=50 - Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP
-  card=51 - Eagle Wireless Capricorn2 (bt878A)
-  card=52 - Pinnacle PCTV Studio Pro
-  card=53 - Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS
-  card=54 - Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]
-  card=55 - Askey CPH031/ BESTBUY Easy TV
-  card=56 - Lifeview FlyVideo 98FM LR50
-  card=57 - GrandTec 'Grand Video Capture' (Bt848)
-  card=58 - Askey CPH060/ Phoebe TV Master Only (No FM)
-  card=59 - Askey CPH03x TV Capturer
-  card=60 - Modular Technology MM100PCTV
-  card=61 - AG Electronics GMV1
-  card=62 - Askey CPH061/ BESTBUY Easy TV (bt878)
-  card=63 - ATI TV-Wonder
-  card=64 - ATI TV-Wonder VE
-  card=65 - Lifeview FlyVideo 2000S LR90
-  card=66 - Terratec TValueRadio
-  card=67 - IODATA GV-BCTV4/PCI
-  card=68 - 3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA)
-  card=69 - Active Imaging AIMMS
-  card=70 - Prolink Pixelview PV-BT878P+ (Rev.4C,8E)
-  card=71 - Lifeview FlyVideo 98EZ (capture only) LR51
-  card=72 - Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)
-  card=73 - Sensoray 311
-  card=74 - RemoteVision MX (RV605)
-  card=75 - Powercolor MTV878/ MTV878R/ MTV878F
-  card=76 - Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)
-  card=77 - GrandTec Multi Capture Card (Bt878)
-  card=78 - Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF
-  card=79 - DSP Design TCVIDEO
-  card=80 - Hauppauge WinTV PVR
-  card=81 - GV-BCTV5/PCI
-  card=82 - Osprey 100/150 (878)
-  card=83 - Osprey 100/150 (848)
-  card=84 - Osprey 101 (848)
-  card=85 - Osprey 101/151
-  card=86 - Osprey 101/151 w/ svid
-  card=87 - Osprey 200/201/250/251
-  card=88 - Osprey 200/250
-  card=89 - Osprey 210/220
-  card=90 - Osprey 500
-  card=91 - Osprey 540
-  card=92 - Osprey 2000
-  card=93 - IDS Eagle
-  card=94 - Pinnacle PCTV Sat
-  card=95 - Formac ProTV II
-  card=96 - MachTV
-  card=97 - Euresys Picolo
-
-tuner.o
-  type=0 - Temic PAL (4002 FH5)
-  type=1 - Philips PAL_I (FI1246 and compatibles)
-  type=2 - Philips NTSC (FI1236,FM1236 and compatibles)
-  type=3 - Philips (SECAM+PAL_BG) (FI1216MF, FM1216MF, FR1216MF)
-  type=4 - NoTuner
-  type=5 - Philips PAL_BG (FI1216 and compatibles)
-  type=6 - Temic NTSC (4032 FY5)
-  type=7 - Temic PAL_I (4062 FY5)
-  type=8 - Temic NTSC (4036 FY5)
-  type=9 - Alps HSBH1
-  type=10 - Alps TSBE1
-  type=11 - Alps TSBB5
-  type=12 - Alps TSBE5
-  type=13 - Alps TSBC5
-  type=14 - Temic PAL_BG (4006FH5)
-  type=15 - Alps TSCH6
-  type=16 - Temic PAL_DK (4016 FY5)
-  type=17 - Philips NTSC_M (MK2)
-  type=18 - Temic PAL_I (4066 FY5)
-  type=19 - Temic PAL* auto (4006 FN5)
-  type=20 - Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)
-  type=21 - Temic NTSC (4039 FR5)
-  type=22 - Temic PAL/SECAM multi (4046 FM5)
-  type=23 - Philips PAL_DK (FI1256 and compatibles)
-  type=24 - Philips PAL/SECAM multi (FQ1216ME)
-  type=25 - LG PAL_I+FM (TAPC-I001D)
-  type=26 - LG PAL_I (TAPC-I701D)
-  type=27 - LG NTSC+FM (TPI8NSR01F)
-  type=28 - LG PAL_BG+FM (TPI8PSB01D)
-  type=29 - LG PAL_BG (TPI8PSB11D)
-  type=30 - Temic PAL* auto + FM (4009 FN5)
-  type=31 - SHARP NTSC_JP (2U5JF5540)
-  type=32 - Samsung PAL TCPM9091PD27
-  type=33 - MT2032 universal
-  type=34 - Temic PAL_BG (4106 FH5)
-  type=35 - Temic PAL_DK/SECAM_L (4012 FY5)
-  type=36 - Temic NTSC (4136 FY5)
-  type=37 - LG PAL (newer TAPC series)
-  type=38 - Philips PAL/SECAM multi (FM1216ME MK3)
-  type=39 - LG NTSC (newer TAPC series)
diff -Nru a/Documentation/video4linux/bttv/Insmod-options b/Documentation/video4linux/bttv/Insmod-options
--- a/Documentation/video4linux/bttv/Insmod-options	Tue Feb  3 19:45:17 2004
+++ b/Documentation/video4linux/bttv/Insmod-options	Tue Feb  3 19:45:17 2004
@@ -1,4 +1,10 @@
 
+Note: "modinfo <module>" prints various informations about a kernel
+module, among them a complete and up-to-date list of insmod options.
+This list tends to be outdated because it is updated manually ...
+
+==========================================================================
+
 bttv.o
 	the bt848/878 (grabber chip) driver
 
diff -Nru a/Documentation/video4linux/bttv/README b/Documentation/video4linux/bttv/README
--- a/Documentation/video4linux/bttv/README	Tue Feb  3 19:45:16 2004
+++ b/Documentation/video4linux/bttv/README	Tue Feb  3 19:45:16 2004
@@ -1,88 +1,37 @@
 
-IMPORTANT:  Don't send me mails with images attached unless I ask you
-to do so.  Mails with images attached will go to /dev/null unseen.
-
-
-Release notes for bttv-0.7.x
-============================
-
-This version is based on Ralphs 0.6.4 release.  There are alot of
-changes.  Bugfixes, merged patches from other people, merged fixes
-from the kernel version, port to the new i2c stack, removed support
-for 2.0.x, code cleanups, ...
-
-To compile this bttv version, you'll the new i2c stack.  Kernels
-newer than 2.3.34 have this already included.  If you have a older
-kernel, download it from:
-	http://www2.lm-sensors.nu/~lm78/download.html
+Release notes for bttv
+======================
 
 You'll need at least these config options for bttv:
-CONFIG_I2C=m
-CONFIG_I2C_ALGOBIT=m
-CONFIG_VIDEO_DEV=m
+	CONFIG_I2C=m
+	CONFIG_I2C_ALGOBIT=m
+	CONFIG_VIDEO_DEV=m
 
 The latest bttv version is available from http://bytesex.org/bttv/
 
-You'll find Ralphs original (mostly outdated) documentation in the
-ralphs-doc subdirectory.
-
-
-Compile bttv
-------------
-
-If you are compiling the kernel version, just say 'm' if you are asked
-for bttv.  I /strongly/ recommend to compile bttv as module, because
-there are some insmod options for configuring the driver.  Starting
-with 0.7.49 the most important ones are available as kernel args too.
-
-If you downloaded the separate bttv bundle:  You need configured kernel
-sources to compile the bttv driver.  The driver uses some Makefile
-magic to compile the modules with your kernel's configuration
-(wrt. module-versions, SMP, ...).  If you already have compiled the
-kernel at least once, you probably don't have do worry about this.  If
-not, go to /usr/src/linux and run at least "make config".  Even
-better, compile your own kernel, you'll never become a real hacker
-else ;-)
-Note that you have to turn on video4linux support (CONFIG_VIDEO_DEV)
-in the kernel to get the videodev.o module which is required by bttv.
-
 
 Make bttv work with your card
 -----------------------------
 
-Setup your /etc/modules.conf file and let kmod load the modules.
-See also:
+Just try "modprobe bttv" and see if that works.
 
-Modules.conf:	some sample entries for /etc/modules.conf
-Insmod-options:	list of all insmod options available for bttv and
-		the helper modules.
-MAKEDEV:	a script to create the special files for v4l
-CARDLIST:	List of all supported cards
-Cards:		more detailed descriptions of known TV cards:
-		OEM name variants, used i2c chips, ...
-		also includes non-bttv cards.
-
-Loading just the bttv modules isn't enouth for most cards.  The
-drivers for the i2c tuner/sound chips must also be loaded.  bttv tries
-to load them automagically by calling request_module() now, but this
-obviously works only with kmod enabled.
+If it doesn't bttv likely could not autodetect your card and needs some
+insmod options.  The most important insmod option for bttv is "card=n"
+to select the correct card type.  If you get video but no sound you've
+very likely specified the wrong (or no) card type.  A list of supported
+cards is in CARDLIST.bttv
 
 If bttv takes very long to load (happens sometimes with the cheap
 cards which have no tuner), try adding this to your modules.conf:
 	options i2c-algo-bit bit_test=1
 
-The most important insmod option for bttv is "card=n" to select the
-correct card type in case the autodetection does'nt work. If you get
-video but no sound you've very likely specified the wrong (or no)
-card type.  A list of supported cards is in CARDLIST.
-
 For the WinTV/PVR you need one firmware file from the driver CD:
 hcwamc.rbf.  The file is in the pvr45xxx.exe archive (self-extracting
 zip file, unzip can unpack it).  Put it into the /etc/pvr directory or
 use the firm_altera=<path> insmod option to point the driver to the
 location of the file.
 
-If your card isn't listed in CARDLIST or if you have trouble making
+If your card isn't listed in CARDLIST.bttv or if you have trouble making
 audio work, you should read the Sound-FAQ.
 
 
@@ -103,14 +52,6 @@
 in bttv-cards.c (in case you are intrested or want to mail patches
 with updates).
 
-Old driver versions used to have a heuristic which could identify some
-bt848-based cards.  It worked for Hauppauge and Miro cards in most
-cases (simply because these where the first cards available on the
-market), but misdetected other bt848 cards.  That code is gone now for
-exactly this reason, the misdetection confused lots of people.  If you
-have a old Hauppauge or Miro card, you'll have to load the driver with
-card=1 or card=2 these days.
-
 
 Still doesn't work?
 -------------------
@@ -146,4 +87,4 @@
   Gerd
 
 --
-Gerd Knorr <kraxel@goldbach.in-berlin.de>
+Gerd Knorr <kraxel@bytesex.org>
diff -Nru a/MAINTAINERS b/MAINTAINERS
--- a/MAINTAINERS	Tue Feb  3 19:45:30 2004
+++ b/MAINTAINERS	Tue Feb  3 19:45:30 2004
@@ -338,35 +338,64 @@
 S:	Maintained
 
 BLUETOOTH SUBSYSTEM
+P:	Marcel Holtmann
+M:	marcel@holtmann.org
 P:	Maxim Krasnyansky
 M:	maxk@qualcomm.com
+L:	bluez-devel@lists.sf.net
 W:	http://bluez.sf.net
 S:	Maintained
 
 BLUETOOTH RFCOMM LAYER
+P:	Marcel Holtmann
+M:	marcel@holtmann.org
 P:	Maxim Krasnyansky
 M:	maxk@qualcomm.com
 W:	http://bluez.sf.net
 S:	Maintained
 
 BLUETOOTH BNEP LAYER
+P:	Marcel Holtmann
+M:	marcel@holtmann.org
 P:	Maxim Krasnyansky
 M:	maxk@qualcomm.com
 W:	http://bluez.sf.net
 S:	Maintained
 
+BLUETOOTH CMTP LAYER
+P:	Marcel Holtmann
+M:	marcel@holtmann.org
+W:	http://www.holtmann.org/linux/bluetooth/
+S:	Maintained
+
 BLUETOOTH HCI USB DRIVER
+P:	Marcel Holtmann
+M:	marcel@holtmann.org
 P:	Maxim Krasnyansky
 M:	maxk@qualcomm.com
 W:	http://bluez.sf.net
 S:	Maintained
 
 BLUETOOTH HCI UART DRIVER
+P:	Marcel Holtmann
+M:	marcel@holtmann.org
 P:	Maxim Krasnyansky
 M:	maxk@qualcomm.com
 W:	http://bluez.sf.net
 S:	Maintained
 
+BLUETOOTH HCI BCM203X DRIVER
+P:	Marcel Holtmann
+M:	marcel@holtmann.org
+W:	http://www.holtmann.org/linux/bluetooth/
+S:	Maintained
+
+BLUETOOTH HCI BFUSB DRIVER
+P:	Marcel Holtmann
+M:	marcel@holtmann.org
+W:	http://www.holtmann.org/linux/bluetooth/
+S:	Maintained
+
 BLUETOOTH HCI DTL1 DRIVER
 P:	Marcel Holtmann
 M:	marcel@holtmann.org
@@ -608,8 +637,8 @@
 S:	Maintained
 
 DEVICE NUMBER REGISTRY
-P:	H. Peter Anvin
-M:	hpa@zytor.com
+P:	John Cagle
+M:	device@lanana.org
 L:	linux-kernel@vger.kernel.org
 S:	Maintained
 
@@ -680,7 +709,8 @@
 
 DVB SUBSYSTEM AND DRIVERS
 P:	LinuxTV.org Project
-L: 	linux-dvb@linuxtv.org
+M: 	linux-dvb-maintainer@linuxtv.org
+L: 	linux-dvb@linuxtv.org (subscription required)
 W:	http://linuxtv.org/developer/dvb.xml
 S:	Supported
 
@@ -1135,7 +1165,7 @@
 P:	H. Peter Anvin
 M:	hpa@zytor.com
 L:	autofs@linux.kernel.org
-S:	Maintained
+S:	Odd Fixes
 
 KERNEL AUTOMOUNTER v4 (AUTOFS4)
 P:	Jeremy Fitzhardinge
@@ -1143,11 +1173,11 @@
 L:	autofs@linux.kernel.org
 S:	Maintained
 
-KERNEL BUILD (Makefile, Rules.make, scripts/*)
-P:	Michael Elizabeth Chastain
-M:	mec@shout.net
-L:	kbuild-devel@lists.sourceforge.net
-W:	http://kbuild.sourceforge.net
+KERNEL BUILD (kbuild: Makefile, scripts/Makefile.*)
+P:	Kai Germaschewski
+M:	kai@germaschewski.name
+P:	Sam Ravnborg
+M:	sam@ravnborg.org
 S:	Maintained 
 
 KERNEL JANITORS
@@ -1482,8 +1512,8 @@
 S:	Maintained
 
 OPROFILE
-P:	John Levon
-M:	levon@movementarian.org
+P:	Philippe Elie
+M:	phil.el@wanadoo.fr
 L:	oprofile-list@lists.sf.net
 S:	Maintained
 
@@ -2223,7 +2253,7 @@
 
 USB W996[87]CF DRIVER
 P:	Luca Risolia
-M:	luca_ing@libero.it
+M:	luca.risolia@studio.unibo.it
 L:	linux-usb-devel@lists.sourceforge.net
 W:	http://go.lamarinapunto.com
 S:	Maintained
diff -Nru a/Makefile b/Makefile
--- a/Makefile	Tue Feb  3 19:45:33 2004
+++ b/Makefile	Tue Feb  3 19:45:33 2004
@@ -1,7 +1,8 @@
 VERSION = 2
 PATCHLEVEL = 6
-SUBLEVEL = 1
+SUBLEVEL = 2
 EXTRAVERSION =
+NAME=Feisty Dunnart
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
@@ -690,7 +691,7 @@
 _modinst_:
 	@if [ -z "`$(DEPMOD) -V | grep module-init-tools`" ]; then \
 		echo "Warning: you may need to install module-init-tools"; \
-		echo "See http://www.codemonkey.org.uk/post-halloween-2.5.txt";\
+		echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\
 		sleep 1; \
 	fi
 	@rm -rf $(MODLIB)/kernel
@@ -825,8 +826,15 @@
 	       -name '*.[chS]' -print )
 endef
 
-quiet_cmd_cscope = MAKE   $@
-cmd_cscope = $(all-sources) | cscope -k -b -i -
+quiet_cmd_cscope-file = FILELST cscope.files
+      cmd_cscope-file = $(all-sources) > cscope.files
+
+quiet_cmd_cscope = MAKE    cscope.out
+      cmd_cscope = cscope -k -b
+
+cscope: FORCE
+	$(call cmd,cscope-file)
+	$(call cmd,cscope)
 
 quiet_cmd_TAGS = MAKE   $@
 cmd_TAGS = $(all-sources) | etags -
@@ -839,9 +847,6 @@
 	CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
 	$(all-sources) | xargs ctags $$CTAGSF -a
 endef
-
-cscope: FORCE
-	$(call cmd,cscope)
 
 TAGS: FORCE
 	$(call cmd,TAGS)
diff -Nru a/arch/alpha/Kconfig b/arch/alpha/Kconfig
--- a/arch/alpha/Kconfig	Tue Feb  3 19:45:35 2004
+++ b/arch/alpha/Kconfig	Tue Feb  3 19:45:35 2004
@@ -509,6 +509,7 @@
 
 config NR_CPUS
 	int "Maximum number of CPUs (2-64)"
+	range 2 64
 	depends on SMP
 	default "64"
 
diff -Nru a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c
--- a/arch/alpha/kernel/module.c	Tue Feb  3 19:45:16 2004
+++ b/arch/alpha/kernel/module.c	Tue Feb  3 19:45:16 2004
@@ -259,7 +259,7 @@
 			*(u64 *)location = value;
 			break;
 		case R_ALPHA_GPRELHIGH:
-			value = (value - gp + 0x8000) >> 16;
+			value = (long)(value - gp + 0x8000) >> 16;
 			if ((short) value != value)
 				goto reloc_overflow;
 			*(u16 *)location = value;
diff -Nru a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c
--- a/arch/alpha/kernel/signal.c	Tue Feb  3 19:45:18 2004
+++ b/arch/alpha/kernel/signal.c	Tue Feb  3 19:45:18 2004
@@ -201,10 +201,13 @@
  * Do a signal return; undo the signal stack.
  */
 
+#if _NSIG_WORDS > 1
+# error "Non SA_SIGINFO frame needs rearranging"
+#endif
+
 struct sigframe
 {
 	struct sigcontext sc;
-	unsigned long extramask[_NSIG_WORDS-1];
 	unsigned int retcode[3];
 };
 
@@ -268,19 +271,20 @@
 	return err;
 }
 
+/* Note that this syscall is also used by setcontext(3) to install
+   a given sigcontext.  This because it's impossible to set *all*
+   registers and transfer control from userland.  */
+
 asmlinkage void
-do_sigreturn(struct sigframe *frame, struct pt_regs *regs,
+do_sigreturn(struct sigcontext *sc, struct pt_regs *regs,
 	     struct switch_stack *sw)
 {
 	sigset_t set;
 
 	/* Verify that it's a good sigcontext before using it */
-	if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+	if (verify_area(VERIFY_READ, sc, sizeof(*sc)))
 		goto give_sigsegv;
-	if (__get_user(set.sig[0], &frame->sc.sc_mask)
-	    || (_NSIG_WORDS > 1
-		&& __copy_from_user(&set.sig[1], &frame->extramask,
-				    sizeof(frame->extramask))))
+	if (__get_user(set.sig[0], &sc->sc_mask))
 		goto give_sigsegv;
 
 	sigdelsetmask(&set, ~_BLOCKABLE);
@@ -289,7 +293,7 @@
 	recalc_sigpending();
 	spin_unlock_irq(&current->sighand->siglock);
 
-	if (restore_sigcontext(&frame->sc, regs, sw))
+	if (restore_sigcontext(sc, regs, sw))
 		goto give_sigsegv;
 
 	/* Send SIGTRAP if we're single-stepping: */
@@ -314,10 +318,9 @@
 		struct switch_stack *sw)
 {
 	sigset_t set;
-	stack_t st;
 
-	/* Verify that it's a good sigcontext before using it */
-	if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+	/* Verify that it's a good ucontext_t before using it */
+	if (verify_area(VERIFY_READ, &frame->uc, sizeof(frame->uc)))
 		goto give_sigsegv;
 	if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
 		goto give_sigsegv;
@@ -331,12 +334,6 @@
 	if (restore_sigcontext(&frame->uc.uc_mcontext, regs, sw))
 		goto give_sigsegv;
 
-	if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st)))
-		goto give_sigsegv;
-	/* It is more difficult to avoid calling this function than to
-	   call it and ignore errors.  */
-	do_sigaltstack(&st, NULL, rdusp());
-
 	/* Send SIGTRAP if we're single-stepping: */
 	if (ptrace_cancel_bpt (current)) {
 		siginfo_t info;
@@ -437,10 +434,6 @@
 		goto give_sigsegv;
 
 	err |= setup_sigcontext(&frame->sc, regs, sw, set->sig[0], oldsp);
-	if (_NSIG_WORDS > 1) {
-		err |= __copy_to_user(frame->extramask, &set->sig[1], 
-				      sizeof(frame->extramask));
-	}
 	if (err)
 		goto give_sigsegv;
 
diff -Nru a/arch/alpha/mm/extable.c b/arch/alpha/mm/extable.c
--- a/arch/alpha/mm/extable.c	Tue Feb  3 19:45:16 2004
+++ b/arch/alpha/mm/extable.c	Tue Feb  3 19:45:16 2004
@@ -6,6 +6,11 @@
 #include <linux/module.h>
 #include <asm/uaccess.h>
 
+void sort_extable(struct exception_table_entry *start,
+		  struct exception_table_entry *finish)
+{
+}
+
 const struct exception_table_entry *
 search_extable(const struct exception_table_entry *first,
 	       const struct exception_table_entry *last,
diff -Nru a/arch/arm/configs/cerfcube_defconfig b/arch/arm/configs/cerfcube_defconfig
--- a/arch/arm/configs/cerfcube_defconfig	Tue Feb  3 19:45:16 2004
+++ b/arch/arm/configs/cerfcube_defconfig	Tue Feb  3 19:45:16 2004
@@ -2,66 +2,94 @@
 # Automatically generated make config: don't edit
 #
 CONFIG_ARM=y
-# CONFIG_EISA is not set
-# CONFIG_SBUS is not set
-# CONFIG_MCA is not set
+CONFIG_MMU=y
 CONFIG_UID16=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 
 #
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-# CONFIG_OBSOLETE is not set
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_SYSCTL=y
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_IKCONFIG is not set
+# CONFIG_EMBEDDED is not set
+CONFIG_KALLSYMS=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
 
 #
 # Loadable module support
 #
 CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_OBSOLETE_MODPARM=y
 # CONFIG_MODVERSIONS is not set
-# CONFIG_KMOD is not set
+CONFIG_KMOD=y
 
 #
 # System Type
 #
+# CONFIG_ARCH_ADIFCC is not set
 # CONFIG_ARCH_ANAKIN is not set
-# CONFIG_ARCH_ARCA5K is not set
 # CONFIG_ARCH_CLPS7500 is not set
 # CONFIG_ARCH_CLPS711X is not set
 # CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_CAMELOT is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
 # CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_IOP3XX is not set
 # CONFIG_ARCH_L7200 is not set
 # CONFIG_ARCH_RPC is not set
 CONFIG_ARCH_SA1100=y
 # CONFIG_ARCH_SHARK is not set
 
 #
-# Archimedes/A5000 Implementations
+# CLPS711X/EP721X Implementations
 #
 
 #
-# Archimedes/A5000 Implementations (select only ONE)
+# Epxa10db
 #
-# CONFIG_ARCH_ARC is not set
-# CONFIG_ARCH_A5K is not set
 
 #
 # Footbridge Implementations
 #
-# CONFIG_ARCH_CATS is not set
-# CONFIG_ARCH_PERSONAL_SERVER is not set
-# CONFIG_ARCH_EBSA285_ADDIN is not set
-# CONFIG_ARCH_EBSA285_HOST is not set
-# CONFIG_ARCH_NETWINDER is not set
+
+#
+# IOP3xx Implementation Options
+#
+# CONFIG_ARCH_IOP310 is not set
+# CONFIG_ARCH_IOP321 is not set
+
+#
+# IOP3xx Chipset Features
+#
+
+#
+# Intel PXA250/210 Implementations
+#
 
 #
 # SA11x0 Implementations
 #
 # CONFIG_SA1100_ASSABET is not set
-# CONFIG_ASSABET_NEPONSET is not set
 # CONFIG_SA1100_ADSBITSY is not set
 # CONFIG_SA1100_BRUTUS is not set
 CONFIG_SA1100_CERF=y
@@ -69,13 +97,17 @@
 CONFIG_SA1100_CERF_FLASH_16MB=y
 # CONFIG_SA1100_CERF_FLASH_32MB is not set
 # CONFIG_SA1100_CERF_CPLD is not set
+# CONFIG_SA1100_H3100 is not set
 # CONFIG_SA1100_H3600 is not set
+# CONFIG_SA1100_H3800 is not set
 # CONFIG_SA1100_EXTENEX1 is not set
 # CONFIG_SA1100_FLEXANET is not set
 # CONFIG_SA1100_FREEBIRD is not set
 # CONFIG_SA1100_GRAPHICSCLIENT is not set
 # CONFIG_SA1100_GRAPHICSMASTER is not set
+# CONFIG_SA1100_BADGE4 is not set
 # CONFIG_SA1100_JORNADA720 is not set
+# CONFIG_SA1100_HACKKIT is not set
 # CONFIG_SA1100_HUW_WEBPANEL is not set
 # CONFIG_SA1100_ITSY is not set
 # CONFIG_SA1100_LART is not set
@@ -83,84 +115,81 @@
 # CONFIG_SA1100_OMNIMETER is not set
 # CONFIG_SA1100_PANGOLIN is not set
 # CONFIG_SA1100_PLEB is not set
+# CONFIG_SA1100_PT_SYSTEM3 is not set
+# CONFIG_SA1100_SHANNON is not set
 # CONFIG_SA1100_SHERMAN is not set
 # CONFIG_SA1100_SIMPAD is not set
 # CONFIG_SA1100_PFS168 is not set
 # CONFIG_SA1100_VICTOR is not set
 # CONFIG_SA1100_XP860 is not set
 # CONFIG_SA1100_YOPY is not set
-CONFIG_SA1100_USB=y
-CONFIG_SA1100_USB_NETLINK=y
-CONFIG_SA1100_USB_CHAR=y
+# CONFIG_SA1100_STORK is not set
+# CONFIG_SA1100_SSP is not set
+CONFIG_SA1100_USB=m
+CONFIG_SA1100_USB_NETLINK=m
+# CONFIG_SA1100_USB_CHAR is not set
 
 #
-# CLPS711X/EP721X Implementations
+# Processor Type
 #
-# CONFIG_ARCH_CDB89712 is not set
-# CONFIG_ARCH_CLEP7312 is not set
-# CONFIG_ARCH_EDB7211 is not set
-# CONFIG_ARCH_P720T is not set
-# CONFIG_ARCH_EP7211 is not set
-# CONFIG_ARCH_EP7212 is not set
-# CONFIG_ARCH_ACORN is not set
-# CONFIG_FOOTBRIDGE is not set
-# CONFIG_FOOTBRIDGE_HOST is not set
-# CONFIG_FOOTBRIDGE_ADDIN is not set
 CONFIG_CPU_32=y
-# CONFIG_CPU_26 is not set
+CONFIG_CPU_SA1100=y
+CONFIG_CPU_32v4=y
+CONFIG_CPU_ABRT_EV4=y
+CONFIG_CPU_CACHE_V4WB=y
+CONFIG_CPU_TLB_V4WB=y
+CONFIG_CPU_MINICACHE=y
 
 #
-# Processor Type
+# Processor Features
 #
-# CONFIG_CPU_32v3 is not set
-CONFIG_CPU_32v4=y
-# CONFIG_CPU_ARM610 is not set
-# CONFIG_CPU_ARM710 is not set
-# CONFIG_CPU_ARM720T is not set
-# CONFIG_CPU_ARM920T is not set
-# CONFIG_CPU_ARM1020 is not set
-# CONFIG_CPU_SA110 is not set
-CONFIG_CPU_SA1100=y
-# CONFIG_ARM_THUMB is not set
-CONFIG_DISCONTIGMEM=y
 
 #
 # General setup
 #
-# CONFIG_PCI is not set
-# CONFIG_ISA is not set
-# CONFIG_ISA_DMA is not set
+CONFIG_DISCONTIGMEM=y
+CONFIG_ISA=y
+# CONFIG_ZBOOT_ROM is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_SA1110=y
+# CONFIG_CPU_FREQ_PROC_INTF is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+CONFIG_CPU_FREQ_GOV_USERSPACE=m
+CONFIG_CPU_FREQ_24_API=y
 CONFIG_HOTPLUG=y
 
 #
 # PCMCIA/CardBus support
 #
-CONFIG_PCMCIA=y
+CONFIG_PCMCIA=m
+# CONFIG_PCMCIA_DEBUG is not set
 # CONFIG_I82365 is not set
 # CONFIG_TCIC is not set
-# CONFIG_PCMCIA_CLPS6700 is not set
-CONFIG_PCMCIA_SA1100=y
-CONFIG_NET=y
-CONFIG_SYSVIPC=y
-CONFIG_BSD_PROCESS_ACCT=y
-CONFIG_SYSCTL=y
+CONFIG_PCMCIA_SA1100=m
 
 #
 # At least one math emulation must be selected
 #
-CONFIG_FPE_NWFPE=y
-# CONFIG_FPE_FASTFPE is not set
-CONFIG_KCORE_ELF=y
-# CONFIG_KCORE_AOUT is not set
-# CONFIG_BINFMT_AOUT is not set
+# CONFIG_FPE_NWFPE is not set
+CONFIG_FPE_FASTFPE=y
 CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
 # CONFIG_BINFMT_MISC is not set
-# CONFIG_PM is not set
+
+#
+# Generic Driver Options
+#
+# CONFIG_FW_LOADER is not set
+CONFIG_PM=y
+# CONFIG_PREEMPT is not set
 # CONFIG_APM is not set
 # CONFIG_ARTHUR is not set
-CONFIG_CMDLINE="console=ttySA0 root=/dev/mtdblock3 rw mem=32M"
-# CONFIG_PFS168_CMDLINE is not set
+CONFIG_CMDLINE="console=ttySA0,38400 root=/dev/mtdblock3 rootfstype=jffs2 rw mem=32M init=/linuxrc"
 CONFIG_LEDS=y
 CONFIG_LEDS_TIMER=y
 CONFIG_LEDS_CPU=y
@@ -177,17 +206,19 @@
 CONFIG_MTD=y
 # CONFIG_MTD_DEBUG is not set
 CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_REDBOOT_PARTS is not set
-# CONFIG_MTD_BOOTLDR_PARTS is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_REDBOOT_PARTS=y
+CONFIG_MTD_CMDLINE_PARTS=y
 # CONFIG_MTD_AFS_PARTS is not set
 
 #
 # User Modules And Translation Layers
 #
-CONFIG_MTD_CHAR=y
+CONFIG_MTD_CHAR=m
 CONFIG_MTD_BLOCK=y
 # CONFIG_FTL is not set
 # CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
 
 #
 # RAM/ROM/Flash chip drivers
@@ -198,6 +229,7 @@
 # CONFIG_MTD_CFI_ADV_OPTIONS is not set
 CONFIG_MTD_CFI_INTELEXT=y
 # CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_CFI_STAA is not set
 # CONFIG_MTD_RAM is not set
 # CONFIG_MTD_ROM is not set
 # CONFIG_MTD_ABSENT is not set
@@ -206,47 +238,25 @@
 #
 # Mapping drivers for chip access
 #
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
 # CONFIG_MTD_PHYSMAP is not set
-# CONFIG_MTD_SUN_UFLASH is not set
-# CONFIG_MTD_NORA is not set
-# CONFIG_MTD_PNC2000 is not set
-# CONFIG_MTD_RPXLITE is not set
-# CONFIG_MTD_TQM8XXL is not set
-# CONFIG_MTD_SC520CDP is not set
-# CONFIG_MTD_NETSC520 is not set
-# CONFIG_MTD_SBC_GXX is not set
-# CONFIG_MTD_ELAN_104NC is not set
-# CONFIG_MTD_DBOX2 is not set
-# CONFIG_MTD_CSTM_MIPS_IXX is not set
-# CONFIG_MTD_CFI_FLAGADM is not set
-# CONFIG_MTD_SOLUTIONENGINE is not set
-# CONFIG_MTD_MIXMEM is not set
-# CONFIG_MTD_OCTAGON is not set
-# CONFIG_MTD_VMAX is not set
-# CONFIG_MTD_OCELOT is not set
-# CONFIG_MTD_L440GX is not set
 # CONFIG_MTD_ARM_INTEGRATOR is not set
-# CONFIG_MTD_CDB89712 is not set
 CONFIG_MTD_SA1100=y
-# CONFIG_MTD_DC21285 is not set
-# CONFIG_MTD_IQ80310 is not set
+# CONFIG_MTD_EDB7312 is not set
 
 #
 # Self-contained MTD device drivers
 #
-# CONFIG_MTD_PMC551 is not set
 # CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_LART is not set
 # CONFIG_MTD_MTDRAM is not set
 # CONFIG_MTD_BLKMTD is not set
 
 #
 # Disk-On-Chip Device Drivers
 #
-# CONFIG_MTD_DOC1000 is not set
 # CONFIG_MTD_DOC2000 is not set
 # CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOCPROBE is not set
+# CONFIG_MTD_DOC2001PLUS is not set
 
 #
 # NAND Flash Device Drivers
@@ -254,24 +264,19 @@
 # CONFIG_MTD_NAND is not set
 
 #
-# Plug and Play configuration
+# Plug and Play support
 #
 # CONFIG_PNP is not set
-# CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
 
 #
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
 # CONFIG_BLK_DEV_XD 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_LOOP=y
+CONFIG_BLK_DEV_LOOP=m
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM=m
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
 
@@ -279,47 +284,52 @@
 # Multi-device support (RAID and LVM)
 #
 # CONFIG_MD is not set
-# CONFIG_BLK_DEV_MD is not set
-# CONFIG_MD_LINEAR is not set
-# CONFIG_MD_RAID0 is not set
-# CONFIG_MD_RAID1 is not set
-# CONFIG_MD_RAID5 is not set
-# CONFIG_BLK_DEV_LVM is not set
+
+#
+# Networking support
+#
+CONFIG_NET=y
 
 #
 # Networking options
 #
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
-CONFIG_NETLINK=y
-CONFIG_RTNETLINK=y
 # CONFIG_NETLINK_DEV is not set
-# CONFIG_NETFILTER is not set
-CONFIG_FILTER=y
 CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
 CONFIG_INET=y
 # CONFIG_IP_MULTICAST is not set
 # CONFIG_IP_ADVANCED_ROUTER is not set
-# CONFIG_IP_PNP is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
 # CONFIG_ARPD is not set
 # CONFIG_INET_ECN is not set
 # CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_KHTTPD is not set
-# CONFIG_ATM is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NETFILTER is not set
 
 #
+# SCTP Configuration (EXPERIMENTAL)
 #
-#
+CONFIG_IPV6_SCTP__=y
+# CONFIG_IP_SCTP is not set
+# CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
-# CONFIG_LLC is not set
 # CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
@@ -332,8 +342,9 @@
 # CONFIG_NET_SCHED is not set
 
 #
-# Network device support
+# Network testing
 #
+# CONFIG_NET_PKTGEN is not set
 CONFIG_NETDEVICES=y
 
 #
@@ -344,45 +355,35 @@
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
-# CONFIG_ETHERTAP is not set
 
 #
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
-# CONFIG_SUNLANCE is not set
-# CONFIG_SUNBMAC is not set
-# CONFIG_SUNQE is not set
-# CONFIG_SUNLANCE is not set
-# CONFIG_SUNGEM is not set
-CONFIG_NET_VENDOR_3COM=y
-# CONFIG_EL1 is not set
-# CONFIG_EL2 is not set
-# CONFIG_ELPLUS is not set
-# CONFIG_EL16 is not set
-# CONFIG_ELMC is not set
-# CONFIG_ELMC_II is not set
-CONFIG_CERF_CS8900A=y
+# CONFIG_MII is not set
+# CONFIG_SMC91X is not set
+# CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_LANCE is not set
 # CONFIG_NET_VENDOR_SMC is not set
 # CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_AT1700 is not set
+# CONFIG_DEPCA is not set
+# CONFIG_HP100 is not set
 # CONFIG_NET_ISA is not set
-# CONFIG_NET_PCI is not set
+CONFIG_NET_PCI=y
+# CONFIG_AC3200 is not set
+# CONFIG_APRICOT is not set
+# CONFIG_CS89x0 is not set
+CONFIG_CS8900=m
 # CONFIG_NET_POCKET is not set
 
 #
 # Ethernet (1000 Mbit)
 #
-# CONFIG_ACENIC is not set
-# CONFIG_DL2K is not set
-# CONFIG_MYRI_SBUS is not set
-# CONFIG_NS83820 is not set
-# CONFIG_HAMACHI is not set
-# CONFIG_YELLOWFIN is not set
-# CONFIG_SK98LIN is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PLIP is not set
+
+#
+# Ethernet (10000 Mbit)
+#
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 
@@ -390,13 +391,12 @@
 # Wireless LAN (non-hamradio)
 #
 # CONFIG_NET_RADIO is not set
+# CONFIG_HOSTAP is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 
 #
@@ -407,17 +407,7 @@
 #
 # PCMCIA network device support
 #
-CONFIG_NET_PCMCIA=y
-# CONFIG_PCMCIA_3C589 is not set
-# CONFIG_PCMCIA_3C574 is not set
-# CONFIG_PCMCIA_FMVJ18X is not set
-CONFIG_PCMCIA_PCNET=m
-# CONFIG_PCMCIA_NMCLAN is not set
-# CONFIG_PCMCIA_SMC91C92 is not set
-# CONFIG_PCMCIA_XIRC2PS is not set
-# CONFIG_ARCNET_COM20020_CS is not set
-# CONFIG_PCMCIA_IBMTR is not set
-# CONFIG_NET_PCMCIA_RADIO is not set
+# CONFIG_NET_PCMCIA is not set
 
 #
 # Amateur Radio support
@@ -430,113 +420,110 @@
 # CONFIG_IRDA is not set
 
 #
-# ATA/IDE/MFM/RLL support
+# Bluetooth support
 #
-CONFIG_IDE=y
+# CONFIG_BT is not set
 
 #
-# IDE, ATA and ATAPI Block devices
+# ATA/ATAPI/MFM/RLL support
 #
+CONFIG_IDE=y
 CONFIG_BLK_DEV_IDE=y
 
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
-# CONFIG_BLK_DEV_HD_IDE is not set
-# CONFIG_BLK_DEV_HD is not set
-CONFIG_BLK_DEV_IDEDISK=y
+CONFIG_BLK_DEV_IDEDISK=m
 # CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_IDEDISK_STROKE is not set
 CONFIG_BLK_DEV_IDECS=m
 # CONFIG_BLK_DEV_IDECD is not set
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
-# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+# CONFIG_IDE_TASKFILE_IO is not set
 
 #
 # IDE chipset support/bugfixes
 #
-# CONFIG_BLK_DEV_CMD640 is not set
-# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
-# CONFIG_BLK_DEV_ISAPNP is not set
 # CONFIG_IDE_CHIPSETS is not set
+# CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
-# CONFIG_BLK_DEV_ATARAID is not set
-# CONFIG_BLK_DEV_ATARAID_PDC is not set
-# CONFIG_BLK_DEV_ATARAID_HPT is not set
+# CONFIG_DMA_NONPCI is not set
+# CONFIG_BLK_DEV_HD is not set
 
 #
-# SCSI support
+# SCSI device support
 #
 # CONFIG_SCSI is not set
 
 #
 # I2O device support
 #
-# CONFIG_I2O is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
 
 #
 # ISDN subsystem
 #
-# CONFIG_ISDN is not set
+# CONFIG_ISDN_BOOL is not set
 
 #
-# Input core support
+# Input device support
 #
-# CONFIG_INPUT is not set
-# CONFIG_INPUT_KEYBDEV is not set
-# CONFIG_INPUT_MOUSEDEV is not set
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+# CONFIG_INPUT_TSLIBDEV is not set
 # CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input I/O drivers
+#
+# CONFIG_GAMEPORT is not set
+CONFIG_SOUND_GAMEPORT=y
+# CONFIG_SERIO is not set
+# CONFIG_SERIO_I8042 is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
 
 #
 # Character devices
 #
 CONFIG_VT=y
-# CONFIG_VT_CONSOLE is not set
-# CONFIG_SERIAL is not set
-# CONFIG_SERIAL_EXTENDED is not set
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
 # Serial drivers
 #
-# CONFIG_SERIAL_ANAKIN is not set
-# CONFIG_SERIAL_ANAKIN_CONSOLE is not set
-# CONFIG_SERIAL_AMBA is not set
-# CONFIG_SERIAL_AMBA_CONSOLE is not set
-# CONFIG_SERIAL_CLPS711X is not set
-# CONFIG_SERIAL_CLPS711X_CONSOLE is not set
-# CONFIG_SERIAL_21285 is not set
-# CONFIG_SERIAL_21285_OLD is not set
-# CONFIG_SERIAL_21285_CONSOLE is not set
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_DZ is not set
 CONFIG_SERIAL_SA1100=y
 CONFIG_SERIAL_SA1100_CONSOLE=y
-CONFIG_SA1100_DEFAULT_BAUDRATE=9600
-# CONFIG_SERIAL_8250 is not set
-# CONFIG_SERIAL_8250_CONSOLE is not set
-# CONFIG_SERIAL_8250_EXTENDED is not set
-# CONFIG_SERIAL_8250_MANY_PORTS is not set
-# CONFIG_SERIAL_8250_SHARE_IRQ is not set
-# CONFIG_SERIAL_8250_DETECT_IRQ is not set
-# CONFIG_SERIAL_8250_MULTIPORT is not set
-# CONFIG_SERIAL_8250_HUB6 is not set
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_UNIX98_PTY_COUNT=32
-# CONFIG_UCB1200 is not set
-# CONFIG_TOUCHSCREEN_UCB1200 is not set
-# CONFIG_AUDIO_UCB1200 is not set
-# CONFIG_ADC_UCB1200 is not set
-# CONFIG_TOUCHSCREEN_H3600 is not set
-# CONFIG_PROFILER is not set
-# CONFIG_PFS168_SPI is not set
-# CONFIG_PFS168_DTMF is not set
-# CONFIG_PFS168_MISC is not set
 
 #
 # I2C support
@@ -544,56 +531,68 @@
 # CONFIG_I2C is not set
 
 #
-# L3 serial bus support
-#
-# CONFIG_L3 is not set
-# CONFIG_L3_ALGOBIT is not set
-# CONFIG_L3_BIT_SA1100_GPIO is not set
-# CONFIG_BIT_SA1100_UCB1200 is not set
-
-#
-# Other L3 adapters
+# I2C Algorithms
 #
-# CONFIG_L3_SA1111 is not set
 
 #
-# L3 driver support
+# I2C Hardware Bus support
 #
-# CONFIG_L3_DRV_UDA1341 is not set
-# CONFIG_BIT_SA1100_GPIO is not set
 
 #
-# Mice
+# I2C Hardware Sensors Chip support
 #
-# CONFIG_BUSMOUSE is not set
-# CONFIG_MOUSE is not set
+# CONFIG_I2C_SENSOR is not set
 
 #
-# Joysticks
+# L3 serial bus support
 #
-# CONFIG_INPUT_GAMEPORT is not set
+CONFIG_L3=m
 
 #
-# Input core support is needed for gameports
+# Mice
 #
+# CONFIG_BUSMOUSE is not set
+# CONFIG_QIC02_TAPE is not set
 
 #
-# Input core support is needed for joysticks
+# IPMI
 #
-# CONFIG_QIC02_TAPE is not set
+# CONFIG_IPMI_HANDLER is not set
 
 #
 # Watchdog Cards
 #
-# CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+# CONFIG_SOFT_WATCHDOG is not set
+# CONFIG_WDT is not set
+# CONFIG_WDTPCI is not set
+# CONFIG_PCWATCHDOG is not set
+# CONFIG_ACQUIRE_WDT is not set
+# CONFIG_ADVANTECH_WDT is not set
+CONFIG_SA1100_WATCHDOG=m
+# CONFIG_EUROTECH_WDT is not set
+# CONFIG_IB700_WDT is not set
+# CONFIG_I810_TCO is not set
+# CONFIG_MIXCOMWD is not set
+# CONFIG_SCx200_WDT is not set
+# CONFIG_60XX_WDT is not set
+# CONFIG_W83877F_WDT is not set
+# CONFIG_MACHZ_WDT is not set
+# CONFIG_SC520_WDT is not set
+# CONFIG_AMD7XX_TCO is not set
+# CONFIG_ALIM7101_WDT is not set
+# CONFIG_ALIM1535_WDT is not set
+# CONFIG_SC1200_WDT is not set
+# CONFIG_WAFER_WDT is not set
+# CONFIG_CPU5_WDT is not set
 # CONFIG_NVRAM is not set
 # CONFIG_RTC is not set
-CONFIG_SA1100_RTC=y
+# CONFIG_GEN_RTC is not set
+# CONFIG_SA1100_RTC is not set
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
 
 #
 # Ftape, the floppy tape device driver
@@ -605,6 +604,8 @@
 #
 # PCMCIA character devices
 #
+# CONFIG_SYNCLINK_CS is not set
+# CONFIG_RAW_DRIVER is not set
 
 #
 # Multimedia devices
@@ -612,94 +613,133 @@
 # CONFIG_VIDEO_DEV is not set
 
 #
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
 # File systems
 #
-# CONFIG_QUOTA is not set
-CONFIG_AUTOFS_FS=y
-CONFIG_AUTOFS4_FS=y
+CONFIG_EXT2_FS=m
+# CONFIG_EXT2_FS_XATTR is not set
+CONFIG_EXT3_FS=m
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+CONFIG_JBD=m
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=m
 # CONFIG_REISERFS_FS is not set
-# CONFIG_REISERFS_CHECK is not set
-# CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_MINIX_FS is not set
+CONFIG_ROMFS_FS=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
 # CONFIG_ADFS_FS is not set
-# CONFIG_ADFS_FS_RW is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
+# CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
-# CONFIG_CMS_FS is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_JBD is not set
-# CONFIG_JBD_DEBUG is not set
-CONFIG_FAT_FS=y
-CONFIG_MSDOS_FS=y
-CONFIG_UMSDOS_FS=y
-CONFIG_VFAT_FS=y
 # CONFIG_EFS_FS is not set
 # CONFIG_JFFS_FS is not set
 CONFIG_JFFS2_FS=y
 CONFIG_JFFS2_FS_DEBUG=0
+# CONFIG_JFFS2_FS_NAND is not set
 # CONFIG_CRAMFS is not set
-# CONFIG_TMPFS is not set
-CONFIG_RAMFS=y
-# CONFIG_ISO9660_FS is not set
-# CONFIG_JOLIET is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_FREEVXFS_FS is not set
-# CONFIG_NTFS_FS is not set
-# CONFIG_NTFS_DEBUG is not set
-# CONFIG_NTFS_RW is not set
+# CONFIG_VXFS_FS is not set
 # CONFIG_HPFS_FS is not set
-CONFIG_PROC_FS=y
-# CONFIG_DEVFS_FS is not set
-# CONFIG_DEVFS_MOUNT is not set
-# CONFIG_DEVFS_DEBUG is not set
-CONFIG_DEVPTS_FS=y
 # CONFIG_QNX4FS_FS is not set
-# CONFIG_QNX4FS_RW is not set
-CONFIG_ROMFS_FS=y
-CONFIG_EXT2_FS=y
 # CONFIG_SYSV_FS is not set
-# CONFIG_UDF_FS is not set
-# CONFIG_UDF_RW is not set
 # CONFIG_UFS_FS is not set
-# CONFIG_UFS_FS_WRITE is not set
 
 #
 # Network File Systems
 #
-# CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
-CONFIG_NFS_FS=y
+CONFIG_NFS_FS=m
 CONFIG_NFS_V3=y
-# CONFIG_ROOT_NFS is not set
-# CONFIG_NFSD is not set
-# CONFIG_NFSD_V3 is not set
-CONFIG_SUNRPC=y
-CONFIG_LOCKD=y
+CONFIG_NFS_V4=y
+# CONFIG_NFS_DIRECTIO is not set
+CONFIG_NFSD=m
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V4=y
+# CONFIG_NFSD_TCP is not set
+CONFIG_LOCKD=m
 CONFIG_LOCKD_V4=y
-# CONFIG_SMB_FS is not set
+CONFIG_EXPORTFS=m
+CONFIG_SUNRPC=m
+# CONFIG_SUNRPC_GSS is not set
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+# CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
-# CONFIG_NCPFS_PACKET_SIGNING is not set
-# CONFIG_NCPFS_IOCTL_LOCKING is not set
-# CONFIG_NCPFS_STRONG is not set
-# CONFIG_NCPFS_NFS_NS is not set
-# CONFIG_NCPFS_OS2_NS is not set
-# CONFIG_NCPFS_SMALLDOS is not set
-# CONFIG_NCPFS_NLS is not set
-# CONFIG_NCPFS_EXTRAS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
+# CONFIG_AFS_FS is not set
 
 #
 # Partition Types
 #
-# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
 CONFIG_MSDOS_PARTITION=y
-# CONFIG_SMB_NLS is not set
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_NEC98_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+CONFIG_SMB_NLS=y
 CONFIG_NLS=y
 
 #
 # Native Language Support
 #
 CONFIG_NLS_DEFAULT="iso8859-1"
-# CONFIG_NLS_CODEPAGE_437 is not set
+CONFIG_NLS_CODEPAGE_437=m
 # CONFIG_NLS_CODEPAGE_737 is not set
 # CONFIG_NLS_CODEPAGE_775 is not set
 # CONFIG_NLS_CODEPAGE_850 is not set
@@ -720,8 +760,9 @@
 # CONFIG_NLS_CODEPAGE_949 is not set
 # CONFIG_NLS_CODEPAGE_874 is not set
 # CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
-# CONFIG_NLS_ISO8859_1 is not set
+CONFIG_NLS_ISO8859_1=m
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
 # CONFIG_NLS_ISO8859_4 is not set
@@ -737,15 +778,16 @@
 # CONFIG_NLS_UTF8 is not set
 
 #
-# Console drivers
+# Graphics support
 #
-CONFIG_PC_KEYMAP=y
-# CONFIG_VGA_CONSOLE is not set
+# CONFIG_FB is not set
 
 #
-# Frame-buffer support
+# Console display driver support
 #
-# CONFIG_FB is not set
+# CONFIG_VGA_CONSOLE is not set
+# CONFIG_MDA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
 
 #
 # Sound
@@ -753,121 +795,52 @@
 # CONFIG_SOUND is not set
 
 #
-# USB support
-#
-# CONFIG_USB is not set
-
-#
-# USB Controllers
+# Misc devices
 #
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-# CONFIG_USB_OHCI_SA1111 is not set
 
 #
-# USB Device Class drivers
+# Multimedia Capabilities Port drivers
 #
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
+# CONFIG_MCP is not set
 
 #
-# USB Human Interface Devices (HID)
+# Console Switches
 #
+# CONFIG_SWITCHES is not set
 
 #
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-# CONFIG_USB_DABUSB is not set
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PLUSB is not set
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
+# USB support
 #
-# CONFIG_USB_USS720 is not set
+# CONFIG_USB_GADGET is not set
 
 #
-# USB Serial Converter support
+# Kernel hacking
 #
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
+CONFIG_FRAME_POINTER=y
+CONFIG_DEBUG_USER=y
+# CONFIG_DEBUG_INFO is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_WAITQ is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_DEBUG_ERRORS=y
+CONFIG_DEBUG_LL=y
 
 #
-# Miscellaneous USB drivers
+# Security options
 #
-# CONFIG_USB_RIO500 is not set
-# CONFIG_USB_ID75 is not set
+# CONFIG_SECURITY is not set
 
 #
-# Bluetooth support
+# Cryptographic options
 #
-# CONFIG_BT is not set
+# CONFIG_CRYPTO is not set
 
 #
-# Kernel hacking
+# Library routines
 #
-CONFIG_FRAME_POINTER=y
-CONFIG_DEBUG_ERRORS=y
-CONFIG_DEBUG_USER=y
-# CONFIG_DEBUG_INFO is not set
-CONFIG_MAGIC_SYSRQ=y
-# CONFIG_NO_PGT_CACHE is not set
-# CONFIG_DEBUG_LL is not set
-# CONFIG_DEBUG_DC21285_PORT is not set
-# CONFIG_DEBUG_CLPS711X_UART2 is not set
+CONFIG_CRC32=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
diff -Nru a/arch/arm/configs/cerfpda_defconfig b/arch/arm/configs/cerfpda_defconfig
--- a/arch/arm/configs/cerfpda_defconfig	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,967 +0,0 @@
-#
-# Automatically generated make config: don't edit
-#
-CONFIG_ARM=y
-# CONFIG_EISA is not set
-# CONFIG_SBUS is not set
-# CONFIG_MCA is not set
-CONFIG_UID16=y
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-
-#
-# Code maturity level options
-#
-CONFIG_EXPERIMENTAL=y
-# CONFIG_OBSOLETE is not set
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-# CONFIG_KMOD is not set
-
-#
-# System Type
-#
-# CONFIG_ARCH_ANAKIN is not set
-# CONFIG_ARCH_ARCA5K is not set
-# CONFIG_ARCH_CLPS7500 is not set
-# CONFIG_ARCH_CLPS711X is not set
-# CONFIG_ARCH_CO285 is not set
-# CONFIG_ARCH_EBSA110 is not set
-# CONFIG_ARCH_FOOTBRIDGE is not set
-# CONFIG_ARCH_INTEGRATOR is not set
-# CONFIG_ARCH_L7200 is not set
-# CONFIG_ARCH_RPC is not set
-CONFIG_ARCH_SA1100=y
-# CONFIG_ARCH_SHARK is not set
-
-#
-# Archimedes/A5000 Implementations
-#
-
-#
-# Archimedes/A5000 Implementations (select only ONE)
-#
-# CONFIG_ARCH_ARC is not set
-# CONFIG_ARCH_A5K is not set
-
-#
-# Footbridge Implementations
-#
-# CONFIG_ARCH_CATS is not set
-# CONFIG_ARCH_PERSONAL_SERVER is not set
-# CONFIG_ARCH_EBSA285_ADDIN is not set
-# CONFIG_ARCH_EBSA285_HOST is not set
-# CONFIG_ARCH_NETWINDER is not set
-
-#
-# SA11x0 Implementations
-#
-# CONFIG_SA1100_ASSABET is not set
-# CONFIG_ASSABET_NEPONSET is not set
-# CONFIG_SA1100_ADSBITSY is not set
-# CONFIG_SA1100_BRUTUS is not set
-CONFIG_SA1100_CERF=y
-# CONFIG_SA1100_CERF_FLASH_8MB is not set
-# CONFIG_SA1100_CERF_FLASH_16MB is not set
-CONFIG_SA1100_CERF_FLASH_32MB=y
-CONFIG_SA1100_CERF_CPLD=y
-# CONFIG_SA1100_H3600 is not set
-# CONFIG_SA1100_EXTENEX1 is not set
-# CONFIG_SA1100_FLEXANET is not set
-# CONFIG_SA1100_FREEBIRD is not set
-# CONFIG_SA1100_GRAPHICSCLIENT is not set
-# CONFIG_SA1100_GRAPHICSMASTER is not set
-# CONFIG_SA1100_JORNADA720 is not set
-# CONFIG_SA1100_HUW_WEBPANEL is not set
-# CONFIG_SA1100_ITSY is not set
-# CONFIG_SA1100_LART is not set
-# CONFIG_SA1100_NANOENGINE is not set
-# CONFIG_SA1100_OMNIMETER is not set
-# CONFIG_SA1100_PANGOLIN is not set
-# CONFIG_SA1100_PLEB is not set
-# CONFIG_SA1100_SHERMAN is not set
-# CONFIG_SA1100_SIMPAD is not set
-# CONFIG_SA1100_PFS168 is not set
-# CONFIG_SA1100_VICTOR is not set
-# CONFIG_SA1100_XP860 is not set
-# CONFIG_SA1100_YOPY is not set
-CONFIG_SA1100_USB=y
-CONFIG_SA1100_USB_NETLINK=y
-CONFIG_SA1100_USB_CHAR=y
-
-#
-# CLPS711X/EP721X Implementations
-#
-# CONFIG_ARCH_CDB89712 is not set
-# CONFIG_ARCH_CLEP7312 is not set
-# CONFIG_ARCH_EDB7211 is not set
-# CONFIG_ARCH_P720T is not set
-# CONFIG_ARCH_EP7211 is not set
-# CONFIG_ARCH_EP7212 is not set
-# CONFIG_ARCH_ACORN is not set
-# CONFIG_FOOTBRIDGE is not set
-# CONFIG_FOOTBRIDGE_HOST is not set
-# CONFIG_FOOTBRIDGE_ADDIN is not set
-CONFIG_CPU_32=y
-# CONFIG_CPU_26 is not set
-
-#
-# Processor Type
-#
-# CONFIG_CPU_32v3 is not set
-CONFIG_CPU_32v4=y
-# CONFIG_CPU_ARM610 is not set
-# CONFIG_CPU_ARM710 is not set
-# CONFIG_CPU_ARM720T is not set
-# CONFIG_CPU_ARM920T is not set
-# CONFIG_CPU_ARM1020 is not set
-# CONFIG_CPU_SA110 is not set
-CONFIG_CPU_SA1100=y
-# CONFIG_ARM_THUMB is not set
-CONFIG_DISCONTIGMEM=y
-
-#
-# General setup
-#
-# CONFIG_PCI is not set
-# CONFIG_ISA is not set
-# CONFIG_ISA_DMA is not set
-CONFIG_CPU_FREQ=y
-CONFIG_HOTPLUG=y
-
-#
-# PCMCIA/CardBus support
-#
-CONFIG_PCMCIA=y
-# CONFIG_I82365 is not set
-# CONFIG_TCIC is not set
-# CONFIG_PCMCIA_CLPS6700 is not set
-CONFIG_PCMCIA_SA1100=y
-CONFIG_NET=y
-CONFIG_SYSVIPC=y
-CONFIG_BSD_PROCESS_ACCT=y
-CONFIG_SYSCTL=y
-
-#
-# At least one math emulation must be selected
-#
-CONFIG_FPE_NWFPE=y
-# CONFIG_FPE_FASTFPE is not set
-CONFIG_KCORE_ELF=y
-# CONFIG_KCORE_AOUT is not set
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
-# CONFIG_PM is not set
-# CONFIG_APM is not set
-# CONFIG_ARTHUR is not set
-CONFIG_CMDLINE="console=ttySA0 cpufreq_max=221200 root=/dev/mtdblock3 rw mem=64M"
-# CONFIG_PFS168_CMDLINE is not set
-# CONFIG_LEDS is not set
-CONFIG_ALIGNMENT_TRAP=y
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-
-#
-# Memory Technology Devices (MTD)
-#
-CONFIG_MTD=y
-# CONFIG_MTD_DEBUG is not set
-CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_REDBOOT_PARTS is not set
-# CONFIG_MTD_BOOTLDR_PARTS is not set
-# CONFIG_MTD_AFS_PARTS is not set
-
-#
-# User Modules And Translation Layers
-#
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_FTL is not set
-# CONFIG_NFTL is not set
-
-#
-# RAM/ROM/Flash chip drivers
-#
-CONFIG_MTD_CFI=y
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_GEN_PROBE=y
-CONFIG_MTD_CFI_ADV_OPTIONS=y
-CONFIG_MTD_CFI_NOSWAP=y
-# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
-# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
-CONFIG_MTD_CFI_GEOMETRY=y
-# CONFIG_MTD_CFI_B1 is not set
-# CONFIG_MTD_CFI_B2 is not set
-CONFIG_MTD_CFI_B4=y
-# CONFIG_MTD_CFI_I1 is not set
-CONFIG_MTD_CFI_I2=y
-# CONFIG_MTD_CFI_I4 is not set
-CONFIG_MTD_CFI_INTELEXT=y
-# CONFIG_MTD_CFI_AMDSTD is not set
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_ABSENT is not set
-# CONFIG_MTD_OBSOLETE_CHIPS is not set
-
-#
-# Mapping drivers for chip access
-#
-# CONFIG_MTD_PHYSMAP is not set
-# CONFIG_MTD_SUN_UFLASH is not set
-# CONFIG_MTD_NORA is not set
-# CONFIG_MTD_PNC2000 is not set
-# CONFIG_MTD_RPXLITE is not set
-# CONFIG_MTD_TQM8XXL is not set
-# CONFIG_MTD_SC520CDP is not set
-# CONFIG_MTD_NETSC520 is not set
-# CONFIG_MTD_SBC_GXX is not set
-# CONFIG_MTD_ELAN_104NC is not set
-# CONFIG_MTD_DBOX2 is not set
-# CONFIG_MTD_CSTM_MIPS_IXX is not set
-# CONFIG_MTD_CFI_FLAGADM is not set
-# CONFIG_MTD_SOLUTIONENGINE is not set
-# CONFIG_MTD_MIXMEM is not set
-# CONFIG_MTD_OCTAGON is not set
-# CONFIG_MTD_VMAX is not set
-# CONFIG_MTD_OCELOT is not set
-# CONFIG_MTD_L440GX is not set
-# CONFIG_MTD_ARM_INTEGRATOR is not set
-# CONFIG_MTD_CDB89712 is not set
-CONFIG_MTD_SA1100=y
-# CONFIG_MTD_DC21285 is not set
-# CONFIG_MTD_IQ80310 is not set
-
-#
-# Self-contained MTD device drivers
-#
-# CONFIG_MTD_PMC551 is not set
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_LART is not set
-# CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_BLKMTD is not set
-
-#
-# Disk-On-Chip Device Drivers
-#
-# CONFIG_MTD_DOC1000 is not set
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOCPROBE is not set
-
-#
-# NAND Flash Device Drivers
-#
-# CONFIG_MTD_NAND is not set
-
-#
-# Plug and Play configuration
-#
-# CONFIG_PNP is not set
-# CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
-
-#
-# Block devices
-#
-# CONFIG_BLK_DEV_FD is not set
-# CONFIG_BLK_DEV_XD 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_LOOP=y
-# CONFIG_BLK_DEV_NBD is not set
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=4096
-CONFIG_BLK_DEV_INITRD=y
-
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-# CONFIG_BLK_DEV_MD is not set
-# CONFIG_MD_LINEAR is not set
-# CONFIG_MD_RAID0 is not set
-# CONFIG_MD_RAID1 is not set
-# CONFIG_MD_RAID5 is not set
-# CONFIG_BLK_DEV_LVM is not set
-
-#
-# Networking options
-#
-CONFIG_PACKET=y
-CONFIG_PACKET_MMAP=y
-CONFIG_NETLINK=y
-CONFIG_RTNETLINK=y
-# CONFIG_NETLINK_DEV is not set
-# CONFIG_NETFILTER is not set
-CONFIG_FILTER=y
-CONFIG_UNIX=y
-CONFIG_INET=y
-CONFIG_IP_MULTICAST=y
-# CONFIG_IP_ADVANCED_ROUTER is not set
-# CONFIG_IP_PNP is not set
-# CONFIG_NET_IPIP is not set
-# CONFIG_NET_IPGRE is not set
-# CONFIG_IP_MROUTE is not set
-# CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
-# CONFIG_SYN_COOKIES is not set
-# CONFIG_IPV6 is not set
-# CONFIG_KHTTPD is not set
-# CONFIG_ATM is not set
-
-#
-#
-#
-# CONFIG_IPX is not set
-# CONFIG_ATALK is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
-# CONFIG_X25 is not set
-# CONFIG_LAPB is not set
-# CONFIG_LLC is not set
-# CONFIG_NET_DIVERT is not set
-# CONFIG_ECONET is not set
-# CONFIG_WAN_ROUTER is not set
-# CONFIG_NET_FASTROUTE is not set
-# CONFIG_NET_HW_FLOWCONTROL is not set
-
-#
-# QoS and/or fair queueing
-#
-# CONFIG_NET_SCHED is not set
-
-#
-# Network device support
-#
-CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
-# CONFIG_ETHERTAP is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
-CONFIG_NET_ETHERNET=y
-# CONFIG_SUNLANCE is not set
-# CONFIG_SUNBMAC is not set
-# CONFIG_SUNQE is not set
-# CONFIG_SUNLANCE is not set
-# CONFIG_SUNGEM is not set
-CONFIG_NET_VENDOR_3COM=y
-# CONFIG_EL1 is not set
-# CONFIG_EL2 is not set
-# CONFIG_ELPLUS is not set
-# CONFIG_EL16 is not set
-# CONFIG_ELMC is not set
-# CONFIG_ELMC_II is not set
-CONFIG_CERF_CS8900A=y
-# CONFIG_LANCE is not set
-# CONFIG_NET_VENDOR_SMC is not set
-# CONFIG_NET_VENDOR_RACAL is not set
-# CONFIG_NET_ISA is not set
-# CONFIG_NET_PCI is not set
-# CONFIG_NET_POCKET is not set
-
-#
-# Ethernet (1000 Mbit)
-#
-# CONFIG_ACENIC is not set
-# CONFIG_DL2K is not set
-# CONFIG_MYRI_SBUS is not set
-# CONFIG_NS83820 is not set
-# CONFIG_HAMACHI is not set
-# CONFIG_YELLOWFIN is not set
-# CONFIG_SK98LIN is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PLIP is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-CONFIG_NET_RADIO=y
-CONFIG_STRIP=m
-CONFIG_WAVELAN=m
-CONFIG_ARLAN=m
-CONFIG_AIRONET4500=m
-CONFIG_AIRONET4500_NONCS=m
-# CONFIG_AIRONET4500_PNP is not set
-# CONFIG_AIRONET4500_PCI is not set
-# CONFIG_AIRONET4500_ISA is not set
-# CONFIG_AIRONET4500_I365 is not set
-CONFIG_AIRONET4500_PROC=m
-
-#
-# Wireless Pcmcia cards support
-#
-CONFIG_PCMCIA_HERMES=m
-CONFIG_AIRO_CS=m
-CONFIG_NET_WIRELESS=y
-
-#
-# Token Ring devices
-#
-# CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# PCMCIA network device support
-#
-CONFIG_NET_PCMCIA=y
-CONFIG_PCMCIA_3C589=m
-CONFIG_PCMCIA_3C574=m
-CONFIG_PCMCIA_FMVJ18X=m
-CONFIG_PCMCIA_PCNET=m
-CONFIG_PCMCIA_NMCLAN=m
-CONFIG_PCMCIA_SMC91C92=m
-CONFIG_PCMCIA_XIRC2PS=m
-# CONFIG_ARCNET_COM20020_CS is not set
-# CONFIG_PCMCIA_IBMTR is not set
-CONFIG_NET_PCMCIA_RADIO=y
-CONFIG_PCMCIA_RAYCS=m
-CONFIG_PCMCIA_NETWAVE=m
-CONFIG_PCMCIA_WAVELAN=m
-CONFIG_AIRONET4500_CS=m
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# ATA/IDE/MFM/RLL support
-#
-CONFIG_IDE=y
-
-#
-# IDE, ATA and ATAPI Block devices
-#
-CONFIG_BLK_DEV_IDE=y
-
-#
-# Please see Documentation/ide.txt for help/info on IDE drives
-#
-# CONFIG_BLK_DEV_HD_IDE is not set
-# CONFIG_BLK_DEV_HD is not set
-CONFIG_BLK_DEV_IDEDISK=y
-# CONFIG_IDEDISK_MULTI_MODE is not set
-CONFIG_BLK_DEV_IDECS=m
-# CONFIG_BLK_DEV_IDECD is not set
-# CONFIG_BLK_DEV_IDETAPE is not set
-# CONFIG_BLK_DEV_IDEFLOPPY is not set
-# CONFIG_BLK_DEV_IDESCSI is not set
-
-#
-# IDE chipset support/bugfixes
-#
-# CONFIG_BLK_DEV_CMD640 is not set
-# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
-# CONFIG_BLK_DEV_ISAPNP is not set
-# CONFIG_IDE_CHIPSETS is not set
-# CONFIG_IDEDMA_AUTO is not set
-# CONFIG_BLK_DEV_ATARAID is not set
-# CONFIG_BLK_DEV_ATARAID_PDC is not set
-# CONFIG_BLK_DEV_ATARAID_HPT is not set
-
-#
-# SCSI support
-#
-# CONFIG_SCSI is not set
-
-#
-# I2O device support
-#
-# CONFIG_I2O is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
-
-#
-# ISDN subsystem
-#
-# CONFIG_ISDN is not set
-
-#
-# Input core support
-#
-# CONFIG_INPUT is not set
-# CONFIG_INPUT_KEYBDEV is not set
-# CONFIG_INPUT_MOUSEDEV is not set
-# CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_EVDEV is not set
-
-#
-# Character devices
-#
-CONFIG_VT=y
-CONFIG_VT_CONSOLE=y
-# CONFIG_SERIAL is not set
-# CONFIG_SERIAL_EXTENDED is not set
-# CONFIG_SERIAL_NONSTANDARD is not set
-
-#
-# Serial drivers
-#
-# CONFIG_SERIAL_ANAKIN is not set
-# CONFIG_SERIAL_ANAKIN_CONSOLE is not set
-# CONFIG_SERIAL_AMBA is not set
-# CONFIG_SERIAL_AMBA_CONSOLE is not set
-# CONFIG_SERIAL_CLPS711X is not set
-# CONFIG_SERIAL_CLPS711X_CONSOLE is not set
-# CONFIG_SERIAL_21285 is not set
-# CONFIG_SERIAL_21285_OLD is not set
-# CONFIG_SERIAL_21285_CONSOLE is not set
-CONFIG_SERIAL_SA1100=y
-CONFIG_SERIAL_SA1100_CONSOLE=y
-CONFIG_SA1100_DEFAULT_BAUDRATE=38400
-CONFIG_SERIAL_8250=y
-# CONFIG_SERIAL_8250_CONSOLE is not set
-# CONFIG_SERIAL_8250_EXTENDED is not set
-# CONFIG_SERIAL_8250_MANY_PORTS is not set
-# CONFIG_SERIAL_8250_SHARE_IRQ is not set
-# CONFIG_SERIAL_8250_DETECT_IRQ is not set
-# CONFIG_SERIAL_8250_MULTIPORT is not set
-# CONFIG_SERIAL_8250_HUB6 is not set
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
-CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=32
-CONFIG_UCB1200=y
-CONFIG_TOUCHSCREEN_UCB1200=y
-CONFIG_CERF_TS_MANUAL=y
-CONFIG_CERF_TS_MAXX="924"
-CONFIG_CERF_TS_MAXY="920"
-CONFIG_CERF_TS_MINX="57"
-CONFIG_CERF_TS_MINY="52"
-CONFIG_CERF_TS_RESX="240"
-CONFIG_CERF_TS_RESY="320"
-# CONFIG_AUDIO_UCB1200 is not set
-# CONFIG_ADC_UCB1200 is not set
-# CONFIG_TOUCHSCREEN_H3600 is not set
-# CONFIG_PROFILER is not set
-# CONFIG_PFS168_SPI is not set
-# CONFIG_PFS168_DTMF is not set
-# CONFIG_PFS168_MISC is not set
-CONFIG_SA1100_CERF_KEYPAD=y
-
-#
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# L3 serial bus support
-#
-# CONFIG_L3 is not set
-# CONFIG_L3_ALGOBIT is not set
-# CONFIG_L3_BIT_SA1100_GPIO is not set
-# CONFIG_BIT_SA1100_UCB1200 is not set
-
-#
-# Other L3 adapters
-#
-# CONFIG_L3_SA1111 is not set
-
-#
-# L3 driver support
-#
-# CONFIG_L3_DRV_UDA1341 is not set
-# CONFIG_BIT_SA1100_GPIO is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
-# CONFIG_MOUSE is not set
-
-#
-# Joysticks
-#
-# CONFIG_INPUT_GAMEPORT is not set
-
-#
-# Input core support is needed for gameports
-#
-
-#
-# Input core support is needed for joysticks
-#
-# CONFIG_QIC02_TAPE is not set
-
-#
-# Watchdog Cards
-#
-# CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
-# CONFIG_NVRAM is not set
-# CONFIG_RTC is not set
-CONFIG_SA1100_RTC=y
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
-
-#
-# Ftape, the floppy tape device driver
-#
-# CONFIG_FTAPE is not set
-# CONFIG_AGP is not set
-# CONFIG_DRM is not set
-
-#
-# PCMCIA character devices
-#
-
-#
-# Multimedia devices
-#
-# CONFIG_VIDEO_DEV is not set
-
-#
-# File systems
-#
-# CONFIG_QUOTA is not set
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-# CONFIG_REISERFS_FS is not set
-# CONFIG_REISERFS_CHECK is not set
-# CONFIG_REISERFS_PROC_INFO is not set
-# CONFIG_ADFS_FS is not set
-# CONFIG_ADFS_FS_RW is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_CMS_FS is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_JBD is not set
-# CONFIG_JBD_DEBUG is not set
-CONFIG_FAT_FS=y
-CONFIG_MSDOS_FS=y
-CONFIG_UMSDOS_FS=y
-CONFIG_VFAT_FS=y
-# CONFIG_EFS_FS is not set
-# CONFIG_JFFS_FS is not set
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_FS_DEBUG=0
-# CONFIG_CRAMFS is not set
-# CONFIG_TMPFS is not set
-CONFIG_RAMFS=y
-# CONFIG_ISO9660_FS is not set
-# CONFIG_JOLIET is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_FREEVXFS_FS is not set
-# CONFIG_NTFS_FS is not set
-# CONFIG_NTFS_DEBUG is not set
-# CONFIG_NTFS_RW is not set
-# CONFIG_HPFS_FS is not set
-CONFIG_PROC_FS=y
-# CONFIG_DEVFS_FS is not set
-# CONFIG_DEVFS_MOUNT is not set
-# CONFIG_DEVFS_DEBUG is not set
-CONFIG_DEVPTS_FS=y
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_QNX4FS_RW is not set
-CONFIG_ROMFS_FS=y
-CONFIG_EXT2_FS=y
-# CONFIG_SYSV_FS is not set
-# CONFIG_UDF_FS is not set
-# CONFIG_UDF_RW is not set
-# CONFIG_UFS_FS is not set
-# CONFIG_UFS_FS_WRITE is not set
-
-#
-# Network File Systems
-#
-# CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-# CONFIG_ROOT_NFS is not set
-# CONFIG_NFSD is not set
-# CONFIG_NFSD_V3 is not set
-CONFIG_SUNRPC=y
-CONFIG_LOCKD=y
-CONFIG_LOCKD_V4=y
-# CONFIG_SMB_FS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_NCPFS_PACKET_SIGNING is not set
-# CONFIG_NCPFS_IOCTL_LOCKING is not set
-# CONFIG_NCPFS_STRONG is not set
-# CONFIG_NCPFS_NFS_NS is not set
-# CONFIG_NCPFS_OS2_NS is not set
-# CONFIG_NCPFS_SMALLDOS is not set
-# CONFIG_NCPFS_NLS is not set
-# CONFIG_NCPFS_EXTRAS is not set
-
-#
-# Partition Types
-#
-# CONFIG_PARTITION_ADVANCED is not set
-CONFIG_MSDOS_PARTITION=y
-# CONFIG_SMB_NLS is not set
-CONFIG_NLS=y
-
-#
-# Native Language Support
-#
-CONFIG_NLS_DEFAULT="iso8859-1"
-# CONFIG_NLS_CODEPAGE_437 is not set
-# CONFIG_NLS_CODEPAGE_737 is not set
-# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
-# CONFIG_NLS_CODEPAGE_855 is not set
-# CONFIG_NLS_CODEPAGE_857 is not set
-# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
-# CONFIG_NLS_CODEPAGE_862 is not set
-# CONFIG_NLS_CODEPAGE_863 is not set
-# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
-# CONFIG_NLS_CODEPAGE_869 is not set
-# CONFIG_NLS_CODEPAGE_936 is not set
-# CONFIG_NLS_CODEPAGE_950 is not set
-# CONFIG_NLS_CODEPAGE_932 is not set
-# CONFIG_NLS_CODEPAGE_949 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_ISO8859_8 is not set
-# CONFIG_NLS_CODEPAGE_1251 is not set
-# CONFIG_NLS_ISO8859_1 is not set
-# CONFIG_NLS_ISO8859_2 is not set
-# CONFIG_NLS_ISO8859_3 is not set
-# CONFIG_NLS_ISO8859_4 is not set
-# CONFIG_NLS_ISO8859_5 is not set
-# CONFIG_NLS_ISO8859_6 is not set
-# CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_9 is not set
-# CONFIG_NLS_ISO8859_13 is not set
-# CONFIG_NLS_ISO8859_14 is not set
-# CONFIG_NLS_ISO8859_15 is not set
-# CONFIG_NLS_KOI8_R is not set
-# CONFIG_NLS_KOI8_U is not set
-# CONFIG_NLS_UTF8 is not set
-
-#
-# Console drivers
-#
-CONFIG_PC_KEYMAP=y
-# CONFIG_VGA_CONSOLE is not set
-
-#
-# Frame-buffer support
-#
-CONFIG_FB=y
-CONFIG_DUMMY_CONSOLE=y
-# CONFIG_FB_ACORN is not set
-# CONFIG_FB_ANAKIN is not set
-# CONFIG_FB_CLPS711X is not set
-# CONFIG_FB_CYBER2000 is not set
-CONFIG_FB_SA1100=y
-CONFIG_CERF_LCD_38_A=y
-# CONFIG_CERF_LCD_57_A is not set
-# CONFIG_CERF_LCD_72_A is not set
-CONFIG_SA1100_CERF_LCD_BACKLIGHT=y
-# CONFIG_FB_VIRTUAL is not set
-# CONFIG_FBCON_ADVANCED is not set
-CONFIG_FBCON_CFB2=y
-CONFIG_FBCON_CFB4=y
-CONFIG_FBCON_CFB8=y
-CONFIG_FBCON_CFB16=y
-# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
-# CONFIG_FBCON_FONTS is not set
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
-
-#
-# Sound
-#
-CONFIG_SOUND=y
-# CONFIG_SOUND_BT878 is not set
-# CONFIG_SOUND_CMPCI is not set
-# CONFIG_SOUND_EMU10K1 is not set
-# CONFIG_MIDI_EMU10K1 is not set
-# CONFIG_SOUND_FUSION is not set
-# CONFIG_SOUND_CS4281 is not set
-# CONFIG_SOUND_ES1370 is not set
-# CONFIG_SOUND_ES1371 is not set
-# CONFIG_SOUND_ESSSOLO1 is not set
-# CONFIG_SOUND_MAESTRO is not set
-# CONFIG_SOUND_MAESTRO3 is not set
-# CONFIG_SOUND_ICH is not set
-# CONFIG_SOUND_RME96XX is not set
-# CONFIG_SOUND_SONICVIBES is not set
-# CONFIG_SOUND_TRIDENT is not set
-# CONFIG_SOUND_MSNDCLAS is not set
-# CONFIG_SOUND_MSNDPIN is not set
-# CONFIG_SOUND_VIA82CXXX is not set
-# CONFIG_MIDI_VIA82CXXX is not set
-# CONFIG_SOUND_ASSABET_UDA1341 is not set
-# CONFIG_SOUND_H3600_UDA1341 is not set
-# CONFIG_SOUND_PANGOLIN_UDA1341 is not set
-# CONFIG_SOUND_SA1111_UDA1341 is not set
-CONFIG_SOUND_CERF_UDA1341=y
-# CONFIG_SOUND_SA1100SSP is not set
-# CONFIG_SOUND_OSS is not set
-# CONFIG_SOUND_WAVEARTIST is not set
-# CONFIG_SOUND_TVMIXER is not set
-
-#
-# USB support
-#
-# CONFIG_USB is not set
-
-#
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-# CONFIG_USB_OHCI_SA1111 is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-# CONFIG_USB_DABUSB is not set
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PLUSB is not set
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# Miscellaneous USB drivers
-#
-# CONFIG_USB_RIO500 is not set
-# CONFIG_USB_ID75 is not set
-
-#
-# Bluetooth support
-#
-CONFIG_BT=y
-CONFIG_BT_L2CAP=y
-
-#
-# Bluetooth device drivers
-#
-# CONFIG_BT_HCIUSB is not set
-CONFIG_BT_HCIUART=y
-# CONFIG_BT_HCIVHCI is not set
-
-#
-# Kernel hacking
-#
-CONFIG_FRAME_POINTER=y
-CONFIG_DEBUG_ERRORS=y
-CONFIG_DEBUG_USER=y
-# CONFIG_DEBUG_INFO is not set
-CONFIG_MAGIC_SYSRQ=y
-# CONFIG_NO_PGT_CACHE is not set
-# CONFIG_DEBUG_LL is not set
-# CONFIG_DEBUG_DC21285_PORT is not set
-# CONFIG_DEBUG_CLPS711X_UART2 is not set
diff -Nru a/arch/arm/configs/cerfpod_defconfig b/arch/arm/configs/cerfpod_defconfig
--- a/arch/arm/configs/cerfpod_defconfig	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,894 +0,0 @@
-#
-# Automatically generated make config: don't edit
-#
-CONFIG_ARM=y
-# CONFIG_EISA is not set
-# CONFIG_SBUS is not set
-# CONFIG_MCA is not set
-CONFIG_UID16=y
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-
-#
-# Code maturity level options
-#
-CONFIG_EXPERIMENTAL=y
-# CONFIG_OBSOLETE is not set
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-# CONFIG_KMOD is not set
-
-#
-# System Type
-#
-# CONFIG_ARCH_ANAKIN is not set
-# CONFIG_ARCH_ARCA5K is not set
-# CONFIG_ARCH_CLPS7500 is not set
-# CONFIG_ARCH_CLPS711X is not set
-# CONFIG_ARCH_CO285 is not set
-# CONFIG_ARCH_EBSA110 is not set
-# CONFIG_ARCH_FOOTBRIDGE is not set
-# CONFIG_ARCH_INTEGRATOR is not set
-# CONFIG_ARCH_L7200 is not set
-# CONFIG_ARCH_RPC is not set
-CONFIG_ARCH_SA1100=y
-# CONFIG_ARCH_SHARK is not set
-
-#
-# Archimedes/A5000 Implementations
-#
-
-#
-# Archimedes/A5000 Implementations (select only ONE)
-#
-# CONFIG_ARCH_ARC is not set
-# CONFIG_ARCH_A5K is not set
-
-#
-# Footbridge Implementations
-#
-# CONFIG_ARCH_CATS is not set
-# CONFIG_ARCH_PERSONAL_SERVER is not set
-# CONFIG_ARCH_EBSA285_ADDIN is not set
-# CONFIG_ARCH_EBSA285_HOST is not set
-# CONFIG_ARCH_NETWINDER is not set
-
-#
-# SA11x0 Implementations
-#
-# CONFIG_SA1100_ASSABET is not set
-# CONFIG_ASSABET_NEPONSET is not set
-# CONFIG_SA1100_ADSBITSY is not set
-# CONFIG_SA1100_BRUTUS is not set
-CONFIG_SA1100_CERF=y
-# CONFIG_SA1100_CERF_FLASH_8MB is not set
-CONFIG_SA1100_CERF_FLASH_16MB=y
-# CONFIG_SA1100_CERF_FLASH_32MB is not set
-# CONFIG_SA1100_CERF_CPLD is not set
-# CONFIG_SA1100_H3600 is not set
-# CONFIG_SA1100_EXTENEX1 is not set
-# CONFIG_SA1100_FLEXANET is not set
-# CONFIG_SA1100_FREEBIRD is not set
-# CONFIG_SA1100_GRAPHICSCLIENT is not set
-# CONFIG_SA1100_GRAPHICSMASTER is not set
-# CONFIG_SA1100_JORNADA720 is not set
-# CONFIG_SA1100_HUW_WEBPANEL is not set
-# CONFIG_SA1100_ITSY is not set
-# CONFIG_SA1100_LART is not set
-# CONFIG_SA1100_NANOENGINE is not set
-# CONFIG_SA1100_OMNIMETER is not set
-# CONFIG_SA1100_PANGOLIN is not set
-# CONFIG_SA1100_PLEB is not set
-# CONFIG_SA1100_SHERMAN is not set
-# CONFIG_SA1100_SIMPAD is not set
-# CONFIG_SA1100_PFS168 is not set
-# CONFIG_SA1100_VICTOR is not set
-# CONFIG_SA1100_XP860 is not set
-# CONFIG_SA1100_YOPY is not set
-CONFIG_SA1100_USB=y
-CONFIG_SA1100_USB_NETLINK=y
-CONFIG_SA1100_USB_CHAR=y
-
-#
-# CLPS711X/EP721X Implementations
-#
-# CONFIG_ARCH_CDB89712 is not set
-# CONFIG_ARCH_CLEP7312 is not set
-# CONFIG_ARCH_EDB7211 is not set
-# CONFIG_ARCH_P720T is not set
-# CONFIG_ARCH_EP7211 is not set
-# CONFIG_ARCH_EP7212 is not set
-# CONFIG_ARCH_ACORN is not set
-# CONFIG_FOOTBRIDGE is not set
-# CONFIG_FOOTBRIDGE_HOST is not set
-# CONFIG_FOOTBRIDGE_ADDIN is not set
-CONFIG_CPU_32=y
-# CONFIG_CPU_26 is not set
-
-#
-# Processor Type
-#
-# CONFIG_CPU_32v3 is not set
-CONFIG_CPU_32v4=y
-# CONFIG_CPU_ARM610 is not set
-# CONFIG_CPU_ARM710 is not set
-# CONFIG_CPU_ARM720T is not set
-# CONFIG_CPU_ARM920T is not set
-# CONFIG_CPU_ARM1020 is not set
-# CONFIG_CPU_SA110 is not set
-CONFIG_CPU_SA1100=y
-# CONFIG_ARM_THUMB is not set
-CONFIG_DISCONTIGMEM=y
-
-#
-# General setup
-#
-# CONFIG_PCI is not set
-# CONFIG_ISA is not set
-# CONFIG_ISA_DMA is not set
-CONFIG_CPU_FREQ=y
-CONFIG_HOTPLUG=y
-
-#
-# PCMCIA/CardBus support
-#
-CONFIG_PCMCIA=y
-# CONFIG_I82365 is not set
-# CONFIG_TCIC is not set
-# CONFIG_PCMCIA_CLPS6700 is not set
-CONFIG_PCMCIA_SA1100=y
-CONFIG_NET=y
-CONFIG_SYSVIPC=y
-CONFIG_BSD_PROCESS_ACCT=y
-CONFIG_SYSCTL=y
-
-#
-# At least one math emulation must be selected
-#
-CONFIG_FPE_NWFPE=y
-# CONFIG_FPE_FASTFPE is not set
-CONFIG_KCORE_ELF=y
-# CONFIG_KCORE_AOUT is not set
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
-# CONFIG_PM is not set
-# CONFIG_APM is not set
-# CONFIG_ARTHUR is not set
-CONFIG_CMDLINE="console=ttySA0 root=/dev/mtdblock3 rw mem=32M"
-# CONFIG_PFS168_CMDLINE is not set
-CONFIG_LEDS=y
-CONFIG_LEDS_TIMER=y
-CONFIG_LEDS_CPU=y
-CONFIG_ALIGNMENT_TRAP=y
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-
-#
-# Memory Technology Devices (MTD)
-#
-CONFIG_MTD=y
-# CONFIG_MTD_DEBUG is not set
-CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_REDBOOT_PARTS is not set
-# CONFIG_MTD_BOOTLDR_PARTS is not set
-# CONFIG_MTD_AFS_PARTS is not set
-
-#
-# User Modules And Translation Layers
-#
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_FTL is not set
-# CONFIG_NFTL is not set
-
-#
-# RAM/ROM/Flash chip drivers
-#
-CONFIG_MTD_CFI=y
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_GEN_PROBE=y
-# CONFIG_MTD_CFI_ADV_OPTIONS is not set
-CONFIG_MTD_CFI_INTELEXT=y
-# CONFIG_MTD_CFI_AMDSTD is not set
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_ABSENT is not set
-# CONFIG_MTD_OBSOLETE_CHIPS is not set
-
-#
-# Mapping drivers for chip access
-#
-# CONFIG_MTD_PHYSMAP is not set
-# CONFIG_MTD_SUN_UFLASH is not set
-# CONFIG_MTD_NORA is not set
-# CONFIG_MTD_PNC2000 is not set
-# CONFIG_MTD_RPXLITE is not set
-# CONFIG_MTD_TQM8XXL is not set
-# CONFIG_MTD_SC520CDP is not set
-# CONFIG_MTD_NETSC520 is not set
-# CONFIG_MTD_SBC_GXX is not set
-# CONFIG_MTD_ELAN_104NC is not set
-# CONFIG_MTD_DBOX2 is not set
-# CONFIG_MTD_CSTM_MIPS_IXX is not set
-# CONFIG_MTD_CFI_FLAGADM is not set
-# CONFIG_MTD_SOLUTIONENGINE is not set
-# CONFIG_MTD_MIXMEM is not set
-# CONFIG_MTD_OCTAGON is not set
-# CONFIG_MTD_VMAX is not set
-# CONFIG_MTD_OCELOT is not set
-# CONFIG_MTD_L440GX is not set
-# CONFIG_MTD_ARM_INTEGRATOR is not set
-# CONFIG_MTD_CDB89712 is not set
-CONFIG_MTD_SA1100=y
-# CONFIG_MTD_DC21285 is not set
-# CONFIG_MTD_IQ80310 is not set
-
-#
-# Self-contained MTD device drivers
-#
-# CONFIG_MTD_PMC551 is not set
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_LART is not set
-# CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_BLKMTD is not set
-
-#
-# Disk-On-Chip Device Drivers
-#
-# CONFIG_MTD_DOC1000 is not set
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOCPROBE is not set
-
-#
-# NAND Flash Device Drivers
-#
-# CONFIG_MTD_NAND is not set
-
-#
-# Plug and Play configuration
-#
-# CONFIG_PNP is not set
-# CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
-
-#
-# Block devices
-#
-# CONFIG_BLK_DEV_FD is not set
-# CONFIG_BLK_DEV_XD 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_LOOP=y
-# CONFIG_BLK_DEV_NBD is not set
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=4096
-CONFIG_BLK_DEV_INITRD=y
-
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-# CONFIG_BLK_DEV_MD is not set
-# CONFIG_MD_LINEAR is not set
-# CONFIG_MD_RAID0 is not set
-# CONFIG_MD_RAID1 is not set
-# CONFIG_MD_RAID5 is not set
-# CONFIG_BLK_DEV_LVM is not set
-
-#
-# Networking options
-#
-CONFIG_PACKET=y
-CONFIG_PACKET_MMAP=y
-CONFIG_NETLINK=y
-CONFIG_RTNETLINK=y
-# CONFIG_NETLINK_DEV is not set
-# CONFIG_NETFILTER is not set
-CONFIG_FILTER=y
-CONFIG_UNIX=y
-CONFIG_INET=y
-CONFIG_IP_MULTICAST=y
-# CONFIG_IP_ADVANCED_ROUTER is not set
-# CONFIG_IP_PNP is not set
-# CONFIG_NET_IPIP is not set
-# CONFIG_NET_IPGRE is not set
-# CONFIG_IP_MROUTE is not set
-# CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
-# CONFIG_SYN_COOKIES is not set
-# CONFIG_IPV6 is not set
-# CONFIG_KHTTPD is not set
-# CONFIG_ATM is not set
-
-#
-#
-#
-# CONFIG_IPX is not set
-# CONFIG_ATALK is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
-# CONFIG_X25 is not set
-# CONFIG_LAPB is not set
-# CONFIG_LLC is not set
-# CONFIG_NET_DIVERT is not set
-# CONFIG_ECONET is not set
-# CONFIG_WAN_ROUTER is not set
-# CONFIG_NET_FASTROUTE is not set
-# CONFIG_NET_HW_FLOWCONTROL is not set
-
-#
-# QoS and/or fair queueing
-#
-# CONFIG_NET_SCHED is not set
-
-#
-# Network device support
-#
-CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
-# CONFIG_ETHERTAP is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
-CONFIG_NET_ETHERNET=y
-# CONFIG_SUNLANCE is not set
-# CONFIG_SUNBMAC is not set
-# CONFIG_SUNQE is not set
-# CONFIG_SUNLANCE is not set
-# CONFIG_SUNGEM is not set
-CONFIG_NET_VENDOR_3COM=y
-# CONFIG_EL1 is not set
-# CONFIG_EL2 is not set
-# CONFIG_ELPLUS is not set
-# CONFIG_EL16 is not set
-# CONFIG_ELMC is not set
-# CONFIG_ELMC_II is not set
-CONFIG_CERF_CS8900A=y
-# CONFIG_LANCE is not set
-# CONFIG_NET_VENDOR_SMC is not set
-# CONFIG_NET_VENDOR_RACAL is not set
-# CONFIG_NET_ISA is not set
-# CONFIG_NET_PCI is not set
-# CONFIG_NET_POCKET is not set
-
-#
-# Ethernet (1000 Mbit)
-#
-# CONFIG_ACENIC is not set
-# CONFIG_DL2K is not set
-# CONFIG_MYRI_SBUS is not set
-# CONFIG_NS83820 is not set
-# CONFIG_HAMACHI is not set
-# CONFIG_YELLOWFIN is not set
-# CONFIG_SK98LIN is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PLIP is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
-
-#
-# Token Ring devices
-#
-# CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# PCMCIA network device support
-#
-CONFIG_NET_PCMCIA=y
-# CONFIG_PCMCIA_3C589 is not set
-# CONFIG_PCMCIA_3C574 is not set
-# CONFIG_PCMCIA_FMVJ18X is not set
-CONFIG_PCMCIA_PCNET=y
-# CONFIG_PCMCIA_NMCLAN is not set
-# CONFIG_PCMCIA_SMC91C92 is not set
-# CONFIG_PCMCIA_XIRC2PS is not set
-# CONFIG_ARCNET_COM20020_CS is not set
-# CONFIG_PCMCIA_IBMTR is not set
-# CONFIG_NET_PCMCIA_RADIO is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# ATA/IDE/MFM/RLL support
-#
-CONFIG_IDE=y
-
-#
-# IDE, ATA and ATAPI Block devices
-#
-CONFIG_BLK_DEV_IDE=y
-
-#
-# Please see Documentation/ide.txt for help/info on IDE drives
-#
-# CONFIG_BLK_DEV_HD_IDE is not set
-# CONFIG_BLK_DEV_HD is not set
-CONFIG_BLK_DEV_IDEDISK=y
-# CONFIG_IDEDISK_MULTI_MODE is not set
-CONFIG_BLK_DEV_IDECS=m
-# CONFIG_BLK_DEV_IDECD is not set
-# CONFIG_BLK_DEV_IDETAPE is not set
-# CONFIG_BLK_DEV_IDEFLOPPY is not set
-# CONFIG_BLK_DEV_IDESCSI is not set
-
-#
-# IDE chipset support/bugfixes
-#
-# CONFIG_BLK_DEV_CMD640 is not set
-# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
-# CONFIG_BLK_DEV_ISAPNP is not set
-# CONFIG_IDE_CHIPSETS is not set
-# CONFIG_IDEDMA_AUTO is not set
-# CONFIG_BLK_DEV_ATARAID is not set
-# CONFIG_BLK_DEV_ATARAID_PDC is not set
-# CONFIG_BLK_DEV_ATARAID_HPT is not set
-
-#
-# SCSI support
-#
-# CONFIG_SCSI is not set
-
-#
-# I2O device support
-#
-# CONFIG_I2O is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
-
-#
-# ISDN subsystem
-#
-# CONFIG_ISDN is not set
-
-#
-# Input core support
-#
-# CONFIG_INPUT is not set
-# CONFIG_INPUT_KEYBDEV is not set
-# CONFIG_INPUT_MOUSEDEV is not set
-# CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_EVDEV is not set
-
-#
-# Character devices
-#
-CONFIG_VT=y
-# CONFIG_VT_CONSOLE is not set
-# CONFIG_SERIAL is not set
-# CONFIG_SERIAL_EXTENDED is not set
-# CONFIG_SERIAL_NONSTANDARD is not set
-
-#
-# Serial drivers
-#
-# CONFIG_SERIAL_ANAKIN is not set
-# CONFIG_SERIAL_ANAKIN_CONSOLE is not set
-# CONFIG_SERIAL_AMBA is not set
-# CONFIG_SERIAL_AMBA_CONSOLE is not set
-# CONFIG_SERIAL_CLPS711X is not set
-# CONFIG_SERIAL_CLPS711X_CONSOLE is not set
-# CONFIG_SERIAL_21285 is not set
-# CONFIG_SERIAL_21285_OLD is not set
-# CONFIG_SERIAL_21285_CONSOLE is not set
-CONFIG_SERIAL_SA1100=y
-CONFIG_SERIAL_SA1100_CONSOLE=y
-CONFIG_SA1100_DEFAULT_BAUDRATE=38400
-# CONFIG_SERIAL_8250 is not set
-# CONFIG_SERIAL_8250_CONSOLE is not set
-# CONFIG_SERIAL_8250_EXTENDED is not set
-# CONFIG_SERIAL_8250_MANY_PORTS is not set
-# CONFIG_SERIAL_8250_SHARE_IRQ is not set
-# CONFIG_SERIAL_8250_DETECT_IRQ is not set
-# CONFIG_SERIAL_8250_MULTIPORT is not set
-# CONFIG_SERIAL_8250_HUB6 is not set
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
-CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=32
-CONFIG_UCB1200=y
-CONFIG_TOUCHSCREEN_UCB1200=y
-# CONFIG_CERF_TS_MANUAL is not set
-CONFIG_AUDIO_UCB1200=y
-# CONFIG_ADC_UCB1200 is not set
-# CONFIG_TOUCHSCREEN_H3600 is not set
-# CONFIG_PROFILER is not set
-# CONFIG_PFS168_SPI is not set
-# CONFIG_PFS168_DTMF is not set
-# CONFIG_PFS168_MISC is not set
-
-#
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# L3 serial bus support
-#
-# CONFIG_L3 is not set
-# CONFIG_L3_ALGOBIT is not set
-# CONFIG_L3_BIT_SA1100_GPIO is not set
-# CONFIG_BIT_SA1100_UCB1200 is not set
-
-#
-# Other L3 adapters
-#
-# CONFIG_L3_SA1111 is not set
-
-#
-# L3 driver support
-#
-# CONFIG_L3_DRV_UDA1341 is not set
-# CONFIG_BIT_SA1100_GPIO is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
-# CONFIG_MOUSE is not set
-
-#
-# Joysticks
-#
-# CONFIG_INPUT_GAMEPORT is not set
-
-#
-# Input core support is needed for gameports
-#
-
-#
-# Input core support is needed for joysticks
-#
-# CONFIG_QIC02_TAPE is not set
-
-#
-# Watchdog Cards
-#
-# CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
-# CONFIG_NVRAM is not set
-# CONFIG_RTC is not set
-CONFIG_SA1100_RTC=y
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
-
-#
-# Ftape, the floppy tape device driver
-#
-# CONFIG_FTAPE is not set
-# CONFIG_AGP is not set
-# CONFIG_DRM is not set
-
-#
-# PCMCIA character devices
-#
-
-#
-# Multimedia devices
-#
-# CONFIG_VIDEO_DEV is not set
-
-#
-# File systems
-#
-# CONFIG_QUOTA is not set
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-# CONFIG_REISERFS_FS is not set
-# CONFIG_REISERFS_CHECK is not set
-# CONFIG_REISERFS_PROC_INFO is not set
-# CONFIG_ADFS_FS is not set
-# CONFIG_ADFS_FS_RW is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_CMS_FS is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_JBD is not set
-# CONFIG_JBD_DEBUG is not set
-CONFIG_FAT_FS=y
-CONFIG_MSDOS_FS=y
-CONFIG_UMSDOS_FS=y
-CONFIG_VFAT_FS=y
-# CONFIG_EFS_FS is not set
-# CONFIG_JFFS_FS is not set
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_FS_DEBUG=0
-# CONFIG_CRAMFS is not set
-# CONFIG_TMPFS is not set
-CONFIG_RAMFS=y
-# CONFIG_ISO9660_FS is not set
-# CONFIG_JOLIET is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_FREEVXFS_FS is not set
-# CONFIG_NTFS_FS is not set
-# CONFIG_NTFS_DEBUG is not set
-# CONFIG_NTFS_RW is not set
-# CONFIG_HPFS_FS is not set
-CONFIG_PROC_FS=y
-# CONFIG_DEVFS_FS is not set
-# CONFIG_DEVFS_MOUNT is not set
-# CONFIG_DEVFS_DEBUG is not set
-CONFIG_DEVPTS_FS=y
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_QNX4FS_RW is not set
-CONFIG_ROMFS_FS=y
-CONFIG_EXT2_FS=y
-# CONFIG_SYSV_FS is not set
-# CONFIG_UDF_FS is not set
-# CONFIG_UDF_RW is not set
-# CONFIG_UFS_FS is not set
-# CONFIG_UFS_FS_WRITE is not set
-
-#
-# Network File Systems
-#
-# CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-# CONFIG_ROOT_NFS is not set
-# CONFIG_NFSD is not set
-# CONFIG_NFSD_V3 is not set
-CONFIG_SUNRPC=y
-CONFIG_LOCKD=y
-CONFIG_LOCKD_V4=y
-# CONFIG_SMB_FS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_NCPFS_PACKET_SIGNING is not set
-# CONFIG_NCPFS_IOCTL_LOCKING is not set
-# CONFIG_NCPFS_STRONG is not set
-# CONFIG_NCPFS_NFS_NS is not set
-# CONFIG_NCPFS_OS2_NS is not set
-# CONFIG_NCPFS_SMALLDOS is not set
-# CONFIG_NCPFS_NLS is not set
-# CONFIG_NCPFS_EXTRAS is not set
-
-#
-# Partition Types
-#
-# CONFIG_PARTITION_ADVANCED is not set
-CONFIG_MSDOS_PARTITION=y
-# CONFIG_SMB_NLS is not set
-CONFIG_NLS=y
-
-#
-# Native Language Support
-#
-CONFIG_NLS_DEFAULT="iso8859-1"
-# CONFIG_NLS_CODEPAGE_437 is not set
-# CONFIG_NLS_CODEPAGE_737 is not set
-# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
-# CONFIG_NLS_CODEPAGE_855 is not set
-# CONFIG_NLS_CODEPAGE_857 is not set
-# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
-# CONFIG_NLS_CODEPAGE_862 is not set
-# CONFIG_NLS_CODEPAGE_863 is not set
-# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
-# CONFIG_NLS_CODEPAGE_869 is not set
-# CONFIG_NLS_CODEPAGE_936 is not set
-# CONFIG_NLS_CODEPAGE_950 is not set
-# CONFIG_NLS_CODEPAGE_932 is not set
-# CONFIG_NLS_CODEPAGE_949 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_ISO8859_8 is not set
-# CONFIG_NLS_CODEPAGE_1251 is not set
-# CONFIG_NLS_ISO8859_1 is not set
-# CONFIG_NLS_ISO8859_2 is not set
-# CONFIG_NLS_ISO8859_3 is not set
-# CONFIG_NLS_ISO8859_4 is not set
-# CONFIG_NLS_ISO8859_5 is not set
-# CONFIG_NLS_ISO8859_6 is not set
-# CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_9 is not set
-# CONFIG_NLS_ISO8859_13 is not set
-# CONFIG_NLS_ISO8859_14 is not set
-# CONFIG_NLS_ISO8859_15 is not set
-# CONFIG_NLS_KOI8_R is not set
-# CONFIG_NLS_KOI8_U is not set
-# CONFIG_NLS_UTF8 is not set
-
-#
-# Console drivers
-#
-CONFIG_PC_KEYMAP=y
-# CONFIG_VGA_CONSOLE is not set
-
-#
-# Frame-buffer support
-#
-CONFIG_FB=y
-CONFIG_DUMMY_CONSOLE=y
-# CONFIG_FB_ACORN is not set
-# CONFIG_FB_ANAKIN is not set
-# CONFIG_FB_CLPS711X is not set
-# CONFIG_FB_CYBER2000 is not set
-CONFIG_FB_SA1100=y
-# CONFIG_CERF_LCD_38_A is not set
-CONFIG_CERF_LCD_57_A=y
-# CONFIG_CERF_LCD_72_A is not set
-# CONFIG_FB_VIRTUAL is not set
-# CONFIG_FBCON_ADVANCED is not set
-CONFIG_FBCON_CFB2=y
-CONFIG_FBCON_CFB4=y
-CONFIG_FBCON_CFB8=y
-CONFIG_FBCON_CFB16=y
-# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
-# CONFIG_FBCON_FONTS is not set
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
-
-#
-# Sound
-#
-# CONFIG_SOUND is not set
-
-#
-# USB support
-#
-# CONFIG_USB is not set
-
-#
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-# CONFIG_USB_OHCI_SA1111 is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-# CONFIG_USB_DABUSB is not set
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PLUSB is not set
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# Miscellaneous USB drivers
-#
-# CONFIG_USB_RIO500 is not set
-# CONFIG_USB_ID75 is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-
-#
-# Kernel hacking
-#
-CONFIG_FRAME_POINTER=y
-CONFIG_DEBUG_ERRORS=y
-CONFIG_DEBUG_USER=y
-# CONFIG_DEBUG_INFO is not set
-CONFIG_MAGIC_SYSRQ=y
-# CONFIG_NO_PGT_CACHE is not set
-# CONFIG_DEBUG_LL is not set
-# CONFIG_DEBUG_DC21285_PORT is not set
-# CONFIG_DEBUG_CLPS711X_UART2 is not set
diff -Nru a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
--- a/arch/arm/kernel/asm-offsets.c	Tue Feb  3 19:45:17 2004
+++ b/arch/arm/kernel/asm-offsets.c	Tue Feb  3 19:45:17 2004
@@ -45,7 +45,6 @@
 
 int main(void)
 {
-  DEFINE(TSK_USED_MATH,		offsetof(struct task_struct, used_math));
   DEFINE(TSK_ACTIVE_MM,		offsetof(struct task_struct, active_mm));
   BLANK();
   DEFINE(VMA_VM_MM,		offsetof(struct vm_area_struct, vm_mm));
diff -Nru a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
--- a/arch/arm/kernel/entry-armv.S	Tue Feb  3 19:45:17 2004
+++ b/arch/arm/kernel/entry-armv.S	Tue Feb  3 19:45:17 2004
@@ -673,48 +673,6 @@
 		and	r2, r6, #31			@ int mode
 		b	bad_mode
 
-#if 1 /* defined CONFIG_FPE_NWFPE || defined CONFIG_FPE_FASTFPE */
-		/* The FPE is always present */
-		.equ	fpe_not_present, fpundefinstr
-#else
-wfs_mask_data:	.word	0x0e200110			@ WFS/RFS
-		.word	0x0fef0fff
-		.word	0x0d000100			@ LDF [sp]/STF [sp]
-		.word	0x0d000100			@ LDF [fp]/STF [fp]
-		.word	0x0f000f00
-
-/* We get here if an undefined instruction happens and the floating
- * point emulator is not present.  If the offending instruction was
- * a WFS, we just perform a normal return as if we had emulated the
- * operation.  This is a hack to allow some basic userland binaries
- * to run so that the emulator module proper can be loaded. --philb
- */
-fpe_not_present:
-		adr	r10, wfs_mask_data
-		ldmia	r10, {r4, r5, r6, r7, r8}
-		ldr	r10, [sp, #S_PC]		@ Load PC
-		sub	r10, r10, #4
-		mask_pc	r10, r10
-		ldrt	r10, [r10]			@ get instruction
-		and	r5, r10, r5
-		teq	r5, r4				@ Is it WFS?
-		moveq	pc, r9
-		and	r5, r10, r8
-		teq	r5, r6				@ Is it LDF/STF on sp or fp?
-		teqne	r5, r7
-		movne	pc, lr
-		tst	r10, #0x00200000		@ Does it have WB
-		moveq	pc, r9
-		and	r4, r10, #255			@ get offset
-		and	r6, r10, #0x000f0000
-		tst	r10, #0x00800000		@ +/-
-		ldr	r5, [sp, r6, lsr #14]		@ Load reg
-		rsbeq	r4, r4, #0
-		add	r5, r5, r4, lsl #2
-		str	r5, [sp, r6, lsr #14]		@ Save reg
-		mov	pc, r9
-#endif
-
 /*
  * SVC mode handlers
  */
@@ -963,23 +921,46 @@
  * co-processor instructions.  However, we have to watch out
  * for the ARM6/ARM7 SWI bug.
  *
- * Emulators may wish to make use of the instruction value we
- * prepared for them in r0.
+ * Emulators may wish to make use of the following registers:
+ *  r0  - instruction opcode.
+ *  r10 - this threads thread_info structure.
  */
 call_fpe:	enable_irq r10				@ Enable interrupts
 		tst	r0, #0x08000000			@ only CDP/CPRT/LDC/STC have bit 27
 #if defined(CONFIG_CPU_ARM610) || defined(CONFIG_CPU_ARM710)
-		and	r10, r0, #0x0f000000		@ mask out op-code bits
-		teqne	r10, #0x0f000000		@ SWI (ARM6/7 bug)?
+		and	r8, r0, #0x0f000000		@ mask out op-code bits
+		teqne	r8, #0x0f000000			@ SWI (ARM6/7 bug)?
 #endif
 		moveq	pc, lr
-do_fpe:		get_thread_info r10			@ get current thread
-		ldr	r4, [r10, #TI_TASK]		@ get current task
-		mov	r8, #1
-		strb	r8, [r4, #TSK_USED_MATH]	@ set current->used_math
-		ldr	r4, .LCfp
+		get_thread_info r10			@ get current thread
+		and	r8, r0, #0x00000f00		@ mask out CP number
+		mov	r7, #1
+		add	r6, r10, #TI_USED_CP
+		strb	r7, [r6, r8, lsr #8]		@ set appropriate used_cp[]
+		add	pc, pc, r8, lsr #6
+		mov	r0, r0
+
+		mov	pc, lr				@ CP#0
+		b	do_fpe				@ CP#1 (FPE)
+		b	do_fpe				@ CP#2 (FPE)
+		mov	pc, lr				@ CP#3
+		mov	pc, lr				@ CP#4
+		mov	pc, lr				@ CP#5
+		mov	pc, lr				@ CP#6
+		mov	pc, lr				@ CP#7
+		mov	pc, lr				@ CP#8
+		mov	pc, lr				@ CP#9
+		mov	pc, lr				@ CP#10 (VFP)
+		mov	pc, lr				@ CP#11 (VFP)
+		mov	pc, lr				@ CP#12
+		mov	pc, lr				@ CP#13
+		mov	pc, lr				@ CP#14 (Debug)
+		mov	pc, lr				@ CP#15 (Control)
+
+do_fpe:		ldr	r4, .LCfp
 		add	r10, r10, #TI_FPSTATE		@ r10 = workspace
 		ldr	pc, [r4]			@ Call FP module USR entry point
+
 /*
  * The FP module is called with these registers set:
  *  r0  = instruction
@@ -989,6 +970,11 @@
  *  lr  = unrecognised FP instruction return address
  */
 
+		.data
+ENTRY(fp_enter)
+		.word	fpundefinstr
+		.text
+
 fpundefinstr:	mov	r0, sp
 		adrsvc	al, lr, ret_from_exception
 		b	do_undefinstr
@@ -1016,10 +1002,6 @@
 		mov	why, #0
 		b	ret_to_user
 
-		.data
-ENTRY(fp_enter)
-		.word	fpe_not_present
-		.text
 /*
  * Register switch for ARMv3 and ARMv4 processors
  * r0 = previous thread_info, r1 = next thread_info
diff -Nru a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
--- a/arch/arm/kernel/process.c	Tue Feb  3 19:45:42 2004
+++ b/arch/arm/kernel/process.c	Tue Feb  3 19:45:42 2004
@@ -307,8 +307,7 @@
 	struct thread_info *thread = current_thread_info();
 	struct task_struct *tsk = current;
 
-	tsk->used_math = 0;
-
+	memset(thread->used_cp, 0, sizeof(thread->used_cp));
 	memset(&tsk->thread.debug, 0, sizeof(struct debug_info));
 	fp_init(&thread->fpstate);
 }
@@ -344,12 +343,12 @@
 int dump_fpu (struct pt_regs *regs, struct user_fp *fp)
 {
 	struct thread_info *thread = current_thread_info();
-	int used_math = current->used_math;
+	int used_math = thread->used_cp[1] | thread->used_cp[2];
 
 	if (used_math)
 		memcpy(fp, &thread->fpstate.soft, sizeof (*fp));
 
-	return used_math;
+	return used_math != 0;
 }
 
 /*
diff -Nru a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
--- a/arch/arm/kernel/ptrace.c	Tue Feb  3 19:45:16 2004
+++ b/arch/arm/kernel/ptrace.c	Tue Feb  3 19:45:16 2004
@@ -602,8 +602,9 @@
  */
 static int ptrace_setfpregs(struct task_struct *tsk, void *ufp)
 {
-	tsk->used_math = 1;
-	return copy_from_user(&tsk->thread_info->fpstate, ufp,
+	struct thread_info *thread = tsk->thread_info;
+	thread->used_cp[1] = thread->used_cp[2] = 1;
+	return copy_from_user(&thread->fpstate, ufp,
 			      sizeof(struct user_fp)) ? -EFAULT : 0;
 }
 
diff -Nru a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
--- a/arch/arm/kernel/setup.c	Tue Feb  3 19:45:28 2004
+++ b/arch/arm/kernel/setup.c	Tue Feb  3 19:45:28 2004
@@ -654,6 +654,17 @@
 	{ 0, ATAG_NONE }
 };
 
+static void (*init_machine)(void) __initdata;
+
+static int __init customize_machine(void)
+{
+	/* customizes platform devices, or adds new ones */
+	if (init_machine)
+		init_machine();
+	return 0;
+}
+arch_initcall(customize_machine);
+
 void __init setup_arch(char **cmdline_p)
 {
 	struct tag *tags = (struct tag *)&init_tags;
@@ -704,6 +715,7 @@
 	 * Set up various architecture-specific pointers
 	 */
 	init_arch_irq = mdesc->init_irq;
+	init_machine = mdesc->init_machine;
 
 #ifdef CONFIG_VT
 #if defined(CONFIG_VGA_CONSOLE)
diff -Nru a/arch/arm/lib/csumpartial.S b/arch/arm/lib/csumpartial.S
--- a/arch/arm/lib/csumpartial.S	Tue Feb  3 19:45:43 2004
+++ b/arch/arm/lib/csumpartial.S	Tue Feb  3 19:45:43 2004
@@ -41,7 +41,7 @@
 		tst	buf, #1			@ odd address?
 		ldrneb	td0, [buf], #1
 		subne	len, len, #1
-		adcnes	sum, sum, td0, lsl #byte(1)
+		adcnes	sum, sum, td0, put_byte_1
 
 .less4:		tst	len, #6
 		beq	.less8_byte
@@ -68,7 +68,7 @@
 
 .less8_byte:	tst	len, #1			@ odd number of bytes
 		ldrneb	td0, [buf], #1		@ include last byte
-		adcnes	sum, sum, td0, lsl #byte(0)	@ update checksum
+		adcnes	sum, sum, td0, put_byte_0	@ update checksum
 
 .done:		adc	r0, sum, #0		@ collect up the last carry
 		ldr	td0, [sp], #4
@@ -80,7 +80,7 @@
 .not_aligned:	tst	buf, #1			@ odd address
 		ldrneb	td0, [buf], #1		@ make even
 		subne	len, len, #1
-		adcnes	sum, sum, td0, lsl #byte(1)	@ update checksum
+		adcnes	sum, sum, td0, put_byte_1	@ update checksum
 
 		tst	buf, #2			@ 32-bit aligned?
 #if __LINUX_ARM_ARCH__ >= 4
diff -Nru a/arch/arm/lib/csumpartialcopygeneric.S b/arch/arm/lib/csumpartialcopygeneric.S
--- a/arch/arm/lib/csumpartialcopygeneric.S	Tue Feb  3 19:45:17 2004
+++ b/arch/arm/lib/csumpartialcopygeneric.S	Tue Feb  3 19:45:17 2004
@@ -36,16 +36,16 @@
 
 		load1b	ip
 		sub	len, len, #1
-		adcs	sum, sum, ip, lsl #byte(1)	@ update checksum
+		adcs	sum, sum, ip, put_byte_1	@ update checksum
 		strb	ip, [dst], #1
 		tst	dst, #2
 		moveq	pc, lr			@ dst is now 32bit aligned
 
 .dst_16bit:	load2b	r8, ip
 		sub	len, len, #2
-		adcs	sum, sum, r8, lsl #byte(0)
+		adcs	sum, sum, r8, put_byte_0
 		strb	r8, [dst], #1
-		adcs	sum, sum, ip, lsl #byte(1)
+		adcs	sum, sum, ip, put_byte_1
 		strb	ip, [dst], #1
 		mov	pc, lr			@ dst is now 32bit aligned
 
@@ -63,16 +63,16 @@
 		/* Align dst */
 		load1b	ip
 		sub	len, len, #1
-		adcs	sum, sum, ip, lsl #byte(1)	@ update checksum
+		adcs	sum, sum, ip, put_byte_1	@ update checksum
 		strb	ip, [dst], #1
 		tst	len, #6
 		beq	.less8_byteonly
 
 1:		load2b	r8, ip
 		sub	len, len, #2
-		adcs	sum, sum, r8, lsl #byte(0)
+		adcs	sum, sum, r8, put_byte_0
 		strb	r8, [dst], #1
-		adcs	sum, sum, ip, lsl #byte(1)
+		adcs	sum, sum, ip, put_byte_1
 		strb	ip, [dst], #1
 .less8_aligned:	tst	len, #6
 		bne	1b
@@ -80,7 +80,7 @@
 		tst	len, #1
 		beq	.done
 		load1b	r8
-		adcs	sum, sum, r8, lsl #byte(0)	@ update checksum
+		adcs	sum, sum, r8, put_byte_0	@ update checksum
 		strb	r8, [dst], #1
 		b	.done
 
@@ -139,17 +139,17 @@
 		beq	.done
 		load1l	r4
 		tst	len, #2
-		mov	r5, r4, lsr #byte(0)
+		mov	r5, r4, get_byte_0
 		beq	.exit
 		adcs	sum, sum, r4, push #16
 		strb	r5, [dst], #1
-		mov	r5, r4, lsr #byte(1)
+		mov	r5, r4, get_byte_1
 		strb	r5, [dst], #1
-		mov	r5, r4, lsr #byte(2)
+		mov	r5, r4, get_byte_2
 .exit:		tst	len, #1
 		strneb	r5, [dst], #1
 		andne	r5, r5, #255
-		adcnes	sum, sum, r5, lsl #byte(0)
+		adcnes	sum, sum, r5, put_byte_0
 
 		/*
 		 * If the dst pointer was not 16-bit aligned, we
@@ -213,14 +213,14 @@
 		mov	r4, r5, pull #8
 4:		ands	len, len, #3
 		beq	.done
-		mov	r5, r4, lsr #byte(0)
+		mov	r5, r4, get_byte_0
 		tst	len, #2
 		beq	.exit
 		adcs	sum, sum, r4, push #16
 		strb	r5, [dst], #1
-		mov	r5, r4, lsr #byte(1)
+		mov	r5, r4, get_byte_1
 		strb	r5, [dst], #1
-		mov	r5, r4, lsr #byte(2)
+		mov	r5, r4, get_byte_2
 		b	.exit
 
 .src2_aligned:	mov	r4, r5, pull #16
@@ -265,12 +265,12 @@
 		mov	r4, r5, pull #16
 4:		ands	len, len, #3
 		beq	.done
-		mov	r5, r4, lsr #byte(0)
+		mov	r5, r4, get_byte_0
 		tst	len, #2
 		beq	.exit
 		adcs	sum, sum, r4
 		strb	r5, [dst], #1
-		mov	r5, r4, lsr #byte(1)
+		mov	r5, r4, get_byte_1
 		strb	r5, [dst], #1
 		tst	len, #1
 		beq	.done
@@ -319,14 +319,14 @@
 		mov	r4, r5, pull #24
 4:		ands	len, len, #3
 		beq	.done
-		mov	r5, r4, lsr #byte(0)
+		mov	r5, r4, get_byte_0
 		tst	len, #2
 		beq	.exit
 		strb	r5, [dst], #1
 		adcs	sum, sum, r4
 		load1l	r4
-		mov	r5, r4, lsr #byte(0)
+		mov	r5, r4, get_byte_0
 		strb	r5, [dst], #1
 		adcs	sum, sum, r4, push #24
-		mov	r5, r4, lsr #byte(1)
+		mov	r5, r4, get_byte_1
 		b	.exit
diff -Nru a/arch/arm/lib/io-readsb.S b/arch/arm/lib/io-readsb.S
--- a/arch/arm/lib/io-readsb.S	Tue Feb  3 19:45:41 2004
+++ b/arch/arm/lib/io-readsb.S	Tue Feb  3 19:45:41 2004
@@ -37,35 +37,35 @@
 .insb_16_lp:	ldrb	r3, [r0]
 		ldrb	r4, [r0]
 		ldrb	r5, [r0]
-		mov	r3, r3,     lsl #byte(0)
+		mov	r3, r3,     put_byte_0
 		ldrb	r6, [r0]
-		orr	r3, r3, r4, lsl #byte(1)
+		orr	r3, r3, r4, put_byte_1
 		ldrb	r4, [r0]
-		orr	r3, r3, r5, lsl #byte(2)
+		orr	r3, r3, r5, put_byte_2
 		ldrb	r5, [r0]
-		orr	r3, r3, r6, lsl #byte(3)
+		orr	r3, r3, r6, put_byte_3
 		ldrb	r6, [r0]
-		mov	r4, r4,     lsl #byte(0)
+		mov	r4, r4,     put_byte_0
 		ldrb	ip, [r0]
-		orr	r4, r4, r5, lsl #byte(1)
+		orr	r4, r4, r5, put_byte_1
 		ldrb	r5, [r0]
-		orr	r4, r4, r6, lsl #byte(2)
+		orr	r4, r4, r6, put_byte_2
 		ldrb	r6, [r0]
-		orr	r4, r4, ip, lsl #byte(3)
+		orr	r4, r4, ip, put_byte_3
 		ldrb	ip, [r0]
-		mov	r5, r5,     lsl #byte(0)
+		mov	r5, r5,     put_byte_0
 		ldrb	lr, [r0]
-		orr	r5, r5, r6, lsl #byte(1)
+		orr	r5, r5, r6, put_byte_1
 		ldrb	r6, [r0]
-		orr	r5, r5, ip, lsl #byte(2)
+		orr	r5, r5, ip, put_byte_2
 		ldrb	ip, [r0]
-		orr	r5, r5, lr, lsl #byte(3)
+		orr	r5, r5, lr, put_byte_3
 		ldrb	lr, [r0]
-		mov	r6, r6,     lsl #byte(0)
-		orr	r6, r6, ip, lsl #byte(1)
+		mov	r6, r6,     put_byte_0
+		orr	r6, r6, ip, put_byte_1
 		ldrb	ip, [r0]
-		orr	r6, r6, lr, lsl #byte(2)
-		orr	r6, r6, ip, lsl #byte(3)
+		orr	r6, r6, lr, put_byte_2
+		orr	r6, r6, ip, put_byte_3
 		stmia	r1!, {r3 - r6}
 
 		subs	r2, r2, #16
@@ -80,19 +80,19 @@
 		ldrb	r3, [r0]
 		ldrb	r4, [r0]
 		ldrb	r5, [r0]
-		mov	r3, r3,     lsl #byte(0)
+		mov	r3, r3,     put_byte_0
 		ldrb	r6, [r0]
-		orr	r3, r3, r4, lsl #byte(1)
+		orr	r3, r3, r4, put_byte_1
 		ldrb	r4, [r0]
-		orr	r3, r3, r5, lsl #byte(2)
+		orr	r3, r3, r5, put_byte_2
 		ldrb	r5, [r0]
-		orr	r3, r3, r6, lsl #byte(3)
+		orr	r3, r3, r6, put_byte_3
 		ldrb	r6, [r0]
-		mov	r4, r4,     lsl #byte(0)
+		mov	r4, r4,     put_byte_0
 		ldrb	ip, [r0]
-		orr	r4, r4, r5, lsl #byte(1)
-		orr	r4, r4, r6, lsl #byte(2)
-		orr	r4, r4, ip, lsl #byte(3)
+		orr	r4, r4, r5, put_byte_1
+		orr	r4, r4, r6, put_byte_2
+		orr	r4, r4, ip, put_byte_3
 		stmia	r1!, {r3, r4}
 
 .insb_no_8:	tst	r2, #4
@@ -102,10 +102,10 @@
 		ldrb	r4, [r0]
 		ldrb	r5, [r0]
 		ldrb	r6, [r0]
-		mov	r3, r3,     lsl #byte(0)
-		orr	r3, r3, r4, lsl #byte(1)
-		orr	r3, r3, r5, lsl #byte(2)
-		orr	r3, r3, r6, lsl #byte(3)
+		mov	r3, r3,     put_byte_0
+		orr	r3, r3, r4, put_byte_1
+		orr	r3, r3, r5, put_byte_2
+		orr	r3, r3, r6, put_byte_3
 		str	r3, [r1], #4
 
 .insb_no_4:	ands	r2, r2, #3
diff -Nru a/arch/arm/lib/memcpy.S b/arch/arm/lib/memcpy.S
--- a/arch/arm/lib/memcpy.S	Tue Feb  3 19:45:41 2004
+++ b/arch/arm/lib/memcpy.S	Tue Feb  3 19:45:41 2004
@@ -16,14 +16,14 @@
 
 #define ENTER	\
 		mov	ip,sp	;\
-		stmfd	sp!,{r4-r9,fp,ip,lr,pc}	;\
+		stmfd	sp!,{r0,r4-r9,fp,ip,lr,pc}	;\
 		sub	fp,ip,#4
 
 #define EXIT	\
-		LOADREGS(ea, fp, {r4 - r9, fp, sp, pc})
+		LOADREGS(ea, fp, {r0, r4 - r9, fp, sp, pc})
 
 #define EXITEQ	\
-		LOADREGS(eqea, fp, {r4 - r9, fp, sp, pc})
+		LOADREGS(eqea, fp, {r0, r4 - r9, fp, sp, pc})
 
 /*
  * Prototype: void memcpy(void *to,const void *from,unsigned long n);
diff -Nru a/arch/arm/lib/uaccess.S b/arch/arm/lib/uaccess.S
--- a/arch/arm/lib/uaccess.S	Tue Feb  3 19:45:16 2004
+++ b/arch/arm/lib/uaccess.S	Tue Feb  3 19:45:16 2004
@@ -183,14 +183,14 @@
 		strnet	r3, [r0], #4			@ Shouldnt fault
 		ands	ip, ip, #3
 		beq	.c2u_1fupi
-.c2u_1nowords:	mov	r3, r7, lsr #byte(1)
+.c2u_1nowords:	mov	r3, r7, get_byte_1
 		teq	ip, #0
 		beq	.c2u_finished
 		cmp	ip, #2
 USER(		strbt	r3, [r0], #1)			@ May fault
-		movge	r3, r7, lsr #byte(2)
+		movge	r3, r7, get_byte_2
 USER(		strgebt	r3, [r0], #1)			@ May fault
-		movgt	r3, r7, lsr #byte(3)
+		movgt	r3, r7, get_byte_3
 USER(		strgtbt	r3, [r0], #1)			@ May fault
 		b	.c2u_finished
 
@@ -250,12 +250,12 @@
 		strnet	r3, [r0], #4			@ Shouldnt fault
 		ands	ip, ip, #3
 		beq	.c2u_2fupi
-.c2u_2nowords:	mov	r3, r7, lsr #byte(2)
+.c2u_2nowords:	mov	r3, r7, get_byte_2
 		teq	ip, #0
 		beq	.c2u_finished
 		cmp	ip, #2
 USER(		strbt	r3, [r0], #1)			@ May fault
-		movge	r3, r7, lsr #byte(3)
+		movge	r3, r7, get_byte_3
 USER(		strgebt	r3, [r0], #1)			@ May fault
 		ldrgtb	r3, [r1], #0
 USER(		strgtbt	r3, [r0], #1)			@ May fault
@@ -317,7 +317,7 @@
 		strnet	r3, [r0], #4			@ Shouldnt fault
 		ands	ip, ip, #3
 		beq	.c2u_3fupi
-.c2u_3nowords:	mov	r3, r7, lsr #byte(3)
+.c2u_3nowords:	mov	r3, r7, get_byte_3
 		teq	ip, #0
 		beq	.c2u_finished
 		cmp	ip, #2
@@ -496,14 +496,14 @@
 		strne	r3, [r0], #4
 		ands	ip, ip, #3
 		beq	.cfu_1fupi
-.cfu_1nowords:	mov	r3, r7, lsr #byte(1)
+.cfu_1nowords:	mov	r3, r7, get_byte_1
 		teq	ip, #0
 		beq	.cfu_finished
 		cmp	ip, #2
 		strb	r3, [r0], #1
-		movge	r3, r7, lsr #byte(2)
+		movge	r3, r7, get_byte_2
 		strgeb	r3, [r0], #1
-		movgt	r3, r7, lsr #byte(3)
+		movgt	r3, r7, get_byte_3
 		strgtb	r3, [r0], #1
 		b	.cfu_finished
 
@@ -563,12 +563,12 @@
 		strne	r3, [r0], #4
 		ands	ip, ip, #3
 		beq	.cfu_2fupi
-.cfu_2nowords:	mov	r3, r7, lsr #byte(2)
+.cfu_2nowords:	mov	r3, r7, get_byte_2
 		teq	ip, #0
 		beq	.cfu_finished
 		cmp	ip, #2
 		strb	r3, [r0], #1
-		movge	r3, r7, lsr #byte(3)
+		movge	r3, r7, get_byte_3
 		strgeb	r3, [r0], #1
 USER(		ldrgtbt	r3, [r1], #0)			@ May fault
 		strgtb	r3, [r0], #1
@@ -630,7 +630,7 @@
 		strne	r3, [r0], #4
 		ands	ip, ip, #3
 		beq	.cfu_3fupi
-.cfu_3nowords:	mov	r3, r7, lsr #byte(3)
+.cfu_3nowords:	mov	r3, r7, get_byte_3
 		teq	ip, #0
 		beq	.cfu_finished
 		cmp	ip, #2
diff -Nru a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
--- a/arch/arm/mach-pxa/generic.c	Tue Feb  3 19:45:17 2004
+++ b/arch/arm/mach-pxa/generic.c	Tue Feb  3 19:45:17 2004
@@ -20,13 +20,18 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/delay.h>
+#include <linux/device.h>
+#include <linux/ioport.h>
 #include <linux/pm.h>
 
 #include <asm/hardware.h>
+#include <asm/irq.h>
 #include <asm/system.h>
 #include <asm/pgtable.h>
 #include <asm/mach/map.h>
 
+#include <asm/arch/udc.h>
+
 #include "generic.h"
 
 /*
@@ -138,3 +143,76 @@
 	iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
 	get_clk_frequency_khz(1);
 }
+
+
+static struct resource pxamci_resources[] = {
+	[0] = {
+		.start	= 0x41100000,
+		.end	= 0x41100fff,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= IRQ_MMC,
+		.end	= IRQ_MMC,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static u64 pxamci_dmamask = 0xffffffffUL;
+
+static struct platform_device pxamci_device = {
+	.name		= "pxamci",
+	.id		= 0,
+	.dev		= {
+		.dma_mask = &pxamci_dmamask,
+	},
+	.num_resources	= ARRAY_SIZE(pxamci_resources),
+	.resource	= pxamci_resources,
+};
+
+
+static struct pxa2xx_udc_mach_info pxa_udc_info;
+
+void __init pxa_set_udc_info(struct pxa2xx_udc_mach_info *info)
+{
+	memcpy(&pxa_udc_info, info, sizeof *info);
+}
+EXPORT_SYMBOL(pxa_set_udc_info);
+
+static struct resource pxa2xx_udc_resources[] = {
+	[0] = {
+		.start	= 0x40600000,
+		.end	= 0x4060ffff,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= IRQ_USB,
+		.end	= IRQ_USB,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static u64 udc_dma_mask = ~(u32)0;
+
+static struct platform_device udc_device = {
+	.name		= "pxa2xx_udc",
+	.id		= 0,
+	.resource	= pxa2xx_udc_resources,
+	.num_resources	= ARRAY_SIZE(pxa2xx_udc_resources),
+	.dev		=  {
+		.platform_data	= &pxa_udc_info,
+		.dma_mask	= &udc_dma_mask,
+	}
+};
+
+static struct platform_device *devices[] __initdata = {
+	&pxamci_device,
+	&udc_device,
+};
+
+static int __init pxa_init(void)
+{
+	return platform_add_devices(devices, ARRAY_SIZE(devices));
+}
+
+subsys_initcall(pxa_init);
diff -Nru a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c
--- a/arch/arm/mach-pxa/idp.c	Tue Feb  3 19:45:16 2004
+++ b/arch/arm/mach-pxa/idp.c	Tue Feb  3 19:45:16 2004
@@ -54,14 +54,11 @@
 
 #endif
 
-static int __init idp_init(void)
+static void __init idp_init(void)
 {
 	printk("idp_init()\n");
-	return 0;
 }
 
-__initcall(idp_init);
-
 static void __init idp_init_irq(void)
 {
 	pxa_init_irq();
@@ -119,4 +116,5 @@
 	BOOT_MEM(0xa0000000, 0x40000000, 0xfc000000)
 	MAPIO(idp_map_io)
 	INITIRQ(idp_init_irq)
+	INIT_MACHINE(idp_init)
 MACHINE_END
diff -Nru a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
--- a/arch/arm/mach-pxa/lubbock.c	Tue Feb  3 19:45:17 2004
+++ b/arch/arm/mach-pxa/lubbock.c	Tue Feb  3 19:45:17 2004
@@ -29,6 +29,7 @@
 #include <asm/mach/irq.h>
 
 #include <asm/arch/irq.h>
+#include <asm/arch/udc.h>
 #include <asm/hardware/sa1111.h>
 
 #include "generic.h"
@@ -88,6 +89,16 @@
 	set_irq_type(IRQ_GPIO(0), IRQT_FALLING);
 }
 
+static int lubbock_udc_is_connected(void)
+{
+	return (LUB_MISC_RD & (1 << 9)) == 0;
+}
+
+static struct pxa2xx_udc_mach_info udc_info __initdata = {
+	.udc_is_connected	= lubbock_udc_is_connected,
+	// no D+ pullup; lubbock can't connect/disconnect in software
+};
+
 static struct resource sa1111_resources[] = {
 	[0] = {
 		.start	= 0x10000000,
@@ -112,13 +123,12 @@
 	&sa1111_device,
 };
 
-static int __init lubbock_init(void)
+static void __init lubbock_init(void)
 {
-	return platform_add_devices(devices, ARRAY_SIZE(devices));
+	pxa_set_udc_info(&udc_info);
+	(void) platform_add_devices(devices, ARRAY_SIZE(devices));
 }
 
-subsys_initcall(lubbock_init);
-
 static struct map_desc lubbock_io_desc[] __initdata = {
  /* virtual     physical    length      type */
   { 0xf0000000, 0x08000000, 0x00100000, MT_DEVICE }, /* CPLD */
@@ -157,4 +167,5 @@
 	BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
 	MAPIO(lubbock_map_io)
 	INITIRQ(lubbock_init_irq)
+	INIT_MACHINE(lubbock_init)
 MACHINE_END
diff -Nru a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
--- a/arch/arm/mach-sa1100/Kconfig	Tue Feb  3 19:45:43 2004
+++ b/arch/arm/mach-sa1100/Kconfig	Tue Feb  3 19:45:43 2004
@@ -37,9 +37,9 @@
 	bool "CerfBoard"
 	depends on ARCH_SA1100
 	help
-	  The Intrinsyc CerfBoard is based on the StrongARM 1110.
+	  The Intrinsyc CerfBoard is based on the StrongARM 1110 (Discontinued).
 	  More information is available at:
-	  <http://www.intrinsyc.com/products/referenceplatforms/cerfboard.html>.
+	  <http://www.intrinsyc.com/products/cerfboard/>.
 
 	  Say Y if configuring for an Intrinsyc CerfBoard.
 	  Say N otherwise.
@@ -59,15 +59,6 @@
 	bool "32MB"
 
 endchoice
-
-config SA1100_CERF_CPLD
-	bool "Cerf w/CPLD support (CerfPDA)"
-	depends on SA1100_CERF
-	help
-	  Say Y here to support the Linux CerfPDA development kit from
-	  Intrinsyc. This is a StrongARM-1110-based reference platform for
-	  designing custom PDAs.  Product info is at
-	  <http://www.intrinsyc.com/products/referencedesigns/cerfpda.asp>.
 
 config SA1100_H3100
 	bool "Compaq iPAQ H3100"
diff -Nru a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c
--- a/arch/arm/mach-sa1100/cerf.c	Tue Feb  3 19:45:17 2004
+++ b/arch/arm/mach-sa1100/cerf.c	Tue Feb  3 19:45:17 2004
@@ -1,48 +1,61 @@
 /*
  * linux/arch/arm/mach-sa1100/cerf.c
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Apr-2003 : Removed some old PDA crud [FB]
+ * Oct-2003 : Added uart2 resource [FB]
+ * Jan-2004 : Removed io map for flash [FB]
  */
+
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/tty.h>
+#include <linux/device.h>
 
 #include <asm/irq.h>
 #include <asm/hardware.h>
 #include <asm/setup.h>
 
+#include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/serial_sa1100.h>
 
+#include <asm/arch/cerf.h>
 #include "generic.h"
 
+static struct resource cerfuart2_resources[] = {
+	[0] = {
+		.start	= 0x80030000,
+		.end	= 0x8003ffff,
+		.flags	= IORESOURCE_MEM,
+	},
+};
+
+static struct platform_device cerfuart2_device = {
+	.name		= "sa11x0-uart",
+	.id		= 2,
+	.num_resources	= ARRAY_SIZE(cerfuart2_resources),
+	.resource	= cerfuart2_resources,
+};
+
+static struct platform_device *cerf_devices[] __initdata = {
+	&cerfuart2_device,
+};
 
 static void __init cerf_init_irq(void)
 {
 	sa1100_init_irq();
-
-	/* Need to register these as rising edge interrupts
-	 * For standard 16550 serial driver support
-	 * Basically - I copied it from pfs168.c :)
-	 */
-#ifdef CONFIG_SA1100_CERF_CPLD
-	/* PDA Full serial port */
-	set_irq_type(IRQ_GPIO3, IRQT_RISING);
-	/* PDA Bluetooth */
-	set_irq_type(IRQ_GPIO2, IRQT_RISING);
-#endif /* CONFIG_SA1100_CERF_CPLD */
-
-	set_irq_type(IRQ_GPIO_UCB1200_IRQ, IRQT_RISING);
+	set_irq_type(CERF_ETH_IRQ, IRQT_RISING);
 }
 
 static struct map_desc cerf_io_desc[] __initdata = {
   /* virtual	 physical    length	 type */
   { 0xf0000000, 0x08000000, 0x00100000, MT_DEVICE }  /* Crystal Ethernet Chip */
-#ifdef CONFIG_SA1100_CERF_CPLD
- ,{ 0xf1000000, 0x40000000, 0x00100000, MT_DEVICE }, /* CPLD Chip */
-  { 0xf2000000, 0x10000000, 0x00100000, MT_DEVICE }, /* CerfPDA Bluetooth */
-  { 0xf3000000, 0x18000000, 0x00100000, MT_DEVICE }  /* CerfPDA Serial */
-#endif
 };
 
 static void __init cerf_map_io(void)
@@ -51,21 +64,30 @@
 	iotable_init(cerf_io_desc, ARRAY_SIZE(cerf_io_desc));
 
 	sa1100_register_uart(0, 3);
-#ifdef CONFIG_SA1100_CERF_IRDA_ENABLED
-	sa1100_register_uart(1, 1);
-#else
-	sa1100_register_uart(1, 2);
+	sa1100_register_uart(1, 2); /* disable this and the uart2 device for sa1100_fir */
 	sa1100_register_uart(2, 1);
-#endif
 
 	/* set some GPDR bits here while it's safe */
-	GPDR |= GPIO_CF_RESET;
-#ifdef CONFIG_SA1100_CERF_CPLD
-	GPDR |= GPIO_PWR_SHUTDOWN;
-#endif
+	GPDR |= CERF_GPIO_CF_RESET;
 }
 
-MACHINE_START(CERF, "Intrinsyc's Cerf Family of Products")
+static int __init cerf_init(void)
+{
+	int ret;
+
+	if (!machine_is_cerf())
+		return -ENODEV;
+
+	ret = platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices));
+	if (ret < 0)
+		return ret;
+
+	return 0;
+}
+
+arch_initcall(cerf_init);
+
+MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
 	MAINTAINER("support@intrinsyc.com")
 	BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
 	MAPIO(cerf_map_io)
diff -Nru a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
--- a/arch/arm/mach-sa1100/generic.c	Tue Feb  3 19:45:17 2004
+++ b/arch/arm/mach-sa1100/generic.c	Tue Feb  3 19:45:17 2004
@@ -99,6 +99,7 @@
 {
 	return cclk_frequency_100khz[PPCR & 0xf] * 100;
 }
+EXPORT_SYMBOL(sa11x0_getspeed);
 #else
 /*
  * We still need to provide this so building without cpufreq works.
diff -Nru a/arch/arm/mach-sa1100/leds-cerf.c b/arch/arm/mach-sa1100/leds-cerf.c
--- a/arch/arm/mach-sa1100/leds-cerf.c	Tue Feb  3 19:45:16 2004
+++ b/arch/arm/mach-sa1100/leds-cerf.c	Tue Feb  3 19:45:16 2004
@@ -19,23 +19,11 @@
 static unsigned int led_state;
 static unsigned int hw_led_state;
 
-#ifdef CONFIG_SA1100_CERF_CPLD
-
-#define LED_D0		GPIO_GPIO(0)
-#define LED_D1		GPIO_GPIO(0)
-#define LED_D2		GPIO_GPIO(0)
-#define LED_D3		GPIO_GPIO(0)
-#define LED_MASK	(LED_D0|LED_D1|LED_D2|LED_D3)
-
-#else
-
 #define LED_D0          GPIO_GPIO(0)
 #define LED_D1          GPIO_GPIO(1)
 #define LED_D2          GPIO_GPIO(2)
 #define LED_D3          GPIO_GPIO(3)
 #define LED_MASK        (LED_D0|LED_D1|LED_D2|LED_D3)
-
-#endif
 
 void cerf_leds_event(led_event_t evt)
 {
diff -Nru a/arch/arm/mm/extable.c b/arch/arm/mm/extable.c
--- a/arch/arm/mm/extable.c	Tue Feb  3 19:45:28 2004
+++ b/arch/arm/mm/extable.c	Tue Feb  3 19:45:28 2004
@@ -4,27 +4,6 @@
 #include <linux/module.h>
 #include <asm/uaccess.h>
 
-const struct exception_table_entry *
-search_extable(const struct exception_table_entry *first,
-	       const struct exception_table_entry *last,
-	       unsigned long value)
-{
-        while (first <= last) {
-		const struct exception_table_entry *mid;
-		long diff;
-
-		mid = (last - first) / 2 + first;
-		diff = mid->insn - value;
-                if (diff == 0)
-                        return mid;
-                else if (diff < 0)
-                        first = mid+1;
-                else
-                        last = mid-1;
-        }
-        return NULL;
-}
-
 int fixup_exception(struct pt_regs *regs)
 {
 	const struct exception_table_entry *fixup;
diff -Nru a/arch/arm/mm/proc-arm720.S b/arch/arm/mm/proc-arm720.S
--- a/arch/arm/mm/proc-arm720.S	Tue Feb  3 19:45:30 2004
+++ b/arch/arm/mm/proc-arm720.S	Tue Feb  3 19:45:30 2004
@@ -126,6 +126,21 @@
 
 		__INIT
 
+		.type	__arm710_setup, #function
+__arm710_setup:	mov	r0, #0
+		mcr	p15, 0, r0, c7, c7, 0		@ invalidate caches
+		mcr	p15, 0, r0, c8, c7, 0		@ flush TLB (v4)
+		mcr	p15, 0, r4, c2, c0		@ load page table pointer
+		mov	r0, #0x1f			@ Domains 0, 1 = client
+		mcr	p15, 0, r0, c3, c0		@ load domain access register
+
+		mrc	p15, 0, r0, c1, c0		@ get control register
+		bic	r0, r0, #0x0e00			@ ..V. ..RS BLDP WCAM
+		orr	r0, r0, #0x0100			@ .... .... .111 .... (old)
+		orr	r0, r0, #0x003d			@ .... ..01 ..11 1101 (new)
+		mov	pc, lr				@ __ret (head-armv.S)
+		.size	__arm710_setup, . - __arm710_setup
+
 		.type	__arm720_setup, #function
 __arm720_setup:	mov	r0, #0
 		mcr	p15, 0, r0, c7, c7, 0		@ invalidate caches
@@ -169,6 +184,11 @@
 cpu_elf_name:	.asciz	"v4"
 		.size	cpu_elf_name, . - cpu_elf_name
 
+		.type	cpu_arm710_name, #object
+cpu_arm710_name:
+		.asciz	"ARM710T"
+		.size	cpu_arm710_name, . - cpu_arm710_name
+
 		.type	cpu_arm720_name, #object
 cpu_arm720_name:
 		.asciz	"ARM720T"
@@ -181,6 +201,22 @@
  */
 	
 		.section ".proc.info", #alloc, #execinstr
+
+		.type	__arm710_proc_info, #object
+__arm710_proc_info:
+		.long	0x41807100				@ cpu_val
+		.long	0xffffff00				@ cpu_mask
+		.long	0x00000c1e				@ section_mmu_flags
+		b	__arm710_setup				@ cpu_flush
+		.long	cpu_arch_name				@ arch_name
+		.long	cpu_elf_name				@ elf_name
+		.long	HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB	@ elf_hwcap
+		.long	cpu_arm710_name				@ name
+		.long	arm720_processor_functions
+		.long	v4_tlb_fns
+		.long	v4wt_user_fns
+		.long	v4_cache_fns
+		.size	__arm710_proc_info, . - __arm710_proc_info
 
 		.type	__arm720_proc_info, #object
 __arm720_proc_info:
diff -Nru a/arch/arm26/mm/extable.c b/arch/arm26/mm/extable.c
--- a/arch/arm26/mm/extable.c	Tue Feb  3 19:45:17 2004
+++ b/arch/arm26/mm/extable.c	Tue Feb  3 19:45:17 2004
@@ -6,27 +6,6 @@
 #include <linux/module.h>
 #include <asm/uaccess.h>
 
-const struct exception_table_entry *
-search_extable(const struct exception_table_entry *first,
-               const struct exception_table_entry *last,
-               unsigned long value)
-{
-        while (first <= last) {
-                const struct exception_table_entry *mid;
-                long diff;
-
-                mid = (last - first) / 2 + first;
-                diff = mid->insn - value;
-                if (diff == 0)
-                        return mid;
-                else if (diff < 0)
-                        first = mid+1;
-                else
-                        last = mid-1;
-        }
-        return NULL;
-}
-
 int fixup_exception(struct pt_regs *regs)
 {
         const struct exception_table_entry *fixup;
diff -Nru a/arch/cris/arch-v10/drivers/ds1302.c b/arch/cris/arch-v10/drivers/ds1302.c
--- a/arch/cris/arch-v10/drivers/ds1302.c	Tue Feb  3 19:45:42 2004
+++ b/arch/cris/arch-v10/drivers/ds1302.c	Tue Feb  3 19:45:42 2004
@@ -342,6 +342,7 @@
 		{
 			struct rtc_time rtc_tm;
 						
+			memset(&rtc_tm, 0, sizeof (struct rtc_time));
 			get_rtc_time(&rtc_tm);						
 			if (copy_to_user((struct rtc_time*)arg, &rtc_tm, sizeof(struct rtc_time)))
 				return -EFAULT;	
diff -Nru a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c
--- a/arch/cris/arch-v10/drivers/pcf8563.c	Tue Feb  3 19:45:17 2004
+++ b/arch/cris/arch-v10/drivers/pcf8563.c	Tue Feb  3 19:45:17 2004
@@ -219,6 +219,7 @@
 				unsigned long flags;
 				struct rtc_time tm;
 
+				memset(&tm, 0, sizeof (struct rtc_time));
 				if (!capable(CAP_SYS_TIME))
 					return -EPERM;
 
diff -Nru a/arch/cris/mm/Makefile b/arch/cris/mm/Makefile
--- a/arch/cris/mm/Makefile	Tue Feb  3 19:45:17 2004
+++ b/arch/cris/mm/Makefile	Tue Feb  3 19:45:17 2004
@@ -2,5 +2,5 @@
 # Makefile for the linux cris-specific parts of the memory manager.
 #
 
-obj-y	 := init.o fault.o tlb.o extable.o ioremap.o
+obj-y	 := init.o fault.o tlb.o ioremap.o
 
diff -Nru a/arch/cris/mm/extable.c b/arch/cris/mm/extable.c
--- a/arch/cris/mm/extable.c	Tue Feb  3 19:45:43 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,48 +0,0 @@
-/*
- * linux/arch/cris/mm/extable.c
- *
- * $Log: extable.c,v $
- * Revision 1.4  2003/01/09 14:42:52  starvik
- * Merge of Linux 2.5.55
- *
- * Revision 1.3  2002/11/21 07:24:54  starvik
- * Made search_exception_table similar to implementation for other archs
- * (now compiles with CONFIG_MODULES)
- *
- * Revision 1.2  2002/11/18 07:36:55  starvik
- * Removed warning
- *
- * Revision 1.1  2001/12/17 13:59:27  bjornw
- * Initial revision
- *
- * Revision 1.3  2001/09/27 13:52:40  bjornw
- * Harmonize underscore-ness with other parts
- *
- *
- */
-
-#include <linux/config.h>
-#include <linux/module.h>
-#include <asm/uaccess.h>
-
-/* Simple binary search */
-const struct exception_table_entry *
-search_extable(const struct exception_table_entry *first,
-	       const struct exception_table_entry *last,
-	       unsigned long value)
-{
-        while (first <= last) {
-		const struct exception_table_entry *mid;
-		long diff;
-
-		mid = (last - first) / 2 + first;
-		diff = mid->insn - value;
-                if (diff == 0)
-                        return mid;
-                else if (diff < 0)
-                        first = mid+1;
-                else
-                        last = mid-1;
-        }
-        return NULL;
-}
diff -Nru a/arch/h8300/mm/Makefile b/arch/h8300/mm/Makefile
--- a/arch/h8300/mm/Makefile	Tue Feb  3 19:45:42 2004
+++ b/arch/h8300/mm/Makefile	Tue Feb  3 19:45:42 2004
@@ -7,4 +7,4 @@
 #
 # Note 2! The CFLAGS definition is now in the main makefile...
 
-obj-y	 := init.o fault.o memory.o kmap.o extable.o
+obj-y	 := init.o fault.o memory.o kmap.o
diff -Nru a/arch/h8300/mm/extable.c b/arch/h8300/mm/extable.c
--- a/arch/h8300/mm/extable.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,30 +0,0 @@
-/*
- * linux/arch/h8300/mm/extable.c
- */
-
-#include <linux/config.h>
-#include <linux/module.h>
-#include <linux/spinlock.h>
-#include <asm/uaccess.h>
-
-/* Simple binary search */
-const struct exception_table_entry *
-search_extable(const struct exception_table_entry *first,
-	       const struct exception_table_entry *last,
-	       unsigned long value)
-{
-        while (first <= last) {
-		const struct exception_table_entry *mid;
-		long diff;
-
-		mid = (last - first) / 2 + first;
-		diff = mid->insn - value;
-                if (diff == 0)
-                        return mid;
-                else if (diff < 0)
-                        first = mid+1;
-                else
-                        last = mid-1;
-        }
-        return NULL;
-}
diff -Nru a/arch/i386/Kconfig b/arch/i386/Kconfig
--- a/arch/i386/Kconfig	Tue Feb  3 19:45:17 2004
+++ b/arch/i386/Kconfig	Tue Feb  3 19:45:17 2004
@@ -399,7 +399,7 @@
 
 config X86_OOSTORE
 	bool
-	depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6
+	depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6) && MTRR
 	default y
 
 config HPET_TIMER
@@ -447,6 +447,7 @@
 
 config NR_CPUS
 	int "Maximum number of CPUs (2-255)"
+	range 2 255
 	depends on SMP
 	default "32" if X86_NUMAQ || X86_SUMMIT || X86_BIGSMP || X86_ES7000
 	default "8"
@@ -1259,11 +1260,6 @@
 	  and slower, but it will give very useful debugging information.
 	  If you don't debug the kernel, you can say N, but we may not be able
 	  to solve problems without frame pointers.
-
-config X86_EXTRA_IRQS
-	bool
-	depends on X86_LOCAL_APIC || X86_VOYAGER
-	default y
 
 config X86_FIND_SMP_CONFIG
 	bool
diff -Nru a/arch/i386/boot/setup.S b/arch/i386/boot/setup.S
--- a/arch/i386/boot/setup.S	Tue Feb  3 19:45:29 2004
+++ b/arch/i386/boot/setup.S	Tue Feb  3 19:45:29 2004
@@ -307,7 +307,7 @@
 # a whole bunch of different types, and allows memory holes and
 # everything.  We scan through this memory map and build a list
 # of the first 32 memory areas, which we return at [E820MAP].
-# This is documented at http://www.teleport.com/~acpi/acpihtml/topic245.htm
+# This is documented at http://www.acpi.info/, in the ACPI 2.0 specification.
 
 #define SMAP  0x534d4150
 
diff -Nru a/arch/i386/defconfig b/arch/i386/defconfig
--- a/arch/i386/defconfig	Tue Feb  3 19:45:34 2004
+++ b/arch/i386/defconfig	Tue Feb  3 19:45:34 2004
@@ -10,7 +10,8 @@
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-# CONFIG_BROKEN is not set
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
 
 #
 # General setup
@@ -20,6 +21,7 @@
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 CONFIG_LOG_BUF_SHIFT=15
+# CONFIG_IKCONFIG is not set
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
 CONFIG_FUTEX=y
@@ -27,6 +29,7 @@
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -79,7 +82,8 @@
 CONFIG_X86_GOOD_APIC=y
 CONFIG_X86_INTEL_USERCOPY=y
 CONFIG_X86_USE_PPRO_CHECKSUM=y
-# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_HPET_TIMER is not set
+# CONFIG_HPET_EMULATE_RTC is not set
 CONFIG_SMP=y
 CONFIG_NR_CPUS=8
 CONFIG_PREEMPT=y
@@ -100,20 +104,22 @@
 # CONFIG_HIGHMEM64G is not set
 # CONFIG_MATH_EMULATION is not set
 CONFIG_MTRR=y
+# CONFIG_EFI is not set
 CONFIG_HAVE_DEC_LOCK=y
 
 #
 # Power management options (ACPI, APM)
 #
 CONFIG_PM=y
-# CONFIG_SOFTWARE_SUSPEND is not set
+CONFIG_SOFTWARE_SUSPEND=y
+# CONFIG_PM_DISK is not set
 
 #
 # ACPI (Advanced Configuration and Power Interface) Support
 #
-CONFIG_ACPI_HT=y
 CONFIG_ACPI=y
 CONFIG_ACPI_BOOT=y
+CONFIG_ACPI_INTERPRETER=y
 CONFIG_ACPI_SLEEP=y
 CONFIG_ACPI_SLEEP_PROC_FS=y
 CONFIG_ACPI_AC=y
@@ -126,11 +132,11 @@
 # CONFIG_ACPI_TOSHIBA is not set
 # CONFIG_ACPI_DEBUG is not set
 CONFIG_ACPI_BUS=y
-CONFIG_ACPI_INTERPRETER=y
 CONFIG_ACPI_EC=y
 CONFIG_ACPI_POWER=y
 CONFIG_ACPI_PCI=y
 CONFIG_ACPI_SYSTEM=y
+# CONFIG_ACPI_RELAXED_AML is not set
 
 #
 # APM (Advanced Power Management) BIOS Support
@@ -151,6 +157,7 @@
 CONFIG_PCI_GOANY=y
 CONFIG_PCI_BIOS=y
 CONFIG_PCI_DIRECT=y
+# CONFIG_PCI_USE_VECTOR is not set
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
 CONFIG_ISA=y
@@ -173,13 +180,15 @@
 #
 # Executable file formats
 #
-CONFIG_KCORE_ELF=y
-# CONFIG_KCORE_AOUT is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_AOUT=y
 CONFIG_BINFMT_MISC=y
 
 #
+# Device Drivers
+#
+
+#
 # Generic Driver Options
 #
 # CONFIG_FW_LOADER is not set
@@ -262,7 +271,6 @@
 # CONFIG_BLK_DEV_OPTI621 is not set
 CONFIG_BLK_DEV_RZ1000=y
 CONFIG_BLK_DEV_IDEDMA_PCI=y
-# CONFIG_BLK_DEV_IDE_TCQ is not set
 # CONFIG_BLK_DEV_IDEDMA_FORCED is not set
 CONFIG_IDEDMA_PCI_AUTO=y
 # CONFIG_IDEDMA_ONLYDISK is not set
@@ -300,6 +308,7 @@
 # SCSI device support
 #
 CONFIG_SCSI=y
+CONFIG_SCSI_PROC_FS=y
 
 #
 # SCSI support type (disk, tape, CD-ROM)
@@ -330,11 +339,14 @@
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
-# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_IN2000 is not set
-# CONFIG_SCSI_AM53C974 is not set
 # CONFIG_SCSI_MEGARAID is not set
+CONFIG_SCSI_SATA=y
+# CONFIG_SCSI_SATA_SVW is not set
+CONFIG_SCSI_ATA_PIIX=y
+# CONFIG_SCSI_SATA_PROMISE is not set
+# CONFIG_SCSI_SATA_VIA is not set
 # CONFIG_SCSI_BUSLOGIC is not set
 # CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
@@ -346,22 +358,21 @@
 # CONFIG_SCSI_GENERIC_NCR5380 is not set
 # CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
 # CONFIG_SCSI_IPS is not set
-# CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_PPA is not set
 # CONFIG_SCSI_IMM is not set
 # CONFIG_SCSI_NCR53C406A is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
-# CONFIG_SCSI_SYM53C8XX is not set
 # CONFIG_SCSI_PAS16 is not set
-# CONFIG_SCSI_PCI2000 is not set
-# CONFIG_SCSI_PCI2220I is not set
 # CONFIG_SCSI_PSI240I is not set
 # CONFIG_SCSI_QLOGIC_FAS is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
-# CONFIG_SCSI_SEAGATE is not set
+CONFIG_SCSI_QLA2XXX_CONFIG=y
+# CONFIG_SCSI_QLA21XX is not set
+# CONFIG_SCSI_QLA22XX is not set
+# CONFIG_SCSI_QLA23XX is not set
 # CONFIG_SCSI_SYM53C416 is not set
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
@@ -402,7 +413,7 @@
 #
 
 #
-# Texas Instruments PCILynx requires I2C bit-banging
+# Texas Instruments PCILynx requires I2C
 #
 CONFIG_IEEE1394_OHCI1394=y
 
@@ -447,10 +458,67 @@
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
+
+#
+# IP: Virtual Server Configuration
+#
+# CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
-# CONFIG_NETFILTER is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_CONNTRACK=y
+# CONFIG_IP_NF_FTP is not set
+# CONFIG_IP_NF_IRC is not set
+# CONFIG_IP_NF_TFTP is not set
+# CONFIG_IP_NF_AMANDA is not set
+CONFIG_IP_NF_QUEUE=y
+CONFIG_IP_NF_IPTABLES=y
+CONFIG_IP_NF_MATCH_LIMIT=y
+CONFIG_IP_NF_MATCH_IPRANGE=y
+CONFIG_IP_NF_MATCH_MAC=y
+CONFIG_IP_NF_MATCH_PKTTYPE=y
+CONFIG_IP_NF_MATCH_MARK=y
+CONFIG_IP_NF_MATCH_MULTIPORT=y
+CONFIG_IP_NF_MATCH_TOS=y
+CONFIG_IP_NF_MATCH_RECENT=y
+CONFIG_IP_NF_MATCH_ECN=y
+CONFIG_IP_NF_MATCH_DSCP=y
+CONFIG_IP_NF_MATCH_AH_ESP=y
+CONFIG_IP_NF_MATCH_LENGTH=y
+CONFIG_IP_NF_MATCH_TTL=y
+CONFIG_IP_NF_MATCH_TCPMSS=y
+CONFIG_IP_NF_MATCH_HELPER=y
+CONFIG_IP_NF_MATCH_STATE=y
+CONFIG_IP_NF_MATCH_CONNTRACK=y
+CONFIG_IP_NF_MATCH_OWNER=y
+CONFIG_IP_NF_FILTER=y
+CONFIG_IP_NF_TARGET_REJECT=y
+CONFIG_IP_NF_NAT=y
+CONFIG_IP_NF_NAT_NEEDED=y
+CONFIG_IP_NF_TARGET_MASQUERADE=y
+CONFIG_IP_NF_TARGET_REDIRECT=y
+CONFIG_IP_NF_TARGET_NETMAP=y
+CONFIG_IP_NF_TARGET_SAME=y
+# CONFIG_IP_NF_NAT_LOCAL is not set
+# CONFIG_IP_NF_NAT_SNMP_BASIC is not set
+CONFIG_IP_NF_MANGLE=y
+CONFIG_IP_NF_TARGET_TOS=y
+CONFIG_IP_NF_TARGET_ECN=y
+CONFIG_IP_NF_TARGET_DSCP=y
+CONFIG_IP_NF_TARGET_MARK=y
+CONFIG_IP_NF_TARGET_CLASSIFY=y
+CONFIG_IP_NF_TARGET_LOG=y
+CONFIG_IP_NF_TARGET_ULOG=y
+CONFIG_IP_NF_TARGET_TCPMSS=y
+CONFIG_IP_NF_ARPTABLES=y
+CONFIG_IP_NF_ARPFILTER=y
+CONFIG_IP_NF_ARP_MANGLE=y
 
 #
 # SCTP Configuration (EXPERIMENTAL)
@@ -459,7 +527,9 @@
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
 # CONFIG_VLAN_8021Q is not set
-# CONFIG_LLC is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
 # CONFIG_NET_DIVERT is not set
@@ -487,14 +557,13 @@
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
-# CONFIG_ETHERTAP is not set
 # CONFIG_NET_SB1000 is not set
 
 #
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
-# CONFIG_MII is not set
+CONFIG_MII=y
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
 # CONFIG_NET_VENDOR_3COM is not set
@@ -517,6 +586,7 @@
 # CONFIG_AC3200 is not set
 # CONFIG_APRICOT is not set
 # CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
 # CONFIG_CS89x0 is not set
 # CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
@@ -567,8 +637,9 @@
 # CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices (depends on LLC=y)
+# Token Ring devices
 #
+# CONFIG_TR is not set
 # CONFIG_NET_FC is not set
 # CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
@@ -589,6 +660,11 @@
 # CONFIG_IRDA is not set
 
 #
+# Bluetooth support
+#
+# CONFIG_BT is not set
+
+#
 # ISDN subsystem
 #
 # CONFIG_ISDN_BOOL is not set
@@ -659,6 +735,7 @@
 CONFIG_SERIAL_8250=y
 # CONFIG_SERIAL_8250_CONSOLE is not set
 # CONFIG_SERIAL_8250_ACPI is not set
+CONFIG_SERIAL_8250_NR_UARTS=4
 # CONFIG_SERIAL_8250_EXTENDED is not set
 
 #
@@ -673,20 +750,6 @@
 # CONFIG_TIPAR is not set
 
 #
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# I2C Hardware Sensors Mainboard support
-#
-
-#
-# I2C Hardware Sensors Chip support
-#
-# CONFIG_I2C_SENSOR is not set
-
-#
 # Mice
 #
 # CONFIG_BUSMOUSE is not set
@@ -713,7 +776,6 @@
 #
 # Ftape, the floppy tape device driver
 #
-# CONFIG_FTAPE is not set
 CONFIG_AGP=y
 # CONFIG_AGP_ALI is not set
 # CONFIG_AGP_ATI is not set
@@ -732,11 +794,17 @@
 # CONFIG_DRM_I810 is not set
 CONFIG_DRM_I830=y
 # CONFIG_DRM_MGA is not set
+# CONFIG_DRM_SIS is not set
 # CONFIG_MWAVE is not set
 # CONFIG_RAW_DRIVER is not set
 # CONFIG_HANGCHECK_TIMER is not set
 
 #
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
@@ -747,138 +815,6 @@
 # CONFIG_DVB is not set
 
 #
-# File systems
-#
-CONFIG_EXT2_FS=y
-# CONFIG_EXT2_FS_XATTR is not set
-CONFIG_EXT3_FS=y
-CONFIG_EXT3_FS_XATTR=y
-# CONFIG_EXT3_FS_POSIX_ACL is not set
-# CONFIG_EXT3_FS_SECURITY is not set
-CONFIG_JBD=y
-# CONFIG_JBD_DEBUG is not set
-CONFIG_FS_MBCACHE=y
-# CONFIG_REISERFS_FS is not set
-# CONFIG_JFS_FS is not set
-# CONFIG_XFS_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
-# CONFIG_QUOTA is not set
-# CONFIG_AUTOFS_FS is not set
-CONFIG_AUTOFS4_FS=y
-
-#
-# CD-ROM/DVD Filesystems
-#
-CONFIG_ISO9660_FS=y
-CONFIG_JOLIET=y
-# CONFIG_ZISOFS is not set
-CONFIG_UDF_FS=y
-
-#
-# DOS/FAT/NT Filesystems
-#
-CONFIG_FAT_FS=y
-CONFIG_MSDOS_FS=y
-CONFIG_VFAT_FS=y
-# CONFIG_NTFS_FS is not set
-
-#
-# Pseudo filesystems
-#
-CONFIG_PROC_FS=y
-# CONFIG_DEVFS_FS is not set
-CONFIG_DEVPTS_FS=y
-# CONFIG_DEVPTS_FS_XATTR is not set
-CONFIG_TMPFS=y
-CONFIG_RAMFS=y
-
-#
-# Miscellaneous filesystems
-#
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_BEFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EFS_FS is not set
-# CONFIG_CRAMFS is not set
-# CONFIG_VXFS_FS is not set
-# CONFIG_HPFS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_SYSV_FS is not set
-# CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
-CONFIG_NFS_FS=y
-# CONFIG_NFS_V3 is not set
-# CONFIG_NFS_V4 is not set
-CONFIG_NFSD=y
-# CONFIG_NFSD_V3 is not set
-# CONFIG_NFSD_TCP is not set
-CONFIG_LOCKD=y
-CONFIG_EXPORTFS=y
-CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
-# CONFIG_SMB_FS is not set
-# CONFIG_CIFS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
-# CONFIG_AFS_FS is not set
-
-#
-# Partition Types
-#
-# CONFIG_PARTITION_ADVANCED is not set
-CONFIG_MSDOS_PARTITION=y
-CONFIG_NLS=y
-
-#
-# Native Language Support
-#
-CONFIG_NLS_DEFAULT="iso8859-1"
-CONFIG_NLS_CODEPAGE_437=y
-# CONFIG_NLS_CODEPAGE_737 is not set
-# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
-# CONFIG_NLS_CODEPAGE_855 is not set
-# CONFIG_NLS_CODEPAGE_857 is not set
-# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
-# CONFIG_NLS_CODEPAGE_862 is not set
-# CONFIG_NLS_CODEPAGE_863 is not set
-# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
-# CONFIG_NLS_CODEPAGE_869 is not set
-# CONFIG_NLS_CODEPAGE_936 is not set
-# CONFIG_NLS_CODEPAGE_950 is not set
-# CONFIG_NLS_CODEPAGE_932 is not set
-# CONFIG_NLS_CODEPAGE_949 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_ISO8859_8 is not set
-# CONFIG_NLS_CODEPAGE_1250 is not set
-# CONFIG_NLS_CODEPAGE_1251 is not set
-CONFIG_NLS_ISO8859_1=y
-# CONFIG_NLS_ISO8859_2 is not set
-# CONFIG_NLS_ISO8859_3 is not set
-# CONFIG_NLS_ISO8859_4 is not set
-# CONFIG_NLS_ISO8859_5 is not set
-# CONFIG_NLS_ISO8859_6 is not set
-# CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_9 is not set
-# CONFIG_NLS_ISO8859_13 is not set
-# CONFIG_NLS_ISO8859_14 is not set
-# CONFIG_NLS_ISO8859_15 is not set
-# CONFIG_NLS_KOI8_R is not set
-# CONFIG_NLS_KOI8_U is not set
-# CONFIG_NLS_UTF8 is not set
-
-#
 # Graphics support
 #
 # CONFIG_FB is not set
@@ -1057,7 +993,6 @@
 #
 # USB Network adaptors
 #
-# CONFIG_USB_AX8817X is not set
 # CONFIG_USB_CATC is not set
 # CONFIG_USB_KAWETH is not set
 # CONFIG_USB_PEGASUS is not set
@@ -1077,31 +1012,170 @@
 #
 # USB Miscellaneous drivers
 #
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
 # CONFIG_USB_TIGL is not set
 # CONFIG_USB_AUERSWALD is not set
 # CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_BRLVGER is not set
 # CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
 # CONFIG_USB_TEST is not set
+
+#
+# USB Gadget Support
+#
 # CONFIG_USB_GADGET is not set
 
 #
-# Bluetooth support
+# File systems
 #
-# CONFIG_BT is not set
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+CONFIG_AUTOFS4_FS=y
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+# CONFIG_ZISOFS is not set
+CONFIG_UDF_FS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+# CONFIG_DEVFS_FS is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+# CONFIG_HUGETLBFS is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+CONFIG_NFSD=y
+# CONFIG_NFSD_V3 is not set
+# CONFIG_NFSD_TCP is not set
+CONFIG_LOCKD=y
+CONFIG_EXPORTFS=y
+CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_GSS is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
 
 #
 # Profiling support
 #
-# CONFIG_PROFILING is not set
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=y
 
 #
 # Kernel hacking
 #
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_DEBUG_SPINLOCK_SLEEP=y
-CONFIG_FRAME_POINTER=y
-CONFIG_X86_EXTRA_IRQS=y
+# CONFIG_FRAME_POINTER is not set
 CONFIG_X86_FIND_SMP_CONFIG=y
 CONFIG_X86_MPPARSE=y
 
@@ -1118,8 +1192,9 @@
 #
 # Library routines
 #
-# CONFIG_CRC32 is not set
+CONFIG_CRC32=y
 CONFIG_X86_SMP=y
 CONFIG_X86_HT=y
 CONFIG_X86_BIOS_REBOOT=y
 CONFIG_X86_TRAMPOLINE=y
+CONFIG_PC=y
diff -Nru a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
--- a/arch/i386/kernel/acpi/boot.c	Tue Feb  3 19:45:41 2004
+++ b/arch/i386/kernel/acpi/boot.c	Tue Feb  3 19:45:41 2004
@@ -41,9 +41,8 @@
 
 #define PREFIX			"ACPI: "
 
-extern int acpi_disabled;
-extern int acpi_irq;
-extern int acpi_ht;
+int acpi_noirq __initdata = 0;	/* skip ACPI IRQ initialization */
+int acpi_ht __initdata = 1;	/* enable HT */
 
 int acpi_lapic = 0;
 int acpi_ioapic = 0;
@@ -250,29 +249,66 @@
 
 #ifdef	CONFIG_ACPI_BUS
 /*
- * Set specified PIC IRQ to level triggered mode.
+ * "acpi_pic_sci=level" (current default)
+ * programs the PIC-mode SCI to Level Trigger.
+ * (NO-OP if the BIOS set Level Trigger already)
+ *
+ * If a PIC-mode SCI is not recogznied or gives spurious IRQ7's
+ * it may require Edge Trigger -- use "acpi_pic_sci=edge"
+ * (NO-OP if the BIOS set Edge Trigger already)
  *
  * Port 0x4d0-4d1 are ECLR1 and ECLR2, the Edge/Level Control Registers
  * for the 8259 PIC.  bit[n] = 1 means irq[n] is Level, otherwise Edge.
  * ECLR1 is IRQ's 0-7 (IRQ 0, 1, 2 must be 0)
  * ECLR2 is IRQ's 8-15 (IRQ 8, 13 must be 0)
- *
- * As the BIOS should have done this for us,
- * print a warning if the IRQ wasn't already set to level.
  */
 
-void acpi_pic_set_level_irq(unsigned int irq)
+static int __initdata	acpi_pic_sci_trigger;	/* 0: level, 1: edge */
+
+void __init
+acpi_pic_sci_set_trigger(unsigned int irq)
 {
 	unsigned char mask = 1 << (irq & 7);
 	unsigned int port = 0x4d0 + (irq >> 3);
 	unsigned char val = inb(port);
 
+	
+	printk(PREFIX "IRQ%d SCI:", irq);
 	if (!(val & mask)) {
-		printk(KERN_WARNING PREFIX "IRQ %d was Edge Triggered, "
-			"setting to Level Triggerd\n", irq);
-		outb(val | mask, port);
+		printk(" Edge");
+
+		if (!acpi_pic_sci_trigger) {
+			printk(" set to Level");
+			outb(val | mask, port);
+		}
+	} else {
+		printk(" Level");
+
+		if (acpi_pic_sci_trigger) {
+			printk(" set to Edge");
+			outb(val | mask, port);
+		}
+	}
+	printk(" Trigger.\n");
+}
+
+int __init
+acpi_pic_sci_setup(char *str)
+{
+	while (str && *str) {
+		if (strncmp(str, "level", 5) == 0)
+			acpi_pic_sci_trigger = 0;	/* force level trigger */
+		if (strncmp(str, "edge", 4) == 0)
+			acpi_pic_sci_trigger = 1;	/* force edge trigger */
+		str = strchr(str, ',');
+		if (str)
+			str += strspn(str, ", \t");
 	}
+	return 1;
 }
+
+__setup("acpi_pic_sci=", acpi_pic_sci_setup);
+
 #endif /* CONFIG_ACPI_BUS */
 
 
@@ -387,8 +423,10 @@
 	 * Initialize the ACPI boot-time table parser.
 	 */
 	result = acpi_table_init();
-	if (result)
+	if (result) {
+		acpi_disabled = 1;
 		return result;
+	}
 
 	result = acpi_blacklisted();
 	if (result) {
@@ -469,7 +507,7 @@
 	 * If MPS is present, it will handle them,
 	 * otherwise the system will stay in PIC mode
 	 */
-	if (acpi_disabled || !acpi_irq) {
+	if (acpi_disabled || acpi_noirq) {
 		return 1;
         }
 
@@ -510,6 +548,8 @@
 	}
 
 	acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC;
+
+	acpi_irq_balance_set(NULL);
 
 	acpi_ioapic = 1;
 
diff -Nru a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S
--- a/arch/i386/kernel/acpi/wakeup.S	Tue Feb  3 19:45:17 2004
+++ b/arch/i386/kernel/acpi/wakeup.S	Tue Feb  3 19:45:17 2004
@@ -193,21 +193,12 @@
 	# and restore the stack ... but you need gdt for this to work
 	movl	saved_context_esp, %esp
 
-	movw	$0x0e00 + 'W', 0xb8018
-	outl	%eax, $0x80
-	outl	%eax, $0x80
-	movw	$0x0e00 + 'O', 0xb8018
-
 	movl	%cs:saved_magic, %eax
 	cmpl	$0x12345678, %eax
 	jne	bogus_magic
 
 	# jump to place where we left off
 	movl	saved_eip,%eax
-	movw	$0x0e00 + 'x', 0xb8018
-	outl	%eax, $0x80
-	outl	%eax, $0x80
-	movw	$0x0e00 + '!', 0xb801a
 	jmp	*%eax
 
 bogus_magic:
diff -Nru a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
--- a/arch/i386/kernel/apic.c	Tue Feb  3 19:45:43 2004
+++ b/arch/i386/kernel/apic.c	Tue Feb  3 19:45:43 2004
@@ -834,11 +834,13 @@
 
 void __setup_APIC_LVTT(unsigned int clocks)
 {
-	unsigned int lvtt1_value, tmp_value;
+	unsigned int lvtt_value, tmp_value, ver;
 
-	lvtt1_value = SET_APIC_TIMER_BASE(APIC_TIMER_BASE_DIV) |
-			APIC_LVT_TIMER_PERIODIC | LOCAL_TIMER_VECTOR;
-	apic_write_around(APIC_LVTT, lvtt1_value);
+	ver = GET_APIC_VERSION(apic_read(APIC_LVR));
+	lvtt_value = APIC_LVT_TIMER_PERIODIC | LOCAL_TIMER_VECTOR;
+	if (!APIC_INTEGRATED(ver))
+		lvtt_value |= SET_APIC_TIMER_BASE(APIC_TIMER_BASE_DIV);
+	apic_write_around(APIC_LVTT, lvtt_value);
 
 	/*
 	 * Divide PICLK by 16
diff -Nru a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
--- a/arch/i386/kernel/apm.c	Tue Feb  3 19:45:16 2004
+++ b/arch/i386/kernel/apm.c	Tue Feb  3 19:45:16 2004
@@ -844,6 +844,8 @@
 		idle_percentage *= 100;
 		idle_percentage /= jiffies_since_last_check;
 		use_apm_idle = (idle_percentage > idle_threshold);
+		if (apm_info.forbid_idle)
+			use_apm_idle = 0;
 		last_jiffies = jiffies;
 		last_stime = current->stime;
 	}
@@ -1199,6 +1201,7 @@
 	}
 
 	device_suspend(3);
+	device_power_down(3);
 
 	/* serialize with the timer interrupt */
 	write_seqlock_irq(&xtime_lock);
@@ -1232,6 +1235,7 @@
 	if (err != APM_SUCCESS)
 		apm_error("suspend", err);
 	err = (err == APM_SUCCESS) ? 0 : -EIO;
+	device_power_up();
 	device_resume();
 	pm_send_all(PM_RESUME, (void *)0);
 	queue_event(APM_NORMAL_RESUME, NULL);
@@ -1250,6 +1254,7 @@
 {
 	int	err;
 
+	device_power_down(3);
 	/* serialize with the timer interrupt */
 	write_seqlock_irq(&xtime_lock);
 	/* If needed, notify drivers here */
@@ -1259,6 +1264,7 @@
 	err = set_system_power_state(APM_STATE_STANDBY);
 	if ((err != APM_SUCCESS) && (err != APM_NO_ERROR))
 		apm_error("standby", err);
+	device_power_up();
 }
 
 static apm_event_t get_event(void)
@@ -1891,6 +1897,7 @@
 static int __init apm_init(void)
 {
 	struct proc_dir_entry *apm_proc;
+	int ret;
 	int i;
 
 	if (apm_info.bios.version == 0) {
@@ -2008,7 +2015,11 @@
 	if (apm_proc)
 		apm_proc->owner = THIS_MODULE;
 
-	kernel_thread(apm, NULL, CLONE_KERNEL | SIGCHLD);
+	ret = kernel_thread(apm, NULL, CLONE_KERNEL | SIGCHLD);
+	if (ret < 0) {
+		printk(KERN_ERR "apm: disabled - Unable to start kernel thread.\n");
+		return -ENOMEM;
+	}
 
 	if (num_online_cpus() > 1 && !smp ) {
 		printk(KERN_NOTICE
diff -Nru a/arch/i386/kernel/cpu/cpufreq/Kconfig b/arch/i386/kernel/cpu/cpufreq/Kconfig
--- a/arch/i386/kernel/cpu/cpufreq/Kconfig	Tue Feb  3 19:45:17 2004
+++ b/arch/i386/kernel/cpu/cpufreq/Kconfig	Tue Feb  3 19:45:17 2004
@@ -145,11 +145,6 @@
 
 	  If in doubt, say N.
 
-config X86_SPEEDSTEP_LIB
-	tristate
-	depends on (X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI)
-	default (X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI)
-
 config X86_P4_CLOCKMOD
 	tristate "Intel Pentium 4 clock modulation"
 	depends on CPU_FREQ_TABLE
@@ -160,6 +155,11 @@
 	  For details, take a look at linux/Documentation/cpu-freq. 
 
 	  If in doubt, say N.
+
+config X86_SPEEDSTEP_LIB
+	tristate
+	depends on (X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI || X86_P4_CLOCKMOD)
+	default (X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI || X86_P4_CLOCKMOD)
 
 config X86_LONGRUN
 	tristate "Transmeta LongRun"
diff -Nru a/arch/i386/kernel/cpu/cpufreq/acpi.c b/arch/i386/kernel/cpu/cpufreq/acpi.c
--- a/arch/i386/kernel/cpu/cpufreq/acpi.c	Tue Feb  3 19:45:16 2004
+++ b/arch/i386/kernel/cpu/cpufreq/acpi.c	Tue Feb  3 19:45:16 2004
@@ -108,7 +108,7 @@
 	}
 
 	perf->control_register = (u16) reg->address;
-
+	perf->control_register_bit_width = reg->bit_width;
 	/*
 	 * status_register
 	 */
@@ -135,6 +135,7 @@
 	}
 
 	perf->status_register = (u16) reg->address;
+	perf->status_register_bit_width = reg->bit_width;
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
 		"control_register[0x%04x] status_register[0x%04x]\n",
@@ -207,6 +208,12 @@
 			goto end;
 		}
 
+		if (!px->core_frequency) {
+			ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSS data: freq is zero\n"));
+			result = -EFAULT;
+			goto end;
+		}
+
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
 			"State [%d]: core_frequency[%d] power[%d] transition_latency[%d] bus_master_latency[%d] control[0x%x] status[0x%x]\n",
 			i, 
@@ -224,6 +231,42 @@
 	return_VALUE(result);
 }
 
+static int
+acpi_processor_write_port(
+	u16	port,
+	u8	bit_width,
+	u32	value)
+{
+	if (bit_width <= 8) {
+		outb(value, port);
+	} else if (bit_width <= 16) {
+		outw(value, port);
+	} else if (bit_width <= 32) {
+		outl(value, port);
+	} else {
+		return -ENODEV;
+	}
+	return 0;
+}
+
+static int
+acpi_processor_read_port(
+	u16	port,
+	u8	bit_width,
+	u32	*ret)
+{
+	*ret = 0;
+	if (bit_width <= 8) {
+		*ret = inb(port);
+	} else if (bit_width <= 16) {
+		*ret = inw(port);
+	} else if (bit_width <= 32) {
+		*ret = inl(port);
+	} else {
+		return -ENODEV;
+	}
+	return 0;
+}
 
 static int
 acpi_processor_set_performance (
@@ -231,7 +274,9 @@
 	int			state)
 {
 	u16			port = 0;
-	u16			value = 0;
+	u8			bit_width = 0;
+	int			ret = 0;
+	u32			value = 0;
 	int			i = 0;
 	struct cpufreq_freqs    cpufreq_freqs;
 
@@ -279,12 +324,18 @@
 	 */
 
 	port = perf->control_register;
-	value = (u16) perf->states[state].control;
+	bit_width = perf->control_register_bit_width;
+	value = (u32) perf->states[state].control;
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
-		"Writing 0x%04x to port 0x%04x\n", value, port));
+		"Writing 0x%08x to port 0x%04x\n", value, port));
 
-	outw(value, port); 
+	ret = acpi_processor_write_port(port, bit_width, value);
+	if (ret) {
+		ACPI_DEBUG_PRINT((ACPI_DB_WARN,
+			"Invalid port width 0x%04x\n", bit_width));
+		return_VALUE(ret);
+	}
 
 	/*
 	 * Then we read the 'status_register' and compare the value with the
@@ -294,14 +345,20 @@
 	 */
 
 	port = perf->status_register;
+	bit_width = perf->status_register_bit_width;
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
-		"Looking for 0x%04x from port 0x%04x\n",
-		(u16) perf->states[state].status, port));
+		"Looking for 0x%08x from port 0x%04x\n",
+		(u32) perf->states[state].status, port));
 
 	for (i=0; i<100; i++) {
-		value = inw(port);
-		if (value == (u16) perf->states[state].status)
+		ret = acpi_processor_read_port(port, bit_width, &value);
+		if (ret) {	
+			ACPI_DEBUG_PRINT((ACPI_DB_WARN,
+				"Invalid port width 0x%04x\n", bit_width));
+			return_VALUE(ret);
+		}
+		if (value == (u32) perf->states[state].status)
 			break;
 		udelay(10);
 	}
@@ -309,7 +366,7 @@
 	/* notify cpufreq */
 	cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE);
 
-	if (value != (u16) perf->states[state].status) {
+	if (value != (u32) perf->states[state].status) {
 		unsigned int tmp = cpufreq_freqs.new;
 		cpufreq_freqs.new = cpufreq_freqs.old;
 		cpufreq_freqs.old = tmp;
diff -Nru a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
--- a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c	Tue Feb  3 19:45:42 2004
+++ b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c	Tue Feb  3 19:45:42 2004
@@ -33,6 +33,8 @@
 #include <asm/msr.h>
 #include <asm/timex.h>
 
+#include "speedstep-lib.h"
+
 #define PFX	"cpufreq: "
 
 /*
@@ -174,51 +176,30 @@
 	return cpufreq_frequency_table_verify(policy, &p4clockmod_table[0]);
 }
 
-/* copied from speedstep_lib, made SMP-compatible */
+
 static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c)
 {
-	u32 msr_lo, msr_hi, mult;
-	unsigned int fsb = 0;
+	if ((c->x86 == 0x06) && (c->x86_model == 0x09)) {
+		/* Pentium M */
+		printk(KERN_DEBUG PFX "Warning: Pentium M detected. The speedstep_centrino module\n");
+		printk(KERN_DEBUG PFX "offers voltage scaling in addition of frequency scaling. You\n");
+		printk(KERN_DEBUG PFX "should use that instead of p4-clockmod, if possible.\n");
+		return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_PM);
+	}
 
 	if (c->x86 != 0xF) {
-		printk(KERN_DEBUG PFX "Unknown P4. Please send an e-mail to <linux@brodo.de>\n");
+		printk(KERN_DEBUG PFX "Unknown p4-clockmod-capable CPU. Please send an e-mail to <linux@brodo.de>\n");
 		return 0;
 	}
 
-	rdmsr(0x2c, msr_lo, msr_hi);
-
-	/* printk(KERN_DEBUG PFX "P4 - MSR_EBC_FREQUENCY_ID: 0x%x 0x%x\n", msr_lo, msr_hi); */
-	/* decode the FSB: see IA-32 Intel (C) Architecture Software 
-	 * Developer's Manual, Volume 3: System Prgramming Guide,
-	 * revision #12 in Table B-1: MSRs in the Pentium 4 and
-	 * Intel Xeon Processors, on page B-4 and B-5.
-	 */
-	if (c->x86_model < 2)
-		fsb = 100 * 1000;
-	else {
-		u8 fsb_code = (msr_lo >> 16) & 0x7;
-		switch (fsb_code) {
-		case 0:
-			fsb = 100 * 1000;
-			break;
-		case 1:
-			fsb = 13333 * 10;
-			break;
-		case 2:
-			fsb = 200 * 1000;
-			break;
-		}
-	}
-
-	if (!fsb) {
-		printk(KERN_DEBUG PFX "couldn't detect FSB speed. Please send an e-mail to <linux@brodo.de>\n");
-		printk(KERN_DEBUG PFX "P4 - MSR_EBC_FREQUENCY_ID: 0x%x 0x%x\n", msr_lo, msr_hi);
+	if (speedstep_detect_processor() == SPEEDSTEP_PROCESSOR_P4M) {
+		printk(KERN_DEBUG PFX "Warning: Pentium 4-M detected. The speedstep-ich or acpi cpufreq \n");
+		printk(KERN_DEBUG PFX "modules offers voltage scaling in addition of frequency scaling. You\n");
+		printk(KERN_DEBUG PFX "should use either one instead of p4-clockmod, if possible.\n");
+		return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_P4M);
 	}
 
-	/* Multiplier. */
-	mult = msr_lo >> 24;
-
-	return (fsb * mult);
+	return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_P4D);
 }
 
  
@@ -315,6 +296,6 @@
 MODULE_DESCRIPTION ("cpufreq driver for Pentium(TM) 4/Xeon(TM)");
 MODULE_LICENSE ("GPL");
 
-module_init(cpufreq_p4_init);
+late_initcall(cpufreq_p4_init);
 module_exit(cpufreq_p4_exit);
 
diff -Nru a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c	Tue Feb  3 19:45:42 2004
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c	Tue Feb  3 19:45:42 2004
@@ -104,6 +104,26 @@
 }
 
 
+static unsigned int pentiumM_get_frequency(void)
+{
+	u32     msr_lo, msr_tmp;
+
+	rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp);
+	dprintk(KERN_DEBUG "speedstep-lib: PM - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp);
+
+	/* see table B-2 of 24547212.pdf */
+	if (msr_lo & 0x00040000) {
+		printk(KERN_DEBUG "speedstep-lib: PM - invalid FSB: 0x%x 0x%x\n", msr_lo, msr_tmp);
+		return 0;
+	}
+
+	msr_tmp = (msr_lo >> 22) & 0x1f;
+	dprintk(KERN_DEBUG "speedstep-lib: bits 22-26 are 0x%x\n", msr_tmp);
+
+	return (msr_tmp * 100 * 10000);
+}
+
+
 static unsigned int pentium4_get_frequency(void)
 {
 	struct cpuinfo_x86 *c = &boot_cpu_data;
@@ -151,6 +171,9 @@
 unsigned int speedstep_get_processor_frequency(unsigned int processor)
 {
 	switch (processor) {
+	case SPEEDSTEP_PROCESSOR_PM:
+		return pentiumM_get_frequency();
+	case SPEEDSTEP_PROCESSOR_P4D:
 	case SPEEDSTEP_PROCESSOR_P4M:
 		return pentium4_get_frequency();
 	case SPEEDSTEP_PROCESSOR_PIII_T:
diff -Nru a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h	Tue Feb  3 19:45:17 2004
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h	Tue Feb  3 19:45:17 2004
@@ -17,6 +17,12 @@
 #define SPEEDSTEP_PROCESSOR_PIII_T 		0x00000003  /* Tualatin core */
 #define SPEEDSTEP_PROCESSOR_P4M			0x00000004  /* P4-M  */
 
+/* the following processors are not speedstep-capable and are not auto-detected
+ * in speedstep_detect_processor(). However, their speed can be detected using
+ * the speedstep_get_processor_frequency() call. */
+#define SPEEDSTEP_PROCESSOR_PM			0xFFFFFF03  /* Pentium M  */
+#define SPEEDSTEP_PROCESSOR_P4D			0xFFFFFF04  /* desktop P4  */
+
 /* speedstep states -- only two of them */
 
 #define SPEEDSTEP_HIGH                  0x00000000
diff -Nru a/arch/i386/kernel/cpu/intel.c b/arch/i386/kernel/cpu/intel.c
--- a/arch/i386/kernel/cpu/intel.c	Tue Feb  3 19:45:17 2004
+++ b/arch/i386/kernel/cpu/intel.c	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,7 @@
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
+
 #include <linux/string.h>
 #include <linux/bitops.h>
 #include <linux/smp.h>
@@ -11,6 +13,12 @@
 
 #include "cpu.h"
 
+#ifdef CONFIG_X86_LOCAL_APIC
+#include <asm/mpspec.h>
+#include <asm/apic.h>
+#include <mach_apic.h>
+#endif
+
 extern int trap_init_f00f_bug(void);
 
 #ifdef CONFIG_X86_INTEL_USERCOPY
@@ -277,6 +285,7 @@
 		extern	int phys_proc_id[NR_CPUS];
 		
 		u32 	eax, ebx, ecx, edx;
+		int 	index_lsb, index_msb, tmp;
 		int 	cpu = smp_processor_id();
 
 		cpuid(1, &eax, &ebx, &ecx, &edx);
@@ -285,6 +294,8 @@
 		if (smp_num_siblings == 1) {
 			printk(KERN_INFO  "CPU: Hyper-Threading is disabled\n");
 		} else if (smp_num_siblings > 1 ) {
+			index_lsb = 0;
+			index_msb = 31;
 			/*
 			 * At this point we only support two siblings per
 			 * processor package.
@@ -295,13 +306,19 @@
 				smp_num_siblings = 1;
 				goto too_many_siblings;
 			}
-			/* cpuid returns the value latched in the HW at reset,
-			 * not the APIC ID register's value.  For any box
-			 * whose BIOS changes APIC IDs, like clustered APIC
-			 * systems, we must use hard_smp_processor_id.
-			 * See Intel's IA-32 SW Dev's Manual Vol2 under CPUID.
-			 */
-			phys_proc_id[cpu] = hard_smp_processor_id() & ~(smp_num_siblings - 1);
+			tmp = smp_num_siblings;
+			while ((tmp & 1) == 0) {
+				tmp >>=1 ;
+				index_lsb++;
+			}
+			tmp = smp_num_siblings;
+			while ((tmp & 0x80000000 ) == 0) {
+				tmp <<=1 ;
+				index_msb--;
+			}
+			if (index_lsb != index_msb )
+				index_msb++;
+			phys_proc_id[cpu] = phys_pkg_id((ebx >> 24) & 0xFF, index_msb);
 
 			printk(KERN_INFO  "CPU: Physical Processor ID: %d\n",
                                phys_proc_id[cpu]);
diff -Nru a/arch/i386/kernel/cpu/mcheck/k7.c b/arch/i386/kernel/cpu/mcheck/k7.c
--- a/arch/i386/kernel/cpu/mcheck/k7.c	Tue Feb  3 19:45:29 2004
+++ b/arch/i386/kernel/cpu/mcheck/k7.c	Tue Feb  3 19:45:29 2004
@@ -1,5 +1,6 @@
 /*
  * Athlon/Hammer specific Machine Check Exception Reporting
+ * (C) Copyright 2002 Dave Jones <davej@codemonkey.org.uk>
  */
 
 #include <linux/init.h>
diff -Nru a/arch/i386/kernel/cpu/mcheck/mce.c b/arch/i386/kernel/cpu/mcheck/mce.c
--- a/arch/i386/kernel/cpu/mcheck/mce.c	Tue Feb  3 19:45:35 2004
+++ b/arch/i386/kernel/cpu/mcheck/mce.c	Tue Feb  3 19:45:35 2004
@@ -1,5 +1,6 @@
 /*
  * mce.c - x86 Machine Check Exception Reporting
+ * (c) 2002 Alan Cox <alan@redhat.com>, Dave Jones <davej@codemonkey.org.uk>
  */
 
 #include <linux/init.h>
diff -Nru a/arch/i386/kernel/cpu/mcheck/non-fatal.c b/arch/i386/kernel/cpu/mcheck/non-fatal.c
--- a/arch/i386/kernel/cpu/mcheck/non-fatal.c	Tue Feb  3 19:45:17 2004
+++ b/arch/i386/kernel/cpu/mcheck/non-fatal.c	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,10 @@
 /*
  * Non Fatal Machine Check Exception Reporting
+ *
+ * (C) Copyright 2002 Dave Jones. <davej@codemonkey.org.uk>
+ *
+ * This file contains routines to check for non-fatal MCEs every 15s
+ *
  */
 
 #include <linux/init.h>
@@ -21,6 +26,7 @@
 
 static struct timer_list mce_timer;
 static int timerset;
+static int firstbank;
 
 #define MCE_RATE	15*HZ	/* timer rate is 15s */
 
@@ -30,7 +36,7 @@
 	int i;
 
 	preempt_disable(); 
-	for (i=0; i<nr_mce_banks; i++) {
+	for (i=firstbank; i<nr_mce_banks; i++) {
 		rdmsr (MSR_IA32_MC0_STATUS+i*4, low, high);
 
 		if (high & (1<<31)) {
@@ -68,6 +74,23 @@
 
 static int __init init_nonfatal_mce_checker(void)
 {
+	struct cpuinfo_x86 *c = &boot_cpu_data;
+
+	/* Check for MCE support */
+	if (!cpu_has(c, X86_FEATURE_MCE))
+		return -ENODEV;
+
+	/* Check for PPro style MCA */
+	if (!cpu_has(c, X86_FEATURE_MCA))
+		return -ENODEV;
+
+	/* Some Athlons misbehave when we frob bank 0 */
+	if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
+		boot_cpu_data.x86 == 6)
+			firstbank = 1;
+	else
+			firstbank = 0;
+
 	if (timerset == 0) {
 		/* Set the timer to check for non-fatal
 		   errors every MCE_RATE seconds */
diff -Nru a/arch/i386/kernel/cpu/mcheck/p5.c b/arch/i386/kernel/cpu/mcheck/p5.c
--- a/arch/i386/kernel/cpu/mcheck/p5.c	Tue Feb  3 19:45:29 2004
+++ b/arch/i386/kernel/cpu/mcheck/p5.c	Tue Feb  3 19:45:29 2004
@@ -1,5 +1,6 @@
 /*
  * P5 specific Machine Check Exception Reporting
+ * (C) Copyright 2002 Alan Cox <alan@redhat.com>
  */
 
 #include <linux/init.h>
diff -Nru a/arch/i386/kernel/cpu/mcheck/p6.c b/arch/i386/kernel/cpu/mcheck/p6.c
--- a/arch/i386/kernel/cpu/mcheck/p6.c	Tue Feb  3 19:45:30 2004
+++ b/arch/i386/kernel/cpu/mcheck/p6.c	Tue Feb  3 19:45:30 2004
@@ -1,5 +1,6 @@
 /*
  * P6 specific Machine Check Exception Reporting
+ * (C) Copyright 2002 Alan Cox <alan@redhat.com>
  */
 
 #include <linux/init.h>
diff -Nru a/arch/i386/kernel/cpu/mcheck/winchip.c b/arch/i386/kernel/cpu/mcheck/winchip.c
--- a/arch/i386/kernel/cpu/mcheck/winchip.c	Tue Feb  3 19:45:28 2004
+++ b/arch/i386/kernel/cpu/mcheck/winchip.c	Tue Feb  3 19:45:28 2004
@@ -1,5 +1,6 @@
 /*
  * IDT Winchip specific Machine Check Exception Reporting
+ * (C) Copyright 2002 Alan Cox <alan@redhat.com>
  */
 
 #include <linux/init.h>
diff -Nru a/arch/i386/kernel/cpu/mtrr/if.c b/arch/i386/kernel/cpu/mtrr/if.c
--- a/arch/i386/kernel/cpu/mtrr/if.c	Tue Feb  3 19:45:17 2004
+++ b/arch/i386/kernel/cpu/mtrr/if.c	Tue Feb  3 19:45:17 2004
@@ -352,6 +352,14 @@
 
 static int __init mtrr_if_init(void)
 {
+	struct cpuinfo_x86 *c = &boot_cpu_data;
+
+	if ((!cpu_has(c, X86_FEATURE_MTRR)) &&
+	    (!cpu_has(c, X86_FEATURE_K6_MTRR)) &&
+	    (!cpu_has(c, X86_FEATURE_CYRIX_ARR)) &&
+	    (!cpu_has(c, X86_FEATURE_CENTAUR_MCR)))
+		return -ENODEV;
+
 	proc_root_mtrr =
 	    create_proc_entry("mtrr", S_IWUSR | S_IRUGO, &proc_root);
 	if (proc_root_mtrr) {
diff -Nru a/arch/i386/kernel/dmi_scan.c b/arch/i386/kernel/dmi_scan.c
--- a/arch/i386/kernel/dmi_scan.c	Tue Feb  3 19:45:17 2004
+++ b/arch/i386/kernel/dmi_scan.c	Tue Feb  3 19:45:17 2004
@@ -6,6 +6,7 @@
 #include <linux/module.h>
 #include <linux/apm_bios.h>
 #include <linux/slab.h>
+#include <asm/acpi.h>
 #include <asm/io.h>
 #include <linux/pm.h>
 #include <asm/system.h>
@@ -16,6 +17,7 @@
 
 int is_sony_vaio_laptop;
 int is_unsafe_smbus;
+int es7000_plat = 0;
 
 struct dmi_header
 {
@@ -107,15 +109,7 @@
 	u8 buf[15];
 	u32 fp=0xF0000;
 
-#ifdef CONFIG_SIMNOW
-	/*
- 	 *	Skip on x86/64 with simnow. Will eventually go away
- 	 *	If you see this ifdef in 2.6pre mail me !
- 	 */
-	return -1;
-#endif
- 	
-	while( fp < 0xFFFFF)
+	while (fp < 0xFFFFF)
 	{
 		isa_memcpy_fromio(buf, fp, 15);
 		if(memcmp(buf, "_DMI_", 5)==0 && dmi_checksum(buf))
@@ -291,6 +285,30 @@
 	return 0;
 }
 
+static __init int apm_is_horked_d850md(struct dmi_blacklist *d)
+{
+	if (apm_info.disabled == 0) {
+		apm_info.disabled = 1;
+		printk(KERN_INFO "%s machine detected. Disabling APM.\n", d->ident);
+		printk(KERN_INFO "This bug is fixed in bios P15 which is available for \n");
+		printk(KERN_INFO "download from support.intel.com \n");
+	}
+	return 0;
+}
+
+/* 
+ * Some APM bioses hang on APM idle calls
+ */
+
+static __init int apm_likes_to_melt(struct dmi_blacklist *d)
+{
+	if (apm_info.forbid_idle == 0) {
+		apm_info.forbid_idle = 1;
+		printk(KERN_INFO "%s machine detected. Disabling APM idle calls.\n", d->ident);
+	}
+	return 0;
+}
+
 /*
  * Some machines, usually laptops, can't handle an enabled local APIC.
  * The symptoms include hangs or reboots when suspending or resuming,
@@ -504,6 +522,7 @@
 }
 
 
+#ifdef	CONFIG_ACPI_BOOT
 extern int acpi_disabled, acpi_force;
 
 static __init __attribute__((unused)) int acpi_disable(struct dmi_blacklist *d) 
@@ -518,8 +537,6 @@
 	return 0;
 } 
 
-
-#ifdef	CONFIG_ACPI_BOOT
 extern int acpi_ht;
 
 /*
@@ -542,10 +559,8 @@
 #ifdef	CONFIG_ACPI_PCI
 static __init int disable_acpi_pci(struct dmi_blacklist *d) 
 { 
-	extern __init void pci_disable_acpi(void) ;
-
 	printk(KERN_NOTICE "%s detected: force use of pci=noacpi\n", d->ident); 	
-	pci_disable_acpi();
+	acpi_noirq_set();
 	return 0;
 } 
 #endif
@@ -566,6 +581,22 @@
 			MATCH(DMI_PRODUCT_NAME, "Latitude C600"),
 			NO_MATCH, NO_MATCH
 			} },
+	{ set_apm_ints, "Dell Latitude", {  /* Allow interrupts during suspend on Dell Latitude laptops*/
+			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+			MATCH(DMI_PRODUCT_NAME, "Latitude C510"),
+			NO_MATCH, NO_MATCH
+			} },
+	{ apm_is_horked, "Dell Inspiron 2500", { /* APM crashes */
+			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+			MATCH(DMI_PRODUCT_NAME, "Inspiron 2500"),
+			MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
+			MATCH(DMI_BIOS_VERSION,"A11")
+			} },
+	{ set_apm_ints, "Dell Inspiron", {	/* Allow interrupts during suspend on Dell Inspiron laptops*/
+			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+			MATCH(DMI_PRODUCT_NAME, "Inspiron 4000"),
+			NO_MATCH, NO_MATCH
+			} },
 	{ broken_apm_power, "Dell Inspiron 5000e", {	/* Handle problems with APM on Inspiron 5000e */
 			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
 			MATCH(DMI_BIOS_VERSION, "A04"),
@@ -576,6 +607,12 @@
 			MATCH(DMI_BIOS_VERSION, "A12"),
 			MATCH(DMI_BIOS_DATE, "02/04/2002"), NO_MATCH
 			} },
+	{ apm_is_horked, "Dell Dimension 4100", { /* APM crashes */
+			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+			MATCH(DMI_PRODUCT_NAME, "XPS-Z"),
+			MATCH(DMI_BIOS_VENDOR,"Intel Corp."),
+			MATCH(DMI_BIOS_VERSION,"A11")
+			} },
 	{ set_realmode_power_off, "Award Software v4.60 PGMA", {	/* broken PM poweroff bios */
 			MATCH(DMI_BIOS_VENDOR, "Award Software International, Inc."),
 			MATCH(DMI_BIOS_VERSION, "4.60 PGMA"),
@@ -586,21 +623,16 @@
 			MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"),
 			NO_MATCH, NO_MATCH
 			} },
-	{ set_bios_reboot, "Dell PowerEdge 300", {	/* Handle problems with rebooting on Dell 1300's */
+	{ set_bios_reboot, "Dell PowerEdge 300", {	/* Handle problems with rebooting on Dell 300's */
 			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
 			MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
 			NO_MATCH, NO_MATCH
 			} },
-	{ set_bios_reboot, "Dell PowerEdge 2400", {  /* Handle problems with rebooting on Dell 300/800's */
+	{ set_bios_reboot, "Dell PowerEdge 2400", {  /* Handle problems with rebooting on Dell 2400's */
 			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
 			MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
 			NO_MATCH, NO_MATCH
 			} },
-	{ set_apm_ints, "Dell Inspiron", {	/* Allow interrupts during suspend on Dell Inspiron laptops*/
-			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			MATCH(DMI_PRODUCT_NAME, "Inspiron 4000"),
-			NO_MATCH, NO_MATCH
-			} },
 	{ set_apm_ints, "Compaq 12XL125", {	/* Allow interrupts during suspend on Compaq Laptops*/
 			MATCH(DMI_SYS_VENDOR, "Compaq"),
 			MATCH(DMI_PRODUCT_NAME, "Compaq PC"),
@@ -627,7 +659,7 @@
 			MATCH(DMI_BIOS_VERSION, "Version1.01"),
 			NO_MATCH, NO_MATCH,
 			} },
-	{ apm_is_horked, "Intel D850MD", { /* APM crashes */
+	{ apm_is_horked_d850md, "Intel D850MD", { /* APM crashes */
 			MATCH(DMI_BIOS_VENDOR, "Intel Corp."),
 			MATCH(DMI_BIOS_VERSION, "MV85010A.86A.0016.P07.0201251536"),
 			NO_MATCH, NO_MATCH,
@@ -655,6 +687,16 @@
 			MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
 			MATCH(DMI_BIOS_VERSION,"A11")
 			} },
+	{ apm_likes_to_melt, "Jabil AMD", { /* APM idle hangs */
+			MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
+			MATCH(DMI_BIOS_VERSION, "0AASNP06"),
+			NO_MATCH, NO_MATCH,
+			} },
+	{ apm_likes_to_melt, "AMI Bios", { /* APM idle hangs */
+			MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
+			MATCH(DMI_BIOS_VERSION, "0AASNP05"), 
+			NO_MATCH, NO_MATCH,
+			} },
 	{ sony_vaio_laptop, "Sony Vaio", { /* This is a Sony Vaio laptop */
 			MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
 			MATCH(DMI_PRODUCT_NAME, "PCG-"),
@@ -785,6 +827,11 @@
                         } },
 	{ broken_pirq, "l44GX Bios", {        		/* Bad $PIR */
 			MATCH(DMI_BIOS_VENDOR, "Intel Corporation"),
+			MATCH(DMI_BIOS_VERSION,"L440GX0.86B.0115.P12"),
+			NO_MATCH, NO_MATCH
+                        } },
+	{ broken_pirq, "l44GX Bios", {        		/* Bad $PIR */
+			MATCH(DMI_BIOS_VENDOR, "Intel Corporation"),
 			MATCH(DMI_BIOS_VERSION,"L440GX0.86B.0120.P12"),
 			NO_MATCH, NO_MATCH
                         } },
@@ -798,6 +845,12 @@
 			MATCH(DMI_BIOS_VERSION,"L440GX0.86B.0066.P07.9906041405"),
 			NO_MATCH, NO_MATCH
 			} },
+
+	{ broken_pirq, "IBM xseries 370", {		/* Bad $PIR */
+			MATCH(DMI_BIOS_VENDOR, "IBM"),
+			MATCH(DMI_BIOS_VERSION,"MMKT33AUS"),
+			NO_MATCH, NO_MATCH
+			} },
                         
 	/* Intel in disguise - In this case they can't hide and they don't run
 	   too well either... */
@@ -1011,6 +1064,7 @@
 				printk(KERN_NOTICE "ACPI disabled because your bios is from %s and too old\n", s);
 				printk(KERN_NOTICE "You can enable it with acpi=force\n");
 				acpi_disabled = 1; 
+				acpi_ht = 0;
 			} 
 		}
 	}
diff -Nru a/arch/i386/kernel/efi.c b/arch/i386/kernel/efi.c
--- a/arch/i386/kernel/efi.c	Tue Feb  3 19:45:34 2004
+++ b/arch/i386/kernel/efi.c	Tue Feb  3 19:45:34 2004
@@ -174,7 +174,7 @@
 	return status;
 }
 
-int inline efi_set_rtc_mmss(unsigned long nowtime)
+inline int efi_set_rtc_mmss(unsigned long nowtime)
 {
 	int real_seconds, real_minutes;
 	efi_status_t 	status;
@@ -207,7 +207,7 @@
  * services have been remapped, therefore, we'll need to call in physical
  * mode.  Note, this call isn't used later, so mark it __init.
  */
-unsigned long inline __init efi_get_time(void)
+inline unsigned long __init efi_get_time(void)
 {
 	efi_status_t status;
 	efi_time_t eft;
diff -Nru a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
--- a/arch/i386/kernel/io_apic.c	Tue Feb  3 19:45:17 2004
+++ b/arch/i386/kernel/io_apic.c	Tue Feb  3 19:45:17 2004
@@ -1650,10 +1650,6 @@
 	unsigned char old_id;
 	unsigned long flags;
 
-	if (acpi_ioapic)
-		/* This gets done during IOAPIC enumeration for ACPI. */
-		return;
-
 	/*
 	 * This is broken; anything with a real cpu count has to
 	 * circumvent this idiocy regardless.
@@ -2286,12 +2282,14 @@
 	/*
 	 * Set up IO-APIC IRQ routing.
 	 */
-	setup_ioapic_ids_from_mpc();
+	if (!acpi_ioapic)
+		setup_ioapic_ids_from_mpc();
 	sync_Arb_IDs();
 	setup_IO_APIC_irqs();
 	init_IO_APIC_traps();
 	check_timer();
-	print_IO_APIC();
+	if (!acpi_ioapic)
+		print_IO_APIC();
 }
 
 /*
diff -Nru a/arch/i386/kernel/mca.c b/arch/i386/kernel/mca.c
--- a/arch/i386/kernel/mca.c	Tue Feb  3 19:45:35 2004
+++ b/arch/i386/kernel/mca.c	Tue Feb  3 19:45:35 2004
@@ -270,6 +270,8 @@
 
 	/* All MCA systems have at least a primary bus */
 	bus = mca_attach_bus(MCA_PRIMARY_BUS);
+	if (!bus)
+		goto out_nomem;
 	bus->default_dma_mask = 0xffffffffLL;
 	bus->f.mca_write_pos = mca_pc_write_pos;
 	bus->f.mca_read_pos = mca_pc_read_pos;
diff -Nru a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
--- a/arch/i386/kernel/mpparse.c	Tue Feb  3 19:45:17 2004
+++ b/arch/i386/kernel/mpparse.c	Tue Feb  3 19:45:17 2004
@@ -1081,8 +1081,14 @@
 
 	ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start;
 
+	/*
+	 * MPS INTI flags:
+	 *  trigger: 0=default, 1=edge, 3=level
+	 *  polarity: 0=default, 1=high, 3=low
+	 * Per ACPI spec, default for SCI means level/low.
+	 */
 	io_apic_set_pci_routing(ioapic, ioapic_pin, irq, 
-				(flags.trigger >> 1) , (flags.polarity >> 1));
+		(flags.trigger == 1 ? 0 : 1), (flags.polarity == 1 ? 0 : 1));
 }
 
 #ifdef CONFIG_ACPI_PCI
@@ -1129,8 +1135,11 @@
 			continue;
 		ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start;
 
-		if (!ioapic && (irq < 16))
-			irq += 16;
+		if (es7000_plat) {
+			if (!ioapic && (irq < 16))
+				irq += 16;
+		}
+
 		/* 
 		 * Avoid pin reprogramming.  PRTs typically include entries  
 		 * with redundant pin->irq mappings (but unique PCI devices);
@@ -1166,6 +1175,10 @@
 			mp_ioapic_routing[ioapic].apic_id, ioapic_pin, 
 			entry->irq);
 	}
+
+	print_IO_APIC();
+
+	return;
 }
 
 #endif /*CONFIG_ACPI_PCI*/
diff -Nru a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
--- a/arch/i386/kernel/setup.c	Tue Feb  3 19:45:18 2004
+++ b/arch/i386/kernel/setup.c	Tue Feb  3 19:45:18 2004
@@ -78,13 +78,10 @@
 EXPORT_SYMBOL(acpi_disabled);
 
 #ifdef	CONFIG_ACPI_BOOT
-	int acpi_irq __initdata = 1;	/* enable IRQ */
-	int acpi_ht __initdata = 1;	/* enable HT */
+extern int __initdata acpi_ht;
+int __initdata acpi_force = 0;
 #endif
 
-int acpi_force __initdata = 0;
-
-
 int MCA_bus;
 /* for MCA, but anyone else can use it if they want */
 unsigned int machine_id;
@@ -573,7 +570,7 @@
 
 		/* "pci=noacpi" disables ACPI interrupt routing */
 		else if (!memcmp(from, "pci=noacpi", 10)) {
-			acpi_irq = 0;
+			acpi_noirq_set();
 		}
 
 #ifdef CONFIG_X86_LOCAL_APIC
diff -Nru a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
--- a/arch/i386/kernel/time.c	Tue Feb  3 19:45:18 2004
+++ b/arch/i386/kernel/time.c	Tue Feb  3 19:45:18 2004
@@ -307,7 +307,31 @@
 	return retval;
 }
 
+static long clock_cmos_diff;
+
+static int time_suspend(struct sys_device *dev, u32 state)
+{
+	/*
+	 * Estimate time zone so that set_time can update the clock
+	 */
+	clock_cmos_diff = -get_cmos_time();
+	clock_cmos_diff += get_seconds();
+	return 0;
+}
+
+static int time_resume(struct sys_device *dev)
+{
+	unsigned long sec = get_cmos_time() + clock_cmos_diff;
+	write_seqlock_irq(&xtime_lock);
+	xtime.tv_sec = sec;
+	xtime.tv_nsec = 0;
+	write_sequnlock_irq(&xtime_lock);
+	return 0;
+}
+
 static struct sysdev_class pit_sysclass = {
+	.resume = time_resume,
+	.suspend = time_suspend,
 	set_kset_name("pit"),
 };
 
diff -Nru a/arch/i386/kernel/time_hpet.c b/arch/i386/kernel/time_hpet.c
--- a/arch/i386/kernel/time_hpet.c	Tue Feb  3 19:45:17 2004
+++ b/arch/i386/kernel/time_hpet.c	Tue Feb  3 19:45:17 2004
@@ -91,10 +91,6 @@
 	    !(id & HPET_ID_LEGSUP))
 		return -1;
 
-	if (((id & HPET_ID_VENDOR) >> HPET_ID_VENDOR_SHIFT) !=
-				HPET_ID_VENDOR_8086)
-		return -1;
-
 	hpet_period = hpet_readl(HPET_PERIOD);
 	if ((hpet_period < HPET_MIN_PERIOD) || (hpet_period > HPET_MAX_PERIOD))
 		return -1;
diff -Nru a/arch/i386/mach-es7000/es7000.c b/arch/i386/mach-es7000/es7000.c
--- a/arch/i386/mach-es7000/es7000.c	Tue Feb  3 19:45:42 2004
+++ b/arch/i386/mach-es7000/es7000.c	Tue Feb  3 19:45:42 2004
@@ -51,8 +51,6 @@
 int 			mip_port;
 unsigned long		mip_addr, host_addr;
 
-static int		es7000_plat;
-
 /*
  * Parse the OEM Table
  */
diff -Nru a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c
--- a/arch/i386/mach-voyager/voyager_smp.c	Tue Feb  3 19:45:17 2004
+++ b/arch/i386/mach-voyager/voyager_smp.c	Tue Feb  3 19:45:17 2004
@@ -130,7 +130,7 @@
 {
 	int cpu;
 
-	for_each_cpu(cpu, cpu_online_map) {
+	for_each_online_cpu(cpu) {
 		if(cpuset & (1<<cpu)) {
 #ifdef VOYAGER_DEBUG
 			if(!cpu_isset(cpu, cpu_online_map))
@@ -1465,7 +1465,7 @@
 	cpuset &= 0xff;		/* only first 8 CPUs vaild for VIC CPI */
 	if(cpuset == 0)
 		return;
-	for_each_cpu(cpu, cpu_online_map) {
+	for_each_online_cpu(cpu) {
 		if(cpuset & (1<<cpu))
 			set_bit(cpi, &vic_cpi_mailbox[cpu]);
 	}
@@ -1579,7 +1579,7 @@
 	VDEBUG(("VOYAGER: enable_vic_irq(%d) CPU%d affinity 0x%lx\n",
 		irq, cpu, cpu_irq_affinity[cpu]));
 	spin_lock_irqsave(&vic_irq_lock, flags);
-	for_each_cpu(real_cpu, cpu_online_map) {
+	for_each_online_cpu(real_cpu) {
 		if(!(voyager_extended_vic_processors & (1<<real_cpu)))
 			continue;
 		if(!(cpu_irq_affinity[real_cpu] & mask)) {
@@ -1720,7 +1720,7 @@
 			int i;
 			__u8 cpu = smp_processor_id();
 			__u8 real_cpu;
-			int mask;
+			int mask; /* Um... initialize me??? --RR */
 
 			printk("VOYAGER SMP: CPU%d lost interrupt %d\n",
 			       cpu, irq);
@@ -1809,7 +1809,7 @@
 		 * bus) */
 		return;
 
-	for_each_cpu(cpu, cpu_online_map) {
+	for_each_online_cpu(cpu) {
 		unsigned long cpu_mask = 1 << cpu;
 		
 		if(cpu_mask & real_mask) {
@@ -1875,7 +1875,7 @@
 	int old_cpu = smp_processor_id(), cpu;
 
 	/* dump the interrupt masks of each processor */
-	for_each_cpu(cpu, cpu_online_map) {
+	for_each_online_cpu(cpu) {
 		__u16 imr, isr, irr;
 		unsigned long flags;
 
diff -Nru a/arch/i386/mm/extable.c b/arch/i386/mm/extable.c
--- a/arch/i386/mm/extable.c	Tue Feb  3 19:45:43 2004
+++ b/arch/i386/mm/extable.c	Tue Feb  3 19:45:43 2004
@@ -7,28 +7,6 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 
-/* Simple binary search */
-const struct exception_table_entry *
-search_extable(const struct exception_table_entry *first,
-	       const struct exception_table_entry *last,
-	       unsigned long value)
-{
-        while (first <= last) {
-		const struct exception_table_entry *mid;
-		long diff;
-
-		mid = (last - first) / 2 + first;
-		diff = mid->insn - value;
-                if (diff == 0)
-                        return mid;
-                else if (diff < 0)
-                        first = mid+1;
-                else
-                        last = mid-1;
-        }
-        return NULL;
-}
-
 int fixup_exception(struct pt_regs *regs)
 {
 	const struct exception_table_entry *fixup;
diff -Nru a/arch/i386/pci/acpi.c b/arch/i386/pci/acpi.c
--- a/arch/i386/pci/acpi.c	Tue Feb  3 19:45:30 2004
+++ b/arch/i386/pci/acpi.c	Tue Feb  3 19:45:30 2004
@@ -18,7 +18,7 @@
 	if (pcibios_scanned)
 		return 0;
 
-	if (!(pci_probe & PCI_NO_ACPI_ROUTING)) {
+	if (!acpi_noirq) {
 		if (!acpi_pci_irq_init()) {
 			printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
 			printk(KERN_INFO "PCI: if you experience problems, try using option 'pci=noacpi' or even 'acpi=off'\n");
@@ -31,15 +31,4 @@
 
 	return 0;
 }
-
-/*
- * pci_disable_acpi()
- * act like pci=noacpi seen on command line
- * called by DMI blacklist code
- */
-__init void pci_disable_acpi(void)
-{
-        pci_probe |= PCI_NO_ACPI_ROUTING;
-}
-
 subsys_initcall(pci_acpi_init);
diff -Nru a/arch/i386/pci/common.c b/arch/i386/pci/common.c
--- a/arch/i386/pci/common.c	Tue Feb  3 19:45:17 2004
+++ b/arch/i386/pci/common.c	Tue Feb  3 19:45:17 2004
@@ -9,6 +9,7 @@
 #include <linux/ioport.h>
 #include <linux/init.h>
 
+#include <asm/acpi.h>
 #include <asm/segment.h>
 #include <asm/io.h>
 #include <asm/smp.h>
@@ -197,12 +198,10 @@
 		return NULL;
 	}
 #endif
-#ifdef CONFIG_ACPI_PCI
 	else if (!strcmp(str, "noacpi")) {
-		pci_probe |= PCI_NO_ACPI_ROUTING;
+		acpi_noirq_set();
 		return NULL;
 	}
-#endif
 #ifndef CONFIG_X86_VISWS
 	else if (!strcmp(str, "usepirqmask")) {
 		pci_probe |= PCI_USE_PIRQ_MASK;
diff -Nru a/arch/i386/pci/direct.c b/arch/i386/pci/direct.c
--- a/arch/i386/pci/direct.c	Tue Feb  3 19:45:17 2004
+++ b/arch/i386/pci/direct.c	Tue Feb  3 19:45:17 2004
@@ -259,7 +259,7 @@
 	release_resource(region);
 
  type2:
-	if ((!pci_probe & PCI_PROBE_CONF2) == 0)
+	if ((pci_probe & PCI_PROBE_CONF2) == 0)
 		goto out;
 	region = request_region(0xCF8, 4, "PCI conf2");
 	if (!region)
diff -Nru a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h
--- a/arch/i386/pci/pci.h	Tue Feb  3 19:45:29 2004
+++ b/arch/i386/pci/pci.h	Tue Feb  3 19:45:29 2004
@@ -22,7 +22,6 @@
 #define PCI_ASSIGN_ROMS		0x1000
 #define PCI_BIOS_IRQ_SCAN	0x2000
 #define PCI_ASSIGN_ALL_BUSSES	0x4000
-#define PCI_NO_ACPI_ROUTING	0x8000
 
 extern unsigned int pci_probe;
 
diff -Nru a/arch/ia64/Kconfig b/arch/ia64/Kconfig
--- a/arch/ia64/Kconfig	Tue Feb  3 19:45:42 2004
+++ b/arch/ia64/Kconfig	Tue Feb  3 19:45:42 2004
@@ -16,10 +16,11 @@
 	  The Itanium Processor Family is Intel's 64-bit successor to
 	  the 32-bit X86 line.  The IA-64 Linux project has a home
 	  page at <http://www.linuxia64.org/> and a mailing list at
-	  linux-ia64@linuxia64.org.
+	  linux-ia64@vger.kernel.org.
 
 config 64BIT
-	def_bool y
+	bool
+	default y
 
 config MMU
 	bool
@@ -33,14 +34,18 @@
 	bool
 	default y
 
+config EFI
+	bool
+	default y
+
 choice
-	prompt "IA-64 processor type"
+	prompt "Processor type"
 	default ITANIUM
 
 config ITANIUM
 	bool "Itanium"
 	help
-	  Select your IA-64 processor type.  The default is Intel Itanium.
+	  Select your IA-64 processor type.  The default is Itanium.
 	  This choice is safe for all IA-64 systems, but may not perform
 	  optimally on systems with, say, Itanium 2 or newer processors.
 
@@ -52,7 +57,7 @@
 endchoice
 
 choice
-	prompt "IA-64 system type"
+	prompt "System type"
 	default IA64_GENERIC
 
 config IA64_GENERIC
@@ -61,41 +66,34 @@
 	select ACPI_NUMA
 	select VIRTUAL_MEM_MAP
 	select DISCONTIGMEM
-	---help---
+	help
 	  This selects the system type of your hardware.  A "generic" kernel
 	  will run on any supported IA-64 system.  However, if you configure
 	  a kernel for your specific system, it will be faster and smaller.
 
-	  To find out what type of IA-64 system you have, you may want to
-	  check the IA-64 Linux web site at <http://www.linux-ia64.org/>.
-	  As of the time of this writing, most hardware is DIG compliant,
-	  so the "DIG-compliant" option is usually the right choice.
-
-	  HP-simulator   For the HP simulator
-	  (<http://software.hp.com/ia64linux/>).
-	  HP-zx1         For HP zx1-based systems.
+	  generic	 For any supported IA-64 system
+	  DIG-compliant	 For DIG ("Developer's Interface Guide") compliant systems
+	  HP-zx1/sx1000	 For HP systems
 	  SGI-SN2	 For SGI Altix systems
-	  DIG-compliant  For DIG ("Developer's Interface Guide") compliant
-	  systems.
+	  Ski-simulator  For the HP simulator (<http://www.hpl.hp.com/research/linux/ski/>)
 
 	  If you don't know what to do, choose "generic".
 
 config IA64_DIG
 	bool "DIG-compliant"
 
-config IA64_HP_SIM
-	bool "HP-simulator"
-
 config IA64_HP_ZX1
-	bool "HP-zx1"
+	bool "HP-zx1/sx1000"
 	help
-	  Build a kernel that runs on HP zx1-based systems.  This adds support
-	  for the zx1 I/O MMU and makes root bus bridges appear in PCI config
-	  space (required for zx1 agpgart support).
+	  Build a kernel that runs on HP zx1 and sx1000 systems.  This adds
+	  support for the HP I/O MMU.
 
 config IA64_SGI_SN2
 	bool "SGI-SN2"
 
+config IA64_HP_SIM
+	bool "Ski-simulator"
+
 endchoice
 
 choice
@@ -104,7 +102,7 @@
 
 config IA64_PAGE_SIZE_4KB
 	bool "4KB"
-	---help---
+	help
 	  This lets you select the page size of the kernel.  For best IA-64
 	  performance, a page size of 8KB or 16KB is recommended.  For best
 	  IA-32 compatibility, a page size of 4KB should be selected (the vast
@@ -135,7 +133,7 @@
 	bool
 	depends on !IA64_HP_SIM
 	default y
-	---help---
+	help
 	  ACPI/OSPM support for Linux is currently under development. As such,
 	  this support is preliminary and EXPERIMENTAL.  Configuring ACPI
 	  support enables kernel interfaces that allow higher level software
@@ -183,7 +181,7 @@
 	default y
 
 config ITANIUM_BSTEP_SPECIFIC
-	bool "Enable Itanium B-step specific code"
+	bool "Itanium B-step specific code"
 	depends on ITANIUM
 	help
 	  Select this option to build a kernel for an Itanium prototype system
@@ -198,38 +196,30 @@
 
 # align cache-sensitive data to 64 bytes
 config MCKINLEY_ASTEP_SPECIFIC
-	bool "Enable McKinley A-step specific code"
+	bool "McKinley A-step specific code"
 	depends on MCKINLEY
 	help
 	  Select this option to build a kernel for an IA-64 McKinley prototype
 	  system with any A-stepping CPU.
 
 config MCKINLEY_A0_SPECIFIC
-	bool "Enable McKinley A0/A1-step specific code"
+	bool "McKinley A0/A1-step specific code"
 	depends on MCKINLEY_ASTEP_SPECIFIC
 	help
 	  Select this option to build a kernel for an IA-64 McKinley prototype
 	  system with an A0 or A1 stepping CPU.
 
 config NUMA
-	bool "Enable NUMA support" if IA64_GENERIC || IA64_DIG || IA64_HP_ZX1
-	default y if IA64_SGI_SN2 || IA64_GENERIC
+	bool "NUMA support"
+	depends on !IA64_HP_SIM
+	default y if IA64_SGI_SN2
 	help
 	  Say Y to compile the kernel to support NUMA (Non-Uniform Memory
 	  Access).  This option is for configuring high-end multiprocessor
 	  server systems.  If in doubt, say N.
 
-config DISCONTIGMEM
-	bool "Discontiguous memory support" if (IA64_DIG || IA64_SGI_SN2 || IA64_GENERIC) && NUMA && VIRTUAL_MEM_MAP
-	default y if (IA64_SGI_SN2 || IA64_GENERIC) && NUMA
-	help
-	  Say Y to support efficient handling of discontiguous physical memory,
-	  for architectures which are either NUMA (Non-Uniform Memory Access)
-	  or have huge holes in the physical address space for other reasons.
-	  See <file:Documentation/vm/numa> for more.
-
 config VIRTUAL_MEM_MAP
-	bool "Enable Virtual Mem Map"
+	bool "Virtual mem map"
 	default y if !IA64_HP_SIM
 	help
 	  Say Y to compile the kernel with support for a virtual mem map.
@@ -238,8 +228,18 @@
 	  require the DISCONTIGMEM option for your machine. If you are
 	  unsure, say Y.
 
+config DISCONTIGMEM
+	bool "Discontiguous memory support"
+	depends on (IA64_DIG || IA64_SGI_SN2 || IA64_GENERIC) && NUMA && VIRTUAL_MEM_MAP
+	default y if (IA64_SGI_SN2 || IA64_GENERIC) && NUMA
+	help
+	  Say Y to support efficient handling of discontiguous physical memory,
+	  for architectures which are either NUMA (Non-Uniform Memory Access)
+	  or have huge holes in the physical address space for other reasons.
+	  See <file:Documentation/vm/numa> for more.
+
 config IA64_MCA
-	bool "Enable IA-64 Machine Check Abort"
+	bool "Machine Check Abort"
 	default y if !IA64_HP_SIM
 	help
 	  Say Y here to enable machine check support for IA-64.  If you're
@@ -249,7 +249,7 @@
 	bool "Power Management support"
 	depends on IA64_GENERIC || IA64_DIG || IA64_HP_ZX1
 	default y
-	---help---
+	help
 	  "Power Management" means that parts of your computer are shut
 	  off or put into a power conserving "sleep" mode if they are not
 	  being used.  There are two competing standards for doing this: APM
@@ -258,8 +258,7 @@
 
 	  Power Management is most important for battery powered laptop
 	  computers; if you have a laptop, check out the Linux Laptop home
-	  page on the WWW at
-	  <http://www.cs.utexas.edu/users/kharker/linux-laptop/> and the
+	  page on the WWW at <http://www.linux-on-laptops.com/> and the
 	  Battery Powered Linux mini-HOWTO, available from
 	  <http://www.tldp.org/docs.html#howto>.
 
@@ -269,11 +268,11 @@
 
 config IOSAPIC
 	bool
-	depends on IA64_GENERIC || IA64_DIG || IA64_HP_ZX1 || IA64_SGI_SN2
+	depends on !IA64_HP_SIM
 	default y
 
 config IA64_SGI_SN_SIM
-	bool "Enable SGI Medusa Simulator Support"
+	bool "SGI Medusa Simulator Support"
 	depends on IA64_SGI_SN2
 	help
 	  If you are compiling a kernel that will run under SGI's IA-64
@@ -284,7 +283,7 @@
 	default "18"
 
 choice
-	prompt "IA-64 Huge TLB Page Size"
+	prompt "Huge TLB page size"
 	depends on HUGETLB_PAGE
 	default HUGETLB_PAGE_SIZE_16MB
 
@@ -318,7 +317,7 @@
 
 config IA64_PAL_IDLE
 	bool "Use PAL_HALT_LIGHT in idle loop"
-	---help---
+	help
 	  Say Y here to enable use of PAL_HALT_LIGHT in the cpu_idle loop.
 	  This allows the CPU to enter a low power state when idle.  You
 	  can enable CONFIG_IA64_PALINFO and check /proc/pal/cpu0/power_info
@@ -326,24 +325,35 @@
 	  unsure your firmware supports it, answer N.
 
 config SMP
-	bool "SMP support"
-	---help---
+	bool "Symmetric multi-processing support"
+	help
 	  This enables support for systems with more than one CPU. If you have
-	  a system with only one CPU say N. If you have a system with more than
-	  one CPU, say Y.
+	  a system with only one CPU, say N.  If you have a system with more
+	  than one CPU, say Y.
 
 	  If you say N here, the kernel will run on single and multiprocessor
-	  systems, but will use only one CPU of a multiprocessor system. If
+	  systems, but will use only one CPU of a multiprocessor system.  If
 	  you say Y here, the kernel will run on many, but not all,
-	  singleprocessor system. On a singleprocessor system, the kernel
+	  single processor systems.  On a single processor system, the kernel
 	  will run faster if you say N here.
 
-	  See also the <file:Documentation/smp.tex>,
-	  <file:Documentation/smp.txt>, and the SMP-HOWTO available at
-	  <http://www.tldp.org/docs.html#howto>.
+	  See also the <file:Documentation/smp.txt> and the SMP-HOWTO
+	  available at <http://www.tldp.org/docs.html#howto>.
 
 	  If you don't know what to do here, say N.
 
+config NR_CPUS
+	int "Maximum number of CPUs (2-512)"
+	range 2 512
+	depends on SMP
+	default "64"
+	help
+	  You should set this to the number of CPUs in your system, but
+	  keep in mind that a kernel compiled for, e.g., 2 CPUs will boot but
+	  only use 2 CPUs on a >2 CPU system.  Setting this to a value larger
+	  than 64 will cause the use of a CPU mask array, causing a small
+	  performance hit.
+
 config PREEMPT
 	bool "Preemptible Kernel"
         help
@@ -356,8 +366,13 @@
           Say Y here if you are building a kernel for a desktop, embedded
           or real-time system.  Say N if you are unsure.
 
+config HAVE_DEC_LOCK
+	bool
+	depends on (SMP || PREEMPT)
+	default y
+
 config IA32_SUPPORT
-	bool "Support running of Linux/x86 binaries"
+	bool "Support for Linux/x86 binaries"
 	help
 	  IA-64 processors can execute IA-32 (X86) instructions.  By
 	  saying Y here, the kernel will include IA-32 system call
@@ -370,11 +385,6 @@
 	depends on IA32_SUPPORT
 	default y
 
-config HAVE_DEC_LOCK
-	bool
-	depends on (SMP || PREEMPT)
-	default y
-
 config PERFMON
 	bool "Performance monitor support"
 	help
@@ -394,12 +404,6 @@
 	  To use this option, you have to ensure that the "/proc file system
 	  support" (CONFIG_PROC_FS) is enabled, too.
 
-
-config EFI
-	bool
-	depends on !IA64_HP_SIM
-	default y
-
 config EFI_VARS
 	tristate "/proc/efi/vars support"
 	help
@@ -410,17 +414,6 @@
 	  To use this option, you have to check that the "/proc file system
 	  support" (CONFIG_PROC_FS) is enabled, too.
 
-config NR_CPUS
-	int "Maximum number of CPUs"
-	depends on SMP
-	default "64"
-	help
-	  You should set this to the number of CPUs in your system, but
-	  keep in mind that a kernel compiled for, e.g., 2 CPUs will boot but
-	  only use 2 CPUs on a >2 CPU system.  Setting this to a value larger
-	  than 64 will cause the use of a CPU mask array, causing a small
-	  performance hit.
-
 source "fs/Kconfig.binfmt"
 
 if !IA64_HP_SIM
@@ -448,7 +441,7 @@
 
 config HOTPLUG
 	bool "Support for hot-pluggable devices"
-	---help---
+	help
 	  Say Y here if you want to plug devices into your computer while
 	  the system is running, and be able to use them quickly.  In many
 	  cases, the devices can likewise be unplugged at any time too.
@@ -514,6 +507,8 @@
 source "drivers/input/Kconfig"
 
 source "drivers/char/Kconfig"
+
+source "drivers/i2c/Kconfig"
 
 #source drivers/misc/Config.in
 source "drivers/media/Kconfig"
diff -Nru a/arch/ia64/Makefile b/arch/ia64/Makefile
--- a/arch/ia64/Makefile	Tue Feb  3 19:45:16 2004
+++ b/arch/ia64/Makefile	Tue Feb  3 19:45:16 2004
@@ -5,10 +5,11 @@
 # License.  See the file "COPYING" in the main directory of this archive
 # for more details.
 #
-# Copyright (C) 1998-2003 by David Mosberger-Tang <davidm@hpl.hp.com>
+# Copyright (C) 1998-2004 by David Mosberger-Tang <davidm@hpl.hp.com>
 #
 
 NM := $(CROSS_COMPILE)nm -B
+READELF := $(CROSS_COMPILE)readelf
 
 export AWK
 
@@ -25,9 +26,8 @@
 GCC_VERSION=$(shell $(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f1 -d'.')
 GCC_MINOR_VERSION=$(shell $(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f2 -d'.')
 
-GAS_STATUS=$(shell $(srctree)/arch/ia64/scripts/check-gas $(CC) $(OBJDUMP))
-
-CPPFLAGS	+= $(shell $(srctree)/arch/ia64/scripts/toolchain-flags $(CC) $(OBJDUMP))
+GAS_STATUS	= $(shell $(srctree)/arch/ia64/scripts/check-gas $(CC) $(OBJDUMP))
+CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags $(CC) $(OBJDUMP) $(READELF))
 
 ifeq ($(GAS_STATUS),buggy)
 $(error Sorry, you need a newer version of the assember, one that is built from	\
@@ -71,15 +71,15 @@
 
 .PHONY: boot compressed check
 
-all: compressed
+all: compressed unwcheck
 
 compressed: vmlinux.gz
 
 vmlinux.gz: vmlinux
 	$(Q)$(MAKE) $(build)=$(boot) $@
 
-check: vmlinux
-	arch/ia64/scripts/unwcheck.sh $<
+unwcheck: vmlinux
+	-$(Q)READELF=$(READELF) $(srctree)/arch/ia64/scripts/unwcheck.py $<
 
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
@@ -88,7 +88,7 @@
 
 prepare: include/asm-ia64/offsets.h
 
-arch/ia64/kernel/asm-offsets.s: include/asm include/linux/version.h
+arch/ia64/kernel/asm-offsets.s: include/asm include/linux/version.h include/config/MARKER
 
 include/asm-ia64/offsets.h: arch/ia64/kernel/asm-offsets.s
 	$(call filechk,gen-asm-offsets)
@@ -108,4 +108,5 @@
 define archhelp
   echo '* compressed	- Build compressed kernel image'
   echo '  boot		- Build vmlinux and bootloader for Ski simulator'
+  echo '* unwcheck	- Check vmlinux for invalid unwind info'
 endef
diff -Nru a/arch/ia64/configs/generic_defconfig b/arch/ia64/configs/generic_defconfig
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/ia64/configs/generic_defconfig	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,1045 @@
+#
+# Automatically generated make config: don't edit
+#
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
+
+#
+# General setup
+#
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+CONFIG_LOG_BUF_SHIFT=20
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+# CONFIG_EMBEDDED is not set
+CONFIG_KALLSYMS=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_MODVERSIONS=y
+CONFIG_KMOD=y
+
+#
+# Processor type and features
+#
+CONFIG_IA64=y
+CONFIG_64BIT=y
+CONFIG_MMU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_TIME_INTERPOLATION=y
+# CONFIG_ITANIUM is not set
+CONFIG_MCKINLEY=y
+CONFIG_IA64_GENERIC=y
+# CONFIG_IA64_DIG is not set
+# CONFIG_IA64_HP_SIM is not set
+# CONFIG_IA64_HP_ZX1 is not set
+# CONFIG_IA64_SGI_SN2 is not set
+# CONFIG_IA64_PAGE_SIZE_4KB is not set
+# CONFIG_IA64_PAGE_SIZE_8KB is not set
+CONFIG_IA64_PAGE_SIZE_16KB=y
+# CONFIG_IA64_PAGE_SIZE_64KB is not set
+CONFIG_ACPI=y
+CONFIG_ACPI_INTERPRETER=y
+CONFIG_ACPI_KERNEL_CONFIG=y
+CONFIG_IA64_L1_CACHE_SHIFT=7
+# CONFIG_MCKINLEY_ASTEP_SPECIFIC is not set
+CONFIG_NUMA=y
+CONFIG_DISCONTIGMEM=y
+CONFIG_VIRTUAL_MEM_MAP=y
+CONFIG_IA64_MCA=y
+CONFIG_PM=y
+CONFIG_IOSAPIC=y
+CONFIG_FORCE_MAX_ZONEORDER=18
+# CONFIG_HUGETLB_PAGE_SIZE_4GB is not set
+# CONFIG_HUGETLB_PAGE_SIZE_1GB is not set
+# CONFIG_HUGETLB_PAGE_SIZE_256MB is not set
+# CONFIG_HUGETLB_PAGE_SIZE_64MB is not set
+CONFIG_HUGETLB_PAGE_SIZE_16MB=y
+# CONFIG_HUGETLB_PAGE_SIZE_4MB is not set
+# CONFIG_HUGETLB_PAGE_SIZE_1MB is not set
+# CONFIG_HUGETLB_PAGE_SIZE_256KB is not set
+# CONFIG_IA64_PAL_IDLE is not set
+CONFIG_SMP=y
+# CONFIG_PREEMPT is not set
+CONFIG_IA32_SUPPORT=y
+CONFIG_COMPAT=y
+CONFIG_HAVE_DEC_LOCK=y
+CONFIG_PERFMON=y
+CONFIG_IA64_PALINFO=y
+CONFIG_EFI=y
+CONFIG_EFI_VARS=y
+CONFIG_NR_CPUS=512
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+
+#
+# ACPI (Advanced Configuration and Power Interface) Support
+#
+CONFIG_ACPI_BOOT=y
+CONFIG_ACPI_BUTTON=m
+CONFIG_ACPI_FAN=m
+CONFIG_ACPI_PROCESSOR=m
+CONFIG_ACPI_THERMAL=m
+CONFIG_ACPI_NUMA=y
+# CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_BUS=y
+CONFIG_ACPI_POWER=y
+CONFIG_ACPI_PCI=y
+CONFIG_ACPI_SYSTEM=y
+# CONFIG_ACPI_RELAXED_AML is not set
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_LEGACY_PROC=y
+CONFIG_PCI_NAMES=y
+CONFIG_HOTPLUG=y
+
+#
+# PCI Hotplug Support
+#
+CONFIG_HOTPLUG_PCI=m
+# CONFIG_HOTPLUG_PCI_FAKE is not set
+CONFIG_HOTPLUG_PCI_ACPI=m
+# CONFIG_HOTPLUG_PCI_CPCI is not set
+
+#
+# PCMCIA/CardBus support
+#
+# CONFIG_PCMCIA is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Generic Driver Options
+#
+# CONFIG_FW_LOADER is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Plug and Play support
+#
+# CONFIG_PNP is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD 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
+CONFIG_BLK_DEV_RAM=m
+CONFIG_BLK_DEV_RAM_SIZE=4096
+# CONFIG_BLK_DEV_INITRD is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_IDEDISK_STROKE is not set
+CONFIG_BLK_DEV_IDECD=y
+# CONFIG_BLK_DEV_IDETAPE is not set
+CONFIG_BLK_DEV_IDEFLOPPY=y
+CONFIG_BLK_DEV_IDESCSI=m
+# CONFIG_IDE_TASK_IOCTL is not set
+# CONFIG_IDE_TASKFILE_IO is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_BLK_DEV_IDEPCI=y
+# CONFIG_IDEPCI_SHARE_IRQ is not set
+# CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_BLK_DEV_GENERIC=y
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+CONFIG_IDEDMA_PCI_AUTO=y
+# CONFIG_IDEDMA_ONLYDISK is not set
+# CONFIG_IDEDMA_PCI_WIP is not set
+CONFIG_BLK_DEV_ADMA=y
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+CONFIG_BLK_DEV_CMD64X=y
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+# CONFIG_BLK_DEV_HPT34X is not set
+# CONFIG_BLK_DEV_HPT366 is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+CONFIG_BLK_DEV_PIIX=y
+# CONFIG_BLK_DEV_NS87415 is not set
+# CONFIG_BLK_DEV_PDC202XX_OLD is not set
+# CONFIG_BLK_DEV_PDC202XX_NEW is not set
+# CONFIG_BLK_DEV_SVWKS is not set
+# CONFIG_BLK_DEV_SIIMAGE is not set
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+# CONFIG_BLK_DEV_VIA82CXXX is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+CONFIG_IDEDMA_AUTO=y
+# CONFIG_DMA_NONPCI is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# 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=y
+
+#
+# Fusion MPT device support
+#
+CONFIG_FUSION=y
+CONFIG_FUSION_BOOT=y
+CONFIG_FUSION_MAX_SGE=40
+# CONFIG_FUSION_ISENSE is not set
+# CONFIG_FUSION_CTL is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_ST=m
+# CONFIG_CHR_DEV_OSST is not set
+CONFIG_BLK_DEV_SR=m
+# CONFIG_BLK_DEV_SR_VENDOR is not set
+CONFIG_CHR_DEV_SG=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+CONFIG_SCSI_REPORT_LUNS=y
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_ADVANSYS is not set
+# CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_SATA is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_CPQFCTS is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_EATA_PIO is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INIA100 is not set
+CONFIG_SCSI_SYM53C8XX_2=y
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
+# CONFIG_SCSI_QLOGIC_ISP is not set
+CONFIG_SCSI_QLOGIC_FC=y
+# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set
+CONFIG_SCSI_QLOGIC_1280=y
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# Networking support
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_NETLINK_DEV=y
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+CONFIG_ARPD=y
+# CONFIG_INET_ECN is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_IPV6 is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NETFILTER is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+CONFIG_IPV6_SCTP__=y
+# CONFIG_IP_SCTP is not set
+# CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+CONFIG_DUMMY=m
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_ETHERTAP is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=m
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+
+#
+# Tulip family network device support
+#
+CONFIG_NET_TULIP=y
+# CONFIG_DE2104X is not set
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+# CONFIG_TULIP_MMIO is not set
+# CONFIG_DE4X5 is not set
+# CONFIG_WINBOND_840 is not set
+# CONFIG_DM9102 is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_PCI=y
+# CONFIG_PCNET32 is not set
+# CONFIG_AMD8111_ETH is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_B44 is not set
+# CONFIG_DGRS is not set
+CONFIG_EEPRO100=m
+# CONFIG_EEPRO100_PIO is not set
+CONFIG_E100=m
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_8139CP is not set
+# CONFIG_8139TOO is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_VIA_RHINE is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+CONFIG_E1000=m
+# CONFIG_E1000_NAPI is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SK98LIN is not set
+CONFIG_TIGON3=y
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_IXGB is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# Bluetooth support
+#
+# CONFIG_BT is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN_BOOL is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input I/O drivers
+#
+CONFIG_GAMEPORT=m
+CONFIG_SOUND_GAMEPORT=m
+# CONFIG_GAMEPORT_NS558 is not set
+# CONFIG_GAMEPORT_L4 is not set
+# CONFIG_GAMEPORT_EMU10K1 is not set
+# CONFIG_GAMEPORT_VORTEX is not set
+# CONFIG_GAMEPORT_FM801 is not set
+# CONFIG_GAMEPORT_CS461x is not set
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PCIPS2 is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_SERIAL_NONSTANDARD=y
+# CONFIG_ROCKETPORT is not set
+# CONFIG_SYNCLINK is not set
+# CONFIG_SYNCLINKMP is not set
+# CONFIG_N_HDLC is not set
+# CONFIG_STALDRV is not set
+CONFIG_SGI_L1_SERIAL=y
+CONFIG_SGI_L1_SERIAL_CONSOLE=y
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_ACPI=y
+CONFIG_SERIAL_8250_HCDP=y
+CONFIG_SERIAL_8250_NR_UARTS=6
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_MULTIPORT is not set
+# CONFIG_SERIAL_8250_RSA is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# I2C Algorithms
+#
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C Hardware Sensors Chip support
+#
+# CONFIG_I2C_SENSOR is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+# CONFIG_QIC02_TAPE is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+# CONFIG_GEN_RTC is not set
+CONFIG_EFI_RTC=y
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+CONFIG_AGP=m
+CONFIG_AGP_I460=m
+CONFIG_AGP_HP_ZX1=m
+CONFIG_DRM=y
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_GAMMA=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_MGA=m
+CONFIG_DRM_SIS=m
+CONFIG_RAW_DRIVER=m
+CONFIG_MAX_RAW_DEVS=256
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=y
+# CONFIG_XFS_RT is not set
+# CONFIG_XFS_QUOTA is not set
+# CONFIG_XFS_POSIX_ACL is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_QUOTA is not set
+CONFIG_AUTOFS_FS=y
+CONFIG_AUTOFS4_FS=y
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+# CONFIG_ZISOFS is not set
+CONFIG_UDF_FS=m
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+# CONFIG_MSDOS_FS is not set
+CONFIG_VFAT_FS=y
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+# CONFIG_DEVFS_FS is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+CONFIG_HUGETLBFS=y
+CONFIG_HUGETLB_PAGE=y
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_DIRECTIO=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=m
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_SUNRPC=m
+# CONFIG_SUNRPC_GSS is not set
+CONFIG_SMB_FS=m
+CONFIG_SMB_NLS_DEFAULT=y
+CONFIG_SMB_NLS_REMOTE="cp437"
+CONFIG_CIFS=m
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_NEC98_PARTITION is not set
+CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+CONFIG_EFI_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+# CONFIG_MDA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+
+#
+# Sound
+#
+CONFIG_SOUND=m
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SND_VERBOSE_PRINTK=y
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_DUMMY=m
+CONFIG_SND_VIRMIDI=m
+CONFIG_SND_MTPAV=m
+CONFIG_SND_SERIAL_U16550=m
+CONFIG_SND_MPU401=m
+
+#
+# PCI devices
+#
+# CONFIG_SND_ALI5451 is not set
+# CONFIG_SND_AZT3328 is not set
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_CS4281=m
+CONFIG_SND_EMU10K1=m
+# CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_NM256 is not set
+# CONFIG_SND_RME32 is not set
+# CONFIG_SND_RME96 is not set
+# CONFIG_SND_RME9652 is not set
+# CONFIG_SND_HDSP is not set
+# CONFIG_SND_TRIDENT is not set
+# CONFIG_SND_YMFPCI is not set
+# CONFIG_SND_ALS4000 is not set
+# CONFIG_SND_CMIPCI is not set
+# CONFIG_SND_ENS1370 is not set
+# CONFIG_SND_ENS1371 is not set
+# CONFIG_SND_ES1938 is not set
+# CONFIG_SND_ES1968 is not set
+# CONFIG_SND_MAESTRO3 is not set
+CONFIG_SND_FM801=m
+# CONFIG_SND_ICE1712 is not set
+# CONFIG_SND_ICE1724 is not set
+# CONFIG_SND_INTEL8X0 is not set
+# CONFIG_SND_SONICVIBES is not set
+# CONFIG_SND_VIA82XX is not set
+# CONFIG_SND_VX222 is not set
+
+#
+# ALSA USB devices
+#
+# CONFIG_SND_USB_AUDIO is not set
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+
+#
+# USB support
+#
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_UHCI_HCD=m
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH_TTY is not set
+# CONFIG_USB_MIDI is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_HP8200e is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+CONFIG_USB_HID=m
+CONFIG_USB_HIDINPUT=y
+# CONFIG_HID_FF is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+# CONFIG_USB_AIPTEK is not set
+# CONFIG_USB_WACOM is not set
+# CONFIG_USB_KBTAB is not set
+# CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_XPAD is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_TIGL is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_BRLVGER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_GADGET is not set
+
+#
+# Library routines
+#
+CONFIG_CRC32=y
+
+#
+# HP Simulator drivers
+#
+# CONFIG_HP_SIMETH is not set
+# CONFIG_HP_SIMSERIAL is not set
+# CONFIG_HP_SIMSCSI is not set
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+CONFIG_IA64_GRANULE_16MB=y
+# CONFIG_IA64_GRANULE_64MB is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_IA64_PRINT_HAZARDS is not set
+# CONFIG_DISABLE_VHPT is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_IA64_DEBUG_CMPXCHG is not set
+# CONFIG_IA64_DEBUG_IRQ is not set
+# CONFIG_DEBUG_INFO is not set
+
+#
+# Security options
+#
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+# CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_TEST is not set
diff -Nru a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig
--- a/arch/ia64/configs/sn2_defconfig	Tue Feb  3 19:45:16 2004
+++ b/arch/ia64/configs/sn2_defconfig	Tue Feb  3 19:45:16 2004
@@ -15,8 +15,6 @@
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
-CONFIG_PAGG=y
-CONFIG_PAGG_JOB=y
 CONFIG_SYSCTL=y
 CONFIG_LOG_BUF_SHIFT=20
 # CONFIG_IKCONFIG is not set
@@ -27,6 +25,7 @@
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -53,7 +52,6 @@
 CONFIG_IA64_PAGE_SIZE_16KB=y
 # CONFIG_IA64_PAGE_SIZE_64KB is not set
 CONFIG_ACPI=y
-CONFIG_ACPI_EFI=y
 CONFIG_ACPI_INTERPRETER=y
 CONFIG_ACPI_KERNEL_CONFIG=y
 CONFIG_IA64_L1_CACHE_SHIFT=7
@@ -70,9 +68,10 @@
 # CONFIG_PREEMPT is not set
 CONFIG_IA32_SUPPORT=y
 CONFIG_COMPAT=y
+CONFIG_HAVE_DEC_LOCK=y
 CONFIG_PERFMON=y
 CONFIG_IA64_PALINFO=y
-CONFIG_IA64_SALINFO=y
+CONFIG_EFI=y
 # CONFIG_EFI_VARS is not set
 CONFIG_NR_CPUS=512
 CONFIG_BINFMT_ELF=y
@@ -145,7 +144,60 @@
 #
 # ATA/ATAPI/MFM/RLL support
 #
-# CONFIG_IDE is not set
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDEDISK is not set
+CONFIG_BLK_DEV_IDECD=y
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+# CONFIG_IDE_TASKFILE_IO is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+# CONFIG_BLK_DEV_GENERIC is not set
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+CONFIG_IDEDMA_PCI_AUTO=y
+# CONFIG_IDEDMA_ONLYDISK is not set
+# CONFIG_IDEDMA_PCI_WIP is not set
+CONFIG_BLK_DEV_ADMA=y
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+# CONFIG_BLK_DEV_CMD64X is not set
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+# CONFIG_BLK_DEV_HPT34X is not set
+# CONFIG_BLK_DEV_HPT366 is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+# CONFIG_BLK_DEV_PIIX is not set
+# CONFIG_BLK_DEV_NS87415 is not set
+# CONFIG_BLK_DEV_PDC202XX_OLD is not set
+# CONFIG_BLK_DEV_PDC202XX_NEW is not set
+# CONFIG_BLK_DEV_SVWKS is not set
+CONFIG_BLK_DEV_SGIIOC4=y
+# CONFIG_BLK_DEV_SIIMAGE is not set
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+# CONFIG_BLK_DEV_VIA82CXXX is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+CONFIG_IDEDMA_AUTO=y
+# CONFIG_DMA_NONPCI is not set
+# CONFIG_BLK_DEV_HD is not set
 
 #
 # IEEE 1394 (FireWire) support (EXPERIMENTAL)
@@ -216,6 +268,7 @@
 # CONFIG_SCSI_QLOGIC_FC is not set
 CONFIG_SCSI_QLOGIC_1280=y
 # CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
 
@@ -585,11 +638,11 @@
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
 CONFIG_EFI_PARTITION=y
-CONFIG_NLS=y
 
 #
 # Native Language Support
 #
+CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_CODEPAGE_437 is not set
 # CONFIG_NLS_CODEPAGE_737 is not set
diff -Nru a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
--- a/arch/ia64/hp/common/sba_iommu.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/hp/common/sba_iommu.c	Tue Feb  3 19:45:17 2004
@@ -1,9 +1,9 @@
 /*
 **  IA64 System Bus Adapter (SBA) I/O MMU manager
 **
-**	(c) Copyright 2002-2003 Alex Williamson
+**	(c) Copyright 2002-2004 Alex Williamson
 **	(c) Copyright 2002-2003 Grant Grundler
-**	(c) Copyright 2002-2003 Hewlett-Packard Company
+**	(c) Copyright 2002-2004 Hewlett-Packard Company
 **
 **	Portions (c) 2000 Grant Grundler (from parisc I/O MMU code)
 **	Portions (c) 1999 Dave S. Miller (from sparc64 I/O MMU code)
@@ -39,12 +39,19 @@
 #include <asm/page.h>		/* PAGE_OFFSET */
 #include <asm/dma.h>
 #include <asm/system.h>		/* wmb() */
+#include <asm/bitops.h>		/* hweight64() */
 
 #include <asm/acpi-ext.h>
 
 #define PFX "IOC: "
 
 /*
+** Enabling timing search of the pdir resource map.  Output in /proc.
+** Disabled by default to optimize performance.
+*/
+#undef PDIR_SEARCH_TIMING
+
+/*
 ** This option allows cards capable of 64bit DMA to bypass the IOMMU.  If
 ** not defined, all DMA will be 32bit and go through the TLB.
 ** There's potentially a conflict in the bio merge code with us
@@ -54,11 +61,6 @@
 */
 #define ALLOW_IOV_BYPASS
 
-#ifdef CONFIG_PROC_FS
-  /* turn it off for now; without per-CPU counters, it's too much of a scalability bottleneck: */
-# define SBA_PROC_FS 0
-#endif
-
 /*
 ** If a device prefetches beyond the end of a valid pdir entry, it will cause
 ** a hard failure, ie. MCA.  Version 3.0 and later of the zx1 LBA should
@@ -156,25 +158,26 @@
 #define IOC_TCNFG	0x318
 #define IOC_PDIR_BASE	0x320
 
+#define IOC_ROPE0_CFG	0x500
+#define   IOC_ROPE_AO	  0x10	/* Allow "Relaxed Ordering" */
+
+
 /* AGP GART driver looks for this */
 #define ZX1_SBA_IOMMU_COOKIE	0x0000badbadc0ffeeUL
 
 /*
-** IOC supports 4/8/16/64KB page sizes (see TCNFG register)
-** It's safer (avoid memory corruption) to keep DMA page mappings
-** equivalently sized to VM PAGE_SIZE.
+** The zx1 IOC supports 4/8/16/64KB page sizes (see TCNFG register)
 **
-** We really can't avoid generating a new mapping for each
-** page since the Virtual Coherence Index has to be generated
-** and updated for each page.
+** Some IOCs (sx1000) can run at the above pages sizes, but are
+** really only supported using the IOC at a 4k page size.
 **
-** IOVP_SIZE could only be greater than PAGE_SIZE if we are
+** iovp_size could only be greater than PAGE_SIZE if we are
 ** confident the drivers really only touch the next physical
 ** page iff that driver instance owns it.
 */
-#define IOVP_SIZE	PAGE_SIZE
-#define IOVP_SHIFT	PAGE_SHIFT
-#define IOVP_MASK	PAGE_MASK
+static unsigned long iovp_size;
+static unsigned long iovp_shift;
+static unsigned long iovp_mask;
 
 struct ioc {
 	void		*ioc_hpa;	/* I/O MMU base address */
@@ -198,24 +201,10 @@
 	} saved[DELAYED_RESOURCE_CNT];
 #endif
 
-#if SBA_PROC_FS
+#ifdef PDIR_SEARCH_TIMING
 #define SBA_SEARCH_SAMPLE	0x100
 	unsigned long avg_search[SBA_SEARCH_SAMPLE];
 	unsigned long avg_idx;	/* current index into avg_search */
-	unsigned long used_pages;
-	unsigned long msingle_calls;
-	unsigned long msingle_pages;
-	unsigned long msg_calls;
-	unsigned long msg_pages;
-	unsigned long usingle_calls;
-	unsigned long usingle_pages;
-	unsigned long usg_calls;
-	unsigned long usg_pages;
-#ifdef ALLOW_IOV_BYPASS
-	unsigned long msingle_bypass;
-	unsigned long usingle_bypass;
-	unsigned long msg_bypass;
-#endif
 #endif
 
 	/* Stuff we don't need in performance path */
@@ -252,7 +241,7 @@
 ** rather than the HW. I/O MMU allocation alogorithms can be
 ** faster with smaller size is (to some degree).
 */
-#define DMA_CHUNK_SIZE  (BITS_PER_LONG*PAGE_SIZE)
+#define DMA_CHUNK_SIZE  (BITS_PER_LONG*iovp_size)
 
 #define ROUNDUP(x,y) ((x + ((y)-1)) & ~((y)-1))
 
@@ -416,18 +405,37 @@
 #define PAGES_PER_RANGE 1	/* could increase this to 4 or 8 if needed */
 
 /* Convert from IOVP to IOVA and vice versa. */
-#define SBA_IOVA(ioc,iovp,offset,hint_reg) ((ioc->ibase) | (iovp) | (offset) |		\
-					    ((hint_reg)<<(ioc->hint_shift_pdir)))
-#define SBA_IOVP(ioc,iova) (((iova) & ioc->hint_mask_pdir) & ~(ioc->ibase))
+#define SBA_IOVA(ioc,iovp,offset,hint_reg) ((ioc->ibase) | (iovp) | (offset))
+#define SBA_IOVP(ioc,iova) ((iova) & ~(ioc->ibase))
+
+#define PDIR_ENTRY_SIZE	sizeof(u64)
 
-/* FIXME : review these macros to verify correctness and usage */
-#define PDIR_INDEX(iovp)   ((iovp)>>IOVP_SHIFT)
+#define PDIR_INDEX(iovp)   ((iovp)>>iovp_shift)
 
 #define RESMAP_MASK(n)    ~(~0UL << (n))
 #define RESMAP_IDX_MASK   (sizeof(unsigned long) - 1)
 
 
 /**
+ * For most cases the normal get_order is sufficient, however it limits us
+ * to PAGE_SIZE being the minimum mapping alignment and TC flush granularity.
+ * It only incurs about 1 clock cycle to use this one with the static variable
+ * and makes the code more intuitive.
+ */
+static SBA_INLINE int
+get_iovp_order (unsigned long size)
+{
+	long double d = size - 1;
+	long order;
+
+	order = ia64_getf_exp(d);
+	order = order - iovp_shift - 0xffff + 1;
+	if (order < 0)
+		order = 0;
+	return order;
+}
+
+/**
  * sba_search_bitmap - find free space in IO PDIR resource bitmap
  * @ioc: IO MMU structure which owns the pdir we are interested in.
  * @bits_wanted: number of entries we need.
@@ -465,7 +473,7 @@
 		** We need the alignment to invalidate I/O TLB using
 		** SBA HW features in the unmap path.
 		*/
-		unsigned long o = 1 << get_order(bits_wanted << PAGE_SHIFT);
+		unsigned long o = 1 << get_iovp_order(bits_wanted << iovp_shift);
 		uint bitshiftcnt = ROUNDUP(ioc->res_bitshift, o);
 		unsigned long mask;
 
@@ -521,16 +529,15 @@
 static int
 sba_alloc_range(struct ioc *ioc, size_t size)
 {
-	unsigned int pages_needed = size >> IOVP_SHIFT;
-#if SBA_PROC_FS
+	unsigned int pages_needed = size >> iovp_shift;
+#ifdef PDIR_SEARCH_TIMING
 	unsigned long itc_start = ia64_get_itc();
 #endif
 	unsigned long pide;
 
 	ASSERT(pages_needed);
-	ASSERT((pages_needed * IOVP_SIZE) <= DMA_CHUNK_SIZE);
 	ASSERT(pages_needed <= BITS_PER_LONG);
-	ASSERT(0 == (size & ~IOVP_MASK));
+	ASSERT(0 == (size & ~iovp_mask));
 
 	/*
 	** "seek and ye shall find"...praying never hurts either...
@@ -546,7 +553,7 @@
 
 #ifdef ASSERT_PDIR_SANITY
 	/* verify the first enable bit is clear */
-	if(0x00 != ((u8 *) ioc->pdir_base)[pide*sizeof(u64) + 7]) {
+	if(0x00 != ((u8 *) ioc->pdir_base)[pide*PDIR_ENTRY_SIZE + 7]) {
 		sba_dump_pdir_entry(ioc, "sba_search_bitmap() botched it?", pide);
 	}
 #endif
@@ -556,17 +563,9 @@
 		(uint) ((unsigned long) ioc->res_hint - (unsigned long) ioc->res_map),
 		ioc->res_bitshift );
 
-#if SBA_PROC_FS
-	{
-		unsigned long itc_end = ia64_get_itc();
-		unsigned long tmp = itc_end - itc_start;
-		/* check for roll over */
-		itc_start = (itc_end < itc_start) ?  -(tmp) : (tmp);
-	}
-	ioc->avg_search[ioc->avg_idx++] = itc_start;
+#ifdef PDIR_SEARCH_TIMING
+	ioc->avg_search[ioc->avg_idx++] = ia64_get_itc() - itc_start;
 	ioc->avg_idx &= SBA_SEARCH_SAMPLE - 1;
-
-	ioc->used_pages += pages_needed;
 #endif
 
 	return (pide);
@@ -589,7 +588,7 @@
 	unsigned int ridx = pide >> 3;	/* convert bit to byte address */
 	unsigned long *res_ptr = (unsigned long *) &((ioc)->res_map[ridx & ~RESMAP_IDX_MASK]);
 
-	int bits_not_wanted = size >> IOVP_SHIFT;
+	int bits_not_wanted = size >> iovp_shift;
 
 	/* 3-bits "bit" address plus 2 (or 3) bits for "byte" == bit in word */
 	unsigned long m = RESMAP_MASK(bits_not_wanted) << (pide & (BITS_PER_LONG - 1));
@@ -598,13 +597,9 @@
 		__FUNCTION__, (uint) iova, size,
 		bits_not_wanted, m, pide, res_ptr, *res_ptr);
 
-#if SBA_PROC_FS
-	ioc->used_pages -= bits_not_wanted;
-#endif
-
 	ASSERT(m != 0);
 	ASSERT(bits_not_wanted);
-	ASSERT((bits_not_wanted * IOVP_SIZE) <= DMA_CHUNK_SIZE);
+	ASSERT((bits_not_wanted * iovp_size) <= DMA_CHUNK_SIZE);
 	ASSERT(bits_not_wanted <= BITS_PER_LONG);
 	ASSERT((*res_ptr & m) == m); /* verify same bits are set */
 	*res_ptr &= ~m;
@@ -702,7 +697,7 @@
 
 	/* Must be non-zero and rounded up */
 	ASSERT(byte_cnt > 0);
-	ASSERT(0 == (byte_cnt & ~IOVP_MASK));
+	ASSERT(0 == (byte_cnt & ~iovp_mask));
 
 #ifdef ASSERT_PDIR_SANITY
 	/* Assert first pdir entry is set */
@@ -711,11 +706,11 @@
 	}
 #endif
 
-	if (byte_cnt <= IOVP_SIZE)
+	if (byte_cnt <= iovp_size)
 	{
 		ASSERT(off < ioc->pdir_size);
 
-		iovp |= IOVP_SHIFT;     /* set "size" field for PCOM */
+		iovp |= iovp_shift;     /* set "size" field for PCOM */
 
 #ifndef FULL_VALID_PDIR
 		/*
@@ -734,7 +729,7 @@
 		ioc->pdir_base[off] = (0x80000000000000FFULL | prefetch_spill_page);
 #endif
 	} else {
-		u32 t = get_order(byte_cnt) + PAGE_SHIFT;
+		u32 t = get_iovp_order(byte_cnt) + iovp_shift;
 
 		iovp |= t;
 		ASSERT(t <= 31);   /* 2GB! Max value of "size" field */
@@ -749,7 +744,7 @@
 			ioc->pdir_base[off] = (0x80000000000000FFULL | prefetch_spill_page);
 #endif
 			off++;
-			byte_cnt -= IOVP_SIZE;
+			byte_cnt -= iovp_size;
 		} while (byte_cnt > 0);
 	}
 
@@ -790,11 +785,6 @@
  		** Device is bit capable of DMA'ing to the buffer...
 		** just return the PCI address of ptr
  		*/
-#if SBA_PROC_FS
-		spin_lock_irqsave(&ioc->res_lock, flags);
-		ioc->msingle_bypass++;
-		spin_unlock_irqrestore(&ioc->res_lock, flags);
-#endif
 		DBG_BYPASS("sba_map_single() bypass mask/addr: 0x%lx/0x%lx\n",
 		           *dev->dma_mask, pci_addr);
 		return pci_addr;
@@ -805,10 +795,10 @@
 	ASSERT(size <= DMA_CHUNK_SIZE);
 
 	/* save offset bits */
-	offset = ((dma_addr_t) (long) addr) & ~IOVP_MASK;
+	offset = ((dma_addr_t) (long) addr) & ~iovp_mask;
 
-	/* round up to nearest IOVP_SIZE */
-	size = (size + offset + ~IOVP_MASK) & IOVP_MASK;
+	/* round up to nearest iovp_size */
+	size = (size + offset + ~iovp_mask) & iovp_mask;
 
 	spin_lock_irqsave(&ioc->res_lock, flags);
 #ifdef ASSERT_PDIR_SANITY
@@ -816,12 +806,8 @@
 		panic("Sanity check failed");
 #endif
 
-#if SBA_PROC_FS
-	ioc->msingle_calls++;
-	ioc->msingle_pages += size >> IOVP_SHIFT;
-#endif
 	pide = sba_alloc_range(ioc, size);
-	iovp = (dma_addr_t) pide << IOVP_SHIFT;
+	iovp = (dma_addr_t) pide << iovp_shift;
 
 	DBG_RUN("%s() 0x%p -> 0x%lx\n",
 		__FUNCTION__, addr, (long) iovp | offset);
@@ -834,8 +820,8 @@
 
 		DBG_RUN("     pdir 0x%p %lx\n", pdir_start, *pdir_start);
 
-		addr += IOVP_SIZE;
-		size -= IOVP_SIZE;
+		addr += iovp_size;
+		size -= iovp_size;
 		pdir_start++;
 	}
 	/* force pdir update */
@@ -875,11 +861,6 @@
 		/*
 		** Address does not fall w/in IOVA, must be bypassing
 		*/
-#if SBA_PROC_FS
-		spin_lock_irqsave(&ioc->res_lock, flags);
-		ioc->usingle_bypass++;
-		spin_unlock_irqrestore(&ioc->res_lock, flags);
-#endif
 		DBG_BYPASS("sba_unmap_single() bypass addr: 0x%lx\n", iova);
 
 #ifdef ENABLE_MARK_CLEAN
@@ -890,20 +871,16 @@
 		return;
 	}
 #endif
-	offset = iova & ~IOVP_MASK;
+	offset = iova & ~iovp_mask;
 
 	DBG_RUN("%s() iovp 0x%lx/%x\n",
 		__FUNCTION__, (long) iova, size);
 
 	iova ^= offset;        /* clear offset bits */
 	size += offset;
-	size = ROUNDUP(size, IOVP_SIZE);
+	size = ROUNDUP(size, iovp_size);
 
 	spin_lock_irqsave(&ioc->res_lock, flags);
-#if SBA_PROC_FS
-	ioc->usingle_calls++;
-	ioc->usingle_pages += size >> IOVP_SHIFT;
-#endif
 
 #if DELAYED_RESOURCE_CNT > 0
 	d = &(ioc->saved[ioc->saved_cnt]);
@@ -930,7 +907,7 @@
 		int off = PDIR_INDEX(iovp);
 		void *addr;
 
-		if (size <= IOVP_SIZE) {
+		if (size <= iovp_size) {
 			addr = phys_to_virt(ioc->pdir_base[off] &
 					    ~0xE000000000000FFFULL);
 			mark_clean(addr, size);
@@ -940,9 +917,9 @@
 			do {
 				addr = phys_to_virt(ioc->pdir_base[off] &
 				                    ~0xE000000000000FFFULL);
-				mark_clean(addr, min(byte_cnt, IOVP_SIZE));
+				mark_clean(addr, min(byte_cnt, iovp_size));
 				off++;
-				byte_cnt -= IOVP_SIZE;
+				byte_cnt -= iovp_size;
 
 			   } while (byte_cnt > 0);
 		}
@@ -1061,11 +1038,11 @@
 		*/
 		if (startsg->dma_address & PIDE_FLAG) {
 			u32 pide = startsg->dma_address & ~PIDE_FLAG;
-			dma_offset = (unsigned long) pide & ~IOVP_MASK;
+			dma_offset = (unsigned long) pide & ~iovp_mask;
 			startsg->dma_address = 0;
 			dma_sg++;
 			dma_sg->dma_address = pide | ioc->ibase;
-			pdirp = &(ioc->pdir_base[pide >> IOVP_SHIFT]);
+			pdirp = &(ioc->pdir_base[pide >> iovp_shift]);
 			n_mappings++;
 		}
 
@@ -1082,14 +1059,11 @@
 			dma_sg->dma_length += cnt;
 			cnt += dma_offset;
 			dma_offset=0;	/* only want offset on first chunk */
-			cnt = ROUNDUP(cnt, IOVP_SIZE);
-#if SBA_PROC_FS
-			ioc->msg_pages += cnt >> IOVP_SHIFT;
-#endif
+			cnt = ROUNDUP(cnt, iovp_size);
 			do {
 				sba_io_pdir_entry(pdirp, vaddr);
-				vaddr += IOVP_SIZE;
-				cnt -= IOVP_SIZE;
+				vaddr += iovp_size;
+				cnt -= iovp_size;
 				pdirp++;
 			} while (cnt > 0);
 		}
@@ -1107,12 +1081,12 @@
 
 /*
 ** Two address ranges are DMA contiguous *iff* "end of prev" and
-** "start of next" are both on a page boundry.
+** "start of next" are both on an IOV page boundary.
 **
 ** (shift left is a quick trick to mask off upper bits)
 */
 #define DMA_CONTIG(__X, __Y) \
-	(((((unsigned long) __X) | ((unsigned long) __Y)) << (BITS_PER_LONG - PAGE_SHIFT)) == 0UL)
+	(((((unsigned long) __X) | ((unsigned long) __Y)) << (BITS_PER_LONG - iovp_shift)) == 0UL)
 
 
 /**
@@ -1150,7 +1124,7 @@
 		dma_sg = vcontig_sg = startsg;
 		dma_len = vcontig_len = vcontig_end = startsg->length;
 		vcontig_end +=  vaddr;
-		dma_offset = vaddr & ~IOVP_MASK;
+		dma_offset = vaddr & ~iovp_mask;
 
 		/* PARANOID: clear entries */
 		startsg->dma_address = startsg->dma_length = 0;
@@ -1175,7 +1149,7 @@
 			** exceed DMA_CHUNK_SIZE if we coalesce the
 			** next entry.
 			*/
-			if (((dma_len + dma_offset + startsg->length + ~IOVP_MASK) & IOVP_MASK)
+			if (((dma_len + dma_offset + startsg->length + ~iovp_mask) & iovp_mask)
 			    > DMA_CHUNK_SIZE)
 				break;
 
@@ -1194,7 +1168,7 @@
 			}
 
 #ifdef DEBUG_LARGE_SG_ENTRIES
-			dump_run_sg = (vcontig_len > IOVP_SIZE);
+			dump_run_sg = (vcontig_len > iovp_size);
 #endif
 
 			/*
@@ -1233,10 +1207,10 @@
 		** Allocate space for DMA stream.
 		*/
 		vcontig_sg->dma_length = vcontig_len;
-		dma_len = (dma_len + dma_offset + ~IOVP_MASK) & IOVP_MASK;
+		dma_len = (dma_len + dma_offset + ~iovp_mask) & iovp_mask;
 		ASSERT(dma_len <= DMA_CHUNK_SIZE);
 		dma_sg->dma_address = (dma_addr_t) (PIDE_FLAG
-			| (sba_alloc_range(ioc, dma_len) << IOVP_SHIFT)
+			| (sba_alloc_range(ioc, dma_len) << iovp_shift)
 			| dma_offset);
 		n_mappings++;
 	}
@@ -1273,11 +1247,6 @@
 			sg->dma_length = sg->length;
 			sg->dma_address = virt_to_phys(sba_sg_address(sg));
 		}
-#if SBA_PROC_FS
-		spin_lock_irqsave(&ioc->res_lock, flags);
-		ioc->msg_bypass++;
-		spin_unlock_irqrestore(&ioc->res_lock, flags);
-#endif
 		return filled;
 	}
 #endif
@@ -1285,13 +1254,7 @@
 	if (nents == 1) {
 		sglist->dma_length = sglist->length;
 		sglist->dma_address = sba_map_single(dev, sba_sg_address(sglist), sglist->length,
-						     dir);
-#if SBA_PROC_FS
-		/*
-		** Should probably do some stats counting, but trying to
-		** be precise quickly starts wasting CPU time.
-		*/
-#endif
+		                                     dir);
 		return 1;
 	}
 
@@ -1305,10 +1268,6 @@
 	}
 #endif
 
-#if SBA_PROC_FS
-	ioc->msg_calls++;
-#endif
-
 	/*
 	** First coalesce the chunks and allocate I/O pdir space
 	**
@@ -1368,10 +1327,6 @@
 	ioc = GET_IOC(dev);
 	ASSERT(ioc);
 
-#if SBA_PROC_FS
-	ioc->usg_calls++;
-#endif
-
 #ifdef ASSERT_PDIR_SANITY
 	spin_lock_irqsave(&ioc->res_lock, flags);
 	sba_check_pdir(ioc,"Check before sba_unmap_sg()");
@@ -1381,16 +1336,6 @@
 	while (nents && sglist->dma_length) {
 
 		sba_unmap_single(dev, sglist->dma_address, sglist->dma_length, dir);
-#if SBA_PROC_FS
-		/*
-		** This leaves inconsistent data in the stats, but we can't
-		** tell which sg lists were mapped by map_single and which
-		** were coalesced to a single entry.  The stats are fun,
-		** but speed is more important.
-		*/
-		ioc->usg_pages += ((sglist->dma_address & ~IOVP_MASK) + sglist->dma_length
-				   + IOVP_SIZE - 1) >> PAGE_SHIFT;
-#endif
 		sglist++;
 		nents--;
 	}
@@ -1414,13 +1359,13 @@
 static void __init
 ioc_iova_init(struct ioc *ioc)
 {
-	u32 iova_space_mask;
-	int iov_order, tcnfg;
+	int tcnfg;
 	int agp_found = 0;
 	struct pci_dev *device = NULL;
 #ifdef FULL_VALID_PDIR
 	unsigned long index;
 #endif
+	unsigned int i;
 
 	/*
 	** Firmware programs the base and size of a "safe IOVA space"
@@ -1428,23 +1373,27 @@
 	** IBASE and IMASK registers.
 	*/
 	ioc->ibase = READ_REG(ioc->ioc_hpa + IOC_IBASE) & ~0x1UL;
-	ioc->iov_size = ~(READ_REG(ioc->ioc_hpa + IOC_IMASK) & 0xFFFFFFFFUL) + 1;
+	ioc->imask = READ_REG(ioc->ioc_hpa + IOC_IMASK) | 0xFFFFFFFF00000000UL;
 
-	/*
-	** iov_order is always based on a 1GB IOVA space since we want to
-	** turn on the other half for AGP GART.
-	*/
-	iov_order = get_order(ioc->iov_size >> (IOVP_SHIFT - PAGE_SHIFT));
-	ioc->pdir_size = (ioc->iov_size / IOVP_SIZE) * sizeof(u64);
+	ioc->iov_size = ~ioc->imask + 1;
 
-	DBG_INIT("%s() hpa %p IOV %dMB (%d bits) PDIR size 0x%x\n",
-		 __FUNCTION__, ioc->ioc_hpa, ioc->iov_size >> 20,
-		 iov_order + PAGE_SHIFT, ioc->pdir_size);
-
-	/* FIXME : DMA HINTs not used */
-	ioc->hint_shift_pdir = iov_order + PAGE_SHIFT;
-	ioc->hint_mask_pdir = ~(0x3 << (iov_order + PAGE_SHIFT));
+	DBG_INIT("%s() hpa %p IOV base 0x%lx mask 0x%lx (%dMB)\n",
+		__FUNCTION__, ioc->ioc_hpa, ioc->ibase, ioc->imask,
+		ioc->iov_size >> 20);
+
+	switch (iovp_size) {
+		case  4*1024: tcnfg = 0; break;
+		case  8*1024: tcnfg = 1; break;
+		case 16*1024: tcnfg = 2; break;
+		case 64*1024: tcnfg = 3; break;
+		default:
+			panic(PFX "Unsupported IOTLB page size %ldK",
+				iovp_size >> 10);
+			break;
+	}
+	WRITE_REG(tcnfg, ioc->ioc_hpa + IOC_TCNFG);
 
+	ioc->pdir_size = (ioc->iov_size / iovp_size) * PDIR_ENTRY_SIZE;
 	ioc->pdir_base = (void *) __get_free_pages(GFP_KERNEL,
 						   get_order(ioc->pdir_size));
 	if (!ioc->pdir_base)
@@ -1452,61 +1401,12 @@
 
 	memset(ioc->pdir_base, 0, ioc->pdir_size);
 
-	DBG_INIT("%s() pdir %p size %x hint_shift_pdir %x hint_mask_pdir %lx\n",
-		__FUNCTION__, ioc->pdir_base, ioc->pdir_size,
-		ioc->hint_shift_pdir, ioc->hint_mask_pdir);
+	DBG_INIT("%s() IOV page size %ldK pdir %p size %x\n", __FUNCTION__,
+		iovp_size >> 10, ioc->pdir_base, ioc->pdir_size);
 
-	ASSERT((((unsigned long) ioc->pdir_base) & PAGE_MASK) == (unsigned long) ioc->pdir_base);
+	ASSERT(ALIGN((unsigned long) ioc->pdir_base, 4*1024) == (unsigned long) ioc->pdir_base);
 	WRITE_REG(virt_to_phys(ioc->pdir_base), ioc->ioc_hpa + IOC_PDIR_BASE);
 
-	DBG_INIT(" base %p\n", ioc->pdir_base);
-
-	/* build IMASK for IOC and Elroy */
-	iova_space_mask =  0xffffffff;
-	iova_space_mask <<= (iov_order + PAGE_SHIFT);
-	ioc->imask = iova_space_mask;
-
-	DBG_INIT("%s() IOV base 0x%lx mask 0x%0lx\n",
-		__FUNCTION__, ioc->ibase, ioc->imask);
-
-	/*
-	** FIXME: Hint registers are programmed with default hint
-	** values during boot, so hints should be sane even if we
-	** can't reprogram them the way drivers want.
-	*/
-	WRITE_REG(ioc->imask, ioc->ioc_hpa + IOC_IMASK);
-
-	/*
-	** Setting the upper bits makes checking for bypass addresses
-	** a little faster later on.
-	*/
-	ioc->imask |= 0xFFFFFFFF00000000UL;
-
-	/* Set I/O PDIR Page size to system page size */
-	switch (PAGE_SHIFT) {
-		case 12: tcnfg = 0; break;	/*  4K */
-		case 13: tcnfg = 1; break;	/*  8K */
-		case 14: tcnfg = 2; break;	/* 16K */
-		case 16: tcnfg = 3; break;	/* 64K */
-		default:
-			panic(PFX "Unsupported system page size %d",
-				1 << PAGE_SHIFT);
-			break;
-	}
-	WRITE_REG(tcnfg, ioc->ioc_hpa + IOC_TCNFG);
-
-	/*
-	** Program the IOC's ibase and enable IOVA translation
-	** Bit zero == enable bit.
-	*/
-	WRITE_REG(ioc->ibase | 1, ioc->ioc_hpa + IOC_IBASE);
-
-	/*
-	** Clear I/O TLB of any possible entries.
-	** (Yes. This is a bit paranoid...but so what)
-	*/
-	WRITE_REG(ioc->ibase | (iov_order+PAGE_SHIFT), ioc->ioc_hpa + IOC_PCOM);
-
 	/*
 	** If an AGP device is present, only use half of the IOV space
 	** for PCI DMA.  Unfortunately we can't know ahead of time
@@ -1519,8 +1419,8 @@
 		agp_found |= pci_find_capability(device, PCI_CAP_ID_AGP);
 
 	if (agp_found && reserve_sba_gart) {
-		DBG_INIT("%s: AGP device found, reserving half of IOVA for GART support\n",
-			 __FUNCTION__);
+		printk(KERN_INFO PFX "reserving %dMb of IOVA space at 0x%lx for agpgart\n",
+		      ioc->iov_size/2 >> 20, ioc->ibase + ioc->iov_size/2);
 		ioc->pdir_size /= 2;
 		((u64 *)ioc->pdir_base)[PDIR_INDEX(ioc->iov_size/2)] = ZX1_SBA_IOMMU_COOKIE;
 	}
@@ -1534,12 +1434,12 @@
 		int poison_size = 16;
 		void *poison_addr, *addr;
 
-		addr = (void *)__get_free_pages(GFP_KERNEL, get_order(IOVP_SIZE));
+		addr = (void *)__get_free_pages(GFP_KERNEL, get_order(iovp_size));
 		if (!addr)
 			panic(PFX "Couldn't allocate PDIR spill page\n");
 
 		poison_addr = addr;
-		for ( ; (u64) poison_addr < addr + IOVP_SIZE; poison_addr += poison_size)
+		for ( ; (u64) poison_addr < addr + iovp_size; poison_addr += poison_size)
 			memcpy(poison_addr, spill_poison, poison_size);
 
 		prefetch_spill_page = virt_to_phys(addr);
@@ -1549,10 +1449,29 @@
 	/*
   	** Set all the PDIR entries valid w/ the spill page as the target
 	*/
-	for (index = 0 ; index < (ioc->pdir_size / sizeof(u64)) ; index++)
+	for (index = 0 ; index < (ioc->pdir_size / PDIR_ENTRY_SIZE) ; index++)
 		((u64 *)ioc->pdir_base)[index] = (0x80000000000000FF | prefetch_spill_page);
 #endif
 
+	/* Clear I/O TLB of any possible entries */
+	WRITE_REG(ioc->ibase | (get_iovp_order(ioc->iov_size) + iovp_shift), ioc->ioc_hpa + IOC_PCOM);
+	READ_REG(ioc->ioc_hpa + IOC_PCOM);
+
+	/* Enable IOVA translation */
+	WRITE_REG(ioc->ibase | 1, ioc->ioc_hpa + IOC_IBASE);
+	READ_REG(ioc->ioc_hpa + IOC_IBASE);
+
+	/* Clear ROPE(N)_CONFIG AO bit.
+	** Disables "NT Ordering" (~= !"Relaxed Ordering")
+	** Overrides bit 1 in DMA Hint Sets.
+	** Improves netperf UDP_STREAM by ~10% for tg3 on bcm5701.
+	*/
+	for (i=0; i<(8*8); i+=8) {
+		unsigned long rope_config;
+		rope_config = READ_REG(ioc->ioc_hpa + IOC_ROPE0_CFG + i);
+		rope_config &= ~IOC_ROPE_AO;
+		WRITE_REG(rope_config, ioc->ioc_hpa + IOC_ROPE0_CFG + i);
+	}
 }
 
 static void __init
@@ -1561,7 +1480,7 @@
 	spin_lock_init(&ioc->res_lock);
 
 	/* resource map size dictated by pdir_size */
-	ioc->res_size = ioc->pdir_size / sizeof(u64); /* entries */
+	ioc->res_size = ioc->pdir_size / PDIR_ENTRY_SIZE; /* entries */
 	ioc->res_size >>= 3;  /* convert bit count to byte count */
 	DBG_INIT("%s() res_size 0x%x\n", __FUNCTION__, ioc->res_size);
 
@@ -1582,7 +1501,7 @@
 #ifdef FULL_VALID_PDIR
 	/* Mark the last resource used so we don't prefetch beyond IOVA space */
 	ioc->res_map[ioc->res_size - 1] |= 0x80UL; /* res_map is chars */
-	ioc->pdir_base[(ioc->pdir_size / sizeof(u64)) - 1] = (0x80000000000000FF
+	ioc->pdir_base[(ioc->pdir_size / PDIR_ENTRY_SIZE) - 1] = (0x80000000000000FF
 							      | prefetch_spill_page);
 #endif
 
@@ -1627,6 +1546,23 @@
 		panic(PFX "IOC 2.0 or later required for IOMMU support\n");
 
 	ioc->dma_mask = 0xFFFFFFFFFFUL;
+
+	if (!iovp_shift) {
+		/* 64k is max iommu page size */
+		iovp_shift = min(PAGE_SHIFT, 16);
+		iovp_size = (1 << iovp_shift);
+		iovp_mask = ~(iovp_size - 1);
+	}
+}
+
+static void __init
+ioc_sx1000_init(struct ioc *ioc)
+{
+	if (!iovp_shift) {
+		iovp_shift = 12;	/* 4K for now */
+		iovp_size = (1 << iovp_shift);
+		iovp_mask = ~(iovp_size - 1);
+	}
 }
 
 typedef void (initfunc)(struct ioc *);
@@ -1639,8 +1575,8 @@
 
 static struct ioc_iommu ioc_iommu_info[] __initdata = {
 	{ ZX1_IOC_ID, "zx1", ioc_zx1_init },
-	{ REO_IOC_ID, "REO" },
-	{ SX1000_IOC_ID, "sx1000" },
+	{ REO_IOC_ID, "REO", ioc_sx1000_init },
+	{ SX1000_IOC_ID, "sx1000", ioc_sx1000_init },
 };
 
 static struct ioc * __init
@@ -1665,6 +1601,11 @@
 	ioc->rev = READ_REG(ioc->ioc_hpa + IOC_FCLASS) & 0xFFUL;
 	ioc->dma_mask = 0xFFFFFFFFFFFFFFFFUL;	/* conservative */
 
+	if (iovp_shift) {
+		iovp_size = (1 << iovp_shift);
+		iovp_mask = ~(iovp_size - 1);
+	}
+
 	for (info = ioc_iommu_info; info < ioc_iommu_info + ARRAY_SIZE(ioc_iommu_info); info++) {
 		if (ioc->func_id == info->func_id) {
 			ioc->name = info->name;
@@ -1672,6 +1613,8 @@
 				(info->init)(ioc);
 		}
 	}
+	DBG_INIT("%s: PAGE_SIZE %ldK, iovp_size %ldK\n", __FUNCTION__,
+		PAGE_SIZE >> 10, iovp_size >> 10);
 
 	if (!ioc->name) {
 		ioc->name = kmalloc(24, GFP_KERNEL);
@@ -1686,8 +1629,8 @@
 	ioc_resource_init(ioc);
 	ioc_sac_init(ioc);
 
-	if ((long) ~IOVP_MASK > (long) ia64_max_iommu_merge_mask)
-		ia64_max_iommu_merge_mask = ~IOVP_MASK;
+	if ((long) ~iovp_mask > (long) ia64_max_iommu_merge_mask)
+		ia64_max_iommu_merge_mask = ~iovp_mask;
 	MAX_DMA_ADDRESS = ~0UL;
 
 	printk(KERN_INFO PFX
@@ -1709,7 +1652,7 @@
 **
 **************************************************************************/
 
-#if SBA_PROC_FS
+#ifdef CONFIG_PROC_FS
 static void *
 ioc_start(struct seq_file *s, loff_t *pos)
 {
@@ -1741,55 +1684,37 @@
 ioc_show(struct seq_file *s, void *v)
 {
 	struct ioc *ioc = v;
-	int total_pages = (int) (ioc->res_size << 3); /* 8 bits per byte */
-	unsigned long i = 0, avg = 0, min, max;
+	unsigned long *res_ptr = (unsigned long *)ioc->res_map;
+	int i, used = 0;
 
 	seq_printf(s, "Hewlett Packard %s IOC rev %d.%d\n",
 		ioc->name, ((ioc->rev >> 4) & 0xF), (ioc->rev & 0xF));
-	seq_printf(s, "IO PDIR size    : %d bytes (%d entries)\n",
-		(int) ((ioc->res_size << 3) * sizeof(u64)), /* 8 bits/byte */
-		total_pages);
-
-	seq_printf(s, "IO PDIR entries : %ld free  %ld used (%d%%)\n",
-		total_pages - ioc->used_pages, ioc->used_pages,
-		(int) (ioc->used_pages * 100 / total_pages));
-
-	seq_printf(s, "Resource bitmap : %d bytes (%d pages)\n",
-		ioc->res_size, ioc->res_size << 3);   /* 8 bits per byte */
-
-	min = max = ioc->avg_search[0];
-	for (i = 0; i < SBA_SEARCH_SAMPLE; i++) {
-		avg += ioc->avg_search[i];
-		if (ioc->avg_search[i] > max) max = ioc->avg_search[i];
-		if (ioc->avg_search[i] < min) min = ioc->avg_search[i];
-	}
-	avg /= SBA_SEARCH_SAMPLE;
-	seq_printf(s, "  Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n", min, avg, max);
-
-	seq_printf(s, "pci_map_single(): %12ld calls  %12ld pages (avg %d/1000)\n",
-		   ioc->msingle_calls, ioc->msingle_pages,
-		   (int) ((ioc->msingle_pages * 1000)/ioc->msingle_calls));
-#ifdef ALLOW_IOV_BYPASS
-	seq_printf(s, "pci_map_single(): %12ld bypasses\n", ioc->msingle_bypass);
-#endif
-
-	seq_printf(s, "pci_unmap_single: %12ld calls  %12ld pages (avg %d/1000)\n",
-		   ioc->usingle_calls, ioc->usingle_pages,
-		   (int) ((ioc->usingle_pages * 1000)/ioc->usingle_calls));
-#ifdef ALLOW_IOV_BYPASS
-	seq_printf(s, "pci_unmap_single: %12ld bypasses\n", ioc->usingle_bypass);
-#endif
+	seq_printf(s, "IOVA size       : %d MB\n", ioc->iov_size/(1024*1024));
+	seq_printf(s, "IOVA page size  : %ld kb\n", iovp_size/1024);
 
-	seq_printf(s, "pci_map_sg()    : %12ld calls  %12ld pages (avg %d/1000)\n",
-		   ioc->msg_calls, ioc->msg_pages,
-		   (int) ((ioc->msg_pages * 1000)/ioc->msg_calls));
-#ifdef ALLOW_IOV_BYPASS
-	seq_printf(s, "pci_map_sg()    : %12ld bypasses\n", ioc->msg_bypass);
-#endif
+	for (i = 0; i < (ioc->res_size / sizeof(unsigned long)); ++i, ++res_ptr)
+		used += hweight64(*res_ptr);
 
-	seq_printf(s, "pci_unmap_sg()  : %12ld calls  %12ld pages (avg %d/1000)\n",
-		   ioc->usg_calls, ioc->usg_pages, (int) ((ioc->usg_pages * 1000)/ioc->usg_calls));
+	seq_printf(s, "PDIR size       : %d entries\n", ioc->res_size << 3);
+	seq_printf(s, "PDIR used       : %d entries\n", used);
 
+#ifdef PDIR_SEARCH_TIMING
+	{
+		unsigned long i = 0, avg = 0, min, max;
+		min = max = ioc->avg_search[0];
+		for (i = 0; i < SBA_SEARCH_SAMPLE; i++) {
+			avg += ioc->avg_search[i];
+			if (ioc->avg_search[i] > max) max = ioc->avg_search[i];
+			if (ioc->avg_search[i] < min) min = ioc->avg_search[i];
+		}
+		avg /= SBA_SEARCH_SAMPLE;
+		seq_printf(s, "Bitmap search   : %ld/%ld/%ld (min/avg/max CPU Cycles)\n",
+		           min, avg, max);
+	}
+#endif
+#ifndef ALLOW_IOV_BYPASS
+	 seq_printf(s, "IOVA bypass disabled\n");
+#endif
 	return 0;
 }
 
@@ -1813,39 +1738,6 @@
 	.release = seq_release
 };
 
-static int
-ioc_map_show(struct seq_file *s, void *v)
-{
-	struct ioc *ioc = v;
-	unsigned int i, *res_ptr = (unsigned int *)ioc->res_map;
-
-	for (i = 0; i < ioc->res_size / sizeof(unsigned int); ++i, ++res_ptr)
-		seq_printf(s, "%s%08x", (i & 7) ? " " : "\n   ", *res_ptr);
-	seq_printf(s, "\n");
-
-	return 0;
-}
-
-static struct seq_operations ioc_map_ops = {
-	.start = ioc_start,
-	.next  = ioc_next,
-	.stop  = ioc_stop,
-	.show  = ioc_map_show
-};
-
-static int
-ioc_map_open(struct inode *inode, struct file *file)
-{
-	return seq_open(file, &ioc_map_ops);
-}
-
-static struct file_operations ioc_map_fops = {
-	.open    = ioc_map_open,
-	.read    = seq_read,
-	.llseek  = seq_lseek,
-	.release = seq_release
-};
-
 static void __init
 ioc_proc_init(void)
 {
@@ -1858,10 +1750,6 @@
 	entry = create_proc_entry(ioc_list->name, 0, dir);
 	if (entry)
 		entry->proc_fops = &ioc_fops;
-
-	entry = create_proc_entry("bitmap", 0, dir);
-	if (entry)
-		entry->proc_fops = &ioc_map_fops;
 }
 #endif
 
@@ -1958,7 +1846,7 @@
 	}
 #endif
 
-#if SBA_PROC_FS
+#ifdef CONFIG_PROC_FS
 	ioc_proc_init();
 #endif
 	return 0;
@@ -1981,6 +1869,29 @@
 }
 
 __setup("nosbagart", nosbagart);
+
+static int __init
+sba_page_override(char *str)
+{
+	unsigned long page_size;
+
+	page_size = memparse(str, &str);
+	switch (page_size) {
+		case 4096:
+		case 8192:
+		case 16384:
+		case 65536:
+			iovp_shift = ffs(page_size) - 1;
+			break;
+		default:
+			printk("%s: unknown/unsupported iommu page size %ld\n",
+			       __FUNCTION__, page_size);
+	}
+
+	return 1;
+}
+
+__setup("sbapagesize=",sba_page_override);
 
 EXPORT_SYMBOL(sba_map_single);
 EXPORT_SYMBOL(sba_unmap_single);
diff -Nru a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
--- a/arch/ia64/ia32/sys_ia32.c	Tue Feb  3 19:45:30 2004
+++ b/arch/ia64/ia32/sys_ia32.c	Tue Feb  3 19:45:30 2004
@@ -741,7 +741,7 @@
 	    || copy_to_user(dirent->d_name, name, namlen)
 	    || put_user(0, dirent->d_name + namlen))
 		return -EFAULT;
-	((char *) dirent) += reclen;
+	dirent = (struct compat_dirent *) ((char *) dirent + reclen);
 	buf->current_dir = dirent;
 	buf->count -= reclen;
 	return 0;
diff -Nru a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
--- a/arch/ia64/kernel/acpi.c	Tue Feb  3 19:45:18 2004
+++ b/arch/ia64/kernel/acpi.c	Tue Feb  3 19:45:18 2004
@@ -32,6 +32,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -53,6 +54,7 @@
 #define PREFIX			"ACPI: "
 
 void (*pm_idle) (void);
+EXPORT_SYMBOL(pm_idle);
 void (*pm_power_off) (void);
 
 unsigned char acpi_kbd_controller_present = 1;
@@ -629,5 +631,6 @@
 			(polarity == ACPI_ACTIVE_HIGH) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
 			(trigger == ACPI_EDGE_SENSITIVE) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
 }
+EXPORT_SYMBOL(acpi_register_irq);
 
 #endif /* CONFIG_ACPI_BOOT */
diff -Nru a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
--- a/arch/ia64/kernel/efi.c	Tue Feb  3 19:45:16 2004
+++ b/arch/ia64/kernel/efi.c	Tue Feb  3 19:45:16 2004
@@ -19,6 +19,7 @@
  *	Skip non-WB memory and ignore empty memory ranges.
  */
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/types.h>
@@ -37,6 +38,7 @@
 extern efi_status_t efi_call_phys (void *, ...);
 
 struct efi efi;
+EXPORT_SYMBOL(efi);
 static efi_runtime_services_t *runtime;
 
 /*
@@ -48,6 +50,7 @@
  */
 #ifdef CONFIG_PROC_FS
 struct proc_dir_entry *efi_dir;
+EXPORT_SYMBOL(efi_dir);
 #endif
 
 static unsigned long mem_limit = ~0UL;
diff -Nru a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
--- a/arch/ia64/kernel/entry.S	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/kernel/entry.S	Tue Feb  3 19:45:17 2004
@@ -489,18 +489,35 @@
 	 * because some system calls (such as ia64_execve) directly
 	 * manipulate ar.pfs.
 	 */
-	.global ia64_strace_leave_kernel
-
 GLOBAL_ENTRY(ia64_trace_syscall)
 	PT_REGS_UNWIND_INFO(0)
-{	/*
-	 * Some versions of gas generate bad unwind info if the first instruction of a
-	 * procedure doesn't go into the first slot of a bundle.  This is a workaround.
+	/*
+	 * We need to preserve the scratch registers f6-f11 in case the system
+	 * call is sigreturn.
 	 */
-	nop.m 0
-	nop.i 0
+	adds r16=PT(F6)+16,sp
+	adds r17=PT(F7)+16,sp
+	;;
+ 	stf.spill [r16]=f6,32
+ 	stf.spill [r17]=f7,32
+	;;
+ 	stf.spill [r16]=f8,32
+ 	stf.spill [r17]=f9,32
+	;;
+ 	stf.spill [r16]=f10
+ 	stf.spill [r17]=f11
 	br.call.sptk.many rp=syscall_trace // give parent a chance to catch syscall args
-}
+	adds r16=PT(F6)+16,sp
+	adds r17=PT(F7)+16,sp
+	;;
+	ldf.fill f6=[r16],32
+	ldf.fill f7=[r17],32
+	;;
+	ldf.fill f8=[r16],32
+	ldf.fill f9=[r17],32
+	;;
+	ldf.fill f10=[r16]
+	ldf.fill f11=[r17]
 	// the syscall number may have changed, so re-load it and re-calculate the
 	// syscall entry-point:
 	adds r15=PT(R15)+16,sp			// r15 = &pt_regs.r15 (syscall #)
@@ -529,9 +546,8 @@
 .strace_save_retval:
 .mem.offset 0,0; st8.spill [r2]=r8		// store return value in slot for r8
 .mem.offset 8,0; st8.spill [r3]=r10		// clear error indication in slot for r10
-ia64_strace_leave_kernel:
 	br.call.sptk.many rp=syscall_trace // give parent a chance to catch return value
-.rety:	br.cond.sptk ia64_leave_syscall
+.ret3:	br.cond.sptk ia64_leave_syscall
 
 strace_error:
 	ld8 r3=[r2]				// load pt_regs.r8
@@ -544,6 +560,23 @@
 (p6)	mov r8=r9
 	br.cond.sptk .strace_save_retval
 END(ia64_trace_syscall)
+
+	/*
+	 * When traced and returning from sigreturn, we invoke syscall_trace but then
+	 * go straight to ia64_leave_kernel rather than ia64_leave_syscall.
+	 */
+GLOBAL_ENTRY(ia64_strace_leave_kernel)
+	PT_REGS_UNWIND_INFO(0)
+{	/*
+	 * Some versions of gas generate bad unwind info if the first instruction of a
+	 * procedure doesn't go into the first slot of a bundle.  This is a workaround.
+	 */
+	nop.m 0
+	nop.i 0
+	br.call.sptk.many rp=syscall_trace // give parent a chance to catch return value
+}
+.ret4:	br.cond.sptk ia64_leave_kernel
+END(ia64_strace_leave_kernel)
 
 GLOBAL_ENTRY(ia64_ret_from_clone)
 	PT_REGS_UNWIND_INFO(0)
diff -Nru a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c
--- a/arch/ia64/kernel/ia64_ksyms.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/kernel/ia64_ksyms.c	Tue Feb  3 19:45:17 2004
@@ -1,15 +1,18 @@
 /*
  * Architecture-specific kernel symbols
+ *
+ * Don't put any exports here unless it's defined in an assembler file.
+ * All other exports should be put directly after the definition.
  */
 
 #include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/string.h>
-EXPORT_SYMBOL_NOVERS(memset);			/* gcc generates direct calls to memset()... */
+EXPORT_SYMBOL(memset);
 EXPORT_SYMBOL(memchr);
 EXPORT_SYMBOL(memcmp);
-EXPORT_SYMBOL_NOVERS(memcpy);
+EXPORT_SYMBOL(memcpy);
 EXPORT_SYMBOL(memmove);
 EXPORT_SYMBOL(memscan);
 EXPORT_SYMBOL(strcat);
@@ -25,77 +28,28 @@
 EXPORT_SYMBOL(strstr);
 EXPORT_SYMBOL(strpbrk);
 
-#include <linux/irq.h>
-EXPORT_SYMBOL(isa_irq_to_vector_map);
-EXPORT_SYMBOL(enable_irq);
-EXPORT_SYMBOL(disable_irq);
-EXPORT_SYMBOL(disable_irq_nosync);
-
-#include <linux/interrupt.h>
-EXPORT_SYMBOL(probe_irq_mask);
-
 #include <asm/checksum.h>
 EXPORT_SYMBOL(ip_fast_csum);		/* hand-coded assembly */
 
-#include <asm/io.h>
-EXPORT_SYMBOL(__ia64_memcpy_fromio);
-EXPORT_SYMBOL(__ia64_memcpy_toio);
-EXPORT_SYMBOL(__ia64_memset_c_io);
-EXPORT_SYMBOL(io_space);
-
 #include <asm/semaphore.h>
-EXPORT_SYMBOL_NOVERS(__down);
-EXPORT_SYMBOL_NOVERS(__down_interruptible);
-EXPORT_SYMBOL_NOVERS(__down_trylock);
-EXPORT_SYMBOL_NOVERS(__up);
+EXPORT_SYMBOL(__down);
+EXPORT_SYMBOL(__down_interruptible);
+EXPORT_SYMBOL(__down_trylock);
+EXPORT_SYMBOL(__up);
 
 #include <asm/page.h>
 EXPORT_SYMBOL(clear_page);
 
 #ifdef CONFIG_VIRTUAL_MEM_MAP
 #include <linux/bootmem.h>
-#include <asm/pgtable.h>
-EXPORT_SYMBOL(vmalloc_end);
-EXPORT_SYMBOL(ia64_pfn_valid);
 EXPORT_SYMBOL(max_low_pfn);	/* defined by bootmem.c, but not exported by generic code */
 #endif
 
 #include <asm/processor.h>
 EXPORT_SYMBOL(per_cpu__cpu_info);
 #ifdef CONFIG_SMP
-EXPORT_SYMBOL(__per_cpu_offset);
 EXPORT_SYMBOL(per_cpu__local_per_cpu_offset);
 #endif
-EXPORT_SYMBOL(kernel_thread);
-
-#include <asm/system.h>
-#ifdef CONFIG_IA64_DEBUG_IRQ
-EXPORT_SYMBOL(last_cli_ip);
-#endif
-
-#include <asm/tlbflush.h>
-
-EXPORT_SYMBOL(flush_tlb_range);
-
-#ifdef CONFIG_SMP
-
-EXPORT_SYMBOL(smp_flush_tlb_all);
-
-#include <asm/current.h>
-#include <asm/hardirq.h>
-EXPORT_SYMBOL(synchronize_irq);
-
-#include <asm/smp.h>
-EXPORT_SYMBOL(smp_call_function);
-EXPORT_SYMBOL(smp_call_function_single);
-EXPORT_SYMBOL(cpu_online_map);
-EXPORT_SYMBOL(phys_cpu_present_map);
-EXPORT_SYMBOL(ia64_cpu_to_sapicid);
-#else /* !CONFIG_SMP */
-
-EXPORT_SYMBOL(local_flush_tlb_all);
-
-#endif /* !CONFIG_SMP */
 
 #include <asm/uaccess.h>
 EXPORT_SYMBOL(__copy_user);
@@ -117,14 +71,14 @@
 extern void __moddi3(void);
 extern void __umoddi3(void);
 
-EXPORT_SYMBOL_NOVERS(__divsi3);
-EXPORT_SYMBOL_NOVERS(__udivsi3);
-EXPORT_SYMBOL_NOVERS(__modsi3);
-EXPORT_SYMBOL_NOVERS(__umodsi3);
-EXPORT_SYMBOL_NOVERS(__divdi3);
-EXPORT_SYMBOL_NOVERS(__udivdi3);
-EXPORT_SYMBOL_NOVERS(__moddi3);
-EXPORT_SYMBOL_NOVERS(__umoddi3);
+EXPORT_SYMBOL(__divsi3);
+EXPORT_SYMBOL(__udivsi3);
+EXPORT_SYMBOL(__modsi3);
+EXPORT_SYMBOL(__umodsi3);
+EXPORT_SYMBOL(__divdi3);
+EXPORT_SYMBOL(__udivdi3);
+EXPORT_SYMBOL(__moddi3);
+EXPORT_SYMBOL(__umoddi3);
 
 #if defined(CONFIG_MD_RAID5) || defined(CONFIG_MD_RAID5_MODULE)
 extern void xor_ia64_2(void);
@@ -132,15 +86,12 @@
 extern void xor_ia64_4(void);
 extern void xor_ia64_5(void);
 
-EXPORT_SYMBOL_NOVERS(xor_ia64_2);
-EXPORT_SYMBOL_NOVERS(xor_ia64_3);
-EXPORT_SYMBOL_NOVERS(xor_ia64_4);
-EXPORT_SYMBOL_NOVERS(xor_ia64_5);
+EXPORT_SYMBOL(xor_ia64_2);
+EXPORT_SYMBOL(xor_ia64_3);
+EXPORT_SYMBOL(xor_ia64_4);
+EXPORT_SYMBOL(xor_ia64_5);
 #endif
 
-extern unsigned long ia64_iobase;
-EXPORT_SYMBOL(ia64_iobase);
-
 #include <asm/pal.h>
 EXPORT_SYMBOL(ia64_pal_call_phys_stacked);
 EXPORT_SYMBOL(ia64_pal_call_phys_static);
@@ -149,64 +100,25 @@
 EXPORT_SYMBOL(ia64_load_scratch_fpregs);
 EXPORT_SYMBOL(ia64_save_scratch_fpregs);
 
-extern struct efi efi;
-EXPORT_SYMBOL(efi);
-
-#include <linux/proc_fs.h>
-extern struct proc_dir_entry *efi_dir;
-EXPORT_SYMBOL(efi_dir);
-
-#include <asm/machvec.h>
-#ifdef CONFIG_IA64_GENERIC
-EXPORT_SYMBOL(ia64_mv);
-#endif
-EXPORT_SYMBOL(machvec_noop);
-EXPORT_SYMBOL(machvec_memory_fence);
-EXPORT_SYMBOL(zero_page_memmap_ptr);
-#ifdef CONFIG_PERFMON
-#include <asm/perfmon.h>
-EXPORT_SYMBOL(pfm_register_buffer_fmt);
-EXPORT_SYMBOL(pfm_unregister_buffer_fmt);
-EXPORT_SYMBOL(pfm_mod_fast_read_pmds);
-EXPORT_SYMBOL(pfm_mod_read_pmds);
-EXPORT_SYMBOL(pfm_mod_write_pmcs);
-#endif
-
-#ifdef CONFIG_NUMA
-#include <asm/numa.h>
-EXPORT_SYMBOL(cpu_to_node_map);
-#endif
-
 #include <asm/unwind.h>
-EXPORT_SYMBOL(unw_init_from_blocked_task);
 EXPORT_SYMBOL(unw_init_running);
-EXPORT_SYMBOL(unw_unwind);
-EXPORT_SYMBOL(unw_unwind_to_user);
-EXPORT_SYMBOL(unw_access_gr);
-EXPORT_SYMBOL(unw_access_br);
-EXPORT_SYMBOL(unw_access_fr);
-EXPORT_SYMBOL(unw_access_ar);
-EXPORT_SYMBOL(unw_access_pr);
 
-#ifdef CONFIG_SMP
-# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
+#ifdef ASM_SUPPORTED
+# ifdef CONFIG_SMP
+#  if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
 /*
  * This is not a normal routine and we don't want a function descriptor for it, so we use
  * a fake declaration here.
  */
 extern char ia64_spinlock_contention_pre3_4;
 EXPORT_SYMBOL(ia64_spinlock_contention_pre3_4);
-# else
+#  else
 /*
  * This is not a normal routine and we don't want a function descriptor for it, so we use
  * a fake declaration here.
  */
 extern char ia64_spinlock_contention;
 EXPORT_SYMBOL(ia64_spinlock_contention);
+#  endif
 # endif
 #endif
-
-EXPORT_SYMBOL(ia64_max_iommu_merge_mask);
-
-#include <linux/pm.h>
-EXPORT_SYMBOL(pm_idle);
diff -Nru a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c
--- a/arch/ia64/kernel/irq.c	Tue Feb  3 19:45:42 2004
+++ b/arch/ia64/kernel/irq.c	Tue Feb  3 19:45:42 2004
@@ -226,6 +226,7 @@
 	while (irq_descp(irq)->status & IRQ_INPROGRESS)
 		cpu_relax();
 }
+EXPORT_SYMBOL(synchronize_irq);
 #endif
 
 /*
@@ -367,6 +368,7 @@
 	}
 	spin_unlock_irqrestore(&desc->lock, flags);
 }
+EXPORT_SYMBOL(disable_irq_nosync);
 
 /**
  *	disable_irq - disable an irq and wait for completion
@@ -389,6 +391,7 @@
 	if (desc->action)
 		synchronize_irq(irq);
 }
+EXPORT_SYMBOL(disable_irq);
 
 /**
  *	enable_irq - enable handling of an irq
@@ -427,6 +430,7 @@
 	}
 	spin_unlock_irqrestore(&desc->lock, flags);
 }
+EXPORT_SYMBOL(enable_irq);
 
 /*
  * do_IRQ handles all normal device IRQ's (the special
@@ -795,6 +799,7 @@
 
 	return mask & val;
 }
+EXPORT_SYMBOL(probe_irq_mask);
 
 /**
  *	probe_irq_off	- end an interrupt autodetect
diff -Nru a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c
--- a/arch/ia64/kernel/irq_ia64.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/kernel/irq_ia64.c	Tue Feb  3 19:45:17 2004
@@ -13,6 +13,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/module.h>
 
 #include <linux/jiffies.h>
 #include <linux/errno.h>
@@ -54,6 +55,7 @@
 	0x2f, 0x20, 0x2e, 0x2d, 0x2c, 0x2b, 0x2a, 0x29,
 	0x28, 0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0x21
 };
+EXPORT_SYMBOL(isa_irq_to_vector_map);
 
 int
 ia64_alloc_vector (void)
diff -Nru a/arch/ia64/kernel/irq_lsapic.c b/arch/ia64/kernel/irq_lsapic.c
--- a/arch/ia64/kernel/irq_lsapic.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/kernel/irq_lsapic.c	Tue Feb  3 19:45:17 2004
@@ -33,6 +33,5 @@
 	.enable =	lsapic_noop,
 	.disable =	lsapic_noop,
 	.ack =		lsapic_noop,
-	.end =		lsapic_noop,
-	.set_affinity =	(void (*)(unsigned int, unsigned long)) lsapic_noop
+	.end =		lsapic_noop
 };
diff -Nru a/arch/ia64/kernel/machvec.c b/arch/ia64/kernel/machvec.c
--- a/arch/ia64/kernel/machvec.c	Tue Feb  3 19:45:18 2004
+++ b/arch/ia64/kernel/machvec.c	Tue Feb  3 19:45:18 2004
@@ -1,4 +1,5 @@
 #include <linux/config.h>
+#include <linux/module.h>
 
 #include <asm/system.h>
 
@@ -11,6 +12,7 @@
 #include <asm/page.h>
 
 struct ia64_machine_vector ia64_mv;
+EXPORT_SYMBOL(ia64_mv);
 
 static struct ia64_machine_vector *
 lookup_machvec (const char *name)
@@ -45,9 +47,11 @@
 machvec_noop (void)
 {
 }
+EXPORT_SYMBOL(machvec_noop);
 
 void
 machvec_memory_fence (void)
 {
 	mb();
 }
+EXPORT_SYMBOL(machvec_memory_fence);
diff -Nru a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
--- a/arch/ia64/kernel/perfmon.c	Tue Feb  3 19:45:42 2004
+++ b/arch/ia64/kernel/perfmon.c	Tue Feb  3 19:45:42 2004
@@ -20,6 +20,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
@@ -1042,12 +1043,10 @@
 	int i;
 	unsigned long val, ovfl_val = pmu_conf.ovfl_val;
 
-	DPRINT(("mask=0x%lx\n", mask));
 	for (i=0; mask; i++, mask>>=1) {
 		if ((mask & 0x1) == 0) continue;
 		val = PMD_IS_COUNTING(i) ? pmds[i] & ovfl_val : pmds[i];
 		ia64_set_pmd(i, val);
-		DPRINT(("pmd[%d]=0x%lx\n", i, val));
 	}
 	ia64_srlz_d();
 }
@@ -1115,11 +1114,9 @@
 {
 	int i;
 
-	DPRINT(("mask=0x%lx\n", mask));
 	for (i=0; mask; i++, mask>>=1) {
 		if ((mask & 0x1) == 0) continue;
 		ia64_set_pmc(i, pmcs[i]);
-		DPRINT(("pmc[%d]=0x%lx\n", i, pmcs[i]));
 	}
 	ia64_srlz_d();
 }
@@ -1259,6 +1256,7 @@
 	spin_unlock(&pfm_buffer_fmt_lock);
  	return ret;
 }
+EXPORT_SYMBOL(pfm_register_buffer_fmt);
 
 int
 pfm_unregister_buffer_fmt(pfm_uuid_t uuid)
@@ -1282,6 +1280,7 @@
 	return ret;
 
 }
+EXPORT_SYMBOL(pfm_unregister_buffer_fmt);
 
 static int
 pfm_reserve_session(struct task_struct *task, int is_syswide, unsigned int cpu)
@@ -2157,6 +2156,7 @@
 
 	d_add(file->f_dentry, inode);
 	file->f_vfsmnt = mntget(pfmfs_mnt);
+	file->f_mapping = inode->i_mapping;
 
 	file->f_op    = &pfm_file_ops;
 	file->f_mode  = FMODE_READ;
@@ -3421,6 +3421,7 @@
 
 	return pfm_write_pmcs(ctx, req, nreq, regs);
 }
+EXPORT_SYMBOL(pfm_mod_write_pmcs);
 
 long
 pfm_mod_read_pmds(struct task_struct *task, pfarg_reg_t *req, unsigned int nreq, struct pt_regs *regs)
@@ -3442,6 +3443,7 @@
 
 	return pfm_read_pmds(ctx, req, nreq, regs);
 }
+EXPORT_SYMBOL(pfm_mod_read_pmds);
 
 long
 pfm_mod_fast_read_pmds(struct task_struct *task, unsigned long mask[4], unsigned long *addr, struct pt_regs *regs)
@@ -3483,6 +3485,7 @@
 	}
 	return 0;
 }
+EXPORT_SYMBOL(pfm_mod_fast_read_pmds);
 
 /*
  * Only call this function when a process it trying to
@@ -5670,7 +5673,7 @@
 
 
 	ctx = PFM_GET_CTX(task);
-	if (ctx == NULL) goto save_error;
+	if (ctx == NULL) return;
 	t = &task->thread;
 
 	/*
@@ -5685,8 +5688,6 @@
 
 		pfm_clear_psr_up();
 
-		DPRINT(("ctx zombie, forcing cleanup for [%d]\n", task->pid));
-
 		pfm_force_cleanup(ctx, regs);
 
 		BUG_ON(ctx->ctx_smpl_hdr);
@@ -5701,12 +5702,7 @@
 	 * sanity check
 	 */
 	if (ctx->ctx_last_activation != GET_ACTIVATION()) {
-		printk("ctx_activation=%lu activation=%lu state=%d: no save\n",
-				ctx->ctx_last_activation,
-				GET_ACTIVATION(), ctx->ctx_state);
-
 		pfm_unprotect_ctx_ctxsw(ctx, flags);
-
 		return;
 	}
 
@@ -5763,13 +5759,6 @@
 	 * interrupts will still be masked after this call.
 	 */
 	pfm_unprotect_ctx_ctxsw(ctx, flags);
-
-	return;
-
-save_error:
-	printk(KERN_ERR "perfmon: pfm_save_regs CPU%d [%d] NULL context PM_VALID=%ld\n",
-		smp_processor_id(), task->pid,
-		task->thread.flags & IA64_THREAD_PM_VALID);
 }
 
 #else /* !CONFIG_SMP */
@@ -5780,7 +5769,7 @@
 	u64 psr;
 
 	ctx = PFM_GET_CTX(task);
-	if (ctx == NULL) goto save_error;
+	if (ctx == NULL) return;
 
 	/*
 	 * save current PSR: needed because we modify it
@@ -5802,12 +5791,6 @@
 	 * keep a copy of psr.up (for reload)
 	 */
 	ctx->ctx_saved_psr_up = psr & IA64_PSR_UP;
-
-	return;
-save_error:
-	printk(KERN_ERR "perfmon: pfm_save_regs CPU%d [%d] NULL context PM_VALID=%ld\n",
-		smp_processor_id(), task->pid,
-		task->thread.flags & IA64_THREAD_PM_VALID);
 }
 
 static void
@@ -5824,8 +5807,6 @@
 	ctx = PFM_GET_CTX(task);
 	t   = &task->thread;
 
-	DPRINT(("on [%d] used_pmds=0x%lx\n", task->pid, ctx->ctx_used_pmds[0]));
-
 	/*
 	 * we need to mask PMU overflow here to
 	 * make sure that we maintain pmc0 until
@@ -5886,10 +5867,7 @@
 	u64 psr, psr_up;
 
 	ctx = PFM_GET_CTX(task);
-	if (unlikely(ctx == NULL)) {
-		printk(KERN_ERR "perfmon: pfm_load_regs() null context\n");
-		return;
-	}
+	if (unlikely(ctx == NULL)) return;
 
 	BUG_ON(GET_PMU_OWNER());
 
@@ -5897,10 +5875,7 @@
 	/*
 	 * possible on unload
 	 */
-	if (unlikely((t->flags & IA64_THREAD_PM_VALID) == 0)) {
-		printk("[%d] PM_VALID=0, nothing to do\n", task->pid);
-		return;
-	}
+	if (unlikely((t->flags & IA64_THREAD_PM_VALID) == 0)) return;
 
 	/*
  	 * we always come here with interrupts ALREADY disabled by
@@ -5918,8 +5893,6 @@
 
 		BUG_ON(ctx->ctx_smpl_hdr);
 
-		DPRINT(("ctx zombie, forcing cleanup for [%d]\n", task->pid));
-
 		pfm_force_cleanup(ctx, regs);
 
 		pfm_unprotect_ctx_ctxsw(ctx, flags);
@@ -5957,7 +5930,6 @@
 		pmc_mask = ctx->ctx_reload_pmcs[0];
 		pmd_mask = ctx->ctx_reload_pmds[0];
 
-		if (pmc_mask || pmd_mask) DPRINT(("partial reload [%d] pmd_mask=0x%lx pmc_mask=0x%lx\n", task->pid, pmd_mask, pmc_mask));
 	} else {
 		/*
 	 	 * To avoid leaking information to the user level when psr.sp=0,
@@ -5975,12 +5947,6 @@
 	 	 * PMC0 is never in the mask. It is always restored separately.
 	 	 */
 		pmc_mask = ctx->ctx_all_pmcs[0];
-
-		DPRINT(("full reload for [%d] activation=%lu last_activation=%lu last_cpu=%d pmd_mask=0x%lx pmc_mask=0x%lx\n",
-			task->pid,
-			GET_ACTIVATION(), ctx->ctx_last_activation,
-			GET_LAST_CPU(ctx), pmd_mask, pmc_mask));
-
 	}
 	/*
 	 * when context is MASKED, we will restore PMC with plm=0
@@ -6008,7 +5974,6 @@
 		/*
 		 * will replay the PMU interrupt
 		 */
-		DPRINT(("perfmon: resend irq for [%d]\n", task->pid));
 		hw_resend_irq(NULL, IA64_PERFMON_VECTOR);
 #endif
 		pfm_stats[smp_processor_id()].pfm_replay_ovfl_intr_count++;
@@ -6102,8 +6067,6 @@
 		return;
 	}
 
-	DPRINT(("reload for [%d] owner=%d\n", task->pid, owner ? owner->pid : -1));
-
 	/*
 	 * someone else is still using the PMU, first push it out and
 	 * then we'll be able to install our stuff !
@@ -6150,7 +6113,6 @@
 		/*
 		 * will replay the PMU interrupt
 		 */
-		DPRINT(("perfmon: resend irq for [%d]\n", task->pid));
 		hw_resend_irq(NULL, IA64_PERFMON_VECTOR);
 #endif
 		pfm_stats[smp_processor_id()].pfm_replay_ovfl_intr_count++;
diff -Nru a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
--- a/arch/ia64/kernel/process.c	Tue Feb  3 19:45:18 2004
+++ b/arch/ia64/kernel/process.c	Tue Feb  3 19:45:18 2004
@@ -598,6 +598,7 @@
 	}
 	return tid;
 }
+EXPORT_SYMBOL(kernel_thread);
 
 /*
  * Flush thread state.  This is called when a thread does an execve().
diff -Nru a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
--- a/arch/ia64/kernel/setup.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/kernel/setup.c	Tue Feb  3 19:45:17 2004
@@ -17,6 +17,7 @@
  * 06/24/99 W.Drummond	added boot_cpu_data.
  */
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/init.h>
 
 #include <linux/acpi.h>
@@ -54,12 +55,9 @@
 # error "struct cpuinfo_ia64 too big!"
 #endif
 
-#ifdef CONFIG_EFI
-int efi_enabled = 1;
-#endif
-
 #ifdef CONFIG_SMP
 unsigned long __per_cpu_offset[NR_CPUS];
+EXPORT_SYMBOL(__per_cpu_offset);
 #endif
 
 DEFINE_PER_CPU(struct cpuinfo_ia64, cpu_info);
@@ -71,7 +69,9 @@
 
 unsigned long ia64_max_cacheline_size;
 unsigned long ia64_iobase;	/* virtual address for I/O accesses */
+EXPORT_SYMBOL(ia64_iobase);
 struct io_space io_space[MAX_IO_SPACES];
+EXPORT_SYMBOL(io_space);
 unsigned int num_io_spaces;
 
 unsigned char aux_device_present = 0xaa;        /* XXX remove this when legacy I/O is gone */
@@ -86,6 +86,7 @@
  * page-size of 2^64.
  */
 unsigned long ia64_max_iommu_merge_mask = ~0UL;
+EXPORT_SYMBOL(ia64_max_iommu_merge_mask);
 
 #define COMMAND_LINE_SIZE	512
 
@@ -317,13 +318,13 @@
 #ifdef CONFIG_ACPI_BOOT
 	acpi_boot_init();
 #endif
+#ifdef CONFIG_SERIAL_8250_CONSOLE
 #ifdef CONFIG_SERIAL_8250_HCDP
 	if (efi.hcdp) {
 		void setup_serial_hcdp(void *);
 		setup_serial_hcdp(efi.hcdp);
 	}
 #endif
-#ifdef CONFIG_SERIAL_8250_CONSOLE
 	/*
 	 * Without HCDP, we won't discover any serial ports until the serial driver looks
 	 * in the ACPI namespace.  If ACPI claims there are some legacy devices, register
@@ -520,8 +521,6 @@
 		impl_va_msb = vm2.pal_vm_info_2_s.impl_va_msb;
 		phys_addr_size = vm1.pal_vm_info_1_s.phys_add_size;
 	}
-	printk(KERN_INFO "CPU %d: %lu virtual and %lu physical address bits\n",
-	       smp_processor_id(), impl_va_msb + 1, phys_addr_size);
 	c->unimpl_va_mask = ~((7L<<61) | ((1L << (impl_va_msb + 1)) - 1));
 	c->unimpl_pa_mask = ~((1L<<63) | ((1L << phys_addr_size) - 1));
 }
diff -Nru a/arch/ia64/kernel/smp.c b/arch/ia64/kernel/smp.c
--- a/arch/ia64/kernel/smp.c	Tue Feb  3 19:45:43 2004
+++ b/arch/ia64/kernel/smp.c	Tue Feb  3 19:45:43 2004
@@ -22,6 +22,7 @@
 
 #include <linux/config.h>
 
+#include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/init.h>
@@ -210,6 +211,7 @@
 {
 	on_each_cpu((void (*)(void *))local_flush_tlb_all, 0, 1, 1);
 }
+EXPORT_SYMBOL(smp_flush_tlb_all);
 
 void
 smp_flush_tlb_mm (struct mm_struct *mm)
@@ -283,6 +285,7 @@
 	put_cpu();
 	return 0;
 }
+EXPORT_SYMBOL(smp_call_function_single);
 
 /*
  * this function sends a 'generic call function' IPI to all other CPUs
@@ -337,6 +340,7 @@
 	spin_unlock(&call_lock);
 	return 0;
 }
+EXPORT_SYMBOL(smp_call_function);
 
 void
 smp_do_timer (struct pt_regs *regs)
diff -Nru a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
--- a/arch/ia64/kernel/smpboot.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/kernel/smpboot.c	Tue Feb  3 19:45:17 2004
@@ -16,6 +16,7 @@
 
 #include <linux/config.h>
 
+#include <linux/module.h>
 #include <linux/acpi.h>
 #include <linux/bootmem.h>
 #include <linux/delay.h>
@@ -81,10 +82,13 @@
 
 /* Bitmask of currently online CPUs */
 cpumask_t cpu_online_map;
+EXPORT_SYMBOL(cpu_online_map);
 cpumask_t phys_cpu_present_map;
+EXPORT_SYMBOL(phys_cpu_present_map);
 
 /* which logical CPU number maps to which CPU (physical APIC ID) */
 volatile int ia64_cpu_to_sapicid[NR_CPUS];
+EXPORT_SYMBOL(ia64_cpu_to_sapicid);
 
 static volatile cpumask_t cpu_callin_map;
 
@@ -401,10 +405,7 @@
 	}
 	Dprintk("\n");
 
-	if (cpu_isset(cpu, cpu_callin_map)) {
-		/* number CPUs logically, starting from 1 (BSP is 0) */
-		printk(KERN_INFO "CPU%d: CPU has booted.\n", cpu);
-	} else {
+	if (!cpu_isset(cpu, cpu_callin_map)) {
 		printk(KERN_ERR "Processor 0x%x/0x%x is stuck.\n", cpu, sapicid);
 		ia64_cpu_to_sapicid[cpu] = -1;
 		cpu_clear(cpu, cpu_online_map);  /* was set in smp_callin() */
@@ -466,9 +467,10 @@
 #ifdef CONFIG_NUMA
 
 /* on which node is each logical CPU (one cacheline even for 64 CPUs) */
-volatile u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
+u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
+EXPORT_SYMBOL(cpu_to_node_map);
 /* which logical CPUs are on which nodes */
-volatile cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
+cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
 
 /*
  * Build cpu to node mapping and initialize the per node cpu masks.
@@ -564,8 +566,8 @@
 		if (cpu_online(cpu))
 			bogosum += cpu_data(cpu)->loops_per_jiffy;
 
-	printk(KERN_INFO "Total of %lu processors activated (%lu.%02lu BogoMIPS).\n",
-	       num_online_cpus(), bogosum/(500000/HZ), (bogosum/(5000/HZ))%100);
+	printk(KERN_INFO "Total of %d processors activated (%lu.%02lu BogoMIPS).\n",
+	       (int)num_online_cpus(), bogosum/(500000/HZ), (bogosum/(5000/HZ))%100);
 }
 
 int __devinit
@@ -578,14 +580,11 @@
 	if (sapicid == -1)
 		return -EINVAL;
 
-	printk(KERN_INFO "Processor %d/%d is spinning up...\n", sapicid, cpu);
-
 	/* Processor goes to start_secondary(), sets online flag */
 	ret = do_boot_cpu(sapicid, cpu);
 	if (ret < 0)
 		return ret;
 
-	printk(KERN_INFO "Processor %d has spun up...\n", cpu);
 	return 0;
 }
 
diff -Nru a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
--- a/arch/ia64/kernel/time.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/kernel/time.c	Tue Feb  3 19:45:17 2004
@@ -21,6 +21,7 @@
 #include <linux/profile.h>
 #include <linux/timex.h>
 
+#include <asm/machvec.h>
 #include <asm/delay.h>
 #include <asm/hw_irq.h>
 #include <asm/ptrace.h>
@@ -39,6 +40,7 @@
 #ifdef CONFIG_IA64_DEBUG_IRQ
 
 unsigned long last_cli_ip;
+EXPORT_SYMBOL(last_cli_ip);
 
 #endif
 
@@ -241,6 +243,8 @@
 timer_interrupt (int irq, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long new_itm;
+
+	platform_timer_interrupt(irq, dev_id, regs);
 
 	new_itm = local_cpu_data->itm_next;
 
diff -Nru a/arch/ia64/kernel/unaligned.c b/arch/ia64/kernel/unaligned.c
--- a/arch/ia64/kernel/unaligned.c	Tue Feb  3 19:45:42 2004
+++ b/arch/ia64/kernel/unaligned.c	Tue Feb  3 19:45:42 2004
@@ -1,7 +1,7 @@
 /*
  * Architecture-specific unaligned trap handling.
  *
- * Copyright (C) 1999-2002 Hewlett-Packard Co
+ * Copyright (C) 1999-2002, 2004 Hewlett-Packard Co
  *	Stephane Eranian <eranian@hpl.hp.com>
  *	David Mosberger-Tang <davidm@hpl.hp.com>
  *
@@ -1328,7 +1328,7 @@
 	 * handler into reading an arbitrary kernel addresses...
 	 */
 	if (!user_mode(regs))
-		eh = SEARCH_EXCEPTION_TABLE(regs);
+		eh = search_exception_tables(regs->cr_iip + ia64_psr(regs)->ri);
 	if (user_mode(regs) || eh) {
 		if ((current->thread.flags & IA64_THREAD_UAC_SIGBUS) != 0)
 			goto force_sigbus;
diff -Nru a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c
--- a/arch/ia64/kernel/unwind.c	Tue Feb  3 19:45:43 2004
+++ b/arch/ia64/kernel/unwind.c	Tue Feb  3 19:45:43 2004
@@ -26,6 +26,7 @@
  *	o if both the unw.lock spinlock and a script's read-write lock must be
  *	  acquired, then the read-write lock must be acquired first.
  */
+#include <linux/module.h>
 #include <linux/bootmem.h>
 #include <linux/elf.h>
 #include <linux/kernel.h>
@@ -392,6 +393,7 @@
 	}
 	return 0;
 }
+EXPORT_SYMBOL(unw_access_gr);
 
 int
 unw_access_br (struct unw_frame_info *info, int regnum, unsigned long *val, int write)
@@ -423,6 +425,7 @@
 		*val = *addr;
 	return 0;
 }
+EXPORT_SYMBOL(unw_access_br);
 
 int
 unw_access_fr (struct unw_frame_info *info, int regnum, struct ia64_fpreg *val, int write)
@@ -467,6 +470,7 @@
 		*val = *addr;
 	return 0;
 }
+EXPORT_SYMBOL(unw_access_fr);
 
 int
 unw_access_ar (struct unw_frame_info *info, int regnum, unsigned long *val, int write)
@@ -559,6 +563,7 @@
 		*val = *addr;
 	return 0;
 }
+EXPORT_SYMBOL(unw_access_ar);
 
 int
 unw_access_pr (struct unw_frame_info *info, unsigned long *val, int write)
@@ -575,6 +580,7 @@
 		*val = *addr;
 	return 0;
 }
+EXPORT_SYMBOL(unw_access_pr);
 
 
 /* Routines to manipulate the state stack.  */
@@ -1897,6 +1903,7 @@
 	STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags));
 	return retval;
 }
+EXPORT_SYMBOL(unw_unwind);
 
 int
 unw_unwind_to_user (struct unw_frame_info *info)
@@ -1917,6 +1924,7 @@
 	UNW_DPRINT(0, "unwind.%s: failed to unwind to user-level (ip=0x%lx)\n", __FUNCTION__, ip);
 	return -1;
 }
+EXPORT_SYMBOL(unw_unwind_to_user);
 
 static void
 init_frame_info (struct unw_frame_info *info, struct task_struct *t,
@@ -2014,6 +2022,7 @@
 	UNW_DPRINT(1, "unwind.%s\n", __FUNCTION__);
 	unw_init_frame_info(info, t, sw);
 }
+EXPORT_SYMBOL(unw_init_from_blocked_task);
 
 static void
 init_unwind_table (struct unw_table *table, const char *name, unsigned long segment_base,
diff -Nru a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile
--- a/arch/ia64/lib/Makefile	Tue Feb  3 19:45:42 2004
+++ b/arch/ia64/lib/Makefile	Tue Feb  3 19:45:42 2004
@@ -2,11 +2,13 @@
 # Makefile for ia64-specific library routines..
 #
 
+obj-y := io.o
+
 lib-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o			\
 	__divdi3.o __udivdi3.o __moddi3.o __umoddi3.o			\
 	checksum.o clear_page.o csum_partial_copy.o copy_page.o		\
 	clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o	\
-	flush.o io.o ip_fast_csum.o do_csum.o				\
+	flush.o ip_fast_csum.o do_csum.o				\
 	memset.o strlen.o swiotlb.o
 
 lib-$(CONFIG_ITANIUM)	+= copy_page.o copy_user.o memcpy.o
diff -Nru a/arch/ia64/lib/io.c b/arch/ia64/lib/io.c
--- a/arch/ia64/lib/io.c	Tue Feb  3 19:45:16 2004
+++ b/arch/ia64/lib/io.c	Tue Feb  3 19:45:16 2004
@@ -1,4 +1,5 @@
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/types.h>
 
 #include <asm/io.h>
@@ -17,6 +18,7 @@
 		from++;
 	}
 }
+EXPORT_SYMBOL(__ia64_memcpy_fromio);
 
 /*
  * Copy data from "real" memory space to IO memory space.
@@ -32,6 +34,7 @@
 		to++;
 	}
 }
+EXPORT_SYMBOL(__ia64_memcpy_toio);
 
 /*
  * "memset" on IO memory space.
@@ -48,6 +51,7 @@
 		dst++;
 	}
 }
+EXPORT_SYMBOL(__ia64_memset_c_io);
 
 #ifdef CONFIG_IA64_GENERIC
 
diff -Nru a/arch/ia64/lib/memcpy_mck.S b/arch/ia64/lib/memcpy_mck.S
--- a/arch/ia64/lib/memcpy_mck.S	Tue Feb  3 19:45:18 2004
+++ b/arch/ia64/lib/memcpy_mck.S	Tue Feb  3 19:45:18 2004
@@ -155,7 +155,7 @@
 	mov	ar.ec=2
 (p10)	br.dpnt.few .aligned_src_tail
 	;;
-//	.align 32
+	TEXT_ALIGN(32)
 1:
 EX(.ex_handler, (p16)	ld8	r34=[src0],16)
 EK(.ex_handler, (p16)	ld8	r38=[src1],16)
@@ -312,7 +312,7 @@
 (p7)	mov	ar.lc = r21
 (p8)	mov	ar.lc = r0
 	;;
-//	.align 32
+	TEXT_ALIGN(32)
 1:	lfetch.fault	  [src_pre_mem], 128
 	lfetch.fault.excl [dst_pre_mem], 128
 	br.cloop.dptk.few 1b
@@ -518,7 +518,7 @@
 		 shrp	r21=r22,r38,shift;	/* speculative work */			\
 		 br.sptk.few .unaligned_src_tail /* branch out of jump table */		\
 		 ;;
-//	.align 32
+	TEXT_ALIGN(32)
 .jump_table:
 	COPYU(8)	// unaligned cases
 .jmp1:
diff -Nru a/arch/ia64/lib/memset.S b/arch/ia64/lib/memset.S
--- a/arch/ia64/lib/memset.S	Tue Feb  3 19:45:18 2004
+++ b/arch/ia64/lib/memset.S	Tue Feb  3 19:45:18 2004
@@ -125,7 +125,7 @@
 (p_zr)	br.cond.dptk.many .l1b			// Jump to use stf.spill
 ;; }
 
-//	.align 32 // -------------------------- //  L1A: store ahead into cache lines; fill later
+	TEXT_ALIGN(32) // --------------------- //  L1A: store ahead into cache lines; fill later
 { .mmi
 	and	tmp = -(LINE_SIZE), cnt		// compute end of range
 	mov	ptr9 = ptr1			// used for prefetching
@@ -194,7 +194,7 @@
 	br.cond.dpnt.many  .move_bytes_from_alignment	// Branch no. 3
 ;; }
 
-//	.align 32
+	TEXT_ALIGN(32)
 .l1b:	// ------------------------------------ //  L1B: store ahead into cache lines; fill later
 { .mmi
 	and	tmp = -(LINE_SIZE), cnt		// compute end of range
@@ -261,7 +261,7 @@
 	and	cnt = 0x1f, cnt			// compute the remaining cnt
 	mov.i   ar.lc = loopcnt
 ;; }
-//	.align 32
+	TEXT_ALIGN(32)
 .l2:	// ------------------------------------ //  L2A:  store 32B in 2 cycles
 { .mmb
 	stf8	[ptr1] = fvalue, 8
diff -Nru a/arch/ia64/mm/extable.c b/arch/ia64/mm/extable.c
--- a/arch/ia64/mm/extable.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/mm/extable.c	Tue Feb  3 19:45:17 2004
@@ -1,7 +1,7 @@
 /*
  * Kernel exception handling table support.  Derived from arch/alpha/mm/extable.c.
  *
- * Copyright (C) 1998, 1999, 2001-2002 Hewlett-Packard Co
+ * Copyright (C) 1998, 1999, 2001-2002, 2004 Hewlett-Packard Co
  *	David Mosberger-Tang <davidm@hpl.hp.com>
  */
 
@@ -9,6 +9,53 @@
 
 #include <asm/uaccess.h>
 #include <asm/module.h>
+
+static inline int
+compare_entries (struct exception_table_entry *l, struct exception_table_entry *r)
+{
+	u64 lip = (u64) &l->addr + l->addr;
+	u64 rip = (u64) &r->addr + r->addr;
+
+	if (lip < rip)
+		return -1;
+	if (lip == rip)
+		return 0;
+	else
+		return 1;
+}
+
+static inline void
+swap_entries (struct exception_table_entry *l, struct exception_table_entry *r)
+{
+	u64 delta = (u64) r - (u64) l;
+	struct exception_table_entry tmp;
+
+	tmp = *l;
+	l->addr = r->addr + delta;
+	l->cont = r->cont + delta;
+	r->addr = tmp.addr - delta;
+	r->cont = tmp.cont - delta;
+}
+
+/*
+ * Sort the exception table.  It's usually already sorted, but there may be unordered
+ * entries due to multiple text sections (such as the .init text section).  Note that the
+ * exception-table-entries contain location-relative addresses, which requires a bit of
+ * care during sorting to avoid overflows in the offset members (e.g., it would not be
+ * safe to make a temporary copy of an exception-table entry on the stack, because the
+ * stack may be more than 2GB away from the exception-table).
+ */
+void
+sort_extable (struct exception_table_entry *start, struct exception_table_entry *finish)
+{
+	struct exception_table_entry *p, *q;
+
+ 	/* insertion sort */
+	for (p = start + 1; p < finish; ++p)
+		/* start .. p-1 is sorted; push p down to it's proper place */
+		for (q = p; q > start && compare_entries(&q[0], &q[-1]) < 0; --q)
+			swap_entries(&q[0], &q[-1]);
+}
 
 const struct exception_table_entry *
 search_extable (const struct exception_table_entry *first,
diff -Nru a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c
--- a/arch/ia64/mm/fault.c	Tue Feb  3 19:45:42 2004
+++ b/arch/ia64/mm/fault.c	Tue Feb  3 19:45:42 2004
@@ -58,7 +58,7 @@
 	if (pgd_none(*pgd) || pgd_bad(*pgd))
 		return 0;
 
-	pmd = pmd_offset(pgd,address);
+	pmd = pmd_offset(pgd, address);
 	if (pmd_none(*pmd) || pmd_bad(*pmd))
 		return 0;
 
diff -Nru a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
--- a/arch/ia64/mm/init.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/mm/init.c	Tue Feb  3 19:45:17 2004
@@ -43,15 +43,16 @@
 unsigned long MAX_DMA_ADDRESS = PAGE_OFFSET + 0x100000000UL;
 
 #ifdef CONFIG_VIRTUAL_MEM_MAP
-  unsigned long vmalloc_end = VMALLOC_END_INIT;
-  struct page *vmem_map;
-
-  EXPORT_SYMBOL(vmem_map);
+unsigned long vmalloc_end = VMALLOC_END_INIT;
+EXPORT_SYMBOL(vmalloc_end);
+struct page *vmem_map;
+EXPORT_SYMBOL(vmem_map);
 #endif
 
 static int pgt_cache_water[2] = { 25, 50 };
 
 struct page *zero_page_memmap_ptr;		/* map entry for zero page */
+EXPORT_SYMBOL(zero_page_memmap_ptr);
 
 void
 check_pgt_cache (void)
@@ -457,6 +458,7 @@
 
 	return __get_user(byte, (char *) pfn_to_page(pfn)) == 0;
 }
+EXPORT_SYMBOL(ia64_pfn_valid);
 
 int
 find_largest_hole (u64 start, u64 end, void *arg)
diff -Nru a/arch/ia64/mm/numa.c b/arch/ia64/mm/numa.c
--- a/arch/ia64/mm/numa.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/mm/numa.c	Tue Feb  3 19:45:17 2004
@@ -18,6 +18,7 @@
 #include <linux/node.h>
 #include <linux/init.h>
 #include <linux/bootmem.h>
+#include <asm/mmzone.h>
 #include <asm/numa.h>
 
 static struct memblk *sysfs_memblks;
@@ -28,7 +29,7 @@
  * The following structures are usually initialized by ACPI or
  * similar mechanisms and describe the NUMA characteristics of the machine.
  */
-int num_memblks = 0;
+int num_memblks;
 struct node_memblk_s node_memblk[NR_MEMBLKS];
 struct node_cpuid_s node_cpuid[NR_CPUS];
 /*
diff -Nru a/arch/ia64/mm/tlb.c b/arch/ia64/mm/tlb.c
--- a/arch/ia64/mm/tlb.c	Tue Feb  3 19:45:34 2004
+++ b/arch/ia64/mm/tlb.c	Tue Feb  3 19:45:34 2004
@@ -10,6 +10,7 @@
  *              IPI based ptc implementation and A-step IPI implementation.
  */
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -126,6 +127,7 @@
 	local_irq_restore(flags);
 	ia64_srlz_i();			/* srlz.i implies srlz.d */
 }
+EXPORT_SYMBOL(local_flush_tlb_all);
 
 void
 flush_tlb_range (struct vm_area_struct *vma, unsigned long start, unsigned long end)
@@ -162,6 +164,7 @@
 
 	ia64_srlz_i();			/* srlz.i implies srlz.d */
 }
+EXPORT_SYMBOL(flush_tlb_range);
 
 void __init
 ia64_tlb_init (void)
diff -Nru a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
--- a/arch/ia64/pci/pci.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/pci/pci.c	Tue Feb  3 19:45:17 2004
@@ -223,6 +223,9 @@
 
 	status = acpi_resource_to_address64(res, &addr);
 	if (ACPI_SUCCESS(status)) {
+		if (!addr.address_length)
+			return AE_OK;
+
 		if (addr.resource_type == ACPI_MEMORY_RANGE) {
 			flags = IORESOURCE_MEM;
 			root = &iomem_resource;
diff -Nru a/arch/ia64/scripts/check-text-align.S b/arch/ia64/scripts/check-text-align.S
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/ia64/scripts/check-text-align.S	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,6 @@
+	.proc foo
+	.prologue
+foo:	.save rp, r2
+	nop 0
+	.align 64
+	.endp foo
diff -Nru a/arch/ia64/scripts/unwcheck.py b/arch/ia64/scripts/unwcheck.py
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/ia64/scripts/unwcheck.py	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,64 @@
+#!/usr/bin/env python
+#
+# Usage: unwcheck.py FILE
+#
+# This script checks the unwind info of each function in file FILE
+# and verifies that the sum of the region-lengths matches the total
+# length of the function.
+#
+# Based on a shell/awk script originally written by Harish Patil,
+# which was converted to Perl by Matthew Chapman, which was converted
+# to Python by David Mosberger.
+#
+import os
+import re
+import sys
+
+if len(sys.argv) != 2:
+    print "Usage: %s FILE" % sys.argv[0]
+    sys.exit(2)
+
+readelf = os.getenv("READELF", "readelf")
+
+start_pattern = re.compile("<([^>]*)>: \[0x([0-9a-f]+)-0x([0-9a-f]+)\]")
+rlen_pattern  = re.compile(".*rlen=([0-9]+)")
+
+def check_func (func, slots, rlen_sum):
+    if slots != rlen_sum:
+        global num_errors
+        num_errors += 1
+        if not func: func = "[%#x-%#x]" % (start, end)
+        print "ERROR: %s: %lu slots, total region length = %lu" % (func, slots, rlen_sum)
+    return
+
+num_funcs = 0
+num_errors = 0
+func = False
+slots = 0
+rlen_sum = 0
+for line in os.popen("%s -u %s" % (readelf, sys.argv[1])):
+    m = start_pattern.match(line)
+    if m:
+        check_func(func, slots, rlen_sum)
+
+        func  = m.group(1)
+        start = long(m.group(2), 16)
+        end   = long(m.group(3), 16)
+        slots = 3 * (end - start) / 16
+        rlen_sum = 0L
+        num_funcs += 1
+    else:
+        m = rlen_pattern.match(line)
+        if m:
+            rlen_sum += long(m.group(1))
+check_func(func, slots, rlen_sum)
+
+if num_errors == 0:
+    print "No errors detected in %u functions." % num_funcs
+else:
+    if num_errors > 1:
+        err="errors"
+    else:
+        err="error"
+    print "%u %s detected in %u functions." % (num_errors, err, num_funcs)
+    sys.exit(1)
diff -Nru a/arch/ia64/scripts/unwcheck.sh b/arch/ia64/scripts/unwcheck.sh
--- a/arch/ia64/scripts/unwcheck.sh	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,109 +0,0 @@
-#!/bin/sh
-#   Usage: unwcheck.sh <executable_file_name>
-#   Pre-requisite: readelf [from Gnu binutils package]
-#   Purpose: Check the following invariant
-#       For each code range in the input binary:
-#          Sum[ lengths of unwind regions] = Number of slots in code range.
-#   Author : Harish Patil
-#   First version: January 2002
-#   Modified : 2/13/2002
-#   Modified : 3/15/2002: duplicate detection
-readelf -u $1 | gawk '\
- function todec(hexstr){
-    dec = 0;
-    l = length(hexstr);
-    for (i = 1; i <= l; i++)
-    {
-        c = substr(hexstr, i, 1);
-        if (c == "A")
-            dec = dec*16 + 10;
-        else if (c == "B")
-            dec = dec*16 + 11;
-        else if (c == "C")
-            dec = dec*16 + 12;
-        else if (c == "D")
-            dec = dec*16 + 13;
-        else if (c == "E")
-            dec = dec*16 + 14;
-        else if (c == "F")
-            dec = dec*16 + 15;
-        else
-            dec = dec*16 + c;
-    }
-    return dec;
- }
- BEGIN { first = 1; sum_rlen = 0; no_slots = 0; errors=0; no_code_ranges=0; }
- {
-   if (NF==5 && $3=="info")
-   {
-      no_code_ranges += 1;
-      if (first == 0)
-      {
-         if (sum_rlen != no_slots)
-         {
-            print full_code_range;
-            print "       ", "lo = ", lo, " hi =", hi;
-            print "       ", "sum_rlen = ", sum_rlen, "no_slots = " no_slots;
-            print "       ","   ", "*******ERROR ***********";
-            print "       ","   ", "sum_rlen:", sum_rlen, " != no_slots:" no_slots;
-            errors += 1;
-         }
-         sum_rlen = 0;
-      }
-      full_code_range =  $0;
-      code_range =  $2;
-      gsub("..$", "", code_range);
-      gsub("^.", "", code_range);
-      split(code_range, addr, "-");
-      lo = toupper(addr[1]);
-
-      code_range_lo[no_code_ranges] = addr[1];
-      occurs[addr[1]] += 1;
-      full_range[addr[1]] = $0;
-
-      gsub("0X.[0]*", "", lo);
-      hi = toupper(addr[2]);
-      gsub("0X.[0]*", "", hi);
-      no_slots = (todec(hi) - todec(lo))/ 16*3
-      first = 0;
-   }
-   if (index($0,"rlen") > 0 )
-   {
-    rlen_str =  substr($0, index($0,"rlen"));
-    rlen = rlen_str;
-    gsub("rlen=", "", rlen);
-    gsub(")", "", rlen);
-    sum_rlen = sum_rlen +  rlen;
-   }
-  }
-  END {
-      if (first == 0)
-      {
-         if (sum_rlen != no_slots)
-         {
-            print "code_range=", code_range;
-            print "       ", "lo = ", lo, " hi =", hi;
-            print "       ", "sum_rlen = ", sum_rlen, "no_slots = " no_slots;
-            print "       ","   ", "*******ERROR ***********";
-            print "       ","   ", "sum_rlen:", sum_rlen, " != no_slots:" no_slots;
-            errors += 1;
-         }
-      }
-    no_duplicates = 0;
-    for (i=1; i<=no_code_ranges; i++)
-    {
-        cr = code_range_lo[i];
-        if (reported_cr[cr]==1) continue;
-        if ( occurs[cr] > 1)
-        {
-            reported_cr[cr] = 1;
-            print "Code range low ", code_range_lo[i], ":", full_range[cr], " occurs: ", occurs[cr], " times.";
-            print " ";
-            no_duplicates++;
-        }
-    }
-    print "======================================"
-    print "Total errors:", errors, "/", no_code_ranges, " duplicates:", no_duplicates;
-    print "======================================"
-  }
-  '
diff -Nru a/arch/ia64/sn/Makefile b/arch/ia64/sn/Makefile
--- a/arch/ia64/sn/Makefile	Tue Feb  3 19:45:41 2004
+++ b/arch/ia64/sn/Makefile	Tue Feb  3 19:45:41 2004
@@ -9,6 +9,4 @@
 # Makefile for the sn ia64 subplatform
 #
 
-EXTRA_CFLAGS := -DLITTLE_ENDIAN
-
 obj-y += kernel/ io/
diff -Nru a/arch/ia64/sn/fakeprom/README b/arch/ia64/sn/fakeprom/README
--- a/arch/ia64/sn/fakeprom/README	Tue Feb  3 19:45:43 2004
+++ b/arch/ia64/sn/fakeprom/README	Tue Feb  3 19:45:43 2004
@@ -1,33 +1,9 @@
 /*
+ * 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) 2002-2003 Silicon Graphics, Inc.  All Rights Reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of version 2 of the GNU General Public License 
- * as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it would be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
- * 
- * Further, this software is distributed without any warranty that it is 
- * free of the rightful claim of any third person regarding infringement 
- * or the like.  Any license provided herein, whether implied or 
- * otherwise, applies only to this software file.  Patent licenses, if 
- * any, provided herein do not apply to combinations of this program with 
- * other software, or any other product whatsoever.
- * 
- * You should have received a copy of the GNU General Public 
- * License along with this program; if not, write the Free Software 
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- * 
- * Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 
- * Mountain View, CA  94043, or:
- * 
- * http://www.sgi.com 
- * 
- * For further information regarding this notice, see: 
- * 
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan
  */
 
 This directory contains the files required to build
diff -Nru a/arch/ia64/sn/fakeprom/fprom.lds b/arch/ia64/sn/fakeprom/fprom.lds
--- a/arch/ia64/sn/fakeprom/fprom.lds	Tue Feb  3 19:45:35 2004
+++ b/arch/ia64/sn/fakeprom/fprom.lds	Tue Feb  3 19:45:35 2004
@@ -1,33 +1,9 @@
 /*
+ * 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) 2002-2003 Silicon Graphics, Inc.  All Rights Reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of version 2 of the GNU General Public License 
- * as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it would be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
- * 
- * Further, this software is distributed without any warranty that it is 
- * free of the rightful claim of any third person regarding infringement 
- * or the like.  Any license provided herein, whether implied or 
- * otherwise, applies only to this software file.  Patent licenses, if 
- * any, provided herein do not apply to combinations of this program with 
- * other software, or any other product whatsoever.
- * 
- * You should have received a copy of the GNU General Public 
- * License along with this program; if not, write the Free Software 
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- * 
- * Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 
- * Mountain View, CA  94043, or:
- * 
- * http://www.sgi.com 
- * 
- * For further information regarding this notice, see: 
- * 
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan
  */
 
 OUTPUT_FORMAT("elf64-ia64-little")
diff -Nru a/arch/ia64/sn/io/Makefile b/arch/ia64/sn/io/Makefile
--- a/arch/ia64/sn/io/Makefile	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/sn/io/Makefile	Tue Feb  3 19:45:17 2004
@@ -9,7 +9,5 @@
 # Makefile for the sn io routines.
 #
 
-EXTRA_CFLAGS    := -DLITTLE_ENDIAN
-
-obj-y += sgi_if.o xswitch.o sgi_io_sim.o cdl.o \
+obj-y += xswitch.o cdl.o snia_if.o \
 	 io.o machvec/ drivers/ platform_init/ sn2/ hwgfs/
diff -Nru a/arch/ia64/sn/io/cdl.c b/arch/ia64/sn/io/cdl.c
--- a/arch/ia64/sn/io/cdl.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/sn/io/cdl.c	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -11,18 +10,15 @@
 #include <linux/types.h>
 #include <asm/sn/sgi.h>
 #include <asm/io.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
-#include <asm/sn/pci/bridge.h>
+#include <asm/sn/pci/pic.h>
 #include "asm/sn/ioerror_handling.h"
 #include <asm/sn/xtalk/xbow.h>
 
 /* these get called directly in cdl_add_connpt in fops bypass hack */
-extern int pcibr_attach(vertex_hdl_t);
 extern int xbow_attach(vertex_hdl_t);
 extern int pic_attach(vertex_hdl_t);
 
-
 /*
  *    cdl: Connection and Driver List
  *
@@ -32,14 +28,12 @@
  *	IO Infrastructure Drivers e.g. pcibr.
  */
 
-#define MAX_SGI_IO_INFRA_DRVR 7
+#define MAX_SGI_IO_INFRA_DRVR 5
 
 static struct cdl sgi_infrastructure_drivers[MAX_SGI_IO_INFRA_DRVR] =
 {
-	{ XBRIDGE_WIDGET_PART_NUM, XBRIDGE_WIDGET_MFGR_NUM, pcibr_attach /* &pcibr_fops  */},
-	{ BRIDGE_WIDGET_PART_NUM,  BRIDGE_WIDGET_MFGR_NUM,  pcibr_attach /* &pcibr_fops */},
-	{ PIC_WIDGET_PART_NUM_BUS0,  PIC_WIDGET_MFGR_NUM,   pic_attach /* &pic_fops */},
-	{ PIC_WIDGET_PART_NUM_BUS1,  PIC_WIDGET_MFGR_NUM,   pic_attach /* &pic_fops */},
+	{ PIC_WIDGET_PART_NUM_BUS0,  PIC_WIDGET_MFGR_NUM,   pic_attach /* &pcibr_fops */},
+	{ PIC_WIDGET_PART_NUM_BUS1,  PIC_WIDGET_MFGR_NUM,   pic_attach /* &pcibr_fops */},
 	{ XXBOW_WIDGET_PART_NUM,   XXBOW_WIDGET_MFGR_NUM,   xbow_attach /* &xbow_fops */},
 	{ XBOW_WIDGET_PART_NUM,    XBOW_WIDGET_MFGR_NUM,    xbow_attach /* &xbow_fops */},
 	{ PXBOW_WIDGET_PART_NUM,   XXBOW_WIDGET_MFGR_NUM,   xbow_attach /* &xbow_fops */},
diff -Nru a/arch/ia64/sn/io/drivers/Makefile b/arch/ia64/sn/io/drivers/Makefile
--- a/arch/ia64/sn/io/drivers/Makefile	Tue Feb  3 19:45:41 2004
+++ b/arch/ia64/sn/io/drivers/Makefile	Tue Feb  3 19:45:41 2004
@@ -7,6 +7,4 @@
 #
 # Makefile for the sn2 io routines.
 
-EXTRA_CFLAGS    := -DLITTLE_ENDIAN
-
 obj-y				+= ioconfig_bus.o
diff -Nru a/arch/ia64/sn/io/drivers/ioconfig_bus.c b/arch/ia64/sn/io/drivers/ioconfig_bus.c
--- a/arch/ia64/sn/io/drivers/ioconfig_bus.c	Tue Feb  3 19:45:30 2004
+++ b/arch/ia64/sn/io/drivers/ioconfig_bus.c	Tue Feb  3 19:45:30 2004
@@ -19,7 +19,6 @@
 #include <asm/sn/sgi.h>
 #include <asm/io.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
 #include <asm/sn/sn_sal.h>
@@ -34,6 +33,7 @@
  */
 static vertex_hdl_t ioconfig_bus_handle;
 static unsigned long ioconfig_bus_debug;
+static struct ioconfig_parm parm;
 
 #ifdef IOCONFIG_BUS_DEBUG
 #define DBG(x...)	printk(x)
@@ -41,8 +41,6 @@
 #define DBG(x...)
 #endif
 
-static u64 ioconfig_file;
-static u64 ioconfig_file_size;
 static u64 ioconfig_activated;
 static char ioconfig_kernopts[128];
 
@@ -50,8 +48,6 @@
  * For debugging purpose .. hardcode a table ..
  */
 struct  ascii_moduleid *ioconfig_bus_table;
-u64 ioconfig_bus_table_size;
-
 
 static int free_entry;
 static int new_entry;
@@ -68,6 +64,8 @@
 
 	*bus_num = -1;
 	temp = ioconfig_bus_table;
+	if (!ioconfig_bus_table)
+		return;
 	for (index = 0; index < free_entry; temp++, index++) {
 		if ( (io_moduleid[0] == temp->io_moduleid[0]) &&
 		     (io_moduleid[1] == temp->io_moduleid[1]) &&
@@ -101,6 +99,10 @@
 	struct ascii_moduleid *temp;
 
 	temp = ioconfig_bus_table;
+	if (!temp) {
+		DBG("ioconfig_bus_table tabel empty\n");
+		return;
+	}
 	while (index < free_entry) {
 		DBG("ASSCI Module ID %s\n", temp->io_moduleid);
 		temp++;
@@ -145,7 +147,7 @@
  *	memory by ioconfig command in EFI and builds the
  *	persistent pci bus naming table.
  */
-void
+int
 build_moduleid_table(char *file_contents, struct ascii_moduleid *table)
 {
 	/*
@@ -160,8 +162,17 @@
 	struct ascii_moduleid *moduleid;
 
 	line = kmalloc(256, GFP_KERNEL);
-	memset(line, 0,256);
 	name = kmalloc(125, GFP_KERNEL);
+	if (!line || !name) {
+		if (line)
+			kfree(line);
+		if (name)
+			kfree(name);
+		printk("build_moduleid_table(): Unabled to allocate memmory");
+		return -ENOMEM;
+	}
+
+	memset(line, 0,256);
 	memset(name, 0, 125);
 	moduleid = table;
 	curr = file_contents;
@@ -210,46 +221,21 @@
 	kfree(line);
 	kfree(name);
 
-	return;
+	return 0;
 }
 
-void
+int
 ioconfig_bus_init(void)
 {
 
-	struct ia64_sal_retval ret_stuff;
-	u64	*temp;
-	int	cnode;
-
 	DBG("ioconfig_bus_init called.\n");
 
-        for (cnode = 0; cnode < numnodes; cnode++) {
-		nasid_t nasid;
-		/*
-	 	 * Make SAL call to get the address of the bus configuration table.
-	 	 */
-		ret_stuff.status = (uint64_t)0;
-		ret_stuff.v0 = (uint64_t)0;
-		ret_stuff.v1 = (uint64_t)0;
-		ret_stuff.v2 = (uint64_t)0;
-		nasid = COMPACT_TO_NASID_NODEID(cnode);
-		SAL_CALL(ret_stuff, SN_SAL_BUS_CONFIG, 0, nasid, 0, 0, 0, 0, 0);
-		temp = (u64 *)TO_NODE_CAC(nasid, ret_stuff.v0);
-		ioconfig_file = *temp;
-		DBG("ioconfig_bus_init: Nasid %d ret_stuff.v0 0x%lx\n", nasid,
-			ret_stuff.v0);
-		if (ioconfig_file) {
-			ioconfig_file_size = ret_stuff.v1;
-			ioconfig_file = (ioconfig_file | CACHEABLE_MEM_SPACE);
-			ioconfig_activated = 1;
-			break;
-		}
+	ioconfig_bus_table = kmalloc( 512, GFP_KERNEL );
+	if (!ioconfig_bus_table) {
+		printk("ioconfig_bus_init : cannot allocate memory\n");
+		return -1;
 	}
 
-	DBG("ioconfig_bus_init: ret_stuff.v0 %p ioconfig_file %p %d\n",
-		ret_stuff.v0, (void *)ioconfig_file, (int)ioconfig_file_size);
-
-	ioconfig_bus_table = kmalloc( 512, GFP_KERNEL );
 	memset(ioconfig_bus_table, 0, 512);
 
 	/*
@@ -260,27 +246,17 @@
 		 * ioconfig="..." kernel options given.
 		 */
 		DBG("ioconfig_bus_init: Kernel Options given.\n");
-		(void) build_moduleid_table((char *)ioconfig_kernopts, ioconfig_bus_table);
+		if ( build_moduleid_table((char *)ioconfig_kernopts, ioconfig_bus_table) < 0 )
+			return -1;
 		(void) dump_ioconfig_table();
-		return;
 	}
-
-	if (ioconfig_activated) {
-		DBG("ioconfig_bus_init: ioconfig file given.\n");
-		(void) build_moduleid_table((char *)ioconfig_file, ioconfig_bus_table);
-		(void) dump_ioconfig_table();
-	} else {
-		DBG("ioconfig_bus_init: ioconfig command not executed in prom\n");
-	}
-
+	return 0;
 }
 
 void
 ioconfig_bus_new_entries(void)
 {
-
-	
-	int index = 0;
+	int index;
 	struct ascii_moduleid *temp;
 
 	if ((ioconfig_activated) && (free_entry > new_entry)) {
@@ -290,6 +266,10 @@
 		return;
 
 	index = new_entry;
+	if (!ioconfig_bus_table) {
+		printk("ioconfig_bus_table table is empty\n");
+		return;
+	}
 	temp = &ioconfig_bus_table[index];
         while (index < free_entry) {
                 printk("%s\n", (char *)temp);
@@ -302,17 +282,21 @@
 static int ioconfig_bus_ioctl(struct inode * inode, struct file * file,
         unsigned int cmd, unsigned long arg)
 {
-
-	struct ioconfig_parm parm;
-
 	/*
 	 * Copy in the parameters.
 	 */
-	copy_from_user(&parm, (char *)arg, sizeof(struct ioconfig_parm));
+	if (copy_from_user(&parm, (char *)arg, sizeof(struct ioconfig_parm)))
+		return -EFAULT;
 	parm.number = free_entry - new_entry;
 	parm.ioconfig_activated = ioconfig_activated;
-	copy_to_user((char *)arg, &parm, sizeof(struct ioconfig_parm));
-	copy_to_user((char *)parm.buffer, &ioconfig_bus_table[new_entry], sizeof(struct  ascii_moduleid) * (free_entry - new_entry));
+	if (copy_to_user((char *)arg, &parm, sizeof(struct ioconfig_parm)))
+		return -EFAULT;
+
+	if (!ioconfig_bus_table)
+		return -EFAULT;
+
+	if (copy_to_user((char *)parm.buffer, &ioconfig_bus_table[new_entry], sizeof(struct  ascii_moduleid) * (free_entry - new_entry)))
+		return -EFAULT;
 
 	return 0;
 }
@@ -344,9 +328,9 @@
 }
 
 struct file_operations ioconfig_bus_fops = {
-	.ioctl = ioconfig_bus_ioctl,
-	.open = ioconfig_bus_open,		/* open */
-	.release = ioconfig_bus_close	/* release */
+	.ioctl	= ioconfig_bus_ioctl,
+	.open	= ioconfig_bus_open,	/* open */
+	.release=ioconfig_bus_close	/* release */
 };
 
 
@@ -357,7 +341,6 @@
  */
 int init_ioconfig_bus(void)
 {
-	ioconfig_bus_handle = NULL;
 	ioconfig_bus_handle = hwgraph_register(hwgraph_root, ".ioconfig_bus",
 		        0, 0,
 			0, 0,
@@ -368,8 +351,7 @@
 		panic("Unable to create SGI PERSISTENT BUS NUMBERING Driver.\n");
 	}
 
-	return(0);
-
+	return 0;
 }
 
 static int __init ioconfig_bus_setup (char *str)
diff -Nru a/arch/ia64/sn/io/hwgfs/Makefile b/arch/ia64/sn/io/hwgfs/Makefile
--- a/arch/ia64/sn/io/hwgfs/Makefile	Tue Feb  3 19:45:18 2004
+++ b/arch/ia64/sn/io/hwgfs/Makefile	Tue Feb  3 19:45:18 2004
@@ -7,6 +7,4 @@
 #
 # Makefile for the sn2 io routines.
 
-EXTRA_CFLAGS    := -DLITTLE_ENDIAN
-
 obj-y		+= hcl.o labelcl.o hcl_util.o ramfs.o interface.o
diff -Nru a/arch/ia64/sn/io/hwgfs/hcl.c b/arch/ia64/sn/io/hwgfs/hcl.c
--- a/arch/ia64/sn/io/hwgfs/hcl.c	Tue Feb  3 19:45:28 2004
+++ b/arch/ia64/sn/io/hwgfs/hcl.c	Tue Feb  3 19:45:28 2004
@@ -23,41 +23,16 @@
 #include <asm/io.h>
 #include <asm/sn/iograph.h>
 #include <asm/sn/hwgfs.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
 #include <asm/sn/simulator.h>
 
-#define HCL_NAME "SGI-HWGRAPH COMPATIBILITY DRIVER"
-#define HCL_TEMP_NAME "HCL_TEMP_NAME_USED_FOR_HWGRAPH_VERTEX_CREATE"
-#define HCL_TEMP_NAME_LEN 44 
-#define HCL_VERSION "1.0"
-
 #define vertex_hdl_t hwgfs_handle_t
+
 vertex_hdl_t hwgraph_root;
 vertex_hdl_t linux_busnum;
-
-extern void pci_bus_cvlink_init(void);
-
-/*
- * Debug flag definition.
- */
-#define OPTION_NONE             0x00
-#define HCL_DEBUG_NONE 0x00000
-#define HCL_DEBUG_ALL  0x0ffff
-#if defined(CONFIG_HCL_DEBUG)
-static unsigned int hcl_debug_init __initdata = HCL_DEBUG_NONE;
-#endif
-static unsigned int hcl_debug = HCL_DEBUG_NONE;
-#if defined(CONFIG_HCL_DEBUG) && !defined(MODULE)
-static unsigned int boot_options = OPTION_NONE;
-#endif
-
-invplace_t invplace_none = {
-	GRAPH_VERTEX_NONE,
-	GRAPH_VERTEX_PLACE_NONE,
-	NULL
-};
+extern int pci_bus_cvlink_init(void);
+unsigned long hwgraph_debug_mask;
 
 /*
  * init_hcl() - Boot time initialization.
@@ -71,19 +46,16 @@
 	extern int init_hwgfs_fs(void);
 	int rv = 0;
 
-	if (IS_RUNNING_ON_SIMULATOR()) {
-		extern u64 klgraph_addr[];
-		klgraph_addr[0] = 0xe000003000030000;
-	}
-
 	init_hwgfs_fs();
 
 	/*
 	 * Create the hwgraph_root.
 	 */
 	rv = hwgraph_path_add(NULL, EDGE_LBL_HW, &hwgraph_root);
-	if (rv)
-		printk ("WARNING: init_hcl: Failed to create hwgraph_root. Error = %d.\n", rv);
+	if (rv) {
+		printk("init_hcl: Failed to create hwgraph_root.\n");
+		return -1;
+	}
 
 	/*
 	 * Initialize the HCL string table.
@@ -96,66 +68,23 @@
 	 */
 	rv = hwgraph_path_add(hwgraph_root, EDGE_LBL_LINUX_BUS, &linux_busnum);
 	if (linux_busnum == NULL) {
-		panic("HCL: Unable to create %s\n", EDGE_LBL_LINUX_BUS);
-		return(0);
+		printk("HCL: Unable to create %s\n", EDGE_LBL_LINUX_BUS);
+		return -1;
 	}
 
-	pci_bus_cvlink_init();
+	if (pci_bus_cvlink_init() < 0 ) {
+		printk("init_hcl: Failed to create pcibus cvlink.\n");
+		return -1;
+	}
 
 	/*
-	 * Initialize the ifconfgi_net driver that does network devices 
 	 * Persistent Naming.
 	 */
 	init_ioconfig_bus();
 
-	return(0);
-
-}
-
-
-/*
- * hcl_setup() - Process boot time parameters if given.
- *	"hcl="
- *	This routine gets called only if "hcl=" is given in the 
- *	boot line and before init_hcl().
- *
- *	We currently do not have any boot options .. when we do, 
- *	functionalities can be added here.
- *
- */
-static int __init hcl_setup(char *str)
-{
-    while ( (*str != '\0') && !isspace (*str) )
-    {
-#ifdef CONFIG_HCL_DEBUG
-        if (strncmp (str, "all", 3) == 0) {
-            hcl_debug_init |= HCL_DEBUG_ALL;
-            str += 3;
-        } else 
-        	return 0;
-#endif
-        if (*str != ',') return 0;
-        ++str;
-    }
-
-    return 1;
-
-}
-
-__setup("hcl=", hcl_setup);
-
-
-/*
- * Set device specific "fast information".
- *
- */
-void
-hwgraph_fastinfo_set(vertex_hdl_t de, arbitrary_info_t fastinfo)
-{
-	labelcl_info_replace_IDX(de, HWGRAPH_FASTINFO, fastinfo, NULL);
+	return 0;
 }
 
-
 /*
  * Get device specific "fast information".
  *
@@ -181,25 +110,6 @@
 
 
 /*
- * hwgraph_connectpt_set - Sets the connect point handle in de to the 
- *	given connect_de handle.  By default, the connect point of the 
- *	node is the parent.  This effectively changes this assumption.
- */
-int
-hwgraph_connectpt_set(vertex_hdl_t de, vertex_hdl_t connect_de)
-{
-	int rv;
-
-	if (!de)
-		return(-1);
-
-	rv = labelcl_info_connectpt_set(de, connect_de);
-
-	return(rv);
-}
-
-
-/*
  * hwgraph_connectpt_get: Returns the entry's connect point.
  *
  */
@@ -403,39 +313,6 @@
 	return(0);
 }
 
-#if 0
-/*
- * hwgraph_edge_add - This routines has changed from the original conext.
- * All it does now is to create a symbolic link from "from" to "to".
- */
-/* ARGSUSED */
-int
-hwgraph_edge_add(vertex_hdl_t from, vertex_hdl_t to, char *name)
-{
-
-	char *path, *link;
-	vertex_hdl_t handle = NULL;
-	int rv, i;
-
-	handle = hwgfs_find_handle(from, name, 0, 0, 0, 1);
-	if (handle) {
-		return(0);
-	}
-
-	path = kmalloc(1024, GFP_KERNEL);
-	memset(path, 0x0, 1024);
-	link = kmalloc(1024, GFP_KERNEL);
-	memset(path, 0x0, 1024);
-	i = hwgfs_generate_path (to, link, 1024);
-	rv = hwgfs_mk_symlink (from, (const char *)name, 
-			       DEVFS_FL_DEFAULT, link,
-			       &handle, NULL);
-	return(0);
-
-
-}
-#endif
-
 int
 hwgraph_edge_add(vertex_hdl_t from, vertex_hdl_t to, char *name)
 {
@@ -448,8 +325,14 @@
 	int i, count;
 
 	path = kmalloc(1024, GFP_KERNEL);
+	if (!path)
+		return -ENOMEM;
 	memset((char *)path, 0x0, 1024);
 	link = kmalloc(1024, GFP_KERNEL);
+	if (!link) {
+		kfree(path);
+		return -ENOMEM;
+	}
 	memset((char *)link, 0x0, 1024);
 
 	i = hwgfs_generate_path (from, path, 1024);
@@ -706,39 +589,6 @@
 }
 
 /*
- * hwgraph_path_to_vertex - Return the entry handle for the given 
- *	pathname .. assume traverse symlinks too!.
- */
-vertex_hdl_t
-hwgraph_path_to_vertex(char *path)
-{
-	return(hwgfs_find_handle(NULL,	/* start dir */
-			path,		/* path */
-		    	0,		/* major */
-		    	0,		/* minor */
-		    	0,		/* char | block */
-		    	1));		/* traverse symlinks */
-}
-
-/*
- * hwgraph_inventory_remove - Removes an inventory entry.
- *
- *	Remove an inventory item associated with a vertex.   It is the caller's
- *	responsibility to make sure that there are no races between removing
- *	inventory from a vertex and simultaneously removing that vertex.
-*/
-int
-hwgraph_inventory_remove(	vertex_hdl_t de,
-				int class,
-				int type,
-				major_t controller,
-				minor_t unit,
-				int state)
-{
-	return(0); /* Just a Stub for IRIX code. */
-}
-
-/*
  * Find the canonical name for a given vertex by walking back through
  * connectpt's until we hit the hwgraph root vertex (or until we run
  * out of buffer space or until something goes wrong).
@@ -750,7 +600,7 @@
  * "/" but rather it just stops right before /dev ..
  */
 int
-hwgraph_vertex_name_get(vertex_hdl_t vhdl, char *buf, uint buflen)
+hwgraph_vertex_name_get(vertex_hdl_t vhdl, char *buf, unsigned int buflen)
 {
 	char *locbuf;
 	int   pos;
@@ -785,34 +635,60 @@
 #define DEVNAME_UNKNOWN "UnknownDevice"
 
 char *
-vertex_to_name(vertex_hdl_t vhdl, char *buf, uint buflen)
+vertex_to_name(vertex_hdl_t vhdl, char *buf, unsigned int buflen)
 {
-	if (hwgraph_vertex_name_get(vhdl, buf, buflen) == GRAPH_SUCCESS)
-		return(buf);
-	else
-		return(DEVNAME_UNKNOWN);
+        if (hwgraph_vertex_name_get(vhdl, buf, buflen) == GRAPH_SUCCESS)
+                return(buf);
+        else
+                return(DEVNAME_UNKNOWN);
 }
 
-graph_error_t
-hwgraph_edge_remove(vertex_hdl_t from, char *name, vertex_hdl_t *toptr)
-{
-	return(GRAPH_ILLEGAL_REQUEST);
-}
 
-graph_error_t
-hwgraph_vertex_unref(vertex_hdl_t vhdl)
+void
+hwgraph_debug(char *file, char * function, int line, vertex_hdl_t vhdl1, vertex_hdl_t vhdl2, char *format, ...)
 {
-	return(GRAPH_ILLEGAL_REQUEST);
-}
 
+	int pos;
+	char *hwpath;
+	va_list ap;
+
+	if ( !hwgraph_debug_mask )
+		return;
+
+	hwpath = kmalloc(MAXDEVNAME, GFP_KERNEL);
+	if (!hwpath) {
+		printk("HWGRAPH_DEBUG kmalloc fails at %d ", __LINE__);
+		return;
+	}
+
+	printk("HWGRAPH_DEBUG %s %s %d : ", file, function, line);
+
+	if (vhdl1){
+		memset(hwpath, 0, MAXDEVNAME);
+		pos = hwgfs_generate_path(vhdl1, hwpath, MAXDEVNAME);
+		printk("vhdl1 = %s : ", &hwpath[pos]);
+	}
+
+	if (vhdl2){
+		memset(hwpath, 0, MAXDEVNAME);
+		pos = hwgfs_generate_path(vhdl2, hwpath, MAXDEVNAME);
+		printk("vhdl2 = %s :", &hwpath[pos]);
+	}
+
+	memset(hwpath, 0, MAXDEVNAME);
+        va_start(ap, format);
+        vsnprintf(hwpath, 500, format, ap);
+        va_end(ap);
+	hwpath[MAXDEVNAME -1] = (char)0; /* Just in case. */
+        printk(" %s", hwpath);
+	kfree(hwpath);
+}
 
 EXPORT_SYMBOL(hwgraph_mk_dir);
 EXPORT_SYMBOL(hwgraph_path_add);
 EXPORT_SYMBOL(hwgraph_register);
 EXPORT_SYMBOL(hwgraph_vertex_destroy);
 EXPORT_SYMBOL(hwgraph_fastinfo_get);
-EXPORT_SYMBOL(hwgraph_fastinfo_set);
-EXPORT_SYMBOL(hwgraph_connectpt_set);
 EXPORT_SYMBOL(hwgraph_connectpt_get);
 EXPORT_SYMBOL(hwgraph_info_add_LBL);
 EXPORT_SYMBOL(hwgraph_info_remove_LBL);
diff -Nru a/arch/ia64/sn/io/hwgfs/hcl_util.c b/arch/ia64/sn/io/hwgfs/hcl_util.c
--- a/arch/ia64/sn/io/hwgfs/hcl_util.c	Tue Feb  3 19:45:16 2004
+++ b/arch/ia64/sn/io/hwgfs/hcl_util.c	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -14,16 +13,33 @@
 #include <asm/sn/io.h>
 #include <asm/sn/iograph.h>
 #include <asm/sn/hwgfs.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl_util.h>
 #include <asm/sn/nodepda.h>
 
 static vertex_hdl_t hwgraph_all_cnodes = GRAPH_VERTEX_NONE;
 extern vertex_hdl_t hwgraph_root;
+static vertex_hdl_t hwgraph_all_cpuids = GRAPH_VERTEX_NONE;
+extern int maxcpus;
+
+void
+mark_cpuvertex_as_cpu(vertex_hdl_t vhdl, cpuid_t cpuid)
+{
+	char cpuid_buffer[10];
+
+	if (cpuid == CPU_NONE)
+		return;
 
+	if (hwgraph_all_cpuids == GRAPH_VERTEX_NONE) {
+		(void)hwgraph_path_add( hwgraph_root,
+					EDGE_LBL_CPUNUM,
+					&hwgraph_all_cpuids);
+	}
+
+	sprintf(cpuid_buffer, "%ld", cpuid);
+	(void)hwgraph_edge_add( hwgraph_all_cpuids, vhdl, cpuid_buffer);
+}
 
 /*
 ** Return the "master" for a given vertex.  A master vertex is a
@@ -96,32 +112,6 @@
 	}
 }
 
-static vertex_hdl_t hwgraph_all_cpuids = GRAPH_VERTEX_NONE;
-extern int maxcpus;
-
-void
-mark_cpuvertex_as_cpu(vertex_hdl_t vhdl, cpuid_t cpuid)
-{
-	if (cpuid == CPU_NONE)
-		return;
-
-	(void)labelcl_info_add_LBL(vhdl, INFO_LBL_CPUID, INFO_DESC_EXPORT,
-			(arbitrary_info_t)cpuid);
-	{
-		char cpuid_buffer[10];
-
-		if (hwgraph_all_cpuids == GRAPH_VERTEX_NONE) {
-			(void)hwgraph_path_add( hwgraph_root,
-						EDGE_LBL_CPUNUM,
-						&hwgraph_all_cpuids);
-		}
-
-		sprintf(cpuid_buffer, "%ld", cpuid);
-		(void)hwgraph_edge_add( hwgraph_all_cpuids,
-							vhdl,
-							cpuid_buffer);
-	}
-}
 
 /*
 ** If the specified device represents a node, return its
@@ -161,25 +151,11 @@
 		(void)hwgraph_edge_add( hwgraph_all_cnodes,
 					vhdl,
 					cnodeid_buffer);
+		HWGRAPH_DEBUG((__FILE__, __FUNCTION__, __LINE__, hwgraph_all_cnodes, NULL, "Creating path vhdl1\n"));
 	}
 }
 
 /*
-** If the specified device represents a CPU, return its cpuid;
-** otherwise, return CPU_NONE.
-*/
-cpuid_t
-cpuvertex_to_cpuid(vertex_hdl_t vhdl)
-{
-	arbitrary_info_t cpuid = CPU_NONE;
-
-	(void)labelcl_info_get_LBL(vhdl, INFO_LBL_CPUID, NULL, &cpuid);
-
-	return((cpuid_t)cpuid);
-}
-
-
-/*
 ** dev_to_name converts a vertex_hdl_t into a canonical name.  If the vertex_hdl_t
 ** represents a vertex in the hardware graph, it is converted in the
 ** normal way for vertices.  If the vertex_hdl_t is an old vertex_hdl_t (one which
@@ -196,5 +172,4 @@
 {
         return(vertex_to_name(dev, buf, buflen));
 }
-
 
diff -Nru a/arch/ia64/sn/io/hwgfs/interface.c b/arch/ia64/sn/io/hwgfs/interface.c
--- a/arch/ia64/sn/io/hwgfs/interface.c	Tue Feb  3 19:45:43 2004
+++ b/arch/ia64/sn/io/hwgfs/interface.c	Tue Feb  3 19:45:43 2004
@@ -1,36 +1,12 @@
 /*
+ * 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) 2003 Silicon Graphics, Inc.  All Rights Reserved.
  *
  *  Portions based on Adam Richter's smalldevfs and thus
  *  Copyright 2002-2003  Yggdrasil Computing, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
 #include <linux/module.h>
@@ -40,7 +16,6 @@
 #include <linux/namei.h>
 #include <linux/string.h>
 #include <linux/slab.h>
-#include <linux/dcache.h>
 #include <asm/sn/hwgfs.h>
 
 
@@ -297,8 +272,7 @@
 
 	nd.mnt = mntget(hwgfs_vfsmount);
 	nd.dentry = dget(base ? base : hwgfs_vfsmount->mnt_sb->s_root);
-	if (traverse_symlinks)
-		nd.flags = LOOKUP_FOLLOW;
+	nd.flags = (traverse_symlinks ? LOOKUP_FOLLOW : 0);
 
 	error = link_path_walk(name, &nd);
 	if (likely(!error)) {
diff -Nru a/arch/ia64/sn/io/hwgfs/labelcl.c b/arch/ia64/sn/io/hwgfs/labelcl.c
--- a/arch/ia64/sn/io/hwgfs/labelcl.c	Tue Feb  3 19:45:30 2004
+++ b/arch/ia64/sn/io/hwgfs/labelcl.c	Tue Feb  3 19:45:30 2004
@@ -16,7 +16,6 @@
 #include <linux/smp_lock.h>
 #include <asm/sn/sgi.h>
 #include <asm/sn/hwgfs.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
 
diff -Nru a/arch/ia64/sn/io/hwgfs/ramfs.c b/arch/ia64/sn/io/hwgfs/ramfs.c
--- a/arch/ia64/sn/io/hwgfs/ramfs.c	Tue Feb  3 19:45:34 2004
+++ b/arch/ia64/sn/io/hwgfs/ramfs.c	Tue Feb  3 19:45:34 2004
@@ -1,37 +1,13 @@
 /*
+ * 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) 2003 Silicon Graphics, Inc.  All Rights Reserved.
  *
  *  Mostly shameless copied from Linus Torvalds' ramfs and thus
  *  Copyright (C) 2000 Linus Torvalds.
  *                2000 Transmeta Corp.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
 #include <linux/module.h>
diff -Nru a/arch/ia64/sn/io/io.c b/arch/ia64/sn/io/io.c
--- a/arch/ia64/sn/io/io.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/sn/io/io.c	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,4 @@
-/* $Id: io.c,v 1.2 2001/06/26 14:02:43 pfg Exp $
- *
+/*
  * 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.
@@ -20,7 +19,6 @@
 #include <asm/sn/io.h>
 #include <asm/sn/sn_private.h>
 #include <asm/sn/addrs.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/hcl_util.h>
 #include <asm/sn/intr.h>
@@ -29,7 +27,6 @@
 #include <asm/sn/sn_cpuid.h>
 
 extern xtalk_provider_t hub_provider;
-extern void hub_intr_init(vertex_hdl_t hubv);
 
 static int force_fire_and_forget = 1;
 static int ignore_conveyor_override;
@@ -86,7 +83,7 @@
 	}
 	hub_set_piomode(nasid, HUB_PIO_CONVEYOR);
 
-	mutex_spinlock_init(&hubinfo->h_bwlock);
+	spin_lock_init(&hubinfo->h_bwlock);
 	init_waitqueue_head(&hubinfo->h_bwwait);
 }
 
@@ -119,7 +116,6 @@
 	int bigwin, free_bw_index;
 	nasid_t nasid;
 	volatile hubreg_t junk;
-	unsigned long s;
 	caddr_t kvaddr;
 #ifdef PIOMAP_UNC_ACC_SPACE
 	uint64_t addr;
@@ -167,7 +163,7 @@
 	 */
 tryagain:
 	free_bw_index = -1;
-	s = mutex_spinlock(&hubinfo->h_bwlock);
+	spin_lock(&hubinfo->h_bwlock);
 	for (bigwin=0; bigwin < HUB_NUM_BIG_WINDOW; bigwin++) {
 		bw_piomap = hubinfo_bwin_piomap_get(hubinfo, bigwin);
 
@@ -187,7 +183,7 @@
 		if ( xtalk_addr == bw_piomap->hpio_xtalk_info.xp_xtalk_addr &&
 		     widget == bw_piomap->hpio_xtalk_info.xp_target) {
 			bw_piomap->hpio_holdcnt++;
-			mutex_spinunlock(&hubinfo->h_bwlock, s);
+			spin_unlock(&hubinfo->h_bwlock);
 			return(bw_piomap);
 		}
 	}
@@ -267,7 +263,7 @@
 		bw_piomap->hpio_flags |= HUB_PIOMAP_IS_VALID;
 
 done:
-	mutex_spinunlock(&hubinfo->h_bwlock, s);
+	spin_unlock(&hubinfo->h_bwlock);
 	return(bw_piomap);
 }
 
@@ -287,7 +283,6 @@
 	vertex_hdl_t hubv;
 	hubinfo_t hubinfo;
 	nasid_t nasid;
-	unsigned long s;
 
 	/* 
 	 * Small windows are permanently mapped to corresponding widgets,
@@ -303,7 +298,7 @@
 	hubinfo_get(hubv, &hubinfo);
 	nasid = hubinfo->h_nasid;
 
-	s = mutex_spinlock(&hubinfo->h_bwlock);
+	spin_lock(&hubinfo->h_bwlock);
 
 	/*
 	 * If this is the last hold on this mapping, free it.
@@ -321,7 +316,7 @@
 		wake_up(&hubinfo->h_bwwait);
 	}
 
-	mutex_spinunlock(&hubinfo->h_bwlock, s);
+	spin_unlock(&hubinfo->h_bwlock);
 }
 
 /*
@@ -442,7 +437,7 @@
 hub_dmamap_free(hub_dmamap_t hub_dmamap)
 {
 	hub_dmamap->hdma_flags &= ~HUB_DMAMAP_IS_VALID;
-	kern_free(hub_dmamap);
+	kfree(hub_dmamap);
 }
 
 /*
@@ -463,12 +458,9 @@
 	if (dmamap->hdma_flags & HUB_DMAMAP_USED) {
 	    /* If the map is FIXED, re-use is OK. */
 	    if (!(dmamap->hdma_flags & HUB_DMAMAP_IS_FIXED)) {
+		char name[MAXDEVNAME];
 		vhdl = dmamap->hdma_xtalk_info.xd_dev;
-#if defined(SUPPORT_PRINTING_V_FORMAT)
-		printk(KERN_WARNING  "%v: hub_dmamap_addr re-uses dmamap.\n",vhdl);
-#else
-		printk(KERN_WARNING  "%p: hub_dmamap_addr re-uses dmamap.\n", (void *)vhdl);
-#endif
+		printk(KERN_WARNING  "%s: hub_dmamap_addr re-uses dmamap.\n", vertex_to_name(vhdl, name, MAXDEVNAME));
 	    }
 	} else {
 		dmamap->hdma_flags |= HUB_DMAMAP_USED;
@@ -496,12 +488,9 @@
 	if (hub_dmamap->hdma_flags & HUB_DMAMAP_USED) {
 	    /* If the map is FIXED, re-use is OK. */
 	    if (!(hub_dmamap->hdma_flags & HUB_DMAMAP_IS_FIXED)) {
+		char name[MAXDEVNAME];
 		vhdl = hub_dmamap->hdma_xtalk_info.xd_dev;
-#if defined(SUPPORT_PRINTING_V_FORMAT)
-		printk(KERN_WARNING  "%v: hub_dmamap_list re-uses dmamap\n",vhdl);
-#else
-		printk(KERN_WARNING  "%p: hub_dmamap_list re-uses dmamap\n", (void *)vhdl);
-#endif
+		printk(KERN_WARNING  "%s: hub_dmamap_list re-uses dmamap\n", vertex_to_name(vhdl, name, MAXDEVNAME));
 	    }
 	} else {
 		hub_dmamap->hdma_flags |= HUB_DMAMAP_USED;
@@ -525,12 +514,9 @@
 	} else {
 	    /* If the map is FIXED, re-done is OK. */
 	    if (!(hub_dmamap->hdma_flags & HUB_DMAMAP_IS_FIXED)) {
+		char name[MAXDEVNAME];
 		vhdl = hub_dmamap->hdma_xtalk_info.xd_dev;
-#if defined(SUPPORT_PRINTING_V_FORMAT)
-		printk(KERN_WARNING  "%v: hub_dmamap_done already done with dmamap\n",vhdl);
-#else
-		printk(KERN_WARNING  "%p: hub_dmamap_done already done with dmamap\n", (void *)vhdl);
-#endif
+		printk(KERN_WARNING  "%s: hub_dmamap_done already done with dmamap\n", vertex_to_name(vhdl, name, MAXDEVNAME));
 	    }
 	}
 }
@@ -601,7 +587,6 @@
 hub_provider_startup(vertex_hdl_t hubv)
 {
 	hub_pio_init(hubv);
-	hub_intr_init(hubv);
 }
 
 /*
@@ -808,4 +793,3 @@
 	(xtalk_provider_startup_f *)	hub_provider_startup,
 	(xtalk_provider_shutdown_f *)	hub_provider_shutdown,
 };
-
diff -Nru a/arch/ia64/sn/io/machvec/Makefile b/arch/ia64/sn/io/machvec/Makefile
--- a/arch/ia64/sn/io/machvec/Makefile	Tue Feb  3 19:45:16 2004
+++ b/arch/ia64/sn/io/machvec/Makefile	Tue Feb  3 19:45:16 2004
@@ -7,6 +7,4 @@
 #
 # Makefile for the sn2 io routines.
 
-EXTRA_CFLAGS    := -DLITTLE_ENDIAN
-
 obj-y				+= pci.o pci_dma.o pci_bus_cvlink.o iomv.o
diff -Nru a/arch/ia64/sn/io/machvec/pci.c b/arch/ia64/sn/io/machvec/pci.c
--- a/arch/ia64/sn/io/machvec/pci.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/sn/io/machvec/pci.c	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,4 @@
 /* 
- *
  * SNI64 specific PCI support for SNI IO.
  *
  * This file is subject to the terms and conditions of the GNU General Public
@@ -8,33 +7,15 @@
  *
  * Copyright (c) 1997, 1998, 2000-2003 Silicon Graphics, Inc.  All rights reserved.
  */
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/config.h>
-#include <linux/pci.h>
-#include <asm/sn/types.h>
-#include <asm/sn/sgi.h>
-#include <asm/sn/io.h>
-#include <asm/sn/driver.h>
-#include <asm/sn/iograph.h>
-#include <asm/param.h>
-#include <asm/sn/pio.h>
-#include <asm/sn/xtalk/xwidget.h>
-#include <asm/sn/sn_private.h>
-#include <asm/sn/addrs.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
-#include <asm/sn/hcl_util.h>
-#include <asm/sn/pci/pciio.h>
-#include <asm/sn/pci/pcibr.h>
 #include <asm/sn/pci/pcibr_private.h>
-#include <asm/sn/pci/bridge.h>
 
 /*
  * These routines are only used during sn_pci_init for probing each bus, and
  * can probably be removed with a little more cleanup now that the SAL routines
  * work on sn2.
  */
+
 extern vertex_hdl_t devfn_to_vertex(unsigned char bus, unsigned char devfn);
 
 int sn_read_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val)
diff -Nru a/arch/ia64/sn/io/machvec/pci_bus_cvlink.c b/arch/ia64/sn/io/machvec/pci_bus_cvlink.c
--- a/arch/ia64/sn/io/machvec/pci_bus_cvlink.c	Tue Feb  3 19:45:36 2004
+++ b/arch/ia64/sn/io/machvec/pci_bus_cvlink.c	Tue Feb  3 19:45:36 2004
@@ -6,37 +6,12 @@
  * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
  */
 
-#include <linux/config.h>
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <linux/pci_ids.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <asm/sn/types.h>
+#include <linux/vmalloc.h>
 #include <asm/sn/sgi.h>
-#include <asm/sn/io.h>
-#include <asm/sn/driver.h>
 #include <asm/sn/iograph.h>
-#include <asm/param.h>
-#include <asm/sn/pio.h>
-#include <asm/sn/xtalk/xwidget.h>
-#include <asm/sn/sn_private.h>
-#include <asm/sn/addrs.h>
-#include <asm/sn/invent.h>
-#include <asm/sn/hcl.h>
-#include <asm/sn/hcl_util.h>
-#include <asm/sn/intr.h>
-#include <asm/sn/xtalk/xtalkaddrs.h>
-#include <asm/sn/klconfig.h>
-#include <asm/sn/nodepda.h>
-#include <asm/sn/pci/pciio.h>
-#include <asm/sn/pci/pcibr.h>
-#include <asm/sn/pci/pcibr_private.h>
 #include <asm/sn/pci/pci_bus_cvlink.h>
-#include <asm/sn/simulator.h>
 #include <asm/sn/sn_cpuid.h>
-#include <asm/sn/arch.h>
+#include <asm/sn/simulator.h>
 
 extern int bridge_rev_b_data_check_disable;
 
@@ -53,29 +28,32 @@
 extern void register_pcibr_intr(int irq, pcibr_intr_t intr);
 
 void sn_dma_flush_init(unsigned long start, unsigned long end, int idx, int pin, int slot);
+extern int cbrick_type_get_nasid(nasid_t);
 
+#define IS_OPUS(nasid) (cbrick_type_get_nasid(nasid) == MODULE_OPUSBRICK)
+#define IS_ALTIX(nasid) (cbrick_type_get_nasid(nasid) == MODULE_CBRICK)
 
 /*
- * For the given device, initialize whether it is a PIC device.
+ * Init the provider asic for a given device
  */
+
 static void
-set_isPIC(struct sn_device_sysdata *device_sysdata)
+set_pci_provider(struct sn_device_sysdata *device_sysdata)
 {
 	pciio_info_t pciio_info = pciio_info_get(device_sysdata->vhdl);
-	pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info);
 
-	device_sysdata->isPIC = IS_PIC_SOFT(pcibr_soft);;
+	device_sysdata->pci_provider = pciio_info_pops_get(pciio_info);
 }
 
 /*
  * pci_bus_cvlink_init() - To be called once during initialization before 
  *	SGI IO Infrastructure init is called.
  */
-void
+int
 pci_bus_cvlink_init(void)
 {
 
-	extern void ioconfig_bus_init(void);
+	extern int ioconfig_bus_init(void);
 
 	memset(busnum_to_pcibr_vhdl, 0x0, sizeof(vertex_hdl_t) * MAX_PCI_XWIDGET);
 	memset(busnum_to_nid, 0x0, sizeof(nasid_t) * MAX_PCI_XWIDGET);
@@ -84,7 +62,7 @@
 
 	num_bridges = 0;
 
-	ioconfig_bus_init();
+	return ioconfig_bus_init();
 }
 
 /*
@@ -170,62 +148,15 @@
 	return(device_vertex);
 }
 
-/*
- * For the given device, initialize the addresses for both the Device(x) Flush 
- * Write Buffer register and the Xbow Flush Register for the port the PCI bus 
- * is connected.
- */
-static void
-set_flush_addresses(struct pci_dev *device_dev, 
-	struct sn_device_sysdata *device_sysdata)
-{
-	pciio_info_t pciio_info = pciio_info_get(device_sysdata->vhdl);
-	pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info);
-	pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info);
-    	bridge_t               *bridge = pcibr_soft->bs_base;
-	nasid_t			nasid;
-
-	/*
-	 * Get the nasid from the bridge.
-	 */
-	nasid = NASID_GET(device_sysdata->dma_buf_sync);
-	if (IS_PIC_DEVICE(device_dev)) {
-		device_sysdata->dma_buf_sync = (volatile unsigned int *)
-			&bridge->b_wr_req_buf[pciio_slot].reg;
-		device_sysdata->xbow_buf_sync = (volatile unsigned int *)
-			XBOW_PRIO_LINKREGS_PTR(NODE_SWIN_BASE(nasid, 0),
-			pcibr_soft->bs_xid);
-	} else {
-		/*
-		 * Accessing Xbridge and Xbow register when SHUB swapoper is on!.
-		 */
-		device_sysdata->dma_buf_sync = (volatile unsigned int *)
-			((uint64_t)&(bridge->b_wr_req_buf[pciio_slot].reg)^4);
-		device_sysdata->xbow_buf_sync = (volatile unsigned int *)
-			((uint64_t)(XBOW_PRIO_LINKREGS_PTR(
-			NODE_SWIN_BASE(nasid, 0), pcibr_soft->bs_xid)) ^ 4);
-	}
-
-#ifdef DEBUG
-	printk("set_flush_addresses: dma_buf_sync %p xbow_buf_sync %p\n", 
-		device_sysdata->dma_buf_sync, device_sysdata->xbow_buf_sync);
-
-printk("set_flush_addresses: dma_buf_sync\n");
-	while((volatile unsigned int )*device_sysdata->dma_buf_sync);
-printk("set_flush_addresses: xbow_buf_sync\n");
-	while((volatile unsigned int )*device_sysdata->xbow_buf_sync);
-#endif
-
-}
-
 struct sn_flush_nasid_entry flush_nasid_list[MAX_NASIDS];
 
-// Initialize the data structures for flushing write buffers after a PIO read.
-// The theory is: 
-// Take an unused int. pin and associate it with a pin that is in use.
-// After a PIO read, force an interrupt on the unused pin, forcing a write buffer flush
-// on the in use pin.  This will prevent the race condition between PIO read responses and 
-// DMA writes.
+/* Initialize the data structures for flushing write buffers after a PIO read.
+ * The theory is: 
+ * Take an unused int. pin and associate it with a pin that is in use.
+ * After a PIO read, force an interrupt on the unused pin, forcing a write buffer flush
+ * on the in use pin.  This will prevent the race condition between PIO read responses and 
+ * DMA writes.
+ */
 void
 sn_dma_flush_init(unsigned long start, unsigned long end, int idx, int pin, int slot) {
 	nasid_t nasid; 
@@ -247,101 +178,59 @@
 	if (flush_nasid_list[nasid].widget_p == NULL) {
 		flush_nasid_list[nasid].widget_p = (struct sn_flush_device_list **)kmalloc((HUB_WIDGET_ID_MAX+1) *
 			sizeof(struct sn_flush_device_list *), GFP_KERNEL);
+		if (flush_nasid_list[nasid].widget_p <= 0) {
+			printk("sn_dma_flush_init: Cannot allocate memory for nasid list\n");
+			return;
+		}
 		memset(flush_nasid_list[nasid].widget_p, 0, (HUB_WIDGET_ID_MAX+1) * sizeof(struct sn_flush_device_list *));
 	}
 	if (bwin > 0) {
-		bwin--;
-		switch (bwin) {
-			case 0:
-				flush_nasid_list[nasid].iio_itte1 = HUB_L(IIO_ITTE_GET(nasid, 0));
-				wid_num = ((flush_nasid_list[nasid].iio_itte1) >> 8) & 0xf;
-				bus = flush_nasid_list[nasid].iio_itte1 & 0xf;
-				if (bus == 0x4 || bus == 0x8)
-					bus = 0;
-				else
-					bus = 1;
-				break;
-			case 1:
-				flush_nasid_list[nasid].iio_itte2 = HUB_L(IIO_ITTE_GET(nasid, 1));
-				wid_num = ((flush_nasid_list[nasid].iio_itte2) >> 8) & 0xf;
-				bus = flush_nasid_list[nasid].iio_itte2 & 0xf;
-				if (bus == 0x4 || bus == 0x8)
-					bus = 0;
-				else
-					bus = 1;
-				break;
-			case 2:
-				flush_nasid_list[nasid].iio_itte3 = HUB_L(IIO_ITTE_GET(nasid, 2));
-				wid_num = ((flush_nasid_list[nasid].iio_itte3) >> 8) & 0xf;
-				bus = flush_nasid_list[nasid].iio_itte3 & 0xf;
-				if (bus == 0x4 || bus == 0x8)
-					bus = 0;
-				else
-					bus = 1;
-				break;
-			case 3:
-				flush_nasid_list[nasid].iio_itte4 = HUB_L(IIO_ITTE_GET(nasid, 3));
-				wid_num = ((flush_nasid_list[nasid].iio_itte4) >> 8) & 0xf;
-				bus = flush_nasid_list[nasid].iio_itte4 & 0xf;
-				if (bus == 0x4 || bus == 0x8)
-					bus = 0;
-				else
-					bus = 1;
-				break;
-			case 4:
-				flush_nasid_list[nasid].iio_itte5 = HUB_L(IIO_ITTE_GET(nasid, 4));
-				wid_num = ((flush_nasid_list[nasid].iio_itte5) >> 8) & 0xf;
-				bus = flush_nasid_list[nasid].iio_itte5 & 0xf;
-				if (bus == 0x4 || bus == 0x8)
-					bus = 0;
-				else
-					bus = 1;
-				break;
-			case 5:
-				flush_nasid_list[nasid].iio_itte6 = HUB_L(IIO_ITTE_GET(nasid, 5));
-				wid_num = ((flush_nasid_list[nasid].iio_itte6) >> 8) & 0xf;
-				bus = flush_nasid_list[nasid].iio_itte6 & 0xf;
-				if (bus == 0x4 || bus == 0x8)
-					bus = 0;
-				else
-					bus = 1;
-				break;
-			case 6:
-				flush_nasid_list[nasid].iio_itte7 = HUB_L(IIO_ITTE_GET(nasid, 6));
-				wid_num = ((flush_nasid_list[nasid].iio_itte7) >> 8) & 0xf;
-				bus = flush_nasid_list[nasid].iio_itte7 & 0xf;
-				if (bus == 0x4 || bus == 0x8)
-					bus = 0;
-				else
-					bus = 1;
-				break;
+		int itte_index = bwin - 1;
+		unsigned long itte;
+
+		itte = HUB_L(IIO_ITTE_GET(nasid, itte_index));
+		flush_nasid_list[nasid].iio_itte[bwin] = itte;
+		wid_num = (itte >> IIO_ITTE_WIDGET_SHIFT) & 
+			  IIO_ITTE_WIDGET_MASK;
+		bus = itte & IIO_ITTE_OFFSET_MASK;
+		if (bus == 0x4 || bus == 0x8) {
+			bus = 0;
+		} else {
+			bus = 1;
 		}
 	}
 
-	// if it's IO9, bus 1, we don't care about slots 1, 3, and 4.  This is
-	// because these are the IOC4 slots and we don't flush them.
+	/* if it's IO9, bus 1, we don't care about slots 1 and 4.  This is
+	 * because these are the IOC4 slots and we don't flush them.
+	 */
 	if (isIO9(nasid) && bus == 0 && (slot == 1 || slot == 4)) {
 		return;
 	}
 	if (flush_nasid_list[nasid].widget_p[wid_num] == NULL) {
 		flush_nasid_list[nasid].widget_p[wid_num] = (struct sn_flush_device_list *)kmalloc(
 			DEV_PER_WIDGET * sizeof (struct sn_flush_device_list), GFP_KERNEL);
+		if (flush_nasid_list[nasid].widget_p[wid_num] <= 0) {
+			printk("sn_dma_flush_init: Cannot allocate memory for nasid sub-list\n");
+			return;
+		}
 		memset(flush_nasid_list[nasid].widget_p[wid_num], 0, 
 			DEV_PER_WIDGET * sizeof (struct sn_flush_device_list));
 		p = &flush_nasid_list[nasid].widget_p[wid_num][0];
 		for (i=0; i<DEV_PER_WIDGET;i++) {
 			p->bus = -1;
 			p->pin = -1;
+			p->slot = -1;
 			p++;
 		}
 	}
 
 	p = &flush_nasid_list[nasid].widget_p[wid_num][0];
 	for (i=0;i<DEV_PER_WIDGET; i++) {
-		if (p->pin == pin && p->bus == bus) break;
+		if (p->pin == pin && p->bus == bus && p->slot == slot) break;
 		if (p->pin < 0) {
 			p->pin = pin;
 			p->bus = bus;
+			p->slot = slot;
 			break;
 		}
 		p++;
@@ -356,25 +245,28 @@
 	}
 	b = (bridge_t *)(NODE_SWIN_BASE(nasid, wid_num) | (bus << 23) );
 
-	// If it's IO9, then slot 2 maps to slot 7 and slot 6 maps to slot 8.
-	// To see this is non-trivial.  By drawing pictures and reading manuals and talking
-	// to HW guys, we can see that on IO9 bus 1, slots 7 and 8 are always unused.
-	// Further, since we short-circuit slots  1, 3, and 4 above, we only have to worry
-	// about the case when there is a card in slot 2.  A multifunction card will appear
-	// to be in slot 6 (from an interrupt point of view) also.  That's the  most we'll
-	// have to worry about.  A four function card will overload the interrupt lines in
-	// slot 2 and 6.  
-	// We also need to special case the 12160 device in slot 3.  Fortunately, we have
-	// a spare intr. line for pin 4, so we'll use that for the 12160.
-	// All other buses have slot 3 and 4 and slots 7 and 8 unused.  Since we can only
-	// see slots 1 and 2 and slots 5 and 6 coming through here for those buses (this
-	// is true only on Pxbricks with 2 physical slots per bus), we just need to add
-	// 2 to the slot number to find an unused slot.
-	// We have convinced ourselves that we will never see a case where two different cards
-	// in two different slots will ever share an interrupt line, so there is no need to
-	// special case this.
-
-	if (isIO9(nasid) && wid_num == 0xc && bus == 0) {
+	/* If it's IO9, then slot 2 maps to slot 7 and slot 6 maps to slot 8.
+	 * To see this is non-trivial.  By drawing pictures and reading manuals and talking
+	 * to HW guys, we can see that on IO9 bus 1, slots 7 and 8 are always unused.
+	 * Further, since we short-circuit slots  1, 3, and 4 above, we only have to worry
+	 * about the case when there is a card in slot 2.  A multifunction card will appear
+	 * to be in slot 6 (from an interrupt point of view) also.  That's the  most we'll
+	 * have to worry about.  A four function card will overload the interrupt lines in
+	 * slot 2 and 6.  
+	 * We also need to special case the 12160 device in slot 3.  Fortunately, we have
+	 * a spare intr. line for pin 4, so we'll use that for the 12160.
+	 * All other buses have slot 3 and 4 and slots 7 and 8 unused.  Since we can only
+	 * see slots 1 and 2 and slots 5 and 6 coming through here for those buses (this
+	 * is true only on Pxbricks with 2 physical slots per bus), we just need to add
+	 * 2 to the slot number to find an unused slot.
+	 * We have convinced ourselves that we will never see a case where two different cards
+	 * in two different slots will ever share an interrupt line, so there is no need to
+	 * special case this.
+	 */
+
+	if (isIO9(nasid) && ( (IS_ALTIX(nasid) && wid_num == 0xc)
+				|| (IS_OPUS(nasid) && wid_num == 0xf) )
+				&& bus == 0) {
 		if (slot == 2) {
 			p->force_int_addr = (unsigned long)&b->b_force_always[6].intr;
 			dev_sel = b->b_int_device;
@@ -427,7 +319,7 @@
 	struct sn_widget_sysdata *widget_sysdata;
 	struct sn_device_sysdata *device_sysdata;
 	pcibr_intr_t intr_handle;
-	int cpuid;
+	pciio_provider_t *pci_provider;
 	vertex_hdl_t device_vertex;
 	pciio_intr_line_t lines;
 	extern int numnodes;
@@ -437,11 +329,10 @@
 #ifdef CONFIG_PROC_FS
 		extern void register_sn_procfs(void);
 #endif
-		extern void irix_io_init(void);
+		extern void sgi_master_io_infr_init(void);
 		extern void sn_init_cpei_timer(void);
 		
-		init_hcl();
-		irix_io_init();
+		sgi_master_io_infr_init();
 		
 		for (cnode = 0; cnode < numnodes; cnode++) {
 			extern void intr_init_vecblk(cnodeid_t);
@@ -474,8 +365,13 @@
  	 * set the root start and end so that drivers calling check_region()
 	 * won't see a conflict
 	 */
-	ioport_resource.start  = 0xc000000000000000;
-	ioport_resource.end =    0xcfffffffffffffff;
+
+#ifdef CONFIG_IA64_SGI_SN_SIM
+	if (! IS_RUNNING_ON_SIMULATOR()) {
+		ioport_resource.start  = 0xc000000000000000;
+		ioport_resource.end =    0xcfffffffffffffff;
+	}
+#endif
 
 	/*
 	 * Set the root start and end for Mem Resource.
@@ -490,6 +386,7 @@
 		unsigned int irq;
 		int idx;
 		u16 cmd;
+		vertex_hdl_t vhdl;
 		unsigned long size;
 		extern int bit_pos_to_irq(int);
 
@@ -497,18 +394,16 @@
 
 		device_sysdata = kmalloc(sizeof(struct sn_device_sysdata),
 					 GFP_KERNEL);
+		if (device_sysdata <= 0) {
+			printk("sn_pci_fixup: Cannot allocate memory for device sysdata\n");
+			return;
+		}
+
 		device_sysdata->vhdl = devfn_to_vertex(device_dev->bus->number, device_dev->devfn);
 		device_sysdata->isa64 = 0;
-		device_vertex = device_sysdata->vhdl;
-
 		device_dev->sysdata = (void *) device_sysdata;
-		set_isPIC(device_sysdata);
+		set_pci_provider(device_sysdata);
 
-		/*
-		 * Set the xbridge Device(X) Write Buffer Flush and Xbow Flush 
-		 * register addresses.
-		 */
-		set_flush_addresses(device_dev, device_sysdata);
 		pci_read_config_word(device_dev, PCI_COMMAND, &cmd);
 
 		/*
@@ -517,22 +412,62 @@
 		 * read from the card and it was set in the card by our
 		 * Infrastructure ..
 		 */
+		vhdl = device_sysdata->vhdl;
+		/* Allocate the IORESOURCE_IO space first */
 		for (idx = 0; idx < PCI_ROM_RESOURCE; idx++) {
-			size = 0;
-			size = device_dev->resource[idx].end -
-				device_dev->resource[idx].start;
-			if (size) {
-				device_dev->resource[idx].start = (unsigned long)pciio_pio_addr(device_vertex, 0, PCIIO_SPACE_WIN(idx), 0, size, 0, (IS_PIC_DEVICE(device_dev)) ? 0 : PCIIO_BYTE_STREAM);
-				device_dev->resource[idx].start |= __IA64_UNCACHED_OFFSET;
-			}
-			else
-				continue;
+			unsigned long start, end, addr;
 
-			device_dev->resource[idx].end = 
-				device_dev->resource[idx].start + size;
+			if (!(device_dev->resource[idx].flags & IORESOURCE_IO))
+				continue; 
+			
+			start = device_dev->resource[idx].start;
+			end = device_dev->resource[idx].end;
+			size = end - start;
+			if (!size)
+				continue; 
+			
+			addr = (unsigned long)pciio_pio_addr(vhdl, 0, 
+					PCIIO_SPACE_WIN(idx), 0, size, 0, 0);
+			if (!addr) {
+				device_dev->resource[idx].start = 0;
+				device_dev->resource[idx].end = 0;
+				printk("sn_pci_fixup(): pio map failure for "
+				    "%s bar%d\n", device_dev->slot_name, idx);
+			} else {
+				addr |= __IA64_UNCACHED_OFFSET;
+				device_dev->resource[idx].start = addr;
+				device_dev->resource[idx].end = addr + size;
+			}	
 
-			if (device_dev->resource[idx].flags & IORESOURCE_IO)
-				cmd |= PCI_COMMAND_IO;
+			if (device_dev->resource[idx].flags & IORESOURCE_IO) 
+				cmd |= PCI_COMMAND_IO; 
+		} 
+
+		/* Allocate the IORESOURCE_MEM space next */
+		for (idx = 0; idx < PCI_ROM_RESOURCE; idx++) {
+			unsigned long start, end, addr;
+
+			if ((device_dev->resource[idx].flags & IORESOURCE_IO))
+				continue; 
+
+			start = device_dev->resource[idx].start;
+			end = device_dev->resource[idx].end;
+			size = end - start;
+			if (!size)
+				continue; 
+
+			addr = (unsigned long)pciio_pio_addr(vhdl, 0, 
+					PCIIO_SPACE_WIN(idx), 0, size, 0, 0);
+			if (!addr) {
+				device_dev->resource[idx].start = 0;
+				device_dev->resource[idx].end = 0;
+				printk("sn_pci_fixup(): pio map failure for "
+				    "%s bar%d\n", device_dev->slot_name, idx);
+			} else {
+				addr |= __IA64_UNCACHED_OFFSET;
+				device_dev->resource[idx].start = addr;
+				device_dev->resource[idx].end = addr + size;
+			}	
 
 			if (device_dev->resource[idx].flags & IORESOURCE_MEM)
 				cmd |= PCI_COMMAND_MEMORY;
@@ -544,17 +479,19 @@
 		cmd |= PCI_COMMAND_MASTER; /* If the device doesn't support */
 					   /* bit gets dropped .. no harm */
 		pci_write_config_word(device_dev, PCI_COMMAND, cmd);
-		
+
 		pci_read_config_byte(device_dev, PCI_INTERRUPT_PIN,
 				     (unsigned char *)&lines);
-	 
+		device_sysdata = (struct sn_device_sysdata *)device_dev->sysdata;
+		device_vertex = device_sysdata->vhdl;
+		pci_provider = device_sysdata->pci_provider;
+ 
 		irqpdaindr->curr = device_dev;
-		intr_handle = pcibr_intr_alloc(device_vertex, NULL, lines, device_vertex);
+		intr_handle = (pci_provider->intr_alloc)(device_vertex, NULL, lines, device_vertex);
 
 		irq = intr_handle->bi_irq;
 		irqpdaindr->device_dev[irq] = device_dev;
-		cpuid = intr_handle->bi_cpu;
-		pcibr_intr_connect(intr_handle, (intr_func_t)0, (intr_arg_t)0);
+		(pci_provider->intr_connect)(intr_handle, (intr_func_t)0, (intr_arg_t)0);
 		device_dev->irq = irq;
 		register_pcibr_intr(irq, intr_handle);
 
@@ -825,10 +762,8 @@
 				
 	devfs_hdl = hwgraph_path_to_vertex("hw/module");
 	for (i = 0; i < nummodules ; i++) {
-	    for ( j = 0; j < 3; j++ ) {
+	    for ( j = 0; j < 2; j++ ) {
 		if ( j == 0 )
-			brick_name = EDGE_LBL_PBRICK;
-		else if ( j == 1 )
 			brick_name = EDGE_LBL_PXBRICK;
 		else
 			brick_name = EDGE_LBL_IXBRICK;
@@ -867,8 +802,8 @@
 	int i = 0;
 	struct pci_controller *controller;
 
-	if (!ia64_platform_is("sn2"))
-	    return 0;
+	if (!ia64_platform_is("sn2") || IS_RUNNING_ON_SIMULATOR())
+		return 0;
 
 	/*
 	 * set pci_raw_ops, etc.
diff -Nru a/arch/ia64/sn/io/machvec/pci_dma.c b/arch/ia64/sn/io/machvec/pci_dma.c
--- a/arch/ia64/sn/io/machvec/pci_dma.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/sn/io/machvec/pci_dma.c	Tue Feb  3 19:45:17 2004
@@ -9,27 +9,8 @@
  * a description of how these routines should be used.
  */
 
-#include <linux/config.h>
-#include <linux/types.h>
-#include <linux/mm.h>
-#include <linux/string.h>
-#include <linux/pci.h>
-#include <linux/slab.h>
 #include <linux/module.h>
-
-#include <asm/delay.h>
-#include <asm/io.h>
-#include <asm/sn/sgi.h>
-#include <asm/sn/io.h>
-#include <asm/sn/invent.h>
-#include <asm/sn/hcl.h>
-#include <asm/sn/pci/pcibr.h>
-#include <asm/sn/pci/pcibr_private.h>
-#include <asm/sn/driver.h>
-#include <asm/sn/types.h>
-#include <asm/sn/alenlist.h>
 #include <asm/sn/pci/pci_bus_cvlink.h>
-#include <asm/sn/nag.h>
 
 /*
  * For ATE allocations
@@ -130,10 +111,7 @@
  *
  * This interface is usually used for "command" streams (e.g. the command
  * queue for a SCSI controller).  See Documentation/DMA-mapping.txt for
- * more information.  Note that this routine will always put a 32 bit
- * DMA address into @dma_handle.  This is because most devices
- * that are capable of 64 bit PCI DMA transactions can't do 64 bit _coherent_
- * DMAs, and unfortunately this interface has to cater to the LCD.  Oh well.
+ * more information.
  *
  * Also known as platform_pci_alloc_consistent() by the IA64 machvec code.
  */
@@ -146,11 +124,6 @@
 	unsigned long phys_addr;
 	pcibr_dmamap_t dma_map = 0;
 
-	*dma_handle = 0;
-
-	if (hwdev->dma_mask < 0xffffffffUL)
-		return NULL;
-
 	/*
 	 * Get hwgraph vertex for the device
 	 */
@@ -158,54 +131,48 @@
 	vhdl = device_sysdata->vhdl;
 
 	/*
-	 * Allocate the memory.  FIXME: if we're allocating for
-	 * two devices on the same bus, we should at least try to
-	 * allocate memory in the same 2 GB window to avoid using
-	 * ATEs for the translation.  See the comment above about the
-	 * 32 bit requirement for this function.
+	 * Allocate the memory.
+	 * FIXME: We should be doing alloc_pages_node for the node closest
+	 *        to the PCI device.
 	 */
-	if(!(cpuaddr = (void *)__get_free_pages(GFP_ATOMIC, get_order(size))))
+	if (!(cpuaddr = (void *)__get_free_pages(GFP_ATOMIC, get_order(size))))
 		return NULL;
 
 	/* physical addr. of the memory we just got */
 	phys_addr = __pa(cpuaddr);
 
 	/*
-	 * This will try to use a Direct Map register to do the
-	 * 32 bit DMA mapping, but it may not succeed if another
-	 * device on the same bus is already mapped with different
-	 * attributes or to a different memory region.
-	 */
-	*dma_handle = pcibr_dmatrans_addr(vhdl, NULL, phys_addr, size,
-			((IS_PIC_DEVICE(hwdev)) ? 0 : PCIIO_BYTE_STREAM) |
-					  PCIIO_DMA_CMD);
-
-        /*
-	 * If this device is in PCI-X mode, the system would have
-	 * automatically allocated a 64Bits DMA Address.  Error out if the 
-	 * device cannot support DAC.
-	 */
-	if (*dma_handle > hwdev->consistent_dma_mask) {
-		free_pages((unsigned long) cpuaddr, get_order(size));
-		return NULL;
+	 * 64 bit address translations should never fail.
+	 * 32 bit translations can fail if there are insufficient mapping
+	 *   resources and the direct map is already wired to a different
+	 *   2GB range.
+	 * 32 bit translations can also return a > 32 bit address, because
+	 *   pcibr_dmatrans_addr ignores a missing PCIIO_DMA_A64 flag on
+	 *   PCI-X buses.
+	 */
+	if (hwdev->consistent_dma_mask == ~0UL)
+		*dma_handle = pcibr_dmatrans_addr(vhdl, NULL, phys_addr, size,
+					  PCIIO_DMA_CMD | PCIIO_DMA_A64);
+	else {
+		dma_map = pcibr_dmamap_alloc(vhdl, NULL, size, PCIIO_DMA_CMD);
+		if (dma_map) {
+			*dma_handle = (dma_addr_t)
+				pcibr_dmamap_addr(dma_map, phys_addr, size);
+			dma_map->bd_dma_addr = *dma_handle;
+		}
+		else {
+			*dma_handle = pcibr_dmatrans_addr(vhdl, NULL, phys_addr, size,
+						  PCIIO_DMA_CMD);
+		}
 	}
 
-	/*
-	 * It is a 32 bit card and we cannot do direct mapping,
-	 * so we try to use an ATE.
-	 */
-	if (!(*dma_handle)) {
-		dma_map = pcibr_dmamap_alloc(vhdl, NULL, size,
-				((IS_PIC_DEVICE(hwdev)) ? 0 : PCIIO_BYTE_STREAM) |
-					     PCIIO_DMA_CMD);
-		if (!dma_map) {
-			printk(KERN_ERR "sn_pci_alloc_consistent: Unable to "
-			       "allocate anymore 32 bit page map entries.\n");
-			return 0;
+	if (!*dma_handle || *dma_handle > hwdev->consistent_dma_mask) {
+		if (dma_map) {
+			pcibr_dmamap_done(dma_map);
+			pcibr_dmamap_free(dma_map);
 		}
-		*dma_handle = (dma_addr_t) pcibr_dmamap_addr(dma_map,phys_addr,
-							     size);
-		dma_map->bd_dma_addr = *dma_handle;
+		free_pages((unsigned long) cpuaddr, get_order(size));
+		return NULL;
 	}
 
         return cpuaddr;
@@ -238,7 +205,6 @@
 	if (dma_map) {
 		pcibr_dmamap_done(dma_map);
 		pcibr_dmamap_free(dma_map);
-		dma_map->bd_dma_addr = 0;
 	}
 	free_pages((unsigned long) vaddr, get_order(size));
 }
@@ -288,9 +254,7 @@
 		if (IS_PCIA64(hwdev)) {
 			sg->dma_address = pcibr_dmatrans_addr(vhdl, NULL, phys_addr,
 						       sg->length,
-			       ((IS_PIC_DEVICE(hwdev)) ? 0 : PCIIO_BYTE_STREAM) |
-						       PCIIO_DMA_DATA |
-						       PCIIO_DMA_A64);
+						       PCIIO_DMA_DATA | PCIIO_DMA_A64);
 			sg->dma_length = sg->length;
 			continue;
 		}
@@ -300,9 +264,7 @@
 		 */
 		if (IS_PCI32G(hwdev)) {
 			sg->dma_address = pcibr_dmatrans_addr(vhdl, NULL, phys_addr,
-						       sg->length,
-					((IS_PIC_DEVICE(hwdev)) ? 0 : PCIIO_BYTE_STREAM) |
-						       PCIIO_DMA_DATA);
+						       sg->length, PCIIO_DMA_DATA);
 			sg->dma_length = sg->length;
 			/*
 			 * See if we got a direct map entry
@@ -317,9 +279,7 @@
 		 * It is a 32 bit card and we cannot do direct mapping,
 		 * so we use an ATE.
 		 */
-		dma_map = pcibr_dmamap_alloc(vhdl, NULL, sg->length,
-				((IS_PIC_DEVICE(hwdev)) ? 0 : PCIIO_BYTE_STREAM) |
-					     PCIIO_DMA_DATA);
+		dma_map = pcibr_dmamap_alloc(vhdl, NULL, sg->length, PCIIO_DMA_DATA);
 		if (!dma_map) {
 			printk(KERN_ERR "sn_pci_map_sg: Unable to allocate "
 			       "anymore 32 bit page map entries.\n");
@@ -369,7 +329,6 @@
         		if (dma_map) {
                 		pcibr_dmamap_done(dma_map);
                 		pcibr_dmamap_free(dma_map);
-                		dma_map->bd_dma_addr = 0;
 			}
         	}
 
@@ -390,7 +349,7 @@
  * the IA64 machvec code.
  *
  * We map this to the one step pcibr_dmamap_trans interface rather than
- * the two step pciio_dmamap_alloc/pciio_dmamap_addr because we have
+ * the two step pcibr_dmamap_alloc/pcibr_dmamap_addr because we have
  * no way of saving the dmamap handle from the alloc to later free
  * (which is pretty much unacceptable).
  *
@@ -429,9 +388,7 @@
 	if (IS_PCIA64(hwdev)) {
 		/* This device supports 64 bit DMA addresses. */
 		dma_addr = pcibr_dmatrans_addr(vhdl, NULL, phys_addr, size,
-		       ((IS_PIC_DEVICE(hwdev)) ? 0 : PCIIO_BYTE_STREAM) |
-					       PCIIO_DMA_DATA |
-					       PCIIO_DMA_A64);
+					       PCIIO_DMA_DATA | PCIIO_DMA_A64);
 		return dma_addr;
 	}
 
@@ -443,7 +400,6 @@
 	 */
 	if (IS_PCI32G(hwdev)) {
 		dma_addr = pcibr_dmatrans_addr(vhdl, NULL, phys_addr, size,
-			((IS_PIC_DEVICE(hwdev)) ? 0 : PCIIO_BYTE_STREAM) |
 					       PCIIO_DMA_DATA);
 		if (dma_addr)
 			return dma_addr;
@@ -454,9 +410,7 @@
 	 * let's use the PMU instead.
 	 */
 	dma_map = NULL;
-	dma_map = pcibr_dmamap_alloc(vhdl, NULL, size, 
-			((IS_PIC_DEVICE(hwdev)) ? 0 : PCIIO_BYTE_STREAM) |
-			PCIIO_DMA_DATA);
+	dma_map = pcibr_dmamap_alloc(vhdl, NULL, size, PCIIO_DMA_DATA);
 
 	if (!dma_map) {
 		printk(KERN_ERR "pci_map_single: Unable to allocate anymore "
@@ -500,7 +454,6 @@
 	if (dma_map) {
 		pcibr_dmamap_done(dma_map);
 		pcibr_dmamap_free(dma_map);
-		dma_map->bd_dma_addr = 0;
 	}
 }
 
diff -Nru a/arch/ia64/sn/io/platform_init/Makefile b/arch/ia64/sn/io/platform_init/Makefile
--- a/arch/ia64/sn/io/platform_init/Makefile	Tue Feb  3 19:45:33 2004
+++ b/arch/ia64/sn/io/platform_init/Makefile	Tue Feb  3 19:45:33 2004
@@ -7,6 +7,4 @@
 #
 # Makefile for the sn2 io routines.
 
-EXTRA_CFLAGS    := -DLITTLE_ENDIAN
-
-obj-y				+=  sgi_io_init.o irix_io_init.o
+obj-y				+=  sgi_io_init.o
diff -Nru a/arch/ia64/sn/io/platform_init/irix_io_init.c b/arch/ia64/sn/io/platform_init/irix_io_init.c
--- a/arch/ia64/sn/io/platform_init/irix_io_init.c	Tue Feb  3 19:45:18 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,88 +0,0 @@
-/* $Id$
- *
- * 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) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
- */
-
-#include <linux/types.h>
-#include <linux/config.h>
-#include <linux/slab.h>
-#include <asm/sn/sgi.h>
-#include <asm/sn/io.h>
-#include <asm/sn/sn_cpuid.h>
-#include <asm/sn/klconfig.h>
-#include <asm/sn/sn_private.h>
-#include <linux/smp.h>
-#include <asm/sn/simulator.h>
-
-extern void init_all_devices(void);
-extern void klhwg_add_all_modules(vertex_hdl_t);
-extern void klhwg_add_all_nodes(vertex_hdl_t);
-
-extern vertex_hdl_t hwgraph_root;
-extern void io_module_init(void);
-extern int pci_bus_to_hcl_cvlink(void);
-extern void mlreset(void);
-
-/* #define DEBUG_IO_INIT 1 */
-#ifdef DEBUG_IO_INIT
-#define DBG(x...) printk(x)
-#else
-#define DBG(x...)
-#endif /* DEBUG_IO_INIT */
-
-/*
- * This routine is responsible for the setup of all the IRIX hwgraph style
- * stuff that's been pulled into linux.  It's called by sn_pci_find_bios which
- * is called just before the generic Linux PCI layer does its probing (by 
- * platform_pci_fixup aka sn_pci_fixup).
- *
- * It is very IMPORTANT that this call is only made by the Master CPU!
- *
- */
-
-void
-irix_io_init(void)
-{
-	cnodeid_t cnode;
-
-	/*
-	 * This is the Master CPU.  Emulate mlsetup and main.c in Irix.
-	 */
-	mlreset();
-
-        /*
-         * Initialize platform-dependent vertices in the hwgraph:
-         *      module
-         *      node
-         *      cpu
-         *      memory
-         *      slot
-         *      hub
-         *      router
-         *      xbow
-         */
-
-        io_module_init(); /* Use to be called module_init() .. */
-        klhwg_add_all_modules(hwgraph_root);
-        klhwg_add_all_nodes(hwgraph_root);
-
-	for (cnode = 0; cnode < numnodes; cnode++) {
-		extern void per_hub_init(cnodeid_t);
-		per_hub_init(cnode);
-	}
-
-	/* We can do headless hub cnodes here .. */
-
-	/*
-	 *
-	 * Our IO Infrastructure drivers are in place .. 
-	 * Initialize the whole IO Infrastructure .. xwidget/device probes.
-	 *
-	 */
-	init_all_devices();
-	pci_bus_to_hcl_cvlink();
-}
diff -Nru a/arch/ia64/sn/io/platform_init/sgi_io_init.c b/arch/ia64/sn/io/platform_init/sgi_io_init.c
--- a/arch/ia64/sn/io/platform_init/sgi_io_init.c	Tue Feb  3 19:45:16 2004
+++ b/arch/ia64/sn/io/platform_init/sgi_io_init.c	Tue Feb  3 19:45:16 2004
@@ -17,19 +17,35 @@
 #include <asm/sn/sn_private.h>
 #include <asm/sn/pda.h>
 
+extern void init_all_devices(void);
+extern void klhwg_add_all_modules(vertex_hdl_t);
+extern void klhwg_add_all_nodes(vertex_hdl_t);
+
+extern int init_hcl(void);
+extern vertex_hdl_t hwgraph_root;
+extern void io_module_init(void);
+extern int pci_bus_to_hcl_cvlink(void);
+
+cpuid_t master_procid;
+nasid_t console_nasid = (nasid_t) - 1;
+char master_baseio_wid;
+
+nasid_t master_baseio_nasid;
+nasid_t master_nasid = INVALID_NASID;	/* This is the partition master nasid */
+
 /*
  * per_hub_init
  *
  * 	This code is executed once for each Hub chip.
  */
-void
+static void
 per_hub_init(cnodeid_t cnode)
 {
-	nasid_t		nasid;
-	nodepda_t	*npdap;
-	ii_icmr_u_t	ii_icmr;
-	ii_ibcr_u_t	ii_ibcr;
-	ii_ilcsr_u_t	ii_ilcsr;
+	nasid_t nasid;
+	nodepda_t *npdap;
+	ii_icmr_u_t ii_icmr;
+	ii_ibcr_u_t ii_ibcr;
+	ii_ilcsr_u_t ii_ilcsr;
 
 	nasid = COMPACT_TO_NASID_NODEID(cnode);
 
@@ -44,11 +60,11 @@
 	/*
 	 * Set the total number of CRBs that can be used.
 	 */
-	ii_icmr.ii_icmr_regval= 0x0;
+	ii_icmr.ii_icmr_regval = 0x0;
 	ii_icmr.ii_icmr_fld_s.i_c_cnt = 0xf;
-	if (enable_shub_wars_1_1() ) {
+	if (enable_shub_wars_1_1()) {
 		// Set bit one of ICMR to prevent II from sending interrupt for II bug.
-		ii_icmr.ii_icmr_regval |= 0x1; 
+		ii_icmr.ii_icmr_regval |= 0x1;
 	}
 	REMOTE_HUB_S(nasid, IIO_ICMR, ii_icmr.ii_icmr_regval);
 
@@ -56,25 +72,106 @@
 	 * Set the number of CRBs that both of the BTEs combined
 	 * can use minus 1.
 	 */
-	ii_ibcr.ii_ibcr_regval= 0x0;
+	ii_ibcr.ii_ibcr_regval = 0x0;
 	ii_ilcsr.ii_ilcsr_regval = REMOTE_HUB_L(nasid, IIO_LLP_CSR);
 	if (ii_ilcsr.ii_ilcsr_fld_s.i_llp_stat & LNK_STAT_WORKING) {
-	    ii_ibcr.ii_ibcr_fld_s.i_count = 0x8;
+		ii_ibcr.ii_ibcr_fld_s.i_count = 0x8;
 	} else {
-	    /*
-	     * if the LLP is down, there is no attached I/O, so
-	    * give BTE all the CRBs.
-	    */
-	    ii_ibcr.ii_ibcr_fld_s.i_count = 0x14;
+		/*
+		 * if the LLP is down, there is no attached I/O, so
+		 * give BTE all the CRBs.
+		 */
+		ii_ibcr.ii_ibcr_fld_s.i_count = 0x14;
 	}
 	REMOTE_HUB_S(nasid, IIO_IBCR, ii_ibcr.ii_ibcr_regval);
 
 	/*
 	 * Set CRB timeout to be 10ms.
 	 */
-	REMOTE_HUB_S(nasid, IIO_ICTP, 0xffffff );
+	REMOTE_HUB_S(nasid, IIO_ICTP, 0xffffff);
 	REMOTE_HUB_S(nasid, IIO_ICTO, 0xff);
 
 	/* Initialize error interrupts for this hub. */
 	hub_error_init(cnode);
+}
+
+/*
+ * This routine is responsible for the setup of all the IRIX hwgraph style
+ * stuff that's been pulled into linux.  It's called by sn_pci_find_bios which
+ * is called just before the generic Linux PCI layer does its probing (by 
+ * platform_pci_fixup aka sn_pci_fixup).
+ *
+ * It is very IMPORTANT that this call is only made by the Master CPU!
+ *
+ */
+
+void __init
+sgi_master_io_infr_init(void)
+{
+	cnodeid_t cnode;
+
+	if (init_hcl() < 0) {	/* Sets up the hwgraph compatibility layer */
+		printk("sgi_master_io_infr_init: Cannot init hcl\n");
+		return;
+	}
+
+	/*
+	 * Initialize platform-dependent vertices in the hwgraph:
+	 *      module
+	 *      node
+	 *      cpu
+	 *      memory
+	 *      slot
+	 *      hub
+	 *      router
+	 *      xbow
+	 */
+
+	io_module_init();	/* Use to be called module_init() .. */
+	klhwg_add_all_modules(hwgraph_root);
+	klhwg_add_all_nodes(hwgraph_root);
+
+	for (cnode = 0; cnode < numnodes; cnode++) {
+		extern void per_hub_init(cnodeid_t);
+		per_hub_init(cnode);
+	}
+
+	/*
+	 *
+	 * Our IO Infrastructure drivers are in place .. 
+	 * Initialize the whole IO Infrastructure .. xwidget/device probes.
+	 *
+	 */
+	init_all_devices();
+	pci_bus_to_hcl_cvlink();
+}
+
+inline int
+check_nasid_equiv(nasid_t nasida, nasid_t nasidb)
+{
+	if ((nasida == nasidb)
+	    || (nasida == NODEPDA(NASID_TO_COMPACT_NODEID(nasidb))->xbow_peer))
+		return 1;
+	else
+		return 0;
+}
+
+int
+is_master_baseio_nasid_widget(nasid_t test_nasid, xwidgetnum_t test_wid)
+{
+	/*
+	 * If the widget numbers are different, we're not the master.
+	 */
+	if (test_wid != (xwidgetnum_t) master_baseio_wid) {
+		return 0;
+	}
+
+	/*
+	 * If the NASIDs are the same or equivalent, we're the master.
+	 */
+	if (check_nasid_equiv(test_nasid, master_baseio_nasid)) {
+		return 1;
+	} else {
+		return 0;
+	}
 }
diff -Nru a/arch/ia64/sn/io/sgi_if.c b/arch/ia64/sn/io/sgi_if.c
--- a/arch/ia64/sn/io/sgi_if.c	Tue Feb  3 19:45:18 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,136 +0,0 @@
-/* $Id$
- *
- * 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) 1992-1997,2000-2003 Silicon Graphics, Inc. All rights reserved.
- */
-
-#include <linux/types.h>
-#include <linux/ctype.h>
-#include <linux/mm.h>
-#include <linux/slab.h>
-#include <asm/sn/sgi.h>
-#include <asm/sn/invent.h>
-#include <asm/sn/hcl.h>
-#include <asm/sn/labelcl.h>
-#include <asm/sn/pci/bridge.h>
-#include <asm/sn/ioerror_handling.h>
-#include <asm/sn/pci/pciio.h>
-#include <asm/sn/slotnum.h>
-
-void *
-snia_kmem_zalloc(size_t size, int flag)
-{
-        void *ptr = kmalloc(size, GFP_KERNEL);
-	if ( ptr )
-        	BZERO(ptr, size);
-        return(ptr);
-}
-
-void
-snia_kmem_free(void *ptr, size_t size)
-{
-        kfree(ptr);
-}
-
-/*
- * the alloc/free_node routines do a simple kmalloc for now ..
- */
-void *
-snia_kmem_alloc_node(register size_t size, register int flags, cnodeid_t node)
-{
-	/* someday will Allocate on node 'node' */
-	return(kmalloc(size, GFP_KERNEL));
-}
-
-void *
-snia_kmem_zalloc_node(register size_t size, register int flags, cnodeid_t node)
-{
-	void *ptr = kmalloc(size, GFP_KERNEL);
-	if ( ptr )
-		BZERO(ptr, size);
-        return(ptr);
-}
-
-
-/*
- * print_register() allows formatted printing of bit fields.  individual
- * bit fields are described by a struct reg_desc, multiple bit fields within
- * a single word can be described by multiple reg_desc structures.
- * %r outputs a string of the format "<bit field descriptions>"
- * %R outputs a string of the format "0x%x<bit field descriptions>"
- *
- * The fields in a reg_desc are:
- *	unsigned long long rd_mask; An appropriate mask to isolate the bit field
- *				within a word, and'ed with val
- *
- *	int rd_shift;		A shift amount to be done to the isolated
- *				bit field.  done before printing the isolate
- *				bit field with rd_format and before searching
- *				for symbolic value names in rd_values
- *
- *	char *rd_name;		If non-null, a bit field name to label any
- *				out from rd_format or searching rd_values.
- *				if neither rd_format or rd_values is non-null
- *				rd_name is printed only if the isolated
- *				bit field is non-null.
- *
- *	char *rd_format;	If non-null, the shifted bit field value
- *				is printed using this format.
- *
- *	struct reg_values *rd_values;	If non-null, a pointer to a table
- *				matching numeric values with symbolic names.
- *				rd_values are searched and the symbolic
- *				value is printed if a match is found, if no
- *				match is found "???" is printed.
- *				
- */
-
-void
-print_register(unsigned long long reg, struct reg_desc *addr)
-{
-	register struct reg_desc *rd;
-	register struct reg_values *rv;
-	unsigned long long field;
-	int any;
-
-	printk("<");
-	any = 0;
-	for (rd = addr; rd->rd_mask; rd++) {
-		field = reg & rd->rd_mask;
-		field = (rd->rd_shift > 0) ? field << rd->rd_shift : field >> -rd->rd_shift;
-		if (any && (rd->rd_format || rd->rd_values || (rd->rd_name && field)))
-			printk(",");
-		if (rd->rd_name) {
-			if (rd->rd_format || rd->rd_values || field) {
-				printk("%s", rd->rd_name);
-				any = 1;
-			}
-			if (rd->rd_format || rd->rd_values) {
-				printk("=");
-				any = 1;
-			}
-		}
-		/* You can have any format so long as it is %x */
-		if (rd->rd_format) {
-			printk("%llx", field);
-			any = 1;
-			if (rd->rd_values)
-				printk(":");
-		}
-		if (rd->rd_values) {
-			any = 1;
-			for (rv = rd->rd_values; rv->rv_name; rv++) {
-				if (field == rv->rv_value) {
-					printk("%s", rv->rv_name);
-					break;
-				}
-			}
-			if (rv->rv_name == NULL)
-				printk("???");
-		}
-	}
-	printk(">\n");
-}
diff -Nru a/arch/ia64/sn/io/sgi_io_sim.c b/arch/ia64/sn/io/sgi_io_sim.c
--- a/arch/ia64/sn/io/sgi_io_sim.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,79 +0,0 @@
-/* $Id$
- *
- * 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) 1992-1997,2000-2003 Silicon Graphics, Inc. All rights reserved.
- */
-
-#include <linux/config.h>
-#include <linux/types.h>
-#include <asm/sn/sgi.h>
-#include <asm/sn/sn_sal.h>
-#include <asm/sn/io.h>
-#include <asm/sn/sn_cpuid.h>
-#include <asm/sn/klconfig.h>
-#include <asm/sn/module.h>
-#include <asm/sn/sn_private.h>
-
-cpuid_t         master_procid;
-char arg_maxnodes[4];
-
-/*
- * Return non-zero if the given variable was specified
- */
-int
-is_specified(char *s)
-{
-        return (strlen(s) != 0);
-}
-
-/*
- * Routines provided by ml/SN/promif.c.
- */
-static __psunsigned_t master_bridge_base;
-nasid_t console_nasid = (nasid_t)-1;
-char master_baseio_wid;
-static char console_wid;
-static char console_pcislot;
-
-void
-set_master_bridge_base(void)
-{
-        console_wid = WIDGETID_GET(KL_CONFIG_CH_CONS_INFO(master_nasid)->memory_base);
-        console_pcislot = KL_CONFIG_CH_CONS_INFO(master_nasid)->npci;
-        master_bridge_base = (__psunsigned_t)NODE_SWIN_BASE(console_nasid, console_wid);
-	// FIXME("WARNING: set_master_bridge_base: NON NASID 0 DOES NOT WORK\n");
-}
-
-int
-check_nasid_equiv(nasid_t nasida, nasid_t nasidb)
-{
-        if ((nasida == nasidb) || (nasida == NODEPDA(NASID_TO_COMPACT_NODEID(nasidb))->xbow_peer))
-                return 1;
-        else
-                return 0;
-}
-
-int
-is_master_baseio_nasid_widget(nasid_t test_nasid, xwidgetnum_t test_wid)
-{
-	extern nasid_t master_baseio_nasid;
-
-        /*
-         * If the widget numbers are different, we're not the master.
-         */
-        if (test_wid != (xwidgetnum_t)master_baseio_wid) {
-                return 0;
-	}
-
-        /*
-         * If the NASIDs are the same or equivalent, we're the master.
-         */
-        if (check_nasid_equiv(test_nasid, master_baseio_nasid)) {
-                return 1;
-        } else {
-                return 0;
-        }
-}
diff -Nru a/arch/ia64/sn/io/sn2/Makefile b/arch/ia64/sn/io/sn2/Makefile
--- a/arch/ia64/sn/io/sn2/Makefile	Tue Feb  3 19:45:43 2004
+++ b/arch/ia64/sn/io/sn2/Makefile	Tue Feb  3 19:45:43 2004
@@ -9,8 +9,6 @@
 # Makefile for the sn2 specific io routines.
 #
 
-EXTRA_CFLAGS := -DLITTLE_ENDIAN
-
 obj-y += pcibr/ ml_SN_intr.o shub_intr.o shuberror.o shub.o bte_error.o \
 	 pic.o geo_op.o l1_command.o klconflib.o klgraph.o ml_SN_init.o \
 	 ml_iograph.o module.o pciio.o xbow.o xtalk.o shubio.o
diff -Nru a/arch/ia64/sn/io/sn2/bte_error.c b/arch/ia64/sn/io/sn2/bte_error.c
--- a/arch/ia64/sn/io/sn2/bte_error.c	Tue Feb  3 19:45:34 2004
+++ b/arch/ia64/sn/io/sn2/bte_error.c	Tue Feb  3 19:45:34 2004
@@ -1,35 +1,9 @@
 /*
- *
+ * 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) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of version 2 of the GNU General Public License 
- * as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it would be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
- * 
- * Further, this software is distributed without any warranty that it is 
- * free of the rightful claim of any third person regarding infringement 
- * or the like.  Any license provided herein, whether implied or 
- * otherwise, applies only to this software file.  Patent licenses, if 
- * any, provided herein do not apply to combinations of this program with 
- * other software, or any other product whatsoever.
- * 
- * You should have received a copy of the GNU General Public 
- * License along with this program; if not, write the Free Software 
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- * 
- * Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 
- * Mountain View, CA  94043, or:
- * 
- * http://www.sgi.com 
- * 
- * For further information regarding this notice, see: 
- * 
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan
  */
 
 
@@ -39,7 +13,6 @@
 #include <asm/sn/sgi.h>
 #include <asm/sn/io.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
 #include <asm/sn/sn_private.h>
@@ -89,36 +62,11 @@
 	 * in the bte handle structure for the thread excercising the
 	 * interface to consume.
 	 */
-	switch (ioe->ie_errortype) {
-	case IIO_ICRB_ECODE_PERR:
-		bte->bh_error = BTEFAIL_POISON;
-		break;
-	case IIO_ICRB_ECODE_WERR:
-		bte->bh_error = BTEFAIL_PROT;
-		break;
-	case IIO_ICRB_ECODE_AERR:
-		bte->bh_error = BTEFAIL_ACCESS;
-		break;
-	case IIO_ICRB_ECODE_TOUT:
-		bte->bh_error = BTEFAIL_TOUT;
-		break;
-	case IIO_ICRB_ECODE_XTERR:
-		bte->bh_error = BTEFAIL_XTERR;
-		break;
-	case IIO_ICRB_ECODE_DERR:
-		bte->bh_error = BTEFAIL_DIR;
-		break;
-	case IIO_ICRB_ECODE_PWERR:
-	case IIO_ICRB_ECODE_PRERR:
-		/* NO BREAK */
-	default:
-		bte->bh_error = BTEFAIL_ERROR;
-	}
-
+	bte->bh_error = ioe->ie_errortype + BTEFAIL_OFFSET;
 	bte->bte_error_count++;
 
-	BTE_PRINTK(("Got an error on cnode %d bte %d\n",
-		    bte->bte_cnode, bte->bte_num));
+	BTE_PRINTK(("Got an error on cnode %d bte %d: HW error type 0x%x\n",
+		    bte->bte_cnode, bte->bte_num, ioe->ie_errortype));
 	bte_error_handler((unsigned long) hinfo->h_nodepda);
 }
 
diff -Nru a/arch/ia64/sn/io/sn2/geo_op.c b/arch/ia64/sn/io/sn2/geo_op.c
--- a/arch/ia64/sn/io/sn2/geo_op.c	Tue Feb  3 19:45:30 2004
+++ b/arch/ia64/sn/io/sn2/geo_op.c	Tue Feb  3 19:45:30 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -29,7 +28,6 @@
 #include <asm/sn/types.h>
 #include <asm/sn/sgi.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
 #include <asm/sn/io.h>
diff -Nru a/arch/ia64/sn/io/sn2/klconflib.c b/arch/ia64/sn/io/sn2/klconflib.c
--- a/arch/ia64/sn/io/sn2/klconflib.c	Tue Feb  3 19:45:16 2004
+++ b/arch/ia64/sn/io/sn2/klconflib.c	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -15,7 +14,6 @@
 #include <asm/sn/io.h>
 #include <asm/sn/sn_cpuid.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
 #include <asm/sn/klconfig.h>
@@ -23,11 +21,9 @@
 #include <asm/sn/module.h>
 #include <asm/sn/router.h>
 #include <asm/sn/xtalk/xbow.h>
+#include <asm/sn/ksys/l1.h>
 
 
-#define LDEBUG 0
-#define NIC_UNKNOWN ((nic_t) -1)
-
 #undef DEBUG_KLGRAPH
 #ifdef DEBUG_KLGRAPH
 #define DBG(x...) printk(x)
@@ -35,11 +31,11 @@
 #define DBG(x...)
 #endif /* DEBUG_KLGRAPH */
 
-u64 klgraph_addr[MAX_COMPACT_NODES];
+lboard_t *root_lboard[MAX_COMPACT_NODES];
 static int hasmetarouter;
 
 
-char brick_types[MAX_BRICK_TYPES + 1] = "crikxdpn%#=012345";
+char brick_types[MAX_BRICK_TYPES + 1] = "crikxdpn%#=vo^34567890123456789...";
 
 lboard_t *
 find_lboard(lboard_t *start, unsigned char brd_type)
@@ -270,17 +266,11 @@
 				board_name = EDGE_LBL_PXBRICK;
 			else if (brd->brd_type == KLTYPE_IXBRICK)
 				board_name = EDGE_LBL_IXBRICK;
-			else if (brd->brd_type == KLTYPE_PBRICK)
-				board_name = EDGE_LBL_PBRICK;
-			else if (brd->brd_type == KLTYPE_IBRICK)
-				board_name = EDGE_LBL_IBRICK;
-			else if (brd->brd_type == KLTYPE_XBRICK)
-				board_name = EDGE_LBL_XBRICK;
-			else if (brd->brd_type == KLTYPE_PEBRICK)
-				board_name = EDGE_LBL_PEBRICK;
+			else if (brd->brd_type == KLTYPE_OPUSBRICK)
+				board_name = EDGE_LBL_OPUSBRICK;
 			else if (brd->brd_type == KLTYPE_CGBRICK)
 				board_name = EDGE_LBL_CGBRICK;
-			else
+			else 
 				board_name = EDGE_LBL_IOBRICK;
 			break;
 		default:
@@ -293,23 +283,6 @@
 	sprintf(path, EDGE_LBL_MODULE "/%s/" EDGE_LBL_SLAB "/%d/%s", buffer, geo_slab(brd->brd_geoid), board_name);
 }
 
-/*
- * Get the module number for a NASID.
- */
-moduleid_t
-get_module_id(nasid_t nasid)
-{
-	lboard_t *brd;
-
-	brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_SNIA);
-
-	if (!brd)
-		return INVALID_MODULE;
-	else
-		return geo_module(brd->brd_geoid);
-}
-
-
 #define MHZ	1000000
 
 
@@ -440,71 +413,24 @@
 		break;
 	}
 	case KLCLASS_IO: {	/* IO board */
-		if (KLTYPE(board->brd_type) == KLTYPE_TPU) {
-		/* Special case for TPU boards */
-			kltpu_t *tpu;	
+	     	klbri_t	*bridge;
 		
-			/* Get the tpu component information */
-			tpu = (kltpu_t *)find_first_component(board,
-						      KLSTRUCT_TPU);
-			/* If we don't have a tpu component on a tpu board
-			 * then we have a weird klconfig.
-			 */
-			if (!tpu)
-				return(1);
-			/* Get the serial number information from
-			 * the tpu's manufacturing nic info
-			 */
-			if (component_serial_number_get(board,
-						tpu->tpu_mfg_nic,
-						serial_number,
-						""))
-				return(1);
-			break;
-		} else  if ((KLTYPE(board->brd_type) == KLTYPE_GSN_A) ||
-		            (KLTYPE(board->brd_type) == KLTYPE_GSN_B)) {
-		/* Special case for GSN boards */
-			klgsn_t *gsn;	
-		
-			/* Get the gsn component information */
-			gsn = (klgsn_t *)find_first_component(board,
-			      ((KLTYPE(board->brd_type) == KLTYPE_GSN_A) ?
-					KLSTRUCT_GSN_A : KLSTRUCT_GSN_B));
-			/* If we don't have a gsn component on a gsn board
-			 * then we have a weird klconfig.
-			 */
-			if (!gsn)
-				return(1);
-			/* Get the serial number information from
-			 * the gsn's manufacturing nic info
-			 */
-			if (component_serial_number_get(board,
-						gsn->gsn_mfg_nic,
-						serial_number,
-						""))
-				return(1);
-			break;
-		} else {
-		     	klbri_t	*bridge;
-		
-			/* Get the bridge component information */
-			bridge = (klbri_t *)find_first_component(board,
+		/* Get the bridge component information */
+		bridge = (klbri_t *)find_first_component(board,
 							 KLSTRUCT_BRI);
-			/* If we don't have a bridge component on an IO board
-			 * then we have a weird klconfig.
-			 */
-			if (!bridge)
-				return(1);
-			/* Get the serial number information from
-		 	 * the bridge's manufacturing nic info
-			 */
-			if (component_serial_number_get(board,
-						bridge->bri_mfg_nic,
-						serial_number,
-						""))
-				return(1);
-			break;
-		}
+		/* If we don't have a bridge component on an IO board
+		 * then we have a weird klconfig.
+		 */
+		if (!bridge)
+			return(1);
+		/* Get the serial number information from
+	 	 * the bridge's manufacturing nic info
+		 */
+		if (component_serial_number_get(board,
+					bridge->bri_mfg_nic,
+					serial_number, ""))
+			return(1);
+		break;
 	}
 	case KLCLASS_ROUTER: {	/* Router board */
 		klrou_t *router;	
@@ -558,6 +484,23 @@
 
 /*
  * Format a module id for printing.
+ *
+ * There are three possible formats:
+ *
+ *   MODULE_FORMAT_BRIEF	is the brief 6-character format, including
+ *				the actual brick-type as recorded in the 
+ *				moduleid_t, eg. 002c15 for a C-brick, or
+ *				101#17 for a PX-brick.
+ *
+ *   MODULE_FORMAT_LONG		is the hwgraph format, eg. rack/002/bay/15
+ *				of rack/101/bay/17 (note that the brick
+ *				type does not appear in this format).
+ *
+ *   MODULE_FORMAT_LCD		is like MODULE_FORMAT_BRIEF, except that it
+ *				ensures that the module id provided appears
+ *				exactly as it would on the LCD display of
+ *				the corresponding brick, eg. still 002c15
+ *				for a C-brick, but 101p17 for a PX-brick.
  */
 void
 format_module_id(char *buffer, moduleid_t m, int fmt)
@@ -569,9 +512,25 @@
 	ASSERT(MODULE_GET_BTYPE(m) < MAX_BRICK_TYPES);
 	brickchar = MODULE_GET_BTCHAR(m);
 
+	if (fmt == MODULE_FORMAT_LCD) {
+	    /* Be sure we use the same brick type character as displayed
+	     * on the brick's LCD
+	     */
+	    switch (brickchar) 
+	    {
+	    case L1_BRICKTYPE_PX:
+		brickchar = L1_BRICKTYPE_P;
+		break;
+
+	    case L1_BRICKTYPE_IX:
+		brickchar = L1_BRICKTYPE_I;
+		break;
+	    }
+	}
+
 	position = MODULE_GET_BPOS(m);
 
-	if (fmt == MODULE_FORMAT_BRIEF) {
+	if ((fmt == MODULE_FORMAT_BRIEF) || (fmt == MODULE_FORMAT_LCD)) {
 	    /* Brief module number format, eg. 002c15 */
 
 	    /* Decompress the rack number */
@@ -685,4 +644,28 @@
 
 	/* avoid sign extending the moduleid_t */
 	return (int)(unsigned short)m;
+}
+
+int
+cbrick_type_get_nasid(nasid_t nasid)
+{
+	lboard_t *brd;
+	moduleid_t module;
+	uint type;
+	int t;
+
+	brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_SNIA);
+	module = geo_module(brd->brd_geoid);
+	type = (module & MODULE_BTYPE_MASK) >> MODULE_BTYPE_SHFT;
+	/* convert brick_type to lower case */
+	if ((type >= 'A') && (type <= 'Z'))
+		type = type - 'A' + 'a';
+    
+	/* convert to a module.h brick type */
+	for( t = 0; t < MAX_BRICK_TYPES; t++ ) {
+		if( brick_types[t] == type ) {
+			return t;
+		}
+	} 
+	return -1;
 }
diff -Nru a/arch/ia64/sn/io/sn2/klgraph.c b/arch/ia64/sn/io/sn2/klgraph.c
--- a/arch/ia64/sn/io/sn2/klgraph.c	Tue Feb  3 19:45:30 2004
+++ b/arch/ia64/sn/io/sn2/klgraph.c	Tue Feb  3 19:45:30 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -15,196 +14,26 @@
 
 #include <linux/types.h>
 #include <linux/slab.h>
+#include <linux/init.h>
 #include <asm/sn/sgi.h>
 #include <asm/sn/sn_sal.h>
-#include <asm/sn/io.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
-#include <asm/sn/labelcl.h>
-#include <asm/sn/kldir.h>
-#include <asm/sn/klconfig.h>
-#include <asm/sn/router.h>
-#include <asm/sn/xtalk/xbow.h>
 #include <asm/sn/hcl_util.h>
+#include <asm/sn/sn_private.h>
 
-// #define KLGRAPH_DEBUG 1
+/* #define KLGRAPH_DEBUG 1 */
 #ifdef KLGRAPH_DEBUG
 #define GRPRINTF(x)	printk x
-#define CE_GRPANIC	CE_PANIC
 #else
 #define GRPRINTF(x)
-#define CE_GRPANIC	CE_PANIC
 #endif
 
-#include <asm/sn/sn_private.h>
-
-extern char arg_maxnodes[];
-extern u64 klgraph_addr[];
 void mark_cpuvertex_as_cpu(vertex_hdl_t vhdl, cpuid_t cpuid);
 
 
-/*
- * Support for verbose inventory via hardware graph. 
- * klhwg_invent_alloc allocates the necessary size of inventory information
- * and fills in the generic information.
- */
-invent_generic_t *
-klhwg_invent_alloc(cnodeid_t cnode, int class, int size)
-{
-	invent_generic_t *invent;
-
-	invent = kern_malloc(size);
-	if (!invent) return NULL;
-	
-	invent->ig_module = NODE_MODULEID(cnode);
-	invent->ig_slot = SLOTNUM_GETSLOT(NODE_SLOTID(cnode));
-	invent->ig_invclass = class;
-
-	return invent;
-}
-
-/*
- * Add detailed disabled cpu inventory info to the hardware graph.
- */
-void
-klhwg_disabled_cpu_invent_info(vertex_hdl_t cpuv,
-                               cnodeid_t cnode,
-                               klcpu_t *cpu, slotid_t slot)
-{
-	invent_cpuinfo_t *cpu_invent;
-	diag_inv_t       *diag_invent;
-
-	cpu_invent = (invent_cpuinfo_t *)
-	klhwg_invent_alloc(cnode, INV_PROCESSOR, sizeof(invent_cpuinfo_t));
-	if (!cpu_invent)
-		return;
-
-	/* Diag information on this processor */
-	diag_invent = (diag_inv_t *)
-	klhwg_invent_alloc(cnode, INV_CPUDIAGVAL, sizeof(diag_inv_t));
-
-	if (!diag_invent)
-		return;
-
-
-	/* Disabled CPU */
-	cpu_invent->ic_gen.ig_flag = 0x0;
-	cpu_invent->ic_gen.ig_slot = slot;
-	cpu_invent->ic_cpu_info.cpuflavor = cpu->cpu_prid;
-	cpu_invent->ic_cpu_info.cpufq = cpu->cpu_speed;
-	cpu_invent->ic_cpu_info.sdfreq = cpu->cpu_scachespeed;
-
-	cpu_invent->ic_cpu_info.sdsize = cpu->cpu_scachesz;
-	cpu_invent->ic_cpuid = cpu->cpu_info.virtid;
-	cpu_invent->ic_slice = cpu->cpu_info.physid;
-
-	/* Disabled CPU label */
-	hwgraph_info_add_LBL(cpuv, INFO_LBL_DETAIL_INVENT,
-			(arbitrary_info_t) cpu_invent);
-	hwgraph_info_export_LBL(cpuv, INFO_LBL_DETAIL_INVENT,
-			sizeof(invent_cpuinfo_t));
-
-	/* Diagval label - stores reason for disable +{virt,phys}id +diagval*/
-	hwgraph_info_add_LBL(cpuv, INFO_LBL_DIAGVAL,
-			(arbitrary_info_t) diag_invent);
-
-	hwgraph_info_export_LBL(cpuv, INFO_LBL_DIAGVAL,
-			sizeof(diag_inv_t));
-}
-
-/*
- * Add detailed cpu inventory info to the hardware graph.
- */
-void
-klhwg_cpu_invent_info(vertex_hdl_t cpuv,
-			cnodeid_t cnode,
-			klcpu_t *cpu)
-{
-	invent_cpuinfo_t *cpu_invent;
-
-	cpu_invent = (invent_cpuinfo_t *)
-		klhwg_invent_alloc(cnode, INV_PROCESSOR, sizeof(invent_cpuinfo_t));
-	if (!cpu_invent)
-		return;
-
-	if (KLCONFIG_INFO_ENABLED((klinfo_t *)cpu))
-		cpu_invent->ic_gen.ig_flag = INVENT_ENABLED;
-	else
-		cpu_invent->ic_gen.ig_flag = 0x0;
-
-	cpu_invent->ic_cpu_info.cpuflavor = cpu->cpu_prid;
-	cpu_invent->ic_cpu_info.cpufq = cpu->cpu_speed;
-	cpu_invent->ic_cpu_info.sdfreq = cpu->cpu_scachespeed;
-
-	cpu_invent->ic_cpu_info.sdsize = cpu->cpu_scachesz;
-	cpu_invent->ic_cpuid = cpu->cpu_info.virtid;
-	cpu_invent->ic_slice = cpu_physical_id_to_slice(cpu->cpu_info.virtid);
-
-	hwgraph_info_add_LBL(cpuv, INFO_LBL_DETAIL_INVENT,
-			(arbitrary_info_t) cpu_invent);
-	hwgraph_info_export_LBL(cpuv, INFO_LBL_DETAIL_INVENT,
-			sizeof(invent_cpuinfo_t));
-}
-
-/* 
- * Add information about the baseio prom version number
- * as a part of detailed inventory info in the hwgraph.
- */
-void
-klhwg_baseio_inventory_add(vertex_hdl_t baseio_vhdl,cnodeid_t cnode)
-{
-	invent_miscinfo_t	*baseio_inventory;
-	unsigned char		version = 0,revision = 0;
-
-	/* Allocate memory for the "detailed inventory" info
-	 * for the baseio
-	 */
-	baseio_inventory = (invent_miscinfo_t *) 
-		klhwg_invent_alloc(cnode, INV_PROM, sizeof(invent_miscinfo_t));
-	baseio_inventory->im_type = INV_IO6PROM;
-	/* Store the revision info  in the inventory */
-	baseio_inventory->im_version = version;
-	baseio_inventory->im_rev = revision;
-	/* Put the inventory info in the hardware graph */
-	hwgraph_info_add_LBL(baseio_vhdl, INFO_LBL_DETAIL_INVENT, 
-			     (arbitrary_info_t) baseio_inventory);
-	/* Make the information available to the user programs
-	 * thru hwgfs.
-	 */
-        hwgraph_info_export_LBL(baseio_vhdl, INFO_LBL_DETAIL_INVENT,
-				sizeof(invent_miscinfo_t));
-}
-
-/*
- * Add detailed cpu inventory info to the hardware graph.
- */
-void
-klhwg_hub_invent_info(vertex_hdl_t hubv,
-		      cnodeid_t cnode, 
-		      klhub_t *hub)
-{
-	invent_miscinfo_t *hub_invent;
-
-	hub_invent = (invent_miscinfo_t *) 
-	    klhwg_invent_alloc(cnode, INV_MISC, sizeof(invent_miscinfo_t));
-	if (!hub_invent)
-	    return;
-
-	if (KLCONFIG_INFO_ENABLED((klinfo_t *)hub))
-	    hub_invent->im_gen.ig_flag = INVENT_ENABLED;
-
-	hub_invent->im_type = INV_HUB;
-	hub_invent->im_rev = hub->hub_info.revision;
-	hub_invent->im_speed = hub->hub_speed;
-	hwgraph_info_add_LBL(hubv, INFO_LBL_DETAIL_INVENT, 
-			     (arbitrary_info_t) hub_invent);
-        hwgraph_info_export_LBL(hubv, INFO_LBL_DETAIL_INVENT,
-				sizeof(invent_miscinfo_t));
-}
-
 /* ARGSUSED */
-void
+static void __init
 klhwg_add_hub(vertex_hdl_t node_vertex, klhub_t *hub, cnodeid_t cnode)
 {
 	vertex_hdl_t myhubv;
@@ -212,18 +41,23 @@
 	int rc;
 	extern struct file_operations shub_mon_fops;
 
-	GRPRINTF(("klhwg_add_hub: adding %s\n", EDGE_LBL_HUB));
-	(void) hwgraph_path_add(node_vertex, EDGE_LBL_HUB, &myhubv);
+	hwgraph_path_add(node_vertex, EDGE_LBL_HUB, &myhubv);
+
+	HWGRAPH_DEBUG((__FILE__, __FUNCTION__,__LINE__, myhubv, NULL, "Created path for hub vertex for Shub node.\n"));
+
 	rc = device_master_set(myhubv, node_vertex);
+	if (rc) {
+		printk("klhwg_add_hub: Unable to create hub vertex.\n");
+		return;
+	}
 	hub_mon = hwgraph_register(myhubv, EDGE_LBL_PERFMON,
-		0, 0,
-		0, 0,
+		0, 0, 0, 0,
 		S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP, 0, 0,
 		&shub_mon_fops, (void *)(long)cnode);
 }
 
 /* ARGSUSED */
-void
+static void __init
 klhwg_add_disabled_cpu(vertex_hdl_t node_vertex, cnodeid_t cnode, klcpu_t *cpu, slotid_t slot)
 {
         vertex_hdl_t my_cpu;
@@ -234,19 +68,19 @@
 	nasid = COMPACT_TO_NASID_NODEID(cnode);
         cpu_id = nasid_slice_to_cpuid(nasid, cpu->cpu_info.physid);
         if(cpu_id != -1){
-		sprintf(name, "%s/%s/%c", EDGE_LBL_DISABLED, EDGE_LBL_CPU, 'a' + cpu->cpu_info.physid);
+		snprintf(name, 120, "%s/%s/%c", EDGE_LBL_DISABLED, EDGE_LBL_CPU, 'a' + cpu->cpu_info.physid);
 		(void) hwgraph_path_add(node_vertex, name, &my_cpu);
 
+		HWGRAPH_DEBUG((__FILE__, __FUNCTION__,__LINE__, my_cpu, NULL, "Created path for disabled cpu slice.\n"));
+
 		mark_cpuvertex_as_cpu(my_cpu, cpu_id);
 		device_master_set(my_cpu, node_vertex);
-
-		klhwg_disabled_cpu_invent_info(my_cpu, cnode, cpu, slot);
 		return;
         }
 }
 
 /* ARGSUSED */
-void
+static void __init
 klhwg_add_cpu(vertex_hdl_t node_vertex, cnodeid_t cnode, klcpu_t *cpu)
 {
         vertex_hdl_t my_cpu, cpu_dir;
@@ -257,27 +91,28 @@
 	nasid = COMPACT_TO_NASID_NODEID(cnode);
         cpu_id = nasid_slice_to_cpuid(nasid, cpu->cpu_info.physid);
 
-        sprintf(name, "%s/%d/%c",
+        snprintf(name, 120, "%s/%d/%c",
                 EDGE_LBL_CPUBUS,
                 0,
                 'a' + cpu->cpu_info.physid);
 
-        GRPRINTF(("klhwg_add_cpu: adding %s to vertex 0x%p\n", name, node_vertex));
         (void) hwgraph_path_add(node_vertex, name, &my_cpu);
-        mark_cpuvertex_as_cpu(my_cpu, cpu_id);
+
+	HWGRAPH_DEBUG((__FILE__, __FUNCTION__,__LINE__, my_cpu, NULL, "Created path for active cpu slice.\n"));
+
+	mark_cpuvertex_as_cpu(my_cpu, cpu_id);
         device_master_set(my_cpu, node_vertex);
 
         /* Add an alias under the node's CPU directory */
         if (hwgraph_edge_get(node_vertex, EDGE_LBL_CPU, &cpu_dir) == GRAPH_SUCCESS) {
-                sprintf(name, "%c", 'a' + cpu->cpu_info.physid);
+                snprintf(name, 120, "%c", 'a' + cpu->cpu_info.physid);
                 (void) hwgraph_edge_add(cpu_dir, my_cpu, name);
+		HWGRAPH_DEBUG((__FILE__, __FUNCTION__,__LINE__, cpu_dir, my_cpu, "Created % from vhdl1 to vhdl2.\n", name));
         }
-
-        klhwg_cpu_invent_info(my_cpu, cnode, cpu);
 }
 
 
-void
+static void __init
 klhwg_add_xbow(cnodeid_t cnode, nasid_t nasid)
 {
 	lboard_t *brd;
@@ -295,9 +130,6 @@
 	if (KL_CONFIG_DUPLICATE_BOARD(brd))
 	    return;
 
-	GRPRINTF(("klhwg_add_xbow: adding cnode %d nasid %d xbow edges\n",
-			cnode, nasid));
-
 	if ((xbow_p = (klxbow_t *)find_component(brd, NULL, KLSTRUCT_XBOW))
 	    == NULL)
 	    return;
@@ -314,7 +146,7 @@
 
 		hub_cnode = NASID_TO_COMPACT_NODEID(hub_nasid);
 
-		if (is_specified(arg_maxnodes) && hub_cnode == INVALID_CNODEID) {
+		if (hub_cnode == INVALID_CNODEID) {
 			continue;
 		}
 			
@@ -326,11 +158,15 @@
                                 printk(KERN_WARNING  "klhwg_add_xbow: Check for "
                                         "working routers and router links!");
 
-                        PRINT_PANIC("klhwg_add_xbow: Failed to add "
+                        printk("klhwg_add_xbow: Failed to add "
                                 "edge: vertex 0x%p to vertex 0x%p,"
                                 "error %d\n",
                                 (void *)hubv, (void *)xbow_v, err);
+			return;
                 }
+
+		HWGRAPH_DEBUG((__FILE__, __FUNCTION__, __LINE__, xbow_v, NULL, "Created path for xtalk.\n"));
+
 		xswitch_vertex_init(xbow_v); 
 
 		NODEPDA(hub_cnode)->xbow_vhdl = xbow_v;
@@ -344,15 +180,12 @@
 			NODEPDA(NASID_TO_COMPACT_NODEID(nasid))->xbow_peer =
 				hub_nasid;
 		}
-
-		GRPRINTF(("klhwg_add_xbow: adding port nasid %d %s to vertex 0x%p\n",
-			hub_nasid, EDGE_LBL_XTALK, hubv));
 	}
 }
 
 
 /* ARGSUSED */
-void
+static void __init
 klhwg_add_node(vertex_hdl_t hwgraph_root, cnodeid_t cnode)
 {
 	nasid_t nasid;
@@ -364,98 +197,78 @@
 	char *s;
 	int board_disabled = 0;
 	klcpu_t *cpu;
+	vertex_hdl_t cpu_dir;
 
 	nasid = COMPACT_TO_NASID_NODEID(cnode);
 	brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_SNIA);
-	GRPRINTF(("klhwg_add_node: Adding cnode %d, nasid %d, brd 0x%p\n",
-                cnode, nasid, brd));
 	ASSERT(brd);
 
-	do {
-		vertex_hdl_t cpu_dir;
-
-		/* Generate a hardware graph path for this board. */
-		board_to_path(brd, path_buffer);
-
-		GRPRINTF(("klhwg_add_node: adding %s to vertex 0x%p\n",
-			path_buffer, hwgraph_root));
-		rv = hwgraph_path_add(hwgraph_root, path_buffer, &node_vertex);
-
-		if (rv != GRAPH_SUCCESS)
-			PRINT_PANIC("Node vertex creation failed.  "
-					  "Path == %s",
-				path_buffer);
+	/* Generate a hardware graph path for this board. */
+	board_to_path(brd, path_buffer);
+	rv = hwgraph_path_add(hwgraph_root, path_buffer, &node_vertex);
+	if (rv != GRAPH_SUCCESS) {
+		printk("Node vertex creation failed.  Path == %s", path_buffer);
+		return;
+	}
 
-		hub = (klhub_t *)find_first_component(brd, KLSTRUCT_HUB);
-		ASSERT(hub);
-		if(hub->hub_info.flags & KLINFO_ENABLE)
-			board_disabled = 0;
-		else
-			board_disabled = 1;
+	HWGRAPH_DEBUG((__FILE__, __FUNCTION__, __LINE__, node_vertex, NULL, "Created path for SHUB node.\n"));
+	hub = (klhub_t *)find_first_component(brd, KLSTRUCT_HUB);
+	ASSERT(hub);
+	if(hub->hub_info.flags & KLINFO_ENABLE)
+		board_disabled = 0;
+	else
+		board_disabled = 1;
 		
-		if(!board_disabled) {
-			mark_nodevertex_as_node(node_vertex,
-					    cnode + board_disabled * numnodes);
-
-			s = dev_to_name(node_vertex, path_buffer, sizeof(path_buffer));
-			NODEPDA(cnode)->hwg_node_name =
-						kmalloc(strlen(s) + 1,
-						GFP_KERNEL);
-			ASSERT_ALWAYS(NODEPDA(cnode)->hwg_node_name != NULL);
-			strcpy(NODEPDA(cnode)->hwg_node_name, s);
-
-			hubinfo_set(node_vertex, NODEPDA(cnode)->pdinfo);
-
-			/* Set up node board's slot */
-			NODEPDA(cnode)->slotdesc = brd->brd_slot;
-
-			/* Set up the module we're in */
-			NODEPDA(cnode)->geoid = brd->brd_geoid;
-			NODEPDA(cnode)->module = module_lookup(geo_module(brd->brd_geoid));
+	if(!board_disabled) {
+		mark_nodevertex_as_node(node_vertex, cnode);
+		s = dev_to_name(node_vertex, path_buffer, sizeof(path_buffer));
+		NODEPDA(cnode)->hwg_node_name =
+					kmalloc(strlen(s) + 1, GFP_KERNEL);
+		if (NODEPDA(cnode)->hwg_node_name <= 0) {
+			printk("%s: no memory\n", __FUNCTION__);
+			return;
 		}
+		strcpy(NODEPDA(cnode)->hwg_node_name, s);
+		hubinfo_set(node_vertex, NODEPDA(cnode)->pdinfo);
+		NODEPDA(cnode)->slotdesc = brd->brd_slot;
+		NODEPDA(cnode)->geoid = brd->brd_geoid;
+		NODEPDA(cnode)->module = module_lookup(geo_module(brd->brd_geoid));
+		klhwg_add_hub(node_vertex, hub, cnode);
+	}
 
-		/* Get the first CPU structure */
-		cpu = (klcpu_t *)find_first_component(brd, KLSTRUCT_CPU);
+	/*
+	 * If there's at least 1 CPU, add a "cpu" directory to represent
+	 * the collection of all CPUs attached to this node.
+	 */
+	cpu = (klcpu_t *)find_first_component(brd, KLSTRUCT_CPU);
+	if (cpu) {
+		graph_error_t rv;
+
+		rv = hwgraph_path_add(node_vertex, EDGE_LBL_CPU, &cpu_dir);
+		if (rv != GRAPH_SUCCESS) {
+			printk("klhwg_add_node: Cannot create CPU directory\n");
+			return;
+		}
+		HWGRAPH_DEBUG((__FILE__, __FUNCTION__, __LINE__, cpu_dir, NULL, "Created cpu directiry on SHUB node.\n"));
 
-		/*
-		* If there's at least 1 CPU, add a "cpu" directory to represent
-		* the collection of all CPUs attached to this node.
-		*/
-		if (cpu) {
-			graph_error_t rv;
-
-			rv = hwgraph_path_add(node_vertex, EDGE_LBL_CPU, &cpu_dir);
-			if (rv != GRAPH_SUCCESS)
-				panic("klhwg_add_node: Cannot create CPU directory\n");
-		}
-
-		/* Add each CPU */
-		while (cpu) {
-			cpuid_t cpu_id;
-			cpu_id = nasid_slice_to_cpuid(nasid,cpu->cpu_info.physid);
-			if (cpu_online(cpu_id))
-				klhwg_add_cpu(node_vertex, cnode, cpu);
-			else
-				klhwg_add_disabled_cpu(node_vertex, cnode, cpu, brd->brd_slot);
-
-			cpu = (klcpu_t *)
-				find_component(brd, (klinfo_t *)cpu, KLSTRUCT_CPU);
-		} /* while */
+	}
 
-		if(!board_disabled)
-			klhwg_add_hub(node_vertex, hub, cnode);
-		
-		brd = KLCF_NEXT(brd);
-		if (brd)
-			brd = find_lboard(brd, KLTYPE_SNIA);
+	while (cpu) {
+		cpuid_t cpu_id;
+		cpu_id = nasid_slice_to_cpuid(nasid,cpu->cpu_info.physid);
+		if (cpu_online(cpu_id))
+			klhwg_add_cpu(node_vertex, cnode, cpu);
 		else
-			break;
-	} while(brd);
+			klhwg_add_disabled_cpu(node_vertex, cnode, cpu, brd->brd_slot);
+
+		cpu = (klcpu_t *)
+			find_component(brd, (klinfo_t *)cpu, KLSTRUCT_CPU);
+	}
 }
 
 
 /* ARGSUSED */
-void
+static void __init
 klhwg_add_all_routers(vertex_hdl_t hwgraph_root)
 {
 	nasid_t nasid;
@@ -467,10 +280,6 @@
 
 	for (cnode = 0; cnode < numnodes; cnode++) {
 		nasid = COMPACT_TO_NASID_NODEID(cnode);
-
-		GRPRINTF(("klhwg_add_all_routers: adding router on cnode %d\n",
-			cnode));
-
 		brd = find_lboard_class((lboard_t *)KL_CONFIG_INFO(nasid),
 				KLTYPE_ROUTER);
 
@@ -480,41 +289,32 @@
 
 		do {
 			ASSERT(brd);
-			GRPRINTF(("Router board struct is %p\n", brd));
 
 			/* Don't add duplicate boards. */
 			if (brd->brd_flags & DUPLICATE_BOARD)
 				continue;
 
-			GRPRINTF(("Router 0x%p module number is %d\n", brd, brd->brd_geoid));
 			/* Generate a hardware graph path for this board. */
 			board_to_path(brd, path_buffer);
 
-			GRPRINTF(("Router path is %s\n", path_buffer));
-
 			/* Add the router */
-			GRPRINTF(("klhwg_add_all_routers: adding %s to vertex 0x%p\n",
-				path_buffer, hwgraph_root));
 			rv = hwgraph_path_add(hwgraph_root, path_buffer, &node_vertex);
+			if (rv != GRAPH_SUCCESS) {
+				printk("Router vertex creation "
+						  "failed.  Path == %s", path_buffer);
+				return;
+			}
+			HWGRAPH_DEBUG((__FILE__, __FUNCTION__, __LINE__, node_vertex, NULL, "Created router path.\n"));
 
-			if (rv != GRAPH_SUCCESS)
-				PRINT_PANIC("Router vertex creation "
-						  "failed.  Path == %s",
-					path_buffer);
-
-			GRPRINTF(("klhwg_add_all_routers: get next board from 0x%p\n",
-					brd));
 		/* Find the rest of the routers stored on this node. */
 		} while ( (brd = find_lboard_class(KLCF_NEXT(brd),
 			 KLTYPE_ROUTER)) );
-
-		GRPRINTF(("klhwg_add_all_routers: Done.\n"));
 	}
 
 }
 
 /* ARGSUSED */
-void
+static void __init
 klhwg_connect_one_router(vertex_hdl_t hwgraph_root, lboard_t *brd,
 			 cnodeid_t cnode, nasid_t nasid)
 {
@@ -527,13 +327,8 @@
 	int port;
 	lboard_t *dest_brd;
 
-	GRPRINTF(("klhwg_connect_one_router: Connecting router on cnode %d\n",
-			cnode));
-
 	/* Don't add duplicate boards. */
 	if (brd->brd_flags & DUPLICATE_BOARD) {
-		GRPRINTF(("klhwg_connect_one_router: Duplicate router 0x%p on cnode %d\n",
-			brd, cnode));
 		return;
 	}
 
@@ -542,7 +337,7 @@
 
 	rc = hwgraph_traverse(hwgraph_root, path_buffer, &router_hndl);
 
-	if (rc != GRAPH_SUCCESS && is_specified(arg_maxnodes))
+	if (rc != GRAPH_SUCCESS)
 			return;
 
 	if (rc != GRAPH_SUCCESS)
@@ -550,7 +345,7 @@
 
 	/* We don't know what to do with multiple router components */
 	if (brd->brd_numcompts != 1) {
-		PRINT_PANIC("klhwg_connect_one_router: %d cmpts on router\n",
+		printk("klhwg_connect_one_router: %d cmpts on router\n",
 			brd->brd_numcompts);
 		return;
 	}
@@ -567,7 +362,7 @@
 				 port));
 			continue;
 		}
-		if (is_specified(arg_maxnodes) && NASID_TO_COMPACT_NODEID(router->rou_port[port].port_nasid) 
+		if (NASID_TO_COMPACT_NODEID(router->rou_port[port].port_nasid) 
 		    == INVALID_CNODEID) {
 			continue;
 		}
@@ -582,12 +377,11 @@
 		rc = hwgraph_traverse(hwgraph_root, dest_path, &dest_hndl);
 
 		if (rc != GRAPH_SUCCESS) {
-			if (is_specified(arg_maxnodes) && KL_CONFIG_DUPLICATE_BOARD(dest_brd))
+			if (KL_CONFIG_DUPLICATE_BOARD(dest_brd))
 				continue;
-			PRINT_PANIC("Can't find router: %s", dest_path);
+			printk("Can't find router: %s", dest_path);
+			return;
 		}
-		GRPRINTF(("klhwg_connect_one_router: Link from %s/%d to %s\n",
-			  path_buffer, port, dest_path));
 
 		sprintf(dest_path, "%d", port);
 
@@ -600,15 +394,18 @@
 			continue;
 		}
 
-		if (rc != GRAPH_SUCCESS && !is_specified(arg_maxnodes))
-			PRINT_PANIC("Can't create edge: %s/%s to vertex 0x%p error 0x%x\n",
+		if (rc != GRAPH_SUCCESS) {
+			printk("Can't create edge: %s/%s to vertex 0x%p error 0x%x\n",
 				path_buffer, dest_path, (void *)dest_hndl, rc);
+			return;
+		}
+		HWGRAPH_DEBUG((__FILE__, __FUNCTION__, __LINE__, router_hndl, dest_hndl, "Created edge %s from vhdl1 to vhdl2.\n", dest_path));
 		
 	}
 }
 
 
-void
+static void __init
 klhwg_connect_routers(vertex_hdl_t hwgraph_root)
 {
 	nasid_t nasid;
@@ -617,10 +414,6 @@
 
 	for (cnode = 0; cnode < numnodes; cnode++) {
 		nasid = COMPACT_TO_NASID_NODEID(cnode);
-
-		GRPRINTF(("klhwg_connect_routers: Connecting routers on cnode %d\n",
-			cnode));
-
 		brd = find_lboard_class((lboard_t *)KL_CONFIG_INFO(nasid),
 				KLTYPE_ROUTER);
 
@@ -641,7 +434,7 @@
 
 
 
-void
+static void __init
 klhwg_connect_hubs(vertex_hdl_t hwgraph_root)
 {
 	nasid_t nasid;
@@ -656,12 +449,9 @@
 	graph_error_t rc;
 	int port;
 
-	for (cnode = 0; cnode < numnodes; cnode++) {
+	for (cnode = 0; cnode < numionodes; cnode++) {
 		nasid = COMPACT_TO_NASID_NODEID(cnode);
 
-		GRPRINTF(("klhwg_connect_hubs: Connecting hubs on cnode %d\n",
-			cnode));
-
 		brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_SNIA);
 		ASSERT(brd);
 
@@ -669,19 +459,15 @@
 		ASSERT(hub);
 
 		for (port = 1; port <= MAX_NI_PORTS; port++) {
-			/* See if the port's active */
 			if (hub->hub_port[port].port_nasid == INVALID_NASID) {
-				GRPRINTF(("klhwg_connect_hubs: port inactive.\n"));
-				continue;
+				continue; /* Port not active */
 			}
 
-			if (is_specified(arg_maxnodes) && NASID_TO_COMPACT_NODEID(hub->hub_port[port].port_nasid) == INVALID_CNODEID)
+			if (NASID_TO_COMPACT_NODEID(hub->hub_port[port].port_nasid) == INVALID_CNODEID)
 				continue;
 
 			/* Generate a hardware graph path for this board. */
 			board_to_path(brd, path_buffer);
-
-			GRPRINTF(("klhwg_connect_hubs: Hub path is %s.\n", path_buffer));
 			rc = hwgraph_traverse(hwgraph_root, path_buffer, &hub_hndl);
 
 			if (rc != GRAPH_SUCCESS)
@@ -697,26 +483,29 @@
 			rc = hwgraph_traverse(hwgraph_root, dest_path, &dest_hndl);
 
 			if (rc != GRAPH_SUCCESS) {
-				if (is_specified(arg_maxnodes) && KL_CONFIG_DUPLICATE_BOARD(dest_brd))
+				if (KL_CONFIG_DUPLICATE_BOARD(dest_brd))
 					continue;
-				PRINT_PANIC("Can't find board: %s", dest_path);
+				printk("Can't find board: %s", dest_path);
+				return;
 			} else {
 				char buf[1024];
-		
-
-				GRPRINTF(("klhwg_connect_hubs: Link from %s to %s.\n",
-			  	path_buffer, dest_path));
 
 				rc = hwgraph_path_add(hub_hndl, EDGE_LBL_INTERCONNECT, &hub_hndl);
+
+				HWGRAPH_DEBUG((__FILE__, __FUNCTION__, __LINE__, hub_hndl, NULL, "Created link path.\n"));
+
 				sprintf(buf,"%s/%s",path_buffer,EDGE_LBL_INTERCONNECT);
 				rc = hwgraph_traverse(hwgraph_root, buf, &hub_hndl);
 				sprintf(buf,"%d",port);
 				rc = hwgraph_edge_add(hub_hndl, dest_hndl, buf);
 
-				if (rc != GRAPH_SUCCESS)
-					PRINT_PANIC("Can't create edge: %s/%s to vertex 0x%p, error 0x%x\n",
-					path_buffer, dest_path, (void *)dest_hndl, rc);
+				HWGRAPH_DEBUG((__FILE__, __FUNCTION__, __LINE__, hub_hndl, dest_hndl, "Created edge %s from vhdl1 to vhdl2.\n", buf));
 
+				if (rc != GRAPH_SUCCESS) {
+					printk("Can't create edge: %s/%s to vertex 0x%p, error 0x%x\n",
+							path_buffer, dest_path, (void *)dest_hndl, rc);
+					return;
+				}
 			}
 		}
 	}
@@ -726,7 +515,7 @@
  * hints which can later be used by the drivers using the device/driver
  * admin interface. 
  */
-void
+static void __init
 klhwg_device_disable_hints_add(void)
 {
 	cnodeid_t	cnode; 		/* node we are looking at */
@@ -785,7 +574,7 @@
 	}
 }
 
-void
+void __init
 klhwg_add_all_modules(vertex_hdl_t hwgraph_root)
 {
 	cmoduleid_t	cm;
@@ -807,6 +596,7 @@
 		rc = hwgraph_path_add(hwgraph_root, name, &module_vhdl);
 		ASSERT(rc == GRAPH_SUCCESS);
 		rc = rc;
+		HWGRAPH_DEBUG((__FILE__, __FUNCTION__, __LINE__, module_vhdl, NULL, "Created module path.\n"));
 
 		hwgraph_fastinfo_set(module_vhdl, (arbitrary_info_t) modules[cm]);
 
@@ -818,24 +608,24 @@
 		rc = hwgraph_path_add(hwgraph_root, name, &vhdl);
 		ASSERT_ALWAYS(rc == GRAPH_SUCCESS); 
 		rc = rc;
+		HWGRAPH_DEBUG((__FILE__, __FUNCTION__, __LINE__, vhdl, NULL, "Created L1 path.\n"));
 
-		hwgraph_info_add_LBL(vhdl,
-				     INFO_LBL_ELSC,
-				     (arbitrary_info_t) (__psint_t) 1);
+		hwgraph_info_add_LBL(vhdl, INFO_LBL_ELSC,
+				     (arbitrary_info_t)1);
 
 	}
 }
 
-void
+void __init
 klhwg_add_all_nodes(vertex_hdl_t hwgraph_root)
 {
 	cnodeid_t	cnode;
 
-	for (cnode = 0; cnode < numnodes; cnode++) {
+	for (cnode = 0; cnode < numionodes; cnode++) {
 		klhwg_add_node(hwgraph_root, cnode);
 	}
 
-	for (cnode = 0; cnode < numnodes; cnode++) {
+	for (cnode = 0; cnode < numionodes; cnode++) {
 		klhwg_add_xbow(cnode, cnodeid_to_nasid(cnode));
 	}
 
diff -Nru a/arch/ia64/sn/io/sn2/l1_command.c b/arch/ia64/sn/io/sn2/l1_command.c
--- a/arch/ia64/sn/io/sn2/l1_command.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/sn/io/sn2/l1_command.c	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -12,7 +11,6 @@
 #include <asm/sn/sgi.h>
 #include <asm/sn/io.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/hcl_util.h>
 #include <asm/sn/labelcl.h>
@@ -60,8 +58,6 @@
 	*rack = (result & MODULE_RACK_MASK) >> MODULE_RACK_SHFT;
 	*bay = (result & MODULE_BPOS_MASK) >> MODULE_BPOS_SHFT;
 	*brick_type = (result & MODULE_BTYPE_MASK) >> MODULE_BTYPE_SHFT;
-	*brick_type = toupper(*brick_type);
-
 	return 0;
 }
 
@@ -76,63 +72,6 @@
 	return result;
 }
 
-int iobrick_module_get(nasid_t nasid)
-{
-    uint rnum, rack, bay, brick_type, t;
-    int ret;
-
-    /* construct module ID from rack and slot info */
-
-    if ((ret = iobrick_rack_bay_type_get(nasid, &rnum, &bay, &brick_type)) < 0)
-        return ret;
-
-    if (bay > MODULE_BPOS_MASK >> MODULE_BPOS_SHFT)
-        return ELSC_ERROR_MODULE;
-
-    /* Build a moduleid_t-compatible rack number */
-
-    rack = 0;           
-    t = rnum / 100;             /* rack class (CPU/IO) */
-    if (t > RACK_CLASS_MASK(rack) >> RACK_CLASS_SHFT(rack))
-        return ELSC_ERROR_MODULE;
-    RACK_ADD_CLASS(rack, t);
-    rnum %= 100;
-
-    t = rnum / 10;              /* rack group */
-    if (t > RACK_GROUP_MASK(rack) >> RACK_GROUP_SHFT(rack))
-        return ELSC_ERROR_MODULE;
-    RACK_ADD_GROUP(rack, t);
-
-    t = rnum % 10;              /* rack number (one-based) */
-    if (t-1 > RACK_NUM_MASK(rack) >> RACK_NUM_SHFT(rack))
-        return ELSC_ERROR_MODULE;
-    RACK_ADD_NUM(rack, t);
-
-    switch( brick_type ) {
-      case L1_BRICKTYPE_IX: 
-	brick_type = MODULE_IXBRICK; break;
-      case L1_BRICKTYPE_PX: 
-	brick_type = MODULE_PXBRICK; break;
-      case L1_BRICKTYPE_I: 
-	brick_type = MODULE_IBRICK; break;
-      case L1_BRICKTYPE_P:
-	brick_type = MODULE_PBRICK; break;
-      case L1_BRICKTYPE_X:
-	brick_type = MODULE_XBRICK; break;
-    }
-
-    ret = RBT_TO_MODULE(rack, bay, brick_type);
-
-    return ret;
-}
-
-/*
- * iobrick_module_get_nasid() returns a module_id which has the brick
- * type encoded in bits 15-12, but this is not the true brick type...
- * The module_id returned by iobrick_module_get_nasid() is modified
- * to make a PEBRICKs & PXBRICKs look like a PBRICK.  So this routine
- * iobrick_type_get_nasid() returns the true unmodified brick type.
- */
 int
 iobrick_type_get_nasid(nasid_t nasid)
 {
@@ -158,14 +97,6 @@
     return -1;    /* unknown brick */
 }
 
-int iobrick_module_get_nasid(nasid_t nasid)
-{
-    int io_moduleid;
-
-    io_moduleid = iobrick_module_get(nasid);
-    return io_moduleid;
-}
-
 /*
  * given a L1 bricktype, return a bricktype string.  This string is the
  * string that will be used in the hwpath for I/O bricks
@@ -178,26 +109,23 @@
     default:
         return("Unknown");
 
-    case L1_BRICKTYPE_X:
-        return("Xbrick");
-
-    case L1_BRICKTYPE_I:
-        return("Ibrick");
-
-    case L1_BRICKTYPE_P:
-        return("Pbrick");
-
     case L1_BRICKTYPE_PX:
-        return("PXbrick");
+        return(EDGE_LBL_PXBRICK);
+
+    case L1_BRICKTYPE_OPUS:
+        return(EDGE_LBL_OPUSBRICK);
 
     case L1_BRICKTYPE_IX:
-        return("IXbrick");
+        return(EDGE_LBL_IXBRICK);
 
     case L1_BRICKTYPE_C:
         return("Cbrick");
 
     case L1_BRICKTYPE_R:
         return("Rbrick");
+
+    case L1_BRICKTYPE_CHI_CG:
+        return(EDGE_LBL_CGBRICK);
     }
 }
 
diff -Nru a/arch/ia64/sn/io/sn2/ml_SN_init.c b/arch/ia64/sn/io/sn2/ml_SN_init.c
--- a/arch/ia64/sn/io/sn2/ml_SN_init.c	Tue Feb  3 19:45:16 2004
+++ b/arch/ia64/sn/io/sn2/ml_SN_init.c	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -13,58 +12,16 @@
 #include <asm/sn/sgi.h>
 #include <asm/sn/io.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
 #include <asm/sn/sn_private.h>
 #include <asm/sn/klconfig.h>
 #include <asm/sn/sn_cpuid.h>
 
-extern cpuid_t master_procid;
 int		maxcpus;
 
 extern xwidgetnum_t hub_widget_id(nasid_t);
 
-extern void iograph_early_init(void);
-
-nasid_t master_nasid = INVALID_NASID;		/* This is the partition master nasid */
-nasid_t master_baseio_nasid = INVALID_NASID;	/* This is the master base I/O nasid */
-
-
-/*
- * mlreset(void)
- * 	very early machine reset - at this point NO interrupts have been
- * 	enabled; nor is memory, tlb, p0, etc setup.
- *
- * 	slave is zero when mlreset is called for the master processor and
- *	is nonzero thereafter.
- */
-
-
-void
-mlreset(int slave)
-{
-	/*
-	 * We are the master cpu and node.
-	 */ 
-	master_nasid = get_nasid();
-	set_master_bridge_base();
-
-	/* We're the master processor */
-	master_procid = smp_processor_id();
-	master_nasid = cpuid_to_nasid(master_procid);
-
-	/*
-	 * master_nasid we get back better be same as one from
-	 * get_nasid()
-	 */
-	ASSERT_ALWAYS(master_nasid == get_nasid());
-
-	/* early initialization of iograph */
-	iograph_early_init();
-}
-
-
 /* XXX - Move the meat of this to intr.c ? */
 /*
  * Set up the platform-dependent fields in the nodepda.
@@ -72,22 +29,26 @@
 void init_platform_nodepda(nodepda_t *npda, cnodeid_t node)
 {
 	hubinfo_t hubinfo;
+	nasid_t nasid;
 
 	extern void router_map_init(nodepda_t *);
 	extern void router_queue_init(nodepda_t *,cnodeid_t);
 	extern void intr_init_vecblk(nodepda_t *, cnodeid_t, int);
 
 	/* Allocate per-node platform-dependent data */
-	hubinfo = (hubinfo_t)alloc_bootmem_node(NODE_DATA(node), sizeof(struct hubinfo_s));
+	
+	nasid = COMPACT_TO_NASID_NODEID(node);
+	if (node >= numnodes) /* Headless/memless IO nodes */
+		hubinfo = (hubinfo_t)alloc_bootmem_node(NODE_DATA(0), sizeof(struct hubinfo_s));
+	else
+		hubinfo = (hubinfo_t)alloc_bootmem_node(NODE_DATA(node), sizeof(struct hubinfo_s));
 
 	npda->pdinfo = (void *)hubinfo;
 	hubinfo->h_nodepda = npda;
 	hubinfo->h_cnodeid = node;
-	hubinfo->h_nasid = COMPACT_TO_NASID_NODEID(node);
 
 	spin_lock_init(&hubinfo->h_crblock);
 
-	hubinfo->h_widgetid = hub_widget_id(hubinfo->h_nasid);
 	npda->xbow_peer = INVALID_NASID;
 
 	/* 
@@ -104,7 +65,22 @@
 	npda->npda_rip_last = &npda->npda_rip_first;
 	npda->geoid.any.type = GEO_TYPE_INVALID;
 
-	mutex_init_locked(&npda->xbow_sema); /* init it locked? */
+	init_MUTEX_LOCKED(&npda->xbow_sema); /* init it locked? */
+}
+
+void
+init_platform_hubinfo(nodepda_t **nodepdaindr) {
+	cnodeid_t       cnode;
+	hubinfo_t hubinfo;
+	nodepda_t *npda;
+	extern int numionodes;
+
+	for (cnode = 0; cnode < numionodes; cnode++) {
+		npda = nodepdaindr[cnode];
+		hubinfo = (hubinfo_t)npda->pdinfo;
+		hubinfo->h_nasid = COMPACT_TO_NASID_NODEID(cnode);
+		hubinfo->h_widgetid = hub_widget_id(hubinfo->h_nasid);
+	}
 }
 
 void
diff -Nru a/arch/ia64/sn/io/sn2/ml_SN_intr.c b/arch/ia64/sn/io/sn2/ml_SN_intr.c
--- a/arch/ia64/sn/io/sn2/ml_SN_intr.c	Tue Feb  3 19:45:35 2004
+++ b/arch/ia64/sn/io/sn2/ml_SN_intr.c	Tue Feb  3 19:45:35 2004
@@ -14,7 +14,6 @@
 #include <asm/hw_irq.h>
 #include <asm/sn/sgi.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
 #include <asm/sn/io.h>
@@ -82,7 +81,7 @@
 	/* Config and enable UART interrupt, all nodes. */
 	local5_config.sh_local_int5_config_regval = 0;
 	local5_config.sh_local_int5_config_s.idx = SGI_UART_VECTOR;
-	local5_config.sh_local_int5_config_s.pid = cpu0;
+	local5_config.sh_local_int5_config_s.pid = cpu;
 	HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_LOCAL_INT5_CONFIG),
 		local5_config.sh_local_int5_config_regval);
 
@@ -223,7 +222,7 @@
 		int intrs;
 
 		cpu = cnode_slice_to_cpuid(cnode, slice);
-		if (cpu == num_online_cpus())
+		if (cpu == NR_CPUS)
 			continue;
 		if (!cpu_online(cpu))
 			continue;
diff -Nru a/arch/ia64/sn/io/sn2/ml_iograph.c b/arch/ia64/sn/io/sn2/ml_iograph.c
--- a/arch/ia64/sn/io/sn2/ml_iograph.c	Tue Feb  3 19:45:16 2004
+++ b/arch/ia64/sn/io/sn2/ml_iograph.c	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -7,28 +6,16 @@
  * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
  */
 
-#include <linux/types.h>
-#include <linux/slab.h>
 #include <linux/ctype.h>
 #include <asm/sn/sgi.h>
 #include <asm/sn/sn_sal.h>
-#include <asm/sn/io.h>
-#include <asm/sn/sn_cpuid.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/hcl_util.h>
-#include <asm/sn/labelcl.h>
-#include <asm/sn/xtalk/xbow.h>
-#include <asm/sn/pci/bridge.h>
-#include <asm/sn/klconfig.h>
 #include <asm/sn/sn_private.h>
-#include <asm/sn/pci/pcibr.h>
-#include <asm/sn/xtalk/xtalk.h>
-#include <asm/sn/xtalk/xswitch.h>
-#include <asm/sn/xtalk/xwidget.h>
-#include <asm/sn/xtalk/xtalk_private.h>
+#include <asm/sn/pci/pcibr_private.h>
 #include <asm/sn/xtalk/xtalkaddrs.h>
+#include <asm/sn/ksys/l1.h>
 
 /* #define IOGRAPH_DEBUG */
 #ifdef IOGRAPH_DEBUG
@@ -37,8 +24,6 @@
 #define DBG(x...)
 #endif /* IOGRAPH_DEBUG */
 
-/* #define PROBE_TEST */
-
 /* At most 2 hubs can be connected to an xswitch */
 #define NUM_XSWITCH_VOLUNTEER 2
 
@@ -49,7 +34,7 @@
  * xswitch vertex is created.
  */
 typedef struct xswitch_vol_s {
-	mutex_t xswitch_volunteer_mutex;
+	struct semaphore xswitch_volunteer_mutex;
 	int		xswitch_volunteer_count;
 	vertex_hdl_t	xswitch_volunteer[NUM_XSWITCH_VOLUNTEER];
 } *xswitch_vol_t;
@@ -59,12 +44,15 @@
 {
 	xswitch_vol_t xvolinfo;
 	int rc;
-	extern void * snia_kmem_zalloc(size_t size, int flag);
 
-	xvolinfo = snia_kmem_zalloc(sizeof(struct xswitch_vol_s), GFP_KERNEL);
-	mutex_init(&xvolinfo->xswitch_volunteer_mutex);
-	rc = hwgraph_info_add_LBL(xswitch, 
-			INFO_LBL_XSWITCH_VOL,
+	xvolinfo = kmalloc(sizeof(struct xswitch_vol_s), GFP_KERNEL);
+	if (xvolinfo <= 0 ) {
+		printk("xswitch_vertex_init: out of memory\n");
+		return;
+	}
+       	memset(xvolinfo, 0, sizeof(struct xswitch_vol_s));
+	init_MUTEX(&xvolinfo->xswitch_volunteer_mutex);
+	rc = hwgraph_info_add_LBL(xswitch, INFO_LBL_XSWITCH_VOL,
 			(arbitrary_info_t)xvolinfo);
 	ASSERT(rc == GRAPH_SUCCESS); rc = rc;
 }
@@ -79,12 +67,12 @@
 {
 	xswitch_vol_t xvolinfo;
 	int rc;
-	extern void snia_kmem_free(void *ptr, size_t size);
 
 	rc = hwgraph_info_remove_LBL(xswitch, 
 				INFO_LBL_XSWITCH_VOL,
 				(arbitrary_info_t *)&xvolinfo);
-	snia_kmem_free(xvolinfo, sizeof(struct xswitch_vol_s));
+	if (xvolinfo > 0)
+		kfree(xvolinfo);
 }
 /*
  * A Crosstalk master volunteers to manage xwidgets on the specified xswitch.
@@ -101,14 +89,16 @@
 				INFO_LBL_XSWITCH_VOL, 
 				(arbitrary_info_t *)&xvolinfo);
 	if (xvolinfo == NULL) {
-	    if (!is_headless_node_vertex(master))
+	    if (!is_headless_node_vertex(master)) {
+		    char name[MAXDEVNAME];
 		    printk(KERN_WARNING
-			"volunteer for widgets: vertex 0x%p has no info label",
-			(void *)xswitch);
+			"volunteer for widgets: vertex %s has no info label",
+			vertex_to_name(xswitch, name, MAXDEVNAME));
+	    }
 	    return;
 	}
 
-	mutex_lock(&xvolinfo->xswitch_volunteer_mutex);
+	down(&xvolinfo->xswitch_volunteer_mutex);
 	ASSERT(xvolinfo->xswitch_volunteer_count < NUM_XSWITCH_VOLUNTEER);
 	xvolinfo->xswitch_volunteer[xvolinfo->xswitch_volunteer_count] = master;
 	xvolinfo->xswitch_volunteer_count++;
@@ -126,7 +116,7 @@
 			xvolinfo->xswitch_volunteer[1] = hubv;
 		}
 	}
-	mutex_unlock(&xvolinfo->xswitch_volunteer_mutex);
+	up(&xvolinfo->xswitch_volunteer_mutex);
 }
 
 extern int xbow_port_io_enabled(nasid_t nasid, int widgetnum);
@@ -158,11 +148,13 @@
 				INFO_LBL_XSWITCH_VOL, 
 				(arbitrary_info_t *)&xvolinfo);
 	if (xvolinfo == NULL) {
-	    if (!is_headless_node_vertex(hubv))
+	    if (!is_headless_node_vertex(hubv)) {
+		    char name[MAXDEVNAME];
 		    printk(KERN_WARNING
-			"assign_widgets_to_volunteers:vertex 0x%p has "
+			"assign_widgets_to_volunteers:vertex %s has "
 			" no info label",
-			(void *)xswitch);
+			vertex_to_name(xswitch, name, MAXDEVNAME));
+	    }
 	    return;
 	}
 
@@ -182,9 +174,6 @@
 	for (widgetnum=HUB_WIDGET_ID_MIN; widgetnum <= HUB_WIDGET_ID_MAX; widgetnum++) {
 		int i;
 
-		/*
-		 * Ignore disabled/empty ports.
-		 */
 		if (!xbow_port_io_enabled(nasid, widgetnum)) 
 		    continue;
 
@@ -193,16 +182,17 @@
 		 * hub that owned it in the prom.
 		 */
 		if (is_master_baseio_nasid_widget(nasid, widgetnum)) {
-			extern nasid_t get_master_baseio_nasid(void);
+			extern nasid_t snia_get_master_baseio_nasid(void);
 			for (i=0; i<num_volunteer; i++) {
 				hubv = xvolinfo->xswitch_volunteer[i];
 				hubinfo_get(hubv, &hubinfo);
 				nasid = hubinfo->h_nasid;
-				if (nasid == get_master_baseio_nasid())
+				if (nasid == snia_get_master_baseio_nasid())
 					goto do_assignment;
 			}
-			PRINT_PANIC("Nasid == %d, console nasid == %d",
-				nasid, get_master_baseio_nasid());
+			printk("Nasid == %d, console nasid == %d",
+				nasid, snia_get_master_baseio_nasid());
+			nasid = 0;
 		}
 
 		/*
@@ -236,38 +226,6 @@
 	xswitch_volunteer_delete(xswitch);
 }
 
-/*
- * Early iograph initialization.  Called by master CPU in mlreset().
- * Useful for including iograph.o in kernel.o.
- */
-void
-iograph_early_init(void)
-{
-/*
- * Need new way to get this information ..
- */
-	cnodeid_t cnode;
-	nasid_t nasid;
-	lboard_t *board;
-	
-	/*
-	 * Init. the board-to-hwgraph link early, so FRU analyzer
-	 * doesn't trip on leftover values if we panic early on.
-	 */
-	for(cnode = 0; cnode < numnodes; cnode++) {
-		nasid = COMPACT_TO_NASID_NODEID(cnode);
-		board = (lboard_t *)KL_CONFIG_INFO(nasid);
-		DBG("iograph_early_init: Found board 0x%p\n", board);
-
-		/* Check out all the board info stored on a node */
-		while(board) {
-			board->brd_graph_link = GRAPH_VERTEX_NONE;
-			board = KLCF_NEXT(board);
-			DBG("iograph_early_init: Found board 0x%p\n", board);
-		}
-	}
-}
-
 /* 
  * Probe to see if this hub's xtalk link is active.  If so,
  * return the Crosstalk Identification of the widget that we talk to.  
@@ -323,7 +281,7 @@
  *	
  */
 
-void
+static void
 io_xswitch_widget_init(vertex_hdl_t  	xswitchv,
 		       vertex_hdl_t	hubv,
 		       xwidgetnum_t	widgetnum)
@@ -424,11 +382,10 @@
 		sprintf(pathname, EDGE_LBL_MODULE "/%s/" EDGE_LBL_SLAB "/%d" "/%s" "/%s/%d",
 			buffer,
 			geo_slab(board->brd_geoid),
-			(board->brd_type == KLTYPE_IBRICK) ? EDGE_LBL_IBRICK :
-			(board->brd_type == KLTYPE_PBRICK) ? EDGE_LBL_PBRICK :
 			(board->brd_type == KLTYPE_PXBRICK) ? EDGE_LBL_PXBRICK :
 			(board->brd_type == KLTYPE_IXBRICK) ? EDGE_LBL_IXBRICK :
-			(board->brd_type == KLTYPE_XBRICK) ? EDGE_LBL_XBRICK : "?brick",
+			(board->brd_type == KLTYPE_CGBRICK) ? EDGE_LBL_CGBRICK :
+			(board->brd_type == KLTYPE_OPUSBRICK) ? EDGE_LBL_OPUSBRICK : "?brick",
 			EDGE_LBL_XTALK, widgetnum);
 		
 		DBG("io_xswitch_widget_init: path= %s\n", pathname);
@@ -465,8 +422,7 @@
 		(void)xwidget_register(&hwid, widgetv, widgetnum,
 				       hubv, hub_widgetid);
 
-		ia64_sn_sysctl_iobrick_module_get(nasid, &io_module);
-
+		io_module = iomoduleid_get(nasid);
 		if (io_module >= 0) {
 			char			buffer[16];
 			vertex_hdl_t		to, from;
@@ -477,8 +433,8 @@
 			memset(buffer, 0, 16);
 			format_module_id(buffer, geo_module(board->brd_geoid), MODULE_FORMAT_BRIEF);
 
-			if ( islower(MODULE_GET_BTCHAR(io_module)) ) {
-				bt = toupper(MODULE_GET_BTCHAR(io_module));
+			if ( isupper(MODULE_GET_BTCHAR(io_module)) ) {
+				bt = tolower(MODULE_GET_BTCHAR(io_module));
 			}
 			else {
 				bt = MODULE_GET_BTCHAR(io_module);
@@ -508,18 +464,12 @@
 			ASSERT_ALWAYS(to);
 			rc = hwgraph_edge_add(from, to,
 				EDGE_LBL_INTERCONNECT);
-			if (rc == -EEXIST)
-				goto link_done;
-			if (rc != GRAPH_SUCCESS) {
+			if (rc != -EEXIST && rc != GRAPH_SUCCESS) {
 				printk("%s: Unable to establish link"
 					" for xbmon.", pathname);
 			}
-link_done:
 		}
 
-#ifdef	SN0_USE_BTE
-		bte_bpush_war(cnode, (void *)board);
-#endif
 	}
 }
 
@@ -540,70 +490,6 @@
 }
 
 /*
- * For each PCI bridge connected to the xswitch, add a link from the
- * board's klconfig info to the bridge's hwgraph vertex.  This lets
- * the FRU analyzer find the bridge without traversing the hardware
- * graph and risking hangs.
- */
-static void
-io_link_xswitch_widgets(vertex_hdl_t xswitchv, cnodeid_t cnodeid)
-{
-	xwidgetnum_t		widgetnum;
-	char 			pathname[128];
-	vertex_hdl_t		vhdl;
-	nasid_t			nasid, peer_nasid;
-	lboard_t		*board;
-
-
-
-	/* And its connected hub's nasids */
-	nasid = COMPACT_TO_NASID_NODEID(cnodeid);
-	peer_nasid = NODEPDA(cnodeid)->xbow_peer;
-
-	/* 
-	 * Look for paths matching "<widgetnum>/pci" under xswitchv.
-	 * For every widget, init. its lboard's hwgraph link.  If the
-	 * board has a PCI bridge, point the link to it.
-	 */
-	for (widgetnum = HUB_WIDGET_ID_MIN; widgetnum <= HUB_WIDGET_ID_MAX;
-		 widgetnum++) {
-		sprintf(pathname, "%d", widgetnum);
-		if (hwgraph_traverse(xswitchv, pathname, &vhdl) !=
-		    GRAPH_SUCCESS)
-			continue;
-
-		board = find_lboard_module((lboard_t *)KL_CONFIG_INFO(nasid),
-				NODEPDA(cnodeid)->geoid);
-		if (board == NULL && peer_nasid != INVALID_NASID) {
-			/*
-			 * Try to find the board on our peer
-			 */
-			board = find_lboard_module(
-				(lboard_t *)KL_CONFIG_INFO(peer_nasid),
-				NODEPDA(cnodeid)->geoid);
-		}
-		if (board == NULL) {
-			printk(KERN_WARNING  "Could not find PROM info for vertex 0x%p, "
-				"FRU analyzer may fail",
-				(void *)vhdl);
-			return;
-		}
-
-		/* Check both buses */
-		sprintf(pathname, "%d/"EDGE_LBL_PCIX_0, widgetnum);
-		if (hwgraph_traverse(xswitchv, pathname, &vhdl) == GRAPH_SUCCESS)
-			board->brd_graph_link = vhdl;
-		else {
-			sprintf(pathname, "%d/"EDGE_LBL_PCIX_1, widgetnum);
-			if (hwgraph_traverse(xswitchv, pathname, &vhdl) == GRAPH_SUCCESS)
-				board->brd_graph_link = vhdl;
-			else
-				board->brd_graph_link = GRAPH_VERTEX_NONE;
-		}
-	}
-}
-
-/*
  * Initialize all I/O on the specified node.
  */
 static void
@@ -617,7 +503,6 @@
 	nodepda_t	*npdap;
 	struct semaphore *peer_sema = 0;
 	uint32_t	widget_partnum;
-	cpu_cookie_t	c = 0;
 
 	npdap = NODEPDA(cnodeid);
 
@@ -633,23 +518,11 @@
 
 	ASSERT(hubv != GRAPH_VERTEX_NONE);
 
-	/*
-	 * Read mfg info on this hub
-	 */
-
 	/* 
 	 * If nothing connected to this hub's xtalk port, we're done.
 	 */
 	early_probe_for_widget(hubv, &hwid);
 	if (hwid.part_num == XWIDGET_PART_NUM_NONE) {
-#ifdef PROBE_TEST
-		if ((cnodeid == 1) || (cnodeid == 2)) {
-			int index;
-
-			for (index = 0; index < 600; index++)
-				DBG("Interfering with device probing!!!\n");
-		}
-#endif
 		DBG("**** io_init_node: Node's 0x%p hub widget has XWIDGET_PART_NUM_NONE ****\n", hubv);
 		return;
 		/* NOTREACHED */
@@ -694,16 +567,12 @@
 	 * accordingly. In particular, SN00 has direct connected bridge,
 	 * and hence widget id is Not 0.
 	 */
+	widget_partnum = (((*(volatile int32_t *)(NODE_SWIN_BASE
+			(COMPACT_TO_NASID_NODEID(cnodeid), 0) + 
+			WIDGET_ID))) & WIDGET_PART_NUM) 
+			>> WIDGET_PART_NUM_SHFT;
 
-	widget_partnum = (((*(volatile int32_t *)(NODE_SWIN_BASE(COMPACT_TO_NASID_NODEID(cnodeid), 0) + WIDGET_ID))) & WIDGET_PART_NUM) >> WIDGET_PART_NUM_SHFT;
-
-	if (widget_partnum == BRIDGE_WIDGET_PART_NUM ||
-				widget_partnum == XBRIDGE_WIDGET_PART_NUM){
-		npdap->basew_id = (((*(volatile int32_t *)(NODE_SWIN_BASE(COMPACT_TO_NASID_NODEID(cnodeid), 0) + BRIDGE_WID_CONTROL))) & WIDGET_WIDGET_ID);
-
-		DBG("io_init_node: Found XBRIDGE widget_partnum= 0x%x\n", widget_partnum);
-
-	} else if ((widget_partnum == XBOW_WIDGET_PART_NUM) ||
+	if ((widget_partnum == XBOW_WIDGET_PART_NUM) ||
 			(widget_partnum == XXBOW_WIDGET_PART_NUM) ||
 			(widget_partnum == PXBOW_WIDGET_PART_NUM) ) {
 		/* 
@@ -714,11 +583,14 @@
 		npdap->basew_id = 0;
 
 	} else {
-		npdap->basew_id = (((*(volatile int32_t *)(NODE_SWIN_BASE(COMPACT_TO_NASID_NODEID(cnodeid), 0) + BRIDGE_WID_CONTROL))) & WIDGET_WIDGET_ID);
+		void	*bridge;
+		extern uint64_t pcireg_control_get(void *);
 
-		panic(" ****io_init_node: Unknown Widget Part Number 0x%x Widget ID 0x%x attached to Hubv 0x%p ****\n", widget_partnum, npdap->basew_id, (void *)hubv);
+		bridge = (void *)NODE_SWIN_BASE(COMPACT_TO_NASID_NODEID(cnodeid), 0);
+		npdap->basew_id = pcireg_control_get(bridge) & WIDGET_WIDGET_ID;
 
-		/*NOTREACHED*/
+		printk(" ****io_init_node: Unknown Widget Part Number 0x%x Widget ID 0x%x attached to Hubv 0x%p ****\n", widget_partnum, npdap->basew_id, (void *)hubv);
+		return;
 	}
 	{
 		char widname[10];
@@ -776,32 +648,22 @@
 
 		/* Signal that we're done */
 		if (peer_sema) {
-			mutex_unlock(peer_sema);
+			up(peer_sema);
 		}
 		
 	}
 	else {
 	    /* Wait 'til master is done assigning widgets. */
-	    mutex_lock(&npdap->xbow_sema);
+	    down(&npdap->xbow_sema);
 	}
 
-#ifdef PROBE_TEST
-	if ((cnodeid == 1) || (cnodeid == 2)) {
-		int index;
-
-		for (index = 0; index < 500; index++)
-			DBG("Interfering with device probing!!!\n");
-	}
-#endif
 	/* Now both nodes can safely inititialize widgets */
 	io_init_xswitch_widgets(switchv, cnodeid);
-	io_link_xswitch_widgets(switchv, cnodeid);
 
 	DBG("\nio_init_node: DONE INITIALIZED ALL I/O FOR CNODEID %d\n\n", cnodeid);
 }
 
 #include <asm/sn/ioerror_handling.h>
-/* #endif */
 
 /*
  * Initialize all I/O devices.  Starting closest to nodes, probe and
@@ -810,75 +672,52 @@
 void
 init_all_devices(void)
 {
-	/* Governor on init threads..bump up when safe 
-	 * (beware many devfs races) 
-	 */
 	cnodeid_t cnodeid, active;
 
 	active = 0;
-	for (cnodeid = 0; cnodeid < numnodes; cnodeid++) {
+	for (cnodeid = 0; cnodeid < numionodes; cnodeid++) {
                 DBG("init_all_devices: Calling io_init_node() for cnode %d\n", cnodeid);
                 io_init_node(cnodeid);
 
 		DBG("init_all_devices: Done io_init_node() for cnode %d\n", cnodeid);
 	}
 
-	for (cnodeid = 0; cnodeid < numnodes; cnodeid++)
+	for (cnodeid = 0; cnodeid < numnodes; cnodeid++) {
 		/*
 	 	 * Update information generated by IO init.
 		 */
 		update_node_information(cnodeid);
-
-#if HWG_PRINT
-	hwgraph_print();
-#endif
-
+	}
 }
 
-#define toint(x) ((int)(x) - (int)('0'))
-
 static
 struct io_brick_map_s io_brick_tab[] = {
 
-/* Ibrick widget number to PCI bus number map */
- {      MODULE_IBRICK,                          /* Ibrick type    */ 
+/* PXbrick widget number to PCI bus number map */
+ {      MODULE_PXBRICK,                         /* PXbrick type   */ 
     /*  PCI Bus #                                  Widget #       */
     {   0, 0, 0, 0, 0, 0, 0, 0,                 /* 0x0 - 0x7      */
         0,                                      /* 0x8            */
         0,                                      /* 0x9            */
         0, 0,                                   /* 0xa - 0xb      */
-        0,                                      /* 0xc            */
-        0,                                      /* 0xd            */
-        2,                                      /* 0xe            */
-        1                                       /* 0xf            */
-     }
- },
-
-/* Pbrick widget number to PCI bus number map */
- {      MODULE_PBRICK,                          /* Pbrick type    */ 
-    /*  PCI Bus #                                  Widget #       */
-    {   0, 0, 0, 0, 0, 0, 0, 0,                 /* 0x0 - 0x7      */
-        2,                                      /* 0x8            */
-        1,                                      /* 0x9            */
-        0, 0,                                   /* 0xa - 0xb      */
-        4,                                      /* 0xc            */
-        6,                                      /* 0xd            */
-        3,                                      /* 0xe            */
-        5                                       /* 0xf            */
+        1,                                      /* 0xc            */
+        5,                                      /* 0xd            */
+        0,                                      /* 0xe            */
+        3                                       /* 0xf            */
     }
  },
 
-/* PXbrick widget number to PCI bus number map */
- {      MODULE_PXBRICK,                         /* PXbrick type   */ 
+/* OPUSbrick widget number to PCI bus number map */
+ {      MODULE_OPUSBRICK,                       /* OPUSbrick type */ 
     /*  PCI Bus #                                  Widget #       */
     {   0, 0, 0, 0, 0, 0, 0, 0,                 /* 0x0 - 0x7      */
         0,                                      /* 0x8            */
         0,                                      /* 0x9            */
         0, 0,                                   /* 0xa - 0xb      */
-        1,                                      /* 0xc            */
-        5,                                      /* 0xd            */
+        0,                                      /* 0xc            */
+        0,                                      /* 0xd            */
         0,                                      /* 0xe            */
-        3                                       /* 0xf            */
+        1                                       /* 0xf            */
     }
  },
 
@@ -896,19 +735,19 @@
     }
  },
 
-/* Xbrick widget to XIO slot map */
- {      MODULE_XBRICK,                          /* Xbrick type    */ 
-    /*  XIO Slot #                                 Widget #       */
+/* CG brick widget number to PCI bus number map */
+ {      MODULE_CGBRICK,				/* CG brick       */
+    /*  PCI Bus #                                  Widget #       */
     {   0, 0, 0, 0, 0, 0, 0, 0,                 /* 0x0 - 0x7      */
-        1,                                      /* 0x8            */
-        3,                                      /* 0x9            */
-        0, 0,                                   /* 0xa - 0xb      */
-        2,                                      /* 0xc            */
-        4,                                      /* 0xd            */
+        0,                                      /* 0x8            */
+        0,                                      /* 0x9            */
+        0, 1,                                   /* 0xa - 0xb      */
+        0,                                      /* 0xc            */
+        0,                                      /* 0xd            */
         0,                                      /* 0xe            */
         0                                       /* 0xf            */
-    }
- }
+     }
+ },
 };
 
 /*
diff -Nru a/arch/ia64/sn/io/sn2/module.c b/arch/ia64/sn/io/sn2/module.c
--- a/arch/ia64/sn/io/sn2/module.c	Tue Feb  3 19:45:16 2004
+++ b/arch/ia64/sn/io/sn2/module.c	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -9,14 +8,14 @@
 
 #include <linux/types.h>
 #include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/string.h>
 #include <asm/sn/sgi.h>
 #include <asm/sn/sn_sal.h>
 #include <asm/sn/io.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
 #include <asm/sn/xtalk/xbow.h>
-#include <asm/sn/pci/bridge.h>
 #include <asm/sn/klconfig.h>
 #include <asm/sn/module.h>
 #include <asm/sn/pci/pcibr.h>
@@ -40,40 +39,8 @@
 #define SN00_SERIAL_FUDGE	0x3b1af409d513c2
 #define SN0_SERIAL_FUDGE	0x6e
 
-void
-encode_int_serial(uint64_t src,uint64_t *dest)
-{
-    uint64_t val;
-    int i;
-
-    val = src + SN00_SERIAL_FUDGE;
-
-
-    for (i = 0; i < sizeof(long long); i++) {
-	((char*)dest)[i] =
-	    ((char*)&val)[sizeof(long long)/2 +
-			 ((i%2) ? ((i/2 * -1) - 1) : (i/2))];
-    }
-}
-
-
-void
-decode_int_serial(uint64_t src, uint64_t *dest)
-{
-    uint64_t val;
-    int i;
-
-    for (i = 0; i < sizeof(long long); i++) {
-	((char*)&val)[sizeof(long long)/2 +
-		     ((i%2) ? ((i/2 * -1) - 1) : (i/2))] =
-	    ((char*)&src)[i];
-    }
-
-    *dest = val - SN00_SERIAL_FUDGE;
-}
 
-
-void
+static void __init
 encode_str_serial(const char *src, char *dest)
 {
     int i;
@@ -86,20 +53,8 @@
     }
 }
 
-void
-decode_str_serial(const char *src, char *dest)
-{
-    int i;
-
-    for (i = 0; i < MAX_SERIAL_NUM_SIZE; i++) {
-	dest[MAX_SERIAL_NUM_SIZE/2 +
-	    ((i%2) ? ((i/2 * -1) - 1) : (i/2))] = src[i] -
-	    SN0_SERIAL_FUDGE;
-    }
-}
-
-
-module_t *module_lookup(moduleid_t id)
+module_t * __init 
+module_lookup(moduleid_t id)
 {
     int			i;
 
@@ -121,13 +76,14 @@
  *
  *   The node number is added to the list of nodes in the module.
  */
-
-module_t *module_add_node(geoid_t geoid, cnodeid_t cnodeid)
+static module_t * __init
+module_add_node(geoid_t geoid, cnodeid_t cnodeid)
 {
     module_t	       *m;
     int			i;
     char		buffer[16];
     moduleid_t		moduleid;
+    slabid_t		slab_number;
 
     memset(buffer, 0, 16);
     moduleid = geo_module(geoid);
@@ -136,14 +92,16 @@
 
     if ((m = module_lookup(moduleid)) == 0) {
 	m = kmalloc(sizeof (module_t), GFP_KERNEL);
-	memset(m, 0 , sizeof(module_t));
 	ASSERT_ALWAYS(m);
+	memset(m, 0 , sizeof(module_t));
+
+	for (slab_number = 0; slab_number <= MAX_SLABS; slab_number++) {
+		m->nodes[slab_number] = -1;
+	}
 
 	m->id = moduleid;
 	spin_lock_init(&m->lock);
 
-	mutex_init_locked(&m->thdcnt);
-
 	/* Insert in sorted order by module number */
 
 	for (i = nummodules; i > 0 && modules[i - 1]->id > moduleid; i--)
@@ -153,16 +111,26 @@
 	nummodules++;
     }
 
-    m->nodes[m->nodecnt] = cnodeid;
-    m->geoid[m->nodecnt] = geoid;
-    m->nodecnt++;
+    /*
+     * Save this information in the correct slab number of the node in the 
+     * module.
+     */
+    slab_number = geo_slab(geoid);
+    DPRINTF("slab number added 0x%x\n", slab_number);
+
+    if (m->nodes[slab_number] != -1) {
+	printk("module_add_node .. slab previously found\n");
+	return NULL;
+    }
 
-    DPRINTF("module_add_node: module %s now has %d nodes\n", buffer, m->nodecnt);
+    m->nodes[slab_number] = cnodeid;
+    m->geoid[slab_number] = geoid;
 
     return m;
 }
 
-int module_probe_snum(module_t *m, nasid_t nasid)
+static int __init
+module_probe_snum(module_t *m, nasid_t host_nasid, nasid_t nasid)
 {
     lboard_t	       *board;
     klmod_serial_num_t *comp;
@@ -171,13 +139,10 @@
     /*
      * record brick serial number
      */
-    board = find_lboard((lboard_t *) KL_CONFIG_INFO(nasid), KLTYPE_SNIA);
+    board = find_lboard((lboard_t *) KL_CONFIG_INFO(host_nasid), KLTYPE_SNIA);
 
     if (! board || KL_CONFIG_DUPLICATE_BOARD(board))
     {
-#if	LDEBUG
-	printf ("module_probe_snum: no IP35 board found!\n");
-#endif
 	return 0;
     }
 
@@ -186,12 +151,6 @@
 	encode_str_serial( serial_number, m->snum.snum_str );
 	m->snum_valid = 1;
     }
-#if	LDEBUG
-    else {
-	printf("module_probe_snum: brick serial number is null!\n");
-    }
-    printf("module_probe_snum: brick serial number == %s\n", serial_number);
-#endif /* DEBUG */
 
     board = find_lboard((lboard_t *) KL_CONFIG_INFO(nasid),
 			KLTYPE_IOBRICK_XBOW);
@@ -202,22 +161,10 @@
     comp = GET_SNUM_COMP(board);
 
     if (comp) {
-#if LDEBUG
-	    int i;
-
-	    printf("********found module with id %x and string", m->id);
-
-	    for (i = 0; i < MAX_SERIAL_NUM_SIZE; i++)
-		printf(" %x ", comp->snum.snum_str[i]);
-
-	    printf("\n");	/* Fudged string is not ASCII */
-#endif
-
 	    if (comp->snum.snum_str[0] != '\0') {
-		memcpy(m->sys_snum,
-		       comp->snum.snum_str,
-		       MAX_SERIAL_NUM_SIZE);
-		m->sys_snum_valid = 1;
+		    memcpy(m->sys_snum, comp->snum.snum_str,
+			   MAX_SERIAL_NUM_SIZE);
+		    m->sys_snum_valid = 1;
 	    }
     }
 
@@ -230,7 +177,7 @@
     }
 }
 
-void
+void __init
 io_module_init(void)
 {
     cnodeid_t		node;
@@ -243,21 +190,20 @@
 
     nserial = 0;
 
+    /*
+     * First pass just scan for compute node boards KLTYPE_SNIA.
+     * We do not support memoryless compute nodes.
+     */
     for (node = 0; node < numnodes; node++) {
 	nasid = COMPACT_TO_NASID_NODEID(node);
 
 	board = find_lboard((lboard_t *) KL_CONFIG_INFO(nasid), KLTYPE_SNIA);
 	ASSERT(board);
 
-	m = module_add_node(board->brd_geoid, node);
+	HWGRAPH_DEBUG((__FILE__, __FUNCTION__, __LINE__, NULL, NULL, "Found Shub lboard 0x%lx nasid 0x%x cnode 0x%x \n", (unsigned long)board, (int)nasid, (int)node));
 
-	if (! m->snum_valid && module_probe_snum(m, nasid))
+	m = module_add_node(board->brd_geoid, node);
+	if (! m->snum_valid && module_probe_snum(m, nasid, nasid))
 	    nserial++;
     }
-
-    DPRINTF("********found total of %d serial numbers in the system\n",
-	    nserial);
-
-    if (nserial == 0)
-	DPRINTF(KERN_WARNING  "io_module_init: No serial number found.\n");
 }
diff -Nru a/arch/ia64/sn/io/sn2/pcibr/Makefile b/arch/ia64/sn/io/sn2/pcibr/Makefile
--- a/arch/ia64/sn/io/sn2/pcibr/Makefile	Tue Feb  3 19:45:42 2004
+++ b/arch/ia64/sn/io/sn2/pcibr/Makefile	Tue Feb  3 19:45:42 2004
@@ -9,7 +9,8 @@
 # Makefile for the sn2 specific pci bridge routines.
 #
 
-EXTRA_CFLAGS    := -DLITTLE_ENDIAN
-
-obj-y += pcibr_ate.o pcibr_config.o pcibr_dvr.o pcibr_hints.o pcibr_intr.o pcibr_rrb.o \
-	 pcibr_slot.o pcibr_error.o
+obj-y += pcibr_ate.o pcibr_config.o \
+	 pcibr_dvr.o pcibr_hints.o  \
+	 pcibr_intr.o pcibr_rrb.o   \
+	 pcibr_slot.o pcibr_error.o \
+	 pcibr_reg.o 
diff -Nru a/arch/ia64/sn/io/sn2/pcibr/pcibr_ate.c b/arch/ia64/sn/io/sn2/pcibr/pcibr_ate.c
--- a/arch/ia64/sn/io/sn2/pcibr/pcibr_ate.c	Tue Feb  3 19:45:16 2004
+++ b/arch/ia64/sn/io/sn2/pcibr/pcibr_ate.c	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,4 @@
 /*
- *
  * 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.
@@ -8,30 +7,12 @@
  */
 
 #include <linux/types.h>
-#include <linux/slab.h>
-#include <linux/module.h>
 #include <asm/sn/sgi.h>
-#include <asm/sn/sn_cpuid.h>
-#include <asm/sn/addrs.h>
-#include <asm/sn/arch.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
-#include <asm/sn/hcl.h>
-#include <asm/sn/labelcl.h>
-#include <asm/sn/xtalk/xwidget.h>
-#include <asm/sn/pci/bridge.h>
 #include <asm/sn/pci/pciio.h>
 #include <asm/sn/pci/pcibr.h>
 #include <asm/sn/pci/pcibr_private.h>
 #include <asm/sn/pci/pci_defs.h>
-#include <asm/sn/prio.h>
-#include <asm/sn/xtalk/xbow.h>
-#include <asm/sn/io.h>
-#include <asm/sn/sn_private.h>
-
-#ifndef LOCAL
-#define LOCAL           static
-#endif
 
 /*
  * functions
@@ -62,7 +43,7 @@
 #define ATE_NUM_ENTRIES(n) _ate_info[n]
 
 /* Possible choices for number of ATE entries in Bridge's SSRAM */
-LOCAL int               _ate_info[] =
+static int               _ate_info[] =
 {
     0,					/* 0 entries */
     8 * 1024,				/* 8K entries */
@@ -85,7 +66,6 @@
     int                     num_entries, entry;
     int                     i, j;
     bridgereg_t             old_enable, new_enable;
-    int                     s;
 
     /* Probe SSRAM to determine its size. */
     old_enable = bridge->b_int_enable;
@@ -112,12 +92,10 @@
      * The read following the write is required for the Bridge war
      */
 
-    s = splhi();
     bridge->b_wid_control = (bridge->b_wid_control
 			& ~BRIDGE_CTRL_SSRAM_SIZE_MASK)
 			| BRIDGE_CTRL_SSRAM_SIZE(largest_working_size);
     bridge->b_wid_control;		/* inval addr bug war */
-    splx(s);
 
     num_entries = ATE_NUM_ENTRIES(largest_working_size);
 
@@ -381,25 +359,9 @@
 	  int ate_count,
 	  bridge_ate_t ate)
 {
-	if (IS_PIC_SOFT(pcibr_soft) ) {
-    		while (ate_count-- > 0) {
-			*ate_ptr++ = ate;
-			ate += IOPGSIZE;
-		}
-	}
-	else {
-		if (io_get_sh_swapper(NASID_GET(ate_ptr))) {
-    			while (ate_count-- > 0) {
-				*ate_ptr++ = __swab64(ate);
-				ate += IOPGSIZE;
-			}
-		}
-		else {
-    			while (ate_count-- > 0) {
-				*ate_ptr++ = ate;
-				ate += IOPGSIZE;
-			}
-		}
+  	while (ate_count-- > 0) {
+		*ate_ptr++ = ate;
+		ate += IOPGSIZE;
 	}
 }
 
@@ -441,19 +403,7 @@
     for (slot = pcibr_soft->bs_min_slot; 
 		slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot) {
 	if ((cmd_reg = cmd_regs[slot]) & PCI_CMD_BUS_MASTER) {
-		if ( IS_PIC_SOFT(pcibr_soft) ) {
-			pcibr_slot_config_set(bridge, slot, PCI_CFG_COMMAND/4, cmd_reg);
-		}
-		else {
-			if (io_get_sh_swapper(NASID_GET(bridge))) {
-				bridge->b_type0_cfg_dev[slot].l[PCI_CFG_COMMAND / 4] = __swab32(cmd_reg);
-			}
-			else {
-//				BUG(); /* Does this really work if called when io_get_sh_swapper = 0? */
-//				bridge->b_type0_cfg_dev[slot].l[PCI_CFG_COMMAND / 4] = cmd_reg;
-				pcibr_slot_config_set(bridge, slot, PCI_CFG_COMMAND/4, cmd_reg);
-			}
-		}
+		pcibr_slot_config_set(bridge, slot, PCI_CFG_COMMAND/4, cmd_reg);
 	}
     }
     pcibr_dmamap->bd_flags |= PCIBR_DMAMAP_BUSY;
diff -Nru a/arch/ia64/sn/io/sn2/pcibr/pcibr_config.c b/arch/ia64/sn/io/sn2/pcibr/pcibr_config.c
--- a/arch/ia64/sn/io/sn2/pcibr/pcibr_config.c	Tue Feb  3 19:45:40 2004
+++ b/arch/ia64/sn/io/sn2/pcibr/pcibr_config.c	Tue Feb  3 19:45:40 2004
@@ -1,5 +1,4 @@
 /*
- *
  * 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.
@@ -8,27 +7,12 @@
  */
 
 #include <linux/types.h>
-#include <linux/slab.h>
-#include <linux/module.h>
-#include <linux/byteorder/swab.h>
 #include <asm/sn/sgi.h>
-#include <asm/sn/sn_cpuid.h>
-#include <asm/sn/addrs.h>
-#include <asm/sn/arch.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
-#include <asm/sn/hcl.h>
-#include <asm/sn/labelcl.h>
-#include <asm/sn/xtalk/xwidget.h>
-#include <asm/sn/pci/bridge.h>
 #include <asm/sn/pci/pciio.h>
 #include <asm/sn/pci/pcibr.h>
 #include <asm/sn/pci/pcibr_private.h>
 #include <asm/sn/pci/pci_defs.h>
-#include <asm/sn/prio.h>
-#include <asm/sn/xtalk/xbow.h>
-#include <asm/sn/io.h>
-#include <asm/sn/sn_private.h>
 
 extern pcibr_info_t      pcibr_info_get(vertex_hdl_t);
 
@@ -38,22 +22,11 @@
 void       	  do_pcibr_config_set(cfg_p, unsigned, unsigned, uint64_t);
 
 /*
- * on sn-ia we need to twiddle the the addresses going out
- * the pci bus because we use the unswizzled synergy space
- * (the alternative is to use the swizzled synergy space
- * and byte swap the data)
+ * fancy snia bit twiddling....
  */
-#define CB(b,r) (((volatile uint8_t *) b)[((r)^4)])
-#define CS(b,r) (((volatile uint16_t *) b)[((r^4)/2)])
-#define CW(b,r) (((volatile uint32_t *) b)[((r^4)/4)])
-
 #define	CBP(b,r) (((volatile uint8_t *) b)[(r)])
 #define	CSP(b,r) (((volatile uint16_t *) b)[((r)/2)])
 #define	CWP(b,r) (((volatile uint32_t *) b)[(r)/4])
-
-#define SCB(b,r) (((volatile uint8_t *) b)[((r)^3)])
-#define SCS(b,r) (((volatile uint16_t *) b)[((r^2)/2)])
-#define SCW(b,r) (((volatile uint32_t *) b)[((r)/4)])
 
 /*
  * Return a config space address for given slot / func / offset.  Note the
diff -Nru a/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c b/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c
--- a/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c	Tue Feb  3 19:45:43 2004
+++ b/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c	Tue Feb  3 19:45:43 2004
@@ -1,5 +1,4 @@
 /*
- *
  * 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.
@@ -7,31 +6,18 @@
  * Copyright (C) 2001-2003 Silicon Graphics, Inc. All rights reserved.
  */
 
-#include <linux/types.h>
-#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/interrupt.h>
-#include <linux/ioport.h>
 #include <asm/sn/sgi.h>
 #include <asm/sn/sn_sal.h>
-#include <asm/sn/sn_cpuid.h>
-#include <asm/sn/addrs.h>
-#include <asm/sn/arch.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
-#include <asm/sn/hcl.h>
-#include <asm/sn/labelcl.h>
-#include <asm/sn/klconfig.h>
-#include <asm/sn/xtalk/xwidget.h>
-#include <asm/sn/pci/bridge.h>
 #include <asm/sn/pci/pciio.h>
 #include <asm/sn/pci/pcibr.h>
 #include <asm/sn/pci/pcibr_private.h>
 #include <asm/sn/pci/pci_defs.h>
-#include <asm/sn/prio.h>
-#include <asm/sn/xtalk/xbow.h>
-#include <asm/sn/io.h>
+
+#include <asm/sn/prio.h> 
 #include <asm/sn/sn_private.h>
 
 /*
@@ -39,36 +25,15 @@
  *   -pcibr_debug_mask is the mask of the different types of debugging
  *    you want to enable.  See sys/PCI/pcibr_private.h 
  *   -pcibr_debug_module is the module you want to trace.  By default
- *    all modules are trace.  For IP35 this value has the format of
- *    something like "001c10".  For IP27 this value is a node number,
- *    i.e. "1", "2"...  For IP30 this is undefined and should be set to
- *    'all'.
- *   -pcibr_debug_widget is the widget you want to trace.  For IP27
- *    the widget isn't exposed in the hwpath so use the xio slot num.
- *    i.e. for 'io2' set pcibr_debug_widget to "2".
+ *    all modules are trace.  The format is something like "001c10".
+ *   -pcibr_debug_widget is the widget you want to trace.  For TIO 
+ *    based bricks use the corelet id.
  *   -pcibr_debug_slot is the pci slot you want to trace.
  */
 uint32_t pcibr_debug_mask = 0x0;	/* 0x00000000 to disable */
-char      *pcibr_debug_module = "all";		/* 'all' for all modules */
-int	   pcibr_debug_widget = -1;		/* '-1' for all widgets  */
-int	   pcibr_debug_slot = -1;		/* '-1' for all slots    */
-
-/*
- * Macros related to the Lucent USS 302/312 usb timeout workaround.  It
- * appears that if the lucent part can get into a retry loop if it sees a
- * DAC on the bus during a pio read retry.  The loop is broken after about
- * 1ms, so we need to set up bridges holding this part to allow at least
- * 1ms for pio.
- */
-
-#define USS302_TIMEOUT_WAR
-
-#ifdef USS302_TIMEOUT_WAR
-#define LUCENT_USBHC_VENDOR_ID_NUM	0x11c1
-#define LUCENT_USBHC302_DEVICE_ID_NUM	0x5801
-#define LUCENT_USBHC312_DEVICE_ID_NUM	0x5802
-#define USS302_BRIDGE_TIMEOUT_HLD	4
-#endif
+static char      *pcibr_debug_module = "all";		/* 'all' for all modules */
+static int	   pcibr_debug_widget = -1;		/* '-1' for all widgets  */
+static int	   pcibr_debug_slot = -1;		/* '-1' for all slots    */
 
 /* kbrick widgetnum-to-bus layout */
 int p_busnum[MAX_PORT_NUM] = {                  /* widget#      */
@@ -82,6 +47,24 @@
         3,                                      /* 0xf          */
 };
 
+char *pci_space[] = {"NONE",
+                     "ROM",
+                     "IO",
+                     "",
+                     "MEM",
+                     "MEM32",
+                     "MEM64",
+                     "CFG",
+                     "WIN0",
+                     "WIN1",
+                     "WIN2",
+                     "WIN3",
+                     "WIN4",
+                     "WIN5",
+                     "",
+                     "BAD"};
+
+
 #if PCIBR_SOFT_LIST
 pcibr_list_p            pcibr_list = 0;
 #endif
@@ -289,12 +272,10 @@
     bridgereg_t             xmask;
 
     xmask = mask;
-    if (IS_XBRIDGE_OR_PIC_SOFT(pcibr_soft)) {
-    	if (mask == BRIDGE_DEV_PMU_BITS)
-		xmask = XBRIDGE_DEV_PMU_BITS;
-	if (mask == BRIDGE_DEV_D64_BITS)
-		xmask = XBRIDGE_DEV_D64_BITS;
-    }
+    if (mask == BRIDGE_DEV_PMU_BITS)
+	xmask = XBRIDGE_DEV_PMU_BITS;
+    if (mask == BRIDGE_DEV_D64_BITS)
+	xmask = XBRIDGE_DEV_D64_BITS;
 
     slotp = &pcibr_soft->bs_slot[slot];
 
@@ -376,11 +357,9 @@
 	new &= ~BRIDGE_DEV_WRGA_BITS;
 
     if (flags & PCIIO_BYTE_STREAM)
-	new |= (IS_XBRIDGE_OR_PIC_SOFT(pcibr_soft)) ? 
-			BRIDGE_DEV_SWAP_DIR : BRIDGE_DEV_SWAP_BITS;
+	new |= BRIDGE_DEV_SWAP_DIR;
     if (flags & PCIIO_WORD_VALUES)
-	new &= (IS_XBRIDGE_OR_PIC_SOFT(pcibr_soft)) ? 
-			~BRIDGE_DEV_SWAP_DIR : ~BRIDGE_DEV_SWAP_BITS;
+	new &= ~BRIDGE_DEV_SWAP_DIR;
 
     /* Provider-specific flags
      */
@@ -410,7 +389,7 @@
      * device.  The bit is only intended for 64-bit devices and, on
      * PIC, can cause problems for 32-bit devices.
      */
-    if (IS_PIC_SOFT(pcibr_soft) && mask == BRIDGE_DEV_D64_BITS &&
+    if (mask == BRIDGE_DEV_D64_BITS &&
                                 PCIBR_WAR_ENABLED(PV855271, pcibr_soft)) {
         if (flags & PCIBR_VCHAN1) {
                 new |= BRIDGE_DEV_VIRTUAL_EN;
@@ -418,6 +397,11 @@
         }
     }
 
+    /* PIC BRINGUP WAR (PV# 878674):   Don't allow 64bit PIO accesses */
+    if (IS_PIC_SOFT(pcibr_soft) && (flags & PCIBR_64BIT) &&
+				PCIBR_WAR_ENABLED(PV878674, pcibr_soft)) {
+	new &= ~(1ull << 22);
+    }
 
     chg = old ^ new;				/* what are we changing, */
     chg &= xmask;				/* of the interesting bits */
@@ -425,13 +409,8 @@
     if (chg) {
 
 	badd32 = slotp->bss_d32_uctr ? (BRIDGE_DEV_D32_BITS & chg) : 0;
-	if (IS_XBRIDGE_OR_PIC_SOFT(pcibr_soft)) {
-		badpmu = slotp->bss_pmu_uctr ? (XBRIDGE_DEV_PMU_BITS & chg) : 0;
-		badd64 = slotp->bss_d64_uctr ? (XBRIDGE_DEV_D64_BITS & chg) : 0;
-	} else {
-		badpmu = slotp->bss_pmu_uctr ? (BRIDGE_DEV_PMU_BITS & chg) : 0;
-		badd64 = slotp->bss_d64_uctr ? (BRIDGE_DEV_D64_BITS & chg) : 0;
-	}
+	badpmu = slotp->bss_pmu_uctr ? (XBRIDGE_DEV_PMU_BITS & chg) : 0;
+	badd64 = slotp->bss_d64_uctr ? (XBRIDGE_DEV_D64_BITS & chg) : 0;
 	bad = badpmu | badd32 | badd64;
 
 	if (bad) {
@@ -473,6 +452,8 @@
 	     */
 	    if (bad) {
 		pcibr_unlock(pcibr_soft, s);
+		PCIBR_DEBUG((PCIBR_DEBUG_DEVREG, pcibr_soft->bs_vhdl,
+			    "pcibr_try_set_device: mod blocked by 0x%x\n", bad));
 		return bad;
 	    }
 	}
@@ -495,25 +476,13 @@
 	pcibr_unlock(pcibr_soft, s);
 	return 0;
     }
-    if ( IS_PIC_SOFT(pcibr_soft) ) {
-	bridge->b_device[slot].reg = new;
-	slotp->bss_device = new;
-	bridge->b_wid_tflush;		/* wait until Bridge PIO complete */
-    }
-    else {
-	if (io_get_sh_swapper(NASID_GET(bridge))) {
-		BRIDGE_REG_SET32((&bridge->b_device[slot].reg)) = __swab32(new);
-		slotp->bss_device = new;
-		BRIDGE_REG_GET32((&bridge->b_wid_tflush));  /* wait until Bridge PIO complete */
-	} else {
-		bridge->b_device[slot].reg = new;
-		slotp->bss_device = new;
-		bridge->b_wid_tflush;               /* wait until Bridge PIO complete */
-	}
-    }
+    bridge->b_device[slot].reg = new;
+    slotp->bss_device = new;
+    bridge->b_wid_tflush;		/* wait until Bridge PIO complete */
     pcibr_unlock(pcibr_soft, s);
 
-    printk("pcibr_try_set_device: Device(%d): %x\n", slot, new);
+    PCIBR_DEBUG((PCIBR_DEBUG_DEVREG, pcibr_soft->bs_vhdl,
+		"pcibr_try_set_device: Device(%d): 0x%x\n", slot, new));
     return 0;
 }
 
@@ -548,22 +517,13 @@
 {
     bridge_t               *bridge;
     unsigned long          s;
-    volatile uint32_t     wrf;
+    volatile uint32_t     wrf; 
     s = pcibr_lock(pcibr_soft);
     bridge = pcibr_soft->bs_base;
-
-    if ( IS_PIC_SOFT(pcibr_soft) ) {
-	wrf = bridge->b_wr_req_buf[slot].reg;
-    }
-    else {
-	if (io_get_sh_swapper(NASID_GET(bridge))) {
-		wrf = BRIDGE_REG_GET32((&bridge->b_wr_req_buf[slot].reg));
-	} else {
-		wrf = bridge->b_wr_req_buf[slot].reg;
-	}
-    }
+    
+    wrf = bridge->b_wr_req_buf[slot].reg;
     pcibr_unlock(pcibr_soft, s);
-}
+}   
 
 /* =====================================================================
  *    Bridge (pcibr) "Device Driver" entry points
@@ -662,7 +622,12 @@
      * passed into us, into its external representation.  See comment
      * for the PCIBR_DEVICE_TO_SLOT macro for more information.
      */
-    NEW(pcibr_info);
+    pcibr_info = kmalloc(sizeof (*(pcibr_info)), GFP_KERNEL);
+    if ( !pcibr_info ) {
+	return NULL;
+    }
+    memset(pcibr_info, 0, sizeof (*(pcibr_info)));
+
     pciio_device_info_new(&pcibr_info->f_c, pcibr_soft->bs_vhdl,
 			  PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot),
 			  rfunc, vendor, device);
@@ -720,7 +685,7 @@
     pcibr_soft_t	 pcibr_soft;
     bridge_t		*bridge;
     int                  count_vchan0, count_vchan1;
-    unsigned             s;
+    unsigned long	 s;
     int			 error_call;
     int			 error = 0;
 
@@ -746,9 +711,6 @@
 
         s = pcibr_lock(pcibr_soft);
 
-	/* PIC NOTE: If this is a BRIDGE, VCHAN2 & VCHAN3 will be zero so
-	 * no need to conditionalize this (ie. "if (IS_PIC_SOFT())" ).
-	 */
         pcibr_soft->bs_rrb_res[slot] = pcibr_soft->bs_rrb_res[slot] +
                                        pcibr_soft->bs_rrb_valid[slot][VCHAN0] +
                                        pcibr_soft->bs_rrb_valid[slot][VCHAN1] +
@@ -983,18 +945,15 @@
     char                    devnm[MAXDEVNAME], *s;
     pcibr_hints_t           pcibr_hints;
     uint64_t              int_enable;
-    bridgereg_t             int_enable_32;
     picreg_t                int_enable_64;
     unsigned                rrb_fixed = 0;
 
-    int                     spl_level;
-
 #if PCI_FBBE
     int                     fast_back_to_back_enable;
 #endif
     nasid_t		    nasid;
     int	                    iobrick_type_get_nasid(nasid_t nasid);
-    int                     iobrick_module_get_nasid(nasid_t nasid);
+    int                     iomoduleid_get(nasid_t nasid);
 
     PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATTACH, pcibr_vhdl,
 	        "pcibr_attach2: bridge=0x%p, busnum=%d\n", bridge, busnum));
@@ -1025,10 +984,13 @@
      * allocate soft state structure, fill in some
      * fields, and hook it up to our vertex.
      */
-    NEW(pcibr_soft);
+    pcibr_soft = kmalloc(sizeof(*(pcibr_soft)), GFP_KERNEL);
     if (ret_softp)
 	*ret_softp = pcibr_soft;
-    BZERO(pcibr_soft, sizeof *pcibr_soft);
+    if (!pcibr_soft)
+	return -1;
+
+    memset(pcibr_soft, 0, sizeof *pcibr_soft);
     pcibr_soft_set(pcibr_vhdl, pcibr_soft);
     pcibr_soft->bs_conn = xconn_vhdl;
     pcibr_soft->bs_vhdl = pcibr_vhdl;
@@ -1094,7 +1056,10 @@
     {
 	pcibr_list_p            self;
 
-	NEW(self);
+	self = kmalloc(sizeof(*(self)), GFP_KERNEL);
+	if (!self)
+		return -1;
+	memset(self, 0, sizeof(*(self)));
 	self->bl_soft = pcibr_soft;
 	self->bl_vhdl = pcibr_vhdl;
 	self->bl_next = pcibr_list;
@@ -1112,8 +1077,7 @@
 
     PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATTACH, pcibr_vhdl,
 		"pcibr_attach2: %s ASIC: rev %s (code=0x%x)\n",
-		IS_XBRIDGE_SOFT(pcibr_soft) ? "XBridge" :
-			IS_PIC_SOFT(pcibr_soft) ? "PIC" : "Bridge", 
+		"PIC",
 		(rev == BRIDGE_PART_REV_A) ? "A" : 
                 (rev == BRIDGE_PART_REV_B) ? "B" :
                 (rev == BRIDGE_PART_REV_C) ? "C" :
@@ -1143,7 +1107,7 @@
 	printk(KERN_WARNING "0x%p: Unknown bricktype : 0x%x\n", (void *)xconn_vhdl,
 				(unsigned int)pcibr_soft->bs_bricktype);
 
-    pcibr_soft->bs_moduleid = iobrick_module_get_nasid(nasid);
+    pcibr_soft->bs_moduleid = iomoduleid_get(nasid);
 
     if (pcibr_soft->bs_bricktype > 0) {
 	switch (pcibr_soft->bs_bricktype) {
@@ -1268,12 +1232,8 @@
      * is a wrapper routine we register that will call the real error handler
      * pcibr_error_handler() with the correct pcibr_soft struct.
      */
-    if (IS_PIC_SOFT(pcibr_soft)) {
-	if (busnum == 0) {
-	    xwidget_error_register(xconn_vhdl, pcibr_error_handler_wrapper, pcibr_soft);
-	}
-    } else {
-	xwidget_error_register(xconn_vhdl, pcibr_error_handler, pcibr_soft);
+    if (busnum == 0) {
+    	xwidget_error_register(xconn_vhdl, pcibr_error_handler_wrapper, pcibr_soft);
     }
 
     /*
@@ -1293,7 +1253,7 @@
     bridge->b_int_rst_stat = (BRIDGE_IRR_ALL_CLR);
 
     /* Initialize some PIC specific registers. */
-    if (IS_PIC_SOFT(pcibr_soft)) {
+    {
 	picreg_t pic_ctrl_reg = bridge->p_wid_control_64;
 
 	/* Bridges Requester ID: bus = busnum, dev = 0, func = 0 */
@@ -1317,19 +1277,7 @@
 
 	bridge->p_wid_control_64 = pic_ctrl_reg;
     }
-
-    /*
-     * Until otherwise set up,
-     * assume all interrupts are
-     * from slot 7(Bridge/Xbridge) or 3(PIC).
-     * XXX. Not sure why we're doing this, made change for PIC
-     * just to avoid setting reserved bits.
-     */
-    if (IS_PIC_SOFT(pcibr_soft))
-	bridge->b_int_device = (uint32_t) 0x006db6db;
-    else
-	bridge->b_int_device = (uint32_t) 0xffffffff;
-
+    bridge->b_int_device = (uint32_t) 0x006db6db;
     {
 	bridgereg_t             dirmap;
 	paddr_t                 paddr;
@@ -1367,7 +1315,7 @@
 	 * for the lowest hunk of memory.
 	 */
 	xbase = xtalk_dmatrans_addr(xconn_vhdl, 0,
-				    paddr, _PAGESZ, 0);
+				    paddr, PAGE_SIZE, 0);
 
 	if (xbase != XIO_NOWHERE) {
 	    if (XIO_PACKED(xbase)) {
@@ -1397,24 +1345,14 @@
 	 * ensure that we write and read without any interruption.
 	 * The read following the write is required for the Bridge war
 	 */
-	spl_level = splhi();
 #if IOPGSIZE == 4096
-        if (IS_PIC_SOFT(pcibr_soft)) {
-            bridge->p_wid_control_64 &= ~BRIDGE_CTRL_PAGE_SIZE;
-        } else {
-            bridge->b_wid_control &= ~BRIDGE_CTRL_PAGE_SIZE;
-        }
+        bridge->p_wid_control_64 &= ~BRIDGE_CTRL_PAGE_SIZE;
 #elif IOPGSIZE == 16384
-        if (IS_PIC_SOFT(pcibr_soft)) {
-            bridge->p_wid_control_64 |= BRIDGE_CTRL_PAGE_SIZE;
-        } else {
-            bridge->b_wid_control |= BRIDGE_CTRL_PAGE_SIZE;
-        }
+        bridge->p_wid_control_64 |= BRIDGE_CTRL_PAGE_SIZE;
 #else
 	<<<Unable to deal with IOPGSIZE >>>;
 #endif
 	bridge->b_wid_control;		/* inval addr bug war */
-	splx(spl_level);
 
 	/* Initialize internal mapping entries */
 	for (entry = 0; entry < pcibr_soft->bs_int_ate_size; entry++) {
@@ -1441,10 +1379,7 @@
 	 * time.
 	 */
 
-	if (IS_XBRIDGE_OR_PIC_SOFT(pcibr_soft))
-		num_entries = 0;
-	else
-		num_entries = pcibr_init_ext_ate_ram(bridge);
+	num_entries = 0;
 
 	/* we always have 128 ATEs (512 for Xbridge) inside the chip
 	 * even if disabled for debugging.
@@ -1552,24 +1487,8 @@
      * enable all of them.
      * NOTE: some PCI ints may already be enabled.
      */
-    /* We read the INT_ENABLE register as a 64bit picreg_t for PIC and a
-     * 32bit bridgereg_t for BRIDGE, but always process the result as a
-     * 64bit value so the code can be "common" for both PIC and BRIDGE...
-     */
-    if (IS_PIC_SOFT(pcibr_soft)) {
-	int_enable_64 = bridge->p_int_enable_64 | BRIDGE_ISR_ERRORS;
-        int_enable = (uint64_t)int_enable_64;
-#ifdef PFG_TEST
-	int_enable = (uint64_t)0x7ffffeff7ffffeff;
-#endif
-    } else {
-	int_enable_32 = bridge->b_int_enable | (BRIDGE_ISR_ERRORS & 0xffffffff);
-	int_enable = ((uint64_t)int_enable_32 & 0xffffffff);
-#ifdef PFG_TEST
-	int_enable = (uint64_t)0x7ffffeff;
-#endif
-    }
-
+    int_enable_64 = bridge->p_int_enable_64 | BRIDGE_ISR_ERRORS;
+    int_enable = (uint64_t)int_enable_64;
 
 #if BRIDGE_ERROR_INTR_WAR
     if (pcibr_soft->bs_rev_num == BRIDGE_PART_REV_A) {
@@ -1609,7 +1528,7 @@
      * locked out to be freed up sooner (by timing out) so that the
      * read tnums are never completely used up.
      */
-    if (IS_PIC_SOFT(pcibr_soft) && PCIBR_WAR_ENABLED(PV856864, pcibr_soft)) {
+    if (PCIBR_WAR_ENABLED(PV856864, pcibr_soft)) {
         int_enable &= ~PIC_ISR_PCIX_REQ_TOUT;
         int_enable &= ~BRIDGE_ISR_XREAD_REQ_TIMEOUT;
 
@@ -1621,16 +1540,12 @@
      * RRB0, RRB8, RRB1, and RRB9.  Assign them to DEVICE[2|3]--VCHAN3
      * so they are not used
      */
-    if (IS_PIC_SOFT(pcibr_soft) && PCIBR_WAR_ENABLED(PV856866, pcibr_soft)) {
+    if (PCIBR_WAR_ENABLED(PV856866, pcibr_soft)) {
         bridge->b_even_resp |= 0x000f000f;
         bridge->b_odd_resp |= 0x000f000f;
     }
 
-    if (IS_PIC_SOFT(pcibr_soft)) {
-        bridge->p_int_enable_64 = (picreg_t)int_enable;
-    } else {
-        bridge->b_int_enable = (bridgereg_t)int_enable;
-    }
+    bridge->p_int_enable_64 = (picreg_t)int_enable;
     bridge->b_int_mode = 0;		/* do not send "clear interrupt" packets */
 
     bridge->b_wid_tflush;		/* wait until Bridge PIO complete */
@@ -1690,7 +1605,7 @@
     /* Setup the Bus's PCI IO Root Resource. */
     pcibr_soft->bs_io_win_root_resource.start = PCIBR_BUS_IO_BASE;
     pcibr_soft->bs_io_win_root_resource.end = 0xffffffff;
-    res = (struct resource *) kmalloc( sizeof(struct resource), KM_NOSLEEP);
+    res = (struct resource *) kmalloc( sizeof(struct resource), GFP_KERNEL);
     if (!res)
 	panic("PCIBR:Unable to allocate resource structure\n");
 
@@ -1702,13 +1617,13 @@
 	panic("PCIBR:Unable to request_resource()\n");
 
     /* Setup the Small Window Root Resource */
-    pcibr_soft->bs_swin_root_resource.start = _PAGESZ;
+    pcibr_soft->bs_swin_root_resource.start = PAGE_SIZE;
     pcibr_soft->bs_swin_root_resource.end = 0x000FFFFF;
 
     /* Setup the Bus's PCI Memory Root Resource */
     pcibr_soft->bs_mem_win_root_resource.start = 0x200000;
     pcibr_soft->bs_mem_win_root_resource.end = 0xffffffff;
-    res = (struct resource *) kmalloc( sizeof(struct resource), KM_NOSLEEP);
+    res = (struct resource *) kmalloc( sizeof(struct resource), GFP_KERNEL);
     if (!res)
         panic("PCIBR:Unable to allocate resource structure\n");
 
@@ -1776,8 +1691,7 @@
     }
 
     /* Set up convenience links */
-    if (IS_XBRIDGE_OR_PIC_SOFT(pcibr_soft))
-	pcibr_bus_cnvlink(pcibr_soft->bs_vhdl);
+    pcibr_bus_cnvlink(pcibr_soft->bs_vhdl);
 
     for (slot = pcibr_soft->bs_min_slot; 
 				slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot)
@@ -1881,11 +1795,7 @@
 
     s = pcibr_lock(pcibr_soft);
     /* Disable the interrupts from the bridge */
-    if (IS_PIC_SOFT(pcibr_soft)) {
-	bridge->p_int_enable_64 = 0;
-    } else {
-	bridge->b_int_enable = 0;
-    }
+    bridge->p_int_enable_64 = 0;
     pcibr_unlock(pcibr_soft, s);
 
     /* Detach all the PCI devices talking to this bridge */
@@ -1898,7 +1808,6 @@
     pciio_device_info_unregister(pcibr_vhdl,
 				 &(pcibr_soft->bs_noslot_info->f_c));
 
-    spin_lock_destroy(&pcibr_soft->bs_lock);
     kfree(pcibr_soft->bs_name);
     
     /* Disconnect the error interrupt and free the xtalk resources 
@@ -1910,13 +1819,14 @@
     /* Clear the software state maintained by the bridge driver for this
      * bridge.
      */
-    DEL(pcibr_soft);
+    kfree(pcibr_soft);
+
     /* Remove the Bridge revision labelled info */
     (void)hwgraph_info_remove_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV, NULL);
     /* Remove the character device associated with this bridge */
-    (void)hwgraph_edge_remove(pcibr_vhdl, EDGE_LBL_CONTROLLER, NULL);
+    hwgraph_edge_remove(pcibr_vhdl, EDGE_LBL_CONTROLLER, NULL);
     /* Remove the PCI bridge vertex */
-    (void)hwgraph_edge_remove(xconn, EDGE_LBL_PCI, NULL);
+    hwgraph_edge_remove(xconn, EDGE_LBL_PCI, NULL);
 
     return(0);
 }
@@ -1994,7 +1904,6 @@
     iopaddr_t               mbase;	/* base of devio(x) mapped area on PCI */
     size_t                  msize;	/* size of devio(x) mapped area on PCI */
     size_t                  mmask;	/* addr bits stored in Device(x) */
-    char		    tmp_str[512];
 
     unsigned long           s;
 
@@ -2171,27 +2080,13 @@
 		devreg &= ~BRIDGE_DEV_DEV_SWAP;
 
 	    if (pcibr_soft->bs_slot[win].bss_device != devreg) {
-		if ( IS_PIC_SOFT(pcibr_soft) ) {
-			bridge->b_device[win].reg = devreg;
-			pcibr_soft->bs_slot[win].bss_device = devreg;
-			bridge->b_wid_tflush;   /* wait until Bridge PIO complete */
-		}
-		else {
-			if (io_get_sh_swapper(NASID_GET(bridge))) {
-				BRIDGE_REG_SET32((&bridge->b_device[win].reg)) = __swab32(devreg);
-				pcibr_soft->bs_slot[win].bss_device = devreg;
-				BRIDGE_REG_GET32((&bridge->b_wid_tflush)); /* wait until Bridge PIO complete */
-			} else {
-				bridge->b_device[win].reg = devreg;
-				pcibr_soft->bs_slot[win].bss_device = devreg;
-				bridge->b_wid_tflush;   /* wait until Bridge PIO complete */
-			}
-		}
-
+		bridge->b_device[win].reg = devreg;
+		pcibr_soft->bs_slot[win].bss_device = devreg;
+		bridge->b_wid_tflush;   /* wait until Bridge PIO complete */
 #ifdef PCI_LATER
 		PCIBR_DEBUG((PCIBR_DEBUG_DEVREG, pconn_vhdl, 
-			    "pcibr_addr_pci_to_xio: Device(%d): %x\n",
-			    win, devreg, device_bits));
+			    "pcibr_addr_pci_to_xio: Device(%d): 0x%x\n",
+			    win, devreg));
 #endif
 	    }
 	    pcibr_soft->bs_slot[win].bss_devio.bssd_space = space;
@@ -2205,18 +2100,12 @@
             if (bar != -1)
                 pcibr_info->f_window[bar].w_devio_index = win;
 
-	    /*
-	     * The kernel only allows functions to have so many variable args,
-	     * attempting to call PCIBR_DEBUG_ALWAYS() with more than 5 printk
-	     * arguments fails so sprintf() it into a temporary string.
-	     */
-	    if (pcibr_debug_mask & PCIBR_DEBUG_PIOMAP) {
-	        sprintf(tmp_str, "pcibr_addr_pci_to_xio: map to [%lx..%lx] for "
-		        "slot %d allocates DevIO(%d) Device(%d) set to %lx\n",
-		        (unsigned long)pci_addr, (unsigned long)(pci_addr + req_size - 1),
-		        (unsigned int)slot, win, win, (unsigned long)devreg);
-	        PCIBR_DEBUG((PCIBR_DEBUG_PIOMAP, pconn_vhdl, "%s", tmp_str));
-	    }
+	    PCIBR_DEBUG((PCIBR_DEBUG_PIOMAP, pconn_vhdl,
+		    "pcibr_addr_pci_to_xio: map to space %s [0x%lx..0x%lx] "
+		    "for slot %d allocates DevIO(%d) Device(%d) set to %lx\n",
+		    pci_space[space], pci_addr, pci_addr + req_size - 1,
+		    slot, win, win, devreg));
+
 	    goto done;
 	}				/* endif DevIO(x) not pointed */
 	mbase = pcibr_soft->bs_slot[win].bss_devio.bssd_base;
@@ -2244,9 +2133,10 @@
         if (bar != -1)
             pcibr_info->f_window[bar].w_devio_index = win;
 
-	if (pcibr_debug_mask & PCIBR_DEBUG_PIOMAP) {
-	    PCIBR_DEBUG((PCIBR_DEBUG_PIOMAP, pconn_vhdl, "%s", tmp_str));
-	}
+	PCIBR_DEBUG((PCIBR_DEBUG_PIOMAP, pconn_vhdl,
+		"pcibr_addr_pci_to_xio: map to space %s [0x%lx..0x%lx] "
+		"for slot %d uses DevIO(%d)\n", pci_space[space],
+		pci_addr, pci_addr + req_size - 1, slot, win));
 	goto done;
     }
 
@@ -2271,9 +2161,9 @@
 	} else if (IS_PIC_BUSNUM_SOFT(pcibr_soft, 1)) {	/* PIC bus 1 */
 		base = PICBRIDGE1_PCI_MEM32_BASE;
 		limit = PICBRIDGE1_PCI_MEM32_LIMIT;
-	} else {					/* Bridge/Xbridge */
-		base = BRIDGE_PCI_MEM32_BASE;
-		limit = BRIDGE_PCI_MEM32_LIMIT;
+	} else {
+		printk("pcibr_addr_pci_to_xio(): unknown bridge type");
+		return (iopaddr_t)0;
 	}
 
 	if ((pci_addr + base + req_size - 1) <= limit)
@@ -2287,9 +2177,9 @@
 	} else if (IS_PIC_BUSNUM_SOFT(pcibr_soft, 1)) {	/* PIC bus 1 */
 		base = PICBRIDGE1_PCI_MEM64_BASE;
 		limit = PICBRIDGE1_PCI_MEM64_LIMIT;
-	} else {					/* Bridge/Xbridge */
-		base = BRIDGE_PCI_MEM64_BASE;
-		limit = BRIDGE_PCI_MEM64_LIMIT;
+	} else {
+		printk("pcibr_addr_pci_to_xio(): unknown bridge type");
+		return (iopaddr_t)0;
 	}
 
 	if ((pci_addr + base + req_size - 1) <= limit)
@@ -2300,20 +2190,7 @@
 	/*
 	 * PIC bridges do not support big-window aliases into PCI I/O space
 	 */
-	if (IS_PIC_SOFT(pcibr_soft)) {
-		xio_addr = XIO_NOWHERE;
-		break;
-	}
-
-	/* Bridge Hardware Bug WAR #482741:
-	 * The 4G area that maps directly from
-	 * XIO space to PCI I/O space is busted
-	 * until Bridge Rev D.
-	 */
-	if ((pcibr_soft->bs_rev_num > BRIDGE_PART_REV_C) &&
-	    ((pci_addr + BRIDGE_PCI_IO_BASE + req_size - 1) <=
-	     BRIDGE_PCI_IO_LIMIT))
-	    xio_addr = pci_addr + BRIDGE_PCI_IO_BASE;
+	xio_addr = XIO_NOWHERE;
 	break;
     }
 
@@ -2340,41 +2217,29 @@
 	if (bfn == bfo) {		/* we already match. */
 	    ;
 	} else if (bfo != 0) {		/* we have a conflict. */
-	    if (pcibr_debug_mask & PCIBR_DEBUG_PIOMAP) {
-	        PCIBR_DEBUG((PCIBR_DEBUG_PIOMAP, pconn_vhdl, "%s", tmp_str));
-	    }
+	    PCIBR_DEBUG((PCIBR_DEBUG_PIOMAP, pconn_vhdl,
+		    "pcibr_addr_pci_to_xio: swap conflict in %s, "
+		    "was%s%s, want%s%s\n", pci_space[space],
+		    bfo & PCIIO_BYTE_STREAM ? " BYTE_STREAM" : "",
+		    bfo & PCIIO_WORD_VALUES ? " WORD_VALUES" : "",
+		    bfn & PCIIO_BYTE_STREAM ? " BYTE_STREAM" : "",
+		    bfn & PCIIO_WORD_VALUES ? " WORD_VALUES" : ""));
 	    xio_addr = XIO_NOWHERE;
 	} else {			/* OK to make the change. */
+    	    picreg_t             octl, nctl;
 	    swb = (space == PCIIO_SPACE_IO) ? BRIDGE_CTRL_IO_SWAP : BRIDGE_CTRL_MEM_SWAP;
-	    if ( IS_PIC_SOFT(pcibr_soft) ) {
-	    	picreg_t             octl, nctl;
-		octl = bridge->p_wid_control_64;
-		nctl = bst ? octl | (uint64_t)swb : octl & ((uint64_t)~swb);
+	    octl = bridge->p_wid_control_64;
+	    nctl = bst ? octl | (uint64_t)swb : octl & ((uint64_t)~swb);
 
-		if (octl != nctl)		/* make the change if any */
-			bridge->b_wid_control = nctl;
-	    }
-	    else {
-	    	picreg_t             octl, nctl;
-		if (io_get_sh_swapper(NASID_GET(bridge))) {
-			octl = BRIDGE_REG_GET32((&bridge->b_wid_control));
-			nctl = bst ? octl | swb : octl & ~swb;
-
-			if (octl != nctl)           /* make the change if any */
-				BRIDGE_REG_SET32((&bridge->b_wid_control)) = __swab32(nctl);
-		} else {
-			octl = bridge->b_wid_control;
-			nctl = bst ? octl | swb : octl & ~swb;
-
-			if (octl != nctl)           /* make the change if any */
-				bridge->b_wid_control = nctl;
-		}
-	    }
+	    if (octl != nctl)		/* make the change if any */
+		bridge->b_wid_control = nctl;
 	    *bfp = bfn;			/* record the assignment */
 
-	    if (pcibr_debug_mask & PCIBR_DEBUG_PIOMAP) {
-	        PCIBR_DEBUG((PCIBR_DEBUG_PIOMAP, pconn_vhdl, "%s", tmp_str));
-	    }
+	    PCIBR_DEBUG((PCIBR_DEBUG_PIOMAP, pconn_vhdl,
+		    "pcibr_addr_pci_to_xio: swap for %s set to%s%s\n",
+		    pci_space[space],
+		    bfn & PCIIO_BYTE_STREAM ? " BYTE_STREAM" : "",
+		    bfn & PCIIO_WORD_VALUES ? " WORD_VALUES" : ""));
 	}
     }
   done:
@@ -2443,7 +2308,13 @@
 	mapptr = NULL;
     else {
 	pcibr_unlock(pcibr_soft, s);
-	NEW(pcibr_piomap);
+	pcibr_piomap = kmalloc(sizeof (*(pcibr_piomap)), GFP_KERNEL);
+	if ( !pcibr_piomap ) {
+		PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_PIOMAP, pconn_vhdl,
+		    	"pcibr_piomap_alloc: malloc fails\n"));
+		return NULL;
+	}
+	memset(pcibr_piomap, 0, sizeof (*(pcibr_piomap)));
     }
 
     pcibr_piomap->bp_dev = pconn_vhdl;
@@ -2480,7 +2351,7 @@
     }
     
     PCIBR_DEBUG((PCIBR_DEBUG_PIOMAP, pconn_vhdl,
-		"pcibr_piomap_alloc: map=0x%x\n", pcibr_piomap));
+		"pcibr_piomap_alloc: map=0x%lx\n", pcibr_piomap));
 
     return pcibr_piomap;
 }
@@ -2490,7 +2361,7 @@
 pcibr_piomap_free(pcibr_piomap_t pcibr_piomap)
 {
     PCIBR_DEBUG((PCIBR_DEBUG_PIOMAP, pcibr_piomap->bp_dev,
-		"pcibr_piomap_free: map=0x%x\n", pcibr_piomap));
+		"pcibr_piomap_free: map=0x%lx\n", pcibr_piomap));
 
     xtalk_piomap_free(pcibr_piomap->bp_xtalk_pio);
     pcibr_piomap->bp_xtalk_pio = 0;
@@ -2509,7 +2380,7 @@
 			     pci_addr - pcibr_piomap->bp_pciaddr,
 			     req_size);
     PCIBR_DEBUG((PCIBR_DEBUG_PIOMAP, pcibr_piomap->bp_dev,
-                "pcibr_piomap_free: map=0x%x, addr=0x%x\n", 
+                "pcibr_piomap_addr: map=0x%lx, addr=0x%lx\n", 
 		pcibr_piomap, addr));
 
     return(addr);
@@ -2520,7 +2391,7 @@
 pcibr_piomap_done(pcibr_piomap_t pcibr_piomap)
 {
     PCIBR_DEBUG((PCIBR_DEBUG_PIOMAP, pcibr_piomap->bp_dev,
-		"pcibr_piomap_done: map=0x%x\n", pcibr_piomap));
+		"pcibr_piomap_done: map=0x%lx\n", pcibr_piomap));
     xtalk_piomap_done(pcibr_piomap->bp_xtalk_pio);
 }
 
@@ -2551,7 +2422,7 @@
 
     addr = xtalk_piotrans_addr(xconn_vhdl, 0, xio_addr, req_size, flags & PIOMAP_FLAGS);
     PCIBR_DEBUG((PCIBR_DEBUG_PIODIR, pconn_vhdl,
-		"pcibr_piotrans_addr: xio_addr=0x%x, addr=0x%x\n",
+		"pcibr_piotrans_addr: xio_addr=0x%lx, addr=0x%lx\n",
 		xio_addr, addr));
     return(addr);
 }
@@ -2586,7 +2457,7 @@
     /*
      * Check for proper alignment
      */
-    ASSERT(alignment >= NBPP);
+    ASSERT(alignment >= PAGE_SIZE);
     ASSERT((alignment & (alignment - 1)) == 0);
 
     align_mask = alignment - 1;
@@ -2595,7 +2466,8 @@
     /*
      * First look if a previously allocated chunk exists.
      */
-    if ((piosp = pcibr_info->f_piospace)) {
+    piosp = pcibr_info->f_piospace;
+    if (piosp) {
 	/*
 	 * Look through the list for a right sized free chunk.
 	 */
@@ -2647,11 +2519,18 @@
     if (!start_addr) {
 	pcibr_unlock(pcibr_soft, s);
 	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_PIOMAP, pconn_vhdl,
-		    "pcibr_piospace_alloc: request 0x%x to big\n", req_size));
+		    "pcibr_piospace_alloc: request 0x%lx to big\n", req_size));
 	return 0;
     }
 
-    NEW(piosp);
+    piosp = kmalloc(sizeof (*(piosp)), GFP_KERNEL);
+    if ( !piosp ) {
+	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_PIOMAP, pconn_vhdl,
+		    "pcibr_piospace_alloc: malloc fails\n"));
+	return 0;
+    }
+    memset(piosp, 0, sizeof (*(piosp)));
+
     piosp->free = 0;
     piosp->space = space;
     piosp->start = start_addr;
@@ -2662,7 +2541,7 @@
     pcibr_unlock(pcibr_soft, s);
 
     PCIBR_DEBUG((PCIBR_DEBUG_PIOMAP, pconn_vhdl,
-		"pcibr_piospace_alloc: piosp=0x%x\n", piosp));
+		"pcibr_piospace_alloc: piosp=0x%lx\n", piosp));
 
     return start_addr;
 }
@@ -2675,6 +2554,7 @@
 		    size_t req_size)
 {
     pcibr_info_t            pcibr_info = pcibr_info_get(pconn_vhdl);
+    pcibr_soft_t            pcibr_soft = (pcibr_soft_t) pcibr_info->f_mfast;
     pciio_piospace_t        piosp;
     unsigned long           s;
     char                    name[1024];
@@ -2718,7 +2598,7 @@
     pcibr_unlock(pcibr_soft, s);
 
     PCIBR_DEBUG((PCIBR_DEBUG_PIOMAP, pconn_vhdl,
-		"pcibr_piospace_free: piosp=0x%x\n", piosp));
+		"pcibr_piospace_free: piosp=0x%lx\n", piosp));
     return;
 }
 
@@ -2777,12 +2657,10 @@
 	attributes &= ~PCI64_ATTR_PREF;
 
     /* the swap bit is in the address attributes for xbridge */
-    if (IS_XBRIDGE_OR_PIC_SOFT(pcibr_soft)) {
-    	if (flags & PCIIO_BYTE_STREAM)
-        	attributes |= PCI64_ATTR_SWAP;
-    	if (flags & PCIIO_WORD_VALUES)
-        	attributes &= ~PCI64_ATTR_SWAP;
-    }
+    if (flags & PCIIO_BYTE_STREAM)
+       	attributes |= PCI64_ATTR_SWAP;
+    if (flags & PCIIO_WORD_VALUES)
+       	attributes &= ~PCI64_ATTR_SWAP;
 
     /* Provider-specific flags
      */
@@ -2832,6 +2710,7 @@
     int                     ate_count;
     int                     ate_index;
     int			    vchan = VCHAN0;
+    unsigned long	    s;
 
     /* merge in forced flags */
     flags |= pcibr_soft->bs_dma_flags;
@@ -2840,7 +2719,9 @@
      * On SNIA64, these maps are pre-allocated because pcibr_dmamap_alloc()
      * can be called within an interrupt thread.
      */
+    s = pcibr_lock(pcibr_soft);
     pcibr_dmamap = (pcibr_dmamap_t)get_free_pciio_dmamap(pcibr_soft->bs_vhdl);
+    pcibr_unlock(pcibr_soft, s);
 
     if (!pcibr_dmamap)
 	return 0;
@@ -2899,16 +2780,19 @@
 		}
 	    }
 	    PCIBR_DEBUG((PCIBR_DEBUG_DMAMAP | PCIBR_DEBUG_DMADIR, pconn_vhdl,
-		 	"pcibr_dmamap_alloc: using direct64, map=0x%x\n",
+		 	"pcibr_dmamap_alloc: using direct64, map=0x%lx\n",
 			pcibr_dmamap));
 	    return pcibr_dmamap;
 	}
 	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_DMAMAP | PCIBR_DEBUG_DMADIR, pconn_vhdl,
 		    "pcibr_dmamap_alloc: unable to use direct64\n"));
 
-	/* PIC only supports 64-bit direct mapping in PCI-X mode. */
+	/* PIC in PCI-X mode only supports 64-bit direct mapping so
+	 * don't fall thru and try 32-bit direct mapping or 32-bit
+	 * page mapping
+	 */
 	if (IS_PCIX(pcibr_soft)) {
-	    DEL(pcibr_dmamap);
+	    kfree(pcibr_dmamap);
 	    return 0;
 	}
 
@@ -2927,7 +2811,7 @@
 	     * is outside the direct32 range.
 	     */
 	    PCIBR_DEBUG((PCIBR_DEBUG_DMAMAP | PCIBR_DEBUG_DMADIR, pconn_vhdl,
-			"pcibr_dmamap_alloc: using direct32, map=0x%x\n", 
+			"pcibr_dmamap_alloc: using direct32, map=0x%lx\n", 
 			pcibr_dmamap));
 	    pcibr_dmamap->bd_flags = flags;
 	    pcibr_dmamap->bd_xio_addr = pcibr_soft->bs_dir_xbase;
@@ -2971,29 +2855,25 @@
 
 	    PCIBR_DEBUG((PCIBR_DEBUG_DMAMAP, pconn_vhdl,
 			"pcibr_dmamap_alloc: using PMU, ate_index=%d, "
-			"pcibr_dmamap=0x%x\n", ate_index, pcibr_dmamap));
+			"pcibr_dmamap=0x%lx\n", ate_index, pcibr_dmamap));
 
 	    ate_proto = pcibr_flags_to_ate(flags);
 
 	    pcibr_dmamap->bd_flags = flags;
 	    pcibr_dmamap->bd_pci_addr =
 		PCI32_MAPPED_BASE + IOPGSIZE * ate_index;
+
+	    if (flags & PCIIO_BYTE_STREAM)
+		    ATE_SWAP_ON(pcibr_dmamap->bd_pci_addr);
 	    /*
-	     * for xbridge the byte-swap bit == bit 29 of PCI address
+	     * If swap was set in bss_device in pcibr_endian_set()
+	     * we need to change the address bit.
 	     */
-	    if (IS_XBRIDGE_OR_PIC_SOFT(pcibr_soft)) {
-		    if (flags & PCIIO_BYTE_STREAM)
-			    ATE_SWAP_ON(pcibr_dmamap->bd_pci_addr);
-		    /*
-		     * If swap was set in bss_device in pcibr_endian_set()
-		     * we need to change the address bit.
-		     */
-		    if (pcibr_soft->bs_slot[slot].bss_device & 
-							BRIDGE_DEV_SWAP_PMU)
-			    ATE_SWAP_ON(pcibr_dmamap->bd_pci_addr);
-		    if (flags & PCIIO_WORD_VALUES)
-			    ATE_SWAP_OFF(pcibr_dmamap->bd_pci_addr);
-	    }
+	    if (pcibr_soft->bs_slot[slot].bss_device & 
+						BRIDGE_DEV_SWAP_PMU)
+		    ATE_SWAP_ON(pcibr_dmamap->bd_pci_addr);
+	    if (flags & PCIIO_WORD_VALUES)
+		    ATE_SWAP_OFF(pcibr_dmamap->bd_pci_addr);
 	    pcibr_dmamap->bd_xio_addr = 0;
 	    pcibr_dmamap->bd_ate_ptr = pcibr_ate_addr(pcibr_soft, ate_index);
 	    pcibr_dmamap->bd_ate_index = ate_index;
@@ -3014,32 +2894,6 @@
 					       min_rrbs - have_rrbs);
 		}
 	    }
-	    if (ate_index >= pcibr_soft->bs_int_ate_size && 
-				!IS_XBRIDGE_OR_PIC_SOFT(pcibr_soft)) {
-		bridge_t               *bridge = pcibr_soft->bs_base;
-		volatile unsigned      *cmd_regp;
-		unsigned                cmd_reg;
-		unsigned long           s;
-
-		pcibr_dmamap->bd_flags |= PCIBR_DMAMAP_SSRAM;
-
-		s = pcibr_lock(pcibr_soft);
-		cmd_regp = pcibr_slot_config_addr(bridge, slot, 
-						PCI_CFG_COMMAND/4);
-		if ( IS_PIC_SOFT(pcibr_soft) ) {
-			cmd_reg = pcibr_slot_config_get(bridge, slot, PCI_CFG_COMMAND/4);
-		}
-		else {
-			if (io_get_sh_swapper(NASID_GET(bridge))) {
-				BRIDGE_REG_SET32((&cmd_reg)) = __swab32(*cmd_regp);
-			} else {
-				cmd_reg = pcibr_slot_config_get(bridge, slot, PCI_CFG_COMMAND/4);
-			}
-		}
-		pcibr_soft->bs_slot[slot].bss_cmd_pointer = cmd_regp;
-		pcibr_soft->bs_slot[slot].bss_cmd_shadow = cmd_reg;
-		pcibr_unlock(pcibr_soft, s);
-	    }
 	    return pcibr_dmamap;
 	}
 	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_DMAMAP, pconn_vhdl,
@@ -3089,7 +2943,7 @@
     }
 
     PCIBR_DEBUG((PCIBR_DEBUG_DMAMAP, pcibr_dmamap->bd_dev,
-		"pcibr_dmamap_free: pcibr_dmamap=0x%x\n", pcibr_dmamap));
+		"pcibr_dmamap_free: pcibr_dmamap=0x%lx\n", pcibr_dmamap));
 
     free_pciio_dmamap(pcibr_dmamap);
 }
@@ -3132,16 +2986,8 @@
 	    return pci_addr;
     	}
     } else {
-    if ((xio_addr >= BRIDGE_PCI_MEM32_BASE) &&
-	(xio_lim <= BRIDGE_PCI_MEM32_LIMIT)) {
-	pci_addr = xio_addr - BRIDGE_PCI_MEM32_BASE;
-	return pci_addr;
-    }
-    if ((xio_addr >= BRIDGE_PCI_MEM64_BASE) &&
-	(xio_lim <= BRIDGE_PCI_MEM64_LIMIT)) {
-	pci_addr = xio_addr - BRIDGE_PCI_MEM64_BASE;
-	return pci_addr;
-    }
+	printk("pcibr_addr_xio_to_pci(): unknown bridge type");
+	return (iopaddr_t)0;
     }
     for (slot = soft->bs_min_slot; slot < PCIBR_NUM_SLOTS(soft); ++slot)
 	if ((xio_addr >= PCIBR_BRIDGE_DEVIO(soft, slot)) &&
@@ -3215,8 +3061,8 @@
 
 	PCIBR_DEBUG((PCIBR_DEBUG_DMAMAP | PCIBR_DEBUG_DMADIR, 
 		    pcibr_dmamap->bd_dev,
-		    "pcibr_dmamap_addr: (direct64): wanted paddr [0x%x..0x%x] "
-		    "XIO port 0x%x offset 0x%x, returning PCI 0x%x\n",
+		    "pcibr_dmamap_addr: (direct64): wanted paddr [0x%lx..0x%lx] "
+		    "XIO port 0x%x offset 0x%lx, returning PCI 0x%lx\n",
 		    paddr, paddr + req_size - 1, xio_port, xio_addr, pci_addr));
 
     } else if (flags & PCIIO_FIXED) {
@@ -3240,8 +3086,8 @@
 
 	PCIBR_DEBUG((PCIBR_DEBUG_DMAMAP | PCIBR_DEBUG_DMADIR, 
 		    pcibr_dmamap->bd_dev,
-		    "pcibr_dmamap_addr (direct32): wanted paddr [0x%x..0x%x] "
-		    "XIO port 0x%x offset 0x%x, returning PCI 0x%x\n",
+		    "pcibr_dmamap_addr (direct32): wanted paddr [0x%lx..0x%lx] "
+		    "XIO port 0x%x offset 0x%lx, returning PCI 0x%lx\n",
 		    paddr, paddr + req_size - 1, xio_port, xio_addr, pci_addr));
 
     } else {
@@ -3285,19 +3131,10 @@
 		ATE_FREEZE();
 		ATE_WRITE();
 		ATE_THAW();
-		if ( IS_PIC_SOFT(pcibr_soft) ) {
-			bridge->b_wid_tflush;	/* wait until Bridge PIO complete */
-		}
-		else {
-			if (io_get_sh_swapper(NASID_GET(bridge))) {
-				BRIDGE_REG_GET32((&bridge->b_wid_tflush));
-			} else {
-				bridge->b_wid_tflush;
-			}
-		}
+		bridge->b_wid_tflush;	/* wait until Bridge PIO complete */
 		PCIBR_DEBUG((PCIBR_DEBUG_DMAMAP, pcibr_dmamap->bd_dev,
 			    "pcibr_dmamap_addr (PMU) : wanted paddr "
-			    "[0x%x..0x%x] returning PCI 0x%x\n", 
+			    "[0x%lx..0x%lx] returning PCI 0x%lx\n", 
 			    paddr, paddr + req_size - 1, pci_addr));
 
 	} else {
@@ -3311,7 +3148,7 @@
 		 */
 		PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_DMAMAP, pcibr_dmamap->bd_dev, 
 		            "pcibr_dmamap_addr (PMU) : wanted paddr "
-			    "[0x%x..0x%x] ate_count 0x%x bd_ate_count 0x%x "
+			    "[0x%lx..0x%lx] ate_count 0x%x bd_ate_count 0x%x "
 			    "ATE's required > number allocated\n",
 			     paddr, paddr + req_size - 1,
 			     ate_count, pcibr_dmamap->bd_ate_count));
@@ -3342,7 +3179,7 @@
     xtalk_dmamap_done(pcibr_dmamap->bd_xtalk);
 
     PCIBR_DEBUG((PCIBR_DEBUG_DMAMAP, pcibr_dmamap->bd_dev,
-		"pcibr_dmamap_done: pcibr_dmamap=0x%x\n", pcibr_dmamap));
+		"pcibr_dmamap_done: pcibr_dmamap=0x%lx\n", pcibr_dmamap));
 }
 
 
@@ -3393,8 +3230,8 @@
 				   flags & DMAMAP_FLAGS);
     if (!xio_addr) {
 	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_DMADIR, pconn_vhdl,
-		    "pcibr_dmatrans_addr: wanted paddr [0x%x..0x%x], "
-		    "xtalk_dmatrans_addr failed with 0x%x\n",
+		    "pcibr_dmatrans_addr: wanted paddr [0x%lx..0x%lx], "
+		    "xtalk_dmatrans_addr failed with 0x%lx\n",
 		    paddr, paddr + req_size - 1, xio_addr));
 	return 0;
     }
@@ -3404,7 +3241,7 @@
     if (XIO_PACKED(xio_addr)) {
 	if (xio_addr == XIO_NOWHERE) {
 	    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_DMADIR, pconn_vhdl,
-		        "pcibr_dmatrans_addr: wanted paddr [0x%x..0x%x], "
+		        "pcibr_dmatrans_addr: wanted paddr [0x%lx..0x%lx], "
 		        "xtalk_dmatrans_addr failed with XIO_NOWHERE\n",
 		        paddr, paddr + req_size - 1));
 	    return 0;
@@ -3425,8 +3262,8 @@
     if (xio_port == pcibr_soft->bs_xid) {
 	pci_addr = pcibr_addr_xio_to_pci(pcibr_soft, xio_addr, req_size);
         PCIBR_DEBUG((PCIBR_DEBUG_DMADIR, pconn_vhdl,
-		    "pcibr_dmatrans_addr:  wanted paddr [0x%x..0x%x], "
-		    "xio_port=0x%x, pci_addr=0x%x\n",
+		    "pcibr_dmatrans_addr:  wanted paddr [0x%lx..0x%lx], "
+		    "xio_port=0x%x, pci_addr=0x%lx\n",
 		    paddr, paddr + req_size - 1, xio_port, pci_addr));
 	return pci_addr;
     }
@@ -3480,19 +3317,16 @@
 					       min_rrbs - have_rrbs);
 		}
 	    }
-#if HWG_PERF_CHECK
-	    if (xio_addr != 0x20000000)
-#endif
-		PCIBR_DEBUG((PCIBR_DEBUG_DMADIR, pconn_vhdl,
-			    "pcibr_dmatrans_addr:  wanted paddr [0x%x..0x%x], "
-			    "xio_port=0x%x, direct64: pci_addr=0x%x, "
-			    "new flags: 0x%x\n", paddr, paddr + req_size - 1,
-			    xio_addr, pci_addr, (uint64_t) flags));
+	    PCIBR_DEBUG((PCIBR_DEBUG_DMADIR, pconn_vhdl,
+			"pcibr_dmatrans_addr:  wanted paddr [0x%lx..0x%lx], "
+			"xio_port=0x%x, direct64: pci_addr=0x%lx, "
+			"new flags: 0x%x\n", paddr, paddr + req_size - 1,
+			xio_addr, pci_addr, (uint64_t) flags));
 	    return (pci_addr);
 	}
 
 	PCIBR_DEBUG((PCIBR_DEBUG_DMADIR, pconn_vhdl,
-		    "pcibr_dmatrans_addr:  wanted paddr [0x%x..0x%x], "
+		    "pcibr_dmatrans_addr:  wanted paddr [0x%lx..0x%lx], "
 		    "xio_port=0x%x, Unable to set direct64 Device(x) bits\n",
 		    paddr, paddr + req_size - 1, xio_addr));
 
@@ -3503,6 +3337,11 @@
 
 	/* our flags conflict with Device(x). try direct32*/
 	flags = flags & ~(PCIIO_DMA_A64 | PCIBR_VCHAN0);
+    } else {
+	/* BUS in PCI-X mode only supports 64-bit direct mapping */
+	if (IS_PCIX(pcibr_soft)) {
+	    return 0;
+	}
     }
     /* Try to satisfy the request with the 32-bit direct
      * map. This can fail if the configuration bits in
@@ -3521,7 +3360,7 @@
 	    (endoff > map_size)) {
 
 	    PCIBR_DEBUG((PCIBR_DEBUG_DMADIR, pconn_vhdl,
-			"pcibr_dmatrans_addr:  wanted paddr [0x%x..0x%x], "
+			"pcibr_dmatrans_addr:  wanted paddr [0x%lx..0x%lx], "
 			"xio_port=0x%x, xio region outside direct32 target\n",
 			paddr, paddr + req_size - 1, xio_addr));
 	} else {
@@ -3532,8 +3371,8 @@
 		pci_addr |= offset;
 
 		PCIBR_DEBUG((PCIBR_DEBUG_DMADIR, pconn_vhdl,
-                            "pcibr_dmatrans_addr:  wanted paddr [0x%x..0x%x], "
-                            "xio_port=0x%x, direct32: pci_addr=0x%x\n",
+                            "pcibr_dmatrans_addr:  wanted paddr [0x%lx..0x%lx],"
+                            " xio_port=0x%x, direct32: pci_addr=0x%lx\n",
                             paddr, paddr + req_size - 1, xio_addr, pci_addr));
 
 		return (pci_addr);
@@ -3559,12 +3398,9 @@
 						   vchan, min_rrbs - have_rrbs);
 		    }
 		}
-#if HWG_PERF_CHECK
-		if (xio_addr != 0x20000000)
-#endif
-                    PCIBR_DEBUG((PCIBR_DEBUG_DMADIR, pconn_vhdl,
-                            "pcibr_dmatrans_addr:  wanted paddr [0x%x..0x%x], "
-                            "xio_port=0x%x, direct32: pci_addr=0x%x, "
+		PCIBR_DEBUG((PCIBR_DEBUG_DMADIR, pconn_vhdl,
+                            "pcibr_dmatrans_addr:  wanted paddr [0x%lx..0x%lx],"
+                            " xio_port=0x%x, direct32: pci_addr=0x%lx, "
 			    "new flags: 0x%x\n", paddr, paddr + req_size - 1,
 			    xio_addr, pci_addr, (uint64_t) flags));
 
@@ -3573,14 +3409,14 @@
 	    /* our flags conflict with Device(x).
 	     */
 	    PCIBR_DEBUG((PCIBR_DEBUG_DMADIR, pconn_vhdl,
-                    "pcibr_dmatrans_addr:  wanted paddr [0x%x..0x%x], "
+                    "pcibr_dmatrans_addr:  wanted paddr [0x%lx..0x%lx], "
                     "xio_port=0x%x, Unable to set direct32 Device(x) bits\n",
                     paddr, paddr + req_size - 1, xio_port));
 	}
     }
 
     PCIBR_DEBUG((PCIBR_DEBUG_DMADIR, pconn_vhdl,
-		"pcibr_dmatrans_addr:  wanted paddr [0x%x..0x%x], "
+		"pcibr_dmatrans_addr:  wanted paddr [0x%lx..0x%lx], "
 		"xio_port=0x%x, No acceptable PCI address found\n",
 		paddr, paddr + req_size - 1, xio_port));
 
@@ -3680,22 +3516,9 @@
     if (pcibr_soft->bs_slot[pciio_slot].bss_device != devreg) {
 	bridge_t               *bridge = pcibr_soft->bs_base;
 
-	if ( IS_PIC_SOFT(pcibr_soft) ) {
-		bridge->b_device[pciio_slot].reg = devreg;
-		pcibr_soft->bs_slot[pciio_slot].bss_device = devreg;
-		bridge->b_wid_tflush;		/* wait until Bridge PIO complete */
-	}
-	else {
-		if (io_get_sh_swapper(NASID_GET(bridge))) {
-			BRIDGE_REG_SET32((&bridge->b_device[pciio_slot].reg)) = __swab32(devreg);
-			pcibr_soft->bs_slot[pciio_slot].bss_device = devreg;
-			BRIDGE_REG_GET32((&bridge->b_wid_tflush));/* wait until Bridge PIO complete */
-		} else {
-			bridge->b_device[pciio_slot].reg = devreg;
-			pcibr_soft->bs_slot[pciio_slot].bss_device = devreg;
-			bridge->b_wid_tflush;           /* wait until Bridge PIO complete */
-		}
-	}
+	bridge->b_device[pciio_slot].reg = devreg;
+	pcibr_soft->bs_slot[pciio_slot].bss_device = devreg;
+	bridge->b_wid_tflush;		/* wait until Bridge PIO complete */
     }
     pcibr_unlock(pcibr_soft, s);
 
@@ -3767,22 +3590,9 @@
     if (pcibr_soft->bs_slot[pciio_slot].bss_device != devreg) {
 	bridge_t               *bridge = pcibr_soft->bs_base;
 
-	if ( IS_PIC_SOFT(pcibr_soft) ) {
-		bridge->b_device[pciio_slot].reg = devreg;
-		pcibr_soft->bs_slot[pciio_slot].bss_device = devreg;
-		bridge->b_wid_tflush;		/* wait until Bridge PIO complete */
-	}
-	else {
-		if (io_get_sh_swapper(NASID_GET(bridge))) {
-			BRIDGE_REG_SET32((&bridge->b_device[pciio_slot].reg)) = __swab32(devreg);
-			pcibr_soft->bs_slot[pciio_slot].bss_device = devreg;
-			BRIDGE_REG_GET32((&bridge->b_wid_tflush));/* wait until Bridge PIO complete */
-		} else {
-			bridge->b_device[pciio_slot].reg = devreg;
-			pcibr_soft->bs_slot[pciio_slot].bss_device = devreg;
-			bridge->b_wid_tflush;           /* wait until Bridge PIO complete */
-		}
-	}
+	bridge->b_device[pciio_slot].reg = devreg;
+	pcibr_soft->bs_slot[pciio_slot].bss_device = devreg;
+	bridge->b_wid_tflush;		/* wait until Bridge PIO complete */
     }
     pcibr_unlock(pcibr_soft, s);
 
@@ -3865,25 +3675,15 @@
 	if (pcibr_soft->bs_slot[pciio_slot].bss_device != devreg) {
 	    bridge_t               *bridge = pcibr_soft->bs_base;
 
-	    if ( IS_PIC_SOFT(pcibr_soft) ) {
-		bridge->b_device[pciio_slot].reg = devreg;
-		pcibr_soft->bs_slot[pciio_slot].bss_device = devreg;
-		bridge->b_wid_tflush;	/* wait until Bridge PIO complete */
-	    }
-	    else {
-		if (io_get_sh_swapper(NASID_GET(bridge))) {
-			BRIDGE_REG_SET32((&bridge->b_device[pciio_slot].reg)) = __swab32(devreg);
-			pcibr_soft->bs_slot[pciio_slot].bss_device = devreg;
-			BRIDGE_REG_GET32((&bridge->b_wid_tflush));/* wait until Bridge PIO complete */
-		} else {
-			bridge->b_device[pciio_slot].reg = devreg;
-			pcibr_soft->bs_slot[pciio_slot].bss_device = devreg;
-			bridge->b_wid_tflush;       /* wait until Bridge PIO complete */
-		}
-	    }
+	    bridge->b_device[pciio_slot].reg = devreg;
+	    pcibr_soft->bs_slot[pciio_slot].bss_device = devreg;
+	    bridge->b_wid_tflush;	/* wait until Bridge PIO complete */
 	}
 	pcibr_unlock(pcibr_soft, s);
-	printk("pcibr_device_flags_set: Device(%d): %x\n", pciio_slot, devreg);
+
+	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_DEVREG, pconn_vhdl,
+		    "pcibr_device_flags_set: Device(%d): 0x%x\n",
+		    pciio_slot, devreg));
     }
     return (1);
 }
@@ -3967,25 +3767,12 @@
     (pciio_priority_set_f *) pcibr_priority_set,
     (pciio_config_get_f *) pcibr_config_get,
     (pciio_config_set_f *) pcibr_config_set,
-    (pciio_error_devenable_f *) 0,
     (pciio_error_extract_f *) 0,
     (pciio_driver_reg_callback_f *) 0,
     (pciio_driver_unreg_callback_f *) 0,
     (pciio_device_unregister_f 	*) pcibr_device_unregister,
-    (pciio_dma_enabled_f		*) pcibr_dma_enabled,
 };
 
-int
-pcibr_dma_enabled(vertex_hdl_t pconn_vhdl)
-{
-    pciio_info_t            pciio_info = pciio_info_get(pconn_vhdl);
-    pcibr_soft_t            pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info);
-	
-
-    return xtalk_dma_enabled(pcibr_soft->bs_conn);
-}
-
-
 /*
  * pcibr_debug() is used to print pcibr debug messages to the console.  A
  * user enables tracing by setting the following global variables:
@@ -4020,23 +3807,26 @@
                 if (strcmp(module, pcibr_debug_module)) {
 		    /* use a copy */
                     (void)strcpy(copy_of_hwpath, hwpath);
-                    cp = strstr(copy_of_hwpath, "/module/");
+		    cp = strstr(copy_of_hwpath, "/" EDGE_LBL_MODULE "/");
                     if (cp) {
-                        cp += strlen("/module");
-                        module = strsep(&cp, "/");
+                        cp += strlen("/" EDGE_LBL_MODULE "/");
+			module = strsep(&cp, "/");
                     }
                 }
                 if (pcibr_debug_widget != -1) {
-                    cp = strstr(hwpath, "/xtalk/");
+		    cp = strstr(hwpath, "/" EDGE_LBL_XTALK "/");
                     if (cp) {
-                        cp += strlen("/xtalk/");
+			cp += strlen("/" EDGE_LBL_XTALK "/");
                         widget = simple_strtoul(cp, NULL, 0);
                     }
                 }
                 if (pcibr_debug_slot != -1) {
-                    cp = strstr(hwpath, "/pci/");
+		    cp = strstr(hwpath, "/" EDGE_LBL_PCIX_0 "/");
+		    if (!cp) {
+			cp = strstr(hwpath, "/" EDGE_LBL_PCIX_1 "/");
+		    }
                     if (cp) {
-                        cp += strlen("/pci/");
+                        cp += strlen("/" EDGE_LBL_PCIX_0 "/");
                         slot = simple_strtoul(cp, NULL, 0);
                     }
                 }
diff -Nru a/arch/ia64/sn/io/sn2/pcibr/pcibr_error.c b/arch/ia64/sn/io/sn2/pcibr/pcibr_error.c
--- a/arch/ia64/sn/io/sn2/pcibr/pcibr_error.c	Tue Feb  3 19:45:16 2004
+++ b/arch/ia64/sn/io/sn2/pcibr/pcibr_error.c	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,4 @@
 /*
- *
  * 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.
@@ -8,26 +7,15 @@
  */
 
 #include <linux/types.h>
-#include <linux/slab.h>
-#include <linux/module.h>
+#include <linux/interrupt.h>
 #include <asm/sn/sgi.h>
-#include <asm/sn/sn_cpuid.h>
 #include <asm/sn/addrs.h>
-#include <asm/sn/arch.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
-#include <asm/sn/hcl.h>
-#include <asm/sn/labelcl.h>
-#include <asm/sn/xtalk/xwidget.h>
-#include <asm/sn/pci/bridge.h>
 #include <asm/sn/pci/pciio.h>
 #include <asm/sn/pci/pcibr.h>
 #include <asm/sn/pci/pcibr_private.h>
 #include <asm/sn/pci/pci_defs.h>
-#include <asm/sn/prio.h>
-#include <asm/sn/xtalk/xbow.h>
-#include <asm/sn/io.h>
-#include <asm/sn/sn_private.h>
+
 
 extern int	hubii_check_widget_disabled(nasid_t, int);
 
@@ -43,12 +31,9 @@
 #define BRIDGE_PIOERR_TIMEOUT	40	/* Timeout in debug mode  */
 #endif
 #else
-#define BRIDGE_PIOERR_TIMEOUT	1	/* Timeout in non-debug mode                            */
+#define BRIDGE_PIOERR_TIMEOUT	1	/* Timeout in non-debug mode */
 #endif
 
-/* PIC has 64bit interrupt error registers, but BRIDGE has 32bit registers.
- * Thus 'bridge_errors_to_dump needs' to default to the larger of the two.
- */
 #ifdef  DEBUG
 #ifdef ERROR_DEBUG
 uint64_t bridge_errors_to_dump = ~BRIDGE_ISR_INT_MSK;
@@ -62,7 +47,29 @@
 
 int                     pcibr_llp_control_war_cnt; /* PCIBR_LLP_CONTROL_WAR */
 
-static struct reg_values xio_cmd_pactyp[] =
+/*
+ * register values
+ * map between numeric values and symbolic values
+ */
+struct reg_values {
+	unsigned long long rv_value;
+	char *rv_name;
+};
+
+/*
+ * register descriptors are used for formatted prints of register values
+ * rd_mask and rd_shift must be defined, other entries may be null
+ */
+struct reg_desc {
+	unsigned long long rd_mask;	/* mask to extract field */
+	int rd_shift;		/* shift for extracted value, - >>, + << */
+	char *rd_name;		/* field name */
+	char *rd_format;	/* format to print field */
+	struct reg_values *rd_values;	/* symbolic names of values */
+};
+
+/* Crosstalk Packet Types */
+static struct reg_values xtalk_cmd_pactyp[] =
 {
     {0x0, "RdReq"},
     {0x1, "RdResp"},
@@ -83,11 +90,11 @@
     {0}
 };
 
-static struct reg_desc   xio_cmd_bits[] =
+static struct reg_desc   xtalk_cmd_bits[] =
 {
     {WIDGET_DIDN, -28, "DIDN", "%x"},
     {WIDGET_SIDN, -24, "SIDN", "%x"},
-    {WIDGET_PACTYP, -20, "PACTYP", 0, xio_cmd_pactyp},
+    {WIDGET_PACTYP, -20, "PACTYP", 0, xtalk_cmd_pactyp},
     {WIDGET_TNUM, -15, "TNUM", "%x"},
     {WIDGET_COHERENT, 0, "COHERENT"},
     {WIDGET_DS, 0, "DS"},
@@ -118,46 +125,16 @@
     {PCIIO_SPACE_BAD, "BAD"},
     {0}
 };
-static struct reg_desc         space_desc[] =
+struct reg_desc         space_desc[] =
 {
     {0xFF, 0, "space", 0, space_v},
     {0}
 };
-#define	device_desc	device_bits
-static struct reg_desc   device_bits[] =
-{
-    {BRIDGE_DEV_ERR_LOCK_EN, 0, "ERR_LOCK_EN"},
-    {BRIDGE_DEV_PAGE_CHK_DIS, 0, "PAGE_CHK_DIS"},
-    {BRIDGE_DEV_FORCE_PCI_PAR, 0, "FORCE_PCI_PAR"},
-    {BRIDGE_DEV_VIRTUAL_EN, 0, "VIRTUAL_EN"},
-    {BRIDGE_DEV_PMU_WRGA_EN, 0, "PMU_WRGA_EN"},
-    {BRIDGE_DEV_DIR_WRGA_EN, 0, "DIR_WRGA_EN"},
-    {BRIDGE_DEV_DEV_SIZE, 0, "DEV_SIZE"},
-    {BRIDGE_DEV_RT, 0, "RT"},
-    {BRIDGE_DEV_SWAP_PMU, 0, "SWAP_PMU"},
-    {BRIDGE_DEV_SWAP_DIR, 0, "SWAP_DIR"},
-    {BRIDGE_DEV_PREF, 0, "PREF"},
-    {BRIDGE_DEV_PRECISE, 0, "PRECISE"},
-    {BRIDGE_DEV_COH, 0, "COH"},
-    {BRIDGE_DEV_BARRIER, 0, "BARRIER"},
-    {BRIDGE_DEV_GBR, 0, "GBR"},
-    {BRIDGE_DEV_DEV_SWAP, 0, "DEV_SWAP"},
-    {BRIDGE_DEV_DEV_IO_MEM, 0, "DEV_IO_MEM"},
-    {BRIDGE_DEV_OFF_MASK, BRIDGE_DEV_OFF_ADDR_SHFT, "DEV_OFF", "%x"},
-    {0}
-};
-
-static void
-print_bridge_errcmd(uint32_t cmdword, char *errtype)
-{
-    printk("\t    Bridge %s Error Command Word Register ", errtype);
-    print_register(cmdword, xio_cmd_bits);
-}
 
 static char             *pcibr_isr_errs[] =
 {
     "", "", "", "", "", "", "", "",
-    "08: GIO non-contiguous byte enable in crosstalk packet", /* BRIDGE ONLY */
+    "08: Reserved Bit 08",
     "09: PCI to Crosstalk read request timeout",
     "10: PCI retry operation count exhausted.",
     "11: PCI bus device select timeout",
@@ -165,12 +142,12 @@
     "13: PCI Address/Cmd parity error ",
     "14: PCI Bridge detected parity error",
     "15: PCI abort condition",
-    "16: SSRAM parity error", /* BRIDGE ONLY */
-    "17: LLP Transmitter Retry count wrapped",
-    "18: LLP Transmitter side required Retry",
-    "19: LLP Receiver retry count wrapped",
-    "20: LLP Receiver check bit error",
-    "21: LLP Receiver sequence number error",
+    "16: Reserved Bit 16",
+    "17: LLP Transmitter Retry count wrapped",	/* PIC ONLY */
+    "18: LLP Transmitter side required Retry",	/* PIC ONLY */
+    "19: LLP Receiver retry count wrapped",	/* PIC ONLY */
+    "20: LLP Receiver check bit error",		/* PIC ONLY */
+    "21: LLP Receiver sequence number error",	/* PIC ONLY */
     "22: Request packet overflow",
     "23: Request operation not supported by bridge",
     "24: Request packet has invalid address for bridge widget",
@@ -180,9 +157,7 @@
     "28: Framing error, response cmd data size does not match actual",
     "29: Unexpected response arrived",
     "30: PMU Access Fault",
-    "31: Multiple errors occurred", /* BRIDGE ONLY */
-    
-    /* bits 32-45 are PIC ONLY */
+    "31: Reserved Bit 31",
     "32: PCI-X address or attribute cycle parity error",
     "33: PCI-X data cycle parity error",
     "34: PCI-X master timeout (ie. master abort)",
@@ -199,11 +174,86 @@
     "45: PCI-X split completion message parity error",
 };
 
-#define BEM_ADD_STR(s)  printk("%s", (s))
-#define BEM_ADD_VAR(v)  printk("\t%20s: 0x%llx\n", #v, ((unsigned long long)v))
-#define BEM_ADD_REG(r)  printk("\t%20s: ", #r); print_register((r), r ## _desc)
-#define BEM_ADD_NSPC(n,s)       printk("\t%20s: ", n); print_register(s, space_desc)
-#define BEM_ADD_SPC(s)          BEM_ADD_NSPC(#s, s)
+/*
+ * print_register() allows formatted printing of bit fields.  individual
+ * bit fields are described by a struct reg_desc, multiple bit fields within
+ * a single word can be described by multiple reg_desc structures.
+ * %r outputs a string of the format "<bit field descriptions>"
+ * %R outputs a string of the format "0x%x<bit field descriptions>"
+ *
+ * The fields in a reg_desc are:
+ *	unsigned long long rd_mask; An appropriate mask to isolate the bit field
+ *				within a word, and'ed with val
+ *
+ *	int rd_shift;		A shift amount to be done to the isolated
+ *				bit field.  done before printing the isolate
+ *				bit field with rd_format and before searching
+ *				for symbolic value names in rd_values
+ *
+ *	char *rd_name;		If non-null, a bit field name to label any
+ *				out from rd_format or searching rd_values.
+ *				if neither rd_format or rd_values is non-null
+ *				rd_name is printed only if the isolated
+ *				bit field is non-null.
+ *
+ *	char *rd_format;	If non-null, the shifted bit field value
+ *				is printed using this format.
+ *
+ *	struct reg_values *rd_values;	If non-null, a pointer to a table
+ *				matching numeric values with symbolic names.
+ *				rd_values are searched and the symbolic
+ *				value is printed if a match is found, if no
+ *				match is found "???" is printed.
+ *				
+ */
+
+static void
+print_register(unsigned long long reg, struct reg_desc *addr)
+{
+	register struct reg_desc *rd;
+	register struct reg_values *rv;
+	unsigned long long field;
+	int any;
+
+	printk("<");
+	any = 0;
+	for (rd = addr; rd->rd_mask; rd++) {
+		field = reg & rd->rd_mask;
+		field = (rd->rd_shift > 0) ? field << rd->rd_shift : field >> -rd->rd_shift;
+		if (any && (rd->rd_format || rd->rd_values || (rd->rd_name && field)))
+			printk(",");
+		if (rd->rd_name) {
+			if (rd->rd_format || rd->rd_values || field) {
+				printk("%s", rd->rd_name);
+				any = 1;
+			}
+			if (rd->rd_format || rd->rd_values) {
+				printk("=");
+				any = 1;
+			}
+		}
+		/* You can have any format so long as it is %x */
+		if (rd->rd_format) {
+			printk("%llx", field);
+			any = 1;
+			if (rd->rd_values)
+				printk(":");
+		}
+		if (rd->rd_values) {
+			any = 1;
+			for (rv = rd->rd_values; rv->rv_name; rv++) {
+				if (field == rv->rv_value) {
+					printk("%s", rv->rv_name);
+					break;
+				}
+			}
+			if (rv->rv_name == NULL)
+				printk("???");
+		}
+	}
+	printk(">\n");
+}
+
 
 /*
  * display memory directory state
@@ -225,6 +275,13 @@
 #endif
 }
 
+static void
+print_bridge_errcmd(uint32_t cmdword, char *errtype)
+{
+    printk("\t    Bridge %s Error Command Word Register ", errtype);
+    print_register(cmdword, xtalk_cmd_bits);
+}
+
 
 /*
  *	Dump relevant error information for Bridge error interrupts.
@@ -235,10 +292,8 @@
 {
     bridge_t               *bridge = pcibr_soft->bs_base;
     uint64_t		    int_status;
-    bridgereg_t             int_status_32;
     picreg_t		    int_status_64;
     uint64_t		    mult_int;
-    bridgereg_t             mult_int_32;
     picreg_t		    mult_int_64;
     uint64_t		    bit;
     int			    number_bits;
@@ -246,19 +301,9 @@
     char		    *reg_desc;
     paddr_t		    addr = (paddr_t)0;
 
-    /* We read the INT_STATUS register as a 64bit picreg_t for PIC and a
-     * 32bit bridgereg_t for BRIDGE, but always process the result as a
-     * 64bit value so the code can be "common" for both PIC and BRIDGE...
-     */
-    if (IS_PIC_SOFT(pcibr_soft)) {
-	int_status_64 = (bridge->p_int_status_64 & ~BRIDGE_ISR_INT_MSK);
-	int_status = (uint64_t)int_status_64;
-	number_bits = PCIBR_ISR_MAX_ERRS_PIC;
-    } else {
-	int_status_32 = (bridge->b_int_status & ~BRIDGE_ISR_INT_MSK);
-	int_status = ((uint64_t)int_status_32) & 0xffffffff;
-	number_bits = PCIBR_ISR_MAX_ERRS_BRIDGE;
-    }
+    int_status_64 = (bridge->p_int_status_64 & ~BRIDGE_ISR_INT_MSK);
+    int_status = (uint64_t)int_status_64;
+    number_bits = PCIBR_ISR_MAX_ERRS_PIC;
 
     if (!int_status) {
 	/* No error bits set */
@@ -273,8 +318,7 @@
     printk(KERN_ALERT "PCI BRIDGE ERROR: int_status is 0x%lx for %s\n"
 	"    Dumping relevant %s registers for each bit set...\n",
 	    int_status, pcibr_soft->bs_name,
-	    (IS_PIC_SOFT(pcibr_soft) ? "PIC" : 
-	        (IS_BRIDGE_SOFT(pcibr_soft) ? "BRIDGE" : "XBRIDGE")));
+	    "PIC");
 
     for (i = PCIBR_ISR_ERR_START; i < number_bits; i++) {
 	bit = 1ull << i;
@@ -283,15 +327,14 @@
 	 * A number of int_status bits are only defined for Bridge.
 	 * Ignore them in the case of an XBridge or PIC.
 	 */
-	if ((IS_XBRIDGE_SOFT(pcibr_soft) || IS_PIC_SOFT(pcibr_soft)) &&
-	    ((bit == BRIDGE_ISR_MULTI_ERR) ||
+	if (((bit == BRIDGE_ISR_MULTI_ERR) ||
 	     (bit == BRIDGE_ISR_SSRAM_PERR) ||
 	     (bit == BRIDGE_ISR_GIO_B_ENBL_ERR))) {
 	    continue;
 	}
 
 	/* A number of int_status bits are only valid for PIC's bus0 */
-	if ((IS_PIC_SOFT(pcibr_soft) && (pcibr_soft->bs_busnum != 0)) && 
+	if (((pcibr_soft->bs_busnum != 0)) && 
 	    ((bit == BRIDGE_ISR_UNSUPPORTED_XOP) ||
 	     (bit == BRIDGE_ISR_LLP_REC_SNERR) ||
 	     (bit == BRIDGE_ISR_LLP_REC_CBERR) ||
@@ -314,7 +357,7 @@
 
 	    case PIC_ISR_PCIX_ARB_ERR:	    /* bit40	PCI_X_ARB_ERR */
 		/* XXX: should breakdown meaning of bits in reg */
-		printk( "\t	Arbitration Reg: 0x%x\n",
+		printk( "\t	Arbitration Reg: 0x%lx\n",
 		    bridge->b_arb);
 		break;
 
@@ -357,10 +400,7 @@
 		break;
 
 	    case BRIDGE_ISR_PAGE_FAULT:	    /* bit30	PMU_PAGE_FAULT */
-		if (IS_XBRIDGE_OR_PIC_SOFT(pcibr_soft))
-		    reg_desc = "Map Fault Address";
-		else
-		    reg_desc = "SSRAM Parity Error";
+	        reg_desc = "Map Fault Address";
 
 		printk( "\t    %s Register: 0x%x\n", reg_desc,
 		    bridge->b_ram_perr_or_map_fault);
@@ -370,7 +410,7 @@
 		print_bridge_errcmd(bridge->b_wid_aux_err, "Aux ");
 
 		/* PIC in PCI-X mode, dump the PCIX DMA Request registers */
-		if (IS_PIC_SOFT(pcibr_soft) && IS_PCIX(pcibr_soft)) {
+		if (IS_PCIX(pcibr_soft)) {
 		    /* XXX: should breakdown meaning of attr bit */
 		    printk( 
 			"\t    PCI-X DMA Request Error Addr Reg: 0x%lx\n"
@@ -382,32 +422,14 @@
 
 	    case BRIDGE_ISR_BAD_XRESP_PKT:  /* bit28	BAD_RESP_PACKET */
 	    case BRIDGE_ISR_RESP_XTLK_ERR:  /* bit26	RESP_XTALK_ERROR */
-		if (IS_PIC_SOFT(pcibr_soft)) {
-		    print_bridge_errcmd(bridge->b_wid_aux_err, "Aux ");
-		}
+	        print_bridge_errcmd(bridge->b_wid_aux_err, "Aux ");
 		 
-		/* If PIC in PCI-X mode, DMA Request Error registers are
-		 * valid.  But PIC in PCI mode, Response Buffer Address 
-		 * register are valid.
-		 */
-		if (IS_PCIX(pcibr_soft)) {
-		    /* XXX: should breakdown meaning of attribute bit */
-		    printk( 
+		/* XXX: should breakdown meaning of attribute bit */
+		printk( 
 			"\t    PCI-X DMA Request Error Addr Reg: 0x%lx\n"
 		        "\t    PCI-X DMA Request Error Attribute Reg: 0x%lx\n",
 		        bridge->p_pcix_dma_req_err_addr_64,
 		        bridge->p_pcix_dma_req_err_attr_64);
-		} else {
-		    addr= (((uint64_t)(bridge->b_wid_resp_upper & 0xFFFF)<<32)
-			   | bridge->b_wid_resp_lower);
-		    printk("\t    Bridge Response Buf Error Upper Addr Reg: 0x%x\n"
-		        "\t    Bridge Response Buf Error Lower Addr Reg: 0x%x\n"
-		        "\t    dev-num %d buff-num %d addr 0x%lx\n",
-		        bridge->b_wid_resp_upper, bridge->b_wid_resp_lower,
-		        ((bridge->b_wid_resp_upper >> 20) & 0x3),
-		        ((bridge->b_wid_resp_upper >> 16) & 0xF),
-		        addr);
-		}
 		if (bit == BRIDGE_ISR_RESP_XTLK_ERR) {
 			/* display memory directory associated with cacheline */
 			pcibr_show_dir_state(addr, "\t    ");
@@ -429,40 +451,17 @@
 		break;
 
 	    case BRIDGE_ISR_UNSUPPORTED_XOP:/* bit23	UNSUPPORTED_XOP */
-		if (IS_PIC_SOFT(pcibr_soft)) {
-		    print_bridge_errcmd(bridge->b_wid_aux_err, "Aux ");
-		    printk( 
+		print_bridge_errcmd(bridge->b_wid_aux_err, "Aux ");
+		printk( 
 			"\t    Address Holding Link Side Error Reg: 0x%lx\n",
-			bridge->p_addr_lkerr_64);
-		} else {
-		    print_bridge_errcmd(bridge->b_wid_err_cmdword, "");
-		    printk( 
-			"\t    Bridge Error Upper Address Register: 0x%lx\n"
-		        "\t    Bridge Error Lower Address Register: 0x%lx\n"
-		        "\t    Bridge Error Address: 0x%lx\n",
-		        (uint64_t) bridge->b_wid_err_upper,
-		        (uint64_t) bridge->b_wid_err_lower,
-		        (((uint64_t) bridge->b_wid_err_upper << 32) |
-		        bridge->b_wid_err_lower));
-		}
+		bridge->p_addr_lkerr_64);
 		break;
 
 	    case BRIDGE_ISR_XREQ_FIFO_OFLOW:/* bit22	XREQ_FIFO_OFLOW */
-		/* Link side error registers are only valid for PIC */
-		if (IS_PIC_SOFT(pcibr_soft)) {
-		    print_bridge_errcmd(bridge->b_wid_aux_err, "Aux ");
-		    printk(
+		print_bridge_errcmd(bridge->b_wid_aux_err, "Aux ");
+		printk(
 			"\t    Address Holding Link Side Error Reg: 0x%lx\n",
-			bridge->p_addr_lkerr_64);
-		}
-		break;
-
-	    case BRIDGE_ISR_SSRAM_PERR:	    /* bit16	SSRAM_PERR */
-		if (IS_BRIDGE_SOFT(pcibr_soft)) {
-		    printk(
-			"\t    Bridge SSRAM Parity Error Register: 0x%x\n",
-			bridge->b_ram_perr);
-		}
+		bridge->p_addr_lkerr_64);
 		break;
 
 	    case BRIDGE_ISR_PCI_ABORT:	    /* bit15	PCI_ABORT */
@@ -498,23 +497,13 @@
 	}
     }
 
-    /* We read the INT_MULT register as a 64bit picreg_t for PIC and a
-     * 32bit bridgereg_t for BRIDGE, but always process the result as a
-     * 64bit value so the code can be "common" for both PIC and BRIDGE...
-     */
-    if (IS_PIC_SOFT(pcibr_soft)) {
-	mult_int_64 = (bridge->p_mult_int_64 & ~BRIDGE_ISR_INT_MSK);
-	mult_int = (uint64_t)mult_int_64;
-	number_bits = PCIBR_ISR_MAX_ERRS_PIC;
-    } else {
-	mult_int_32 = (bridge->b_mult_int & ~BRIDGE_ISR_INT_MSK);
-	mult_int = ((uint64_t)mult_int_32) & 0xffffffff;
-	number_bits = PCIBR_ISR_MAX_ERRS_BRIDGE;
-    }
+    mult_int_64 = (bridge->p_mult_int_64 & ~BRIDGE_ISR_INT_MSK);
+    mult_int = (uint64_t)mult_int_64;
+    number_bits = PCIBR_ISR_MAX_ERRS_PIC;
 
-    if (IS_XBRIDGE_OR_PIC_SOFT(pcibr_soft)&&(mult_int & ~BRIDGE_ISR_INT_MSK)) {
+    if (mult_int & ~BRIDGE_ISR_INT_MSK) {
 	printk( "    %s Multiple Interrupt Register is 0x%lx\n",
-		IS_PIC_SOFT(pcibr_soft) ? "PIC" : "XBridge", mult_int);
+		"PIC", mult_int);
 	for (i = PCIBR_ISR_ERR_START; i < number_bits; i++) {
 	    if (mult_int & (1ull << i))
 		printk( "\t%s\n", pcibr_isr_errs[i]);
@@ -522,29 +511,6 @@
     }
 }
 
-static uint32_t
-pcibr_errintr_group(uint32_t error)
-{
-    uint32_t              group = BRIDGE_IRR_MULTI_CLR;
-
-    if (error & BRIDGE_IRR_PCI_GRP)
-	group |= BRIDGE_IRR_PCI_GRP_CLR;
-    if (error & BRIDGE_IRR_SSRAM_GRP)
-	group |= BRIDGE_IRR_SSRAM_GRP_CLR;
-    if (error & BRIDGE_IRR_LLP_GRP)
-	group |= BRIDGE_IRR_LLP_GRP_CLR;
-    if (error & BRIDGE_IRR_REQ_DSP_GRP)
-	group |= BRIDGE_IRR_REQ_DSP_GRP_CLR;
-    if (error & BRIDGE_IRR_RESP_BUF_GRP)
-	group |= BRIDGE_IRR_RESP_BUF_GRP_CLR;
-    if (error & BRIDGE_IRR_CRP_GRP)
-	group |= BRIDGE_IRR_CRP_GRP_CLR;
-
-    return group;
-
-}
-
-
 /* pcibr_pioerr_check():
  *	Check to see if this pcibr has a PCI PIO
  *	TIMEOUT error; if so, bump the timeout-count
@@ -555,7 +521,6 @@
 {
     bridge_t		   *bridge;
     uint64_t              int_status;
-    bridgereg_t             int_status_32;
     picreg_t                int_status_64;
     bridgereg_t		    pci_err_lower;
     bridgereg_t		    pci_err_upper;
@@ -568,18 +533,8 @@
     int			    func;
 
     bridge = soft->bs_base;
-
-    /* We read the INT_STATUS register as a 64bit picreg_t for PIC and a
-     * 32bit bridgereg_t for BRIDGE, but always process the result as a
-     * 64bit value so the code can be "common" for both PIC and BRIDGE...
-     */
-    if (IS_PIC_SOFT(soft)) {
-        int_status_64 = (bridge->p_int_status_64 & ~BRIDGE_ISR_INT_MSK);
-        int_status = (uint64_t)int_status_64;
-    } else {
-        int_status_32 = (bridge->b_int_status & ~BRIDGE_ISR_INT_MSK);
-        int_status = ((uint64_t)int_status_32) & 0xffffffff;
-    }
+    int_status_64 = (bridge->p_int_status_64 & ~BRIDGE_ISR_INT_MSK);
+    int_status = (uint64_t)int_status_64;
 
     if (int_status & BRIDGE_ISR_PCIBUS_PIOERR) {
 	pci_err_lower = bridge->b_pci_err_lower;
@@ -636,14 +591,13 @@
  *                due to read or write error!.
  */
 
-void
+irqreturn_t
 pcibr_error_intr_handler(int irq, void *arg, struct pt_regs *ep)
 {
     pcibr_soft_t            pcibr_soft;
     bridge_t               *bridge;
     uint64_t              int_status;
     uint64_t              err_status;
-    bridgereg_t             int_status_32;
     picreg_t                int_status_64;
     int			    number_bits;
     int                     i;
@@ -662,7 +616,9 @@
 	entry = pcibr_list;
 	while (1) {
 	    if (entry == NULL) {
-		PRINT_PANIC("pcibr_error_intr_handler:\tmy parameter (0x%p) is not a pcibr_soft!", arg);
+		printk("pcibr_error_intr_handler: (0x%lx) is not a pcibr_soft!",
+	 	      (uint64_t)arg);
+    		return IRQ_NONE;
 	    }
 	    if ((intr_arg_t) entry->bl_soft == arg)
 		break;
@@ -706,22 +662,12 @@
 	return(pcibr_error_intr_handler(irq, arg, ep));
     }
 
-    /* We read the INT_STATUS register as a 64bit picreg_t for PIC and a
-     * 32bit bridgereg_t for BRIDGE, but always process the result as a
-     * 64bit value so the code can be "common" for both PIC and BRIDGE...
-     */
-    if (IS_PIC_SOFT(pcibr_soft)) {
-        int_status_64 = (bridge->p_int_status_64 & ~BRIDGE_ISR_INT_MSK);
-        int_status = (uint64_t)int_status_64;
-        number_bits = PCIBR_ISR_MAX_ERRS_PIC;
-    } else {
-        int_status_32 = (bridge->b_int_status & ~BRIDGE_ISR_INT_MSK);
-        int_status = ((uint64_t)int_status_32) & 0xffffffff;
-        number_bits = PCIBR_ISR_MAX_ERRS_BRIDGE;
-    }
+    int_status_64 = (bridge->p_int_status_64 & ~BRIDGE_ISR_INT_MSK);
+    int_status = (uint64_t)int_status_64;
+    number_bits = PCIBR_ISR_MAX_ERRS_PIC;
 
     PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_INTR_ERROR, pcibr_soft->bs_conn,
-		"pcibr_error_intr_handler: int_status=0x%x\n", int_status));
+		"pcibr_error_intr_handler: int_status=0x%lx\n", int_status));
 
     /* int_status is which bits we have to clear;
      * err_status is the bits we haven't handled yet.
@@ -732,7 +678,7 @@
 	/*
 	 * No error bit set!!.
 	 */
-	return;
+	return IRQ_HANDLED;
     }
     /*
      * If we have a PCIBUS_PIOERR, hand it to the logger.
@@ -853,8 +799,7 @@
 		 * interrupt inorder to clear the DEV_BROKE bits in
 		 * b_arb register to re-enable the device.
 		 */
-		if (IS_PIC_SOFT(pcibr_soft) &&
-				!(err_status & PIC_ISR_PCIX_ARB_ERR) &&
+		if (!(err_status & PIC_ISR_PCIX_ARB_ERR) &&
 				PCIBR_WAR_ENABLED(PV856155, pcibr_soft)) {
 
 		if (bs_estat->bs_errcount_total > PCIBR_ERRINTR_DISABLE_LEVEL) {
@@ -876,17 +821,13 @@
     }
 
     if (disable_errintr_mask) {
-	unsigned s;
+	unsigned long s;
 	/*
 	 * Disable some high frequency errors as they
 	 * could eat up too much cpu time.
 	 */
 	s = pcibr_lock(pcibr_soft);
-	if (IS_PIC_SOFT(pcibr_soft)) {
-	    bridge->p_int_enable_64 &= (picreg_t)(~disable_errintr_mask);
-	} else {
-	    bridge->b_int_enable &= (bridgereg_t)(~disable_errintr_mask);
-	}
+	bridge->p_int_enable_64 &= (picreg_t)(~disable_errintr_mask);
 	pcibr_unlock(pcibr_soft, s);
     }
     /*
@@ -931,15 +872,15 @@
      * so we know we've hit the problem defined in PV 867308 that we believe
      * has only been seen in simulation
      */
-    if (IS_PIC_SOFT(pcibr_soft) && PCIBR_WAR_ENABLED(PV867308, pcibr_soft) &&
+    if (PCIBR_WAR_ENABLED(PV867308, pcibr_soft) &&
         (err_status & (BRIDGE_ISR_LLP_REC_SNERR | BRIDGE_ISR_LLP_REC_CBERR))) {
         printk("BRIDGE ERR_STATUS 0x%lx\n", err_status);
         pcibr_error_dump(pcibr_soft);
-        PRINT_PANIC("PCI Bridge Error interrupt killed the system");
+        panic("PCI Bridge Error interrupt killed the system");
     }
 
     if (err_status & BRIDGE_ISR_ERROR_FATAL) {
-	PRINT_PANIC("PCI Bridge Error interrupt killed the system");
+	panic("PCI Bridge Error interrupt killed the system");
 	    /*NOTREACHED */
     }
 
@@ -952,24 +893,20 @@
      * 
      * PIC doesn't require groups of interrupts to be cleared...
      */
-    if (IS_PIC_SOFT(pcibr_soft)) {
-	bridge->p_int_rst_stat_64 = (picreg_t)(int_status | BRIDGE_IRR_MULTI_CLR);
-    } else {
-	bridge->b_int_rst_stat = (bridgereg_t)pcibr_errintr_group(int_status);
-    }
+    bridge->p_int_rst_stat_64 = (picreg_t)(int_status | BRIDGE_IRR_MULTI_CLR);
 
     /* PIC BRINGUP WAR (PV# 856155):
      * On a PCI_X_ARB_ERR error interrupt clear the DEV_BROKE bits from
      * the b_arb register to re-enable the device.
      */
-    if (IS_PIC_SOFT(pcibr_soft) &&
-		(err_status & PIC_ISR_PCIX_ARB_ERR) &&
+    if ((err_status & PIC_ISR_PCIX_ARB_ERR) &&
 		PCIBR_WAR_ENABLED(PV856155, pcibr_soft)) {
 	bridge->b_arb |= (0xf << 20);
     }
 
     /* Zero out bserr_intstat field */
     pcibr_soft->bs_errinfo.bserr_intstat = 0;
+    return IRQ_HANDLED;
 }
 
 void
@@ -980,14 +917,9 @@
     ASSERT(error_code & IOECODE_PIO);
     error_code = error_code;
 
-    if (IS_PIC_SOFT(pcibr_soft)) {
-        bridge->p_int_rst_stat_64 = BRIDGE_IRR_PCI_GRP_CLR |
+    bridge->p_int_rst_stat_64 = BRIDGE_IRR_PCI_GRP_CLR |
 				    PIC_PCIX_GRP_CLR |
 				    BRIDGE_IRR_MULTI_CLR;
-    } else {
-        bridge->b_int_rst_stat = BRIDGE_IRR_PCI_GRP_CLR | BRIDGE_IRR_MULTI_CLR;
-    }
-
     (void) bridge->b_wid_tflush;	/* flushbus */
 }
 
@@ -1079,8 +1011,6 @@
     int                     retval = IOERROR_HANDLED;
 
     vertex_hdl_t            pcibr_vhdl = pcibr_soft->bs_vhdl;
-    bridge_t               *bridge = pcibr_soft->bs_base;
-
     iopaddr_t               bad_xaddr;
 
     pciio_space_t           raw_space;	/* raw PCI space */
@@ -1106,7 +1036,7 @@
     IOERROR_GETVALUE(bad_xaddr, ioe, xtalkaddr);
 
     PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ERROR_HDLR, pcibr_soft->bs_conn,
-                "pcibr_pioerror: pcibr_soft=0x%x, bad_xaddr=0x%x\n",
+                "pcibr_pioerror: pcibr_soft=0x%lx, bad_xaddr=0x%lx\n",
 		pcibr_soft, bad_xaddr));
 
     slot = PCIIO_SLOT_NONE;
@@ -1405,47 +1335,8 @@
 	    printk(KERN_ALERT
 		    "PIO Error on PCI Bus %s",
 		    pcibr_soft->bs_name);
-	    /* this decodes part of the ioe; our caller
-	     * will dump the raw details in DEBUG and
-	     * kdebug kernels.
-	     */
 	    BEM_ADD_IOE(ioe);
 	}
-#if defined(FORCE_ERRORS)
-	if (0) {
-#elif !DEBUG
-	if (kdebug) {
-#endif
-	    /*
-	     * Dump raw data from Bridge/PCI layer.
-	     */
-
-	    BEM_ADD_STR("Raw info from Bridge/PCI layer:\n");
-	    if (IS_PIC_SOFT(pcibr_soft)) {
-		if (bridge->p_int_status_64 & (picreg_t)BRIDGE_ISR_PCIBUS_PIOERR)
-		    pcibr_error_dump(pcibr_soft);
-	    } else {
-		if (bridge->b_int_status & (bridgereg_t)BRIDGE_ISR_PCIBUS_PIOERR)
-		    pcibr_error_dump(pcibr_soft);
-	    }
-	    BEM_ADD_SPC(raw_space);
-	    BEM_ADD_VAR(raw_paddr);
-	    if (IOERROR_FIELDVALID(ioe, widgetdev)) {
-		short widdev;
-		IOERROR_GETVALUE(widdev, ioe, widgetdev);
-		slot = pciio_widgetdev_slot_get(widdev);
-		func = pciio_widgetdev_func_get(widdev);
-		if (slot < PCIBR_NUM_SLOTS(pcibr_soft)) {
-		    bridgereg_t             device = bridge->b_device[slot].reg;
-
-		    BEM_ADD_VAR(slot);
-		    BEM_ADD_VAR(func);
-		    BEM_ADD_REG(device);
-		}
-	    }
-#if !DEBUG || defined(FORCE_ERRORS)
-	}
-#endif
 
 	/*
 	 * Since error could not be handled at lower level,
@@ -1506,7 +1397,6 @@
 	IOERROR_GETVALUE(tmp, ioe, widgetnum);
 	ASSERT(tmp == pcibr_soft->bs_xid);
     }
-    ASSERT(bridge);
 
     /*
      * read error log registers
@@ -1637,7 +1527,7 @@
     pcibr_soft = (pcibr_soft_t) einfo;
 
     PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ERROR_HDLR, pcibr_soft->bs_conn,
-		"pcibr_error_handler: pcibr_soft=0x%x, error_code=0x%x\n",
+		"pcibr_error_handler: pcibr_soft=0x%lx, error_code=0x%x\n",
 		pcibr_soft, error_code));
 
 #if DEBUG && ERROR_DEBUG
@@ -1701,7 +1591,7 @@
     int		       dma_retval = -1;
 
     PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ERROR_HDLR, pcibr_soft->bs_conn,
-                "pcibr_error_handler_wrapper: pcibr_soft=0x%x, "
+                "pcibr_error_handler_wrapper: pcibr_soft=0x%lx, "
 		"error_code=0x%x\n", pcibr_soft, error_code));
 
     /*
@@ -1735,7 +1625,7 @@
 	    if (!pcibr_soft) {
 #if DEBUG
 		printk(KERN_WARNING "pcibr_error_handler: "
-			"bs_peers_soft==NULL. bad_xaddr= 0x%x mode= 0x%x\n",
+			"bs_peers_soft==NULL. bad_xaddr= 0x%lx mode= 0x%lx\n",
 						bad_xaddr, mode);
 #endif
   		pio_retval = IOERROR_HANDLED;
diff -Nru a/arch/ia64/sn/io/sn2/pcibr/pcibr_hints.c b/arch/ia64/sn/io/sn2/pcibr/pcibr_hints.c
--- a/arch/ia64/sn/io/sn2/pcibr/pcibr_hints.c	Tue Feb  3 19:45:42 2004
+++ b/arch/ia64/sn/io/sn2/pcibr/pcibr_hints.c	Tue Feb  3 19:45:42 2004
@@ -1,5 +1,4 @@
 /*
- *
  * 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.
@@ -8,26 +7,11 @@
  */
 
 #include <linux/types.h>
-#include <linux/slab.h>
-#include <linux/module.h>
 #include <asm/sn/sgi.h>
-#include <asm/sn/sn_cpuid.h>
-#include <asm/sn/addrs.h>
-#include <asm/sn/arch.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
-#include <asm/sn/hcl.h>
-#include <asm/sn/labelcl.h>
-#include <asm/sn/xtalk/xwidget.h>
-#include <asm/sn/pci/bridge.h>
-#include <asm/sn/pci/pciio.h>
 #include <asm/sn/pci/pcibr.h>
 #include <asm/sn/pci/pcibr_private.h>
 #include <asm/sn/pci/pci_defs.h>
-#include <asm/sn/prio.h>
-#include <asm/sn/xtalk/xbow.h>
-#include <asm/sn/io.h>
-#include <asm/sn/sn_private.h>
 
 pcibr_hints_t           pcibr_hints_get(vertex_hdl_t, int);
 void                    pcibr_hints_fix_rrbs(vertex_hdl_t);
@@ -48,7 +32,11 @@
 
     if (alloc && (rv != GRAPH_SUCCESS)) {
 
-	NEW(hint);
+	hint = kmalloc(sizeof (*(hint)), GFP_KERNEL);
+	if ( !hint )
+		goto abnormal_exit;
+	memset(hint, 0, sizeof (*(hint)));
+
 	hint->rrb_alloc_funct = NULL;
 	hint->ph_intr_bits = NULL;
 	rv = hwgraph_info_add_LBL(xconn_vhdl, 
@@ -68,10 +56,7 @@
     return (pcibr_hints_t) ainfo;
 
 abnormal_exit:
-#ifdef LATER
-    printf("SHOULD NOT BE HERE\n");
-#endif
-    DEL(hint);
+    kfree(hint);
     return(NULL);
 
 }
@@ -162,18 +147,19 @@
     if (ainfo == 0) {
 	uint64_t                *subdevp;
 
-	NEW(subdevp);
+	subdevp = kmalloc(sizeof (*(subdevp)), GFP_KERNEL);
 	if (!subdevp) {
 	    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_HINTS, xconn_vhdl,
 			"pcibr_hints_subdevs: subdev ptr alloc failed\n"));
 	    return;
 	}
+	memset(subdevp, 0, sizeof (*(subdevp)));
 	*subdevp = subdevs;
 	hwgraph_info_add_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, (arbitrary_info_t) subdevp);
 	hwgraph_info_get_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, &ainfo);
 	if (ainfo == (arbitrary_info_t) subdevp)
 	    return;
-	DEL(subdevp);
+	kfree(subdevp);
 	if (ainfo == (arbitrary_info_t) NULL) {
 	    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_HINTS, xconn_vhdl,
 			"pcibr_hints_subdevs: null subdevs ptr\n"));
diff -Nru a/arch/ia64/sn/io/sn2/pcibr/pcibr_intr.c b/arch/ia64/sn/io/sn2/pcibr/pcibr_intr.c
--- a/arch/ia64/sn/io/sn2/pcibr/pcibr_intr.c	Tue Feb  3 19:45:35 2004
+++ b/arch/ia64/sn/io/sn2/pcibr/pcibr_intr.c	Tue Feb  3 19:45:35 2004
@@ -1,5 +1,4 @@
 /*
- *
  * 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.
@@ -8,24 +7,14 @@
  */
 
 #include <linux/types.h>
-#include <linux/slab.h>
 #include <linux/module.h>
 #include <asm/sn/sgi.h>
-#include <asm/sn/sn_cpuid.h>
-#include <asm/sn/addrs.h>
 #include <asm/sn/arch.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
-#include <asm/sn/hcl.h>
-#include <asm/sn/labelcl.h>
-#include <asm/sn/xtalk/xwidget.h>
-#include <asm/sn/pci/bridge.h>
 #include <asm/sn/pci/pciio.h>
 #include <asm/sn/pci/pcibr.h>
 #include <asm/sn/pci/pcibr_private.h>
 #include <asm/sn/pci/pci_defs.h>
-#include <asm/sn/prio.h>
-#include <asm/sn/xtalk/xbow.h>
 #include <asm/sn/io.h>
 #include <asm/sn/sn_private.h>
 
@@ -33,7 +22,7 @@
 inline int
 compare_and_swap_ptr(void **location, void *old_ptr, void *new_ptr)
 {
-	FIXME("compare_and_swap_ptr : NOT ATOMIC");
+	/* FIXME - compare_and_swap_ptr NOT ATOMIC */
 	if (*location == old_ptr) {
 		*location = new_ptr;
 		return(1);
@@ -94,49 +83,6 @@
 
 
 /*
- *	Get the next wrapper pointer queued in the interrupt circular buffer.
- */
-pcibr_intr_wrap_t
-pcibr_wrap_get(pcibr_intr_cbuf_t cbuf)
-{
-    pcibr_intr_wrap_t	wrap;
-
-	if (cbuf->ib_in == cbuf->ib_out)
-	    PRINT_PANIC( "pcibr intr circular buffer empty, cbuf=0x%p, ib_in=ib_out=%d\n",
-		(void *)cbuf, cbuf->ib_out);
-
-	wrap = cbuf->ib_cbuf[cbuf->ib_out++];
-	cbuf->ib_out = cbuf->ib_out % IBUFSIZE;
-	return(wrap);
-}
-
-/* 
- *	Queue a wrapper pointer in the interrupt circular buffer.
- */
-void
-pcibr_wrap_put(pcibr_intr_wrap_t wrap, pcibr_intr_cbuf_t cbuf)
-{
-	int	in;
-	int	s;
-
-	/*
-	 * Multiple CPUs could be executing this code simultaneously
-	 * if a handler has registered multiple interrupt lines and
-	 * the interrupts are directed to different CPUs.
-	 */
-	s = mutex_spinlock(&cbuf->ib_lock);
-	in = (cbuf->ib_in + 1) % IBUFSIZE;
-	if (in == cbuf->ib_out) 
-	    PRINT_PANIC( "pcibr intr circular buffer full, cbuf=0x%p, ib_in=%d\n",
-		(void *)cbuf, cbuf->ib_in);
-
-	cbuf->ib_cbuf[cbuf->ib_in] = wrap;
-	cbuf->ib_in = in;
-	mutex_spinunlock(&cbuf->ib_lock, s);
-	return;
-}
-
-/*
  *	On SN systems there is a race condition between a PIO read response
  *	and DMA's.  In rare cases, the read response may beat the DMA, causing
  *	the driver to think that data in memory is complete and meaningful.
@@ -168,36 +114,16 @@
 
 	if (flush_nasid_list[nasid].widget_p == NULL) return;
 	if (bwin > 0) {
-		bwin--;
-		switch (bwin) {
-			case 0:
-				wid_num = ((flush_nasid_list[nasid].iio_itte1) >> 8) & 0xf;
-				break;
-			case 1:
-				wid_num = ((flush_nasid_list[nasid].iio_itte2) >> 8) & 0xf;
-				break;
-			case 2: 
-				wid_num = ((flush_nasid_list[nasid].iio_itte3) >> 8) & 0xf;
-				break;
-			case 3: 
-				wid_num = ((flush_nasid_list[nasid].iio_itte4) >> 8) & 0xf;
-				break;
-			case 4: 
-				wid_num = ((flush_nasid_list[nasid].iio_itte5) >> 8) & 0xf;
-				break;
-			case 5: 
-				wid_num = ((flush_nasid_list[nasid].iio_itte6) >> 8) & 0xf;
-				break;
-			case 6: 
-				wid_num = ((flush_nasid_list[nasid].iio_itte7) >> 8) & 0xf;
-				break;
-		}
+		unsigned long itte = flush_nasid_list[nasid].iio_itte[bwin];
+
+		wid_num = (itte >> IIO_ITTE_WIDGET_SHIFT) &
+				  IIO_ITTE_WIDGET_MASK;
 	}
 	if (flush_nasid_list[nasid].widget_p == NULL) return;
 	if (flush_nasid_list[nasid].widget_p[wid_num] == NULL) return;
 	p = &flush_nasid_list[nasid].widget_p[wid_num][0];
 
-	// find a matching BAR
+	/* find a matching BAR */
 
 	for (i=0; i<DEV_PER_WIDGET;i++) {
 		for (j=0; j<PCI_ROM_RESOURCE;j++) {
@@ -208,7 +134,7 @@
 		p++;
 	}
 
-	// if no matching BAR, return without doing anything.
+	/* if no matching BAR, return without doing anything. */
 
 	if (i == DEV_PER_WIDGET) return;
 
@@ -216,15 +142,15 @@
 
 	p->flush_addr = 0;
 
-	// force an interrupt.
+	/* force an interrupt. */
 
 	*(bridgereg_t *)(p->force_int_addr) = 1;
 
-	// wait for the interrupt to come back.
+	/* wait for the interrupt to come back. */
 
 	while (p->flush_addr != 0x10f);
 
-	// okay, everything is synched up.
+	/* okay, everything is synched up. */
 	spin_unlock_irqrestore(&p->flush_lock, flags);
 
 	return;
@@ -283,9 +209,7 @@
 			PCIBR_DEBUG((PCIBR_DEBUG_INTR, pcibr_soft->bs_vhdl,
 		    		"pcibr_force_interrupt: bit=0x%x\n", bit));
 
-			if (IS_XBRIDGE_OR_PIC_SOFT(pcibr_soft)) {
-	    			bridge->b_force_pin[bit].intr = 1;
-			}
+    			bridge->b_force_pin[bit].intr = 1;
 		}
 	}
 }
@@ -326,9 +250,10 @@
 		lines & 4 ? " INTC" : "",
 		lines & 8 ? " INTD" : ""));
 
-    NEW(pcibr_intr);
+    pcibr_intr = kmalloc(sizeof (*(pcibr_intr)), GFP_KERNEL);
     if (!pcibr_intr)
 	return NULL;
+    memset(pcibr_intr, 0, sizeof (*(pcibr_intr)));
 
     pcibr_intr->bi_dev = pconn_vhdl;
     pcibr_intr->bi_lines = lines;
@@ -340,7 +265,7 @@
     pcibr_intr->bi_mustruncpu = CPU_NONE;
     pcibr_intr->bi_ibuf.ib_in = 0;
     pcibr_intr->bi_ibuf.ib_out = 0;
-    mutex_spinlock_init(&pcibr_intr->bi_ibuf.ib_lock);
+    spin_lock_init(&pcibr_intr->bi_ibuf.ib_lock);
     pcibr_int_bits = pcibr_soft->bs_intr_bits((pciio_info_t)pcibr_info, lines, 
 		PCIBR_NUM_SLOTS(pcibr_soft));
 
@@ -384,7 +309,7 @@
 			owner_dev);
 
 		PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_INTR_ALLOC, pconn_vhdl,
-			    "pcibr_intr_alloc: xtalk_intr=0x%x\n", xtalk_intr));
+			    "pcibr_intr_alloc: xtalk_intr=0x%lx\n", xtalk_intr));
 
 		/* both an assert and a runtime check on this:
 		 * we need to check in non-DEBUG kernels, and
@@ -400,15 +325,9 @@
 		     * in xtalk_intr_p.
 		     */
 		    if (!*xtalk_intr_p) {
-#ifdef SUPPORT_PRINTING_V_FORMAT
-			printk(KERN_ALERT  
-				"pcibr_intr_alloc %v: unable to get xtalk interrupt resources",
-				xconn_vhdl);
-#else
-			printk(KERN_ALERT  
-				"pcibr_intr_alloc 0x%p: unable to get xtalk interrupt resources",
-				(void *)xconn_vhdl);
-#endif
+			printk(KERN_ALERT "pcibr_intr_alloc %s: "
+				"unable to get xtalk interrupt resources",
+				pcibr_soft->bs_name);
 			/* yes, we leak resources here. */
 			return 0;
 		    }
@@ -432,25 +351,20 @@
 		     */
 		    xtalk_intr_free(xtalk_intr);
 		    xtalk_intr = *xtalk_intr_p;
-#if PARANOID
-		    /* once xtalk_intr is set, we never clear it,
-		     * so if the CAS fails above, this condition
-		     * can "never happen" ...
-		     */
-		    if (!xtalk_intr) {
-			printk(KERN_ALERT  
-				"pcibr_intr_alloc %v: unable to set xtalk interrupt resources",
-				xconn_vhdl);
-			/* yes, we leak resources here. */
-			return 0;
-		    }
-#endif
 		}
 	    }
 
 	    pcibr_intr->bi_ibits |= 1 << pcibr_int_bit;
 
-	    NEW(intr_entry);
+	    intr_entry = kmalloc(sizeof (*(intr_entry)), GFP_KERNEL);
+	    if ( !intr_entry ) {
+		printk(KERN_ALERT "pcibr_intr_alloc %s: "
+			"unable to get memory",
+			pcibr_soft->bs_name);
+		return 0;
+	    }
+	    memset(intr_entry, 0, sizeof (*(intr_entry)));
+
 	    intr_entry->il_next = NULL;
 	    intr_entry->il_intr = pcibr_intr;
 	    intr_entry->il_wrbf = &(bridge->b_wr_req_buf[pciio_slot].reg);
@@ -458,8 +372,8 @@
 		&pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_list;
 
 	    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_INTR_ALLOC, pconn_vhdl,
-			"Bridge bit 0x%x wrap=0x%x\n", pcibr_int_bit,
-			pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap));
+			"Bridge bit 0x%x wrap=0x%lx\n", pcibr_int_bit,
+			&(pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap)));
 
 	    if (compare_and_swap_ptr((void **) intr_list_p, NULL, intr_entry)) {
 		/* we are the first interrupt on this bridge bit.
@@ -476,7 +390,7 @@
 		 * and we replaced it, so we
 		 * don't need our intr_entry.
 		 */
-		DEL(intr_entry);
+		kfree(intr_entry);
 		PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_INTR_ALLOC, pconn_vhdl,
 			    "INT 0x%x (bridge bit %d) replaces erased first\n",
 			    pcibr_int_bits, pcibr_int_bit));
@@ -499,7 +413,7 @@
 		     * and we replaced it, so we
 		     * don't need our intr_entry.
 		     */
-		    DEL(intr_entry);
+		    kfree(intr_entry);
 
 		    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_INTR_ALLOC, pconn_vhdl,
 				"INT 0x%x (bridge bit %d) replaces erase Nth\n",
@@ -522,12 +436,11 @@
 	}
     }
 
-#if DEBUG && INTR_DEBUG
-    printk("%v pcibr_intr_alloc complete\n", pconn_vhdl);
-#endif
     hub_intr = (hub_intr_t)xtalk_intr;
     pcibr_intr->bi_irq = hub_intr->i_bit;
     pcibr_intr->bi_cpu = hub_intr->i_cpuid;
+    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_INTR_ALLOC, pconn_vhdl,
+		"pcibr_intr_alloc complete: pcibr_intr=0x%lx\n", pcibr_intr));
     return pcibr_intr;
 }
 
@@ -582,7 +495,7 @@
 	    }
 	}
     }
-    DEL(pcibr_intr);
+    kfree(pcibr_intr);
 }
 
 void
@@ -619,8 +532,8 @@
 	return -1;
 
     PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_INTR_ALLOC, pcibr_intr->bi_dev,
-		"pcibr_intr_connect: intr_func=0x%x\n",
-		pcibr_intr));
+		"pcibr_intr_connect: intr_func=0x%lx, intr_arg=0x%lx\n",
+		intr_func, intr_arg));
 
     pcibr_intr->bi_func = intr_func;
     pcibr_intr->bi_arg = intr_arg;
@@ -653,10 +566,7 @@
 	     * Use the pcibr wrapper function to handle all Bridge interrupts
 	     * regardless of whether the interrupt line is shared or not.
 	     */
-	    if (IS_PIC_SOFT(pcibr_soft)) 
-		int_addr = (void *)&(bridge->p_int_addr_64[pcibr_int_bit]);
-	    else
-		int_addr = (void *)&(bridge->b_int_addr[pcibr_int_bit].addr);
+	    int_addr = (void *)&(bridge->p_int_addr_64[pcibr_int_bit]);
 
 	    xtalk_intr_connect(xtalk_intr, pcibr_intr_func, (intr_arg_t) intr_wrap,
 					(xtalk_intr_setfunc_t) pcibr_setpciint,
@@ -675,8 +585,7 @@
 	 * On PIC we must write 64-bit MMRs with 64-bit stores
 	 */
 	s = pcibr_lock(pcibr_soft);
-	if (IS_PIC_SOFT(pcibr_soft) &&
-			PCIBR_WAR_ENABLED(PV854697, pcibr_soft)) {
+	if (PCIBR_WAR_ENABLED(PV854697, pcibr_soft)) {
 	    int_enable = bridge->p_int_enable_64;
 	    int_enable |= pcibr_int_bits;
 	    bridge->p_int_enable_64 = int_enable;
@@ -726,11 +635,8 @@
     if (!pcibr_int_bits)
 	return;
 
-    /* PIC WAR. PV# 854697
-     * On PIC we must write 64-bit MMRs with 64-bit stores
-     */
     s = pcibr_lock(pcibr_soft);
-    if (IS_PIC_SOFT(pcibr_soft) && PCIBR_WAR_ENABLED(PV854697, pcibr_soft)) {
+    if (PCIBR_WAR_ENABLED(PV854697, pcibr_soft)) {
 	int_enable = bridge->p_int_enable_64;
 	int_enable &= ~pcibr_int_bits;
 	bridge->p_int_enable_64 = int_enable;
@@ -775,10 +681,7 @@
             if (!pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_shared)
                 continue;
 
-            if (IS_PIC_SOFT(pcibr_soft))
-                int_addr = (void *)&(bridge->p_int_addr_64[pcibr_int_bit]);
-            else
-                int_addr = (void *)&(bridge->b_int_addr[pcibr_int_bit].addr);
+            int_addr = (void *)&(bridge->p_int_addr_64[pcibr_int_bit]);
 
 	    xtalk_intr_connect(pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr,
 				pcibr_intr_func, (intr_arg_t) intr_wrap,
@@ -856,7 +759,7 @@
 		printk(KERN_WARNING  "NEW=0x%x/0x%x  OLD=0x%x/0x%x\n",
 			NEW_b_wid_int_upper, NEW_b_wid_int_lower,
 			OLD_b_wid_int_upper, OLD_b_wid_int_lower);
-		PRINT_PANIC("PCI Bridge interrupt targetting error\n");
+		panic("PCI Bridge interrupt targetting error\n");
 	}
     }
 
@@ -950,8 +853,7 @@
 	 * interrupt problem.   Briefly disable the enable bit for
 	 * this device.
 	 */
-	if (IS_PIC_SOFT(pcibr_soft) &&
-			PCIBR_WAR_ENABLED(PV855272, pcibr_soft)) {
+	if (PCIBR_WAR_ENABLED(PV855272, pcibr_soft)) {
 		unsigned s;
 
 		/* disable-enable interrupts for this bridge pin */
@@ -986,26 +888,27 @@
 	    for (list = wrap->iw_list; list != NULL; list = list->il_next) {
 		if ((intr = list->il_intr) && (intr->bi_flags & PCIIO_INTR_CONNECTED)) {
 
-		    /*
-		     * This device may have initiated write
-		     * requests since the bridge last saw
-		     * an edge on this interrupt input; flushing
-		     * the buffer prior to invoking the handler
-		     * should help but may not be sufficient if we 
-		     * get more requests after the flush, followed
-		     * by the card deciding it wants service, before
-		     * the interrupt handler checks to see if things need
-		     * to be done.
-		     *
-		     * There is a similar race condition if
-		     * an interrupt handler loops around and
-		     * notices further service is required.
-		     * Perhaps we need to have an explicit
-		     * call that interrupt handlers need to
-		     * do between noticing that DMA to memory
-		     * has completed, but before observing the
-		     * contents of memory?
-		     */
+
+		/*
+		 * This device may have initiated write
+		 * requests since the bridge last saw
+		 * an edge on this interrupt input; flushing
+		 * the buffer prior to invoking the handler
+		 * should help but may not be sufficient if we 
+		 * get more requests after the flush, followed
+		 * by the card deciding it wants service, before
+		 * the interrupt handler checks to see if things need
+		 * to be done.
+		 *
+		 * There is a similar race condition if
+		 * an interrupt handler loops around and
+		 * notices further service is requred.
+		 * Perhaps we need to have an explicit
+		 * call that interrupt handlers need to
+		 * do between noticing that DMA to memory
+		 * has completed, but before observing the
+		 * contents of memory?
+		 */
 
 		    if ((do_nonthreaded) && (!is_threaded)) {
 			/* Non-threaded -  Call the interrupt handler at interrupt level */
@@ -1061,8 +964,7 @@
 	     * On PIC we must write 64-bit MMRs with 64-bit stores
 	     */
 	    s = pcibr_lock(pcibr_soft);
-	    if (IS_PIC_SOFT(pcibr_soft) &&
-				PCIBR_WAR_ENABLED(PV854697, pcibr_soft)) {
+	    if (PCIBR_WAR_ENABLED(PV854697, pcibr_soft)) {
 		int_enable = bridge->p_int_enable_64;
 		int_enable &= ~mask;
 		bridge->p_int_enable_64 = int_enable;
diff -Nru a/arch/ia64/sn/io/sn2/pcibr/pcibr_reg.c b/arch/ia64/sn/io/sn2/pcibr/pcibr_reg.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/ia64/sn/io/sn2/pcibr/pcibr_reg.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,107 @@
+/*
+ * 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) 2003 Silicon Graphics, Inc. All rights reserved.
+ */
+
+#include <linux/types.h>
+#include <asm/sn/sgi.h>
+#include <asm/sn/iograph.h>
+#include <asm/sn/addrs.h>
+#include <asm/sn/pci/pcibr.h>
+#include <asm/sn/pci/pcibr_private.h>
+#include <asm/sn/pci/pci_defs.h>
+
+#define IS_IOADDR(ptr) (!(((uint64_t)(ptr) & CAC_BASE) == CAC_BASE))
+
+/*
+ * Control Register Access -- Read/Write                            0000_0020
+ */
+
+uint64_t
+pcireg_control_get(void *ptr)
+{
+	uint64_t ret = 0;
+	pic_t *bridge;
+
+	if (IS_IOADDR(ptr))
+		bridge = (pic_t *) ptr;
+	else
+		bridge = (pic_t *) ((pcibr_soft_t) (ptr))->bs_base;
+
+	ret = ((pic_t *) bridge)->p_wid_control;
+	return ret;
+}
+
+/*
+ * Interrupt Status Register Access -- Read Only                    0000_0100
+ */
+uint64_t
+pcireg_intr_status_get(void *ptr)
+{
+	short bridge_type;
+	pic_t *bridge;
+	uint64_t ret = 0;
+
+	if (IS_IOADDR(ptr))
+		bridge = (pic_t *) ptr;
+	else
+		bridge = (pic_t *) ((pcibr_soft_t) (ptr))->bs_base;
+
+	ret = ((pic_t *) bridge)->p_int_status;
+	return ret;
+}
+
+void
+pcireg_intr_enable_bit_clr(void *ptr, uint64_t bits)
+{
+	pic_t *bridge;
+
+	if (IS_IOADDR(ptr))
+		bridge = (pic_t *) ptr;
+	else
+		bridge = (pic_t *) ((pcibr_soft_t) (ptr))->bs_base;
+	bridge->p_int_enable &= ~bits;
+}
+
+void
+pcireg_intr_enable_bit_set(void *ptr, uint64_t bits)
+{
+	pic_t *bridge;
+
+	if (IS_IOADDR(ptr))
+		bridge = (pic_t *) ptr;
+	else
+		bridge = (pic_t *) ((pcibr_soft_t) (ptr))->bs_base;
+	bridge->p_int_enable |= bits;
+}
+
+void
+pcireg_intr_addr_addr_set(void *ptr, int int_n, uint64_t addr)
+{
+	pic_t *bridge;
+
+	if (IS_IOADDR(ptr))
+		bridge = (pic_t *) ptr;
+	else
+		bridge = (pic_t *) ((pcibr_soft_t) (ptr))->bs_base;
+	bridge->p_int_addr[int_n] &= ~(0x0000FFFFFFFFFFFF);
+	bridge->p_int_addr[int_n] |= (addr & 0x0000FFFFFFFFFFFF);
+}
+
+/*
+ * Force Interrupt Register Access -- Write Only        0000_01C0 - 0000_01F8
+ */
+void
+pcireg_force_intr_set(void *ptr, int int_n)
+{
+	pic_t *bridge;
+
+	if (IS_IOADDR(ptr))
+		bridge = (pic_t *) ptr;
+	else
+		bridge = (pic_t *) ((pcibr_soft_t) (ptr))->bs_base;
+	bridge->p_force_pin[int_n] = 1;
+}
diff -Nru a/arch/ia64/sn/io/sn2/pcibr/pcibr_rrb.c b/arch/ia64/sn/io/sn2/pcibr/pcibr_rrb.c
--- a/arch/ia64/sn/io/sn2/pcibr/pcibr_rrb.c	Tue Feb  3 19:45:43 2004
+++ b/arch/ia64/sn/io/sn2/pcibr/pcibr_rrb.c	Tue Feb  3 19:45:43 2004
@@ -1,5 +1,4 @@
 /*
- *
  * 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.
@@ -8,26 +7,12 @@
  */
 
 #include <linux/types.h>
-#include <linux/slab.h>
-#include <linux/module.h>
 #include <asm/sn/sgi.h>
-#include <asm/sn/sn_cpuid.h>
-#include <asm/sn/addrs.h>
-#include <asm/sn/arch.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
-#include <asm/sn/hcl.h>
-#include <asm/sn/labelcl.h>
-#include <asm/sn/xtalk/xwidget.h>
-#include <asm/sn/pci/bridge.h>
 #include <asm/sn/pci/pciio.h>
 #include <asm/sn/pci/pcibr.h>
 #include <asm/sn/pci/pcibr_private.h>
 #include <asm/sn/pci/pci_defs.h>
-#include <asm/sn/prio.h>
-#include <asm/sn/xtalk/xbow.h>
-#include <asm/sn/io.h>
-#include <asm/sn/sn_private.h>
 
 void              do_pcibr_rrb_clear(bridge_t *, int);
 void              do_pcibr_rrb_flush(bridge_t *, int);
@@ -87,7 +72,7 @@
 			 pciio_slot_t slot,
 			 int vchan)
 {
-    bridgereg_t tmp;
+    uint64_t tmp;
     uint16_t enable_bit, vchan_bits, pdev_bits, rrb_bits;
     int rrb_index, cnt=0;
 
@@ -120,7 +105,7 @@
 do_pcibr_rrb_count_avail(bridge_t *bridge,
 			 pciio_slot_t slot)
 {
-    bridgereg_t tmp;
+    uint64_t tmp;
     uint16_t enable_bit;
     int rrb_index, cnt=0;
     
@@ -156,7 +141,7 @@
 		   int vchan,
 		   int more)
 {
-    bridgereg_t reg, tmp = (bridgereg_t)0;
+    uint64_t reg, tmp = 0;
     uint16_t enable_bit, vchan_bits, pdev_bits, rrb_bits;
     int rrb_index;
     
@@ -201,7 +186,7 @@
 		  int vchan,
 		  int less)
 {
-    bridgereg_t reg, tmp = (bridgereg_t)0, clr = 0;
+    uint64_t reg, tmp = 0, clr = 0;
     uint16_t enable_bit, vchan_bits, pdev_bits, rrb_bits;
     int rrb_index;
     
@@ -273,7 +258,7 @@
 void
 do_pcibr_rrb_clear(bridge_t *bridge, int rrb)
 {
-    bridgereg_t             status;
+    uint64_t             status;
 
     /* bridge_lock must be held;
      * this RRB must be disabled.
@@ -365,7 +350,7 @@
     pciio_slot_t  slot = PCIBR_INFO_SLOT_GET_INT(pciio_info);
     bridge_t	 *bridge = pcibr_soft->bs_base;
 
-    bridgereg_t tmp;
+    uint64_t tmp;
     uint16_t enable_bit, pdev_bits, rrb_bits, rrb_mask;
     int rrb_index;
     unsigned long s;
@@ -402,18 +387,8 @@
     volatile bridgereg_t   *wrb_flush;
 
     wrb_flush = &(bridge->b_wr_req_buf[pciio_slot].reg);
-    if ( IS_PIC_SOFT(pcibr_soft) ) {
-	while (*wrb_flush)
-		;
-    }
-    else {
-	if (io_get_sh_swapper(NASID_GET(bridge))) {
-		while (BRIDGE_REG_GET32((wrb_flush)));
-	} else {
-		while (*wrb_flush)
-			;
-	}
-    }
+    while (*wrb_flush)
+	;
     return(0);
 }
 
@@ -711,24 +686,17 @@
     for (vchan = 0; vchan < vchan_total; vchan++) 
         chan[vchan] = do_pcibr_rrb_count_valid(bridge, slot, vchan);
 
-    if (IS_PIC_SOFT(pcibr_soft)) {
- 	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_RRB, pcibr_vhdl,
+    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_RRB, pcibr_vhdl,
 	    "pcibr_slot_initial_rrb_alloc: slot %d started with %d+%d+%d+%d\n",
 	    PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot), 
 	    chan[VCHAN0], chan[VCHAN1], chan[VCHAN2], chan[VCHAN3]));
-    } else {
-	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_RRB, pcibr_vhdl,
-	    "pcibr_slot_initial_rrb_alloc: slot %d started with %d+%d\n",
-	    PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot), 
-	    chan[VCHAN0], chan[VCHAN1]));
-    }
 
     /* Do we really need any?
      */
     pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos;
     pcibr_info = pcibr_infoh[0];
 
-    if (PCIBR_WAR_ENABLED(PV856866, pcibr_soft) && IS_PIC_SOFT(pcibr_soft) &&
+    if (PCIBR_WAR_ENABLED(PV856866, pcibr_soft) &&
                         (slot == 2 || slot == 3) &&
                         (pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) &&
                         !pcibr_soft->bs_slot[slot].has_host) {
@@ -868,13 +836,8 @@
                     "%s: rrbs available, even=%d, odd=%d\n", calling_func,
                     pcibr_soft->bs_rrb_avail[0], pcibr_soft->bs_rrb_avail[1]));
 
-        if (IS_PIC_SOFT(pcibr_soft)) {
-            PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_RRB, pcibr_soft->bs_vhdl,
+        PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_RRB, pcibr_soft->bs_vhdl,
                         "\tslot\tvchan0\tvchan1\tvchan2\tvchan3\treserved\n"));
-        } else {
-	    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_RRB, pcibr_soft->bs_vhdl,
-		        "\tslot\tvchan0\tvchan1\treserved\n"));
-        }
 
         for (slot=0; slot < PCIBR_NUM_SLOTS(pcibr_soft); slot++) {
 	    /*
@@ -882,22 +845,13 @@
              * attempting to call PCIBR_DEBUG_ALWAYS() with more than 5 printf
              * arguments fails so sprintf() it into a temporary string.
              */
-	    if (IS_PIC_SOFT(pcibr_soft)) {
-                sprintf(tmp_str, "\t %d\t  %d\t  %d\t  %d\t  %d\t  %d\n", 
+            sprintf(tmp_str, "\t %d\t  %d\t  %d\t  %d\t  %d\t  %d\n", 
 		        PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot),
                         0xFFF & pcibr_soft->bs_rrb_valid[slot][VCHAN0],
                         0xFFF & pcibr_soft->bs_rrb_valid[slot][VCHAN1],
                         0xFFF & pcibr_soft->bs_rrb_valid[slot][VCHAN2],
                         0xFFF & pcibr_soft->bs_rrb_valid[slot][VCHAN3],
                         pcibr_soft->bs_rrb_res[slot]);
-	    } else {
-	        sprintf(tmp_str, "\t %d\t  %d\t  %d\t  %d\n", 
-		        PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot),
-		        0xFFF & pcibr_soft->bs_rrb_valid[slot][VCHAN0],
-		        0xFFF & pcibr_soft->bs_rrb_valid[slot][VCHAN1],
-		        pcibr_soft->bs_rrb_res[slot]);
-	    }
-    
             PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_RRB, pcibr_soft->bs_vhdl,
                         "%s", tmp_str));
         }
diff -Nru a/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c b/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c
--- a/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c	Tue Feb  3 19:45:18 2004
+++ b/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c	Tue Feb  3 19:45:18 2004
@@ -1,5 +1,4 @@
 /*
- *
  * 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.
@@ -8,26 +7,14 @@
  */
 
 #include <linux/types.h>
-#include <linux/slab.h>
-#include <linux/module.h>
-#include <linux/pci.h>
 #include <asm/sn/sgi.h>
 #include <asm/sn/sn_cpuid.h>
-#include <asm/sn/addrs.h>
-#include <asm/sn/arch.h>
+#include <asm/uaccess.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
-#include <asm/sn/hcl.h>
-#include <asm/sn/labelcl.h>
-#include <asm/sn/xtalk/xwidget.h>
-#include <asm/sn/pci/bridge.h>
 #include <asm/sn/pci/pciio.h>
 #include <asm/sn/pci/pcibr.h>
 #include <asm/sn/pci/pcibr_private.h>
 #include <asm/sn/pci/pci_defs.h>
-#include <asm/sn/prio.h>
-#include <asm/sn/xtalk/xbow.h>
-#include <asm/sn/io.h>
 #include <asm/sn/sn_private.h>
 
 extern pcibr_info_t     pcibr_info_get(vertex_hdl_t);
@@ -36,6 +23,8 @@
 extern int		pcibr_slot_initial_rrb_alloc(vertex_hdl_t,pciio_slot_t);
 extern int		pcibr_pcix_rbars_calc(pcibr_soft_t);
 
+extern char *pci_space[];
+
 int pcibr_slot_info_init(vertex_hdl_t pcibr_vhdl, pciio_slot_t slot);
 int pcibr_slot_info_free(vertex_hdl_t pcibr_vhdl, pciio_slot_t slot);
 int pcibr_slot_addr_space_init(vertex_hdl_t pcibr_vhdl,  pciio_slot_t slot);
@@ -57,24 +46,6 @@
 extern uint64_t  do_pcibr_config_get(cfg_p, unsigned, unsigned);
 void do_pcibr_config_set(cfg_p, unsigned, unsigned, uint64_t); 
 
-int pcibr_slot_attach(vertex_hdl_t pcibr_vhdl, pciio_slot_t slot,
-                int drv_flags, char *l1_msg, int *sub_errorp);
-
-int pcibr_slot_info_return(pcibr_soft_t pcibr_soft, pciio_slot_t slot,
-                 pcibr_slot_info_resp_t respp);
-
-extern vertex_hdl_t baseio_pci_vhdl;
-int scsi_ctlr_nums_add(vertex_hdl_t, vertex_hdl_t);
-
-
-/* For now .... */
-/*
- * PCI Hot-Plug Capability Flags
-
- */
-#define D_PCI_HOT_PLUG_ATTACH  0x200  /* Driver supports PCI hot-plug attach */
-#define D_PCI_HOT_PLUG_DETACH  0x400  /* Driver supports PCI hot-plug detach */
-
 
 /* 
  * PCI-X Max Outstanding Split Transactions translation array and Max Memory
@@ -86,158 +57,6 @@
 int max_splittrans_to_numbuf[MAX_SPLIT_TABLE] = {1, 2, 3, 4, 8, 12, 16, 32};
 int max_readcount_to_bufsize[MAX_READCNT_TABLE] = {512, 1024, 2048, 4096 };
 
-
-/*==========================================================================
- *	BRIDGE PCI SLOT RELATED IOCTLs
- */
-
-/*
- * pcibr_slot_startup
- *	Software start-up the PCI slot.
- */
-
-#ifdef PIC_LATER
-
-int
-pcibr_slot_startup(vertex_hdl_t pcibr_vhdl, pcibr_slot_req_t reqp)
-{
-    pcibr_soft_t                   pcibr_soft = pcibr_soft_get(pcibr_vhdl);
-    pciio_slot_t                   slot;
-    int                            error = 0;
-    char                           l1_msg[BRL1_QSIZE+1];
-    struct pcibr_slot_up_resp_s    tmp_up_resp;
-
-    /* Make sure that we are dealing with a bridge device vertex */
-    if (!pcibr_soft) {
-        return(PCI_NOT_A_BRIDGE);
-    }
-
-    /* req_slot is the 'external' slot number, convert for internal use */
-    slot = PCIBR_SLOT_TO_DEVICE(pcibr_soft, reqp->req_slot);
-
-    /* Check for the valid slot */
-    if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
-        return(PCI_NOT_A_SLOT);
-
-#ifdef PIC_LATER
-    /* Acquire update access to the bus */
-    mrlock(pcibr_soft->bs_bus_lock, MR_UPDATE, PZERO);
-#endif
-
-    if (pcibr_soft->bs_slot[slot].slot_status & SLOT_STARTUP_CMPLT) {
-        error = PCI_SLOT_ALREADY_UP;
-        goto startup_unlock;
-    }
-
-    error = pcibr_slot_attach(pcibr_vhdl, slot, D_PCI_HOT_PLUG_ATTACH,
-                              l1_msg, &tmp_up_resp.resp_sub_errno);
-
-    strncpy(tmp_up_resp.resp_l1_msg, l1_msg, L1_QSIZE);
-    tmp_up_resp.resp_l1_msg[L1_QSIZE] = '\0';
-
-    if (COPYOUT(&tmp_up_resp, reqp->req_respp.up, reqp->req_size)) {
-        return(EFAULT);
-    }
-
-    startup_unlock:
-
-#ifdef PIC_LATER
-    /* Release the bus lock */
-    mrunlock(pcibr_soft->bs_bus_lock);
-#endif
-    return(error);
-}
-
-/*
- * pcibr_slot_shutdown
- *	Software shut-down the PCI slot
- */
-int
-pcibr_slot_shutdown(vertex_hdl_t pcibr_vhdl, pcibr_slot_req_t reqp)
-{
-    pcibr_soft_t                   pcibr_soft = pcibr_soft_get(pcibr_vhdl);
-    bridge_t                      *bridge;
-    pciio_slot_t                   slot;
-    int                            error = 0;
-    char                           l1_msg[BRL1_QSIZE+1];
-    struct pcibr_slot_down_resp_s  tmp_down_resp;
-    pciio_slot_t                   tmp_slot;
-
-    /* Make sure that we are dealing with a bridge device vertex */
-    if (!pcibr_soft) {
-        return(PCI_NOT_A_BRIDGE);
-    }
-
-    /* req_slot is the 'external' slot number, convert for internal use */
-    slot = PCIBR_SLOT_TO_DEVICE(pcibr_soft, reqp->req_slot);
-
-    bridge = pcibr_soft->bs_base;
-
-    /* Check for valid slot */
-    if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
-        return(PCI_NOT_A_SLOT);
-
-#ifdef PIC_LATER
-    /* Acquire update access to the bus */
-    mrlock(pcibr_soft->bs_bus_lock, MR_UPDATE, PZERO);
-#endif
-
-    if ((pcibr_soft->bs_slot[slot].slot_status & SLOT_SHUTDOWN_CMPLT) ||
-        ((pcibr_soft->bs_slot[slot].slot_status & SLOT_STATUS_MASK) == 0)) {
-        error = PCI_SLOT_ALREADY_DOWN;
-        /*
-         * RJR - Should we invoke an L1 slot power-down command just in case
-         *       a previous shut-down failed to power-down the slot?
-         */
-        goto shutdown_unlock;
-    }
-
-    /* Do not allow a multi-function card to be hot-plug removed */
-    if (pcibr_soft->bs_slot[slot].bss_ninfo > 1) {
-        tmp_down_resp.resp_sub_errno = EPERM;
-        error = PCI_MULTI_FUNC_ERR;
-        goto shutdown_copyout;
-    }
-
-    /* Do not allow the last 33 MHz card to be removed */
-    if ((bridge->b_wid_control & BRIDGE_CTRL_BUS_SPEED_MASK) ==
-         BRIDGE_CTRL_BUS_SPEED_33) {
-        for (tmp_slot = pcibr_soft->bs_first_slot;
-             tmp_slot <= pcibr_soft->bs_last_slot; tmp_slot++)
-            if (tmp_slot != slot)
-                if (pcibr_soft->bs_slot[tmp_slot].slot_status & SLOT_POWER_UP) {
-                    error++;
-                    break;
-                }
-        if (!error) {
-            error = PCI_EMPTY_33MHZ;
-            goto shutdown_unlock;
-        }
-    }
-
-    error = pcibr_slot_detach(pcibr_vhdl, slot, D_PCI_HOT_PLUG_DETACH,
-                              l1_msg, &tmp_down_resp.resp_sub_errno);
-
-    strncpy(tmp_down_resp.resp_l1_msg, l1_msg, L1_QSIZE);
-    tmp_down_resp.resp_l1_msg[L1_QSIZE] = '\0';
-
-    shutdown_copyout:
-
-    if (COPYOUT(&tmp_down_resp, reqp->req_respp.down, reqp->req_size)) {
-        return(EFAULT);
-    }
-
-    shutdown_unlock:
-
-#ifdef PIC_LATER
-    /* Release the bus lock */
-    mrunlock(pcibr_soft->bs_bus_lock);
-#endif
-
-    return(error);
-}
-#endif	/* PIC_LATER */
-
 char *pci_space_name[] = {"NONE", 
 			  "ROM",
 			  "IO",
@@ -255,252 +74,6 @@
 			  "",
 			  "BAD"};
 
-void
-pcibr_slot_func_info_return(pcibr_info_h pcibr_infoh,
-                            int func,
-                            pcibr_slot_func_info_resp_t funcp)
-{
-    pcibr_info_t                 pcibr_info = pcibr_infoh[func];
-    int                          win;
-
-    funcp->resp_f_status = 0;
-
-    if (!pcibr_info) {
-        return;
-    }
-
-    funcp->resp_f_status |= FUNC_IS_VALID;
-#if defined(SUPPORT_PRINTING_V_FORMAT)
-    sprintf(funcp->resp_f_slot_name, "%v", pcibr_info->f_vertex);
-#endif
-
-    funcp->resp_f_bus = pcibr_info->f_bus;
-    funcp->resp_f_slot = PCIBR_INFO_SLOT_GET_EXT(pcibr_info);
-    funcp->resp_f_func = pcibr_info->f_func;
-#if defined(SUPPORT_PRINTING_V_FORMAT)
-    sprintf(funcp->resp_f_master_name, "%v", pcibr_info->f_master);
-#endif
-    funcp->resp_f_pops = pcibr_info->f_pops;
-    funcp->resp_f_efunc = pcibr_info->f_efunc;
-    funcp->resp_f_einfo = pcibr_info->f_einfo;
-
-    funcp->resp_f_vendor = pcibr_info->f_vendor;
-    funcp->resp_f_device = pcibr_info->f_device;
-
-    for(win = 0 ; win < 6 ; win++) {
-        funcp->resp_f_window[win].resp_w_base =
-                                  pcibr_info->f_window[win].w_base;
-        funcp->resp_f_window[win].resp_w_size =
-                                  pcibr_info->f_window[win].w_size;
-        sprintf(funcp->resp_f_window[win].resp_w_space,
-                "%s",
-                pci_space_name[pcibr_info->f_window[win].w_space]);
-    }
-
-    funcp->resp_f_rbase = pcibr_info->f_rbase;
-    funcp->resp_f_rsize = pcibr_info->f_rsize;
-
-    for (win = 0 ; win < 4; win++) {
-        funcp->resp_f_ibit[win] = pcibr_info->f_ibit[win];
-    }
-
-    funcp->resp_f_att_det_error = pcibr_info->f_att_det_error;
-
-}
-
-int
-pcibr_slot_info_return(pcibr_soft_t             pcibr_soft,
-                       pciio_slot_t             slot,
-                       pcibr_slot_info_resp_t   respp)
-{
-    pcibr_soft_slot_t            pss;
-    int                          func;
-    bridge_t                    *bridge = pcibr_soft->bs_base;
-    reg_p                        b_respp;
-    pcibr_slot_info_resp_t       slotp;
-    pcibr_slot_func_info_resp_t  funcp;
-    extern void snia_kmem_free(void *, int);
-
-    slotp = snia_kmem_zalloc(sizeof(*slotp), 0);
-    if (slotp == NULL) {
-        return(ENOMEM);
-    }
-
-    pss = &pcibr_soft->bs_slot[slot];
-
-    slotp->resp_bs_bridge_mode = pcibr_soft->bs_bridge_mode;
-    slotp->resp_bs_bridge_type = pcibr_soft->bs_bridge_type;
-
-    slotp->resp_has_host = pss->has_host;
-    slotp->resp_host_slot = pss->host_slot;
-#if defined(SUPPORT_PRINTING_V_FORMAT)
-    sprintf(slotp->resp_slot_conn_name, "%v", pss->slot_conn);
-#else
-    sprintf(slotp->resp_slot_conn_name, "%p", (void *)pss->slot_conn);
-#endif
-    slotp->resp_slot_status = pss->slot_status;
-
-    slotp->resp_l1_bus_num = pcibr_widget_to_bus(pcibr_soft->bs_vhdl);
-    slotp->resp_bss_ninfo = pss->bss_ninfo;
-
-    for (func = 0; func < pss->bss_ninfo; func++) {
-        funcp = &(slotp->resp_func[func]);
-        pcibr_slot_func_info_return(pss->bss_infos, func, funcp);
-    }
-
-    sprintf(slotp->resp_bss_devio_bssd_space, "%s",
-            pci_space_name[pss->bss_devio.bssd_space]);
-    slotp->resp_bss_devio_bssd_base = pss->bss_devio.bssd_base;
-    slotp->resp_bss_device = pss->bss_device;
-
-    slotp->resp_bss_pmu_uctr = pss->bss_pmu_uctr;
-    slotp->resp_bss_d32_uctr = pss->bss_d32_uctr;
-    slotp->resp_bss_d64_uctr = pss->bss_d64_uctr;
-
-    slotp->resp_bss_d64_base = pss->bss_d64_base;
-    slotp->resp_bss_d64_flags = pss->bss_d64_flags;
-    slotp->resp_bss_d32_base = pss->bss_d32_base;
-    slotp->resp_bss_d32_flags = pss->bss_d32_flags;
-
-    slotp->resp_bss_ext_ates_active = pss->bss_ext_ates_active;
-
-    slotp->resp_bss_cmd_pointer = pss->bss_cmd_pointer;
-    slotp->resp_bss_cmd_shadow = pss->bss_cmd_shadow;
-
-    slotp->resp_bs_rrb_valid = pcibr_soft->bs_rrb_valid[slot][VCHAN0];
-    slotp->resp_bs_rrb_valid_v1 = pcibr_soft->bs_rrb_valid[slot][VCHAN1];
-    slotp->resp_bs_rrb_valid_v2 = pcibr_soft->bs_rrb_valid[slot][VCHAN2];
-    slotp->resp_bs_rrb_valid_v3 = pcibr_soft->bs_rrb_valid[slot][VCHAN3];
-    slotp->resp_bs_rrb_res = pcibr_soft->bs_rrb_res[slot];
-
-    if (slot & 1) {
-        b_respp = &bridge->b_odd_resp;
-    } else {
-        b_respp = &bridge->b_even_resp;
-    }
-
-    slotp->resp_b_resp = *b_respp;
-
-    slotp->resp_b_int_device = bridge->b_int_device;
-
-    if (IS_PIC_SOFT(pcibr_soft)) {
-	slotp->resp_p_int_enable = bridge->p_int_enable_64;
-	slotp->resp_p_int_host = bridge->p_int_addr_64[slot];
-    } else {
-	slotp->resp_b_int_enable = bridge->b_int_enable;
-	slotp->resp_b_int_host = bridge->b_int_addr[slot].addr;
-    }
-
-    if (COPYOUT(slotp, respp, sizeof(*respp))) {
-        return(EFAULT);
-    }
-
-    snia_kmem_free(slotp, sizeof(*slotp));
-
-    return(0);
-}
-
-/*
- * pcibr_slot_query
- *	Return information about the PCI slot maintained by the infrastructure.
- *	Information is requested in the request structure.
- *
- *      Information returned in the response structure:
- *		Slot hwgraph name
- *		Vendor/Device info
- *		Base register info
- *		Interrupt mapping from device pins to the bridge pins
- *		Devio register
- *		Software RRB info
- *		RRB register info
- *		Host/Gues info
- *		PCI Bus #,slot #, function #
- *		Slot provider hwgraph name
- *		Provider Functions
- *		Error handler
- *		DMA mapping usage counters
- *		DMA direct translation info
- *		External SSRAM workaround info
- */
-int
-pcibr_slot_query(vertex_hdl_t pcibr_vhdl, pcibr_slot_req_t reqp)
-{
-    pcibr_soft_t            pcibr_soft = pcibr_soft_get(pcibr_vhdl);
-    pciio_slot_t            slot;
-    pciio_slot_t            tmp_slot;
-    pcibr_slot_info_resp_t  respp = reqp->req_respp.query;
-    int                     size = reqp->req_size;
-    int                     error = 0;
-
-    /* Make sure that we are dealing with a bridge device vertex */
-    if (!pcibr_soft) {
-        return(PCI_NOT_A_BRIDGE);
-    }
-
-    /* req_slot is the 'external' slot number, convert for internal use */
-    slot = PCIBR_SLOT_TO_DEVICE(pcibr_soft, reqp->req_slot);
-
-    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_HOTPLUG, pcibr_vhdl,
-                "pcibr_slot_query: pcibr_soft=0x%x, slot=%d, reqp=0x%x\n",
-                pcibr_soft, slot, reqp));
-
-    /* Make sure that we have a valid PCI slot number or PCIIO_SLOT_NONE */
-    if ((!PCIBR_VALID_SLOT(pcibr_soft, slot)) && (slot != PCIIO_SLOT_NONE)) {
-        return(PCI_NOT_A_SLOT);
-    }
-
-    /* Return information for the requested PCI slot */
-    if (slot != PCIIO_SLOT_NONE) {
-        if (size < sizeof(*respp)) {
-            return(PCI_RESP_AREA_TOO_SMALL);
-        }
-
-#ifdef PIC_LATER
-        /* Acquire read access to the bus */
-        mrlock(pcibr_soft->bs_bus_lock, MR_ACCESS, PZERO);
-#endif
-        error = pcibr_slot_info_return(pcibr_soft, slot, respp);
-
-#ifdef PIC_LATER
-        /* Release the bus lock */
-        mrunlock(pcibr_soft->bs_bus_lock);
-#endif
-        return(error);
-    }
-
-    /* Return information for all the slots */
-    for (tmp_slot = pcibr_soft->bs_min_slot; 
-		tmp_slot < PCIBR_NUM_SLOTS(pcibr_soft); tmp_slot++) {
-
-        if (size < sizeof(*respp)) {
-            return(PCI_RESP_AREA_TOO_SMALL);
-        }
-
-#ifdef PIC_LATER
-        /* Acquire read access to the bus */
-        mrlock(pcibr_soft->bs_bus_lock, MR_ACCESS, PZERO);
-#endif
-        error = pcibr_slot_info_return(pcibr_soft, tmp_slot, respp);
-
-#ifdef PCI_LATER
-        /* Release the bus lock */
-        mrunlock(pcibr_soft->bs_bus_lock);
-#endif
-        if (error) {
-            return(error);
-        }
-
-        ++respp;
-        size -= sizeof(*respp);
-    }
-
-    return(error);
-}
-
-#define PROBE_LOCK 0	/* FIXME: we're attempting to lock around accesses
-			 * to b_int_enable.   This hangs pcibr_probe_slot()
-			 */
-
 /*
  * pcibr_slot_info_init
  *	Probe for this slot and see if it is populated.
@@ -553,14 +126,8 @@
     /* Try to read the device-id/vendor-id from the config space */
     cfgw = pcibr_slot_config_addr(bridge, slot, 0);
 
-#if PROBE_LOCK
-    s = pcibr_lock(pcibr_soft);
-#endif
     if (pcibr_probe_slot(bridge, cfgw, &idword)) 
 	return(ENODEV);
-#if PROBE_LOCK
-    pcibr_unlock(pcibr_soft, s);
-#endif
 
     slotp = &pcibr_soft->bs_slot[slot];
     slotp->slot_status |= SLOT_POWER_UP;
@@ -591,16 +158,10 @@
     if (htype & 0x80) {		/* MULTIFUNCTION */
 	for (func = 1; func < 8; ++func) {
 	    cfgw = pcibr_func_config_addr(bridge, 0, slot, func, 0);
-#if PROBE_LOCK
-            s = pcibr_lock(pcibr_soft);
-#endif
 	    if (pcibr_probe_slot(bridge, cfgw, &idwords[func])) {
 		pfail |= 1 << func;
 		continue;
 	    }
-#if PROBE_LOCK
-            pcibr_unlock(pcibr_soft, s);
-#endif
 	    vendor = 0xFFFF & idwords[func];
 	    if (vendor == 0xFFFF) {
 		pfail |= 1 << func;
@@ -611,7 +172,11 @@
 	}
         cfgw = pcibr_slot_config_addr(bridge, slot, 0);
     }
-    NEWA(pcibr_infoh, nfunc);
+    pcibr_infoh = kmalloc(nfunc*sizeof (*(pcibr_infoh)), GFP_KERNEL);
+    if ( !pcibr_infoh ) {
+	return ENOMEM;
+    }
+    memset(pcibr_infoh, 0, nfunc*sizeof (*(pcibr_infoh)));
     
     pcibr_soft->bs_slot[slot].bss_ninfo = nfunc;
     pcibr_soft->bs_slot[slot].bss_infos = pcibr_infoh;
@@ -641,39 +206,9 @@
 	}
 
 	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_CONFIG, pcibr_vhdl,
-                "pcibr_slot_info_init: slot=%d, func=%d, cfgw=0x%x\n",
+                "pcibr_slot_info_init: slot=%d, func=%d, cfgw=0x%lx\n",
 		PCIBR_DEVICE_TO_SLOT(pcibr_soft,slot), func, cfgw));
 
-#ifdef PIC_LATER
-        /*
-         * Check for a Quad ATM PCI "card" and return all the PCI bus
-         * memory and I/O space.  This will work-around an apparent
-         * hardware problem with the Quad ATM XIO card handling large
-         * PIO addresses.  Releasing all the space for use by the card
-         * will lower the PIO addresses with the PCI bus address space.
-         * This is OK since the PROM did not assign any BAR addresses. 
-         *
-         * Only release all the PCI bus addresses once.
-         *
-         */
-        if ((vendor == LINC_VENDOR_ID_NUM) && (device == LINC_DEVICE_ID_NUM)) {
-            iopaddr_t               prom_base_addr = pcibr_soft->bs_xid << 24;
-            int                     prom_base_size = 0x1000000;
-
-            if (!(pcibr_soft->bs_bus_addr_status & PCIBR_BUS_ADDR_MEM_FREED)) {
-		pciio_device_win_populate(&pcibr_soft->bs_mem_win_map,
-					  prom_base_addr, prom_base_size);
-                pcibr_soft->bs_bus_addr_status |= PCIBR_BUS_ADDR_MEM_FREED;
-            }
-
-            if (!(pcibr_soft->bs_bus_addr_status & PCIBR_BUS_ADDR_IO_FREED)) {
-		pciio_device_win_populate(&pcibr_soft->bs_io_win_map,
-					  prom_base_addr, prom_base_size);
-                pcibr_soft->bs_bus_addr_status |= PCIBR_BUS_ADDR_IO_FREED;
-            }
-        }
-#endif	/* PIC_LATER */
-
 	/* 
 	 * If the latency timer has already been set, by prom or by the
 	 * card itself, use that value.  Otherwise look at the device's
@@ -745,19 +280,15 @@
 	     */
 	    if (!(pcix_cap = pcibr_find_capability(cfgw, PCI_CAP_PCIX))) {
 		printk(KERN_WARNING
-#if defined(SUPPORT_PRINTING_V_FORMAT)
-		        "%v: Bus running in PCI-X mode, But card in slot %d, "
-		        "func %d not PCI-X capable\n", pcibr_vhdl, slot, func);
-#else
-		        "0x%lx: Bus running in PCI-X mode, But card in slot %d, "
-		        "func %d not PCI-X capable\n", (unsigned long)pcibr_vhdl, slot, func);
-#endif
+		        "%s: Bus running in PCI-X mode, But card in slot %d, "
+		        "func %d not PCI-X capable\n", 
+			pcibr_soft->bs_name, slot, func);
 		pcibr_device_info_new(pcibr_soft, slot, PCIIO_FUNC_NONE,
 		               PCIIO_VENDOR_ID_NONE, PCIIO_DEVICE_ID_NONE);
 		continue;
 	    }
 	    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_CONFIG, pcibr_vhdl,
-                    "pcibr_slot_info_init: PCI-X capability at 0x%x for "
+                    "pcibr_slot_info_init: PCI-X capability at 0x%lx for "
 		    "slot=%d, func=%d\n", 
 		    pcix_cap, PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot), func));
 	} else {
@@ -957,7 +488,7 @@
     pcibr_device_info_free(pcibr_vhdl, slot);
 
     pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos;
-    DELA(pcibr_infoh,nfunc);
+    kfree(pcibr_infoh);
     pcibr_soft->bs_slot[slot].bss_ninfo = 0;
 
     return(0);
@@ -973,7 +504,6 @@
 {
     pcibr_info_h	 pcibr_infoh;
     pcibr_info_t	 pcibr_info;
-    char		 tmp_str[256];
     int		       	 nfunc;
     int			 func;
 
@@ -1047,21 +577,14 @@
             pcibr_soft->bs_pcix_rbar_avail -= num_rbar;
 	    pcix_cmdreg_p->max_mem_read_cnt = pcix_statreg_p->max_mem_read_cnt;
 	}
-        /*
-         * The kernel only allows functions to have so many variable args,
-         * attempting to call PCIBR_DEBUG_ALWAYS() with more than 5 printf
-         * arguments fails so sprintf() it into a temporary string.
-         */
-	if (pcibr_debug_mask & PCIBR_DEBUG_RBAR) {
-            sprintf(tmp_str,"\t  %d/%d   \t    %d    \t  %d  \t  %d  \t  %d\n",
-	            PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot), func,
-	            max_splittrans_to_numbuf[pcix_statreg_p->max_out_split],
-	            max_splittrans_to_numbuf[pcix_cmdreg_p->max_split],
-	            pcibr_soft->bs_pcix_rbar_inuse, 
-		    pcibr_soft->bs_pcix_rbar_avail);
-            PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_RBAR, pcibr_soft->bs_vhdl, 
-		        "%s", tmp_str));
-	}
+
+	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_RBAR, pcibr_soft->bs_vhdl,
+		"\t  %d/%d   \t    %d    \t  %d  \t  %d  \t  %d\n",
+		PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot), func,
+		max_splittrans_to_numbuf[pcix_statreg_p->max_out_split],
+		max_splittrans_to_numbuf[pcix_cmdreg_p->max_split],
+		pcibr_soft->bs_pcix_rbar_inuse,
+		pcibr_soft->bs_pcix_rbar_avail));
     }
     return(0);
 }
@@ -1126,8 +649,7 @@
      * the entire "lo" area is only a
      * megabyte, total ...
      */
-    align_slot = 0x100000;
-    align = align_slot;
+    align_slot = (slot < 2) ? 0x200000 : 0x100000;
 
     for (func = 0; func < nfunc; ++func) {
 	cfg_p                   cfgw;
@@ -1135,9 +657,6 @@
 	pciio_space_t           space;
 	iopaddr_t               base;
 	size_t                  size;
-#ifdef PCI_LATER
-	char			tmp_str[256];
-#endif
 	unsigned                pci_cfg_cmd_reg;
 	unsigned                pci_cfg_cmd_reg_add = 0;
 
@@ -1166,29 +685,21 @@
 		continue;
 
 	    if (base >= size) {
-		/*
-         	 * The kernel only allows functions to have so many variable
-                 * args attempting to call PCIBR_DEBUG_ALWAYS() with more than
-         	 * 5 printf arguments fails so sprintf() it into a temporary 
-		 * string (tmp_str).
-         	 */
-#if defined(SUPPORT_PRINTING_R_FORMAT)
-		if (pcibr_debug_mask & PCIBR_DEBUG_BAR) {
-		    sprintf(tmp_str, "pcibr_slot_addr_space_init: slot=%d, "
-			"func=%d win %d is in %r [0x%x..0x%x], allocated by "
-			"prom\n", PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot),
-			func, win, space, space_desc, base, base + size - 1);
-		    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_BAR, pcibr_vhdl, 
-				"%s",tmp_str));
-		}
-#endif	/* SUPPORT_PRINTING_R_FORMAT */
+		PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_BAR, pcibr_vhdl,
+			"pcibr_slot_addr_space_init: slot=%d, "
+			"func=%d win %d is in space %s [0x%lx..0x%lx], "
+			"allocated by prom\n",
+			PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot), func, win,
+			pci_space[space], (uint64_t)base,
+			(uint64_t)(base + size - 1)));
+
 		continue;		/* already allocated */
 	    }
 
 	    align = (win) ? size : align_slot; 
 
-	    if (align < _PAGESZ)
-		align = _PAGESZ;        /* ie. 0x00004000 */
+	    if (align < PAGE_SIZE)
+		align = PAGE_SIZE;        /* ie. 0x00004000 */
  
 	    switch (space) {
 	    case PCIIO_SPACE_IO:
@@ -1232,28 +743,20 @@
 	    pcibr_info->f_window[win].w_base = base;
 	    do_pcibr_config_set(wptr, (win * 4), 4, base);
 
-#if defined(SUPPORT_PRINTING_R_FORMAT)
-	    if (pcibr_debug_mask & PCIBR_DEBUG_BAR) {
-                if (base >= size) {
-		    sprintf(tmp_str,"pcibr_slot_addr_space_init: slot=%d, func="
-				    "%d, win %d is in %r[0x%x..0x%x], "
-				    "allocated by pcibr\n",
-				    PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot), 
-				    func, win, space, space_desc, base, 
-				    base + size - 1);
-		     PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_BAR, pcibr_vhdl, 
-				 "%s",tmp_str));
-	        }
-		else {
-		    sprintf(tmp_str,"pcibr_slot_addr_space_init: slot=%d, func="
-				    "%d, win %d, unable to alloc 0x%x in %r\n",
-				    PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot), 
-				    func, win, size, space, space_desc);
-		    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_BAR, pcibr_vhdl, 
-				"%s",tmp_str));
-	        }
+	    if (base >= size) {
+		PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_BAR, pcibr_vhdl,
+			"pcibr_slot_addr_space_init: slot=%d, func=%d. win %d "
+			"is in space %s [0x%lx..0x%lx], allocated by pcibr\n",
+			PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot), func, win,
+			pci_space[space], (uint64_t)base, 
+			(uint64_t)(base + size - 1)));
+	    } else {
+		PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_BAR, pcibr_vhdl,
+			"pcibr_slot_addr_space_init: slot=%d, func=%d, win %d, "
+			"unable to alloc 0x%lx in space %s\n",
+			PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot), func, win,
+			(uint64_t)size, pci_space[space]));
 	    }
-#endif	/* SUPPORT_PRINTING_R_FORMAT */
 	}				/* next base */
 
 	/*
@@ -1313,11 +816,6 @@
 	pci_cfg_cmd_reg_add |= PCI_CMD_BUS_MASTER;
 
 	pci_cfg_cmd_reg = do_pcibr_config_get(cfgw, PCI_CFG_COMMAND, 4);
-
-#if PCI_FBBE	/* XXX- check here to see if dev can do fast-back-to-back */
-	if (!((pci_cfg_cmd_reg >> 16) & PCI_STAT_F_BK_BK_CAP))
-	    fast_back_to_back_enable = 0;
-#endif
 	pci_cfg_cmd_reg &= 0xFFFF;
 	if (pci_cfg_cmd_reg_add & ~pci_cfg_cmd_reg)
 	    do_pcibr_config_set(cfgw, PCI_CFG_COMMAND, 4, 
@@ -1363,18 +861,12 @@
      * for 64-bit devices).  We set the bit in pcibr_try_set_device()
      * if we're 64-bit and requesting virtual channels.
      */
-    if (IS_PIC_SOFT(pcibr_soft) && PCIBR_WAR_ENABLED(PV855271, pcibr_soft))
+    if (PCIBR_WAR_ENABLED(PV855271, pcibr_soft))
 	devreg |= BRIDGE_DEV_COH;
     else
 	devreg |= BRIDGE_DEV_COH | BRIDGE_DEV_VIRTUAL_EN;
     pcibr_soft->bs_slot[slot].bss_device = devreg;
     bridge->b_device[slot].reg = devreg;
-
-#ifdef PIC_LATER
-    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_DEVREG, pcibr_vhdl,
-		"pcibr_slot_device_init: Device(%d): %R\n",
-		slot, devreg, device_bits));
-#endif
     return(0);
 }
 
@@ -1407,7 +899,12 @@
      * build verticies for them).
      */
     if (pcibr_soft->bs_slot[slot].bss_ninfo < 1) {
-	NEWA(pcibr_infoh, 1);
+	pcibr_infoh = kmalloc(sizeof (*(pcibr_infoh)), GFP_KERNEL);
+	if ( !pcibr_infoh ) {
+		return ENOMEM;
+	}
+	memset(pcibr_infoh, 0, sizeof (*(pcibr_infoh)));
+
 	pcibr_soft->bs_slot[slot].bss_ninfo = 1;
 	pcibr_soft->bs_slot[slot].bss_infos = pcibr_infoh;
 
@@ -1461,16 +958,10 @@
     pcibr_info_t	pcibr_info;
     int			func;
     vertex_hdl_t	xconn_vhdl, conn_vhdl;
-#ifdef PIC_LATER
-    vertex_hdl_t	scsi_vhdl;
-#endif
     int			nfunc;
     int                 error_func;
     int                 error_slot = 0;
     int                 error = ENODEV;
-#ifdef PIC_LATER
-    int                 hwg_err;
-#endif
 
     pcibr_soft = pcibr_soft_get(pcibr_vhdl);
 
@@ -1501,43 +992,13 @@
 
 	conn_vhdl = pcibr_info->f_vertex;
 
-
 	error_func = pciio_device_attach(conn_vhdl, drv_flags);
 
-#ifdef PIC_LATER
-        /*
-         * Try to assign well-known SCSI controller numbers for hot-plug
-         * insert
-         */
-        if (drv_flags) {
-
-            hwg_err = hwgraph_path_lookup(conn_vhdl, EDGE_LBL_SCSI_CTLR "/0",
-                                          &scsi_vhdl, NULL);
-
-            if (hwg_err == GRAPH_SUCCESS)
-                scsi_ctlr_nums_add(baseio_pci_vhdl, scsi_vhdl);
-
-            /* scsi_vhdl will be the final vertex in either the complete path
-             * on success or a partial path on failure;  in either case,
-             * unreference that vertex.
-             */
-            hwgraph_vertex_unref(scsi_vhdl);
-
-            hwg_err = hwgraph_path_lookup(conn_vhdl, EDGE_LBL_SCSI_CTLR "/1",
-                                          &scsi_vhdl, NULL);
-
-            if (hwg_err == GRAPH_SUCCESS)
-                scsi_ctlr_nums_add(baseio_pci_vhdl, scsi_vhdl);
-
-            /* scsi_vhdl will be the final vertex in either the complete path
-             * on success or a partial path on failure;  in either case,
-             * unreference that vertex.
-             */
-            hwgraph_vertex_unref(scsi_vhdl);
-
-        }
-#endif /* PIC_LATER */
-
+	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_DEV_ATTACH, pcibr_vhdl,
+		    "pcibr_slot_call_device_attach: slot=%d, func=%d "
+		    "drv_flags=0x%x, pciio_device_attach returned %d\n",
+		    PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot), func, 
+		    drv_flags, error_func));
         pcibr_info->f_att_det_error = error_func;
 
 	if (error_func)
@@ -1616,6 +1077,12 @@
 
 	error_func = pciio_device_detach(conn_vhdl, drv_flags);
 
+	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_DEV_DETACH, pcibr_vhdl,
+		    "pcibr_slot_call_device_detach: slot=%d, func=%d "
+		    "drv_flags=0x%x, pciio_device_detach returned %d\n",
+		    PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot), func, 
+		    drv_flags, error_func));
+
         pcibr_info->f_att_det_error = error_func;
 
 	if (error_func)
@@ -1656,9 +1123,6 @@
                   int         *sub_errorp)
 {
     pcibr_soft_t  pcibr_soft = pcibr_soft_get(pcibr_vhdl);
-#ifdef PIC_LATER
-    timespec_t    ts;
-#endif
     int		  error;
 
     /* Do not allow a multi-function card to be hot-plug inserted */
@@ -1739,7 +1203,7 @@
 {
 	int rv;
 	picreg_t p_old_enable = (picreg_t)0, p_new_enable;
-	extern int badaddr_val(volatile void *, int, volatile void *);
+	extern int snia_badaddr_val(volatile void *, int, volatile void *);
 
 	p_old_enable = bridge->p_int_enable_64;
 	p_new_enable = p_old_enable & ~(BRIDGE_IMR_PCI_MST_TIMEOUT | PIC_ISR_PCIX_MTOUT);
@@ -1752,7 +1216,7 @@
 		bridge->p_int_rst_stat_64 = (BRIDGE_IRR_PCI_GRP_CLR | PIC_PCIX_GRP_CLR);
 		(void) bridge->b_wid_tflush;	/* flushbus */
 	}
-	rv = badaddr_val((void *) cfg, 4, valp);
+	rv = snia_badaddr_val((void *) cfg, 4, valp);
 	if (bridge->p_err_int_view_64 & (BRIDGE_ISR_PCI_MST_TIMEOUT | PIC_ISR_PCIX_MTOUT)) {
 		bridge->p_int_rst_stat_64 = BRIDGE_IRR_MULTI_CLR;
 		rv = 1;         /* unoccupied slot */
@@ -1790,7 +1254,7 @@
     int			nfunc = slotp->bss_ninfo;
     int                 bar;
     int                 devio_index;
-    int                 s;
+    unsigned long	s;
     unsigned            cmd_reg;
 
 
@@ -1840,7 +1304,7 @@
 	pciio_device_info_unregister(pcibr_vhdl, &pcibr_info->f_c);
 	pciio_device_info_free(&pcibr_info->f_c);
 
-	DEL(pcibr_info);
+	kfree(pcibr_info);
     }
 
     /* Reset the mapping usage counters */
diff -Nru a/arch/ia64/sn/io/sn2/pciio.c b/arch/ia64/sn/io/sn2/pciio.c
--- a/arch/ia64/sn/io/sn2/pciio.c	Tue Feb  3 19:45:43 2004
+++ b/arch/ia64/sn/io/sn2/pciio.c	Tue Feb  3 19:45:43 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -7,115 +6,11 @@
  * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
  */
 
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <linux/pci_ids.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/slab.h>
-#include <linux/module.h>
-#include <asm/sn/sgi.h>
-#include <asm/sn/xtalk/xbow.h>	/* Must be before iograph.h to get MAX_PORT_NUM */
-#include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
-#include <asm/sn/hcl.h>
-#include <asm/sn/hcl_util.h>
-#include <asm/sn/labelcl.h>
-#include <asm/sn/pci/bridge.h>
-#include <asm/sn/ioerror_handling.h>
-#include <asm/sn/pci/pciio.h>
-#include <asm/sn/pci/pciio_private.h>
-#include <asm/sn/sn_sal.h>
-#include <asm/sn/io.h>
 #include <asm/sn/pci/pci_bus_cvlink.h>
 #include <asm/sn/simulator.h>
 
-#define DEBUG_PCIIO
-#undef DEBUG_PCIIO	/* turn this on for yet more console output */
-
-
 char                    pciio_info_fingerprint[] = "pciio_info";
 
-int
-badaddr_val(volatile void *addr, int len, volatile void *ptr)
-{
-	int ret = 0;
-	volatile void *new_addr;
-
-	switch (len) {
-		case 4:
-			new_addr = (void *) addr;
-			ret = ia64_sn_probe_io_slot((long)new_addr, len, (void *)ptr);
-			break;
-		default:
-			printk(KERN_WARNING "badaddr_val given len %x but supports len of 4 only\n", len);
-	}
-
-	if (ret < 0)
-		panic("badaddr_val: unexpected status (%d) in probing", ret);
-	return(ret);
-
-}
-
-
-nasid_t
-get_console_nasid(void)
-{
-	extern nasid_t console_nasid;
-	extern nasid_t master_baseio_nasid;
-
-	if (console_nasid < 0) {
-		console_nasid = ia64_sn_get_console_nasid();
-		if (console_nasid < 0) {
-// ZZZ What do we do if we don't get a console nasid on the hardware????
-			if (IS_RUNNING_ON_SIMULATOR() )
-				console_nasid = master_baseio_nasid;
-		}
-	} 
-	return console_nasid;
-}
-
-nasid_t
-get_master_baseio_nasid(void)
-{
-	extern nasid_t master_baseio_nasid;
-	extern char master_baseio_wid;
-
-	if (master_baseio_nasid < 0) {
-		master_baseio_nasid = ia64_sn_get_master_baseio_nasid();
-
-		if ( master_baseio_nasid >= 0 ) {
-        		master_baseio_wid = WIDGETID_GET(KL_CONFIG_CH_CONS_INFO(master_baseio_nasid)->memory_base);
-		}
-	} 
-	return master_baseio_nasid;
-}
-
-int
-hub_dma_enabled(vertex_hdl_t xconn_vhdl)
-{
-	return(0);
-}
-
-int
-hub_error_devenable(vertex_hdl_t xconn_vhdl, int devnum, int error_code)
-{
-	return(0);
-}
-
-void
-ioerror_dump(char *name, int error_code, int error_mode, ioerror_t *ioerror)
-{
-}
-
-/******
- ****** end hack defines ......
- ******/
-
-
-
-
 /* =====================================================================
  *    PCI Generic Bus Provider
  * Implement PCI provider operations.  The pciio* layer provides a
@@ -124,111 +19,6 @@
  */
 
 /* =====================================================================
- *    Provider Function Location SHORTCUT
- *
- * On platforms with only one possible PCI provider, macros can be
- * set up at the top that cause the table lookups and indirections to
- * completely disappear.
- */
-
-
-/* =====================================================================
- *    Function Table of Contents
- */
-
-#if !defined(DEV_FUNC)
-static pciio_provider_t *pciio_to_provider_fns(vertex_hdl_t dev);
-#endif
-
-pciio_piomap_t          pciio_piomap_alloc(vertex_hdl_t, device_desc_t, pciio_space_t, iopaddr_t, size_t, size_t, unsigned);
-void                    pciio_piomap_free(pciio_piomap_t);
-caddr_t                 pciio_piomap_addr(pciio_piomap_t, iopaddr_t, size_t);
-
-void                    pciio_piomap_done(pciio_piomap_t);
-caddr_t                 pciio_piotrans_addr(vertex_hdl_t, device_desc_t, pciio_space_t, iopaddr_t, size_t, unsigned);
-caddr_t			pciio_pio_addr(vertex_hdl_t, device_desc_t, pciio_space_t, iopaddr_t, size_t, pciio_piomap_t *, unsigned);
-
-iopaddr_t               pciio_piospace_alloc(vertex_hdl_t, device_desc_t, pciio_space_t, size_t, size_t);
-void                    pciio_piospace_free(vertex_hdl_t, pciio_space_t, iopaddr_t, size_t);
-
-pciio_dmamap_t          pciio_dmamap_alloc(vertex_hdl_t, device_desc_t, size_t, unsigned);
-void                    pciio_dmamap_free(pciio_dmamap_t);
-iopaddr_t               pciio_dmamap_addr(pciio_dmamap_t, paddr_t, size_t);
-void                    pciio_dmamap_done(pciio_dmamap_t);
-iopaddr_t               pciio_dmatrans_addr(vertex_hdl_t, device_desc_t, paddr_t, size_t, unsigned);
-void			pciio_dmamap_drain(pciio_dmamap_t);
-void			pciio_dmaaddr_drain(vertex_hdl_t, paddr_t, size_t);
-void			pciio_dmalist_drain(vertex_hdl_t, alenlist_t);
-iopaddr_t               pciio_dma_addr(vertex_hdl_t, device_desc_t, paddr_t, size_t, pciio_dmamap_t *, unsigned);
-
-pciio_intr_t            pciio_intr_alloc(vertex_hdl_t, device_desc_t, pciio_intr_line_t, vertex_hdl_t);
-void                    pciio_intr_free(pciio_intr_t);
-int                     pciio_intr_connect(pciio_intr_t, intr_func_t, intr_arg_t);
-void                    pciio_intr_disconnect(pciio_intr_t);
-vertex_hdl_t            pciio_intr_cpu_get(pciio_intr_t);
-
-void			pciio_slot_func_to_name(char *, pciio_slot_t, pciio_function_t);
-
-void                    pciio_provider_startup(vertex_hdl_t);
-void                    pciio_provider_shutdown(vertex_hdl_t);
-
-pciio_endian_t          pciio_endian_set(vertex_hdl_t, pciio_endian_t, pciio_endian_t);
-pciio_priority_t        pciio_priority_set(vertex_hdl_t, pciio_priority_t);
-vertex_hdl_t            pciio_intr_dev_get(pciio_intr_t);
-
-vertex_hdl_t            pciio_pio_dev_get(pciio_piomap_t);
-pciio_slot_t            pciio_pio_slot_get(pciio_piomap_t);
-pciio_space_t           pciio_pio_space_get(pciio_piomap_t);
-iopaddr_t               pciio_pio_pciaddr_get(pciio_piomap_t);
-ulong                   pciio_pio_mapsz_get(pciio_piomap_t);
-caddr_t                 pciio_pio_kvaddr_get(pciio_piomap_t);
-
-vertex_hdl_t            pciio_dma_dev_get(pciio_dmamap_t);
-pciio_slot_t            pciio_dma_slot_get(pciio_dmamap_t);
-
-pciio_info_t            pciio_info_chk(vertex_hdl_t);
-pciio_info_t            pciio_info_get(vertex_hdl_t);
-void                    pciio_info_set(vertex_hdl_t, pciio_info_t);
-vertex_hdl_t            pciio_info_dev_get(pciio_info_t);
-pciio_slot_t            pciio_info_slot_get(pciio_info_t);
-pciio_function_t        pciio_info_function_get(pciio_info_t);
-pciio_vendor_id_t       pciio_info_vendor_id_get(pciio_info_t);
-pciio_device_id_t       pciio_info_device_id_get(pciio_info_t);
-vertex_hdl_t            pciio_info_master_get(pciio_info_t);
-arbitrary_info_t        pciio_info_mfast_get(pciio_info_t);
-pciio_provider_t       *pciio_info_pops_get(pciio_info_t);
-error_handler_f	       *pciio_info_efunc_get(pciio_info_t);
-error_handler_arg_t    *pciio_info_einfo_get(pciio_info_t);
-pciio_space_t		pciio_info_bar_space_get(pciio_info_t, int);
-iopaddr_t		pciio_info_bar_base_get(pciio_info_t, int);
-size_t			pciio_info_bar_size_get(pciio_info_t, int);
-iopaddr_t		pciio_info_rom_base_get(pciio_info_t);
-size_t			pciio_info_rom_size_get(pciio_info_t);
-
-int                     pciio_attach(vertex_hdl_t);
-
-void                    pciio_provider_register(vertex_hdl_t, pciio_provider_t *pciio_fns);
-void                    pciio_provider_unregister(vertex_hdl_t);
-pciio_provider_t       *pciio_provider_fns_get(vertex_hdl_t);
-
-int                     pciio_driver_register(pciio_vendor_id_t, pciio_device_id_t, char *driver_prefix, unsigned);
-
-vertex_hdl_t            pciio_device_register(vertex_hdl_t, vertex_hdl_t, pciio_slot_t, pciio_function_t, pciio_vendor_id_t, pciio_device_id_t);
-
-void			pciio_device_unregister(vertex_hdl_t);
-pciio_info_t		pciio_device_info_new(pciio_info_t, vertex_hdl_t, pciio_slot_t, pciio_function_t, pciio_vendor_id_t, pciio_device_id_t);
-void			pciio_device_info_free(pciio_info_t);
-vertex_hdl_t		pciio_device_info_register(vertex_hdl_t, pciio_info_t);
-void			pciio_device_info_unregister(vertex_hdl_t, pciio_info_t);
-int                     pciio_device_attach(vertex_hdl_t, int);
-int			pciio_device_detach(vertex_hdl_t, int);
-void                    pciio_error_register(vertex_hdl_t, error_handler_f *, error_handler_arg_t);
-
-int                     pciio_reset(vertex_hdl_t);
-int                     pciio_write_gather_flush(vertex_hdl_t);
-int                     pciio_slot_inuse(vertex_hdl_t);
-
-/* =====================================================================
  *    Provider Function Location
  *
  *      If there is more than one possible provider for
@@ -238,9 +28,7 @@
  *      appropriately named member.
  */
 
-#if !defined(DEV_FUNC)
-
-static pciio_provider_t *
+pciio_provider_t *
 pciio_to_provider_fns(vertex_hdl_t dev)
 {
     pciio_info_t            card_info;
@@ -261,13 +49,10 @@
 	}
     }
 
-    if (provider_fns == NULL)
-#if defined(SUPPORT_PRINTING_V_FORMAT)
-	PRINT_PANIC("%v: provider_fns == NULL", dev);
-#else
-	PRINT_PANIC("0x%p: provider_fns == NULL", (void *)dev);
-#endif
-
+    if (provider_fns == NULL) {
+	char devname[MAXDEVNAME];
+	panic("%s: provider_fns == NULL", vertex_to_name(dev, devname, MAXDEVNAME));
+    }
     return provider_fns;
 
 }
@@ -276,7 +61,6 @@
 #define CAST_PIOMAP(x)		((pciio_piomap_t)(x))
 #define CAST_DMAMAP(x)		((pciio_dmamap_t)(x))
 #define CAST_INTR(x)		((pciio_intr_t)(x))
-#endif
 
 /*
  * Many functions are not passed their vertex
@@ -396,8 +180,8 @@
 		     size_t byte_count,	/* Size of mapping */
 		     size_t align)
 {					/* Alignment needed */
-    if (align < NBPP)
-	align = NBPP;
+    if (align < PAGE_SIZE)
+	align = PAGE_SIZE;
     return DEV_FUNC(dev, piospace_alloc)
 	(dev, dev_desc, space, byte_count, align);
 }
@@ -753,50 +537,6 @@
 }
 
 /*
- * Specify endianness constraints.  The driver tells us what the device
- * does and how it would like to see things in memory.  We reply with
- * how things will actually appear in memory.
- */
-pciio_endian_t
-pciio_endian_set(vertex_hdl_t dev,
-		 pciio_endian_t device_end,
-		 pciio_endian_t desired_end)
-{
-    ASSERT((device_end == PCIDMA_ENDIAN_BIG) || (device_end == PCIDMA_ENDIAN_LITTLE));
-    ASSERT((desired_end == PCIDMA_ENDIAN_BIG) || (desired_end == PCIDMA_ENDIAN_LITTLE));
-
-#if DEBUG
-#if defined(SUPPORT_PRINTING_V_FORMAT)
-    printk(KERN_ALERT  "%v: pciio_endian_set is going away.\n"
-	    "\tplease use PCIIO_BYTE_STREAM or PCIIO_WORD_VALUES in your\n"
-	    "\tpciio_dmamap_alloc and pciio_dmatrans calls instead.\n",
-	    dev);
-#else
-    printk(KERN_ALERT  "0x%x: pciio_endian_set is going away.\n"
-	    "\tplease use PCIIO_BYTE_STREAM or PCIIO_WORD_VALUES in your\n"
-	    "\tpciio_dmamap_alloc and pciio_dmatrans calls instead.\n",
-	    dev);
-#endif
-#endif
-
-    return DEV_FUNC(dev, endian_set)
-	(dev, device_end, desired_end);
-}
-
-/*
- * Specify PCI arbitration priority.
- */
-pciio_priority_t
-pciio_priority_set(vertex_hdl_t dev,
-		   pciio_priority_t device_prio)
-{
-    ASSERT((device_prio == PCI_PRIO_HIGH) || (device_prio == PCI_PRIO_LOW));
-
-    return DEV_FUNC(dev, priority_set)
-	(dev, device_prio);
-}
-
-/*
  * Read value of configuration register
  */
 uint64_t
@@ -865,71 +605,6 @@
     return DEV_FUNC(dev, reset) (dev);
 }
 
-/*
- * flush write gather buffers
- */
-int
-pciio_write_gather_flush(vertex_hdl_t dev)
-{
-    return DEV_FUNC(dev, write_gather_flush) (dev);
-}
-
-vertex_hdl_t
-pciio_intr_dev_get(pciio_intr_t pciio_intr)
-{
-    return (pciio_intr->pi_dev);
-}
-
-/****** Generic crosstalk pio interfaces ******/
-vertex_hdl_t
-pciio_pio_dev_get(pciio_piomap_t pciio_piomap)
-{
-    return (pciio_piomap->pp_dev);
-}
-
-pciio_slot_t
-pciio_pio_slot_get(pciio_piomap_t pciio_piomap)
-{
-    return (pciio_piomap->pp_slot);
-}
-
-pciio_space_t
-pciio_pio_space_get(pciio_piomap_t pciio_piomap)
-{
-    return (pciio_piomap->pp_space);
-}
-
-iopaddr_t
-pciio_pio_pciaddr_get(pciio_piomap_t pciio_piomap)
-{
-    return (pciio_piomap->pp_pciaddr);
-}
-
-ulong
-pciio_pio_mapsz_get(pciio_piomap_t pciio_piomap)
-{
-    return (pciio_piomap->pp_mapsz);
-}
-
-caddr_t
-pciio_pio_kvaddr_get(pciio_piomap_t pciio_piomap)
-{
-    return (pciio_piomap->pp_kvaddr);
-}
-
-/****** Generic crosstalk dma interfaces ******/
-vertex_hdl_t
-pciio_dma_dev_get(pciio_dmamap_t pciio_dmamap)
-{
-    return (pciio_dmamap->pd_dev);
-}
-
-pciio_slot_t
-pciio_dma_slot_get(pciio_dmamap_t pciio_dmamap)
-{
-    return (pciio_dmamap->pd_slot);
-}
-
 /****** Generic pci slot information interfaces ******/
 
 pciio_info_t
@@ -979,6 +654,13 @@
     return (pciio_info->c_vertex);
 }
 
+/*ARGSUSED*/
+pciio_bus_t
+pciio_info_bus_get(pciio_info_t pciio_info)
+{
+    return (pciio_info->c_bus);
+}
+
 pciio_slot_t
 pciio_info_slot_get(pciio_info_t pciio_info)
 {
@@ -1021,49 +703,30 @@
     return (pciio_info->c_pops);
 }
 
-error_handler_f	       *
-pciio_info_efunc_get(pciio_info_t pciio_info)
-{
-    return (pciio_info->c_efunc);
-}
-
-error_handler_arg_t    *
-pciio_info_einfo_get(pciio_info_t pciio_info)
-{
-    return (pciio_info->c_einfo);
-}
-
-pciio_space_t
-pciio_info_bar_space_get(pciio_info_t info, int win)
-{
-    return info->c_window[win].w_space;
-}
-
-iopaddr_t
-pciio_info_bar_base_get(pciio_info_t info, int win)
+int
+pciio_businfo_multi_master_get(pciio_businfo_t businfo)
 {
-    return info->c_window[win].w_base;
+    return businfo->bi_multi_master;
 }
 
-size_t
-pciio_info_bar_size_get(pciio_info_t info, int win)
+pciio_asic_type_t
+pciio_businfo_asic_type_get(pciio_businfo_t businfo)
 {
-    return info->c_window[win].w_size;
+    return businfo->bi_asic_type;
 }
 
-iopaddr_t
-pciio_info_rom_base_get(pciio_info_t info)
+pciio_bus_type_t
+pciio_businfo_bus_type_get(pciio_businfo_t businfo)
 {
-    return info->c_rbase;
+    return businfo->bi_bus_type;
 }
 
-size_t
-pciio_info_rom_size_get(pciio_info_t info)
+pciio_bus_speed_t
+pciio_businfo_bus_speed_get(pciio_businfo_t businfo)
 {
-    return info->c_rsize;
+    return businfo->bi_bus_speed;
 }
 
-
 /* =====================================================================
  *          GENERIC PCI INITIALIZATION FUNCTIONS
  */
@@ -1077,11 +740,8 @@
 pciio_attach(vertex_hdl_t pciio)
 {
 #if DEBUG && ATTACH_DEBUG
-#if defined(SUPPORT_PRINTING_V_FORMAT)
-    printk("%v: pciio_attach\n", pciio);
-#else
-    printk("0x%x: pciio_attach\n", pciio);
-#endif
+    char devname[MAXDEVNAME];
+    printk("%s: pciio_attach\n", vertex_to_name(pciio, devname, MAXDEVNAME));
 #endif
     return 0;
 }
@@ -1119,37 +779,6 @@
     return (pciio_provider_t *) ainfo;
 }
 
-/*ARGSUSED4 */
-int
-pciio_driver_register(
-			 pciio_vendor_id_t vendor_id,
-			 pciio_device_id_t device_id,
-			 char *driver_prefix,
-			 unsigned flags)
-{
-	return(0);
-}
-
-vertex_hdl_t
-pciio_device_register(
-		vertex_hdl_t connectpt,	/* vertex for /hw/.../pciio/%d */
-		vertex_hdl_t master,	/* card's master ASIC (PCI provider) */
-		pciio_slot_t slot,	/* card's slot */
-		pciio_function_t func,	/* card's func */
-		pciio_vendor_id_t vendor_id,
-		pciio_device_id_t device_id)
-{
-    return pciio_device_info_register
-	(connectpt, pciio_device_info_new (NULL, master, slot, func,
-					   vendor_id, device_id));
-}
-
-void
-pciio_device_unregister(vertex_hdl_t pconn)
-{
-    DEV_FUNC(pconn,device_unregister)(pconn);
-}
-
 pciio_info_t
 pciio_device_info_new(
 		pciio_info_t pciio_info,
@@ -1159,8 +788,11 @@
 		pciio_vendor_id_t vendor_id,
 		pciio_device_id_t device_id)
 {
-    if (!pciio_info)
-	NEW(pciio_info);
+    if (!pciio_info) {
+	pciio_info = kmalloc(sizeof (*(pciio_info)), GFP_KERNEL);
+	if ( pciio_info )
+		memset(pciio_info, 0, sizeof (*(pciio_info)));
+    }
     ASSERT(pciio_info != NULL);
 
     pciio_info->c_slot = slot;
@@ -1182,7 +814,7 @@
     /* NOTE : pciio_info is a structure within the pcibr_info
      *	      and not a pointer to memory allocated on the heap !!
      */
-    BZERO((char *)pciio_info,sizeof(pciio_info));
+    memset((char *)pciio_info, 0, sizeof(pciio_info));
 }
 
 vertex_hdl_t
@@ -1293,14 +925,26 @@
 {
 
 	struct resource *new_res;
-	int status = 0;
-
-	new_res = (struct resource *) kmalloc( sizeof(struct resource), KM_NOSLEEP);
+	int status;
 
-	status = allocate_resource( root_resource, new_res,
+	new_res = (struct resource *) kmalloc( sizeof(struct resource), GFP_KERNEL);
+	if (!new_res)
+		return 0;
+
+	if (start > 0) {
+		status = allocate_resource( root_resource, new_res,
+			size, start /* Min start addr. */,
+			(start + size) - 1, 1,
+			NULL, NULL);
+	} else {
+		if (size > align)
+			align = size;
+		status = allocate_resource( root_resource, new_res,
 				    size, align /* Min start addr. */,
 				    root_resource->end, align,
 				    NULL, NULL);
+	}
+
 	if (status) {
 		kfree(new_res);
 		return((iopaddr_t) NULL);
@@ -1326,8 +970,7 @@
 void
 pciio_device_win_free(pciio_win_alloc_t win_alloc)
 {
-
-	int status = 0;
+	int status;
 
 	if (win_alloc->wa_resource) {
 		status = release_resource(win_alloc->wa_resource);
@@ -1389,47 +1032,16 @@
 }
 
 int
-pciio_dma_enabled(vertex_hdl_t pconn_vhdl)
-{
-	return DEV_FUNC(pconn_vhdl, dma_enabled)(pconn_vhdl);
-}
-
-int
 pciio_info_type1_get(pciio_info_t pci_info)
 {
-	return(0);
+	return (pci_info->c_type1);
 }
 
-/*
- *  XXX: should probably be called __sn2_pci_rrb_alloc
- */
-/* used by qla1280 */
-int
-snia_pcibr_rrb_alloc(struct pci_dev *pci_dev,
-	int *count_vchan0,
-	int *count_vchan1)
+pciio_businfo_t
+pciio_businfo_get(vertex_hdl_t conn)
 {
-	vertex_hdl_t dev = PCIDEV_VERTEX(pci_dev);
+	pciio_info_t		info;
 
-	return pcibr_rrb_alloc(dev, count_vchan0, count_vchan1);
-}
-EXPORT_SYMBOL(snia_pcibr_rrb_alloc);
-
-/* 
- * XXX: interface should be more like
- *
- *	int __sn2_pci_enable_bwswap(struct pci_dev *dev);
- *	void __sn2_pci_disable_bswap(struct pci_dev *dev);
- */
-/* used by ioc4 ide */
-pciio_endian_t
-snia_pciio_endian_set(struct pci_dev *pci_dev,
-	pciio_endian_t device_end,
-	pciio_endian_t desired_end)
-{
-	vertex_hdl_t dev = PCIDEV_VERTEX(pci_dev);
-	
-	return DEV_FUNC(dev, endian_set)
-		(dev, device_end, desired_end);
+	info = pciio_info_get(conn);
+	return DEV_FUNC(conn, businfo_get)(conn);
 }
-EXPORT_SYMBOL(snia_pciio_endian_set);
diff -Nru a/arch/ia64/sn/io/sn2/pic.c b/arch/ia64/sn/io/sn2/pic.c
--- a/arch/ia64/sn/io/sn2/pic.c	Tue Feb  3 19:45:30 2004
+++ b/arch/ia64/sn/io/sn2/pic.c	Tue Feb  3 19:45:30 2004
@@ -1,5 +1,4 @@
 /*
- *
  * 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.
@@ -7,26 +6,15 @@
  * Copyright (C) 2001-2003 Silicon Graphics, Inc. All rights reserved.
  */
 
-#include <linux/types.h>
-#include <linux/slab.h>
-#include <linux/module.h>
-#include <asm/sn/sgi.h>
+#include <linux/interrupt.h>
 #include <asm/sn/sn_cpuid.h>
-#include <asm/sn/addrs.h>
-#include <asm/sn/arch.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
-#include <asm/sn/hcl.h>
-#include <asm/sn/labelcl.h>
-#include <asm/sn/xtalk/xwidget.h>
-#include <asm/sn/pci/bridge.h>
+#include <asm/sn/hcl_util.h>
 #include <asm/sn/pci/pciio.h>
 #include <asm/sn/pci/pcibr.h>
 #include <asm/sn/pci/pcibr_private.h>
 #include <asm/sn/pci/pci_defs.h>
-#include <asm/sn/prio.h>
-#include <asm/sn/xtalk/xbow.h>
-#include <asm/sn/io.h>
+#include <asm/sn/pci/pic.h>
 #include <asm/sn/sn_private.h>
 
 
@@ -38,34 +26,9 @@
 
 
 /*
- * copy inventory_t from conn_v to peer_conn_v
- */
-int
-pic_bus1_inventory_dup(vertex_hdl_t conn_v, vertex_hdl_t peer_conn_v)
-{
-	inventory_t *pinv, *peer_pinv;
-
-	if (hwgraph_info_get_LBL(conn_v, INFO_LBL_INVENT,
-				(arbitrary_info_t *)&pinv) == GRAPH_SUCCESS)
- {
-		NEW(peer_pinv);
-		memcpy(peer_pinv, pinv, sizeof(inventory_t));
-		if (hwgraph_info_add_LBL(peer_conn_v, INFO_LBL_INVENT,
-			    (arbitrary_info_t)peer_pinv) != GRAPH_SUCCESS) {
-			DEL(peer_pinv);
-			return 0;
-		}
-		return 1;
-	}
-
-	printk("pic_bus1_inventory_dup: cannot get INFO_LBL_INVENT from 0x%lx\n ", (uint64_t)conn_v);
-	return 0;
-}
-
-/*
  * copy xwidget_info_t from conn_v to peer_conn_v
  */
-int
+static int
 pic_bus1_widget_info_dup(vertex_hdl_t conn_v, vertex_hdl_t peer_conn_v,
 							cnodeid_t xbow_peer)
 {
@@ -83,21 +46,27 @@
 
 	if (hwgraph_info_get_LBL(conn_v, INFO_LBL_XWIDGET,
 			(arbitrary_info_t *)&widget_info) == GRAPH_SUCCESS) {
-		NEW(peer_widget_info);
-		peer_widget_info->w_vertex = peer_conn_v;
-		peer_widget_info->w_id = widget_info->w_id;
-		peer_widget_info->w_master = peer_hubv;
-		peer_widget_info->w_masterid = peer_hub_info->h_widgetid;
+		peer_widget_info = kmalloc(sizeof (*(peer_widget_info)), GFP_KERNEL);
+		if ( !peer_widget_info ) {
+			return 0;
+		}
+		memset(peer_widget_info, 0, sizeof (*(peer_widget_info)));
+
+		peer_widget_info->w_fingerprint = widget_info_fingerprint;
+    		peer_widget_info->w_vertex = peer_conn_v;
+    		peer_widget_info->w_id = widget_info->w_id;
+    		peer_widget_info->w_master = peer_hubv;
+    		peer_widget_info->w_masterid = peer_hub_info->h_widgetid;
 		/* structure copy */
-		peer_widget_info->w_hwid = widget_info->w_hwid;
-		peer_widget_info->w_efunc = 0;
-		peer_widget_info->w_einfo = 0;
+    		peer_widget_info->w_hwid = widget_info->w_hwid;
+    		peer_widget_info->w_efunc = 0;
+    		peer_widget_info->w_einfo = 0;
 		peer_widget_info->w_name = kmalloc(strlen(peer_path) + 1, GFP_KERNEL);
 		strcpy(peer_widget_info->w_name, peer_path);
 
 		if (hwgraph_info_add_LBL(peer_conn_v, INFO_LBL_XWIDGET,
 			(arbitrary_info_t)peer_widget_info) != GRAPH_SUCCESS) {
-				DEL(peer_widget_info);
+				kfree(peer_widget_info);
 				return 0;
 		}
 
@@ -119,7 +88,7 @@
  * If not successful, return zero and both buses will attach to the
  * vertex passed into pic_attach().
  */
-vertex_hdl_t
+static vertex_hdl_t
 pic_bus1_redist(nasid_t nasid, vertex_hdl_t conn_v)
 {
 	cnodeid_t cnode = NASID_TO_COMPACT_NODEID(nasid);
@@ -172,11 +141,6 @@
 			     * vertex but that should be safe and we don't
 			     * really expect the additions to fail anyway.
 			     */
-#if 0
-			    if (!pic_bus1_inventory_dup(conn_v, peer_conn_v))
-					return 0;
-			    pic_bus1_device_desc_dup(conn_v, peer_conn_v);
-#endif
 			    if (!pic_bus1_widget_info_dup(conn_v, peer_conn_v, xbow_peer))
 					return 0;
 
@@ -196,6 +160,8 @@
 	vertex_hdl_t	pcibr_vhdl0, pcibr_vhdl1 = (vertex_hdl_t)0;
 	pcibr_soft_t	bus0_soft, bus1_soft = (pcibr_soft_t)0;
 	vertex_hdl_t  conn_v0, conn_v1, peer_conn_v;
+	int		bricktype;
+	int		iobrick_type_get_nasid(nasid_t nasid);
 
 	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATTACH, conn_v, "pic_attach()\n"));
 
@@ -204,13 +170,14 @@
 	bridge1 = (bridge_t *)((char *)bridge0 + PIC_BUS1_OFFSET);
 
 	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATTACH, conn_v,
-		    "pic_attach: bridge0=0x%x, bridge1=0x%x\n", 
+		    "pic_attach: bridge0=0x%lx, bridge1=0x%lx\n", 
 		    bridge0, bridge1));
 
 	conn_v0 = conn_v1 = conn_v;
 
 	/* If dual-ported then split the two PIC buses across both Cbricks */
-	if ((peer_conn_v = (pic_bus1_redist(NASID_GET(bridge0), conn_v))))
+	peer_conn_v = pic_bus1_redist(NASID_GET(bridge0), conn_v);
+	if (peer_conn_v)
 		conn_v1 = peer_conn_v;
 
 	/*
@@ -224,14 +191,21 @@
 	 * Opening this vertex will provide access to
 	 * the Bridge registers themselves.
 	 */
-	/* FIXME: what should the hwgraph path look like ? */
-	rc = hwgraph_path_add(conn_v0, EDGE_LBL_PCIX_0, &pcibr_vhdl0);
-	ASSERT(rc == GRAPH_SUCCESS);
-	rc = hwgraph_path_add(conn_v1, EDGE_LBL_PCIX_1, &pcibr_vhdl1);
-	ASSERT(rc == GRAPH_SUCCESS);
+	bricktype = iobrick_type_get_nasid(NASID_GET(bridge0));
+	if ( bricktype == MODULE_CGBRICK ) {
+		rc = hwgraph_path_add(conn_v0, EDGE_LBL_AGP_0, &pcibr_vhdl0);
+		ASSERT(rc == GRAPH_SUCCESS);
+		rc = hwgraph_path_add(conn_v1, EDGE_LBL_AGP_1, &pcibr_vhdl1);
+		ASSERT(rc == GRAPH_SUCCESS);
+	} else {
+		rc = hwgraph_path_add(conn_v0, EDGE_LBL_PCIX_0, &pcibr_vhdl0);
+		ASSERT(rc == GRAPH_SUCCESS);
+		rc = hwgraph_path_add(conn_v1, EDGE_LBL_PCIX_1, &pcibr_vhdl1);
+		ASSERT(rc == GRAPH_SUCCESS);
+	}
 
 	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATTACH, conn_v,
-		    "pic_attach: pcibr_vhdl0=%v, pcibr_vhdl1=%v\n",
+		    "pic_attach: pcibr_vhdl0=0x%lx, pcibr_vhdl1=0x%lx\n",
 		    pcibr_vhdl0, pcibr_vhdl1));
 
 	/* register pci provider array */
@@ -249,7 +223,7 @@
         bus1_soft->bs_peers_soft = bus0_soft;
 
 	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATTACH, conn_v,
-		    "pic_attach: bus0_soft=0x%x, bus1_soft=0x%x\n",
+		    "pic_attach: bus0_soft=0x%lx, bus1_soft=0x%lx\n",
 		    bus0_soft, bus1_soft));
 
 	return 0;
@@ -294,10 +268,8 @@
     (pciio_priority_set_f *) pcibr_priority_set,
     (pciio_config_get_f *) pcibr_config_get,
     (pciio_config_set_f *) pcibr_config_set,
-    (pciio_error_devenable_f *) 0,
     (pciio_error_extract_f *) 0,
     (pciio_driver_reg_callback_f *) pcibr_driver_reg_callback,
     (pciio_driver_unreg_callback_f *) pcibr_driver_unreg_callback,
     (pciio_device_unregister_f 	*) pcibr_device_unregister,
-    (pciio_dma_enabled_f		*) pcibr_dma_enabled,
 };
diff -Nru a/arch/ia64/sn/io/sn2/shub.c b/arch/ia64/sn/io/sn2/shub.c
--- a/arch/ia64/sn/io/sn2/shub.c	Tue Feb  3 19:45:28 2004
+++ b/arch/ia64/sn/io/sn2/shub.c	Tue Feb  3 19:45:28 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -7,18 +6,18 @@
  * Copyright (C) 1992-1997, 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  */
 
-#ident  "$Revision: 1.167 $"
-
 #include <linux/types.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
+#include <linux/seq_file.h>
+#include <linux/sched.h>
 #include <asm/smp.h>
 #include <asm/irq.h>
 #include <asm/hw_irq.h>
 #include <asm/system.h>
 #include <asm/sn/sgi.h>
+#include <asm/uaccess.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
 #include <asm/sn/io.h>
@@ -30,49 +29,12 @@
 #include <asm/sn/xtalk/xtalk.h>
 #include <asm/sn/pci/pcibr_private.h>
 #include <asm/sn/intr.h>
+#include <asm/sn/sn2/shub_mmr.h>
 #include <asm/sn/sn2/shub_mmr_t.h>
 #include <asm/sal.h>
 #include <asm/sn/sn_sal.h>
 #include <asm/sn/sndrv.h>
 #include <asm/sn/sn2/shubio.h>
-#include <asm/sn/sn2/shub_mmr.h>
-
-/*
- * Shub WAR for Xbridge Little Endian problem:
- *	Xbridge has to run in BIG ENDIAN even with Shub.
- */
-
-
-/*
- * io_sh_swapper: Turn on Shub byte swapping.
- *	All data destined to and from Shub to XIO are byte-swapped.
- */
-void
-io_sh_swapper(nasid_t nasid, int onoff)
-{
-    ii_iwc_u_t      ii_iwc;
-
-    ii_iwc.ii_iwc_regval = REMOTE_HUB_L(nasid, IIO_IWC);
-
-    ii_iwc.ii_iwc_fld_s.i_dma_byte_swap = onoff;
-    REMOTE_HUB_S(nasid, IIO_IWC, ii_iwc.ii_iwc_regval);
-    ii_iwc.ii_iwc_regval = REMOTE_HUB_L(nasid, IIO_IWC);
-
-}
-
-/*
- * io_get_sh_swapper: Return current Swap mode.
- *	1 = Swap on, 0 = Swap off.
- */
-int
-io_get_sh_swapper(nasid_t nasid)
-{
-    ii_iwc_u_t      ii_iwc;
-
-    ii_iwc.ii_iwc_regval = REMOTE_HUB_L(nasid, IIO_IWC);
-    return(ii_iwc.ii_iwc_fld_s.i_dma_byte_swap);
-
-}
 
 #define SHUB_NUM_ECF_REGISTERS 8
 
@@ -204,6 +166,8 @@
 	int		nasid;
 
         cnode = (cnodeid_t)file->f_dentry->d_fsdata;
+        if (cnode < 0 || cnode >= numnodes)
+                return -ENODEV;
 
         switch (cmd) {
 	case SNDRV_SHUB_CONFIGURE:
diff -Nru a/arch/ia64/sn/io/sn2/shub_intr.c b/arch/ia64/sn/io/sn2/shub_intr.c
--- a/arch/ia64/sn/io/sn2/shub_intr.c	Tue Feb  3 19:45:26 2004
+++ b/arch/ia64/sn/io/sn2/shub_intr.c	Tue Feb  3 19:45:26 2004
@@ -18,7 +18,6 @@
 #include <asm/sn/io.h>
 #include <asm/sn/sn_private.h>
 #include <asm/sn/addrs.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/hcl_util.h>
 #include <asm/sn/intr.h>
@@ -26,6 +25,8 @@
 #include <asm/sn/klconfig.h>
 #include <asm/sn/sn2/shub_mmr.h>
 #include <asm/sn/sn_cpuid.h>
+#include <asm/sn/pci/pcibr.h>
+#include <asm/sn/pci/pcibr_private.h>
 
 /* ARGSUSED */
 void
@@ -36,11 +37,15 @@
 xwidgetnum_t
 hub_widget_id(nasid_t nasid)
 {
-        hubii_wcr_t     ii_wcr; /* the control status register */
-        
-        ii_wcr.wcr_reg_value = REMOTE_HUB_L(nasid,IIO_WCR);
-        
-        return ii_wcr.wcr_fields_s.wcr_widget_id;
+
+	if (!(nasid & 1)) {
+        	hubii_wcr_t     ii_wcr; /* the control status register */
+        	ii_wcr.wcr_reg_value = REMOTE_HUB_L(nasid,IIO_WCR);
+        	return ii_wcr.wcr_fields_s.wcr_widget_id;
+	} else {
+		/* ICE does not have widget id. */
+		return(-1);
+	}
 }
 
 static hub_intr_t
@@ -49,7 +54,7 @@
 		vertex_hdl_t owner_dev,
 		int uncond_nothread)
 {
-	cpuid_t		cpu = 0;
+	cpuid_t		cpu;
 	int		vector;
 	hub_intr_t	intr_hdl;
 	cnodeid_t	cnode;
@@ -58,7 +63,6 @@
 	iopaddr_t	xtalk_addr;
 	struct xtalk_intr_s	*xtalk_info;
 	xwidget_info_t	xwidget_info;
-	ilvl_t		intr_swlevel = 0;
 
 	cpu = intr_heuristic(dev, -1, &vector);
 	if (cpu == CPU_NONE) {
@@ -77,8 +81,9 @@
 		xtalk_addr = SH_II_INT0 | ((unsigned long)nasid << 36) | (1UL << 47);
 	}
 
-	intr_hdl = snia_kmem_alloc_node(sizeof(struct hub_intr_s), KM_NOSLEEP, cnode);
+	intr_hdl = kmalloc(sizeof(struct hub_intr_s), GFP_KERNEL);
 	ASSERT_ALWAYS(intr_hdl);
+	memset(intr_hdl, 0, sizeof(struct hub_intr_s));
 
 	xtalk_info = &intr_hdl->i_xtalk_info;
 	xtalk_info->xi_dev = dev;
@@ -90,12 +95,11 @@
 		xtalk_info->xi_target = xwidget_info_masterid_get(xwidget_info);
 	}
 
-	intr_hdl->i_swlevel = intr_swlevel;
 	intr_hdl->i_cpuid = cpu;
 	intr_hdl->i_bit = vector;
 	intr_hdl->i_flags |= HUB_INTR_IS_ALLOCED;
 
-	return(intr_hdl);
+	return intr_hdl;
 }
 
 hub_intr_t
@@ -184,4 +188,74 @@
 	rv = intr_disconnect_level(cpu, bit);
 	ASSERT(rv == 0);
 	intr_hdl->i_flags &= ~HUB_INTR_IS_CONNECTED;
+}
+
+/* 
+ * Redirect an interrupt to another cpu.
+ */
+
+void
+sn_shub_redirect_intr(pcibr_intr_t intr, unsigned long cpu)
+{
+	unsigned long bit;
+	int cpuphys, slice;
+	nasid_t nasid;
+	unsigned long xtalk_addr;
+	void		*bridge = intr->bi_soft->bs_base;
+	int		irq;
+	int		i;
+	int		old_cpu;
+	int		new_cpu;
+
+	cpuphys = cpu_physical_id(cpu);
+	slice = cpu_physical_id_to_slice(cpuphys);
+	nasid = cpu_physical_id_to_nasid(cpuphys);
+
+	for (i = CPUS_PER_NODE - 1; i >= 0; i--) {
+		new_cpu = nasid_slice_to_cpuid(nasid, i);
+		if (new_cpu == NR_CPUS) {
+			continue;
+		}
+
+		if (!cpu_online(new_cpu)) {
+			continue;
+		}
+		break;
+	}
+
+	if (enable_shub_wars_1_1() && slice != i) {
+		printk("smp_affinity WARNING: SHUB 1.1 present: cannot target cpu %d, targeting cpu %d instead.\n",(int)cpu, new_cpu);
+		cpu = new_cpu;
+		slice = i;
+	}
+
+	if (slice) {    
+		xtalk_addr = SH_II_INT1 | ((unsigned long)nasid << 36) | (1UL << 47);
+	} else {
+		xtalk_addr = SH_II_INT0 | ((unsigned long)nasid << 36) | (1UL << 47);
+	}
+
+	for (bit = 0; bit < 8; bit++) {
+		if (intr->bi_ibits & (1 << bit) ) {
+			/* Disable interrupts. */
+			pcireg_intr_enable_bit_clr(bridge, bit);
+			/* Reset Host address (Interrupt destination) */
+			pcireg_intr_addr_addr_set(bridge, bit, xtalk_addr);
+			/* Enable interrupt */
+			pcireg_intr_enable_bit_set(bridge, bit);
+			/* Force an interrupt, just in case. */
+			pcireg_force_intr_set(bridge, bit);
+		}
+	}
+	irq = intr->bi_irq;
+	old_cpu = intr->bi_cpu;
+	if (pdacpu(cpu)->sn_first_irq == 0 || pdacpu(cpu)->sn_first_irq > irq) {
+		pdacpu(cpu)->sn_first_irq = irq;
+	}
+	if (pdacpu(cpu)->sn_last_irq < irq) {
+		pdacpu(cpu)->sn_last_irq = irq;
+	}
+	pdacpu(old_cpu)->sn_num_irqs--;
+	pdacpu(cpu)->sn_num_irqs++;
+	intr->bi_cpu = (int)cpu;
 }
diff -Nru a/arch/ia64/sn/io/sn2/shuberror.c b/arch/ia64/sn/io/sn2/shuberror.c
--- a/arch/ia64/sn/io/sn2/shuberror.c	Tue Feb  3 19:45:42 2004
+++ b/arch/ia64/sn/io/sn2/shuberror.c	Tue Feb  3 19:45:42 2004
@@ -1,5 +1,4 @@
-/* $Id: shuberror.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $
- *
+/*
  * 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.
@@ -17,7 +16,6 @@
 #include <asm/sn/sgi.h>
 #include <asm/sn/io.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
 #include <asm/sn/sn_private.h>
@@ -31,6 +29,7 @@
 #include <asm/sn/ioerror_handling.h>
 #include <asm/sn/ioerror.h>
 #include <asm/sn/sn2/shubio.h>
+#include <asm/sn/sn2/shub_mmr.h>
 #include <asm/sn/bte.h>
 
 extern void hubni_eint_init(cnodeid_t cnode);
@@ -173,7 +172,6 @@
     hubinfo_t		hinfo; 
     ii_wstat_u_t	wstat;
     hubreg_t		idsr;
-    ii_ilcsr_u_t	ilcsr;
 
 
     /* two levels of casting avoids compiler warning.!! */
@@ -228,11 +226,9 @@
 	
 	}
 	/*
-	 * Note: we may never be able to print this, if the II talking
-	 * to Xbow which hosts the console is dead. 
+	 * Only print the II_ECRAZY message if there is an attached xbow.
 	 */
-	ilcsr.ii_ilcsr_regval = REMOTE_HUB_L(hinfo->h_nasid, IIO_ILCSR);
-	if (ilcsr.ii_ilcsr_fld_s.i_llp_en == 1) {	/* Link is enabled */
+	if (NODEPDA(hinfo->h_cnodeid)->xbow_vhdl != 0) {
 	    printk("Hub %d, cnode %d to Xtalk Link failed (II_ECRAZY) Reason: %s", 
 		hinfo->h_nasid, hinfo->h_cnodeid, reason);
 	}
@@ -299,7 +295,7 @@
 	* Wait till hub indicates it's done.
 	*/
 	while (REMOTE_HUB_L(hinfo->h_nasid, IIO_ICDR) & IIO_ICDR_PND)
-		us_delay(1);
+		udelay(1);
 
 }
 
diff -Nru a/arch/ia64/sn/io/sn2/shubio.c b/arch/ia64/sn/io/sn2/shubio.c
--- a/arch/ia64/sn/io/sn2/shubio.c	Tue Feb  3 19:45:41 2004
+++ b/arch/ia64/sn/io/sn2/shubio.c	Tue Feb  3 19:45:41 2004
@@ -1,5 +1,4 @@
-/* $Id: shubio.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $
- *
+/*
  * 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.
@@ -14,7 +13,6 @@
 #include <asm/sn/sgi.h>
 #include <asm/sn/io.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
 #include <asm/sn/sn_private.h>
@@ -160,8 +158,6 @@
 	iopaddr_t 	p;
 	caddr_t 	cp;
 
-	IOERROR_DUMP("hub_ioerror_handler", error_code, mode, ioerror);
-
 	hubinfo_get(hub_v, &hinfo);
 
 	if (!hinfo){
@@ -287,8 +283,6 @@
 			IOERROR_SETVALUE(ioerror,widgetnum,widgetnum);
 			IOERROR_SETVALUE(ioerror,xtalkaddr,xtalkaddr);
 		} else {
-			IOERROR_DUMP("hub_ioerror_handler", error_code, 
-						mode, ioerror);
 			IOERR_PRINTF(printk(
 				"hub_ioerror_handler: Invalid address passed"));
 
@@ -308,11 +302,6 @@
 			 * widget is enabled.
 			 */
 			if (!is_widget_pio_enabled(ioerror)) {
-				if (error_state_get(hub_v) == 
-				    ERROR_STATE_ACTION)
-					ioerror_dump("No outbound widget"
-						     " access - ", 
-						     error_code, mode, ioerror);
 				return(IOERROR_HANDLED);
 			}
 		  
@@ -350,11 +339,6 @@
 			 */
 
 			if (!is_widget_pio_enabled(ioerror)) {
-				if (error_state_get(hub_v) == 
-				    ERROR_STATE_ACTION)
-					ioerror_dump("No outbound widget"
-						     " access - ", 
-						     error_code, mode, ioerror);
 				return(IOERROR_HANDLED);
 			}
 		  
@@ -478,7 +462,7 @@
 error_state_set(vertex_hdl_t v,error_state_t new_state)
 {
         error_state_t   old_state;
-        boolean_t       replace = B_TRUE;
+        int       replace = 1;
 
         /* Check if we have a valid hwgraph vertex */
         if ( v == (vertex_hdl_t)0 )
@@ -497,7 +481,7 @@
          * for this vertex.
          */
         if (v_error_state_get(v,old_state) != GRAPH_SUCCESS)
-                replace = B_FALSE;
+                replace = 0;
 
         if (v_error_state_set(v,new_state,replace) != GRAPH_SUCCESS) {
                 return(ERROR_RETURN_CODE_CANNOT_SET_STATE);
diff -Nru a/arch/ia64/sn/io/sn2/xbow.c b/arch/ia64/sn/io/sn2/xbow.c
--- a/arch/ia64/sn/io/sn2/xbow.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/sn/io/sn2/xbow.c	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -7,47 +6,24 @@
  * Copyright (c) 1992-1997,2000-2003 Silicon Graphics, Inc. All rights reserved.
  */
 
-#include <linux/types.h>
 #include <linux/slab.h>
 #include <linux/module.h>
-#include <linux/sched.h>
 #include <linux/interrupt.h>
-#include <asm/sn/sgi.h>
-#include <asm/sn/intr.h>
 #include <asm/sn/sn2/sn_private.h>
-#include <asm/sn/sn2/shubio.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
-#include <asm/sn/hcl.h>
-#include <asm/sn/labelcl.h>
-#include <asm/sn/pci/bridge.h>
-#include <asm/sn/xtalk/xtalk_private.h>
 #include <asm/sn/simulator.h>
+#include <asm/sn/hcl.h>
+#include <asm/sn/hcl_util.h>
 
 /* #define DEBUG		1 */
 /* #define XBOW_DEBUG	1 */
-/* #define DEBUG_ERROR	1 */
-
-
-/*
- * Files needed to get the device driver entry points
- */
-
-#include <asm/sn/xtalk/xbow.h>
-#include <asm/sn/xtalk/xtalk.h>
-#include <asm/sn/xtalk/xswitch.h>
-#include <asm/sn/xtalk/xwidget.h>
-
-#include <asm/sn/prio.h>
-#include <asm/sn/hcl_util.h>
 
+#define kdebug 0
 
-#define NEW(ptr)	(ptr = kmalloc(sizeof (*(ptr)), GFP_KERNEL))
-#define DEL(ptr)	(kfree(ptr))
 
 /*
  * This file supports the Xbow chip.  Main functions: initializtion,
- * error handling, and GBR.
+ * error handling.
  */
 
 /*
@@ -55,7 +31,6 @@
  * has a "fastinfo" pointer pointing at one
  * of these things.
  */
-typedef struct xbow_soft_s *xbow_soft_t;
 
 struct xbow_soft_s {
     vertex_hdl_t            conn;	/* our connection point */
@@ -64,30 +39,24 @@
     xbow_t                 *base;	/* PIO pointer to crossbow chip */
     char                   *name;	/* hwgraph name */
 
-    xbow_perf_t             xbow_perfcnt[XBOW_PERF_COUNTERS];
-    xbow_perf_link_t        xbow_perflink[MAX_XBOW_PORTS];
     xbow_link_status_t      xbow_link_status[MAX_XBOW_PORTS];
-    spinlock_t              xbow_perf_lock;
-    int                     link_monitor;
     widget_cfg_t	   *wpio[MAX_XBOW_PORTS];	/* cached PIO pointer */
 
     /* Bandwidth allocation state. Bandwidth values are for the
      * destination port since contention happens there.
      * Implicit mapping from xbow ports (8..f) -> (0..7) array indices.
      */
-    spinlock_t		    xbow_bw_alloc_lock;		/* bw allocation lock */
     unsigned long long	    bw_hiwm[MAX_XBOW_PORTS];	/* hiwater mark values */
     unsigned long long      bw_cur_used[MAX_XBOW_PORTS]; /* bw used currently */
 };
 
 #define xbow_soft_set(v,i)	hwgraph_fastinfo_set((v), (arbitrary_info_t)(i))
-#define xbow_soft_get(v)	((xbow_soft_t)hwgraph_fastinfo_get((v)))
+#define xbow_soft_get(v)	((struct xbow_soft_s *)hwgraph_fastinfo_get((v)))
 
 /*
  * Function Table of Contents
  */
 
-void                    xbow_mlreset(xbow_t *);
 int                     xbow_attach(vertex_hdl_t);
 
 int                     xbow_widget_present(xbow_t *, int);
@@ -95,19 +64,6 @@
 vertex_hdl_t            xbow_widget_lookup(vertex_hdl_t, int);
 
 void                    xbow_intr_preset(void *, int, xwidgetnum_t, iopaddr_t, xtalk_intr_vector_t);
-
-
-
-void                    xbow_update_perf_counters(vertex_hdl_t);
-xbow_perf_link_t       *xbow_get_perf_counters(vertex_hdl_t);
-int                     xbow_enable_perf_counter(vertex_hdl_t, int, int, int);
-xbow_link_status_t     *xbow_get_llp_status(vertex_hdl_t);
-void                    xbow_update_llp_status(vertex_hdl_t);
-
-int                     xbow_disable_llp_monitor(vertex_hdl_t);
-int                     xbow_enable_llp_monitor(vertex_hdl_t);
-int                     xbow_prio_bw_alloc(vertex_hdl_t, xwidgetnum_t, xwidgetnum_t,
-                                unsigned long long, unsigned long long);
 static void		xbow_setwidint(xtalk_intr_t);
 
 xswitch_reset_link_f    xbow_reset_link;
@@ -122,12 +78,12 @@
 xbow_mmap(struct file * file, struct vm_area_struct * vma)
 {
         unsigned long           phys_addr;
-        int                     error = 0;
+        int                     error;
 
         phys_addr = (unsigned long)file->private_data & ~0xc000000000000000; /* Mask out the Uncache bits */
         vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
         vma->vm_flags |= VM_RESERVED | VM_IO;
-        error = io_remap_page_range(vma, phys_addr, vma->vm_start,
+        error = io_remap_page_range(vma, vma->vm_start, phys_addr,
                                    vma->vm_end-vma->vm_start,
                                    vma->vm_page_prot);
         return(error);
@@ -143,23 +99,6 @@
         .mmap		= xbow_mmap,
 };
 
-/*
- *    xbow_mlreset: called at mlreset time if the
- *      platform specific code determines that there is
- *      a crossbow in a critical path that must be
- *      functional before the driver would normally get
- *      the device properly set up.
- *
- *      what do we need to do, that the boot prom can
- *      not be counted on to have already done, that is
- *      generic across all platforms using crossbows?
- */
-/*ARGSUSED */
-void
-xbow_mlreset(xbow_t * xbow)
-{
-}
-
 #ifdef XBRIDGE_REGS_SIM
 /*    xbow_set_simulated_regs: sets xbow regs as needed
  *	for powering through the boot
@@ -201,8 +140,8 @@
     /*REFERENCED */
     vertex_hdl_t            vhdl;
     vertex_hdl_t            busv;
-    xbow_t                 *xbow;
-    xbow_soft_t             soft;
+    xbow_t                  *xbow;
+    struct xbow_soft_s      *soft;
     int                     port;
     xswitch_info_t          info;
     xtalk_intr_t            intr_hdl;
@@ -211,15 +150,14 @@
     int                     rev;
     int			    i;
     int			    xbow_num;
-    static void xbow_errintr_handler(int, void *, struct pt_regs *);
+#if DEBUG && ATTACH_DEBUG
+    char		    name[MAXDEVNAME];
+#endif
+    static irqreturn_t xbow_errintr_handler(int, void *, struct pt_regs *);
 
 	
 #if DEBUG && ATTACH_DEBUG
-#if defined(SUPPORT_PRINTING_V_FORMAT)
-    printk("%v: xbow_attach\n", conn);
-#else
-    printk("0x%x: xbow_attach\n", conn);
-#endif
+    printk("%s: xbow_attach\n", vertex_to_name(conn, name, MAXDEVNAME));
 #endif
 
     /*
@@ -229,6 +167,8 @@
 #ifdef XBRIDGE_REGS_SIM
     printk("xbow_attach: XBRIDGE_REGS_SIM FIXME: allocating %ld bytes for xbow_s\n", sizeof(xbow_t));
     xbow = (xbow_t *) kmalloc(sizeof(xbow_t), GFP_KERNEL);
+    if (!xbow)
+	    return -ENOMEM;
     /*
      * turn on ports e and f like in a real live ibrick
      */
@@ -260,7 +200,6 @@
      * Register a xbow driver with hwgraph.
      * file ops.
      */
-    vhdl = NULL;
     vhdl = hwgraph_register(conn, EDGE_LBL_XBOW, 0,
 	   0, 0, 0,
 	   S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP, 0, 0,
@@ -274,7 +213,9 @@
      * Allocate the soft state structure and attach
      * it to the xbow's vertex
      */
-    NEW(soft);
+    soft = kmalloc(sizeof(*soft), GFP_KERNEL);
+    if (!soft)
+	    return -ENOMEM;
     soft->conn = conn;
     soft->vhdl = vhdl;
     soft->busv = busv;
@@ -298,6 +239,10 @@
     s = dev_to_name(vhdl, devnm, MAXDEVNAME);
     soft->name = kmalloc(strlen(s) + strlen(XBOW_NUM_SUFFIX_FORMAT) + 1, 
 			    GFP_KERNEL);
+    if (!soft->name) {
+	    kfree(soft);
+	    return -ENOMEM;
+    }
     sprintf(soft->name,"%s"XBOW_NUM_SUFFIX_FORMAT, s,xbow_num);
 
 #ifdef XBRIDGE_REGS_SIM
@@ -311,14 +256,6 @@
 #endif /* XBRIDGE_REGS_SIM */
     rev = XWIDGET_PART_REV_NUM(id);
 
-    mutex_spinlock_init(&soft->xbow_perf_lock);
-    soft->xbow_perfcnt[0].xp_perf_reg = &xbow->xb_perf_ctr_a;
-    soft->xbow_perfcnt[1].xp_perf_reg = &xbow->xb_perf_ctr_b;
-
-    /* Initialization for GBR bw allocation */
-    mutex_spinlock_init(&soft->xbow_bw_alloc_lock);
-
-#define	XBOW_8_BIT_PORT_BW_MAX		(400 * 1000 * 1000)	/* 400 MB/s */
 #define XBOW_16_BIT_PORT_BW_MAX		(800 * 1000 * 1000)	/* 800 MB/s */
 
     /* Set bandwidth hiwatermark and current values */
@@ -419,43 +356,6 @@
     return 0;				/* attach successful */
 }
 
-/* This contains special-case code for grio. There are plans to make
- * this general sometime in the future, but till then this should
- * be good enough.
- */
-xwidgetnum_t
-xbow_widget_num_get(vertex_hdl_t dev)
-{
-	vertex_hdl_t	tdev;
-	char		devname[MAXDEVNAME];
-	xwidget_info_t	xwidget_info;
-	int		i;
-
-	vertex_to_name(dev, devname, MAXDEVNAME);
-
-	/* If this is a pci controller vertex, traverse up using
-	 * the ".." links to get to the widget.
-	 */
-	if (strstr(devname, EDGE_LBL_PCI) &&
-			strstr(devname, EDGE_LBL_CONTROLLER)) {
-		tdev = dev;
-		for (i=0; i< 2; i++) {
-			if (hwgraph_edge_get(tdev,
-				HWGRAPH_EDGELBL_DOTDOT, &tdev) !=
-					GRAPH_SUCCESS)
-				return XWIDGET_NONE;
-		}
-
-		if ((xwidget_info = xwidget_info_chk(tdev)) != NULL) {
-			return (xwidget_info_id_get(xwidget_info));
-		} else {
-			return XWIDGET_NONE;
-		}
-	}
-
-	return XWIDGET_NONE;
-}
-
 /*
  * xbow_widget_present: See if a device is present
  * on the specified port of this crossbow.
@@ -477,6 +377,10 @@
 					IS_PIC_XBOW(xbow->xb_wid_id) && port==0xf) {
 			return 1;
 		}
+		else if ( IS_PIC_XBOW(xbow->xb_wid_id) && port==0xb ) {
+			/* for opus the present bit doesn't work on port 0xb */
+			return 1;
+		}
 		return xbow->xb_link(port).link_aux_status & XB_AUX_STAT_PRESENT;
 	}
 }
@@ -562,10 +466,8 @@
 				    XEM_ADD_NVAR("ioe." #n, p);		\
 				}
 
-int                     xbow_xmit_retry_errors;
-
 int
-xbow_xmit_retry_error(xbow_soft_t soft,
+xbow_xmit_retry_error(struct xbow_soft_s *soft,
 		      int port)
 {
     xswitch_info_t          info;
@@ -600,46 +502,18 @@
     part = XWIDGET_PART_NUM(id);
     mfgr = XWIDGET_MFG_NUM(id);
 
-    /* If this thing is not a Bridge,
-     * do not activate the WAR, and
-     * tell our caller we do not need
-     * to be called again.
-     */
-    if ((part != BRIDGE_WIDGET_PART_NUM) ||
-	(mfgr != BRIDGE_WIDGET_MFGR_NUM)) {
-		/* FIXME: add Xbridge to the WAR.
-		 * Shouldn't hurt anything.  Later need to
-		 * check if we can remove this.
-                 */
-    		if ((part != XBRIDGE_WIDGET_PART_NUM) ||
-		    (mfgr != XBRIDGE_WIDGET_MFGR_NUM))
-			return 0;
-    }
-
-    /* count how many times we
-     * have picked up after
-     * LLP Transmit problems.
-     */
-    xbow_xmit_retry_errors++;
-
-    /* rewrite the control register
-     * to fix things up.
-     */
-    wid->w_control = wid->w_control;
-    wid->w_control;
-
-    return 1;
+    return 0;
 }
 
 /*
  * xbow_errintr_handler will be called if the xbow
  * sends an interrupt request to report an error.
  */
-static void
+static irqreturn_t
 xbow_errintr_handler(int irq, void *arg, struct pt_regs *ep)
 {
     ioerror_t               ioe[1];
-    xbow_soft_t             soft = (xbow_soft_t) arg;
+    struct xbow_soft_s     *soft = (struct xbow_soft_s *)arg;
     xbow_t                 *xbow = soft->base;
     xbowreg_t               wid_control;
     xbowreg_t               wid_stat;
@@ -805,8 +679,9 @@
 	XEM_ADD_VAR(wid_err_upper);
 	XEM_ADD_VAR(wid_err_lower);
 	XEM_ADD_VAR(wid_err_addr);
-	PRINT_PANIC("XIO Bus Error");
+	panic("XIO Bus Error");
     }
+    return IRQ_HANDLED;
 }
 
 /*
@@ -831,10 +706,10 @@
 		      ioerror_mode_t mode,
 		      ioerror_t *ioerror)
 {
-    int                     retval = IOERROR_WIDGETLEVEL;
+    int                    retval = IOERROR_WIDGETLEVEL;
 
-    xbow_soft_t             soft = (xbow_soft_t) einfo;
-    int                     port;
+    struct xbow_soft_s    *soft = (struct xbow_soft_s *) einfo;
+    int                   port;
     vertex_hdl_t          conn;
     vertex_hdl_t          busv;
 
@@ -958,8 +833,9 @@
     if (XBOW_WAR_ENABLED(PV854827, xbow->xb_wid_id) &&
 		IS_PIC_XBOW(xbow->xb_wid_id) && (port==0xf))
 		;
-    else
-    if (!(link_aux_status & XB_AUX_STAT_PRESENT)) {
+    else if (IS_PIC_XBOW(xbow->xb_wid_id) && (port==0xb))
+		;	/* WAR for opus this is missing on 0xb */
+    else if (!(link_aux_status & XB_AUX_STAT_PRESENT)) {
 	/* nobody connected. */
 	if (mode == MODE_DEVPROBE)
 	    return IOERROR_HANDLED;
@@ -1087,173 +963,6 @@
     return retval;
 }
 
-void
-xbow_update_perf_counters(vertex_hdl_t vhdl)
-{
-    xbow_soft_t             xbow_soft = xbow_soft_get(vhdl);
-    xbow_perf_t            *xbow_perf = xbow_soft->xbow_perfcnt;
-    xbow_perf_link_t       *xbow_plink = xbow_soft->xbow_perflink;
-    xbow_perfcount_t        perf_reg;
-    unsigned long           s;
-    int                     link, i;
-
-    for (i = 0; i < XBOW_PERF_COUNTERS; i++, xbow_perf++) {
-	if (xbow_perf->xp_mode == XBOW_MONITOR_NONE)
-	    continue;
-
-	s = mutex_spinlock(&xbow_soft->xbow_perf_lock);
-
-	perf_reg.xb_counter_val = *(xbowreg_t *) xbow_perf->xp_perf_reg;
-
-	link = perf_reg.xb_perf.link_select;
-
-	(xbow_plink + link)->xlp_cumulative[xbow_perf->xp_curmode] +=
-	    ((perf_reg.xb_perf.count - xbow_perf->xp_current) & XBOW_COUNTER_MASK);
-	xbow_perf->xp_current = perf_reg.xb_perf.count;
-
-	mutex_spinunlock(&xbow_soft->xbow_perf_lock, s);
-    }
-}
-
-xbow_perf_link_t       *
-xbow_get_perf_counters(vertex_hdl_t vhdl)
-{
-    xbow_soft_t             xbow_soft = xbow_soft_get(vhdl);
-    xbow_perf_link_t       *xbow_perf_link = xbow_soft->xbow_perflink;
-
-    return xbow_perf_link;
-}
-
-int
-xbow_enable_perf_counter(vertex_hdl_t vhdl, int link, int mode, int counter)
-{
-    xbow_soft_t             xbow_soft = xbow_soft_get(vhdl);
-    xbow_perf_t            *xbow_perf = xbow_soft->xbow_perfcnt;
-    xbow_linkctrl_t         xbow_link_ctrl;
-    xbow_t                 *xbow = xbow_soft->base;
-    xbow_perfcount_t        perf_reg;
-    unsigned long           s;
-    int                     i;
-
-    link -= BASE_XBOW_PORT;
-    if ((link < 0) || (link >= MAX_XBOW_PORTS))
-	return -1;
-
-    if ((mode < XBOW_MONITOR_NONE) || (mode > XBOW_MONITOR_DEST_LINK))
-	return -1;
-
-    if ((counter < 0) || (counter >= XBOW_PERF_COUNTERS))
-	return -1;
-
-    s = mutex_spinlock(&xbow_soft->xbow_perf_lock);
-
-    if ((xbow_perf + counter)->xp_mode && mode) {
-	mutex_spinunlock(&xbow_soft->xbow_perf_lock, s);
-	return -1;
-    }
-    for (i = 0; i < XBOW_PERF_COUNTERS; i++) {
-	if (i == counter)
-	    continue;
-	if (((xbow_perf + i)->xp_link == link) &&
-	    ((xbow_perf + i)->xp_mode)) {
-	    mutex_spinunlock(&xbow_soft->xbow_perf_lock, s);
-	    return -1;
-	}
-    }
-    xbow_perf += counter;
-
-    xbow_perf->xp_curlink = xbow_perf->xp_link = link;
-    xbow_perf->xp_curmode = xbow_perf->xp_mode = mode;
-
-    xbow_link_ctrl.xbl_ctrlword = xbow->xb_link_raw[link].link_control;
-    xbow_link_ctrl.xb_linkcontrol.perf_mode = mode;
-    xbow->xb_link_raw[link].link_control = xbow_link_ctrl.xbl_ctrlword;
-
-    perf_reg.xb_counter_val = *(xbowreg_t *) xbow_perf->xp_perf_reg;
-    perf_reg.xb_perf.link_select = link;
-    *(xbowreg_t *) xbow_perf->xp_perf_reg = perf_reg.xb_counter_val;
-    xbow_perf->xp_current = perf_reg.xb_perf.count;
-
-    mutex_spinunlock(&xbow_soft->xbow_perf_lock, s);
-    return 0;
-}
-
-xbow_link_status_t     *
-xbow_get_llp_status(vertex_hdl_t vhdl)
-{
-    xbow_soft_t             xbow_soft = xbow_soft_get(vhdl);
-    xbow_link_status_t     *xbow_llp_status = xbow_soft->xbow_link_status;
-
-    return xbow_llp_status;
-}
-
-void
-xbow_update_llp_status(vertex_hdl_t vhdl)
-{
-    xbow_soft_t             xbow_soft = xbow_soft_get(vhdl);
-    xbow_link_status_t     *xbow_llp_status = xbow_soft->xbow_link_status;
-    xbow_t                 *xbow;
-    xbwX_stat_t             lnk_sts;
-    xbow_aux_link_status_t  aux_sts;
-    int                     link;
-    vertex_hdl_t	    xwidget_vhdl;
-    char		   *xwidget_name;	
-
-    xbow = (xbow_t *) xbow_soft->base;
-    for (link = 0; link < MAX_XBOW_PORTS; link++, xbow_llp_status++) {
-	/* Get the widget name corresponding the current link.
-	 * Note : 0 <= link < MAX_XBOW_PORTS(8).
-	 * 	  BASE_XBOW_PORT(0x8) <= xwidget number < MAX_PORT_NUM (0x10)
-	 */
-	xwidget_vhdl = xbow_widget_lookup(xbow_soft->busv,link+BASE_XBOW_PORT);
-	xwidget_name = xwidget_name_get(xwidget_vhdl);
-	aux_sts.aux_linkstatus
-	    = xbow->xb_link_raw[link].link_aux_status;
-	lnk_sts.linkstatus = xbow->xb_link_raw[link].link_status_clr;
-
-	if (lnk_sts.link_alive == 0)
-	    continue;
-
-	xbow_llp_status->rx_err_count +=
-	    aux_sts.xb_aux_linkstatus.rx_err_cnt;
-
-	xbow_llp_status->tx_retry_count +=
-	    aux_sts.xb_aux_linkstatus.tx_retry_cnt;
-
-	if (lnk_sts.linkstatus & ~(XB_STAT_RCV_ERR | XB_STAT_XMT_RTRY_ERR | XB_STAT_LINKALIVE)) {
-#ifdef	LATER
-	    printk(KERN_WARNING  "link %d[%s]: bad status 0x%x\n",
-		    link, xwidget_name, lnk_sts.linkstatus);
-#endif
-	}
-    }
-}
-
-int
-xbow_disable_llp_monitor(vertex_hdl_t vhdl)
-{
-    xbow_soft_t             xbow_soft = xbow_soft_get(vhdl);
-    int                     port;
-
-    for (port = 0; port < MAX_XBOW_PORTS; port++) {
-	xbow_soft->xbow_link_status[port].rx_err_count = 0;
-	xbow_soft->xbow_link_status[port].tx_retry_count = 0;
-    }
-
-    xbow_soft->link_monitor = 0;
-    return 0;
-}
-
-int
-xbow_enable_llp_monitor(vertex_hdl_t vhdl)
-{
-    xbow_soft_t             xbow_soft = xbow_soft_get(vhdl);
-
-    xbow_soft->link_monitor = 1;
-    return 0;
-}
-
-
 int
 xbow_reset_link(vertex_hdl_t xconn_vhdl)
 {
@@ -1262,15 +971,10 @@
     xbow_t                 *xbow;
     xbowreg_t               ctrl;
     xbwX_stat_t             stat;
-    unsigned                itick;
-    unsigned                dtick;
-    static int              ticks_per_ms = 0;
-
-    if (!ticks_per_ms) {
-	itick = get_timestamp();
-	us_delay(1000);
-	ticks_per_ms = get_timestamp() - itick;
-    }
+    unsigned                long itick;
+    unsigned int            dtick;
+    static long             ticks_to_wait = HZ / 1000;
+
     widget_info = xwidget_info_get(xconn_vhdl);
     port = xwidget_info_id_get(widget_info);
 
@@ -1279,7 +983,7 @@
 #else
     {
 	vertex_hdl_t            xbow_vhdl;
-	xbow_soft_t             xbow_soft;
+	struct xbow_soft_s      *xbow_soft;
 
 	hwgraph_traverse(xconn_vhdl, ".master/xtalk/0/xbow", &xbow_vhdl);
 	xbow_soft = xbow_soft_get(xbow_vhdl);
@@ -1296,155 +1000,17 @@
      */
     ctrl = xbow->xb_link(port).link_control;
     xbow->xb_link(port).link_reset = 0;
-    itick = get_timestamp();
+    itick = jiffies;
     while (1) {
 	stat.linkstatus = xbow->xb_link(port).link_status;
 	if (stat.link_alive)
 	    break;
-	dtick = get_timestamp() - itick;
-	if (dtick > ticks_per_ms) {
+	dtick = jiffies - itick;
+	if (dtick > ticks_to_wait) {
 	    return -1;			/* never came out of reset */
 	}
-	DELAY(2);			/* don't beat on link_status */
+	udelay(2);			/* don't beat on link_status */
     }
     xbow->xb_link(port).link_control = ctrl;
     return 0;
-}
-
-#define XBOW_ARB_RELOAD_TICKS		25
-					/* granularity: 4 MB/s, max: 124 MB/s */
-#define GRANULARITY			((100 * 1000000) / XBOW_ARB_RELOAD_TICKS)
-
-#define XBOW_BYTES_TO_GBR(BYTES_per_s)	(int) (BYTES_per_s / GRANULARITY)
-
-#define XBOW_GBR_TO_BYTES(cnt)		(bandwidth_t) ((cnt) * GRANULARITY)
-
-#define CEILING_BYTES_TO_GBR(gbr, bytes_per_sec)	\
-			((XBOW_GBR_TO_BYTES(gbr) < bytes_per_sec) ? gbr+1 : gbr)
-
-#define XBOW_ARB_GBR_MAX		31
-
-#define ABS(x)				((x > 0) ? (x) : (-1 * x))
-					/* absolute value */
-
-int
-xbow_bytes_to_gbr(bandwidth_t old_bytes_per_sec, bandwidth_t bytes_per_sec)
-{
-    int                     gbr_granted;
-    int                     new_total_gbr;
-    int                     change_gbr;
-    bandwidth_t             new_total_bw;
-
-#ifdef GRIO_DEBUG
-    printk("xbow_bytes_to_gbr: old_bytes_per_sec %lld bytes_per_sec %lld\n",
-		old_bytes_per_sec, bytes_per_sec);
-#endif	/* GRIO_DEBUG */
-
-    gbr_granted = CEILING_BYTES_TO_GBR((XBOW_BYTES_TO_GBR(old_bytes_per_sec)),
-			old_bytes_per_sec);
-    new_total_bw = old_bytes_per_sec + bytes_per_sec;
-    new_total_gbr = CEILING_BYTES_TO_GBR((XBOW_BYTES_TO_GBR(new_total_bw)),
-			new_total_bw);
-
-    change_gbr = new_total_gbr - gbr_granted;
-
-#ifdef GRIO_DEBUG
-    printk("xbow_bytes_to_gbr: gbr_granted %d new_total_gbr %d change_gbr %d\n",
-		gbr_granted, new_total_gbr, change_gbr);
-#endif	/* GRIO_DEBUG */
-
-    return (change_gbr);
-}
-
-/* Conversion from GBR to bytes */
-bandwidth_t
-xbow_gbr_to_bytes(int gbr)
-{
-    return (XBOW_GBR_TO_BYTES(gbr));
-}
-
-/* Given the vhdl for the desired xbow, the src and dest. widget ids
- * and the req_bw value, this xbow driver entry point accesses the
- * xbow registers and allocates the desired bandwidth if available.
- *
- * If bandwidth allocation is successful, return success else return failure.
- */
-int
-xbow_prio_bw_alloc(vertex_hdl_t vhdl,
-		xwidgetnum_t src_wid,
-		xwidgetnum_t dest_wid,
-		unsigned long long old_alloc_bw,
-		unsigned long long req_bw)
-{
-    xbow_soft_t             soft = xbow_soft_get(vhdl);
-    volatile xbowreg_t     *xreg;
-    xbowreg_t               mask;
-    unsigned long           s;
-    int                     error = 0;
-    bandwidth_t             old_bw_BYTES, req_bw_BYTES;
-    xbowreg_t               old_xreg;
-    int                     old_bw_GBR, req_bw_GBR, new_bw_GBR;
-
-#ifdef GRIO_DEBUG
-    printk("xbow_prio_bw_alloc: vhdl %d src_wid %d dest_wid %d req_bw %lld\n",
-		(int) vhdl, (int) src_wid, (int) dest_wid, req_bw);
-#endif
-
-    ASSERT(XBOW_WIDGET_IS_VALID(src_wid));
-    ASSERT(XBOW_WIDGET_IS_VALID(dest_wid));
-
-    s = mutex_spinlock(&soft->xbow_bw_alloc_lock);
-
-    /* Get pointer to the correct register */
-    xreg = XBOW_PRIO_ARBREG_PTR(soft->base, dest_wid, src_wid);
-
-    /* Get mask for GBR count value */
-    mask = XB_ARB_GBR_MSK << XB_ARB_GBR_SHFT(src_wid);
-
-    req_bw_GBR = xbow_bytes_to_gbr(old_alloc_bw, req_bw);
-    req_bw_BYTES = (req_bw_GBR < 0) ? (-1 * xbow_gbr_to_bytes(ABS(req_bw_GBR)))
-		: xbow_gbr_to_bytes(req_bw_GBR);
-
-#ifdef GRIO_DEBUG
-    printk("req_bw %lld req_bw_BYTES %lld req_bw_GBR %d\n",
-		req_bw, req_bw_BYTES, req_bw_GBR);
-#endif	/* GRIO_DEBUG */
-
-    old_bw_BYTES = soft->bw_cur_used[(int) dest_wid - MAX_XBOW_PORTS];
-    old_xreg = *xreg;
-    old_bw_GBR = (((*xreg) & mask) >> XB_ARB_GBR_SHFT(src_wid));
-
-#ifdef GRIO_DEBUG
-    ASSERT(XBOW_BYTES_TO_GBR(old_bw_BYTES) == old_bw_GBR);
-
-    printk("old_bw_BYTES %lld old_bw_GBR %d\n", old_bw_BYTES, old_bw_GBR);
-
-    printk("req_bw_BYTES %lld old_bw_BYTES %lld soft->bw_hiwm %lld\n",
-		req_bw_BYTES, old_bw_BYTES,
-		soft->bw_hiwm[(int) dest_wid - MAX_XBOW_PORTS]);
-	   
-#endif				/* GRIO_DEBUG */
-
-    /* Accept the request only if we don't exceed the destination
-     * port HIWATER_MARK *AND* the max. link GBR arbitration count
-     */
-    if (((old_bw_BYTES + req_bw_BYTES) <=
-		soft->bw_hiwm[(int) dest_wid - MAX_XBOW_PORTS]) &&
-		(req_bw_GBR + old_bw_GBR <= XBOW_ARB_GBR_MAX)) {
-
-	new_bw_GBR = (old_bw_GBR + req_bw_GBR);
-
-	/* Set this in the xbow link register */
-	*xreg = (old_xreg & ~mask) | \
-	    (new_bw_GBR << XB_ARB_GBR_SHFT(src_wid) & mask);
-
-	soft->bw_cur_used[(int) dest_wid - MAX_XBOW_PORTS] =
-			xbow_gbr_to_bytes(new_bw_GBR);
-    } else {
-	error = 1;
-    }
-
-    mutex_spinunlock(&soft->xbow_bw_alloc_lock, s);
-
-    return (error);
 }
diff -Nru a/arch/ia64/sn/io/sn2/xtalk.c b/arch/ia64/sn/io/sn2/xtalk.c
--- a/arch/ia64/sn/io/sn2/xtalk.c	Tue Feb  3 19:45:16 2004
+++ b/arch/ia64/sn/io/sn2/xtalk.c	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -13,7 +12,6 @@
 #include <asm/sn/driver.h>
 #include <asm/sn/io.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
 #include <asm/sn/hcl_util.h>
@@ -23,9 +21,9 @@
 #include <asm/sn/xtalk/xtalk_private.h>
 
 /*
- * Implement crosstalk provider operations.  The xtalk* layer provides a
- * platform-independent interface for crosstalk devices.  This layer
- * switches among the possible implementations of a crosstalk adapter.
+ * Implement io channel provider operations.  The xtalk* layer provides a
+ * platform-independent interface for io channel devices.  This layer
+ * switches among the possible implementations of a io channel adapter.
  *
  * On platforms with only one possible xtalk provider, macros can be
  * set up at the top that cause the table lookups and indirections to
@@ -37,11 +35,6 @@
 
 char                    widget_info_fingerprint[] = "widget_info";
 
-#define	DEV_FUNC(dev,func)	hub_##func
-#define	CAST_PIOMAP(x)		((hub_piomap_t)(x))
-#define	CAST_DMAMAP(x)		((hub_dmamap_t)(x))
-#define	CAST_INTR(x)		((hub_intr_t)(x))
-
 /* =====================================================================
  *            Function Table of Contents
  */
@@ -71,7 +64,6 @@
 void                    xtalk_intr_disconnect(xtalk_intr_t);
 vertex_hdl_t            xtalk_intr_cpu_get(xtalk_intr_t);
 int                     xtalk_error_handler(vertex_hdl_t, int, ioerror_mode_t, ioerror_t *);
-int                     xtalk_error_devenable(vertex_hdl_t, int, int);
 void                    xtalk_provider_startup(vertex_hdl_t);
 void                    xtalk_provider_shutdown(vertex_hdl_t);
 vertex_hdl_t            xtalk_intr_dev_get(xtalk_intr_t);
@@ -121,6 +113,7 @@
 #define	CAST_PIOMAP(x)		((xtalk_piomap_t)(x))
 #define	CAST_DMAMAP(x)		((xtalk_dmamap_t)(x))
 #define	CAST_INTR(x)		((xtalk_intr_t)(x))
+xtalk_provider_t * xwidget_info_pops_get(xwidget_info_t info);
 
 static xtalk_provider_t *
 xwidget_to_provider_fns(vertex_hdl_t xconn)
@@ -136,6 +129,17 @@
 
     return (provider_fns);
 }
+
+xtalk_provider_t *
+xwidget_info_pops_get(xwidget_info_t info) {
+	vertex_hdl_t master = info->w_master;
+	xtalk_provider_t *provider_fns;
+
+	provider_fns = xtalk_provider_fns_get(master);
+
+	ASSERT(provider_fns != NULL);
+	return provider_fns;
+}
 #endif
 
 /*
@@ -273,13 +277,13 @@
 }
 
 /* xtalk_early_piotrans_addr:
- * figure out a PIO address for the "nth" crosstalk widget that
+ * figure out a PIO address for the "nth" io channel widget that
  * matches the specified part and mfgr number. Returns NULL if
  * there is no such widget, or if the requested mapping can not
  * be constructed.
- * Limitations on which crosstalk slots (and busses) are
+ * Limitations on which io channel slots (and busses) are
  * checked, and definitions of the ordering of the search across
- * the crosstalk slots, are defined by the platform.
+ * the io channel slots, are defined by the platform.
  */
 caddr_t
 xtalk_early_piotrans_addr(xwidget_part_num_t part_num,
@@ -310,7 +314,7 @@
 			       unsigned flags)
 {
 #if DEBUG
-    PRINT_PANIC("null_xtalk_early_piotrans_addr");
+    panic("null_xtalk_early_piotrans_addr");
 #endif
     return NULL;
 }
@@ -318,7 +322,7 @@
 /* =====================================================================
  *                    DMA MANAGEMENT
  *
- *      For mapping from crosstalk space to system
+ *      For mapping from io channel space to system
  *      physical space.
  */
 
@@ -415,7 +419,7 @@
 /* =====================================================================
  *                    INTERRUPT MANAGEMENT
  *
- *      Allow crosstalk devices to establish interrupts
+ *      Allow io channel devices to establish interrupts
  */
 
 /*
@@ -510,8 +514,8 @@
  * This routine plays two roles during error delivery
  * to most widgets: first, the external agent (heart,
  * hub, or whatever) calls in with the error and the
- * connect point representing the crosstalk switch,
- * or whatever crosstalk device is directly connected
+ * connect point representing the io channel switch,
+ * or whatever io channel device is directly connected
  * to the agent.
  *
  * If there is a switch, it will generally look at the
@@ -528,6 +532,8 @@
 		       ioerror_t *ioerror)
 {
     xwidget_info_t          xwidget_info;
+    char		    name[MAXDEVNAME];
+
 
     xwidget_info = xwidget_info_get(xconn);
     /* Make sure that xwidget_info is a valid pointer before derefencing it.
@@ -548,46 +554,33 @@
 	(mode == MODE_DEVREENABLE))
 	return IOERROR_HANDLED;
 
-#if defined(SUPPORT_PRINTING_V_FORMAT)
-    printk(KERN_WARNING "Xbow at %v encountered Fatal error", xconn);
-#else
-    printk(KERN_WARNING "Xbow at 0x%p encountered Fatal error", (void *)xconn);
-#endif
-    ioerror_dump("xtalk", error_code, mode, ioerror);
+    printk(KERN_WARNING "Xbow at %s encountered Fatal error", vertex_to_name(xconn, name, MAXDEVNAME));
 
     return IOERROR_UNHANDLED;
 }
 
-int
-xtalk_error_devenable(vertex_hdl_t xconn_vhdl, int devnum, int error_code)
-{
-    return DEV_FUNC(xconn_vhdl, error_devenable) (xconn_vhdl, devnum, error_code);
-}
-
 
 /* =====================================================================
  *                    CONFIGURATION MANAGEMENT
  */
 
 /*
- * Startup a crosstalk provider
+ * Startup an io channel provider
  */
 void
 xtalk_provider_startup(vertex_hdl_t xtalk_provider)
 {
-    DEV_FUNC(xtalk_provider, provider_startup)
-	(xtalk_provider);
+    ((xtalk_provider_t *) hwgraph_fastinfo_get(xtalk_provider))->provider_startup(xtalk_provider);
 }
 
 
 /*
- * Shutdown a crosstalk provider
+ * Shutdown an io channel provider
  */
 void
 xtalk_provider_shutdown(vertex_hdl_t xtalk_provider)
 {
-    DEV_FUNC(xtalk_provider, provider_shutdown)
-	(xtalk_provider);
+    ((xtalk_provider_t *) hwgraph_fastinfo_get(xtalk_provider))->provider_shutdown(xtalk_provider);
 }
 
 /* 
@@ -608,17 +601,12 @@
 	return;
 }
 
-int
-xtalk_dma_enabled(vertex_hdl_t xconn_vhdl)
-{
-    return DEV_FUNC(xconn_vhdl, dma_enabled) (xconn_vhdl);
-}
 /*
- * Generic crosstalk functions, for use with all crosstalk providers
- * and all crosstalk devices.
+ * Generic io channel functions, for use with all io channel providers
+ * and all io channel devices.
  */
 
-/****** Generic crosstalk interrupt interfaces ******/
+/* Generic io channel interrupt interfaces */
 vertex_hdl_t
 xtalk_intr_dev_get(xtalk_intr_t xtalk_intr)
 {
@@ -649,7 +637,7 @@
     return (xtalk_intr->xi_sfarg);
 }
 
-/****** Generic crosstalk pio interfaces ******/
+/* Generic io channel pio interfaces */
 vertex_hdl_t
 xtalk_pio_dev_get(xtalk_piomap_t xtalk_piomap)
 {
@@ -681,7 +669,7 @@
 }
 
 
-/****** Generic crosstalk dma interfaces ******/
+/* Generic io channel dma interfaces */
 vertex_hdl_t
 xtalk_dma_dev_get(xtalk_dmamap_t xtalk_dmamap)
 {
@@ -695,7 +683,7 @@
 }
 
 
-/****** Generic crosstalk widget information interfaces ******/
+/* Generic io channel widget information interfaces */
 
 /* xwidget_info_chk:
  * check to see if this vertex is a widget;
@@ -797,7 +785,7 @@
 	panic("xwidget_info_name_get: null xwidget_info");
     return(xwidget_info->w_name);
 }
-/****** Generic crosstalk initialization interfaces ******/
+/* Generic io channel initialization interfaces */
 
 /*
  * Associate a set of xtalk_provider functions with a vertex.
@@ -912,16 +900,11 @@
     if (!(widget_info = xwidget_info_get(widget)))
 	return(1);
 
-    /* Remove the inventory information associated
-     * with the widget.
-     */
-    hwgraph_inventory_remove(widget, -1, -1, -1, -1, -1);
-    
     hwid = &(widget_info->w_hwid);
 
     /* Clean out the xwidget information */
     (void)kfree(widget_info->w_name);
-    BZERO((void *)widget_info, sizeof(widget_info));
+    memset((void *)widget_info, 0, sizeof(widget_info));
     DEL(widget_info);
     
     return(0);
diff -Nru a/arch/ia64/sn/io/snia_if.c b/arch/ia64/sn/io/snia_if.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/ia64/sn/io/snia_if.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,108 @@
+/*
+ * 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) 2003 Silicon Graphics, Inc. All rights reserved.
+ */
+
+#include <asm/sn/sgi.h>
+#include <asm/sn/sn_sal.h>
+#include <asm/sn/pci/pci_bus_cvlink.h>
+#include <asm/sn/simulator.h>
+
+extern pciio_provider_t *pciio_to_provider_fns(vertex_hdl_t dev);
+
+int
+snia_badaddr_val(volatile void *addr, int len, volatile void *ptr)
+{
+	int ret = 0;
+	volatile void *new_addr;
+
+	switch (len) {
+	case 4:
+		new_addr = (void *) addr;
+		ret = ia64_sn_probe_io_slot((long) new_addr, len, (void *) ptr);
+		break;
+	default:
+		printk(KERN_WARNING
+		       "snia_badaddr_val given len %x but supports len of 4 only\n",
+		       len);
+	}
+
+	if (ret < 0)
+		panic("snia_badaddr_val: unexpected status (%d) in probing",
+		      ret);
+	return (ret);
+
+}
+
+nasid_t
+snia_get_console_nasid(void)
+{
+	extern nasid_t console_nasid;
+	extern nasid_t master_baseio_nasid;
+
+	if (console_nasid < 0) {
+		console_nasid = ia64_sn_get_console_nasid();
+		if (console_nasid < 0) {
+// ZZZ What do we do if we don't get a console nasid on the hardware????
+			if (IS_RUNNING_ON_SIMULATOR())
+				console_nasid = master_baseio_nasid;
+		}
+	}
+	return console_nasid;
+}
+
+nasid_t
+snia_get_master_baseio_nasid(void)
+{
+	extern nasid_t master_baseio_nasid;
+	extern char master_baseio_wid;
+
+	if (master_baseio_nasid < 0) {
+		master_baseio_nasid = ia64_sn_get_master_baseio_nasid();
+
+		if (master_baseio_nasid >= 0) {
+			master_baseio_wid =
+			    WIDGETID_GET(KL_CONFIG_CH_CONS_INFO
+					 (master_baseio_nasid)->memory_base);
+		}
+	}
+	return master_baseio_nasid;
+}
+
+/*
+ * XXX: should probably be called __sn2_pci_rrb_alloc
+ * used by qla1280
+ */
+
+int
+snia_pcibr_rrb_alloc(struct pci_dev *pci_dev,
+		     int *count_vchan0, int *count_vchan1)
+{
+	vertex_hdl_t dev = PCIDEV_VERTEX(pci_dev);
+
+	return pcibr_rrb_alloc(dev, count_vchan0, count_vchan1);
+}
+
+/* 
+ * XXX: interface should be more like
+ *
+ *     int __sn2_pci_enable_bwswap(struct pci_dev *dev);
+ *     void __sn2_pci_disable_bswap(struct pci_dev *dev);
+ */
+/* used by ioc4 ide */
+
+pciio_endian_t
+snia_pciio_endian_set(struct pci_dev * pci_dev,
+		      pciio_endian_t device_end, pciio_endian_t desired_end)
+{
+	vertex_hdl_t dev = PCIDEV_VERTEX(pci_dev);
+
+	return ((pciio_to_provider_fns(dev))->endian_set)
+		(dev, device_end, desired_end);
+}
+
+EXPORT_SYMBOL(snia_pciio_endian_set);
+EXPORT_SYMBOL(snia_pcibr_rrb_alloc);
diff -Nru a/arch/ia64/sn/io/xswitch.c b/arch/ia64/sn/io/xswitch.c
--- a/arch/ia64/sn/io/xswitch.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/sn/io/xswitch.c	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -12,7 +11,6 @@
 #include <asm/sn/sgi.h>
 #include <asm/sn/driver.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
 #include <asm/sn/xtalk/xtalk.h>
@@ -65,7 +63,7 @@
     if (port > XSWITCH_CENSUS_PORT_MAX)
 	return;
 
-    xswitch_info->vhdl[port] = xwidget;
+    xswitch_info->vhdl[(int)port] = xwidget;
 }
 
 vertex_hdl_t
@@ -75,7 +73,7 @@
     if (port > XSWITCH_CENSUS_PORT_MAX)
 	return GRAPH_VERTEX_NONE;
 
-    return xswitch_info->vhdl[port];
+    return xswitch_info->vhdl[(int)port];
 }
 
 /*
@@ -91,7 +89,7 @@
     if (port > XSWITCH_CENSUS_PORT_MAX)
 	return;
 
-    xswitch_info->master_vhdl[port] = master_vhdl;
+    xswitch_info->master_vhdl[(int)port] = master_vhdl;
 }
 
 vertex_hdl_t
@@ -101,7 +99,7 @@
     if (port > XSWITCH_CENSUS_PORT_MAX)
 	return GRAPH_VERTEX_NONE;
 
-    return xswitch_info->master_vhdl[port];
+    return xswitch_info->master_vhdl[(int)port];
 }
 
 void
diff -Nru a/arch/ia64/sn/kernel/Makefile b/arch/ia64/sn/kernel/Makefile
--- a/arch/ia64/sn/kernel/Makefile	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/sn/kernel/Makefile	Tue Feb  3 19:45:17 2004
@@ -7,7 +7,5 @@
 # Copyright (C) 1999,2001-2003 Silicon Graphics, Inc.  All Rights Reserved.
 #
 
-EXTRA_CFLAGS := -DLITTLE_ENDIAN
-
 obj-y				+= probe.o setup.o bte.o irq.o mca.o idle.o sn2/
 obj-$(CONFIG_IA64_GENERIC)      += machvec.o
diff -Nru a/arch/ia64/sn/kernel/bte.c b/arch/ia64/sn/kernel/bte.c
--- a/arch/ia64/sn/kernel/bte.c	Tue Feb  3 19:45:28 2004
+++ b/arch/ia64/sn/kernel/bte.c	Tue Feb  3 19:45:28 2004
@@ -1,35 +1,9 @@
 /*
- *
+ * 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) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of version 2 of the GNU General Public License 
- * as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it would be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
- * 
- * Further, this software is distributed without any warranty that it is 
- * free of the rightful claim of any third person regarding infringement 
- * or the like.  Any license provided herein, whether implied or 
- * otherwise, applies only to this software file.  Patent licenses, if 
- * any, provided herein do not apply to combinations of this program with 
- * other software, or any other product whatsoever.
- * 
- * You should have received a copy of the GNU General Public 
- * License along with this program; if not, write the Free Software 
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- * 
- * Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 
- * Mountain View, CA  94043, or:
- * 
- * http://www.sgi.com 
- * 
- * For further information regarding this notice, see: 
- * 
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan
  */
 
 #include <linux/config.h>
diff -Nru a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
--- a/arch/ia64/sn/kernel/irq.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/sn/kernel/irq.c	Tue Feb  3 19:45:17 2004
@@ -1,35 +1,11 @@
 /*
  * Platform dependent support for SGI SN
  *
+ * 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) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of version 2 of the GNU General Public License 
- * as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it would be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
- * 
- * Further, this software is distributed without any warranty that it is 
- * free of the rightful claim of any third person regarding infringement 
- * or the like.  Any license provided herein, whether implied or 
- * otherwise, applies only to this software file.  Patent licenses, if 
- * any, provided herein do not apply to combinations of this program with 
- * other software, or any other product whatsoever.
- * 
- * You should have received a copy of the GNU General Public 
- * License along with this program; if not, write the Free Software 
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- * 
- * Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 
- * Mountain View, CA  94043, or:
- * 
- * http://www.sgi.com 
- * 
- * For further information regarding this notice, see: 
- * 
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan
  */
 
 #include <linux/init.h>
@@ -42,10 +18,8 @@
 #include <asm/pgtable.h>
 #include <asm/sn/sgi.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/types.h>
-#include <asm/sn/pci/bridge.h>
 #include <asm/sn/pci/pciio.h>
 #include <asm/sn/pci/pciio_private.h>
 #include <asm/sn/pci/pcibr.h>
@@ -62,11 +36,12 @@
 #include <asm/bitops.h>
 #include <asm/sn/sn2/shub_mmr.h>
 
-int irq_to_bit_pos(int irq);
 static void force_interrupt(int irq);
 extern void pcibr_force_interrupt(pcibr_intr_t intr);
 extern int sn_force_interrupt_flag;
 
+static pcibr_intr_list_t *pcibr_intr_list;
+
 
 
 static unsigned int
@@ -139,8 +114,32 @@
 }
 
 static void
-sn_set_affinity_irq(unsigned int irq, unsigned long mask)
+sn_set_affinity_irq(unsigned int irq, cpumask_t mask)
 {
+#if CONFIG_SMP  
+        int redir = 0;
+        pcibr_intr_list_t p = pcibr_intr_list[irq];
+        pcibr_intr_t intr; 
+	int	cpu;
+        extern void sn_shub_redirect_intr(pcibr_intr_t intr, unsigned long cpu);
+        extern void sn_tio_redirect_intr(pcibr_intr_t intr, unsigned long cpu);
+                
+	if (p == NULL)
+		return; 
+        
+	intr = p->il_intr;
+
+	if (intr == NULL)
+		return; 
+
+	cpu = first_cpu(mask);
+	if (IS_PIC_SOFT(intr->bi_soft) ) {
+		sn_shub_redirect_intr(intr, cpu);
+	} else { 
+		return; 
+	}
+	(void) set_irq_affinity_info(irq, cpu_physical_id(intr->bi_cpu), redir);
+#endif /* CONFIG_SMP */
 }
 
 
@@ -187,41 +186,18 @@
 	}
 }
 
-int
-bit_pos_to_irq(int bit) {
-#define BIT_TO_IRQ 64
-	if (bit > 118) bit = 118;
-
-        return bit + BIT_TO_IRQ;
-}
-
-int
-irq_to_bit_pos(int irq) {
-#define IRQ_TO_BIT 64
-	int bit = irq - IRQ_TO_BIT;
-
-        return bit;
-}
-
-struct pcibr_intr_list_t {
-	struct pcibr_intr_list_t *next;
-	pcibr_intr_t intr;
-};
-
-static struct pcibr_intr_list_t **pcibr_intr_list;
-
 void
 register_pcibr_intr(int irq, pcibr_intr_t intr) {
-	struct pcibr_intr_list_t *p = kmalloc(sizeof(struct pcibr_intr_list_t), GFP_KERNEL);
-	struct pcibr_intr_list_t *list;
+	pcibr_intr_list_t p = kmalloc(sizeof(struct pcibr_intr_list_s), GFP_KERNEL);
+	pcibr_intr_list_t list;
 	int cpu = SN_CPU_FROM_IRQ(irq);
 
 	if (pcibr_intr_list == NULL) {
-		pcibr_intr_list = kmalloc(sizeof(struct pcibr_intr_list_t *) * NR_IRQS, GFP_KERNEL);
+		pcibr_intr_list = kmalloc(sizeof(pcibr_intr_list_t) * NR_IRQS, GFP_KERNEL);
 		if (pcibr_intr_list == NULL) 
-			pcibr_intr_list = vmalloc(sizeof(struct pcibr_intr_list_t *) * NR_IRQS);
+			pcibr_intr_list = vmalloc(sizeof(pcibr_intr_list_t) * NR_IRQS);
 		if (pcibr_intr_list == NULL) panic("Could not allocate memory for pcibr_intr_list\n");
-		memset( (void *)pcibr_intr_list, 0, sizeof(struct pcibr_intr_list_t *) * NR_IRQS);
+		memset( (void *)pcibr_intr_list, 0, sizeof(pcibr_intr_list_t) * NR_IRQS);
 	}
 	if (pdacpu(cpu)->sn_last_irq < irq) {
 		pdacpu(cpu)->sn_last_irq = irq;
@@ -229,42 +205,42 @@
 	if (pdacpu(cpu)->sn_first_irq > irq) pdacpu(cpu)->sn_first_irq = irq;
 	if (!p) panic("Could not allocate memory for pcibr_intr_list_t\n");
 	if ((list = pcibr_intr_list[irq])) {
-		while (list->next) list = list->next;
-		list->next = p;
-		p->next = NULL;
-		p->intr = intr;
+		while (list->il_next) list = list->il_next;
+		list->il_next = p;
+		p->il_next = NULL;
+		p->il_intr = intr;
 	} else {
 		pcibr_intr_list[irq] = p;
-		p->next = NULL;
-		p->intr = intr;
+		p->il_next = NULL;
+		p->il_intr = intr;
 	}
 }
 
 void
 force_polled_int(void) {
 	int i;
-	struct pcibr_intr_list_t *p;
+	pcibr_intr_list_t p;
 
 	for (i=0; i<NR_IRQS;i++) {
 		p = pcibr_intr_list[i];
 		while (p) {
-			if (p->intr){
-				pcibr_force_interrupt(p->intr);
+			if (p->il_intr){
+				pcibr_force_interrupt(p->il_intr);
 			}
-			p = p->next;
+			p = p->il_next;
 		}
 	}
 }
 
 static void
 force_interrupt(int irq) {
-	struct pcibr_intr_list_t *p = pcibr_intr_list[irq];
+	pcibr_intr_list_t p = pcibr_intr_list[irq];
 
 	while (p) {
-		if (p->intr) {
-			pcibr_force_interrupt(p->intr);
+		if (p->il_intr) {
+			pcibr_force_interrupt(p->il_intr);
 		}
-		p = p->next;
+		p = p->il_next;
 	}
 }
 
@@ -286,7 +262,7 @@
 	unsigned long irr_reg;
 
 
-	regval = intr->bi_soft->bs_base->p_int_status_64;
+	regval = pcireg_intr_status_get(intr->bi_soft->bs_base);
 	irr_reg_num = irq_to_vector(irq) / 64;
 	irr_bit = irq_to_vector(irq) % 64;
 	switch (irr_reg_num) {
@@ -324,13 +300,13 @@
 	if (pda->sn_first_irq == 0) return;
 	for (i=pda->sn_first_irq;
 		i <= pda->sn_last_irq; i++) {
-			struct pcibr_intr_list_t *p = pcibr_intr_list[i];
+			pcibr_intr_list_t p = pcibr_intr_list[i];
 			if (p == NULL) {
 				continue;
 			}
 			while (p) {
-				sn_check_intr(i, p->intr);
-				p = p->next;
+				sn_check_intr(i, p->il_intr);
+				p = p->il_next;
 			}
 	}
 }
diff -Nru a/arch/ia64/sn/kernel/machvec.c b/arch/ia64/sn/kernel/machvec.c
--- a/arch/ia64/sn/kernel/machvec.c	Tue Feb  3 19:45:28 2004
+++ b/arch/ia64/sn/kernel/machvec.c	Tue Feb  3 19:45:28 2004
@@ -1,33 +1,9 @@
 /*
+ * 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) 2002-2003 Silicon Graphics, Inc.  All Rights Reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of version 2 of the GNU General Public License 
- * as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it would be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
- * 
- * Further, this software is distributed without any warranty that it is 
- * free of the rightful claim of any third person regarding infringement 
- * or the like.  Any license provided herein, whether implied or 
- * otherwise, applies only to this software file.  Patent licenses, if 
- * any, provided herein do not apply to combinations of this program with 
- * other software, or any other product whatsoever.
- * 
- * You should have received a copy of the GNU General Public 
- * License along with this program; if not, write the Free Software 
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- * 
- * Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 
- * Mountain View, CA  94043, or:
- * 
- * http://www.sgi.com 
- * 
- * For further information regarding this notice, see: 
- * 
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan
  */
 
 #define MACHVEC_PLATFORM_NAME	sn2
diff -Nru a/arch/ia64/sn/kernel/mca.c b/arch/ia64/sn/kernel/mca.c
--- a/arch/ia64/sn/kernel/mca.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/sn/kernel/mca.c	Tue Feb  3 19:45:17 2004
@@ -2,35 +2,11 @@
  * File:	mca.c
  * Purpose:	SN specific MCA code.
  *
+ * 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) 2001-2003 Silicon Graphics, Inc.  All Rights Reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of version 2 of the GNU General Public License 
- * as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it would be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
- * 
- * Further, this software is distributed without any warranty that it is 
- * free of the rightful claim of any third person regarding infringement 
- * or the like.  Any license provided herein, whether implied or 
- * otherwise, applies only to this software file.  Patent licenses, if 
- * any, provided herein do not apply to combinations of this program with 
- * other software, or any other product whatsoever.
- * 
- * You should have received a copy of the GNU General Public 
- * License along with this program; if not, write the Free Software 
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- * 
- * Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 
- * Mountain View, CA  94043, or:
- * 
- * http://www.sgi.com 
- * 
- * For further information regarding this notice, see: 
- * 
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan
  */
 
 #include <linux/types.h>
diff -Nru a/arch/ia64/sn/kernel/probe.c b/arch/ia64/sn/kernel/probe.c
--- a/arch/ia64/sn/kernel/probe.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/sn/kernel/probe.c	Tue Feb  3 19:45:17 2004
@@ -1,35 +1,11 @@
 /*
  * Platform dependent support for IO probing.
  *
+ * 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) 2000-2003 Silicon Graphics, Inc.  All rights reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of version 2 of the GNU General Public License 
- * as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it would be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
- * 
- * Further, this software is distributed without any warranty that it is 
- * free of the rightful claim of any third person regarding infringement 
- * or the like.  Any license provided herein, whether implied or 
- * otherwise, applies only to this software file.  Patent licenses, if 
- * any, provided herein do not apply to combinations of this program with 
- * other software, or any other product whatsoever.
- * 
- * You should have received a copy of the GNU General Public 
- * License along with this program; if not, write the Free Software 
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- * 
- * Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 
- * Mountain View, CA  94043, or:
- * 
- * http://www.sgi.com 
- * 
- * For further information regarding this notice, see: 
- * 
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan
  */
 
 #include <asm/sn/sn_sal.h>
diff -Nru a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
--- a/arch/ia64/sn/kernel/setup.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ia64/sn/kernel/setup.c	Tue Feb  3 19:45:17 2004
@@ -1,33 +1,9 @@
 /*
+ * 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) 1999,2001-2003 Silicon Graphics, Inc. All rights reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of version 2 of the GNU General Public License 
- * as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it would be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
- * 
- * Further, this software is distributed without any warranty that it is 
- * free of the rightful claim of any third person regarding infringement 
- * or the like.  Any license provided herein, whether implied or 
- * otherwise, applies only to this software file.  Patent licenses, if 
- * any, provided herein do not apply to combinations of this program with 
- * other software, or any other product whatsoever.
- * 
- * You should have received a copy of the GNU General Public 
- * License along with this program; if not, write the Free Software 
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- * 
- * Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 
- * Mountain View, CA  94043, or:
- * 
- * http://www.sgi.com 
- * 
- * For further information regarding this notice, see: 
- * 
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan
  */
 
 #include <linux/config.h>
@@ -82,6 +58,7 @@
 extern void bte_init_cpu (void);
 extern void sn_timer_init(void);
 extern unsigned long last_time_offset;
+extern void init_platform_hubinfo(nodepda_t **nodepdaindr);
 extern void (*ia64_mark_idle)(int);
 extern void snidle(int);
 
@@ -93,6 +70,8 @@
 
 short physical_node_map[MAX_PHYSNODE_ID];
 
+int     numionodes;
+
 /*
  * This is the address of the RRegs in the HSpace of the global
  * master.  It is used by a hack in serial.c (serial_[in|out],
@@ -240,9 +219,10 @@
 	long status, ticks_per_sec, drift;
 	int pxm;
 	int major = sn_sal_rev_major(), minor = sn_sal_rev_minor();
-	extern void io_sh_swapper(int, int);
-	extern nasid_t get_master_baseio_nasid(void);
+	extern nasid_t snia_get_master_baseio_nasid(void);
 	extern void sn_cpu_init(void);
+	extern nasid_t snia_get_console_nasid(void);
+
 
 	MAX_DMA_ADDRESS = PAGE_OFFSET + MAX_PHYS_MEMORY;
 
@@ -263,11 +243,9 @@
 		panic("PROM version too old\n");
 	}
 
-	io_sh_swapper(get_nasid(), 0);
-
 	master_nasid = get_nasid();
-	(void)get_console_nasid();
-	(void)get_master_baseio_nasid();
+	(void)snia_get_console_nasid();
+	(void)snia_get_master_baseio_nasid();
 
 	status = ia64_sal_freq_base(SAL_FREQ_BASE_REALTIME_CLOCK, &ticks_per_sec, &drift);
 	if (status != 0 || ticks_per_sec < 100000) {
@@ -312,6 +290,12 @@
 	 */
 	sn_cpu_init();
 
+	/*
+	 * Setup hubinfo stuff. Has to happen AFTER sn_cpu_init(),
+	 * because it uses the cnode to nasid tables.
+	 */
+	init_platform_hubinfo(nodepdaindr);
+
 #ifdef CONFIG_SMP
 	init_smp_config();
 #endif
@@ -329,6 +313,7 @@
 sn_init_pdas(char **cmdline_p)
 {
 	cnodeid_t	cnode;
+	void scan_for_ionodes(void);
 
 	/*
 	 * Make sure that the PDA fits entirely in the same page as the 
@@ -341,6 +326,9 @@
 	for (cnode=0; cnode<numnodes; cnode++)
 		pda->cnodeid_to_nasid_table[cnode] = pxm_to_nasid(nid_to_pxm_map[cnode]);
 
+	numionodes = numnodes;
+	scan_for_ionodes();
+
         /*
          * Allocate & initalize the nodepda for each node.
          */
@@ -398,9 +386,6 @@
 	cnode = nasid_to_cnodeid(nasid);
 	slice = cpu_physical_id_to_slice(cpuphyid);
 
-	printk("CPU %d: nasid %d, slice %d, cnode %d\n",
-			smp_processor_id(), nasid, slice, cnode);
-
 	memset(pda, 0, sizeof(pda));
 	pda->p_nodepda = nodepdaindr[cnode];
 	pda->led_address = (typeof(pda->led_address)) (LED0 + (slice<<LED_CPU_SHIFT));
@@ -444,4 +429,33 @@
 	}
 
 	bte_init_cpu();
+}
+
+/*
+ * Scan klconfig for ionodes.  Add the nasids to the
+ * physical_node_map and the pda and increment numionodes.
+ */
+
+void
+scan_for_ionodes(void) {
+	int nasid = 0;
+
+	/* Setup ionodes with memory */
+	for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid +=2) {
+		u64 klgraph_header;
+		cnodeid_t cnodeid;
+
+		if (physical_node_map[nasid] == -1) 
+			continue;
+
+		klgraph_header = cnodeid = -1;
+		klgraph_header = ia64_sn_get_klconfig_addr(nasid);
+		if (klgraph_header <= 0)
+			BUG(); /* All nodes must have klconfig tables! */
+		cnodeid = nasid_to_cnodeid(nasid);
+		root_lboard[cnodeid] = (lboard_t *)
+					NODE_OFFSET_TO_LBOARD( (nasid),
+					((kl_config_hdr_t *)(klgraph_header))->
+					ch_board_info);
+	}
 }
diff -Nru a/arch/ia64/sn/kernel/sn2/Makefile b/arch/ia64/sn/kernel/sn2/Makefile
--- a/arch/ia64/sn/kernel/sn2/Makefile	Tue Feb  3 19:45:43 2004
+++ b/arch/ia64/sn/kernel/sn2/Makefile	Tue Feb  3 19:45:43 2004
@@ -9,7 +9,5 @@
 # sn2 specific kernel files
 #
 
-EXTRA_CFLAGS := -DLITTLE_ENDIAN
-
 obj-y += cache.o io.o ptc_deadlock.o sn2_smp.o sn_proc_fs.o \
-	 prominfo_proc.o timer.o
+	 prominfo_proc.o timer.o timer_interrupt.o
diff -Nru a/arch/ia64/sn/kernel/sn2/cache.c b/arch/ia64/sn/kernel/sn2/cache.c
--- a/arch/ia64/sn/kernel/sn2/cache.c	Tue Feb  3 19:45:43 2004
+++ b/arch/ia64/sn/kernel/sn2/cache.c	Tue Feb  3 19:45:43 2004
@@ -1,5 +1,4 @@
 /*
- * 
  * 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.
@@ -8,9 +7,7 @@
  *
  */
 
-#include <linux/module.h>
-#include <asm/cacheflush.h>
-#include <asm/system.h>
+#include <asm/pgalloc.h>
 
 /**
  * sn_flush_all_caches - flush a range of address from all caches (incl. L4)
diff -Nru a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c
--- a/arch/ia64/sn/kernel/sn2/sn2_smp.c	Tue Feb  3 19:45:42 2004
+++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c	Tue Feb  3 19:45:42 2004
@@ -1,35 +1,11 @@
 /*
  * SN2 Platform specific SMP Support
  *
+ * 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) 2000-2003 Silicon Graphics, Inc. All rights reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of version 2 of the GNU General Public License 
- * as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it would be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
- * 
- * Further, this software is distributed without any warranty that it is 
- * free of the rightful claim of any third person regarding infringement 
- * or the like.  Any license provided herein, whether implied or 
- * otherwise, applies only to this software file.  Patent licenses, if 
- * any, provided herein do not apply to combinations of this program with 
- * other software, or any other product whatsoever.
- * 
- * You should have received a copy of the GNU General Public 
- * License along with this program; if not, write the Free Software 
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- * 
- * Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 
- * Mountain View, CA  94043, or:
- * 
- * http://www.sgi.com 
- * 
- * For further information regarding this notice, see: 
- * 
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan
  */
 
 #include <linux/init.h>
@@ -74,7 +50,7 @@
 
 	piows = pda->pio_write_status_addr;
 	do {
-		__asm__ __volatile__ ("mf.a" ::: "memory");
+		ia64_mfa();
 	} while (((ws = *piows) & SH_PIO_WRITE_STATUS_0_PENDING_WRITE_COUNT_MASK) != 
 			SH_PIO_WRITE_STATUS_0_PENDING_WRITE_COUNT_MASK);
 	return ws;
@@ -117,7 +93,8 @@
 			if (is_headless_node(cnode))
 				continue;
 			if (cnode == mycnode) {
-				asm volatile ("ptc.ga %0,%1;;srlz.i;;" :: "r"(start), "r"(nbits<<2) : "memory");
+				ia64_ptcga(start, nbits<<2);
+				ia64_srlz_i();
 			} else {
 				nasid = cnodeid_to_nasid(cnode);
 				ptc0 = CHANGE_NASID(nasid, ptc0);
diff -Nru a/arch/ia64/sn/kernel/sn2/sn_proc_fs.c b/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
--- a/arch/ia64/sn/kernel/sn2/sn_proc_fs.c	Tue Feb  3 19:45:43 2004
+++ b/arch/ia64/sn/kernel/sn2/sn_proc_fs.c	Tue Feb  3 19:45:43 2004
@@ -1,34 +1,9 @@
 /*
+ * 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) 2000-2003 Silicon Graphics, Inc. All rights reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of version 2 of the GNU General Public License 
- * as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it would be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
- * 
- * Further, this software is distributed without any warranty that it is 
- * free of the rightful claim of any third person regarding infringement 
- * or the like.  Any license provided herein, whether implied or 
- * otherwise, applies only to this software file.  Patent licenses, if 
- * any, provided herein do not apply to combinations of this program with 
- * other software, or any other product whatsoever.
- * 
- * You should have received a copy of the GNU General Public 
- * License along with this program; if not, write the Free Software 
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- * 
- * Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 
- * Mountain View, CA  94043, or:
- * 
- * http://www.sgi.com 
- * 
- * For further information regarding this notice, see: 
- * 
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan
  */
 #include <linux/config.h>
 #include <asm/uaccess.h>
diff -Nru a/arch/ia64/sn/kernel/sn2/timer_interrupt.c b/arch/ia64/sn/kernel/sn2/timer_interrupt.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/ia64/sn/kernel/sn2/timer_interrupt.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,63 @@
+/*
+ *
+ *
+ * Copyright (c) 2003 Silicon Graphics, Inc.  All Rights Reserved.
+ * 
+ * This program is free software; you can redistribute it and/or modify it 
+ * under the terms of version 2 of the GNU General Public License 
+ * as published by the Free Software Foundation.
+ * 
+ * This program is distributed in the hope that it would be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty of 
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
+ * 
+ * Further, this software is distributed without any warranty that it is 
+ * free of the rightful claim of any third person regarding infringement 
+ * or the like.  Any license provided herein, whether implied or 
+ * otherwise, applies only to this software file.  Patent licenses, if 
+ * any, provided herein do not apply to combinations of this program with 
+ * other software, or any other product whatsoever.
+ * 
+ * You should have received a copy of the GNU General Public 
+ * License along with this program; if not, write the Free Software 
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ * 
+ * Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 
+ * Mountain View, CA  94043, or:
+ * 
+ * http://www.sgi.com 
+ * 
+ * For further information regarding this notice, see: 
+ * 
+ * http://oss.sgi.com/projects/GenInfo/NoticeExplan
+ */
+
+#include <linux/interrupt.h>
+#include <asm/sn/pda.h>
+#include <asm/sn/leds.h>
+
+extern void sn_lb_int_war_check(void);
+extern irqreturn_t timer_interrupt (int irq, void *dev_id, struct pt_regs *regs);
+
+#define SN_LB_INT_WAR_INTERVAL 100
+
+void
+sn_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	/* LED blinking */
+	if (!pda->hb_count--) {
+		pda->hb_count = HZ/2;
+		set_led_bits(pda->hb_state ^= LED_CPU_HEARTBEAT, LED_CPU_HEARTBEAT);
+	}
+
+	if (enable_shub_wars_1_1()) {
+		/* Bugfix code for SHUB 1.1 */
+        	if (pda->pio_shub_war_cam_addr)
+                	*pda->pio_shub_war_cam_addr = 0x8000000000000010UL;
+	}
+	if (pda->sn_lb_int_war_ticks == 0)
+		sn_lb_int_war_check();
+	pda->sn_lb_int_war_ticks++;
+	if (pda->sn_lb_int_war_ticks >= SN_LB_INT_WAR_INTERVAL)
+		pda->sn_lb_int_war_ticks = 0;
+}
diff -Nru a/arch/m68k/amiga/amisound.c b/arch/m68k/amiga/amisound.c
--- a/arch/m68k/amiga/amisound.c	Tue Feb  3 19:45:43 2004
+++ b/arch/m68k/amiga/amisound.c	Tue Feb  3 19:45:43 2004
@@ -44,7 +44,7 @@
 
 void __init amiga_init_sound(void)
 {
-	static struct resource beep_res = { "Beep" };
+	static struct resource beep_res = { .name = "Beep" };
 
 	snd_data = amiga_chip_alloc_res(sizeof(sine_data), &beep_res);
 	if (!snd_data) {
diff -Nru a/arch/m68k/amiga/chipram.c b/arch/m68k/amiga/chipram.c
--- a/arch/m68k/amiga/chipram.c	Tue Feb  3 19:45:30 2004
+++ b/arch/m68k/amiga/chipram.c	Tue Feb  3 19:45:30 2004
@@ -19,7 +19,9 @@
 
 unsigned long amiga_chip_size;
 
-static struct resource chipram_res = { "Chip RAM", CHIP_PHYSADDR };
+static struct resource chipram_res = {
+    .name = "Chip RAM", .start = CHIP_PHYSADDR
+};
 static unsigned long chipavail;
 
 
diff -Nru a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c
--- a/arch/m68k/amiga/config.c	Tue Feb  3 19:45:16 2004
+++ b/arch/m68k/amiga/config.c	Tue Feb  3 19:45:16 2004
@@ -121,14 +121,22 @@
 static struct {
     struct resource _ciab, _ciaa, _custom, _kickstart;
 } mb_resources = {
-    ._ciab =		{ "CIA B", 0x00bfd000, 0x00bfdfff },
-    ._ciaa =		{ "CIA A", 0x00bfe000, 0x00bfefff },
-    ._custom =		{ "Custom I/O", 0x00dff000, 0x00dfffff },
-    ._kickstart =	{ "Kickstart ROM", 0x00f80000, 0x00ffffff }
+    ._ciab = {
+	.name = "CIA B", .start = 0x00bfd000, .end = 0x00bfdfff
+    },
+    ._ciaa = {
+	.name = "CIA A", .start = 0x00bfe000, .end = 0x00bfefff
+    },
+    ._custom = {
+	.name = "Custom I/O", .start = 0x00dff000, .end = 0x00dfffff
+    },
+    ._kickstart = {
+	.name = "Kickstart ROM", .start = 0x00f80000, .end = 0x00ffffff
+    }
 };
 
 static struct resource rtc_resource = {
-    NULL, 0x00dc0000, 0x00dcffff
+    .start = 0x00dc0000, .end = 0x00dcffff
 };
 
 static struct resource ram_resource[NUM_MEMINFO];
@@ -495,7 +503,7 @@
 							  struct pt_regs *))
 {
 	static struct resource sched_res = {
-	    "timer", 0x00bfd400, 0x00bfd5ff,
+	    .name = "timer", .start = 0x00bfd400, .end = 0x00bfd5ff,
 	};
 	jiffy_ticks = (amiga_eclock+HZ/2)/HZ;
 
@@ -798,12 +806,12 @@
 
 static void amiga_savekmsg_init(void)
 {
-    static struct resource debug_res = { "Debug" };
+    static struct resource debug_res = { .name = "Debug" };
 
     savekmsg = amiga_chip_alloc_res(SAVEKMSG_MAXMEM, &debug_res);
     savekmsg->magic1 = SAVEKMSG_MAGIC1;
     savekmsg->magic2 = SAVEKMSG_MAGIC2;
-    savekmsg->magicptr = virt_to_phys(savekmsg);
+    savekmsg->magicptr = ZTWO_PADDR(savekmsg);
     savekmsg->size = 0;
 }
 
diff -Nru a/arch/m68k/atari/hades-pci.c b/arch/m68k/atari/hades-pci.c
--- a/arch/m68k/atari/hades-pci.c	Tue Feb  3 19:45:28 2004
+++ b/arch/m68k/atari/hades-pci.c	Tue Feb  3 19:45:28 2004
@@ -40,13 +40,20 @@
 static const char pci_io_name[] = "PCI I/O space";
 static const char pci_config_name[] = "PCI config space";
 
-static struct resource config_space = { pci_config_name, HADES_CONFIG_BASE,
-										HADES_CONFIG_BASE + HADES_CONFIG_SIZE - 1 };
-static struct resource io_space = { pci_io_name, HADES_IO_BASE, HADES_IO_BASE +
-								    HADES_IO_SIZE - 1 };
+static struct resource config_space = {
+    .name = pci_config_name,
+    .start = HADES_CONFIG_BASE,
+    .end = HADES_CONFIG_BASE + HADES_CONFIG_SIZE - 1
+};
+static struct resource io_space = {
+    .name = pci_io_name,
+    .start = HADES_IO_BASE,
+    .end = HADES_IO_BASE + HADES_IO_SIZE - 1
+};
 
-static const unsigned long pci_conf_base_phys[] = { 0xA0080000, 0xA0040000,
-												    0xA0020000, 0xA0010000 };
+static const unsigned long pci_conf_base_phys[] = {
+    0xA0080000, 0xA0040000, 0xA0020000, 0xA0010000
+};
 static unsigned long pci_conf_base_virt[N_SLOTS];
 static unsigned long pci_io_base_virt;
 
diff -Nru a/arch/m68k/bvme6000/rtc.c b/arch/m68k/bvme6000/rtc.c
--- a/arch/m68k/bvme6000/rtc.c	Tue Feb  3 19:45:29 2004
+++ b/arch/m68k/bvme6000/rtc.c	Tue Feb  3 19:45:29 2004
@@ -53,6 +53,7 @@
 		/* Ensure clock and real-time-mode-register are accessible */
 		msr = rtc->msr & 0xc0;
 		rtc->msr = 0x40;
+		memset(&wtime, 0, sizeof(struct rtc_time));
 		do {
 			wtime.tm_sec =  BCD2BIN(rtc->bcd_sec);
 			wtime.tm_min =  BCD2BIN(rtc->bcd_min);
@@ -164,11 +165,10 @@
 	.release =	rtc_release,
 };
 
-static struct miscdevice rtc_dev=
-{
-	RTC_MINOR,
-	"rtc",
-	&rtc_fops
+static struct miscdevice rtc_dev = {
+	.minor =	RTC_MINOR,
+	.name =		"rtc",
+	.fops =		&rtc_fops
 };
 
 int __init rtc_DP8570A_init(void)
diff -Nru a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S
--- a/arch/m68k/kernel/head.S	Tue Feb  3 19:45:43 2004
+++ b/arch/m68k/kernel/head.S	Tue Feb  3 19:45:43 2004
@@ -23,7 +23,7 @@
 ** 98/04/25 Phil Blundell: added HP300 support
 ** 1998/08/30 David Kilzer: Added support for font_desc structures
 **            for linux-2.1.115
-** 9/02/11  Richard Zidlicky: added Q40 support (initial vesion 99/01/01) 
+** 9/02/11  Richard Zidlicky: added Q40 support (initial vesion 99/01/01)
 **
 ** This file is subject to the terms and conditions of the GNU General Public
 ** License. See the file README.legal in the main directory of this archive
@@ -100,14 +100,14 @@
  *
  *	While this essentially describes the function in the abstract, you'll
  * find more indepth description of other parameters at the implementation site.
- * 
+ *
  * mmu_get_root_table_entry
  * ------------------------
  * mmu_get_ptr_table_entry
  * -----------------------
  * mmu_get_page_table_entry
  * ------------------------
- * 
+ *
  *	These routines are used by other mmu routines to get a pointer into
  * a table, if necessary a new table is allocated. These routines are working
  * basically like pmd_alloc() and pte_alloc() in <asm/pgtable.h>. The root
@@ -273,6 +273,7 @@
  */
 
 #define CONSOLE
+#define CONSOLE_PENGUIN
 
 /*
  * Macintosh serial debug support; outputs boot info to the printer
@@ -310,8 +311,8 @@
 .globl mvme_bdid
 #endif
 #ifdef CONFIG_Q40
-.globl q40_mem_cptr	
-#endif		
+.globl q40_mem_cptr
+#endif
 #ifdef CONFIG_HP300
 .globl hp300_phys_ram_base
 #endif
@@ -422,7 +423,7 @@
 L(\name):
 	linkw	%a6,#-\stack
 	moveml	\saveregs,%sp@-
-.set	stackstart,-\stack	
+.set	stackstart,-\stack
 
 .macro	func_return_\name
 	moveml	%sp@+,\saveregs
@@ -483,6 +484,12 @@
 func_define	serial_putc,1
 func_define	console_putc,1
 
+func_define	console_init
+func_define	console_put_stats
+func_define	console_put_penguin
+func_define	console_plot_pixel,3
+func_define	console_scroll
+
 .macro	putc	ch
 #if defined(CONSOLE) || defined(SERIAL_DEBUG)
 	pea	\ch
@@ -586,7 +593,7 @@
 	.long	MACH_MVME16x, MVME16x_BOOTI_VERSION
 	.long	MACH_BVME6000, BVME6000_BOOTI_VERSION
 	.long	MACH_MAC, MAC_BOOTI_VERSION
-	.long	MACH_Q40, Q40_BOOTI_VERSION	
+	.long	MACH_Q40, Q40_BOOTI_VERSION
 	.long	0
 1:	jra	__start
 
@@ -604,8 +611,8 @@
    address (apparently 0xff002000 in practice) which is not good if we need
    to be able to map this to VA 0x1000.  We could do it with pagetables but
    a better solution seems to be to relocate the kernel in physical memory
-   before we start.  
-	
+   before we start.
+
    So, we copy the entire kernel image (code+data+bss) down to the 16MB
    boundary that marks the start of RAM.  This is slightly tricky because
    we must not overwrite the copying code itself. :-)  */
@@ -650,7 +657,7 @@
 	movel	%d6,%a0
 	addl	#Lstart1,%a0
 	jmp	%a0@
-Lcopyend:	
+Lcopyend:
 
 Lstart1:
 	moveb	#0x3f,%d7
@@ -960,11 +967,11 @@
 #ifdef CONFIG_MAC
 	is_not_mac(L(nocon))
 #ifdef CONSOLE
-	jbsr	L(console_init)
+	console_init
 #ifdef CONSOLE_PENGUIN
-	jbsr	L(console_put_penguin)
+	console_put_penguin
 #endif	/* CONSOLE_PENGUIN */
-	jbsr	L(console_put_stats)
+	console_put_stats
 #endif	/* CONSOLE */
 L(nocon):
 #endif	/* CONFIG_MAC */
@@ -1108,12 +1115,12 @@
 
 	mmu_map_tt	#0,#0xfe000000,#0x01000000,#_PAGE_CACHE040W
 	mmu_map_tt	#1,#0xff000000,#0x01000000,#_PAGE_NOCACHE_S
-	
+
 	jbra	L(mmu_init_done)
-	
-L(notq40):		
-#endif	
-	
+
+L(notq40):
+#endif
+
 #ifdef CONFIG_HP300
 	is_not_hp300(L(nothp300))
 
@@ -1130,18 +1137,18 @@
 
 #ifdef CONFIG_MVME147
 
-       is_not_mvme147(L(not147))
+	is_not_mvme147(L(not147))
 
-       /*
-	* On MVME147 we have already created kernel page tables for
-	* 4MB of RAM at address 0, so now need to do a transparent
-	* mapping of the top of memory space.  Make it 0.5GByte for now,
-	* so we can access on-board i/o areas.
-	*/
+	/*
+	 * On MVME147 we have already created kernel page tables for
+	 * 4MB of RAM at address 0, so now need to do a transparent
+	 * mapping of the top of memory space.  Make it 0.5GByte for now,
+	 * so we can access on-board i/o areas.
+	 */
 
-       mmu_map_tt      #1,#0xe0000000,#0x20000000,#_PAGE_NOCACHE030
+	mmu_map_tt	#1,#0xe0000000,#0x20000000,#_PAGE_NOCACHE030
 
-       jbra    L(mmu_init_done)
+	jbra	L(mmu_init_done)
 
 L(not147):
 #endif /* CONFIG_MVME147 */
@@ -1226,10 +1233,6 @@
 
 	putc	'F'
 
-	lea	%pc@(L(mac_videobase)),%a0
-	lea	%pc@(L(console_video_virtual)),%a1
-	movel	%a0@,%a1@
-
 	is_not_040_or_060(1f)
 
 	moveq	#_PAGE_NOCACHE_S,%d3
@@ -1243,14 +1246,14 @@
 	 */
 
 	movel	#VIDEOMEMMASK,%d0
-	andl	L(mac_videobase),%d0
+	andl	%pc@(L(mac_videobase)),%d0
 
 	mmu_map		#VIDEOMEMBASE,%d0,#VIDEOMEMSIZE,%d3
-	/* The ROM starts at 4000 0000		    	*/
+	/* ROM from 4000 0000 to 4200 0000 (only for mac_reset()) */
 	mmu_map_eq	#0x40000000,#0x02000000,%d3
-	/* IO devices                               	*/
+	/* IO devices (incl. serial port) from 5000 0000 to 5300 0000 */
 	mmu_map_eq	#0x50000000,#0x03000000,%d3
-	/* NuBus slot space				*/
+	/* Nubus slot space (video at 0xF0000000, rom at 0xF0F80000) */
 	mmu_map_tt	#1,#0xf8000000,#0x08000000,%d3
 
 	jbra	L(mmu_init_done)
@@ -1284,7 +1287,7 @@
 	andl	#PAGE_TABLE_SIZE-1, %d0
 	mmu_get_page_table_entry	%a0,%d0
 
-	/* this is where the prom page table lives */	
+	/* this is where the prom page table lives */
 	movel	0xfefe00d4, %a1
 	movel	%a1@, %a1
 
@@ -1295,11 +1298,11 @@
 	movel	%d3,%a0@+
 	addl	#0x1000,%d3
 	movel	%d3,%a0@+
-	
-	dbra	%d1,1b	
-		
+
+	dbra	%d1,1b
+
 	/* setup tt1 for I/O */
-	mmu_map_tt	#1,#0x40000000,#0x40000000,#_PAGE_NOCACHE_S 
+	mmu_map_tt	#1,#0x40000000,#0x40000000,#_PAGE_NOCACHE_S
 	jbra	L(mmu_init_done)
 
 L(notsun3x):
@@ -1310,8 +1313,8 @@
 
 	putc	'P'
 	mmu_map         #0x80000000,#0,#0x02000000,#_PAGE_NOCACHE030
-	
-L(notapollo):	
+
+L(notapollo):
 	jbra	L(mmu_init_done)
 #endif
 
@@ -1342,7 +1345,7 @@
 #endif
 
 	/* first fix the page at the start of the kernel, that
-         * contains also kernel_pg_dir.
+	 * contains also kernel_pg_dir.
 	 */
 	movel	%pc@(L(phys_kernel_start)),%d0
 	subl	#PAGE_OFFSET,%d0
@@ -1462,9 +1465,15 @@
 	andl	L(mac_videobase),%d0
 	addl	#VIDEOMEMBASE,%d0
 	movel	%d0,L(mac_videobase)
+#if defined(CONSOLE)
+	movel	%pc@(L(phys_kernel_start)),%d0
+	subl	#PAGE_OFFSET,%d0
+	subl	%d0,L(console_font)
+	subl	%d0,L(console_font_data)
+#endif
 #ifdef MAC_SERIAL_DEBUG
 	orl	#0x50000000,L(mac_sccbase)
-#endif		
+#endif
 1:
 #endif
 
@@ -1486,20 +1495,20 @@
 	is_not_sun3x(1f)
 
 	/* enable copro */
-	oriw	#0x4000,0x61000000 
+	oriw	#0x4000,0x61000000
 1:
 #endif
 
 #ifdef CONFIG_APOLLO
 	is_not_apollo(1f)
 
-        /*
+	/*
 	 * Fix up the iobase before printing
-         */
-        movel   #0x80000000,L(iobase)
+	 */
+	movel	#0x80000000,L(iobase)
 1:
 #endif
-	
+
 	putc	'I'
 	leds	0x10
 
@@ -1889,7 +1898,7 @@
 	movel	%a4,%d5
 	addil	#PAGESIZE<<13,%d5
 	movel	%a0@+,%d6
-	btst	#1,%d6			/* is it a ptr? */
+	btst	#1,%d6			/* is it a table ptr? */
 	jbne	31f			/* yes */
 	btst	#0,%d6			/* is it early terminating? */
 	jbeq	1f			/* no */
@@ -1906,9 +1915,9 @@
 	movel	%a4,%d5
 	addil	#PAGESIZE<<6,%d5
 	movel	%a1@+,%d6
-	btst	#1,%d6
-	jbne	33f
-	btst	#0,%d6
+	btst	#1,%d6			/* is it a table ptr? */
+	jbne	33f			/* yes */
+	btst	#0,%d6			/* is it a page descriptor? */
 	jbeq	1f			/* no */
 	jbsr	mmu_030_print_helper
 	jbra	37f
@@ -2981,7 +2990,7 @@
    - check for '%LX$' signature in SRAM   */
 	lea	%pc@(q40_mem_cptr),%a1
 	move.l	#0xff020010,%a1@  /* must be inited - also used by debug=mem */
-	move.l	#0xff020000,%a1   
+	move.l	#0xff020000,%a1
 	cmp.b	#'%',%a1@
 	bne	2f	/*nodbg*/
 	addq.w	#4,%a1
@@ -2996,10 +3005,10 @@
 	/* signature OK */
 	lea	%pc@(L(q40_do_debug)),%a1
 	tas	%a1@
-/*nodbg: q40_do_debug is 0 by default*/	
-2:		
-#endif	
-	
+/*nodbg: q40_do_debug is 0 by default*/
+2:
+#endif
+
 #ifdef CONFIG_APOLLO
 /* We count on the PROM initializing SIO1 */
 #endif
@@ -3152,7 +3161,7 @@
 	moveml	%sp@+,%d0-%d7/%a2-%a6
 	jbra	L(serial_putc_done)
 2:
-#endif CONFIG_MVME16x
+#endif /* CONFIG_MVME16x */
 
 #ifdef CONFIG_BVME6000
 	is_not_bvme6000(2f)
@@ -3167,15 +3176,15 @@
 #endif
 
 #ifdef CONFIG_SUN3X
-	is_not_sun3x(2f) 
+	is_not_sun3x(2f)
 	movel	%d0,-(%sp)
 	movel	0xFEFE0018,%a1
 	jbsr	(%a1)
 	addq	#4,%sp
 	jbra	L(serial_putc_done)
-2:	
+2:
 #endif
-	
+
 #ifdef CONFIG_Q40
 	is_not_q40(2f)
 	tst.l	%pc@(L(q40_do_debug))	/* only debug if requested */
@@ -3186,16 +3195,16 @@
 	addq.l	#4,%a0
 	move.l	%a0,%a1@
 	jbra    L(serial_putc_done)
-2:		
-#endif	
+2:
+#endif
 
 #ifdef CONFIG_APOLLO
 	is_not_apollo(2f)
 	movl    %pc@(L(iobase)),%a1
-        moveb   %d0,%a1@(LTHRB0)
+	moveb	%d0,%a1@(LTHRB0)
 1:      moveb   %a1@(LSRB0),%d0
-        andb    #0x4,%d0
-        beq     1b
+	andb	#0x4,%d0
+	beq	1b
 2:
 #endif
 
@@ -3212,7 +3221,7 @@
 1:
 #ifdef CONSOLE
 	console_putc	%d0
-#endif 
+#endif
 #ifdef SERIAL_DEBUG
 	serial_putc	%d0
 #endif
@@ -3241,7 +3250,7 @@
 2:
 #ifdef CONSOLE
 	console_putc	%d2
-#endif 
+#endif
 #ifdef SERIAL_DEBUG
 	serial_putc	%d2
 #endif
@@ -3290,7 +3299,7 @@
 	moveb	%d0,%a0@(0x1ffff)
 	jra	2f
 #endif
-1:	
+1:
 #ifdef CONFIG_APOLLO
 	movel   %pc@(L(iobase)),%a0
 	lsll    #8,%d0
@@ -3313,7 +3322,7 @@
 #define Lconsole_struct_left_edge	16
 #define Lconsole_struct_penguin_putc	20
 
-L(console_init):
+func_start	console_init,%a0-%a4/%d0-%d7
 	/*
 	 *	Some of the register usage that follows
 	 *		a0 = pointer to boot_info
@@ -3327,30 +3336,27 @@
 	 *		d5 = number of bytes per scan line
 	 *		d6 = number of bytes on the entire screen
 	 */
-	moveml	%a0-%a4/%d0-%d7,%sp@-
 
 	lea	%pc@(L(console_globals)),%a2
-	lea	%pc@(L(mac_videobase)),%a0
-	movel	%a0@,%a1
-	lea	%pc@(L(mac_rowbytes)),%a0
-	movel	%a0@,%d5
-	lea	%pc@(L(mac_dimensions)),%a0
-	movel	%a0@,%d3	/* -> low byte */
+	movel	%pc@(L(mac_videobase)),%a1
+	movel	%pc@(L(mac_rowbytes)),%d5
+	movel	%pc@(L(mac_dimensions)),%d3	/* -> low byte */
 	movel	%d3,%d4
 	swap	%d4		/* -> high byte */
 	andl	#0xffff,%d3	/* d3 = screen width in pixels */
 	andl	#0xffff,%d4	/* d4 = screen height in pixels */
 
 	movel	%d5,%d6
-	subl	#20,%d6
+|	subl	#20,%d6
 	mulul	%d4,%d6		/* scan line bytes x num scan lines */
 	divul	#8,%d6		/* we'll clear 8 bytes at a time */
+	moveq	#-1,%d0		/* Mac_black */
 	subq	#1,%d6
 
-console_clear_loop:
-	movel	#0xffffffff,%a1@+	/* Mac_black */
-	movel	#0xffffffff,%a1@+	/* Mac_black */
-	dbra	%d6,console_clear_loop
+L(console_clear_loop):
+	movel	%d0,%a1@+
+	movel	%d0,%a1@+
+	dbra	%d6,L(console_clear_loop)
 
 	/* Calculate font size */
 
@@ -3368,12 +3374,17 @@
 
 	/*
 	 *	At this point we make a shift in register usage
-	 *	a1 = address of Lconsole_font pointer
+	 *	a1 = address of console_font pointer
 	 */
 	lea	%pc@(L(console_font)),%a1
-	movel	%a0,%a1@	/* store pointer to struct font_desc in Lconsole_font */
+	movel	%a0,%a1@	/* store pointer to struct fbcon_font_desc in console_font */
 	tstl	%a0
 	jeq	1f
+	lea	%pc@(L(console_font_data)),%a4
+	movel	%a0@(FONT_DESC_DATA),%d0
+	subl	#L(console_font),%a1
+	addl	%a1,%d0
+	movel	%d0,%a4@
 
 	/*
 	 *	Calculate global maxs
@@ -3382,11 +3393,11 @@
 	 *	6 x 11 also supported
 	 */
 		/* ASSERT: a0 = contents of Lconsole_font */
-	movel	%d3,%d0			/* screen width in pixels */
-	divul	%a0@(FONT_DESC_WIDTH),%d0		/* d0 = max num chars per row */
+	movel	%d3,%d0				/* screen width in pixels */
+	divul	%a0@(FONT_DESC_WIDTH),%d0	/* d0 = max num chars per row */
 
-	movel	%d4,%d1			 /* screen height in pixels */
-	divul	%a0@(FONT_DESC_HEIGHT),%d1	 /* d1 = max num rows */
+	movel	%d4,%d1				/* screen height in pixels */
+	divul	%a0@(FONT_DESC_HEIGHT),%d1	/* d1 = max num rows */
 
 	movel	%d0,%a2@(Lconsole_struct_num_columns)
 	movel	%d1,%a2@(Lconsole_struct_num_rows)
@@ -3401,17 +3412,15 @@
 	/*
 	 * Initialization is complete
 	 */
-1:	moveml	%sp@+,%a0-%a4/%d0-%d7
-	rts
+1:
+func_return	console_init
 
-L(console_put_stats):
+func_start	console_put_stats,%a0/%d7
 	/*
 	 *	Some of the register usage that follows
 	 *		a0 = pointer to boot_info
 	 *		d7 = value of boot_info fields
 	 */
-	moveml	%a0/%d7,%sp@-
-
 	puts	"\nMacLinux\n\n"
 
 #ifdef SERIAL_DEBUG
@@ -3433,58 +3442,57 @@
 #ifdef MAC_SERIAL_DEBUG
 	putn	%pc@(L(mac_sccbase))
 	putc	'\n'
-#endif	
+#endif
 #  if defined(MMU_PRINT)
 	jbsr	mmu_print_machine_cpu_types
 #  endif /* MMU_PRINT */
 #endif /* SERIAL_DEBUG */
 
-	moveml	%sp@+,%a0/%d7
-	rts
+func_return	console_put_stats
 
 #ifdef CONSOLE_PENGUIN
-L(console_put_penguin):
+func_start	console_put_penguin,%a0-%a1/%d0-%d7
 	/*
 	 *	Get 'that_penguin' onto the screen in the upper right corner
 	 *	penguin is 64 x 74 pixels, align against right edge of screen
 	 */
-	moveml	%a0-%a1/%d0-%d7,%sp@-
-
 	lea	%pc@(L(mac_dimensions)),%a0
 	movel	%a0@,%d0
 	andil	#0xffff,%d0
 	subil	#64,%d0		/* snug up against the right edge */
 	clrl	%d1		/* start at the top */
 	movel	#73,%d7
-	lea	%pc@(that_penguin),%a1
-console_penguin_row:
+	lea	%pc@(L(that_penguin)),%a1
+L(console_penguin_row):
 	movel	#31,%d6
-console_penguin_pixel_pair:
+L(console_penguin_pixel_pair):
 	moveb	%a1@,%d2
 	lsrb	#4,%d2
-	jbsr	console_plot_pixel
+	console_plot_pixel %d0,%d1,%d2
 	addq	#1,%d0
 	moveb	%a1@+,%d2
-	jbsr	console_plot_pixel
+	console_plot_pixel %d0,%d1,%d2
 	addq	#1,%d0
-	dbra	%d6,console_penguin_pixel_pair
+	dbra	%d6,L(console_penguin_pixel_pair)
 
 	subil	#64,%d0
 	addq	#1,%d1
-	dbra	%d7,console_penguin_row
+	dbra	%d7,L(console_penguin_row)
 
-	moveml	%sp@+,%a0-%a1/%d0-%d7
-	rts
-#endif
+func_return	console_put_penguin
 
-console_scroll:
-	moveml	%a0-%a4/%d0-%d7,%sp@-
+/* include penguin bitmap */
+L(that_penguin):
+#include "../mac/mac_penguin.S"
+#endif
 
 	/*
 	 * Calculate source and destination addresses
 	 *	output	a1 = dest
 	 *		a2 = source
 	 */
+
+func_start	console_scroll,%a0-%a4/%d0-%d7
 	lea	%pc@(L(mac_videobase)),%a0
 	movel	%a0@,%a1
 	movel	%a1,%a2
@@ -3517,7 +3525,7 @@
 	divul	#32,%d6		/* we'll move 8 longs at a time */
 	subq	#1,%d6
 
-console_scroll_loop:
+L(console_scroll_loop):
 	movel	%a2@+,%a1@+
 	movel	%a2@+,%a1@+
 	movel	%a2@+,%a1@+
@@ -3526,7 +3534,7 @@
 	movel	%a2@+,%a1@+
 	movel	%a2@+,%a1@+
 	movel	%a2@+,%a1@+
-	dbra	%d6,console_scroll_loop
+	dbra	%d6,L(console_scroll_loop)
 
 	lea	%pc@(L(mac_rowbytes)),%a0
 	movel	%a0@,%d6
@@ -3536,7 +3544,7 @@
 	subq	#1,%d6
 
 	moveq	#-1,%d0
-console_scroll_clear_loop:
+L(console_scroll_clear_loop):
 	movel	%d0,%a1@+
 	movel	%d0,%a1@+
 	movel	%d0,%a1@+
@@ -3545,17 +3553,17 @@
 	movel	%d0,%a1@+
 	movel	%d0,%a1@+
 	movel	%d0,%a1@+
-	dbra	%d6,console_scroll_clear_loop
+	dbra	%d6,L(console_scroll_clear_loop)
 
-1:	moveml	%sp@+,%a0-%a4/%d0-%d7
-	rts
+1:
+func_return	console_scroll
 
 
 func_start	console_putc,%a0/%a1/%d0-%d7
 
-	is_not_mac(console_exit)
+	is_not_mac(L(console_exit))
 	tstl	%pc@(L(console_font))
-	jeq	console_exit
+	jeq	L(console_exit)
 
 	/* Output character in d7 on console.
 	 */
@@ -3569,7 +3577,7 @@
 	lea	%pc@(L(console_globals)),%a0
 
 	cmpib	#10,%d7
-	jne	console_not_lf
+	jne	L(console_not_lf)
 	movel	%a0@(Lconsole_struct_cur_row),%d0
 	addil	#1,%d0
 	movel	%d0,%a0@(Lconsole_struct_cur_row)
@@ -3578,22 +3586,22 @@
 	jcs	1f
 	subil	#1,%d0
 	movel	%d0,%a0@(Lconsole_struct_cur_row)
-	jbsr	console_scroll
+	console_scroll
 1:
-	jra	console_exit
+	jra	L(console_exit)
 
-console_not_lf:
+L(console_not_lf):
 	cmpib	#13,%d7
-	jne	console_not_cr
+	jne	L(console_not_cr)
 	clrl	%a0@(Lconsole_struct_cur_column)
-	jra	console_exit
+	jra	L(console_exit)
 
-console_not_cr:
+L(console_not_cr):
 	cmpib	#1,%d7
-	jne	console_not_home
+	jne	L(console_not_home)
 	clrl	%a0@(Lconsole_struct_cur_row)
 	clrl	%a0@(Lconsole_struct_cur_column)
-	jra	console_exit
+	jra	L(console_exit)
 
 /*
  *	At this point we know that the %d7 character is going to be
@@ -3604,9 +3612,9 @@
  *		d1 = cursor row to draw the character
  *		d7 = character number
  */
-console_not_home:
+L(console_not_home):
 	movel	%a0@(Lconsole_struct_cur_column),%d0
-	addil	#1,%a0@(Lconsole_struct_cur_column)
+	addql	#1,%a0@(Lconsole_struct_cur_column)
 	movel	%a0@(Lconsole_struct_num_columns),%d1
 	cmpl	%d1,%d0
 	jcs	1f
@@ -3616,10 +3624,10 @@
 
 	/*
 	 *	At this point we make a shift in register usage
-	 *	a0 = address of pointer to font data (font_desc)
+	 *	a0 = address of pointer to font data (fbcon_font_desc)
 	 */
 	movel	%pc@(L(console_font)),%a0
-	movel	%a0@(FONT_DESC_DATA),%a1	/* Load font_desc.data into a1 */
+	movel	%pc@(L(console_font_data)),%a1	/* Load fbcon_font_desc.data into a1 */
 	andl	#0x000000ff,%d7
 		/* ASSERT: a0 = contents of Lconsole_font */
 	mulul	%a0@(FONT_DESC_HEIGHT),%d7	/* d7 = index into font data */
@@ -3637,32 +3645,30 @@
 		/* ASSERT: a0 = contents of Lconsole_font */
 	mulul	%a0@(FONT_DESC_WIDTH),%d0
 	mulul	%a0@(FONT_DESC_HEIGHT),%d1
-	movel	%a0@(FONT_DESC_HEIGHT),%d7	/* Load font_desc.height into d7 */
+	movel	%a0@(FONT_DESC_HEIGHT),%d7	/* Load fbcon_font_desc.height into d7 */
 	subq	#1,%d7
-console_read_char_scanline:
+L(console_read_char_scanline):
 	moveb	%a1@+,%d3
 
 		/* ASSERT: a0 = contents of Lconsole_font */
-	movel	%a0@(FONT_DESC_WIDTH),%d6	/* Load font_desc.width into d6 */
+	movel	%a0@(FONT_DESC_WIDTH),%d6	/* Load fbcon_font_desc.width into d6 */
 	subql	#1,%d6
 
-console_do_font_scanline:
+L(console_do_font_scanline):
 	lslb	#1,%d3
 	scsb	%d2		/* convert 1 bit into a byte */
-	jbsr	console_plot_pixel
+	console_plot_pixel %d0,%d1,%d2
 	addq	#1,%d0
-	dbra	%d6,console_do_font_scanline
+	dbra	%d6,L(console_do_font_scanline)
 
 		/* ASSERT: a0 = contents of Lconsole_font */
 	subl	%a0@(FONT_DESC_WIDTH),%d0
 	addq	#1,%d1
-	dbra	%d7,console_read_char_scanline
-
-console_exit:
+	dbra	%d7,L(console_read_char_scanline)
 
+L(console_exit):
 func_return	console_putc
 
-console_plot_pixel:
 	/*
 	 *	Input:
 	 *		d0 = x coordinate
@@ -3670,14 +3676,14 @@
 	 *		d2 = (bit 0) 1/0 for white/black (!)
 	 *	All registers are preserved
 	 */
-	moveml	%a0-%a1/%d0-%d4,%sp@-
+func_start	console_plot_pixel,%a0-%a1/%d0-%d4
 
-	lea	%pc@(L(mac_videobase)),%a0
-	movel	%a0@,%a1
-	lea	%pc@(L(mac_videodepth)),%a0
-	movel	%a0@,%d3
-	lea	%pc@(L(mac_rowbytes)),%a0
-	mulul	%a0@,%d1
+	movel	%pc@(L(mac_videobase)),%a1
+	movel	%pc@(L(mac_videodepth)),%d3
+	movel	ARG1,%d0
+	movel	ARG2,%d1
+	mulul	%pc@(L(mac_rowbytes)),%d1
+	movel	ARG3,%d2
 
 	/*
 	 *	Register usage:
@@ -3686,13 +3692,10 @@
 	 *		d2 = black or white (0/1)
 	 *		d3 = video depth
 	 *		d4 = temp of x (d0) for many bit depths
-	 *		d5 = unused
-	 *		d6 = unused
-	 *		d7 = unused
 	 */
-test_1bit:
+L(test_1bit):
 	cmpb	#1,%d3
-	jbne	test_2bit
+	jbne	L(test_2bit)
 	movel	%d0,%d4		/* we need the low order 3 bits! */
 	divul	#8,%d0
 	addal	%d0,%a1
@@ -3700,16 +3703,16 @@
 	andb	#7,%d4
 	eorb	#7,%d4		/* reverse the x-coordinate w/ screen-bit # */
 	andb	#1,%d2
-	jbne	white_1
+	jbne	L(white_1)
 	bsetb	%d4,%a1@
-	jbra	console_plot_pixel_exit
-white_1:
+	jbra	L(console_plot_pixel_exit)
+L(white_1):
 	bclrb	%d4,%a1@
-	jbra	console_plot_pixel_exit
+	jbra	L(console_plot_pixel_exit)
 
-test_2bit:
+L(test_2bit):
 	cmpb	#2,%d3
-	jbne	test_4bit
+	jbne	L(test_4bit)
 	movel	%d0,%d4		/* we need the low order 2 bits! */
 	divul	#4,%d0
 	addal	%d0,%a1
@@ -3718,20 +3721,20 @@
 	eorb	#3,%d4		/* reverse the x-coordinate w/ screen-bit # */
 	lsll	#1,%d4		/* ! */
 	andb	#1,%d2
-	jbne	white_2
+	jbne	L(white_2)
 	bsetb	%d4,%a1@
 	addq	#1,%d4
 	bsetb	%d4,%a1@
-	jbra	console_plot_pixel_exit
-white_2:
+	jbra	L(console_plot_pixel_exit)
+L(white_2):
 	bclrb	%d4,%a1@
 	addq	#1,%d4
 	bclrb	%d4,%a1@
-	jbra	console_plot_pixel_exit
+	jbra	L(console_plot_pixel_exit)
 
-test_4bit:
+L(test_4bit):
 	cmpb	#4,%d3
-	jbne	test_8bit
+	jbne	L(test_8bit)
 	movel	%d0,%d4		/* we need the low order bit! */
 	divul	#2,%d0
 	addal	%d0,%a1
@@ -3740,7 +3743,7 @@
 	eorb	#1,%d4
 	lsll	#2,%d4		/* ! */
 	andb	#1,%d2
-	jbne	white_4
+	jbne	L(white_4)
 	bsetb	%d4,%a1@
 	addq	#1,%d4
 	bsetb	%d4,%a1@
@@ -3748,8 +3751,8 @@
 	bsetb	%d4,%a1@
 	addq	#1,%d4
 	bsetb	%d4,%a1@
-	jbra	console_plot_pixel_exit
-white_4:
+	jbra	L(console_plot_pixel_exit)
+L(white_4):
 	bclrb	%d4,%a1@
 	addq	#1,%d4
 	bclrb	%d4,%a1@
@@ -3757,38 +3760,37 @@
 	bclrb	%d4,%a1@
 	addq	#1,%d4
 	bclrb	%d4,%a1@
-	jbra	console_plot_pixel_exit
+	jbra	L(console_plot_pixel_exit)
 
-test_8bit:
+L(test_8bit):
 	cmpb	#8,%d3
-	jbne	test_16bit
+	jbne	L(test_16bit)
 	addal	%d0,%a1
 	addal	%d1,%a1
 	andb	#1,%d2
-	jbne	white_8
+	jbne	L(white_8)
 	moveb	#0xff,%a1@
-	jbra	console_plot_pixel_exit
-white_8:
+	jbra	L(console_plot_pixel_exit)
+L(white_8):
 	clrb	%a1@
-	jbra	console_plot_pixel_exit
+	jbra	L(console_plot_pixel_exit)
 
-test_16bit:
+L(test_16bit):
 	cmpb	#16,%d3
-	jbne	console_plot_pixel_exit
+	jbne	L(console_plot_pixel_exit)
 	addal	%d0,%a1
 	addal	%d0,%a1
 	addal	%d1,%a1
 	andb	#1,%d2
-	jbne	white_16
+	jbne	L(white_16)
 	clrw	%a1@
-	jbra	console_plot_pixel_exit
-white_16:
+	jbra	L(console_plot_pixel_exit)
+L(white_16):
 	movew	#0x0fff,%a1@
-	jbra	console_plot_pixel_exit
+	jbra	L(console_plot_pixel_exit)
 
-console_plot_pixel_exit:
-	moveml	%sp@+,%a0-%a1/%d0-%d4
-	rts
+L(console_plot_pixel_exit):
+func_return	console_plot_pixel
 #endif /* CONSOLE */
 
 #if 0
@@ -3838,11 +3840,6 @@
 	.long 0
 #endif
 
-#ifdef CONFIG_MAC
-L(console_video_virtual):
-	.long	0
-#endif	/* CONFIG_MAC */
-
 #if defined(CONSOLE)
 L(console_globals):
 	.long	0		/* cursor column */
@@ -3853,6 +3850,8 @@
 	.long	0		/* mac putc */
 L(console_font):
 	.long	0		/* pointer to console font (struct font_desc) */
+L(console_font_data):
+	.long	0		/* pointer to console font data */
 #endif /* CONSOLE */
 
 #if defined(MMU_PRINT)
@@ -3941,7 +3940,7 @@
 #endif
 #if defined(CONFIG_Q40)
 q40_mem_cptr:
-	.long 0
-L(q40_do_debug):	
-	.long 0	
+	.long	0
+L(q40_do_debug):
+	.long	0
 #endif
diff -Nru a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c
--- a/arch/m68k/kernel/traps.c	Tue Feb  3 19:45:43 2004
+++ b/arch/m68k/kernel/traps.c	Tue Feb  3 19:45:43 2004
@@ -447,7 +447,7 @@
 
 /* sun3 version of bus_error030 */
 
-extern inline void bus_error030 (struct frame *fp)
+static inline void bus_error030 (struct frame *fp)
 {
 	unsigned char buserr_type = sun3_get_buserr ();
 	unsigned long addr, errorcode;
@@ -583,12 +583,9 @@
 	unsigned short mmusr;
 	unsigned long addr, errorcode;
 	unsigned short ssw = fp->un.fmtb.ssw;
-	int user_space_fault = 1;
 #if DEBUG
 	unsigned long desc;
-#endif
 
-#if DEBUG
 	printk ("pid = %x  ", current->pid);
 	printk ("SSW=%#06x  ", ssw);
 
@@ -605,128 +602,116 @@
 			space_names[ssw & DFC], fp->ptregs.pc);
 #endif
 
-	if (fp->ptregs.sr & PS_S) {
-		/* kernel fault must be a data fault to user space */
-		if (! ((ssw & DF) && ((ssw & DFC) == USER_DATA))) {
-			/* instruction fault or kernel data fault! */
-			if (ssw & (FC | FB))
-				printk ("Instruction fault at %#010lx\n",
-					fp->ptregs.pc);
-			if (ssw & DF) {
-				printk ("Data %s fault at %#010lx in %s (pc=%#lx)\n",
-					ssw & RW ? "read" : "write",
-					fp->un.fmtb.daddr,
-					space_names[ssw & DFC], fp->ptregs.pc);
-			}
-			printk ("BAD KERNEL BUSERR\n");
-			die_if_kernel("Oops",&fp->ptregs,0);
-			force_sig(SIGKILL, current);
-			return;
-		}
-	} else {
-		/* user fault */
-		if (!(ssw & (FC | FB)) && !(ssw & DF))
-			/* not an instruction fault or data fault! BAD */
-			panic ("USER BUSERR w/o instruction or data fault");
-		user_space_fault = 1;
-#if DEBUG
-		printk("User space bus-error\n");
-#endif
-	}
-
 	/* ++andreas: If a data fault and an instruction fault happen
 	   at the same time map in both pages.  */
 
 	/* First handle the data fault, if any.  */
-	if (ssw & DF)
-	  {
-	    addr = fp->un.fmtb.daddr;
+	if (ssw & DF) {
+		addr = fp->un.fmtb.daddr;
 
-	    mmusr = MMU_I;
-	    if (user_space_fault) {
 #if DEBUG
-		    asm volatile ("ptestr #1,%2@,#7,%0\n\t"
-				  "pmove %/psr,%1@"
-				  : "=a&" (desc)
-				  : "a" (&temp), "a" (addr));
+		asm volatile ("ptestr %3,%2@,#7,%0\n\t"
+			      "pmove %%psr,%1@"
+			      : "=a&" (desc)
+			      : "a" (&temp), "a" (addr), "d" (ssw));
 #else
-		    asm volatile ("ptestr #1,%1@,#7\n\t"
-				  "pmove %/psr,%0@"
-				  : : "a" (&temp), "a" (addr));
-#endif
-		    mmusr = temp;
-	    }
-      
-#if DEBUG
-	    printk ("mmusr is %#x for addr %#lx in task %p\n",
-		    mmusr, addr, current);
-	    printk ("descriptor address is %#lx, contents %#lx\n",
-		    __va(desc), *(unsigned long *)__va(desc));
+		asm volatile ("ptestr %2,%1@,#7\n\t"
+			      "pmove %%psr,%0@"
+			      : : "a" (&temp), "a" (addr), "d" (ssw));
 #endif
+		mmusr = temp;
 
-	    errorcode = (mmusr & MMU_I) ? 0 : 1;
-	    if (!(ssw & RW) || (ssw & RM))
-		    errorcode |= 2;
-
-	    if (mmusr & (MMU_I | MMU_WP)) {
-		/* Don't try to do anything further if an exception was
-		   handled. */
-		if (do_page_fault (&fp->ptregs, addr, errorcode) < 0)
+#if DEBUG
+		printk("mmusr is %#x for addr %#lx in task %p\n",
+		       mmusr, addr, current);
+		printk("descriptor address is %#lx, contents %#lx\n",
+		       __va(desc), *(unsigned long *)__va(desc));
+#endif
+
+		errorcode = (mmusr & MMU_I) ? 0 : 1;
+		if (!(ssw & RW) || (ssw & RM))
+			errorcode |= 2;
+
+		if (mmusr & (MMU_I | MMU_WP)) {
+			if (ssw & 4) {
+				printk("Data %s fault at %#010lx in %s (pc=%#lx)\n",
+				       ssw & RW ? "read" : "write",
+				       fp->un.fmtb.daddr,
+				       space_names[ssw & DFC], fp->ptregs.pc);
+				goto buserr;
+			}
+			/* Don't try to do anything further if an exception was
+			   handled. */
+			if (do_page_fault (&fp->ptregs, addr, errorcode) < 0)
+				return;
+		} else if (!(mmusr & MMU_I)) {
+			/* propably a 020 cas fault */
+			if (!(ssw & RM))
+				printk("unexpected bus error (%#x,%#x)\n", ssw, mmusr);
+		} else if (mmusr & (MMU_B|MMU_L|MMU_S)) {
+			printk("invalid %s access at %#lx from pc %#lx\n",
+			       !(ssw & RW) ? "write" : "read", addr,
+			       fp->ptregs.pc);
+			die_if_kernel("Oops",&fp->ptregs,mmusr);
+			force_sig(SIGSEGV, current);
 			return;
-	    } else if (mmusr & (MMU_B|MMU_L|MMU_S)) {
-		    printk ("invalid %s access at %#lx from pc %#lx\n",
-			    !(ssw & RW) ? "write" : "read", addr,
-			    fp->ptregs.pc);
-		    die_if_kernel("Oops",&fp->ptregs,mmusr);
-		    force_sig(SIGSEGV, current);
-		    return;
-	    } else {
+		} else {
 #if 0
-		    static volatile long tlong;
+			static volatile long tlong;
 #endif
 
-		    printk ("weird %s access at %#lx from pc %#lx (ssw is %#x)\n",
-			    !(ssw & RW) ? "write" : "read", addr,
-			    fp->ptregs.pc, ssw);
-		    asm volatile ("ptestr #1,%1@,#0\n\t"
-				  "pmove %/psr,%0@"
-				  : /* no outputs */
-				  : "a" (&temp), "a" (addr));
-		    mmusr = temp;
+			printk("weird %s access at %#lx from pc %#lx (ssw is %#x)\n",
+			       !(ssw & RW) ? "write" : "read", addr,
+			       fp->ptregs.pc, ssw);
+			asm volatile ("ptestr #1,%1@,#0\n\t"
+				      "pmove %%psr,%0@"
+				      : /* no outputs */
+				      : "a" (&temp), "a" (addr));
+			mmusr = temp;
 
-		    printk ("level 0 mmusr is %#x\n", mmusr);
+			printk ("level 0 mmusr is %#x\n", mmusr);
 #if 0
-		    asm volatile ("pmove %/tt0,%0@"
-				  : /* no outputs */
-				  : "a" (&tlong));
-		    printk ("tt0 is %#lx, ", tlong);
-		    asm volatile ("pmove %/tt1,%0@"
-				  : /* no outputs */
-				  : "a" (&tlong));
-		    printk ("tt1 is %#lx\n", tlong);
+			asm volatile ("pmove %%tt0,%0@"
+				      : /* no outputs */
+				      : "a" (&tlong));
+			printk("tt0 is %#lx, ", tlong);
+			asm volatile ("pmove %%tt1,%0@"
+				      : /* no outputs */
+				      : "a" (&tlong));
+			printk("tt1 is %#lx\n", tlong);
 #endif
 #if DEBUG
-		    printk("Unknown SIGSEGV - 1\n");
+			printk("Unknown SIGSEGV - 1\n");
 #endif
-		    die_if_kernel("Oops",&fp->ptregs,mmusr);
-		    force_sig(SIGSEGV, current);
-		    return;
-	    }
-
-	    /* setup an ATC entry for the access about to be retried */
-	    if (!(ssw & RW))
-		    asm volatile ("ploadw %1,%0@" : /* no outputs */
-				  : "a" (addr), "d" (ssw));
-	    else
-		    asm volatile ("ploadr %1,%0@" : /* no outputs */
-				  : "a" (addr), "d" (ssw));
-	  }
+			die_if_kernel("Oops",&fp->ptregs,mmusr);
+			force_sig(SIGSEGV, current);
+			return;
+		}
+
+		/* setup an ATC entry for the access about to be retried */
+		if (!(ssw & RW) || (ssw & RM))
+			asm volatile ("ploadw %1,%0@" : /* no outputs */
+				      : "a" (addr), "d" (ssw));
+		else
+			asm volatile ("ploadr %1,%0@" : /* no outputs */
+				      : "a" (addr), "d" (ssw));
+	}
 
 	/* Now handle the instruction fault. */
 
 	if (!(ssw & (FC|FB)))
 		return;
 
+	if (fp->ptregs.sr & PS_S) {
+		printk("Instruction fault at %#010lx\n",
+			fp->ptregs.pc);
+	buserr:
+		printk ("BAD KERNEL BUSERR\n");
+		die_if_kernel("Oops",&fp->ptregs,0);
+		force_sig(SIGKILL, current);
+		return;
+	}
+
 	/* get the fault address */
 	if (fp->ptregs.format == 10)
 		addr = fp->ptregs.pc + 4;
@@ -740,21 +725,18 @@
 		   should still create the ATC entry.  */
 		goto create_atc_entry;
 
-	mmusr = MMU_I;
-	if (user_space_fault) {
 #if DEBUG
-		asm volatile ("ptestr #1,%2@,#7,%0\n\t"
-			      "pmove %/psr,%1@"
-			      : "=a&" (desc)
-			      : "a" (&temp), "a" (addr));
+	asm volatile ("ptestr #1,%2@,#7,%0\n\t"
+		      "pmove %%psr,%1@"
+		      : "=a&" (desc)
+		      : "a" (&temp), "a" (addr));
 #else
-		asm volatile ("ptestr #1,%1@,#7\n\t"
-			      "pmove %/psr,%0@"
-			      : : "a" (&temp), "a" (addr));
+	asm volatile ("ptestr #1,%1@,#7\n\t"
+		      "pmove %%psr,%0@"
+		      : : "a" (&temp), "a" (addr));
 #endif
-		mmusr = temp;
-	}
-      
+	mmusr = temp;
+
 #ifdef DEBUG
 	printk ("mmusr is %#x for addr %#lx in task %p\n",
 		mmusr, addr, current);
diff -Nru a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
--- a/arch/m68k/mac/config.c	Tue Feb  3 19:45:17 2004
+++ b/arch/m68k/mac/config.c	Tue Feb  3 19:45:17 2004
@@ -11,6 +11,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
@@ -267,6 +268,7 @@
  */
  
 struct mac_model *macintosh_config;
+EXPORT_SYMBOL(macintosh_config);
 
 static struct mac_model mac_data_table[]=
 {
diff -Nru a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c
--- a/arch/m68k/mac/misc.c	Tue Feb  3 19:45:28 2004
+++ b/arch/m68k/mac/misc.c	Tue Feb  3 19:45:28 2004
@@ -39,6 +39,7 @@
 extern struct mac_booter_data mac_bi_data;
 static void (*rom_reset)(void);
 
+#ifdef CONFIG_ADB
 /*
  * Return the current time as the number of seconds since January 1, 1904.
  */
@@ -103,6 +104,7 @@
 			(offset >> 8) & 0xFF, offset & 0xFF,
 			data);
 }
+#endif /* CONFIG_ADB */
 
 /*
  * VIA PRAM/RTC access routines
@@ -356,7 +358,11 @@
 	    macintosh_config->adb_type == MAC_ADB_PB1 ||
 	    macintosh_config->adb_type == MAC_ADB_PB2 ||
 	    macintosh_config->adb_type == MAC_ADB_CUDA) {
+#ifdef CONFIG_ADB
 		func = adb_read_pram;
+#else
+		return;
+#endif
 	} else {
 		func = via_read_pram;
 	}
@@ -374,7 +380,11 @@
 	    macintosh_config->adb_type == MAC_ADB_PB1 ||
 	    macintosh_config->adb_type == MAC_ADB_PB2 ||
 	    macintosh_config->adb_type == MAC_ADB_CUDA) {
+#ifdef CONFIG_ADB
 		func = adb_write_pram;
+#else
+		return;
+#endif
 	} else {
 		func = via_write_pram;
 	}
@@ -580,12 +590,16 @@
 	if (!op) { /* read */
 		if (macintosh_config->adb_type == MAC_ADB_II) {
 			now = via_read_time();
-		} else if ((macintosh_config->adb_type == MAC_ADB_IISI) ||
+		} else
+#ifdef CONFIG_ADB
+		if ((macintosh_config->adb_type == MAC_ADB_IISI) ||
 			   (macintosh_config->adb_type == MAC_ADB_PB1) ||
 			   (macintosh_config->adb_type == MAC_ADB_PB2) ||
 			   (macintosh_config->adb_type == MAC_ADB_CUDA)) {
 			now = adb_read_time();
-		} else if (macintosh_config->adb_type == MAC_ADB_IOP) {
+		} else
+#endif
+		if (macintosh_config->adb_type == MAC_ADB_IOP) {
 			now = via_read_time();
 		} else {
 			now = 0;
diff -Nru a/arch/m68k/math-emu/fp_arith.c b/arch/m68k/math-emu/fp_arith.c
--- a/arch/m68k/math-emu/fp_arith.c	Tue Feb  3 19:45:17 2004
+++ b/arch/m68k/math-emu/fp_arith.c	Tue Feb  3 19:45:17 2004
@@ -19,12 +19,13 @@
 
 const struct fp_ext fp_QNaN =
 {
-	0, 0, 0x7fff, { ~0 }
+	.exp = 0x7fff,
+	.mant = { .m64 = ~0 }
 };
 
 const struct fp_ext fp_Inf =
 {
-	0, 0, 0x7fff, { 0 }
+	.exp = 0x7fff,
 };
 
 /* let's start with the easy ones */
diff -Nru a/arch/m68k/math-emu/fp_log.c b/arch/m68k/math-emu/fp_log.c
--- a/arch/m68k/math-emu/fp_log.c	Tue Feb  3 19:45:43 2004
+++ b/arch/m68k/math-emu/fp_log.c	Tue Feb  3 19:45:43 2004
@@ -19,7 +19,7 @@
 
 static const struct fp_ext fp_one =
 {
-	0, 0, 0x3fff, { 0 }
+	.exp = 0x3fff,
 };
 
 extern struct fp_ext *fp_fadd(struct fp_ext *dest, const struct fp_ext *src);
diff -Nru a/arch/m68k/math-emu/multi_arith.h b/arch/m68k/math-emu/multi_arith.h
--- a/arch/m68k/math-emu/multi_arith.h	Tue Feb  3 19:45:17 2004
+++ b/arch/m68k/math-emu/multi_arith.h	Tue Feb  3 19:45:17 2004
@@ -38,17 +38,14 @@
 
 /* Convenience functions to stuff various integer values into int128s */
 
-extern inline void zero128(int128 a)
+static inline void zero128(int128 a)
 {
 	a[LSW128] = a[NLSW128] = a[NMSW128] = a[MSW128] = 0;
 }
 
 /* Human-readable word order in the arguments */
-extern inline void set128(unsigned int i3,
-			  unsigned int i2,
-			  unsigned int i1,
-			  unsigned int i0,
-			  int128 a)
+static inline void set128(unsigned int i3, unsigned int i2, unsigned int i1,
+			  unsigned int i0, int128 a)
 {
 	a[LSW128] = i0;
 	a[NLSW128] = i1;
@@ -57,21 +54,19 @@
 }
 
 /* Convenience functions (for testing as well) */
-extern inline void int64_to_128(unsigned long long src,
-				int128 dest)
+static inline void int64_to_128(unsigned long long src, int128 dest)
 {
 	dest[LSW128] = (unsigned int) src;
 	dest[NLSW128] = src >> 32;
 	dest[NMSW128] = dest[MSW128] = 0;
 }
 
-extern inline void int128_to_64(const int128 src,
-				unsigned long long *dest)
+static inline void int128_to_64(const int128 src, unsigned long long *dest)
 {
 	*dest = src[LSW128] | (long long) src[NLSW128] << 32;
 }
 
-extern inline void put_i128(const int128 a)
+static inline void put_i128(const int128 a)
 {
 	printk("%08x %08x %08x %08x\n", a[MSW128], a[NMSW128],
 	       a[NLSW128], a[LSW128]);
@@ -82,7 +77,7 @@
    Note that these are only good for 0 < count < 32.
  */
 
-extern inline void _lsl128(unsigned int count, int128 a)
+static inline void _lsl128(unsigned int count, int128 a)
 {
 	a[MSW128] = (a[MSW128] << count) | (a[NMSW128] >> (32 - count));
 	a[NMSW128] = (a[NMSW128] << count) | (a[NLSW128] >> (32 - count));
@@ -90,7 +85,7 @@
 	a[LSW128] <<= count;
 }
 
-extern inline void _lsr128(unsigned int count, int128 a)
+static inline void _lsr128(unsigned int count, int128 a)
 {
 	a[LSW128] = (a[LSW128] >> count) | (a[NLSW128] << (32 - count));
 	a[NLSW128] = (a[NLSW128] >> count) | (a[NMSW128] << (32 - count));
@@ -100,7 +95,7 @@
 
 /* Should be faster, one would hope */
 
-extern inline void lslone128(int128 a)
+static inline void lslone128(int128 a)
 {
 	asm volatile ("lsl.l #1,%0\n"
 		      "roxl.l #1,%1\n"
@@ -118,7 +113,7 @@
 		      "3"(a[MSW128]));
 }
 
-extern inline void lsrone128(int128 a)
+static inline void lsrone128(int128 a)
 {
 	asm volatile ("lsr.l #1,%0\n"
 		      "roxr.l #1,%1\n"
@@ -140,7 +135,7 @@
 
    These bit-shift to a multiple of 32, then move whole longwords.  */
 
-extern inline void lsl128(unsigned int count, int128 a)
+static inline void lsl128(unsigned int count, int128 a)
 {
 	int wordcount, i;
 
@@ -159,7 +154,7 @@
 	}
 }
 
-extern inline void lsr128(unsigned int count, int128 a)
+static inline void lsr128(unsigned int count, int128 a)
 {
 	int wordcount, i;
 
@@ -177,18 +172,18 @@
 	}
 }
 
-extern inline int orl128(int a, int128 b)
+static inline int orl128(int a, int128 b)
 {
 	b[LSW128] |= a;
 }
 
-extern inline int btsthi128(const int128 a)
+static inline int btsthi128(const int128 a)
 {
 	return a[MSW128] & 0x80000000;
 }
 
 /* test bits (numbered from 0 = LSB) up to and including "top" */
-extern inline int bftestlo128(int top, const int128 a)
+static inline int bftestlo128(int top, const int128 a)
 {
 	int r = 0;
 
@@ -206,7 +201,7 @@
 
 /* Aargh.  We need these because GCC is broken */
 /* FIXME: do them in assembly, for goodness' sake! */
-extern inline void mask64(int pos, unsigned long long *mask)
+static inline void mask64(int pos, unsigned long long *mask)
 {
 	*mask = 0;
 
@@ -218,7 +213,7 @@
 	HI_WORD(*mask) = (1 << (pos - 32)) - 1;
 }
 
-extern inline void bset64(int pos, unsigned long long *dest)
+static inline void bset64(int pos, unsigned long long *dest)
 {
 	/* This conditional will be optimized away.  Thanks, GCC! */
 	if (pos < 32)
@@ -229,7 +224,7 @@
 			      (HI_WORD(*dest)):"id"(pos - 32));
 }
 
-extern inline int btst64(int pos, unsigned long long dest)
+static inline int btst64(int pos, unsigned long long dest)
 {
 	if (pos < 32)
 		return (0 != (LO_WORD(dest) & (1 << pos)));
@@ -237,7 +232,7 @@
 		return (0 != (HI_WORD(dest) & (1 << (pos - 32))));
 }
 
-extern inline void lsl64(int count, unsigned long long *dest)
+static inline void lsl64(int count, unsigned long long *dest)
 {
 	if (count < 32) {
 		HI_WORD(*dest) = (HI_WORD(*dest) << count)
@@ -250,7 +245,7 @@
 	LO_WORD(*dest) = 0;
 }
 
-extern inline void lsr64(int count, unsigned long long *dest)
+static inline void lsr64(int count, unsigned long long *dest)
 {
 	if (count < 32) {
 		LO_WORD(*dest) = (LO_WORD(*dest) >> count)
@@ -264,7 +259,7 @@
 }
 #endif
 
-extern inline void fp_denormalize(struct fp_ext *reg, unsigned int cnt)
+static inline void fp_denormalize(struct fp_ext *reg, unsigned int cnt)
 {
 	reg->exp += cnt;
 
@@ -306,7 +301,7 @@
 	}
 }
 
-extern inline int fp_overnormalize(struct fp_ext *reg)
+static inline int fp_overnormalize(struct fp_ext *reg)
 {
 	int shift;
 
@@ -324,7 +319,7 @@
 	return shift;
 }
 
-extern inline int fp_addmant(struct fp_ext *dest, struct fp_ext *src)
+static inline int fp_addmant(struct fp_ext *dest, struct fp_ext *src)
 {
 	int carry;
 
@@ -340,7 +335,7 @@
 	return carry;
 }
 
-extern inline int fp_addcarry(struct fp_ext *reg)
+static inline int fp_addcarry(struct fp_ext *reg)
 {
 	if (++reg->exp == 0x7fff) {
 		if (reg->mant.m64)
@@ -357,7 +352,8 @@
 	return 1;
 }
 
-extern inline void fp_submant(struct fp_ext *dest, struct fp_ext *src1, struct fp_ext *src2)
+static inline void fp_submant(struct fp_ext *dest, struct fp_ext *src1,
+			      struct fp_ext *src2)
 {
 	/* we assume here, gcc only insert move and a clr instr */
 	asm volatile ("sub.b %1,%0" : "=d,g" (dest->lowmant)
@@ -407,7 +403,8 @@
 	carry;								\
 })
 
-extern inline void fp_multiplymant(union fp_mant128 *dest, struct fp_ext *src1, struct fp_ext *src2)
+static inline void fp_multiplymant(union fp_mant128 *dest, struct fp_ext *src1,
+				   struct fp_ext *src2)
 {
 	union fp_mant64 temp;
 
@@ -421,7 +418,8 @@
 	fp_addx96(dest, temp);
 }
 
-extern inline void fp_dividemant(union fp_mant128 *dest, struct fp_ext *src, struct fp_ext *div)
+static inline void fp_dividemant(union fp_mant128 *dest, struct fp_ext *src,
+				 struct fp_ext *div)
 {
 	union fp_mant128 tmp;
 	union fp_mant64 tmp64;
@@ -484,7 +482,7 @@
 }
 
 #if 0
-extern inline unsigned int fp_fls128(union fp_mant128 *src)
+static inline unsigned int fp_fls128(union fp_mant128 *src)
 {
 	unsigned long data;
 	unsigned int res, off;
@@ -504,7 +502,7 @@
 	return res + off;
 }
 
-extern inline void fp_shiftmant128(union fp_mant128 *src, int shift)
+static inline void fp_shiftmant128(union fp_mant128 *src, int shift)
 {
 	unsigned long sticky;
 
@@ -594,7 +592,8 @@
 }
 #endif
 
-extern inline void fp_putmant128(struct fp_ext *dest, union fp_mant128 *src, int shift)
+static inline void fp_putmant128(struct fp_ext *dest, union fp_mant128 *src,
+				 int shift)
 {
 	unsigned long tmp;
 
@@ -639,7 +638,7 @@
 }
 
 #if 0 /* old code... */
-extern inline int fls(unsigned int a)
+static inline int fls(unsigned int a)
 {
 	int r;
 
@@ -649,7 +648,7 @@
 }
 
 /* fls = "find last set" (cf. ffs(3)) */
-extern inline int fls128(const int128 a)
+static inline int fls128(const int128 a)
 {
 	if (a[MSW128])
 		return fls(a[MSW128]);
@@ -668,12 +667,12 @@
 		return -1;
 }
 
-extern inline int zerop128(const int128 a)
+static inline int zerop128(const int128 a)
 {
 	return !(a[LSW128] | a[NLSW128] | a[NMSW128] | a[MSW128]);
 }
 
-extern inline int nonzerop128(const int128 a)
+static inline int nonzerop128(const int128 a)
 {
 	return (a[LSW128] | a[NLSW128] | a[NMSW128] | a[MSW128]);
 }
@@ -681,7 +680,7 @@
 /* Addition and subtraction */
 /* Do these in "pure" assembly, because "extended" asm is unmanageable
    here */
-extern inline void add128(const int128 a, int128 b)
+static inline void add128(const int128 a, int128 b)
 {
 	/* rotating carry flags */
 	unsigned int carry[2];
@@ -699,7 +698,7 @@
 }
 
 /* Note: assembler semantics: "b -= a" */
-extern inline void sub128(const int128 a, int128 b)
+static inline void sub128(const int128 a, int128 b)
 {
 	/* rotating borrow flags */
 	unsigned int borrow[2];
@@ -717,9 +716,7 @@
 }
 
 /* Poor man's 64-bit expanding multiply */
-extern inline void mul64(unsigned long long a,
-		  unsigned long long b,
-		  int128 c)
+static inline void mul64(unsigned long long a, unsigned long long b, int128 c)
 {
 	unsigned long long acc;
 	int128 acc128;
@@ -756,7 +753,7 @@
 }
 
 /* Note: unsigned */
-extern inline int cmp128(int128 a, int128 b)
+static inline int cmp128(int128 a, int128 b)
 {
 	if (a[MSW128] < b[MSW128])
 		return -1;
diff -Nru a/arch/m68k/mm/Makefile b/arch/m68k/mm/Makefile
--- a/arch/m68k/mm/Makefile	Tue Feb  3 19:45:17 2004
+++ b/arch/m68k/mm/Makefile	Tue Feb  3 19:45:17 2004
@@ -2,7 +2,7 @@
 # Makefile for the linux m68k-specific parts of the memory manager.
 #
 
-obj-y		:= init.o fault.o extable.o hwtest.o
+obj-y		:= init.o fault.o hwtest.o
 
 ifndef CONFIG_SUN3
 obj-y		+= kmap.o memory.o motorola.o
diff -Nru a/arch/m68k/mm/extable.c b/arch/m68k/mm/extable.c
--- a/arch/m68k/mm/extable.c	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,33 +0,0 @@
-/*
- * linux/arch/m68k/mm/extable.c
- */
-
-#include <linux/config.h>
-#include <linux/module.h>
-#include <asm/uaccess.h>
-
-extern const struct exception_table_entry __start___ex_table[];
-extern const struct exception_table_entry __stop___ex_table[];
-
-/* Simple binary search */
-const struct exception_table_entry *
-search_extable(const struct exception_table_entry *first,
-	       const struct exception_table_entry *last,
-	       unsigned long value)
-{
-        while (first <= last) {
-		const struct exception_table_entry *mid;
-		long diff;
-
-		mid = (last - first) / 2 + first;
-		diff = value - mid->insn;
-		if (diff >= 0 && diff <= 2)
-			return mid;
-		else if (diff > 0)
-			first = mid+1;
-		else
-			last = mid-1;
-	}
-	return NULL;
-}
-
diff -Nru a/arch/m68k/mm/hwtest.c b/arch/m68k/mm/hwtest.c
--- a/arch/m68k/mm/hwtest.c	Tue Feb  3 19:45:42 2004
+++ b/arch/m68k/mm/hwtest.c	Tue Feb  3 19:45:42 2004
@@ -23,6 +23,8 @@
  * a temporary VBR and a vector table for the duration of the test.
  */
 
+#include <linux/module.h>
+
 int hwreg_present( volatile void *regp )
 {
     int	ret = 0;
@@ -47,6 +49,7 @@
 
     return( ret );
 }
+EXPORT_SYMBOL(hwreg_present);
   
 /* Basically the same, but writes a value into a word register, protected
  * by a bus error handler. Returns 1 if successful, 0 otherwise.
@@ -78,4 +81,5 @@
 
 	return( ret );
 }
+EXPORT_SYMBOL(hwreg_write);
 
diff -Nru a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
--- a/arch/m68k/mm/motorola.c	Tue Feb  3 19:45:29 2004
+++ b/arch/m68k/mm/motorola.c	Tue Feb  3 19:45:29 2004
@@ -9,6 +9,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
@@ -40,6 +41,7 @@
  * For 68040, this is _PAGE_CACHE040 (cachable, copyback)
  */
 unsigned long mm_cachebits = 0;
+EXPORT_SYMBOL(mm_cachebits);
 #endif
 
 static pte_t * __init kernel_page_table(void)
diff -Nru a/arch/m68k/mvme16x/rtc.c b/arch/m68k/mvme16x/rtc.c
--- a/arch/m68k/mvme16x/rtc.c	Tue Feb  3 19:45:43 2004
+++ b/arch/m68k/mvme16x/rtc.c	Tue Feb  3 19:45:43 2004
@@ -51,6 +51,7 @@
 		local_irq_save(flags);
 		/* Ensure clock and real-time-mode-register are accessible */
 		rtc->ctrl = RTC_READ;
+		memset(&wtime, 0, sizeof(struct rtc_time));
 		wtime.tm_sec =  BCD2BIN(rtc->bcd_sec);
 		wtime.tm_min =  BCD2BIN(rtc->bcd_min);
 		wtime.tm_hour = BCD2BIN(rtc->bcd_hr);
@@ -155,9 +156,9 @@
 
 static struct miscdevice rtc_dev=
 {
-	RTC_MINOR,
-	"rtc",
-	&rtc_fops
+	.minor =	RTC_MINOR,
+	.name =		"rtc",
+	.fops =		&rtc_fops
 };
 
 int __init rtc_MK48T08_init(void)
diff -Nru a/arch/m68k/q40/q40ints.c b/arch/m68k/q40/q40ints.c
--- a/arch/m68k/q40/q40ints.c	Tue Feb  3 19:45:42 2004
+++ b/arch/m68k/q40/q40ints.c	Tue Feb  3 19:45:42 2004
@@ -281,21 +281,17 @@
   {Q40_IRQ_KEYB_MASK,Q40_IRQ_KEYBOARD},
   {0,0}};
 #endif
-static struct IRQ_TABLE eirqs[]={
-  {Q40_IRQ3_MASK,3},                   /* ser 1 */
-  {Q40_IRQ4_MASK,4},                   /* ser 2 */
-  {Q40_IRQ14_MASK,14},                 /* IDE 1 */
-  {Q40_IRQ15_MASK,15},                 /* IDE 2 */
-  {Q40_IRQ6_MASK,6},                   /* floppy, handled elsewhere */
-  {Q40_IRQ7_MASK,7},                   /* par */
-
-  {Q40_IRQ5_MASK,5},
-  {Q40_IRQ10_MASK,10},
-
-
-
-
-  {0,0}};
+static struct IRQ_TABLE eirqs[] = {
+  { .mask = Q40_IRQ3_MASK,	.irq = 3 },	/* ser 1 */
+  { .mask = Q40_IRQ4_MASK,	.irq = 4 },	/* ser 2 */
+  { .mask = Q40_IRQ14_MASK,	.irq = 14 },	/* IDE 1 */
+  { .mask = Q40_IRQ15_MASK,	.irq = 15 },	/* IDE 2 */
+  { .mask = Q40_IRQ6_MASK,	.irq = 6 },	/* floppy, handled elsewhere */
+  { .mask = Q40_IRQ7_MASK,	.irq = 7 },	/* par */
+  { .mask = Q40_IRQ5_MASK,	.irq = 5 },
+  { .mask = Q40_IRQ10_MASK,	.irq = 10 },
+  {0,0}
+};
 
 /* complain only this many times about spurious ints : */
 static int ccleirq=60;    /* ISA dev IRQ's*/
diff -Nru a/arch/m68k/sun3/idprom.c b/arch/m68k/sun3/idprom.c
--- a/arch/m68k/sun3/idprom.c	Tue Feb  3 19:45:17 2004
+++ b/arch/m68k/sun3/idprom.c	Tue Feb  3 19:45:17 2004
@@ -24,34 +24,34 @@
  */
 struct Sun_Machine_Models Sun_Machines[NUM_SUN_MACHINES] = {
 /* First, Sun3's */
-{ "Sun 3/160 Series", (SM_SUN3 | SM_3_160) },
-{ "Sun 3/50", (SM_SUN3 | SM_3_50) },
-{ "Sun 3/260 Series", (SM_SUN3 | SM_3_260) },
-{ "Sun 3/110 Series", (SM_SUN3 | SM_3_110) },
-{ "Sun 3/60", (SM_SUN3 | SM_3_60) },
-{ "Sun 3/E", (SM_SUN3 | SM_3_E) },
+    { .name = "Sun 3/160 Series",	.id_machtype = (SM_SUN3 | SM_3_160) },
+    { .name = "Sun 3/50",		.id_machtype = (SM_SUN3 | SM_3_50) },
+    { .name = "Sun 3/260 Series",	.id_machtype = (SM_SUN3 | SM_3_260) },
+    { .name = "Sun 3/110 Series",	.id_machtype = (SM_SUN3 | SM_3_110) },
+    { .name = "Sun 3/60",		.id_machtype = (SM_SUN3 | SM_3_60) },
+    { .name = "Sun 3/E",		.id_machtype = (SM_SUN3 | SM_3_E) },
 /* Now, Sun3x's */
-{ "Sun 3/460 Series", (SM_SUN3X | SM_3_460) },
-{ "Sun 3/80", (SM_SUN3X | SM_3_80) },
+    { .name = "Sun 3/460 Series",	.id_machtype = (SM_SUN3X | SM_3_460) },
+    { .name = "Sun 3/80",		.id_machtype = (SM_SUN3X | SM_3_80) },
 /* Then, Sun4's */
-//{ "Sun 4/100 Series", (SM_SUN4 | SM_4_110) },
-//{ "Sun 4/200 Series", (SM_SUN4 | SM_4_260) },
-//{ "Sun 4/300 Series", (SM_SUN4 | SM_4_330) },
-//{ "Sun 4/400 Series", (SM_SUN4 | SM_4_470) },
+// { .name = "Sun 4/100 Series",	.id_machtype = (SM_SUN4 | SM_4_110) },
+// { .name = "Sun 4/200 Series",	.id_machtype = (SM_SUN4 | SM_4_260) },
+// { .name = "Sun 4/300 Series",	.id_machtype = (SM_SUN4 | SM_4_330) },
+// { .name = "Sun 4/400 Series",	.id_machtype = (SM_SUN4 | SM_4_470) },
 /* And now, Sun4c's */
-//{ "Sun4c SparcStation 1", (SM_SUN4C | SM_4C_SS1) },
-//{ "Sun4c SparcStation IPC", (SM_SUN4C | SM_4C_IPC) },
-//{ "Sun4c SparcStation 1+", (SM_SUN4C | SM_4C_SS1PLUS) },
-//{ "Sun4c SparcStation SLC", (SM_SUN4C | SM_4C_SLC) },
-//{ "Sun4c SparcStation 2", (SM_SUN4C | SM_4C_SS2) },
-//{ "Sun4c SparcStation ELC", (SM_SUN4C | SM_4C_ELC) },
-//{ "Sun4c SparcStation IPX", (SM_SUN4C | SM_4C_IPX) },
+// { .name = "Sun4c SparcStation 1",	.id_machtype = (SM_SUN4C | SM_4C_SS1) },
+// { .name = "Sun4c SparcStation IPC",	.id_machtype = (SM_SUN4C | SM_4C_IPC) },
+// { .name = "Sun4c SparcStation 1+",	.id_machtype = (SM_SUN4C | SM_4C_SS1PLUS) },
+// { .name = "Sun4c SparcStation SLC",	.id_machtype = (SM_SUN4C | SM_4C_SLC) },
+// { .name = "Sun4c SparcStation 2",	.id_machtype = (SM_SUN4C | SM_4C_SS2) },
+// { .name = "Sun4c SparcStation ELC",	.id_machtype = (SM_SUN4C | SM_4C_ELC) },
+// { .name = "Sun4c SparcStation IPX",	.id_machtype = (SM_SUN4C | SM_4C_IPX) },
 /* Finally, early Sun4m's */
-//{ "Sun4m SparcSystem600", (SM_SUN4M | SM_4M_SS60) },
-//{ "Sun4m SparcStation10/20", (SM_SUN4M | SM_4M_SS50) },
-//{ "Sun4m SparcStation5", (SM_SUN4M | SM_4M_SS40) },
+// { .name = "Sun4m SparcSystem600",	.id_machtype = (SM_SUN4M | SM_4M_SS60) },
+// { .name = "Sun4m SparcStation10/20",	.id_machtype = (SM_SUN4M | SM_4M_SS50) },
+// { .name = "Sun4m SparcStation5",	.id_machtype = (SM_SUN4M | SM_4M_SS40) },
 /* One entry for the OBP arch's which are sun4d, sun4e, and newer sun4m's */
-//{ "Sun4M OBP based system", (SM_SUN4M_OBP | 0x0) }
+// { .name = "Sun4M OBP based system",	.id_machtype = (SM_SUN4M_OBP | 0x0) }
 };
 
 static void __init display_system_type(unsigned char machtype)
diff -Nru a/arch/m68knommu/kernel/Makefile b/arch/m68knommu/kernel/Makefile
--- a/arch/m68knommu/kernel/Makefile	Tue Feb  3 19:45:17 2004
+++ b/arch/m68knommu/kernel/Makefile	Tue Feb  3 19:45:17 2004
@@ -4,8 +4,8 @@
 
 extra-y := vmlinux.lds.s
 
-obj-y += entry.o init_task.o m68k_ksyms.o process.o ptrace.o \
-	 semaphore.o setup.o signal.o syscalltable.o sys_m68k.o time.o \
-	 traps.o
+obj-y += entry.o init_task.o m68k_ksyms.o process.o ptrace.o semaphore.o \
+	 setup.o signal.o syscalltable.o sys_m68k.o time.o traps.o
 
+obj-$(CONFIG_MODULES)	+= module.o
 obj-$(CONFIG_COMEMPCI)	+= comempci.o
diff -Nru a/arch/m68knommu/kernel/module.c b/arch/m68knommu/kernel/module.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/m68knommu/kernel/module.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,99 @@
+#include <linux/moduleloader.h>
+#include <linux/elf.h>
+#include <linux/vmalloc.h>
+#include <linux/fs.h>
+#include <linux/string.h>
+#include <linux/kernel.h>
+
+#if 0
+#define DEBUGP printk
+#else
+#define DEBUGP(fmt...)
+#endif
+
+void *module_alloc(unsigned long size)
+{
+	if (size == 0)
+		return NULL;
+	return vmalloc(size);
+}
+
+
+/* Free memory returned from module_alloc */
+void module_free(struct module *mod, void *module_region)
+{
+	vfree(module_region);
+	/* FIXME: If module_region == mod->init_region, trim exception
+           table entries. */
+}
+
+/* We don't need anything special. */
+int module_frob_arch_sections(Elf_Ehdr *hdr,
+			      Elf_Shdr *sechdrs,
+			      char *secstrings,
+			      struct module *mod)
+{
+	return 0;
+}
+
+int apply_relocate(Elf32_Shdr *sechdrs,
+		   const char *strtab,
+		   unsigned int symindex,
+		   unsigned int relsec,
+		   struct module *me)
+{
+	unsigned int i;
+	Elf32_Rel *rel = (void *)sechdrs[relsec].sh_addr;
+	Elf32_Sym *sym;
+	uint32_t *location;
+
+	DEBUGP("Applying relocate section %u to %u\n", relsec,
+	       sechdrs[relsec].sh_info);
+	for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
+		/* This is where to make the change */
+		location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
+			+ rel[i].r_offset;
+		/* This is the symbol it is referring to.  Note that all
+		   undefined symbols have been resolved.  */
+		sym = (Elf32_Sym *)sechdrs[symindex].sh_addr
+			+ ELF32_R_SYM(rel[i].r_info);
+
+		switch (ELF32_R_TYPE(rel[i].r_info)) {
+		case R_68K_32:
+			/* We add the value into the location given */
+			*location += sym->st_value;
+			break;
+		case R_68K_PC32:
+			/* Add the value, subtract its postition */
+			*location += sym->st_value - (uint32_t)location;
+			break;
+		default:
+			printk(KERN_ERR "module %s: Unknown relocation: %u\n",
+			       me->name, ELF32_R_TYPE(rel[i].r_info));
+			return -ENOEXEC;
+		}
+	}
+	return 0;
+}
+
+int apply_relocate_add(Elf32_Shdr *sechdrs,
+		       const char *strtab,
+		       unsigned int symindex,
+		       unsigned int relsec,
+		       struct module *me)
+{
+	printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n",
+	       me->name);
+	return -ENOEXEC;
+}
+
+int module_finalize(const Elf_Ehdr *hdr,
+		    const Elf_Shdr *sechdrs,
+		    struct module *me)
+{
+	return 0;
+}
+
+void module_arch_cleanup(struct module *mod)
+{
+}
diff -Nru a/arch/m68knommu/kernel/time.c b/arch/m68knommu/kernel/time.c
--- a/arch/m68knommu/kernel/time.c	Tue Feb  3 19:45:33 2004
+++ b/arch/m68knommu/kernel/time.c	Tue Feb  3 19:45:33 2004
@@ -202,4 +202,12 @@
 	return 0;
 }
 
+/*
+ * Scheduler clock - returns current time in nanosec units.
+ */
+unsigned long long sched_clock(void)
+{
+	return (unsigned long long)jiffies * (1000000000 / HZ);
+}
+
 EXPORT_SYMBOL(do_settimeofday);
diff -Nru a/arch/m68knommu/lib/checksum.c b/arch/m68knommu/lib/checksum.c
--- a/arch/m68knommu/lib/checksum.c	Tue Feb  3 19:45:29 2004
+++ b/arch/m68knommu/lib/checksum.c	Tue Feb  3 19:45:29 2004
@@ -32,7 +32,6 @@
    of the assembly has to go. */
 
 #include <net/checksum.h>
-#include <net/module.h>
 
 static inline unsigned short from32to16(unsigned long x)
 {
diff -Nru a/arch/m68knommu/mm/Makefile b/arch/m68knommu/mm/Makefile
--- a/arch/m68knommu/mm/Makefile	Tue Feb  3 19:45:43 2004
+++ b/arch/m68knommu/mm/Makefile	Tue Feb  3 19:45:43 2004
@@ -2,4 +2,4 @@
 # Makefile for the linux m68knommu specific parts of the memory manager.
 #
 
-obj-y += init.o fault.o memory.o kmap.o extable.o
+obj-y += init.o fault.o memory.o kmap.o
diff -Nru a/arch/m68knommu/mm/extable.c b/arch/m68knommu/mm/extable.c
--- a/arch/m68knommu/mm/extable.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,30 +0,0 @@
-/*
- * linux/arch/m68knommu/mm/extable.c
- */
-
-#include <linux/config.h>
-#include <linux/module.h>
-#include <linux/spinlock.h>
-#include <asm/uaccess.h>
-
-/* Simple binary search */
-const struct exception_table_entry *
-search_extable(const struct exception_table_entry *first,
-	       const struct exception_table_entry *last,
-	       unsigned long value)
-{
-        while (first <= last) {
-		const struct exception_table_entry *mid;
-		long diff;
-
-		mid = (last - first) / 2 + first;
-		diff = mid->insn - value;
-                if (diff == 0)
-                        return mid;
-                else if (diff < 0)
-                        first = mid+1;
-                else
-                        last = mid-1;
-        }
-        return NULL;
-}
diff -Nru a/arch/m68knommu/platform/5307/entry.S b/arch/m68knommu/platform/5307/entry.S
--- a/arch/m68knommu/platform/5307/entry.S	Tue Feb  3 19:45:43 2004
+++ b/arch/m68knommu/platform/5307/entry.S	Tue Feb  3 19:45:43 2004
@@ -182,7 +182,7 @@
 	movew   %sp@(LFORMATVEC),%d0	/* put exception # in d0 */
 	andl	#0x03fc,%d0		/* mask out vector only */
 
-	leal	kstat__per_cpu+STAT_IRQ,%a0
+	leal	per_cpu__kstat+STAT_IRQ,%a0
 	addql	#1,%a0@(%d0)
 
 	lsrl	#2,%d0			/* calculate real vector # */
@@ -213,7 +213,7 @@
 	movew   %sp@(LFORMATVEC),%d0
 	andl	#0x03fc,%d0		/* mask out vector only */
 
-	leal	kstat__per_cpu+STAT_IRQ,%a0
+	leal	per_cpu__kstat+STAT_IRQ,%a0
 	addql	#1,%a0@(%d0)
 
 	movel	%sp,%sp@-		/* push regs arg onto stack */
diff -Nru a/arch/mips/Kconfig b/arch/mips/Kconfig
--- a/arch/mips/Kconfig	Tue Feb  3 19:45:18 2004
+++ b/arch/mips/Kconfig	Tue Feb  3 19:45:18 2004
@@ -981,6 +981,7 @@
 
 config NR_CPUS
 	int "Maximum number of CPUs (2-32)"
+	range 2 32
 	depends on SMP
 	default "32"
 	help
diff -Nru a/arch/mips/mm/Makefile b/arch/mips/mm/Makefile
--- a/arch/mips/mm/Makefile	Tue Feb  3 19:45:30 2004
+++ b/arch/mips/mm/Makefile	Tue Feb  3 19:45:30 2004
@@ -2,7 +2,7 @@
 # Makefile for the Linux/MIPS-specific parts of the memory manager.
 #
 
-obj-y				+= cache.o extable.o fault.o loadmmu.o pgtable.o
+obj-y				+= cache.o fault.o loadmmu.o pgtable.o
 
 obj-$(CONFIG_MIPS32)		+= ioremap.o pgtable-32.o
 obj-$(CONFIG_MIPS64)		+= pgtable-64.o
diff -Nru a/arch/mips/mm/extable.c b/arch/mips/mm/extable.c
--- a/arch/mips/mm/extable.c	Tue Feb  3 19:45:29 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,30 +0,0 @@
-/*
- * linux/arch/i386/mm/extable.c
- */
-
-#include <linux/config.h>
-#include <linux/module.h>
-#include <linux/spinlock.h>
-#include <asm/uaccess.h>
-
-/* Simple binary search */
-const struct exception_table_entry *
-search_extable(const struct exception_table_entry *first,
-	       const struct exception_table_entry *last,
-	       unsigned long value)
-{
-        while (first <= last) {
-		const struct exception_table_entry *mid;
-		long diff;
-
-		mid = (last - first) / 2 + first;
-		diff = mid->insn - value;
-                if (diff == 0)
-                        return mid;
-                else if (diff < 0)
-                        first = mid+1;
-                else
-                        last = mid-1;
-        }
-        return NULL;
-}
diff -Nru a/arch/parisc/Kconfig b/arch/parisc/Kconfig
--- a/arch/parisc/Kconfig	Tue Feb  3 19:45:30 2004
+++ b/arch/parisc/Kconfig	Tue Feb  3 19:45:30 2004
@@ -154,6 +154,7 @@
 
 config NR_CPUS
 	int "Maximum number of CPUs (2-32)"
+	range 2 32
 	depends on SMP
 	default "32"
 
diff -Nru a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
--- a/arch/parisc/kernel/sys_parisc.c	Tue Feb  3 19:45:41 2004
+++ b/arch/parisc/kernel/sys_parisc.c	Tue Feb  3 19:45:41 2004
@@ -93,17 +93,13 @@
 unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
 		unsigned long len, unsigned long pgoff, unsigned long flags)
 {
-	struct inode *inode;
-
 	if (len > TASK_SIZE)
 		return -ENOMEM;
 	if (!addr)
 		addr = TASK_UNMAPPED_BASE;
 
-	inode = filp ? filp->f_dentry->d_inode : NULL;
-
-	if (inode && (flags & MAP_SHARED)) {
-		addr = get_shared_area(inode->i_mapping, addr, len, pgoff);
+	if (filp && (flags & MAP_SHARED)) {
+		addr = get_shared_area(filp->f_mapping, addr, len, pgoff);
 	} else {
 		addr = get_unshared_area(addr, len);
 	}
diff -Nru a/arch/parisc/mm/Makefile b/arch/parisc/mm/Makefile
--- a/arch/parisc/mm/Makefile	Tue Feb  3 19:45:42 2004
+++ b/arch/parisc/mm/Makefile	Tue Feb  3 19:45:42 2004
@@ -2,4 +2,4 @@
 # Makefile for arch/parisc/mm
 #
 
-obj-y	 := init.o fault.o extable.o ioremap.o
+obj-y	 := init.o fault.o ioremap.o
diff -Nru a/arch/parisc/mm/extable.c b/arch/parisc/mm/extable.c
--- a/arch/parisc/mm/extable.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,37 +0,0 @@
-/*
- * Kernel exception handling table support.  Derived from arch/i386/mm/extable.c.
- *
- * Copyright (C) 2000 Hewlett-Packard Co
- * Copyright (C) 2000 John Marvin (jsm@fc.hp.com)
- */
-
-#include <asm/uaccess.h>
-
-const struct exception_table_entry *
-search_extable(const struct exception_table_entry *first,
-	       const struct exception_table_entry *last,
-	       unsigned long addr)
-{
-	/* Abort early if the search value is out of range.  */
-
-	if ((addr < first->addr) || (addr > last->addr))
-		return 0;
-
-        while (first <= last) {
-		const struct exception_table_entry *mid;
-		long diff;
-
-		mid = first + ((last - first)/2);
-		diff = mid->addr - addr;
-
-                if (diff == 0)
-                        return mid;
-                else if (diff < 0)
-                        first = mid+1;
-                else
-                        last = mid-1;
-        }
-
-        return 0;
-}
-
diff -Nru a/arch/ppc/Kconfig b/arch/ppc/Kconfig
--- a/arch/ppc/Kconfig	Tue Feb  3 19:45:42 2004
+++ b/arch/ppc/Kconfig	Tue Feb  3 19:45:42 2004
@@ -681,6 +681,7 @@
 
 config NR_CPUS
 	int "Maximum number of CPUs (2-32)"
+	range 2 32
 	depends on SMP
 	default "4"
 
diff -Nru a/arch/ppc/boot/prep/Makefile b/arch/ppc/boot/prep/Makefile
--- a/arch/ppc/boot/prep/Makefile	Tue Feb  3 19:45:42 2004
+++ b/arch/ppc/boot/prep/Makefile	Tue Feb  3 19:45:42 2004
@@ -27,9 +27,10 @@
 bootlib	:= $(boot)/lib
 images	:= $(boot)/images
 simple	:= $(boot)/simple
+of1275	:= $(boot)/of1275
 
 OBJCOPYFLAGS	:= -O elf32-powerpc
-LIBS 		:= $(common)/lib.a $(bootlib)/lib.a
+LIBS 		:= $(common)/lib.a $(bootlib)/lib.a $(of1275)/lib.a
 
 targets		:= $(boot-y) dummy.o ../simple/legacy.o
 OBJS		:= $(addprefix $(obj)/,$(boot-y)) $(simple)/legacy.o
diff -Nru a/arch/ppc/boot/prep/head.S b/arch/ppc/boot/prep/head.S
--- a/arch/ppc/boot/prep/head.S	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc/boot/prep/head.S	Tue Feb  3 19:45:17 2004
@@ -35,9 +35,28 @@
 
 	mr	r11,r3		/* Save pointer to residual/board data */
 
-	/* Establish default MSR value */
-	li	r3,MSR_IP|MSR_FP
-	mtmsr	r3
+/*
+ * Save the OF pointer to r25, but only if the entry point is in a sane
+ * location; if not we store 0.  If there is no entry point, or it is
+ * invalid, we establish the default MSR value immediately.  Otherwise,
+ * we defer doing that, to allow OF functions to be called, until we
+ * begin uncompressing the kernel.
+ */
+	lis	r3,0x0fff		/* r3 = 0x0fffffff */
+	ori	r3,r3,0xffff
+
+	subc	r3,r3,r5		/* r3 = (r5 <= r3) ? ~0 : 0 */
+	subfe	r3,r3,r3
+	nand	r3,r3,r3
+
+	and.	r5,r5,r3		/* r5 will be cleared if (r5 > r3) */
+	bne+	haveOF
+
+	li	r3,MSR_IP|MSR_FP	/* Not OF: set MSR immediately */
+  	mtmsr	r3
+	isync
+haveOF:
+	mr	r25,r5
 
 	/* compute the size of the whole image in words. */
 	lis	r4,start@h
@@ -111,6 +130,7 @@
 	mr	r4,r7			/* Program length */
 	mr	r5,r6			/* Checksum */
 	mr	r6,r11			/* Residual data */
+	mr      r7,r25                  /* Validated OFW interface */
 	bl	decompress_kernel
 
 	/*
diff -Nru a/arch/ppc/boot/prep/misc.c b/arch/ppc/boot/prep/misc.c
--- a/arch/ppc/boot/prep/misc.c	Tue Feb  3 19:45:33 2004
+++ b/arch/ppc/boot/prep/misc.c	Tue Feb  3 19:45:33 2004
@@ -19,7 +19,7 @@
 #include <asm/bootinfo.h>
 #include <asm/mmu.h>
 #include <asm/byteorder.h>
-
+#include "of1275.h"
 #include "nonstdio.h"
 #include "zlib.h"
 
@@ -114,17 +114,19 @@
 
 unsigned long
 decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
-		  RESIDUAL *residual)
+		  RESIDUAL *residual, void *OFW_interface)
 {
 	int timer = 0;
 	extern unsigned long start;
 	char *cp, ch;
 	unsigned long TotalMemory;
-	unsigned char board_type;
-	unsigned char base_mod;
 	int start_multi = 0;
 	unsigned int pci_viddid, pci_did, tulip_pci_base, tulip_base;
 
+	/* If we have Open Firmware, initialise it immediately */
+	if (OFW_interface)
+		ofinit(OFW_interface);
+
 	serial_fixups();
 #if defined(CONFIG_SERIAL_8250_CONSOLE)
 	com_port = serial_init(0, NULL);
@@ -163,7 +165,8 @@
 		/* Is this Motorola PPCBug? */
 		if ((1 & residual->VitalProductData.FirmwareSupports) &&
 		    (1 == residual->VitalProductData.FirmwareSupplier)) {
-			board_type = inb(0x800) & 0xF0;
+			unsigned char base_mod;
+			unsigned char board_type = inb(0x800) & 0xF0;
 
 			/*
 			 * Reset the onboard 21x4x Ethernet
@@ -229,8 +232,31 @@
 	/* If it's not, see if we have anything in the residual data. */
 	else if (residual && residual->TotalMemory)
 		TotalMemory = residual->TotalMemory;
-	/* Fall back to hard-coding 32MB. */
-	else
+	else if (OFW_interface) {
+		/*
+		 * This is a 'best guess' check.  We want to make sure
+		 * we don't try this on a PReP box without OF
+		 *     -- Cort
+		 */
+		while (OFW_interface)
+		{
+			phandle dev_handle;
+			int mem_info[2];
+
+			/* get handle to memory description */
+			if (!(dev_handle = finddevice("/memory@0")))
+				break;
+
+			/* get the info */
+			if (getprop(dev_handle, "reg", mem_info,
+						sizeof(mem_info)) != 8)
+				break;
+
+			TotalMemory = mem_info[1];
+			break;
+		}
+	} else
+		/* Fall back to hard-coding 32MB. */
 		TotalMemory = 32*1024*1024;
 
 
@@ -303,6 +329,18 @@
 	}
 	*cp = 0;
 	puts("\nUncompressing Linux...");
+
+	/*
+	 * If we have OF, then we have deferred setting the MSR.
+	 * We must set it now because we are about to overwrite
+	 * the exception table.  The new MSR value will disable
+	 * machine check exceptions and point the exception table
+	 * to the ROM.
+	 */
+	if (OFW_interface) {
+		mtmsr(MSR_IP | MSR_FP);
+		asm volatile("isync");
+	}
 
 	gunzip(0, 0x400000, zimage_start, &zimage_size);
 	puts("done.\n");
diff -Nru a/arch/ppc/boot/simple/embed_config.c b/arch/ppc/boot/simple/embed_config.c
--- a/arch/ppc/boot/simple/embed_config.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc/boot/simple/embed_config.c	Tue Feb  3 19:45:17 2004
@@ -50,7 +50,7 @@
 {
 	u_char	*mp;
 	u_char	eebuf[128];
-	int i;
+	int i = 8;
 	bd_t    *bd;
 
 	bd = *bdp;
@@ -62,11 +62,21 @@
 
 	/* All we are looking for is the Ethernet MAC address.  The
 	 * first 8 bytes are 'MOTOROLA', so check for part of that.
+	 * Next, the VPD describes a MAC 'packet' as being of type 08
+	 * and size 06.  So we look for that and the MAC must follow.
+	 * If there are more than one, we still only care about the first.
 	 * If it's there, assume we have a valid MAC address.  If not,
 	 * grab our default one.
 	 */
-	if ((*(uint *)eebuf) == 0x4d4f544f)
-		mp = &eebuf[0x4c];
+	if ((*(uint *)eebuf) == 0x4d4f544f) {
+		while (i < 127 && !(eebuf[i] == 0x08 && eebuf[i + 1] == 0x06))
+			 i += eebuf[i + 1] + 2;  /* skip this packet */
+
+		if (i == 127)	/* Couldn't find. */
+			mp = (u_char *)def_enet_addr;
+		else
+			mp = &eebuf[i + 2];
+	}
 	else
 		mp = (u_char *)def_enet_addr;
 
diff -Nru a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile
--- a/arch/ppc/kernel/Makefile	Tue Feb  3 19:45:42 2004
+++ b/arch/ppc/kernel/Makefile	Tue Feb  3 19:45:42 2004
@@ -9,8 +9,7 @@
 EXTRA_AFLAGS		:= -Wa,-m405
 endif
 
-# Start off with 'head.o', change as needed.
-extra-y				:= head.o
+extra-$(CONFIG_PPC_STD_MMU)	:= head.o
 extra-$(CONFIG_40x)		:= head_4xx.o
 extra-$(CONFIG_44x)		:= head_44x.o
 extra-$(CONFIG_8xx)		:= head_8xx.o
diff -Nru a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
--- a/arch/ppc/kernel/misc.S	Tue Feb  3 19:45:42 2004
+++ b/arch/ppc/kernel/misc.S	Tue Feb  3 19:45:42 2004
@@ -1385,3 +1385,4 @@
 	.long sys_statfs64
 	.long sys_fstatfs64
 	.long ppc_fadvise64_64
+	.long sys_ni_syscall	/* 255 - rtas (used on ppc64) */
diff -Nru a/arch/ppc/kernel/module.c b/arch/ppc/kernel/module.c
--- a/arch/ppc/kernel/module.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc/kernel/module.c	Tue Feb  3 19:45:17 2004
@@ -88,6 +88,10 @@
 		    != is_init)
 			continue;
 
+		/* We don't want to look at debug sections. */
+		if (strstr(secstrings + sechdrs[i].sh_name, ".debug") != 0)
+			continue;
+
 		if (sechdrs[i].sh_type == SHT_RELA) {
 			DEBUGP("Found relocations in section %u\n", i);
 			DEBUGP("Ptr: %p.  Number: %u\n",
@@ -265,7 +269,6 @@
 	return 0;
 }
 
-/* FIXME: Sort exception table --RR */
 int module_finalize(const Elf_Ehdr *hdr,
 		    const Elf_Shdr *sechdrs,
 		    struct module *me)
diff -Nru a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
--- a/arch/ppc/kernel/ppc_ksyms.c	Tue Feb  3 19:45:42 2004
+++ b/arch/ppc/kernel/ppc_ksyms.c	Tue Feb  3 19:45:42 2004
@@ -92,7 +92,7 @@
 EXPORT_SYMBOL(probe_irq_mask);
 
 EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
-EXPORT_SYMBOL_NOVERS(DMA_MODE_READ);
+EXPORT_SYMBOL(DMA_MODE_READ);
 EXPORT_SYMBOL(DMA_MODE_WRITE);
 #if defined(CONFIG_PPC_PREP)
 EXPORT_SYMBOL(_prep_type);
@@ -167,9 +167,9 @@
 #endif
 
 #ifdef CONFIG_PCI
-EXPORT_SYMBOL_NOVERS(isa_io_base);
-EXPORT_SYMBOL_NOVERS(isa_mem_base);
-EXPORT_SYMBOL_NOVERS(pci_dram_offset);
+EXPORT_SYMBOL(isa_io_base);
+EXPORT_SYMBOL(isa_mem_base);
+EXPORT_SYMBOL(pci_dram_offset);
 EXPORT_SYMBOL(pci_alloc_consistent);
 EXPORT_SYMBOL(pci_free_consistent);
 EXPORT_SYMBOL(pci_bus_io_base);
@@ -246,7 +246,7 @@
 EXPORT_SYMBOL(_machine);
 #endif
 #ifdef CONFIG_PPC_PMAC
-EXPORT_SYMBOL_NOVERS(sys_ctrler);
+EXPORT_SYMBOL(sys_ctrler);
 EXPORT_SYMBOL(pmac_newworld);
 #endif
 #ifdef CONFIG_PPC_OF
@@ -294,15 +294,15 @@
 
 EXPORT_SYMBOL(pm_power_off);
 
-EXPORT_SYMBOL_NOVERS(__ashrdi3);
-EXPORT_SYMBOL_NOVERS(__ashldi3);
-EXPORT_SYMBOL_NOVERS(__lshrdi3);
-EXPORT_SYMBOL_NOVERS(memcpy);
-EXPORT_SYMBOL_NOVERS(memset);
-EXPORT_SYMBOL_NOVERS(memmove);
-EXPORT_SYMBOL_NOVERS(memscan);
-EXPORT_SYMBOL_NOVERS(memcmp);
-EXPORT_SYMBOL_NOVERS(memchr);
+EXPORT_SYMBOL(__ashrdi3);
+EXPORT_SYMBOL(__ashldi3);
+EXPORT_SYMBOL(__lshrdi3);
+EXPORT_SYMBOL(memcpy);
+EXPORT_SYMBOL(memset);
+EXPORT_SYMBOL(memmove);
+EXPORT_SYMBOL(memscan);
+EXPORT_SYMBOL(memcmp);
+EXPORT_SYMBOL(memchr);
 
 EXPORT_SYMBOL(abs);
 
@@ -366,7 +366,7 @@
 EXPORT_SYMBOL(next_mmu_context);
 EXPORT_SYMBOL(set_context);
 EXPORT_SYMBOL(handle_mm_fault); /* For MOL */
-EXPORT_SYMBOL_NOVERS(disarm_decr);
+EXPORT_SYMBOL(disarm_decr);
 #ifdef CONFIG_PPC_STD_MMU
 extern long mol_trampoline;
 EXPORT_SYMBOL(mol_trampoline); /* For MOL */
@@ -381,5 +381,5 @@
 EXPORT_SYMBOL(cur_cpu_spec);
 #ifdef CONFIG_PPC_PMAC
 extern unsigned long agp_special_page;
-EXPORT_SYMBOL_NOVERS(agp_special_page);
+EXPORT_SYMBOL(agp_special_page);
 #endif
diff -Nru a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
--- a/arch/ppc/kernel/setup.c	Tue Feb  3 19:45:42 2004
+++ b/arch/ppc/kernel/setup.c	Tue Feb  3 19:45:42 2004
@@ -675,7 +675,6 @@
 	if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab);
 
 	paging_init();
-	sort_exception_table();
 
 	/* this is for modules since _machine can be a define -- Cort */
 	ppc_md.ppc_machine = _machine;
diff -Nru a/arch/ppc/kernel/signal.c b/arch/ppc/kernel/signal.c
--- a/arch/ppc/kernel/signal.c	Tue Feb  3 19:45:42 2004
+++ b/arch/ppc/kernel/signal.c	Tue Feb  3 19:45:42 2004
@@ -241,12 +241,16 @@
  * (except for MSR).
  */
 static int
-restore_user_regs(struct pt_regs *regs, struct mcontext __user *sr)
+restore_user_regs(struct pt_regs *regs, struct mcontext __user *sr, int sig)
 {
+	unsigned long save_r2;
 #ifdef CONFIG_ALTIVEC
 	unsigned long msr;
 #endif
 
+	/* backup/restore the TLS as we don't want it to be modified */
+	if (!sig)
+		save_r2 = regs->gpr[2];
 	/* copy up to but not including MSR */
 	if (__copy_from_user(regs, &sr->mc_gregs, PT_MSR * sizeof(elf_greg_t)))
 		return 1;
@@ -254,6 +258,8 @@
 	if (__copy_from_user(&regs->orig_gpr3, &sr->mc_gregs[PT_ORIG_R3],
 			     GP_REGS_SIZE - PT_ORIG_R3 * sizeof(elf_greg_t)))
 		return 1;
+	if (!sig)
+		regs->gpr[2] = save_r2;
 
 	/* force the process to reload the FP registers from
 	   current->thread when it next does FP instructions */
@@ -359,7 +365,7 @@
 	force_sig(SIGSEGV, current);
 }
 
-static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs)
+static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs, int sig)
 {
 	sigset_t set;
 	struct mcontext *mcp;
@@ -368,7 +374,7 @@
 	    || __get_user(mcp, &ucp->uc_regs))
 		return -EFAULT;
 	restore_sigmask(&set);
-	if (restore_user_regs(regs, mcp))
+	if (restore_user_regs(regs, mcp, sig))
 		return -EFAULT;
 
 	return 0;
@@ -376,10 +382,16 @@
 
 int sys_swapcontext(struct ucontext __user *old_ctx,
 		    struct ucontext __user *new_ctx,
-		    int r5, int r6, int r7, int r8, struct pt_regs *regs)
+		    int ctx_size, int r6, int r7, int r8, struct pt_regs *regs)
 {
 	unsigned char tmp;
 
+	/* Context size is for future use. Right now, we only make sure
+	 * we are passed something we understand
+	 */
+	if (ctx_size < sizeof(struct ucontext))
+		return -EINVAL;
+
 	if (old_ctx != NULL) {
 		if (verify_area(VERIFY_WRITE, old_ctx, sizeof(*old_ctx))
 		    || save_user_regs(regs, &old_ctx->uc_mcontext, 0)
@@ -406,7 +418,7 @@
 	 * or if another thread unmaps the region containing the context.
 	 * We kill the task with a SIGSEGV in this situation.
 	 */
-	if (do_setcontext(new_ctx, regs))
+	if (do_setcontext(new_ctx, regs, 0))
 		do_exit(SIGSEGV);
 	sigreturn_exit(regs);
 	/* doesn't actually return back to here */
@@ -425,7 +437,7 @@
 		(regs->gpr[1] + __SIGNAL_FRAMESIZE + 16);
 	if (verify_area(VERIFY_READ, rt_sf, sizeof(struct rt_sigframe)))
 		goto bad;
-	if (do_setcontext(&rt_sf->uc, regs))
+	if (do_setcontext(&rt_sf->uc, regs, 1))
 		goto bad;
 
 	/*
@@ -484,7 +496,7 @@
 	if (save_user_regs(regs, &frame->mctx, __NR_sigreturn))
 		goto badframe;
 
-	if (put_user(regs->gpr[1], (unsigned long *)newsp))
+	if (put_user(regs->gpr[1], (unsigned long __user *)newsp))
 		goto badframe;
 	regs->gpr[1] = newsp;
 	regs->gpr[3] = sig;
@@ -529,7 +541,7 @@
 
 	sr = (struct mcontext *) sigctx.regs;
 	if (verify_area(VERIFY_READ, sr, sizeof(*sr))
-	    || restore_user_regs(regs, sr))
+	    || restore_user_regs(regs, sr, 1))
 		goto badframe;
 
 	sigreturn_exit(regs);		/* doesn't return */
diff -Nru a/arch/ppc/kernel/syscalls.c b/arch/ppc/kernel/syscalls.c
--- a/arch/ppc/kernel/syscalls.c	Tue Feb  3 19:45:42 2004
+++ b/arch/ppc/kernel/syscalls.c	Tue Feb  3 19:45:42 2004
@@ -271,5 +271,3 @@
 {
 	return sys_fadvise64_64(fd, offset, len, advice);
 }
-
-cond_syscall(sys_pciconfig_iobase);
diff -Nru a/arch/ppc/mm/Makefile b/arch/ppc/mm/Makefile
--- a/arch/ppc/mm/Makefile	Tue Feb  3 19:45:37 2004
+++ b/arch/ppc/mm/Makefile	Tue Feb  3 19:45:37 2004
@@ -6,7 +6,7 @@
 EXTRA_AFLAGS		:= -Wa,-mppc64bridge
 endif
 
-obj-y				:= fault.o init.o mem_pieces.o extable.o \
+obj-y				:= fault.o init.o mem_pieces.o \
 					mmu_context.o pgtable.o
 
 obj-$(CONFIG_PPC_STD_MMU)	+= hashtable.o ppc_mmu.o tlb.o
diff -Nru a/arch/ppc/mm/cachemap.c b/arch/ppc/mm/cachemap.c
--- a/arch/ppc/mm/cachemap.c	Tue Feb  3 19:45:43 2004
+++ b/arch/ppc/mm/cachemap.c	Tue Feb  3 19:45:43 2004
@@ -170,3 +170,5 @@
 	start = (unsigned long)page_address(page) + offset;
 	consistent_sync((void *)start, size, direction);
 }
+
+EXPORT_SYMBOL(consistent_sync_page);
diff -Nru a/arch/ppc/mm/extable.c b/arch/ppc/mm/extable.c
--- a/arch/ppc/mm/extable.c	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,70 +0,0 @@
-/*
- * arch/ppc/mm/extable.c
- *
- * from arch/i386/mm/extable.c
- */
-
-#include <linux/config.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <asm/uaccess.h>
-
-extern struct exception_table_entry __start___ex_table[];
-extern struct exception_table_entry __stop___ex_table[];
-
-/*
- * The exception table needs to be sorted because we use the macros
- * which put things into the exception table in a variety of segments
- * such as the prep, pmac, chrp, etc. segments as well as the init
- * segment and the main kernel text segment.
- */
-static inline void
-sort_ex_table(struct exception_table_entry *start,
-	      struct exception_table_entry *finish)
-{
-	struct exception_table_entry el, *p, *q;
-
-	/* insertion sort */
-	for (p = start + 1; p < finish; ++p) {
-		/* start .. p-1 is sorted */
-		if (p[0].insn < p[-1].insn) {
-			/* move element p down to its right place */
-			el = *p;
-			q = p;
-			do {
-				/* el comes before q[-1], move q[-1] up one */
-				q[0] = q[-1];
-				--q;
-			} while (q > start && el.insn < q[-1].insn);
-			*q = el;
-		}
-	}
-}
-
-void __init
-sort_exception_table(void)
-{
-	sort_ex_table(__start___ex_table, __stop___ex_table);
-}
-
-/* Simple binary search */
-const struct exception_table_entry *
-search_extable(const struct exception_table_entry *first,
-	       const struct exception_table_entry *last,
-	       unsigned long value)
-{
-        while (first <= last) {
-		const struct exception_table_entry *mid;
-		long diff;
-
-		mid = (last - first) / 2 + first;
-		diff = mid->insn - value;
-                if (diff == 0)
-                        return mid;
-                else if (diff < 0)
-                        first = mid+1;
-                else
-                        last = mid-1;
-        }
-	return NULL;
-}
diff -Nru a/arch/ppc/platforms/mpc82xx.h b/arch/ppc/platforms/mpc82xx.h
--- a/arch/ppc/platforms/mpc82xx.h	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,42 +0,0 @@
-/*
- * arch/ppc/platforms/mpc82xx.h
- *
- * Board specific support for various 82xx platforms.
- *
- * Author: Allen Curtis <acurtis@onz.com>
- *
- * Copyright 2002 Ones and Zeros, Inc.
- *
- * This program is free software; you can redistribute  it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
- */
-#ifndef __CONFIG_82XX_PLATFORMS
-#define __CONFIG_82XX_PLATFORMS
-
-#ifdef CONFIG_8260
-
-#ifdef CONFIG_EST8260
-#include <platforms/est8260.h>
-#endif
-
-#ifdef CONFIG_SBS8260
-#include <platforms/sbs8260.h>
-#endif
-
-#ifdef CONFIG_RPX6
-#include <platforms/rpxsuper.h>
-#endif
-
-#ifdef CONFIG_WILLOW
-#include <platforms/willow.h>
-#endif
-
-#ifdef CONFIG_TQM8260
-#include <platforms/tqm8260.h>
-#endif
-
-#endif	/* CONFIG_8260 */
-
-#endif
diff -Nru a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig
--- a/arch/ppc64/Kconfig	Tue Feb  3 19:45:28 2004
+++ b/arch/ppc64/Kconfig	Tue Feb  3 19:45:28 2004
@@ -72,6 +72,21 @@
 	bool
 	default y
 
+# VMX is pSeries only for now until somebody writes the iSeries
+# exception vectors for it
+config ALTIVEC
+	bool "Support for VMX (Altivec) vector unit"
+	depends on PPC_PSERIES
+	default y
+
+config POWER4_ONLY
+	bool "Optimize for POWER4"
+	default n
+	---help---
+	  Cause the compiler to optimize for POWER4 processors. The resulting
+	  binary will not work on POWER3 or RS64 processors when compiled with
+	  binutils 2.15 or later.
+
 config SMP
 	bool "Symmetric multi-processing support"
 	---help---
@@ -97,6 +112,7 @@
 
 config NR_CPUS
 	int "Maximum number of CPUs (2-128)"
+	range 2 128
 	depends on SMP
 	default "32"
 
@@ -130,17 +146,24 @@
 	depends on PPC_ISERIES
 	default y
 
+
+config PPC_RTAS
+	bool "Proc interface to RTAS"
+	depends on !PPC_ISERIES
+
 config RTAS_FLASH
 	tristate "Firmware flash interface"
-	depends on !PPC_ISERIES
+	depends on PPC_RTAS
 
 config SCANLOG
 	tristate "Scanlog dump interface"
-	depends on !PPC_ISERIES
+	depends on PPC_RTAS
 
-config PPC_RTAS
-	bool "Proc interface to RTAS"
-	depends on !PPC_ISERIES
+config LPARCFG
+	bool "LPAR Configuration Data"
+	help
+	Provide system capacity information via human readable 
+	<key word>=<value> pairs through a /proc/ppc64/lparcfg interface.
 
 endmenu
 
@@ -263,6 +286,8 @@
 
 source "drivers/char/Kconfig"
 
+source "drivers/i2c/Kconfig"
+
 source "drivers/media/Kconfig"
 
 source "fs/Kconfig"
@@ -318,7 +343,7 @@
 
 config VIOPATH
 	bool
-	depends on PPC_ISERIES
+	depends on VIOCONS || VIODASD || VIOCD || VIOTAPE || VETH
 	default y
 
 source "arch/ppc64/oprofile/Kconfig"
diff -Nru a/arch/ppc64/Makefile b/arch/ppc64/Makefile
--- a/arch/ppc64/Makefile	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc64/Makefile	Tue Feb  3 19:45:17 2004
@@ -15,15 +15,25 @@
 
 KERNELLOAD	:= 0xc000000000000000
 
+HAS_BIARCH      := $(shell if $(CC) -m64 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi;)
+ifeq ($(HAS_BIARCH),y)
+AS              := $(AS) -64
+LD              := $(LD) -m elf64ppc
+CC		:= $(CC) -m64
+endif
+
 LDFLAGS		:= -m elf64ppc
 LDFLAGS_vmlinux	:= -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD)
 CFLAGS		+= -msoft-float -pipe -Wno-uninitialized -mminimal-toc \
-		-mcpu=power4
-
-have_zero_bss := $(shell if $(CC) -fno-zero-initialized-in-bss -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi)
+		   -mtraceback=none
 
-ifeq ($(have_zero_bss),y)
-CFLAGS		+= -fno-zero-initialized-in-bss
+HAS_POWER4	:= $(shell if $(CC) -mcpu=power4 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi;)
+ifeq ($(HAS_POWER4),y)
+ifeq ($(CONFIG_POWER4_ONLY),y)
+CFLAGS		+= -mcpu=power4
+else
+CFLAGS		+= -mtune=power4
+endif
 endif
 
 head-y := arch/ppc64/kernel/head.o
@@ -46,6 +56,8 @@
 BOOTIMAGE := $(bootimage-y)
 install: vmlinux
 	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
+
+all: $(BOOTIMAGE)
 
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
diff -Nru a/arch/ppc64/boot/ppc32-types.h b/arch/ppc64/boot/ppc32-types.h
--- a/arch/ppc64/boot/ppc32-types.h	Tue Feb  3 19:45:16 2004
+++ b/arch/ppc64/boot/ppc32-types.h	Tue Feb  3 19:45:16 2004
@@ -25,6 +25,12 @@
 typedef signed long long s64;
 typedef unsigned long long u64;
 
+typedef struct {
+	__u32 u[4];
+} __attribute((aligned(16))) __vector128;
+
 #define BITS_PER_LONG 32
+
+typedef __vector128 vector128;
 
 #endif /* _PPC64_TYPES_H */
diff -Nru a/arch/ppc64/defconfig b/arch/ppc64/defconfig
--- a/arch/ppc64/defconfig	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc64/defconfig	Tue Feb  3 19:45:17 2004
@@ -1,6 +1,7 @@
 #
 # Automatically generated make config: don't edit
 #
+CONFIG_64BIT=y
 CONFIG_MMU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_GENERIC_ISA_DMA=y
@@ -14,7 +15,8 @@
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-# CONFIG_BROKEN is not set
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
 
 #
 # General setup
@@ -33,6 +35,7 @@
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -51,21 +54,23 @@
 CONFIG_PPC_PSERIES=y
 CONFIG_PPC=y
 CONFIG_PPC64=y
+CONFIG_ALTIVEC=y
+# CONFIG_POWER4_ONLY is not set
 CONFIG_SMP=y
 CONFIG_IRQ_ALL_CPUS=y
 CONFIG_NR_CPUS=32
 # CONFIG_HMT is not set
 # CONFIG_DISCONTIGMEM is not set
-# CONFIG_RTAS_FLASH is not set
-CONFIG_SCANLOG=y
 CONFIG_PPC_RTAS=y
+CONFIG_RTAS_FLASH=m
+CONFIG_SCANLOG=m
+CONFIG_LPARCFG=y
 
 #
 # General setup
 #
 CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
-CONFIG_KCORE_ELF=y
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 CONFIG_PCI_LEGACY_PROC=y
@@ -75,6 +80,10 @@
 # CONFIG_CMDLINE_BOOL is not set
 
 #
+# Device Drivers
+#
+
+#
 # Generic Driver Options
 #
 
@@ -117,6 +126,7 @@
 # SCSI device support
 #
 CONFIG_SCSI=y
+CONFIG_SCSI_PROC_FS=y
 
 #
 # SCSI support type (disk, tape, CD-ROM)
@@ -145,9 +155,9 @@
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
-# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_BUSLOGIC is not set
 # CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
@@ -155,18 +165,21 @@
 # CONFIG_SCSI_EATA_PIO is not set
 # CONFIG_SCSI_FUTURE_DOMAIN is not set
 # CONFIG_SCSI_GDTH is not set
-# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INIA100 is not set
 CONFIG_SCSI_SYM53C8XX_2=y
 CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
-# CONFIG_SCSI_PCI2000 is not set
-# CONFIG_SCSI_PCI2220I is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
+CONFIG_SCSI_QLA2XXX_CONFIG=y
+CONFIG_SCSI_QLA2XXX=y
+CONFIG_SCSI_QLA21XX=y
+CONFIG_SCSI_QLA22XX=y
+CONFIG_SCSI_QLA23XX=y
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_NSP32 is not set
@@ -181,6 +194,7 @@
 CONFIG_MD_RAID0=y
 CONFIG_MD_RAID1=y
 CONFIG_MD_RAID5=y
+# CONFIG_MD_RAID6 is not set
 # CONFIG_MD_MULTIPATH is not set
 CONFIG_BLK_DEV_DM=y
 CONFIG_DM_IOCTL_V4=y
@@ -240,7 +254,9 @@
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
 # CONFIG_VLAN_8021Q is not set
-# CONFIG_LLC is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
 # CONFIG_NET_DIVERT is not set
@@ -268,7 +284,6 @@
 CONFIG_BONDING=m
 # CONFIG_EQUALIZER is not set
 CONFIG_TUN=m
-# CONFIG_ETHERTAP is not set
 
 #
 # Ethernet (10 or 100Mbit)
@@ -292,6 +307,7 @@
 # CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
 # CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
 CONFIG_E100=y
@@ -303,7 +319,6 @@
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
-# CONFIG_TLAN is not set
 # CONFIG_VIA_RHINE is not set
 
 #
@@ -344,10 +359,10 @@
 # CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices (depends on LLC=y)
+# Token Ring devices
 #
+# CONFIG_TR is not set
 # CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 
 #
@@ -366,6 +381,11 @@
 # CONFIG_IRDA is not set
 
 #
+# Bluetooth support
+#
+# CONFIG_BT is not set
+
+#
 # ISDN subsystem
 #
 # CONFIG_ISDN_BOOL is not set
@@ -433,6 +453,7 @@
 #
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=4
 # CONFIG_SERIAL_8250_EXTENDED is not set
 
 #
@@ -445,20 +466,6 @@
 CONFIG_HVC_CONSOLE=y
 
 #
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# I2C Hardware Sensors Mainboard support
-#
-
-#
-# I2C Hardware Sensors Chip support
-#
-# CONFIG_I2C_SENSOR is not set
-
-#
 # Mice
 #
 # CONFIG_BUSMOUSE is not set
@@ -483,11 +490,15 @@
 #
 # Ftape, the floppy tape device driver
 #
-# CONFIG_FTAPE is not set
 # CONFIG_AGP is not set
 # CONFIG_DRM is not set
 CONFIG_RAW_DRIVER=y
-# CONFIG_HANGCHECK_TIMER is not set
+CONFIG_MAX_RAW_DEVS=256
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
 
 #
 # Multimedia devices
@@ -500,6 +511,67 @@
 # CONFIG_DVB is not set
 
 #
+# Graphics support
+#
+CONFIG_FB=y
+# CONFIG_FB_CYBER2000 is not set
+CONFIG_FB_OF=y
+# CONFIG_FB_CT65550 is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_S3TRIO is not set
+# CONFIG_FB_VGA16 is not set
+# CONFIG_FB_RIVA is not set
+CONFIG_FB_MATROX=y
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G450=y
+CONFIG_FB_MATROX_G100=y
+CONFIG_FB_MATROX_MULTIHEAD=y
+# CONFIG_FB_RADEON is not set
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_ATY is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+# CONFIG_FB_3DFX is not set
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+# CONFIG_MDA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_PCI_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+
+#
+# Logo configuration
+#
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_GADGET is not set
+
+#
 # File systems
 #
 CONFIG_EXT2_FS=y
@@ -551,11 +623,14 @@
 # Pseudo filesystems
 #
 CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS=y
 CONFIG_DEVPTS_FS_XATTR=y
 # CONFIG_DEVPTS_FS_SECURITY is not set
 CONFIG_TMPFS=y
+CONFIG_HUGETLBFS=y
+CONFIG_HUGETLB_PAGE=y
 CONFIG_RAMFS=y
 
 #
@@ -580,6 +655,7 @@
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_NFS_V4=y
+# CONFIG_NFS_DIRECTIO is not set
 CONFIG_NFSD=y
 CONFIG_NFSD_V3=y
 CONFIG_NFSD_V4=y
@@ -602,11 +678,11 @@
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-CONFIG_NLS=y
 
 #
 # Native Language Support
 #
+CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_CODEPAGE_437 is not set
 # CONFIG_NLS_CODEPAGE_737 is not set
@@ -645,72 +721,6 @@
 # CONFIG_NLS_KOI8_R is not set
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
-
-#
-# Graphics support
-#
-CONFIG_FB=y
-# CONFIG_FB_CIRRUS is not set
-# CONFIG_FB_PM2 is not set
-# CONFIG_FB_CYBER2000 is not set
-CONFIG_FB_OF=y
-# CONFIG_FB_CT65550 is not set
-# CONFIG_FB_IMSTT is not set
-# CONFIG_FB_S3TRIO is not set
-# CONFIG_FB_VGA16 is not set
-# CONFIG_FB_RIVA is not set
-CONFIG_FB_MATROX=y
-CONFIG_FB_MATROX_MILLENIUM=y
-CONFIG_FB_MATROX_MYSTIQUE=y
-CONFIG_FB_MATROX_G450=y
-CONFIG_FB_MATROX_G100=y
-CONFIG_FB_MATROX_MULTIHEAD=y
-# CONFIG_FB_RADEON is not set
-# CONFIG_FB_ATY128 is not set
-# CONFIG_FB_ATY is not set
-# CONFIG_FB_SIS is not set
-# CONFIG_FB_NEOMAGIC is not set
-# CONFIG_FB_3DFX is not set
-# CONFIG_FB_VOODOO1 is not set
-# CONFIG_FB_TRIDENT is not set
-# CONFIG_FB_PM3 is not set
-# CONFIG_FB_VIRTUAL is not set
-
-#
-# Console display driver support
-#
-# CONFIG_VGA_CONSOLE is not set
-# CONFIG_MDA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_PCI_CONSOLE=y
-# CONFIG_FONTS is not set
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
-
-#
-# Logo configuration
-#
-CONFIG_LOGO=y
-CONFIG_LOGO_LINUX_MONO=y
-CONFIG_LOGO_LINUX_VGA16=y
-CONFIG_LOGO_LINUX_CLUT224=y
-
-#
-# Sound
-#
-# CONFIG_SOUND is not set
-
-#
-# USB support
-#
-# CONFIG_USB is not set
-# CONFIG_USB_GADGET is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
 
 #
 # Profiling support
diff -Nru a/arch/ppc64/kernel/HvCall.c b/arch/ppc64/kernel/HvCall.c
--- a/arch/ppc64/kernel/HvCall.c	Tue Feb  3 19:45:41 2004
+++ b/arch/ppc64/kernel/HvCall.c	Tue Feb  3 19:45:41 2004
@@ -8,108 +8,29 @@
  * (at your option) any later version.
  */
 
-#include <linux/stddef.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/slab.h>
-#include <asm/system.h>
 #include <asm/page.h>
+#include <asm/abs_addr.h>
 #include <asm/iSeries/HvCall.h>
-#ifndef  _HVCALLSC_H
 #include <asm/iSeries/HvCallSc.h>
-#endif
-#include <asm/iSeries/LparData.h>
-
-#ifndef  _HVTYPES_H
 #include <asm/iSeries/HvTypes.h>
-#endif
-
-
-/*=====================================================================
- * Note that this call takes at MOST one page worth of data
- */
-int HvCall_readLogBuffer(HvLpIndex lpIndex, void *buffer, u64 bufLen)
-{
-	struct HvLpBufferList *bufList;
-	u64 bytesLeft = bufLen;
-	u64 leftThisPage;
-	u64 curPtr = virt_to_absolute( (unsigned long) buffer );
-	u64 retVal;
-	int npages;
-	int i;
-
-	npages = 0;
-	while (bytesLeft) {
-		npages++;
-		leftThisPage = ((curPtr & PAGE_MASK) + PAGE_SIZE) - curPtr;
-
-		if (leftThisPage > bytesLeft)
-			bytesLeft = 0;
-		else
-			bytesLeft -= leftThisPage;
-
-		curPtr = (curPtr & PAGE_MASK) + PAGE_SIZE;
-	}
-
-	if (npages == 0)
-		return 0;
-
-	bufList = (struct HvLpBufferList *)
-		kmalloc(npages * sizeof(struct HvLpBufferList), GFP_ATOMIC);
-	bytesLeft = bufLen;
-	curPtr = virt_to_absolute( (unsigned long) buffer );
-	for(i=0; i<npages; i++) {
-		bufList[i].addr = curPtr;
-      
-		leftThisPage = ((curPtr & PAGE_MASK) + PAGE_SIZE) - curPtr;
-
-		if (leftThisPage > bytesLeft) {
-			bufList[i].len = bytesLeft;
-			bytesLeft = 0;
-		} else {
-			bufList[i].len = leftThisPage;
-			bytesLeft -= leftThisPage;
-		}
 
-		curPtr = (curPtr & PAGE_MASK) + PAGE_SIZE;
-	}
-
-
-	retVal = HvCall3(HvCallBaseReadLogBuffer, lpIndex,
-			 virt_to_absolute((unsigned long)bufList), bufLen);
 
-	kfree(bufList);
-
-	return (int)retVal;
-}
-
-/*=====================================================================
- */
-void HvCall_writeLogBuffer(const void *buffer, u64 bufLen)
+void HvCall_writeLogBuffer(const void *buffer, u64 len)
 {
-	struct HvLpBufferList bufList;
-	u64 bytesLeft = bufLen;
-	u64 leftThisPage;
-	u64 curPtr = virt_to_absolute( (unsigned long) buffer );
-
-	while (bytesLeft) {
-		bufList.addr = curPtr;
-      
-		leftThisPage = ((curPtr & PAGE_MASK) + PAGE_SIZE) - curPtr;
-
-		if (leftThisPage > bytesLeft) {
-			bufList.len = bytesLeft;
-			bytesLeft = 0;
-		} else {
-			bufList.len = leftThisPage;
-			bytesLeft -= leftThisPage;
-		}
-
-		curPtr = (curPtr & PAGE_MASK) + PAGE_SIZE;
+	struct HvLpBufferList hv_buf;
+	u64 left_this_page;
+	u64 cur = virt_to_absolute((unsigned long)buffer);
+
+	while (len) {
+		hv_buf.addr = cur;
+		left_this_page = ((cur & PAGE_MASK) + PAGE_SIZE) - cur;
+		if (left_this_page > len)
+			left_this_page = len;
+		hv_buf.len = left_this_page;
+		len -= left_this_page;
+		HvCall2(HvCallBaseWriteLogBuffer,
+				virt_to_absolute((unsigned long)&hv_buf),
+				left_this_page);
+		cur = (cur & PAGE_MASK) + PAGE_SIZE;
 	}
-
-
-	HvCall2(HvCallBaseWriteLogBuffer,
-		virt_to_absolute((unsigned long)&bufList), bufLen);
-
 }
diff -Nru a/arch/ppc64/kernel/ItLpQueue.c b/arch/ppc64/kernel/ItLpQueue.c
--- a/arch/ppc64/kernel/ItLpQueue.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc64/kernel/ItLpQueue.c	Tue Feb  3 19:45:17 2004
@@ -147,17 +147,14 @@
 				printk(KERN_INFO "Unexpected Lp Event type=%d\n", nextLpEvent->xType );
 			
 			ItLpQueue_clearValid( nextLpEvent );
-		}
-		else 	/* No more valid events
-			 * If overflow events are pending
-			 * process them
+		} else if ( lpQueue->xPlicOverflowIntPending )
+			/*
+			 * No more valid events. If overflow events are
+			 * pending process them
 			 */
-			if ( lpQueue->xPlicOverflowIntPending ) {
-				HvCallEvent_getOverflowLpEvents( 
-						lpQueue->xIndex);
-			}
-			else	/* If nothing left then we are done */
-				break;
+			HvCallEvent_getOverflowLpEvents( lpQueue->xIndex);
+		else
+			break;
 	}
 
 	ItLpQueueInProcess = 0;
diff -Nru a/arch/ppc64/kernel/LparData.c b/arch/ppc64/kernel/LparData.c
--- a/arch/ppc64/kernel/LparData.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc64/kernel/LparData.c	Tue Feb  3 19:45:17 2004
@@ -28,29 +28,12 @@
 #include <asm/iSeries/IoHriProcessorVpd.h>
 #include <asm/iSeries/ItSpCommArea.h>
 
-extern char _start_boltedStacks[];
-
-/* The LparMap data is now located at offset 0x6000 in head.S
- * It was put there so that the HvReleaseData could address it
- * with a 32-bit offset as required by the iSeries hypervisor
- *
- * The Naca has a pointer to the ItVpdAreas.  The hypervisor finds
- * the Naca via the HvReleaseData area.  The HvReleaseData has the
- * offset into the Naca of the pointer to the ItVpdAreas.
- */
-
-extern struct ItVpdAreas itVpdAreas;
-
 /* The LpQueue is used to pass event data from the hypervisor to
  * the partition.  This is where I/O interrupt events are communicated.
- * The ItLpQueue must be initialized (even though only to all zeros)
- * If it were uninitialized (in .bss) it would get zeroed after the
- * kernel gets control.  The hypervisor will have filled in some fields
- * before the kernel gets control.  By initializing it we keep it out
- * of the .bss
  */
 
-struct ItLpQueue xItLpQueue = {};
+/* May be filled in by the hypervisor so cannot end up in the BSS */
+struct ItLpQueue xItLpQueue __attribute__((__section__(".data")));
 
 
 /* The HvReleaseData is the root of the information shared between 
@@ -71,7 +54,7 @@
 	6,		/* TEMP: This allows non-GA driver */
 	4,		/* We are v5r2m0               */
 	3,		/* Min supported PLIC = v5r1m0 */
-	3,		/* Min usuable PLIC   = v5r1m0 */
+	3,		/* Min usable PLIC   = v5r1m0 */
 	{ 0xd3, 0x89, 0x95, 0xa4, /* "Linux 2.4   "*/
 	  0xa7, 0x40, 0xf2, 0x4b,
 	  0xf4, 0x4b, 0xf6, 0xf4 },
@@ -141,9 +124,11 @@
 	}
 };
 
-struct ItIplParmsReal xItIplParmsReal = {};
+/* May be filled in by the hypervisor so cannot end up in the BSS */
+struct ItIplParmsReal xItIplParmsReal __attribute__((__section__(".data"))); 
 
-struct ItExtVpdPanel xItExtVpdPanel = {};
+/* May be filled in by the hypervisor so cannot end up in the BSS */
+struct ItExtVpdPanel xItExtVpdPanel __attribute__((__section__(".data")));
 
 #define maxPhysicalProcessors 32
 
@@ -157,10 +142,13 @@
 	}
 };
 	
-
-u64    xMsVpd[3400] = {};		/* Space for Main Store Vpd 27,200 bytes */
-
-u64    xRecoveryLogBuffer[32] = {};	/* Space for Recovery Log Buffer */
+/* Space for Main Store Vpd 27,200 bytes */
+/* May be filled in by the hypervisor so cannot end up in the BSS */
+u64    xMsVpd[3400] __attribute__((__section__(".data")));
+
+/* Space for Recovery Log Buffer */
+/* May be filled in by the hypervisor so cannot end up in the BSS */
+u64    xRecoveryLogBuffer[32] __attribute__((__section__(".data")));
 
 struct SpCommArea xSpCommArea = {
 	0xE2D7C3C2,
@@ -169,13 +157,21 @@
 	0, 0, 0, 0, {0}
 };
 
+/* The LparMap data is now located at offset 0x6000 in head.S
+ * It was put there so that the HvReleaseData could address it
+ * with a 32-bit offset as required by the iSeries hypervisor
+ *
+ * The Naca has a pointer to the ItVpdAreas.  The hypervisor finds
+ * the Naca via the HvReleaseData area.  The HvReleaseData has the
+ * offset into the Naca of the pointer to the ItVpdAreas.
+ */
 struct ItVpdAreas itVpdAreas = {
 	0xc9a3e5c1,	/* "ItVA" */
 	sizeof( struct ItVpdAreas ),
 	0, 0,
 	26,		/* # VPD array entries */
 	10,		/* # DMA array entries */
-	MAX_PROCESSORS*2, maxPhysicalProcessors,	/* Max logical, physical procs */
+	NR_CPUS*2, maxPhysicalProcessors,	/* Max logical, physical procs */
 	offsetof(struct ItVpdAreas,xPlicDmaToks),/* offset to DMA toks */
 	offsetof(struct ItVpdAreas,xSlicVpdAdrs),/* offset to VPD addrs */
 	offsetof(struct ItVpdAreas,xPlicDmaLens),/* offset to DMA lens */
@@ -223,7 +219,7 @@
 	}
 };
 
-struct msChunks msChunks = {0, 0, 0, 0, NULL};
+struct msChunks msChunks;
 
 /* Depending on whether this is called from iSeries or pSeries setup
  * code, the location of the msChunks struct may or may not have
diff -Nru a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile
--- a/arch/ppc64/kernel/Makefile	Tue Feb  3 19:45:42 2004
+++ b/arch/ppc64/kernel/Makefile	Tue Feb  3 19:45:42 2004
@@ -7,24 +7,29 @@
 
 obj-y               :=	setup.o entry.o traps.o irq.o idle.o \
 			time.o process.o signal.o syscalls.o misc.o ptrace.o \
-			align.o semaphore.o bitops.o stab.o htab.o pacaData.o \
+			align.o semaphore.o bitops.o stab.o pacaData.o \
 			udbg.o binfmt_elf32.o sys_ppc32.o ioctl32.o \
 			ptrace32.o signal32.o pmc.o rtc.o init_task.o \
-			lmb.o pci.o pci_dn.o pci_dma.o cputable.o
+			lmb.o cputable.o
 
-obj-$(CONFIG_PPC_ISERIES) += iSeries_pci.o       iSeries_pci_reset.o \
-			     iSeries_IoMmTable.o iSeries_irq.o \
-			     iSeries_VpdInfo.o   XmPciLpEvent.o \
+obj-$(CONFIG_PCI)	+= pci.o pci_dn.o pci_dma.o
+
+ifdef CONFIG_PPC_ISERIES
+obj-$(CONFIG_PCI)	+= iSeries_pci.o iSeries_pci_reset.o \
+			     iSeries_IoMmTable.o 
+endif
+
+obj-$(CONFIG_PPC_ISERIES) += iSeries_irq.o \
+			     iSeries_VpdInfo.o XmPciLpEvent.o \
 			     HvCall.o HvLpConfig.o LparData.o mf_proc.o \
 			     iSeries_setup.o ItLpQueue.o hvCall.o \
-			     mf.o HvLpEvent.o iSeries_proc.o 
+			     mf.o HvLpEvent.o iSeries_proc.o iSeries_htab.o \
+			     proc_pmc.o
 
 obj-$(CONFIG_PPC_PSERIES) += pSeries_pci.o pSeries_lpar.o pSeries_hvCall.o \
-			     eeh.o rtasd.o nvram.o ras.o
-
-# Change this to pSeries only once we've got iSeries up to date
-obj-y			  += open_pic.o xics.o pSeries_htab.o rtas.o \
-			     chrp_setup.o i8259.o prom.o 
+			     eeh.o nvram.o rtasd.o ras.o \
+			     open_pic.o xics.o pSeries_htab.o rtas.o \
+			     chrp_setup.o i8259.o prom.o vio.o
 
 obj-$(CONFIG_PROC_FS)		+= proc_ppc64.o
 obj-$(CONFIG_RTAS_FLASH)	+= rtas_flash.o
@@ -32,5 +37,8 @@
 obj-$(CONFIG_MODULES)		+= module.o ppc_ksyms.o
 obj-$(CONFIG_PPC_RTAS)		+= rtas-proc.o
 obj-$(CONFIG_SCANLOG)		+= scanlog.o
+obj-$(CONFIG_VIOPATH)		+= viopath.o
+obj-$(CONFIG_LPARCFG)		+= lparcfg.o
+
 
 CFLAGS_ioctl32.o += -Ifs/
diff -Nru a/arch/ppc64/kernel/XmPciLpEvent.c b/arch/ppc64/kernel/XmPciLpEvent.c
--- a/arch/ppc64/kernel/XmPciLpEvent.c	Tue Feb  3 19:45:18 2004
+++ b/arch/ppc64/kernel/XmPciLpEvent.c	Tue Feb  3 19:45:18 2004
@@ -1,10 +1,10 @@
 /*
-   * File XmPciLpEvent.h created by Wayne Holm on Mon Jan 15 2001.
-   *
-   * This module handles PCI interrupt events sent by the iSeries Hypervisor.
+ * File XmPciLpEvent.h created by Wayne Holm on Mon Jan 15 2001.
+ *
+ * This module handles PCI interrupt events sent by the iSeries Hypervisor.
 */
 
-
+#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/threads.h>
@@ -20,13 +20,13 @@
 #include <asm/iSeries/XmPciLpEvent.h>
 #include <asm/ppcdebug.h>
 
-long Pci_Interrupt_Count = 0;
-long Pci_Event_Count     = 0;
+static long Pci_Interrupt_Count;
+static long Pci_Event_Count;
 
 enum XmPciLpEvent_Subtype {
 	XmPciLpEvent_BusCreated	   = 0,		// PHB has been created
 	XmPciLpEvent_BusError	   = 1,		// PHB has failed
-	XmPciLpEvent_BusFailed	   = 2,		// Msg to Seconday, Primary failed bus
+	XmPciLpEvent_BusFailed	   = 2,		// Msg to Secondary, Primary failed bus
 	XmPciLpEvent_NodeFailed	   = 4,		// Multi-adapter bridge has failed
 	XmPciLpEvent_NodeRecovered = 5,		// Multi-adapter bridge has recovered
 	XmPciLpEvent_BusRecovered  = 12,	// PHB has been recovered
@@ -36,14 +36,14 @@
 };
 
 struct XmPciLpEvent_BusInterrupt {
-	HvBusNumber		busNumber;
+	HvBusNumber	busNumber;
 	HvSubBusNumber	subBusNumber;
 };
 
 struct XmPciLpEvent_NodeInterrupt {
-	HvBusNumber		busNumber;
+	HvBusNumber	busNumber;
 	HvSubBusNumber	subBusNumber;
-	HvAgentId		deviceId;
+	HvAgentId	deviceId;
 };
 
 struct XmPciLpEvent {
@@ -53,10 +53,10 @@
 		u64 alignData;			// Align on an 8-byte boundary
 
 		struct {
-			u32			fisr;
+			u32		fisr;
 			HvBusNumber	busNumber;
 			HvSubBusNumber	subBusNumber;
-			HvAgentId		deviceId;
+			HvAgentId	deviceId;
 		} slotInterrupt;
 
 		struct XmPciLpEvent_BusInterrupt busFailed;
@@ -70,40 +70,52 @@
 
 };
 
-static void intReceived(struct XmPciLpEvent* eventParm, struct pt_regs* regsParm);
+static void intReceived(struct XmPciLpEvent *eventParm,
+		struct pt_regs *regsParm);
 
-static void XmPciLpEvent_handler( struct HvLpEvent* eventParm, struct pt_regs* regsParm)
+static void XmPciLpEvent_handler(struct HvLpEvent *eventParm,
+		struct pt_regs *regsParm)
 {
-	//PPCDBG(PPCDBG_BUSWALK,"XmPciLpEvent_handler, type 0x%x\n",eventParm->xType );
+#ifdef CONFIG_PCI
+#if 0
+	PPCDBG(PPCDBG_BUSWALK, "XmPciLpEvent_handler, type 0x%x\n",
+			eventParm->xType);
+#endif
 	++Pci_Event_Count;
 
-	if (eventParm && eventParm->xType == HvLpEvent_Type_PciIo) {
-		switch( eventParm->xFlags.xFunction ) {
+	if (eventParm && (eventParm->xType == HvLpEvent_Type_PciIo)) {
+		switch (eventParm->xFlags.xFunction) {
 		case HvLpEvent_Function_Int:
-			intReceived( (struct XmPciLpEvent*)eventParm, regsParm );
+			intReceived((struct XmPciLpEvent *)eventParm, regsParm);
 			break;
 		case HvLpEvent_Function_Ack:
-			printk(KERN_ERR "XmPciLpEvent.c: unexpected ack received\n");
+			printk(KERN_ERR
+				"XmPciLpEvent.c: unexpected ack received\n");
 			break;
 		default:
-			printk(KERN_ERR "XmPciLpEvent.c: unexpected event function %d\n",(int)eventParm->xFlags.xFunction);
+			printk(KERN_ERR
+				"XmPciLpEvent.c: unexpected event function %d\n",
+				(int)eventParm->xFlags.xFunction);
 			break;
 		}
-	}
-	else if (event) {
-		printk(KERN_ERR "XmPciLpEvent.c: Unrecognized PCI event type 0x%x\n",(int)eventParm->xType);
-	}
-	else {
+	} else if (eventParm)
+		printk(KERN_ERR
+			"XmPciLpEvent.c: Unrecognized PCI event type 0x%x\n",
+			(int)eventParm->xType);
+	else
 		printk(KERN_ERR "XmPciLpEvent.c: NULL event received\n");
-	}
+#endif
 }
 
-static void intReceived(struct XmPciLpEvent* eventParm, struct pt_regs* regsParm)
+static void intReceived(struct XmPciLpEvent *eventParm,
+		struct pt_regs *regsParm)
 {
 	int irq;
 
 	++Pci_Interrupt_Count;
-	//PPCDBG(PPCDBG_BUSWALK,"PCI: XmPciLpEvent.c: intReceived\n");
+#if 0
+	PPCDBG(PPCDBG_BUSWALK, "PCI: XmPciLpEvent.c: intReceived\n");
+#endif
 
 	switch (eventParm->hvLpEvent.xSubtype) {
 	case XmPciLpEvent_SlotInterrupt:
@@ -111,33 +123,45 @@
 		/* Dispatch the interrupt handlers for this irq */
 		ppc_irq_dispatch_handler(regsParm, irq);
 		HvCallPci_eoi(eventParm->eventData.slotInterrupt.busNumber,
-			      eventParm->eventData.slotInterrupt.subBusNumber,
-			      eventParm->eventData.slotInterrupt.deviceId);
+			eventParm->eventData.slotInterrupt.subBusNumber,
+			eventParm->eventData.slotInterrupt.deviceId);
 		break;
 		/* Ignore error recovery events for now */
 	case XmPciLpEvent_BusCreated:
-		printk(KERN_INFO "XmPciLpEvent.c: system bus %d created\n", eventParm->eventData.busCreated.busNumber);
+		printk(KERN_INFO "XmPciLpEvent.c: system bus %d created\n",
+			eventParm->eventData.busCreated.busNumber);
 		break;
 	case XmPciLpEvent_BusError:
 	case XmPciLpEvent_BusFailed:
-		printk(KERN_INFO "XmPciLpEvent.c: system bus %d failed\n", eventParm->eventData.busFailed.busNumber);
+		printk(KERN_INFO "XmPciLpEvent.c: system bus %d failed\n",
+			eventParm->eventData.busFailed.busNumber);
 		break;
 	case XmPciLpEvent_BusRecovered:
 	case XmPciLpEvent_UnQuiesceBus:
-		printk(KERN_INFO "XmPciLpEvent.c: system bus %d recovered\n", eventParm->eventData.busRecovered.busNumber);
+		printk(KERN_INFO "XmPciLpEvent.c: system bus %d recovered\n",
+			eventParm->eventData.busRecovered.busNumber);
 		break;
 	case XmPciLpEvent_NodeFailed:
 	case XmPciLpEvent_BridgeError:
-		printk(KERN_INFO "XmPciLpEvent.c: multi-adapter bridge %d/%d/%d failed\n", eventParm->eventData.nodeFailed.busNumber, eventParm->eventData.nodeFailed.subBusNumber, eventParm->eventData.nodeFailed.deviceId);
+		printk(KERN_INFO
+			"XmPciLpEvent.c: multi-adapter bridge %d/%d/%d failed\n",
+			eventParm->eventData.nodeFailed.busNumber,
+			eventParm->eventData.nodeFailed.subBusNumber,
+			eventParm->eventData.nodeFailed.deviceId);
 		break;
 	case XmPciLpEvent_NodeRecovered:
-		printk(KERN_INFO "XmPciLpEvent.c: multi-adapter bridge %d/%d/%d recovered\n", eventParm->eventData.nodeRecovered.busNumber, eventParm->eventData.nodeRecovered.subBusNumber, eventParm->eventData.nodeRecovered.deviceId);
+		printk(KERN_INFO
+			"XmPciLpEvent.c: multi-adapter bridge %d/%d/%d recovered\n",
+			eventParm->eventData.nodeRecovered.busNumber,
+			eventParm->eventData.nodeRecovered.subBusNumber,
+			eventParm->eventData.nodeRecovered.deviceId);
 		break;
 	default:
-		printk(KERN_ERR "XmPciLpEvent.c: unrecognized event subtype 0x%x\n",
-		       eventParm->hvLpEvent.xSubtype);
+		printk(KERN_ERR
+			"XmPciLpEvent.c: unrecognized event subtype 0x%x\n",
+			eventParm->hvLpEvent.xSubtype);
 		break;
-	};
+	}
 }
 
 
@@ -145,18 +169,22 @@
 int XmPciLpEvent_init()
 {
 	int xRc;
-	PPCDBG(PPCDBG_BUSWALK,"XmPciLpEvent_init, Register Event type 0x%04X\n",HvLpEvent_Type_PciIo);
 
-	xRc = HvLpEvent_registerHandler(HvLpEvent_Type_PciIo, &XmPciLpEvent_handler);
+	PPCDBG(PPCDBG_BUSWALK,
+			"XmPciLpEvent_init, Register Event type 0x%04X\n",
+			HvLpEvent_Type_PciIo);
+
+	xRc = HvLpEvent_registerHandler(HvLpEvent_Type_PciIo,
+			&XmPciLpEvent_handler);
 	if (xRc == 0) {
 		xRc = HvLpEvent_openPath(HvLpEvent_Type_PciIo, 0);
-		if (xRc != 0) {
-			printk(KERN_ERR "XmPciLpEvent.c: open event path failed with rc 0x%x\n", xRc);
-		}
-	}
-	else {
-		printk(KERN_ERR "XmPciLpEvent.c: register handler failed with rc 0x%x\n", xRc);
-    	}
-    return xRc;
+		if (xRc != 0)
+			printk(KERN_ERR
+				"XmPciLpEvent.c: open event path failed with rc 0x%x\n",
+				xRc);
+	} else
+		printk(KERN_ERR
+			"XmPciLpEvent.c: register handler failed with rc 0x%x\n",
+			xRc);
+	return xRc;
 }
-
diff -Nru a/arch/ppc64/kernel/asm-offsets.c b/arch/ppc64/kernel/asm-offsets.c
--- a/arch/ppc64/kernel/asm-offsets.c	Tue Feb  3 19:45:33 2004
+++ b/arch/ppc64/kernel/asm-offsets.c	Tue Feb  3 19:45:33 2004
@@ -13,6 +13,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 
+#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -56,6 +57,12 @@
 	DEFINE(THREAD_FPSCR, offsetof(struct thread_struct, fpscr));
 	DEFINE(KSP, offsetof(struct thread_struct, ksp));
 
+#ifdef CONFIG_ALTIVEC
+	DEFINE(THREAD_VR0, offsetof(struct thread_struct, vr[0]));
+	DEFINE(THREAD_VRSAVE, offsetof(struct thread_struct, vrsave));
+	DEFINE(THREAD_VSCR, offsetof(struct thread_struct, vscr));
+	DEFINE(THREAD_USED_VR, offsetof(struct thread_struct, used_vr));
+#endif /* CONFIG_ALTIVEC */
 	DEFINE(MM, offsetof(struct task_struct, mm));
 
 	/* naca */
diff -Nru a/arch/ppc64/kernel/chrp_setup.c b/arch/ppc64/kernel/chrp_setup.c
--- a/arch/ppc64/kernel/chrp_setup.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc64/kernel/chrp_setup.c	Tue Feb  3 19:45:17 2004
@@ -57,6 +57,7 @@
 #include <asm/irq.h>
 #include <asm/naca.h>
 #include <asm/time.h>
+#include <asm/nvram.h>
 
 #include "i8259.h"
 #include "open_pic.h"
@@ -64,8 +65,6 @@
 #include <asm/ppcdebug.h>
 #include <asm/cputable.h>
 
-extern volatile unsigned char *chrp_int_ack_special;
-
 void chrp_progress(char *, unsigned short);
 
 extern void openpic_init_IRQ(void);
@@ -96,16 +95,19 @@
 
 	seq_printf(m, "timebase\t: %lu\n", ppc_tb_freq);
 
-	root = find_path_device("/");
+	root = of_find_node_by_path("/");
 	if (root)
 		model = get_property(root, "model", NULL);
 	seq_printf(m, "machine\t\t: CHRP %s\n", model);
+	of_node_put(root);
 }
 
 #define I8042_DATA_REG 0x60
 
-void __init chrp_request_regions(void) 
+void __init chrp_request_regions(void)
 {
+	struct device_node *i8042;
+
 	request_region(0x20,0x20,"pic1");
 	request_region(0xa0,0x20,"pic2");
 	request_region(0x00,0x20,"dma1");
@@ -118,8 +120,9 @@
 	 * tree and reserve the region if it does not appear. Later on
 	 * the i8042 code will try and reserve this region and fail.
 	 */
-	if (!find_type_devices("8042"))
+	if (!(i8042 = of_find_node_by_type(NULL, "8042")))
 		request_region(I8042_DATA_REG, 16, "reserved (no i8042)");
+	of_node_put(i8042);
 }
 
 void __init
@@ -158,7 +161,7 @@
 #endif
 
 	/* Find the Open PIC if present */
-	root = find_path_device("/");
+	root = of_find_node_by_path("/");
 	opprop = (unsigned int *) get_property(root,
 				"platform-open-pic", NULL);
 	if (opprop != 0) {
@@ -170,6 +173,7 @@
 		printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic);
 		OpenPIC_Addr = __ioremap(openpic, 0x40000, _PAGE_NO_CACHE);
 	}
+	of_node_put(root);
 
 #ifdef CONFIG_DUMMY_CONSOLE
 	conswitchp = &dummy_con;
@@ -229,6 +233,10 @@
 chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
 	  unsigned long r6, unsigned long r7)
 {
+	struct device_node * dn;
+	char * hypertas;
+	unsigned int len;
+
 #if 0 /* PPPBBB remove this later... -Peter */
 #ifdef CONFIG_BLK_DEV_INITRD
 	/* take care of initrd if we have one */
@@ -262,36 +270,40 @@
 	ppc_md.set_rtc_time   = pSeries_set_rtc_time;
 	ppc_md.calibrate_decr = pSeries_calibrate_decr;
 
-	ppc_md.progress = chrp_progress;
+	ppc_md.progress       = chrp_progress;
+
+	ppc_md.nvram_read     = pSeries_nvram_read;
+	ppc_md.nvram_write    = pSeries_nvram_write;
 
-        /* build up the firmware_features bitmask field
+        /* Build up the firmware_features bitmask field
          * using contents of device-tree/ibm,hypertas-functions.
          * Ultimately this functionality may be moved into prom.c prom_init().
          */
-	struct device_node * dn;
-	char * hypertas;
-	unsigned int len;
-	dn = find_path_device("/rtas");
+	dn = of_find_node_by_path("/rtas");
 	cur_cpu_spec->firmware_features = 0;
 	hypertas = get_property(dn, "ibm,hypertas-functions", &len);
 	if (hypertas) {
-	    while (len > 0){
-		int i;
-		/* check value against table of strings */
-		for(i=0; i < FIRMWARE_MAX_FEATURES ;i++) {
-		    if ((firmware_features_table[i].name) && (strcmp(firmware_features_table[i].name,hypertas))==0) {
-			/* we have a match */
-			cur_cpu_spec->firmware_features |= (1UL << firmware_features_table[i].val);
-			break;
-		    } 
+		while (len > 0){
+			int i, hypertas_len;
+			/* check value against table of strings */
+			for(i=0; i < FIRMWARE_MAX_FEATURES ;i++) {
+				if ((firmware_features_table[i].name) &&
+				    (strcmp(firmware_features_table[i].name,hypertas))==0) {
+					/* we have a match */
+					cur_cpu_spec->firmware_features |= 
+						(firmware_features_table[i].val);
+					break;
+				} 
+			}
+			hypertas_len = strlen(hypertas);
+			len -= hypertas_len +1;
+			hypertas+= hypertas_len +1;
 		}
-		int hypertas_len = strlen(hypertas);
-		len -= hypertas_len +1;
-		hypertas+= hypertas_len +1;
-	    }
 	}
-	udbg_printf("firmware_features bitmask: 0x%x \n",
-		    cur_cpu_spec->firmware_features);
+
+	of_node_put(dn);
+	printk(KERN_INFO "firmware_features = 0x%lx\n", 
+	       cur_cpu_spec->firmware_features);
 }
 
 void
@@ -319,6 +331,13 @@
 		display_character = rtas_token("display-character");
 		set_indicator = rtas_token("set-indicator");
 	}
+	if (display_character == RTAS_UNKNOWN_SERVICE) {
+		/* use hex display */
+		if (set_indicator == RTAS_UNKNOWN_SERVICE)
+			return;
+		rtas_call(set_indicator, 3, 1, NULL, 6, 0, hex);
+		return;
+	}
 
 	if(display_character == RTAS_UNKNOWN_SERVICE) {
 		/* use hex display if available */
@@ -405,11 +424,11 @@
 
 	/*
 	 * The cpu node should have a timebase-frequency property
-	 * to tell us the rate at which the decrementer counts. 
+	 * to tell us the rate at which the decrementer counts.
 	 */
 	freq = 16666000;        /* hardcoded default */
-	cpu = find_type_devices("cpu");
-	if (cpu != 0) { 
+	cpu = of_find_node_by_type(NULL, "cpu");
+	if (cpu != 0) {
 		fp = (int *) get_property(cpu, "timebase-frequency", NULL);
 		if (fp != 0)
 			freq = *fp;
@@ -422,11 +441,12 @@
 			processor_freq = *fp;
 	}
 	ppc_proc_freq = processor_freq;
-	
-        printk("time_init: decrementer frequency = %lu.%.6lu MHz\n", 
-	       freq/1000000, freq%1000000 );
+	of_node_put(cpu);
+
+	printk("time_init: decrementer frequency = %lu.%.6lu MHz\n",
+	       freq/1000000, freq%1000000);
 	printk("time_init: processor frequency   = %lu.%.6lu MHz\n",
-		processor_freq/1000000, processor_freq%1000000 );
+	       processor_freq/1000000, processor_freq%1000000);
 
 	tb_ticks_per_jiffy = freq / HZ;
 	tb_ticks_per_sec = tb_ticks_per_jiffy * HZ;
diff -Nru a/arch/ppc64/kernel/cputable.c b/arch/ppc64/kernel/cputable.c
--- a/arch/ppc64/kernel/cputable.c	Tue Feb  3 19:45:16 2004
+++ b/arch/ppc64/kernel/cputable.c	Tue Feb  3 19:45:16 2004
@@ -21,6 +21,13 @@
 
 struct cpu_spec* cur_cpu_spec = NULL;
 
+/* NOTE:
+ * Unlike ppc32, ppc64 will only call this once for the boot CPU, it's
+ * the responsibility of the appropriate CPU save/restore functions to
+ * eventually copy these settings over. Those save/restore aren't yet
+ * part of the cputable though. That has to be fixed for both ppc32
+ * and ppc64
+ */
 extern void __setup_cpu_power3(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_power4(unsigned long offset, struct cpu_spec* spec);
 
@@ -30,8 +37,10 @@
  */
 #ifdef CONFIG_ALTIVEC
 #define CPU_FTR_ALTIVEC_COMP	CPU_FTR_ALTIVEC
+#define PPC_FEATURE_HAS_ALTIVEC_COMP PPC_FEATURE_HAS_ALTIVEC
 #else
 #define CPU_FTR_ALTIVEC_COMP	0
+#define PPC_FEATURE_HAS_ALTIVEC_COMP    0
 #endif
 
 struct cpu_spec	cpu_specs[] = {
@@ -107,6 +116,24 @@
 	    __setup_cpu_power4,
 	    COMMON_PPC64_FW
     },
+    {	/* PPC970 */
+	    0xffff0000, 0x00390000, "PPC970",
+	    CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
+	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP,
+	    COMMON_USER_PPC64 | PPC_FEATURE_HAS_ALTIVEC_COMP,
+	    128, 128,
+	    __setup_cpu_power4,
+	    COMMON_PPC64_FW
+    },
+    {	/* Power5 */
+	    0xffff0000, 0x003a0000, "Power5",
+	    CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
+	    CPU_FTR_PPCAS_ARCH_V2,
+	    COMMON_USER_PPC64,
+	    128, 128,
+	    __setup_cpu_power4,
+	    COMMON_PPC64_FW
+    },
     {	/* default match */
 	    0x00000000, 0x00000000, "(Power4-Compatible)",
   	    CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
@@ -130,4 +157,13 @@
     {FW_FEATURE_DUMP,		"hcall-dump"},
     {FW_FEATURE_INTERRUPT,	"hcall-interrupt"},
     {FW_FEATURE_MIGRATE,	"hcall-migrate"},
+    {FW_FEATURE_PERFMON,	"hcall-perfmon"},
+    {FW_FEATURE_CRQ,    	"hcall-crq"},
+    {FW_FEATURE_VIO,	        "hcall-vio"},
+    {FW_FEATURE_RDMA,	        "hcall-rdma"},
+    {FW_FEATURE_LLAN,	        "hcall-lLAN"},
+    {FW_FEATURE_BULK,   	"hcall-bulk"},
+    {FW_FEATURE_XDABR,  	"hcall-xdabr"},
+    {FW_FEATURE_MULTITCE,	"hcall-multi-tce"},
+    {FW_FEATURE_SPLPAR,	        "hcall-splpar"},
 };
diff -Nru a/arch/ppc64/kernel/eeh.c b/arch/ppc64/kernel/eeh.c
--- a/arch/ppc64/kernel/eeh.c	Tue Feb  3 19:45:33 2004
+++ b/arch/ppc64/kernel/eeh.c	Tue Feb  3 19:45:33 2004
@@ -257,7 +257,7 @@
 
 	/* Enable EEH for all adapters.  Note that eeh requires buid's */
 	info.adapters_enabled = 0;
-	for (phb = find_devices("pci"); phb; phb = phb->next) {
+	for (phb = of_find_node_by_name(NULL, "pci"); phb; phb = of_find_node_by_name(phb, "pci")) {
 		int len;
 		int *buid_vals = (int *) get_property(phb, "ibm,fw-phb-id", &len);
 		if (!buid_vals)
diff -Nru a/arch/ppc64/kernel/entry.S b/arch/ppc64/kernel/entry.S
--- a/arch/ppc64/kernel/entry.S	Tue Feb  3 19:45:16 2004
+++ b/arch/ppc64/kernel/entry.S	Tue Feb  3 19:45:16 2004
@@ -29,6 +29,7 @@
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
 #include <asm/offsets.h>
+#include <asm/cputable.h>
 
 #ifdef CONFIG_PPC_ISERIES
 #define DO_SOFT_DISABLE
@@ -211,6 +212,15 @@
 	.align	2,0
 #endif
 
+	
+_GLOBAL(ppc32_swapcontext)
+	bl	.sys32_swapcontext
+	b	80f
+	
+_GLOBAL(ppc64_swapcontext)
+	bl	.sys_swapcontext
+	b	80f
+
 _GLOBAL(ppc32_sigreturn)
 	bl	.sys32_sigreturn
 	b	80f
@@ -261,10 +271,17 @@
 	SAVE_10GPRS(22, r1)
 	mflr	r20		/* Return to switch caller */
 	mfmsr	r22
-	andi.	r21, r22, MSR_FP
+	li	r0, MSR_FP
+#ifdef CONFIG_ALTIVEC
+BEGIN_FTR_SECTION
+	oris	r0,r0,MSR_VEC@h	/* Disable altivec */
+	mfspr	r24,SPRN_VRSAVE	/* save vrsave register value */
+	std	r24,THREAD_VRSAVE(r3)
+END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
+#endif /* CONFIG_ALTIVEC */
+	and.	r0,r0,r22
 	beq+	1f
-	li	r6,MSR_FP	/* Disable floating-point */
-	andc	r22,r22,r6
+	andc	r22,r22,r0
 	mtmsrd	r22
 	isync
 1:	std	r20,_NIP(r1)
@@ -275,22 +292,30 @@
 	addi	r6,r4,-THREAD	/* Convert THREAD to 'current' */
 	std	r6,PACACURRENT(r13)	/* Set new 'current' */
 
-#ifdef CONFIG_PPC_ISERIES
-#error fixme
-	ld	r7,TI_FLAGS(r4)	/* Get run light flag */
-	mfspr	r9,CTRLF
-	srdi	r7,r7,1		/* Align to run light bit in CTRL reg */
-	insrdi	r9,r7,1,63	/* Insert run light into CTRL */
-	mtspr	CTRLT,r9
-#endif
-
 	ld	r1,KSP(r4)	/* Load new stack pointer */
 	ld	r6,_CCR(r1)
 	mtcrf	0xFF,r6
+
+#ifdef CONFIG_ALTIVEC
+BEGIN_FTR_SECTION
+	ld	r0,THREAD_VRSAVE(r4)
+	mtspr	SPRN_VRSAVE,r0		/* if G4, restore VRSAVE reg */
+END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
+#endif /* CONFIG_ALTIVEC */
+
 	/* r3-r13 are destroyed -- Cort */
 	REST_8GPRS(14, r1)
 	REST_10GPRS(22, r1)
 
+#ifdef CONFIG_PPC_ISERIES
+	clrrdi	r7,r1,THREAD_SHIFT	/* get current_thread_info() */
+	ld	r7,TI_FLAGS(r7)		/* Get run light flag */
+	mfspr	r9,CTRLF
+	srdi	r7,r7,TIF_RUN_LIGHT
+	insrdi	r9,r7,1,63		/* Insert run light into CTRL */
+	mtspr	CTRLT,r9
+#endif
+
 	/* convert old thread to its task_struct for return value */
 	addi	r3,r3,-THREAD
 	ld	r7,_NIP(r1)	/* Return to _switch caller in new task */
@@ -308,39 +333,16 @@
 	b	.ret_from_except
 
 _GLOBAL(ret_from_except)
-#ifdef CONFIG_PPC_ISERIES
-	ld	r5,SOFTE(r1)
-	cmpdi	0,r5,0
-	beq	4f
-irq_recheck:
-	/* Check for pending interrupts (iSeries) */
-	CHECKANYINT(r3,r4)
-	beq+	4f	/* skip do_IRQ if no interrupts */
-
-#warning FIX ISERIES
-	mfspr	r5,SPRG3
-	li	r3,0
-	stb	r3,PACAPROCENABLED(r5)	/* ensure we are disabled */
-	addi	r3,r1,STACK_FRAME_OVERHEAD
-	bl	.do_IRQ
-	b	irq_recheck	/* loop back and handle more */
-4:
-#endif
 	/*
 	 * Disable interrupts so that current_thread_info()->flags
 	 * can't change between when we test it and when we return
 	 * from the interrupt.
 	 */
-recheck:
 	mfmsr	r10		/* Get current interrupt state */
 	li	r4,0
 	ori	r4,r4,MSR_EE
-	andc	r10,r10,r4	/* clear MSR_EE */
-	mtmsrd	r10,1		/* Update machine state */
-
-#ifdef CONFIG_PPC_ISERIES
-#error fix iSeries soft disable
-#endif
+	andc	r9,r10,r4	/* clear MSR_EE */
+	mtmsrd	r9,1		/* Update machine state */
 
 	ld	r3,_MSR(r1)	/* Returning to user mode? */
 	andi.	r3,r3,MSR_PR
@@ -364,6 +366,28 @@
 	REST_GPR(13,r1)
 
 restore:
+#ifdef CONFIG_PPC_ISERIES
+	ld	r5,SOFTE(r1)
+	mfspr	r4,SPRG3		/* get paca address */
+	cmpdi	0,r5,0
+	beq	4f
+	/* Check for pending interrupts (iSeries) */
+	/* this is CHECKANYINT except that we already have the paca address */
+	ld	r3,PACALPPACA+LPPACAANYINT(r4)
+	cmpdi	r3,0
+	beq+	4f			/* skip do_IRQ if no interrupts */
+
+	mfspr	r13,SPRG3		/* get paca pointer back */
+	li	r3,0
+	stb	r3,PACAPROCENABLED(r13)	/* ensure we are soft-disabled */
+	mtmsrd	r10			/* hard-enable again */
+	addi	r3,r1,STACK_FRAME_OVERHEAD
+	bl	.do_IRQ
+	b	.ret_from_except		/* loop back and handle more */
+
+4:	stb	r5,PACAPROCENABLED(r4)
+#endif
+
 	ld	r3,_CTR(r1)
 	ld	r0,_LINK(r1)
 	mtctr	r3
@@ -377,12 +401,6 @@
 
 	stdcx.	r0,0,r1		/* to clear the reservation */
 
-#ifdef DO_SOFT_DISABLE
-	/* XXX do this in do_work, r13 isnt valid here */
-	ld	r0,SOFTE(r1)
-	stb	r0,PACAPROCENABLED(r13)
-#endif
-
 	mfmsr	r0
 	li	r2, MSR_RI
 	andc	r0,r0,r2
@@ -407,21 +425,21 @@
 /* Note: this must change if we start using the  TIF_NOTIFY_RESUME bit */
 do_work:
 	/* Enable interrupts */
-	ori	r10,r10,MSR_EE
 	mtmsrd	r10,1
 
 	andi.	r0,r3,_TIF_NEED_RESCHED
 	beq	1f
 	bl	.schedule
-	b	recheck
+	b	.ret_from_except
 
 1:	andi.	r0,r3,_TIF_SIGPENDING
-	beq	recheck
+	beq	.ret_from_except
 	li	r3,0
 	addi	r4,r1,STACK_FRAME_OVERHEAD
 	bl	.do_signal
-	b	recheck
+	b	.ret_from_except
 
+#ifdef CONFIG_PPC_PSERIES
 /*
  * On CHRP, the Run-Time Abstraction Services (RTAS) have to be
  * called with the MMU off.
@@ -498,6 +516,12 @@
 	mfspr	r4,SPRG3	        /* Get PACA */
 	SET_REG_TO_CONST(r5, KERNELBASE)
         sub     r4,r4,r5                /* RELOC the PACA base pointer */
+
+	mfmsr   r6
+	li	r0,MSR_RI
+	andc	r6,r6,r0
+	sync	
+	mtmsrd  r6
         
         ld	r1,PACAR1(r4)           /* Restore our SP */
 	LOADADDR(r3,.rtas_restore_regs)
@@ -626,3 +650,4 @@
 
 	mtlr    r0
         blr				/* return to caller */
+#endif	/* defined(CONFIG_PPC_PSERIES) */
diff -Nru a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S
--- a/arch/ppc64/kernel/head.S	Tue Feb  3 19:45:28 2004
+++ b/arch/ppc64/kernel/head.S	Tue Feb  3 19:45:28 2004
@@ -91,20 +91,26 @@
 	.text
 	.globl  _stext
 _stext:
+#ifdef CONFIG_PPC_PSERIES
 _STATIC(__start)
 	b .__start_initialization_pSeries
+#endif
 #ifdef CONFIG_PPC_ISERIES
-	/* At offset 0x20, there is a pointer to iSeries LPAR data.
-	 * This is required by the hypervisor */
+	/*
+	 * At offset 0x20, there is a pointer to iSeries LPAR data.
+	 * This is required by the hypervisor
+	 */
 	. = 0x20
 	.llong hvReleaseData-KERNELBASE
 
-	/* At offset 0x28 and 0x30 are offsets to the msChunks
+	/*
+	 * At offset 0x28 and 0x30 are offsets to the msChunks
 	 * array (used by the iSeries LPAR debugger to do translation
 	 * between physical addresses and absolute addresses) and
-	 * to the pidhash table (also used by the debugger) */
+	 * to the pidhash table (also used by the debugger)
+	 */
 	.llong msChunks-KERNELBASE
-	.llong pidhash-KERNELBASE
+	.llong 0 /* pidhash-KERNELBASE SFRXXX */
 
 	/* Offset 0x38 - Pointer to start of embedded System.map */
 	.globl	embedded_sysmap_start
@@ -114,7 +120,7 @@
 	.globl	embedded_sysmap_end
 embedded_sysmap_end:
 	.llong	0
-#endif
+#else
 
 	/* Secondary processors spin on this value until it goes to 1. */
 	.globl  __secondary_hold_spinloop
@@ -147,6 +153,7 @@
 	/* Relocation is off & we are located at an address less */
 	/* than 0x100, so only need to grab low order offset.    */
 	std     r24,__secondary_hold_acknowledge@l(0)
+	sync
 
 	/* All secondary cpu's wait here until told to start. */
 100:    ld      r4,__secondary_hold_spinloop@l(0)
@@ -163,6 +170,7 @@
 	BUG_OPCODE
 #endif
 #endif
+#endif
 
 /*
  * The following macros define the code that appears as
@@ -244,6 +252,14 @@
 	std	r22,EX_SRR0(r21);	    /* save SRR0 in exc. frame     */ \
 	ld      r23,LPPACA+LPPACASRR1(r20); /* Get SRR1 from ItLpPaca      */ \
 	std	r23,EX_SRR1(r21);	    /* save SRR1 in exc. frame     */ \
+                                                                         \
+	mfspr   r23,DAR;                /* Save DAR in exc. frame      */ \
+	std	r23,EX_DAR(r21);	                                  \
+	mfspr	r23,DSISR;		/* Save DSISR in exc. frame    */ \
+	stw	r23,EX_DSISR(r21);	                                  \
+	mfspr	r23,SPRG2;		/* Save r20 in exc. frame      */ \
+	std	r23,EX_R20(r21);	                                  \
+                                                                         \
 	mfcr    r23;                        /* save CR in r23              */
 
 /*
@@ -375,9 +391,34 @@
 	STD_EXCEPTION_PSERIES( 0xc00, SystemCall )
 	STD_EXCEPTION_PSERIES( 0xd00, SingleStep )
 	STD_EXCEPTION_PSERIES( 0xe00, Trap_0e )
-	STD_EXCEPTION_PSERIES( 0xf00, PerformanceMonitor )
+
+	/* We need to deal with the Altivec unavailable exception
+	 * here which is at 0xf20, thus in the middle of the
+	 * prolog code of the PerformanceMonitor one. A little
+	 * trickery is thus necessary
+	 */
+	. = 0xf00
+	b	.PerformanceMonitor_Pseries
+	. = 0xf20
+	b	.AltivecUnavailable_Pseries
+
 	STD_EXCEPTION_PSERIES( 0x1300, InstructionBreakpoint )
+	STD_EXCEPTION_PSERIES( 0x1700, AltivecAssist )
 
+	/* Here are the "moved" performance monitor and
+	 * altivec unavailable exceptions
+	 */
+	. = 0x3000
+	.globl PerformanceMonitor_Pseries;
+.PerformanceMonitor_Pseries:
+	EXCEPTION_PROLOG_PSERIES(0xf00, PerformanceMonitor_common)
+	
+	. = 0x3100
+	.globl AltivecUnavailable_Pseries;
+.AltivecUnavailable_Pseries:
+	EXCEPTION_PROLOG_PSERIES(0xf20, AltivecUnavailable_common)
+	
+		
 	/* Space for the naca.  Architected to be located at real address
 	 * NACA_PHYS_ADDR.  Various tools rely on this location being fixed.
 	 * The first dword of the naca is required by iSeries LPAR to
@@ -564,7 +605,11 @@
 	STD_EXCEPTION_COMMON( 0xe00, Trap_0e, .UnknownException )
 	STD_EXCEPTION_COMMON( 0xf00, PerformanceMonitor, .PerformanceMonitorException )
 	STD_EXCEPTION_COMMON(0x1300, InstructionBreakpoint, .InstructionBreakpointException )
-
+#ifdef CONFIG_ALTIVEC
+	STD_EXCEPTION_COMMON(0x1700, AltivecAssist, .AltivecAssistException )
+#else
+	STD_EXCEPTION_COMMON(0x1700, AltivecAssist, .UnknownException )
+#endif
 /*
  * Return from an exception which is handled without calling
  * save_remaining_regs.  The caller is assumed to have done
@@ -601,12 +646,14 @@
  */
 	.globl DataAccess_common
 DataAccess_common:
+BEGIN_FTR_SECTION
 	mfspr   r22,DAR
 	srdi    r22,r22,60
 	cmpi    0,r22,0xc
 
 	/* Segment fault on a bolted segment. Go off and map that segment. */
 	beq-	.do_stab_bolted
+END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
 stab_bolted_user_return:
 	EXCEPTION_PROLOG_COMMON
 	ld      r3,_DSISR(r1)
@@ -616,10 +663,12 @@
 	rlwinm	r4,r3,32-23,29,29	/* DSISR_STORE -> _PAGE_RW */
 	ld      r3,_DAR(r1)             /* into the hash table */
 
+BEGIN_FTR_SECTION
 	beq+	2f			/* If so handle it */
 	li	r4,0x300                /* Trap number */
 	bl	.do_stab_SI
 	b	1f
+END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
 
 2:	li	r5,0x300
 	bl	.do_hash_page_DSI 	/* Try to handle as hpte fault */
@@ -645,7 +694,7 @@
 	EXCEPTION_PROLOG_COMMON
 	ld      r3,_DAR(r1)
 	li      r4,0x380                /* Exception vector  */
-	bl	.ste_allocate
+	bl	.slb_allocate
 	or.	r3,r3,r3		/* Check return code */
 	beq     fast_exception_return   /* Return if we succeeded */
 	addi	r3,r1,STACK_FRAME_OVERHEAD
@@ -660,12 +709,14 @@
 InstructionAccess_common:
 	EXCEPTION_PROLOG_COMMON
 
+BEGIN_FTR_SECTION
 	andis.	r0,r23,0x0020		/* no ste found? */
 	beq+	2f
 	mr	r3,r22			/* SRR0 at interrupt */
 	li	r4,0x400		/* Trap number       */
 	bl	.do_stab_SI
 	b	1f
+END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
 
 2:	mr	r3,r22
 	li	r5,0x400
@@ -685,7 +736,7 @@
 	EXCEPTION_PROLOG_COMMON
 	mr      r3,r22                  /* SRR0 = NIA        */
 	li	r4,0x480                /* Exception vector  */
-	bl	.ste_allocate
+	bl	.slb_allocate
 	or.	r3,r3,r3		/* Check return code */
 	beq+	fast_exception_return   /* Return if we succeeded */
 
@@ -739,6 +790,23 @@
 	bl      .KernelFPUnavailableException
 	BUG_OPCODE
 
+	.globl AltivecUnavailable_common
+AltivecUnavailable_common:
+	EXCEPTION_PROLOG_COMMON
+#ifdef CONFIG_ALTIVEC
+	bne	.load_up_altivec		/* if from user, just load it up */
+#endif
+	addi	r3,r1,STACK_FRAME_OVERHEAD
+	DO_COPY_EE()
+	li	r6,0xf20
+	bl      .save_remaining_regs
+#ifdef CONFIG_ALTIVEC
+	bl	.KernelAltivecUnavailableException
+#else
+	bl      .UnknownException
+#endif
+	BUG_OPCODE
+		
 	.globl SystemCall_common
 SystemCall_common:
 	EXCEPTION_PROLOG_COMMON
@@ -944,48 +1012,27 @@
  * r20 - r23, SRR0 and SRR1 are saved in the exception frame.
  * We assume we aren't going to take any exceptions during this procedure.
  */
+/* XXX note fix masking in get_kernel_vsid to match */
 _GLOBAL(do_slb_bolted)
-	stw     r23,EX_CCR(r21) /* save CR in exc. frame */
-
-	/* (((ea >> 28) & 0x1fff) << 15) | (ea >> 60) */
-	mfspr	r21,DAR
-	rldicl  r20,r21,36,32   /* Permits a full 32b of ESID */
-	rldicr  r20,r20,15,48
-	rldicl  r21,r21,4,60
-	or      r20,r20,r21
-
-	li      r21,9           /* VSID_RANDOMIZER */
-	sldi    r21,r21,32
-	oris    r21,r21,58231
-	ori     r21,r21,39831
-
-	mulld   r20,r20,r21
-	clrldi  r20,r20,28      /* r20 = vsid */
+	stw	r23,EX_CCR(r21)		/* save CR in exc. frame */
 
-	/* Search the SLB for a free entry */
-	li      r22,1
-1:
-	slbmfee	r23,r22
-	rldicl  r23,r23,37,63
-	cmpwi   r23,0
-	beq     4f              /* Found an invalid entry              */
-
-	addi	r22,r22,1
-	cmpldi	r22,64
-	blt	1b
+	/*
+	 * We take the next entry, round robin. Previously we tried
+	 * to find a free slot first but that took too long. Unfortunately
+	 * we dont have any LRU information to help us choose a slot.
+	 */
 
-	/* No free entry - just take the next entry, round-robin */
-	/* XXX we should get the number of SLB entries from the naca */
+	/* r20 = paca */
+	/* use a cpu feature mask if we ever change our slb size */
 SLB_NUM_ENTRIES = 64
-2:	mfspr	r21,SPRG3
-	ld	r22,PACASTABRR(r21)
-	addi	r23,r22,1
-	cmpdi	r23,SLB_NUM_ENTRIES
-	blt	3f
-	li	r23,1
-3:	std	r23,PACASTABRR(r21)
+1:	ld	r22,PACASTABRR(r20)
+	addi	r21,r22,1
+	cmpdi	r21,SLB_NUM_ENTRIES
+	blt+	2f
+	li	r21,1			/* dont touch bolted slot 0 */
+2:	std	r21,PACASTABRR(r20)
 
-	/* r20 = vsid, r22 = entry */
+	/* r20 = paca, r22 = entry */
 
 	/* 
 	 * Never cast out the segment for our kernel stack. Since we
@@ -994,48 +1041,86 @@
 	 * which gets invalidated due to a tlbie from another cpu at a
 	 * non recoverable point (after setting srr0/1) - Anton
 	 */
-	slbmfee	r23,r22
-	srdi	r23,r23,28
+	slbmfee	r21,r22
+	srdi	r21,r21,27
 	/*
 	 * This is incorrect (r1 is not the kernel stack) if we entered
 	 * from userspace but there is no critical window from userspace
 	 * so this should be OK. Also if we cast out the userspace stack
 	 * segment while in userspace we will fault it straight back in.
 	 */
-	srdi	r21,r1,28
-	cmpd	r21,r23
-	beq-	2b
-
-	/* Put together the vsid portion of the entry. */
-4:	li      r21,0
-	rldimi  r21,r20,12,0
-	ori     r20,r21,1024
-	ori	r20,r20,128    /* set class bit for kernel region */
-#ifndef CONFIG_PPC_ISERIES
-	ori	r20,r20,256    /* map kernel region with large ptes */
-#endif
+	srdi	r23,r1,27
+	ori	r23,r23,1
+	cmpd	r23,r21
+	beq-	1b
+
+	/* r20 = paca, r22 = entry */
+
+	/* (((ea >> 28) & 0x1fff) << 15) | (ea >> 60) */
+	mfspr	r21,DAR
+	rldicl	r23,r21,36,51
+	sldi	r23,r23,15
+	srdi	r21,r21,60
+	or	r23,r23,r21
+
+	/* VSID_RANDOMIZER */
+	li	r21,9
+	sldi	r21,r21,32
+	oris	r21,r21,58231
+	ori	r21,r21,39831
+
+	/* vsid = (ordinal * VSID_RANDOMIZER) & VSID_MASK */
+	mulld	r23,r23,r21
+	clrldi	r23,r23,28
+
+	/* r20 = paca, r22 = entry, r23 = vsid */
+
+	/* Put together slb word1 */
+	sldi	r23,r23,12
+
+BEGIN_FTR_SECTION
+	/* set kp and c bits */
+	ori	r23,r23,0x480
+END_FTR_SECTION_IFCLR(CPU_FTR_16M_PAGE)
+BEGIN_FTR_SECTION
+	/* set kp, l and c bits */
+	ori	r23,r23,0x580
+END_FTR_SECTION_IFSET(CPU_FTR_16M_PAGE)
 
-	/* Put together the esid portion of the entry. */
-	mfspr	r21,DAR        /* Get the new esid                     */
-	rldicl  r21,r21,36,28  /* Permits a full 36b of ESID           */
-	li      r23,0
-	rldimi  r23,r21,28,0   /* Insert esid  */
-	oris    r21,r23,2048   /* valid bit    */
-	rldimi  r21,r22,0,52   /* Insert entry */
+	/* r20 = paca, r22 = entry, r23 = slb word1 */
+
+	/* Put together slb word0 */
+	mfspr	r21,DAR
+	rldicr	r21,r21,0,35	/* get the new esid */
+	oris	r21,r21,2048	/* set valid bit */
+	rldimi	r21,r22,0,52	/* insert entry */
+
+	/* r20 = paca, r21 = slb word0, r23 = slb word1 */
 
 	/* 
 	 * No need for an isync before or after this slbmte. The exception
 	 * we enter with and the rfid we exit with are context synchronizing .
 	 */
-	slbmte  r20,r21
+	slbmte	r23,r21
 
 	/* All done -- return from exception. */
-	mfsprg  r20,3                   /* Load the PACA pointer  */
-	ld      r21,PACAEXCSP(r20)      /* Get the exception frame pointer */
-	addi    r21,r21,EXC_FRAME_SIZE
+	ld	r21,PACAEXCSP(r20)	/* Get the exception frame pointer */
+	addi	r21,r21,EXC_FRAME_SIZE
 	lwz	r23,EX_CCR(r21)		/* get saved CR */
 	/* note that this is almost identical to maskable_exception_exit */
-	mtcr    r23                     /* restore CR */
+
+	/*
+	 * Until everyone updates binutils hardwire the POWER4 optimised
+	 * single field mtcrf
+	 */
+#if 0
+	.machine	push
+	.machine	"power4"
+	mtcrf	0x80,r23
+	.machine	pop
+#else
+	.long 0x7ef80120
+#endif
 
 	mfmsr	r22
 	li	r23, MSR_RI
@@ -1045,10 +1130,10 @@
 	ld	r22,EX_SRR0(r21)	/* Get SRR0 from exc. frame */
 	ld	r23,EX_SRR1(r21)	/* Get SRR1 from exc. frame */
 	mtspr	SRR0,r22
-	mtspr   SRR1,r23
+	mtspr	SRR1,r23
 	ld	r22,EX_R22(r21)		/* restore r22 and r23 */
 	ld	r23,EX_R23(r21)
-	mfspr	r20,SPRG2
+	ld	r20,EX_R20(r21)
 	mfspr	r21,SPRG1
 	rfid
 
@@ -1113,7 +1198,6 @@
 	SET_REG_TO_CONST(r22, MSR_KERNEL)
 
 #ifdef DO_SOFT_DISABLE
-#warning FIX ISERIES
 	stb	r20,PACAPROCENABLED(r13) /* possibly soft enable */
 	ori	r22,r22,MSR_EE		/* always hard enable */
 #else
@@ -1187,7 +1271,21 @@
 	b 	1b			 /* Loop until told to go         */
 #ifdef CONFIG_PPC_ISERIES
 _GLOBAL(__start_initialization_iSeries)
+	/* Clear out the BSS */
+	LOADADDR(r11,__bss_stop)
 
+	LOADADDR(r8,__bss_start)
+
+	sub	r11,r11,r8        /* bss size                        */
+	addi	r11,r11,7         /* round up to an even double word */
+	rldicl. r11,r11,61,3      /* shift right by 3                */
+	beq	4f
+	addi	r8,r8,-8
+	li	r0,0
+	mtctr	r11		  /* zero this many doublewords      */
+3:	stdu	r0,8(r8)
+	bdnz	3b
+4:
 	LOADADDR(r1,init_thread_union)
 	addi	r1,r1,THREAD_SIZE
 	li	r0,0
@@ -1216,9 +1314,12 @@
 
 	bl      .iSeries_fixup_klimit
 
+	/* relocation is on at this point */
+
 	b	.start_here_common
 #endif
 
+#ifdef CONFIG_PPC_PSERIES
 _GLOBAL(__start_initialization_pSeries)
 	mr	r31,r3			/* save parameters */
 	mr	r30,r4
@@ -1238,20 +1339,6 @@
 	/* Relocate the TOC from a virt addr to a real addr */
 	sub	r2,r2,r3
 
-	/* setup the systemcfg pointer which is needed by prom_init       */
-	LOADADDR(r9,systemcfg)
-	sub	r9,r9,r3                /* addr of the variable systemcfg */
-	SET_REG_TO_CONST(r4, SYSTEMCFG_VIRT_ADDR)
-	sub	r4,r4,r3
-	std	r4,0(r9)		/* set the value of systemcfg     */
-
-	/* setup the naca pointer which is needed by prom_init            */
-	LOADADDR(r9,naca)
-	sub	r9,r9,r3                /* addr of the variable naca      */
-	SET_REG_TO_CONST(r4, NACA_VIRT_ADDR)
-	sub	r4,r4,r3
-	std	r4,0(r9)		/* set the value of naca          */
-
 	/* DRENG / PPPBBB Fix the following comment!!! -Peter */
 	/* The following copies the first 0x100 bytes of code from the    */
 	/* load addr to physical addr 0x0.  This code causes secondary    */
@@ -1328,6 +1415,7 @@
 	sub	r5,r5,r27
 	bl	.copy_and_flush		/* copy the rest */
 	b	.start_here_pSeries
+#endif
 
 /*
  * Copy routine used to copy the kernel to start at physical address 0
@@ -1466,6 +1554,126 @@
 #endif /* CONFIG_SMP */
 	blr
 
+
+#ifdef CONFIG_ALTIVEC
+		
+/*
+ * load_up_altivec(unused, unused, tsk)
+ * Disable VMX for the task which had it previously,
+ * and save its vector registers in its thread_struct.
+ * Enables the VMX for use in the kernel on return.
+ * On SMP we know the VMX is free, since we give it up every
+ * switch (ie, no lazy save of the vector registers).
+ * On entry: r13 == 'current' && last_task_used_altivec != 'current'
+ */
+_STATIC(load_up_altivec)
+	mfmsr	r5                      /* grab the current MSR */
+	oris	r5,r5,MSR_VEC@h
+	mtmsrd  r5			/* enable use of VMX now */
+	isync
+	
+/*
+ * For SMP, we don't do lazy VMX switching because it just gets too
+ * horrendously complex, especially when a task switches from one CPU
+ * to another.  Instead we call giveup_altvec in switch_to.
+ * VRSAVE isn't dealt with here, that is done in the normal context
+ * switch code. Note that we could rely on vrsave value to eventually
+ * avoid saving all of the VREGs here...
+ */
+#ifndef CONFIG_SMP
+	LOADBASE(r3,last_task_used_altivec)
+	ld	r4,last_task_used_altivec@l(r3)
+	cmpi	0,r4,0
+	beq	1f
+	/* Save VMX state to last_task_used_altivec's THREAD struct */
+	addi	r4,r4,THREAD
+	SAVE_32VRS(0,r5,r4)
+	mfvscr	vr0
+	li	r10,THREAD_VSCR
+	stvx	vr0,r10,r4
+	/* Disable VMX for last_task_used_altivec */
+	ld	r5,PT_REGS(r4)
+	ld	r4,_MSR-STACK_FRAME_OVERHEAD(r5)
+	lis	r20,MSR_VEC@h
+	andc	r4,r4,r20
+	std	r4,_MSR-STACK_FRAME_OVERHEAD(r5)
+1:
+#endif /* CONFIG_SMP */
+	/* Hack: if we get an altivec unavailable trap with VRSAVE
+	 * set to all zeros, we assume this is a broken application
+	 * that fails to set it properly, and thus we switch it to
+	 * all 1's
+	 */
+	mfspr	r4,SPRN_VRSAVE
+	cmpi	0,r4,0
+	bne+	1f
+	li	r4,-1
+	mtspr	SPRN_VRSAVE,r4
+1:
+	/* enable use of VMX after return */
+	ld	r4,PACACURRENT(r13)
+	addi	r5,r4,THREAD		/* Get THREAD */
+	oris	r23,r23,MSR_VEC@h
+	li	r4,1
+	li	r10,THREAD_VSCR
+	stw	r4,THREAD_USED_VR(r5)
+	lvx	vr0,r10,r5
+	REST_32VRS(0,r4,r5)
+#ifndef CONFIG_SMP
+	/* Update last_task_used_math to 'current' */
+	subi	r4,r5,THREAD		/* Back to 'current' */
+	std	r4,last_task_used_altivec@l(r3)
+#endif /* CONFIG_SMP */
+	/* restore registers and return */
+	b	fast_exception_return
+
+/*
+ * disable_kernel_altivec()
+ * Disable the VMX.
+ */
+_GLOBAL(disable_kernel_altivec)
+	mfmsr   r3
+	rldicl  r0,r3,(63-MSR_VEC_LG),1
+	rldicl  r3,r0,(MSR_VEC_LG+1),0
+	mtmsrd  r3			/* disable use of VMX now */
+	isync
+	blr
+
+/*
+ * giveup_altivec(tsk)
+ * Disable VMX for the task given as the argument,
+ * and save the vector registers in its thread_struct.
+ * Enables the VMX for use in the kernel on return.
+ */
+_GLOBAL(giveup_altivec)
+	mfmsr	r5
+	oris	r5,r5,MSR_VEC@h
+	mtmsrd	r5			/* enable use of VMX now */
+	isync
+	cmpi	0,r3,0
+	beqlr-				/* if no previous owner, done */
+	addi	r3,r3,THREAD		/* want THREAD of task */
+	ld	r5,PT_REGS(r3)
+	cmpi	0,r5,0
+	SAVE_32VRS(0,r4,r3)
+	mfvscr	vr0
+	li	r4,THREAD_VSCR
+	stvx	vr0,r4,r3
+	beq	1f
+	ld	r4,_MSR-STACK_FRAME_OVERHEAD(r5)
+	lis	r3,MSR_VEC@h
+	andc	r4,r4,r3		/* disable FP for previous task */
+	std	r4,_MSR-STACK_FRAME_OVERHEAD(r5)
+1:
+#ifndef CONFIG_SMP
+	li	r5,0
+	LOADBASE(r4,last_task_used_altivec)
+	std	r5,last_task_used_altivec@l(r4)
+#endif /* CONFIG_SMP */
+	blr
+
+#endif /* CONFIG_ALTIVEC */
+
 #ifdef CONFIG_SMP
 /*
  * This function is called after the master CPU has released the
@@ -1594,6 +1802,7 @@
 	isync
 	blr
 
+#ifdef CONFIG_PPC_PSERIES
 /*
  * This is where the main kernel code starts.
  */
@@ -1729,27 +1938,11 @@
 	mtspr	SRR0,r3
 	mtspr	SRR1,r4
 	rfid
+#endif	/* CONFIG_PPC_PSERIES */
 
 	/* This is where all platforms converge execution */
 _STATIC(start_here_common)
-	/* relocation is on at this point */
-
-	/* Clear out the BSS */
-	LOADADDR(r11,_end)
-
-	LOADADDR(r8,__bss_start)
-
-	sub	r11,r11,r8        /* bss size                        */
-	addi	r11,r11,7         /* round up to an even double word */
-	rldicl. r11,r11,61,3      /* shift right by 3                */
-	beq	4f
-	addi	r8,r8,-8
-	li	r0,0
-	mtctr	r11		  /* zero this many doublewords      */
-3:	stdu	r0,8(r8)
-	bdnz	3b
-4:
-
+	
 	/* The following code sets up the SP and TOC now that we are */
 	/* running with translation enabled. */
 
@@ -1765,6 +1958,12 @@
 	addi    r2,r2,0x4000
 	addi    r2,r2,0x4000
 
+	/* Apply the CPUs-specific fixups (nop out sections not relevant
+	 * to this CPU
+	 */
+	li	r3,0
+	bl	.do_cpu_ftr_fixups
+
 	/* setup the systemcfg pointer */
 	LOADADDR(r9,systemcfg)
 	SET_REG_TO_CONST(r8, SYSTEMCFG_VIRT_ADDR)
@@ -1803,10 +2002,8 @@
 	/* Load up the kernel context */
 5:
 #ifdef DO_SOFT_DISABLE
-#warning FIX ISERIES
-	mfspr	r4,SPRG3
 	li	r5,0
-	stb	r5,PACAPROCENABLED(r4)	/* Soft Disabled */
+	stb	r5,PACAPROCENABLED(r13)	/* Soft Disabled */
 	mfmsr	r5
 	ori	r5,r5,MSR_EE		/* Hard Enabled */
 	mtmsrd	r5
diff -Nru a/arch/ppc64/kernel/htab.c b/arch/ppc64/kernel/htab.c
--- a/arch/ppc64/kernel/htab.c	Tue Feb  3 19:45:29 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,491 +0,0 @@
-/*
- * PowerPC64 port by Mike Corrigan and Dave Engebretsen
- *   {mikejc|engebret}@us.ibm.com
- *
- *    Copyright (c) 2000 Mike Corrigan <mikejc@us.ibm.com>
- *
- * SMP scalability work:
- *    Copyright (C) 2001 Anton Blanchard <anton@au.ibm.com>, IBM
- * 
- *    Module name: htab.c
- *
- *    Description:
- *      PowerPC Hashed Page Table functions
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#include <linux/spinlock.h>
-#include <linux/errno.h>
-#include <linux/sched.h>
-#include <linux/proc_fs.h>
-#include <linux/stat.h>
-#include <linux/sysctl.h>
-#include <linux/ctype.h>
-#include <linux/cache.h>
-
-#include <asm/ppcdebug.h>
-#include <asm/processor.h>
-#include <asm/pgtable.h>
-#include <asm/mmu.h>
-#include <asm/mmu_context.h>
-#include <asm/page.h>
-#include <asm/types.h>
-#include <asm/system.h>
-#include <asm/uaccess.h>
-#include <asm/naca.h>
-#include <asm/pmc.h>
-#include <asm/machdep.h>
-#include <asm/lmb.h>
-#include <asm/abs_addr.h>
-#include <asm/tlbflush.h>
-#include <asm/io.h>
-#include <asm/eeh.h>
-#include <asm/tlb.h>
-#include <asm/cacheflush.h>
-#include <asm/cputable.h>
-
-/*
- * Note:  pte   --> Linux PTE
- *        HPTE  --> PowerPC Hashed Page Table Entry
- *
- * Execution context:
- *   htab_initialize is called with the MMU off (of course), but
- *   the kernel has been copied down to zero so it can directly
- *   reference global data.  At this point it is very difficult
- *   to print debug info.
- *
- */
-
-HTAB htab_data = {NULL, 0, 0, 0, 0};
-
-extern unsigned long _SDR1;
-
-#define KB (1024)
-#define MB (1024*KB)
-
-static inline void
-loop_forever(void)
-{
-	volatile unsigned long x = 1;
-	for(;x;x|=1)
-		;
-}
-
-static inline void
-create_pte_mapping(unsigned long start, unsigned long end,
-		   unsigned long mode, int large)
-{
-	unsigned long addr;
-	unsigned int step;
-
-	if (large)
-		step = 16*MB;
-	else
-		step = 4*KB;
-
-	for (addr = start; addr < end; addr += step) {
-		unsigned long vpn, hash, hpteg;
-		unsigned long vsid = get_kernel_vsid(addr);
-		unsigned long va = (vsid << 28) | (addr & 0xfffffff);
-		int ret;
-
-		if (large)
-			vpn = va >> LARGE_PAGE_SHIFT;
-		else
-			vpn = va >> PAGE_SHIFT;
-
-		hash = hpt_hash(vpn, large);
-
-		hpteg = ((hash & htab_data.htab_hash_mask)*HPTES_PER_GROUP);
-
-		if (systemcfg->platform == PLATFORM_PSERIES_LPAR)
-			ret = pSeries_lpar_hpte_insert(hpteg, va,
-				(unsigned long)__v2a(addr) >> PAGE_SHIFT,
-				0, mode, 1, large);
-		else
-			ret = pSeries_hpte_insert(hpteg, va,
-				(unsigned long)__v2a(addr) >> PAGE_SHIFT,
-				0, mode, 1, large);
-
-		if (ret == -1) {
-			ppc64_terminate_msg(0x20, "create_pte_mapping");
-			loop_forever();
-		}
-	}
-}
-
-void
-htab_initialize(void)
-{
-	unsigned long table, htab_size_bytes;
-	unsigned long pteg_count;
-	unsigned long mode_rw;
-
-	/*
-	 * Calculate the required size of the htab.  We want the number of
-	 * PTEGs to equal one half the number of real pages.
-	 */ 
-	htab_size_bytes = 1UL << naca->pftSize;
-	pteg_count = htab_size_bytes >> 7;
-
-	/* For debug, make the HTAB 1/8 as big as it normally would be. */
-	ifppcdebug(PPCDBG_HTABSIZE) {
-		pteg_count >>= 3;
-		htab_size_bytes = pteg_count << 7;
-	}
-
-	htab_data.htab_num_ptegs = pteg_count;
-	htab_data.htab_hash_mask = pteg_count - 1;
-
-	if (systemcfg->platform == PLATFORM_PSERIES) {
-		/* Find storage for the HPT.  Must be contiguous in
-		 * the absolute address space.
-		 */
-		table = lmb_alloc(htab_size_bytes, htab_size_bytes);
-		if ( !table ) {
-			ppc64_terminate_msg(0x20, "hpt space");
-			loop_forever();
-		}
-		htab_data.htab = (HPTE *)__a2v(table);
-
-		/* htab absolute addr + encoded htabsize */
-		_SDR1 = table + __ilog2(pteg_count) - 11;
-
-		/* Initialize the HPT with no entries */
-		memset((void *)table, 0, htab_size_bytes);
-	} else {
-		/* Using a hypervisor which owns the htab */
-		htab_data.htab = NULL;
-		_SDR1 = 0; 
-	}
-
-	mode_rw = _PAGE_ACCESSED | _PAGE_COHERENT | PP_RWXX;
-
-	/* XXX we currently map kernel text rw, should fix this */
-	if ((cur_cpu_spec->cpu_features & CPU_FTR_16M_PAGE)
-	    && systemcfg->physicalMemorySize > 256*MB) {
-		create_pte_mapping((unsigned long)KERNELBASE, 
-				   KERNELBASE + 256*MB, mode_rw, 0);
-		create_pte_mapping((unsigned long)KERNELBASE + 256*MB, 
-				   KERNELBASE + (systemcfg->physicalMemorySize), 
-				   mode_rw, 1);
-	} else {
-		create_pte_mapping((unsigned long)KERNELBASE, 
-				   KERNELBASE+(systemcfg->physicalMemorySize), 
-				   mode_rw, 0);
-	}
-}
-#undef KB
-#undef MB
-
-/*
- * find_linux_pte returns the address of a linux pte for a given 
- * effective address and directory.  If not found, it returns zero.
- */
-pte_t *find_linux_pte(pgd_t *pgdir, unsigned long ea)
-{
-	pgd_t *pg;
-	pmd_t *pm;
-	pte_t *pt = NULL;
-	pte_t pte;
-
-	pg = pgdir + pgd_index(ea);
-	if (!pgd_none(*pg)) {
-
-		pm = pmd_offset(pg, ea);
-		if (pmd_present(*pm)) { 
-			pt = pte_offset_kernel(pm, ea);
-			pte = *pt;
-			if (!pte_present(pte))
-				pt = NULL;
-		}
-	}
-
-	return pt;
-}
-
-static inline unsigned long computeHptePP(unsigned long pte)
-{
-	return (pte & _PAGE_USER) |
-		(((pte & _PAGE_USER) >> 1) &
-		 ((~((pte >> 2) &	/* _PAGE_RW */
-		     (pte >> 7))) &	/* _PAGE_DIRTY */
-		  1));
-}
-
-/*
- * Handle a fault by adding an HPTE. If the address can't be determined
- * to be valid via Linux page tables, return 1. If handled return 0
- */
-int __hash_page(unsigned long ea, unsigned long access, unsigned long vsid,
-		pte_t *ptep, unsigned long trap, int local)
-{
-	unsigned long va, vpn;
-	unsigned long newpp, prpn;
-	unsigned long hpteflags;
-	long slot;
-	pte_t old_pte, new_pte;
-
-	/* XXX fix for large ptes */
-	int large = 0;
-
-	/* Search the Linux page table for a match with va */
-	va = (vsid << 28) | (ea & 0x0fffffff);
-
-	if (large)
-		vpn = va >> LARGE_PAGE_SHIFT;
-	else
-		vpn = va >> PAGE_SHIFT;
-
-	/*
-	 * If no pte found or not present, send the problem up to
-	 * do_page_fault
-	 */
-	if (unlikely(!ptep || !pte_present(*ptep)))
-		return 1;
-
-	/* 
-	 * Check the user's access rights to the page.  If access should be
-	 * prevented then send the problem up to do_page_fault.
-	 */
-	access |= _PAGE_PRESENT;
-	if (unlikely(access & ~(pte_val(*ptep))))
-		return 1;
-
-	/*
-	 * At this point, we have a pte (old_pte) which can be used to build
-	 * or update an HPTE. There are 2 cases:
-	 *
-	 * 1. There is a valid (present) pte with no associated HPTE (this is 
-	 *	the most common case)
-	 * 2. There is a valid (present) pte with an associated HPTE. The
-	 *	current values of the pp bits in the HPTE prevent access
-	 *	because we are doing software DIRTY bit management and the
-	 *	page is currently not DIRTY. 
-	 */
-
-	old_pte = *ptep;
-	new_pte = old_pte;
-	/* If the attempted access was a store */
-	if (access & _PAGE_RW)
-		pte_val(new_pte) |= _PAGE_ACCESSED | _PAGE_DIRTY;
-	else
-		pte_val(new_pte) |= _PAGE_ACCESSED;
-
-	newpp = computeHptePP(pte_val(new_pte));
-
-#define PPC64_HWNOEXEC (1 << 2)
-
-	/* We do lazy icache flushing on cpus that support it */
-	if (unlikely((cur_cpu_spec->cpu_features & CPU_FTR_NOEXECUTE)
-		     && pfn_valid(pte_pfn(new_pte)))) {
-		struct page *page = pte_page(new_pte);
-
-		/* page is dirty */
-		if (!PageReserved(page) &&
-		    !test_bit(PG_arch_1, &page->flags)) {
-			if (trap == 0x400) {
-				__flush_dcache_icache(page_address(page));
-				set_bit(PG_arch_1, &page->flags);
-			} else {
-				newpp |= PPC64_HWNOEXEC;
-			}
-		}
-	}
-
-	/* Check if pte already has an hpte (case 2) */
-	if (unlikely(pte_val(old_pte) & _PAGE_HASHPTE)) {
-		/* There MIGHT be an HPTE for this pte */
-		unsigned long hash, slot, secondary;
-
-		hash = hpt_hash(vpn, large);
-		secondary = (pte_val(old_pte) & _PAGE_SECONDARY) >> 15;
-		if (secondary)
-			hash = ~hash;
-		slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP;
-		slot += (pte_val(old_pte) & _PAGE_GROUP_IX) >> 12;
-
-		if (ppc_md.hpte_updatepp(slot, newpp, va, large, local) == -1)
-			pte_val(old_pte) &= ~_PAGE_HPTEFLAGS;
-		else
-			if (!pte_same(old_pte, new_pte))
-				*ptep = new_pte;
-	}
-
-	if (likely(!(pte_val(old_pte) & _PAGE_HASHPTE))) {
-		unsigned long hash = hpt_hash(vpn, large);
-		unsigned long hpte_group;
-		prpn = pte_val(old_pte) >> PTE_SHIFT;
-
-repeat:
-		hpte_group = ((hash & htab_data.htab_hash_mask) *
-			      HPTES_PER_GROUP) & ~0x7UL;
-
-		/* Update the linux pte with the HPTE slot */
-		pte_val(new_pte) &= ~_PAGE_HPTEFLAGS;
-		pte_val(new_pte) |= _PAGE_HASHPTE;
-
-		/* copy appropriate flags from linux pte */
-		hpteflags = (pte_val(new_pte) & 0x1f8) | newpp;
-
-		slot = ppc_md.hpte_insert(hpte_group, va, prpn, 0,
-					  hpteflags, 0, large);
-
-		/* Primary is full, try the secondary */
-		if (unlikely(slot == -1)) {
-			pte_val(new_pte) |= 1 << 15;
-			hpte_group = ((~hash & htab_data.htab_hash_mask) *
-				      HPTES_PER_GROUP) & ~0x7UL; 
-			slot = ppc_md.hpte_insert(hpte_group, va, prpn,
-						  1, hpteflags, 0, large);
-			if (slot == -1) {
-				if (mftb() & 0x1)
-					hpte_group = ((hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP) & ~0x7UL;
-
-				ppc_md.hpte_remove(hpte_group);
-				goto repeat;
-                        }
-		}
-
-		if (unlikely(slot == -2))
-			panic("hash_page: pte_insert failed\n");
-
-		pte_val(new_pte) |= (slot<<12) & _PAGE_GROUP_IX;
-
-		/* 
-		 * No need to use ldarx/stdcx here because all who
-		 * might be updating the pte will hold the
-		 * page_table_lock or the hash_table_lock
-		 * (we hold both)
-		 */
-		*ptep = new_pte;
-	}
-
-	return 0;
-}
-
-int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
-{
-	void *pgdir;
-	unsigned long vsid;
-	struct mm_struct *mm;
-	pte_t *ptep;
-	int ret;
-	int user_region = 0;
-	int local = 0;
-	cpumask_t tmp;
-
-	/* Check for invalid addresses. */
-	if (!IS_VALID_EA(ea))
-		return 1;
-
- 	switch (REGION_ID(ea)) {
-	case USER_REGION_ID:
-		user_region = 1;
-		mm = current->mm;
-		if (mm == NULL)
-			return 1;
-
-		vsid = get_vsid(mm->context, ea);
-		break;
-	case IO_REGION_ID:
-		mm = &ioremap_mm;
-		vsid = get_kernel_vsid(ea);
-		break;
-	case VMALLOC_REGION_ID:
-		mm = &init_mm;
-		vsid = get_kernel_vsid(ea);
-		break;
-#if 0
-	case EEH_REGION_ID:
-		/*
-		 * Should only be hit if there is an access to MMIO space
-		 * which is protected by EEH.
-		 * Send the problem up to do_page_fault 
-		 */
-	case KERNEL_REGION_ID:
-		/*
-		 * Should never get here - entire 0xC0... region is bolted.
-		 * Send the problem up to do_page_fault 
-		 */
-#endif
-	default:
-		/* Not a valid range
-		 * Send the problem up to do_page_fault 
-		 */
-		return 1;
-		break;
-	}
-
-	pgdir = mm->pgd;
-
-	if (pgdir == NULL)
-		return 1;
-
-	/*
-	 * Lock the Linux page table to prevent mmap and kswapd
-	 * from modifying entries while we search and update
-	 */
-	spin_lock(&mm->page_table_lock);
-
-	tmp = cpumask_of_cpu(smp_processor_id());
-	if (user_region && cpus_equal(mm->cpu_vm_mask, tmp))
-		local = 1;
-
-	ret = hash_huge_page(mm, access, ea, vsid, local);
-	if (ret < 0) {
-		ptep = find_linux_pte(pgdir, ea);
-		ret = __hash_page(ea, access, vsid, ptep, trap, local);
-	}
-
-	spin_unlock(&mm->page_table_lock);
-
-	return ret;
-}
-
-void flush_hash_page(unsigned long context, unsigned long ea, pte_t pte,
-		     int local)
-{
-	unsigned long vsid, vpn, va, hash, secondary, slot;
-
-	/* XXX fix for large ptes */
-	unsigned long large = 0;
-
-	if ((ea >= USER_START) && (ea <= USER_END))
-		vsid = get_vsid(context, ea);
-	else
-		vsid = get_kernel_vsid(ea);
-
-	va = (vsid << 28) | (ea & 0x0fffffff);
-	if (large)
-		vpn = va >> LARGE_PAGE_SHIFT;
-	else
-		vpn = va >> PAGE_SHIFT;
-	hash = hpt_hash(vpn, large);
-	secondary = (pte_val(pte) & _PAGE_SECONDARY) >> 15;
-	if (secondary)
-		hash = ~hash;
-	slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP;
-	slot += (pte_val(pte) & _PAGE_GROUP_IX) >> 12;
-
-	ppc_md.hpte_invalidate(slot, va, large, local);
-}
-
-void flush_hash_range(unsigned long context, unsigned long number, int local)
-{
-	if (ppc_md.flush_hash_range) {
-		ppc_md.flush_hash_range(context, number, local);
-	} else {
-		int i;
-		struct ppc64_tlb_batch *batch =
-			&ppc64_tlb_batch[smp_processor_id()];
-
-		for (i = 0; i < number; i++)
-			flush_hash_page(context, batch->addr[i], batch->pte[i],
-					local);
-	}
-}
diff -Nru a/arch/ppc64/kernel/iSeries_IoMmTable.c b/arch/ppc64/kernel/iSeries_IoMmTable.c
--- a/arch/ppc64/kernel/iSeries_IoMmTable.c	Tue Feb  3 19:45:42 2004
+++ b/arch/ppc64/kernel/iSeries_IoMmTable.c	Tue Feb  3 19:45:42 2004
@@ -1,3 +1,4 @@
+#define PCIFR(...)
 /************************************************************************/
 /* This module supports the iSeries I/O Address translation mapping     */
 /* Copyright (C) 20yy  <Allan H Trautman> <IBM Corp>                    */
@@ -30,134 +31,139 @@
 #include <linux/pci.h>
 #include <linux/spinlock.h>
 #include <asm/ppcdebug.h>
-#include <asm/flight_recorder.h>
 #include <asm/iSeries/HvCallPci.h>
 #include <asm/iSeries/iSeries_pci.h>
 
 #include "iSeries_IoMmTable.h"
 #include "pci.h"
 
-/*******************************************************************/
-/* Table defines                                                   */
-/* Each Entry size is 4 MB * 1024 Entries = 4GB I/O address space. */
-/*******************************************************************/
+/*
+ * Table defines
+ * Each Entry size is 4 MB * 1024 Entries = 4GB I/O address space.
+ */
 #define Max_Entries 1024
 unsigned long iSeries_IoMmTable_Entry_Size = 0x0000000000400000; 
 unsigned long iSeries_Base_Io_Memory       = 0xE000000000000000;
 unsigned long iSeries_Max_Io_Memory        = 0xE000000000000000;
 static   long iSeries_CurrentIndex         = 0;
 
-/*******************************************************************/
-/* Lookup Tables.                                                  */
-/*******************************************************************/
-struct iSeries_Device_Node** iSeries_IoMmTable;
-u8*                          iSeries_IoBarTable;
-
-/*******************************************************************/
-/* Static and Global variables                                     */
-/*******************************************************************/
-static char*      iSeriesPciIoText     = "iSeries PCI I/O";
+/*
+ * Lookup Tables.
+ */
+struct iSeries_Device_Node **iSeries_IoMmTable;
+u8 *iSeries_IoBarTable;
+
+/*
+ * Static and Global variables
+ */
+static char *iSeriesPciIoText = "iSeries PCI I/O";
 static spinlock_t iSeriesIoMmTableLock = SPIN_LOCK_UNLOCKED;
 
-/*******************************************************************/
-/* iSeries_IoMmTable_Initialize                                    */
-/*******************************************************************/
-/* Allocates and initalizes the Address Translation Table and Bar  */
-/* Tables to get them ready for use.  Must be called before any    */
-/* I/O space is handed out to the device BARs.                     */
-/* A follow up method,iSeries_IoMmTable_Status can be called to    */
-/* adjust the table after the device BARs have been assiged to     */
-/* resize the table.                                               */
-/*******************************************************************/
+/*
+ * iSeries_IoMmTable_Initialize
+ *
+ * Allocates and initalizes the Address Translation Table and Bar
+ * Tables to get them ready for use.  Must be called before any
+ * I/O space is handed out to the device BARs.
+ * A follow up method,iSeries_IoMmTable_Status can be called to
+ * adjust the table after the device BARs have been assiged to
+ * resize the table.
+ */
 void iSeries_IoMmTable_Initialize(void)
 {
 	spin_lock(&iSeriesIoMmTableLock);
-	iSeries_IoMmTable  = kmalloc(sizeof(void*)*Max_Entries,GFP_KERNEL);
-	iSeries_IoBarTable = kmalloc(sizeof(u8)*Max_Entries,   GFP_KERNEL);
+	iSeries_IoMmTable  = kmalloc(sizeof(void *) * Max_Entries, GFP_KERNEL);
+	iSeries_IoBarTable = kmalloc(sizeof(u8) * Max_Entries, GFP_KERNEL);
 	spin_unlock(&iSeriesIoMmTableLock);
-	PCIFR("IoMmTable Initialized 0x%p",  iSeries_IoMmTable);
-	if(iSeries_IoMmTable == NULL || iSeries_IoBarTable == NULL) {
+	PCIFR("IoMmTable Initialized 0x%p", iSeries_IoMmTable);
+	if ((iSeries_IoMmTable == NULL) || (iSeries_IoBarTable == NULL))
 		panic("PCI: I/O tables allocation failed.\n");
-	}
 }
 
-/*******************************************************************/
-/* iSeries_IoMmTable_AllocateEntry                                 */
-/*******************************************************************/
-/* Adds pci_dev entry in address translation table                 */
-/*******************************************************************/
-/* - Allocates the number of entries required in table base on BAR */
-/*   size.                                                         */
-/* - Allocates starting at iSeries_Base_Io_Memory and increases.   */
-/* - The size is round up to be a multiple of entry size.          */
-/* - CurrentIndex is incremented to keep track of the last entry.  */
-/* - Builds the resource entry for allocated BARs.                 */
-/*******************************************************************/
-static void iSeries_IoMmTable_AllocateEntry(struct pci_dev* PciDev, int BarNumber)
+/*
+ * iSeries_IoMmTable_AllocateEntry
+ *
+ * Adds pci_dev entry in address translation table
+ *
+ * - Allocates the number of entries required in table base on BAR
+ *   size.
+ * - Allocates starting at iSeries_Base_Io_Memory and increases.
+ * - The size is round up to be a multiple of entry size.
+ * - CurrentIndex is incremented to keep track of the last entry.
+ * - Builds the resource entry for allocated BARs.
+ */
+static void iSeries_IoMmTable_AllocateEntry(struct pci_dev *PciDev,
+		int BarNumber)
 {
-	struct resource* BarResource = &PciDev->resource[BarNumber];
-	long             BarSize     = pci_resource_len(PciDev,BarNumber);
-	/***********************************************************/
-	/* No space to allocate, quick exit, skip Allocation.      */
-	/***********************************************************/
-	if(BarSize == 0) return;
-	/***********************************************************/
-	/* Set Resource values.                                    */
-	/***********************************************************/
+	struct resource *BarResource = &PciDev->resource[BarNumber];
+	long BarSize = pci_resource_len(PciDev, BarNumber);
+
+	/*
+	 * No space to allocate, quick exit, skip Allocation.
+	 */
+	if (BarSize == 0)
+		return;
+	/*
+	 * Set Resource values.
+	 */
 	spin_lock(&iSeriesIoMmTableLock);
-	BarResource->name  = iSeriesPciIoText;
-	BarResource->start = iSeries_IoMmTable_Entry_Size*iSeries_CurrentIndex;
-	BarResource->start+= iSeries_Base_Io_Memory;
-	BarResource->end   = BarResource->start+BarSize-1;
-	/***********************************************************/
-	/* Allocate the number of table entries needed for BAR.    */
-	/***********************************************************/
+	BarResource->name = iSeriesPciIoText;
+	BarResource->start =
+		iSeries_IoMmTable_Entry_Size * iSeries_CurrentIndex;
+	BarResource->start += iSeries_Base_Io_Memory;
+	BarResource->end = BarResource->start+BarSize-1;
+	/*
+	 * Allocate the number of table entries needed for BAR.
+	 */
 	while (BarSize > 0 ) {
-		*(iSeries_IoMmTable +iSeries_CurrentIndex) = (struct iSeries_Device_Node*)PciDev->sysdata;
-		*(iSeries_IoBarTable+iSeries_CurrentIndex) = BarNumber;
+		*(iSeries_IoMmTable + iSeries_CurrentIndex) =
+			(struct iSeries_Device_Node *)PciDev->sysdata;
+		*(iSeries_IoBarTable + iSeries_CurrentIndex) = BarNumber;
 		BarSize -= iSeries_IoMmTable_Entry_Size;
 		++iSeries_CurrentIndex;
 	}
-	iSeries_Max_Io_Memory = (iSeries_IoMmTable_Entry_Size*iSeries_CurrentIndex)+iSeries_Base_Io_Memory;
+	iSeries_Max_Io_Memory = iSeries_Base_Io_Memory +
+		(iSeries_IoMmTable_Entry_Size * iSeries_CurrentIndex);
 	spin_unlock(&iSeriesIoMmTableLock);
 }
 
-/*******************************************************************/
-/* iSeries_allocateDeviceBars                                      */
-/*******************************************************************/
-/* - Allocates ALL pci_dev BAR's and updates the resources with the*/
-/*   BAR value.  BARS with zero length will have the resources     */
-/*   The HvCallPci_getBarParms is used to get the size of the BAR  */
-/*   space.  It calls iSeries_IoMmTable_AllocateEntry to allocate  */
-/*   each entry.                                                   */
-/* - Loops through The Bar resources(0 - 5) including the ROM      */
-/*   is resource(6).                                               */
-/*******************************************************************/
-void iSeries_allocateDeviceBars(struct pci_dev* PciDev)
+/*
+ * iSeries_allocateDeviceBars
+ *
+ * - Allocates ALL pci_dev BAR's and updates the resources with the
+ *   BAR value.  BARS with zero length will have the resources
+ *   The HvCallPci_getBarParms is used to get the size of the BAR
+ *   space.  It calls iSeries_IoMmTable_AllocateEntry to allocate
+ *   each entry.
+ * - Loops through The Bar resources(0 - 5) including the ROM
+ *   is resource(6).
+ */
+void iSeries_allocateDeviceBars(struct pci_dev *PciDev)
 {
-	struct resource* BarResource;
-	int              BarNumber;
-	for(BarNumber = 0; BarNumber <= PCI_ROM_RESOURCE; ++BarNumber) {
+	struct resource *BarResource;
+	int BarNumber;
+
+	for (BarNumber = 0; BarNumber <= PCI_ROM_RESOURCE; ++BarNumber) {
 		BarResource = &PciDev->resource[BarNumber];
 		iSeries_IoMmTable_AllocateEntry(PciDev, BarNumber);
     	}
 }
 
-/************************************************************************/
-/* Translates the IoAddress to the device that is mapped to IoSpace.    */
-/* This code is inlined, see the iSeries_pci.c file for the replacement.*/
-/************************************************************************/
-struct iSeries_Device_Node* iSeries_xlateIoMmAddress(void* IoAddress)
+/*
+ * Translates the IoAddress to the device that is mapped to IoSpace.
+ * This code is inlined, see the iSeries_pci.c file for the replacement.
+ */
+struct iSeries_Device_Node *iSeries_xlateIoMmAddress(void *IoAddress)
 {
 	return NULL;	   
 }
 
-/************************************************************************
+/*
  * Status hook for IoMmTable
- ************************************************************************/
-void     iSeries_IoMmTable_Status(void)
+ */
+void iSeries_IoMmTable_Status(void)
 {
-	PCIFR("IoMmTable......: 0x%p",iSeries_IoMmTable);
-	PCIFR("IoMmTable Range: 0x%p to 0x%p",iSeries_Base_Io_Memory,iSeries_Max_Io_Memory);
-	return;
+	PCIFR("IoMmTable......: 0x%p", iSeries_IoMmTable);
+	PCIFR("IoMmTable Range: 0x%p to 0x%p", iSeries_Base_Io_Memory,
+			iSeries_Max_Io_Memory);
 }
diff -Nru a/arch/ppc64/kernel/iSeries_IoMmTable.h b/arch/ppc64/kernel/iSeries_IoMmTable.h
--- a/arch/ppc64/kernel/iSeries_IoMmTable.h	Tue Feb  3 19:45:33 2004
+++ b/arch/ppc64/kernel/iSeries_IoMmTable.h	Tue Feb  3 19:45:33 2004
@@ -31,55 +31,55 @@
 struct pci_dev;
 struct iSeries_Device_Node;
 
-extern struct iSeries_Device_Node** iSeries_IoMmTable;
-extern u8*                          iSeries_IoBarTable;
+extern struct iSeries_Device_Node **iSeries_IoMmTable;
+extern u8 *iSeries_IoBarTable;
 extern unsigned long iSeries_Base_Io_Memory;
 extern unsigned long iSeries_Max_Io_Memory;
 extern unsigned long iSeries_Base_Io_Memory;
 extern unsigned long iSeries_IoMmTable_Entry_Size;
-/************************************************************************/
-/* iSeries_IoMmTable_Initialize                                         */
-/************************************************************************/
-/* - Initalizes the Address Translation Table and get it ready for use. */
-/*   Must be called before any client calls any of the other methods.   */
-/*                                                                      */
-/* Parameters: None.                                                    */
-/*                                                                      */
-/* Return: None.                                                        */  
-/************************************************************************/
-extern  void iSeries_IoMmTable_Initialize(void);
-extern  void iSeries_IoMmTable_Status(void);
+/*
+ * iSeries_IoMmTable_Initialize
+ *
+ * - Initalizes the Address Translation Table and get it ready for use.
+ *   Must be called before any client calls any of the other methods.
+ *
+ * Parameters: None.
+ *
+ * Return: None.
+ */
+extern void iSeries_IoMmTable_Initialize(void);
+extern void iSeries_IoMmTable_Status(void);
 
-/************************************************************************/
-/* iSeries_allocateDeviceBars                                           */
-/************************************************************************/
-/* - Allocates ALL pci_dev BAR's and updates the resources with the BAR */
-/*   value.  BARS with zero length will not have the resources.  The    */
-/*   HvCallPci_getBarParms is used to get the size of the BAR space.    */
-/*   It calls iSeries_IoMmTable_AllocateEntry to allocate each entry.   */
-/*                                                                      */
-/* Parameters:                                                          */
-/* pci_dev = Pointer to pci_dev structure that will be mapped to pseudo */
-/*           I/O Address.                                               */
-/*                                                                      */
-/* Return:                                                              */
-/*   The pci_dev I/O resources updated with pseudo I/O Addresses.       */
-/************************************************************************/
-extern  void iSeries_allocateDeviceBars(struct pci_dev* );
+/*
+ * iSeries_allocateDeviceBars
+ *
+ * - Allocates ALL pci_dev BAR's and updates the resources with the BAR
+ *   value.  BARS with zero length will not have the resources.  The
+ *   HvCallPci_getBarParms is used to get the size of the BAR space.
+ *   It calls iSeries_IoMmTable_AllocateEntry to allocate each entry.
+ *
+ * Parameters:
+ * pci_dev = Pointer to pci_dev structure that will be mapped to pseudo
+ *           I/O Address.
+ *
+ * Return:
+ *   The pci_dev I/O resources updated with pseudo I/O Addresses.
+ */
+extern void iSeries_allocateDeviceBars(struct pci_dev *);
 
-/************************************************************************/
-/* iSeries_xlateIoMmAddress                                             */
-/************************************************************************/
-/* - Translates an I/O Memory address to Device Node that has been the  */
-/*   allocated the psuedo I/O Address.                                  */
-/*                                                                      */
-/* Parameters:                                                          */
-/* IoAddress = I/O Memory Address.                                      */
-/*                                                                      */
-/* Return:                                                              */
-/*   An iSeries_Device_Node to the device mapped to the I/O address. The*/
-/*   BarNumber and BarOffset are valid if the Device Node is returned.  */
-/************************************************************************/
-extern struct iSeries_Device_Node* iSeries_xlateIoMmAddress(void* IoAddress);
+/*
+ * iSeries_xlateIoMmAddress
+ *
+ * - Translates an I/O Memory address to Device Node that has been the
+ *   allocated the psuedo I/O Address.
+ *
+ * Parameters:
+ * IoAddress = I/O Memory Address.
+ *
+ * Return:
+ *   An iSeries_Device_Node to the device mapped to the I/O address. The
+ *   BarNumber and BarOffset are valid if the Device Node is returned.
+ */
+extern struct iSeries_Device_Node *iSeries_xlateIoMmAddress(void *IoAddress);
 
 #endif /* _ISERIES_IOMMTABLE_H */
diff -Nru a/arch/ppc64/kernel/iSeries_VpdInfo.c b/arch/ppc64/kernel/iSeries_VpdInfo.c
--- a/arch/ppc64/kernel/iSeries_VpdInfo.c	Tue Feb  3 19:45:16 2004
+++ b/arch/ppc64/kernel/iSeries_VpdInfo.c	Tue Feb  3 19:45:16 2004
@@ -25,6 +25,7 @@
 /*   Ported to ppc64, August 20, 2001                                   */
 /* End Change Activity                                                  */
 /************************************************************************/
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <asm/types.h>
@@ -38,20 +39,20 @@
 #include <asm/iSeries/iSeries_pci.h>
 #include "pci.h"
 
-/************************************************/
-/* Size of Bus VPD data                         */
-/************************************************/
+/*
+ * Size of Bus VPD data
+ */
 #define BUS_VPDSIZE      1024
-/************************************************/
-/* Bus Vpd Tags                                 */
-/************************************************/
+/*
+ * Bus Vpd Tags
+ */
 #define  VpdEndOfDataTag   0x78
 #define  VpdEndOfAreaTag   0x79
 #define  VpdIdStringTag    0x82
 #define  VpdVendorAreaTag  0x84
-/************************************************/
-/* Mfg Area Tags                                */
-/************************************************/
+/*
+ * Mfg Area Tags
+ */
 #define  VpdFruFlag       0x4647     // "FG"
 #define  VpdFruFrameId    0x4649     // "FI"
 #define  VpdSlotMapFormat 0x4D46     // "MF"
@@ -59,9 +60,9 @@
 #define  VpdFruSerial     0x534E     // "SN"
 #define  VpdSlotMap       0x534D     // "SM"
 
-/************************************************/
-/* Structures of the areas                      */
-/************************************************/
+/*
+ * Structures of the areas
+ */
 struct MfgVpdAreaStruct {
 	u16 Tag;
 	u8  TagLength;
@@ -82,168 +83,172 @@
 typedef struct SlotMapStruct SlotMap;
 #define SLOT_ENTRY_SIZE   16
 
-/****************************************************************
- *                                                              *
- * Bus, Card, Board, FrameId, CardLocation.                     *
- ****************************************************************/
-LocationData* iSeries_GetLocationData(struct pci_dev* PciDev)
+/*
+ * Bus, Card, Board, FrameId, CardLocation.
+ */
+LocationData* iSeries_GetLocationData(struct pci_dev *PciDev)
 {
-	struct iSeries_Device_Node* DevNode = (struct iSeries_Device_Node*)PciDev->sysdata;
-	LocationData* LocationPtr = (LocationData*)kmalloc(LOCATION_DATA_SIZE, GFP_KERNEL);
+	struct iSeries_Device_Node *DevNode =
+		(struct iSeries_Device_Node *)PciDev->sysdata;
+	LocationData *LocationPtr =
+		(LocationData *)kmalloc(LOCATION_DATA_SIZE, GFP_KERNEL);
+
 	if (LocationPtr == NULL) {
 		printk("PCI: LocationData area allocation failed!\n");
 		return NULL;
 	}
-	memset(LocationPtr,0,LOCATION_DATA_SIZE);
-	LocationPtr->Bus              = ISERIES_BUS(DevNode);
-	LocationPtr->Board            = DevNode->Board;
-	LocationPtr->FrameId          = DevNode->FrameId;
-	LocationPtr->Card             = PCI_SLOT(DevNode->DevFn);
-	strcpy(&LocationPtr->CardLocation[0],&DevNode->CardLocation[0]);
+	memset(LocationPtr, 0, LOCATION_DATA_SIZE);
+	LocationPtr->Bus = ISERIES_BUS(DevNode);
+	LocationPtr->Board = DevNode->Board;
+	LocationPtr->FrameId = DevNode->FrameId;
+	LocationPtr->Card = PCI_SLOT(DevNode->DevFn);
+	strcpy(&LocationPtr->CardLocation[0], &DevNode->CardLocation[0]);
 	return LocationPtr;
 }
 
-/************************************************************************/
-/* Formats the device information.                                      */
-/* - Pass in pci_dev* pointer to the device.                            */
-/* - Pass in buffer to place the data.  Danger here is the buffer must  */
-/*   be as big as the client says it is.   Should be at least 128 bytes.*/
-/* Return will the length of the string data put in the buffer.         */
-/* Format:                                                              */
-/* PCI: Bus  0, Device 26, Vendor 0x12AE  Frame  1, Card  C10  Ethernet */
-/* controller                                                           */
-/************************************************************************/
-int  iSeries_Device_Information(struct pci_dev* PciDev,char* Buffer, int BufferSize)
+/*
+ * Formats the device information.
+ * - Pass in pci_dev* pointer to the device.
+ * - Pass in buffer to place the data.  Danger here is the buffer must
+ *   be as big as the client says it is.   Should be at least 128 bytes.
+ * Return will the length of the string data put in the buffer.
+ * Format:
+ * PCI: Bus  0, Device 26, Vendor 0x12AE  Frame  1, Card  C10  Ethernet
+ * controller
+ */
+int iSeries_Device_Information(struct pci_dev *PciDev, char *buffer,
+		int BufferSize)
 {
-	struct iSeries_Device_Node* DevNode = (struct iSeries_Device_Node*)PciDev->sysdata;
-	char*          BufPtr  = Buffer;
-	int            LineLen = 0;
-
-	if (DevNode == NULL) {
-		LineLen = sprintf(BufPtr+LineLen, "PCI: iSeries_Device_Information DevNode is NULL");
-		return LineLen;
-	}
-
-	if (BufferSize >= 128) {
-		LineLen =  sprintf(BufPtr+LineLen,"PCI: Bus%3d, Device%3d, Vendor %04X ",
-				   ISERIES_BUS(DevNode), PCI_SLOT(PciDev->devfn),PciDev->vendor);
-
-		LineLen += sprintf(BufPtr+LineLen,"Frame%3d, Card %4s  ", DevNode->FrameId,DevNode->CardLocation);
-
-		if (pci_class_name(PciDev->class >> 8) == 0) {
-			LineLen += sprintf(BufPtr+LineLen,"0x%04X  ",(int)(PciDev->class >> 8));
-		}
-		else {
-			LineLen += sprintf(BufPtr+LineLen,"%s",pci_class_name(PciDev->class >> 8) );
-		}
-	}
-	return LineLen;
+	struct iSeries_Device_Node *DevNode =
+		(struct iSeries_Device_Node *)PciDev->sysdata;
+	int len;
+
+	if (DevNode == NULL)
+		return sprintf(buffer,
+				"PCI: iSeries_Device_Information DevNode is NULL");
+
+	if (BufferSize < 128)
+		return 0;
+
+	len = sprintf(buffer, "PCI: Bus%3d, Device%3d, Vendor %04X ",
+			ISERIES_BUS(DevNode), PCI_SLOT(PciDev->devfn),
+			PciDev->vendor);
+	len += sprintf(buffer + len, "Frame%3d, Card %4s  ",
+			DevNode->FrameId, DevNode->CardLocation);
+#ifdef CONFIG_PCI
+	if (pci_class_name(PciDev->class >> 8) == 0)
+		len += sprintf(buffer + len, "0x%04X  ",
+				(int)(PciDev->class >> 8));
+	else
+		len += sprintf(buffer + len, "%s",
+				pci_class_name(PciDev->class >> 8));
+#endif
+	return len;
 }
-/************************************************************************/
-/* Build a character string of the device location, Frame  1, Card  C10 */
-/************************************************************************/
-int   device_Location(struct pci_dev* PciDev,char* BufPtr)
+
+/*
+ * Build a character string of the device location, Frame  1, Card  C10
+ */
+int device_Location(struct pci_dev *PciDev, char *BufPtr)
 {
-	struct iSeries_Device_Node* DevNode = (struct iSeries_Device_Node*)PciDev->sysdata;
-	return sprintf(BufPtr,"PCI: Bus%3d, AgentId%3d, Vendor %04X, Location %s",
-		       DevNode->DsaAddr.busNumber,
-		       DevNode->AgentId,
-		       DevNode->Vendor,
-		       DevNode->Location);
+	struct iSeries_Device_Node *DevNode =
+		(struct iSeries_Device_Node *)PciDev->sysdata;
+	return sprintf(BufPtr, "PCI: Bus%3d, AgentId%3d, Vendor %04X, Location %s",
+		       DevNode->DsaAddr.Dsa.busNumber, DevNode->AgentId,
+		       DevNode->Vendor, DevNode->Location);
 }
 
-/*****************************************************************/
-/* Parse the Slot Area                                           */
-/*****************************************************************/
-void  iSeries_Parse_SlotArea(SlotMap* MapPtr,int MapLen, struct iSeries_Device_Node* DevNode)
+/*
+ * Parse the Slot Area
+ */
+void iSeries_Parse_SlotArea(SlotMap *MapPtr, int MapLen,
+		struct iSeries_Device_Node *DevNode)
 {
-	int      SlotMapLen = MapLen;
-	SlotMap* SlotMapPtr = MapPtr;
-	/*************************************************************/
-	/* Parse Slot label until we find the one requrested         */
-	/*************************************************************/
+	int SlotMapLen = MapLen;
+	SlotMap *SlotMapPtr = MapPtr;
+
+	/*
+	 * Parse Slot label until we find the one requrested
+	 */
 	while (SlotMapLen > 0) {
 		if (SlotMapPtr->AgentId == DevNode->AgentId ) {
-			/*******************************************************/
-			/* If Phb wasn't found, grab the entry first one found.*/ 
-			/*******************************************************/
-			if (DevNode->PhbId == 0xff) {
+			/*
+			 * If Phb wasn't found, grab the entry first one found.
+			 */
+			if (DevNode->PhbId == 0xff)
 				DevNode->PhbId = SlotMapPtr->PhbId; 
-			}
-			/**************************************************/
-			/* Found it, extract the data.                    */
-			/**************************************************/
+			/* Found it, extract the data. */
 			if (SlotMapPtr->PhbId == DevNode->PhbId ) {
-	        		memcpy(&DevNode->CardLocation,&SlotMapPtr->CardLocation,3);
+	        		memcpy(&DevNode->CardLocation,
+						&SlotMapPtr->CardLocation, 3);
 				DevNode->CardLocation[3]  = 0;
 				break;
 			}
 		}
-		/*********************************************************/
-		/* Point to the next Slot                                */
-		/*********************************************************/
-		SlotMapPtr = (SlotMap*)((char*)SlotMapPtr+SLOT_ENTRY_SIZE);
+		/* Point to the next Slot */
+		SlotMapPtr = (SlotMap *)((char *)SlotMapPtr + SLOT_ENTRY_SIZE);
 		SlotMapLen -= SLOT_ENTRY_SIZE;
 	}
 }
 
-/*****************************************************************/
-/* Parse the Mfg Area                                            */
-/*****************************************************************/
-static void  iSeries_Parse_MfgArea(u8* AreaData,int AreaLen, struct iSeries_Device_Node* DevNode)
+/*
+ * Parse the Mfg Area
+ */
+static void iSeries_Parse_MfgArea(u8 *AreaData, int AreaLen,
+		struct iSeries_Device_Node *DevNode)
 {
-	MfgArea* MfgAreaPtr = (MfgArea*)AreaData;
-	int      MfgAreaLen = AreaLen;
-	u16      SlotMapFmt = 0;
-
-	/*************************************************************/
-	/* Parse Mfg Data                                            */
-	/*************************************************************/
+	MfgArea *MfgAreaPtr = (MfgArea *)AreaData;
+	int MfgAreaLen = AreaLen;
+	u16 SlotMapFmt = 0;
+
+	/* Parse Mfg Data */
 	while (MfgAreaLen > 0) {
-		int MfgTagLen  = MfgAreaPtr->TagLength;
-		/*******************************************************/
-		/* Frame ID         (FI 4649020310 )                   */
-		/*******************************************************/
-		if (MfgAreaPtr->Tag == VpdFruFrameId) {     /* FI  */
+		int MfgTagLen = MfgAreaPtr->TagLength;
+		/* Frame ID         (FI 4649020310 ) */
+		if (MfgAreaPtr->Tag == VpdFruFrameId)		/* FI  */
 			DevNode->FrameId = MfgAreaPtr->AreaData1;
+		/* Slot Map Format  (MF 4D46020004 ) */
+		else if (MfgAreaPtr->Tag == VpdSlotMapFormat)	/* MF  */
+			SlotMapFmt = (MfgAreaPtr->AreaData1 * 256)
+				+ MfgAreaPtr->AreaData2;
+		/* Slot Map         (SM 534D90 */
+		else if (MfgAreaPtr->Tag == VpdSlotMap)	{	/* SM  */
+			SlotMap *SlotMapPtr;
+
+			if (SlotMapFmt == 0x1004)
+				SlotMapPtr = (SlotMap *)((char *)MfgAreaPtr
+						+ MFG_ENTRY_SIZE + 1);
+ 	    		else
+				SlotMapPtr = (SlotMap *)((char *)MfgAreaPtr
+						+ MFG_ENTRY_SIZE);
+	    		iSeries_Parse_SlotArea(SlotMapPtr, MfgTagLen, DevNode);
 		}
-		/*******************************************************/
-		/* Slot Map Format  (MF 4D46020004 )                   */
-		/*******************************************************/
-		else if (MfgAreaPtr->Tag == VpdSlotMapFormat){   /* MF  */
-			SlotMapFmt = (MfgAreaPtr->AreaData1*256)+(MfgAreaPtr->AreaData2);
-		}
-		/*******************************************************/
-		/* Slot Map         (SM 534D90                         */
-		/*******************************************************/
-		else if (MfgAreaPtr->Tag == VpdSlotMap){         /* SM  */
-			SlotMap*  SlotMapPtr;
-			if (SlotMapFmt == 0x1004) SlotMapPtr = (SlotMap*)((char*)MfgAreaPtr+MFG_ENTRY_SIZE+1);
- 	    		else                     SlotMapPtr = (SlotMap*)((char*)MfgAreaPtr+MFG_ENTRY_SIZE);
-	    		iSeries_Parse_SlotArea(SlotMapPtr,MfgTagLen, DevNode);
-		}
-		/*********************************************************/
-		/* Point to the next Mfg Area                            */
-		/* Use defined size, sizeof give wrong answer            */
-		/*********************************************************/
-		MfgAreaPtr = (MfgArea*)((char*)MfgAreaPtr + MfgTagLen + MFG_ENTRY_SIZE);
+		/*
+		 * Point to the next Mfg Area
+		 * Use defined size, sizeof give wrong answer
+		 */
+		MfgAreaPtr = (MfgArea *)((char *)MfgAreaPtr + MfgTagLen
+				+ MFG_ENTRY_SIZE);
 		MfgAreaLen -= (MfgTagLen + MFG_ENTRY_SIZE); 
 	}	
 }
 
-/*****************************************************************/
-/* Look for "BUS".. Data is not Null terminated.                 */
-/* PHBID of 0xFF indicates PHB was not found in VPD Data.        */	
-/*****************************************************************/
-static int iSeries_Parse_PhbId(u8* AreaPtr,int AreaLength)
+/*
+ * Look for "BUS".. Data is not Null terminated.
+ * PHBID of 0xFF indicates PHB was not found in VPD Data.
+ */
+static int iSeries_Parse_PhbId(u8 *AreaPtr, int AreaLength)
 {
-	u8*  PhbPtr  = AreaPtr;
-	int  DataLen = AreaLength;
-	char PhbId   = 0xFF;                   
+	u8 *PhbPtr = AreaPtr;
+	int DataLen = AreaLength;
+	char PhbId = 0xFF;                   
+
 	while (DataLen > 0) {
-		if (*PhbPtr == 'B' && *(PhbPtr+1) == 'U' && *(PhbPtr+2) == 'S') {
+		if ((*PhbPtr == 'B') && (*(PhbPtr + 1) == 'U')
+				&& (*(PhbPtr + 2) == 'S')) {
 			PhbPtr += 3;
-			while(*PhbPtr == ' ') ++PhbPtr;
+			while (*PhbPtr == ' ')
+				++PhbPtr;
 			PhbId = (*PhbPtr & 0x0F);
 			break;
         	}
@@ -253,64 +258,54 @@
 	return PhbId;
 }
 
-/****************************************************************/
-/* Parse out the VPD Areas                                      */
-/****************************************************************/
-static void  iSeries_Parse_Vpd(u8* VpdData, int VpdDataLen, struct iSeries_Device_Node* DevNode)
+/*
+ * Parse out the VPD Areas
+ */
+static void iSeries_Parse_Vpd(u8 *VpdData, int VpdDataLen,
+		struct iSeries_Device_Node *DevNode)
 {
-	u8*  TagPtr  = VpdData;
-	int  DataLen = VpdDataLen-3;
-	/*************************************************************/
-	/* Parse the Areas                                           */
-	/*************************************************************/
-	while (*TagPtr != VpdEndOfAreaTag && DataLen > 0) {
-		int  AreaLen   = *(TagPtr+1) + (*(TagPtr+2)*256);	
-		u8*  AreaData  = TagPtr+3;
+	u8 *TagPtr = VpdData;
+	int DataLen = VpdDataLen - 3;
 
-		if (*TagPtr == VpdIdStringTag) {
-			DevNode->PhbId = iSeries_Parse_PhbId(AreaData,AreaLen);
-		}
-		else if (*TagPtr == VpdVendorAreaTag) {
-	    		iSeries_Parse_MfgArea(AreaData,AreaLen,DevNode);
-		}
-		/*********************************************************
-		 * Point to next Area.
-		 *********************************************************/
+	while ((*TagPtr != VpdEndOfAreaTag) && (DataLen > 0)) {
+		int AreaLen = *(TagPtr + 1) + (*(TagPtr + 2) * 256);	
+		u8 *AreaData  = TagPtr + 3;
+
+		if (*TagPtr == VpdIdStringTag)
+			DevNode->PhbId = iSeries_Parse_PhbId(AreaData, AreaLen);
+		else if (*TagPtr == VpdVendorAreaTag)
+	    		iSeries_Parse_MfgArea(AreaData, AreaLen, DevNode);
+		/* Point to next Area. */
 		TagPtr  = AreaData + AreaLen;
 		DataLen -= AreaLen;
 	}
 }    
 
-/****************************************************************
- *  iSeries_Get_Location_Code(struct iSeries_Device_Node*)      *
- *
- ****************************************************************/
-void  iSeries_Get_Location_Code(struct iSeries_Device_Node* DevNode)
+void iSeries_Get_Location_Code(struct iSeries_Device_Node *DevNode)
 {
-	int  BusVpdLen = 0;
-	u8*  BusVpdPtr = (u8*)kmalloc(BUS_VPDSIZE, GFP_KERNEL);
+	int BusVpdLen = 0;
+	u8 *BusVpdPtr = (u8 *)kmalloc(BUS_VPDSIZE, GFP_KERNEL);
+
 	if (BusVpdPtr == NULL) {
 		printk("PCI: Bus VPD Buffer allocation failure.\n");
 		return;
 	}
-	BusVpdLen  = HvCallPci_getBusVpd(ISERIES_BUS(DevNode),REALADDR(BusVpdPtr),BUS_VPDSIZE);
+	BusVpdLen = HvCallPci_getBusVpd(ISERIES_BUS(DevNode),
+			REALADDR(BusVpdPtr), BUS_VPDSIZE);
 	if (BusVpdLen == 0) {
 		kfree(BusVpdPtr);
 		printk("PCI: Bus VPD Buffer zero length.\n");
 		return;
 	}
-	//printk("PCI: BusVpdPtr: %p, %d\n",BusVpdPtr, BusVpdLen);
-	/*************************************************************/
-	/* Make sure this is what I think it is                      */
-	/*************************************************************/
-	if (*BusVpdPtr != VpdIdStringTag) {               /*0x82     */
+	/* printk("PCI: BusVpdPtr: %p, %d\n",BusVpdPtr, BusVpdLen); */
+	/* Make sure this is what I think it is */
+	if (*BusVpdPtr != VpdIdStringTag) {	/* 0x82 */
 		printk("PCI: Bus VPD Buffer missing starting tag.\n");
 		kfree(BusVpdPtr);
 		return;
 	}
-	/***************************************************************/
-	/***************************************************************/
 	iSeries_Parse_Vpd(BusVpdPtr,BusVpdLen, DevNode);
-	sprintf(DevNode->Location,"Frame%3d, Card %-4s",DevNode->FrameId,DevNode->CardLocation);
+	sprintf(DevNode->Location, "Frame%3d, Card %-4s", DevNode->FrameId,
+			DevNode->CardLocation);
 	kfree(BusVpdPtr);
 }
diff -Nru a/arch/ppc64/kernel/iSeries_htab.c b/arch/ppc64/kernel/iSeries_htab.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/ppc64/kernel/iSeries_htab.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,197 @@
+/*
+ * iSeries hashtable management.
+ * 	Derived from pSeries_htab.c
+ *
+ * SMP scalability work:
+ *    Copyright (C) 2001 Anton Blanchard <anton@au.ibm.com>, IBM
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#include <asm/machdep.h>
+#include <asm/pgtable.h>
+#include <asm/mmu.h>
+#include <asm/mmu_context.h>
+#include <asm/iSeries/HvCallHpt.h>
+#include <asm/abs_addr.h>
+
+#if 0
+#include <linux/spinlock.h>
+#include <linux/bitops.h>
+#include <linux/threads.h>
+#include <linux/smp.h>
+
+#include <asm/tlbflush.h>
+#include <asm/tlb.h>
+#include <asm/cputable.h>
+#endif
+
+static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
+			 unsigned long prpn, int secondary,
+			 unsigned long hpteflags, int bolted, int large)
+{
+	long slot;
+	HPTE lhpte;
+
+	/*
+	 * The hypervisor tries both primary and secondary.
+	 * If we are being called to insert in the secondary,
+	 * it means we have already tried both primary and secondary,
+	 * so we return failure immediately.
+	 */
+	if (secondary)
+		return -1;
+
+	slot = HvCallHpt_findValid(&lhpte, va >> PAGE_SHIFT);
+	if (lhpte.dw0.dw0.v)
+		panic("select_hpte_slot found entry already valid\n");
+
+	if (slot == -1)	/* No available entry found in either group */
+		return -1;
+
+	if (slot < 0) {		/* MSB set means secondary group */
+		secondary = 1;
+		slot &= 0x7fffffffffffffff;
+	}
+
+	lhpte.dw1.dword1      = 0;
+	lhpte.dw1.dw1.rpn     = physRpn_to_absRpn(prpn);
+	lhpte.dw1.flags.flags = hpteflags;
+
+	lhpte.dw0.dword0      = 0;
+	lhpte.dw0.dw0.avpn    = va >> 23;
+	lhpte.dw0.dw0.h       = secondary;
+	lhpte.dw0.dw0.bolted  = bolted;
+	lhpte.dw0.dw0.v       = 1;
+
+	/* Now fill in the actual HPTE */
+	HvCallHpt_addValidate(slot, secondary, &lhpte);
+
+	return (secondary << 3) | (slot & 7);
+}
+
+static unsigned long iSeries_hpte_getword0(unsigned long slot)
+{
+	unsigned long dword0;
+	HPTE hpte;
+
+	HvCallHpt_get(&hpte, slot);
+	dword0 = hpte.dw0.dword0;
+
+	return dword0;
+}
+
+static long iSeries_hpte_remove(unsigned long hpte_group)
+{
+	unsigned long slot_offset;
+	int i;
+	HPTE lhpte;
+
+	/* Pick a random slot to start at */
+	slot_offset = mftb() & 0x7;
+
+	for (i = 0; i < HPTES_PER_GROUP; i++) {
+		lhpte.dw0.dword0 = 
+			iSeries_hpte_getword0(hpte_group + slot_offset);
+
+		if (!lhpte.dw0.dw0.bolted) {
+			HvCallHpt_invalidateSetSwBitsGet(hpte_group + 
+							 slot_offset, 0, 0);
+			return i;
+		}
+
+		slot_offset++;
+		slot_offset &= 0x7;
+	}
+
+	return -1;
+}
+
+static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
+				  unsigned long va, int large, int local)
+{
+	HPTE hpte;
+	unsigned long avpn = va >> 23;
+
+	HvCallHpt_get(&hpte, slot);
+	if ((hpte.dw0.dw0.avpn == avpn) && (hpte.dw0.dw0.v)) {
+		HvCallHpt_setPp(slot, newpp);
+		return 0;
+	}
+	return -1;
+}
+
+/*
+ * Functions used to find the PTE for a particular virtual address. 
+ * Only used during boot when bolting pages.
+ *
+ * Input : vpn      : virtual page number
+ * Output: PTE index within the page table of the entry
+ *         -1 on failure
+ */
+static long iSeries_hpte_find(unsigned long vpn)
+{
+	HPTE hpte;
+	long slot;
+
+	/*
+	 * The HvCallHpt_findValid interface is as follows:
+	 * 0xffffffffffffffff : No entry found.
+	 * 0x00000000xxxxxxxx : Entry found in primary group, slot x
+	 * 0x80000000xxxxxxxx : Entry found in secondary group, slot x
+	 */
+	slot = HvCallHpt_findValid(&hpte, vpn); 
+	if (hpte.dw0.dw0.v) {
+		if (slot < 0) {
+			slot &= 0x7fffffffffffffff;
+			slot = -slot;
+		}
+	} else
+		slot = -1;
+	return slot;
+}
+
+/*
+ * Update the page protection bits. Intended to be used to create
+ * guard pages for kernel data structures on pages which are bolted
+ * in the HPT. Assumes pages being operated on will not be stolen.
+ * Does not work on large pages.
+ *
+ * No need to lock here because we should be the only user.
+ */
+static void iSeries_hpte_updateboltedpp(unsigned long newpp, unsigned long ea)
+{
+	unsigned long vsid,va,vpn;
+	long slot;
+
+	vsid = get_kernel_vsid(ea);
+	va = (vsid << 28) | (ea & 0x0fffffff);
+	vpn = va >> PAGE_SHIFT;
+	slot = iSeries_hpte_find(vpn); 
+	if (slot == -1)
+		panic("updateboltedpp: Could not find page to bolt\n");
+	HvCallHpt_setPp(slot, newpp);
+}
+
+static void iSeries_hpte_invalidate(unsigned long slot, unsigned long va,
+				    int large, int local)
+{
+	HPTE lhpte;
+	unsigned long avpn = va >> 23;
+
+	lhpte.dw0.dword0 = iSeries_hpte_getword0(slot);
+	
+	if ((lhpte.dw0.dw0.avpn == avpn) && lhpte.dw0.dw0.v)
+		HvCallHpt_invalidateSetSwBitsGet(slot, 0, 0);
+}
+
+void hpte_init_iSeries(void)
+{
+	ppc_md.hpte_invalidate	= iSeries_hpte_invalidate;
+	ppc_md.hpte_updatepp	= iSeries_hpte_updatepp;
+	ppc_md.hpte_updateboltedpp = iSeries_hpte_updateboltedpp;
+	ppc_md.hpte_insert	= iSeries_hpte_insert;
+	ppc_md.hpte_remove     	= iSeries_hpte_remove;
+}
diff -Nru a/arch/ppc64/kernel/iSeries_irq.c b/arch/ppc64/kernel/iSeries_irq.c
--- a/arch/ppc64/kernel/iSeries_irq.c	Tue Feb  3 19:45:35 2004
+++ b/arch/ppc64/kernel/iSeries_irq.c	Tue Feb  3 19:45:35 2004
@@ -40,219 +40,177 @@
 #include <asm/iSeries/iSeries_irq.h>
 #include <asm/iSeries/XmPciLpEvent.h>
 
-
-hw_irq_controller iSeries_IRQ_handler = {
-	"iSeries irq controller",
-	iSeries_startup_IRQ,	/* startup */
-	iSeries_shutdown_IRQ,	/* shutdown */
-	iSeries_enable_IRQ,	/* enable */
-	iSeries_disable_IRQ,	/* disable */
-	NULL,			/* ack  */
-	iSeries_end_IRQ,	/* end  */
-	NULL			/* set_affinity */
-};
-
-
-struct iSeries_irqEntry {
-	u32 dsa;
-	struct iSeries_irqEntry* next;
-};
-
-struct iSeries_irqAnchor {
-	u8  valid : 1;
-	u8  reserved : 7;
-	u16  entryCount;
-	struct iSeries_irqEntry* head;
+static unsigned int iSeries_startup_IRQ(unsigned int irq);
+static void iSeries_shutdown_IRQ(unsigned int irq);
+static void iSeries_enable_IRQ(unsigned int irq);
+static void iSeries_disable_IRQ(unsigned int irq);
+static void iSeries_end_IRQ(unsigned int irq);
+
+static hw_irq_controller iSeries_IRQ_handler = {
+	.typename = "iSeries irq controller",
+	.startup = iSeries_startup_IRQ,
+	.shutdown = iSeries_shutdown_IRQ,
+	.enable = iSeries_enable_IRQ,
+	.disable = iSeries_disable_IRQ,
+	.end = iSeries_end_IRQ
 };
 
-struct iSeries_irqAnchor iSeries_irqMap[NR_IRQS];
-
-void iSeries_init_irqMap(int irq);
+void iSeries_init_irq_desc(irq_desc_t *desc)
+{
+}
 
-/*  This is called by init_IRQ.  set in ppc_md.init_IRQ by iSeries_setup.c */
+/* This is called by init_IRQ.  set in ppc_md.init_IRQ by iSeries_setup.c */
 void __init iSeries_init_IRQ(void)
 {
-	int i;
-	for (i = 0; i < NR_IRQS; i++) {
-		irq_desc[i].handler = &iSeries_IRQ_handler;
-		irq_desc[i].status = 0;
-		irq_desc[i].status |= IRQ_DISABLED;
-		irq_desc[i].depth = 1;
-		iSeries_init_irqMap(i);
-	}
 	/* Register PCI event handler and open an event path */
-	PPCDBG(PPCDBG_BUSWALK,"Register PCI event handler and open an event path\n");
+	PPCDBG(PPCDBG_BUSWALK,
+			"Register PCI event handler and open an event path\n");
 	XmPciLpEvent_init();
 	return;
 }
 
-/**********************************************************************
- *  Called by iSeries_init_IRQ 
- * Prevent IRQs 0 and 255 from being used.  IRQ 0 appears in
- * uninitialized devices.  IRQ 255 appears in the PCI interrupt
- * line register if a PCI error occurs,
- *********************************************************************/
-void __init iSeries_init_irqMap(int irq)
-{
-	iSeries_irqMap[irq].valid = (irq == 0 || irq == 255)? 0 : 1;
-	iSeries_irqMap[irq].entryCount = 0;
-	iSeries_irqMap[irq].head = NULL;
-}
-
-/* This is called out of iSeries_scan_slot to allocate an IRQ for an EADS slot */
-/* It calculates the irq value for the slot.                                   */
-int __init iSeries_allocate_IRQ(HvBusNumber busNumber, HvSubBusNumber subBusNumber, HvAgentId deviceId)
+/*
+ * This is called out of iSeries_scan_slot to allocate an IRQ for an EADS slot
+ * It calculates the irq value for the slot.
+ * Note that subBusNumber is always 0 (at the moment at least).
+ */
+int __init iSeries_allocate_IRQ(HvBusNumber busNumber,
+		HvSubBusNumber subBusNumber, HvAgentId deviceId)
 {
 	u8 idsel = (deviceId >> 4);
-	u8 function = deviceId & 0x0F;
-	int irq = ((((busNumber-1)*16 + (idsel-1)*8 + function)*9/8) % 253) + 2;
-	return irq;
+	u8 function = deviceId & 7;
+
+	return ((busNumber - 1) << 6) + ((idsel - 1) << 3) + function + 1;
 }
 
-/* This is called out of iSeries_scan_slot to assign the EADS slot to its IRQ number */
-int __init iSeries_assign_IRQ(int irq, HvBusNumber busNumber, HvSubBusNumber subBusNumber, HvAgentId deviceId)
+#define IRQ_TO_BUS(irq)		(((((irq) - 1) >> 6) & 0xff) + 1)
+#define IRQ_TO_IDSEL(irq)	(((((irq) - 1) >> 3) & 7) + 1)
+#define IRQ_TO_FUNC(irq)	(((irq) - 1) & 7)
+
+/*
+ * This is called out of iSeries_scan_slot to assign the EADS slot
+ * to its IRQ number
+ */
+int __init iSeries_assign_IRQ(int irq, HvBusNumber busNumber,
+		HvSubBusNumber subBusNumber, HvAgentId deviceId)
 {
-	int rc;
-	u32 dsa = (busNumber << 16) | (subBusNumber << 8) | deviceId;
-	struct iSeries_irqEntry* newEntry;
-	unsigned long flags;
+	irq_desc_t *desc = get_real_irq_desc(irq);
 
-	if (irq < 0 || irq >= NR_IRQS) {
+	if (desc == NULL)
 		return -1;
-	}
-	newEntry = kmalloc(sizeof(*newEntry), GFP_KERNEL);
-	if (newEntry == NULL) {
-		return -ENOMEM;
-	}
-	newEntry->dsa  = dsa;
-	newEntry->next = NULL;
-	/********************************************************************
-	* Probably not necessary to lock the irq since allocation is only 
-	* done during buswalk, but it should not hurt anything except a 
-	* little performance to be smp safe.
-	*******************************************************************/
-	spin_lock_irqsave(&irq_desc[irq].lock, flags);
-
-	if (iSeries_irqMap[irq].valid) {
-		/* Push the new element onto the irq stack */
-		newEntry->next = iSeries_irqMap[irq].head;
-		iSeries_irqMap[irq].head = newEntry;
-		++iSeries_irqMap[irq].entryCount;
-		rc = 0;
-		PPCDBG(PPCDBG_BUSWALK,"iSeries_assign_IRQ   0x%04X.%02X.%02X = 0x%04X\n",busNumber, subBusNumber, deviceId, irq);
-	}
-	else {
-		printk("PCI: Something is wrong with the iSeries_irqMap. \n");
-		kfree(newEntry);
-		rc = -1;
-    }
-	spin_unlock_irqrestore(&irq_desc[irq].lock, flags);
-	return rc;
+	desc->handler = &iSeries_IRQ_handler;
+	return 0;
 }
 
 
 /* This is called by iSeries_activate_IRQs */
-unsigned int iSeries_startup_IRQ(unsigned int irq)
+static unsigned int iSeries_startup_IRQ(unsigned int irq)
 {
-	struct iSeries_irqEntry* entry;
-	u32 bus, subBus, deviceId, function, mask;
-	for(entry=iSeries_irqMap[irq].head; entry!=NULL; entry=entry->next) {
-		bus      = (entry->dsa >> 16) & 0xFFFF;
-		subBus   = (entry->dsa >> 8) & 0xFF;
-		deviceId = entry->dsa & 0xFF;
-		function = deviceId & 0x0F;
-		/* Link the IRQ number to the bridge */
-		HvCallXm_connectBusUnit(bus, subBus, deviceId, irq);
-        	/* Unmask bridge interrupts in the FISR */
-		mask = 0x01010000 << function;
-		HvCallPci_unmaskFisr(bus, subBus, deviceId, mask);
-		PPCDBG(PPCDBG_BUSWALK,"iSeries_activate_IRQ 0x%02X.%02X.%02X  Irq:0x%02X\n",bus,subBus,deviceId,irq);
-	}
+	u32 bus, deviceId, function, mask;
+	const u32 subBus = 0;
+
+	bus = IRQ_TO_BUS(irq);
+	function = IRQ_TO_FUNC(irq);
+	deviceId = (IRQ_TO_IDSEL(irq) << 4) + function;
+
+	/* Link the IRQ number to the bridge */
+	HvCallXm_connectBusUnit(bus, subBus, deviceId, irq);
+
+	/* Unmask bridge interrupts in the FISR */
+	mask = 0x01010000 << function;
+	HvCallPci_unmaskFisr(bus, subBus, deviceId, mask);
+	PPCDBG(PPCDBG_BUSWALK, "iSeries_activate_IRQ 0x%02X.%02X.%02X  Irq:0x%02X\n",
+				bus, subBus, deviceId, irq);
 	return 0;
 }
 
-/* This is called out of iSeries_fixup to activate interrupt
- * generation for usable slots                              */
+/*
+ * This is called out of iSeries_fixup to activate interrupt
+ * generation for usable slots
+ */
 void __init iSeries_activate_IRQs()
 {
 	int irq;
 	unsigned long flags;
-	for (irq=0; irq < NR_IRQS; irq++) {
-		spin_lock_irqsave(&irq_desc[irq].lock, flags);
-		irq_desc[irq].handler->startup(irq);
-		spin_unlock_irqrestore(&irq_desc[irq].lock, flags);
+
+	for (irq = 0; irq < NR_IRQS; irq++) {
+		irq_desc_t *desc = get_irq_desc(irq);
+
+		if (desc && desc->handler && desc->handler->startup) {
+			spin_lock_irqsave(&desc->lock, flags);
+			desc->handler->startup(irq);
+			spin_unlock_irqrestore(&desc->lock, flags);
+		}
     	}
 }
 
 /*  this is not called anywhere currently */
-void iSeries_shutdown_IRQ(unsigned int irq) {
-	struct iSeries_irqEntry* entry;
-	u32 bus, subBus, deviceId, function, mask;
+static void iSeries_shutdown_IRQ(unsigned int irq)
+{
+	u32 bus, deviceId, function, mask;
+	const u32 subBus = 0;
 
 	/* irq should be locked by the caller */
+	bus = IRQ_TO_BUS(irq);
+	function = IRQ_TO_FUNC(irq);
+	deviceId = (IRQ_TO_IDSEL(irq) << 4) + function;
 
-	for (entry=iSeries_irqMap[irq].head; entry; entry=entry->next) {
-		bus = (entry->dsa >> 16) & 0xFFFF;
-		subBus = (entry->dsa >> 8) & 0xFF;
-		deviceId = entry->dsa & 0xFF;
-		function = deviceId & 0x0F;
-		/* Invalidate the IRQ number in the bridge */
-		HvCallXm_connectBusUnit(bus, subBus, deviceId, 0);
-		/* Mask bridge interrupts in the FISR */
-		mask = 0x01010000 << function;
-		HvCallPci_maskFisr(bus, subBus, deviceId, mask);
-	}
+	/* Invalidate the IRQ number in the bridge */
+	HvCallXm_connectBusUnit(bus, subBus, deviceId, 0);
 
+	/* Mask bridge interrupts in the FISR */
+	mask = 0x01010000 << function;
+	HvCallPci_maskFisr(bus, subBus, deviceId, mask);
 }
 
-/***********************************************************
+/*
  * This will be called by device drivers (via disable_IRQ)
  * to disable INTA in the bridge interrupt status register.
- ***********************************************************/
-void iSeries_disable_IRQ(unsigned int irq)
+ */
+static void iSeries_disable_IRQ(unsigned int irq)
 {
-	struct iSeries_irqEntry* entry;
-	u32 bus, subBus, deviceId, mask;
+	u32 bus, deviceId, function, mask;
+	const u32 subBus = 0;
 
 	/* The IRQ has already been locked by the caller */
-
-	for (entry=iSeries_irqMap[irq].head; entry; entry=entry->next) {
-		bus      = (entry->dsa >> 16) & 0xFFFF;
-		subBus   = (entry->dsa >> 8) & 0xFF;
-		deviceId = entry->dsa & 0xFF;
-		/* Mask secondary INTA   */
-		mask = 0x80000000;
-		HvCallPci_maskInterrupts(bus, subBus, deviceId, mask);
-		PPCDBG(PPCDBG_BUSWALK,"iSeries_disable_IRQ 0x%02X.%02X.%02X 0x%04X\n",bus,subBus,deviceId,irq);
-    	}
+	bus = IRQ_TO_BUS(irq);
+	function = IRQ_TO_FUNC(irq);
+	deviceId = (IRQ_TO_IDSEL(irq) << 4) + function;
+
+	/* Mask secondary INTA   */
+	mask = 0x80000000;
+	HvCallPci_maskInterrupts(bus, subBus, deviceId, mask);
+	PPCDBG(PPCDBG_BUSWALK, "iSeries_disable_IRQ 0x%02X.%02X.%02X 0x%04X\n",
+	       bus, subBus, deviceId, irq);
 }
 
-/***********************************************************
+/*
  * This will be called by device drivers (via enable_IRQ)
  * to enable INTA in the bridge interrupt status register.
- ***********************************************************/
-void iSeries_enable_IRQ(unsigned int irq)
+ */
+static void iSeries_enable_IRQ(unsigned int irq)
 {
-	struct iSeries_irqEntry* entry;
-	u32 bus, subBus, deviceId, mask;
+	u32 bus, deviceId, function, mask;
+	const u32 subBus = 0;
 
 	/* The IRQ has already been locked by the caller */
-	for (entry=iSeries_irqMap[irq].head; entry; entry=entry->next) {
-		bus      = (entry->dsa >> 16) & 0xFFFF;
-		subBus   = (entry->dsa >> 8) & 0xFF;
-		deviceId = entry->dsa & 0xFF;
-		/* Unmask secondary INTA */
-		mask = 0x80000000;
-		HvCallPci_unmaskInterrupts(bus, subBus, deviceId, mask);
-		PPCDBG(PPCDBG_BUSWALK,"iSeries_enable_IRQ 0x%02X.%02X.%02X 0x%04X\n",bus,subBus,deviceId,irq);
-	}
-}
-
-/* Need to define this so ppc_irq_dispatch_handler will NOT call
-   enable_IRQ at the end of interrupt handling.  However, this
-   does nothing because there is not enough information provided
-   to do the EOI HvCall.  This is done by XmPciLpEvent.c */
-void iSeries_end_IRQ(unsigned int irq)
+	bus = IRQ_TO_BUS(irq);
+	function = IRQ_TO_FUNC(irq);
+	deviceId = (IRQ_TO_IDSEL(irq) << 4) + function;
+
+	/* Unmask secondary INTA */
+	mask = 0x80000000;
+	HvCallPci_unmaskInterrupts(bus, subBus, deviceId, mask);
+	PPCDBG(PPCDBG_BUSWALK, "iSeries_enable_IRQ 0x%02X.%02X.%02X 0x%04X\n",
+	       bus, subBus, deviceId, irq);
+}
+
+/*
+ * Need to define this so ppc_irq_dispatch_handler will NOT call
+ * enable_IRQ at the end of interrupt handling.  However, this does
+ * nothing because there is not enough information provided to do
+ * the EOI HvCall.  This is done by XmPciLpEvent.c
+ */
+static void iSeries_end_IRQ(unsigned int irq)
 {
 }
-
diff -Nru a/arch/ppc64/kernel/iSeries_pci.c b/arch/ppc64/kernel/iSeries_pci.c
--- a/arch/ppc64/kernel/iSeries_pci.c	Tue Feb  3 19:45:43 2004
+++ b/arch/ppc64/kernel/iSeries_pci.c	Tue Feb  3 19:45:43 2004
@@ -1,3 +1,4 @@
+#define PCIFR(...)
 /*
  * iSeries_pci.c
  *
@@ -35,7 +36,6 @@
 #include <asm/pci-bridge.h>
 #include <asm/ppcdebug.h>
 #include <asm/naca.h>
-#include <asm/flight_recorder.h>
 #include <asm/pci_dma.h>
 
 #include <asm/iSeries/HvCallPci.h>
@@ -49,856 +49,811 @@
 #include "iSeries_IoMmTable.h"
 #include "pci.h"
 
-extern struct pci_controller* hose_head;
-extern struct pci_controller** hose_tail;
-extern int    global_phb_number;
-extern int    panic_timeout;
+extern int panic_timeout;
 
-extern struct device_node *allnodes;
 extern unsigned long iSeries_Base_Io_Memory;    
 
-extern struct pci_ops iSeries_pci_ops;
-extern struct flightRecorder* PciFr;
-extern struct TceTable* tceTables[256];
-
-/*******************************************************************
- * Counters and control flags. 
- *******************************************************************/
-extern long   Pci_Io_Read_Count;
-extern long   Pci_Io_Write_Count;
-extern long   Pci_Cfg_Read_Count;
-extern long   Pci_Cfg_Write_Count;
-extern long   Pci_Error_Count;
-
-extern int    Pci_Retry_Max;	
-extern int    Pci_Error_Flag;
-extern int    Pci_Trace_Flag;
+extern struct TceTable *tceTables[256];
 
 extern void iSeries_MmIoTest(void);
 
-
-/*******************************************************************
+/*
  * Forward declares of prototypes. 
- *******************************************************************/
-struct iSeries_Device_Node* find_Device_Node(struct pci_dev* PciDev);
-struct iSeries_Device_Node* get_Device_Node(struct pci_dev* PciDev);
-
-unsigned long find_and_init_phbs(void);
-struct        pci_controller* alloc_phb(struct device_node *dev, char *model, unsigned int addr_size_words) ;
-
-void  iSeries_Scan_PHBs_Slots(struct pci_controller* Phb);
-void  iSeries_Scan_EADs_Bridge(HvBusNumber Bus, HvSubBusNumber SubBus, int IdSel);
-int   iSeries_Scan_Bridge_Slot(HvBusNumber Bus, struct HvCallPci_BridgeInfo* Info);
-void  list_device_nodes(void);
-
-struct pci_dev;
+ */
+static struct iSeries_Device_Node *find_Device_Node(int bus, int devfn);
+static void iSeries_Scan_PHBs_Slots(struct pci_controller *Phb);
+static void iSeries_Scan_EADs_Bridge(HvBusNumber Bus, HvSubBusNumber SubBus,
+		int IdSel);
+static int iSeries_Scan_Bridge_Slot(HvBusNumber Bus,
+		struct HvCallPci_BridgeInfo *Info);
 
 LIST_HEAD(iSeries_Global_Device_List);
 
-int DeviceCount = 0;
-
+static int DeviceCount;
 
 /* Counters and control flags. */
-static long   Pci_Io_Read_Count  = 0;
-static long   Pci_Io_Write_Count = 0;
-static long   Pci_Cfg_Read_Count = 0;
-static long   Pci_Cfg_Write_Count= 0;
-static long   Pci_Error_Count    = 0;
-
-static int    Pci_Retry_Max      = 3;	/* Only retry 3 times  */	
-static int    Pci_Error_Flag     = 1;	/* Set Retry Error on. */
-static int    Pci_Trace_Flag     = 0;
+static long Pci_Io_Read_Count;
+static long Pci_Io_Write_Count;
+#if 0
+static long Pci_Cfg_Read_Count;
+static long Pci_Cfg_Write_Count;
+#endif
+static long Pci_Error_Count;
+
+static int Pci_Retry_Max = 3;	/* Only retry 3 times  */	
+static int Pci_Error_Flag = 1;	/* Set Retry Error on. */
 
+static struct pci_ops iSeries_pci_ops;
 
-/**********************************************************************************
+/*
  * Log Error infor in Flight Recorder to system Console.
  * Filter out the device not there errors.
  * PCI: EADs Connect Failed 0x18.58.10 Rc: 0x00xx
  * PCI: Read Vendor Failed 0x18.58.10 Rc: 0x00xx
  * PCI: Connect Bus Unit Failed 0x18.58.10 Rc: 0x00xx
- **********************************************************************************/
-void  pci_Log_Error(char* Error_Text, int Bus, int SubBus, int AgentId, int HvRc)
+ */
+static void pci_Log_Error(char *Error_Text, int Bus, int SubBus,
+		int AgentId, int HvRc)
 {
-	if( HvRc != 0x0302) { 
-		char ErrorString[128];
-		sprintf(ErrorString,"%s Failed: 0x%02X.%02X.%02X Rc: 0x%04X",Error_Text,Bus,SubBus,AgentId,HvRc);
-		PCIFR(ErrorString);
-		printk("PCI: %s\n",ErrorString);
-	}
+	if (HvRc == 0x0302)
+		return;
+
+	printk(KERN_ERR "PCI: %s Failed: 0x%02X.%02X.%02X Rc: 0x%04X",
+	       Error_Text, Bus, SubBus, AgentId, HvRc);
 }
 
-/**********************************************************************************
+#if 0
+/*
  * Dump the iSeries Temp Device Node 
- *<4>buswalk [swapper : - DeviceNode: 0xC000000000634300
- *<4>00. Device Node   = 0xC000000000634300
- *<4>    - PciDev      = 0x0000000000000000
- *<4>    - tDevice     = 0x  17:01.00  0x1022 00
- *<4>  4. Device Node = 0xC000000000634480
- *<4>     - PciDev    = 0x0000000000000000
- *<4>     - Device    = 0x  18:38.16 Irq:0xA7 Vendor:0x1014  Flags:0x00
- *<4>     - Devfn     = 0xB0: 22.18
- **********************************************************************************/
-void dumpDevice_Node(struct iSeries_Device_Node* DevNode)
+ * <4>buswalk [swapper : - DeviceNode: 0xC000000000634300
+ * <4>00. Device Node   = 0xC000000000634300
+ * <4>    - PciDev      = 0x0000000000000000
+ * <4>    - tDevice     = 0x  17:01.00  0x1022 00
+ * <4>  4. Device Node = 0xC000000000634480
+ * <4>     - PciDev    = 0x0000000000000000
+ * <4>     - Device    = 0x  18:38.16 Irq:0xA7 Vendor:0x1014  Flags:0x00
+ * <4>     - Devfn     = 0xB0: 22.18
+ */
+void dumpDevice_Node(struct iSeries_Device_Node *DevNode)
 {
-	udbg_printf("Device Node      = 0x%p\n",DevNode);
-	udbg_printf("     - PciDev    = 0x%p\n",DevNode->PciDev);
+	udbg_printf("Device Node      = 0x%p\n", DevNode);
+	udbg_printf("     - PciDev    = 0x%p\n", DevNode->PciDev);
 	udbg_printf("     - Device    = 0x%4X:%02X.%02X (0x%02X)\n",
-		    ISERIES_BUS(DevNode),
-		    ISERIES_SUBBUS(DevNode),
-		    DevNode->AgentId,
-		    DevNode->DevFn);
-	udbg_printf("     - LSlot     = 0x%02X\n",DevNode->LogicalSlot);
-	udbg_printf("     - TceTable  = 0x%p\n  ",DevNode->DevTceTable);
-
-	udbg_printf("     - DSA       = 0x%04X\n",ISERIES_DSA(DevNode)>>32 );
-
+			ISERIES_BUS(DevNode), ISERIES_SUBBUS(DevNode),
+			DevNode->AgentId, DevNode->DevFn);
+	udbg_printf("     - LSlot     = 0x%02X\n", DevNode->LogicalSlot);
+	udbg_printf("     - TceTable  = 0x%p\n  ", DevNode->DevTceTable);
+	udbg_printf("     - DSA       = 0x%04X\n", ISERIES_DSA(DevNode) >> 32);
 	udbg_printf("                 = Irq:0x%02X Vendor:0x%04X  Flags:0x%02X\n",
-		    DevNode->Irq,
-		    DevNode->Vendor,
-		    DevNode->Flags );
-	udbg_printf("     - Location  = %s\n",DevNode->CardLocation);
-
-
+			DevNode->Irq, DevNode->Vendor, DevNode->Flags);
+	udbg_printf("     - Location  = %s\n", DevNode->CardLocation);
 }
-/**********************************************************************************
+
+/*
  * Walk down the device node chain 
- **********************************************************************************/
-void  list_device_nodes(void)
+ */
+static void list_device_nodes(void)
 {
-	struct list_head* Device_Node_Ptr = iSeries_Global_Device_List.next;
-	while(Device_Node_Ptr != &iSeries_Global_Device_List) {
-		dumpDevice_Node( (struct iSeries_Device_Node*)Device_Node_Ptr );
+	struct list_head *Device_Node_Ptr = iSeries_Global_Device_List.next;
+
+	while (Device_Node_Ptr != &iSeries_Global_Device_List) {
+		dumpDevice_Node((struct iSeries_Device_Node*)Device_Node_Ptr);
 		Device_Node_Ptr = Device_Node_Ptr->next;
 	}
 }
-	
+#endif
 
-/***********************************************************************
+/*
  * build_device_node(u16 Bus, int SubBus, u8 DevFn)
- *
- ***********************************************************************/
-struct iSeries_Device_Node* build_device_node(HvBusNumber Bus, HvSubBusNumber  SubBus, int AgentId, int Function)
+ */
+static struct iSeries_Device_Node *build_device_node(HvBusNumber Bus,
+		HvSubBusNumber SubBus, int AgentId, int Function)
 {
-	struct iSeries_Device_Node*  DeviceNode;
-
-	PPCDBG(PPCDBG_BUSWALK,"-build_device_node 0x%02X.%02X.%02X Function: %02X\n",Bus,SubBus,AgentId, Function);
+	struct iSeries_Device_Node *node;
 
-	DeviceNode = kmalloc(sizeof(struct iSeries_Device_Node), GFP_KERNEL);
-	if(DeviceNode == NULL) return NULL;
-
-	memset(DeviceNode,0,sizeof(struct iSeries_Device_Node) );
-	list_add_tail(&DeviceNode->Device_List,&iSeries_Global_Device_List);
-	/*DeviceNode->DsaAddr      = ((u64)Bus<<48)+((u64)SubBus<<40)+((u64)0x10<<32); */
-	ISERIES_BUS(DeviceNode)       = Bus;
-	ISERIES_SUBBUS(DeviceNode)    = SubBus;
-	DeviceNode->DsaAddr.deviceId  = 0x10;
-        DeviceNode->DsaAddr.barNumber = 0;
-	DeviceNode->AgentId           = AgentId;
-	DeviceNode->DevFn             = PCI_DEVFN(ISERIES_ENCODE_DEVICE(AgentId),Function );
-	DeviceNode->IoRetry           = 0;
-	iSeries_Get_Location_Code(DeviceNode);
-	PCIFR("Device 0x%02X.%2X, Node:0x%p ",ISERIES_BUS(DeviceNode),ISERIES_DEVFUN(DeviceNode),DeviceNode);
-	return DeviceNode;
-}
-/****************************************************************************
-* 
-* Allocate pci_controller(phb) initialized common variables. 
-* 
-*****************************************************************************/
-struct pci_controller* pci_alloc_pci_controllerX(char *model, enum phb_types controller_type)
-{
-	struct pci_controller *hose;
-	hose = (struct pci_controller*)kmalloc(sizeof(struct pci_controller), GFP_KERNEL);
-	if(hose == NULL) return NULL;
-
-	memset(hose, 0, sizeof(struct pci_controller));
-	if(strlen(model) < 8) strcpy(hose->what,model);
-	else                  memcpy(hose->what,model,7);
-	hose->type = controller_type;
-	hose->global_number = global_phb_number;
-	global_phb_number++;
-
-	*hose_tail = hose;
-	hose_tail = &hose->next;
-	return hose;
+	PPCDBG(PPCDBG_BUSWALK,
+			"-build_device_node 0x%02X.%02X.%02X Function: %02X\n",
+			Bus, SubBus, AgentId, Function);
+
+	node = kmalloc(sizeof(struct iSeries_Device_Node), GFP_KERNEL);
+	if (node == NULL)
+		return NULL;
+
+	memset(node, 0, sizeof(struct iSeries_Device_Node));
+	list_add_tail(&node->Device_List, &iSeries_Global_Device_List);
+#if 0
+	node->DsaAddr = ((u64)Bus << 48) + ((u64)SubBus << 40) + ((u64)0x10 << 32);
+#endif
+	node->DsaAddr.DsaAddr = 0;
+	node->DsaAddr.Dsa.busNumber = Bus;
+	node->DsaAddr.Dsa.subBusNumber = SubBus;
+	node->DsaAddr.Dsa.deviceId = 0x10;
+	node->AgentId = AgentId;
+	node->DevFn = PCI_DEVFN(ISERIES_ENCODE_DEVICE(AgentId), Function);
+	node->IoRetry = 0;
+	iSeries_Get_Location_Code(node);
+	PCIFR("Device 0x%02X.%2X, Node:0x%p ", ISERIES_BUS(node),
+			ISERIES_DEVFUN(node), node);
+	return node;
 }
 
-/****************************************************************************
- *
- * unsigned int __init find_and_init_phbs(void)
+/*
+ * unsigned long __init find_and_init_phbs(void)
  *
  * Description:
  *   This function checks for all possible system PCI host bridges that connect
  *   PCI buses.  The system hypervisor is queried as to the guest partition
- *   ownership status.  A pci_controller is build for any bus which is partially
+ *   ownership status.  A pci_controller is built for any bus which is partially
  *   owned or fully owned by this guest partition.
- ****************************************************************************/
+ */
 unsigned long __init find_and_init_phbs(void)
 {
-	struct      pci_controller* phb;
-	HvBusNumber BusNumber;
+	struct pci_controller *phb;
+	HvBusNumber bus;
 
-	PPCDBG(PPCDBG_BUSWALK,"find_and_init_phbs Entry\n");
+	PPCDBG(PPCDBG_BUSWALK, "find_and_init_phbs Entry\n");
 
 	/* Check all possible buses. */
-	for (BusNumber = 0; BusNumber < 256; BusNumber++) {
-		int RtnCode = HvCallXm_testBus(BusNumber);
-		if (RtnCode == 0) {
-			phb = pci_alloc_pci_controllerX("PHB HV", phb_type_hypervisor);
-			if(phb == NULL) {
-				printk("PCI: Allocate pci_controller failed.\n");
-				PCIFR(      "Allocate pci_controller failed.");
+	for (bus = 0; bus < 256; bus++) {
+		int ret = HvCallXm_testBus(bus);
+		if (ret == 0) {
+			printk("bus %d appears to exist\n", bus);
+			phb = pci_alloc_pci_controller(phb_type_hypervisor);
+			if (phb == NULL) {
+				PCIFR("Allocate pci_controller failed.");
 				return -1;
 			}
-			phb->pci_mem_offset = phb->local_number = BusNumber;
-			phb->first_busno  = BusNumber;
-			phb->last_busno   = BusNumber;
-			phb->ops          = &iSeries_pci_ops;
-
-			PPCDBG(PPCDBG_BUSWALK, "PCI:Create iSeries pci_controller(%p), Bus: %04X\n",phb,BusNumber);
-			PCIFR("Create iSeries PHB controller: %04X",BusNumber);
-
-			/***************************************************/
-			/* Find and connect the devices.                   */
-			/***************************************************/
+			phb->pci_mem_offset = phb->local_number = bus;
+			phb->first_busno = bus;
+			phb->last_busno = bus;
+			phb->ops = &iSeries_pci_ops;
+
+			PPCDBG(PPCDBG_BUSWALK, "PCI:Create iSeries pci_controller(%p), Bus: %04X\n",
+					phb, bus);
+			PCIFR("Create iSeries PHB controller: %04X", bus);
+
+			/* Find and connect the devices. */
 			iSeries_Scan_PHBs_Slots(phb);
 		}
-		/* Check for Unexpected Return code, a clue that something */
-		/* has gone wrong.                                         */
-		else if(RtnCode != 0x0301) {
-			PCIFR("Unexpected Return on Probe(0x%04X): 0x%04X",BusNumber,RtnCode);
-		}
-
+		/*
+		 * Check for Unexpected Return code, a clue that something
+		 * has gone wrong.
+		 */
+		else if (ret != 0x0301)
+			printk(KERN_ERR "Unexpected Return on Probe(0x%04X): 0x%04X",
+			       bus, ret);
 	}
 	return 0;
 }
-/*********************************************************************** 
+
+/*
  * iSeries_pcibios_init
  *  
  * Chance to initialize and structures or variable before PCI Bus walk.
- *  
- *<4>buswalk [swapper : iSeries_pcibios_init Entry.
- *<4>buswalk [swapper : IoMmTable Initialized 0xC00000000034BD30
- *<4>buswalk [swapper : find_and_init_phbs Entry
- *<4>buswalk [swapper : Create iSeries pci_controller:(0xC00000001F5C7000), Bus 0x0017
- *<4>buswalk [swapper : Connect EADs: 0x17.00.12 = 0x00
- *<4>buswalk [swapper : iSeries_assign_IRQ   0x0017.00.12 = 0x0091
- *<4>buswalk [swapper : - allocate and assign IRQ 0x17.00.12 = 0x91
- *<4>buswalk [swapper : - FoundDevice: 0x17.28.10 = 0x12AE
- *<4>buswalk [swapper : - build_device_node 0x17.28.12
- *<4>buswalk [swapper : iSeries_pcibios_init Exit.
- ***********************************************************************/
+ */
 void iSeries_pcibios_init(void)
 {
-	PPCDBG(PPCDBG_BUSWALK,"iSeries_pcibios_init Entry.\n"); 
-
+	PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_init Entry.\n"); 
 	iSeries_IoMmTable_Initialize();
-
 	find_and_init_phbs();
-
-	pci_assign_all_busses = 0;
-	PPCDBG(PPCDBG_BUSWALK,"iSeries_pcibios_init Exit.\n"); 
+	/* pci_assign_all_busses = 0;		SFRXXX*/
+	PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_init Exit.\n"); 
 }
-/***********************************************************************
+
+/*
  * pcibios_final_fixup(void)  
- ***********************************************************************/
+ */
 void __init pcibios_final_fixup(void)
 {
-	struct pci_dev* PciDev = NULL;
-	struct iSeries_Device_Node* DeviceNode;
-	char   Buffer[256];
-    	int    DeviceCount = 0;
+	struct pci_dev *pdev = NULL;
+	struct iSeries_Device_Node *node;
+	char Buffer[256];
+    	int DeviceCount = 0;
+
+	PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_fixup Entry.\n"); 
 
-	PPCDBG(PPCDBG_BUSWALK,"iSeries_pcibios_fixup Entry.\n"); 
-	/******************************************************/
 	/* Fix up at the device node and pci_dev relationship */
-	/******************************************************/
 	mf_displaySrc(0xC9000100);
 
-	while ((PciDev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, PciDev)) != NULL) {
-		DeviceNode = find_Device_Node(PciDev);
-		if(DeviceNode != NULL) {
-			++DeviceCount;
-			PciDev->sysdata    = (void*)DeviceNode;
-			DeviceNode->PciDev = PciDev;
-
-			PPCDBG(PPCDBG_BUSWALK,"PciDev 0x%p <==> DevNode 0x%p\n",PciDev,DeviceNode );
-
-			iSeries_allocateDeviceBars(PciDev);
-
-			iSeries_Device_Information(PciDev,Buffer, sizeof(Buffer) );
-			printk("%d. %s\n",DeviceCount,Buffer);
+	printk("pcibios_final_fixup\n");
+	while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev))
+			!= NULL) {
+		node = find_Device_Node(pdev->bus->number, pdev->devfn);
+		printk("pci dev %p (%x.%x), node %p\n", pdev,
+		       pdev->bus->number, pdev->devfn, node);
 
-			create_pci_bus_tce_table((unsigned long)DeviceNode);
-		} else {
-			printk("PCI: Device Tree not found for 0x%016lX\n",(unsigned long)PciDev);
-		}
+		if (node != NULL) {
+			++DeviceCount;
+			pdev->sysdata = (void *)node;
+			node->PciDev = pdev;
+			PPCDBG(PPCDBG_BUSWALK,
+					"pdev 0x%p <==> DevNode 0x%p\n",
+					pdev, node);
+			iSeries_allocateDeviceBars(pdev);
+			iSeries_Device_Information(pdev, Buffer,
+					sizeof(Buffer));
+			printk("%d. %s\n", DeviceCount, Buffer);
+			create_pci_bus_tce_table((unsigned long)node);
+		} else
+			printk("PCI: Device Tree not found for 0x%016lX\n",
+					(unsigned long)pdev);
 	}
 	iSeries_IoMmTable_Status();
-
 	iSeries_activate_IRQs();
-
 	mf_displaySrc(0xC9000200);
 }
 
-void pcibios_fixup_bus(struct pci_bus* PciBus)
+void pcibios_fixup_bus(struct pci_bus *PciBus)
 {
-	PPCDBG(PPCDBG_BUSWALK,"iSeries_pcibios_fixup_bus(0x%04X) Entry.\n",PciBus->number); 
-
+	PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_fixup_bus(0x%04X) Entry.\n",
+			PciBus->number); 
 }
 
-
-/***********************************************************************
- * pcibios_fixup_resources(struct pci_dev *dev) 
- *	
- ***********************************************************************/
-void pcibios_fixup_resources(struct pci_dev *PciDev)
+void pcibios_fixup_resources(struct pci_dev *pdev)
 {
-	PPCDBG(PPCDBG_BUSWALK,"pcibios_fixup_resources PciDev %p\n",PciDev);
+	PPCDBG(PPCDBG_BUSWALK, "fixup_resources pdev %p\n", pdev);
 }   
 
+/*
+ * Loop through each node function to find usable EADs bridges.  
+ */
+static void iSeries_Scan_PHBs_Slots(struct pci_controller *Phb)
+{
+	struct HvCallPci_DeviceInfo *DevInfo;
+	HvBusNumber bus = Phb->local_number;	/* System Bus */	
+	const HvSubBusNumber SubBus = 0;	/* EADs is always 0. */
+	int HvRc = 0;
+	int IdSel;	
+	const int MaxAgents = 8;
+
+	DevInfo = (struct HvCallPci_DeviceInfo*)
+		kmalloc(sizeof(struct HvCallPci_DeviceInfo), GFP_KERNEL);
+	if (DevInfo == NULL)
+		return;
 
-/********************************************************************************
-* Loop through each node function to find usable EADs bridges.  
-*********************************************************************************/
-void  iSeries_Scan_PHBs_Slots(struct pci_controller* Phb)
-{
-	struct HvCallPci_DeviceInfo* DevInfo;
-	HvBusNumber    Bus       = Phb->local_number;       /* System Bus        */	
-	HvSubBusNumber SubBus    = 0;                       /* EADs is always 0. */
-	int            HvRc      = 0;
-	int            IdSel     = 1;	
-	int            MaxAgents = 8;
-
-	DevInfo    = (struct HvCallPci_DeviceInfo*)kmalloc(sizeof(struct HvCallPci_DeviceInfo), GFP_KERNEL);
-	if(DevInfo == NULL) return;
-
-	/********************************************************************************
+	/*
 	 * Probe for EADs Bridges      
-	 ********************************************************************************/
-	for (IdSel=1; IdSel < MaxAgents; ++IdSel) {
-    		HvRc = HvCallPci_getDeviceInfo(Bus, SubBus, IdSel,REALADDR(DevInfo), sizeof(struct HvCallPci_DeviceInfo));
+	 */
+	for (IdSel = 1; IdSel < MaxAgents; ++IdSel) {
+    		HvRc = HvCallPci_getDeviceInfo(bus, SubBus, IdSel,
+				REALADDR(DevInfo),
+				sizeof(struct HvCallPci_DeviceInfo));
 		if (HvRc == 0) {
-			if(DevInfo->deviceType == HvCallPci_NodeDevice) {
-				iSeries_Scan_EADs_Bridge(Bus, SubBus, IdSel);
-			}
-			else printk("PCI: Invalid System Configuration(0x%02X.\n",DevInfo->deviceType);
+			if (DevInfo->deviceType == HvCallPci_NodeDevice)
+				iSeries_Scan_EADs_Bridge(bus, SubBus, IdSel);
+			else
+				printk("PCI: Invalid System Configuration(0x%02X)"
+				       " for bus 0x%02x id 0x%02x.\n",
+				       DevInfo->deviceType, bus, IdSel);
 		}
-		else pci_Log_Error("getDeviceInfo",Bus, SubBus, IdSel,HvRc);
+		else
+			pci_Log_Error("getDeviceInfo", bus, SubBus, IdSel, HvRc);
 	}
 	kfree(DevInfo);
 }
 
-/********************************************************************************
-* 
-*********************************************************************************/
-void  iSeries_Scan_EADs_Bridge(HvBusNumber Bus, HvSubBusNumber SubBus, int IdSel)
-{
-	struct HvCallPci_BridgeInfo* BridgeInfo;
-	HvAgentId      AgentId;
-	int            Function;
-	int            HvRc;
-
-	BridgeInfo = (struct HvCallPci_BridgeInfo*)kmalloc(sizeof(struct HvCallPci_BridgeInfo), GFP_KERNEL);
-	if(BridgeInfo == NULL) return;
-
-	/*********************************************************************
-	 * Note: hvSubBus and irq is always be 0 at this level!
-	 *********************************************************************/
-	for (Function=0; Function < 8; ++Function) {
+static void iSeries_Scan_EADs_Bridge(HvBusNumber bus, HvSubBusNumber SubBus,
+		int IdSel)
+{
+	struct HvCallPci_BridgeInfo *BridgeInfo;
+	HvAgentId AgentId;
+	int Function;
+	int HvRc;
+
+	BridgeInfo = (struct HvCallPci_BridgeInfo *)
+		kmalloc(sizeof(struct HvCallPci_BridgeInfo), GFP_KERNEL);
+	if (BridgeInfo == NULL)
+		return;
+
+	/* Note: hvSubBus and irq is always be 0 at this level! */
+	for (Function = 0; Function < 8; ++Function) {
 	  	AgentId = ISERIES_PCI_AGENTID(IdSel, Function);
-		HvRc = HvCallXm_connectBusUnit(Bus, SubBus, AgentId, 0);
+		HvRc = HvCallXm_connectBusUnit(bus, SubBus, AgentId, 0);
  		if (HvRc == 0) {
+			printk("found device at bus %d idsel %d func %d (AgentId %x)\n",
+			       bus, IdSel, Function, AgentId);
   			/*  Connect EADs: 0x18.00.12 = 0x00 */
-			PPCDBG(PPCDBG_BUSWALK,"PCI:Connect EADs: 0x%02X.%02X.%02X\n",Bus, SubBus, AgentId);
-			PCIFR(                    "Connect EADs: 0x%02X.%02X.%02X",  Bus, SubBus, AgentId);
-	    		HvRc = HvCallPci_getBusUnitInfo(Bus, SubBus, AgentId, 
-			                                REALADDR(BridgeInfo), sizeof(struct HvCallPci_BridgeInfo));
+			PPCDBG(PPCDBG_BUSWALK,
+					"PCI:Connect EADs: 0x%02X.%02X.%02X\n",
+					bus, SubBus, AgentId);
+	    		HvRc = HvCallPci_getBusUnitInfo(bus, SubBus, AgentId,
+					REALADDR(BridgeInfo),
+					sizeof(struct HvCallPci_BridgeInfo));
 	 		if (HvRc == 0) {
-				PPCDBG(PPCDBG_BUSWALK,"PCI: BridgeInfo, Type:0x%02X, SubBus:0x%02X, MaxAgents:0x%02X, MaxSubBus: 0x%02X, LSlot: 0x%02X\n",
-				       BridgeInfo->busUnitInfo.deviceType,
-				       BridgeInfo->subBusNumber,
-				       BridgeInfo->maxAgents,
-				       BridgeInfo->maxSubBusNumber,
-				       BridgeInfo->logicalSlotNumber);
-				PCIFR(                     "BridgeInfo, Type:0x%02X, SubBus:0x%02X, MaxAgents:0x%02X, MaxSubBus: 0x%02X, LSlot: 0x%02X",
-				       BridgeInfo->busUnitInfo.deviceType,
-				       BridgeInfo->subBusNumber,
-				       BridgeInfo->maxAgents,
-				       BridgeInfo->maxSubBusNumber,
-				       BridgeInfo->logicalSlotNumber);
+				printk("bridge info: type %x subbus %x maxAgents %x maxsubbus %x logslot %x\n",
+					BridgeInfo->busUnitInfo.deviceType,
+					BridgeInfo->subBusNumber,
+					BridgeInfo->maxAgents,
+					BridgeInfo->maxSubBusNumber,
+					BridgeInfo->logicalSlotNumber);
+				PPCDBG(PPCDBG_BUSWALK,
+					"PCI: BridgeInfo, Type:0x%02X, SubBus:0x%02X, MaxAgents:0x%02X, MaxSubBus: 0x%02X, LSlot: 0x%02X\n",
+					BridgeInfo->busUnitInfo.deviceType,
+					BridgeInfo->subBusNumber,
+					BridgeInfo->maxAgents,
+					BridgeInfo->maxSubBusNumber,
+					BridgeInfo->logicalSlotNumber);
 
-				if (BridgeInfo->busUnitInfo.deviceType == HvCallPci_BridgeDevice)  {
+				if (BridgeInfo->busUnitInfo.deviceType ==
+						HvCallPci_BridgeDevice)  {
 					/* Scan_Bridge_Slot...: 0x18.00.12 */
-					iSeries_Scan_Bridge_Slot(Bus,BridgeInfo);
-				}
-				else printk("PCI: Invalid Bridge Configuration(0x%02X)",BridgeInfo->busUnitInfo.deviceType);
+					iSeries_Scan_Bridge_Slot(bus, BridgeInfo);
+				} else
+					printk("PCI: Invalid Bridge Configuration(0x%02X)",
+						BridgeInfo->busUnitInfo.deviceType);
 			}
-    		}
-		else if(HvRc != 0x000B) pci_Log_Error("EADs Connect",Bus,SubBus,AgentId,HvRc);
+    		} else if (HvRc != 0x000B)
+			pci_Log_Error("EADs Connect",
+					bus, SubBus, AgentId, HvRc);
 	}
 	kfree(BridgeInfo);
 }
 
-/********************************************************************************
-* 
-* This assumes that the node slot is always on the primary bus!
-*
-*********************************************************************************/
-int iSeries_Scan_Bridge_Slot(HvBusNumber Bus, struct HvCallPci_BridgeInfo* BridgeInfo)
+/*
+ * This assumes that the node slot is always on the primary bus!
+ */
+static int iSeries_Scan_Bridge_Slot(HvBusNumber Bus,
+		struct HvCallPci_BridgeInfo *BridgeInfo)
 {
-	struct iSeries_Device_Node* DeviceNode;
+	struct iSeries_Device_Node *node;
 	HvSubBusNumber SubBus = BridgeInfo->subBusNumber;
-	u16       VendorId    = 0;
-	int       HvRc        = 0;
-	u8        Irq         = 0;
-	int       IdSel       = ISERIES_GET_DEVICE_FROM_SUBBUS(SubBus);
-	int       Function    = ISERIES_GET_FUNCTION_FROM_SUBBUS(SubBus);
-	HvAgentId AgentId     = ISERIES_PCI_AGENTID(IdSel, Function);
-	HvAgentId EADsIdSel   = ISERIES_PCI_AGENTID(IdSel, Function);
-	int       FirstSlotId = 0; 	
-
-	/**********************************************************/
-	/* iSeries_allocate_IRQ.: 0x18.00.12(0xA3)                */
-	/**********************************************************/
-  	Irq   = iSeries_allocate_IRQ(Bus, 0, AgentId);
-	iSeries_assign_IRQ(Irq, Bus, 0, AgentId);
-	PPCDBG(PPCDBG_BUSWALK,"PCI:- allocate and assign IRQ 0x%02X.%02X.%02X = 0x%02X\n",Bus, 0, AgentId, Irq );
+	u16 VendorId = 0;
+	int HvRc = 0;
+	u8 Irq = 0;
+	int IdSel = ISERIES_GET_DEVICE_FROM_SUBBUS(SubBus);
+	int Function = ISERIES_GET_FUNCTION_FROM_SUBBUS(SubBus);
+	HvAgentId EADsIdSel = ISERIES_PCI_AGENTID(IdSel, Function);
+
+	/* iSeries_allocate_IRQ.: 0x18.00.12(0xA3) */
+  	Irq = iSeries_allocate_IRQ(Bus, 0, EADsIdSel);
+	iSeries_assign_IRQ(Irq, Bus, 0, EADsIdSel);
+	PPCDBG(PPCDBG_BUSWALK,
+		"PCI:- allocate and assign IRQ 0x%02X.%02X.%02X = 0x%02X\n",
+		Bus, 0, EADsIdSel, Irq);
 
-	/****************************************************************************
+	/*
 	 * Connect all functions of any device found.  
-	 ****************************************************************************/
+	 */
   	for (IdSel = 1; IdSel <= BridgeInfo->maxAgents; ++IdSel) {
     		for (Function = 0; Function < 8; ++Function) {
-			AgentId = ISERIES_PCI_AGENTID(IdSel, Function);
-			HvRc = HvCallXm_connectBusUnit(Bus, SubBus, AgentId, Irq);
-			if( HvRc == 0) {
-				HvRc = HvCallPci_configLoad16(Bus, SubBus, AgentId, PCI_VENDOR_ID, &VendorId);
-				if( HvRc == 0) {
-					/**********************************************************/
-					/* FoundDevice: 0x18.28.10 = 0x12AE                       */
-					/**********************************************************/
-					PPCDBG(PPCDBG_BUSWALK,"PCI:- FoundDevice: 0x%02X.%02X.%02X = 0x%04X\n",
-					                                       Bus, SubBus, AgentId, VendorId);
-
-					HvRc = HvCallPci_configStore8(Bus, SubBus, AgentId, PCI_INTERRUPT_LINE, Irq);  
-					if( HvRc != 0) {
-						pci_Log_Error("PciCfgStore Irq Failed!",Bus,SubBus,AgentId,HvRc);
-					}
-
-					++DeviceCount;
-					DeviceNode = build_device_node(Bus, SubBus, EADsIdSel, Function);
-					DeviceNode->Vendor      = VendorId;
-					DeviceNode->Irq         = Irq;
-					DeviceNode->LogicalSlot = BridgeInfo->logicalSlotNumber;
-					PCIFR("Device(%4d): 0x%02X.%02X.%02X 0x%02X 0x%04X",
-					      DeviceCount,Bus, SubBus, AgentId,
-					      DeviceNode->LogicalSlot,DeviceNode->Vendor);
-
-					/***********************************************************
-					 * On the first device/function, assign irq to slot
-					 ***********************************************************/
-					if(Function == 0) { 
-						FirstSlotId = AgentId;
-						// AHT iSeries_assign_IRQ(Irq, Bus, SubBus, AgentId);
-    					}
-				}
-				else pci_Log_Error("Read Vendor",Bus,SubBus,AgentId,HvRc);
+			HvAgentId AgentId = ISERIES_PCI_AGENTID(IdSel, Function);
+			HvRc = HvCallXm_connectBusUnit(Bus, SubBus,
+					AgentId, Irq);
+			if (HvRc != 0) {
+				pci_Log_Error("Connect Bus Unit",
+					      Bus, SubBus, AgentId, HvRc);
+				continue;
+			}
+			printk("connected bus unit at bus %d subbus 0x%x agentid 0x%x (idsel=%d func=%d)\n",
+			       Bus, SubBus, AgentId, IdSel, Function);
+
+			HvRc = HvCallPci_configLoad16(Bus, SubBus, AgentId,
+						      PCI_VENDOR_ID, &VendorId);
+			if (HvRc != 0) {
+				pci_Log_Error("Read Vendor",
+					      Bus, SubBus, AgentId, HvRc);
+				continue;
 			}
-			else pci_Log_Error("Connect Bus Unit",Bus,SubBus, AgentId,HvRc);
+			printk("read vendor ID: %x\n", VendorId);
+
+			/* FoundDevice: 0x18.28.10 = 0x12AE */
+			PPCDBG(PPCDBG_BUSWALK,
+			       "PCI:- FoundDevice: 0x%02X.%02X.%02X = 0x%04X\n",
+			       Bus, SubBus, AgentId, VendorId);
+			HvRc = HvCallPci_configStore8(Bus, SubBus, AgentId,
+						      PCI_INTERRUPT_LINE, Irq);  
+			if (HvRc != 0)
+				pci_Log_Error("PciCfgStore Irq Failed!",
+					      Bus, SubBus, AgentId, HvRc);
+
+			++DeviceCount;
+			node = build_device_node(Bus, SubBus, EADsIdSel, Function);
+			node->Vendor = VendorId;
+			node->Irq = Irq;
+			node->LogicalSlot = BridgeInfo->logicalSlotNumber;
+
 		} /* for (Function = 0; Function < 8; ++Function) */
 	} /* for (IdSel = 1; IdSel <= MaxAgents; ++IdSel) */
 	return HvRc;
 }
-/************************************************************************/
-/* I/0 Memory copy MUST use mmio commands on iSeries                    */
-/* To do; For performance, include the hv call directly                 */
-/************************************************************************/
-void* iSeries_memset_io(void* dest, char c, size_t Count)
-{
-	u8    ByteValue     = c;
-	long  NumberOfBytes = Count;
-	char* IoBuffer      = dest;
-	while(NumberOfBytes > 0) {
-		iSeries_Write_Byte( ByteValue, (void*)IoBuffer );
+
+/*
+ * I/0 Memory copy MUST use mmio commands on iSeries
+ * To do; For performance, include the hv call directly
+ */
+void *iSeries_memset_io(void *dest, char c, size_t Count)
+{
+	u8 ByteValue = c;
+	long NumberOfBytes = Count;
+	char *IoBuffer = dest;
+
+	while (NumberOfBytes > 0) {
+		iSeries_Write_Byte(ByteValue, (void *)IoBuffer);
 		++IoBuffer;
 		-- NumberOfBytes;
 	}
 	return dest;
-}	
-void* iSeries_memcpy_toio(void *dest, void *source, size_t count)
+}
+
+void *iSeries_memcpy_toio(void *dest, void *source, size_t count)
 {
-	char *dst           = dest;
-	char *src           = source;
-	long  NumberOfBytes = count;
-	while(NumberOfBytes > 0) {
-		iSeries_Write_Byte(*src++, (void*)dst++);
+	char *dst = dest;
+	char *src = source;
+	long NumberOfBytes = count;
+
+	while (NumberOfBytes > 0) {
+		iSeries_Write_Byte(*src++, (void *)dst++);
 		-- NumberOfBytes;
 	}
 	return dest;
 }
-void* iSeries_memcpy_fromio(void *dest, void *source, size_t count)
+
+void *iSeries_memcpy_fromio(void *dest, void *source, size_t count)
 {
 	char *dst = dest;
 	char *src = source;
-	long  NumberOfBytes = count;
-	while(NumberOfBytes > 0) {
-		*dst++ = iSeries_Read_Byte( (void*)src++);
+	long NumberOfBytes = count;
+
+	while (NumberOfBytes > 0) {
+		*dst++ = iSeries_Read_Byte((void *)src++);
 		-- NumberOfBytes;
 	}
 	return dest;
 }
-/**********************************************************************************
+
+/*
  * Look down the chain to find the matching Device Device
- **********************************************************************************/
-struct iSeries_Device_Node* find_Device_Node(struct pci_dev* PciDev)
+ */
+static struct iSeries_Device_Node *find_Device_Node(int bus, int devfn)
 {
-	struct list_head* Device_Node_Ptr = iSeries_Global_Device_List.next;
-	int Bus   = PciDev->bus->number;
-	int DevFn = PciDev->devfn;
-	
-	while(Device_Node_Ptr != &iSeries_Global_Device_List) { 
-		struct iSeries_Device_Node* DevNode = (struct iSeries_Device_Node*)Device_Node_Ptr;
-		if(Bus == ISERIES_BUS(DevNode) && DevFn == DevNode->DevFn) {
-			return DevNode;
-		}
-		Device_Node_Ptr = Device_Node_Ptr->next;
+	struct list_head *pos;
+
+	list_for_each(pos, &iSeries_Global_Device_List) {
+		struct iSeries_Device_Node *node =
+			list_entry(pos, struct iSeries_Device_Node, Device_List);
+
+		if ((bus == ISERIES_BUS(node)) && (devfn == node->DevFn))
+			return node;
 	}
 	return NULL;
 }
-/******************************************************************/
-/* Returns the device node for the passed pci_dev                 */
-/* Sanity Check Node PciDev to passed pci_dev                     */
-/* If none is found, returns a NULL which the client must handle. */
-/******************************************************************/
-struct iSeries_Device_Node* get_Device_Node(struct pci_dev* PciDev)
-{
-	struct iSeries_Device_Node* Node;
-	Node = (struct iSeries_Device_Node*)PciDev->sysdata;
-	if(Node == NULL ) {
-		Node = find_Device_Node(PciDev);
-	}
-	else if(Node->PciDev != PciDev) { 
-		Node = find_Device_Node(PciDev);
+
+#if 0
+/*
+ * Returns the device node for the passed pci_dev
+ * Sanity Check Node PciDev to passed pci_dev
+ * If none is found, returns a NULL which the client must handle.
+ */
+static struct iSeries_Device_Node *get_Device_Node(struct pci_dev *pdev)
+{
+	struct iSeries_Device_Node *node;
+
+	node = pdev->sysdata;
+	if (node == NULL || node->PciDev != pdev)
+		node = find_Device_Node(pdev->bus->number, pdev->devfn);
+	return node;
+}
+#endif
+
+/*
+ * Config space read and write functions.
+ * For now at least, we look for the device node for the bus and devfn
+ * that we are asked to access.  It may be possible to translate the devfn
+ * to a subbus and deviceid more directly.
+ */
+static u64 hv_cfg_read_func[4]  = {
+	HvCallPciConfigLoad8, HvCallPciConfigLoad16,
+	HvCallPciConfigLoad32, HvCallPciConfigLoad32
+};
+
+static u64 hv_cfg_write_func[4] = {
+	HvCallPciConfigStore8, HvCallPciConfigStore16,
+	HvCallPciConfigStore32, HvCallPciConfigStore32
+};
+
+/*
+ * Read PCI config space
+ */
+static int iSeries_pci_read_config(struct pci_bus *bus, unsigned int devfn,
+		int offset, int size, u32 *val)
+{
+	struct iSeries_Device_Node *node = find_Device_Node(bus->number, devfn);
+	u64 fn;
+	struct HvCallPci_LoadReturn ret;
+
+	if (node == NULL)
+		return PCIBIOS_DEVICE_NOT_FOUND;
+
+	fn = hv_cfg_read_func[(size - 1) & 3];
+	HvCall3Ret16(fn, &ret, node->DsaAddr.DsaAddr, offset, 0);
+
+	if (ret.rc != 0) {
+		*val = ~0;
+		return PCIBIOS_DEVICE_NOT_FOUND;	/* or something */
 	}
-	return Node;
+
+	*val = ret.value;
+	return 0;
 }
-/**********************************************************************************
- *
- * Read PCI Config Space Code 
- *
- **********************************************************************************/
-/** BYTE  *************************************************************************/
-int iSeries_Node_read_config_byte(struct iSeries_Device_Node* DevNode, int Offset, u8* ReadValue)
-{
-	u8  ReadData; 
-	if(DevNode == NULL) { return 0x301; } 
-	++Pci_Cfg_Read_Count;
-	DevNode->ReturnCode = HvCallPci_configLoad8(ISERIES_BUS(DevNode),ISERIES_SUBBUS(DevNode),0x10,
-	                                                Offset,&ReadData);
-	if(Pci_Trace_Flag == 1) {
-		PCIFR("RCB: 0x%04X.%02X 0x%04X = 0x%02X",ISERIES_BUS(DevNode),DevNode->DevFn,Offset,ReadData);
-	}
-	if(DevNode->ReturnCode != 0 ) { 
-		printk("PCI: RCB: 0x%04X.%02X  Error: 0x%04X\n",ISERIES_BUS(DevNode),DevNode->DevFn,DevNode->ReturnCode);
-		PCIFR(      "RCB: 0x%04X.%02X  Error: 0x%04X",  ISERIES_BUS(DevNode),DevNode->DevFn,DevNode->ReturnCode);
-	}
-	*ReadValue = ReadData; 
- 	return DevNode->ReturnCode;
-}
-/** WORD  *************************************************************************/
-int iSeries_Node_read_config_word(struct iSeries_Device_Node* DevNode, int Offset, u16* ReadValue)
-{
-	u16  ReadData; 
-	if(DevNode == NULL) { return 0x301; } 
-	++Pci_Cfg_Read_Count;
-	DevNode->ReturnCode = HvCallPci_configLoad16(ISERIES_BUS(DevNode),ISERIES_SUBBUS(DevNode),0x10,
-	                                                Offset,&ReadData);
-	if(Pci_Trace_Flag == 1) {
-		PCIFR("RCW: 0x%04X.%02X 0x%04X = 0x%04X",ISERIES_BUS(DevNode),DevNode->DevFn,Offset,ReadData);
-	}
-	if(DevNode->ReturnCode != 0 ) { 
-		printk("PCI: RCW: 0x%04X.%02X  Error: 0x%04X\n",ISERIES_BUS(DevNode),DevNode->DevFn,DevNode->ReturnCode);
-		PCIFR(      "RCW: 0x%04X.%02X  Error: 0x%04X",  ISERIES_BUS(DevNode),DevNode->DevFn,DevNode->ReturnCode);
-
-	}
-	*ReadValue = ReadData; 
- 	return DevNode->ReturnCode;
-}
-/** DWORD *************************************************************************/
-int iSeries_Node_read_config_dword(struct iSeries_Device_Node* DevNode, int Offset, u32* ReadValue)
-{
- 	u32  ReadData; 
-	if(DevNode == NULL) { return 0x301; } 
-	++Pci_Cfg_Read_Count;
-	DevNode->ReturnCode = HvCallPci_configLoad32(ISERIES_BUS(DevNode),ISERIES_SUBBUS(DevNode),0x10,
-	                                                Offset,&ReadData);
-	if(Pci_Trace_Flag == 1) {
-		PCIFR("RCL: 0x%04X.%02X 0x%04X = 0x%08X",ISERIES_BUS(DevNode),DevNode->DevFn,Offset,ReadData);
-	}
-	if(DevNode->ReturnCode != 0 ) { 
-		printk("PCI: RCL: 0x%04X.%02X  Error: 0x%04X\n",ISERIES_BUS(DevNode),DevNode->DevFn,DevNode->ReturnCode);
-		PCIFR(      "RCL: 0x%04X.%02X  Error: 0x%04X",  ISERIES_BUS(DevNode),DevNode->DevFn,DevNode->ReturnCode);
-	}
-	*ReadValue = ReadData; 
- 	return DevNode->ReturnCode;
-}
-int iSeries_pci_read_config_byte(struct pci_dev* PciDev, int Offset, u8* ReadValue) { 
-	struct iSeries_Device_Node* DevNode = get_Device_Node(PciDev);
-	if(DevNode == NULL) return 0x0301;
-	return iSeries_Node_read_config_byte( DevNode ,Offset,ReadValue);
-}
-int iSeries_pci_read_config_word(struct pci_dev* PciDev, int Offset, u16* ReadValue) { 
-	struct iSeries_Device_Node* DevNode = get_Device_Node(PciDev);
-	if(DevNode == NULL) return 0x0301;
-	return iSeries_Node_read_config_word( DevNode ,Offset,ReadValue );
-}
-int iSeries_pci_read_config_dword(struct pci_dev* PciDev, int Offset, u32* ReadValue) { 
-	struct iSeries_Device_Node* DevNode = get_Device_Node(PciDev);
-	if(DevNode == NULL) return 0x0301;
-	return iSeries_Node_read_config_dword(DevNode ,Offset,ReadValue  );
-}
-/**********************************************************************************/
-/*                                                                                */
-/* Write PCI Config Space                                                         */
-/*                                                                                */
-/** BYTE  *************************************************************************/
-int iSeries_Node_write_config_byte(struct iSeries_Device_Node* DevNode, int Offset, u8 WriteData)
-{
-	++Pci_Cfg_Write_Count;
-	DevNode->ReturnCode = HvCallPci_configStore8(ISERIES_BUS(DevNode),ISERIES_SUBBUS(DevNode),0x10,
-	                                                  Offset,WriteData);
-	if(Pci_Trace_Flag == 1) {
-		PCIFR("WCB: 0x%04X.%02X 0x%04X = 0x%02X",ISERIES_BUS(DevNode),DevNode->DevFn,Offset,WriteData);
-	}
-	if(DevNode->ReturnCode != 0 ) { 
-		printk("PCI: WCB: 0x%04X.%02X  Error: 0x%04X\n",ISERIES_BUS(DevNode),DevNode->DevFn,DevNode->ReturnCode);
-		PCIFR(      "WCB: 0x%04X.%02X  Error: 0x%04X",  ISERIES_BUS(DevNode),DevNode->DevFn,DevNode->ReturnCode);
-	}
- 	return DevNode->ReturnCode;
-}
-/** WORD  *************************************************************************/
-int iSeries_Node_write_config_word(struct iSeries_Device_Node* DevNode, int Offset, u16 WriteData)
-{
-	++Pci_Cfg_Write_Count;
-	DevNode->ReturnCode = HvCallPci_configStore16(ISERIES_BUS(DevNode),ISERIES_SUBBUS(DevNode),0x10,
-	                                                  Offset,WriteData);
-	if(Pci_Trace_Flag == 1) {
-		PCIFR("WCW: 0x%04X.%02X 0x%04X = 0x%04X",ISERIES_BUS(DevNode),DevNode->DevFn,Offset,WriteData);
-	}
-	if(DevNode->ReturnCode != 0 ) { 
-		printk("PCI: WCW: 0x%04X.%02X  Error: 0x%04X\n",ISERIES_BUS(DevNode),DevNode->DevFn,DevNode->ReturnCode);
-		PCIFR(      "WCW: 0x%04X.%02X  Error: 0x%04X",  ISERIES_BUS(DevNode),DevNode->DevFn,DevNode->ReturnCode);
-	}
- 	return DevNode->ReturnCode;
-}
-/** DWORD *************************************************************************/
-int iSeries_Node_write_config_dword(struct iSeries_Device_Node* DevNode, int Offset, u32 WriteData)
-{
-	++Pci_Cfg_Write_Count;
-	DevNode->ReturnCode = HvCallPci_configStore32(ISERIES_BUS(DevNode),ISERIES_SUBBUS(DevNode),0x10,
-	                                                  Offset,WriteData);
-	if(Pci_Trace_Flag == 1) {
-		PCIFR("WCL: 0x%04X.%02X 0x%04X = 0x%08X",ISERIES_BUS(DevNode),DevNode->DevFn,Offset,WriteData);
-	}
-	if(DevNode->ReturnCode != 0 ) { 
-		printk("PCI: WCL: 0x%04X.%02X  Error: 0x%04X\n",ISERIES_BUS(DevNode),DevNode->DevFn,DevNode->ReturnCode);
-		PCIFR(      "WCL: 0x%04X.%02X  Error: 0x%04X",  ISERIES_BUS(DevNode),DevNode->DevFn,DevNode->ReturnCode);
-	}
-	return DevNode->ReturnCode;
-}
-int iSeries_pci_write_config_byte( struct pci_dev* PciDev,int Offset, u8 WriteValue)
-{
-	struct iSeries_Device_Node* DevNode = get_Device_Node(PciDev);
-	if(DevNode == NULL) return 0x0301;
-	return iSeries_Node_write_config_byte( DevNode,Offset,WriteValue);
-}
-int iSeries_pci_write_config_word( struct pci_dev* PciDev,int Offset,u16 WriteValue)
-{
-	struct iSeries_Device_Node* DevNode = get_Device_Node(PciDev);
-	if(DevNode == NULL) return 0x0301;
-	return iSeries_Node_write_config_word( DevNode,Offset,WriteValue);
-}
-int iSeries_pci_write_config_dword(struct pci_dev* PciDev,int Offset,u32 WriteValue)
-{
-	struct iSeries_Device_Node* DevNode = get_Device_Node(PciDev);
-	if(DevNode == NULL) return 0x0301;
-	return iSeries_Node_write_config_dword(DevNode,Offset,WriteValue);
-}
-
-/************************************************************************/
-/* Branch Table                                                         */
-/************************************************************************/
-struct pci_ops iSeries_pci_ops = {
-	iSeries_pci_read_config_byte,
-	iSeries_pci_read_config_word,
-	iSeries_pci_read_config_dword,
-	iSeries_pci_write_config_byte,
-	iSeries_pci_write_config_word,
-	iSeries_pci_write_config_dword 
+
+/*
+ * Write PCI config space
+ */
+
+static int iSeries_pci_write_config(struct pci_bus *bus, unsigned int devfn,
+		int offset, int size, u32 val)
+{
+	struct iSeries_Device_Node *node = find_Device_Node(bus->number, devfn);
+	u64 fn;
+	u64 ret;
+
+	if (node == NULL)
+		return PCIBIOS_DEVICE_NOT_FOUND;
+
+	fn = hv_cfg_write_func[(size - 1) & 3];
+	ret = HvCall4(fn, node->DsaAddr.DsaAddr, offset, val, 0);
+
+	if (ret != 0)
+		return PCIBIOS_DEVICE_NOT_FOUND;
+
+	return 0;
+}
+
+static struct pci_ops iSeries_pci_ops = {
+	.read = iSeries_pci_read_config,
+	.write = iSeries_pci_write_config
 };
 
-/************************************************************************
+/*
  * Check Return Code
  * -> On Failure, print and log information.
  *    Increment Retry Count, if exceeds max, panic partition.
  * -> If in retry, print and log success 
- ************************************************************************
+ *
  * PCI: Device 23.90 ReadL I/O Error( 0): 0x1234
  * PCI: Device 23.90 ReadL Retry( 1)
  * PCI: Device 23.90 ReadL Retry Successful(1)
- ************************************************************************/
-int  CheckReturnCode(char* TextHdr, struct iSeries_Device_Node* DevNode, u64 RtnCode)
+ */
+static int CheckReturnCode(char *TextHdr, struct iSeries_Device_Node *DevNode,
+		u64 ret)
 {
-	if(RtnCode != 0)  {
+	if (ret != 0)  {
 		++Pci_Error_Count;
 		++DevNode->IoRetry;
-		PCIFR(      "%s: Device 0x%04X:%02X  I/O Error(%2d): 0x%04X",
-			    TextHdr,ISERIES_BUS(DevNode),DevNode->DevFn,DevNode->IoRetry,(int)RtnCode);
 		printk("PCI: %s: Device 0x%04X:%02X  I/O Error(%2d): 0x%04X\n",
-		            TextHdr,ISERIES_BUS(DevNode),DevNode->DevFn,DevNode->IoRetry,(int)RtnCode);
-		/*******************************************************/
-		/* Bump the retry and check for retry count exceeded.  */
-		/* If, Exceeded, panic the system.                     */           
-		/*******************************************************/
-		if(DevNode->IoRetry > Pci_Retry_Max && Pci_Error_Flag > 0 ) {
+				TextHdr, DevNode->DsaAddr.Dsa.busNumber, DevNode->DevFn,
+				DevNode->IoRetry, (int)ret);
+		/*
+		 * Bump the retry and check for retry count exceeded.
+		 * If, Exceeded, panic the system.
+		 */
+		if ((DevNode->IoRetry > Pci_Retry_Max) &&
+				(Pci_Error_Flag > 0)) {
 			mf_displaySrc(0xB6000103);
 			panic_timeout = 0; 
-			panic("PCI: Hardware I/O Error, SRC B6000103, Automatic Reboot Disabled.\n");
+			panic("PCI: Hardware I/O Error, SRC B6000103, "
+					"Automatic Reboot Disabled.\n");
 		}
 		return -1;	/* Retry Try */
 	}
-	/********************************************************************
-	* If retry was in progress, log success and rest retry count        *
-	*********************************************************************/
-	else if(DevNode->IoRetry > 0) {
+	/* If retry was in progress, log success and rest retry count */
+	if (DevNode->IoRetry > 0) {
 		PCIFR("%s: Device 0x%04X:%02X Retry Successful(%2d).",
-		      TextHdr,ISERIES_BUS(DevNode),DevNode->DevFn,DevNode->IoRetry);
+				TextHdr, DevNode->DsaAddr.Dsa.busNumber, DevNode->DevFn,
+				DevNode->IoRetry);
 		DevNode->IoRetry = 0;
-		return 0; 
 	}
 	return 0; 
 }
-/************************************************************************/
-/* Translate the I/O Address into a device node, bar, and bar offset.   */
-/* Note: Make sure the passed variable end up on the stack to avoid     */
-/* the exposure of being device global.                                 */
-/************************************************************************/
-static inline struct iSeries_Device_Node* xlateIoMmAddress(void* IoAddress,
-							    union HvDsaMap* DsaPtr,
-							   u64* BarOffsetPtr) {
-
-	unsigned long BaseIoAddr = (unsigned long)IoAddress-iSeries_Base_Io_Memory;
-	long          TableIndex = BaseIoAddr/iSeries_IoMmTable_Entry_Size;
-	struct iSeries_Device_Node* DevNode = *(iSeries_IoMmTable +TableIndex);
-	if(DevNode != NULL) {
-		DsaPtr->DsaAddr       = ISERIES_DSA(DevNode);
-		DsaPtr->Dsa.barNumber = *(iSeries_IoBarTable+TableIndex);
-		*BarOffsetPtr         = BaseIoAddr % iSeries_IoMmTable_Entry_Size;
-	}
-	else {
+
+/*
+ * Translate the I/O Address into a device node, bar, and bar offset.
+ * Note: Make sure the passed variable end up on the stack to avoid
+ * the exposure of being device global.
+ */
+static inline struct iSeries_Device_Node *xlateIoMmAddress(void *IoAddress,
+		 u64 *dsaptr, u64 *BarOffsetPtr)
+{
+	unsigned long BaseIoAddr;
+	unsigned long TableIndex;
+	struct iSeries_Device_Node *DevNode;
+
+	if (((unsigned long)IoAddress < iSeries_Base_Io_Memory) ||
+			((unsigned long)IoAddress >= iSeries_Max_Io_Memory))
+		return NULL;
+	BaseIoAddr = (unsigned long)IoAddress - iSeries_Base_Io_Memory;
+	TableIndex = BaseIoAddr / iSeries_IoMmTable_Entry_Size;
+	DevNode = iSeries_IoMmTable[TableIndex];
+
+	if (DevNode != NULL) {
+		int barnum = iSeries_IoBarTable[TableIndex];
+		*dsaptr = DevNode->DsaAddr.DsaAddr | (barnum << 24);
+		*BarOffsetPtr = BaseIoAddr % iSeries_IoMmTable_Entry_Size;
+	} else
 		panic("PCI: Invalid PCI IoAddress detected!\n");
-	}
 	return DevNode;
 }
 
-/************************************************************************/
-/* Read MM I/O Instructions for the iSeries                             */
-/* On MM I/O error, all ones are returned and iSeries_pci_IoError is cal*/
-/* else, data is returned in big Endian format.                         */
-/************************************************************************/
-/* iSeries_Read_Byte = Read Byte  ( 8 bit)                              */
-/* iSeries_Read_Word = Read Word  (16 bit)                              */
-/* iSeries_Read_Long = Read Long  (32 bit)                              */
-/************************************************************************/
-u8  iSeries_Read_Byte(void* IoAddress)
-{
-	u64    BarOffset;
-	union  HvDsaMap DsaData;
-	struct HvCallPci_LoadReturn Return;
-	struct iSeries_Device_Node* DevNode = xlateIoMmAddress(IoAddress,&DsaData,&BarOffset);
-
+/*
+ * Read MM I/O Instructions for the iSeries
+ * On MM I/O error, all ones are returned and iSeries_pci_IoError is cal
+ * else, data is returned in big Endian format.
+ *
+ * iSeries_Read_Byte = Read Byte  ( 8 bit)
+ * iSeries_Read_Word = Read Word  (16 bit)
+ * iSeries_Read_Long = Read Long  (32 bit)
+ */
+u8 iSeries_Read_Byte(void *IoAddress)
+{
+	u64 BarOffset;
+	u64 dsa;
+	struct HvCallPci_LoadReturn ret;
+	struct iSeries_Device_Node *DevNode =
+		xlateIoMmAddress(IoAddress, &dsa, &BarOffset);
+
+	if (DevNode == NULL) {
+		static unsigned long last_jiffies;
+		static int num_printed;
+
+		if ((jiffies - last_jiffies) > 60 * HZ) {
+			last_jiffies = jiffies;
+			num_printed = 0;
+		}
+		if (num_printed++ < 10)
+			printk(KERN_ERR "iSeries_Read_Byte: invalid access at IO address %p\n", IoAddress);
+		return 0xff;
+	}
 	do {
 		++Pci_Io_Read_Count;
-		HvCall3Ret16(HvCallPciBarLoad8, &Return, DsaData.DsaAddr,BarOffset, 0);
-	} while (CheckReturnCode("RDB",DevNode, Return.rc) != 0);
+		HvCall3Ret16(HvCallPciBarLoad8, &ret, dsa, BarOffset, 0);
+	} while (CheckReturnCode("RDB", DevNode, ret.rc) != 0);
 
-	if(Pci_Trace_Flag == 1)	PCIFR("RDB: IoAddress 0x%p = 0x%02X",IoAddress, (u8)Return.value); 
-	return (u8)Return.value;
+	return (u8)ret.value;
 }
-u16  iSeries_Read_Word(void* IoAddress)
+
+u16 iSeries_Read_Word(void *IoAddress)
 {
-	u64    BarOffset;
-	union  HvDsaMap DsaData;
-	struct HvCallPci_LoadReturn Return;
-	struct iSeries_Device_Node* DevNode = xlateIoMmAddress(IoAddress,&DsaData,&BarOffset);
+	u64 BarOffset;
+	u64 dsa;
+	struct HvCallPci_LoadReturn ret;
+	struct iSeries_Device_Node *DevNode =
+		xlateIoMmAddress(IoAddress, &dsa, &BarOffset);
+
+	if (DevNode == NULL) {
+		static unsigned long last_jiffies;
+		static int num_printed;
 
+		if ((jiffies - last_jiffies) > 60 * HZ) {
+			last_jiffies = jiffies;
+			num_printed = 0;
+		}
+		if (num_printed++ < 10)
+			printk(KERN_ERR "iSeries_Read_Word: invalid access at IO address %p\n", IoAddress);
+		return 0xffff;
+	}
 	do {
 		++Pci_Io_Read_Count;
-		HvCall3Ret16(HvCallPciBarLoad16,&Return, DsaData.DsaAddr,BarOffset, 0);
-	} while (CheckReturnCode("RDW",DevNode, Return.rc) != 0);
+		HvCall3Ret16(HvCallPciBarLoad16, &ret, dsa,
+				BarOffset, 0);
+	} while (CheckReturnCode("RDW", DevNode, ret.rc) != 0);
 
-	if(Pci_Trace_Flag == 1) PCIFR("RDW: IoAddress 0x%p = 0x%04X",IoAddress, swab16((u16)Return.value));
-	return swab16((u16)Return.value);
+	return swab16((u16)ret.value);
 }
-u32  iSeries_Read_Long(void* IoAddress)
+
+u32 iSeries_Read_Long(void *IoAddress)
 {
-	u64    BarOffset;
-	union  HvDsaMap DsaData;
-	struct HvCallPci_LoadReturn Return;
-	struct iSeries_Device_Node* DevNode = xlateIoMmAddress(IoAddress,&DsaData,&BarOffset);
+	u64 BarOffset;
+	u64 dsa;
+	struct HvCallPci_LoadReturn ret;
+	struct iSeries_Device_Node *DevNode =
+		xlateIoMmAddress(IoAddress, &dsa, &BarOffset);
+
+	if (DevNode == NULL) {
+		static unsigned long last_jiffies;
+		static int num_printed;
 
+		if ((jiffies - last_jiffies) > 60 * HZ) {
+			last_jiffies = jiffies;
+			num_printed = 0;
+		}
+		if (num_printed++ < 10)
+			printk(KERN_ERR "iSeries_Read_Long: invalid access at IO address %p\n", IoAddress);
+		return 0xffffffff;
+	}
 	do {
 		++Pci_Io_Read_Count;
-		HvCall3Ret16(HvCallPciBarLoad32,&Return, DsaData.DsaAddr,BarOffset, 0);
-	} while (CheckReturnCode("RDL",DevNode, Return.rc) != 0);
+		HvCall3Ret16(HvCallPciBarLoad32, &ret, dsa,
+				BarOffset, 0);
+	} while (CheckReturnCode("RDL", DevNode, ret.rc) != 0);
 
-	if(Pci_Trace_Flag == 1) PCIFR("RDL: IoAddress 0x%p = 0x%04X",IoAddress, swab32((u32)Return.value));
-	return swab32((u32)Return.value);
+	return swab32((u32)ret.value);
 }
-/************************************************************************/
-/* Write MM I/O Instructions for the iSeries                            */
-/************************************************************************/
-/* iSeries_Write_Byte = Write Byte (8 bit)                              */
-/* iSeries_Write_Word = Write Word(16 bit)                              */
-/* iSeries_Write_Long = Write Long(32 bit)                              */
-/************************************************************************/
-void iSeries_Write_Byte(u8 Data, void* IoAddress)
-{
-	u64    BarOffset;
-	union  HvDsaMap DsaData;
-	struct HvCallPci_LoadReturn Return;
-	struct iSeries_Device_Node* DevNode = xlateIoMmAddress(IoAddress,&DsaData,&BarOffset);
 
+/*
+ * Write MM I/O Instructions for the iSeries
+ *
+ * iSeries_Write_Byte = Write Byte (8 bit)
+ * iSeries_Write_Word = Write Word(16 bit)
+ * iSeries_Write_Long = Write Long(32 bit)
+ */
+void iSeries_Write_Byte(u8 data, void *IoAddress)
+{
+	u64 BarOffset;
+	u64 dsa;
+	u64 rc;
+	struct iSeries_Device_Node *DevNode =
+		xlateIoMmAddress(IoAddress, &dsa, &BarOffset);
+
+	if (DevNode == NULL) {
+		static unsigned long last_jiffies;
+		static int num_printed;
+
+		if ((jiffies - last_jiffies) > 60 * HZ) {
+			last_jiffies = jiffies;
+			num_printed = 0;
+		}
+		if (num_printed++ < 10)
+			printk(KERN_ERR "iSeries_Write_Byte: invalid access at IO address %p\n", IoAddress);
+		return;
+	}
 	do {
 		++Pci_Io_Write_Count;
-		Return.rc = HvCall4(HvCallPciBarStore8, DsaData.DsaAddr,BarOffset, Data, 0);
-	} while (CheckReturnCode("WWB",DevNode, Return.rc) != 0);
-	if(Pci_Trace_Flag == 1) PCIFR("WWB: IoAddress 0x%p = 0x%02X",IoAddress,Data);
-}
-void iSeries_Write_Word(u16 Data, void* IoAddress)
-{
-	u64    BarOffset;
-	union  HvDsaMap DsaData;
-	struct HvCallPci_LoadReturn Return;
-	struct iSeries_Device_Node* DevNode = xlateIoMmAddress(IoAddress,&DsaData,&BarOffset);
+		rc = HvCall4(HvCallPciBarStore8, dsa, BarOffset, data, 0);
+	} while (CheckReturnCode("WWB", DevNode, rc) != 0);
+}
+
+void iSeries_Write_Word(u16 data, void *IoAddress)
+{
+	u64 BarOffset;
+	u64 dsa;
+	u64 rc;
+	struct iSeries_Device_Node *DevNode =
+		xlateIoMmAddress(IoAddress, &dsa, &BarOffset);
 
+	if (DevNode == NULL) {
+		static unsigned long last_jiffies;
+		static int num_printed;
+
+		if ((jiffies - last_jiffies) > 60 * HZ) {
+			last_jiffies = jiffies;
+			num_printed = 0;
+		}
+		if (num_printed++ < 10)
+			printk(KERN_ERR "iSeries_Write_Word: invalid access at IO address %p\n", IoAddress);
+		return;
+	}
 	do {
 		++Pci_Io_Write_Count;
-		Return.rc = HvCall4(HvCallPciBarStore16,DsaData.DsaAddr,BarOffset, swab16(Data), 0);
-	} while (CheckReturnCode("WWW",DevNode, Return.rc) != 0);
-	if(Pci_Trace_Flag == 1) PCIFR("WWW: IoAddress 0x%p = 0x%04X",IoAddress,Data);
-}
-void iSeries_Write_Long(u32 Data, void* IoAddress)
-{
-	u64    BarOffset;
-	union  HvDsaMap DsaData;
-	struct HvCallPci_LoadReturn Return;
-	struct iSeries_Device_Node* DevNode = xlateIoMmAddress(IoAddress,&DsaData,&BarOffset);
+		rc = HvCall4(HvCallPciBarStore16, dsa, BarOffset, swab16(data), 0);
+	} while (CheckReturnCode("WWW", DevNode, rc) != 0);
+}
+
+void iSeries_Write_Long(u32 data, void *IoAddress)
+{
+	u64 BarOffset;
+	u64 dsa;
+	u64 rc;
+	struct iSeries_Device_Node *DevNode =
+		xlateIoMmAddress(IoAddress, &dsa, &BarOffset);
+
+	if (DevNode == NULL) {
+		static unsigned long last_jiffies;
+		static int num_printed;
 
+		if ((jiffies - last_jiffies) > 60 * HZ) {
+			last_jiffies = jiffies;
+			num_printed = 0;
+		}
+		if (num_printed++ < 10)
+			printk(KERN_ERR "iSeries_Write_Long: invalid access at IO address %p\n", IoAddress);
+		return;
+	}
 	do {
 		++Pci_Io_Write_Count;
-		Return.rc = HvCall4(HvCallPciBarStore32,DsaData.DsaAddr,BarOffset, swab32(Data), 0);
-	} while (CheckReturnCode("WWL",DevNode, Return.rc) != 0);
-	if(Pci_Trace_Flag == 1) PCIFR("WWL: IoAddress 0x%p = 0x%08X",IoAddress, Data);
+		rc = HvCall4(HvCallPciBarStore32, dsa, BarOffset, swab32(data), 0);
+	} while (CheckReturnCode("WWL", DevNode, rc) != 0);
+}
+
+void pcibios_name_device(struct pci_dev *dev)
+{
 }
diff -Nru a/arch/ppc64/kernel/iSeries_pci_reset.c b/arch/ppc64/kernel/iSeries_pci_reset.c
--- a/arch/ppc64/kernel/iSeries_pci_reset.c	Tue Feb  3 19:45:37 2004
+++ b/arch/ppc64/kernel/iSeries_pci_reset.c	Tue Feb  3 19:45:37 2004
@@ -1,3 +1,4 @@
+#define PCIFR(...)
 /************************************************************************/
 /* File iSeries_pci_reset.c created by Allan Trautman on Mar 21 2001.   */
 /************************************************************************/
@@ -35,53 +36,67 @@
 #include <asm/iSeries/HvCallPci.h>
 #include <asm/iSeries/HvTypes.h>
 #include <asm/iSeries/mf.h>
-#include <asm/flight_recorder.h>
 #include <asm/pci.h>
 
 #include <asm/iSeries/iSeries_pci.h>
 #include "pci.h"
 
-/************************************************************************/
-/* Interface to toggle the reset line                                   */
-/* Time is in .1 seconds, need for seconds.                             */
-/************************************************************************/
-int  iSeries_Device_ToggleReset(struct pci_dev* PciDev, int AssertTime, int DelayTime)
+/*
+ * Interface to toggle the reset line
+ * Time is in .1 seconds, need for seconds.
+ */
+int iSeries_Device_ToggleReset(struct pci_dev *PciDev, int AssertTime,
+		int DelayTime)
 {
 	unsigned long AssertDelay, WaitDelay;
-	struct iSeries_Device_Node* DeviceNode = (struct iSeries_Device_Node*)PciDev->sysdata;
+	struct iSeries_Device_Node *DeviceNode =
+		(struct iSeries_Device_Node *)PciDev->sysdata;
+
  	if (DeviceNode == NULL) { 
-		printk("PCI: Pci Reset Failed, Device Node not found for pci_dev %p\n",PciDev);
+		printk("PCI: Pci Reset Failed, Device Node not found for pci_dev %p\n",
+				PciDev);
 		return -1;
 	}
-	/********************************************************************
+	/*
 	 * Set defaults, Assert is .5 second, Wait is 3 seconds.
-	 ********************************************************************/
-	if (AssertTime == 0) AssertDelay = ( 5 * HZ)/10;
-	else                 AssertDelay = (AssertTime*HZ)/10;
-	if (WaitDelay == 0)  WaitDelay   = (30 * HZ)/10;
-	else                 WaitDelay   = (DelayTime* HZ)/10;
+	 */
+	if (AssertTime == 0)
+		AssertDelay = (5 * HZ) / 10;
+	else
+		AssertDelay = (AssertTime * HZ) / 10;
+	if (WaitDelay == 0)
+		WaitDelay = (30 * HZ) / 10;
+	else
+		WaitDelay = (DelayTime * HZ) / 10;
 
-	/********************************************************************
+	/*
 	 * Assert reset
-	 ********************************************************************/
-	DeviceNode->ReturnCode = HvCallPci_setSlotReset(ISERIES_BUS(DeviceNode),0x00,DeviceNode->AgentId,1);
+	 */
+	DeviceNode->ReturnCode = HvCallPci_setSlotReset(ISERIES_BUS(DeviceNode),
+			0x00, DeviceNode->AgentId, 1);
 	if (DeviceNode->ReturnCode == 0) {
 		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(AssertDelay);       /* Sleep for the time     */
-		DeviceNode->ReturnCode = HvCallPci_setSlotReset(ISERIES_BUS(DeviceNode),0x00,DeviceNode->AgentId, 0);
+		schedule_timeout(AssertDelay);       /* Sleep for the time */
+		DeviceNode->ReturnCode =
+			HvCallPci_setSlotReset(ISERIES_BUS(DeviceNode),
+					0x00, DeviceNode->AgentId, 0);
 
-		/***************************************************************
+		/*
    		 * Wait for device to reset
-		 ***************************************************************/
+		 */
 		set_current_state(TASK_UNINTERRUPTIBLE);  
 		schedule_timeout(WaitDelay);
 	}
-	if (DeviceNode->ReturnCode == 0) {
-		PCIFR("Slot 0x%04X.%02 Reset\n",ISERIES_BUS(DeviceNode),DeviceNode->AgentId );
-	} 
+	if (DeviceNode->ReturnCode == 0)
+		PCIFR("Slot 0x%04X.%02 Reset\n", ISERIES_BUS(DeviceNode),
+				DeviceNode->AgentId);
 	else {
-		printk("PCI: Slot 0x%04X.%02X Reset Failed, RCode: %04X\n",ISERIES_BUS(DeviceNode),DeviceNode->AgentId,DeviceNode->ReturnCode);
-		PCIFR(      "Slot 0x%04X.%02X Reset Failed, RCode: %04X\n",ISERIES_BUS(DeviceNode),DeviceNode->AgentId,DeviceNode->ReturnCode);
+		printk("PCI: Slot 0x%04X.%02X Reset Failed, RCode: %04X\n",
+				ISERIES_BUS(DeviceNode), DeviceNode->AgentId,
+				DeviceNode->ReturnCode);
+		PCIFR("Slot 0x%04X.%02X Reset Failed, RCode: %04X\n",
+				ISERIES_BUS(DeviceNode), DeviceNode->AgentId,
+				DeviceNode->ReturnCode);
 	}
 	return DeviceNode->ReturnCode;
 }
diff -Nru a/arch/ppc64/kernel/iSeries_proc.c b/arch/ppc64/kernel/iSeries_proc.c
--- a/arch/ppc64/kernel/iSeries_proc.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc64/kernel/iSeries_proc.c	Tue Feb  3 19:45:17 2004
@@ -16,30 +16,22 @@
   * along with this program; if not, write to the Free Software
   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
   */
-
-
-/* Change Activity: */
-/* End Change Activity */
-
 #include <linux/proc_fs.h>
 #include <linux/spinlock.h>
-#ifndef _ISERIES_PROC_H
+#include <linux/init.h>
 #include <asm/iSeries/iSeries_proc.h>
-#endif
 
-
-static struct proc_dir_entry * iSeries_proc_root = NULL;
-static int iSeries_proc_initializationDone = 0;
+static struct proc_dir_entry *iSeries_proc_root;
+static int iSeries_proc_initializationDone;
 static spinlock_t iSeries_proc_lock;
 
-struct iSeries_proc_registration
-{
+struct iSeries_proc_registration {
 	struct iSeries_proc_registration *next;
 	iSeriesProcFunction functionMember;
 };
 
-
 struct iSeries_proc_registration preallocated[16];
+
 #define MYQUEUETYPE(T) struct MYQueue##T
 #define MYQUEUE(T) \
 MYQUEUETYPE(T) \
@@ -69,74 +61,71 @@
 	if ((q)->tail == NULL) \
 		(q)->head = NULL; \
 } while(0)
+
 MYQUEUE(iSeries_proc_registration);
 typedef MYQUEUETYPE(iSeries_proc_registration) aQueue;
 
-
-aQueue iSeries_free;
-aQueue iSeries_queued;
+static aQueue iSeries_free;
+static aQueue iSeries_queued;
 
 void iSeries_proc_early_init(void)
 {
 	int i = 0;
 	unsigned long flags;
+
 	iSeries_proc_initializationDone = 0;
 	spin_lock_init(&iSeries_proc_lock);
 	MYQUEUECTOR(&iSeries_free);
 	MYQUEUECTOR(&iSeries_queued);
 
 	spin_lock_irqsave(&iSeries_proc_lock, flags);
-	for (i = 0; i < 16; ++i) {
-		MYQUEUEENQ(&iSeries_free, preallocated+i);
-	}
+	for (i = 0; i < 16; ++i)
+		MYQUEUEENQ(&iSeries_free, preallocated + i);
 	spin_unlock_irqrestore(&iSeries_proc_lock, flags);
 }
 
-void iSeries_proc_create(void)
+static int iSeries_proc_create(void)
 {
 	unsigned long flags;
-	struct iSeries_proc_registration *reg = NULL;
-	spin_lock_irqsave(&iSeries_proc_lock, flags);
+	struct iSeries_proc_registration *reg;
+
 	printk("iSeries_proc: Creating /proc/iSeries\n");
 
+	spin_lock_irqsave(&iSeries_proc_lock, flags);
 	iSeries_proc_root = proc_mkdir("iSeries", 0);
-	if (!iSeries_proc_root) return;
+	if (!iSeries_proc_root)
+		goto out;
 
 	MYQUEUEDEQ(&iSeries_queued, reg);
-
 	while (reg != NULL) {
 		(*(reg->functionMember))(iSeries_proc_root);
-
 		MYQUEUEDEQ(&iSeries_queued, reg);
 	}
 
 	iSeries_proc_initializationDone = 1;
+out:
 	spin_unlock_irqrestore(&iSeries_proc_lock, flags);
+	return 0;
 }
 
+arch_initcall(iSeries_proc_create);
+
 void iSeries_proc_callback(iSeriesProcFunction initFunction)
 {
 	unsigned long flags;
-	spin_lock_irqsave(&iSeries_proc_lock, flags);
 
-	if (iSeries_proc_initializationDone) {
+	spin_lock_irqsave(&iSeries_proc_lock, flags);
+	if (iSeries_proc_initializationDone)
 		(*initFunction)(iSeries_proc_root);
-	} else {
+	else {
 		struct iSeries_proc_registration *reg = NULL;
 
 		MYQUEUEDEQ(&iSeries_free, reg);
-
 		if (reg != NULL) {
-			/* printk("Registering %p in reg %p\n", initFunction, reg); */
 			reg->functionMember = initFunction;
-
 			MYQUEUEENQ(&iSeries_queued, reg);
-		} else {
+		} else
 			printk("Couldn't get a queue entry\n");
-		}
 	}
-
 	spin_unlock_irqrestore(&iSeries_proc_lock, flags);
 }
-
-
diff -Nru a/arch/ppc64/kernel/iSeries_setup.c b/arch/ppc64/kernel/iSeries_setup.c
--- a/arch/ppc64/kernel/iSeries_setup.c	Tue Feb  3 19:45:34 2004
+++ b/arch/ppc64/kernel/iSeries_setup.c	Tue Feb  3 19:45:34 2004
@@ -25,6 +25,8 @@
 #include <linux/bootmem.h>
 #include <linux/initrd.h>
 #include <linux/seq_file.h>
+#include <linux/kdev_t.h>
+#include <linux/major.h>
 #include <linux/root_dev.h>
 
 #include <asm/processor.h>
@@ -53,34 +55,35 @@
 #include <asm/iSeries/mf.h>
 
 /* Function Prototypes */
-
 extern void abort(void);
-#ifdef CONFIG_PPC_ISERIES
-static void build_iSeries_Memory_Map( void );
-static void setup_iSeries_cache_sizes( void );
-static void iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr);
-#endif
-void build_valid_hpte( unsigned long vsid, unsigned long ea, unsigned long pa,
-		       pte_t * ptep, unsigned hpteflags, unsigned bolted );
 extern void ppcdbg_initialize(void);
 extern void iSeries_pcibios_init(void);
+extern void tce_init_iSeries(void);
+
+static void build_iSeries_Memory_Map(void);
+static void setup_iSeries_cache_sizes(void);
+static void iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr);
+void build_valid_hpte(unsigned long vsid, unsigned long ea, unsigned long pa,
+		pte_t *ptep, unsigned hpteflags, unsigned bolted);
 static void iSeries_setup_dprofile(void);
+void iSeries_setup_arch(void);
 
 /* Global Variables */
+static unsigned long procFreqHz;
+static unsigned long procFreqMhz;
+static unsigned long procFreqMhzHundreths;
+
+static unsigned long tbFreqHz;
+static unsigned long tbFreqMhz;
+static unsigned long tbFreqMhzHundreths;
 
-static unsigned long procFreqHz = 0;
-static unsigned long procFreqMhz = 0;
-static unsigned long procFreqMhzHundreths = 0;
-
-static unsigned long tbFreqHz = 0;
-static unsigned long tbFreqMhz = 0;
-static unsigned long tbFreqMhzHundreths = 0;
-
-unsigned long dprof_shift = 0;
-unsigned long dprof_len = 0;
-unsigned int * dprof_buffer = NULL;
+unsigned long dprof_shift;
+unsigned long dprof_len;
+unsigned int *dprof_buffer;
 
-int piranha_simulator = 0;
+int piranha_simulator;
+
+int boot_cpuid;
 
 extern char _end[];
 
@@ -92,7 +95,7 @@
 extern unsigned long iSeries_recal_tb;
 extern unsigned long iSeries_recal_titan;
 
-static int mf_initialized = 0;
+static int mf_initialized;
 
 struct MemoryBlock {
 	unsigned long absStart;
@@ -106,30 +109,30 @@
  * and return the number of physical blocks and fill in the array of
  * block data.
  */
-
-unsigned long iSeries_process_Condor_mainstore_vpd( struct MemoryBlock *mb_array, unsigned long max_entries )
+unsigned long iSeries_process_Condor_mainstore_vpd(struct MemoryBlock *mb_array,
+		unsigned long max_entries)
 {
-	/* Determine if absolute memory has any
-	 * holes so that we can interpret the
-	 * access map we get back from the hypervisor
-	 * correctly.
-	 */
-	
 	unsigned long holeFirstChunk, holeSizeChunks;
 	unsigned long numMemoryBlocks = 1;
-	struct IoHriMainStoreSegment4 * msVpd = (struct IoHriMainStoreSegment4 *)xMsVpd;
+	struct IoHriMainStoreSegment4 *msVpd =
+		(struct IoHriMainStoreSegment4 *)xMsVpd;
 	unsigned long holeStart = msVpd->nonInterleavedBlocksStartAdr;
-	unsigned long holeEnd   = msVpd->nonInterleavedBlocksEndAdr;
+	unsigned long holeEnd = msVpd->nonInterleavedBlocksEndAdr;
 	unsigned long holeSize = holeEnd - holeStart;
 
 	printk("Mainstore_VPD: Condor\n");
-
+	/*
+	 * Determine if absolute memory has any
+	 * holes so that we can interpret the
+	 * access map we get back from the hypervisor
+	 * correctly.
+	 */
 	mb_array[0].logicalStart = 0;
-	mb_array[0].logicalEnd   = 0x100000000;
-	mb_array[0].absStart     = 0;
-	mb_array[0].absEnd       = 0x100000000;
+	mb_array[0].logicalEnd = 0x100000000;
+	mb_array[0].absStart = 0;
+	mb_array[0].absEnd = 0x100000000;
 
-	if ( holeSize ) {
+	if (holeSize) {
 		numMemoryBlocks = 2;
 		holeStart = holeStart & 0x000fffffffffffff;
 		holeStart = addr_to_chunk(holeStart);
@@ -138,275 +141,264 @@
 		holeSizeChunks = holeSize;
 		printk( "Main store hole: start chunk = %0lx, size = %0lx chunks\n",
 				holeFirstChunk, holeSizeChunks );
-		mb_array[0].logicalEnd   = holeFirstChunk;
-		mb_array[0].absEnd       = holeFirstChunk;
+		mb_array[0].logicalEnd = holeFirstChunk;
+		mb_array[0].absEnd = holeFirstChunk;
 		mb_array[1].logicalStart = holeFirstChunk;
-		mb_array[1].logicalEnd   = 0x100000000 - holeSizeChunks;
-		mb_array[1].absStart     = holeFirstChunk + holeSizeChunks;
-		mb_array[1].absEnd       = 0x100000000;
+		mb_array[1].logicalEnd = 0x100000000 - holeSizeChunks;
+		mb_array[1].absStart = holeFirstChunk + holeSizeChunks;
+		mb_array[1].absEnd = 0x100000000;
 	}
-
-	
 	return numMemoryBlocks;
 }
 
-#define MaxSegmentAreas 32
-#define MaxSegmentAdrRangeBlocks 128
-#define MaxAreaRangeBlocks 4
-unsigned long iSeries_process_Regatta_mainstore_vpd( struct MemoryBlock *mb_array, unsigned long max_entries )
+#define MaxSegmentAreas			32
+#define MaxSegmentAdrRangeBlocks	128
+#define MaxAreaRangeBlocks		4
+
+unsigned long iSeries_process_Regatta_mainstore_vpd(
+		struct MemoryBlock *mb_array, unsigned long max_entries)
 {
-	struct IoHriMainStoreSegment5 * msVpdP = (struct IoHriMainStoreSegment5 *)xMsVpd;
+	struct IoHriMainStoreSegment5 *msVpdP =
+		(struct IoHriMainStoreSegment5 *)xMsVpd;
 	unsigned long numSegmentBlocks = 0;
 	u32 existsBits = msVpdP->msAreaExists;
 	unsigned long area_num;
 
 	printk("Mainstore_VPD: Regatta\n");
 
-	for ( area_num = 0; area_num < MaxSegmentAreas; ++area_num ) {
+	for (area_num = 0; area_num < MaxSegmentAreas; ++area_num ) {
 		unsigned long numAreaBlocks;
-		struct IoHriMainStoreArea4 * currentArea;
+		struct IoHriMainStoreArea4 *currentArea;
 
-		if ( existsBits & 0x80000000 ) {
+		if (existsBits & 0x80000000) {
 			unsigned long block_num;
 
 			currentArea = &msVpdP->msAreaArray[area_num];
 			numAreaBlocks = currentArea->numAdrRangeBlocks;
-
-			printk("ms_vpd: processing area %2ld  blocks=%ld", area_num, numAreaBlocks);
-
-			for ( block_num = 0; block_num < numAreaBlocks; ++block_num ) {
+			printk("ms_vpd: processing area %2ld  blocks=%ld",
+					area_num, numAreaBlocks);
+			for (block_num = 0; block_num < numAreaBlocks;
+					++block_num ) {
 				/* Process an address range block */
 				struct MemoryBlock tempBlock;
 				unsigned long i;
 
-				tempBlock.absStart = (unsigned long)currentArea->xAdrRangeBlock[block_num].blockStart;
-				tempBlock.absEnd   = (unsigned long)currentArea->xAdrRangeBlock[block_num].blockEnd;
+				tempBlock.absStart =
+					(unsigned long)currentArea->xAdrRangeBlock[block_num].blockStart;
+				tempBlock.absEnd =
+					(unsigned long)currentArea->xAdrRangeBlock[block_num].blockEnd;
 				tempBlock.logicalStart = 0;
 				tempBlock.logicalEnd   = 0;
-
-				printk("\n          block %ld absStart=%016lx absEnd=%016lx", block_num,
-							tempBlock.absStart, tempBlock.absEnd);
-
-				for ( i=0; i<numSegmentBlocks; ++i ) {
-					if ( mb_array[i].absStart == tempBlock.absStart )
+				printk("\n          block %ld absStart=%016lx absEnd=%016lx",
+						block_num, tempBlock.absStart,
+						tempBlock.absEnd);
+
+				for (i = 0; i < numSegmentBlocks; ++i) {
+					if (mb_array[i].absStart ==
+							tempBlock.absStart)
 						break;
 				}
-				if ( i == numSegmentBlocks ) {
-					if ( numSegmentBlocks == max_entries ) {
+				if (i == numSegmentBlocks) {
+					if (numSegmentBlocks == max_entries)
 						panic("iSeries_process_mainstore_vpd: too many memory blocks");
-					}
 					mb_array[numSegmentBlocks] = tempBlock;
 					++numSegmentBlocks;
-				}
-				else {
+				} else
 					printk(" (duplicate)");
-				}
 			}
 			printk("\n");
 		}
 		existsBits <<= 1;
 	}
 	/* Now sort the blocks found into ascending sequence */
-	if ( numSegmentBlocks > 1 ) {
+	if (numSegmentBlocks > 1) {
 		unsigned long m, n;
-		for ( m=0; m<numSegmentBlocks-1; ++m ) {
-			for ( n=numSegmentBlocks-1; m<n; --n ) {
-				if ( mb_array[n].absStart < mb_array[n-1].absStart ) {
+
+		for (m = 0; m < numSegmentBlocks - 1; ++m) {
+			for (n = numSegmentBlocks - 1; m < n; --n) {
+				if (mb_array[n].absStart <
+						mb_array[n-1].absStart) {
 					struct MemoryBlock tempBlock;
+
 					tempBlock = mb_array[n];
 					mb_array[n] = mb_array[n-1];
 					mb_array[n-1] = tempBlock;
 				}
-				
 			}
 		}
 	}
-	/* Assign "logical" addresses to each block.  These
+	/*
+	 * Assign "logical" addresses to each block.  These
 	 * addresses correspond to the hypervisor "bitmap" space.
 	 * Convert all addresses into units of 256K chunks.
 	 */
 	{
 	unsigned long i, nextBitmapAddress;
+
 	printk("ms_vpd: %ld sorted memory blocks\n", numSegmentBlocks);
 	nextBitmapAddress = 0;
-	for ( i=0; i<numSegmentBlocks; ++i ) {
-		unsigned long length = mb_array[i].absEnd - mb_array[i].absStart;
+	for (i = 0; i < numSegmentBlocks; ++i) {
+		unsigned long length = mb_array[i].absEnd -
+			mb_array[i].absStart;
+
 		mb_array[i].logicalStart = nextBitmapAddress;
 		mb_array[i].logicalEnd = nextBitmapAddress + length;
 		nextBitmapAddress += length;
 		printk("          Bitmap range: %016lx - %016lx\n"
-		       "        Absolute range: %016lx - %016lx\n",
-				mb_array[i].logicalStart, mb_array[i].logicalEnd, 
+				"        Absolute range: %016lx - %016lx\n",
+				mb_array[i].logicalStart,
+				mb_array[i].logicalEnd, 
 				mb_array[i].absStart, mb_array[i].absEnd);
-		mb_array[i].absStart     = addr_to_chunk( mb_array[i].absStart & 0x000fffffffffffff );
-		mb_array[i].absEnd       = addr_to_chunk( mb_array[i].absEnd & 0x000fffffffffffff );
-		mb_array[i].logicalStart = addr_to_chunk( mb_array[i].logicalStart );
-		mb_array[i].logicalEnd   = addr_to_chunk( mb_array[i].logicalEnd );
+		mb_array[i].absStart = addr_to_chunk(mb_array[i].absStart &
+				0x000fffffffffffff);
+		mb_array[i].absEnd = addr_to_chunk(mb_array[i].absEnd &
+				0x000fffffffffffff);
+		mb_array[i].logicalStart =
+			addr_to_chunk(mb_array[i].logicalStart);
+		mb_array[i].logicalEnd = addr_to_chunk(mb_array[i].logicalEnd);
 	}
 	}
 
 	return numSegmentBlocks;
-
 }
 
-unsigned long iSeries_process_mainstore_vpd( struct MemoryBlock *mb_array, unsigned long max_entries )
+unsigned long iSeries_process_mainstore_vpd(struct MemoryBlock *mb_array,
+		unsigned long max_entries)
 {
 	unsigned long i;
 	unsigned long mem_blocks = 0;
+
 	if (cur_cpu_spec->cpu_features & CPU_FTR_SLB)
-		mem_blocks = iSeries_process_Regatta_mainstore_vpd( mb_array, max_entries );
+		mem_blocks = iSeries_process_Regatta_mainstore_vpd(mb_array,
+				max_entries);
 	else
-		mem_blocks = iSeries_process_Condor_mainstore_vpd( mb_array, max_entries );
+		mem_blocks = iSeries_process_Condor_mainstore_vpd(mb_array,
+				max_entries);
 
 	printk("Mainstore_VPD: numMemoryBlocks = %ld \n", mem_blocks);
-	for ( i=0; i<mem_blocks; ++i ) {
+	for (i = 0; i < mem_blocks; ++i) {
 		printk("Mainstore_VPD: block %3ld logical chunks %016lx - %016lx\n"
 		       "                             abs chunks %016lx - %016lx\n",
 			i, mb_array[i].logicalStart, mb_array[i].logicalEnd,
 			mb_array[i].absStart, mb_array[i].absEnd);
 	}
-
 	return mem_blocks;
 }
 
-/*
- * void __init iSeries_init_early()
- */
-
-
-
-void __init
-iSeries_init_early(void)
+void __init iSeries_init_early(void)
 {
-#ifdef CONFIG_PPC_ISERIES
 	ppcdbg_initialize();
-	
+
 #if defined(CONFIG_BLK_DEV_INITRD)
 	/*
 	 * If the init RAM disk has been configured and there is
 	 * a non-zero starting address for it, set it up
 	 */
-
-	if ( naca->xRamDisk ) {
+	if (naca->xRamDisk) {
 		initrd_start = (unsigned long)__va(naca->xRamDisk);
-		initrd_end   = initrd_start + naca->xRamDiskSize * PAGE_SIZE;
+		initrd_end = initrd_start + naca->xRamDiskSize * PAGE_SIZE;
 		initrd_below_start_ok = 1;	// ramdisk in kernel space
 		ROOT_DEV = Root_RAM0;
-
-		if ( ((rd_size*1024)/PAGE_SIZE) < naca->xRamDiskSize )
-			rd_size = (naca->xRamDiskSize*PAGE_SIZE)/1024;
+		if (((rd_size * 1024) / PAGE_SIZE) < naca->xRamDiskSize)
+			rd_size = (naca->xRamDiskSize * PAGE_SIZE) / 1024;
 	} else
-	
 #endif /* CONFIG_BLK_DEV_INITRD */
-	  {
-                
-	    /*		ROOT_DEV = MKDEV( VIODASD_MAJOR, 1 ); */
-	  }
+	{
+	    /* ROOT_DEV = MKDEV(VIODASD_MAJOR, 1); */
+	}
 
 	iSeries_recal_tb = get_tb();
 	iSeries_recal_titan = HvCallXm_loadTod();
 
-	ppc_md.setup_arch	 	= iSeries_setup_arch;
-	ppc_md.setup_residual	 	= iSeries_setup_residual;
-	ppc_md.get_cpuinfo	 	= iSeries_get_cpuinfo;
-	ppc_md.init_IRQ		 	= iSeries_init_IRQ;
-	ppc_md.get_irq		 	= iSeries_get_irq;
-	ppc_md.init		 	= NULL;
-
-	ppc_md.restart		 	= iSeries_restart;
-	ppc_md.power_off	 	= iSeries_power_off;
-	ppc_md.halt		 	= iSeries_halt;
-
-	ppc_md.get_boot_time		= iSeries_get_boot_time;
-	ppc_md.set_rtc_time	 	= iSeries_set_rtc_time;
-	ppc_md.get_rtc_time	 	= iSeries_get_rtc_time;
-	ppc_md.calibrate_decr	 	= iSeries_calibrate_decr;
-	ppc_md.progress			= iSeries_progress;
+	ppc_md.setup_arch = iSeries_setup_arch;
+	ppc_md.setup_residual = iSeries_setup_residual;
+	ppc_md.get_cpuinfo = iSeries_get_cpuinfo;
+	ppc_md.init_IRQ = iSeries_init_IRQ;
+	ppc_md.init_irq_desc = iSeries_init_irq_desc;
+	ppc_md.get_irq = iSeries_get_irq;
+	ppc_md.init = NULL;
+
+	ppc_md.restart = iSeries_restart;
+	ppc_md.power_off = iSeries_power_off;
+	ppc_md.halt = iSeries_halt;
+
+	ppc_md.get_boot_time = iSeries_get_boot_time;
+	ppc_md.set_rtc_time = iSeries_set_rtc_time;
+	ppc_md.get_rtc_time = iSeries_get_rtc_time;
+	ppc_md.calibrate_decr = iSeries_calibrate_decr;
+	ppc_md.progress = iSeries_progress;
 
 	hpte_init_iSeries();
 	tce_init_iSeries();
 
-	/* Initialize the table which translate Linux physical addresses to
+	/*
+	 * Initialize the table which translate Linux physical addresses to
 	 * AS/400 absolute addresses
 	 */
-
 	build_iSeries_Memory_Map();
-
 	setup_iSeries_cache_sizes();
-
 	/* Initialize machine-dependency vectors */
-
-
 #ifdef CONFIG_SMP
 	smp_init_iSeries();
 #endif
-
-	if ( itLpNaca.xPirEnvironMode == 0 ) 
+	if (itLpNaca.xPirEnvironMode == 0) 
 		piranha_simulator = 1;
-#endif
 }
 
-/*
- * void __init iSeries_init()
- */
-
-void __init
-iSeries_init(unsigned long r3, unsigned long r4, unsigned long r5, 
+void __init iSeries_init(unsigned long r3, unsigned long r4, unsigned long r5, 
 	   unsigned long r6, unsigned long r7)
 {
+	char *p, *q;
+
 	/* Associate Lp Event Queue 0 with processor 0 */
-	HvCallEvent_setLpEventQueueInterruptProc( 0, 0 );
+	HvCallEvent_setLpEventQueueInterruptProc(0, 0);
 
-	{
-		/* copy the command line parameter from the primary VSP  */
-		char *p, *q;
-		HvCallEvent_dmaToSp( cmd_line,
-				     2*64*1024,
-				     256,
-				     HvLpDma_Direction_RemoteToLocal );
-
-		p = q = cmd_line + 255;
-		while( p > cmd_line ) {
-			if ((*p == 0) || (*p == ' ') || (*p == '\n'))
-				--p;
-			else
-				break;
-		}
-		if ( p < q )
-			*(p+1) = 0;
+	/* copy the command line parameter from the primary VSP  */
+	HvCallEvent_dmaToSp(cmd_line, 2 * 64* 1024, 256,
+			HvLpDma_Direction_RemoteToLocal);
+
+	p = q = cmd_line + 255;
+	while (p > cmd_line) {
+		if ((*p == 0) || (*p == ' ') || (*p == '\n'))
+			--p;
+		else
+			break;
 	}
+	if (p < q)
+		*(p + 1) = 0;
 
         if (strstr(cmd_line, "dprofile=")) {
-                char *p, *q;
-
                 for (q = cmd_line; (p = strstr(q, "dprofile=")) != 0; ) {
 			unsigned long size, new_klimit;
+
                         q = p + 9;
-                        if (p > cmd_line && p[-1] != ' ')
+                        if ((p > cmd_line) && (p[-1] != ' '))
                                 continue;
                         dprof_shift = simple_strtoul(q, &q, 0);
-			dprof_len = (unsigned long)_etext - (unsigned long)_stext;
+			dprof_len = (unsigned long)_etext -
+				(unsigned long)_stext;
 			dprof_len >>= dprof_shift;
-			size = ((dprof_len * sizeof(unsigned int)) + (PAGE_SIZE-1)) & PAGE_MASK;
-			dprof_buffer = (unsigned int *)((klimit + (PAGE_SIZE-1)) & PAGE_MASK);
+			size = ((dprof_len * sizeof(unsigned int)) +
+					(PAGE_SIZE-1)) & PAGE_MASK;
+			dprof_buffer = (unsigned int *)((klimit +
+						(PAGE_SIZE-1)) & PAGE_MASK);
 			new_klimit = ((unsigned long)dprof_buffer) + size;
-			lmb_reserve( __pa(klimit), (new_klimit-klimit));
+			lmb_reserve(__pa(klimit), (new_klimit-klimit));
 			klimit = new_klimit;
-			memset( dprof_buffer, 0, size );
+			memset(dprof_buffer, 0, size);
                 }
         }
 
 	iSeries_setup_dprofile();
 
-	iSeries_proc_early_init();	
+	iSeries_proc_early_init();
 	mf_init();
 	mf_initialized = 1;
 	mb();
 
-	iSeries_proc_callback( &pmc_proc_init );
+	iSeries_proc_callback(&pmc_proc_init);
 }
 
-#ifdef CONFIG_PPC_ISERIES
 /*
  * The iSeries may have very large memories ( > 128 GB ) and a partition
  * may get memory in "chunks" that may be anywhere in the 2**52 real
@@ -444,9 +436,10 @@
 
 	/* Chunk size on iSeries is 256K bytes */
 	totalChunks = (u32)HvLpConfig_getMsChunks();
-	klimit = msChunks_alloc(klimit, totalChunks, 1UL<<18);
+	klimit = msChunks_alloc(klimit, totalChunks, 1UL << 18);
 
-	/* Get absolute address of our load area
+	/*
+	 * Get absolute address of our load area
 	 * and map it to physical address 0
 	 * This guarantees that the loadarea ends up at physical 0
 	 * otherwise, it might not be returned by PLIC as the first
@@ -456,63 +449,68 @@
 	loadAreaFirstChunk = (u32)addr_to_chunk(itLpNaca.xLoadAreaAddr);
 	loadAreaSize =  itLpNaca.xLoadAreaChunks;
 
-	/* Only add the pages already mapped here.  
+	/*
+	 * Only add the pages already mapped here.  
 	 * Otherwise we might add the hpt pages 
 	 * The rest of the pages of the load area
 	 * aren't in the HPT yet and can still
 	 * be assigned an arbitrary physical address
 	 */
-	if ( (loadAreaSize * 64) > HvPagesToMap )
+	if ((loadAreaSize * 64) > HvPagesToMap)
 		loadAreaSize = HvPagesToMap / 64;
 
 	loadAreaLastChunk = loadAreaFirstChunk + loadAreaSize - 1;
 
-	/* TODO Do we need to do something if the HPT is in the 64MB load area?
+	/*
+	 * TODO Do we need to do something if the HPT is in the 64MB load area?
 	 * This would be required if the itLpNaca.xLoadAreaChunks includes 
 	 * the HPT size
 	 */
 
-	printk( "Mapping load area - physical addr = 0000000000000000\n"
-                "                    absolute addr = %016lx\n", 
-			chunk_to_addr(loadAreaFirstChunk) );
-	printk( "Load area size %dK\n", loadAreaSize*256 );
+	printk("Mapping load area - physical addr = 0000000000000000\n"
+		"                    absolute addr = %016lx\n",
+		chunk_to_addr(loadAreaFirstChunk));
+	printk("Load area size %dK\n", loadAreaSize * 256);
+	
+	for (nextPhysChunk = 0; nextPhysChunk < loadAreaSize; ++nextPhysChunk)
+		msChunks.abs[nextPhysChunk] =
+			loadAreaFirstChunk + nextPhysChunk;
 	
-	for (	nextPhysChunk = 0; 
-		nextPhysChunk < loadAreaSize; 
-		++nextPhysChunk ) {
-		msChunks.abs[nextPhysChunk] = loadAreaFirstChunk+nextPhysChunk;
-	}
-	
-	/* Get absolute address of our HPT and remember it so
+	/*
+	 * Get absolute address of our HPT and remember it so
 	 * we won't map it to any physical address
 	 */
-
 	hptFirstChunk = (u32)addr_to_chunk(HvCallHpt_getHptAddress());
-	hptSizePages =  (u32)(HvCallHpt_getHptPages());
-	hptSizeChunks = hptSizePages >> (msChunks.chunk_shift-PAGE_SHIFT);
+	hptSizePages = (u32)HvCallHpt_getHptPages();
+	hptSizeChunks = hptSizePages >> (msChunks.chunk_shift - PAGE_SHIFT);
 	hptLastChunk = hptFirstChunk + hptSizeChunks - 1;
-	
-	printk( "HPT absolute addr = %016lx, size = %dK\n",
-			chunk_to_addr(hptFirstChunk), hptSizeChunks*256 );
+
+	printk("HPT absolute addr = %016lx, size = %dK\n",
+			chunk_to_addr(hptFirstChunk), hptSizeChunks * 256);
 
 	/* Fill in the htab_data structure */
-	
 	/* Fill in size of hashed page table */
-	num_ptegs = hptSizePages * (PAGE_SIZE/(sizeof(HPTE)*HPTES_PER_GROUP));
+	num_ptegs = hptSizePages *
+		(PAGE_SIZE / (sizeof(HPTE) * HPTES_PER_GROUP));
 	htab_data.htab_num_ptegs = num_ptegs;
 	htab_data.htab_hash_mask = num_ptegs - 1;
 	
-	/* The actual hashed page table is in the hypervisor, we have no direct access */
+	/*
+	 * The actual hashed page table is in the hypervisor,
+	 * we have no direct access
+	 */
 	htab_data.htab = NULL;
 
-	/* Determine if absolute memory has any
+	/*
+	 * Determine if absolute memory has any
 	 * holes so that we can interpret the
 	 * access map we get back from the hypervisor
 	 * correctly.
 	 */
-	numMemoryBlocks = iSeries_process_mainstore_vpd( mb, 32 );
+	numMemoryBlocks = iSeries_process_mainstore_vpd(mb, 32);
 
-	/* Process the main store access map from the hypervisor
+	/*
+	 * Process the main store access map from the hypervisor
 	 * to build up our physical -> absolute translation table
 	 */
 	curBlock = 0;
@@ -520,30 +518,29 @@
 	currDword = 0;
 	moreChunks = totalChunks;
 
-	while ( moreChunks ) {
-		map = HvCallSm_get64BitsOfAccessMap( itLpNaca.xLpIndex,
-						     currDword );
+	while (moreChunks) {
+		map = HvCallSm_get64BitsOfAccessMap(itLpNaca.xLpIndex,
+				currDword);
 		thisChunk = currChunk;
-		while ( map ) {
+		while (map) {
 			chunkBit = map >> 63;
 			map <<= 1;
-			if ( chunkBit ) {
+			if (chunkBit) {
 				--moreChunks;
-
-				while ( thisChunk >= mb[curBlock].logicalEnd ) {
+				while (thisChunk >= mb[curBlock].logicalEnd) {
 					++curBlock;
-					if ( curBlock >= numMemoryBlocks )
+					if (curBlock >= numMemoryBlocks)
 						panic("out of memory blocks");
 				}
-				if ( thisChunk < mb[curBlock].logicalStart )
+				if (thisChunk < mb[curBlock].logicalStart)
 					panic("memory block error");
 
-				absChunk = mb[curBlock].absStart + ( thisChunk - mb[curBlock].logicalStart );
-
-				if ( ( ( absChunk < hptFirstChunk ) ||
-				       ( absChunk > hptLastChunk ) ) &&
-				     ( ( absChunk < loadAreaFirstChunk ) ||
-				       ( absChunk > loadAreaLastChunk ) ) ) {
+				absChunk = mb[curBlock].absStart +
+					(thisChunk - mb[curBlock].logicalStart);
+				if (((absChunk < hptFirstChunk) ||
+				     (absChunk > hptLastChunk)) &&
+				    ((absChunk < loadAreaFirstChunk) ||
+				     (absChunk > loadAreaLastChunk))) {
 					msChunks.abs[nextPhysChunk] = absChunk;
 					++nextPhysChunk;
 				}
@@ -553,8 +550,9 @@
 		++currDword;
 		currChunk += 64;
 	}
-					
-	/* main store size (in chunks) is 
+
+	/*
+	 * main store size (in chunks) is 
 	 *   totalChunks - hptSizeChunks
 	 * which should be equal to 
 	 *   nextPhysChunk
@@ -562,12 +560,12 @@
 	systemcfg->physicalMemorySize = chunk_to_addr(nextPhysChunk);
 
 	/* Bolt kernel mappings for all of memory */
-	iSeries_bolt_kernel( 0, systemcfg->physicalMemorySize );
+	iSeries_bolt_kernel(0, systemcfg->physicalMemorySize);
 
 	lmb_init();
-	lmb_add( 0, systemcfg->physicalMemorySize );
+	lmb_add(0, systemcfg->physicalMemorySize);
 	lmb_analyze();	/* ?? */
-	lmb_reserve( 0, __pa(klimit));
+	lmb_reserve(0, __pa(klimit));
 
 	/* 
 	 * Hardcode to GP size.  I am not sure where to get this info. DRENG
@@ -579,59 +577,94 @@
  * Set up the variables that describe the cache line sizes
  * for this machine.
  */
-
 static void __init setup_iSeries_cache_sizes(void)
 {
 	unsigned int i, n;
 	unsigned int procIx = get_paca()->xLpPaca.xDynHvPhysicalProcIndex;
 
-	systemcfg->iCacheL1Size = xIoHriProcessorVpd[procIx].xInstCacheSize * 1024;
-	systemcfg->iCacheL1LineSize = xIoHriProcessorVpd[procIx].xInstCacheOperandSize;
-	systemcfg->dCacheL1Size = xIoHriProcessorVpd[procIx].xDataL1CacheSizeKB * 1024;
-	systemcfg->dCacheL1LineSize = xIoHriProcessorVpd[procIx].xDataCacheOperandSize;
+	systemcfg->iCacheL1Size =
+		xIoHriProcessorVpd[procIx].xInstCacheSize * 1024;
+	systemcfg->iCacheL1LineSize =
+		xIoHriProcessorVpd[procIx].xInstCacheOperandSize;
+	systemcfg->dCacheL1Size =
+		xIoHriProcessorVpd[procIx].xDataL1CacheSizeKB * 1024;
+	systemcfg->dCacheL1LineSize =
+		xIoHriProcessorVpd[procIx].xDataCacheOperandSize;
 	naca->iCacheL1LinesPerPage = PAGE_SIZE / systemcfg->iCacheL1LineSize;
 	naca->dCacheL1LinesPerPage = PAGE_SIZE / systemcfg->dCacheL1LineSize;
 
 	i = systemcfg->iCacheL1LineSize;
 	n = 0;
-	while ((i=(i/2))) ++n;
+	while ((i = (i / 2)))
+		++n;
 	naca->iCacheL1LogLineSize = n;
 
 	i = systemcfg->dCacheL1LineSize;
 	n = 0;
-	while ((i=(i/2))) ++n;
+	while ((i = (i / 2)))
+		++n;
 	naca->dCacheL1LogLineSize = n;
 
-	printk( "D-cache line size = %d\n", (unsigned int)systemcfg->dCacheL1LineSize);
-	printk( "I-cache line size = %d\n", (unsigned int)systemcfg->iCacheL1LineSize);
+	printk("D-cache line size = %d\n",
+			(unsigned int)systemcfg->dCacheL1LineSize);
+	printk("I-cache line size = %d\n",
+			(unsigned int)systemcfg->iCacheL1LineSize);
 }
 
 /*
- * Bolt the kernel addr space into the HPT
+ * Create a pte. Used during initialization only.
  */
+static void iSeries_make_pte(unsigned long va, unsigned long pa,
+			     int mode)
+{
+	HPTE local_hpte, rhpte;
+	unsigned long hash, vpn;
+	long slot;
+
+	vpn = va >> PAGE_SHIFT;
+	hash = hpt_hash(vpn, 0);
+
+	local_hpte.dw1.dword1 = pa | mode;
+	local_hpte.dw0.dword0 = 0;
+	local_hpte.dw0.dw0.avpn = va >> 23;
+	local_hpte.dw0.dw0.bolted = 1;		/* bolted */
+	local_hpte.dw0.dw0.v = 1;
+
+	slot = HvCallHpt_findValid(&rhpte, vpn);
+	if (slot < 0) {
+		/* Must find space in primary group */
+		panic("hash_page: hpte already exists\n");
+	}
+	HvCallHpt_addValidate(slot, 0, (HPTE *)&local_hpte );
+}
 
+/*
+ * Bolt the kernel addr space into the HPT
+ */
 static void __init iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr)
 {
 	unsigned long pa;
 	unsigned long mode_rw = _PAGE_ACCESSED | _PAGE_COHERENT | PP_RWXX;
 	HPTE hpte;
 
-	for (pa=saddr; pa < eaddr ;pa+=PAGE_SIZE) {
+	for (pa = saddr; pa < eaddr ;pa += PAGE_SIZE) {
 		unsigned long ea = (unsigned long)__va(pa);
-		unsigned long vsid = get_kernel_vsid( ea );
-		unsigned long va = ( vsid << 28 ) | ( pa & 0xfffffff );
+		unsigned long vsid = get_kernel_vsid(ea);
+		unsigned long va = (vsid << 28) | (pa & 0xfffffff);
 		unsigned long vpn = va >> PAGE_SHIFT;
-		unsigned long slot = HvCallHpt_findValid( &hpte, vpn );
-		if ( hpte.dw0.dw0.v ) {
+		unsigned long slot = HvCallHpt_findValid(&hpte, vpn);
+
+		if (hpte.dw0.dw0.v) {
 			/* HPTE exists, so just bolt it */
-			HvCallHpt_setSwBits( slot, 0x10, 0 );
-		} else {
+			HvCallHpt_setSwBits(slot, 0x10, 0);
+			/* And make sure the pp bits are correct */
+			HvCallHpt_setPp(slot, PP_RWXX);
+		} else
 			/* No HPTE exists, so create a new bolted one */
-			build_valid_hpte(vsid, ea, pa, NULL, mode_rw, 1);
-		}
+			iSeries_make_pte(va, (unsigned long)__v2a(ea),
+					mode_rw);
 	}
 }
-#endif /* CONFIG_PPC_ISERIES */
 
 extern unsigned long ppc_proc_freq;
 extern unsigned long ppc_tb_freq;
@@ -639,10 +672,9 @@
 /*
  * Document me.
  */
-void __init
-iSeries_setup_arch(void)
+void __init iSeries_setup_arch(void)
 {
-	void *	eventStack;
+	void *eventStack;
 	unsigned procIx = get_paca()->xLpPaca.xDynHvPhysicalProcIndex;
 
 	/* Add an eye catcher and the systemcfg layout version number */
@@ -657,50 +689,43 @@
 	 * we subtract out the KERNELBASE and add in the
 	 * absolute real address of the kernel load area
 	 */
-	
-	eventStack = alloc_bootmem_pages( LpEventStackSize );
-	
-	memset( eventStack, 0, LpEventStackSize );
+	eventStack = alloc_bootmem_pages(LpEventStackSize);
+	memset(eventStack, 0, LpEventStackSize);
 	
 	/* Invoke the hypervisor to initialize the event stack */
-	
-	HvCallEvent_setLpEventStack( 0, eventStack, LpEventStackSize );
-	
+	HvCallEvent_setLpEventStack(0, eventStack, LpEventStackSize);
+
 	/* Initialize fields in our Lp Event Queue */
-	
 	xItLpQueue.xSlicEventStackPtr = (char *)eventStack;
 	xItLpQueue.xSlicCurEventPtr = (char *)eventStack;
 	xItLpQueue.xSlicLastValidEventPtr = (char *)eventStack + 
 					(LpEventStackSize - LpEventMaxSize);
 	xItLpQueue.xIndex = 0;
-	
+
 	/* Compute processor frequency */
-	procFreqHz = (((1UL<<34) * 1000000) / xIoHriProcessorVpd[procIx].xProcFreq );
+	procFreqHz = ((1UL << 34) * 1000000) /
+			xIoHriProcessorVpd[procIx].xProcFreq;
 	procFreqMhz = procFreqHz / 1000000;
-	procFreqMhzHundreths = (procFreqHz/10000) - (procFreqMhz*100);
-
+	procFreqMhzHundreths = (procFreqHz / 10000) - (procFreqMhz * 100);
 	ppc_proc_freq = procFreqHz;
 
 	/* Compute time base frequency */
-	tbFreqHz = (((1UL<<32) * 1000000) / xIoHriProcessorVpd[procIx].xTimeBaseFreq );
+	tbFreqHz = ((1UL << 32) * 1000000) /
+		xIoHriProcessorVpd[procIx].xTimeBaseFreq;
 	tbFreqMhz = tbFreqHz / 1000000;
-	tbFreqMhzHundreths = (tbFreqHz/10000) - (tbFreqMhz*100);
-
+	tbFreqMhzHundreths = (tbFreqHz / 10000) - (tbFreqMhz * 100);
 	ppc_tb_freq = tbFreqHz;
 
 	printk("Max  logical processors = %d\n", 
-			itVpdAreas.xSlicMaxLogicalProcs );
+			itVpdAreas.xSlicMaxLogicalProcs);
 	printk("Max physical processors = %d\n",
-			itVpdAreas.xSlicMaxPhysicalProcs );
-	printk("Processor frequency = %lu.%02lu\n",
-			procFreqMhz, 
-			procFreqMhzHundreths );
-	printk("Time base frequency = %lu.%02lu\n",
-			tbFreqMhz,
-			tbFreqMhzHundreths );
+			itVpdAreas.xSlicMaxPhysicalProcs);
+	printk("Processor frequency = %lu.%02lu\n", procFreqMhz,
+			procFreqMhzHundreths);
+	printk("Time base frequency = %lu.%02lu\n", tbFreqMhz,
+			tbFreqMhzHundreths);
 	systemcfg->processor = xIoHriProcessorVpd[procIx].xPVR;
 	printk("Processor version = %x\n", systemcfg->processor);
-
 }
 
 /*
@@ -715,38 +740,27 @@
  *
  * Output(s):
  *  *buffer - Buffer with CPU data.
- *
- * Returns:
- *   The number of bytes copied into 'buffer' if OK, otherwise zero or less
- *   on error.
  */
-void iSeries_setup_residual(struct seq_file *m)
+void iSeries_setup_residual(struct seq_file *m, int cpu_id)
 {
-	
-	seq_printf(m,"clock\t\t: %lu.%02luMhz\n",
-		procFreqMhz, procFreqMhzHundreths );
-	seq_printf(m,"time base\t: %lu.%02luMHz\n",
-		tbFreqMhz, tbFreqMhzHundreths );
-	seq_printf(m,"i-cache\t\t: %d\n",
-		systemcfg->iCacheL1LineSize);
-	seq_printf(m,"d-cache\t\t: %d\n",
-		systemcfg->dCacheL1LineSize);
-
+	seq_printf(m, "clock\t\t: %lu.%02luMhz\n", procFreqMhz,
+			procFreqMhzHundreths);
+	seq_printf(m, "time base\t: %lu.%02luMHz\n", tbFreqMhz,
+			tbFreqMhzHundreths);
+	seq_printf(m, "i-cache\t\t: %d\n", systemcfg->iCacheL1LineSize);
+	seq_printf(m, "d-cache\t\t: %d\n", systemcfg->dCacheL1LineSize);
 }
 
 void iSeries_get_cpuinfo(struct seq_file *m)
 {
-
-	seq_printf(m,"machine\t\t: 64-bit iSeries Logical Partition\n");
-
+	seq_printf(m, "machine\t\t: 64-bit iSeries Logical Partition\n");
 }
 
 /*
  * Document me.
  * and Implement me.
  */
-int
-iSeries_get_irq(struct pt_regs *regs)
+int iSeries_get_irq(struct pt_regs *regs)
 {
 	/* -2 means ignore this interrupt */
 	return -2;
@@ -755,8 +769,7 @@
 /*
  * Document me.
  */
-void
-iSeries_restart(char *cmd)
+void iSeries_restart(char *cmd)
 {
 	mf_reboot();
 }
@@ -764,8 +777,7 @@
 /*
  * Document me.
  */
-void
-iSeries_power_off(void)
+void iSeries_power_off(void)
 {
 	mf_powerOff();
 }
@@ -773,8 +785,7 @@
 /*
  * Document me.
  */
-void
-iSeries_halt(void)
+void iSeries_halt(void)
 {
 	mf_powerOff();
 }
@@ -792,24 +803,19 @@
  *   and sets up the kernel timer decrementer based on that value.
  *
  */
-void __init
-iSeries_calibrate_decr(void)
+void __init iSeries_calibrate_decr(void)
 {
 	unsigned long	cyclesPerUsec;
-
 	struct div_result divres;
 	
-	/* Compute decrementer (and TB) frequency 
-	 * in cycles/sec 
-	 */
+	/* Compute decrementer (and TB) frequency in cycles/sec */
+	cyclesPerUsec = ppc_tb_freq / 1000000;
 
-	cyclesPerUsec = ppc_tb_freq / 1000000;	/* cycles / usec */
-
-	/* Set the amount to refresh the decrementer by.  This
+	/*
+	 * Set the amount to refresh the decrementer by.  This
 	 * is the number of decrementer ticks it takes for 
 	 * 1/HZ seconds.
 	 */
-
 	tb_ticks_per_jiffy = ppc_tb_freq / HZ;
 
 #if 0
@@ -824,47 +830,54 @@
 	 * that jiffies (and xtime) will match the time returned
 	 * by do_gettimeofday.
 	 */
-	tb_ticks_per_sec   = tb_ticks_per_jiffy * HZ;
+	tb_ticks_per_sec = tb_ticks_per_jiffy * HZ;
 	tb_ticks_per_usec = cyclesPerUsec;
 	tb_to_us = mulhwu_scale_factor(ppc_tb_freq, 1000000);
-	div128_by_32( 1024*1024, 0, tb_ticks_per_sec, &divres );
+	div128_by_32(1024 * 1024, 0, tb_ticks_per_sec, &divres);
 	tb_to_xs = divres.result_low;
 	setup_default_decr();
 }
 
-void __init
-iSeries_progress( char * st, unsigned short code )
+void __init iSeries_progress(char * st, unsigned short code)
 {
-	printk( "Progress: [%04x] - %s\n", (unsigned)code, st );
-	if ( !piranha_simulator && mf_initialized ) {
-	    if (code != 0xffff)
-		mf_displayProgress( code );
-	    else
-		mf_clearSrc();
+	printk("Progress: [%04x] - %s\n", (unsigned)code, st);
+	if (!piranha_simulator && mf_initialized) {
+		if (code != 0xffff)
+			mf_displayProgress(code);
+		else
+			mf_clearSrc();
 	}
 }
 
-
 void iSeries_fixup_klimit(void)
 {
-	/* Change klimit to take into account any ram disk that may be included */
+	/*
+	 * Change klimit to take into account any ram disk
+	 * that may be included
+	 */
 	if (naca->xRamDisk)
-		klimit = KERNELBASE + (u64)naca->xRamDisk + (naca->xRamDiskSize * PAGE_SIZE);
+		klimit = KERNELBASE + (u64)naca->xRamDisk +
+			(naca->xRamDiskSize * PAGE_SIZE);
 	else {
-		/* No ram disk was included - check and see if there was an embedded system map */
-		/* Change klimit to take into account any embedded system map */
+		/*
+		 * No ram disk was included - check and see if there
+		 * was an embedded system map.  Change klimit to take
+		 * into account any embedded system map
+		 */
 		if (embedded_sysmap_end)
-			klimit = KERNELBASE + ((embedded_sysmap_end+4095) & 0xfffffffffffff000);
+			klimit = KERNELBASE + ((embedded_sysmap_end + 4095) &
+					0xfffffffffffff000);
 	}
 }
 
 static void iSeries_setup_dprofile(void)
 {
-	if ( dprof_buffer ) {
+	if (dprof_buffer) {
 		unsigned i;
-		for (i=0; i<NR_CPUS; ++i) {
+
+		for (i = 0; i < NR_CPUS; ++i) {
 			paca[i].prof_shift = dprof_shift;
-			paca[i].prof_len = dprof_len-1;
+			paca[i].prof_len = dprof_len - 1;
 			paca[i].prof_buffer = dprof_buffer;
 			paca[i].prof_stext = (unsigned *)_stext;
 			mb();
diff -Nru a/arch/ppc64/kernel/iSeries_setup.h b/arch/ppc64/kernel/iSeries_setup.h
--- a/arch/ppc64/kernel/iSeries_setup.h	Tue Feb  3 19:45:34 2004
+++ b/arch/ppc64/kernel/iSeries_setup.h	Tue Feb  3 19:45:34 2004
@@ -19,25 +19,26 @@
 #ifndef	__ISERIES_SETUP_H__
 #define	__ISERIES_SETUP_H__
 
-extern void		 iSeries_init_early(void);
-extern void		 iSeries_init(unsigned long r3,
-			            unsigned long ird_start,
-				    unsigned long ird_end,
-				    unsigned long cline_start,
-				    unsigned long cline_end);
-extern void		 iSeries_setup_arch(void);
-extern void		 iSeries_setup_residual(struct seq_file *m);
-extern void		 iSeries_get_cpuinfo(struct seq_file *m);
-extern void		 iSeries_init_IRQ(void);
-extern int		 iSeries_get_irq(struct pt_regs *regs);
-extern void		 iSeries_restart(char *cmd);
-extern void		 iSeries_power_off(void);
-extern void		 iSeries_halt(void);
-extern void		 iSeries_time_init(void);
-extern void      iSeries_get_boot_time(struct rtc_time *tm);
-extern int		 iSeries_set_rtc_time(unsigned long now);
-extern unsigned long	 iSeries_get_rtc_time(void);
-extern void		 iSeries_calibrate_decr(void);
-extern void 	 iSeries_progress( char *, unsigned short );
+#include <linux/irq.h>		/* for irq_desc_t */
+
+extern void iSeries_init_early(void);
+extern void iSeries_init(unsigned long r3, unsigned long ird_start,
+		unsigned long ird_end, unsigned long cline_start,
+		unsigned long cline_end);
+extern void iSeries_setup_arch(void);
+extern void iSeries_setup_residual(struct seq_file *m, int cpu_id);
+extern void iSeries_get_cpuinfo(struct seq_file *m);
+extern void iSeries_init_IRQ(void);
+extern void iSeries_init_irq_desc(irq_desc_t *);
+extern int iSeries_get_irq(struct pt_regs *regs);
+extern void iSeries_restart(char *cmd);
+extern void iSeries_power_off(void);
+extern void iSeries_halt(void);
+extern void iSeries_time_init(void);
+extern void iSeries_get_boot_time(struct rtc_time *tm);
+extern int iSeries_set_rtc_time(struct rtc_time *tm);
+extern void iSeries_get_rtc_time(struct rtc_time *tm);
+extern void iSeries_calibrate_decr(void);
+extern void iSeries_progress( char *, unsigned short );
 
 #endif /* __ISERIES_SETUP_H__ */
diff -Nru a/arch/ppc64/kernel/idle.c b/arch/ppc64/kernel/idle.c
--- a/arch/ppc64/kernel/idle.c	Tue Feb  3 19:45:37 2004
+++ b/arch/ppc64/kernel/idle.c	Tue Feb  3 19:45:37 2004
@@ -1,5 +1,13 @@
 /*
- * idle.c
+ * Idle daemon for PowerPC.  Idle daemon will handle any action
+ * that needs to be taken when the system becomes idle.
+ *
+ * Originally Written by Cort Dougan (cort@cs.nmt.edu)
+ *
+ * iSeries supported added by Mike Corrigan <mikejc@us.ibm.com>
+ *
+ * Additional shared processor, SMT, and firmware support
+ *    Copyright (c) 2003 Dave Engebretsen <engebret@us.ibm.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -26,14 +34,18 @@
 #include <asm/processor.h>
 #include <asm/mmu.h>
 #include <asm/cache.h>
+#include <asm/cputable.h>
 #include <asm/time.h>
-
-#ifdef CONFIG_PPC_ISERIES
-
 #include <asm/iSeries/LparData.h>
 #include <asm/iSeries/HvCall.h>
 #include <asm/iSeries/ItLpQueue.h>
 
+extern long cede_processor(void);
+extern long poll_pending(void);
+
+int (*idle_loop)(void);
+
+#ifdef CONFIG_PPC_ISERIES
 unsigned long maxYieldTime = 0;
 unsigned long minYieldTime = 0xffffffffffffffffUL;
 
@@ -66,24 +78,24 @@
 	process_iSeries_events();
 }
 
-int cpu_idle(void)
+int iSeries_idle(void)
 {
 	struct paca_struct *lpaca;
 	long oldval;
 	unsigned long CTRL;
 
-#warning fix iseries run light
-#if 0
 	/* ensure iSeries run light will be out when idle */
-	current->thread.flags &= ~PPC_FLAG_RUN_LIGHT;
+	clear_thread_flag(TIF_RUN_LIGHT);
 	CTRL = mfspr(CTRLF);
 	CTRL &= ~RUNLATCH;
 	mtspr(CTRLT, CTRL);
+#if 0
+	init_idle();	
 #endif
 
 	lpaca = get_paca();
 
-	while (1) {
+	for (;;) {
 		if (lpaca->xLpPaca.xSharedProc) {
 			if (ItLpQueue_isLpIntPending(lpaca->lpQueuePtr))
 				process_iSeries_events();
@@ -109,16 +121,13 @@
 			}
 		}
 
-		if (need_resched())
-			schedule();
+		schedule();
 	}
-
 	return 0;
 }
+#endif
 
-#else /* CONFIG_PPC_ISERIES */
-
-int cpu_idle(void)
+int default_idle(void)
 {
 	long oldval;
 
@@ -145,9 +154,155 @@
 	return 0;
 }
 
-#endif /* CONFIG_PPC_ISERIES */
+#ifdef CONFIG_PPC_PSERIES
+int dedicated_idle(void)
+{
+	long oldval;
+	struct paca_struct *lpaca = get_paca(), *ppaca;
+	unsigned long start_snooze;
+
+	ppaca = &paca[(lpaca->xPacaIndex) ^ 1];
+
+	while (1) {
+		/* Indicate to the HV that we are idle.  Now would be
+		 * a good time to find other work to dispatch. */
+		lpaca->xLpPaca.xIdle = 1;
+
+		oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED);
+		if (!oldval) {
+			set_thread_flag(TIF_POLLING_NRFLAG);
+			start_snooze = __get_tb();
+			while (!need_resched()) {
+				/* need_resched could be 1 or 0 at this 
+				 * point.  If it is 0, set it to 0, so
+				 * an IPI/Prod is sent.  If it is 1, keep
+				 * it that way & schedule work.
+				 */
+				if (__get_tb() < 
+				    (start_snooze + 
+				     naca->smt_snooze_delay*tb_ticks_per_usec)) {  
+					HMT_low(); /* Low thread priority */
+					continue;
+				}
+
+				HMT_very_low(); /* Low power mode */
+
+				/* If the SMT mode is system controlled & the 
+				 * partner thread is doing work, switch into
+				 * ST mode.
+				 */
+				if((naca->smt_state == SMT_DYNAMIC) &&
+				   (!(ppaca->xLpPaca.xIdle))) {
+					/* Indicate we are no longer polling for
+					 * work, and then clear need_resched.  If
+					 * need_resched was 1, set it back to 1
+					 * and schedule work
+					 */
+					clear_thread_flag(TIF_POLLING_NRFLAG);
+					oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED);
+					if(oldval == 1) {
+						set_need_resched();
+						break;
+					}
+
+					/* DRENG: Go HMT_medium here ? */
+					local_irq_disable(); 
+					lpaca->yielded = 1;
+
+					/* SMT dynamic mode.  Cede will result 
+					 * in this thread going dormant, if the
+					 * partner thread is still doing work.
+					 * Thread wakes up if partner goes idle,
+					 * an interrupt is presented, or a prod
+					 * occurs.  Returning from the cede
+					 * enables external interrupts.
+					 */
+					cede_processor();
+
+					lpaca->yielded = 0;
+				} else {
+					/* Give the HV an opportunity at the
+					 * processor, since we are not doing
+					 * any work.
+					 */
+					poll_pending();
+				}
+			}
+		} else {
+			set_need_resched();
+		}
+
+		HMT_medium();
+		lpaca->xLpPaca.xIdle = 0;
+		schedule();
+	}
+	return 0;
+}
+
+int shared_idle(void)
+{
+	struct paca_struct *lpaca = get_paca();
+
+	while (1) {
+		/* Indicate to the HV that we are idle.  Now would be
+		 * a good time to find other work to dispatch. */
+		lpaca->xLpPaca.xIdle = 1;
+
+		if (!need_resched()) {
+			local_irq_disable(); 
+			lpaca->yielded = 1;
+			
+			/* 
+			 * Yield the processor to the hypervisor.  We return if
+			 * an external interrupt occurs (which are driven prior
+			 * to returning here) or if a prod occurs from another 
+			 * processor.  When returning here, external interrupts 
+			 * are enabled.
+			 */
+			cede_processor();
+			
+			lpaca->yielded = 0;
+		}
+
+		HMT_medium();
+		lpaca->xLpPaca.xIdle = 0;
+		schedule();
+	}
+
+	return 0;
+}
+#endif
+
+int cpu_idle(void)
+{
+	idle_loop();
+	return 0; 
+}
 
-void default_idle(void)
+int idle_setup(void)
 {
-	barrier();
+#ifdef CONFIG_PPC_ISERIES
+	idle_loop = iSeries_idle;
+#else
+	if (systemcfg->platform & PLATFORM_PSERIES) {
+		if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
+			if(get_paca()->xLpPaca.xSharedProc) {
+				printk("idle = shared_idle\n");
+				idle_loop = shared_idle;
+			} else {
+				printk("idle = dedicated_idle\n");
+				idle_loop = dedicated_idle;
+			}
+		} else {
+			printk("idle = default_idle\n");
+			idle_loop = default_idle;
+		}
+	} else {
+		printk("idle_setup: unknown platform, use default_idle\n");
+		idle_loop = default_idle;
+	}
+#endif
+
+	return 1;
 }
+
diff -Nru a/arch/ppc64/kernel/irq.c b/arch/ppc64/kernel/irq.c
--- a/arch/ppc64/kernel/irq.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc64/kernel/irq.c	Tue Feb  3 19:45:17 2004
@@ -59,7 +59,6 @@
 extern void iSeries_smp_message_recv( struct pt_regs * );
 #endif
 
-volatile unsigned char *chrp_int_ack_special;
 static void register_irq_proc (unsigned int irq);
 
 irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = {
@@ -300,7 +299,7 @@
 	spin_lock_irqsave(&desc->lock, flags);
 	switch (desc->depth) {
 	case 1: {
-		unsigned int status = desc->status & ~(IRQ_DISABLED | IRQ_INPROGRESS);
+		unsigned int status = desc->status & ~IRQ_DISABLED;
 		desc->status = status;
 		if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) {
 			desc->status = status | IRQ_REPLAY;
@@ -561,17 +560,14 @@
 	spin_unlock(&desc->lock);
 }
 
+#ifdef CONFIG_PPC_ISERIES
 int do_IRQ(struct pt_regs *regs)
 {
-	int irq, first = 1;
-#ifdef CONFIG_PPC_ISERIES
 	struct paca_struct *lpaca;
 	struct ItLpQueue *lpq;
-#endif
 
 	irq_enter();
 
-#ifdef CONFIG_PPC_ISERIES
 	lpaca = get_paca();
 #ifdef CONFIG_SMP
 	if (lpaca->xLpPaca.xIntDword.xFields.xIpiCnt) {
@@ -582,7 +578,26 @@
 	lpq = lpaca->lpQueuePtr;
 	if (lpq && ItLpQueue_isLpIntPending(lpq))
 		lpEvent_count += ItLpQueue_process(lpq, regs);
-#else
+
+	irq_exit();
+
+	if (lpaca->xLpPaca.xIntDword.xFields.xDecrInt) {
+		lpaca->xLpPaca.xIntDword.xFields.xDecrInt = 0;
+		/* Signal a fake decrementer interrupt */
+		timer_interrupt(regs);
+	}
+
+	return 1; /* lets ret_from_int know we can do checks */
+}
+
+#else	/* CONFIG_PPC_ISERIES */
+
+int do_IRQ(struct pt_regs *regs)
+{
+	int irq, first = 1;
+
+	irq_enter();
+
 	/*
 	 * Every arch is required to implement ppc_md.get_irq.
 	 * This function will either return an irq number or -1 to
@@ -598,20 +613,12 @@
 	if (irq != -2 && first)
 		/* That's not SMP safe ... but who cares ? */
 		ppc_spurious_interrupts++;
-#endif
 
 	irq_exit();
 
-#ifdef CONFIG_PPC_ISERIES
-	if (lpaca->xLpPaca.xIntDword.xFields.xDecrInt) {
-		lpaca->xLpPaca.xIntDword.xFields.xDecrInt = 0;
-		/* Signal a fake decrementer interrupt */
-		timer_interrupt(regs);
-	}
-#endif
-
 	return 1; /* lets ret_from_int know we can do checks */
 }
+#endif	/* CONFIG_PPC_ISERIES */
 
 unsigned long probe_irq_on (void)
 {
@@ -636,10 +643,10 @@
 {
 	static int once = 0;
 
-	if ( once )
+	if (once)
 		return;
-	else
-		once++;
+
+	once++;
 	
 	ppc_md.init_IRQ();
 }
diff -Nru a/arch/ppc64/kernel/lparcfg.c b/arch/ppc64/kernel/lparcfg.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/ppc64/kernel/lparcfg.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,584 @@
+/*
+ * PowerPC64 LPAR Configuration Information Driver
+ *
+ * Dave Engebretsen engebret@us.ibm.com
+ *    Copyright (c) 2003 Dave Engebretsen
+ * Will Schmidt willschm@us.ibm.com
+ *    SPLPAR updates, Copyright (c) 2003 Will Schmidt IBM Corporation.
+ * Nathan Lynch nathanl@austin.ibm.com
+ *    Added lparcfg_write, Copyright (C) 2004 Nathan Lynch IBM Corporation.
+ *
+ *      This program is free software; you can redistribute it and/or
+ *      modify it under the terms of the GNU General Public License
+ *      as published by the Free Software Foundation; either version
+ *      2 of the License, or (at your option) any later version.
+ *
+ * This driver creates a proc file at /proc/ppc64/lparcfg which contains
+ * keyword - value pairs that specify the configuration of the partition.
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/proc_fs.h>
+#include <linux/init.h>
+#include <asm/uaccess.h>
+#include <asm/iSeries/HvLpConfig.h>
+#include <asm/iSeries/ItLpPaca.h>
+#include <asm/hvcall.h>
+#include <asm/cputable.h>
+
+#define MODULE_VERSION "1.0"
+#define MODULE_NAME "lparcfg"
+
+static struct proc_dir_entry *proc_ppc64_lparcfg;
+#define LPARCFG_BUFF_SIZE 4096
+
+#ifdef CONFIG_PPC_ISERIES
+
+#define lparcfg_write NULL
+
+static unsigned char e2a(unsigned char x)
+{
+        switch (x) {
+        case 0xF0:
+                return '0';
+        case 0xF1:
+                return '1';
+        case 0xF2:
+                return '2';
+        case 0xF3:
+                return '3';
+        case 0xF4:
+                return '4';
+        case 0xF5:
+                return '5';
+        case 0xF6:
+                return '6';
+        case 0xF7:
+                return '7';
+        case 0xF8:
+                return '8';
+        case 0xF9:
+                return '9';
+        case 0xC1:
+                return 'A';
+        case 0xC2:
+                return 'B';
+        case 0xC3:
+                return 'C';
+        case 0xC4:
+                return 'D';
+        case 0xC5:
+                return 'E';
+        case 0xC6:
+                return 'F';
+        case 0xC7:
+                return 'G';
+        case 0xC8:
+                return 'H';
+        case 0xC9:
+                return 'I';
+        case 0xD1:
+                return 'J';
+        case 0xD2:
+                return 'K';
+        case 0xD3:
+                return 'L';
+        case 0xD4:
+                return 'M';
+        case 0xD5:
+                return 'N';
+        case 0xD6:
+                return 'O';
+        case 0xD7:
+                return 'P';
+        case 0xD8:
+                return 'Q';
+        case 0xD9:
+                return 'R';
+        case 0xE2:
+                return 'S';
+        case 0xE3:
+                return 'T';
+        case 0xE4:
+                return 'U';
+        case 0xE5:
+                return 'V';
+        case 0xE6:
+                return 'W';
+        case 0xE7:
+                return 'X';
+        case 0xE8:
+                return 'Y';
+        case 0xE9:
+                return 'Z';
+        }
+        return ' ';
+}
+
+/* 
+ * Methods used to fetch LPAR data when running on an iSeries platform.
+ */
+static int lparcfg_data(unsigned char *buf, unsigned long size)
+{
+	unsigned long n = 0, pool_id, lp_index; 
+	int shared, entitled_capacity, max_entitled_capacity;
+	int processors, max_processors;
+	struct paca_struct *lpaca = get_paca();
+
+	if((buf == NULL) || (size > LPARCFG_BUFF_SIZE)) {
+		return -EFAULT;
+	}
+	memset(buf, 0, size); 
+
+	shared = (int)(lpaca->xLpPacaPtr->xSharedProc);
+	n += snprintf(buf, LPARCFG_BUFF_SIZE - n,
+		      "serial_number=%c%c%c%c%c%c%c\n", 
+		      e2a(xItExtVpdPanel.mfgID[2]),
+		      e2a(xItExtVpdPanel.mfgID[3]),
+		      e2a(xItExtVpdPanel.systemSerial[1]),
+		      e2a(xItExtVpdPanel.systemSerial[2]),
+		      e2a(xItExtVpdPanel.systemSerial[3]),
+		      e2a(xItExtVpdPanel.systemSerial[4]),
+		      e2a(xItExtVpdPanel.systemSerial[5])); 
+
+	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		      "system_type=%c%c%c%c\n",
+		      e2a(xItExtVpdPanel.machineType[0]),
+		      e2a(xItExtVpdPanel.machineType[1]),
+		      e2a(xItExtVpdPanel.machineType[2]),
+		      e2a(xItExtVpdPanel.machineType[3])); 
+
+	lp_index = HvLpConfig_getLpIndex(); 
+	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		      "partition_id=%d\n", (int)lp_index); 
+
+	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		      "system_active_processors=%d\n", 
+		      (int)HvLpConfig_getSystemPhysicalProcessors()); 
+
+	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		      "system_potential_processors=%d\n", 
+		      (int)HvLpConfig_getSystemPhysicalProcessors()); 
+
+	processors = (int)HvLpConfig_getPhysicalProcessors(); 
+	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		      "partition_active_processors=%d\n", processors);  
+
+	max_processors = (int)HvLpConfig_getMaxPhysicalProcessors(); 
+	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		      "partition_potential_processors=%d\n", max_processors);  
+
+	if(shared) {
+		entitled_capacity = HvLpConfig_getSharedProcUnits(); 
+		max_entitled_capacity = HvLpConfig_getMaxSharedProcUnits(); 
+	} else {
+		entitled_capacity = processors * 100; 
+		max_entitled_capacity = max_processors * 100; 
+	}
+	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		      "partition_entitled_capacity=%d\n", entitled_capacity);
+
+	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		      "partition_max_entitled_capacity=%d\n", 
+		      max_entitled_capacity);
+
+	if(shared) {
+		pool_id = HvLpConfig_getSharedPoolIndex(); 
+		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, "pool=%d\n", 
+			      (int)pool_id); 
+		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+			      "pool_capacity=%d\n", (int)(HvLpConfig_getNumProcsInSharedPool(pool_id)*100)); 
+	}
+
+	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		      "shared_processor_mode=%d\n", shared);
+
+	return 0;
+}
+#endif /* CONFIG_PPC_ISERIES */
+
+#ifdef CONFIG_PPC_PSERIES
+/* 
+ * Methods used to fetch LPAR data when running on a pSeries platform.
+ */
+
+/*
+ * H_GET_PPP hcall returns info in 4 parms.
+ *  entitled_capacity,unallocated_capacity,
+ *  aggregation, resource_capability).
+ *
+ *  R4 = Entitled Processor Capacity Percentage. 
+ *  R5 = Unallocated Processor Capacity Percentage.
+ *  R6 (AABBCCDDEEFFGGHH).
+ *      XXXX - reserved (0)
+ *          XXXX - reserved (0)
+ *              XXXX - Group Number
+ *                  XXXX - Pool Number.
+ *  R7 (PPOONNMMLLKKJJII)
+ *      XX - reserved. (0)
+ *        XX - bit 0-6 reserved (0).   bit 7 is Capped indicator.
+ *          XX - variable processor Capacity Weight
+ *            XX - Unallocated Variable Processor Capacity Weight.
+ *              XXXX - Active processors in Physical Processor Pool.
+ *                  XXXX  - Processors active on platform. 
+ */
+unsigned int h_get_ppp(unsigned long *entitled,unsigned long  *unallocated,unsigned long *aggregation,unsigned long *resource)
+{
+	unsigned long rc;
+	rc = plpar_hcall_4out(H_GET_PPP,0,0,0,0,entitled,unallocated,aggregation,resource);
+	return 0;
+}
+
+/*
+ * get_splpar_potential_characteristics().
+ * Retrieve the potential_processors and max_entitled_capacity values
+ * through the get-system-parameter rtas call.
+ */
+#define SPLPAR_CHARACTERISTICS_TOKEN 20
+#define SPLPAR_MAXLENGTH 1026*(sizeof(char))
+unsigned int get_splpar_potential_characteristics(void)
+{
+	/* return 0 for now.  Underlying rtas functionality is not yet complete. 12/01/2003*/
+	return 0; 
+#if 0 
+	long call_status;
+	unsigned long ret[2];
+
+	char * buffer = kmalloc(SPLPAR_MAXLENGTH, GFP_KERNEL);
+
+	printk("token for ibm,get-system-parameter (0x%x)\n",rtas_token("ibm,get-system-parameter"));
+
+	call_status = rtas_call(rtas_token("ibm,get-system-parameter"), 3, 1,
+				NULL,
+				SPLPAR_CHARACTERISTICS_TOKEN,
+				&buffer,
+				SPLPAR_MAXLENGTH,
+				(void *)&ret);
+
+	if (call_status!=0) {
+		printk("Error calling get-system-parameter (0x%lx)\n",call_status);
+		kfree(buffer);
+		return -1;
+	} else {
+		printk("get-system-parameter (%s)\n",buffer);
+		kfree(buffer);
+		/* TODO: Add code here to parse out value for system_potential_processors and partition_max_entitled_capacity */
+		return 1;
+	}
+#endif
+}
+
+static int lparcfg_data(unsigned char *buf, unsigned long size)
+{
+	unsigned long n = 0;
+	int shared, max_entitled_capacity;
+	int processors, system_active_processors, system_potential_processors;
+	struct device_node *root;
+	const char *model = "";
+	const char *system_id = "";
+	unsigned int *lp_index_ptr, lp_index = 0;
+	struct device_node *rtas_node;
+	int *ip;
+	unsigned long h_entitled,h_unallocated,h_aggregation,h_resource;
+
+	if((buf == NULL) || (size > LPARCFG_BUFF_SIZE)) {
+		return -EFAULT;
+	}
+	memset(buf, 0, size); 
+
+	root = find_path_device("/");
+	if (root) {
+		model = get_property(root, "model", NULL);
+		system_id = get_property(root, "system-id", NULL);
+		lp_index_ptr = (unsigned int *)get_property(root, "ibm,partition-no", NULL);
+		if(lp_index_ptr) lp_index = *lp_index_ptr;
+	}
+
+	n  = snprintf(buf, LPARCFG_BUFF_SIZE - n,
+		      "serial_number=%s\n", system_id); 
+
+	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		      "system_type=%s\n", model); 
+
+	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		      "partition_id=%d\n", (int)lp_index); 
+
+	rtas_node = find_path_device("/rtas");
+	ip = (int *)get_property(rtas_node, "ibm,lrdr-capacity", NULL);
+	if (ip == NULL) {
+		system_active_processors = systemcfg->processorCount; 
+	} else {
+		system_active_processors = *(ip + 4);
+	}
+
+	if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
+		h_get_ppp(&h_entitled,&h_unallocated,&h_aggregation,&h_resource);
+#ifdef DEBUG
+		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+			      "R4=0x%lx\n", h_entitled);
+		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+			      "R5=0x%lx\n", h_unallocated);
+		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+			      "R6=0x%lx\n", h_aggregation);
+		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+			      "R7=0x%lx\n", h_resource);
+#endif /* DEBUG */
+	}
+
+	if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
+		system_potential_processors =  get_splpar_potential_characteristics();
+		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+			      "system_active_processors=%d\n", 
+			      (h_resource >> 2*8) & 0xffff);
+		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+			      "system_potential_processors=%d\n", 
+			      system_potential_processors);
+	} else {
+		system_potential_processors = system_active_processors;
+		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+			      "system_active_processors=%d\n", 
+			      system_active_processors);
+		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+			      "system_potential_processors=%d\n", 
+			      system_potential_processors);
+	}
+
+	processors = systemcfg->processorCount;
+	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		      "partition_active_processors=%d\n", processors);  
+	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		      "partition_potential_processors=%d\n",
+		      system_active_processors);
+
+	/* max_entitled_capacity will come out of get_splpar_potential_characteristics() when that function is complete */
+	max_entitled_capacity = system_active_processors * 100; 
+	if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
+		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+			      "partition_entitled_capacity=%ld\n", h_entitled);
+	} else {
+		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+			      "partition_entitled_capacity=%d\n", system_active_processors*100);
+	}
+
+	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		      "partition_max_entitled_capacity=%d\n", 
+		      max_entitled_capacity);
+
+	shared = 0;
+	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		      "shared_processor_mode=%d\n", shared);
+
+	if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
+		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+			      "pool=%d\n", (h_aggregation >> 0*8)&0xffff);
+
+		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+			      "pool_capacity=%d\n", (h_resource >> 3*8) &0xffff);
+
+		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+			      "group=%d\n", (h_aggregation >> 2*8)&0xffff);
+
+		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+			      "capped=%d\n", (h_resource >> 6*8)&0x40);
+
+		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+			      "capacity_weight=%d\n", (int)(h_resource>>5*8)&0xFF);
+	}
+	return 0;
+}
+
+/*
+ * Interface for changing system parameters (variable capacity weight
+ * and entitled capacity).  Format of input is "param_name=value";
+ * anything after value is ignored.  Valid parameters at this time are
+ * "partition_entitled_capacity" and "capacity_weight".  We use
+ * H_SET_PPP to alter parameters.
+ *
+ * This function should be invoked only on systems with
+ * FW_FEATURE_SPLPAR.
+ */
+static ssize_t lparcfg_write(struct file *file, const char __user *buf, size_t count, loff_t *off)
+{
+	char *kbuf;
+	char *tmp;
+	u64 new_entitled, *new_entitled_ptr = &new_entitled;
+	u8 new_weight, *new_weight_ptr = &new_weight;
+
+	unsigned long current_entitled;    /* parameters for h_get_ppp */
+	unsigned long dummy;
+	unsigned long resource;
+	u8 current_weight;
+
+	ssize_t retval = -ENOMEM;
+
+	kbuf = kmalloc(count, GFP_KERNEL);
+	if (!kbuf)
+		goto out;
+
+	retval = -EFAULT;
+	if (copy_from_user(kbuf, buf, count))
+		goto out;
+
+	retval = -EINVAL;
+	kbuf[count - 1] = '\0';
+	tmp = strchr(kbuf, '=');
+	if (!tmp)
+		goto out;
+
+	*tmp++ = '\0';
+
+	if (!strcmp(kbuf, "partition_entitled_capacity")) {
+		char *endp;
+		*new_entitled_ptr = (u64)simple_strtoul(tmp, &endp, 10);
+		if (endp == tmp)
+			goto out;
+		new_weight_ptr = &current_weight;
+	} else if (!strcmp(kbuf, "capacity_weight")) {
+		char *endp;
+		*new_weight_ptr = (u8)simple_strtoul(tmp, &endp, 10);
+		if (endp == tmp)
+			goto out;
+		new_entitled_ptr = &current_entitled;
+	} else
+		goto out;
+
+	/* Get our current parameters */
+	retval = h_get_ppp(&current_entitled, &dummy, &dummy, &resource);
+	if (retval) {
+		retval = -EIO;
+		goto out;
+	}
+
+	current_weight = (resource>>5*8)&0xFF;
+
+	pr_debug("%s: current_entitled = %lu, current_weight = %lu\n",
+		 __FUNCTION__, current_entitled, current_weight);
+
+	pr_debug("%s: new_entitled = %lu, new_weight = %lu\n",
+		 __FUNCTION__, *new_entitled_ptr, *new_weight_ptr);
+
+	retval = plpar_hcall_norets(H_SET_PPP, *new_entitled_ptr,
+				    *new_weight_ptr);
+
+	if (retval == H_Success || retval == H_Constrained) {
+		retval = count;
+	} else if (retval == H_Busy) {
+		retval = -EBUSY;
+	} else if (retval == H_Hardware) {
+		retval = -EIO;
+	} else if (retval == H_Parameter) {
+		retval = -EINVAL;
+	} else {
+		printk(KERN_WARNING "%s: received unknown hv return code %ld",
+		       __FUNCTION__, retval);
+		retval = -EIO;
+	}
+
+out:
+	kfree(kbuf);
+	return retval;
+}
+
+#endif /* CONFIG_PPC_PSERIES */
+
+
+static ssize_t lparcfg_read(struct file *file, char *buf,
+			    size_t count, loff_t *ppos)
+{
+	struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode);
+	unsigned long *data = (unsigned long *)dp->data;
+	unsigned long p;
+	ssize_t read;
+	char * pnt;
+
+	if (!data) {
+		printk(KERN_ERR "lparcfg: read failed no data\n");
+		return -EIO;
+	}
+
+	if(ppos) {
+		p = *ppos;
+	} else {
+		return -EFAULT;
+	}
+
+	if (p >= LPARCFG_BUFF_SIZE) return 0;
+
+	lparcfg_data((unsigned char *)data, LPARCFG_BUFF_SIZE); 
+	if (count > (strlen((char *)data) - p))
+		count = (strlen((char *)data)) - p;
+	read = 0;
+
+	pnt = (char *)(data) + p;
+	copy_to_user(buf, (void *)pnt, count);
+	read += count;
+	*ppos += read;
+	return read;
+}
+
+static int lparcfg_open(struct inode * inode, struct file * file)
+{
+	struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode);
+	unsigned int *data = (unsigned int *)dp->data;
+
+	if (!data) {
+		printk(KERN_ERR "lparcfg: open failed no data\n");
+		return -EIO;
+	}
+
+	return 0;
+}
+
+struct file_operations lparcfg_fops = {
+	owner:		THIS_MODULE,
+	read:		lparcfg_read,
+	open:		lparcfg_open,
+};
+
+int __init lparcfg_init(void)
+{
+	struct proc_dir_entry *ent;
+	mode_t mode = S_IRUSR;
+
+	/* Allow writing if we have FW_FEATURE_SPLPAR */
+	if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
+		lparcfg_fops.write = lparcfg_write;
+		mode |= S_IWUSR;
+	}
+
+	ent = create_proc_entry("ppc64/lparcfg", mode, NULL);
+	if (ent) {
+		ent->proc_fops = &lparcfg_fops;
+		ent->data = kmalloc(LPARCFG_BUFF_SIZE, GFP_KERNEL);
+		if (!ent->data) {
+			printk(KERN_ERR "Failed to allocate buffer for lparcfg\n");
+			remove_proc_entry("lparcfg", ent->parent);
+			return -ENOMEM;
+		}
+	} else {
+		printk(KERN_ERR "Failed to create ppc64/lparcfg\n");
+		return -EIO;
+	}
+
+	proc_ppc64_lparcfg = ent;
+	return 0;
+}
+
+void __exit lparcfg_cleanup(void)
+{
+	if (proc_ppc64_lparcfg) {
+		if (proc_ppc64_lparcfg->data) {
+		    kfree(proc_ppc64_lparcfg->data);
+		}
+		remove_proc_entry("lparcfg", proc_ppc64_lparcfg->parent);
+	}
+}
+
+module_init(lparcfg_init);
+module_exit(lparcfg_cleanup);
+MODULE_DESCRIPTION("Interface for LPAR configuration data");
+MODULE_AUTHOR("Dave Engebretsen");
+MODULE_LICENSE("GPL");
diff -Nru a/arch/ppc64/kernel/mf.c b/arch/ppc64/kernel/mf.c
--- a/arch/ppc64/kernel/mf.c	Tue Feb  3 19:45:35 2004
+++ b/arch/ppc64/kernel/mf.c	Tue Feb  3 19:45:35 2004
@@ -36,166 +36,125 @@
 #include <asm/nvram.h>
 #include <asm/time.h>
 #include <asm/iSeries/ItSpCommArea.h>
-#include <asm/iSeries/mf_proc.h>
 #include <asm/iSeries/iSeries_proc.h>
 #include <asm/uaccess.h>
 #include <linux/pci.h>
 #include <linux/bcd.h>
 
-extern struct pci_dev * iSeries_vio_dev;
+extern struct pci_dev *iSeries_vio_dev;
 
 /*
  * This is the structure layout for the Machine Facilites LPAR event
  * flows.
  */
-struct VspCmdData;
-struct CeMsgData;
-union SafeCast
-{
-	u64 ptrAsU64;
+union safe_cast {
+	u64 ptr_as_u64;
 	void *ptr;
 };
 
+struct VspCmdData {
+	union safe_cast token;
+	u16 cmd;
+	HvLpIndex lp_index;
+	u8 result_code;
+	u32 reserved;
+	union {
+		u64 state;	/* GetStateOut */
+		u64 ipl_type;	/* GetIplTypeOut, Function02SelectIplTypeIn */
+		u64 ipl_mode;	/* GetIplModeOut, Function02SelectIplModeIn */
+		u64 page[4];	/* GetSrcHistoryIn */
+		u64 flag;	/* GetAutoIplWhenPrimaryIplsOut,
+				   SetAutoIplWhenPrimaryIplsIn,
+				   WhiteButtonPowerOffIn,
+				   Function08FastPowerOffIn,
+				   IsSpcnRackPowerIncompleteOut */
+		struct {
+			u64 token;
+			u64 address_type;
+			u64 side;
+			u32 length;
+			u32 offset;
+		} kern;		/* SetKernelImageIn, GetKernelImageIn,
+				   SetKernelCmdLineIn, GetKernelCmdLineIn */
+		u32 length_out;	/* GetKernelImageOut, GetKernelCmdLineOut */
+		u8 reserved[80];
+	} sub_data;
+};
 
-typedef void (*CeMsgCompleteHandler)( void *token, struct CeMsgData *vspCmdRsp );
-
-struct CeMsgCompleteData
-{
-	CeMsgCompleteHandler xHdlr;
-	void *xToken;
+struct VspRspData {
+	struct semaphore *sem;
+	struct VspCmdData *response;
 };
 
-struct VspRspData
-{
-	struct semaphore *xSemaphore;
-	struct VspCmdData *xResponse;
+struct AllocData {
+	u16 size;
+	u16 type;
+	u32 count;
+	u16 reserved1;
+	u8 reserved2;
+	HvLpIndex target_lp;
 };
 
-struct IoMFLpEvent
-{
-	struct HvLpEvent xHvLpEvent;
+struct CeMsgData;
 
-	u16 xSubtypeRc;
-	u16 xRsvd1;
-	u32 xRsvd2;
-
-	union
-	{
-
-		struct AllocData
-		{
-			u16 xSize;
-			u16 xType;
-			u32 xCount;
-			u16 xRsvd3;
-			u8 xRsvd4;
-			HvLpIndex xTargetLp;
-		} xAllocData;
-
-		struct CeMsgData
-		{
-			u8 xCEMsg[12];
-			char xReserved[4];
-			struct CeMsgCompleteData *xToken;
-		} xCEMsgData;
-
-		struct VspCmdData
-		{
-			union SafeCast xTokenUnion;
-			u16 xCmd;
-			HvLpIndex xLpIndex;
-			u8 xRc;
-			u32 xReserved1;
+typedef void (*CeMsgCompleteHandler)(void *token, struct CeMsgData *vspCmdRsp);
 
-			union VspCmdSubData
-			{
-				struct
-				{
-					u64 xState;
-				} xGetStateOut;
-
-				struct
-				{
-					u64 xIplType;
-				} xGetIplTypeOut, xFunction02SelectIplTypeIn;
-
-				struct
-				{
-					u64 xIplMode;
-				} xGetIplModeOut, xFunction02SelectIplModeIn;
-
-				struct
-				{
-					u64 xPage[4];
-				} xGetSrcHistoryIn;
-
-				struct
-				{
-					u64 xFlag;
-				} xGetAutoIplWhenPrimaryIplsOut,
-					xSetAutoIplWhenPrimaryIplsIn,
-					xWhiteButtonPowerOffIn,
-					xFunction08FastPowerOffIn,
-					xIsSpcnRackPowerIncompleteOut;
-
-				struct
-				{
-					u64 xToken;
-					u64 xAddressType;
-					u64 xSide;
-					u32 xTransferLength;
-					u32 xOffset;
-				} xSetKernelImageIn,
-					xGetKernelImageIn,
-					xSetKernelCmdLineIn,
-					xGetKernelCmdLineIn;
-
-				struct
-				{
-					u32 xTransferLength;
-				} xGetKernelImageOut,xGetKernelCmdLineOut;
-
-
-				u8 xReserved2[80];
-
-			} xSubData;
-		} xVspCmd;
-	} xUnion;
+struct CeMsgCompleteData {
+	CeMsgCompleteHandler handler;
+	void *token;
 };
 
+struct CeMsgData {
+	u8 ce_msg[12];
+	char reserved[4];
+	struct CeMsgCompleteData *completion;
+};
+
+struct IoMFLpEvent {
+	struct HvLpEvent hp_lp_event;
+	u16 subtype_result_code;
+	u16 reserved1;
+	u32 reserved2;
+	union {
+		struct AllocData alloc;
+		struct CeMsgData ce_msg;
+		struct VspCmdData vsp_cmd;
+	} data;
+};
+
+#define subtype_data(a, b, c, d)	\
+		(((a) << 24) + ((b) << 16) + ((c) << 8) + (d))
 
 /*
  * All outgoing event traffic is kept on a FIFO queue.  The first
  * pointer points to the one that is outstanding, and all new
  * requests get stuck on the end.  Also, we keep a certain number of
- * preallocated stack elements so that we can operate very early in
+ * preallocated pending events so that we can operate very early in
  * the boot up sequence (before kmalloc is ready).
  */
-struct StackElement
-{
-	struct StackElement * next;
+struct pending_event {
+	struct pending_event *next;
 	struct IoMFLpEvent event;
 	MFCompleteHandler hdlr;
-	char dmaData[72];
-	unsigned dmaDataLength;
-	unsigned remoteAddress;
+	char dma_data[72];
+	unsigned dma_data_length;
+	unsigned remote_address;
 };
-static spinlock_t spinlock;
-static struct StackElement * head = NULL;
-static struct StackElement * tail = NULL;
-static struct StackElement * avail = NULL;
-static struct StackElement prealloc[16];
+static spinlock_t pending_event_spinlock;
+static struct pending_event *pending_event_head;
+static struct pending_event *pending_event_tail;
+static struct pending_event *pending_event_avail;
+static struct pending_event pending_event_prealloc[16];
 
 /*
- * Put a stack element onto the available queue, so it can get reused.
- * Attention! You must have the spinlock before calling!
+ * Put a pending event onto the available queue, so it can get reused.
+ * Attention! You must have the pending_event_spinlock before calling!
  */
-void free( struct StackElement * element )
+static void free_pending_event(struct pending_event *ev)
 {
-	if ( element != NULL )
-	{
-		element->next = avail;
-		avail = element;
+	if (ev != NULL) {
+		ev->next = pending_event_avail;
+		pending_event_avail = ev;
 	}
 }
 
@@ -203,68 +162,68 @@
  * Enqueue the outbound event onto the stack.  If the queue was
  * empty to begin with, we must also issue it via the Hypervisor
  * interface.  There is a section of code below that will touch
- * the first stack pointer without the protection of the spinlock.
+ * the first stack pointer without the protection of the pending_event_spinlock.
  * This is OK, because we know that nobody else will be modifying
  * the first pointer when we do this.
  */
-static int signalEvent( struct StackElement * newElement )
+static int signal_event(struct pending_event *ev)
 {
 	int rc = 0;
 	unsigned long flags;
 	int go = 1;
-	struct StackElement * element;
+	struct pending_event *ev1;
 	HvLpEvent_Rc hvRc;
 
 	/* enqueue the event */
-	if ( newElement != NULL )
-	{
-		spin_lock_irqsave( &spinlock, flags );
-		if ( head == NULL )
-			head = newElement;
+	if (ev != NULL) {
+		ev->next = NULL;
+		spin_lock_irqsave(&pending_event_spinlock, flags);
+		if (pending_event_head == NULL)
+			pending_event_head = ev;
 		else {
 			go = 0;
-			tail->next = newElement;
+			pending_event_tail->next = ev;
 		}
-		newElement->next = NULL;
-		tail = newElement;
-		spin_unlock_irqrestore( &spinlock, flags );
+		pending_event_tail = ev;
+		spin_unlock_irqrestore(&pending_event_spinlock, flags);
 	}
 
 	/* send the event */
-	while ( go )
-	{
+	while (go) {
 		go = 0;
 
 		/* any DMA data to send beforehand? */
-		if ( head->dmaDataLength > 0 )
-			HvCallEvent_dmaToSp( head->dmaData, head->remoteAddress, head->dmaDataLength, HvLpDma_Direction_LocalToRemote );
-
-		hvRc = HvCallEvent_signalLpEvent(&head->event.xHvLpEvent);
-		if ( hvRc != HvLpEvent_Rc_Good )
-		{
-			printk( KERN_ERR "mf.c: HvCallEvent_signalLpEvent() failed with %d\n", (int)hvRc );
-
-			spin_lock_irqsave( &spinlock, flags );
-			element = head;
-			head = head->next;
-			if ( head != NULL )
+		if (pending_event_head->dma_data_length > 0)
+			HvCallEvent_dmaToSp(pending_event_head->dma_data,
+					pending_event_head->remote_address,
+					pending_event_head->dma_data_length,
+					HvLpDma_Direction_LocalToRemote);
+
+		hvRc = HvCallEvent_signalLpEvent(
+				&pending_event_head->event.hp_lp_event);
+		if (hvRc != HvLpEvent_Rc_Good) {
+			printk(KERN_ERR "mf.c: HvCallEvent_signalLpEvent() failed with %d\n",
+					(int)hvRc);
+
+			spin_lock_irqsave(&pending_event_spinlock, flags);
+			ev1 = pending_event_head;
+			pending_event_head = pending_event_head->next;
+			if (pending_event_head != NULL)
 				go = 1;
-			spin_unlock_irqrestore( &spinlock, flags );
+			spin_unlock_irqrestore(&pending_event_spinlock, flags);
 
-			if ( element == newElement )
+			if (ev1 == ev)
 				rc = -EIO;
-			else {
-				if ( element->hdlr != NULL )
-				{
-					union SafeCast mySafeCast;
-					mySafeCast.ptrAsU64 = element->event.xHvLpEvent.xCorrelationToken;
-					(*element->hdlr)( mySafeCast.ptr, -EIO );
-				}
+			else if (ev1->hdlr != NULL) {
+				union safe_cast mySafeCast;
+
+				mySafeCast.ptr_as_u64 = ev1->event.hp_lp_event.xCorrelationToken;
+				(*ev1->hdlr)(mySafeCast.ptr, -EIO);
 			}
 
-			spin_lock_irqsave( &spinlock, flags );
-			free( element );
-			spin_unlock_irqrestore( &spinlock, flags );
+			spin_lock_irqsave(&pending_event_spinlock, flags);
+			free_pending_event(ev1);
+			spin_unlock_irqrestore(&pending_event_spinlock, flags);
 		}
 	}
 
@@ -272,80 +231,74 @@
 }
 
 /*
- * Allocate a new StackElement structure, and initialize it.
+ * Allocate a new pending_event structure, and initialize it.
  */
-static struct StackElement * newStackElement( void )
+static struct pending_event *new_pending_event(void)
 {
-	struct StackElement * newElement = NULL;
+	struct pending_event *ev = NULL;
 	HvLpIndex primaryLp = HvLpConfig_getPrimaryLpIndex();
 	unsigned long flags;
+	struct HvLpEvent *hev;
 
-	if ( newElement == NULL )
-	{
-		spin_lock_irqsave( &spinlock, flags );
-		if ( avail != NULL )
-		{
-			newElement = avail;
-			avail = avail->next;
-		}
-		spin_unlock_irqrestore( &spinlock, flags );
-	}
-
-	if ( newElement == NULL )
-		newElement = kmalloc(sizeof(struct StackElement),GFP_ATOMIC);
-
-	if ( newElement == NULL )
-	{
-		printk( KERN_ERR "mf.c: unable to kmalloc %ld bytes\n", sizeof(struct StackElement) );
+	spin_lock_irqsave(&pending_event_spinlock, flags);
+	if (pending_event_avail != NULL) {
+		ev = pending_event_avail;
+		pending_event_avail = pending_event_avail->next;
+	}
+	spin_unlock_irqrestore(&pending_event_spinlock, flags);
+	if (ev == NULL)
+		ev = kmalloc(sizeof(struct pending_event),GFP_ATOMIC);
+	if (ev == NULL) {
+		printk(KERN_ERR "mf.c: unable to kmalloc %ld bytes\n",
+				sizeof(struct pending_event));
 		return NULL;
 	}
+	memset(ev, 0, sizeof(struct pending_event));
+	hev = &ev->event.hp_lp_event;
+	hev->xFlags.xValid = 1;
+	hev->xFlags.xAckType = HvLpEvent_AckType_ImmediateAck;
+	hev->xFlags.xAckInd = HvLpEvent_AckInd_DoAck;
+	hev->xFlags.xFunction = HvLpEvent_Function_Int;
+	hev->xType = HvLpEvent_Type_MachineFac;
+	hev->xSourceLp = HvLpConfig_getLpIndex();
+	hev->xTargetLp = primaryLp;
+	hev->xSizeMinus1 = sizeof(ev->event)-1;
+	hev->xRc = HvLpEvent_Rc_Good;
+	hev->xSourceInstanceId = HvCallEvent_getSourceLpInstanceId(primaryLp,
+			HvLpEvent_Type_MachineFac);
+	hev->xTargetInstanceId = HvCallEvent_getTargetLpInstanceId(primaryLp,
+			HvLpEvent_Type_MachineFac);
 
-	memset( newElement, 0, sizeof(struct StackElement) );
-	newElement->event.xHvLpEvent.xFlags.xValid = 1;
-	newElement->event.xHvLpEvent.xFlags.xAckType = HvLpEvent_AckType_ImmediateAck;
-	newElement->event.xHvLpEvent.xFlags.xAckInd = HvLpEvent_AckInd_DoAck;
-	newElement->event.xHvLpEvent.xFlags.xFunction = HvLpEvent_Function_Int;
-	newElement->event.xHvLpEvent.xType = HvLpEvent_Type_MachineFac;
-	newElement->event.xHvLpEvent.xSourceLp = HvLpConfig_getLpIndex();
-	newElement->event.xHvLpEvent.xTargetLp = primaryLp;
-	newElement->event.xHvLpEvent.xSizeMinus1 = sizeof(newElement->event)-1;
-	newElement->event.xHvLpEvent.xRc = HvLpEvent_Rc_Good;
-	newElement->event.xHvLpEvent.xSourceInstanceId = HvCallEvent_getSourceLpInstanceId(primaryLp,HvLpEvent_Type_MachineFac);
-	newElement->event.xHvLpEvent.xTargetInstanceId = HvCallEvent_getTargetLpInstanceId(primaryLp,HvLpEvent_Type_MachineFac);
-
-	return newElement;
+	return ev;
 }
 
-static int signalVspInstruction( struct VspCmdData *vspCmd )
+static int signal_vsp_instruction(struct VspCmdData *vspCmd)
 {
-	struct StackElement * newElement = newStackElement();
-	int rc = 0;
+	struct pending_event *ev = new_pending_event();
+	int rc;
 	struct VspRspData response;
 	DECLARE_MUTEX_LOCKED(Semaphore);
-	response.xSemaphore = &Semaphore;
-	response.xResponse = vspCmd;
 
-	if ( newElement == NULL )
-		rc = -ENOMEM;
-	else {
-		newElement->event.xHvLpEvent.xSubtype = 6;
-		newElement->event.xHvLpEvent.x.xSubtypeData = ('M'<<24)+('F'<<16)+('V'<<8)+('I'<<0);
-		newElement->event.xUnion.xVspCmd.xTokenUnion.ptr = &response;
-		newElement->event.xUnion.xVspCmd.xCmd = vspCmd->xCmd;
-		newElement->event.xUnion.xVspCmd.xLpIndex = HvLpConfig_getLpIndex();
-		newElement->event.xUnion.xVspCmd.xRc = 0xFF;
-		newElement->event.xUnion.xVspCmd.xReserved1 = 0;
-		memcpy(&(newElement->event.xUnion.xVspCmd.xSubData),&(vspCmd->xSubData), sizeof(vspCmd->xSubData));
-		mb();
+	if (ev == NULL)
+		return -ENOMEM;
 
-		rc = signalEvent(newElement);
-	}
+	response.sem = &Semaphore;
+	response.response = vspCmd;
+	ev->event.hp_lp_event.xSubtype = 6;
+	ev->event.hp_lp_event.x.xSubtypeData =
+		subtype_data('M', 'F',  'V',  'I');
+	ev->event.data.vsp_cmd.token.ptr = &response;
+	ev->event.data.vsp_cmd.cmd = vspCmd->cmd;
+	ev->event.data.vsp_cmd.lp_index = HvLpConfig_getLpIndex();
+	ev->event.data.vsp_cmd.result_code = 0xFF;
+	ev->event.data.vsp_cmd.reserved = 0;
+	memcpy(&(ev->event.data.vsp_cmd.sub_data),
+			&(vspCmd->sub_data), sizeof(vspCmd->sub_data));
+	mb();
 
+	rc = signal_event(ev);
 	if (rc == 0)
-	{
 		down(&Semaphore);
-	}
-
 	return rc;
 }
 
@@ -353,46 +306,42 @@
 /*
  * Send a 12-byte CE message to the primary partition VSP object
  */
-static int signalCEMsg( char * ceMsg, void * token )
+static int signal_ce_msg(char *ce_msg, struct CeMsgCompleteData *completion)
 {
-	struct StackElement * newElement = newStackElement();
-	int rc = 0;
+	struct pending_event *ev = new_pending_event();
 
-	if ( newElement == NULL )
-		rc = -ENOMEM;
-	else {
-		newElement->event.xHvLpEvent.xSubtype = 0;
-		newElement->event.xHvLpEvent.x.xSubtypeData = ('M'<<24)+('F'<<16)+('C'<<8)+('E'<<0);
-		memcpy( newElement->event.xUnion.xCEMsgData.xCEMsg, ceMsg, 12 );
-		newElement->event.xUnion.xCEMsgData.xToken = token;
-		rc = signalEvent(newElement);
-	}
+	if (ev == NULL)
+		return -ENOMEM;
 
-	return rc;
+	ev->event.hp_lp_event.xSubtype = 0;
+	ev->event.hp_lp_event.x.xSubtypeData =
+		subtype_data('M',  'F',  'C',  'E');
+	memcpy(ev->event.data.ce_msg.ce_msg, ce_msg, 12);
+	ev->event.data.ce_msg.completion = completion;
+	return signal_event(ev);
 }
 
 /*
  * Send a 12-byte CE message and DMA data to the primary partition VSP object
  */
-static int dmaAndSignalCEMsg( char * ceMsg, void * token, void * dmaData, unsigned dmaDataLength, unsigned remoteAddress )
+static int dma_and_signal_ce_msg(char *ce_msg,
+		struct CeMsgCompleteData *completion, void *dma_data,
+		unsigned dma_data_length, unsigned remote_address)
 {
-	struct StackElement * newElement = newStackElement();
-	int rc = 0;
+	struct pending_event *ev = new_pending_event();
 
-	if ( newElement == NULL )
-		rc = -ENOMEM;
-	else {
-		newElement->event.xHvLpEvent.xSubtype = 0;
-		newElement->event.xHvLpEvent.x.xSubtypeData = ('M'<<24)+('F'<<16)+('C'<<8)+('E'<<0);
-		memcpy( newElement->event.xUnion.xCEMsgData.xCEMsg, ceMsg, 12 );
-		newElement->event.xUnion.xCEMsgData.xToken = token;
-		memcpy( newElement->dmaData, dmaData, dmaDataLength );
-		newElement->dmaDataLength = dmaDataLength;
-		newElement->remoteAddress = remoteAddress;
-		rc = signalEvent(newElement);
-	}
+	if (ev == NULL)
+		return -ENOMEM;
 
-	return rc;
+	ev->event.hp_lp_event.xSubtype = 0;
+	ev->event.hp_lp_event.x.xSubtypeData =
+		subtype_data('M', 'F', 'C', 'E');
+	memcpy(ev->event.data.ce_msg.ce_msg, ce_msg, 12);
+	ev->event.data.ce_msg.completion = completion;
+	memcpy(ev->dma_data, dma_data, dma_data_length);
+	ev->dma_data_length = dma_data_length;
+	ev->remote_address = remote_address;
+	return signal_event(ev);
 }
 
 /*
@@ -401,18 +350,17 @@
  * this fails (why?), we'll simply force it off in a not-so-nice
  * manner.
  */
-static int shutdown( void )
+static int shutdown(void)
 {
-	int rc = kill_proc(1,SIGINT,1);
+	int rc = kill_proc(1, SIGINT, 1);
 
-	if ( rc )
-	{
-		printk( KERN_ALERT "mf.c: SIGINT to init failed (%d), hard shutdown commencing\n", rc );
+	if (rc) {
+		printk(KERN_ALERT "mf.c: SIGINT to init failed (%d), "
+				"hard shutdown commencing\n", rc);
 		mf_powerOff();
-	}
-	else
-		printk( KERN_INFO "mf.c: init has been successfully notified to proceed with shutdown\n" );
-
+	} else
+		printk(KERN_INFO "mf.c: init has been successfully notified "
+				"to proceed with shutdown\n");
 	return rc;
 }
 
@@ -420,67 +368,64 @@
  * The primary partition VSP object is sending us a new
  * event flow.  Handle it...
  */
-static void intReceived( struct IoMFLpEvent * event )
+static void intReceived(struct IoMFLpEvent *event)
 {
 	int freeIt = 0;
-	struct StackElement * two = NULL;
+	struct pending_event *two = NULL;
+
 	/* ack the interrupt */
-	event->xHvLpEvent.xRc = HvLpEvent_Rc_Good;
-	HvCallEvent_ackLpEvent( &event->xHvLpEvent );
+	event->hp_lp_event.xRc = HvLpEvent_Rc_Good;
+	HvCallEvent_ackLpEvent(&event->hp_lp_event);
 
-    /* process interrupt */
-	switch( event->xHvLpEvent.xSubtype )
-	{
+	/* process interrupt */
+	switch (event->hp_lp_event.xSubtype) {
 	case 0:	/* CE message */
-		switch( event->xUnion.xCEMsgData.xCEMsg[3] )
-		{
+		switch (event->data.ce_msg.ce_msg[3]) {
 		case 0x5B:	/* power control notification */
-			if ( (event->xUnion.xCEMsgData.xCEMsg[5]&0x20) != 0 )
-			{
-				printk( KERN_INFO "mf.c: Commencing partition shutdown\n" );
-				if ( shutdown() == 0 )
-					signalCEMsg( "\x00\x00\x00\xDB\x00\x00\x00\x00\x00\x00\x00\x00", NULL );
+			if ((event->data.ce_msg.ce_msg[5] & 0x20) != 0) {
+				printk(KERN_INFO "mf.c: Commencing partition shutdown\n");
+				if (shutdown() == 0)
+					signal_ce_msg("\x00\x00\x00\xDB\x00\x00\x00\x00\x00\x00\x00\x00", NULL);
 			}
 			break;
 		case 0xC0:	/* get time */
-			{
-				if ( (head != NULL) && ( head->event.xUnion.xCEMsgData.xCEMsg[3] == 0x40 ) )
-				{
-					freeIt = 1;
-					if ( head->event.xUnion.xCEMsgData.xToken != 0 )
-					{
-						CeMsgCompleteHandler xHdlr = head->event.xUnion.xCEMsgData.xToken->xHdlr;
-						void * token = head->event.xUnion.xCEMsgData.xToken->xToken;
+			if ((pending_event_head == NULL) ||
+			    (pending_event_head->event.data.ce_msg.ce_msg[3]
+			     != 0x40))
+				break;
+			freeIt = 1;
+			if (pending_event_head->event.data.ce_msg.completion != 0) {
+				CeMsgCompleteHandler handler = pending_event_head->event.data.ce_msg.completion->handler;
+				void *token = pending_event_head->event.data.ce_msg.completion->token;
 
-						if (xHdlr != NULL)
-							(*xHdlr)( token, &(event->xUnion.xCEMsgData) );
-					}
-				}
+				if (handler != NULL)
+					(*handler)(token, &(event->data.ce_msg));
 			}
 			break;
 		}
 
 		/* remove from queue */
-		if ( freeIt == 1 )
-		{
+		if (freeIt == 1) {
 			unsigned long flags;
-			spin_lock_irqsave( &spinlock, flags );
-			if ( head != NULL )
-			{
-				struct StackElement *oldHead = head;
-				head = head->next;
-				two = head;
-				free( oldHead );
+
+			spin_lock_irqsave(&pending_event_spinlock, flags);
+			if (pending_event_head != NULL) {
+				struct pending_event *oldHead =
+					pending_event_head;
+
+				pending_event_head = pending_event_head->next;
+				two = pending_event_head;
+				free_pending_event(oldHead);
 			}
-			spin_unlock_irqrestore( &spinlock, flags );
+			spin_unlock_irqrestore(&pending_event_spinlock, flags);
 		}
 
 		/* send next waiting event */
-		if ( two != NULL )
-			signalEvent( NULL );
+		if (two != NULL)
+			signal_event(NULL);
 		break;
 	case 1:	/* IT sys shutdown */
-		printk( KERN_INFO "mf.c: Commencing system shutdown\n" );
+		printk(KERN_INFO "mf.c: Commencing system shutdown\n");
 		shutdown();
 		break;
 	}
@@ -491,81 +436,74 @@
  * of a flow we sent to them.  If there are other flows queued
  * up, we must send another one now...
  */
-static void ackReceived( struct IoMFLpEvent * event )
+static void ackReceived(struct IoMFLpEvent *event)
 {
 	unsigned long flags;
-	struct StackElement * two = NULL;
+	struct pending_event * two = NULL;
 	unsigned long freeIt = 0;
 
-    /* handle current event */
-	if ( head != NULL )
-	{
-		switch( event->xHvLpEvent.xSubtype )
-		{
+	/* handle current event */
+	if (pending_event_head != NULL) {
+		switch (event->hp_lp_event.xSubtype) {
 		case 0:     /* CE msg */
-			if ( event->xUnion.xCEMsgData.xCEMsg[3] == 0x40 )
-			{
-				if ( event->xUnion.xCEMsgData.xCEMsg[2] != 0 )
-				{
+			if (event->data.ce_msg.ce_msg[3] == 0x40) {
+				if (event->data.ce_msg.ce_msg[2] != 0) {
 					freeIt = 1;
-					if ( head->event.xUnion.xCEMsgData.xToken != 0 )
-					{
-						CeMsgCompleteHandler xHdlr = head->event.xUnion.xCEMsgData.xToken->xHdlr;
-						void * token = head->event.xUnion.xCEMsgData.xToken->xToken;
+					if (pending_event_head->event.data.ce_msg.completion
+							!= 0) {
+						CeMsgCompleteHandler handler = pending_event_head->event.data.ce_msg.completion->handler;
+						void *token = pending_event_head->event.data.ce_msg.completion->token;
 
-						if (xHdlr != NULL)
-							(*xHdlr)( token, &(event->xUnion.xCEMsgData) );
+						if (handler != NULL)
+							(*handler)(token, &(event->data.ce_msg));
 					}
 				}
-			} else {
+			} else
 				freeIt = 1;
-			}
 			break;
 		case 4:	/* allocate */
 		case 5:	/* deallocate */
-			if ( head->hdlr != NULL )
-			{
-				union SafeCast mySafeCast;
-				mySafeCast.ptrAsU64 = event->xHvLpEvent.xCorrelationToken;
-				(*head->hdlr)( mySafeCast.ptr, event->xUnion.xAllocData.xCount );
+			if (pending_event_head->hdlr != NULL) {
+				union safe_cast mySafeCast;
+
+				mySafeCast.ptr_as_u64 = event->hp_lp_event.xCorrelationToken;
+				(*pending_event_head->hdlr)(mySafeCast.ptr, event->data.alloc.count);
 			}
 			freeIt = 1;
 			break;
 		case 6:
 			{
-				struct VspRspData *rsp = (struct VspRspData *)event->xUnion.xVspCmd.xTokenUnion.ptr;
+				struct VspRspData *rsp = (struct VspRspData *)event->data.vsp_cmd.token.ptr;
 
-				if (rsp != NULL)
-				{
-					if (rsp->xResponse != NULL)
-						memcpy(rsp->xResponse, &(event->xUnion.xVspCmd), sizeof(event->xUnion.xVspCmd));
-					if (rsp->xSemaphore != NULL)
-						up(rsp->xSemaphore);
-				} else {
-					printk( KERN_ERR "mf.c: no rsp\n");
-				}
+				if (rsp != NULL) {
+					if (rsp->response != NULL)
+						memcpy(rsp->response, &(event->data.vsp_cmd), sizeof(event->data.vsp_cmd));
+					if (rsp->sem != NULL)
+						up(rsp->sem);
+				} else
+					printk(KERN_ERR "mf.c: no rsp\n");
 				freeIt = 1;
 			}
 			break;
 		}
 	}
 	else
-		printk( KERN_ERR "mf.c: stack empty for receiving ack\n" );
+		printk(KERN_ERR "mf.c: stack empty for receiving ack\n");
 
-    /* remove from queue */
-	spin_lock_irqsave( &spinlock, flags );
-	if (( head != NULL ) && ( freeIt == 1 ))
-	{
-		struct StackElement *oldHead = head;
-		head = head->next;
-		two = head;
-		free( oldHead );
+	/* remove from queue */
+	spin_lock_irqsave(&pending_event_spinlock, flags);
+	if ((pending_event_head != NULL) && (freeIt == 1)) {
+		struct pending_event *oldHead = pending_event_head;
+
+		pending_event_head = pending_event_head->next;
+		two = pending_event_head;
+		free_pending_event(oldHead);
 	} 
-	spin_unlock_irqrestore( &spinlock, flags );
+	spin_unlock_irqrestore(&pending_event_spinlock, flags);
 
-    /* send next waiting event */
-	if ( two != NULL )
-		signalEvent( NULL );
+	/* send next waiting event */
+	if (two != NULL)
+		signal_event(NULL);
 }
 
 /*
@@ -574,101 +512,94 @@
  * parse it enough to know if it is an interrupt or an
  * acknowledge.
  */
-static void hvHandler( struct HvLpEvent * event, struct pt_regs * regs )
+static void hvHandler(struct HvLpEvent *event, struct pt_regs *regs)
 {
-	if ( (event != NULL) && (event->xType == HvLpEvent_Type_MachineFac) )
-	{
-		switch( event->xFlags.xFunction )
-		{
+	if ((event != NULL) && (event->xType == HvLpEvent_Type_MachineFac)) {
+		switch(event->xFlags.xFunction) {
 		case HvLpEvent_Function_Ack:
-			ackReceived( (struct IoMFLpEvent *)event );
+			ackReceived((struct IoMFLpEvent *)event);
 			break;
 		case HvLpEvent_Function_Int:
-			intReceived( (struct IoMFLpEvent *)event );
+			intReceived((struct IoMFLpEvent *)event);
 			break;
 		default:
-			printk( KERN_ERR "mf.c: non ack/int event received\n" );
+			printk(KERN_ERR "mf.c: non ack/int event received\n");
 			break;
 		}
-	}
-	else
-		printk( KERN_ERR "mf.c: alien event received\n" );
+	} else
+		printk(KERN_ERR "mf.c: alien event received\n");
 }
 
 /*
  * Global kernel interface to allocate and seed events into the
  * Hypervisor.
  */
-void mf_allocateLpEvents( HvLpIndex targetLp,
-			  HvLpEvent_Type type,
-			  unsigned size,
-			  unsigned count,
-			  MFCompleteHandler hdlr,
-			  void * userToken )
+void mf_allocateLpEvents(HvLpIndex targetLp, HvLpEvent_Type type,
+		unsigned size, unsigned count, MFCompleteHandler hdlr,
+		void *userToken)
 {
-	struct StackElement * newElement = newStackElement();
-	int rc = 0;
+	struct pending_event *ev = new_pending_event();
+	int rc;
 
-	if ( newElement == NULL )
+	if (ev == NULL) {
 		rc = -ENOMEM;
-	else {
-		union SafeCast mine;
+	} else {
+		union safe_cast mine;
+
 		mine.ptr = userToken;
-		newElement->event.xHvLpEvent.xSubtype = 4;
-		newElement->event.xHvLpEvent.xCorrelationToken = mine.ptrAsU64;
-		newElement->event.xHvLpEvent.x.xSubtypeData = ('M'<<24)+('F'<<16)+('M'<<8)+('A'<<0);
-		newElement->event.xUnion.xAllocData.xTargetLp = targetLp;
-		newElement->event.xUnion.xAllocData.xType = type;
-		newElement->event.xUnion.xAllocData.xSize = size;
-		newElement->event.xUnion.xAllocData.xCount = count;
-		newElement->hdlr = hdlr;
-		rc = signalEvent(newElement);
+		ev->event.hp_lp_event.xSubtype = 4;
+		ev->event.hp_lp_event.xCorrelationToken = mine.ptr_as_u64;
+		ev->event.hp_lp_event.x.xSubtypeData =
+			subtype_data('M', 'F', 'M', 'A');
+		ev->event.data.alloc.target_lp = targetLp;
+		ev->event.data.alloc.type = type;
+		ev->event.data.alloc.size = size;
+		ev->event.data.alloc.count = count;
+		ev->hdlr = hdlr;
+		rc = signal_event(ev);
 	}
-
-	if ( (rc != 0) && (hdlr != NULL) )
-		(*hdlr)( userToken, rc );
+	if ((rc != 0) && (hdlr != NULL))
+		(*hdlr)(userToken, rc);
 }
 
 /*
  * Global kernel interface to unseed and deallocate events already in
  * Hypervisor.
  */
-void mf_deallocateLpEvents( HvLpIndex targetLp,
-			    HvLpEvent_Type type,
-			    unsigned count,
-			    MFCompleteHandler hdlr,
-			    void * userToken )
+void mf_deallocateLpEvents(HvLpIndex targetLp, HvLpEvent_Type type,
+		unsigned count, MFCompleteHandler hdlr, void *userToken)
 {
-	struct StackElement * newElement = newStackElement();
-	int rc = 0;
+	struct pending_event *ev = new_pending_event();
+	int rc;
 
-	if ( newElement == NULL )
+	if (ev == NULL)
 		rc = -ENOMEM;
 	else {
-		union SafeCast mine;
+		union safe_cast mine;
+
 		mine.ptr = userToken;
-		newElement->event.xHvLpEvent.xSubtype = 5;
-		newElement->event.xHvLpEvent.xCorrelationToken = mine.ptrAsU64;
-		newElement->event.xHvLpEvent.x.xSubtypeData = ('M'<<24)+('F'<<16)+('M'<<8)+('D'<<0);
-		newElement->event.xUnion.xAllocData.xTargetLp = targetLp;
-		newElement->event.xUnion.xAllocData.xType = type;
-		newElement->event.xUnion.xAllocData.xCount = count;
-		newElement->hdlr = hdlr;
-		rc = signalEvent(newElement);
+		ev->event.hp_lp_event.xSubtype = 5;
+		ev->event.hp_lp_event.xCorrelationToken = mine.ptr_as_u64;
+		ev->event.hp_lp_event.x.xSubtypeData =
+			subtype_data('M', 'F', 'M', 'D');
+		ev->event.data.alloc.target_lp = targetLp;
+		ev->event.data.alloc.type = type;
+		ev->event.data.alloc.count = count;
+		ev->hdlr = hdlr;
+		rc = signal_event(ev);
 	}
-
-	if ( (rc != 0) && (hdlr != NULL) )
-		(*hdlr)( userToken, rc );
+	if ((rc != 0) && (hdlr != NULL))
+		(*hdlr)(userToken, rc);
 }
 
 /*
  * Global kernel interface to tell the VSP object in the primary
  * partition to power this partition off.
  */
-void mf_powerOff( void )
+void mf_powerOff(void)
 {
-	printk( KERN_INFO "mf.c: Down it goes...\n" );
-	signalCEMsg( "\x00\x00\x00\x4D\x00\x00\x00\x00\x00\x00\x00\x00", NULL );
+	printk(KERN_INFO "mf.c: Down it goes...\n");
+	signal_ce_msg("\x00\x00\x00\x4D\x00\x00\x00\x00\x00\x00\x00\x00", NULL);
 	for (;;);
 }
 
@@ -676,111 +607,104 @@
  * Global kernel interface to tell the VSP object in the primary
  * partition to reboot this partition.
  */
-void mf_reboot( void )
+void mf_reboot(void)
 {
-	printk( KERN_INFO "mf.c: Preparing to bounce...\n" );
-	signalCEMsg( "\x00\x00\x00\x4E\x00\x00\x00\x00\x00\x00\x00\x00", NULL );
+	printk(KERN_INFO "mf.c: Preparing to bounce...\n");
+	signal_ce_msg("\x00\x00\x00\x4E\x00\x00\x00\x00\x00\x00\x00\x00", NULL);
 	for (;;);
 }
 
 /*
  * Display a single word SRC onto the VSP control panel.
  */
-void mf_displaySrc( u32 word )
+void mf_displaySrc(u32 word)
 {
 	u8 ce[12];
 
-	memcpy( ce, "\x00\x00\x00\x4A\x00\x00\x00\x01\x00\x00\x00\x00", 12 );
-	ce[8] = word>>24;
-	ce[9] = word>>16;
-	ce[10] = word>>8;
+	memcpy(ce, "\x00\x00\x00\x4A\x00\x00\x00\x01\x00\x00\x00\x00", 12);
+	ce[8] = word >> 24;
+	ce[9] = word >> 16;
+	ce[10] = word >> 8;
 	ce[11] = word;
-	signalCEMsg( ce, NULL );
+	signal_ce_msg(ce, NULL);
 }
 
 /*
  * Display a single word SRC of the form "PROGXXXX" on the VSP control panel.
  */
-void mf_displayProgress( u16 value )
+void mf_displayProgress(u16 value)
 {
 	u8 ce[12];
 	u8 src[72];
 
-	memcpy( ce, "\x00\x00\x04\x4A\x00\x00\x00\x48\x00\x00\x00\x00", 12 );
-	memcpy( src,
-		"\x01\x00\x00\x01"
-		"\x00\x00\x00\x00"
-		"\x00\x00\x00\x00"
-		"\x00\x00\x00\x00"
-		"\x00\x00\x00\x00"
-		"\x00\x00\x00\x00"
-		"\x00\x00\x00\x00"
-		"\x00\x00\x00\x00"
-		"\x00\x00\x00\x00"
-		"\x00\x00\x00\x00"
-		"PROGxxxx"
-		"                        ",
-		72 );
-	src[6] = value>>8;
-	src[7] = value&255;
-	src[44] = "0123456789ABCDEF"[(value>>12)&15];
-	src[45] = "0123456789ABCDEF"[(value>>8)&15];
-	src[46] = "0123456789ABCDEF"[(value>>4)&15];
-	src[47] = "0123456789ABCDEF"[value&15];
-	dmaAndSignalCEMsg( ce, NULL, src, sizeof(src), 9*64*1024 );
+	memcpy(ce, "\x00\x00\x04\x4A\x00\x00\x00\x48\x00\x00\x00\x00", 12);
+	memcpy(src, "\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00"
+		"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+		"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+		"\x00\x00\x00\x00PROGxxxx                        ",
+		72);
+	src[6] = value >> 8;
+	src[7] = value & 255;
+	src[44] = "0123456789ABCDEF"[(value >> 12) & 15];
+	src[45] = "0123456789ABCDEF"[(value >> 8) & 15];
+	src[46] = "0123456789ABCDEF"[(value >> 4) & 15];
+	src[47] = "0123456789ABCDEF"[value & 15];
+	dma_and_signal_ce_msg(ce, NULL, src, sizeof(src), 9 * 64 * 1024);
 }
 
 /*
  * Clear the VSP control panel.  Used to "erase" an SRC that was
  * previously displayed.
  */
-void mf_clearSrc( void )
+void mf_clearSrc(void)
 {
-	signalCEMsg( "\x00\x00\x00\x4B\x00\x00\x00\x00\x00\x00\x00\x00", NULL );
+	signal_ce_msg("\x00\x00\x00\x4B\x00\x00\x00\x00\x00\x00\x00\x00", NULL);
 }
 
 /*
  * Initialization code here.
  */
-void mf_init( void )
+void mf_init(void)
 {
 	int i;
 
-    /* initialize */
-	spin_lock_init( &spinlock );
-	for ( i = 0; i < sizeof(prealloc)/sizeof(*prealloc); ++i )
-		free( &prealloc[i] );
-	HvLpEvent_registerHandler( HvLpEvent_Type_MachineFac, &hvHandler );
+	/* initialize */
+	spin_lock_init(&pending_event_spinlock);
+	for (i = 0;
+	     i < sizeof(pending_event_prealloc) / sizeof(*pending_event_prealloc);
+	     ++i)
+		free_pending_event(&pending_event_prealloc[i]);
+	HvLpEvent_registerHandler(HvLpEvent_Type_MachineFac, &hvHandler);
 
 	/* virtual continue ack */
-	signalCEMsg( "\x00\x00\x00\x57\x00\x00\x00\x00\x00\x00\x00\x00", NULL );
+	signal_ce_msg("\x00\x00\x00\x57\x00\x00\x00\x00\x00\x00\x00\x00", NULL);
 
 	/* initialization complete */
-	printk( KERN_NOTICE "mf.c: iSeries Linux LPAR Machine Facilities initialized\n" );
+	printk(KERN_NOTICE "mf.c: iSeries Linux LPAR Machine Facilities initialized\n");
 
 	iSeries_proc_callback(&mf_proc_init);
 }
 
 void mf_setSide(char side)
 {
-	int rc = 0;
-	u64 newSide = 0;
+	u64 newSide;
 	struct VspCmdData myVspCmd;
 
 	memset(&myVspCmd, 0, sizeof(myVspCmd));
-	if (side == 'A')
-		newSide = 0;
-	else if (side == 'B')
-		newSide = 1;
-	else if (side == 'C')
-		newSide = 2; 
-	else
-		newSide = 3;
-
-	myVspCmd.xSubData.xFunction02SelectIplTypeIn.xIplType = newSide;
-	myVspCmd.xCmd = 10;
+	switch (side) {
+	case 'A':	newSide = 0;
+			break;
+	case 'B':	newSide = 1;
+			break;
+	case 'C':	newSide = 2; 
+			break;
+	default:	newSide = 3;
+			break;
+	}
+	myVspCmd.sub_data.ipl_type = newSide;
+	myVspCmd.cmd = 10;
 
-	rc = signalVspInstruction(&myVspCmd);
+	(void)signal_vsp_instruction(&myVspCmd);
 }
 
 char mf_getSide(void)
@@ -790,91 +714,82 @@
 	struct VspCmdData myVspCmd;
 
 	memset(&myVspCmd, 0, sizeof(myVspCmd));
-	myVspCmd.xCmd = 2;
-	myVspCmd.xSubData.xFunction02SelectIplTypeIn.xIplType = 0;
+	myVspCmd.cmd = 2;
+	myVspCmd.sub_data.ipl_type = 0;
 	mb();
-	rc = signalVspInstruction(&myVspCmd);
+	rc = signal_vsp_instruction(&myVspCmd);
 
 	if (rc != 0)
-	{
 		return returnValue;
-	} else {
-		if (myVspCmd.xRc == 0)
-		{
-			if (myVspCmd.xSubData.xGetIplTypeOut.xIplType == 0)
-				returnValue = 'A';
-			else if (myVspCmd.xSubData.xGetIplTypeOut.xIplType == 1)
-				returnValue = 'B';
-			else if (myVspCmd.xSubData.xGetIplTypeOut.xIplType == 2)
-				returnValue = 'C';
-			else
-				returnValue = 'D';
+
+	if (myVspCmd.result_code == 0) {
+		switch (myVspCmd.sub_data.ipl_type) {
+		case 0:	returnValue = 'A';
+			break;
+		case 1:	returnValue = 'B';
+			break;
+		case 2:	returnValue = 'C';
+			break;
+		default:	returnValue = 'D';
+			break;
 		}
 	}
-
 	return returnValue;
 }
 
 void mf_getSrcHistory(char *buffer, int size)
 {
-    /*    struct IplTypeReturnStuff returnStuff;
-     struct StackElement * newElement = newStackElement();
-     int rc = 0;
-     char *pages[4];
-
-     pages[0] = kmalloc(4096, GFP_ATOMIC);
-     pages[1] = kmalloc(4096, GFP_ATOMIC);
-     pages[2] = kmalloc(4096, GFP_ATOMIC);
-     pages[3] = kmalloc(4096, GFP_ATOMIC);
-     if (( newElement == NULL ) || (pages[0] == NULL) || (pages[1] == NULL) || (pages[2] == NULL) || (pages[3] == NULL))
-     rc = -ENOMEM;
-     else
-     {
-     returnStuff.xType = 0;
-     returnStuff.xRc = 0;
-     returnStuff.xDone = 0;
-     newElement->event.xHvLpEvent.xSubtype = 6;
-     newElement->event.xHvLpEvent.x.xSubtypeData = ('M'<<24)+('F'<<16)+('V'<<8)+('I'<<0);
-     newElement->event.xUnion.xVspCmd.xEvent = &returnStuff;
-     newElement->event.xUnion.xVspCmd.xCmd = 4;
-     newElement->event.xUnion.xVspCmd.xLpIndex = HvLpConfig_getLpIndex();
-     newElement->event.xUnion.xVspCmd.xRc = 0xFF;
-     newElement->event.xUnion.xVspCmd.xReserved1 = 0;
-     newElement->event.xUnion.xVspCmd.xSubData.xGetSrcHistoryIn.xPage[0] = (0x8000000000000000ULL | virt_to_absolute((unsigned long)pages[0]));
-     newElement->event.xUnion.xVspCmd.xSubData.xGetSrcHistoryIn.xPage[1] = (0x8000000000000000ULL | virt_to_absolute((unsigned long)pages[1]));
-     newElement->event.xUnion.xVspCmd.xSubData.xGetSrcHistoryIn.xPage[2] = (0x8000000000000000ULL | virt_to_absolute((unsigned long)pages[2]));
-     newElement->event.xUnion.xVspCmd.xSubData.xGetSrcHistoryIn.xPage[3] = (0x8000000000000000ULL | virt_to_absolute((unsigned long)pages[3]));
-     mb();
-     rc = signalEvent(newElement);
-     }
-
-     if (rc != 0)
-     {
-     return;
-     }
-     else
-     {
-     while (returnStuff.xDone != 1)
-     {
-     udelay(10);
-     }
-
-     if (returnStuff.xRc == 0)
-     {
-     memcpy(buffer, pages[0], size);
-     }
-     }
-
-     kfree(pages[0]);
-     kfree(pages[1]);
-     kfree(pages[2]);
-     kfree(pages[3]);*/
+#if 0
+	struct IplTypeReturnStuff returnStuff;
+	struct pending_event *ev = new_pending_event();
+	int rc = 0;
+	char *pages[4];
+
+	pages[0] = kmalloc(4096, GFP_ATOMIC);
+	pages[1] = kmalloc(4096, GFP_ATOMIC);
+	pages[2] = kmalloc(4096, GFP_ATOMIC);
+	pages[3] = kmalloc(4096, GFP_ATOMIC);
+	if ((ev == NULL) || (pages[0] == NULL) || (pages[1] == NULL)
+			 || (pages[2] == NULL) || (pages[3] == NULL))
+		return -ENOMEM;
+
+	returnStuff.xType = 0;
+	returnStuff.xRc = 0;
+	returnStuff.xDone = 0;
+	ev->event.hp_lp_event.xSubtype = 6;
+	ev->event.hp_lp_event.x.xSubtypeData =
+		subtype_data('M', 'F', 'V', 'I');
+	ev->event.data.vsp_cmd.xEvent = &returnStuff;
+	ev->event.data.vsp_cmd.cmd = 4;
+	ev->event.data.vsp_cmd.lp_index = HvLpConfig_getLpIndex();
+	ev->event.data.vsp_cmd.result_code = 0xFF;
+	ev->event.data.vsp_cmd.reserved = 0;
+	ev->event.data.vsp_cmd.sub_data.page[0] =
+		(0x8000000000000000ULL | virt_to_absolute((unsigned long)pages[0]));
+	ev->event.data.vsp_cmd.sub_data.page[1] =
+		(0x8000000000000000ULL | virt_to_absolute((unsigned long)pages[1]));
+	ev->event.data.vsp_cmd.sub_data.page[2] =
+		(0x8000000000000000ULL | virt_to_absolute((unsigned long)pages[2]));
+	ev->event.data.vsp_cmd.sub_data.page[3] =
+		(0x8000000000000000ULL | virt_to_absolute((unsigned long)pages[3]));
+	mb();
+	if (signal_event(ev) != 0)
+		return;
+
+ 	while (returnStuff.xDone != 1)
+ 		udelay(10);
+ 	if (returnStuff.xRc == 0)
+ 		memcpy(buffer, pages[0], size);
+	kfree(pages[0]);
+	kfree(pages[1]);
+	kfree(pages[2]);
+	kfree(pages[3]);
+#endif
 }
 
 void mf_setCmdLine(const char *cmdline, int size, u64 side)
 {
 	struct VspCmdData myVspCmd;
-	int rc = 0;
 	dma_addr_t dma_addr = 0;
 	char *page = pci_alloc_consistent(iSeries_vio_dev, size, &dma_addr);
 
@@ -886,13 +801,13 @@
 	copy_from_user(page, cmdline, size);
 
 	memset(&myVspCmd, 0, sizeof(myVspCmd));
-	myVspCmd.xCmd = 31;
-	myVspCmd.xSubData.xSetKernelCmdLineIn.xToken = dma_addr;
-	myVspCmd.xSubData.xSetKernelCmdLineIn.xAddressType = HvLpDma_AddressType_TceIndex;
-	myVspCmd.xSubData.xSetKernelCmdLineIn.xSide = side;
-	myVspCmd.xSubData.xSetKernelCmdLineIn.xTransferLength = size;
+	myVspCmd.cmd = 31;
+	myVspCmd.sub_data.kern.token = dma_addr;
+	myVspCmd.sub_data.kern.address_type = HvLpDma_AddressType_TceIndex;
+	myVspCmd.sub_data.kern.side = side;
+	myVspCmd.sub_data.kern.length = size;
 	mb();
-	rc = signalVspInstruction(&myVspCmd);
+	(void)signal_vsp_instruction(&myVspCmd);
 
 	pci_free_consistent(iSeries_vio_dev, size, page, dma_addr);
 }
@@ -900,31 +815,29 @@
 int mf_getCmdLine(char *cmdline, int *size, u64 side)
 {
 	struct VspCmdData myVspCmd;
-	int rc = 0;
+	int rc;
 	int len = *size;
-	dma_addr_t dma_addr = pci_map_single(iSeries_vio_dev, cmdline, *size, PCI_DMA_FROMDEVICE);
+	dma_addr_t dma_addr;
 
-	memset(cmdline, 0, *size);
+	dma_addr = pci_map_single(iSeries_vio_dev, cmdline, len,
+			PCI_DMA_FROMDEVICE);
+	memset(cmdline, 0, len);
 	memset(&myVspCmd, 0, sizeof(myVspCmd));
-	myVspCmd.xCmd = 33;
-	myVspCmd.xSubData.xGetKernelCmdLineIn.xToken = dma_addr;
-	myVspCmd.xSubData.xGetKernelCmdLineIn.xAddressType = HvLpDma_AddressType_TceIndex;
-	myVspCmd.xSubData.xGetKernelCmdLineIn.xSide = side;
-	myVspCmd.xSubData.xGetKernelCmdLineIn.xTransferLength = *size;
+	myVspCmd.cmd = 33;
+	myVspCmd.sub_data.kern.token = dma_addr;
+	myVspCmd.sub_data.kern.address_type = HvLpDma_AddressType_TceIndex;
+	myVspCmd.sub_data.kern.side = side;
+	myVspCmd.sub_data.kern.length = len;
 	mb();
-	rc = signalVspInstruction(&myVspCmd);
-
-	if ( ! rc ) {
+	rc = signal_vsp_instruction(&myVspCmd);
 
-		if (myVspCmd.xRc == 0)
-		{
-			len = myVspCmd.xSubData.xGetKernelCmdLineOut.xTransferLength;
-		}
-		/* else
-			{
+	if (rc == 0) {
+		if (myVspCmd.result_code == 0)
+			len = myVspCmd.sub_data.length_out;
+#if 0
+		else
 			memcpy(cmdline, "Bad cmdline", 11);
-			}
-		*/
+#endif
 	}
 
 	pci_unmap_single(iSeries_vio_dev, dma_addr, *size, PCI_DMA_FROMDEVICE);
@@ -936,10 +849,8 @@
 int mf_setVmlinuxChunk(const char *buffer, int size, int offset, u64 side)
 {
 	struct VspCmdData myVspCmd;
-	int rc = 0;
-
+	int rc;
 	dma_addr_t dma_addr = 0;
-
 	char *page = pci_alloc_consistent(iSeries_vio_dev, size, &dma_addr);
 
 	if (page == NULL) {
@@ -950,23 +861,19 @@
 	copy_from_user(page, buffer, size);
 	memset(&myVspCmd, 0, sizeof(myVspCmd));
 
-	myVspCmd.xCmd = 30;
-	myVspCmd.xSubData.xGetKernelImageIn.xToken = dma_addr;
-	myVspCmd.xSubData.xGetKernelImageIn.xAddressType = HvLpDma_AddressType_TceIndex;
-	myVspCmd.xSubData.xGetKernelImageIn.xSide = side;
-	myVspCmd.xSubData.xGetKernelImageIn.xOffset = offset;
-	myVspCmd.xSubData.xGetKernelImageIn.xTransferLength = size;
+	myVspCmd.cmd = 30;
+	myVspCmd.sub_data.kern.token = dma_addr;
+	myVspCmd.sub_data.kern.address_type = HvLpDma_AddressType_TceIndex;
+	myVspCmd.sub_data.kern.side = side;
+	myVspCmd.sub_data.kern.offset = offset;
+	myVspCmd.sub_data.kern.length = size;
 	mb();
-	rc = signalVspInstruction(&myVspCmd);
-
-	if (rc == 0)
-	{
-		if (myVspCmd.xRc == 0)
-		{
+	rc = signal_vsp_instruction(&myVspCmd);
+	if (rc == 0) {
+		if (myVspCmd.result_code == 0)
 			rc = 0;
-		} else {
+		else
 			rc = -ENOMEM;
-		}
 	}
 
 	pci_free_consistent(iSeries_vio_dev, size, page, dma_addr);
@@ -977,31 +884,27 @@
 int mf_getVmlinuxChunk(char *buffer, int *size, int offset, u64 side)
 {
 	struct VspCmdData myVspCmd;
-	int rc = 0;
+	int rc;
 	int len = *size;
+	dma_addr_t dma_addr;
 
-	dma_addr_t dma_addr = pci_map_single(iSeries_vio_dev, buffer, *size, PCI_DMA_FROMDEVICE);
-
+	dma_addr = pci_map_single(iSeries_vio_dev, buffer, len,
+			PCI_DMA_FROMDEVICE);
 	memset(buffer, 0, len);
-
 	memset(&myVspCmd, 0, sizeof(myVspCmd));
-	myVspCmd.xCmd = 32;
-	myVspCmd.xSubData.xGetKernelImageIn.xToken = dma_addr;
-	myVspCmd.xSubData.xGetKernelImageIn.xAddressType = HvLpDma_AddressType_TceIndex;
-	myVspCmd.xSubData.xGetKernelImageIn.xSide = side;
-	myVspCmd.xSubData.xGetKernelImageIn.xOffset = offset;
-	myVspCmd.xSubData.xGetKernelImageIn.xTransferLength = len;
+	myVspCmd.cmd = 32;
+	myVspCmd.sub_data.kern.token = dma_addr;
+	myVspCmd.sub_data.kern.address_type = HvLpDma_AddressType_TceIndex;
+	myVspCmd.sub_data.kern.side = side;
+	myVspCmd.sub_data.kern.offset = offset;
+	myVspCmd.sub_data.kern.length = len;
 	mb();
-	rc = signalVspInstruction(&myVspCmd);
-
-	if (rc == 0)
-	{
-		if (myVspCmd.xRc == 0)
-		{
-			*size = myVspCmd.xSubData.xGetKernelImageOut.xTransferLength;
-		} else {
+	rc = signal_vsp_instruction(&myVspCmd);
+	if (rc == 0) {
+		if (myVspCmd.result_code == 0)
+			*size = myVspCmd.sub_data.length_out;
+		else
 			rc = -ENOMEM;
-		}
 	}
 
 	pci_unmap_single(iSeries_vio_dev, dma_addr, len, PCI_DMA_FROMDEVICE);
@@ -1015,12 +918,11 @@
 
 	to_tm(time, &tm);
 
-	return mf_setRtc( &tm );
+	return mf_setRtc(&tm);
 }
 
-struct RtcTimeData
-{
-	struct semaphore *xSemaphore;
+struct RtcTimeData {
+	struct semaphore *sem;
 	struct CeMsgData xCeMsg;
 	int xRc;
 };
@@ -1030,26 +932,23 @@
 	struct RtcTimeData *rtc = (struct RtcTimeData *)token;
 
 	memcpy(&(rtc->xCeMsg), ceMsg, sizeof(rtc->xCeMsg));
-
 	rtc->xRc = 0;
-	up(rtc->xSemaphore);
+	up(rtc->sem);
 }
 
 static unsigned long lastsec = 1;
 
 int mf_getRtcTime(unsigned long *time)
 {
-/*    unsigned long usec, tsec; */
-	
 	u32 dataWord1 = *((u32 *)(&xSpCommArea.xBcdTimeAtIplStart));
 	u32 dataWord2 = *(((u32 *)&(xSpCommArea.xBcdTimeAtIplStart)) + 1);
 	int year = 1970;
-	int year1 = ( dataWord1 >> 24 ) & 0x000000FF;
-	int year2 = ( dataWord1 >> 16 ) & 0x000000FF;
-	int sec = ( dataWord1 >> 8 ) & 0x000000FF;
+	int year1 = (dataWord1 >> 24) & 0x000000FF;
+	int year2 = (dataWord1 >> 16) & 0x000000FF;
+	int sec = (dataWord1 >> 8) & 0x000000FF;
 	int min = dataWord1 & 0x000000FF;
-	int hour = ( dataWord2 >> 24 ) & 0x000000FF;
-	int day = ( dataWord2 >> 8 ) & 0x000000FF;
+	int hour = (dataWord2 >> 24) & 0x000000FF;
+	int day = (dataWord2 >> 8) & 0x000000FF;
 	int mon = dataWord2 & 0x000000FF;
 
 	BCD_TO_BIN(sec);
@@ -1062,49 +961,41 @@
 	year = year1 * 100 + year2;
 
 	*time = mktime(year, mon, day, hour, min, sec);
-
-	*time += ( jiffies / HZ );
+	*time += (jiffies / HZ);
     
-	/* Now THIS is a nasty hack!
+	/*
+	 * Now THIS is a nasty hack!
 	 * It ensures that the first two calls to mf_getRtcTime get different
 	 * answers.  That way the loop in init_time (time.c) will not think
 	 * the clock is stuck.
 	 */
-	if ( lastsec ) {
+	if (lastsec) {
 		*time -= lastsec;
 		--lastsec;
 	}
-    
 	return 0;
-
 }
 
-int mf_getRtc( struct rtc_time * tm )
+int mf_getRtc(struct rtc_time *tm)
 {
-
 	struct CeMsgCompleteData ceComplete;
 	struct RtcTimeData rtcData;
-	int rc = 0;
+	int rc;
 	DECLARE_MUTEX_LOCKED(Semaphore);
 
 	memset(&ceComplete, 0, sizeof(ceComplete));
 	memset(&rtcData, 0, sizeof(rtcData));
-
-	rtcData.xSemaphore = &Semaphore;
-
-	ceComplete.xHdlr = &getRtcTimeComplete;
-	ceComplete.xToken = (void *)&rtcData;
-
-	rc = signalCEMsg( "\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00", &ceComplete );
-
-	if ( rc == 0 )
-	{
+	rtcData.sem = &Semaphore;
+	ceComplete.handler = &getRtcTimeComplete;
+	ceComplete.token = (void *)&rtcData;
+	rc = signal_ce_msg("\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00",
+			&ceComplete);
+	if (rc == 0) {
 		down(&Semaphore);
 
-		if ( rtcData.xRc == 0)
-		{
-			if ( ( rtcData.xCeMsg.xCEMsg[2] == 0xa9 ) ||
-			     ( rtcData.xCeMsg.xCEMsg[2] == 0xaf ) ) {
+		if (rtcData.xRc == 0) {
+			if ((rtcData.xCeMsg.ce_msg[2] == 0xa9) ||
+			    (rtcData.xCeMsg.ce_msg[2] == 0xaf)) {
 				/* TOD clock is not set */
 				tm->tm_sec = 1;
 				tm->tm_min = 1;
@@ -1112,16 +1003,16 @@
 				tm->tm_mday = 10;
 				tm->tm_mon = 8;
 				tm->tm_year = 71;
-				mf_setRtc( tm );
+				mf_setRtc(tm);
 			}
 			{
-				u32 dataWord1 = *((u32 *)(rtcData.xCeMsg.xCEMsg+4));
-				u32 dataWord2 = *((u32 *)(rtcData.xCeMsg.xCEMsg+8));
-				u8 year = (dataWord1 >> 16 ) & 0x000000FF;
-				u8 sec = ( dataWord1 >> 8 ) & 0x000000FF;
+				u32 dataWord1 = *((u32 *)(rtcData.xCeMsg.ce_msg+4));
+				u32 dataWord2 = *((u32 *)(rtcData.xCeMsg.ce_msg+8));
+				u8 year = (dataWord1 >> 16) & 0x000000FF;
+				u8 sec = (dataWord1 >> 8) & 0x000000FF;
 				u8 min = dataWord1 & 0x000000FF;
-				u8 hour = ( dataWord2 >> 24 ) & 0x000000FF;
-				u8 day = ( dataWord2 >> 8 ) & 0x000000FF;
+				u8 hour = (dataWord2 >> 24) & 0x000000FF;
+				u8 day = (dataWord2 >> 8) & 0x000000FF;
 				u8 mon = dataWord2 & 0x000000FF;
 
 				BCD_TO_BIN(sec);
@@ -1131,7 +1022,7 @@
 				BCD_TO_BIN(mon);
 				BCD_TO_BIN(year);
 
-				if ( year <= 69 )
+				if (year <= 69)
 					year += 100;
 	    
 				tm->tm_sec = sec;
@@ -1154,17 +1045,14 @@
 		tm->tm_wday = 0;
 		tm->tm_yday = 0;
 		tm->tm_isdst = 0;
-
 	}
 
 	return rc;
-
 }
 
 int mf_setRtc(struct rtc_time * tm)
 {
 	char ceTime[12] = "\x00\x00\x00\x41\x00\x00\x00\x00\x00\x00\x00\x00";
-	int rc = 0;
 	u8 day, mon, hour, min, sec, y1, y2;
 	unsigned year;
     
@@ -1194,10 +1082,5 @@
 	ceTime[10] = day;
 	ceTime[11] = mon;
    
-	rc = signalCEMsg( ceTime, NULL );
-
-	return rc;
+	return signal_ce_msg(ceTime, NULL);
 }
-
-
-
diff -Nru a/arch/ppc64/kernel/mf_proc.c b/arch/ppc64/kernel/mf_proc.c
--- a/arch/ppc64/kernel/mf_proc.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc64/kernel/mf_proc.c	Tue Feb  3 19:45:17 2004
@@ -16,151 +16,27 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
-
-
-/* Change Activity: */
-/* End Change Activity */
-
-#ifndef _MF_PROC_H
-#include <asm/iSeries/mf_proc.h>
-#endif
-#ifndef MF_H_INCLUDED
-#include <asm/iSeries/mf.h>
-#endif
 #include <asm/uaccess.h>
+#include <asm/iSeries/mf.h>
 
 static struct proc_dir_entry *mf_proc_root = NULL;
 
-int proc_mf_dump_cmdline
-(char *page, char **start, off_t off, int count, int *eof, void *data);
-
-int proc_mf_dump_vmlinux
-(char *page, char **start, off_t off, int count, int *eof, void *data);
-
-int proc_mf_dump_side
-(char *page, char **start, off_t off, int count, int *eof, void *data);
-
-int proc_mf_change_side
-(struct file *file, const char *buffer, unsigned long count, void *data);
-
-int proc_mf_dump_src
-(char *page, char **start, off_t off, int count, int *eof, void *data);
-int proc_mf_change_src (struct file *file, const char *buffer, unsigned long count, void *data);
-int proc_mf_change_cmdline(struct file *file, const char *buffer, unsigned long count, void *data);
-int proc_mf_change_vmlinux(struct file *file, const char *buffer, unsigned long count, void *data);
-
-
-void mf_proc_init(struct proc_dir_entry *iSeries_proc)
+static int proc_mf_dump_cmdline(char *page, char **start, off_t off,
+		int count, int *eof, void *data)
 {
-	struct proc_dir_entry *ent = NULL;
-	struct proc_dir_entry *mf_a = NULL;
-	struct proc_dir_entry *mf_b = NULL;
-	struct proc_dir_entry *mf_c = NULL;
-	struct proc_dir_entry *mf_d = NULL;
-
-	mf_proc_root = proc_mkdir("mf", iSeries_proc);
-	if (!mf_proc_root) return;
-
-	mf_a = proc_mkdir("A", mf_proc_root);
-	if (!mf_a) return;
-
-	ent = create_proc_entry("cmdline", S_IFREG|S_IRUSR|S_IWUSR, mf_a);
-	if (!ent) return;
-	ent->nlink = 1;
-	ent->data = (void *)0;
-	ent->read_proc = proc_mf_dump_cmdline;
-	ent->write_proc = proc_mf_change_cmdline;
-
-	ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf_a);
-	if (!ent) return;
-	ent->nlink = 1;
-	ent->data = (void *)0;
-	ent->write_proc = proc_mf_change_vmlinux;
-	ent->read_proc = NULL;
-
-	mf_b = proc_mkdir("B", mf_proc_root);
-	if (!mf_b) return;
-
-	ent = create_proc_entry("cmdline", S_IFREG|S_IRUSR|S_IWUSR, mf_b);
-	if (!ent) return;
-	ent->nlink = 1;
-	ent->data = (void *)1;
-	ent->read_proc = proc_mf_dump_cmdline;
-	ent->write_proc = proc_mf_change_cmdline;
-
-	ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf_b);
-	if (!ent) return;
-	ent->nlink = 1;
-	ent->data = (void *)1;
-	ent->write_proc = proc_mf_change_vmlinux;
-	ent->read_proc = NULL;
-
-	mf_c = proc_mkdir("C", mf_proc_root);
-	if (!mf_c) return;
-
-	ent = create_proc_entry("cmdline", S_IFREG|S_IRUSR|S_IWUSR, mf_c);
-	if (!ent) return;
-	ent->nlink = 1;
-	ent->data = (void *)2;
-	ent->read_proc = proc_mf_dump_cmdline;
-	ent->write_proc = proc_mf_change_cmdline;
-
-	ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf_c);
-	if (!ent) return;
-	ent->nlink = 1;
-	ent->data = (void *)2;
-	ent->write_proc = proc_mf_change_vmlinux;
-	ent->read_proc = NULL;
-
-	mf_d = proc_mkdir("D", mf_proc_root);
-	if (!mf_d) return;
-
-
-	ent = create_proc_entry("cmdline", S_IFREG|S_IRUSR|S_IWUSR, mf_d);
-	if (!ent) return;
-	ent->nlink = 1;
-	ent->data = (void *)3;
-	ent->read_proc = proc_mf_dump_cmdline;
-	ent->write_proc = proc_mf_change_cmdline;
-#if 0
-	ent = create_proc_entry("vmlinux", S_IFREG|S_IRUSR, mf_d);
-	if (!ent) return;
-	ent->nlink = 1;
-	ent->data = (void *)3;
-	ent->read_proc = proc_mf_dump_vmlinux;
-	ent->write_proc = NULL;
-#endif
-	ent = create_proc_entry("side", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root);
-	if (!ent) return;
-	ent->nlink = 1;
-	ent->data = (void *)0;
-	ent->read_proc = proc_mf_dump_side;
-	ent->write_proc = proc_mf_change_side;
-
-	ent = create_proc_entry("src", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root);
-	if (!ent) return;
-	ent->nlink = 1;
-	ent->data = (void *)0;
-	ent->read_proc = proc_mf_dump_src;
-	ent->write_proc = proc_mf_change_src;
-}
-
-int proc_mf_dump_cmdline
-(char *page, char **start, off_t off, int count, int *eof, void *data)
-{
-	int		len = count;
+	int len = count;
 	char *p;
     
 	len = mf_getCmdLine(page, &len, (u64)data);
    
 	p = page + len - 1;
-	while ( p > page ) {
-		if ( (*p == 0) || (*p == ' ') )
+	while (p > page) {
+		if ((*p == 0) || (*p == ' '))
 			--p;
 		else
 			break;
 	}
-	if ( *p != '\n' ) {
+	if (*p != '\n') {
 		++p;
 		*p = '\n';
 	}
@@ -179,74 +55,76 @@
 	return len;			
 }
 
-int proc_mf_dump_vmlinux
-(char *page, char **start, off_t off, int count, int *eof, void *data)
+#if 0
+static int proc_mf_dump_vmlinux(char *page, char **start, off_t off,
+		int count, int *eof, void *data)
 {
 	int sizeToGet = count;
+
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
 
-	if (mf_getVmlinuxChunk(page, &sizeToGet, off, (u64)data) == 0)
-	{
-		if (sizeToGet != 0)
-		{
+	if (mf_getVmlinuxChunk(page, &sizeToGet, off, (u64)data) == 0) {
+		if (sizeToGet != 0) {
 			*start = page + off;
 			return sizeToGet;
-		} else {
-			*eof = 1;
-			return 0;
 		}
-	} else {
 		*eof = 1;
 		return 0;
 	}
+	*eof = 1;
+	return 0;
 }
+#endif
 
-int proc_mf_dump_side
-(char *page, char **start, off_t off, int count, int *eof, void *data)
+static int proc_mf_dump_side(char *page, char **start, off_t off,
+		int count, int *eof, void *data)
 {
-	int		len = 0;
-
+	int len;
 	char mf_current_side = mf_getSide();
+
 	len = sprintf(page, "%c\n", mf_current_side);
 
-	if (len <= off+count) *eof = 1;
+	if (len <= (off + count))
+		*eof = 1;
 	*start = page + off;
 	len -= off;
-	if (len>count) len = count;
-	if (len<0) len = 0;
+	if (len > count)
+		len = count;
+	if (len < 0)
+		len = 0;
 	return len;			
 }
 
-int proc_mf_change_side(struct file *file, const char *buffer, unsigned long count, void *data)
+static int proc_mf_change_side(struct file *file, const char __user *buffer,
+		unsigned long count, void *data)
 {
 	char stkbuf[10];
+
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
 
-	if (count > 9) count = 9;
-	if (copy_from_user (stkbuf, buffer, count)) {
+	if (count > (sizeof(stkbuf) - 1))
+		count = sizeof(stkbuf) - 1;
+	if (copy_from_user(stkbuf, buffer, count))
 		return -EFAULT;
-	}
 	stkbuf[count] = 0;
-	if ((*stkbuf != 'A') &&
-	    (*stkbuf != 'B') &&
-	    (*stkbuf != 'C') &&
-	    (*stkbuf != 'D'))
-	{
+	if ((*stkbuf != 'A') && (*stkbuf != 'B') &&
+	    (*stkbuf != 'C') && (*stkbuf != 'D')) {
 		printk(KERN_ERR "mf_proc.c: proc_mf_change_side: invalid side\n");
 		return -EINVAL;
 	}
 
 	mf_setSide(*stkbuf);
 
-	return count;			
+	return count;
 }
 
-int proc_mf_dump_src
-(char *page, char **start, off_t off, int count, int *eof, void *data)
+static int proc_mf_dump_src(char *page, char **start, off_t off,
+		int count, int *eof, void *data)
 {
-	int		len = 0;
+	int len;
+
 	mf_getSrcHistory(page, count);
 	len = count;
 	len -= off;			
@@ -260,34 +138,34 @@
 	return len;			
 }
 
-int proc_mf_change_src(struct file *file, const char *buffer, unsigned long count, void *data)
+static int proc_mf_change_src(struct file *file, const char __user *buffer,
+		unsigned long count, void *data)
 {
 	char stkbuf[10];
+
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
 
-	if ((count < 4) && (count != 1))
-	{
+	if ((count < 4) && (count != 1)) {
 		printk(KERN_ERR "mf_proc: invalid src\n");
 		return -EINVAL;
 	}
 
-	if (count > 9) count = 9;
-	if (copy_from_user (stkbuf, buffer, count)) {
+	if (count > (sizeof(stkbuf) - 1))
+		count = sizeof(stkbuf) - 1;
+	if (copy_from_user(stkbuf, buffer, count))
 		return -EFAULT;
-	}
 
-	if ((count == 1) && ((*stkbuf) == '\0'))
-	{
+	if ((count == 1) && (*stkbuf == '\0'))
 		mf_clearSrc();
-	} else {
+	else
 		mf_displaySrc(*(u32 *)stkbuf);
-	}
 
 	return count;			
 }
 
-int proc_mf_change_cmdline(struct file *file, const char *buffer, unsigned long count, void *data)
+static int proc_mf_change_cmdline(struct file *file, const char *buffer,
+		unsigned long count, void *data)
 {
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
@@ -297,7 +175,8 @@
 	return count;			
 }
 
-int proc_mf_change_vmlinux(struct file *file, const char *buffer, unsigned long count, void *data)
+static int proc_mf_change_vmlinux(struct file *file, const char *buffer,
+		unsigned long count, void *data)
 {
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
@@ -306,4 +185,71 @@
 	file->f_pos += count;
 
 	return count;			
+}
+
+void mf_proc_init(struct proc_dir_entry *iSeries_proc)
+{
+	struct proc_dir_entry *ent;
+	struct proc_dir_entry *mf;
+	char name[2];
+	int i;
+
+	mf_proc_root = proc_mkdir("mf", iSeries_proc);
+	if (!mf_proc_root)
+		return;
+
+	name[1] = '\0';
+	for (i = 0; i < 4; i++) {
+		name[0] = 'A' + i;
+		mf = proc_mkdir(name, mf_proc_root);
+		if (!mf)
+			return;
+
+		ent = create_proc_entry("cmdline", S_IFREG|S_IRUSR|S_IWUSR, mf);
+		if (!ent)
+			return;
+		ent->nlink = 1;
+		ent->data = (void *)(long)i;
+		ent->read_proc = proc_mf_dump_cmdline;
+		ent->write_proc = proc_mf_change_cmdline;
+
+		if (i == 3)	/* no vmlinux entry for 'D' */
+			continue;
+
+		ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf);
+		if (!ent)
+			return;
+		ent->nlink = 1;
+		ent->data = (void *)(long)i;
+#if 0
+		if (i == 3) {
+			/*
+			 * if we had a 'D' vmlinux entry, it would only
+			 * be readable.
+			 */
+			ent->read_proc = proc_mf_dump_vmlinux;
+			ent->write_proc = NULL;
+		} else
+#endif
+		{
+			ent->write_proc = proc_mf_change_vmlinux;
+			ent->read_proc = NULL;
+		}
+	}
+
+	ent = create_proc_entry("side", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root);
+	if (!ent)
+		return;
+	ent->nlink = 1;
+	ent->data = (void *)0;
+	ent->read_proc = proc_mf_dump_side;
+	ent->write_proc = proc_mf_change_side;
+
+	ent = create_proc_entry("src", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root);
+	if (!ent)
+		return;
+	ent->nlink = 1;
+	ent->data = (void *)0;
+	ent->read_proc = proc_mf_dump_src;
+	ent->write_proc = proc_mf_change_src;
 }
diff -Nru a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S
--- a/arch/ppc64/kernel/misc.S	Tue Feb  3 19:45:41 2004
+++ b/arch/ppc64/kernel/misc.S	Tue Feb  3 19:45:41 2004
@@ -66,32 +66,31 @@
 	blr
 		
 #ifdef CONFIG_PPC_ISERIES
-/* unsigned long __no_use_save_flags(void) */
-_GLOBAL(__no_use_save_flags)
-#warning FIX ISERIES
-	mfspr	r4,SPRG3
-	lbz	r3,PACAPROCENABLED(r4)
+/* unsigned long local_save_flags(void) */
+_GLOBAL(local_get_flags)
+	lbz	r3,PACAPROCENABLED(r13)
 	blr
 
-/* void __no_use_restore_flags(unsigned long flags) */	
-_GLOBAL(__no_use_restore_flags)
-/*
- * Just set/clear the MSR_EE bit through restore/flags but do not
- * change anything else.  This is needed by the RT system and makes
- * sense anyway.
- *    -- Cort
- */
-#warning FIX ISERIES
-	mfspr	r6,SPRG3
-	lbz	r5,PACAPROCENABLED(r6)
+/* unsigned long local_irq_disable(void) */
+_GLOBAL(local_irq_disable)
+	lbz	r3,PACAPROCENABLED(r13)
+	li	r4,0
+	stb	r4,PACAPROCENABLED(r13)
+	blr			/* Done */
+
+/* void local_irq_restore(unsigned long flags) */	
+_GLOBAL(local_irq_restore)
+	lbz	r5,PACAPROCENABLED(r13)
 	 /* Check if things are setup the way we want _already_. */
 	cmpw	0,r3,r5
 	beqlr
 	/* are we enabling interrupts? */
 	cmpi	0,r3,0
-	stb	r3,PACAPROCENABLED(r6)
+	stb	r3,PACAPROCENABLED(r13)
 	beqlr
 	/* Check pending interrupts */
+	/*   A decrementer, IPI or PMC interrupt may have occurred
+	 *   while we were in the hypervisor (which enables) */
 	CHECKANYINT(r4,r5)
 	beqlr
 
@@ -101,35 +100,8 @@
 	li	r0,0x5555
 	sc
 	blr
+#endif /* CONFIG_PPC_ISERIES */
 
-_GLOBAL(__no_use_cli)
-#warning FIX ISERIES
-	mfspr	r5,SPRG3
-	lbz	r3,PACAPROCENABLED(r5)
-	li	r4,0
-	stb	r4,PACAPROCENABLED(r5)
-	blr			/* Done */
-
-_GLOBAL(__no_use_sti)
-#warning FIX ISERIES
-	mfspr	r6,SPRG3
-	li	r3,1
-	stb	r3,PACAPROCENABLED(r6)
-
-	/* Check for pending interrupts
-	 *   A decrementer, IPI or PMC interrupt may have occurred
-	 *   while we were in the hypervisor (which enables)
-	 */
-	CHECKANYINT(r4,r5)
-	beqlr
-
-	/* 
-	 * Handle pending interrupts in interrupt context
-	 */
-	li	r0,0x5555
-	sc	
-	blr
-#endif
 /*
  * Flush instruction cache.
  */
@@ -446,7 +418,7 @@
 	blr
 
 /*
- * identify_cpu,
+ * identify_cpu and calls setup_cpu
  * In:	r3 = base of the cpu_specs array
  *	r4 = address of cur_cpu_spec
  *	r5 = relocation offset
@@ -462,9 +434,17 @@
 	addi	r3,r3,CPU_SPEC_ENTRY_SIZE
 	b	1b
 1:
-	add	r3,r3,r5
-	std	r3,0(r4)
-	blr
+	add	r0,r3,r5
+	std	r0,0(r4)
+	ld	r4,CPU_SPEC_SETUP(r3)
+	sub	r4,r4,r5
+	ld	r4,0(r4)
+	sub	r4,r4,r5
+	mtctr	r4
+	/* Calling convention for cpu setup is r3=offset, r4=cur_cpu_spec */
+	mr	r4,r3
+	mr	r3,r5
+	bctr
 
 /*
  * do_cpu_ftr_fixups - goes through the list of CPU feature fixups
@@ -514,25 +494,6 @@
 	isync
 	b	1b
 
-/*
- * call_setup_cpu - call the setup_cpu function for this cpu
- * r3 = data offset
- *
- * Setup function is called with:
- *   r3 = data offset
- *   r4 = ptr to CPU spec (relocated)
- */
-_GLOBAL(call_setup_cpu)
-	LOADADDR(r4, cur_cpu_spec)
-	sub	r4,r4,r3
-	lwz	r4,0(r4)		# load pointer to cpu_spec
-	sub	r4,r4,r3		# relocate
-	lwz	r6,CPU_SPEC_SETUP(r4)	# load function pointer
-	sub	r6,r6,r3
-	mtctr	r6
-	bctr
-
-
 
 /*
  * Create a kernel thread
@@ -595,6 +556,10 @@
 SYSCALL(execve)
 SYSCALL(waitpid)
 
+#ifdef CONFIG_PPC_ISERIES	/* hack hack hack */
+#define ppc_rtas	sys_ni_syscall
+#endif
+
 /* Why isn't this a) automatic, b) written in 'C'? */	
 	.balign 8
 _GLOBAL(sys_call_table32)
@@ -825,10 +790,10 @@
 	.llong .sys_ni_syscall
 	.llong .sys_ni_syscall		/* 225 - reserved for tux */
 	.llong .sys32_sendfile64
-	.llong .sys32_io_setup
+	.llong .compat_sys_io_setup
 	.llong .sys_io_destroy
-	.llong .sys32_io_getevents
-	.llong .sys32_io_submit
+	.llong .compat_sys_io_getevents
+	.llong .compat_sys_io_submit
 	.llong .sys_io_cancel
 	.llong .sys_set_tid_address
 	.llong .ppc32_fadvise64
@@ -838,20 +803,22 @@
 	.llong .sys_epoll_ctl
 	.llong .sys_epoll_wait
 	.llong .sys_remap_file_pages
-	.llong .sys_ni_syscall		/* 240 */
-	.llong .sys_ni_syscall
-	.llong .sys_ni_syscall
-	.llong .sys_ni_syscall
-	.llong .sys_ni_syscall
-	.llong .sys_ni_syscall		/* 245 */
-	.llong .sys_ni_syscall
-	.llong .sys_ni_syscall
-	.llong .sys_ni_syscall
-	.llong .sys_ni_syscall
+	.llong .ppc32_timer_create	/* 240 */
+	.llong .compat_timer_settime
+	.llong .compat_timer_gettime
+	.llong .sys_timer_getoverrun
+	.llong .sys_timer_delete
+	.llong .compat_clock_settime	/* 245 */
+	.llong .compat_clock_gettime
+	.llong .compat_clock_getres
+	.llong .compat_clock_nanosleep
+	.llong .ppc32_swapcontext
 	.llong .sys32_tgkill		/* 250 */
 	.llong .sys32_utimes
-	.llong .sys_statfs64
-	.llong .sys_fstatfs64
+	.llong .compat_statfs64
+	.llong .compat_fstatfs64
+	.llong .ppc32_fadvise64_64	/* 32bit only fadvise64_64 */
+	.llong .ppc_rtas		/* 255 */
 
 	.balign 8
 _GLOBAL(sys_call_table)
@@ -1104,8 +1071,10 @@
 	.llong .sys_clock_gettime
 	.llong .sys_clock_getres
 	.llong .sys_clock_nanosleep
-	.llong .sys_ni_syscall
+	.llong .ppc64_swapcontext
 	.llong .sys_tgkill		/* 250 */
 	.llong .sys_utimes
 	.llong .sys_statfs64
 	.llong .sys_fstatfs64
+	.llong .sys_ni_syscall		/* 32bit only fadvise64_64 */
+	.llong .ppc_rtas		/* 255 */
diff -Nru a/arch/ppc64/kernel/module.c b/arch/ppc64/kernel/module.c
--- a/arch/ppc64/kernel/module.c	Tue Feb  3 19:45:42 2004
+++ b/arch/ppc64/kernel/module.c	Tue Feb  3 19:45:42 2004
@@ -404,10 +404,6 @@
 	 */
 	list_add(&me->arch.bug_list, &module_bug_list);
 
-	sort_ex_table((struct exception_table_entry *)me->extable,
-		      (struct exception_table_entry *)me->extable +
-				me->num_exentries);
-
 	return 0;
 }
 
diff -Nru a/arch/ppc64/kernel/nvram.c b/arch/ppc64/kernel/nvram.c
--- a/arch/ppc64/kernel/nvram.c	Tue Feb  3 19:45:16 2004
+++ b/arch/ppc64/kernel/nvram.c	Tue Feb  3 19:45:16 2004
@@ -20,23 +20,50 @@
 #include <linux/fcntl.h>
 #include <linux/nvram.h>
 #include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <asm/nvram.h>
 #include <asm/rtas.h>
 #include <asm/prom.h>
+#include <asm/machdep.h>
 
-static unsigned int rtas_nvram_size;
+#define DEBUG_NVRAM
+
+static int nvram_scan_partitions(void);
+static int nvram_setup_partition(void);
+static int nvram_create_os_partition(void);
+static int nvram_remove_os_partition(void);
+static unsigned char nvram_checksum(struct nvram_header *p);
+static int nvram_write_header(struct nvram_partition * part);
+
+static unsigned int nvram_size;
 static unsigned int nvram_fetch, nvram_store;
-static char nvram_buf[4];	/* assume this is in the first 4GB */
+static char nvram_buf[NVRW_CNT];	/* assume this is in the first 4GB */
+static struct nvram_partition * nvram_part;
+static long nvram_error_log_index = -1;
+static long nvram_error_log_size = 0;
+static spinlock_t nvram_lock = SPIN_LOCK_UNLOCKED;
+
+volatile int no_more_logging = 1; /* Until we initialize everything,
+				   * make sure we don't try logging
+				   * anything */
+
+extern volatile int error_log_cnt;
+
+struct err_log_info {
+	int error_type;
+	unsigned int seq_num;
+};
 
-static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
+static loff_t dev_nvram_llseek(struct file *file, loff_t offset, int origin)
 {
 	switch (origin) {
 	case 1:
 		offset += file->f_pos;
 		break;
 	case 2:
-		offset += rtas_nvram_size;
+		offset += nvram_size;
 		break;
 	}
 	if (offset < 0)
@@ -46,53 +73,76 @@
 }
 
 
-static ssize_t read_nvram(struct file *file, char *buf,
+static ssize_t dev_nvram_read(struct file *file, char *buf,
 			  size_t count, loff_t *ppos)
 {
-	unsigned int i;
-	unsigned long len;
-	char *p = buf;
+	ssize_t len;
+	char *tmp_buffer;
 
 	if (verify_area(VERIFY_WRITE, buf, count))
 		return -EFAULT;
-	if (*ppos >= rtas_nvram_size)
+	if (*ppos >= nvram_size)
 		return 0;
-	for (i = *ppos; count > 0 && i < rtas_nvram_size; ++i, ++p, --count) {
-		if ((rtas_call(nvram_fetch, 3, 2, &len, i, __pa(nvram_buf), 1) != 0) ||
-		    len != 1)
-			return -EIO;
-		if (__put_user(nvram_buf[0], p))
-			return -EFAULT;
+	if (count > nvram_size) 
+		count = nvram_size;
+
+	tmp_buffer = (char *) kmalloc(count, GFP_KERNEL);
+	if (!tmp_buffer) {
+		printk(KERN_ERR "dev_read_nvram: kmalloc failed\n");
+		return -ENOMEM;
 	}
-	*ppos = i;
-	return p - buf;
+
+	len = ppc_md.nvram_read(tmp_buffer, count, ppos);
+	if ((long)len <= 0) {
+		kfree(tmp_buffer);
+		return len;
+	}
+
+	if (copy_to_user(buf, tmp_buffer, len)) {
+		kfree(tmp_buffer);
+		return -EFAULT;
+	}
+
+	kfree(tmp_buffer);
+	return len;
+
 }
 
-static ssize_t write_nvram(struct file *file, const char *buf,
+static ssize_t dev_nvram_write(struct file *file, const char *buf,
 			   size_t count, loff_t *ppos)
 {
-	unsigned int i;
-	unsigned long len;
-	const char *p = buf;
-	char c;
+	ssize_t len;
+	char * tmp_buffer;
 
 	if (verify_area(VERIFY_READ, buf, count))
 		return -EFAULT;
-	if (*ppos >= rtas_nvram_size)
+	if (*ppos >= nvram_size)
 		return 0;
-	for (i = *ppos; count > 0 && i < rtas_nvram_size; ++i, ++p, --count) {
-		if (__get_user(c, p))
-			return -EFAULT;
-		nvram_buf[0] = c;
-		if ((rtas_call(nvram_store, 3, 2, &len, i, __pa(nvram_buf), 1) != 0) ||
-		    len != 1)
-			return -EIO;
+	if (count > nvram_size)
+		count = nvram_size;
+
+	tmp_buffer = (char *) kmalloc(count, GFP_KERNEL);
+	if (!tmp_buffer) {
+		printk(KERN_ERR "dev_nvram_write: kmalloc failed\n");
+		return -ENOMEM;
 	}
-	*ppos = i;
-	return p - buf;
+	
+	if (copy_from_user(tmp_buffer, buf, count)) {
+		kfree(tmp_buffer);
+		return -EFAULT;
+	}
+
+	len = ppc_md.nvram_write(tmp_buffer, count, ppos);
+	if ((long)len <= 0) {
+		kfree(tmp_buffer);
+		return len;
+	}
+
+	kfree(tmp_buffer);
+	return len;
 }
 
-static int nvram_ioctl(struct inode *inode, struct file *file,
+static int dev_nvram_ioctl(struct inode *inode, struct file *file,
 	unsigned int cmd, unsigned long arg)
 {
 	return -EINVAL;
@@ -100,10 +150,10 @@
 
 struct file_operations nvram_fops = {
 	.owner =	THIS_MODULE,
-	.llseek =	nvram_llseek,
-	.read =		read_nvram,
-	.write =	write_nvram,
-	.ioctl =	nvram_ioctl,
+	.llseek =	dev_nvram_llseek,
+	.read =		dev_nvram_read,
+	.write =	dev_nvram_write,
+	.ioctl =	dev_nvram_ioctl,
 };
 
 static struct miscdevice nvram_dev = {
@@ -112,26 +162,578 @@
 	&nvram_fops
 };
 
+ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index)
+{
+	unsigned int i;
+	unsigned long len, done;
+	unsigned long flags;
+	char *p = buf;
+
+	if (*index >= nvram_size)
+		return 0;
+
+	i = *index;
+	if (i + count > nvram_size)
+		count = nvram_size - i;
+
+	spin_lock_irqsave(&nvram_lock, flags);
+
+	for (; count != 0; count -= len) {
+		len = count;
+		if (len > NVRW_CNT)
+			len = NVRW_CNT;
+		
+		if ((rtas_call(nvram_fetch, 3, 2, &done, i, __pa(nvram_buf),
+			       len) != 0) || len != done) {
+			spin_unlock_irqrestore(&nvram_lock, flags);
+			return -EIO;
+		}
+		
+		memcpy(p, nvram_buf, len);
+
+		p += len;
+		i += len;
+	}
+
+	spin_unlock_irqrestore(&nvram_lock, flags);
+	
+	*index = i;
+	return p - buf;
+}
+
+ssize_t pSeries_nvram_write(char *buf, size_t count, loff_t *index)
+{
+	unsigned int i;
+	unsigned long len, done;
+	unsigned long flags;
+	const char *p = buf;
+
+	if (*index >= nvram_size)
+		return 0;
+
+	i = *index;
+	if (i + count > nvram_size)
+		count = nvram_size - i;
+
+	spin_lock_irqsave(&nvram_lock, flags);
+
+	for (; count != 0; count -= len) {
+		len = count;
+		if (len > NVRW_CNT)
+			len = NVRW_CNT;
+
+		memcpy(nvram_buf, p, len);
+
+		if ((rtas_call(nvram_store, 3, 2, &done, i, __pa(nvram_buf),
+			       len) != 0) || len != done) {
+			spin_unlock_irqrestore(&nvram_lock, flags);
+			return -EIO;
+		}
+		
+		p += len;
+		i += len;
+	}
+	spin_unlock_irqrestore(&nvram_lock, flags);
+	
+	*index = i;
+	return p - buf;
+}
+ 
 int __init nvram_init(void)
 {
 	struct device_node *nvram;
 	unsigned int *nbytes_p, proplen;
-	if ((nvram = find_type_devices("nvram")) != NULL) {
+	int error;
+	int rc;
+	
+	if ((nvram = of_find_node_by_type(NULL, "nvram")) != NULL) {
 		nbytes_p = (unsigned int *)get_property(nvram, "#bytes", &proplen);
 		if (nbytes_p && proplen == sizeof(unsigned int)) {
-			rtas_nvram_size = *nbytes_p;
+			nvram_size = *nbytes_p;
+		} else {
+			return -EIO;
 		}
 	}
 	nvram_fetch = rtas_token("nvram-fetch");
 	nvram_store = rtas_token("nvram-store");
-	printk(KERN_INFO "PPC64 nvram contains %d bytes\n", rtas_nvram_size);
+	printk(KERN_INFO "PPC64 nvram contains %d bytes\n", nvram_size);
+	of_node_put(nvram);
+
+  	rc = misc_register(&nvram_dev);
+  
+  	/* If we don't know how big NVRAM is then we shouldn't touch
+  	   the nvram partitions */
+  	if (nvram == NULL) {
+  		return rc;
+  	}
+  	
+  	/* initialize our anchor for the nvram partition list */
+  	nvram_part = (struct nvram_partition *) kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
+  	if (!nvram_part) {
+  		printk(KERN_ERR "nvram_init: Failed kmalloc\n");
+  		return -ENOMEM;
+  	}
+  	INIT_LIST_HEAD(&nvram_part->partition);
+  
+  	/* Get all the NVRAM partitions */
+  	error = nvram_scan_partitions();
+  	if (error) {
+  		printk(KERN_ERR "nvram_init: Failed nvram_scan_partitions\n");
+  		return error;
+  	}
+  		
+  	if(nvram_setup_partition()) 
+  		printk(KERN_WARNING "nvram_init: Could not find nvram partition"
+  		       " for nvram buffered error logging.\n");
+  
+#ifdef DEBUG_NVRAM
+	nvram_print_partitions("NVRAM Partitions");
+#endif
 
-	return misc_register(&nvram_dev);
+  	return rc;
 }
 
 void __exit nvram_cleanup(void)
 {
         misc_deregister( &nvram_dev );
+}
+
+static int nvram_scan_partitions(void)
+{
+	loff_t cur_index = 0;
+	struct nvram_header phead;
+	struct nvram_partition * tmp_part;
+	unsigned char c_sum;
+	char * header;
+	long size;
+	
+	header = (char *) kmalloc(NVRAM_HEADER_LEN, GFP_KERNEL);
+	if (!header) {
+		printk(KERN_ERR "nvram_scan_partitions: Failed kmalloc\n");
+		return -ENOMEM;
+	}
+
+	while (cur_index < nvram_size) {
+
+		size = ppc_md.nvram_read(header, NVRAM_HEADER_LEN, &cur_index);
+		if (size != NVRAM_HEADER_LEN) {
+			printk(KERN_ERR "nvram_scan_partitions: Error parsing "
+			       "nvram partitions\n");
+			kfree(header);
+			return size;
+		}
+
+		cur_index -= NVRAM_HEADER_LEN; /* nvram_read will advance us */
+
+		memcpy(&phead, header, NVRAM_HEADER_LEN);
+
+		c_sum = nvram_checksum(&phead);
+		if (c_sum != phead.checksum)
+			printk(KERN_WARNING "WARNING: nvram partition checksum "
+			       "was %02x, should be %02x!\n", phead.checksum, c_sum);
+		
+		tmp_part = (struct nvram_partition *)
+			kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
+		if (!tmp_part) {
+			printk(KERN_ERR "nvram_scan_partitions: kmalloc failed\n");
+			kfree(header);
+			return -ENOMEM;
+		}
+		
+		memcpy(&tmp_part->header, &phead, NVRAM_HEADER_LEN);
+		tmp_part->index = cur_index;
+		list_add_tail(&tmp_part->partition, &nvram_part->partition);
+		
+		cur_index += phead.length * NVRAM_BLOCK_LEN;
+	}
+
+	kfree(header);
+	return 0;
+}
+
+/* nvram_setup_partition
+ *
+ * This will setup the partition we need for buffering the
+ * error logs and cleanup partitions if needed.
+ *
+ * The general strategy is the following:
+ * 1.) If there is ppc64,linux partition large enough then use it.
+ * 2.) If there is not a ppc64,linux partition large enough, search
+ * for a free partition that is large enough.
+ * 3.) If there is not a free partition large enough remove 
+ * _all_ OS partitions and consolidate the space.
+ * 4.) Will first try getting a chunk that will satisfy the maximum
+ * error log size (NVRAM_MAX_REQ).
+ * 5.) If the max chunk cannot be allocated then try finding a chunk
+ * that will satisfy the minum needed (NVRAM_MIN_REQ).
+ */
+static int nvram_setup_partition(void)
+{
+	struct list_head * p;
+	struct nvram_partition * part;
+	int rc;
+
+	/* see if we have an OS partition that meets our needs.
+	   will try getting the max we need.  If not we'll delete
+	   partitions and try again. */
+	list_for_each(p, &nvram_part->partition) {
+		part = list_entry(p, struct nvram_partition, partition);
+		if (part->header.signature != NVRAM_SIG_OS)
+			continue;
+
+		if (strcmp(part->header.name, "ppc64,linux"))
+			continue;
+
+		if (part->header.length >= NVRAM_MIN_REQ) {
+			/* found our partition */
+			nvram_error_log_index = part->index + NVRAM_HEADER_LEN;
+			nvram_error_log_size = ((part->header.length - 1) *
+						NVRAM_BLOCK_LEN) - sizeof(struct err_log_info);
+			return 0;
+		}
+	}
+	
+	/* try creating a partition with the free space we have */
+	rc = nvram_create_os_partition();
+	if (!rc) {
+		return 0;
+	}
+		
+	/* need to free up some space */
+	rc = nvram_remove_os_partition();
+	if (rc) {
+		return rc;
+	}
+	
+	/* create a partition in this new space */
+	rc = nvram_create_os_partition();
+	if (rc) {
+		printk(KERN_ERR "nvram_create_os_partition: Could not find a "
+		       "NVRAM partition large enough\n");
+		return rc;
+	}
+	
+	return 0;
+}
+
+static int nvram_remove_os_partition(void)
+{
+	struct list_head *i;
+	struct list_head *j;
+	struct nvram_partition * part;
+	struct nvram_partition * cur_part;
+	int rc;
+
+	list_for_each(i, &nvram_part->partition) {
+		part = list_entry(i, struct nvram_partition, partition);
+		if (part->header.signature != NVRAM_SIG_OS)
+			continue;
+		
+		/* Make os partition a free partition */
+		part->header.signature = NVRAM_SIG_FREE;
+		sprintf(part->header.name, "wwwwwwwwwwww");
+		part->header.checksum = nvram_checksum(&part->header);
+
+		/* Merge contiguous free partitions backwards */
+		list_for_each_prev(j, &part->partition) {
+			cur_part = list_entry(j, struct nvram_partition, partition);
+			if (cur_part == nvram_part || cur_part->header.signature != NVRAM_SIG_FREE) {
+				break;
+			}
+			
+			part->header.length += cur_part->header.length;
+			part->header.checksum = nvram_checksum(&part->header);
+			part->index = cur_part->index;
+
+			list_del(&cur_part->partition);
+			kfree(cur_part);
+			j = &part->partition; /* fixup our loop */
+		}
+		
+		/* Merge contiguous free partitions forwards */
+		list_for_each(j, &part->partition) {
+			cur_part = list_entry(j, struct nvram_partition, partition);
+			if (cur_part == nvram_part || cur_part->header.signature != NVRAM_SIG_FREE) {
+				break;
+			}
+
+			part->header.length += cur_part->header.length;
+			part->header.checksum = nvram_checksum(&part->header);
+
+			list_del(&cur_part->partition);
+			kfree(cur_part);
+			j = &part->partition; /* fixup our loop */
+		}
+		
+		rc = nvram_write_header(part);
+		if (rc <= 0) {
+			printk(KERN_ERR "nvram_remove_os_partition: nvram_write failed (%d)\n", rc);
+			return rc;
+		}
+
+	}
+	
+	return 0;
+}
+
+/* nvram_create_os_partition
+ *
+ * Create a OS linux partition to buffer error logs.
+ * Will create a partition starting at the first free
+ * space found if space has enough room.
+ */
+static int nvram_create_os_partition(void)
+{
+	struct list_head * p;
+	struct nvram_partition * part;
+	struct nvram_partition * new_part = NULL;
+	struct nvram_partition * free_part;
+	int seq_init[2] = { 0, 0 };
+	loff_t tmp_index;
+	long size = 0;
+	int rc;
+	
+	/* Find a free partition that will give us the maximum needed size 
+	   If can't find one that will give us the minimum size needed */
+	list_for_each(p, &nvram_part->partition) {
+		part = list_entry(p, struct nvram_partition, partition);
+		if (part->header.signature != NVRAM_SIG_FREE)
+			continue;
+
+		if (part->header.length >= NVRAM_MAX_REQ) {
+			size = NVRAM_MAX_REQ;
+			free_part = part;
+			break;
+		}
+		if (!size && part->header.length >= NVRAM_MIN_REQ) {
+			size = NVRAM_MIN_REQ;
+			free_part = part;
+		}
+	}
+	if (!size) {
+		return -ENOSPC;
+	}
+	
+	/* Create our OS partition */
+	new_part = (struct nvram_partition *)
+		kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
+	if (!new_part) {
+		printk(KERN_ERR "nvram_create_os_partition: kmalloc failed\n");
+		return -ENOMEM;
+	}
+
+	new_part->index = free_part->index;
+	new_part->header.signature = NVRAM_SIG_OS;
+	new_part->header.length = size;
+	sprintf(new_part->header.name, "ppc64,linux");
+	new_part->header.checksum = nvram_checksum(&new_part->header);
+
+	rc = nvram_write_header(new_part);
+	if (rc <= 0) {
+		printk(KERN_ERR "nvram_create_os_partition: nvram_write_header \
+				failed (%d)\n", rc);
+		return rc;
+	}
+
+	/* make sure and initialize to zero the sequence number and the error
+	   type logged */
+	tmp_index = new_part->index + NVRAM_HEADER_LEN;
+	rc = ppc_md.nvram_write((char *)&seq_init, sizeof(seq_init), &tmp_index);
+	if (rc <= 0) {
+		printk(KERN_ERR "nvram_create_os_partition: nvram_write failed (%d)\n", rc);
+		return rc;
+	}
+	
+	nvram_error_log_index = new_part->index + NVRAM_HEADER_LEN;
+	nvram_error_log_size = ((part->header.length - 1) *
+				NVRAM_BLOCK_LEN) - sizeof(struct err_log_info);
+	
+	list_add_tail(&new_part->partition, &free_part->partition);
+
+	if (free_part->header.length <= size) {
+		list_del(&free_part->partition);
+		kfree(free_part);
+		return 0;
+	} 
+
+	/* Adjust the partition we stole the space from */
+	free_part->index += size * NVRAM_BLOCK_LEN;
+	free_part->header.length -= size;
+	free_part->header.checksum = nvram_checksum(&free_part->header);
+	
+	rc = nvram_write_header(free_part);
+	if (rc <= 0) {
+		printk(KERN_ERR "nvram_create_os_partition: nvram_write_header "
+		       "failed (%d)\n", rc);
+		return rc;
+	}
+
+	return 0;
+}
+
+
+void nvram_print_partitions(char * label)
+{
+	struct list_head * p;
+	struct nvram_partition * tmp_part;
+	
+	printk(KERN_WARNING "--------%s---------\n", label);
+	printk(KERN_WARNING "indx\t\tsig\tchks\tlen\tname\n");
+	list_for_each(p, &nvram_part->partition) {
+		tmp_part = list_entry(p, struct nvram_partition, partition);
+		printk(KERN_WARNING "%d    \t%02x\t%02x\t%d\t%s\n",
+		       tmp_part->index, tmp_part->header.signature,
+		       tmp_part->header.checksum, tmp_part->header.length,
+		       tmp_part->header.name);
+	}
+}
+
+/* nvram_write_error_log
+ *
+ * We need to buffer the error logs into nvram to ensure that we have
+ * the failure information to decode.  If we have a severe error there
+ * is no way to guarantee that the OS or the machine is in a state to
+ * get back to user land and write the error to disk.  For example if
+ * the SCSI device driver causes a Machine Check by writing to a bad
+ * IO address, there is no way of guaranteeing that the device driver
+ * is in any state that is would also be able to write the error data
+ * captured to disk, thus we buffer it in NVRAM for analysis on the
+ * next boot.
+ *
+ * In NVRAM the partition containing the error log buffer will looks like:
+ * Header (in bytes):
+ * +-----------+----------+--------+------------+------------------+
+ * | signature | checksum | length | name       | data             |
+ * |0          |1         |2      3|4         15|16        length-1|
+ * +-----------+----------+--------+------------+------------------+
+ *
+ * The 'data' section would look like (in bytes):
+ * +--------------+------------+-----------------------------------+
+ * | event_logged | sequence # | error log                         |
+ * |0            3|4          7|8            nvram_error_log_size-1|
+ * +--------------+------------+-----------------------------------+
+ *
+ * event_logged: 0 if event has not been logged to syslog, 1 if it has
+ * sequence #: The unique sequence # for each event. (until it wraps)
+ * error log: The error log from event_scan
+ */
+int nvram_write_error_log(char * buff, int length, unsigned int err_type)
+{
+	int rc;
+	loff_t tmp_index;
+	struct err_log_info info;
+	
+	if (no_more_logging) {
+		return -EPERM;
+	}
+
+	if (nvram_error_log_index == -1) {
+		return -ESPIPE;
+	}
+
+	if (length > nvram_error_log_size) {
+		length = nvram_error_log_size;
+	}
+
+	info.error_type = err_type;
+	info.seq_num = error_log_cnt;
+
+	tmp_index = nvram_error_log_index;
+
+	rc = ppc_md.nvram_write((char *)&info, sizeof(struct err_log_info), &tmp_index);
+	if (rc <= 0) {
+		printk(KERN_ERR "nvram_write_error_log: Failed nvram_write (%d)\n", rc);
+		return rc;
+	}
+
+	rc = ppc_md.nvram_write(buff, length, &tmp_index);
+	if (rc <= 0) {
+		printk(KERN_ERR "nvram_write_error_log: Failed nvram_write (%d)\n", rc);
+		return rc;
+	}
+	
+	return 0;
+}
+
+/* nvram_read_error_log
+ *
+ * Reads nvram for error log for at most 'length'
+ */
+int nvram_read_error_log(char * buff, int length, unsigned int * err_type)
+{
+	int rc;
+	loff_t tmp_index;
+	struct err_log_info info;
+	
+	if (nvram_error_log_index == -1)
+		return -1;
+
+	if (length > nvram_error_log_size)
+		length = nvram_error_log_size;
+
+	tmp_index = nvram_error_log_index;
+
+	rc = ppc_md.nvram_read((char *)&info, sizeof(struct err_log_info), &tmp_index);
+	if (rc <= 0) {
+		printk(KERN_ERR "nvram_read_error_log: Failed nvram_read (%d)\n", rc);
+		return rc;
+	}
+
+	rc = ppc_md.nvram_read(buff, length, &tmp_index);
+	if (rc <= 0) {
+		printk(KERN_ERR "nvram_read_error_log: Failed nvram_read (%d)\n", rc);
+		return rc;
+	}
+
+	error_log_cnt = info.seq_num;
+	*err_type = info.error_type;
+
+	return 0;
+}
+
+/* This doesn't actually zero anything, but it sets the event_logged
+ * word to tell that this event is safely in syslog.
+ */
+int nvram_clear_error_log()
+{
+	loff_t tmp_index;
+	int clear_word = ERR_FLAG_ALREADY_LOGGED;
+	int rc;
+
+	tmp_index = nvram_error_log_index;
+	
+	rc = ppc_md.nvram_write((char *)&clear_word, sizeof(int), &tmp_index);
+	if (rc <= 0) {
+		printk(KERN_ERR "nvram_clear_error_log: Failed nvram_write (%d)\n", rc);
+		return rc;
+	}
+
+	return 0;
+}
+
+static int nvram_write_header(struct nvram_partition * part)
+{
+	loff_t tmp_index;
+	int rc;
+	
+	tmp_index = part->index;
+	rc = ppc_md.nvram_write((char *)&part->header, NVRAM_HEADER_LEN, &tmp_index); 
+
+	return rc;
+}
+
+static unsigned char nvram_checksum(struct nvram_header *p)
+{
+	unsigned int c_sum, c_sum2;
+	unsigned short *sp = (unsigned short *)p->name; /* assume 6 shorts */
+	c_sum = p->signature + p->length + sp[0] + sp[1] + sp[2] + sp[3] + sp[4] + sp[5];
+
+	/* The sum may have spilled into the 3rd byte.  Fold it back. */
+	c_sum = ((c_sum & 0xffff) + (c_sum >> 16)) & 0xffff;
+	/* The sum cannot exceed 2 bytes.  Fold it into a checksum */
+	c_sum2 = (c_sum >> 8) + (c_sum << 8);
+	c_sum = ((c_sum + c_sum2) >> 8) & 0xff;
+	return c_sum;
 }
 
 module_init(nvram_init);
diff -Nru a/arch/ppc64/kernel/open_pic.c b/arch/ppc64/kernel/open_pic.c
--- a/arch/ppc64/kernel/open_pic.c	Tue Feb  3 19:45:29 2004
+++ b/arch/ppc64/kernel/open_pic.c	Tue Feb  3 19:45:29 2004
@@ -85,10 +85,10 @@
  */
 #ifdef CONFIG_SMP
 #define THIS_CPU		Processor[cpu]
-#define DECL_THIS_CPU		int cpu = smp_processor_id()
+#define DECL_THIS_CPU		int cpu = hard_smp_processor_id()
 #define CHECK_THIS_CPU		check_arg_cpu(cpu)
 #else
-#define THIS_CPU		Processor[smp_processor_id()]
+#define THIS_CPU		Processor[hard_smp_processor_id()]
 #define DECL_THIS_CPU
 #define CHECK_THIS_CPU
 #endif /* CONFIG_SMP */
@@ -142,7 +142,7 @@
         struct device_node *kbd;
 #endif
 
-        if (!(np = find_devices("pci"))
+        if (!(np = of_find_node_by_name(NULL, "pci"))
             || !(addrp = (unsigned int *)
                  get_property(np, "8259-interrupt-acknowledge", NULL)))
                 printk(KERN_ERR "Cannot find pci to get ack address\n");
@@ -158,6 +158,7 @@
         openpic_init(1, NUM_8259_INTERRUPTS, chrp_int_ack_special, nmi_irq);
         for ( i = 0 ; i < NUM_8259_INTERRUPTS  ; i++ )
                 irq_desc[i].handler = &i8259_pic;
+	of_node_put(np);
 }
 
 static inline u_int openpic_read(volatile u_int *addr)
@@ -354,7 +355,7 @@
 	/* SIOint (8259 cascade) is special */
 	if (offset) {
 		openpic_initirq(0, 8, offset, 1, 1);
-		openpic_mapirq(0, 1 << boot_cpuid);
+		openpic_mapirq(0, 1 << get_hard_smp_processor_id(boot_cpuid));
 	}
 
 	/* Init all external sources */
@@ -372,7 +373,7 @@
 		/* Enabled, Priority 8 or 9 */
 		openpic_initirq(i, pri, i+offset, !sense, sense);
 		/* Processor 0 */
-		openpic_mapirq(i, 1 << boot_cpuid);
+		openpic_mapirq(i, 1 << get_hard_smp_processor_id(boot_cpuid));
 	}
 
 	/* Init descriptors */
@@ -513,10 +514,23 @@
 			   vec);
 }
 
+/*
+ * Convert a cpu mask from logical to physical cpu numbers.
+ */
+static inline u32 physmask(u32 cpumask)
+{
+	int i;
+	u32 mask = 0;
+
+	for (i = 0; i < NR_CPUS; ++i, cpumask >>= 1)
+		mask |= (cpumask & 1) << get_hard_smp_processor_id(i);
+	return mask;
+}
+
 void openpic_init_processor(u_int cpumask)
 {
 	openpic_write(&OpenPIC->Global.Processor_Initialization,
-		      cpumask & cpus_coerce(cpu_online_map));
+		      physmask(cpumask & cpus_coerce(cpu_online_map)));
 }
 
 #ifdef CONFIG_SMP
@@ -550,7 +564,7 @@
 	CHECK_THIS_CPU;
 	check_arg_ipi(ipi);
 	openpic_write(&OpenPIC->THIS_CPU.IPI_Dispatch(ipi),
-		      cpumask & cpus_coerce(cpu_online_map));
+		      physmask(cpumask & cpus_coerce(cpu_online_map)));
 }
 
 void openpic_request_IPIs(void)
@@ -591,7 +605,7 @@
 {
 #ifdef CONFIG_IRQ_ALL_CPUS
  	int i;
-	u32 msk = 1 << smp_processor_id();
+	u32 msk = 1 << hard_smp_processor_id();
 #endif
 
 	spin_lock(&openpic_setup_lock);
@@ -636,7 +650,7 @@
 {
 	check_arg_timer(timer);
 	openpic_write(&OpenPIC->Global.Timer[timer].Destination,
-		      cpumask & cpus_coerce(cpu_online_map));
+		      physmask(cpumask & cpus_coerce(cpu_online_map)));
 }
 
 
@@ -762,7 +776,7 @@
 	cpumask_t tmp;
 
 	cpus_and(tmp, cpumask, cpu_online_map);
-	openpic_mapirq(irq_nr - open_pic_irq_offset, cpus_coerce(tmp));
+	openpic_mapirq(irq_nr - open_pic_irq_offset, physmask(cpus_coerce(tmp)));
 }
 
 #ifdef CONFIG_SMP
diff -Nru a/arch/ppc64/kernel/pSeries_htab.c b/arch/ppc64/kernel/pSeries_htab.c
--- a/arch/ppc64/kernel/pSeries_htab.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc64/kernel/pSeries_htab.c	Tue Feb  3 19:45:17 2004
@@ -219,10 +219,10 @@
 
 	/* Ensure it is out of the tlb too */
 	if ((cur_cpu_spec->cpu_features & CPU_FTR_TLBIEL) && !large && local) {
-		_tlbiel(va);
+		tlbiel(va);
 	} else {
 		spin_lock_irqsave(&pSeries_tlbie_lock, flags);
-		_tlbie(va, large);
+		tlbie(va, large);
 		spin_unlock_irqrestore(&pSeries_tlbie_lock, flags);
 	}
 
@@ -256,7 +256,7 @@
 
 	/* Ensure it is out of the tlb too */
 	spin_lock_irqsave(&pSeries_tlbie_lock, flags);
-	_tlbie(va, 0);
+	tlbie(va, 0);
 	spin_unlock_irqrestore(&pSeries_tlbie_lock, flags);
 }
 
@@ -285,10 +285,10 @@
 
 	/* Invalidate the tlb */
 	if ((cur_cpu_spec->cpu_features & CPU_FTR_TLBIEL) && !large && local) {
-		_tlbiel(va);
+		tlbiel(va);
 	} else {
 		spin_lock_irqsave(&pSeries_tlbie_lock, flags);
-		_tlbie(va, large);
+		tlbie(va, large);
 		spin_unlock_irqrestore(&pSeries_tlbie_lock, flags);
 	}
 }
@@ -350,12 +350,8 @@
 	if ((cur_cpu_spec->cpu_features & CPU_FTR_TLBIEL) && !large && local) {
 		asm volatile("ptesync":::"memory");
 
-		for (i = 0; i < j; i++) {
-			asm volatile("\n\
-			clrldi  %0,%0,16\n\
-			tlbiel   %0"
-			: : "r" (batch->vaddr[i]) : "memory" );
-		}
+		for (i = 0; i < j; i++)
+			__tlbiel(batch->vaddr[i]);
 
 		asm volatile("ptesync":::"memory");
 	} else {
@@ -364,12 +360,8 @@
 
 		asm volatile("ptesync":::"memory");
 
-		for (i = 0; i < j; i++) {
-			asm volatile("\n\
-			clrldi  %0,%0,16\n\
-			tlbie   %0"
-			: : "r" (batch->vaddr[i]) : "memory" );
-		}
+		for (i = 0; i < j; i++)
+			__tlbie(batch->vaddr[i], 0);
 
 		asm volatile("eieio; tlbsync; ptesync":::"memory");
 
@@ -389,10 +381,11 @@
 	ppc_md.hpte_remove     	= pSeries_hpte_remove;
 
 	/* Disable TLB batching on nighthawk */
-	root = find_path_device("/");
+	root = of_find_node_by_path("/");
 	if (root) {
 		model = get_property(root, "model", NULL);
 		if (strcmp(model, "CHRP IBM,9076-N81"))
 			ppc_md.flush_hash_range = pSeries_flush_hash_range;
+		of_node_put(root);
 	}
 }
diff -Nru a/arch/ppc64/kernel/pSeries_hvCall.S b/arch/ppc64/kernel/pSeries_hvCall.S
--- a/arch/ppc64/kernel/pSeries_hvCall.S	Tue Feb  3 19:45:42 2004
+++ b/arch/ppc64/kernel/pSeries_hvCall.S	Tue Feb  3 19:45:42 2004
@@ -67,3 +67,77 @@
 	ld	r0,-8(r1)
 	mtcrf	0xff,r0
 	blr                     /* return r3 = status */
+
+
+/* long plpar_hcall_8arg_2ret(unsigned long opcode,		 R3 
+			     unsigned long arg1,		 R4 
+		 	     unsigned long arg2,		 R5 
+			     unsigned long arg3,		 R6 
+	 		     unsigned long arg4,		 R7 
+	 		     unsigned long arg5,		 R8 
+			     unsigned long arg6,		 R9 
+	 		     unsigned long arg7,		 R10 
+	 		     unsigned long arg8,		 112(R1)
+	 		     unsigned long *out1);		 120(R1)
+
+ */
+
+	.text
+_GLOBAL(plpar_hcall_8arg_2ret)
+	mfcr	r0
+
+	ld              r11, 112(r1) /* put arg8 and out1 in R11 and R12 */
+	ld              r12, 120(r1)
+
+	std	r0,-8(r1)
+	stdu	r1,-32(r1)
+
+        std     r12,-8(r1)      /* Save out ptr */
+	
+	HSC                    /* invoke the hypervisor */
+
+        ld      r10,-8(r1)      /* Fetch r4 ret arg */
+        std     r4,0(r10)
+
+	ld	r1,0(r1)
+	ld	r0,-8(r1)
+	mtcrf	0xff,r0
+	blr                     /* return r3 = status */
+
+
+/* long plpar_hcall_4out(unsigned long opcode,	 R3 
+		 unsigned long arg1,		 R4 
+		 unsigned long arg2,		 R5 
+		 unsigned long arg3,		 R6 
+		 unsigned long arg4,		 R7 
+		 unsigned long *out1,	(r4)	 R8 
+		 unsigned long *out2,	(r5)	 R9
+		 unsigned long *out3,   (r6)     R10
+		 unsigned long *out4);	(r7)	 112(R1). From Parameter save area. 
+ */
+_GLOBAL(plpar_hcall_4out)
+	mfcr	r0
+	std	r0,-8(r1)
+	ld      r14,112(r1)
+	stdu	r1,-48(r1) 
+
+	std     r8,32(r1)       /* Save out ptrs. */
+	std     r9,24(r1)
+	std     r10,16(r1)
+	std     r14,8(r1)
+	
+	HSC                    /* invoke the hypervisor */
+
+	ld      r14,32(r1)      /* Fetch r4-r7 ret args. */
+	std     r4,0(r14)
+	ld      r14,24(r1)
+	std     r5,0(r14)
+	ld      r14,16(r1)
+	std     r6,0(r14)
+	ld      r14,8(r1)
+	std     r7,0(r14)
+
+	ld	r1,0(r1) 
+	ld	r0,-8(r1)
+	mtcrf	0xff,r0
+	blr                     /* return r3 = status */
diff -Nru a/arch/ppc64/kernel/pSeries_lpar.c b/arch/ppc64/kernel/pSeries_lpar.c
--- a/arch/ppc64/kernel/pSeries_lpar.c	Tue Feb  3 19:45:43 2004
+++ b/arch/ppc64/kernel/pSeries_lpar.c	Tue Feb  3 19:45:43 2004
@@ -35,6 +35,32 @@
 #include <asm/tlbflush.h>
 #include <asm/tlb.h>
 #include <asm/hvcall.h>
+#include <asm/prom.h>
+
+long poll_pending(void)
+{
+	unsigned long dummy;
+	return plpar_hcall(H_POLL_PENDING, 0, 0, 0, 0,
+			   &dummy, &dummy, &dummy);
+}
+
+long prod_processor(void)
+{
+	plpar_hcall_norets(H_PROD);
+	return(0); 
+}
+
+long cede_processor(void)
+{
+	plpar_hcall_norets(H_CEDE);
+	return(0); 
+}
+
+long register_vpa(unsigned long flags, unsigned long proc, unsigned long vpa)
+{
+	plpar_hcall_norets(H_REGISTER_VPA, flags, proc, vpa);
+	return(0); 
+}
 
 long plpar_pte_remove(unsigned long flags,
 		      unsigned long ptex,
@@ -206,6 +232,61 @@
 	}
 }
 
+/* returns 0 if couldn't find or use /chosen/stdout as console */
+static int find_udbg_vterm(void)
+{
+	struct device_node *stdout_node;
+	u32 *termno;
+	char *name;
+	int found = 0;
+
+	/* find the boot console from /chosen/stdout */
+	if (!of_stdout_device) {
+		printk(KERN_WARNING "couldn't get path from /chosen/stdout!\n");
+		return found;
+	}
+	stdout_node = of_find_node_by_path(of_stdout_device);
+	if (!stdout_node) {
+		printk(KERN_WARNING "couldn't find node from /chosen/stdout\n");
+		return found;
+	}
+
+	/* now we have the stdout node; figure out what type of device it is. */
+	name = (char *)get_property(stdout_node, "name", 0);
+	if (!name) {
+		printk(KERN_WARNING "stdout node missing 'name' property!\n");
+		goto out;
+	}
+
+	if (strncmp(name, "vty", 3) == 0) {
+		if (device_is_compatible(stdout_node, "hvterm1")) {
+			termno = (u32 *)get_property(stdout_node, "reg", 0);
+			if (termno) {
+				vtermno = termno[0];
+				ppc_md.udbg_putc = udbg_putcLP;
+				ppc_md.udbg_getc = udbg_getcLP;
+				ppc_md.udbg_getc_poll = udbg_getc_pollLP;
+				found = 1;
+			}
+		} else {
+			/* XXX implement udbg_putcLP_vtty for hvterm-protocol1 case */
+			printk(KERN_WARNING "%s doesn't speak hvterm1; "
+					"can't print udbg messages\n", of_stdout_device);
+		}
+	} else if (strncmp(name, "serial", 6)) {
+		/* XXX fix ISA serial console */
+		printk(KERN_WARNING "serial stdout on LPAR ('%s')! "
+				"can't print udbg messages\n", of_stdout_device);
+	} else {
+		printk(KERN_WARNING "don't know how to print to stdout '%s'\n",
+				of_stdout_device);
+	}
+
+out:
+	of_node_put(stdout_node);
+	return found;
+}
+
 void pSeries_lpar_mm_init(void);
 
 /* This is called early in setup.c.
@@ -213,8 +294,6 @@
  */
 void pSeriesLP_init_early(void)
 {
-	struct device_node *np;
-
 	pSeries_lpar_mm_init();
 
 	ppc_md.tce_build	 = tce_build_pSeriesLP;
@@ -225,24 +304,13 @@
 #endif
 
 	/* The keyboard is not useful in the LPAR environment.
-	 * Leave all the interfaces NULL.
+	 * Leave all the ppc_md keyboard interfaces NULL.
 	 */
 
-	/* lookup the first virtual terminal number in case we don't have a
-	 * com port. Zero is probably correct in case someone calls udbg
-	 * before the init. The property is a pair of numbers.  The first
-	 * is the starting termno (the one we use) and the second is the
-	 * number of terminals.
-	 */
-	np = find_path_device("/rtas");
-	if (np) {
-		u32 *termno = (u32 *)get_property(np, "ibm,termno", 0);
-		if (termno)
-			vtermno = termno[0];
-	}
-	ppc_md.udbg_putc = udbg_putcLP;
-	ppc_md.udbg_getc = udbg_getcLP;
-	ppc_md.udbg_getc_poll = udbg_getc_pollLP;
+	if (0 == find_udbg_vterm()) {
+		printk(KERN_WARNING
+			"can't use stdout; can't print early debug messages.\n");
+	}
 }
 
 int hvc_get_chars(int index, char *buf, int count)
@@ -285,23 +353,28 @@
 	return -1;
 }
 
+/* return the number of client vterms present */
+/* XXX this requires an interface change to handle multiple discontiguous
+ * vterms */
 int hvc_count(int *start_termno)
 {
-	u32 *termno;
-	struct device_node *dn;
+	struct device_node *vty;
+	int num_found = 0;
 
-	if ((dn = find_path_device("/rtas")) != NULL) {
-		if ((termno = (u32 *)get_property(dn, "ibm,termno", 0)) != NULL) {
-			if (start_termno)
-				*start_termno = termno[0];
-			return termno[1];
-		}
+	/* consider only the first vty node.
+	 * we should _always_ be able to find one. */
+	vty = of_find_node_by_name(NULL, "vty");
+	if (vty && device_is_compatible(vty, "hvterm1")) {
+		u32 *termno = (u32 *)get_property(vty, "reg", 0);
+
+		if (termno && start_termno)
+			*start_termno = *termno;
+		num_found = 1;
+		of_node_put(vty);
 	}
-	return 0;
-}
-
-
 
+	return num_found;
+}
 
 long pSeries_lpar_hpte_insert(unsigned long hpte_group,
 			      unsigned long va, unsigned long prpn,
diff -Nru a/arch/ppc64/kernel/pSeries_pci.c b/arch/ppc64/kernel/pSeries_pci.c
--- a/arch/ppc64/kernel/pSeries_pci.c	Tue Feb  3 19:45:43 2004
+++ b/arch/ppc64/kernel/pSeries_pci.c	Tue Feb  3 19:45:43 2004
@@ -176,6 +176,55 @@
 	       pci_name(pci_dev), pci_dev->irq);
 	return 0;
 }
+EXPORT_SYMBOL(pci_read_irq_line);
+
+#define ISA_SPACE_MASK 0x1
+#define ISA_SPACE_IO 0x1
+
+static void pci_process_ISA_OF_ranges(struct device_node *isa_node,
+		                      unsigned long phb_io_base_phys,
+				      void * phb_io_base_virt)
+{
+	struct isa_range *range;
+	unsigned long pci_addr;
+	unsigned int isa_addr;
+	unsigned int size;
+	int rlen = 0;
+
+	range = (struct isa_range *) get_property(isa_node, "ranges", &rlen);
+	if (rlen < sizeof(struct isa_range)) {
+		printk(KERN_ERR "unexpected isa range size: %s\n", 
+				__FUNCTION__);
+		return;	
+	}
+	
+	/* From "ISA Binding to 1275"
+	 * The ranges property is laid out as an array of elements,
+	 * each of which comprises:
+	 *   cells 0 - 1:	an ISA address
+	 *   cells 2 - 4:	a PCI address 
+	 *			(size depending on dev->n_addr_cells)
+	 *   cell 5:		the size of the range
+	 */
+	if ((range->isa_addr.a_hi && ISA_SPACE_MASK) == ISA_SPACE_IO) {
+		isa_addr = range->isa_addr.a_lo;
+		pci_addr = (unsigned long) range->pci_addr.a_mid << 32 | 
+			range->pci_addr.a_lo;
+
+		/* Assume these are both zero */
+		if ((pci_addr != 0) || (isa_addr != 0)) {
+			printk(KERN_ERR "unexpected isa to pci mapping: %s\n",
+					__FUNCTION__);
+			return;
+		}
+		
+		size = PAGE_ALIGN(range->size);
+
+		__ioremap_explicit(phb_io_base_phys, 
+				   (unsigned long) phb_io_base_virt, 
+				   size, _PAGE_NO_CACHE);
+	}
+}
 
 static void __init pci_process_bridge_OF_ranges(struct pci_controller *hose,
 						struct device_node *dev,
@@ -188,10 +237,11 @@
 	struct resource *res;
 	int np, na = prom_n_addr_cells(dev);
 	unsigned long pci_addr, cpu_phys_addr;
+	struct device_node *isa_dn;
 
 	np = na + 5;
 
-	/*
+	/* From "PCI Binding to 1275"
 	 * The ranges property is laid out as an array of elements,
 	 * each of which comprises:
 	 *   cells 0 - 2:	a PCI address
@@ -215,12 +265,22 @@
 		switch (ranges[0] >> 24) {
 		case 1:		/* I/O space */
 			hose->io_base_phys = cpu_phys_addr;
-			hose->io_base_virt = __ioremap(hose->io_base_phys,
-						       size, _PAGE_NO_CACHE);
+			hose->io_base_virt = reserve_phb_iospace(size);
+			PPCDBG(PPCDBG_PHBINIT, 
+			       "phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n", 
+			       hose->global_number, hose->io_base_phys, 
+			       (unsigned long) hose->io_base_virt);
+
 			if (primary) {
 				pci_io_base = (unsigned long)hose->io_base_virt;
-				if (find_type_devices("isa"))
+				isa_dn = of_find_node_by_type(NULL, "isa");
+				if (isa_dn) {
 					isa_io_base = pci_io_base;
+					of_node_put(isa_dn);
+					pci_process_ISA_OF_ranges(isa_dn,
+						hose->io_base_phys,
+						hose->io_base_virt);
+				}
 			}
 
 			res = &hose->io_resource;
@@ -386,7 +446,7 @@
 	unsigned int root_size_cells = 0;
 	unsigned int index;
 	unsigned int *opprop;
-	struct device_node *root = find_path_device("/");
+	struct device_node *root = of_find_node_by_path("/");
 
 	read_pci_config = rtas_token("read-pci-config");
 	write_pci_config = rtas_token("write-pci-config");
@@ -402,7 +462,9 @@
 
 	index = 0;
 
-	for (node = root->child; node != NULL; node = node->sibling) {
+	for (node = of_get_next_child(root, NULL);
+	     node != NULL;
+	     node = of_get_next_child(root, node)) {
 		if (node->type == NULL || strcmp(node->type, "pci") != 0)
 			continue;
 
@@ -420,6 +482,7 @@
 		index++;
 	}
 
+	of_node_put(root);
 	pci_devs_phb_init();
 
 	return 0;
@@ -450,7 +513,7 @@
 #endif
 }   
 
-void __init pcibios_fixup_device_resources(struct pci_dev *dev,
+void __devinit pcibios_fixup_device_resources(struct pci_dev *dev,
 					   struct pci_bus *bus)
 {
 	/* Update device resources.  */
@@ -469,8 +532,9 @@
 		}
         }
 }
+EXPORT_SYMBOL(pcibios_fixup_device_resources);
 
-void __init pcibios_fixup_bus(struct pci_bus *bus)
+void __devinit pcibios_fixup_bus(struct pci_bus *bus)
 {
 	struct pci_controller *hose = PCI_GET_PHB_PTR(bus);
 	struct list_head *ln;
@@ -519,18 +583,106 @@
 			pcibios_fixup_device_resources(dev, bus);
 	}
 }
+EXPORT_SYMBOL(pcibios_fixup_bus);
 
 static void check_s7a(void)
 {
 	struct device_node *root;
 	char *model;
 
-	root = find_path_device("/");
+	root = of_find_node_by_path("/");
 	if (root) {
 		model = get_property(root, "model", NULL);
 		if (model && !strcmp(model, "IBM,7013-S7A"))
 			s7a_workaround = 1;
+		of_node_put(root);
+	}
+}
+
+static int get_bus_io_range(struct pci_bus *bus, unsigned long *start_phys,
+				unsigned long *start_virt, unsigned long *size)
+{
+	struct pci_controller *hose = PCI_GET_PHB_PTR(bus);
+	struct pci_bus_region region;
+	struct resource *res;
+
+	if (bus->self) {
+		res = bus->resource[0];
+		pcibios_resource_to_bus(bus->self, &region, res);
+		*start_phys = hose->io_base_phys + region.start;
+		*start_virt = (unsigned long) hose->io_base_virt + 
+				region.start;
+		if (region.end > region.start) 
+			*size = region.end - region.start + 1;
+		else {
+			printk("%s(): unexpected region 0x%lx->0x%lx\n", 
+					__FUNCTION__, region.start, region.end);
+			return 1;
+		}
+		
+	} else {
+		/* Root Bus */
+		res = &hose->io_resource;
+		*start_phys = hose->io_base_phys;
+		*start_virt = (unsigned long) hose->io_base_virt;
+		if (res->end > res->start)
+			*size = res->end - res->start + 1;
+		else {
+			printk("%s(): unexpected region 0x%lx->0x%lx\n", 
+					__FUNCTION__, res->start, res->end);
+			return 1;
+		}
 	}
+
+	return 0;
+}
+
+int unmap_bus_range(struct pci_bus *bus)
+{
+	unsigned long start_phys;
+	unsigned long start_virt;
+	unsigned long size;
+
+	if (!bus) {
+		printk(KERN_ERR "%s() expected bus\n", __FUNCTION__);
+		return 1;
+	}
+	
+	if (get_bus_io_range(bus, &start_phys, &start_virt, &size))
+		return 1;
+	if (iounmap_explicit((void *) start_virt, size))
+		return 1;
+
+	return 0;
+}
+EXPORT_SYMBOL(unmap_bus_range);
+
+int remap_bus_range(struct pci_bus *bus)
+{
+	unsigned long start_phys;
+	unsigned long start_virt;
+	unsigned long size;
+
+	if (!bus) {
+		printk(KERN_ERR "%s() expected bus\n", __FUNCTION__);
+		return 1;
+	}
+	
+	if (get_bus_io_range(bus, &start_phys, &start_virt, &size))
+		return 1;
+	if (__ioremap_explicit(start_phys, start_virt, size, _PAGE_NO_CACHE))
+		return 1;
+
+	return 0;
+}
+EXPORT_SYMBOL(remap_bus_range);
+
+static void phbs_fixup_io(void)
+{
+	struct pci_controller *hose;
+
+	for (hose=hose_head;hose;hose=hose->next) 
+		remap_bus_range(hose->bus);
 }
 
 extern void chrp_request_regions(void);
@@ -544,6 +696,7 @@
 	while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
 		pci_read_irq_line(dev);
 
+	phbs_fixup_io();
 	chrp_request_regions();
 	pci_fix_bus_sysdata();
 	create_tce_tables();
diff -Nru a/arch/ppc64/kernel/pacaData.c b/arch/ppc64/kernel/pacaData.c
--- a/arch/ppc64/kernel/pacaData.c	Tue Feb  3 19:45:35 2004
+++ b/arch/ppc64/kernel/pacaData.c	Tue Feb  3 19:45:35 2004
@@ -41,7 +41,6 @@
 	.xStab_data = {							    \
 		.real = (asrr),		/* Real pointer to segment table */ \
 		.virt = (asrv),		/* Virt pointer to segment table */ \
-		.next_round_robin = 1	/* Round robin index */		    \
 	},								    \
 	.lpQueuePtr = (lpq),		/* &xItLpQueue, */		    \
 	/* .xRtas = {							    \
diff -Nru a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c
--- a/arch/ppc64/kernel/pci.c	Tue Feb  3 19:45:41 2004
+++ b/arch/ppc64/kernel/pci.c	Tue Feb  3 19:45:41 2004
@@ -144,7 +144,7 @@
 	return NULL;
 }
 
-void __devinit
+void 
 pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
 			struct resource *res)
 {
@@ -224,7 +224,11 @@
         struct pci_controller *hose;
 	char *model;
 
+#ifdef CONFIG_PPC_ISERIES
+        hose = (struct pci_controller *)kmalloc(sizeof(struct pci_controller), GFP_KERNEL);
+#else
         hose = (struct pci_controller *)alloc_bootmem(sizeof(struct pci_controller));
+#endif
         if(hose == NULL) {
                 printk(KERN_ERR "PCI: Allocate pci_controller failed.\n");
                 return NULL;
@@ -232,6 +236,11 @@
         memset(hose, 0, sizeof(struct pci_controller));
 
 	switch(controller_type) {
+#ifdef CONFIG_PPC_ISERIES
+	case phb_type_hypervisor:
+		model = "PHB HV";
+		break;
+#endif
 	case phb_type_python:
 		model = "PHB PY";
 		break;
@@ -280,6 +289,7 @@
 		pcibios_claim_one_bus(child_bus);
 }
 
+#ifndef CONFIG_PPC_ISERIES
 static void __init pcibios_claim_of_setup(void)
 {
 	struct list_head *lb;
@@ -289,6 +299,7 @@
 		pcibios_claim_one_bus(b);
 	}
 }
+#endif
 
 static int __init pcibios_init(void)
 {
@@ -311,6 +322,7 @@
 		hose->last_busno = bus->subordinate;
 	}
 
+#ifndef CONFIG_PPC_ISERIES
 	if (pci_probe_only)
 		pcibios_claim_of_setup();
 	else
@@ -318,6 +330,7 @@
 		   pci_assign_unassigned_resources() is able to work
 		   correctly with [partially] allocated PCI tree. */
 		pci_assign_unassigned_resources();
+#endif
 
 	/* Call machine dependent fixup */
 	pcibios_final_fixup();
@@ -375,19 +388,27 @@
  */
 int pci_domain_nr(struct pci_bus *bus)
 {
+#ifdef CONFIG_PPC_ISERIES
+	return 0;
+#else
 	struct pci_controller *hose = PCI_GET_PHB_PTR(bus);
 
 	return hose->global_number;
+#endif
 }
 
+EXPORT_SYMBOL(pci_domain_nr);
+
 /* Set the name of the bus as it appears in /proc/bus/pci */
 int pci_name_bus(char *name, struct pci_bus *bus)
 {
+#ifndef CONFIG_PPC_ISERIES
 	struct pci_controller *hose = PCI_GET_PHB_PTR(bus);
 
 	if (hose->buid)
 		sprintf(name, "%04x:%02x", pci_domain_nr(bus), bus->number);
 	else
+#endif
 		sprintf(name, "%02x", bus->number);
 
 	return 0;
diff -Nru a/arch/ppc64/kernel/pci_dma.c b/arch/ppc64/kernel/pci_dma.c
--- a/arch/ppc64/kernel/pci_dma.c	Tue Feb  3 19:45:30 2004
+++ b/arch/ppc64/kernel/pci_dma.c	Tue Feb  3 19:45:30 2004
@@ -48,11 +48,13 @@
 /* #define MONITOR_TCE 1 */ /* Turn on to sanity check TCE generation. */
 
 
+#ifdef CONFIG_PPC_PSERIES
 /* Initialize so this guy does not end up in the BSS section.
  * Only used to pass OF initialization data set in prom.c into the main 
  * kernel code -- data ultimately copied into tceTables[].
  */
 extern struct _of_tce_table of_tce_table[];
+#endif
 
 extern struct pci_controller* hose_head;
 extern struct pci_controller** hose_tail;
@@ -553,7 +555,7 @@
 }
 
 #ifdef CONFIG_PPC_ISERIES
-static void tce_free_one_iSeries( struct TceTable *tbl, long tcenum )
+void tce_free_one_iSeries( struct TceTable *tbl, long tcenum )
 {
 	u64 set_tce_rc;
 	union Tce tce;
@@ -701,6 +703,7 @@
 	}
 }
 
+#ifdef CONFIG_PPC_PSERIES
 void create_tce_tables_for_busesLP(struct list_head *bus_list)
 {
 	struct list_head *ln;
@@ -722,15 +725,19 @@
 		create_tce_tables_for_busesLP(&bus->children);
 	}
 }
+#endif
 
 void create_tce_tables(void) {
 	struct pci_dev *dev = NULL;
 	struct device_node *dn, *mydn;
 
+#ifdef CONFIG_PPC_PSERIES
 	if (systemcfg->platform == PLATFORM_PSERIES_LPAR) {
 		create_tce_tables_for_busesLP(&pci_root_buses);
 	}
-	else {
+	else
+#endif
+	{
 		create_tce_tables_for_buses(&pci_root_buses);
 	}
 	/* Now copy the tce_table ptr from the bus devices down to every
@@ -884,6 +891,7 @@
 static void getTceTableParmsPSeries(struct pci_controller *phb,
 				    struct device_node *dn,
 				    struct TceTable *newTceTable ) {
+#ifdef CONFIG_PPC_PSERIES
 	phandle node;
 	unsigned long i;
 
@@ -953,6 +961,7 @@
 		}
 		i++;
 	}
+#endif
 }
 
 /*
@@ -970,6 +979,7 @@
 static void getTceTableParmsPSeriesLP(struct pci_controller *phb,
 				    struct device_node *dn,
 				    struct TceTable *newTceTable ) {
+#ifdef CONFIG_PPC_PSERIES
 	u32 *dma_window = (u32 *)get_property(dn, "ibm,dma-window", 0);
 	if (!dma_window) {
 		panic("PCI_DMA: getTceTableParmsPSeriesLP: device %s has no ibm,dma-window property!\n", dn->full_name);
@@ -985,6 +995,7 @@
 	PPCDBG(PPCDBG_TCEINIT, "\tnewTceTable->index       = 0x%lx\n", newTceTable->index);
 	PPCDBG(PPCDBG_TCEINIT, "\tnewTceTable->startOffset = 0x%lx\n", newTceTable->startOffset);
 	PPCDBG(PPCDBG_TCEINIT, "\tnewTceTable->size        = 0x%lx\n", newTceTable->size);
+#endif
 }
 
 /* Allocates a contiguous real buffer and creates TCEs over it.
diff -Nru a/arch/ppc64/kernel/pci_dn.c b/arch/ppc64/kernel/pci_dn.c
--- a/arch/ppc64/kernel/pci_dn.c	Tue Feb  3 19:45:43 2004
+++ b/arch/ppc64/kernel/pci_dn.c	Tue Feb  3 19:45:43 2004
@@ -46,6 +46,7 @@
 static void * __init
 update_dn_pci_info(struct device_node *dn, void *data)
 {
+#ifdef CONFIG_PPC_PSERIES
 	struct pci_controller *phb = (struct pci_controller *)data;
 	u32 *regs;
 	char *device_type = get_property(dn, "device_type", 0);
@@ -64,6 +65,7 @@
 			dn->devfn = (regs[0] >> 8) & 0xff;
 		}
 	}
+#endif
 	return NULL;
 }
 
@@ -97,6 +99,7 @@
 		return ret;
 	for (dn = start->child; dn; dn = nextdn) {
 		nextdn = NULL;
+#ifdef CONFIG_PPC_PSERIES
 		if (get_property(dn, "class-code", 0)) {
 			if (pre && (ret = pre(dn, data)) != NULL)
 				return ret;
@@ -112,6 +115,7 @@
 					post(dn, data);
 			}
 		}
+#endif
 		if (!nextdn) {
 			/* Walk up to next valid sibling. */
 			do {
diff -Nru a/arch/ppc64/kernel/ppc_ksyms.c b/arch/ppc64/kernel/ppc_ksyms.c
--- a/arch/ppc64/kernel/ppc_ksyms.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc64/kernel/ppc_ksyms.c	Tue Feb  3 19:45:17 2004
@@ -39,6 +39,7 @@
 #include <asm/hw_irq.h>
 #include <asm/abs_addr.h>
 #include <asm/cacheflush.h>
+#include <asm/proc_fs.h>
 #ifdef CONFIG_PPC_ISERIES
 #include <asm/iSeries/iSeries_pci.h>
 #include <asm/iSeries/iSeries_proc.h>
@@ -82,7 +83,7 @@
 EXPORT_SYMBOL(naca);
 EXPORT_SYMBOL(__down);
 
-/* EXPORT_SYMBOL(csum_partial); already in net/netsyms.c */
+EXPORT_SYMBOL(csum_partial);
 EXPORT_SYMBOL(csum_partial_copy_generic);
 EXPORT_SYMBOL(ip_fast_csum);
 EXPORT_SYMBOL(csum_tcpudp_magic);
@@ -163,21 +164,23 @@
 EXPORT_SYMBOL(flush_instruction_cache);
 EXPORT_SYMBOL(_get_PVR);
 EXPORT_SYMBOL(giveup_fpu);
-EXPORT_SYMBOL(enable_kernel_fp);
+#ifdef CONFIG_ALTIVEC
+EXPORT_SYMBOL(giveup_altivec);
+#endif
 EXPORT_SYMBOL(flush_icache_range);
 EXPORT_SYMBOL(flush_icache_user_range);
 EXPORT_SYMBOL(flush_dcache_page);
 #ifdef CONFIG_SMP
 #ifdef CONFIG_PPC_ISERIES
-EXPORT_SYMBOL(__no_use_restore_flags);
-EXPORT_SYMBOL(__no_use_save_flags);
-EXPORT_SYMBOL(__no_use_sti);
-EXPORT_SYMBOL(__no_use_cli);
+EXPORT_SYMBOL(local_get_flags);
+EXPORT_SYMBOL(local_irq_disable);
+EXPORT_SYMBOL(local_irq_restore);
 #endif
 #endif
 
 EXPORT_SYMBOL(ppc_md);
 
+#ifdef CONFIG_PPC_PSERIES
 EXPORT_SYMBOL(find_devices);
 EXPORT_SYMBOL(find_type_devices);
 EXPORT_SYMBOL(find_compatible_devices);
@@ -186,13 +189,14 @@
 EXPORT_SYMBOL(machine_is_compatible);
 EXPORT_SYMBOL(find_all_nodes);
 EXPORT_SYMBOL(get_property);
-
+#endif
 
 EXPORT_SYMBOL_NOVERS(memcpy);
 EXPORT_SYMBOL_NOVERS(memset);
 EXPORT_SYMBOL_NOVERS(memmove);
 EXPORT_SYMBOL_NOVERS(memscan);
 EXPORT_SYMBOL_NOVERS(memcmp);
+EXPORT_SYMBOL_NOVERS(memchr);
 
 EXPORT_SYMBOL(abs);
 
@@ -222,3 +226,4 @@
 
 EXPORT_SYMBOL(tb_ticks_per_usec);
 EXPORT_SYMBOL(paca);
+EXPORT_SYMBOL(proc_ppc64);
diff -Nru a/arch/ppc64/kernel/proc_pmc.c b/arch/ppc64/kernel/proc_pmc.c
--- a/arch/ppc64/kernel/proc_pmc.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc64/kernel/proc_pmc.c	Tue Feb  3 19:45:17 2004
@@ -44,8 +44,6 @@
 
 static int proc_pmc_control_mode = 0;
 
-static struct proc_dir_entry *proc_ppc64_root = NULL;
-static struct proc_dir_entry *proc_ppc64_pmc_root = NULL;
 static struct proc_dir_entry *proc_ppc64_pmc_system_root = NULL;
 static struct proc_dir_entry *proc_ppc64_pmc_cpu_root[NR_CPUS] = {NULL, };
 
@@ -82,8 +80,8 @@
 int proc_pmc_set_pmc7(  struct file *file, const char *buffer, unsigned long count, void *data);
 int proc_pmc_set_pmc8(  struct file *file, const char *buffer, unsigned long count, void *data);
 
-
-void proc_ppc64_init(void)
+#if 0
+int proc_ppc64_init(void)
 {
 	unsigned long i;
 	struct proc_dir_entry *ent = NULL;
@@ -97,15 +95,21 @@
 	 *   /proc/ppc64/pmc/cpu0 
 	 */
 	spin_lock(&proc_ppc64_lock);
-	proc_ppc64_root = proc_mkdir("ppc64", 0);
-	if (!proc_ppc64_root) return;
+	if (proc_ppc64.root == NULL) {
+		proc_ppc64_init();
+		if (!proc_ppc64.root) {
+			spin_unlock(&proc_ppc64_lock);
+			return;
+		}
+	}
 	spin_unlock(&proc_ppc64_lock);
 
 	/* Placeholder for rtas interfaces. */
-	rtas_proc_dir = proc_mkdir("rtas", proc_ppc64_root);
-
+	if (proc_ppc64.rtas == NULL) {
+		return;
+	}
 
-	proc_ppc64_pmc_root = proc_mkdir("pmc", proc_ppc64_root);
+	proc_ppc64_pmc_root = proc_mkdir("pmc", proc_ppc64.root);
 
 	proc_ppc64_pmc_system_root = proc_mkdir("system", proc_ppc64_pmc_root);
 	for (i = 0; i < NR_CPUS; i++) {
@@ -116,7 +120,6 @@
 		}
 	}
 
-
 	/* Create directories for the software counters. */
 	for (i = 0; i < NR_CPUS; i++) {
 		if (!cpu_online(i))
@@ -181,6 +184,7 @@
 		ent->write_proc = NULL;
 	}
 }
+#endif
 
 /*
  * Find the requested 'file' given a proc token.
diff -Nru a/arch/ppc64/kernel/proc_ppc64.c b/arch/ppc64/kernel/proc_ppc64.c
--- a/arch/ppc64/kernel/proc_ppc64.c	Tue Feb  3 19:45:34 2004
+++ b/arch/ppc64/kernel/proc_ppc64.c	Tue Feb  3 19:45:34 2004
@@ -27,9 +27,12 @@
  * End Change Activity 
  */
 
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/proc_fs.h>
+#include <linux/slab.h>
+#include <linux/kernel.h>
 
 #include <asm/proc_fs.h>
 #include <asm/naca.h>
@@ -37,6 +40,7 @@
 #include <asm/systemcfg.h>
 #include <asm/rtas.h>
 #include <asm/uaccess.h>
+#include <asm/prom.h>
 
 struct proc_ppc64_t proc_ppc64;
 
@@ -52,15 +56,32 @@
 	.mmap	= page_map_mmap
 };
 
+#ifdef CONFIG_PPC_PSERIES
+/* routines for /proc/ppc64/ofdt */
+static ssize_t ofdt_write(struct file *, const char __user *, size_t, loff_t *);
+static void proc_ppc64_create_ofdt(struct proc_dir_entry *);
+static int do_remove_node(char *);
+static int do_add_node(char *, size_t);
+static void release_prop_list(const struct property *);
+static struct property *new_property(const char *, const int, const unsigned char *, struct property *);
+static char * parse_next_property(char *, char *, char **, int *, unsigned char**);
+static struct file_operations ofdt_fops = {
+	.write = ofdt_write
+};
+#endif
 
-static int __init proc_ppc64_init(void)
+int __init proc_ppc64_init(void)
 {
 
-	printk(KERN_INFO "proc_ppc64: Creating /proc/ppc64/\n");
 
-	proc_ppc64.root = proc_mkdir("ppc64", 0);
-	if (!proc_ppc64.root)
+	if (proc_ppc64.root == NULL) {
+		printk(KERN_INFO "proc_ppc64: Creating /proc/ppc64/\n");
+		proc_ppc64.root = proc_mkdir("ppc64", 0);
+		if (!proc_ppc64.root)
+			return 0;
+	} else {
 		return 0;
+	}
 
 	proc_ppc64.naca = create_proc_entry("naca", S_IRUSR, proc_ppc64.root);
 	if ( proc_ppc64.naca ) {
@@ -90,8 +111,16 @@
 		}
 	}
 
+#ifdef CONFIG_PPC_PSERIES
 	/* Placeholder for rtas interfaces. */
-	proc_ppc64.rtas = proc_mkdir("rtas", proc_ppc64.root);
+	if (proc_ppc64.rtas == NULL)
+		proc_ppc64.rtas = proc_mkdir("rtas", proc_ppc64.root);
+
+	if (proc_ppc64.rtas)
+		proc_symlink("rtas", 0, "ppc64/rtas");
+
+	proc_ppc64_create_ofdt(proc_ppc64.root);
+#endif
 
 	return 0;
 }
@@ -173,5 +202,228 @@
 	return 0;
 }
 
-fs_initcall(proc_ppc64_init);
+#ifdef CONFIG_PPC_PSERIES
+/* create /proc/ppc64/ofdt write-only by root */
+static void proc_ppc64_create_ofdt(struct proc_dir_entry *parent)
+{
+	struct proc_dir_entry *ent;
+
+	ent = create_proc_entry("ofdt", S_IWUSR, parent);
+	if (ent) {
+		ent->nlink = 1;
+		ent->data = NULL;
+		ent->size = 0;
+		ent->proc_fops = &ofdt_fops;
+	}
+}
+
+/**
+ * ofdt_write - perform operations on the Open Firmware device tree
+ *
+ * @file: not used
+ * @buf: command and arguments
+ * @count: size of the command buffer
+ * @off: not used
+ *
+ * Operations supported at this time are addition and removal of
+ * whole nodes along with their properties.  Operations on individual
+ * properties are not implemented (yet).
+ */
+static ssize_t ofdt_write(struct file *file, const char __user *buf, size_t count, loff_t *off)
+{
+	int rv = 0;
+	char *kbuf;
+	char *tmp;
+
+	if (!(kbuf = kmalloc(count + 1, GFP_KERNEL))) {
+		rv = -ENOMEM;
+		goto out;
+	}
+	if (copy_from_user(kbuf, buf, count)) {
+		rv = -EFAULT;
+		goto out;
+	}
+
+	kbuf[count] = '\0';
+
+	tmp = strchr(kbuf, ' ');
+	if (!tmp) {
+		rv = -EINVAL;
+		goto out;
+	}
+	*tmp = '\0';
+	tmp++;
+
+	if (!strcmp(kbuf, "add_node"))
+		rv = do_add_node(tmp, count - (tmp - kbuf));
+	else if (!strcmp(kbuf, "remove_node"))
+		rv = do_remove_node(tmp);
+	else
+		rv = -EINVAL;
+out:
+	kfree(kbuf);
+	return rv ? rv : count;
+}
+
+static int do_remove_node(char *buf)
+{
+	struct device_node *node;
+	int rv = 0;
+
+	if ((node = of_find_node_by_path(buf)))
+		of_remove_node(node);
+	else
+		rv = -ENODEV;
+
+	of_node_put(node);
+	return rv;
+}
+
+static int do_add_node(char *buf, size_t bufsize)
+{
+	char *path, *end, *name;
+	struct device_node *np;
+	struct property *prop = NULL;
+	unsigned char* value;
+	int length, rv = 0;
+
+	end = buf + bufsize;
+	path = buf;
+	buf = strchr(buf, ' ');
+	if (!buf)
+		return -EINVAL;
+	*buf = '\0';
+	buf++;
+
+	if ((np = of_find_node_by_path(path))) {
+		of_node_put(np);
+		return -EINVAL;
+	}
 
+	/* rv = build_prop_list(tmp, bufsize - (tmp - buf), &proplist); */
+	while (buf < end &&
+	       (buf = parse_next_property(buf, end, &name, &length, &value))) {
+		struct property *last = prop;
+
+		prop = new_property(name, length, value, last);
+		if (!prop) {
+			rv = -ENOMEM;
+			prop = last;
+			goto out;
+		}
+	}
+	if (!buf) {
+		rv = -EINVAL;
+		goto out;
+	}
+
+	rv = of_add_node(path, prop);
+
+out:
+	if (rv)
+		release_prop_list(prop);
+	return rv;
+}
+
+static struct property *new_property(const char *name, const int length, const unsigned char *value, struct property *last)
+{
+	struct property *new = kmalloc(sizeof(*new), GFP_KERNEL);
+
+	if (!new)
+		return NULL;
+	memset(new, 0, sizeof(*new));
+
+	if (!(new->name = kmalloc(strlen(name) + 1, GFP_KERNEL)))
+		goto cleanup;
+	if (!(new->value = kmalloc(length + 1, GFP_KERNEL)))
+		goto cleanup;
+
+	strcpy(new->name, name);
+	memcpy(new->value, value, length);
+	*(((char *)new->value) + length) = 0;
+	new->length = length;
+	new->next = last;
+	return new;
+
+cleanup:
+	if (new->name)
+		kfree(new->name);
+	if (new->value)
+		kfree(new->value);
+	kfree(new);
+	return NULL;
+}
+
+/**
+ * parse_next_property - process the next property from raw input buffer
+ * @buf: input buffer, must be nul-terminated
+ * @end: end of the input buffer + 1, for validation
+ * @name: return value; set to property name in buf
+ * @length: return value; set to length of value
+ * @value: return value; set to the property value in buf
+ *
+ * Note that the caller must make copies of the name and value returned,
+ * this function does no allocation or copying of the data.  Return value
+ * is set to the next name in buf, or NULL on error.
+ */
+static char * parse_next_property(char *buf, char *end, char **name, int *length, unsigned char **value)
+{
+	char *tmp;
+
+	*name = buf;
+
+	tmp = strchr(buf, ' ');
+	if (!tmp) {
+		printk(KERN_ERR "property parse failed in %s at line %d\n", __FUNCTION__, __LINE__);
+		return NULL;
+	}
+	*tmp = '\0';
+
+	if (++tmp >= end) {
+		printk(KERN_ERR "property parse failed in %s at line %d\n", __FUNCTION__, __LINE__);
+		return NULL;
+	}
+
+	/* now we're on the length */
+	*length = -1;
+	*length = simple_strtoul(tmp, &tmp, 10);
+	if (*length == -1) {
+		printk(KERN_ERR "property parse failed in %s at line %d\n", __FUNCTION__, __LINE__);
+		return NULL;
+	}
+	if (*tmp != ' ' || ++tmp >= end) {
+		printk(KERN_ERR "property parse failed in %s at line %d\n", __FUNCTION__, __LINE__);
+		return NULL;
+	}
+
+	/* now we're on the value */
+	*value = tmp;
+	tmp += *length;
+	if (tmp > end) {
+		printk(KERN_ERR "property parse failed in %s at line %d\n", __FUNCTION__, __LINE__);
+		return NULL;
+	}
+	else if (tmp < end && *tmp != ' ' && *tmp != '\0') {
+		printk(KERN_ERR "property parse failed in %s at line %d\n", __FUNCTION__, __LINE__);
+		return NULL;
+	}
+	tmp++;
+
+	/* and now we should be on the next name, or the end */
+	return tmp;
+}
+
+static void release_prop_list(const struct property *prop)
+{
+	struct property *next;
+	for (; prop; prop = next) {
+		next = prop->next;
+		kfree(prop->name);
+		kfree(prop->value);
+		kfree(prop);
+	}
+
+}
+#endif	/* defined(CONFIG_PPC_PSERIES) */
+
+fs_initcall(proc_ppc64_init);
diff -Nru a/arch/ppc64/kernel/process.c b/arch/ppc64/kernel/process.c
--- a/arch/ppc64/kernel/process.c	Tue Feb  3 19:45:30 2004
+++ b/arch/ppc64/kernel/process.c	Tue Feb  3 19:45:30 2004
@@ -50,7 +50,10 @@
 #include <asm/cputable.h>
 #include <asm/sections.h>
 
+#ifndef CONFIG_SMP
 struct task_struct *last_task_used_math = NULL;
+struct task_struct *last_task_used_altivec = NULL;
+#endif
 
 struct mm_struct ioremap_mm = { pgd             : ioremap_dir  
                                ,page_table_lock : SPIN_LOCK_UNLOCKED };
@@ -58,8 +61,7 @@
 char *sysmap = NULL;
 unsigned long sysmap_size = 0;
 
-void
-enable_kernel_fp(void)
+void enable_kernel_fp(void)
 {
 #ifdef CONFIG_SMP
 	if (current->thread.regs && (current->thread.regs->msr & MSR_FP))
@@ -70,6 +72,7 @@
 	giveup_fpu(last_task_used_math);
 #endif /* CONFIG_SMP */
 }
+EXPORT_SYMBOL(enable_kernel_fp);
 
 int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs)
 {
@@ -85,6 +88,31 @@
 	return 1;
 }
 
+#ifdef CONFIG_ALTIVEC
+
+void enable_kernel_altivec(void)
+{
+#ifdef CONFIG_SMP
+	if (current->thread.regs && (current->thread.regs->msr & MSR_VEC))
+		giveup_altivec(current);
+	else
+		giveup_altivec(NULL);	/* just enables FP for kernel */
+#else
+	giveup_altivec(last_task_used_altivec);
+#endif /* CONFIG_SMP */
+}
+EXPORT_SYMBOL(enable_kernel_altivec);
+
+int dump_task_altivec(struct pt_regs *regs, elf_vrregset_t *vrregs)
+{
+	if (regs->msr & MSR_VEC)
+		giveup_altivec(current);
+	memcpy(vrregs, &current->thread.vr[0], sizeof(*vrregs));
+	return 1;
+}
+
+#endif /* CONFIG_ALTIVEC */
+
 struct task_struct *__switch_to(struct task_struct *prev,
 				struct task_struct *new)
 {
@@ -104,14 +132,50 @@
 	 */
 	if (prev->thread.regs && (prev->thread.regs->msr & MSR_FP))
 		giveup_fpu(prev);
+#ifdef CONFIG_ALTIVEC
+	if (prev->thread.regs && (prev->thread.regs->msr & MSR_VEC))
+		giveup_altivec(prev);
+#endif /* CONFIG_ALTIVEC */
 #endif /* CONFIG_SMP */
 
+#if defined(CONFIG_ALTIVEC) && !defined(CONFIG_SMP)
+	/* Avoid the trap.  On smp this this never happens since
+	 * we don't set last_task_used_altivec -- Cort
+	 */
+	if (new->thread.regs && last_task_used_altivec == new)
+		new->thread.regs->msr |= MSR_VEC;
+#endif /* CONFIG_ALTIVEC */
+
 	new_thread = &new->thread;
 	old_thread = &current->thread;
 
 	local_irq_save(flags);
 	last = _switch(old_thread, new_thread);
+
+	/*
+	 * force our kernel stack out of the ERAT and SLB, this is to
+	 * avoid the race where we it hangs around in the ERAT but not the
+	 * SLB and the ERAT gets invalidated at just the wrong moment by
+	 * another CPU doing a tlbie.
+	 *
+	 * We definitely dont want to flush our bolted segment, so check
+	 * for that first.
+	 */
+	if ((cur_cpu_spec->cpu_features & CPU_FTR_SLB) &&
+	    GET_ESID((unsigned long)_get_SP()) != GET_ESID(PAGE_OFFSET)) {
+		union {
+			unsigned long word0;
+			slb_dword0 data;
+		} esid_data;
+
+		esid_data.word0 = 0;
+		/* class bit is in valid field for slbie instruction */
+		esid_data.data.v = 1;
+		esid_data.data.esid = GET_ESID((unsigned long)_get_SP());
+		asm volatile("isync; slbie %0; isync" : : "r" (esid_data));
+	}
 	local_irq_restore(flags);
+
 	return last;
 }
 
@@ -158,8 +222,14 @@
 
 void exit_thread(void)
 {
+#ifndef CONFIG_SMP
 	if (last_task_used_math == current)
 		last_task_used_math = NULL;
+#ifdef CONFIG_ALTIVEC
+	if (last_task_used_altivec == current)
+		last_task_used_altivec = NULL;
+#endif /* CONFIG_ALTIVEC */
+#endif /* CONFIG_SMP */
 }
 
 void flush_thread(void)
@@ -169,8 +239,14 @@
 	if (t->flags & _TIF_ABI_PENDING)
 		t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT);
 
+#ifndef CONFIG_SMP
 	if (last_task_used_math == current)
 		last_task_used_math = NULL;
+#ifdef CONFIG_ALTIVEC
+	if (last_task_used_altivec == current)
+		last_task_used_altivec = NULL;
+#endif /* CONFIG_ALTIVEC */
+#endif /* CONFIG_SMP */
 }
 
 void
@@ -178,6 +254,25 @@
 {
 }
 
+
+/*
+ * This gets called before we allocate a new thread and copy
+ * the current task into it.
+ */
+void prepare_to_copy(struct task_struct *tsk)
+{
+	struct pt_regs *regs = tsk->thread.regs;
+
+	if (regs == NULL)
+		return;
+	if (regs->msr & MSR_FP)
+		giveup_fpu(current);
+#ifdef CONFIG_ALTIVEC
+	if (regs->msr & MSR_VEC)
+		giveup_altivec(current);
+#endif /* CONFIG_ALTIVEC */
+}
+
 /*
  * Copy a thread..
  */
@@ -268,9 +363,25 @@
 	regs->gpr[1] = sp;
 	regs->gpr[2] = toc;
 	regs->msr = MSR_USER64;
+#ifndef CONFIG_SMP
 	if (last_task_used_math == current)
 		last_task_used_math = 0;
+#endif /* CONFIG_SMP */
+	memset(current->thread.fpr, 0, sizeof(current->thread.fpr));
 	current->thread.fpscr = 0;
+#ifdef CONFIG_ALTIVEC
+#ifndef CONFIG_SMP
+	if (last_task_used_altivec == current)
+		last_task_used_altivec = 0;
+#endif /* CONFIG_SMP */
+	memset(current->thread.vr, 0, sizeof(current->thread.vr));
+	current->thread.vscr.u[0] = 0;
+	current->thread.vscr.u[1] = 0;
+	current->thread.vscr.u[2] = 0;
+	current->thread.vscr.u[3] = 0x00010000; /* Java mode disabled */
+	current->thread.vrsave = 0;
+	current->thread.used_vr = 0;
+#endif /* CONFIG_ALTIVEC */
 }
 
 int set_fpexc_mode(struct task_struct *tsk, unsigned int val)
@@ -314,9 +425,6 @@
 		}
 	}
 
-	if (regs->msr & MSR_FP)
-		giveup_fpu(current);
-
 	return do_fork(clone_flags & ~CLONE_IDLETASK, p2, regs, 0,
 		    (int *)parent_tidptr, (int *)child_tidptr);
 }
@@ -325,9 +433,6 @@
 	     unsigned long p4, unsigned long p5, unsigned long p6,
 	     struct pt_regs *regs)
 {
-	if (regs->msr & MSR_FP)
-		giveup_fpu(current);
-
 	return do_fork(SIGCHLD, regs->gpr[1], regs, 0, NULL, NULL);
 }
 
@@ -335,9 +440,6 @@
 	      unsigned long p4, unsigned long p5, unsigned long p6,
 	      struct pt_regs *regs)
 {
-	if (regs->msr & MSR_FP)
-		giveup_fpu(current);
-
 	return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->gpr[1], regs, 0,
 	            NULL, NULL);
 }
@@ -355,7 +457,10 @@
 		goto out;
 	if (regs->msr & MSR_FP)
 		giveup_fpu(current);
-  
+#ifdef CONFIG_ALTIVEC
+	if (regs->msr & MSR_VEC)
+		giveup_altivec(current);
+#endif /* CONFIG_ALTIVEC */
 	error = do_execve(filename, (char **) a1, (char **) a2, regs);
   
 	if (error == 0)
diff -Nru a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c
--- a/arch/ppc64/kernel/prom.c	Tue Feb  3 19:45:34 2004
+++ b/arch/ppc64/kernel/prom.c	Tue Feb  3 19:45:34 2004
@@ -29,6 +29,7 @@
 #include <linux/spinlock.h>
 #include <linux/types.h>
 #include <linux/pci.h>
+#include <linux/proc_fs.h>
 #include <asm/prom.h>
 #include <asm/rtas.h>
 #include <asm/lmb.h>
@@ -44,8 +45,10 @@
 #include <asm/bitops.h>
 #include <asm/naca.h>
 #include <asm/pci.h>
+#include <asm/pci_dma.h>
 #include <asm/bootinfo.h>
 #include <asm/ppcdebug.h>
+#include <asm/sections.h>
 #include "open_pic.h"
 
 #ifdef CONFIG_LOGO_LINUX_CLUT224
@@ -147,8 +150,13 @@
 char *bootdevice = 0;
 
 int boot_cpuid = 0;
+#define MAX_CPU_THREADS 2
 
 struct device_node *allnodes = 0;
+/* use when traversing tree through the allnext, child, sibling,
+ * or parent members of struct device_node.
+ */
+static rwlock_t devtree_lock = RW_LOCK_UNLOCKED;
 
 #define UNDEFINED_IRQ 0xffff
 unsigned short real_irq_to_virt_map[NR_HW_IRQS];
@@ -156,7 +164,7 @@
 int last_virt_irq = 2;	/* index of last virt_irq.  Skip through IPI */
 
 static unsigned long call_prom(const char *service, int nargs, int nret, ...);
-static void prom_exit(void);
+static void prom_panic(const char *reason);
 static unsigned long copy_device_tree(unsigned long);
 static unsigned long inspect_node(phandle, struct device_node *, unsigned long,
 				  unsigned long, struct device_node ***);
@@ -168,6 +176,11 @@
 static struct bi_record * prom_bi_rec_verify(struct bi_record *);
 static unsigned long prom_bi_rec_reserve(unsigned long);
 static struct device_node *find_phandle(phandle);
+static void of_node_cleanup(struct device_node *);
+static struct device_node *derive_parent(const char *);
+static void add_node_proc_entries(struct device_node *);
+static void remove_node_proc_entries(struct device_node *);
+static int of_finish_dynamic_node(struct device_node *);
 
 #ifdef DEBUG_PROM
 void prom_dump_lmb(void);
@@ -223,10 +236,12 @@
 
 
 static void __init
-prom_exit()
+prom_panic(const char *reason)
 {
 	unsigned long offset = reloc_offset();
 
+	prom_print(reason);
+	/* ToDo: should put up an SRC here */
 	call_prom(RELOC("exit"), 0, 0);
 
 	for (;;)			/* should never get here */
@@ -602,6 +617,9 @@
 						      _rtas->base) >= 0) {
 				_rtas->entry = (long)_prom->args.rets[1];
 			}
+			RELOC(rtas_rmo_buf)
+				= lmb_alloc_base(RTAS_RMOBUF_MAX, PAGE_SIZE,
+							rtas_region);
 		}
 
 		if (_rtas->entry <= 0) {
@@ -785,8 +803,7 @@
 		base = lmb_alloc(minsize, align);
 
 		if ( !base ) {
-			prom_print(RELOC("ERROR, cannot find space for TCE table.\n"));
-			prom_exit();
+			prom_panic(RELOC("ERROR, cannot find space for TCE table.\n"));
 		}
 
 		vbase = absolute_to_virt(base);
@@ -884,16 +901,21 @@
 prom_hold_cpus(unsigned long mem)
 {
 	unsigned long i;
-	unsigned int cpuid;
+	unsigned int reg;
 	phandle node;
 	unsigned long offset = reloc_offset();
 	char type[64], *path;
+	int cpuid = 0;
+	unsigned int interrupt_server[MAX_CPU_THREADS];
+	unsigned int cpu_threads, hw_cpu_num;
+	int propsize;
 	extern void __secondary_hold(void);
         extern unsigned long __secondary_hold_spinloop;
         extern unsigned long __secondary_hold_acknowledge;
         unsigned long *spinloop     = __v2a(&__secondary_hold_spinloop);
         unsigned long *acknowledge  = __v2a(&__secondary_hold_acknowledge);
         unsigned long secondary_hold = (unsigned long)__v2a(*PTRRELOC((unsigned long *)__secondary_hold));
+        struct naca_struct *_naca = RELOC(naca);
         struct systemcfg *_systemcfg = RELOC(systemcfg);
 	struct paca_struct *_xPaca = PTRRELOC(&paca[0]);
 	struct prom_t *_prom = PTRRELOC(&prom);
@@ -946,13 +968,9 @@
 		if (strcmp(type, RELOC("okay")) != 0)
 			continue;
 
-                cpuid = -1;
+                reg = -1;
 		call_prom(RELOC("getprop"), 4, 1, node, RELOC("reg"),
-			  &cpuid, sizeof(cpuid));
-
-		/* Only need to start secondary procs, not ourself. */
-		if ( cpuid == _prom->cpu )
-			continue;
+			  &reg, sizeof(reg));
 
 		path = (char *) mem;
 		memset(path, 0, 256);
@@ -962,12 +980,14 @@
 
 #ifdef DEBUG_PROM
 		prom_print_nl();
-		prom_print(RELOC("cpu hw idx   = 0x"));
+		prom_print(RELOC("cpuid        = 0x"));
 		prom_print_hex(cpuid);
 		prom_print_nl();
+		prom_print(RELOC("cpu hw idx   = 0x"));
+		prom_print_hex(reg);
+		prom_print_nl();
 #endif
-		prom_print(RELOC("starting cpu "));
-		prom_print(path);
+		_xPaca[cpuid].xHwProcNum = reg;
 
 		/* Init the acknowledge var which will be reset by
 		 * the secondary cpu when it awakens from its OF
@@ -975,45 +995,85 @@
 		 */
 		*acknowledge = (unsigned long)-1;
 
-#ifdef DEBUG_PROM
-		prom_print(RELOC("    3) spinloop       = 0x"));
-		prom_print_hex(spinloop);
-		prom_print_nl();
-		prom_print(RELOC("    3) *spinloop      = 0x"));
-		prom_print_hex(*spinloop);
-		prom_print_nl();
-		prom_print(RELOC("    3) acknowledge    = 0x"));
-		prom_print_hex(acknowledge);
-		prom_print_nl();
-		prom_print(RELOC("    3) *acknowledge   = 0x"));
-		prom_print_hex(*acknowledge);
-		prom_print_nl();
-		prom_print(RELOC("    3) secondary_hold = 0x"));
-		prom_print_hex(secondary_hold);
-		prom_print_nl();
-#endif
-		call_prom(RELOC("start-cpu"), 3, 0, node, secondary_hold, cpuid);
-		prom_print(RELOC("..."));
-		for ( i = 0 ; (i < 100000000) && 
-			      (*acknowledge == ((unsigned long)-1)); i++ ) ;
-#ifdef DEBUG_PROM
-		{
-			unsigned long *p = 0x0;
-			prom_print(RELOC("    4) 0x0 = 0x"));
-			prom_print_hex(*p);
-			prom_print_nl();
+		propsize = call_prom(RELOC("getprop"), 4, 1, node,
+				     RELOC("ibm,ppc-interrupt-server#s"), 
+				     &interrupt_server, 
+				     sizeof(interrupt_server));
+		if (propsize < 0) {
+			/* no property.  old hardware has no SMT */
+			cpu_threads = 1;
+			interrupt_server[0] = reg; /* fake it with phys id */
+		} else {
+			/* We have a threaded processor */
+			cpu_threads = propsize / sizeof(u32);
+			if (cpu_threads > MAX_CPU_THREADS) {
+				prom_print(RELOC("SMT: too many threads!\nSMT: found "));
+				prom_print_hex(cpu_threads);
+				prom_print(RELOC(", max is "));
+				prom_print_hex(MAX_CPU_THREADS);
+				prom_print_nl();
+				cpu_threads = 1; /* ToDo: panic? */
+			}
 		}
+
+		hw_cpu_num = interrupt_server[0];
+		if (hw_cpu_num != _prom->cpu) {
+			/* Primary Thread of non-boot cpu */
+			prom_print_hex(cpuid);
+			prom_print(RELOC(" : starting cpu "));
+			prom_print(path);
+			prom_print(RELOC("..."));
+			call_prom(RELOC("start-cpu"), 3, 0, node, 
+				  secondary_hold, cpuid);
+
+			for ( i = 0 ; (i < 100000000) && 
+			      (*acknowledge == ((unsigned long)-1)); i++ ) ;
+
+			if (*acknowledge == cpuid) {
+				prom_print(RELOC("ok\n"));
+#ifdef CONFIG_SMP
+				/* Set the number of active processors. */
+				_systemcfg->processorCount++;
+				cpu_set(cpuid, RELOC(cpu_available_map));
+				cpu_set(cpuid, RELOC(cpu_possible_map));
+				cpu_set(cpuid, RELOC(cpu_present_at_boot));
 #endif
-		if (*acknowledge == cpuid) {
-			prom_print(RELOC("ok\n"));
-			/* Set the number of active processors. */
-			_systemcfg->processorCount++;
-			_xPaca[cpuid].active = 1;
-		} else {
-			prom_print(RELOC("failed: "));
-			prom_print_hex(*acknowledge);
+			} else {
+				prom_print(RELOC("failed: "));
+				prom_print_hex(*acknowledge);
+				prom_print_nl();
+				/* prom_panic(RELOC("cpu failed to start")); */
+			}
+		}
+#ifdef CONFIG_SMP
+		else {
+			prom_print_hex(cpuid);
+			prom_print(RELOC(" : booting  cpu "));
+			prom_print(path);
+			prom_print_nl();
+			cpu_set(cpuid, RELOC(cpu_available_map));
+			cpu_set(cpuid, RELOC(cpu_possible_map));
+			cpu_set(cpuid, RELOC(cpu_online_map));
+			cpu_set(cpuid, RELOC(cpu_present_at_boot));
+		}
+
+		/* Init paca for secondary threads.   They start later. */
+		for (i=1; i < cpu_threads; i++) {
+			cpuid++;
+			_xPaca[cpuid].xHwProcNum = interrupt_server[i];
+			prom_print_hex(interrupt_server[i]);
+			prom_print(RELOC(" : preparing thread ... "));
+			if (_naca->smt_state) {
+				cpu_set(cpuid, RELOC(cpu_available_map));
+				cpu_set(cpuid, RELOC(cpu_present_at_boot));
+				prom_print(RELOC("available"));
+			} else {
+				prom_print(RELOC("not available"));
+			}
 			prom_print_nl();
 		}
+#endif
+		cpuid++;
 	}
 #ifdef CONFIG_HMT
 	/* Only enable HMT on processors that provide support. */
@@ -1023,10 +1083,10 @@
 		prom_print(RELOC("    starting secondary threads\n"));
 
 		for (i = 0; i < NR_CPUS; i += 2) {
-			if (!_xPaca[i].active)
+			if (!cpu_online(i))
 				continue;
 
-			if (i == boot_cpuid) {
+			if (i == 0) {
 				unsigned long pir = _get_PIR();
 				if (__is_processor(PV_PULSAR)) {
 					RELOC(hmt_thread_data)[i].pir = 
@@ -1036,7 +1096,8 @@
 						pir & 0x3ff;
 				}
 			}
-			_xPaca[i+1].active = 1;
+/* 			cpu_set(i+1, cpu_online_map); */
+			cpu_set(i+1, RELOC(cpu_possible_map));
 		}
 		_systemcfg->processorCount *= 2;
 	} else {
@@ -1049,6 +1110,105 @@
 #endif
 }
 
+static void
+smt_setup(void)
+{
+	char *p, *q;
+	char my_smt_enabled = SMT_DYNAMIC;
+	unsigned long my_smt_snooze_delay; 
+	ihandle prom_options = NULL;
+	char option[9];
+	unsigned long offset = reloc_offset();
+        struct naca_struct *_naca = RELOC(naca);
+	char found = 0;
+
+	if (strstr(RELOC(cmd_line), RELOC("smt-enabled="))) {
+		for (q = RELOC(cmd_line); (p = strstr(q, RELOC("smt-enabled="))) != 0; ) {
+			q = p + 12;
+			if (p > RELOC(cmd_line) && p[-1] != ' ')
+				continue;
+			found = 1;
+			if (q[0] == 'o' && q[1] == 'f' && 
+			    q[2] == 'f' && (q[3] == ' ' || q[3] == '\0')) {
+				my_smt_enabled = SMT_OFF;
+			} else if (q[0]=='o' && q[1] == 'n' && 
+				   (q[2] == ' ' || q[2] == '\0')) {
+				my_smt_enabled = SMT_ON;
+			} else {
+				my_smt_enabled = SMT_DYNAMIC;
+			} 
+		}
+	}
+	if (!found) {
+		prom_options = (ihandle)call_prom(RELOC("finddevice"), 1, 1, RELOC("/options"));
+		if (prom_options != (ihandle) -1) {
+			call_prom(RELOC("getprop"), 
+				4, 1, prom_options,
+				RELOC("ibm,smt-enabled"), 
+				option, 
+				sizeof(option));
+			if (option[0] != 0) {
+				found = 1;
+				if (!strcmp(option, "off"))	
+					my_smt_enabled = SMT_OFF;
+				else if (!strcmp(option, "on"))	
+					my_smt_enabled = SMT_ON;
+				else
+					my_smt_enabled = SMT_DYNAMIC;
+			}
+		}
+	}
+
+	if (!found )
+		my_smt_enabled = SMT_DYNAMIC; /* default to on */
+
+	found = 0;
+	if (my_smt_enabled) {
+		if (strstr(RELOC(cmd_line), RELOC("smt-snooze-delay="))) {
+			for (q = RELOC(cmd_line); (p = strstr(q, RELOC("smt-snooze-delay="))) != 0; ) {
+				q = p + 17;
+				if (p > RELOC(cmd_line) && p[-1] != ' ')
+					continue;
+				found = 1;
+				/* Don't use simple_strtoul() because _ctype & others aren't RELOC'd */
+				my_smt_snooze_delay = 0;
+				while (*q >= '0' && *q <= '9') {
+					my_smt_snooze_delay = my_smt_snooze_delay * 10 + *q - '0';
+					q++;
+				}
+			}
+		}
+
+		if (!found) {
+			prom_options = (ihandle)call_prom(RELOC("finddevice"), 1, 1, RELOC("/options"));
+			if (prom_options != (ihandle) -1) {
+				call_prom(RELOC("getprop"), 
+					4, 1, prom_options,
+					RELOC("ibm,smt-snooze-delay"), 
+					option, 
+					sizeof(option));
+				if (option[0] != 0) {
+					found = 1;
+					/* Don't use simple_strtoul() because _ctype & others aren't RELOC'd */
+					my_smt_snooze_delay = 0;
+					q = option;
+					while (*q >= '0' && *q <= '9') {
+						my_smt_snooze_delay = my_smt_snooze_delay * 10 + *q - '0';
+						q++;
+					}
+				}
+			}
+		}
+
+		if (!found) {
+			my_smt_snooze_delay = 30000; /* default value */
+		}
+	} else {
+		my_smt_snooze_delay = 0; /* default value */
+	}
+	_naca->smt_snooze_delay = my_smt_snooze_delay;
+	_naca->smt_state = my_smt_enabled;
+}
 
 /*
  * We enter here early on, when the Open Firmware prom is still
@@ -1065,12 +1225,20 @@
 	unsigned long offset = reloc_offset();
 	long l;
 	char *p, *d;
- 	unsigned long phys;
-        u32 getprop_rval;
-        struct systemcfg *_systemcfg = RELOC(systemcfg);
+	unsigned long phys;
+	u32 getprop_rval;
+	struct systemcfg *_systemcfg;
 	struct paca_struct *_xPaca = PTRRELOC(&paca[0]);
 	struct prom_t *_prom = PTRRELOC(&prom);
 
+	/* First zero the BSS -- use memset, some arches don't have
+	 * caches on yet */
+	memset(PTRRELOC(&__bss_start), 0, __bss_stop - __bss_start);
+
+	/* Setup systemcfg and NACA pointers now */
+	RELOC(systemcfg) = _systemcfg = (struct systemcfg *)(SYSTEMCFG_VIRT_ADDR - offset);
+	RELOC(naca) = (struct naca_struct *)(NACA_VIRT_ADDR - offset);
+
 	/* Default machine type. */
 	_systemcfg->platform = PLATFORM_PSERIES;
 
@@ -1092,12 +1260,12 @@
 				       RELOC("/chosen"));
 
 	if ((long)_prom->chosen <= 0)
-		prom_exit();
+		prom_panic(RELOC("cannot find chosen")); /* msg won't be printed :( */
 
         if ((long)call_prom(RELOC("getprop"), 4, 1, _prom->chosen,
 			    RELOC("stdout"), &getprop_rval,
 			    sizeof(getprop_rval)) <= 0)
-                prom_exit();
+                prom_panic(RELOC("cannot find stdout"));
 
         _prom->stdout = (ihandle)(unsigned long)getprop_rval;
 
@@ -1123,7 +1291,7 @@
         if ((long)call_prom(RELOC("getprop"), 4, 1, _prom->chosen,
 			    RELOC("cpu"), &getprop_rval,
 			    sizeof(getprop_rval)) <= 0)
-                prom_exit();
+                prom_panic(RELOC("cannot find boot cpu"));
 
 	prom_cpu = (ihandle)(unsigned long)getprop_rval;
 	cpu_pkg = call_prom(RELOC("instance-to-package"), 1, 1, prom_cpu);
@@ -1131,11 +1299,9 @@
 		cpu_pkg, RELOC("reg"),
 		&getprop_rval, sizeof(getprop_rval));
 	_prom->cpu = (int)(unsigned long)getprop_rval;
-	_xPaca[_prom->cpu].active = 1;
-#ifdef CONFIG_SMP
-	cpu_set(_prom->cpu, RELOC(cpu_online_map));
-#endif
-	RELOC(boot_cpuid) = _prom->cpu;
+	_xPaca[0].xHwProcNum = _prom->cpu;
+
+	RELOC(boot_cpuid) = 0;
 
 #ifdef DEBUG_PROM
   	prom_print(RELOC("Booting CPU hw index = 0x"));
@@ -1169,11 +1335,12 @@
         /* Initialize some system info into the Naca early... */
         mem = prom_initialize_naca(mem);
 
+	smt_setup();
+	
         /* If we are on an SMP machine, then we *MUST* do the
          * following, regardless of whether we have an SMP
          * kernel or not.
          */
-        if (_systemcfg->processorCount > 1)
 	        prom_hold_cpus(mem);
 
 #ifdef DEBUG_PROM
@@ -1381,8 +1548,7 @@
 
 	root = call_prom(RELOC("peer"), 1, 1, (phandle)0);
 	if (root == (phandle)0) {
-		prom_print(RELOC("couldn't get device tree root\n"));
-		prom_exit();
+		prom_panic(RELOC("couldn't get device tree root\n"));
 	}
 	allnextp = &RELOC(allnodes);
 	mem_start = DOUBLEWORD_ALIGN(mem_start);
@@ -1444,6 +1610,23 @@
 		*prev_propp = PTRUNRELOC(pp);
 		prev_propp = &pp->next;
 	}
+
+	/* Add a "linux_phandle" value */
+        if (np->node) {
+		u32 ibm_phandle = 0;
+		int len;
+
+                /* First see if "ibm,phandle" exists and use its value */
+                len = (int)
+                        call_prom(RELOC("getprop"), 4, 1, node, RELOC("ibm,phandle"),
+                                  &ibm_phandle, sizeof(ibm_phandle));
+                if (len < 0) {
+                        np->linux_phandle = np->node;
+                } else {
+                        np->linux_phandle = ibm_phandle;
+		}
+	}
+
 	*prev_propp = 0;
 
 	/* get the node's full name */
@@ -1487,7 +1670,7 @@
 
 	klimit = mem;
 
-	rtas.dev = find_devices("rtas");
+	rtas.dev = of_find_node_by_name(NULL, "rtas");
 }
 
 static unsigned long __init
@@ -1540,7 +1723,7 @@
 /*
  * Find the interrupt parent of a node.
  */
-static struct device_node * __init
+static struct device_node * __devinit
 intr_parent(struct device_node *p)
 {
 	phandle *parp;
@@ -1555,7 +1738,7 @@
  * Find out the size of each entry of the interrupts property
  * for a node.
  */
-static int __init
+static int __devinit
 prom_n_intr_cells(struct device_node *np)
 {
 	struct device_node *p;
@@ -1583,7 +1766,7 @@
  * Map an interrupt from a device up to the platform interrupt
  * descriptor.
  */
-static int __init
+static int __devinit
 map_interrupt(unsigned int **irq, struct device_node **ictrler,
 	      struct device_node *np, unsigned int *ints, int nintrc)
 {
@@ -1939,11 +2122,14 @@
 machine_is_compatible(const char *compat)
 {
 	struct device_node *root;
-	
-	root = find_path_device("/");
-	if (root == 0)
-		return 0;
-	return device_is_compatible(root, compat);
+	int rc = 0;
+  
+	root = of_find_node_by_path("/");
+	if (root) {
+		rc = device_is_compatible(root, compat);
+		of_node_put(root);
+	}
+	return rc;
 }
 
 /*
@@ -1983,16 +2169,572 @@
 	return NULL;
 }
 
+/*******
+ *
+ * New implementation of the OF "find" APIs, return a refcounted
+ * object, call of_node_put() when done.  The device tree and list
+ * are protected by a rw_lock.
+ *
+ * Note that property management will need some locking as well,
+ * this isn't dealt with yet.
+ *
+ *******/
+
+/**
+ *	of_find_node_by_name - Find a node by its "name" property
+ *	@from:	The node to start searching from or NULL, the node
+ *		you pass will not be searched, only the next one
+ *		will; typically, you pass what the previous call
+ *		returned. of_node_put() will be called on it
+ *	@name:	The name string to match against
+ *
+ *	Returns a node pointer with refcount incremented, use
+ *	of_node_put() on it when done.
+ */
+struct device_node *of_find_node_by_name(struct device_node *from,
+	const char *name)
+{
+	struct device_node *np;
+
+	read_lock(&devtree_lock);
+	np = from ? from->allnext : allnodes;
+	for (; np != 0; np = np->allnext)
+		if (np->name != 0 && strcasecmp(np->name, name) == 0
+		    && of_node_get(np))
+			break;
+	if (from)
+		of_node_put(from);
+	read_unlock(&devtree_lock);
+	return np;
+}
+
+/**
+ *	of_find_node_by_type - Find a node by its "device_type" property
+ *	@from:	The node to start searching from or NULL, the node
+ *		you pass will not be searched, only the next one
+ *		will; typically, you pass what the previous call
+ *		returned. of_node_put() will be called on it
+ *	@name:	The type string to match against
+ *
+ *	Returns a node pointer with refcount incremented, use
+ *	of_node_put() on it when done.
+ */
+struct device_node *of_find_node_by_type(struct device_node *from,
+	const char *type)
+{
+	struct device_node *np;
+
+	read_lock(&devtree_lock);
+	np = from ? from->allnext : allnodes;
+	for (; np != 0; np = np->allnext)
+		if (np->type != 0 && strcasecmp(np->type, type) == 0
+		    && of_node_get(np))
+			break;
+	if (from)
+		of_node_put(from);
+	read_unlock(&devtree_lock);
+	return np;
+}
+EXPORT_SYMBOL(of_find_node_by_type);
+
+/**
+ *	of_find_compatible_node - Find a node based on type and one of the
+ *                                tokens in its "compatible" property
+ *	@from:		The node to start searching from or NULL, the node
+ *			you pass will not be searched, only the next one
+ *			will; typically, you pass what the previous call
+ *			returned. of_node_put() will be called on it
+ *	@type:		The type string to match "device_type" or NULL to ignore
+ *	@compatible:	The string to match to one of the tokens in the device
+ *			"compatible" list.
+ *
+ *	Returns a node pointer with refcount incremented, use
+ *	of_node_put() on it when done.
+ */
+struct device_node *of_find_compatible_node(struct device_node *from,
+	const char *type, const char *compatible)
+{
+	struct device_node *np;
+
+	read_lock(&devtree_lock);
+	np = from ? from->allnext : allnodes;
+	for (; np != 0; np = np->allnext) {
+		if (type != NULL
+		    && !(np->type != 0 && strcasecmp(np->type, type) == 0))
+			continue;
+		if (device_is_compatible(np, compatible) && of_node_get(np))
+			break;
+	}
+	if (from)
+		of_node_put(from);
+	read_unlock(&devtree_lock);
+	return np;
+}
+
+/**
+ *	of_find_node_by_path - Find a node matching a full OF path
+ *	@path:	The full path to match
+ *
+ *	Returns a node pointer with refcount incremented, use
+ *	of_node_put() on it when done.
+ */
+struct device_node *of_find_node_by_path(const char *path)
+{
+	struct device_node *np = allnodes;
+
+	read_lock(&devtree_lock);
+	for (; np != 0; np = np->allnext)
+		if (np->full_name != 0 && strcasecmp(np->full_name, path) == 0
+		    && of_node_get(np))
+			break;
+	read_unlock(&devtree_lock);
+	return np;
+}
+
+/**
+ *	of_find_all_nodes - Get next node in global list
+ *	@prev:	Previous node or NULL to start iteration
+ *		of_node_put() will be called on it
+ *
+ *	Returns a node pointer with refcount incremented, use
+ *	of_node_put() on it when done.
+ */
+struct device_node *of_find_all_nodes(struct device_node *prev)
+{
+	struct device_node *np;
+
+	read_lock(&devtree_lock);
+	np = prev ? prev->allnext : allnodes;
+	for (; np != 0; np = np->allnext)
+		if (of_node_get(np))
+			break;
+	if (prev)
+		of_node_put(prev);
+	read_unlock(&devtree_lock);
+	return np;
+}
+
+/**
+ *	of_get_parent - Get a node's parent if any
+ *	@node:	Node to get parent
+ *
+ *	Returns a node pointer with refcount incremented, use
+ *	of_node_put() on it when done.
+ */
+struct device_node *of_get_parent(const struct device_node *node)
+{
+	struct device_node *np;
+
+	if (!node)
+		return NULL;
+
+	read_lock(&devtree_lock);
+	np = of_node_get(node->parent);
+	read_unlock(&devtree_lock);
+	return np;
+}
+
+/**
+ *	of_get_next_child - Iterate a node childs
+ *	@node:	parent node
+ *	@prev:	previous child of the parent node, or NULL to get first
+ *
+ *	Returns a node pointer with refcount incremented, use
+ *	of_node_put() on it when done.
+ */
+struct device_node *of_get_next_child(const struct device_node *node,
+	struct device_node *prev)
+{
+	struct device_node *next;
+
+	read_lock(&devtree_lock);
+	next = prev ? prev->sibling : node->child;
+	for (; next != 0; next = next->sibling)
+		if (of_node_get(next))
+			break;
+	if (prev)
+		of_node_put(prev);
+	read_unlock(&devtree_lock);
+	return next;
+}
+
+/**
+ *	of_node_get - Increment refcount of a node
+ *	@node:	Node to inc refcount, NULL is supported to
+ *		simplify writing of callers
+ *
+ *	Returns the node itself or NULL if gone.
+ */
+struct device_node *of_node_get(struct device_node *node)
+{
+	if (node && !OF_IS_STALE(node)) {
+		atomic_inc(&node->_users);
+		return node;
+	}
+	return NULL;
+}
+
+/**
+ *	of_node_put - Decrement refcount of a node
+ *	@node:	Node to dec refcount, NULL is supported to
+ *		simplify writing of callers
+ *
+ */
+void of_node_put(struct device_node *node)
+{
+	if (!node)
+		return;
+
+	WARN_ON(0 == atomic_read(&node->_users));
+
+	if (OF_IS_STALE(node)) {
+		if (atomic_dec_and_test(&node->_users)) {
+			of_node_cleanup(node);
+			return;
+		}
+	}
+	else
+		atomic_dec(&node->_users);
+}
+
+/**
+ *	of_node_cleanup - release a dynamically allocated node
+ *	@arg:  Node to be released
+ */
+static void of_node_cleanup(struct device_node *node)
+{
+	struct property *prop = node->properties;
+
+	if (!OF_IS_DYNAMIC(node))
+		return;
+	while (prop) {
+		struct property *next = prop->next;
+		kfree(prop->name);
+		kfree(prop->value);
+		kfree(prop);
+		prop = next;
+	}
+	kfree(node->intrs);
+	kfree(node->addrs);
+	kfree(node->full_name);
+	kfree(node);
+}
+
+/**
+ *	derive_parent - basically like dirname(1)
+ *	@path:  the full_name of a node to be added to the tree
+ *
+ *	Returns the node which should be the parent of the node
+ *	described by path.  E.g., for path = "/foo/bar", returns
+ *	the node with full_name = "/foo".
+ */
+static struct device_node *derive_parent(const char *path)
+{
+	struct device_node *parent = NULL;
+	char *parent_path = "/";
+	size_t parent_path_len = strrchr(path, '/') - path + 1;
+
+	/* reject if path is "/" */
+	if (!strcmp(path, "/"))
+		return NULL;
+
+	if (strrchr(path, '/') != path) {
+		parent_path = kmalloc(parent_path_len, GFP_KERNEL);
+		if (!parent_path)
+			return NULL;
+		strlcpy(parent_path, path, parent_path_len);
+	}
+	parent = of_find_node_by_path(parent_path);
+	if (strcmp(parent_path, "/"))
+		kfree(parent_path);
+	return parent;
+}
+
+/*
+ * Routines for "runtime" addition and removal of device tree nodes.
+ */
+
+/*
+ * Given a path and a property list, construct an OF device node, add
+ * it to the device tree and global list, and place it in
+ * /proc/device-tree.  This function may sleep.
+ */
+int of_add_node(const char *path, struct property *proplist)
+{
+	struct device_node *np;
+	int err = 0;
+
+	np = kmalloc(sizeof(struct device_node), GFP_KERNEL);
+	if (!np)
+		return -ENOMEM;
+
+	memset(np, 0, sizeof(*np));
+
+	np->full_name = kmalloc(strlen(path) + 1, GFP_KERNEL);
+	if (!np->full_name) {
+		kfree(np);
+		return -ENOMEM;
+	}
+	strcpy(np->full_name, path);
+
+	np->properties = proplist;
+	OF_MARK_DYNAMIC(np);
+	of_node_get(np);
+	np->parent = derive_parent(path);
+	if (!np->parent) {
+		kfree(np);
+		return -EINVAL; /* could also be ENOMEM, though */
+	}
+
+	if (0 != (err = of_finish_dynamic_node(np))) {
+		kfree(np);
+		return err;
+	}
+
+	write_lock(&devtree_lock);
+	np->sibling = np->parent->child;
+	np->allnext = allnodes;
+	np->parent->child = np;
+	allnodes = np;
+	write_unlock(&devtree_lock);
+
+	add_node_proc_entries(np);
+
+	of_node_put(np->parent);
+	of_node_put(np);
+	return 0;
+}
+
+/*
+ * Remove an OF device node from the system.
+ */
+int of_remove_node(struct device_node *np)
+{
+	struct device_node *parent, *child;
+
+	parent = of_get_parent(np);
+	child = of_get_next_child(np, NULL);
+	if (child && !child->child && !child->sibling) {
+		/* For now, we will allow removal of a
+		 * node with one and only one child, so
+		 * that we can support removing a slot with
+		 * an IOA in it.  More general support for
+		 * subtree removal to be implemented later, if
+		 * necessary.
+		 */
+		of_remove_node(child);
+	}
+	else if (child) {
+		of_node_put(child);
+		of_node_put(parent);
+		return -EINVAL;
+	}
+	of_node_put(child);
+
+	write_lock(&devtree_lock);
+	OF_MARK_STALE(np);
+	remove_node_proc_entries(np);
+	if (allnodes == np)
+		allnodes = np->allnext;
+	else {
+		struct device_node *prev;
+		for (prev = allnodes;
+		     prev->allnext != np;
+		     prev = prev->allnext)
+			;
+		prev->allnext = np->allnext;
+	}
+
+	if (np->parent->child == np)
+		np->parent->child = np->sibling;
+	else {
+		struct device_node *prevsib;
+		for (prevsib = np->parent->child;
+		     prevsib->sibling != np;
+		     prevsib = prevsib->sibling)
+			;
+		prevsib->sibling = np->sibling;
+	}
+	write_unlock(&devtree_lock);
+	of_node_put(parent);
+	return 0;
+}
+
+#ifdef CONFIG_PROC_DEVICETREE
+/*
+ * Add a node to /proc/device-tree.
+ */
+static void add_node_proc_entries(struct device_node *np)
+{
+	struct proc_dir_entry *ent;
+
+	ent = proc_mkdir(strrchr(np->full_name, '/') + 1, np->parent->pde);
+	if (ent)
+		proc_device_tree_add_node(np, ent);
+}
+
+static void remove_node_proc_entries(struct device_node *np)
+{
+	struct property *pp = np->properties;
+	struct device_node *parent = np->parent;
+
+	while (pp) {
+		remove_proc_entry(pp->name, np->pde);
+		pp = pp->next;
+	}
+
+	/* Assuming that symlinks have the same parent directory as
+	 * np->pde.
+	 */
+	if (np->name_link)
+		remove_proc_entry(np->name_link->name, parent->pde);
+	if (np->addr_link)
+		remove_proc_entry(np->addr_link->name, parent->pde);
+	if (np->pde)
+		remove_proc_entry(np->pde->name, parent->pde);
+}
+#else /* !CONFIG_PROC_DEVICETREE */
+static void add_node_proc_entries(struct device_node *np)
+{
+	return;
+}
+
+static void remove_node_proc_entries(struct device_node *np)
+{
+	return;
+}
+#endif /* CONFIG_PROC_DEVICETREE */
+
+/*
+ * Fix up the uninitialized fields in a new device node:
+ * name, type, n_addrs, addrs, n_intrs, intrs, and pci-specific fields
+ *
+ * A lot of boot-time code is duplicated here, because functions such
+ * as finish_node_interrupts, interpret_pci_props, etc. cannot use the
+ * slab allocator.
+ *
+ * This should probably be split up into smaller chunks.
+ */
+
+static int of_finish_dynamic_node(struct device_node *node)
+{
+	struct device_node *parent = of_get_parent(node);
+	u32 *regs;
+	unsigned int *ints;
+	int intlen, intrcells;
+	int i, j, n, err = 0;
+	unsigned int *irq;
+	struct device_node *ic;
+ 
+	node->name = get_property(node, "name", 0);
+	node->type = get_property(node, "device_type", 0);
+
+	if (!parent) {
+		err = -ENODEV;
+		goto out;
+	}
+
+	/* do the work of interpret_pci_props */
+	if (parent->type && !strcmp(parent->type, "pci")) {
+		struct address_range *adr;
+		struct pci_reg_property *pci_addrs;
+		int i, l;
+
+		pci_addrs = (struct pci_reg_property *)
+			get_property(node, "assigned-addresses", &l);
+		if (pci_addrs != 0 && l >= sizeof(struct pci_reg_property)) {
+			i = 0;
+			adr = kmalloc(sizeof(struct address_range) * 
+				      (l / sizeof(struct pci_reg_property)),
+				      GFP_KERNEL);
+			if (!adr) {
+				err = -ENOMEM;
+				goto out;
+			}
+			while ((l -= sizeof(struct pci_reg_property)) >= 0) {
+				adr[i].space = pci_addrs[i].addr.a_hi;
+				adr[i].address = pci_addrs[i].addr.a_lo;
+				adr[i].size = pci_addrs[i].size_lo;
+				++i;
+			}
+			node->addrs = adr;
+			node->n_addrs = i;
+		}
+	}
+
+	/* now do the work of finish_node_interrupts */
+
+	ints = (unsigned int *) get_property(node, "interrupts", &intlen);
+	if (!ints)
+		goto out;
+
+	intrcells = prom_n_intr_cells(node);
+	intlen /= intrcells * sizeof(unsigned int);
+	node->n_intrs = intlen;
+	node->intrs = kmalloc(sizeof(struct interrupt_info) * intlen,
+			      GFP_KERNEL);
+	if (!node->intrs) {
+		err = -ENOMEM;
+		goto out;
+	}
+
+	for (i = 0; i < intlen; ++i) {
+		node->intrs[i].line = 0;
+		node->intrs[i].sense = 1;
+		n = map_interrupt(&irq, &ic, node, ints, intrcells);
+		if (n <= 0)
+			continue;
+		node->intrs[i].line = openpic_to_irq(virt_irq_create_mapping(irq[0]));
+		if (n > 1)
+			node->intrs[i].sense = irq[1];
+		if (n > 2) {
+			printk(KERN_DEBUG "hmmm, got %d intr cells for %s:", n,
+			       node->full_name);
+			for (j = 0; j < n; ++j)
+				printk(" %d", irq[j]);
+			printk("\n");
+		}
+		ints += intrcells;
+	}
+
+       /* now do the rough equivalent of update_dn_pci_info, this
+        * probably is not correct for phb's, but should work for
+	* IOAs and slots.
+        */
+
+       node->phb = parent->phb;
+
+       regs = (u32 *)get_property(node, "reg", 0);
+       if (regs) {
+               node->busno = (regs[0] >> 16) & 0xff;
+               node->devfn = (regs[0] >> 8) & 0xff;
+       }
+
+	/* fixing up tce_table */
+
+	if(strcmp(node->name, "pci") == 0 &&
+                get_property(node, "ibm,dma-window", NULL)) {
+                node->bussubno = node->busno;
+                create_pci_bus_tce_table((unsigned long)node);
+        }
+	else
+		node->tce_table = parent->tce_table;
+
+out:
+	of_node_put(parent);
+	return err;
+}
+
 /*
  * Find the device_node with a given phandle.
  */
-static struct device_node * __init
+static struct device_node * __devinit
 find_phandle(phandle ph)
 {
 	struct device_node *np;
 
 	for (np = allnodes; np != 0; np = np->allnext)
-		if (np->node == ph)
+		if (np->linux_phandle == ph)
 			return np;
 	return NULL;
 }
@@ -2080,17 +2822,6 @@
 	}
 }
 #endif
-
-
-void __init
-abort()
-{
-#ifdef CONFIG_XMON
-	xmon(NULL);
-#endif
-	for (;;)
-		prom_exit();
-}
 
 
 /* Verify bi_recs are good */
diff -Nru a/arch/ppc64/kernel/ras.c b/arch/ppc64/kernel/ras.c
--- a/arch/ppc64/kernel/ras.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc64/kernel/ras.c	Tue Feb  3 19:45:17 2004
@@ -70,27 +70,29 @@
 	struct device_node *np;
 	unsigned int *ireg, len, i;
 
-	if((np = find_path_device("/event-sources/internal-errors")) &&
-	   (ireg = (unsigned int *)get_property(np, "open-pic-interrupt", 
-						&len))) {
-		for(i=0; i<(len / sizeof(*ireg)); i++) {
+	if ((np = of_find_node_by_path("/event-sources/internal-errors")) &&
+	    (ireg = (unsigned int *)get_property(np, "open-pic-interrupt",
+						 &len))) {
+		for (i=0; i<(len / sizeof(*ireg)); i++) {
 			request_irq(virt_irq_create_mapping(*(ireg)) + NUM_8259_INTERRUPTS, 
 				    ras_error_interrupt, 0, 
 				    "RAS_ERROR", NULL);
 			ireg++;
 		}
 	}
+	of_node_put(np);
 
-	if((np = find_path_device("/event-sources/epow-events")) &&
-	   (ireg = (unsigned int *)get_property(np, "open-pic-interrupt", 
-						&len))) {
-		for(i=0; i<(len / sizeof(*ireg)); i++) {
+	if ((np = of_find_node_by_path("/event-sources/epow-events")) &&
+	    (ireg = (unsigned int *)get_property(np, "open-pic-interrupt",
+						 &len))) {
+		for (i=0; i<(len / sizeof(*ireg)); i++) {
 			request_irq(virt_irq_create_mapping(*(ireg)) + NUM_8259_INTERRUPTS, 
 				    ras_epow_interrupt, 0, 
 				    "RAS_EPOW", NULL);
 			ireg++;
 		}
 	}
+	of_node_put(np);
 
 	return 1;
 }
@@ -112,7 +114,7 @@
 
 	status = rtas_call(rtas_token("check-exception"), 6, 1, NULL, 
 			   0x500, irq, 
-			   EPOW_WARNING | POWERMGM_EVENTS, 
+			   RTAS_EPOW_WARNING | RTAS_POWERMGM_EVENTS, 
 			   1,  /* Time Critical */
 			   __pa(&log_entry), size);
 
@@ -120,6 +122,10 @@
 		    *((unsigned long *)&log_entry), status); 
 	printk(KERN_WARNING 
 		"EPOW <0x%lx 0x%lx>\n",*((unsigned long *)&log_entry), status);
+
+	/* format and print the extended information */
+	log_error((char *)&log_entry, ERR_TYPE_RTAS_LOG, 0);
+	
 	return IRQ_HANDLED;
 }
 
@@ -137,15 +143,23 @@
 	struct rtas_error_log log_entry;
 	unsigned int size = sizeof(log_entry);
 	long status = 0xdeadbeef;
+	int fatal;
 
 	status = rtas_call(rtas_token("check-exception"), 6, 1, NULL, 
 			   0x500, irq, 
-			   INTERNAL_ERROR, 
+			   RTAS_INTERNAL_ERROR, 
 			   1, /* Time Critical */
 			   __pa(&log_entry), size);
 
-	if((status != 1) && 
-	   (log_entry.severity >= SEVERITY_ERROR_SYNC)) {
+	if ((status == 0) && (log_entry.severity >= SEVERITY_ERROR_SYNC)) 
+		fatal = 1;
+	else
+		fatal = 0;
+
+	/* format and print the extended information */
+	log_error((char *)&log_entry, ERR_TYPE_RTAS_LOG, fatal); 
+
+	if (fatal) {
 		udbg_printf("HW Error <0x%lx 0x%lx>\n",
 			    *((unsigned long *)&log_entry), status);
 		printk(KERN_EMERG 
@@ -155,6 +169,7 @@
 #ifndef DEBUG
 		/* Don't actually power off when debugging so we can test
 		 * without actually failing while injecting errors.
+		 * Error data will not be logged to syslog.
 		 */
 		ppc_md.power_off();
 #endif
diff -Nru a/arch/ppc64/kernel/rtas-proc.c b/arch/ppc64/kernel/rtas-proc.c
--- a/arch/ppc64/kernel/rtas-proc.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc64/kernel/rtas-proc.c	Tue Feb  3 19:45:17 2004
@@ -20,6 +20,7 @@
 #include <linux/ctype.h>
 #include <linux/time.h>
 #include <linux/string.h>
+#include <linux/init.h>
 
 #include <asm/uaccess.h>
 #include <asm/bitops.h>
@@ -27,6 +28,7 @@
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/rtas.h>
+#include <asm/proc_fs.h>
 #include <asm/machdep.h> /* for ppc_md */
 #include <asm/time.h>
 
@@ -161,6 +163,8 @@
 		size_t count, loff_t *ppos);
 static ssize_t ppc_rtas_tone_volume_read(struct file * file, char * buf,
 		size_t count, loff_t *ppos);
+static ssize_t ppc_rtas_rmo_buf_read(struct file *file, char *buf,
+				    size_t count, loff_t *ppos);
 
 struct file_operations ppc_rtas_poweron_operations = {
 	.read =		ppc_rtas_poweron_read,
@@ -185,6 +189,10 @@
 	.write =	ppc_rtas_tone_volume_write
 };
 
+static struct file_operations ppc_rtas_rmo_buf_ops = {
+	.read =		ppc_rtas_rmo_buf_read,
+};
+
 int ppc_rtas_find_all_sensors (void);
 int ppc_rtas_process_sensor(struct individual_sensor s, int state, 
 		int error, char * buf);
@@ -200,39 +208,42 @@
 {
 	struct proc_dir_entry *entry;
 
-	rtas_node = find_devices("rtas");
+	rtas_node = of_find_node_by_name(NULL, "rtas");
 	if ((rtas_node == NULL) || (systemcfg->platform == PLATFORM_ISERIES_LPAR)) {
 		return;
 	}
 	
-	if (proc_rtas == NULL) {
-		proc_rtas = proc_mkdir("rtas", 0);
+	if (proc_ppc64.rtas == NULL) {
+		proc_ppc64_init();
 	}
 
-	if (proc_rtas == NULL) {
+	if (proc_ppc64.rtas == NULL) {
 		printk(KERN_ERR "Failed to create /proc/rtas in proc_rtas_init\n");
 		return;
 	}
 
 	/* /proc/rtas entries */
 
-	entry = create_proc_entry("progress", S_IRUGO|S_IWUSR, proc_rtas);
+	entry = create_proc_entry("progress", S_IRUGO|S_IWUSR, proc_ppc64.rtas);
 	if (entry) entry->proc_fops = &ppc_rtas_progress_operations;
 
-	entry = create_proc_entry("clock", S_IRUGO|S_IWUSR, proc_rtas); 
+	entry = create_proc_entry("clock", S_IRUGO|S_IWUSR, proc_ppc64.rtas); 
 	if (entry) entry->proc_fops = &ppc_rtas_clock_operations;
 
-	entry = create_proc_entry("poweron", S_IWUSR|S_IRUGO, proc_rtas); 
+	entry = create_proc_entry("poweron", S_IWUSR|S_IRUGO, proc_ppc64.rtas); 
 	if (entry) entry->proc_fops = &ppc_rtas_poweron_operations;
 
-	create_proc_read_entry("sensors", S_IRUGO, proc_rtas, 
+	create_proc_read_entry("sensors", S_IRUGO, proc_ppc64.rtas, 
 			ppc_rtas_sensor_read, NULL);
 	
-	entry = create_proc_entry("frequency", S_IWUSR|S_IRUGO, proc_rtas); 
+	entry = create_proc_entry("frequency", S_IWUSR|S_IRUGO, proc_ppc64.rtas); 
 	if (entry) entry->proc_fops = &ppc_rtas_tone_freq_operations;
 
-	entry = create_proc_entry("volume", S_IWUSR|S_IRUGO, proc_rtas); 
+	entry = create_proc_entry("volume", S_IWUSR|S_IRUGO, proc_ppc64.rtas); 
 	if (entry) entry->proc_fops = &ppc_rtas_tone_volume_operations;
+
+	entry = create_proc_entry("rmo_buffer", S_IRUSR, proc_ppc64.rtas);
+	if (entry) entry->proc_fops = &ppc_rtas_rmo_buf_ops;
 }
 
 /* ****************************************************************** */
@@ -917,5 +928,30 @@
 		return -EFAULT;
 	}
 	*ppos += n;
+	return n;
+}
+
+#define RMO_READ_BUF_MAX 30
+
+/* RTAS Userspace access */
+static ssize_t ppc_rtas_rmo_buf_read(struct file *file, char __user *buf,
+				    size_t count, loff_t *ppos)
+{
+	char kbuf[RMO_READ_BUF_MAX];
+	int n;
+
+	n = sprintf(kbuf, "%016lx %x\n", rtas_rmo_buf, RTAS_RMOBUF_MAX);
+	if (n > count)
+		n = count;
+
+	if (ppos && *ppos != 0)
+		return 0;
+
+	if (copy_to_user(buf, kbuf, n))
+		return -EFAULT;
+
+	if (ppos)
+		*ppos = n;
+	
 	return n;
 }
diff -Nru a/arch/ppc64/kernel/rtas.c b/arch/ppc64/kernel/rtas.c
--- a/arch/ppc64/kernel/rtas.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc64/kernel/rtas.c	Tue Feb  3 19:45:17 2004
@@ -16,6 +16,7 @@
 #include <linux/types.h>
 #include <linux/spinlock.h>
 #include <linux/module.h>
+#include <linux/init.h>
 
 #include <asm/prom.h>
 #include <asm/proc_fs.h>
@@ -28,6 +29,8 @@
 #include <asm/system.h>
 #include <asm/abs_addr.h>
 #include <asm/udbg.h>
+#include <asm/delay.h>
+#include <asm/uaccess.h>
 
 struct flash_block_list_header rtas_firmware_flash_list = {0, 0};
 
@@ -59,7 +62,7 @@
 extern unsigned long reloc_offset(void);
 
 spinlock_t rtas_data_buf_lock = SPIN_LOCK_UNLOCKED;
-char rtas_data_buf[RTAS_DATA_BUF_SIZE];
+char rtas_data_buf[RTAS_DATA_BUF_SIZE]__page_aligned;
 
 void
 phys_call_rtas(int token, int nargs, int nret, ...)
@@ -180,23 +183,98 @@
 }
 
 /* Given an RTAS status code of 990n compute the hinted delay of 10^n
- * (last digit) milliseconds.  For now we bound at n=3 (1 sec).
+ * (last digit) milliseconds.  For now we bound at n=5 (100 sec).
  */
 unsigned int
 rtas_extended_busy_delay_time(int status)
 {
 	int order = status - 9900;
-	unsigned int ms;
+	unsigned long ms;
 
 	if (order < 0)
 		order = 0;	/* RTC depends on this for -2 clock busy */
-	else if (order > 3)
-		order = 3;	/* bound */
+	else if (order > 5)
+		order = 5;	/* bound */
 
 	/* Use microseconds for reasonable accuracy */
-	for (ms = 1000; order > 0; order--)
-		ms = ms * 10;
-	return ms / (1000000/HZ); /* round down is fine */
+	for (ms=1; order > 0; order--)
+		ms *= 10;          
+
+	return ms; 
+}
+
+int
+rtas_get_power_level(int powerdomain, int *level)
+{
+	int token = rtas_token("get-power-level");
+	long powerlevel;
+	int rc;
+
+	if (token == RTAS_UNKNOWN_SERVICE)
+		return RTAS_UNKNOWN_OP;
+
+	while(1) {
+		rc = (int) rtas_call(token, 1, 2, &powerlevel, powerdomain);
+		if (rc == RTAS_BUSY)
+			udelay(1);
+		else
+			break;
+	}
+	*level = (int) powerlevel;
+	return rc;
+}
+
+int
+rtas_get_sensor(int sensor, int index, int *state)
+{
+	int token = rtas_token("get-sensor-state");
+	unsigned int wait_time;
+	long returned_state;
+	int rc;
+
+	if (token == RTAS_UNKNOWN_SERVICE)
+		return RTAS_UNKNOWN_OP;
+
+	while (1) {
+		rc = (int) rtas_call(token, 2, 2, &returned_state, sensor,
+					index);
+		if (rc == RTAS_BUSY)
+			udelay(1);
+		else if (rtas_is_extended_busy(rc)) {
+			wait_time = rtas_extended_busy_delay_time(rc);
+			udelay(wait_time * 1000);
+		}
+		else
+			break;
+	}
+	*state = (int) returned_state;
+	return rc;
+}
+
+int
+rtas_set_indicator(int indicator, int index, int new_value)
+{
+	int token = rtas_token("set-indicator");
+	unsigned int wait_time;
+	int rc;
+
+	if (token == RTAS_UNKNOWN_SERVICE)
+		return RTAS_UNKNOWN_OP;
+
+	while (1) {
+		rc = (int) rtas_call(token, 3, 1, NULL, indicator, index,
+					new_value);
+		if (rc == RTAS_BUSY)
+			udelay(1);
+		else if (rtas_is_extended_busy(rc)) {
+			wait_time = rtas_extended_busy_delay_time(rc);
+			udelay(wait_time * 1000);
+		}
+		else
+			break;
+	}
+
+	return rc;
 }
 
 #define FLASH_BLOCK_LIST_VERSION (1UL)
@@ -308,9 +386,51 @@
         rtas_power_off();
 }
 
-EXPORT_SYMBOL(proc_ppc64);
+unsigned long rtas_rmo_buf = 0;
+
+asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
+{
+	struct rtas_args args;
+	unsigned long flags;
+
+	if (!capable(CAP_SYS_ADMIN))
+		return -EPERM;
+
+	if (copy_from_user(&args, uargs, 3 * sizeof(u32)) != 0)
+		return -EFAULT;
+
+	if (args.nargs > ARRAY_SIZE(args.args)
+	    || args.nret > ARRAY_SIZE(args.args)
+	    || args.nargs + args.nret > ARRAY_SIZE(args.args))
+		return -EINVAL;
+
+	/* Copy in args. */
+	if (copy_from_user(args.args, uargs->args,
+			   args.nargs * sizeof(rtas_arg_t)) != 0)
+		return -EFAULT;
+
+	spin_lock_irqsave(&rtas.lock, flags);
+	get_paca()->xRtas = args;
+	enter_rtas((void *)__pa((unsigned long)&get_paca()->xRtas));
+	args = get_paca()->xRtas;
+	spin_unlock_irqrestore(&rtas.lock, flags);
+
+	/* Copy out args. */
+	if (copy_to_user(uargs->args + args.nargs,
+			 args.args + args.nargs,
+			 args.nret * sizeof(rtas_arg_t)) != 0)
+		return -EFAULT;
+
+	return 0;
+}
+
+
 EXPORT_SYMBOL(rtas_firmware_flash_list);
 EXPORT_SYMBOL(rtas_token);
 EXPORT_SYMBOL(rtas_call);
 EXPORT_SYMBOL(rtas_data_buf);
 EXPORT_SYMBOL(rtas_data_buf_lock);
+EXPORT_SYMBOL(rtas_extended_busy_delay_time);
+EXPORT_SYMBOL(rtas_get_sensor);
+EXPORT_SYMBOL(rtas_get_power_level);
+EXPORT_SYMBOL(rtas_set_indicator);
diff -Nru a/arch/ppc64/kernel/rtas_flash.c b/arch/ppc64/kernel/rtas_flash.c
--- a/arch/ppc64/kernel/rtas_flash.c	Tue Feb  3 19:45:42 2004
+++ b/arch/ppc64/kernel/rtas_flash.c	Tue Feb  3 19:45:42 2004
@@ -14,15 +14,62 @@
  */
 
 #include <linux/module.h>
-#include <linux/proc_fs.h>
 #include <linux/init.h>
+#include <asm/proc_fs.h>
+#include <asm/delay.h>
 #include <asm/uaccess.h>
 #include <asm/rtas.h>
 
 #define MODULE_VERSION "1.0"
 #define MODULE_NAME "rtas_flash"
 
-#define FIRMWARE_FLASH_NAME "firmware_flash"
+#define FIRMWARE_FLASH_NAME "firmware_flash"   
+#define FIRMWARE_UPDATE_NAME "firmware_update"
+#define MANAGE_FLASH_NAME "manage_flash"
+#define VALIDATE_FLASH_NAME "validate_flash"
+
+/* General RTAS Status Codes */
+#define RTAS_RC_SUCCESS  0
+#define RTAS_RC_HW_ERR	-1
+#define RTAS_RC_BUSY	-2
+
+/* Flash image status values */
+#define FLASH_AUTH           -9002 /* RTAS Not Service Authority Partition */
+#define FLASH_NO_OP          -1099 /* No operation initiated by user */	
+#define FLASH_IMG_SHORT	     -1005 /* Flash image shorter than expected */
+#define FLASH_IMG_BAD_LEN    -1004 /* Bad length value in flash list block */
+#define FLASH_IMG_NULL_DATA  -1003 /* Bad data value in flash list block */
+#define FLASH_IMG_READY      0     /* Firmware img ready for flash on reboot */
+
+/* Manage image status values */
+#define MANAGE_AUTH          -9002 /* RTAS Not Service Authority Partition */
+#define MANAGE_ACTIVE_ERR    -9001 /* RTAS Cannot Overwrite Active Img */
+#define MANAGE_NO_OP         -1099 /* No operation initiated by user */
+#define MANAGE_PARAM_ERR     -3    /* RTAS Parameter Error */
+#define MANAGE_HW_ERR        -1    /* RTAS Hardware Error */
+
+/* Validate image status values */
+#define VALIDATE_AUTH          -9002 /* RTAS Not Service Authority Partition */
+#define VALIDATE_NO_OP         -1099 /* No operation initiated by the user */
+#define VALIDATE_INCOMPLETE    -1002 /* User copied < VALIDATE_BUF_SIZE */
+#define VALIDATE_READY	       -1001 /* Firmware image ready for validation */
+#define VALIDATE_PARAM_ERR     -3    /* RTAS Parameter Error */
+#define VALIDATE_HW_ERR        -1    /* RTAS Hardware Error */
+#define VALIDATE_TMP_UPDATE    0     /* Validate Return Status */
+#define VALIDATE_FLASH_AUTH    1     /* Validate Return Status */
+#define VALIDATE_INVALID_IMG   2     /* Validate Return Status */
+#define VALIDATE_CUR_UNKNOWN   3     /* Validate Return Status */
+#define VALIDATE_TMP_COMMIT_DL 4     /* Validate Return Status */
+#define VALIDATE_TMP_COMMIT    5     /* Validate Return Status */
+#define VALIDATE_TMP_UPDATE_DL 6     /* Validate Return Status */
+
+/* ibm,manage-flash-image operation tokens */
+#define RTAS_REJECT_TMP_IMG   0
+#define RTAS_COMMIT_TMP_IMG   1
+
+/* Array sizes */
+#define VALIDATE_BUF_SIZE 4096    
+#define RTAS_MSG_MAXLEN   64
 
 /* Local copy of the flash block list.
  * We only allow one open of the flash proc file and create this
@@ -34,21 +81,35 @@
  * is treated as the number of entries currently in the block
  * (i.e. not a byte count).  This is all fixed on release.
  */
-static struct flash_block_list *flist;
-static char *flash_msg;
-static int flash_possible;
-
-static int rtas_flash_open(struct inode *inode, struct file *file)
-{
-	if ((file->f_mode & FMODE_WRITE) && flash_possible) {
-		if (flist)
-			return -EBUSY;
-		flist = (struct flash_block_list *)get_zeroed_page(GFP_KERNEL);
-		if (!flist)
-			return -ENOMEM;
-	}
-	return 0;
-}
+
+/* Status int must be first member of struct */
+struct rtas_update_flash_t
+{
+	int status;			/* Flash update status */
+	struct flash_block_list *flist; /* Local copy of flash block list */
+};
+
+/* Status int must be first member of struct */
+struct rtas_manage_flash_t
+{
+	int status;			/* Returned status */
+	unsigned int op;		/* Reject or commit image */
+};
+
+/* Status int must be first member of struct */
+struct rtas_validate_flash_t
+{
+	int status;		 	/* Returned status */	
+	char buf[VALIDATE_BUF_SIZE]; 	/* Candidate image buffer */
+	unsigned int buf_size;		/* Size of image buf */
+	unsigned int update_results;	/* Update results token */
+};
+
+static spinlock_t flash_file_open_lock = SPIN_LOCK_UNLOCKED;
+static struct proc_dir_entry *firmware_flash_pde = NULL;
+static struct proc_dir_entry *firmware_update_pde = NULL;
+static struct proc_dir_entry *validate_pde = NULL;
+static struct proc_dir_entry *manage_pde = NULL;
 
 /* Do simple sanity checks on the flash image. */
 static int flash_list_valid(struct flash_block_list *flist)
@@ -57,32 +118,29 @@
 	int i;
 	unsigned long block_size, image_size;
 
-	flash_msg = NULL;
 	/* Paranoid self test here.  We also collect the image size. */
 	image_size = 0;
 	for (f = flist; f; f = f->next) {
 		for (i = 0; i < f->num_blocks; i++) {
 			if (f->blocks[i].data == NULL) {
-				flash_msg = "error: internal error null data\n";
-				return 0;
+				return FLASH_IMG_NULL_DATA;
 			}
 			block_size = f->blocks[i].length;
 			if (block_size <= 0 || block_size > PAGE_SIZE) {
-				flash_msg = "error: internal error bad length\n";
-				return 0;
+				return FLASH_IMG_BAD_LEN;
 			}
 			image_size += block_size;
 		}
 	}
+
 	if (image_size < (256 << 10)) {
-		if (image_size < 2)
-			flash_msg = NULL;	/* allow "clear" of image */
-		else
-			flash_msg = "error: flash image short\n";
-		return 0;
+		if (image_size < 2) 
+			return FLASH_NO_OP;
 	}
+
 	printk(KERN_INFO "FLASH: flash image with %ld bytes stored for hardware flash on reboot\n", image_size);
-	return 1;
+
+	return FLASH_IMG_READY;
 }
 
 static void free_flash_list(struct flash_block_list *f)
@@ -101,40 +159,80 @@
 
 static int rtas_flash_release(struct inode *inode, struct file *file)
 {
-	if (flist) {
-		/* Always clear saved list on a new attempt. */
+	struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode);
+	struct rtas_update_flash_t *uf;
+	
+	uf = (struct rtas_update_flash_t *) dp->data;
+	if (uf->flist) {    
+		/* File was opened in write mode for a new flash attempt */
+		/* Clear saved list */
 		if (rtas_firmware_flash_list.next) {
 			free_flash_list(rtas_firmware_flash_list.next);
 			rtas_firmware_flash_list.next = NULL;
 		}
 
-		if (flash_list_valid(flist))
-			rtas_firmware_flash_list.next = flist;
+		if (uf->status != FLASH_AUTH)  
+			uf->status = flash_list_valid(uf->flist);
+
+		if (uf->status == FLASH_IMG_READY) 
+			rtas_firmware_flash_list.next = uf->flist;
 		else
-			free_flash_list(flist);
-		flist = NULL;
+			free_flash_list(uf->flist);
+
+		uf->flist = NULL;
 	}
+
+	atomic_dec(&dp->count);
 	return 0;
 }
 
+static void get_flash_status_msg(int status, char *buf)
+{
+	char *msg;
+
+	switch (status) {
+	case FLASH_AUTH:
+		msg = "error: this partition does not have service authority\n";
+		break;
+	case FLASH_NO_OP:
+		msg = "info: no firmware image for flash\n";
+		break;
+	case FLASH_IMG_SHORT:
+		msg = "error: flash image short\n";
+		break;
+	case FLASH_IMG_BAD_LEN:
+		msg = "error: internal error bad length\n";
+		break;
+	case FLASH_IMG_NULL_DATA:
+		msg = "error: internal error null data\n";
+		break;
+	case FLASH_IMG_READY:
+		msg = "ready: firmware image ready for flash on reboot\n";
+		break;
+	default:
+		sprintf(buf, "error: unexpected status value %d\n", status);
+		return;
+	}
+
+	strcpy(buf, msg);	
+}
+
 /* Reading the proc file will show status (not the firmware contents) */
 static ssize_t rtas_flash_read(struct file *file, char *buf,
 			       size_t count, loff_t *ppos)
 {
+	struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode);
+	struct rtas_update_flash_t *uf;
+	char msg[RTAS_MSG_MAXLEN];
 	int error;
-	char *msg;
 	int msglen;
 
-	if (!flash_possible) {
-		msg = "error: this partition does not have service authority\n";
-	} else if (flist) {
-		msg = "info: this file is busy for write by some process\n";
-	} else if (flash_msg) {
-		msg = flash_msg;	/* message from last flash attempt */
-	} else if (rtas_firmware_flash_list.next) {
-		msg = "ready: firmware image ready for flash on reboot\n";
-	} else {
-		msg = "info: no firmware image for flash\n";
+	uf = (struct rtas_update_flash_t *) dp->data;
+
+	if (!strcmp(dp->name, FIRMWARE_FLASH_NAME)) {
+		get_flash_status_msg(uf->status, msg);
+	} else {	   /* FIRMWARE_UPDATE_NAME */
+		sprintf(msg, "%d\n", uf->status);
 	}
 	msglen = strlen(msg);
 	if (msglen > count)
@@ -147,7 +245,8 @@
 	if (error)
 		return -EINVAL;
 
-	copy_to_user(buf, msg, msglen);
+	if (copy_to_user(buf, msg, msglen))
+		return -EFAULT;
 
 	if (ppos)
 		*ppos = msglen;
@@ -162,14 +261,28 @@
 static ssize_t rtas_flash_write(struct file *file, const char *buffer,
 				size_t count, loff_t *off)
 {
-	size_t len = count;
+	struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode);
+	struct rtas_update_flash_t *uf;
 	char *p;
 	int next_free;
-	struct flash_block_list *fl = flist;
+	struct flash_block_list *fl;
+
+	uf = (struct rtas_update_flash_t *) dp->data;
 
-	if (!flash_possible || len == 0)
-		return len;	/* discard data */
+	if (uf->status == FLASH_AUTH || count == 0)
+		return count;	/* discard data */
 
+	/* In the case that the image is not ready for flashing, the memory
+	 * allocated for the block list will be freed upon the release of the 
+	 * proc file
+	 */
+	if (uf->flist == NULL) {
+		uf->flist = (struct flash_block_list *) get_zeroed_page(GFP_KERNEL);
+		if (!uf->flist)
+			return -ENOMEM;
+	}
+
+	fl = uf->flist;
 	while (fl->next)
 		fl = fl->next; /* seek to last block_list for append */
 	next_free = fl->num_blocks;
@@ -182,47 +295,392 @@
 		next_free = 0;
 	}
 
-	if (len > PAGE_SIZE)
-		len = PAGE_SIZE;
+	if (count > PAGE_SIZE)
+		count = PAGE_SIZE;
 	p = (char *)get_zeroed_page(GFP_KERNEL);
 	if (!p)
 		return -ENOMEM;
-	if(copy_from_user(p, buffer, len)) {
+	
+	if(copy_from_user(p, buffer, count)) {
 		free_page((unsigned long)p);
 		return -EFAULT;
 	}
 	fl->blocks[next_free].data = p;
-	fl->blocks[next_free].length = len;
+	fl->blocks[next_free].length = count;
 	fl->num_blocks++;
 
-	return len;
+	return count;
+}
+
+static int rtas_excl_open(struct inode *inode, struct file *file)
+{
+	struct proc_dir_entry *dp = PDE(inode);
+
+	/* Enforce exclusive open with use count of PDE */
+	spin_lock(&flash_file_open_lock);
+	if (atomic_read(&dp->count) > 1) {
+		spin_unlock(&flash_file_open_lock);
+		return -EBUSY;
+	}
+
+	atomic_inc(&dp->count);
+	spin_unlock(&flash_file_open_lock);
+	
+	return 0;
+}
+
+static int rtas_excl_release(struct inode *inode, struct file *file)
+{
+	struct proc_dir_entry *dp = PDE(inode);
+
+	atomic_dec(&dp->count);
+
+	return 0;
+}
+
+static void manage_flash(struct rtas_manage_flash_t *args_buf)
+{
+	unsigned int wait_time;
+	s32 rc;
+
+	while (1) {
+		rc = (s32) rtas_call(rtas_token("ibm,manage-flash-image"), 1, 
+				1, NULL, (long) args_buf->op);
+		if (rc == RTAS_RC_BUSY)
+			udelay(1);
+		else if (rtas_is_extended_busy(rc)) {
+			wait_time = rtas_extended_busy_delay_time(rc);
+			udelay(wait_time * 1000);
+		} else
+			break;
+	}
+
+	args_buf->status = rc;
+}
+
+static ssize_t manage_flash_read(struct file *file, char *buf,
+			       size_t count, loff_t *ppos)
+{
+	struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode);
+	struct rtas_manage_flash_t *args_buf;
+	char msg[RTAS_MSG_MAXLEN];
+	int msglen;
+	int error;
+
+	args_buf = (struct rtas_manage_flash_t *) dp->data;
+	if (args_buf == NULL)
+		return 0;
+
+	msglen = sprintf(msg, "%d\n", args_buf->status);
+	if (msglen > count)
+		msglen = count;
+
+	if (ppos && *ppos != 0)
+		return 0;	/* be cheap */
+
+	error = verify_area(VERIFY_WRITE, buf, msglen);
+	if (error)
+		return -EINVAL;
+
+	if (copy_to_user(buf, msg, msglen))
+		return -EFAULT;
+
+	if (ppos)
+		*ppos = msglen;
+	return msglen;
+}
+
+static ssize_t manage_flash_write(struct file *file, const char *buf,
+				size_t count, loff_t *off)
+{
+	struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode);
+	struct rtas_manage_flash_t *args_buf;
+	const char reject_str[] = "0";
+	const char commit_str[] = "1";
+	char stkbuf[10];
+	int op;
+
+	args_buf = (struct rtas_manage_flash_t *) dp->data;
+	if ((args_buf->status == MANAGE_AUTH) || (count == 0))
+		return count;
+		
+	op = -1;
+	if (buf) {
+		if (count > 9) count = 9;
+		if (copy_from_user (stkbuf, buf, count)) {
+			return -EFAULT;
+		}
+		if (strncmp(stkbuf, reject_str, strlen(reject_str)) == 0) 
+			op = RTAS_REJECT_TMP_IMG;
+		else if (strncmp(stkbuf, commit_str, strlen(commit_str)) == 0) 
+			op = RTAS_COMMIT_TMP_IMG;
+	}
+	
+	if (op == -1)   /* buf is empty, or contains invalid string */
+		return -EINVAL;
+
+	args_buf->op = op;
+	manage_flash(args_buf);
+
+	return count;
+}
+
+static void validate_flash(struct rtas_validate_flash_t *args_buf)
+{
+	int token = rtas_token("ibm,validate-flash-image");
+	unsigned int wait_time;
+	long update_results;
+	s32 rc;	
+
+	rc = 0;
+	while(1) {
+		spin_lock(&rtas_data_buf_lock);
+		memcpy(rtas_data_buf, args_buf->buf, VALIDATE_BUF_SIZE);
+		rc = (s32) rtas_call(token, 2, 2, &update_results, 
+				     __pa(rtas_data_buf), args_buf->buf_size);
+		memcpy(args_buf->buf, rtas_data_buf, VALIDATE_BUF_SIZE);
+		spin_unlock(&rtas_data_buf_lock);
+			
+		if (rc == RTAS_RC_BUSY)
+			udelay(1);
+		else if (rtas_is_extended_busy(rc)) {
+			wait_time = rtas_extended_busy_delay_time(rc);
+			udelay(wait_time * 1000);
+		} else
+			break;
+	}
+
+	args_buf->status = rc;
+	args_buf->update_results = (u32) update_results;
+}
+
+static int get_validate_flash_msg(struct rtas_validate_flash_t *args_buf, 
+		                   char *msg)
+{
+	int n;
+
+	if (args_buf->status >= VALIDATE_TMP_UPDATE) { 
+		n = sprintf(msg, "%d\n", args_buf->update_results);
+		if ((args_buf->update_results >= VALIDATE_CUR_UNKNOWN) ||
+		    (args_buf->update_results == VALIDATE_TMP_UPDATE))
+			n += sprintf(msg + n, "%s\n", args_buf->buf);
+	} else {
+		n = sprintf(msg, "%d\n", args_buf->status);
+	}
+	return n;
+}
+
+static ssize_t validate_flash_read(struct file *file, char *buf,
+			       size_t count, loff_t *ppos)
+{
+	struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode);
+	struct rtas_validate_flash_t *args_buf;
+	char msg[RTAS_MSG_MAXLEN];
+	int msglen;
+	int error;
+
+	args_buf = (struct rtas_validate_flash_t *) dp->data;
+
+	if (ppos && *ppos != 0)
+		return 0;	/* be cheap */
+	
+	msglen = get_validate_flash_msg(args_buf, msg);
+	if (msglen > count)
+		msglen = count;
+
+	error = verify_area(VERIFY_WRITE, buf, msglen);
+	if (error)
+		return -EINVAL;
+
+	if (copy_to_user(buf, msg, msglen))
+		return -EFAULT;
+
+	if (ppos)
+		*ppos = msglen;
+	return msglen;
+}
+
+static ssize_t validate_flash_write(struct file *file, const char *buf,
+				size_t count, loff_t *off)
+{
+	struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode);
+	struct rtas_validate_flash_t *args_buf;
+	int rc;
+
+	args_buf = (struct rtas_validate_flash_t *) dp->data;
+
+	if (dp->data == NULL) {
+		dp->data = kmalloc(sizeof(struct rtas_validate_flash_t), 
+				GFP_KERNEL);
+		if (dp->data == NULL) 
+			return -ENOMEM;
+	}
+
+	/* We are only interested in the first 4K of the
+	 * candidate image */
+	if ((*off >= VALIDATE_BUF_SIZE) || 
+		(args_buf->status == VALIDATE_AUTH)) {
+		*off += count;
+		return count;
+	}
+
+	if (*off + count >= VALIDATE_BUF_SIZE)  {
+		count = VALIDATE_BUF_SIZE - *off;
+		args_buf->status = VALIDATE_READY;	
+	} else {
+		args_buf->status = VALIDATE_INCOMPLETE;
+	}
+
+	if (verify_area(VERIFY_READ, buf, count)) {
+		rc = -EFAULT;
+		goto done;
+	}
+	if (copy_from_user(args_buf->buf + *off, buf, count)) {
+		rc = -EFAULT;
+		goto done;
+	}
+
+	*off += count;
+	rc = count;
+done:
+	if (rc < 0) {
+		kfree(dp->data);
+		dp->data = NULL;
+	}
+	return rc;
+}
+
+static int validate_flash_release(struct inode *inode, struct file *file)
+{
+	struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode);
+	struct rtas_validate_flash_t *args_buf;
+
+	args_buf = (struct rtas_validate_flash_t *) dp->data;
+
+	if (args_buf->status == VALIDATE_READY) {
+		args_buf->buf_size = VALIDATE_BUF_SIZE;
+		validate_flash(args_buf);
+	}
+
+	atomic_dec(&dp->count);
+
+	return 0;
+}
+
+static inline void remove_flash_pde(struct proc_dir_entry *dp)
+{
+	if (dp) {
+		if (dp->data != NULL)
+			kfree(dp->data);
+		remove_proc_entry(dp->name, proc_ppc64.rtas);
+	}
+}
+
+static inline int initialize_flash_pde_data(const char *rtas_call_name, 
+		                            size_t buf_size,
+					    struct proc_dir_entry *dp)
+{
+	int *status;
+	int token;
+
+	dp->data = kmalloc(buf_size, GFP_KERNEL);
+	if (dp->data == NULL) {
+		remove_flash_pde(dp);
+		return -ENOMEM;
+	}
+
+	memset(dp->data, 0, buf_size);
+
+	/* This code assumes that the status int is the first member of the
+	 * struct 
+	 */
+	status = (int *) dp->data;
+	token = rtas_token(rtas_call_name);
+	if (token == RTAS_UNKNOWN_SERVICE)
+		*status = FLASH_AUTH;
+	else
+		*status = FLASH_NO_OP;
+
+	return 0;
+}
+
+static inline struct proc_dir_entry * create_flash_pde(const char *filename, 
+					struct file_operations *fops)
+{
+	struct proc_dir_entry *ent = NULL;
+
+	ent = create_proc_entry(filename, S_IRUSR | S_IWUSR, proc_ppc64.rtas);
+	if (ent != NULL) {
+		ent->nlink = 1;
+		ent->proc_fops = fops;
+		ent->owner = THIS_MODULE;
+	}
+
+	return ent;
 }
 
 static struct file_operations rtas_flash_operations = {
 	.read		= rtas_flash_read,
 	.write		= rtas_flash_write,
-	.open		= rtas_flash_open,
+	.open		= rtas_excl_open,
 	.release	= rtas_flash_release,
 };
 
+static struct file_operations manage_flash_operations = {
+	.read		= manage_flash_read,
+	.write		= manage_flash_write,
+	.open		= rtas_excl_open,
+	.release	= rtas_excl_release,
+};
+
+static struct file_operations validate_flash_operations = {
+	.read		= validate_flash_read,
+	.write		= validate_flash_write,
+	.open		= rtas_excl_open,
+	.release	= validate_flash_release,
+};
 
 int __init rtas_flash_init(void)
 {
-	struct proc_dir_entry *ent = NULL;
+	int rc;
 
 	if (!proc_ppc64.rtas) {
 		printk(KERN_WARNING "rtas proc dir does not already exist");
 		return -ENOENT;
 	}
 
-	if (rtas_token("ibm,update-flash-64-and-reboot") != RTAS_UNKNOWN_SERVICE)
-		flash_possible = 1;
-
-	if ((ent = create_proc_entry(FIRMWARE_FLASH_NAME, S_IRUSR | S_IWUSR, proc_ppc64.rtas)) != NULL) {
-		ent->nlink = 1;
-		ent->proc_fops = &rtas_flash_operations;
-		ent->owner = THIS_MODULE;
-	}
+	firmware_flash_pde = create_flash_pde(FIRMWARE_FLASH_NAME, 
+					      &rtas_flash_operations);
+	rc = initialize_flash_pde_data("ibm,update-flash-64-and-reboot",
+			 	       sizeof(struct rtas_update_flash_t), 
+				       firmware_flash_pde);
+	if (rc != 0)
+		return rc;
+	
+	firmware_update_pde = create_flash_pde(FIRMWARE_UPDATE_NAME, 
+					       &rtas_flash_operations);
+	rc = initialize_flash_pde_data("ibm,update-flash-64-and-reboot",
+			 	       sizeof(struct rtas_update_flash_t), 
+				       firmware_update_pde);
+	if (rc != 0)
+		return rc;
+	
+	validate_pde = create_flash_pde(VALIDATE_FLASH_NAME, 
+			      		&validate_flash_operations);
+	rc = initialize_flash_pde_data("ibm,validate-flash-image",
+		                       sizeof(struct rtas_validate_flash_t), 
+				       validate_pde);
+	if (rc != 0)
+		return rc;
+	
+	manage_pde = create_flash_pde(MANAGE_FLASH_NAME, 
+				      &manage_flash_operations);
+	rc = initialize_flash_pde_data("ibm,manage-flash-image",
+			               sizeof(struct rtas_manage_flash_t),
+				       manage_pde);
+	if (rc != 0)
+		return rc;
+	
 	return 0;
 }
 
@@ -230,7 +688,10 @@
 {
 	if (!proc_ppc64.rtas)
 		return;
-	remove_proc_entry(FIRMWARE_FLASH_NAME, proc_ppc64.rtas);
+	remove_flash_pde(firmware_flash_pde);
+	remove_flash_pde(firmware_update_pde);
+	remove_flash_pde(validate_pde);
+	remove_flash_pde(manage_pde);
 }
 
 module_init(rtas_flash_init);
diff -Nru a/arch/ppc64/kernel/rtasd.c b/arch/ppc64/kernel/rtasd.c
--- a/arch/ppc64/kernel/rtasd.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc64/kernel/rtasd.c	Tue Feb  3 19:45:17 2004
@@ -17,11 +17,15 @@
 #include <linux/proc_fs.h>
 #include <linux/init.h>
 #include <linux/vmalloc.h>
+#include <linux/spinlock.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/rtas.h>
 #include <asm/prom.h>
+#include <asm/nvram.h>
+#include <asm/atomic.h>
+#include <asm/proc_fs.h>
 
 #if 0
 #define DEBUG(A...)	printk(KERN_ERR A)
@@ -29,36 +33,184 @@
 #define DEBUG(A...)
 #endif
 
-static spinlock_t rtas_log_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t log_lock = SPIN_LOCK_UNLOCKED;
 
 DECLARE_WAIT_QUEUE_HEAD(rtas_log_wait);
 
-#define LOG_NUMBER		64		/* must be a power of two */
-#define LOG_NUMBER_MASK		(LOG_NUMBER-1)
-
 static char *rtas_log_buf;
 static unsigned long rtas_log_start;
 static unsigned long rtas_log_size;
 
-static int surveillance_requested;
+static int surveillance_timeout = -1;
 static unsigned int rtas_event_scan_rate;
 static unsigned int rtas_error_log_max;
+static unsigned int rtas_error_log_buffer_max;
 
-#define EVENT_SCAN_ALL_EVENTS	0xf0000000
-#define SURVEILLANCE_TOKEN	9000
-#define SURVEILLANCE_TIMEOUT	1
-#define SURVEILLANCE_SCANRATE	1
+extern spinlock_t proc_ppc64_lock;
+extern volatile int no_more_logging;
 
-struct proc_dir_entry *proc_rtas;
+volatile int error_log_cnt = 0;
 
 /*
  * Since we use 32 bit RTAS, the physical address of this must be below
  * 4G or else bad things happen. Allocate this in the kernel data and
  * make it big enough.
  */
-#define RTAS_ERROR_LOG_MAX 1024
 static unsigned char logdata[RTAS_ERROR_LOG_MAX];
 
+/* To see this info, grep RTAS /var/log/messages and each entry
+ * will be collected together with obvious begin/end.
+ * There will be a unique identifier on the begin and end lines.
+ * This will persist across reboots.
+ *
+ * format of error logs returned from RTAS:
+ * bytes	(size)	: contents
+ * --------------------------------------------------------
+ * 0-7		(8)	: rtas_error_log
+ * 8-47		(40)	: extended info
+ * 48-51	(4)	: vendor id
+ * 52-1023 (vendor specific) : location code and debug data
+ */
+static void printk_log_rtas(char *buf, int len)
+{
+
+	int i,j,n;
+	int perline = 16;
+	char buffer[64];
+	char * str = "RTAS event";
+
+	printk(RTAS_ERR "%d -------- %s begin --------\n", error_log_cnt, str);
+
+	/*
+	 * Print perline bytes on each line, each line will start
+	 * with RTAS and a changing number, so syslogd will
+	 * print lines that are otherwise the same.  Separate every
+	 * 4 bytes with a space.
+	 */
+	for (i=0; i < len; i++) {
+		j = i % perline;
+		if (j == 0) {
+			memset(buffer, 0, sizeof(buffer));
+			n = sprintf(buffer, "RTAS %d:", i/perline);
+		}
+
+		if ((i % 4) == 0)
+			n += sprintf(buffer+n, " ");
+
+		n += sprintf(buffer+n, "%02x", (unsigned char)buf[i]);
+
+		if (j == (perline-1))
+			printk(KERN_ERR "%s\n", buffer);
+	}
+	if ((i % perline) != 0)
+		printk(KERN_ERR "%s\n", buffer);
+
+	printk(RTAS_ERR "%d -------- %s end ----------\n", error_log_cnt, str);
+}
+
+static int log_rtas_len(char * buf)
+{
+	int len;
+	struct rtas_error_log *err;
+
+	/* rtas fixed header */
+	len = 8;
+	err = (struct rtas_error_log *)buf;
+	if (err->extended_log_length) {
+
+		/* extended header */
+		len += err->extended_log_length;
+
+		if (len > RTAS_ERROR_LOG_MAX)
+			len = RTAS_ERROR_LOG_MAX;
+	}
+	return len;
+}
+
+/*
+ * First write to nvram, if fatal error, that is the only
+ * place we log the info.  The error will be picked up
+ * on the next reboot by rtasd.  If not fatal, run the
+ * method for the type of error.  Currently, only RTAS
+ * errors have methods implemented, but in the future
+ * there might be a need to store data in nvram before a
+ * call to panic().
+ *
+ * XXX We write to nvram periodically, to indicate error has
+ * been written and sync'd, but there is a possibility
+ * that if we don't shutdown correctly, a duplicate error
+ * record will be created on next reboot.
+ */
+void pSeries_log_error(char *buf, unsigned int err_type, int fatal)
+{
+	unsigned long offset;
+	unsigned long s;
+	int len = 0;
+
+	DEBUG("logging event\n");
+
+	if (buf == NULL)
+		return;
+
+	spin_lock_irqsave(&log_lock, s);
+
+	/* get length and increase count */
+	switch (err_type & ERR_TYPE_MASK) {
+	case ERR_TYPE_RTAS_LOG:
+		len = log_rtas_len(buf);
+		if (!(err_type & ERR_FLAG_BOOT))
+			error_log_cnt++;
+		break;
+	case ERR_TYPE_KERNEL_PANIC:
+	default:
+		spin_unlock_irqrestore(&log_lock, s);
+		return;
+	}
+
+	/* Write error to NVRAM */
+	if (!no_more_logging && !(err_type & ERR_FLAG_BOOT))
+		nvram_write_error_log(buf, len, err_type);
+
+	/* Check to see if we need to or have stopped logging */
+	if (fatal || no_more_logging) {
+		no_more_logging = 1;
+		spin_unlock_irqrestore(&log_lock, s);
+		return;
+	}
+
+	/* call type specific method for error */
+	switch (err_type & ERR_TYPE_MASK) {
+	case ERR_TYPE_RTAS_LOG:
+		/* put into syslog and error_log file */
+		printk_log_rtas(buf, len);
+
+		offset = rtas_error_log_buffer_max *
+			((rtas_log_start+rtas_log_size) & LOG_NUMBER_MASK);
+
+		/* First copy over sequence number */
+		memcpy(&rtas_log_buf[offset], (void *) &error_log_cnt, sizeof(int));
+
+		/* Second copy over error log data */
+		offset += sizeof(int);
+		memcpy(&rtas_log_buf[offset], buf, len);
+
+		if (rtas_log_size < LOG_NUMBER)
+			rtas_log_size += 1;
+		else
+			rtas_log_start += 1;
+
+		spin_unlock_irqrestore(&log_lock, s);
+		wake_up_interruptible(&rtas_log_wait);
+		break;
+	case ERR_TYPE_KERNEL_PANIC:
+	default:
+		spin_unlock_irqrestore(&log_lock, s);
+		return;
+	}
+
+}
+
+
 static int rtas_log_open(struct inode * inode, struct file * file)
 {
 	return 0;
@@ -69,36 +221,50 @@
 	return 0;
 }
 
+/* This will check if all events are logged, if they are then, we
+ * know that we can safely clear the events in NVRAM.
+ * Next we'll sit and wait for something else to log.
+ */
 static ssize_t rtas_log_read(struct file * file, char * buf,
 			 size_t count, loff_t *ppos)
 {
 	int error;
 	char *tmp;
+	unsigned long s;
 	unsigned long offset;
 
-	if (!buf || count < rtas_error_log_max)
+	if (!buf || count < rtas_error_log_buffer_max)
 		return -EINVAL;
 
-	count = rtas_error_log_max;
+	count = rtas_error_log_buffer_max;
 
 	error = verify_area(VERIFY_WRITE, buf, count);
 	if (error)
-		return -EINVAL;
+		return -EFAULT;
 
-	tmp = kmalloc(rtas_error_log_max, GFP_KERNEL);
+	tmp = kmalloc(count, GFP_KERNEL);
 	if (!tmp)
 		return -ENOMEM;
 
+
+	spin_lock_irqsave(&log_lock, s);
+	/* if it's 0, then we know we got the last one (the one in NVRAM) */
+	if (rtas_log_size == 0 && !no_more_logging)
+		nvram_clear_error_log();
+	spin_unlock_irqrestore(&log_lock, s);
+
+
 	error = wait_event_interruptible(rtas_log_wait, rtas_log_size);
 	if (error)
 		goto out;
 
-	spin_lock(&rtas_log_lock);
-	offset = rtas_error_log_max * (rtas_log_start & LOG_NUMBER_MASK);
+	spin_lock_irqsave(&log_lock, s);
+	offset = rtas_error_log_buffer_max * (rtas_log_start & LOG_NUMBER_MASK);
 	memcpy(tmp, &rtas_log_buf[offset], count);
+
 	rtas_log_start += 1;
 	rtas_log_size -= 1;
-	spin_unlock(&rtas_log_lock);
+	spin_unlock_irqrestore(&log_lock, s);
 
 	error = copy_to_user(buf, tmp, count) ? -EFAULT : count;
 out:
@@ -121,42 +287,18 @@
 	.release =	rtas_log_release,
 };
 
-static void log_rtas(char *buf)
-{
-	unsigned long offset;
-
-	DEBUG("logging rtas event\n");
-
-	spin_lock(&rtas_log_lock);
-
-	offset = rtas_error_log_max *
-			((rtas_log_start+rtas_log_size) & LOG_NUMBER_MASK);
-
-	memcpy(&rtas_log_buf[offset], buf, rtas_error_log_max);
-
-	if (rtas_log_size < LOG_NUMBER)
-		rtas_log_size += 1;
-	else
-		rtas_log_start += 1;
-
-	spin_unlock(&rtas_log_lock);
-	wake_up_interruptible(&rtas_log_wait);
-}
-
-static int enable_surveillance(void)
+static int enable_surveillance(int timeout)
 {
 	int error;
 
 	error = rtas_call(rtas_token("set-indicator"), 3, 1, NULL,
-			  SURVEILLANCE_TOKEN, 0, SURVEILLANCE_TIMEOUT);
+			  SURVEILLANCE_TOKEN, 0, timeout);
 
 	if (error) {
 		printk(KERN_ERR "rtasd: could not enable surveillance\n");
 		return -1;
 	}
 
-	rtas_event_scan_rate = SURVEILLANCE_SCANRATE;
-
 	return 0;
 }
 
@@ -165,11 +307,12 @@
 	struct device_node *node;
 	int *ip;
 
-	node = find_path_device("/rtas");
+	node = of_find_node_by_path("/rtas");
 
 	ip = (int *)get_property(node, "rtas-event-scan-rate", NULL);
 	if (ip == NULL) {
 		printk(KERN_ERR "rtasd: no rtas-event-scan-rate\n");
+		of_node_put(node);
 		return -1;
 	}
 	rtas_event_scan_rate = *ip;
@@ -178,6 +321,7 @@
 	ip = (int *)get_property(node, "rtas-error-log-max", NULL);
 	if (ip == NULL) {
 		printk(KERN_ERR "rtasd: no rtas-error-log-max\n");
+		of_node_put(node);
 		return -1;
 	}
 	rtas_error_log_max = *ip;
@@ -187,6 +331,7 @@
 		printk(KERN_ERR "rtasd: truncated error log from %d to %d bytes\n", rtas_error_log_max, RTAS_ERROR_LOG_MAX);
 		rtas_error_log_max = RTAS_ERROR_LOG_MAX;
 	}
+	of_node_put(node);
 
 	return 0;
 }
@@ -195,10 +340,12 @@
 
 static int rtasd(void *unused)
 {
+	unsigned int err_type;
 	int cpu = 0;
 	int error;
 	int first_pass = 1;
 	int event_scan = rtas_token("event-scan");
+	int rc;
 
 	if (event_scan == RTAS_UNKNOWN_SERVICE || get_eventscan_parms() == -1)
 		goto error;
@@ -209,6 +356,9 @@
 		goto error;
 	}
 
+	/* We can use rtas_log_buf now */
+	no_more_logging = 0;
+
 	DEBUG("will sleep for %d jiffies\n", (HZ*60/rtas_event_scan_rate) / 2);
 
 	daemonize("rtasd");
@@ -219,6 +369,16 @@
 	current->nice = sys_sched_get_priority_max(SCHED_FIFO) + 1;
 #endif
 
+	/* See if we have any error stored in NVRAM */
+	memset(logdata, 0, rtas_error_log_max);
+
+	rc = nvram_read_error_log(logdata, rtas_error_log_max, &err_type);
+	if (!rc) {
+		if (err_type != ERR_FLAG_ALREADY_LOGGED) {
+			pSeries_log_error(logdata, err_type | ERR_FLAG_BOOT, 0);
+		}
+	}
+
 repeat:
 	for (cpu = 0; cpu < NR_CPUS; cpu++) {
 		if (!cpu_online(cpu))
@@ -231,7 +391,7 @@
 		do {
 			memset(logdata, 0, rtas_error_log_max);
 			error = rtas_call(event_scan, 4, 1, NULL,
-					EVENT_SCAN_ALL_EVENTS, 0,
+					RTAS_EVENT_SCAN_ALL_EVENTS, 0,
 					__pa(logdata), rtas_error_log_max);
 			if (error == -1) {
 				printk(KERN_ERR "event-scan failed\n");
@@ -239,7 +399,7 @@
 			}
 
 			if (error == 0)
-				log_rtas(logdata);
+				pSeries_log_error(logdata, ERR_TYPE_RTAS_LOG, 0);
 
 		} while(error == 0);
 
@@ -252,9 +412,9 @@
 		schedule_timeout(first_pass ? HZ : (HZ*60/rtas_event_scan_rate) / 2);
 	}
 
-	if (first_pass && surveillance_requested) {
+	if (first_pass && (surveillance_timeout != -1)) {
 		DEBUG("enabling surveillance\n");
-		if (enable_surveillance())
+		if (enable_surveillance(surveillance_timeout))
 			goto error_vfree;
 		DEBUG("surveillance enabled\n");
 	}
@@ -273,25 +433,29 @@
 {
 	struct proc_dir_entry *entry;
 
-	if (proc_rtas == NULL) {
-		proc_rtas = proc_mkdir("rtas", 0);
+	if (proc_ppc64.rtas == NULL) {
+		proc_ppc64_init();
 	}
 
-	if (proc_rtas == NULL) {
-		printk(KERN_ERR "Failed to create /proc/rtas in rtas_init\n");
-	} else {
-		entry = create_proc_entry("error_log", S_IRUSR, proc_rtas);
-		if (entry)
-			entry->proc_fops = &proc_rtas_log_operations;
-		else
-			printk(KERN_ERR "Failed to create rtas/error_log proc entry\n");
+	if (proc_ppc64.rtas == NULL) {
+		printk(KERN_ERR "rtas_init: /proc/ppc64/rtas does not exist.");
+		return -EIO;
 	}
 
+	entry = create_proc_entry("error_log", S_IRUSR, proc_ppc64.rtas);
+	if (entry)
+		entry->proc_fops = &proc_rtas_log_operations;
+	else
+		printk(KERN_ERR "Failed to create rtas/error_log proc entry\n");
+
 	if (kernel_thread(rtasd, 0, CLONE_FS) < 0)
 		printk(KERN_ERR "Failed to start RTAS daemon\n");
 
 	printk(KERN_ERR "RTAS daemon started\n");
 
+	/* Make room for the sequence number */
+	rtas_error_log_buffer_max = rtas_error_log_max + sizeof(int);
+
 	return 0;
 }
 
@@ -300,8 +464,8 @@
 	int i;
 
 	if (get_option(&str,&i)) {
-		if (i == 1)
-			surveillance_requested = 1;
+		if (i >= 0 && i <= 255)
+			surveillance_timeout = i;
 	}
 
 	return 1;
diff -Nru a/arch/ppc64/kernel/rtc.c b/arch/ppc64/kernel/rtc.c
--- a/arch/ppc64/kernel/rtc.c	Tue Feb  3 19:45:29 2004
+++ b/arch/ppc64/kernel/rtc.c	Tue Feb  3 19:45:29 2004
@@ -99,6 +99,7 @@
 	switch (cmd) {
 	case RTC_RD_TIME:	/* Read the time/date from RTC	*/
 	{
+		memset(&wtime, 0, sizeof(struct rtc_time));
 		ppc_md.get_rtc_time(&wtime);
 		break;
 	}
diff -Nru a/arch/ppc64/kernel/scanlog.c b/arch/ppc64/kernel/scanlog.c
--- a/arch/ppc64/kernel/scanlog.c	Tue Feb  3 19:45:42 2004
+++ b/arch/ppc64/kernel/scanlog.c	Tue Feb  3 19:45:42 2004
@@ -28,6 +28,7 @@
 #include <asm/uaccess.h>
 #include <asm/rtas.h>
 #include <asm/prom.h>
+#include <asm/proc_fs.h>
 
 #define MODULE_VERSION "1.0"
 #define MODULE_NAME "scanlog"
@@ -43,9 +44,6 @@
 static unsigned int ibm_scan_log_dump;			/* RTAS token */
 static struct proc_dir_entry *proc_ppc64_scan_log_dump;	/* The proc file */
 
-extern struct proc_dir_entry *proc_rtas;
-
-
 static ssize_t scanlog_read(struct file *file, char *buf,
 			    size_t count, loff_t *ppos)
 {
@@ -214,15 +212,16 @@
 		return -EIO;
 	}
 
-	if (proc_rtas == NULL)
-                proc_rtas = proc_mkdir("rtas", 0);
+	if (proc_ppc64.rtas == NULL) {
+		proc_ppc64_init();
+	}
 
-	if (proc_rtas == NULL) {
+	if (proc_ppc64.rtas == NULL) {
 		printk(KERN_ERR "Failed to create /proc/rtas in scanlog_init\n");
 		return -EIO;
 	}
 
-        ent = create_proc_entry("scan-log-dump",  S_IRUSR, proc_rtas);
+        ent = create_proc_entry("scan-log-dump",  S_IRUSR, proc_ppc64.rtas);
 	if (ent) {
 		ent->proc_fops = &scanlog_fops;
 		/* Ideally we could allocate a buffer < 4G */
diff -Nru a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c
--- a/arch/ppc64/kernel/setup.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc64/kernel/setup.c	Tue Feb  3 19:45:17 2004
@@ -38,6 +38,7 @@
 #include <asm/paca.h>
 #include <asm/ppcdebug.h>
 #include <asm/time.h>
+#include <asm/cputable.h>
 #include <asm/sections.h>
 
 extern unsigned long klimit;
@@ -58,6 +59,9 @@
 extern void pSeries_init_early( void );
 extern void pSeriesLP_init_early(void);
 extern void mm_init_ppc64( void ); 
+extern void pseries_secondary_smp_init(unsigned long); 
+extern int  idle_setup(void);
+extern void vpa_init(int cpu);
 
 unsigned long decr_overclock = 1;
 unsigned long decr_overclock_proc0 = 1;
@@ -137,12 +141,16 @@
 }
 
 /*
- * Do some initial setup of the system.  The paramters are those which 
+ * Do some initial setup of the system.  The parameters are those which 
  * were passed in from the bootloader.
  */
 void setup_system(unsigned long r3, unsigned long r4, unsigned long r5,
 		  unsigned long r6, unsigned long r7)
 {
+#ifdef CONFIG_PPC_PSERIES
+        unsigned int ret, i;
+#endif
+
 #ifdef CONFIG_XMON_DEFAULT
 	debugger = xmon;
 	debugger_bpt = xmon_bpt;
@@ -183,10 +191,33 @@
 #endif
 	}
 
+#ifdef CONFIG_PPC_PSERIES
 	if (systemcfg->platform & PLATFORM_PSERIES) {
 		early_console_initialized = 1;
 		register_console(&udbg_console);
+		finish_device_tree();
+		chrp_init(r3, r4, r5, r6, r7);
+
+#ifdef CONFIG_SMP
+		/* Start secondary threads on SMT systems */
+		for (i = 0; i < NR_CPUS; i++) {
+			if(cpu_available(i)  && !cpu_possible(i)) {
+				printk("%16.16x : starting thread\n", i);
+				rtas_call(rtas_token("start-cpu"), 3, 1, 
+					  (void *)&ret,
+					  get_hard_smp_processor_id(i), 
+					  *((unsigned long *)pseries_secondary_smp_init), i);
+				cpu_set(i, cpu_possible_map);
+				systemcfg->processorCount++;
+			}
+		}
+#endif
 	}
+#endif
+	/* Finish initializing the hash table (do the dynamic
+	 * patching for the fast-path hashtable.S code)
+	 */
+	htab_finish_init();
 
 	printk("Starting Linux PPC64 %s\n", UTS_RELEASE);
 
@@ -204,12 +235,16 @@
 	printk("htab_data.num_ptegs           = 0x%lx\n", htab_data.htab_num_ptegs);
 	printk("-----------------------------------------------------\n");
 
-	if (systemcfg->platform & PLATFORM_PSERIES) {
-		finish_device_tree();
-		chrp_init(r3, r4, r5, r6, r7);
+	mm_init_ppc64();
+
+#if defined(CONFIG_SMP) && defined(CONFIG_PPC_PSERIES)
+	if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
+		vpa_init(boot_cpuid);
 	}
+#endif
 
-	mm_init_ppc64();
+	/* Select the correct idle loop for the platform. */
+	idle_setup();
 
 	switch (systemcfg->platform) {
 #ifdef CONFIG_PPC_ISERIES
@@ -277,36 +312,19 @@
 	seq_printf(m, "processor\t: %lu\n", cpu_id);
 	seq_printf(m, "cpu\t\t: ");
 
-	switch (PVR_VER(pvr)) {
-	case PV_NORTHSTAR:
-		seq_printf(m, "RS64-II (northstar)\n");
-		break;
-	case PV_PULSAR:
-		seq_printf(m, "RS64-III (pulsar)\n");
-		break;
-	case PV_POWER4:
-		seq_printf(m, "POWER4 (gp)\n");
-		break;
-	case PV_ICESTAR:
-		seq_printf(m, "RS64-III (icestar)\n");
-		break;
-	case PV_SSTAR:
-		seq_printf(m, "RS64-IV (sstar)\n");
-		break;
-	case PV_POWER4p:
-		seq_printf(m, "POWER4+ (gq)\n");
-		break;
-	case PV_630:
-		seq_printf(m, "POWER3 (630)\n");
-		break;
-	case PV_630p:
-		seq_printf(m, "POWER3 (630+)\n");
-		break;
-	default:
-		seq_printf(m, "Unknown (%08x)\n", pvr);
-		break;
-	}
+	if (cur_cpu_spec->pvr_mask)
+		seq_printf(m, "%s", cur_cpu_spec->cpu_name);
+	else
+		seq_printf(m, "unknown (%08x)", pvr);
+
+#ifdef CONFIG_ALTIVEC
+	if (cur_cpu_spec->cpu_features & CPU_FTR_ALTIVEC)
+		seq_printf(m, ", altivec supported");
+#endif /* CONFIG_ALTIVEC */
+
+	seq_printf(m, "\n");
 
+#ifdef CONFIG_PPC_PSERIES
 	/*
 	 * Assume here that all clock rates are the same in a
 	 * smp system.  -- Cort
@@ -315,15 +333,17 @@
 		struct device_node *cpu_node;
 		int *fp;
 
-		cpu_node = find_type_devices("cpu");
+		cpu_node = of_find_node_by_type(NULL, "cpu");
 		if (cpu_node) {
 			fp = (int *) get_property(cpu_node, "clock-frequency",
 						  NULL);
 			if (fp)
 				seq_printf(m, "clock\t\t: %dMHz\n",
 					   *fp / 1000000);
+			of_node_put(cpu_node);
 		}
 	}
+#endif
 
 	if (ppc_md.setup_residual != NULL)
 		ppc_md.setup_residual(m, cpu_id);
@@ -353,13 +373,11 @@
 };
 
 /*
- * Fetch the cmd_line from open firmware. */
+ * Fetch the cmd_line from open firmware. 
+ */
 void parse_cmd_line(unsigned long r3, unsigned long r4, unsigned long r5,
 		  unsigned long r6, unsigned long r7)
 {
-	struct device_node *chosen;
-	char *p;
-
 #ifdef CONFIG_BLK_DEV_INITRD
 	if ((initrd_start == 0) && r3 && r4 && r4 != 0xdeadbeef) {
 		initrd_start = (r3 >= KERNELBASE) ? r3 : (unsigned long)__va(r3);
@@ -375,12 +393,20 @@
 	strlcpy(cmd_line, CONFIG_CMDLINE, sizeof(cmd_line));
 #endif /* CONFIG_CMDLINE */
 
-	chosen = find_devices("chosen");
+#ifdef CONFIG_PPC_PSERIES
+	{
+	struct device_node *chosen;
+
+	chosen = of_find_node_by_name(NULL, "chosen");
 	if (chosen != NULL) {
+		char *p;
 		p = get_property(chosen, "bootargs", NULL);
 		if (p != NULL && p[0] != 0)
 			strlcpy(cmd_line, p, sizeof(cmd_line));
+		of_node_put(chosen);
+	}
 	}
+#endif
 
 	/* Look for mem= option on command line */
 	if (strstr(cmd_line, "mem=")) {
@@ -405,28 +431,57 @@
 	}
 }
 
-
-char *bi_tag2str(unsigned long tag)
+#ifdef CONFIG_PPC_PSERIES
+static int __init set_preferred_console(void)
 {
-	switch (tag) {
-	case BI_FIRST:
-		return "BI_FIRST";
-	case BI_LAST:
-		return "BI_LAST";
-	case BI_CMD_LINE:
-		return "BI_CMD_LINE";
-	case BI_BOOTLOADER_ID:
-		return "BI_BOOTLOADER_ID";
-	case BI_INITRD:
-		return "BI_INITRD";
-	case BI_SYSMAP:
-		return "BI_SYSMAP";
-	case BI_MACHTYPE:
-		return "BI_MACHTYPE";
-	default:
-		return "BI_UNKNOWN";
+	struct device_node *prom_stdout;
+	char *name;
+
+	/* The user has requested a console so this is already set up. */
+	if (strstr(cmd_line, "console="))
+		return -EBUSY;
+
+	prom_stdout = find_path_device(of_stdout_device);
+	if (!prom_stdout)
+		return -ENODEV;
+
+	name = (char *)get_property(prom_stdout, "name", NULL);
+	if (!name)
+		return -ENODEV;
+
+	if (strcmp(name, "serial") == 0) {
+		int i;
+		u32 *reg = (u32 *)get_property(prom_stdout, "reg", &i);
+		if (i > 8) {
+			int offset;
+			switch (reg[1]) {
+				case 0x3f8:
+					offset = 0;
+					break;
+				case 0x2f8:
+					offset = 1;
+					break;
+				case 0x898:
+					offset = 2;
+					break;
+				case 0x890:
+					offset = 3;
+					break;
+				default:
+					/* We dont recognise the serial port */
+					return -ENODEV;
+			}
+
+			return add_preferred_console("ttyS", offset, NULL);
+		}
+	} else if (strcmp(name, "vty") == 0) {
+		/* pSeries LPAR virtual console */
+		return add_preferred_console("hvc", 0, NULL);
 	}
+
+	return -ENODEV;
 }
+console_initcall(set_preferred_console);
 
 int parse_bootinfo(void)
 {
@@ -445,8 +500,7 @@
 			memcpy(cmd_line, (void *)rec->data, rec->size);
 			break;
 		case BI_SYSMAP:
-			sysmap = (char *)((rec->data[0] >= (KERNELBASE))
-					? rec->data[0] : (unsigned long)__va(rec->data[0]));
+			sysmap = __va(rec->data[0]);
 			sysmap_size = rec->data[1];
 			break;
 #ifdef CONFIG_BLK_DEV_INITRD
@@ -462,6 +516,7 @@
 
 	return 0;
 }
+#endif
 
 int __init ppc_init(void)
 {
@@ -486,7 +541,6 @@
 }	
 
 extern void (*calibrate_delay)(void);
-extern void sort_exception_table(void);
 
 /*
  * Called into from start_kernel, after lock_kernel has been called.
@@ -534,7 +588,6 @@
 	ppc_md.setup_arch();
 
 	paging_init();
-	sort_exception_table();
 	ppc64_boot_msg(0x15, "Setup Done");
 }
 
diff -Nru a/arch/ppc64/kernel/signal.c b/arch/ppc64/kernel/signal.c
--- a/arch/ppc64/kernel/signal.c	Tue Feb  3 19:45:16 2004
+++ b/arch/ppc64/kernel/signal.c	Tue Feb  3 19:45:16 2004
@@ -14,6 +14,7 @@
  *  2 of the License, or (at your option) any later version.
  */
 
+#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
@@ -114,19 +115,49 @@
  * Set up the sigcontext for the signal frame.
  */
 
-static int
-setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
+static int setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
 		 int signr, sigset_t *set, unsigned long handler)
 {
+	/* When CONFIG_ALTIVEC is set, we _always_ setup v_regs even if the
+	 * process never used altivec yet (MSR_VEC is zero in pt_regs of
+	 * the context). This is very important because we must ensure we
+	 * don't lose the VRSAVE content that may have been set prior to
+	 * the process doing its first vector operation
+	 * Userland shall check AT_HWCAP to know wether it can rely on the
+	 * v_regs pointer or not
+	 */
+#ifdef CONFIG_ALTIVEC
+	elf_vrreg_t *v_regs = (elf_vrreg_t *)(((unsigned long)sc->vmx_reserve) & ~0xful);
+#endif
 	int err = 0;
 
 	if (regs->msr & MSR_FP)
 		giveup_fpu(current);
 
-	current->thread.saved_msr = regs->msr & ~(MSR_FP | MSR_FE0 | MSR_FE1);
-	regs->msr = current->thread.saved_msr | current->thread.fpexc_mode;
-	current->thread.saved_softe = regs->softe;
+	/* Make sure signal doesn't get spurrious FP exceptions */
+	current->thread.fpscr = 0;
+
+#ifdef CONFIG_ALTIVEC
+	err |= __put_user(v_regs, &sc->v_regs);
 
+	/* save altivec registers */
+	if (current->thread.used_vr) {		
+		if (regs->msr & MSR_VEC)
+			giveup_altivec(current);
+		/* Copy 33 vec registers (vr0..31 and vscr) to the stack */
+		err |= __copy_to_user(v_regs, current->thread.vr, 33 * sizeof(vector128));
+		/* set MSR_VEC in the MSR value in the frame to indicate that sc->v_reg)
+		 * contains valid data.
+		 */
+		regs->msr |= MSR_VEC;
+	}
+	/* We always copy to/from vrsave, it's 0 if we don't have or don't
+	 * use altivec.
+	 */
+	err |= __put_user(current->thread.vrsave, (u32 *)&v_regs[33]);
+#else /* CONFIG_ALTIVEC */
+	err |= __put_user(0, &sc->v_regs);
+#endif /* CONFIG_ALTIVEC */
 	err |= __put_user(&sc->gp_regs, &sc->regs);
 	err |= __copy_to_user(&sc->gp_regs, regs, GP_REGS_SIZE);
 	err |= __copy_to_user(&sc->fp_regs, &current->thread.fpr, FP_REGS_SIZE);
@@ -135,9 +166,6 @@
 	if (set != NULL)
 		err |=  __put_user(set->sig[0], &sc->oldmask);
 
-	regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1);
-	current->thread.fpscr = 0;
-
 	return err;
 }
 
@@ -145,23 +173,42 @@
  * Restore the sigcontext from the signal frame.
  */
 
-static int
-restore_sigcontext(struct pt_regs *regs, sigset_t *set, struct sigcontext *sc)
+static int restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig, struct sigcontext *sc)
 {
+#ifdef CONFIG_ALTIVEC
+	elf_vrreg_t *v_regs;
+#endif
 	unsigned int err = 0;
+	unsigned long save_r13;
 
-	if (regs->msr & MSR_FP)
-		giveup_fpu(current);
-
+	/* If this is not a signal return, we preserve the TLS in r13 */
+	if (!sig)
+		save_r13 = regs->gpr[13];
 	err |= __copy_from_user(regs, &sc->gp_regs, GP_REGS_SIZE);
+	if (!sig)
+		regs->gpr[13] = save_r13;
 	err |= __copy_from_user(&current->thread.fpr, &sc->fp_regs, FP_REGS_SIZE);
-	current->thread.fpexc_mode = regs->msr & (MSR_FE0 | MSR_FE1);
 	if (set != NULL)
 		err |=  __get_user(set->sig[0], &sc->oldmask);
 
-	/* Don't allow the signal handler to change these modulo FE{0,1} */
-	regs->msr = current->thread.saved_msr & ~(MSR_FP | MSR_FE0 | MSR_FE1);
-	regs->softe = current->thread.saved_softe;
+#ifdef CONFIG_ALTIVEC
+	err |= __get_user(v_regs, &sc->v_regs);
+	if (err)
+		return err;
+	/* Copy 33 vec registers (vr0..31 and vscr) from the stack */
+	if (v_regs != 0 && (regs->msr & MSR_VEC) != 0)
+		err |= __copy_from_user(current->thread.vr, v_regs, 33 * sizeof(vector128));
+	else if (current->thread.used_vr)
+		memset(&current->thread.vr, 0, 33);
+	/* Always get VRSAVE back */
+	if (v_regs != 0)
+		err |= __get_user(current->thread.vrsave, (u32 *)&v_regs[33]);
+	else
+		current->thread.vrsave = 0;
+#endif /* CONFIG_ALTIVEC */
+
+	/* Force reload of FP/VEC */
+	regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1 | MSR_VEC);
 
 	return err;
 }
@@ -169,8 +216,8 @@
 /*
  * Allocate space for the signal frame
  */
-static inline void *
-get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size)
+static inline void * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
+				  size_t frame_size)
 {
         unsigned long newsp;
 
@@ -185,8 +232,10 @@
         return (void *)((newsp - frame_size) & -8ul);
 }
 
-static int
-setup_trampoline(unsigned int syscall, unsigned int *tramp)
+/*
+ * Setup the trampoline code on the stack
+ */
+static int setup_trampoline(unsigned int syscall, unsigned int *tramp)
 {
 	int i, err = 0;
 
@@ -209,6 +258,72 @@
 }
 
 /*
+ * Restore the user process's signal mask (also used by signal32.c)
+ */
+void restore_sigmask(sigset_t *set)
+{
+	sigdelsetmask(set, ~_BLOCKABLE);
+	spin_lock_irq(&current->sighand->siglock);
+	current->blocked = *set;
+	recalc_sigpending();
+	spin_unlock_irq(&current->sighand->siglock);
+}
+
+
+/*
+ * Handle {get,set,swap}_context operations
+ */
+int sys_swapcontext(struct ucontext __user *old_ctx,
+		    struct ucontext __user *new_ctx,
+		    long ctx_size, long r6, long r7, long r8, struct pt_regs *regs)
+{
+	unsigned char tmp;
+	sigset_t set;
+
+	/* Context size is for future use. Right now, we only make sure
+	 * we are passed something we understand
+	 */
+	if (ctx_size < sizeof(struct ucontext))
+		return -EINVAL;
+
+	if (old_ctx != NULL) {
+		if (verify_area(VERIFY_WRITE, old_ctx, sizeof(*old_ctx))
+		    || setup_sigcontext(&old_ctx->uc_mcontext, regs, 0, NULL, 0)
+		    || __copy_to_user(&old_ctx->uc_sigmask,
+				      &current->blocked, sizeof(sigset_t)))
+			return -EFAULT;
+	}
+	if (new_ctx == NULL)
+		return 0;
+	if (verify_area(VERIFY_READ, new_ctx, sizeof(*new_ctx))
+	    || __get_user(tmp, (u8 *) new_ctx)
+	    || __get_user(tmp, (u8 *) (new_ctx + 1) - 1))
+		return -EFAULT;
+
+	/*
+	 * If we get a fault copying the context into the kernel's
+	 * image of the user's registers, we can't just return -EFAULT
+	 * because the user's registers will be corrupted.  For instance
+	 * the NIP value may have been updated but not some of the
+	 * other registers.  Given that we have done the verify_area
+	 * and successfully read the first and last bytes of the region
+	 * above, this should only happen in an out-of-memory situation
+	 * or if another thread unmaps the region containing the context.
+	 * We kill the task with a SIGSEGV in this situation.
+	 */
+
+	if (__copy_from_user(&set, &new_ctx->uc_sigmask, sizeof(set)))
+		do_exit(SIGSEGV);
+	restore_sigmask(&set);
+	if (restore_sigcontext(regs, NULL, 0, &new_ctx->uc_mcontext))
+		do_exit(SIGSEGV);
+
+	/* This returns like rt_sigreturn */
+	return 0;
+}
+
+
+/*
  * Do a signal return; undo the signal stack.
  */
 
@@ -218,7 +333,6 @@
 {
 	struct ucontext *uc = (struct ucontext *)regs->gpr[1];
 	sigset_t set;
-	stack_t st;
 
 	/* Always make any pending restarted system calls return -EINTR */
 	current_thread_info()->restart_block.fn = do_no_restart_syscall;
@@ -228,20 +342,14 @@
 
 	if (__copy_from_user(&set, &uc->uc_sigmask, sizeof(set)))
 		goto badframe;
-	sigdelsetmask(&set, ~_BLOCKABLE);
-	spin_lock_irq(&current->sighand->siglock);
-	current->blocked = set;
-	recalc_sigpending();
-	spin_unlock_irq(&current->sighand->siglock);
-
-	if (restore_sigcontext(regs, NULL, &uc->uc_mcontext))
+	restore_sigmask(&set);
+	if (restore_sigcontext(regs, NULL, 1, &uc->uc_mcontext))
 		goto badframe;
 
-	if (__copy_from_user(&st, &uc->uc_stack, sizeof(st)))
-		goto badframe;
-	/* This function sets back the stack flags into
-	   the current task structure.  */
-	sys_sigaltstack(&st, NULL, 0, 0, 0, 0, regs);
+	/* do_sigaltstack expects a __user pointer and won't modify
+	 * what's in there anyway
+	 */
+	do_sigaltstack(&uc->uc_stack, NULL, regs->gpr[1]);
 
 	return regs->result;
 
@@ -253,8 +361,7 @@
 	do_exit(SIGSEGV);
 }
 
-static void
-setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info,
+static void setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info,
 		sigset_t *set, struct pt_regs *regs)
 {
 	/* Handler is *really* a pointer to the function descriptor for
@@ -332,9 +439,8 @@
 /*
  * OK, we're invoking a handler
  */
-static void
-handle_signal(unsigned long sig, struct k_sigaction *ka,
-	      siginfo_t *info, sigset_t *oldset, struct pt_regs *regs)
+static void handle_signal(unsigned long sig, struct k_sigaction *ka,
+			  siginfo_t *info, sigset_t *oldset, struct pt_regs *regs)
 {
 	/* Set up Signal Frame */
 	setup_rt_frame(sig, ka, info, oldset, regs);
@@ -352,8 +458,7 @@
 	return;
 }
 
-static inline void
-syscall_restart(struct pt_regs *regs, struct k_sigaction *ka)
+static inline void syscall_restart(struct pt_regs *regs, struct k_sigaction *ka)
 {
 	switch ((int)regs->result) {
 	case -ERESTART_RESTARTBLOCK:
diff -Nru a/arch/ppc64/kernel/signal32.c b/arch/ppc64/kernel/signal32.c
--- a/arch/ppc64/kernel/signal32.c	Tue Feb  3 19:45:42 2004
+++ b/arch/ppc64/kernel/signal32.c	Tue Feb  3 19:45:42 2004
@@ -14,6 +14,7 @@
  *      2 of the License, or (at your option) any later version.
  */
 
+#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/mm.h> 
 #include <linux/smp.h>
@@ -32,71 +33,207 @@
 #define DEBUG_SIG 0
 
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
-/* 
- * These are the flags in the MSR that the user is allowed to change
- * by modifying the saved value of the MSR on the stack.  SE and BE
- * should not be in this list since gdb may want to change these.  I.e,
- * you should be able to step out of a signal handler to see what
- * instruction executes next after the signal handler completes.
- * Alternately, if you stepped into a signal handler, you should be
- * able to continue 'til the next breakpoint from within the signal
- * handler, even if the handler returns.
- */
-#if 0
-#define MSR_USERCHANGE	(MSR_FE0 | MSR_FE1)
-#else
+
+#define GP_REGS_SIZE32	min(sizeof(elf_gregset_t32), sizeof(struct pt_regs32))
+
 /*
- * glibc tries to set FE0/FE1 via a signal handler. Since it only ever
- * sets both bits and this is the default setting we now disable this
- * behaviour. This is done to insure the new prctl which alters FE0/FE1 does
- * not get overriden by glibc. Setting and clearing FE0/FE1 via signal
- * handler has always been bogus since load_up_fpu used to set FE0/FE1
- * unconditionally.
+ * When we have signals to deliver, we set up on the
+ * user stack, going down from the original stack pointer:
+ *	a sigregs32 struct
+ *	a sigcontext32 struct
+ *	a gap of __SIGNAL_FRAMESIZE32 bytes
+ *
+ * Each of these things must be a multiple of 16 bytes in size.
+ *
  */
-#define MSR_USERCHANGE	0
-#endif
-
 struct sigregs32 {
-	/*
-	 * the gp_regs array is 32 bit representation of the pt_regs
-	 * structure that was stored on the kernel stack during the
-	 * system call that was interrupted for the signal.
-	 *
-	 * Note that the entire pt_regs regs structure will fit in
-	 * the gp_regs structure because the ELF_NREG value is 48 for
-	 * PPC and the pt_regs structure contains 44 registers
-	 */
-	elf_gregset_t32	gp_regs;
-	double		fp_regs[ELF_NFPREG];
-	unsigned int	tramp[2];
+	struct mcontext32	mctx;		/* all the register values */
 	/*
 	 * Programs using the rs6000/xcoff abi can save up to 19 gp
 	 * regs and 18 fp regs below sp before decrementing it.
 	 */
-	int		abigap[56];
+	int			abigap[56];
 };
 
+/* We use the mc_pad field for the signal return trampoline. */
+#define tramp	mc_pad
 
-struct rt_sigframe_32 {
-	/*
-	 * Unused space at start of frame to allow for storing of
-	 * stack pointers
-	 */
-	unsigned long _unused;
+/*
+ *  When we have rt signals to deliver, we set up on the
+ *  user stack, going down from the original stack pointer:
+ *	one rt_sigframe32 struct (siginfo + ucontext + ABI gap)
+ *	a gap of __SIGNAL_FRAMESIZE32+16 bytes
+ *  (the +16 is to get the siginfo and ucontext32 in the same
+ *  positions as in older kernels).
+ *
+ *  Each of these things must be a multiple of 16 bytes in size.
+ *
+ */
+struct rt_sigframe32 {
+	struct compat_siginfo	info;
+	struct ucontext32	uc;
 	/*
-	 * This is a 32 bit pointer in user address space 
-	 * it is a pointer to the siginfo stucture in the rt stack frame 
+	 * Programs using the rs6000/xcoff abi can save up to 19 gp
+	 * regs and 18 fp regs below sp before decrementing it.
 	 */
-	u32 pinfo;
+	int			abigap[56];
+};
+
+
+/*
+ * Common utility functions used by signal and context support
+ *
+ */
+
+/*
+ * Restore the user process's signal mask
+ * (implemented in signal.c)
+ */
+extern void restore_sigmask(sigset_t *set);
+
+/*
+ * Functions for flipping sigsets (thanks to brain dead generic
+ * implementation that makes things simple for little endian only
+ */
+static inline void compat_from_sigset(compat_sigset_t *compat, sigset_t *set)
+{
+	switch (_NSIG_WORDS) {
+	case 4: compat->sig[5] = set->sig[3] & 0xffffffffull ;
+		compat->sig[7] = set->sig[3] >> 32; 
+	case 3: compat->sig[4] = set->sig[2] & 0xffffffffull ;
+		compat->sig[5] = set->sig[2] >> 32; 
+	case 2: compat->sig[2] = set->sig[1] & 0xffffffffull ;
+		compat->sig[3] = set->sig[1] >> 32; 
+	case 1: compat->sig[0] = set->sig[0] & 0xffffffffull ;
+		compat->sig[1] = set->sig[0] >> 32; 
+	}
+}
+
+static inline void sigset_from_compat(sigset_t *set, compat_sigset_t *compat)
+{
+	switch (_NSIG_WORDS) {
+	case 4: set->sig[3] = compat->sig[6] | (((long)compat->sig[7]) << 32);
+	case 3: set->sig[2] = compat->sig[4] | (((long)compat->sig[5]) << 32);
+	case 2: set->sig[1] = compat->sig[2] | (((long)compat->sig[3]) << 32);
+	case 1: set->sig[0] = compat->sig[0] | (((long)compat->sig[1]) << 32);
+	}
+}
+
+
+/*
+ * Save the current user registers on the user stack.
+ * We only save the altivec registers if the process has used
+ * altivec instructions at some point.
+ */
+static int save_user_regs(struct pt_regs *regs, struct mcontext32 *frame, int sigret)
+{
+	elf_greg_t64 *gregs = (elf_greg_t64 *)regs;
+	int i, err = 0;
+	
+	/* Make sure floating point registers are stored in regs */ 
+	if (regs->msr & MSR_FP)
+		giveup_fpu(current);
+	
+	/* save general and floating-point registers */
+	for (i = 0; i <= PT_RESULT; i ++)
+		err |= __put_user((unsigned int)gregs[i], &frame->mc_gregs[i]);
+	err |= __copy_to_user(&frame->mc_fregs, current->thread.fpr,
+			      ELF_NFPREG * sizeof(double));
+	if (err)
+		return 1;
+
+	current->thread.fpscr = 0;	/* turn off all fp exceptions */
+
+#ifdef CONFIG_ALTIVEC
+	/* save altivec registers */
+	if (current->thread.used_vr) {
+		if (regs->msr & MSR_VEC)
+			giveup_altivec(current);
+		if (__copy_to_user(&frame->mc_vregs, current->thread.vr,
+				   ELF_NVRREG32 * sizeof(vector128)))
+			return 1;
+		/* set MSR_VEC in the saved MSR value to indicate that
+		   frame->mc_vregs contains valid data */
+		if (__put_user(regs->msr | MSR_VEC, &frame->mc_gregs[PT_MSR]))
+			return 1;
+	}
+	/* else assert((regs->msr & MSR_VEC) == 0) */
+
+	/* We always copy to/from vrsave, it's 0 if we don't have or don't
+	 * use altivec. Since VSCR only contains 32 bits saved in the least
+	 * significant bits of a vector, we "cheat" and stuff VRSAVE in the
+	 * most significant bits of that same vector. --BenH
+	 */
+	if (__put_user(current->thread.vrsave, (u32 *)&frame->mc_vregs[32]))
+		return 1;
+#endif /* CONFIG_ALTIVEC */
+
+	if (sigret) {
+		/* Set up the sigreturn trampoline: li r0,sigret; sc */
+		if (__put_user(0x38000000UL + sigret, &frame->tramp[0])
+		    || __put_user(0x44000002UL, &frame->tramp[1]))
+			return 1;
+		flush_icache_range((unsigned long) &frame->tramp[0],
+				   (unsigned long) &frame->tramp[2]);
+	}
+
+	return 0;
+}
+
+/*
+ * Restore the current user register values from the user stack,
+ * (except for MSR).
+ */
+static int restore_user_regs(struct pt_regs *regs, struct mcontext32 __user *sr, int sig)
+{
+	elf_greg_t64 *gregs = (elf_greg_t64 *)regs;
+	int i, err = 0;
+	unsigned int save_r2;
+#ifdef CONFIG_ALTIVEC
+	unsigned long msr;
+#endif
+
 	/*
-	 * This is a 32 bit pointer in user address space
-	 * it is a pointer to the user context in the rt stack frame
+	 * restore general registers but not including MSR. Also take
+	 * care of keeping r2 (TLS) intact if not a signal
 	 */
-	u32 puc;
-	struct siginfo32  info;
-	struct ucontext32 uc;
-};
+	if (!sig)
+		save_r2 = (unsigned int)regs->gpr[2];
+	for (i = 0; i < PT_MSR; i ++)
+		err |= __get_user(gregs[i], &sr->mc_gregs[i]);
+	for (i ++; i <= PT_RESULT; i ++)
+		err |= __get_user(gregs[i], &sr->mc_gregs[i]);
+	if (!sig)
+		regs->gpr[2] = (unsigned long) save_r2;
+	if (err)
+		return 1;
+
+	/* force the process to reload the FP registers from
+	   current->thread when it next does FP instructions */
+	regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1);
+	if (__copy_from_user(current->thread.fpr, &sr->mc_fregs,
+			     sizeof(sr->mc_fregs)))
+		return 1;
+
+#ifdef CONFIG_ALTIVEC
+	/* force the process to reload the altivec registers from
+	   current->thread when it next does altivec instructions */
+	regs->msr &= ~MSR_VEC;
+	if (!__get_user(msr, &sr->mc_gregs[PT_MSR]) && (msr & MSR_VEC) != 0) {
+		/* restore altivec registers from the stack */
+		if (__copy_from_user(current->thread.vr, &sr->mc_vregs,
+				     sizeof(sr->mc_vregs)))
+			return 1;
+	} else if (current->thread.used_vr)
+		memset(&current->thread.vr, 0, ELF_NVRREG32 * sizeof(vector128));
+
+	/* Always get VRSAVE back */
+	if (__get_user(current->thread.vrsave, (u32 *)&sr->mc_vregs[32]))
+		return 1;
+#endif /* CONFIG_ALTIVEC */
 
+	return 0;
+}
 
 
 /*
@@ -181,209 +318,6 @@
 }
 
 
-/*
- * When we have signals to deliver, we set up on the
- * user stack, going down from the original stack pointer:
- *	a sigregs struct
- *	one or more sigcontext structs
- *	a gap of __SIGNAL_FRAMESIZE32 bytes
- *
- * Each of these things must be a multiple of 16 bytes in size.
- *
- */
-
-
-/*
- * Do a signal return; undo the signal stack.
- */
-long sys32_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
-		     unsigned long r6, unsigned long r7, unsigned long r8,
-		     struct pt_regs *regs)
-{
-	struct sigcontext32 *sc, sigctx;
-	struct sigregs32 *sr;
-	int ret;
-	elf_gregset_t32 saved_regs;  /* an array of ELF_NGREG unsigned ints (32 bits) */
-	sigset_t set;
-	int i;
-
-	sc = (struct sigcontext32 *)(regs->gpr[1] + __SIGNAL_FRAMESIZE32);
-	if (copy_from_user(&sigctx, sc, sizeof(sigctx)))
-		goto badframe;
-
-	/*
-	 * Note that PPC32 puts the upper 32 bits of the sigmask in the
-	 * unused part of the signal stackframe
-	 */
-	set.sig[0] = sigctx.oldmask + ((long)(sigctx._unused[3]) << 32);
-	sigdelsetmask(&set, ~_BLOCKABLE);
-	spin_lock_irq(&current->sighand->siglock);
-	current->blocked = set;
-	recalc_sigpending();
-	spin_unlock_irq(&current->sighand->siglock);
-	if (regs->msr & MSR_FP )
-		giveup_fpu(current);
-	/* Last stacked signal - restore registers */
-	sr = (struct sigregs32*)(u64)sigctx.regs;
-	/*
-	 * copy the 32 bit register values off the user stack
-	 * into the 32 bit register area
-	 */
-	if (copy_from_user(saved_regs, &sr->gp_regs, sizeof(sr->gp_regs)))
-		goto badframe;
-	/*
-	 * The saved reg structure in the frame is an elf_grepset_t32,
-	 * it is a 32 bit register save of the registers in the
-	 * pt_regs structure that was stored on the kernel stack
-	 * during the system call when the system call was interrupted
-	 * for the signal. Only 32 bits are saved because the
-	 * sigcontext contains a pointer to the regs and the sig
-	 * context address is passed as a pointer to the signal
-	 * handler.  
-	 *
-	 * The entries in the elf_grepset have the same index as the
-	 * elements in the pt_regs structure.
-	 */
-	saved_regs[PT_MSR] = (regs->msr & ~MSR_USERCHANGE)
-		| (saved_regs[PT_MSR] & MSR_USERCHANGE);
-	/*
-	 * Register 2 is the kernel toc - should be reset on
-	 * any calls into the kernel 
-	 */
-	for (i = 0; i < 32; i++)
-		regs->gpr[i] = (u64)(saved_regs[i]) & 0xFFFFFFFF;
-
-	/*
-	 *  restore the non gpr registers 
-	 */
-	regs->msr = (u64)(saved_regs[PT_MSR]) & 0xFFFFFFFF;
-	/*
-	 * Insure that the interrupt mode is 64 bit, during 32 bit
-	 * execution. (This is necessary because we only saved
-	 * lower 32 bits of msr.)
-	 */
-	regs->msr = regs->msr | MSR_ISF;  /* When this thread is interrupted it should run in 64 bit mode. */
-
-	regs->nip = (u64)(saved_regs[PT_NIP]) & 0xFFFFFFFF;
-	regs->orig_gpr3 = (u64)(saved_regs[PT_ORIG_R3]) & 0xFFFFFFFF; 
-	regs->ctr = (u64)(saved_regs[PT_CTR]) & 0xFFFFFFFF; 
-	regs->link = (u64)(saved_regs[PT_LNK]) & 0xFFFFFFFF; 
-	regs->xer = (u64)(saved_regs[PT_XER]) & 0xFFFFFFFF; 
-	regs->ccr = (u64)(saved_regs[PT_CCR]) & 0xFFFFFFFF;
-	/* regs->softe is left unchanged (like the MSR.EE bit) */
-	/******************************************************/
-	/* the DAR and the DSISR are only relevant during a   */
-	/*   data or instruction storage interrupt. The value */
-	/*   will be set to zero.                             */
-	/******************************************************/
-	regs->dar = 0; 
-	regs->dsisr = 0;
-	regs->result = (u64)(saved_regs[PT_RESULT]) & 0xFFFFFFFF;
-
-	if (copy_from_user(current->thread.fpr, &sr->fp_regs,
-			   sizeof(sr->fp_regs)))
-		goto badframe;
-
-	ret = regs->result;
-	return ret;
-
-badframe:
-	do_exit(SIGSEGV);
-}	
-
-/*
- * Set up a signal frame.
- */
-static void setup_frame32(struct pt_regs *regs, struct sigregs32 *frame,
-            unsigned int newsp)
-{
-	struct sigcontext32 *sc = (struct sigcontext32 *)(u64)newsp;
-	int i;
-
-	/* Always make any pending restarted system calls return -EINTR */
-	current_thread_info()->restart_block.fn = do_no_restart_syscall;
-
-	if (verify_area(VERIFY_WRITE, frame, sizeof(*frame)))
-		goto badframe;
-	if (regs->msr & MSR_FP)
-		giveup_fpu(current);
-
-	/*
-	 * Copy the register contents for the pt_regs structure on the
-	 *   kernel stack to the elf_gregset_t32 structure on the user
-	 *   stack. This is a copy of 64 bit register values to 32 bit
-	 *   register values. The high order 32 bits of the 64 bit
-	 *   registers are not needed since a 32 bit application is
-	 *   running and the saved registers are the contents of the
-	 *   user registers at the time of a system call.
-	 * 
-	 * The values saved on the user stack will be restored into
-	 *  the registers during the signal return processing
-	 */
-	for (i = 0; i < 32; i++) {
-		if (__put_user((u32)regs->gpr[i], &frame->gp_regs[i]))
-			goto badframe;
-	}
-
-	/*
-	 * Copy the non gpr registers to the user stack
-	 */
-	if (__put_user((u32)regs->gpr[PT_NIP], &frame->gp_regs[PT_NIP])
-	    || __put_user((u32)regs->gpr[PT_MSR], &frame->gp_regs[PT_MSR])
-	    || __put_user((u32)regs->gpr[PT_ORIG_R3], &frame->gp_regs[PT_ORIG_R3])
-	    || __put_user((u32)regs->gpr[PT_CTR], &frame->gp_regs[PT_CTR])
-	    || __put_user((u32)regs->gpr[PT_LNK], &frame->gp_regs[PT_LNK])
-	    || __put_user((u32)regs->gpr[PT_XER], &frame->gp_regs[PT_XER])
-	    || __put_user((u32)regs->gpr[PT_CCR], &frame->gp_regs[PT_CCR])
-#if 0
-	    || __put_user((u32)regs->gpr[PT_MQ], &frame->gp_regs[PT_MQ])
-#endif
-	    || __put_user((u32)regs->gpr[PT_RESULT], &frame->gp_regs[PT_RESULT]))
-		goto badframe;
-
-
-	/*
-	 * Now copy the floating point registers onto the user stack 
-	 *
-	 * Also set up so on the completion of the signal handler, the
-	 * sys_sigreturn will get control to reset the stack
-	 */
-	if (__copy_to_user(&frame->fp_regs, current->thread.fpr,
-			   ELF_NFPREG * sizeof(double))
-	    /* li r0, __NR_sigreturn */
-	    || __put_user(0x38000000U + __NR_sigreturn, &frame->tramp[0])
-	    /* sc */
-	    || __put_user(0x44000002U, &frame->tramp[1]))
-		goto badframe;
-	flush_icache_range((unsigned long)&frame->tramp[0],
-			   (unsigned long)&frame->tramp[2]);
-	current->thread.fpscr = 0;	/* turn off all fp exceptions */
-
-	newsp -= __SIGNAL_FRAMESIZE32;
-	if (put_user(regs->gpr[1], (u32*)(u64)newsp)
-	    || get_user(regs->nip, &sc->handler)
-	    || get_user(regs->gpr[3], &sc->signal))
-		goto badframe;
-
-	regs->gpr[1] = newsp & 0xFFFFFFFF;
-	/*
-	 * first parameter to the signal handler is the signal number
-	 *  - the value is in gpr3
-	 * second parameter to the signal handler is the sigcontext
-	 *   - set the value into gpr4
-	 */
-	regs->gpr[4] = (unsigned long) sc;
-	regs->link = (unsigned long) frame->tramp;
-	return;
-
-badframe:
-#if DEBUG_SIG
-	printk("badframe in setup_frame32, regs=%p frame=%p newsp=%lx\n",
-	       regs, frame, newsp);
-#endif
-	do_exit(SIGSEGV);
-}
-
 
 /*
  *  Start of RT signal support
@@ -405,115 +339,6 @@
  *        siginfo32to64
  */
 
-/*
- * This code executes after the rt signal handler in 32 bit mode has
- * completed and returned  
- */
-long sys32_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
-			unsigned long r6, unsigned long r7, unsigned long r8,
-			struct pt_regs * regs)
-{
-	struct rt_sigframe_32 *rt_sf;
-	struct sigcontext32 sigctx;
-	struct sigregs32 *sr;
-	int ret;
-	elf_gregset_t32 saved_regs;   /* an array of 32 bit register values */
-	sigset_t set; 
-	stack_t st;
-	int i;
-	mm_segment_t old_fs;
-
-	/* Always make any pending restarted system calls return -EINTR */
-	current_thread_info()->restart_block.fn = do_no_restart_syscall;
-
-	/* Adjust the inputted reg1 to point to the first rt signal frame */
-	rt_sf = (struct rt_sigframe_32 *)(regs->gpr[1] + __SIGNAL_FRAMESIZE32);
-	/* Copy the information from the user stack  */
-	if (copy_from_user(&sigctx, &rt_sf->uc.uc_mcontext, sizeof(sigctx))
-	    || copy_from_user(&set, &rt_sf->uc.uc_sigmask, sizeof(set))
-	    || copy_from_user(&st,&rt_sf->uc.uc_stack, sizeof(st)))
-		goto badframe;
-
-	/*
-	 * Unblock the signal that was processed 
-	 *   After a signal handler runs - 
-	 *     if the signal is blockable - the signal will be unblocked  
-	 *       (sigkill and sigstop are not blockable)
-	 */
-	sigdelsetmask(&set, ~_BLOCKABLE); 
-	/* update the current based on the sigmask found in the rt_stackframe */
-	spin_lock_irq(&current->sighand->siglock);
-	current->blocked = set;
-	recalc_sigpending();
-	spin_unlock_irq(&current->sighand->siglock);
-
-	/* If currently owning the floating point - give them up */
-	if (regs->msr & MSR_FP)
-		giveup_fpu(current);
-	/*
-	 * Set to point to the next rt_sigframe - this is used to
-	 * determine whether this is the last signal to process
-	 */
-	sr = (struct sigregs32 *)(u64)sigctx.regs;
-	if (copy_from_user(saved_regs, &sr->gp_regs, sizeof(sr->gp_regs))) 
-		goto badframe;
-	/*
-	 * The saved reg structure in the frame is an elf_grepset_t32,
-	 * it is a 32 bit register save of the registers in the
-	 * pt_regs structure that was stored on the kernel stack
-	 * during the system call when the system call was interrupted
-	 * for the signal. Only 32 bits are saved because the
-	 * sigcontext contains a pointer to the regs and the sig
-	 * context address is passed as a pointer to the signal handler
-	 *
-	 * The entries in the elf_grepset have the same index as
-	 * the elements in the pt_regs structure.
-	 */
-	saved_regs[PT_MSR] = (regs->msr & ~MSR_USERCHANGE)
-		| (saved_regs[PT_MSR] & MSR_USERCHANGE);
-	/*
-	 * Register 2 is the kernel toc - should be reset on any
-	 * calls into the kernel
-	 */
-	for (i = 0; i < 32; i++)
-		regs->gpr[i] = (u64)(saved_regs[i]) & 0xFFFFFFFF;
-	/*
-	 * restore the non gpr registers
-	 */
-	regs->msr = (u64)(saved_regs[PT_MSR]) & 0xFFFFFFFF;
-	regs->nip = (u64)(saved_regs[PT_NIP]) & 0xFFFFFFFF;
-	regs->orig_gpr3 = (u64)(saved_regs[PT_ORIG_R3]) & 0xFFFFFFFF; 
-	regs->ctr = (u64)(saved_regs[PT_CTR]) & 0xFFFFFFFF; 
-	regs->link = (u64)(saved_regs[PT_LNK]) & 0xFFFFFFFF; 
-	regs->xer = (u64)(saved_regs[PT_XER]) & 0xFFFFFFFF; 
-	regs->ccr = (u64)(saved_regs[PT_CCR]) & 0xFFFFFFFF;
-	/* regs->softe is left unchanged (like MSR.EE) */
-	/*
-	 * the DAR and the DSISR are only relevant during a
-	 *   data or instruction storage interrupt. The value
-	 *   will be set to zero.
-	 */
-	regs->dar = 0; 
-	regs->dsisr = 0;
-	regs->result = (u64)(saved_regs[PT_RESULT]) & 0xFFFFFFFF;
-	if (copy_from_user(current->thread.fpr, &sr->fp_regs,
-			   sizeof(sr->fp_regs)))
-		goto badframe;
-	/* This function sets back the stack flags into
-	   the current task structure.  */
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	do_sigaltstack(&st, NULL, regs->gpr[1]);
-	set_fs(old_fs);
-
-	ret = regs->result;
-	return ret;
-
- badframe:
-	do_exit(SIGSEGV);     
-}
-
-
 
 long sys32_rt_sigaction(int sig, const struct sigaction32 *act,
 		struct sigaction32 *oact, size_t sigsetsize)
@@ -530,16 +355,7 @@
 		ret = get_user((long)new_ka.sa.sa_handler, &act->sa_handler);
 		ret |= __copy_from_user(&set32, &act->sa_mask,
 					sizeof(compat_sigset_t));
-		switch (_NSIG_WORDS) {
-		case 4: new_ka.sa.sa_mask.sig[3] = set32.sig[6]
-				| (((long)set32.sig[7]) << 32);
-		case 3: new_ka.sa.sa_mask.sig[2] = set32.sig[4]
-				| (((long)set32.sig[5]) << 32);
-		case 2: new_ka.sa.sa_mask.sig[1] = set32.sig[2]
-				| (((long)set32.sig[3]) << 32);
-		case 1: new_ka.sa.sa_mask.sig[0] = set32.sig[0]
-				| (((long)set32.sig[1]) << 32);
-		}
+		sigset_from_compat(&new_ka.sa.sa_mask, &set32);
 		ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags);
 		if (ret)
 			return -EFAULT;
@@ -547,20 +363,7 @@
 
 	ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
 	if (!ret && oact) {
-		switch (_NSIG_WORDS) {
-		case 4:
-			set32.sig[7] = (old_ka.sa.sa_mask.sig[3] >> 32);
-			set32.sig[6] = old_ka.sa.sa_mask.sig[3];
-		case 3:
-			set32.sig[5] = (old_ka.sa.sa_mask.sig[2] >> 32);
-			set32.sig[4] = old_ka.sa.sa_mask.sig[2];
-		case 2:
-			set32.sig[3] = (old_ka.sa.sa_mask.sig[1] >> 32);
-			set32.sig[2] = old_ka.sa.sa_mask.sig[1];
-		case 1:
-			set32.sig[1] = (old_ka.sa.sa_mask.sig[0] >> 32);
-			set32.sig[0] = old_ka.sa.sa_mask.sig[0];
-		}
+		compat_from_sigset(&set32, &old_ka.sa.sa_mask);
 		ret = put_user((long)old_ka.sa.sa_handler, &oact->sa_handler);
 		ret |= __copy_to_user(&oact->sa_mask, &set32,
 				      sizeof(compat_sigset_t));
@@ -586,14 +389,8 @@
 
 	if (set) {
 		if (copy_from_user (&s32, set, sizeof(compat_sigset_t)))
-			return -EFAULT;
-    
-		switch (_NSIG_WORDS) {
-		case 4: s.sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32);
-		case 3: s.sig[2] = s32.sig[4] | (((long)s32.sig[5]) << 32);
-		case 2: s.sig[1] = s32.sig[2] | (((long)s32.sig[3]) << 32);
-		case 1: s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);
-		}
+			return -EFAULT;    
+		sigset_from_compat(&s, &s32);
 	}
 	
 	set_fs(KERNEL_DS);
@@ -603,12 +400,7 @@
 	if (ret)
 		return ret;
 	if (oset) {
-		switch (_NSIG_WORDS) {
-		case 4: s32.sig[7] = (s.sig[3] >> 32); s32.sig[6] = s.sig[3];
-		case 3: s32.sig[5] = (s.sig[2] >> 32); s32.sig[4] = s.sig[2];
-		case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1];
-		case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0];
-		}
+		compat_from_sigset(&s32, &s);
 		if (copy_to_user (oset, &s32, sizeof(compat_sigset_t)))
 			return -EFAULT;
 	}
@@ -626,12 +418,7 @@
 	ret = sys_rt_sigpending(&s, sigsetsize);
 	set_fs(old_fs);
 	if (!ret) {
-		switch (_NSIG_WORDS) {
-		case 4: s32.sig[7] = (s.sig[3] >> 32); s32.sig[6] = s.sig[3];
-		case 3: s32.sig[5] = (s.sig[2] >> 32); s32.sig[4] = s.sig[2];
-		case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1];
-		case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0];
-		}
+		compat_from_sigset(&s32, &s);
 		if (copy_to_user (set, &s32, sizeof(compat_sigset_t)))
 			return -EFAULT;
 	}
@@ -639,7 +426,7 @@
 }
 
 
-static int copy_siginfo_to_user32(siginfo_t32 *d, siginfo_t *s)
+static int copy_siginfo_to_user32(compat_siginfo_t *d, siginfo_t *s)
 {
 	int err;
 
@@ -681,7 +468,7 @@
 	return err;
 }
 
-long sys32_rt_sigtimedwait(compat_sigset_t *uthese, siginfo_t32 *uinfo,
+long sys32_rt_sigtimedwait(compat_sigset_t *uthese, compat_siginfo_t *uinfo,
 		struct compat_timespec *uts, compat_size_t sigsetsize)
 {
 	sigset_t s;
@@ -693,12 +480,7 @@
 
 	if (copy_from_user(&s32, uthese, sizeof(compat_sigset_t)))
 		return -EFAULT;
-	switch (_NSIG_WORDS) {
-	case 4: s.sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32);
-	case 3: s.sig[2] = s32.sig[4] | (((long)s32.sig[5]) << 32);
-	case 2: s.sig[1] = s32.sig[2] | (((long)s32.sig[3]) << 32);
-	case 1: s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);
-	}
+	sigset_from_compat(&s, &s32);
 	if (uts && get_compat_timespec(&t, uts))
 		return -EFAULT;
 	set_fs(KERNEL_DS);
@@ -714,7 +496,7 @@
 
 
 
-static siginfo_t * siginfo32to64(siginfo_t *d, siginfo_t32 *s)
+static siginfo_t * siginfo32to64(siginfo_t *d, compat_siginfo_t *s)
 {
 	d->si_signo = s->si_signo;
 	d->si_errno = s->si_errno;
@@ -758,14 +540,14 @@
  * (msr in 32-bit mode) and the register representation of a signed int
  * (msr in 64-bit mode) is performed.
  */
-long sys32_rt_sigqueueinfo(u32 pid, u32 sig, siginfo_t32 *uinfo)
+long sys32_rt_sigqueueinfo(u32 pid, u32 sig, compat_siginfo_t *uinfo)
 {
 	siginfo_t info;
-	siginfo_t32 info32;
+	compat_siginfo_t info32;
 	int ret;
 	mm_segment_t old_fs = get_fs();
 	
-	if (copy_from_user (&info32, uinfo, sizeof(siginfo_t32)))
+	if (copy_from_user (&info32, uinfo, sizeof(compat_siginfo_t)))
 		return -EFAULT;
     	/* XXX: Is this correct? */
 	siginfo32to64(&info, &info32);
@@ -793,15 +575,9 @@
 	 * Swap the 2 words of the 64-bit sigset_t (they are stored
 	 * in the "wrong" endian in 32-bit user storage).
 	 */
-	switch (_NSIG_WORDS) {
-	case 4: newset.sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32);
-	case 3: newset.sig[2] = s32.sig[4] | (((long)s32.sig[5]) << 32);
-	case 2: newset.sig[1] = s32.sig[2] | (((long)s32.sig[3]) << 32);
-	case 1: newset.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);
-	}
+	sigset_from_compat(&newset, &s32);
 
 	sigdelsetmask(&newset, ~_BLOCKABLE);
-
 	spin_lock_irq(&current->sighand->siglock);
 	saveset = current->blocked;
 	current->blocked = newset;
@@ -827,237 +603,324 @@
 	}
 }
 
-
 /*
- * Set up a rt signal frame.
+ *  Start Alternate signal stack support
+ *
+ *  System Calls
+ *       sigaltatck               sys32_sigaltstack
  */
-static void setup_rt_frame32(struct pt_regs *regs, struct sigregs32 *frame,
-            unsigned int newsp)
+
+int sys32_sigaltstack(u32 newstack, u32 oldstack, int r5,
+		      int r6, int r7, int r8, struct pt_regs *regs)
 {
-	unsigned int copyreg4, copyreg5;
-	struct rt_sigframe_32 * rt_sf = (struct rt_sigframe_32 *) (u64)newsp;
-	int i;
-  
-	if (verify_area(VERIFY_WRITE, frame, sizeof(*frame)))
-		goto badframe;
-	if (regs->msr & MSR_FP)
-		giveup_fpu(current);
+	stack_t uss, uoss;
+	int ret;
+	mm_segment_t old_fs;
+	unsigned long sp;
 
 	/*
-	 * Copy the register contents for the pt_regs structure on the
-	 *   kernel stack to the elf_gregset_t32 structure on the user
-	 *   stack. This is a copy of 64 bit register values to 32 bit
-	 *   register values. The high order 32 bits of the 64 bit
-	 *   registers are not needed since a 32 bit application is
-	 *   running and the saved registers are the contents of the
-	 *   user registers at the time of a system call.
-	 *
-	 * The values saved on the user stack will be restored into
-	 *  the registers during the signal return processing
+	 * set sp to the user stack on entry to the system call
+	 * the system call router sets R9 to the saved registers
 	 */
-	for (i = 0; i < 32; i++) {
-		if (__put_user((u32)regs->gpr[i], &frame->gp_regs[i]))
-			goto badframe;
-	}
+	sp = regs->gpr[1];
 
-	/*
-	 * Copy the non gpr registers to the user stack
-	 */
-	if (__put_user((u32)regs->gpr[PT_NIP], &frame->gp_regs[PT_NIP])
-	    || __put_user((u32)regs->gpr[PT_MSR], &frame->gp_regs[PT_MSR])
-	    || __put_user((u32)regs->gpr[PT_ORIG_R3], &frame->gp_regs[PT_ORIG_R3])
-	    || __put_user((u32)regs->gpr[PT_CTR], &frame->gp_regs[PT_CTR])
-	    || __put_user((u32)regs->gpr[PT_LNK], &frame->gp_regs[PT_LNK])
-	    || __put_user((u32)regs->gpr[PT_XER], &frame->gp_regs[PT_XER])
-	    || __put_user((u32)regs->gpr[PT_CCR], &frame->gp_regs[PT_CCR])
-	    || __put_user((u32)regs->gpr[PT_RESULT], &frame->gp_regs[PT_RESULT]))
-		goto badframe;
+	/* Put new stack info in local 64 bit stack struct */
+	if (newstack &&
+		(get_user((long)uss.ss_sp,
+			  &((stack_32_t *)(long)newstack)->ss_sp) ||
+		 __get_user(uss.ss_flags,
+			 &((stack_32_t *)(long)newstack)->ss_flags) ||
+		 __get_user(uss.ss_size,
+			 &((stack_32_t *)(long)newstack)->ss_size)))
+		return -EFAULT; 
 
+	old_fs = get_fs();
+	set_fs(KERNEL_DS);
+	ret = do_sigaltstack(newstack ? &uss : NULL, oldstack ? &uoss : NULL,
+			sp);
+	set_fs(old_fs);
+	/* Copy the stack information to the user output buffer */
+	if (!ret && oldstack  &&
+		(put_user((long)uoss.ss_sp,
+			  &((stack_32_t *)(long)oldstack)->ss_sp) ||
+		 __put_user(uoss.ss_flags,
+			 &((stack_32_t *)(long)oldstack)->ss_flags) ||
+		 __put_user(uoss.ss_size,
+			 &((stack_32_t *)(long)oldstack)->ss_size)))
+		return -EFAULT;
+	return ret;
+}
 
-	/*
-	 * Now copy the floating point registers onto the user stack
-	 *
-	 * Also set up so on the completion of the signal handler, the
-	 * sys_sigreturn will get control to reset the stack
-	 */
-	if (__copy_to_user(&frame->fp_regs, current->thread.fpr,
-			   ELF_NFPREG * sizeof(double))
-	    || __put_user(0x38000000U + __NR_rt_sigreturn, &frame->tramp[0])    /* li r0, __NR_rt_sigreturn */
-	    || __put_user(0x44000002U, &frame->tramp[1]))   /* sc */
+
+/*
+ * Set up a signal frame for a "real-time" signal handler
+ * (one which gets siginfo).
+ */
+static void handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,
+			       siginfo_t *info, sigset_t *oldset,
+			       struct pt_regs * regs, unsigned long newsp)
+{
+	struct rt_sigframe32 __user *rt_sf;
+	struct mcontext32 __user *frame;
+	unsigned long origsp = newsp;
+	compat_sigset_t c_oldset;
+
+	/* Set up Signal Frame */
+	/* Put a Real Time Context onto stack */
+	newsp -= sizeof(*rt_sf);
+	rt_sf = (struct rt_sigframe32 __user *)newsp;
+
+	/* create a stack frame for the caller of the handler */
+	newsp -= __SIGNAL_FRAMESIZE32 + 16;
+
+	if (verify_area(VERIFY_WRITE, (void __user *)newsp, origsp - newsp))
 		goto badframe;
 
-	flush_icache_range((unsigned long) &frame->tramp[0],
-			   (unsigned long) &frame->tramp[2]);
-	current->thread.fpscr = 0;	/* turn off all fp exceptions */
+	compat_from_sigset(&c_oldset, oldset);
 
-	/*
-	 * Retrieve rt_sigframe from stack and
-	 * set up registers for signal handler
-	 */
-	newsp -= __SIGNAL_FRAMESIZE32;
-      
+	/* Put the siginfo & fill in most of the ucontext */
+	if (copy_siginfo_to_user32(&rt_sf->info, info)
+	    || __put_user(0, &rt_sf->uc.uc_flags)
+	    || __put_user(0, &rt_sf->uc.uc_link)
+	    || __put_user(current->sas_ss_sp, &rt_sf->uc.uc_stack.ss_sp)
+	    || __put_user(sas_ss_flags(regs->gpr[1]),
+			  &rt_sf->uc.uc_stack.ss_flags)
+	    || __put_user(current->sas_ss_size, &rt_sf->uc.uc_stack.ss_size)
+	    || __put_user((u32)(u64)&rt_sf->uc.uc_mcontext, &rt_sf->uc.uc_regs)
+	    || __copy_to_user(&rt_sf->uc.uc_sigmask, &c_oldset, sizeof(c_oldset)))
+		goto badframe;
 
-	if (put_user((u32)(regs->gpr[1]), (unsigned int *)(u64)newsp)
-	    || get_user(regs->nip, &rt_sf->uc.uc_mcontext.handler)
-	    || get_user(regs->gpr[3], &rt_sf->uc.uc_mcontext.signal)
-	    || get_user(copyreg4, &rt_sf->pinfo)
-	    || get_user(copyreg5, &rt_sf->puc))
+	/* Save user registers on the stack */
+	frame = &rt_sf->uc.uc_mcontext;
+	if (save_user_regs(regs, frame, __NR_rt_sigreturn))
 		goto badframe;
 
-	regs->gpr[4] = copyreg4;
-	regs->gpr[5] = copyreg5;
-	regs->gpr[1] = newsp;
+	if (put_user(regs->gpr[1], (unsigned long __user *)newsp))
+		goto badframe;
+	regs->gpr[1] = (unsigned long) newsp;
+	regs->gpr[3] = sig;
+	regs->gpr[4] = (unsigned long) &rt_sf->info;
+	regs->gpr[5] = (unsigned long) &rt_sf->uc;
 	regs->gpr[6] = (unsigned long) rt_sf;
+	regs->nip = (unsigned long) ka->sa.sa_handler;
 	regs->link = (unsigned long) frame->tramp;
+	regs->trap = 0;
 
 	return;
 
 badframe:
 #if DEBUG_SIG
-	printk("badframe in setup_frame32, regs=%p frame=%p newsp=%lx\n",
+	printk("badframe in handle_rt_signal, regs=%p frame=%p newsp=%lx\n",
 	       regs, frame, newsp);
 #endif
-	do_exit(SIGSEGV);
+	if (sig == SIGSEGV)
+		ka->sa.sa_handler = SIG_DFL;
+	force_sig(SIGSEGV, current);
 }
 
+static long do_setcontext32(struct ucontext32 __user *ucp, struct pt_regs *regs, int sig)
+{
+	compat_sigset_t c_set;
+	sigset_t set;
+	u32 mcp;
+
+	if (__copy_from_user(&c_set, &ucp->uc_sigmask, sizeof(c_set))
+	    || __get_user(mcp, &ucp->uc_regs))
+		return -EFAULT;
+	sigset_from_compat(&set, &c_set);
+	restore_sigmask(&set);
+	if (restore_user_regs(regs, (struct mcontext32 *)(u64)mcp, sig))
+		return -EFAULT;
+
+	return 0;
+}
 
 /*
- * OK, we're invoking a handler
+ * Handle {get,set,swap}_context operations for 32 bits processes
  */
-static void handle_signal32(unsigned long sig, siginfo_t *info,
-		sigset_t *oldset, struct pt_regs * regs, unsigned int *newspp,
-		unsigned int frame)
-{
-	struct sigcontext32 *sc;
-	struct rt_sigframe_32 *rt_sf;
-	struct k_sigaction *ka = &current->sighand->action[sig-1];
-
-	if (regs->trap == 0x0C00 /* System Call! */
-	    && ((int)regs->result == -ERESTARTNOHAND ||
-		(int)regs->result == -ERESTART_RESTARTBLOCK ||
-		((int)regs->result == -ERESTARTSYS &&
-		 !(ka->sa.sa_flags & SA_RESTART)))) {
-		if ((int)regs->result == -ERESTART_RESTARTBLOCK)
-			current_thread_info()->restart_block.fn
-				= do_no_restart_syscall;
-		regs->result = -EINTR;
+
+long sys32_swapcontext(struct ucontext32 __user *old_ctx,
+		       struct ucontext32 __user *new_ctx,
+		       int ctx_size, int r6, int r7, int r8, struct pt_regs *regs)
+{
+	unsigned char tmp;
+	compat_sigset_t c_set;
+
+	/* Context size is for future use. Right now, we only make sure
+	 * we are passed something we understand
+	 */
+	if (ctx_size < sizeof(struct ucontext32))
+		return -EINVAL;
+
+	if (old_ctx != NULL) {
+		compat_from_sigset(&c_set, &current->blocked);
+		if (verify_area(VERIFY_WRITE, old_ctx, sizeof(*old_ctx))
+		    || save_user_regs(regs, &old_ctx->uc_mcontext, 0)
+		    || __copy_to_user(&old_ctx->uc_sigmask, &c_set, sizeof(c_set))
+		    || __put_user((u32)(u64)&old_ctx->uc_mcontext, &old_ctx->uc_regs))
+			return -EFAULT;
 	}
+	if (new_ctx == NULL)
+		return 0;
+	if (verify_area(VERIFY_READ, new_ctx, sizeof(*new_ctx))
+	    || __get_user(tmp, (u8 *) new_ctx)
+	    || __get_user(tmp, (u8 *) (new_ctx + 1) - 1))
+		return -EFAULT;
 
 	/*
-	 * Set up the signal frame
-	 * Determine if a real time frame and a siginfo is required
+	 * If we get a fault copying the context into the kernel's
+	 * image of the user's registers, we can't just return -EFAULT
+	 * because the user's registers will be corrupted.  For instance
+	 * the NIP value may have been updated but not some of the
+	 * other registers.  Given that we have done the verify_area
+	 * and successfully read the first and last bytes of the region
+	 * above, this should only happen in an out-of-memory situation
+	 * or if another thread unmaps the region containing the context.
+	 * We kill the task with a SIGSEGV in this situation.
 	 */
-	if (ka->sa.sa_flags & SA_SIGINFO) {
-		*newspp -= sizeof(*rt_sf);
-		rt_sf = (struct rt_sigframe_32 *)(u64)(*newspp);
-		if (verify_area(VERIFY_WRITE, rt_sf, sizeof(*rt_sf)))
-			goto badframe;
-		if (__put_user((u32)(u64)ka->sa.sa_handler,
-					&rt_sf->uc.uc_mcontext.handler)
-		    || __put_user((u32)(u64)&rt_sf->info, &rt_sf->pinfo)
-		    || __put_user((u32)(u64)&rt_sf->uc, &rt_sf->puc)
-		    /*  put the siginfo on the user stack                    */
-		    || copy_siginfo_to_user32(&rt_sf->info, info)
-		    /*  set the ucontext on the user stack                   */ 
-		    || __put_user(0, &rt_sf->uc.uc_flags)
-		    || __put_user(0, &rt_sf->uc.uc_link)
-		    || __put_user(current->sas_ss_sp, &rt_sf->uc.uc_stack.ss_sp)
-		    || __put_user(sas_ss_flags(regs->gpr[1]),
-			    &rt_sf->uc.uc_stack.ss_flags)
-		    || __put_user(current->sas_ss_size,
-			    &rt_sf->uc.uc_stack.ss_size)
-		    || __copy_to_user(&rt_sf->uc.uc_sigmask,
-			    oldset, sizeof(*oldset))
-		    /* point the mcontext.regs to the pramble register frame  */
-		    || __put_user(frame, &rt_sf->uc.uc_mcontext.regs)
-		    || __put_user(sig,&rt_sf->uc.uc_mcontext.signal))
-			goto badframe; 
-	} else {
-		/* Put a sigcontext on the stack */
-		*newspp -= sizeof(*sc);
-		sc = (struct sigcontext32 *)(u64)*newspp;
-		if (verify_area(VERIFY_WRITE, sc, sizeof(*sc)))
-			goto badframe;
-		/*
-		 * Note the upper 32 bits of the signal mask are stored
-		 * in the unused part of the signal stack frame
-		 */
-		if (__put_user((u32)(u64)ka->sa.sa_handler, &sc->handler)
-		    || __put_user(oldset->sig[0], &sc->oldmask)
-		    || __put_user((oldset->sig[0] >> 32), &sc->_unused[3])
-		    || __put_user((unsigned int)frame, &sc->regs)
-		    || __put_user(sig, &sc->signal))
-			goto badframe;
-	}
+	if (do_setcontext32(new_ctx, regs, 0))
+		do_exit(SIGSEGV);
 
-	if (ka->sa.sa_flags & SA_ONESHOT)
-		ka->sa.sa_handler = SIG_DFL;
+	return 0;
+}
+
+long sys32_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
+		     struct pt_regs *regs)
+{
+	struct rt_sigframe32 __user *rt_sf;
+	int ret;
+
+
+	/* Always make any pending restarted system calls return -EINTR */
+	current_thread_info()->restart_block.fn = do_no_restart_syscall;
+
+	rt_sf = (struct rt_sigframe32 __user *)
+		(regs->gpr[1] + __SIGNAL_FRAMESIZE32 + 16);
+	if (verify_area(VERIFY_READ, rt_sf, sizeof(*rt_sf)))
+		goto bad;
+	if (do_setcontext32(&rt_sf->uc, regs, 1))
+		goto bad;
+
+	/*
+	 * It's not clear whether or why it is desirable to save the
+	 * sigaltstack setting on signal delivery and restore it on
+	 * signal return.  But other architectures do this and we have
+	 * always done it up until now so it is probably better not to
+	 * change it.  -- paulus
+	 * We use the sys32_ version that does the 32/64 bits conversion
+	 * and takes userland pointer directly. What about error checking ?
+	 * nobody does any...
+	 */
+       	sys32_sigaltstack((u32)(u64)&rt_sf->uc.uc_stack, 0, 0, 0, 0, 0, regs);
+
+	regs->result &= 0xFFFFFFFF;
+	ret = regs->result;
+
+	return ret;
+
+ bad:
+	force_sig(SIGSEGV, current);
+	return 0;
+}
+
+
+/*
+ * OK, we're invoking a handler
+ */
+static void handle_signal32(unsigned long sig, struct k_sigaction *ka,
+			    siginfo_t *info, sigset_t *oldset,
+			    struct pt_regs * regs, unsigned long newsp)
+{
+	struct sigcontext32 __user *sc;
+	struct sigregs32 __user *frame;
+	unsigned long origsp = newsp;
+
+	/* Set up Signal Frame */
+	newsp -= sizeof(struct sigregs32);
+	frame = (struct sigregs32 __user *) newsp;
+
+	/* Put a sigcontext on the stack */
+	newsp -= sizeof(*sc);
+	sc = (struct sigcontext32 __user *) newsp;
+
+	/* create a stack frame for the caller of the handler */
+	newsp -= __SIGNAL_FRAMESIZE32;
+
+	if (verify_area(VERIFY_WRITE, (void *) newsp, origsp - newsp))
+		goto badframe;
+
+#if _NSIG != 64
+#error "Please adjust handle_signal32()"
+#endif
+	if (__put_user((u32)(u64)ka->sa.sa_handler, &sc->handler)
+	    || __put_user(oldset->sig[0], &sc->oldmask)
+	    || __put_user((oldset->sig[0] >> 32), &sc->_unused[3])
+	    || __put_user((u32)(u64)frame, &sc->regs)
+	    || __put_user(sig, &sc->signal))
+		goto badframe;
+
+	if (save_user_regs(regs, &frame->mctx, __NR_sigreturn))
+		goto badframe;
+
+	if (put_user(regs->gpr[1], (unsigned long __user *)newsp))
+		goto badframe;
+	regs->gpr[1] = (unsigned long) newsp;
+	regs->gpr[3] = sig;
+	regs->gpr[4] = (unsigned long) sc;
+	regs->nip = (unsigned long) ka->sa.sa_handler;
+	regs->link = (unsigned long) frame->mctx.tramp;
+	regs->trap = 0;
 
-	if (!(ka->sa.sa_flags & SA_NODEFER)) {
-		spin_lock_irq(&current->sighand->siglock);
-		sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
-		sigaddset(&current->blocked,sig);
-		recalc_sigpending();
-		spin_unlock_irq(&current->sighand->siglock);
-	}
 	return;
 
 badframe:
 #if DEBUG_SIG
-	printk("badframe in handle_signal32, regs=%p frame=%lx newsp=%lx\n",
+	printk("badframe in handle_signal, regs=%p frame=%x newsp=%x\n",
 	       regs, frame, *newspp);
-	printk("sc=%p sig=%d ka=%p info=%p oldset=%p\n", sc, sig, ka, info, oldset);
 #endif
-	do_exit(SIGSEGV);
+	if (sig == SIGSEGV)
+		ka->sa.sa_handler = SIG_DFL;
+	force_sig(SIGSEGV, current);
 }
 
-
 /*
- *  Start Alternate signal stack support
- *
- *  System Calls
- *       sigaltatck               sys32_sigaltstack
+ * Do a signal return; undo the signal stack.
  */
-
-int sys32_sigaltstack(u32 newstack, u32 oldstack, int p3,
-		      int p4, int p6, int p7, struct pt_regs *regs)
+long sys32_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
+		       struct pt_regs *regs)
 {
-	stack_t uss, uoss;
+	struct sigcontext32 __user *sc;
+	struct sigcontext32 sigctx;
+	struct mcontext32 __user *sr;
+	sigset_t set;
 	int ret;
-	mm_segment_t old_fs;
-	unsigned long sp;
+
+	/* Always make any pending restarted system calls return -EINTR */
+	current_thread_info()->restart_block.fn = do_no_restart_syscall;
+
+	sc = (struct sigcontext32 __user *)(regs->gpr[1] + __SIGNAL_FRAMESIZE32);
+	if (copy_from_user(&sigctx, sc, sizeof(sigctx)))
+		goto badframe;
 
 	/*
-	 * set sp to the user stack on entry to the system call
-	 * the system call router sets R9 to the saved registers
+	 * Note that PPC32 puts the upper 32 bits of the sigmask in the
+	 * unused part of the signal stackframe
 	 */
-	sp = regs->gpr[1];
+	set.sig[0] = sigctx.oldmask + ((long)(sigctx._unused[3]) << 32);
+	restore_sigmask(&set);
 
-	/* Put new stack info in local 64 bit stack struct */
-	if (newstack &&
-		(get_user((long)uss.ss_sp,
-			  &((stack_32_t *)(long)newstack)->ss_sp) ||
-		 __get_user(uss.ss_flags,
-			 &((stack_32_t *)(long)newstack)->ss_flags) ||
-		 __get_user(uss.ss_size,
-			 &((stack_32_t *)(long)newstack)->ss_size)))
-		return -EFAULT; 
+	sr = (struct mcontext32 *)(u64)sigctx.regs;
+	if (verify_area(VERIFY_READ, sr, sizeof(*sr))
+	    || restore_user_regs(regs, sr, 1))
+		goto badframe;
 
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = do_sigaltstack(newstack ? &uss : NULL, oldstack ? &uoss : NULL,
-			sp);
-	set_fs(old_fs);
-	/* Copy the stack information to the user output buffer */
-	if (!ret && oldstack  &&
-		(put_user((long)uoss.ss_sp,
-			  &((stack_32_t *)(long)oldstack)->ss_sp) ||
-		 __put_user(uoss.ss_flags,
-			 &((stack_32_t *)(long)oldstack)->ss_flags) ||
-		 __put_user(uoss.ss_size,
-			 &((stack_32_t *)(long)oldstack)->ss_size)))
-		return -EFAULT;
+	regs->result &= 0xFFFFFFFF;
+	ret = regs->result;
 	return ret;
+
+badframe:
+	force_sig(SIGSEGV, current);
+	return 0;
 }
 
 
@@ -1082,7 +945,7 @@
 	siginfo_t info;
 	struct k_sigaction *ka;
 	unsigned int frame, newsp;
-	int signr;
+	int signr, ret;
 
 	if (!oldset)
 		oldset = &current->blocked;
@@ -1090,40 +953,60 @@
 	newsp = frame = 0;
 
 	signr = get_signal_to_deliver(&info, regs, NULL);
-	if (signr > 0) {
-		ka = &current->sighand->action[signr-1];
-		if ((ka->sa.sa_flags & SA_ONSTACK)
-		     && (!on_sig_stack(regs->gpr[1])))
-			newsp = (current->sas_ss_sp + current->sas_ss_size);
-		else
-			newsp = regs->gpr[1];
-		newsp = frame = newsp - sizeof(struct sigregs32);
 
-		/* Whee!  Actually deliver the signal.  */
-		handle_signal32(signr, &info, oldset, regs, &newsp, frame);
-	}
+	ka = (signr == 0)? NULL: &current->sighand->action[signr-1];
 
-	if (regs->trap == 0x0C00) {	/* System Call! */
-		if ((int)regs->result == -ERESTARTNOHAND ||
-		    (int)regs->result == -ERESTARTSYS ||
-		    (int)regs->result == -ERESTARTNOINTR) {
-			regs->gpr[3] = regs->orig_gpr3;
-			regs->nip -= 4; /* Back up & retry system call */
-			regs->result = 0;
-		} else if ((int)regs->result == -ERESTART_RESTARTBLOCK) {
-			regs->gpr[0] = __NR_restart_syscall;
-			regs->nip -= 4;
+	if (regs->trap == 0x0C00		/* System Call! */
+	    && regs->ccr & 0x10000000		/* error signalled */
+	    && ((ret = regs->gpr[3]) == ERESTARTSYS
+		|| ret == ERESTARTNOHAND || ret == ERESTARTNOINTR
+		|| ret == ERESTART_RESTARTBLOCK)) {
+
+		if (signr > 0
+		    && (ret == ERESTARTNOHAND || ret == ERESTART_RESTARTBLOCK
+			|| (ret == ERESTARTSYS
+			    && !(ka->sa.sa_flags & SA_RESTART)))) {
+			/* make the system call return an EINTR error */
+			regs->result = -EINTR;
+			regs->gpr[3] = EINTR;
+			/* note that the cr0.SO bit is already set */
+		} else {
+			regs->nip -= 4;	/* Back up & retry system call */
 			regs->result = 0;
+			regs->trap = 0;
+			if (ret == ERESTART_RESTARTBLOCK)
+				regs->gpr[0] = __NR_restart_syscall;
+			else
+				regs->gpr[3] = regs->orig_gpr3;
 		}
 	}
 
-	if (newsp == frame)
+	if (signr == 0)
 		return 0;		/* no signals delivered */
 
-	/* Invoke correct stack setup routine */
+	if ((ka->sa.sa_flags & SA_ONSTACK) && current->sas_ss_size
+	    && (!on_sig_stack(regs->gpr[1])))
+		newsp = (current->sas_ss_sp + current->sas_ss_size);
+	else
+		newsp = regs->gpr[1];
+	newsp &= ~0xfUL;
+
+	/* Whee!  Actually deliver the signal.  */
 	if (ka->sa.sa_flags & SA_SIGINFO)
-		setup_rt_frame32(regs, (struct sigregs32*)(u64)frame, newsp);
+		handle_rt_signal32(signr, ka, &info, oldset, regs, newsp);
 	else
-		setup_frame32(regs, (struct sigregs32*)(u64)frame, newsp);
+		handle_signal32(signr, ka, &info, oldset, regs, newsp);
+
+	if (ka->sa.sa_flags & SA_ONESHOT)
+		ka->sa.sa_handler = SIG_DFL;
+
+	if (!(ka->sa.sa_flags & SA_NODEFER)) {
+		spin_lock_irq(&current->sighand->siglock);
+		sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
+		sigaddset(&current->blocked, signr);
+		recalc_sigpending();
+		spin_unlock_irq(&current->sighand->siglock);
+	}
+
 	return 1;
 }
diff -Nru a/arch/ppc64/kernel/smp.c b/arch/ppc64/kernel/smp.c
--- a/arch/ppc64/kernel/smp.c	Tue Feb  3 19:45:35 2004
+++ b/arch/ppc64/kernel/smp.c	Tue Feb  3 19:45:35 2004
@@ -53,10 +53,14 @@
 int smp_threads_ready;
 unsigned long cache_decay_ticks;
 
-/* initialised so it doesn't end up in bss */
+/* Initialised so it doesn't end up in bss */
+cpumask_t cpu_possible_map    = CPU_MASK_NONE;
 cpumask_t cpu_online_map = CPU_MASK_NONE;
+cpumask_t cpu_available_map   = CPU_MASK_NONE;
+cpumask_t cpu_present_at_boot = CPU_MASK_NONE;
 
 EXPORT_SYMBOL(cpu_online_map);
+EXPORT_SYMBOL(cpu_possible_map);
 
 static struct smp_ops_t *smp_ops;
 
@@ -67,6 +71,8 @@
 extern int cpu_idle(void *unused);
 void smp_call_function_interrupt(void);
 void smp_message_pass(int target, int msg, unsigned long data, int wait);
+extern long register_vpa(unsigned long flags, unsigned long proc,
+			 unsigned long vpa);
 
 #define smp_message_pass(t,m,d,w) smp_ops->message_pass((t),(m),(d),(w))
 
@@ -120,6 +126,9 @@
         for (i=0; i < NR_CPUS; ++i) {
                 lpPaca = paca[i].xLpPacaPtr;
                 if ( lpPaca->xDynProcStatus < 2 ) {
+			cpu_set(i, cpu_available_map);
+			cpu_set(i, cpu_possible_map);
+			cpu_set(i, cpu_present_at_boot);
                         ++np;
                 }
         }
@@ -135,7 +144,7 @@
 	for (i=0; i < NR_CPUS; ++i) {
 		lpPaca = paca[i].xLpPacaPtr;
 		if (lpPaca->xDynProcStatus < 2) {
-			paca[i].active = 1;
+			/*paca[i].active = 1;*/
 			++np;
 		}
 	}
@@ -181,7 +190,6 @@
 	smp_ops->probe        = smp_iSeries_probe;
 	smp_ops->kick_cpu     = smp_iSeries_kick_cpu;
 	smp_ops->setup_cpu    = smp_iSeries_setup_cpu;
-#warning fix for iseries
 	systemcfg->processorCount	= smp_iSeries_numProcs();
 }
 #endif
@@ -227,6 +235,11 @@
 	return nr_cpus;
 }
 
+static void __devinit smp_openpic_setup_cpu(int cpu)
+{
+	do_openpic_setup_cpu();
+}
+
 static void
 smp_kick_cpu(int nr)
 {
@@ -266,14 +279,15 @@
 }
 
 #ifdef CONFIG_PPC_PSERIES
-static void __devinit pSeries_setup_cpu(int cpu)
+void vpa_init(int cpu)
 {
-	if (OpenPIC_Addr) {
-		do_openpic_setup_cpu();
-	} else {
-		if (cpu != boot_cpuid)
-			xics_setup_cpu();
-	}
+	unsigned long flags;
+
+	/* Register the Virtual Processor Area (VPA) */
+	printk(KERN_INFO "register_vpa: cpu 0x%x\n", cpu);
+	flags = 1UL << (63 - 18);
+	paca[cpu].xLpPaca.xSLBCount = 64; /* SLB restore highwater mark */
+	register_vpa(flags, cpu, __pa((unsigned long)&(paca[cpu].xLpPaca))); 
 }
 
 static void
@@ -295,6 +309,8 @@
 	}
 }
 
+extern void xics_request_IPIs(void);
+
 static int __init smp_xics_probe(void)
 {
 	int i;
@@ -305,13 +321,18 @@
 			nr_cpus++;
 	}
 #ifdef CONFIG_SMP
-	extern void xics_request_IPIs(void);
 	xics_request_IPIs();
 #endif
 
 	return nr_cpus;
 }
 
+static void __devinit smp_xics_setup_cpu(int cpu)
+{
+	if (cpu != boot_cpuid)
+		xics_setup_cpu();
+}
+
 static spinlock_t timebase_lock = SPIN_LOCK_UNLOCKED;
 static unsigned long timebase = 0;
 
@@ -345,9 +366,11 @@
 	if (naca->interrupt_controller == IC_OPEN_PIC) {
 		smp_ops->message_pass	= smp_openpic_message_pass;
 		smp_ops->probe		= smp_openpic_probe;
+		smp_ops->setup_cpu	= smp_openpic_setup_cpu;
 	} else {
 		smp_ops->message_pass	= smp_xics_message_pass;
 		smp_ops->probe		= smp_xics_probe;
+		smp_ops->setup_cpu	= smp_xics_setup_cpu;
 	}
 
 	if (systemcfg->platform == PLATFORM_PSERIES) {
@@ -356,7 +379,6 @@
 	}
 
 	smp_ops->kick_cpu = smp_kick_cpu;
-	smp_ops->setup_cpu = pSeries_setup_cpu;
 }
 #endif
 
@@ -480,13 +502,13 @@
 	while (atomic_read(&data.started) != cpus) {
 		HMT_low();
 		if (--timeout == 0) {
+			printk("smp_call_function on cpu %d: other cpus not "
+			       "responding (%d)\n", smp_processor_id(),
+			       atomic_read(&data.started));
 #ifdef CONFIG_DEBUG_KERNEL
 			if (debugger)
 				debugger(0);
 #endif
-			printk("smp_call_function on cpu %d: other cpus not "
-			       "responding (%d)\n", smp_processor_id(),
-			       atomic_read(&data.started));
 			goto out;
 		}
 	}
@@ -496,15 +518,15 @@
 		while (atomic_read(&data.finished) != cpus) {
 			HMT_low();
 			if (--timeout == 0) {
-#ifdef CONFIG_DEBUG_KERNEL
-				if (debugger)
-					debugger(0);
-#endif
 				printk("smp_call_function on cpu %d: other "
 				       "cpus not finishing (%d/%d)\n",
 				       smp_processor_id(),
 				       atomic_read(&data.finished),
 				       atomic_read(&data.started));
+#ifdef CONFIG_DEBUG_KERNEL
+				if (debugger)
+					debugger(0);
+#endif
 				goto out;
 			}
 		}
@@ -513,6 +535,7 @@
 	ret = 0;
 
 out:
+	call_data = NULL;
 	HMT_medium();
 	spin_unlock(&call_lock);
 	return ret;
@@ -520,9 +543,19 @@
 
 void smp_call_function_interrupt(void)
 {
-	void (*func) (void *info) = call_data->func;
-	void *info = call_data->info;
-	int wait = call_data->wait;
+	void (*func) (void *info);
+	void *info;
+	int wait;
+
+	/* call_data will be NULL if the sender timed out while
+	 * waiting on us to receive the call.
+	 */
+	if (!call_data)
+		return;
+
+	func = call_data->func;
+	info = call_data->info;
+	wait = call_data->wait;
 
 	/*
 	 * Notify initiating CPU that I've grabbed the data and am
@@ -549,11 +582,17 @@
 
 void __init smp_prepare_cpus(unsigned int max_cpus)
 {
+	/* 
+	 * setup_cpu may need to be called on the boot cpu. We havent
+	 * spun any cpus up but lets be paranoid.
+	 */
+	BUG_ON(boot_cpuid != smp_processor_id());
+
 	/* Fixup boot cpu */
-	smp_store_cpu_info(smp_processor_id());
-	cpu_callin_map[smp_processor_id()] = 1;
-	paca[smp_processor_id()].prof_counter = 1;
-	paca[smp_processor_id()].prof_multiplier = 1;
+	smp_store_cpu_info(boot_cpuid);
+	cpu_callin_map[boot_cpuid] = 1;
+	paca[boot_cpuid].prof_counter = 1;
+	paca[boot_cpuid].prof_multiplier = 1;
 
 	/*
 	 * XXX very rough. 
@@ -658,6 +697,14 @@
 	if (smp_ops->take_timebase)
 		smp_ops->take_timebase();
 
+	get_paca()->yielded = 0;
+
+#ifdef CONFIG_PPC_PSERIES
+	if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
+		vpa_init(cpu); 
+	}
+#endif
+
 	local_irq_enable();
 
 	return cpu_idle(NULL);
@@ -670,8 +717,19 @@
 
 void __init smp_cpus_done(unsigned int max_cpus)
 {
+	cpumask_t old_mask;
+
+	/* We want the setup_cpu() here to be called from CPU 0, but our
+	 * init thread may have been "borrowed" by another CPU in the meantime
+	 * se we pin us down to CPU 0 for a short while
+	 */
+	old_mask = current->cpus_allowed;
+	set_cpus_allowed(current, cpumask_of_cpu(boot_cpuid));
+	
 	smp_ops->setup_cpu(boot_cpuid);
 
 	/* XXX fix this, xics currently relies on it - Anton */
 	smp_threads_ready = 1;
+
+	set_cpus_allowed(current, old_mask);
 }
diff -Nru a/arch/ppc64/kernel/stab.c b/arch/ppc64/kernel/stab.c
--- a/arch/ppc64/kernel/stab.c	Tue Feb  3 19:45:35 2004
+++ b/arch/ppc64/kernel/stab.c	Tue Feb  3 19:45:35 2004
@@ -12,8 +12,6 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-/* XXX Note: Changes for bolted region have not been merged - Anton */
-
 #include <linux/config.h>
 #include <asm/pgtable.h>
 #include <asm/mmu.h>
@@ -59,6 +57,15 @@
 	}
 }
 
+/* Both the segment table and SLB code uses the following cache */
+#define NR_STAB_CACHE_ENTRIES 8
+DEFINE_PER_CPU(long, stab_cache_ptr);
+DEFINE_PER_CPU(long, stab_cache[NR_STAB_CACHE_ENTRIES]);
+
+/*
+ * Segment table stuff
+ */
+
 /*
  * Create a segment table entry for the given esid/vsid pair.
  */
@@ -91,14 +98,8 @@
 
 	/*
 	 * Could not find empty entry, pick one with a round robin selection.
-	 * Search all entries in the two groups.  Note that the first time
-	 * we get here, we start with entry 1 so the initializer
-	 * can be common with the SLB castout code.
+	 * Search all entries in the two groups.
 	 */
-
-	/* This assumes we never castout when initializing the stab. */
-	PMC_SW_PROCESSOR(stab_capacity_castouts); 
-
 	castout_entry = get_paca()->xStab_data.next_round_robin;
 	for (i = 0; i < 16; i++) {
 		if (castout_entry < 8) {
@@ -123,23 +124,169 @@
 	/* Modify the old entry to the new value. */
 
 	/* Force previous translations to complete. DRENG */
-	asm volatile("isync" : : : "memory" );
+	asm volatile("isync" : : : "memory");
 
 	castout_ste->dw0.dw0.v = 0;
-	asm volatile("sync" : : : "memory" );    /* Order update */
+	asm volatile("sync" : : : "memory");    /* Order update */
 	castout_ste->dw1.dw1.vsid = vsid;
 	old_esid = castout_ste->dw0.dw0.esid;
 	castout_ste->dw0.dw0.esid = esid;
 	castout_ste->dw0.dw0.kp = 1;
-	asm volatile("eieio" : : : "memory" );   /* Order update */
+	asm volatile("eieio" : : : "memory");   /* Order update */
 	castout_ste->dw0.dw0.v  = 1;
 	asm volatile("slbie  %0" : : "r" (old_esid << SID_SHIFT)); 
 	/* Ensure completion of slbie */
-	asm volatile("sync" : : : "memory" );
+	asm volatile("sync" : : : "memory");
 
 	return (global_entry | (castout_entry & 0x7));
 }
 
+static inline void __ste_allocate(unsigned long esid, unsigned long vsid,
+				  mm_context_t context)
+{
+	unsigned char stab_entry;
+	unsigned long *offset;
+	int region_id = REGION_ID(esid << SID_SHIFT);
+
+	stab_entry = make_ste(get_paca()->xStab_data.virt, esid, vsid);
+
+	if (region_id != USER_REGION_ID)
+		return;
+
+	offset = &__get_cpu_var(stab_cache_ptr);
+	if (*offset < NR_STAB_CACHE_ENTRIES) {
+		__get_cpu_var(stab_cache[*offset]) = stab_entry;
+	}
+	(*offset)++;
+}
+
+/*
+ * Allocate a segment table entry for the given ea.
+ */
+int ste_allocate(unsigned long ea)
+{
+	unsigned long vsid, esid;
+	mm_context_t context;
+
+	/* Check for invalid effective addresses. */
+	if (!IS_VALID_EA(ea))
+		return 1;
+
+	/* Kernel or user address? */
+	if (REGION_ID(ea) >= KERNEL_REGION_ID) {
+		vsid = get_kernel_vsid(ea);
+		context = REGION_ID(ea);
+	} else {
+		if (!current->mm)
+			return 1;
+
+		context = current->mm->context;
+		vsid = get_vsid(context, ea);
+	}
+
+	esid = GET_ESID(ea);
+	__ste_allocate(esid, vsid, context);
+	/* Order update */
+	asm volatile("sync":::"memory");
+
+	return 0;
+}
+
+/*
+ * preload some userspace segments into the segment table.
+ */
+static void preload_stab(struct task_struct *tsk, struct mm_struct *mm)
+{
+	unsigned long pc = KSTK_EIP(tsk);
+	unsigned long stack = KSTK_ESP(tsk);
+	unsigned long unmapped_base;
+	unsigned long pc_esid = GET_ESID(pc);
+	unsigned long stack_esid = GET_ESID(stack);
+	unsigned long unmapped_base_esid;
+	unsigned long vsid;
+
+	if (test_tsk_thread_flag(tsk, TIF_32BIT))
+		unmapped_base = TASK_UNMAPPED_BASE_USER32;
+	else
+		unmapped_base = TASK_UNMAPPED_BASE_USER64;
+
+	unmapped_base_esid = GET_ESID(unmapped_base);
+
+	if (!IS_VALID_EA(pc) || (REGION_ID(pc) >= KERNEL_REGION_ID))
+		return;
+	vsid = get_vsid(mm->context, pc);
+	__ste_allocate(pc_esid, vsid, mm->context);
+
+	if (pc_esid == stack_esid)
+		return;
+
+	if (!IS_VALID_EA(stack) || (REGION_ID(stack) >= KERNEL_REGION_ID))
+		return;
+	vsid = get_vsid(mm->context, stack);
+	__ste_allocate(stack_esid, vsid, mm->context);
+
+	if (pc_esid == unmapped_base_esid || stack_esid == unmapped_base_esid)
+		return;
+
+	if (!IS_VALID_EA(unmapped_base) ||
+	    (REGION_ID(unmapped_base) >= KERNEL_REGION_ID))
+		return;
+	vsid = get_vsid(mm->context, unmapped_base);
+	__ste_allocate(unmapped_base_esid, vsid, mm->context);
+
+	/* Order update */
+	asm volatile("sync" : : : "memory");
+}
+
+/* Flush all user entries from the segment table of the current processor. */
+void flush_stab(struct task_struct *tsk, struct mm_struct *mm)
+{
+	STE *stab = (STE *) get_paca()->xStab_data.virt;
+	STE *ste;
+	unsigned long *offset = &__get_cpu_var(stab_cache_ptr);
+
+	/* Force previous translations to complete. DRENG */
+	asm volatile("isync" : : : "memory");
+
+	if (*offset <= NR_STAB_CACHE_ENTRIES) {
+		int i;
+
+		for (i = 0; i < *offset; i++) {
+			ste = stab + __get_cpu_var(stab_cache[i]);
+			ste->dw0.dw0.v = 0;
+		}
+
+		asm volatile("sync; slbia; sync":::"memory");
+	} else {
+		unsigned long entry;
+
+		/* Invalidate all entries. */
+		ste = stab;
+
+		/* Never flush the first entry. */
+		ste += 1;
+		for (entry = 1;
+		     entry < (PAGE_SIZE / sizeof(STE));
+		     entry++, ste++) {
+			unsigned long ea;
+			ea = ste->dw0.dw0.esid << SID_SHIFT;
+			if (ea < KERNELBASE) {
+				ste->dw0.dw0.v = 0;
+			}
+		}
+
+		asm volatile("sync; slbia; sync":::"memory");
+	}
+
+	*offset = 0;
+
+	preload_stab(tsk, mm);
+}
+
+/*
+ * SLB stuff
+ */
+
 /*
  * Create a segment buffer entry for the given esid/vsid pair.
  *
@@ -160,22 +307,11 @@
 	} vsid_data;
 
 	/*
-	 * Find an empty entry, if one exists. Must start at 0 because
-	 * we use this code to load SLB entry 0 at boot.
-	 */
-	for (entry = 0; entry < naca->slb_size; entry++) {
-		asm volatile("slbmfee  %0,%1" 
-			     : "=r" (esid_data) : "r" (entry)); 
-		if (!esid_data.data.v)
-			goto write_entry;
-	}
-
-	/*
-	 * Could not find empty entry, pick one with a round robin selection.
+	 * We take the next entry, round robin. Previously we tried
+	 * to find a free slot first but that took too long. Unfortunately
+	 * we dont have any LRU information to help us choose a slot.
 	 */
 
-	PMC_SW_PROCESSOR(stab_capacity_castouts); 
-
 	/* 
 	 * Never cast out the segment for our kernel stack. Since we
 	 * dont invalidate the ERAT we could have a valid translation
@@ -190,13 +326,13 @@
 		if (castout_entry >= naca->slb_size)
 			castout_entry = 1; 
 		asm volatile("slbmfee  %0,%1" : "=r" (esid_data) : "r" (entry));
-	} while (esid_data.data.esid == GET_ESID((unsigned long)_get_SP()));
+	} while (esid_data.data.v &&
+		 esid_data.data.esid == GET_ESID((unsigned long)_get_SP()));
 
 	get_paca()->xStab_data.next_round_robin = castout_entry;
 
 	/* slbie not needed as the previous mapping is still valid. */
 
-write_entry:	
 	/* 
 	 * Write the new SLB entry.
 	 */
@@ -220,211 +356,129 @@
 	asm volatile("slbmte  %0,%1" : : "r" (vsid_data), "r" (esid_data)); 
 }
 
-static inline void __ste_allocate(unsigned long esid, unsigned long vsid,
-				  int kernel_segment, mm_context_t context)
+static inline void __slb_allocate(unsigned long esid, unsigned long vsid,
+				  mm_context_t context)
 {
-	if (cur_cpu_spec->cpu_features & CPU_FTR_SLB) {
-		int large = 0;
+	int large = 0;
+	int region_id = REGION_ID(esid << SID_SHIFT);
+	unsigned long *offset;
 
-#ifndef CONFIG_PPC_ISERIES
-		if (REGION_ID(esid << SID_SHIFT) == KERNEL_REGION_ID)
+	if (cur_cpu_spec->cpu_features & CPU_FTR_16M_PAGE) {
+		if (region_id == KERNEL_REGION_ID)
 			large = 1;
-		else if (REGION_ID(esid << SID_SHIFT) == USER_REGION_ID)
+		else if (region_id == USER_REGION_ID)
 			large = in_hugepage_area(context, esid << SID_SHIFT);
-#endif
-		make_slbe(esid, vsid, large, kernel_segment);
-	} else {
-		unsigned char top_entry, stab_entry, *segments; 
+	}
 
-		stab_entry = make_ste(get_paca()->xStab_data.virt, esid, vsid);
-		PMC_SW_PROCESSOR_A(stab_entry_use, stab_entry & 0xf); 
+	make_slbe(esid, vsid, large, region_id != USER_REGION_ID);
 
-		segments = get_paca()->xSegments;		
-		top_entry = get_paca()->stab_cache_pointer;
-		if (!kernel_segment && top_entry < STAB_CACHE_SIZE) {
-			segments[top_entry] = stab_entry;
-			if (top_entry == STAB_CACHE_SIZE)
-				top_entry = 0xff;
-			top_entry++;
-			get_paca()->stab_cache_pointer = top_entry;
-		}
+	if (region_id != USER_REGION_ID)
+		return;
+
+	offset = &__get_cpu_var(stab_cache_ptr);
+	if (*offset < NR_STAB_CACHE_ENTRIES) {
+		__get_cpu_var(stab_cache[*offset]) = esid;
 	}
+	(*offset)++;
 }
 
 /*
  * Allocate a segment table entry for the given ea.
  */
-int ste_allocate(unsigned long ea)
+int slb_allocate(unsigned long ea)
 {
 	unsigned long vsid, esid;
-	int kernel_segment = 0;
 	mm_context_t context;
 
-	PMC_SW_PROCESSOR(stab_faults); 
-
 	/* Check for invalid effective addresses. */
-	if (!IS_VALID_EA(ea))
+	if (unlikely(!IS_VALID_EA(ea)))
 		return 1;
 
 	/* Kernel or user address? */
 	if (REGION_ID(ea) >= KERNEL_REGION_ID) {
-		kernel_segment = 1;
-		vsid = get_kernel_vsid(ea);
 		context = REGION_ID(ea);
+		vsid = get_kernel_vsid(ea);
 	} else {
-		if (! current->mm)
+		if (unlikely(!current->mm))
 			return 1;
 
 		context = current->mm->context;
-		
 		vsid = get_vsid(context, ea);
 	}
 
 	esid = GET_ESID(ea);
-	__ste_allocate(esid, vsid, kernel_segment, context);
-	if (!(cur_cpu_spec->cpu_features & CPU_FTR_SLB)) {
-		/* Order update */
-		asm volatile("sync":::"memory"); 
-	}
+	__slb_allocate(esid, vsid, context);
 
 	return 0;
 }
 
-unsigned long ppc64_preload_all_segments;
-unsigned long ppc64_stab_preload = 1;
-#define STAB_PRESSURE 0
-#define USE_SLBIE_ON_STAB 0
-
 /*
- * preload all 16 segments for a 32 bit process and the PC and SP segments
- * for a 64 bit process.
+ * preload some userspace segments into the SLB.
  */
-static void preload_stab(struct task_struct *tsk, struct mm_struct *mm)
+static void preload_slb(struct task_struct *tsk, struct mm_struct *mm)
 {
-	if (ppc64_preload_all_segments &&
-	    test_tsk_thread_flag(tsk, TIF_32BIT)) {
-		unsigned long esid, vsid;
-
-		for (esid = 0; esid < 16; esid++) {
-			unsigned long ea = esid << SID_SHIFT;
-			vsid = get_vsid(mm->context, ea);
-			__ste_allocate(esid, vsid, 0, mm->context);
-		}
-	} else {
-		unsigned long pc = KSTK_EIP(tsk);
-		unsigned long stack = KSTK_ESP(tsk);
-		unsigned long pc_segment = pc & ~SID_MASK;
-		unsigned long stack_segment = stack & ~SID_MASK;
-		unsigned long vsid;
-
-		if (pc) {
-			if (!IS_VALID_EA(pc) || 
-			    (REGION_ID(pc) >= KERNEL_REGION_ID))
-				return;
-			vsid = get_vsid(mm->context, pc);
-			__ste_allocate(GET_ESID(pc), vsid, 0, mm->context);
-		}
-
-		if (stack && (pc_segment != stack_segment)) {
-			if (!IS_VALID_EA(stack) || 
-			    (REGION_ID(stack) >= KERNEL_REGION_ID))
-				return;
-			vsid = get_vsid(mm->context, stack);
-			__ste_allocate(GET_ESID(stack), vsid, 0, mm->context);
-		}
-	}
-
-	if (!(cur_cpu_spec->cpu_features & CPU_FTR_SLB)) {
-		/* Order update */
-		asm volatile("sync" : : : "memory"); 
-	}
+	unsigned long pc = KSTK_EIP(tsk);
+	unsigned long stack = KSTK_ESP(tsk);
+	unsigned long unmapped_base;
+	unsigned long pc_esid = GET_ESID(pc);
+	unsigned long stack_esid = GET_ESID(stack);
+	unsigned long unmapped_base_esid;
+	unsigned long vsid;
+
+	if (test_tsk_thread_flag(tsk, TIF_32BIT))
+		unmapped_base = TASK_UNMAPPED_BASE_USER32;
+	else
+		unmapped_base = TASK_UNMAPPED_BASE_USER64;
+
+	unmapped_base_esid = GET_ESID(unmapped_base);
+
+	if (!IS_VALID_EA(pc) || (REGION_ID(pc) >= KERNEL_REGION_ID))
+		return;
+	vsid = get_vsid(mm->context, pc);
+	__slb_allocate(pc_esid, vsid, mm->context);
+
+	if (pc_esid == stack_esid)
+		return;
+
+	if (!IS_VALID_EA(stack) || (REGION_ID(stack) >= KERNEL_REGION_ID))
+		return;
+	vsid = get_vsid(mm->context, stack);
+	__slb_allocate(stack_esid, vsid, mm->context);
+
+	if (pc_esid == unmapped_base_esid || stack_esid == unmapped_base_esid)
+		return;
+
+	if (!IS_VALID_EA(unmapped_base) ||
+	    (REGION_ID(unmapped_base) >= KERNEL_REGION_ID))
+		return;
+	vsid = get_vsid(mm->context, unmapped_base);
+	__slb_allocate(unmapped_base_esid, vsid, mm->context);
 }
 
 /* Flush all user entries from the segment table of the current processor. */
-void flush_stab(struct task_struct *tsk, struct mm_struct *mm)
+void flush_slb(struct task_struct *tsk, struct mm_struct *mm)
 {
-	if (cur_cpu_spec->cpu_features & CPU_FTR_SLB) {
-		/*
-		 * XXX disable 32bit slb invalidate optimisation until we fix
-		 * the issue where a 32bit app execed out of a 64bit app can
-		 * cause segments above 4GB not to be flushed - Anton
-		 */
-		if (0 && !STAB_PRESSURE && test_thread_flag(TIF_32BIT)) {
-			union {
-				unsigned long word0;
-				slb_dword0 data;
-			} esid_data;
-			unsigned long esid;
-
-			asm volatile("isync" : : : "memory");
-			for (esid = 0; esid < 16; esid++) {
-				esid_data.word0 = 0;
-				esid_data.data.esid = esid;
-				asm volatile("slbie %0" : : "r" (esid_data));
-			}
-			asm volatile("isync" : : : "memory");
-		} else {
-			asm volatile("isync; slbia; isync":::"memory");
-		}
+	unsigned long *offset = &__get_cpu_var(stab_cache_ptr);
 
-		PMC_SW_PROCESSOR(stab_invalidations);
-	} else {
-		STE *stab = (STE *) get_paca()->xStab_data.virt;
-		STE *ste;
-		unsigned long flags;
+	if (*offset <= NR_STAB_CACHE_ENTRIES) {
+		int i;
+		union {
+			unsigned long word0;
+			slb_dword0 data;
+		} esid_data;
 
-		/* Force previous translations to complete. DRENG */
 		asm volatile("isync" : : : "memory");
-
-		local_irq_save(flags);
-		if (get_paca()->stab_cache_pointer != 0xff && !STAB_PRESSURE) {
-			int i;
-			unsigned char *segments = get_paca()->xSegments;
-
-			for (i = 0; i < get_paca()->stab_cache_pointer; i++) {
-				ste = stab + segments[i]; 
-				ste->dw0.dw0.v = 0;
-				PMC_SW_PROCESSOR(stab_invalidations); 
-			}
-
-#if USE_SLBIE_ON_STAB
-			asm volatile("sync":::"memory");
-			for (i = 0; i < get_paca()->stab_cache_pointer; i++) {
-				ste = stab + segments[i]; 
-				asm volatile("slbie  %0" : :
-					"r" (ste->dw0.dw0.esid << SID_SHIFT)); 
-			}
-			asm volatile("sync":::"memory");
-#else
-			asm volatile("sync; slbia; sync":::"memory");
-#endif
-
-		} else {
-			unsigned long entry;
-
-			/* Invalidate all entries. */
-			ste = stab;
-
-			/* Never flush the first entry. */ 
-			ste += 1;
-			for (entry = 1;
-			     entry < (PAGE_SIZE / sizeof(STE)); 
-			     entry++, ste++) {
-				unsigned long ea;
-				ea = ste->dw0.dw0.esid << SID_SHIFT;
-				if (STAB_PRESSURE || ea < KERNELBASE) {
-					ste->dw0.dw0.v = 0;
-					PMC_SW_PROCESSOR(stab_invalidations); 
-				}
-			}
-
-			asm volatile("sync; slbia; sync":::"memory");
+		for (i = 0; i < *offset; i++) {
+			esid_data.word0 = 0;
+			esid_data.data.esid = __get_cpu_var(stab_cache[i]);
+			asm volatile("slbie %0" : : "r" (esid_data));
 		}
-
-		get_paca()->stab_cache_pointer = 0;
-		local_irq_restore(flags);
+		asm volatile("isync" : : : "memory");
+	} else {
+		asm volatile("isync; slbia; isync" : : : "memory");
 	}
 
-	if (ppc64_stab_preload)
-		preload_stab(tsk, mm);
+	*offset = 0;
+
+	preload_slb(tsk, mm);
 }
diff -Nru a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c
--- a/arch/ppc64/kernel/sys_ppc32.c	Tue Feb  3 19:45:34 2004
+++ b/arch/ppc64/kernel/sys_ppc32.c	Tue Feb  3 19:45:34 2004
@@ -14,6 +14,7 @@
  *      2 of the License, or (at your option) any later version.
  */
 
+#include <linux/config.h>
 #include <asm/ptrace.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -746,30 +747,31 @@
 
 int cp_compat_stat(struct kstat *stat, struct compat_stat *statbuf)
 {
-	int err;
+	long err;
 
 	if (stat->size > MAX_NON_LFS || !new_valid_dev(stat->dev) ||
 	    !new_valid_dev(stat->rdev))
 		return -EOVERFLOW;
 
-	err  = put_user(new_encode_dev(stat->dev), &statbuf->st_dev);
-	err |= put_user(stat->ino, &statbuf->st_ino);
-	err |= put_user(stat->mode, &statbuf->st_mode);
-	err |= put_user(stat->nlink, &statbuf->st_nlink);
-	err |= put_user(stat->uid, &statbuf->st_uid);
-	err |= put_user(stat->gid, &statbuf->st_gid);
-	err |= put_user(new_encode_dev(stat->rdev), &statbuf->st_rdev);
-	err |= put_user(stat->size, &statbuf->st_size);
-	err |= put_user(stat->atime.tv_sec, &statbuf->st_atime);
-	err |= put_user(0, &statbuf->__unused1);
-	err |= put_user(stat->mtime.tv_sec, &statbuf->st_mtime);
-	err |= put_user(0, &statbuf->__unused2);
-	err |= put_user(stat->ctime.tv_sec, &statbuf->st_ctime);
-	err |= put_user(0, &statbuf->__unused3);
-	err |= put_user(stat->blksize, &statbuf->st_blksize);
-	err |= put_user(stat->blocks, &statbuf->st_blocks);
-	err |= put_user(0, &statbuf->__unused4[0]);
-	err |= put_user(0, &statbuf->__unused4[1]);
+	err  = verify_area(VERIFY_WRITE, statbuf, sizeof(*statbuf));
+	err |= __put_user(new_encode_dev(stat->dev), &statbuf->st_dev);
+	err |= __put_user(stat->ino, &statbuf->st_ino);
+	err |= __put_user(stat->mode, &statbuf->st_mode);
+	err |= __put_user(stat->nlink, &statbuf->st_nlink);
+	err |= __put_user(stat->uid, &statbuf->st_uid);
+	err |= __put_user(stat->gid, &statbuf->st_gid);
+	err |= __put_user(new_encode_dev(stat->rdev), &statbuf->st_rdev);
+	err |= __put_user(stat->size, &statbuf->st_size);
+	err |= __put_user(stat->atime.tv_sec, &statbuf->st_atime);
+	err |= __put_user(stat->atime.tv_nsec, &statbuf->st_atime_nsec);
+	err |= __put_user(stat->mtime.tv_sec, &statbuf->st_mtime);
+	err |= __put_user(stat->mtime.tv_nsec, &statbuf->st_mtime_nsec);
+	err |= __put_user(stat->ctime.tv_sec, &statbuf->st_ctime);
+	err |= __put_user(stat->ctime.tv_nsec, &statbuf->st_ctime_nsec);
+	err |= __put_user(stat->blksize, &statbuf->st_blksize);
+	err |= __put_user(stat->blocks, &statbuf->st_blocks);
+	err |= __put_user(0, &statbuf->__unused4[0]);
+	err |= __put_user(0, &statbuf->__unused4[1]);
 
 	return err;
 }
@@ -2010,6 +2012,8 @@
 	int retval;
 	int i;
 
+	sched_balance_exec();
+
 	file = open_exec(filename);
 
 	retval = PTR_ERR(file);
@@ -2083,7 +2087,8 @@
 		security_bprm_free(&bprm);
 
 out_mm:
-	mmdrop(bprm.mm);
+	if (bprm.mm)
+		mmdrop(bprm.mm);
 
 out_file:
 	if (bprm.file) {
@@ -2106,6 +2111,10 @@
 		goto out;
 	if (regs->msr & MSR_FP)
 		giveup_fpu(current);
+#ifdef CONFIG_ALTIVEC
+	if (regs->msr & MSR_VEC)
+		giveup_altivec(current);
+#endif /* CONFIG_ALTIVEC */
 
 	error = do_execve32(filename, (u32*) a1, (u32*) a2, regs);
 
@@ -2126,9 +2135,25 @@
 	regs->nip = nip;
 	regs->gpr[1] = sp;
 	regs->msr = MSR_USER32;
+#ifndef CONFIG_SMP
 	if (last_task_used_math == current)
 		last_task_used_math = 0;
+#endif /* CONFIG_SMP */
 	current->thread.fpscr = 0;
+	memset(current->thread.fpr, 0, sizeof(current->thread.fpr));
+#ifdef CONFIG_ALTIVEC
+#ifndef CONFIG_SMP
+	if (last_task_used_altivec == current)
+		last_task_used_altivec = 0;
+#endif /* CONFIG_SMP */
+	memset(current->thread.vr, 0, sizeof(current->thread.vr));
+	current->thread.vscr.u[0] = 0;
+	current->thread.vscr.u[1] = 0;
+	current->thread.vscr.u[2] = 0;
+	current->thread.vscr.u[3] = 0x00010000; /* Java mode disabled */
+	current->thread.vrsave = 0;
+	current->thread.used_vr = 0;
+#endif /* CONFIG_ALTIVEC */
 }
 
 extern asmlinkage int sys_prctl(int option, unsigned long arg2, unsigned long arg3,
@@ -2683,98 +2708,6 @@
 	return sys_mmap(addr, len, prot, flags, fd, pgoff << 12);
 }
 
-extern long sys_io_setup(unsigned nr_reqs, aio_context_t *ctx);
-
-long sys32_io_setup(unsigned nr_reqs, u32 *ctx32p)
-{
-	long ret;
-	aio_context_t ctx64;
-	mm_segment_t oldfs = get_fs();
-
-	if (get_user((u32)ctx64, ctx32p))
-		return -EFAULT;
-
-	set_fs(KERNEL_DS);
-	ret = sys_io_setup(nr_reqs, &ctx64);
-	set_fs(oldfs);
-
-	/* truncating is ok because it's a user address */
-	if (!ret)
-		ret = put_user((u32)ctx64, ctx32p);
-
-	return ret;
-}
-
-long sys_io_getevents(aio_context_t ctx_id, long min_nr, long nr,
-		      struct io_event *events, struct timespec *timeout);
-
-long sys32_io_getevents(aio_context_t ctx_id, u32 min_nr, u32 nr,
-			struct io_event *events, struct compat_timespec *t32)
-{
-	struct timespec t;
-	long ret;
-	mm_segment_t oldfs = get_fs();
-
-	if (t32) {
-		if (get_user(t.tv_sec, &t32->tv_sec) ||
-		    __get_user(t.tv_nsec, &t32->tv_nsec))
-			return -EFAULT;
-	}
-
-	if (verify_area(VERIFY_WRITE, events, nr * sizeof(*events)))
-		return -EFAULT;
-
-	set_fs(KERNEL_DS);
-	/* sign extend min_nr and nr */
-	ret = sys_io_getevents(ctx_id, (int)min_nr, (int)nr, events,
-			       t32 ? &t : NULL);
-	set_fs(oldfs);
-
-	return ret;
-}
-
-long sys32_io_submit(aio_context_t ctx_id, u32 number, u32 *iocbpp)
-{
-	struct kioctx *ctx;
-	long ret = 0;
-	int i;
-	int nr = (int)number;	/* sign extend */
-
-	if (unlikely(nr < 0))
-		return -EINVAL;
-
-	if (unlikely(!access_ok(VERIFY_READ, iocbpp, (nr*sizeof(u32)))))
-		return -EFAULT;
-
-	ctx = lookup_ioctx(ctx_id);
-	if (unlikely(!ctx)) {
-		pr_debug("EINVAL: io_submit: invalid context id\n");
-		return -EINVAL;
-	}
-
-	for (i=0; i<nr; i++) {
-		struct iocb tmp;
-		u32 *user_iocb;
-
-		if (unlikely(__get_user((u32)(long)user_iocb, iocbpp + i))) {
-			ret = -EFAULT;
-			break;
-		}
-
-		if (unlikely(copy_from_user(&tmp, user_iocb, sizeof(tmp)))) {
-			ret = -EFAULT;
-			break;
-		}
-
-		ret = io_submit_one(ctx, (struct iocb *)user_iocb, &tmp);
-		if (ret)
-			break;
-	}
-
-	put_ioctx(ctx);
-	return i ? i : ret;
-}
-
 int get_compat_timeval(struct timeval *tv, struct compat_timeval *ctv)
 {
 	return (verify_area(VERIFY_READ, ctv, sizeof(*ctv)) ||
@@ -2878,3 +2811,47 @@
 			     advice);
 }
 
+long ppc32_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low,
+			u32 len_high, u32 len_low)
+{
+	return sys_fadvise64(fd, (u64)offset_high << 32 | offset_low,
+			     (u64)len_high << 32 | len_low, advice);
+}
+
+extern long sys_timer_create(clockid_t, sigevent_t *, timer_t *);
+
+long ppc32_timer_create(clockid_t clock,
+			struct compat_sigevent __user *ev32,
+			timer_t __user *timer_id)
+{
+	sigevent_t event;
+	timer_t t;
+	long err;
+	mm_segment_t savefs;
+
+	if (ev32 == NULL)
+		return sys_timer_create(clock, NULL, timer_id);
+
+	memset(&event, 0, sizeof(event));
+	if (!access_ok(VERIFY_READ, ev32, sizeof(struct compat_sigevent))
+	    || __get_user(event.sigev_value.sival_int,
+			  &ev32->sigev_value.sival_int)
+	    || __get_user(event.sigev_signo, &ev32->sigev_signo)
+	    || __get_user(event.sigev_notify, &ev32->sigev_notify)
+	    || __get_user(event.sigev_notify_thread_id,
+			  &ev32->sigev_notify_thread_id))
+		return -EFAULT;
+
+	if (!access_ok(VERIFY_WRITE, timer_id, sizeof(timer_t)))
+		return -EFAULT;
+
+	savefs = get_fs();
+	set_fs(KERNEL_DS);
+	err = sys_timer_create(clock, &event, &t);
+	set_fs(savefs);
+
+	if (err == 0)
+		err = __put_user(t, timer_id);
+
+	return err;
+}
diff -Nru a/arch/ppc64/kernel/syscalls.c b/arch/ppc64/kernel/syscalls.c
--- a/arch/ppc64/kernel/syscalls.c	Tue Feb  3 19:45:34 2004
+++ b/arch/ppc64/kernel/syscalls.c	Tue Feb  3 19:45:34 2004
@@ -41,6 +41,7 @@
 #include <asm/ipc.h>
 #include <asm/semaphore.h>
 #include <asm/time.h>
+#include <asm/unistd.h>
 
 extern unsigned long wall_jiffies;
 
@@ -234,3 +235,6 @@
 
 	return secs;
 }
+
+/* Only exists on P-series. */
+cond_syscall(ppc_rtas);
diff -Nru a/arch/ppc64/kernel/time.c b/arch/ppc64/kernel/time.c
--- a/arch/ppc64/kernel/time.c	Tue Feb  3 19:45:42 2004
+++ b/arch/ppc64/kernel/time.c	Tue Feb  3 19:45:42 2004
@@ -91,6 +91,9 @@
 unsigned long processor_freq;
 spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED;
 
+unsigned long tb_to_ns_scale;
+unsigned long tb_to_ns_shift;
+
 struct gettimeofday_struct do_gtod;
 
 extern unsigned long wall_jiffies;
@@ -313,11 +316,13 @@
 /*
  * Scheduler clock - returns current time in nanosec units.
  *
- * This is wrong, but my CPUs run at 1GHz, so nyer nyer.
+ * Note: mulhdu(a, b) (multiply high double unsigned) returns
+ * the high 64 bits of a * b, i.e. (a * b) >> 64, where a and b
+ * are 64-bit unsigned numbers.
  */
 unsigned long long sched_clock(void)
 {
-	return get_tb();
+	return mulhdu(get_tb(), tb_to_ns_scale) << tb_to_ns_shift;
 }
 
 /*
@@ -473,8 +478,29 @@
 	/* This function is only called on the boot processor */
 	unsigned long flags;
 	struct rtc_time tm;
+	struct div_result res;
+	unsigned long scale, shift;
 
 	ppc_md.calibrate_decr();
+
+	/*
+	 * Compute scale factor for sched_clock.
+	 * The calibrate_decr() function has set tb_ticks_per_sec,
+	 * which is the timebase frequency.
+	 * We compute 1e9 * 2^64 / tb_ticks_per_sec and interpret
+	 * the 128-bit result as a 64.64 fixed-point number.
+	 * We then shift that number right until it is less than 1.0,
+	 * giving us the scale factor and shift count to use in
+	 * sched_clock().
+	 */
+	div128_by_32(1000000000, 0, tb_ticks_per_sec, &res);
+	scale = res.result_low;
+	for (shift = 0; res.result_high != 0; ++shift) {
+		scale = (scale >> 1) | (res.result_high << 63);
+		res.result_high >>= 1;
+	}
+	tb_to_ns_scale = scale;
+	tb_to_ns_shift = shift;
 
 #ifdef CONFIG_PPC_ISERIES
 	if (!piranha_simulator)
diff -Nru a/arch/ppc64/kernel/traps.c b/arch/ppc64/kernel/traps.c
--- a/arch/ppc64/kernel/traps.c	Tue Feb  3 19:45:27 2004
+++ b/arch/ppc64/kernel/traps.c	Tue Feb  3 19:45:27 2004
@@ -16,6 +16,7 @@
  * This file handles the architecture-dependent parts of hardware exceptions
  */
 
+#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -26,7 +27,6 @@
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/interrupt.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 
@@ -40,8 +40,10 @@
 extern int fix_alignment(struct pt_regs *);
 extern void bad_page_fault(struct pt_regs *, unsigned long, int);
 
+#ifdef CONFIG_PPC_PSERIES
 /* This is true if we are using the firmware NMI handler (typically LPAR) */
 extern int fwnmi_active;
+#endif
 
 #ifdef CONFIG_DEBUG_KERNEL
 void (*debugger)(struct pt_regs *regs);
@@ -96,6 +98,7 @@
 	force_sig_info(signr, info, current);
 }
 
+#ifdef CONFIG_PPC_PSERIES
 /* Get the error information for errors coming through the
  * FWNMI vectors.  The pt_regs' r3 will be updated to reflect
  * the actual r3 if possible, and a ptr to the error log entry
@@ -128,10 +131,12 @@
 	if (ret != 0)
 		printk("FWNMI: nmi-interlock failed: %ld\n", ret);
 }
+#endif
 
 void
 SystemResetException(struct pt_regs *regs)
 {
+#ifdef CONFIG_PPC_PSERIES
 	if (fwnmi_active) {
 		struct rtas_error_log *errhdr = FWNMI_get_errinfo(regs);
 		if (errhdr) {
@@ -139,6 +144,7 @@
 		}
 		FWNMI_release_errinfo();
 	}
+#endif
 
 #ifdef CONFIG_DEBUG_KERNEL
 	if (debugger)
@@ -154,6 +160,7 @@
 	/* What should we do here? We could issue a shutdown or hard reset. */
 }
 
+#ifdef CONFIG_PPC_PSERIES
 /* 
  * See if we can recover from a machine check exception.
  * This is only called on power4 (or above) and only via
@@ -190,6 +197,7 @@
 	}
 	return 0;
 }
+#endif
 
 /*
  * Handle a machine check.
@@ -207,6 +215,7 @@
 void
 MachineCheckException(struct pt_regs *regs)
 {
+#ifdef CONFIG_PPC_PSERIES
 	struct rtas_error_log err, *errp;
 
 	if (fwnmi_active) {
@@ -217,6 +226,7 @@
 		if (errp && recover_mce(regs, err))
 			return;
 	}
+#endif
 
 #ifdef CONFIG_DEBUG_KERNEL
 	if (debugger_fault_handler) {
@@ -349,7 +359,7 @@
 		printk(KERN_ERR "Badness in %s at %s:%d\n",
 		       bug->function, bug->file,
 		      (unsigned int)bug->line & ~BUG_WARNING_TRAP);
-		dump_stack();
+		show_stack(current, (void *)regs->gpr[1]);
 		return 1;
 	}
 	printk(KERN_CRIT "kernel BUG in %s at %s:%d!\n",
@@ -410,6 +420,14 @@
 }
 
 void
+KernelAltivecUnavailableException(struct pt_regs *regs)
+{
+	printk("Illegal VMX/Altivec used in kernel (task=0x%p, "
+		"pc=0x%016lx, trap=0x%lx)\n", current, regs->nip, regs->trap);
+	panic("Unrecoverable VMX/Altivec Unavailable Exception in Kernel");
+}
+
+void
 SingleStepException(struct pt_regs *regs)
 {
 	siginfo_t info;
@@ -477,6 +495,17 @@
 	info.si_addr = (void *)regs->nip;
 	_exception(SIGBUS, &info, regs);	
 }
+
+#ifdef CONFIG_ALTIVEC
+void
+AltivecAssistException(struct pt_regs *regs)
+{
+	if (regs->msr & MSR_VEC)
+		giveup_altivec(current);
+	/* XXX quick hack for now: set the non-Java bit in the VSCR */
+	current->thread.vscr.u[3] |= 0x10000;
+}
+#endif /* CONFIG_ALTIVEC */
 
 void __init trap_init(void)
 {
diff -Nru a/arch/ppc64/kernel/udbg.c b/arch/ppc64/kernel/udbg.c
--- a/arch/ppc64/kernel/udbg.c	Tue Feb  3 19:45:16 2004
+++ b/arch/ppc64/kernel/udbg.c	Tue Feb  3 19:45:16 2004
@@ -127,8 +127,10 @@
 {
 	int remain = n;
 	char c;
+
 	if (!ppc_md.udbg_putc)
-		for (;;);	/* stop here for cpuctl */
+		return 0;
+
 	if ( s && *s != '\0' ) {
 		while ( (( c = *s++ ) != '\0') && (remain-- > 0)) {
 			ppc_md.udbg_putc(c);
diff -Nru a/arch/ppc64/kernel/vio.c b/arch/ppc64/kernel/vio.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/ppc64/kernel/vio.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,536 @@
+/*
+ * IBM PowerPC Virtual I/O Infrastructure Support.
+ *
+ *    Copyright (c) 2003 IBM Corp.
+ *     Dave Engebretsen engebret@us.ibm.com
+ *     Santiago Leon santil@us.ibm.com
+ *
+ *      This program is free software; you can redistribute it and/or
+ *      modify it under the terms of the GNU General Public License
+ *      as published by the Free Software Foundation; either version
+ *      2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/init.h>
+#include <linux/console.h>
+#include <linux/pci.h>
+#include <linux/version.h>
+#include <linux/module.h>
+#include <asm/rtas.h>
+#include <asm/pci_dma.h>
+#include <asm/dma.h>
+#include <asm/ppcdebug.h>
+#include <asm/vio.h>
+#include <asm/hvcall.h>
+#include <linux/mm.h>
+#include "open_pic.h" 	/* temporary, until we merge large irq support */
+
+extern struct TceTable *build_tce_table(struct TceTable *tbl);
+
+extern dma_addr_t get_tces(struct TceTable *, unsigned order,
+			   void *page, unsigned numPages, int direction);
+extern void tce_free(struct TceTable *tbl, dma_addr_t dma_addr,
+		     unsigned order, unsigned num_pages);
+
+
+static struct vio_bus vio_bus;
+static LIST_HEAD(registered_vio_drivers);
+int vio_num_address_cells;
+EXPORT_SYMBOL(vio_num_address_cells);
+
+/* TODO:
+ *   really fit into driver model (see include/linux/device.h)
+ *   locking around list accesses
+ */
+
+/**
+ * vio_register_driver: - Register a new vio driver
+ * @drv:	The vio_driver structure to be registered.
+ *
+ * Adds the driver structure to the list of registered drivers
+ * Returns the number of vio devices which were claimed by the driver
+ * during registration.  The driver remains registered even if the
+ * return value is zero.
+ */
+int vio_register_driver(struct vio_driver *drv)
+{
+	int count = 0;
+	struct vio_dev *dev;
+
+	printk(KERN_DEBUG "%s: driver %s/%s registering\n", __FUNCTION__,
+		drv->id_table[0].type, drv->id_table[0].type);
+
+	/* find matching devices not already claimed by other drivers and pass
+	 * them to probe() */
+	list_for_each_entry(dev, &vio_bus.devices, devices_list) {
+		const struct vio_device_id* id;
+
+		if (dev->driver)
+			continue; /* this device is already owned */
+
+		id = vio_match_device(drv->id_table, dev);
+		if (drv && id) {
+			if (0 == drv->probe(dev, id)) {
+				printk(KERN_DEBUG "  took device %p\n", dev);
+				dev->driver = drv;
+				count++;
+			}
+		}
+	}
+
+	list_add_tail(&drv->node, &registered_vio_drivers);
+
+	return count;
+}
+EXPORT_SYMBOL(vio_register_driver);
+
+/**
+ * vio_unregister_driver - Remove registration of vio driver.
+ * @driver:	The vio_driver struct to be removed form registration
+ *
+ * Searches for devices that are assigned to the driver and calls
+ * driver->remove() for each one.  Removes the driver from the list
+ * of registered drivers.  Returns the number of devices that were
+ * assigned to that driver.
+ */
+int vio_unregister_driver(struct vio_driver *driver)
+{
+	struct vio_dev *dev;
+	int devices_found = 0;
+
+	list_for_each_entry(dev, &vio_bus.devices, devices_list) {
+		if (dev->driver == driver) {
+			driver->remove(dev);
+			dev->driver = NULL;
+			devices_found++;
+		}
+	}
+
+	list_del(&driver->node);
+
+	return devices_found;
+}
+EXPORT_SYMBOL(vio_unregister_driver);
+
+/**
+ * vio_match_device: - Tell if a VIO device has a matching VIO device id structure.
+ * @ids: 	array of VIO device id structures to search in
+ * @dev: 	the VIO device structure to match against
+ *
+ * Used by a driver to check whether a VIO device present in the
+ * system is in its list of supported devices. Returns the matching
+ * vio_device_id structure or NULL if there is no match.
+ */
+const struct vio_device_id *
+vio_match_device(const struct vio_device_id *ids, const struct vio_dev *dev)
+{
+	while (ids->type) {
+		if ((strncmp(dev->archdata->type, ids->type, strlen(ids->type)) == 0) &&
+			device_is_compatible((struct device_node*)dev->archdata, ids->compat))
+			return ids;
+		ids++;
+	}
+	return NULL;
+}
+
+/**
+ * vio_bus_init: - Initialize the virtual IO bus
+ */
+int __init
+vio_bus_init(void)
+{
+	struct device_node *node_vroot, *node_vdev;
+
+	INIT_LIST_HEAD(&vio_bus.devices);
+
+	/*
+	 * Create device node entries for each virtual device
+	 * identified in the device tree.
+	 * Functionally takes the place of pci_scan_bus
+	 */
+	node_vroot = find_devices("vdevice");
+	if ((node_vroot == NULL) || (node_vroot->child == NULL)) {
+		printk(KERN_INFO "VIO: missing or empty /vdevice node; no virtual IO"
+			" devices present.\n");
+		return 0;
+	}
+
+	vio_num_address_cells = prom_n_addr_cells(node_vroot->child);
+
+	for (node_vdev = node_vroot->child;
+			node_vdev != NULL;
+			node_vdev = node_vdev->sibling) {
+		printk(KERN_DEBUG "%s: processing %p\n", __FUNCTION__, node_vdev);
+
+		vio_register_device(node_vdev);
+	}
+
+	return 0;
+}
+
+__initcall(vio_bus_init);
+
+
+/**
+ * vio_probe_device - attach dev to appropriate driver
+ * @dev:	device to find a driver for
+ *
+ * Walks the list of registered VIO drivers looking for one to take this
+ * device.
+ *
+ * Returns a pointer to the matched driver or NULL if driver is not
+ * found.
+ */
+struct vio_driver * __devinit vio_probe_device(struct vio_dev* dev)
+{
+	struct vio_driver *driver;
+
+	list_for_each_entry(driver, &registered_vio_drivers, node) {
+		const struct vio_device_id* id;
+
+		id = vio_match_device(driver->id_table, dev);
+		if (id && (0 < driver->probe(dev, id))) {
+			printk(KERN_DEBUG "%s: driver %s/%s took device %p\n",
+				__FUNCTION__, id->type, id->compat, dev);
+			dev->driver = driver;
+			return driver;
+		}
+	}
+
+	printk(KERN_DEBUG "%s: device %p found no driver\n", __FUNCTION__, dev);
+	return NULL;
+}
+
+/**
+ * vio_register_device: - Register a new vio device.
+ * @archdata:	The OF node for this device.
+ *
+ * Creates and initializes a vio_dev structure from the data in
+ * node_vdev (archdata) and adds it to the list of virtual devices.
+ * Returns a pointer to the created vio_dev or NULL if node has
+ * NULL device_type or compatible fields.
+ */
+struct vio_dev * __devinit vio_register_device(struct device_node *node_vdev)
+{
+	struct vio_dev *dev;
+	unsigned int *unit_address;
+	unsigned int *irq_p;
+
+	/* guarantee all vio_devs have 'device_type' field*/
+	if ((NULL == node_vdev->type)) {
+		printk(KERN_WARNING
+			"%s: node %s missing 'device_type'\n", __FUNCTION__,
+			node_vdev->name ? node_vdev->name : "<unknown>");
+		return NULL;
+	}
+
+	unit_address = (unsigned int *)get_property(node_vdev, "reg", NULL);
+	if (!unit_address) {
+		printk(KERN_WARNING "%s: node %s missing 'reg'\n", __FUNCTION__,
+			node_vdev->name ? node_vdev->name : "<unknown>");
+		return NULL;
+	}
+
+	/* allocate a vio_dev for this node */
+	dev = kmalloc(sizeof(*dev), GFP_KERNEL);
+	if (!dev)
+		return NULL;
+	memset(dev, 0, sizeof(*dev));
+
+	dev->archdata = (void*)of_node_get(node_vdev);
+	dev->bus = &vio_bus;
+	dev->unit_address = *unit_address;
+	dev->tce_table = vio_build_tce_table(dev);
+
+	irq_p = (unsigned int *) get_property(node_vdev, "interrupts", 0);
+	if(irq_p) {
+		dev->irq = openpic_to_irq(virt_irq_create_mapping(*irq_p));
+	} else {
+		dev->irq = (unsigned int) -1;
+	}
+
+	list_add_tail(&dev->devices_list, &vio_bus.devices);
+
+	vio_probe_device(dev); /* finally, assign it to a driver */
+
+	return dev;
+}
+EXPORT_SYMBOL(vio_register_device);
+
+int __devinit vio_unregister_device(struct vio_dev *dev)
+{
+	list_del(&dev->devices_list);
+	of_node_put(dev->archdata);
+
+	return 0;
+}
+EXPORT_SYMBOL(vio_unregister_device);
+
+/**
+ * vio_get_attribute: - get attribute for virtual device
+ * @vdev:	The vio device to get property.
+ * @which:	The property/attribute to be extracted.
+ * @length:	Pointer to length of returned data size (unused if NULL).
+ *
+ * Calls prom.c's get_property() to return the value of the
+ * attribute specified by the preprocessor constant @which
+*/
+const void * vio_get_attribute(struct vio_dev *vdev, void* which, int* length)
+{
+	return get_property((struct device_node *)vdev->archdata, (char*)which, length);
+}
+EXPORT_SYMBOL(vio_get_attribute);
+
+/**
+ * vio_build_tce_table: - gets the dma information from OF and builds the TCE tree.
+ * @dev: the virtual device.
+ *
+ * Returns a pointer to the built tce tree, or NULL if it can't
+ * find property.
+*/
+struct TceTable * vio_build_tce_table(struct vio_dev *dev)
+{
+	unsigned int *dma_window;
+	struct TceTable *newTceTable;
+	unsigned long offset;
+	unsigned long size;
+	int dma_window_property_size;
+
+	dma_window = (unsigned int *) get_property((struct device_node *)dev->archdata, "ibm,my-dma-window", &dma_window_property_size);
+	if(!dma_window) {
+		return NULL;
+	}
+
+	newTceTable = (struct TceTable *) kmalloc(sizeof(struct TceTable), GFP_KERNEL);
+
+	/* RPA docs say that #address-cells is always 1 for virtual
+		devices, but some older boxes' OF returns 2.  This should
+		be removed by GA, unless there is legacy OFs that still
+		have 2 for #address-cells */
+	size = ((dma_window[1+vio_num_address_cells]
+		>> PAGE_SHIFT) << 3) >> PAGE_SHIFT;
+
+	/* This is just an ugly kludge. Remove as soon as the OF for all
+	machines actually follow the spec and encodes the offset field
+	as phys-encode (that is, #address-cells wide)*/
+	if (dma_window_property_size == 12) {
+		size = ((dma_window[1] >> PAGE_SHIFT) << 3) >> PAGE_SHIFT;
+	} else if (dma_window_property_size == 20) {
+		size = ((dma_window[4] >> PAGE_SHIFT) << 3) >> PAGE_SHIFT;
+	} else {
+		printk(KERN_WARNING "vio_build_tce_table: Invalid size of ibm,my-dma-window=%i, using 0x80 for size\n", dma_window_property_size);
+		size = 0x80;
+	}
+
+	/*  There should be some code to extract the phys-encoded offset
+		using prom_n_addr_cells(). However, according to a comment
+		on earlier versions, it's always zero, so we don't bother */
+	offset = dma_window[1] >>  PAGE_SHIFT;
+
+	/* TCE table size - measured in units of pages of tce table */
+	newTceTable->size = size;
+	/* offset for VIO should always be 0 */
+	newTceTable->startOffset = offset;
+	newTceTable->busNumber   = 0;
+	newTceTable->index       = (unsigned long)dma_window[0];
+	newTceTable->tceType     = TCE_VB;
+
+	return build_tce_table(newTceTable);
+}
+
+int vio_enable_interrupts(struct vio_dev *dev)
+{
+	int rc = h_vio_signal(dev->unit_address, VIO_IRQ_ENABLE);
+	if (rc != H_Success) {
+		printk(KERN_ERR "vio: Error 0x%x enabling interrupts\n", rc);
+	}
+	return rc;
+}
+EXPORT_SYMBOL(vio_enable_interrupts);
+
+int vio_disable_interrupts(struct vio_dev *dev)
+{
+	int rc = h_vio_signal(dev->unit_address, VIO_IRQ_DISABLE);
+	if (rc != H_Success) {
+		printk(KERN_ERR "vio: Error 0x%x disabling interrupts\n", rc);
+	}
+	return rc;
+}
+EXPORT_SYMBOL(vio_disable_interrupts);
+
+
+dma_addr_t vio_map_single(struct vio_dev *dev, void *vaddr,
+			  size_t size, int direction )
+{
+	struct TceTable * tbl;
+	dma_addr_t dma_handle = NO_TCE;
+	unsigned long uaddr;
+	unsigned order, nPages;
+
+	if(direction == PCI_DMA_NONE) BUG();
+
+	uaddr = (unsigned long)vaddr;
+	nPages = PAGE_ALIGN( uaddr + size ) - ( uaddr & PAGE_MASK );
+	order = get_order( nPages & PAGE_MASK );
+	nPages >>= PAGE_SHIFT;
+
+ 	/* Client asked for way to much space.  This is checked later anyway */
+	/* It is easier to debug here for the drivers than in the tce tables.*/
+ 	if(order >= NUM_TCE_LEVELS) {
+ 		printk("VIO_DMA: vio_map_single size to large: 0x%lx \n",size);
+ 		return NO_TCE;
+ 	}
+
+	tbl = dev->tce_table;
+
+	if(tbl) {
+		dma_handle = get_tces(tbl, order, vaddr, nPages, direction);
+		dma_handle |= (uaddr & ~PAGE_MASK);
+	}
+
+	return dma_handle;
+}
+EXPORT_SYMBOL(vio_map_single);
+
+void vio_unmap_single(struct vio_dev *dev, dma_addr_t dma_handle,
+		      size_t size, int direction)
+{
+	struct TceTable * tbl;
+	unsigned order, nPages;
+
+	if (direction == PCI_DMA_NONE) BUG();
+
+	nPages = PAGE_ALIGN( dma_handle + size ) - ( dma_handle & PAGE_MASK );
+	order = get_order( nPages & PAGE_MASK );
+	nPages >>= PAGE_SHIFT;
+
+ 	/* Client asked for way to much space.  This is checked later anyway */
+	/* It is easier to debug here for the drivers than in the tce tables.*/
+ 	if(order >= NUM_TCE_LEVELS) {
+ 		printk("VIO_DMA: vio_unmap_single 0x%lx size to large: 0x%lx \n",(unsigned long)dma_handle,(unsigned long)size);
+ 		return;
+ 	}
+
+	tbl = dev->tce_table;
+	if(tbl) tce_free(tbl, dma_handle, order, nPages);
+}
+EXPORT_SYMBOL(vio_unmap_single);
+
+int vio_map_sg(struct vio_dev *vdev, struct scatterlist *sglist, int nelems,
+	       int direction)
+{
+	int i;
+
+	for (i = 0; i < nelems; i++) {
+
+		/* 2.4 scsi scatterlists use address field.
+		   Not sure about other subsystems. */
+		void *vaddr;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
+		if (sglist->address)
+			vaddr = sglist->address;
+		else
+#endif
+			vaddr = page_address(sglist->page) + sglist->offset;
+
+		sglist->dma_address = vio_map_single(vdev, vaddr,
+						     sglist->length,
+						     direction);
+		sglist->dma_length = sglist->length;
+		sglist++;
+	}
+
+	return nelems;
+}
+EXPORT_SYMBOL(vio_map_sg);
+
+void vio_unmap_sg(struct vio_dev *vdev, struct scatterlist *sglist, int nelems,
+		  int direction)
+{
+	while (nelems--) {
+		vio_unmap_single(vdev, sglist->dma_address,
+				 sglist->dma_length, direction);
+		sglist++;
+	}
+}
+
+void *vio_alloc_consistent(struct vio_dev *dev, size_t size,
+			   dma_addr_t *dma_handle)
+{
+	struct TceTable * tbl;
+	void *ret = NULL;
+	unsigned order, nPages;
+	dma_addr_t tce;
+
+	size = PAGE_ALIGN(size);
+	order = get_order(size);
+	nPages = 1 << order;
+
+ 	/* Client asked for way to much space.  This is checked later anyway */
+	/* It is easier to debug here for the drivers than in the tce tables.*/
+ 	if(order >= NUM_TCE_LEVELS) {
+ 		printk("VIO_DMA: vio_alloc_consistent size to large: 0x%lx \n",size);
+ 		return (void *)NO_TCE;
+ 	}
+
+	tbl = dev->tce_table;
+
+	if ( tbl ) {
+		/* Alloc enough pages (and possibly more) */
+		ret = (void *)__get_free_pages( GFP_ATOMIC, order );
+		if ( ret ) {
+			/* Page allocation succeeded */
+			memset(ret, 0, nPages << PAGE_SHIFT);
+			/* Set up tces to cover the allocated range */
+			tce = get_tces( tbl, order, ret, nPages, PCI_DMA_BIDIRECTIONAL );
+			if ( tce == NO_TCE ) {
+				PPCDBG(PPCDBG_TCE, "vio_alloc_consistent: get_tces failed\n" );
+				free_pages( (unsigned long)ret, order );
+				ret = NULL;
+			}
+			else
+				{
+					*dma_handle = tce;
+				}
+		}
+		else PPCDBG(PPCDBG_TCE, "vio_alloc_consistent: __get_free_pages failed for order = %d\n", order);
+	}
+	else PPCDBG(PPCDBG_TCE, "vio_alloc_consistent: get_tce_table failed for 0x%016lx\n", dev);
+
+	PPCDBG(PPCDBG_TCE, "\tvio_alloc_consistent: dma_handle = 0x%16.16lx\n", *dma_handle);
+	PPCDBG(PPCDBG_TCE, "\tvio_alloc_consistent: return     = 0x%16.16lx\n", ret);
+	return ret;
+}
+EXPORT_SYMBOL(vio_alloc_consistent);
+
+void vio_free_consistent(struct vio_dev *dev, size_t size,
+			 void *vaddr, dma_addr_t dma_handle)
+{
+	struct TceTable * tbl;
+	unsigned order, nPages;
+
+	PPCDBG(PPCDBG_TCE, "vio_free_consistent:\n");
+	PPCDBG(PPCDBG_TCE, "\tdev = 0x%16.16lx, size = 0x%16.16lx, dma_handle = 0x%16.16lx, vaddr = 0x%16.16lx\n", dev, size, dma_handle, vaddr);
+
+	size = PAGE_ALIGN(size);
+	order = get_order(size);
+	nPages = 1 << order;
+
+ 	/* Client asked for way to much space.  This is checked later anyway */
+	/* It is easier to debug here for the drivers than in the tce tables.*/
+ 	if(order >= NUM_TCE_LEVELS) {
+ 		printk("PCI_DMA: pci_free_consistent size to large: 0x%lx \n",size);
+ 		return;
+ 	}
+
+	tbl = dev->tce_table;
+
+	if ( tbl ) {
+		tce_free(tbl, dma_handle, order, nPages);
+		free_pages( (unsigned long)vaddr, order );
+	}
+}
+EXPORT_SYMBOL(vio_free_consistent);
+
+EXPORT_SYMBOL(plpar_hcall_norets);
+EXPORT_SYMBOL(plpar_hcall_8arg_2ret);
diff -Nru a/arch/ppc64/kernel/viopath.c b/arch/ppc64/kernel/viopath.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/ppc64/kernel/viopath.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,756 @@
+/* -*- linux-c -*-
+ *  arch/ppc64/kernel/viopath.c
+ *
+ *  iSeries Virtual I/O Message Path code
+ *
+ *  Authors: Dave Boutcher <boutcher@us.ibm.com>
+ *           Ryan Arnold <ryanarn@us.ibm.com>
+ *           Colin Devilbiss <devilbis@us.ibm.com>
+ *
+ * (C) Copyright 2000-2003 IBM Corporation
+ *
+ * This code is used by the iSeries virtual disk, cd,
+ * tape, and console to communicate with OS/400 in another
+ * partition.
+ *
+ * This program is free software;  you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) anyu later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+#include <asm/uaccess.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/vmalloc.h>
+#include <linux/string.h>
+#include <linux/proc_fs.h>
+#include <linux/pci.h>
+#include <linux/wait.h>
+
+#include <asm/hardirq.h>	/* for is_atomic */
+
+#include <asm/iSeries/LparData.h>
+#include <asm/iSeries/HvLpEvent.h>
+#include <asm/iSeries/HvLpConfig.h>
+#include <asm/iSeries/HvCallCfg.h>
+#include <asm/iSeries/mf.h>
+#include <asm/iSeries/iSeries_proc.h>
+#include <asm/iSeries/vio.h>
+
+extern struct pci_dev *iSeries_vio_dev;
+
+/* Status of the path to each other partition in the system.
+ * This is overkill, since we will only ever establish connections
+ * to our hosting partition and the primary partition on the system.
+ * But this allows for other support in the future.
+ */
+static struct viopathStatus {
+	int isOpen:1;		/* Did we open the path?            */
+	int isActive:1;		/* Do we have a mon msg outstanding */
+	int users[VIO_MAX_SUBTYPES];
+	HvLpInstanceId mSourceInst;
+	HvLpInstanceId mTargetInst;
+	int numberAllocated;
+} viopathStatus[HVMAXARCHITECTEDLPS];
+
+static spinlock_t statuslock = SPIN_LOCK_UNLOCKED;
+
+/*
+ * For each kind of event we allocate a buffer that is
+ * guaranteed not to cross a page boundary
+ */
+static unsigned char event_buffer[VIO_MAX_SUBTYPES * 256] __page_aligned;
+static atomic_t event_buffer_available[VIO_MAX_SUBTYPES];
+static int event_buffer_initialised;
+
+static void handleMonitorEvent(struct HvLpEvent *event);
+
+/*
+ * We use this structure to handle asynchronous responses.  The caller
+ * blocks on the semaphore and the handler posts the semaphore.  However,
+ * if in_atomic() is true in the caller, then wait_atomic is used ...
+ */
+struct doneAllocParms_t {
+	struct semaphore *sem;
+	int number;
+	atomic_t *wait_atomic;
+	int used_wait_atomic;
+};
+
+/* Put a sequence number in each mon msg.  The value is not
+ * important.  Start at something other than 0 just for
+ * readability.  wrapping this is ok.
+ */
+static u8 viomonseq = 22;
+
+/* Our hosting logical partition.  We get this at startup
+ * time, and different modules access this variable directly.
+ */
+HvLpIndex viopath_hostLp = 0xff;	/* HvLpIndexInvalid */
+EXPORT_SYMBOL(viopath_hostLp);
+HvLpIndex viopath_ourLp = 0xff;
+EXPORT_SYMBOL(viopath_ourLp);
+
+/* For each kind of incoming event we set a pointer to a
+ * routine to call.
+ */
+static vio_event_handler_t *vio_handler[VIO_MAX_SUBTYPES];
+
+static unsigned char e2a(unsigned char x)
+{
+	switch (x) {
+	case 0xF0:
+		return '0';
+	case 0xF1:
+		return '1';
+	case 0xF2:
+		return '2';
+	case 0xF3:
+		return '3';
+	case 0xF4:
+		return '4';
+	case 0xF5:
+		return '5';
+	case 0xF6:
+		return '6';
+	case 0xF7:
+		return '7';
+	case 0xF8:
+		return '8';
+	case 0xF9:
+		return '9';
+	case 0xC1:
+		return 'A';
+	case 0xC2:
+		return 'B';
+	case 0xC3:
+		return 'C';
+	case 0xC4:
+		return 'D';
+	case 0xC5:
+		return 'E';
+	case 0xC6:
+		return 'F';
+	case 0xC7:
+		return 'G';
+	case 0xC8:
+		return 'H';
+	case 0xC9:
+		return 'I';
+	case 0xD1:
+		return 'J';
+	case 0xD2:
+		return 'K';
+	case 0xD3:
+		return 'L';
+	case 0xD4:
+		return 'M';
+	case 0xD5:
+		return 'N';
+	case 0xD6:
+		return 'O';
+	case 0xD7:
+		return 'P';
+	case 0xD8:
+		return 'Q';
+	case 0xD9:
+		return 'R';
+	case 0xE2:
+		return 'S';
+	case 0xE3:
+		return 'T';
+	case 0xE4:
+		return 'U';
+	case 0xE5:
+		return 'V';
+	case 0xE6:
+		return 'W';
+	case 0xE7:
+		return 'X';
+	case 0xE8:
+		return 'Y';
+	case 0xE9:
+		return 'Z';
+	}
+	return ' ';
+}
+
+/* Handle reads from the proc file system
+ */
+static int proc_read(char *buf, char **start, off_t offset,
+		     int blen, int *eof, void *data)
+{
+	HvLpEvent_Rc hvrc;
+	DECLARE_MUTEX_LOCKED(Semaphore);
+	dma_addr_t dmaa =
+	    pci_map_single(iSeries_vio_dev, buf, PAGE_SIZE,
+			   PCI_DMA_FROMDEVICE);
+	int len = PAGE_SIZE;
+
+	if (len > blen)
+		len = blen;
+
+	memset(buf, 0x00, len);
+	hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp,
+			HvLpEvent_Type_VirtualIo,
+			viomajorsubtype_config | vioconfigget,
+			HvLpEvent_AckInd_DoAck, HvLpEvent_AckType_ImmediateAck,
+			viopath_sourceinst(viopath_hostLp),
+			viopath_targetinst(viopath_hostLp),
+			(u64)(unsigned long)&Semaphore, VIOVERSION << 16,
+			((u64)dmaa) << 32, len, 0, 0);
+	if (hvrc != HvLpEvent_Rc_Good)
+		printk("viopath hv error on op %d\n", (int) hvrc);
+
+	down(&Semaphore);
+
+	pci_unmap_single(iSeries_vio_dev, dmaa, PAGE_SIZE,
+			 PCI_DMA_FROMDEVICE);
+
+	sprintf(buf + strlen(buf), "SRLNBR=");
+	buf[strlen(buf)] = e2a(xItExtVpdPanel.mfgID[2]);
+	buf[strlen(buf)] = e2a(xItExtVpdPanel.mfgID[3]);
+	buf[strlen(buf)] = e2a(xItExtVpdPanel.systemSerial[1]);
+	buf[strlen(buf)] = e2a(xItExtVpdPanel.systemSerial[2]);
+	buf[strlen(buf)] = e2a(xItExtVpdPanel.systemSerial[3]);
+	buf[strlen(buf)] = e2a(xItExtVpdPanel.systemSerial[4]);
+	buf[strlen(buf)] = e2a(xItExtVpdPanel.systemSerial[5]);
+	buf[strlen(buf)] = '\n';
+	*eof = 1;
+	return strlen(buf);
+}
+
+/* Handle writes to our proc file system
+ */
+static int proc_write(struct file *file, const char *buffer,
+		      unsigned long count, void *data)
+{
+	/* Doesn't do anything today!!!
+	 */
+	return count;
+}
+
+/* setup our proc file system entries
+ */
+static void vio_proc_init(struct proc_dir_entry *iSeries_proc)
+{
+	struct proc_dir_entry *ent;
+	ent = create_proc_entry("config", S_IFREG | S_IRUSR, iSeries_proc);
+	if (!ent)
+		return;
+	ent->nlink = 1;
+	ent->data = NULL;
+	ent->read_proc = proc_read;
+	ent->write_proc = proc_write;
+}
+
+/* See if a given LP is active.  Allow for invalid lps to be passed in
+ * and just return invalid
+ */
+int viopath_isactive(HvLpIndex lp)
+{
+	if (lp == HvLpIndexInvalid)
+		return 0;
+	if (lp < HVMAXARCHITECTEDLPS)
+		return viopathStatus[lp].isActive;
+	else
+		return 0;
+}
+EXPORT_SYMBOL(viopath_isactive);
+
+/*
+ * We cache the source and target instance ids for each
+ * partition.  
+ */
+HvLpInstanceId viopath_sourceinst(HvLpIndex lp)
+{
+	return viopathStatus[lp].mSourceInst;
+}
+EXPORT_SYMBOL(viopath_sourceinst);
+
+HvLpInstanceId viopath_targetinst(HvLpIndex lp)
+{
+	return viopathStatus[lp].mTargetInst;
+}
+EXPORT_SYMBOL(viopath_targetinst);
+
+/*
+ * Send a monitor message.  This is a message with the acknowledge
+ * bit on that the other side will NOT explicitly acknowledge.  When
+ * the other side goes down, the hypervisor will acknowledge any
+ * outstanding messages....so we will know when the other side dies.
+ */
+static void sendMonMsg(HvLpIndex remoteLp)
+{
+	HvLpEvent_Rc hvrc;
+
+	viopathStatus[remoteLp].mSourceInst =
+		HvCallEvent_getSourceLpInstanceId(remoteLp,
+				HvLpEvent_Type_VirtualIo);
+	viopathStatus[remoteLp].mTargetInst =
+		HvCallEvent_getTargetLpInstanceId(remoteLp,
+				HvLpEvent_Type_VirtualIo);
+
+	/*
+	 * Deliberately ignore the return code here.  if we call this
+	 * more than once, we don't care.
+	 */
+	vio_setHandler(viomajorsubtype_monitor, handleMonitorEvent);
+
+	hvrc = HvCallEvent_signalLpEventFast(remoteLp, HvLpEvent_Type_VirtualIo,
+			viomajorsubtype_monitor, HvLpEvent_AckInd_DoAck,
+			HvLpEvent_AckType_DeferredAck,
+			viopathStatus[remoteLp].mSourceInst,
+			viopathStatus[remoteLp].mTargetInst,
+			viomonseq++, 0, 0, 0, 0, 0);
+
+	if (hvrc == HvLpEvent_Rc_Good)
+		viopathStatus[remoteLp].isActive = 1;
+	else {
+		printk(KERN_WARNING_VIO "could not connect to partition %d\n",
+				remoteLp);
+		viopathStatus[remoteLp].isActive = 0;
+	}
+}
+
+static void handleMonitorEvent(struct HvLpEvent *event)
+{
+	HvLpIndex remoteLp;
+	int i;
+
+	/*
+	 * This handler is _also_ called as part of the loop
+	 * at the end of this routine, so it must be able to
+	 * ignore NULL events...
+	 */
+	if (!event)
+		return;
+
+	/*
+	 * First see if this is just a normal monitor message from the
+	 * other partition
+	 */
+	if (event->xFlags.xFunction == HvLpEvent_Function_Int) {
+		remoteLp = event->xSourceLp;
+		if (!viopathStatus[remoteLp].isActive)
+			sendMonMsg(remoteLp);
+		return;
+	}
+
+	/*
+	 * This path is for an acknowledgement; the other partition
+	 * died
+	 */
+	remoteLp = event->xTargetLp;
+	if ((event->xSourceInstanceId != viopathStatus[remoteLp].mSourceInst) ||
+	    (event->xTargetInstanceId != viopathStatus[remoteLp].mTargetInst)) {
+		printk(KERN_WARNING_VIO "ignoring ack....mismatched instances\n");
+		return;
+	}
+
+	printk(KERN_WARNING_VIO "partition %d ended\n", remoteLp);
+
+	viopathStatus[remoteLp].isActive = 0;
+
+	/*
+	 * For each active handler, pass them a NULL
+	 * message to indicate that the other partition
+	 * died
+	 */
+	for (i = 0; i < VIO_MAX_SUBTYPES; i++) {
+		if (vio_handler[i] != NULL)
+			(*vio_handler[i])(NULL);
+	}
+}
+
+int vio_setHandler(int subtype, vio_event_handler_t *beh)
+{
+	subtype = subtype >> VIOMAJOR_SUBTYPE_SHIFT;
+	if ((subtype < 0) || (subtype >= VIO_MAX_SUBTYPES))
+		return -EINVAL;
+	if (vio_handler[subtype] != NULL)
+		return -EBUSY;
+	vio_handler[subtype] = beh;
+	return 0;
+}
+EXPORT_SYMBOL(vio_setHandler);
+
+int vio_clearHandler(int subtype)
+{
+	subtype = subtype >> VIOMAJOR_SUBTYPE_SHIFT;
+	if ((subtype < 0) || (subtype >= VIO_MAX_SUBTYPES))
+		return -EINVAL;
+	if (vio_handler[subtype] == NULL)
+		return -EAGAIN;
+	vio_handler[subtype] = NULL;
+	return 0;
+}
+EXPORT_SYMBOL(vio_clearHandler);
+
+static void handleConfig(struct HvLpEvent *event)
+{
+	if (!event)
+		return;
+	if (event->xFlags.xFunction == HvLpEvent_Function_Int) {
+		printk(KERN_WARNING_VIO
+		       "unexpected config request from partition %d",
+		       event->xSourceLp);
+
+		if ((event->xFlags.xFunction == HvLpEvent_Function_Int) &&
+		    (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck)) {
+			event->xRc = HvLpEvent_Rc_InvalidSubtype;
+			HvCallEvent_ackLpEvent(event);
+		}
+		return;
+	}
+
+	up((struct semaphore *)event->xCorrelationToken);
+}
+
+/*
+ * Initialization of the hosting partition
+ */
+void vio_set_hostlp(void)
+{
+	/*
+	 * If this has already been set then we DON'T want to either change
+	 * it or re-register the proc file system
+	 */
+	if (viopath_hostLp != HvLpIndexInvalid)
+		return;
+
+	/*
+	 * Figure out our hosting partition.  This isn't allowed to change
+	 * while we're active
+	 */
+	viopath_ourLp = HvLpConfig_getLpIndex();
+	viopath_hostLp = HvCallCfg_getHostingLpIndex(viopath_ourLp);
+
+	/* If we have a valid hosting LP, create a proc file system entry
+	 * for config information
+	 */
+	if (viopath_hostLp != HvLpIndexInvalid) {
+		iSeries_proc_callback(&vio_proc_init);
+		vio_setHandler(viomajorsubtype_config, handleConfig);
+	}
+}
+EXPORT_SYMBOL(vio_set_hostlp);
+
+static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs)
+{
+	HvLpIndex remoteLp;
+	int subtype = (event->xSubtype & VIOMAJOR_SUBTYPE_MASK)
+		>> VIOMAJOR_SUBTYPE_SHIFT;
+
+	if (event->xFlags.xFunction == HvLpEvent_Function_Int) {
+		remoteLp = event->xSourceLp;
+		/*
+		 * The isActive is checked because if the hosting partition
+		 * went down and came back up it would not be active but it
+		 * would have different source and target instances, in which
+		 * case we'd want to reset them.  This case really protects
+		 * against an unauthorized active partition sending interrupts
+		 * or acks to this linux partition.
+		 */
+		if (viopathStatus[remoteLp].isActive
+		    && (event->xSourceInstanceId !=
+			viopathStatus[remoteLp].mTargetInst)) {
+			printk(KERN_WARNING_VIO
+			       "message from invalid partition. "
+			       "int msg rcvd, source inst (%d) doesnt match (%d)\n",
+			       viopathStatus[remoteLp].mTargetInst,
+			       event->xSourceInstanceId);
+			return;
+		}
+
+		if (viopathStatus[remoteLp].isActive
+		    && (event->xTargetInstanceId !=
+			viopathStatus[remoteLp].mSourceInst)) {
+			printk(KERN_WARNING_VIO
+			       "message from invalid partition. "
+			       "int msg rcvd, target inst (%d) doesnt match (%d)\n",
+			       viopathStatus[remoteLp].mSourceInst,
+			       event->xTargetInstanceId);
+			return;
+		}
+	} else {
+		remoteLp = event->xTargetLp;
+		if (event->xSourceInstanceId !=
+		    viopathStatus[remoteLp].mSourceInst) {
+			printk(KERN_WARNING_VIO
+			       "message from invalid partition. "
+			       "ack msg rcvd, source inst (%d) doesnt match (%d)\n",
+			       viopathStatus[remoteLp].mSourceInst,
+			       event->xSourceInstanceId);
+			return;
+		}
+
+		if (event->xTargetInstanceId !=
+		    viopathStatus[remoteLp].mTargetInst) {
+			printk(KERN_WARNING_VIO
+			       "message from invalid partition. "
+			       "viopath: ack msg rcvd, target inst (%d) doesnt match (%d)\n",
+			       viopathStatus[remoteLp].mTargetInst,
+			       event->xTargetInstanceId);
+			return;
+		}
+	}
+
+	if (vio_handler[subtype] == NULL) {
+		printk(KERN_WARNING_VIO
+		       "unexpected virtual io event subtype %d from partition %d\n",
+		       event->xSubtype, remoteLp);
+		/* No handler.  Ack if necessary */
+		if ((event->xFlags.xFunction == HvLpEvent_Function_Int) &&
+		    (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck)) {
+			event->xRc = HvLpEvent_Rc_InvalidSubtype;
+			HvCallEvent_ackLpEvent(event);
+		}
+		return;
+	}
+
+	/* This innocuous little line is where all the real work happens */
+	(*vio_handler[subtype])(event);
+}
+
+static void viopath_donealloc(void *parm, int number)
+{
+	struct doneAllocParms_t *parmsp = (struct doneAllocParms_t *)parm;
+
+	parmsp->number = number;
+	if (parmsp->used_wait_atomic)
+		atomic_set(parmsp->wait_atomic, 0);
+	else
+		up(parmsp->sem);
+}
+
+static int allocateEvents(HvLpIndex remoteLp, int numEvents)
+{
+	struct doneAllocParms_t parms;
+	DECLARE_MUTEX_LOCKED(Semaphore);
+	atomic_t wait_atomic;
+
+	if (in_atomic()) {
+		parms.used_wait_atomic = 1;
+		atomic_set(&wait_atomic, 1);
+		parms.wait_atomic = &wait_atomic;
+	} else {
+		parms.used_wait_atomic = 0;
+		parms.sem = &Semaphore;
+	}
+	mf_allocateLpEvents(remoteLp, HvLpEvent_Type_VirtualIo, 250,	/* It would be nice to put a real number here! */
+			    numEvents, &viopath_donealloc, &parms);
+	if (in_atomic()) {
+		while (atomic_read(&wait_atomic))
+			mb();
+	} else
+		down(&Semaphore);
+	return parms.number;
+}
+
+int viopath_open(HvLpIndex remoteLp, int subtype, int numReq)
+{
+	int i;
+	unsigned long flags;
+	int tempNumAllocated;
+
+	if ((remoteLp >= HvMaxArchitectedLps) || (remoteLp == HvLpIndexInvalid))
+		return -EINVAL;
+
+	subtype = subtype >> VIOMAJOR_SUBTYPE_SHIFT;
+	if ((subtype < 0) || (subtype >= VIO_MAX_SUBTYPES))
+		return -EINVAL;
+
+	spin_lock_irqsave(&statuslock, flags);
+
+	if (!event_buffer_initialised) {
+		for (i = 0; i < VIO_MAX_SUBTYPES; i++)
+			atomic_set(&event_buffer_available[i], 1);
+		event_buffer_initialised = 1;
+	}
+
+	viopathStatus[remoteLp].users[subtype]++;
+
+	if (!viopathStatus[remoteLp].isOpen) {
+		viopathStatus[remoteLp].isOpen = 1;
+		HvCallEvent_openLpEventPath(remoteLp, HvLpEvent_Type_VirtualIo);
+
+		/*
+		 * Don't hold the spinlock during an operation that
+		 * can sleep.
+		 */
+		spin_unlock_irqrestore(&statuslock, flags);
+		tempNumAllocated = allocateEvents(remoteLp, 1);
+		spin_lock_irqsave(&statuslock, flags);
+
+		viopathStatus[remoteLp].numberAllocated += tempNumAllocated;
+
+		if (viopathStatus[remoteLp].numberAllocated == 0) {
+			HvCallEvent_closeLpEventPath(remoteLp,
+					HvLpEvent_Type_VirtualIo);
+
+			spin_unlock_irqrestore(&statuslock, flags);
+			return -ENOMEM;
+		}
+
+		viopathStatus[remoteLp].mSourceInst =
+			HvCallEvent_getSourceLpInstanceId(remoteLp,
+					HvLpEvent_Type_VirtualIo);
+		viopathStatus[remoteLp].mTargetInst =
+			HvCallEvent_getTargetLpInstanceId(remoteLp,
+					HvLpEvent_Type_VirtualIo);
+		HvLpEvent_registerHandler(HvLpEvent_Type_VirtualIo,
+					  &vio_handleEvent);
+		sendMonMsg(remoteLp);
+		printk(KERN_INFO_VIO
+		       "Opening connection to partition %d, setting sinst %d, tinst %d\n",
+		       remoteLp, viopathStatus[remoteLp].mSourceInst,
+		       viopathStatus[remoteLp].mTargetInst);
+	}
+
+	spin_unlock_irqrestore(&statuslock, flags);
+	tempNumAllocated = allocateEvents(remoteLp, numReq);
+	spin_lock_irqsave(&statuslock, flags);
+	viopathStatus[remoteLp].numberAllocated += tempNumAllocated;
+	spin_unlock_irqrestore(&statuslock, flags);
+
+	return 0;
+}
+EXPORT_SYMBOL(viopath_open);
+
+int viopath_close(HvLpIndex remoteLp, int subtype, int numReq)
+{
+	unsigned long flags;
+	int i;
+	int numOpen;
+	struct doneAllocParms_t doneAllocParms;
+	DECLARE_MUTEX_LOCKED(Semaphore);
+
+	if ((remoteLp >= HvMaxArchitectedLps) || (remoteLp == HvLpIndexInvalid))
+		return -EINVAL;
+
+	subtype = subtype >> VIOMAJOR_SUBTYPE_SHIFT;
+	if ((subtype < 0) || (subtype >= VIO_MAX_SUBTYPES))
+		return -EINVAL;
+
+	spin_lock_irqsave(&statuslock, flags);
+	/*
+	 * If the viopath_close somehow gets called before a
+	 * viopath_open it could decrement to -1 which is a non
+	 * recoverable state so we'll prevent this from
+	 * happening.
+	 */
+	if (viopathStatus[remoteLp].users[subtype] > 0)
+		viopathStatus[remoteLp].users[subtype]--;
+
+	spin_unlock_irqrestore(&statuslock, flags);
+
+	doneAllocParms.used_wait_atomic = 0;
+	doneAllocParms.sem = &Semaphore;
+	mf_deallocateLpEvents(remoteLp, HvLpEvent_Type_VirtualIo,
+			      numReq, &viopath_donealloc, &doneAllocParms);
+	down(&Semaphore);
+
+	spin_lock_irqsave(&statuslock, flags);
+	for (i = 0, numOpen = 0; i < VIO_MAX_SUBTYPES; i++)
+		numOpen += viopathStatus[remoteLp].users[i];
+
+	if ((viopathStatus[remoteLp].isOpen) && (numOpen == 0)) {
+		printk(KERN_INFO_VIO "Closing connection to partition %d",
+				remoteLp);
+
+		HvCallEvent_closeLpEventPath(remoteLp,
+					     HvLpEvent_Type_VirtualIo);
+		viopathStatus[remoteLp].isOpen = 0;
+		viopathStatus[remoteLp].isActive = 0;
+
+		for (i = 0; i < VIO_MAX_SUBTYPES; i++)
+			atomic_set(&event_buffer_available[i], 0);
+		event_buffer_initialised = 0;
+	}
+	spin_unlock_irqrestore(&statuslock, flags);
+	return 0;
+}
+EXPORT_SYMBOL(viopath_close);
+
+void *vio_get_event_buffer(int subtype)
+{
+	subtype = subtype >> VIOMAJOR_SUBTYPE_SHIFT;
+	if ((subtype < 0) || (subtype >= VIO_MAX_SUBTYPES))
+		return NULL;
+
+	if (atomic_dec_if_positive(&event_buffer_available[subtype]) == 0)
+		return &event_buffer[subtype * 256];
+	else
+		return NULL;
+}
+EXPORT_SYMBOL(vio_get_event_buffer);
+
+void vio_free_event_buffer(int subtype, void *buffer)
+{
+	subtype = subtype >> VIOMAJOR_SUBTYPE_SHIFT;
+	if ((subtype < 0) || (subtype >= VIO_MAX_SUBTYPES)) {
+		printk(KERN_WARNING_VIO
+		       "unexpected subtype %d freeing event buffer\n",
+		       subtype);
+		return;
+	}
+
+	if (atomic_read(&event_buffer_available[subtype]) != 0) {
+		printk(KERN_WARNING_VIO
+		       "freeing unallocated event buffer, subtype %d\n",
+		       subtype);
+		return;
+	}
+
+	if (buffer != &event_buffer[subtype * 256]) {
+		printk(KERN_WARNING_VIO
+		       "freeing invalid event buffer, subtype %d\n",
+		       subtype);
+	}
+
+	atomic_set(&event_buffer_available[subtype], 1);
+}
+EXPORT_SYMBOL(vio_free_event_buffer);
+
+static const struct vio_error_entry vio_no_error =
+    { 0, 0, "Non-VIO Error" };
+static const struct vio_error_entry vio_unknown_error =
+    { 0, EIO, "Unknown Error" };
+
+static const struct vio_error_entry vio_default_errors[] = {
+	{0x0001, EIO, "No Connection"},
+	{0x0002, EIO, "No Receiver"},
+	{0x0003, EIO, "No Buffer Available"},
+	{0x0004, EBADRQC, "Invalid Message Type"},
+	{0x0000, 0, NULL},
+};
+
+const struct vio_error_entry *vio_lookup_rc(
+		const struct vio_error_entry *local_table, u16 rc)
+{
+	const struct vio_error_entry *cur;
+
+	if (!rc)
+		return &vio_no_error;
+	if (local_table)
+		for (cur = local_table; cur->rc; ++cur)
+			if (cur->rc == rc)
+				return cur;
+	for (cur = vio_default_errors; cur->rc; ++cur)
+		if (cur->rc == rc)
+			return cur;
+	return &vio_unknown_error;
+}
+EXPORT_SYMBOL(vio_lookup_rc);
diff -Nru a/arch/ppc64/kernel/vmlinux.lds.S b/arch/ppc64/kernel/vmlinux.lds.S
--- a/arch/ppc64/kernel/vmlinux.lds.S	Tue Feb  3 19:45:35 2004
+++ b/arch/ppc64/kernel/vmlinux.lds.S	Tue Feb  3 19:45:35 2004
@@ -1,145 +1,146 @@
 #include <asm-generic/vmlinux.lds.h>
 
 OUTPUT_ARCH(powerpc:common64)
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
 jiffies = jiffies_64;
 SECTIONS
 {
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)		}
-  .dynsym        : { *(.dynsym)		}
-  .dynstr        : { *(.dynstr)		}
-  .rel.text      : { *(.rel.text)		}
-  .rela.text     : { *(.rela.text) 	}
-  .rel.data      : { *(.rel.data)		}
-  .rela.data     : { *(.rela.data) 	}
-  .rel.rodata    : { *(.rel.rodata) 	}
-  .rela.rodata   : { *(.rela.rodata) 	}
-  .rel.got       : { *(.rel.got)		}
-  .rela.got      : { *(.rela.got)		}
-  .rel.ctors     : { *(.rel.ctors)	}
-  .rela.ctors    : { *(.rela.ctors)	}
-  .rel.dtors     : { *(.rel.dtors)	}
-  .rela.dtors    : { *(.rela.dtors)	}
-  .rel.bss       : { *(.rel.bss)		}
-  .rela.bss      : { *(.rela.bss)		}
-  .rel.plt       : { *(.rel.plt)		}
-  .rela.plt      : { *(.rela.plt)		}
-/*  .init          : { *(.init)	} =0*/
-  .plt : { *(.plt) }
-  .text      :
-  {
-    *(.text)
-    *(.fixup)
-    *(.got1)
-  }
-  . = ALIGN(4096);
-  _etext = .;
-  PROVIDE (etext = .);
-
-  RODATA
-
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFFFFFFFFFF000;
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.got.plt) *(.got)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  . = ALIGN(4096);
-  _edata  =  .;
-  PROVIDE (edata = .);
+  /* Sections to be discarded. */
+  /DISCARD/ : {
+	*(.exitcall.exit)
+	}
 
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  __start___bug_table = .;
-  __bug_table : { *(__bug_table) }
-  __stop___bug_table = .;
-
-  __start___ftr_fixup = .;
-  __ftr_fixup : { *(__ftr_fixup) }
-  __stop___ftr_fixup = .;
 
-  . = ALIGN(16384);		/* init_task */
-  .data.init_task : { *(.data.init_task) }
+  /* Read-only sections, merged into text segment: */
+  .text : {
+	*(.text .text.*)
+	*(.fixup)
+	. = ALIGN(4096);
+	_etext = .;
+	}
+
+  __ex_table : {
+	__start___ex_table = .;
+	*(__ex_table)
+	__stop___ex_table = .;
+	}
+
+  __bug_table : {
+	__start___bug_table = .;
+	*(__bug_table)
+	__stop___bug_table = .;
+	}
+
+  __ftr_fixup : {
+	__start___ftr_fixup = .;
+	*(__ftr_fixup)
+	__stop___ftr_fixup = .;
+	}
 
-  . = ALIGN(4096);
-  .data.page_aligned : { *(.data.page_aligned) }
+  RODATA
 
-  . = ALIGN(128);
-  .data.cacheline_aligned : { *(.data.cacheline_aligned) }
 
   /* will be freed after init */
   . = ALIGN(4096);
   __init_begin = .;
-  .init.text : { 
+
+  .init.text : {
 	_sinittext = .;
 	*(.init.text)
 	_einittext = .;
-  }
-  .init.data : { *(.init.data) }
+	}
+
+  .init.data : {
+	*(.init.data)
+	}
+
   . = ALIGN(16);
-  __setup_start = .;
-  .init.setup : { *(.init.setup) }
-  __setup_end = .;
-  __start___param = .;
-  __param : { *(__param) }
-  __stop___param = .;
-  __initcall_start = .;
+  .init.setup : {
+	__setup_start = .;
+	*(.init.setup)
+	__setup_end = .;
+	}
+
+  __param : {
+	__start___param = .;
+	*(__param)
+	__stop___param = .;
+	}
+
   .initcall.init : {
-	*(.initcall1.init) 
-	*(.initcall2.init) 
-	*(.initcall3.init) 
-	*(.initcall4.init) 
-	*(.initcall5.init) 
-	*(.initcall6.init) 
+	__initcall_start = .;
+	*(.initcall1.init)
+	*(.initcall2.init)
+	*(.initcall3.init)
+	*(.initcall4.init)
+	*(.initcall5.init)
+	*(.initcall6.init)
 	*(.initcall7.init)
-  }
-  __initcall_end = .;
-  __con_initcall_start = .;
-  .con_initcall.init : { *(.con_initcall.init) }
-  __con_initcall_end = .;
+	__initcall_end = .;
+	}
+
+  .con_initcall.init : {
+	__con_initcall_start = .;
+	*(.con_initcall.init)
+	__con_initcall_end = .;
+	}
+
   SECURITY_INIT
+
   . = ALIGN(4096);
-  __initramfs_start = .;
-  .init.ramfs : { *(.init.ramfs) }
-  __initramfs_end = .;
-  . = ALIGN(32);
-  __per_cpu_start = .;
-  .data.percpu  : { *(.data.percpu) }
-  __per_cpu_end = .;
-  . = ALIGN(4096);
+  .init.ramfs : {
+	__initramfs_start = .;
+	*(.init.ramfs)
+	__initramfs_end = .;
+	}
+
+  .data.percpu : {
+	__per_cpu_start = .;
+	*(.data.percpu)
+	__per_cpu_end = .;
+	}
+
+  . = ALIGN(16384);
   __init_end = .;
   /* freed after init ends here */
 
-  __toc_start = .;
-  .toc : { *(.toc) }
-  . = ALIGN(4096);
-  __toc_end = .;
 
-  __bss_start = .;
-  .bss : { *(.bss) }
-  __bss_stop = .;
+  /* Read/write sections */
+  . = ALIGN(16384);
+  /* The initial task and kernel stack */
+  .data.init_task : {
+	*(.data.init_task)
+	}
+
+  .data.page_aligned : {
+	*(.data.page_aligned)
+	}
+
+  .data.cacheline_aligned : {
+	*(.data.cacheline_aligned)
+	}
+
+  .data : {
+	*(.data .data.rel* .toc1)
+	*(.opd)
+	*(.branch_lt)
+	}
+
+  .got : {
+	__toc_start = .;
+	*(.got)
+	*(.toc)
+	. = ALIGN(4096);
+	_edata = .;
+	}
+
 
   . = ALIGN(4096);
-  _end = . ;
-  PROVIDE (end = .);
+  .bss : {
+	__bss_start = .;
+	*(.bss)
+	__bss_stop = .;
+	}
 
-  /* Sections to be discarded. */
-  /DISCARD/ : {
-    *(.exitcall.exit)
-  }
+  . = ALIGN(4096);
+  _end = . ;
 }
diff -Nru a/arch/ppc64/kernel/xics.c b/arch/ppc64/kernel/xics.c
--- a/arch/ppc64/kernel/xics.c	Tue Feb  3 19:45:28 2004
+++ b/arch/ppc64/kernel/xics.c	Tue Feb  3 19:45:28 2004
@@ -202,7 +202,7 @@
 {
 	unsigned long lpar_rc;
 
-	lpar_rc = plpar_ipi(n_cpu, value);
+	lpar_rc = plpar_ipi(get_hard_smp_processor_id(n_cpu), value);
 	if (lpar_rc != H_Success)
 		panic("bad return code qirr - rc = %lx\n", lpar_rc); 
 }
@@ -398,7 +398,7 @@
 	ibm_int_on  = rtas_token("ibm,int-on");
 	ibm_int_off = rtas_token("ibm,int-off");
 
-	np = find_type_devices("PowerPC-External-Interrupt-Presentation");
+	np = of_find_node_by_type(NULL, "PowerPC-External-Interrupt-Presentation");
 	if (!np) {
 		printk(KERN_WARNING "Can't find Interrupt Presentation\n");
 		udbg_printf("Can't find Interrupt Presentation\n");
@@ -433,13 +433,15 @@
 		if (indx >= NR_CPUS) break;
 	}
 
-	np = np->next;
+	np = of_find_node_by_type(np, "PowerPC-External-Interrupt-Presentation");
 	if ((indx < NR_CPUS) && np) goto nextnode;
 
 	/* Find the server numbers for the boot cpu. */
-	for (np = find_type_devices("cpu"); np; np = np->next) {
+	for (np = of_find_node_by_type(NULL, "cpu");
+	     np;
+	     np = of_find_node_by_type(np, "cpu")) {
 		ireg = (uint *)get_property(np, "reg", &ilen);
-		if (ireg && ireg[0] == smp_processor_id()) {
+		if (ireg && ireg[0] == hard_smp_processor_id()) {
 			ireg = (uint *)get_property(np, "ibm,ppc-interrupt-gserver#s", &ilen);
 			i = ilen / sizeof(int);
 			if (ireg && i > 0) {
@@ -449,11 +451,12 @@
 			break;
 		}
 	}
+	of_node_put(np);
 
 	intr_base = inodes[0].addr;
 	intr_size = (ulong)inodes[0].size;
 
-	np = find_type_devices("interrupt-controller");
+	np = of_find_node_by_type(NULL, "interrupt-controller");
 	if (!np) {
 		printk(KERN_WARNING "xics:  no ISA Interrupt Controller\n");
 		xics_irq_8259_cascade_real = -1;
@@ -467,6 +470,7 @@
 		}
 		xics_irq_8259_cascade_real = *ireg;
 		xics_irq_8259_cascade = virt_irq_create_mapping(xics_irq_8259_cascade_real);
+		of_node_put(np);
 	}
 
 	if (systemcfg->platform == PLATFORM_PSERIES) {
@@ -474,8 +478,8 @@
 		for (i = 0; i < NR_CPUS; ++i) {
 			if (!cpu_possible(i))
 				continue;
-			xics_per_cpu[i] = __ioremap((ulong)inodes[i].addr, 
-						    (ulong)inodes[i].size,
+			xics_per_cpu[i] = __ioremap((ulong)inodes[get_hard_smp_processor_id(i)].addr, 
+						    (ulong)inodes[get_hard_smp_processor_id(i)].size,
 						    _PAGE_NO_CACHE);
 		}
 #else
@@ -566,7 +570,7 @@
 		cpus_and(tmp, cpu_online_map, cpumask);
 		if (cpus_empty(tmp))
 			goto out;
-		newmask = first_cpu(cpumask);
+		newmask = get_hard_smp_processor_id(first_cpu(cpumask));
 	}
 
 	status = rtas_call(ibm_set_xive, 3, 1, NULL,
diff -Nru a/arch/ppc64/mm/Makefile b/arch/ppc64/mm/Makefile
--- a/arch/ppc64/mm/Makefile	Tue Feb  3 19:45:16 2004
+++ b/arch/ppc64/mm/Makefile	Tue Feb  3 19:45:16 2004
@@ -4,6 +4,6 @@
 
 EXTRA_CFLAGS += -mno-minimal-toc
 
-obj-y := fault.o init.o extable.o imalloc.o
+obj-y := fault.o init.o imalloc.o hash_utils.o hash_low.o
 obj-$(CONFIG_DISCONTIGMEM) += numa.o
 obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
diff -Nru a/arch/ppc64/mm/extable.c b/arch/ppc64/mm/extable.c
--- a/arch/ppc64/mm/extable.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,74 +0,0 @@
-/*
- * arch/ppc64/mm/extable.c
- *
- * from arch/i386/mm/extable.c
- *
- *      This program is free software; you can redistribute it and/or
- *      modify it under the terms of the GNU General Public License
- *      as published by the Free Software Foundation; either version
- *      2 of the License, or (at your option) any later version.
- */
-
-#include <linux/module.h>
-#include <linux/init.h>
-#include <asm/uaccess.h>
-
-extern struct exception_table_entry __start___ex_table[];
-extern struct exception_table_entry __stop___ex_table[];
-
-/*
- * The exception table needs to be sorted because we use the macros
- * which put things into the exception table in a variety of segments
- * as well as the init segment and the main kernel text segment.
- *
- * Also used for modules.
- */
-void __init_or_module sort_ex_table(struct exception_table_entry *start,
-				    struct exception_table_entry *finish)
-{
-	struct exception_table_entry el, *p, *q;
-
-	/* insertion sort */
-	for (p = start + 1; p < finish; ++p) {
-		/* start .. p-1 is sorted */
-		if (p[0].insn < p[-1].insn) {
-			/* move element p down to its right place */
-			el = *p;
-			q = p;
-			do {
-				/* el comes before q[-1], move q[-1] up one */
-				q[0] = q[-1];
-				--q;
-			} while (q > start && el.insn < q[-1].insn);
-			*q = el;
-		}
-	}
-}
-
-void __init
-sort_exception_table(void)
-{
-	sort_ex_table(__start___ex_table, __stop___ex_table);
-}
-
-/* Simple binary search */
-const struct exception_table_entry *
-search_extable(const struct exception_table_entry *first,
-	       const struct exception_table_entry *last,
-	       unsigned long value)
-{
-	while (first <= last) {
-		const struct exception_table_entry *mid;
-		long diff;
-
-		mid = (last - first) / 2 + first;
-		diff = mid->insn - value;
-		if (diff == 0)
-			return mid;
-		else if (diff < 0)
-			first = mid+1;
-		else
-			last = mid-1;
-	}
-	return NULL;
-}
diff -Nru a/arch/ppc64/mm/hash_low.S b/arch/ppc64/mm/hash_low.S
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/ppc64/mm/hash_low.S	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,282 @@
+/*
+ * ppc64 MMU hashtable management routines
+ *
+ * (c) Copyright IBM Corp. 2003
+ *
+ * Maintained by: Benjamin Herrenschmidt
+ *                <benh@kernel.crashing.org>
+ *
+ * This file is covered by the GNU Public Licence v2 as
+ * described in the kernel's COPYING file.
+ */
+
+#include <asm/processor.h>
+#include <asm/pgtable.h>
+#include <asm/mmu.h>
+#include <asm/page.h>
+#include <asm/types.h>
+#include <asm/ppc_asm.h>
+#include <asm/offsets.h>
+#include <asm/cputable.h>
+
+	.text
+
+/*
+ * Stackframe:
+ *		
+ *         +-> Back chain			(SP + 256)
+ *         |   General register save area	(SP + 112)
+ *         |   Parameter save area		(SP + 48)
+ *         |   TOC save area			(SP + 40)
+ *         |   link editor doubleword		(SP + 32)
+ *         |   compiler doubleword		(SP + 24)
+ *         |   LR save area			(SP + 16)
+ *         |   CR save area			(SP + 8)
+ * SP ---> +-- Back chain			(SP + 0)
+ */
+#define STACKFRAMESIZE	256
+
+/* Save parameters offsets */
+#define STK_PARM(i)	(STACKFRAMESIZE + 48 + ((i)-3)*8)
+
+/* Save non-volatile offsets */
+#define STK_REG(i)	(112 + ((i)-14)*8)
+
+/*
+ * _hash_page(unsigned long ea, unsigned long access, unsigned long vsid,
+ *		pte_t *ptep, unsigned long trap, int local)
+ *
+ * Adds a page to the hash table. This is the non-LPAR version for now
+ */
+
+_GLOBAL(__hash_page)
+	mflr	r0
+	std	r0,16(r1)
+	stdu	r1,-STACKFRAMESIZE(r1)
+	/* Save all params that we need after a function call */
+	std	r6,STK_PARM(r6)(r1)
+	std	r8,STK_PARM(r8)(r1)
+	
+	/* Add _PAGE_PRESENT to access */
+	ori	r4,r4,_PAGE_PRESENT
+
+	/* Save non-volatile registers.
+	 * r31 will hold "old PTE"
+	 * r30 is "new PTE"
+	 * r29 is "va"
+	 * r28 is a hash value
+	 * r27 is hashtab mask (maybe dynamic patched instead ?)
+	 */
+	std	r27,STK_REG(r27)(r1)
+	std	r28,STK_REG(r28)(r1)
+	std	r29,STK_REG(r29)(r1)
+	std	r30,STK_REG(r30)(r1)
+	std	r31,STK_REG(r31)(r1)
+	
+	/* Step 1:
+	 *
+	 * Check permissions, atomically mark the linux PTE busy
+	 * and hashed.
+	 */ 
+1:
+	ldarx	r31,0,r6
+	/* Check access rights (access & ~(pte_val(*ptep))) */
+	andc.	r0,r4,r31
+	bne-	htab_wrong_access
+	/* Check if PTE is busy */
+	andi.	r0,r31,_PAGE_BUSY
+	bne-	1b
+	/* Prepare new PTE value (turn access RW into DIRTY, then
+	 * add BUSY,HASHPTE and ACCESSED)
+	 */
+	rlwinm	r30,r4,5,24,24	/* _PAGE_RW -> _PAGE_DIRTY */
+	or	r30,r30,r31
+	ori	r30,r30,_PAGE_BUSY | _PAGE_ACCESSED | _PAGE_HASHPTE
+	/* Write the linux PTE atomically (setting busy) */
+	stdcx.	r30,0,r6
+	bne-	1b
+	
+
+	/* Step 2:
+	 *
+	 * Insert/Update the HPTE in the hash table. At this point,
+	 * r4 (access) is re-useable, we use it for the new HPTE flags
+	 */
+
+	/* Calc va and put it in r29 */
+	rldicr	r29,r5,28,63-28
+	rldicl	r3,r3,0,36
+	or	r29,r3,r29
+
+	/* Calculate hash value for primary slot and store it in r28 */
+	rldicl	r5,r5,0,25		/* vsid & 0x0000007fffffffff */
+	rldicl	r0,r3,64-12,48		/* (ea >> 12) & 0xffff */
+	xor	r28,r5,r0
+	
+	/* Convert linux PTE bits into HW equivalents
+	 */
+	andi.	r3,r30,0x1fa		/* Get basic set of flags */
+	rlwinm	r0,r30,32-2+1,30,30	/* _PAGE_RW -> _PAGE_USER (r0) */
+	rlwinm	r4,r30,32-7+1,30,30	/* _PAGE_DIRTY -> _PAGE_USER (r4) */
+	and	r0,r0,r4		/* _PAGE_RW & _PAGE_DIRTY -> r0 bit 30 */
+	andc	r0,r30,r0		/* r0 = pte & ~r0 */
+	rlwimi	r3,r0,32-1,31,31	/* Insert result into PP lsb */
+
+	/* We eventually do the icache sync here (maybe inline that
+	 * code rather than call a C function...) 
+	 */
+BEGIN_FTR_SECTION
+	mr	r4,r30
+	mr	r5,r7
+	bl	.hash_page_do_lazy_icache
+END_FTR_SECTION_IFSET(CPU_FTR_NOEXECUTE)
+
+	/* At this point, r3 contains new PP bits, save them in
+	 * place of "access" in the param area (sic)
+	 */
+	std	r3,STK_PARM(r4)(r1)
+
+	/* Get htab_hash_mask */
+	ld	r4,htab_data@got(2)
+	ld	r27,16(r4)	/* htab_data.htab_hash_mask -> r27 */
+
+	/* Check if we may already be in the hashtable, in this case, we
+	 * go to out-of-line code to try to modify the HPTE
+	 */
+	andi.	r0,r31,_PAGE_HASHPTE
+	bne	htab_modify_pte
+
+htab_insert_pte:
+	/* Clear hpte bits in new pte (we also clear BUSY btw) and
+	 * add _PAGE_HASHPTE
+	 */
+	lis	r0,_PAGE_HPTEFLAGS@h
+	ori	r0,r0,_PAGE_HPTEFLAGS@l
+	andc	r30,r30,r0
+	ori	r30,r30,_PAGE_HASHPTE
+
+	/* page number in r5 */
+	rldicl	r5,r31,64-PTE_SHIFT,PTE_SHIFT
+
+	/* Calculate primary group hash */
+	and	r0,r28,r27
+	rldicr	r3,r0,3,63-3	/* r0 = (hash & mask) << 3 */
+
+	/* Call ppc_md.hpte_insert */
+	ld	r7,STK_PARM(r4)(r1)	/* Retreive new pp bits */
+	mr	r4,r29			/* Retreive va */
+	li	r6,0			/* primary slot */
+	li	r8,0			/* not bolted and not large */
+	li	r9,0
+_GLOBAL(htab_call_hpte_insert1)
+	bl	.			/* Will be patched by htab_finish_init() */
+	cmpi	0,r3,0
+	bge	htab_pte_insert_ok	/* Insertion successful */
+	cmpi	0,r3,-2			/* Critical failure */
+	beq-	htab_pte_insert_failure
+
+	/* Now try secondary slot */
+	ori	r30,r30,_PAGE_SECONDARY
+	
+	/* page number in r5 */
+	rldicl	r5,r31,64-PTE_SHIFT,PTE_SHIFT
+
+	/* Calculate secondary group hash */
+	andc	r0,r27,r28
+	rldicr	r3,r0,3,63-3	/* r0 = (~hash & mask) << 3 */
+	
+	/* Call ppc_md.hpte_insert */
+	ld	r7,STK_PARM(r4)(r1)	/* Retreive new pp bits */
+	mr	r4,r29			/* Retreive va */
+	li	r6,1			/* secondary slot */
+	li	r8,0			/* not bolted and not large */
+	li	r9,0
+_GLOBAL(htab_call_hpte_insert2)
+	bl	.			/* Will be patched by htab_finish_init() */
+	cmpi	0,r3,0
+	bge+	htab_pte_insert_ok	/* Insertion successful */
+	cmpi	0,r3,-2			/* Critical failure */
+	beq-	htab_pte_insert_failure
+
+	/* Both are full, we need to evict something */
+	mftb	r0
+	/* Pick a random group based on TB */
+	andi.	r0,r0,1
+	mr	r5,r28
+	bne	2f
+	not	r5,r5
+2:	and	r0,r5,r27
+	rldicr	r3,r0,3,63-3	/* r0 = (hash & mask) << 3 */	
+	/* Call ppc_md.hpte_remove */
+_GLOBAL(htab_call_hpte_remove)
+	bl	.			/* Will be patched by htab_finish_init() */
+
+	/* Try all again */
+	b	htab_insert_pte	
+
+htab_pte_insert_ok:
+	/* Insert slot number in PTE */
+	rldimi	r30,r3,12,63-14
+		
+	/* Write out the PTE with a normal write
+	 * (maybe add eieio may be good still ?)
+	 */
+htab_write_out_pte:
+	ld	r6,STK_PARM(r6)(r1)
+	std	r30,0(r6)
+	li	r3, 0
+bail:
+	ld	r27,STK_REG(r27)(r1)
+	ld	r28,STK_REG(r28)(r1)
+	ld	r29,STK_REG(r29)(r1)
+	ld      r30,STK_REG(r30)(r1)
+	ld      r31,STK_REG(r31)(r1)
+	addi    r1,r1,STACKFRAMESIZE
+	ld      r0,16(r1)
+	mtlr    r0
+	blr
+
+htab_modify_pte:
+	/* Keep PP bits in r4 and slot idx from the PTE around in r3 */
+	mr	r4,r3
+	rlwinm	r3,r31,32-12,29,31
+
+	/* Secondary group ? if yes, get a inverted hash value */
+	mr	r5,r28
+	andi.	r0,r31,_PAGE_SECONDARY
+	beq	1f
+	not	r5,r5
+1:
+	/* Calculate proper slot value for ppc_md.hpte_updatepp */
+	and	r0,r5,r27
+	rldicr	r0,r0,3,63-3	/* r0 = (hash & mask) << 3 */
+	add	r3,r0,r3	/* add slot idx */
+
+	/* Call ppc_md.hpte_updatepp */
+	mr	r5,r29			/* va */
+	li	r6,0			/* large is 0 */
+	ld	r7,STK_PARM(r8)(r1)	/* get "local" param */
+_GLOBAL(htab_call_hpte_updatepp)
+	bl	.			/* Will be patched by htab_finish_init() */
+
+	/* if we failed because typically the HPTE wasn't really here
+	 * we try an insertion. 
+	 */
+	cmpi	0,r3,-1
+	beq-	htab_insert_pte
+
+	/* Clear the BUSY bit and Write out the PTE */
+	li	r0,_PAGE_BUSY
+	andc	r30,r30,r0
+	b	htab_write_out_pte
+
+htab_wrong_access:
+	/* Bail out clearing reservation */
+	stdcx.	r31,0,r6
+	li	r3,1
+	b	bail
+
+htab_pte_insert_failure:
+	b	.htab_insert_failure
+
+
diff -Nru a/arch/ppc64/mm/hash_utils.c b/arch/ppc64/mm/hash_utils.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/ppc64/mm/hash_utils.c	Tue Feb  3 19:45:29 2004
@@ -0,0 +1,358 @@
+/*
+ * PowerPC64 port by Mike Corrigan and Dave Engebretsen
+ *   {mikejc|engebret}@us.ibm.com
+ *
+ *    Copyright (c) 2000 Mike Corrigan <mikejc@us.ibm.com>
+ *
+ * SMP scalability work:
+ *    Copyright (C) 2001 Anton Blanchard <anton@au.ibm.com>, IBM
+ * 
+ *    Module name: htab.c
+ *
+ *    Description:
+ *      PowerPC Hashed Page Table functions
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/config.h>
+#include <linux/spinlock.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/proc_fs.h>
+#include <linux/stat.h>
+#include <linux/sysctl.h>
+#include <linux/ctype.h>
+#include <linux/cache.h>
+#include <linux/init.h>
+
+#include <asm/ppcdebug.h>
+#include <asm/processor.h>
+#include <asm/pgtable.h>
+#include <asm/mmu.h>
+#include <asm/mmu_context.h>
+#include <asm/page.h>
+#include <asm/types.h>
+#include <asm/system.h>
+#include <asm/uaccess.h>
+#include <asm/naca.h>
+#include <asm/pmc.h>
+#include <asm/machdep.h>
+#include <asm/lmb.h>
+#include <asm/abs_addr.h>
+#include <asm/tlbflush.h>
+#include <asm/io.h>
+#include <asm/eeh.h>
+#include <asm/tlb.h>
+#include <asm/cacheflush.h>
+#include <asm/cputable.h>
+/*
+ * Note:  pte   --> Linux PTE
+ *        HPTE  --> PowerPC Hashed Page Table Entry
+ *
+ * Execution context:
+ *   htab_initialize is called with the MMU off (of course), but
+ *   the kernel has been copied down to zero so it can directly
+ *   reference global data.  At this point it is very difficult
+ *   to print debug info.
+ *
+ */
+
+HTAB htab_data = {NULL, 0, 0, 0, 0};
+
+extern unsigned long _SDR1;
+
+#define KB (1024)
+#define MB (1024*KB)
+
+static inline void loop_forever(void)
+{
+	volatile unsigned long x = 1;
+	for(;x;x|=1)
+		;
+}
+
+#ifdef CONFIG_PPC_PSERIES
+static inline void create_pte_mapping(unsigned long start, unsigned long end,
+				      unsigned long mode, int large)
+{
+	unsigned long addr;
+	unsigned int step;
+
+	if (large)
+		step = 16*MB;
+	else
+		step = 4*KB;
+
+	for (addr = start; addr < end; addr += step) {
+		unsigned long vpn, hash, hpteg;
+		unsigned long vsid = get_kernel_vsid(addr);
+		unsigned long va = (vsid << 28) | (addr & 0xfffffff);
+		int ret;
+
+		if (large)
+			vpn = va >> LARGE_PAGE_SHIFT;
+		else
+			vpn = va >> PAGE_SHIFT;
+
+		hash = hpt_hash(vpn, large);
+
+		hpteg = ((hash & htab_data.htab_hash_mask)*HPTES_PER_GROUP);
+
+		if (systemcfg->platform == PLATFORM_PSERIES_LPAR)
+			ret = pSeries_lpar_hpte_insert(hpteg, va,
+				(unsigned long)__v2a(addr) >> PAGE_SHIFT,
+				0, mode, 1, large);
+		else
+			ret = pSeries_hpte_insert(hpteg, va,
+				(unsigned long)__v2a(addr) >> PAGE_SHIFT,
+				0, mode, 1, large);
+
+		if (ret == -1) {
+			ppc64_terminate_msg(0x20, "create_pte_mapping");
+			loop_forever();
+		}
+	}
+}
+
+void __init htab_initialize(void)
+{
+	unsigned long table, htab_size_bytes;
+	unsigned long pteg_count;
+	unsigned long mode_rw;
+
+	/*
+	 * Calculate the required size of the htab.  We want the number of
+	 * PTEGs to equal one half the number of real pages.
+	 */ 
+	htab_size_bytes = 1UL << naca->pftSize;
+	pteg_count = htab_size_bytes >> 7;
+
+	/* For debug, make the HTAB 1/8 as big as it normally would be. */
+	ifppcdebug(PPCDBG_HTABSIZE) {
+		pteg_count >>= 3;
+		htab_size_bytes = pteg_count << 7;
+	}
+
+	htab_data.htab_num_ptegs = pteg_count;
+	htab_data.htab_hash_mask = pteg_count - 1;
+
+	if (systemcfg->platform == PLATFORM_PSERIES) {
+		/* Find storage for the HPT.  Must be contiguous in
+		 * the absolute address space.
+		 */
+		table = lmb_alloc(htab_size_bytes, htab_size_bytes);
+		if ( !table ) {
+			ppc64_terminate_msg(0x20, "hpt space");
+			loop_forever();
+		}
+		htab_data.htab = (HPTE *)__a2v(table);
+
+		/* htab absolute addr + encoded htabsize */
+		_SDR1 = table + __ilog2(pteg_count) - 11;
+
+		/* Initialize the HPT with no entries */
+		memset((void *)table, 0, htab_size_bytes);
+	} else {
+		/* Using a hypervisor which owns the htab */
+		htab_data.htab = NULL;
+		_SDR1 = 0; 
+	}
+
+	mode_rw = _PAGE_ACCESSED | _PAGE_COHERENT | PP_RWXX;
+
+	/* XXX we currently map kernel text rw, should fix this */
+	if ((cur_cpu_spec->cpu_features & CPU_FTR_16M_PAGE)
+	    && systemcfg->physicalMemorySize > 256*MB) {
+		create_pte_mapping((unsigned long)KERNELBASE, 
+				   KERNELBASE + 256*MB, mode_rw, 0);
+		create_pte_mapping((unsigned long)KERNELBASE + 256*MB, 
+				   KERNELBASE + (systemcfg->physicalMemorySize), 
+				   mode_rw, 1);
+	} else {
+		create_pte_mapping((unsigned long)KERNELBASE, 
+				   KERNELBASE+(systemcfg->physicalMemorySize), 
+				   mode_rw, 0);
+	}
+}
+#undef KB
+#undef MB
+#endif
+
+/*
+ * Called by asm hashtable.S for doing lazy icache flush
+ */
+unsigned int hash_page_do_lazy_icache(unsigned int pp, pte_t pte, int trap)
+{
+	struct page *page;
+
+#define PPC64_HWNOEXEC (1 << 2)
+
+	if (!pfn_valid(pte_pfn(pte)))
+		return pp;
+
+	page = pte_page(pte);
+
+	/* page is dirty */
+	if (!test_bit(PG_arch_1, &page->flags) && !PageReserved(page)) {
+		if (trap == 0x400) {
+			__flush_dcache_icache(page_address(page));
+			set_bit(PG_arch_1, &page->flags);
+		} else
+			pp |= PPC64_HWNOEXEC;
+	}
+	return pp;
+}
+
+/*
+ * Called by asm hashtable.S in case of critical insert failure
+ */
+void htab_insert_failure(void)
+{
+	panic("hash_page: pte_insert failed\n");
+}
+
+int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
+{
+	void *pgdir;
+	unsigned long vsid;
+	struct mm_struct *mm;
+	pte_t *ptep;
+	int ret;
+	int user_region = 0;
+	int local = 0;
+	cpumask_t tmp;
+
+	/* Check for invalid addresses. */
+	if (!IS_VALID_EA(ea))
+		return 1;
+
+ 	switch (REGION_ID(ea)) {
+	case USER_REGION_ID:
+		user_region = 1;
+		mm = current->mm;
+		if (mm == NULL)
+			return 1;
+
+		vsid = get_vsid(mm->context, ea);
+		break;
+	case IO_REGION_ID:
+		mm = &ioremap_mm;
+		vsid = get_kernel_vsid(ea);
+		break;
+	case VMALLOC_REGION_ID:
+		mm = &init_mm;
+		vsid = get_kernel_vsid(ea);
+		break;
+#if 0
+	case EEH_REGION_ID:
+		/*
+		 * Should only be hit if there is an access to MMIO space
+		 * which is protected by EEH.
+		 * Send the problem up to do_page_fault 
+		 */
+	case KERNEL_REGION_ID:
+		/*
+		 * Should never get here - entire 0xC0... region is bolted.
+		 * Send the problem up to do_page_fault 
+		 */
+#endif
+	default:
+		/* Not a valid range
+		 * Send the problem up to do_page_fault 
+		 */
+		return 1;
+		break;
+	}
+
+	pgdir = mm->pgd;
+
+	if (pgdir == NULL)
+		return 1;
+
+	tmp = cpumask_of_cpu(smp_processor_id());
+	if (user_region && cpus_equal(mm->cpu_vm_mask, tmp))
+		local = 1;
+
+	/* Is this a huge page ? */
+	if (unlikely(in_hugepage_area(mm->context, ea)))
+		ret = hash_huge_page(mm, access, ea, vsid, local);
+	else {
+		ptep = find_linux_pte(pgdir, ea);
+		if (ptep == NULL)
+			return 1;
+		ret = __hash_page(ea, access, vsid, ptep, trap, local);
+	}
+
+
+	return ret;
+}
+
+void flush_hash_page(unsigned long context, unsigned long ea, pte_t pte,
+		     int local)
+{
+	unsigned long vsid, vpn, va, hash, secondary, slot;
+
+	/* XXX fix for large ptes */
+	unsigned long large = 0;
+
+	if ((ea >= USER_START) && (ea <= USER_END))
+		vsid = get_vsid(context, ea);
+	else
+		vsid = get_kernel_vsid(ea);
+
+	va = (vsid << 28) | (ea & 0x0fffffff);
+	if (large)
+		vpn = va >> LARGE_PAGE_SHIFT;
+	else
+		vpn = va >> PAGE_SHIFT;
+	hash = hpt_hash(vpn, large);
+	secondary = (pte_val(pte) & _PAGE_SECONDARY) >> 15;
+	if (secondary)
+		hash = ~hash;
+	slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP;
+	slot += (pte_val(pte) & _PAGE_GROUP_IX) >> 12;
+
+	ppc_md.hpte_invalidate(slot, va, large, local);
+}
+
+void flush_hash_range(unsigned long context, unsigned long number, int local)
+{
+	if (ppc_md.flush_hash_range) {
+		ppc_md.flush_hash_range(context, number, local);
+	} else {
+		int i;
+		struct ppc64_tlb_batch *batch =
+			&ppc64_tlb_batch[smp_processor_id()];
+
+		for (i = 0; i < number; i++)
+			flush_hash_page(context, batch->addr[i], batch->pte[i],
+					local);
+	}
+}
+
+static inline void make_bl(unsigned int *insn_addr, void *func)
+{
+	unsigned long funcp = *((unsigned long *)func);
+	int offset = funcp - (unsigned long)insn_addr;
+
+	*insn_addr = (unsigned int)(0x48000001 | (offset & 0x03fffffc));
+	flush_icache_range((unsigned long)insn_addr, 4+
+			   (unsigned long)insn_addr);
+}
+
+void __init htab_finish_init(void)
+{
+	extern unsigned int *htab_call_hpte_insert1;
+	extern unsigned int *htab_call_hpte_insert2;
+	extern unsigned int *htab_call_hpte_remove;
+	extern unsigned int *htab_call_hpte_updatepp;
+
+	make_bl(htab_call_hpte_insert1, ppc_md.hpte_insert);
+	make_bl(htab_call_hpte_insert2, ppc_md.hpte_insert);
+	make_bl(htab_call_hpte_remove, ppc_md.hpte_remove);
+	make_bl(htab_call_hpte_updatepp, ppc_md.hpte_updatepp);
+}
diff -Nru a/arch/ppc64/mm/hugetlbpage.c b/arch/ppc64/mm/hugetlbpage.c
--- a/arch/ppc64/mm/hugetlbpage.c	Tue Feb  3 19:45:26 2004
+++ b/arch/ppc64/mm/hugetlbpage.c	Tue Feb  3 19:45:26 2004
@@ -7,7 +7,6 @@
  * Copyright (C) 2002, Rohit Seth <rohit.seth@intel.com>
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
@@ -652,17 +651,12 @@
 	unsigned long va, vpn;
 	int is_write;
 	hugepte_t old_pte, new_pte;
-	unsigned long hpteflags, prpn;
+	unsigned long hpteflags, prpn, flags;
 	long slot;
 
-	/* Is this for us? */
-	if (!in_hugepage_area(mm->context, ea))
-		return -1;
-
-	ea &= ~(HPAGE_SIZE-1);
-
 	/* We have to find the first hugepte in the batch, since
 	 * that's the one that will store the HPTE flags */
+	ea &= HPAGE_MASK;
 	ptep = hugepte_offset(mm, ea);
 
 	/* Search the Linux page table for a match with va */
@@ -698,6 +692,8 @@
 	 *	page is currently not DIRTY. 
 	 */
 
+	spin_lock_irqsave(&mm->page_table_lock, flags);
+
 	old_pte = *ptep;
 	new_pte = old_pte;
 
@@ -769,6 +765,8 @@
 		*ptep = new_pte;
 	}
 
+	spin_unlock_irqrestore(&mm->page_table_lock, flags);
+
 	return 0;
 }
 
@@ -886,10 +884,11 @@
 			spin_unlock(&htlbpage_lock);
 		}
 		htlbpage_max = htlbpage_free = htlbpage_total = i;
-		printk("Total HugeTLB memory allocated, %d\n", htlbpage_free);
+		printk(KERN_INFO "Total HugeTLB memory allocated, %d\n",
+		       htlbpage_free);
 	} else {
 		htlbpage_max = 0;
-		printk("CPU does not support HugeTLB\n");
+		printk(KERN_INFO "CPU does not support HugeTLB\n");
 	}
 
 	return 0;
diff -Nru a/arch/ppc64/mm/imalloc.c b/arch/ppc64/mm/imalloc.c
--- a/arch/ppc64/mm/imalloc.c	Tue Feb  3 19:45:17 2004
+++ b/arch/ppc64/mm/imalloc.c	Tue Feb  3 19:45:17 2004
@@ -18,55 +18,264 @@
 rwlock_t imlist_lock = RW_LOCK_UNLOCKED;
 struct vm_struct * imlist = NULL;
 
-struct vm_struct *get_im_area(unsigned long size)
+static int get_free_im_addr(unsigned long size, unsigned long *im_addr)
 {
 	unsigned long addr;
-	struct vm_struct **p, *tmp, *area;
-  
-	area = (struct vm_struct *) kmalloc(sizeof(*area), GFP_KERNEL);
-	if (!area)
-		return NULL;
+	struct vm_struct **p, *tmp;
+
 	addr = IMALLOC_START;
-	write_lock(&imlist_lock);
 	for (p = &imlist; (tmp = *p) ; p = &tmp->next) {
 		if (size + addr < (unsigned long) tmp->addr)
 			break;
-		addr = tmp->size + (unsigned long) tmp->addr;
-		if (addr > IMALLOC_END-size) {
-			write_unlock(&imlist_lock);
-			kfree(area);
+		if ((unsigned long)tmp->addr >= IMALLOC_START) 
+			addr = tmp->size + (unsigned long) tmp->addr;
+		if (addr > IMALLOC_END-size) 
+			return 1;
+	}
+	*im_addr = addr;
+
+	return 0;
+}
+
+/* Return whether the region described by v_addr and size overlaps
+ * the region described by vm.  Overlapping regions meet the 
+ * following conditions:
+ * 1) The regions share some part of the address space
+ * 2) The regions aren't identical
+ * 3) The first region is not a subset of the second
+ */
+static inline int im_region_overlaps(unsigned long v_addr, unsigned long size,
+		     struct vm_struct *vm)
+{
+	return (v_addr + size > (unsigned long) vm->addr + vm->size &&
+		v_addr < (unsigned long) vm->addr + vm->size) ||
+	       (v_addr < (unsigned long) vm->addr &&
+		v_addr + size > (unsigned long) vm->addr);
+}
+
+/* Return whether the region described by v_addr and size is a subset
+ * of the region described by vm
+ */
+static inline int im_region_is_subset(unsigned long v_addr, unsigned long size,
+			struct vm_struct *vm)
+{
+	return (int) (v_addr >= (unsigned long) vm->addr && 
+	              v_addr < (unsigned long) vm->addr + vm->size &&
+	    	      size < vm->size);
+}
+
+/* Determine imalloc status of region described by v_addr and size.
+ * Can return one of the following:
+ * IM_REGION_UNUSED   -  Entire region is unallocated in imalloc space.
+ * IM_REGION_SUBSET -    Region is a subset of a region that is already
+ * 			 allocated in imalloc space.
+ * 		         vm will be assigned to a ptr to the parent region.
+ * IM_REGION_EXISTS -    Exact region already allocated in imalloc space.
+ *                       vm will be assigned to a ptr to the existing imlist
+ *                       member.
+ * IM_REGION_OVERLAPS -  A portion of the region is already allocated in 
+ *                       imalloc space.
+ */
+static int im_region_status(unsigned long v_addr, unsigned long size, 
+		    struct vm_struct **vm)
+{
+	struct vm_struct *tmp;
+
+	for (tmp = imlist; tmp; tmp = tmp->next) 
+		if (v_addr < (unsigned long) tmp->addr + tmp->size) 
+			break;
+					
+	if (tmp) {
+		if (im_region_overlaps(v_addr, size, tmp))
+			return IM_REGION_OVERLAP;
+
+		*vm = tmp;
+		if (im_region_is_subset(v_addr, size, tmp))
+			return IM_REGION_SUBSET;
+		else if (v_addr == (unsigned long) tmp->addr && 
+		 	 size == tmp->size) 
+			return IM_REGION_EXISTS;
+	}
+
+	*vm = NULL;
+	return IM_REGION_UNUSED;
+}
+
+static struct vm_struct * split_im_region(unsigned long v_addr, 
+		unsigned long size, struct vm_struct *parent)
+{
+	struct vm_struct *vm1 = NULL;
+	struct vm_struct *vm2 = NULL;
+	struct vm_struct *new_vm = NULL;
+	
+	vm1 = (struct vm_struct *) kmalloc(sizeof(*vm1), GFP_KERNEL);
+	if (vm1	== NULL) {
+		printk(KERN_ERR "%s() out of memory\n", __FUNCTION__);
+		return NULL;
+	}
+
+	if (v_addr == (unsigned long) parent->addr) {
+	        /* Use existing parent vm_struct to represent child, allocate
+		 * new one for the remainder of parent range
+		 */
+		vm1->size = parent->size - size;
+		vm1->addr = (void *) (v_addr + size);
+		vm1->next = parent->next;
+
+		parent->size = size;
+		parent->next = vm1;
+		new_vm = parent;
+	} else if (v_addr + size == (unsigned long) parent->addr + 
+			parent->size) {
+		/* Allocate new vm_struct to represent child, use existing
+		 * parent one for remainder of parent range
+		 */
+		vm1->size = size;
+		vm1->addr = (void *) v_addr;
+		vm1->next = parent->next;
+		new_vm = vm1;
+
+		parent->size -= size;
+		parent->next = vm1;
+	} else {
+	        /* Allocate two new vm_structs for the new child and 
+		 * uppermost remainder, and use existing parent one for the
+		 * lower remainder of parent range
+		 */
+		vm2 = (struct vm_struct *) kmalloc(sizeof(*vm2), GFP_KERNEL);
+		if (vm2 == NULL) {
+			printk(KERN_ERR "%s() out of memory\n", __FUNCTION__);
+			kfree(vm1);
 			return NULL;
 		}
+
+		vm1->size = size;
+		vm1->addr = (void *) v_addr;
+		vm1->next = vm2;
+		new_vm = vm1;
+
+		vm2->size = ((unsigned long) parent->addr + parent->size) - 
+				(v_addr + size);
+		vm2->addr = (void *) v_addr + size;
+		vm2->next = parent->next;
+
+		parent->size = v_addr - (unsigned long) parent->addr;
+		parent->next = vm1;
 	}
+
+	return new_vm;
+}
+
+static struct vm_struct * __add_new_im_area(unsigned long req_addr, 
+					    unsigned long size)
+{
+	struct vm_struct **p, *tmp, *area;
+		
+	for (p = &imlist; (tmp = *p) ; p = &tmp->next) {
+		if (req_addr + size <= (unsigned long)tmp->addr)
+			break;
+	}
+	
+	area = (struct vm_struct *) kmalloc(sizeof(*area), GFP_KERNEL);
+	if (!area)
+		return NULL;
 	area->flags = 0;
-	area->addr = (void *)addr;
+	area->addr = (void *)req_addr;
 	area->size = size;
 	area->next = *p;
 	*p = area;
+
+	return area;
+}
+
+static struct vm_struct * __im_get_area(unsigned long req_addr, 
+					unsigned long size,
+					int criteria)
+{
+	struct vm_struct *tmp;
+	int status;
+
+	status = im_region_status(req_addr, size, &tmp);
+	if ((criteria & status) == 0) {
+		return NULL;
+	}
+	
+	switch (status) {
+	case IM_REGION_UNUSED:
+		tmp = __add_new_im_area(req_addr, size);
+		break;
+	case IM_REGION_SUBSET:
+		tmp = split_im_region(req_addr, size, tmp);
+		break;
+	case IM_REGION_EXISTS:
+		break;
+	default:
+		printk(KERN_ERR "%s() unexpected imalloc region status\n",
+				__FUNCTION__);
+		tmp = NULL;
+	}
+
+	return tmp;
+}
+
+struct vm_struct * im_get_free_area(unsigned long size)
+{
+	struct vm_struct *area;
+	unsigned long addr;
+	
+	write_lock(&imlist_lock);
+	if (get_free_im_addr(size, &addr)) {
+		printk(KERN_ERR "%s() cannot obtain addr for size 0x%lx\n",
+				__FUNCTION__, size);
+		area = NULL;
+		goto next_im_done;
+	}
+
+	area = __im_get_area(addr, size, IM_REGION_UNUSED);
+	if (area == NULL) {
+		printk(KERN_ERR 
+		       "%s() cannot obtain area for addr 0x%lx size 0x%lx\n",
+			__FUNCTION__, addr, size);
+	}
+next_im_done:
 	write_unlock(&imlist_lock);
 	return area;
 }
 
-void ifree(void * addr)
+struct vm_struct * im_get_area(unsigned long v_addr, unsigned long size,
+		int criteria)
+{
+	struct vm_struct *area;
+
+	write_lock(&imlist_lock);
+	area = __im_get_area(v_addr, size, criteria);
+	write_unlock(&imlist_lock);
+	return area;
+}
+
+unsigned long im_free(void * addr)
 {
 	struct vm_struct **p, *tmp;
+	unsigned long ret_size = 0;
   
 	if (!addr)
-		return;
+		return ret_size;
 	if ((PAGE_SIZE-1) & (unsigned long) addr) {
-		printk(KERN_ERR "Trying to ifree() bad address (%p)\n", addr);
-		return;
+		printk(KERN_ERR "Trying to %s bad address (%p)\n", __FUNCTION__,			addr);
+		return ret_size;
 	}
 	write_lock(&imlist_lock);
 	for (p = &imlist ; (tmp = *p) ; p = &tmp->next) {
 		if (tmp->addr == addr) {
+			ret_size = tmp->size;
 			*p = tmp->next;
 			kfree(tmp);
 			write_unlock(&imlist_lock);
-			return;
+			return ret_size;
 		}
 	}
 	write_unlock(&imlist_lock);
-	printk(KERN_ERR "Trying to ifree() nonexistent area (%p)\n", addr);
+	printk(KERN_ERR "Trying to %s nonexistent area (%p)\n", __FUNCTION__,
+			addr);
+	return ret_size;
 }
-
diff -Nru a/arch/ppc64/mm/init.c b/arch/ppc64/mm/init.c
--- a/arch/ppc64/mm/init.c	Tue Feb  3 19:45:29 2004
+++ b/arch/ppc64/mm/init.c	Tue Feb  3 19:45:29 2004
@@ -67,6 +67,7 @@
 struct mmu_context_queue_t mmu_context_queue;
 int mem_init_done;
 unsigned long ioremap_bot = IMALLOC_BASE;
+static unsigned long phbs_io_bot = PHBS_IO_BASE;
 
 extern pgd_t swapper_pg_dir[];
 extern struct task_struct *current_set[NR_CPUS];
@@ -74,6 +75,9 @@
 extern pgd_t ioremap_dir[];
 pgd_t * ioremap_pgd = (pgd_t *)&ioremap_dir;
 
+static void * __ioremap_com(unsigned long addr, unsigned long pa, 
+			    unsigned long ea, unsigned long size, 
+			    unsigned long flags);
 static void map_io_page(unsigned long va, unsigned long pa, int flags);
 
 unsigned long klimit = (unsigned long)_end;
@@ -90,6 +94,52 @@
  * include/asm-ppc64/tlb.h file -- tgall
  */
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
+DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur);
+unsigned long pte_freelist_forced_free;
+
+static void pte_free_smp_sync(void *arg)
+{
+	/* Do nothing, just ensure we sync with all CPUs */
+}
+
+/* This is only called when we are critically out of memory
+ * (and fail to get a page in pte_free_tlb).
+ */
+void pte_free_now(struct page *ptepage)
+{
+	pte_freelist_forced_free++;
+
+	smp_call_function(pte_free_smp_sync, NULL, 0, 1);
+
+	pte_free(ptepage);
+}
+
+static void pte_free_rcu_callback(void *arg)
+{
+	struct pte_freelist_batch *batch = arg;
+	unsigned int i;
+
+	for (i = 0; i < batch->index; i++)
+		pte_free(batch->pages[i]);
+	free_page((unsigned long)batch);
+}
+
+void pte_free_submit(struct pte_freelist_batch *batch)
+{
+	INIT_RCU_HEAD(&batch->rcu);
+	call_rcu(&batch->rcu, pte_free_rcu_callback, batch);
+}
+
+void pte_free_finish(void)
+{
+	/* This is safe as we are holding page_table_lock */
+	struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur);
+	
+	if (*batchp == NULL)
+		return;
+	pte_free_submit(*batchp);
+	*batchp = NULL;
+}
 
 void show_mem(void)
 {
@@ -133,12 +183,10 @@
 #endif
 }
 
-extern struct vm_struct * get_im_area( unsigned long size );
-
 void *
 __ioremap(unsigned long addr, unsigned long size, unsigned long flags)
 {
-	unsigned long pa, ea, i;
+	unsigned long pa, ea;
 
 	/*
 	 * Choose an address to map it to.
@@ -157,26 +205,163 @@
 
 	if (mem_init_done) {
 		struct vm_struct *area;
-		area = get_im_area(size);
-		if (area == 0)
+		area = im_get_free_area(size);
+		if (area == NULL)
 			return NULL;
 		ea = (unsigned long)(area->addr);
-	} 
-	else {
+	} else {
 		ea = ioremap_bot;
 		ioremap_bot += size;
 	}
 
-	if ((flags & _PAGE_PRESENT) == 0)
-		flags |= pgprot_val(PAGE_KERNEL);
-	if (flags & (_PAGE_NO_CACHE | _PAGE_WRITETHRU))
-		flags |= _PAGE_GUARDED;
+	return __ioremap_com(addr, pa, ea, size, flags);
+}
 
-	for (i = 0; i < size; i += PAGE_SIZE) {
-		map_io_page(ea+i, pa+i, flags);
+#define IS_PAGE_ALIGNED(_val) ((_val) == ((_val) & PAGE_MASK))
+
+int __ioremap_explicit(unsigned long pa, unsigned long ea,
+		       unsigned long size, unsigned long flags)
+{
+	struct vm_struct *area;
+	
+	/* For now, require page-aligned values for pa, ea, and size */
+	if (!IS_PAGE_ALIGNED(pa) || !IS_PAGE_ALIGNED(ea) ||
+	    !IS_PAGE_ALIGNED(size)) {
+		printk(KERN_ERR	"unaligned value in %s\n", __FUNCTION__);
+		return 1;
+	}
+	
+	if (!mem_init_done) {
+		/* Two things to consider in this case:
+		 * 1) No records will be kept (imalloc, etc) that the region
+		 *    has been remapped
+		 * 2) It won't be easy to iounmap() the region later (because
+		 *    of 1)
+		 */
+		;
+	} else {
+		area = im_get_area(ea, size, IM_REGION_UNUSED|IM_REGION_SUBSET);
+		if (area == NULL) {
+			printk(KERN_ERR "could not obtain imalloc area for ea 0x%lx\n", ea);
+			return 1;
+		}
+		if (ea != (unsigned long) area->addr) {
+			printk(KERN_ERR "unexpected addr return from im_get_area\n");
+			return 1;
+		}
+	}
+	
+	if (__ioremap_com(pa, pa, ea, size, flags) != (void *) ea) {
+		printk(KERN_ERR "__ioremap_com() returned unexpected addr\n");
+		return 1;
 	}
 
-	return (void *) (ea + (addr & ~PAGE_MASK));
+	return 0;
+}
+
+static void unmap_im_area_pte(pmd_t *pmd, unsigned long address,
+				  unsigned long size)
+{
+	unsigned long end;
+	pte_t *pte;
+
+	if (pmd_none(*pmd))
+		return;
+	if (pmd_bad(*pmd)) {
+		pmd_ERROR(*pmd);
+		pmd_clear(pmd);
+		return;
+	}
+
+	pte = pte_offset_kernel(pmd, address);
+	address &= ~PMD_MASK;
+	end = address + size;
+	if (end > PMD_SIZE)
+		end = PMD_SIZE;
+
+	do {
+		pte_t page;
+		page = ptep_get_and_clear(pte);
+		address += PAGE_SIZE;
+		pte++;
+		if (pte_none(page))
+			continue;
+		if (pte_present(page))
+			continue;
+		printk(KERN_CRIT "Whee.. Swapped out page in kernel page table\n");
+	} while (address < end);
+}
+
+static void unmap_im_area_pmd(pgd_t *dir, unsigned long address,
+				  unsigned long size)
+{
+	unsigned long end;
+	pmd_t *pmd;
+
+	if (pgd_none(*dir))
+		return;
+	if (pgd_bad(*dir)) {
+		pgd_ERROR(*dir);
+		pgd_clear(dir);
+		return;
+	}
+
+	pmd = pmd_offset(dir, address);
+	address &= ~PGDIR_MASK;
+	end = address + size;
+	if (end > PGDIR_SIZE)
+		end = PGDIR_SIZE;
+
+	do {
+		unmap_im_area_pte(pmd, address, end - address);
+		address = (address + PMD_SIZE) & PMD_MASK;
+		pmd++;
+	} while (address < end);
+}
+
+/*  
+ * Unmap an IO region and remove it from imalloc'd list.
+ * Access to IO memory should be serialized by driver.
+ * This code is modeled after vmalloc code - unmap_vm_area()
+ *
+ * XXX	what about calls before mem_init_done (ie python_countermeasures())	
+ */
+void pSeries_iounmap(void *addr)
+{
+	unsigned long address, start, end, size;
+	struct mm_struct *mm;
+	pgd_t *dir;
+
+	if (!mem_init_done) {
+		return;
+	}
+	
+	/* addr could be in EEH or IO region, map it to IO region regardless.
+	 */
+	addr = (void *) (IO_TOKEN_TO_ADDR(addr) & PAGE_MASK);
+	
+	if ((size = im_free(addr)) == 0) {
+		return;
+	}
+
+	address = (unsigned long)addr; 
+	start = address;
+	end = address + size;
+
+	mm = &ioremap_mm;
+	spin_lock(&mm->page_table_lock);
+
+	dir = pgd_offset_i(address);
+	flush_cache_all();
+	do {
+		unmap_im_area_pmd(dir, address, end - address);
+		address = (address + PGDIR_SIZE) & PGDIR_MASK;
+		dir++;
+	} while (address && (address < end));
+	__flush_tlb_range(mm, start, end);
+
+	spin_unlock(&mm->page_table_lock);
+	return;
 }
 
 void iounmap(void *addr) 
@@ -186,10 +371,52 @@
 	return;
 #else
 	/* DRENG / PPPBBB todo */
-	return;
+	return pSeries_iounmap(addr);
 #endif
 }
 
+int iounmap_explicit(void *addr, unsigned long size)
+{
+	struct vm_struct *area;
+	
+	/* addr could be in EEH or IO region, map it to IO region regardless.
+	 */
+	addr = (void *) (IO_TOKEN_TO_ADDR(addr) & PAGE_MASK);
+
+	/* Verify that the region either exists or is a subset of an existing
+	 * region.  In the latter case, split the parent region to create 
+	 * the exact region 
+	 */
+	area = im_get_area((unsigned long) addr, size, 
+			    IM_REGION_EXISTS | IM_REGION_SUBSET);
+	if (area == NULL) {
+		printk(KERN_ERR "%s() cannot unmap nonexistant range 0x%lx\n",
+				__FUNCTION__, (unsigned long) addr);
+		return 1;
+	}
+
+	iounmap(area->addr);
+	return 0;
+}
+
+static void * __ioremap_com(unsigned long addr, unsigned long pa, 
+			    unsigned long ea, unsigned long size, 
+			    unsigned long flags)
+{
+	unsigned long i;
+	
+	if ((flags & _PAGE_PRESENT) == 0)
+		flags |= pgprot_val(PAGE_KERNEL);
+	if (flags & (_PAGE_NO_CACHE | _PAGE_WRITETHRU))
+		flags |= _PAGE_GUARDED;
+
+	for (i = 0; i < size; i += PAGE_SIZE) {
+		map_io_page(ea+i, pa+i, flags);
+	}
+
+	return (void *) (ea + (addr & ~PAGE_MASK));
+}
+
 /*
  * map_io_page currently only called by __ioremap
  * map_io_page adds an entry to the ioremap page table
@@ -674,10 +901,6 @@
 	flush_icache_range(maddr, maddr + len);
 }
 
-extern pte_t *find_linux_pte(pgd_t *pgdir, unsigned long ea);
-int __hash_page(unsigned long ea, unsigned long access, unsigned long vsid,
-		pte_t *ptep, unsigned long trap, int local);
-
 /*
  * This is called at the end of handling a user page fault, when the
  * fault has been handled by updating a PTE in the linux page tables.
@@ -717,6 +940,9 @@
 		return;
 
 	ptep = find_linux_pte(pgdir, ea);
+	if (!ptep)
+		return;
+
 	vsid = get_vsid(vma->vm_mm->context, ea);
 
 	tmp = cpumask_of_cpu(smp_processor_id());
@@ -725,6 +951,19 @@
 
 	__hash_page(ea, pte_val(pte) & (_PAGE_USER|_PAGE_RW), vsid, ptep,
 		    0x300, local);
+}
+
+void * reserve_phb_iospace(unsigned long size)
+{
+	void *virt_addr;
+		
+	if (phbs_io_bot >= IMALLOC_BASE) 
+		panic("reserve_phb_iospace(): phb io space overflow\n");
+			
+	virt_addr = (void *) phbs_io_bot;
+	phbs_io_bot += size;
+
+	return virt_addr;
 }
 
 kmem_cache_t *zero_cache;
diff -Nru a/arch/ppc64/mm/numa.c b/arch/ppc64/mm/numa.c
--- a/arch/ppc64/mm/numa.c	Tue Feb  3 19:45:34 2004
+++ b/arch/ppc64/mm/numa.c	Tue Feb  3 19:45:34 2004
@@ -46,29 +46,29 @@
 
 static int __init parse_numa_properties(void)
 {
-	struct device_node *cpu;
-	struct device_node *memory;
+	struct device_node *cpu = NULL;
+	struct device_node *memory = NULL;
 	int *cpu_associativity;
 	int *memory_associativity;
 	int depth;
 	int max_domain = 0;
 
-	cpu = find_type_devices("cpu");
+	cpu = of_find_node_by_type(NULL, "cpu");
 	if (!cpu)
-		return -1;
+		goto err;
 
-	memory = find_type_devices("memory");
+	memory = of_find_node_by_type(NULL, "memory");
 	if (!memory)
-		return -1;
+		goto err;
 
 	cpu_associativity = (int *)get_property(cpu, "ibm,associativity", NULL);
 	if (!cpu_associativity)
-		return -1;
+		goto err;
 
 	memory_associativity = (int *)get_property(memory, "ibm,associativity",
 						   NULL);
 	if (!memory_associativity)
-		return -1;
+		goto err;
 
 	/* find common depth */
 	if (cpu_associativity[0] < memory_associativity[0])
@@ -76,7 +76,7 @@
 	else
 		depth = memory_associativity[0];
 
-	for (cpu = find_type_devices("cpu"); cpu; cpu = cpu->next) {
+	for (; cpu; cpu = of_find_node_by_type(cpu, "cpu")) {
 		int *tmp;
 		int cpu_nr, numa_domain;
 
@@ -106,9 +106,8 @@
 		map_cpu_to_node(cpu_nr, numa_domain);
 	}
 
-	for (memory = find_type_devices("memory"); memory;
-	     memory = memory->next) {
-		int *tmp1, *tmp2;
+	for (; memory; memory = of_find_node_by_type(memory, "memory")) {
+		unsigned int *tmp1, *tmp2;
 		unsigned long i;
 		unsigned long start = 0;
 		unsigned long size = 0;
@@ -196,6 +195,10 @@
 	numnodes = max_domain + 1;
 
 	return 0;
+err:
+	of_node_put(cpu);
+	of_node_put(memory);
+	return -1;
 }
 
 void setup_nonnuma(void)
diff -Nru a/arch/ppc64/xmon/start.c b/arch/ppc64/xmon/start.c
--- a/arch/ppc64/xmon/start.c	Tue Feb  3 19:45:43 2004
+++ b/arch/ppc64/xmon/start.c	Tue Feb  3 19:45:43 2004
@@ -6,8 +6,10 @@
  *      as published by the Free Software Foundation; either version
  *      2 of the License, or (at your option) any later version.
  */
+#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
+#include <linux/errno.h>
 #include <linux/sysrq.h>
 #include <asm/machdep.h>
 #include <asm/io.h>
@@ -28,11 +30,14 @@
 	return ret;
 }
 
+#ifdef CONFIG_MAGIC_SYSRQ
+
 static void sysrq_handle_xmon(int key, struct pt_regs *pt_regs,
 			      struct tty_struct *tty) 
 {
 	xmon(pt_regs);
 }
+
 static struct sysrq_key_op sysrq_xmon_op = 
 {
 	.handler =	sysrq_handle_xmon,
@@ -40,11 +45,15 @@
 	.action_msg =	"Entering xmon\n",
 };
 
+#endif /* CONFIG_MAGIC_SYSRQ */
+
 void
 xmon_map_scc(void)
 {
+#ifdef CONFIG_MAGIC_SYSRQ
 	/* This maybe isn't the best place to register sysrq 'x' */
 	__sysrq_put_key_op('x', &sysrq_xmon_op);
+#endif /* CONFIG_MAGIC_SYSRQ */
 }
 
 int
diff -Nru a/arch/ppc64/xmon/xmon.c b/arch/ppc64/xmon/xmon.c
--- a/arch/ppc64/xmon/xmon.c	Tue Feb  3 19:45:41 2004
+++ b/arch/ppc64/xmon/xmon.c	Tue Feb  3 19:45:41 2004
@@ -37,9 +37,10 @@
 #define skipbl	xmon_skipbl
 
 #ifdef CONFIG_SMP
-unsigned long cpus_in_xmon = 0;
+volatile unsigned long cpus_in_xmon = 0;
 static unsigned long got_xmon = 0;
 static volatile int take_xmon = -1;
+static volatile int leaving_xmon = 0;
 #endif /* CONFIG_SMP */
 
 static unsigned long adrs;
@@ -162,7 +163,6 @@
   mz	zero a block of memory\n\
   mx	translation information for an effective address\n\
   mi	show information about memory allocation\n\
-  M	print System.map\n\
   p 	show the task list\n\
   r	print registers\n\
   s	single step\n\
@@ -227,7 +227,7 @@
 xmon(struct pt_regs *excp)
 {
 	struct pt_regs regs;
-	int cmd;
+	int cmd = 0;
 	unsigned long msr;
 
 	if (excp == NULL) {
@@ -285,9 +285,15 @@
 	xmon_regs[smp_processor_id()] = excp;
 	excprint(excp);
 #ifdef CONFIG_SMP
-	if (test_and_set_bit(smp_processor_id(), &cpus_in_xmon))
+	leaving_xmon = 0;
+	/* possible race condition here if a CPU is held up and gets
+	 * here while we are exiting */
+	if (test_and_set_bit(smp_processor_id(), &cpus_in_xmon)) {
+		/* xmon probably caused an exception itself */
+		printf("We are already in xmon\n");
 		for (;;)
 			;
+	}
 	while (test_and_set_bit(0, &got_xmon)) {
 		if (take_xmon == smp_processor_id()) {
 			take_xmon = -1;
@@ -304,6 +310,9 @@
 	if (cmd == 's') {
 		xmon_trace[smp_processor_id()] = SSTEP;
 		excp->msr |= MSR_SE;
+#ifdef CONFIG_SMP		
+		take_xmon = smp_processor_id();
+#endif		
 	} else if (at_breakpoint(excp->nip)) {
 		xmon_trace[smp_processor_id()] = BRSTEP;
 		excp->msr |= MSR_SE;
@@ -313,7 +322,9 @@
 	}
 	xmon_regs[smp_processor_id()] = 0;
 #ifdef CONFIG_SMP
-	clear_bit(0, &got_xmon);
+	leaving_xmon = 1;
+	if (cmd != 's')
+		clear_bit(0, &got_xmon);
 	clear_bit(smp_processor_id(), &cpus_in_xmon);
 #endif /* CONFIG_SMP */
 	set_msrd(msr);		/* restore interrupt enable */
@@ -421,8 +432,6 @@
 	int i;
 	struct bpt *bp;
 
-	if (systemcfg->platform != PLATFORM_PSERIES)
-		return;
 	bp = bpts;
 	for (i = 0; i < NBPTS; ++i, ++bp) {
 		if (!bp->enabled)
@@ -450,9 +459,6 @@
 	struct bpt *bp;
 	unsigned instr;
 
-	if (systemcfg->platform != PLATFORM_PSERIES)
-		return;
-
 	if ((cur_cpu_spec->cpu_features & CPU_FTR_DABR))
 		set_dabr(0);
 	if ((cur_cpu_spec->cpu_features & CPU_FTR_IABR))
@@ -478,11 +484,15 @@
 static int
 cmds(struct pt_regs *excp)
 {
-	int cmd;
+	int cmd = 0;
 
 	last_cmd = NULL;
 	for(;;) {
 #ifdef CONFIG_SMP
+		/* Need to check if we should take any commands on
+		   this CPU. */
+		if (leaving_xmon)
+			return cmd;
 		printf("%d:", smp_processor_id());
 #endif /* CONFIG_SMP */
 		printf("mon> ");
@@ -832,6 +842,12 @@
 				}
 			break;
 		}
+		
+		if (!(systemcfg->platform & PLATFORM_PSERIES)) {
+			printf("Not supported for this platform\n");
+			break;
+		}
+
 		bp = at_breakpoint(a);
 		if (bp == 0) {
 			for (bp = bpts; bp < &bpts[NBPTS]; ++bp)
diff -Nru a/arch/s390/Kconfig b/arch/s390/Kconfig
--- a/arch/s390/Kconfig	Tue Feb  3 19:45:17 2004
+++ b/arch/s390/Kconfig	Tue Feb  3 19:45:17 2004
@@ -97,6 +97,7 @@
 
 config NR_CPUS
 	int "Maximum number of CPUs (2-32)"
+	range 2 32
 	depends on SMP && ARCH_S390X = 'n'
 	default "32"
 	help
@@ -109,6 +110,7 @@
 	
 config NR_CPUS
 	int "Maximum number of CPUs (2-64)"
+	range 2 64
 	depends on SMP && ARCH_S390X
 	default "64"
 	help
diff -Nru a/arch/s390/Makefile b/arch/s390/Makefile
--- a/arch/s390/Makefile	Tue Feb  3 19:45:17 2004
+++ b/arch/s390/Makefile	Tue Feb  3 19:45:17 2004
@@ -70,3 +70,8 @@
 	$(call filechk,gen-asm-offsets)
 
 CLEAN_FILES += include/asm-$(ARCH)/offsets.h
+
+# Don't use tabs in echo arguments
+define archhelp
+  echo  '* image           - Kernel image for IPL ($(boot)/image)'
+endef
diff -Nru a/arch/s390/defconfig b/arch/s390/defconfig
--- a/arch/s390/defconfig	Tue Feb  3 19:45:41 2004
+++ b/arch/s390/defconfig	Tue Feb  3 19:45:41 2004
@@ -29,6 +29,7 @@
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -109,8 +110,8 @@
 #
 # SCSI low-level drivers
 #
-# CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_EATA_PIO is not set
 # CONFIG_SCSI_DEBUG is not set
 CONFIG_ZFCP=y
@@ -146,6 +147,7 @@
 CONFIG_MD_RAID0=m
 CONFIG_MD_RAID1=m
 CONFIG_MD_RAID5=m
+# CONFIG_MD_RAID6 is not set
 CONFIG_MD_MULTIPATH=m
 # CONFIG_BLK_DEV_DM is not set
 
@@ -158,7 +160,8 @@
 #
 # S/390 character device drivers
 #
-# CONFIG_TN3270 is not set
+CONFIG_TN3270=y
+CONFIG_TN3270_CONSOLE=y
 CONFIG_TN3215=y
 CONFIG_TN3215_CONSOLE=y
 CONFIG_CCW_CONSOLE=y
@@ -318,6 +321,21 @@
 CONFIG_CCWGROUP=y
 
 #
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# Bluetooth support
+#
+# CONFIG_BT is not set
+
+#
 # File systems
 #
 CONFIG_EXT2_FS=y
@@ -358,8 +376,7 @@
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS=y
 # CONFIG_DEVPTS_FS_XATTR is not set
-# CONFIG_TMPFS is not set
-# CONFIG_HUGETLBFS is not set
+CONFIG_TMPFS=y
 # CONFIG_HUGETLB_PAGE is not set
 CONFIG_RAMFS=y
 
@@ -385,6 +402,7 @@
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
 CONFIG_NFSD=y
 CONFIG_NFSD_V3=y
 # CONFIG_NFSD_V4 is not set
@@ -422,6 +440,11 @@
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+# CONFIG_NLS is not set
 
 #
 # Kernel hacking
diff -Nru a/arch/s390/kernel/compat_ioctl.c b/arch/s390/kernel/compat_ioctl.c
--- a/arch/s390/kernel/compat_ioctl.c	Tue Feb  3 19:45:33 2004
+++ b/arch/s390/kernel/compat_ioctl.c	Tue Feb  3 19:45:33 2004
@@ -2,818 +2,46 @@
  * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
  *
  *  S390 version
- *    Copyright (C) 2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ *    Copyright (C) 2000-2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
  *    Author(s): Gerhard Tonn (ton@de.ibm.com)
+ *               Arnd Bergmann (arndb@de.ibm.com)
  *
- * Heavily inspired by the 32-bit Sparc compat code which is  
+ * Original implementation from 32-bit Sparc compat code which is
  * Copyright (C) 2000 Silicon Graphics, Inc.
  * Written by Ulf Carlsson (ulfc@engr.sgi.com) 
- *
  */
 
-#include <linux/compat.h>
-#include <linux/init.h>
-#include <linux/ioctl32.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/types.h>
-
-#include <asm/ioctls.h>
-#include <asm/types.h>
-#include <asm/uaccess.h>
-
-#include <linux/blkdev.h>
-#include <linux/blkpg.h>
-#include <linux/cdrom.h>
-#include <linux/dm-ioctl.h>
-#include <linux/elevator.h>
-#include <linux/file.h>
-#include <linux/fs.h>
-#include <linux/hdreg.h>
-#include <linux/kd.h>
-#include <linux/loop.h>
-#include <linux/lp.h>
-#include <linux/mtio.h>
-#include <linux/netdevice.h>
-#include <linux/nbd.h>
-#include <linux/ppp_defs.h>
-#include <linux/raid/md_u.h>
-#include <linux/random.h>
-#include <linux/raw.h>
-#include <linux/route.h>
-#include <linux/rtc.h>
-#include <linux/vt.h>
-#include <linux/watchdog.h>
-
-#include <linux/auto_fs.h>
-#include <linux/auto_fs4.h>
-#include <linux/devfs_fs.h>
-#include <linux/ext2_fs.h>
-#include <linux/ncp_fs.h>
-#include <linux/smb_fs.h>
-
-#include <linux/if_bonding.h>
-#include <linux/if_ppp.h>
-#include <linux/if_pppox.h>
-#include <linux/if_tun.h>
-
-#include <scsi/scsi.h>
-#include <scsi/scsi_ioctl.h>
-#include <scsi/sg.h>
-
+#include "compat_linux.h"
+#define INCLUDES
+#define CODE
+#include "../../../fs/compat_ioctl.c"
 #include <asm/dasd.h>
-#include <asm/sockios.h>
 #include <asm/tape390.h>
 
-#include "compat_linux.h"
-
-long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
-
-struct hd_geometry32 {
-	unsigned char	heads;
-	unsigned char	sectors;
-	unsigned short	cylinders;
-	__u32		start;
-};  
-
-static inline int hd_geometry_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg,
-				    struct file *f)
-{
-	struct hd_geometry32 *hg32 = (struct hd_geometry32 *) A(arg);
-	struct hd_geometry hg;
-	int ret;
-	mm_segment_t old_fs = get_fs();
-	
-	set_fs (KERNEL_DS);
-	ret = sys_ioctl (fd, cmd, (long)&hg);
-	set_fs (old_fs);
-
-	if (ret)
-		return ret;
-
-	ret = put_user (hg.heads, &(hg32->heads));
-	ret |= __put_user (hg.sectors, &(hg32->sectors));
-	ret |= __put_user (hg.cylinders, &(hg32->cylinders));
-	ret |= __put_user (hg.start, &(hg32->start));
-
-	return ret;
-}
-
-#define EXT2_IOC32_GETFLAGS               _IOR('f', 1, int)
-#define EXT2_IOC32_SETFLAGS               _IOW('f', 2, int)
-#define EXT2_IOC32_GETVERSION             _IOR('v', 1, int)
-#define EXT2_IOC32_SETVERSION             _IOW('v', 2, int)
-
-struct ifmap32 {
-	unsigned int mem_start;
-	unsigned int mem_end;
-	unsigned short base_addr;
-	unsigned char irq;
-	unsigned char dma;
-	unsigned char port;
-};
-
-struct ifreq32 {
-#define IFHWADDRLEN     6
-#define IFNAMSIZ        16
-        union {
-                char    ifrn_name[IFNAMSIZ];	/* if name, e.g. "en0" */
-        } ifr_ifrn;
-        union {
-                struct  sockaddr ifru_addr;
-                struct  sockaddr ifru_dstaddr;
-                struct  sockaddr ifru_broadaddr;
-                struct  sockaddr ifru_netmask;
-                struct  sockaddr ifru_hwaddr;
-                short   ifru_flags;
-                int     ifru_ivalue;
-                int     ifru_mtu;
-                struct  ifmap32 ifru_map;
-                char    ifru_slave[IFNAMSIZ];   /* Just fits the size */
-		char	ifru_newname[IFNAMSIZ];
-                __u32	ifru_data;
-        } ifr_ifru;
-};
-
-struct ifconf32 {
-        int     ifc_len;                        /* size of buffer       */
-        __u32	ifcbuf;
-};
-
-static int dev_ifname32(unsigned int fd, unsigned int cmd,
-			unsigned long arg, struct file *f)
-{
-	struct ireq32 *uir32 = (struct ireq32 *) A(arg);
-	struct net_device *dev;
-	struct ifreq32 ifr32;
-
-	if (copy_from_user(&ifr32, uir32, sizeof(struct ifreq32)))
-		return -EFAULT;
-
-	read_lock(&dev_base_lock);
-	dev = __dev_get_by_index(ifr32.ifr_ifindex);
-	if (!dev) {
-		read_unlock(&dev_base_lock);
-		return -ENODEV;
-	}
-
-	strcpy(ifr32.ifr_name, dev->name);
-	read_unlock(&dev_base_lock);
-
-	if (copy_to_user(uir32, &ifr32, sizeof(struct ifreq32)))
-	    return -EFAULT;
-
-	return 0;
-}
-
-static int dev_ifconf(unsigned int fd, unsigned int cmd,
-		      unsigned long arg, struct file *f)
-{
-	struct ioconf32 *uifc32 = (struct ioconf32 *) A(arg);
-	struct ifconf32 ifc32;
-	struct ifconf ifc;
-	struct ifreq32 *ifr32;
-	struct ifreq *ifr;
-	mm_segment_t old_fs;
-	int len;
-	int err;
-
-	if (copy_from_user(&ifc32, uifc32, sizeof(struct ifconf32)))
-		return -EFAULT;
-
-	if(ifc32.ifcbuf == 0) {
-		ifc32.ifc_len = 0;
-		ifc.ifc_len = 0;
-		ifc.ifc_buf = NULL;
-	} else {
-		ifc.ifc_len = ((ifc32.ifc_len / sizeof (struct ifreq32))) *
-			sizeof (struct ifreq);
-		ifc.ifc_buf = kmalloc (ifc.ifc_len, GFP_KERNEL);
-		if (!ifc.ifc_buf)
-			return -ENOMEM;
-	}
-	ifr = ifc.ifc_req;
-	ifr32 = (struct ifreq32 *) A(ifc32.ifcbuf);
-	len = ifc32.ifc_len / sizeof (struct ifreq32);
-	while (len--) {
-		if (copy_from_user(ifr++, ifr32++, sizeof (struct ifreq32))) {
-			err = -EFAULT;
-			goto out;
-		}
-	}
-
-	old_fs = get_fs();
-	set_fs (KERNEL_DS);
-	err = sys_ioctl (fd, SIOCGIFCONF, (unsigned long)&ifc);	
-	set_fs (old_fs);
-	if (err)
-		goto out;
-
-	ifr = ifc.ifc_req;
-	ifr32 = (struct ifreq32 *) A(ifc32.ifcbuf);
-	len = ifc.ifc_len / sizeof (struct ifreq);
-	ifc32.ifc_len = len * sizeof (struct ifreq32);
-
-	while (len--) {
-		if (copy_to_user(ifr32++, ifr++, sizeof (struct ifreq32))) {
-			err = -EFAULT;
-			goto out;
-		}
-	}
-
-	if (copy_to_user(uifc32, &ifc32, sizeof(struct ifconf32))) {
-		err = -EFAULT;
-		goto out;
-	}
-out:
-	if(ifc.ifc_buf != NULL)
-		kfree (ifc.ifc_buf);
-	return err;
-}
-
-static int bond_ioctl(unsigned int fd, unsigned int cmd,
-		      unsigned long arg, struct file *f)
-{
-	struct ifreq ifr;
-	mm_segment_t old_fs;
-	int err, len;
-	u32 data;
-	
-	if (copy_from_user(&ifr, (struct ifreq32 *)arg, sizeof(struct ifreq32)))
-		return -EFAULT;
-	ifr.ifr_data = (__kernel_caddr_t)get_zeroed_page(GFP_KERNEL);
-	if (!ifr.ifr_data)
-		return -EAGAIN;
-
-	switch (cmd) {
-	case SIOCBONDENSLAVE:
-	case SIOCBONDRELEASE:
-	case SIOCBONDSETHWADDR:
-	case SIOCBONDCHANGEACTIVE:
-		len = IFNAMSIZ * sizeof(char);
-		break;
-	case SIOCBONDSLAVEINFOQUERY:
-		len = sizeof(struct ifslave);
-		break;
-	case SIOCBONDINFOQUERY:
-		len = sizeof(struct ifbond);
-		break;
-	default:
-		err = -EINVAL;
-		goto out;
-	};
-
-	__get_user(data, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_data));
-	if (copy_from_user(ifr.ifr_data, (char *)A(data), len)) {
-		err = -EFAULT;
-		goto out;
-	}
-
-	old_fs = get_fs();
-	set_fs (KERNEL_DS);
-	err = sys_ioctl (fd, cmd, (unsigned long)&ifr);
-	set_fs (old_fs);
-	if (!err) {
-		len = copy_to_user((char *)A(data), ifr.ifr_data, len);
-		if (len)
-			err = -EFAULT;
-	}
-
-out:
-	free_page((unsigned long)ifr.ifr_data);
-	return err;
-}
-
-static int dev_ifsioc(unsigned int fd, unsigned int cmd,
-			     unsigned long arg, struct file *f)
+static int do_ioctl32_pointer(unsigned int fd, unsigned int cmd,
+				unsigned long arg, struct file *f)
 {
-	struct ifreq32 *uifr = (struct ifreq32 *) A(arg);
-	struct ifreq ifr;
-	mm_segment_t old_fs;
-	int err;
-	
-	switch (cmd) {
-	case SIOCSIFMAP:
-		err = copy_from_user(&ifr, uifr, sizeof(ifr.ifr_name));
-		err |= __get_user(ifr.ifr_map.mem_start, &(uifr->ifr_ifru.ifru_map.mem_start));
-		err |= __get_user(ifr.ifr_map.mem_end, &(uifr->ifr_ifru.ifru_map.mem_end));
-		err |= __get_user(ifr.ifr_map.base_addr, &(uifr->ifr_ifru.ifru_map.base_addr));
-		err |= __get_user(ifr.ifr_map.irq, &(uifr->ifr_ifru.ifru_map.irq));
-		err |= __get_user(ifr.ifr_map.dma, &(uifr->ifr_ifru.ifru_map.dma));
-		err |= __get_user(ifr.ifr_map.port, &(uifr->ifr_ifru.ifru_map.port));
-		if (err)
-			return -EFAULT;
-		break;
-	default:
-		if (copy_from_user(&ifr, uifr, sizeof(struct ifreq32)))
-			return -EFAULT;
-		break;
-	}
-	old_fs = get_fs();
-	set_fs (KERNEL_DS);
-	err = sys_ioctl (fd, cmd, (unsigned long)&ifr);
-	set_fs (old_fs);
-	if (!err) {
-		switch (cmd) {
-		case SIOCGIFFLAGS:
-		case SIOCGIFMETRIC:
-		case SIOCGIFMTU:
-		case SIOCGIFMEM:
-		case SIOCGIFHWADDR:
-		case SIOCGIFINDEX:
-		case SIOCGIFADDR:
-		case SIOCGIFBRDADDR:
-		case SIOCGIFDSTADDR:
-		case SIOCGIFNETMASK:
-		case SIOCGIFTXQLEN:
-			if (copy_to_user(uifr, &ifr, sizeof(struct ifreq32)))
-				return -EFAULT;
-			break;
-		case SIOCGIFMAP:
-			err = copy_to_user(uifr, &ifr, sizeof(ifr.ifr_name));
-			err |= __put_user(ifr.ifr_map.mem_start, &(uifr->ifr_ifru.ifru_map.mem_start));
-			err |= __put_user(ifr.ifr_map.mem_end, &(uifr->ifr_ifru.ifru_map.mem_end));
-			err |= __put_user(ifr.ifr_map.base_addr, &(uifr->ifr_ifru.ifru_map.base_addr));
-			err |= __put_user(ifr.ifr_map.irq, &(uifr->ifr_ifru.ifru_map.irq));
-			err |= __put_user(ifr.ifr_map.dma, &(uifr->ifr_ifru.ifru_map.dma));
-			err |= __put_user(ifr.ifr_map.port, &(uifr->ifr_ifru.ifru_map.port));
-			if (err)
-				err = -EFAULT;
-			break;
-		}
-	}
-	return err;
+	return sys_ioctl(fd, cmd, (unsigned long)compat_ptr(arg));
 }
 
-struct rtentry32
-{
-	unsigned int	rt_pad1;
-	struct sockaddr	rt_dst;		/* target address		*/
-	struct sockaddr	rt_gateway;	/* gateway addr (RTF_GATEWAY)	*/
-	struct sockaddr	rt_genmask;	/* target network mask (IP)	*/
-	unsigned short	rt_flags;
-	short		rt_pad2;
-	unsigned int	rt_pad3;
-	unsigned int	rt_pad4;
-	short		rt_metric;	/* +1 for binary compatibility!	*/
-	unsigned int	rt_dev;		/* forcing the device at add	*/
-	unsigned int	rt_mtu;		/* per route MTU/Window 	*/
-#ifndef __KERNEL__
-#define rt_mss	rt_mtu			/* Compatibility :-(            */
-#endif
-	unsigned int	rt_window;	/* Window clamping 		*/
-	unsigned short	rt_irtt;	/* Initial RTT			*/
-};
-
-static int routing_ioctl(unsigned int fd, unsigned int cmd,
-			 unsigned long arg, struct file *f)
+static int do_ioctl32_ulong(unsigned int fd, unsigned int cmd,
+				unsigned long arg, struct file *f)
 {
-	struct rtentry32 *ur = (struct rtentry32 *) A(arg);
-	struct rtentry r;
-	char devname[16];
-	u32 rtdev;
-	int ret;
-	mm_segment_t old_fs = get_fs();
-	
-	ret = copy_from_user (&r.rt_dst, &(ur->rt_dst), 3 * sizeof(struct sockaddr));
-	ret |= __get_user (r.rt_flags, &(ur->rt_flags));
-	ret |= __get_user (r.rt_metric, &(ur->rt_metric));
-	ret |= __get_user (r.rt_mtu, &(ur->rt_mtu));
-	ret |= __get_user (r.rt_window, &(ur->rt_window));
-	ret |= __get_user (r.rt_irtt, &(ur->rt_irtt));
-	ret |= __get_user (rtdev, &(ur->rt_dev));
-	if (rtdev) {
-		ret |= copy_from_user (devname, (char *) A(rtdev), 15);
-		r.rt_dev = devname; devname[15] = 0;
-	} else
-		r.rt_dev = 0;
-	if (ret)
-		return -EFAULT;
-	set_fs (KERNEL_DS);
-	ret = sys_ioctl (fd, cmd, (long)&r);
-	set_fs (old_fs);
-	return ret;
-}
-
-static int do_ext2_ioctl(unsigned int fd, unsigned int cmd,
-			 unsigned long arg, struct file *f)
-{
-	/* These are just misnamed, they actually get/put from/to user an int */
-	switch (cmd) {
-	case EXT2_IOC32_GETFLAGS: cmd = EXT2_IOC_GETFLAGS; break;
-	case EXT2_IOC32_SETFLAGS: cmd = EXT2_IOC_SETFLAGS; break;
-	case EXT2_IOC32_GETVERSION: cmd = EXT2_IOC_GETVERSION; break;
-	case EXT2_IOC32_SETVERSION: cmd = EXT2_IOC_SETVERSION; break;
-	}
 	return sys_ioctl(fd, cmd, arg);
 }
 
+#define COMPATIBLE_IOCTL(cmd)		HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)do_ioctl32_pointer)
+#define ULONG_IOCTL(cmd)		HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)do_ioctl32_ulong)
+#define HANDLE_IOCTL(cmd,handler)	{ (cmd), (ioctl_trans_handler_t)(handler), NULL },
 
-struct loop_info32 {
-	int			lo_number;      /* ioctl r/o */
-	compat_dev_t	lo_device;      /* ioctl r/o */
-	unsigned int		lo_inode;       /* ioctl r/o */
-	compat_dev_t	lo_rdevice;     /* ioctl r/o */
-	int			lo_offset;
-	int			lo_encrypt_type;
-	int			lo_encrypt_key_size;    /* ioctl w/o */
-	int			lo_flags;       /* ioctl r/o */
-	char			lo_name[LO_NAME_SIZE];
-	unsigned char		lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
-	unsigned int		lo_init[2];
-	char			reserved[4];
-};
-
-static int loop_status(unsigned int fd, unsigned int cmd,
-		       unsigned long arg, struct file *f)
-{
-	mm_segment_t old_fs = get_fs();
-	struct loop_info l;
-	int err = -EINVAL;
-
-	switch(cmd) {
-	case LOOP_SET_STATUS:
-		err = get_user(l.lo_number, &((struct loop_info32 *)arg)->lo_number);
-		err |= __get_user(l.lo_device, &((struct loop_info32 *)arg)->lo_device);
-		err |= __get_user(l.lo_inode, &((struct loop_info32 *)arg)->lo_inode);
-		err |= __get_user(l.lo_rdevice, &((struct loop_info32 *)arg)->lo_rdevice);
-		err |= __copy_from_user((char *)&l.lo_offset, (char *)&((struct loop_info32 *)arg)->lo_offset,
-					   8 + (unsigned long)l.lo_init - (unsigned long)&l.lo_offset);
-		if (err) {
-			err = -EFAULT;
-		} else {
-			set_fs (KERNEL_DS);
-			err = sys_ioctl (fd, cmd, (unsigned long)&l);
-			set_fs (old_fs);
-		}
-		break;
-	case LOOP_GET_STATUS:
-		set_fs (KERNEL_DS);
-		err = sys_ioctl (fd, cmd, (unsigned long)&l);
-		set_fs (old_fs);
-		if (!err) {
-			err = put_user(l.lo_number, &((struct loop_info32 *)arg)->lo_number);
-			err |= __put_user(l.lo_device, &((struct loop_info32 *)arg)->lo_device);
-			err |= __put_user(l.lo_inode, &((struct loop_info32 *)arg)->lo_inode);
-			err |= __put_user(l.lo_rdevice, &((struct loop_info32 *)arg)->lo_rdevice);
-			err |= __copy_to_user((char *)&((struct loop_info32 *)arg)->lo_offset,
-					   (char *)&l.lo_offset, (unsigned long)l.lo_init - (unsigned long)&l.lo_offset);
-			if (err)
-				err = -EFAULT;
-		}
-		break;
-	default: {
-		static int count = 0;
-		if (++count <= 20)
-			printk("%s: Unknown loop ioctl cmd, fd(%d) "
-			       "cmd(%08x) arg(%08lx)\n",
-			       __FUNCTION__, fd, cmd, arg);
-	}
-	}
-	return err;
-}
-
-
-struct blkpg_ioctl_arg32 {
-	int op;
-	int flags;
-	int datalen;
-	u32 data;
-};
-                                
-static int blkpg_ioctl_trans(unsigned int fd, unsigned int cmd,
-			     unsigned long uarg, struct file *f)
-{
-	struct blkpg_ioctl_arg a;
-	struct blkpg_partition p;
-	struct blkpg_ioctl_arg32 *arg = (void*)A(uarg);
-	int err;
-	mm_segment_t old_fs = get_fs();
-	
-	err = get_user(a.op, &arg->op);
-	err |= __get_user(a.flags, &arg->flags);
-	err |= __get_user(a.datalen, &arg->datalen);
-	err |= __get_user((long)a.data, &arg->data);
-	if (err) return err;
-	switch (a.op) {
-	case BLKPG_ADD_PARTITION:
-	case BLKPG_DEL_PARTITION:
-		if (a.datalen < sizeof(struct blkpg_partition))
-			return -EINVAL;
-                if (copy_from_user(&p, a.data, sizeof(struct blkpg_partition)))
-			return -EFAULT;
-		a.data = &p;
-		set_fs (KERNEL_DS);
-		err = sys_ioctl(fd, cmd, (unsigned long)&a);
-		set_fs (old_fs);
-	default:
-		return -EINVAL;
-	}                                        
-	return err;
-}
-
-
-typedef struct ica_z90_status_t {
-  int totalcount;
-  int leedslitecount;
-  int leeds2count;
-  int requestqWaitCount;
-  int pendingqWaitCount;
-  int totalOpenCount;
-  int cryptoDomain;
-  unsigned char status[64];
-  unsigned char qdepth[64];
-} ica_z90_status;
-
-typedef struct _ica_rsa_modexpo {
-  char         *inputdata;
-  unsigned int  inputdatalength;
-  char         *outputdata;
-  unsigned int  outputdatalength;
-  char         *b_key;
-  char         *n_modulus;
-} ica_rsa_modexpo_t;
-
-typedef struct _ica_rsa_modexpo_32 {
-  u32          inputdata;
-  u32          inputdatalength;
-  u32          outputdata;
-  u32          outputdatalength;
-  u32          b_key;
-  u32          n_modulus;
-} ica_rsa_modexpo_32_t;
-
-typedef struct _ica_rsa_modexpo_crt {
-  char         *inputdata;
-  unsigned int  inputdatalength;
-  char         *outputdata;
-  unsigned int  outputdatalength;
-  char         *bp_key;
-  char         *bq_key;
-  char         *np_prime;
-  char         *nq_prime;
-  char         *u_mult_inv;
-} ica_rsa_modexpo_crt_t;
-
-typedef struct _ica_rsa_modexpo_crt_32 {
-  u32          inputdata;
-  u32          inputdatalength;
-  u32          outputdata;
-  u32          outputdatalength;
-  u32          bp_key;
-  u32          bq_key;
-  u32          np_prime;
-  u32          nq_prime;
-  u32          u_mult_inv;
-} ica_rsa_modexpo_crt_32_t;
-
-#define ICA_IOCTL_MAGIC 'z'
-#define ICARSAMODEXPO   _IOC(_IOC_READ|_IOC_WRITE, ICA_IOCTL_MAGIC, 0x05, 0)
-#define ICARSACRT       _IOC(_IOC_READ|_IOC_WRITE, ICA_IOCTL_MAGIC, 0x06, 0) 
-#define ICARSAMODMULT   _IOC(_IOC_READ|_IOC_WRITE, ICA_IOCTL_MAGIC, 0x07, 0)
-#define ICAZ90STATUS    _IOC(_IOC_READ, ICA_IOCTL_MAGIC, 0x10, sizeof(ica_z90_status))
-#define ICAZ90QUIESCE   _IOC(_IOC_NONE, ICA_IOCTL_MAGIC, 0x11, 0)
-#define ICAZ90HARDRESET _IOC(_IOC_NONE, ICA_IOCTL_MAGIC, 0x12, 0)
-#define ICAZ90HARDERROR _IOC(_IOC_NONE, ICA_IOCTL_MAGIC, 0x13, 0)
-
-static int do_rsa_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *f)
-{
-	mm_segment_t old_fs = get_fs();
-	int err = 0;
-	ica_rsa_modexpo_t rsa;
-	ica_rsa_modexpo_32_t *rsa32 = (ica_rsa_modexpo_32_t *)arg;
-	u32 inputdata, outputdata, b_key, n_modulus;
-
-	memset (&rsa, 0, sizeof(rsa));
-
-	err |= __get_user (inputdata, &rsa32->inputdata);
-	err |= __get_user (rsa.inputdatalength, &rsa32->inputdatalength);
-	err |= __get_user (outputdata, &rsa32->outputdata);
-	err |= __get_user (rsa.outputdatalength, &rsa32->outputdatalength);
-	err |= __get_user (b_key, &rsa32->b_key);
-	err |= __get_user (n_modulus, &rsa32->n_modulus);
-	if (err)
-		return -EFAULT;
-
-	rsa.inputdata = (char *)kmalloc(rsa.inputdatalength, GFP_KERNEL);
-	if (!rsa.inputdata) {
-		err = -ENOMEM;
-		goto cleanup;
-	}
-	if (copy_from_user(rsa.inputdata, (char *)(u64)(inputdata & 0x7fffffff), 
-			   rsa.inputdatalength)) {
-		err = -EFAULT;
-		goto cleanup;
-	}
-
-	rsa.outputdata = (char *)kmalloc(rsa.outputdatalength, GFP_KERNEL);
-	if (!rsa.outputdata) {
-		err = -ENOMEM;
-		goto cleanup;
-	}
-
-	rsa.b_key = (char *)kmalloc(rsa.inputdatalength, GFP_KERNEL);
-	if (!rsa.b_key) {
-		err = -ENOMEM;
-		goto cleanup;
-	}
-	if (copy_from_user(rsa.b_key, (char *)(u64)(b_key & 0x7fffffff), 
-			   rsa.inputdatalength)) {
-		err = -EFAULT;
-		goto cleanup;
-	}
-
-	rsa.n_modulus = (char *)kmalloc(rsa.inputdatalength, GFP_KERNEL);
-	if (!rsa.n_modulus) {
-		err = -ENOMEM;
-		goto cleanup;
-	}
-	if (copy_from_user(rsa.n_modulus, (char *)(u64)(n_modulus & 0x7fffffff), 
-			   rsa.inputdatalength)) {
-		err = -EFAULT;
-		goto cleanup;
-	}
-
-	set_fs(KERNEL_DS);
-	err = sys_ioctl(fd, cmd, (unsigned long)&rsa);
-	set_fs(old_fs);
-	if (err < 0)
-		goto cleanup;
-
-	if (copy_to_user((char *)(u64)(outputdata & 0x7fffffff), rsa.outputdata,
-			 rsa.outputdatalength))
-		err = -EFAULT;
-
-cleanup:
-	if (rsa.inputdata)
-		kfree(rsa.inputdata);
-	if (rsa.outputdata)
-		kfree(rsa.outputdata);
-	if (rsa.b_key)
-		kfree(rsa.b_key);
-	if (rsa.n_modulus)
-		kfree(rsa.n_modulus);
-	
-	return err;
-}
-
-static int do_rsa_crt_ioctl(unsigned int fd, unsigned int cmd,
-			    unsigned long arg, struct file *f)
-{
-	mm_segment_t old_fs = get_fs();
-	int err = 0;
-	ica_rsa_modexpo_crt_t rsa;
-	ica_rsa_modexpo_crt_32_t *rsa32 = (ica_rsa_modexpo_crt_32_t *)arg;
-	u32 inputdata, outputdata, bp_key, bq_key, np_prime, nq_prime, u_mult_inv;
-
-	memset (&rsa, 0, sizeof(rsa));
-
-	err |= __get_user (inputdata, &rsa32->inputdata);
-	err |= __get_user (rsa.inputdatalength, &rsa32->inputdatalength);
-	err |= __get_user (outputdata, &rsa32->outputdata);
-	err |= __get_user (rsa.outputdatalength, &rsa32->outputdatalength);
-	err |= __get_user (bp_key, &rsa32->bp_key);
-	err |= __get_user (bq_key, &rsa32->bq_key);
-	err |= __get_user (np_prime, &rsa32->np_prime);
-	err |= __get_user (nq_prime, &rsa32->nq_prime);
-	err |= __get_user (u_mult_inv, &rsa32->u_mult_inv);
-	if (err)
-		return -EFAULT;
-
-	rsa.inputdata = (char *)kmalloc(rsa.inputdatalength, GFP_KERNEL);
-	if (!rsa.inputdata) {
-		err = -ENOMEM;
-		goto cleanup;
-	}
-	if (copy_from_user(rsa.inputdata, (char *)(u64)(inputdata & 0x7fffffff), 
-			   rsa.inputdatalength)) {
-		err = -EFAULT;
-		goto cleanup;
-	}
-
-	rsa.outputdata = (char *)kmalloc(rsa.outputdatalength, GFP_KERNEL);
-	if (!rsa.outputdata) {
-		err = -ENOMEM;
-		goto cleanup;
-	}
-
-	rsa.bp_key = (char *)kmalloc(rsa.inputdatalength/2 + 8, GFP_KERNEL);
-	if (!rsa.bp_key) {
-		err = -ENOMEM;
-		goto cleanup;
-	}
-	if (copy_from_user(rsa.bp_key, (char *)(u64)(bp_key & 0x7fffffff), 
-			   rsa.inputdatalength/2 + 8)) {
-		err = -EFAULT;
-		goto cleanup;
-	}
-
-	rsa.bq_key = (char *)kmalloc(rsa.inputdatalength/2, GFP_KERNEL);
-	if (!rsa.bq_key) {
-		err = -ENOMEM;
-		goto cleanup;
-	}
-	if (copy_from_user(rsa.bq_key, (char *)(u64)(bq_key & 0x7fffffff), 
-			   rsa.inputdatalength/2)) {
-		err = -EFAULT;
-		goto cleanup;
-	}
-
-	rsa.np_prime = (char *)kmalloc(rsa.inputdatalength/2 + 8, GFP_KERNEL);
-	if (!rsa.np_prime) {
-		err = -ENOMEM;
-		goto cleanup;
-	}
-	if (copy_from_user(rsa.np_prime, (char *)(u64)(np_prime & 0x7fffffff), 
-			   rsa.inputdatalength/2 + 8)) {
-		err = -EFAULT;
-		goto cleanup;
-	}
-
-	rsa.nq_prime = (char *)kmalloc(rsa.inputdatalength/2, GFP_KERNEL);
-	if (!rsa.nq_prime) {
-		err = -ENOMEM;
-		goto cleanup;
-	}
-	if (copy_from_user(rsa.nq_prime, (char *)(u64)(nq_prime & 0x7fffffff), 
-			   rsa.inputdatalength/2)) {
-		err = -EFAULT;
-		goto cleanup;
-	}
-
-	rsa.u_mult_inv = (char *)kmalloc(rsa.inputdatalength/2 + 8, GFP_KERNEL);
-	if (!rsa.u_mult_inv) {
-		err = -ENOMEM;
-		goto cleanup;
-	}
-	if (copy_from_user(rsa.u_mult_inv, (char *)(u64)(u_mult_inv & 0x7fffffff), 
-			   rsa.inputdatalength/2 + 8)) {
-		err = -EFAULT;
-		goto cleanup;
-	}
-
-	set_fs(KERNEL_DS);
-	err = sys_ioctl(fd, cmd, (unsigned long)&rsa);
-	set_fs(old_fs);
-	if (err < 0)
-		goto cleanup;
-
-	if (copy_to_user((char *)(u64)(outputdata & 0x7fffffff), rsa.outputdata,
-			 rsa.outputdatalength))
-		err = -EFAULT;
-
-cleanup:
-	if (rsa.inputdata)
-		kfree(rsa.inputdata);
-	if (rsa.outputdata)
-		kfree(rsa.outputdata);
-	if (rsa.bp_key)
-		kfree(rsa.bp_key);
-	if (rsa.bq_key)
-		kfree(rsa.bq_key);
-	if (rsa.np_prime)
-		kfree(rsa.np_prime);
-	if (rsa.nq_prime)
-		kfree(rsa.nq_prime);
-	if (rsa.u_mult_inv)
-		kfree(rsa.u_mult_inv);
-	
-	return err;
-}
-
-static int w_long(unsigned int fd, unsigned int cmd, unsigned long arg,
-		  struct file *f)
-{
-	mm_segment_t old_fs = get_fs();
-	int err;
-	unsigned long val;
-	
-	set_fs (KERNEL_DS);
-	err = sys_ioctl(fd, cmd, (unsigned long)&val);
-	set_fs (old_fs);
-	if (!err && put_user((unsigned int) val, (u32 *)arg))
-		return -EFAULT;
-	return err;
-}
-
-int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd,
-			 unsigned long arg, struct file *f)
-{
-	/* siocdevprivate cannot be emulated properly */
-	return -EINVAL;
-}
-
-#define COMPATIBLE_IOCTL(cmd)		HANDLE_IOCTL((cmd), NULL)
-#define HANDLE_IOCTL(cmd,handler)	{ (cmd), (handler), NULL },
-#define IOCTL_TABLE_START \
-	struct ioctl_trans ioctl_start[] = {
-#define IOCTL_TABLE_END \
-	};
-
-IOCTL_TABLE_START
+struct ioctl_trans ioctl_start[] = {
+/* architecture independent ioctls */
 #include <linux/compat_ioctl.h>
+#define DECLARES
+#include "../../../fs/compat_ioctl.c"
 
+/* s390 only ioctls */
+#if defined(CONFIG_DASD) || defined(CONFIG_DASD_MODULE)
 COMPATIBLE_IOCTL(DASDAPIVER)
 COMPATIBLE_IOCTL(BIODASDDISABLE)
 COMPATIBLE_IOCTL(BIODASDENABLE)
@@ -822,83 +50,18 @@
 COMPATIBLE_IOCTL(BIODASDSLCK)
 COMPATIBLE_IOCTL(BIODASDINFO)
 COMPATIBLE_IOCTL(BIODASDFMT)
+#endif
 
+#if defined(CONFIG_S390_TAPE) || defined(CONFIG_S390_TAPE_MODULE)
 COMPATIBLE_IOCTL(TAPE390_DISPLAY)
-COMPATIBLE_IOCTL(BLKRASET)
-COMPATIBLE_IOCTL(BLKFRASET)
-COMPATIBLE_IOCTL(BLKBSZGET)
-COMPATIBLE_IOCTL(BLKGETSIZE64)
-
-HANDLE_IOCTL(HDIO_GETGEO, hd_geometry_ioctl)
+#endif
 
+/* This one should be architecture independent */
 COMPATIBLE_IOCTL(TCSBRKP)
 
+/* s390 doesn't need handlers here */
 COMPATIBLE_IOCTL(TIOCGSERIAL)
 COMPATIBLE_IOCTL(TIOCSSERIAL)
-
-COMPATIBLE_IOCTL(SIOCGSTAMP)
-
-HANDLE_IOCTL(SIOCGIFNAME, dev_ifname32)
-HANDLE_IOCTL(SIOCGIFCONF, dev_ifconf)
-HANDLE_IOCTL(SIOCGIFFLAGS, dev_ifsioc)
-HANDLE_IOCTL(SIOCSIFFLAGS, dev_ifsioc)
-HANDLE_IOCTL(SIOCGIFMETRIC, dev_ifsioc)
-HANDLE_IOCTL(SIOCSIFMETRIC, dev_ifsioc)
-HANDLE_IOCTL(SIOCGIFMTU, dev_ifsioc)
-HANDLE_IOCTL(SIOCSIFMTU, dev_ifsioc)
-HANDLE_IOCTL(SIOCGIFMEM, dev_ifsioc)
-HANDLE_IOCTL(SIOCSIFMEM, dev_ifsioc)
-HANDLE_IOCTL(SIOCGIFHWADDR, dev_ifsioc)
-HANDLE_IOCTL(SIOCSIFHWADDR, dev_ifsioc)
-HANDLE_IOCTL(SIOCADDMULTI, dev_ifsioc)
-HANDLE_IOCTL(SIOCDELMULTI, dev_ifsioc)
-HANDLE_IOCTL(SIOCGIFINDEX, dev_ifsioc)
-HANDLE_IOCTL(SIOCGIFMAP, dev_ifsioc)
-HANDLE_IOCTL(SIOCSIFMAP, dev_ifsioc)
-HANDLE_IOCTL(SIOCGIFADDR, dev_ifsioc)
-HANDLE_IOCTL(SIOCSIFADDR, dev_ifsioc)
-HANDLE_IOCTL(SIOCGIFBRDADDR, dev_ifsioc)
-HANDLE_IOCTL(SIOCSIFBRDADDR, dev_ifsioc)
-HANDLE_IOCTL(SIOCGIFDSTADDR, dev_ifsioc)
-HANDLE_IOCTL(SIOCSIFDSTADDR, dev_ifsioc)
-HANDLE_IOCTL(SIOCGIFNETMASK, dev_ifsioc)
-HANDLE_IOCTL(SIOCSIFNETMASK, dev_ifsioc)
-HANDLE_IOCTL(SIOCSIFPFLAGS, dev_ifsioc)
-HANDLE_IOCTL(SIOCGIFPFLAGS, dev_ifsioc)
-HANDLE_IOCTL(SIOCGIFTXQLEN, dev_ifsioc)
-HANDLE_IOCTL(SIOCSIFTXQLEN, dev_ifsioc)
-HANDLE_IOCTL(SIOCADDRT, routing_ioctl)
-HANDLE_IOCTL(SIOCDELRT, routing_ioctl)
-HANDLE_IOCTL(SIOCBONDENSLAVE, bond_ioctl)
-HANDLE_IOCTL(SIOCBONDRELEASE, bond_ioctl)
-HANDLE_IOCTL(SIOCBONDSETHWADDR, bond_ioctl)
-HANDLE_IOCTL(SIOCBONDSLAVEINFOQUERY, bond_ioctl)
-HANDLE_IOCTL(SIOCBONDINFOQUERY, bond_ioctl)
-HANDLE_IOCTL(SIOCBONDCHANGEACTIVE, bond_ioctl)
-
-HANDLE_IOCTL(EXT2_IOC32_GETFLAGS, do_ext2_ioctl)
-HANDLE_IOCTL(EXT2_IOC32_SETFLAGS, do_ext2_ioctl)
-HANDLE_IOCTL(EXT2_IOC32_GETVERSION, do_ext2_ioctl)
-HANDLE_IOCTL(EXT2_IOC32_SETVERSION, do_ext2_ioctl)
-
-HANDLE_IOCTL(LOOP_SET_STATUS, loop_status)
-HANDLE_IOCTL(LOOP_GET_STATUS, loop_status)
-
-HANDLE_IOCTL(ICARSAMODEXPO, do_rsa_ioctl)
-HANDLE_IOCTL(ICARSACRT, do_rsa_crt_ioctl)
-HANDLE_IOCTL(ICARSAMODMULT, do_rsa_ioctl)
-
-COMPATIBLE_IOCTL(ICAZ90STATUS)
-COMPATIBLE_IOCTL(ICAZ90QUIESCE)
-COMPATIBLE_IOCTL(ICAZ90HARDRESET)
-COMPATIBLE_IOCTL(ICAZ90HARDERROR)
-
-HANDLE_IOCTL(BLKRAGET, w_long)
-HANDLE_IOCTL(BLKGETSIZE, w_long)
-HANDLE_IOCTL(BLKFRAGET, w_long)
-HANDLE_IOCTL(BLKSECTGET, w_long)
-HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans)
-
-IOCTL_TABLE_END
+};
 
 int ioctl_table_size = ARRAY_SIZE(ioctl_start);
diff -Nru a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
--- a/arch/s390/kernel/compat_linux.c	Tue Feb  3 19:45:37 2004
+++ b/arch/s390/kernel/compat_linux.c	Tue Feb  3 19:45:37 2004
@@ -5,6 +5,7 @@
  *    Copyright (C) 2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
  *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
  *               Gerhard Tonn (ton@de.ibm.com)   
+ *               Thomas Spatzier (tspat@de.ibm.com)
  *
  *  Conversion between 31bit and 64bit native syscalls.
  *
@@ -934,19 +935,32 @@
 	tot_len = 0;
 	i = count;
 	ivp = iov;
+	retval = -EINVAL;
 	while(i > 0) {
-		u32 len;
+		compat_ssize_t tmp = tot_len;
+		compat_ssize_t len;
 		u32 buf;
 
-		__get_user(len, &vector->iov_len);
-		__get_user(buf, &vector->iov_base);
+		if (__get_user(len, &vector->iov_len) ||
+		    __get_user(buf, &vector->iov_base)) {
+			retval = -EFAULT;
+			goto out;
+		}
+		if (len < 0)	/* size_t not fitting an ssize_t32 .. */
+			goto out;
 		tot_len += len;
+		if (tot_len < tmp) /* maths overflow on the compat_ssize_t */
+			goto out;
 		ivp->iov_base = (void *)A(buf);
 		ivp->iov_len = (__kernel_size_t) len;
 		vector++;
 		ivp++;
 		i--;
 	}
+	if (tot_len == 0) {
+		retval = 0;
+		goto out;
+	}
 
 	inode = file->f_dentry->d_inode;
 	/* VERIFY_WRITE actually means a read, as we write to user space */
@@ -1500,50 +1514,6 @@
 	return err;
 }
 
-struct rusage32 {
-        struct compat_timeval ru_utime;
-        struct compat_timeval ru_stime;
-        s32    ru_maxrss;
-        s32    ru_ixrss;
-        s32    ru_idrss;
-        s32    ru_isrss;
-        s32    ru_minflt;
-        s32    ru_majflt;
-        s32    ru_nswap;
-        s32    ru_inblock;
-        s32    ru_oublock;
-        s32    ru_msgsnd; 
-        s32    ru_msgrcv; 
-        s32    ru_nsignals;
-        s32    ru_nvcsw;
-        s32    ru_nivcsw;
-};
-
-static int put_rusage (struct rusage32 *ru, struct rusage *r)
-{
-	int err;
-	
-	err = put_user (r->ru_utime.tv_sec, &ru->ru_utime.tv_sec);
-	err |= __put_user (r->ru_utime.tv_usec, &ru->ru_utime.tv_usec);
-	err |= __put_user (r->ru_stime.tv_sec, &ru->ru_stime.tv_sec);
-	err |= __put_user (r->ru_stime.tv_usec, &ru->ru_stime.tv_usec);
-	err |= __put_user (r->ru_maxrss, &ru->ru_maxrss);
-	err |= __put_user (r->ru_ixrss, &ru->ru_ixrss);
-	err |= __put_user (r->ru_idrss, &ru->ru_idrss);
-	err |= __put_user (r->ru_isrss, &ru->ru_isrss);
-	err |= __put_user (r->ru_minflt, &ru->ru_minflt);
-	err |= __put_user (r->ru_majflt, &ru->ru_majflt);
-	err |= __put_user (r->ru_nswap, &ru->ru_nswap);
-	err |= __put_user (r->ru_inblock, &ru->ru_inblock);
-	err |= __put_user (r->ru_oublock, &ru->ru_oublock);
-	err |= __put_user (r->ru_msgsnd, &ru->ru_msgsnd);
-	err |= __put_user (r->ru_msgrcv, &ru->ru_msgrcv);
-	err |= __put_user (r->ru_nsignals, &ru->ru_nsignals);
-	err |= __put_user (r->ru_nvcsw, &ru->ru_nvcsw);
-	err |= __put_user (r->ru_nivcsw, &ru->ru_nivcsw);
-	return err;
-}
-
 struct sysinfo32 {
         s32 uptime;
         u32 loads[3];
@@ -1942,7 +1912,8 @@
 		security_bprm_free(&bprm);
 
 out_mm:
-	mmdrop(bprm.mm);
+	if (bprm.mm)
+		mmdrop(bprm.mm);
 
 out_file:
 	if (bprm.file) {
@@ -2706,56 +2677,6 @@
 	return error;
 }
 
-extern asmlinkage int sys_sched_setaffinity(pid_t pid, unsigned int len,
-					    unsigned long *user_mask_ptr);
-
-asmlinkage int sys32_sched_setaffinity(compat_pid_t pid, unsigned int len,
-				       u32 *user_mask_ptr)
-{
-	unsigned long kernel_mask;
-	mm_segment_t old_fs;
-	int ret;
-
-	if (get_user(kernel_mask, user_mask_ptr))
-		return -EFAULT;
-
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sys_sched_setaffinity(pid,
-				    /* XXX Nice api... */
-				    sizeof(kernel_mask),
-				    &kernel_mask);
-	set_fs(old_fs);
-
-	return ret;
-}
-
-extern asmlinkage int sys_sched_getaffinity(pid_t pid, unsigned int len,
-					    unsigned long *user_mask_ptr);
-
-asmlinkage int sys32_sched_getaffinity(compat_pid_t pid, unsigned int len,
-				       u32 *user_mask_ptr)
-{
-	unsigned long kernel_mask;
-	mm_segment_t old_fs;
-	int ret;
-
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sys_sched_getaffinity(pid,
-				    /* XXX Nice api... */
-				    sizeof(kernel_mask),
-				    &kernel_mask);
-	set_fs(old_fs);
-
-	if (ret == 0) {
-		if (put_user(kernel_mask, user_mask_ptr))
-			ret = -EFAULT;
-	}
-
-	return ret;
-}
-
 asmlinkage ssize_t sys_read(unsigned int fd, char * buf, size_t count);
 
 asmlinkage compat_ssize_t sys32_read(unsigned int fd, char * buf, size_t count)
@@ -2792,4 +2713,43 @@
 		       parent_tidptr, child_tidptr);
 }
 
+/*
+ * Wrapper function for sys_timer_create.
+ */
+extern asmlinkage long
+sys_timer_create(clockid_t, struct sigevent *, timer_t *);
+
+asmlinkage long
+sys32_timer_create(clockid_t which_clock, struct sigevent32 *se32,
+		timer_t *timer_id)
+{
+	struct sigevent se;
+	timer_t ktimer_id;
+	mm_segment_t old_fs;
+	long ret;
+
+	if (se32 == NULL)
+		return sys_timer_create(which_clock, NULL, timer_id);
 
+	/* XXX: converting se32 to se is filthy because of the
+	 * two union members. For now it is ok, because the pointers
+	 * are not touched in kernel.
+	 */
+	memset(&se, 0, sizeof(se));
+	if (get_user(se.sigev_value.sival_int,  &se32->sigev_value.sival_int) ||
+	    get_user(se.sigev_signo, &se32->sigev_signo) ||
+	    get_user(se.sigev_notify, &se32->sigev_notify) ||
+	    copy_from_user(&se._sigev_un._pad, &se32->_sigev_un._pad,
+	    sizeof(se._sigev_un._pad)))
+		return -EFAULT;
+
+	old_fs = get_fs();
+	set_fs(KERNEL_DS);
+	ret = sys_timer_create(which_clock, &se, &ktimer_id);
+	set_fs(old_fs);
+
+	if (!ret)
+		ret = put_user (ktimer_id, timer_id);
+
+	return ret;
+}
diff -Nru a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h
--- a/arch/s390/kernel/compat_linux.h	Tue Feb  3 19:45:34 2004
+++ b/arch/s390/kernel/compat_linux.h	Tue Feb  3 19:45:34 2004
@@ -190,4 +190,22 @@
 	compat_sigset_t		uc_sigmask;	/* mask last for extensibility */
 };
 
+#define SIGEV_PAD_SIZE32 ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
+struct sigevent32 {
+	union {
+		int sival_int;
+		u32 sival_ptr;
+	} sigev_value;
+	int sigev_signo;
+	int sigev_notify;
+	union {
+		int _pad[SIGEV_PAD_SIZE32];
+		int _tid;
+		struct {
+			u32 *_function;
+			u32 *_attribute;
+		} _sigev_thread;
+	} _sigev_un;
+};
+
 #endif /* _ASM_S390X_S390_H */
diff -Nru a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
--- a/arch/s390/kernel/compat_signal.c	Tue Feb  3 19:45:42 2004
+++ b/arch/s390/kernel/compat_signal.c	Tue Feb  3 19:45:42 2004
@@ -314,6 +314,9 @@
 	_s390_regs_common32 regs32;
 	int err, i;
 
+	/* Alwys make any pending restarted system call return -EINTR */
+	current_thread_info()->restart_block.fn = do_no_restart_syscall;
+
 	err = __copy_from_user(&regs32, &sregs->regs, sizeof(regs32));
 	if (err)
 		return err;
diff -Nru a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
--- a/arch/s390/kernel/compat_wrapper.S	Tue Feb  3 19:45:43 2004
+++ b/arch/s390/kernel/compat_wrapper.S	Tue Feb  3 19:45:43 2004
@@ -135,7 +135,7 @@
 compat_sys_utime_wrapper:
 	llgtr	%r2,%r2			# char *
 	llgtr	%r3,%r3			# struct compat_utimbuf *
-	jg	compat_sys_utime		# branch to system call
+	jg	compat_sys_utime	# branch to system call
 
 	.globl  sys32_access_wrapper 
 sys32_access_wrapper:
@@ -1192,14 +1192,14 @@
 	lgfr	%r2,%r2			# int
 	llgfr	%r3,%r3			# unsigned int
 	llgtr	%r4,%r4			# unsigned long *
-	jg	sys32_sched_setaffinity
+	jg	compat_sys_sched_setaffinity
 
 	.globl	sys32_sched_getaffinity_wrapper
 sys32_sched_getaffinity_wrapper:
 	lgfr	%r2,%r2			# int
 	llgfr	%r3,%r3			# unsigned int
 	llgtr	%r4,%r4			# unsigned long *
-	jg	sys32_sched_getaffinity
+	jg	compat_sys_sched_getaffinity
 
 	.globl  sys32_exit_group_wrapper
 sys32_exit_group_wrapper:
@@ -1231,6 +1231,77 @@
 	lgfr	%r4,%r4			# int
 	lgfr	%r5,%r5			# int
 	jg	sys_epoll_wait		# branch to system call
+
+	.globl	sys32_fadvise64_wrapper
+sys32_fadvise64_wrapper:
+	lgfr	%r2,%r2			# int
+	sllg	%r3,%r3,32		# get high word of 64bit loff_t
+	or	%r3,%r4			# get low word of 64bit loff_t
+	llgfr	%r4,%r5			# size_t (unsigned long)
+	lgfr	%r5,%r6			# int
+	jg	sys_fadvise64
+
+	.globl	sys32_fadvise64_64_wrapper
+sys32_fadvise64_64_wrapper:
+	llgtr	%r2,%r2			# struct fadvise64_64_args *
+	jg	s390_fadvise64_64
+
+	.globl	sys32_clock_settime_wrapper
+sys32_clock_settime_wrapper:
+	lgfr	%r2,%r2			# clockid_t (int)
+	llgtr	%r3,%r3			# struct compat_timespec *
+	jg	compat_clock_settime
+
+	.globl	sys32_clock_gettime_wrapper
+sys32_clock_gettime_wrapper:
+	lgfr	%r2,%r2			# clockid_t (int)
+	llgtr	%r3,%r3			# struct compat_timespec *
+	jg	compat_clock_gettime
+
+	.globl	sys32_clock_getres_wrapper
+sys32_clock_getres_wrapper:
+	lgfr	%r2,%r2			# clockid_t (int)
+	llgtr	%r3,%r3			# struct compat_timespec *
+	jg	compat_clock_getres
+
+	.globl	sys32_clock_nanosleep_wrapper
+sys32_clock_nanosleep_wrapper:
+	lgfr	%r2,%r2			# clockid_t (int)
+	lgfr	%r3,%r3			# int
+	llgtr	%r4,%r4			# struct compat_timespec *
+	llgtr	%r5,%r5			# struct compat_timespec *
+	jg	compat_clock_nanosleep
+
+	.globl	sys32_timer_create_wrapper
+sys32_timer_create_wrapper:
+	lgfr	%r2,%r2			# timer_t (int)
+	llgtr	%r3,%r3			# struct compat_sigevent *
+	llgtr	%r4,%r4			# timer_t *
+	jg	sys32_timer_create
+
+	.globl	sys32_timer_settime_wrapper
+sys32_timer_settime_wrapper:
+	lgfr	%r2,%r2			# timer_t (int)
+	lgfr	%r3,%r3			# int
+	llgtr	%r4,%r4			# struct compat_itimerspec *
+	llgtr	%r5,%r5			# struct compat_itimerspec *
+	jg	compat_timer_settime
+
+	.globl	sys32_timer_gettime_wrapper
+sys32_timer_gettime_wrapper:
+	lgfr	%r2,%r2			# timer_t (int)
+	llgtr	%r3,%r3			# struct compat_itimerspec *
+	jg	compat_timer_gettime
+
+	.globl	sys32_timer_getoverrun_wrapper
+sys32_timer_getoverrun_wrapper:
+	lgfr	%r2,%r2			# timer_t (int)
+	jg	sys_timer_getoverrun
+
+	.globl	sys32_timer_delete_wrapper
+sys32_timer_delete_wrapper:
+	lgfr	%r2,%r2			# timer_t (int)
+	jg	sys_timer_delete
 
 	.globl	sys32_io_setup_wrapper
 sys32_io_setup_wrapper:
diff -Nru a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
--- a/arch/s390/kernel/entry.S	Tue Feb  3 19:45:17 2004
+++ b/arch/s390/kernel/entry.S	Tue Feb  3 19:45:17 2004
@@ -249,6 +249,8 @@
         l       %r1,BASED(.Ldo_signal)
 	basr	%r14,%r1               # call do_signal
         stnsm   24(%r15),0xfc          # disable I/O and ext. interrupts
+	tm	__TI_flags+3(%r9),_TIF_RESTART_SVC
+	bo	BASED(sysc_restart)
 	b	BASED(sysc_leave)      # out of here, do NOT recheck
 
 #
@@ -258,7 +260,7 @@
 	ni	__TI_flags+3(%r9),255-_TIF_RESTART_SVC # clear TIF_RESTART_SVC
 	stosm	24(%r15),0x03          # reenable interrupts
 	l	%r7,SP_R2(%r15)        # load new svc number
-	sla	%r2,2
+	sla	%r7,2
 	mvc	SP_R2(4,%r15),SP_ORIG_R2(%r15) # restore first argument
 	lm	%r2,%r6,SP_R2(%r15)    # load svc arguments
 	b	BASED(sysc_do_restart) # restart svc
@@ -541,7 +543,7 @@
 io_resume_loop:
 	tm	__TI_flags+3(%r9),_TIF_NEED_RESCHED
 	bno	BASED(io_leave)
-	mvc     __TI_precount(4,%r9),.Lc_pactive
+	mvc     __TI_precount(4,%r9),BASED(.Lc_pactive)
 	# hmpf, we are on the async. stack but to call schedule
 	# we have to move the interrupt frame to the process stack
 	l	%r1,SP_R15(%r15)
diff -Nru a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
--- a/arch/s390/kernel/entry64.S	Tue Feb  3 19:45:17 2004
+++ b/arch/s390/kernel/entry64.S	Tue Feb  3 19:45:17 2004
@@ -169,9 +169,10 @@
         slag    %r7,%r7,2         # *4 and test for svc 0
 	jnz	sysc_do_restart
 	# svc 0: system call number in %r1
-	clg	%r1,.Lnr_syscalls-.Lconst(%r14)
+	cl	%r1,.Lnr_syscalls-.Lconst(%r14)
 	jnl	sysc_do_restart
-	slag    %r7,%r1,2         # svc 0: system call number in %r1
+	lgfr	%r7,%r1           # clear high word in r1
+	slag    %r7,%r7,2         # svc 0: system call number in %r1
 sysc_do_restart:
 	larl    %r10,sys_call_table
 #ifdef CONFIG_S390_SUPPORT
@@ -235,16 +236,18 @@
         sgr     %r3,%r3           # clear *oldset
 	brasl	%r14,do_signal    # call do_signal
 	stnsm   48(%r15),0xfc     # disable I/O and ext. interrupts
+	tm	__TI_flags+7(%r9),_TIF_RESTART_SVC
+	jo	sysc_restart
 	j	sysc_leave        # out of here, do NOT recheck
 
 #
 # _TIF_RESTART_SVC is set, set up registers and restart svc
 #
 sysc_restart:
-	ni	__TI_flags+3(%r9),255-_TIF_RESTART_SVC # clear TIF_RESTART_SVC
+	ni	__TI_flags+7(%r9),255-_TIF_RESTART_SVC # clear TIF_RESTART_SVC
 	stosm	48(%r15),0x03          # reenable interrupts
 	lg	%r7,SP_R2(%r15)        # load new svc number
-        slag    %r7,%r7,3              # *8
+        slag    %r7,%r7,2              # *4
 	mvc	SP_R2(8,%r15),SP_ORIG_R2(%r15) # restore first argument
 	lmg	%r2,%r6,SP_R2(%r15)    # load svc arguments
 	j	sysc_do_restart        # restart svc
@@ -503,7 +506,7 @@
 	larl    %r10,sys_call_table_emu # use 31 bit emulation system calls
 pgm_svcper_noemu:
 #endif
-	tm	__TI_flags+3(%r9),_TIF_SYSCALL_TRACE
+	tm	__TI_flags+7(%r9),_TIF_SYSCALL_TRACE
         lgf     %r8,0(%r7,%r10)   # load address of system call routine
         jo      pgm_tracesys
         basr    %r14,%r8          # call sys_xxxx
@@ -512,7 +515,7 @@
                                   # changing anything here !!
 
 pgm_svcret:
-	tm	__TI_flags+3(%r9),_TIF_SIGPENDING
+	tm	__TI_flags+7(%r9),_TIF_SIGPENDING
 	jo	pgm_svcper_nosig
         la      %r2,SP_PTREGS(%r15) # load pt_regs
         sgr     %r3,%r3             # clear *oldset
diff -Nru a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
--- a/arch/s390/kernel/head.S	Tue Feb  3 19:45:17 2004
+++ b/arch/s390/kernel/head.S	Tue Feb  3 19:45:17 2004
@@ -569,6 +569,19 @@
        oi     3(%r12),16                # set MVPG flag
 .Lchkmvpg:
 
+#
+# find out if we have the IDTE instruction
+#
+	mvc	__LC_PGM_NEW_PSW(8),.Lpcidte-.LPG1(%r13)
+	.long	0xb2b10000		# store facility list
+	tm	0xc8,0x08		# check bit for clearing-by-ASCE
+	bno	.Lchkidte-.LPG1(%r13)
+	lhi	%r1,2094
+	lhi	%r2,0
+	.long	0xb98e2001
+	oi	3(%r12),0x80		# set IDTE flag
+.Lchkidte:
+
         lpsw  .Lentry-.LPG1(13)         # jump to _stext in primary-space,
                                         # virtual and never return ...
         .align 8
@@ -593,6 +606,7 @@
 .Lpcfpu:.long  0x00080000,0x80000000 + .Lchkfpu
 .Lpccsp:.long  0x00080000,0x80000000 + .Lchkcsp
 .Lpcmvpg:.long 0x00080000,0x80000000 + .Lchkmvpg
+.Lpcidte:.long 0x00080000,0x80000000 + .Lchkidte
 .Lmemsize:.long memory_size
 .Lmchunk:.long memory_chunk
 .Lmflags:.long machine_flags
diff -Nru a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
--- a/arch/s390/kernel/head64.S	Tue Feb  3 19:45:17 2004
+++ b/arch/s390/kernel/head64.S	Tue Feb  3 19:45:17 2004
@@ -582,6 +582,20 @@
 	mvc    __LC_DIAG44_OPCODE(8),.Ldiag44-.LPG1(%r13)
 0:	
 
+#
+# find out if we have the IDTE instruction
+#
+	la     %r1,0f-.LPG1(%r13)	# set program check address
+	stg    %r1,__LC_PGM_NEW_PSW+8
+	.long	0xb2b10000		# store facility list
+	tm	0xc8,0x08		# check bit for clearing-by-ASCE
+	bno	0f-.LPG1(%r13)
+	lhi	%r1,2094
+	lhi	%r2,0
+	.long	0xb98e2001
+	oi	7(%r12),0x80		# set IDTE flag
+0:
+
         lpswe .Lentry-.LPG1(13)         # jump to _stext in primary-space,
                                         # virtual and never return ...
         .align 16
diff -Nru a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
--- a/arch/s390/kernel/ptrace.c	Tue Feb  3 19:45:42 2004
+++ b/arch/s390/kernel/ptrace.c	Tue Feb  3 19:45:42 2004
@@ -130,7 +130,11 @@
 	struct user *dummy = NULL;
 	addr_t offset, tmp;
 
-	if ((addr & __ADDR_MASK) || addr > sizeof(struct user) - __ADDR_MASK)
+	/*
+	 * Stupid gdb peeks/pokes the access registers in 64 bit with
+	 * an alignment of 4. Programmers from hell...
+	 */
+	if ((addr & 3) || addr > sizeof(struct user) - __ADDR_MASK)
 		return -EIO;
 
 	if (addr <= (addr_t) &dummy->regs.orig_gpr2) {
@@ -138,6 +142,9 @@
 		 * psw, gprs, acrs and orig_gpr2 are stored on the stack
 		 */
 		tmp = *(addr_t *)((addr_t) __KSTK_PTREGS(child) + addr);
+		if (addr == (addr_t) &dummy->regs.psw.mask)
+			/* Remove per bit from user psw. */
+			tmp &= ~PSW_MASK_PER;
 
 	} else if (addr >= (addr_t) &dummy->regs.fp_regs &&
 		   addr < (addr_t) (&dummy->regs.fp_regs + 1)) {
@@ -173,7 +180,11 @@
 	struct user *dummy = NULL;
 	addr_t offset;
 
-	if ((addr & __ADDR_MASK) || addr > sizeof(struct user) - __ADDR_MASK)
+	/*
+	 * Stupid gdb peeks/pokes the access registers in 64 bit with
+	 * an alignment of 4. Programmers from hell indeed...
+	 */
+	if ((addr & 3) || addr > sizeof(struct user) - __ADDR_MASK)
 		return -EIO;
 
 	if (addr <= (addr_t) &dummy->regs.orig_gpr2) {
@@ -258,7 +269,7 @@
 
 	case PTRACE_PEEKUSR_AREA:
 	case PTRACE_POKEUSR_AREA:
-		if (!copy_from_user(&parea, (void *) addr, sizeof(parea)))
+		if (copy_from_user(&parea, (void *) addr, sizeof(parea)))
 			return -EFAULT;
 		addr = parea.kernel_addr;
 		data = parea.process_addr;
@@ -266,8 +277,12 @@
 		while (copied < parea.len) {
 			if (request == PTRACE_PEEKUSR_AREA)
 				ret = peek_user(child, addr, data);
-			else
-				ret = poke_user(child, addr, data);
+			else {
+				addr_t tmp;
+				if (get_user (tmp, (addr_t *) data))
+					return -EFAULT;
+				ret = poke_user(child, addr, tmp);
+			}
 			if (ret)
 				return ret;
 			addr += sizeof(unsigned long);
@@ -390,7 +405,7 @@
 			if ((tmp & ~PSW32_MASK_CC) != PSW32_USER_BITS)
 				/* Invalid psw mask. */
 				return -EINVAL;
-			__KSTK_PTREGS(child)->psw.mask = PSW_USER_BITS |
+			__KSTK_PTREGS(child)->psw.mask = PSW_USER32_BITS |
 				((tmp & PSW32_MASK_CC) << 32);
 		} else if (addr == (addr_t) &dummy32->regs.psw.addr) {
 			/* Build a 64 bit psw address from 31 bit address. */
@@ -484,7 +499,7 @@
 
 	case PTRACE_PEEKUSR_AREA:
 	case PTRACE_POKEUSR_AREA:
-		if (!copy_from_user(&parea, (void *) addr, sizeof(parea)))
+		if (copy_from_user(&parea, (void *) addr, sizeof(parea)))
 			return -EFAULT;
 		addr = parea.kernel_addr;
 		data = parea.process_addr;
@@ -492,8 +507,12 @@
 		while (copied < parea.len) {
 			if (request == PTRACE_PEEKUSR_AREA)
 				ret = peek_user_emu31(child, addr, data);
-			else
-				ret = poke_user_emu31(child, addr, data);
+			else {
+				__u32 tmp;
+				if (get_user (tmp, (__u32 *) data))
+					return -EFAULT;
+				ret = poke_user_emu31(child, addr, tmp);
+			}
 			if (ret)
 				return ret;
 			addr += sizeof(unsigned int);
diff -Nru a/arch/s390/kernel/s390_ksyms.c b/arch/s390/kernel/s390_ksyms.c
--- a/arch/s390/kernel/s390_ksyms.c	Tue Feb  3 19:45:30 2004
+++ b/arch/s390/kernel/s390_ksyms.c	Tue Feb  3 19:45:30 2004
@@ -9,6 +9,7 @@
 #include <linux/mm.h>
 #include <linux/smp.h>
 #include <linux/interrupt.h>
+#include <linux/ioctl32.h>
 #include <asm/checksum.h>
 #include <asm/cpcmd.h>
 #include <asm/delay.h>
@@ -74,4 +75,5 @@
 EXPORT_SYMBOL_NOVERS(do_call_softirq);
 EXPORT_SYMBOL(sys_wait4);
 EXPORT_SYMBOL(cpcmd);
+EXPORT_SYMBOL(sys_ioctl);
 
diff -Nru a/arch/s390/kernel/semaphore.c b/arch/s390/kernel/semaphore.c
--- a/arch/s390/kernel/semaphore.c	Tue Feb  3 19:45:42 2004
+++ b/arch/s390/kernel/semaphore.c	Tue Feb  3 19:45:42 2004
@@ -64,14 +64,14 @@
 	struct task_struct *tsk = current;
 	DECLARE_WAITQUEUE(wait, tsk);
 
-	tsk->state = TASK_UNINTERRUPTIBLE;
+	__set_task_state(tsk, TASK_UNINTERRUPTIBLE);
 	add_wait_queue_exclusive(&sem->wait, &wait);
 	while (__sem_update_count(sem, -1) <= 0) {
 		schedule();
-		tsk->state = TASK_UNINTERRUPTIBLE;
+		set_task_state(tsk, TASK_UNINTERRUPTIBLE);
 	}
 	remove_wait_queue(&sem->wait, &wait);
-	tsk->state = TASK_RUNNING;
+	__set_task_state(tsk, TASK_RUNNING);
 	wake_up(&sem->wait);
 }
 
@@ -87,7 +87,7 @@
 	struct task_struct *tsk = current;
 	DECLARE_WAITQUEUE(wait, tsk);
 
-	tsk->state = TASK_INTERRUPTIBLE;
+	__set_task_state(tsk, TASK_INTERRUPTIBLE);
 	add_wait_queue_exclusive(&sem->wait, &wait);
 	while (__sem_update_count(sem, -1) <= 0) {
 		if (signal_pending(current)) {
@@ -96,10 +96,10 @@
 			break;
 		}
 		schedule();
-		tsk->state = TASK_INTERRUPTIBLE;
+		set_task_state(tsk, TASK_INTERRUPTIBLE);
 	}
 	remove_wait_queue(&sem->wait, &wait);
-	tsk->state = TASK_RUNNING;
+	__set_task_state(tsk, TASK_RUNNING);
 	wake_up(&sem->wait);
 	return retval;
 }
diff -Nru a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
--- a/arch/s390/kernel/setup.c	Tue Feb  3 19:45:16 2004
+++ b/arch/s390/kernel/setup.c	Tue Feb  3 19:45:16 2004
@@ -158,8 +158,10 @@
 	int vdev;
 
 	vdev = simple_strtoul(str, &str, 0);
-	if (vdev >= 0 && vdev < 65536)
+	if (vdev >= 0 && vdev < 65536) {
 		console_device = vdev;
+		console_irq = -1;
+	}
 	return 1;
 }
 
@@ -287,6 +289,7 @@
 
 void machine_restart(char *command)
 {
+	console_unblank();
 	_machine_restart(command);
 }
 
@@ -294,6 +297,7 @@
 
 void machine_halt(void)
 {
+	console_unblank();
 	_machine_halt();
 }
 
@@ -301,6 +305,7 @@
 
 void machine_power_off(void)
 {
+	console_unblank();
 	_machine_power_off();
 }
 
diff -Nru a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
--- a/arch/s390/kernel/signal.c	Tue Feb  3 19:45:37 2004
+++ b/arch/s390/kernel/signal.c	Tue Feb  3 19:45:37 2004
@@ -167,6 +167,9 @@
 {
 	int err;
 
+	/* Alwys make any pending restarted system call return -EINTR */
+	current_thread_info()->restart_block.fn = do_no_restart_syscall;
+
 	err = __copy_from_user(regs, &sregs->regs, sizeof(_s390_regs_common));
 	regs->psw.mask = PSW_USER_BITS | (regs->psw.mask & PSW_MASK_CC);
 	regs->psw.addr |= PSW_ADDR_AMODE;
diff -Nru a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c
--- a/arch/s390/kernel/sys_s390.c	Tue Feb  3 19:45:17 2004
+++ b/arch/s390/kernel/sys_s390.c	Tue Feb  3 19:45:17 2004
@@ -325,3 +325,39 @@
 	return ret;
 }
 #endif /* CONFIG_ARCH_S390X */
+
+/*
+ * Wrapper function for sys_fadvise64/fadvise64_64
+ */
+#ifndef CONFIG_ARCH_S390X
+
+extern asmlinkage long sys_fadvise64(int, loff_t, size_t, int);
+
+asmlinkage long
+s390_fadvise64(int fd, u32 offset_high, u32 offset_low, size_t len, int advice)
+{
+	return sys_fadvise64(fd, (u64) offset_high << 32 | offset_low,
+			len, advice);
+}
+
+#endif
+
+extern asmlinkage long sys_fadvise64_64(int, loff_t, loff_t, int);
+
+struct fadvise64_64_args {
+	int fd;
+	long long offset;
+	long long len;
+	int advice;
+};
+
+asmlinkage long
+s390_fadvise64_64(struct fadvise64_64_args *args)
+{
+	struct fadvise64_64_args a;
+
+	if ( copy_from_user(&a, args, sizeof(a)) )
+		return -EFAULT;
+	return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice);
+}
+
diff -Nru a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S
--- a/arch/s390/kernel/syscalls.S	Tue Feb  3 19:45:16 2004
+++ b/arch/s390/kernel/syscalls.S	Tue Feb  3 19:45:16 2004
@@ -15,7 +15,7 @@
 SYSCALL(sys_write,sys_write,sys32_write_wrapper)
 SYSCALL(sys_open,sys_open,sys32_open_wrapper)			/* 5 */
 SYSCALL(sys_close,sys_close,sys32_close_wrapper)
-SYSCALL(sys_restart_syscall,sys_restart_syscall,sys_ni_syscall)
+SYSCALL(sys_restart_syscall,sys_restart_syscall,sys_restart_syscall)
 SYSCALL(sys_creat,sys_creat,sys32_creat_wrapper)
 SYSCALL(sys_link,sys_link,sys32_link_wrapper)
 SYSCALL(sys_unlink,sys_unlink,sys32_unlink_wrapper)		/* 10 */
@@ -261,14 +261,15 @@
 SYSCALL(sys_epoll_ctl,sys_epoll_ctl,sys_epoll_ctl_wrapper)	/* 250 */
 SYSCALL(sys_epoll_wait,sys_epoll_wait,sys_epoll_wait_wrapper)
 SYSCALL(sys_set_tid_address,sys_set_tid_address,sys32_set_tid_address_wrapper)
-SYSCALL(sys_fadvise64,sys_fadvise64,sys_ni_syscall)
-SYSCALL(sys_timer_create,sys_timer_create,sys_ni_syscall)
-SYSCALL(sys_timer_settime,sys_timer_settime,sys_ni_syscall)	/* 255 */
-SYSCALL(sys_timer_gettime,sys_timer_gettime,sys_ni_syscall)
-SYSCALL(sys_timer_getoverrun,sys_timer_getoverrun,sys_ni_syscall)
-SYSCALL(sys_timer_delete,sys_timer_delete,sys_ni_syscall)
-SYSCALL(sys_clock_settime,sys_clock_settime,sys_ni_syscall)
-SYSCALL(sys_clock_gettime,sys_clock_gettime,sys_ni_syscall)	/* 260 */
-SYSCALL(sys_clock_getres,sys_clock_getres,sys_ni_syscall)
-SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,sys_ni_syscall)
+SYSCALL(s390_fadvise64,sys_fadvise64_64,sys32_fadvise64_wrapper)
+SYSCALL(sys_timer_create,sys_timer_create,sys32_timer_create_wrapper)
+SYSCALL(sys_timer_settime,sys_timer_settime,sys32_timer_settime_wrapper)	/* 255 */
+SYSCALL(sys_timer_gettime,sys_timer_gettime,sys32_timer_gettime_wrapper)
+SYSCALL(sys_timer_getoverrun,sys_timer_getoverrun,sys32_timer_getoverrun_wrapper)
+SYSCALL(sys_timer_delete,sys_timer_delete,sys32_timer_delete_wrapper)
+SYSCALL(sys_clock_settime,sys_clock_settime,sys32_clock_settime_wrapper)
+SYSCALL(sys_clock_gettime,sys_clock_gettime,sys32_clock_gettime_wrapper)	/* 260 */
+SYSCALL(sys_clock_getres,sys_clock_getres,sys32_clock_getres_wrapper)
+SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,sys32_clock_nanosleep_wrapper)
 NI_SYSCALL							/* reserved for vserver */
+SYSCALL(s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper)
diff -Nru a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
--- a/arch/s390/kernel/traps.c	Tue Feb  3 19:45:17 2004
+++ b/arch/s390/kernel/traps.c	Tue Feb  3 19:45:17 2004
@@ -25,6 +25,7 @@
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/init.h>
+#include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/module.h>
 #include <linux/kallsyms.h>
@@ -156,9 +157,10 @@
 	int i;
 
 	mode = (regs->psw.mask & PSW_MASK_PSTATE) ? "User" : "Krnl";
-	printk("%s PSW : %p %p\n",
+	printk("%s PSW : %p %p",
 	       mode, (void *) regs->psw.mask,
 	       (void *) regs->psw.addr);
+	print_symbol(" (%s)\n", regs->psw.addr & PSW_ADDR_INSN);
 	printk("%s GPRS: " FOURLONG, mode,
 	       regs->gprs[0], regs->gprs[1], regs->gprs[2], regs->gprs[3]);
 	printk("           " FOURLONG,
@@ -250,6 +252,10 @@
         show_regs(regs);
 	bust_spinlocks(0);
         spin_unlock_irq(&die_lock);
+	if (in_interrupt())
+		panic("Fatal exception in interrupt");
+	if (panic_on_oops)
+		panic("Fatal exception: panic_on_oops");
         do_exit(SIGSEGV);
 }
 
diff -Nru a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
--- a/arch/s390/kernel/vmlinux.lds.S	Tue Feb  3 19:45:17 2004
+++ b/arch/s390/kernel/vmlinux.lds.S	Tue Feb  3 19:45:17 2004
@@ -117,10 +117,7 @@
 
   /* Sections to be discarded */
   /DISCARD/ : {
-	*(.exit.text)
-	*(.exit.data)
 	*(.exitcall.exit)
-	*(.eh_frame)
 	}
 
   /* Stabs debugging sections.  */
diff -Nru a/arch/s390/lib/uaccess.S b/arch/s390/lib/uaccess.S
--- a/arch/s390/lib/uaccess.S	Tue Feb  3 19:45:34 2004
+++ b/arch/s390/lib/uaccess.S	Tue Feb  3 19:45:34 2004
@@ -73,6 +73,41 @@
 
         .align 4
         .text
+        .globl __copy_in_user_asm
+__copy_in_user_asm:
+	stm	%r6,%r15,24(%r15)
+	lr	%r5,%r3
+	lr	%r7,%r3
+	lr	%r6,%r2
+	cpya	6,4          # ar6 = ar4
+	sacf	512
+0:	mvcle	%r4,%r6,0
+	jo	0b
+1:	sacf	0
+	lr	%r2,%r7
+	lm	%r6,%r15,24(%r15)
+	br	%r14
+2:	lhi	%r1,-4096
+	lr	%r5,%r4
+	slr	%r5,%r1      # %r5 = %r4 + 4096
+	nr	%r5,%r1      # %r5 = (%r4 + 4096) & -4096
+	slr	%r5,%r4      # %r5 = #bytes to next user page boundary
+	clr	%r7,%r5      # copy crosses next page boundary ?
+	jnh	1b           # no, the current page fauled
+	# The page after the current user page might have faulted.
+	# We cant't find out which page because the program check handler
+	# might have callled schedule, destroying all lowcore information.
+	# We retry with the shortened length.
+3:	mvcle	%r4,%r6,0
+	jo	3b
+	j	1b
+        .section __ex_table,"a"
+	.long	0b,2b
+	.long	3b,1b
+        .previous
+
+        .align 4
+        .text
         .globl __clear_user_asm
 __clear_user_asm:
 	lr	%r4,%r2
diff -Nru a/arch/s390/lib/uaccess64.S b/arch/s390/lib/uaccess64.S
--- a/arch/s390/lib/uaccess64.S	Tue Feb  3 19:45:41 2004
+++ b/arch/s390/lib/uaccess64.S	Tue Feb  3 19:45:41 2004
@@ -73,6 +73,41 @@
 
         .align 4
         .text
+        .globl __copy_in_user_asm
+__copy_in_user_asm:
+	stmg	%r6,%r15,48(%r15)
+	lgr	%r5,%r3
+	lgr	%r7,%r5
+	lgr	%r6,%r2
+	cpya	6,4          # ar6 = ar4
+	sacf	512
+0:	mvcle	%r4,%r6,0
+	jo	0b
+1:	sacf	0
+	lgr	%r2,%r7
+	lmg	%r6,%r15,48(%r15)
+	br	%r14
+2:	lghi	%r1,-4096
+	lgr	%r5,%r4
+	slgr	%r5,%r1      # %r5 = %r4 + 4096
+	ngr	%r5,%r1      # %r5 = (%r4 + 4096) & -4096
+	slgr	%r5,%r4      # %r5 = #bytes to next user page boundary
+	clgr	%r7,%r5      # copy crosses next page boundary ?
+	jnh	1b           # no, the current page fauled
+	# The page after the current user page might have faulted.
+	# We cant't find out which page because the program check handler
+	# might have callled schedule, destroying all lowcore information.
+	# We retry with the shortened length.
+3:	mvcle	%r4,%r6,0
+	jo	3b
+	j	1b
+        .section __ex_table,"a"
+	.quad	0b,2b
+	.quad	3b,1b
+        .previous
+
+        .align 4
+        .text
         .globl __clear_user_asm
 __clear_user_asm:
 	lgr	%r4,%r2
diff -Nru a/arch/s390/mm/Makefile b/arch/s390/mm/Makefile
--- a/arch/s390/mm/Makefile	Tue Feb  3 19:45:42 2004
+++ b/arch/s390/mm/Makefile	Tue Feb  3 19:45:42 2004
@@ -2,4 +2,4 @@
 # Makefile for the linux s390-specific parts of the memory manager.
 #
 
-obj-y	 := init.o fault.o ioremap.o extable.o
+obj-y	 := init.o fault.o ioremap.o
diff -Nru a/arch/s390/mm/extable.c b/arch/s390/mm/extable.c
--- a/arch/s390/mm/extable.c	Tue Feb  3 19:45:34 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,34 +0,0 @@
-/*
- *  arch/s390/mm/extable.c
- *
- *  S390 version
- *
- *  identical to arch/i386/mm/extable.c
- */
-
-#include <linux/config.h>
-#include <linux/module.h>
-#include <linux/spinlock.h>
-#include <asm/uaccess.h>
-
-/* Simple binary search */
-const struct exception_table_entry *
-search_extable(const struct exception_table_entry *first,
-	       const struct exception_table_entry *last,
-	       unsigned long value)
-{
-	while (first <= last) {
-		const struct exception_table_entry *mid;
-		long diff;
-
-		mid = (last - first) / 2 + first;
-		diff = mid->insn - value;
-		if (diff == 0)
-			return mid;
-		else if (diff < 0)
-			first = mid+1;
-		else
-			last = mid-1;
-	}
-	return NULL;
-}
diff -Nru a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
--- a/arch/s390/mm/fault.c	Tue Feb  3 19:45:37 2004
+++ b/arch/s390/mm/fault.c	Tue Feb  3 19:45:37 2004
@@ -538,8 +538,6 @@
 pfault_interrupt(struct pt_regs *regs, __u16 error_code)
 {
 	struct task_struct *tsk;
-	wait_queue_head_t queue;
-	wait_queue_head_t *qp;
 	__u16 subcode;
 
 	/*
@@ -553,46 +551,34 @@
 		return;
 
 	/*
-	 * Get the token (= address of kernel stack of affected task).
+	 * Get the token (= address of the task structure of the affected task).
 	 */
 	tsk = *(struct task_struct **) __LC_PFAULT_INTPARM;
 
-	/*
-	 * We got all needed information from the lowcore and can
-	 * now safely switch on interrupts.
-	 */
-	if (regs->psw.mask & PSW_MASK_PSTATE)
-		local_irq_enable();
-
 	if (subcode & 0x0080) {
 		/* signal bit is set -> a page has been swapped in by VM */
-		qp = (wait_queue_head_t *)
-			xchg(&tsk->thread.pfault_wait, -1);
-		if (qp != NULL) {
+		if (xchg(&tsk->thread.pfault_wait, -1) != 0) {
 			/* Initial interrupt was faster than the completion
 			 * interrupt. pfault_wait is valid. Set pfault_wait
 			 * back to zero and wake up the process. This can
 			 * safely be done because the task is still sleeping
 			 * and can't procude new pfaults. */
-			tsk->thread.pfault_wait = 0ULL;
-			wake_up(qp);
+			tsk->thread.pfault_wait = 0;
+			wake_up_process(tsk);
 		}
 	} else {
 		/* signal bit not set -> a real page is missing. */
-                init_waitqueue_head (&queue);
-		qp = (wait_queue_head_t *)
-			xchg(&tsk->thread.pfault_wait, (addr_t) &queue);
-		if (qp != NULL) {
+		set_task_state(tsk, TASK_UNINTERRUPTIBLE);
+		if (xchg(&tsk->thread.pfault_wait, 1) != 0) {
 			/* Completion interrupt was faster than the initial
 			 * interrupt (swapped in a -1 for pfault_wait). Set
 			 * pfault_wait back to zero and exit. This can be
 			 * done safely because tsk is running in kernel 
 			 * mode and can't produce new pfaults. */
-			tsk->thread.pfault_wait = 0ULL;
-		}
-
-                /* go to sleep */
-                wait_event(queue, tsk->thread.pfault_wait == 0ULL);
+			tsk->thread.pfault_wait = 0;
+			set_task_state(tsk, TASK_RUNNING);
+		} else
+			set_tsk_need_resched(tsk);
 	}
 }
 #endif
diff -Nru a/arch/s390/mm/init.c b/arch/s390/mm/init.c
--- a/arch/s390/mm/init.c	Tue Feb  3 19:45:34 2004
+++ b/arch/s390/mm/init.c	Tue Feb  3 19:45:34 2004
@@ -79,8 +79,6 @@
  * paging_init() sets up the page tables
  */
 
-unsigned long last_valid_pfn;
-
 #ifndef CONFIG_ARCH_S390X
 void __init paging_init(void)
 {
diff -Nru a/arch/sh/Kconfig b/arch/sh/Kconfig
--- a/arch/sh/Kconfig	Tue Feb  3 19:45:43 2004
+++ b/arch/sh/Kconfig	Tue Feb  3 19:45:43 2004
@@ -25,14 +25,6 @@
 config RWSEM_XCHGADD_ALGORITHM
 	bool
 
-config GENERIC_ISA_DMA
-	bool
-	default y
-
-config VARIABLE_CLOCK_TICK_RATE
-	bool
-	default y
-
 source "init/Kconfig"
 
 
@@ -54,6 +46,12 @@
 	  Select 7751 SolutionEngine if configuring for a Hitachi SH7751
 	  evalutation board.
 
+config SH_7751_SYSTEMH
+	bool "SystemH7751R"
+	help
+	  Select SystemH if you are configuring for a Renesas SystemH
+	  7751R evaluation board.
+
 config SH_STB1_HARP
 	bool "STB1_Harp"
 
@@ -102,6 +100,8 @@
 
 config SH_SATURN
 	bool "Saturn"
+	help
+	  Select Saturn if configuring for a SEGA Saturn.
 
 config SH_DREAMCAST
 	bool "Dreamcast"
@@ -132,6 +132,13 @@
 config SH_MPC1211
 	bool "MPC1211"
 
+config SH_SECUREEDGE5410
+	bool "SecureEdge5410"
+	help
+	  Select SecureEdge5410 if configuring for a SnapGear SH board.
+	  This includes both the OEM SecureEdge products as well as the
+	  SME product line.
+
 config SH_UNKNOWN
 	bool "BareCPU"
 	help
@@ -146,6 +153,85 @@
 
 endchoice
 
+choice
+	prompt "Processor family"
+	default CPU_SH4
+	help
+	  This option determines the CPU family to compile for. Supported
+	  targets are SH-2, SH-3, and SH-4. These options are independent of
+	  CPU functionality. As such, SH-DSP users will still want to select
+	  their respective processor family in addition to the DSP support
+	  option.
+
+config CPU_SH2
+	bool "SH-2"
+	select SH_WRITETHROUGH
+
+config CPU_SH3
+	bool "SH-3"
+
+config CPU_SH4
+	bool "SH-4"
+
+endchoice
+
+choice
+	prompt "Processor subtype"
+	
+config CPU_SUBTYPE_SH7604
+	bool "SH7604"
+	depends on CPU_SH2
+	help
+	  Select SH7604 if you have SH7604
+
+config CPU_SUBTYPE_SH7300
+	bool "SH7300"
+	depends on CPU_SH3
+	  
+config CPU_SUBTYPE_SH7707
+	bool "SH7707"
+	depends on CPU_SH3
+	help
+	  Select SH7707 if you have a  60 Mhz SH-3 HD6417707 CPU.
+
+config CPU_SUBTYPE_SH7708
+	bool "SH7708"
+	depends on CPU_SH3
+	help
+	  Select SH7708 if you have a  60 Mhz SH-3 HD6417708S or
+	  if you have a 100 Mhz SH-3 HD6417708R CPU.
+
+config CPU_SUBTYPE_SH7709
+	bool "SH7709"
+	depends on CPU_SH3
+	help
+	  Select SH7709 if you have a  80 Mhz SH-3 HD6417709 CPU.
+
+config CPU_SUBTYPE_SH7750
+	bool "SH7750"
+	depends on CPU_SH4
+	help
+	  Select SH7750 if you have a 200 Mhz SH-4 HD6417750 CPU.
+
+config CPU_SUBTYPE_SH7751
+	bool "SH7751/SH7751R"
+	depends on CPU_SH4
+	help
+	  Select SH7751 if you have a 166 Mhz SH-4 HD6417751 CPU,
+	  or if you have a HD6417751R CPU.
+
+config CPU_SUBTYPE_SH7760
+	bool "SH7760"
+	depends on CPU_SH4
+
+config CPU_SUBTYPE_ST40STB1
+	bool "ST40STB1"
+	depends on CPU_SH4
+	help
+	  Select ST40STB1 if you have a ST40STB1 CPU.
+
+endchoice
+
 config MMU
         bool "Support for memory management hardware"
 	depends on !CPU_SH2
@@ -169,8 +255,8 @@
 # Platform-specific memory start and size definitions
 config MEMORY_START
 	hex "Physical memory start address" if !MEMORY_SET || MEMORY_OVERRIDE
-	default "08000000" if !MEMORY_SET || MEMORY_OVERRIDE || !MEMORY_OVERRIDE && SH_ADX || SH_MPC1211
-	default "0c000000" if !MEMORY_OVERRIDE && (SH_DREAMCAST || SH_HP600 || SH_BIGSUR || SH_SH2000 || SH_7751_SOLUTION_ENGINE || SH_SOLUTION_ENGINE)
+	default "0x08000000" if !MEMORY_SET || MEMORY_OVERRIDE || !MEMORY_OVERRIDE && SH_ADX || SH_MPC1211 || SH_SECUREEDGE5410
+	default "0x0c000000" if !MEMORY_OVERRIDE && (SH_DREAMCAST || SH_HP600 || SH_BIGSUR || SH_SH2000 || SH_7751_SOLUTION_ENGINE || SH_SOLUTION_ENGINE)
 	---help---
 	  Computers built with Hitachi SuperH processors always
 	  map the ROM starting at address zero.  But the processor
@@ -187,11 +273,11 @@
 
 config MEMORY_SIZE
 	hex "Physical memory size" if !MEMORY_SET || MEMORY_OVERRIDE
-	default "00400000" if !MEMORY_SET || MEMORY_OVERRIDE || !MEMORY_OVERRIDE && SH_ADX || !MEMORY_OVERRIDE && (SH_HP600 || SH_BIGSUR || SH_SH2000)
-	default "01000000" if !MEMORY_OVERRIDE && SH_DREAMCAST
-	default "04000000" if !MEMORY_OVERRIDE && SH_7751_SOLUTION_ENGINE
-	default "02000000" if !MEMORY_OVERRIDE && SH_SOLUTION_ENGINE
-	default "08000000" if SH_MPC1211
+	default "0x00400000" if !MEMORY_SET || MEMORY_OVERRIDE || !MEMORY_OVERRIDE && SH_ADX || !MEMORY_OVERRIDE && (SH_HP600 || SH_BIGSUR || SH_SH2000)
+	default "0x01000000" if !MEMORY_OVERRIDE && SH_DREAMCAST || SH_SECUREEDGE5410
+	default "0x04000000" if !MEMORY_OVERRIDE && SH_7751_SOLUTION_ENGINE
+	default "0x02000000" if !MEMORY_OVERRIDE && SH_SOLUTION_ENGINE
+	default "0x08000000" if SH_MPC1211
 	help
 	  This sets the default memory size assumed by your SH kernel. It can
 	  be overridden as normal by the 'mem=' argument on the kernel command
@@ -201,7 +287,7 @@
 
 config MEMORY_SET
 	bool
-	depends on !MEMORY_OVERRIDE && (SH_MPC1211 || SH_ADX || SH_DREAMCAST || SH_HP600 || SH_BIGSUR || SH_SH2000 || SH_7751_SOLUTION_ENGINE || SH_SOLUTION_ENGINE)
+	depends on !MEMORY_OVERRIDE && (SH_MPC1211 || SH_ADX || SH_DREAMCAST || SH_HP600 || SH_BIGSUR || SH_SH2000 || SH_7751_SOLUTION_ENGINE || SH_SOLUTION_ENGINE || SH_SECUREEDGE5410)
 	default y
 	help
 	  This is an option about which you will never be asked a question.
@@ -254,15 +340,13 @@
 config CF_BASE_ADDR
 	hex
 	depends on CF_ENABLER
-	default "b8000000" if CF_AREA6
-	default "b4000000" if CF_AREA5
-
-endmenu
+	default "0xb8000000" if CF_AREA6
+	default "0xb4000000" if CF_AREA5
 
 # The SH7750 RTC module is disabled in the Dreamcast
 config SH_RTC
 	bool
-	depends on !SH_DREAMCAST
+	depends on !SH_DREAMCAST && !SH_SATURN
 	default y
 	help
 	  Selecting this option will allow the Linux kernel to emulate
@@ -270,9 +354,16 @@
 
 	  If unsure, say N.
 
-# This is also board-specific
-config PCI_AUTO
-	bool
+config SH_DSP
+	bool "DSP support"
+	depends on !CPU_SH4
+	default y
+	help
+	  Selecting this option will enable support for SH processors that
+	  have DSP units (ie, SH2-DSP and SH3-DSP). It is safe to say Y here
+	  by default, as the existance of the DSP will be probed at runtime.
+
+	  This option must be set in order to enable the DSP.
 
 config SH_HP600
 	bool
@@ -289,91 +380,10 @@
 	  or have huge holes in the physical address space for other reasons.
 	  See <file:Documentation/vm/numa> for more.
 
-
-menu "Processor type and features"
-
-#
-# Ick, get rid of all this CPU_SUBTYPE nonsense. Just probe it, fill in
-# cpu_data, and leave it alone. (Feasible for SH-4 at least, and some
-# SH-3). ++paulm
-#
-choice
-	prompt "Processor type"
-	default CPU_SUBTYPE_SH7708
-
-config CPU_SUBTYPE_SH7604
-	bool "SH7604"
-	help
-	  Select SH7604 if you have SH7604
-
-config CPU_SUBTYPE_SH7707
-	bool "SH7707"
-	---help---
-	  Select the type of SuperH processor you have. This information is
-	  used for optimizing and configuration purposes.
-
-          Select SH7604 if you have a SH-2 CPU.
-
-	  Select SH7707 if you have a  60 Mhz SH-3 HD6417707 CPU.
-
-	  Select SH7708 if you have a  60 Mhz SH-3 HD6417708S or
-	  if you have a 100 Mhz SH-3 HD6417708R CPU.
-
-	  Select SH7709 if you have a  80 Mhz SH-3 HD6417709 CPU.
-
-	  Select SH7750 if you have a 200 Mhz SH-4 HD6417750 CPU.
-
-	  Select SH7751 if you have a SH7751
-
-	  Select ST40STB1 if you have a ST40STB1
-
-config CPU_SUBTYPE_SH7708
-	bool "SH7708"
-	help
-	  Select SH7708 if you have a  60 Mhz SH-3 HD6417708S or
-	  if you have a 100 Mhz SH-3 HD6417708R CPU.
-
-config CPU_SUBTYPE_SH7709
-	bool "SH7709"
-	help
-	  Select SH7709 if you have a  80 Mhz SH-3 HD6417709 CPU.
-
-config CPU_SUBTYPE_SH7750
-	bool "SH7750"
-	help
-	  Select SH7750 if you have a 200 Mhz SH-4 HD6417750 CPU.
-
-config CPU_SUBTYPE_SH7751
-	bool "SH7751"
-	help
-	  Select SH7750 if you have a 166 Mhz SH-4 HD6417751 CPU.
-
-config CPU_SUBTYPE_ST40STB1
-	bool "ST40STB1"
-	help
-	  Select ST40STB1 if you have a ST40STB1 CPU.
-
-endchoice
-
-config CPU_SH2
-	bool
-	depends on CPU_SUBTYPE_SH7604
-	default y
-
-config CPU_SH3
-	bool
-	depends on !CPU_SH2 && (CPU_SUBTYPE_SH7707 || CPU_SUBTYPE_SH7708 || CPU_SUBTYPE_SH7709)
-	default y
-
-config CPU_SH4
-	bool
-	depends on !CPU_SH3 && !CPU_SH2 && (CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7751 || CPU_SUBTYPE_ST40STB1)
-	default y
-
 config ZERO_PAGE_OFFSET
 	hex "Zero page offset"
-	default "00001000" if !SH_MPC1211
-	default "00004000" if SH_MPC1211
+	default "0x00001000" if !SH_MPC1211
+	default "0x00004000" if SH_MPC1211
 	help
 	  This sets the default offset of zero page.
 
@@ -385,18 +395,26 @@
 config MEMORY_START
 	hex
 	depends on CPU_SUBTYPE_ST40STB1 && ST40_LMI_MEMORY
-	default "08000000"
+	default "0x08000000"
 
 config MEMORY_SIZE
 	hex
 	depends on CPU_SUBTYPE_ST40STB1 && ST40_LMI_MEMORY
-	default "00400000"
+	default "0x00400000"
 
 config MEMORY_SET
 	bool
 	depends on CPU_SUBTYPE_ST40STB1 && ST40_LMI_MEMORY
 	default y
 
+config BOOT_LINK_OFFSET
+	hex "Link address offset for booting"
+	default "0x00800000"
+	help
+	  This option allows you to set the link address offset of the zImage.
+	  This can be useful if you are on a board which has a small amount of
+	  memory.
+
 config CPU_LITTLE_ENDIAN
 	bool "Little Endian"
 	help
@@ -442,6 +460,13 @@
 
 	  If unsure, say N.
 
+config SH_STORE_QUEUES
+	bool "Support for Store Queues"
+	depends on CPU_SH4
+	help
+	  Selecting this option will enable an in-kernel API for manipulating
+	  the store queues integrated in the SH-4 processors.
+	
 config SMP
 	bool "Symmetric multi-processing support"
 	---help---
@@ -467,6 +492,7 @@
 
 config NR_CPUS
 	int "Maximum number of CPUs (2-32)"
+	range 2 32
 	depends on SMP
 	default "2"
 	help
@@ -477,13 +503,18 @@
 	  This is purely to save memory - each supported CPU adds
 	  approximately eight kilobytes to the kernel image.
 
-config SH_DMA
-	bool "DMA controller (DMAC) support"
-	help
-	  Selecting this option will provide same API as PC's Direct Memory
-	  Access Controller(8237A) for SuperH DMAC.
-
-	  If unsure, say N.
+config SH_PCLK_FREQ
+	int "Peripheral clock frequency (in Hz)"
+	default "49876504" if CPU_SUBTYPE_SH7750
+	default "60013568" if CPU_SUBTYPE_SH7751
+	default "1193182"
+	help
+	  This option is used to specify the peripheral clock frequency. This
+	  option must be set for each processor in order for the kernel to
+	  function reliably. If no sane default exists, we use a default from
+	  the legacy i8254. Any discrepancies will be reported on boot time
+	  with an auto-probed frequency which should be considered the proper
+	  value for your hardware.
 
 config CPU_FREQ
 	bool "CPU Frequency scaling"
@@ -518,80 +549,9 @@
 
 source "drivers/cpufreq/Kconfig"
 
-# A board must have defined HD6446X_SERIES in order to see these
-choice
-	prompt "HD6446x options"
-	depends HD6446X_SERIES
-	default HD64461
-
-config HD64461
-	bool "Hitachi HD64461 companion chip support"
-	depends on CPU_SUBTYPE_SH7709
-	---help---
-	  The Hitachi HD64461 provides an interface for
-	  the SH7709 CPU, supporting a LCD controller,
-	  CRT color controller, IrDA up to 4 Mbps, and a
-	  PCMCIA controller supporting 2 slots.
-
-	  More information is available at
-	  <http://semiconductor.hitachi.com/windowsce/superh/sld013.htm>.
-
-	  Say Y if you want support for the HD64461.
-	  Otherwise, say N.
-
-config HD64465
-	bool "Hitachi HD64465 companion chip support"
-	depends on CPU_SUBTYPE_SH7750
-	---help---
-	  The Hitachi HD64465 provides an interface for
-	  the SH7750 CPU, supporting a LCD controller,
-	  CRT color controller, IrDA, USB, PCMCIA,
-	  keyboard controller, and a printer interface.
-
-	  More information is available at
-	  <http://global.hitachi.com/New/cnews/E/1998/981019B.html>.
-
-	  Say Y if you want support for the HD64465.
-	  Otherwise, say N.
-
-endchoice
-
-# These will also be split into the Kconfig's below
-config HD64461_IRQ
-	int "HD64461 IRQ"
-	depends on HD64461
-	default "36"
-	help
-	  The default setting of the HD64461 IRQ is 36.
-
-	  Do not change this unless you know what you are doing.
-
-config HD64461_ENABLER
-	bool "HD64461 PCMCIA enabler"
-	depends on HD64461
-	help
-	  Say Y here if you want to enable PCMCIA support
-	  via the HD64461 companion chip.
-	  Otherwise, say N.
-
+source "arch/sh/drivers/dma/Kconfig"
 
-config HD64465_IOBASE
-	hex "HD64465 start address"
-	depends on HD64465
-	default "b0000000"
-	help
-	  The default setting of the HD64465 IO base address is 0xb0000000.
-
-	  Do not change this unless you know what you are doing.
-
-config HD64465_IRQ
-	int "HD64465 IRQ"
-	depends on HD64465
-	default "5"
-	help
-	  The default setting of the HD64465 IRQ is 5.
-
-	  Do not change this unless you know what you are doing.
+source "arch/sh/cchips/Kconfig"
 
 endmenu
 
@@ -601,9 +561,13 @@
 # Even on SuperH devices which don't have an ISA bus,
 # this variable helps the PCMCIA modules handle
 # IRQ requesting properly -- Greg Banks.
+#
+# Though we're generally not interested in it when
+# we're not using PCMCIA, so we make it dependent on
+# PCMCIA outright. -- PFM.
 config ISA
 	bool
-	default y
+	default y if PCMCIA
 	help
 	  Find out whether you have ISA slots on your motherboard.  ISA is the
 	  name of a bus system, i.e. the way the CPU talks to the other stuff
@@ -637,68 +601,11 @@
 config SBUS
 	bool
 
-config PCI
-	bool "PCI support"
-	help
-	  Find out whether you have a PCI motherboard. PCI is the name of a
-	  bus system, i.e. the way the CPU talks to the other stuff inside
-	  your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
-	  VESA. If you have PCI, say Y, otherwise N.
-
-	  The PCI-HOWTO, available from
-	  <http://www.tldp.org/docs.html#howto>, contains valuable
-	  information about which PCI hardware does work under Linux and which
-	  doesn't.
-
-choice
-	prompt "PCI access mode"
-	depends on PCI
-	default PCI_GOANY
-
-config PCI_GOBIOS
-	bool "BIOS"
-	---help---
-	  On PCI systems, the BIOS can be used to detect the PCI devices and
-	  determine their configuration. However, some old PCI motherboards
-	  have BIOS bugs and may crash if this is done. Also, some embedded
-	  PCI-based systems don't have any BIOS at all. Linux can also try to
-	  detect the PCI hardware directly without using the BIOS.
-
-	  With this option, you can specify how Linux should detect the PCI
-	  devices. If you choose "BIOS", the BIOS will be used, if you choose
-	  "Direct", the BIOS won't be used, and if you choose "Any", the
-	  kernel will try the direct access method and falls back to the BIOS
-	  if that doesn't work. If unsure, go with the default, which is
-	  "Any".
-
-config PCI_GODIRECT
-	bool "Direct"
-
-config PCI_GOANY
-	bool "Any"
-
-endchoice
-
-config PCI_BIOS
-	bool
-	depends on PCI && (PCI_GOBIOS || PCI_GOANY)
-	default y
-
-config PCI_DIRECT
+config MAPLE
 	bool
-	depends on PCI && (PCI_GODIRECT || PCI_GOANY)
-	default y
+	default y if SH_DREAMCAST
 
-config SH_PCIDMA_NONCOHERENT
-	bool "Cache and PCI noncoherent"
-	depends on PCI
-	help
-	  Enable this option if your platform does not have a CPU cache which
-	  remains coherent with PCI DMA. It is safest to say 'Y', although you
-	  will see better performance if you can say 'N', because the PCI DMA
-	  code will not have to flush the CPU's caches. If you have a PCI host
-	  bridge integrated with your SH CPU, refer carefully to the chip specs
-	  to see if you can say 'N' here. Otherwise, leave it as 'Y'.
+source "arch/sh/drivers/pci/Kconfig"
 
 source "drivers/pci/Kconfig"
 
@@ -762,10 +669,6 @@
 #
 source "drivers/input/Kconfig"
 
-#if [ "$CONFIG_SH_DREAMCAST" = "y" ]; then
-#   source drivers/maple/Config.in
-#fi
-
 menu "Character devices"
 
 config VT
@@ -887,7 +790,7 @@
 
 	  If unsure, say N.
 
-comment "Unix 98 PTY support"
+comment "Unix98 PTY support"
 
 config UNIX98_PTYS
 	bool "Unix98 PTY support"
@@ -1136,6 +1039,7 @@
 
 source "drivers/usb/Kconfig"
 
+source "arch/sh/oprofile/Kconfig"
 
 menu "Kernel hacking"
 
@@ -1183,6 +1087,97 @@
 	  This option is only useful porting the kernel to a new machine,
 	  when the kernel may crash or hang before the serial console is
 	  initialised. If unsure, say N.
+
+config KGDB
+	bool "Include KGDB kernel debugger"
+	help
+	  Include in-kernel hooks for kgdb, the Linux kernel source level
+	  debugger.  See <http://kgdb.sourceforge.net/> for more information.
+	  Unless you are intending to debug the kernel, say N here.
+
+menu "KGDB configuration options"
+	depends on KGDB
+
+config MORE_COMPILE_OPTIONS
+	bool "Add any additional compile options"
+	help
+	  If you want to add additional CFLAGS to the kernel build, enable this
+	  option and then enter what you would like to add in the next question.
+	  Note however that -g is already appended with the selection of KGDB.
+
+config COMPILE_OPTIONS
+	string "Additional compile arguments"
+	depends on MORE_COMPILE_OPTIONS
+
+config KGDB_NMI
+	bool "Enter KGDB on NMI"
+	default n
+
+config KGDB_THREAD
+	bool "Include KGDB thread support"
+	default y
+
+config SH_KGDB_CONSOLE
+	bool "Console messages through GDB"
+	default n
+
+config KGDB_SYSRQ
+	bool "Allow SysRq 'G' to enter KGDB"
+	default y
+
+config KGDB_KERNEL_ASSERTS
+	bool "Include KGDB kernel assertions"
+	default n
+
+comment "Serial port setup"
+
+config KGDB_DEFPORT
+	int "Port number (ttySCn)"
+	default "1"
+
+config KGDB_DEFBAUD
+	int "Baud rate"
+	default "115200"
+
+choice
+	prompt "Parity"
+	depends on KGDB
+	default KGDB_DEFPARITY_N
+
+config KGDB_DEFPARITY_N
+	bool "None"
+
+config KGDB_DEFPARITY_E
+	bool "Even"
+
+config KGDB_DEFPARITY_O
+	bool "Odd"
+
+endchoice
+
+choice
+	prompt "Data bits"
+	depends on KGDB
+	default KGDB_DEFBITS_8
+
+config KGDB_DEFBITS_8
+	bool "8"
+
+config KGDB_DEFBITS_7
+	bool "7"
+
+endchoice
+
+endmenu
+
+config FRAME_POINTER
+	bool "Compile the kernel with frame pointers"
+	default y if KGDB
+	help
+	  If you say Y here the resulting kernel image will be slightly larger
+	  and slower, but it will give very useful debugging information.
+	  If you don't debug the kernel, you can say N, but we may not be able
+	  to solve problems without frame pointers.
 
 endmenu
 
diff -Nru a/arch/sh/Makefile b/arch/sh/Makefile
--- a/arch/sh/Makefile	Tue Feb  3 19:45:30 2004
+++ b/arch/sh/Makefile	Tue Feb  3 19:45:31 2004
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.17 2003/05/20 03:12:54 lethal Exp $
+# $Id: Makefile,v 1.32 2003/10/26 23:33:49 lethal Exp $
 #
 # 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
@@ -25,20 +25,20 @@
 -include .config
 endif
 
-cpu-y				:= -mb
-cpu-$(CONFIG_CPU_LITTLE_ENDIAN)	:= -ml
+cflags-y				:= -mb
+cflags-$(CONFIG_CPU_LITTLE_ENDIAN)	:= -ml
 
-cpu-$(CONFIG_CPU_SH2)		+= -m2
-cpu-$(CONFIG_CPU_SH3)		+= -m3
-cpu-$(CONFIG_CPU_SH4)		+= -m4 -mno-implicit-fp
-
-ifdef CONFIG_SH_KGDB
-CFLAGS :=$(CFLAGS:-fomit-frame-pointer=) -g
-AFLAGS += -g
-ifdef CONFIG_KGDB_MORE
-CFLAGS += $(shell echo $(CONFIG_KGDB_OPTIONS) | sed -e 's/"//g')
-endif
-endif
+cflags-$(CONFIG_CPU_SH2)		+= -m2
+cflags-$(CONFIG_CPU_SH3)		+= -m3
+cflags-$(CONFIG_CPU_SH4)		+= -m4 \
+	$(call check_gcc,-mno-implicit-fp,-m4-nofpu)
+
+cflags-$(CONFIG_SH_DSP)			+= -Wa,-dsp
+cflags-$(CONFIG_SH_KGDB)		+= -g
+cflags-$(CONFIG_EMBEDDED)		+= -Os
+
+cflags-$(CONFIG_MORE_COMPILE_OPTIONS)	+= \
+	$(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g')
 
 OBJCOPYFLAGS	:= -O binary -R .note -R .comment -R .stab -R .stabstr -S
 
@@ -49,13 +49,15 @@
 LDFLAGS_vmlinux     += -e _stext
 
 ifdef CONFIG_CPU_LITTLE_ENDIAN
-LDFLAGS_vmlinux     +=  --defsym 'jiffies=jiffies_64' -EL
+LDFLAGS_vmlinux		+= --defsym 'jiffies=jiffies_64'
+LDFLAGS			+= -EL
 else
-LDFLAGS_vmlinux     +=  --defsym 'jiffies=jiffies_64+4' -EB
+LDFLAGS_vmlinux		+= --defsym 'jiffies=jiffies_64+4'
+LDFLAGS			+= -EB
 endif
 
-CFLAGS		+= -pipe $(cpu-y)
-AFLAGS		+= $(cpu-y)
+CFLAGS		+= -pipe $(cflags-y)
+AFLAGS		+= $(cflags-y)
 
 head-y := arch/sh/kernel/head.o arch/sh/kernel/init_task.o
 
@@ -66,6 +68,7 @@
 # Boards
 machdir-$(CONFIG_SH_SOLUTION_ENGINE)		:= se/770x
 machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE)	:= se/7751
+machdir-$(CONFIG_SH_7751_SYSTEMH)		:= systemh
 machdir-$(CONFIG_SH_STB1_HARP)			:= harp
 machdir-$(CONFIG_SH_STB1_OVERDRIVE)		:= overdrive
 machdir-$(CONFIG_SH_HP620)			:= hp6xx/hp620
@@ -81,6 +84,7 @@
 machdir-$(CONFIG_SH_SH2000)			:= sh2000
 machdir-$(CONFIG_SH_ADX)			:= adx
 machdir-$(CONFIG_SH_MPC1211)			:= mpc1211
+machdir-$(CONFIG_SH_SECUREEDGE5410)		:= snapgear
 machdir-$(CONFIG_SH_UNKNOWN)			:= unknown
 
 incdir-y			:= $(machdir-y)
@@ -99,7 +103,10 @@
 cpuincdir-$(CONFIG_CPU_SH3)	:= cpu-sh3
 cpuincdir-$(CONFIG_CPU_SH4)	:= cpu-sh4
 
-libs-y				+= arch/sh/lib/	$(LIBGCC)
+libs-y				:= arch/sh/lib/	$(libs-y) $(LIBGCC)
+
+drivers-y			+= arch/sh/drivers/
+drivers-$(CONFIG_OPROFILE)	+= arch/sh/oprofile/
 
 boot := arch/sh/boot
 
@@ -110,18 +117,36 @@
 .PHONY: target_links FORCE
 target_links:
 	@echo '  Making asm-sh/cpu -> asm-sh/$(cpuincdir-y) link'
+	@rm -f include/asm-sh/cpu
 	@ln -sf $(cpuincdir-y) include/asm-sh/cpu
 
 	@echo '  Making asm-sh/mach -> asm-sh/$(incdir-y) link'
+	@rm -f include/asm-sh/mach
 	@ln -sf $(incdir-y) include/asm-sh/mach
 
 	$(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h
 
-BOOTIMAGE=arch/sh/boot/zImage
 zImage: vmlinux
-	$(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE)
+	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
 
 compressed: zImage
 
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
+
+defconfig-%:
+	@echo '  Copying arch/sh/configs/$@ -> .config'
+	@if [ -e .config ]; then mv -f .config .config.old; fi
+	@cp -f arch/sh/configs/$@ .config
+	@chmod 644 .config
+
+define archhelp
+	@echo '  zImage		  - Compressed kernel image (arch/sh/boot/zImage)'
+	for board in arch/sh/configs/*; \
+	do \
+		 echo -n ' ' $$board | sed -e 's|arch/sh/configs/||g' ; \
+		 echo -n '  	  - Build for ' ; \
+		 echo -e $$board | sed -e 's|.*-||g'; \
+	done
+endef
+
diff -Nru a/arch/sh/boards/adx/Makefile b/arch/sh/boards/adx/Makefile
--- a/arch/sh/boards/adx/Makefile	Tue Feb  3 19:45:41 2004
+++ b/arch/sh/boards/adx/Makefile	Tue Feb  3 19:45:41 2004
@@ -6,5 +6,5 @@
 # unless it's something special (ie not a .c file).
 #
 
-obj-y	 := mach.o setup.o io.o irq.o irq_maskreq.o
+obj-y	 := setup.o irq.o irq_maskreq.o
 
diff -Nru a/arch/sh/boards/adx/io.c b/arch/sh/boards/adx/io.c
--- a/arch/sh/boards/adx/io.c	Tue Feb  3 19:45:18 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,195 +0,0 @@
-/* 
- * linux/arch/sh/kernel/io_adx.c
- *
- * Copyright (C) 2001 A&D Co., Ltd.
- *
- * I/O routine and setup routines for A&D ADX Board
- *
- * 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.
- *
- */
-
-#include <asm/io.h>
-#include <asm/machvec.h>
-#include <linux/module.h>
-
-#define PORT2ADDR(x) (adx_isa_port2addr(x))
-
-static inline void delay(void)
-{
-	ctrl_inw(0xa0000000);
-}
-
-unsigned char adx_inb(unsigned long port)
-{
-	return *(volatile unsigned char*)PORT2ADDR(port);
-}
-
-unsigned short adx_inw(unsigned long port)
-{
-	return *(volatile unsigned short*)PORT2ADDR(port);
-}
-
-unsigned int adx_inl(unsigned long port)
-{
-	return *(volatile unsigned long*)PORT2ADDR(port);
-}
-
-unsigned char adx_inb_p(unsigned long port)
-{
-	unsigned long v = *(volatile unsigned char*)PORT2ADDR(port);
-
-	delay();
-	return v;
-}
-
-unsigned short adx_inw_p(unsigned long port)
-{
-	unsigned long v = *(volatile unsigned short*)PORT2ADDR(port);
-
-	delay();
-	return v;
-}
-
-unsigned int adx_inl_p(unsigned long port)
-{
-	unsigned long v = *(volatile unsigned long*)PORT2ADDR(port);
-
-	delay();
-	return v;
-}
-
-void adx_insb(unsigned long port, void *buffer, unsigned long count)
-{
-	unsigned char *buf = buffer;
-	while(count--) *buf++ = inb(port);
-}
-
-void adx_insw(unsigned long port, void *buffer, unsigned long count)
-{
-	unsigned short *buf = buffer;
-	while(count--) *buf++ = inw(port);
-}
-
-void adx_insl(unsigned long port, void *buffer, unsigned long count)
-{
-	unsigned long *buf = buffer;
-	while(count--) *buf++ = inl(port);
-}
-
-void adx_outb(unsigned char b, unsigned long port)
-{
-	*(volatile unsigned char*)PORT2ADDR(port) = b;
-}
-
-void adx_outw(unsigned short b, unsigned long port)
-{
-	*(volatile unsigned short*)PORT2ADDR(port) = b;
-}
-
-void adx_outl(unsigned int b, unsigned long port)
-{
-	*(volatile unsigned long*)PORT2ADDR(port) = b;
-}
-
-void adx_outb_p(unsigned char b, unsigned long port)
-{
-	*(volatile unsigned char*)PORT2ADDR(port) = b;
-	delay();
-}
-
-void adx_outw_p(unsigned short b, unsigned long port)
-{
-	*(volatile unsigned short*)PORT2ADDR(port) = b;
-	delay();
-}
-
-void adx_outl_p(unsigned int b, unsigned long port)
-{
-	*(volatile unsigned long*)PORT2ADDR(port) = b;
-	delay();
-}
-
-void adx_outsb(unsigned long port, const void *buffer, unsigned long count)
-{
-	const unsigned char *buf = buffer;
-	while(count--) outb(*buf++, port);
-}
-
-void adx_outsw(unsigned long port, const void *buffer, unsigned long count)
-{
-	const unsigned short *buf = buffer;
-	while(count--) outw(*buf++, port);
-}
-
-void adx_outsl(unsigned long port, const void *buffer, unsigned long count)
-{
-	const unsigned long *buf = buffer;
-	while(count--) outl(*buf++, port);
-}
-
-unsigned char adx_readb(unsigned long addr)
-{
-	return *(volatile unsigned char*)addr;
-}
-
-unsigned short adx_readw(unsigned long addr)
-{
-	return *(volatile unsigned short*)addr;
-}
-
-unsigned int adx_readl(unsigned long addr)
-{
-	return *(volatile unsigned long*)addr;
-}
-
-void adx_writeb(unsigned char b, unsigned long addr)
-{
-	*(volatile unsigned char*)addr = b;
-}
-
-void adx_writew(unsigned short b, unsigned long addr)
-{
-	*(volatile unsigned short*)addr = b;
-}
-
-void adx_writel(unsigned int b, unsigned long addr)
-{
-	*(volatile unsigned long*)addr = b;
-}
-
-void *adx_ioremap(unsigned long offset, unsigned long size)
-{
-	return (void *)P2SEGADDR(offset);
-}
-
-EXPORT_SYMBOL (adx_ioremap);
-
-void adx_iounmap(void *addr)
-{
-}
-
-EXPORT_SYMBOL(adx_iounmap);
-
-#ifdef CONFIG_IDE
-#include <linux/vmalloc.h>
-extern void *cf_io_base;
-
-unsigned long adx_isa_port2addr(unsigned long offset)
-{
-  /* CompactFlash (IDE) */
-	if (((offset >= 0x1f0) && (offset <= 0x1f7)) || (offset == 0x3f6)) {
-		return (unsigned long)cf_io_base + offset;
-	}
-
-  /* eth0 */
-	if ((offset >= 0x300) && (offset <= 0x30f)) {
-		return 0xa5000000 + offset;	/* COMM BOARD (AREA1) */
-	}
-
-	return offset + 0xb0000000; /* IOBUS (AREA 4)*/
-}
-#endif
-
diff -Nru a/arch/sh/boards/adx/mach.c b/arch/sh/boards/adx/mach.c
--- a/arch/sh/boards/adx/mach.c	Tue Feb  3 19:45:18 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,64 +0,0 @@
-/*
- * linux/arch/sh/kernel/mach_adx.c
- *
- * Copyright (C) 2001 A&D Co., Ltd.
- *
- * This file may be copied or modified under the terms of the GNU
- * General Public License.  See linux/COPYING for more information.
- *
- * Machine vector for the A&D ADX Board
- */
-
-#include <linux/config.h>
-#include <linux/init.h>
-
-#include <asm/machvec.h>
-#include <asm/rtc.h>
-#include <asm/machvec_init.h>
-#include <asm/adx/io.h>
-
-extern void init_adx_IRQ(void);
-
-/*
- * The Machine Vector
- */
-
-struct sh_machine_vector mv_adx __initmv = {
-	.mv_nr_irqs		= 48,
-
-	.mv_inb			= adx_inb,
-	.mv_inw			= adx_inw,
-	.mv_inl			= adx_inl,
-	.mv_outb		= adx_outb,
-	.mv_outw		= adx_outw,
-	.mv_outl		= adx_outl,
-
-	.mv_inb_p		= adx_inb_p,
-	.mv_inw_p		= adx_inw,
-	.mv_inl_p		= adx_inl,
-	.mv_outb_p		= adx_outb_p,
-	.mv_outw_p		= adx_outw,
-	.mv_outl_p		= adx_outl,
-
-	.mv_insb		= adx_insb,
-	.mv_insw		= adx_insw,
-	.mv_insl		= adx_insl,
-	.mv_outsb		= adx_outsb,
-	.mv_outsw		= adx_outsw,
-	.mv_outsl		= adx_outsl,
-
-	.mv_readb		= adx_readb,
-	.mv_readw		= adx_readw,
-	.mv_readl		= adx_readl,
-	.mv_writeb		= adx_writeb,
-	.mv_writew		= adx_writew,
-	.mv_writel		= adx_writel,
-
-	.mv_ioremap		= adx_ioremap,
-	.mv_iounmap		= adx_iounmap,
-
-	.mv_isa_port2addr	= adx_isa_port2addr,
-
-	.mv_init_irq		= init_adx_IRQ,
-};
-ALIAS_MV(adx)
diff -Nru a/arch/sh/boards/adx/setup.c b/arch/sh/boards/adx/setup.c
--- a/arch/sh/boards/adx/setup.c	Tue Feb  3 19:45:42 2004
+++ b/arch/sh/boards/adx/setup.c	Tue Feb  3 19:45:42 2004
@@ -14,11 +14,43 @@
 #include <asm/machvec.h>
 #include <linux/module.h>
 
+extern void init_adx_IRQ(void);
+extern void *cf_io_base;
+
 const char *get_system_type(void)
 {
 	return "A&D ADX";
 }
 
-void platform_setup(void)
+unsigned long adx_isa_port2addr(unsigned long offset)
 {
+	/* CompactFlash (IDE) */
+	if (((offset >= 0x1f0) && (offset <= 0x1f7)) || (offset == 0x3f6)) {
+		return (unsigned long)cf_io_base + offset;
+	}
+
+	/* eth0 */
+	if ((offset >= 0x300) && (offset <= 0x30f)) {
+		return 0xa5000000 + offset;	/* COMM BOARD (AREA1) */
+	}
+
+	return offset + 0xb0000000; /* IOBUS (AREA 4)*/
 }
+
+/*
+ * The Machine Vector
+ */
+
+struct sh_machine_vector mv_adx __initmv = {
+	.mv_nr_irqs		= 48,
+	.mv_isa_port2addr	= adx_isa_port2addr,
+	.mv_init_irq		= init_adx_IRQ,
+};
+ALIAS_MV(adx)
+
+int __init platform_setup(void)
+{
+	/* Nothing to see here .. */
+	return 0;
+}
+
diff -Nru a/arch/sh/boards/bigsur/Makefile b/arch/sh/boards/bigsur/Makefile
--- a/arch/sh/boards/bigsur/Makefile	Tue Feb  3 19:45:28 2004
+++ b/arch/sh/boards/bigsur/Makefile	Tue Feb  3 19:45:28 2004
@@ -6,7 +6,5 @@
 # unless it's something special (ie not a .c file).
 #
 
-obj-y	 := mach.o setup.o io.o irq.o led.o
-
-obj-$(CONFIG_PCI) += pci.o
+obj-y	 := setup.o io.o irq.o led.o
 
diff -Nru a/arch/sh/boards/bigsur/io.c b/arch/sh/boards/bigsur/io.c
--- a/arch/sh/boards/bigsur/io.c	Tue Feb  3 19:45:29 2004
+++ b/arch/sh/boards/bigsur/io.c	Tue Feb  3 19:45:29 2004
@@ -21,18 +21,6 @@
 #include <asm/io.h>
 #include <asm/bigsur/bigsur.h>
 
-//#define BIGSUR_DEBUG 2
-#undef BIGSUR_DEBUG
-
-#ifdef BIGSUR_DEBUG
-#define DPRINTK(args...)	printk(args)
-#define DIPRINTK(n, args...)	if (BIGSUR_DEBUG>(n)) printk(args)
-#else
-#define DPRINTK(args...)
-#define DIPRINTK(n, args...)
-#endif
-
-
 /* Low iomap maps port 0-1K to addresses in 8byte chunks */
 #define BIGSUR_IOMAP_LO_THRESH 0x400
 #define BIGSUR_IOMAP_LO_SHIFT	3
@@ -53,19 +41,17 @@
 #define MAX(a,b)    ((a)>(b)?(a):(b))
 #endif
 
-#define PORT2ADDR(x) (sh_mv.mv_isa_port2addr(x))
-
 void bigsur_port_map(u32 baseport, u32 nports, u32 addr, u8 shift)
 {
-    u32 port, endport = baseport + nports;
+	u32 port, endport = baseport + nports;
 
-    DPRINTK("bigsur_port_map(base=0x%0x, n=0x%0x, addr=0x%08x)\n",
-	    baseport, nports, addr);
+	pr_debug("bigsur_port_map(base=0x%0x, n=0x%0x, addr=0x%08x)\n",
+		 baseport, nports, addr);
 	    
 	for (port = baseport ;
 	     port < endport && port < BIGSUR_IOMAP_LO_THRESH ;
 	     port += (1<<BIGSUR_IOMAP_LO_SHIFT)) {
-	    	DPRINTK("    maplo[0x%x] = 0x%08x\n", port, addr);
+	    	pr_debug("    maplo[0x%x] = 0x%08x\n", port, addr);
     	    bigsur_iomap_lo[port>>BIGSUR_IOMAP_LO_SHIFT] = addr;
     	    bigsur_iomap_lo_shift[port>>BIGSUR_IOMAP_LO_SHIFT] = shift;
 	    	addr += (1<<(BIGSUR_IOMAP_LO_SHIFT));
@@ -74,7 +60,7 @@
 	for (port = MAX(baseport, BIGSUR_IOMAP_LO_THRESH) ;
 	     port < endport && port < BIGSUR_IOMAP_HI_THRESH ;
 	     port += (1<<BIGSUR_IOMAP_HI_SHIFT)) {
-	    	DPRINTK("    maphi[0x%x] = 0x%08x\n", port, addr);
+	    	pr_debug("    maphi[0x%x] = 0x%08x\n", port, addr);
     	    bigsur_iomap_hi[port>>BIGSUR_IOMAP_HI_SHIFT] = addr;
     	    bigsur_iomap_hi_shift[port>>BIGSUR_IOMAP_HI_SHIFT] = shift;
 	    	addr += (1<<(BIGSUR_IOMAP_HI_SHIFT));
@@ -84,166 +70,56 @@
 
 void bigsur_port_unmap(u32 baseport, u32 nports)
 {
-    u32 port, endport = baseport + nports;
+	u32 port, endport = baseport + nports;
 	
-    DPRINTK("bigsur_port_unmap(base=0x%0x, n=0x%0x)\n", baseport, nports);
+	pr_debug("bigsur_port_unmap(base=0x%0x, n=0x%0x)\n", baseport, nports);
 
 	for (port = baseport ;
 	     port < endport && port < BIGSUR_IOMAP_LO_THRESH ;
 	     port += (1<<BIGSUR_IOMAP_LO_SHIFT)) {
-    	    bigsur_iomap_lo[port>>BIGSUR_IOMAP_LO_SHIFT] = 0;
+		bigsur_iomap_lo[port>>BIGSUR_IOMAP_LO_SHIFT] = 0;
 	}
 
 	for (port = MAX(baseport, BIGSUR_IOMAP_LO_THRESH) ;
 	     port < endport && port < BIGSUR_IOMAP_HI_THRESH ;
 	     port += (1<<BIGSUR_IOMAP_HI_SHIFT)) {
-    	    bigsur_iomap_hi[port>>BIGSUR_IOMAP_HI_SHIFT] = 0;
+		bigsur_iomap_hi[port>>BIGSUR_IOMAP_HI_SHIFT] = 0;
 	}
 }
 EXPORT_SYMBOL(bigsur_port_unmap);
 
 unsigned long bigsur_isa_port2addr(unsigned long port)
 {
-    unsigned long addr = 0;
+	unsigned long addr = 0;
 	unsigned char shift;
 
 	/* Physical address not in P0, do nothing */
-	if (PXSEG(port)) addr = port;
+	if (PXSEG(port)) {
+		addr = port;
 	/* physical address in P0, map to P2 */
-	else if (port >= 0x30000)
-	    addr = P2SEGADDR(port);
+	} else if (port >= 0x30000) {
+		addr = P2SEGADDR(port);
 	/* Big Sur I/O + HD64465 registers 0x10000-0x30000 */
-	else if (port >= BIGSUR_IOMAP_HI_THRESH)
-	    addr = BIGSUR_INTERNAL_BASE + (port - BIGSUR_IOMAP_HI_THRESH);
+	} else if (port >= BIGSUR_IOMAP_HI_THRESH) {
+		addr = BIGSUR_INTERNAL_BASE + (port - BIGSUR_IOMAP_HI_THRESH);
 	/* Handle remapping of high IO/PCI IO ports */
-	else if (port >= BIGSUR_IOMAP_LO_THRESH) {
-	    addr = bigsur_iomap_hi[port >> BIGSUR_IOMAP_HI_SHIFT];
-	    shift = bigsur_iomap_hi_shift[port >> BIGSUR_IOMAP_HI_SHIFT];
-	    if (addr != 0)
-		    addr += (port & BIGSUR_IOMAP_HI_MASK) << shift;
-	}
-	/* Handle remapping of low IO ports */
-	else {
-	    addr = bigsur_iomap_lo[port >> BIGSUR_IOMAP_LO_SHIFT];
-	    shift = bigsur_iomap_lo_shift[port >> BIGSUR_IOMAP_LO_SHIFT];
-	    if (addr != 0)
-	    	addr += (port & BIGSUR_IOMAP_LO_MASK) << shift;
+	} else if (port >= BIGSUR_IOMAP_LO_THRESH) {
+		addr = bigsur_iomap_hi[port >> BIGSUR_IOMAP_HI_SHIFT];
+		shift = bigsur_iomap_hi_shift[port >> BIGSUR_IOMAP_HI_SHIFT];
+
+		if (addr != 0)
+			addr += (port & BIGSUR_IOMAP_HI_MASK) << shift;
+	} else {
+		/* Handle remapping of low IO ports */
+		addr = bigsur_iomap_lo[port >> BIGSUR_IOMAP_LO_SHIFT];
+		shift = bigsur_iomap_lo_shift[port >> BIGSUR_IOMAP_LO_SHIFT];
+
+		if (addr != 0)
+			addr += (port & BIGSUR_IOMAP_LO_MASK) << shift;
 	}
 
-    DIPRINTK(2, "PORT2ADDR(0x%08lx) = 0x%08lx\n", port, addr);
+	pr_debug("%s(0x%08lx) = 0x%08lx\n", __FUNCTION__, port, addr);
 
 	return addr;
-}
-
-static inline void delay(void)
-{
-	ctrl_inw(0xa0000000);
-}
-
-unsigned char bigsur_inb(unsigned long port)
-{
-	unsigned long addr = PORT2ADDR(port);
-	unsigned long b = (addr == 0 ? 0 : *(volatile unsigned char*)addr);
-
-	DIPRINTK(0, "inb(%08lx) = %02x\n", addr, (unsigned)b);
-	return b;
-}
-
-unsigned char bigsur_inb_p(unsigned long port)
-{
-    unsigned long v;
-	unsigned long addr = PORT2ADDR(port);
-
-	v = (addr == 0 ? 0 : *(volatile unsigned char*)addr);
-	delay();
-	DIPRINTK(0, "inb_p(%08lx) = %02x\n", addr, (unsigned)v);
-	return v;
-}
-
-unsigned short bigsur_inw(unsigned long port)
-{
-    unsigned long addr = PORT2ADDR(port);
-	unsigned long b = (addr == 0 ? 0 : *(volatile unsigned short*)addr);
-	DIPRINTK(0, "inw(%08lx) = %04lx\n", addr, b);
-	return b;
-}
-
-unsigned int bigsur_inl(unsigned long port)
-{
-    unsigned long addr = PORT2ADDR(port);
-	unsigned int b = (addr == 0 ? 0 : *(volatile unsigned long*)addr);
-	DIPRINTK(0, "inl(%08lx) = %08x\n", addr, b);
-	return b;
-}
-
-void bigsur_insb(unsigned long port, void *buffer, unsigned long count)
-{
-	unsigned char *buf=buffer;
-	while(count--) *buf++=inb(port);
-}
-
-void bigsur_insw(unsigned long port, void *buffer, unsigned long count)
-{
-	unsigned short *buf=buffer;
-	while(count--) *buf++=inw(port);
-}
-
-void bigsur_insl(unsigned long port, void *buffer, unsigned long count)
-{
-	unsigned long *buf=buffer;
-	while(count--) *buf++=inl(port);
-}
-
-void bigsur_outb(unsigned char b, unsigned long port)
-{
-	unsigned long addr = PORT2ADDR(port);
-
-	DIPRINTK(0, "outb(%02x, %08lx)\n", (unsigned)b, addr);
-	if (addr != 0)
-	    *(volatile unsigned char*)addr = b;
-}
-
-void bigsur_outb_p(unsigned char b, unsigned long port)
-{
-	unsigned long addr = PORT2ADDR(port);
-
-	DIPRINTK(0, "outb_p(%02x, %08lx)\n", (unsigned)b, addr);
-    if (addr != 0)
-	    *(volatile unsigned char*)addr = b;
-	delay();
-}
-
-void bigsur_outw(unsigned short b, unsigned long port)
-{
-	unsigned long addr = PORT2ADDR(port);
-	DIPRINTK(0, "outw(%04x, %08lx)\n", (unsigned)b, addr);
-	if (addr != 0)
-	    *(volatile unsigned short*)addr = b;
-}
-
-void bigsur_outl(unsigned int b, unsigned long port)
-{
-	unsigned long addr = PORT2ADDR(port);
-	DIPRINTK(0, "outl(%08x, %08lx)\n", b, addr);
-	if (addr != 0)
-            *(volatile unsigned long*)addr = b;
-}
-
-void bigsur_outsb(unsigned long port, const void *buffer, unsigned long count)
-{
-	const unsigned char *buf=buffer;
-	while(count--) outb(*buf++, port);
-}
-
-void bigsur_outsw(unsigned long port, const void *buffer, unsigned long count)
-{
-	const unsigned short *buf=buffer;
-	while(count--) outw(*buf++, port);
-}
-
-void bigsur_outsl(unsigned long port, const void *buffer, unsigned long count)
-{
-	const unsigned long *buf=buffer;
-	while(count--) outl(*buf++, port);
 }
 
diff -Nru a/arch/sh/boards/bigsur/mach.c b/arch/sh/boards/bigsur/mach.c
--- a/arch/sh/boards/bigsur/mach.c	Tue Feb  3 19:45:34 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,72 +0,0 @@
-/*
- * linux/arch/sh/kernel/mach_bigsur.c
- *
- * By Dustin McIntire (dustin@sensoria.com) (c)2001
- * Derived from mach_se.h, which bore the message:
- * Copyright (C) 2000 Stuart Menefy (stuart.menefy@st.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * Machine vector for the Hitachi Big Sur Evaluation Board
- */
-
-#include <linux/config.h>
-#include <linux/init.h>
-
-#include <asm/machvec.h>
-#include <asm/rtc.h>
-#include <asm/machvec_init.h>
-#include <asm/io.h>
-#include <asm/bigsur/io.h>
-#include <asm/irq.h>
-
-/*
- * The Machine Vector
- */
-extern void heartbeat_bigsur(void);
-extern void init_bigsur_IRQ(void);
-
-struct sh_machine_vector mv_bigsur __initmv = {
-	.mv_nr_irqs		= NR_IRQS,     // Defined in <asm/irq.h>
-	.mv_inb			= bigsur_inb,
-	.mv_inw			= bigsur_inw,
-	.mv_inl			= bigsur_inl,
-	.mv_outb		= bigsur_outb,
-	.mv_outw		= bigsur_outw,
-	.mv_outl		= bigsur_outl,
-
-	.mv_inb_p		= bigsur_inb_p,
-	.mv_inw_p		= bigsur_inw,
-	.mv_inl_p		= bigsur_inl,
-	.mv_outb_p		= bigsur_outb_p,
-	.mv_outw_p		= bigsur_outw,
-	.mv_outl_p		= bigsur_outl,
-
-	.mv_insb		= bigsur_insb,
-	.mv_insw		= bigsur_insw,
-	.mv_insl		= bigsur_insl,
-	.mv_outsb		= bigsur_outsb,
-	.mv_outsw		= bigsur_outsw,
-	.mv_outsl		= bigsur_outsl,
-
-	.mv_readb		= generic_readb,
-	.mv_readw		= generic_readw,
-	.mv_readl		= generic_readl,
-	.mv_writeb		= generic_writeb,
-	.mv_writew		= generic_writew,
-	.mv_writel		= generic_writel,
-
-	.mv_ioremap		= generic_ioremap,
-	.mv_iounmap		= generic_iounmap,
-
-	.mv_isa_port2addr	= bigsur_isa_port2addr,
-	.mv_irq_demux       = bigsur_irq_demux,
-
-	.mv_init_irq		= init_bigsur_IRQ,
-#ifdef CONFIG_HEARTBEAT
-	.mv_heartbeat		= heartbeat_bigsur,
-#endif
-
-};
-ALIAS_MV(bigsur)
diff -Nru a/arch/sh/boards/bigsur/pci.c b/arch/sh/boards/bigsur/pci.c
--- a/arch/sh/boards/bigsur/pci.c	Tue Feb  3 19:45:37 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,163 +0,0 @@
-/*
- * linux/arch/sh/kernel/pci-bigsur.c
- *
- * By Dustin McIntire (dustin@sensoria.com) (c)2001
-
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * PCI initialization for the Hitachi Big Sur Evaluation Board
- */
-
-#include <linux/config.h>
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/delay.h>
-#include <linux/pci.h>
-
-#include <asm/io.h>
-#include <asm/pci-sh7751.h>
-#include <asm/bigsur/bigsur.h>
-
-#define PCI_REG(reg)        (SH7751_PCIREG_BASE+reg)
-
-/*
- * Initialize the Big Sur PCI interface 
- * Setup hardware to be Central Funtion
- * Copy the BSR regs to the PCI interface
- * Setup PCI windows into local RAM
- */
-int __init pcibios_init_platform(void) {
-	u32 reg;
-	u32 word;
-
-	PCIDBG(1,"PCI: bigsur_pci_init called\n");
-	/* Set the BCR's to enable PCI access */
-	reg = inl(SH7751_BCR1);
-	reg |= 0x80000;
-	outl(reg, SH7751_BCR1);
-	
-	/* Setup the host hardware */
-	if(inl(PCI_REG(SH7751_PCICONF0)) !=
-	   (u32)((SH7751_DEVICE_ID <<16) | (SH7751_VENDOR_ID))) {
-	   printk("PCI: Unkown PCI host bridge.\n");
-	   return 0;
-	}  
-	printk("PCI: SH7751 PCI host bridge found.\n");
-	
-	/* Turn the clocks back on (not done in reset)*/
-	outl(0, PCI_REG(SH7751_PCICLKR));
-	/* Clear Powerdown IRQ's (not done in reset) */
-	word = SH7751_PCIPINT_D3 | SH7751_PCIPINT_D0;
-	outl(word, PCI_REG(SH7751_PCICLKR));
-
-	/* toggle PCI reset pin */
-	word = SH7751_PCICR_PREFIX | SH7751_PCICR_PRST;
-	outl(word,PCI_REG(SH7751_PCICR));    
-	/* Wait for a long time... not 1 sec. but long enough */
-	mdelay(100);
-	word = SH7751_PCICR_PREFIX;
-	outl(word,PCI_REG(SH7751_PCICR)); 
-	
-    /* set the command/status bits to:
-     * Wait Cycle Control + Parity Enable + Bus Master +
-     * Mem space enable
-     */
-    word = SH7751_PCICONF1_WCC | SH7751_PCICONF1_PER | 
-           SH7751_PCICONF1_BUM | SH7751_PCICONF1_MES;
-	outl(word, PCI_REG(SH7751_PCICONF1));
-
-	/* define this host as the host bridge */
-	word = SH7751_PCI_HOST_BRIDGE << 24;
-	outl(word, PCI_REG(SH7751_PCICONF2));
-
-	/* Set IO and Mem windows to local address 
-	 * Make PCI and local address the same for easy 1 to 1 mapping 
-	 * Window0 = BIGSUR_LSR0_SIZE @ non-cached CS3 base = SDRAM
-	 * Window1 = BIGSUR_LSR1_SIZE @ cached CS3 base = SDRAM 
-	 */
-	word = BIGSUR_LSR0_SIZE - 1;
-	outl(word, PCI_REG(SH7751_PCILSR0));
-	word = BIGSUR_LSR1_SIZE - 1;
-	outl(word, PCI_REG(SH7751_PCILSR1));
-	/* Set the values on window 0 PCI config registers */
-	word = P2SEGADDR(SH7751_CS3_BASE_ADDR);
-	outl(word, PCI_REG(SH7751_PCILAR0));
-	outl(word, PCI_REG(SH7751_PCICONF5));
-	/* Set the values on window 1 PCI config registers */
-	word =  PHYSADDR(SH7751_CS3_BASE_ADDR);
-	outl(word, PCI_REG(SH7751_PCILAR1));
-	outl(word, PCI_REG(SH7751_PCICONF6));
-
-	/* Set the local 16MB PCI memory space window to 
-	 * the lowest PCI mapped address
-	 */
-	word = PCIBIOS_MIN_MEM & SH7751_PCIMBR_MASK;
-	PCIDBG(2,"PCI: Setting upper bits of Memory window to 0x%x\n", word);
-	outl(word , PCI_REG(SH7751_PCIMBR));
-
-	/* Map IO space into PCI IO window
-	 * The IO window is 64K-PCIBIOS_MIN_IO in size
-	 * IO addresses will be translated to the 
-	 * PCI IO window base address
-	 */
-	PCIDBG(3,"PCI: Mapping IO address 0x%x - 0x%x to base 0x%x\n", PCIBIOS_MIN_IO,
-	    (64*1024), SH7751_PCI_IO_BASE+PCIBIOS_MIN_IO);
-	bigsur_port_map(PCIBIOS_MIN_IO, (64*1024), SH7751_PCI_IO_BASE+PCIBIOS_MIN_IO,0);
-	    
-	/* Make sure the MSB's of IO window are set to access PCI space correctly */
-	word = PCIBIOS_MIN_IO & SH7751_PCIIOBR_MASK;
-	PCIDBG(2,"PCI: Setting upper bits of IO window to 0x%x\n", word);
-	outl(word, PCI_REG(SH7751_PCIIOBR));
-	
-	/* Set PCI WCRx, BCRx's, copy from BSC locations */
-	word = inl(SH7751_BCR1);
-	/* check BCR for SDRAM in area 3 */
-	if(((word >> 3) & 1) == 0) {
-		printk("PCI: Area 3 is not configured for SDRAM. BCR1=0x%x\n", word);
-		return 0;
-	}
-	outl(word, PCI_REG(SH7751_PCIBCR1));
-	word = (u16)inw(SH7751_BCR2);
-	/* check BCR2 for 32bit SDRAM interface*/
-	if(((word >> 6) & 0x3) != 0x3) {
-		printk("PCI: Area 3 is not 32 bit SDRAM. BCR2=0x%x\n", word);
-		return 0;
-	}
-	outl(word, PCI_REG(SH7751_PCIBCR2));
-	/* configure the wait control registers */
-	word = inl(SH7751_WCR1);
-	outl(word, PCI_REG(SH7751_PCIWCR1));
-	word = inl(SH7751_WCR2);
-	outl(word, PCI_REG(SH7751_PCIWCR2));
-	word = inl(SH7751_WCR3);
-	outl(word, PCI_REG(SH7751_PCIWCR3));
-	word = inl(SH7751_MCR);
-	outl(word, PCI_REG(SH7751_PCIMCR));
-
-	/* NOTE: I'm ignoring the PCI error IRQs for now..
-	 * TODO: add support for the internal error interrupts and
-	 * DMA interrupts...
-	 */
-	 
-	/* SH7751 init done, set central function init complete */
-	word = SH7751_PCICR_PREFIX | SH7751_PCICR_CFIN;
-	outl(word,PCI_REG(SH7751_PCICR)); 
-	PCIDBG(2,"PCI: bigsur_pci_init finished\n");
-
-	return 1;
-}
-
-int pcibios_map_platform_irq(u8 slot, u8 pin)
-{
-    /* The Big Sur can be used in a CPCI chassis, but the SH7751 PCI interface is on the
-     * wrong end of the board so that it can also support a V320 CPI interface chip...
-     * Therefor the IRQ mapping is somewhat use dependent... I'l assume a linear map for
-     * now, i.e. INTA=slot0,pin0... INTD=slot3,pin0...
-     */ 
-    int irq = (slot + pin-1)%4 + BIGSUR_SH7751_PCI_IRQ_BASE;
-    PCIDBG(2,"PCI: Mapping Big Sur IRQ for slot %d, pin %c to irq %d\n", slot, pin-1+'A', irq);
-    return irq;
-     
-}
diff -Nru a/arch/sh/boards/bigsur/setup.c b/arch/sh/boards/bigsur/setup.c
--- a/arch/sh/boards/bigsur/setup.c	Tue Feb  3 19:45:41 2004
+++ b/arch/sh/boards/bigsur/setup.c	Tue Feb  3 19:45:41 2004
@@ -33,22 +33,11 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/bitops.h>
-
+#include <asm/machvec.h>
 #include <asm/bigsur/io.h>
 #include <asm/hd64465/hd64465.h>
 #include <asm/bigsur/bigsur.h>
 
-//#define BIGSUR_DEBUG 3
-#undef BIGSUR_DEBUG
-
-#ifdef BIGSUR_DEBUG
-#define DPRINTK(args...)	printk(args)
-#define DIPRINTK(n, args...)	if (BIGSUR_DEBUG>(n)) printk(args)
-#else
-#define DPRINTK(args...)
-#define DIPRINTK(n, args...)
-#endif /* BIGSUR_DEBUG */
-
 /*===========================================================*/
 //		Big Sur Init Routines	
 /*===========================================================*/
@@ -58,13 +47,27 @@
 	return "Big Sur";
 }
 
+/*
+ * The Machine Vector
+ */
+extern void heartbeat_bigsur(void);
+extern void init_bigsur_IRQ(void);
+
+struct sh_machine_vector mv_bigsur __initmv = {
+	.mv_nr_irqs		= NR_IRQS,     // Defined in <asm/irq.h>
+
+	.mv_isa_port2addr	= bigsur_isa_port2addr,
+	.mv_irq_demux       	= bigsur_irq_demux,
+
+	.mv_init_irq		= init_bigsur_IRQ,
+#ifdef CONFIG_HEARTBEAT
+	.mv_heartbeat		= heartbeat_bigsur,
+#endif
+};
+ALIAS_MV(bigsur)
+
 int __init platform_setup(void)
 {
-	static int done = 0; /* run this only once */
-
-	if (!MACH_BIGSUR || done) return 0;
-	done = 1;
-
 	/* Mask all 2nd level IRQ's */
 	outb(-1,BIGSUR_IMR0);
 	outb(-1,BIGSUR_IMR1);
@@ -88,7 +91,6 @@
 	/* set the IO port to BIGSUR_ETHER_IOPORT */
 	outw(BIGSUR_ETHER_IOPORT<<3, BIGSUR_ETHR+0x2);
 
-    return 0;
+	return 0;
 }
 
-module_init(setup_bigsur);
diff -Nru a/arch/sh/boards/cat68701/Makefile b/arch/sh/boards/cat68701/Makefile
--- a/arch/sh/boards/cat68701/Makefile	Tue Feb  3 19:45:16 2004
+++ b/arch/sh/boards/cat68701/Makefile	Tue Feb  3 19:45:16 2004
@@ -6,5 +6,5 @@
 # unless it's something special (ie not a .c file).
 #
 
-obj-y	 := mach.o setup.o io.o irq.o
+obj-y	 := setup.o irq.o
 
diff -Nru a/arch/sh/boards/cat68701/io.c b/arch/sh/boards/cat68701/io.c
--- a/arch/sh/boards/cat68701/io.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,207 +0,0 @@
-/* 
- * linux/arch/sh/boards/cat68701/io.c
- *
- * Copyright (C) 2000  Niibe Yutaka
- *               2001  Yutaro Ebihara
- *
- * I/O routines for A-ONE Corp CAT-68701 SH7708 Board
- *
- * 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.
- *
- */
-
-#include <asm/io.h>
-#include <asm/machvec.h>
-#include <linux/config.h>
-#include <linux/module.h>
-
-#define SH3_PCMCIA_BUG_WORKAROUND 1
-#define DUMMY_READ_AREA6	  0xba000000
-
-#define PORT2ADDR(x) (cat68701_isa_port2addr(x))
-
-static inline void delay(void)
-{
-	ctrl_inw(0xa0000000);
-}
-
-unsigned char cat68701_inb(unsigned long port)
-{
-	return *(volatile unsigned char*)PORT2ADDR(port);
-}
-
-unsigned short cat68701_inw(unsigned long port)
-{
-	return *(volatile unsigned short*)PORT2ADDR(port);
-}
-
-unsigned int cat68701_inl(unsigned long port)
-{
-	return *(volatile unsigned long*)PORT2ADDR(port);
-}
-
-unsigned char cat68701_inb_p(unsigned long port)
-{
-	unsigned long v = *(volatile unsigned char*)PORT2ADDR(port);
-
-	delay();
-	return v;
-}
-
-unsigned short cat68701_inw_p(unsigned long port)
-{
-	unsigned long v = *(volatile unsigned short*)PORT2ADDR(port);
-
-	delay();
-	return v;
-}
-
-unsigned int cat68701_inl_p(unsigned long port)
-{
-	unsigned long v = *(volatile unsigned long*)PORT2ADDR(port);
-
-	delay();
-	return v;
-}
-
-void cat68701_insb(unsigned long port, void *buffer, unsigned long count)
-{
-	unsigned char *buf=buffer;
-	while(count--) *buf++=inb(port);
-}
-
-void cat68701_insw(unsigned long port, void *buffer, unsigned long count)
-{
-	unsigned short *buf=buffer;
-	while(count--) *buf++=inw(port);
-#ifdef SH3_PCMCIA_BUG_WORKAROUND
-	ctrl_inb (DUMMY_READ_AREA6);
-#endif
-}
-
-void cat68701_insl(unsigned long port, void *buffer, unsigned long count)
-{
-	unsigned long *buf=buffer;
-	while(count--) *buf++=inl(port);
-#ifdef SH3_PCMCIA_BUG_WORKAROUND
-	ctrl_inb (DUMMY_READ_AREA6);
-#endif
-}
-
-void cat68701_outb(unsigned char b, unsigned long port)
-{
-	*(volatile unsigned char*)PORT2ADDR(port) = b;
-}
-
-void cat68701_outw(unsigned short b, unsigned long port)
-{
-	*(volatile unsigned short*)PORT2ADDR(port) = b;
-}
-
-void cat68701_outl(unsigned int b, unsigned long port)
-{
-        *(volatile unsigned long*)PORT2ADDR(port) = b;
-}
-
-void cat68701_outb_p(unsigned char b, unsigned long port)
-{
-	*(volatile unsigned char*)PORT2ADDR(port) = b;
-	delay();
-}
-
-void cat68701_outw_p(unsigned short b, unsigned long port)
-{
-	*(volatile unsigned short*)PORT2ADDR(port) = b;
-	delay();
-}
-
-void cat68701_outl_p(unsigned int b, unsigned long port)
-{
-	*(volatile unsigned long*)PORT2ADDR(port) = b;
-	delay();
-}
-
-void cat68701_outsb(unsigned long port, const void *buffer, unsigned long count)
-{
-	const unsigned char *buf=buffer;
-	while(count--) outb(*buf++, port);
-}
-
-void cat68701_outsw(unsigned long port, const void *buffer, unsigned long count)
-{
-	const unsigned short *buf=buffer;
-	while(count--) outw(*buf++, port);
-#ifdef SH3_PCMCIA_BUG_WORKAROUND
-	ctrl_inb (DUMMY_READ_AREA6);
-#endif
-}
-
-void cat68701_outsl(unsigned long port, const void *buffer, unsigned long count)
-{
-	const unsigned long *buf=buffer;
-	while(count--) outl(*buf++, port);
-#ifdef SH3_PCMCIA_BUG_WORKAROUND
-	ctrl_inb (DUMMY_READ_AREA6);
-#endif
-}
-
-unsigned char cat68701_readb(unsigned long addr)
-{
-	return *(volatile unsigned char*)addr;
-}
-
-unsigned short cat68701_readw(unsigned long addr)
-{
-	return *(volatile unsigned short*)addr;
-}
-
-unsigned int cat68701_readl(unsigned long addr)
-{
-	return *(volatile unsigned long*)addr;
-}
-
-void cat68701_writeb(unsigned char b, unsigned long addr)
-{
-	*(volatile unsigned char*)addr = b;
-}
-
-void cat68701_writew(unsigned short b, unsigned long addr)
-{
-	*(volatile unsigned short*)addr = b;
-}
-
-void cat68701_writel(unsigned int b, unsigned long addr)
-{
-        *(volatile unsigned long*)addr = b;
-}
-
-void * cat68701_ioremap(unsigned long offset, unsigned long size)
-{
-	return (void *) P2SEGADDR(offset);
-}
-EXPORT_SYMBOL(cat68701_ioremap);
-
-void cat68701_iounmap(void *addr)
-{
-}
-EXPORT_SYMBOL(cat68701_iounmap);
-
-unsigned long cat68701_isa_port2addr(unsigned long offset)
-{
-  /* CompactFlash (IDE) */
-  if(((offset >= 0x1f0) && (offset <= 0x1f7)) || (offset==0x3f6))
-    return 0xba000000 + offset;
-
-  /* INPUT PORT */
-  if((offset >= 0x3fc) && (offset <= 0x3fd))
-    return 0xb4007000 + offset;
-
-  /* OUTPUT PORT */
-  if((offset >= 0x3fe) && (offset <= 0x3ff))
-    return 0xb4007400 + offset;
-
-  return offset + 0xb4000000; /* other I/O (EREA 5)*/
-}
-
diff -Nru a/arch/sh/boards/cat68701/mach.c b/arch/sh/boards/cat68701/mach.c
--- a/arch/sh/boards/cat68701/mach.c	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,66 +0,0 @@
-/*
- * linux/arch/sh/boards/cat68701/mach.c
- *
- * Copyright (C) 2000 Stuart Menefy (stuart.menefy@st.com)
- *               2001 Yutaro Ebihara (ebihara@si-linux.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * Machine vector for the A-ONE corp. CAT-68701 SH7708 board
- */
-
-#include <linux/config.h>
-#include <linux/init.h>
-
-#include <asm/machvec.h>
-#include <asm/rtc.h>
-#include <asm/machvec_init.h>
-#include <asm/cat68701/io.h>
-
-/*
- * The Machine Vector
- */
-
-struct sh_machine_vector mv_cat68701 __initmv = {
-	.mv_nr_irqs		= 32,
-	.mv_inb			= cat68701_inb,
-	.mv_inw			= cat68701_inw,
-	.mv_inl			= cat68701_inl,
-	.mv_outb		= cat68701_outb,
-	.mv_outw		= cat68701_outw,
-	.mv_outl		= cat68701_outl,
-
-	.mv_inb_p		= cat68701_inb_p,
-	.mv_inw_p		= cat68701_inw,
-	.mv_inl_p		= cat68701_inl,
-	.mv_outb_p		= cat68701_outb_p,
-	.mv_outw_p		= cat68701_outw,
-	.mv_outl_p		= cat68701_outl,
-
-	.mv_insb		= cat68701_insb,
-	.mv_insw		= cat68701_insw,
-	.mv_insl		= cat68701_insl,
-	.mv_outsb		= cat68701_outsb,
-	.mv_outsw		= cat68701_outsw,
-	.mv_outsl		= cat68701_outsl,
-
-	.mv_readb		= cat68701_readb,
-	.mv_readw		= cat68701_readw,
-	.mv_readl		= cat68701_readl,
-	.mv_writeb		= cat68701_writeb,
-	.mv_writew		= cat68701_writew,
-	.mv_writel		= cat68701_writel,
-
-	.mv_ioremap		= cat68701_ioremap,
-	.mv_iounmap		= cat68701_iounmap,
-
-	.mv_isa_port2addr	= cat68701_isa_port2addr,
-	.mv_irq_demux           = cat68701_irq_demux,
-
-	.mv_init_irq		= init_cat68701_IRQ,
-#ifdef CONFIG_HEARTBEAT
-	.mv_heartbeat		= heartbeat_cat68701,
-#endif
-};
-ALIAS_MV(cat68701)
diff -Nru a/arch/sh/boards/cat68701/setup.c b/arch/sh/boards/cat68701/setup.c
--- a/arch/sh/boards/cat68701/setup.c	Tue Feb  3 19:45:30 2004
+++ b/arch/sh/boards/cat68701/setup.c	Tue Feb  3 19:45:30 2004
@@ -14,21 +14,18 @@
 
 #include <asm/io.h>
 #include <asm/machvec.h>
+#include <asm/mach/io.h>
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/init.h>
+#include <linux/sched.h>
 
 const char *get_system_type(void)
 {
 	return "CAT-68701";
 }
 
-void platform_setup()
-{
-	/* dummy read erea5 (CS8900A) */
-}
-
 #ifdef CONFIG_HEARTBEAT
-#include <linux/sched.h>
 void heartbeat_cat68701()
 {
         static unsigned int cnt = 0, period = 0 , bit = 0;
@@ -48,4 +45,42 @@
 	outw(bit<<15,0x3fe);
 }
 #endif /* CONFIG_HEARTBEAT */
+
+unsigned long cat68701_isa_port2addr(unsigned long offset)
+{
+	/* CompactFlash (IDE) */
+	if (((offset >= 0x1f0) && (offset <= 0x1f7)) || (offset==0x3f6))
+		return 0xba000000 + offset;
+
+	/* INPUT PORT */
+	if ((offset >= 0x3fc) && (offset <= 0x3fd))
+		return 0xb4007000 + offset;
+
+	/* OUTPUT PORT */
+	if ((offset >= 0x3fe) && (offset <= 0x3ff))
+		return 0xb4007400 + offset;
+
+	return offset + 0xb4000000; /* other I/O (EREA 5)*/
+}
+
+/*
+ * The Machine Vector
+ */
+
+struct sh_machine_vector mv_cat68701 __initmv = {
+	.mv_nr_irqs		= 32,
+	.mv_isa_port2addr	= cat68701_isa_port2addr,
+	.mv_irq_demux		= cat68701_irq_demux,
+
+	.mv_init_irq		= init_cat68701_IRQ,
+#ifdef CONFIG_HEARTBEAT
+	.mv_heartbeat		= heartbeat_cat68701,
+#endif
+};
+ALIAS_MV(cat68701)
+
+int __init platform_setup(void)
+{
+	/* dummy read erea5 (CS8900A) */
+}
 
diff -Nru a/arch/sh/boards/cqreek/Makefile b/arch/sh/boards/cqreek/Makefile
--- a/arch/sh/boards/cqreek/Makefile	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/boards/cqreek/Makefile	Tue Feb  3 19:45:17 2004
@@ -6,5 +6,5 @@
 # unless it's something special (ie not a .c file).
 #
 
-obj-y	 := mach.o setup.o io.o irq.o
+obj-y	 := setup.o irq.o
 
diff -Nru a/arch/sh/boards/cqreek/io.c b/arch/sh/boards/cqreek/io.c
--- a/arch/sh/boards/cqreek/io.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,14 +0,0 @@
-#define IDE_OFFSET 0xA4000000UL
-#define ISA_OFFSET 0xA4A00000UL
-
-unsigned long cqreek_port2addr(unsigned long port)
-{
-	if (0x0000<=port && port<=0x0040)
-		return IDE_OFFSET + port;
-	if ((0x01f0<=port && port<=0x01f7) || port == 0x03f6)
-		return IDE_OFFSET + port;
-
-	return ISA_OFFSET + port;
-}
-
-
diff -Nru a/arch/sh/boards/cqreek/mach.c b/arch/sh/boards/cqreek/mach.c
--- a/arch/sh/boards/cqreek/mach.c	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,66 +0,0 @@
-/* $Id: mach.c,v 1.1.2.4.2.1 2003/01/10 17:26:32 lethal Exp $
- *
- * arch/sh/kernel/setup_cqreek.c
- *
- * Copyright (C) 2000  Niibe Yutaka
- *
- * CqREEK IDE/ISA Bridge Support.
- *
- */
-
-#include <asm/rtc.h>
-#include <asm/io.h>
-#include <asm/io_generic.h>
-#include <asm/machvec.h>
-#include <asm/machvec_init.h>
-#include <asm/cqreek/cqreek.h>
-
-/*
- * The Machine Vector
- */
-
-struct sh_machine_vector mv_cqreek __initmv = {
-#if defined(CONFIG_CPU_SH4)
-	.mv_nr_irqs		= 48,
-#elif defined(CONFIG_CPU_SUBTYPE_SH7708)
-	.mv_nr_irqs		= 32,
-#elif defined(CONFIG_CPU_SUBTYPE_SH7709)
-	.mv_nr_irqs		= 61,
-#endif
-
-	.mv_inb			= generic_inb,
-	.mv_inw			= generic_inw,
-	.mv_inl			= generic_inl,
-	.mv_outb		= generic_outb,
-	.mv_outw		= generic_outw,
-	.mv_outl		= generic_outl,
-
-	.mv_inb_p		= generic_inb_p,
-	.mv_inw_p		= generic_inw_p,
-	.mv_inl_p		= generic_inl_p,
-	.mv_outb_p		= generic_outb_p,
-	.mv_outw_p		= generic_outw_p,
-	.mv_outl_p		= generic_outl_p,
-
-	.mv_insb		= generic_insb,
-	.mv_insw		= generic_insw,
-	.mv_insl		= generic_insl,
-	.mv_outsb		= generic_outsb,
-	.mv_outsw		= generic_outsw,
-	.mv_outsl		= generic_outsl,
-
-	.mv_readb		= generic_readb,
-	.mv_readw		= generic_readw,
-	.mv_readl		= generic_readl,
-	.mv_writeb		= generic_writeb,
-	.mv_writew		= generic_writew,
-	.mv_writel		= generic_writel,
-
-	.mv_init_irq		= init_cqreek_IRQ,
-
-	.mv_isa_port2addr	= cqreek_port2addr,
-
-	.mv_ioremap		= generic_ioremap,
-	.mv_iounmap		= generic_iounmap,
-};
-ALIAS_MV(cqreek)
diff -Nru a/arch/sh/boards/cqreek/setup.c b/arch/sh/boards/cqreek/setup.c
--- a/arch/sh/boards/cqreek/setup.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/boards/cqreek/setup.c	Tue Feb  3 19:45:17 2004
@@ -1,4 +1,4 @@
-/* $Id: setup.c,v 1.1.2.5 2002/03/02 21:57:07 lethal Exp $
+/* $Id: setup.c,v 1.5 2003/08/04 01:51:58 lethal Exp $
  *
  * arch/sh/kernel/setup_cqreek.c
  *
@@ -13,16 +13,48 @@
 #include <linux/init.h>
 #include <linux/irq.h>
 
-#include <asm/cqreek/cqreek.h>
+#include <asm/mach/cqreek.h>
+#include <asm/machvec.h>
 #include <asm/io.h>
 #include <asm/io_generic.h>
 #include <asm/irq.h>
 #include <asm/rtc.h>
 
+#define IDE_OFFSET 0xA4000000UL
+#define ISA_OFFSET 0xA4A00000UL
+
 const char *get_system_type(void)
 {
 	return "CqREEK";
 }
+
+static unsigned long cqreek_port2addr(unsigned long port)
+{
+	if (0x0000<=port && port<=0x0040)
+		return IDE_OFFSET + port;
+	if ((0x01f0<=port && port<=0x01f7) || port == 0x03f6)
+		return IDE_OFFSET + port;
+
+	return ISA_OFFSET + port;
+}
+
+/*
+ * The Machine Vector
+ */
+struct sh_machine_vector mv_cqreek __initmv = {
+#if defined(CONFIG_CPU_SH4)
+	.mv_nr_irqs		= 48,
+#elif defined(CONFIG_CPU_SUBTYPE_SH7708)
+	.mv_nr_irqs		= 32,
+#elif defined(CONFIG_CPU_SUBTYPE_SH7709)
+	.mv_nr_irqs		= 61,
+#endif
+
+	.mv_init_irq		= init_cqreek_IRQ,
+
+	.mv_isa_port2addr	= cqreek_port2addr,
+};
+ALIAS_MV(cqreek)
 
 /*
  * Initialize the board
diff -Nru a/arch/sh/boards/dmida/mach.c b/arch/sh/boards/dmida/mach.c
--- a/arch/sh/boards/dmida/mach.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/boards/dmida/mach.c	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,5 @@
 /*
- * linux/arch/sh/kernel/mach_dmida.c
+ * linux/arch/sh/boards/dmida/mach.c
  *
  * by Greg Banks <gbanks@pocketpenguins.com>
  * (c) 2000 PocketPenguins Inc
@@ -30,8 +30,6 @@
  */
 
 struct sh_machine_vector mv_dmida __initmv = {
-	.mv_name		= "DMIDA",
-
 	.mv_nr_irqs		= HD64465_IRQ_BASE+HD64465_IRQ_NUM,
 
 	.mv_inb			= hd64465_inb,
@@ -55,17 +53,7 @@
 	.mv_outsw		= hd64465_outsw,
 	.mv_outsl		= hd64465_outsl,
 
-	.mv_readb		= generic_readb,
-	.mv_readw		= generic_readw,
-	.mv_readl		= generic_readl,
-	.mv_writeb		= generic_writeb,
-	.mv_writew		= generic_writew,
-	.mv_writel		= generic_writel,
-
 	.mv_irq_demux		= hd64465_irq_demux,
-
-	.mv_rtc_gettimeofday	= sh_rtc_gettimeofday,
-	.mv_rtc_settimeofday	= sh_rtc_settimeofday,
 };
 ALIAS_MV(dmida)
 
diff -Nru a/arch/sh/boards/dreamcast/Makefile b/arch/sh/boards/dreamcast/Makefile
--- a/arch/sh/boards/dreamcast/Makefile	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/boards/dreamcast/Makefile	Tue Feb  3 19:45:17 2004
@@ -6,7 +6,5 @@
 # unless it's something special (ie not a .c file).
 #
 
-obj-y	 := mach.o setup.o io.o irq.o rtc.o
-
-obj-$(CONFIG_PCI) += pci.o
+obj-y	 := setup.o irq.o rtc.o
 
diff -Nru a/arch/sh/boards/dreamcast/io.c b/arch/sh/boards/dreamcast/io.c
--- a/arch/sh/boards/dreamcast/io.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,12 +0,0 @@
-/*
- *	$Id: io.c,v 1.1.2.1 2002/01/19 23:54:19 mrbrown Exp $
- *	I/O routines for SEGA Dreamcast
- */
-
-#include <asm/io.h>
-#include <asm/machvec.h>
-
-unsigned long dreamcast_isa_port2addr(unsigned long offset)
-{
-	return offset + 0xa0000000;
-}
diff -Nru a/arch/sh/boards/dreamcast/mach.c b/arch/sh/boards/dreamcast/mach.c
--- a/arch/sh/boards/dreamcast/mach.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,60 +0,0 @@
-/*
- *	$Id: mach.c,v 1.4 2003/05/20 03:04:36 lethal Exp $
- *	SEGA Dreamcast machine vector
- */
-
-#include <linux/config.h>
-#include <linux/init.h>
-#include <linux/time.h>
-
-#include <asm/machvec.h>
-#include <asm/machvec_init.h>
-
-#include <asm/io_generic.h>
-#include <asm/dreamcast/io.h>
-#include <asm/irq.h>
-
-void __init dreamcast_pcibios_init(void);
-
-/*
- * The Machine Vector
- */
-
-struct sh_machine_vector mv_dreamcast __initmv = {
-	.mv_nr_irqs		= NR_IRQS,
-
-	.mv_inb			= generic_inb,
-	.mv_inw			= generic_inw,
-	.mv_inl			= generic_inl,
-	.mv_outb		= generic_outb,
-	.mv_outw		= generic_outw,
-	.mv_outl		= generic_outl,
-
-	.mv_inb_p		= generic_inb_p,
-	.mv_inw_p		= generic_inw,
-	.mv_inl_p		= generic_inl,
-	.mv_outb_p		= generic_outb_p,
-	.mv_outw_p		= generic_outw,
-	.mv_outl_p		= generic_outl,
-
-	.mv_insb		= generic_insb,
-	.mv_insw		= generic_insw,
-	.mv_insl		= generic_insl,
-	.mv_outsb		= generic_outsb,
-	.mv_outsw		= generic_outsw,
-	.mv_outsl		= generic_outsl,
-
-	.mv_readb		= generic_readb,
-	.mv_readw		= generic_readw,
-	.mv_readl		= generic_readl,
-	.mv_writeb		= generic_writeb,
-	.mv_writew		= generic_writew,
-	.mv_writel		= generic_writel,
-
-	.mv_ioremap		= generic_ioremap,
-	.mv_iounmap		= generic_iounmap,
-
-	.mv_isa_port2addr	= dreamcast_isa_port2addr,
-	.mv_irq_demux		= systemasic_irq_demux,
-};
-ALIAS_MV(dreamcast)
diff -Nru a/arch/sh/boards/dreamcast/pci.c b/arch/sh/boards/dreamcast/pci.c
--- a/arch/sh/boards/dreamcast/pci.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,214 +0,0 @@
-/*
- $	$Id: pci.c,v 1.1.2.4.2.1 2003/03/31 14:33:18 lethal Exp $
- *	Dreamcast PCI: Supports SEGA Broadband Adaptor only.
- */
-
-#include <linux/config.h>
-#include <linux/sched.h>
-#include <linux/kernel.h>
-#include <linux/param.h>
-#include <linux/interrupt.h>
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/pci.h>
-
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/dreamcast/sysasic.h>
-
-#define	GAPSPCI_REGS		0x01001400
-#define GAPSPCI_DMA_BASE	0x01840000
-#define GAPSPCI_DMA_SIZE	32768
-#define GAPSPCI_BBA_CONFIG	0x01001600
-
-#define	GAPSPCI_IRQ		HW_EVENT_EXTERNAL
-
-static int gapspci_dma_used;
-
-/* XXX: Uh... */
-static struct resource gapspci_io_resource = {
-	"GAPSPCI IO",
-	0x01001600,
-	0x010016ff,
-	IORESOURCE_IO
-};
-
-static struct resource gapspci_mem_resource = {
-	"GAPSPCI mem",
-	0x01840000,
-	0x01847fff,
-	IORESOURCE_MEM
-};
-
-static struct pci_ops gapspci_pci_ops;
-struct pci_channel board_pci_channels[] = {
-	{&gapspci_pci_ops, &gapspci_io_resource, &gapspci_mem_resource, 0, 1},
-	{NULL, NULL, NULL, 0, 0},
-};
-
-struct pci_fixup pcibios_fixups[] = {
-	{0, 0, 0, NULL}
-};
-
-#define BBA_SELECTED(bus,devfn) (bus->number==0 && devfn==0)
-
-static int gapspci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 * val)
-{
-	switch (size) {
-	case 1:
-		if (BBA_SELECTED(bus, devfn))
-			*val = (u8)inb(GAPSPCI_BBA_CONFIG+where);
-	else
-			*val = (u8)0xff;
-		break;
-	case 2:
-		if (BBA_SELECTED(bus, devfn))
-			*val = (u16)inw(GAPSPCI_BBA_CONFIG+where);
-	else
-			*val = (u16)0xffff;
-		break;
-	case 4:
-		if (BBA_SELECTED(bus, devfn))
-		*val = inl(GAPSPCI_BBA_CONFIG+where);
-	else
-                *val = 0xffffffff;
-		break;
-	}	
-        return PCIBIOS_SUCCESSFUL;
-}
-
-static int gapspci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val)
-{
-	if (BBA_SELECTED(bus, devfn)) {
-		switch (size) {
-		case 1:
-			if (BBA_SELECTED(bus, devfn))
-				outb((u8)val, GAPSPCI_BBA_CONFIG+where);
-			break;
-		case 2:
-			if (BBA_SELECTED(bus, devfn))
-				outw((u16)val, GAPSPCI_BBA_CONFIG+where);
-			break;
-		case 4:
-			if (BBA_SELECTED(bus, devfn))
-		outl(val, GAPSPCI_BBA_CONFIG+where);
-			break;
-		}
-	}
-        return PCIBIOS_SUCCESSFUL;
-}
-
-static struct pci_ops gapspci_pci_ops = {
-	.read = 	gapspci_read,
-	.write = 	gapspci_write,
-};
-
-
-void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
-			   dma_addr_t * dma_handle)
-{
-	unsigned long buf;
-
-	if (gapspci_dma_used+size > GAPSPCI_DMA_SIZE)
-		return NULL;
-
-	buf = GAPSPCI_DMA_BASE+gapspci_dma_used;
-
-	gapspci_dma_used = PAGE_ALIGN(gapspci_dma_used+size);
-	
-	printk("pci_alloc_consistent: %ld bytes at 0x%lx\n", (long)size, buf);
-
-	*dma_handle = (dma_addr_t)buf;
-
-	return (void *)P2SEGADDR(buf);
-}
-
-
-void pci_free_consistent(struct pci_dev *hwdev, size_t size,
-			 void *vaddr, dma_addr_t dma_handle)
-{
-	/* XXX */
-	gapspci_dma_used = 0;
-}
-
-
-void __init pcibios_fixup_bus(struct pci_bus *bus)
-{
-	struct list_head *ln;
-	struct pci_dev *dev;
-
-	for (ln=bus->devices.next; ln != &bus->devices; ln=ln->next) {
-		dev = pci_dev_b(ln);
-		if (!BBA_SELECTED(bus, dev->devfn)) continue;
-
-		printk("PCI: MMIO fixup to %s\n", dev->dev.name);
-		dev->resource[1].start=0x01001700;
-		dev->resource[1].end=0x010017ff;
-	}
-}
-
-
-static u8 __init no_swizzle(struct pci_dev *dev, u8 * pin)
-{
-	return PCI_SLOT(dev->devfn);
-}
-
-
-static int __init map_dc_irq(struct pci_dev *dev, u8 slot, u8 pin)
-{
-	return GAPSPCI_IRQ;
-}
-
-void __init pcibios_fixup(void) { /* Do nothing. */ }
-
-void __init pcibios_fixup_irqs(void)
-{
-	pci_fixup_irqs(no_swizzle, map_dc_irq);
-}
-
-int __init gapspci_init(void)
-{
-	int i;
-	char idbuf[16];
-
-	for(i=0; i<16; i++)
-		idbuf[i]=inb(GAPSPCI_REGS+i);
-
-	if(strncmp(idbuf, "GAPSPCI_BRIDGE_2", 16))
-		return -1;
-
-	outl(0x5a14a501, GAPSPCI_REGS+0x18);
-
-	for(i=0; i<1000000; i++);
-
-	if(inl(GAPSPCI_REGS+0x18)!=1)
-		return -1;
-
-	outl(0x01000000, GAPSPCI_REGS+0x20);
-	outl(0x01000000, GAPSPCI_REGS+0x24);
-
-	outl(GAPSPCI_DMA_BASE, GAPSPCI_REGS+0x28);
-	outl(GAPSPCI_DMA_BASE+GAPSPCI_DMA_SIZE, GAPSPCI_REGS+0x2c);
-
-	outl(1, GAPSPCI_REGS+0x14);
-	outl(1, GAPSPCI_REGS+0x34);
-
-	gapspci_dma_used=0;
-
-	/* Setting Broadband Adapter */
-	outw(0xf900, GAPSPCI_BBA_CONFIG+0x06);
-	outl(0x00000000, GAPSPCI_BBA_CONFIG+0x30);
-	outb(0x00, GAPSPCI_BBA_CONFIG+0x3c);
-	outb(0xf0, GAPSPCI_BBA_CONFIG+0x0d);
-	outw(0x0006, GAPSPCI_BBA_CONFIG+0x04);
-	outl(0x00002001, GAPSPCI_BBA_CONFIG+0x10);
-	outl(0x01000000, GAPSPCI_BBA_CONFIG+0x14);
-
-	return 0;
-}
-
-/* Haven't done anything here as yet */
-char * __devinit pcibios_setup(char *str)
-{
-	return str;
-}
diff -Nru a/arch/sh/boards/dreamcast/setup.c b/arch/sh/boards/dreamcast/setup.c
--- a/arch/sh/boards/dreamcast/setup.c	Tue Feb  3 19:45:16 2004
+++ b/arch/sh/boards/dreamcast/setup.c	Tue Feb  3 19:45:16 2004
@@ -1,9 +1,10 @@
-/* arch/sh/kernel/setup_dc.c
+/* 
+ * arch/sh/boards/dreamcast/setup.c
  *
  * Hardware support for the Sega Dreamcast.
  *
  * Copyright (c) 2001, 2002 M. R. Brown <mrbrown@linuxdc.org>
- * Copyright (c) 2002 Paul Mundt <lethal@chaoticdreams.org>
+ * Copyright (c) 2002, 2003 Paul Mundt <lethal@linux-sh.org>
  *
  * This file is part of the LinuxDC project (www.linuxdc.org)
  *
@@ -23,21 +24,27 @@
 
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/dreamcast/sysasic.h>
+#include <asm/machvec.h>
+#include <asm/machvec_init.h>
+#include <asm/mach/sysasic.h>
 
 extern struct hw_interrupt_type systemasic_int;
 /* XXX: Move this into it's proper header. */
 extern void (*board_time_init)(void);
 extern void aica_time_init(void);
-
+extern int gapspci_init(void);
+extern int systemasic_irq_demux(int);
 const char *get_system_type(void)
 {
 	return "Sega Dreamcast";
 }
 
-#ifdef CONFIG_PCI
-extern int gapspci_init(void);
-#endif
+struct sh_machine_vector mv_dreamcast __initmv = {
+	.mv_nr_irqs		= NR_IRQS,
+
+	.mv_irq_demux		= systemasic_irq_demux,
+};
+ALIAS_MV(dreamcast)
 
 int __init platform_setup(void)
 {
@@ -48,6 +55,8 @@
 
 	/* Acknowledge any previous events */
 	/* XXX */
+
+	__set_io_port_base(0xa0000000);
 
 	/* Assign all virtual IRQs to the System ASIC int. handler */
 	for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++)
diff -Nru a/arch/sh/boards/ec3104/Makefile b/arch/sh/boards/ec3104/Makefile
--- a/arch/sh/boards/ec3104/Makefile	Tue Feb  3 19:45:34 2004
+++ b/arch/sh/boards/ec3104/Makefile	Tue Feb  3 19:45:34 2004
@@ -6,5 +6,5 @@
 # unless it's something special (ie not a .c file).
 #
 
-obj-y	 := mach.o setup.o io.o irq.o
+obj-y	 := setup.o io.o irq.o
 
diff -Nru a/arch/sh/boards/ec3104/mach.c b/arch/sh/boards/ec3104/mach.c
--- a/arch/sh/boards/ec3104/mach.c	Tue Feb  3 19:45:40 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,69 +0,0 @@
-/*
- * linux/arch/sh/kernel/mach_ec3104.c
- *  EC3104 companion chip support
- *
- * Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>
- *
- */
-/* EC3104 note:
- * This code was written without any documentation about the EC3104 chip.  While
- * I hope I got most of the basic functionality right, the register names I use
- * are most likely completely different from those in the chip documentation.
- *
- * If you have any further information about the EC3104, please tell me
- * (prumpf@tux.org).
- */
-
-#include <linux/init.h>
-
-#include <asm/machvec.h>
-#include <asm/rtc.h>
-#include <asm/machvec_init.h>
-
-#include <asm/io.h>
-#include <asm/irq.h>
-
-/*
- * The Machine Vector
- */
-
-struct sh_machine_vector mv_ec3104 __initmv = {
-	.mv_name		= "EC3104",
-
-	.mv_nr_irqs		= 96,
-
-	.mv_inb			= ec3104_inb,
-	.mv_inw			= ec3104_inw,
-	.mv_inl			= ec3104_inl,
-	.mv_outb		= ec3104_outb,
-	.mv_outw		= ec3104_outw,
-	.mv_outl		= ec3104_outl,
-
-	.mv_inb_p		= generic_inb_p,
-	.mv_inw_p		= generic_inw,
-	.mv_inl_p		= generic_inl,
-	.mv_outb_p		= generic_outb_p,
-	.mv_outw_p		= generic_outw,
-	.mv_outl_p		= generic_outl,
-
-	.mv_insb		= generic_insb,
-	.mv_insw		= generic_insw,
-	.mv_insl		= generic_insl,
-	.mv_outsb		= generic_outsb,
-	.mv_outsw		= generic_outsw,
-	.mv_outsl		= generic_outsl,
-
-	.mv_readb		= generic_readb,
-	.mv_readw		= generic_readw,
-	.mv_readl		= generic_readl,
-	.mv_writeb		= generic_writeb,
-	.mv_writew		= generic_writew,
-	.mv_writel		= generic_writel,
-
-	.mv_irq_demux		= ec3104_irq_demux,
-
-	.mv_rtc_gettimeofday	= sh_rtc_gettimeofday,
-	.mv_rtc_settimeofday	= sh_rtc_settimeofday,
-};
-
-ALIAS_MV(ec3104)
diff -Nru a/arch/sh/boards/ec3104/setup.c b/arch/sh/boards/ec3104/setup.c
--- a/arch/sh/boards/ec3104/setup.c	Tue Feb  3 19:45:41 2004
+++ b/arch/sh/boards/ec3104/setup.c	Tue Feb  3 19:45:41 2004
@@ -24,16 +24,38 @@
 
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/ec3104/ec3104.h>
+#include <asm/machvec.h>
+#include <asm/mach/ec3104.h>
 
-int __init setup_ec3104(void)
+const char *get_system_type(void)
+{
+	return "EC3104";
+}
+
+/*
+ * The Machine Vector
+ */
+
+struct sh_machine_vector mv_ec3104 __initmv = {
+	.mv_nr_irqs	= 96,
+
+	.mv_inb		= ec3104_inb,
+	.mv_inw		= ec3104_inw,
+	.mv_inl		= ec3104_inl,
+	.mv_outb	= ec3104_outb,
+	.mv_outw	= ec3104_outw,
+	.mv_outl	= ec3104_outl,
+
+	.mv_irq_demux	= ec3104_irq_demux,
+};
+
+ALIAS_MV(ec3104)
+
+int __init platform_setup(void)
 {
 	char str[8];
 	int i;
 	
-	if (!MACH_EC3104)
-		printk("!MACH_EC3104\n");
-
 	if (0)
 		return 0;
 
@@ -54,4 +76,3 @@
 	return 0;
 }
 
-module_init(setup_ec3104);
diff -Nru a/arch/sh/boards/harp/mach.c b/arch/sh/boards/harp/mach.c
--- a/arch/sh/boards/harp/mach.c	Tue Feb  3 19:45:29 2004
+++ b/arch/sh/boards/harp/mach.c	Tue Feb  3 19:45:29 2004
@@ -1,5 +1,5 @@
 /*
- * linux/arch/sh/stboards/mach.c
+ * linux/arch/sh/boards/harp/mach.c
  *
  * Copyright (C) 2000 Stuart Menefy (stuart.menefy@st.com)
  *
@@ -14,7 +14,7 @@
 #include <asm/machvec.h>
 #include <asm/rtc.h>
 #include <asm/machvec_init.h>
-#include <asm/hd64465.h/io.h>
+#include <asm/hd64465/io.h>
 #include <asm/hd64465/hd64465.h>
 
 void setup_harp(void);
@@ -49,16 +49,6 @@
 	.mv_outsw		= hd64465_outsw,
 	.mv_outsl		= hd64465_outsl,
 
-	.mv_readb		= generic_readb,
-	.mv_readw		= generic_readw,
-	.mv_readl		= generic_readl,
-	.mv_writeb		= generic_writeb,
-	.mv_writew		= generic_writew,
-	.mv_writel		= generic_writel,
-
-        .mv_ioremap             = generic_ioremap,
-        .mv_iounmap             = generic_iounmap,
- 
         .mv_isa_port2addr       = hd64465_isa_port2addr,
 
 #ifdef CONFIG_PCI
diff -Nru a/arch/sh/boards/hp6xx/hp620/mach.c b/arch/sh/boards/hp6xx/hp620/mach.c
--- a/arch/sh/boards/hp6xx/hp620/mach.c	Tue Feb  3 19:45:30 2004
+++ b/arch/sh/boards/hp6xx/hp620/mach.c	Tue Feb  3 19:45:30 2004
@@ -24,8 +24,6 @@
  */
 
 struct sh_machine_vector mv_hp620 __initmv = {
-        .mv_name                = "hp620",
-
         .mv_nr_irqs             = HD64461_IRQBASE+HD64461_IRQ_NUM,
 
         .mv_inb                 = hd64461_inb,
@@ -49,16 +47,6 @@
         .mv_outsw               = hd64461_outsw,
         .mv_outsl               = hd64461_outsl,
 
-        .mv_readb               = generic_readb,
-        .mv_readw               = generic_readw,
-        .mv_readl               = generic_readl,
-        .mv_writeb              = generic_writeb,
-        .mv_writew              = generic_writew,
-        .mv_writel              = generic_writel,
-
         .mv_irq_demux           = hd64461_irq_demux,
-
-        .mv_rtc_gettimeofday    = sh_rtc_gettimeofday,
-        .mv_rtc_settimeofday    = sh_rtc_settimeofday,
 };
 ALIAS_MV(hp620)
diff -Nru a/arch/sh/boards/hp6xx/hp680/mach.c b/arch/sh/boards/hp6xx/hp680/mach.c
--- a/arch/sh/boards/hp6xx/hp680/mach.c	Tue Feb  3 19:45:42 2004
+++ b/arch/sh/boards/hp6xx/hp680/mach.c	Tue Feb  3 19:45:42 2004
@@ -20,8 +20,6 @@
 #include <asm/irq.h>
 
 struct sh_machine_vector mv_hp680 __initmv = {
-        .mv_name                = "hp680",
-
         .mv_nr_irqs             = HD64461_IRQBASE+HD64461_IRQ_NUM,
 
         .mv_inb                 = hd64461_inb,
@@ -45,16 +43,6 @@
         .mv_outsw               = hd64461_outsw,
         .mv_outsl               = hd64461_outsl,
 
-        .mv_readb               = generic_readb,
-        .mv_readw               = generic_readw,
-        .mv_readl               = generic_readl,
-        .mv_writeb              = generic_writeb,
-        .mv_writew              = generic_writew,
-        .mv_writel              = generic_writel,
-
         .mv_irq_demux           = hd64461_irq_demux,
-
-        .mv_rtc_gettimeofday    = sh_rtc_gettimeofday,
-        .mv_rtc_settimeofday    = sh_rtc_settimeofday,
 };
 ALIAS_MV(hp680)
diff -Nru a/arch/sh/boards/hp6xx/hp690/mach.c b/arch/sh/boards/hp6xx/hp690/mach.c
--- a/arch/sh/boards/hp6xx/hp690/mach.c	Tue Feb  3 19:45:43 2004
+++ b/arch/sh/boards/hp6xx/hp690/mach.c	Tue Feb  3 19:45:43 2004
@@ -20,8 +20,6 @@
 #include <asm/irq.h>
 
 struct sh_machine_vector mv_hp690 __initmv = {
-        .mv_name                = "hp690",
-
         .mv_nr_irqs             = HD64461_IRQBASE+HD64461_IRQ_NUM,
 
         .mv_inb                 = hd64461_inb,
@@ -45,16 +43,6 @@
         .mv_outsw               = hd64461_outsw,
         .mv_outsl               = hd64461_outsl,
 
-        .mv_readb               = generic_readb,
-        .mv_readw               = generic_readw,
-        .mv_readl               = generic_readl,
-        .mv_writeb              = generic_writeb,
-        .mv_writew              = generic_writew,
-        .mv_writel              = generic_writel,
-
         .mv_irq_demux           = hd64461_irq_demux,
-
-        .mv_rtc_gettimeofday    = sh_rtc_gettimeofday,
-        .mv_rtc_settimeofday    = sh_rtc_settimeofday,
 };
 ALIAS_MV(hp690)
diff -Nru a/arch/sh/boards/mpc1211/Makefile b/arch/sh/boards/mpc1211/Makefile
--- a/arch/sh/boards/mpc1211/Makefile	Tue Feb  3 19:45:16 2004
+++ b/arch/sh/boards/mpc1211/Makefile	Tue Feb  3 19:45:16 2004
@@ -6,7 +6,7 @@
 # unless it's something special (ie not a .c file).
 #
 
-obj-y	 := mach.o setup.o io.o rtc.o led.o
+obj-y	 := setup.o rtc.o led.o
 
 obj-$(CONFIG_PCI) += pci.o
 
diff -Nru a/arch/sh/boards/mpc1211/io.c b/arch/sh/boards/mpc1211/io.c
--- a/arch/sh/boards/mpc1211/io.c	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,158 +0,0 @@
-/*
- * linux/arch/sh/kernel/io_mpc1211.c
- *
- * Copyright (C) 2001  Saito.K & Jeanne
- *
- * I/O routine for Interface MPC-1211.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <asm/io.h>
-#include <asm/mpc1211/pci.h>
-
-static inline void delay(void)
-{
-	ctrl_inw(0xa0000000);
-}
-
-static inline unsigned long port2adr(unsigned long port)
-{
-        return port + PA_PCI_IO;
-}
-
-unsigned char mpc1211_inb(unsigned long port)
-{
-        return *(__u8 *)port2adr(port);
-}
-
-unsigned short mpc1211_inw(unsigned long port)
-{
-        return *(__u16 *)port2adr(port);
-}
-
-unsigned int mpc1211_inl(unsigned long port)
-{
-        return *(__u32 *)port2adr(port);
-}
-
-void mpc1211_outb(unsigned char value, unsigned long port)
-{
-	*(__u8 *)port2adr(port) = value; 
-}
-
-void mpc1211_outw(unsigned short value, unsigned long port)
-{
-	*(__u16 *)port2adr(port) = value; 
-}
-
-void mpc1211_outl(unsigned int value, unsigned long port)
-{
-	*(__u32 *)port2adr(port) = value; 
-}
-
-unsigned char mpc1211_inb_p(unsigned long port)
-{
-	unsigned char v;
-
-	v = *(__u8 *)port2adr(port);
-	delay();
-	return v;
-}
-
-void mpc1211_outb_p(unsigned char value, unsigned long port)
-{
-	*(__u8 *)port2adr(port) = value; 
-	delay();
-}
-
-void mpc1211_insb(unsigned long port, void *addr, unsigned long count)
-{
-	volatile __u8 *p = (__u8 *)port2adr(port);
-
-	while (count--) {
-	        *((__u8 *)addr)++ = *p;
-	}
-}
-
-void mpc1211_insw(unsigned long port, void *addr, unsigned long count)
-{
-	volatile __u16 *p = (__u16 *)port2adr(port);
-
-	while (count--) {
-	        *((__u16 *)addr)++ = *p;
-	}
-}
-
-void mpc1211_insl(unsigned long port, void *addr, unsigned long count)
-{
-	volatile __u32 *p = (__u32 *)port2adr(port);
-
-	while (count--) {
-	        *((__u32 *)addr)++ = *p;
-	}
-}
-
-void mpc1211_outsb(unsigned long port, const void *addr, unsigned long count)
-{
-	volatile __u8 *p = (__u8 *)port2adr(port);
-
-	while (count--) {
-	        *p = *((__u8 *)addr)++;
-	}
-}
-
-void mpc1211_outsw(unsigned long port, const void *addr, unsigned long count)
-{
-	volatile __u16 *p = (__u16 *)port2adr(port);
-
-	while (count--) {
-	        *p = *((__u16 *)addr)++;
-	}
-}
-
-void mpc1211_outsl(unsigned long port, const void *addr, unsigned long count)
-{
-	volatile __u32 *p = (__u32 *)port2adr(port);
-
-	while (count--) {
-	        *p = *((__u32 *)addr)++;
-	}
-}
-
-unsigned char mpc1211_readb(unsigned long addr)
-{
-	return *(volatile unsigned char *)addr;
-}
-
-unsigned short mpc1211_readw(unsigned long addr)
-{
-	return *(volatile unsigned short *)addr;
-}
-
-unsigned int mpc1211_readl(unsigned long addr)
-{
-	return *(volatile unsigned int *)addr;
-}
-
-void mpc1211_writeb(unsigned char b, unsigned long addr)
-{
-	*(volatile unsigned char *)addr = b;
-}
-
-void mpc1211_writew(unsigned short b, unsigned long addr)
-{
-	*(volatile unsigned short *)addr = b;
-}
-
-void mpc1211_writel(unsigned int b, unsigned long addr)
-{
-        *(volatile unsigned int *)addr = b;
-}
-
-unsigned long mpc1211_isa_port2addr(unsigned long offset)
-{
-	return port2adr(offset);
-}
diff -Nru a/arch/sh/boards/mpc1211/mach.c b/arch/sh/boards/mpc1211/mach.c
--- a/arch/sh/boards/mpc1211/mach.c	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,77 +0,0 @@
-/*
- * linux/arch/sh/kernel/mach_mpc1211.c
- *
- * Copyright (C) 2001 Saito.K & Jeanne
- *
- * Machine vector for the Interface MPC-1211
- */
-
-#include <linux/config.h>
-#include <linux/init.h>
-
-#include <asm/machvec.h>
-#include <asm/rtc.h>
-#include <asm/machvec_init.h>
-
-#include <asm/mpc1211/io.h>
-
-void heartbeat_mpc1211(void);
-void setup_mpc1211(void);
-void init_mpc1211_IRQ(void);
-
-/*
- * The Machine Vector
- */
-
-struct sh_machine_vector mv_mpc1211 __initmv = {
-	.mv_name		= "MPC-1211",
-
-	.mv_nr_irqs		= 48,
-
-	.mv_inb			= mpc1211_inb,
-	.mv_inw			= mpc1211_inw,
-	.mv_inl			= mpc1211_inl,
-	.mv_outb		= mpc1211_outb,
-	.mv_outw		= mpc1211_outw,
-	.mv_outl		= mpc1211_outl,
-
-	.mv_inb_p		= mpc1211_inb_p,
-	.mv_inw_p		= mpc1211_inw,
-	.mv_inl_p		= mpc1211_inl,
-	.mv_outb_p		= mpc1211_outb_p,
-	.mv_outw_p		= mpc1211_outw,
-	.mv_outl_p		= mpc1211_outl,
-
-	.mv_insb		= mpc1211_insb,
-	.mv_insw		= mpc1211_insw,
-	.mv_insl		= mpc1211_insl,
-	.mv_outsb		= mpc1211_outsb,
-	.mv_outsw		= mpc1211_outsw,
-	.mv_outsl		= mpc1211_outsl,
-
-	.mv_readb		= mpc1211_readb,
-	.mv_readw		= mpc1211_readw,
-	.mv_readl		= mpc1211_readl,
-	.mv_writeb		= mpc1211_writeb,
-	.mv_writew		= mpc1211_writew,
-	.mv_writel		= mpc1211_writel,
-
-	.mv_ioremap		= generic_ioremap,
-	.mv_iounmap		= generic_iounmap,
-
-	.mv_isa_port2addr	= mpc1211_isa_port2addr,
-
-	.mv_irq_demux		= mpc1211_irq_demux,
-
-	.mv_init_arch		= setup_mpc1211,
-	.mv_init_irq		= init_mpc1211_IRQ,
-	//	mv_init_pci            = mpc1211_pcibios_init,
-
-#ifdef CONFIG_HEARTBEAT
-	.mv_heartbeat		= heartbeat_mpc1211,
-#endif
-
-	.mv_rtc_gettimeofday	= mpc1211_rtc_gettimeofday,
-	.mv_rtc_settimeofday	= mpc1211_rtc_settimeofday,
-};
-ALIAS_MV(mpc1211)
diff -Nru a/arch/sh/boards/mpc1211/pci.c b/arch/sh/boards/mpc1211/pci.c
--- a/arch/sh/boards/mpc1211/pci.c	Tue Feb  3 19:45:41 2004
+++ b/arch/sh/boards/mpc1211/pci.c	Tue Feb  3 19:45:41 2004
@@ -180,7 +180,8 @@
 
 /* Add future fixups here... */
 struct pci_fixup pcibios_fixups[] = {
-  { PCI_FIXUP_HEADER, PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5229, quirk_ali_ide_ports },
+	{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_AL,
+	  PCI_DEVICE_ID_AL_M5229, quirk_ali_ide_ports },
 	{ 0 }
 };
 
@@ -272,8 +273,6 @@
 
 	return irq;
 }
-
-void __init pcibios_fixup(void) { /* Do nothing. */ }
 
 void __init pcibios_fixup_irqs(void)
 {
diff -Nru a/arch/sh/boards/mpc1211/rtc.c b/arch/sh/boards/mpc1211/rtc.c
--- a/arch/sh/boards/mpc1211/rtc.c	Tue Feb  3 19:45:29 2004
+++ b/arch/sh/boards/mpc1211/rtc.c	Tue Feb  3 19:45:29 2004
@@ -143,3 +143,10 @@
 
 	return set_rtc_mmss(nowtime);
 }
+
+void mpc1211_time_init(void)
+{
+	rtc_get_time = mpc1211_rtc_gettimeofday;
+	rtc_set_time = mpc1211_rtc_settimeofday;
+}
+
diff -Nru a/arch/sh/boards/mpc1211/setup.c b/arch/sh/boards/mpc1211/setup.c
--- a/arch/sh/boards/mpc1211/setup.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/boards/mpc1211/setup.c	Tue Feb  3 19:45:17 2004
@@ -13,7 +13,9 @@
 #include <linux/interrupt.h>
 
 #include <asm/io.h>
+#include <asm/machvec.h>
 #include <asm/mpc1211/mpc1211.h>
+#include <asm/mpc1211/pci.h>
 #include <asm/mpc1211/m1543c.h>
 
 
@@ -54,10 +56,6 @@
 	return "Interface MPC-1211(CTP/PCI/MPC-SH02)";
 }
 
-void platform_setup(void)
-{
-}
-
 static void __init pci_write_config(unsigned long busNo,
 				    unsigned long devNo,
 				    unsigned long fncNo,
@@ -265,15 +263,16 @@
 
 static void delay (void)
 {
-  volatile unsigned short tmp;
-  tmp = *(volatile unsigned short *) 0xa0000000;
+	volatile unsigned short tmp;
+	tmp = *(volatile unsigned short *) 0xa0000000;
 }
 
 static void delay1000 (void)
 {
-  int i;
-  for (i=0; i<1000; i++)
-    delay ();
+	int i;
+
+	for (i=0; i<1000; i++)
+		delay ();
 }
 
 static int put_smb_blk(unsigned char *p, int address, int command, int no)
@@ -316,21 +315,46 @@
 	return 0;
 }
 
-void __init setup_mpc1211(void)
+/*
+ * The Machine Vector
+ */
+
+struct sh_machine_vector mv_mpc1211 __initmv = {
+	.mv_nr_irqs		= 48,
+	.mv_irq_demux		= mpc1211_irq_demux,
+	.mv_init_irq		= init_mpc1211_IRQ,
+
+#ifdef CONFIG_HEARTBEAT
+	.mv_heartbeat		= heartbeat_mpc1211,
+#endif
+};
+
+ALIAS_MV(mpc1211)
+
+/* arch/sh/boards/mpc1211/rtc.c */
+void mpc1211_time_init(void);
+
+int __init platform_setup(void)
 {
-  unsigned char spd_buf[128];
-  pci_write_config(0,0,0,0x54, 0xb0b00000);
+	unsigned char spd_buf[128];
+
+	__set_io_port_base(PA_PCI_IO);
+
+	pci_write_config(0,0,0,0x54, 0xb0b00000);
 
-retry:
-  outb(ALI15X3_ABORT, SMBHSTCNT);
-  spd_buf[0] = 0x0c;
-  spd_buf[1] = 0x43;
-  spd_buf[2] = 0x7f;
-  spd_buf[3] = 0x03;
-  spd_buf[4] = 0x00;
-  spd_buf[5] = 0x03;
-  spd_buf[6] = 0x00;
-  if (put_smb_blk(spd_buf, 0x69, 0, 7) < 0) {
-    goto retry;
-  }
+	do {
+		outb(ALI15X3_ABORT, SMBHSTCNT);
+		spd_buf[0] = 0x0c;
+		spd_buf[1] = 0x43;
+		spd_buf[2] = 0x7f;
+		spd_buf[3] = 0x03;
+		spd_buf[4] = 0x00;
+		spd_buf[5] = 0x03;
+		spd_buf[6] = 0x00;
+	} while (put_smb_blk(spd_buf, 0x69, 0, 7) < 0);
+
+	board_time_init = mpc1211_time_init;
+
+	return 0;
 }
+
diff -Nru a/arch/sh/boards/overdrive/mach.c b/arch/sh/boards/overdrive/mach.c
--- a/arch/sh/boards/overdrive/mach.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/boards/overdrive/mach.c	Tue Feb  3 19:45:17 2004
@@ -51,18 +51,6 @@
 	.mv_outsw		= od_outsw,
 	.mv_outsl		= od_outsl,
 
-	.mv_readb		= generic_readb,
-	.mv_readw		= generic_readw,
-	.mv_readl		= generic_readl,
-	.mv_writeb		= generic_writeb,
-	.mv_writew		= generic_writew,
-	.mv_writel		= generic_writel,
-
-	.mv_ioremap		= generic_ioremap,
-	.mv_iounmap		= generic_iounmap,
-
-	.mv_isa_port2addr	= generic_isa_port2addr,
-
 #ifdef CONFIG_PCI
 	.mv_init_irq		= init_overdrive_irq,
 #endif
diff -Nru a/arch/sh/boards/saturn/Makefile b/arch/sh/boards/saturn/Makefile
--- a/arch/sh/boards/saturn/Makefile	Tue Feb  3 19:45:18 2004
+++ b/arch/sh/boards/saturn/Makefile	Tue Feb  3 19:45:18 2004
@@ -6,7 +6,7 @@
 # unless it's something special (ie not a .c file).
 #
 
-obj-y	 := mach.o setup.o io.o irq.o
+obj-y	 := setup.o io.o irq.o
 
 obj-$(CONFIG_SMP) += smp.o
 
diff -Nru a/arch/sh/boards/saturn/irq.c b/arch/sh/boards/saturn/irq.c
--- a/arch/sh/boards/saturn/irq.c	Tue Feb  3 19:45:30 2004
+++ b/arch/sh/boards/saturn/irq.c	Tue Feb  3 19:45:30 2004
@@ -7,8 +7,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <asm/saturn/saturn.h>
-#include <asm/saturn/irq.h>
+#include <linux/interrupt.h>
 #include <asm/irq.h>
 #include <asm/io.h>
 
@@ -65,7 +64,7 @@
 
 	mask = ctrl_inl(SATURN_IMR);
 	mask &= ~saturn_irq_mask(irq_nr);
-	ctrl_outl(SATURN_IMR);
+	ctrl_outl(mask, SATURN_IMR);
 }
 
 static void disable_saturn_irq(unsigned int irq_nr)
@@ -85,7 +84,7 @@
 
 static void end_saturn_irq(unsigned int irq_nr)
 {
-	if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
+	if (!(irq_desc[irq_nr].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
 		unmask_saturn_irq(irq_nr);
 }
 
diff -Nru a/arch/sh/boards/saturn/mach.c b/arch/sh/boards/saturn/mach.c
--- a/arch/sh/boards/saturn/mach.c	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,59 +0,0 @@
-/*
- * arch/sh/boards/saturn/mach.c
- *
- * machvec definitions for the Sega Saturn.
- *
- * Copyright (C) 2002 Paul Mundt
- * 
- * Released under the terms of the GNU GPL v2.0.
- */
-#include <asm/io.h>
-#include <asm/io_generic.h>
-#include <asm/machvec.h>
-#include <asm/machvec_init.h>
-#include <asm/rtc.h>
-#include <asm/saturn/io.h>
-
-/*
- * The Machine Vector
- */
-struct sh_machine_vector mv_saturn __initmv = {
-        .mv_nr_irqs             = 80,	/* Fix this later */
-
-        .mv_inb                 = generic_inb,
-        .mv_inw                 = generic_inw,
-        .mv_inl                 = generic_inl,
-        .mv_outb                = generic_outb,
-        .mv_outw                = generic_outw,
-        .mv_outl                = generic_outl,
-
-        .mv_inb_p               = generic_inb_p,
-        .mv_inw_p               = generic_inw_p,
-        .mv_inl_p               = generic_inl_p,
-        .mv_outb_p              = generic_outb_p,
-        .mv_outw_p              = generic_outw_p,
-        .mv_outl_p              = generic_outl_p,
-
-        .mv_insb                = generic_insb,
-        .mv_insw                = generic_insw,
-        .mv_insl                = generic_insl,
-        .mv_outsb               = generic_outsb,
-        .mv_outsw               = generic_outsw,
-        .mv_outsl               = generic_outsl,
-
-        .mv_readb               = generic_readb,
-        .mv_readw               = generic_readw,
-        .mv_readl               = generic_readl,
-        .mv_writeb              = generic_writeb,
-        .mv_writew              = generic_writew,
-        .mv_writel              = generic_writel,
-
-        .mv_isa_port2addr       = saturn_isa_port2addr,
-	.mv_irq_demux		= saturn_irq_demux,
-
-        .mv_ioremap             = saturn_ioremap,
-        .mv_iounmap             = saturn_iounmap,
-};
-
-ALIAS_MV(saturn)
-
diff -Nru a/arch/sh/boards/saturn/setup.c b/arch/sh/boards/saturn/setup.c
--- a/arch/sh/boards/saturn/setup.c	Tue Feb  3 19:45:42 2004
+++ b/arch/sh/boards/saturn/setup.c	Tue Feb  3 19:45:42 2004
@@ -10,10 +10,31 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 
+#include <asm/io.h>
+#include <asm/machvec.h>
+#include <asm/mach/io.h>
+
+extern int saturn_irq_demux(int irq_nr);
+
 const char *get_system_type(void)
 {
 	return "Sega Saturn";
 }
+
+/*
+ * The Machine Vector
+ */
+struct sh_machine_vector mv_saturn __initmv = {
+	.mv_nr_irqs		= 80,	/* Fix this later */
+
+	.mv_isa_port2addr	= saturn_isa_port2addr,
+	.mv_irq_demux		= saturn_irq_demux,
+
+	.mv_ioremap		= saturn_ioremap,
+	.mv_iounmap		= saturn_iounmap,
+};
+
+ALIAS_MV(saturn)
 
 int __init platform_setup(void)
 {
diff -Nru a/arch/sh/boards/saturn/smp.c b/arch/sh/boards/saturn/smp.c
--- a/arch/sh/boards/saturn/smp.c	Tue Feb  3 19:45:41 2004
+++ b/arch/sh/boards/saturn/smp.c	Tue Feb  3 19:45:41 2004
@@ -34,7 +34,7 @@
  * addition to which, we treat them as write-only, since
  * reading from them will return undefined data.
  */
-static inline void smpc_slave_off(unsigned int cpu)
+static inline void smpc_slave_stop(unsigned int cpu)
 {
 	smpc_barrier();
 	ctrl_outb(1, SMPC_STATUS);
@@ -43,7 +43,7 @@
 	smpc_barrier();
 }
 
-static inline void smpc_slave_on(unsigned int cpu)
+static inline void smpc_slave_start(unsigned int cpu)
 {
 	ctrl_outb(1, SMPC_STATUS);
 	ctrl_outb(SMPC_CMD_SSHON, SMPC_COMMAND);
diff -Nru a/arch/sh/boards/se/770x/io.c b/arch/sh/boards/se/770x/io.c
--- a/arch/sh/boards/se/770x/io.c	Tue Feb  3 19:45:16 2004
+++ b/arch/sh/boards/se/770x/io.c	Tue Feb  3 19:45:16 2004
@@ -1,4 +1,4 @@
-/* $Id: io.c,v 1.1.2.2 2002/01/20 05:03:25 mrbrown Exp $
+/* $Id: io.c,v 1.4 2003/08/03 03:05:10 lethal Exp $
  *
  * linux/arch/sh/kernel/io_se.c
  *
@@ -189,36 +189,6 @@
 	maybebadio(outsw, port);
 }
 
-unsigned char se_readb(unsigned long addr)
-{
-	return *(volatile unsigned char*)addr;
-}
-
-unsigned short se_readw(unsigned long addr)
-{
-	return *(volatile unsigned short*)addr;
-}
-
-unsigned int se_readl(unsigned long addr)
-{
-	return *(volatile unsigned long*)addr;
-}
-
-void se_writeb(unsigned char b, unsigned long addr)
-{
-	*(volatile unsigned char*)addr = b;
-}
-
-void se_writew(unsigned short b, unsigned long addr)
-{
-	*(volatile unsigned short*)addr = b;
-}
-
-void se_writel(unsigned int b, unsigned long addr)
-{
-        *(volatile unsigned long*)addr = b;
-}
-
 /* Map ISA bus address to the real address. Only for PCMCIA.  */
 
 /* ISA page descriptor.  */
diff -Nru a/arch/sh/boards/se/770x/mach.c b/arch/sh/boards/se/770x/mach.c
--- a/arch/sh/boards/se/770x/mach.c	Tue Feb  3 19:45:41 2004
+++ b/arch/sh/boards/se/770x/mach.c	Tue Feb  3 19:45:41 2004
@@ -56,16 +56,6 @@
 	.mv_outsw		= se_outsw,
 	.mv_outsl		= se_outsl,
 
-	.mv_readb		= se_readb,
-	.mv_readw		= se_readw,
-	.mv_readl		= se_readl,
-	.mv_writeb		= se_writeb,
-	.mv_writew		= se_writew,
-	.mv_writel		= se_writel,
-
-	.mv_ioremap		= generic_ioremap,
-	.mv_iounmap		= generic_iounmap,
-
 	.mv_isa_port2addr	= se_isa_port2addr,
 
 	.mv_init_irq		= init_se_IRQ,
diff -Nru a/arch/sh/boards/se/7751/io.c b/arch/sh/boards/se/7751/io.c
--- a/arch/sh/boards/se/7751/io.c	Tue Feb  3 19:45:16 2004
+++ b/arch/sh/boards/se/7751/io.c	Tue Feb  3 19:45:16 2004
@@ -201,75 +201,15 @@
 		maybebadio(outl, port);
 }
 
-void sh7751se_insb(unsigned long port, void *addr, unsigned long count)
-{
-	unsigned char *p = addr;
-	while (count--) *p++ = sh7751se_inb(port);
-}
-
-void sh7751se_insw(unsigned long port, void *addr, unsigned long count)
-{
-	unsigned short *p = addr;
-	while (count--) *p++ = sh7751se_inw(port);
-}
-
 void sh7751se_insl(unsigned long port, void *addr, unsigned long count)
 {
 	maybebadio(insl, port);
 }
 
-void sh7751se_outsb(unsigned long port, const void *addr, unsigned long count)
-{
-	unsigned char *p = (unsigned char*)addr;
-	while (count--) sh7751se_outb(*p++, port);
-}
-
-void sh7751se_outsw(unsigned long port, const void *addr, unsigned long count)
-{
-	unsigned short *p = (unsigned short*)addr;
-	while (count--) sh7751se_outw(*p++, port);
-}
-
 void sh7751se_outsl(unsigned long port, const void *addr, unsigned long count)
 {
 	maybebadio(outsw, port);
 }
-
-/* For read/write calls, just copy generic (pass-thru); PCIMBR is  */
-/* already set up.  For a larger memory space, these would need to */
-/* reset PCIMBR as needed on a per-call basis...                   */
-
-unsigned char sh7751se_readb(unsigned long addr)
-{
-	return *(volatile unsigned char*)addr;
-}
-
-unsigned short sh7751se_readw(unsigned long addr)
-{
-	return *(volatile unsigned short*)addr;
-}
-
-unsigned int sh7751se_readl(unsigned long addr)
-{
-	return *(volatile unsigned long*)addr;
-}
-
-void sh7751se_writeb(unsigned char b, unsigned long addr)
-{
-	*(volatile unsigned char*)addr = b;
-}
-
-void sh7751se_writew(unsigned short b, unsigned long addr)
-{
-	*(volatile unsigned short*)addr = b;
-}
-
-void sh7751se_writel(unsigned int b, unsigned long addr)
-{
-        *(volatile unsigned long*)addr = b;
-}
-
-
 
 /* Map ISA bus address to the real address. Only for PCMCIA.  */
 
diff -Nru a/arch/sh/boards/se/7751/mach.c b/arch/sh/boards/se/7751/mach.c
--- a/arch/sh/boards/se/7751/mach.c	Tue Feb  3 19:45:28 2004
+++ b/arch/sh/boards/se/7751/mach.c	Tue Feb  3 19:45:28 2004
@@ -42,22 +42,8 @@
 	.mv_outw_p		= sh7751se_outw,
 	.mv_outl_p		= sh7751se_outl,
 
-	.mv_insb		= sh7751se_insb,
-	.mv_insw		= sh7751se_insw,
 	.mv_insl		= sh7751se_insl,
-	.mv_outsb		= sh7751se_outsb,
-	.mv_outsw		= sh7751se_outsw,
 	.mv_outsl		= sh7751se_outsl,
-
-	.mv_readb		= sh7751se_readb,
-	.mv_readw		= sh7751se_readw,
-	.mv_readl		= sh7751se_readl,
-	.mv_writeb		= sh7751se_writeb,
-	.mv_writew		= sh7751se_writew,
-	.mv_writel		= sh7751se_writel,
-
-	.mv_ioremap		= generic_ioremap,
-	.mv_iounmap		= generic_iounmap,
 
 	.mv_isa_port2addr	= sh7751se_isa_port2addr,
 
diff -Nru a/arch/sh/boards/se/7751/pci.c b/arch/sh/boards/se/7751/pci.c
--- a/arch/sh/boards/se/7751/pci.c	Tue Feb  3 19:45:16 2004
+++ b/arch/sh/boards/se/7751/pci.c	Tue Feb  3 19:45:16 2004
@@ -95,12 +95,11 @@
 
    /*
     * Set the MBR so PCI address is one-to-one with window,
-    * meaning all calls go straight through... use ifdef to
+    * meaning all calls go straight through... use BUG_ON to
     * catch erroneous assumption.
     */
-#if PCIBIOS_MIN_MEM != SH7751_PCI_MEMORY_BASE
-#error One-to-one assumption for PCI memory mapping is wrong!?!?!?
-#endif   
+   BUG_ON(PCIBIOS_MIN_MEM != SH7751_PCI_MEMORY_BASE);
+
    PCIC_WRITE(SH7751_PCIMBR, PCIBIOS_MIN_MEM);
 
    /* Set IOBR for window containing area specified in pci.h */
@@ -125,3 +124,25 @@
                 return -1;
         }
 }
+
+static struct resource sh7751_io_resource = {
+	.name   = "SH7751 IO",
+	.start  = SH7751_PCI_IO_BASE,
+	.end    = SH7751_PCI_IO_BASE + SH7751_PCI_IO_SIZE - 1,
+	.flags  = IORESOURCE_IO
+};
+
+static struct resource sh7751_mem_resource = {
+	.name   = "SH7751 mem",
+	.start  = SH7751_PCI_MEMORY_BASE,
+	.end    = SH7751_PCI_MEMORY_BASE + SH7751_PCI_MEM_SIZE - 1,
+	.flags  = IORESOURCE_MEM
+};
+
+extern struct pci_ops sh7751_pci_ops;
+
+struct pci_channel board_pci_channels[] = {
+	{ &sh7751_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
+	{ NULL, NULL, NULL, 0, 0 },
+};
+
diff -Nru a/arch/sh/boards/sh2000/Makefile b/arch/sh/boards/sh2000/Makefile
--- a/arch/sh/boards/sh2000/Makefile	Tue Feb  3 19:45:42 2004
+++ b/arch/sh/boards/sh2000/Makefile	Tue Feb  3 19:45:42 2004
@@ -6,5 +6,5 @@
 # unless it's something special (ie not a .c file).
 #
 
-obj-y	 := mach.o setup.o io.o
+obj-y	 := setup.o
 
diff -Nru a/arch/sh/boards/sh2000/io.c b/arch/sh/boards/sh2000/io.c
--- a/arch/sh/boards/sh2000/io.c	Tue Feb  3 19:45:16 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,19 +0,0 @@
-/*
- * I/O routine for SH-2000
- */
-#include <linux/config.h>
-#include <asm/io.h>
-#include <asm/machvec.h>
-
-#define IDE_OFFSET    0xb6200000
-#define NIC_OFFSET    0xb6000000
-#define EXTBUS_OFFSET 0xba000000
-
-unsigned long sh2000_isa_port2addr(unsigned long offset)
-{
-	if((offset & ~7) == 0x1f0 || offset == 0x3f6)
-		return IDE_OFFSET + offset;
-	else if((offset & ~0x1f) == 0x300)
-		return NIC_OFFSET + offset;
-	return EXTBUS_OFFSET + offset;
-}
diff -Nru a/arch/sh/boards/sh2000/mach.c b/arch/sh/boards/sh2000/mach.c
--- a/arch/sh/boards/sh2000/mach.c	Tue Feb  3 19:45:41 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,57 +0,0 @@
-/*
- * linux/arch/sh/boards/sh2000/mach.c
- *
- * Original copyright message:
- * Copyright (C) 2001  SUGIOKA Tochinobu
- *
- * Split into mach.c from setup.c by M. R. Brown <mrbrown@0xd6.org>
- */
-
-#include <asm/io.h>
-#include <asm/io_generic.h>
-#include <asm/machvec.h>
-#include <asm/machvec_init.h>
-#include <asm/rtc.h>
-#include <asm/sh2000/sh2000.h>
-
-/*
- * The Machine Vector
- */
-
-struct sh_machine_vector mv_sh2000 __initmv = {
-        .mv_nr_irqs             = 80,
-
-        .mv_inb                 = generic_inb,
-        .mv_inw                 = generic_inw,
-        .mv_inl                 = generic_inl,
-        .mv_outb                = generic_outb,
-        .mv_outw                = generic_outw,
-        .mv_outl                = generic_outl,
-
-        .mv_inb_p               = generic_inb_p,
-        .mv_inw_p               = generic_inw_p,
-        .mv_inl_p               = generic_inl_p,
-        .mv_outb_p              = generic_outb_p,
-        .mv_outw_p              = generic_outw_p,
-        .mv_outl_p              = generic_outl_p,
-
-        .mv_insb                = generic_insb,
-        .mv_insw                = generic_insw,
-        .mv_insl                = generic_insl,
-        .mv_outsb               = generic_outsb,
-        .mv_outsw               = generic_outsw,
-        .mv_outsl               = generic_outsl,
-
-        .mv_readb               = generic_readb,
-        .mv_readw               = generic_readw,
-        .mv_readl               = generic_readl,
-        .mv_writeb              = generic_writeb,
-        .mv_writew              = generic_writew,
-        .mv_writel              = generic_writel,
-
-        .mv_isa_port2addr       = sh2000_isa_port2addr,
-
-        .mv_ioremap             = generic_ioremap,
-        .mv_iounmap             = generic_iounmap,
-};
-ALIAS_MV(sh2000)
diff -Nru a/arch/sh/boards/sh2000/setup.c b/arch/sh/boards/sh2000/setup.c
--- a/arch/sh/boards/sh2000/setup.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/boards/sh2000/setup.c	Tue Feb  3 19:45:17 2004
@@ -12,6 +12,8 @@
 #include <linux/irq.h>
 
 #include <asm/io.h>
+#include <asm/machvec.h>
+#include <asm/mach/sh2000.h>
 
 #define CF_CIS_BASE	0xb4200000
 
@@ -20,10 +22,33 @@
 #define	PORT_ICR1	0xa4000010
 #define	PORT_IRR0	0xa4000004
 
+#define IDE_OFFSET	0xb6200000
+#define NIC_OFFSET	0xb6000000
+#define EXTBUS_OFFSET	0xba000000
+
+
 const char *get_system_type(void)
 {
 	return "sh2000";
 }
+
+static unsigned long sh2000_isa_port2addr(unsigned long offset)
+{
+	if((offset & ~7) == 0x1f0 || offset == 0x3f6)
+		return IDE_OFFSET + offset;
+	else if((offset & ~0x1f) == 0x300)
+		return NIC_OFFSET + offset;
+	return EXTBUS_OFFSET + offset;
+}
+
+/*
+ * The Machine Vector
+ */
+struct sh_machine_vector mv_sh2000 __initmv = {
+        .mv_nr_irqs		= 80,
+        .mv_isa_port2addr	= sh2000_isa_port2addr,
+};
+ALIAS_MV(sh2000)
 
 /*
  * Initialize the board
diff -Nru a/arch/sh/boards/snapgear/Makefile b/arch/sh/boards/snapgear/Makefile
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/boards/snapgear/Makefile	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,10 @@
+#
+# Makefile for the SnapGear specific parts of the kernel
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+
+obj-y	 := setup.o io.o rtc.o
+
diff -Nru a/arch/sh/boards/snapgear/io.c b/arch/sh/boards/snapgear/io.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/boards/snapgear/io.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,226 @@
+/* 
+ * linux/arch/sh/kernel/io_7751se.c
+ *
+ * Copyright (C) 2002  David McCullough <davidm@snapgear.com>
+ * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
+ * Based largely on io_se.c.
+ *
+ * I/O routine for Hitachi 7751 SolutionEngine.
+ *
+ * Initial version only to support LAN access; some
+ * placeholder code from io_se.c left in with the
+ * expectation of later SuperIO and PCMCIA access.
+ */
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <asm/io.h>
+#include <asm/addrspace.h>
+
+#include <asm/pci.h>
+#include "../../drivers/pci/pci-sh7751.h"
+
+#ifdef CONFIG_SH_SECUREEDGE5410
+unsigned short secureedge5410_ioport;
+#endif
+
+/*
+ * The SnapGear uses the built-in PCI controller (PCIC)
+ * of the 7751 processor
+ */ 
+
+#define PCIIOBR		(volatile long *)PCI_REG(SH7751_PCIIOBR)
+#define PCIMBR          (volatile long *)PCI_REG(SH7751_PCIMBR)
+#define PCI_IO_AREA	SH7751_PCI_IO_BASE
+#define PCI_MEM_AREA	SH7751_PCI_CONFIG_BASE
+
+
+#define PCI_IOMAP(adr)	(PCI_IO_AREA + (adr & ~SH7751_PCIIOBR_MASK))
+
+
+#define maybebadio(name,port) \
+  printk("bad PC-like io %s for port 0x%lx at 0x%08x\n", \
+	 #name, (port), (__u32) __builtin_return_address(0))
+
+
+static inline void delay(void)
+{
+	ctrl_inw(0xa0000000);
+}
+
+
+static inline volatile __u16 *port2adr(unsigned int port)
+{
+#if 0
+	if (port >= 0x2000)
+		return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
+#endif
+	maybebadio(name,(unsigned long)port);
+	return (volatile __u16*)port;
+}
+
+
+/* In case someone configures the kernel w/o PCI support: in that */
+/* scenario, don't ever bother to check for PCI-window addresses */
+
+/* NOTE: WINDOW CHECK MAY BE A BIT OFF, HIGH PCIBIOS_MIN_IO WRAPS? */
+#if defined(CONFIG_PCI)
+#define CHECK_SH7751_PCIIO(port) \
+  ((port >= PCIBIOS_MIN_IO) && (port < (PCIBIOS_MIN_IO + SH7751_PCI_IO_SIZE)))
+#else
+#define CHECK_SH7751_PCIIO(port) (0)
+#endif
+
+/*
+ * General outline: remap really low stuff [eventually] to SuperIO,
+ * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO)
+ * is mapped through the PCI IO window.  Stuff with high bits (PXSEG)
+ * should be way beyond the window, and is used  w/o translation for
+ * compatibility.
+ */
+
+unsigned char snapgear_inb(unsigned long port)
+{
+	if (PXSEG(port))
+		return *(volatile unsigned char *)port;
+	else if (CHECK_SH7751_PCIIO(port))
+		return *(volatile unsigned char *)PCI_IOMAP(port);
+	else
+		return (*port2adr(port))&0xff; 
+}
+
+
+unsigned char snapgear_inb_p(unsigned long port)
+{
+	unsigned char v;
+
+	if (PXSEG(port))
+		v = *(volatile unsigned char *)port;
+	else if (CHECK_SH7751_PCIIO(port))
+		v = *(volatile unsigned char *)PCI_IOMAP(port);
+	else
+		v = (*port2adr(port))&0xff; 
+	delay();
+	return v;
+}
+
+
+unsigned short snapgear_inw(unsigned long port)
+{
+	if (PXSEG(port))
+		return *(volatile unsigned short *)port;
+	else if (CHECK_SH7751_PCIIO(port))
+		return *(volatile unsigned short *)PCI_IOMAP(port);
+	else if (port >= 0x2000)
+		return *port2adr(port);
+	else
+		maybebadio(inw, port);
+	return 0;
+}
+
+
+unsigned int snapgear_inl(unsigned long port)
+{
+	if (PXSEG(port))
+		return *(volatile unsigned long *)port;
+	else if (CHECK_SH7751_PCIIO(port))
+		return *(volatile unsigned int *)PCI_IOMAP(port);
+	else if (port >= 0x2000)
+		return *port2adr(port);
+	else
+		maybebadio(inl, port);
+	return 0;
+}
+
+
+void snapgear_outb(unsigned char value, unsigned long port)
+{
+
+	if (PXSEG(port))
+		*(volatile unsigned char *)port = value;
+	else if (CHECK_SH7751_PCIIO(port))
+		*((unsigned char*)PCI_IOMAP(port)) = value;
+	else
+		*(port2adr(port)) = value;
+}
+
+
+void snapgear_outb_p(unsigned char value, unsigned long port)
+{
+	if (PXSEG(port))
+		*(volatile unsigned char *)port = value;
+	else if (CHECK_SH7751_PCIIO(port))
+		*((unsigned char*)PCI_IOMAP(port)) = value;
+	else
+		*(port2adr(port)) = value;
+	delay();
+}
+
+
+void snapgear_outw(unsigned short value, unsigned long port)
+{
+	if (PXSEG(port))
+		*(volatile unsigned short *)port = value;
+	else if (CHECK_SH7751_PCIIO(port))
+		*((unsigned short *)PCI_IOMAP(port)) = value;
+	else if (port >= 0x2000)
+		*port2adr(port) = value;
+	else
+		maybebadio(outw, port);
+}
+
+
+void snapgear_outl(unsigned int value, unsigned long port)
+{
+	if (PXSEG(port))
+		*(volatile unsigned long *)port = value;
+	else if (CHECK_SH7751_PCIIO(port))
+		*((unsigned long*)PCI_IOMAP(port)) = value;
+	else
+		maybebadio(outl, port);
+}
+
+void snapgear_insl(unsigned long port, void *addr, unsigned long count)
+{
+	maybebadio(insl, port);
+}
+
+void snapgear_outsl(unsigned long port, const void *addr, unsigned long count)
+{
+	maybebadio(outsw, port);
+}
+
+/* Map ISA bus address to the real address. Only for PCMCIA.  */
+
+
+/* ISA page descriptor.  */
+static __u32 sh_isa_memmap[256];
+
+
+#if 0
+static int sh_isa_mmap(__u32 start, __u32 length, __u32 offset)
+{
+	int idx;
+
+	if (start >= 0x100000 || (start & 0xfff) || (length != 0x1000))
+		return -1;
+
+	idx = start >> 12;
+	sh_isa_memmap[idx] = 0xb8000000 + (offset &~ 0xfff);
+#if 0
+	printk("sh_isa_mmap: start %x len %x offset %x (idx %x paddr %x)\n",
+	       start, length, offset, idx, sh_isa_memmap[idx]);
+#endif
+	return 0;
+}
+#endif
+
+unsigned long snapgear_isa_port2addr(unsigned long offset)
+{
+	int idx;
+
+	idx = (offset >> 12) & 0xff;
+	offset &= 0xfff;
+	return sh_isa_memmap[idx] + offset;
+}
diff -Nru a/arch/sh/boards/snapgear/rtc.c b/arch/sh/boards/snapgear/rtc.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/boards/snapgear/rtc.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,333 @@
+/****************************************************************************/
+/*
+ * linux/arch/sh/boards/snapgear/rtc.c -- Secureedge5410 RTC code
+ *
+ *  Copyright (C) 2002  David McCullough <davidm@snapgear.com>
+ *  Copyright (C) 2003  Paul Mundt <lethal@linux-sh.org>
+ *
+ * The SecureEdge5410 can have one of 2 real time clocks, the SH
+ * built in version or the preferred external DS1302.  Here we work out
+ * each to see what we have and then run with it.
+ */
+/****************************************************************************/
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/time.h>
+#include <linux/rtc.h>
+#include <linux/mc146818rtc.h>
+
+#include <asm/io.h>
+#include <asm/rtc.h>
+#include <asm/mc146818rtc.h>
+
+/****************************************************************************/
+
+static int use_ds1302 = 0;
+
+/****************************************************************************/
+/*
+ *	we need to implement a DS1302 driver here that can operate in
+ *	conjunction with the builtin rtc driver which is already quite friendly
+ */
+/*****************************************************************************/
+
+#define	RTC_CMD_READ	0x81		/* Read command */
+#define	RTC_CMD_WRITE	0x80		/* Write command */
+
+#define	RTC_ADDR_YEAR	0x06		/* Address of year register */
+#define	RTC_ADDR_DAY	0x05		/* Address of day of week register */
+#define	RTC_ADDR_MON	0x04		/* Address of month register */
+#define	RTC_ADDR_DATE	0x03		/* Address of day of month register */
+#define	RTC_ADDR_HOUR	0x02		/* Address of hour register */
+#define	RTC_ADDR_MIN	0x01		/* Address of minute register */
+#define	RTC_ADDR_SEC	0x00		/* Address of second register */
+
+#define	RTC_RESET	0x1000
+#define	RTC_IODATA	0x0800
+#define	RTC_SCLK	0x0400
+
+#define set_dirp(x)
+#define get_dirp(x) 0
+#define set_dp(x)	SECUREEDGE_WRITE_IOPORT(x, 0x1c00)
+#define get_dp(x)	SECUREEDGE_READ_IOPORT()
+
+static void ds1302_sendbits(unsigned int val)
+{
+	int	i;
+
+	for (i = 8; (i); i--, val >>= 1) {
+		set_dp((get_dp() & ~RTC_IODATA) | ((val & 0x1) ? RTC_IODATA : 0));
+		set_dp(get_dp() | RTC_SCLK);	// clock high
+		set_dp(get_dp() & ~RTC_SCLK);	// clock low
+	}
+}
+
+static unsigned int ds1302_recvbits(void)
+{
+	unsigned int	val;
+	int		i;
+
+	for (i = 0, val = 0; (i < 8); i++) {
+		val |= (((get_dp() & RTC_IODATA) ? 1 : 0) << i);
+		set_dp(get_dp() | RTC_SCLK);	// clock high
+		set_dp(get_dp() & ~RTC_SCLK);	// clock low
+	}
+	return(val);
+}
+
+static unsigned int ds1302_readbyte(unsigned int addr)
+{
+	unsigned int	val;
+	unsigned long	flags;
+
+#if 0
+	printk("SnapGear RTC: ds1302_readbyte(addr=%x)\n", addr);
+#endif
+
+	local_irq_save(flags);
+	set_dirp(get_dirp() | RTC_RESET | RTC_IODATA | RTC_SCLK);
+	set_dp(get_dp() & ~(RTC_RESET | RTC_IODATA | RTC_SCLK));
+
+	set_dp(get_dp() | RTC_RESET);
+	ds1302_sendbits(((addr & 0x3f) << 1) | RTC_CMD_READ);
+	set_dirp(get_dirp() & ~RTC_IODATA);
+	val = ds1302_recvbits();
+	set_dp(get_dp() & ~RTC_RESET);
+	local_irq_restore(flags);
+
+	return(val);
+}
+
+static void ds1302_writebyte(unsigned int addr, unsigned int val)
+{
+	unsigned long	flags;
+
+#if 0
+	printk("SnapGear RTC: ds1302_writebyte(addr=%x)\n", addr);
+#endif
+
+	local_irq_save(flags);
+	set_dirp(get_dirp() | RTC_RESET | RTC_IODATA | RTC_SCLK);
+	set_dp(get_dp() & ~(RTC_RESET | RTC_IODATA | RTC_SCLK));
+	set_dp(get_dp() | RTC_RESET);
+	ds1302_sendbits(((addr & 0x3f) << 1) | RTC_CMD_WRITE);
+	ds1302_sendbits(val);
+	set_dp(get_dp() & ~RTC_RESET);
+	local_irq_restore(flags);
+}
+
+static void ds1302_reset(void)
+{
+	unsigned long	flags;
+	/* Hardware dependant reset/init */
+	local_irq_save(flags);
+	set_dirp(get_dirp() | RTC_RESET | RTC_IODATA | RTC_SCLK);
+	set_dp(get_dp() & ~(RTC_RESET | RTC_IODATA | RTC_SCLK));
+	local_irq_restore(flags);
+}
+
+/*****************************************************************************/
+
+static inline int bcd2int(int val)
+{
+	return((((val & 0xf0) >> 4) * 10) + (val & 0xf));
+}
+
+static inline int int2bcd(int val)
+{
+	return(((val / 10) << 4) + (val % 10));
+}
+
+/*****************************************************************************/
+/*
+ *	Write and Read some RAM in the DS1302,  if it works assume it's there
+ *	Otherwise use the SH4 internal RTC
+ */
+
+void snapgear_rtc_gettimeofday(struct timespec *);
+int snapgear_rtc_settimeofday(const time_t);
+
+void __init secureedge5410_rtc_init(void)
+{
+	unsigned char *test = "snapgear";
+	int i;
+
+	ds1302_reset();
+
+	use_ds1302 = 1;
+
+	for (i = 0; test[i]; i++)
+		ds1302_writebyte(32 + i, test[i]);
+
+	for (i = 0; test[i]; i++)
+		if (ds1302_readbyte(32 + i) != test[i]) {
+			use_ds1302 = 0;
+			break;
+		}
+
+	if (use_ds1302) {
+		rtc_get_time = snapgear_rtc_gettimeofday;
+		rtc_set_time = snapgear_rtc_settimeofday;
+	} else {
+		rtc_get_time = sh_rtc_gettimeofday;
+		rtc_set_time = sh_rtc_settimeofday;
+	}
+		
+	printk("SnapGear RTC: using %s rtc.\n", use_ds1302 ? "ds1302" : "internal");
+}
+
+/****************************************************************************/
+/*
+ *	our generic interface that chooses the correct code to use
+ */
+
+void snapgear_rtc_gettimeofday(struct timespec *ts)
+{
+	unsigned int sec, min, hr, day, mon, yr;
+
+	if (!use_ds1302) {
+		sh_rtc_gettimeofday(ts);
+		return;
+	}
+
+ 	sec = bcd2int(ds1302_readbyte(RTC_ADDR_SEC));
+ 	min = bcd2int(ds1302_readbyte(RTC_ADDR_MIN));
+ 	hr  = bcd2int(ds1302_readbyte(RTC_ADDR_HOUR));
+ 	day = bcd2int(ds1302_readbyte(RTC_ADDR_DATE));
+ 	mon = bcd2int(ds1302_readbyte(RTC_ADDR_MON));
+ 	yr  = bcd2int(ds1302_readbyte(RTC_ADDR_YEAR));
+
+bad_time:
+	if (yr > 99 || mon < 1 || mon > 12 || day > 31 || day < 1 ||
+	    hr > 23 || min > 59 || sec > 59) {
+		printk(KERN_ERR
+		       "SnapGear RTC: invalid value, resetting to 1 Jan 2000\n");
+		ds1302_writebyte(RTC_ADDR_MIN,  min = 0);
+		ds1302_writebyte(RTC_ADDR_HOUR, hr  = 0);
+		ds1302_writebyte(RTC_ADDR_DAY,        7);
+		ds1302_writebyte(RTC_ADDR_DATE, day = 1);
+		ds1302_writebyte(RTC_ADDR_MON,  mon = 1);
+		ds1302_writebyte(RTC_ADDR_YEAR, yr  = 0);
+		ds1302_writebyte(RTC_ADDR_SEC,  sec = 0);
+	}
+
+	ts->tv_sec = mktime(2000 + yr, mon, day, hr, min, sec);
+	if (ts->tv_sec < 0) {
+#if 0
+		printk("BAD TIME %d %d %d %d %d %d\n", yr, mon, day, hr, min, sec);
+#endif
+		yr = 100;
+		goto bad_time;
+	}
+	ts->tv_nsec = 0;
+}
+
+int snapgear_rtc_settimeofday(const time_t secs)
+{
+	int retval = 0;
+	int real_seconds, real_minutes, cmos_minutes;
+	unsigned long nowtime;
+
+	if (!use_ds1302)
+		return sh_rtc_settimeofday(secs);
+
+/*
+ *	This is called direct from the kernel timer handling code.
+ *	It is supposed to synchronize the kernel clock to the RTC.
+ */
+
+	nowtime = secs;
+
+#if 1
+	printk("SnapGear RTC: snapgear_rtc_settimeofday(nowtime=%ld)\n", nowtime);
+#endif
+
+	/* STOP RTC */
+	ds1302_writebyte(RTC_ADDR_SEC, ds1302_readbyte(RTC_ADDR_SEC) | 0x80);
+
+	cmos_minutes = bcd2int(ds1302_readbyte(RTC_ADDR_MIN));
+
+	/*
+	 * since we're only adjusting minutes and seconds,
+	 * don't interfere with hour overflow. This avoids
+	 * messing with unknown time zones but requires your
+	 * RTC not to be off by more than 15 minutes
+	 */
+	real_seconds = nowtime % 60;
+	real_minutes = nowtime / 60;
+	if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
+		real_minutes += 30;	/* correct for half hour time zone */
+	real_minutes %= 60;
+
+	if (abs(real_minutes - cmos_minutes) < 30) {
+		ds1302_writebyte(RTC_ADDR_MIN, int2bcd(real_minutes));
+		ds1302_writebyte(RTC_ADDR_SEC, int2bcd(real_seconds));
+	} else {
+		printk(KERN_WARNING
+		       "SnapGear RTC: can't update from %d to %d\n",
+		       cmos_minutes, real_minutes);
+		retval = -1;
+	}
+
+	/* START RTC */
+	ds1302_writebyte(RTC_ADDR_SEC, ds1302_readbyte(RTC_ADDR_SEC) & ~0x80);
+	return(0);
+}
+
+unsigned char secureedge5410_cmos_read(int addr)
+{
+	unsigned char val = 0;
+
+	if (!use_ds1302)
+		return(__CMOS_READ(addr, w));
+
+	switch(addr) {
+	case RTC_SECONDS:       val = ds1302_readbyte(RTC_ADDR_SEC);  break;
+	case RTC_SECONDS_ALARM:                                       break;
+	case RTC_MINUTES:       val = ds1302_readbyte(RTC_ADDR_MIN);  break;
+	case RTC_MINUTES_ALARM:                                       break;
+	case RTC_HOURS:         val = ds1302_readbyte(RTC_ADDR_HOUR); break;
+	case RTC_HOURS_ALARM:                                         break;
+	case RTC_DAY_OF_WEEK:   val = ds1302_readbyte(RTC_ADDR_DAY);  break;
+	case RTC_DAY_OF_MONTH:  val = ds1302_readbyte(RTC_ADDR_DATE); break;
+	case RTC_MONTH:         val = ds1302_readbyte(RTC_ADDR_MON);  break;
+	case RTC_YEAR:          val = ds1302_readbyte(RTC_ADDR_YEAR); break;
+	case RTC_REG_A:         /* RTC_FREQ_SELECT */                 break;
+	case RTC_REG_B:	        /* RTC_CONTROL */                     break;
+	case RTC_REG_C:	        /* RTC_INTR_FLAGS */                  break;
+	case RTC_REG_D:         val = RTC_VRT /* RTC_VALID */;        break;
+	default:                                                      break;
+	}
+
+	return(val);
+}
+
+void secureedge5410_cmos_write(unsigned char val, int addr)
+{
+	if (!use_ds1302) {
+		__CMOS_WRITE(val, addr, w);
+		return;
+	}
+
+	switch(addr) {
+	case RTC_SECONDS:       ds1302_writebyte(RTC_ADDR_SEC, val);  break;
+	case RTC_SECONDS_ALARM:                                       break;
+	case RTC_MINUTES:       ds1302_writebyte(RTC_ADDR_MIN, val);  break;
+	case RTC_MINUTES_ALARM:                                       break;
+	case RTC_HOURS:         ds1302_writebyte(RTC_ADDR_HOUR, val); break;
+	case RTC_HOURS_ALARM:                                         break;
+	case RTC_DAY_OF_WEEK:   ds1302_writebyte(RTC_ADDR_DAY, val);  break;
+	case RTC_DAY_OF_MONTH:  ds1302_writebyte(RTC_ADDR_DATE, val); break;
+	case RTC_MONTH:         ds1302_writebyte(RTC_ADDR_MON, val);  break;
+	case RTC_YEAR:          ds1302_writebyte(RTC_ADDR_YEAR, val); break;
+	case RTC_REG_A:         /* RTC_FREQ_SELECT */                 break;
+	case RTC_REG_B:        	/* RTC_CONTROL */                     break;
+	case RTC_REG_C:	        /* RTC_INTR_FLAGS */                  break;
+	case RTC_REG_D:	        /* RTC_VALID */                       break;
+	default:                                                      break;
+	}
+}
+
+/****************************************************************************/
diff -Nru a/arch/sh/boards/snapgear/setup.c b/arch/sh/boards/snapgear/setup.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/boards/snapgear/setup.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,220 @@
+/****************************************************************************/
+/* 
+ * linux/arch/sh/boards/snapgear/setup.c
+ *
+ * Copyright (C) 2002  David McCullough <davidm@snapgear.com>
+ * Copyright (C) 2003  Paul Mundt <lethal@linux-sh.org>
+ *
+ * Based on files with the following comments:
+ *
+ *           Copyright (C) 2000  Kazumoto Kojima
+ *
+ *           Modified for 7751 Solution Engine by
+ *           Ian da Silva and Jeremy Siegel, 2001.
+ */
+/****************************************************************************/
+
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/timer.h>
+#include <linux/delay.h>
+#include <linux/module.h>
+#include <linux/sched.h>
+
+#include <asm/machvec.h>
+#include <asm/mach/io.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+
+extern void (*board_time_init)(void);
+extern void secureedge5410_rtc_init(void);
+extern void pcibios_init(void);
+
+/****************************************************************************/
+/*
+ * EraseConfig handling functions
+ */
+
+static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	volatile char dummy __attribute__((unused)) = * (volatile char *) 0xb8000000;
+
+	printk("SnapGear: erase switch interrupt!\n");
+
+	return IRQ_HANDLED;
+}
+
+static int __init eraseconfig_init(void)
+{
+	printk("SnapGear: EraseConfig init\n");
+	/* Setup "EraseConfig" switch on external IRQ 0 */
+	if (request_irq(IRL0_IRQ, eraseconfig_interrupt, SA_INTERRUPT,
+				"Erase Config", NULL))
+		printk("SnapGear: failed to register IRQ%d for Reset witch\n",
+				IRL0_IRQ);
+	else
+		printk("SnapGear: registered EraseConfig switch on IRQ%d\n",
+				IRL0_IRQ);
+	return(0);
+}
+
+module_init(eraseconfig_init);
+
+/****************************************************************************/
+/*
+ * Initialize IRQ setting
+ *
+ * IRL0 = erase switch
+ * IRL1 = eth0
+ * IRL2 = eth1
+ * IRL3 = crypto
+ */
+
+static void __init init_snapgear_IRQ(void)
+{
+	/* enable individual interrupt mode for externals */
+	ctrl_outw(ctrl_inw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR);
+
+	printk("Setup SnapGear IRQ/IPR ...\n");
+
+	make_ipr_irq(IRL0_IRQ, IRL0_IPR_ADDR, IRL0_IPR_POS, IRL0_PRIORITY);
+	make_ipr_irq(IRL1_IRQ, IRL1_IPR_ADDR, IRL1_IPR_POS, IRL1_PRIORITY);
+	make_ipr_irq(IRL2_IRQ, IRL2_IPR_ADDR, IRL2_IPR_POS, IRL2_PRIORITY);
+	make_ipr_irq(IRL3_IRQ, IRL3_IPR_ADDR, IRL3_IPR_POS, IRL3_PRIORITY);
+}
+
+/****************************************************************************/
+/*
+ *	Fast poll interrupt simulator.
+ */
+
+/*
+ * Leave all of the fast timer/fast poll stuff commented out for now, since
+ * it's not clear whether it actually works or not. Since it wasn't being used
+ * at all in 2.4, we'll assume it's not sane for 2.6 either.. -- PFM
+ */
+#if 0
+#define FAST_POLL	1000
+//#define FAST_POLL_INTR
+
+#define FASTTIMER_IRQ   17
+#define FASTTIMER_IPR_ADDR  INTC_IPRA
+#define FASTTIMER_IPR_POS    2
+#define FASTTIMER_PRIORITY   3
+
+#ifdef FAST_POLL_INTR
+#define TMU1_TCR_INIT	0x0020
+#else
+#define TMU1_TCR_INIT	0
+#endif
+#define TMU_TSTR_INIT	1
+#define TMU1_TCR_CALIB	0x0000
+#define TMU_TOCR	0xffd80000	/* Byte access */
+#define TMU_TSTR	0xffd80004	/* Byte access */
+#define TMU1_TCOR	0xffd80014	/* Long access */
+#define TMU1_TCNT	0xffd80018	/* Long access */
+#define TMU1_TCR	0xffd8001c	/* Word access */
+
+
+#ifdef FAST_POLL_INTR
+static void fast_timer_irq(int irq, void *dev_instance, struct pt_regs *regs)
+{
+	unsigned long timer_status;
+    timer_status = ctrl_inw(TMU1_TCR);
+	timer_status &= ~0x100;
+	ctrl_outw(timer_status, TMU1_TCR);
+}
+#endif
+
+/*
+ * return the current ticks on the fast timer
+ */
+
+unsigned long fast_timer_count(void)
+{
+	return(ctrl_inl(TMU1_TCNT));
+}
+
+/*
+ * setup a fast timer for profiling etc etc
+ */
+
+static void setup_fast_timer()
+{
+	unsigned long interval;
+
+#ifdef FAST_POLL_INTR
+	interval = (current_cpu_data.module_clock/4 + FAST_POLL/2) / FAST_POLL;
+
+	make_ipr_irq(FASTTIMER_IRQ, FASTTIMER_IPR_ADDR, FASTTIMER_IPR_POS,
+			FASTTIMER_PRIORITY);
+
+	printk("SnapGear: %dHz fast timer on IRQ %d\n",FAST_POLL,FASTTIMER_IRQ);
+
+	if (request_irq(FASTTIMER_IRQ, fast_timer_irq, 0, "SnapGear fast timer",
+			NULL) != 0)
+		printk("%s(%d): request_irq() failed?\n", __FILE__, __LINE__);
+#else
+	printk("SnapGear: fast timer running\n",FAST_POLL,FASTTIMER_IRQ);
+	interval = 0xffffffff;
+#endif
+
+	ctrl_outb(ctrl_inb(TMU_TSTR) & ~0x2, TMU_TSTR); /* disable timer 1 */
+	ctrl_outw(TMU1_TCR_INIT, TMU1_TCR);
+	ctrl_outl(interval, TMU1_TCOR);
+	ctrl_outl(interval, TMU1_TCNT);
+	ctrl_outb(ctrl_inb(TMU_TSTR) | 0x2, TMU_TSTR); /* enable timer 1 */
+
+	printk("Timer count 1 = 0x%x\n", fast_timer_count());
+	udelay(1000);
+	printk("Timer count 2 = 0x%x\n", fast_timer_count());
+}
+#endif
+
+/****************************************************************************/
+
+const char *get_system_type(void)
+{
+	return "SnapGear SecureEdge5410";
+}
+
+/*
+ * The Machine Vector
+ */
+
+struct sh_machine_vector mv_snapgear __initmv = {
+	.mv_nr_irqs		= 72,
+
+	.mv_inb			= snapgear_inb,
+	.mv_inw			= snapgear_inw,
+	.mv_inl			= snapgear_inl,
+	.mv_outb		= snapgear_outb,
+	.mv_outw		= snapgear_outw,
+	.mv_outl		= snapgear_outl,
+
+	.mv_inb_p		= snapgear_inb_p,
+	.mv_inw_p		= snapgear_inw,
+	.mv_inl_p		= snapgear_inl,
+	.mv_outb_p		= snapgear_outb_p,
+	.mv_outw_p		= snapgear_outw,
+	.mv_outl_p		= snapgear_outl,
+
+	.mv_isa_port2addr	= snapgear_isa_port2addr,
+
+	.mv_init_irq		= init_snapgear_IRQ,
+};
+ALIAS_MV(snapgear)
+
+/*
+ * Initialize the board
+ */
+
+int __init platform_setup(void)
+{
+	board_time_init = secureedge5410_rtc_init;
+
+	return 0;
+}
+
diff -Nru a/arch/sh/boards/systemh/Makefile b/arch/sh/boards/systemh/Makefile
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/boards/systemh/Makefile	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,17 @@
+#
+# Makefile for the SystemH specific parts of the kernel
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+
+obj-y	 := setup.o irq.o io.o
+
+# XXX: This wants to be consolidated in arch/sh/drivers/pci, and more
+# importantly, with the generic sh7751_pcic_init() code. For now, we'll
+# just abuse the hell out of kbuild, because we can..
+
+obj-$(CONFIG_PCI) += pci.o
+pci-y := ../se/7751/pci.o
+
diff -Nru a/arch/sh/boards/systemh/io.c b/arch/sh/boards/systemh/io.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/boards/systemh/io.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,283 @@
+/* 
+ * linux/arch/sh/boards/systemh/io.c
+ *
+ * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
+ * Based largely on io_se.c.
+ *
+ * I/O routine for Hitachi 7751 Systemh.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <asm/systemh/7751systemh.h>
+#include <asm/addrspace.h>
+#include <asm/io.h>
+
+#include <linux/pci.h>
+#include "../../drivers/pci/pci-sh7751.h"
+
+/*
+ * The 7751 SystemH Engine uses the built-in PCI controller (PCIC)
+ * of the 7751 processor, and has a SuperIO accessible on its memory 
+ * bus.
+ */ 
+
+#define PCIIOBR		(volatile long *)PCI_REG(SH7751_PCIIOBR)
+#define PCIMBR          (volatile long *)PCI_REG(SH7751_PCIMBR)
+#define PCI_IO_AREA	SH7751_PCI_IO_BASE
+#define PCI_MEM_AREA	SH7751_PCI_CONFIG_BASE
+
+#define PCI_IOMAP(adr)	(PCI_IO_AREA + (adr & ~SH7751_PCIIOBR_MASK))
+#define ETHER_IOMAP(adr) (0xB3000000 + (adr)) /*map to 16bits access area
+                                                of smc lan chip*/ 
+
+#define maybebadio(name,port) \
+  printk("bad PC-like io %s for port 0x%lx at 0x%08x\n", \
+	 #name, (port), (__u32) __builtin_return_address(0))
+
+static inline void delay(void)
+{
+	ctrl_inw(0xa0000000);
+}
+
+static inline volatile __u16 *
+port2adr(unsigned int port)
+{
+	if (port >= 0x2000)
+		return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
+#if 0
+	else
+		return (volatile __u16 *) (PA_SUPERIO + (port << 1));
+#endif
+	maybebadio(name,(unsigned long)port);
+	return (volatile __u16*)port;
+}
+
+/* In case someone configures the kernel w/o PCI support: in that */
+/* scenario, don't ever bother to check for PCI-window addresses */
+
+/* NOTE: WINDOW CHECK MAY BE A BIT OFF, HIGH PCIBIOS_MIN_IO WRAPS? */
+#if defined(CONFIG_PCI)
+#define CHECK_SH7751_PCIIO(port) \
+  ((port >= PCIBIOS_MIN_IO) && (port < (PCIBIOS_MIN_IO + SH7751_PCI_IO_SIZE)))
+#else
+#define CHECK_SH7751_PCIIO(port) (0)
+#endif
+
+/*
+ * General outline: remap really low stuff [eventually] to SuperIO,
+ * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO)
+ * is mapped through the PCI IO window.  Stuff with high bits (PXSEG)
+ * should be way beyond the window, and is used  w/o translation for
+ * compatibility.
+ */
+unsigned char sh7751systemh_inb(unsigned long port)
+{
+	if (PXSEG(port))
+		return *(volatile unsigned char *)port;
+	else if (CHECK_SH7751_PCIIO(port))
+		return *(volatile unsigned char *)PCI_IOMAP(port);
+	else if (port <= 0x3F1)
+		return *(volatile unsigned char *)ETHER_IOMAP(port);
+	else
+		return (*port2adr(port))&0xff; 
+}
+
+unsigned char sh7751systemh_inb_p(unsigned long port)
+{
+	unsigned char v;
+
+        if (PXSEG(port))
+                v = *(volatile unsigned char *)port;
+	else if (CHECK_SH7751_PCIIO(port))
+                v = *(volatile unsigned char *)PCI_IOMAP(port);
+	else if (port <= 0x3F1)
+		v = *(volatile unsigned char *)ETHER_IOMAP(port);
+	else
+		v = (*port2adr(port))&0xff; 
+	delay();
+	return v;
+}
+
+unsigned short sh7751systemh_inw(unsigned long port)
+{
+        if (PXSEG(port))
+                return *(volatile unsigned short *)port;
+	else if (CHECK_SH7751_PCIIO(port))
+                return *(volatile unsigned short *)PCI_IOMAP(port);
+	else if (port >= 0x2000)
+		return *port2adr(port);
+	else if (port <= 0x3F1)
+		return *(volatile unsigned int *)ETHER_IOMAP(port);
+	else
+		maybebadio(inw, port);
+	return 0;
+}
+
+unsigned int sh7751systemh_inl(unsigned long port)
+{
+        if (PXSEG(port))
+                return *(volatile unsigned long *)port;
+	else if (CHECK_SH7751_PCIIO(port))
+                return *(volatile unsigned int *)PCI_IOMAP(port);
+	else if (port >= 0x2000)
+		return *port2adr(port);
+	else if (port <= 0x3F1)
+		return *(volatile unsigned int *)ETHER_IOMAP(port);
+	else
+		maybebadio(inl, port);
+	return 0;
+}
+
+void sh7751systemh_outb(unsigned char value, unsigned long port)
+{
+
+        if (PXSEG(port))
+                *(volatile unsigned char *)port = value;
+	else if (CHECK_SH7751_PCIIO(port))
+        	*((unsigned char*)PCI_IOMAP(port)) = value;
+	else if (port <= 0x3F1)
+		*(volatile unsigned char *)ETHER_IOMAP(port) = value;
+	else
+		*(port2adr(port)) = value;
+}
+
+void sh7751systemh_outb_p(unsigned char value, unsigned long port)
+{
+        if (PXSEG(port))
+                *(volatile unsigned char *)port = value;
+	else if (CHECK_SH7751_PCIIO(port))
+        	*((unsigned char*)PCI_IOMAP(port)) = value;
+	else if (port <= 0x3F1)
+		*(volatile unsigned char *)ETHER_IOMAP(port) = value;
+	else
+		*(port2adr(port)) = value;
+	delay();
+}
+
+void sh7751systemh_outw(unsigned short value, unsigned long port)
+{
+        if (PXSEG(port))
+                *(volatile unsigned short *)port = value;
+	else if (CHECK_SH7751_PCIIO(port))
+        	*((unsigned short *)PCI_IOMAP(port)) = value;
+	else if (port >= 0x2000)
+		*port2adr(port) = value;
+	else if (port <= 0x3F1)
+		*(volatile unsigned short *)ETHER_IOMAP(port) = value;
+	else
+		maybebadio(outw, port);
+}
+
+void sh7751systemh_outl(unsigned int value, unsigned long port)
+{
+        if (PXSEG(port))
+                *(volatile unsigned long *)port = value;
+	else if (CHECK_SH7751_PCIIO(port))
+        	*((unsigned long*)PCI_IOMAP(port)) = value;
+	else
+		maybebadio(outl, port);
+}
+
+void sh7751systemh_insb(unsigned long port, void *addr, unsigned long count)
+{
+	unsigned char *p = addr;
+	while (count--) *p++ = sh7751systemh_inb(port);
+}
+
+void sh7751systemh_insw(unsigned long port, void *addr, unsigned long count)
+{
+	unsigned short *p = addr;
+	while (count--) *p++ = sh7751systemh_inw(port);
+}
+
+void sh7751systemh_insl(unsigned long port, void *addr, unsigned long count)
+{
+	maybebadio(insl, port);
+}
+
+void sh7751systemh_outsb(unsigned long port, const void *addr, unsigned long count)
+{
+	unsigned char *p = (unsigned char*)addr;
+	while (count--) sh7751systemh_outb(*p++, port);
+}
+
+void sh7751systemh_outsw(unsigned long port, const void *addr, unsigned long count)
+{
+	unsigned short *p = (unsigned short*)addr;
+	while (count--) sh7751systemh_outw(*p++, port);
+}
+
+void sh7751systemh_outsl(unsigned long port, const void *addr, unsigned long count)
+{
+	maybebadio(outsw, port);
+}
+
+/* For read/write calls, just copy generic (pass-thru); PCIMBR is  */
+/* already set up.  For a larger memory space, these would need to */
+/* reset PCIMBR as needed on a per-call basis...                   */
+
+unsigned char sh7751systemh_readb(unsigned long addr)
+{
+	return *(volatile unsigned char*)addr;
+}
+
+unsigned short sh7751systemh_readw(unsigned long addr)
+{
+	return *(volatile unsigned short*)addr;
+}
+
+unsigned int sh7751systemh_readl(unsigned long addr)
+{
+	return *(volatile unsigned long*)addr;
+}
+
+void sh7751systemh_writeb(unsigned char b, unsigned long addr)
+{
+	*(volatile unsigned char*)addr = b;
+}
+
+void sh7751systemh_writew(unsigned short b, unsigned long addr)
+{
+	*(volatile unsigned short*)addr = b;
+}
+
+void sh7751systemh_writel(unsigned int b, unsigned long addr)
+{
+        *(volatile unsigned long*)addr = b;
+}
+
+
+
+/* Map ISA bus address to the real address. Only for PCMCIA.  */
+
+/* ISA page descriptor.  */
+static __u32 sh_isa_memmap[256];
+
+#if 0
+static int
+sh_isa_mmap(__u32 start, __u32 length, __u32 offset)
+{
+	int idx;
+
+	if (start >= 0x100000 || (start & 0xfff) || (length != 0x1000))
+		return -1;
+
+	idx = start >> 12;
+	sh_isa_memmap[idx] = 0xb8000000 + (offset &~ 0xfff);
+	printk("sh_isa_mmap: start %x len %x offset %x (idx %x paddr %x)\n",
+	       start, length, offset, idx, sh_isa_memmap[idx]);
+	return 0;
+}
+#endif
+
+unsigned long
+sh7751systemh_isa_port2addr(unsigned long offset)
+{
+	int idx;
+
+	idx = (offset >> 12) & 0xff;
+	offset &= 0xfff;
+	return sh_isa_memmap[idx] + offset;
+}
diff -Nru a/arch/sh/boards/systemh/irq.c b/arch/sh/boards/systemh/irq.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/boards/systemh/irq.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,111 @@
+/* 
+ * linux/arch/sh/boards/systemh/irq.c
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * Hitachi SystemH Support.
+ *
+ * Modified for 7751 SystemH by
+ * Jonathan Short.
+ */
+
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <linux/hdreg.h>
+#include <linux/ide.h>
+#include <asm/io.h>
+#include <asm/mach/7751systemh.h>
+#include <asm/smc37c93x.h>
+
+/* address of external interrupt mask register
+ * address must be set prior to use these (maybe in init_XXX_irq())
+ * XXX : is it better to use .config than specifying it in code? */
+static unsigned long *systemh_irq_mask_register = (unsigned long *)0xB3F10004;
+static unsigned long *systemh_irq_request_register = (unsigned long *)0xB3F10000;
+
+/* forward declaration */
+static unsigned int startup_systemh_irq(unsigned int irq);
+static void shutdown_systemh_irq(unsigned int irq);
+static void enable_systemh_irq(unsigned int irq);
+static void disable_systemh_irq(unsigned int irq);
+static void mask_and_ack_systemh(unsigned int);
+static void end_systemh_irq(unsigned int irq);
+
+/* hw_interrupt_type */
+static struct hw_interrupt_type systemh_irq_type = {
+	" SystemH Register",
+	startup_systemh_irq,
+	shutdown_systemh_irq,
+	enable_systemh_irq,
+	disable_systemh_irq,
+	mask_and_ack_systemh,
+	end_systemh_irq
+};
+
+static unsigned int startup_systemh_irq(unsigned int irq)
+{ 
+	enable_systemh_irq(irq);
+	return 0; /* never anything pending */
+}
+
+static void shutdown_systemh_irq(unsigned int irq)
+{
+	disable_systemh_irq(irq);
+}
+
+static void disable_systemh_irq(unsigned int irq)
+{
+	if (systemh_irq_mask_register) {
+		unsigned long flags;
+		unsigned long val, mask = 0x01 << 1;
+
+		/* Clear the "irq"th bit in the mask and set it in the request */
+		local_irq_save(flags);
+
+		val = ctrl_inl((unsigned long)systemh_irq_mask_register);
+		val &= ~mask;
+		ctrl_outl(val, (unsigned long)systemh_irq_mask_register);
+
+		val = ctrl_inl((unsigned long)systemh_irq_request_register);
+		val |= mask;
+		ctrl_outl(val, (unsigned long)systemh_irq_request_register);
+
+		local_irq_restore(flags);
+	}
+}
+
+static void enable_systemh_irq(unsigned int irq)
+{
+	if (systemh_irq_mask_register) {
+		unsigned long flags;
+		unsigned long val, mask = 0x01 << 1;
+
+		/* Set "irq"th bit in the mask register */
+		local_irq_save(flags);
+		val = ctrl_inl((unsigned long)systemh_irq_mask_register);
+		val |= mask;
+		ctrl_outl(val, (unsigned long)systemh_irq_mask_register);
+		local_irq_restore(flags);
+	}
+}
+
+static void mask_and_ack_systemh(unsigned int irq)
+{
+	disable_systemh_irq(irq);
+}
+
+static void end_systemh_irq(unsigned int irq)
+{
+	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+		enable_systemh_irq(irq);
+}
+
+void make_systemh_irq(unsigned int irq)
+{
+	disable_irq_nosync(irq);
+	irq_desc[irq].handler = &systemh_irq_type;
+	disable_systemh_irq(irq);
+}
+
diff -Nru a/arch/sh/boards/systemh/setup.c b/arch/sh/boards/systemh/setup.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/boards/systemh/setup.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,80 @@
+/* 
+ * linux/arch/sh/boards/systemh/setup.c
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * Hitachi SystemH Support.
+ *
+ * Modified for 7751 SystemH by Jonathan Short.
+ *
+ * Rewritten for 2.6 by Paul Mundt.
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <asm/mach/7751systemh.h>
+#include <asm/mach/io.h>
+#include <asm/machvec.h>
+
+extern void make_systemh_irq(unsigned int irq);
+
+const char *get_system_type(void)
+{
+	return "7751 SystemH";
+}
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_7751systemh_IRQ(void)
+{
+/*  	make_ipr_irq(10, BCR_ILCRD, 1, 0x0f-10); LAN */
+/*  	make_ipr_irq(14, BCR_ILCRA, 2, 0x0f-4); */
+	make_systemh_irq(0xb);	/* Ethernet interrupt */
+}
+
+struct sh_machine_vector mv_7751systemh __initmv = {
+	.mv_nr_irqs		= 72,
+
+	.mv_inb			= sh7751systemh_inb,
+	.mv_inw			= sh7751systemh_inw,
+	.mv_inl			= sh7751systemh_inl,
+	.mv_outb		= sh7751systemh_outb,
+	.mv_outw		= sh7751systemh_outw,
+	.mv_outl		= sh7751systemh_outl,
+
+	.mv_inb_p		= sh7751systemh_inb_p,
+	.mv_inw_p		= sh7751systemh_inw,
+	.mv_inl_p		= sh7751systemh_inl,
+	.mv_outb_p		= sh7751systemh_outb_p,
+	.mv_outw_p		= sh7751systemh_outw,
+	.mv_outl_p		= sh7751systemh_outl,
+
+	.mv_insb		= sh7751systemh_insb,
+	.mv_insw		= sh7751systemh_insw,
+	.mv_insl		= sh7751systemh_insl,
+	.mv_outsb		= sh7751systemh_outsb,
+	.mv_outsw		= sh7751systemh_outsw,
+	.mv_outsl		= sh7751systemh_outsl,
+
+	.mv_readb		= sh7751systemh_readb,
+	.mv_readw		= sh7751systemh_readw,
+	.mv_readl		= sh7751systemh_readl,
+	.mv_writeb		= sh7751systemh_writeb,
+	.mv_writew		= sh7751systemh_writew,
+	.mv_writel		= sh7751systemh_writel,
+
+	.mv_isa_port2addr	= sh7751systemh_isa_port2addr,
+
+	.mv_init_irq		= init_7751systemh_IRQ,
+};
+ALIAS_MV(7751systemh)
+
+int __init platform_setup(void)
+{
+	return 0;
+}
+
diff -Nru a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile
--- a/arch/sh/boot/compressed/Makefile	Tue Feb  3 19:45:28 2004
+++ b/arch/sh/boot/compressed/Makefile	Tue Feb  3 19:45:28 2004
@@ -16,9 +16,9 @@
 #
 # IMAGE_OFFSET is the load offset of the compression loader
 #
-IMAGE_OFFSET = $(shell printf "0x%8x" $$[0x80000000+0x$(CONFIG_MEMORY_START)+0x200000+0x10000])
+IMAGE_OFFSET := $(shell printf "0x%8x" $$[0x80000000+$(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET)])
 
-LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../vmlinux.lds.s
+LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds.s
 
 $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE
 	$(call if_changed,ld)
diff -Nru a/arch/sh/boot/compressed/head.S b/arch/sh/boot/compressed/head.S
--- a/arch/sh/boot/compressed/head.S	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/boot/compressed/head.S	Tue Feb  3 19:45:17 2004
@@ -2,10 +2,12 @@
  *  linux/arch/sh/boot/compressed/head.S
  *
  *  Copyright (C) 1999 Stuart Menefy
+ *  Copyright (C) 2003 SUGIOKA Toshinobu
  */
 
 .text
 
+#include <linux/config.h>
 #include <linux/linkage.h>
 
 	.global	startup
@@ -14,7 +16,54 @@
 	mov.l   init_sr, r1
 	ldc     r1, sr
 
-	/* First clear BSS */
+	/* Move myself to proper location if necessary */
+	mova	1f, r0
+	mov.l	1f, r2
+	cmp/eq	r2, r0
+	bt	clear_bss
+	sub	r0, r2
+	mov.l	bss_start_addr, r0
+	mov	#0xe0, r1
+	and	r1, r0			! align cache line
+	mov.l	text_start_addr, r3
+	mov	r0, r1
+	sub	r2, r1
+3:
+	mov.l	@r1, r4
+	mov.l	@(4,r1), r5
+	mov.l	@(8,r1), r6
+	mov.l	@(12,r1), r7
+	mov.l	@(16,r1), r8
+	mov.l	@(20,r1), r9
+	mov.l	@(24,r1), r10
+	mov.l	@(28,r1), r11
+	mov.l	r4, @r0
+	mov.l	r5, @(4,r0)
+	mov.l	r6, @(8,r0)
+	mov.l	r7, @(12,r0)
+	mov.l	r8, @(16,r0)
+	mov.l	r9, @(20,r0)
+	mov.l	r10, @(24,r0)
+	mov.l	r11, @(28,r0)
+#ifdef CONFIG_CPU_SH4
+	ocbwb	@r0
+#endif
+	cmp/hi	r3, r0
+	add	#-32, r0
+	bt/s	3b
+	 add	#-32, r1
+	mov.l	2f, r0
+	jmp	@r0
+	 nop
+
+	.align 2
+1:	.long	1b
+2:	.long	clear_bss
+text_start_addr:
+	.long	startup
+
+	/* Clear BSS */
+clear_bss:
 	mov.l	end_addr, r1
 	mov.l	bss_start_addr, r2
 	mov	#0, r0
diff -Nru a/arch/sh/boot/compressed/vmlinux.scr b/arch/sh/boot/compressed/vmlinux.scr
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/boot/compressed/vmlinux.scr	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,9 @@
+SECTIONS
+{
+  .data : { 
+	input_len = .;
+	LONG(input_data_end - input_data) input_data = .; 
+	*(.data) 
+	input_data_end = .; 
+	}
+}
diff -Nru a/arch/sh/cchips/Kconfig b/arch/sh/cchips/Kconfig
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/cchips/Kconfig	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,76 @@
+# A board must have defined HD6446X_SERIES in order to see these
+choice
+	prompt "HD6446x options"
+	depends HD6446X_SERIES
+	default HD64461
+
+config HD64461
+	bool "Hitachi HD64461 companion chip support"
+	depends on CPU_SUBTYPE_SH7709
+	---help---
+	  The Hitachi HD64461 provides an interface for
+	  the SH7709 CPU, supporting a LCD controller,
+	  CRT color controller, IrDA up to 4 Mbps, and a
+	  PCMCIA controller supporting 2 slots.
+
+	  More information is available at
+	  <http://semiconductor.hitachi.com/windowsce/superh/sld013.htm>.
+
+	  Say Y if you want support for the HD64461.
+	  Otherwise, say N.
+
+config HD64465
+	bool "Hitachi HD64465 companion chip support"
+	depends on CPU_SUBTYPE_SH7750
+	---help---
+	  The Hitachi HD64465 provides an interface for
+	  the SH7750 CPU, supporting a LCD controller,
+	  CRT color controller, IrDA, USB, PCMCIA,
+	  keyboard controller, and a printer interface.
+
+	  More information is available at
+	  <http://global.hitachi.com/New/cnews/E/1998/981019B.html>.
+
+	  Say Y if you want support for the HD64465.
+	  Otherwise, say N.
+
+endchoice
+
+# These will also be split into the Kconfig's below
+config HD64461_IRQ
+	int "HD64461 IRQ"
+	depends on HD64461
+	default "36"
+	help
+	  The default setting of the HD64461 IRQ is 36.
+
+	  Do not change this unless you know what you are doing.
+
+config HD64461_ENABLER
+	bool "HD64461 PCMCIA enabler"
+	depends on HD64461
+	help
+	  Say Y here if you want to enable PCMCIA support
+	  via the HD64461 companion chip.
+	  Otherwise, say N.
+
+
+config HD64465_IOBASE
+	hex "HD64465 start address"
+	depends on HD64465
+	default "0xb0000000"
+	help
+	  The default setting of the HD64465 IO base address is 0xb0000000.
+
+	  Do not change this unless you know what you are doing.
+
+config HD64465_IRQ
+	int "HD64465 IRQ"
+	depends on HD64465
+	default "5"
+	help
+	  The default setting of the HD64465 IRQ is 5.
+
+	  Do not change this unless you know what you are doing.
+
+
diff -Nru a/arch/sh/cchips/hd6446x/hd64461/io.c b/arch/sh/cchips/hd6446x/hd64461/io.c
--- a/arch/sh/cchips/hd6446x/hd64461/io.c	Tue Feb  3 19:45:34 2004
+++ b/arch/sh/cchips/hd6446x/hd64461/io.c	Tue Feb  3 19:45:34 2004
@@ -1,5 +1,5 @@
 /*
- *	$Id: io.c,v 1.1.2.2 2002/01/20 05:03:25 mrbrown Exp $
+ *	$Id: io.c,v 1.4 2003/08/03 03:05:10 lethal Exp $
  *	Copyright (C) 2000 YAEGASHI Takeshi
  *	Typical I/O routines for HD64461 system.
  */
@@ -78,24 +78,6 @@
 	return *(volatile unsigned long*)PORT2ADDR(port);
 }
 
-void hd64461_insb(unsigned long port, void *buffer, unsigned long count)
-{
-	unsigned char *buf=buffer;
-	while(count--) *buf++=inb(port);
-}
-
-void hd64461_insw(unsigned long port, void *buffer, unsigned long count)
-{
-	unsigned short *buf=buffer;
-	while(count--) *buf++=inw(port);
-}
-
-void hd64461_insl(unsigned long port, void *buffer, unsigned long count)
-{
-	unsigned long *buf=buffer;
-	while(count--) *buf++=inl(port);
-}
-
 void hd64461_outb(unsigned char b, unsigned long port)
 {
 	*(volatile unsigned char*)PORT2ADDR(port) = b;
@@ -117,20 +99,3 @@
         *(volatile unsigned long*)PORT2ADDR(port) = b;
 }
 
-void hd64461_outsb(unsigned long port, const void *buffer, unsigned long count)
-{
-	const unsigned char *buf=buffer;
-	while(count--) outb(*buf++, port);
-}
-
-void hd64461_outsw(unsigned long port, const void *buffer, unsigned long count)
-{
-	const unsigned short *buf=buffer;
-	while(count--) outw(*buf++, port);
-}
-
-void hd64461_outsl(unsigned long port, const void *buffer, unsigned long count)
-{
-	const unsigned long *buf=buffer;
-	while(count--) outl(*buf++, port);
-}
diff -Nru a/arch/sh/cchips/hd6446x/hd64461/setup.c b/arch/sh/cchips/hd6446x/hd64461/setup.c
--- a/arch/sh/cchips/hd6446x/hd64461/setup.c	Tue Feb  3 19:45:41 2004
+++ b/arch/sh/cchips/hd6446x/hd64461/setup.c	Tue Feb  3 19:45:41 2004
@@ -1,5 +1,5 @@
 /*
- *	$Id: setup.c,v 1.1.2.3 2002/11/04 20:33:57 lethal Exp $
+ *	$Id: setup.c,v 1.4 2003/08/03 03:05:10 lethal Exp $
  *	Copyright (C) 2000 YAEGASHI Takeshi
  *	Hitachi HD64461 companion chip support
  */
@@ -76,21 +76,23 @@
 
 
 static struct hw_interrupt_type hd64461_irq_type = {
-	"HD64461-IRQ",
-	startup_hd64461_irq,
-	shutdown_hd64461_irq,
-	enable_hd64461_irq,
-	disable_hd64461_irq,
-	mask_and_ack_hd64461,
-	end_hd64461_irq
+	.typename	= "HD64461-IRQ",
+	.startup	= startup_hd64461_irq,
+	.shutdown	= shutdown_hd64461_irq,
+	.enable		= enable_hd64461_irq,
+	.disable	= disable_hd64461_irq,
+	.ack		= mask_and_ack_hd64461,
+	.end		= end_hd64461_irq,
 };
 
 
-static void hd64461_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t hd64461_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	printk(KERN_INFO
 	       "HD64461: spurious interrupt, nirr: 0x%x nimr: 0x%x\n",
 	       inw(HD64461_NIRR), inw(HD64461_NIMR));
+
+	return IRQ_NONE;
 }
 
 int hd64461_irq_demux(int irq)
diff -Nru a/arch/sh/cchips/hd6446x/hd64465/io.c b/arch/sh/cchips/hd6446x/hd64465/io.c
--- a/arch/sh/cchips/hd6446x/hd64465/io.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/cchips/hd6446x/hd64465/io.c	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,5 @@
 /*
- * $Id: io.c,v 1.1.2.2 2002/01/20 05:03:25 mrbrown Exp $
+ * $Id: io.c,v 1.4 2003/08/03 03:05:10 lethal Exp $
  * by Greg Banks <gbanks@pocketpenguins.com>
  * (c) 2000 PocketPenguins Inc
  *
@@ -179,24 +179,6 @@
 	return b;
 }
 
-void hd64465_insb(unsigned long port, void *buffer, unsigned long count)
-{
-	unsigned char *buf=buffer;
-	while(count--) *buf++=inb(port);
-}
-
-void hd64465_insw(unsigned long port, void *buffer, unsigned long count)
-{
-	unsigned short *buf=buffer;
-	while(count--) *buf++=inw(port);
-}
-
-void hd64465_insl(unsigned long port, void *buffer, unsigned long count)
-{
-	unsigned long *buf=buffer;
-	while(count--) *buf++=inl(port);
-}
-
 void hd64465_outb(unsigned char b, unsigned long port)
 {
 	unsigned long addr = PORT2ADDR(port);
@@ -232,20 +214,3 @@
             *(volatile unsigned long*)addr = b;
 }
 
-void hd64465_outsb(unsigned long port, const void *buffer, unsigned long count)
-{
-	const unsigned char *buf=buffer;
-	while(count--) outb(*buf++, port);
-}
-
-void hd64465_outsw(unsigned long port, const void *buffer, unsigned long count)
-{
-	const unsigned short *buf=buffer;
-	while(count--) outw(*buf++, port);
-}
-
-void hd64465_outsl(unsigned long port, const void *buffer, unsigned long count)
-{
-	const unsigned long *buf=buffer;
-	while(count--) outl(*buf++, port);
-}
diff -Nru a/arch/sh/cchips/hd6446x/hd64465/setup.c b/arch/sh/cchips/hd6446x/hd64465/setup.c
--- a/arch/sh/cchips/hd6446x/hd64465/setup.c	Tue Feb  3 19:45:43 2004
+++ b/arch/sh/cchips/hd6446x/hd64465/setup.c	Tue Feb  3 19:45:43 2004
@@ -1,5 +1,5 @@
 /*
- * $Id: setup.c,v 1.1.2.3 2002/11/04 20:33:57 lethal Exp $
+ * $Id: setup.c,v 1.4 2003/08/03 03:05:10 lethal Exp $
  *
  * Setup and IRQ handling code for the HD64465 companion chip.
  * by Greg Banks <gbanks@pocketpenguins.com>
@@ -24,21 +24,13 @@
 
 #include <asm/hd64465/hd64465.h>
 
-#undef HD64465_DEBUG
-
-#ifdef HD64465_DEBUG
-#define DPRINTK(args...)	printk(args)
-#else
-#define DPRINTK(args...)
-#endif
-
 static void disable_hd64465_irq(unsigned int irq)
 {
 	unsigned long flags;
 	unsigned short nimr;
 	unsigned short mask = 1 << (irq - HD64465_IRQ_BASE);
 
-    	DPRINTK("disable_hd64465_irq(%d): mask=%x\n", irq, mask);
+    	pr_debug("disable_hd64465_irq(%d): mask=%x\n", irq, mask);
 	local_irq_save(flags);
 	nimr = inw(HD64465_REG_NIMR);
 	nimr |= mask;
@@ -53,7 +45,7 @@
 	unsigned short nimr;
 	unsigned short mask = 1 << (irq - HD64465_IRQ_BASE);
 
-    	DPRINTK("enable_hd64465_irq(%d): mask=%x\n", irq, mask);
+    	pr_debug("enable_hd64465_irq(%d): mask=%x\n", irq, mask);
 	local_irq_save(flags);
 	nimr = inw(HD64465_REG_NIMR);
 	nimr &= ~mask;
@@ -95,15 +87,17 @@
 	.enable		= enable_hd64465_irq,
 	.disable	= disable_hd64465_irq,
 	.ack		= mask_and_ack_hd64465,
-	.end		= end_hd64465_irq
+	.end		= end_hd64465_irq,
 };
 
 
-static void hd64465_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t hd64465_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	printk(KERN_INFO
 	       "HD64465: spurious interrupt, nirr: 0x%x nimr: 0x%x\n",
 	       inw(HD64465_REG_NIRR), inw(HD64465_REG_NIMR));
+
+	return IRQ_NONE;
 }
 
 
@@ -145,7 +139,7 @@
 		unsigned short nirr = inw(HD64465_REG_NIRR);
 		unsigned short nimr = inw(HD64465_REG_NIMR);
 
-    	    	DPRINTK("hd64465_irq_demux, nirr=%04x, nimr=%04x\n", nirr, nimr);
+    	    	pr_debug("hd64465_irq_demux, nirr=%04x, nimr=%04x\n", nirr, nimr);
 		nirr &= ~nimr;
 		for (bit = 1, i = 0 ; i < HD64465_IRQ_NUM ; bit <<= 1, i++)
 		    if (nirr & bit)
diff -Nru a/arch/sh/configs/defconfig-adx b/arch/sh/configs/defconfig-adx
--- a/arch/sh/configs/defconfig-adx	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/configs/defconfig-adx	Tue Feb  3 19:45:17 2004
@@ -45,8 +45,8 @@
 # CONFIG_CPU_SH3 is not set
 CONFIG_CPU_SH4=y
 CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_MEMORY_START=08000000
-CONFIG_MEMORY_SIZE=00400000
+CONFIG_MEMORY_START=0x08000000
+CONFIG_MEMORY_SIZE=0x00400000
 CONFIG_MEMORY_SET=y
 # CONFIG_DISCONTIGMEM is not set
 
@@ -61,7 +61,7 @@
 CONFIG_CF_ENABLER=y
 # CONFIG_CF_AREA5 is not set
 CONFIG_CF_AREA6=y
-CONFIG_CF_BASE_ADDR=b8000000
+CONFIG_CF_BASE_ADDR=0xb8000000
 # CONFIG_HD64461 is not set
 # CONFIG_HD64465 is not set
 # CONFIG_SH_DMA is not set
diff -Nru a/arch/sh/configs/defconfig-cqreek b/arch/sh/configs/defconfig-cqreek
--- a/arch/sh/configs/defconfig-cqreek	Tue Feb  3 19:45:34 2004
+++ b/arch/sh/configs/defconfig-cqreek	Tue Feb  3 19:45:34 2004
@@ -45,8 +45,8 @@
 CONFIG_CPU_SH3=y
 # CONFIG_CPU_SH4 is not set
 CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_MEMORY_START=0c000000
-CONFIG_MEMORY_SIZE=00400000
+CONFIG_MEMORY_START=0x0c000000
+CONFIG_MEMORY_SIZE=0x00400000
 # CONFIG_DISCONTIGMEM is not set
 
 #
@@ -59,7 +59,7 @@
 # CONFIG_NET is not set
 # CONFIG_CF_AREA5 is not set
 CONFIG_CF_AREA6=y
-CONFIG_CF_BASE_ADDR=b8000000
+CONFIG_CF_BASE_ADDR=0xb8000000
 # CONFIG_HD64461 is not set
 # CONFIG_HD64465 is not set
 # CONFIG_SH_DMA is not set
diff -Nru a/arch/sh/configs/defconfig-dreamcast b/arch/sh/configs/defconfig-dreamcast
--- a/arch/sh/configs/defconfig-dreamcast	Tue Feb  3 19:45:29 2004
+++ b/arch/sh/configs/defconfig-dreamcast	Tue Feb  3 19:45:29 2004
@@ -1,23 +1,48 @@
 #
-# Automatically generated by make menuconfig: don't edit
+# Automatically generated make config: don't edit
 #
 CONFIG_SUPERH=y
 CONFIG_UID16=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 
 #
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
+# CONFIG_CLEAN_COMPILE is not set
+# CONFIG_STANDALONE is not set
+CONFIG_BROKEN=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_SWAP=y
+# CONFIG_SYSVIPC is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_SYSCTL is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_IKCONFIG is not set
+CONFIG_EMBEDDED=y
+CONFIG_KALLSYMS=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
 
 #
 # Loadable module support
 #
-# CONFIG_MODULES is not set
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_KMOD is not set
 
 #
-# Processor type and features
+# System type
 #
 # CONFIG_SH_SOLUTION_ENGINE is not set
 # CONFIG_SH_7751_SOLUTION_ENGINE is not set
@@ -29,60 +54,77 @@
 # CONFIG_SH_CQREEK is not set
 # CONFIG_SH_DMIDA is not set
 # CONFIG_SH_EC3104 is not set
+# CONFIG_SH_SATURN is not set
 CONFIG_SH_DREAMCAST=y
 # CONFIG_SH_CAT68701 is not set
 # CONFIG_SH_BIGSUR is not set
 # CONFIG_SH_SH2000 is not set
 # CONFIG_SH_ADX is not set
+# CONFIG_SH_MPC1211 is not set
+# CONFIG_SH_SECUREEDGE5410 is not set
 # CONFIG_SH_UNKNOWN is not set
-# CONFIG_SH_RTC is not set
+# CONFIG_CPU_SH2 is not set
+# CONFIG_CPU_SH3 is not set
+CONFIG_CPU_SH4=y
+# CONFIG_CPU_SUBTYPE_SH7604 is not set
+# CONFIG_CPU_SUBTYPE_SH7300 is not set
 # CONFIG_CPU_SUBTYPE_SH7707 is not set
 # CONFIG_CPU_SUBTYPE_SH7708 is not set
 # CONFIG_CPU_SUBTYPE_SH7709 is not set
 CONFIG_CPU_SUBTYPE_SH7750=y
 # CONFIG_CPU_SUBTYPE_SH7751 is not set
 # CONFIG_CPU_SUBTYPE_ST40STB1 is not set
-# CONFIG_CPU_SH3 is not set
-CONFIG_CPU_SH4=y
-CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_MEMORY_START=0c000000
-CONFIG_MEMORY_SIZE=00400000
+CONFIG_MMU=y
+# CONFIG_CMDLINE_BOOL is not set
+CONFIG_MEMORY_START=0x0c000000
+CONFIG_MEMORY_SIZE=0x01000000
 CONFIG_MEMORY_SET=y
-# CONFIG_DISCONTIGMEM is not set
+# CONFIG_MEMORY_OVERRIDE is not set
+CONFIG_ZERO_PAGE_OFFSET=0x00001000
+CONFIG_BOOT_LINK_OFFSET=0x00800000
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_PREEMPT=y
+# CONFIG_UBC_WAKEUP is not set
+# CONFIG_SH_WRITETHROUGH is not set
+# CONFIG_SH_OCRAM is not set
+CONFIG_SH_STORE_QUEUES=y
+# CONFIG_SMP is not set
+CONFIG_SH_PCLK_FREQ=49876504
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+CONFIG_SH_CPU_FREQ=y
+# CONFIG_CPU_FREQ_PROC_INTF is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_SH_DMA=y
+CONFIG_NR_ONCHIP_DMA_CHANNELS=4
+CONFIG_NR_DMA_CHANNELS_BOOL=y
+CONFIG_NR_DMA_CHANNELS=9
+CONFIG_DMA_PAGE_OPS=y
 
 #
-# General setup
+# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
 #
-CONFIG_ISA=y
-# CONFIG_EISA is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
-CONFIG_NET=y
-# CONFIG_HD64461 is not set
-# CONFIG_HD64465 is not set
-# CONFIG_SH_DMA is not set
 CONFIG_PCI=y
-# CONFIG_PCI_GOBIOS is not set
-# CONFIG_PCI_GODIRECT is not set
-CONFIG_PCI_GOANY=y
-CONFIG_PCI_BIOS=y
-CONFIG_PCI_DIRECT=y
 # CONFIG_SH_PCIDMA_NONCOHERENT is not set
+CONFIG_PCI_AUTO=y
+CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
 # CONFIG_HOTPLUG is not set
-# CONFIG_PCMCIA is not set
-# CONFIG_SYSVIPC is not set
-# CONFIG_BSD_PROCESS_ACCT is not set
-# CONFIG_SYSCTL is not set
-CONFIG_KCORE_ELF=y
-# CONFIG_KCORE_AOUT is not set
+
+#
+# Executable file formats
+#
 CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_FLAT is not set
 # CONFIG_BINFMT_MISC is not set
 
 #
-# Parallel port support
+# Generic Driver Options
 #
-# CONFIG_PARPORT is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -90,64 +132,89 @@
 # CONFIG_MTD is not set
 
 #
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
 # Block devices
 #
-# CONFIG_BLK_DEV_FD is not set
-# CONFIG_BLK_DEV_XD is not set
-# CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
-# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_SIZE=1024
 CONFIG_BLK_DEV_INITRD=y
+# CONFIG_LBD is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_SCSI is not set
 
 #
 # Multi-device support (RAID and LVM)
 #
 # CONFIG_MD is not set
-# CONFIG_BLK_DEV_MD is not set
-# CONFIG_MD_LINEAR is not set
-# CONFIG_MD_RAID0 is not set
-# CONFIG_MD_RAID1 is not set
-# CONFIG_MD_RAID5 is not set
-# CONFIG_MD_MULTIPATH is not set
-# CONFIG_BLK_DEV_LVM is not set
+
+#
+# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# Networking support
+#
+CONFIG_NET=y
 
 #
 # Networking options
 #
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
-# CONFIG_NETLINK is not set
-# CONFIG_NETFILTER is not set
-# CONFIG_FILTER is not set
+# CONFIG_NETLINK_DEV is not set
 CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
 CONFIG_INET=y
 # CONFIG_IP_MULTICAST is not set
 # CONFIG_IP_ADVANCED_ROUTER is not set
 CONFIG_IP_PNP=y
-# CONFIG_IP_PNP_DHCP is not set
+CONFIG_IP_PNP_DHCP=y
 # CONFIG_IP_PNP_BOOTP is not set
 # CONFIG_IP_PNP_RARP is not set
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
 # CONFIG_INET_ECN is not set
 # CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_KHTTPD is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NETFILTER is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+CONFIG_IPV6_SCTP__=y
+# CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
-# CONFIG_LLC is not set
 # CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
@@ -160,24 +227,9 @@
 # CONFIG_NET_SCHED is not set
 
 #
-# ATA/IDE/MFM/RLL support
-#
-# CONFIG_IDE is not set
-# CONFIG_BLK_DEV_HD is not set
-
-#
-# SCSI support
-#
-# CONFIG_SCSI is not set
-
-#
-# IEEE 1394 (FireWire) support (EXPERIMENTAL)
-#
-# CONFIG_IEEE1394 is not set
-
-#
-# Network device support
+# Network testing
 #
+# CONFIG_NET_PKTGEN is not set
 CONFIG_NETDEVICES=y
 
 #
@@ -193,65 +245,60 @@
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
 # CONFIG_STNIC is not set
-# CONFIG_SUNLANCE is not set
 # CONFIG_HAPPYMEAL is not set
-# CONFIG_SUNBMAC is not set
-# CONFIG_SUNQE is not set
-# CONFIG_SUNLANCE is not set
 # CONFIG_SUNGEM is not set
 # CONFIG_NET_VENDOR_3COM is not set
-# CONFIG_LANCE is not set
-# CONFIG_NET_VENDOR_SMC is not set
-# CONFIG_NET_VENDOR_RACAL is not set
-# CONFIG_AT1700 is not set
-# CONFIG_DEPCA is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
 # CONFIG_HP100 is not set
-# CONFIG_NET_ISA is not set
 CONFIG_NET_PCI=y
 # CONFIG_PCNET32 is not set
+# CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
-# CONFIG_AC3200 is not set
-# CONFIG_APRICOT is not set
-# CONFIG_TULIP is not set
-# CONFIG_DE4X5 is not set
+# CONFIG_B44 is not set
 # CONFIG_DGRS is not set
-# CONFIG_DM9102 is not set
 # CONFIG_EEPRO100 is not set
-# CONFIG_LNE390 is not set
+# CONFIG_E100 is not set
 # CONFIG_FEALNX is not set
 # CONFIG_NATSEMI is not set
 # CONFIG_NE2K_PCI is not set
-# CONFIG_NE3210 is not set
-# CONFIG_ES3210 is not set
 # CONFIG_8139CP is not set
 CONFIG_8139TOO=y
 # CONFIG_8139TOO_PIO is not set
 # CONFIG_8139TOO_TUNE_TWISTER is not set
 # CONFIG_8139TOO_8129 is not set
-CONFIG_8139TOO_DREAMCAST=y
+# CONFIG_8139_OLD_RX_RESET is not set
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
 # CONFIG_TLAN is not set
 # CONFIG_VIA_RHINE is not set
-# CONFIG_VIA_RHINE_MMIO is not set
-# CONFIG_WINBOND_840 is not set
-# CONFIG_NET_POCKET is not set
 
 #
 # Ethernet (1000 Mbit)
 #
 # CONFIG_ACENIC is not set
 # CONFIG_DL2K is not set
-# CONFIG_MYRI_SBUS is not set
+# CONFIG_E1000 is not set
 # CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_IXGB is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
-# CONFIG_PLIP is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 
@@ -264,7 +311,6 @@
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_NET_FC is not set
 # CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 
@@ -274,165 +320,186 @@
 # CONFIG_WAN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# Bluetooth support
+#
+# CONFIG_BT is not set
+
+#
+# ISDN subsystem
 #
-# CONFIG_CD_NO_IDESCSI is not set
+# CONFIG_ISDN_BOOL is not set
 
 #
-# Input core support
+# Telephony Support
 #
-CONFIG_INPUT=y
-CONFIG_INPUT_KEYBDEV=y
-CONFIG_INPUT_MOUSEDEV=y
-CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
-CONFIG_INPUT_JOYDEV=y
-# CONFIG_INPUT_EVDEV is not set
+# CONFIG_PHONE is not set
 
 #
-# Maple Bus support
+# Input device support
+#
+# CONFIG_INPUT is not set
+
+#
+# Userland interfaces
+#
+
+#
+# Input I/O drivers
+#
+# CONFIG_GAMEPORT is not set
+CONFIG_SOUND_GAMEPORT=y
+CONFIG_SERIO=y
+# CONFIG_SERIO_I8042 is not set
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PCIPS2 is not set
+
+#
+# Input Device Drivers
 #
-CONFIG_MAPLE=y
 
 #
 # Character devices
 #
-CONFIG_VT=y
-CONFIG_VT_CONSOLE=y
+# CONFIG_VT is not set
 # CONFIG_SERIAL is not set
 CONFIG_SH_SCI=y
 CONFIG_SERIAL_CONSOLE=y
-# CONFIG_UNIX98_PTYS is not set
 
 #
-# Maple Bus input peripherals
-#
-CONFIG_MAPLE_KEYBOARD=y
-CONFIG_MAPLE_MOUSE=y
-
+# Unix 98 PTY support
 #
-# Joysticks
-#
-# CONFIG_INPUT_GAMEPORT is not set
-# CONFIG_INPUT_NS558 is not set
-# CONFIG_INPUT_LIGHTNING is not set
-# CONFIG_INPUT_PCIGAME is not set
-# CONFIG_INPUT_CS461X is not set
-# CONFIG_INPUT_EMU10K1 is not set
-# CONFIG_INPUT_SERIO is not set
-# CONFIG_INPUT_SERPORT is not set
-# CONFIG_INPUT_ANALOG is not set
-# CONFIG_INPUT_A3D is not set
-# CONFIG_INPUT_ADI is not set
-# CONFIG_INPUT_COBRA is not set
-# CONFIG_INPUT_GF2K is not set
-# CONFIG_INPUT_GRIP is not set
-# CONFIG_INPUT_INTERACT is not set
-# CONFIG_INPUT_TMDC is not set
-# CONFIG_INPUT_SIDEWINDER is not set
-# CONFIG_INPUT_IFORCE_USB is not set
-# CONFIG_INPUT_IFORCE_232 is not set
-# CONFIG_INPUT_WARRIOR is not set
-# CONFIG_INPUT_MAGELLAN is not set
-# CONFIG_INPUT_SPACEORB is not set
-# CONFIG_INPUT_SPACEBALL is not set
-# CONFIG_INPUT_STINGER is not set
-# CONFIG_INPUT_DB9 is not set
-# CONFIG_INPUT_GAMECON is not set
-# CONFIG_INPUT_TURBOGRAFX is not set
-CONFIG_INPUT_MAPLE_CONTROL=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
 # CONFIG_PSMOUSE is not set
 
 #
 # Watchdog Cards
 #
-CONFIG_WATCHDOG=y
-# CONFIG_WATCHDOG_NOWAYOUT is not set
-CONFIG_SH_WDT=y
+# CONFIG_WATCHDOG is not set
 # CONFIG_RTC is not set
 
 #
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_SH_SCI is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# I2C Algorithms
+#
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C Hardware Sensors Chip support
+#
+# CONFIG_I2C_SENSOR is not set
+
+#
 # File systems
 #
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_MINIX_FS is not set
+CONFIG_ROMFS_FS=y
 # CONFIG_QUOTA is not set
 # CONFIG_AUTOFS_FS is not set
 # CONFIG_AUTOFS4_FS is not set
-# CONFIG_REISERFS_FS is not set
-# CONFIG_REISERFS_CHECK is not set
-# CONFIG_REISERFS_PROC_INFO is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_FAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_DEVFS_FS=y
+CONFIG_DEVFS_MOUNT=y
+# CONFIG_DEVFS_DEBUG is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+# CONFIG_HUGETLBFS is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
 # CONFIG_ADFS_FS is not set
-# CONFIG_ADFS_FS_RW is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
+# CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_JBD is not set
-# CONFIG_JBD_DEBUG is not set
-# CONFIG_FAT_FS is not set
-# CONFIG_MSDOS_FS is not set
-# CONFIG_UMSDOS_FS is not set
-# CONFIG_VFAT_FS is not set
 # CONFIG_EFS_FS is not set
-# CONFIG_JFFS_FS is not set
-# CONFIG_JFFS2_FS is not set
-# CONFIG_CRAMFS is not set
-CONFIG_TMPFS=y
-CONFIG_RAMFS=y
-CONFIG_ISO9660_FS=y
-# CONFIG_JOLIET is not set
-# CONFIG_ZISOFS is not set
-# CONFIG_MINIX_FS is not set
+CONFIG_CRAMFS=y
 # CONFIG_VXFS_FS is not set
-# CONFIG_NTFS_FS is not set
-# CONFIG_NTFS_RW is not set
 # CONFIG_HPFS_FS is not set
-CONFIG_PROC_FS=y
-# CONFIG_DEVFS_FS is not set
-# CONFIG_DEVFS_MOUNT is not set
-# CONFIG_DEVFS_DEBUG is not set
-# CONFIG_DEVPTS_FS is not set
 # CONFIG_QNX4FS_FS is not set
-# CONFIG_QNX4FS_RW is not set
-# CONFIG_ROMFS_FS is not set
-# CONFIG_EXT2_FS is not set
 # CONFIG_SYSV_FS is not set
-# CONFIG_UDF_FS is not set
-# CONFIG_UDF_RW is not set
 # CONFIG_UFS_FS is not set
-# CONFIG_UFS_FS_WRITE is not set
 
 #
 # Network File Systems
 #
-# CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 CONFIG_NFS_FS=y
-# CONFIG_NFS_V3 is not set
-CONFIG_ROOT_NFS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V4 is not set
 # CONFIG_NFSD is not set
-# CONFIG_NFSD_V3 is not set
-CONFIG_SUNRPC=y
+CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+# CONFIG_EXPORTFS is not set
+CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_GSS is not set
 # CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
-# CONFIG_NCPFS_PACKET_SIGNING is not set
-# CONFIG_NCPFS_IOCTL_LOCKING is not set
-# CONFIG_NCPFS_STRONG is not set
-# CONFIG_NCPFS_NFS_NS is not set
-# CONFIG_NCPFS_OS2_NS is not set
-# CONFIG_NCPFS_SMALLDOS is not set
-# CONFIG_NCPFS_NLS is not set
-# CONFIG_NCPFS_EXTRAS is not set
-# CONFIG_ZISOFS_FS is not set
-# CONFIG_ZLIB_FS_INFLATE is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
+# CONFIG_AFS_FS is not set
 
 #
 # Partition Types
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-# CONFIG_SMB_NLS is not set
-# CONFIG_NLS is not set
 
 #
 # Multimedia devices
@@ -440,40 +507,39 @@
 # CONFIG_VIDEO_DEV is not set
 
 #
-# Console drivers
+# Digital Video Broadcasting Devices
 #
-# CONFIG_VGA_CONSOLE is not set
-# CONFIG_VIDEO_SELECT is not set
-# CONFIG_MDA_CONSOLE is not set
+# CONFIG_DVB is not set
 
 #
-# Frame-buffer support
+# Graphics support
 #
 CONFIG_FB=y
-CONFIG_DUMMY_CONSOLE=y
-# CONFIG_FB_RIVA is not set
-# CONFIG_FB_CLGEN is not set
+# CONFIG_FB_CIRRUS is not set
 # CONFIG_FB_PM2 is not set
 # CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
 CONFIG_FB_PVR2=y
-CONFIG_FB_PVR2_DEBUG=y
+# CONFIG_FB_PVR2_DEBUG is not set
 # CONFIG_FB_E1355 is not set
+# CONFIG_FB_RIVA is not set
 # CONFIG_FB_MATROX is not set
-# CONFIG_FB_ATY is not set
 # CONFIG_FB_RADEON is not set
 # CONFIG_FB_ATY128 is not set
+# CONFIG_FB_ATY is not set
 # CONFIG_FB_SIS is not set
+# CONFIG_FB_NEOMAGIC is not set
 # CONFIG_FB_3DFX is not set
 # CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_PM3 is not set
 # CONFIG_FB_VIRTUAL is not set
-# CONFIG_FBCON_ADVANCED is not set
-CONFIG_FBCON_CFB16=y
-CONFIG_FBCON_CFB24=y
-CONFIG_FBCON_CFB32=y
-# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
-# CONFIG_FBCON_FONTS is not set
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
+
+#
+# Logo configuration
+#
+# CONFIG_LOGO is not set
 
 #
 # Sound
@@ -481,7 +547,38 @@
 # CONFIG_SOUND is not set
 
 #
+# USB support
+#
+# CONFIG_USB is not set
+# CONFIG_USB_GADGET is not set
+
+#
+# Profiling support
+#
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=y
+
+#
 # Kernel hacking
 #
 # CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_SH_STANDARD_BIOS is not set
+# CONFIG_KGDB is not set
+# CONFIG_FRAME_POINTER is not set
+
+#
+# Security options
+#
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+CONFIG_CRC32=y
+CONFIG_ZLIB_INFLATE=y
diff -Nru a/arch/sh/configs/defconfig-se7751 b/arch/sh/configs/defconfig-se7751
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/configs/defconfig-se7751	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,617 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_SUPERH=y
+CONFIG_UID16=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_SYSCTL=y
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_IKCONFIG is not set
+CONFIG_EMBEDDED=y
+CONFIG_KALLSYMS=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODULE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_KMOD is not set
+
+#
+# System type
+#
+# CONFIG_SH_SOLUTION_ENGINE is not set
+CONFIG_SH_7751_SOLUTION_ENGINE=y
+# CONFIG_SH_7751_SYSTEMH is not set
+# CONFIG_SH_STB1_HARP is not set
+# CONFIG_SH_STB1_OVERDRIVE is not set
+# CONFIG_SH_HP620 is not set
+# CONFIG_SH_HP680 is not set
+# CONFIG_SH_HP690 is not set
+# CONFIG_SH_CQREEK is not set
+# CONFIG_SH_DMIDA is not set
+# CONFIG_SH_EC3104 is not set
+# CONFIG_SH_SATURN is not set
+# CONFIG_SH_DREAMCAST is not set
+# CONFIG_SH_CAT68701 is not set
+# CONFIG_SH_BIGSUR is not set
+# CONFIG_SH_SH2000 is not set
+# CONFIG_SH_ADX is not set
+# CONFIG_SH_MPC1211 is not set
+# CONFIG_SH_SECUREEDGE5410 is not set
+# CONFIG_SH_UNKNOWN is not set
+# CONFIG_CPU_SH2 is not set
+# CONFIG_CPU_SH3 is not set
+CONFIG_CPU_SH4=y
+# CONFIG_CPU_SUBTYPE_SH7604 is not set
+# CONFIG_CPU_SUBTYPE_SH7300 is not set
+# CONFIG_CPU_SUBTYPE_SH7707 is not set
+# CONFIG_CPU_SUBTYPE_SH7708 is not set
+# CONFIG_CPU_SUBTYPE_SH7709 is not set
+# CONFIG_CPU_SUBTYPE_SH7750 is not set
+CONFIG_CPU_SUBTYPE_SH7751=y
+# CONFIG_CPU_SUBTYPE_SH7760 is not set
+# CONFIG_CPU_SUBTYPE_ST40STB1 is not set
+CONFIG_MMU=y
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="console=ttySC1,38400"
+CONFIG_MEMORY_START=0x0c000000
+CONFIG_MEMORY_SIZE=0x04000000
+CONFIG_MEMORY_SET=y
+# CONFIG_MEMORY_OVERRIDE is not set
+CONFIG_SH_RTC=y
+CONFIG_ZERO_PAGE_OFFSET=0x00010000
+CONFIG_BOOT_LINK_OFFSET=0x00800000
+CONFIG_CPU_LITTLE_ENDIAN=y
+# CONFIG_PREEMPT is not set
+# CONFIG_UBC_WAKEUP is not set
+# CONFIG_SH_WRITETHROUGH is not set
+# CONFIG_SH_OCRAM is not set
+# CONFIG_SH_STORE_QUEUES is not set
+# CONFIG_SMP is not set
+CONFIG_SH_PCLK_FREQ=60013568
+# CONFIG_CPU_FREQ is not set
+# CONFIG_SH_DMA is not set
+
+#
+# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
+#
+CONFIG_PCI=y
+# CONFIG_SH_PCIDMA_NONCOHERENT is not set
+CONFIG_PCI_AUTO=y
+CONFIG_PCI_AUTO_UPDATE_RESOURCES=y
+CONFIG_PCI_DMA=y
+# CONFIG_PCI_LEGACY_PROC is not set
+# CONFIG_PCI_NAMES is not set
+# CONFIG_HOTPLUG is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_FLAT is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Generic Driver Options
+#
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_CONCAT is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+# CONFIG_MTD_CHAR is not set
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+CONFIG_MTD_CFI_AMDSTD=y
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_RAM=y
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_OBSOLETE_CHIPS is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_MPC1211 is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLKMTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD 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 is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_LBD is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_SCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# Networking support
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_NETLINK_DEV=y
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+
+#
+# IP: Virtual Server Configuration
+#
+# CONFIG_IP_VS is not set
+# CONFIG_IPV6 is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+CONFIG_NETFILTER=y
+CONFIG_NETFILTER_DEBUG=y
+
+#
+# IP: Netfilter Configuration
+#
+# CONFIG_IP_NF_CONNTRACK is not set
+CONFIG_IP_NF_QUEUE=y
+# CONFIG_IP_NF_IPTABLES is not set
+# CONFIG_IP_NF_ARPTABLES is not set
+# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
+# CONFIG_IP_NF_COMPAT_IPFWADM is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+CONFIG_IPV6_SCTP__=y
+# CONFIG_IP_SCTP is not set
+# CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_ETHERTAP is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_STNIC is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=y
+# CONFIG_AMD8111_ETH is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_B44 is not set
+# CONFIG_DGRS is not set
+# CONFIG_EEPRO100 is not set
+# CONFIG_E100 is not set
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_8139CP is not set
+# CONFIG_8139TOO is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_IXGB is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# Bluetooth support
+#
+# CONFIG_BT is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN_BOOL is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+# CONFIG_INPUT is not set
+
+#
+# Userland interfaces
+#
+
+#
+# Input I/O drivers
+#
+# CONFIG_GAMEPORT is not set
+CONFIG_SOUND_GAMEPORT=y
+# CONFIG_SERIO is not set
+# CONFIG_SERIO_I8042 is not set
+
+#
+# Input Device Drivers
+#
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL is not set
+CONFIG_SH_SCI=y
+CONFIG_SERIAL_CONSOLE=y
+
+#
+# Unix 98 PTY support
+#
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+CONFIG_HEARTBEAT=y
+# CONFIG_PSMOUSE is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+# CONFIG_SH_WDT is not set
+# CONFIG_RTC is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_SH_SCI is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# I2C Algorithms
+#
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C Hardware Sensors Chip support
+#
+# CONFIG_I2C_SENSOR is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_FAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+# CONFIG_DEVFS_FS is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+# CONFIG_JFFS2_FS_NAND is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+# CONFIG_NFS_FS is not set
+# CONFIG_NFSD is not set
+# CONFIG_EXPORTFS is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+# CONFIG_USB_GADGET is not set
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_SH_STANDARD_BIOS is not set
+# CONFIG_KGDB is not set
+# CONFIG_FRAME_POINTER is not set
+
+#
+# Security options
+#
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+CONFIG_CRC32=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
diff -Nru a/arch/sh/configs/defconfig-snapgear b/arch/sh/configs/defconfig-snapgear
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/configs/defconfig-snapgear	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,540 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_SUPERH=y
+CONFIG_UID16=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_SWAP=y
+# CONFIG_SYSVIPC is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_SYSCTL is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_IKCONFIG is not set
+# CONFIG_EMBEDDED is not set
+CONFIG_KALLSYMS=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+
+#
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
+# System type
+#
+# CONFIG_SH_SOLUTION_ENGINE is not set
+# CONFIG_SH_7751_SOLUTION_ENGINE is not set
+# CONFIG_SH_STB1_HARP is not set
+# CONFIG_SH_STB1_OVERDRIVE is not set
+# CONFIG_SH_HP620 is not set
+# CONFIG_SH_HP680 is not set
+# CONFIG_SH_HP690 is not set
+# CONFIG_SH_CQREEK is not set
+# CONFIG_SH_DMIDA is not set
+# CONFIG_SH_EC3104 is not set
+# CONFIG_SH_SATURN is not set
+# CONFIG_SH_DREAMCAST is not set
+# CONFIG_SH_CAT68701 is not set
+# CONFIG_SH_BIGSUR is not set
+# CONFIG_SH_SH2000 is not set
+# CONFIG_SH_ADX is not set
+# CONFIG_SH_MPC1211 is not set
+CONFIG_SH_SECUREEDGE5410=y
+# CONFIG_SH_UNKNOWN is not set
+# CONFIG_CPU_SH2 is not set
+# CONFIG_CPU_SH3 is not set
+CONFIG_CPU_SH4=y
+# CONFIG_CPU_SUBTYPE_SH7604 is not set
+# CONFIG_CPU_SUBTYPE_SH7300 is not set
+# CONFIG_CPU_SUBTYPE_SH7707 is not set
+# CONFIG_CPU_SUBTYPE_SH7708 is not set
+# CONFIG_CPU_SUBTYPE_SH7709 is not set
+# CONFIG_CPU_SUBTYPE_SH7750 is not set
+CONFIG_CPU_SUBTYPE_SH7751=y
+# CONFIG_CPU_SUBTYPE_ST40STB1 is not set
+CONFIG_MMU=y
+# CONFIG_CMDLINE_BOOL is not set
+CONFIG_MEMORY_START=0x08000000
+CONFIG_MEMORY_SIZE=0x01000000
+CONFIG_MEMORY_SET=y
+# CONFIG_MEMORY_OVERRIDE is not set
+CONFIG_SH_RTC=y
+CONFIG_ZERO_PAGE_OFFSET=0x00001000
+CONFIG_BOOT_LINK_OFFSET=0x00800000
+CONFIG_CPU_LITTLE_ENDIAN=y
+# CONFIG_PREEMPT is not set
+# CONFIG_UBC_WAKEUP is not set
+# CONFIG_SH_WRITETHROUGH is not set
+# CONFIG_SH_OCRAM is not set
+# CONFIG_SH_STORE_QUEUES is not set
+# CONFIG_SMP is not set
+CONFIG_SH_PCLK_FREQ=60013568
+# CONFIG_CPU_FREQ is not set
+CONFIG_SH_DMA=y
+CONFIG_NR_DMA_CHANNELS=8
+# CONFIG_DMA_PAGE_OPS is not set
+
+#
+# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
+#
+CONFIG_PCI=y
+# CONFIG_SH_PCIDMA_NONCOHERENT is not set
+CONFIG_PCI_AUTO=y
+CONFIG_PCI_AUTO_UPDATE_RESOURCES=y
+CONFIG_PCI_DMA=y
+# CONFIG_PCI_LEGACY_PROC is not set
+CONFIG_PCI_NAMES=y
+# CONFIG_HOTPLUG is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_FLAT is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Generic Driver Options
+#
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD 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 is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_LBD is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_SCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# Networking support
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+# CONFIG_PACKET is not set
+# CONFIG_NETLINK_DEV is not set
+# CONFIG_UNIX is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_IPV6 is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NETFILTER is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+CONFIG_IPV6_SCTP__=y
+# CONFIG_IP_SCTP is not set
+# CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_LLC is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+# CONFIG_MII is not set
+# CONFIG_STNIC is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_PCI=y
+# CONFIG_PCNET32 is not set
+# CONFIG_AMD8111_ETH is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_B44 is not set
+# CONFIG_DGRS is not set
+# CONFIG_EEPRO100 is not set
+# CONFIG_E100 is not set
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_8139CP is not set
+CONFIG_8139TOO=y
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_OLD_RX_RESET is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_IXGB is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices (depends on LLC=y)
+#
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN_BOOL is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input I/O drivers
+#
+# CONFIG_GAMEPORT is not set
+CONFIG_SOUND_GAMEPORT=y
+# CONFIG_SERIO is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL is not set
+CONFIG_SH_SCI=y
+CONFIG_SERIAL_CONSOLE=y
+
+#
+# Unix 98 PTY support
+#
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+# CONFIG_PSMOUSE is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_RTC is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_SH_SCI is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# I2C Hardware Sensors Mainboard support
+#
+
+#
+# I2C Hardware Sensors Chip support
+#
+# CONFIG_I2C_SENSOR is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_MINIX_FS is not set
+CONFIG_ROMFS_FS=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_FAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_DEVFS_FS=y
+CONFIG_DEVFS_MOUNT=y
+# CONFIG_DEVFS_DEBUG is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+# CONFIG_EXPORTFS is not set
+CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_GSS is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+# CONFIG_USB_GADGET is not set
+
+#
+# Bluetooth support
+#
+# CONFIG_BT is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_SH_STANDARD_BIOS is not set
+# CONFIG_KGDB is not set
+# CONFIG_FRAME_POINTER is not set
+
+#
+# Security options
+#
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+# CONFIG_CRC32 is not set
+CONFIG_ZLIB_INFLATE=y
diff -Nru a/arch/sh/configs/defconfig-systemh b/arch/sh/configs/defconfig-systemh
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/configs/defconfig-systemh	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,372 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_SUPERH=y
+CONFIG_UID16=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+# CONFIG_CLEAN_COMPILE is not set
+# CONFIG_STANDALONE is not set
+CONFIG_BROKEN=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_SWAP=y
+# CONFIG_SYSVIPC is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_SYSCTL is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_IKCONFIG is not set
+CONFIG_EMBEDDED=y
+CONFIG_KALLSYMS=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_KMOD is not set
+
+#
+# System type
+#
+# CONFIG_SH_SOLUTION_ENGINE is not set
+# CONFIG_SH_7751_SOLUTION_ENGINE is not set
+CONFIG_SH_7751_SYSTEMH=y
+# CONFIG_SH_STB1_HARP is not set
+# CONFIG_SH_STB1_OVERDRIVE is not set
+# CONFIG_SH_HP620 is not set
+# CONFIG_SH_HP680 is not set
+# CONFIG_SH_HP690 is not set
+# CONFIG_SH_CQREEK is not set
+# CONFIG_SH_DMIDA is not set
+# CONFIG_SH_EC3104 is not set
+# CONFIG_SH_SATURN is not set
+# CONFIG_SH_DREAMCAST is not set
+# CONFIG_SH_CAT68701 is not set
+# CONFIG_SH_BIGSUR is not set
+# CONFIG_SH_SH2000 is not set
+# CONFIG_SH_ADX is not set
+# CONFIG_SH_MPC1211 is not set
+# CONFIG_SH_SECUREEDGE5410 is not set
+# CONFIG_SH_UNKNOWN is not set
+# CONFIG_CPU_SH2 is not set
+# CONFIG_CPU_SH3 is not set
+CONFIG_CPU_SH4=y
+# CONFIG_CPU_SUBTYPE_SH7604 is not set
+# CONFIG_CPU_SUBTYPE_SH7300 is not set
+# CONFIG_CPU_SUBTYPE_SH7707 is not set
+# CONFIG_CPU_SUBTYPE_SH7708 is not set
+# CONFIG_CPU_SUBTYPE_SH7709 is not set
+# CONFIG_CPU_SUBTYPE_SH7750 is not set
+CONFIG_CPU_SUBTYPE_SH7751=y
+# CONFIG_CPU_SUBTYPE_ST40STB1 is not set
+CONFIG_MMU=y
+# CONFIG_CMDLINE_BOOL is not set
+CONFIG_MEMORY_START=0x0c000000
+CONFIG_MEMORY_SIZE=0x00400000
+# CONFIG_MEMORY_OVERRIDE is not set
+CONFIG_SH_RTC=y
+CONFIG_ZERO_PAGE_OFFSET=0x00001000
+CONFIG_BOOT_LINK_OFFSET=0x00800000
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_PREEMPT=y
+# CONFIG_UBC_WAKEUP is not set
+# CONFIG_SH_WRITETHROUGH is not set
+# CONFIG_SH_OCRAM is not set
+# CONFIG_SH_STORE_QUEUES is not set
+# CONFIG_SMP is not set
+CONFIG_SH_PCLK_FREQ=49876504
+# CONFIG_CPU_FREQ is not set
+# CONFIG_SH_DMA is not set
+
+#
+# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
+#
+CONFIG_PCI=y
+# CONFIG_SH_PCIDMA_NONCOHERENT is not set
+CONFIG_PCI_AUTO=y
+CONFIG_PCI_AUTO_UPDATE_RESOURCES=y
+CONFIG_PCI_DMA=y
+CONFIG_PCI_LEGACY_PROC=y
+CONFIG_PCI_NAMES=y
+# CONFIG_HOTPLUG is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_FLAT is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Generic Driver Options
+#
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Block devices
+#
+# 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 is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=1024
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_LBD is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_SCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# Networking support
+#
+# CONFIG_NET is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# ISDN subsystem
+#
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+# CONFIG_INPUT is not set
+
+#
+# Userland interfaces
+#
+
+#
+# Input I/O drivers
+#
+# CONFIG_GAMEPORT is not set
+CONFIG_SOUND_GAMEPORT=y
+CONFIG_SERIO=y
+# CONFIG_SERIO_I8042 is not set
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PCIPS2 is not set
+
+#
+# Input Device Drivers
+#
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL is not set
+CONFIG_SH_SCI=y
+CONFIG_SERIAL_CONSOLE=y
+
+#
+# Unix 98 PTY support
+#
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+# CONFIG_PSMOUSE is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_RTC is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_SH_SCI is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# I2C Algorithms
+#
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C Hardware Sensors Chip support
+#
+# CONFIG_I2C_SENSOR is not set
+
+#
+# File systems
+#
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_MINIX_FS is not set
+CONFIG_ROMFS_FS=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_FAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_DEVFS_FS=y
+CONFIG_DEVFS_MOUNT=y
+# CONFIG_DEVFS_DEBUG is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+# CONFIG_HUGETLBFS is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+# CONFIG_USB_GADGET is not set
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_SH_STANDARD_BIOS is not set
+# CONFIG_KGDB is not set
+# CONFIG_FRAME_POINTER is not set
+
+#
+# Security options
+#
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+CONFIG_CRC32=y
+CONFIG_ZLIB_INFLATE=y
diff -Nru a/arch/sh/drivers/Makefile b/arch/sh/drivers/Makefile
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/Makefile	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,7 @@
+#
+# Makefile for the Linux SuperH-specific device drivers.
+#
+
+obj-$(CONFIG_PCI)	+= pci/
+obj-$(CONFIG_SH_DMA)	+= dma/
+
diff -Nru a/arch/sh/drivers/dma/Kconfig b/arch/sh/drivers/dma/Kconfig
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/dma/Kconfig	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,42 @@
+config SH_DMA
+	bool "DMA controller (DMAC) support"
+	help
+	  Selecting this option will provide same API as PC's Direct Memory
+	  Access Controller(8237A) for SuperH DMAC.
+
+	  If unsure, say N.
+
+config NR_ONCHIP_DMA_CHANNELS
+	depends on SH_DMA
+	int "Number of on-chip DMAC channels"
+	default "4"
+	help
+	  This allows you to specify the number of channels that the on-chip
+	  DMAC supports. This will be 4 for SH7750/SH7751 and 8 for the
+	  SH7750R/SH7751R.
+
+config NR_DMA_CHANNELS_BOOL
+	depends on SH_DMA
+	bool "Override default number of maximum DMA channels"
+	help
+	  This allows you to forcibly update the maximum number of supported
+	  DMA channels for a given board. If this is unset, this will default
+	  to the number of channels that the on-chip DMAC has.
+
+config NR_DMA_CHANNELS
+	int "Maximum number of DMA channels"
+	depends on SH_DMA && NR_DMA_CHANNELS_BOOL
+	default NR_ONCHIP_DMA_CHANNELS
+	help
+	  This allows you to specify the maximum number of DMA channels to
+	  support. Setting this to a higher value allows for cascading DMACs
+	  with additional channels.
+
+config DMA_PAGE_OPS
+	bool "Use DMAC for page copy/clear"
+	depends on SH_DMA
+	help
+	  Selecting this option will use a dual-address mode configured channel
+	  in the SH DMAC for copy_page()/clear_page(). Primarily a performance
+	  hack.
+
diff -Nru a/arch/sh/drivers/dma/Makefile b/arch/sh/drivers/dma/Makefile
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/dma/Makefile	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,8 @@
+#
+# Makefile for the SuperH DMA specific kernel interface routines under Linux.
+#
+
+obj-y				+= dma-api.o dma-isa.o
+obj-$(CONFIG_SH_DMA)		+= dma-sh.o
+obj-$(CONFIG_SH_DREAMCAST)	+= dma-pvr2.o dma-g2.o
+
diff -Nru a/arch/sh/drivers/dma/dma-api.c b/arch/sh/drivers/dma/dma-api.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/dma/dma-api.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,193 @@
+/*
+ * arch/sh/drivers/dma/dma-api.c
+ *
+ * SuperH-specific DMA management API
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */ 
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/interrupt.h>
+#include <linux/spinlock.h>
+#include <linux/proc_fs.h>
+#include <asm/dma.h>
+
+struct dma_info dma_info[MAX_DMA_CHANNELS] = { { 0, } };
+spinlock_t dma_spin_lock = SPIN_LOCK_UNLOCKED;
+
+/* 
+ * A brief note about the reasons for this API as it stands.
+ *
+ * For starters, the old ISA DMA API didn't work for us for a number of
+ * reasons, for one, the vast majority of channels on the SH DMAC are
+ * dual-address mode only, and both the new and the old DMA APIs are after the
+ * concept of managing a DMA buffer, which doesn't overly fit this model very
+ * well. In addition to which, the new API is largely geared at IOMMUs and
+ * GARTs, and doesn't even support the channel notion very well.
+ *
+ * The other thing that's a marginal issue, is the sheer number of random DMA
+ * engines that are present (ie, in boards like the Dreamcast), some of which
+ * cascade off of the SH DMAC, and others do not. As such, there was a real
+ * need for a scalable subsystem that could deal with both single and
+ * dual-address mode usage, in addition to interoperating with cascaded DMACs.
+ *
+ * There really isn't any reason why this needs to be SH specific, though I'm
+ * not aware of too many other processors (with the exception of some MIPS)
+ * that have the same concept of a dual address mode, or any real desire to
+ * actually make use of the DMAC even if such a subsystem were exposed
+ * elsewhere.
+ *
+ * The idea for this was derived from the ARM port, which acted as an excellent
+ * reference when trying to address these issues.
+ *
+ * It should also be noted that the decision to add Yet Another DMA API(tm) to
+ * the kernel wasn't made easily, and was only decided upon after conferring
+ * with jejb with regards to the state of the old and new APIs as they applied
+ * to these circumstances. Philip Blundell was also a great help in figuring
+ * out some single-address mode DMA semantics that were otherwise rather
+ * confusing.
+ */
+
+struct dma_info *get_dma_info(unsigned int chan)
+{
+	return dma_info + chan;
+}
+
+int get_dma_residue(unsigned int chan)
+{
+	struct dma_info *info = get_dma_info(chan);
+
+	if (info->ops->get_residue)
+		return info->ops->get_residue(info);
+	
+	return 0;
+}
+
+int request_dma(unsigned int chan, const char *dev_id)
+{
+	struct dma_info *info = get_dma_info(chan);
+
+	down(&info->sem);
+
+	if (!info->ops || chan >= MAX_DMA_CHANNELS) {
+		up(&info->sem);
+		return -EINVAL;
+	}
+	
+	atomic_set(&info->busy, 1);
+
+	info->dev_id = dev_id;
+
+	up(&info->sem);
+
+	if (info->ops->request)
+		return info->ops->request(info);
+	
+	return 0;
+}
+
+void free_dma(unsigned int chan)
+{
+	struct dma_info *info = get_dma_info(chan);
+
+	if (info->ops->free)
+		info->ops->free(info);
+	
+	atomic_set(&info->busy, 0);
+}
+
+void dma_wait_for_completion(unsigned int chan)
+{
+	struct dma_info *info = get_dma_info(chan);
+
+	while (info->ops->get_residue(info))
+		cpu_relax();
+}
+
+void dma_configure_channel(unsigned int chan, unsigned long flags)
+{
+	struct dma_info *info = get_dma_info(chan);
+
+	if (info->ops->configure)
+		info->ops->configure(info, flags);
+}
+
+int dma_xfer(unsigned int chan, unsigned long from,
+	     unsigned long to, size_t size, unsigned int mode)
+{
+	struct dma_info *info = get_dma_info(chan);
+
+	info->sar	= from;
+	info->dar	= to;
+	info->count	= size;
+	info->mode	= mode;
+
+	return info->ops->xfer(info);
+}
+
+#ifdef CONFIG_PROC_FS
+static int dma_read_proc(char *buf, char **start, off_t off,
+			 int len, int *eof, void *data)
+{
+	struct dma_info *info;
+	char *p = buf;
+	int i;
+
+	for (i = 0, info = dma_info; i < MAX_DMA_CHANNELS; i++, info++) {
+		if (!atomic_read(&info->busy))
+			continue;
+
+		p += sprintf(p, "%2d: %14s    %s\n", i,
+			     info->ops->name, info->dev_id);
+	}
+
+	return p - buf;
+}
+#endif
+
+int __init register_dmac(struct dma_ops *ops)
+{
+	int i;
+
+	printk("DMA: Registering %s handler.\n", ops->name);
+
+	for (i = 0; i < MAX_DMA_CHANNELS; i++) {
+		struct dma_info *info = get_dma_info(i);
+
+		info->chan = i;
+
+		init_MUTEX(&info->sem);
+	}
+
+	return 0;
+}
+
+static int __init dma_api_init(void)
+{
+	printk("DMA: Registering DMA API.\n");
+
+#ifdef CONFIG_PROC_FS
+	create_proc_read_entry("dma", 0, 0, dma_read_proc, 0);
+#endif
+
+	return 0;
+}
+
+subsys_initcall(dma_api_init);
+
+MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>");
+MODULE_DESCRIPTION("DMA API for SuperH");
+MODULE_LICENSE("GPL");
+
+EXPORT_SYMBOL(request_dma);
+EXPORT_SYMBOL(free_dma);
+EXPORT_SYMBOL(get_dma_residue);
+EXPORT_SYMBOL(get_dma_info);
+EXPORT_SYMBOL(dma_xfer);
+EXPORT_SYMBOL(dma_wait_for_completion);
+EXPORT_SYMBOL(dma_configure_channel);
+
diff -Nru a/arch/sh/drivers/dma/dma-g2.c b/arch/sh/drivers/dma/dma-g2.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/dma/dma-g2.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,173 @@
+/*
+ * arch/sh/drivers/dma/dma-g2.c
+ *
+ * G2 bus DMA support
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/interrupt.h>
+
+#include <asm/mach/sysasic.h>
+#include <asm/mach/dma.h>
+#include <asm/dma.h>
+
+struct g2_channel {
+	unsigned long g2_addr;		/* G2 bus address */
+	unsigned long root_addr;	/* Root bus (SH-4) address */
+	unsigned long size;		/* Size (in bytes), 32-byte aligned */
+	unsigned long direction;	/* Transfer direction */
+	unsigned long ctrl;		/* Transfer control */
+	unsigned long chan_enable;	/* Channel enable */
+	unsigned long xfer_enable;	/* Transfer enable */
+	unsigned long xfer_stat;	/* Transfer status */
+} __attribute__ ((aligned(32)));
+
+struct g2_status {
+	unsigned long g2_addr;
+	unsigned long root_addr;
+	unsigned long size;
+	unsigned long status;
+} __attribute__ ((aligned(16)));
+
+struct g2_dma_info {
+	struct g2_channel channel[G2_NR_DMA_CHANNELS];
+	unsigned long pad1[G2_NR_DMA_CHANNELS];
+	unsigned long wait_state;
+	unsigned long pad2[10];
+	unsigned long magic;
+	struct g2_status status[G2_NR_DMA_CHANNELS];
+} __attribute__ ((aligned(256)));
+
+static volatile struct g2_dma_info *g2_dma = (volatile struct g2_dma_info *)0xa05f7800;
+
+static irqreturn_t g2_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	/* FIXME: Do some meaningful completion work here.. */
+	return IRQ_HANDLED;
+}
+
+static struct irqaction g2_dma_irq = {
+	.name		= "g2 DMA handler",
+	.handler	= g2_dma_interrupt,
+	.flags		= SA_INTERRUPT,
+};
+
+static int g2_enable_dma(struct dma_info *info)
+{
+	unsigned int chan = info->chan;
+
+	g2_dma->channel[chan].chan_enable = 1;
+	g2_dma->channel[chan].xfer_enable = 1;
+
+	return 0;
+}
+
+static int g2_disable_dma(struct dma_info *info)
+{
+	unsigned int chan = info->chan;
+
+	g2_dma->channel[chan].chan_enable = 0;
+	g2_dma->channel[chan].xfer_enable = 0;
+
+	return 0;
+}
+
+static int g2_xfer_dma(struct dma_info *info)
+{
+	unsigned int chan = info->chan;
+
+	if (info->sar & 31) {
+		printk("g2dma: unaligned source 0x%lx\n", info->sar);
+		return -EINVAL;
+	}
+
+	if (info->dar & 31) {
+		printk("g2dma: unaligned dest 0x%lx\n", info->dar);
+		return -EINVAL;
+	}
+
+	/* Align the count */
+	if (info->count & 31)
+		info->count = (info->count + (32 - 1)) & ~(32 - 1);
+
+	/* Fixup destination */
+	info->dar += 0xa0800000;
+
+	/* Fixup direction */
+	info->mode = !info->mode;
+
+	flush_icache_range((unsigned long)info->sar, info->count);
+
+	g2_disable_dma(info);
+
+	g2_dma->channel[chan].g2_addr	= info->dar & 0x1fffffe0;
+	g2_dma->channel[chan].root_addr = info->sar & 0x1fffffe0;
+	g2_dma->channel[chan].size	= (info->count & ~31) | 0x80000000;
+	g2_dma->channel[chan].direction = info->mode;
+
+	/*
+	 * bit 0 - ???
+	 * bit 1 - if set, generate a hardware event on transfer completion
+	 * bit 2 - ??? something to do with suspend?
+	 */
+	g2_dma->channel[chan].ctrl	= 5; /* ?? */
+
+	g2_enable_dma(info);
+	
+	/* debug cruft */
+	pr_debug("count, sar, dar, mode, ctrl, chan, xfer: %ld, 0x%08lx, "
+		 "0x%08lx, %ld, %ld, %ld, %ld\n",
+		 g2_dma->channel[chan].size,
+		 g2_dma->channel[chan].root_addr,
+		 g2_dma->channel[chan].g2_addr,
+		 g2_dma->channel[chan].direction,
+		 g2_dma->channel[chan].ctrl,
+		 g2_dma->channel[chan].chan_enable,
+		 g2_dma->channel[chan].xfer_enable);
+
+	return 0;
+}
+
+static struct dma_ops g2_dma_ops = {
+	.name		= "G2 DMA",
+	.xfer		= g2_xfer_dma,
+};
+
+static int __init g2_dma_init(void)
+{
+	int i, base;
+
+	setup_irq(HW_EVENT_G2_DMA, &g2_dma_irq);
+
+	/* Magic */
+	g2_dma->wait_state	= 27;
+	g2_dma->magic		= 0x4659404f;
+
+	/* G2 channels come after on-chip and pvr2 */
+	base = ONCHIP_NR_DMA_CHANNELS + PVR2_NR_DMA_CHANNELS;
+
+	for (i = 0; i < G2_NR_DMA_CHANNELS; i++)
+		dma_info[base + i].ops = &g2_dma_ops;
+	
+	return register_dmac(&g2_dma_ops);
+}
+
+static void __exit g2_dma_exit(void)
+{
+	free_irq(HW_EVENT_G2_DMA, 0);
+}
+
+subsys_initcall(g2_dma_init);
+module_exit(g2_dma_exit);
+
+MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>");
+MODULE_DESCRIPTION("G2 bus DMA driver");
+MODULE_LICENSE("GPL");
+
diff -Nru a/arch/sh/drivers/dma/dma-isa.c b/arch/sh/drivers/dma/dma-isa.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/dma/dma-isa.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,93 @@
+/*
+ * arch/sh/drivers/dma/dma-isa.c
+ *
+ * Generic ISA DMA wrapper for SH DMA API
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */ 
+#include <linux/kernel.h>
+#include <asm/dma.h>
+
+/*
+ * This implements a small wrapper set to make code using the old ISA DMA API
+ * work with the SH DMA API. Since most of the work in the new API happens
+ * at ops->xfer() time, we simply use the various set_dma_xxx() routines to
+ * fill in per-channel info, and then hand hand this off to ops->xfer() at
+ * enable_dma() time.
+ *
+ * For channels that are doing on-demand data transfer via cascading, the
+ * channel itself will still need to be configured through the new API. As
+ * such, this code is meant for only the simplest of tasks (and shouldn't be
+ * used in any new drivers at all).
+ *
+ * It should also be noted that various functions here are labelled as
+ * being deprecated. This is due to the fact that the ops->xfer() method is
+ * the preferred way of doing things (as well as just grabbing the spinlock
+ * directly). As such, any users of this interface will be warned rather
+ * loudly.
+ */
+
+unsigned long __deprecated claim_dma_lock(void)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&dma_spin_lock, flags);
+
+	return flags;
+}
+
+void __deprecated release_dma_lock(unsigned long flags)
+{
+	spin_unlock_irqrestore(&dma_spin_lock, flags);
+}
+
+void __deprecated disable_dma(unsigned int chan)
+{
+	/* Nothing */
+}
+
+void __deprecated enable_dma(unsigned int chan)
+{
+	struct dma_info *info = get_dma_info(chan);
+
+	info->ops->xfer(info);
+}
+
+void clear_dma_ff(unsigned int chan)
+{
+	/* Nothing */
+}
+
+void set_dma_mode(unsigned int chan, char mode)
+{
+	struct dma_info *info = get_dma_info(chan);
+
+	info->mode = mode;
+}
+
+void set_dma_addr(unsigned int chan, unsigned int addr)
+{
+	struct dma_info *info = get_dma_info(chan);
+
+	/*
+	 * Single address mode is the only thing supported through
+	 * this interface.
+	 */
+	if ((info->mode & DMA_MODE_MASK) == DMA_MODE_READ) {
+		info->sar = addr;
+	} else {
+		info->dar = addr;
+	}
+}
+
+void set_dma_count(unsigned int chan, unsigned int count)
+{
+	struct dma_info *info = get_dma_info(chan);
+
+	info->count = count;
+}
+
diff -Nru a/arch/sh/drivers/dma/dma-pvr2.c b/arch/sh/drivers/dma/dma-pvr2.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/dma/dma-pvr2.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,111 @@
+/*
+ * arch/sh/boards/dreamcast/dma-pvr2.c
+ *
+ * NEC PowerVR 2 (Dreamcast) DMA support
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/interrupt.h>
+#include <asm/mach/sysasic.h>
+#include <asm/mach/dma.h>
+#include <asm/dma.h>
+#include <asm/io.h>
+
+static unsigned int xfer_complete = 0;
+static int count = 0;
+
+static irqreturn_t pvr2_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	if (get_dma_residue(PVR2_CASCADE_CHAN)) {
+		printk(KERN_WARNING "DMA: SH DMAC did not complete transfer "
+		       "on channel %d, waiting..\n", PVR2_CASCADE_CHAN);
+		dma_wait_for_completion(PVR2_CASCADE_CHAN);
+	}
+
+	if (count++ < 10)
+		pr_debug("Got a pvr2 dma interrupt for channel %d\n",
+			 irq - HW_EVENT_PVR2_DMA);
+
+	xfer_complete = 1;
+
+	return IRQ_HANDLED;
+}
+
+static int pvr2_request_dma(struct dma_info *info)
+{
+	if (ctrl_inl(PVR2_DMA_MODE) != 0)
+		return -EBUSY;
+
+	ctrl_outl(0, PVR2_DMA_LMMODE0);
+
+	return 0;
+}
+
+static int pvr2_get_dma_residue(struct dma_info *info)
+{
+	return xfer_complete == 0;
+}
+
+static int pvr2_xfer_dma(struct dma_info *info)
+{
+	if (info->sar || !info->dar)
+		return -EINVAL;
+
+	xfer_complete = 0;
+
+	ctrl_outl(info->dar, PVR2_DMA_ADDR);
+	ctrl_outl(info->count, PVR2_DMA_COUNT);
+	ctrl_outl(info->mode & DMA_MODE_MASK, PVR2_DMA_MODE);
+
+	return 0;
+}
+
+static struct irqaction pvr2_dma_irq = {
+	.name		= "pvr2 DMA handler",
+	.handler	= pvr2_dma_interrupt,
+	.flags		= SA_INTERRUPT,
+};
+
+static struct dma_ops pvr2_dma_ops = {
+	.name		= "PowerVR 2 DMA",
+	.request	= pvr2_request_dma,
+	.get_residue	= pvr2_get_dma_residue,
+	.xfer		= pvr2_xfer_dma,
+};
+
+static int __init pvr2_dma_init(void)
+{
+	int i, base;
+
+	setup_irq(HW_EVENT_PVR2_DMA, &pvr2_dma_irq);
+	request_dma(PVR2_CASCADE_CHAN, "pvr2 cascade");
+
+	/* PVR2 cascade comes after on-chip DMAC */
+	base = ONCHIP_NR_DMA_CHANNELS;
+
+	for (i = 0; i < PVR2_NR_DMA_CHANNELS; i++)
+		dma_info[base + i].ops = &pvr2_dma_ops;
+
+	return register_dmac(&pvr2_dma_ops);
+}
+
+static void __exit pvr2_dma_exit(void)
+{
+	free_dma(PVR2_CASCADE_CHAN);
+	free_irq(HW_EVENT_PVR2_DMA, 0);
+}
+
+subsys_initcall(pvr2_dma_init);
+module_exit(pvr2_dma_exit);
+
+MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>");
+MODULE_DESCRIPTION("NEC PowerVR 2 DMA driver");
+MODULE_LICENSE("GPL");
+
diff -Nru a/arch/sh/drivers/dma/dma-sh.c b/arch/sh/drivers/dma/dma-sh.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/dma/dma-sh.c	Tue Feb  3 19:45:42 2004
@@ -0,0 +1,271 @@
+/*
+ * arch/sh/kernel/cpu/dma.c
+ *
+ * Copyright (C) 2000 Takashi YOSHII
+ * Copyright (C) 2003 Paul Mundt
+ *
+ * PC like DMA API for SuperH's DMAC.
+ *
+ * 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.
+ */
+
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/module.h>
+#include <asm/signal.h>
+#include <asm/irq.h>
+#include <asm/dma.h>
+#include <asm/io.h>
+#include "dma-sh.h"
+
+/*
+ * The SuperH DMAC supports a number of transmit sizes, we list them here,
+ * with their respective values as they appear in the CHCR registers.
+ *
+ * Defaults to a 64-bit transfer size.
+ */
+enum {
+	XMIT_SZ_64BIT	= 0,
+	XMIT_SZ_8BIT	= 1,
+	XMIT_SZ_16BIT	= 2,
+	XMIT_SZ_32BIT	= 3,
+	XMIT_SZ_256BIT	= 4,
+};
+
+/*
+ * The DMA count is defined as the number of bytes to transfer.
+ */
+static unsigned int ts_shift[] = {
+	[XMIT_SZ_64BIT]		3,
+	[XMIT_SZ_8BIT]		0,
+	[XMIT_SZ_16BIT]		1,
+	[XMIT_SZ_32BIT]		2,
+	[XMIT_SZ_256BIT]	5,
+};
+
+struct sh_dmac_channel {
+        unsigned long sar;
+        unsigned long dar;
+        unsigned long dmatcr;
+        unsigned long chcr;
+} __attribute__ ((aligned(16)));
+
+struct sh_dmac_info {
+        struct sh_dmac_channel channel[MAX_DMAC_CHANNELS];
+        unsigned long dmaor;
+} __attribute__ ((packed));
+
+static volatile struct sh_dmac_info *sh_dmac = (volatile struct sh_dmac_info *)SH_DMAC_BASE;
+
+static inline unsigned int get_dmte_irq(unsigned int chan)
+{
+	unsigned int irq;
+
+	/* 
+	 * Normally we could just do DMTE0_IRQ + chan outright, though in the
+	 * case of the 7751R, the DMTE IRQs for channels > 4 start right above
+	 * the SCIF
+	 */
+
+	if (chan < 4) {
+		irq = DMTE0_IRQ + chan;
+	} else {
+		irq = DMTE4_IRQ + chan;
+	}
+
+	return irq;
+}
+
+static inline int get_dmte_chan(unsigned int irq)
+{
+	int chan;
+
+	if ((irq - DMTE4_IRQ) < 0) {
+		chan = irq - DMTE0_IRQ;
+	} else {
+		chan = irq - DMTE4_IRQ + 4;
+	}
+
+	return chan;
+}
+
+/*
+ * We determine the correct shift size based off of the CHCR transmit size
+ * for the given channel. Since we know that it will take:
+ *
+ * 	info->count >> ts_shift[transmit_size]
+ *
+ * iterations to complete the transfer.
+ */
+static inline unsigned int calc_xmit_shift(struct dma_info *info)
+{
+	return ts_shift[(sh_dmac->channel[info->chan].chcr >> 4) & 0x0007];
+}
+
+static irqreturn_t dma_tei(int irq, void *dev_id, struct pt_regs *regs)
+{
+	
+	int chan = get_dmte_chan(irq);
+	struct dma_info *info = get_dma_info(chan);
+
+	if (info->sar)
+		sh_dmac->channel[info->chan].sar = info->sar;
+	if (info->dar)
+		sh_dmac->channel[info->chan].sar = info->dar;
+
+	sh_dmac->channel[info->chan].dmatcr = info->count >> calc_xmit_shift(info);
+	sh_dmac->channel[info->chan].chcr &= ~CHCR_TE;
+
+	disable_irq(irq);
+
+	return IRQ_HANDLED;
+}
+
+static struct irqaction irq_tei = {
+	.name		= "DMAC Transfer End",
+	.handler	= dma_tei,
+	.flags		= SA_INTERRUPT,
+};
+
+static int sh_dmac_request_dma(struct dma_info *info)
+{
+	int irq = get_dmte_irq(info->chan);
+	char *p = (char *)((&irq_tei)->name);
+
+	sprintf(p, "%s (Channel %d)", p, info->chan);
+
+	make_ipr_irq(irq, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY);
+
+	return setup_irq(irq, &irq_tei);
+}
+
+static void sh_dmac_free_dma(struct dma_info *info)
+{
+	free_irq(get_dmte_irq(info->chan), 0);
+}
+
+static void sh_dmac_configure_channel(struct dma_info *info, unsigned long chcr)
+{
+	if (!chcr) {
+		chcr = sh_dmac->channel[info->chan].chcr;
+		chcr |= /* CHCR_IE | */ RS_DUAL;
+	}
+
+	sh_dmac->channel[info->chan].chcr = chcr;
+
+	info->configured = 1;
+}
+
+static void sh_dmac_enable_dma(struct dma_info *info)
+{
+	sh_dmac->channel[info->chan].chcr |= CHCR_DE;
+}
+
+static void sh_dmac_disable_dma(struct dma_info *info)
+{
+	sh_dmac->channel[info->chan].chcr &= ~(CHCR_DE | CHCR_TE);
+}
+
+static int sh_dmac_xfer_dma(struct dma_info *info)
+{
+	/* 
+	 * If we haven't pre-configured the channel with special flags, use
+	 * the defaults.
+	 */
+	if (!info->configured)
+		sh_dmac_configure_channel(info, 0);
+
+	sh_dmac_disable_dma(info);
+	
+	/* 
+	 * Single-address mode usage note!
+	 *
+	 * It's important that we don't accidentally write any value to SAR/DAR
+	 * (this includes 0) that hasn't been directly specified by the user if
+	 * we're in single-address mode.
+	 *
+	 * In this case, only one address can be defined, anything else will
+	 * result in a DMA address error interrupt (at least on the SH-4),
+	 * which will subsequently halt the transfer.
+	 */
+	if (info->sar)
+		sh_dmac->channel[info->chan].sar = info->sar;
+	if (info->dar)
+		sh_dmac->channel[info->chan].dar = info->dar;
+	
+	sh_dmac->channel[info->chan].dmatcr = info->count >> calc_xmit_shift(info);
+
+	sh_dmac_enable_dma(info);
+
+	return 0;
+}
+
+static int sh_dmac_get_dma_residue(struct dma_info *info)
+{
+	return sh_dmac->channel[info->chan].dmatcr << calc_xmit_shift(info);
+}
+
+#if defined(CONFIG_CPU_SH4)
+static irqreturn_t dma_err(int irq, void *dev_id, struct pt_regs *regs)
+{
+	printk("DMAE: DMAOR=%lx\n", sh_dmac->dmaor);
+
+	sh_dmac->dmaor &= ~(DMAOR_NMIF | DMAOR_AE);
+	sh_dmac->dmaor |= DMAOR_DME;
+
+	disable_irq(irq);
+
+	return IRQ_HANDLED;
+}
+
+static struct irqaction irq_err = {
+	.name		= "DMAC Address Error",
+	.handler	= dma_err,
+	.flags		= SA_INTERRUPT,
+};
+#endif
+
+static struct dma_ops sh_dmac_ops = {
+	.name		= "SuperH DMAC",
+	.request	= sh_dmac_request_dma,
+	.free		= sh_dmac_free_dma,
+	.get_residue	= sh_dmac_get_dma_residue,
+	.xfer		= sh_dmac_xfer_dma,
+	.configure	= sh_dmac_configure_channel,
+};
+	
+static int __init sh_dmac_init(void)
+{
+	int i;
+
+#ifdef CONFIG_CPU_SH4
+	make_ipr_irq(DMAE_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY);
+	setup_irq(DMAE_IRQ, &irq_err);
+#endif
+
+	/* Kick the DMAOR */
+	sh_dmac->dmaor |= DMAOR_DME /* | 0x200 */ | 0x8000;	/* DDT = 1, PR1 = 1, DME = 1 */
+	sh_dmac->dmaor &= ~(DMAOR_NMIF | DMAOR_AE);
+
+	for (i = 0; i < MAX_DMAC_CHANNELS; i++)
+		dma_info[i].ops  = &sh_dmac_ops;
+
+	return register_dmac(&sh_dmac_ops);
+}
+
+static void __exit sh_dmac_exit(void)
+{
+#ifdef CONFIG_CPU_SH4
+	free_irq(DMAE_IRQ, 0);
+#endif
+}
+
+subsys_initcall(sh_dmac_init);
+module_exit(sh_dmac_exit);
+
+MODULE_LICENSE("GPL");
+
diff -Nru a/arch/sh/drivers/dma/dma-sh.h b/arch/sh/drivers/dma/dma-sh.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/dma/dma-sh.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,48 @@
+/*
+ * arch/sh/drivers/dma/dma-sh.h
+ *
+ * Copyright (C) 2000  Takashi YOSHII
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __DMA_SH_H
+#define __DMA_SH_H
+
+/* Definitions for the SuperH DMAC */
+#define REQ_L	0x00000000
+#define REQ_E	0x00080000
+#define RACK_H	0x00000000
+#define RACK_L	0x00040000
+#define ACK_R	0x00000000
+#define ACK_W	0x00020000
+#define ACK_H	0x00000000
+#define ACK_L	0x00010000
+#define DM_INC	0x00004000
+#define DM_DEC	0x00008000
+#define SM_INC	0x00001000
+#define SM_DEC	0x00002000
+#define RS_DUAL	0x00000000
+#define RS_IN	0x00000200
+#define RS_OUT	0x00000300
+#define TM_BURST 0x0000080
+#define TS_8	0x00000010
+#define TS_16	0x00000020
+#define TS_32	0x00000030
+#define TS_64	0x00000000
+#define TS_BLK	0x00000040
+#define CHCR_DE 0x00000001
+#define CHCR_TE 0x00000002
+#define CHCR_IE 0x00000004
+
+#define DMAOR_COD	0x00000008
+#define DMAOR_AE	0x00000004
+#define DMAOR_NMIF	0x00000002
+#define DMAOR_DME	0x00000001
+
+#define MAX_DMAC_CHANNELS	(CONFIG_NR_ONCHIP_DMA_CHANNELS)
+
+#endif /* __DMA_SH_H */
+
diff -Nru a/arch/sh/drivers/pci/Kconfig b/arch/sh/drivers/pci/Kconfig
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/pci/Kconfig	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,46 @@
+config PCI
+	bool "PCI support"
+	help
+	  Find out whether you have a PCI motherboard. PCI is the name of a
+	  bus system, i.e. the way the CPU talks to the other stuff inside
+	  your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
+	  VESA. If you have PCI, say Y, otherwise N.
+
+	  The PCI-HOWTO, available from
+	  <http://www.tldp.org/docs.html#howto>, contains valuable
+	  information about which PCI hardware does work under Linux and which
+	  doesn't.
+
+config SH_PCIDMA_NONCOHERENT
+	bool "Cache and PCI noncoherent"
+	depends on PCI
+	help
+	  Enable this option if your platform does not have a CPU cache which
+	  remains coherent with PCI DMA. It is safest to say 'Y', although you
+	  will see better performance if you can say 'N', because the PCI DMA
+	  code will not have to flush the CPU's caches. If you have a PCI host
+	  bridge integrated with your SH CPU, refer carefully to the chip specs
+	  to see if you can say 'N' here. Otherwise, leave it as 'Y'.
+
+# This is also board-specific
+config PCI_AUTO
+	bool
+	depends on PCI
+	default y
+
+config PCI_AUTO_UPDATE_RESOURCES
+	bool
+	depends on PCI_AUTO
+	default y if !SH_DREAMCAST
+	help
+	  Selecting this option will cause the PCI auto code to leave your
+	  BAR values alone. Otherwise they will be updated automatically. If
+	  for some reason, you have a board that simply refuses to work
+	  with its resources updated beyond what they are when the device
+	  is powered up, set this to N. Everyone else will want this as Y.
+
+config PCI_DMA
+	bool
+	depends on PCI
+	default y if !SH_DREAMCAST
+
diff -Nru a/arch/sh/drivers/pci/Makefile b/arch/sh/drivers/pci/Makefile
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/pci/Makefile	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,16 @@
+#
+# Makefile for the PCI specific kernel interface routines under Linux.
+#
+
+obj-y					+= pci.o
+obj-$(CONFIG_PCI_AUTO)			+= pci-auto.o
+obj-$(CONFIG_PCI_DMA)			+= pci-dma.o
+
+obj-$(CONFIG_CPU_SUBTYPE_ST40STB1)	+= pci-st40.o
+obj-$(CONFIG_CPU_SUBTYPE_SH7751)	+= pci-sh7751.o 
+
+obj-$(CONFIG_SH_DREAMCAST)		+= ops-dreamcast.o fixups-dreamcast.o \
+					   dma-dreamcast.o
+obj-$(CONFIG_SH_SECUREEDGE5410)		+= ops-snapgear.o
+obj-$(CONFIG_SH_BIGSUR)			+= ops-bigsur.o
+
diff -Nru a/arch/sh/drivers/pci/dma-dreamcast.c b/arch/sh/drivers/pci/dma-dreamcast.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/pci/dma-dreamcast.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,61 @@
+/*
+ * arch/sh/pci/dma-dreamcast.c
+ *
+ * PCI DMA support for the Sega Dreamcast
+ *
+ * Copyright (C) 2001, 2002  M. R. Brown
+ * Copyright (C) 2002, 2003  Paul Mundt
+ *
+ * This file originally bore the message (with enclosed-$):
+ *	Id: pci.c,v 1.3 2003/05/04 19:29:46 lethal Exp
+ *	Dreamcast PCI: Supports SEGA Broadband Adaptor only.
+ *
+ * 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.
+ */
+
+#include <linux/config.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/param.h>
+#include <linux/interrupt.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/pci.h>
+
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mach/pci.h>
+
+static int gapspci_dma_used = 0;
+
+void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
+			   dma_addr_t * dma_handle)
+{
+	unsigned long buf;
+
+	if (gapspci_dma_used+size > GAPSPCI_DMA_SIZE)
+		return NULL;
+
+	buf = GAPSPCI_DMA_BASE+gapspci_dma_used;
+
+	gapspci_dma_used = PAGE_ALIGN(gapspci_dma_used+size);
+	
+	*dma_handle = (dma_addr_t)buf;
+
+	buf = P2SEGADDR(buf);
+
+	/* Flush the dcache before we hand off the buffer */
+	dma_cache_wback_inv((void *)buf, size);
+
+	return (void *)buf;
+}
+
+void pci_free_consistent(struct pci_dev *hwdev, size_t size,
+			 void *vaddr, dma_addr_t dma_handle)
+{
+	/* XXX */
+	gapspci_dma_used = 0;
+}
+
diff -Nru a/arch/sh/drivers/pci/fixups-dreamcast.c b/arch/sh/drivers/pci/fixups-dreamcast.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/pci/fixups-dreamcast.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,85 @@
+/*
+ * arch/sh/pci/fixups-dreamcast.c
+ *
+ * PCI fixups for the Sega Dreamcast
+ *
+ * Copyright (C) 2001, 2002  M. R. Brown
+ * Copyright (C) 2002, 2003  Paul Mundt
+ *
+ * This file originally bore the message (with enclosed-$):
+ *	Id: pci.c,v 1.3 2003/05/04 19:29:46 lethal Exp
+ *	Dreamcast PCI: Supports SEGA Broadband Adaptor only.
+ *
+ * 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.
+ */
+
+#include <linux/config.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/param.h>
+#include <linux/interrupt.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/pci.h>
+
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mach/pci.h>
+
+static void __init gapspci_fixup_resources(struct pci_dev *dev)
+{
+	struct pci_channel *p = board_pci_channels;
+
+	printk(KERN_NOTICE "PCI: Fixing up device %s\n", pci_name(dev));
+
+	switch (dev->device) {
+	case PCI_DEVICE_ID_SEGA_BBA:
+		/*
+		 * We also assume that dev->devfn == 0
+		 */
+		dev->resource[1].start	= p->io_resource->start  + 0x100;
+		dev->resource[1].end	= dev->resource[1].start + 0x200 - 1;
+		break;
+	default:
+		printk("PCI: Failed resource fixup\n");
+	}
+}
+
+struct pci_fixup pcibios_fixups[] = {
+	{ PCI_FIXUP_HEADER, PCI_ANY_ID,
+	  PCI_ANY_ID, gapspci_fixup_resources },
+	{ 0, }
+};
+
+void __init pcibios_fixup_bus(struct pci_bus *bus)
+{
+	/* 
+	 * We don't have any sub bus to fix up, and this is a rather
+	 * stupid place to put general device fixups. Don't do it.
+	 * Use the pcibios_fixups table or suffer the consequences.
+	 */
+}
+
+void __init pcibios_fixup_irqs(void)
+{
+	struct pci_dev *dev = 0;
+
+	while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+		/*
+		 * The interrupt routing semantics here are quite trivial.
+		 *
+		 * We basically only support one interrupt, so we only bother
+		 * updating a device's interrupt line with this single shared
+		 * interrupt. Keeps routing quite simple, doesn't it?
+		 */
+		printk(KERN_NOTICE "PCI: Fixing up IRQ routing for device %s\n",
+		       pci_name(dev));
+
+		dev->irq = GAPSPCI_IRQ;
+
+		pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
+	}
+}
+
diff -Nru a/arch/sh/drivers/pci/ops-bigsur.c b/arch/sh/drivers/pci/ops-bigsur.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/pci/ops-bigsur.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,88 @@
+/*
+ * linux/arch/sh/kernel/pci-bigsur.c
+ *
+ * By Dustin McIntire (dustin@sensoria.com) (c)2001
+ *
+ * Ported to new API by Paul Mundt <lethal@linux-sh.org>.
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ *
+ * PCI initialization for the Hitachi Big Sur Evaluation Board
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/pci.h>
+
+#include <asm/io.h>
+#include "pci-sh7751.h"
+#include <asm/bigsur/bigsur.h>
+
+#define BIGSUR_PCI_IO	0x4000
+#define BIGSUR_PCI_MEM	0xfd000000
+
+static struct resource sh7751_io_resource = {
+	.name		= "SH7751 IO",
+	.start		= BIGSUR_PCI_IO,
+	.end		= BIGSUR_PCI_IO + (64*1024) - 1,
+	.flags		= IORESOURCE_IO,
+};
+
+static struct resource sh7751_mem_resource = {
+	.name		= "SH7751 mem",
+	.start		= BIGSUR_PCI_MEM,
+	.end		= BIGSUR_PCI_MEM + (64*1024*1024) - 1,
+	.flags		= IORESOURCE_MEM,
+};
+
+extern struct pci_ops sh7751_pci_ops;
+
+struct pci_channel board_pci_channels[] = {
+	{ &sh7751_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
+	{ 0, }
+};
+
+static struct sh7751_pci_address_map sh7751_pci_map = {
+	.window0	= {
+		.base	= SH7751_CS3_BASE_ADDR,
+		.size	= BIGSUR_LSR0_SIZE,
+	},
+
+	.window1	= {
+		.base	= SH7751_CS3_BASE_ADDR,
+		.size	= BIGSUR_LSR1_SIZE,
+	},
+};
+
+/*
+ * Initialize the Big Sur PCI interface 
+ * Setup hardware to be Central Funtion
+ * Copy the BSR regs to the PCI interface
+ * Setup PCI windows into local RAM
+ */
+int __init pcibios_init_platform(void)
+{
+	return sh7751_pcic_init(&sh7751_pci_map);
+}
+
+int pcibios_map_platform_irq(u8 slot, u8 pin)
+{
+	/* 
+	 * The Big Sur can be used in a CPCI chassis, but the SH7751 PCI
+	 * interface is on the wrong end of the board so that it can also
+	 * support a V320 CPI interface chip...  Therefor the IRQ mapping is
+	 * somewhat use dependent... I'l assume a linear map for now, i.e.
+	 * INTA=slot0,pin0... INTD=slot3,pin0...
+	 */ 
+	int irq = (slot + pin-1) % 4 + BIGSUR_SH7751_PCI_IRQ_BASE;
+
+	PCIDBG(2, "PCI: Mapping Big Sur IRQ for slot %d, pin %c to irq %d\n",
+	       slot, pin-1+'A', irq);
+
+	return irq;
+}
+
diff -Nru a/arch/sh/drivers/pci/ops-dreamcast.c b/arch/sh/drivers/pci/ops-dreamcast.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/pci/ops-dreamcast.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,169 @@
+/*
+ * arch/sh/pci/ops-dreamcast.c
+ *
+ * PCI operations for the Sega Dreamcast
+ *
+ * Copyright (C) 2001, 2002  M. R. Brown
+ * Copyright (C) 2002, 2003  Paul Mundt
+ *
+ * This file originally bore the message (with enclosed-$):
+ *	Id: pci.c,v 1.3 2003/05/04 19:29:46 lethal Exp
+ *	Dreamcast PCI: Supports SEGA Broadband Adaptor only.
+ *
+ * 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.
+ */
+
+#include <linux/config.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/param.h>
+#include <linux/interrupt.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/pci.h>
+
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mach/pci.h>
+
+static struct resource gapspci_io_resource = {
+	.name	= "GAPSPCI IO",
+	.start	= GAPSPCI_BBA_CONFIG,
+	.end	= GAPSPCI_BBA_CONFIG + GAPSPCI_BBA_CONFIG_SIZE - 1,
+	.flags	= IORESOURCE_IO,
+};
+
+static struct resource gapspci_mem_resource = {
+	.name	= "GAPSPCI mem",
+	.start	= GAPSPCI_DMA_BASE,
+	.end	= GAPSPCI_DMA_BASE + GAPSPCI_DMA_SIZE - 1,
+	.flags	= IORESOURCE_MEM,
+};
+
+static struct pci_ops gapspci_pci_ops;
+
+struct pci_channel board_pci_channels[] = {
+	{ &gapspci_pci_ops, &gapspci_io_resource,
+	  &gapspci_mem_resource, 0, 1 },
+	{ 0, }
+};
+
+/*
+ * The !gapspci_config_access case really shouldn't happen, ever, unless
+ * someone implicitly messes around with the last devfn value.. otherwise we
+ * only support a single device anyways, and if we didn't have a BBA, we
+ * wouldn't make it terribly far through the PCI setup anyways.
+ *
+ * Also, we could very easily support both Type 0 and Type 1 configurations
+ * here, but since it doesn't seem that there is any such implementation in
+ * existance, we don't bother.
+ *
+ * I suppose if someone actually gets around to ripping the chip out of
+ * the BBA and hanging some more devices off of it, then this might be
+ * something to take into consideration. However, due to the cost of the BBA,
+ * and the general lack of activity by DC hardware hackers, this doesn't seem
+ * likely to happen anytime soon.
+ */
+static int gapspci_config_access(unsigned char bus, unsigned int devfn)
+{
+	return (bus == 0) && (devfn == 0);
+}
+
+/*
+ * We can also actually read and write in b/w/l sizes! Thankfully this part
+ * was at least done right, and we don't have to do the stupid masking and
+ * shifting that we do on the 7751! Small wonders never cease to amaze.
+ */
+static int gapspci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val)
+{
+	*val = 0xffffffff;
+
+	if (!gapspci_config_access(bus->number, devfn))
+		return PCIBIOS_DEVICE_NOT_FOUND;
+
+	switch (size) {
+		case 1: *val = inb(GAPSPCI_BBA_CONFIG+where); break;
+		case 2: *val = inw(GAPSPCI_BBA_CONFIG+where); break;
+		case 4: *val = inl(GAPSPCI_BBA_CONFIG+where); break;
+	}	
+
+        return PCIBIOS_SUCCESSFUL;
+}
+
+static int gapspci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val)
+{
+	if (!gapspci_config_access(bus->number, devfn))
+		return PCIBIOS_DEVICE_NOT_FOUND;
+
+	switch (size) {
+		case 1: outb(( u8)val, GAPSPCI_BBA_CONFIG+where); break;
+		case 2: outw((u16)val, GAPSPCI_BBA_CONFIG+where); break;
+		case 4: outl((u32)val, GAPSPCI_BBA_CONFIG+where); break;
+	}
+
+        return PCIBIOS_SUCCESSFUL;
+}
+
+static struct pci_ops gapspci_pci_ops = {
+	.read	= gapspci_read,
+	.write	= gapspci_write,
+};
+
+/*
+ * gapspci init
+ */
+
+int __init gapspci_init(void)
+{
+	char idbuf[16];
+	int i;
+
+	/*
+	 * FIXME: All of this wants documenting to some degree,
+	 * even some basic register definitions would be nice.
+	 *
+	 * I haven't seen anything this ugly since.. maple.
+	 */
+
+	for (i=0; i<16; i++)
+		idbuf[i] = inb(GAPSPCI_REGS+i);
+
+	if (strncmp(idbuf, "GAPSPCI_BRIDGE_2", 16))
+		return -ENODEV;
+
+	outl(0x5a14a501, GAPSPCI_REGS+0x18);
+
+	for (i=0; i<1000000; i++)
+		;
+
+	if (inl(GAPSPCI_REGS+0x18) != 1)
+		return -EINVAL;
+
+	outl(0x01000000, GAPSPCI_REGS+0x20);
+	outl(0x01000000, GAPSPCI_REGS+0x24);
+
+	outl(GAPSPCI_DMA_BASE, GAPSPCI_REGS+0x28);
+	outl(GAPSPCI_DMA_BASE+GAPSPCI_DMA_SIZE, GAPSPCI_REGS+0x2c);
+
+	outl(1, GAPSPCI_REGS+0x14);
+	outl(1, GAPSPCI_REGS+0x34);
+
+	/* Setting Broadband Adapter */
+	outw(0xf900, GAPSPCI_BBA_CONFIG+0x06);
+	outl(0x00000000, GAPSPCI_BBA_CONFIG+0x30);
+	outb(0x00, GAPSPCI_BBA_CONFIG+0x3c);
+	outb(0xf0, GAPSPCI_BBA_CONFIG+0x0d);
+	outw(0x0006, GAPSPCI_BBA_CONFIG+0x04);
+	outl(0x00002001, GAPSPCI_BBA_CONFIG+0x10);
+	outl(0x01000000, GAPSPCI_BBA_CONFIG+0x14);
+
+	return 0;
+}
+
+/* Haven't done anything here as yet */
+char * __devinit pcibios_setup(char *str)
+{
+	return str;
+}
diff -Nru a/arch/sh/drivers/pci/ops-snapgear.c b/arch/sh/drivers/pci/ops-snapgear.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/pci/ops-snapgear.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,100 @@
+/*
+ * arch/sh/drivers/pci/ops-snapgear.c
+ *
+ * Author:  David McCullough <davidm@snapgear.com>
+ * 
+ * Ported to new API by Paul Mundt <lethal@linux-sh.org>
+ *
+ * Highly leveraged from pci-bigsur.c, written by Dustin McIntire.
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ *
+ * PCI initialization for the SnapGear boards
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/pci.h>
+
+#include <asm/io.h>
+#include "pci-sh7751.h"
+
+#define SNAPGEAR_PCI_IO		0x4000
+#define SNAPGEAR_PCI_MEM	0xfd000000
+
+/* PCI: default LOCAL memory window sizes (seen from PCI bus) */
+#define SNAPGEAR_LSR0_SIZE    (64*(1<<20)) //64MB
+#define SNAPGEAR_LSR1_SIZE    (64*(1<<20)) //64MB
+
+static struct resource sh7751_io_resource = {
+	.name		= "SH7751 IO",
+	.start		= SNAPGEAR_PCI_IO,
+	.end		= SNAPGEAR_PCI_IO + (64*1024) - 1, /* 64KiB I/O */
+	.flags		= IORESOURCE_IO,
+};
+
+static struct resource sh7751_mem_resource = {
+	.name		= "SH7751 mem",
+	.start		= SNAPGEAR_PCI_MEM,
+	.end		= SNAPGEAR_PCI_MEM + (64*1024*1024) - 1, /* 64MiB mem */
+	.flags		= IORESOURCE_MEM,
+};
+
+extern struct pci_ops sh7751_pci_ops;
+
+struct pci_channel board_pci_channels[] = {
+	{ &sh7751_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
+	{ 0, }
+};
+
+static struct sh7751_pci_address_map sh7751_pci_map = {
+	.window0	= {
+		.base	= SH7751_CS2_BASE_ADDR,
+		.size	= SNAPGEAR_LSR0_SIZE,
+	},
+
+	.window1	= {
+		.base	= SH7751_CS2_BASE_ADDR,
+		.size	= SNAPGEAR_LSR1_SIZE,
+	},
+};
+
+/*
+ * Initialize the SnapGear PCI interface 
+ * Setup hardware to be Central Funtion
+ * Copy the BSR regs to the PCI interface
+ * Setup PCI windows into local RAM
+ */
+int __init pcibios_init_platform(void)
+{
+	return sh7751_pcic_init(&sh7751_pci_map);
+}
+
+int __init pcibios_map_platform_irq(u8 slot, u8 pin)
+{
+	int irq = -1;
+
+	switch (slot) {
+	case 8:  /* the PCI bridge */ break;
+	case 11: irq = 8;  break; /* USB    */
+	case 12: irq = 11; break; /* PCMCIA */
+	case 13: irq = 5;  break; /* eth0   */
+	case 14: irq = 8;  break; /* eth1   */
+	case 15: irq = 11; break; /* safenet (unused) */
+	}
+
+	printk("PCI: Mapping SnapGear IRQ for slot %d, pin %c to irq %d\n",
+	       slot, pin - 1 + 'A', irq);
+
+	return irq;
+}
+
+void __init pcibios_fixup(void)
+{
+	/* Nothing to fixup .. */
+}
+
diff -Nru a/arch/sh/drivers/pci/pci-auto.c b/arch/sh/drivers/pci/pci-auto.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/pci/pci-auto.c	Tue Feb  3 19:45:42 2004
@@ -0,0 +1,534 @@
+/*
+ * PCI autoconfiguration library
+ *
+ * Author: Matt Porter <mporter@mvista.com>
+ *
+ * Copyright 2000, 2001 MontaVista Software Inc.
+ * Copyright 2001 Bradley D. LaRonde <brad@ltc.com>
+ * Copyright 2003 Paul Mundt <lethal@linux-sh.org>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+/*
+ * Modified for MIPS by Jun Sun, jsun@mvista.com
+ *
+ * . Simplify the interface between pci_auto and the rest: a single function.
+ * . Assign resources from low address to upper address.
+ * . change most int to u32.
+ *
+ * Further modified to include it as mips generic code, ppopov@mvista.com.
+ *
+ * 2001-10-26  Bradley D. LaRonde <brad@ltc.com>
+ * - Add a top_bus argument to the "early config" functions so that
+ *   they can set a fake parent bus pointer to convince the underlying
+ *   pci ops to use type 1 configuration for sub busses.
+ * - Set bridge base and limit registers correctly.
+ * - Align io and memory base properly before and after bridge setup.
+ * - Don't fall through to pci_setup_bars for bridge.
+ * - Reformat the debug output to look more like lspci's output.
+ *
+ * Cloned for SuperH by M. R. Brown, mrbrown@0xd6.org
+ *
+ * 2003-08-05  Paul Mundt <lethal@linux-sh.org>
+ * - Don't update the BAR values on systems that already have valid addresses
+ *   and don't want these updated for whatever reason, by way of a new config
+ *   option check. However, we still read in the old BAR values so that they
+ *   can still be reported through the debug output.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+
+#define	DEBUG
+#ifdef 	DEBUG
+#define	DBG(x...)	printk(x)
+#else
+#define	DBG(x...)	
+#endif
+
+/*
+ * These functions are used early on before PCI scanning is done
+ * and all of the pci_dev and pci_bus structures have been created.
+ */
+static struct pci_dev *fake_pci_dev(struct pci_channel *hose,
+	int top_bus, int busnr, int devfn)
+{
+	static struct pci_dev dev;
+	static struct pci_bus bus;
+
+	dev.bus = &bus;
+	dev.sysdata = hose;
+	dev.devfn = devfn;
+	bus.number = busnr;
+	bus.ops = hose->pci_ops;
+
+	if(busnr != top_bus)
+		/* Fake a parent bus structure. */
+		bus.parent = &bus;
+	else
+		bus.parent = NULL;
+
+	return &dev;
+}
+
+#define EARLY_PCI_OP(rw, size, type)					\
+int early_##rw##_config_##size(struct pci_channel *hose,		\
+	int top_bus, int bus, int devfn, int offset, type value)	\
+{									\
+	return pci_##rw##_config_##size(				\
+		fake_pci_dev(hose, top_bus, bus, devfn),		\
+		offset, value);						\
+}
+
+EARLY_PCI_OP(read, byte, u8 *)
+EARLY_PCI_OP(read, word, u16 *)
+EARLY_PCI_OP(read, dword, u32 *)
+EARLY_PCI_OP(write, byte, u8)
+EARLY_PCI_OP(write, word, u16)
+EARLY_PCI_OP(write, dword, u32)
+
+static struct resource *io_resource_inuse;
+static struct resource *mem_resource_inuse;
+
+static u32 pciauto_lower_iospc;
+static u32 pciauto_upper_iospc;
+
+static u32 pciauto_lower_memspc;
+static u32 pciauto_upper_memspc;
+
+static void __init 
+pciauto_setup_bars(struct pci_channel *hose,
+		   int top_bus,
+		   int current_bus,
+		   int pci_devfn)
+{
+	u32 bar_response, bar_size, bar_value;
+	u32 bar, addr_mask, bar_nr = 0;
+	u32 * upper_limit;
+	u32 * lower_limit;
+	int found_mem64 = 0;
+
+	for (bar = PCI_BASE_ADDRESS_0; bar <= PCI_BASE_ADDRESS_5; bar+=4) {
+		u32 bar_addr;
+
+		/* Read the old BAR value */
+		early_read_config_dword(hose, top_bus,
+					current_bus,
+					pci_devfn,
+					bar,
+					&bar_addr);
+
+		/* Tickle the BAR and get the response */
+		early_write_config_dword(hose, top_bus,
+					 current_bus,
+					 pci_devfn,
+					 bar,
+					 0xffffffff);
+
+		early_read_config_dword(hose, top_bus,
+					current_bus,
+					pci_devfn,
+					bar,
+					&bar_response);
+
+		/* 
+		 * Write the old BAR value back out, only update the BAR
+		 * if we implicitly want resources to be updated, which
+		 * is done by the generic code further down. -- PFM.
+		 */
+		early_write_config_dword(hose, top_bus,
+					 current_bus,
+					 pci_devfn,
+					 bar,
+					 bar_addr);
+
+		/* If BAR is not implemented go to the next BAR */
+		if (!bar_response)
+			continue;
+
+		/*
+		 * Workaround for a BAR that doesn't use its upper word,
+		 * like the ALi 1535D+ PCI DC-97 Controller Modem (M5457).
+		 * bdl <brad@ltc.com>
+		 */
+		if (!(bar_response & 0xffff0000))
+			bar_response |= 0xffff0000;
+
+retry:
+		/* Check the BAR type and set our address mask */
+		if (bar_response & PCI_BASE_ADDRESS_SPACE) {
+			addr_mask = PCI_BASE_ADDRESS_IO_MASK;
+			upper_limit = &pciauto_upper_iospc;
+			lower_limit = &pciauto_lower_iospc;
+			DBG("        I/O");
+		} else {
+			if ((bar_response & PCI_BASE_ADDRESS_MEM_TYPE_MASK) ==
+			    PCI_BASE_ADDRESS_MEM_TYPE_64)
+				found_mem64 = 1;
+
+			addr_mask = PCI_BASE_ADDRESS_MEM_MASK;		
+			upper_limit = &pciauto_upper_memspc;
+			lower_limit = &pciauto_lower_memspc;
+			DBG("        Mem");
+		}
+
+
+		/* Calculate requested size */
+		bar_size = ~(bar_response & addr_mask) + 1;
+
+		/* Allocate a base address */
+		bar_value = ((*lower_limit - 1) & ~(bar_size - 1)) + bar_size;
+
+		if ((bar_value + bar_size) > *upper_limit) {
+			if (bar_response & PCI_BASE_ADDRESS_SPACE) {
+				if (io_resource_inuse->child) {
+					io_resource_inuse = 
+						io_resource_inuse->child;
+					pciauto_lower_iospc = 
+						io_resource_inuse->start;
+					pciauto_upper_iospc = 
+						io_resource_inuse->end + 1;
+					goto retry;
+				}
+
+			} else {
+				if (mem_resource_inuse->child) {
+					mem_resource_inuse = 
+						mem_resource_inuse->child;
+					pciauto_lower_memspc = 
+						mem_resource_inuse->start;
+					pciauto_upper_memspc = 
+						mem_resource_inuse->end + 1;
+					goto retry;
+				}
+			}
+			DBG(" unavailable -- skipping, value %x size %x\n",
+					bar_value, bar_size);
+			continue;
+		}
+
+#ifdef CONFIG_PCI_AUTO_UPDATE_RESOURCES
+		/* Write it out and update our limit */
+		early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
+					 bar, bar_value);
+#endif
+
+		*lower_limit = bar_value + bar_size;
+
+		/*
+		 * If we are a 64-bit decoder then increment to the
+		 * upper 32 bits of the bar and force it to locate
+		 * in the lower 4GB of memory.
+		 */ 
+		if (found_mem64) {
+			bar += 4;
+			early_write_config_dword(hose, top_bus,
+						 current_bus,
+						 pci_devfn,
+						 bar,
+						 0x00000000);
+		}
+
+		DBG(" at 0x%.8x [size=0x%x]\n", bar_value, bar_size);
+
+		bar_nr++;
+	}
+
+}
+
+static void __init
+pciauto_prescan_setup_bridge(struct pci_channel *hose,
+			     int top_bus,
+			     int current_bus,
+			     int pci_devfn,
+			     int sub_bus)
+{
+	/* Configure bus number registers */
+	early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
+	                        PCI_PRIMARY_BUS, current_bus);
+	early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
+				PCI_SECONDARY_BUS, sub_bus + 1);
+	early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
+				PCI_SUBORDINATE_BUS, 0xff);
+
+	/* Align memory and I/O to 1MB and 4KB boundaries. */
+	pciauto_lower_memspc = (pciauto_lower_memspc + (0x100000 - 1))
+		& ~(0x100000 - 1);
+	pciauto_lower_iospc = (pciauto_lower_iospc + (0x1000 - 1))
+		& ~(0x1000 - 1);
+
+	/* Set base (lower limit) of address range behind bridge. */
+	early_write_config_word(hose, top_bus, current_bus, pci_devfn,
+		PCI_MEMORY_BASE, pciauto_lower_memspc >> 16);
+	early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
+		PCI_IO_BASE, (pciauto_lower_iospc & 0x0000f000) >> 8);
+	early_write_config_word(hose, top_bus, current_bus, pci_devfn,
+		PCI_IO_BASE_UPPER16, pciauto_lower_iospc >> 16);
+
+	/* We don't support prefetchable memory for now, so disable */
+	early_write_config_word(hose, top_bus, current_bus, pci_devfn,
+				PCI_PREF_MEMORY_BASE, 0);
+	early_write_config_word(hose, top_bus, current_bus, pci_devfn,
+				PCI_PREF_MEMORY_LIMIT, 0);
+}
+
+static void __init
+pciauto_postscan_setup_bridge(struct pci_channel *hose,
+			      int top_bus,
+			      int current_bus,
+			      int pci_devfn,
+			      int sub_bus)
+{
+	u32 temp;
+
+	pciauto_lower_memspc += 1;
+	pciauto_lower_iospc += 1;
+
+	/* Configure bus number registers */
+	early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
+				PCI_SUBORDINATE_BUS, sub_bus);
+
+	/* Set upper limit of address range behind bridge. */
+	early_write_config_word(hose, top_bus, current_bus, pci_devfn,
+		PCI_MEMORY_LIMIT, pciauto_lower_memspc >> 16);
+	early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
+		PCI_IO_LIMIT, (pciauto_lower_iospc & 0x0000f000) >> 8);
+	early_write_config_word(hose, top_bus, current_bus, pci_devfn,
+		PCI_IO_LIMIT_UPPER16, pciauto_lower_iospc >> 16);
+
+	/* Align memory and I/O to 1MB and 4KB boundaries. */
+	pciauto_lower_memspc = (pciauto_lower_memspc + (0x100000 - 1))
+		& ~(0x100000 - 1);
+	pciauto_lower_iospc = (pciauto_lower_iospc + (0x1000 - 1))
+		& ~(0x1000 - 1);
+
+	/* Enable memory and I/O accesses, enable bus master */
+	early_read_config_dword(hose, top_bus, current_bus, pci_devfn,
+		PCI_COMMAND, &temp);
+	early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
+		PCI_COMMAND, temp | PCI_COMMAND_IO | PCI_COMMAND_MEMORY
+		| PCI_COMMAND_MASTER);
+}
+
+static void __init
+pciauto_prescan_setup_cardbus_bridge(struct pci_channel *hose,
+                            int top_bus,
+                            int current_bus,
+                            int pci_devfn,
+                            int sub_bus)
+{
+       /* Configure bus number registers */
+       early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
+                               PCI_PRIMARY_BUS, current_bus);
+       early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
+                               PCI_SECONDARY_BUS, sub_bus + 1);
+       early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
+                               PCI_SUBORDINATE_BUS, 0xff);
+
+       /* Align memory and I/O to 4KB and 4 byte boundaries. */
+       pciauto_lower_memspc = (pciauto_lower_memspc + (0x1000 - 1))
+               & ~(0x1000 - 1);
+       pciauto_lower_iospc = (pciauto_lower_iospc + (0x4 - 1))
+               & ~(0x4 - 1);
+
+       early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
+               PCI_CB_MEMORY_BASE_0, pciauto_lower_memspc);
+       early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
+               PCI_CB_IO_BASE_0, pciauto_lower_iospc);  
+}
+
+static void __init
+pciauto_postscan_setup_cardbus_bridge(struct pci_channel *hose,
+                             int top_bus,
+                             int current_bus,
+                             int pci_devfn,
+                             int sub_bus)
+{
+       u32 temp;
+
+       /* 
+        * [jsun] we always bump up baselines a little, so that if there 
+        * nothing behind P2P bridge, we don't wind up overlapping IO/MEM 
+        * spaces.
+        */
+       pciauto_lower_memspc += 1;
+       pciauto_lower_iospc += 1;
+
+       /*
+        * Configure subordinate bus number.  The PCI subsystem
+        * bus scan will renumber buses (reserving three additional
+        * for this PCI<->CardBus bridge for the case where a CardBus
+        * adapter contains a P2P or CB2CB bridge.
+        */
+
+       early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
+                               PCI_SUBORDINATE_BUS, sub_bus);
+
+       /*
+        * Reserve an additional 4MB for mem space and 16KB for
+        * I/O space.  This should cover any additional space
+        * requirement of unusual CardBus devices with 
+        * additional bridges that can consume more address space.
+        * 
+        * Although pcmcia-cs currently will reprogram bridge
+        * windows, the goal is to add an option to leave them
+        * alone and use the bridge window ranges as the regions
+        * that are searched for free resources upon hot-insertion
+        * of a device.  This will allow a PCI<->CardBus bridge
+        * configured by this routine to happily live behind a
+        * P2P bridge in a system.
+        */
+
+       /* Align memory and I/O to 4KB and 4 byte boundaries. */
+       pciauto_lower_memspc = (pciauto_lower_memspc + (0x1000 - 1))
+               & ~(0x1000 - 1);
+       pciauto_lower_iospc = (pciauto_lower_iospc + (0x4 - 1))
+               & ~(0x4 - 1);
+       /* Set up memory and I/O filter limits, assume 32-bit I/O space */
+       early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
+               PCI_CB_MEMORY_LIMIT_0, pciauto_lower_memspc - 1); 
+       early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
+               PCI_CB_IO_LIMIT_0, pciauto_lower_iospc - 1);
+       
+       /* Enable memory and I/O accesses, enable bus master */
+       early_read_config_dword(hose, top_bus, current_bus, pci_devfn,
+               PCI_COMMAND, &temp);
+       early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
+               PCI_COMMAND, temp | PCI_COMMAND_IO | PCI_COMMAND_MEMORY
+               | PCI_COMMAND_MASTER);
+}
+
+#define      PCIAUTO_IDE_MODE_MASK           0x05
+
+static int __init
+pciauto_bus_scan(struct pci_channel *hose, int top_bus, int current_bus)
+{
+	int sub_bus;
+	u32 pci_devfn, pci_class, cmdstat, found_multi=0;
+	unsigned short vid, did;
+	unsigned char header_type;
+	int devfn_start = 0;
+	int devfn_stop = 0xff;
+
+	sub_bus = current_bus;
+	
+	if (hose->first_devfn)
+		devfn_start = hose->first_devfn;
+	if (hose->last_devfn)
+		devfn_stop = hose->last_devfn;
+	
+	for (pci_devfn=devfn_start; pci_devfn<devfn_stop; pci_devfn++) {
+
+		if (PCI_FUNC(pci_devfn) && !found_multi)
+			continue;
+
+		early_read_config_word(hose, top_bus, current_bus, pci_devfn,
+				       PCI_VENDOR_ID, &vid);
+
+		if (vid == 0xffff) continue;
+
+		early_read_config_byte(hose, top_bus, current_bus, pci_devfn,
+				       PCI_HEADER_TYPE, &header_type);
+
+		if (!PCI_FUNC(pci_devfn))
+			found_multi = header_type & 0x80;
+
+		early_read_config_word(hose, top_bus, current_bus, pci_devfn,
+				       PCI_DEVICE_ID, &did);
+
+		early_read_config_dword(hose, top_bus, current_bus, pci_devfn,
+					PCI_CLASS_REVISION, &pci_class);
+
+		DBG("%.2x:%.2x.%x Class %.4x: %.4x:%.4x",
+			current_bus, PCI_SLOT(pci_devfn), PCI_FUNC(pci_devfn),
+			pci_class >> 16, vid, did);
+		if (pci_class & 0xff)
+			DBG(" (rev %.2x)", pci_class & 0xff);
+		DBG("\n");
+
+		if ((pci_class >> 16) == PCI_CLASS_BRIDGE_PCI) {
+			DBG("        Bridge: primary=%.2x, secondary=%.2x\n",
+				current_bus, sub_bus + 1);
+			pciauto_prescan_setup_bridge(hose, top_bus, current_bus,
+						     pci_devfn, sub_bus);
+			DBG("Scanning sub bus %.2x, I/O 0x%.8x, Mem 0x%.8x\n",
+				sub_bus + 1,
+				pciauto_lower_iospc, pciauto_lower_memspc);
+			sub_bus = pciauto_bus_scan(hose, top_bus, sub_bus+1);
+			DBG("Back to bus %.2x\n", current_bus);
+			pciauto_postscan_setup_bridge(hose, top_bus, current_bus,
+						      pci_devfn, sub_bus);
+			continue;
+                } else if ((pci_class >> 16) == PCI_CLASS_BRIDGE_CARDBUS) {
+                        DBG("  CARDBUS  Bridge: primary=%.2x, secondary=%.2x\n",
+                                current_bus, sub_bus + 1);
+                        DBG("PCI Autoconfig: Found CardBus bridge, device %d function %d\n", PCI_SLOT(pci_devfn), PCI_FUNC(pci_devfn));
+                        /* Place CardBus Socket/ExCA registers */
+                        pciauto_setup_bars(hose, top_bus, current_bus, pci_devfn);
+ 
+                        pciauto_prescan_setup_cardbus_bridge(hose, top_bus, 
+                                        current_bus, pci_devfn, sub_bus);
+ 
+                        DBG("Scanning sub bus %.2x, I/O 0x%.8x, Mem 0x%.8x\n",
+                                sub_bus + 1,
+                                pciauto_lower_iospc, pciauto_lower_memspc);
+                        sub_bus = pciauto_bus_scan(hose, top_bus, sub_bus+1);
+                        DBG("Back to bus %.2x, sub_bus is %x\n", current_bus, sub_bus);
+                        pciauto_postscan_setup_cardbus_bridge(hose, top_bus, 
+                                        current_bus, pci_devfn, sub_bus);
+                        continue;
+		} else if ((pci_class >> 16) == PCI_CLASS_STORAGE_IDE) {
+
+			unsigned char prg_iface;
+
+			early_read_config_byte(hose, top_bus, current_bus,
+				pci_devfn, PCI_CLASS_PROG, &prg_iface);
+			if (!(prg_iface & PCIAUTO_IDE_MODE_MASK)) {
+				DBG("Skipping legacy mode IDE controller\n");
+				continue;
+			}
+		}
+
+ 		/*
+		 * Found a peripheral, enable some standard
+		 * settings
+		 */
+		early_read_config_dword(hose, top_bus, current_bus, pci_devfn,
+					PCI_COMMAND, &cmdstat);
+		early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
+					 PCI_COMMAND, cmdstat | PCI_COMMAND_IO |
+					 PCI_COMMAND_MEMORY |
+					 PCI_COMMAND_MASTER);
+		early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
+					PCI_LATENCY_TIMER, 0x80);
+
+		/* Allocate PCI I/O and/or memory space */
+		pciauto_setup_bars(hose, top_bus, current_bus, pci_devfn);
+	}
+	return sub_bus;
+}
+
+int __init
+pciauto_assign_resources(int busno, struct pci_channel *hose)
+{
+	/* setup resource limits */
+	io_resource_inuse = hose->io_resource;
+	mem_resource_inuse = hose->mem_resource;
+
+	pciauto_lower_iospc = io_resource_inuse->start;
+	pciauto_upper_iospc = io_resource_inuse->end + 1;
+	pciauto_lower_memspc = mem_resource_inuse->start;
+	pciauto_upper_memspc = mem_resource_inuse->end + 1;
+	DBG("Autoconfig PCI channel 0x%p\n", hose);
+	DBG("Scanning bus %.2x, I/O 0x%.8x:0x%.8x, Mem 0x%.8x:0x%.8x\n",
+		busno, pciauto_lower_iospc, pciauto_upper_iospc, 
+		pciauto_lower_memspc, pciauto_upper_memspc);
+
+	return pciauto_bus_scan(hose, busno, busno);
+}
diff -Nru a/arch/sh/drivers/pci/pci-dma.c b/arch/sh/drivers/pci/pci-dma.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/pci/pci-dma.c	Tue Feb  3 19:45:35 2004
@@ -0,0 +1,42 @@
+/* 
+ * Copyright (C) 2001 David J. Mckay (david.mckay@st.com)
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.                            
+ *
+ * Dynamic DMA mapping support.
+ */
+
+#include <linux/types.h>
+#include <linux/mm.h>
+#include <linux/string.h>
+#include <linux/pci.h>
+#include <asm/io.h>
+#include <asm/addrspace.h>
+
+
+void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
+			   dma_addr_t * dma_handle)
+{
+	void *ret;
+	int gfp = GFP_ATOMIC;
+
+	ret = (void *) __get_free_pages(gfp, get_order(size));
+
+	if (ret != NULL) {
+	        /* Is it necessary to do the memset? */
+		memset(ret, 0, size);
+		*dma_handle = virt_to_phys(ret);
+	}
+	/* We must flush the cache before we pass it on to the device */
+	dma_cache_wback_inv(ret, size);
+	return  P2SEGADDR(ret);
+}
+
+void pci_free_consistent(struct pci_dev *hwdev, size_t size,
+			 void *vaddr, dma_addr_t dma_handle)
+{
+        unsigned long p1addr=P1SEGADDR((unsigned long)vaddr);
+
+	free_pages(p1addr, get_order(size));
+}
diff -Nru a/arch/sh/drivers/pci/pci-sh7751.c b/arch/sh/drivers/pci/pci-sh7751.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/pci/pci-sh7751.c	Tue Feb  3 19:45:37 2004
@@ -0,0 +1,414 @@
+/*
+ *	Low-Level PCI Support for the SH7751
+ *
+ *  Dustin McIntire (dustin@sensoria.com)
+ *	Derived from arch/i386/kernel/pci-*.c which bore the message:
+ *	(c) 1999--2000 Martin Mares <mj@ucw.cz>
+ *
+ *  Ported to the new API by Paul Mundt <lethal@linux-sh.org>
+ *  With cleanup by Paul van Gool <pvangool@mimotech.com>
+ *
+ *  May be copied or modified under the terms of the GNU General Public
+ *  License.  See linux/COPYING for more information.
+ *
+ */
+
+#undef DEBUG
+
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <linux/sched.h>
+#include <linux/ioport.h>
+#include <linux/errno.h>
+#include <linux/irq.h>
+#include <linux/delay.h>
+
+#include <asm/machvec.h>
+#include <asm/io.h>
+#include "pci-sh7751.h"
+
+static unsigned int pci_probe = PCI_PROBE_CONF1;
+
+/*
+ * Direct access to PCI hardware...
+ */
+
+#define CONFIG_CMD(bus, devfn, where) (0x80000000 | (bus->number << 16) | (devfn << 8) | (where & ~3))
+
+/*
+ * Functions for accessing PCI configuration space with type 1 accesses
+ */
+static int sh7751_pci_read(struct pci_bus *bus, unsigned int devfn,
+			   int where, int size, u32 *val)
+{
+	unsigned long flags;
+	u32 data;
+
+	/* 
+	 * PCIPDR may only be accessed as 32 bit words, 
+	 * so we must do byte alignment by hand 
+	 */
+	local_irq_save(flags);
+	outl(CONFIG_CMD(bus,devfn,where), PCI_REG(SH7751_PCIPAR));
+	data = inl(PCI_REG(SH7751_PCIPDR));
+	local_irq_restore(flags);
+
+	switch (size) {
+	case 1:
+		*val = (data >> ((where & 3) << 3)) & 0xff;
+		break;
+	case 2:
+		*val = (data >> ((where & 2) << 3)) & 0xffff;
+		break;
+	case 4:
+		*val = data;
+		break;
+	default:
+		return PCIBIOS_FUNC_NOT_SUPPORTED;
+	}
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+/* 
+ * Since SH7751 only does 32bit access we'll have to do a read,mask,write operation.  
+ * We'll allow an odd byte offset, though it should be illegal.
+ */ 
+static int sh7751_pci_write(struct pci_bus *bus, unsigned int devfn,
+			    int where, int size, u32 val)
+{
+	unsigned long flags;
+	int shift;
+	u32 data;
+
+	local_irq_save(flags);
+	outl(CONFIG_CMD(bus,devfn,where), PCI_REG(SH7751_PCIPAR));
+	data = inl(PCI_REG(SH7751_PCIPDR));
+	local_irq_restore(flags);
+
+	switch (size) {
+	case 1:
+		shift = (where & 3) << 3;
+		data &= ~(0xff << shift);
+		data |= ((val & 0xff) << shift);
+		break;
+	case 2:
+		shift = (where & 2) << 3;
+		data &= ~(0xffff << shift);
+		data |= ((val & 0xffff) << shift);
+		break;
+	case 4:
+		data = val;
+		break;
+	default:
+		return PCIBIOS_FUNC_NOT_SUPPORTED;
+	}
+
+	outl(data, PCI_REG(SH7751_PCIPDR));
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+#undef CONFIG_CMD
+
+struct pci_ops sh7751_pci_ops = {
+	.read 		= sh7751_pci_read,
+	.write		= sh7751_pci_write,
+};
+
+static int __init pci_check_direct(void)
+{
+	unsigned int tmp, id;
+
+	/* check for SH7751/SH7751R hardware */
+	id = inl(SH7751_PCIREG_BASE+SH7751_PCICONF0);
+	if (id != ((SH7751_DEVICE_ID << 16) | SH7751_VENDOR_ID) &&
+	    id != ((SH7751R_DEVICE_ID << 16) | SH7751_VENDOR_ID)) {
+		pr_debug("PCI: This is not an SH7751(R) (%x)\n", id);
+		return -ENODEV;
+	}
+
+	/*
+	 * Check if configuration works.
+	 */
+	if (pci_probe & PCI_PROBE_CONF1) {
+		tmp = inl (PCI_REG(SH7751_PCIPAR));
+		outl (0x80000000, PCI_REG(SH7751_PCIPAR));
+		if (inl (PCI_REG(SH7751_PCIPAR)) == 0x80000000) {
+			outl (tmp, PCI_REG(SH7751_PCIPAR));
+			printk(KERN_INFO "PCI: Using configuration type 1\n");
+			request_region(PCI_REG(SH7751_PCIPAR), 8, "PCI conf1");
+			return 0;
+		}
+		outl (tmp, PCI_REG(SH7751_PCIPAR));
+	}
+
+	pr_debug("PCI: pci_check_direct failed\n");
+	return -EINVAL;
+}
+
+/***************************************************************************************/
+
+/*
+ *  Handle bus scanning and fixups ....
+ */
+
+static void __init pci_fixup_ide_bases(struct pci_dev *d)
+{
+	int i;
+
+	/*
+	 * PCI IDE controllers use non-standard I/O port decoding, respect it.
+	 */
+	if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE)
+		return;
+	pr_debug("PCI: IDE base address fixup for %s\n", d->slot_name);
+	for(i=0; i<4; i++) {
+		struct resource *r = &d->resource[i];
+		if ((r->start & ~0x80) == 0x374) {
+			r->start |= 2;
+			r->end = r->start;
+		}
+	}
+}
+
+
+/* Add future fixups here... */
+struct pci_fixup pcibios_fixups[] = {
+	{ PCI_FIXUP_HEADER,	PCI_ANY_ID,	PCI_ANY_ID,	pci_fixup_ide_bases },
+	{ 0 }
+};
+
+/*
+ *  Called after each bus is probed, but before its children
+ *  are examined.
+ */
+
+void __init pcibios_fixup_bus(struct pci_bus *b)
+{
+	pci_read_bridge_bases(b);
+}
+
+/*
+ * Initialization. Try all known PCI access methods. Note that we support
+ * using both PCI BIOS and direct access: in such cases, we use I/O ports
+ * to access config space.
+ * 
+ * Note that the platform specific initialization (BSC registers, and memory
+ * space mapping) will be called via the machine vectors (sh_mv.mv_pci_init()) if it
+ * exitst and via the platform defined function pcibios_init_platform().  
+ * See pci_bigsur.c for implementation;
+ * 
+ * The BIOS version of the pci functions is not yet implemented but it is left
+ * in for completeness.  Currently an error will be genereated at compile time. 
+ */
+
+static int __init sh7751_pci_init(void)
+{
+	int ret;
+
+	pr_debug("PCI: Starting intialization.\n");
+	if ((ret = pci_check_direct()) != 0)
+		return ret;
+
+	return pcibios_init_platform();
+}
+
+subsys_initcall(sh7751_pci_init);
+
+static int __init __area_sdram_check(unsigned int area)
+{
+	u32 word;
+
+	word = inl(SH7751_BCR1);
+	/* check BCR for SDRAM in area */
+	if(((word >> area) & 1) == 0) {
+		printk("PCI: Area %d is not configured for SDRAM. BCR1=0x%x\n",
+		       area, word);
+		return 0;
+	}
+	outl(word, PCI_REG(SH7751_PCIBCR1));
+
+	word = (u16)inw(SH7751_BCR2);
+	/* check BCR2 for 32bit SDRAM interface*/
+	if(((word >> (area << 1)) & 0x3) != 0x3) {
+		printk("PCI: Area %d is not 32 bit SDRAM. BCR2=0x%x\n",
+		       area, word);
+		return 0;
+	}
+	outl(word, PCI_REG(SH7751_PCIBCR2));
+
+	return 1;
+}
+
+int __init sh7751_pcic_init(struct sh7751_pci_address_map *map)
+{
+	u32 reg;
+	u32 word;
+
+	/* Set the BCR's to enable PCI access */
+	reg = inl(SH7751_BCR1);
+	reg |= 0x80000;
+	outl(reg, SH7751_BCR1);
+	
+	/* Turn the clocks back on (not done in reset)*/
+	outl(0, PCI_REG(SH7751_PCICLKR));
+	/* Clear Powerdown IRQ's (not done in reset) */
+	word = SH7751_PCIPINT_D3 | SH7751_PCIPINT_D0;
+	outl(word, PCI_REG(SH7751_PCICLKR));
+
+	/*
+	 * XXX: This code is unused for the SnapGear boards as it is done in
+	 * the bootloader and doing it here means the MAC addresses loaded by
+	 * the bootloader get lost.
+	 */
+#ifndef CONFIG_SH_SECUREEDGE5410
+	/* toggle PCI reset pin */
+	word = SH7751_PCICR_PREFIX | SH7751_PCICR_PRST;
+	outl(word,PCI_REG(SH7751_PCICR));    
+	/* Wait for a long time... not 1 sec. but long enough */
+	mdelay(100);
+	word = SH7751_PCICR_PREFIX;
+	outl(word,PCI_REG(SH7751_PCICR)); 
+#endif
+	
+	/* set the command/status bits to:
+	 * Wait Cycle Control + Parity Enable + Bus Master +
+	 * Mem space enable
+	 */
+	word = SH7751_PCICONF1_WCC | SH7751_PCICONF1_PER | 
+	       SH7751_PCICONF1_BUM | SH7751_PCICONF1_MES;
+	outl(word, PCI_REG(SH7751_PCICONF1));
+
+	/* define this host as the host bridge */
+	word = SH7751_PCI_HOST_BRIDGE << 24;
+	outl(word, PCI_REG(SH7751_PCICONF2));
+
+	/* Set IO and Mem windows to local address 
+	 * Make PCI and local address the same for easy 1 to 1 mapping 
+	 * Window0 = map->window0.size @ non-cached area base = SDRAM
+	 * Window1 = map->window1.size @ cached area base = SDRAM 
+	 */
+	word = map->window0.size - 1;
+	outl(word, PCI_REG(SH7751_PCILSR0));
+	word = map->window1.size - 1;
+	outl(word, PCI_REG(SH7751_PCILSR1));
+	/* Set the values on window 0 PCI config registers */
+	word = P2SEGADDR(map->window0.base);
+	outl(word, PCI_REG(SH7751_PCILAR0));
+	outl(word, PCI_REG(SH7751_PCICONF5));
+	/* Set the values on window 1 PCI config registers */
+	word =  PHYSADDR(map->window1.base);
+	outl(word, PCI_REG(SH7751_PCILAR1));
+	outl(word, PCI_REG(SH7751_PCICONF6));
+
+	/* Set the local 16MB PCI memory space window to 
+	 * the lowest PCI mapped address
+	 */
+	word = PCIBIOS_MIN_MEM & SH7751_PCIMBR_MASK;
+	PCIDBG(2,"PCI: Setting upper bits of Memory window to 0x%x\n", word);
+	outl(word , PCI_REG(SH7751_PCIMBR));
+
+	/* Map IO space into PCI IO window
+	 * The IO window is 64K-PCIBIOS_MIN_IO in size
+	 * IO addresses will be translated to the 
+	 * PCI IO window base address
+	 */
+	PCIDBG(3,"PCI: Mapping IO address 0x%x - 0x%x to base 0x%x\n", PCIBIOS_MIN_IO,
+	    (64*1024), SH7751_PCI_IO_BASE+PCIBIOS_MIN_IO);
+
+	/* 
+	 * XXX: For now, leave this board-specific. In the event we have other
+	 * boards that need to do similar work, this can be wrapped.
+	 */
+#ifdef CONFIG_SH_BIGSUR
+	bigsur_port_map(PCIBIOS_MIN_IO, (64*1024), SH7751_PCI_IO_BASE+PCIBIOS_MIN_IO,0);
+#endif
+
+	/* Make sure the MSB's of IO window are set to access PCI space correctly */
+	word = PCIBIOS_MIN_IO & SH7751_PCIIOBR_MASK;
+	PCIDBG(2,"PCI: Setting upper bits of IO window to 0x%x\n", word);
+	outl(word, PCI_REG(SH7751_PCIIOBR));
+	
+	/* Set PCI WCRx, BCRx's, copy from BSC locations */
+
+	/* check BCR for SDRAM in specified area */
+	switch (map->window0.base) {
+	case SH7751_CS0_BASE_ADDR: word = __area_sdram_check(0); break;
+	case SH7751_CS1_BASE_ADDR: word = __area_sdram_check(1); break;
+	case SH7751_CS2_BASE_ADDR: word = __area_sdram_check(2); break;
+	case SH7751_CS3_BASE_ADDR: word = __area_sdram_check(3); break;
+	case SH7751_CS4_BASE_ADDR: word = __area_sdram_check(4); break;
+	case SH7751_CS5_BASE_ADDR: word = __area_sdram_check(5); break;
+	case SH7751_CS6_BASE_ADDR: word = __area_sdram_check(6); break;
+	}
+	
+	if (!word)
+		return 0;
+
+	/* configure the wait control registers */
+	word = inl(SH7751_WCR1);
+	outl(word, PCI_REG(SH7751_PCIWCR1));
+	word = inl(SH7751_WCR2);
+	outl(word, PCI_REG(SH7751_PCIWCR2));
+	word = inl(SH7751_WCR3);
+	outl(word, PCI_REG(SH7751_PCIWCR3));
+	word = inl(SH7751_MCR);
+	outl(word, PCI_REG(SH7751_PCIMCR));
+
+	/* NOTE: I'm ignoring the PCI error IRQs for now..
+	 * TODO: add support for the internal error interrupts and
+	 * DMA interrupts...
+	 */
+	 
+	/* SH7751 init done, set central function init complete */
+	/* use round robin mode to stop a device starving/overruning */
+	word = SH7751_PCICR_PREFIX | SH7751_PCICR_CFIN | SH7751_PCICR_ARBM;
+	outl(word,PCI_REG(SH7751_PCICR)); 
+
+	return 1;
+}
+
+char * __init pcibios_setup(char *str)
+{
+	if (!strcmp(str, "off")) {
+		pci_probe = 0;
+		return NULL;
+	}
+
+	return str;
+}
+
+/* 
+ * 	IRQ functions 
+ */
+static u8 __init sh7751_no_swizzle(struct pci_dev *dev, u8 *pin)
+{
+	/* no swizzling */
+	return PCI_SLOT(dev->devfn);
+}
+
+static int sh7751_pci_lookup_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+	int irq = -1;
+
+	/* now lookup the actual IRQ on a platform specific basis (pci-'platform'.c) */
+	irq = pcibios_map_platform_irq(slot,pin);
+	if( irq < 0 ) {
+		pr_debug("PCI: Error mapping IRQ on device %s\n", dev->slot_name);
+		return irq;
+	}
+	
+	pr_debug("Setting IRQ for slot %s to %d\n", dev->slot_name, irq);
+
+	return irq;
+}
+
+void __init pcibios_fixup_irqs(void)
+{
+	pci_fixup_irqs(sh7751_no_swizzle, sh7751_pci_lookup_irq);
+}
+
diff -Nru a/arch/sh/drivers/pci/pci-sh7751.h b/arch/sh/drivers/pci/pci-sh7751.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/pci/pci-sh7751.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,296 @@
+/*
+ *	Low-Level PCI Support for SH7751 targets
+ *
+ *  Dustin McIntire (dustin@sensoria.com) (c) 2001
+ *  Paul Mundt (lethal@linux-sh.org) (c) 2003
+ *	
+ *  May be copied or modified under the terms of the GNU General Public
+ *  License.  See linux/COPYING for more information.
+ *
+ */
+
+#ifndef _PCI_SH7751_H_
+#define _PCI_SH7751_H_
+
+#include <linux/pci.h>
+
+/* set debug level 4=verbose...1=terse */
+//#define DEBUG_PCI 3
+#undef DEBUG_PCI
+
+#ifdef DEBUG_PCI
+#define PCIDBG(n, x...) { if(DEBUG_PCI>=n) printk(x); }
+#else
+#define PCIDBG(n, x...)
+#endif
+
+/* startup values */
+#define PCI_PROBE_BIOS 1
+#define PCI_PROBE_CONF1 2
+#define PCI_PROBE_CONF2 4
+#define PCI_NO_SORT 0x100
+#define PCI_BIOS_SORT 0x200
+#define PCI_NO_CHECKS 0x400
+#define PCI_ASSIGN_ROMS 0x1000
+#define PCI_BIOS_IRQ_SCAN 0x2000
+
+/* Platform Specific Values */
+#define SH7751_VENDOR_ID             0x1054
+#define SH7751_DEVICE_ID             0x3505
+#define SH7751R_DEVICE_ID            0x350e
+
+/* SH7751 Specific Values */
+#define SH7751_PCI_CONFIG_BASE	     0xFD000000  /* Config space base addr */
+#define SH7751_PCI_CONFIG_SIZE       0x1000000   /* Config space size */
+#define SH7751_PCI_MEMORY_BASE	     0xFD000000  /* Memory space base addr */
+#define SH7751_PCI_MEM_SIZE          0x01000000  /* Size of Memory window */
+#define SH7751_PCI_IO_BASE           0xFE240000  /* IO space base address */
+#define SH7751_PCI_IO_SIZE           0x40000     /* Size of IO window */
+
+#define SH7751_PCIREG_BASE           0xFE200000  /* PCI regs base address */
+#define PCI_REG(n)                  (SH7751_PCIREG_BASE+ n)
+
+#define SH7751_PCICONF0            0x0           /* PCI Config Reg 0 */
+  #define SH7751_PCICONF0_DEVID      0xFFFF0000  /* Device ID */
+  #define SH7751_PCICONF0_VNDID      0x0000FFFF  /* Vendor ID */
+#define SH7751_PCICONF1            0x4           /* PCI Config Reg 1 */
+  #define SH7751_PCICONF1_DPE        0x80000000  /* Data Parity Error */
+  #define SH7751_PCICONF1_SSE        0x40000000  /* System Error Status */
+  #define SH7751_PCICONF1_RMA        0x20000000  /* Master Abort */
+  #define SH7751_PCICONF1_RTA        0x10000000  /* Target Abort Rx Status */
+  #define SH7751_PCICONF1_STA        0x08000000  /* Target Abort Exec Status */
+  #define SH7751_PCICONF1_DEV        0x06000000  /* Timing Status */
+  #define SH7751_PCICONF1_DPD        0x01000000  /* Data Parity Status */
+  #define SH7751_PCICONF1_FBBC       0x00800000  /* Back 2 Back Status */
+  #define SH7751_PCICONF1_UDF        0x00400000  /* User Defined Status */
+  #define SH7751_PCICONF1_66M        0x00200000  /* 66Mhz Operation Status */
+  #define SH7751_PCICONF1_PM         0x00100000  /* Power Management Status */
+  #define SH7751_PCICONF1_PBBE       0x00000200  /* Back 2 Back Control */
+  #define SH7751_PCICONF1_SER        0x00000100  /* SERR Output Control */
+  #define SH7751_PCICONF1_WCC        0x00000080  /* Wait Cycle Control */
+  #define SH7751_PCICONF1_PER        0x00000040  /* Parity Error Response */
+  #define SH7751_PCICONF1_VPS        0x00000020  /* VGA Pallet Snoop */
+  #define SH7751_PCICONF1_MWIE       0x00000010  /* Memory Write+Invalidate */
+  #define SH7751_PCICONF1_SPC        0x00000008  /* Special Cycle Control */
+  #define SH7751_PCICONF1_BUM        0x00000004  /* Bus Master Control */
+  #define SH7751_PCICONF1_MES        0x00000002  /* Memory Space Control */
+  #define SH7751_PCICONF1_IOS        0x00000001  /* I/O Space Control */
+#define SH7751_PCICONF2            0x8           /* PCI Config Reg 2 */
+  #define SH7751_PCICONF2_BCC        0xFF000000  /* Base Class Code */
+  #define SH7751_PCICONF2_SCC        0x00FF0000  /* Sub-Class Code */
+  #define SH7751_PCICONF2_RLPI       0x0000FF00  /* Programming Interface */
+  #define SH7751_PCICONF2_REV        0x000000FF  /* Revision ID */
+#define SH7751_PCICONF3            0xC           /* PCI Config Reg 3 */ 
+  #define SH7751_PCICONF3_BIST7      0x80000000  /* Bist Supported */
+  #define SH7751_PCICONF3_BIST6      0x40000000  /* Bist Executing */
+  #define SH7751_PCICONF3_BIST3_0    0x0F000000  /* Bist Passed */
+  #define SH7751_PCICONF3_HD7        0x00800000  /* Single Funtion device */
+  #define SH7751_PCICONF3_HD6_0      0x007F0000  /* Configuration Layout */
+  #define SH7751_PCICONF3_LAT        0x0000FF00  /* Latency Timer */
+  #define SH7751_PCICONF3_CLS        0x000000FF  /* Cache Line Size */
+#define SH7751_PCICONF4            0x10          /* PCI Config Reg 4 */
+  #define SH7751_PCICONF4_BASE       0xFFFFFFFC  /* I/O Space Base Addr */
+  #define SH7751_PCICONF4_ASI        0x00000001  /* Address Space Type */
+#define SH7751_PCICONF5            0x14          /* PCI Config Reg 5 */
+  #define SH7751_PCICONF5_BASE       0xFFFFFFF0  /* Mem Space Base Addr */
+  #define SH7751_PCICONF5_LAP        0x00000008  /* Prefetch Enabled */
+  #define SH7751_PCICONF5_LAT        0x00000006  /* Local Memory type */
+  #define SH7751_PCICONF5_ASI        0x00000001  /* Address Space Type */  
+#define SH7751_PCICONF6            0x18          /* PCI Config Reg 6 */
+  #define SH7751_PCICONF6_BASE       0xFFFFFFF0  /* Mem Space Base Addr */
+  #define SH7751_PCICONF6_LAP        0x00000008  /* Prefetch Enabled */
+  #define SH7751_PCICONF6_LAT        0x00000006  /* Local Memory type */
+  #define SH7751_PCICONF6_ASI        0x00000001  /* Address Space Type */  
+/* PCICONF7 - PCICONF10 are undefined */
+#define SH7751_PCICONF11           0x2C          /* PCI Config Reg 11 */
+  #define SH7751_PCICONF11_SSID      0xFFFF0000  /* Subsystem ID */
+  #define SH7751_PCICONF11_SVID      0x0000FFFF  /* Subsystem Vendor ID */
+/* PCICONF12 is undefined */
+#define SH7751_PCICONF13           0x34          /* PCI Config Reg 13 */
+  #define SH7751_PCICONF13_CPTR      0x000000FF  /* PM function pointer */
+/* PCICONF14 is undefined */
+#define SH7751_PCICONF15           0x3C          /* PCI Config Reg 15 */
+  #define SH7751_PCICONF15_IPIN      0x000000FF  /* Interrupt Pin */
+#define SH7751_PCICONF16           0x40          /* PCI Config Reg 16 */
+  #define SH7751_PCICONF16_PMES      0xF8000000  /* PME Support */
+  #define SH7751_PCICONF16_D2S       0x04000000  /* D2 Support */
+  #define SH7751_PCICONF16_D1S       0x02000000  /* D1 Support */
+  #define SH7751_PCICONF16_DSI       0x00200000  /* Bit Device Init. */
+  #define SH7751_PCICONF16_PMCK      0x00080000  /* Clock for PME req. */
+  #define SH7751_PCICONF16_VER       0x00070000  /* PM Version */
+  #define SH7751_PCICONF16_NIP       0x0000FF00  /* Next Item Pointer */
+  #define SH7751_PCICONF16_CID       0x000000FF  /* Capability Identifier */
+#define SH7751_PCICONF17           0x44          /* PCI Config Reg 17 */
+  #define SH7751_PCICONF17_DATA      0xFF000000  /* Data field for PM */
+  #define SH7751_PCICONF17_PMES      0x00800000  /* PME Status */
+  #define SH7751_PCICONF17_DSCL      0x00600000  /* Data Scaling Value */
+  #define SH7751_PCICONF17_DSEL      0x001E0000  /* Data Select */
+  #define SH7751_PCICONF17_PMEN      0x00010000  /* PME Enable */
+  #define SH7751_PCICONF17_PWST      0x00000003  /* Power State */
+/* SH7715 Internal PCI Registers */
+#define SH7751_PCICR               0x100         /* PCI Control Register */
+  #define SH7751_PCICR_PREFIX        0xA5000000  /* CR prefix for write */
+  #define SH7751_PCICR_TRSB          0x00000200  /* Target Read Single */
+  #define SH7751_PCICR_BSWP          0x00000100  /* Target Byte Swap */
+  #define SH7751_PCICR_PLUP          0x00000080  /* Enable PCI Pullup */
+  #define SH7751_PCICR_ARBM          0x00000040  /* PCI Arbitration Mode */
+  #define SH7751_PCICR_MD            0x00000030  /* MD9 and MD10 status */
+  #define SH7751_PCICR_SERR          0x00000008  /* SERR output assert */
+  #define SH7751_PCICR_INTA          0x00000004  /* INTA output assert */
+  #define SH7751_PCICR_PRST          0x00000002  /* PCI Reset Assert */
+  #define SH7751_PCICR_CFIN          0x00000001  /* Central Fun. Init Done */
+#define SH7751_PCILSR0             0x104         /* PCI Local Space Register0 */
+#define SH7751_PCILSR1             0x108         /* PCI Local Space Register1 */
+#define SH7751_PCILAR0             0x10C         /* PCI Local Address Register1 */
+#define SH7751_PCILAR1             0x110         /* PCI Local Address Register1 */
+#define SH7751_PCIINT              0x114         /* PCI Interrupt Register */
+  #define SH7751_PCIINT_MLCK         0x00008000  /* Master Lock Error */
+  #define SH7751_PCIINT_TABT         0x00004000  /* Target Abort Error */
+  #define SH7751_PCIINT_TRET         0x00000200  /* Target Retry Error */
+  #define SH7751_PCIINT_MFDE         0x00000100  /* Master Func. Disable Error */
+  #define SH7751_PCIINT_PRTY         0x00000080  /* Address Parity Error */
+  #define SH7751_PCIINT_SERR         0x00000040  /* SERR Detection Error */
+  #define SH7751_PCIINT_TWDP         0x00000020  /* Tgt. Write Parity Error */
+  #define SH7751_PCIINT_TRDP         0x00000010  /* Tgt. Read Parity Error Det. */
+  #define SH7751_PCIINT_MTABT        0x00000008  /* Master-Tgt. Abort Error */
+  #define SH7751_PCIINT_MMABT        0x00000004  /* Master-Master Abort Error */
+  #define SH7751_PCIINT_MWPD         0x00000002  /* Master Write PERR Detect */
+  #define SH7751_PCIINT_MRPD         0x00000002  /* Master Read PERR Detect */
+#define SH7751_PCIINTM             0x118         /* PCI Interrupt Mask Register */
+#define SH7751_PCIALR              0x11C         /* Error Address Register */
+#define SH7751_PCICLR              0x120         /* Error Command/Data Register */
+  #define SH7751_PCICLR_MPIO         0x80000000  /* Error Command/Data Register */
+  #define SH7751_PCICLR_MDMA0        0x40000000  /* DMA0 Transfer Error */
+  #define SH7751_PCICLR_MDMA1        0x20000000  /* DMA1 Transfer Error */
+  #define SH7751_PCICLR_MDMA2        0x10000000  /* DMA2 Transfer Error */
+  #define SH7751_PCICLR_MDMA3        0x08000000  /* DMA3 Transfer Error */
+  #define SH7751_PCICLR_TGT          0x04000000  /* Target Transfer Error */
+  #define SH7751_PCICLR_CMDL         0x0000000F  /* PCI Command at Error */
+#define SH7751_PCIAINT             0x130         /* Arbiter Interrupt Register */
+  #define SH7751_PCIAINT_MBKN        0x00002000  /* Master Broken Interrupt */
+  #define SH7751_PCIAINT_TBTO        0x00001000  /* Target Bus Time Out */
+  #define SH7751_PCIAINT_MBTO        0x00001000  /* Master Bus Time Out */
+  #define SH7751_PCIAINT_TABT        0x00000008  /* Target Abort */
+  #define SH7751_PCIAINT_MABT        0x00000004  /* Master Abort */
+  #define SH7751_PCIAINT_RDPE        0x00000002  /* Read Data Parity Error */
+  #define SH7751_PCIAINT_WDPE        0x00000002  /* Write Data Parity Error */
+#define SH7751_PCIAINTM            0x134         /* Arbiter Int. Mask Register */
+#define SH7751_PCIBMLR             0x138         /* Error Bus Master Register */
+  #define SH7751_PCIBMLR_REQ4        0x00000010  /* REQ4 bus master at error */
+  #define SH7751_PCIBMLR_REQ3        0x00000008  /* REQ3 bus master at error */
+  #define SH7751_PCIBMLR_REQ2        0x00000004  /* REQ2 bus master at error */
+  #define SH7751_PCIBMLR_REQ1        0x00000002  /* REQ1 bus master at error */
+  #define SH7751_PCIBMLR_REQ0        0x00000001  /* REQ0 bus master at error */
+#define SH7751_PCIDMABT            0x140         /* DMA Transfer Arb. Register */
+  #define SH7751_PCIDMABT_RRBN       0x00000001  /* DMA Arbitor Round-Robin */
+#define SH7751_PCIDPA0             0x180         /* DMA0 Transfer Addr. Register */
+#define SH7751_PCIDLA0             0x184         /* DMA0 Local Addr. Register */
+#define SH7751_PCIDTC0             0x188         /* DMA0 Transfer Cnt. Register */
+#define SH7751_PCIDCR0             0x18C         /* DMA0 Control Register */
+  #define SH7751_PCIDCR_ALGN         0x00000600  /* DMA Alignment Mode */
+  #define SH7751_PCIDCR_MAST         0x00000100  /* DMA Termination Type */
+  #define SH7751_PCIDCR_INTM         0x00000080  /* DMA Interrupt Done Mask*/
+  #define SH7751_PCIDCR_INTS         0x00000040  /* DMA Interrupt Done Status */
+  #define SH7751_PCIDCR_LHLD         0x00000020  /* Local Address Control */
+  #define SH7751_PCIDCR_PHLD         0x00000010  /* PCI Address Control*/
+  #define SH7751_PCIDCR_IOSEL        0x00000008  /* PCI Address Space Type */
+  #define SH7751_PCIDCR_DIR          0x00000004  /* DMA Transfer Direction */
+  #define SH7751_PCIDCR_STOP         0x00000002  /* Force DMA Stop */
+  #define SH7751_PCIDCR_STRT         0x00000001  /* DMA Start */
+#define SH7751_PCIDPA1             0x190         /* DMA1 Transfer Addr. Register */
+#define SH7751_PCIDLA1             0x194         /* DMA1 Local Addr. Register */
+#define SH7751_PCIDTC1             0x198         /* DMA1 Transfer Cnt. Register */
+#define SH7751_PCIDCR1             0x19C         /* DMA1 Control Register */
+#define SH7751_PCIDPA2             0x1A0         /* DMA2 Transfer Addr. Register */
+#define SH7751_PCIDLA2             0x1A4         /* DMA2 Local Addr. Register */
+#define SH7751_PCIDTC2             0x1A8         /* DMA2 Transfer Cnt. Register */
+#define SH7751_PCIDCR2             0x1AC         /* DMA2 Control Register */
+#define SH7751_PCIDPA3             0x1B0         /* DMA3 Transfer Addr. Register */
+#define SH7751_PCIDLA3             0x1B4         /* DMA3 Local Addr. Register */
+#define SH7751_PCIDTC3             0x1B8         /* DMA3 Transfer Cnt. Register */
+#define SH7751_PCIDCR3             0x1BC         /* DMA3 Control Register */
+#define SH7751_PCIPAR              0x1C0         /* PIO Address Register */
+  #define SH7751_PCIPAR_CFGEN        0x80000000  /* Configuration Enable */
+  #define SH7751_PCIPAR_BUSNO        0x00FF0000  /* Config. Bus Number */
+  #define SH7751_PCIPAR_DEVNO        0x0000FF00  /* Config. Device Number */
+  #define SH7751_PCIPAR_REGAD        0x000000FC  /* Register Address Number */
+#define SH7751_PCIMBR              0x1C4         /* Memory Base Address Register */
+  #define SH7751_PCIMBR_MASK         0xFF000000  /* Memory Space Mask */
+  #define SH7751_PCIMBR_LOCK         0x00000001  /* Lock Memory Space */
+#define SH7751_PCIIOBR             0x1C8         /* I/O Base Address Register */
+  #define SH7751_PCIIOBR_MASK         0xFFFC0000 /* IO Space Mask */
+  #define SH7751_PCIIOBR_LOCK         0x00000001 /* Lock IO Space */
+#define SH7751_PCIPINT             0x1CC         /* Power Mgmnt Int. Register */
+  #define SH7751_PCIPINT_D3           0x00000002 /* D3 Pwr Mgmt. Interrupt */
+  #define SH7751_PCIPINT_D0           0x00000001 /* D0 Pwr Mgmt. Interrupt */  
+#define SH7751_PCIPINTM            0x1D0         /* Power Mgmnt Mask Register */
+#define SH7751_PCICLKR             0x1D4         /* Clock Ctrl. Register */
+  #define SH7751_PCICLKR_PCSTP        0x00000002 /* PCI Clock Stop */
+  #define SH7751_PCICLKR_BCSTP        0x00000002 /* BCLK Clock Stop */
+/* For definitions of BCR, MCR see ... */
+#define SH7751_PCIBCR1             0x1E0         /* Memory BCR1 Register */
+#define SH7751_PCIBCR2             0x1E4         /* Memory BCR2 Register */
+#define SH7751_PCIWCR1             0x1E8         /* Wait Control 1 Register */
+#define SH7751_PCIWCR2             0x1EC         /* Wait Control 2 Register */
+#define SH7751_PCIWCR3             0x1F0         /* Wait Control 3 Register */
+#define SH7751_PCIMCR              0x1F4         /* Memory Control Register */
+#define SH7751_PCIPCTR             0x200         /* Port Control Register */
+  #define SH7751_PCIPCTR_P2EN        0x000400000 /* Port 2 Enable */
+  #define SH7751_PCIPCTR_P1EN        0x000200000 /* Port 1 Enable */
+  #define SH7751_PCIPCTR_P0EN        0x000100000 /* Port 0 Enable */
+  #define SH7751_PCIPCTR_P2UP        0x000000020 /* Port2 Pull Up Enable */
+  #define SH7751_PCIPCTR_P2IO        0x000000010 /* Port2 Output Enable */
+  #define SH7751_PCIPCTR_P1UP        0x000000008 /* Port1 Pull Up Enable */
+  #define SH7751_PCIPCTR_P1IO        0x000000004 /* Port1 Output Enable */
+  #define SH7751_PCIPCTR_P0UP        0x000000002 /* Port0 Pull Up Enable */
+  #define SH7751_PCIPCTR_P0IO        0x000000001 /* Port0 Output Enable */
+#define SH7751_PCIPDTR             0x204         /* Port Data Register */
+  #define SH7751_PCIPDTR_PB5         0x000000020 /* Port 5 Enable */
+  #define SH7751_PCIPDTR_PB4         0x000000010 /* Port 4 Enable */
+  #define SH7751_PCIPDTR_PB3         0x000000008 /* Port 3 Enable */
+  #define SH7751_PCIPDTR_PB2         0x000000004 /* Port 2 Enable */
+  #define SH7751_PCIPDTR_PB1         0x000000002 /* Port 1 Enable */
+  #define SH7751_PCIPDTR_PB0         0x000000001 /* Port 0 Enable */
+#define SH7751_PCIPDR              0x220         /* Port IO Data Register */
+
+/* Memory Control Registers */
+#define SH7751_BCR1                0xFF800000    /* Memory BCR1 Register */
+#define SH7751_BCR2                0xFF800004    /* Memory BCR2 Register */
+#define SH7751_WCR1                0xFF800008    /* Wait Control 1 Register */
+#define SH7751_WCR2                0xFF80000C    /* Wait Control 2 Register */
+#define SH7751_WCR3                0xFF800010    /* Wait Control 3 Register */
+#define SH7751_MCR                 0xFF800014    /* Memory Control Register */
+
+/* General Memory Config Addresses */
+#define SH7751_CS0_BASE_ADDR       0x0
+#define SH7751_MEM_REGION_SIZE     0x04000000
+#define SH7751_CS1_BASE_ADDR       (SH7751_CS0_BASE_ADDR + SH7751_MEM_REGION_SIZE)
+#define SH7751_CS2_BASE_ADDR       (SH7751_CS1_BASE_ADDR + SH7751_MEM_REGION_SIZE)
+#define SH7751_CS3_BASE_ADDR       (SH7751_CS2_BASE_ADDR + SH7751_MEM_REGION_SIZE)
+#define SH7751_CS4_BASE_ADDR       (SH7751_CS3_BASE_ADDR + SH7751_MEM_REGION_SIZE)
+#define SH7751_CS5_BASE_ADDR       (SH7751_CS4_BASE_ADDR + SH7751_MEM_REGION_SIZE)
+#define SH7751_CS6_BASE_ADDR       (SH7751_CS5_BASE_ADDR + SH7751_MEM_REGION_SIZE)
+
+/* General PCI values */
+#define SH7751_PCI_HOST_BRIDGE		0x6
+
+/* External functions defined per platform i.e. Big Sur, SE... (these could be routed 
+ * through the machine vectors... */
+extern int pcibios_init_platform(void);
+extern int pcibios_map_platform_irq(u8 slot, u8 pin);
+
+struct sh7751_pci_address_space {
+	unsigned long base;
+	unsigned long size;
+};
+
+struct sh7751_pci_address_map {
+	struct sh7751_pci_address_space window0;
+	struct sh7751_pci_address_space window1;
+};
+
+/* arch/sh/drivers/pci/pci-sh7751.c */
+extern int sh7751_pcic_init(struct sh7751_pci_address_map *map);
+
+#endif /* _PCI_SH7751_H_ */
+
diff -Nru a/arch/sh/drivers/pci/pci-st40.c b/arch/sh/drivers/pci/pci-st40.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/pci/pci-st40.c	Tue Feb  3 19:45:29 2004
@@ -0,0 +1,423 @@
+/* 
+ * Copyright (C) 2001 David J. Mckay (david.mckay@st.com)
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.                            
+ *
+ * Support functions for the ST40 PCI hardware.
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/smp.h>
+#include <linux/smp_lock.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <linux/pci.h>
+#include <linux/delay.h>
+#include <linux/types.h>
+#include <asm/pci.h>
+#include <linux/irq.h>
+
+#include "pci-st40.h"
+
+/* This is in P2 of course */
+#define ST40PCI_BASE_ADDRESS     (0xb0000000)
+#define ST40PCI_MEM_ADDRESS      (ST40PCI_BASE_ADDRESS+0x0)
+#define ST40PCI_IO_ADDRESS       (ST40PCI_BASE_ADDRESS+0x06000000)
+#define ST40PCI_REG_ADDRESS      (ST40PCI_BASE_ADDRESS+0x07000000)
+
+#define ST40PCI_REG(x) (ST40PCI_REG_ADDRESS+(ST40PCI_##x))
+
+#define ST40PCI_WRITE(reg,val) writel((val),ST40PCI_REG(reg))
+#define ST40PCI_WRITE_SHORT(reg,val) writew((val),ST40PCI_REG(reg))
+#define ST40PCI_WRITE_BYTE(reg,val) writeb((val),ST40PCI_REG(reg))
+
+#define ST40PCI_READ(reg) readl(ST40PCI_REG(reg))
+#define ST40PCI_READ_SHORT(reg) readw(ST40PCI_REG(reg))
+#define ST40PCI_READ_BYTE(reg) readb(ST40PCI_REG(reg))
+
+#define ST40PCI_SERR_IRQ        64
+#define ST40PCI_SERR_INT_GROUP  0
+#define ST40PCI_SERR_INT_POS    0
+#define ST40PCI_SERR_INT_PRI    15
+
+#define ST40PCI_ERR_IRQ        65
+#define ST40PCI_ERR_INT_GROUP   1
+#define ST40PCI_ERR_INT_POS     1
+#define ST40PCI_ERR_INT_PRI     14
+
+
+/* Macros to extract PLL params */
+#define PLL_MDIV(reg)  ( ((unsigned)reg) & 0xff )
+#define PLL_NDIV(reg) ( (((unsigned)reg)>>8) & 0xff )
+#define PLL_PDIV(reg) ( (((unsigned)reg)>>16) & 0x3 )
+#define PLL_SETUP(reg) ( (((unsigned)reg)>>19) & 0x1ff )
+
+/* Build up the appropriate settings */
+#define PLL_SET(mdiv,ndiv,pdiv,setup) \
+( ((mdiv)&0xff) | (((ndiv)&0xff)<<8) | (((pdiv)&3)<<16)| (((setup)&0x1ff)<<19))
+
+#define PLLPCICR (0xbb040000+0x10)
+
+#define PLLPCICR_POWERON (1<<28)
+#define PLLPCICR_OUT_EN (1<<29)
+#define PLLPCICR_LOCKSELECT (1<<30)
+#define PLLPCICR_LOCK (1<<31)
+
+
+#define PLL_25MHZ 0x793c8512
+#define PLL_33MHZ PLL_SET(18,88,3,295)
+
+
+static __init void SetPCIPLL(void)
+{
+	/* Stop the PLL */
+	writel(0, PLLPCICR);
+
+	/* Always run at 33Mhz. The PCI clock is totally async 
+	 * to the rest of the system
+	 */
+	writel(PLL_33MHZ | PLLPCICR_POWERON, PLLPCICR);
+
+	printk("ST40PCI: Waiting for PCI PLL to lock\n");
+	while ((readl(PLLPCICR) & PLLPCICR_LOCK) == 0);
+	writel(readl(PLLPCICR) | PLLPCICR_OUT_EN, PLLPCICR);
+}
+
+
+static irqreturn_t st40_pci_irq(int irq, void *dev_instance, struct pt_regs *regs)
+{
+
+	unsigned pci_int, pci_air, pci_cir, pci_aint;
+
+	pci_int = ST40PCI_READ(INT);
+	pci_cir = ST40PCI_READ(CIR);
+	pci_air = ST40PCI_READ(AIR);
+
+	if (pci_int) {
+		printk("PCI INTERRUPT!\n");
+		printk("PCI INT -> 0x%x\n", pci_int & 0xffff);
+		printk("PCI AIR -> 0x%x\n", pci_air);
+		printk("PCI CIR -> 0x%x\n", pci_cir);
+		ST40PCI_WRITE(INT, ~0);
+	}
+
+	pci_aint = ST40PCI_READ(AINT);
+	if (pci_aint) {
+		printk("PCI ARB INTERRUPT!\n");
+		printk("PCI AINT -> 0x%x\n", pci_aint);
+		printk("PCI AIR -> 0x%x\n", pci_air);
+		printk("PCI CIR -> 0x%x\n", pci_cir);
+		ST40PCI_WRITE(AINT, ~0);
+	}
+
+	return IRQ_HANDLED;
+}
+
+
+/* Rounds a number UP to the nearest power of two. Used for
+ * sizing the PCI window.
+ */
+static u32 __init r2p2(u32 num)
+{
+	int i = 31;
+	u32 tmp = num;
+
+	if (num == 0)
+		return 0;
+
+	do {
+		if (tmp & (1 << 31))
+			break;
+		i--;
+		tmp <<= 1;
+	} while (i >= 0);
+
+	tmp = 1 << i;
+	/* If the original number isn't a power of 2, round it up */
+	if (tmp != num)
+		tmp <<= 1;
+
+	return tmp;
+}
+
+static void __init pci_fixup_ide_bases(struct pci_dev *d)
+{
+	int i;
+
+	/*
+	 * PCI IDE controllers use non-standard I/O port decoding, respect it.
+	 */
+	if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE)
+		return;
+	printk("PCI: IDE base address fixup for %s\n", d->slot_name);
+	for(i=0; i<4; i++) {
+		struct resource *r = &d->resource[i];
+		if ((r->start & ~0x80) == 0x374) {
+			r->start |= 2;
+			r->end = r->start;
+		}
+	}
+}
+
+
+/* Add future fixups here... */
+struct pci_fixup pcibios_fixups[] = {
+	{ PCI_FIXUP_HEADER,	PCI_ANY_ID,	PCI_ANY_ID,	pci_fixup_ide_bases },
+	{ 0 }
+};
+
+int __init st40pci_init(unsigned memStart, unsigned memSize)
+{
+	u32 lsr0;
+
+	SetPCIPLL();
+
+	/* Initialises the ST40 pci subsystem, performing a reset, then programming
+	 * up the address space decoders appropriately
+	 */
+
+	/* Should reset core here as well methink */
+
+	ST40PCI_WRITE(CR, CR_LOCK_MASK | CR_SOFT_RESET);
+
+	/* Loop while core resets */
+	while (ST40PCI_READ(CR) & CR_SOFT_RESET);
+
+	/* Now, lets reset all the cards on the bus with extreme prejudice */
+	ST40PCI_WRITE(CR, CR_LOCK_MASK | CR_RSTCTL);
+	udelay(250);
+
+	/* Set bus active, take it out of reset */
+	ST40PCI_WRITE(CR, CR_LOCK_MASK | CR_CFINT | CR_PFCS | CR_PFE);
+
+	/* The PCI spec says that no access must be made to the bus until 1 second
+	 * after reset. This seem ludicrously long, but some delay is needed here
+	 */
+	mdelay(1000);
+
+	/* Switch off interrupts */
+	ST40PCI_WRITE(INTM, 0);
+	ST40PCI_WRITE(AINT, 0);
+
+	/* Allow it to be a master */
+
+	ST40PCI_WRITE_SHORT(CSR_CMD,
+			    PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |
+			    PCI_COMMAND_IO);
+
+	/* Accesse to the 0xb0000000 -> 0xb6000000 area will go through to 0x10000000 -> 0x16000000
+	 * on the PCI bus. This allows a nice 1-1 bus to phys mapping.
+	 */
+
+
+	ST40PCI_WRITE(MBR, 0x10000000);
+	/* Always set the max size 128M (actually, it is only 96MB wide) */
+	ST40PCI_WRITE(MBMR, 0x07ff0000);
+
+	/* I/O addresses are mapped at 0xb6000000 -> 0xb7000000. These are changed to 0, to 
+	 * allow cards that have legacy io such as vga to function correctly. This gives a 
+	 * maximum of 64K of io/space as only the bottom 16 bits of the address are copied 
+	 * over to the bus  when the transaction is made. 64K of io space is more than enough
+	 */
+	ST40PCI_WRITE(IOBR, 0x0);
+	/* Set up the 64K window */
+	ST40PCI_WRITE(IOBMR, 0x0);
+
+	/* Now we set up the mbars so the PCI bus can see the memory of the machine */
+
+	if (memSize < (64 * 1024)) {
+		printk("Ridiculous memory size of 0x%x?\n",memSize);
+		return 0;
+	}
+
+	lsr0 =
+	    (memSize >
+	     (512 * 1024 * 1024)) ? 0x1fff0001 : ((r2p2(memSize) -
+						   0x10000) | 0x1);
+
+	ST40PCI_WRITE(LSR0, lsr0);
+
+	ST40PCI_WRITE(CSR_MBAR0, memStart);
+	ST40PCI_WRITE(LAR0, memStart);
+
+	/* Maximise timeout values */
+	ST40PCI_WRITE_BYTE(CSR_TRDY, 0xff);
+	ST40PCI_WRITE_BYTE(CSR_RETRY, 0xff);
+	ST40PCI_WRITE_BYTE(CSR_MIT, 0xff);
+
+
+	/* Install the pci interrupt handlers */
+	make_intc2_irq(ST40PCI_SERR_IRQ, INTC2_BASE0,
+		       ST40PCI_SERR_INT_GROUP, ST40PCI_SERR_INT_POS,
+		       ST40PCI_SERR_INT_PRI);
+
+	make_intc2_irq(ST40PCI_ERR_IRQ, INTC2_BASE0, ST40PCI_ERR_INT_GROUP,
+		       ST40PCI_ERR_INT_POS, ST40PCI_ERR_INT_PRI);
+
+
+	return 1;
+}
+
+char * __init pcibios_setup(char *str)
+{
+	return str;
+}
+
+
+#define SET_CONFIG_BITS(bus,devfn,where)\
+  (((bus) << 16) | ((devfn) << 8) | ((where) & ~3) | (bus!=0))
+
+#define CONFIG_CMD(bus, devfn, where) SET_CONFIG_BITS(bus->number,devfn,where)
+
+
+static int CheckForMasterAbort(void)
+{
+	if (ST40PCI_READ(INT) & INT_MADIM) {
+		/* Should we clear config space version as well ??? */
+		ST40PCI_WRITE(INT, INT_MADIM);
+		ST40PCI_WRITE_SHORT(CSR_STATUS, 0);
+		return 1;
+	}
+
+	return 0;
+}
+
+/* Write to config register */
+static int st40pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 * val)
+{
+	ST40PCI_WRITE(PAR, CONFIG_CMD(bus, devfn, where));
+	switch (size) {
+		case 1:
+			*val = (u8)ST40PCI_READ_BYTE(PDR + (where & 3));
+			break;
+		case 2:
+			*val = (u16)ST40PCI_READ_SHORT(PDR + (where & 2));
+			break;
+		case 4:
+			*val = ST40PCI_READ(PDR);
+			break;
+	}
+
+	if (CheckForMasterAbort()){
+		switch (size) {
+			case 1:
+				*val = (u8)0xff;
+				break;
+			case 2:
+				*val = (u16)0xffff;
+				break;
+			case 4:
+				*val = 0xffffffff;
+				break;
+		}
+	}
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static int st40pci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val)
+{
+	ST40PCI_WRITE(PAR, CONFIG_CMD(bus, devfn, where));
+
+	switch (size) {
+		case 1:
+			ST40PCI_WRITE_BYTE(PDR + (where & 3), (u8)val);
+			break;
+		case 2:
+			ST40PCI_WRITE_SHORT(PDR + (where & 2), (u16)val);
+			break;
+		case 4:
+			ST40PCI_WRITE(PDR, val);
+			break;
+	}
+
+	CheckForMasterAbort();
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static struct pci_ops pci_config_ops = {
+	.read = 	st40pci_read,
+	.write = 	st40pci_write,
+};
+
+
+/* Everything hangs off this */
+static struct pci_bus *pci_root_bus;
+
+
+static u8 __init no_swizzle(struct pci_dev *dev, u8 * pin)
+{
+	return PCI_SLOT(dev->devfn);
+}
+
+
+/* This needs to be shunted out of here into the board specific bit */
+#define HARP_PCI_IRQ    1
+#define HARP_BRIDGE_IRQ 2
+#define OVERDRIVE_SLOT0_IRQ 0
+
+static int __init map_harp_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+	switch (slot) {
+#ifdef CONFIG_SH_STB1_HARP
+	case 2:		/*This is the PCI slot on the */
+		return HARP_PCI_IRQ;
+	case 1:		/* this is the bridge */
+		return HARP_BRIDGE_IRQ;
+#elif defined(CONFIG_SH_STB1_OVERDRIVE)
+	case 1:
+	case 2:
+	case 3:
+		return slot - 1;
+#else
+#error Unknown board
+#endif
+	default:
+		return -1;
+	}
+}
+
+void __init pcibios_init(void)
+{
+	extern unsigned long memory_start, memory_end;
+
+	if (sh_mv.mv_init_pci != NULL) {
+		sh_mv.mv_init_pci();
+	}
+
+	/* The pci subsytem needs to know where memory is and how much 
+	 * of it there is. I've simply made these globals. A better mechanism
+	 * is probably needed.
+	 */
+	st40pci_init(PHYSADDR(memory_start),
+		     PHYSADDR(memory_end) - PHYSADDR(memory_start));
+
+	if (request_irq(ST40PCI_ERR_IRQ, st40_pci_irq, 
+                        SA_INTERRUPT, "st40pci", NULL)) {
+		printk(KERN_ERR "st40pci: Cannot hook interrupt\n");
+		return;
+	}
+
+	/* Enable the PCI interrupts on the device */
+	ST40PCI_WRITE(INTM, ~0);
+	ST40PCI_WRITE(AINT, ~0);
+
+	/* Map the io address apprioately */
+#ifdef CONFIG_HD64465
+	hd64465_port_map(PCIBIOS_MIN_IO, (64 * 1024) - PCIBIOS_MIN_IO + 1,
+			 ST40_IO_ADDR + PCIBIOS_MIN_IO, 0);
+#endif
+
+	/* ok, do the scan man */
+	pci_root_bus = pci_scan_bus(0, &pci_config_ops, NULL);
+	pci_assign_unassigned_resources();
+	pci_fixup_irqs(no_swizzle, map_harp_irq);
+
+}
+
+void __init pcibios_fixup_bus(struct pci_bus *bus)
+{
+}
diff -Nru a/arch/sh/drivers/pci/pci-st40.h b/arch/sh/drivers/pci/pci-st40.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/pci/pci-st40.h	Tue Feb  3 19:45:17 2004
@@ -0,0 +1,66 @@
+/* 
+ * Copyright (C) 2001 David J. Mckay (david.mckay@st.com)
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.                            
+ *
+ * Defintions for the ST40 PCI hardware.
+ */
+
+#ifndef __PCI_ST40_H__
+#define __PCI_ST40_H__
+
+#define ST40PCI_VCR_STATUS    0x00
+
+#define ST40PCI_VCR_VERSION   0x08
+
+#define ST40PCI_CR            0x10
+
+#define CR_SOFT_RESET (1<<12)
+#define CR_PFCS       (1<<11)
+#define CR_PFE        (1<<9)
+#define CR_BMAM       (1<<6)
+#define CR_HOST       (1<<5)
+#define CR_CLKEN      (1<<4)
+#define CR_SOCS       (1<<3)
+#define CR_IOCS       (1<<2)
+#define CR_RSTCTL     (1<<1)
+#define CR_CFINT      (1<<0)
+#define CR_LOCK_MASK  0x5a000000
+
+
+#define ST40PCI_LSR0          0X14
+#define ST40PCI_LAR0          0x1c
+
+#define ST40PCI_INT           0x24
+#define INT_MADIM             (1<<2)
+
+
+#define ST40PCI_INTM          0x28
+#define ST40PCI_AIR           0x2c
+#define ST40PCI_CIR           0x30
+#define ST40PCI_AINT          0x40
+#define ST40PCI_AINTM         0x44
+#define ST40PCI_BMIR          0x48
+#define ST40PCI_PAR           0x4c
+#define ST40PCI_MBR           0x50
+#define ST40PCI_IOBR          0x54
+#define ST40PCI_PINT          0x58
+#define ST40PCI_PINTM         0x5c
+#define ST40PCI_MBMR          0x70
+#define ST40PCI_IOBMR         0x74
+#define ST40PCI_PDR           0x78
+
+/* These are configs space registers */
+#define ST40PCI_CSR_VID               0x10000
+#define ST40PCI_CSR_DID               0x10002
+#define ST40PCI_CSR_CMD               0x10004
+#define ST40PCI_CSR_STATUS            0x10006
+#define ST40PCI_CSR_MBAR0             0x10010
+#define ST40PCI_CSR_TRDY              0x10040
+#define ST40PCI_CSR_RETRY             0x10041
+#define ST40PCI_CSR_MIT               0x1000d
+
+#define ST40_IO_ADDR 0xb6000000       
+
+#endif /* __PCI_ST40_H__ */
diff -Nru a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/drivers/pci/pci.c	Tue Feb  3 19:45:40 2004
@@ -0,0 +1,153 @@
+/* arch/sh/kernel/pci.c
+ * $Id: pci.c,v 1.1 2003/08/24 19:15:45 lethal Exp $
+ *
+ * Copyright (c) 2002 M. R. Brown  <mrbrown@linux-sh.org>
+ * 
+ * 
+ * These functions are collected here to reduce duplication of common
+ * code amongst the many platform-specific PCI support code files.
+ * 
+ * These routines require the following board-specific routines:
+ * void pcibios_fixup_irqs();
+ *
+ * See include/asm-sh/pci.h for more information.
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+
+static int __init pcibios_init(void)
+{
+	struct pci_channel *p;
+	struct pci_bus *bus;
+	int busno;
+
+#ifdef CONFIG_PCI_AUTO
+	/* assign resources */
+	busno=0;
+	for (p = board_pci_channels; p->pci_ops != NULL; p++) {
+		busno = pciauto_assign_resources(busno, p) + 1;
+	}
+#endif
+
+	/* scan the buses */
+	busno = 0;
+	for (p= board_pci_channels; p->pci_ops != NULL; p++) {
+		bus = pci_scan_bus(busno, p->pci_ops, p);
+		busno = bus->subordinate+1;
+	}
+
+	/* board-specific fixups */
+	pcibios_fixup_irqs();
+
+	return 0;
+}
+
+subsys_initcall(pcibios_init);
+
+void
+pcibios_update_resource(struct pci_dev *dev, struct resource *root,
+			struct resource *res, int resource)
+{
+	u32 new, check;
+	int reg;
+
+	new = res->start | (res->flags & PCI_REGION_FLAG_MASK);
+	if (resource < 6) {
+		reg = PCI_BASE_ADDRESS_0 + 4*resource;
+	} else if (resource == PCI_ROM_RESOURCE) {
+		res->flags |= PCI_ROM_ADDRESS_ENABLE;
+		new |= PCI_ROM_ADDRESS_ENABLE;
+		reg = dev->rom_base_reg;
+	} else {
+		/* Somebody might have asked allocation of a non-standard resource */
+		return;
+	}
+	
+	pci_write_config_dword(dev, reg, new);
+	pci_read_config_dword(dev, reg, &check);
+	if ((new ^ check) & ((new & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK)) {
+		printk(KERN_ERR "PCI: Error while updating region "
+		       "%s/%d (%08x != %08x)\n", pci_name(dev), resource,
+		       new, check);
+	}
+}
+
+void pcibios_align_resource(void *data, struct resource *res,
+			    unsigned long size, unsigned long align)
+			    __attribute__ ((weak));
+
+/*
+ * We need to avoid collisions with `mirrored' VGA ports
+ * and other strange ISA hardware, so we always want the
+ * addresses to be allocated in the 0x000-0x0ff region
+ * modulo 0x400.
+ */
+void pcibios_align_resource(void *data, struct resource *res,
+			    unsigned long size, unsigned long align)
+{
+	if (res->flags & IORESOURCE_IO) {
+		unsigned long start = res->start;
+
+		if (start & 0x300) {
+			start = (start + 0x3ff) & ~0x3ff;
+			res->start = start;
+		}
+	}
+}
+
+int pcibios_enable_device(struct pci_dev *dev, int mask)
+{
+	u16 cmd, old_cmd;
+	int idx;
+	struct resource *r;
+
+	pci_read_config_word(dev, PCI_COMMAND, &cmd);
+	old_cmd = cmd;
+	for(idx=0; idx<6; idx++) {
+		r = &dev->resource[idx];
+		if (!r->start && r->end) {
+			printk(KERN_ERR "PCI: Device %s not available because "
+			       "of resource collisions\n", pci_name(dev));
+			return -EINVAL;
+		}
+		if (r->flags & IORESOURCE_IO)
+			cmd |= PCI_COMMAND_IO;
+		if (r->flags & IORESOURCE_MEM)
+			cmd |= PCI_COMMAND_MEMORY;
+	}
+	if (dev->resource[PCI_ROM_RESOURCE].start)
+		cmd |= PCI_COMMAND_MEMORY;
+	if (cmd != old_cmd) {
+		printk(KERN_INFO "PCI: Enabling device %s (%04x -> %04x)\n",
+		       pci_name(dev), old_cmd, cmd);
+		pci_write_config_word(dev, PCI_COMMAND, cmd);
+	}
+	return 0;
+}
+
+/*
+ *  If we set up a device for bus mastering, we need to check and set
+ *  the latency timer as it may not be properly set.
+ */
+unsigned int pcibios_max_latency = 255;
+
+void pcibios_set_master(struct pci_dev *dev)
+{
+	u8 lat;
+	pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
+	if (lat < 16)
+		lat = (64 <= pcibios_max_latency) ? 64 : pcibios_max_latency;
+	else if (lat > pcibios_max_latency)
+		lat = pcibios_max_latency;
+	else
+		return;
+	printk(KERN_INFO "PCI: Setting latency timer of device %s to %d\n", pci_name(dev), lat);
+	pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
+}
+
+void __init pcibios_update_irq(struct pci_dev *dev, int irq)
+{
+	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
+}
diff -Nru a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
--- a/arch/sh/kernel/Makefile	Tue Feb  3 19:45:29 2004
+++ b/arch/sh/kernel/Makefile	Tue Feb  3 19:45:29 2004
@@ -17,11 +17,5 @@
 obj-$(CONFIG_SH_CPU_FREQ)	+= cpufreq.o
 obj-$(CONFIG_MODULES)		+= module.o
 
-ifneq ($(CONFIG_SH_DREAMCAST),y)
-obj-$(CONFIG_PCI)		+= pci-dma.o
-endif
-obj-$(CONFIG_PCI)		+= pci.o
-obj-$(CONFIG_PCI_AUTO)		+= pci_auto.o
-
 USE_STANDARD_AS_RULE := true
 
diff -Nru a/arch/sh/kernel/cpu/Makefile b/arch/sh/kernel/cpu/Makefile
--- a/arch/sh/kernel/cpu/Makefile	Tue Feb  3 19:45:35 2004
+++ b/arch/sh/kernel/cpu/Makefile	Tue Feb  3 19:45:35 2004
@@ -2,13 +2,12 @@
 # Makefile for the Linux/SuperH CPU-specifc backends.
 #
 
-obj-y	:= irq_ipr.o irq_imask.o
+obj-y	:= irq_ipr.o irq_imask.o init.o
 
 obj-$(CONFIG_CPU_SH2)		+= sh2/
 obj-$(CONFIG_CPU_SH3)		+= sh3/
 obj-$(CONFIG_CPU_SH4)		+= sh4/
 
-obj-$(CONFIG_SH_DMA)            += dma.o
 obj-$(CONFIG_SH_RTC)            += rtc.o
 obj-$(CONFIG_UBC_WAKEUP)	+= ubc.o
 
diff -Nru a/arch/sh/kernel/cpu/dma.c b/arch/sh/kernel/cpu/dma.c
--- a/arch/sh/kernel/cpu/dma.c	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,211 +0,0 @@
-/*
- * arch/sh/kernel/cpu/dma.c
- *
- * Copyright (C) 2000 Takashi YOSHII
- * Copyright (C) 2003 Paul Mundt
- *
- * PC like DMA API for SuperH's DMAC.
- *
- * 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.
- */
-
-#include <linux/config.h>
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/module.h>
-
-#include <asm/signal.h>
-#include <asm/dma.h>
-
-static struct dma_info_t *dma_info[MAX_DMA_CHANNELS];
-static struct dma_info_t *autoinit_info[SH_MAX_DMA_CHANNELS] = {0};
-extern spinlock_t dma_spin_lock;
-
-/*
- * The SuperH DMAC supports a number of transmit sizes, we list them here,
- * with their respective values as they appear in the CHCR registers.
- *
- * Defaults to a 64-bit transfer size.
- */
-enum {
-	XMIT_SZ_64BIT	= 0,
-	XMIT_SZ_8BIT	= 1,
-	XMIT_SZ_16BIT	= 2,
-	XMIT_SZ_32BIT	= 3,
-	XMIT_SZ_256BIT	= 4,
-};
-
-/*
- * The DMA count is defined as the number of bytes to transfer.
- */
-static unsigned int ts_shift[] = {
-	[XMIT_SZ_64BIT]		3,
-	[XMIT_SZ_8BIT]		0,
-	[XMIT_SZ_16BIT]		1,
-	[XMIT_SZ_32BIT]		2,
-	[XMIT_SZ_256BIT]	5,
-};
-
-/*
- * We determine the correct shift size based off of the CHCR transmit size
- * for the given channel. Since we know that it will take:
- *
- * 	info->count >> ts_shift[transmit_size]
- *
- * iterations to complete the transfer.
- */
-static inline unsigned int calc_xmit_shift(struct dma_info_t *info)
-{
-	return ts_shift[(ctrl_inl(CHCR[info->chan]) >> 4) & 0x0007];
-}
-
-static irqreturn_t dma_tei(int irq, void *dev_id, struct pt_regs *regs)
-{
-	int chan = irq - DMTE_IRQ[0];
-	struct dma_info_t *info = autoinit_info[chan];
-
-	if( info->mode & DMA_MODE_WRITE )
-		ctrl_outl(info->mem_addr, SAR[info->chan]);
-	else
-		ctrl_outl(info->mem_addr, DAR[info->chan]);
-
-	ctrl_outl(info->count >> calc_xmit_shift(info), DMATCR[info->chan]);
-	ctrl_outl(ctrl_inl(CHCR[info->chan])&~CHCR_TE, CHCR[info->chan]);
-
-	return IRQ_HANDLED;
-}
-
-static struct irqaction irq_tei = {
-	.handler	= dma_tei,
-	.flags		= SA_INTERRUPT,
-	.name		= "dma_tei",
-};
-
-void setup_dma(unsigned int dmanr, struct dma_info_t *info)
-{
-	make_ipr_irq(DMTE_IRQ[info->chan], DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY);
-	setup_irq(DMTE_IRQ[info->chan], &irq_tei);
-	dma_info[dmanr] = info;
-}
-
-unsigned long claim_dma_lock(void)
-{
-	unsigned long flags;
-	spin_lock_irqsave(&dma_spin_lock, flags);
-	return flags;
-}
-
-void release_dma_lock(unsigned long flags)
-{
-	spin_unlock_irqrestore(&dma_spin_lock, flags);
-}
-
-void enable_dma(unsigned int dmanr)
-{
-	struct dma_info_t *info = dma_info[dmanr];
-	unsigned long chcr;
-
-	chcr = ctrl_inl(CHCR[info->chan]);
-	chcr |= CHCR_DE;
-	ctrl_outl(chcr, CHCR[info->chan]);
-}
-
-void disable_dma(unsigned int dmanr)
-{
-	struct dma_info_t *info = dma_info[dmanr];
-	unsigned long chcr;
-
-	chcr = ctrl_inl(CHCR[info->chan]);
-	chcr &= ~CHCR_DE;
-	ctrl_outl(chcr, CHCR[info->chan]);
-}
-
-void set_dma_mode(unsigned int dmanr, char mode)
-{
-	struct dma_info_t *info = dma_info[dmanr];
-
-	info->mode = mode;
-	set_dma_addr(dmanr, info->mem_addr);
-	set_dma_count(dmanr, info->count);
-	autoinit_info[info->chan] = info;
-}
-
-void set_dma_addr(unsigned int dmanr, unsigned int a)
-{
-	struct dma_info_t *info = dma_info[dmanr];
-	unsigned long sar, dar;
-
-	info->mem_addr = a;
-	sar = (info->mode & DMA_MODE_WRITE)? info->mem_addr: info->dev_addr;
-	dar = (info->mode & DMA_MODE_WRITE)? info->dev_addr: info->mem_addr;
-	ctrl_outl(sar, SAR[info->chan]);
-	ctrl_outl(dar, DAR[info->chan]);
-}
-
-void set_dma_count(unsigned int dmanr, unsigned int count)
-{
-	struct dma_info_t *info = dma_info[dmanr];
-	info->count = count;
-	ctrl_outl(count >> calc_xmit_shift(info), DMATCR[info->chan]);
-}
-
-int get_dma_residue(unsigned int dmanr)
-{
-	struct dma_info_t *info = dma_info[dmanr];
-	return (ctrl_inl(DMATCR[info->chan]) << calc_xmit_shift(info));
-}
-
-#if defined(CONFIG_CPU_SH4)
-static irqreturn_t dma_err(int irq, void *dev_id, struct pt_regs *regs)
-{
-	printk(KERN_WARNING "DMAE: DMAOR=%x\n",ctrl_inl(DMAOR));
-	ctrl_outl(ctrl_inl(DMAOR)&~DMAOR_NMIF, DMAOR);
-	ctrl_outl(ctrl_inl(DMAOR)&~DMAOR_AE, DMAOR);
-	ctrl_outl(ctrl_inl(DMAOR)|DMAOR_DME, DMAOR);
-
-	return IRQ_HANDLED;
-}
-
-static struct irqaction irq_err = {
-	.handler	= dma_err,
-	.flags		= SA_INTERRUPT,
-	.name		= "dma_err",
-};
-#endif
-
-int __init init_dma(void)
-{
-#if defined(CONFIG_CPU_SH4)
-	make_ipr_irq(DMAE_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY);
-	setup_irq(DMAE_IRQ, &irq_err);
-#endif
-
-	ctrl_outl(DMAOR_DME, DMAOR);
-	return 0;
-}
-
-static void __exit exit_dma(void)
-{
-#ifdef CONFIG_CPU_SH4
-	free_irq(DMAE_IRQ, 0);
-#endif
-}
-
-module_init(init_dma);
-module_exit(exit_dma);
-
-MODULE_LICENSE("GPL");
-
-EXPORT_SYMBOL(setup_dma);
-EXPORT_SYMBOL(claim_dma_lock);
-EXPORT_SYMBOL(release_dma_lock);
-EXPORT_SYMBOL(enable_dma);
-EXPORT_SYMBOL(disable_dma);
-EXPORT_SYMBOL(set_dma_mode);
-EXPORT_SYMBOL(set_dma_addr);
-EXPORT_SYMBOL(set_dma_count);
-EXPORT_SYMBOL(get_dma_residue);
-
diff -Nru a/arch/sh/kernel/cpu/init.c b/arch/sh/kernel/cpu/init.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/kernel/cpu/init.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,214 @@
+/*
+ * arch/sh/kernel/cpu/init.c
+ *
+ * CPU init code
+ *
+ * Copyright (C) 2002, 2003  Paul Mundt
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <asm/processor.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+#include <asm/cacheflush.h>
+#include <asm/cache.h>
+#include <asm/io.h>
+
+extern void detect_cpu_and_cache_system(void);
+
+/*
+ * Generic wrapper for command line arguments to disable on-chip
+ * peripherals (nofpu, nodsp, and so forth).
+ */
+#define onchip_setup(x) 			\
+static int x##_disabled __initdata = 0; 	\
+						\
+static int __init x##_setup(char *opts)		\
+{						\
+	x##_disabled = 1;			\
+	return 0;				\
+}						\
+__setup("no" __stringify(x), x##_setup);
+
+onchip_setup(fpu);
+onchip_setup(dsp);
+
+/*
+ * Generic first-level cache init
+ */
+static void __init cache_init(void)
+{
+	unsigned long ccr, flags = 0;
+
+	if (cpu_data->type == CPU_SH_NONE)
+		panic("Unknown CPU");
+
+	jump_to_P2();
+	ccr = ctrl_inl(CCR);
+
+	/*
+	 * If the cache is already enabled .. flush it.
+	 */
+	if (ccr & CCR_CACHE_ENABLE) {
+		unsigned long entries, i, j;
+
+		entries = cpu_data->dcache.sets;
+
+		/*
+		 * If the OC is already in RAM mode, we only have
+		 * half of the entries to flush..
+		 */
+		if (ccr & CCR_CACHE_ORA)
+			entries >>= 1;
+
+		for (i = 0; i < entries; i++) {
+			for (j = 0; j < cpu_data->dcache.ways; j++) {
+				unsigned long data, addr;
+
+				addr = CACHE_OC_ADDRESS_ARRAY |
+					(j << cpu_data->dcache.way_shift) |
+					(i << cpu_data->dcache.entry_shift);
+
+				data = ctrl_inl(addr);
+
+				if ((data & (SH_CACHE_UPDATED | SH_CACHE_VALID))
+					== (SH_CACHE_UPDATED | SH_CACHE_VALID))
+					ctrl_outl(data & ~SH_CACHE_UPDATED, addr);
+			}
+		}
+	}
+
+	/* 
+	 * Default CCR values .. enable the caches
+	 * and flush them immediately..
+	 */
+	flags |= CCR_CACHE_ENABLE | CCR_CACHE_INVALIDATE;
+	
+#ifdef CCR_CACHE_EMODE
+	flags |= (ccr & CCR_CACHE_EMODE);
+#endif
+
+#ifdef CONFIG_SH_WRITETHROUGH
+	/* Turn on Write-through caching */
+	flags |= CCR_CACHE_WT;
+#else
+	/* .. or default to Write-back */
+	flags |= CCR_CACHE_CB;
+#endif
+
+#ifdef CONFIG_SH_OCRAM
+	/* Turn on OCRAM -- halve the OC */
+	flags |= CCR_CACHE_ORA;
+	cpu_data->dcache.sets >>= 1;
+#endif
+
+	ctrl_outl(flags, CCR);
+	back_to_P1();
+}
+
+#ifdef CONFIG_SH_DSP
+static void __init release_dsp(void)
+{
+	unsigned long sr;
+
+	/* Clear SR.DSP bit */
+	__asm__ __volatile__ (
+		"stc\tsr, %0\n\t"
+		"and\t%1, %0\n\t"
+		"ldc\t%0, sr\n\t"
+		: "=&r" (sr)
+		: "r" (~SR_DSP)
+	);
+}
+
+static void __init dsp_init(void)
+{
+	unsigned long sr;
+
+	/*
+	 * Set the SR.DSP bit, wait for one instruction, and then read
+	 * back the SR value.
+	 */
+	__asm__ __volatile__ (
+		"stc\tsr, %0\n\t"
+		"or\t%1, %0\n\t"
+		"ldc\t%0, sr\n\t"
+		"nop\n\t"
+		"stc\tsr, %0\n\t"
+		: "=&r" (sr)
+		: "r" (SR_DSP)
+	);
+
+	/* If the DSP bit is still set, this CPU has a DSP */
+	if (sr & SR_DSP)
+		set_bit(CPU_HAS_DSP, &(cpu_data->flags));
+	
+	/* Now that we've determined the DSP status, clear the DSP bit. */
+	release_dsp();
+}
+#endif /* CONFIG_SH_DSP */
+
+/*
+ * sh_cpu_init
+ *
+ * This is our initial entry point for each CPU, and is invoked on the boot
+ * CPU prior to calling start_kernel(). For SMP, a combination of this and
+ * start_secondary() will bring up each processor to a ready state prior
+ * to hand forking the idle loop.
+ *
+ * We do all of the basic processor init here, including setting up the
+ * caches, FPU, DSP, kicking the UBC, etc. By the time start_kernel() is
+ * hit (and subsequently platform_setup()) things like determining the
+ * CPU subtype and initial configuration will all be done.
+ *
+ * Each processor family is still responsible for doing its own probing
+ * and cache configuration in detect_cpu_and_cache_system().
+ */
+asmlinkage void __init sh_cpu_init(void)
+{
+	/* First, probe the CPU */
+	detect_cpu_and_cache_system();
+
+	/* Init the cache */
+	cache_init();
+
+	/* Disable the FPU */
+	if (fpu_disabled) {
+		printk("FPU Disabled\n");
+		cpu_data->flags &= ~CPU_HAS_FPU;
+		release_fpu();
+	}
+
+	/* FPU initialization */
+	if (test_bit(CPU_HAS_FPU, &(cpu_data->flags))) {
+		clear_thread_flag(TIF_USEDFPU);
+		current->used_math = 0;
+	}
+
+#ifdef CONFIG_SH_DSP
+	/* Probe for DSP */
+	dsp_init();
+	
+	/* Disable the DSP */
+	if (dsp_disabled) {
+		printk("DSP Disabled\n");
+		cpu_data->flags &= ~CPU_HAS_DSP;
+		release_dsp();
+	}
+#endif
+
+#ifdef CONFIG_UBC_WAKEUP
+	/*
+	 * Some brain-damaged loaders decided it would be a good idea to put
+	 * the UBC to sleep. This causes some issues when it comes to things
+	 * like PTRACE_SINGLESTEP or doing hardware watchpoints in GDB.  So ..
+	 * we wake it up and hope that all is well.
+	 */
+	ubc_wakeup();
+#endif
+}
+
diff -Nru a/arch/sh/kernel/cpu/sh3/Makefile b/arch/sh/kernel/cpu/sh3/Makefile
--- a/arch/sh/kernel/cpu/sh3/Makefile	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/kernel/cpu/sh3/Makefile	Tue Feb  3 19:45:17 2004
@@ -2,3 +2,5 @@
 # Makefile for the Linux/SuperH SH-3 backends.
 #
 
+obj-y	:= ex.o
+
diff -Nru a/arch/sh/kernel/cpu/sh3/ex.S b/arch/sh/kernel/cpu/sh3/ex.S
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/kernel/cpu/sh3/ex.S	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,124 @@
+/*
+ *  arch/sh/kernel/cpu/sh3/ex.S
+ *
+ *  The SH-3 exception vector table.
+
+ *  Copyright (C) 1999, 2000, 2002  Niibe Yutaka
+ *  Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ *
+ */
+#include <linux/linkage.h>
+#include <linux/config.h>
+
+	.align 2
+	.data
+
+ENTRY(exception_handling_table)
+	.long	exception_error		/* 000 */
+	.long	exception_error
+#if defined(CONFIG_MMU)
+	.long	tlb_miss_load		/* 040 */
+	.long	tlb_miss_store
+	.long	initial_page_write
+	.long	tlb_protection_violation_load
+	.long	tlb_protection_violation_store
+	.long	address_error_load
+	.long	address_error_store	/* 100 */
+#else
+	.long	exception_error	! tlb miss load		/* 040 */
+	.long	exception_error	! tlb miss store
+	.long	exception_error	! initial page write
+	.long	exception_error	! tlb prot violation load
+	.long	exception_error	! tlb prot violation store
+	.long	exception_error	! address error load
+	.long	exception_error	! address error store	/* 100 */
+#endif
+	.long	exception_error	! fpu_exception	/* 120 */
+	.long	exception_error			/* 140 */
+	.long	system_call	! Unconditional Trap	 /* 160 */
+	.long	exception_error	! reserved_instruction (filled by trap_init) /* 180 */
+	.long	exception_error	! illegal_slot_instruction (filled by trap_init) /*1A0*/
+ENTRY(nmi_slot)
+#if defined (CONFIG_KGDB_NMI)
+	.long	debug_enter	/* 1C0 */	! Allow trap to debugger
+#else
+	.long	exception_none	/* 1C0 */	! Not implemented yet
+#endif
+ENTRY(user_break_point_trap)
+	.long	break_point_trap	/* 1E0 */
+ENTRY(interrupt_table)
+	! external hardware
+	.long	do_IRQ	! 0000		/* 200 */
+	.long	do_IRQ	! 0001
+	.long	do_IRQ	! 0010
+	.long	do_IRQ	! 0011
+	.long	do_IRQ	! 0100
+	.long	do_IRQ	! 0101
+	.long	do_IRQ	! 0110
+	.long	do_IRQ	! 0111
+	.long	do_IRQ	! 1000		/* 300 */
+	.long	do_IRQ	! 1001
+	.long	do_IRQ	! 1010
+	.long	do_IRQ	! 1011
+	.long	do_IRQ	! 1100
+	.long	do_IRQ	! 1101
+	.long	do_IRQ	! 1110
+	.long	exception_error		
+	! Internal hardware
+	.long	do_IRQ	! TMU0 tuni0	/* 400 */
+	.long	do_IRQ	! TMU1 tuni1
+	.long	do_IRQ	! TMU2 tuni2
+	.long	do_IRQ	!      ticpi2
+	.long	do_IRQ	! RTC  ati
+	.long	do_IRQ	!      pri
+	.long	do_IRQ	!      cui
+	.long	do_IRQ	! SCI  eri
+	.long	do_IRQ	!      rxi	/* 500 */
+	.long	do_IRQ	!      txi
+	.long	do_IRQ	!      tei
+	.long	do_IRQ	! WDT  iti	/* 560 */
+	.long	do_IRQ	! REF  rcmi
+	.long	do_IRQ	!      rovi
+	.long	do_IRQ			
+	.long	do_IRQ			/* 5E0 */
+#if  defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709)
+	.long	do_IRQ	! 32 IRQ  irq0	/* 600 */
+	.long	do_IRQ	! 33      irq1
+	.long	do_IRQ	! 34      irq2
+	.long	do_IRQ	! 35      irq3
+	.long	do_IRQ	! 36      irq4
+	.long	do_IRQ	! 37      irq5
+	.long	do_IRQ	! 38
+	.long	do_IRQ	! 39
+	.long	do_IRQ	! 40 PINT pint0-7	/* 700 */
+	.long	do_IRQ	! 41      pint8-15
+	.long	do_IRQ	! 42
+	.long	do_IRQ	! 43
+	.long	do_IRQ	! 44
+	.long	do_IRQ	! 45	
+	.long	do_IRQ	! 46
+	.long	do_IRQ	! 47
+	.long	do_IRQ	! 48 DMAC dei0	/* 800 */
+	.long	do_IRQ	! 49      dei1
+	.long	do_IRQ	! 50      dei2
+	.long	do_IRQ	! 51      dei3
+	.long	do_IRQ	! 52 IrDA eri1
+	.long	do_IRQ	! 53      rxi1
+	.long	do_IRQ	! 54      bri1
+	.long	do_IRQ	! 55      txi1
+	.long	do_IRQ	! 56 SCIF eri2
+	.long	do_IRQ	! 57      rxi2
+	.long	do_IRQ	! 58      bri2
+	.long	do_IRQ	! 59      txi2
+	.long	do_IRQ	! 60 ADC  adi	/* 980 */
+#if defined(CONFIG_CPU_SUBTYPE_SH7707)
+	.long   do_IRQ	! 61 LCDC lcdi	/* 9A0 */
+	.long   do_IRQ	! 62 PCC  pcc0i
+	.long   do_IRQ	! 63      pcc1i	/* 9E0 */
+#endif
+#endif
+
diff -Nru a/arch/sh/kernel/cpu/sh4/Makefile b/arch/sh/kernel/cpu/sh4/Makefile
--- a/arch/sh/kernel/cpu/sh4/Makefile	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/kernel/cpu/sh4/Makefile	Tue Feb  3 19:45:17 2004
@@ -2,13 +2,8 @@
 # Makefile for the Linux/SuperH SH-4 backends.
 #
 
-obj-y	:= fpu.o
+obj-y	:= fpu.o ex.o
 
 obj-$(CONFIG_CPU_SUBTYPE_ST40STB1)	+= irq_intc2.o
-obj-$(CONFIG_CPU_SUBTYPE_SH7751)	+= irq_intc2.o
-
-ifeq ($(CONFIG_PCI),y)
-obj-$(CONFIG_CPU_SUBTYPE_ST40STB1)	+= pci-st40.o
-obj-$(CONFIG_CPU_SUBTYPE_SH7751)	+= pci-sh7751.o 
-endif
+obj-$(CONFIG_SH_STORE_QUEUES)		+= sq.o
 
diff -Nru a/arch/sh/kernel/cpu/sh4/ex.S b/arch/sh/kernel/cpu/sh4/ex.S
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/kernel/cpu/sh4/ex.S	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,316 @@
+/*
+ *  arch/sh/kernel/cpu/sh4/ex.S
+ *
+ *  The SH-4 exception vector table.
+
+ *  Copyright (C) 1999, 2000, 2002  Niibe Yutaka
+ *  Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ *
+ */
+#include <linux/linkage.h>
+#include <linux/config.h>
+
+	.align 2
+	.data
+
+ENTRY(exception_handling_table)
+	.long	exception_error		/* 000 */
+	.long	exception_error
+#if defined(CONFIG_MMU)
+	.long	tlb_miss_load		/* 040 */
+	.long	tlb_miss_store
+	.long	initial_page_write
+	.long	tlb_protection_violation_load
+	.long	tlb_protection_violation_store
+	.long	address_error_load
+	.long	address_error_store	/* 100 */
+#else
+	.long	exception_error	! tlb miss load		/* 040 */
+	.long	exception_error	! tlb miss store
+	.long	exception_error	! initial page write
+	.long	exception_error	! tlb prot violation load
+	.long	exception_error	! tlb prot violation store
+	.long	exception_error	! address error load
+	.long	exception_error	! address error store	/* 100 */
+#endif
+
+	.long	do_fpu_error		/* 120 */
+	.long	exception_error		/* 140 */
+	.long	system_call	! Unconditional Trap	 /* 160 */
+	.long	exception_error	! reserved_instruction (filled by trap_init) /* 180 */
+	.long	exception_error	! illegal_slot_instruction (filled by trap_init) /*1A0*/
+ENTRY(nmi_slot)
+#if defined (CONFIG_KGDB_NMI)
+	.long	debug_enter	/* 1C0 */	! Allow trap to debugger
+#else
+	.long	exception_none	/* 1C0 */	! Not implemented yet
+#endif
+ENTRY(user_break_point_trap)
+	.long	break_point_trap	/* 1E0 */
+ENTRY(interrupt_table)
+	! external hardware
+	.long	do_IRQ	! 0000		/* 200 */
+	.long	do_IRQ	! 0001
+	.long	do_IRQ	! 0010
+	.long	do_IRQ	! 0011
+	.long	do_IRQ	! 0100
+	.long	do_IRQ	! 0101
+	.long	do_IRQ	! 0110
+	.long	do_IRQ	! 0111
+	.long	do_IRQ	! 1000		/* 300 */
+	.long	do_IRQ	! 1001
+	.long	do_IRQ	! 1010
+	.long	do_IRQ	! 1011
+	.long	do_IRQ	! 1100
+	.long	do_IRQ	! 1101
+	.long	do_IRQ	! 1110
+	.long	exception_error		
+	! Internal hardware
+	.long	do_IRQ	! TMU0 tuni0	/* 400 */
+	.long	do_IRQ	! TMU1 tuni1
+	.long	do_IRQ	! TMU2 tuni2
+	.long	do_IRQ	!      ticpi2
+#if  defined(CONFIG_CPU_SUBTYPE_SH7760)
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error			/* 500 */
+	.long	exception_error
+	.long	exception_error
+#else
+	.long	do_IRQ	! RTC  ati
+	.long	do_IRQ	!      pri
+	.long	do_IRQ	!      cui
+	.long	do_IRQ	! SCI  eri
+	.long	do_IRQ	!      rxi	/* 500 */
+	.long	do_IRQ	!      txi
+	.long	do_IRQ	!      tei
+#endif
+	.long	do_IRQ	! WDT  iti	/* 560 */
+	.long	do_IRQ	! REF  rcmi
+	.long	do_IRQ	!      rovi
+	.long	do_IRQ			
+	.long	do_IRQ			/* 5E0 */
+	.long	do_IRQ	! 32 Hitachi UDI	/* 600 */
+	.long	do_IRQ	! 33 GPIO
+	.long	do_IRQ	! 34 DMAC dmte0
+	.long	do_IRQ	! 35      dmte1
+	.long	do_IRQ	! 36      dmte2
+	.long	do_IRQ	! 37      dmte3
+	.long	do_IRQ	! 38      dmae
+	.long	exception_error			! 39	/* 6E0 */
+#if defined(CONFIG_CPU_SUBTYPE_SH7760)
+	.long	exception_error				/* 700 */
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error				/* 760 */
+#else
+	.long	do_IRQ	! 40 SCIF eri		/* 700 */
+	.long	do_IRQ	! 41      rxi
+	.long	do_IRQ	! 42      bri
+	.long	do_IRQ	! 43      txi
+#endif
+#if CONFIG_NR_ONCHIP_DMA_CHANNELS == 8
+	.long	do_IRQ	! 44 DMAC dmte4		/* 780 */
+	.long	do_IRQ	! 45      dmte5
+	.long	do_IRQ	! 46      dmte6
+	.long	do_IRQ	! 47      dmte7		/* 7E0 */
+#else
+	.long	exception_error			! 44	/* 780 */
+	.long	exception_error			! 45
+	.long	exception_error			! 46
+	.long	exception_error			! 47
+#endif
+	.long	do_fpu_state_restore	! 48	/* 800 */
+	.long	do_fpu_state_restore	! 49	/* 820 */
+#if defined(CONFIG_CPU_SUBTYPE_SH7751)
+	.long	exception_error			/* 840 */
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error			/* 900 */
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error
+	.long	do_IRQ	! PCI serr	/* A00 */
+	.long	do_IRQ	!     dma3
+	.long	do_IRQ	!     dma2
+	.long	do_IRQ	!     dma1
+	.long	do_IRQ	!     dma0
+	.long	do_IRQ	!     pwon
+	.long	do_IRQ	!     pwdwn
+	.long	do_IRQ	!     err
+	.long	do_IRQ	! TMU3 tuni3	/* B00 */
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error
+	.long	do_IRQ	! TMU4 tuni4	/* B80 */
+#elif defined(CONFIG_CPU_SUBTYPE_SH7760)
+	.long	do_IRQ	! IRQ	irq6	/* 840 */
+	.long	do_IRQ	!	irq7
+	.long	do_IRQ	! SCIF	eri0
+	.long	do_IRQ	!	rxi0
+	.long	do_IRQ	!	bri0
+	.long	do_IRQ	!	txi0
+	.long	do_IRQ	! HCAN2	cani0	/* 900 */
+	.long	do_IRQ	!	cani1
+	.long	do_IRQ	! SSI	ssii0
+	.long	do_IRQ	!	ssii1
+	.long	do_IRQ	! HAC	haci0
+	.long	do_IRQ	!	haci1
+	.long	do_IRQ	! IIC	iici0
+	.long	do_IRQ	!	iici1
+	.long	do_IRQ	! USB	usbi	/* A00 */
+	.long	do_IRQ	! LCDC	vint
+	.long	exception_error
+	.long	exception_error
+	.long	do_IRQ	! DMABRG dmabrgi0
+	.long	do_IRQ	!        dmabrgi1
+	.long	do_IRQ	!        dmabrgi2
+	.long	exception_error
+	.long	do_IRQ	! SCIF	eri1	/* B00 */
+	.long	do_IRQ	!	rxi1
+	.long	do_IRQ	!	bri1
+	.long	do_IRQ	!	txi1
+	.long	do_IRQ	!	eri2
+	.long	do_IRQ	!	rxi2
+	.long	do_IRQ	!	bri2
+	.long	do_IRQ  !	txi2
+	.long	do_IRQ	! SIM	simeri	/* C00 */
+	.long	do_IRQ	!	simrxi
+	.long	do_IRQ	!	simtxi
+	.long	do_IRQ	!	simtei
+	.long	do_IRQ	! HSPI	spii
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error
+	.long	do_IRQ	! MMCIF	mmci0	/* D00 */
+	.long	do_IRQ	!	mmci1
+	.long	do_IRQ	!	mmci2
+	.long	do_IRQ	!	mmci3
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error			/* E00 */
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error
+	.long	do_IRQ	! MFI	mfii
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error			/* F00 */
+	.long	exception_error
+	.long	exception_error
+	.long	exception_error
+	.long	do_IRQ	! ADC	adi
+	.long	do_IRQ	! CMT	cmti	/* FA0 */
+#elif defined(CONFIG_CPU_SUBTYPE_ST40STB1)
+	.long	exception_error			!  50 0x840
+	.long	exception_error			!  51 0x860
+	.long	exception_error			!  52 0x880
+	.long	exception_error			!  53 0x8a0
+	.long	exception_error			!  54 0x8c0
+	.long	exception_error			!  55 0x8e0
+	.long	exception_error			!  56 0x900
+	.long	exception_error			!  57 0x920
+	.long	exception_error			!  58 0x940
+	.long	exception_error			!  59 0x960
+	.long	exception_error			!  60 0x980
+	.long	exception_error			!  61 0x9a0
+	.long	exception_error			!  62 0x9c0
+	.long	exception_error			!  63 0x9e0
+	.long	do_IRQ	!  64 0xa00 PCI serr
+	.long	do_IRQ	!  65 0xa20     err
+	.long	do_IRQ	!  66 0xa40     ad
+	.long	do_IRQ	!  67 0xa60     pwr_dwn
+	.long	exception_error			!  68 0xa80
+	.long	exception_error			!  69 0xaa0
+	.long	exception_error			!  70 0xac0
+	.long	exception_error			!  71 0xae0
+	.long	do_IRQ	!  72 0xb00 DMA INT0
+	.long	do_IRQ	!  73 0xb20     INT1
+	.long	do_IRQ	!  74 0xb40     INT2
+	.long	do_IRQ	!  75 0xb60     INT3
+	.long	do_IRQ	!  76 0xb80     INT4
+	.long	exception_error			!  77 0xba0
+	.long	do_IRQ	!  78 0xbc0 DMA ERR
+	.long	exception_error			!  79 0xbe0
+	.long	do_IRQ	!  80 0xc00 PIO0
+	.long	do_IRQ	!  81 0xc20 PIO1
+	.long	do_IRQ	!  82 0xc40 PIO2
+	.long	exception_error			!  83 0xc60
+	.long	exception_error			!  84 0xc80
+	.long	exception_error			!  85 0xca0
+	.long	exception_error			!  86 0xcc0
+	.long	exception_error			!  87 0xce0
+	.long	exception_error			!  88 0xd00
+	.long	exception_error			!  89 0xd20
+	.long	exception_error			!  90 0xd40
+	.long	exception_error			!  91 0xd60
+	.long	exception_error			!  92 0xd80
+	.long	exception_error			!  93 0xda0
+	.long	exception_error			!  94 0xdc0
+	.long	exception_error			!  95 0xde0
+	.long	exception_error			!  96 0xe00
+	.long	exception_error			!  97 0xe20
+	.long	exception_error			!  98 0xe40
+	.long	exception_error			!  99 0xe60
+	.long	exception_error			! 100 0xe80
+	.long	exception_error			! 101 0xea0
+	.long	exception_error			! 102 0xec0
+	.long	exception_error			! 103 0xee0
+	.long	exception_error			! 104 0xf00
+	.long	exception_error			! 105 0xf20
+	.long	exception_error			! 106 0xf40
+	.long	exception_error			! 107 0xf60
+	.long	exception_error			! 108 0xf80
+	.long	exception_error			! 109 0xfa0
+	.long	exception_error			! 110 0xfc0
+	.long	exception_error			! 111 0xfe0
+	.long	do_IRQ	! 112 0x1000 Mailbox
+	.long	exception_error			! 113 0x1020
+	.long	exception_error			! 114 0x1040
+	.long	exception_error			! 115 0x1060
+	.long	exception_error			! 116 0x1080
+	.long	exception_error			! 117 0x10a0
+	.long	exception_error			! 118 0x10c0
+	.long	exception_error			! 119 0x10e0
+	.long	exception_error			! 120 0x1100
+	.long	exception_error			! 121 0x1120
+	.long	exception_error			! 122 0x1140
+	.long	exception_error			! 123 0x1160
+	.long	exception_error			! 124 0x1180
+	.long	exception_error			! 125 0x11a0
+	.long	exception_error			! 126 0x11c0
+	.long	exception_error			! 127 0x11e0
+	.long	exception_error			! 128 0x1200
+	.long	exception_error			! 129 0x1220
+	.long	exception_error			! 130 0x1240
+	.long	exception_error			! 131 0x1260
+	.long	exception_error			! 132 0x1280
+	.long	exception_error			! 133 0x12a0
+	.long	exception_error			! 134 0x12c0
+	.long	exception_error			! 135 0x12e0
+	.long	exception_error			! 136 0x1300
+	.long	exception_error			! 137 0x1320
+	.long	exception_error			! 138 0x1340
+	.long	exception_error			! 139 0x1360
+	.long	do_IRQ	! 140 0x1380 EMPI INV_ADDR
+	.long	exception_error			! 141 0x13a0
+	.long	exception_error			! 142 0x13c0
+	.long	exception_error			! 143 0x13e0
+#endif
+
diff -Nru a/arch/sh/kernel/cpu/sh4/fpu.c b/arch/sh/kernel/cpu/sh4/fpu.c
--- a/arch/sh/kernel/cpu/sh4/fpu.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/kernel/cpu/sh4/fpu.c	Tue Feb  3 19:45:17 2004
@@ -1,4 +1,4 @@
-/* $Id: fpu.c,v 1.2 2003/05/04 19:29:54 lethal Exp $
+/* $Id: fpu.c,v 1.3 2003/09/23 23:15:44 lethal Exp $
  *
  * linux/arch/sh/kernel/fpu.c
  *
@@ -18,6 +18,14 @@
 #include <asm/processor.h>
 #include <asm/io.h>
 
+/* The PR (precision) bit in the FP Status Register must be clear when
+ * an frchg instruction is executed, otherwise the instruction is undefined.
+ * Executing frchg with PR set causes a trap on some SH4 implementations.
+ */
+
+#define FPSCR_RCHG 0x00000000
+
+
 /*
  * Save FPU registers onto task structure.
  * Assume called with FPU enabled (SR.FD=0).
@@ -61,9 +69,11 @@
 		     "fmov.s	fr3, @-%0\n\t"
 		     "fmov.s	fr2, @-%0\n\t"
 		     "fmov.s	fr1, @-%0\n\t"
-		     "fmov.s	fr0, @-%0"
+		     "fmov.s	fr0, @-%0\n\t"
+		     "lds	%2, fpscr\n\t"
 		     : /* no output */
 		     : "r" ((char *)(&tsk->thread.fpu.hard.status)),
+		       "r" (FPSCR_RCHG),
 		       "r" (FPSCR_INIT)
 		     : "memory");
 
@@ -112,7 +122,7 @@
 		     "lds.l	@%0+, fpscr\n\t"
 		     "lds.l	@%0+, fpul\n\t"
 		     : /* no output */
-		     : "r" (&tsk->thread.fpu), "r" (FPSCR_INIT)
+		     : "r" (&tsk->thread.fpu), "r" (FPSCR_RCHG)
 		     : "memory");
 }
 
@@ -160,9 +170,10 @@
 		     "fsts	fpul, fr13\n\t"
 		     "fsts	fpul, fr14\n\t"
 		     "fsts	fpul, fr15\n\t"
-		     "frchg"
+		     "frchg\n\t"
+		     "lds	%2, fpscr\n\t"
 		     : /* no output */
-		     : "r" (0), "r" (FPSCR_INIT));
+		     : "r" (0), "r" (FPSCR_RCHG), "r" (FPSCR_INIT));
 }
 
 /**
diff -Nru a/arch/sh/kernel/cpu/sh4/pci-sh7751.c b/arch/sh/kernel/cpu/sh4/pci-sh7751.c
--- a/arch/sh/kernel/cpu/sh4/pci-sh7751.c	Tue Feb  3 19:45:37 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,503 +0,0 @@
-/*
- *	Low-Level PCI Support for the SH7751
- *
- *  Dustin McIntire (dustin@sensoria.com)
- *	Derived from arch/i386/kernel/pci-*.c which bore the message:
- *	(c) 1999--2000 Martin Mares <mj@ucw.cz>
- *	
- *  May be copied or modified under the terms of the GNU General Public
- *  License.  See linux/COPYING for more information.
- *
-*/
-
-#include <linux/config.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/pci.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/errno.h>
-#include <linux/irq.h>
-
-#include <asm/machvec.h>
-#include <asm/io.h>
-#include <asm/pci-sh7751.h>
-
-struct pci_ops *pci_check_direct(void);
-void pcibios_resource_survey(void);
-static u8 pcibios_swizzle(struct pci_dev *dev, u8 *pin);
-static int pcibios_lookup_irq(struct pci_dev *dev, u8 slot, u8 pin);
-
-unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1;
-int pcibios_last_bus = -1;
-struct pci_bus *pci_root_bus;
-struct pci_ops *pci_root_ops;
-
-/*
- * Direct access to PCI hardware...
- */
-
-#ifdef CONFIG_PCI_DIRECT
-
-
-#define CONFIG_CMD(bus, devfn, where) (0x80000000 | (bus->number << 16) | (devfn << 8) | (where & ~3))
-
-#define PCI_REG(reg) (SH7751_PCIREG_BASE+reg)
-
-/*
- * Functions for accessing PCI configuration space with type 1 accesses
- */
-static int pci_conf1_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
-{
-	unsigned long flags;
-	u32 word;
-
-	/* 
-	 * PCIPDR may only be accessed as 32 bit words, 
-	 * so we must do byte alignment by hand 
-	 */
-	local_irq_save(flags);
-	outl(CONFIG_CMD(bus,devfn,where), PCI_REG(SH7751_PCIPAR));
-	word = inl(PCI_REG(SH7751_PCIPDR));
-	local_irq_restore(flags);
-
-	switch (size) {
-	case 1:
-		switch (where & 0x3) {
-		    	case 3: *value = (u8)(word >> 24); break;
-			case 2: *value = (u8)(word >> 16); break;
-			case 1: *value = (u8)(word >> 8);  break;
-		}
-		break;
-	case 2:
-		switch (where & 0x2) {
-			case 2:	*value = (u16)(word >> 16); break;
-			case 1: *value = (u16)(word >> 8);  break;
-		}
-		break;
-	case 4:
-		*value = word;
-		break;
-	}
-
-	PCIDBG(4,"pci_conf1_read@0x%08x=0x%x\n", CONFIG_CMD(bus,devfn,where),*value); 
-
-	return PCIBIOS_SUCCESSFUL;
-}
-
-/* 
- * Since SH7751 only does 32bit access we'll have to do a read,mask,write operation.  
- * We'll allow an odd byte offset, though it should be illegal.
- */ 
-static int pci_conf1_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value)
-{
-	u32 word,mask;
-	unsigned long flags;
-	u32 shift = (where & 3) * 8;
-
-	if(size == 1) {
-		mask = ((1 << 8) - 1) << shift;  // create the byte mask
-	} else if(size == 2){
-		if(shift == 24)
-			return PCIBIOS_BAD_REGISTER_NUMBER;           
-		mask = ((1 << 16) - 1) << shift;  // create the word mask
-	}
-
-	local_irq_save(flags);
-	outl(CONFIG_CMD(bus,devfn,where), PCI_REG(SH7751_PCIPAR));
-
-	if(size == 4){
-		outl(value, PCI_REG(SH7751_PCIPDR));
-		local_irq_restore(flags);
-
-		PCIDBG(4,"pci_conf1_write@0x%08x=0x%x\n", CONFIG_CMD(bus,devfn,where),value);
-
-		return PCIBIOS_SUCCESSFUL;
-	}
-
-	word = inl(PCI_REG(SH7751_PCIPDR)) ;
-	word &= ~mask;
-	word |= value << shift;
-	outl(word, PCI_REG(SH7751_PCIPDR));
-	local_irq_restore(flags);
-
-	PCIDBG(4,"pci_conf1_write@0x%08x=0x%x\n", CONFIG_CMD(bus,devfn,where),word);
-
-	return PCIBIOS_SUCCESSFUL;
-}
-
-#undef CONFIG_CMD
-
-static struct pci_ops pci_direct_conf1 = {
-	.read =		pci_conf1_read,
-	.write = 	pci_conf1_write,
-};
-
-struct pci_ops * __init pci_check_direct(void)
-{
-	unsigned int tmp, id;
-
-	/* check for SH7751 hardware */
-	id = (SH7751_DEVICE_ID << 16) | SH7751_VENDOR_ID;
-	if(inl(SH7751_PCIREG_BASE+SH7751_PCICONF0) != id) {
-		PCIDBG(2,"PCI: This is not an SH7751\n");
-		return NULL;
-	}
-	/*
-	 * Check if configuration works.
-	 */
-	if (pci_probe & PCI_PROBE_CONF1) {
-		tmp = inl (PCI_REG(SH7751_PCIPAR));
-		outl (0x80000000, PCI_REG(SH7751_PCIPAR));
-		if (inl (PCI_REG(SH7751_PCIPAR)) == 0x80000000) {
-			outl (tmp, PCI_REG(SH7751_PCIPAR));
-			printk(KERN_INFO "PCI: Using configuration type 1\n");
-			request_region(PCI_REG(SH7751_PCIPAR), 8, "PCI conf1");
-			return &pci_direct_conf1;
-		}
-		outl (tmp, PCI_REG(SH7751_PCIPAR));
-	}
-
-	PCIDBG(2,"PCI: pci_check_direct failed\n");
-	return NULL;
-}
-
-#endif
-
-/*
- * BIOS32 and PCI BIOS handling.
- * 
- * The BIOS version of the pci functions is not yet implemented but it is left
- * in for completeness.  Currently an error will be generated at compile time. 
- */
- 
-#ifdef CONFIG_PCI_BIOS
-
-#error PCI BIOS is not yet supported on SH7751
-
-#endif /* CONFIG_PCI_BIOS */
-
-/***************************************************************************************/
-
-/*
- *  Handle bus scanning and fixups ....
- */
-
-
-/*
- * Discover remaining PCI buses in case there are peer host bridges.
- * We use the number of last PCI bus provided by the PCI BIOS.
- */
-static void __init pcibios_fixup_peer_bridges(void)
-{
-	int n;
-	struct pci_bus bus;
-	struct pci_dev dev;
-	u16 l;
-
-	if (pcibios_last_bus <= 0 || pcibios_last_bus >= 0xff)
-		return;
-	PCIDBG(2,"PCI: Peer bridge fixup\n");
-	for (n=0; n <= pcibios_last_bus; n++) {
-		if (pci_find_bus(0, n))
-			continue;
-		bus.number = n;
-		bus.ops = pci_root_ops;
-		dev.bus = &bus;
-		for(dev.devfn=0; dev.devfn<256; dev.devfn += 8)
-			if (!pci_read_config_word(&dev, PCI_VENDOR_ID, &l) &&
-			    l != 0x0000 && l != 0xffff) {
-				PCIDBG(3,"Found device at %02x:%02x [%04x]\n", n, dev.devfn, l);
-				printk(KERN_INFO "PCI: Discovered peer bus %02x\n", n);
-				pci_scan_bus(n, pci_root_ops, NULL);
-				break;
-			}
-	}
-}
-
-
-static void __init pci_fixup_ide_bases(struct pci_dev *d)
-{
-	int i;
-
-	/*
-	 * PCI IDE controllers use non-standard I/O port decoding, respect it.
-	 */
-	if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE)
-		return;
-	PCIDBG(3,"PCI: IDE base address fixup for %s\n", pci_name(d));
-	for(i=0; i<4; i++) {
-		struct resource *r = &d->resource[i];
-		if ((r->start & ~0x80) == 0x374) {
-			r->start |= 2;
-			r->end = r->start;
-		}
-	}
-}
-
-
-/* Add future fixups here... */
-struct pci_fixup pcibios_fixups[] = {
-	{ PCI_FIXUP_HEADER,	PCI_ANY_ID,	PCI_ANY_ID,	pci_fixup_ide_bases },
-	{ 0 }
-};
-
-/*
- *  Called after each bus is probed, but before its children
- *  are examined.
- */
-
-void __init pcibios_fixup_bus(struct pci_bus *b)
-{
-	pci_read_bridge_bases(b);
-}
-
-/*
- * Initialization. Try all known PCI access methods. Note that we support
- * using both PCI BIOS and direct access: in such cases, we use I/O ports
- * to access config space.
- * 
- * Note that the platform specific initialization (BSC registers, and memory
- * space mapping) will be called via the machine vectors (sh_mv.mv_pci_init()) if it
- * exitst and via the platform defined function pcibios_init_platform().  
- * See pci_bigsur.c for implementation;
- * 
- * The BIOS version of the pci functions is not yet implemented but it is left
- * in for completeness.  Currently an error will be genereated at compile time. 
- */
-
-void __init pcibios_init(void)
-{
-	struct pci_ops *bios = NULL;
-	struct pci_ops *dir = NULL;
-
-	PCIDBG(1,"PCI: Starting intialization.\n");
-#ifdef CONFIG_PCI_BIOS
-	if ((pci_probe & PCI_PROBE_BIOS) && ((bios = pci_find_bios()))) {
-		pci_probe |= PCI_BIOS_SORT;
-		pci_bios_present = 1;
-	}
-#endif
-#ifdef CONFIG_PCI_DIRECT
-	if (pci_probe & PCI_PROBE_CONF1 )
-		dir = pci_check_direct();
-#endif
-	if (dir) {
-		pci_root_ops = dir;
-	    if(!pcibios_init_platform())
-			PCIDBG(1,"PCI: Initialization failed\n");
-	    if (sh_mv.mv_init_pci != NULL)
-            sh_mv.mv_init_pci();
-	}
-	else if (bios)
-		pci_root_ops = bios;
-	else {
-		PCIDBG(1,"PCI: No PCI bus detected\n");
-		return;
-	}
-
-	PCIDBG(1,"PCI: Probing PCI hardware\n");
-	pci_root_bus = pci_scan_bus(0, pci_root_ops, NULL);
-	//pci_assign_unassigned_resources();
-	pci_fixup_irqs(pcibios_swizzle, pcibios_lookup_irq);
-	pcibios_fixup_peer_bridges();
-	pcibios_resource_survey();
-
-#ifdef CONFIG_PCI_BIOS
-	if ((pci_probe & PCI_BIOS_SORT) && !(pci_probe & PCI_NO_SORT))
-		pcibios_sort();
-#endif
-}
-
-char * __init pcibios_setup(char *str)
-{
-	if (!strcmp(str, "off")) {
-		pci_probe = 0;
-		return NULL;
-	}
-#ifdef CONFIG_PCI_BIOS
-	else if (!strcmp(str, "bios")) {
-		pci_probe = PCI_PROBE_BIOS;
-		return NULL;
-	} else if (!strcmp(str, "nobios")) {
-		pci_probe &= ~PCI_PROBE_BIOS;
-		return NULL;
-	} else if (!strcmp(str, "nosort")) {
-		pci_probe |= PCI_NO_SORT;
-		return NULL;
-	} else if (!strcmp(str, "biosirq")) {
-		pci_probe |= PCI_BIOS_IRQ_SCAN;
-		return NULL;
-	}
-#endif
-#ifdef CONFIG_PCI_DIRECT
-	else if (!strcmp(str, "conf1")) {
-		pci_probe = PCI_PROBE_CONF1 | PCI_NO_CHECKS;
-		return NULL;
-	}
-#endif
-	else if (!strcmp(str, "rom")) {
-		pci_probe |= PCI_ASSIGN_ROMS;
-		return NULL;
-	} else if (!strncmp(str, "lastbus=", 8)) {
-		pcibios_last_bus = simple_strtol(str+8, NULL, 0);
-		return NULL;
-	}
-	return str;
-}
-
-/*
- *    Allocate the bridge and device resources
- */
-
-static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
-{
-	struct list_head *ln;
-	struct pci_bus *bus;
-	struct pci_dev *dev;
-	int idx;
-	struct resource *r, *pr;
-	
-	PCIDBG(2,"PCI: pcibios_allocate_bus_reasources called\n" );
-	/* Depth-First Search on bus tree */
-	for (ln=bus_list->next; ln != bus_list; ln=ln->next) {
-		bus = pci_bus_b(ln);
-		if ((dev = bus->self)) {
-			for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) {
-				r = &dev->resource[idx];
-				if (!r->start)
-					continue;
-				pr = pci_find_parent_resource(dev, r);
-				if (!pr || request_resource(pr, r) < 0)
-					printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev));
-			}
-		}
-		pcibios_allocate_bus_resources(&bus->children);
-	}
-}
-
-static void __init pcibios_allocate_resources(int pass)
-{
-	struct pci_dev *dev;
-	int idx, disabled;
-	u16 command;
-	struct resource *r, *pr;
-
-	PCIDBG(2,"PCI: pcibios_allocate_resources pass %d called\n", pass);
-	pci_for_each_dev(dev) {
-		pci_read_config_word(dev, PCI_COMMAND, &command);
-		for(idx = 0; idx < 6; idx++) {
-			r = &dev->resource[idx];
-			if (r->parent)		/* Already allocated */
-				continue;
-			if (!r->start)		/* Address not assigned at all */
-				continue;
-			if (r->flags & IORESOURCE_IO)
-				disabled = !(command & PCI_COMMAND_IO);
-			else
-				disabled = !(command & PCI_COMMAND_MEMORY);
-			if (pass == disabled) {
-				PCIDBG(3,"PCI: Resource %08lx-%08lx (f=%lx, d=%d, p=%d)\n",
-				    r->start, r->end, r->flags, disabled, pass);
-				pr = pci_find_parent_resource(dev, r);
-				if (!pr || request_resource(pr, r) < 0) {
-					printk(KERN_ERR "PCI: Cannot allocate resource region %d of device %s\n", idx, pci_name(dev));
-					/* We'll assign a new address later */
-					r->end -= r->start;
-					r->start = 0;
-				}
-			}
-		}
-		if (!pass) {
-			r = &dev->resource[PCI_ROM_RESOURCE];
-			if (r->flags & PCI_ROM_ADDRESS_ENABLE) {
-				/* Turn the ROM off, leave the resource region, but keep it unregistered. */
-				u32 reg;
-				PCIDBG(3,"PCI: Switching off ROM of %s\n", pci_name(dev));
-				r->flags &= ~PCI_ROM_ADDRESS_ENABLE;
-				pci_read_config_dword(dev, dev->rom_base_reg, &reg);
-				pci_write_config_dword(dev, dev->rom_base_reg, reg & ~PCI_ROM_ADDRESS_ENABLE);
-			}
-		}
-	}
-}
-
-static void __init pcibios_assign_resources(void)
-{
-	struct pci_dev *dev;
-	int idx;
-	struct resource *r;
-
-	PCIDBG(2,"PCI: pcibios_assign_resources called\n");
-	pci_for_each_dev(dev) {
-		int class = dev->class >> 8;
-
-		/* Don't touch classless devices and host bridges */
-		if (!class || class == PCI_CLASS_BRIDGE_HOST)
-			continue;
-
-		for(idx=0; idx<6; idx++) {
-			r = &dev->resource[idx];
-
-			/*
-			 *  Don't touch IDE controllers and I/O ports of video cards!
-			 */
-			if ((class == PCI_CLASS_STORAGE_IDE && idx < 4) ||
-			    (class == PCI_CLASS_DISPLAY_VGA && (r->flags & IORESOURCE_IO)))
-				continue;
-
-			/*
-			 *  We shall assign a new address to this resource, either because
-			 *  the BIOS forgot to do so or because we have decided the old
-			 *  address was unusable for some reason.
-			 */
-			if (!r->start && r->end)
-				pci_assign_resource(dev, idx);
-		}
-
-		if (pci_probe & PCI_ASSIGN_ROMS) {
-			r = &dev->resource[PCI_ROM_RESOURCE];
-			r->end -= r->start;
-			r->start = 0;
-			if (r->end)
-				pci_assign_resource(dev, PCI_ROM_RESOURCE);
-		}
-	}
-}
-
-void __init pcibios_resource_survey(void)
-{
-	PCIDBG(1,"PCI: Allocating resources\n");
-	pcibios_allocate_bus_resources(&pci_root_buses);
-	pcibios_allocate_resources(0);
-	pcibios_allocate_resources(1);
-	pcibios_assign_resources();
-}
-
-
-/***************************************************************************************/
-/* 
- * 	IRQ functions 
- */
-static u8 __init pcibios_swizzle(struct pci_dev *dev, u8 *pin)
-{
-	/* no swizzling */
-	return PCI_SLOT(dev->devfn);
-}
-
-static int pcibios_lookup_irq(struct pci_dev *dev, u8 slot, u8 pin)
-{
-	int irq = -1;
-
-	/* now lookup the actual IRQ on a platform specific basis (pci-'platform'.c) */
-	irq = pcibios_map_platform_irq(slot,pin);
-	if( irq < 0 ) {
-	    PCIDBG(3,"PCI: Error mapping IRQ on device %s\n", dev->name);
-		return irq;
-	}
-	
-	PCIDBG(2,"Setting IRQ for slot %s to %d\n", pci_name(dev), irq);
-
-	return irq;
-}
diff -Nru a/arch/sh/kernel/cpu/sh4/pci-st40.c b/arch/sh/kernel/cpu/sh4/pci-st40.c
--- a/arch/sh/kernel/cpu/sh4/pci-st40.c	Tue Feb  3 19:45:29 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,423 +0,0 @@
-/* 
- * Copyright (C) 2001 David J. Mckay (david.mckay@st.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.                            
- *
- * Support functions for the ST40 PCI hardware.
- */
-
-#include <linux/config.h>
-#include <linux/kernel.h>
-#include <linux/smp.h>
-#include <linux/smp_lock.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-#include <linux/pci.h>
-#include <linux/delay.h>
-#include <linux/types.h>
-#include <asm/pci.h>
-#include <linux/irq.h>
-
-#include "pci-st40.h"
-
-/* This is in P2 of course */
-#define ST40PCI_BASE_ADDRESS     (0xb0000000)
-#define ST40PCI_MEM_ADDRESS      (ST40PCI_BASE_ADDRESS+0x0)
-#define ST40PCI_IO_ADDRESS       (ST40PCI_BASE_ADDRESS+0x06000000)
-#define ST40PCI_REG_ADDRESS      (ST40PCI_BASE_ADDRESS+0x07000000)
-
-#define ST40PCI_REG(x) (ST40PCI_REG_ADDRESS+(ST40PCI_##x))
-
-#define ST40PCI_WRITE(reg,val) writel((val),ST40PCI_REG(reg))
-#define ST40PCI_WRITE_SHORT(reg,val) writew((val),ST40PCI_REG(reg))
-#define ST40PCI_WRITE_BYTE(reg,val) writeb((val),ST40PCI_REG(reg))
-
-#define ST40PCI_READ(reg) readl(ST40PCI_REG(reg))
-#define ST40PCI_READ_SHORT(reg) readw(ST40PCI_REG(reg))
-#define ST40PCI_READ_BYTE(reg) readb(ST40PCI_REG(reg))
-
-#define ST40PCI_SERR_IRQ        64
-#define ST40PCI_SERR_INT_GROUP  0
-#define ST40PCI_SERR_INT_POS    0
-#define ST40PCI_SERR_INT_PRI    15
-
-#define ST40PCI_ERR_IRQ        65
-#define ST40PCI_ERR_INT_GROUP   1
-#define ST40PCI_ERR_INT_POS     1
-#define ST40PCI_ERR_INT_PRI     14
-
-
-/* Macros to extract PLL params */
-#define PLL_MDIV(reg)  ( ((unsigned)reg) & 0xff )
-#define PLL_NDIV(reg) ( (((unsigned)reg)>>8) & 0xff )
-#define PLL_PDIV(reg) ( (((unsigned)reg)>>16) & 0x3 )
-#define PLL_SETUP(reg) ( (((unsigned)reg)>>19) & 0x1ff )
-
-/* Build up the appropriate settings */
-#define PLL_SET(mdiv,ndiv,pdiv,setup) \
-( ((mdiv)&0xff) | (((ndiv)&0xff)<<8) | (((pdiv)&3)<<16)| (((setup)&0x1ff)<<19))
-
-#define PLLPCICR (0xbb040000+0x10)
-
-#define PLLPCICR_POWERON (1<<28)
-#define PLLPCICR_OUT_EN (1<<29)
-#define PLLPCICR_LOCKSELECT (1<<30)
-#define PLLPCICR_LOCK (1<<31)
-
-
-#define PLL_25MHZ 0x793c8512
-#define PLL_33MHZ PLL_SET(18,88,3,295)
-
-
-static __init void SetPCIPLL(void)
-{
-	/* Stop the PLL */
-	writel(0, PLLPCICR);
-
-	/* Always run at 33Mhz. The PCI clock is totally async 
-	 * to the rest of the system
-	 */
-	writel(PLL_33MHZ | PLLPCICR_POWERON, PLLPCICR);
-
-	printk("ST40PCI: Waiting for PCI PLL to lock\n");
-	while ((readl(PLLPCICR) & PLLPCICR_LOCK) == 0);
-	writel(readl(PLLPCICR) | PLLPCICR_OUT_EN, PLLPCICR);
-}
-
-
-static irqreturn_t st40_pci_irq(int irq, void *dev_instance, struct pt_regs *regs)
-{
-
-	unsigned pci_int, pci_air, pci_cir, pci_aint;
-
-	pci_int = ST40PCI_READ(INT);
-	pci_cir = ST40PCI_READ(CIR);
-	pci_air = ST40PCI_READ(AIR);
-
-	if (pci_int) {
-		printk("PCI INTERRUPT!\n");
-		printk("PCI INT -> 0x%x\n", pci_int & 0xffff);
-		printk("PCI AIR -> 0x%x\n", pci_air);
-		printk("PCI CIR -> 0x%x\n", pci_cir);
-		ST40PCI_WRITE(INT, ~0);
-	}
-
-	pci_aint = ST40PCI_READ(AINT);
-	if (pci_aint) {
-		printk("PCI ARB INTERRUPT!\n");
-		printk("PCI AINT -> 0x%x\n", pci_aint);
-		printk("PCI AIR -> 0x%x\n", pci_air);
-		printk("PCI CIR -> 0x%x\n", pci_cir);
-		ST40PCI_WRITE(AINT, ~0);
-	}
-
-	return IRQ_HANDLED;
-}
-
-
-/* Rounds a number UP to the nearest power of two. Used for
- * sizing the PCI window.
- */
-static u32 __init r2p2(u32 num)
-{
-	int i = 31;
-	u32 tmp = num;
-
-	if (num == 0)
-		return 0;
-
-	do {
-		if (tmp & (1 << 31))
-			break;
-		i--;
-		tmp <<= 1;
-	} while (i >= 0);
-
-	tmp = 1 << i;
-	/* If the original number isn't a power of 2, round it up */
-	if (tmp != num)
-		tmp <<= 1;
-
-	return tmp;
-}
-
-static void __init pci_fixup_ide_bases(struct pci_dev *d)
-{
-	int i;
-
-	/*
-	 * PCI IDE controllers use non-standard I/O port decoding, respect it.
-	 */
-	if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE)
-		return;
-	printk("PCI: IDE base address fixup for %s\n", pci_name(d));
-	for(i=0; i<4; i++) {
-		struct resource *r = &d->resource[i];
-		if ((r->start & ~0x80) == 0x374) {
-			r->start |= 2;
-			r->end = r->start;
-		}
-	}
-}
-
-
-/* Add future fixups here... */
-struct pci_fixup pcibios_fixups[] = {
-	{ PCI_FIXUP_HEADER,	PCI_ANY_ID,	PCI_ANY_ID,	pci_fixup_ide_bases },
-	{ 0 }
-};
-
-int __init st40pci_init(unsigned memStart, unsigned memSize)
-{
-	u32 lsr0;
-
-	SetPCIPLL();
-
-	/* Initialises the ST40 pci subsystem, performing a reset, then programming
-	 * up the address space decoders appropriately
-	 */
-
-	/* Should reset core here as well methink */
-
-	ST40PCI_WRITE(CR, CR_LOCK_MASK | CR_SOFT_RESET);
-
-	/* Loop while core resets */
-	while (ST40PCI_READ(CR) & CR_SOFT_RESET);
-
-	/* Now, lets reset all the cards on the bus with extreme prejudice */
-	ST40PCI_WRITE(CR, CR_LOCK_MASK | CR_RSTCTL);
-	udelay(250);
-
-	/* Set bus active, take it out of reset */
-	ST40PCI_WRITE(CR, CR_LOCK_MASK | CR_CFINT | CR_PFCS | CR_PFE);
-
-	/* The PCI spec says that no access must be made to the bus until 1 second
-	 * after reset. This seem ludicrously long, but some delay is needed here
-	 */
-	mdelay(1000);
-
-	/* Switch off interrupts */
-	ST40PCI_WRITE(INTM, 0);
-	ST40PCI_WRITE(AINT, 0);
-
-	/* Allow it to be a master */
-
-	ST40PCI_WRITE_SHORT(CSR_CMD,
-			    PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |
-			    PCI_COMMAND_IO);
-
-	/* Accesse to the 0xb0000000 -> 0xb6000000 area will go through to 0x10000000 -> 0x16000000
-	 * on the PCI bus. This allows a nice 1-1 bus to phys mapping.
-	 */
-
-
-	ST40PCI_WRITE(MBR, 0x10000000);
-	/* Always set the max size 128M (actually, it is only 96MB wide) */
-	ST40PCI_WRITE(MBMR, 0x07ff0000);
-
-	/* I/O addresses are mapped at 0xb6000000 -> 0xb7000000. These are changed to 0, to 
-	 * allow cards that have legacy io such as vga to function correctly. This gives a 
-	 * maximum of 64K of io/space as only the bottom 16 bits of the address are copied 
-	 * over to the bus  when the transaction is made. 64K of io space is more than enough
-	 */
-	ST40PCI_WRITE(IOBR, 0x0);
-	/* Set up the 64K window */
-	ST40PCI_WRITE(IOBMR, 0x0);
-
-	/* Now we set up the mbars so the PCI bus can see the memory of the machine */
-
-	if (memSize < (64 * 1024)) {
-		printk("Ridiculous memory size of 0x%x?\n",memSize);
-		return 0;
-	}
-
-	lsr0 =
-	    (memSize >
-	     (512 * 1024 * 1024)) ? 0x1fff0001 : ((r2p2(memSize) -
-						   0x10000) | 0x1);
-
-	ST40PCI_WRITE(LSR0, lsr0);
-
-	ST40PCI_WRITE(CSR_MBAR0, memStart);
-	ST40PCI_WRITE(LAR0, memStart);
-
-	/* Maximise timeout values */
-	ST40PCI_WRITE_BYTE(CSR_TRDY, 0xff);
-	ST40PCI_WRITE_BYTE(CSR_RETRY, 0xff);
-	ST40PCI_WRITE_BYTE(CSR_MIT, 0xff);
-
-
-	/* Install the pci interrupt handlers */
-	make_intc2_irq(ST40PCI_SERR_IRQ, INTC2_BASE0,
-		       ST40PCI_SERR_INT_GROUP, ST40PCI_SERR_INT_POS,
-		       ST40PCI_SERR_INT_PRI);
-
-	make_intc2_irq(ST40PCI_ERR_IRQ, INTC2_BASE0, ST40PCI_ERR_INT_GROUP,
-		       ST40PCI_ERR_INT_POS, ST40PCI_ERR_INT_PRI);
-
-
-	return 1;
-}
-
-char * __init pcibios_setup(char *str)
-{
-	return str;
-}
-
-
-#define SET_CONFIG_BITS(bus,devfn,where)\
-  (((bus) << 16) | ((devfn) << 8) | ((where) & ~3) | (bus!=0))
-
-#define CONFIG_CMD(bus, devfn, where) SET_CONFIG_BITS(bus->number,devfn,where)
-
-
-static int CheckForMasterAbort(void)
-{
-	if (ST40PCI_READ(INT) & INT_MADIM) {
-		/* Should we clear config space version as well ??? */
-		ST40PCI_WRITE(INT, INT_MADIM);
-		ST40PCI_WRITE_SHORT(CSR_STATUS, 0);
-		return 1;
-	}
-
-	return 0;
-}
-
-/* Write to config register */
-static int st40pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 * val)
-{
-	ST40PCI_WRITE(PAR, CONFIG_CMD(bus, devfn, where));
-	switch (size) {
-		case 1:
-			*val = (u8)ST40PCI_READ_BYTE(PDR + (where & 3));
-			break;
-		case 2:
-			*val = (u16)ST40PCI_READ_SHORT(PDR + (where & 2));
-			break;
-		case 4:
-			*val = ST40PCI_READ(PDR);
-			break;
-	}
-
-	if (CheckForMasterAbort()){
-		switch (size) {
-			case 1:
-				*val = (u8)0xff;
-				break;
-			case 2:
-				*val = (u16)0xffff;
-				break;
-			case 4:
-				*val = 0xffffffff;
-				break;
-		}
-	}
-
-	return PCIBIOS_SUCCESSFUL;
-}
-
-static int st40pci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val)
-{
-	ST40PCI_WRITE(PAR, CONFIG_CMD(bus, devfn, where));
-
-	switch (size) {
-		case 1:
-			ST40PCI_WRITE_BYTE(PDR + (where & 3), (u8)val);
-			break;
-		case 2:
-			ST40PCI_WRITE_SHORT(PDR + (where & 2), (u16)val);
-			break;
-		case 4:
-			ST40PCI_WRITE(PDR, val);
-			break;
-	}
-
-	CheckForMasterAbort();
-
-	return PCIBIOS_SUCCESSFUL;
-}
-
-static struct pci_ops pci_config_ops = {
-	.read = 	st40pci_read,
-	.write = 	st40pci_write,
-};
-
-
-/* Everything hangs off this */
-static struct pci_bus *pci_root_bus;
-
-
-static u8 __init no_swizzle(struct pci_dev *dev, u8 * pin)
-{
-	return PCI_SLOT(dev->devfn);
-}
-
-
-/* This needs to be shunted out of here into the board specific bit */
-#define HARP_PCI_IRQ    1
-#define HARP_BRIDGE_IRQ 2
-#define OVERDRIVE_SLOT0_IRQ 0
-
-static int __init map_harp_irq(struct pci_dev *dev, u8 slot, u8 pin)
-{
-	switch (slot) {
-#ifdef CONFIG_SH_STB1_HARP
-	case 2:		/*This is the PCI slot on the */
-		return HARP_PCI_IRQ;
-	case 1:		/* this is the bridge */
-		return HARP_BRIDGE_IRQ;
-#elif defined(CONFIG_SH_STB1_OVERDRIVE)
-	case 1:
-	case 2:
-	case 3:
-		return slot - 1;
-#else
-#error Unknown board
-#endif
-	default:
-		return -1;
-	}
-}
-
-void __init pcibios_init(void)
-{
-	extern unsigned long memory_start, memory_end;
-
-	if (sh_mv.mv_init_pci != NULL) {
-		sh_mv.mv_init_pci();
-	}
-
-	/* The pci subsytem needs to know where memory is and how much 
-	 * of it there is. I've simply made these globals. A better mechanism
-	 * is probably needed.
-	 */
-	st40pci_init(PHYSADDR(memory_start),
-		     PHYSADDR(memory_end) - PHYSADDR(memory_start));
-
-	if (request_irq(ST40PCI_ERR_IRQ, st40_pci_irq, 
-                        SA_INTERRUPT, "st40pci", NULL)) {
-		printk(KERN_ERR "st40pci: Cannot hook interrupt\n");
-		return;
-	}
-
-	/* Enable the PCI interrupts on the device */
-	ST40PCI_WRITE(INTM, ~0);
-	ST40PCI_WRITE(AINT, ~0);
-
-	/* Map the io address apprioately */
-#ifdef CONFIG_HD64465
-	hd64465_port_map(PCIBIOS_MIN_IO, (64 * 1024) - PCIBIOS_MIN_IO + 1,
-			 ST40_IO_ADDR + PCIBIOS_MIN_IO, 0);
-#endif
-
-	/* ok, do the scan man */
-	pci_root_bus = pci_scan_bus(0, &pci_config_ops, NULL);
-	pci_assign_unassigned_resources();
-	pci_fixup_irqs(no_swizzle, map_harp_irq);
-
-}
-
-void __init pcibios_fixup_bus(struct pci_bus *bus)
-{
-}
diff -Nru a/arch/sh/kernel/cpu/sh4/pci-st40.h b/arch/sh/kernel/cpu/sh4/pci-st40.h
--- a/arch/sh/kernel/cpu/sh4/pci-st40.h	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,66 +0,0 @@
-/* 
- * Copyright (C) 2001 David J. Mckay (david.mckay@st.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.                            
- *
- * Defintions for the ST40 PCI hardware.
- */
-
-#ifndef __PCI_ST40_H__
-#define __PCI_ST40_H__
-
-#define ST40PCI_VCR_STATUS    0x00
-
-#define ST40PCI_VCR_VERSION   0x08
-
-#define ST40PCI_CR            0x10
-
-#define CR_SOFT_RESET (1<<12)
-#define CR_PFCS       (1<<11)
-#define CR_PFE        (1<<9)
-#define CR_BMAM       (1<<6)
-#define CR_HOST       (1<<5)
-#define CR_CLKEN      (1<<4)
-#define CR_SOCS       (1<<3)
-#define CR_IOCS       (1<<2)
-#define CR_RSTCTL     (1<<1)
-#define CR_CFINT      (1<<0)
-#define CR_LOCK_MASK  0x5a000000
-
-
-#define ST40PCI_LSR0          0X14
-#define ST40PCI_LAR0          0x1c
-
-#define ST40PCI_INT           0x24
-#define INT_MADIM             (1<<2)
-
-
-#define ST40PCI_INTM          0x28
-#define ST40PCI_AIR           0x2c
-#define ST40PCI_CIR           0x30
-#define ST40PCI_AINT          0x40
-#define ST40PCI_AINTM         0x44
-#define ST40PCI_BMIR          0x48
-#define ST40PCI_PAR           0x4c
-#define ST40PCI_MBR           0x50
-#define ST40PCI_IOBR          0x54
-#define ST40PCI_PINT          0x58
-#define ST40PCI_PINTM         0x5c
-#define ST40PCI_MBMR          0x70
-#define ST40PCI_IOBMR         0x74
-#define ST40PCI_PDR           0x78
-
-/* These are configs space registers */
-#define ST40PCI_CSR_VID               0x10000
-#define ST40PCI_CSR_DID               0x10002
-#define ST40PCI_CSR_CMD               0x10004
-#define ST40PCI_CSR_STATUS            0x10006
-#define ST40PCI_CSR_MBAR0             0x10010
-#define ST40PCI_CSR_TRDY              0x10040
-#define ST40PCI_CSR_RETRY             0x10041
-#define ST40PCI_CSR_MIT               0x1000d
-
-#define ST40_IO_ADDR 0xb6000000       
-
-#endif /* __PCI_ST40_H__ */
diff -Nru a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/kernel/cpu/sh4/sq.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,484 @@
+/*
+ * arch/sh/kernel/cpu/sq.c
+ *
+ * General management API for SH-4 integrated Store Queues
+ *
+ * Copyright (C) 2001, 2002, 2003  Paul Mundt
+ * Copyright (C) 2001, 2002  M. R. Brown
+ *
+ * Some of this code has been adopted directly from the old arch/sh/mm/sq.c
+ * hack that was part of the LinuxDC project. For all intensive purposes, this
+ * is a completely new interface that really doesn't have much in common with
+ * the old zone-based approach at all. Infact, I'm only listing it here for
+ * general completeness.
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/config.h>
+#include <linux/slab.h>
+#include <linux/list.h>
+#include <linux/proc_fs.h>
+#include <linux/miscdevice.h>
+
+#include <asm/io.h>
+#include <asm/page.h>
+#include <asm/mmu_context.h>
+#include <asm/cpu/sq.h>
+
+static LIST_HEAD(sq_mapping_list);
+
+/**
+ * sq_flush - Flush (prefetch) the store queue cache
+ *
+ * @addr: the store queue address to flush
+ *
+ * Executes a prefetch instruction on the specified store queue cache,
+ * so that the cached data is written to physical memory.
+ */
+inline void sq_flush(void *addr)
+{
+	__asm__ __volatile__ ("pref @%0": "=r" (addr) : : "memory");
+}
+
+/**
+ * sq_flush_range - Flush (prefetch) a specific SQ range
+ *
+ * @start: the store queue address to start flushing from
+ * @len: the length to flush
+ *
+ * Flushes the store queue cache from @start to @start + @len in a
+ * linear fashion.
+ */
+void sq_flush_range(unsigned long start, unsigned int len)
+{
+	volatile unsigned long *sq = (unsigned long *)start;
+
+	/* Flush the queues */
+	for (len >>= 5; len--; sq += 8)
+		sq_flush((void *)sq);
+	
+	/* Wait for completion */
+	sq = (volatile unsigned long *)start;
+}
+
+static struct sq_mapping *__sq_alloc_mapping(unsigned long virt, unsigned long phys, unsigned long size, const char *name)
+{
+	struct sq_mapping *map;
+
+	if (virt + size > SQ_ADDRMAX)
+		return ERR_PTR(-ENOSPC);
+
+	map = kmalloc(sizeof(struct sq_mapping), GFP_KERNEL);
+	if (!map)
+		return ERR_PTR(-ENOMEM);
+
+	INIT_LIST_HEAD(&map->list);
+
+	map->sq_addr	= virt;
+	map->addr	= phys;
+	map->size	= size;
+	map->name	= name;
+
+	list_add(&map->list, &sq_mapping_list);
+
+	return map;
+}
+
+static unsigned long __sq_get_next_addr(void)
+{
+	if (!list_empty(&sq_mapping_list)) {
+		struct list_head *pos, *tmp;
+		
+		/*
+		 * Read one off the list head, as it will have the highest
+		 * mapped allocation. Set the next one up right above it.
+		 *
+		 * This is somewhat sub-optimal, as we don't look at
+		 * gaps between allocations or anything lower then the
+		 * highest-level allocation.
+		 *
+		 * However, in the interest of performance and the general
+		 * lack of desire to do constant list rebalancing, we don't
+		 * worry about it.
+		 */
+		list_for_each_safe(pos, tmp, &sq_mapping_list) {
+			struct sq_mapping *entry;
+
+			entry = list_entry(pos, typeof(*entry), list);
+
+			return entry->sq_addr + entry->size;
+		}
+	}
+
+	return P4SEG_STORE_QUE;
+}
+
+/**
+ * __sq_remap - Perform a translation from the SQ to a phys addr
+ *
+ * @phys: Physical address to map store queues too.
+ * @virt: Associated store queue address.
+ *
+ * Maps the store queue address @virt to the physical address @phys.
+ */
+static struct sq_mapping *__sq_remap(struct sq_mapping *map)
+{
+	/*
+	 * First check the MMU status..
+	 */
+#ifndef CONFIG_MMU
+	/*
+	 * Without an MMU (or with it turned off), this is much more
+	 * straightforward, as we can just load up each queue's QACR with
+	 * the physical address appropriately masked.
+	 */
+	ctrl_outl(((map->addr >> 26) << 2) & 0x1c, SQ_QACR0);
+	ctrl_outl(((map->addr >> 26) << 2) & 0x1c, SQ_QACR1);
+#else
+	unsigned long flags, pteh, ptel;
+	pgprot_t pgprot;
+	pgd_t *pgd;
+	pmd_t *pmd;
+	pte_t *pte;
+
+	/*
+	 * With an MMU on the other hand, things are slightly more involved.
+	 * Namely, we have to have a direct mapping between the SQ addr and
+	 * the associated physical address in the UTLB by way of setting up
+	 * a virt<->phys translation by hand. We do this by simply specifying
+	 * the SQ addr in UTLB.VPN and the associated physical address in
+	 * UTLB.PPN.
+	 *
+	 * Notably, even though this is a special case translation, and some
+	 * of the configuration bits are meaningless, we're still required
+	 * to have a valid ASID context in PTEH.
+	 *
+	 * We could also probably get by without explicitly setting PTEA, but
+	 * we do it here just for good measure.
+	 */
+	local_irq_save(flags);
+
+	pteh = map->sq_addr;
+	ctrl_outl((pteh & MMU_VPN_MASK) | get_asid(), MMU_PTEH);
+
+	ptel = map->addr & PAGE_MASK;
+	ctrl_outl(((ptel >> 28) & 0xe) | (ptel & 0x1), MMU_PTEA);
+
+	pgprot = pgprot_noncached(PAGE_KERNEL);
+
+	ptel &= _PAGE_FLAGS_HARDWARE_MASK;
+	ptel |= pgprot_val(pgprot);
+	ctrl_outl(ptel, MMU_PTEL);
+
+	__asm__ __volatile__ ("ldtlb" : : : "memory");
+
+	/*
+	 * Next, we need to map ourselves in the kernel page table, so that
+	 * future accesses after a TLB flush will be handled when we take a
+	 * page fault.
+	 *
+	 * Theoretically we could just do this directly and not worry about
+	 * setting up the translation by hand ahead of time, but for the
+	 * cases where we want a one-shot SQ mapping followed by a quick
+	 * writeout before we hit the TLB flush, we do it anyways. This way
+	 * we at least save ourselves the initial page fault overhead.
+	 */
+	pgd = pgd_offset_k(map->sq_addr);
+
+	spin_lock(&init_mm.page_table_lock);
+
+	pmd = pmd_alloc(&init_mm, pgd, map->sq_addr);
+	if (!pmd)
+		goto out;
+	
+	pte = pte_alloc_map(&init_mm, pmd, map->sq_addr);
+	if (!pte)
+		goto out;
+	if (!pte_none(*pte)) {
+		pte_unmap(pte);
+		goto out;
+	}
+
+	set_pte(pte, mk_pte(phys_to_page(map->addr), pgprot));
+	pte_unmap(pte);
+
+out:
+	spin_unlock(&init_mm.page_table_lock);
+	sq_flush((void *)pteh);
+
+	local_irq_restore(flags);
+
+#endif /* CONFIG_MMU */
+
+	return map;
+}
+
+/**
+ * sq_remap - Map a physical address through the Store Queues
+ *
+ * @phys: Physical address of mapping.
+ * @size: Length of mapping.
+ * @name: User invoking mapping.
+ *
+ * Remaps the physical address @phys through the next available store queue
+ * address of @size length. @name is logged at boot time as well as through
+ * the procfs interface.
+ *
+ * A pre-allocated and filled sq_mapping pointer is returned, and must be
+ * cleaned up with a call to sq_unmap() when the user is done with the
+ * mapping.
+ */
+struct sq_mapping *sq_remap(unsigned long phys, unsigned int size, const char *name)
+{
+	struct sq_mapping *map;
+	unsigned long virt;
+	unsigned int psz;
+
+	phys &= PAGE_MASK;
+
+	virt  = __sq_get_next_addr();
+	psz   = (size + (PAGE_SIZE - 1)) / PAGE_SIZE;
+	map   = __sq_alloc_mapping(virt, phys, size, name);
+
+	printk("sqremap: %15s  [%4d page%s]  va 0x%08lx   pa 0x%08lx\n",
+	       map->name ? map->name : "???",
+	       psz, psz == 1 ? " " : "s",
+	       map->sq_addr, map->addr);
+
+	return __sq_remap(map);
+}
+
+/**
+ * sq_unmap - Unmap a Store Queue allocation
+ *
+ * @map: Pre-allocated Store Queue mapping.
+ *
+ * Unmaps the store queue allocation @map that was previously created by
+ * sq_remap(). Also frees up the pte that was previously inserted into
+ * the kernel page table and discards the UTLB translation.
+ */
+void sq_unmap(struct sq_mapping *map)
+{
+#ifdef CONFIG_MMU
+	pgd_t *pgd;
+	pmd_t *pmd;
+	pte_t *pte;
+	
+	pgd = pgd_offset_k(map->sq_addr);
+	pmd = pmd_offset(pgd, map->sq_addr);
+
+	if (pmd_none(*pmd))
+		return;
+	if (pmd_bad(*pmd)) {
+		pmd_ERROR(*pmd);
+		pmd_clear(pmd);
+		return;
+	}
+
+	pte = pte_offset_kernel(pmd, map->sq_addr);
+	if (pte_none(*pte) || pte_not_present(*pte))
+		return;
+
+	ptep_get_and_clear(pte);
+
+	__flush_tlb_page(get_asid(), map->sq_addr & PAGE_MASK);
+#endif
+
+	list_del(&map->list);
+	kfree(map);
+}
+
+/**
+ * sq_clear - Clear a store queue range
+ *
+ * @addr: Address to start clearing from.
+ * @len: Length to clear.
+ *
+ * A quick zero-fill implementation for clearing out memory that has been
+ * remapped through the store queues.
+ */
+void sq_clear(unsigned long addr, unsigned int len)
+{
+	int i;
+	
+	/* Clear out both queues linearly */
+	for (i = 0; i < 8; i++) {
+		ctrl_outl(0, addr + i + 0);
+		ctrl_outl(0, addr + i + 8);
+	}
+
+	sq_flush_range(addr, len);
+}
+
+/**
+ * sq_vma_unmap - Unmap a VMA range
+ *
+ * @area: VMA containing range.
+ * @addr: Start of range.
+ * @len: Length of range.
+ *
+ * Searches the sq_mapping_list for a mapping matching the sq addr @addr,
+ * and subsequently frees up the entry. Further cleanup is done by generic
+ * code.
+ */
+static void sq_vma_unmap(struct vm_area_struct *area,
+			 unsigned long addr, size_t len)
+{
+	struct list_head *pos, *tmp;
+
+	list_for_each_safe(pos, tmp, &sq_mapping_list) {
+		struct sq_mapping *entry;
+
+		entry = list_entry(pos, typeof(*entry), list);
+
+		if (entry->sq_addr == addr) {
+			/* 
+			 * We could probably get away without doing the tlb flush
+			 * here, as generic code should take care of most of this
+			 * when unmapping the rest of the VMA range for us. Leave
+			 * it in for added sanity for the time being..
+			 */
+			__flush_tlb_page(get_asid(), entry->sq_addr & PAGE_MASK);
+			
+			list_del(&entry->list);
+			kfree(entry);
+
+			return;
+		}	
+	}
+}
+
+/**
+ * sq_vma_sync - Sync a VMA range
+ *
+ * @area: VMA containing range.
+ * @start: Start of range.
+ * @len: Length of range.
+ * @flags: Additional flags.
+ *
+ * Synchronizes an sq mapped range by flushing the store queue cache for
+ * the duration of the mapping.
+ *
+ * Used internally for user mappings, which must use msync() to prefetch
+ * the store queue cache.
+ */
+static int sq_vma_sync(struct vm_area_struct *area,
+		       unsigned long start, size_t len, unsigned int flags)
+{
+	sq_flush_range(start, len);
+
+	return 0;
+}
+
+static struct vm_operations_struct sq_vma_ops = {
+	.unmap	= sq_vma_unmap,
+	.sync	= sq_vma_sync,
+};
+
+/**
+ * sq_mmap - mmap() for /dev/cpu/sq
+ *
+ * @file: unused.
+ * @vma: VMA to remap.
+ *
+ * Remap the specified vma @vma through the store queues, and setup associated
+ * information for the new mapping. Also build up the page tables for the new
+ * area.
+ */
+static int sq_mmap(struct file *file, struct vm_area_struct *vma)
+{
+	unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
+	unsigned long size = vma->vm_end - vma->vm_start;
+	struct sq_mapping *map;
+
+	/* 
+	 * We're not interested in any arbitrary virtual address that has
+	 * been stuck in the VMA, as we already know what addresses we
+	 * want. Save off the size, and reposition the VMA to begin at
+	 * the next available sq address.
+	 */
+	vma->vm_start = __sq_get_next_addr();
+	vma->vm_end   = vma->vm_start + size;
+
+	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+
+	vma->vm_flags |= VM_IO | VM_RESERVED;
+
+	map = __sq_alloc_mapping(vma->vm_start, offset, size, "Userspace");
+
+	if (io_remap_page_range(vma, map->sq_addr, map->addr,
+				size, vma->vm_page_prot))
+		return -EAGAIN;
+	
+	vma->vm_ops = &sq_vma_ops;
+
+	return 0;
+}
+
+#ifdef CONFIG_PROC_FS
+static int sq_mapping_read_proc(char *buf, char **start, off_t off,
+				int len, int *eof, void *data)
+{
+	struct list_head *pos;
+	char *p = buf;
+
+	list_for_each_prev(pos, &sq_mapping_list) {
+		struct sq_mapping *entry;
+		
+		entry = list_entry(pos, typeof(*entry), list);
+
+		p += sprintf(p, "%08lx-%08lx [%08lx]: %s\n", entry->sq_addr,
+			     entry->sq_addr + entry->size - 1, entry->addr,
+			     entry->name);
+	}
+
+	return p - buf;
+}
+#endif
+
+static struct file_operations sq_fops = {
+	.owner		= THIS_MODULE,
+	.mmap		= sq_mmap,
+};
+
+static struct miscdevice sq_dev = {
+	.minor		= STORE_QUEUE_MINOR,
+	.name		= "sq",
+	.devfs_name	= "cpu/sq",
+	.fops		= &sq_fops,
+};
+
+static int __init sq_api_init(void)
+{
+	printk(KERN_NOTICE "sq: Registering store queue API.\n");
+
+#ifdef CONFIG_PROC_FS
+	create_proc_read_entry("sq_mapping", 0, 0, sq_mapping_read_proc, 0);
+#endif
+
+	return misc_register(&sq_dev);
+}
+
+static void __exit sq_api_exit(void)
+{
+	misc_deregister(&sq_dev);
+}
+
+module_init(sq_api_init);
+module_exit(sq_api_exit);
+
+MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>, M. R. Brown <mrbrown@0xd6.org>");
+MODULE_DESCRIPTION("Simple API for SH-4 integrated Store Queues");
+MODULE_LICENSE("GPL");
+
+EXPORT_SYMBOL(sq_remap);
+EXPORT_SYMBOL(sq_unmap);
+EXPORT_SYMBOL(sq_clear);
+EXPORT_SYMBOL(sq_flush);
+EXPORT_SYMBOL(sq_flush_range);
+
diff -Nru a/arch/sh/kernel/dma.c b/arch/sh/kernel/dma.c
--- a/arch/sh/kernel/dma.c	Tue Feb  3 19:45:18 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,142 +0,0 @@
-/*
- * arch/sh/kernel/dma.c
- *
- * Copyright (C) 2000 Takashi YOSHII
- *
- * PC like DMA API for SuperH's DMAC.
- */
-
-#include <linux/config.h>
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-
-#include <asm/signal.h>
-#include <asm/dma.h>
-
-static struct dma_info_t *dma_info[MAX_DMA_CHANNELS];
-static struct dma_info_t *autoinit_info[SH_MAX_DMA_CHANNELS] = {0};
-static spinlock_t  dma_spin_lock;
-
-static unsigned int calc_chcr(struct dma_info_t *info)
-{
-	unsigned int chcr;
-
-	chcr = ( info->mode & DMA_MODE_WRITE )? info->mode_write : info->mode_read;
-	if( info->mode & DMA_AUTOINIT )
-		chcr |= CHCR_IE;
-	return chcr;
-}
-
-static __inline__ int ts_shift(unsigned long chcr)
-{
-	return ((int[]){3,0,1,2,5,0,0,0})[(chcr>>4)&0x000007];
-}
-
-static void dma_tei(int irq, void *dev_id, struct pt_regs *regs)
-{
-	int chan = irq - DMTE_IRQ[0];
-	struct dma_info_t *info = autoinit_info[chan];
-
-	if( info->mode & DMA_MODE_WRITE )
-		ctrl_outl(info->mem_addr, SAR[info->chan]);
-	else
-		ctrl_outl(info->mem_addr, DAR[info->chan]);
-
-	ctrl_outl(info->count>>ts_shift(calc_chcr(info)), DMATCR[info->chan]);
-	ctrl_outl(ctrl_inl(CHCR[info->chan])&~CHCR_TE, CHCR[info->chan]);
-}
-
-static struct irqaction irq_tei = { dma_tei, SA_INTERRUPT, 0, "dma_tei", NULL, NULL};
-
-void setup_dma(unsigned int dmanr, struct dma_info_t *info)
-{
-	make_ipr_irq(DMTE_IRQ[info->chan], DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY);
-	setup_irq(DMTE_IRQ[info->chan], &irq_tei);
-	dma_info[dmanr] = info;
-}
-
-unsigned long claim_dma_lock(void)
-{
-	unsigned long flags;
-	spin_lock_irqsave(&dma_spin_lock, flags);
-	return flags;
-}
-
-void release_dma_lock(unsigned long flags)
-{
-	spin_unlock_irqrestore(&dma_spin_lock, flags);
-}
-
-void enable_dma(unsigned int dmanr)
-{
-	struct dma_info_t *info = dma_info[dmanr];
-	ctrl_outl(calc_chcr(info)|CHCR_DE, CHCR[info->chan]);
-}
-
-void disable_dma(unsigned int dmanr)
-{
-	struct dma_info_t *info = dma_info[dmanr];
-	ctrl_outl(calc_chcr(info)&~CHCR_DE, CHCR[info->chan]);
-}
-
-void set_dma_mode(unsigned int dmanr, char mode)
-{
-	struct dma_info_t *info = dma_info[dmanr];
-
-	info->mode = mode;
-	set_dma_addr(dmanr, info->mem_addr);
-	set_dma_count(dmanr, info->count);
-	autoinit_info[info->chan] = info;
-}
-
-void set_dma_addr(unsigned int dmanr, unsigned int a)
-{
-	struct dma_info_t *info = dma_info[dmanr];
-	unsigned long sar, dar;
-
-	info->mem_addr = a;
-	sar = (info->mode & DMA_MODE_WRITE)? info->mem_addr: info->dev_addr;
-	dar = (info->mode & DMA_MODE_WRITE)? info->dev_addr: info->mem_addr;
-	ctrl_outl(sar, SAR[info->chan]);
-	ctrl_outl(dar, DAR[info->chan]);
-}
-
-void set_dma_count(unsigned int dmanr, unsigned int count)
-{
-	struct dma_info_t *info = dma_info[dmanr];
-	info->count = count;
-	ctrl_outl(count>>ts_shift(calc_chcr(info)), DMATCR[info->chan]);
-}
-
-int get_dma_residue(unsigned int dmanr)
-{
-	struct dma_info_t *info = dma_info[dmanr];
-	return ctrl_inl(DMATCR[info->chan])<<ts_shift(calc_chcr(info));
-}
-
-#if defined(__SH4__)
-static void dma_err(int irq, void *dev_id, struct pt_regs *regs)
-{
-	printk(KERN_WARNING "DMAE: DMAOR=%lx\n",ctrl_inl(DMAOR));
-	ctrl_outl(ctrl_inl(DMAOR)&~DMAOR_NMIF, DMAOR);
-	ctrl_outl(ctrl_inl(DMAOR)&~DMAOR_AE, DMAOR);
-	ctrl_outl(ctrl_inl(DMAOR)|DMAOR_DME, DMAOR);
-}
-static struct irqaction irq_err = { dma_err, SA_INTERRUPT, 0, "dma_err", NULL, NULL};
-#endif
-
-int __init init_dma(void)
-{
-#if defined(__SH4__)
-	make_ipr_irq(DMAE_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY);
-	setup_irq(DMAE_IRQ, &irq_err);
-#endif
-
-	ctrl_outl(DMAOR_DME, DMAOR);
-	return 0;
-}
-
-module_init(init_dma);
-
-/**/
diff -Nru a/arch/sh/kernel/entry.S b/arch/sh/kernel/entry.S
--- a/arch/sh/kernel/entry.S	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/kernel/entry.S	Tue Feb  3 19:45:17 2004
@@ -1,4 +1,4 @@
-/* $Id: entry.S,v 1.19 2003/05/06 23:28:47 lethal Exp $
+/* $Id: entry.S,v 1.33 2003/11/22 15:39:51 lethal Exp $
  *
  *  linux/arch/sh/entry.S
  *
@@ -24,6 +24,15 @@
 #if !defined(CONFIG_MMU)
 #define sys_madvise		sys_ni_syscall
 #define sys_readahead		sys_ni_syscall
+#define sys_mprotect		sys_ni_syscall
+#define sys_msync		sys_ni_syscall
+#define sys_mlock		sys_ni_syscall
+#define sys_munlock		sys_ni_syscall
+#define sys_mlockall		sys_ni_syscall
+#define sys_munlockall		sys_ni_syscall
+#define sys_mremap		sys_ni_syscall
+#define sys_mincore		sys_ni_syscall
+#define sys_remap_file_pages	sys_ni_syscall
 #endif
 
 ! NOTE:
@@ -137,6 +146,11 @@
 ! this first version depends *much* on C implementation.
 !
 
+#define CLI()				\
+	stc	sr, r0;			\
+	or	#0xf0, r0;		\
+	ldc	r0, sr
+
 #define STI()				\
 	mov.l	__INV_IMASK, r11;	\
 	stc	sr, r10;		\
@@ -145,29 +159,36 @@
 	or	r11, r10;		\
 	ldc	r10, sr
 
+#if defined(CONFIG_PREEMPT)
+#  define preempt_stop()	CLI()
+#else
+#  define preempt_stop()
+#  define resume_kernel		restore_all
+#endif
+
 #if defined(CONFIG_MMU)
 	.align	2
-tlb_miss_load:
+ENTRY(tlb_miss_load)
 	bra	call_dpf
 	 mov	#0, r5
 
 	.align	2
-tlb_miss_store:
+ENTRY(tlb_miss_store)
 	bra	call_dpf
 	 mov	#1, r5
 
 	.align	2
-initial_page_write:
+ENTRY(initial_page_write)
 	bra	call_dpf
 	 mov	#1, r5
 
 	.align	2
-tlb_protection_violation_load:
+ENTRY(tlb_protection_violation_load)
 	bra	call_dpf
 	 mov	#0, r5
 
 	.align	2
-tlb_protection_violation_store:
+ENTRY(tlb_protection_violation_store)
 	bra	call_dpf
 	 mov	#1, r5
 
@@ -199,12 +220,12 @@
 3:	.long	do_page_fault
 
 	.align	2
-address_error_load:
+ENTRY(address_error_load)
 	bra	call_dae
 	 mov	#0,r5		! writeaccess = 0
 
 	.align	2
-address_error_store:
+ENTRY(address_error_store)
 	bra	call_dae
 	 mov	#1,r5		! writeaccess = 1
 
@@ -244,7 +265,7 @@
 	jmp	@r0
 	 mov	r15, r4
 	.align	2
-3:	.long	SYMBOL_NAME(kgdb_handle_exception)
+3:	.long	kgdb_handle_exception
 #endif /* CONFIG_SH_KGDB */
 
 #if defined(CONFIG_SH_STANDARD_BIOS)
@@ -305,7 +326,7 @@
 	 nop
 
 	.align	2
-error:	
+ENTRY(exception_error)
 	!
 	STI()
 	mov.l	2f, r0
@@ -318,22 +339,53 @@
 2:	.long	do_exception_error
 
 	.align	2
-ret_from_irq:
 ret_from_exception:
+	preempt_stop()
+ret_from_irq:
+	!
 	mov	#OFF_SR, r0
 	mov.l	@(r0,r15), r0	! get status register
 	shll	r0
 	shll	r0		! kernel space?
-	bt/s	restore_all	! Yes, it's from kernel, go back soon
+	bt/s	resume_kernel	! Yes, it's from kernel, go back soon
 	 GET_THREAD_INFO(r8)
 
+#ifdef CONFIG_PREEMPT
+ENTRY(resume_kernel)
+	mov.l	@(TI_PRE_COUNT,r8), r0	! current_thread_info->preempt_count
+	tst	r0, r0
+	bf	restore_all
+need_resched:
+	mov.l	@(TI_FLAGS,r8), r0	! current_thread_info->flags
+	tst	#_TIF_NEED_RESCHED, r0	! need_resched set?
+	bt	restore_all
+
+	stc	sr, r0			! interrupts disabled?
+	tst	#0xf0, r0
+	bf	restore_all
+
+	mov.l	1f, r0
+	mov.l	r0, @(TI_PRE_COUNT,r8)
+
+	STI()
+	mov.l	2f, r0
+	jsr	@r0
+	 nop
+	mov	#0, r0
+	mov.l	r0, @(TI_PRE_COUNT,r8)
+	CLI()
+
+	bra need_resched
+	 nop
+
+	.align 2
+1:	.long	PREEMPT_ACTIVE
+2:	.long	schedule
+#endif
+
 ENTRY(resume_userspace)
 	! r8: current_thread_info
-	/* CLI */
-	stc	sr, r0
-	or	#0xf0, r0
-	ldc	r0, sr
-	!
+	CLI()
 	mov.l	@(TI_FLAGS,r8), r0		! current_thread_info->flags
 	tst	#_TIF_WORK_MASK, r0
 	bt/s	restore_all
@@ -377,10 +429,7 @@
 	mov.l	1f, r1
 	jsr	@r1				! schedule
 	 nop
-	/* CLI */
-	stc	sr, r0
-	or	#0xf0, r0
-	ldc	r0, sr
+	CLI()
 	!
 	mov.l	@(TI_FLAGS,r8), r0		! current_thread_info->flags
 	tst	#_TIF_WORK_MASK, r0
@@ -469,7 +518,7 @@
 	.align	2
 1:	.long	schedule_tail
 	!
-system_call:
+ENTRY(system_call)
 	mov.l	1f, r9
 	mov.l	@r9, r8		! Read from TRA (Trap Address) Register
 	!
@@ -510,10 +559,7 @@
 	mov.l	r0, @(OFF_R0,r15)		! save the return value
 	!
 syscall_exit:
-	/* CLI */
-	stc	sr, r0
-	or	#0xf0, r0
-	ldc	r0, sr
+	CLI()
 	!
 	GET_THREAD_INFO(r8)
 	mov.l	@(TI_FLAGS,r8), r0		! current_thread_info->flags
@@ -550,6 +596,40 @@
 	lds.l	@r15+, macl
 	add	#4, r15			! Skip syscall number
 	!
+#ifdef CONFIG_SH_DSP
+	mov.l	@r15+, k0		! DSP mode marker
+	mov.l	5f, k1
+	cmp/eq	k0, k1			! Do we have a DSP stack frame?
+	bf	skip_restore
+
+	stc	sr, k0			! Enable CPU DSP mode
+	or	k1, k0			! (within kernel it may be disabled)
+	ldc	k0, sr
+	mov	r2, k0			! Backup r2
+
+	! Restore DSP registers from stack
+	mov	r15, r2
+	movs.l	@r2+, a1
+	movs.l	@r2+, a0g
+	movs.l	@r2+, a1g
+	movs.l	@r2+, m0
+	movs.l	@r2+, m1
+	mov	r2, r15
+
+	lds.l	@r15+, a0
+	lds.l	@r15+, x0
+	lds.l	@r15+, x1
+	lds.l	@r15+, y0
+	lds.l	@r15+, y1
+	lds.l	@r15+, dsr
+	ldc.l	@r15+, rs
+	ldc.l	@r15+, re
+	ldc.l	@r15+, mod
+
+	mov	k0, r2			! Restore r2
+skip_restore:
+#endif
+	!
 	! Calculate new SR value
 	mov	k3, k2			! original SR value
 	mov.l	8f, k1
@@ -576,6 +656,7 @@
 	mov	#0, k1
 	mov.b	k1, @k0
 #endif
+	mov.l	@r15+, k2		! restore EXPEVT
 	mov	k4, r15
 	rte
 	 nop
@@ -585,14 +666,12 @@
 2:	.long	NR_syscalls
 3:	.long	sys_call_table
 4:	.long	do_syscall_trace
+5:	.long	0x00001000	! DSP
 7:	.long	0x30000000
 8:	.long	0x00008000	! FD
 9:	.long	0xffff7f0f	! ~(IMASK+FD)
 __INV_IMASK:
 	.long	0xffffff0f	! ~(IMASK)
-#if defined(CONFIG_KGDB_NMI)
-10:	.long	in_nmi
-#endif
 
 ! Exception Vector Base
 !
@@ -637,7 +716,7 @@
 	 nop
 	.align	2
 5:	.long	NMI_VEC
-6:	.long	SYMBOL_NAME(in_nmi)
+6:	.long	in_nmi
 0:
 #endif /* defined(CONFIG_KGDB_NMI) */
 	bra	handle_exception
@@ -669,7 +748,50 @@
 	!
 1:  	mov	#-1, k4
 	mov.l	2f, k1
+	!
+#ifdef CONFIG_SH_DSP
+	mov.l	r2, @-r15		! Save r2, we need another reg
+	stc	sr, k4
+	mov.l	1f, r2
+	tst	r2, k4			! Check if in DSP mode
+	mov.l	@r15+, r2		! Restore r2 now
+	bt/s	skip_save
+	 mov	#0, k4			! Set marker for no stack frame
+
+	mov	r2, k4			! Backup r2 (in k4) for later
+
+	! Save DSP registers on stack
+	stc.l	mod, @-r15
+	stc.l	re, @-r15
+	stc.l	rs, @-r15
+	sts.l	dsr, @-r15
+	sts.l	y1, @-r15
+	sts.l	y0, @-r15
+	sts.l	x1, @-r15
+	sts.l	x0, @-r15
+	sts.l	a0, @-r15
+
+	! GAS is broken, does not generate correct "movs.l Ds,@-As" instr.
+
+	! FIXME: Make sure that this is still the case with newer toolchains,
+	! as we're not at all interested in supporting ancient toolchains at
+	! this point. -- PFM.
+
+	mov	r15, r2
+	.word	0xf653			! movs.l	a1, @-r2
+	.word	0xf6f3			! movs.l	a0g, @-r2
+	.word	0xf6d3			! movs.l	a1g, @-r2
+	.word	0xf6c3			! movs.l	m0, @-r2
+	.word	0xf6e3			! movs.l	m1, @-r2
+	mov	r2, r15
+
+	mov	k4, r2			! Restore r2
+	mov.l	1f, k4			! Force DSP stack frame
+skip_save:
+	mov.l	k4, @-r15		! Push DSP mode marker onto stack
+#endif
 	! Save the user registers on the stack.
+	mov.l	k2, @-r15	! EXPEVT
 	mov.l	k4, @-r15	! set TRA (default: -1)
 	!
 	sts.l	macl, @-r15
@@ -715,264 +837,17 @@
 	 nop
 
 	.align	2
+1:	.long	0x00001000	! DSP=1
 2:	.long	0x000000f0	! FD=0, IMASK=15
 3:	.long	0xcfffffff	! RB=0, BL=0
 4:	.long	exception_handling_table
 
 	.align	2
-none:
+ENTRY(exception_none)
 	rts
 	 nop
 
-.data
-ENTRY(exception_handling_table)
-	.long	error
-	.long	error
-#if defined(CONFIG_MMU)
-	.long	tlb_miss_load
-	.long	tlb_miss_store
-	.long	initial_page_write
-	.long	tlb_protection_violation_load
-	.long	tlb_protection_violation_store
-	.long	address_error_load
-	.long	address_error_store
-#else
-	.long	error	! tlb miss load
-	.long	error	! tlb miss store
-	.long	error	! initial page write
-	.long	error	! tlb prot violation load
-	.long	error	! tlb prot violation store
-	.long	error	! address error load
-	.long	error	! address error store
-#endif
-
-#if defined(CONFIG_CPU_SH4)
-	.long	do_fpu_error
-#else
-	.long	error	! fpu_exception
-#endif
-	.long	error
-	.long	system_call			! Unconditional Trap
-	.long	error	! reserved_instruction      (filled by trap_init)
-	.long	error	! illegal_slot_instruction  (filled by trap_init)
-ENTRY(nmi_slot)
-#if defined (CONFIG_KGDB_NMI)
-	.long	debug_enter			! Allow trap to debugger
-#else
-	.long	none				! Not implemented yet
-#endif
-ENTRY(user_break_point_trap)
-	.long	break_point_trap
-ENTRY(interrupt_table)
-	! external hardware
-	.long	do_IRQ	! 0000
-	.long	do_IRQ	! 0001
-	.long	do_IRQ	! 0010
-	.long	do_IRQ	! 0011
-	.long	do_IRQ	! 0100
-	.long	do_IRQ	! 0101
-	.long	do_IRQ	! 0110
-	.long	do_IRQ	! 0111
-	.long	do_IRQ	! 1000
-	.long	do_IRQ	! 1001
-	.long	do_IRQ	! 1010
-	.long	do_IRQ	! 1011
-	.long	do_IRQ	! 1100
-	.long	do_IRQ	! 1101
-	.long	do_IRQ	! 1110
-	.long	error
-	! Internal hardware
-	.long	do_IRQ	! TMU0 tuni0
-	.long	do_IRQ	! TMU1 tuni1
-	.long	do_IRQ	! TMU2 tuni2
-	.long	do_IRQ	!      ticpi2
-	.long	do_IRQ	! RTC  ati
-	.long	do_IRQ	!      pri
-	.long	do_IRQ	!      cui
-	.long	do_IRQ	! SCI  eri
-	.long	do_IRQ	!      rxi
-	.long	do_IRQ	!      txi
-	.long	do_IRQ	!      tei
-	.long	do_IRQ	! WDT  iti
-	.long	do_IRQ	! REF  rcmi
-	.long	do_IRQ	!      rovi
-	.long	do_IRQ
-	.long	do_IRQ
-#if  defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709)
-	.long	do_IRQ	! 32 IRQ  irq0
-	.long	do_IRQ	! 33      irq1
-	.long	do_IRQ	! 34      irq2
-	.long	do_IRQ	! 35      irq3
-	.long	do_IRQ	! 36      irq4
-	.long	do_IRQ	! 37      irq5
-	.long	do_IRQ	! 38
-	.long	do_IRQ	! 39
-	.long	do_IRQ	! 40 PINT pint0-7
-	.long	do_IRQ	! 41      pint8-15
-	.long	do_IRQ	! 42
-	.long	do_IRQ	! 43
-	.long	do_IRQ	! 44
-	.long	do_IRQ	! 45
-	.long	do_IRQ	! 46
-	.long	do_IRQ	! 47
-	.long	do_IRQ	! 48 DMAC dei0
-	.long	do_IRQ	! 49      dei1
-	.long	do_IRQ	! 50      dei2
-	.long	do_IRQ	! 51      dei3
-	.long	do_IRQ	! 52 IrDA eri1
-	.long	do_IRQ	! 53      rxi1
-	.long	do_IRQ	! 54      bri1
-	.long	do_IRQ	! 55      txi1
-	.long	do_IRQ	! 56 SCIF eri2
-	.long	do_IRQ	! 57      rxi2
-	.long	do_IRQ	! 58      bri2
-	.long	do_IRQ	! 59      txi2
-	.long	do_IRQ	! 60 ADC  adi
-#if defined(CONFIG_CPU_SUBTYPE_SH7707)
-	.long   do_IRQ	! 61 LCDC lcdi
-	.long   do_IRQ	! 62 PCC  pcc0i
-	.long   do_IRQ	! 63      pcc1i
-#endif
-#elif defined(CONFIG_CPU_SH4)
-	.long	do_IRQ	! 32 Hitachi UDI
-	.long	do_IRQ	! 33 GPIO
-	.long	do_IRQ	! 34 DMAC dmte0
-	.long	do_IRQ	! 35      dmte1
-	.long	do_IRQ	! 36      dmte2
-	.long	do_IRQ	! 37      dmte3
-	.long	do_IRQ	! 38      dmae
-	.long	error			! 39
-	.long	do_IRQ	! 40 SCIF eri
-	.long	do_IRQ	! 41      rxi
-	.long	do_IRQ	! 42      bri
-	.long	do_IRQ	! 43      txi
-	.long	error			! 44
-	.long	error			! 45
-	.long	error			! 46
-	.long	error			! 47
-	.long	do_fpu_state_restore	! 48
-	.long	do_fpu_state_restore	! 49
-#endif
-#if defined(CONFIG_CPU_SUBTYPE_SH7751)
-	.long	error
-	.long	error
-	.long	error
-	.long	error
-	.long	error
-	.long	error
-	.long	error
-	.long	error
-	.long	error
-	.long	error
-	.long	error
-	.long	error
-	.long	error
-	.long	error
-	.long	do_IRQ	! PCI serr
-	.long	do_IRQ	!     dma3
-	.long	do_IRQ	!     dma2
-	.long	do_IRQ	!     dma1
-	.long	do_IRQ	!     dma0
-	.long	do_IRQ	!     pwon
-	.long	do_IRQ	!     pwdwn
-	.long	do_IRQ	!     err
-#elif defined(CONFIG_CPU_SUBTYPE_ST40STB1)
-	.long	error			!  50 0x840
-	.long	error			!  51 0x860
-	.long	error			!  52 0x880
-	.long	error			!  53 0x8a0
-	.long	error			!  54 0x8c0
-	.long	error			!  55 0x8e0
-	.long	error			!  56 0x900
-	.long	error			!  57 0x920
-	.long	error			!  58 0x940
-	.long	error			!  59 0x960
-	.long	error			!  60 0x980
-	.long	error			!  61 0x9a0
-	.long	error			!  62 0x9c0
-	.long	error			!  63 0x9e0
-	.long	do_IRQ	!  64 0xa00 PCI serr
-	.long	do_IRQ	!  65 0xa20     err
-	.long	do_IRQ	!  66 0xa40     ad
-	.long	do_IRQ	!  67 0xa60     pwr_dwn
-	.long	error			!  68 0xa80
-	.long	error			!  69 0xaa0
-	.long	error			!  70 0xac0
-	.long	error			!  71 0xae0
-	.long	do_IRQ	!  72 0xb00 DMA INT0
-	.long	do_IRQ	!  73 0xb20     INT1
-	.long	do_IRQ	!  74 0xb40     INT2
-	.long	do_IRQ	!  75 0xb60     INT3
-	.long	do_IRQ	!  76 0xb80     INT4
-	.long	error			!  77 0xba0
-	.long	do_IRQ	!  78 0xbc0 DMA ERR
-	.long	error			!  79 0xbe0
-	.long	do_IRQ	!  80 0xc00 PIO0
-	.long	do_IRQ	!  81 0xc20 PIO1
-	.long	do_IRQ	!  82 0xc40 PIO2
-	.long	error			!  83 0xc60
-	.long	error			!  84 0xc80
-	.long	error			!  85 0xca0
-	.long	error			!  86 0xcc0
-	.long	error			!  87 0xce0
-	.long	error			!  88 0xd00
-	.long	error			!  89 0xd20
-	.long	error			!  90 0xd40
-	.long	error			!  91 0xd60
-	.long	error			!  92 0xd80
-	.long	error			!  93 0xda0
-	.long	error			!  94 0xdc0
-	.long	error			!  95 0xde0
-	.long	error			!  96 0xe00
-	.long	error			!  97 0xe20
-	.long	error			!  98 0xe40
-	.long	error			!  99 0xe60
-	.long	error			! 100 0xe80
-	.long	error			! 101 0xea0
-	.long	error			! 102 0xec0
-	.long	error			! 103 0xee0
-	.long	error			! 104 0xf00
-	.long	error			! 105 0xf20
-	.long	error			! 106 0xf40
-	.long	error			! 107 0xf60
-	.long	error			! 108 0xf80
-	.long	error			! 109 0xfa0
-	.long	error			! 110 0xfc0
-	.long	error			! 111 0xfe0
-	.long	do_IRQ	! 112 0x1000 Mailbox
-	.long	error			! 113 0x1020
-	.long	error			! 114 0x1040
-	.long	error			! 115 0x1060
-	.long	error			! 116 0x1080
-	.long	error			! 117 0x10a0
-	.long	error			! 118 0x10c0
-	.long	error			! 119 0x10e0
-	.long	error			! 120 0x1100
-	.long	error			! 121 0x1120
-	.long	error			! 122 0x1140
-	.long	error			! 123 0x1160
-	.long	error			! 124 0x1180
-	.long	error			! 125 0x11a0
-	.long	error			! 126 0x11c0
-	.long	error			! 127 0x11e0
-	.long	error			! 128 0x1200
-	.long	error			! 129 0x1220
-	.long	error			! 130 0x1240
-	.long	error			! 131 0x1260
-	.long	error			! 132 0x1280
-	.long	error			! 133 0x12a0
-	.long	error			! 134 0x12c0
-	.long	error			! 135 0x12e0
-	.long	error			! 136 0x1300
-	.long	error			! 137 0x1320
-	.long	error			! 138 0x1340
-	.long	error			! 139 0x1360
-	.long	do_IRQ	! 140 0x1380 EMPI INV_ADDR
-	.long	error			! 141 0x13a0
-	.long	error			! 142 0x13c0
-	.long	error			! 143 0x13e0
-#endif
-
+	.data
 ENTRY(sys_call_table)
 	.long sys_ni_syscall	/* 0  -  old "setup()" system call*/
 	.long sys_exit
@@ -1242,6 +1117,12 @@
  	.long sys_clock_gettime		/* 265 */
  	.long sys_clock_getres
  	.long sys_clock_nanosleep
+	.long sys_statfs64
+	.long sys_fstatfs64     
+	.long sys_tgkill		/* 270 */
+	.long sys_utimes
+ 	.long sys_fadvise64_64_wrapper
+	.long sys_ni_syscall	/* Reserved for vserver */
 
 	.rept NR_syscalls-(.-sys_call_table)/4
 		.long sys_ni_syscall
diff -Nru a/arch/sh/kernel/fpu.c b/arch/sh/kernel/fpu.c
--- a/arch/sh/kernel/fpu.c	Tue Feb  3 19:45:29 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,314 +0,0 @@
-/* $Id: fpu.c,v 1.29 2000/03/22 13:42:10 gniibe Exp $
- *
- * linux/arch/sh/kernel/fpu.c
- *
- * Save/restore floating point context for signal handlers.
- *
- * 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) 1999, 2000  Kaz Kojima & Niibe Yutaka
- *
- * FIXME! These routines can be optimized in big endian case.
- */
-
-#include <linux/sched.h>
-#include <linux/signal.h>
-#include <asm/processor.h>
-#include <asm/io.h>
-
-/*
- * Save FPU registers onto task structure.
- * Assume called with FPU enabled (SR.FD=0).
- */
-void
-save_fpu(struct task_struct *tsk)
-{
-	asm volatile("sts.l	fpul, @-%0\n\t"
-		     "sts.l	fpscr, @-%0\n\t"
-		     "lds	%1, fpscr\n\t"
-		     "frchg\n\t"
-		     "fmov.s	fr15, @-%0\n\t"
-		     "fmov.s	fr14, @-%0\n\t"
-		     "fmov.s	fr13, @-%0\n\t"
-		     "fmov.s	fr12, @-%0\n\t"
-		     "fmov.s	fr11, @-%0\n\t"
-		     "fmov.s	fr10, @-%0\n\t"
-		     "fmov.s	fr9, @-%0\n\t"
-		     "fmov.s	fr8, @-%0\n\t"
-		     "fmov.s	fr7, @-%0\n\t"
-		     "fmov.s	fr6, @-%0\n\t"
-		     "fmov.s	fr5, @-%0\n\t"
-		     "fmov.s	fr4, @-%0\n\t"
-		     "fmov.s	fr3, @-%0\n\t"
-		     "fmov.s	fr2, @-%0\n\t"
-		     "fmov.s	fr1, @-%0\n\t"
-		     "fmov.s	fr0, @-%0\n\t"
-		     "frchg\n\t"
-		     "fmov.s	fr15, @-%0\n\t"
-		     "fmov.s	fr14, @-%0\n\t"
-		     "fmov.s	fr13, @-%0\n\t"
-		     "fmov.s	fr12, @-%0\n\t"
-		     "fmov.s	fr11, @-%0\n\t"
-		     "fmov.s	fr10, @-%0\n\t"
-		     "fmov.s	fr9, @-%0\n\t"
-		     "fmov.s	fr8, @-%0\n\t"
-		     "fmov.s	fr7, @-%0\n\t"
-		     "fmov.s	fr6, @-%0\n\t"
-		     "fmov.s	fr5, @-%0\n\t"
-		     "fmov.s	fr4, @-%0\n\t"
-		     "fmov.s	fr3, @-%0\n\t"
-		     "fmov.s	fr2, @-%0\n\t"
-		     "fmov.s	fr1, @-%0\n\t"
-		     "fmov.s	fr0, @-%0"
-		     : /* no output */
-		     : "r" ((char *)(&tsk->thread.fpu.hard.status)),
-		       "r" (FPSCR_INIT)
-		     : "memory");
-
-	tsk->flags &= ~PF_USEDFPU;
-	release_fpu();
-}
-
-static void
-restore_fpu(struct task_struct *tsk)
-{
-	asm volatile("lds	%1, fpscr\n\t"
-		     "fmov.s	@%0+, fr0\n\t"
-		     "fmov.s	@%0+, fr1\n\t"
-		     "fmov.s	@%0+, fr2\n\t"
-		     "fmov.s	@%0+, fr3\n\t"
-		     "fmov.s	@%0+, fr4\n\t"
-		     "fmov.s	@%0+, fr5\n\t"
-		     "fmov.s	@%0+, fr6\n\t"
-		     "fmov.s	@%0+, fr7\n\t"
-		     "fmov.s	@%0+, fr8\n\t"
-		     "fmov.s	@%0+, fr9\n\t"
-		     "fmov.s	@%0+, fr10\n\t"
-		     "fmov.s	@%0+, fr11\n\t"
-		     "fmov.s	@%0+, fr12\n\t"
-		     "fmov.s	@%0+, fr13\n\t"
-		     "fmov.s	@%0+, fr14\n\t"
-		     "fmov.s	@%0+, fr15\n\t"
-		     "frchg\n\t"
-		     "fmov.s	@%0+, fr0\n\t"
-		     "fmov.s	@%0+, fr1\n\t"
-		     "fmov.s	@%0+, fr2\n\t"
-		     "fmov.s	@%0+, fr3\n\t"
-		     "fmov.s	@%0+, fr4\n\t"
-		     "fmov.s	@%0+, fr5\n\t"
-		     "fmov.s	@%0+, fr6\n\t"
-		     "fmov.s	@%0+, fr7\n\t"
-		     "fmov.s	@%0+, fr8\n\t"
-		     "fmov.s	@%0+, fr9\n\t"
-		     "fmov.s	@%0+, fr10\n\t"
-		     "fmov.s	@%0+, fr11\n\t"
-		     "fmov.s	@%0+, fr12\n\t"
-		     "fmov.s	@%0+, fr13\n\t"
-		     "fmov.s	@%0+, fr14\n\t"
-		     "fmov.s	@%0+, fr15\n\t"
-		     "frchg\n\t"
-		     "lds.l	@%0+, fpscr\n\t"
-		     "lds.l	@%0+, fpul\n\t"
-		     : /* no output */
-		     : "r" (&tsk->thread.fpu), "r" (FPSCR_INIT)
-		     : "memory");
-}
-
-/*
- * Load the FPU with signalling NANS.  This bit pattern we're using
- * has the property that no matter whether considered as single or as
- * double precission represents signaling NANS.  
- */
-
-static void
-fpu_init(void)
-{
-	asm volatile("lds	%0, fpul\n\t"
-		     "lds	%1, fpscr\n\t"
-		     "fsts	fpul, fr0\n\t"
-		     "fsts	fpul, fr1\n\t"
-		     "fsts	fpul, fr2\n\t"
-		     "fsts	fpul, fr3\n\t"
-		     "fsts	fpul, fr4\n\t"
-		     "fsts	fpul, fr5\n\t"
-		     "fsts	fpul, fr6\n\t"
-		     "fsts	fpul, fr7\n\t"
-		     "fsts	fpul, fr8\n\t"
-		     "fsts	fpul, fr9\n\t"
-		     "fsts	fpul, fr10\n\t"
-		     "fsts	fpul, fr11\n\t"
-		     "fsts	fpul, fr12\n\t"
-		     "fsts	fpul, fr13\n\t"
-		     "fsts	fpul, fr14\n\t"
-		     "fsts	fpul, fr15\n\t"
-		     "frchg\n\t"
-		     "fsts	fpul, fr0\n\t"
-		     "fsts	fpul, fr1\n\t"
-		     "fsts	fpul, fr2\n\t"
-		     "fsts	fpul, fr3\n\t"
-		     "fsts	fpul, fr4\n\t"
-		     "fsts	fpul, fr5\n\t"
-		     "fsts	fpul, fr6\n\t"
-		     "fsts	fpul, fr7\n\t"
-		     "fsts	fpul, fr8\n\t"
-		     "fsts	fpul, fr9\n\t"
-		     "fsts	fpul, fr10\n\t"
-		     "fsts	fpul, fr11\n\t"
-		     "fsts	fpul, fr12\n\t"
-		     "fsts	fpul, fr13\n\t"
-		     "fsts	fpul, fr14\n\t"
-		     "fsts	fpul, fr15\n\t"
-		     "frchg"
-		     : /* no output */
-		     : "r" (0), "r" (FPSCR_INIT));
-}
-
-/**
- *	denormal_to_double - Given denormalized float number,
- *	                     store double float
- *
- *	@fpu: Pointer to sh_fpu_hard structure
- *	@n: Index to FP register
- */
-static void
-denormal_to_double (struct sh_fpu_hard_struct *fpu, int n)
-{
-	unsigned long du, dl;
-	unsigned long x = fpu->fpul;
-	int exp = 1023 - 126;
-
-	if (x != 0 && (x & 0x7f800000) == 0) {
-		du = (x & 0x80000000);
-		while ((x & 0x00800000) == 0) {
-			x <<= 1;
-			exp--;
-		}
-		x &= 0x007fffff;
-		du |= (exp << 20) | (x >> 3);
-		dl = x << 29;
-
-		fpu->fp_regs[n] = du;
-		fpu->fp_regs[n+1] = dl;
-	}
-}
-
-/**
- *	ieee_fpe_handler - Handle denormalized number exception
- *
- *	@regs: Pointer to register structure
- *
- *	Returns 1 when it's handled (should not cause exception).
- */
-static int
-ieee_fpe_handler (struct pt_regs *regs)
-{
-	unsigned short insn = *(unsigned short *) regs->pc;
-	unsigned short finsn;
-	unsigned long nextpc;
-	int nib[4] = {
-		(insn >> 12) & 0xf,
-		(insn >> 8) & 0xf,
-		(insn >> 4) & 0xf,
-		insn & 0xf};
-
-	if (nib[0] == 0xb ||
-	    (nib[0] == 0x4 && nib[2] == 0x0 && nib[3] == 0xb)) /* bsr & jsr */
-		regs->pr = regs->pc + 4;
-  
-	if (nib[0] == 0xa || nib[0] == 0xb) { /* bra & bsr */
-		nextpc = regs->pc + 4 + ((short) ((insn & 0xfff) << 4) >> 3);
-		finsn = *(unsigned short *) (regs->pc + 2);
-	} else if (nib[0] == 0x8 && nib[1] == 0xd) { /* bt/s */
-		if (regs->sr & 1)
-			nextpc = regs->pc + 4 + ((char) (insn & 0xff) << 1);
-		else
-			nextpc = regs->pc + 4;
-		finsn = *(unsigned short *) (regs->pc + 2);
-	} else if (nib[0] == 0x8 && nib[1] == 0xf) { /* bf/s */
-		if (regs->sr & 1)
-			nextpc = regs->pc + 4;
-		else
-			nextpc = regs->pc + 4 + ((char) (insn & 0xff) << 1);
-		finsn = *(unsigned short *) (regs->pc + 2);
-	} else if (nib[0] == 0x4 && nib[3] == 0xb &&
-		 (nib[2] == 0x0 || nib[2] == 0x2)) { /* jmp & jsr */
-		nextpc = regs->regs[nib[1]];
-		finsn = *(unsigned short *) (regs->pc + 2);
-	} else if (nib[0] == 0x0 && nib[3] == 0x3 &&
-		 (nib[2] == 0x0 || nib[2] == 0x2)) { /* braf & bsrf */
-		nextpc = regs->pc + 4 + regs->regs[nib[1]];
-		finsn = *(unsigned short *) (regs->pc + 2);
-	} else if (insn == 0x000b) { /* rts */
-		nextpc = regs->pr;
-		finsn = *(unsigned short *) (regs->pc + 2);
-	} else {
-		nextpc = regs->pc + 2;
-		finsn = insn;
-	}
-
-	if ((finsn & 0xf1ff) == 0xf0ad) { /* fcnvsd */
-		struct task_struct *tsk = current;
-
-		save_fpu(tsk);
-		if ((tsk->thread.fpu.hard.fpscr & (1 << 17))) {
-			/* FPU error */
-			denormal_to_double (&tsk->thread.fpu.hard,
-					    (finsn >> 8) & 0xf);
-			tsk->thread.fpu.hard.fpscr &=
-				~(FPSCR_CAUSE_MASK | FPSCR_FLAG_MASK);
-			grab_fpu();
-			restore_fpu(tsk);
-			tsk->flags |= PF_USEDFPU;
-		} else {
-			tsk->thread.trap_no = 11;
-			tsk->thread.error_code = 0;
-			force_sig(SIGFPE, tsk);
-		}
-
-		regs->pc = nextpc;
-		return 1;
-	}
-
-	return 0;
-}
-
-asmlinkage void
-do_fpu_error(unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7,
-	     struct pt_regs regs)
-{
-	struct task_struct *tsk = current;
-
-	if (ieee_fpe_handler (&regs))
-		return;
-
-	regs.pc += 2;
-	save_fpu(tsk);
-	tsk->thread.trap_no = 11;
-	tsk->thread.error_code = 0;
-	force_sig(SIGFPE, tsk);
-}
-
-asmlinkage void
-do_fpu_state_restore(unsigned long r4, unsigned long r5, unsigned long r6,
-		     unsigned long r7, struct pt_regs regs)
-{
-	struct task_struct *tsk = current;
-
-	grab_fpu();
-	if (!user_mode(&regs)) {
-		printk(KERN_ERR "BUG: FPU is used in kernel mode.\n");
-		return;
-	}
-
-	if (tsk->used_math) {
-		/* Using the FPU again.  */
-		restore_fpu(tsk);
-	} else	{
-		/* First time FPU user.  */
-		fpu_init();
-		tsk->used_math = 1;
-	}
-	tsk->flags |= PF_USEDFPU;
-}
diff -Nru a/arch/sh/kernel/head.S b/arch/sh/kernel/head.S
--- a/arch/sh/kernel/head.S	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/kernel/head.S	Tue Feb  3 19:45:17 2004
@@ -1,4 +1,4 @@
-/* $Id: head.S,v 1.6 2003/05/04 19:29:53 lethal Exp $
+/* $Id: head.S,v 1.7 2003/09/01 17:58:19 lethal Exp $
  *
  *  arch/sh/kernel/head.S
  *
@@ -50,7 +50,7 @@
 	sub	r1, r0		!
 	ldc	r0, r7_bank	! ... and initial thread_info
 	!
-	!			Enable cache
+	!			Additional CPU initialization
 	mov.l	6f, r0
 	jsr	@r0
 	 nop
@@ -73,4 +73,4 @@
 3:	.long	__bss_start
 4:	.long	_end
 5:	.long	start_kernel
-6:	.long	sh_cache_init
+6:	.long	sh_cpu_init
diff -Nru a/arch/sh/kernel/io.c b/arch/sh/kernel/io.c
--- a/arch/sh/kernel/io.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/kernel/io.c	Tue Feb  3 19:45:17 2004
@@ -10,186 +10,6 @@
 #include <asm/io.h>
 #include <linux/module.h>
 
-unsigned char _inb(unsigned long port)
-{
-	return __inb(port);
-}
-EXPORT_SYMBOL(_inb);
-
-unsigned short _inw(unsigned long port)
-{
-	return __inw(port);
-}
-EXPORT_SYMBOL(_inw);
-
-unsigned int _inl(unsigned long port)
-{
-	return __inl(port);
-}
-EXPORT_SYMBOL(_inl);
-
-void _outb(unsigned char b, unsigned long port)
-{
-	__outb(b, port);
-}
-EXPORT_SYMBOL(_outb);
-
-void _outw(unsigned short b, unsigned long port)
-{
-	__outw(b, port);
-}
-EXPORT_SYMBOL(_outw);
-
-
-void _outl(unsigned int b, unsigned long port)
-{
-	__outl(b, port);
-}
-EXPORT_SYMBOL(_outl);
-
-
-unsigned char _inb_p(unsigned long port)
-{
-	return __inb_p(port);
-}
-EXPORT_SYMBOL(_inb_p);
-
-unsigned short _inw_p(unsigned long port)
-{
-	return __inw_p(port);
-}
-EXPORT_SYMBOL(_inw_p);
-
-
-void _outb_p(unsigned char b, unsigned long port)
-{
-	__outb_p(b, port);
-}
-EXPORT_SYMBOL(_outb_p);
-
-void _outw_p(unsigned short b, unsigned long port)
-{
-	__outw_p(b, port);
-}
-EXPORT_SYMBOL(_outw_p);
-
-void _insb(unsigned long port, void *buffer, unsigned long count)
-{
-	return __insb(port, buffer, count);
-}
-EXPORT_SYMBOL(_insb);
-
-void _insw(unsigned long port, void *buffer, unsigned long count)
-{
-	__insw(port, buffer, count);
-}
-EXPORT_SYMBOL(_insw);
-
-void _insl(unsigned long port, void *buffer, unsigned long count)
-{
-	__insl(port, buffer, count);
-}
-EXPORT_SYMBOL(_insl);
-
-void _outsb(unsigned long port, const void *buffer, unsigned long count)
-{
-	__outsb(port, buffer, count);
-}
-EXPORT_SYMBOL(_outsb);
-
-void _outsw(unsigned long port, const void *buffer, unsigned long count)
-{
-	__outsw(port, buffer, count);
-}
-EXPORT_SYMBOL(_outsw);
-
-void _outsl(unsigned long port, const void *buffer, unsigned long count)
-{
-	__outsl(port, buffer, count);
-
-}
-EXPORT_SYMBOL(_outsl);
-
-unsigned char ___raw_readb(unsigned long addr)
-{
-	return __readb(addr);
-}
-EXPORT_SYMBOL(___raw_readb);
-
-unsigned short ___raw_readw(unsigned long addr)
-{
-	return __readw(addr);
-}
-EXPORT_SYMBOL(___raw_readw);
-
-unsigned int ___raw_readl(unsigned long addr)
-{
-	return __readl(addr);
-}
-EXPORT_SYMBOL(___raw_readl);
-
-unsigned char _readb(unsigned long addr)
-{
-	unsigned long r = __readb(addr);
-	mb();
-	return r;
-}
-EXPORT_SYMBOL(_readb);
-
-unsigned short _readw(unsigned long addr)
-{
-	unsigned long r = __readw(addr);
-	mb();
-	return r;
-}
-EXPORT_SYMBOL(_readw);
-
-unsigned int _readl(unsigned long addr)
-{
-	unsigned long r = __readl(addr);
-	mb();
-	return r;
-}
-EXPORT_SYMBOL(_readl);
-
-void ___raw_writeb(unsigned char b, unsigned long addr)
-{
-	__writeb(b, addr);
-}
-
-void ___raw_writew(unsigned short b, unsigned long addr)
-{
-	__writew(b, addr);
-}
-EXPORT_SYMBOL(___raw_writew);
-
-void ___raw_writel(unsigned int b, unsigned long addr)
-{
-	__writel(b, addr);
-}
-EXPORT_SYMBOL(___raw_writel);
-
-void _writeb(unsigned char b, unsigned long addr)
-{
-	__writeb(b, addr);
-	mb();
-}
-EXPORT_SYMBOL(_writeb);
-
-void _writew(unsigned short b, unsigned long addr)
-{
-	__writew(b, addr);
-	mb();
-}
-EXPORT_SYMBOL(_writew);
-
-void _writel(unsigned int b, unsigned long addr)
-{
-	__writel(b, addr);
-	mb();
-}
-EXPORT_SYMBOL(_writel);
-
 /*
  * Copy data from IO memory space to "real" memory space.
  * This needs to be optimized.
@@ -230,3 +50,8 @@
                 dst++;
         }
 }
+
+EXPORT_SYMBOL(memcpy_fromio);
+EXPORT_SYMBOL(memcpy_toio);
+EXPORT_SYMBOL(memset_io);
+
diff -Nru a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
--- a/arch/sh/kernel/irq.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/kernel/irq.c	Tue Feb  3 19:45:17 2004
@@ -1,4 +1,4 @@
-/* $Id: irq.c,v 1.12 2003/06/28 15:34:55 lethal Exp $
+/* $Id: irq.c,v 1.19 2004/01/10 01:25:32 lethal Exp $
  *
  * linux/arch/sh/kernel/irq.c
  *
@@ -30,6 +30,7 @@
 #include <linux/smp_lock.h>
 #include <linux/init.h>
 #include <linux/seq_file.h>
+#include <linux/kallsyms.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -45,6 +46,7 @@
 irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = {
 	[0 ... NR_IRQS-1] = {
 		.handler = &no_irq_type,
+		.lock = SPIN_LOCK_UNLOCKED
 	}
 };
 
@@ -150,23 +152,88 @@
 		add_interrupt_randomness(irq);
 
 	local_irq_disable();
+	return retval;
+}
 
-	if (retval != 1) {
-		static int count = 100;
+static void __report_bad_irq(int irq, irq_desc_t *desc, irqreturn_t action_ret)
+{
+	struct irqaction *action;
 
-		if (count) {
-			count--;
+	if (action_ret != IRQ_HANDLED && action_ret != IRQ_NONE) {
+		printk(KERN_ERR "irq event %d: bogus return value %x\n",
+				irq, action_ret);
+	} else {
+		printk(KERN_ERR "irq %d: nobody cared!\n", irq);
+	}
+	dump_stack();
+	printk(KERN_ERR "handlers:\n");
+	action = desc->action;
+	do {
+		printk(KERN_ERR "[<%p>]", action->handler);
+		print_symbol(" (%s)",
+			(unsigned long)action->handler);
+		printk("\n");
+		action = action->next;
+	} while (action);
+}
 
-			if (retval) {
-				printk("irq event %d: bogus retval mask %x\n",
-					irq, retval);
-			} else {
-				printk("irq %d: nobody cared\n", irq);
-			}
-		}
+static void report_bad_irq(int irq, irq_desc_t *desc, irqreturn_t action_ret)
+{
+	static int count = 100;
+
+	if (count) {
+		count--;
+		__report_bad_irq(irq, desc, action_ret);
+	}
+}
+
+static int noirqdebug;
+
+static int __init noirqdebug_setup(char *str)
+{
+	noirqdebug = 1;
+	printk("IRQ lockup detection disabled\n");
+	return 1;
+}
+
+__setup("noirqdebug", noirqdebug_setup);
+
+/*
+ * If 99,900 of the previous 100,000 interrupts have not been handled then
+ * assume that the IRQ is stuck in some manner.  Drop a diagnostic and try to
+ * turn the IRQ off.
+ *
+ * (The other 100-of-100,000 interrupts may have been a correctly-functioning
+ *  device sharing an IRQ with the failing one)
+ *
+ * Called under desc->lock
+ */
+static void note_interrupt(int irq, irq_desc_t *desc, irqreturn_t action_ret)
+{
+	if (action_ret != IRQ_HANDLED) {
+		desc->irqs_unhandled++;
+		if (action_ret != IRQ_NONE)
+			report_bad_irq(irq, desc, action_ret);
 	}
 
-	return status;
+	desc->irq_count++;
+	if (desc->irq_count < 100000)
+		return;
+
+	desc->irq_count = 0;
+	if (desc->irqs_unhandled > 99900) {
+		/*
+		 * The interrupt is stuck
+		 */
+		__report_bad_irq(irq, desc, action_ret);
+		/*
+		 * Now kill the IRQ
+		 */
+		printk(KERN_EMERG "Disabling IRQ #%d\n", irq);
+		desc->status |= IRQ_DISABLED;
+		desc->handler->disable(irq);
+	}
+	desc->irqs_unhandled = 0;
 }
 
 /*
@@ -194,8 +261,10 @@
  */
 void disable_irq(unsigned int irq)
 {
+	irq_desc_t *desc = irq_desc + irq;
 	disable_irq_nosync(irq);
-	synchronize_irq(irq);
+	if (desc->action)
+		synchronize_irq(irq);
 }
 
 void enable_irq(unsigned int irq)
@@ -206,7 +275,7 @@
 	spin_lock_irqsave(&desc->lock, flags);
 	switch (desc->depth) {
 	case 1: {
-		unsigned int status = desc->status & ~IRQ_DISABLED;
+		unsigned int status = desc->status & ~(IRQ_DISABLED | IRQ_INPROGRESS);
 		desc->status = status;
 		if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) {
 			desc->status = status | IRQ_REPLAY;
@@ -243,7 +312,6 @@
 	 * handled by some other CPU. (or is disabled)
 	 */
 	int irq;
-	int cpu = smp_processor_id();
 	irq_desc_t *desc;
 	struct irqaction * action;
 	unsigned int status;
@@ -259,7 +327,7 @@
 		     :"=z" (irq));
 	irq = irq_demux(irq);
 
-	kstat_cpu(cpu).irqs[irq]++;
+	kstat_this_cpu.irqs[irq]++;
 	desc = irq_desc + irq;
 	spin_lock(&desc->lock);
 	desc->handler->ack(irq);
@@ -302,10 +370,13 @@
 	 * SMP environment.
 	 */
 	for (;;) {
+		irqreturn_t action_ret;
+
 		spin_unlock(&desc->lock);
-		handle_IRQ_event(irq, &regs, action);
+		action_ret = handle_IRQ_event(irq, &regs, action);
 		spin_lock(&desc->lock);
-
+		if (!noirqdebug)
+			note_interrupt(irq, desc, action_ret);
 		if (likely(!(desc->status & IRQ_PENDING)))
 			break;
 		desc->status &= ~IRQ_PENDING;
@@ -454,15 +525,16 @@
 	 * Wait for spurious interrupts to trigger
 	 */
 	for (delay = jiffies + HZ/10; time_after(delay, jiffies); )
-		/* about 100ms delay */ synchronize_irq();
+		/* about 100ms delay */ barrier();
 
 	/*
 	 * Now filter out any obviously spurious interrupts
 	 */
 	val = 0;
 	for (i=0; i<NR_IRQS; i++) {
-		desc = irq_desc + i;
 		unsigned int status;
+
+		desc = irq_desc + i;
 
 		spin_lock_irq(&desc->lock);
 		status = desc->status;
diff -Nru a/arch/sh/kernel/kgdb_stub.c b/arch/sh/kernel/kgdb_stub.c
--- a/arch/sh/kernel/kgdb_stub.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/kernel/kgdb_stub.c	Tue Feb  3 19:45:17 2004
@@ -778,7 +778,7 @@
 	else
 		addr = trap_registers.pc + 2;
 
-	flush_icache_range(addr, addr + 2);
+	kgdb_flush_icache_range(addr, addr + 2);
 	return (short *) addr;
 }
 
@@ -801,7 +801,7 @@
 	*addr = STEP_OPCODE;
 
 	/* Flush and return */
-	flush_icache_range((long) addr, (long) addr + 2);
+	kgdb_flush_icache_range((long) addr, (long) addr + 2);
 	return;
 }
 
@@ -812,7 +812,7 @@
 	/* Use stepped_address in case we stopped elsewhere */
 	if (stepped_opcode != 0) {
 		*(short*)stepped_address = stepped_opcode;
-		flush_icache_range(stepped_address, stepped_address + 2);
+		kgdb_flush_icache_range(stepped_address, stepped_address + 2);
 	}
 	stepped_opcode = 0;
 }
@@ -924,7 +924,7 @@
 					ebin_to_mem(ptr, (char*)addr, length);
 				else
 					hex_to_mem(ptr, (char*)addr, length);
-				flush_icache_range(addr, addr + length);
+				kgdb_flush_icache_range(addr, addr + length);
 				ptr = 0;
 				send_ok_msg();
 			}
diff -Nru a/arch/sh/kernel/module.c b/arch/sh/kernel/module.c
--- a/arch/sh/kernel/module.c	Tue Feb  3 19:45:40 2004
+++ b/arch/sh/kernel/module.c	Tue Feb  3 19:45:40 2004
@@ -138,3 +138,7 @@
 {
 	return 0;
 }
+
+void module_arch_cleanup(struct module *mod)
+{
+}
diff -Nru a/arch/sh/kernel/pci-dma.c b/arch/sh/kernel/pci-dma.c
--- a/arch/sh/kernel/pci-dma.c	Tue Feb  3 19:45:35 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,42 +0,0 @@
-/* 
- * Copyright (C) 2001 David J. Mckay (david.mckay@st.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.                            
- *
- * Dynamic DMA mapping support.
- */
-
-#include <linux/types.h>
-#include <linux/mm.h>
-#include <linux/string.h>
-#include <linux/pci.h>
-#include <asm/io.h>
-#include <asm/addrspace.h>
-
-
-void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
-			   dma_addr_t * dma_handle)
-{
-	void *ret;
-	int gfp = GFP_ATOMIC;
-
-	ret = (void *) __get_free_pages(gfp, get_order(size));
-
-	if (ret != NULL) {
-	        /* Is it necessary to do the memset? */
-		memset(ret, 0, size);
-		*dma_handle = virt_to_phys(ret);
-	}
-	/* We must flush the cache before we pass it on to the device */
-	dma_cache_wback_inv(ret, size);
-	return  P2SEGADDR(ret);
-}
-
-void pci_free_consistent(struct pci_dev *hwdev, size_t size,
-			 void *vaddr, dma_addr_t dma_handle)
-{
-        unsigned long p1addr=P1SEGADDR((unsigned long)vaddr);
-
-	free_pages(p1addr, get_order(size));
-}
diff -Nru a/arch/sh/kernel/pci.c b/arch/sh/kernel/pci.c
--- a/arch/sh/kernel/pci.c	Tue Feb  3 19:45:40 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,153 +0,0 @@
-/* arch/sh/kernel/pci.c
- * $Id: pci.c,v 1.4 2003/05/25 01:29:24 lethal Exp $
- *
- * Copyright (c) 2002 M. R. Brown  <mrbrown@linux-sh.org>
- * 
- * 
- * These functions are collected here to reduce duplication of common
- * code amongst the many platform-specific PCI support code files.
- * 
- * These routines require the following board-specific routines:
- * void pcibios_fixup();
- * void pcibios_fixup_irqs();
- *
- * See include/asm-sh/pci.h for more information.
- */
-
-#include <linux/kernel.h>
-#include <linux/pci.h>
-#include <linux/init.h>
-
-static int __init pcibios_init(void)
-{
-	struct pci_channel *p;
-	struct pci_bus *bus;
-	int busno;
-
-#ifdef CONFIG_PCI_AUTO
-	/* assign resources */
-	busno=0;
-	for (p = board_pci_channels; p->pci_ops != NULL; p++) {
-		busno = pciauto_assign_resources(busno, p) + 1;
-	}
-#endif
-
-	/* scan the buses */
-	busno = 0;
-	for (p= board_pci_channels; p->pci_ops != NULL; p++) {
-		bus = pci_scan_bus(busno, p->pci_ops, p);
-		busno = bus->subordinate+1;
-	}
-
-	/* board-specific fixups */
-	pcibios_fixup();
-	pcibios_fixup_irqs();
-
-	return 0;
-}
-
-subsys_initcall(pcibios_init);
-
-void
-pcibios_update_resource(struct pci_dev *dev, struct resource *root,
-			struct resource *res, int resource)
-{
-	u32 new, check;
-	int reg;
-
-	new = res->start | (res->flags & PCI_REGION_FLAG_MASK);
-	if (resource < 6) {
-		reg = PCI_BASE_ADDRESS_0 + 4*resource;
-	} else if (resource == PCI_ROM_RESOURCE) {
-		res->flags |= PCI_ROM_ADDRESS_ENABLE;
-		new |= PCI_ROM_ADDRESS_ENABLE;
-		reg = dev->rom_base_reg;
-	} else {
-		/* Somebody might have asked allocation of a non-standard resource */
-		return;
-	}
-	
-	pci_write_config_dword(dev, reg, new);
-	pci_read_config_dword(dev, reg, &check);
-	if ((new ^ check) & ((new & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK)) {
-		printk(KERN_ERR "PCI: Error while updating region "
-		       "%s/%d (%08x != %08x)\n", pci_name(dev), resource,
-		       new, check);
-	}
-}
-
-void pcibios_align_resource(void *data, struct resource *res,
-			    unsigned long size, unsigned long align)
-			    __attribute__ ((weak));
-
-/*
- * We need to avoid collisions with `mirrored' VGA ports
- * and other strange ISA hardware, so we always want the
- * addresses to be allocated in the 0x000-0x0ff region
- * modulo 0x400.
- */
-void pcibios_align_resource(void *data, struct resource *res,
-			    unsigned long size, unsigned long align)
-{
-	if (res->flags & IORESOURCE_IO) {
-		unsigned long start = res->start;
-
-		if (start & 0x300) {
-			start = (start + 0x3ff) & ~0x3ff;
-			res->start = start;
-		}
-	}
-}
-
-int pcibios_enable_device(struct pci_dev *dev, int mask)
-{
-	u16 cmd, old_cmd;
-	int idx;
-	struct resource *r;
-
-	pci_read_config_word(dev, PCI_COMMAND, &cmd);
-	old_cmd = cmd;
-	for(idx=0; idx<6; idx++) {
-		r = &dev->resource[idx];
-		if (!r->start && r->end) {
-			printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev));
-			return -EINVAL;
-		}
-		if (r->flags & IORESOURCE_IO)
-			cmd |= PCI_COMMAND_IO;
-		if (r->flags & IORESOURCE_MEM)
-			cmd |= PCI_COMMAND_MEMORY;
-	}
-	if (dev->resource[PCI_ROM_RESOURCE].start)
-		cmd |= PCI_COMMAND_MEMORY;
-	if (cmd != old_cmd) {
-		printk(KERN_INFO "PCI: Enabling device %s (%04x -> %04x)\n", dev->dev.name, old_cmd, cmd);
-		pci_write_config_word(dev, PCI_COMMAND, cmd);
-	}
-	return 0;
-}
-
-/*
- *  If we set up a device for bus mastering, we need to check and set
- *  the latency timer as it may not be properly set.
- */
-unsigned int pcibios_max_latency = 255;
-
-void pcibios_set_master(struct pci_dev *dev)
-{
-	u8 lat;
-	pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
-	if (lat < 16)
-		lat = (64 <= pcibios_max_latency) ? 64 : pcibios_max_latency;
-	else if (lat > pcibios_max_latency)
-		lat = pcibios_max_latency;
-	else
-		return;
-	printk(KERN_INFO "PCI: Setting latency timer of device %s to %d\n", dev->dev.name, lat);
-	pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
-}
-
-void __init pcibios_update_irq(struct pci_dev *dev, int irq)
-{
-	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
-}
diff -Nru a/arch/sh/kernel/pci_auto.c b/arch/sh/kernel/pci_auto.c
--- a/arch/sh/kernel/pci_auto.c	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,502 +0,0 @@
-/*
- * PCI autoconfiguration library
- *
- * Author: Matt Porter <mporter@mvista.com>
- *
- * Copyright 2000, 2001 MontaVista Software Inc.
- * Copyright 2001 Bradley D. LaRonde <brad@ltc.com>
- *
- * This program is free software; you can redistribute  it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
- */
-
-/*
- * Modified for MIPS by Jun Sun, jsun@mvista.com
- *
- * . Simplify the interface between pci_auto and the rest: a single function.
- * . Assign resources from low address to upper address.
- * . change most int to u32.
- *
- * Further modified to include it as mips generic code, ppopov@mvista.com.
- *
- * 2001-10-26  Bradley D. LaRonde <brad@ltc.com>
- * - Add a top_bus argument to the "early config" functions so that
- *   they can set a fake parent bus pointer to convince the underlying
- *   pci ops to use type 1 configuration for sub busses.
- * - Set bridge base and limit registers correctly.
- * - Align io and memory base properly before and after bridge setup.
- * - Don't fall through to pci_setup_bars for bridge.
- * - Reformat the debug output to look more like lspci's output.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/pci.h>
-
-#define	DEBUG
-#ifdef 	DEBUG
-#define	DBG(x...)	printk(x)
-#else
-#define	DBG(x...)	
-#endif
-
-/*
- * These functions are used early on before PCI scanning is done
- * and all of the pci_dev and pci_bus structures have been created.
- */
-static struct pci_dev *fake_pci_dev(struct pci_channel *hose,
-	int top_bus, int busnr, int devfn)
-{
-	static struct pci_dev dev;
-	static struct pci_bus bus;
-
-	dev.bus = &bus;
-	dev.sysdata = hose;
-	dev.devfn = devfn;
-	bus.number = busnr;
-	bus.ops = hose->pci_ops;
-
-	if(busnr != top_bus)
-		/* Fake a parent bus structure. */
-		bus.parent = &bus;
-	else
-		bus.parent = NULL;
-
-	return &dev;
-}
-
-#define EARLY_PCI_OP(rw, size, type)					\
-int early_##rw##_config_##size(struct pci_channel *hose,		\
-	int top_bus, int bus, int devfn, int offset, type value)	\
-{									\
-	return pci_##rw##_config_##size(				\
-		fake_pci_dev(hose, top_bus, bus, devfn),		\
-		offset, value);						\
-}
-
-EARLY_PCI_OP(read, byte, u8 *)
-EARLY_PCI_OP(read, word, u16 *)
-EARLY_PCI_OP(read, dword, u32 *)
-EARLY_PCI_OP(write, byte, u8)
-EARLY_PCI_OP(write, word, u16)
-EARLY_PCI_OP(write, dword, u32)
-
-static struct resource *io_resource_inuse;
-static struct resource *mem_resource_inuse;
-
-static u32 pciauto_lower_iospc;
-static u32 pciauto_upper_iospc;
-
-static u32 pciauto_lower_memspc;
-static u32 pciauto_upper_memspc;
-
-static void __init 
-pciauto_setup_bars(struct pci_channel *hose,
-		   int top_bus,
-		   int current_bus,
-		   int pci_devfn)
-{
-	u32 bar_response, bar_size, bar_value;
-	u32 bar, addr_mask, bar_nr = 0;
-	u32 * upper_limit;
-	u32 * lower_limit;
-	int found_mem64 = 0;
-
-	for (bar = PCI_BASE_ADDRESS_0; bar <= PCI_BASE_ADDRESS_5; bar+=4) {
-		/* Tickle the BAR and get the response */
-		early_write_config_dword(hose, top_bus,
-					 current_bus,
-					 pci_devfn,
-					 bar,
-					 0xffffffff);
-		early_read_config_dword(hose, top_bus,
-					current_bus,
-					pci_devfn,
-					bar,
-					&bar_response);
-
-		/* If BAR is not implemented go to the next BAR */
-		if (!bar_response)
-			continue;
-
-		/*
-		 * Workaround for a BAR that doesn't use its upper word,
-		 * like the ALi 1535D+ PCI DC-97 Controller Modem (M5457).
-		 * bdl <brad@ltc.com>
-		 */
-		if (!(bar_response & 0xffff0000))
-			bar_response |= 0xffff0000;
-
-retry:
-		/* Check the BAR type and set our address mask */
-		if (bar_response & PCI_BASE_ADDRESS_SPACE) {
-			addr_mask = PCI_BASE_ADDRESS_IO_MASK;
-			upper_limit = &pciauto_upper_iospc;
-			lower_limit = &pciauto_lower_iospc;
-			DBG("        I/O");
-		} else {
-			if ((bar_response & PCI_BASE_ADDRESS_MEM_TYPE_MASK) ==
-			    PCI_BASE_ADDRESS_MEM_TYPE_64)
-				found_mem64 = 1;
-
-			addr_mask = PCI_BASE_ADDRESS_MEM_MASK;		
-			upper_limit = &pciauto_upper_memspc;
-			lower_limit = &pciauto_lower_memspc;
-			DBG("        Mem");
-		}
-
-
-		/* Calculate requested size */
-		bar_size = ~(bar_response & addr_mask) + 1;
-
-		/* Allocate a base address */
-		bar_value = ((*lower_limit - 1) & ~(bar_size - 1)) + bar_size;
-
-		if ((bar_value + bar_size) > *upper_limit) {
-			if (bar_response & PCI_BASE_ADDRESS_SPACE) {
-				if (io_resource_inuse->child) {
-					io_resource_inuse = 
-						io_resource_inuse->child;
-					pciauto_lower_iospc = 
-						io_resource_inuse->start;
-					pciauto_upper_iospc = 
-						io_resource_inuse->end + 1;
-					goto retry;
-				}
-
-			} else {
-				if (mem_resource_inuse->child) {
-					mem_resource_inuse = 
-						mem_resource_inuse->child;
-					pciauto_lower_memspc = 
-						mem_resource_inuse->start;
-					pciauto_upper_memspc = 
-						mem_resource_inuse->end + 1;
-					goto retry;
-				}
-			}
-			DBG(" unavailable -- skipping, value %x size %x\n",
-					bar_value, bar_size);
-			continue;
-		}
-
-		/* Write it out and update our limit */
-		early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
-					 bar, bar_value);
-
-		*lower_limit = bar_value + bar_size;
-
-		/*
-		 * If we are a 64-bit decoder then increment to the
-		 * upper 32 bits of the bar and force it to locate
-		 * in the lower 4GB of memory.
-		 */ 
-		if (found_mem64) {
-			bar += 4;
-			early_write_config_dword(hose, top_bus,
-						 current_bus,
-						 pci_devfn,
-						 bar,
-						 0x00000000);
-		}
-
-		DBG(" at 0x%.8x [size=0x%x]\n", bar_value, bar_size);
-
-		bar_nr++;
-	}
-
-}
-
-static void __init
-pciauto_prescan_setup_bridge(struct pci_channel *hose,
-			     int top_bus,
-			     int current_bus,
-			     int pci_devfn,
-			     int sub_bus)
-{
-	/* Configure bus number registers */
-	early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
-	                        PCI_PRIMARY_BUS, current_bus);
-	early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
-				PCI_SECONDARY_BUS, sub_bus + 1);
-	early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
-				PCI_SUBORDINATE_BUS, 0xff);
-
-	/* Align memory and I/O to 1MB and 4KB boundaries. */
-	pciauto_lower_memspc = (pciauto_lower_memspc + (0x100000 - 1))
-		& ~(0x100000 - 1);
-	pciauto_lower_iospc = (pciauto_lower_iospc + (0x1000 - 1))
-		& ~(0x1000 - 1);
-
-	/* Set base (lower limit) of address range behind bridge. */
-	early_write_config_word(hose, top_bus, current_bus, pci_devfn,
-		PCI_MEMORY_BASE, pciauto_lower_memspc >> 16);
-	early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
-		PCI_IO_BASE, (pciauto_lower_iospc & 0x0000f000) >> 8);
-	early_write_config_word(hose, top_bus, current_bus, pci_devfn,
-		PCI_IO_BASE_UPPER16, pciauto_lower_iospc >> 16);
-
-	/* We don't support prefetchable memory for now, so disable */
-	early_write_config_word(hose, top_bus, current_bus, pci_devfn,
-				PCI_PREF_MEMORY_BASE, 0);
-	early_write_config_word(hose, top_bus, current_bus, pci_devfn,
-				PCI_PREF_MEMORY_LIMIT, 0);
-}
-
-static void __init
-pciauto_postscan_setup_bridge(struct pci_channel *hose,
-			      int top_bus,
-			      int current_bus,
-			      int pci_devfn,
-			      int sub_bus)
-{
-	u32 temp;
-
-	pciauto_lower_memspc += 1;
-	pciauto_lower_iospc += 1;
-
-	/* Configure bus number registers */
-	early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
-				PCI_SUBORDINATE_BUS, sub_bus);
-
-	/* Set upper limit of address range behind bridge. */
-	early_write_config_word(hose, top_bus, current_bus, pci_devfn,
-		PCI_MEMORY_LIMIT, pciauto_lower_memspc >> 16);
-	early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
-		PCI_IO_LIMIT, (pciauto_lower_iospc & 0x0000f000) >> 8);
-	early_write_config_word(hose, top_bus, current_bus, pci_devfn,
-		PCI_IO_LIMIT_UPPER16, pciauto_lower_iospc >> 16);
-
-	/* Align memory and I/O to 1MB and 4KB boundaries. */
-	pciauto_lower_memspc = (pciauto_lower_memspc + (0x100000 - 1))
-		& ~(0x100000 - 1);
-	pciauto_lower_iospc = (pciauto_lower_iospc + (0x1000 - 1))
-		& ~(0x1000 - 1);
-
-	/* Enable memory and I/O accesses, enable bus master */
-	early_read_config_dword(hose, top_bus, current_bus, pci_devfn,
-		PCI_COMMAND, &temp);
-	early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
-		PCI_COMMAND, temp | PCI_COMMAND_IO | PCI_COMMAND_MEMORY
-		| PCI_COMMAND_MASTER);
-}
-
-static void __init
-pciauto_prescan_setup_cardbus_bridge(struct pci_channel *hose,
-                            int top_bus,
-                            int current_bus,
-                            int pci_devfn,
-                            int sub_bus)
-{
-       /* Configure bus number registers */
-       early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
-                               PCI_PRIMARY_BUS, current_bus);
-       early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
-                               PCI_SECONDARY_BUS, sub_bus + 1);
-       early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
-                               PCI_SUBORDINATE_BUS, 0xff);
-
-       /* Align memory and I/O to 4KB and 4 byte boundaries. */
-       pciauto_lower_memspc = (pciauto_lower_memspc + (0x1000 - 1))
-               & ~(0x1000 - 1);
-       pciauto_lower_iospc = (pciauto_lower_iospc + (0x4 - 1))
-               & ~(0x4 - 1);
-
-       early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
-               PCI_CB_MEMORY_BASE_0, pciauto_lower_memspc);
-       early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
-               PCI_CB_IO_BASE_0, pciauto_lower_iospc);  
-}
-
-static void __init
-pciauto_postscan_setup_cardbus_bridge(struct pci_channel *hose,
-                             int top_bus,
-                             int current_bus,
-                             int pci_devfn,
-                             int sub_bus)
-{
-       u32 temp;
-
-       /* 
-        * [jsun] we always bump up baselines a little, so that if there 
-        * nothing behind P2P bridge, we don't wind up overlapping IO/MEM 
-        * spaces.
-        */
-       pciauto_lower_memspc += 1;
-       pciauto_lower_iospc += 1;
-
-       /*
-        * Configure subordinate bus number.  The PCI subsystem
-        * bus scan will renumber buses (reserving three additional
-        * for this PCI<->CardBus bridge for the case where a CardBus
-        * adapter contains a P2P or CB2CB bridge.
-        */
-
-       early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
-                               PCI_SUBORDINATE_BUS, sub_bus);
-
-       /*
-        * Reserve an additional 4MB for mem space and 16KB for
-        * I/O space.  This should cover any additional space
-        * requirement of unusual CardBus devices with 
-        * additional bridges that can consume more address space.
-        * 
-        * Although pcmcia-cs currently will reprogram bridge
-        * windows, the goal is to add an option to leave them
-        * alone and use the bridge window ranges as the regions
-        * that are searched for free resources upon hot-insertion
-        * of a device.  This will allow a PCI<->CardBus bridge
-        * configured by this routine to happily live behind a
-        * P2P bridge in a system.
-        */
-
-       /* Align memory and I/O to 4KB and 4 byte boundaries. */
-       pciauto_lower_memspc = (pciauto_lower_memspc + (0x1000 - 1))
-               & ~(0x1000 - 1);
-       pciauto_lower_iospc = (pciauto_lower_iospc + (0x4 - 1))
-               & ~(0x4 - 1);
-       /* Set up memory and I/O filter limits, assume 32-bit I/O space */
-       early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
-               PCI_CB_MEMORY_LIMIT_0, pciauto_lower_memspc - 1); 
-       early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
-               PCI_CB_IO_LIMIT_0, pciauto_lower_iospc - 1);
-       
-       /* Enable memory and I/O accesses, enable bus master */
-       early_read_config_dword(hose, top_bus, current_bus, pci_devfn,
-               PCI_COMMAND, &temp);
-       early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
-               PCI_COMMAND, temp | PCI_COMMAND_IO | PCI_COMMAND_MEMORY
-               | PCI_COMMAND_MASTER);
-}
-
-#define      PCIAUTO_IDE_MODE_MASK           0x05
-
-static int __init
-pciauto_bus_scan(struct pci_channel *hose, int top_bus, int current_bus)
-{
-	int sub_bus;
-	u32 pci_devfn, pci_class, cmdstat, found_multi=0;
-	unsigned short vid, did;
-	unsigned char header_type;
-	int devfn_start = 0;
-	int devfn_stop = 0xff;
-
-	sub_bus = current_bus;
-	
-	if (hose->first_devfn)
-		devfn_start = hose->first_devfn;
-	if (hose->last_devfn)
-		devfn_stop = hose->last_devfn;
-	
-	for (pci_devfn=devfn_start; pci_devfn<devfn_stop; pci_devfn++) {
-
-		if (PCI_FUNC(pci_devfn) && !found_multi)
-			continue;
-
-		early_read_config_word(hose, top_bus, current_bus, pci_devfn,
-				       PCI_VENDOR_ID, &vid);
-
-		if (vid == 0xffff) continue;
-
-		early_read_config_byte(hose, top_bus, current_bus, pci_devfn,
-				       PCI_HEADER_TYPE, &header_type);
-
-		if (!PCI_FUNC(pci_devfn))
-			found_multi = header_type & 0x80;
-
-		early_read_config_word(hose, top_bus, current_bus, pci_devfn,
-				       PCI_DEVICE_ID, &did);
-
-		early_read_config_dword(hose, top_bus, current_bus, pci_devfn,
-					PCI_CLASS_REVISION, &pci_class);
-
-		DBG("%.2x:%.2x.%x Class %.4x: %.4x:%.4x",
-			current_bus, PCI_SLOT(pci_devfn), PCI_FUNC(pci_devfn),
-			pci_class >> 16, vid, did);
-		if (pci_class & 0xff)
-			DBG(" (rev %.2x)", pci_class & 0xff);
-		DBG("\n");
-
-		if ((pci_class >> 16) == PCI_CLASS_BRIDGE_PCI) {
-			DBG("        Bridge: primary=%.2x, secondary=%.2x\n",
-				current_bus, sub_bus + 1);
-			pciauto_prescan_setup_bridge(hose, top_bus, current_bus,
-						     pci_devfn, sub_bus);
-			DBG("Scanning sub bus %.2x, I/O 0x%.8x, Mem 0x%.8x\n",
-				sub_bus + 1,
-				pciauto_lower_iospc, pciauto_lower_memspc);
-			sub_bus = pciauto_bus_scan(hose, top_bus, sub_bus+1);
-			DBG("Back to bus %.2x\n", current_bus);
-			pciauto_postscan_setup_bridge(hose, top_bus, current_bus,
-						      pci_devfn, sub_bus);
-			continue;
-                } else if ((pci_class >> 16) == PCI_CLASS_BRIDGE_CARDBUS) {
-                        DBG("  CARDBUS  Bridge: primary=%.2x, secondary=%.2x\n",
-                                current_bus, sub_bus + 1);
-                        DBG("PCI Autoconfig: Found CardBus bridge, device %d function %d\n", PCI_SLOT(pci_devfn), PCI_FUNC(pci_devfn));
-                        /* Place CardBus Socket/ExCA registers */
-                        pciauto_setup_bars(hose, top_bus, current_bus, pci_devfn);
- 
-                        pciauto_prescan_setup_cardbus_bridge(hose, top_bus, 
-                                        current_bus, pci_devfn, sub_bus);
- 
-                        DBG("Scanning sub bus %.2x, I/O 0x%.8x, Mem 0x%.8x\n",
-                                sub_bus + 1,
-                                pciauto_lower_iospc, pciauto_lower_memspc);
-                        sub_bus = pciauto_bus_scan(hose, top_bus, sub_bus+1);
-                        DBG("Back to bus %.2x, sub_bus is %x\n", current_bus, sub_bus);
-                        pciauto_postscan_setup_cardbus_bridge(hose, top_bus, 
-                                        current_bus, pci_devfn, sub_bus);
-                        continue;
-		} else if ((pci_class >> 16) == PCI_CLASS_STORAGE_IDE) {
-
-			unsigned char prg_iface;
-
-			early_read_config_byte(hose, top_bus, current_bus,
-				pci_devfn, PCI_CLASS_PROG, &prg_iface);
-			if (!(prg_iface & PCIAUTO_IDE_MODE_MASK)) {
-				DBG("Skipping legacy mode IDE controller\n");
-				continue;
-			}
-		}
-
- 		/*
-		 * Found a peripheral, enable some standard
-		 * settings
-		 */
-		early_read_config_dword(hose, top_bus, current_bus, pci_devfn,
-					PCI_COMMAND, &cmdstat);
-		early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
-					 PCI_COMMAND, cmdstat | PCI_COMMAND_IO |
-					 PCI_COMMAND_MEMORY |
-					 PCI_COMMAND_MASTER);
-		early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
-					PCI_LATENCY_TIMER, 0x80);
-
-		/* Allocate PCI I/O and/or memory space */
-		pciauto_setup_bars(hose, top_bus, current_bus, pci_devfn);
-	}
-	return sub_bus;
-}
-
-int __init
-pciauto_assign_resources(int busno, struct pci_channel *hose)
-{
-	/* setup resource limits */
-	io_resource_inuse = hose->io_resource;
-	mem_resource_inuse = hose->mem_resource;
-
-	pciauto_lower_iospc = io_resource_inuse->start;
-	pciauto_upper_iospc = io_resource_inuse->end + 1;
-	pciauto_lower_memspc = mem_resource_inuse->start;
-	pciauto_upper_memspc = mem_resource_inuse->end + 1;
-	DBG("Autoconfig PCI channel 0x%p\n", hose);
-	DBG("Scanning bus %.2x, I/O 0x%.8x:0x%.8x, Mem 0x%.8x:0x%.8x\n",
-		busno, pciauto_lower_iospc, pciauto_upper_iospc, 
-		pciauto_lower_memspc, pciauto_upper_memspc);
-
-	return pciauto_bus_scan(hose, busno, busno);
-}
diff -Nru a/arch/sh/kernel/pcibios.c b/arch/sh/kernel/pcibios.c
--- a/arch/sh/kernel/pcibios.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,97 +0,0 @@
-/*
- * $Id: pcibios.c,v 1.1 2001/08/24 12:38:19 dwmw2 Exp $
- *
- * arch/sh/kernel/pcibios.c
- *
- * This is GPL'd.
- *
- * Provided here are generic versions of:
- *	pcibios_align_resource()
- *	pcibios_enable_device()
- *	pcibios_set_master()
- *	pcibios_update_irq()
- *
- * These functions are collected here to reduce duplication of common
- * code amongst the many platform-specific PCI support code files.
- *
- * Platform-specific files are expected to provide:
- *	pcibios_fixup_bus()
- *	pcibios_init()
- *	pcibios_setup()
- */
-
-#include <linux/kernel.h>
-#include <linux/pci.h>
-#include <linux/init.h>
-
-/*
- * We need to avoid collisions with `mirrored' VGA ports
- * and other strange ISA hardware, so we always want the
- * addresses to be allocated in the 0x000-0x0ff region
- * modulo 0x400.
- */
-void pcibios_align_resource(void *data, struct resource *res,
-			    unsigned long size, unsigned long align)
-{
-	if (res->flags & IORESOURCE_IO) {
-		unsigned long start = res->start;
-
-		if (start & 0x300) {
-			start = (start + 0x3ff) & ~0x3ff;
-			res->start = start;
-		}
-	}
-}
-
-int pcibios_enable_device(struct pci_dev *dev)
-{
-	u16 cmd, old_cmd;
-	int idx;
-	struct resource *r;
-
-	pci_read_config_word(dev, PCI_COMMAND, &cmd);
-	old_cmd = cmd;
-	for(idx=0; idx<6; idx++) {
-		r = &dev->resource[idx];
-		if (!r->start && r->end) {
-			printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev));
-			return -EINVAL;
-		}
-		if (r->flags & IORESOURCE_IO)
-			cmd |= PCI_COMMAND_IO;
-		if (r->flags & IORESOURCE_MEM)
-			cmd |= PCI_COMMAND_MEMORY;
-	}
-	if (dev->resource[PCI_ROM_RESOURCE].start)
-		cmd |= PCI_COMMAND_MEMORY;
-	if (cmd != old_cmd) {
-		printk(KERN_INFO "PCI: Enabling device %s (%04x -> %04x)\n", dev->name, old_cmd, cmd);
-		pci_write_config_word(dev, PCI_COMMAND, cmd);
-	}
-	return 0;
-}
-
-/*
- *  If we set up a device for bus mastering, we need to check and set
- *  the latency timer as it may not be properly set.
- */
-unsigned int pcibios_max_latency = 255;
-
-void pcibios_set_master(struct pci_dev *dev)
-{
-	u8 lat;
-	pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
-	if (lat < 16)
-		lat = (64 <= pcibios_max_latency) ? 64 : pcibios_max_latency;
-	else if (lat > pcibios_max_latency)
-		lat = pcibios_max_latency;
-	else
-		return;
-	printk(KERN_INFO "PCI: Setting latency timer of device %s to %d\n", dev->name, lat);
-	pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
-}
-
-void __init pcibios_update_irq(struct pci_dev *dev, int irq)
-{
-	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
-}
diff -Nru a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
--- a/arch/sh/kernel/process.c	Tue Feb  3 19:45:34 2004
+++ b/arch/sh/kernel/process.c	Tue Feb  3 19:45:34 2004
@@ -1,4 +1,4 @@
-/* $Id: process.c,v 1.17 2003/05/27 21:37:11 lethal Exp $
+/* $Id: process.c,v 1.24 2003/11/28 23:05:43 kkojima Exp $
  *
  *  linux/arch/sh/kernel/process.c
  *
@@ -19,6 +19,7 @@
 #include <linux/a.out.h>
 #include <linux/ptrace.h>
 #include <linux/platform.h>
+#include <linux/kallsyms.h>
 
 #include <asm/io.h>
 #include <asm/uaccess.h>
@@ -27,6 +28,8 @@
 
 static int hlt_counter=0;
 
+int ubc_usercnt = 0;
+
 #define HARD_IDLE_TIMEOUT (HZ / 3)
 
 void disable_hlt(void)
@@ -47,19 +50,9 @@
 {
 	/* endless idle loop with no priority at all */
 	while (1) {
-		if (hlt_counter) {
-			while (1)
-				if (need_resched())
-					break;
-		} else {
-			local_irq_disable();
-			while (!need_resched()) {
-				local_irq_enable();
-				asm volatile("sleep" : : : "memory");
-				local_irq_disable();
-			}
-			local_irq_enable();
-		}
+		while (!need_resched())
+			cpu_relax();
+
 		schedule();
 	}
 }
@@ -81,7 +74,7 @@
 void machine_halt(void)
 {
 	while (1)
-		asm volatile("sleep" : : : "memory");
+		cpu_relax();
 }
 
 EXPORT_SYMBOL(machine_halt);
@@ -95,8 +88,17 @@
 void show_regs(struct pt_regs * regs)
 {
 	printk("\n");
-	printk("PC  : %08lx SP  : %08lx SR  : %08lx TEA : %08x    %s\n",
-	       regs->pc, regs->regs[15], regs->sr, ctrl_inl(MMU_TEA), print_tainted());
+	printk("Pid : %d, Comm: %20s\n", current->pid, current->comm);
+	print_symbol("PC is at %s\n", regs->pc);
+	printk("PC  : %08lx SP  : %08lx SR  : %08lx ",
+	       regs->pc, regs->regs[15], regs->sr);
+#ifdef CONFIG_MMU
+	printk("TEA : %08x    ", ctrl_inl(MMU_TEA));
+#else
+	printk("                  ");
+#endif
+	printk("%s\n", print_tainted());
+
 	printk("R0  : %08lx R1  : %08lx R2  : %08lx R3  : %08lx\n",
 	       regs->regs[0],regs->regs[1],
 	       regs->regs[2],regs->regs[3]);
@@ -162,7 +164,10 @@
  */
 void exit_thread(void)
 {
-	/* Nothing to do. */
+	if (current->thread.ubc_pc) {
+		current->thread.ubc_pc = 0;
+		ubc_usercnt -= 1;
+	}
 }
 
 void flush_thread(void)
@@ -207,7 +212,11 @@
 	struct pt_regs ptregs;
 	
 	ptregs = *(struct pt_regs *)
-		((unsigned long)tsk->thread_info+THREAD_SIZE - sizeof(ptregs));
+		((unsigned long)tsk->thread_info+THREAD_SIZE - sizeof(ptregs)
+#ifdef CONFIG_SH_DSP
+		 - sizeof(struct pt_dspregs)
+#endif
+		 - sizeof(unsigned long));
 	elf_core_copy_regs(regs, &ptregs);
 
 	return 1;
@@ -237,7 +246,12 @@
 {
 	struct pt_regs *childregs;
 
-	childregs = ((struct pt_regs *)(THREAD_SIZE + (unsigned long) p->thread_info)) - 1;
+	childregs = ((struct pt_regs *)
+		(THREAD_SIZE + (unsigned long) p->thread_info)
+#ifdef CONFIG_SH_DSP
+		- sizeof(struct pt_dspregs)
+#endif
+		- sizeof(unsigned long)) - 1;
 	*childregs = *regs;
 
 	if (user_mode(regs)) {
@@ -255,6 +269,8 @@
 	p->thread.sp = (unsigned long) childregs;
 	p->thread.pc = (unsigned long) ret_from_fork;
 
+	p->thread.ubc_pc = 0;
+
 #if defined(CONFIG_CPU_SH4)
 	{
 		struct task_struct *tsk = current;
@@ -288,6 +304,27 @@
 	dump->u_fpvalid = dump_fpu(regs, &dump->fpu);
 }
 
+/* Tracing by user break controller.  */
+static void
+ubc_set_tracing(int asid, unsigned long pc)
+{
+	ctrl_outl(pc, UBC_BARA);
+
+	/* We don't have any ASID settings for the SH-2! */
+	if (cpu_data->type != CPU_SH7604)
+		ctrl_outb(asid, UBC_BASRA);
+
+	ctrl_outl(0, UBC_BAMRA);
+
+	if (cpu_data->type == CPU_SH7729) {
+		ctrl_outw(BBR_INST | BBR_READ | BBR_CPU, UBC_BBRA);
+		ctrl_outl(BRCR_PCBA | BRCR_PCTE, UBC_BRCR);
+	} else {
+		ctrl_outw(BBR_INST | BBR_READ, UBC_BBRA);
+		ctrl_outw(BRCR_PCBA, UBC_BRCR);
+	}
+}
+
 /*
  *	switch_to(x,y) should switch tasks from x to y.
  *
@@ -305,6 +342,19 @@
 		     : /* no output */
 		     : "r" (next->thread_info));
 
+#ifdef CONFIG_MMU
+	/* If no tasks are using the UBC, we're done */
+	if (ubc_usercnt == 0)
+		/* If no tasks are using the UBC, we're done */;
+	else if (next->thread.ubc_pc && next->mm) {
+		ubc_set_tracing(next->mm->context & MMU_CONTEXT_ASID_MASK,
+				next->thread.ubc_pc);
+	} else {
+		ctrl_outw(0, UBC_BBRA);
+		ctrl_outw(0, UBC_BBRB);
+	}
+#endif
+
 	return prev;
 }
 
@@ -328,7 +378,7 @@
 	if (!newsp)
 		newsp = regs.regs[15];
 	return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, &regs, 0,
-			(int *)parent_tidptr, (int *)child_tidptr);
+			(int __user *)parent_tidptr, (int __user *)child_tidptr);
 }
 
 /*
@@ -359,12 +409,15 @@
 	int error;
 	char *filename;
 
-	filename = getname(ufilename);
+	filename = getname((char __user *)ufilename);
 	error = PTR_ERR(filename);
 	if (IS_ERR(filename))
 		goto out;
 
-	error = do_execve(filename, uargv, uenvp, &regs);
+	error = do_execve(filename,
+			  (char __user * __user *)uargv,
+			  (char __user * __user *)uenvp,
+			  &regs);
 	if (error == 0)
 		current->ptrace &= ~PT_DTRACE;
 	putname(filename);
@@ -406,6 +459,8 @@
 	/* Clear tracing.  */
 	ctrl_outw(0, UBC_BBRA);
 	ctrl_outw(0, UBC_BBRB);
+	current->thread.ubc_pc = 0;
+	ubc_usercnt -= 1;
 
 	force_sig(SIGTRAP, current);
 }
diff -Nru a/arch/sh/kernel/ptrace.c b/arch/sh/kernel/ptrace.c
--- a/arch/sh/kernel/ptrace.c	Tue Feb  3 19:45:16 2004
+++ b/arch/sh/kernel/ptrace.c	Tue Feb  3 19:45:16 2004
@@ -1,4 +1,4 @@
-/* $Id: ptrace.c,v 1.9 2003/05/06 23:28:47 lethal Exp $
+/* $Id: ptrace.c,v 1.14 2003/11/28 23:05:43 kkojima Exp $
  *
  * linux/arch/sh/kernel/ptrace.c
  *
@@ -41,7 +41,12 @@
 {
 	unsigned char *stack;
 
-	stack = (unsigned char *)task->thread_info + THREAD_SIZE - sizeof(struct pt_regs);
+	stack = (unsigned char *)
+		task->thread_info + THREAD_SIZE	- sizeof(struct pt_regs)
+#ifdef CONFIG_SH_DSP
+		- sizeof(struct pt_dspregs)
+#endif
+		- sizeof(unsigned long);
 	stack += offset;
 	return (*((int *)stack));
 }
@@ -54,97 +59,17 @@
 {
 	unsigned char *stack;
 
-	stack = (unsigned char *)task->thread_info + THREAD_SIZE - sizeof(struct pt_regs);
+	stack = (unsigned char *)
+		task->thread_info + THREAD_SIZE - sizeof(struct pt_regs)
+#ifdef CONFIG_SH_DSP
+		- sizeof(struct pt_dspregs)
+#endif
+		- sizeof(unsigned long);
 	stack += offset;
 	*(unsigned long *) stack = data;
 	return 0;
 }
 
-static void
-compute_next_pc(struct pt_regs *regs, unsigned short inst,
-		unsigned long *pc1, unsigned long *pc2)
-{
-	int nib[4]
-		= { (inst >> 12) & 0xf,
-		    (inst >> 8) & 0xf,
-		    (inst >> 4) & 0xf,
-		    inst & 0xf};
-
-	/* bra & bsr */
-	if (nib[0] == 0xa || nib[0] == 0xb) {
-		*pc1 = regs->pc + 4 + ((short) ((inst & 0xfff) << 4) >> 3);
-		*pc2 = (unsigned long) -1;
-		return;
-	}
-
-	/* bt & bf */
-	if (nib[0] == 0x8 && (nib[1] == 0x9 || nib[1] == 0xb)) {
-		*pc1 = regs->pc + 4 + ((char) (inst & 0xff) << 1);
-		*pc2 = regs->pc + 2;
-		return;
-	}
-
-	/* bt/s & bf/s */
-	if (nib[0] == 0x8 && (nib[1] == 0xd || nib[1] == 0xf)) {
-		*pc1 = regs->pc + 4 + ((char) (inst & 0xff) << 1);
-		*pc2 = regs->pc + 4;
-		return;
-	}
-
-	/* jmp & jsr */
-	if (nib[0] == 0x4 && nib[3] == 0xb
-	    && (nib[2] == 0x0 || nib[2] == 0x2)) {
-		*pc1 = regs->regs[nib[1]];
-		*pc2 = (unsigned long) -1;
-		return;
-	}
-
-	/* braf & bsrf */
-	if (nib[0] == 0x0 && nib[3] == 0x3
-	    && (nib[2] == 0x0 || nib[2] == 0x2)) {
-		*pc1 = regs->pc + 4 + regs->regs[nib[1]];
-		*pc2 = (unsigned long) -1;
-		return;
-	}
-
-	if (inst == 0x000b) {
-		*pc1 = regs->pr;
-		*pc2 = (unsigned long) -1;
-		return;
-	}
-
-	*pc1 = regs->pc + 2;
-	*pc2 = (unsigned long) -1;
-	return;
-}
-
-/* Tracing by user break controller.  */
-static void
-ubc_set_tracing(int asid, unsigned long nextpc1, unsigned nextpc2)
-{
-	ctrl_outl(nextpc1, UBC_BARA);
-	ctrl_outb(asid, UBC_BASRA);
-	ctrl_outl(0, UBC_BAMRA);
-	if(UBC_TYPE_SH7729)
-		ctrl_outw(BBR_INST | BBR_READ | BBR_CPU, UBC_BBRA);
-	else
-		ctrl_outw(BBR_INST | BBR_READ, UBC_BBRA);
-
-	if (nextpc2 != (unsigned long) -1) {
-		ctrl_outl(nextpc2, UBC_BARB);
-		ctrl_outb(asid, UBC_BASRB);
-		ctrl_outl(0, UBC_BAMRB);
-		if(UBC_TYPE_SH7729)
-			ctrl_outw(BBR_INST | BBR_READ | BBR_CPU, UBC_BBRB);
-		else
-			ctrl_outw(BBR_INST | BBR_READ, UBC_BBRB);
-	}
-	if(UBC_TYPE_SH7729)
-		ctrl_outl(BRCR_PCTE, UBC_BRCR);
-	else
-		ctrl_outw(0, UBC_BRCR);
-}
-
 /*
  * Called by kernel/ptrace.c when detaching..
  *
@@ -300,11 +225,8 @@
 	}
 
 	case PTRACE_SINGLESTEP: {  /* set the trap flag. */
-		long tmp, pc;
+		long pc;
 		struct pt_regs *dummy = NULL;
-		struct pt_regs *regs;
-		unsigned long nextpc1, nextpc2;
-		unsigned short insn;
 
 		ret = -EIO;
 		if ((unsigned long) data > _NSIG)
@@ -315,34 +237,12 @@
 			child->ptrace |= PT_DTRACE;
 		}
 
-		/* Compute next pc.  */
 		pc = get_stack_long(child, (long)&dummy->pc);
-		regs = (struct pt_regs *)(THREAD_SIZE + (unsigned long)child->thread_info) - 1;
-		if (access_process_vm(child, pc&~3, &tmp, sizeof(tmp), 0) != sizeof(tmp))
-			break;
- 
-#ifdef  __LITTLE_ENDIAN__
-		if (pc & 3)
-			insn = tmp >> 16;
-		else
-			insn = tmp & 0xffff;
-#else
-		if (pc & 3)
-			insn = tmp & 0xffff;
-		else
-			insn = tmp >> 16;
-#endif
-		compute_next_pc(regs, insn, &nextpc1, &nextpc2);
 
-		if (nextpc1 & 0x80000000)
-			break;
-		if (nextpc2 != (unsigned long) -1 && (nextpc2 & 0x80000000))
-			break;
-
-#ifdef CONFIG_MMU
-		ubc_set_tracing(child->mm->context & MMU_CONTEXT_ASID_MASK,
-				nextpc1, nextpc2);
-#endif
+		/* Next scheduling will set up UBC */
+		if (child->thread.ubc_pc == 0)
+			ubc_usercnt += 1;
+		child->thread.ubc_pc = pc;
 
 		child->exit_code = data;
 		/* give it a chance to run. */
@@ -362,7 +262,36 @@
 			child->ptrace &= ~PT_TRACESYSGOOD;
 		ret = 0;
 		break;
+#ifdef CONFIG_SH_DSP
+	case PTRACE_GETDSPREGS: {
+		unsigned long dp;
 
+		ret = -EIO;
+		dp = ((unsigned long) child) + THREAD_SIZE -
+			 sizeof(struct pt_dspregs);
+		if (*((int *) (dp - 4)) == SR_FD) {
+			copy_to_user(addr, (void *) dp,
+				sizeof(struct pt_dspregs));
+			ret = 0;
+		}
+		break;
+	}
+
+	case PTRACE_SETDSPREGS: {
+		unsigned long dp;
+		int i;
+
+		ret = -EIO;
+		dp = ((unsigned long) child) + THREAD_SIZE -
+			 sizeof(struct pt_dspregs);
+		if (*((int *) (dp - 4)) == SR_FD) {
+			copy_from_user((void *) dp, addr,
+				sizeof(struct pt_dspregs));
+			ret = 0;
+		}
+		break;
+	}
+#endif
 	default:
 		ret = ptrace_request(child, request, addr, data);
 		break;
diff -Nru a/arch/sh/kernel/rtc.c b/arch/sh/kernel/rtc.c
--- a/arch/sh/kernel/rtc.c	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,124 +0,0 @@
-/*
- * linux/arch/sh/kernel/rtc.c -- SH3 / SH4 on-chip RTC support
- *
- *  Copyright (C) 2000  Philipp Rumpf <prumpf@tux.org>
- *  Copyright (C) 1999  Tetsuya Okada & Niibe Yutaka
- */
-
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/time.h>
-#include <linux/bcd.h>
-
-#include <asm/io.h>
-#include <asm/rtc.h>
-
-void sh_rtc_gettimeofday(struct timeval *tv)
-{
-	unsigned int sec128, sec, min, hr, wk, day, mon, yr, yr100;
-
- again:
-	do {
-		ctrl_outb(0, RCR1);  /* Clear CF-bit */
-		sec128 = ctrl_inb(R64CNT);
-		sec = ctrl_inb(RSECCNT);
-		min = ctrl_inb(RMINCNT);
-		hr  = ctrl_inb(RHRCNT);
-		wk  = ctrl_inb(RWKCNT);
-		day = ctrl_inb(RDAYCNT);
-		mon = ctrl_inb(RMONCNT);
-#if defined(__SH4__)
-		yr  = ctrl_inw(RYRCNT);
-		yr100 = (yr >> 8);
-		yr &= 0xff;
-#else
-		yr  = ctrl_inb(RYRCNT);
-		yr100 = (yr == 0x99) ? 0x19 : 0x20;
-#endif
-	} while ((ctrl_inb(RCR1) & RCR1_CF) != 0);
-
-#if RTC_BIT_INVERTED != 0
-	/* Work around to avoid reading incorrect value. */
-	if (sec128 == RTC_BIT_INVERTED) {
-		schedule_timeout(1);
-		goto again;
-	}
-#endif
-
-	BCD_TO_BIN(yr100);
-	BCD_TO_BIN(yr);
-	BCD_TO_BIN(mon);
-	BCD_TO_BIN(day);
-	BCD_TO_BIN(hr);
-	BCD_TO_BIN(min);
-	BCD_TO_BIN(sec);
-
-	if (yr > 99 || mon < 1 || mon > 12 || day > 31 || day < 1 ||
-	    hr > 23 || min > 59 || sec > 59) {
-		printk(KERN_ERR
-		       "SH RTC: invalid value, resetting to 1 Jan 2000\n");
-		ctrl_outb(RCR2_RESET, RCR2);  /* Reset & Stop */
-		ctrl_outb(0, RSECCNT);
-		ctrl_outb(0, RMINCNT);
-		ctrl_outb(0, RHRCNT);
-		ctrl_outb(6, RWKCNT);
-		ctrl_outb(1, RDAYCNT);
-		ctrl_outb(1, RMONCNT);
-#if defined(__SH4__)
-		ctrl_outw(0x2000, RYRCNT);
-#else
-		ctrl_outb(0, RYRCNT);
-#endif
-		ctrl_outb(RCR2_RTCEN|RCR2_START, RCR2);  /* Start */
-		goto again;
-	}
-
-#if RTC_BIT_INVERTED != 0
-	if ((sec128 & RTC_BIT_INVERTED))
-		sec--;
-#endif
-
-	tv->tv_sec = mktime(yr100 * 100 + yr, mon, day, hr, min, sec);
-	tv->tv_usec = (sec128 * 1000000) / 128;
-}
-
-int sh_rtc_settimeofday(const struct timeval *tv)
-{
-	unsigned long nowtime = tv->tv_sec;
-	int retval = 0;
-	int real_seconds, real_minutes, cmos_minutes;
-
-	ctrl_outb(RCR2_RESET, RCR2);  /* Reset pre-scaler & stop RTC */
-
-	cmos_minutes = ctrl_inb(RMINCNT);
-	BCD_TO_BIN(cmos_minutes);
-
-	/*
-	 * since we're only adjusting minutes and seconds,
-	 * don't interfere with hour overflow. This avoids
-	 * messing with unknown time zones but requires your
-	 * RTC not to be off by more than 15 minutes
-	 */
-	real_seconds = nowtime % 60;
-	real_minutes = nowtime / 60;
-	if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
-		real_minutes += 30;	/* correct for half hour time zone */
-	real_minutes %= 60;
-
-	if (abs(real_minutes - cmos_minutes) < 30) {
-		BIN_TO_BCD(real_seconds);
-		BIN_TO_BCD(real_minutes);
-		ctrl_outb(real_seconds, RSECCNT);
-		ctrl_outb(real_minutes, RMINCNT);
-	} else {
-		printk(KERN_WARNING
-		       "set_rtc_time: can't update from %d to %d\n",
-		       cmos_minutes, real_minutes);
-		retval = -1;
-	}
-
-	ctrl_outb(RCR2_RTCEN|RCR2_START, RCR2);  /* Start RTC */
-
-	return retval;
-}
diff -Nru a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
--- a/arch/sh/kernel/setup.c	Tue Feb  3 19:45:30 2004
+++ b/arch/sh/kernel/setup.c	Tue Feb  3 19:45:30 2004
@@ -1,4 +1,4 @@
-/* $Id: setup.c,v 1.17 2003/05/20 01:51:37 lethal Exp $
+/* $Id: setup.c,v 1.30 2003/10/13 07:21:19 lethal Exp $
  *
  *  linux/arch/sh/kernel/setup.c
  *
@@ -10,38 +10,21 @@
  * This file handles the architecture-dependent parts of initialization
  */
 
-#include <linux/errno.h>
-#include <linux/sched.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/stddef.h>
-#include <linux/unistd.h>
-#include <linux/ptrace.h>
-#include <linux/slab.h>
-#include <linux/user.h>
-#include <linux/a.out.h>
 #include <linux/tty.h>
 #include <linux/ioport.h>
-#include <linux/delay.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/initrd.h>
 #include <linux/bootmem.h>
 #include <linux/console.h>
-#include <linux/ctype.h>
 #include <linux/seq_file.h>
-#include <linux/utsname.h>
 #include <linux/root_dev.h>
 #include <linux/utsname.h>
 #include <linux/cpu.h>
-#include <asm/processor.h>
-#include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/uaccess.h>
-#include <asm/system.h>
 #include <asm/io.h>
 #include <asm/io_generic.h>
-#include <asm/machvec.h>
+#include <asm/sections.h>
+#include <asm/irq.h>
 #ifdef CONFIG_SH_EARLY_PRINTK
 #include <asm/sh_bios.h>
 #endif
@@ -63,7 +46,6 @@
 struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 0, 10000000, };
 struct screen_info screen_info;
 unsigned char aux_device_present = 0xaa;
-static int fpu_disabled __initdata = 0;
 
 #if defined(CONFIG_SH_UNKNOWN)
 struct sh_machine_vector sh_mv;
@@ -82,11 +64,9 @@
         16                      /* orig-video-points */
 };
 
-extern void fpu_init(void);
 extern void platform_setup(void);
 extern char *get_system_type(void);
 extern int root_mountflags;
-extern int _text, _etext, _edata, _end;
 
 #define MV_NAME_SIZE 32
 
@@ -174,7 +154,7 @@
 
 static int __init scif_sercon_setup(struct console *con, char *options)
 {
-	con->cflag = CREAD | HUPCL | CLOCAL | B115200 | CS8;
+	con->cflag = CREAD | HUPCL | CLOCAL | B57600 | CS8;
 
 	return 0;
 }
@@ -333,7 +313,7 @@
 	*cmdline_p = command_line;
 }
 
-void __init setup_arch(char **cmdline_p)
+static int __init sh_mv_setup(char **cmdline_p)
 {
 #if defined(CONFIG_SH_UNKNOWN)
 	extern struct sh_machine_vector mv_unknown;
@@ -342,41 +322,11 @@
 	char mv_name[MV_NAME_SIZE] = "";
 	unsigned long mv_io_base = 0;
 	int mv_mmio_enable = 0;
-	unsigned long bootmap_size;
-	unsigned long start_pfn, max_pfn, max_low_pfn;
-
-/* XXX: MRB-remove */
-#if 0
-	scif_sercon_init(115200);
-#endif
-#ifdef CONFIG_SH_EARLY_PRINTK
-	sh_console_init();
-#endif
-	
-	ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
-
-#ifdef CONFIG_BLK_DEV_RAM
-	rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK;
-	rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0);
-	rd_doload = ((RAMDISK_FLAGS & RAMDISK_LOAD_FLAG) != 0);
-#endif
-
-	if (!MOUNT_ROOT_RDONLY)
-		root_mountflags &= ~MS_RDONLY;
-	init_mm.start_code = (unsigned long)&_text;
-	init_mm.end_code = (unsigned long) &_etext;
-	init_mm.end_data = (unsigned long) &_edata;
-	init_mm.brk = (unsigned long) &_end;
-
-	code_resource.start = virt_to_bus(&_text);
-	code_resource.end = virt_to_bus(&_etext)-1;
-	data_resource.start = virt_to_bus(&_etext);
-	data_resource.end = virt_to_bus(&_edata)-1;
 
 	parse_cmdline(cmdline_p, mv_name, &mv, &mv_io_base, &mv_mmio_enable);
 
 #ifdef CONFIG_CMDLINE_BOOL
-	sprintf(*cmdline_p, CONFIG_CMDLINE);
+        sprintf(*cmdline_p, CONFIG_CMDLINE);
 #endif
 
 #ifdef CONFIG_SH_GENERIC
@@ -393,42 +343,75 @@
 	sh_mv = mv_unknown;
 #endif
 
-#if defined(CONFIG_SH_UNKNOWN)
-	if (mv_io_base != 0) {
-		sh_mv.mv_inb = generic_inb;
-		sh_mv.mv_inw = generic_inw;
-		sh_mv.mv_inl = generic_inl;
-		sh_mv.mv_outb = generic_outb;
-		sh_mv.mv_outw = generic_outw;
-		sh_mv.mv_outl = generic_outl;
-
-		sh_mv.mv_inb_p = generic_inb_p;
-		sh_mv.mv_inw_p = generic_inw_p;
-		sh_mv.mv_inl_p = generic_inl_p;
-		sh_mv.mv_outb_p = generic_outb_p;
-		sh_mv.mv_outw_p = generic_outw_p;
-		sh_mv.mv_outl_p = generic_outl_p;
-
-		sh_mv.mv_insb = generic_insb;
-		sh_mv.mv_insw = generic_insw;
-		sh_mv.mv_insl = generic_insl;
-		sh_mv.mv_outsb = generic_outsb;
-		sh_mv.mv_outsw = generic_outsw;
-		sh_mv.mv_outsl = generic_outsl;
-
-		sh_mv.mv_isa_port2addr = generic_isa_port2addr;
-		generic_io_base = mv_io_base;
-	}
-	if (mv_mmio_enable != 0) {
-		sh_mv.mv_readb = generic_readb;
-		sh_mv.mv_readw = generic_readw;
-		sh_mv.mv_readl = generic_readl;
-		sh_mv.mv_writeb = generic_writeb;
-		sh_mv.mv_writew = generic_writew;
-		sh_mv.mv_writel = generic_writel;
-	}
+	/*
+	 * Manually walk the vec, fill in anything that the board hasn't yet
+	 * by hand, wrapping to the generic implementation.
+	 */
+#define mv_set(elem) do { \
+	if (!sh_mv.mv_##elem) \
+		sh_mv.mv_##elem = generic_##elem; \
+} while (0)
+
+	mv_set(inb);	mv_set(inw);	mv_set(inl);
+	mv_set(outb);	mv_set(outw);	mv_set(outl);
+
+	mv_set(inb_p);	mv_set(inw_p);	mv_set(inl_p);
+	mv_set(outb_p);	mv_set(outw_p);	mv_set(outl_p);
+
+	mv_set(insb);	mv_set(insw);	mv_set(insl);
+	mv_set(outsb);	mv_set(outsw);	mv_set(outsl);
+
+	mv_set(readb);	mv_set(readw);	mv_set(readl);
+	mv_set(writeb);	mv_set(writew);	mv_set(writel);
+
+	mv_set(ioremap);
+	mv_set(iounmap);
+
+	mv_set(isa_port2addr);
+	mv_set(irq_demux);
+
+#ifdef CONFIG_SH_UNKNOWN
+	__set_io_port_base(mv_io_base);
 #endif
 
+	return 0;
+}
+
+void __init setup_arch(char **cmdline_p)
+{
+	unsigned long bootmap_size;
+	unsigned long start_pfn, max_pfn, max_low_pfn;
+
+/* XXX: MRB-remove */
+#if 0
+	scif_sercon_init(57600);
+#endif
+#ifdef CONFIG_SH_EARLY_PRINTK
+	sh_console_init();
+#endif
+	
+	ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
+
+#ifdef CONFIG_BLK_DEV_RAM
+	rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK;
+	rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0);
+	rd_doload = ((RAMDISK_FLAGS & RAMDISK_LOAD_FLAG) != 0);
+#endif
+
+	if (!MOUNT_ROOT_RDONLY)
+		root_mountflags &= ~MS_RDONLY;
+	init_mm.start_code = (unsigned long) _text;
+	init_mm.end_code = (unsigned long) _etext;
+	init_mm.end_data = (unsigned long) _edata;
+	init_mm.brk = (unsigned long) _end;
+
+	code_resource.start = virt_to_bus(_text);
+	code_resource.end = virt_to_bus(_etext)-1;
+	data_resource.start = virt_to_bus(_etext);
+	data_resource.end = virt_to_bus(_edata)-1;
+
+	sh_mv_setup(cmdline_p);
+
 #define PFN_UP(x)	(((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
 #define PFN_DOWN(x)	((x) >> PAGE_SHIFT)
 #define PFN_PHYS(x)	((x) << PAGE_SHIFT)
@@ -459,7 +442,8 @@
 	 * Partially used pages are not usable - thus
 	 * we are rounding upwards:
  	 */
-	start_pfn = PFN_UP(__pa(&_end));
+	start_pfn = PFN_UP(__pa(_end));
+
 	/*
 	 * Find a proper area for the bootmem bitmap. After this
 	 * bootstrap step all allocations (until the page allocator
@@ -524,40 +508,13 @@
 	}
 #endif
 
-#ifdef CONFIG_VT
-#if defined(CONFIG_VGA_CONSOLE)
-	conswitchp = &vga_con;
-#elif defined(CONFIG_DUMMY_CONSOLE)
+#ifdef CONFIG_DUMMY_CONSOLE
 	conswitchp = &dummy_con;
 #endif
-#endif
 
 	/* Perform the machine specific initialisation */
 	platform_setup();
 
-#if defined(CONFIG_CPU_SH4)
-	/* FPU initialization */
-	clear_thread_flag(TIF_USEDFPU);
-	current->used_math = 0;
-#endif
-
-	/* Disable the FPU */
-	if (fpu_disabled) {
-		printk("FPU Disabled\n");
-		cpu_data->flags &= ~CPU_HAS_FPU;
-		release_fpu();
-	}
-
-#ifdef CONFIG_UBC_WAKEUP
-	/*
-	 * Some brain-damaged loaders decided it would be a good idea to put
-	 * the UBC to sleep. This causes some issues when it comes to things
-	 * like PTRACE_SINGLESTEP or doing hardware watchpoints in GDB.  So ..
-	 * we wake it up and hope that all is well.
-	 */
-	ubc_wakeup();
-#endif
-
 	paging_init();
 }
 
@@ -599,17 +556,20 @@
 subsys_initcall(topology_init);
 
 static const char *cpu_name[] = {
-	[CPU_SH7604]	"SH7604",
-	[CPU_SH7708]	"SH7708",
-	[CPU_SH7729]	"SH7729",
-	[CPU_SH7750]	"SH7750",
-	[CPU_SH7750S]	"SH7750S",
-	[CPU_SH7750R]	"SH7750R",
-	[CPU_SH7751]	"SH7751",
-	[CPU_SH7751R]	"SH7751R",
-	[CPU_ST40RA]	"ST40RA",
-	[CPU_ST40GX1]	"ST40GX1",
-	[CPU_SH_NONE]	"Unknown"
+	[CPU_SH7604]	= "SH7604",
+	[CPU_SH7708]	= "SH7708",
+	[CPU_SH7729]	= "SH7729",
+	[CPU_SH7750]	= "SH7750",
+	[CPU_SH7750S]	= "SH7750S",
+	[CPU_SH7750R]	= "SH7750R",
+	[CPU_SH7751]	= "SH7751",
+	[CPU_SH7751R]	= "SH7751R",
+	[CPU_SH7760]	= "SH7760",
+	[CPU_ST40RA]	= "ST40RA",
+	[CPU_ST40GX1]	= "ST40GX1",
+	[CPU_SH4_202]	= "SH4-202",
+	[CPU_SH4_501]	= "SH4-501",
+	[CPU_SH_NONE]	= "Unknown"
 };
 
 const char *get_cpu_subtype(void)
@@ -617,44 +577,73 @@
 	return cpu_name[boot_cpu_data.type];
 }
 
+#ifdef CONFIG_PROC_FS
+static const char *cpu_flags[] = {
+	"none", "fpu", "p2flush", "mmuassoc", "dsp",
+};
+
+static void show_cpuflags(struct seq_file *m)
+{
+	unsigned long i;
+
+	seq_printf(m, "cpu flags\t:");
+
+	if (!cpu_data->flags) {
+		seq_printf(m, " %s\n", cpu_flags[0]);
+		return;
+	}
+
+	for (i = 0; i < cpu_data->flags; i++)
+		if ((cpu_data->flags & (1 << i)))
+			seq_printf(m, " %s", cpu_flags[i]);
+	
+	seq_printf(m, "\n");
+}
+
+static void show_cacheinfo(struct seq_file *m, const char *type, struct cache_info info)
+{
+	unsigned int cache_size;
+
+	cache_size = info.ways * info.sets * info.linesz;
+
+	seq_printf(m, "%s size\t: %dKiB\n", type, cache_size >> 10);
+}
+
 /*
  *	Get CPU information for use by the procfs.
  */
-#ifdef CONFIG_PROC_FS
 static int show_cpuinfo(struct seq_file *m, void *v)
 {
-	unsigned int dcachesz, icachesz;
 	unsigned int cpu = smp_processor_id();
 
-	icachesz = boot_cpu_data.icache.ways *
-		   boot_cpu_data.icache.sets *
-		   boot_cpu_data.icache.linesz;
-
 	if (!cpu && cpu_online(cpu))
 		seq_printf(m, "machine\t\t: %s\n", get_system_type());
 
 	seq_printf(m, "processor\t: %d\n", cpu);
 	seq_printf(m, "cpu family\t: %s\n", system_utsname.machine);
 	seq_printf(m, "cpu type\t: %s\n", get_cpu_subtype());
-	seq_printf(m, "cache size\t: %dK-bytes", icachesz >> 10);
+
+	show_cpuflags(m);
+
+	seq_printf(m, "cache type\t: ");
 
 	/*
-	 * SH-2 and SH-3 have a combined cache, thus there's no real
-	 * I/D distinction ..  so don't inadvertently double
-	 * up the output.
+	 * Check for what type of cache we have, we support both the
+	 * unified cache on the SH-2 and SH-3, as well as the harvard
+	 * style cache on the SH-4.
 	 */
-	if (strcmp(system_utsname.machine, "sh2") ||
-	    strcmp(system_utsname.machine, "sh3")) {
-		dcachesz = boot_cpu_data.dcache.ways *
-			   boot_cpu_data.dcache.sets *
-			   boot_cpu_data.dcache.linesz;
-
-		seq_printf(m, "/%dK-bytes", dcachesz >> 10);
+	if (test_bit(SH_CACHE_COMBINED, &(boot_cpu_data.icache.flags))) {
+		seq_printf(m, "unified\n");
+		show_cacheinfo(m, "cache", boot_cpu_data.icache);
+	} else {
+		seq_printf(m, "split (harvard)\n");
+		show_cacheinfo(m, "icache", boot_cpu_data.icache);
+		show_cacheinfo(m, "dcache", boot_cpu_data.dcache);
 	}
 
-	seq_printf(m, "\nbogomips\t: %lu.%02lu\n",
-		     loops_per_jiffy/(500000/HZ),
-		     (loops_per_jiffy/(5000/HZ)) % 100);
+	seq_printf(m, "bogomips\t: %lu.%02lu\n",
+		     boot_cpu_data.loops_per_jiffy/(500000/HZ),
+		     (boot_cpu_data.loops_per_jiffy/(5000/HZ)) % 100);
 
 #define PRINT_CLOCK(name, value) \
 	seq_printf(m, name " clock\t: %d.%02dMHz\n", \
@@ -779,11 +768,4 @@
 }
 __setup("kgdb=", kgdb_parse_options);
 #endif /* CONFIG_SH_KGDB */
-
-static int __init fpu_setup(char *opts)
-{
-	fpu_disabled = 1;
-	return 0;
-}
-__setup("nofpu", fpu_setup);
 
diff -Nru a/arch/sh/kernel/sh_bios.c b/arch/sh/kernel/sh_bios.c
--- a/arch/sh/kernel/sh_bios.c	Tue Feb  3 19:45:42 2004
+++ b/arch/sh/kernel/sh_bios.c	Tue Feb  3 19:45:42 2004
@@ -1,4 +1,4 @@
-/* $Id: sh_bios.c,v 1.5 2001/01/08 08:42:32 gniibe Exp $
+/* $Id: sh_bios.c,v 1.2 2003/05/04 19:29:53 lethal Exp $
  *
  *  linux/arch/sh/kernel/sh_bios.c
  *  C interface for trapping into the standard LinuxSH BIOS.
diff -Nru a/arch/sh/kernel/sh_ksyms.c b/arch/sh/kernel/sh_ksyms.c
--- a/arch/sh/kernel/sh_ksyms.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/kernel/sh_ksyms.c	Tue Feb  3 19:45:17 2004
@@ -25,6 +25,8 @@
 extern int dump_fpu(struct pt_regs *, elf_fpregset_t *);
 extern struct hw_interrupt_type no_irq_type;
 
+EXPORT_SYMBOL(sh_mv);
+
 /* platform dependent support */
 EXPORT_SYMBOL(dump_thread);
 EXPORT_SYMBOL(dump_fpu);
@@ -71,7 +73,9 @@
 
 EXPORT_SYMBOL(boot_cpu_data);
 
+#ifdef CONFIG_MMU
 EXPORT_SYMBOL(get_vm_area);
+#endif
 
 /* semaphore exports */
 EXPORT_SYMBOL(__up);
diff -Nru a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal.c
--- a/arch/sh/kernel/signal.c	Tue Feb  3 19:45:43 2004
+++ b/arch/sh/kernel/signal.c	Tue Feb  3 19:45:43 2004
@@ -1,4 +1,4 @@
-/* $Id: signal.c,v 1.15 2003/05/06 23:28:47 lethal Exp $
+/* $Id: signal.c,v 1.19 2003/10/13 07:21:19 lethal Exp $
  *
  *  linux/arch/sh/kernel/signal.c
  *
@@ -93,8 +93,8 @@
 }
 
 asmlinkage int 
-sys_sigaction(int sig, const struct old_sigaction *act,
-	      struct old_sigaction *oact)
+sys_sigaction(int sig, const struct old_sigaction __user *act,
+	      struct old_sigaction __user *oact)
 {
 	struct k_sigaction new_ka, old_ka;
 	int ret;
@@ -125,7 +125,7 @@
 }
 
 asmlinkage int
-sys_sigaltstack(const stack_t *uss, stack_t *uoss,
+sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
 		unsigned long r6, unsigned long r7,
 		struct pt_regs regs)
 {
@@ -137,24 +137,26 @@
  * Do a signal return; undo the signal stack.
  */
 
+#define MOVW(n)	 (0x9300|((n)-2))	/* Move mem word at PC+n to R3 */
+#define TRAP16	 0xc310			/* Syscall w/no args (NR in R3) */
+#define OR_R0_R0 0x200b			/* or r0,r0 (insert to avoid hardware bug) */
+
 struct sigframe
 {
 	struct sigcontext sc;
 	unsigned long extramask[_NSIG_WORDS-1];
-	char retcode[4];
+	u16 retcode[8];
 };
 
 struct rt_sigframe
 {
-	struct siginfo *pinfo;
-	void *puc;
 	struct siginfo info;
 	struct ucontext uc;
-	char retcode[4];
+	u16 retcode[8];
 };
 
 #ifdef CONFIG_CPU_SH4
-static inline int restore_sigcontext_fpu(struct sigcontext *sc)
+static inline int restore_sigcontext_fpu(struct sigcontext __user *sc)
 {
 	struct task_struct *tsk = current;
 
@@ -166,7 +168,7 @@
 				sizeof(long)*(16*2+2));
 }
 
-static inline int save_sigcontext_fpu(struct sigcontext *sc)
+static inline int save_sigcontext_fpu(struct sigcontext __user *sc)
 {
 	struct task_struct *tsk = current;
 
@@ -192,7 +194,7 @@
 #endif /* CONFIG_CPU_SH4 */
 
 static int
-restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc, int *r0_p)
+restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *r0_p)
 {
 	unsigned int err = 0;
 
@@ -233,7 +235,7 @@
 			     unsigned long r6, unsigned long r7,
 			     struct pt_regs regs)
 {
-	struct sigframe *frame = (struct sigframe *)regs.regs[15];
+	struct sigframe __user *frame = (struct sigframe __user *)regs.regs[15];
 	sigset_t set;
 	int r0;
 
@@ -266,7 +268,7 @@
 				unsigned long r6, unsigned long r7,
 				struct pt_regs regs)
 {
-	struct rt_sigframe *frame = (struct rt_sigframe *)regs.regs[15];
+	struct rt_sigframe __user *frame = (struct rt_sigframe __user *)regs.regs[15];
 	sigset_t set;
 	stack_t st;
 	int r0;
@@ -304,7 +306,7 @@
  */
 
 static int
-setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
+setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
 		 unsigned long mask)
 {
 	int err = 0;
@@ -336,19 +338,19 @@
 /*
  * Determine which stack to use..
  */
-static inline void *
+static inline void __user *
 get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size)
 {
 	if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! on_sig_stack(sp))
 		sp = current->sas_ss_sp + current->sas_ss_size;
 
-	return (void *)((sp - frame_size) & -8ul);
+	return (void __user *)((sp - frame_size) & -8ul);
 }
 
 static void setup_frame(int sig, struct k_sigaction *ka,
 			sigset_t *set, struct pt_regs *regs)
 {
-	struct sigframe *frame;
+	struct sigframe __user *frame;
 	int err = 0;
 	int signal;
 
@@ -375,15 +377,16 @@
 	if (ka->sa.sa_flags & SA_RESTORER) {
 		regs->pr = (unsigned long) ka->sa.sa_restorer;
 	} else {
-		/* This is : mov  #__NR_sigreturn,r3 ; trapa #0x10 */
-#ifdef __LITTLE_ENDIAN__
-		unsigned long code = 0xc310e300 | (__NR_sigreturn);
-#else
-		unsigned long code = 0xe300c310 | (__NR_sigreturn << 16);
-#endif
-
+		/* Generate return code (system call to sigreturn) */
+		err |= __put_user(MOVW(7), &frame->retcode[0]);
+		err |= __put_user(TRAP16, &frame->retcode[1]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[2]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[3]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[4]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[5]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[6]);
+		err |= __put_user((__NR_sigreturn), &frame->retcode[7]);
 		regs->pr = (unsigned long) frame->retcode;
-		err |= __put_user(code, (long *)(frame->retcode+0));
 	}
 
 	if (err)
@@ -392,6 +395,8 @@
 	/* Set up registers for signal handler */
 	regs->regs[15] = (unsigned long) frame;
 	regs->regs[4] = signal; /* Arg for signal handler */
+	regs->regs[5] = 0;
+	regs->regs[6] = (unsigned long) &frame->sc;
 	regs->pc = (unsigned long) ka->sa.sa_handler;
 
 	set_fs(USER_DS);
@@ -402,6 +407,8 @@
 #endif
 
 	flush_cache_sigtramp(regs->pr);
+	if ((-regs->pr & (L1_CACHE_BYTES-1)) < sizeof(frame->retcode))
+		flush_cache_sigtramp(regs->pr + L1_CACHE_BYTES);
 	return;
 
 give_sigsegv:
@@ -413,7 +420,7 @@
 static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 			   sigset_t *set, struct pt_regs *regs)
 {
-	struct rt_sigframe *frame;
+	struct rt_sigframe __user *frame;
 	int err = 0;
 	int signal;
 
@@ -428,8 +435,6 @@
 		? current_thread_info()->exec_domain->signal_invmap[sig]
 		: sig;
 
-	err |= __put_user(&frame->info, &frame->pinfo);
-	err |= __put_user(&frame->uc, &frame->puc);
 	err |= copy_siginfo_to_user(&frame->info, info);
 
 	/* Create the ucontext.  */
@@ -449,15 +454,16 @@
 	if (ka->sa.sa_flags & SA_RESTORER) {
 		regs->pr = (unsigned long) ka->sa.sa_restorer;
 	} else {
-		/* This is : mov  #__NR_rt_sigreturn,r3 ; trapa #0x10 */
-#ifdef __LITTLE_ENDIAN__
-		unsigned long code = 0xc310e300 | (__NR_rt_sigreturn);
-#else
-		unsigned long code = 0xe300c310 | (__NR_rt_sigreturn << 16);
-#endif
-
+		/* Generate return code (system call to rt_sigreturn) */
+		err |= __put_user(MOVW(7), &frame->retcode[0]);
+		err |= __put_user(TRAP16, &frame->retcode[1]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[2]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[3]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[4]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[5]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[6]);
+		err |= __put_user((__NR_rt_sigreturn), &frame->retcode[7]);
 		regs->pr = (unsigned long) frame->retcode;
-		err |= __put_user(code, (long *)(frame->retcode+0));
 	}
 
 	if (err)
@@ -466,6 +472,8 @@
 	/* Set up registers for signal handler */
 	regs->regs[15] = (unsigned long) frame;
 	regs->regs[4] = signal; /* Arg for signal handler */
+	regs->regs[5] = (unsigned long) &frame->info;
+	regs->regs[6] = (unsigned long) &frame->uc;
 	regs->pc = (unsigned long) ka->sa.sa_handler;
 
 	set_fs(USER_DS);
@@ -476,6 +484,8 @@
 #endif
 
 	flush_cache_sigtramp(regs->pr);
+	if ((-regs->pr & (L1_CACHE_BYTES-1)) < sizeof(frame->retcode))
+		flush_cache_sigtramp(regs->pr + L1_CACHE_BYTES);
 	return;
 
 give_sigsegv:
diff -Nru a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/kernel/smp.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,207 @@
+/*
+ * arch/sh/kernel/smp.c
+ *
+ * SMP support for the SuperH processors.
+ *
+ * Copyright (C) 2002, 2003 Paul Mundt
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+#include <linux/config.h>
+#include <linux/cache.h>
+#include <linux/cpumask.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/spinlock.h>
+#include <linux/threads.h>
+#include <linux/module.h>
+#include <linux/time.h>
+#include <linux/timex.h>
+#include <linux/sched.h>
+
+#include <asm/atomic.h>
+#include <asm/processor.h>
+#include <asm/system.h>
+#include <asm/hardirq.h>
+#include <asm/mmu_context.h>
+#include <asm/smp.h>
+
+/*
+ * This was written with the Sega Saturn (SMP SH-2 7604) in mind,
+ * but is designed to be usable regardless if there's an MMU
+ * present or not.
+ */
+int smp_threads_ready = 0;
+struct sh_cpuinfo cpu_data[NR_CPUS];
+
+extern int cpu_idle(void *unused);
+extern void per_cpu_trap_init(void);
+
+cpumask_t cpu_possible_map;
+cpumask_t cpu_online_map;
+unsigned long cache_decay_ticks = HZ / 100;
+static atomic_t cpus_booted = ATOMIC_INIT(0);
+
+/* These are defined by the board-specific code. */
+
+/*
+ * Cause the function described by call_data to be executed on the passed
+ * cpu.  When the function has finished, increment the finished field of
+ * call_data.
+ */
+void __smp_send_ipi(unsigned int cpu, unsigned int action);
+
+/*
+ * Find the number of available processors
+ */
+unsigned int __smp_probe_cpus(void);
+
+/*
+ * Start a particular processor
+ */
+void __smp_slave_init(unsigned int cpu);
+
+/*
+ * Run specified function on a particular processor.
+ */
+void __smp_call_function(unsigned int cpu);
+
+static inline void __init smp_store_cpu_info(unsigned int cpu)
+{
+	cpu_data[cpu].loops_per_jiffy = loops_per_jiffy;
+}
+
+void __init smp_prepare_cpus(unsigned int max_cpus)
+{
+	unsigned int cpu = smp_processor_id();
+	int i;
+
+	atomic_set(&cpus_booted, 1);
+	smp_store_cpu_info(cpu);
+	
+	for (i = 0; i < __smp_probe_cpus(); i++)
+		cpu_set(i, cpu_possible_map);
+}
+
+void __devinit smp_prepare_boot_cpu(void)
+{
+	unsigned int cpu = smp_processor_id();
+
+	cpu_set(cpu, cpu_online_map);
+	cpu_set(cpu, cpu_possible_map);
+}
+
+int __cpu_up(unsigned int cpu)
+{
+	struct task_struct *tsk;
+	struct pt_regs regs;
+
+	memset(&regs, 0, sizeof(struct pt_regs));
+	tsk = copy_process(CLONE_VM | CLONE_IDLETASK, 0, &regs, 0, 0, 0);
+
+	if (IS_ERR(tsk))
+		panic("Failed forking idle task for cpu %d\n", cpu);
+	
+	wake_up_forked_process(tsk);
+
+	init_idle(tsk, cpu);
+	unhash_process(tsk);
+	
+	tsk->thread_info->cpu = cpu;
+
+	cpu_set(cpu, cpu_online_map);
+
+	return 0;
+}
+
+int start_secondary(void *unused)
+{
+	unsigned int cpu = smp_processor_id();
+
+	atomic_inc(&init_mm.mm_count);
+	current->active_mm = &init_mm;
+
+	smp_store_cpu_info(cpu);
+
+	__smp_slave_init(cpu);
+	per_cpu_trap_init();
+	
+	atomic_inc(&cpus_booted);
+
+	return cpu_idle(0);
+}
+
+void __init smp_cpus_done(unsigned int max_cpus)
+{
+	smp_threads_ready = 1;
+	smp_mb();
+}
+
+void smp_send_reschedule(int cpu)
+{
+	__smp_send_ipi(cpu, SMP_MSG_RESCHEDULE);
+}
+
+static void stop_this_cpu(void *unused)
+{
+	cpu_clear(smp_processor_id(), cpu_online_map);
+	local_irq_disable();
+
+	for (;;)
+		cpu_relax();
+}
+
+void smp_send_stop(void)
+{
+	smp_call_function(stop_this_cpu, 0, 1, 0);
+}
+
+
+struct smp_fn_call_struct smp_fn_call = {
+	.lock		= SPIN_LOCK_UNLOCKED,
+	.finished	= ATOMIC_INIT(0),
+};
+
+/*
+ * The caller of this wants the passed function to run on every cpu.  If wait
+ * is set, wait until all cpus have finished the function before returning.
+ * The lock is here to protect the call structure.
+ * You must not call this function with disabled interrupts or from a
+ * hardware interrupt handler or from a bottom half handler.
+ */
+int smp_call_function(void (*func)(void *info), void *info, int retry, int wait)
+{
+	unsigned int nr_cpus = atomic_read(&cpus_booted);
+	int i;
+
+	if (nr_cpus < 2)
+		return 0;
+
+	spin_lock(&smp_fn_call.lock);
+
+	atomic_set(&smp_fn_call.finished, 0);
+	smp_fn_call.fn = func;
+	smp_fn_call.data = info;
+
+	for (i = 0; i < nr_cpus; i++)
+		if (i != smp_processor_id())
+			__smp_call_function(i);
+
+	if (wait)
+		while (atomic_read(&smp_fn_call.finished) != (nr_cpus - 1));
+
+	spin_unlock(&smp_fn_call.lock);
+
+	return 0;
+}
+
+/* Not really SMP stuff ... */
+int setup_profiling_timer(unsigned int multiplier)
+{
+	return 0;
+}
+
diff -Nru a/arch/sh/kernel/sys_sh.c b/arch/sh/kernel/sys_sh.c
--- a/arch/sh/kernel/sys_sh.c	Tue Feb  3 19:45:43 2004
+++ b/arch/sh/kernel/sys_sh.c	Tue Feb  3 19:45:43 2004
@@ -132,7 +132,7 @@
  * This is really horribly ugly.
  */
 asmlinkage int sys_ipc(uint call, int first, int second,
-		       int third, void *ptr, long fifth)
+		       int third, void __user *ptr, long fifth)
 {
 	int version, ret;
 
@@ -142,19 +142,19 @@
 	if (call <= SEMCTL)
 		switch (call) {
 		case SEMOP:
-			return sys_semtimedop(first, (struct sembuf *)ptr,
+			return sys_semtimedop(first, (struct sembuf __user *)ptr,
 					      second, NULL);
 		case SEMTIMEDOP:
-			return sys_semtimedop(first, (struct sembuf *)ptr,
+			return sys_semtimedop(first, (struct sembuf __user *)ptr,
 					      second,
-					      (const struct timespec *)fifth);
+					      (const struct timespec __user *)fifth);
 		case SEMGET:
 			return sys_semget (first, second, third);
 		case SEMCTL: {
 			union semun fourth;
 			if (!ptr)
 				return -EINVAL;
-			if (get_user(fourth.__pad, (void **) ptr))
+			if (get_user(fourth.__pad, (void * __user *) ptr))
 				return -EFAULT;
 			return sys_semctl (first, second, third, fourth);
 			}
@@ -165,7 +165,7 @@
 	if (call <= MSGCTL) 
 		switch (call) {
 		case MSGSND:
-			return sys_msgsnd (first, (struct msgbuf *) ptr, 
+			return sys_msgsnd (first, (struct msgbuf __user *) ptr, 
 					  second, third);
 		case MSGRCV:
 			switch (version) {
@@ -175,7 +175,7 @@
 					return -EINVAL;
 				
 				if (copy_from_user(&tmp,
-						   (struct ipc_kludge *) ptr, 
+						   (struct ipc_kludge __user *) ptr, 
 						   sizeof (tmp)))
 					return -EFAULT;
 				return sys_msgrcv (first, tmp.msgp, second,
@@ -183,14 +183,14 @@
 				}
 			default:
 				return sys_msgrcv (first,
-						   (struct msgbuf *) ptr,
+						   (struct msgbuf __user *) ptr,
 						   second, fifth, third);
 			}
 		case MSGGET:
 			return sys_msgget ((key_t) first, second);
 		case MSGCTL:
 			return sys_msgctl (first, second,
-					   (struct msqid_ds *) ptr);
+					   (struct msqid_ds __user *) ptr);
 		default:
 			return -EINVAL;
 		}
@@ -200,25 +200,25 @@
 			switch (version) {
 			default: {
 				ulong raddr;
-				ret = sys_shmat (first, (char *) ptr,
+				ret = sys_shmat (first, (char __user *) ptr,
 						 second, &raddr);
 				if (ret)
 					return ret;
-				return put_user (raddr, (ulong *) third);
+				return put_user (raddr, (ulong __user *) third);
 			}
 			case 1:	/* iBCS2 emulator entry point */
 				if (!segment_eq(get_fs(), get_ds()))
 					return -EINVAL;
-				return sys_shmat (first, (char *) ptr,
+				return sys_shmat (first, (char __user *) ptr,
 						  second, (ulong *) third);
 			}
 		case SHMDT: 
-			return sys_shmdt ((char *)ptr);
+			return sys_shmdt ((char __user *)ptr);
 		case SHMGET:
 			return sys_shmget (first, second, third);
 		case SHMCTL:
 			return sys_shmctl (first, second,
-					   (struct shmid_ds *) ptr);
+					   (struct shmid_ds __user *) ptr);
 		default:
 			return -EINVAL;
 		}
@@ -251,4 +251,16 @@
 	extern asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char * buf,
 					size_t count, loff_t pos);
 	return sys_pwrite64(fd, buf, count, pos);
+}
+
+asmlinkage int sys_fadvise64_64_wrapper(int fd, u32 offset0, u32 offset1,
+				u32 len0, u32 len1, int advice)
+{
+#ifdef  __LITTLE_ENDIAN__
+	return sys_fadvise64_64(fd, (u64)offset1 << 32 | offset0,
+				(u64)len1 << 32 | len0,	advice);
+#else
+	return sys_fadvise64_64(fd, (u64)offset0 << 32 | offset1,
+				(u64)len0 << 32 | len1,	advice);
+#endif
 }
diff -Nru a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c
--- a/arch/sh/kernel/time.c	Tue Feb  3 19:45:16 2004
+++ b/arch/sh/kernel/time.c	Tue Feb  3 19:45:16 2004
@@ -1,4 +1,4 @@
-/* $Id: time.c,v 1.12 2003/06/28 15:35:28 lethal Exp $
+/* $Id: time.c,v 1.18 2003/10/09 16:28:14 lethal Exp $
  *
  *  linux/arch/sh/kernel/time.c
  *
@@ -68,7 +68,7 @@
 #endif /* CONFIG_CPU_SH3 or CONFIG_CPU_SH4 */
 
 extern unsigned long wall_jiffies;
-#define TICK_SIZE (TICK_NSEC / 1000)
+#define TICK_SIZE (tick_nsec / 1000)
 spinlock_t tmu0_lock = SPIN_LOCK_UNLOCKED;
 
 u64 jiffies_64 = INITIAL_JIFFIES;
@@ -101,6 +101,14 @@
 #error "Unknown ifc/bfc/pfc/stc values for this processor"
 #endif
 
+/*
+ * Scheduler clock - returns current time in nanosec units.
+ */
+unsigned long long sched_clock(void)
+{
+	return (unsigned long long)jiffies * (1000000000 / HZ);
+}
+
 static unsigned long do_gettimeoffset(void)
 {
 	int count;
@@ -198,7 +206,7 @@
 	 * made, and then undo it!
 	 */
 	nsec -= 1000 * (do_gettimeoffset() +
-			(jiffies - wall_jiffies) * (1000000 / HZ));
+				(jiffies - wall_jiffies) * (1000000 / HZ));
 
 	wtm_sec  = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec);
 	wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec);
@@ -230,7 +238,8 @@
 
 static inline void sh_do_profile(unsigned long pc)
 {
-	if (!prof_buffer)
+	/* Don't profile cpu_idle.. */
+	if (!prof_buffer || !current->pid)
 		return;
 
 	if (pc >= 0xa0000000UL && pc < 0xc0000000UL)
@@ -365,6 +374,19 @@
 void (*board_time_init)(void) = 0;
 void (*board_timer_setup)(struct irqaction *irq) = 0;
 
+static unsigned int sh_pclk_freq __initdata = CONFIG_SH_PCLK_FREQ;
+
+static int __init sh_pclk_setup(char *str)
+{
+        unsigned int freq;
+
+	if (get_option(&str, &freq))
+		sh_pclk_freq = freq;
+
+	return 1;
+}
+__setup("sh_pclk=", sh_pclk_setup);
+
 static struct irqaction irq0  = { timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL};
 
 void get_current_frequency_divisors(unsigned int *ifc, unsigned int *bfc, unsigned int *pfc)
@@ -407,23 +429,46 @@
 
 void __init time_init(void)
 {
-	unsigned int timer_freq;
+	unsigned int timer_freq = 0;
 	unsigned int ifc, pfc, bfc;
 	unsigned long interval;
 
 	if (board_time_init)
 		board_time_init();
 
-	/* 
-	 * XXX: Hmm... when cpu/ is proposed, this looks like a good spot for
-	 * it, but we need a rtc to get the timer_freq so board_time_init()
-	 * must always come before a CPU time_(rtc?)_init().
-	 */
 	get_current_frequency_divisors(&ifc, &bfc, &pfc);
 
-	timer_freq = get_timer_frequency();
+	/*
+	 * If we don't have an RTC (such as with the SH7300), don't attempt to
+	 * probe the timer frequency. Rely on an either hardcoded peripheral
+	 * clock value, or on the sh_pclk command line option.
+	 */
+	current_cpu_data.module_clock = sh_pclk_freq;
 
-	current_cpu_data.module_clock = timer_freq * 4;
+	/* XXX: Switch this over to a more generic test. */
+	if (current_cpu_data.type != CPU_SH7300) {
+		unsigned int freq;
+
+		/* 
+		 * If we've specified a peripheral clock frequency, and we have
+		 * an RTC, compare it against the autodetected value. Complain
+		 * if there's a mismatch.
+		 *
+		 * Note: We should allow for some high and low watermarks for
+		 * the frequency here (compensating for potential drift), as
+		 * otherwise we'll likely end up triggering this essentially
+		 * on every boot.
+		 */
+		timer_freq = get_timer_frequency();
+		freq = timer_freq * 4;
+
+		if (sh_pclk_freq && sh_pclk_freq != freq) {
+			printk(KERN_NOTICE "Calculated peripheral clock value "
+			       "%d differs from sh_pclk value %d, fixing..\n",
+			       freq, sh_pclk_freq);
+			current_cpu_data.module_clock = freq;
+		}
+	}
 
 	rtc_get_time(&xtime);
 
diff -Nru a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c
--- a/arch/sh/kernel/traps.c	Tue Feb  3 19:45:16 2004
+++ b/arch/sh/kernel/traps.c	Tue Feb  3 19:45:16 2004
@@ -1,4 +1,4 @@
-/* $Id: traps.c,v 1.7 2003/05/04 19:29:53 lethal Exp $
+/* $Id: traps.c,v 1.14 2003/11/14 18:40:10 lethal Exp $
  *
  *  linux/arch/sh/traps.c
  *
@@ -26,12 +26,14 @@
 #include <linux/delay.h>
 #include <linux/spinlock.h>
 #include <linux/module.h>
+#include <linux/kallsyms.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/atomic.h>
 #include <asm/processor.h>
+#include <asm/sections.h>
 
 #ifdef CONFIG_SH_KGDB
 #include <asm/kgdb.h>
@@ -46,21 +48,36 @@
 #define CHK_REMOTE_DEBUG(regs)
 #endif
 
-#define DO_ERROR(trapnr, signr, str, name, tsk) \
-asmlinkage void do_##name(unsigned long r4, unsigned long r5, \
-			  unsigned long r6, unsigned long r7, \
-			  struct pt_regs regs) \
-{ \
-	unsigned long error_code; \
- \
-	asm volatile("stc	r2_bank, %0": "=r" (error_code)); \
-	local_irq_enable(); \
-	tsk->thread.error_code = error_code; \
-	tsk->thread.trap_no = trapnr; \
-        CHK_REMOTE_DEBUG(&regs); \
-	force_sig(signr, tsk); \
-	die_if_no_fixup(str,&regs,error_code); \
-}
+#define DO_ERROR(trapnr, signr, str, name, tsk)				\
+asmlinkage void do_##name(unsigned long r4, unsigned long r5,		\
+			  unsigned long r6, unsigned long r7,		\
+			  struct pt_regs regs)				\
+{									\
+	unsigned long error_code;					\
+ 									\
+	/* Check if it's a DSP instruction */				\
+ 	if (is_dsp_inst(&regs)) {					\
+		/* Enable DSP mode, and restart instruction. */		\
+		regs.sr |= SR_DSP;					\
+		return;							\
+	}								\
+									\
+	asm volatile("stc	r2_bank, %0": "=r" (error_code));	\
+	local_irq_enable();						\
+	tsk->thread.error_code = error_code;				\
+	tsk->thread.trap_no = trapnr;					\
+        CHK_REMOTE_DEBUG(&regs);					\
+	force_sig(signr, tsk);						\
+	die_if_no_fixup(str,&regs,error_code);				\
+}
+
+#ifdef CONFIG_CPU_SH2
+#define TRAP_RESERVED_INST	4
+#define TRAP_ILLEGAL_SLOT_INST	6
+#else
+#define TRAP_RESERVED_INST	12
+#define TRAP_ILLEGAL_SLOT_INST	13
+#endif
 
 /*
  * These constants are for searching for possible module text
@@ -530,8 +547,37 @@
 	}
 }
 
-DO_ERROR(12, SIGILL,  "reserved instruction", reserved_inst, current)
-DO_ERROR(13, SIGILL,  "illegal slot instruction", illegal_slot_inst, current)
+#ifdef CONFIG_SH_DSP
+/*
+ *	SH-DSP support gerg@snapgear.com.
+ */
+int is_dsp_inst(struct pt_regs *regs)
+{
+	unsigned short inst;
+
+	/* 
+	 * Safe guard if DSP mode is already enabled or we're lacking
+	 * the DSP altogether.
+	 */
+	if (!test_bit(CPU_HAS_DSP, &(cpu_data->flags)) || (regs->sr & SR_DSP))
+		return 0;
+
+	get_user(inst, ((unsigned short *) regs->pc));
+
+	inst &= 0xf000;
+
+	/* Check for any type of DSP or support instruction */
+	if ((inst == 0xf000) || (inst == 0x4000))
+		return 1;
+
+	return 0;
+}
+#else
+#define is_dsp_inst(regs)	(0)
+#endif /* CONFIG_SH_DSP */
+
+DO_ERROR(TRAP_RESERVED_INST, SIGILL, "reserved instruction", reserved_inst, current)
+DO_ERROR(TRAP_ILLEGAL_SLOT_INST, SIGILL, "illegal slot instruction", illegal_slot_inst, current)
 
 asmlinkage void do_exception_error(unsigned long r4, unsigned long r5,
 				   unsigned long r6, unsigned long r7,
@@ -547,18 +593,18 @@
 
 static inline void __init gdb_vbr_init(void)
 {
-    	/*
+	register unsigned long vbr;
+
+	/*
 	 * Read the old value of the VBR register to initialise
 	 * the vector through which debug and BIOS traps are
 	 * delegated by the Linux trap handler.
 	 */
-	{
-	    register unsigned long vbr;
-	    asm volatile("stc vbr, %0" : "=r" (vbr));
-	    gdb_vbr_vector = (void *)(vbr + 0x100);
-	    printk("Setting GDB trap vector to 0x%08lx\n",
-	    	(unsigned long)gdb_vbr_vector);
-	}
+	asm volatile("stc vbr, %0" : "=r" (vbr));
+
+	gdb_vbr_vector = (void *)(vbr + 0x100);
+	printk("Setting GDB trap vector to 0x%08lx\n",
+	       (unsigned long)gdb_vbr_vector);
 }
 #endif
 
@@ -582,11 +628,24 @@
 
 void __init trap_init(void)
 {
-	extern void *exception_handling_table[14];
-
-	exception_handling_table[12] = (void *)do_reserved_inst;
-	exception_handling_table[13] = (void *)do_illegal_slot_inst;
+	extern void *exception_handling_table[];
 
+	exception_handling_table[TRAP_RESERVED_INST]
+		= (void *)do_reserved_inst;
+	exception_handling_table[TRAP_ILLEGAL_SLOT_INST]
+		= (void *)do_illegal_slot_inst;
+
+#ifdef CONFIG_CPU_SH4
+	if (!test_bit(CPU_HAS_FPU, &(cpu_data->flags))) {
+		/* For SH-4 lacking an FPU, treat floating point instructions
+		   as reserved. */
+		/* entry 64 corresponds to EXPEVT=0x800 */
+		exception_handling_table[64] = (void *)do_reserved_inst;
+		exception_handling_table[65] = (void *)do_illegal_slot_inst;
+	}
+#endif
+		
+	/* Setup VBR for boot cpu */
 	per_cpu_trap_init();
 }
 
@@ -595,7 +654,6 @@
 	unsigned long *stack, addr;
 	unsigned long module_start = VMALLOC_START;
 	unsigned long module_end = VMALLOC_END;
-	extern long _text, _etext;
 	int i = 1;
 
 	if (!sp) {
@@ -612,19 +670,25 @@
 	stack = sp;
 
 	printk("\nCall trace: ");
+#ifdef CONFIG_KALLSYMS
+	printk("\n");
+#endif
 
-	while (((long)stack & (THREAD_SIZE - 1))) {
+	while (!kstack_end(stack)) {
 		addr = *stack++;
-		if (((addr >= (unsigned long)&_text) &&
-		     (addr <= (unsigned long)&_etext)) ||
+		if (((addr >= (unsigned long)_text) &&
+		     (addr <= (unsigned long)_etext)) ||
 		    ((addr >= module_start) && (addr <= module_end))) {
 			/*
 			 * For 80-columns display, 6 entry is maximum.
 			 * NOTE: '[<8c00abcd>] ' consumes 13 columns .
 			 */
+#ifndef CONFIG_KALLSYMS
 			if (i && ((i % 6) == 0))
 				printk("\n       ");
+#endif
 			printk("[<%08lx>] ", addr);
+			print_symbol("%s\n", addr);
 			i++;
 		}
 	}
diff -Nru a/arch/sh/lib/Makefile b/arch/sh/lib/Makefile
--- a/arch/sh/lib/Makefile	Tue Feb  3 19:45:18 2004
+++ b/arch/sh/lib/Makefile	Tue Feb  3 19:45:18 2004
@@ -3,4 +3,5 @@
 #
 
 lib-y  = delay.o memcpy.o memset.o memmove.o memchr.o \
-	 checksum.o strcasecmp.o strlen.o div64.o udivdi3.o
+	 checksum.o strcasecmp.o strlen.o div64.o udivdi3.o \
+	 div64-generic.o
diff -Nru a/arch/sh/lib/div64-generic.c b/arch/sh/lib/div64-generic.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/lib/div64-generic.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,19 @@
+/*
+ * Generic __div64_32 wrapper for __xdiv64_32.
+ */
+
+#include <linux/types.h>
+
+extern u64 __xdiv64_32(u64 n, u32 d);
+
+u64 __div64_32(u64 *xp, u32 y)
+{
+	u64 rem;
+	u64 q = __xdiv64_32(*xp, y);
+
+	rem = *xp - q * y;
+	*xp = q;
+
+	return rem;
+}
+
diff -Nru a/arch/sh/lib/div64.S b/arch/sh/lib/div64.S
--- a/arch/sh/lib/div64.S	Tue Feb  3 19:45:16 2004
+++ b/arch/sh/lib/div64.S	Tue Feb  3 19:45:16 2004
@@ -1,11 +1,11 @@
 /*	
- * unsigned long long __div64_32(unsigned long long n, unsigned long d); 
+ * unsigned long long __xdiv64_32(unsigned long long n, unsigned long d); 
  */
 
 #include <linux/linkage.h>
 
 .text
-ENTRY(__div64_32)
+ENTRY(__xdiv64_32)
 #ifdef  __LITTLE_ENDIAN__
 	mov	r4, r0
 	mov	r5, r1
diff -Nru a/arch/sh/lib/udivdi3.c b/arch/sh/lib/udivdi3.c
--- a/arch/sh/lib/udivdi3.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/lib/udivdi3.c	Tue Feb  3 19:45:17 2004
@@ -4,13 +4,13 @@
 
 #include <linux/types.h>
 
-extern u64 __div64_32(u64 n, u32 d);
+extern u64 __xdiv64_32(u64 n, u32 d);
 extern void panic(const char * fmt, ...);
 
 u64 __udivdi3(u64 n, u64 d)
 {
 	if (d & ~0xffffffff)
 		panic("Need true 64-bit/64-bit division");
-	return __div64_32(n, (u32)d);
+	return __xdiv64_32(n, (u32)d);
 }
 
diff -Nru a/arch/sh/mm/Makefile b/arch/sh/mm/Makefile
--- a/arch/sh/mm/Makefile	Tue Feb  3 19:45:42 2004
+++ b/arch/sh/mm/Makefile	Tue Feb  3 19:45:42 2004
@@ -2,14 +2,16 @@
 # Makefile for the Linux SuperH-specific parts of the memory manager.
 #
 
-obj-y			:= init.o extable.o clear_page.o copy_page.o
+obj-y			:= init.o extable.o
 
 obj-$(CONFIG_CPU_SH2)	+= cache-sh2.o
-obj-$(CONFIG_CPU_SH3) += cache-sh3.o
+obj-$(CONFIG_CPU_SH3)	+= cache-sh3.o
 obj-$(CONFIG_CPU_SH4)	+= cache-sh4.o pg-sh4.o
 
-mmu-y			:= fault-nommu.o tlb-nommu.o
-mmu-$(CONFIG_MMU)	:= fault.o
+obj-$(CONFIG_DMA_PAGE_OPS)	+= pg-dma.o
+
+mmu-y			:= fault-nommu.o tlb-nommu.o pg-nommu.o
+mmu-$(CONFIG_MMU)	:= fault.o clear_page.o copy_page.o
 
 obj-y			+= $(mmu-y)
 
diff -Nru a/arch/sh/mm/__clear_user_page-sh4.S b/arch/sh/mm/__clear_user_page-sh4.S
--- a/arch/sh/mm/__clear_user_page-sh4.S	Tue Feb  3 19:45:30 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,49 +0,0 @@
-/* $Id$
- *
- * __clear_user_page implementation of SuperH
- *
- * Copyright (C) 2001  Niibe Yutaka & Kaz Kojima
- *
- */
-
-/*
- * __clear_user_page
- * @to: P1 address (with same color)
- * @orig_to: P1 address
- *
- * void __clear_user_page(void *to, void *orig_to)
- */
-
-/*
- * r0 --- scratch 
- * r4 --- to
- * r5 --- orig_to
- * r6 --- to + 4096
- */
-#include <linux/linkage.h>
-ENTRY(__clear_user_page)
-	mov	r4,r6
-	mov.w	.L4096,r0
-	add	r0,r6
-	mov	#0,r0
-	!
-1:	ocbi	@r5
-	add	#32,r5
-	movca.l	r0,@r4
-	mov	r4,r1
-	add	#32,r4
-	mov.l	r0,@-r4
-	mov.l	r0,@-r4
-	mov.l	r0,@-r4
-	mov.l	r0,@-r4
-	mov.l	r0,@-r4
-	mov.l	r0,@-r4
-	mov.l	r0,@-r4
-	add	#28,r4
-	cmp/eq	r6,r4
-	bf/s	1b
-	 ocbwb	@r1
-	!
-	rts
-	 nop
-.L4096:	.word	4096
diff -Nru a/arch/sh/mm/__copy_user_page-sh4.S b/arch/sh/mm/__copy_user_page-sh4.S
--- a/arch/sh/mm/__copy_user_page-sh4.S	Tue Feb  3 19:45:16 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,69 +0,0 @@
-/* $Id: __copy_user_page-sh4.S,v 1.1 2001/07/23 09:02:17 gniibe Exp $
- *
- * __copy_user_page implementation of SuperH
- *
- * Copyright (C) 2001  Niibe Yutaka & Kaz Kojima
- *
- */
-
-/*
- * __copy_user_page
- * @to: P1 address (with same color)
- * @from: P1 address
- * @orig_to: P1 address
- *
- * void __copy_user_page(void *to, void *from, void *orig_to)
- */
-
-/*
- * r0, r1, r2, r3, r4, r5, r6, r7 --- scratch 
- * r8 --- from + 4096
- * r9 --- orig_to
- * r10 --- to
- * r11 --- from
- */
-#include <linux/linkage.h>
-ENTRY(__copy_user_page)
-	mov.l	r8,@-r15
-	mov.l	r9,@-r15
-	mov.l	r10,@-r15
-	mov.l	r11,@-r15
-	mov	r4,r10
-	mov	r5,r11
-	mov	r6,r9
-	mov	r5,r8
-	mov.w	.L4096,r0
-	add	r0,r8
-	!
-1:	ocbi	@r9
-	add	#32,r9
-	mov.l	@r11+,r0
-	mov.l	@r11+,r1
-	mov.l	@r11+,r2
-	mov.l	@r11+,r3
-	mov.l	@r11+,r4
-	mov.l	@r11+,r5
-	mov.l	@r11+,r6
-	mov.l	@r11+,r7
-	movca.l	r0,@r10
-	mov	r10,r0
-	add	#32,r10
-	mov.l	r7,@-r10
-	mov.l	r6,@-r10
-	mov.l	r5,@-r10
-	mov.l	r4,@-r10
-	mov.l	r3,@-r10
-	mov.l	r2,@-r10
-	mov.l	r1,@-r10
-	ocbwb	@r0
-	cmp/eq	r11,r8
-	bf/s	1b
-	 add	#28,r10
-	!
-	mov.l	@r15+,r11
-	mov.l	@r15+,r10
-	mov.l	@r15+,r9
-	mov.l	@r15+,r8
-	rts
-	 nop
-.L4096:	.word	4096
diff -Nru a/arch/sh/mm/cache-sh3.c b/arch/sh/mm/cache-sh3.c
--- a/arch/sh/mm/cache-sh3.c	Tue Feb  3 19:45:16 2004
+++ b/arch/sh/mm/cache-sh3.c	Tue Feb  3 19:45:16 2004
@@ -1,4 +1,4 @@
-/* $Id: cache-sh3.c,v 1.5 2003/05/06 23:28:48 lethal Exp $
+/* $Id: cache-sh3.c,v 1.7 2003/08/28 16:16:09 lethal Exp $
  *
  *  linux/arch/sh/mm/cache-sh3.c
  *
@@ -70,6 +70,8 @@
 		cpu_data->dcache.entry_mask	= 0x7f0;
 		cpu_data->dcache.sets		= 128;
 		cpu_data->type = CPU_SH7708;
+
+		set_bit(CPU_HAS_MMU_PAGE_ASSOC, &(cpu_data->flags));
 	} else {				/* 7709A or 7729  */
 		cpu_data->dcache.way_shift	= 12;
 		cpu_data->dcache.entry_mask	= 0xff0;
@@ -77,9 +79,9 @@
 		cpu_data->type = CPU_SH7729;
 	}
 
-		/*
+	/*
 	 * SH-3 doesn't have separate caches
-		 */
+	 */
 	cpu_data->dcache.flags |= SH_CACHE_COMBINED;
 	cpu_data->icache = cpu_data->dcache;
 
diff -Nru a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c
--- a/arch/sh/mm/cache-sh4.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/mm/cache-sh4.c	Tue Feb  3 19:45:17 2004
@@ -1,4 +1,4 @@
-/* $Id: cache-sh4.c,v 1.20 2003/05/10 03:22:05 sugioka Exp $
+/* $Id: cache-sh4.c,v 1.24 2003/10/12 19:40:12 lethal Exp $
  *
  *  linux/arch/sh/mm/cache-sh4.c
  *
@@ -26,10 +26,7 @@
 static void __flush_cache_4096_all_ex(unsigned long start);
 extern void __flush_dcache_all(void);
 static void __flush_dcache_all_ex(void);
-/*
- * FIXME: Add ST40STB1 probe support (and clean up the manual overdrive stuff)
- * seems to rely on some quirky PVR shifting .. stuart? ++paulm
- */
+
 int __init detect_cpu_and_cache_system(void)
 {
 	unsigned long pvr, prr, ccr;
@@ -37,9 +34,9 @@
 	pvr = (ctrl_inl(CCN_PVR) >> 8) & 0xffff;
 	prr = (ctrl_inl(CCN_PRR) >> 4) & 0xff;
 
-		/*
+	/*
 	 * Setup some sane SH-4 defaults for the icache
-		 */
+	 */
 	cpu_data->icache.way_shift	= 13;
 	cpu_data->icache.entry_shift	= 5;
 	cpu_data->icache.entry_mask	= 0x1fe0;
@@ -64,9 +61,17 @@
 	switch (pvr) {
 	case 0x205:
 		cpu_data->type = CPU_SH7750;
+		set_bit(CPU_HAS_P2_FLUSH_BUG, &(cpu_data->flags));
 		break;
 	case 0x206:
 		cpu_data->type = CPU_SH7750S;
+
+		/* 
+		 * FIXME: This is needed for 7750, but do we need it for the
+		 * 7750S and 7750R too? For now, assume we do.. -- PFM
+		 */
+		set_bit(CPU_HAS_P2_FLUSH_BUG, &(cpu_data->flags));
+
 		break;
 	case 0x1100:
 		cpu_data->type = CPU_SH7751;
@@ -77,28 +82,46 @@
 	case 0x8100:
 		cpu_data->type = CPU_ST40GX1;
 		break;
-	case 0x500:
-		if (prr == 0x10)
-			cpu_data->type = CPU_SH7750R;
-		else
-			cpu_data->type = CPU_SH7751R;
+	case 0x700:
+		/* XXX: Add proper CVR probing */
+		cpu_data->type = CPU_SH4_501;
+		break;
+	case 0x600:
+		cpu_data->type = CPU_SH4_202;
+		/* fall */
+	case 0x500 ... 0x501:
+		switch (prr) {
+		    case 0x10: cpu_data->type = CPU_SH7750R; break;
+		    case 0x11: cpu_data->type = CPU_SH7751R; break;
+		    case 0x50: cpu_data->type = CPU_SH7760;  break;
+		}
+
+		if (cpu_data->type == CPU_SH7750R)
+			set_bit(CPU_HAS_P2_FLUSH_BUG, &(cpu_data->flags));
+
 		jump_to_P2();
 		ccr = ctrl_inl(CCR);
-		back_to_P1();
-		if(ccr & CCR_CACHE_EMODE) {
-			cpu_data->icache.ways = 2;
-			cpu_data->dcache.ways = 2;
+
+		/* Force EMODE */
+		if (!(ccr & CCR_CACHE_EMODE)) {
+			ccr |= CCR_CACHE_EMODE;
+			ctrl_outl(ccr, CCR);
 		}
+
+		back_to_P1();
+
+		cpu_data->icache.ways = 2;
+		cpu_data->dcache.ways = 2;
+
 		break;
 	default:
 		cpu_data->type = CPU_SH_NONE;
 		break;
 	}
 
-	/*
-	 * For now, all SH-4's have an FPU ..
-	 */
-	cpu_data->flags |= CPU_HAS_FPU;
+	/* No FPU on the SH4-500 series.. */
+	if (cpu_data->type != CPU_SH4_501)
+		set_bit(CPU_HAS_FPU, &(cpu_data->flags));
 
 	return 0;
 }
@@ -257,20 +280,16 @@
 	unsigned long flags; 
 	extern void __flush_cache_4096(unsigned long addr, unsigned long phys, unsigned long exec_offset);
 
-		/*
+	/*
 	 * SH7751, SH7751R, and ST40 have no restriction to handle cache.
-		 * (While SH7750 must do that at P2 area.)
-		 */
-	if ((cpu_data->type == CPU_SH7751 ||
-	     cpu_data->type == CPU_SH7751R ||
-	     cpu_data->type == CPU_ST40RA ||
-	     cpu_data->type == CPU_ST40GX1) &&
-		(start >= CACHE_OC_ADDRESS_ARRAY)) {
-		__flush_cache_4096(start | SH_CACHE_ASSOC, phys | 0x80000000, 0);
-	} else {
+	 * (While SH7750 must do that at P2 area.)
+	 */
+	if (test_bit(CPU_HAS_P2_FLUSH_BUG, &(cpu_data->flags))) {
 		local_irq_save(flags);
 		__flush_cache_4096(start | SH_CACHE_ASSOC, phys | 0x80000000, 0x20000000);
 		local_irq_restore(flags);
+	} else if (start >= CACHE_OC_ADDRESS_ARRAY) {
+		__flush_cache_4096(start | SH_CACHE_ASSOC, phys | 0x80000000, 0);
 	}
 }
 
diff -Nru a/arch/sh/mm/clear_page.S b/arch/sh/mm/clear_page.S
--- a/arch/sh/mm/clear_page.S	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/mm/clear_page.S	Tue Feb  3 19:45:17 2004
@@ -1,4 +1,4 @@
-/* $Id: clear_page.S,v 1.12 2003/05/10 03:22:05 sugioka Exp $
+/* $Id: clear_page.S,v 1.13 2003/08/25 17:03:10 lethal Exp $
  *
  * __clear_user_page, __clear_user, clear_page implementation of SuperH
  *
@@ -10,10 +10,10 @@
 #include <linux/linkage.h>
 
 /*
- * clear_page
+ * clear_page_slow
  * @to: P1 address
  *
- * void clear_page(void *to)
+ * void clear_page_slow(void *to)
  */
 
 /*
@@ -21,7 +21,7 @@
  * r4 --- to
  * r5 --- to + 4096
  */
-ENTRY(clear_page)
+ENTRY(clear_page_slow)
 	mov	r4,r5
 	mov.w	.Llimit,r0
 	add	r0,r5
diff -Nru a/arch/sh/mm/copy_page.S b/arch/sh/mm/copy_page.S
--- a/arch/sh/mm/copy_page.S	Tue Feb  3 19:45:16 2004
+++ b/arch/sh/mm/copy_page.S	Tue Feb  3 19:45:16 2004
@@ -1,4 +1,4 @@
-/* $Id: copy_page.S,v 1.7 2003/05/04 19:29:54 lethal Exp $
+/* $Id: copy_page.S,v 1.8 2003/08/25 17:03:10 lethal Exp $
  *
  * copy_page, __copy_user_page, __copy_user implementation of SuperH
  *
@@ -9,11 +9,11 @@
 #include <linux/linkage.h>
 
 /*
- * copy_page
+ * copy_page_slow
  * @to: P1 address
  * @from: P1 address
  *
- * void copy_page(void *to, void *from)
+ * void copy_page_slow(void *to, void *from)
  */
 
 /*
@@ -23,7 +23,7 @@
  * r10 --- to
  * r11 --- from
  */
-ENTRY(copy_page)
+ENTRY(copy_page_slow)
 	mov.l	r8,@-r15
 	mov.l	r10,@-r15
 	mov.l	r11,@-r15
diff -Nru a/arch/sh/mm/extable.c b/arch/sh/mm/extable.c
--- a/arch/sh/mm/extable.c	Tue Feb  3 19:45:16 2004
+++ b/arch/sh/mm/extable.c	Tue Feb  3 19:45:16 2004
@@ -9,29 +9,6 @@
 #include <linux/module.h>
 #include <asm/uaccess.h>
 
-/* Simple binary search */
-const struct exception_table_entry *
-search_extable(const struct exception_table_entry *first,
-		 const struct exception_table_entry *last,
-		 unsigned long value)
-{
-        while (first <= last) {
-		const struct exception_table_entry *mid;
-		long diff;
-
-		mid = (last - first) / 2 + first;
-		diff = mid->insn - value;
-                if (diff == 0)
-                        return mid;
-                else if (diff < 0)
-                        first = mid+1;
-                else
-                        last = mid-1;
-        }
-
-        return NULL;
-}
-
 int fixup_exception(struct pt_regs *regs)
 {
 	const struct exception_table_entry *fixup;
diff -Nru a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c
--- a/arch/sh/mm/fault.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/mm/fault.c	Tue Feb  3 19:45:17 2004
@@ -1,7 +1,8 @@
-/* $Id: fault.c,v 1.10 2003/05/04 19:29:54 lethal Exp $
+/* $Id: fault.c,v 1.13 2003/08/11 11:44:50 lethal Exp $
  *
  *  linux/arch/sh/mm/fault.c
  *  Copyright (C) 1999  Niibe Yutaka
+ *  Copyright (C) 2003  Paul Mundt
  *
  *  Based on linux/arch/i386/mm/fault.c:
  *   Copyright (C) 1995  Linus Torvalds
@@ -28,10 +29,7 @@
 #include <asm/hardirq.h>
 #include <asm/mmu_context.h>
 #include <asm/cacheflush.h>
-
-#if defined(CONFIG_SH_KGDB)
 #include <asm/kgdb.h>
-#endif
 
 extern void die(const char *,struct pt_regs *,long);
 
@@ -47,11 +45,10 @@
 	struct mm_struct *mm;
 	struct vm_area_struct * vma;
 	unsigned long page;
-	const struct exception_table_entry *fixup;
 
-#if defined(CONFIG_SH_KGDB)
+#ifdef CONFIG_SH_KGDB
 	if (kgdb_nofault && kgdb_bus_err_hook)
-	  kgdb_bus_err_hook();
+		kgdb_bus_err_hook();
 #endif
 
 	tsk = current;
@@ -61,7 +58,7 @@
 	 * If we're in an interrupt or have no user
 	 * context, we must not take the fault..
 	 */
-	if (in_interrupt() || !mm)
+	if (in_atomic() || !mm)
 		goto no_context;
 
 	down_read(&mm->mmap_sem);
@@ -95,16 +92,18 @@
 	 */
 survive:
 	switch (handle_mm_fault(mm, vma, address, writeaccess)) {
-	case 1:
-		tsk->min_flt++;
-		break;
-	case 2:
-		tsk->maj_flt++;
-		break;
-	case 0:
-		goto do_sigbus;
-	default:
-		goto out_of_memory;
+		case VM_FAULT_MINOR:
+			tsk->min_flt++;
+			break;
+		case VM_FAULT_MAJOR:
+			tsk->maj_flt++;
+			break;
+		case VM_FAULT_SIGBUS:
+			goto do_sigbus;
+		case VM_FAULT_OOM:
+			goto out_of_memory;
+		default:
+			BUG();
 	}
 
 	up_read(&mm->mmap_sem);
@@ -126,11 +125,8 @@
 
 no_context:
 	/* Are we prepared to handle this kernel fault?  */
-	fixup = search_exception_tables(regs->pc);
-	if (fixup) {
-		regs->pc = fixup->fixup;
+	if (fixup_exception(regs))
 		return;
-	}
 
 /*
  * Oops. The kernel tried to access some bad page. We'll have to
@@ -198,16 +194,22 @@
 asmlinkage int __do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
 			       unsigned long address)
 {
+	unsigned long addrmax = P4SEG;
 	pgd_t *dir;
 	pmd_t *pmd;
 	pte_t *pte;
 	pte_t entry;
 
-#if defined(CONFIG_SH_KGDB)
+#ifdef CONFIG_SH_KGDB
 	if (kgdb_nofault && kgdb_bus_err_hook)
-	  kgdb_bus_err_hook();
+		kgdb_bus_err_hook();
+#endif
+
+#ifdef CONFIG_SH_STORE_QUEUES
+	addrmax = P4SEG_STORE_QUE + 0x04000000;
 #endif
-	if (address >= P3SEG && address < P4SEG)
+
+	if (address >= P3SEG && address < addrmax)
 		dir = pgd_offset_k(address);
 	else if (address >= TASK_SIZE)
 		return 1;
@@ -233,15 +235,19 @@
 	if (writeaccess)
 		entry = pte_mkdirty(entry);
 	entry = pte_mkyoung(entry);
-#if defined(CONFIG_CPU_SH4)
+
+#ifdef CONFIG_CPU_SH4
 	/*
 	 * ITLB is not affected by "ldtlb" instruction.
 	 * So, we need to flush the entry by ourselves.
 	 */
+
 	__flush_tlb_page(get_asid(), address&PAGE_MASK);
 #endif
+
 	set_pte(pte, entry);
 	update_mmu_cache(NULL, address, entry);
+
 	return 0;
 }
 
diff -Nru a/arch/sh/mm/init.c b/arch/sh/mm/init.c
--- a/arch/sh/mm/init.c	Tue Feb  3 19:45:41 2004
+++ b/arch/sh/mm/init.c	Tue Feb  3 19:45:41 2004
@@ -1,4 +1,4 @@
-/* $Id: init.c,v 1.11 2003/05/27 16:21:23 lethal Exp $
+/* $Id: init.c,v 1.18 2003/10/31 09:26:59 kkojima Exp $
  *
  *  linux/arch/sh/mm/init.c
  *
@@ -24,6 +24,7 @@
 #include <linux/init.h>
 #include <linux/highmem.h>
 #include <linux/bootmem.h>
+#include <linux/pagemap.h>
 
 #include <asm/processor.h>
 #include <asm/system.h>
@@ -55,6 +56,9 @@
 bootmem_data_t discontig_node_bdata[MAX_NUMNODES];
 #endif
 
+void (*copy_page)(void *from, void *to);
+void (*clear_page)(void *to);
+
 void show_mem(void)
 {
 	int i, total = 0, reserved = 0;
@@ -112,13 +116,13 @@
 	{
 		unsigned long max_dma, low, start_pfn;
 		pgd_t *pg_dir;
-	int i;
+		int i;
 
-	/* We don't need kernel mapping as hardware support that. */
-	pg_dir = swapper_pg_dir;
+		/* We don't need kernel mapping as hardware support that. */
+		pg_dir = swapper_pg_dir;
 
 		for (i = 0; i < PTRS_PER_PGD; i++)
-		pgd_val(pg_dir[i]) = 0;
+			pgd_val(pg_dir[i]) = 0;
 
 		/* Turn on the MMU */
 		enable_mmu();
@@ -130,11 +134,13 @@
 
 		if (low < max_dma) {
 			zones_size[ZONE_DMA] = low - start_pfn;
+			zones_size[ZONE_NORMAL] = 0;
 		} else {
 			zones_size[ZONE_DMA] = max_dma - start_pfn;
 			zones_size[ZONE_NORMAL] = low - max_dma;
 		}
 	}
+
 #elif defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4)
 	/*
 	 * If we don't have CONFIG_MMU set and the processor in question
@@ -149,17 +155,17 @@
 	disable_mmu();
 #endif
 
-		free_area_init_node(0, NODE_DATA(0), 0, zones_size, __MEMORY_START >> PAGE_SHIFT, 0);
+	free_area_init_node(0, NODE_DATA(0), 0, zones_size, __MEMORY_START >> PAGE_SHIFT, 0);
 	/* XXX: MRB-remove - this doesn't seem sane, should this be done somewhere else ?*/
-		mem_map = NODE_DATA(0)->node_mem_map;
+	mem_map = NODE_DATA(0)->node_mem_map;
 
 #ifdef CONFIG_DISCONTIGMEM
 	/*
 	 * And for discontig, do some more fixups on the zone sizes..
 	 */
-		zones_size[ZONE_DMA] = __MEMORY_SIZE_2ND >> PAGE_SHIFT;
-		zones_size[ZONE_NORMAL] = 0;
-		free_area_init_node(1, NODE_DATA(1), 0, zones_size, __MEMORY_START_2ND >> PAGE_SHIFT, 0);
+	zones_size[ZONE_DMA] = __MEMORY_SIZE_2ND >> PAGE_SHIFT;
+	zones_size[ZONE_NORMAL] = 0;
+	free_area_init_node(1, NODE_DATA(1), 0, zones_size, __MEMORY_START_2ND >> PAGE_SHIFT, 0);
 #endif
 }
 
@@ -183,6 +189,13 @@
 	memset(empty_zero_page, 0, PAGE_SIZE);
 	__flush_wback_region(empty_zero_page, PAGE_SIZE);
 
+	/* 
+	 * Setup wrappers for copy/clear_page(), these will get overridden
+	 * later in the boot process if a better method is available.
+	 */
+	copy_page = copy_page_slow;
+	clear_page = clear_page_slow;
+
 	/* this will put all low memory onto the freelists */
 	totalram_pages += free_all_bootmem_node(NODE_DATA(0));
 #ifdef CONFIG_DISCONTIGMEM
@@ -195,6 +208,7 @@
 		 */
 		if (PageReserved(mem_map+tmp))
 			reservedpages++;
+
 	codesize =  (unsigned long) &_etext - (unsigned long) &_text;
 	datasize =  (unsigned long) &_edata - (unsigned long) &_etext;
 	initsize =  (unsigned long) &__init_end - (unsigned long) &__init_begin;
@@ -237,76 +251,4 @@
 	printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
 }
 #endif
-
-/*
- * Generic first-level cache init
- */
-void __init sh_cache_init(void)
-{
-	extern int detect_cpu_and_cache_system(void);
-	unsigned long ccr, flags = 0;
-
-	detect_cpu_and_cache_system();
-
-	if (cpu_data->type == CPU_SH_NONE)
-		panic("Unknown CPU");
-
-	jump_to_P2();
-	ccr = ctrl_inl(CCR);
-
-	/*
-	 * If the cache is already enabled .. flush it.
-	 */
-	if (ccr & CCR_CACHE_ENABLE) {
-		unsigned long entries, i, j;
-
-		entries = cpu_data->dcache.sets;
-
-		/*
-		 * If the OC is already in RAM mode, we only have
-		 * half of the entries to flush..
-		 */
-		if (ccr & CCR_CACHE_ORA)
-			entries >>= 1;
-
-		for (i = 0; i < entries; i++) {
-			for (j = 0; j < cpu_data->dcache.ways; j++) {
-				unsigned long data, addr;
-
-				addr = CACHE_OC_ADDRESS_ARRAY |
-					(j << cpu_data->dcache.way_shift) |
-					(i << cpu_data->dcache.entry_shift);
-
-				data = ctrl_inl(addr);
-
-				if ((data & (SH_CACHE_UPDATED | SH_CACHE_VALID))
-					== (SH_CACHE_UPDATED | SH_CACHE_VALID))
-					ctrl_outl(data & ~SH_CACHE_UPDATED, addr);
-		}
-		}
-	}
-
-	/* 
-	 * Default CCR values .. enable the caches
-	 * and flush them immediately..
-	 */
-	flags |= CCR_CACHE_ENABLE | CCR_CACHE_INVALIDATE | (ccr & CCR_CACHE_EMODE);
-
-#ifdef CONFIG_SH_WRITETHROUGH
-	/* Turn on Write-through caching */
-	flags |= CCR_CACHE_WT;
-#else
-	/* .. or default to Write-back */
-	flags |= CCR_CACHE_CB;
-#endif
-
-#ifdef CONFIG_SH_OCRAM
-	/* Turn on OCRAM -- halve the OC */
-	flags |= CCR_CACHE_ORA;
-	cpu_data->dcache.sets >>= 1;
-#endif
-
-	ctrl_outl(flags, CCR);
-	back_to_P1();
-}
 
diff -Nru a/arch/sh/mm/ioremap.c b/arch/sh/mm/ioremap.c
--- a/arch/sh/mm/ioremap.c	Tue Feb  3 19:45:30 2004
+++ b/arch/sh/mm/ioremap.c	Tue Feb  3 19:45:30 2004
@@ -1,4 +1,4 @@
-/* $Id: ioremap.c,v 1.6 2003/05/04 19:29:55 lethal Exp $
+/* $Id: ioremap.c,v 1.8 2003/10/09 15:25:42 lethal Exp $
  *
  * arch/sh/mm/ioremap.c
  *
@@ -140,7 +140,7 @@
 	 */
 	offset = phys_addr & ~PAGE_MASK;
 	phys_addr &= PAGE_MASK;
-	size = PAGE_ALIGN(last_addr) - phys_addr;
+	size = PAGE_ALIGN(last_addr+1) - phys_addr;
 
 	/*
 	 * Ok, go for it..
@@ -148,9 +148,10 @@
 	area = get_vm_area(size, VM_IOREMAP);
 	if (!area)
 		return NULL;
+	area->phys_addr = phys_addr;
 	addr = area->addr;
 	if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) {
-		vfree(addr);
+		vunmap(addr);
 		return NULL;
 	}
 	return (void *) (offset + (char *)addr);
diff -Nru a/arch/sh/mm/pg-dma.c b/arch/sh/mm/pg-dma.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/mm/pg-dma.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,97 @@
+/*
+ * arch/sh/mm/pg-dma.c
+ *
+ * Fast clear_page()/copy_page() implementation using the SH DMAC
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <asm/semaphore.h>
+#include <asm/mmu_context.h>
+#include <asm/addrspace.h>
+#include <asm/atomic.h>
+#include <asm/page.h>
+#include <asm/dma.h>
+#include <asm/io.h>
+
+/* Channel to use for page ops, must be dual-address mode capable. */
+static int dma_channel = 3;
+
+static void copy_page_dma(void *to, void *from)
+{
+	/* 
+	 * This doesn't seem to get triggered until further along in the
+	 * boot process, at which point the DMAC is already initialized.
+	 * Fix this in the same fashion as clear_page_dma() in the event
+	 * that this crashes due to the DMAC not being initialized.
+	 */
+
+	flush_icache_range((unsigned long)from, PAGE_SIZE);
+	dma_write_page(dma_channel, (unsigned long)from, (unsigned long)to);
+	dma_wait_for_completion(dma_channel);
+}
+
+static void clear_page_dma(void *to)
+{
+	extern unsigned long empty_zero_page[1024];
+
+	/*
+	 * We get invoked quite early on, if the DMAC hasn't been initialized
+	 * yet, fall back on the slow manual implementation.
+	 */
+	if (dma_info[dma_channel].chan != dma_channel) {
+		clear_page_slow(to);
+		return;
+	}
+
+	dma_write_page(dma_channel, (unsigned long)empty_zero_page,
+				    (unsigned long)to);
+
+	/*
+	 * FIXME: Something is a bit racy here, if we poll the counter right
+	 * away, we seem to lock. flushing the page from the dcache doesn't
+	 * seem to make a difference one way or the other, though either a full
+	 * icache or dcache flush does.
+	 *
+	 * The location of this is important as well, and must happen prior to
+	 * the completion loop but after the transfer was initiated.
+	 *
+	 * Oddly enough, this doesn't appear to be an issue for copy_page()..
+	 */
+	flush_icache_range((unsigned long)to, PAGE_SIZE);
+
+	dma_wait_for_completion(dma_channel);
+}
+
+static int __init pg_dma_init(void)
+{
+	int ret;
+	
+	ret = request_dma(dma_channel, "page ops");
+	if (ret != 0)
+		return ret;
+
+	copy_page = copy_page_dma;
+	clear_page = clear_page_dma;
+
+	return ret;
+}
+
+static void __exit pg_dma_exit(void)
+{
+	free_dma(dma_channel);
+}
+
+module_init(pg_dma_init);
+module_exit(pg_dma_exit);
+
+MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>");
+MODULE_DESCRIPTION("Optimized page copy/clear routines using a dual-address mode capable DMAC channel");
+MODULE_LICENSE("GPL");
+
diff -Nru a/arch/sh/mm/pg-nommu.c b/arch/sh/mm/pg-nommu.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/mm/pg-nommu.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,36 @@
+/*
+ * arch/sh/mm/pg-nommu.c
+ *
+ * clear_page()/copy_page() implementation for MMUless SH.
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <asm/page.h>
+
+static void copy_page_nommu(void *to, void *from)
+{
+	memcpy(to, from, PAGE_SIZE);
+}
+
+static void clear_page_nommu(void *to)
+{
+	memset(to, 0, PAGE_SIZE);
+}
+
+static int __init pg_nommu_init(void)
+{
+	copy_page = copy_page_nommu;
+	clear_page = clear_page_nommu;
+
+	return 0;
+}
+
+subsys_initcall(pg_nommu_init);
+
diff -Nru a/arch/sh/mm/tlb-sh3.c b/arch/sh/mm/tlb-sh3.c
--- a/arch/sh/mm/tlb-sh3.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sh/mm/tlb-sh3.c	Tue Feb  3 19:45:17 2004
@@ -61,6 +61,7 @@
 void __flush_tlb_page(unsigned long asid, unsigned long page)
 {
 	unsigned long addr, data;
+	int i, ways = MMU_NTLB_WAYS;
 
 	/*
 	 * NOTE: PTEH.ASID should be set to this MM
@@ -68,8 +69,15 @@
 	 *
 	 * It would be simple if we didn't need to set PTEH.ASID...
 	 */
-	addr = MMU_TLB_ADDRESS_ARRAY |(page & 0x1F000)| MMU_PAGE_ASSOC_BIT;
+	addr = MMU_TLB_ADDRESS_ARRAY | (page & 0x1F000);
 	data = (page & 0xfffe0000) | asid; /* VALID bit is off */
-	ctrl_outl(data, addr);
+	
+	if (test_bit(CPU_HAS_MMU_PAGE_ASSOC, &(cpu_data->flags))) {
+		addr |= MMU_PAGE_ASSOC_BIT;
+		ways = 1;	/* we already know the way .. */
+	}
+
+	for (i = 0; i < ways; i++)
+		ctrl_outl(data, addr + (i << 8));
 }
 
diff -Nru a/arch/sh/oprofile/Kconfig b/arch/sh/oprofile/Kconfig
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/oprofile/Kconfig	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,23 @@
+
+menu "Profiling support"
+	depends on EXPERIMENTAL
+
+config PROFILING
+	bool "Profiling support (EXPERIMENTAL)"
+	help
+	  Say Y here to enable the extended profiling support mechanisms used
+	  by profilers such as OProfile.
+	  
+
+config OPROFILE
+	tristate "OProfile system profiling (EXPERIMENTAL)"
+	depends on PROFILING
+	help
+	  OProfile is a profiling system capable of profiling the
+	  whole system, include the kernel, kernel modules, libraries,
+	  and applications.
+
+	  If unsure, say N.
+
+endmenu
+
diff -Nru a/arch/sh/oprofile/Makefile b/arch/sh/oprofile/Makefile
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/oprofile/Makefile	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,13 @@
+obj-$(CONFIG_OPROFILE) += oprofile.o
+
+DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
+		oprof.o cpu_buffer.o buffer_sync.o \
+		event_buffer.o oprofile_files.o \
+		oprofilefs.o oprofile_stats.o \
+		timer_int.o )
+
+profdrvr-y				:= op_model_null.o
+profdrvr-$(CONFIG_SH_DREAMCAST)		:= op_model_dreamcast.o
+
+oprofile-y				:= $(DRIVER_OBJS) $(profdrvr-y)
+
diff -Nru a/arch/sh/oprofile/op_model_null.c b/arch/sh/oprofile/op_model_null.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/sh/oprofile/op_model_null.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,23 @@
+/*
+ * arch/sh/oprofile/op_model_null.c
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */
+#include <linux/kernel.h>
+#include <linux/oprofile.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+
+int __init oprofile_arch_init(struct oprofile_operations **ops)
+{
+	return -ENODEV;
+}
+
+void oprofile_arch_exit(void)
+{
+}
+
diff -Nru a/arch/sh/tools/mach-types b/arch/sh/tools/mach-types
--- a/arch/sh/tools/mach-types	Tue Feb  3 19:45:43 2004
+++ b/arch/sh/tools/mach-types	Tue Feb  3 19:45:43 2004
@@ -7,6 +7,7 @@
 #
 SE			SH_SOLUTION_ENGINE
 7751SE			SH_7751_SOLUTION_ENGINE		
+7751SYSTEMH		SH_7751_SYSTEMH
 HP600			SH_HP600
 HP620			SH_HP620
 HP680			SH_HP680
@@ -19,4 +20,5 @@
 BIGSUR			SH_BIGSUR
 ADX			SH_ADX
 MPC1211			SH_MPC1211
+SNAPGEAR		SH_SECUREEDGE5410
 
diff -Nru a/arch/sparc/Kconfig b/arch/sparc/Kconfig
--- a/arch/sparc/Kconfig	Tue Feb  3 19:45:16 2004
+++ b/arch/sparc/Kconfig	Tue Feb  3 19:45:16 2004
@@ -112,6 +112,7 @@
 
 config NR_CPUS
 	int "Maximum number of CPUs (2-32)"
+	range 2 32
 	depends on SMP
 	default "32"
 
diff -Nru a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c
--- a/arch/sparc/kernel/irq.c	Tue Feb  3 19:45:16 2004
+++ b/arch/sparc/kernel/irq.c	Tue Feb  3 19:45:16 2004
@@ -49,6 +49,9 @@
 #include <asm/pcic.h>
 #include <asm/cacheflush.h>
 
+/* Used to protect the IRQ action lists */
+spinlock_t irq_action_lock = SPIN_LOCK_UNLOCKED;
+
 /*
  * Dave Redman (djhr@tadpole.co.uk)
  *
@@ -492,7 +495,7 @@
 		return -EBUSY;
 	}
 
-	save_and_cli(flags);
+	spin_lock_irqsave(&irq_action_lock, flags);
 
 	/* If this is flagged as statically allocated then we use our
 	 * private struct which is never freed.
@@ -507,10 +510,10 @@
 	
 	if (action == NULL)
 	    action = (struct irqaction *)kmalloc(sizeof(struct irqaction),
-						 GFP_KERNEL);
+						 GFP_ATOMIC);
 	
 	if (!action) { 
-		restore_flags(flags);
+		spin_unlock_irqrestore(&irq_action_lock, flags);
 		return -ENOMEM;
 	}
 
@@ -547,7 +550,7 @@
 	*(cpu_irq + irq_action) = action;
 
 	enable_irq(irq);
-	restore_flags(flags);
+	spin_unlock_irqrestore(&irq_action_lock, flags);
 	return 0;
 }
 
@@ -586,7 +589,7 @@
 		action = NULL;		/* Or else! */
 	}
 
-	save_and_cli(flags);
+	spin_lock_irqsave(&irq_action_lock, flags);
 
 	/* If this is flagged as statically allocated then we use our
 	 * private struct which is never freed.
@@ -600,10 +603,10 @@
 	
 	if (action == NULL)
 	    action = (struct irqaction *)kmalloc(sizeof(struct irqaction),
-						 GFP_KERNEL);
+						 GFP_ATOMIC);
 	
 	if (!action) { 
-		restore_flags(flags);
+		spin_unlock_irqrestore(&irq_action_lock, flags);
 		return -ENOMEM;
 	}
 
@@ -620,7 +623,7 @@
 		*(cpu_irq + irq_action) = action;
 
 	enable_irq(irq);
-	restore_flags(flags);
+	spin_unlock_irqrestore(&irq_action_lock, flags);
 	return 0;
 }
 
diff -Nru a/arch/sparc/kernel/traps.c b/arch/sparc/kernel/traps.c
--- a/arch/sparc/kernel/traps.c	Tue Feb  3 19:45:28 2004
+++ b/arch/sparc/kernel/traps.c	Tue Feb  3 19:45:28 2004
@@ -121,7 +121,6 @@
 		      !(((unsigned long) rw) & 0x7)) {
 			printk("Caller[%08lx]", rw->ins[7]);
 			print_symbol(": %s\n", rw->ins[7]);
-			printk("\n");
 			rw = (struct reg_window *)rw->ins[6];
 		}
 	}
diff -Nru a/arch/sparc/mm/extable.c b/arch/sparc/mm/extable.c
--- a/arch/sparc/mm/extable.c	Tue Feb  3 19:45:28 2004
+++ b/arch/sparc/mm/extable.c	Tue Feb  3 19:45:28 2004
@@ -6,6 +6,11 @@
 #include <linux/module.h>
 #include <asm/uaccess.h>
 
+void sort_extable(struct exception_table_entry *start,
+		  struct exception_table_entry *finish)
+{
+}
+
 /* Caller knows they are in a range if ret->fixup == 0 */
 const struct exception_table_entry *
 search_extable(const struct exception_table_entry *start,
diff -Nru a/arch/sparc/mm/fault.c b/arch/sparc/mm/fault.c
--- a/arch/sparc/mm/fault.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sparc/mm/fault.c	Tue Feb  3 19:45:17 2004
@@ -36,7 +36,6 @@
 
 #define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0]))
 
-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
@@ -393,7 +392,7 @@
 
 		if (pmd_present(*pmd) || !pmd_present(*pmd_k))
 			goto bad_area_nosemaphore;
-		pmd_val(*pmd) = pmd_val(*pmd_k);
+		*pmd = *pmd_k;
 		return;
 	}
 }
diff -Nru a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
--- a/arch/sparc/mm/srmmu.c	Tue Feb  3 19:45:29 2004
+++ b/arch/sparc/mm/srmmu.c	Tue Feb  3 19:45:29 2004
@@ -51,26 +51,6 @@
 
 #include <asm/btfixup.h>
 
-/*
- * To support pagetables in highmem, Linux introduces APIs which
- * return struct page* and generally manipulate page tables when
- * they are not mapped into kernel space. Our hardware page tables
- * are smaller than pages. We lump hardware tabes into big, page sized
- * software tables.
- *
- * PMD_SHIFT determines the size of the area a second-level page table entry
- * can map, and our pmd_t is 16 times larger than normal.
- */
-#define SRMMU_PTRS_PER_PMD_SOFT    0x4	/* Each pmd_t contains 16 hard PTPs */
-#define SRMMU_PTRS_PER_PTE_SOFT  0x400	/* 16 hard tables per 4K page */
-#define SRMMU_PTE_SZ_SOFT       0x1000	/* same as above, in bytes */
-
-#define SRMMU_PMD_SHIFT_SOFT	22
-#define SRMMU_PMD_SIZE_SOFT	(1UL << SRMMU_PMD_SHIFT_SOFT)
-#define SRMMU_PMD_MASK_SOFT	(~(SRMMU_PMD_SIZE_SOFT-1))
-// #define SRMMU_PMD_ALIGN(addr)  (((addr)+SRMMU_PMD_SIZE-1)&SRMMU_PMD_MASK)
-
-
 enum mbus_module srmmu_modtype;
 unsigned int hwbug_bitmask;
 int vac_cache_size;
@@ -349,7 +329,7 @@
 		    vaddr, (unsigned long)SRMMU_NOCACHE_VADDR);
 		BUG();
 	}
-	if (vaddr+size >= 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();
@@ -1071,7 +1051,7 @@
 		}
 		if (start > (0xffffffffUL - SRMMU_PMD_SIZE_SOFT))
 			break;
-		start = (start + SRMMU_PMD_SIZE) & SRMMU_PMD_MASK;
+		start = (start + SRMMU_PMD_SIZE_SOFT) & SRMMU_PMD_MASK_SOFT;
 	}
 }
 
@@ -1101,7 +1081,7 @@
 		}
 		if (start > (0xffffffffUL - SRMMU_PMD_SIZE_SOFT))
 			break;
-		start = (start + SRMMU_PMD_SIZE) & SRMMU_PMD_MASK;
+		start = (start + SRMMU_PMD_SIZE_SOFT) & SRMMU_PMD_MASK_SOFT;
 	}
 }
 
diff -Nru a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
--- a/arch/sparc64/Kconfig	Tue Feb  3 19:45:41 2004
+++ b/arch/sparc64/Kconfig	Tue Feb  3 19:45:41 2004
@@ -128,6 +128,7 @@
 
 config NR_CPUS
 	int "Maximum number of CPUs (2-64)"
+	range 2 64
 	depends on SMP
 	default "64"
 
@@ -489,6 +490,22 @@
 	  machines.  The watchdog timeout period is normally one minute but
 	  can be changed with a boot-time parameter.
 
+config CMDLINE_BOOL
+	bool "Default bootloader kernel arguments"
+
+config CMDLINE
+	string "Initial kernel command string"
+	depends on CMDLINE_BOOL
+	default "console=ttyS0,9600 root=/dev/sda1"
+	help
+	  Say Y here if you want to be able to pass default arguments to
+	  the kernel. This will be overridden by the bootloader, if you
+	  use one (such as SILO). This is most useful if you want to boot
+	  a kernel from TFTP, and want default options to be available
+	  with having them passed on the command line.
+
+	  NOTE: This option WILL override the PROM bootargs setting!
+
 endmenu
 
 source "drivers/base/Kconfig"
@@ -525,7 +542,7 @@
 
 # This one must be before the filesystem configs. -DaveM
 
-menu "Unix 98 PTY support"
+menu "Unix98 PTY support"
 
 config UNIX98_PTYS
 	bool "Unix98 PTY support"
@@ -709,6 +726,10 @@
 config STACK_DEBUG
 	depends on DEBUG_KERNEL
 	bool "Stack Overflow Detection Support"
+
+config DEBUG_BOOTMEM
+	depends on DEBUG_KERNEL
+	bool "Debug BOOTMEM initialization"
 
 # We have a custom atomic_dec_and_lock() implementation but it's not
 # compatible with spinlock debugging so we need to fall back on
diff -Nru a/arch/sparc64/defconfig b/arch/sparc64/defconfig
--- a/arch/sparc64/defconfig	Tue Feb  3 19:45:17 2004
+++ b/arch/sparc64/defconfig	Tue Feb  3 19:45:17 2004
@@ -102,6 +102,7 @@
 CONFIG_DISPLAY7SEG=m
 CONFIG_WATCHDOG_CP1XXX=m
 CONFIG_WATCHDOG_RIO=m
+# CONFIG_CMDLINE_BOOL is not set
 
 #
 # Generic Driver Options
@@ -124,6 +125,7 @@
 # CONFIG_FB_ATY is not set
 # CONFIG_FB_SIS is not set
 # CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
 # CONFIG_FB_3DFX is not set
 # CONFIG_FB_VOODOO1 is not set
 # CONFIG_FB_TRIDENT is not set
@@ -339,6 +341,11 @@
 CONFIG_SCSI_QLOGIC_FC_FIRMWARE=y
 # CONFIG_SCSI_QLOGIC_1280 is not set
 CONFIG_SCSI_QLOGICPTI=m
+CONFIG_SCSI_QLA2XXX_CONFIG=y
+CONFIG_SCSI_QLA2XXX=m
+CONFIG_SCSI_QLA21XX=m
+CONFIG_SCSI_QLA22XX=m
+CONFIG_SCSI_QLA23XX=m
 CONFIG_SCSI_DC395x=m
 CONFIG_SCSI_DC390T=m
 # CONFIG_SCSI_DC390T_NOGENSUPP is not set
@@ -372,6 +379,7 @@
 CONFIG_MD_RAID0=m
 CONFIG_MD_RAID1=m
 CONFIG_MD_RAID5=m
+CONFIG_MD_RAID6=m
 CONFIG_MD_MULTIPATH=m
 CONFIG_BLK_DEV_DM=m
 # CONFIG_DM_IOCTL_V4 is not set
@@ -712,6 +720,7 @@
 CONFIG_ADAPTEC_STARFIRE=m
 CONFIG_ADAPTEC_STARFIRE_NAPI=y
 CONFIG_B44=m
+CONFIG_FORCEDETH=m
 CONFIG_DGRS=m
 CONFIG_EEPRO100=m
 # CONFIG_EEPRO100_PIO is not set
@@ -910,17 +919,19 @@
 CONFIG_BT_BNEP=m
 CONFIG_BT_BNEP_MC_FILTER=y
 CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_CMTP=m
 
 #
 # Bluetooth device drivers
 #
 CONFIG_BT_HCIUSB=m
-CONFIG_BT_USB_SCO=y
-# CONFIG_BT_USB_ZERO_PACKET is not set
+CONFIG_BT_HCIUSB_SCO=y
 CONFIG_BT_HCIUART=m
 CONFIG_BT_HCIUART_H4=y
 CONFIG_BT_HCIUART_BCSP=y
 CONFIG_BT_HCIUART_BCSP_TXCRC=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBFUSB=m
 CONFIG_BT_HCIVHCI=m
 
 #
@@ -959,7 +970,7 @@
 CONFIG_PHONE_IXJ=m
 
 #
-# Unix 98 PTY support
+# Unix98 PTY support
 #
 CONFIG_UNIX98_PTYS=y
 CONFIG_UNIX98_PTY_COUNT=256
@@ -1044,16 +1055,21 @@
 CONFIG_I2C_ALI15X3=m
 CONFIG_I2C_AMD756=m
 CONFIG_I2C_AMD8111=m
+CONFIG_I2C_ELV=m
 CONFIG_I2C_I801=m
 CONFIG_I2C_I810=m
+CONFIG_I2C_ISA=m
 CONFIG_I2C_NFORCE2=m
 CONFIG_I2C_PHILIPSPAR=m
+CONFIG_I2C_PARPORT=m
+CONFIG_I2C_PARPORT_LIGHT=m
 CONFIG_I2C_PROSAVAGE=m
 CONFIG_I2C_SAVAGE4=m
 CONFIG_SCx200_ACB=m
 CONFIG_I2C_SIS5595=m
 CONFIG_I2C_SIS630=m
 CONFIG_I2C_SIS96X=m
+CONFIG_I2C_VELLEMAN=m
 CONFIG_I2C_VIA=m
 CONFIG_I2C_VIAPRO=m
 CONFIG_I2C_VOODOO3=m
@@ -1063,14 +1079,20 @@
 #
 CONFIG_I2C_SENSOR=m
 CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ASB100=m
 CONFIG_SENSORS_EEPROM=m
 CONFIG_SENSORS_IT87=m
 CONFIG_SENSORS_LM75=m
 CONFIG_SENSORS_LM78=m
 CONFIG_SENSORS_LM83=m
 CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM90=m
 CONFIG_SENSORS_VIA686A=m
 CONFIG_SENSORS_W83781D=m
+CONFIG_SENSORS_W83L785TS=m
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
 
 #
 # File systems
@@ -1266,6 +1288,7 @@
 CONFIG_VIDEO_DPC=m
 CONFIG_VIDEO_HEXIUM_ORION=m
 CONFIG_VIDEO_HEXIUM_GEMINI=m
+CONFIG_VIDEO_CX88=m
 
 #
 # Radio Adapters
@@ -1286,6 +1309,7 @@
 CONFIG_DVB_TWINHAN_DST=m
 CONFIG_DVB_STV0299=m
 CONFIG_DVB_SP887X=m
+CONFIG_DVB_SP887X_FIRMWARE_FILE="/etc/dvb/sc_main.mc"
 CONFIG_DVB_ALPS_TDLB7=m
 CONFIG_DVB_ALPS_TDMB7=m
 CONFIG_DVB_ATMEL_AT76C651=m
@@ -1295,12 +1319,12 @@
 CONFIG_DVB_MT312=m
 CONFIG_DVB_VES1820=m
 CONFIG_DVB_VES1X93=m
-CONFIG_DVB_SP887X_FIRMWARE_FILE="/etc/dvb/sc_main.mc"
 
 #
 # Supported SAA7146 based PCI Adapters
 #
-# CONFIG_DVB_AV7110 is not set
+CONFIG_DVB_AV7110=m
+# CONFIG_DVB_AV7110_OSD is not set
 CONFIG_DVB_BUDGET=m
 CONFIG_DVB_BUDGET_CI=m
 CONFIG_DVB_BUDGET_AV=m
@@ -1327,6 +1351,7 @@
 CONFIG_VIDEO_TUNER=m
 CONFIG_VIDEO_BUF=m
 CONFIG_VIDEO_BTCX=m
+CONFIG_VIDEO_IR=m
 
 #
 # Sound
@@ -1559,12 +1584,15 @@
 #
 # USB Miscellaneous drivers
 #
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
 # CONFIG_USB_TIGL is not set
 CONFIG_USB_AUERSWALD=m
 CONFIG_USB_RIO500=m
 CONFIG_USB_LEGOTOWER=m
 # CONFIG_USB_BRLVGER is not set
 CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
 CONFIG_USB_SPEEDTOUCH=m
 CONFIG_USB_TEST=m
 # CONFIG_USB_GADGET is not set
diff -Nru a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S
--- a/arch/sparc64/kernel/head.S	Tue Feb  3 19:45:17 2004
+++ b/arch/sparc64/kernel/head.S	Tue Feb  3 19:45:17 2004
@@ -54,7 +54,15 @@
 
         .ascii  "HdrS"
         .word   LINUX_VERSION_CODE
-        .half   0x0203          /* HdrS version */
+
+	/* History:
+	 *
+	 * 0x0300 : Supports being located at other than 0x4000
+	 * 0x0202 : Supports kernel params string
+	 * 0x0201 : Supports reboot_command
+	 */
+        .half   0x0300          /* HdrS version */
+
 root_flags:
         .half   1
 root_dev:
@@ -151,6 +159,9 @@
 	blu,pt	%xcc, 1b
 	 add	%l0, (1 << 3), %l0
 
+	/* BUG() if we get here... */
+	ta	0x5
+
 cheetah_got_tlbentry:
 	ldxa	[%l0] ASI_ITLB_DATA_ACCESS, %g0
 	ldxa	[%l0] ASI_ITLB_DATA_ACCESS, %g1
@@ -333,13 +344,17 @@
 	blu,pt	%xcc, 1b
 	 add	%l0, (1 << 3), %l0
 
+	/* BUG() if we get here... */
+	ta	0x5
+
 spitfire_got_tlbentry:
 	/* Nops here again, perhaps Cheetah/Blackbird are better behaved... */
 	nop
 	nop
 	nop
 	and	%g1, %g3, %g1		/* Mask to just get paddr bits.       */
-	sub	%g1, %g2, %g1		/* Get rid of %pc offset to get base. */
+	set	0x5fff, %l3		/* Mask offset to get phys base.      */
+	andn	%g1, %l3, %g1
 
 	/* NOTE: We hold on to %g1 paddr base as we need it below to lock
 	 * NOTE: the PROM cif code into the TLB.
diff -Nru a/arch/sparc64/kernel/pci_common.c b/arch/sparc64/kernel/pci_common.c
--- a/arch/sparc64/kernel/pci_common.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sparc64/kernel/pci_common.c	Tue Feb  3 19:45:17 2004
@@ -303,14 +303,23 @@
 {
 	struct resource *res;
 	int breg = (ap->phys_hi & 0xff);
-	int space = (ap->phys_hi >> 24) & 3;
 
 	switch (breg) {
 	case  PCI_ROM_ADDRESS:
+		/* Unfortunately I have seen several cases where
+		 * buggy FCODE uses a space value of '1' (I/O space)
+		 * in the register property for the ROM address
+		 * so disable this sanity check for now.
+		 */
+#if 0
+	{
+		int space = (ap->phys_hi >> 24) & 3;
+
 		/* It had better be MEM space. */
 		if (space != 2)
 			bad_assignment(pdev, ap, NULL, 0);
-
+	}
+#endif
 		res = &pdev->resource[PCI_ROM_RESOURCE];
 		break;
 
diff -Nru a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c
--- a/arch/sparc64/kernel/power.c	Tue Feb  3 19:45:42 2004
+++ b/arch/sparc64/kernel/power.c	Tue Feb  3 19:45:42 2004
@@ -29,8 +29,8 @@
 static irqreturn_t power_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
 	if (button_pressed == 0) {
-		wake_up(&powerd_wait);
 		button_pressed = 1;
+		wake_up(&powerd_wait);
 	}
 
 	/* FIXME: Check registers for status... */
@@ -69,19 +69,27 @@
 {
 	static char *envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
 	char *argv[] = { "/sbin/shutdown", "-h", "now", NULL };
+	DECLARE_WAITQUEUE(wait, current);
 
 	daemonize("powerd");
 
+	add_wait_queue(&powerd_wait, &wait);
 again:
-	while (button_pressed == 0) {
+	for (;;) {
+		set_task_state(current, TASK_INTERRUPTIBLE);
+		if (button_pressed)
+			break;
 		flush_signals(current);
-		interruptible_sleep_on(&powerd_wait);
+		schedule();
 	}
+	__set_current_state(TASK_RUNNING);
+	remove_wait_queue(&powerd_wait, &wait);
 
 	/* Ok, down we go... */
+	button_pressed = 0;
 	if (execve("/sbin/shutdown", argv, envp) < 0) {
 		printk("powerd: shutdown execution failed\n");
-		button_pressed = 0;
+		add_wait_queue(&powerd_wait, &wait);
 		goto again;
 	}
 	return 0;
diff -Nru a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
--- a/arch/sparc64/kernel/setup.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sparc64/kernel/setup.c	Tue Feb  3 19:45:17 2004
@@ -45,6 +45,7 @@
 #include <asm/hardirq.h>
 #include <asm/mmu_context.h>
 #include <asm/timer.h>
+#include <asm/sections.h>
 
 #ifdef CONFIG_IP_PNP
 #include <net/ipconfig.h>
@@ -521,6 +522,22 @@
 			highest_paddr = top;
 	}
 	pfn_base = phys_base >> PAGE_SHIFT;
+
+	switch (tlb_type) {
+	default:
+	case spitfire:
+		kern_base = spitfire_get_itlb_data(sparc64_highest_locked_tlbent());
+		kern_base &= _PAGE_PADDR_SF;
+		break;
+
+	case cheetah:
+	case cheetah_plus:
+		kern_base = cheetah_get_litlb_data(sparc64_highest_locked_tlbent());
+		kern_base &= _PAGE_PADDR;
+		break;
+	};
+
+	kern_size = (unsigned long)&_end - (unsigned long)KERNBASE;
 
 	if (!root_flags)
 		root_mountflags &= ~MS_RDONLY;
diff -Nru a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
--- a/arch/sparc64/kernel/smp.c	Tue Feb  3 19:45:16 2004
+++ b/arch/sparc64/kernel/smp.c	Tue Feb  3 19:45:16 2004
@@ -1261,6 +1261,7 @@
 
 void __devinit smp_prepare_boot_cpu(void)
 {
+	current_thread_info()->cpu = hard_smp_processor_id();
 	cpu_set(smp_processor_id(), cpu_online_map);
 	cpu_set(smp_processor_id(), phys_cpu_present_map);
 }
diff -Nru a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
--- a/arch/sparc64/kernel/sys_sparc32.c	Tue Feb  3 19:45:30 2004
+++ b/arch/sparc64/kernel/sys_sparc32.c	Tue Feb  3 19:45:30 2004
@@ -1950,6 +1950,8 @@
 	int retval;
 	int i;
 
+	sched_balance_exec();
+
 	file = open_exec(filename);
 
 	retval = PTR_ERR(file);
@@ -2023,7 +2025,8 @@
 		security_bprm_free(&bprm);
 
 out_mm:
-	mmdrop(bprm.mm);
+	if (bprm.mm)
+		mmdrop(bprm.mm);
 
 out_file:
 	if (bprm.file) {
diff -Nru a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
--- a/arch/sparc64/kernel/traps.c	Tue Feb  3 19:45:42 2004
+++ b/arch/sparc64/kernel/traps.c	Tue Feb  3 19:45:42 2004
@@ -2043,8 +2043,4 @@
 	 */
 	atomic_inc(&init_mm.mm_count);
 	current->active_mm = &init_mm;
-
-#ifdef CONFIG_SMP
-	current_thread_info()->cpu = hard_smp_processor_id();
-#endif
 }
diff -Nru a/arch/sparc64/mm/extable.c b/arch/sparc64/mm/extable.c
--- a/arch/sparc64/mm/extable.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sparc64/mm/extable.c	Tue Feb  3 19:45:17 2004
@@ -9,6 +9,11 @@
 extern const struct exception_table_entry __start___ex_table[];
 extern const struct exception_table_entry __stop___ex_table[];
 
+void sort_extable(struct exception_table_entry *start,
+		  struct exception_table_entry *finish)
+{
+}
+
 /* Caller knows they are in a range if ret->fixup == 0 */
 const struct exception_table_entry *
 search_extable(const struct exception_table_entry *start,
diff -Nru a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
--- a/arch/sparc64/mm/init.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sparc64/mm/init.c	Tue Feb  3 19:45:17 2004
@@ -47,8 +47,19 @@
 
 /* Ugly, but necessary... -DaveM */
 unsigned long phys_base;
+unsigned long kern_base;
+unsigned long kern_size;
 unsigned long pfn_base;
 
+/* This is even uglier. We have a problem where the kernel may not be
+ * located at phys_base. However, initial __alloc_bootmem() calls need to
+ * be adjusted to be within the 4-8Megs that the kernel is mapped to, else
+ * those page mappings wont work. Things are ok after inherit_prom_mappings
+ * is called though. Dave says he'll clean this up some other time.
+ * -- BenC
+ */
+static unsigned long bootmap_base;
+
 /* get_new_mmu_context() uses "cache + 1".  */
 spinlock_t ctx_alloc_lock = SPIN_LOCK_UNLOCKED;
 unsigned long tlb_context_cache = CTX_FIRST_VERSION - 1;
@@ -433,7 +444,7 @@
 	n += 5 * sizeof(struct linux_prom_translation);
 	for (tsz = 1; tsz < n; tsz <<= 1)
 		/* empty */;
-	trans = __alloc_bootmem(tsz, SMP_CACHE_BYTES, 0UL);
+	trans = __alloc_bootmem(tsz, SMP_CACHE_BYTES, bootmap_base);
 	if (trans == NULL) {
 		prom_printf("inherit_prom_mappings: Cannot alloc translations.\n");
 		prom_halt();
@@ -453,7 +464,7 @@
 	 * in inherit_locked_prom_mappings()).
 	 */
 #define OBP_PMD_SIZE 2048
-	prompmd = __alloc_bootmem(OBP_PMD_SIZE, OBP_PMD_SIZE, 0UL);
+	prompmd = __alloc_bootmem(OBP_PMD_SIZE, OBP_PMD_SIZE, bootmap_base);
 	if (prompmd == NULL)
 		early_pgtable_allocfail("pmd");
 	memset(prompmd, 0, OBP_PMD_SIZE);
@@ -471,7 +482,7 @@
 				if (pmd_none(*pmdp)) {
 					ptep = __alloc_bootmem(BASE_PAGE_SIZE,
 							       BASE_PAGE_SIZE,
-							       0UL);
+							       bootmap_base);
 					if (ptep == NULL)
 						early_pgtable_allocfail("pte");
 					memset(ptep, 0, BASE_PAGE_SIZE);
@@ -1293,6 +1304,10 @@
 	unsigned long bootmap_pfn, bytes_avail, size;
 	int i;
 
+#ifdef CONFIG_DEBUG_BOOTMEM
+	prom_printf("bootmem_init: Scan sp_banks, ");
+#endif
+
 	bytes_avail = 0UL;
 	for (i = 0; sp_banks[i].num_bytes != 0; i++) {
 		end_of_phys_memory = sp_banks[i].base_addr +
@@ -1323,15 +1338,8 @@
 	 * image.  The kernel is hard mapped below PAGE_OFFSET in a
 	 * 4MB locked TLB translation.
 	 */
-	start_pfn  = PAGE_ALIGN((unsigned long) _end) -
-		((unsigned long) KERNBASE);
-
-	/* Adjust up to the physical address where the kernel begins. */
-	start_pfn += phys_base;
+	start_pfn = PAGE_ALIGN(kern_base + kern_size) >> PAGE_SHIFT;
 
-	/* Now shift down to get the real physical page frame number. */
-	start_pfn >>= PAGE_SHIFT;
-	
 	bootmap_pfn = start_pfn;
 
 	end_pfn = end_of_phys_memory >> PAGE_SHIFT;
@@ -1359,14 +1367,25 @@
 	/* Initialize the boot-time allocator. */
 	max_pfn = max_low_pfn = end_pfn;
 	min_low_pfn = pfn_base;
+
+#ifdef CONFIG_DEBUG_BOOTMEM
+	prom_printf("init_bootmem(min[%lx], bootmap[%lx], max[%lx])\n",
+		    min_low_pfn, bootmap_pfn, max_low_pfn);
+#endif
 	bootmap_size = init_bootmem_node(NODE_DATA(0), bootmap_pfn, pfn_base, end_pfn);
 
+	bootmap_base = bootmap_pfn << PAGE_SHIFT;
+
 	/* Now register the available physical memory with the
 	 * allocator.
 	 */
-	for (i = 0; sp_banks[i].num_bytes != 0; i++)
-		free_bootmem(sp_banks[i].base_addr,
-			     sp_banks[i].num_bytes);
+	for (i = 0; sp_banks[i].num_bytes != 0; i++) {
+#ifdef CONFIG_DEBUG_BOOTMEM
+		prom_printf("free_bootmem(sp_banks:%d): base[%lx] size[%lx]\n",
+			    i, sp_banks[i].base_addr, sp_banks[i].num_bytes);
+#endif
+		free_bootmem(sp_banks[i].base_addr, sp_banks[i].num_bytes);
+	}
 
 #ifdef CONFIG_BLK_DEV_INITRD
 	if (initrd_start) {
@@ -1381,15 +1400,21 @@
 	}
 #endif
 	/* Reserve the kernel text/data/bss. */
-	size = (start_pfn << PAGE_SHIFT) - phys_base;
-	reserve_bootmem(phys_base, size);
-	*pages_avail -= PAGE_ALIGN(size) >> PAGE_SHIFT;
+#ifdef CONFIG_DEBUG_BOOTMEM
+	prom_printf("reserve_bootmem(kernel): base[%lx] size[%lx]\n", kern_base, kern_size);
+#endif
+	reserve_bootmem(kern_base, kern_size);
+	*pages_avail -= PAGE_ALIGN(kern_size) >> PAGE_SHIFT;
 
 	/* Reserve the bootmem map.   We do not account for it
 	 * in pages_avail because we will release that memory
 	 * in free_all_bootmem.
 	 */
 	size = bootmap_size;
+#ifdef CONFIG_DEBUG_BOOTMEM
+	prom_printf("reserve_bootmem(bootmap): base[%lx] size[%lx]\n",
+		    (bootmap_pfn << PAGE_SHIFT), size);
+#endif
 	reserve_bootmem((bootmap_pfn << PAGE_SHIFT), size);
 	*pages_avail -= PAGE_ALIGN(size) >> PAGE_SHIFT;
 
@@ -1408,7 +1433,7 @@
 	extern pmd_t swapper_pmd_dir[1024];
 	extern unsigned int sparc64_vpte_patchme1[1];
 	extern unsigned int sparc64_vpte_patchme2[1];
-	unsigned long alias_base = phys_base + PAGE_OFFSET;
+	unsigned long alias_base = kern_base + PAGE_OFFSET;
 	unsigned long second_alias_page = 0;
 	unsigned long pt, flags, end_pfn, pages_avail;
 	unsigned long shift = alias_base - ((unsigned long)KERNBASE);
@@ -1428,7 +1453,7 @@
 	 * if this were not true we wouldn't boot up to this point
 	 * anyways.
 	 */
-	pt  = phys_base | _PAGE_VALID | _PAGE_SZ4MB;
+	pt  = kern_base | _PAGE_VALID | _PAGE_SZ4MB;
 	pt |= _PAGE_CP | _PAGE_CV | _PAGE_P | _PAGE_L | _PAGE_W;
 	local_irq_save(flags);
 	if (tlb_type == spitfire) {
@@ -1522,7 +1547,16 @@
 	}
 
 	inherit_locked_prom_mappings(1);
-	
+
+#ifdef CONFIG_SUN_SERIAL
+	/* This does not logically belong here, but we need to call it at
+	 * the moment we are able to use the bootmem allocator. This _has_
+	 * to be done after the prom_mappings above so since
+	 * __alloc_bootmem() doesn't work correctly until then.
+	 */
+	sun_serial_setup();
+#endif
+
 	/* We only created DTLB mapping of this stuff. */
 	spitfire_flush_dtlb_nucleus_page(alias_base);
 	if (second_alias_page)
@@ -1693,17 +1727,15 @@
 	i = last_valid_pfn >> ((22 - PAGE_SHIFT) + 6);
 	i += 1;
 	sparc64_valid_addr_bitmap = (unsigned long *)
-		__alloc_bootmem(i << 3, SMP_CACHE_BYTES, 0UL);
+		__alloc_bootmem(i << 3, SMP_CACHE_BYTES, bootmap_base);
 	if (sparc64_valid_addr_bitmap == NULL) {
 		prom_printf("mem_init: Cannot alloc valid_addr_bitmap.\n");
 		prom_halt();
 	}
 	memset(sparc64_valid_addr_bitmap, 0, i << 3);
 
-	addr = PAGE_OFFSET + phys_base;
-	last = PAGE_ALIGN((unsigned long)_end) -
-		((unsigned long) KERNBASE);
-	last += PAGE_OFFSET + phys_base;
+	addr = PAGE_OFFSET + kern_base;
+	last = PAGE_ALIGN(kern_size) + addr;
 	while (addr < last) {
 		set_bit(__pa(addr) >> 22, sparc64_valid_addr_bitmap);
 		addr += PAGE_SIZE;
@@ -1714,6 +1746,9 @@
 	max_mapnr = last_valid_pfn - pfn_base;
 	high_memory = __va(last_valid_pfn << PAGE_SHIFT);
 
+#ifdef CONFIG_DEBUG_BOOTMEM
+	prom_printf("mem_init: Calling free_all_bootmem().\n");
+#endif
 	totalram_pages = num_physpages = free_all_bootmem() - 1;
 
 	/*
@@ -1740,7 +1775,7 @@
 		/* Put empty_pg_dir on pgd_quicklist */
 		extern pgd_t empty_pg_dir[1024];
 		unsigned long addr = (unsigned long)empty_pg_dir;
-		unsigned long alias_base = phys_base + PAGE_OFFSET -
+		unsigned long alias_base = kern_base + PAGE_OFFSET -
 			(long)(KERNBASE);
 		
 		memset(empty_pg_dir, 0, sizeof(empty_pg_dir));
@@ -1776,7 +1811,7 @@
 		struct page *p;
 
 		page = (addr +
-			((unsigned long) __va(phys_base)) -
+			((unsigned long) __va(kern_base)) -
 			((unsigned long) KERNBASE));
 		p = virt_to_page(page);
 
diff -Nru a/arch/sparc64/prom/bootstr.c b/arch/sparc64/prom/bootstr.c
--- a/arch/sparc64/prom/bootstr.c	Tue Feb  3 19:45:17 2004
+++ b/arch/sparc64/prom/bootstr.c	Tue Feb  3 19:45:17 2004
@@ -21,6 +21,10 @@
 	char bootstr_buf[BARG_LEN];
 } bootstr_info = {
 	.bootstr_len = BARG_LEN,
+#ifdef CONFIG_CMDLINE
+	.bootstr_valid = 1,
+	.bootstr_buf = CONFIG_CMDLINE,
+#endif
 };
 
 char * __init
diff -Nru a/arch/um/Kconfig b/arch/um/Kconfig
--- a/arch/um/Kconfig	Tue Feb  3 19:45:18 2004
+++ b/arch/um/Kconfig	Tue Feb  3 19:45:18 2004
@@ -128,6 +128,7 @@
 
 config NR_CPUS
 	int "Maximum number of CPUs (2-32)"
+	range 2 32
 	depends on SMP
 	default "32"
 
diff -Nru a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
--- a/arch/x86_64/Kconfig	Tue Feb  3 19:45:37 2004
+++ b/arch/x86_64/Kconfig	Tue Feb  3 19:45:37 2004
@@ -68,6 +68,9 @@
 
 	  If unsure, say Y.
 
+config HPET_EMULATE_RTC
+	def_bool HPET_TIMER && RTC=y
+
 config GENERIC_ISA_DMA
 	bool
 	default y
@@ -233,6 +236,7 @@
 # to use clustered mode or whatever your big iron needs
 config NR_CPUS
 	int "Maximum number of CPUs (2-8)"
+	range 2 8
 	depends on SMP
 	default "8"
 	help
@@ -270,51 +274,7 @@
 
 menu "Power management options"
 
-config PM
-	bool "Power Management support"
-	---help---
-	  "Power Management" means that parts of your computer are shut
-	  off or put into a power conserving "sleep" mode if they are not
-	  being used.  There are two competing standards for doing this: APM
-	  and ACPI.  If you want to use either one, say Y here and then also
-	  to the requisite support below.
-
-	  Power Management is most important for battery powered laptop
-	  computers.
-
-	  Note that, even if you say N here, Linux on the x86 architecture
-	  will issue the hlt instruction if nothing is to be done, thereby
-	  sending the processor to limited sleep and saving power. However
-	  using ACPI will likely save more power.
-
-config SOFTWARE_SUSPEND
-	bool "Software Suspend (EXPERIMENTAL)"
-	depends on EXPERIMENTAL && PM && SWAP
-	---help---
-	  Enable the possibilty of suspending the machine. It doesn't need APM.
-	  You may suspend your machine by 'swsusp' or 'shutdown -z <time>' 
-	  (patch for sysvinit needed). 
-
-	  It creates an image which is saved in your active swaps. On the next
-	  boot, pass the 'resume=/path/to/your/swap/file' option and the kernel
-	  will detect the saved image, restore the memory from
-	  it, and then continue to run as before you suspended.
-	  If you don't want the previous state to continue, use the 'noresume'
-	  kernel option. However, note that your partitions will be fsck'd and
-	  you must re-mkswap your swap partitions/files.
-
-	  Right now you may boot without resuming and then later resume but
-	  in the meantime you cannot use those swap partitions/files which were
-	  involved in suspending. Also in this case there is a risk that buffers
-	  on disk won't match with saved ones.
-
-	  SMP is supported ``as-is''. There's code for it but doesn't work.
-	  There have been problems reported relating to SCSI.
-
-	  This option is close to getting stable. However there is still some
-	  absence of features.
-
-	  For more information take a look at Documentation/power/swsusp.txt.
+source kernel/power/Kconfig
 
 source "drivers/acpi/Kconfig"
 
@@ -335,8 +295,23 @@
 
 # the drivers/pci/msi.c code needs to be fixed first before enabling
 config PCI_USE_VECTOR
-	bool
+	bool "Vector-based interrupt indexing"
+	depends on X86_LOCAL_APIC && NOTWORKING
 	default n
+	help
+	   This replaces the current existing IRQ-based index interrupt scheme
+	   with the vector-base index scheme. The advantages of vector base
+	   over IRQ base are listed below:
+	   1) Support MSI implementation.
+	   2) Support future IOxAPIC hotplug
+
+	   Note that this enables MSI, Message Signaled Interrupt, on all
+	   MSI capable device functions detected if users also install the
+	   MSI patch. Message Signal Interrupt enables an MSI-capable
+	   hardware device to send an inbound Memory Write on its PCI bus
+	   instead of asserting IRQ signal on device IRQ pin.
+
+	   If you don't know what to do here, say N.
 
 source "drivers/pci/Kconfig"
 
@@ -395,51 +370,9 @@
 
 endmenu
 
-source "drivers/base/Kconfig"
-
-source "drivers/mtd/Kconfig"
-
-source "drivers/parport/Kconfig"
-
-source "drivers/block/Kconfig"
-
-source "drivers/ide/Kconfig"
-
-source "drivers/scsi/Kconfig"
-
-source "drivers/md/Kconfig"
-
-source "drivers/telephony/Kconfig"
-
-source "drivers/message/fusion/Kconfig"
-
-source "drivers/ieee1394/Kconfig"
-
-#Currently not 64-bit safe
-#source drivers/message/i2o/Config.in
-source "net/Kconfig"
-
-source "drivers/isdn/Kconfig"
-
-# no support for non IDE/SCSI cdroms as they were all ISA only
-#
-# input before char - char/joystick depends on it. As does USB.
-#
-source "drivers/input/Kconfig"
-
-source "drivers/char/Kconfig"
-
-source "drivers/misc/Kconfig"
-
-source "drivers/media/Kconfig"
-
-source "fs/Kconfig"
-
-source "drivers/video/Kconfig"
-
-source "sound/Kconfig"
+source drivers/Kconfig
 
-source "drivers/usb/Kconfig"
+source fs/Kconfig
 
 source "arch/x86_64/oprofile/Kconfig"
 
@@ -504,6 +437,7 @@
           If you say Y here the resulting kernel image will include
 	  debugging info resulting in a larger kernel image.
 	  Say Y here only if you plan to use gdb to debug the kernel.
+	  Please note that this option requires new binutils.
 	  If you don't debug the kernel, you can say N.
 	  
 config FRAME_POINTER
diff -Nru a/arch/x86_64/Makefile b/arch/x86_64/Makefile
--- a/arch/x86_64/Makefile	Tue Feb  3 19:45:42 2004
+++ b/arch/x86_64/Makefile	Tue Feb  3 19:45:42 2004
@@ -49,7 +49,7 @@
 # CFLAGS += -finline-limit=2000
 CFLAGS += -Wno-sign-compare
 # don't enable this when you use kgdb:
-ifneq ($(CONFIG_X86_REMOTE_DEBUG),y)
+ifneq ($(CONFIG_DEBUG_INFO),y)
 CFLAGS += -fno-asynchronous-unwind-tables
 endif
 #CFLAGS += $(call check_gcc,-funit-at-a-time,)
diff -Nru a/arch/x86_64/defconfig b/arch/x86_64/defconfig
--- a/arch/x86_64/defconfig	Tue Feb  3 19:45:34 2004
+++ b/arch/x86_64/defconfig	Tue Feb  3 19:45:34 2004
@@ -9,6 +9,7 @@
 CONFIG_X86_CMPXCHG=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_HPET_TIMER=y
+CONFIG_HPET_EMULATE_RTC=y
 CONFIG_GENERIC_ISA_DMA=y
 
 #
@@ -26,7 +27,8 @@
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 CONFIG_LOG_BUF_SHIFT=18
-# CONFIG_IKCONFIG is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
 CONFIG_FUTEX=y
@@ -34,6 +36,7 @@
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -59,7 +62,6 @@
 CONFIG_X86_IO_APIC=y
 CONFIG_X86_LOCAL_APIC=y
 CONFIG_MTRR=y
-# CONFIG_HUGETLB_PAGE is not set
 CONFIG_SMP=y
 # CONFIG_PREEMPT is not set
 CONFIG_K8_NUMA=y
@@ -79,9 +81,9 @@
 #
 # ACPI (Advanced Configuration and Power Interface) Support
 #
-# CONFIG_ACPI_HT is not set
 CONFIG_ACPI=y
 CONFIG_ACPI_BOOT=y
+CONFIG_ACPI_INTERPRETER=y
 CONFIG_ACPI_SLEEP=y
 CONFIG_ACPI_SLEEP_PROC_FS=y
 CONFIG_ACPI_AC=y
@@ -94,17 +96,23 @@
 CONFIG_ACPI_TOSHIBA=y
 CONFIG_ACPI_DEBUG=y
 CONFIG_ACPI_BUS=y
-CONFIG_ACPI_INTERPRETER=y
 CONFIG_ACPI_EC=y
 CONFIG_ACPI_POWER=y
 CONFIG_ACPI_PCI=y
 CONFIG_ACPI_SYSTEM=y
+# CONFIG_ACPI_RELAXED_AML is not set
+
+#
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ is not set
 
 #
 # Bus options (PCI etc.)
 #
 CONFIG_PCI=y
 CONFIG_PCI_DIRECT=y
+# CONFIG_PCI_USE_VECTOR is not set
 # CONFIG_PCI_LEGACY_PROC is not set
 # CONFIG_PCI_NAMES is not set
 # CONFIG_HOTPLUG is not set
@@ -115,6 +123,7 @@
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 CONFIG_IA32_EMULATION=y
+# CONFIG_IA32_AOUT is not set
 CONFIG_COMPAT=y
 CONFIG_UID16=y
 
@@ -179,7 +188,6 @@
 # CONFIG_BLK_DEV_OPTI621 is not set
 # CONFIG_BLK_DEV_RZ1000 is not set
 CONFIG_BLK_DEV_IDEDMA_PCI=y
-# CONFIG_BLK_DEV_IDE_TCQ is not set
 # CONFIG_BLK_DEV_IDEDMA_FORCED is not set
 CONFIG_IDEDMA_PCI_AUTO=y
 # CONFIG_IDEDMA_ONLYDISK is not set
@@ -246,6 +254,7 @@
 # CONFIG_SCSI_AIC79XX is not set
 # CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_BUSLOGIC is not set
 # CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
@@ -260,7 +269,7 @@
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
 # CONFIG_SCSI_DC395x is not set
-# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_DEBUG is not set
 
 #
@@ -313,7 +322,12 @@
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
-# CONFIG_IPV6 is not set
+CONFIG_IPV6=y
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_INET6_AH is not set
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_TUNNEL is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
@@ -325,7 +339,9 @@
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
 # CONFIG_VLAN_8021Q is not set
-# CONFIG_LLC is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
 # CONFIG_NET_DIVERT is not set
@@ -358,7 +374,7 @@
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
-# CONFIG_MII is not set
+CONFIG_MII=y
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
 # CONFIG_NET_VENDOR_3COM is not set
@@ -388,7 +404,6 @@
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
-# CONFIG_TLAN is not set
 # CONFIG_VIA_RHINE is not set
 
 #
@@ -421,10 +436,10 @@
 # CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices (depends on LLC=y)
+# Token Ring devices
 #
+# CONFIG_TR is not set
 # CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 
 #
@@ -443,6 +458,11 @@
 # CONFIG_IRDA is not set
 
 #
+# Bluetooth support
+#
+# CONFIG_BT is not set
+
+#
 # ISDN subsystem
 #
 # CONFIG_ISDN_BOOL is not set
@@ -504,6 +524,7 @@
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 # CONFIG_SERIAL_8250_ACPI is not set
+CONFIG_SERIAL_8250_NR_UARTS=4
 # CONFIG_SERIAL_8250_EXTENDED is not set
 
 #
@@ -520,7 +541,11 @@
 # CONFIG_I2C is not set
 
 #
-# I2C Hardware Sensors Mainboard support
+# I2C Algorithms
+#
+
+#
+# I2C Hardware Bus support
 #
 
 #
@@ -549,7 +574,6 @@
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
 
 #
 # Ftape, the floppy tape device driver
@@ -559,6 +583,7 @@
 # CONFIG_DRM is not set
 # CONFIG_MWAVE is not set
 CONFIG_RAW_DRIVER=y
+CONFIG_MAX_RAW_DEVS=256
 CONFIG_HANGCHECK_TIMER=y
 
 #
@@ -619,10 +644,13 @@
 # Pseudo filesystems
 #
 CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS=y
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
+# CONFIG_HUGETLBFS is not set
+# CONFIG_HUGETLB_PAGE is not set
 CONFIG_RAMFS=y
 
 #
@@ -647,6 +675,7 @@
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
 CONFIG_NFSD=y
 CONFIG_NFSD_V3=y
 # CONFIG_NFSD_V4 is not set
@@ -670,6 +699,11 @@
 CONFIG_MSDOS_PARTITION=y
 
 #
+# Native Language Support
+#
+# CONFIG_NLS is not set
+
+#
 # Graphics support
 #
 # CONFIG_FB is not set
@@ -707,13 +741,15 @@
 # CONFIG_SOUND_MAESTRO is not set
 # CONFIG_SOUND_MAESTRO3 is not set
 CONFIG_SOUND_ICH=y
-# CONFIG_SOUND_RME96XX is not set
 # CONFIG_SOUND_SONICVIBES is not set
 # CONFIG_SOUND_TRIDENT is not set
+# CONFIG_SOUND_MSNDCLAS is not set
+# CONFIG_SOUND_MSNDPIN is not set
 # CONFIG_SOUND_VIA82CXXX is not set
 # CONFIG_SOUND_OSS is not set
 # CONFIG_SOUND_ALI5455 is not set
 # CONFIG_SOUND_FORTE is not set
+# CONFIG_SOUND_RME96XX is not set
 # CONFIG_SOUND_AD1980 is not set
 
 #
@@ -723,11 +759,6 @@
 # CONFIG_USB_GADGET is not set
 
 #
-# Bluetooth support
-#
-# CONFIG_BT is not set
-
-#
 # Profiling support
 #
 CONFIG_PROFILING=y
@@ -744,8 +775,6 @@
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_FRAME_POINTER is not set
 # CONFIG_IOMMU_DEBUG is not set
-CONFIG_IOMMU_LEAK=y
-CONFIG_MCE_DEBUG=y
 
 #
 # Security options
@@ -760,4 +789,4 @@
 #
 # Library routines
 #
-# CONFIG_CRC32 is not set
+CONFIG_CRC32=y
diff -Nru a/arch/x86_64/ia32/ia32_aout.c b/arch/x86_64/ia32/ia32_aout.c
--- a/arch/x86_64/ia32/ia32_aout.c	Tue Feb  3 19:45:43 2004
+++ b/arch/x86_64/ia32/ia32_aout.c	Tue Feb  3 19:45:43 2004
@@ -33,11 +33,14 @@
 #include <asm/user32.h>
 
 #undef WARN_OLD
+#undef CORE_DUMP /* probably broken */
 
 extern int ia32_setup_arg_pages(struct linux_binprm *bprm);
 
 static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs);
 static int load_aout_library(struct file*);
+
+#if CORE_DUMP
 static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file);
 
 /*
@@ -92,11 +95,15 @@
 #endif
 }
 
+#endif
+
 static struct linux_binfmt aout_format = {
 	.module		= THIS_MODULE,
 	.load_binary	= load_aout_binary,
 	.load_shlib	= load_aout_library,
+#if CORE_DUMP
 	.core_dump	= aout_core_dump,
+#endif
 	.min_coredump	= PAGE_SIZE
 };
 
@@ -109,6 +116,7 @@
 	do_brk(start, end - start);
 }
 
+#if CORE_DUMP
 /*
  * These are the only things you should do on a core-file: use only these
  * macros to write out all the necessary info.
@@ -201,6 +209,7 @@
 	set_fs(fs);
 	return has_dumped;
 }
+#endif
 
 /*
  * create_aout_tables() parses the env- and arg-strings in new user
@@ -285,10 +294,11 @@
 	regs->cs = __USER32_CS; 
 	regs->r8 = regs->r9 = regs->r10 = regs->r11 = regs->r12 =
 		regs->r13 = regs->r14 = regs->r15 = 0;
-	set_thread_flag(TIF_IA32); 
 
 	/* OK, This is the point of no return */
 	set_personality(PER_LINUX);
+	set_thread_flag(TIF_IA32); 
+	clear_thread_flag(TIF_ABI_PENDING);
 
 	current->mm->end_code = ex.a_text +
 		(current->mm->start_code = N_TXTADDR(ex));
diff -Nru a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c
--- a/arch/x86_64/ia32/ia32_binfmt.c	Tue Feb  3 19:45:16 2004
+++ b/arch/x86_64/ia32/ia32_binfmt.c	Tue Feb  3 19:45:16 2004
@@ -197,6 +197,7 @@
 static inline int elf_core_copy_task_regs(struct task_struct *t, elf_gregset_t* elfregs)
 {	
 	struct pt_regs *pp = (struct pt_regs *)(t->thread.rsp0);
+	--pp;
 	ELF_CORE_COPY_REGS((*elfregs), pp);
 	/* fix wrong segments */ 
 	(*elfregs)[7] = t->thread.ds; 
@@ -214,6 +215,8 @@
 
 	if (!tsk->used_math) 
 		return 0;
+	if (!regs)
+		regs = (struct pt_regs *)tsk->thread.rsp0;
 	--regs;
 	if (tsk == current)
 		unlazy_fpu(tsk);
@@ -250,6 +253,14 @@
 #define ELF_PLATFORM  ("i686")
 #define SET_PERSONALITY(ex, ibcs2)			\
 do {							\
+	unsigned long new_flags = 0;				\
+	if ((ex).e_ident[EI_CLASS] == ELFCLASS32)		\
+		new_flags = _TIF_IA32;				\
+	if ((current_thread_info()->flags & _TIF_IA32)		\
+	    != new_flags)					\
+		set_thread_flag(TIF_ABI_PENDING);		\
+	else							\
+		clear_thread_flag(TIF_ABI_PENDING);		\
 	set_personality((ibcs2)?PER_SVR4:current->personality);	\
 } while (0)
 
@@ -323,7 +334,6 @@
 	me->thread.gsindex = 0;
     me->thread.ds = __USER_DS; 
 	me->thread.es = __USER_DS;
-	set_thread_flag(TIF_IA32); 
 }
 
 int setup_arg_pages(struct linux_binprm *bprm)
@@ -392,7 +402,7 @@
 	down_write(&me->mm->mmap_sem);
 	map_addr = do_mmap(filep, ELF_PAGESTART(addr),
 			   eppnt->p_filesz + ELF_PAGEOFFSET(eppnt->p_vaddr), prot, 
-			   type|MAP_32BIT,
+			   type,
 			   eppnt->p_offset - ELF_PAGEOFFSET(eppnt->p_vaddr));
 	up_write(&me->mm->mmap_sem);
 	return(map_addr);
diff -Nru a/arch/x86_64/ia32/ia32_signal.c b/arch/x86_64/ia32/ia32_signal.c
--- a/arch/x86_64/ia32/ia32_signal.c	Tue Feb  3 19:45:42 2004
+++ b/arch/x86_64/ia32/ia32_signal.c	Tue Feb  3 19:45:42 2004
@@ -44,10 +44,10 @@
 asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset);
 void signal_fault(struct pt_regs *regs, void *frame, char *where);
 
-static int ia32_copy_siginfo_to_user(siginfo_t32 *to, siginfo_t *from)
+int ia32_copy_siginfo_to_user(siginfo_t32 __user *to, siginfo_t *from)
 {
 	int err;
-	if (!access_ok (VERIFY_WRITE, to, sizeof(siginfo_t)))
+	if (!access_ok (VERIFY_WRITE, to, sizeof(siginfo_t32)))
 		return -EFAULT;
 
 	/* If you change siginfo_t structure, please make sure that
@@ -55,21 +55,18 @@
 		   It should never copy any pad contained in the structure
 		   to avoid security leaks, but must copy the generic
 		   3 ints plus the relevant union member.  */
-
-	if (from->si_code < 0) {
-		err = __put_user(from->si_signo, &to->si_signo);
-		err |= __put_user(from->si_errno, &to->si_errno);
-		err |= __put_user(from->si_code, &to->si_code);
-		err |= __put_user(from->_sifields._rt._pid, &to->_sifields._rt._pid);
-		err |= __put_user(from->_sifields._rt._uid, &to->_sifields._rt._uid);
-		err |= __put_user((u32)(u64)from->_sifields._rt._sigval.sival_ptr,
-				  &to->_sifields._rt._sigval.sival_ptr);
-	} else {
 		err = __put_user(from->si_signo, &to->si_signo);
 		err |= __put_user(from->si_errno, &to->si_errno);
-		err |= __put_user(from->si_code, &to->si_code);
-		/* First 32bits of unions are always present.  */
+ 	err |= __put_user((short)from->si_code, &to->si_code);
+
+	if (from->si_code < 0) {
 		err |= __put_user(from->si_pid, &to->si_pid);
+ 		err |= __put_user(from->si_uid, &to->si_uid);
+ 		err |= __put_user((u32)(u64)from->si_ptr, &to->si_ptr);
+	} else {
+ 		/* First 32bits of unions are always present:
+ 		 * si_pid === si_band === si_tid === si_addr(LS half) */
+		err |= __put_user(from->_sifields._pad[0], &to->_sifields._pad[0]);
 		switch (from->si_code >> 16) {
 		case __SI_FAULT >> 16:
 			break;
@@ -78,18 +75,39 @@
 			err |= __put_user(from->si_stime, &to->si_stime);
 			err |= __put_user(from->si_status, &to->si_status);
 		default:
+		case __SI_KILL >> 16:
 			err |= __put_user(from->si_uid, &to->si_uid);
 			break;
 		case __SI_POLL >> 16:
-			err |= __put_user(from->si_band, &to->si_band); 
 			err |= __put_user(from->si_fd, &to->si_fd); 
 			break;
+		case __SI_TIMER >> 16:
+			err |= __put_user(from->si_overrun, &to->si_overrun); 
+			err |= __put_user((u32)(u64)from->si_ptr, &to->si_ptr);
+			break;
 		/* case __SI_RT: This is not generated by the kernel as of now.  */
 		}
 	}
 	return err;
 }
 
+int ia32_copy_siginfo_from_user(siginfo_t *to, siginfo_t32 __user *from)
+{
+	int err;
+	if (!access_ok (VERIFY_READ, from, sizeof(siginfo_t32)))
+		return -EFAULT;
+
+	err = __get_user(to->si_signo, &from->si_signo);
+	err |= __get_user(to->si_errno, &from->si_errno);
+	err |= __get_user(to->si_code, &from->si_code);
+
+	err |= __get_user(to->si_pid, &from->si_pid);
+	err |= __get_user(to->si_uid, &from->si_uid);
+	err |= __get_user((u32)(u64)to->si_ptr, &from->si_ptr);
+
+	return err;
+}
+
 asmlinkage long
 sys32_sigsuspend(int history0, int history1, old_sigset_t mask, struct pt_regs regs)
 {
@@ -134,9 +152,9 @@
 	set_fs(seg); 
 	if (ret >= 0 && uoss_ptr)  {
 		if (!access_ok(VERIFY_WRITE,uoss_ptr,sizeof(stack_ia32_t)) ||
-		    __put_user((u32)(u64)uss.ss_sp, &uoss_ptr->ss_sp) ||
-		    __put_user(uss.ss_flags, &uoss_ptr->ss_flags) ||
-		    __put_user(uss.ss_size, &uoss_ptr->ss_size))
+		    __put_user((u32)(u64)uoss.ss_sp, &uoss_ptr->ss_sp) ||
+		    __put_user(uoss.ss_flags, &uoss_ptr->ss_flags) ||
+		    __put_user(uoss.ss_size, &uoss_ptr->ss_size))
 			ret = -EFAULT;
 	} 	
 	return ret;	
@@ -376,7 +394,7 @@
 /*
  * Determine which stack to use..
  */
-static inline void *
+static void *
 get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
 {
 	unsigned long rsp;
@@ -386,7 +404,7 @@
 
 	/* This is the X/Open sanctioned signal stack switching.  */
 	if (ka->sa.sa_flags & SA_ONSTACK) {
-		if (! on_sig_stack(rsp))
+		if (sas_ss_flags(rsp) == 0)
 			rsp = current->sas_ss_sp + current->sas_ss_size;
 	}
 
diff -Nru a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S
--- a/arch/x86_64/ia32/ia32entry.S	Tue Feb  3 19:45:17 2004
+++ b/arch/x86_64/ia32/ia32entry.S	Tue Feb  3 19:45:17 2004
@@ -4,6 +4,7 @@
  * Copyright 2000-2002 Andi Kleen, SuSE Labs.
  */		 
 
+#include <asm/dwarf2.h>
 #include <asm/calling.h>
 #include <asm/offset.h>
 #include <asm/current.h>
@@ -45,6 +46,7 @@
  * with the int 0x80 path.	
  */ 	
 ENTRY(ia32_cstar_target)
+	CFI_STARTPROC
 	swapgs
 	movl	%esp,%r8d
 	movq	%gs:pda_kernelstack,%rsp
@@ -105,6 +107,7 @@
 cstar_badarg:
 	movq $-EFAULT,%rax
 	jmp cstar_sysret
+	CFI_ENDPROC
 
 /* 
  * Emulated IA32 system calls via int 0x80. 
@@ -128,6 +131,7 @@
  */ 				
 
 ENTRY(ia32_syscall)
+	CFI_STARTPROC
 	swapgs	
 	sti
 	movl %eax,%eax
@@ -168,6 +172,7 @@
 quiet_ni_syscall:
 	movq $-ENOSYS,%rax
 	ret
+	CFI_ENDPROC
 	
 	.macro PTREGSCALL label, func
 	.globl \label
@@ -188,6 +193,7 @@
 	PTREGSCALL stub32_rt_sigsuspend, sys_rt_sigsuspend
 
 ENTRY(ia32_ptregs_common)
+	CFI_STARTPROC
 	popq %r11
 	SAVE_REST
 	movq %r11, %r15
@@ -198,6 +204,7 @@
 	je   int_ret_from_sys_call /* misbalances the call/ret stack. sorry */
 	pushq %r11
 	ret
+	CFI_ENDPROC
 
 	.data
 	.align 8
@@ -326,7 +333,7 @@
 	.quad stub32_clone		/* 120 */
 	.quad sys_setdomainname
 	.quad sys_uname
-	.quad sys32_modify_ldt
+	.quad sys_modify_ldt
 	.quad sys32_adjtimex
 	.quad sys32_mprotect		/* 125 */
 	.quad compat_sys_sigprocmask
@@ -334,10 +341,10 @@
 	.quad sys_init_module
 	.quad sys_delete_module
 	.quad quiet_ni_syscall		/* 130  get_kernel_syms */
-	.quad ni_syscall	/* quotactl */ 
+	.quad sys32_quotactl		/* quotactl */ 
 	.quad sys_getpgid
 	.quad sys_fchdir
-	.quad ni_syscall	/* bdflush */
+	.quad quiet_ni_syscall	/* bdflush */
 	.quad sys_sysfs		/* 135 */
 	.quad sys_personality
 	.quad ni_syscall	/* for afs_syscall */
@@ -425,8 +432,8 @@
 	.quad sys_madvise
 	.quad sys_getdents64	/* 220 getdents64 */ 
 	.quad compat_sys_fcntl64	
-	.quad sys_ni_syscall	/* tux */
-	.quad sys_ni_syscall    /* security */
+	.quad quiet_ni_syscall		/* tux */
+	.quad quiet_ni_syscall    	/* security */
 	.quad sys_gettid	
 	.quad sys_readahead	/* 225 */
 	.quad sys_setxattr
@@ -454,7 +461,7 @@
 	.quad sys32_io_submit
 	.quad sys_io_cancel
 	.quad sys_fadvise64
-	.quad sys_ni_syscall /* free_huge_pages */
+	.quad quiet_ni_syscall /* free_huge_pages */
 	.quad sys_exit_group /* exit_group */
 	.quad sys_lookup_dcookie
 	.quad sys_epoll_create
diff -Nru a/arch/x86_64/ia32/ptrace32.c b/arch/x86_64/ia32/ptrace32.c
--- a/arch/x86_64/ia32/ptrace32.c	Tue Feb  3 19:45:17 2004
+++ b/arch/x86_64/ia32/ptrace32.c	Tue Feb  3 19:45:17 2004
@@ -26,6 +26,10 @@
 #include <linux/ptrace.h>
 #include <linux/mm.h>
 
+/* determines which flags the user has access to. */
+/* 1 = access 0 = no access */
+#define FLAG_MASK 0x44dd5UL
+
 #define R32(l,q) \
 	case offsetof(struct user32, regs.l): stack[offsetof(struct pt_regs, q)/8] = val; break
 
@@ -70,9 +74,12 @@
 	R32(eip, rip);
 	R32(esp, rsp);
 
-	case offsetof(struct user32, regs.eflags): 
-		stack[offsetof(struct pt_regs, eflags)/8] = val & 0x44dd5; 
+	case offsetof(struct user32, regs.eflags): {
+		__u64 *flags = &stack[offsetof(struct pt_regs, eflags)/8];
+		val &= FLAG_MASK;
+		*flags = val | (*flags & ~FLAG_MASK);
 		break;
+	}
 
 	case offsetof(struct user32, u_debugreg[4]): 
 	case offsetof(struct user32, u_debugreg[5]):
diff -Nru a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c
--- a/arch/x86_64/ia32/sys_ia32.c	Tue Feb  3 19:45:17 2004
+++ b/arch/x86_64/ia32/sys_ia32.c	Tue Feb  3 19:45:17 2004
@@ -858,8 +858,13 @@
 
 int sys32_ni_syscall(int call)
 { 
+	struct task_struct *me = current;
+	static char lastcomm[8];
+	if (strcmp(lastcomm, me->comm)) {
 	printk(KERN_INFO "IA32 syscall %d from %s not implemented\n", call,
 	       current->comm);
+		strcpy(lastcomm, me->comm); 
+	} 
 	return -ENOSYS;	       
 } 
 
@@ -1022,84 +1027,6 @@
 	return ret;
 }
 
-siginfo_t32 *
-siginfo64to32(siginfo_t32 *d, siginfo_t *s)
-{
-	memset (d, 0, sizeof(siginfo_t32));
-	d->si_signo = s->si_signo;
-	d->si_errno = s->si_errno;
-	d->si_code = s->si_code;
-	if (s->si_signo >= SIGRTMIN) {
-		d->si_pid = s->si_pid;
-		d->si_uid = s->si_uid;
-		memcpy(&d->si_int, &s->si_int, 
-                       sizeof(siginfo_t) - offsetof(siginfo_t,si_int));
-	} else switch (s->si_signo) {
-	/* XXX: What about POSIX1.b timers */
-	case SIGCHLD:
-		d->si_pid = s->si_pid;
-		d->si_status = s->si_status;
-		d->si_utime = s->si_utime;
-		d->si_stime = s->si_stime;
-		break;
-	case SIGSEGV:
-	case SIGBUS:
-	case SIGFPE:
-	case SIGILL:
-		d->si_addr = (long)(s->si_addr);
-//		d->si_trapno = s->si_trapno;
-		break;
-	case SIGPOLL:
-		d->si_band = s->si_band;
-		d->si_fd = s->si_fd;
-		break;
-	default:
-		d->si_pid = s->si_pid;
-		d->si_uid = s->si_uid;
-		break;
-	}
-	return d;
-}
-
-siginfo_t *
-siginfo32to64(siginfo_t *d, siginfo_t32 *s)
-{
-	d->si_signo = s->si_signo;
-	d->si_errno = s->si_errno;
-	d->si_code = s->si_code;
-	if (s->si_signo >= SIGRTMIN) {
-		d->si_pid = s->si_pid;
-		d->si_uid = s->si_uid;
-		memcpy(&d->si_int,
-                       &s->si_int,
-                       sizeof(siginfo_t) - offsetof(siginfo_t, si_int)); 
-	} else switch (s->si_signo) {
-	/* XXX: What about POSIX1.b timers */
-	case SIGCHLD:
-		d->si_pid = s->si_pid;
-		d->si_status = s->si_status;
-		d->si_utime = s->si_utime;
-		d->si_stime = s->si_stime;
-		break;
-	case SIGSEGV:
-	case SIGBUS:
-	case SIGFPE:
-	case SIGILL:
-		d->si_addr = (void *)A(s->si_addr);
-//		d->si_trapno = s->si_trapno;
-		break;
-	case SIGPOLL:
-		d->si_band = s->si_band;
-		d->si_fd = s->si_fd;
-		break;
-	default:
-		d->si_pid = s->si_pid;
-		d->si_uid = s->si_uid;
-		break;
-	}
-	return d;
-}
-
 extern asmlinkage long
 sys_rt_sigtimedwait(const sigset_t *uthese, siginfo_t *uinfo,
 		    const struct timespec *uts, size_t sigsetsize);
@@ -1114,7 +1041,6 @@
 	int ret;
 	mm_segment_t old_fs = get_fs();
 	siginfo_t info;
-	siginfo_t32 info32;
 		
 	if (copy_from_user (&s32, uthese, sizeof(compat_sigset_t)))
 		return -EFAULT;
@@ -1126,13 +1052,18 @@
 	}
 	if (uts && get_compat_timespec(&t, uts))
 		return -EFAULT;
+	if (uinfo) {
+		/* stop data leak to user space in case of structure fill mismatch
+		 * between sys_rt_sigtimedwait & ia32_copy_siginfo_to_user.
+		 */
+		memset(&info, 0, sizeof(info));
+	}
 	set_fs (KERNEL_DS);
 	ret = sys_rt_sigtimedwait(&s, uinfo ? &info : NULL, uts ? &t : NULL,
 			sigsetsize);
 	set_fs (old_fs);
 	if (ret >= 0 && uinfo) {
-		if (copy_to_user (uinfo, siginfo64to32(&info32, &info),
-				  sizeof(siginfo_t32)))
+		if (ia32_copy_siginfo_to_user(uinfo, &info))
 			return -EFAULT;
 	}
 	return ret;
@@ -1145,14 +1076,11 @@
 sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 *uinfo)
 {
 	siginfo_t info;
-	siginfo_t32 info32;
 	int ret;
 	mm_segment_t old_fs = get_fs();
 	
-	if (copy_from_user (&info32, uinfo, sizeof(siginfo_t32)))
+	if (ia32_copy_siginfo_from_user(&info, uinfo))
 		return -EFAULT;
-	/* XXX: Is this correct? */
-	siginfo32to64(&info, &info32);
 	set_fs (KERNEL_DS);
 	ret = sys_rt_sigqueueinfo(pid, sig, &info);
 	set_fs (old_fs);
@@ -1289,31 +1217,6 @@
 	return ret;
 }
 
-extern asmlinkage long sys_modify_ldt(int func, void *ptr, 
-				      unsigned long bytecount);
-
-asmlinkage long sys32_modify_ldt(int func, void *ptr, unsigned long bytecount)
-{
-	long ret;
-	if (func == 0x1 || func == 0x11) { 
-		struct user_desc info;
-		mm_segment_t old_fs = get_fs();
-		if (bytecount != sizeof(struct user_desc))
-			return -EINVAL;
-		if (copy_from_user(&info, ptr, sizeof(struct user_desc)))
-			return -EFAULT;
-		/* lm bit was undefined in the 32bit ABI and programs
-		   give it random values. Force it to zero here. */
-		info.lm = 0; 
-		set_fs(KERNEL_DS);
-		ret = sys_modify_ldt(func, &info, bytecount);
-		set_fs(old_fs);
-	}  else { 
-		ret = sys_modify_ldt(func, ptr, bytecount); 
-	}
-	return ret;
-}
-
 /* Handle adjtimex compatibility. */
 
 struct timex32 {
@@ -2001,6 +1904,18 @@
 	static char lastcomm[8];
 	if (strcmp(lastcomm, me->comm)) {
 		printk(KERN_INFO "%s: vm86 mode not supported on 64 bit kernel\n",
+		       me->comm);
+		strcpy(lastcomm, me->comm); 
+	} 
+	return -ENOSYS;
+} 
+
+long sys32_quotactl(void)
+{ 
+	struct task_struct *me = current;
+	static char lastcomm[8];
+	if (strcmp(lastcomm, me->comm)) {
+		printk(KERN_INFO "%s: 32bit quotactl not supported on 64 bit kernel\n",
 		       me->comm);
 		strcpy(lastcomm, me->comm); 
 	} 
diff -Nru a/arch/x86_64/kernel/acpi/boot.c b/arch/x86_64/kernel/acpi/boot.c
--- a/arch/x86_64/kernel/acpi/boot.c	Tue Feb  3 19:45:17 2004
+++ b/arch/x86_64/kernel/acpi/boot.c	Tue Feb  3 19:45:17 2004
@@ -46,11 +46,13 @@
 #include <asm/proto.h>
 #include <asm/tlbflush.h>
 
-int acpi_lapic = 0;
-int acpi_ioapic = 0;
-
 #define PREFIX			"ACPI: "
 
+int acpi_noirq __initdata = 0;	/* skip ACPI IRQ initialization */
+int acpi_ht __initdata = 1;	/* enable HT */
+
+int acpi_lapic = 0;
+int acpi_ioapic = 0;
 
 /* --------------------------------------------------------------------------
                               Boot-time Configuration
@@ -253,29 +255,66 @@
 
 #ifdef CONFIG_ACPI_BUS
 /*
- * Set specified PIC IRQ to level triggered mode.
+ * "acpi_pic_sci=level" (current default)
+ * programs the PIC-mode SCI to Level Trigger.
+ * (NO-OP if the BIOS set Level Trigger already)
+ *
+ * If a PIC-mode SCI is not recogznied or gives spurious IRQ7's
+ * it may require Edge Trigger -- use "acpi_pic_sci=edge"
+ * (NO-OP if the BIOS set Edge Trigger already)
  *
  * Port 0x4d0-4d1 are ECLR1 and ECLR2, the Edge/Level Control Registers
  * for the 8259 PIC.  bit[n] = 1 means irq[n] is Level, otherwise Edge.
  * ECLR1 is IRQ's 0-7 (IRQ 0, 1, 2 must be 0)
  * ECLR2 is IRQ's 8-15 (IRQ 8, 13 must be 0)
- *
- * As the BIOS should have done this for us,
- * print a warning if the IRQ wasn't already set to level.
  */
 
-void acpi_pic_set_level_irq(unsigned int irq)
+static int __initdata	acpi_pic_sci_trigger;	/* 0: level, 1: edge */
+
+void __init
+acpi_pic_sci_set_trigger(unsigned int irq)
 {
 	unsigned char mask = 1 << (irq & 7);
 	unsigned int port = 0x4d0 + (irq >> 3);
 	unsigned char val = inb(port);
 
+	
+	printk(PREFIX "IRQ%d SCI:", irq);
 	if (!(val & mask)) {
-		printk(KERN_WARNING PREFIX "IRQ %d was Edge Triggered, "
-			"setting to Level Triggerd\n", irq);
-		outb(val | mask, port);
+		printk(" Edge");
+
+		if (!acpi_pic_sci_trigger) {
+			printk(" set to Level");
+			outb(val | mask, port);
+		}
+	} else {
+		printk(" Level");
+
+		if (acpi_pic_sci_trigger) {
+			printk(" set to Edge");
+			outb(val | mask, port);
+		}
 	}
+	printk(" Trigger.\n");
 }
+
+int __init
+acpi_pic_sci_setup(char *str)
+{
+	while (str && *str) {
+		if (strncmp(str, "level", 5) == 0)
+			acpi_pic_sci_trigger = 0;	/* force level trigger */
+		if (strncmp(str, "edge", 4) == 0)
+			acpi_pic_sci_trigger = 1;	/* force edge trigger */
+		str = strchr(str, ',');
+		if (str)
+			str += strspn(str, ", \t");
+	}
+	return 1;
+}
+
+__setup("acpi_pic_sci=", acpi_pic_sci_setup);
+
 #endif /* CONFIG_ACPI_BUS */
 
 static unsigned long __init
@@ -354,8 +393,10 @@
 	 * Initialize the ACPI boot-time table parser.
 	 */
 	result = acpi_table_init();
-	if (result)
+	if (result) {
+		acpi_disabled = 1;
 		return result;
+	}
 
 	result = acpi_blacklisted();
 	if (result) {
@@ -442,7 +483,7 @@
         * If MPS is present, it will handle them,
         * otherwise the system will stay in PIC mode
         */
-        if (acpi_disabled) {
+        if (acpi_disabled || acpi_noirq) {
                return 1;
 	}
 
@@ -483,6 +524,8 @@
 	}
 
 	acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC;
+
+	acpi_irq_balance_set(NULL);
 
 	acpi_ioapic = 1;
 
diff -Nru a/arch/x86_64/kernel/acpi/sleep.c b/arch/x86_64/kernel/acpi/sleep.c
--- a/arch/x86_64/kernel/acpi/sleep.c	Tue Feb  3 19:45:16 2004
+++ b/arch/x86_64/kernel/acpi/sleep.c	Tue Feb  3 19:45:16 2004
@@ -56,6 +56,7 @@
 
 /* address in low memory of the wakeup routine. */
 unsigned long acpi_wakeup_address = 0;
+unsigned long acpi_video_flags;
 extern char wakeup_start, wakeup_end;
 
 extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long));
@@ -115,6 +116,22 @@
 		printk(KERN_CRIT "ACPI: Wakeup code way too big, will crash on attempt to suspend\n");
 	printk(KERN_DEBUG "ACPI: have wakeup address 0x%8.8lx\n", acpi_wakeup_address);
 }
+
+static int __init acpi_sleep_setup(char *str)
+{
+	while ((str != NULL) && (*str != '\0')) {
+		if (strncmp(str, "s3_bios", 7) == 0)
+			acpi_video_flags = 1;
+		if (strncmp(str, "s3_mode", 7) == 0)
+			acpi_video_flags |= 2;
+		str = strchr(str, ',');
+		if (str != NULL)
+			str += strspn(str, ", \t");
+	}
+	return 1;
+}
+
+__setup("acpi_sleep=", acpi_sleep_setup);
 
 #endif /*CONFIG_ACPI_SLEEP*/
 
diff -Nru a/arch/x86_64/kernel/acpi/wakeup.S b/arch/x86_64/kernel/acpi/wakeup.S
--- a/arch/x86_64/kernel/acpi/wakeup.S	Tue Feb  3 19:45:34 2004
+++ b/arch/x86_64/kernel/acpi/wakeup.S	Tue Feb  3 19:45:34 2004
@@ -41,7 +41,19 @@
 	cmpl	$0x12345678, %eax
 	jne	bogus_real_magic
 
+	testl	$1, video_flags - wakeup_code
+	jz	1f
 	lcall   $0xc000,$3
+	movw	%cs, %ax
+	movw	%ax, %ds					# Bios might have played with that
+	movw	%ax, %ss
+1:
+
+	testl	$2, video_flags - wakeup_code
+	jz	1f
+	mov	video_mode - wakeup_code, %ax
+	call	mode_seta
+1:
 
  	movw	$0xb800, %ax
 	movw	%ax,%fs
@@ -250,6 +262,7 @@
 		.quad 0
 real_magic:	.quad 0
 video_mode:	.quad 0
+video_flags:	.quad 0
 
 bogus_real_magic:
 	movb	$0xba,%al	;  outb %al,$0x80		
@@ -382,8 +395,10 @@
 	movl	%eax, saved_efer
 	movl	%edx, saved_efer2
 
-#	movq	saved_videomode, %rdx				# FIXME:	 videomode
-	movq	%rdx, video_mode - wakeup_start (,%rdi)
+	movl	saved_video_mode, %edx
+	movl	%edx, video_mode - wakeup_start (,%rdi)
+	movl	acpi_video_flags, %edx
+	movl	%edx, video_flags - wakeup_start (,%rdi)
 	movq	$0x12345678, real_magic - wakeup_start (,%rdi)
 	movq	$0x123456789abcdef0, %rdx
 	movq	%rdx, saved_magic
diff -Nru a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
--- a/arch/x86_64/kernel/entry.S	Tue Feb  3 19:45:17 2004
+++ b/arch/x86_64/kernel/entry.S	Tue Feb  3 19:45:17 2004
@@ -34,6 +34,7 @@
 #include <asm/smp.h>
 #include <asm/cache.h>
 #include <asm/errno.h>
+#include <asm/dwarf2.h>
 #include <asm/calling.h>
 #include <asm/offset.h>
 #include <asm/msr.h>
@@ -41,7 +42,6 @@
 #include <asm/thread_info.h>
 #include <asm/hw_irq.h>
 #include <asm/errno.h>
-#include <asm/dwarf2.h>
 
 	.code64
 
@@ -82,22 +82,53 @@
 	/* push in order ss, rsp, eflags, cs, rip */
 	xorq %rax, %rax
 	pushq %rax /* ss */
+	CFI_ADJUST_CFA_OFFSET	8
 	pushq %rax /* rsp */
+	CFI_ADJUST_CFA_OFFSET	8
+	CFI_OFFSET	rip,0
 	pushq $(1<<9) /* eflags - interrupts on */
+	CFI_ADJUST_CFA_OFFSET	8
 	pushq $__KERNEL_CS /* cs */
+	CFI_ADJUST_CFA_OFFSET	8
 	pushq \child_rip /* rip */
+	CFI_ADJUST_CFA_OFFSET	8
+	CFI_OFFSET	rip,0
 	pushq	%rax /* orig rax */
+	CFI_ADJUST_CFA_OFFSET	8
 	.endm
 
 	.macro UNFAKE_STACK_FRAME
 	addq $8*6, %rsp
+	CFI_ADJUST_CFA_OFFSET	-(6*8)
 	.endm
 
+	.macro	CFI_DEFAULT_STACK
+	CFI_ADJUST_CFA_OFFSET  (SS)
+	CFI_OFFSET	r15,R15-SS
+	CFI_OFFSET	r14,R14-SS
+	CFI_OFFSET	r13,R13-SS
+	CFI_OFFSET	r12,R12-SS
+	CFI_OFFSET	rbp,RBP-SS
+	CFI_OFFSET	rbx,RBX-SS
+	CFI_OFFSET	r11,R11-SS
+	CFI_OFFSET	r10,R10-SS
+	CFI_OFFSET	r9,R9-SS
+	CFI_OFFSET	r8,R8-SS
+	CFI_OFFSET	rax,RAX-SS
+	CFI_OFFSET	rcx,RCX-SS
+	CFI_OFFSET	rdx,RDX-SS
+	CFI_OFFSET	rsi,RSI-SS
+	CFI_OFFSET	rdi,RDI-SS
+	CFI_OFFSET	rsp,RSP-SS
+	CFI_OFFSET	rip,RIP-SS
+	.endm
 /*
  * A newly forked process directly context switches into this.
  */ 	
 /* rdi:	prev */	
 ENTRY(ret_from_fork)
+	CFI_STARTPROC
+	CFI_DEFAULT_STACK
 	call schedule_tail
 	GET_THREAD_INFO(%rcx)
 	bt $TIF_SYSCALL_TRACE,threadinfo_flags(%rcx)
@@ -115,6 +146,7 @@
 	call syscall_trace
 	GET_THREAD_INFO(%rcx)	
 	jmp rff_action
+	CFI_ENDPROC
 
 /*
  * System call entry. Upto 6 arguments in registers are supported.
@@ -144,6 +176,7 @@
  */ 			 		
 
 ENTRY(system_call)
+	CFI_STARTPROC
 	swapgs
 	movq	%rsp,%gs:pda_oldrsp 
 	movq	%gs:pda_kernelstack,%rsp
@@ -283,6 +316,7 @@
 int_restore_rest:
 	RESTORE_REST
 	jmp int_with_check
+	CFI_ENDPROC
 		
 /* 
  * Certain special system calls that need to save a complete full stack frame.
@@ -303,7 +337,9 @@
 	PTREGSCALL stub_iopl, sys_iopl
 
 ENTRY(ptregscall_common)
+	CFI_STARTPROC
 	popq %r11
+	CFI_ADJUST_CFA_OFFSET	-8
 	SAVE_REST
 	movq %r11, %r15
 	FIXUP_TOP_OF_STACK %r11
@@ -312,10 +348,14 @@
 	movq %r15, %r11
 	RESTORE_REST
 	pushq %r11
+	CFI_ADJUST_CFA_OFFSET	8
 	ret
+	CFI_ENDPROC
 	
 ENTRY(stub_execve)
+	CFI_STARTPROC
 	popq %r11
+	CFI_ADJUST_CFA_OFFSET	-8
 	SAVE_REST
 	movq %r11, %r15
 	FIXUP_TOP_OF_STACK %r11
@@ -330,15 +370,18 @@
 	ret
 
 exec_32bit:
+	CFI_ADJUST_CFA_OFFSET	REST_SKIP
 	movq %rax,RAX(%rsp)
 	RESTORE_REST
 	jmp int_ret_from_sys_call
+	CFI_ENDPROC
 	
 /*
  * sigreturn is special because it needs to restore all registers on return.
  * This cannot be done with SYSRET, so use the IRET return path instead.
  */                
 ENTRY(stub_rt_sigreturn)
+	CFI_STARTPROC
 	addq $8, %rsp		
 	SAVE_REST
 	FIXUP_TOP_OF_STACK %r11
@@ -346,6 +389,7 @@
 	movq %rax,RAX(%rsp) # fixme, this could be done at the higher layer
 	RESTORE_REST
 	jmp int_ret_from_sys_call
+	CFI_ENDPROC
 
 /* 
  * Interrupt entry/exit.
@@ -357,10 +401,20 @@
 
 /* 0(%rsp): interrupt number */ 
 	.macro interrupt func
+	CFI_STARTPROC	simple
+	CFI_DEF_CFA	rsp,(SS-ORIG_RAX)
+	CFI_OFFSET	rsp,(RSP-SS)
+	CFI_OFFSET	rip,(RIP-SS)
 	cld
-#ifdef CONFIG_X86_REMOTE_DEBUG
+#ifdef CONFIG_DEBUG_INFO
 	SAVE_ALL	
 	movq %rsp,%rdi
+	/*
+	 * Setup a stack frame pointer.  This allows gdb to trace
+	 * back to the original stack.
+	 */
+	movq %rsp,%rbp
+	CFI_DEF_CFA_REGISTER	rbp
 #else		
 	SAVE_ARGS
 	leaq -ARGOFFSET(%rsp),%rdi	# arg1 for handler
@@ -382,6 +436,9 @@
 	popq  %rdi
 	cli	
 	subl $1,%gs:pda_irqcount
+#ifdef CONFIG_KGDB
+	movq RBP(%rdi),%rbp
+#endif
 	leaq ARGOFFSET(%rdi),%rsp
 exit_intr:	 	
 	GET_THREAD_INFO(%rcx)
@@ -465,6 +522,7 @@
 	movl $0,threadinfo_preempt_count(%rcx) 
 	jmp exit_intr
 #endif	
+	CFI_ENDPROC
 	
 /*
  * APIC interrupts.
@@ -473,6 +531,7 @@
 	pushq $\num-256
 	interrupt \func
 	jmp ret_from_intr
+	CFI_ENDPROC
 	.endm
 
 #ifdef CONFIG_SMP	
@@ -518,24 +577,43 @@
  * and the exception handler in %rax.	
  */ 		  				
 ENTRY(error_entry)
+	CFI_STARTPROC	simple
+	CFI_DEF_CFA	rsp,(SS-RDI)
+	CFI_REL_OFFSET	rsp,(RSP-RDI)
+	CFI_REL_OFFSET	rip,(RIP-RDI)
 	/* rdi slot contains rax, oldrax contains error code */
 	cld	
 	subq  $14*8,%rsp
+	CFI_ADJUST_CFA_OFFSET	(14*8)
 	movq %rsi,13*8(%rsp)
+	CFI_REL_OFFSET	rsi,RSI
 	movq 14*8(%rsp),%rsi	/* load rax from rdi slot */
 	movq %rdx,12*8(%rsp)
+	CFI_REL_OFFSET	rdx,RDX
 	movq %rcx,11*8(%rsp)
+	CFI_REL_OFFSET	rcx,RCX
 	movq %rsi,10*8(%rsp)	/* store rax */ 
+	CFI_REL_OFFSET	rax,RAX
 	movq %r8, 9*8(%rsp)
+	CFI_REL_OFFSET	r8,R8
 	movq %r9, 8*8(%rsp)
+	CFI_REL_OFFSET	r9,R9
 	movq %r10,7*8(%rsp)
+	CFI_REL_OFFSET	r10,R10
 	movq %r11,6*8(%rsp)
+	CFI_REL_OFFSET	r11,R11
 	movq %rbx,5*8(%rsp) 
+	CFI_REL_OFFSET	rbx,RBX
 	movq %rbp,4*8(%rsp) 
+	CFI_REL_OFFSET	rbp,RBP
 	movq %r12,3*8(%rsp) 
+	CFI_REL_OFFSET	r12,R12
 	movq %r13,2*8(%rsp) 
+	CFI_REL_OFFSET	r13,R13
 	movq %r14,1*8(%rsp) 
+	CFI_REL_OFFSET	r14,R14
 	movq %r15,(%rsp) 
+	CFI_REL_OFFSET	r15,R15
 	xorl %ebx,%ebx	
 	testl $3,CS(%rsp)
 	je  error_kernelspace
@@ -561,6 +639,7 @@
 	swapgs 
 	RESTORE_ARGS 0,8,0						
 	iretq
+	CFI_ENDPROC
 
 error_kernelspace:
 	incl %ebx
@@ -615,6 +694,7 @@
  *	rdi: fn, rsi: arg, rdx: flags
  */
 ENTRY(kernel_thread)
+	CFI_STARTPROC
 	FAKE_STACK_FRAME $child_rip
 	SAVE_ALL
 
@@ -642,6 +722,8 @@
 	RESTORE_ALL
 	UNFAKE_STACK_FRAME
 	ret
+	CFI_ENDPROC
+
 	
 child_rip:
 	/*
@@ -671,6 +753,7 @@
  *	rdi: name, rsi: argv, rdx: envp, fake frame on the stack
  */
 ENTRY(execve)
+	CFI_STARTPROC
 	FAKE_STACK_FRAME $0
 	SAVE_ALL	
 	call sys_execve
@@ -681,6 +764,7 @@
 	RESTORE_ARGS
 	UNFAKE_STACK_FRAME
 	ret
+	CFI_ENDPROC
 
 ENTRY(page_fault)
 	errorentry do_page_fault
@@ -692,6 +776,7 @@
 	zeroentry do_simd_coprocessor_error	
 
 ENTRY(device_not_available)
+	CFI_STARTPROC
 	pushq $-1	#error code
 	SAVE_ALL
 	movl  $1,%ebx
@@ -706,11 +791,13 @@
 	cmoveq %rcx,%rdx
 	call  *%rdx
 	jmp  error_exit
+	CFI_ENDPROC
 
 ENTRY(debug)
 	zeroentry do_debug
 
 ENTRY(nmi)
+	CFI_STARTPROC
 	pushq $-1
 	SAVE_ALL
         /* NMI could happen inside the critical section of a swapgs,
@@ -731,6 +818,7 @@
 	swapgs
 2:	RESTORE_ALL 8
 	iretq
+	CFI_ENDPROC
 	
 ENTRY(int3)
 	zeroentry do_int3	
diff -Nru a/arch/x86_64/kernel/i387.c b/arch/x86_64/kernel/i387.c
--- a/arch/x86_64/kernel/i387.c	Tue Feb  3 19:45:17 2004
+++ b/arch/x86_64/kernel/i387.c	Tue Feb  3 19:45:17 2004
@@ -46,11 +46,6 @@
 	current->used_math = 0;
 }
 
-/*
- * The _current_ task is using the FPU for the first time
- * so initialize it and set the mxcsr to its default.
- * remember the current task has used the FPU.
- */
 void init_fpu(struct task_struct *child)
 {
 	if (child->used_math) { 
diff -Nru a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
--- a/arch/x86_64/kernel/io_apic.c	Tue Feb  3 19:45:26 2004
+++ b/arch/x86_64/kernel/io_apic.c	Tue Feb  3 19:45:26 2004
@@ -1121,8 +1121,6 @@
 	unsigned char old_id;
 	unsigned long flags;
 
-	if (acpi_ioapic) return; /* ACPI does that already */
-
 	/*
 	 * Set the IOAPIC ID to the value stored in the MPC table.
 	 */
@@ -1751,12 +1749,14 @@
 	/*
 	 * Set up the IO-APIC IRQ routing table.
 	 */
-	setup_ioapic_ids_from_mpc();
+	if (!acpi_ioapic)
+		setup_ioapic_ids_from_mpc();
 	sync_Arb_IDs();
 	setup_IO_APIC_irqs();
 	init_IO_APIC_traps();
 	check_timer();
-	print_IO_APIC();
+	if (!acpi_ioapic)
+		print_IO_APIC();
 }
 
 /* Ensure the ACPI SCI interrupt level is active low, edge-triggered */
diff -Nru a/arch/x86_64/kernel/ldt.c b/arch/x86_64/kernel/ldt.c
--- a/arch/x86_64/kernel/ldt.c	Tue Feb  3 19:45:42 2004
+++ b/arch/x86_64/kernel/ldt.c	Tue Feb  3 19:45:42 2004
@@ -107,7 +107,6 @@
 		retval = copy_ldt(&mm->context, &old_mm->context);
 		up(&old_mm->context.sem);
 	}
-	rwlock_init(&mm->context.ldtlock);
 	return retval;
 }
 
@@ -216,10 +215,8 @@
 
 	/* Install the new entry ...  */
 install:
-	write_lock(&mm->context.ldtlock); 
 	*lp	= entry_1;
 	*(lp+1)	= entry_2;
-	write_unlock(&mm->context.ldtlock);
 	error = 0;
 
 out_unlock:
diff -Nru a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c
--- a/arch/x86_64/kernel/mpparse.c	Tue Feb  3 19:45:17 2004
+++ b/arch/x86_64/kernel/mpparse.c	Tue Feb  3 19:45:17 2004
@@ -951,6 +951,8 @@
 			entry->irq);
 	}
 	
+	print_IO_APIC();
+
 	return;
 }
 
diff -Nru a/arch/x86_64/kernel/pci-dma.c b/arch/x86_64/kernel/pci-dma.c
--- a/arch/x86_64/kernel/pci-dma.c	Tue Feb  3 19:45:42 2004
+++ b/arch/x86_64/kernel/pci-dma.c	Tue Feb  3 19:45:42 2004
@@ -35,6 +35,7 @@
 		BUG_ON(!s->page); 
 			s->dma_address = pci_map_page(hwdev, s->page, s->offset, 
 						      s->length, direction); 
+		s->dma_length = s->length;
 	}
 	return nents;
 }
@@ -53,7 +54,7 @@
 		struct scatterlist *s = &sg[i];
 		BUG_ON(s->page == NULL); 
 		BUG_ON(s->dma_address == 0); 
-		pci_unmap_single(dev, s->dma_address, s->length, dir); 
+		pci_unmap_single(dev, s->dma_address, s->dma_length, dir); 
 	} 
 }
 
diff -Nru a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
--- a/arch/x86_64/kernel/pci-gart.c	Tue Feb  3 19:45:17 2004
+++ b/arch/x86_64/kernel/pci-gart.c	Tue Feb  3 19:45:17 2004
@@ -382,10 +382,12 @@
 				if (i > 0) 
 					pci_unmap_sg(dev, sg, i, dir); 
 				nents = 0; 
+				sg[0].dma_length = 0;
 				break;
 			}
 		}
 		s->dma_address = addr;
+		s->dma_length = s->length;
 	}
 	flush_gart(dev);
 	return nents;
@@ -412,8 +414,9 @@
 			*sout = *s; 
 			sout->dma_address = iommu_bus_base;
 			sout->dma_address += iommu_page*PAGE_SIZE + s->offset;
+			sout->dma_length = s->length;
 		} else { 
-			sout->length += s->length; 
+			sout->dma_length += s->length; 
 		}
 
 		addr = phys_addr;
@@ -436,6 +439,7 @@
 	if (!need) { 
 		BUG_ON(stopat - start != 1);
 		*sout = sg[start]; 
+		sout->dma_length = sg[start].length; 
 		return 0;
 	} 
 	return __pci_map_cont(sg, start, stopat, sout, pages);
@@ -453,8 +457,6 @@
 	unsigned long pages = 0;
 	int need = 0, nextneed;
 
-	unsigned long size = 0; 
-
 	BUG_ON(dir == PCI_DMA_NONE);
 	if (nents == 0) 
 		return 0;
@@ -466,7 +468,6 @@
 		s->dma_address = addr;
 		BUG_ON(s->length == 0); 
 
-		size += s->length; 
 		nextneed = need_iommu(dev, addr, s->length); 
 
 		/* Handle the previous not yet processed entries */
@@ -493,7 +494,7 @@
 	out++;
 	flush_gart(dev);
 	if (out < nents) 
-		sg[out].length = 0; 
+		sg[out].dma_length = 0; 
 	return out;
 
 error:
@@ -540,9 +541,9 @@
 	int i;
 	for (i = 0; i < nents; i++) { 
 		struct scatterlist *s = &sg[i];
-		if (!s->length) 
+		if (!s->dma_length || !s->length) 
 			break;
-		pci_unmap_single(dev, s->dma_address, s->length, dir);
+		pci_unmap_single(dev, s->dma_address, s->dma_length, dir);
 	}
 }
 
@@ -800,7 +801,8 @@
    merge  Do SG merging. Implies force (experimental)  
    nomerge Don't do SG merging.
    forcesac For SAC mode for masks <40bits  (experimental)
-   fullflush Flush IOMMU on each allocation (for testing)
+   fullflush Flush IOMMU on each allocation (default) 
+   nofullflush Don't use IOMMU fullflush
 */
 __init int iommu_setup(char *opt) 
 { 
@@ -838,6 +840,8 @@
 		    iommu_sac_force = 1;
 	    if (!memcmp(p, "fullflush", 9))
 		    iommu_fullflush = 1;
+	    if (!memcmp(p, "nofullflush", 11))
+		    iommu_fullflush = 0;
 #ifdef CONFIG_IOMMU_LEAK
 	    if (!memcmp(p,"leak", 4)) { 
 		    leak_trace = 1;
diff -Nru a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
--- a/arch/x86_64/kernel/process.c	Tue Feb  3 19:45:29 2004
+++ b/arch/x86_64/kernel/process.c	Tue Feb  3 19:45:29 2004
@@ -152,20 +152,6 @@
 
 __setup("idle=", idle_setup);
 
-void idle_warning(void) 
-{ 
-	static int warned;
-	if (warned)
-		return; 
-	warned = 1;
-	if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) 
-		BUG();
-	printk(KERN_ERR "******* Your BIOS seems to not contain a fix for K8 errata #93\n"); 
-	printk(KERN_ERR "******* Working around it, but it will cost you a lot of power\n");
-	printk(KERN_ERR "******* Please consider a BIOS update.\n");
-	printk(KERN_ERR "******* Disabling USB legacy in the BIOS may also help.\n");
-} 
-
 /* Prints also some state that isn't saved in the pt_regs */ 
 void __show_regs(struct pt_regs * regs)
 {
@@ -234,6 +220,10 @@
 void flush_thread(void)
 {
 	struct task_struct *tsk = current;
+	struct thread_info *t = current_thread_info();
+
+	if (t->flags & _TIF_ABI_PENDING)
+		t->flags ^= (_TIF_ABI_PENDING | _TIF_IA32);
 
 	tsk->thread.debugreg0 = 0;
 	tsk->thread.debugreg1 = 0;
@@ -439,7 +429,6 @@
 	write_pda(oldrsp, next->userrsp); 
 	write_pda(pcurrent, next_p); 
 	write_pda(kernelstack, (unsigned long)next_p->thread_info + THREAD_SIZE - PDA_STACKOFFSET);
-
 
 	/*
 	 * Now maybe reload the debug registers
diff -Nru a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
--- a/arch/x86_64/kernel/setup.c	Tue Feb  3 19:45:16 2004
+++ b/arch/x86_64/kernel/setup.c	Tue Feb  3 19:45:16 2004
@@ -65,7 +65,11 @@
 EXPORT_SYMBOL_GPL(mmu_cr4_features);
 
 int acpi_disabled = 0;
-int acpi_ht = 0;
+
+#ifdef	CONFIG_ACPI_BOOT
+extern int __initdata acpi_ht;
+/* int __initdata acpi_force = 0; */
+#endif
 
 /* For PCI or other memory-mapped resources */
 unsigned long pci_mem_start = 0x10000000;
@@ -195,6 +199,7 @@
 		if (c != ' ') 
 			goto next_char; 
  
+#ifdef CONFIG_ACPI_BOOT
 		/* "acpi=off" disables both ACPI table parsing and interpreter init */
 		if (!memcmp(from, "acpi=off", 8))
 			acpi_disabled = 1;
@@ -210,6 +215,7 @@
 		if (!memcmp(from, "acpi=ht", 7)) { 
 			acpi_ht = 1; 
 		}
+#endif
 
 		if (!memcmp(from, "nolapic", 7) ||
 		    !memcmp(from, "disableapic", 11))
diff -Nru a/arch/x86_64/kernel/sys_x86_64.c b/arch/x86_64/kernel/sys_x86_64.c
--- a/arch/x86_64/kernel/sys_x86_64.c	Tue Feb  3 19:45:33 2004
+++ b/arch/x86_64/kernel/sys_x86_64.c	Tue Feb  3 19:45:33 2004
@@ -65,43 +65,78 @@
 	return error;
 }
 
-unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags)
+static void find_start_end(unsigned long flags, unsigned long *begin,
+			   unsigned long *end)
 {
-	struct vm_area_struct *vma;
-	unsigned long end = TASK_SIZE;
-
 #ifdef CONFIG_IA32_EMULATION
 	if (test_thread_flag(TIF_IA32)) { 
-		if (!addr) 
-			addr = TASK_UNMAPPED_32;
-		end = IA32_PAGE_OFFSET; 
+		*begin = TASK_UNMAPPED_32;
+		*end = IA32_PAGE_OFFSET; 
 	} else 
 #endif
 	if (flags & MAP_32BIT) { 
-		/* This is usually used needed to map code in small model, so it needs to 
-		   be in the first 31bit. Limit it to that.
-		   This means we need to move the unmapped base down for this case. This can 
-		   give conflicts with the heap, but we assume that glibc malloc knows how 
-		   to fall back to mmap. Give it 1GB of playground for now. -AK */ 
-		if (!addr) 
-			addr = 0x40000000; 
-		end = 0x80000000;		
+		/* This is usually used needed to map code in small
+		   model, so it needs to be in the first 31bit. Limit
+		   it to that.  This means we need to move the
+		   unmapped base down for this case. This can give
+		   conflicts with the heap, but we assume that glibc
+		   malloc knows how to fall back to mmap. Give it 1GB
+		   of playground for now. -AK */ 
+		*begin = 0x40000000; 
+		*end = 0x80000000;		
 	} else { 
-		if (!addr) 
-			addr = TASK_UNMAPPED_64; 
-		end = TASK_SIZE; 
+		*begin = TASK_UNMAPPED_64; 
+		*end = TASK_SIZE; 
 		}
+} 
+
+unsigned long
+arch_get_unmapped_area(struct file *filp, unsigned long addr,
+		unsigned long len, unsigned long pgoff, unsigned long flags)
+{
+	struct mm_struct *mm = current->mm;
+	struct vm_area_struct *vma;
+	unsigned long start_addr;
+	unsigned long begin, end;
+	
+	find_start_end(flags, &begin, &end); 
 
 	if (len > end)
 		return -ENOMEM;
+
+	if (addr) {
 	addr = PAGE_ALIGN(addr);
+		vma = find_vma(mm, addr);
+		if (end - len >= addr &&
+		    (!vma || addr + len <= vma->vm_start))
+			return addr;
+	}
+	addr = mm->free_area_cache;
+	if (addr < begin) 
+		addr = begin; 
+	start_addr = addr;
 
-	for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) {
+full_search:
+	for (vma = find_vma(mm, addr); ; vma = vma->vm_next) {
 		/* At this point:  (!vma || addr < vma->vm_end). */
-		if (end - len < addr)
+		if (end - len < addr) {
+			/*
+			 * Start a new search - just in case we missed
+			 * some holes.
+			 */
+			if (start_addr != begin) {
+				start_addr = addr = begin;
+				goto full_search;
+			}
 			return -ENOMEM;
-		if (!vma || addr + len <= vma->vm_start)
+		}
+		if (!vma || addr + len <= vma->vm_start) {
+			/*
+			 * Remember the place where we stopped the search:
+			 */
+			mm->free_area_cache = addr + len;
 			return addr;
+		}
 		addr = vma->vm_end;
 	}
 }
diff -Nru a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
--- a/arch/x86_64/kernel/time.c	Tue Feb  3 19:45:34 2004
+++ b/arch/x86_64/kernel/time.c	Tue Feb  3 19:45:34 2004
@@ -10,6 +10,7 @@
  *  Copyright (c) 1998  Andrea Arcangeli
  *  Copyright (c) 2002  Vojtech Pavlik
  *  Copyright (c) 2003  Andi Kleen
+ *  RTC support code taken from arch/i386/kernel/timers/time_hpet.c
  *
  */
 
@@ -28,6 +29,7 @@
 #include <asm/vsyscall.h>
 #include <asm/timex.h>
 #include <asm/proto.h>
+#include <asm/hpet.h>
 #include <linux/cpufreq.h>
 #ifdef CONFIG_X86_LOCAL_APIC
 #include <asm/apic.h>
@@ -627,10 +629,10 @@
  * and period also hpet_tick.
  */
 
-	hpet_writel(HPET_T0_ENABLE | HPET_T0_PERIODIC | HPET_T0_SETVAL |
-		    HPET_T0_32BIT, HPET_T0_CFG);
-	hpet_writel(hpet_tick, HPET_T0_CMP);
+	hpet_writel(HPET_TN_ENABLE | HPET_TN_PERIODIC | HPET_TN_SETVAL |
+		    HPET_TN_32BIT, HPET_T0_CFG);
 	hpet_writel(hpet_tick, HPET_T0_CMP);
+	hpet_writel(hpet_tick, HPET_T0_CMP); /* AK: why twice? */
 
 /*
  * Go!
@@ -733,3 +735,229 @@
 }
 
 __setup("report_lost_ticks", time_setup);
+
+#ifdef CONFIG_HPET_EMULATE_RTC
+/* HPET in LegacyReplacement Mode eats up RTC interrupt line. When, HPET
+ * is enabled, we support RTC interrupt functionality in software.
+ * RTC has 3 kinds of interrupts:
+ * 1) Update Interrupt - generate an interrupt, every sec, when RTC clock
+ *    is updated
+ * 2) Alarm Interrupt - generate an interrupt at a specific time of day
+ * 3) Periodic Interrupt - generate periodic interrupt, with frequencies
+ *    2Hz-8192Hz (2Hz-64Hz for non-root user) (all freqs in powers of 2)
+ * (1) and (2) above are implemented using polling at a frequency of
+ * 64 Hz. The exact frequency is a tradeoff between accuracy and interrupt
+ * overhead. (DEFAULT_RTC_INT_FREQ)
+ * For (3), we use interrupts at 64Hz or user specified periodic
+ * frequency, whichever is higher.
+ */
+#include <linux/mc146818rtc.h>
+#include <linux/rtc.h>
+
+extern irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+
+#define DEFAULT_RTC_INT_FREQ 	64
+#define RTC_NUM_INTS 		1
+
+static unsigned long UIE_on;
+static unsigned long prev_update_sec;
+
+static unsigned long AIE_on;
+static struct rtc_time alarm_time;
+
+static unsigned long PIE_on;
+static unsigned long PIE_freq = DEFAULT_RTC_INT_FREQ;
+static unsigned long PIE_count;
+
+static unsigned long hpet_rtc_int_freq; /* RTC interrupt frequency */
+
+int is_hpet_enabled(void)
+{
+	return vxtime.hpet_address != 0;
+}
+
+/*
+ * Timer 1 for RTC, we do not use periodic interrupt feature,
+ * even if HPET supports periodic interrupts on Timer 1.
+ * The reason being, to set up a periodic interrupt in HPET, we need to
+ * stop the main counter. And if we do that everytime someone diables/enables
+ * RTC, we will have adverse effect on main kernel timer running on Timer 0.
+ * So, for the time being, simulate the periodic interrupt in software.
+ *
+ * hpet_rtc_timer_init() is called for the first time and during subsequent
+ * interuppts reinit happens through hpet_rtc_timer_reinit().
+ */
+int hpet_rtc_timer_init(void)
+{
+	unsigned int cfg, cnt;
+	unsigned long flags;
+
+	if (!is_hpet_enabled())
+		return 0;
+	/*
+	 * Set the counter 1 and enable the interrupts.
+	 */
+	if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ))
+		hpet_rtc_int_freq = PIE_freq;
+	else
+		hpet_rtc_int_freq = DEFAULT_RTC_INT_FREQ;
+
+	local_irq_save(flags);
+	cnt = hpet_readl(HPET_COUNTER);
+	cnt += ((hpet_tick*HZ)/hpet_rtc_int_freq);
+	hpet_writel(cnt, HPET_T1_CMP);
+	local_irq_restore(flags);
+
+	cfg = hpet_readl(HPET_T1_CFG);
+	cfg |= HPET_TN_ENABLE | HPET_TN_SETVAL | HPET_TN_32BIT;
+	hpet_writel(cfg, HPET_T1_CFG);
+
+	return 1;
+}
+
+static void hpet_rtc_timer_reinit(void)
+{
+	unsigned int cfg, cnt;
+
+	if (!(PIE_on | AIE_on | UIE_on))
+		return;
+
+	if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ))
+		hpet_rtc_int_freq = PIE_freq;
+	else
+		hpet_rtc_int_freq = DEFAULT_RTC_INT_FREQ;
+
+	/* It is more accurate to use the comparator value than current count.*/
+	cnt = hpet_readl(HPET_T1_CMP);
+	cnt += hpet_tick*HZ/hpet_rtc_int_freq;
+	hpet_writel(cnt, HPET_T1_CMP);
+
+	cfg = hpet_readl(HPET_T1_CFG);
+	cfg |= HPET_TN_ENABLE | HPET_TN_SETVAL | HPET_TN_32BIT;
+	hpet_writel(cfg, HPET_T1_CFG);
+
+	return;
+}
+
+/*
+ * The functions below are called from rtc driver.
+ * Return 0 if HPET is not being used.
+ * Otherwise do the necessary changes and return 1.
+ */
+int hpet_mask_rtc_irq_bit(unsigned long bit_mask)
+{
+	if (!is_hpet_enabled())
+		return 0;
+
+	if (bit_mask & RTC_UIE)
+		UIE_on = 0;
+	if (bit_mask & RTC_PIE)
+		PIE_on = 0;
+	if (bit_mask & RTC_AIE)
+		AIE_on = 0;
+
+	return 1;
+}
+
+int hpet_set_rtc_irq_bit(unsigned long bit_mask)
+{
+	int timer_init_reqd = 0;
+
+	if (!is_hpet_enabled())
+		return 0;
+
+	if (!(PIE_on | AIE_on | UIE_on))
+		timer_init_reqd = 1;
+
+	if (bit_mask & RTC_UIE) {
+		UIE_on = 1;
+	}
+	if (bit_mask & RTC_PIE) {
+		PIE_on = 1;
+		PIE_count = 0;
+	}
+	if (bit_mask & RTC_AIE) {
+		AIE_on = 1;
+	}
+
+	if (timer_init_reqd)
+		hpet_rtc_timer_init();
+
+	return 1;
+}
+
+int hpet_set_alarm_time(unsigned char hrs, unsigned char min, unsigned char sec)
+{
+	if (!is_hpet_enabled())
+		return 0;
+
+	alarm_time.tm_hour = hrs;
+	alarm_time.tm_min = min;
+	alarm_time.tm_sec = sec;
+
+	return 1;
+}
+
+int hpet_set_periodic_freq(unsigned long freq)
+{
+	if (!is_hpet_enabled())
+		return 0;
+
+	PIE_freq = freq;
+	PIE_count = 0;
+
+	return 1;
+}
+
+int hpet_rtc_dropped_irq(void)
+{
+	if (!is_hpet_enabled())
+		return 0;
+
+	return 1;
+}
+
+irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	struct rtc_time curr_time;
+	unsigned long rtc_int_flag = 0;
+	int call_rtc_interrupt = 0;
+
+	hpet_rtc_timer_reinit();
+
+	if (UIE_on | AIE_on) {
+		rtc_get_rtc_time(&curr_time);
+	}
+	if (UIE_on) {
+		if (curr_time.tm_sec != prev_update_sec) {
+			/* Set update int info, call real rtc int routine */
+			call_rtc_interrupt = 1;
+			rtc_int_flag = RTC_UF;
+			prev_update_sec = curr_time.tm_sec;
+		}
+	}
+	if (PIE_on) {
+		PIE_count++;
+		if (PIE_count >= hpet_rtc_int_freq/PIE_freq) {
+			/* Set periodic int info, call real rtc int routine */
+			call_rtc_interrupt = 1;
+			rtc_int_flag |= RTC_PF;
+			PIE_count = 0;
+		}
+	}
+	if (AIE_on) {
+		if ((curr_time.tm_sec == alarm_time.tm_sec) &&
+		    (curr_time.tm_min == alarm_time.tm_min) &&
+		    (curr_time.tm_hour == alarm_time.tm_hour)) {
+			/* Set alarm int info, call real rtc int routine */
+			call_rtc_interrupt = 1;
+			rtc_int_flag |= RTC_AF;
+		}
+	}
+	if (call_rtc_interrupt) {
+		rtc_int_flag |= (RTC_IRQF | (RTC_NUM_INTS << 8));
+		rtc_interrupt(rtc_int_flag, dev_id, regs);
+	}
+	return IRQ_HANDLED;
+}
+#endif
diff -Nru a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
--- a/arch/x86_64/kernel/traps.c	Tue Feb  3 19:45:16 2004
+++ b/arch/x86_64/kernel/traps.c	Tue Feb  3 19:45:16 2004
@@ -405,9 +405,7 @@
 	if ((regs->cs & 3)  != 0) { 
 		struct task_struct *tsk = current;
 
-		if (exception_trace && !(tsk->ptrace & PT_PTRACED) && 
-		    (tsk->sighand->action[signr-1].sa.sa_handler == SIG_IGN ||
-		    (tsk->sighand->action[signr-1].sa.sa_handler == SIG_DFL)))
+		if (exception_trace && unhandled_signal(tsk, signr))
 			printk(KERN_INFO
 			       "%s[%d] trap %s rip:%lx rsp:%lx error:%lx\n",
 			       tsk->comm, tsk->pid, str,
@@ -491,9 +489,7 @@
 	if ((regs->cs & 3)!=0) { 
 		struct task_struct *tsk = current;
 
-		if (exception_trace && !(tsk->ptrace & PT_PTRACED) && 
-		    (tsk->sighand->action[SIGSEGV-1].sa.sa_handler == SIG_IGN ||
-		    (tsk->sighand->action[SIGSEGV-1].sa.sa_handler == SIG_DFL)))
+		if (exception_trace && unhandled_signal(tsk, SIGSEGV))
 			printk(KERN_INFO
 		       "%s[%d] general protection rip:%lx rsp:%lx error:%lx\n",
 			       tsk->comm, tsk->pid,
@@ -553,6 +549,8 @@
 	unsigned char reason = inb(0x61);
 
 	if (!(reason & 0xc0)) {
+		if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT) == NOTIFY_BAD)
+			return;
 #ifdef CONFIG_X86_LOCAL_APIC
 		/*
 		 * Ok, so this is none of the documented NMI sources,
diff -Nru a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S
--- a/arch/x86_64/kernel/vmlinux.lds.S	Tue Feb  3 19:45:16 2004
+++ b/arch/x86_64/kernel/vmlinux.lds.S	Tue Feb  3 19:45:16 2004
@@ -3,6 +3,7 @@
  */
 
 #include <asm-generic/vmlinux.lds.h>
+#include <linux/config.h>
 
 OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
 OUTPUT_ARCH(i386:x86-64)
@@ -137,7 +138,9 @@
   /* Sections to be discarded */
   /DISCARD/ : {
 	*(.exitcall.exit)
+#ifndef CONFIG_DEBUG_INFO
 	*(.eh_frame)
+#endif
 	}
 
   /* DWARF 2 */
diff -Nru a/arch/x86_64/kernel/x8664_ksyms.c b/arch/x86_64/kernel/x8664_ksyms.c
--- a/arch/x86_64/kernel/x8664_ksyms.c	Tue Feb  3 19:45:17 2004
+++ b/arch/x86_64/kernel/x8664_ksyms.c	Tue Feb  3 19:45:17 2004
@@ -149,13 +149,11 @@
 #undef strncpy
 #undef strchr	
 #undef strcmp 
-#undef bcopy
 #undef strcpy 
 #undef strcat
 
 extern void * memset(void *,int,__kernel_size_t);
 extern size_t strlen(const char *);
-extern void bcopy(const char * src, char * dest, int count);
 extern void * memmove(void * dest,const void *src,size_t count);
 extern char * strcpy(char * dest,const char *src);
 extern int strcmp(const char * cs,const char * ct);
@@ -178,7 +176,6 @@
 EXPORT_SYMBOL_NOVERS(strrchr);
 EXPORT_SYMBOL_NOVERS(strnlen);
 EXPORT_SYMBOL_NOVERS(memscan);
-EXPORT_SYMBOL_NOVERS(bcopy);
 EXPORT_SYMBOL_NOVERS(memcpy);
 EXPORT_SYMBOL_NOVERS(__memcpy);
 
diff -Nru a/arch/x86_64/lib/thunk.S b/arch/x86_64/lib/thunk.S
--- a/arch/x86_64/lib/thunk.S	Tue Feb  3 19:45:17 2004
+++ b/arch/x86_64/lib/thunk.S	Tue Feb  3 19:45:17 2004
@@ -8,6 +8,7 @@
 
 	#include <linux/config.h>
 	#include <linux/linkage.h>
+	#include <asm/dwarf2.h>
 	#include <asm/calling.h>			
 	#include <asm/rwlock.h>
 		
@@ -15,18 +16,22 @@
 	.macro thunk name,func
 	.globl \name
 \name:	
+	CFI_STARTPROC
 	SAVE_ARGS
 	call \func
 	jmp  restore
+	CFI_ENDPROC
 	.endm
 
 	/* rdi:	arg1 ... normal C conventions. rax is passed from C. */ 	
 	.macro thunk_retrax name,func
 	.globl \name
 \name:	
+	CFI_STARTPROC
 	SAVE_ARGS
 	call \func
 	jmp  restore_norax
+	CFI_ENDPROC
 	.endm
 	
 
@@ -43,13 +48,20 @@
 	thunk_retrax __down_failed_trylock,__down_trylock
 	thunk __up_wakeup,__up
 	
+	/* SAVE_ARGS below is used only for the .cfi directives it contains. */
+	CFI_STARTPROC
+	SAVE_ARGS
 restore:
 	RESTORE_ARGS
 	ret	
+	CFI_ENDPROC
 	
+	CFI_STARTPROC
+	SAVE_ARGS
 restore_norax:	
 	RESTORE_ARGS 1
 	ret
+	CFI_ENDPROC
 
 #ifdef CONFIG_SMP
 /* Support for read/write spinlocks. */
diff -Nru a/arch/x86_64/lib/usercopy.c b/arch/x86_64/lib/usercopy.c
--- a/arch/x86_64/lib/usercopy.c	Tue Feb  3 19:45:16 2004
+++ b/arch/x86_64/lib/usercopy.c	Tue Feb  3 19:45:16 2004
@@ -88,7 +88,7 @@
 		"	.quad 1b,2b\n"
 		".previous"
 		: [size8] "=c"(size), [dst] "=&D" (__d0)
-		: [size1] "r"(size & 7), "[size8]" (size / 8), "[dst] "(addr),
+		: [size1] "r"(size & 7), "[size8]" (size / 8), "[dst]"(addr),
 		  [zero] "r" (0UL), [eight] "r" (8UL));
 	return size;
 }
diff -Nru a/arch/x86_64/mm/extable.c b/arch/x86_64/mm/extable.c
--- a/arch/x86_64/mm/extable.c	Tue Feb  3 19:45:42 2004
+++ b/arch/x86_64/mm/extable.c	Tue Feb  3 19:45:42 2004
@@ -36,10 +36,9 @@
 
 /* When an exception handler is in an non standard section (like __init)
    the fixup table can end up unordered. Fix that here. */
-static __init int check_extable(void)
+void sort_extable(struct exception_table_entry *start,
+		  struct exception_table_entry *finish)
 {
-	extern struct exception_table_entry __start___ex_table[];
-	extern struct exception_table_entry  __stop___ex_table[];
 	struct exception_table_entry *e;
 	int change;
 
@@ -47,7 +46,7 @@
 	   best (and simplest) sort algorithm. */
 	do {
 		change = 0;
-		for (e = __start___ex_table+1; e < __stop___ex_table; e++) {
+		for (e = start+1; e < finish; e++) {
 			if (e->insn < e[-1].insn) {
 				struct exception_table_entry tmp = e[-1];
 				e[-1] = e[0];
@@ -56,6 +55,4 @@
 			}
 		}
 	} while (change != 0);
-	return 0;
 }
-core_initcall(check_extable);
diff -Nru a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
--- a/arch/x86_64/mm/fault.c	Tue Feb  3 19:45:16 2004
+++ b/arch/x86_64/mm/fault.c	Tue Feb  3 19:45:16 2004
@@ -32,6 +32,7 @@
 #include <asm/tlbflush.h>
 #include <asm/proto.h>
 #include <asm/kdebug.h>
+#include <asm-generic/sections.h>
 
 void bust_spinlocks(int yes)
 {
@@ -169,8 +170,45 @@
 	printk("BAD\n");
 }
 
-static inline int unhandled_signal(struct task_struct *tsk, int sig)
+static const char errata93_warning[] = 
+KERN_ERR "******* Your BIOS seems to not contain a fix for K8 errata #93\n"
+KERN_ERR "******* Working around it, but it may cause SEGVs or burn power.\n"
+KERN_ERR "******* Please consider a BIOS update.\n"
+KERN_ERR "******* Disabling USB legacy in the BIOS may also help.\n";
+
+/* Workaround for K8 erratum #93 & buggy BIOS.
+   BIOS SMM functions are required to use a specific workaround
+   to avoid corruption of the 64bit RIP register on C stepping K8. 
+   A lot of BIOS that didn't get tested properly miss this. 
+   The OS sees this as a page fault with the upper 32bits of RIP cleared.
+   Try to work around it here.
+   Note we only handle faults in kernel here. */
+
+static int is_errata93(struct pt_regs *regs, unsigned long address) 
+{
+	static int warned;
+	if (address != regs->rip)
+		return 0;
+	if ((address >> 32) != 0) 
+		return 0;
+	address |= 0xffffffffUL << 32;
+	if ((address >= (u64)_stext && address <= (u64)_etext) || 
+	    (address >= MODULES_VADDR && address <= MODULES_END)) { 
+		if (!warned) {
+			printk(errata93_warning); 		
+			warned = 1;
+		}
+		regs->rip = address;
+		return 1;
+	}
+	return 0;
+} 
+
+int unhandled_signal(struct task_struct *tsk, int sig)
 {
+	/* Warn for strace, but not for gdb */
+	if ((tsk->ptrace & (PT_PTRACED|PT_TRACESYSGOOD)) == PT_PTRACED)
+		return 0;
 	return (tsk->sighand->action[sig-1].sa.sa_handler == SIG_IGN) ||
 		(tsk->sighand->action[sig-1].sa.sa_handler == SIG_DFL);
 }
@@ -331,8 +369,7 @@
 		if (is_prefetch(regs, address))
 			return;
 
-		if (exception_trace && !(tsk->ptrace & PT_PTRACED) && 
-		    !unhandled_signal(tsk, SIGSEGV)) { 
+		if (exception_trace && !unhandled_signal(tsk, SIGSEGV)) { 
 		printk(KERN_INFO 
 		       "%s[%d]: segfault at %016lx rip %016lx rsp %016lx error %lx\n",
 					tsk->comm, tsk->pid, address, regs->rip,
@@ -360,8 +397,15 @@
 		return;
 	}
 
+	/* 
+	 * Hall of shame of CPU/BIOS bugs.
+	 */
+
  	if (is_prefetch(regs, address))
  		return;
+
+	if (is_errata93(regs, address))
+		return; 
 
 /*
  * Oops. The kernel tried to access some bad page. We'll have to
diff -Nru a/arch/x86_64/mm/k8topology.c b/arch/x86_64/mm/k8topology.c
--- a/arch/x86_64/mm/k8topology.c	Tue Feb  3 19:45:42 2004
+++ b/arch/x86_64/mm/k8topology.c	Tue Feb  3 19:45:42 2004
@@ -47,7 +47,7 @@
 	struct node nodes[MAXNODE];
 	int nodeid, i, nb; 
 	int found = 0;
-	int nmax; 
+	u32 reg;
 
 	nb = find_northbridge(); 
 	if (nb < 0) 
@@ -55,8 +55,10 @@
 
 	printk(KERN_INFO "Scanning NUMA topology in Northbridge %d\n", nb); 
 
-	nmax = (1 << ((read_pci_config(0, nb, 0, 0x60 ) >> 4) & 3)); 
-	numnodes = nmax;
+	reg = read_pci_config(0, nb, 0, 0x60); 
+	numnodes =  ((reg >> 4) & 7) + 1; 
+
+	printk(KERN_INFO "Number of nodes %d (%x)\n", numnodes, reg);
 
 	memset(&nodes,0,sizeof(nodes)); 
 	prevbase = 0;
@@ -66,10 +68,15 @@
 		base = read_pci_config(0, nb, 1, 0x40 + i*8);
 		limit = read_pci_config(0, nb, 1, 0x44 + i*8);
 
-		nodeid = limit & 3; 
+		nodeid = limit & 7; 
 		if ((base & 3) == 0) { 
-			if (i < nmax) 
+			if (i < numnodes) 
 				printk("Skipping disabled node %d\n", i); 
+			continue;
+		} 
+		if (nodeid >= numnodes) { 
+			printk("Ignoring excess node %d (%lx:%lx)\n", nodeid,
+			       base, limit); 
 			continue;
 		} 
 
diff -Nru a/crypto/sha256.c b/crypto/sha256.c
--- a/crypto/sha256.c	Tue Feb  3 19:45:17 2004
+++ b/crypto/sha256.c	Tue Feb  3 19:45:17 2004
@@ -295,7 +295,7 @@
 	u8 bits[8];
 	unsigned int index, pad_len, t;
 	int i, j;
-	const u8 padding[64] = { 0x80, };
+	static const u8 padding[64] = { 0x80, };
 
 	/* Save number of bits */
 	t = sctx->count[0];
diff -Nru a/drivers/Kconfig b/drivers/Kconfig
--- a/drivers/Kconfig	Tue Feb  3 19:45:42 2004
+++ b/drivers/Kconfig	Tue Feb  3 19:45:42 2004
@@ -38,6 +38,8 @@
 
 source "drivers/char/Kconfig"
 
+source "drivers/i2c/Kconfig"
+
 # source "drivers/misc/Kconfig"
 
 source "drivers/media/Kconfig"
diff -Nru a/drivers/acorn/char/i2c.c b/drivers/acorn/char/i2c.c
--- a/drivers/acorn/char/i2c.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/acorn/char/i2c.c	Tue Feb  3 19:45:43 2004
@@ -167,6 +167,7 @@
 		break;
 
 	case RTC_RD_TIME:
+		memset(&rtctm, 0, sizeof(struct rtc_time));
 		get_rtc_time(&rtc_raw, &year);
 		rtctm.tm_sec  = rtc_raw.secs;
 		rtctm.tm_min  = rtc_raw.mins;
diff -Nru a/drivers/acpi/ac.c b/drivers/acpi/ac.c
--- a/drivers/acpi/ac.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/ac.c	Tue Feb  3 19:45:17 2004
@@ -108,7 +108,7 @@
                               FS Interface (/proc)
    -------------------------------------------------------------------------- */
 
-struct proc_dir_entry		*acpi_ac_dir = NULL;
+struct proc_dir_entry		*acpi_ac_dir;
 
 int acpi_ac_seq_show(struct seq_file *seq, void *offset)
 {
diff -Nru a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
--- a/drivers/acpi/asus_acpi.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/asus_acpi.c	Tue Feb  3 19:45:17 2004
@@ -73,8 +73,8 @@
 MODULE_LICENSE("GPL");
 
 
-static uid_t asus_uid = 0;
-static gid_t asus_gid = 0;
+static uid_t asus_uid;
+static gid_t asus_gid;
 MODULE_PARM(asus_uid, "i");
 MODULE_PARM_DESC(uid, "UID for entries in /proc/acpi/asus.\n");
 MODULE_PARM(asus_gid, "i");
@@ -192,14 +192,14 @@
 };
 
 /* procdir we use */
-static struct proc_dir_entry *asus_proc_dir = NULL;
+static struct proc_dir_entry *asus_proc_dir;
 
 /*
  * This header is made available to allow proper configuration given model,
  * revision number , ... this info cannot go in struct asus_hotk because it is
  * available before the hotk
  */
-static struct acpi_table_header *asus_info = NULL;
+static struct acpi_table_header *asus_info;
 
 /*
  * The hotkey driver declaration
diff -Nru a/drivers/acpi/battery.c b/drivers/acpi/battery.c
--- a/drivers/acpi/battery.c	Tue Feb  3 19:45:35 2004
+++ b/drivers/acpi/battery.c	Tue Feb  3 19:45:35 2004
@@ -340,7 +340,7 @@
                               FS Interface (/proc)
    -------------------------------------------------------------------------- */
 
-struct proc_dir_entry		*acpi_battery_dir = NULL;
+struct proc_dir_entry		*acpi_battery_dir;
 
 static int
 acpi_battery_read_info (
diff -Nru a/drivers/acpi/bus.c b/drivers/acpi/bus.c
--- a/drivers/acpi/bus.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/acpi/bus.c	Tue Feb  3 19:45:30 2004
@@ -39,7 +39,7 @@
 #define _COMPONENT		ACPI_BUS_COMPONENT
 ACPI_MODULE_NAME		("acpi_bus")
 
-extern void acpi_pic_set_level_irq(unsigned int irq);
+extern void __init acpi_pic_sci_set_trigger(unsigned int irq);
 
 FADT_DESCRIPTOR			acpi_fadt;
 struct acpi_device		*acpi_root;
@@ -615,7 +615,7 @@
 	if (acpi_ioapic)
 		mp_config_ioapic_for_sci(acpi_fadt.sci_int);
 	else
-		acpi_pic_set_level_irq(acpi_fadt.sci_int);
+		acpi_pic_sci_set_trigger(acpi_fadt.sci_int);
 #endif
 
 	status = acpi_enable_subsystem(ACPI_FULL_INITIALIZATION);
diff -Nru a/drivers/acpi/button.c b/drivers/acpi/button.c
--- a/drivers/acpi/button.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/button.c	Tue Feb  3 19:45:16 2004
@@ -107,7 +107,7 @@
                               FS Interface (/proc)
    -------------------------------------------------------------------------- */
 
-static struct proc_dir_entry	*acpi_button_dir = NULL;
+static struct proc_dir_entry	*acpi_button_dir;
 
 static int acpi_button_info_seq_show(struct seq_file *seq, void *offset)
 {
diff -Nru a/drivers/acpi/dispatcher/dsfield.c b/drivers/acpi/dispatcher/dsfield.c
--- a/drivers/acpi/dispatcher/dsfield.c	Tue Feb  3 19:45:33 2004
+++ b/drivers/acpi/dispatcher/dsfield.c	Tue Feb  3 19:45:33 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/dispatcher/dsinit.c b/drivers/acpi/dispatcher/dsinit.c
--- a/drivers/acpi/dispatcher/dsinit.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/acpi/dispatcher/dsinit.c	Tue Feb  3 19:45:42 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -106,7 +106,7 @@
 		status = acpi_ds_initialize_region (obj_handle);
 		if (ACPI_FAILURE (status)) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region %p [%4.4s] - Init failure, %s\n",
-				obj_handle, ((struct acpi_namespace_node *) obj_handle)->name.ascii,
+				obj_handle, acpi_ut_get_node_name (obj_handle),
 				acpi_format_exception (status)));
 		}
 
@@ -141,7 +141,7 @@
 		status = acpi_ds_parse_method (obj_handle);
 		if (ACPI_FAILURE (status)) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Method %p [%4.4s] - parse failure, %s\n",
-				obj_handle, ((struct acpi_namespace_node *) obj_handle)->name.ascii,
+				obj_handle, acpi_ut_get_node_name (obj_handle),
 				acpi_format_exception (status)));
 
 			/* This parse failed, but we will continue parsing more methods */
diff -Nru a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
--- a/drivers/acpi/dispatcher/dsmethod.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/acpi/dispatcher/dsmethod.c	Tue Feb  3 19:45:18 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -94,7 +94,7 @@
 	}
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Parsing [%4.4s] **** named_obj=%p\n",
-		((struct acpi_namespace_node *) obj_handle)->name.ascii, obj_handle));
+		acpi_ut_get_node_name (obj_handle), obj_handle));
 
 	/* Extract the method object from the method Node */
 
@@ -169,7 +169,7 @@
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
 		"**** [%4.4s] Parsed **** named_obj=%p Op=%p\n",
-		((struct acpi_namespace_node *) obj_handle)->name.ascii, obj_handle, op));
+		acpi_ut_get_node_name (obj_handle), obj_handle, op));
 
 	acpi_ps_delete_parse_tree (op);
 	return_ACPI_STATUS (status);
diff -Nru a/drivers/acpi/dispatcher/dsmthdat.c b/drivers/acpi/dispatcher/dsmthdat.c
--- a/drivers/acpi/dispatcher/dsmthdat.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/dispatcher/dsmthdat.c	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -203,9 +203,10 @@
 	while ((index < ACPI_METHOD_NUM_ARGS) && (index < max_param_count) && params[index]) {
 		/*
 		 * A valid parameter.
-		 * Store the argument in the method/walk descriptor
+		 * Store the argument in the method/walk descriptor.
+		 * Do not copy the arg in order to implement call by reference
 		 */
-		status = acpi_ds_store_object_to_local (AML_ARG_OP, index, params[index],
+		status = acpi_ds_method_data_set_value (AML_ARG_OP, index, params[index],
 				 walk_state);
 		if (ACPI_FAILURE (status)) {
 			return_ACPI_STATUS (status);
@@ -567,13 +568,13 @@
 	acpi_status                     status;
 	struct acpi_namespace_node      *node;
 	union acpi_operand_object       *current_obj_desc;
+	union acpi_operand_object       *new_obj_desc;
 
 
 	ACPI_FUNCTION_TRACE ("ds_store_object_to_local");
 	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode=%d Idx=%d Obj=%p\n",
 		opcode, index, obj_desc));
 
-
 	/* Parameter validation */
 
 	if (!obj_desc) {
@@ -595,6 +596,18 @@
 	}
 
 	/*
+	 * If the reference count on the object is more than one, we must
+	 * take a copy of the object before we store.
+	 */
+	new_obj_desc = obj_desc;
+	if (obj_desc->common.reference_count > 1) {
+		status = acpi_ut_copy_iobject_to_iobject (obj_desc, &new_obj_desc, walk_state);
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+		}
+	}
+
+	/*
 	 * If there is an object already in this slot, we either
 	 * have to delete it, or if this is an argument and there
 	 * is an object reference stored there, we have to do
@@ -624,8 +637,8 @@
 			 * operand objects of type Reference.
 			 */
 			if (ACPI_GET_DESCRIPTOR_TYPE (current_obj_desc) != ACPI_DESC_TYPE_OPERAND) {
-				ACPI_REPORT_ERROR (("Invalid descriptor type while storing to method arg: %X\n",
-					current_obj_desc->common.type));
+				ACPI_REPORT_ERROR (("Invalid descriptor type while storing to method arg: [%s]\n",
+						acpi_ut_get_descriptor_name (current_obj_desc)));
 				return_ACPI_STATUS (AE_AML_INTERNAL);
 			}
 
@@ -636,15 +649,21 @@
 			if ((current_obj_desc->common.type == ACPI_TYPE_LOCAL_REFERENCE) &&
 				(current_obj_desc->reference.opcode == AML_REF_OF_OP)) {
 				ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
-					"Arg (%p) is an obj_ref(Node), storing in node %p\n",
-					obj_desc, current_obj_desc));
+						"Arg (%p) is an obj_ref(Node), storing in node %p\n",
+						new_obj_desc, current_obj_desc));
 
 				/*
 				 * Store this object to the Node
 				 * (perform the indirect store)
 				 */
-				status = acpi_ex_store_object_to_node (obj_desc,
+				status = acpi_ex_store_object_to_node (new_obj_desc,
 						 current_obj_desc->reference.object, walk_state);
+
+				/* Remove local reference if we copied the object above */
+
+				if (new_obj_desc != obj_desc) {
+					acpi_ut_remove_reference (new_obj_desc);
+				}
 				return_ACPI_STATUS (status);
 			}
 		}
@@ -657,12 +676,18 @@
 	}
 
 	/*
-	 * Install the obj_stack descriptor (*obj_desc) into
+	 * Install the Obj descriptor (*new_obj_desc) into
 	 * the descriptor for the Arg or Local.
-	 * Install the new object in the stack entry
 	 * (increments the object reference count by one)
 	 */
-	status = acpi_ds_method_data_set_value (opcode, index, obj_desc, walk_state);
+	status = acpi_ds_method_data_set_value (opcode, index, new_obj_desc, walk_state);
+
+	/* Remove local reference if we copied the object above */
+
+	if (new_obj_desc != obj_desc) {
+		acpi_ut_remove_reference (new_obj_desc);
+	}
+
 	return_ACPI_STATUS (status);
 }
 
diff -Nru a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c
--- a/drivers/acpi/dispatcher/dsobject.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/dispatcher/dsobject.c	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c
--- a/drivers/acpi/dispatcher/dsopcode.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/acpi/dispatcher/dsopcode.c	Tue Feb  3 19:45:41 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -201,7 +201,7 @@
 
 	ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (ACPI_TYPE_BUFFER_FIELD, node, NULL));
 	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] buffer_field Arg Init\n",
-		node->name.ascii));
+		acpi_ut_get_node_name (node)));
 
 	/* Execute the AML code for the term_arg arguments */
 
@@ -346,7 +346,7 @@
 	ACPI_DEBUG_EXEC (acpi_ut_display_init_pathname (ACPI_TYPE_REGION, node, NULL));
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] op_region Arg Init at AML %p\n",
-		node->name.ascii, extra_desc->extra.aml_start));
+		acpi_ut_get_node_name (node), extra_desc->extra.aml_start));
 
 	/* Execute the argument AML */
 
@@ -438,8 +438,8 @@
 	 * after resolution in acpi_ex_resolve_operands().
 	 */
 	if (ACPI_GET_DESCRIPTOR_TYPE (result_desc) != ACPI_DESC_TYPE_NAMED) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) destination must be a NS Node\n",
-			acpi_ps_get_opcode_name (aml_opcode)));
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) destination not a NS Node [%s]\n",
+				acpi_ps_get_opcode_name (aml_opcode), acpi_ut_get_descriptor_name (result_desc)));
 
 		status = AE_AML_OPERAND_TYPE;
 		goto cleanup;
@@ -514,14 +514,16 @@
 		goto cleanup;
 	}
 
-
 	/* Entire field must fit within the current length of the buffer */
 
 	if ((bit_offset + bit_count) >
 		(8 * (u32) buffer_desc->buffer.length)) {
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-			"Field size %d exceeds Buffer size %d (bits)\n",
-			 bit_offset + bit_count, 8 * (u32) buffer_desc->buffer.length));
+			"Field [%4.4s] size %d exceeds Buffer [%4.4s] size %d (bits)\n",
+			 acpi_ut_get_node_name (result_desc),
+			 bit_offset + bit_count,
+			 acpi_ut_get_node_name (buffer_desc->buffer.node),
+			 8 * (u32) buffer_desc->buffer.length));
 		status = AE_AML_BUFFER_LIMIT;
 		goto cleanup;
 	}
@@ -742,7 +744,7 @@
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "rgn_obj %p Addr %8.8X%8.8X Len %X\n",
 		obj_desc,
-		ACPI_HIDWORD (obj_desc->region.address), ACPI_LODWORD (obj_desc->region.address),
+		ACPI_FORMAT_UINT64 (obj_desc->region.address),
 		obj_desc->region.length));
 
 	/* Now the address and length are valid for this opregion */
diff -Nru a/drivers/acpi/dispatcher/dsutils.c b/drivers/acpi/dispatcher/dsutils.c
--- a/drivers/acpi/dispatcher/dsutils.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/dispatcher/dsutils.c	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c
--- a/drivers/acpi/dispatcher/dswexec.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/acpi/dispatcher/dswexec.c	Tue Feb  3 19:45:42 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -416,10 +416,24 @@
 			status = acpi_gbl_op_type_dispatch [op_type] (walk_state);
 		}
 		else {
-			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-				"[%s]: Could not resolve operands, %s\n",
-				acpi_ps_get_opcode_name (walk_state->opcode),
-				acpi_format_exception (status)));
+			/*
+			 * Treat constructs of the form "Store(local_x,local_x)" as noops when the
+			 * Local is uninitialized.
+			 */
+			if  ((status == AE_AML_UNINITIALIZED_LOCAL) &&
+				(walk_state->opcode == AML_STORE_OP) &&
+				(walk_state->operands[0]->common.type == ACPI_TYPE_LOCAL_REFERENCE) &&
+				(walk_state->operands[1]->common.type == ACPI_TYPE_LOCAL_REFERENCE) &&
+				(walk_state->operands[0]->reference.opcode ==
+				 walk_state->operands[1]->reference.opcode)) {
+				status = AE_OK;
+			}
+			else {
+				ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+					"[%s]: Could not resolve operands, %s\n",
+					acpi_ps_get_opcode_name (walk_state->opcode),
+					acpi_format_exception (status)));
+			}
 		}
 
 		/* Always delete the argument objects and clear the operand stack */
diff -Nru a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c
--- a/drivers/acpi/dispatcher/dswload.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/dispatcher/dswload.c	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -167,7 +167,7 @@
 	object_type = walk_state->op_info->object_type;
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-		"State=%p Op=%p [%s] ", walk_state, op, acpi_ut_get_type_name (object_type)));
+		"State=%p Op=%p [%s]\n", walk_state, op, acpi_ut_get_type_name (object_type)));
 
 	switch (walk_state->opcode) {
 	case AML_SCOPE_OP:
@@ -260,10 +260,12 @@
 		if ((walk_state->opcode != AML_SCOPE_OP) &&
 			(!(walk_state->parse_flags & ACPI_PARSE_DEFERRED_OP))) {
 			flags |= ACPI_NS_ERROR_IF_FOUND;
-			ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Cannot already exist\n"));
+			ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Cannot already exist\n",
+					acpi_ut_get_type_name (object_type)));
 		}
 		else {
-			ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Both Find or Create allowed\n"));
+			ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Both Find or Create allowed\n",
+					acpi_ut_get_type_name (object_type)));
 		}
 
 		/*
diff -Nru a/drivers/acpi/dispatcher/dswscope.c b/drivers/acpi/dispatcher/dswscope.c
--- a/drivers/acpi/dispatcher/dswscope.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/acpi/dispatcher/dswscope.c	Tue Feb  3 19:45:43 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -146,7 +146,7 @@
 	if (old_scope_info) {
 		ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
 			"[%4.4s] (%s)",
-			old_scope_info->scope.node->name.ascii,
+			acpi_ut_get_node_name (old_scope_info->scope.node),
 			acpi_ut_get_type_name (old_scope_info->common.value)));
 	}
 	else {
@@ -156,7 +156,7 @@
 
 	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
 		", New scope -> [%4.4s] (%s)\n",
-		scope_info->scope.node->name.ascii,
+		acpi_ut_get_node_name (scope_info->scope.node),
 		acpi_ut_get_type_name (scope_info->common.value)));
 
 	/* Push new scope object onto stack */
@@ -207,14 +207,14 @@
 	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
 		"[%.2d] Popped scope [%4.4s] (%s), New scope -> ",
 		(u32) walk_state->scope_depth,
-		scope_info->scope.node->name.ascii,
+		acpi_ut_get_node_name (scope_info->scope.node),
 		acpi_ut_get_type_name (scope_info->common.value)));
 
 	new_scope_info = walk_state->scope_info;
 	if (new_scope_info) {
 		ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
 			"[%4.4s] (%s)\n",
-			new_scope_info->scope.node->name.ascii,
+			acpi_ut_get_node_name (new_scope_info->scope.node),
 			acpi_ut_get_type_name (new_scope_info->common.value)));
 	}
 	else {
diff -Nru a/drivers/acpi/dispatcher/dswstate.c b/drivers/acpi/dispatcher/dswstate.c
--- a/drivers/acpi/dispatcher/dswstate.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/acpi/dispatcher/dswstate.c	Tue Feb  3 19:45:41 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/ec.c b/drivers/acpi/ec.c
--- a/drivers/acpi/ec.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/acpi/ec.c	Tue Feb  3 19:45:28 2004
@@ -475,7 +475,7 @@
                               FS Interface (/proc)
    -------------------------------------------------------------------------- */
 
-struct proc_dir_entry		*acpi_ec_dir = NULL;
+struct proc_dir_entry		*acpi_ec_dir;
 
 
 static int
diff -Nru a/drivers/acpi/events/evevent.c b/drivers/acpi/events/evevent.c
--- a/drivers/acpi/events/evevent.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/acpi/events/evevent.c	Tue Feb  3 19:45:41 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
--- a/drivers/acpi/events/evgpe.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/acpi/events/evgpe.c	Tue Feb  3 19:45:29 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -139,12 +139,10 @@
 {
 	u32                             int_status = ACPI_INTERRUPT_NOT_HANDLED;
 	u8                              enabled_status_byte;
-	u8                              bit_mask;
 	struct acpi_gpe_register_info   *gpe_register_info;
 	u32                             in_value;
 	acpi_status                     status;
 	struct acpi_gpe_block_info      *gpe_block;
-	u32                             gpe_number;
 	u32                             i;
 	u32                             j;
 
@@ -187,11 +185,9 @@
 
 			ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
 				"GPE pair: Status %8.8X%8.8X = %02X, Enable %8.8X%8.8X = %02X\n",
-				ACPI_HIDWORD (gpe_register_info->status_address.address),
-				ACPI_LODWORD (gpe_register_info->status_address.address),
+				ACPI_FORMAT_UINT64 (gpe_register_info->status_address.address),
 				gpe_register_info->status,
-				ACPI_HIDWORD (gpe_register_info->enable_address.address),
-				ACPI_LODWORD (gpe_register_info->enable_address.address),
+				ACPI_FORMAT_UINT64 (gpe_register_info->enable_address.address),
 				gpe_register_info->enable));
 
 			/* First check if there is anything active at all in this register */
@@ -206,19 +202,17 @@
 
 			/* Now look at the individual GPEs in this byte register */
 
-			for (j = 0, bit_mask = 1; j < ACPI_GPE_REGISTER_WIDTH; j++, bit_mask <<= 1) {
+			for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) {
 				/* Examine one GPE bit */
 
-				if (enabled_status_byte & bit_mask) {
+				if (enabled_status_byte & acpi_gbl_decode_to8bit[j]) {
 					/*
 					 * Found an active GPE. Dispatch the event to a handler
 					 * or method.
 					 */
-					gpe_number = (i * ACPI_GPE_REGISTER_WIDTH) + j;
-
 					int_status |= acpi_ev_gpe_dispatch (
-							&gpe_block->event_info[gpe_number],
-							j + gpe_register_info->base_gpe_number);
+							  &gpe_block->event_info[(i * ACPI_GPE_REGISTER_WIDTH) + j],
+							  j + gpe_register_info->base_gpe_number);
 				}
 			}
 		}
@@ -294,7 +288,7 @@
 		if (ACPI_FAILURE (status)) {
 			ACPI_REPORT_ERROR (("%s while evaluating method [%4.4s] for GPE[%2X]\n",
 				acpi_format_exception (status),
-				local_gpe_event_info.method_node->name.ascii, gpe_number));
+				acpi_ut_get_node_name (local_gpe_event_info.method_node), gpe_number));
 		}
 	}
 
@@ -367,6 +361,18 @@
 		/* Invoke the installed handler (at interrupt level) */
 
 		gpe_event_info->handler (gpe_event_info->context);
+
+		/* It is now safe to clear level-triggered events. */
+
+		if (gpe_event_info->flags & ACPI_EVENT_LEVEL_TRIGGERED) {
+			status = acpi_hw_clear_gpe (gpe_event_info);
+			if (ACPI_FAILURE (status)) {
+				ACPI_REPORT_ERROR ((
+					"acpi_ev_gpe_dispatch: Unable to clear GPE[%2X]\n",
+					gpe_number));
+				return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
+			}
+		}
 	}
 	else if (gpe_event_info->method_node) {
 		/*
@@ -375,13 +381,16 @@
 		 */
 		status = acpi_hw_disable_gpe (gpe_event_info);
 		if (ACPI_FAILURE (status)) {
-			ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n",
+			ACPI_REPORT_ERROR ((
+				"acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n",
 				gpe_number));
 			return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
 		}
 
-		/* Execute the method associated with the GPE. */
-
+		/*
+		 * Execute the method associated with the GPE
+		 * NOTE: Level-triggered GPEs are cleared after the method completes.
+		 */
 		if (ACPI_FAILURE (acpi_os_queue_for_execution (OSD_PRIORITY_GPE,
 				 acpi_ev_asynch_execute_gpe_method,
 				 gpe_event_info))) {
@@ -399,22 +408,12 @@
 
 		/*
 		 * Disable the GPE.  The GPE will remain disabled until the ACPI
-		 * Core Subsystem is restarted, or the handler is reinstalled.
+		 * Core Subsystem is restarted, or a handler is installed.
 		 */
 		status = acpi_hw_disable_gpe (gpe_event_info);
 		if (ACPI_FAILURE (status)) {
-			ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n",
-				gpe_number));
-			return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
-		}
-	}
-
-	/* It is now safe to clear level-triggered events. */
-
-	if (gpe_event_info->flags & ACPI_EVENT_LEVEL_TRIGGERED) {
-		status = acpi_hw_clear_gpe (gpe_event_info);
-		if (ACPI_FAILURE (status)) {
-			ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: Unable to clear GPE[%2X]\n",
+			ACPI_REPORT_ERROR ((
+				"acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n",
 				gpe_number));
 			return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
 		}
diff -Nru a/drivers/acpi/events/evgpeblk.c b/drivers/acpi/events/evgpeblk.c
--- a/drivers/acpi/events/evgpeblk.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/acpi/events/evgpeblk.c	Tue Feb  3 19:45:28 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -477,7 +477,7 @@
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Install new GPE block with mutex support
+ * DESCRIPTION: Remove a GPE block
  *
  ******************************************************************************/
 
@@ -743,8 +743,7 @@
 				((gpe_block->register_count * ACPI_GPE_REGISTER_WIDTH) -1)),
 		gpe_device->name.ascii,
 		gpe_block->register_count,
-		ACPI_HIDWORD (gpe_block->block_address.address),
-		ACPI_LODWORD (gpe_block->block_address.address),
+		ACPI_FORMAT_UINT64 (gpe_block->block_address.address),
 		interrupt_level));
 
 	/* Find all GPE methods (_Lxx, _Exx) for this block */
diff -Nru a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
--- a/drivers/acpi/events/evmisc.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/acpi/events/evmisc.c	Tue Feb  3 19:45:29 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -195,7 +195,8 @@
 		/* There is no per-device notify handler for this device */
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
-			"No notify handler for [%4.4s] node %p\n", node->name.ascii, node));
+			"No notify handler for [%4.4s] node %p\n",
+			acpi_ut_get_node_name (node), node));
 	}
 
 	return (status);
diff -Nru a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c
--- a/drivers/acpi/events/evregion.c	Tue Feb  3 19:45:33 2004
+++ b/drivers/acpi/events/evregion.c	Tue Feb  3 19:45:33 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -52,7 +52,7 @@
 
 #define ACPI_NUM_DEFAULT_SPACES     4
 
-u8                              acpi_gbl_default_address_spaces[ACPI_NUM_DEFAULT_SPACES] = {
+static u8                   acpi_gbl_default_address_spaces[ACPI_NUM_DEFAULT_SPACES] = {
 			 ACPI_ADR_SPACE_SYSTEM_MEMORY,
 			 ACPI_ADR_SPACE_SYSTEM_IO,
 			 ACPI_ADR_SPACE_PCI_CONFIG,
@@ -136,7 +136,7 @@
  *
  ******************************************************************************/
 
-static acpi_status
+acpi_status
 acpi_ev_execute_reg_method (
 	union acpi_operand_object      *region_obj,
 	u32                             function)
@@ -202,7 +202,7 @@
  *
  * FUNCTION:    acpi_ev_address_space_dispatch
  *
- * PARAMETERS:  region_obj          - internal region object
+ * PARAMETERS:  region_obj          - Internal region object
  *              space_id            - ID of the address space (0-255)
  *              Function            - Read or Write operation
  *              Address             - Where in the space to read or write
@@ -243,9 +243,11 @@
 
 	/* Ensure that there is a handler associated with this region */
 
-	handler_desc = region_obj->region.address_space;
+	handler_desc = region_obj->region.handler;
 	if (!handler_desc) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "no handler for region(%p) [%s]\n",
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+			"No handler for Region [%4.4s] (%p) [%s]\n",
+			acpi_ut_get_node_name (region_obj->region.node),
 			region_obj, acpi_ut_get_region_name (region_obj->region.space_id)));
 
 		return_ACPI_STATUS (AE_NOT_EXIST);
@@ -320,8 +322,8 @@
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
 		"Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
-		&region_obj->region.address_space->address_space, handler,
-		ACPI_HIDWORD (address), ACPI_LODWORD (address),
+		&region_obj->region.handler->address_space, handler,
+		ACPI_FORMAT_UINT64 (address),
 		acpi_ut_get_region_name (region_obj->region.space_id)));
 
 	if (!(handler_desc->address_space.flags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {
@@ -359,6 +361,7 @@
 	return_ACPI_STATUS (status);
 }
 
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ev_detach_region
@@ -398,7 +401,7 @@
 
 	/* Get the address handler from the region object */
 
-	handler_obj = region_obj->region.address_space;
+	handler_obj = region_obj->region.handler;
 	if (!handler_obj) {
 		/* This region has no handler, all done */
 
@@ -472,7 +475,7 @@
 			 * If the region is on the handler's list
 			 * this better be the region's handler
 			 */
-			region_obj->region.address_space = NULL;
+			region_obj->region.handler = NULL;
 			acpi_ut_remove_reference (handler_obj);
 
 			return_VOID;
@@ -515,17 +518,15 @@
 	union acpi_operand_object       *region_obj,
 	u8                              acpi_ns_is_locked)
 {
-	acpi_status                     status;
-	acpi_status                     status2;
-
 
 	ACPI_FUNCTION_TRACE ("ev_attach_region");
 
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
-		"Adding Region %p to address handler %p [%s]\n",
-		region_obj, handler_obj, acpi_ut_get_region_name (region_obj->region.space_id)));
-
+		"Adding Region [%4.4s] %p to address handler %p [%s]\n",
+		acpi_ut_get_node_name (region_obj->region.node),
+		region_obj, handler_obj,
+		acpi_ut_get_region_name (region_obj->region.space_id)));
 
 	/* Link this region to the front of the handler's list */
 
@@ -534,34 +535,14 @@
 
 	/* Install the region's handler */
 
-	if (region_obj->region.address_space) {
+	if (region_obj->region.handler) {
 		return_ACPI_STATUS (AE_ALREADY_EXISTS);
 	}
 
-	region_obj->region.address_space = handler_obj;
+	region_obj->region.handler = handler_obj;
 	acpi_ut_add_reference (handler_obj);
 
-	/*
-	 * Tell all users that this region is usable by running the _REG
-	 * method
-	 */
-	if (acpi_ns_is_locked) {
-		status2 = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
-		if (ACPI_FAILURE (status2)) {
-			return_ACPI_STATUS (status2);
-		}
-	}
-
-	status = acpi_ev_execute_reg_method (region_obj, 1);
-
-	if (acpi_ns_is_locked) {
-		status2 = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
-		if (ACPI_FAILURE (status2)) {
-			return_ACPI_STATUS (status2);
-		}
-	}
-
-	return_ACPI_STATUS (status);
+	return_ACPI_STATUS (AE_OK);
 }
 
 
@@ -569,9 +550,7 @@
  *
  * FUNCTION:    acpi_ev_install_handler
  *
- * PARAMETERS:  Handle              - Node to be dumped
- *              Level               - Nesting level of the handle
- *              Context             - Passed into acpi_ns_walk_namespace
+ * PARAMETERS:  walk_namespace callback
  *
  * DESCRIPTION: This routine installs an address handler into objects that are
  *              of type Region or Device.
@@ -640,7 +619,7 @@
 	if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_DEVICE) {
 		/* Check if this Device already has a handler for this address space */
 
-		next_handler_obj = obj_desc->device.address_space;
+		next_handler_obj = obj_desc->device.handler;
 		while (next_handler_obj) {
 			/* Found a handler, is it for the same address space? */
 
@@ -697,4 +676,74 @@
 	return (status);
 }
 
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ev_reg_run
+ *
+ * PARAMETERS:  walk_namespace callback
+ *
+ * DESCRIPTION: Run _REg method for region objects of the requested space_iD
+ *
+ ******************************************************************************/
+
+acpi_status
+acpi_ev_reg_run (
+	acpi_handle                     obj_handle,
+	u32                             level,
+	void                            *context,
+	void                            **return_value)
+{
+	union acpi_operand_object       *handler_obj;
+	union acpi_operand_object       *obj_desc;
+	struct acpi_namespace_node      *node;
+	acpi_status                     status;
+
+
+	handler_obj = (union acpi_operand_object   *) context;
+
+	/* Parameter validation */
+
+	if (!handler_obj) {
+		return (AE_OK);
+	}
+
+	/* Convert and validate the device handle */
+
+	node = acpi_ns_map_handle_to_node (obj_handle);
+	if (!node) {
+		return (AE_BAD_PARAMETER);
+	}
+
+	/*
+	 * We only care about regions.and objects
+	 * that are allowed to have address space handlers
+	 */
+	if ((node->type != ACPI_TYPE_REGION) &&
+		(node != acpi_gbl_root_node)) {
+		return (AE_OK);
+	}
+
+	/* Check for an existing internal object */
+
+	obj_desc = acpi_ns_get_attached_object (node);
+	if (!obj_desc) {
+		/* No object, just exit */
+
+		return (AE_OK);
+	}
+
+
+	/* Object is a Region */
+
+	if (obj_desc->region.space_id != handler_obj->address_space.space_id) {
+		/*
+		 * This region is for a different address space
+		 * -- just ignore it
+		 */
+		return (AE_OK);
+	}
+
+	status = acpi_ev_execute_reg_method (obj_desc, 1);
+	return (status);
+}
 
diff -Nru a/drivers/acpi/events/evrgnini.c b/drivers/acpi/events/evrgnini.c
--- a/drivers/acpi/events/evrgnini.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/events/evrgnini.c	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -177,7 +177,7 @@
 	ACPI_FUNCTION_TRACE ("ev_pci_config_region_setup");
 
 
-	handler_obj = region_obj->region.address_space;
+	handler_obj = region_obj->region.handler;
 	if (!handler_obj) {
 		/*
 		 * No installed handler. This shouldn't happen because the dispatch
@@ -239,7 +239,7 @@
 						else {
 							ACPI_REPORT_ERROR ((
 								"Could not install pci_config handler for Root Bridge %4.4s, %s\n",
-								pci_root_node->name.ascii, acpi_format_exception (status)));
+								acpi_ut_get_node_name (pci_root_node), acpi_format_exception (status)));
 						}
 					}
 					break;
@@ -469,7 +469,7 @@
 
 	/* Setup defaults */
 
-	region_obj->region.address_space = NULL;
+	region_obj->region.handler = NULL;
 	region_obj2->extra.method_REG = NULL;
 	region_obj->common.flags &= ~(AOPOBJ_SETUP_COMPLETE);
 	region_obj->common.flags |= AOPOBJ_OBJECT_INITIALIZED;
@@ -502,17 +502,17 @@
 			switch (node->type) {
 			case ACPI_TYPE_DEVICE:
 
-				handler_obj = obj_desc->device.address_space;
+				handler_obj = obj_desc->device.handler;
 				break;
 
 			case ACPI_TYPE_PROCESSOR:
 
-				handler_obj = obj_desc->processor.address_space;
+				handler_obj = obj_desc->processor.handler;
 				break;
 
 			case ACPI_TYPE_THERMAL:
 
-				handler_obj = obj_desc->thermal_zone.address_space;
+				handler_obj = obj_desc->thermal_zone.handler;
 				break;
 
 			default:
@@ -532,6 +532,26 @@
 
 					status = acpi_ev_attach_region (handler_obj, region_obj,
 							 acpi_ns_locked);
+
+					/*
+					 * Tell all users that this region is usable by running the _REG
+					 * method
+					 */
+					if (acpi_ns_locked) {
+						status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
+						if (ACPI_FAILURE (status)) {
+							return_ACPI_STATUS (status);
+						}
+					}
+
+					status = acpi_ev_execute_reg_method (region_obj, 1);
+
+					if (acpi_ns_locked) {
+						status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
+						if (ACPI_FAILURE (status)) {
+							return_ACPI_STATUS (status);
+						}
+					}
 
 					return_ACPI_STATUS (AE_OK);
 				}
diff -Nru a/drivers/acpi/events/evsci.c b/drivers/acpi/events/evsci.c
--- a/drivers/acpi/events/evsci.c	Tue Feb  3 19:45:33 2004
+++ b/drivers/acpi/events/evsci.c	Tue Feb  3 19:45:33 2004
@@ -6,7 +6,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/events/evxface.c b/drivers/acpi/events/evxface.c
--- a/drivers/acpi/events/evxface.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/acpi/events/evxface.c	Tue Feb  3 19:45:29 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/events/evxfevnt.c b/drivers/acpi/events/evxfevnt.c
--- a/drivers/acpi/events/evxfevnt.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/events/evxfevnt.c	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/events/evxfregn.c b/drivers/acpi/events/evxfregn.c
--- a/drivers/acpi/events/evxfregn.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/events/evxfregn.c	Tue Feb  3 19:45:17 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -173,7 +173,7 @@
 		 * The attached device object already exists.
 		 * Make sure the handler is not already installed.
 		 */
-		handler_obj = obj_desc->device.address_space;
+		handler_obj = obj_desc->device.handler;
 
 		/* Walk the handler list for this device */
 
@@ -240,7 +240,8 @@
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
 		"Installing address handler for region %s(%X) on Device %4.4s %p(%p)\n",
-		acpi_ut_get_region_name (space_id), space_id, node->name.ascii, node, obj_desc));
+		acpi_ut_get_region_name (space_id), space_id,
+		acpi_ut_get_node_name (node), node, obj_desc));
 
 	/*
 	 * Install the handler
@@ -267,13 +268,13 @@
 
 	/* Install at head of Device.address_space list */
 
-	handler_obj->address_space.next      = obj_desc->device.address_space;
+	handler_obj->address_space.next      = obj_desc->device.handler;
 
 	/*
 	 * The Device object is the first reference on the handler_obj.
 	 * Each region that uses the handler adds a reference.
 	 */
-	obj_desc->device.address_space = handler_obj;
+	obj_desc->device.handler = handler_obj;
 
 	/*
 	 * Walk the namespace finding all of the regions this
@@ -291,6 +292,17 @@
 			  ACPI_NS_WALK_UNLOCK, acpi_ev_install_handler,
 			  handler_obj, NULL);
 
+	/*
+	 * Now we can run the _REG methods for all Regions for this
+	 * space ID.  This is a separate walk in order to handle any
+	 * interdependencies between regions and _REG methods.  (i.e. handlers
+	 * must be installed for all regions of this Space ID before we
+	 * can run any _REG methods.
+	 */
+	status = acpi_ns_walk_namespace (ACPI_TYPE_ANY, device, ACPI_UINT32_MAX,
+			  ACPI_NS_WALK_UNLOCK, acpi_ev_reg_run,
+			  handler_obj, NULL);
+
 unlock_and_exit:
 	(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
 	return_ACPI_STATUS (status);
@@ -357,8 +369,8 @@
 
 	/* Find the address handler the user requested */
 
-	handler_obj = obj_desc->device.address_space;
-	last_obj_ptr = &obj_desc->device.address_space;
+	handler_obj = obj_desc->device.handler;
+	last_obj_ptr = &obj_desc->device.handler;
 	while (handler_obj) {
 		/* We have a handler, see if user requested this one */
 
diff -Nru a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
--- a/drivers/acpi/executer/exconfig.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/acpi/executer/exconfig.c	Tue Feb  3 19:45:29 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/executer/exconvrt.c b/drivers/acpi/executer/exconvrt.c
--- a/drivers/acpi/executer/exconvrt.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/executer/exconvrt.c	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/executer/excreate.c b/drivers/acpi/executer/excreate.c
--- a/drivers/acpi/executer/excreate.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/acpi/executer/excreate.c	Tue Feb  3 19:45:42 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c
--- a/drivers/acpi/executer/exdump.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/executer/exdump.c	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -89,27 +89,27 @@
 
 	if (!obj_desc) {
 		/*
-		 * This usually indicates that something serious is wrong --
-		 * since most (if not all)
-		 * code that dumps the stack expects something to be there!
+		 * This usually indicates that something serious is wrong
 		 */
-		acpi_os_printf ("Null stack entry ptr\n");
+		acpi_os_printf ("Null Object Descriptor\n");
 		return;
 	}
 
 	if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p NS Node: ", obj_desc));
+		ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p is a NS Node: ", obj_desc));
 		ACPI_DUMP_ENTRY (obj_desc, ACPI_LV_EXEC);
 		return;
 	}
 
 	if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p is not a local object\n", obj_desc));
+		ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+				"%p is not a node or operand object: [%s]\n",
+				obj_desc, acpi_ut_get_descriptor_name (obj_desc)));
 		ACPI_DUMP_BUFFER (obj_desc, sizeof (union acpi_operand_object));
 		return;
 	}
 
-	/*  obj_desc is a valid object */
+	/* obj_desc is a valid object */
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc));
 
@@ -151,11 +151,10 @@
 					 obj_desc->reference.offset);
 
 			if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) {
-				/* Value is a Number */
+				/* Value is an Integer */
 
 				acpi_os_printf (" value is [%8.8X%8.8x]",
-						 ACPI_HIDWORD(obj_desc->integer.value),
-						 ACPI_LODWORD(obj_desc->integer.value));
+						 ACPI_FORMAT_UINT64 (obj_desc->integer.value));
 			}
 
 			acpi_os_printf ("\n");
@@ -169,11 +168,10 @@
 
 			if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) {
 
-				/* Value is a Number */
+				/* Value is an Integer */
 
 				acpi_os_printf (" value is [%8.8X%8.8x]",
-						 ACPI_HIDWORD(obj_desc->integer.value),
-						 ACPI_LODWORD(obj_desc->integer.value));
+						 ACPI_FORMAT_UINT64 (obj_desc->integer.value));
 			}
 
 			acpi_os_printf ("\n");
@@ -189,7 +187,7 @@
 
 		default:
 
-			/*  unknown opcode  */
+			/* Unknown opcode */
 
 			acpi_os_printf ("Unknown Reference opcode=%X\n",
 				obj_desc->reference.opcode);
@@ -229,8 +227,7 @@
 	case ACPI_TYPE_INTEGER:
 
 		acpi_os_printf ("Integer %8.8X%8.8X\n",
-				 ACPI_HIDWORD (obj_desc->integer.value),
-				 ACPI_LODWORD (obj_desc->integer.value));
+				 ACPI_FORMAT_UINT64 (obj_desc->integer.value));
 		break;
 
 
@@ -271,8 +268,7 @@
 		}
 		else {
 			acpi_os_printf (" base %8.8X%8.8X Length %X\n",
-				ACPI_HIDWORD (obj_desc->region.address),
-				ACPI_LODWORD (obj_desc->region.address),
+				ACPI_FORMAT_UINT64 (obj_desc->region.address),
 				obj_desc->region.length);
 		}
 		break;
@@ -494,7 +490,7 @@
 	acpi_os_printf ("%20s : %p\n", title, value);
 #else
 	acpi_os_printf ("%20s : %8.8X%8.8X\n", title,
-			 ACPI_HIDWORD (value), ACPI_LODWORD (value));
+			 ACPI_FORMAT_UINT64 (value));
 #endif
 }
 
@@ -525,7 +521,7 @@
 		}
 	}
 
-	acpi_os_printf ("%20s : %4.4s\n",     "Name", node->name.ascii);
+	acpi_os_printf ("%20s : %4.4s\n",     "Name", acpi_ut_get_node_name (node));
 	acpi_ex_out_string ("Type",           acpi_ut_get_type_name (node->type));
 	acpi_ex_out_integer ("Flags",         node->flags);
 	acpi_ex_out_integer ("Owner Id",      node->owner_id);
@@ -573,7 +569,8 @@
 	}
 
 	if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) {
-		acpi_os_printf ("ex_dump_object_descriptor: %p is not a valid ACPI object\n", obj_desc);
+		acpi_os_printf ("ex_dump_object_descriptor: %p is not an ACPI operand object: [%s]\n",
+				obj_desc, acpi_ut_get_descriptor_name (obj_desc));
 		return_VOID;
 	}
 
@@ -589,8 +586,7 @@
 	case ACPI_TYPE_INTEGER:
 
 		acpi_os_printf ("%20s : %8.8X%8.8X\n", "Value",
-				  ACPI_HIDWORD (obj_desc->integer.value),
-				  ACPI_LODWORD (obj_desc->integer.value));
+				ACPI_FORMAT_UINT64 (obj_desc->integer.value));
 		break;
 
 
@@ -635,7 +631,7 @@
 
 	case ACPI_TYPE_DEVICE:
 
-		acpi_ex_out_pointer ("address_space", obj_desc->device.address_space);
+		acpi_ex_out_pointer ("Handler",     obj_desc->device.handler);
 		acpi_ex_out_pointer ("system_notify", obj_desc->device.system_notify);
 		acpi_ex_out_pointer ("device_notify", obj_desc->device.device_notify);
 		break;
@@ -673,7 +669,7 @@
 		acpi_ex_out_integer ("Flags",        obj_desc->region.flags);
 		acpi_ex_out_address ("Address",      obj_desc->region.address);
 		acpi_ex_out_integer ("Length",       obj_desc->region.length);
-		acpi_ex_out_pointer ("address_space", obj_desc->region.address_space);
+		acpi_ex_out_pointer ("Handler",      obj_desc->region.handler);
 		acpi_ex_out_pointer ("Next",         obj_desc->region.next);
 		break;
 
@@ -694,7 +690,7 @@
 		acpi_ex_out_address ("Address",      (acpi_physical_address) obj_desc->processor.address);
 		acpi_ex_out_pointer ("system_notify", obj_desc->processor.system_notify);
 		acpi_ex_out_pointer ("device_notify", obj_desc->processor.device_notify);
-		acpi_ex_out_pointer ("address_space", obj_desc->processor.address_space);
+		acpi_ex_out_pointer ("Handler",      obj_desc->processor.handler);
 		break;
 
 
@@ -702,7 +698,7 @@
 
 		acpi_ex_out_pointer ("system_notify", obj_desc->thermal_zone.system_notify);
 		acpi_ex_out_pointer ("device_notify", obj_desc->thermal_zone.device_notify);
-		acpi_ex_out_pointer ("address_space", obj_desc->thermal_zone.address_space);
+		acpi_ex_out_pointer ("Handler",      obj_desc->thermal_zone.handler);
 		break;
 
 
diff -Nru a/drivers/acpi/executer/exfield.c b/drivers/acpi/executer/exfield.c
--- a/drivers/acpi/executer/exfield.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/executer/exfield.c	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/executer/exfldio.c b/drivers/acpi/executer/exfldio.c
--- a/drivers/acpi/executer/exfldio.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/executer/exfldio.c	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -138,8 +138,9 @@
 			 */
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
 				"Field [%4.4s] access width (%d bytes) too large for region [%4.4s] (length %X)\n",
-				obj_desc->common_field.node->name.ascii, obj_desc->common_field.access_byte_width,
-				rgn_desc->region.node->name.ascii, rgn_desc->region.length));
+				acpi_ut_get_node_name (obj_desc->common_field.node),
+				obj_desc->common_field.access_byte_width,
+				acpi_ut_get_node_name (rgn_desc->region.node), rgn_desc->region.length));
 		}
 
 		/*
@@ -148,9 +149,10 @@
 		 */
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
 			"Field [%4.4s] Base+Offset+Width %X+%X+%X is beyond end of region [%4.4s] (length %X)\n",
-			obj_desc->common_field.node->name.ascii, obj_desc->common_field.base_byte_offset,
+			acpi_ut_get_node_name (obj_desc->common_field.node),
+			obj_desc->common_field.base_byte_offset,
 			field_datum_byte_offset, obj_desc->common_field.access_byte_width,
-			rgn_desc->region.node->name.ascii, rgn_desc->region.length));
+			acpi_ut_get_node_name (rgn_desc->region.node), rgn_desc->region.length));
 
 		#ifdef CONFIG_ACPI_RELAXED_AML
 		{
@@ -261,7 +263,7 @@
 		obj_desc->common_field.access_byte_width,
 		obj_desc->common_field.base_byte_offset,
 		field_datum_byte_offset,
-		ACPI_HIDWORD (address), ACPI_LODWORD (address)));
+		ACPI_FORMAT_UINT64 (address)));
 
 	/* Invoke the appropriate address_space/op_region handler */
 
@@ -514,12 +516,12 @@
 	if (ACPI_SUCCESS (status)) {
 		if (read_write == ACPI_READ) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value Read %8.8X%8.8X, Width %d\n",
-					   ACPI_HIDWORD (*value), ACPI_LODWORD (*value),
+					   ACPI_FORMAT_UINT64 (*value),
 					   obj_desc->common_field.access_byte_width));
 		}
 		else {
 			ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value Written %8.8X%8.8X, Width %d\n",
-					   ACPI_HIDWORD (*value), ACPI_LODWORD (*value),
+					   ACPI_FORMAT_UINT64 (*value),
 					   obj_desc->common_field.access_byte_width));
 		}
 	}
@@ -612,11 +614,11 @@
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
 		"Mask %8.8X%8.8X, datum_offset %X, Width %X, Value %8.8X%8.8X, merged_value %8.8X%8.8X\n",
-		ACPI_HIDWORD (mask), ACPI_LODWORD (mask),
+		ACPI_FORMAT_UINT64 (mask),
 		field_datum_byte_offset,
 		obj_desc->common_field.access_byte_width,
-		ACPI_HIDWORD (field_value), ACPI_LODWORD (field_value),
-		ACPI_HIDWORD (merged_value),ACPI_LODWORD (merged_value)));
+		ACPI_FORMAT_UINT64 (field_value),
+		ACPI_FORMAT_UINT64 (merged_value)));
 
 	/* Write the merged value */
 
@@ -784,12 +786,13 @@
 {
 	acpi_status                     status;
 	u32                             field_datum_byte_offset;
-	u32                             datum_offset;
-	acpi_integer                    previous_raw_datum;
+	u32                             buffer_datum_offset;
+	acpi_integer                    previous_raw_datum = 0;
 	acpi_integer                    this_raw_datum = 0;
 	acpi_integer                    merged_datum = 0;
 	u32                             byte_field_length;
 	u32                             datum_count;
+	u32                             i;
 
 
 	ACPI_FUNCTION_TRACE ("ex_extract_from_field");
@@ -812,77 +815,74 @@
 	datum_count = ACPI_ROUND_UP_TO (byte_field_length,
 			   obj_desc->common_field.access_byte_width);
 
+	/*
+	 * If the field is not aligned on a datum boundary and does not
+	 * fit within a single datum, we must read an extra datum.
+	 *
+	 * We could just split the aligned and non-aligned cases since the
+	 * aligned case is so very simple, but this would require more code.
+	 */
+	if ((obj_desc->common_field.end_field_valid_bits != 0)    &&
+		(!(obj_desc->common_field.flags & AOPOBJ_SINGLE_DATUM))) {
+		datum_count++;
+	}
+
 	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
 		"byte_len %X, datum_len %X, byte_gran %X\n",
 		byte_field_length, datum_count,obj_desc->common_field.access_byte_width));
 
 	/*
 	 * Clear the caller's buffer (the whole buffer length as given)
-	 * This is very important, especially in the cases where a byte is read,
-	 * but the buffer is really a u32 (4 bytes).
+	 * This is very important, especially in the cases where the buffer
+	 * is longer than the size of the field.
 	 */
 	ACPI_MEMSET (buffer, 0, buffer_length);
 
-	/* Read the first raw datum to prime the loop */
-
 	field_datum_byte_offset = 0;
-	datum_offset= 0;
-
-	status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset,
-			  &previous_raw_datum, ACPI_READ);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
-	}
-
+	buffer_datum_offset= 0;
 
-	/* We might actually be done if the request fits in one datum */
+	/* Read the entire field */
 
-	if ((datum_count == 1) &&
-		(obj_desc->common_field.flags & AOPOBJ_SINGLE_DATUM)) {
-		/* 1) Shift the valid data bits down to start at bit 0 */
+	for (i = 0; i < datum_count; i++) {
+		status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset,
+				  &this_raw_datum, ACPI_READ);
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+		}
 
-		merged_datum = (previous_raw_datum >> obj_desc->common_field.start_field_bit_offset);
+		/* We might actually be done if the request fits in one datum */
 
-		/* 2) Mask off any upper unused bits (bits not part of the field) */
+		if ((datum_count == 1) &&
+			(obj_desc->common_field.flags & AOPOBJ_SINGLE_DATUM)) {
+			/* 1) Shift the valid data bits down to start at bit 0 */
 
-		if (obj_desc->common_field.end_buffer_valid_bits) {
-			merged_datum &= ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_buffer_valid_bits);
-		}
+			merged_datum = (this_raw_datum >> obj_desc->common_field.start_field_bit_offset);
 
-		/* Store the datum to the caller buffer */
+			/* 2) Mask off any upper unused bits (bits not part of the field) */
 
-		acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length,
-				obj_desc->common_field.access_byte_width, datum_offset);
+			if (obj_desc->common_field.end_buffer_valid_bits) {
+				merged_datum &= ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_buffer_valid_bits);
+			}
 
-		return_ACPI_STATUS (AE_OK);
-	}
+			/* Store the datum to the caller buffer */
 
+			acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length,
+					obj_desc->common_field.access_byte_width, buffer_datum_offset);
 
-	/* We need to get more raw data to complete one or more field data */
+			return_ACPI_STATUS (AE_OK);
+		}
 
-	while (datum_offset < datum_count) {
-		field_datum_byte_offset += obj_desc->common_field.access_byte_width;
+		/* Special handling for the last datum to ignore extra bits */
 
-		/*
-		 * If the field is aligned on a byte boundary, we don't want
-		 * to perform a final read, since this would potentially read
-		 * past the end of the region.
-		 *
-		 * We could just split the aligned and non-aligned cases since the
-		 * aligned case is so very simple, but this would require more code.
-		 */
-		if ((obj_desc->common_field.start_field_bit_offset != 0) ||
-			((obj_desc->common_field.start_field_bit_offset == 0) &&
-			(datum_offset < (datum_count -1)))) {
+		if ((i >= (datum_count -1))          &&
+			(obj_desc->common_field.end_field_valid_bits)) {
 			/*
-			 * Get the next raw datum, it contains some or all bits
-			 * of the current field datum
+			 * This is the last iteration of the loop.  We need to clear
+			 * any unused bits (bits that are not part of this field) before
+			 * we store the final merged datum into the caller buffer.
 			 */
-			status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset,
-					  &this_raw_datum, ACPI_READ);
-			if (ACPI_FAILURE (status)) {
-				return_ACPI_STATUS (status);
-			}
+			this_raw_datum &=
+				ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits);
 		}
 
 		/*
@@ -891,48 +891,48 @@
 		if (obj_desc->common_field.start_field_bit_offset == 0) {
 			/* Field is not skewed and we can just copy the datum */
 
-			merged_datum = previous_raw_datum;
+			acpi_ex_set_buffer_datum (this_raw_datum, buffer, buffer_length,
+					obj_desc->common_field.access_byte_width, buffer_datum_offset);
+			buffer_datum_offset++;
 		}
 		else {
-			/*
-			 * Put together the appropriate bits of the two raw data to make a
-			 * single complete field datum
-			 *
-			 * 1) Normalize the first datum down to bit 0
-			 */
-			merged_datum = (previous_raw_datum >> obj_desc->common_field.start_field_bit_offset);
-
-			/* 2) Insert the second datum "above" the first datum */
+			/* Not aligned -- on the first iteration, just save the datum */
 
-			merged_datum |= (this_raw_datum << obj_desc->common_field.datum_valid_bits);
-
-			if ((datum_offset >= (datum_count -1))) {
+			if (i != 0) {
 				/*
-				 * This is the last iteration of the loop.  We need to clear
-				 * any unused bits (bits that are not part of this field) that
-				 * came from the last raw datum before we store the final
-				 * merged datum into the caller buffer.
+				 * Put together the appropriate bits of the two raw data to make a
+				 * single complete field datum
+				 *
+				 * 1) Normalize the first datum down to bit 0
 				 */
-				if (obj_desc->common_field.end_buffer_valid_bits) {
-					merged_datum &=
-						ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_buffer_valid_bits);
-				}
+				merged_datum = (previous_raw_datum >> obj_desc->common_field.start_field_bit_offset);
+
+				/* 2) Insert the second datum "above" the first datum */
+
+				merged_datum |= (this_raw_datum << obj_desc->common_field.datum_valid_bits);
+
+				acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length,
+						obj_desc->common_field.access_byte_width, buffer_datum_offset);
+				buffer_datum_offset++;
 			}
+
+			/*
+			 * Save the raw datum that was just acquired since it may contain bits
+			 * of the *next* field datum
+			 */
+			previous_raw_datum = this_raw_datum;
 		}
 
-		/*
-		 * Store the merged field datum in the caller's buffer, according to
-		 * the granularity of the field (size of each datum).
-		 */
-		acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length,
-				obj_desc->common_field.access_byte_width, datum_offset);
+		field_datum_byte_offset += obj_desc->common_field.access_byte_width;
+	}
 
-		/*
-		 * Save the raw datum that was just acquired since it may contain bits
-		 * of the *next* field datum.  Update offsets
-		 */
-		previous_raw_datum = this_raw_datum;
-		datum_offset++;
+	/* For non-aligned case, there is one last datum to insert */
+
+	if (obj_desc->common_field.start_field_bit_offset != 0) {
+		merged_datum = (this_raw_datum >> obj_desc->common_field.start_field_bit_offset);
+
+		acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length,
+				obj_desc->common_field.access_byte_width, buffer_datum_offset);
 	}
 
 	return_ACPI_STATUS (AE_OK);
diff -Nru a/drivers/acpi/executer/exmisc.c b/drivers/acpi/executer/exmisc.c
--- a/drivers/acpi/executer/exmisc.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/acpi/executer/exmisc.c	Tue Feb  3 19:45:41 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -121,8 +121,8 @@
 
 	default:
 
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid descriptor type %X in %p\n",
-			ACPI_GET_DESCRIPTOR_TYPE (obj_desc), obj_desc));
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p has invalid descriptor [%s]\n",
+				obj_desc, acpi_ut_get_descriptor_name (obj_desc)));
 		return_ACPI_STATUS (AE_TYPE);
 	}
 
@@ -139,7 +139,7 @@
 	*return_desc = reference_obj;
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Object %p Type [%s], returning Reference %p\n",
-		obj_desc, acpi_ut_get_object_type_name (obj_desc), *return_desc));
+			obj_desc, acpi_ut_get_object_type_name (obj_desc), *return_desc));
 
 	return_ACPI_STATUS (AE_OK);
 }
diff -Nru a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c
--- a/drivers/acpi/executer/exmutex.c	Tue Feb  3 19:45:37 2004
+++ b/drivers/acpi/executer/exmutex.c	Tue Feb  3 19:45:37 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -159,7 +159,7 @@
 
 	if (!walk_state->thread) {
 		ACPI_REPORT_ERROR (("Cannot acquire Mutex [%4.4s], null thread info\n",
-				obj_desc->mutex.node->name.ascii));
+				acpi_ut_get_node_name (obj_desc->mutex.node)));
 		return_ACPI_STATUS (AE_AML_INTERNAL);
 	}
 
@@ -169,7 +169,7 @@
 	 */
 	if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) {
 		ACPI_REPORT_ERROR (("Cannot acquire Mutex [%4.4s], incorrect sync_level\n",
-				obj_desc->mutex.node->name.ascii));
+				acpi_ut_get_node_name (obj_desc->mutex.node)));
 		return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
 	}
 
@@ -242,7 +242,7 @@
 
 	if (!obj_desc->mutex.owner_thread) {
 		ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], not acquired\n",
-				obj_desc->mutex.node->name.ascii));
+				acpi_ut_get_node_name (obj_desc->mutex.node)));
 		return_ACPI_STATUS (AE_AML_MUTEX_NOT_ACQUIRED);
 	}
 
@@ -250,7 +250,7 @@
 
 	if (!walk_state->thread) {
 		ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], null thread info\n",
-				obj_desc->mutex.node->name.ascii));
+				acpi_ut_get_node_name (obj_desc->mutex.node)));
 		return_ACPI_STATUS (AE_AML_INTERNAL);
 	}
 
@@ -260,7 +260,7 @@
 		ACPI_REPORT_ERROR ((
 			"Thread %X cannot release Mutex [%4.4s] acquired by thread %X\n",
 			walk_state->thread->thread_id,
-			obj_desc->mutex.node->name.ascii,
+			acpi_ut_get_node_name (obj_desc->mutex.node),
 			obj_desc->mutex.owner_thread->thread_id));
 		return_ACPI_STATUS (AE_AML_NOT_OWNER);
 	}
@@ -271,7 +271,7 @@
 	 */
 	if (obj_desc->mutex.sync_level > walk_state->thread->current_sync_level) {
 		ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], incorrect sync_level\n",
-				obj_desc->mutex.node->name.ascii));
+				acpi_ut_get_node_name (obj_desc->mutex.node)));
 		return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
 	}
 
diff -Nru a/drivers/acpi/executer/exnames.c b/drivers/acpi/executer/exnames.c
--- a/drivers/acpi/executer/exnames.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/executer/exnames.c	Tue Feb  3 19:45:17 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c
--- a/drivers/acpi/executer/exoparg1.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/acpi/executer/exoparg1.c	Tue Feb  3 19:45:42 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -351,8 +351,7 @@
 
 			if (digit > 0) {
 				ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Integer too large to convert to BCD: %8.8X%8.8X\n",
-					ACPI_HIDWORD(operand[0]->integer.value),
-					ACPI_LODWORD(operand[0]->integer.value)));
+						ACPI_FORMAT_UINT64 (operand[0]->integer.value)));
 				status = AE_AML_NUMERIC_OVERFLOW;
 				goto cleanup;
 			}
diff -Nru a/drivers/acpi/executer/exoparg2.c b/drivers/acpi/executer/exoparg2.c
--- a/drivers/acpi/executer/exoparg2.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/acpi/executer/exoparg2.c	Tue Feb  3 19:45:28 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/executer/exoparg3.c b/drivers/acpi/executer/exoparg3.c
--- a/drivers/acpi/executer/exoparg3.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/executer/exoparg3.c	Tue Feb  3 19:45:16 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -101,14 +101,13 @@
 
 
 	switch (walk_state->opcode) {
-
 	case AML_FATAL_OP:          /* Fatal (fatal_type fatal_code fatal_arg)   */
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
 			"fatal_op: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
-			(u32) operand[0]->integer.value, (u32) operand[1]->integer.value,
+			(u32) operand[0]->integer.value,
+			(u32) operand[1]->integer.value,
 			(u32) operand[2]->integer.value));
-
 
 		fatal = ACPI_MEM_ALLOCATE (sizeof (struct acpi_signal_fatal_info));
 		if (fatal) {
diff -Nru a/drivers/acpi/executer/exoparg6.c b/drivers/acpi/executer/exoparg6.c
--- a/drivers/acpi/executer/exoparg6.c	Tue Feb  3 19:45:35 2004
+++ b/drivers/acpi/executer/exoparg6.c	Tue Feb  3 19:45:35 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/executer/exprep.c b/drivers/acpi/executer/exprep.c
--- a/drivers/acpi/executer/exprep.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/executer/exprep.c	Tue Feb  3 19:45:17 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -351,7 +351,7 @@
 	 */
 	nearest_byte_address =
 			ACPI_ROUND_BITS_DOWN_TO_BYTES (field_bit_position);
-	obj_desc->common_field.base_byte_offset =
+	obj_desc->common_field.base_byte_offset = (u32)
 			ACPI_ROUND_DOWN (nearest_byte_address, byte_alignment);
 
 	/*
@@ -539,7 +539,7 @@
 			  acpi_ns_get_type (info->field_node));
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Set named_obj %p [%4.4s], obj_desc %p\n",
-			info->field_node, info->field_node->name.ascii, obj_desc));
+			info->field_node, acpi_ut_get_node_name (info->field_node), obj_desc));
 
 	/* Remove local reference to the object */
 
diff -Nru a/drivers/acpi/executer/exregion.c b/drivers/acpi/executer/exregion.c
--- a/drivers/acpi/executer/exregion.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/executer/exregion.c	Tue Feb  3 19:45:17 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -161,7 +161,7 @@
 				  (void **) &mem_info->mapped_logical_address);
 		if (ACPI_FAILURE (status)) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not map memory at %8.8X%8.8X, size %X\n",
-				ACPI_HIDWORD (address), ACPI_LODWORD (address), (u32) window_size));
+					ACPI_FORMAT_UINT64 (address), (u32) window_size));
 			mem_info->mapped_length = 0;
 			return_ACPI_STATUS (status);
 		}
@@ -180,8 +180,8 @@
 			  ((acpi_integer) address - (acpi_integer) mem_info->mapped_physical_address);
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
-		"system_memory %d (%d width) Address=%8.8X%8.8X\n", function, bit_width,
-		ACPI_HIDWORD (address), ACPI_LODWORD (address)));
+			"system_memory %d (%d width) Address=%8.8X%8.8X\n", function, bit_width,
+			ACPI_FORMAT_UINT64 (address)));
 
    /*
 	* Perform the memory read or write
@@ -290,8 +290,8 @@
 
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
-		"system_iO %d (%d width) Address=%8.8X%8.8X\n", function, bit_width,
-		ACPI_HIDWORD (address), ACPI_LODWORD (address)));
+			"system_iO %d (%d width) Address=%8.8X%8.8X\n", function, bit_width,
+			ACPI_FORMAT_UINT64 (address)));
 
 	/* Decode the function parameter */
 
diff -Nru a/drivers/acpi/executer/exresnte.c b/drivers/acpi/executer/exresnte.c
--- a/drivers/acpi/executer/exresnte.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/executer/exresnte.c	Tue Feb  3 19:45:17 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c
--- a/drivers/acpi/executer/exresolv.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/executer/exresolv.c	Tue Feb  3 19:45:17 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -349,6 +349,8 @@
 			/* All "References" point to a NS node */
 
 			if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) {
+				ACPI_REPORT_ERROR (("acpi_ex_resolve_multiple: Not a NS node %p [%s]\n",
+						node, acpi_ut_get_descriptor_name (node)));
 				return_ACPI_STATUS (AE_AML_INTERNAL);
 			}
 
@@ -399,7 +401,9 @@
 			/* All "References" point to a NS node */
 
 			if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) {
-				return_ACPI_STATUS (AE_AML_INTERNAL);
+				ACPI_REPORT_ERROR (("acpi_ex_resolve_multiple: Not a NS node %p [%s]\n",
+						node, acpi_ut_get_descriptor_name (node)));
+			   return_ACPI_STATUS (AE_AML_INTERNAL);
 			}
 
 			/* Get the attached object */
diff -Nru a/drivers/acpi/executer/exresop.c b/drivers/acpi/executer/exresop.c
--- a/drivers/acpi/executer/exresop.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/acpi/executer/exresop.c	Tue Feb  3 19:45:42 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -247,8 +247,8 @@
 			/* Invalid descriptor */
 
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-				"Bad descriptor type %X in Obj %p\n",
-				ACPI_GET_DESCRIPTOR_TYPE (obj_desc), obj_desc));
+					"Invalid descriptor %p [%s]\n",
+					obj_desc, acpi_ut_get_descriptor_name (obj_desc)));
 
 			return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
 		}
diff -Nru a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c
--- a/drivers/acpi/executer/exstore.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/executer/exstore.c	Tue Feb  3 19:45:17 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -190,8 +190,7 @@
 		case ACPI_TYPE_INTEGER:
 
 			ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%8.8X%8.8X\n",
-					ACPI_HIDWORD (source_desc->integer.value),
-					ACPI_LODWORD (source_desc->integer.value)));
+					ACPI_FORMAT_UINT64 (source_desc->integer.value)));
 			break;
 
 
diff -Nru a/drivers/acpi/executer/exstoren.c b/drivers/acpi/executer/exstoren.c
--- a/drivers/acpi/executer/exstoren.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/executer/exstoren.c	Tue Feb  3 19:45:17 2004
@@ -7,7 +7,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/executer/exstorob.c b/drivers/acpi/executer/exstorob.c
--- a/drivers/acpi/executer/exstorob.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/acpi/executer/exstorob.c	Tue Feb  3 19:45:42 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/executer/exsystem.c b/drivers/acpi/executer/exsystem.c
--- a/drivers/acpi/executer/exsystem.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/acpi/executer/exsystem.c	Tue Feb  3 19:45:34 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -111,11 +111,16 @@
  *
  * FUNCTION:    acpi_ex_system_do_stall
  *
- * PARAMETERS:  how_long            - The amount of time to stall
+ * PARAMETERS:  how_long            - The amount of time to stall,
+ *                                    in microseconds
  *
  * RETURN:      Status
  *
  * DESCRIPTION: Suspend running thread for specified amount of time.
+ *              Note: ACPI specification requires that Stall() does not
+ *              relinquish the processor, and delays longer than 100 usec
+ *              should use Sleep() instead.  We allow stalls up to 255 usec
+ *              for compatibility with other interpreters and existing BIOSs.
  *
  ******************************************************************************/
 
@@ -129,12 +134,15 @@
 	ACPI_FUNCTION_ENTRY ();
 
 
-	if (how_long > 100) /* 100 microseconds */ {
+	if (how_long > 255) /* 255 microseconds */ {
 		/*
-		 * Longer than 100 usec, use sleep instead
-		 * (according to ACPI specification)
+		 * Longer than 255 usec, this is an error
+		 *
+		 * (ACPI specifies 100 usec as max, but this gives some slack in
+		 * order to support existing BIOSs)
 		 */
-		status = acpi_ex_system_do_suspend ((how_long / 1000) + 1);
+		ACPI_REPORT_ERROR (("Stall: Time parameter is too large (%d)\n", how_long));
+		status = AE_AML_OPERAND_VALUE;
 	}
 	else {
 		acpi_os_stall (how_long);
@@ -148,7 +156,8 @@
  *
  * FUNCTION:    acpi_ex_system_do_suspend
  *
- * PARAMETERS:  how_long            - The amount of time to suspend
+ * PARAMETERS:  how_long            - The amount of time to suspend,
+ *                                    in milliseconds
  *
  * RETURN:      None
  *
diff -Nru a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c
--- a/drivers/acpi/executer/exutils.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/executer/exutils.c	Tue Feb  3 19:45:17 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/fan.c b/drivers/acpi/fan.c
--- a/drivers/acpi/fan.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/fan.c	Tue Feb  3 19:45:16 2004
@@ -71,7 +71,7 @@
                               FS Interface (/proc)
    -------------------------------------------------------------------------- */
 
-struct proc_dir_entry		*acpi_fan_dir = NULL;
+struct proc_dir_entry		*acpi_fan_dir;
 
 
 static int
diff -Nru a/drivers/acpi/hardware/hwacpi.c b/drivers/acpi/hardware/hwacpi.c
--- a/drivers/acpi/hardware/hwacpi.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/hardware/hwacpi.c	Tue Feb  3 19:45:16 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -119,7 +119,7 @@
 	 * system does not support mode transition.
 	 */
 	if (!acpi_gbl_FADT->smi_cmd) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No SMI_CMD in FADT, mode transition failed.\n"));
+		ACPI_REPORT_ERROR (("No SMI_CMD in FADT, mode transition failed.\n"));
 		return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE);
 	}
 
@@ -131,7 +131,7 @@
 	 * transitions are not supported.
 	 */
 	if (!acpi_gbl_FADT->acpi_enable && !acpi_gbl_FADT->acpi_disable) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "No mode transition supported in this system.\n"));
+		ACPI_REPORT_ERROR (("No ACPI mode transition supported in this system (enable/disable both zero)\n"));
 		return_ACPI_STATUS (AE_OK);
 	}
 
@@ -162,6 +162,7 @@
 	}
 
 	if (ACPI_FAILURE (status)) {
+		ACPI_REPORT_ERROR (("Could not write mode change, %s\n", acpi_format_exception (status)));
 		return_ACPI_STATUS (status);
 	}
 
@@ -171,18 +172,16 @@
 	 */
 	retry = 3000;
 	while (retry) {
-		status = AE_NO_HARDWARE_RESPONSE;
-
 		if (acpi_hw_get_mode() == mode) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Mode %X successfully enabled\n", mode));
-			status = AE_OK;
-			break;
+			return_ACPI_STATUS (AE_OK);
 		}
 		acpi_os_stall(1000);
 		retry--;
 	}
 
-	return_ACPI_STATUS (status);
+	ACPI_REPORT_ERROR (("Hardware never changed modes\n"));
+	return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE);
 }
 
 
diff -Nru a/drivers/acpi/hardware/hwgpe.c b/drivers/acpi/hardware/hwgpe.c
--- a/drivers/acpi/hardware/hwgpe.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/hardware/hwgpe.c	Tue Feb  3 19:45:16 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -348,17 +348,14 @@
 	struct acpi_gpe_block_info      *gpe_block)
 {
 	u32                             i;
-	struct acpi_gpe_register_info   *gpe_register_info;
 	acpi_status                     status;
 
 
-	/* Get the register info for the entire GPE block */
-
-	gpe_register_info = gpe_block->register_info;
-
 	/* Examine each GPE Register within the block */
 
 	for (i = 0; i < gpe_block->register_count; i++) {
+		/* Disable all GPEs in this register */
+
 		status = acpi_hw_low_level_write (8, 0x00,
 				 &gpe_block->register_info[i].enable_address);
 		if (ACPI_FAILURE (status)) {
@@ -389,17 +386,14 @@
 	struct acpi_gpe_block_info      *gpe_block)
 {
 	u32                             i;
-	struct acpi_gpe_register_info   *gpe_register_info;
 	acpi_status                     status;
 
 
-	/* Get the register info for the entire GPE block */
-
-	gpe_register_info = gpe_block->register_info;
-
 	/* Examine each GPE Register within the block */
 
 	for (i = 0; i < gpe_block->register_count; i++) {
+		/* Clear all GPEs in this register */
+
 		status = acpi_hw_low_level_write (8, 0xFF,
 				 &gpe_block->register_info[i].status_address);
 		if (ACPI_FAILURE (status)) {
diff -Nru a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c
--- a/drivers/acpi/hardware/hwregs.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/acpi/hardware/hwregs.c	Tue Feb  3 19:45:41 2004
@@ -7,7 +7,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -418,16 +418,14 @@
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM2 control: Read %X from %8.8X%8.8X\n",
 			register_value,
-			ACPI_HIDWORD (acpi_gbl_FADT->xpm2_cnt_blk.address),
-			ACPI_LODWORD (acpi_gbl_FADT->xpm2_cnt_blk.address)));
+			ACPI_FORMAT_UINT64 (acpi_gbl_FADT->xpm2_cnt_blk.address)));
 
 		ACPI_REGISTER_INSERT_VALUE (register_value, bit_reg_info->bit_position,
 				bit_reg_info->access_bit_mask, value);
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %4.4X to %8.8X%8.8X\n",
 			register_value,
-			ACPI_HIDWORD (acpi_gbl_FADT->xpm2_cnt_blk.address),
-			ACPI_LODWORD (acpi_gbl_FADT->xpm2_cnt_blk.address)));
+			ACPI_FORMAT_UINT64 (acpi_gbl_FADT->xpm2_cnt_blk.address)));
 
 		status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK,
 				   ACPI_REGISTER_PM2_CONTROL, (u8) (register_value));
@@ -763,8 +761,7 @@
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Read:  %8.8X width %2d from %8.8X%8.8X (%s)\n",
 			*value, width,
-			ACPI_HIDWORD (reg->address),
-			ACPI_LODWORD (reg->address),
+			ACPI_FORMAT_UINT64 (reg->address),
 			acpi_ut_get_region_name (reg->address_space_id)));
 
 	return (status);
@@ -850,8 +847,7 @@
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Wrote: %8.8X width %2d   to %8.8X%8.8X (%s)\n",
 			value, width,
-			ACPI_HIDWORD (reg->address),
-			ACPI_LODWORD (reg->address),
+			ACPI_FORMAT_UINT64 (reg->address),
 			acpi_ut_get_region_name (reg->address_space_id)));
 
 	return (status);
diff -Nru a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c
--- a/drivers/acpi/hardware/hwsleep.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/hardware/hwsleep.c	Tue Feb  3 19:45:16 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -181,6 +181,13 @@
 		return_ACPI_STATUS (status);
 	}
 
+	/* Set the system indicators to show the desired sleep state. */
+
+	status = acpi_evaluate_object (NULL, "\\_SI._SST", &arg_list, NULL);
+	if (ACPI_FAILURE (status) && status != AE_NOT_FOUND) {
+		 ACPI_REPORT_ERROR (("Method _SST failed, %s\n", acpi_format_exception (status)));
+	}
+
 	return_ACPI_STATUS (AE_OK);
 }
 
@@ -220,30 +227,31 @@
 		return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
 	}
 
-
 	sleep_type_reg_info = acpi_hw_get_bit_register_info (ACPI_BITREG_SLEEP_TYPE_A);
 	sleep_enable_reg_info = acpi_hw_get_bit_register_info (ACPI_BITREG_SLEEP_ENABLE);
 
-	/* Clear wake status */
+	if (sleep_state != ACPI_STATE_S5) {
+		/* Clear wake status */
 
-	status = acpi_set_register (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
-	}
+		status = acpi_set_register (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK);
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+		}
 
-	status = acpi_hw_clear_acpi_status(ACPI_MTX_DO_NOT_LOCK);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
-	}
+		status = acpi_hw_clear_acpi_status (ACPI_MTX_DO_NOT_LOCK);
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+		}
 
-	/* Disable BM arbitration */
+		/* Disable BM arbitration */
 
-	status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 1, ACPI_MTX_DO_NOT_LOCK);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
+		status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 1, ACPI_MTX_DO_NOT_LOCK);
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+		}
 	}
 
-	status = acpi_hw_disable_non_wakeup_gpes();
+	status = acpi_hw_disable_non_wakeup_gpes ();
 	if (ACPI_FAILURE (status)) {
 		return_ACPI_STATUS (status);
 	}
@@ -266,6 +274,11 @@
 	PM1Acontrol |= (acpi_gbl_sleep_type_a << sleep_type_reg_info->bit_position);
 	PM1Bcontrol |= (acpi_gbl_sleep_type_b << sleep_type_reg_info->bit_position);
 
+	/*
+	 * We split the writes of SLP_TYP and SLP_EN to workaround
+	 * poorly implemented hardware.
+	 */
+
 	/* Write #1: fill in SLP_TYP data */
 
 	status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1A_CONTROL, PM1Acontrol);
@@ -297,13 +310,15 @@
 		return_ACPI_STATUS (status);
 	}
 
-	/*
-	 * Wait a second, then try again. This is to get S4/5 to work on all machines.
-	 */
 	if (sleep_state > ACPI_STATE_S3) {
 		/*
+		 * We wanted to sleep > S3, but it didn't happen (by virtue of the fact that
+		 * we are still executing!)
+		 *
+		 * Wait ten seconds, then try again. This is to get S4/S5 to work on all machines.
+		 *
 		 * We wait so long to allow chipsets that poll this reg very slowly to
-		 * still read the right value. Ideally, this entire block would go
+		 * still read the right value. Ideally, this block would go
 		 * away entirely.
 		 */
 		acpi_os_stall (10000000);
@@ -354,12 +369,23 @@
 
 	ACPI_FUNCTION_TRACE ("acpi_enter_sleep_state_s4bios");
 
-	acpi_set_register (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK);
-	acpi_hw_clear_acpi_status(ACPI_MTX_DO_NOT_LOCK);
 
-	acpi_hw_disable_non_wakeup_gpes();
+	status = acpi_set_register (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK);
+	if (ACPI_FAILURE (status)) {
+		return_ACPI_STATUS (status);
+	}
+
+	status = acpi_hw_clear_acpi_status (ACPI_MTX_DO_NOT_LOCK);
+	if (ACPI_FAILURE (status)) {
+		return_ACPI_STATUS (status);
+	}
+
+	status = acpi_hw_disable_non_wakeup_gpes ();
+	if (ACPI_FAILURE (status)) {
+		return_ACPI_STATUS (status);
+	}
 
-	ACPI_FLUSH_CPU_CACHE();
+	ACPI_FLUSH_CPU_CACHE ();
 
 	status = acpi_os_write_port (acpi_gbl_FADT->smi_cmd, (u32) acpi_gbl_FADT->S4bios_req, 8);
 
@@ -389,16 +415,56 @@
 
 acpi_status
 acpi_leave_sleep_state (
-	u8                          sleep_state)
+	u8                              sleep_state)
 {
-	struct acpi_object_list     arg_list;
-	union acpi_object           arg;
-	acpi_status                 status;
+	struct acpi_object_list         arg_list;
+	union acpi_object               arg;
+	acpi_status                     status;
+	struct acpi_bit_register_info   *sleep_type_reg_info;
+	struct acpi_bit_register_info   *sleep_enable_reg_info;
+	u32                             PM1Acontrol;
+	u32                             PM1Bcontrol;
 
 
 	ACPI_FUNCTION_TRACE ("acpi_leave_sleep_state");
 
 
+	/*
+	 * Set SLP_TYPE and SLP_EN to state S0.
+	 * This is unclear from the ACPI Spec, but it is required
+	 * by some machines.
+	 */
+	status = acpi_get_sleep_type_data (ACPI_STATE_S0,
+			  &acpi_gbl_sleep_type_a, &acpi_gbl_sleep_type_b);
+	if (ACPI_SUCCESS (status)) {
+		sleep_type_reg_info = acpi_hw_get_bit_register_info (ACPI_BITREG_SLEEP_TYPE_A);
+		sleep_enable_reg_info = acpi_hw_get_bit_register_info (ACPI_BITREG_SLEEP_ENABLE);
+
+		/* Get current value of PM1A control */
+
+		status = acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK,
+				 ACPI_REGISTER_PM1_CONTROL, &PM1Acontrol);
+		if (ACPI_SUCCESS (status)) {
+			/* Clear SLP_EN and SLP_TYP fields */
+
+			PM1Acontrol &= ~(sleep_type_reg_info->access_bit_mask |
+					   sleep_enable_reg_info->access_bit_mask);
+			PM1Bcontrol = PM1Acontrol;
+
+			/* Insert SLP_TYP bits */
+
+			PM1Acontrol |= (acpi_gbl_sleep_type_a << sleep_type_reg_info->bit_position);
+			PM1Bcontrol |= (acpi_gbl_sleep_type_b << sleep_type_reg_info->bit_position);
+
+			/* Just ignore any errors */
+
+			(void) acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK,
+					  ACPI_REGISTER_PM1A_CONTROL, PM1Acontrol);
+			(void) acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK,
+					  ACPI_REGISTER_PM1B_CONTROL, PM1Bcontrol);
+		}
+	}
+
 	/* Ensure enter_sleep_state_prep -> enter_sleep_state ordering */
 
 	acpi_gbl_sleep_type_a = ACPI_SLEEP_TYPE_INVALID;
@@ -407,12 +473,17 @@
 
 	arg_list.count = 1;
 	arg_list.pointer = &arg;
-
 	arg.type = ACPI_TYPE_INTEGER;
-	arg.integer.value = sleep_state;
 
 	/* Ignore any errors from these methods */
 
+	arg.integer.value = 0;
+	status = acpi_evaluate_object (NULL, "\\_SI._SST", &arg_list, NULL);
+	if (ACPI_FAILURE (status) && status != AE_NOT_FOUND) {
+		ACPI_REPORT_ERROR (("Method _SST failed, %s\n", acpi_format_exception (status)));
+	}
+
+	arg.integer.value = sleep_state;
 	status = acpi_evaluate_object (NULL, "\\_BFS", &arg_list, NULL);
 	if (ACPI_FAILURE (status) && status != AE_NOT_FOUND) {
 		ACPI_REPORT_ERROR (("Method _BFS failed, %s\n", acpi_format_exception (status)));
@@ -425,13 +496,13 @@
 
 	/* _WAK returns stuff - do we want to look at it? */
 
-	status = acpi_hw_enable_non_wakeup_gpes();
+	status = acpi_hw_enable_non_wakeup_gpes ();
 	if (ACPI_FAILURE (status)) {
 		return_ACPI_STATUS (status);
 	}
 
-	/* Disable BM arbitration */
-	status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 0, ACPI_MTX_LOCK);
+	/* Enable BM arbitration */
 
+	status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 0, ACPI_MTX_LOCK);
 	return_ACPI_STATUS (status);
 }
diff -Nru a/drivers/acpi/hardware/hwtimer.c b/drivers/acpi/hardware/hwtimer.c
--- a/drivers/acpi/hardware/hwtimer.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/hardware/hwtimer.c	Tue Feb  3 19:45:17 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/namespace/nsaccess.c b/drivers/acpi/namespace/nsaccess.c
--- a/drivers/acpi/namespace/nsaccess.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/acpi/namespace/nsaccess.c	Tue Feb  3 19:45:42 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -314,8 +314,8 @@
 	else {
 		prefix_node = scope_info->scope.node;
 		if (ACPI_GET_DESCRIPTOR_TYPE (prefix_node) != ACPI_DESC_TYPE_NAMED) {
-			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "[%p] Not a namespace node\n",
-				prefix_node));
+			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p Not a namespace node [%s]\n",
+					prefix_node, acpi_ut_get_descriptor_name (prefix_node)));
 			return_ACPI_STATUS (AE_AML_INTERNAL);
 		}
 
@@ -379,7 +379,7 @@
 
 			ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
 				"Searching relative to prefix scope [%4.4s] (%p)\n",
-				prefix_node->name.ascii, prefix_node));
+				acpi_ut_get_node_name (prefix_node), prefix_node));
 
 			/*
 			 * Handle multiple Parent Prefixes (carat) by just getting
@@ -413,7 +413,7 @@
 			if (search_parent_flag == ACPI_NS_NO_UPSEARCH) {
 				ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
 					"Search scope is [%4.4s], path has %d carat(s)\n",
-					this_node->name.ascii, num_carats));
+					acpi_ut_get_node_name (this_node), num_carats));
 			}
 		}
 
diff -Nru a/drivers/acpi/namespace/nsalloc.c b/drivers/acpi/namespace/nsalloc.c
--- a/drivers/acpi/namespace/nsalloc.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/acpi/namespace/nsalloc.c	Tue Feb  3 19:45:28 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -271,7 +271,7 @@
 		 * alphabetic placement.
 		 */
 		previous_child_node = NULL;
-		while (acpi_ns_compare_names (child_node->name.ascii, node->name.ascii) < 0) {
+		while (acpi_ns_compare_names (acpi_ut_get_node_name (child_node), acpi_ut_get_node_name (node)) < 0) {
 			if (child_node->flags & ANOBJ_END_OF_PEER_LIST) {
 				/* Last peer;  Clear end-of-list flag */
 
@@ -335,8 +335,9 @@
 	node->type = (u8) type;
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%4.4s (%s) added to %4.4s (%s) %p at %p\n",
-		node->name.ascii, acpi_ut_get_type_name (node->type),
-		parent_node->name.ascii, acpi_ut_get_type_name (parent_node->type), parent_node, node));
+		acpi_ut_get_node_name (node), acpi_ut_get_type_name (node->type),
+		acpi_ut_get_node_name (parent_node), acpi_ut_get_type_name (parent_node->type),
+		parent_node, node));
 
 	/*
 	 * Increment the reference count(s) of all parents up to
diff -Nru a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c
--- a/drivers/acpi/namespace/nsdump.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/acpi/namespace/nsdump.c	Tue Feb  3 19:45:42 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -50,8 +50,8 @@
 #define _COMPONENT          ACPI_NAMESPACE
 	 ACPI_MODULE_NAME    ("nsdump")
 
-#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
 
+#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
 
 /*******************************************************************************
  *
@@ -76,7 +76,7 @@
 		return;
 	}
 
-		/* Print the entire name */
+	/* Print the entire name */
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "["));
 
@@ -205,7 +205,7 @@
 	 * Now we can print out the pertinent information
 	 */
 	acpi_os_printf ("%4.4s %-12s %p ",
-			this_node->name.ascii, acpi_ut_get_type_name (type), this_node);
+			acpi_ut_get_node_name (this_node), acpi_ut_get_type_name (type), this_node);
 
 	dbg_level = acpi_dbg_level;
 	acpi_dbg_level = 0;
@@ -250,8 +250,7 @@
 		case ACPI_TYPE_INTEGER:
 
 			acpi_os_printf ("= %8.8X%8.8X\n",
-					 ACPI_HIDWORD (obj_desc->integer.value),
-					 ACPI_LODWORD (obj_desc->integer.value));
+					 ACPI_FORMAT_UINT64 (obj_desc->integer.value));
 			break;
 
 
@@ -302,8 +301,7 @@
 			acpi_os_printf ("[%s]", acpi_ut_get_region_name (obj_desc->region.space_id));
 			if (obj_desc->region.flags & AOPOBJ_DATA_VALID) {
 				acpi_os_printf (" Addr %8.8X%8.8X Len %.4X\n",
-						 ACPI_HIDWORD (obj_desc->region.address),
-						 ACPI_LODWORD (obj_desc->region.address),
+						 ACPI_FORMAT_UINT64 (obj_desc->region.address),
 						 obj_desc->region.length);
 			}
 			else {
@@ -324,7 +322,7 @@
 			if (obj_desc->buffer_field.buffer_obj &&
 				obj_desc->buffer_field.buffer_obj->buffer.node) {
 				acpi_os_printf ("Buf [%4.4s]",
-						obj_desc->buffer_field.buffer_obj->buffer.node->name.ascii);
+						acpi_ut_get_node_name (obj_desc->buffer_field.buffer_obj->buffer.node));
 			}
 			break;
 
@@ -332,29 +330,29 @@
 		case ACPI_TYPE_LOCAL_REGION_FIELD:
 
 			acpi_os_printf ("Rgn [%4.4s]",
-					obj_desc->common_field.region_obj->region.node->name.ascii);
+					acpi_ut_get_node_name (obj_desc->common_field.region_obj->region.node));
 			break;
 
 
 		case ACPI_TYPE_LOCAL_BANK_FIELD:
 
 			acpi_os_printf ("Rgn [%4.4s] Bnk [%4.4s]",
-					obj_desc->common_field.region_obj->region.node->name.ascii,
-					obj_desc->bank_field.bank_obj->common_field.node->name.ascii);
+					acpi_ut_get_node_name (obj_desc->common_field.region_obj->region.node),
+					acpi_ut_get_node_name (obj_desc->bank_field.bank_obj->common_field.node));
 			break;
 
 
 		case ACPI_TYPE_LOCAL_INDEX_FIELD:
 
 			acpi_os_printf ("Idx [%4.4s] Dat [%4.4s]",
-					obj_desc->index_field.index_obj->common_field.node->name.ascii,
-					obj_desc->index_field.data_obj->common_field.node->name.ascii);
+					acpi_ut_get_node_name (obj_desc->index_field.index_obj->common_field.node),
+					acpi_ut_get_node_name (obj_desc->index_field.data_obj->common_field.node));
 			break;
 
 
 		case ACPI_TYPE_LOCAL_ALIAS:
 
-			acpi_os_printf ("Target %4.4s (%p)\n", ((struct acpi_namespace_node *) obj_desc)->name.ascii, obj_desc);
+			acpi_os_printf ("Target %4.4s (%p)\n", acpi_ut_get_node_name (obj_desc), obj_desc);
 			break;
 
 		default:
@@ -371,7 +369,7 @@
 		case ACPI_TYPE_LOCAL_BANK_FIELD:
 		case ACPI_TYPE_LOCAL_INDEX_FIELD:
 
-			acpi_os_printf ("Off %.2X Len %.2X Acc %.2hd\n",
+			acpi_os_printf (" Off %.3X Len %.2X Acc %.2hd\n",
 					(obj_desc->common_field.base_byte_offset * 8)
 						+ obj_desc->common_field.start_field_bit_offset,
 					obj_desc->common_field.bit_length,
@@ -408,8 +406,8 @@
 
 		case ACPI_TYPE_INTEGER:
 
-			acpi_os_printf (" N:%X%X\n", ACPI_HIDWORD(obj_desc->integer.value),
-					 ACPI_LODWORD(obj_desc->integer.value));
+			acpi_os_printf (" I:%8.8X8.8%X\n",
+					ACPI_FORMAT_UINT64 (obj_desc->integer.value));
 			break;
 
 		case ACPI_TYPE_STRING:
@@ -485,7 +483,8 @@
 
 		default:
 
-			acpi_os_printf ("(String or Buffer ptr - not an object descriptor)\n");
+			acpi_os_printf ("(String or Buffer ptr - not an object descriptor) [%s]\n",
+					acpi_ut_get_descriptor_name (obj_desc));
 			bytes_to_dump = 16;
 			break;
 		}
@@ -581,7 +580,6 @@
 	info.owner_id = owner_id;
 	info.display_type = display_type;
 
-
 	(void) acpi_ns_walk_namespace (type, start_handle, max_depth,
 			 ACPI_NS_WALK_NO_UNLOCK, acpi_ns_dump_one_object,
 			 (void *) &info, NULL);
@@ -627,7 +625,6 @@
 		search_handle = acpi_gbl_root_node;
 		ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "\\\n"));
 	}
-
 
 	acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, max_depth,
 			ACPI_UINT32_MAX, search_handle);
diff -Nru a/drivers/acpi/namespace/nsdumpdv.c b/drivers/acpi/namespace/nsdumpdv.c
--- a/drivers/acpi/namespace/nsdumpdv.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/namespace/nsdumpdv.c	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -93,7 +93,7 @@
 
 		ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "    HID: %s, ADR: %8.8X%8.8X, Status: %X\n",
 				  info->hardware_id.value,
-				  ACPI_HIDWORD (info->address), ACPI_LODWORD (info->address),
+				  ACPI_FORMAT_UINT64 (info->address),
 				  info->current_status));
 		ACPI_MEM_FREE (info);
 	}
diff -Nru a/drivers/acpi/namespace/nseval.c b/drivers/acpi/namespace/nseval.c
--- a/drivers/acpi/namespace/nseval.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/namespace/nseval.c	Tue Feb  3 19:45:17 2004
@@ -6,7 +6,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/namespace/nsinit.c b/drivers/acpi/namespace/nsinit.c
--- a/drivers/acpi/namespace/nsinit.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/namespace/nsinit.c	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -144,10 +144,17 @@
 
 	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Executing all Device _STA and_INI methods:"));
 
-	/* Walk namespace for all objects of type Device */
+	status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
+	if (ACPI_FAILURE (status)) {
+		return_ACPI_STATUS (status);
+	}
 
-	status = acpi_ns_walk_namespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
-			  ACPI_UINT32_MAX, FALSE, acpi_ns_init_one_device, &info, NULL);
+	/* Walk namespace for all objects of type Device or Processor */
+
+	status = acpi_ns_walk_namespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+			  ACPI_UINT32_MAX, TRUE, acpi_ns_init_one_device, &info, NULL);
+
+	(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
 
 	if (ACPI_FAILURE (status)) {
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "walk_namespace failed! %s\n",
@@ -290,7 +297,8 @@
 		ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n"));
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
 				"Could not execute arguments for [%4.4s] (%s), %s\n",
-				node->name.ascii, acpi_ut_get_type_name (type), acpi_format_exception (status)));
+				acpi_ut_get_node_name (node), acpi_ut_get_type_name (type),
+				acpi_format_exception (status)));
 	}
 
 	/* Print a dot for each object unless we are going to print the entire pathname */
@@ -338,45 +346,48 @@
 	ACPI_FUNCTION_TRACE ("ns_init_one_device");
 
 
-	if ((acpi_dbg_level <= ACPI_LV_ALL_EXCEPTIONS) && (!(acpi_dbg_level & ACPI_LV_INFO))) {
-		ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "."));
-	}
-
-	info->device_count++;
-
-	status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
-	}
-
 	node = acpi_ns_map_handle_to_node (obj_handle);
 	if (!node) {
-		(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
 		return_ACPI_STATUS (AE_BAD_PARAMETER);
 	}
 
-	status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
+	/*
+	 * We will run _STA/_INI on Devices and Processors only
+	 */
+	if ((node->type != ACPI_TYPE_DEVICE) &&
+		(node->type != ACPI_TYPE_PROCESSOR)) {
+		return_ACPI_STATUS (AE_OK);
+	}
+
+	if ((acpi_dbg_level <= ACPI_LV_ALL_EXCEPTIONS) && (!(acpi_dbg_level & ACPI_LV_INFO))) {
+		ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "."));
 	}
 
+	info->device_count++;
+
 	/*
 	 * Run _STA to determine if we can run _INI on the device.
 	 */
 	ACPI_DEBUG_EXEC (acpi_ut_display_init_pathname (ACPI_TYPE_METHOD, node, "_STA"));
 	status = acpi_ut_execute_STA (node, &flags);
+
 	if (ACPI_FAILURE (status)) {
-		/* Ignore error and move on to next device */
+		if (node->type == ACPI_TYPE_DEVICE) {
+			/* Ignore error and move on to next device */
 
-		return_ACPI_STATUS (AE_OK);
-	}
+			return_ACPI_STATUS (AE_OK);
+		}
 
-	info->num_STA++;
+		/* _STA is not required for Processor objects */
+	}
+	else {
+		info->num_STA++;
 
-	if (!(flags & 0x01)) {
-		/* don't look at children of a not present device */
+		if (!(flags & 0x01)) {
+			/* Don't look at children of a not present device */
 
-		return_ACPI_STATUS(AE_CTRL_DEPTH);
+			return_ACPI_STATUS(AE_CTRL_DEPTH);
+		}
 	}
 
 	/*
diff -Nru a/drivers/acpi/namespace/nsload.c b/drivers/acpi/namespace/nsload.c
--- a/drivers/acpi/namespace/nsload.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/acpi/namespace/nsload.c	Tue Feb  3 19:45:42 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/namespace/nsnames.c b/drivers/acpi/namespace/nsnames.c
--- a/drivers/acpi/namespace/nsnames.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/acpi/namespace/nsnames.c	Tue Feb  3 19:45:43 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/namespace/nsobject.c b/drivers/acpi/namespace/nsobject.c
--- a/drivers/acpi/namespace/nsobject.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/namespace/nsobject.c	Tue Feb  3 19:45:17 2004
@@ -6,7 +6,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -104,7 +104,8 @@
 	if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) {
 		/* Not a name handle */
 
-		ACPI_REPORT_ERROR (("ns_attach_object: Invalid handle\n"));
+		ACPI_REPORT_ERROR (("ns_attach_object: Invalid handle %p [%s]\n",
+				node, acpi_ut_get_descriptor_name (node)));
 		return_ACPI_STATUS (AE_BAD_PARAMETER);
 	}
 
@@ -151,7 +152,7 @@
 	}
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Installing %p into Node %p [%4.4s]\n",
-		obj_desc, node, node->name.ascii));
+		obj_desc, node, acpi_ut_get_node_name (node)));
 
 	/* Detach an existing attached object if present */
 
@@ -234,7 +235,7 @@
 	node->type = ACPI_TYPE_ANY;
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Node %p [%4.4s] Object %p\n",
-		node, node->name.ascii, obj_desc));
+		node, acpi_ut_get_node_name (node), obj_desc));
 
 	/* Remove one reference on the object (and all subobjects) */
 
diff -Nru a/drivers/acpi/namespace/nsparse.c b/drivers/acpi/namespace/nsparse.c
--- a/drivers/acpi/namespace/nsparse.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/namespace/nsparse.c	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/namespace/nssearch.c b/drivers/acpi/namespace/nssearch.c
--- a/drivers/acpi/namespace/nssearch.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/acpi/namespace/nssearch.c	Tue Feb  3 19:45:42 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -119,7 +119,7 @@
 			ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
 				"Name [%4.4s] (%s) %p found in scope [%4.4s] %p\n",
 				(char *) &target_name, acpi_ut_get_type_name (next_node->type),
-				next_node, node->name.ascii, node));
+				next_node, acpi_ut_get_node_name (node), node));
 
 			*return_node = next_node;
 			return_ACPI_STATUS (AE_OK);
@@ -145,7 +145,7 @@
 	ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
 		"Name [%4.4s] (%s) not found in search in scope [%4.4s] %p first child %p\n",
 		(char *) &target_name, acpi_ut_get_type_name (type),
-		node->name.ascii, node, node->child));
+		acpi_ut_get_node_name (node), node, node->child));
 
 	return_ACPI_STATUS (AE_NOT_FOUND);
 }
diff -Nru a/drivers/acpi/namespace/nsutils.c b/drivers/acpi/namespace/nsutils.c
--- a/drivers/acpi/namespace/nsutils.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/acpi/namespace/nsutils.c	Tue Feb  3 19:45:18 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -977,8 +977,8 @@
 		parent_node = acpi_ns_get_parent_node (child_node);
 		if (parent_node) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Parent of %p [%4.4s] is %p [%4.4s]\n",
-				child_node, child_node->name.ascii,
-				parent_node, parent_node->name.ascii));
+				child_node, acpi_ut_get_node_name (child_node),
+				parent_node, acpi_ut_get_node_name (parent_node)));
 
 			if (parent_node->name.integer) {
 				return_VALUE ((acpi_name) parent_node->name.integer);
@@ -986,7 +986,7 @@
 		}
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "unable to find parent of %p (%4.4s)\n",
-			child_node, child_node->name.ascii));
+			child_node, acpi_ut_get_node_name (child_node)));
 	}
 
 	return_VALUE (ACPI_UNKNOWN_NAME);
diff -Nru a/drivers/acpi/namespace/nswalk.c b/drivers/acpi/namespace/nswalk.c
--- a/drivers/acpi/namespace/nswalk.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/acpi/namespace/nswalk.c	Tue Feb  3 19:45:43 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c
--- a/drivers/acpi/namespace/nsxfeval.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/acpi/namespace/nsxfeval.c	Tue Feb  3 19:45:42 2004
@@ -6,7 +6,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/namespace/nsxfname.c b/drivers/acpi/namespace/nsxfname.c
--- a/drivers/acpi/namespace/nsxfname.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/namespace/nsxfname.c	Tue Feb  3 19:45:17 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -199,7 +199,7 @@
 
 	/* Just copy the ACPI name from the Node and zero terminate it */
 
-	ACPI_STRNCPY (buffer->pointer, node->name.ascii,
+	ACPI_STRNCPY (buffer->pointer, acpi_ut_get_node_name (node),
 			 ACPI_NAME_SIZE);
 	((char *) buffer->pointer) [ACPI_NAME_SIZE] = 0;
 	status = AE_OK;
diff -Nru a/drivers/acpi/namespace/nsxfobj.c b/drivers/acpi/namespace/nsxfobj.c
--- a/drivers/acpi/namespace/nsxfobj.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/namespace/nsxfobj.c	Tue Feb  3 19:45:16 2004
@@ -6,7 +6,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/osl.c b/drivers/acpi/osl.c
--- a/drivers/acpi/osl.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/acpi/osl.c	Tue Feb  3 19:45:41 2004
@@ -59,13 +59,13 @@
 #ifdef ENABLE_DEBUGGER
 #include <linux/kdb.h>
 /* stuff for debugger support */
-int acpi_in_debugger = 0;
+int acpi_in_debugger;
 extern char line_buf[80];
 #endif /*ENABLE_DEBUGGER*/
 
-static int acpi_irq_irq = 0;
-static OSD_HANDLER acpi_irq_handler = NULL;
-static void *acpi_irq_context = NULL;
+static int acpi_irq_irq;
+static OSD_HANDLER acpi_irq_handler;
+static void *acpi_irq_context;
 
 acpi_status
 acpi_os_initialize(void)
@@ -257,13 +257,13 @@
 		return AE_OK;
 	}
 #endif
-	acpi_irq_irq = irq;
 	acpi_irq_handler = handler;
 	acpi_irq_context = context;
 	if (request_irq(irq, acpi_irq, SA_SHIRQ, "acpi", acpi_irq)) {
 		printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq);
 		return AE_NOT_ACQUIRED;
 	}
+	acpi_irq_irq = irq;
 
 	return AE_OK;
 }
@@ -271,12 +271,13 @@
 acpi_status
 acpi_os_remove_interrupt_handler(u32 irq, OSD_HANDLER handler)
 {
-	if (acpi_irq_handler) {
+	if (irq) {
 #ifdef CONFIG_IA64
 		irq = acpi_irq_to_vector(irq);
 #endif
 		free_irq(irq, acpi_irq);
 		acpi_irq_handler = NULL;
+		acpi_irq_irq = 0;
 	}
 
 	return AE_OK;
diff -Nru a/drivers/acpi/parser/psargs.c b/drivers/acpi/parser/psargs.c
--- a/drivers/acpi/parser/psargs.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/parser/psargs.c	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -490,7 +490,7 @@
 acpi_ps_get_next_field (
 	struct acpi_parse_state         *parser_state)
 {
-	u32                             aml_offset = ACPI_PTR_DIFF (parser_state->aml,
+	u32                             aml_offset = (u32) ACPI_PTR_DIFF (parser_state->aml,
 			 parser_state->aml_start);
 	union acpi_parse_object         *field;
 	u16                             opcode;
@@ -677,7 +677,7 @@
 
 			/* Fill in bytelist data */
 
-			arg->common.value.size = ACPI_PTR_DIFF (parser_state->pkg_end,
+			arg->common.value.size = (u32) ACPI_PTR_DIFF (parser_state->pkg_end,
 					  parser_state->aml);
 			arg->named.data = parser_state->aml;
 
diff -Nru a/drivers/acpi/parser/psopcode.c b/drivers/acpi/parser/psopcode.c
--- a/drivers/acpi/parser/psopcode.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/parser/psopcode.c	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c
--- a/drivers/acpi/parser/psparse.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/parser/psparse.c	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -498,7 +498,7 @@
 		if (!op) {
 			/* Get the next opcode from the AML stream */
 
-			walk_state->aml_offset = ACPI_PTR_DIFF (parser_state->aml,
+			walk_state->aml_offset = (u32) ACPI_PTR_DIFF (parser_state->aml,
 					   parser_state->aml_start);
 			walk_state->opcode   = acpi_ps_peek_opcode (parser_state);
 
@@ -710,7 +710,7 @@
 
 				while (GET_CURRENT_ARG_TYPE (walk_state->arg_types) &&
 						!walk_state->arg_count) {
-					walk_state->aml_offset = ACPI_PTR_DIFF (parser_state->aml,
+					walk_state->aml_offset = (u32) ACPI_PTR_DIFF (parser_state->aml,
 							   parser_state->aml_start);
 					status = acpi_ps_get_next_arg (walk_state, parser_state,
 							 GET_CURRENT_ARG_TYPE (walk_state->arg_types), &arg);
diff -Nru a/drivers/acpi/parser/psscope.c b/drivers/acpi/parser/psscope.c
--- a/drivers/acpi/parser/psscope.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/parser/psscope.c	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/parser/pstree.c b/drivers/acpi/parser/pstree.c
--- a/drivers/acpi/parser/pstree.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/parser/pstree.c	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/parser/psutils.c b/drivers/acpi/parser/psutils.c
--- a/drivers/acpi/parser/psutils.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/acpi/parser/psutils.c	Tue Feb  3 19:45:29 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/parser/pswalk.c b/drivers/acpi/parser/pswalk.c
--- a/drivers/acpi/parser/pswalk.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/acpi/parser/pswalk.c	Tue Feb  3 19:45:34 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/parser/psxface.c b/drivers/acpi/parser/psxface.c
--- a/drivers/acpi/parser/psxface.c	Tue Feb  3 19:45:40 2004
+++ b/drivers/acpi/parser/psxface.c	Tue Feb  3 19:45:40 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -127,7 +127,8 @@
 
 	op = acpi_ps_create_scope_op ();
 	if (!op) {
-		return_ACPI_STATUS (AE_NO_MEMORY);
+		status = AE_NO_MEMORY;
+		goto cleanup1;
 	}
 
 	/*
@@ -142,20 +143,24 @@
 	walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id,
 			   NULL, NULL, NULL);
 	if (!walk_state) {
-		return_ACPI_STATUS (AE_NO_MEMORY);
+		status = AE_NO_MEMORY;
+		goto cleanup2;
 	}
 
 	status = acpi_ds_init_aml_walk (walk_state, op, method_node, obj_desc->method.aml_start,
 			  obj_desc->method.aml_length, NULL, NULL, 1);
 	if (ACPI_FAILURE (status)) {
-		acpi_ds_delete_walk_state (walk_state);
-		return_ACPI_STATUS (status);
+		goto cleanup3;
 	}
 
 	/* Parse the AML */
 
 	status = acpi_ps_parse_aml (walk_state);
 	acpi_ps_delete_parse_tree (op);
+	if (ACPI_FAILURE (status)) {
+		goto cleanup1; /* Walk state is already deleted */
+
+	}
 
 	/*
 	 * 2) Execute the method.  Performs second pass parse simultaneously
@@ -168,7 +173,8 @@
 
 	op = acpi_ps_create_scope_op ();
 	if (!op) {
-		return_ACPI_STATUS (AE_NO_MEMORY);
+		status = AE_NO_MEMORY;
+		goto cleanup1;
 	}
 
 	/* Init new op with the method name and pointer back to the NS node */
@@ -180,22 +186,30 @@
 
 	walk_state = acpi_ds_create_walk_state (0, NULL, NULL, NULL);
 	if (!walk_state) {
-		return_ACPI_STATUS (AE_NO_MEMORY);
+		status = AE_NO_MEMORY;
+		goto cleanup2;
 	}
 
 	status = acpi_ds_init_aml_walk (walk_state, op, method_node, obj_desc->method.aml_start,
 			  obj_desc->method.aml_length, params, return_obj_desc, 3);
 	if (ACPI_FAILURE (status)) {
-		acpi_ds_delete_walk_state (walk_state);
-		return_ACPI_STATUS (status);
+		goto cleanup3;
 	}
 
 	/*
 	 * The walk of the parse tree is where we actually execute the method
 	 */
 	status = acpi_ps_parse_aml (walk_state);
+	goto cleanup2; /* Walk state already deleted */
+
+
+cleanup3:
+	acpi_ds_delete_walk_state (walk_state);
+
+cleanup2:
 	acpi_ps_delete_parse_tree (op);
 
+cleanup1:
 	if (params) {
 		/* Take away the extra reference that we gave the parameters above */
 
@@ -204,6 +218,10 @@
 
 			(void) acpi_ut_update_object_reference (params[i], REF_DECREMENT);
 		}
+	}
+
+	if (ACPI_FAILURE (status)) {
+		return_ACPI_STATUS (status);
 	}
 
 	/*
diff -Nru a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
--- a/drivers/acpi/pci_link.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/pci_link.c	Tue Feb  3 19:45:16 2004
@@ -99,7 +99,7 @@
 	void			*context)
 {
 	struct acpi_pci_link	*link = (struct acpi_pci_link *) context;
-	int			i = 0;
+	u32			i = 0;
 
 	ACPI_FUNCTION_TRACE("acpi_pci_link_check_possible");
 
@@ -294,7 +294,10 @@
 
 	if (!link->irq.active) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "No active IRQ resource found\n"));
-		printk(KERN_WARNING "_CRS returns NULL! Using IRQ %d for device (%s [%s]).\n", irq, acpi_device_name(link->device), acpi_device_bid(link->device));
+		printk(KERN_WARNING "_CRS returns NULL! Using IRQ %d for"
+			"device (%s [%s]).\n", irq,
+			acpi_device_name(link->device),
+			acpi_device_bid(link->device));
 		link->irq.active = irq;
 	}
 	
@@ -429,30 +432,67 @@
                             PCI Link IRQ Management
    -------------------------------------------------------------------------- */
 
-#define ACPI_MAX_IRQS		256
-#define ACPI_MAX_ISA_IRQ	16
-
 /*
- * IRQ penalties are used to promote PCI IRQ balancing.  We set each ISA-
- * possible IRQ (0-15) with a default penalty relative to its feasibility
- * for PCI's use:
+ * "acpi_irq_balance" (default in APIC mode) enables ACPI to use PIC Interrupt
+ * Link Devices to move the PIRQs around to minimize sharing.
+ * 
+ * "acpi_irq_nobalance" (default in PIC mode) tells ACPI not to move any PIC IRQs
+ * that the BIOS has already set to active.  This is necessary because
+ * ACPI has no automatic means of knowing what ISA IRQs are used.  Note that
+ * if the BIOS doesn't set a Link Device active, ACPI needs to program it
+ * even if acpi_irq_nobalance is set.
+ *
+ * A tables of penalties avoids directing PCI interrupts to well known
+ * ISA IRQs. Boot params are available to over-ride the default table:
  *
- *   Never use:		0, 1, 2 (timer, keyboard, and cascade)
- *   Avoid using:	13, 14, and 15 (FP error and IDE)
- *   Penalize:		3, 4, 6, 7, 12 (known ISA uses)
+ * List interrupts that are free for PCI use.
+ * acpi_irq_pci=n[,m]
  *
- * Thus we're left with IRQs 5, 9, 10, 11, and everything above 15 (IO[S]APIC)
- * as 'best bets' for PCI use.
+ * List interrupts that should not be used for PCI:
+ * acpi_irq_isa=n[,m]
+ *
+ * Note that PCI IRQ routers have a list of possible IRQs,
+ * which may not include the IRQs this table says are available.
+ * 
+ * Since this heuristic can't tell the difference between a link
+ * that no device will attach to, vs. a link which may be shared
+ * by multiple active devices -- it is not optimal.
+ *
+ * If interrupt performance is that important, get an IO-APIC system
+ * with a pin dedicated to each device.  Or for that matter, an MSI
+ * enabled system.
  */
 
+#define ACPI_MAX_IRQS		256
+#define ACPI_MAX_ISA_IRQ	16
+
+#define PIRQ_PENALTY_PCI_AVAILABLE	(0)
+#define PIRQ_PENALTY_PCI_POSSIBLE	(16*16)
+#define PIRQ_PENALTY_PCI_USING		(16*16*16)
+#define PIRQ_PENALTY_ISA_TYPICAL	(16*16*16*16)
+#define PIRQ_PENALTY_ISA_USED		(16*16*16*16*16)
+#define PIRQ_PENALTY_ISA_ALWAYS		(16*16*16*16*16*16)
+
 static int acpi_irq_penalty[ACPI_MAX_IRQS] = {
-	1000000,  1000000,  1000000,    10000, 
-	  10000,        0,    10000,    10000,
-	  10000,        0,        0,        0, 
-	  10000,   100000,   100000,   100000,
+	PIRQ_PENALTY_ISA_ALWAYS,	/* IRQ0 timer */
+	PIRQ_PENALTY_ISA_ALWAYS,	/* IRQ1 keyboard */
+	PIRQ_PENALTY_ISA_ALWAYS,	/* IRQ2 cascade */
+	PIRQ_PENALTY_ISA_TYPICAL,	/* IRQ3	serial */
+	PIRQ_PENALTY_ISA_TYPICAL,	/* IRQ4	serial */
+	PIRQ_PENALTY_ISA_TYPICAL,	/* IRQ5 sometimes SoundBlaster */
+	PIRQ_PENALTY_ISA_TYPICAL,	/* IRQ6 */
+	PIRQ_PENALTY_ISA_TYPICAL,	/* IRQ7 parallel, spurious */
+	PIRQ_PENALTY_ISA_TYPICAL,	/* IRQ8 rtc, sometimes */
+	PIRQ_PENALTY_PCI_AVAILABLE,	/* IRQ9  PCI, often acpi */
+	PIRQ_PENALTY_PCI_AVAILABLE,	/* IRQ10 PCI */
+	PIRQ_PENALTY_PCI_AVAILABLE,	/* IRQ11 PCI */
+	PIRQ_PENALTY_ISA_TYPICAL,	/* IRQ12 mouse */
+	PIRQ_PENALTY_ISA_USED,	/* IRQ13 fpe, sometimes */
+	PIRQ_PENALTY_ISA_USED,	/* IRQ14 ide0 */
+	PIRQ_PENALTY_ISA_USED,	/* IRQ15 ide1 */
+			/* >IRQ15 */
 };
 
-
 int
 acpi_pci_link_check (void)
 {
@@ -473,20 +513,30 @@
 			continue;
 		}
 
-		if (link->irq.active)
-			acpi_irq_penalty[link->irq.active] += 100;
-		else if (link->irq.possible_count) {
-			int penalty = 100 / link->irq.possible_count;
-			for (i=0; i<link->irq.possible_count; i++) {
+		/*
+		 * reflect the possible and active irqs in the penalty table --
+		 * useful for breaking ties.
+		 */
+		if (link->irq.possible_count) {
+			int penalty = PIRQ_PENALTY_PCI_POSSIBLE / link->irq.possible_count;
+
+			for (i = 0; i < link->irq.possible_count; i++) {
 				if (link->irq.possible[i] < ACPI_MAX_ISA_IRQ)
 					acpi_irq_penalty[link->irq.possible[i]] += penalty;
 			}
+
+		} else if (link->irq.active) {
+			acpi_irq_penalty[link->irq.active] += PIRQ_PENALTY_PCI_POSSIBLE;
 		}
 	}
+	/* Add a penalty for the SCI */
+	acpi_irq_penalty[acpi_fadt.sci_int] += PIRQ_PENALTY_PCI_USING;
 
 	return_VALUE(0);
 }
 
+static int acpi_irq_balance;	/* 0: static, 1: balance */
+
 static int acpi_pci_link_allocate(struct acpi_pci_link* link) {
 	int irq;
 	int i;
@@ -500,12 +550,14 @@
 		irq = link->irq.active;
 	} else {
 		irq = link->irq.possible[0];
+	}
 
+	if (acpi_irq_balance || !link->irq.active) {
 		/*
 		 * Select the best IRQ.  This is done in reverse to promote
 		 * the use of IRQs 9, 10, 11, and >15.
 		 */
-		for (i=(link->irq.possible_count-1); i>0; i--) {
+		for (i = (link->irq.possible_count - 1); i >= 0; i--) {
 			if (acpi_irq_penalty[irq] > acpi_irq_penalty[link->irq.possible[i]])
 				irq = link->irq.possible[i];
 		}
@@ -518,13 +570,14 @@
 			acpi_device_bid(link->device));
 		return_VALUE(-ENODEV);
 	} else {
-		acpi_irq_penalty[link->irq.active] += 100;
+		acpi_irq_penalty[link->irq.active] += PIRQ_PENALTY_PCI_USING;
 		printk(PREFIX "%s [%s] enabled at IRQ %d\n", 
 			acpi_device_name(link->device),
 			acpi_device_bid(link->device), link->irq.active);
 	}
 
 	link->irq.setonboot = 1;
+
 	return_VALUE(0);
 }
 
@@ -607,9 +660,12 @@
 	if (result)
 		goto end;
 
+	/* query and set link->irq.active */
 	acpi_pci_link_get_current(link);
 
-	printk(PREFIX "%s [%s] (IRQs", acpi_device_name(device), acpi_device_bid(device));
+//#ifdef CONFIG_ACPI_DEBUG
+	printk(PREFIX "%s [%s] (IRQs", acpi_device_name(device),
+		acpi_device_bid(device));
 	for (i = 0; i < link->irq.possible_count; i++) {
 		if (link->irq.active == link->irq.possible[i]) {
 			printk(" *%d", link->irq.possible[i]);
@@ -619,6 +675,7 @@
 			printk(" %d", link->irq.possible[i]);
 	}
 	printk(")\n");
+//#endif /* CONFIG_ACPI_DEBUG */
 
 	/* TBD: Acquire/release lock */
 	list_add_tail(&link->node, &acpi_link.entries);
@@ -653,6 +710,77 @@
 
 	return_VALUE(0);
 }
+
+/*
+ * modify acpi_irq_penalty[] from cmdline
+ */
+static int __init acpi_irq_penalty_update(char *str, int used)
+{
+	int i;
+
+	for (i = 0; i < 16; i++) {
+		int retval;
+		int irq;
+
+		retval = get_option(&str,&irq);
+
+		if (!retval)
+			break;	/* no number found */
+
+		if (irq < 0)
+			continue;
+		
+		if (irq >= ACPI_MAX_IRQS)
+			continue;
+
+		if (used)
+			acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED;
+		else
+			acpi_irq_penalty[irq] = PIRQ_PENALTY_PCI_AVAILABLE;
+
+		if (retval != 2)	/* no next number */
+			break;
+	}
+	return 1;
+}
+
+/*
+ * Over-ride default table to reserve additional IRQs for use by ISA
+ * e.g. acpi_irq_isa=5
+ * Useful for telling ACPI how not to interfere with your ISA sound card.
+ */
+static int __init acpi_irq_isa(char *str)
+{
+	return(acpi_irq_penalty_update(str, 1));
+}
+__setup("acpi_irq_isa=", acpi_irq_isa);
+
+/*
+ * Over-ride default table to free additional IRQs for use by PCI
+ * e.g. acpi_irq_pci=7,15
+ * Used for acpi_irq_balance to free up IRQs to reduce PCI IRQ sharing.
+ */
+static int __init acpi_irq_pci(char *str)
+{
+	return(acpi_irq_penalty_update(str, 0));
+}
+__setup("acpi_irq_pci=", acpi_irq_pci);
+
+static int __init acpi_irq_nobalance_set(char *str)
+{
+printk("ACPI STATIC SET\n");
+	acpi_irq_balance = 0;
+	return(1);
+}
+__setup("acpi_irq_nobalance", acpi_irq_nobalance_set);
+
+int __init acpi_irq_balance_set(char *str)
+{
+printk("ACPI BALANCE SET\n");
+	acpi_irq_balance = 1;
+	return(1);
+}
+__setup("acpi_irq_balance", acpi_irq_balance_set);
 
 
 static int __init acpi_pci_link_init (void)
diff -Nru a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
--- a/drivers/acpi/pci_root.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/pci_root.c	Tue Feb  3 19:45:17 2004
@@ -62,8 +62,6 @@
 	acpi_handle		handle;
 	struct acpi_pci_id	id;
 	struct pci_bus		*bus;
-	u64			mem_tra;
-	u64			io_tra;
 };
 
 static LIST_HEAD(acpi_pci_roots);
@@ -115,97 +113,6 @@
 	}
 }
 
-void
-acpi_pci_get_translations (
-	struct acpi_pci_id	*id,
-	u64			*mem_tra,
-	u64			*io_tra)
-{
-	struct list_head	*node = NULL;
-	struct acpi_pci_root	*entry;
-
-	/* TBD: Locking */
-	list_for_each(node, &acpi_pci_roots) {
-		entry = list_entry(node, struct acpi_pci_root, node);
-		if ((id->segment == entry->id.segment)
-			&& (id->bus == entry->id.bus)) {
-			*mem_tra = entry->mem_tra;
-			*io_tra = entry->io_tra;
-			return;
-		}
-	}
-
-	*mem_tra = 0;
-	*io_tra = 0;
-}
-
-
-static u64
-acpi_pci_root_bus_tra (
-       struct acpi_resource	*resource,
-       int			type)
-{
-	struct acpi_resource_address16 *address16;
-	struct acpi_resource_address32 *address32;
-	struct acpi_resource_address64 *address64;
-
-	while (1) {
-		switch (resource->id) {
-		case ACPI_RSTYPE_END_TAG:
-			return 0;
-
-		case ACPI_RSTYPE_ADDRESS16:
-			address16 = (struct acpi_resource_address16 *) &resource->data;
-			if (type == address16->resource_type) {
-				return address16->address_translation_offset;
-			}
-			break;
-
-		case ACPI_RSTYPE_ADDRESS32:
-			address32 = (struct acpi_resource_address32 *) &resource->data;
-			if (type == address32->resource_type) {
-				return address32->address_translation_offset;
-			}
-			break;
-
-		case ACPI_RSTYPE_ADDRESS64:
-			address64 = (struct acpi_resource_address64 *) &resource->data;
-			if (type == address64->resource_type) {
-				return address64->address_translation_offset;
-			}
-			break;
-		}
-		resource = ACPI_PTR_ADD (struct acpi_resource,
-				resource, resource->length);
-	}
-
-	return 0;
-}
-
-
-static int
-acpi_pci_evaluate_crs (
-	struct acpi_pci_root	*root)
-{
-	acpi_status		status;
-	struct acpi_buffer	buffer = {ACPI_ALLOCATE_BUFFER, NULL};
-
-	ACPI_FUNCTION_TRACE("acpi_pci_evaluate_crs");
-
-	status = acpi_get_current_resources (root->handle, &buffer);
-	if (ACPI_FAILURE(status))
-		return_VALUE(-ENODEV);
-
-	root->io_tra = acpi_pci_root_bus_tra ((struct acpi_resource *)
-			buffer.pointer, ACPI_IO_RANGE);
-	root->mem_tra = acpi_pci_root_bus_tra ((struct acpi_resource *)
-			buffer.pointer, ACPI_MEMORY_RANGE);
-
-	acpi_os_free(buffer.pointer);
-	return_VALUE(0);
-}
-
-
 static int
 acpi_pci_root_add (
 	struct acpi_device	*device)
@@ -288,10 +195,8 @@
 	root->id.function = device->pnp.bus_address & 0xFFFF;
 
 	/*
-	 * Evaluate _CRS to get root bridge resources
 	 * TBD: Need PCI interface for enumeration/configuration of roots.
 	 */
- 	acpi_pci_evaluate_crs(root);
 
  	/* TBD: Locking */
  	list_add_tail(&root->node, &acpi_pci_roots);
diff -Nru a/drivers/acpi/power.c b/drivers/acpi/power.c
--- a/drivers/acpi/power.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/acpi/power.c	Tue Feb  3 19:45:28 2004
@@ -387,7 +387,7 @@
                               FS Interface (/proc)
    -------------------------------------------------------------------------- */
 
-struct proc_dir_entry		*acpi_power_dir = NULL;
+struct proc_dir_entry		*acpi_power_dir;
 
 static int acpi_power_seq_show(struct seq_file *seq, void *offset)
 {
diff -Nru a/drivers/acpi/processor.c b/drivers/acpi/processor.c
--- a/drivers/acpi/processor.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/acpi/processor.c	Tue Feb  3 19:45:34 2004
@@ -138,7 +138,7 @@
 
 static struct acpi_processor	*processors[NR_CPUS];
 static struct acpi_processor_errata errata;
-static void (*pm_idle_save)(void) = NULL;
+static void (*pm_idle_save)(void);
 
 
 /* --------------------------------------------------------------------------
diff -Nru a/drivers/acpi/resources/rsaddr.c b/drivers/acpi/resources/rsaddr.c
--- a/drivers/acpi/resources/rsaddr.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/acpi/resources/rsaddr.c	Tue Feb  3 19:45:28 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c
--- a/drivers/acpi/resources/rscalc.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/acpi/resources/rscalc.c	Tue Feb  3 19:45:28 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -696,7 +696,7 @@
 		default:
 			/*
 			 * If we get here, everything is out of sync,
-			 *  so exit with an error
+			 * exit with an error
 			 */
 			return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
 		}
@@ -704,7 +704,7 @@
 		/*
 		 * Update the return value and counter
 		 */
-		buffer_size += ACPI_ALIGN_RESOURCE_SIZE(structure_size);
+		buffer_size += (u32) ACPI_ALIGN_RESOURCE_SIZE (structure_size);
 		bytes_parsed += bytes_consumed;
 
 		/*
diff -Nru a/drivers/acpi/resources/rscreate.c b/drivers/acpi/resources/rscreate.c
--- a/drivers/acpi/resources/rscreate.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/resources/rscreate.c	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -331,7 +331,7 @@
 
 		/* Now align the current length */
 
-		user_prt->length = ACPI_ROUND_UP_to_64_bITS (user_prt->length);
+		user_prt->length = (u32) ACPI_ROUND_UP_to_64_bITS (user_prt->length);
 
 		/*
 		 * 4) Fourth subobject: Dereference the PRT.source_index
diff -Nru a/drivers/acpi/resources/rsdump.c b/drivers/acpi/resources/rsdump.c
--- a/drivers/acpi/resources/rsdump.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/acpi/resources/rsdump.c	Tue Feb  3 19:45:29 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -899,24 +899,19 @@
 			 "" : "not ");
 
 	acpi_os_printf ("  Granularity: %8.8X%8.8X\n",
-			 ACPI_HIDWORD (address64_data->granularity),
-			 ACPI_LODWORD (address64_data->granularity));
+			 ACPI_FORMAT_UINT64 (address64_data->granularity));
 
 	acpi_os_printf ("  Address range min: %8.8X%8.8X\n",
-			 ACPI_HIDWORD (address64_data->min_address_range),
-			 ACPI_HIDWORD (address64_data->min_address_range));
+			 ACPI_FORMAT_UINT64 (address64_data->min_address_range));
 
 	acpi_os_printf ("  Address range max: %8.8X%8.8X\n",
-			 ACPI_HIDWORD (address64_data->max_address_range),
-			 ACPI_HIDWORD (address64_data->max_address_range));
+			 ACPI_FORMAT_UINT64 (address64_data->max_address_range));
 
 	acpi_os_printf ("  Address translation offset: %8.8X%8.8X\n",
-			 ACPI_HIDWORD (address64_data->address_translation_offset),
-			 ACPI_HIDWORD (address64_data->address_translation_offset));
+			 ACPI_FORMAT_UINT64 (address64_data->address_translation_offset));
 
 	acpi_os_printf ("  Address Length: %8.8X%8.8X\n",
-			 ACPI_HIDWORD (address64_data->address_length),
-			 ACPI_HIDWORD (address64_data->address_length));
+			 ACPI_FORMAT_UINT64 (address64_data->address_length));
 
 	if(0xFF != address64_data->resource_source.index) {
 		acpi_os_printf ("  Resource Source Index: %X\n",
@@ -1126,8 +1121,7 @@
 			acpi_os_printf ("PCI IRQ Routing Table structure %X.\n", count++);
 
 			acpi_os_printf ("  Address: %8.8X%8.8X\n",
-					 ACPI_HIDWORD (prt_element->address),
-					 ACPI_LODWORD (prt_element->address));
+					 ACPI_FORMAT_UINT64 (prt_element->address));
 
 			acpi_os_printf ("  Pin: %X\n", prt_element->pin);
 
diff -Nru a/drivers/acpi/resources/rsio.c b/drivers/acpi/resources/rsio.c
--- a/drivers/acpi/resources/rsio.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/resources/rsio.c	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/resources/rsirq.c b/drivers/acpi/resources/rsirq.c
--- a/drivers/acpi/resources/rsirq.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/acpi/resources/rsirq.c	Tue Feb  3 19:45:43 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -132,26 +132,28 @@
 		temp8 = *buffer;
 
 		/*
-		 * Check for HE, LL or HL
+		 * Check for HE, LL interrupts
 		 */
-		if (temp8 & 0x01) {
+		switch (temp8 & 0x09) {
+		case 0x01: /* HE */
 			output_struct->data.irq.edge_level = ACPI_EDGE_SENSITIVE;
 			output_struct->data.irq.active_high_low = ACPI_ACTIVE_HIGH;
-		}
-		else {
-			if (temp8 & 0x8) {
-				output_struct->data.irq.edge_level = ACPI_LEVEL_SENSITIVE;
-				output_struct->data.irq.active_high_low = ACPI_ACTIVE_LOW;
-			}
-			else {
-				/*
-				 * Only _LL and _HE polarity/trigger interrupts
-				 * are allowed (ACPI spec v1.0b ection 6.4.2.1),
-				 * so an error will occur if we reach this point
-				 */
-				ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid interrupt polarity/trigger in resource list\n"));
-				return_ACPI_STATUS (AE_BAD_DATA);
-			}
+			break;
+
+		case 0x08: /* LL */
+			output_struct->data.irq.edge_level = ACPI_LEVEL_SENSITIVE;
+			output_struct->data.irq.active_high_low = ACPI_ACTIVE_LOW;
+			break;
+
+		default:
+			/*
+			 * Only _LL and _HE polarity/trigger interrupts
+			 * are allowed (ACPI spec, section "IRQ Format")
+			 * so 0x00 and 0x09 are illegal.
+			 */
+			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+				"Invalid interrupt polarity/trigger in resource list, %X\n", temp8));
+			return_ACPI_STATUS (AE_BAD_DATA);
 		}
 
 		/*
@@ -419,7 +421,7 @@
 		 * Point the String pointer to the end of this structure.
 		 */
 		output_struct->data.extended_irq.resource_source.string_ptr =
-				(char *)(output_struct + struct_size);
+				(char *)((char *) output_struct + struct_size);
 
 		temp_ptr = (u8 *) output_struct->data.extended_irq.resource_source.string_ptr;
 
diff -Nru a/drivers/acpi/resources/rslist.c b/drivers/acpi/resources/rslist.c
--- a/drivers/acpi/resources/rslist.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/acpi/resources/rslist.c	Tue Feb  3 19:45:43 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -312,8 +312,8 @@
 		 * Set the Buffer to the next structure
 		 */
 		resource = ACPI_CAST_PTR (struct acpi_resource, buffer);
-		resource->length = ACPI_ALIGN_RESOURCE_SIZE(resource->length);
-		buffer += ACPI_ALIGN_RESOURCE_SIZE(structure_size);
+		resource->length = (u32) ACPI_ALIGN_RESOURCE_SIZE (resource->length);
+		buffer += ACPI_ALIGN_RESOURCE_SIZE (structure_size);
 
 	} /*  end while */
 
diff -Nru a/drivers/acpi/resources/rsmemory.c b/drivers/acpi/resources/rsmemory.c
--- a/drivers/acpi/resources/rsmemory.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/acpi/resources/rsmemory.c	Tue Feb  3 19:45:41 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/resources/rsmisc.c b/drivers/acpi/resources/rsmisc.c
--- a/drivers/acpi/resources/rsmisc.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/resources/rsmisc.c	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/resources/rsutils.c b/drivers/acpi/resources/rsutils.c
--- a/drivers/acpi/resources/rsutils.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/resources/rsutils.c	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/resources/rsxface.c b/drivers/acpi/resources/rsxface.c
--- a/drivers/acpi/resources/rsxface.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/acpi/resources/rsxface.c	Tue Feb  3 19:45:34 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/scan.c b/drivers/acpi/scan.c
--- a/drivers/acpi/scan.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/scan.c	Tue Feb  3 19:45:17 2004
@@ -336,6 +336,9 @@
 
 	ACPI_FUNCTION_TRACE("acpi_bus_register_driver");
 
+	if (acpi_disabled)
+		return_VALUE(-ENODEV);
+
 	if (driver) {
 		spin_lock(&acpi_device_lock);
 		list_add_tail(&driver->node, &acpi_bus_drivers);
@@ -703,11 +706,11 @@
 	switch (type) {
 	case ACPI_BUS_TYPE_DEVICE:
 		result = acpi_bus_get_status(device);
-		if (!result)
-			break;
-		if (!device->status.present) 
+		if (ACPI_FAILURE(result) || !device->status.present) {
 			result = -ENOENT;
-		goto end;
+			goto end;
+		}
+		break;
 	default:
 		STRUCT_TO_INT(device->status) = 0x0F;
 		break;
diff -Nru a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c
--- a/drivers/acpi/sleep/proc.c	Tue Feb  3 19:45:33 2004
+++ b/drivers/acpi/sleep/proc.c	Tue Feb  3 19:45:33 2004
@@ -374,6 +374,9 @@
 {
 	struct proc_dir_entry	*entry = NULL;
 
+	if (acpi_disabled)
+		return 0;
+ 
 	/* 'sleep' [R/W]*/
 	entry = create_proc_entry(ACPI_SYSTEM_FILE_SLEEP,
 				  S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
diff -Nru a/drivers/acpi/tables/tbconvrt.c b/drivers/acpi/tables/tbconvrt.c
--- a/drivers/acpi/tables/tbconvrt.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/tables/tbconvrt.c	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -138,11 +138,11 @@
 	for (i = 0; i < acpi_gbl_rsdt_table_count; i++) {
 		if (acpi_gbl_RSDP->revision < 2) {
 			ACPI_STORE_ADDRESS (new_table->table_offset_entry[i],
-				((struct rsdt_descriptor_rev1 *) table_info->pointer)->table_offset_entry[i]);
+				(ACPI_CAST_PTR (struct rsdt_descriptor_rev1, table_info->pointer))->table_offset_entry[i]);
 		}
 		else {
 			new_table->table_offset_entry[i] =
-				((XSDT_DESCRIPTOR *) table_info->pointer)->table_offset_entry[i];
+				(ACPI_CAST_PTR (XSDT_DESCRIPTOR, table_info->pointer))->table_offset_entry[i];
 		}
 	}
 
@@ -152,7 +152,7 @@
 
 	/* Point the table descriptor to the new table */
 
-	table_info->pointer     = (struct acpi_table_header *) new_table;
+	table_info->pointer     = ACPI_CAST_PTR (struct acpi_table_header, new_table);
 	table_info->length      = table_size;
 	table_info->allocation  = ACPI_MEM_ALLOCATED;
 
@@ -469,7 +469,7 @@
 
 	/* Install the new table */
 
-	table_desc->pointer     = (struct acpi_table_header *) acpi_gbl_FADT;
+	table_desc->pointer     = ACPI_CAST_PTR (struct acpi_table_header, acpi_gbl_FADT);
 	table_desc->allocation  = ACPI_MEM_ALLOCATED;
 	table_desc->length      = sizeof (struct fadt_descriptor_rev2);
 
diff -Nru a/drivers/acpi/tables/tbget.c b/drivers/acpi/tables/tbget.c
--- a/drivers/acpi/tables/tbget.c	Tue Feb  3 19:45:31 2004
+++ b/drivers/acpi/tables/tbget.c	Tue Feb  3 19:45:31 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -148,8 +148,7 @@
 				  (void *) &header);
 		if (ACPI_FAILURE (status)) {
 			ACPI_REPORT_ERROR (("Could not map memory at %8.8X%8.8X for length %X\n",
-				ACPI_HIDWORD (address->pointer.physical),
-				ACPI_LODWORD (address->pointer.physical),
+				ACPI_FORMAT_UINT64 (address->pointer.physical),
 				sizeof (struct acpi_table_header)));
 			return_ACPI_STATUS (status);
 		}
@@ -365,8 +364,7 @@
 		if (ACPI_FAILURE (status)) {
 			ACPI_REPORT_ERROR (("Could not map memory for table [%4.4s] at %8.8X%8.8X for length %X\n",
 				header->signature,
-				ACPI_HIDWORD (address->pointer.physical),
-				ACPI_LODWORD (address->pointer.physical), header->length));
+				ACPI_FORMAT_UINT64 (address->pointer.physical), header->length));
 			return (status);
 		}
 
@@ -408,8 +406,7 @@
 	ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
 		"Found table [%4.4s] at %8.8X%8.8X, mapped/copied to %p\n",
 		full_table->signature,
-		ACPI_HIDWORD (address->pointer.physical),
-		ACPI_LODWORD (address->pointer.physical), full_table));
+		ACPI_FORMAT_UINT64 (address->pointer.physical), full_table));
 
 	return_ACPI_STATUS (status);
 }
@@ -458,6 +455,7 @@
 	if (instance == 1) {
 		/* Get the first */
 
+		*table_ptr_loc = NULL;
 		if (acpi_gbl_table_lists[table_type].next) {
 			*table_ptr_loc = acpi_gbl_table_lists[table_type].next->pointer;
 		}
diff -Nru a/drivers/acpi/tables/tbgetall.c b/drivers/acpi/tables/tbgetall.c
--- a/drivers/acpi/tables/tbgetall.c	Tue Feb  3 19:45:35 2004
+++ b/drivers/acpi/tables/tbgetall.c	Tue Feb  3 19:45:35 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -240,8 +240,7 @@
 		if ((status != AE_OK) && (status != AE_TABLE_NOT_SUPPORTED)) {
 			ACPI_REPORT_WARNING (("%s, while getting table at %8.8X%8.8X\n",
 				acpi_format_exception (status),
-				ACPI_HIDWORD (address.pointer.value),
-				ACPI_LODWORD (address.pointer.value)));
+				ACPI_FORMAT_UINT64 (address.pointer.value)));
 		}
 	}
 
diff -Nru a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c
--- a/drivers/acpi/tables/tbinstal.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/tables/tbinstal.c	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/tables/tbrsdt.c b/drivers/acpi/tables/tbrsdt.c
--- a/drivers/acpi/tables/tbrsdt.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/acpi/tables/tbrsdt.c	Tue Feb  3 19:45:30 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -233,6 +233,15 @@
 			acpi_gbl_RSDP->rsdt_physical_address,
 			(void *) (acpi_native_uint) acpi_gbl_RSDP->rsdt_physical_address));
 
+		if (acpi_gbl_RSDP->revision < 2) {
+			ACPI_REPORT_ERROR (("Looking for RSDT (RSDP->Rev < 2)\n"))
+		}
+		else {
+			ACPI_REPORT_ERROR (("Looking for XSDT (RSDP->Rev >= 2)\n"))
+		}
+
+		ACPI_DUMP_BUFFER ((char *) table_ptr, 48);
+
 		return (AE_BAD_SIGNATURE);
 	}
 
@@ -278,8 +287,7 @@
 	ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
 		"RSDP located at %p, points to RSDT physical=%8.8X%8.8X \n",
 		acpi_gbl_RSDP,
-		ACPI_HIDWORD (address.pointer.value),
-		ACPI_LODWORD (address.pointer.value)));
+		ACPI_FORMAT_UINT64 (address.pointer.value)));
 
 	/* Check the RSDT or XSDT signature */
 
@@ -306,7 +314,7 @@
 		return_ACPI_STATUS (status);
 	}
 
-	acpi_gbl_XSDT = (XSDT_DESCRIPTOR *) table_info.pointer;
+	acpi_gbl_XSDT = ACPI_CAST_PTR (XSDT_DESCRIPTOR, table_info.pointer);
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "XSDT located at %p\n", acpi_gbl_XSDT));
 	return_ACPI_STATUS (status);
diff -Nru a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c
--- a/drivers/acpi/tables/tbutils.c	Tue Feb  3 19:45:37 2004
+++ b/drivers/acpi/tables/tbutils.c	Tue Feb  3 19:45:37 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c
--- a/drivers/acpi/tables/tbxface.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/acpi/tables/tbxface.c	Tue Feb  3 19:45:42 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -251,7 +251,7 @@
 	/* Find all tables of the requested type */
 
 	table_desc = acpi_gbl_table_lists[table_type].next;
-	while (table_desc); {
+	while (table_desc) {
 		/*
 		 * Delete all namespace entries owned by this table.  Note that these
 		 * entries can appear anywhere in the namespace by virtue of the AML
diff -Nru a/drivers/acpi/tables/tbxfroot.c b/drivers/acpi/tables/tbxfroot.c
--- a/drivers/acpi/tables/tbxfroot.c	Tue Feb  3 19:45:35 2004
+++ b/drivers/acpi/tables/tbxfroot.c	Tue Feb  3 19:45:35 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -211,8 +211,7 @@
 	ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
 		"RSDP located at %p, RSDT physical=%8.8X%8.8X \n",
 		acpi_gbl_RSDP,
-		ACPI_HIDWORD (address.pointer.value),
-		ACPI_LODWORD (address.pointer.value)));
+		ACPI_FORMAT_UINT64 (address.pointer.value)));
 
 	/* Insert processor_mode flags */
 
@@ -242,11 +241,11 @@
 		/* Get the next table pointer, handle RSDT vs. XSDT */
 
 		if (acpi_gbl_RSDP->revision < 2) {
-			address.pointer.value = ((RSDT_DESCRIPTOR *) rsdt_info.pointer)->table_offset_entry[i];
+			address.pointer.value = (ACPI_CAST_PTR (RSDT_DESCRIPTOR, rsdt_info.pointer))->table_offset_entry[i];
 		}
 		else {
 			address.pointer.value =
-				((XSDT_DESCRIPTOR *) rsdt_info.pointer)->table_offset_entry[i];
+				(ACPI_CAST_PTR (XSDT_DESCRIPTOR, rsdt_info.pointer))->table_offset_entry[i];
 		}
 
 		/* Get the table header */
diff -Nru a/drivers/acpi/tables.c b/drivers/acpi/tables.c
--- a/drivers/acpi/tables.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/tables.c	Tue Feb  3 19:45:17 2004
@@ -60,6 +60,9 @@
 	[ACPI_HPET]		= "HPET",
 };
 
+static char *mps_inti_flags_polarity[] = { "dfl", "high", "res", "low" };
+static char *mps_inti_flags_trigger[] = { "dfl", "edge", "res", "level" };
+
 /* System Description Table (RSDT/XSDT) */
 struct acpi_table_sdt {
 	unsigned long		pa;
@@ -136,8 +139,14 @@
 	{
 		struct acpi_table_int_src_ovr *p =
 			(struct acpi_table_int_src_ovr*) header;
-		printk(KERN_INFO PREFIX "INT_SRC_OVR (bus[%d] irq[0x%x] global_irq[0x%x] polarity[0x%x] trigger[0x%x])\n",
-			p->bus, p->bus_irq, p->global_irq, p->flags.polarity, p->flags.trigger);
+		printk(KERN_INFO PREFIX "INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)\n",
+			p->bus, p->bus_irq, p->global_irq,
+			mps_inti_flags_polarity[p->flags.polarity],
+			mps_inti_flags_trigger[p->flags.trigger]);
+		if(p->flags.reserved)
+			printk(KERN_INFO PREFIX "INT_SRC_OVR unexpected reserved flags: 0x%x\n",
+				p->flags.reserved);
+
 	}
 		break;
 
@@ -145,8 +154,9 @@
 	{
 		struct acpi_table_nmi_src *p =
 			(struct acpi_table_nmi_src*) header;
-		printk(KERN_INFO PREFIX "NMI_SRC (polarity[0x%x] trigger[0x%x] global_irq[0x%x])\n",
-			p->flags.polarity, p->flags.trigger, p->global_irq);
+		printk(KERN_INFO PREFIX "NMI_SRC (%s %s global_irq %d)\n",
+			mps_inti_flags_polarity[p->flags.polarity],
+			mps_inti_flags_trigger[p->flags.trigger], p->global_irq);
 	}
 		break;
 
@@ -154,8 +164,10 @@
 	{
 		struct acpi_table_lapic_nmi *p =
 			(struct acpi_table_lapic_nmi*) header;
-		printk(KERN_INFO PREFIX "LAPIC_NMI (acpi_id[0x%02x] polarity[0x%x] trigger[0x%x] lint[0x%x])\n",
-			p->acpi_id, p->flags.polarity, p->flags.trigger, p->lint);
+		printk(KERN_INFO PREFIX "LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n",
+			p->acpi_id,
+			mps_inti_flags_polarity[p->flags.polarity],
+			mps_inti_flags_trigger[p->flags.trigger], p->lint);
 	}
 		break;
 
@@ -190,8 +202,10 @@
 	{
 		struct acpi_table_plat_int_src *p =
 			(struct acpi_table_plat_int_src*) header;
-		printk(KERN_INFO PREFIX "PLAT_INT_SRC (polarity[0x%x] trigger[0x%x] type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n",
-			p->flags.polarity, p->flags.trigger, p->type, p->id, p->eid, p->iosapic_vector, p->global_irq);
+		printk(KERN_INFO PREFIX "PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n",
+			mps_inti_flags_polarity[p->flags.polarity],
+			mps_inti_flags_trigger[p->flags.trigger],
+			p->type, p->id, p->eid, p->iosapic_vector, p->global_irq);
 	}
 		break;
 
@@ -262,10 +276,17 @@
 
 	/* Map the DSDT header via the pointer in the FADT */
 	if (id == ACPI_DSDT) {
-		struct acpi_table_fadt *fadt = (struct acpi_table_fadt *) *header;
+		struct fadt_descriptor_rev2 *fadt = (struct fadt_descriptor_rev2 *) *header;
+
+		if (fadt->revision == 3 && fadt->Xdsdt) {
+			*header = (void *) __acpi_map_table(fadt->Xdsdt,
+					sizeof(struct acpi_table_header));
+		} else if (fadt->V1_dsdt) {
+			*header = (void *) __acpi_map_table(fadt->V1_dsdt,
+					sizeof(struct acpi_table_header));
+		} else
+			*header = 0;
 
-		*header = (void *) __acpi_map_table(fadt->dsdt_addr,
-				sizeof(struct acpi_table_header));
 		if (!*header) {
 			printk(KERN_WARNING PREFIX "Unable to map DSDT\n");
 			return -ENODEV;
diff -Nru a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
--- a/drivers/acpi/thermal.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/acpi/thermal.c	Tue Feb  3 19:45:41 2004
@@ -74,7 +74,7 @@
 MODULE_DESCRIPTION(ACPI_THERMAL_DRIVER_NAME);
 MODULE_LICENSE("GPL");
 
-static int tzp = 0;
+static int tzp;
 MODULE_PARM(tzp, "i");
 MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n");
 
@@ -467,6 +467,7 @@
 	if (result)
 		return_VALUE(result);
 
+	printk(KERN_EMERG "Critical temperature reached (%ld C), shutting down.\n", KELVIN_TO_CELSIUS(tz->temperature));
 	acpi_bus_generate_event(device, ACPI_THERMAL_NOTIFY_CRITICAL, tz->trips.critical.flags.enabled);
 
 	acpi_thermal_call_usermode(ACPI_THERMAL_PATH_POWEROFF);
@@ -765,7 +766,7 @@
                               FS Interface (/proc)
    -------------------------------------------------------------------------- */
 
-struct proc_dir_entry		*acpi_thermal_dir = NULL;
+struct proc_dir_entry		*acpi_thermal_dir;
 
 static int acpi_thermal_state_seq_show(struct seq_file *seq, void *offset)
 {
diff -Nru a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c
--- a/drivers/acpi/toshiba_acpi.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/toshiba_acpi.c	Tue Feb  3 19:45:16 2004
@@ -215,7 +215,7 @@
 	return status;
 }
 
-static struct proc_dir_entry*	toshiba_proc_dir = NULL;
+static struct proc_dir_entry*	toshiba_proc_dir;
 static int			force_fan;
 static int			last_key_event;
 static int			key_event_valid;
diff -Nru a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c
--- a/drivers/acpi/utilities/utalloc.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/utilities/utalloc.c	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -902,71 +902,30 @@
 
 			descriptor = ACPI_CAST_PTR (union acpi_descriptor, &element->user_space);
 			if (descriptor->descriptor_id != ACPI_DESC_TYPE_CACHED) {
-				acpi_os_printf ("%p Len %04X %9.9s-%d ",
+				acpi_os_printf ("%p Len %04X %9.9s-%d [%s] ",
 						 descriptor, element->size, element->module,
-						 element->line);
+						 element->line, acpi_ut_get_descriptor_name (descriptor));
 
-				/* Most of the elements will be internal objects. */
+				/* Most of the elements will be Operand objects. */
 
 				switch (ACPI_GET_DESCRIPTOR_TYPE (descriptor)) {
 				case ACPI_DESC_TYPE_OPERAND:
-					acpi_os_printf ("obj_type %12.12s R%hd",
+					acpi_os_printf ("%12.12s R%hd",
 							acpi_ut_get_type_name (descriptor->object.common.type),
 							descriptor->object.common.reference_count);
 					break;
 
 				case ACPI_DESC_TYPE_PARSER:
-					acpi_os_printf ("parse_obj aml_opcode %04hX",
+					acpi_os_printf ("aml_opcode %04hX",
 							descriptor->op.asl.aml_opcode);
 					break;
 
 				case ACPI_DESC_TYPE_NAMED:
-					acpi_os_printf ("Node %4.4s",
-							descriptor->node.name.ascii);
-					break;
-
-				case ACPI_DESC_TYPE_STATE:
-					acpi_os_printf ("Untyped state_obj");
-					break;
-
-				case ACPI_DESC_TYPE_STATE_UPDATE:
-					acpi_os_printf ("UPDATE state_obj");
-					break;
-
-				case ACPI_DESC_TYPE_STATE_PACKAGE:
-					acpi_os_printf ("PACKAGE state_obj");
-					break;
-
-				case ACPI_DESC_TYPE_STATE_CONTROL:
-					acpi_os_printf ("CONTROL state_obj");
-					break;
-
-				case ACPI_DESC_TYPE_STATE_RPSCOPE:
-					acpi_os_printf ("ROOT-PARSE-SCOPE state_obj");
-					break;
-
-				case ACPI_DESC_TYPE_STATE_PSCOPE:
-					acpi_os_printf ("PARSE-SCOPE state_obj");
-					break;
-
-				case ACPI_DESC_TYPE_STATE_WSCOPE:
-					acpi_os_printf ("WALK-SCOPE state_obj");
-					break;
-
-				case ACPI_DESC_TYPE_STATE_RESULT:
-					acpi_os_printf ("RESULT state_obj");
-					break;
-
-				case ACPI_DESC_TYPE_STATE_NOTIFY:
-					acpi_os_printf ("NOTIFY state_obj");
-					break;
-
-				case ACPI_DESC_TYPE_STATE_THREAD:
-					acpi_os_printf ("THREAD state_obj");
+					acpi_os_printf ("%4.4s",
+							acpi_ut_get_node_name (&descriptor->node));
 					break;
 
 				default:
-					/* All types should appear above */
 					break;
 				}
 
diff -Nru a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
--- a/drivers/acpi/utilities/utcopy.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/utilities/utcopy.c	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c
--- a/drivers/acpi/utilities/utdebug.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/acpi/utilities/utdebug.c	Tue Feb  3 19:45:30 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -447,7 +447,7 @@
 
 	acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info,
 			"%s %8.8X%8.8X\n", acpi_gbl_fn_exit_str,
-			ACPI_HIDWORD (value), ACPI_LODWORD (value));
+			ACPI_FORMAT_UINT64 (value));
 
 	acpi_gbl_nesting_level--;
 }
diff -Nru a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
--- a/drivers/acpi/utilities/utdelete.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/acpi/utilities/utdelete.c	Tue Feb  3 19:45:18 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -140,7 +140,7 @@
 
 		/* Walk the handler list for this device */
 
-		handler_desc = object->device.address_space;
+		handler_desc = object->device.handler;
 		while (handler_desc) {
 			next_desc = handler_desc->address_space.next;
 			acpi_ut_remove_reference (handler_desc);
@@ -193,7 +193,7 @@
 			 * default handlers -- and therefore, we created the context object
 			 * locally, it was not created by an external caller.
 			 */
-			handler_desc = object->region.address_space;
+			handler_desc = object->region.handler;
 			if (handler_desc) {
 				if (handler_desc->address_space.hflags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) {
 					obj_pointer = second_desc->extra.region_context;
diff -Nru a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c
--- a/drivers/acpi/utilities/uteval.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/utilities/uteval.c	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -91,7 +91,7 @@
 	if (ACPI_FAILURE (status)) {
 		if (status == AE_NOT_FOUND) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s.%s] was not found\n",
-				prefix_node->name.ascii, path));
+				acpi_ut_get_node_name (prefix_node), path));
 		}
 		else {
 			ACPI_REPORT_METHOD_ERROR ("Method execution failed",
@@ -544,7 +544,7 @@
 		if (AE_NOT_FOUND == status) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
 				"_STA on %4.4s was not found, assuming device is present\n",
-				device_node->name.ascii));
+				acpi_ut_get_node_name (device_node)));
 
 			*flags = 0x0F;
 			status = AE_OK;
diff -Nru a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
--- a/drivers/acpi/utilities/utglobal.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/utilities/utglobal.c	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -358,7 +358,7 @@
 	/* ACPI_EVENT_GLOBAL        */  {ACPI_BITREG_GLOBAL_LOCK_STATUS,    ACPI_BITREG_GLOBAL_LOCK_ENABLE,  ACPI_BITMASK_GLOBAL_LOCK_STATUS,    ACPI_BITMASK_GLOBAL_LOCK_ENABLE},
 	/* ACPI_EVENT_POWER_BUTTON  */  {ACPI_BITREG_POWER_BUTTON_STATUS,   ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS,   ACPI_BITMASK_POWER_BUTTON_ENABLE},
 	/* ACPI_EVENT_SLEEP_BUTTON  */  {ACPI_BITREG_SLEEP_BUTTON_STATUS,   ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS,   ACPI_BITMASK_SLEEP_BUTTON_ENABLE},
-	/* ACPI_EVENT_RTC           */  {ACPI_BITREG_RT_CLOCK_STATUS,       ACPI_BITREG_RT_CLOCK_ENABLE,     0,                                  0},
+	/* ACPI_EVENT_RTC           */  {ACPI_BITREG_RT_CLOCK_STATUS,       ACPI_BITREG_RT_CLOCK_ENABLE,     ACPI_BITMASK_RT_CLOCK_STATUS,       ACPI_BITMASK_RT_CLOCK_ENABLE},
 };
 
 /*****************************************************************************
@@ -531,6 +531,99 @@
 	}
 
 	return (acpi_ut_get_type_name (ACPI_GET_OBJECT_TYPE (obj_desc)));
+}
+
+
+/*****************************************************************************
+ *
+ * FUNCTION:    acpi_ut_get_node_name
+ *
+ * PARAMETERS:  Object               - A namespace node
+ *
+ * RETURN:      Pointer to a string
+ *
+ * DESCRIPTION: Validate the node and return the node's ACPI name.
+ *
+ ****************************************************************************/
+
+char *
+acpi_ut_get_node_name (
+	void                            *object)
+{
+	struct acpi_namespace_node      *node;
+
+
+	if (!object)
+	{
+		return ("NULL NODE");
+	}
+
+	node = (struct acpi_namespace_node *) object;
+
+	if (node->descriptor != ACPI_DESC_TYPE_NAMED)
+	{
+		return ("****");
+	}
+
+	if (!acpi_ut_valid_acpi_name (* (u32 *) node->name.ascii))
+	{
+		return ("----");
+	}
+
+	return (node->name.ascii);
+}
+
+
+/*****************************************************************************
+ *
+ * FUNCTION:    acpi_ut_get_descriptor_name
+ *
+ * PARAMETERS:  Object               - An ACPI object
+ *
+ * RETURN:      Pointer to a string
+ *
+ * DESCRIPTION: Validate object and return the descriptor type
+ *
+ ****************************************************************************/
+
+static const char                   *acpi_gbl_desc_type_names[] = /* printable names of descriptor types */
+{
+	/* 00 */ "Invalid",
+	/* 01 */ "Cached",
+	/* 02 */ "State-Generic",
+	/* 03 */ "State-Update",
+	/* 04 */ "State-Package",
+	/* 05 */ "State-Control",
+	/* 06 */ "State-root_parse_scope",
+	/* 07 */ "State-parse_scope",
+	/* 08 */ "State-walk_scope",
+	/* 09 */ "State-Result",
+	/* 10 */ "State-Notify",
+	/* 11 */ "State-Thread",
+	/* 12 */ "Walk",
+	/* 13 */ "Parser",
+	/* 14 */ "Operand",
+	/* 15 */ "Node"
+};
+
+
+char *
+acpi_ut_get_descriptor_name (
+	void                            *object)
+{
+
+	if (!object)
+	{
+		return ("NULL OBJECT");
+	}
+
+	if (ACPI_GET_DESCRIPTOR_TYPE (object) > ACPI_DESC_TYPE_MAX)
+	{
+		return ((char *) acpi_gbl_bad_type);
+	}
+
+	return ((char *) acpi_gbl_desc_type_names[ACPI_GET_DESCRIPTOR_TYPE (object)]);
+
 }
 
 
diff -Nru a/drivers/acpi/utilities/utinit.c b/drivers/acpi/utilities/utinit.c
--- a/drivers/acpi/utilities/utinit.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/acpi/utilities/utinit.c	Tue Feb  3 19:45:29 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/utilities/utmath.c b/drivers/acpi/utilities/utmath.c
--- a/drivers/acpi/utilities/utmath.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/acpi/utilities/utmath.c	Tue Feb  3 19:45:42 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
--- a/drivers/acpi/utilities/utmisc.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/acpi/utilities/utmisc.c	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -304,16 +304,20 @@
 	u32                             name)
 {
 	char                            *name_ptr = (char *) &name;
-	u32                             i;
+	char                            character;
+	acpi_native_uint                i;
 
 
 	ACPI_FUNCTION_ENTRY ();
 
 
 	for (i = 0; i < ACPI_NAME_SIZE; i++) {
-		if (!((name_ptr[i] == '_') ||
-			  (name_ptr[i] >= 'A' && name_ptr[i] <= 'Z') ||
-			  (name_ptr[i] >= '0' && name_ptr[i] <= '9'))) {
+		character = *name_ptr;
+		name_ptr++;
+
+		if (!((character == '_') ||
+			  (character >= 'A' && character <= 'Z') ||
+			  (character >= '0' && character <= '9'))) {
 			return (FALSE);
 		}
 	}
diff -Nru a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c
--- a/drivers/acpi/utilities/utobject.c	Tue Feb  3 19:45:33 2004
+++ b/drivers/acpi/utilities/utobject.c	Tue Feb  3 19:45:33 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -223,29 +223,10 @@
 
 		return (TRUE);
 
-	case ACPI_DESC_TYPE_NAMED:
-
-		ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
-			"**** Obj %p is a named obj, not ACPI obj\n", object));
-		break;
-
-	case ACPI_DESC_TYPE_PARSER:
-
-		ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
-			"**** Obj %p is a parser obj, not ACPI obj\n", object));
-		break;
-
-	case ACPI_DESC_TYPE_CACHED:
-
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-			"**** Obj %p has already been released to internal cache\n", object));
-		break;
-
 	default:
-
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-			"**** Obj %p has unknown descriptor type %X\n", object,
-			ACPI_GET_DESCRIPTOR_TYPE (object)));
+		ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+				"%p is not not an ACPI operand obj [%s]\n",
+				object, acpi_ut_get_descriptor_name (object)));
 		break;
 	}
 
@@ -322,7 +303,8 @@
 
 	if (ACPI_GET_DESCRIPTOR_TYPE (object) != ACPI_DESC_TYPE_OPERAND) {
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-			"Obj %p is not an ACPI object\n", object));
+				"%p is not an ACPI Operand object [%s]\n", object,
+				acpi_ut_get_descriptor_name (object)));
 		return_VOID;
 	}
 
diff -Nru a/drivers/acpi/utilities/utxface.c b/drivers/acpi/utilities/utxface.c
--- a/drivers/acpi/utilities/utxface.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/acpi/utilities/utxface.c	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/drivers/atm/atmdev_init.c b/drivers/atm/atmdev_init.c
--- a/drivers/atm/atmdev_init.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/atm/atmdev_init.c	Tue Feb  3 19:45:17 2004
@@ -10,9 +10,6 @@
 #ifdef CONFIG_ATM_ZATM
 extern int zatm_detect(void);
 #endif
-#ifdef CONFIG_ATM_NICSTAR
-extern int nicstar_detect(void);
-#endif
 #ifdef CONFIG_ATM_AMBASSADOR
 extern int amb_detect(void);
 #endif
@@ -40,9 +37,6 @@
 	devs = 0;
 #ifdef CONFIG_ATM_ZATM
 	devs += zatm_detect();
-#endif
-#ifdef CONFIG_ATM_NICSTAR
-	devs += nicstar_detect();
 #endif
 #ifdef CONFIG_ATM_AMBASSADOR
 	devs += amb_detect();
diff -Nru a/drivers/atm/he.c b/drivers/atm/he.c
--- a/drivers/atm/he.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/atm/he.c	Tue Feb  3 19:45:17 2004
@@ -109,10 +109,6 @@
 #define pci_get_drvdata(pci_dev)	(pci_dev)->driver_data
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,44)
-#define pci_pool_create(a, b, c, d, e)	pci_pool_create(a, b, c, d, e, SLAB_KERNEL)
-#endif
-
 #include "he.h"
 
 #include "suni.h"
@@ -1986,8 +1982,7 @@
 			TBRQ_MULTIPLE(he_dev->tbrq_head) ? " MULTIPLE" : "");
 #ifdef USE_TPD_POOL
 		tpd = NULL;
-		p = &he_dev->outstanding_tpds;
-		while ((p = p->next) != &he_dev->outstanding_tpds) {
+		list_for_each(p, &he_dev->outstanding_tpds) {
 			struct he_tpd *__tpd = list_entry(p, struct he_tpd, entry);
 			if (TPD_ADDR(__tpd->status) == TBRQ_TPD(he_dev->tbrq_head)) {
 				tpd = __tpd;
diff -Nru a/drivers/atm/horizon.c b/drivers/atm/horizon.c
--- a/drivers/atm/horizon.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/atm/horizon.c	Tue Feb  3 19:45:16 2004
@@ -359,8 +359,8 @@
 
 static unsigned short debug = 0;
 static unsigned short vpi_bits = 0;
-static unsigned short max_tx_size = 9000;
-static unsigned short max_rx_size = 9000;
+static int max_tx_size = 9000;
+static int max_rx_size = 9000;
 static unsigned char pci_lat = 0;
 
 /********** access functions **********/
@@ -2898,11 +2898,11 @@
     PRINTK (KERN_ERR, "vpi_bits has been limited to %hu",
 	    vpi_bits = HRZ_MAX_VPI);
   
-  if (max_tx_size > TX_AAL5_LIMIT)
+  if (max_tx_size < 0 || max_tx_size > TX_AAL5_LIMIT)
     PRINTK (KERN_NOTICE, "max_tx_size has been limited to %hu",
 	    max_tx_size = TX_AAL5_LIMIT);
   
-  if (max_rx_size > RX_AAL5_LIMIT)
+  if (max_rx_size < 0 || max_rx_size > RX_AAL5_LIMIT)
     PRINTK (KERN_NOTICE, "max_rx_size has been limited to %hu",
 	    max_rx_size = RX_AAL5_LIMIT);
   
@@ -2914,8 +2914,8 @@
 MODULE_LICENSE("GPL");
 MODULE_PARM(debug, "h");
 MODULE_PARM(vpi_bits, "h");
-MODULE_PARM(max_tx_size, "h");
-MODULE_PARM(max_rx_size, "h");
+MODULE_PARM(max_tx_size, "i");
+MODULE_PARM(max_rx_size, "i");
 MODULE_PARM(pci_lat, "b");
 MODULE_PARM_DESC(debug, "debug bitmap, see .h file");
 MODULE_PARM_DESC(vpi_bits, "number of bits (0..4) to allocate to VPIs");
diff -Nru a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
--- a/drivers/atm/nicstar.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/atm/nicstar.c	Tue Feb  3 19:45:17 2004
@@ -214,8 +214,8 @@
 
 static u32 ns_read_sram(ns_dev *card, u32 sram_address);
 static void ns_write_sram(ns_dev *card, u32 sram_address, u32 *value, int count);
-static int __init ns_init_card(int i, struct pci_dev *pcidev);
-static void __init ns_init_card_error(ns_dev *card, int error);
+static int __devinit ns_init_card(int i, struct pci_dev *pcidev);
+static void __devinit ns_init_card_error(ns_dev *card, int error);
 static scq_info *get_scq(int size, u32 scd);
 static void free_scq(scq_info *scq, struct atm_vcc *vcc);
 static void push_rxbufs(ns_dev *card, u32 type, u32 handle1, u32 addr1,
@@ -276,136 +276,151 @@
 
 /* Functions*******************************************************************/
 
-static int __init nicstar_module_init(void)
+static int __devinit nicstar_init_one(struct pci_dev *pcidev,
+				      const struct pci_device_id *ent)
 {
-   int i;
-   unsigned error = 0;	/* Initialized to remove compile warning */
-   struct pci_dev *pcidev;
+   static int index = -1;
+   unsigned int error;
 
-   XPRINTK("nicstar: nicstar_module_init() called.\n");
+   index++;
+   cards[index] = NULL;
 
-   for(i = 0; i < NS_MAX_CARDS; i++)
-      cards[i] = NULL;
-
-   pcidev = NULL;
-   for(i = 0; i < NS_MAX_CARDS; i++)
-   {
-      if ((pcidev = pci_find_device(PCI_VENDOR_ID_IDT,
-                                    PCI_DEVICE_ID_IDT_IDT77201,
-                                    pcidev)) == NULL)
-         break;
-
-      error = ns_init_card(i, pcidev);
-      if (error)
-         cards[i--] = NULL;	/* Try to find another card but don't increment index */
+   error = ns_init_card(index, pcidev);
+   if (error) {
+      cards[index--] = NULL;	/* don't increment index */
+      goto err_out;
    }
 
-   if (i == 0)
-   {
-      if (!error)
-      {
-         printk("nicstar: no cards found.\n");
-         return -ENXIO;
-      }
-      else
-         return -EIO;
-   }
-   TXPRINTK("nicstar: TX debug enabled.\n");
-   RXPRINTK("nicstar: RX debug enabled.\n");
-   PRINTK("nicstar: General debug enabled.\n");
-#ifdef PHY_LOOPBACK
-   printk("nicstar: using PHY loopback.\n");
-#endif /* PHY_LOOPBACK */
-   XPRINTK("nicstar: nicstar_module_init() returned.\n");
-
-   init_timer(&ns_timer);
-   ns_timer.expires = jiffies + NS_POLL_PERIOD;
-   ns_timer.data = 0UL;
-   ns_timer.function = ns_poll;
-   add_timer(&ns_timer);
    return 0;
+err_out:
+   return -ENODEV;
 }
 
 
 
-static void __exit nicstar_module_exit(void)
+static void __devexit nicstar_remove_one(struct pci_dev *pcidev)
 {
    int i, j;
-   unsigned short pci_command;
-   ns_dev *card;
+   ns_dev *card = pci_get_drvdata(pcidev);
    struct sk_buff *hb;
    struct sk_buff *iovb;
    struct sk_buff *lb;
    struct sk_buff *sb;
    
-   XPRINTK("nicstar: cleanup_module() called.\n");
+   i = card->index;
 
-   del_timer(&ns_timer);
+   if (cards[i] == NULL)
+      return;
 
-   for (i = 0; i < NS_MAX_CARDS; i++)
+   if (card->atmdev->phy && card->atmdev->phy->stop)
+      card->atmdev->phy->stop(card->atmdev);
+
+   /* Stop everything */
+   writel(0x00000000, card->membase + CFG);
+
+   /* De-register device */
+   atm_dev_deregister(card->atmdev);
+
+   /* Disable PCI device */
+   pci_disable_device(pcidev);
+   
+   /* Free up resources */
+   j = 0;
+   PRINTK("nicstar%d: freeing %d huge buffers.\n", i, card->hbpool.count);
+   while ((hb = skb_dequeue(&card->hbpool.queue)) != NULL)
    {
-      if (cards[i] == NULL)
-         continue;
+      dev_kfree_skb_any(hb);
+      j++;
+   }
+   PRINTK("nicstar%d: %d huge buffers freed.\n", i, j);
+   j = 0;
+   PRINTK("nicstar%d: freeing %d iovec buffers.\n", i, card->iovpool.count);
+   while ((iovb = skb_dequeue(&card->iovpool.queue)) != NULL)
+   {
+      dev_kfree_skb_any(iovb);
+      j++;
+   }
+   PRINTK("nicstar%d: %d iovec buffers freed.\n", i, j);
+   while ((lb = skb_dequeue(&card->lbpool.queue)) != NULL)
+      dev_kfree_skb_any(lb);
+   while ((sb = skb_dequeue(&card->sbpool.queue)) != NULL)
+      dev_kfree_skb_any(sb);
+   free_scq(card->scq0, NULL);
+   for (j = 0; j < NS_FRSCD_NUM; j++)
+   {
+      if (card->scd2vc[j] != NULL)
+         free_scq(card->scd2vc[j]->scq, card->scd2vc[j]->tx_vcc);
+   }
+   kfree(card->rsq.org);
+   kfree(card->tsq.org);
+   free_irq(card->pcidev->irq, card);
+   iounmap((void *) card->membase);
+   kfree(card);
+}
 
-      card = cards[i];
 
-      if (card->atmdev->phy && card->atmdev->phy->stop)
-        card->atmdev->phy->stop(card->atmdev);
 
-      /* Stop everything */
-      writel(0x00000000, card->membase + CFG);
+static struct pci_device_id nicstar_pci_tbl[] __devinitdata =
+{
+	{PCI_VENDOR_ID_IDT, PCI_DEVICE_ID_IDT_IDT77201,
+	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+	{0,}			/* terminate list */
+};
+MODULE_DEVICE_TABLE(pci, nicstar_pci_tbl);
 
-      /* De-register device */
-      atm_dev_deregister(card->atmdev);
 
-      /* Disable memory mapping and busmastering */
-      if (pci_read_config_word(card->pcidev, PCI_COMMAND, &pci_command) != 0)
-      {
-         printk("nicstar%d: can't read PCI_COMMAND.\n", i);
-      }
-      pci_command &= ~(PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
-      if (pci_write_config_word(card->pcidev, PCI_COMMAND, pci_command) != 0)
-      {
-         printk("nicstar%d: can't write PCI_COMMAND.\n", i);
-      }
-      
-      /* Free up resources */
-      j = 0;
-      PRINTK("nicstar%d: freeing %d huge buffers.\n", i, card->hbpool.count);
-      while ((hb = skb_dequeue(&card->hbpool.queue)) != NULL)
-      {
-         dev_kfree_skb_any(hb);
-	 j++;
-      }
-      PRINTK("nicstar%d: %d huge buffers freed.\n", i, j);
-      j = 0;
-      PRINTK("nicstar%d: freeing %d iovec buffers.\n", i, card->iovpool.count);
-      while ((iovb = skb_dequeue(&card->iovpool.queue)) != NULL)
-      {
-         dev_kfree_skb_any(iovb);
-         j++;
-      }
-      PRINTK("nicstar%d: %d iovec buffers freed.\n", i, j);
-      while ((lb = skb_dequeue(&card->lbpool.queue)) != NULL)
-         dev_kfree_skb_any(lb);
-      while ((sb = skb_dequeue(&card->sbpool.queue)) != NULL)
-         dev_kfree_skb_any(sb);
-      free_scq(card->scq0, NULL);
-      for (j = 0; j < NS_FRSCD_NUM; j++)
-      {
-         if (card->scd2vc[j] != NULL)
-	    free_scq(card->scd2vc[j]->scq, card->scd2vc[j]->tx_vcc);
-      }
-      kfree(card->rsq.org);
-      kfree(card->tsq.org);
-      free_irq(card->pcidev->irq, card);
-      iounmap((void *) card->membase);
-      kfree(card);
-      
+
+static struct pci_driver nicstar_driver = {
+	.name		= "nicstar",
+	.id_table	= nicstar_pci_tbl,
+	.probe		= nicstar_init_one,
+	.remove		= __devexit_p(nicstar_remove_one),
+};
+
+
+
+static int __init nicstar_init(void)
+{
+   unsigned error = 0;	/* Initialized to remove compile warning */
+
+   XPRINTK("nicstar: nicstar_init() called.\n");
+
+   error = pci_module_init(&nicstar_driver);
+   
+   TXPRINTK("nicstar: TX debug enabled.\n");
+   RXPRINTK("nicstar: RX debug enabled.\n");
+   PRINTK("nicstar: General debug enabled.\n");
+#ifdef PHY_LOOPBACK
+   printk("nicstar: using PHY loopback.\n");
+#endif /* PHY_LOOPBACK */
+   XPRINTK("nicstar: nicstar_init() returned.\n");
+
+   if (!error) {
+      init_timer(&ns_timer);
+      ns_timer.expires = jiffies + NS_POLL_PERIOD;
+      ns_timer.data = 0UL;
+      ns_timer.function = ns_poll;
+      add_timer(&ns_timer);
    }
-   XPRINTK("nicstar: cleanup_module() returned.\n");
+   
+   return error;
+}
+
+
+
+static void __exit nicstar_cleanup(void)
+{
+   XPRINTK("nicstar: nicstar_cleanup() called.\n");
+
+   del_timer(&ns_timer);
+
+   pci_unregister_driver(&nicstar_driver);
+
+   XPRINTK("nicstar: nicstar_cleanup() returned.\n");
 }
 
+
+
 static u32 ns_read_sram(ns_dev *card, u32 sram_address)
 {
    unsigned long flags;
@@ -445,11 +460,10 @@
 }
 
 
-static int __init ns_init_card(int i, struct pci_dev *pcidev)
+static int __devinit ns_init_card(int i, struct pci_dev *pcidev)
 {
    int j;
    struct ns_dev *card = NULL;
-   unsigned short pci_command;
    unsigned char pci_latency;
    unsigned error;
    u32 data;
@@ -478,6 +492,8 @@
    spin_lock_init(&card->int_lock);
    spin_lock_init(&card->res_lock);
       
+   pci_set_drvdata(pcidev, card);
+   
    card->index = i;
    card->atmdev = NULL;
    card->pcidev = pcidev;
@@ -492,21 +508,7 @@
    }
    PRINTK("nicstar%d: membase at 0x%x.\n", i, card->membase);
 
-   if (pci_read_config_word(pcidev, PCI_COMMAND, &pci_command) != 0)
-   {
-      printk("nicstar%d: can't read PCI_COMMAND.\n", i);
-      error = 4;
-      ns_init_card_error(card, error);
-      return error;
-   }
-   pci_command |= (PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
-   if (pci_write_config_word(pcidev, PCI_COMMAND, pci_command) != 0)
-   {
-      printk("nicstar%d: can't write PCI_COMMAND.\n", i);
-      error = 5;
-      ns_init_card_error(card, error);
-      return error;
-   }
+   pci_set_master(pcidev);
 
    if (pci_read_config_byte(pcidev, PCI_LATENCY_TIMER, &pci_latency) != 0)
    {
@@ -932,7 +934,7 @@
 
 
 
-static void __init ns_init_card_error(ns_dev *card, int error)
+static void __devinit ns_init_card_error(ns_dev *card, int error)
 {
    if (error >= 17)
    {
@@ -981,6 +983,7 @@
    }
    if (error >= 3)
    {
+      pci_disable_device(card->pcidev);
       kfree(card);
    }
 }
@@ -3099,5 +3102,7 @@
    return (unsigned char) data;
 }
 
-module_init(nicstar_module_init);
-module_exit(nicstar_module_exit);
+
+
+module_init(nicstar_init);
+module_exit(nicstar_cleanup);
diff -Nru a/drivers/base/Makefile b/drivers/base/Makefile
--- a/drivers/base/Makefile	Tue Feb  3 19:45:41 2004
+++ b/drivers/base/Makefile	Tue Feb  3 19:45:41 2004
@@ -1,7 +1,7 @@
 # Makefile for the Linux device tree
 
 obj-y			:= core.o sys.o interface.o bus.o \
-			   driver.o class.o platform.o \
+			   driver.o class.o class_simple.o platform.o \
 			   cpu.o firmware.o init.o map.o
 obj-y			+= power/
 obj-$(CONFIG_FW_LOADER)	+= firmware_class.o
diff -Nru a/drivers/base/class.c b/drivers/base/class.c
--- a/drivers/base/class.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/base/class.c	Tue Feb  3 19:45:43 2004
@@ -46,6 +46,19 @@
 	return ret;
 }
 
+static void class_release(struct kobject * kobj)
+{
+	struct class *class = to_class(kobj);
+
+	pr_debug("class '%s': release.\n", class->name);
+
+	if (class->class_release)
+		class->class_release(class);
+	else
+		pr_debug("class '%s' does not have a release() function, "
+			 "be careful\n", class->name);
+}
+
 static struct sysfs_ops class_sysfs_ops = {
 	.show	= class_attr_show,
 	.store	= class_attr_store,
@@ -53,6 +66,7 @@
 
 static struct kobj_type ktype_class = {
 	.sysfs_ops	= &class_sysfs_ops,
+	.release	= class_release,
 };
 
 /* Hotplug events for classes go to the class_obj subsys */
diff -Nru a/drivers/base/class_simple.c b/drivers/base/class_simple.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/base/class_simple.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,201 @@
+/*
+ * class_simple.c - a "simple" interface for classes for simple char devices.
+ *
+ * Copyright (c) 2003-2004 Greg Kroah-Hartman <greg@kroah.com>
+ * Copyright (c) 2003-2004 IBM Corp.
+ * 
+ * This file is released under the GPLv2
+ *
+ */
+
+#define DEBUG 1
+
+#include <linux/device.h>
+#include <linux/kdev_t.h>
+#include <linux/err.h>
+
+struct class_simple {
+	struct class_device_attribute attr;
+	struct class class;
+};
+#define to_class_simple(d) container_of(d, struct class_simple, class)
+
+struct simple_dev {
+	struct list_head node;
+	dev_t dev;
+	struct class_device class_dev;
+};
+#define to_simple_dev(d) container_of(d, struct simple_dev, class_dev)
+
+static LIST_HEAD(simple_dev_list);
+static spinlock_t simple_dev_list_lock = SPIN_LOCK_UNLOCKED;
+
+static void release_simple_dev(struct class_device *class_dev)
+{
+	struct simple_dev *s_dev = to_simple_dev(class_dev);
+	kfree(s_dev);
+}
+
+static ssize_t show_dev(struct class_device *class_dev, char *buf)
+{
+	struct simple_dev *s_dev = to_simple_dev(class_dev);
+	return print_dev_t(buf, s_dev->dev);
+}
+
+static void class_simple_release(struct class *class)
+{
+	struct class_simple *cs = to_class_simple(class);
+	kfree(cs);
+}
+
+/**
+ * class_simple_create - create a struct class_simple structure
+ * @owner: pointer to the module that is to "own" this struct class_simple
+ * @name: pointer to a string for the name of this class.
+ *
+ * This is used to create a struct class_simple pointer that can then be used
+ * in calls to class_simple_device_add().  This is used when you do not wish to
+ * create a full blown class support for a type of char devices.
+ *
+ * Note, the pointer created here is to be destroyed when finished by making a
+ * call to class_simple_destroy().
+ */
+struct class_simple *class_simple_create(struct module *owner, char *name)
+{
+	struct class_simple *cs;
+	int retval;
+
+	cs = kmalloc(sizeof(*cs), GFP_KERNEL);
+	if (!cs) {
+		retval = -ENOMEM;
+		goto error;
+	}
+	memset(cs, 0x00, sizeof(*cs));
+
+	cs->class.name = name;
+	cs->class.class_release = class_simple_release;
+	cs->class.release = release_simple_dev;
+
+	cs->attr.attr.name = "dev";
+	cs->attr.attr.mode = S_IRUGO;
+	cs->attr.attr.owner = owner;
+	cs->attr.show = show_dev;
+	cs->attr.store = NULL;
+
+	retval = class_register(&cs->class);
+	if (retval)
+		goto error;
+
+	return cs;
+
+error:
+	kfree(cs);
+	return ERR_PTR(retval);
+}
+EXPORT_SYMBOL(class_simple_create);
+
+/**
+ * class_simple_destroy - destroys a struct class_simple structure
+ * @cs: pointer to the struct class_simple that is to be destroyed
+ *
+ * Note, the pointer to be destroyed must have been created with a call to
+ * class_simple_create().
+ */
+void class_simple_destroy(struct class_simple *cs)
+{
+	if ((cs == NULL) || (IS_ERR(cs)))
+		return;
+
+	class_unregister(&cs->class);
+}
+EXPORT_SYMBOL(class_simple_destroy);
+
+/**
+ * class_simple_device_add - adds a class device to sysfs for a character driver
+ * @cs: pointer to the struct class_simple that this device should be registered to.  
+ * @dev: the dev_t for the device to be added.
+ * @device: a pointer to a struct device that is assiociated with this class device.
+ * @fmt: string for the class device's name
+ *
+ * This function can be used by simple char device classes that do not
+ * implement their own class device registration.  A struct class_device will
+ * be created in sysfs, registered to the specified class.  A "dev" file will
+ * be created, showing the dev_t for the device.  The pointer to the struct
+ * class_device will be returned from the call.  Any further sysfs files that
+ * might be required can be created using this pointer.
+ * Note: the struct class_device passed to this function must have previously been
+ * created with a call to class_simple_create().
+ */
+struct class_device *class_simple_device_add(struct class_simple *cs, dev_t dev, struct device *device, const char *fmt, ...)
+{
+	va_list args;
+	struct simple_dev *s_dev = NULL;
+	int retval;
+
+	if ((cs == NULL) || (IS_ERR(cs))) {
+		retval = -ENODEV;
+		goto error;
+	}
+
+	s_dev = kmalloc(sizeof(*s_dev), GFP_KERNEL);
+	if (!s_dev) {
+		retval = -ENOMEM;
+		goto error;
+	}
+	memset(s_dev, 0x00, sizeof(*s_dev));
+
+	s_dev->dev = dev;
+	s_dev->class_dev.dev = device;
+	s_dev->class_dev.class = &cs->class;
+	
+	va_start(args,fmt);
+	vsnprintf(s_dev->class_dev.class_id, BUS_ID_SIZE, fmt, args);
+	va_end(args);
+	retval = class_device_register(&s_dev->class_dev);
+	if (retval)
+		goto error;
+
+	class_device_create_file(&s_dev->class_dev, &cs->attr);
+
+	spin_lock(&simple_dev_list_lock);
+	list_add(&s_dev->node, &simple_dev_list);
+	spin_unlock(&simple_dev_list_lock);
+
+	return &s_dev->class_dev;
+
+error:
+	kfree(s_dev);
+	return ERR_PTR(retval);
+}
+EXPORT_SYMBOL(class_simple_device_add);
+
+/**
+ * class_simple_device_remove - removes a class device that was created with class_simple_device_add()
+ * @dev: the dev_t of the device that was previously registered.
+ *
+ * This call unregisters and cleans up a class device that was created with a
+ * call to class_device_simple_add()
+ */
+void class_simple_device_remove(dev_t dev)
+{
+	struct simple_dev *s_dev = NULL;
+	struct list_head *tmp;
+	int found = 0;
+
+	spin_lock(&simple_dev_list_lock);
+	list_for_each(tmp, &simple_dev_list) {
+		s_dev = list_entry(tmp, struct simple_dev, node);
+		if (s_dev->dev == dev) {
+			found = 1;
+			break;
+		}
+	}
+	if (found) {
+		list_del(&s_dev->node);
+		spin_unlock(&simple_dev_list_lock);
+		class_device_unregister(&s_dev->class_dev);
+	} else {
+		spin_unlock(&simple_dev_list_lock);
+	}
+}
+EXPORT_SYMBOL(class_simple_device_remove);
diff -Nru a/drivers/base/core.c b/drivers/base/core.c
--- a/drivers/base/core.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/base/core.c	Tue Feb  3 19:45:16 2004
@@ -400,6 +400,14 @@
 	return error;
 }
 
+struct device *device_find(const char *name, struct bus_type *bus)
+{
+	struct kobject *k = kset_find_obj(&bus->devices, name);
+	if (k)
+		return to_dev(k);
+	return NULL;
+}
+
 int __init devices_init(void)
 {
 	return subsystem_register(&devices_subsys);
@@ -416,6 +424,7 @@
 EXPORT_SYMBOL(device_unregister_wait);
 EXPORT_SYMBOL(get_device);
 EXPORT_SYMBOL(put_device);
+EXPORT_SYMBOL(device_find);
 
 EXPORT_SYMBOL(device_create_file);
 EXPORT_SYMBOL(device_remove_file);
diff -Nru a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
--- a/drivers/base/firmware_class.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/base/firmware_class.c	Tue Feb  3 19:45:16 2004
@@ -361,7 +361,7 @@
 
 	wait_for_completion(&fw_priv->completion);
 
-	del_timer(&fw_priv->timeout);
+	del_timer_sync(&fw_priv->timeout);
 	fw_remove_class_device(class_dev);
 
 	if (fw_priv->fw->size && !fw_priv->abort) {
diff -Nru a/drivers/block/Kconfig b/drivers/block/Kconfig
--- a/drivers/block/Kconfig	Tue Feb  3 19:45:17 2004
+++ b/drivers/block/Kconfig	Tue Feb  3 19:45:17 2004
@@ -6,7 +6,7 @@
 
 config BLK_DEV_FD
 	tristate "Normal floppy disk support"
-	depends on !X86_PC9800 && !ARCH_S390
+	depends on (!X86_PC9800 && !ARCH_S390 && !M68K) || Q40 || (SUN3X && BROKEN)
 	---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
diff -Nru a/drivers/block/as-iosched.c b/drivers/block/as-iosched.c
--- a/drivers/block/as-iosched.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/block/as-iosched.c	Tue Feb  3 19:45:16 2004
@@ -31,19 +31,19 @@
 /*
  * max time before a read is submitted.
  */
-#define default_read_expire (HZ / 20)
+#define default_read_expire (HZ / 8)
 
 /*
  * ditto for writes, these limits are not hard, even
  * if the disk is capable of satisfying them.
  */
-#define default_write_expire (HZ / 5)
+#define default_write_expire (HZ / 4)
 
 /*
  * read_batch_expire describes how long we will allow a stream of reads to
  * persist before looking to see whether it is time to switch over to writes.
  */
-#define default_read_batch_expire (HZ / 5)
+#define default_read_batch_expire (HZ / 4)
 
 /*
  * write_batch_expire describes how long we want a stream of writes to run for.
@@ -51,7 +51,7 @@
  * See, the problem is: we can send a lot of writes to disk cache / TCQ in
  * a short amount of time...
  */
-#define default_write_batch_expire (HZ / 20)
+#define default_write_batch_expire (HZ / 16)
 
 /*
  * max time we may wait to anticipate a read (default around 6ms)
@@ -70,6 +70,7 @@
 /* Bits in as_io_context.state */
 enum as_io_states {
 	AS_TASK_RUNNING=0,	/* Process has not exitted */
+	AS_TASK_IOSTARTED,	/* Process has started some IO */
 	AS_TASK_IORUNNING,	/* Process has completed some IO */
 };
 
@@ -99,7 +100,14 @@
 	sector_t last_sector[2];	/* last REQ_SYNC & REQ_ASYNC sectors */
 	struct list_head *dispatch;	/* driver dispatch queue */
 	struct list_head *hash;		/* request hash */
-	unsigned long new_success; /* anticipation success on new proc */
+
+	unsigned long exit_prob;	/* probability a task will exit while
+					   being waited on */
+	unsigned long new_ttime_total; 	/* mean thinktime on new proc */
+	unsigned long new_ttime_mean;
+	u64 new_seek_total;		/* mean seek on new proc */
+	sector_t new_seek_mean;
+
 	unsigned long current_batch_expires;
 	unsigned long last_check_fifo[2];
 	int changed_batch;		/* 1: waiting for old batch to end */
@@ -137,6 +145,10 @@
 				   scheduler */
 	AS_RQ_DISPATCHED,	/* On the dispatch list. It belongs to the
 				   driver now */
+	AS_RQ_PRESCHED,		/* Debug poisoning for requests being used */
+	AS_RQ_REMOVED,
+	AS_RQ_MERGED,
+	AS_RQ_POSTSCHED,	/* when they shouldn't be */
 };
 
 struct as_rq {
@@ -183,6 +195,7 @@
 /* Called when the task exits */
 static void exit_as_io_context(struct as_io_context *aic)
 {
+	WARN_ON(!test_bit(AS_TASK_RUNNING, &aic->state));
 	clear_bit(AS_TASK_RUNNING, &aic->state);
 }
 
@@ -413,6 +426,8 @@
 				 * for a request.
 				 */
 
+#define BACK_PENALTY	2
+
 /*
  * as_choose_req selects the preferred one of two requests of the same data_dir
  * ignoring time - eg. timeouts, which is the job of as_dispatch_request
@@ -446,7 +461,7 @@
 	if (s1 >= last)
 		d1 = s1 - last;
 	else if (s1+maxback >= last)
-		d1 = (last - s1)*2;
+		d1 = (last - s1)*BACK_PENALTY;
 	else {
 		r1_wrap = 1;
 		d1 = 0; /* shut up, gcc */
@@ -455,7 +470,7 @@
 	if (s2 >= last)
 		d2 = s2 - last;
 	else if (s2+maxback >= last)
-		d2 = (last - s2)*2;
+		d2 = (last - s2)*BACK_PENALTY;
 	else {
 		r2_wrap = 1;
 		d2 = 0;
@@ -585,18 +600,11 @@
 	int status = ad->antic_status;
 
 	if (status == ANTIC_WAIT_REQ || status == ANTIC_WAIT_NEXT) {
-		struct as_io_context *aic;
-
 		if (status == ANTIC_WAIT_NEXT)
 			del_timer(&ad->antic_timer);
 		ad->antic_status = ANTIC_FINISHED;
 		/* see as_work_handler */
 		kblockd_schedule_work(&ad->antic_work);
-
-		aic = ad->io_context->aic;
-		if (aic->seek_samples == 0)
-			/* new process */
-			ad->new_success = (ad->new_success * 3) / 4 + 256;
 	}
 }
 
@@ -612,14 +620,15 @@
 	spin_lock_irqsave(q->queue_lock, flags);
 	if (ad->antic_status == ANTIC_WAIT_REQ
 			|| ad->antic_status == ANTIC_WAIT_NEXT) {
-		struct as_io_context *aic;
+		struct as_io_context *aic = ad->io_context->aic;
+
 		ad->antic_status = ANTIC_FINISHED;
 		kblockd_schedule_work(&ad->antic_work);
 
-		aic = ad->io_context->aic;
-		if (aic->seek_samples == 0)
-			/* new process */
-			ad->new_success = (ad->new_success * 3) / 4;
+		if (aic->ttime_samples == 0) {
+			/* process anticipated on has exitted or timed out*/
+			ad->exit_prob = (7*ad->exit_prob + 256)/8;
+		}
 	}
 	spin_unlock_irqrestore(q->queue_lock, flags);
 }
@@ -633,7 +642,7 @@
 	unsigned long delay;	/* milliseconds */
 	sector_t last = ad->last_sector[ad->batch_data_dir];
 	sector_t next = arq->request->sector;
-	sector_t delta;	/* acceptable close offset (in sectors) */
+	sector_t delta; /* acceptable close offset (in sectors) */
 
 	if (ad->antic_status == ANTIC_OFF || !ad->ioc_finished)
 		delay = 0;
@@ -667,9 +676,13 @@
 {
 	struct io_context *ioc;
 	struct as_io_context *aic;
+	sector_t s;
 
-	if (arq && arq->is_sync == REQ_SYNC && as_close_req(ad, arq)) {
-		/* close request */
+	ioc = ad->io_context;
+	BUG_ON(!ioc);
+
+	if (arq && ioc == arq->io_context) {
+		/* request from same process */
 		return 1;
 	}
 
@@ -681,20 +694,14 @@
 		return 1;
 	}
 
-	ioc = ad->io_context;
-	BUG_ON(!ioc);
-
-	if (arq && ioc == arq->io_context) {
-		/* request from same process */
-		return 1;
-	}
-
 	aic = ioc->aic;
 	if (!aic)
 		return 0;
 
 	if (!test_bit(AS_TASK_RUNNING, &aic->state)) {
 		/* process anticipated on has exitted */
+		if (aic->ttime_samples == 0)
+			ad->exit_prob = (7*ad->exit_prob + 256)/8;
 		return 1;
 	}
 
@@ -708,28 +715,52 @@
 		return 1;
 	}
 
-	if (ad->new_success < 256 &&
-			(aic->seek_samples == 0 || aic->ttime_samples == 0)) {
+	if (arq && arq->is_sync == REQ_SYNC && as_close_req(ad, arq)) {
 		/*
-		 * Process has just started IO and we have a bad history of
-		 * success anticipating on new processes!
+		 * Found a close request that is not one of ours.
+		 *
+		 * This makes close requests from another process reset
+		 * our thinktime delay. Is generally useful when there are
+		 * two or more cooperating processes working in the same
+		 * area.
 		 */
+		spin_lock(&aic->lock);
+		aic->last_end_request = jiffies;
+		spin_unlock(&aic->lock);
 		return 1;
 	}
 
-	if (aic->ttime_mean > ad->antic_expire) {
+
+	if (aic->ttime_samples == 0) {
+		if (ad->new_ttime_mean > ad->antic_expire)
+			return 1;
+		if (ad->exit_prob > 128)
+			return 1;
+	} else if (aic->ttime_mean > ad->antic_expire) {
 		/* the process thinks too much between requests */
 		return 1;
 	}
 
-	if (arq && aic->seek_samples) {
-		sector_t s;
-		if (ad->last_sector[REQ_SYNC] < arq->request->sector)
-			s = arq->request->sector - ad->last_sector[REQ_SYNC];
-		else
-			s = ad->last_sector[REQ_SYNC] - arq->request->sector;
+	if (!arq)
+		return 0;
 
-		if (aic->seek_mean > (s>>1)) {
+	if (ad->last_sector[REQ_SYNC] < arq->request->sector)
+		s = arq->request->sector - ad->last_sector[REQ_SYNC];
+	else
+		s = ad->last_sector[REQ_SYNC] - arq->request->sector;
+
+	if (aic->seek_samples == 0) {
+		/*
+		 * Process has just started IO. Use past statistics to
+		 * guage success possibility
+		 */
+		if (ad->new_seek_mean > s) {
+			/* this request is better than what we're expecting */
+			return 1;
+		}
+
+	} else {
+		if (aic->seek_mean > s) {
 			/* this request is better than what we're expecting */
 			return 1;
 		}
@@ -774,12 +805,51 @@
 	return 1;
 }
 
+static void as_update_thinktime(struct as_data *ad, struct as_io_context *aic, unsigned long ttime)
+{
+	/* fixed point: 1.0 == 1<<8 */
+	if (aic->ttime_samples == 0) {
+		ad->new_ttime_total = (7*ad->new_ttime_total + 256*ttime) / 8;
+		ad->new_ttime_mean = ad->new_ttime_total / 256;
+
+		ad->exit_prob = (7*ad->exit_prob)/8;
+	}
+	aic->ttime_samples = (7*aic->ttime_samples + 256) / 8;
+	aic->ttime_total = (7*aic->ttime_total + 256*ttime) / 8;
+	aic->ttime_mean = (aic->ttime_total + 128) / aic->ttime_samples;
+}
+
+static void as_update_seekdist(struct as_data *ad, struct as_io_context *aic, sector_t sdist)
+{
+	u64 total;
+
+	if (aic->seek_samples == 0) {
+		ad->new_seek_total = (7*ad->new_seek_total + 256*(u64)sdist)/8;
+		ad->new_seek_mean = ad->new_seek_total / 256;
+	}
+
+	/*
+	 * Don't allow the seek distance to get too large from the
+	 * odd fragment, pagein, etc
+	 */
+	if (aic->seek_samples <= 60) /* second&third seek */
+		sdist = min(sdist, (aic->seek_mean * 4) + 2*1024*1024);
+	else
+		sdist = min(sdist, (aic->seek_mean * 4)	+ 2*1024*64);
+
+	aic->seek_samples = (7*aic->seek_samples + 256) / 8;
+	aic->seek_total = (7*aic->seek_total + (u64)256*sdist) / 8;
+	total = aic->seek_total + (aic->seek_samples/2);
+	do_div(total, aic->seek_samples);
+	aic->seek_mean = (sector_t)total;
+}
+
 /*
  * as_update_iohist keeps a decaying histogram of IO thinktimes, and
  * updates @aic->ttime_mean based on that. It is called when a new
  * request is queued.
  */
-static void as_update_iohist(struct as_io_context *aic, struct request *rq)
+static void as_update_iohist(struct as_data *ad, struct as_io_context *aic, struct request *rq)
 {
 	struct as_rq *arq = RQ_DATA(rq);
 	int data_dir = arq->is_sync;
@@ -790,60 +860,29 @@
 		return;
 
 	if (data_dir == REQ_SYNC) {
+		unsigned long in_flight = atomic_read(&aic->nr_queued)
+					+ atomic_read(&aic->nr_dispatched);
 		spin_lock(&aic->lock);
-
-		if (test_bit(AS_TASK_IORUNNING, &aic->state)
-				&& !atomic_read(&aic->nr_queued)
-				&& !atomic_read(&aic->nr_dispatched)) {
+		if (test_bit(AS_TASK_IORUNNING, &aic->state) ||
+			test_bit(AS_TASK_IOSTARTED, &aic->state)) {
 			/* Calculate read -> read thinktime */
-			thinktime = jiffies - aic->last_end_request;
-			thinktime = min(thinktime, MAX_THINKTIME-1);
-			/* fixed point: 1.0 == 1<<8 */
-			aic->ttime_samples += 256;
-			aic->ttime_total += 256*thinktime;
-			if (aic->ttime_samples)
-				/* fixed point factor is cancelled here */
-				aic->ttime_mean = (aic->ttime_total + 128)
-							/ aic->ttime_samples;
-			aic->ttime_samples = (aic->ttime_samples>>1)
-						+ (aic->ttime_samples>>2);
-			aic->ttime_total = (aic->ttime_total>>1)
-						+ (aic->ttime_total>>2);
-		}
-
-		/* Calculate read -> read seek distance */
-		if (!aic->seek_samples)
-			seek_dist = 0;
-		else if (aic->last_request_pos < rq->sector)
-			seek_dist = rq->sector - aic->last_request_pos;
-		else
-			seek_dist = aic->last_request_pos - rq->sector;
-
+			if (test_bit(AS_TASK_IORUNNING, &aic->state)
+							&& in_flight == 0) {
+				thinktime = jiffies - aic->last_end_request;
+				thinktime = min(thinktime, MAX_THINKTIME-1);
+			} else
+				thinktime = 0;
+			as_update_thinktime(ad, aic, thinktime);
+
+			/* Calculate read -> read seek distance */
+			if (aic->last_request_pos < rq->sector)
+				seek_dist = rq->sector - aic->last_request_pos;
+			else
+				seek_dist = aic->last_request_pos - rq->sector;
+			as_update_seekdist(ad, aic, seek_dist);
+		}
 		aic->last_request_pos = rq->sector + rq->nr_sectors;
-
-		/*
-		 * Don't allow the seek distance to get too large from the
-		 * odd fragment, pagein, etc
-		 */
-		if (aic->seek_samples < 400) /* second&third seek */
-			seek_dist = min(seek_dist, (aic->seek_mean * 4)
-							+ 2*1024*1024);
-		else
-			seek_dist = min(seek_dist, (aic->seek_mean * 4)
-							+ 2*1024*64);
-
-		aic->seek_samples += 256;
-		aic->seek_total += (u64)256*seek_dist;
-		if (aic->seek_samples) {
-			u64 total = aic->seek_total + (aic->seek_samples>>1);
-			do_div(total, aic->seek_samples);
-			aic->seek_mean = (sector_t)total;
-		}
-		aic->seek_samples = (aic->seek_samples>>1)
-					+ (aic->seek_samples>>2);
-		aic->seek_total = (aic->seek_total>>1)
-					+ (aic->seek_total>>2);
-
+		set_bit(AS_TASK_IOSTARTED, &aic->state);
 		spin_unlock(&aic->lock);
 	}
 }
@@ -908,15 +947,25 @@
 {
 	struct as_data *ad = q->elevator.elevator_data;
 	struct as_rq *arq = RQ_DATA(rq);
-	struct as_io_context *aic;
 
 	WARN_ON(!list_empty(&rq->queuelist));
 
-	if (unlikely(arq->state != AS_RQ_DISPATCHED))
-		return;
+	if (arq->state == AS_RQ_PRESCHED) {
+		WARN_ON(arq->io_context);
+		goto out;
+	}
+
+	if (arq->state == AS_RQ_MERGED)
+		goto out_ioc;
+
+	if (arq->state != AS_RQ_REMOVED) {
+		printk("arq->state %d\n", arq->state);
+		WARN_ON(1);
+		goto out;
+	}
 
 	if (!blk_fs_request(rq))
-		return;
+		goto out;
 
 	if (ad->changed_batch && ad->nr_dispatched == 1) {
 		kblockd_schedule_work(&ad->antic_work);
@@ -940,10 +989,7 @@
 		ad->new_batch = 0;
 	}
 
-	if (!arq->io_context)
-		return;
-
-	if (ad->io_context == arq->io_context) {
+	if (ad->io_context == arq->io_context && ad->io_context) {
 		ad->antic_start = jiffies;
 		ad->ioc_finished = 1;
 		if (ad->antic_status == ANTIC_WAIT_REQ) {
@@ -955,18 +1001,23 @@
 		}
 	}
 
-	aic = arq->io_context->aic;
-	if (!aic)
-		return;
+out_ioc:
+	if (!arq->io_context)
+		goto out;
 
-	spin_lock(&aic->lock);
 	if (arq->is_sync == REQ_SYNC) {
-		set_bit(AS_TASK_IORUNNING, &aic->state);
-		aic->last_end_request = jiffies;
+		struct as_io_context *aic = arq->io_context->aic;
+		if (aic) {
+			spin_lock(&aic->lock);
+			set_bit(AS_TASK_IORUNNING, &aic->state);
+			aic->last_end_request = jiffies;
+			spin_unlock(&aic->lock);
+		}
 	}
-	spin_unlock(&aic->lock);
 
 	put_io_context(arq->io_context);
+out:
+	arq->state = AS_RQ_POSTSCHED;
 }
 
 /*
@@ -1035,14 +1086,14 @@
 	struct as_rq *arq = RQ_DATA(rq);
 
 	if (unlikely(arq->state == AS_RQ_NEW))
-		return;
-
-	if (!arq) {
-		WARN_ON(1);
-		return;
-	}
+		goto out;
 
 	if (ON_RB(&arq->rb_node)) {
+		if (arq->state != AS_RQ_QUEUED) {
+			printk("arq->state %d\n", arq->state);
+			WARN_ON(1);
+			goto out;
+		}
 		/*
 		 * We'll lose the aliased request(s) here. I don't think this
 		 * will ever happen, but if it does, hopefully someone will
@@ -1050,8 +1101,16 @@
 		 */
 		WARN_ON(!list_empty(&rq->queuelist));
 		as_remove_queued_request(q, rq);
-	} else
+	} else {
+		if (arq->state != AS_RQ_DISPATCHED) {
+			printk("arq->state %d\n", arq->state);
+			WARN_ON(1);
+			goto out;
+		}
 		as_remove_dispatched_request(q, rq);
+	}
+out:
+	arq->state = AS_RQ_REMOVED;
 }
 
 /*
@@ -1229,9 +1288,9 @@
 			 */
 			goto dispatch_writes;
 
- 		if (ad->batch_data_dir == REQ_ASYNC) {
+		if (ad->batch_data_dir == REQ_ASYNC) {
 			WARN_ON(ad->new_batch);
- 			ad->changed_batch = 1;
+			ad->changed_batch = 1;
 		}
 		ad->batch_data_dir = REQ_SYNC;
 		arq = list_entry_fifo(ad->fifo_list[ad->batch_data_dir].next);
@@ -1247,8 +1306,8 @@
 dispatch_writes:
 		BUG_ON(RB_EMPTY(&ad->sort_list[REQ_ASYNC]));
 
- 		if (ad->batch_data_dir == REQ_SYNC) {
- 			ad->changed_batch = 1;
+		if (ad->batch_data_dir == REQ_SYNC) {
+			ad->changed_batch = 1;
 
 			/*
 			 * new_batch might be 1 when the queue runs out of
@@ -1291,8 +1350,6 @@
 			ad->new_batch = 1;
 
 		ad->changed_batch = 0;
-
-		arq->request->flags |= REQ_SOFTBARRIER;
 	}
 
 	/*
@@ -1369,8 +1426,8 @@
 	arq->io_context = as_get_io_context();
 
 	if (arq->io_context) {
+		as_update_iohist(ad, arq->io_context->aic, arq->request);
 		atomic_inc(&arq->io_context->aic->nr_queued);
-		as_update_iohist(arq->io_context->aic, arq->request);
 	}
 
 	alias = as_add_arq_rb(ad, arq);
@@ -1391,6 +1448,7 @@
 
 	} else {
 		as_add_aliased_request(ad, arq, alias);
+
 		/*
 		 * have we been anticipating this request?
 		 * or does it come from the same process as the one we are
@@ -1416,6 +1474,11 @@
 	struct as_rq *arq = RQ_DATA(rq);
 
 	if (arq) {
+		if (arq->state != AS_RQ_REMOVED) {
+			printk("arq->state %d\n", arq->state);
+			WARN_ON(1);
+		}
+
 		arq->state = AS_RQ_DISPATCHED;
 		if (arq->io_context && arq->io_context->aic)
 			atomic_inc(&arq->io_context->aic->nr_dispatched);
@@ -1427,8 +1490,6 @@
 
 	/* Stop anticipating - let this request get through */
 	as_antic_stop(ad);
-
-	return;
 }
 
 static void
@@ -1437,10 +1498,20 @@
 	struct as_data *ad = q->elevator.elevator_data;
 	struct as_rq *arq = RQ_DATA(rq);
 
+	if (arq) {
+		if (arq->state != AS_RQ_PRESCHED) {
+			printk("arq->state: %d\n", arq->state);
+			WARN_ON(1);
+		}
+		arq->state = AS_RQ_NEW;
+	}
+
 	/* barriers must flush the reorder queue */
 	if (unlikely(rq->flags & (REQ_SOFTBARRIER | REQ_HARDBARRIER)
-			&& where == ELEVATOR_INSERT_SORT))
+			&& where == ELEVATOR_INSERT_SORT)) {
+		WARN_ON(1);
 		where = ELEVATOR_INSERT_BACK;
+	}
 
 	switch (where) {
 		case ELEVATOR_INSERT_BACK:
@@ -1675,7 +1746,8 @@
 	 * kill knowledge of next, this one is a goner
 	 */
 	as_remove_queued_request(q, next);
-	put_io_context(anext->io_context);
+
+	anext->state = AS_RQ_MERGED;
 }
 
 /*
@@ -1708,6 +1780,11 @@
 		return;
 	}
 
+	if (arq->state != AS_RQ_POSTSCHED && arq->state != AS_RQ_PRESCHED) {
+		printk("arq->state %d\n", arq->state);
+		WARN_ON(1);
+	}
+
 	mempool_free(arq, ad->arq_pool);
 	rq->elevator_private = NULL;
 }
@@ -1721,7 +1798,7 @@
 		memset(arq, 0, sizeof(*arq));
 		RB_CLEAR(&arq->rb_node);
 		arq->request = rq;
-		arq->state = AS_RQ_NEW;
+		arq->state = AS_RQ_PRESCHED;
 		arq->io_context = NULL;
 		INIT_LIST_HEAD(&arq->hash);
 		arq->on_hash = 0;
@@ -1823,8 +1900,6 @@
 	if (ad->write_batch_count < 2)
 		ad->write_batch_count = 2;
 
-	ad->new_success = 512;
-
 	return 0;
 }
 
@@ -1860,6 +1935,17 @@
 	return count;
 }
 
+static ssize_t as_est_show(struct as_data *ad, char *page)
+{
+	int pos = 0;
+
+	pos += sprintf(page+pos, "%lu %% exit probability\n", 100*ad->exit_prob/256);
+	pos += sprintf(page+pos, "%lu ms new thinktime\n", ad->new_ttime_mean);
+	pos += sprintf(page+pos, "%llu sectors new seek distance\n", (unsigned long long)ad->new_seek_mean);
+
+	return pos;
+}
+
 #define SHOW_FUNCTION(__FUNC, __VAR)					\
 static ssize_t __FUNC(struct as_data *ad, char *page)		\
 {									\
@@ -1891,6 +1977,10 @@
 			&ad->batch_expire[REQ_ASYNC], 0, INT_MAX);
 #undef STORE_FUNCTION
 
+static struct as_fs_entry as_est_entry = {
+	.attr = {.name = "est_time", .mode = S_IRUGO },
+	.show = as_est_show,
+};
 static struct as_fs_entry as_readexpire_entry = {
 	.attr = {.name = "read_expire", .mode = S_IRUGO | S_IWUSR },
 	.show = as_readexpire_show,
@@ -1918,6 +2008,7 @@
 };
 
 static struct attribute *default_attrs[] = {
+	&as_est_entry.attr,
 	&as_readexpire_entry.attr,
 	&as_writeexpire_entry.attr,
 	&as_anticexpire_entry.attr,
diff -Nru a/drivers/block/elevator.c b/drivers/block/elevator.c
--- a/drivers/block/elevator.c	Tue Feb  3 19:45:37 2004
+++ b/drivers/block/elevator.c	Tue Feb  3 19:45:37 2004
@@ -165,6 +165,7 @@
 	if (plug)
 		blk_plug_device(q);
 
+	rq->q = q;
 	q->elevator.elevator_add_req_fn(q, rq, where);
 }
 
diff -Nru a/drivers/block/floppy.c b/drivers/block/floppy.c
--- a/drivers/block/floppy.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/block/floppy.c	Tue Feb  3 19:45:17 2004
@@ -3784,8 +3784,7 @@
 	/* Allow ioctls if we have write-permissions even if read-only open.
 	 * Needed so that programs such as fdrawcmd still can work on write
 	 * protected disks */
-	if ((filp->f_mode & 2) || 
-	    (inode->i_sb && (permission(inode,2, NULL) == 0)))
+	if (filp->f_mode & 2 || permission(filp->f_dentry->d_inode,2,NULL) == 0)
 	    filp->private_data = (void*) 8;
 
 	if (UFDCS->rawcmd == 1)
diff -Nru a/drivers/block/floppy98.c b/drivers/block/floppy98.c
--- a/drivers/block/floppy98.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/block/floppy98.c	Tue Feb  3 19:45:17 2004
@@ -3859,8 +3859,7 @@
 	/* Allow ioctls if we have write-permissions even if read-only open.
 	 * Needed so that programs such as fdrawcmd still can work on write
 	 * protected disks */
-	if ((filp->f_mode & 2) || 
-	    (inode->i_sb && (permission(inode,2) == 0)))
+	if (filp->f_mode & 2 || permission(filp->f_dentry->d_inode,2,NULL) == 0)
 	    filp->private_data = (void*) 8;
 
 	if (UFDCS->rawcmd == 1)
diff -Nru a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c
--- a/drivers/block/ll_rw_blk.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/block/ll_rw_blk.c	Tue Feb  3 19:45:16 2004
@@ -145,6 +145,8 @@
 	q->activity_data = data;
 }
 
+EXPORT_SYMBOL(blk_queue_activity_fn);
+
 /**
  * blk_queue_prep_rq - set a prepare_request function for queue
  * @q:		queue
@@ -173,9 +175,11 @@
  * are dynamic, and thus we have to query the queue whether it is ok to
  * add a new bio_vec to a bio at a given offset or not. If the block device
  * has such limitations, it needs to register a merge_bvec_fn to control
- * the size of bio's sent to it. Per default now merge_bvec_fn is defined for
- * a queue, and only the fixed limits are honored.
- *
+ * the size of bio's sent to it. Note that a block device *must* allow a
+ * single page to be added to an empty bio. The block device driver may want
+ * to use the bio_split() function to deal with these bio's. By default
+ * no merge_bvec_fn is defined for a queue, and only the fixed limits are
+ * honored.
  */
 void blk_queue_merge_bvec(request_queue_t *q, merge_bvec_fn *mbfn)
 {
@@ -1834,8 +1838,6 @@
 	if (unlikely(--req->ref_count))
 		return;
 
-	elv_completed_request(req->q, req);
-
 	req->rq_status = RQ_INACTIVE;
 	req->q = NULL;
 	req->rl = NULL;
@@ -1847,6 +1849,8 @@
 	if (rl) {
 		int rw = rq_data_dir(req);
 
+		elv_completed_request(q, req);
+
 		BUG_ON(!list_empty(&req->queuelist));
 
 		blk_free_request(q, req);
@@ -1856,14 +1860,13 @@
 
 void blk_put_request(struct request *req)
 {
-	request_queue_t *q = req->q;
-	
 	/*
-	 * if req->q isn't set, this request didnt originate from the
+	 * if req->rl isn't set, this request didnt originate from the
 	 * block layer, so it's safe to just disregard it
 	 */
-	if (q) {
+	if (req->rl) {
 		unsigned long flags;
+		request_queue_t *q = req->q;
 
 		spin_lock_irqsave(q->queue_lock, flags);
 		__blk_put_request(q, req);
@@ -2489,8 +2492,6 @@
 			 * not a complete bvec done
 			 */
 			if (unlikely(nbytes > nr_bytes)) {
-				bio_iovec_idx(bio, idx)->bv_offset += nr_bytes;
-				bio_iovec_idx(bio, idx)->bv_len -= nr_bytes;
 				bio_nbytes += nr_bytes;
 				total_bytes += nr_bytes;
 				break;
@@ -2526,7 +2527,9 @@
 	 */
 	if (bio_nbytes) {
 		bio_endio(bio, bio_nbytes, error);
-		req->bio->bi_idx += next_idx;
+		bio->bi_idx += next_idx;
+		bio_iovec(bio)->bv_offset += nr_bytes;
+		bio_iovec(bio)->bv_len -= nr_bytes;
 	}
 
 	blk_recalc_rq_sectors(req, total_bytes >> 9);
@@ -2897,7 +2900,7 @@
 
 	request_queue_t *q = disk->queue;
 
-	if (!q)
+	if (!q || !q->request_fn)
 		return -ENXIO;
 
 	q->kobj.parent = kobject_get(&disk->kobj);
@@ -2924,7 +2927,7 @@
 {
 	request_queue_t *q = disk->queue;
 
-	if (q) {
+	if (q && q->request_fn) {
 		elv_unregister_queue(q);
 
 		kobject_unregister(&q->kobj);
diff -Nru a/drivers/block/loop.c b/drivers/block/loop.c
--- a/drivers/block/loop.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/block/loop.c	Tue Feb  3 19:45:29 2004
@@ -55,6 +55,7 @@
 #include <linux/errno.h>
 #include <linux/major.h>
 #include <linux/wait.h>
+#include <linux/blkdev.h>
 #include <linux/blkpg.h>
 #include <linux/init.h>
 #include <linux/devfs_fs_kernel.h>
@@ -140,8 +141,7 @@
 	sector_t x;
 
 	/* Compute loopsize in bytes */
-	size = i_size_read(lo->lo_backing_file->f_dentry->
-				d_inode->i_mapping->host);
+	size = i_size_read(lo->lo_backing_file->f_mapping->host);
 	offset = lo->lo_offset;
 	loopsize = size - offset;
 	if (lo->lo_sizelimit > 0 && lo->lo_sizelimit < loopsize)
@@ -175,7 +175,7 @@
 do_lo_send(struct loop_device *lo, struct bio_vec *bvec, int bsize, loff_t pos)
 {
 	struct file *file = lo->lo_backing_file; /* kudos to NFsckingS */
-	struct address_space *mapping = file->f_dentry->d_inode->i_mapping;
+	struct address_space *mapping = file->f_mapping;
 	struct address_space_operations *aops = mapping->a_ops;
 	struct page *page;
 	char *kaddr, *data;
@@ -660,6 +660,7 @@
 	struct file	*file;
 	struct inode	*inode;
 	struct block_device *lo_device = NULL;
+	struct address_space *mapping;
 	unsigned lo_blocksize;
 	int		lo_flags = 0;
 	int		error;
@@ -676,23 +677,24 @@
 	if (!file)
 		goto out;
 
-	error = -EINVAL;
-	inode = file->f_dentry->d_inode;
+	mapping = file->f_mapping;
+	inode = mapping->host;
 
 	if (!(file->f_mode & FMODE_WRITE))
 		lo_flags |= LO_FLAGS_READ_ONLY;
 
+	error = -EINVAL;
 	if (S_ISBLK(inode->i_mode)) {
-		lo_device = inode->i_bdev;
+		lo_device = I_BDEV(inode);
 		if (lo_device == bdev) {
 			error = -EBUSY;
-			goto out;
+			goto out_putf;
 		}
 		lo_blocksize = block_size(lo_device);
 		if (bdev_read_only(lo_device))
 			lo_flags |= LO_FLAGS_READ_ONLY;
 	} else if (S_ISREG(inode->i_mode)) {
-		struct address_space_operations *aops = inode->i_mapping->a_ops;
+		struct address_space_operations *aops = mapping->a_ops;
 		/*
 		 * If we can't read - sorry. If we only can't write - well,
 		 * it's going to be read-only.
@@ -705,12 +707,9 @@
 
 		lo_blocksize = inode->i_blksize;
 		lo_flags |= LO_FLAGS_DO_BMAP;
-		error = 0;
 	} else
 		goto out_putf;
 
-	get_file(file);
-
 	if (!(lo_file->f_mode & FMODE_WRITE))
 		lo_flags |= LO_FLAGS_READ_ONLY;
 
@@ -725,14 +724,10 @@
 	lo->lo_sizelimit = 0;
 	if (figure_loop_size(lo)) {
 		error = -EFBIG;
-		fput(file);
 		goto out_putf;
 	}
-	lo->old_gfp_mask = mapping_gfp_mask(inode->i_mapping);
-	mapping_set_gfp_mask(inode->i_mapping,
-			     lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
-
-	set_blocksize(bdev, lo_blocksize);
+	lo->old_gfp_mask = mapping_gfp_mask(mapping);
+	mapping_set_gfp_mask(mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
 
 	lo->lo_bio = lo->lo_biotail = NULL;
 
@@ -752,15 +747,16 @@
 		blk_queue_max_sectors(lo->lo_queue, q->max_sectors);
 		blk_queue_max_phys_segments(lo->lo_queue,q->max_phys_segments);
 		blk_queue_max_hw_segments(lo->lo_queue, q->max_hw_segments);
+		blk_queue_hardsect_size(lo->lo_queue, queue_hardsect_size(q));
 		blk_queue_max_segment_size(lo->lo_queue, q->max_segment_size);
 		blk_queue_segment_boundary(lo->lo_queue, q->seg_boundary_mask);
 		blk_queue_merge_bvec(lo->lo_queue, q->merge_bvec_fn);
 	}
 
+	set_blocksize(bdev, lo_blocksize);
+
 	kernel_thread(loop_thread, lo, CLONE_KERNEL);
 	down(&lo->lo_sem);
-
-	fput(file);
 	return 0;
 
  out_putf:
@@ -846,7 +842,7 @@
 	memset(lo->lo_file_name, 0, LO_NAME_SIZE);
 	invalidate_bdev(bdev, 0);
 	set_capacity(disks[lo->lo_number], 0);
-	mapping_set_gfp_mask(filp->f_dentry->d_inode->i_mapping, gfp);
+	mapping_set_gfp_mask(filp->f_mapping, gfp);
 	lo->lo_state = Lo_unbound;
 	fput(filp);
 	/* This is safe: open() is still holding a reference. */
@@ -1124,6 +1120,7 @@
 MODULE_PARM(max_loop, "i");
 MODULE_PARM_DESC(max_loop, "Maximum number of loop devices (1-256)");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS_BLOCKDEV_MAJOR(LOOP_MAJOR);
 
 int loop_register_transfer(struct loop_func_table *funcs)
 {
diff -Nru a/drivers/block/paride/Kconfig b/drivers/block/paride/Kconfig
--- a/drivers/block/paride/Kconfig	Tue Feb  3 19:45:16 2004
+++ b/drivers/block/paride/Kconfig	Tue Feb  3 19:45:16 2004
@@ -130,7 +130,7 @@
 
 config PARIDE_BPCK6
 	tristate "MicroSolutions backpack (Series 6) protocol"
-	depends on PARIDE
+	depends on PARIDE && !64BIT
 	---help---
 	  This option enables support for the Micro Solutions BACKPACK
 	  parallel port Series 6 IDE protocol.  (Most BACKPACK drives made
diff -Nru a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig
--- a/drivers/bluetooth/Kconfig	Tue Feb  3 19:45:17 2004
+++ b/drivers/bluetooth/Kconfig	Tue Feb  3 19:45:17 2004
@@ -13,22 +13,14 @@
 	  Say Y here to compile support for Bluetooth USB devices into the
 	  kernel or say M to compile it as module (hci_usb).
 
-config BT_USB_SCO
-	bool "SCO over HCI USB support"
+config BT_HCIUSB_SCO
+	bool "SCO (voice) support"
 	depends on BT_HCIUSB
 	help
 	  This option enables the SCO support in the HCI USB driver. You need this
-	  to transmit voice data with your Bluetooth USB device. 
-	  Say Y here to compile support for SCO over HCI USB.
+	  to transmit voice data with your Bluetooth USB device.
 
-config BT_USB_ZERO_PACKET
-	bool "USB zero packet support"
-	depends on BT_HCIUSB
-	help
-	  This option is provided only as a work around for buggy Bluetooth USB 
-	  devices. Do _not_ enable it unless you know for sure that your device 
-	  requires zero packets.
-	  Most people should say N here.
+	  Say Y here to compile support for SCO over HCI USB.
 
 config BT_HCIUART
 	tristate "HCI UART driver"
@@ -65,12 +57,37 @@
 	  Say Y here to compile support for HCI BCSP protocol.
 
 config BT_HCIUART_BCSP_TXCRC
-        bool "Transmit CRC with every BCSP packet"
-        depends on BT_HCIUART_BCSP
-        help
+	bool "Transmit CRC with every BCSP packet"
+	depends on BT_HCIUART_BCSP
+	help
 	  If you say Y here, a 16-bit CRC checksum will be transmitted along with
 	  every BCSP (BlueCore Serial Protocol) packet sent to the Bluetooth chip.
 	  This increases reliability, but slightly reduces efficiency.
+
+config BT_HCIBCM203X
+	tristate "HCI BCM203x USB driver"
+	depends on USB && BT
+	select FW_LOADER
+	help
+	  Bluetooth HCI BCM203x USB driver.
+	  This driver provides the firmware loading mechanism for the Broadcom
+	  Blutonium based devices.
+
+	  Say Y here to compile support for HCI BCM203x devices into the
+	  kernel or say M to compile it as module (bcm203x).
+
+config BT_HCIBFUSB
+	tristate "HCI BlueFRITZ! USB driver"
+	depends on USB && BT
+	select FW_LOADER
+	help
+	  Bluetooth HCI BlueFRITZ! USB driver.
+	  This driver provides support for Bluetooth USB devices with AVM
+	  interface:
+	     AVM BlueFRITZ! USB
+
+	  Say Y here to compile support for HCI BFUSB devices into the
+	  kernel or say M to compile it as module (bfusb).
 
 config BT_HCIDTL1
 	tristate "HCI DTL1 (PC Card) driver"
diff -Nru a/drivers/bluetooth/Makefile b/drivers/bluetooth/Makefile
--- a/drivers/bluetooth/Makefile	Tue Feb  3 19:45:42 2004
+++ b/drivers/bluetooth/Makefile	Tue Feb  3 19:45:42 2004
@@ -5,6 +5,8 @@
 obj-$(CONFIG_BT_HCIUSB)		+= hci_usb.o
 obj-$(CONFIG_BT_HCIVHCI)	+= hci_vhci.o
 obj-$(CONFIG_BT_HCIUART)	+= hci_uart.o
+obj-$(CONFIG_BT_HCIBCM203X)	+= bcm203x.o
+obj-$(CONFIG_BT_HCIBFUSB)	+= bfusb.o
 obj-$(CONFIG_BT_HCIDTL1)	+= dtl1_cs.o
 obj-$(CONFIG_BT_HCIBT3C)	+= bt3c_cs.o
 obj-$(CONFIG_BT_HCIBLUECARD)	+= bluecard_cs.o
diff -Nru a/drivers/bluetooth/bcm203x.c b/drivers/bluetooth/bcm203x.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/bluetooth/bcm203x.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,309 @@
+/*
+ *
+ *  Broadcom Blutonium firmware driver
+ *
+ *  Copyright (C) 2003  Marcel Holtmann <marcel@holtmann.org>
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/timer.h>
+
+#include <linux/device.h>
+#include <linux/firmware.h>
+
+#include <linux/usb.h>
+
+#include <net/bluetooth/bluetooth.h>
+
+#ifndef CONFIG_BT_HCIBCM203X_DEBUG
+#undef  BT_DBG
+#define BT_DBG(D...)
+#endif
+
+#define VERSION "1.0"
+
+static struct usb_device_id bcm203x_table[] = {
+	/* Broadcom Blutonium (BCM2033) */
+	{ USB_DEVICE(0x0a5c, 0x2033) },
+
+	{ }	/* Terminating entry */
+};
+
+MODULE_DEVICE_TABLE(usb, bcm203x_table);
+
+
+#define BCM203X_ERROR		0
+#define BCM203X_RESET		1
+#define BCM203X_LOAD_MINIDRV	2
+#define BCM203X_SELECT_MEMORY	3
+#define BCM203X_CHECK_MEMORY	4
+#define BCM203X_LOAD_FIRMWARE	5
+#define BCM203X_CHECK_FIRMWARE	6
+
+#define BCM203X_IN_EP		0x81
+#define BCM203X_OUT_EP		0x02
+
+struct bcm203x_data {
+	struct usb_device	*udev;
+
+	unsigned long		state;
+
+	struct timer_list	timer;
+
+	struct urb		*urb;
+	unsigned char		buffer[4096];
+
+	unsigned char		*fw_data;
+	unsigned int		fw_size;
+	unsigned int		fw_sent;
+};
+
+static void bcm203x_complete(struct urb *urb, struct pt_regs *regs)
+{
+	struct bcm203x_data *data = urb->context;
+	struct usb_device *udev = urb->dev;
+	int len;
+
+	BT_DBG("udev %p urb %p", udev, urb);
+
+	if (urb->status) {
+		BT_ERR("URB failed with status %d", urb->status);
+		data->state = BCM203X_ERROR;
+		return;
+	}
+
+	switch (data->state) {
+	case BCM203X_LOAD_MINIDRV:
+		memcpy(data->buffer, "#", 1);
+
+		usb_fill_bulk_urb(urb, udev,
+				usb_sndbulkpipe(udev, BCM203X_OUT_EP),
+				data->buffer, 1, bcm203x_complete, data);
+
+		data->state = BCM203X_SELECT_MEMORY;
+
+		mod_timer(&data->timer, jiffies + (HZ / 10));
+		break;
+
+	case BCM203X_SELECT_MEMORY:
+		usb_fill_int_urb(urb, udev,
+				usb_rcvintpipe(udev, BCM203X_IN_EP),
+				data->buffer, 32, bcm203x_complete, data, 1);
+
+		data->state = BCM203X_CHECK_MEMORY;
+
+		if (usb_submit_urb(data->urb, GFP_ATOMIC) < 0)
+			BT_ERR("Can't submit URB");
+		break;
+
+	case BCM203X_CHECK_MEMORY:
+		if (data->buffer[0] != '#') {
+			BT_ERR("Memory select failed");
+			data->state = BCM203X_ERROR;
+			break;
+		}
+
+		data->state = BCM203X_LOAD_FIRMWARE;
+
+	case BCM203X_LOAD_FIRMWARE:
+		if (data->fw_sent == data->fw_size) {
+			usb_fill_int_urb(urb, udev,
+					usb_rcvintpipe(udev, BCM203X_IN_EP),
+					data->buffer, 32,
+					bcm203x_complete, data, 1);
+
+			data->state = BCM203X_CHECK_FIRMWARE;
+		} else {
+			len = min_t(uint, data->fw_size - data->fw_sent,
+							sizeof(data->buffer));
+
+			usb_fill_bulk_urb(urb, udev,
+					usb_sndbulkpipe(udev, BCM203X_OUT_EP),
+					data->fw_data + data->fw_sent, len,
+					bcm203x_complete, data);
+
+			data->fw_sent += len;
+		}
+
+		if (usb_submit_urb(data->urb, GFP_ATOMIC) < 0)
+			BT_ERR("Can't submit URB");
+		break;
+
+	case BCM203X_CHECK_FIRMWARE:
+		if (data->buffer[0] != '.') {
+			BT_ERR("Firmware loading failed");
+			data->state = BCM203X_ERROR;
+			break;
+		}
+
+		data->state = BCM203X_RESET;
+		break;
+	}
+}
+
+static void bcm203x_timer(unsigned long user_data)
+{
+	struct bcm203x_data *data = (struct bcm203x_data *) user_data;
+
+	if (usb_submit_urb(data->urb, GFP_ATOMIC) < 0)
+		BT_ERR("Can't submit URB");
+}
+
+static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id *id)
+{
+	const struct firmware *firmware;
+	struct usb_device *udev = interface_to_usbdev(intf);
+	struct bcm203x_data *data;
+
+	BT_DBG("intf %p id %p", intf, id);
+
+	if (intf->altsetting->desc.bInterfaceNumber != 0)
+		return -ENODEV;
+
+	data = kmalloc(sizeof(*data), GFP_KERNEL);
+	if (!data) {
+		BT_ERR("Can't allocate memory for data structure");
+		return -ENOMEM;
+	}
+
+	memset(data, 0, sizeof(*data));
+
+	data->udev  = udev;
+	data->state = BCM203X_LOAD_MINIDRV;
+
+	data->urb = usb_alloc_urb(0, GFP_KERNEL);
+	if (!data->urb) {
+		BT_ERR("Can't allocate URB");
+		kfree(data);
+		return -ENOMEM;
+	}
+
+	if (request_firmware(&firmware, "BCM2033-MD.hex", &udev->dev) < 0) {
+		BT_ERR("Mini driver request failed");
+		usb_free_urb(data->urb);
+		kfree(data);
+		return -EIO;
+	}
+
+	BT_DBG("minidrv data %p size %d", firmware->data, firmware->size);
+
+	if (firmware->size > sizeof(data->buffer)) {
+		BT_ERR("Mini driver exceeds size of buffer");
+		release_firmware(firmware);
+		usb_free_urb(data->urb);
+		kfree(data);
+		return -EIO;
+	}
+
+	memcpy(data->buffer, firmware->data, firmware->size);
+
+	usb_fill_bulk_urb(data->urb, udev,
+			usb_sndbulkpipe(udev, BCM203X_OUT_EP),
+			data->buffer, firmware->size, bcm203x_complete, data);
+
+	release_firmware(firmware);
+
+	if (request_firmware(&firmware, "BCM2033-FW.bin", &udev->dev) < 0) {
+		BT_ERR("Firmware request failed");
+		usb_free_urb(data->urb);
+		kfree(data);
+		return -EIO;
+	}
+
+	BT_DBG("firmware data %p size %d", firmware->data, firmware->size);
+
+	data->fw_data = kmalloc(firmware->size, GFP_KERNEL);
+	if (!data->fw_data) {
+		BT_ERR("Can't allocate memory for firmware image");
+		usb_free_urb(data->urb);
+		kfree(data);
+		return -ENOMEM;
+	}
+
+	memcpy(data->fw_data, firmware->data, firmware->size);
+	data->fw_size = firmware->size;
+	data->fw_sent = 0;
+
+	release_firmware(firmware);
+
+	init_timer(&data->timer);
+	data->timer.function = bcm203x_timer;
+	data->timer.data = (unsigned long) data;
+
+	usb_set_intfdata(intf, data);
+
+	mod_timer(&data->timer, jiffies + HZ);
+
+	return 0;
+}
+
+static void bcm203x_disconnect(struct usb_interface *intf)
+{
+	struct bcm203x_data *data = usb_get_intfdata(intf);
+
+	BT_DBG("intf %p", intf);
+
+	usb_unlink_urb(data->urb);
+
+	usb_set_intfdata(intf, NULL);
+
+	usb_free_urb(data->urb);
+	kfree(data->fw_data);
+	kfree(data);
+}
+
+static struct usb_driver bcm203x_driver = {
+	.owner		= THIS_MODULE,
+	.name		= "bcm203x",
+	.probe		= bcm203x_probe,
+	.disconnect	= bcm203x_disconnect,
+	.id_table	= bcm203x_table,
+};
+
+static int __init bcm203x_init(void)
+{
+	int err;
+
+	BT_INFO("Broadcom Blutonium firmware driver ver %s", VERSION);
+
+	err = usb_register(&bcm203x_driver);
+	if (err < 0)
+		BT_ERR("Failed to register USB driver");
+
+	return err;
+}
+
+static void __exit bcm203x_cleanup(void)
+{
+	usb_deregister(&bcm203x_driver);
+}
+
+module_init(bcm203x_init);
+module_exit(bcm203x_cleanup);
+
+MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
+MODULE_DESCRIPTION("Broadcom Blutonium firmware driver ver " VERSION);
+MODULE_LICENSE("GPL");
diff -Nru a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/bluetooth/bfusb.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,782 @@
+/*
+ *
+ *  AVM BlueFRITZ! USB driver
+ *
+ *  Copyright (C) 2003  Marcel Holtmann <marcel@holtmann.org>
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/types.h>
+#include <linux/sched.h>
+#include <linux/errno.h>
+#include <linux/skbuff.h>
+
+#include <linux/device.h>
+#include <linux/firmware.h>
+
+#include <linux/usb.h>
+
+#include <net/bluetooth/bluetooth.h>
+#include <net/bluetooth/hci_core.h>
+
+#ifndef CONFIG_BT_HCIBFUSB_DEBUG
+#undef  BT_DBG
+#define BT_DBG(D...)
+#endif
+
+#define VERSION "1.1"
+
+static struct usb_driver bfusb_driver;
+
+static struct usb_device_id bfusb_table[] = {
+	/* AVM BlueFRITZ! USB */
+	{ USB_DEVICE(0x057c, 0x2200) },
+
+	{ }	/* Terminating entry */
+};
+
+MODULE_DEVICE_TABLE(usb, bfusb_table);
+
+
+#define BFUSB_MAX_BLOCK_SIZE	256
+
+#define BFUSB_BLOCK_TIMEOUT	(HZ * 3)
+
+#define BFUSB_TX_PROCESS	1
+#define BFUSB_TX_WAKEUP		2
+
+#define BFUSB_MAX_BULK_TX	2
+#define BFUSB_MAX_BULK_RX	2
+
+struct bfusb {
+	struct hci_dev		hdev;
+
+	unsigned long		state;
+
+	struct usb_device	*udev;
+
+	unsigned int		bulk_in_ep;
+	unsigned int		bulk_out_ep;
+	unsigned int		bulk_pkt_size;
+
+	rwlock_t		lock;
+
+	struct sk_buff_head	transmit_q;
+
+	struct sk_buff		*reassembly;
+
+	atomic_t		pending_tx;
+	struct sk_buff_head	pending_q;
+	struct sk_buff_head	completed_q;
+};
+
+struct bfusb_scb {
+	struct urb *urb;
+};
+
+static void bfusb_tx_complete(struct urb *urb, struct pt_regs *regs);
+static void bfusb_rx_complete(struct urb *urb, struct pt_regs *regs);
+
+static struct urb *bfusb_get_completed(struct bfusb *bfusb)
+{
+	struct sk_buff *skb;
+	struct urb *urb = NULL;
+
+	BT_DBG("bfusb %p", bfusb);
+
+	skb = skb_dequeue(&bfusb->completed_q);
+	if (skb) {
+		urb = ((struct bfusb_scb *) skb->cb)->urb;
+		kfree_skb(skb);
+	}
+
+	return urb;
+}
+
+static inline void bfusb_unlink_urbs(struct bfusb *bfusb)
+{
+	struct sk_buff *skb;
+	struct urb *urb;
+
+	BT_DBG("bfusb %p", bfusb);
+
+	while ((skb = skb_dequeue(&bfusb->pending_q))) {
+		urb = ((struct bfusb_scb *) skb->cb)->urb;
+		usb_unlink_urb(urb);
+		skb_queue_tail(&bfusb->completed_q, skb);
+	}
+
+	while ((urb = bfusb_get_completed(bfusb)))
+		usb_free_urb(urb);
+}
+
+
+static int bfusb_send_bulk(struct bfusb *bfusb, struct sk_buff *skb)
+{
+	struct bfusb_scb *scb = (void *) skb->cb;
+	struct urb *urb = bfusb_get_completed(bfusb);
+	int err, pipe;
+
+	BT_DBG("bfusb %p skb %p len %d", bfusb, skb, skb->len);
+
+	if (!urb && !(urb = usb_alloc_urb(0, GFP_ATOMIC)))
+		return -ENOMEM;
+
+	pipe = usb_sndbulkpipe(bfusb->udev, bfusb->bulk_out_ep);
+
+	usb_fill_bulk_urb(urb, bfusb->udev, pipe, skb->data, skb->len,
+			bfusb_tx_complete, skb);
+
+	scb->urb = urb;
+
+	skb_queue_tail(&bfusb->pending_q, skb);
+
+	err = usb_submit_urb(urb, GFP_ATOMIC);
+	if (err) {
+		BT_ERR("%s bulk tx submit failed urb %p err %d", 
+					bfusb->hdev.name, urb, err);
+		skb_unlink(skb);
+		usb_free_urb(urb);
+	} else
+		atomic_inc(&bfusb->pending_tx);
+
+	return err;
+}
+
+static void bfusb_tx_wakeup(struct bfusb *bfusb)
+{
+	struct sk_buff *skb;
+
+	BT_DBG("bfusb %p", bfusb);
+
+	if (test_and_set_bit(BFUSB_TX_PROCESS, &bfusb->state)) {
+		set_bit(BFUSB_TX_WAKEUP, &bfusb->state);
+		return;
+	}
+
+	do {
+		clear_bit(BFUSB_TX_WAKEUP, &bfusb->state);
+
+		while ((atomic_read(&bfusb->pending_tx) < BFUSB_MAX_BULK_TX) &&
+				(skb = skb_dequeue(&bfusb->transmit_q))) {
+			if (bfusb_send_bulk(bfusb, skb) < 0) {
+				skb_queue_head(&bfusb->transmit_q, skb);
+				break;
+			}
+		}
+
+	} while (test_bit(BFUSB_TX_WAKEUP, &bfusb->state));
+
+	clear_bit(BFUSB_TX_PROCESS, &bfusb->state);
+}
+
+static void bfusb_tx_complete(struct urb *urb, struct pt_regs *regs)
+{
+	struct sk_buff *skb = (struct sk_buff *) urb->context;
+	struct bfusb *bfusb = (struct bfusb *) skb->dev;
+
+	BT_DBG("bfusb %p urb %p skb %p len %d", bfusb, urb, skb, skb->len);
+
+	atomic_dec(&bfusb->pending_tx);
+
+	if (!test_bit(HCI_RUNNING, &bfusb->hdev.flags))
+		return;
+
+	if (!urb->status)
+		bfusb->hdev.stat.byte_tx += skb->len;
+	else
+		bfusb->hdev.stat.err_tx++;
+
+	read_lock(&bfusb->lock);
+
+	skb_unlink(skb);
+	skb_queue_tail(&bfusb->completed_q, skb);
+
+	bfusb_tx_wakeup(bfusb);
+
+	read_unlock(&bfusb->lock);
+}
+
+
+static int bfusb_rx_submit(struct bfusb *bfusb, struct urb *urb)
+{
+	struct bfusb_scb *scb;
+	struct sk_buff *skb;
+	int err, pipe, size = HCI_MAX_FRAME_SIZE + 32;
+
+	BT_DBG("bfusb %p urb %p", bfusb, urb);
+
+	if (!urb && !(urb = usb_alloc_urb(0, GFP_ATOMIC)))
+		return -ENOMEM;
+
+	if (!(skb = bt_skb_alloc(size, GFP_ATOMIC))) {
+		usb_free_urb(urb);
+		return -ENOMEM;
+	}
+
+	skb->dev = (void *) bfusb;
+
+	scb = (struct bfusb_scb *) skb->cb;
+	scb->urb = urb;
+
+	pipe = usb_rcvbulkpipe(bfusb->udev, bfusb->bulk_in_ep);
+
+	usb_fill_bulk_urb(urb, bfusb->udev, pipe, skb->data, size,
+			bfusb_rx_complete, skb);
+
+	skb_queue_tail(&bfusb->pending_q, skb);
+
+	err = usb_submit_urb(urb, GFP_ATOMIC);
+	if (err) {
+		BT_ERR("%s bulk rx submit failed urb %p err %d",
+					bfusb->hdev.name, urb, err);
+		skb_unlink(skb);
+		kfree_skb(skb);
+		usb_free_urb(urb);
+	}
+
+	return err;
+}
+
+static inline int bfusb_recv_block(struct bfusb *bfusb, int hdr, unsigned char *data, int len)
+{
+	BT_DBG("bfusb %p hdr 0x%02x data %p len %d", bfusb, hdr, data, len);
+
+	if (hdr & 0x10) {
+		BT_ERR("%s error in block", bfusb->hdev.name);
+		if (bfusb->reassembly)
+			kfree_skb(bfusb->reassembly);
+		bfusb->reassembly = NULL;
+		return -EIO;
+	}
+
+	if (hdr & 0x04) {
+		struct sk_buff *skb;
+		unsigned char pkt_type;
+		int pkt_len = 0;
+
+		if (bfusb->reassembly) {
+			BT_ERR("%s unexpected start block", bfusb->hdev.name);
+			kfree_skb(bfusb->reassembly);
+			bfusb->reassembly = NULL;
+		}
+
+		if (len < 1) {
+			BT_ERR("%s no packet type found", bfusb->hdev.name);
+			return -EPROTO;
+		}
+
+		pkt_type = *data++; len--;
+
+		switch (pkt_type) {
+		case HCI_EVENT_PKT:
+			if (len >= HCI_EVENT_HDR_SIZE) {
+				struct hci_event_hdr *hdr = (struct hci_event_hdr *) data;
+				pkt_len = HCI_EVENT_HDR_SIZE + hdr->plen;
+			} else {
+				BT_ERR("%s event block is too short", bfusb->hdev.name);
+				return -EILSEQ;
+			}
+			break;
+
+		case HCI_ACLDATA_PKT:
+			if (len >= HCI_ACL_HDR_SIZE) {
+				struct hci_acl_hdr *hdr = (struct hci_acl_hdr *) data;
+				pkt_len = HCI_ACL_HDR_SIZE + __le16_to_cpu(hdr->dlen);
+			} else {
+				BT_ERR("%s data block is too short", bfusb->hdev.name);
+				return -EILSEQ;
+			}
+			break;
+
+		case HCI_SCODATA_PKT:
+			if (len >= HCI_SCO_HDR_SIZE) {
+				struct hci_sco_hdr *hdr = (struct hci_sco_hdr *) data;
+				pkt_len = HCI_SCO_HDR_SIZE + hdr->dlen;
+			} else {
+				BT_ERR("%s audio block is too short", bfusb->hdev.name);
+				return -EILSEQ;
+			}
+			break;
+		}
+
+		skb = bt_skb_alloc(pkt_len, GFP_ATOMIC);
+		if (!skb) {
+			BT_ERR("%s no memory for the packet", bfusb->hdev.name);
+			return -ENOMEM;
+		}
+
+		skb->dev = (void *) &bfusb->hdev;
+		skb->pkt_type = pkt_type;
+
+		bfusb->reassembly = skb;
+	} else {
+		if (!bfusb->reassembly) {
+			BT_ERR("%s unexpected continuation block", bfusb->hdev.name);
+			return -EIO;
+		}
+	}
+
+	if (len > 0)
+		memcpy(skb_put(bfusb->reassembly, len), data, len);
+
+	if (hdr & 0x08) {
+		hci_recv_frame(bfusb->reassembly);
+		bfusb->reassembly = NULL;
+	}
+
+	return 0;
+}
+
+static void bfusb_rx_complete(struct urb *urb, struct pt_regs *regs)
+{
+	struct sk_buff *skb = (struct sk_buff *) urb->context;
+	struct bfusb *bfusb = (struct bfusb *) skb->dev;
+	unsigned char *buf = urb->transfer_buffer;
+	int count = urb->actual_length;
+	int err, hdr, len;
+
+	BT_DBG("bfusb %p urb %p skb %p len %d", bfusb, urb, skb, skb->len);
+
+	if (!test_bit(HCI_RUNNING, &bfusb->hdev.flags))
+		return;
+
+	read_lock(&bfusb->lock);
+
+	if (urb->status || !count)
+		goto resubmit;
+
+	bfusb->hdev.stat.byte_rx += count;
+
+	skb_put(skb, count);
+
+	while (count) {
+		hdr = buf[0] | (buf[1] << 8);
+
+		if (hdr & 0x4000) {
+			len = 0;
+			count -= 2;
+			buf   += 2;
+		} else {
+			len = (buf[2] == 0) ? 256 : buf[2];
+			count -= 3;
+			buf   += 3;
+		}
+
+		if (count < len) {
+			BT_ERR("%s block extends over URB buffer ranges",
+					bfusb->hdev.name);
+		}
+
+		if ((hdr & 0xe1) == 0xc1)
+			bfusb_recv_block(bfusb, hdr, buf, len);
+
+		count -= len;
+		buf   += len;
+	}
+
+	skb_unlink(skb);
+	kfree_skb(skb);
+
+	bfusb_rx_submit(bfusb, urb);
+
+	read_unlock(&bfusb->lock);
+
+	return;
+
+resubmit:
+	urb->dev = bfusb->udev;
+
+	err = usb_submit_urb(urb, GFP_ATOMIC);
+	if (err) {
+		BT_ERR("%s bulk resubmit failed urb %p err %d",
+					bfusb->hdev.name, urb, err);
+	}
+
+	read_unlock(&bfusb->lock);
+}
+
+
+static int bfusb_open(struct hci_dev *hdev)
+{
+	struct bfusb *bfusb = (struct bfusb *) hdev->driver_data;
+	unsigned long flags;
+	int i, err;
+
+	BT_DBG("hdev %p bfusb %p", hdev, bfusb);
+
+	if (test_and_set_bit(HCI_RUNNING, &hdev->flags))
+		return 0;
+
+	write_lock_irqsave(&bfusb->lock, flags);
+
+	err = bfusb_rx_submit(bfusb, NULL);
+	if (!err) {
+		for (i = 1; i < BFUSB_MAX_BULK_RX; i++)
+			bfusb_rx_submit(bfusb, NULL);
+	} else {
+		clear_bit(HCI_RUNNING, &hdev->flags);
+	}
+
+	write_unlock_irqrestore(&bfusb->lock, flags);
+
+	return err;
+}
+
+static int bfusb_flush(struct hci_dev *hdev)
+{
+	struct bfusb *bfusb = (struct bfusb *) hdev->driver_data;
+
+	BT_DBG("hdev %p bfusb %p", hdev, bfusb);
+
+	skb_queue_purge(&bfusb->transmit_q);
+
+	return 0;
+}
+
+static int bfusb_close(struct hci_dev *hdev)
+{
+	struct bfusb *bfusb = (struct bfusb *) hdev->driver_data;
+	unsigned long flags;
+
+	BT_DBG("hdev %p bfusb %p", hdev, bfusb);
+
+	if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
+		return 0;
+
+	write_lock_irqsave(&bfusb->lock, flags);
+	write_unlock_irqrestore(&bfusb->lock, flags);
+
+	bfusb_unlink_urbs(bfusb);
+	bfusb_flush(hdev);
+
+	return 0;
+}
+
+static int bfusb_send_frame(struct sk_buff *skb)
+{
+	struct hci_dev *hdev = (struct hci_dev *) skb->dev;
+	struct bfusb *bfusb;
+	struct sk_buff *nskb;
+	unsigned char buf[3];
+	int sent = 0, size, count;
+
+	BT_DBG("hdev %p skb %p type %d len %d", hdev, skb, skb->pkt_type, skb->len);
+
+	if (!hdev) {
+		BT_ERR("Frame for unknown HCI device (hdev=NULL)");
+		return -ENODEV;
+	}
+
+	if (!test_bit(HCI_RUNNING, &hdev->flags))
+		return -EBUSY;
+
+	bfusb = (struct bfusb *) hdev->driver_data;
+
+	switch (skb->pkt_type) {
+	case HCI_COMMAND_PKT:
+		hdev->stat.cmd_tx++;
+		break;
+	case HCI_ACLDATA_PKT:
+		hdev->stat.acl_tx++;
+		break;
+	case HCI_SCODATA_PKT:
+		hdev->stat.sco_tx++;
+		break;
+	};
+
+	/* Prepend skb with frame type */
+	memcpy(skb_push(skb, 1), &(skb->pkt_type), 1);
+
+	count = skb->len;
+
+	/* Max HCI frame size seems to be 1511 + 1 */
+	if (!(nskb = bt_skb_alloc(count + 32, GFP_ATOMIC))) {
+		BT_ERR("Can't allocate memory for new packet");
+		return -ENOMEM;
+	}
+
+	nskb->dev = (void *) bfusb;
+
+	while (count) {
+		size = min_t(uint, count, BFUSB_MAX_BLOCK_SIZE);
+
+		buf[0] = 0xc1 | ((sent == 0) ? 0x04 : 0) | ((count == size) ? 0x08 : 0);
+		buf[1] = 0x00;
+		buf[2] = (size == BFUSB_MAX_BLOCK_SIZE) ? 0 : size;
+
+		memcpy(skb_put(nskb, 3), buf, 3);
+		memcpy(skb_put(nskb, size), skb->data + sent, size);
+
+		sent  += size;
+		count -= size;
+	}
+
+	/* Don't send frame with multiple size of bulk max packet */
+	if ((nskb->len % bfusb->bulk_pkt_size) == 0) {
+		buf[0] = 0xdd;
+		buf[1] = 0x00;
+		memcpy(skb_put(nskb, 2), buf, 2);
+	}
+
+	read_lock(&bfusb->lock);
+
+	skb_queue_tail(&bfusb->transmit_q, nskb);
+	bfusb_tx_wakeup(bfusb);
+
+	read_unlock(&bfusb->lock);
+
+	kfree_skb(skb);
+
+	return 0;
+}
+
+static void bfusb_destruct(struct hci_dev *hdev)
+{
+	struct bfusb *bfusb = (struct bfusb *) hdev->driver_data;
+
+	BT_DBG("hdev %p bfusb %p", hdev, bfusb);
+
+	kfree(bfusb);
+}
+
+static int bfusb_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long arg)
+{
+	return -ENOIOCTLCMD;
+}
+
+
+static int bfusb_load_firmware(struct bfusb *bfusb, unsigned char *firmware, int count)
+{
+	unsigned char *buf;
+	int err, pipe, len, size, sent = 0;
+
+	BT_DBG("bfusb %p udev %p", bfusb, bfusb->udev);
+
+	BT_INFO("BlueFRITZ! USB loading firmware");
+
+	pipe = usb_sndctrlpipe(bfusb->udev, 0);
+
+	if (usb_control_msg(bfusb->udev, pipe, USB_REQ_SET_CONFIGURATION,
+				0, 1, 0, NULL, 0, HZ * USB_CTRL_SET_TIMEOUT) < 0) {
+		BT_ERR("Can't change to loading configuration");
+		return -EBUSY;
+	}
+
+	buf = kmalloc(BFUSB_MAX_BLOCK_SIZE + 3, GFP_ATOMIC);
+	if (!buf) {
+		BT_ERR("Can't allocate memory chunk for firmware");
+		return -ENOMEM;
+	}
+
+	pipe = usb_sndbulkpipe(bfusb->udev, bfusb->bulk_out_ep);
+
+	while (count) {
+		size = min_t(uint, count, BFUSB_MAX_BLOCK_SIZE + 3);
+
+		memcpy(buf, firmware + sent, size);
+
+		err = usb_bulk_msg(bfusb->udev, pipe, buf, size,
+					&len, BFUSB_BLOCK_TIMEOUT);
+
+		if (err || (len != size)) {
+			BT_ERR("Error in firmware loading");
+			goto error;
+		}
+
+		sent  += size;
+		count -= size;
+	}
+
+	if ((err = usb_bulk_msg(bfusb->udev, pipe, NULL, 0,
+				&len, BFUSB_BLOCK_TIMEOUT)) < 0) {
+		BT_ERR("Error in null packet request");
+		goto error;
+	}
+
+	pipe = usb_sndctrlpipe(bfusb->udev, 0);
+
+        if ((err = usb_control_msg(bfusb->udev, pipe, USB_REQ_SET_CONFIGURATION,
+				0, 2, 0, NULL, 0, HZ * USB_CTRL_SET_TIMEOUT)) < 0) {
+		BT_ERR("Can't change to running configuration");
+		goto error;
+	}
+
+	BT_INFO("BlueFRITZ! USB device ready");
+
+	kfree(buf);
+	return 0;
+
+error:
+	kfree(buf);
+
+	pipe = usb_sndctrlpipe(bfusb->udev, 0);
+
+	usb_control_msg(bfusb->udev, pipe, USB_REQ_SET_CONFIGURATION,
+				0, 0, 0, NULL, 0, HZ * USB_CTRL_SET_TIMEOUT);
+
+	return err;
+}
+
+static int bfusb_probe(struct usb_interface *iface, const struct usb_device_id *id)
+{
+	const struct firmware *firmware;
+	struct usb_device *udev = interface_to_usbdev(iface);
+	struct usb_host_endpoint *bulk_out_ep;
+	struct usb_host_endpoint *bulk_in_ep;
+	struct hci_dev *hdev;
+	struct bfusb *bfusb;
+
+	BT_DBG("iface %p id %p", iface, id);
+
+	/* Check number of endpoints */
+	if (iface->altsetting[0].desc.bNumEndpoints < 2)
+		return -EIO;
+
+	bulk_out_ep = &iface->altsetting[0].endpoint[0];
+	bulk_in_ep  = &iface->altsetting[0].endpoint[1];
+
+	if (!bulk_out_ep || !bulk_in_ep) {
+		BT_ERR("Bulk endpoints not found");
+		goto done;
+	}
+
+	/* Initialize control structure and load firmware */
+	if (!(bfusb = kmalloc(sizeof(struct bfusb), GFP_KERNEL))) {
+		BT_ERR("Can't allocate memory for control structure");
+		goto done;
+	}
+
+	memset(bfusb, 0, sizeof(struct bfusb));
+
+	bfusb->udev = udev;
+	bfusb->bulk_in_ep    = bulk_in_ep->desc.bEndpointAddress;
+	bfusb->bulk_out_ep   = bulk_out_ep->desc.bEndpointAddress;
+	bfusb->bulk_pkt_size = bulk_out_ep->desc.wMaxPacketSize;
+
+	bfusb->lock = RW_LOCK_UNLOCKED;
+
+	bfusb->reassembly = NULL;
+
+	skb_queue_head_init(&bfusb->transmit_q);
+	skb_queue_head_init(&bfusb->pending_q);
+	skb_queue_head_init(&bfusb->completed_q);
+
+	if (request_firmware(&firmware, "bfubase.frm", &udev->dev) < 0) {
+		BT_ERR("Firmware request failed");
+		goto error;
+	}
+
+	BT_DBG("firmware data %p size %d", firmware->data, firmware->size);
+
+	if (bfusb_load_firmware(bfusb, firmware->data, firmware->size) < 0) {
+		BT_ERR("Firmware loading failed");
+		goto release;
+	}
+
+	release_firmware(firmware);
+
+	/* Initialize and register HCI device */
+	hdev = &bfusb->hdev;
+
+	hdev->type = HCI_USB;
+	hdev->driver_data = bfusb;
+
+	hdev->open     = bfusb_open;
+	hdev->close    = bfusb_close;
+	hdev->flush    = bfusb_flush;
+	hdev->send     = bfusb_send_frame;
+	hdev->destruct = bfusb_destruct;
+	hdev->ioctl    = bfusb_ioctl;
+
+	hdev->owner = THIS_MODULE;
+
+	if (hci_register_dev(hdev) < 0) {
+		BT_ERR("Can't register HCI device");
+		goto error;
+	}
+
+	usb_set_intfdata(iface, bfusb);
+
+	return 0;
+
+release:
+	release_firmware(firmware);
+
+error:
+	kfree(bfusb);
+
+done:
+	return -EIO;
+}
+
+static void bfusb_disconnect(struct usb_interface *iface)
+{
+	struct bfusb *bfusb = usb_get_intfdata(iface);
+	struct hci_dev *hdev = &bfusb->hdev;
+
+	BT_DBG("iface %p", iface);
+
+	if (!hdev)
+		return;
+
+	usb_set_intfdata(iface, NULL);
+
+	bfusb_close(hdev);
+
+	if (hci_unregister_dev(hdev) < 0)
+		BT_ERR("Can't unregister HCI device %s", hdev->name);
+}
+
+static struct usb_driver bfusb_driver = {
+	.owner		= THIS_MODULE,
+	.name		= "bfusb",
+	.probe		= bfusb_probe,
+	.disconnect	= bfusb_disconnect,
+	.id_table	= bfusb_table,
+};
+
+static int __init bfusb_init(void)
+{
+	int err;
+
+	BT_INFO("BlueFRITZ! USB driver ver %s", VERSION);
+
+	if ((err = usb_register(&bfusb_driver)) < 0)
+		BT_ERR("Failed to register BlueFRITZ! USB driver");
+
+	return err;
+}
+
+static void __exit bfusb_cleanup(void)
+{
+	usb_deregister(&bfusb_driver);
+}
+
+module_init(bfusb_init);
+module_exit(bfusb_cleanup);
+
+MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
+MODULE_DESCRIPTION("BlueFRITZ! USB driver ver " VERSION);
+MODULE_LICENSE("GPL");
diff -Nru a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
--- a/drivers/bluetooth/bluecard_cs.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/bluetooth/bluecard_cs.c	Tue Feb  3 19:45:18 2004
@@ -499,7 +499,7 @@
 }
 
 
-void bluecard_interrupt(int irq, void *dev_inst, struct pt_regs *regs)
+static irqreturn_t bluecard_interrupt(int irq, void *dev_inst, struct pt_regs *regs)
 {
 	bluecard_info_t *info = dev_inst;
 	unsigned int iobase;
@@ -507,11 +507,11 @@
 
 	if (!info) {
 		printk(KERN_WARNING "bluecard_cs: Call of irq %d for unknown device.\n", irq);
-		return;
+		return IRQ_NONE;
 	}
 
 	if (!test_bit(CARD_READY, &(info->hw_state)))
-		return;
+		return IRQ_NONE;
 
 	iobase = info->link.io.BasePort1;
 
@@ -556,6 +556,8 @@
 	outb(info->ctrl_reg, iobase + REG_CONTROL);
 
 	spin_unlock(&(info->lock));
+
+	return IRQ_HANDLED;
 }
 
 
@@ -869,7 +871,7 @@
 	client_reg.Version = 0x0210;
 	client_reg.event_callback_args.client_data = link;
 
-	ret = CardServices(RegisterClient, &link->handle, &client_reg);
+	ret = pcmcia_register_client(&link->handle, &client_reg);
 	if (ret != CS_SUCCESS) {
 		cs_error(link->handle, RegisterClient, ret);
 		bluecard_detach(link);
@@ -898,7 +900,7 @@
 		bluecard_release(link);
 
 	if (link->handle) {
-		ret = CardServices(DeregisterClient, link->handle);
+		ret = pcmcia_deregister_client(link->handle);
 		if (ret != CS_SUCCESS)
 			cs_error(link->handle, DeregisterClient, ret);
 	}
@@ -910,25 +912,21 @@
 }
 
 
-static int get_tuple(int fn, client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
+static int first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
 {
 	int i;
 
-	i = CardServices(fn, handle, tuple);
+	i = pcmcia_get_first_tuple(handle, tuple);
 	if (i != CS_SUCCESS)
 		return CS_NO_MORE_ITEMS;
 
-	i = CardServices(GetTupleData, handle, tuple);
+	i = pcmcia_get_tuple_data(handle, tuple);
 	if (i != CS_SUCCESS)
 		return i;
 
-	return CardServices(ParseTuple, handle, tuple, parse);
+	return pcmcia_parse_tuple(handle, tuple, parse);
 }
 
-
-#define first_tuple(a, b, c) get_tuple(GetFirstTuple, a, b, c)
-#define next_tuple(a, b, c) get_tuple(GetNextTuple, a, b, c)
-
 void bluecard_config(dev_link_t *link)
 {
 	client_handle_t handle = link->handle;
@@ -956,7 +954,7 @@
 
 	/* Configure card */
 	link->state |= DEV_CONFIG;
-	i = CardServices(GetConfigurationInfo, handle, &config);
+	i = pcmcia_get_configuration_info(handle, &config);
 	link->conf.Vcc = config.Vcc;
 
 	link->conf.ConfigIndex = 0x20;
@@ -965,7 +963,7 @@
 
 	for (n = 0; n < 0x400; n += 0x40) {
 		link->io.BasePort1 = n ^ 0x300;
-		i = CardServices(RequestIO, link->handle, &link->io);
+		i = pcmcia_request_io(link->handle, &link->io);
 		if (i == CS_SUCCESS)
 			break;
 	}
@@ -975,13 +973,13 @@
 		goto failed;
 	}
 
-	i = CardServices(RequestIRQ, link->handle, &link->irq);
+	i = pcmcia_request_irq(link->handle, &link->irq);
 	if (i != CS_SUCCESS) {
 		cs_error(link->handle, RequestIRQ, i);
 		link->irq.AssignedIRQ = 0;
 	}
 
-	i = CardServices(RequestConfiguration, link->handle, &link->conf);
+	i = pcmcia_request_configuration(link->handle, &link->conf);
 	if (i != CS_SUCCESS) {
 		cs_error(link->handle, RequestConfiguration, i);
 		goto failed;
@@ -1013,9 +1011,9 @@
 
 	link->dev = NULL;
 
-	CardServices(ReleaseConfiguration, link->handle);
-	CardServices(ReleaseIO, link->handle, &link->io);
-	CardServices(ReleaseIRQ, link->handle, &link->irq);
+	pcmcia_release_configuration(link->handle);
+	pcmcia_release_io(link->handle, &link->io);
+	pcmcia_release_irq(link->handle, &link->irq);
 
 	link->state &= ~DEV_CONFIG;
 }
@@ -1043,14 +1041,14 @@
 		/* Fall through... */
 	case CS_EVENT_RESET_PHYSICAL:
 		if (link->state & DEV_CONFIG)
-			CardServices(ReleaseConfiguration, link->handle);
+			pcmcia_release_configuration(link->handle);
 		break;
 	case CS_EVENT_PM_RESUME:
 		link->state &= ~DEV_SUSPEND;
 		/* Fall through... */
 	case CS_EVENT_CARD_RESET:
 		if (DEV_OK(link))
-			CardServices(RequestConfiguration, link->handle, &link->conf);
+			pcmcia_request_configuration(link->handle, &link->conf);
 		break;
 	}
 
diff -Nru a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
--- a/drivers/bluetooth/bt3c_cs.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/bluetooth/bt3c_cs.c	Tue Feb  3 19:45:43 2004
@@ -355,7 +355,7 @@
 }
 
 
-void bt3c_interrupt(int irq, void *dev_inst, struct pt_regs *regs)
+static irqreturn_t bt3c_interrupt(int irq, void *dev_inst, struct pt_regs *regs)
 {
 	bt3c_info_t *info = dev_inst;
 	unsigned int iobase;
@@ -363,7 +363,7 @@
 
 	if (!info) {
 		printk(KERN_WARNING "bt3c_cs: Call of irq %d for unknown device.\n", irq);
-		return;
+		return IRQ_NONE;
 	}
 
 	iobase = info->link.io.BasePort1;
@@ -396,6 +396,8 @@
 	}
 
 	spin_unlock(&(info->lock));
+
+	return IRQ_HANDLED;
 }
 
 
@@ -615,7 +617,7 @@
 	client_reg.Version = 0x0210;
 	client_reg.event_callback_args.client_data = link;
 
-	ret = CardServices(RegisterClient, &link->handle, &client_reg);
+	ret = pcmcia_register_client(&link->handle, &client_reg);
 	if (ret != CS_SUCCESS) {
 		cs_error(link->handle, RegisterClient, ret);
 		bt3c_detach(link);
@@ -644,7 +646,7 @@
 		bt3c_release(link);
 
 	if (link->handle) {
-		ret = CardServices(DeregisterClient, link->handle);
+		ret = pcmcia_deregister_client(link->handle);
 		if (ret != CS_SUCCESS)
 			cs_error(link->handle, DeregisterClient, ret);
 	}
@@ -655,25 +657,30 @@
 	kfree(info);
 }
 
-
-static int get_tuple(int fn, client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
+static int get_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
 {
 	int i;
 
-	i = CardServices(fn, handle, tuple);
-	if (i != CS_SUCCESS)
-		return CS_NO_MORE_ITEMS;
-
-	i = CardServices(GetTupleData, handle, tuple);
+	i = pcmcia_get_tuple_data(handle, tuple);
 	if (i != CS_SUCCESS)
 		return i;
 
-	return CardServices(ParseTuple, handle, tuple, parse);
+	return pcmcia_parse_tuple(handle, tuple, parse);
 }
 
+static int first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
+{
+	if (pcmcia_get_first_tuple(handle, tuple) != CS_SUCCESS)
+		return CS_NO_MORE_ITEMS;
+	return get_tuple(handle, tuple, parse);
+}
 
-#define first_tuple(a, b, c) get_tuple(GetFirstTuple, a, b, c)
-#define next_tuple(a, b, c) get_tuple(GetNextTuple, a, b, c)
+static int next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
+{
+	if (pcmcia_get_next_tuple(handle, tuple) != CS_SUCCESS)
+		return CS_NO_MORE_ITEMS;
+	return get_tuple(handle, tuple, parse);
+}
 
 void bt3c_config(dev_link_t *link)
 {
@@ -704,7 +711,7 @@
 
 	/* Configure card */
 	link->state |= DEV_CONFIG;
-	i = CardServices(GetConfigurationInfo, handle, &config);
+	i = pcmcia_get_configuration_info(handle, &config);
 	link->conf.Vcc = config.Vcc;
 
 	/* First pass: look for a config entry that looks normal. */
@@ -725,7 +732,7 @@
 				link->conf.ConfigIndex = cf->index;
 				link->io.BasePort1 = cf->io.win[0].base;
 				link->io.IOAddrLines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
-				i = CardServices(RequestIO, link->handle, &link->io);
+				i = pcmcia_request_io(link->handle, &link->io);
 				if (i == CS_SUCCESS)
 					goto found_port;
 			}
@@ -744,7 +751,7 @@
 			for (j = 0; j < 5; j++) {
 				link->io.BasePort1 = base[j];
 				link->io.IOAddrLines = base[j] ? 16 : 3;
-				i = CardServices(RequestIO, link->handle, &link->io);
+				i = pcmcia_request_io(link->handle, &link->io);
 				if (i == CS_SUCCESS)
 					goto found_port;
 			}
@@ -759,13 +766,13 @@
 		goto failed;
 	}
 
-	i = CardServices(RequestIRQ, link->handle, &link->irq);
+	i = pcmcia_request_irq(link->handle, &link->irq);
 	if (i != CS_SUCCESS) {
 		cs_error(link->handle, RequestIRQ, i);
 		link->irq.AssignedIRQ = 0;
 	}
 
-	i = CardServices(RequestConfiguration, link->handle, &link->conf);
+	i = pcmcia_request_configuration(link->handle, &link->conf);
 	if (i != CS_SUCCESS) {
 		cs_error(link->handle, RequestConfiguration, i);
 		goto failed;
@@ -797,9 +804,9 @@
 
 	link->dev = NULL;
 
-	CardServices(ReleaseConfiguration, link->handle);
-	CardServices(ReleaseIO, link->handle, &link->io);
-	CardServices(ReleaseIRQ, link->handle, &link->irq);
+	pcmcia_release_configuration(link->handle);
+	pcmcia_release_io(link->handle, &link->io);
+	pcmcia_release_irq(link->handle, &link->irq);
 
 	link->state &= ~DEV_CONFIG;
 }
@@ -827,14 +834,14 @@
 		/* Fall through... */
 	case CS_EVENT_RESET_PHYSICAL:
 		if (link->state & DEV_CONFIG)
-			CardServices(ReleaseConfiguration, link->handle);
+			pcmcia_release_configuration(link->handle);
 		break;
 	case CS_EVENT_PM_RESUME:
 		link->state &= ~DEV_SUSPEND;
 		/* Fall through... */
 	case CS_EVENT_CARD_RESET:
 		if (DEV_OK(link))
-			CardServices(RequestConfiguration, link->handle, &link->conf);
+			pcmcia_request_configuration(link->handle, &link->conf);
 		break;
 	}
 
diff -Nru a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
--- a/drivers/bluetooth/btuart_cs.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/bluetooth/btuart_cs.c	Tue Feb  3 19:45:43 2004
@@ -301,7 +301,7 @@
 }
 
 
-void btuart_interrupt(int irq, void *dev_inst, struct pt_regs *regs)
+static irqreturn_t btuart_interrupt(int irq, void *dev_inst, struct pt_regs *regs)
 {
 	btuart_info_t *info = dev_inst;
 	unsigned int iobase;
@@ -310,7 +310,7 @@
 
 	if (!info) {
 		printk(KERN_WARNING "btuart_cs: Call of irq %d for unknown device.\n", irq);
-		return;
+		return IRQ_NONE;
 	}
 
 	iobase = info->link.io.BasePort1;
@@ -351,6 +351,8 @@
 	}
 
 	spin_unlock(&(info->lock));
+
+	return IRQ_HANDLED;
 }
 
 
@@ -622,7 +624,7 @@
 	client_reg.Version = 0x0210;
 	client_reg.event_callback_args.client_data = link;
 
-	ret = CardServices(RegisterClient, &link->handle, &client_reg);
+	ret = pcmcia_register_client(&link->handle, &client_reg);
 	if (ret != CS_SUCCESS) {
 		cs_error(link->handle, RegisterClient, ret);
 		btuart_detach(link);
@@ -651,7 +653,7 @@
 		btuart_release(link);
 
 	if (link->handle) {
-		ret = CardServices(DeregisterClient, link->handle);
+		ret = pcmcia_deregister_client(link->handle);
 		if (ret != CS_SUCCESS)
 			cs_error(link->handle, DeregisterClient, ret);
 	}
@@ -662,25 +664,30 @@
 	kfree(info);
 }
 
-
-static int get_tuple(int fn, client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
+static int get_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
 {
 	int i;
 
-	i = CardServices(fn, handle, tuple);
-	if (i != CS_SUCCESS)
-		return CS_NO_MORE_ITEMS;
-
-	i = CardServices(GetTupleData, handle, tuple);
+	i = pcmcia_get_tuple_data(handle, tuple);
 	if (i != CS_SUCCESS)
 		return i;
 
-	return CardServices(ParseTuple, handle, tuple, parse);
+	return pcmcia_parse_tuple(handle, tuple, parse);
 }
 
+static int first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
+{
+	if (pcmcia_get_first_tuple(handle, tuple) != CS_SUCCESS)
+		return CS_NO_MORE_ITEMS;
+	return get_tuple(handle, tuple, parse);
+}
 
-#define first_tuple(a, b, c) get_tuple(GetFirstTuple, a, b, c)
-#define next_tuple(a, b, c) get_tuple(GetNextTuple, a, b, c)
+static int next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
+{
+	if (pcmcia_get_next_tuple(handle, tuple) != CS_SUCCESS)
+		return CS_NO_MORE_ITEMS;
+	return get_tuple(handle, tuple, parse);
+}
 
 void btuart_config(dev_link_t *link)
 {
@@ -711,7 +718,7 @@
 
 	/* Configure card */
 	link->state |= DEV_CONFIG;
-	i = CardServices(GetConfigurationInfo, handle, &config);
+	i = pcmcia_get_configuration_info(handle, &config);
 	link->conf.Vcc = config.Vcc;
 
 	/* First pass: look for a config entry that looks normal. */
@@ -732,7 +739,7 @@
 				link->conf.ConfigIndex = cf->index;
 				link->io.BasePort1 = cf->io.win[0].base;
 				link->io.IOAddrLines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
-				i = CardServices(RequestIO, link->handle, &link->io);
+				i = pcmcia_request_io(link->handle, &link->io);
 				if (i == CS_SUCCESS)
 					goto found_port;
 			}
@@ -752,7 +759,7 @@
 			for (j = 0; j < 5; j++) {
 				link->io.BasePort1 = base[j];
 				link->io.IOAddrLines = base[j] ? 16 : 3;
-				i = CardServices(RequestIO, link->handle, &link->io);
+				i = pcmcia_request_io(link->handle, &link->io);
 				if (i == CS_SUCCESS)
 					goto found_port;
 			}
@@ -767,13 +774,13 @@
 		goto failed;
 	}
 
-	i = CardServices(RequestIRQ, link->handle, &link->irq);
+	i = pcmcia_request_irq(link->handle, &link->irq);
 	if (i != CS_SUCCESS) {
 		cs_error(link->handle, RequestIRQ, i);
 		link->irq.AssignedIRQ = 0;
 	}
 
-	i = CardServices(RequestConfiguration, link->handle, &link->conf);
+	i = pcmcia_request_configuration(link->handle, &link->conf);
 	if (i != CS_SUCCESS) {
 		cs_error(link->handle, RequestConfiguration, i);
 		goto failed;
@@ -805,9 +812,9 @@
 
 	link->dev = NULL;
 
-	CardServices(ReleaseConfiguration, link->handle);
-	CardServices(ReleaseIO, link->handle, &link->io);
-	CardServices(ReleaseIRQ, link->handle, &link->irq);
+	pcmcia_release_configuration(link->handle);
+	pcmcia_release_io(link->handle, &link->io);
+	pcmcia_release_irq(link->handle, &link->irq);
 
 	link->state &= ~DEV_CONFIG;
 }
@@ -835,14 +842,14 @@
 		/* Fall through... */
 	case CS_EVENT_RESET_PHYSICAL:
 		if (link->state & DEV_CONFIG)
-			CardServices(ReleaseConfiguration, link->handle);
+			pcmcia_release_configuration(link->handle);
 		break;
 	case CS_EVENT_PM_RESUME:
 		link->state &= ~DEV_SUSPEND;
 		/* Fall through... */
 	case CS_EVENT_CARD_RESET:
 		if (DEV_OK(link))
-			CardServices(RequestConfiguration, link->handle, &link->conf);
+			pcmcia_request_configuration(link->handle, &link->conf);
 		break;
 	}
 
diff -Nru a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
--- a/drivers/bluetooth/dtl1_cs.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/bluetooth/dtl1_cs.c	Tue Feb  3 19:45:17 2004
@@ -304,7 +304,7 @@
 }
 
 
-void dtl1_interrupt(int irq, void *dev_inst, struct pt_regs *regs)
+static irqreturn_t dtl1_interrupt(int irq, void *dev_inst, struct pt_regs *regs)
 {
 	dtl1_info_t *info = dev_inst;
 	unsigned int iobase;
@@ -314,7 +314,7 @@
 
 	if (!info) {
 		printk(KERN_WARNING "dtl1_cs: Call of irq %d for unknown device.\n", irq);
-		return;
+		return IRQ_NONE;
 	}
 
 	iobase = info->link.io.BasePort1;
@@ -363,6 +363,8 @@
 	}
 
 	spin_unlock(&(info->lock));
+
+	return IRQ_HANDLED;
 }
 
 
@@ -601,7 +603,7 @@
 	client_reg.Version = 0x0210;
 	client_reg.event_callback_args.client_data = link;
 
-	ret = CardServices(RegisterClient, &link->handle, &client_reg);
+	ret = pcmcia_register_client(&link->handle, &client_reg);
 	if (ret != CS_SUCCESS) {
 		cs_error(link->handle, RegisterClient, ret);
 		dtl1_detach(link);
@@ -630,7 +632,7 @@
 		dtl1_release(link);
 
 	if (link->handle) {
-		ret = CardServices(DeregisterClient, link->handle);
+		ret = pcmcia_deregister_client(link->handle);
 		if (ret != CS_SUCCESS)
 			cs_error(link->handle, DeregisterClient, ret);
 	}
@@ -641,25 +643,30 @@
 	kfree(info);
 }
 
-
-static int get_tuple(int fn, client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
+static int get_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
 {
 	int i;
 
-	i = CardServices(fn, handle, tuple);
-	if (i != CS_SUCCESS)
-		return CS_NO_MORE_ITEMS;
-
-	i = CardServices(GetTupleData, handle, tuple);
+	i = pcmcia_get_tuple_data(handle, tuple);
 	if (i != CS_SUCCESS)
 		return i;
 
-	return CardServices(ParseTuple, handle, tuple, parse);
+	return pcmcia_parse_tuple(handle, tuple, parse);
 }
 
+static int first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
+{
+	if (pcmcia_get_first_tuple(handle, tuple) != CS_SUCCESS)
+		return CS_NO_MORE_ITEMS;
+	return get_tuple(handle, tuple, parse);
+}
 
-#define first_tuple(a, b, c) get_tuple(GetFirstTuple, a, b, c)
-#define next_tuple(a, b, c) get_tuple(GetNextTuple, a, b, c)
+static int next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
+{
+	if (pcmcia_get_next_tuple(handle, tuple) != CS_SUCCESS)
+		return CS_NO_MORE_ITEMS;
+	return get_tuple(handle, tuple, parse);
+}
 
 void dtl1_config(dev_link_t *link)
 {
@@ -689,7 +696,7 @@
 
 	/* Configure card */
 	link->state |= DEV_CONFIG;
-	i = CardServices(GetConfigurationInfo, handle, &config);
+	i = pcmcia_get_configuration_info(handle, &config);
 	link->conf.Vcc = config.Vcc;
 
 	tuple.TupleData = (cisdata_t *)buf;
@@ -707,7 +714,7 @@
 			link->io.BasePort1 = cf->io.win[0].base;
 			link->io.NumPorts1 = cf->io.win[0].len;	/*yo */
 			link->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK;
-			i = CardServices(RequestIO, link->handle, &link->io);
+			i = pcmcia_request_io(link->handle, &link->io);
 			if (i == CS_SUCCESS)
 				break;
 		}
@@ -719,13 +726,13 @@
 		goto failed;
 	}
 
-	i = CardServices(RequestIRQ, link->handle, &link->irq);
+	i = pcmcia_request_irq(link->handle, &link->irq);
 	if (i != CS_SUCCESS) {
 		cs_error(link->handle, RequestIRQ, i);
 		link->irq.AssignedIRQ = 0;
 	}
 
-	i = CardServices(RequestConfiguration, link->handle, &link->conf);
+	i = pcmcia_request_configuration(link->handle, &link->conf);
 	if (i != CS_SUCCESS) {
 		cs_error(link->handle, RequestConfiguration, i);
 		goto failed;
@@ -757,9 +764,9 @@
 
 	link->dev = NULL;
 
-	CardServices(ReleaseConfiguration, link->handle);
-	CardServices(ReleaseIO, link->handle, &link->io);
-	CardServices(ReleaseIRQ, link->handle, &link->irq);
+	pcmcia_release_configuration(link->handle);
+	pcmcia_release_io(link->handle, &link->io);
+	pcmcia_release_irq(link->handle, &link->irq);
 
 	link->state &= ~DEV_CONFIG;
 }
@@ -787,14 +794,14 @@
 		/* Fall through... */
 	case CS_EVENT_RESET_PHYSICAL:
 		if (link->state & DEV_CONFIG)
-			CardServices(ReleaseConfiguration, link->handle);
+			pcmcia_release_configuration(link->handle);
 		break;
 	case CS_EVENT_PM_RESUME:
 		link->state &= ~DEV_SUSPEND;
 		/* Fall through... */
 	case CS_EVENT_CARD_RESET:
 		if (DEV_OK(link))
-			CardServices(RequestConfiguration, link->handle, &link->conf);
+			pcmcia_request_configuration(link->handle, &link->conf);
 		break;
 	}
 
diff -Nru a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
--- a/drivers/bluetooth/hci_usb.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/bluetooth/hci_usb.c	Tue Feb  3 19:45:42 2004
@@ -62,7 +62,7 @@
 #define BT_DMP( A... )
 #endif
 
-#ifndef CONFIG_BT_USB_ZERO_PACKET
+#ifndef CONFIG_BT_HCIUSB_ZERO_PACKET
 #undef  URB_ZERO_PACKET
 #define URB_ZERO_PACKET 0
 #endif
@@ -70,12 +70,21 @@
 static struct usb_driver hci_usb_driver; 
 
 static struct usb_device_id bluetooth_ids[] = {
+	/* Broadcom BCM2033 without firmware */
+	{ USB_DEVICE(0x0a5c, 0x2033), driver_info: HCI_IGNORE },
+
+	/* Digianswer device */
+	{ USB_DEVICE(0x08fd, 0x0001), driver_info: HCI_DIGIANSWER },
+
 	/* Generic Bluetooth USB device */
 	{ USB_DEVICE_INFO(HCI_DEV_CLASS, HCI_DEV_SUBCLASS, HCI_DEV_PROTOCOL) },
 
 	/* Ericsson with non-standard id */
 	{ USB_DEVICE(0x0bdb, 0x1002) },
 
+	/* ALPS Module with non-standard id */
+	{ USB_DEVICE(0x044e, 0x3002) },
+
 	/* Bluetooth Ultraport Module from IBM */
 	{ USB_DEVICE(0x04bf, 0x030a) },
 
@@ -84,13 +93,6 @@
 
 MODULE_DEVICE_TABLE (usb, bluetooth_ids);
 
-static struct usb_device_id ignore_ids[] = {
-	/* Broadcom BCM2033 without firmware */
-	{ USB_DEVICE(0x0a5c, 0x2033) },
-
-	{ }	/* Terminating entry */
-};
-
 struct _urb *_urb_alloc(int isoc, int gfp)
 {
 	struct _urb *_urb = kmalloc(sizeof(struct _urb) +
@@ -134,7 +136,7 @@
 	return _urb_dequeue(__completed_q(husb, type)); 
 }
 
-#ifdef CONFIG_BT_USB_SCO
+#ifdef CONFIG_BT_HCIUSB_SCO
 static void __fill_isoc_desc(struct urb *urb, int len, int mtu)
 {
 	int offset = 0, i;
@@ -232,7 +234,7 @@
 	return err;
 }
 
-#ifdef CONFIG_BT_USB_SCO
+#ifdef CONFIG_BT_HCIUSB_SCO
 static int hci_usb_isoc_rx_submit(struct hci_usb *husb)
 {
 	struct _urb *_urb;
@@ -301,9 +303,10 @@
 		for (i = 0; i < HCI_MAX_BULK_RX; i++)
 			hci_usb_bulk_rx_submit(husb);
 
-#ifdef CONFIG_BT_USB_SCO
+#ifdef CONFIG_BT_HCIUSB_SCO
 		if (husb->isoc_iface)
-			hci_usb_isoc_rx_submit(husb);
+			for (i = 0; i < HCI_MAX_ISOC_RX; i++)
+				hci_usb_isoc_rx_submit(husb);
 #endif
 	} else {
 		clear_bit(HCI_RUNNING, &hdev->flags);
@@ -425,7 +428,7 @@
 	} else
 		dr = (void *) _urb->urb.setup_packet;
 
-	dr->bRequestType = HCI_CTRL_REQ;
+	dr->bRequestType = husb->ctrl_req;
 	dr->bRequest = 0;
 	dr->wIndex   = 0;
 	dr->wValue   = 0;
@@ -466,7 +469,7 @@
 	return __tx_submit(husb, _urb);
 }
 
-#ifdef CONFIG_BT_USB_SCO
+#ifdef CONFIG_BT_HCIUSB_SCO
 static inline int hci_usb_send_isoc(struct hci_usb *husb, struct sk_buff *skb)
 {
 	struct _urb *_urb = __get_completed(husb, skb->pkt_type);
@@ -517,10 +520,10 @@
 				skb_queue_head(q, skb);
 		}
 
-#ifdef CONFIG_BT_USB_SCO
+#ifdef CONFIG_BT_HCIUSB_SCO
 		/* Process SCO queue */
 		q = __transmit_q(husb, HCI_SCODATA_PKT);
-		if (!atomic_read(__pending_tx(husb, HCI_SCODATA_PKT)) &&
+		if (atomic_read(__pending_tx(husb, HCI_SCODATA_PKT)) < HCI_MAX_ISOC_TX &&
 				(skb = skb_dequeue(q))) {
 			if (hci_usb_send_isoc(husb, skb) < 0)
 				skb_queue_head(q, skb);
@@ -576,7 +579,7 @@
 		hdev->stat.acl_tx++;
 		break;
 
-#ifdef CONFIG_BT_USB_SCO
+#ifdef CONFIG_BT_HCIUSB_SCO
 	case HCI_SCODATA_PKT:
 		hdev->stat.sco_tx++;
 		break;
@@ -626,7 +629,7 @@
 				} else
 					return -EILSEQ;
 				break;
-#ifdef CONFIG_BT_USB_SCO
+#ifdef CONFIG_BT_HCIUSB_SCO
 			case HCI_SCODATA_PKT:
 				if (count >= HCI_SCO_HDR_SIZE) {
 					struct hci_sco_hdr *h = data;
@@ -691,7 +694,7 @@
 		goto resubmit;
 
 	if (_urb->type == HCI_SCODATA_PKT) {
-#ifdef CONFIG_BT_USB_SCO
+#ifdef CONFIG_BT_HCIUSB_SCO
 		int i;
 		for (i=0; i < urb->number_of_packets; i++) {
 			BT_DBG("desc %d status %d offset %d len %d", i,
@@ -785,9 +788,11 @@
 
 	iface = udev->actconfig->interface[0];
 
-	/* Check our black list */
-	if (usb_match_id(intf, ignore_ids))
-		return -EIO;
+	if (id->driver_info & HCI_IGNORE)
+		return -ENODEV;
+
+	if (intf->altsetting->desc.bInterfaceNumber > 0)
+		return -ENODEV;
 
 	/* Check number of endpoints */
 	if (intf->altsetting[0].desc.bNumEndpoints < 3)
@@ -826,9 +831,9 @@
 						bulk_out_ep[i] = ep;
 					break;
 
-#ifdef CONFIG_BT_USB_SCO
+#ifdef CONFIG_BT_HCIUSB_SCO
 				case USB_ENDPOINT_XFER_ISOC:
-					if (ep->desc.wMaxPacketSize < size)
+					if (ep->desc.wMaxPacketSize < size || a > 2)
 						break;
 					size = ep->desc.wMaxPacketSize;
 
@@ -852,7 +857,7 @@
 		goto done;
 	}
 
-#ifdef CONFIG_BT_USB_SCO
+#ifdef CONFIG_BT_HCIUSB_SCO
 	if (!isoc_in_ep[1] || !isoc_out_ep[1]) {
 		BT_DBG("Isoc endpoints not found");
 		isoc_iface = NULL;
@@ -871,7 +876,12 @@
 	husb->bulk_in_ep  = bulk_in_ep[0];
 	husb->intr_in_ep  = intr_in_ep[0];
 
-#ifdef CONFIG_BT_USB_SCO
+	if (id->driver_info & HCI_DIGIANSWER)
+		husb->ctrl_req = HCI_DIGI_REQ;
+	else
+		husb->ctrl_req = HCI_CTRL_REQ;
+
+#ifdef CONFIG_BT_HCIUSB_SCO
 	if (isoc_iface) {
 		BT_DBG("isoc ifnum %d alts %d", isoc_ifnum, isoc_alts);
 		if (usb_set_interface(udev, isoc_ifnum, isoc_alts)) {
diff -Nru a/drivers/bluetooth/hci_usb.h b/drivers/bluetooth/hci_usb.h
--- a/drivers/bluetooth/hci_usb.h	Tue Feb  3 19:45:37 2004
+++ b/drivers/bluetooth/hci_usb.h	Tue Feb  3 19:45:37 2004
@@ -35,12 +35,19 @@
 #define HCI_DEV_PROTOCOL     0x01	/* Bluetooth programming protocol */
 
 #define HCI_CTRL_REQ	     0x20
+#define HCI_DIGI_REQ	     0x40
+
+#define HCI_IGNORE           0x01
+#define HCI_DIGIANSWER       0x02
 
 #define HCI_MAX_IFACE_NUM	3 
 
 #define HCI_MAX_BULK_TX     	4
 #define HCI_MAX_BULK_RX     	1
 
+#define HCI_MAX_ISOC_RX		2
+#define HCI_MAX_ISOC_TX		2
+
 #define HCI_MAX_ISOC_FRAMES     10
 
 struct _urb_queue {
@@ -118,6 +125,8 @@
 	struct usb_interface            *isoc_iface;
 	struct usb_host_endpoint	*isoc_out_ep;
 	struct usb_host_endpoint	*isoc_in_ep;
+
+	__u8			ctrl_req;
 
 	struct sk_buff_head	transmit_q[4];
 	struct sk_buff		*reassembly[4]; // Reassembly buffers
diff -Nru a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
--- a/drivers/cdrom/cdrom.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/cdrom/cdrom.c	Tue Feb  3 19:45:17 2004
@@ -228,10 +228,16 @@
    3.12 Oct 18, 2000 - Jens Axboe <axboe@suse.de>
   -- Use quiet bit on packet commands not known to work
 
+   3.20 Dec 17, 2003 - Jens Axboe <axboe@suse.de>
+  -- Various fixes and lots of cleanups not listed :-)
+  -- Locking fixes
+  -- Mt Rainier support
+  -- DVD-RAM write open fixes
+
 -------------------------------------------------------------------------*/
 
-#define REVISION "Revision: 3.12"
-#define VERSION "Id: cdrom.c 3.12 2000/10/18"
+#define REVISION "Revision: 3.20"
+#define VERSION "Id: cdrom.c 3.20 2003/12/17"
 
 /* I use an error-log mask to give fine grain control over the type of
    messages dumped to the system logs.  The available masks include: */
@@ -282,11 +288,25 @@
 static int lockdoor = 1;
 /* will we ever get to use this... sigh. */
 static int check_media_type;
+/* automatically restart mrw format */
+static int mrw_format_restart = 1;
 MODULE_PARM(debug, "i");
 MODULE_PARM(autoclose, "i");
 MODULE_PARM(autoeject, "i");
 MODULE_PARM(lockdoor, "i");
 MODULE_PARM(check_media_type, "i");
+MODULE_PARM(mrw_format_restart, "i");
+
+static spinlock_t cdrom_lock = SPIN_LOCK_UNLOCKED;
+
+static const char *mrw_format_status[] = {
+	"not mrw",
+	"bgformat inactive",
+	"bgformat active",
+	"mrw complete",
+};
+
+static const char *mrw_address_space[] = { "DMA", "GAA" };
 
 #if (ERRLOGMASK!=CD_NOTHING)
 #define cdinfo(type, fmt, args...) \
@@ -325,6 +345,10 @@
 static int cdrom_get_next_writable(struct cdrom_device_info *, long *);
 static void cdrom_count_tracks(struct cdrom_device_info *, tracktype*);
 
+static int cdrom_mrw_exit(struct cdrom_device_info *cdi);
+
+static int cdrom_get_disc_info(struct cdrom_device_info *cdi, disc_information *di);
+
 #ifdef CONFIG_SYSCTL
 static void cdrom_sysctl_register(void);
 #endif /* CONFIG_SYSCTL */ 
@@ -347,13 +371,14 @@
 
 	if (cdo->open == NULL || cdo->release == NULL)
 		return -2;
-	if ( !banner_printed ) {
+	if (!banner_printed) {
 		printk(KERN_INFO "Uniform CD-ROM driver " REVISION "\n");
 		banner_printed = 1;
 #ifdef CONFIG_SYSCTL
 		cdrom_sysctl_register();
 #endif /* CONFIG_SYSCTL */ 
 	}
+
 	ENSURE(drive_status, CDC_DRIVE_STATUS );
 	ENSURE(media_changed, CDC_MEDIA_CHANGED);
 	ENSURE(tray_move, CDC_CLOSE_TRAY | CDC_OPEN_TRAY);
@@ -378,9 +403,14 @@
 	if (check_media_type==1)
 		cdi->options |= (int) CDO_CHECK_TYPE;
 
+	if (CDROM_CAN(CDC_MRW_W))
+		cdi->exit = cdrom_mrw_exit;
+
 	cdinfo(CD_REG_UNREG, "drive \"/dev/%s\" registered\n", cdi->name);
+	spin_lock(&cdrom_lock);
 	cdi->next = topCdromPtr; 	
 	topCdromPtr = cdi;
+	spin_unlock(&cdrom_lock);
 	return 0;
 }
 #undef ENSURE
@@ -391,23 +421,309 @@
 	cdinfo(CD_OPEN, "entering unregister_cdrom\n"); 
 
 	prev = NULL;
+	spin_lock(&cdrom_lock);
 	cdi = topCdromPtr;
 	while (cdi && cdi != unreg) {
 		prev = cdi;
 		cdi = cdi->next;
 	}
 
-	if (cdi == NULL)
+	if (cdi == NULL) {
+		spin_unlock(&cdrom_lock);
 		return -2;
+	}
 	if (prev)
 		prev->next = cdi->next;
 	else
 		topCdromPtr = cdi->next;
+
+	spin_unlock(&cdrom_lock);
+
+	if (cdi->exit)
+		cdi->exit(cdi);
+
 	cdi->ops->n_minors--;
 	cdinfo(CD_REG_UNREG, "drive \"/dev/%s\" unregistered\n", cdi->name);
 	return 0;
 }
 
+int cdrom_get_media_event(struct cdrom_device_info *cdi,
+			  struct media_event_desc *med)
+{
+	struct cdrom_generic_command cgc;
+	unsigned char buffer[8];
+	struct event_header *eh = (struct event_header *) buffer;
+
+	init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
+	cgc.cmd[0] = GPCMD_GET_EVENT_STATUS_NOTIFICATION;
+	cgc.cmd[1] = 1;		/* IMMED */
+	cgc.cmd[4] = 1 << 4;	/* media event */
+	cgc.cmd[8] = sizeof(buffer);
+	cgc.quiet = 1;
+
+	if (cdi->ops->generic_packet(cdi, &cgc))
+		return 1;
+
+	if (be16_to_cpu(eh->data_len) < sizeof(*med))
+		return 1;
+
+	memcpy(med, &buffer[sizeof(*eh)], sizeof(*med));
+	return 0;
+}
+
+/*
+ * the first prototypes used 0x2c as the page code for the mrw mode page,
+ * subsequently this was changed to 0x03. probe the one used by this drive
+ */
+int cdrom_mrw_probe_pc(struct cdrom_device_info *cdi)
+{
+	struct cdrom_generic_command cgc;
+	char buffer[16];
+
+	init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
+
+	cgc.timeout = HZ;
+	cgc.quiet = 1;
+
+	if (!cdrom_mode_sense(cdi, &cgc, MRW_MODE_PC, 0)) {
+		cdi->mrw_mode_page = MRW_MODE_PC;
+		return 0;
+	} else if (!cdrom_mode_sense(cdi, &cgc, MRW_MODE_PC_PRE1, 0)) {
+		cdi->mrw_mode_page = MRW_MODE_PC_PRE1;
+		return 0;
+	}
+
+	return 1;
+}
+
+int cdrom_is_mrw(struct cdrom_device_info *cdi, int *write)
+{
+	struct cdrom_generic_command cgc;
+	struct mrw_feature_desc *mfd;
+	unsigned char buffer[16];
+	int ret;
+
+	init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
+
+	cgc.cmd[0] = GPCMD_GET_CONFIGURATION;
+	cgc.cmd[3] = CDF_MRW;
+	cgc.cmd[8] = sizeof(buffer);
+	cgc.quiet = 1;
+
+	if ((ret = cdi->ops->generic_packet(cdi, &cgc)))
+		return ret;
+
+	mfd = (struct mrw_feature_desc *)&buffer[sizeof(struct feature_header)];
+	*write = mfd->write;
+
+	if ((ret = cdrom_mrw_probe_pc(cdi)))
+		return ret;
+
+	return 0;
+}
+
+static int cdrom_mrw_bgformat(struct cdrom_device_info *cdi, int cont)
+{
+	struct cdrom_generic_command cgc;
+	unsigned char buffer[12];
+	int ret;
+
+	printk(KERN_INFO "cdrom: %sstarting format\n", cont ? "Re" : "");
+
+	/*
+	 * FmtData bit set (bit 4), format type is 1
+	 */
+	init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_WRITE);
+	cgc.cmd[0] = GPCMD_FORMAT_UNIT;
+	cgc.cmd[1] = (1 << 4) | 1;
+
+	cgc.timeout = 5 * 60 * HZ;
+
+	/*
+	 * 4 byte format list header, 8 byte format list descriptor
+	 */
+	buffer[1] = 1 << 1;
+	buffer[3] = 8;
+
+	/*
+	 * nr_blocks field
+	 */
+	buffer[4] = 0xff;
+	buffer[5] = 0xff;
+	buffer[6] = 0xff;
+	buffer[7] = 0xff;
+
+	buffer[8] = 0x24 << 2;
+	buffer[11] = cont;
+
+	ret = cdi->ops->generic_packet(cdi, &cgc);
+	if (ret)
+		printk(KERN_INFO "cdrom: bgformat failed\n");
+
+	return ret;
+}
+
+static int cdrom_mrw_bgformat_susp(struct cdrom_device_info *cdi, int immed)
+{
+	struct cdrom_generic_command cgc;
+
+	init_cdrom_command(&cgc, NULL, 0, CGC_DATA_NONE);
+	cgc.cmd[0] = GPCMD_CLOSE_TRACK;
+
+	/*
+	 * Session = 1, Track = 0
+	 */
+	cgc.cmd[1] = !!immed;
+	cgc.cmd[2] = 1 << 1;
+
+	cgc.timeout = 5 * 60 * HZ;
+
+	return cdi->ops->generic_packet(cdi, &cgc);
+}
+
+static int cdrom_flush_cache(struct cdrom_device_info *cdi)
+{
+	struct cdrom_generic_command cgc;
+
+	init_cdrom_command(&cgc, NULL, 0, CGC_DATA_NONE);
+	cgc.cmd[0] = GPCMD_FLUSH_CACHE;
+
+	cgc.timeout = 5 * 60 * HZ;
+
+	return cdi->ops->generic_packet(cdi, &cgc);
+}
+
+static int cdrom_mrw_exit(struct cdrom_device_info *cdi)
+{
+	disc_information di;
+	int ret = 0;
+
+	if (cdrom_get_disc_info(cdi, &di))
+		return 1;
+
+	if (di.mrw_status == CDM_MRW_BGFORMAT_ACTIVE) {
+		printk(KERN_INFO "cdrom: issuing MRW back ground format suspend\n");
+		ret = cdrom_mrw_bgformat_susp(cdi, 0);
+	}
+
+	if (!ret)
+		ret = cdrom_flush_cache(cdi);
+
+	return ret;
+}
+
+static int cdrom_mrw_set_lba_space(struct cdrom_device_info *cdi, int space)
+{
+	struct cdrom_generic_command cgc;
+	struct mode_page_header *mph;
+	char buffer[16];
+	int ret, offset, size;
+
+	init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
+
+	cgc.buffer = buffer;
+	cgc.buflen = sizeof(buffer);
+
+	if ((ret = cdrom_mode_sense(cdi, &cgc, cdi->mrw_mode_page, 0)))
+		return ret;
+
+	mph = (struct mode_page_header *) buffer;
+	offset = be16_to_cpu(mph->desc_length);
+	size = be16_to_cpu(mph->mode_data_length) + 2;
+
+	buffer[offset + 3] = space;
+	cgc.buflen = size;
+
+	if ((ret = cdrom_mode_select(cdi, &cgc)))
+		return ret;
+
+	printk(KERN_INFO "cdrom: %s: mrw address space %s selected\n", cdi->name, mrw_address_space[space]);
+	return 0;
+}
+
+static int cdrom_media_erasable(struct cdrom_device_info *cdi)
+{
+	disc_information di;
+
+	if (cdrom_get_disc_info(cdi, &di))
+		return 0;
+
+	return di.erasable;
+}
+
+/*
+ * FIXME: check RO bit
+ */
+static int cdrom_dvdram_open_write(struct cdrom_device_info *cdi)
+{
+	return !cdrom_media_erasable(cdi);
+}
+
+static int cdrom_mrw_open_write(struct cdrom_device_info *cdi)
+{
+	disc_information di;
+	int ret;
+
+	/*
+	 * always reset to DMA lba space on open
+	 */
+	if (cdrom_mrw_set_lba_space(cdi, MRW_LBA_DMA)) {
+		printk(KERN_ERR "cdrom: failed setting lba address space\n");
+		return 1;
+	}
+
+	if (cdrom_get_disc_info(cdi, &di))
+		return 1;
+
+	if (!di.erasable)
+		return 1;
+
+	/*
+	 * mrw_status
+	 * 0	-	not MRW formatted
+	 * 1	-	MRW bgformat started, but not running or complete
+	 * 2	-	MRW bgformat in progress
+	 * 3	-	MRW formatting complete
+	 */
+	ret = 0;
+	printk(KERN_INFO "cdrom open: mrw_status '%s'\n", mrw_format_status[di.mrw_status]);
+	if (!di.mrw_status)
+		ret = 1;
+	else if (di.mrw_status == CDM_MRW_BGFORMAT_INACTIVE && mrw_format_restart)
+		ret = cdrom_mrw_bgformat(cdi, 1);
+
+	return ret;
+}
+
+/*
+ * returns 0 for ok to open write, non-0 to disallow
+ */
+static int cdrom_open_write(struct cdrom_device_info *cdi)
+{
+	int ret = 1;
+
+	if (CDROM_CAN(CDC_MRW_W))
+		ret = cdrom_mrw_open_write(cdi);
+	else if (CDROM_CAN(CDC_DVD_RAM))
+		ret = cdrom_dvdram_open_write(cdi);
+	/*
+	 * needs to really check whether media is writeable
+	 */
+	else if (CDROM_CAN(CDC_MO_DRIVE))
+		ret = 0;
+
+	return ret;
+}
+
+static int cdrom_close_write(struct cdrom_device_info *cdi)
+{
+#if 0
+	return cdrom_flush_cache(cdi);
+#else
+	return 0;
+#endif
+}
+
 /* We use the open-option O_NONBLOCK to indicate that the
  * purpose of opening is only for subsequent ioctl() calls; no device
  * integrity checks are performed.
@@ -421,23 +737,34 @@
 	int ret;
 
 	cdinfo(CD_OPEN, "entering cdrom_open\n"); 
+
 	/* if this was a O_NONBLOCK open and we should honor the flags,
 	 * do a quick open without drive/disc integrity checks. */
-	if ((fp->f_flags & O_NONBLOCK) && (cdi->options & CDO_USE_FFLAGS))
+	cdi->use_count++;
+	if ((fp->f_flags & O_NONBLOCK) && (cdi->options & CDO_USE_FFLAGS)) {
 		ret = cdi->ops->open(cdi, 1);
-	else {
-		if ((fp->f_mode & FMODE_WRITE) && !CDROM_CAN(CDC_DVD_RAM))
-			return -EROFS;
-
+	} else {
+		if (fp->f_mode & FMODE_WRITE) {
+			ret = -EROFS;
+			if (!CDROM_CAN(CDC_RAM))
+				goto err;
+			if (cdrom_open_write(cdi))
+				goto err;
+		}
 		ret = open_for_data(cdi);
 	}
 
-	if (!ret) cdi->use_count++;
+	if (ret)
+		goto err;
 
-	cdinfo(CD_OPEN, "Use count for \"/dev/%s\" now %d\n", cdi->name, cdi->use_count);
+	cdinfo(CD_OPEN, "Use count for \"/dev/%s\" now %d\n",
+			cdi->name, cdi->use_count);
 	/* Do this on open.  Don't wait for mount, because they might
 	    not be mounting, but opening with O_NONBLOCK */
 	check_disk_change(ip->i_bdev);
+	return 0;
+err:
+	cdi->use_count--;
 	return ret;
 }
 
@@ -525,7 +852,7 @@
 		cdinfo(CD_OPEN, "open device failed.\n"); 
 		goto clean_up_and_return;
 	}
-	if (CDROM_CAN(CDC_LOCK) && cdi->options & CDO_LOCK) {
+	if (CDROM_CAN(CDC_LOCK) && (cdi->options & CDO_LOCK)) {
 			cdo->lock_door(cdi, 1);
 			cdinfo(CD_OPEN, "door locked.\n");
 	}
@@ -603,7 +930,6 @@
 	return 0;
 }
 
-
 /* Admittedly, the logic below could be performed in a nicer way. */
 int cdrom_release(struct cdrom_device_info *cdi, struct file *fp)
 {
@@ -617,12 +943,19 @@
 	if (cdi->use_count == 0)
 		cdinfo(CD_CLOSE, "Use count for \"/dev/%s\" now zero\n", cdi->name);
 	if (cdi->use_count == 0 &&
-	    cdo->capability & CDC_LOCK && !keeplocked) {
+	    (cdo->capability & CDC_LOCK) && !keeplocked) {
 		cdinfo(CD_CLOSE, "Unlocking door!\n");
 		cdo->lock_door(cdi, 0);
 	}
 	opened_for_data = !(cdi->options & CDO_USE_FFLAGS) ||
 		!(fp && fp->f_flags & O_NONBLOCK);
+
+	/*
+	 * flush cache on last write release
+	 */
+	if (CDROM_CAN(CDC_RAM) && !cdi->use_count && cdi->for_data)
+		cdrom_close_write(cdi);
+
 	cdo->release(cdi);
 	if (cdi->use_count == 0) {      /* last process that closes dev*/
 		if (opened_for_data &&
@@ -2203,7 +2536,6 @@
 	return cdo->generic_packet(cdi, &cgc);
 }
 
-
 /* return the last written block on the CD-R media. this is for the udf
    file system. */
 int cdrom_get_last_written(struct cdrom_device_info *cdi, long *last_written)
@@ -2310,6 +2642,8 @@
 EXPORT_SYMBOL(cdrom_mode_select);
 EXPORT_SYMBOL(cdrom_mode_sense);
 EXPORT_SYMBOL(init_cdrom_command);
+EXPORT_SYMBOL(cdrom_get_media_event);
+EXPORT_SYMBOL(cdrom_is_mrw);
 
 #ifdef CONFIG_SYSCTL
 
@@ -2405,6 +2739,14 @@
 	pos += sprintf(info+pos, "\nCan write DVD-RAM:");
 	for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
 	    pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_DVD_RAM) != 0);
+
+	pos += sprintf(info+pos, "\nCan read MRW:");
+	for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
+	    pos += sprintf(info+pos, "\t\t%d", CDROM_CAN(CDC_MRW) != 0);
+
+	pos += sprintf(info+pos, "\nCan write MRW:");
+	for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
+	    pos += sprintf(info+pos, "\t\t%d", CDROM_CAN(CDC_MRW_W) != 0);
 
 	strcpy(info+pos,"\n\n");
 		
diff -Nru a/drivers/char/Kconfig b/drivers/char/Kconfig
--- a/drivers/char/Kconfig	Tue Feb  3 19:45:16 2004
+++ b/drivers/char/Kconfig	Tue Feb  3 19:45:16 2004
@@ -588,8 +588,6 @@
 	bool "Support for console on line printer"
 	depends on PC9800_OLDLP
 
-source "drivers/i2c/Kconfig"
-
 
 menu "Mice"
 
diff -Nru a/drivers/char/Makefile b/drivers/char/Makefile
--- a/drivers/char/Makefile	Tue Feb  3 19:45:42 2004
+++ b/drivers/char/Makefile	Tue Feb  3 19:45:42 2004
@@ -43,6 +43,7 @@
 obj-$(CONFIG_HVC_CONSOLE)	+= hvc_console.o
 obj-$(CONFIG_RAW_DRIVER)	+= raw.o
 obj-$(CONFIG_SGI_L1_SERIAL)	+= sn_serial.o
+obj-$(CONFIG_VIOCONS) += viocons.o
 
 obj-$(CONFIG_PRINTER) += lp.o
 obj-$(CONFIG_TIPAR) += tipar.o
diff -Nru a/drivers/char/drm/Kconfig b/drivers/char/drm/Kconfig
--- a/drivers/char/drm/Kconfig	Tue Feb  3 19:45:41 2004
+++ b/drivers/char/drm/Kconfig	Tue Feb  3 19:45:41 2004
@@ -64,10 +64,9 @@
 	  module will be called i830.  AGP support is required for this driver
 	  to work.
 
-
 config DRM_MGA
 	tristate "Matrox g200/g400"
-	depends on DRM && AGP
+	depends on DRM && AGP && (!X86_64 || BROKEN) 
 	help
 	  Choose this option if you have a Matrox G200, G400 or G450 graphics
 	  card.  If M is selected, the module will be called mga.  AGP
diff -Nru a/drivers/char/efirtc.c b/drivers/char/efirtc.c
--- a/drivers/char/efirtc.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/char/efirtc.c	Tue Feb  3 19:45:34 2004
@@ -118,6 +118,7 @@
 static void
 convert_from_efi_time(efi_time_t *eft, struct rtc_time *wtime)
 {
+	memset(wtime, 0, sizeof(*wtime));
 	wtime->tm_sec  = eft->second;
 	wtime->tm_min  = eft->minute;
 	wtime->tm_hour = eft->hour;
diff -Nru a/drivers/char/genrtc.c b/drivers/char/genrtc.c
--- a/drivers/char/genrtc.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/char/genrtc.c	Tue Feb  3 19:45:42 2004
@@ -375,68 +375,13 @@
 	return 0;
 }
 
-static int gen_rtc_read_proc(char *page, char **start, off_t off,
-			     int count, int *eof, void *data);
-
-
-/*
- *	The various file operations we support.
- */
-
-static struct file_operations gen_rtc_fops = {
-	.owner		= THIS_MODULE,
-#ifdef CONFIG_GEN_RTC_X
-	.read		= gen_rtc_read,
-	.poll		= gen_rtc_poll,
-#endif
-	.ioctl		= gen_rtc_ioctl,
-	.open		= gen_rtc_open,
-	.release	= gen_rtc_release,
-};
-
-static struct miscdevice rtc_gen_dev =
-{
-	.minor		= RTC_MINOR,
-	.name		= "rtc",
-	.fops		= &gen_rtc_fops,
-};
-
-static int __init rtc_generic_init(void)
-{
-	int retval;
-
-	printk(KERN_INFO "Generic RTC Driver v%s\n", RTC_VERSION);
-
-	retval = misc_register(&rtc_gen_dev);
-	if(retval < 0)
-		return retval;
 
 #ifdef CONFIG_PROC_FS
-	if((create_proc_read_entry ("driver/rtc", 0, 0, gen_rtc_read_proc, NULL)) == NULL){
-		misc_deregister(&rtc_gen_dev);
-		return -ENOMEM;
-	}
-#endif
-
-	return 0;
-}
-
-static void __exit rtc_generic_exit(void)
-{
-	remove_proc_entry ("driver/rtc", NULL);
-	misc_deregister(&rtc_gen_dev);
-}
-
-module_init(rtc_generic_init);
-module_exit(rtc_generic_exit);
-
 
 /*
  *	Info exported via "/proc/rtc".
  */
 
-#ifdef CONFIG_PROC_FS
-
 static int gen_rtc_proc_output(char *buf)
 {
 	char *p;
@@ -523,6 +468,58 @@
 
 #endif /* CONFIG_PROC_FS */
 
+
+/*
+ *	The various file operations we support.
+ */
+
+static struct file_operations gen_rtc_fops = {
+	.owner		= THIS_MODULE,
+#ifdef CONFIG_GEN_RTC_X
+	.read		= gen_rtc_read,
+	.poll		= gen_rtc_poll,
+#endif
+	.ioctl		= gen_rtc_ioctl,
+	.open		= gen_rtc_open,
+	.release	= gen_rtc_release,
+};
+
+static struct miscdevice rtc_gen_dev =
+{
+	.minor		= RTC_MINOR,
+	.name		= "rtc",
+	.fops		= &gen_rtc_fops,
+};
+
+static int __init rtc_generic_init(void)
+{
+	int retval;
+
+	printk(KERN_INFO "Generic RTC Driver v%s\n", RTC_VERSION);
+
+	retval = misc_register(&rtc_gen_dev);
+	if(retval < 0)
+		return retval;
+
+#ifdef CONFIG_PROC_FS
+	if((create_proc_read_entry ("driver/rtc", 0, 0, gen_rtc_read_proc, NULL)) == NULL){
+		misc_deregister(&rtc_gen_dev);
+		return -ENOMEM;
+	}
+#endif
+
+	return 0;
+}
+
+static void __exit rtc_generic_exit(void)
+{
+	remove_proc_entry ("driver/rtc", NULL);
+	misc_deregister(&rtc_gen_dev);
+}
+
+
+module_init(rtc_generic_init);
+module_exit(rtc_generic_exit);
 
 MODULE_AUTHOR("Richard Zidlicky");
 MODULE_LICENSE("GPL");
diff -Nru a/drivers/char/hp600_keyb.c b/drivers/char/hp600_keyb.c
--- a/drivers/char/hp600_keyb.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/char/hp600_keyb.c	Tue Feb  3 19:45:43 2004
@@ -9,6 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/init.h>
+#include <linux/module.h>
 
 #include <asm/machvec.h>
 #include <asm/delay.h>
diff -Nru a/drivers/char/keyboard.c b/drivers/char/keyboard.c
--- a/drivers/char/keyboard.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/char/keyboard.c	Tue Feb  3 19:45:17 2004
@@ -493,9 +493,13 @@
 
 static void fn_dec_console(struct vc_data *vc, struct pt_regs *regs)
 {
-	int i;
- 
-	for (i = fg_console-1; i != fg_console; i--) {
+	int i, cur = fg_console;
+
+	/* Currently switching?  Queue this next switch relative to that. */
+	if (want_console != -1)
+		cur = want_console;
+
+	for (i = cur-1; i != cur; i--) {
 		if (i == -1)
 			i = MAX_NR_CONSOLES-1;
 		if (vc_cons_allocated(i))
@@ -506,9 +510,13 @@
 
 static void fn_inc_console(struct vc_data *vc, struct pt_regs *regs)
 {
-	int i;
+	int i, cur = fg_console;
+
+	/* Currently switching?  Queue this next switch relative to that. */
+	if (want_console != -1)
+		cur = want_console;
 
-	for (i = fg_console+1; i != fg_console; i++) {
+	for (i = cur+1; i != cur; i++) {
 		if (i == MAX_NR_CONSOLES)
 			i = 0;
 		if (vc_cons_allocated(i))
@@ -933,7 +941,7 @@
 	tasklet_enable(&keyboard_tasklet);
 }
 
-#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) || defined(CONFIG_PARISC)
+#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) || defined(CONFIG_PARISC) || defined(CONFIG_SH_MPC1211)
 
 static unsigned short x86_keycodes[256] =
 	{ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
@@ -941,14 +949,14 @@
 	 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
 	 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
 	 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
-	 80, 81, 82, 83, 84, 93, 86, 87, 88, 94, 95, 85,259,375,260, 90,
-	284,285,309,311,312, 91,327,328,329,331,333,335,336,337,338,339,
-	367,288,302,304,350, 89,334,326,116,377,109,111,126,347,348,349,
-	360,261,262,263,298,376,100,101,321,316,373,286,289,102,351,355,
+	 80, 81, 82, 83, 84,118, 86, 87, 88,115,120,119,121,112,123, 92,
+	284,285,309,298,312, 91,327,328,329,331,333,335,336,337,338,339,
+	367,288,302,304,350, 89,334,326,267,126,268,269,125,347,348,349,
+	360,261,262,263,268,376,100,101,321,316,373,286,289,102,351,355,
 	103,104,105,275,287,279,306,106,274,107,294,364,358,363,362,361,
 	291,108,381,281,290,272,292,305,280, 99,112,257,258,359,113,114,
-	264,117,271,374,379,115,125,273,121,123, 92,265,266,267,268,269,
-	120,119,118,277,278,282,283,295,296,297,299,300,301,293,303,307,
+	264,117,271,374,379,265,266, 93, 94, 95, 85,259,375,260, 90,116,
+	377,109,111,277,278,282,283,295,296,297,299,300,301,293,303,307,
 	308,310,313,314,315,317,318,319,320,357,322,323,324,325,276,330,
 	332,340,365,342,343,344,345,346,356,270,341,368,369,370,371,372 };
 
@@ -978,10 +986,10 @@
 			put_queue(vc, 0x1d | up_flag);
 			put_queue(vc, 0x45 | up_flag);
 			return 0;
-		case KEY_LANG1:
+		case KEY_HANGUEL:
 			if (!up_flag) put_queue(vc, 0xf1);
 			return 0;
-		case KEY_LANG2:
+		case KEY_HANJA:
 			if (!up_flag) put_queue(vc, 0xf2);
 			return 0;
 	} 
diff -Nru a/drivers/char/lp.c b/drivers/char/lp.c
--- a/drivers/char/lp.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/char/lp.c	Tue Feb  3 19:45:16 2004
@@ -145,6 +145,7 @@
 struct lp_struct lp_table[LP_NO];
 
 static unsigned int lp_count = 0;
+static struct class_simple *lp_class;
 
 #ifdef CONFIG_LP_CONSOLE
 static struct parport *console_registered; // initially NULL
@@ -795,6 +796,8 @@
 	if (reset)
 		lp_reset(nr);
 
+	class_simple_device_add(lp_class, MKDEV(LP_MAJOR, nr), NULL,
+				"lp%d", nr);
 	devfs_mk_cdev(MKDEV(LP_MAJOR, nr), S_IFCHR | S_IRUGO | S_IWUGO,
 			"printers/%d", nr);
 
@@ -897,6 +900,7 @@
 	}
 
 	devfs_mk_dir("printers");
+	lp_class = class_simple_create(THIS_MODULE, "printer");
 
 	if (parport_register_driver (&lp_driver)) {
 		printk (KERN_ERR "lp: unable to register with parport\n");
@@ -958,8 +962,10 @@
 			continue;
 		parport_unregister_device(lp_table[offset].dev);
 		devfs_remove("printers/%d", offset);
+		class_simple_device_remove(MKDEV(LP_MAJOR, offset));
 	}
 	devfs_remove("printers");
+	class_simple_destroy(lp_class);
 }
 
 __setup("lp=", lp_setup);
diff -Nru a/drivers/char/mem.c b/drivers/char/mem.c
--- a/drivers/char/mem.c	Tue Feb  3 19:45:27 2004
+++ b/drivers/char/mem.c	Tue Feb  3 19:45:27 2004
@@ -24,6 +24,7 @@
 #include <linux/smp_lock.h>
 #include <linux/devfs_fs_kernel.h>
 #include <linux/ptrace.h>
+#include <linux/device.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -676,6 +677,8 @@
 	{11,"kmsg",    S_IRUGO | S_IWUSR,           &kmsg_fops},
 };
 
+static struct class_simple *mem_class;
+
 static int __init chr_dev_init(void)
 {
 	int i;
@@ -683,7 +686,11 @@
 	if (register_chrdev(MEM_MAJOR,"mem",&memory_fops))
 		printk("unable to get major %d for memory devs\n", MEM_MAJOR);
 
+	mem_class = class_simple_create(THIS_MODULE, "mem");
 	for (i = 0; i < ARRAY_SIZE(devlist); i++) {
+		class_simple_device_add(mem_class,
+					MKDEV(MEM_MAJOR, devlist[i].minor),
+					NULL, devlist[i].name);
 		devfs_mk_cdev(MKDEV(MEM_MAJOR, devlist[i].minor),
 				S_IFCHR | devlist[i].mode, devlist[i].name);
 	}
diff -Nru a/drivers/char/misc.c b/drivers/char/misc.c
--- a/drivers/char/misc.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/char/misc.c	Tue Feb  3 19:45:42 2004
@@ -47,7 +47,7 @@
 #include <linux/devfs_fs_kernel.h>
 #include <linux/stat.h>
 #include <linux/init.h>
-
+#include <linux/device.h>
 #include <linux/tty.h>
 #include <linux/kmod.h>
 
@@ -180,6 +180,13 @@
 	return err;
 }
 
+/* 
+ * TODO for 2.7:
+ *  - add a struct class_device to struct miscdevice and make all usages of
+ *    them dynamic.
+ */
+static struct class_simple *misc_class;
+
 static struct file_operations misc_fops = {
 	.owner		= THIS_MODULE,
 	.open		= misc_open,
@@ -234,6 +241,8 @@
 				"misc/%s", misc->name);
 	}
 
+	class_simple_device_add(misc_class, MKDEV(MISC_MAJOR, misc->minor),
+				misc->dev, misc->name);
 	devfs_mk_cdev(MKDEV(MISC_MAJOR, misc->minor),
 			S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP, misc->devfs_name);
 
@@ -265,6 +274,7 @@
 
 	down(&misc_sem);
 	list_del(&misc->list);
+	class_simple_device_remove(MKDEV(MISC_MAJOR, misc->minor));
 	devfs_remove(misc->devfs_name);
 	if (i < DYNAMIC_MINORS && i>0) {
 		misc_minors[i>>3] &= ~(1 << (misc->minor & 7));
@@ -285,6 +295,9 @@
 	if (ent)
 		ent->proc_fops = &misc_proc_fops;
 #endif
+	misc_class = class_simple_create(THIS_MODULE, "misc");
+	if (IS_ERR(misc_class))
+		return PTR_ERR(misc_class);
 #ifdef CONFIG_MVME16x
 	rtc_MK48T08_init();
 #endif
@@ -319,4 +332,4 @@
 	}
 	return 0;
 }
-module_init(misc_init);
+subsys_initcall(misc_init);
diff -Nru a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
--- a/drivers/char/pcmcia/synclink_cs.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/char/pcmcia/synclink_cs.c	Tue Feb  3 19:45:17 2004
@@ -592,7 +592,7 @@
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
 
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != CS_SUCCESS) {
 	    cs_error(link->handle, RegisterClient, ret);
 	    mgslpc_detach(link);
@@ -607,8 +607,8 @@
 /* Card has been inserted.
  */
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn),args))!=0) goto cs_failed
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static void mgslpc_config(dev_link_t *link)
 {
@@ -631,9 +631,9 @@
     tuple.TupleData = buf;
     tuple.TupleDataMax = sizeof(buf);
     tuple.TupleOffset = 0;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
-    CS_CHECK(GetTupleData, handle, &tuple);
-    CS_CHECK(ParseTuple, handle, &tuple, &parse);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+    CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
     link->conf.ConfigBase = parse.config.base;
     link->conf.Present = parse.config.rmask[0];
     
@@ -641,17 +641,17 @@
     link->state |= DEV_CONFIG;
 
     /* Look up the current Vcc */
-    CS_CHECK(GetConfigurationInfo, handle, &conf);
+    CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf));
     link->conf.Vcc = conf.Vcc;
 
     /* get CIS configuration entry */
 
     tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
 
     cfg = &(parse.cftable_entry);
-    CS_CHECK(GetTupleData, handle, &tuple);
-    CS_CHECK(ParseTuple, handle, &tuple, &parse);
+    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+    CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
 
     if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg;
     if (cfg->index == 0)
@@ -672,7 +672,7 @@
 	    link->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
 	    link->io.BasePort1 = io->win[0].base;
 	    link->io.NumPorts1 = io->win[0].len;
-	    CS_CHECK(RequestIO, link->handle, &link->io);
+	    CS_CHECK(RequestIO, pcmcia_request_io(link->handle, &link->io));
     }
 
     link->conf.Attributes = CONF_ENABLE_IRQ;
@@ -684,9 +684,9 @@
     link->irq.Attributes |= IRQ_HANDLE_PRESENT;
     link->irq.Handler     = mgslpc_isr;
     link->irq.Instance    = info;
-    CS_CHECK(RequestIRQ, link->handle, &link->irq);
+    CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));
 
-    CS_CHECK(RequestConfiguration, link->handle, &link->conf);
+    CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));
 
     info->io_base = link->io.BasePort1;
     info->irq_level = link->irq.AssignedIRQ;
@@ -728,11 +728,11 @@
     link->dev = NULL;
     link->state &= ~DEV_CONFIG;
 
-    CardServices(ReleaseConfiguration, link->handle);
+    pcmcia_release_configuration(link->handle);
     if (link->io.NumPorts1)
-	    CardServices(ReleaseIO, link->handle, &link->io);
+	    pcmcia_release_io(link->handle, &link->io);
     if (link->irq.AssignedIRQ)
-	    CardServices(ReleaseIRQ, link->handle, &link->irq);
+	    pcmcia_release_irq(link->handle, &link->irq);
     if (link->state & DEV_STALE_LINK)
 	    mgslpc_detach(link);
 }
@@ -763,7 +763,7 @@
 
     /* Break the link with Card Services */
     if (link->handle)
-	    CardServices(DeregisterClient, link->handle);
+	    pcmcia_deregister_client(link->handle);
     
     /* Unlink device structure, and free it */
     *linkp = link->next;
@@ -798,14 +798,14 @@
 	    /* Mark the device as stopped, to block IO until later */
 	    info->stop = 1;
 	    if (link->state & DEV_CONFIG)
-		    CardServices(ReleaseConfiguration, link->handle);
+		    pcmcia_release_configuration(link->handle);
 	    break;
     case CS_EVENT_PM_RESUME:
 	    link->state &= ~DEV_SUSPEND;
 	    /* Fall through... */
     case CS_EVENT_CARD_RESET:
 	    if (link->state & DEV_CONFIG)
-		    CardServices(RequestConfiguration, link->handle, &link->conf);
+		    pcmcia_request_configuration(link->handle, &link->conf);
 	    info->stop = 0;
 	    break;
     }
diff -Nru a/drivers/char/raw.c b/drivers/char/raw.c
--- a/drivers/char/raw.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/char/raw.c	Tue Feb  3 19:45:30 2004
@@ -57,28 +57,31 @@
 	 */
 	bdev = raw_devices[minor].binding;
 	err = -ENODEV;
-	if (bdev) {
-		err = blkdev_get(bdev, filp->f_mode, 0, BDEV_RAW);
-		if (err)
-			goto out;
-		igrab(bdev->bd_inode);
-		err = bd_claim(bdev, raw_open);
-		if (err) {
-			blkdev_put(bdev, BDEV_RAW);
-			goto out;
-		}
-		err = set_blocksize(bdev, bdev_hardsect_size(bdev));
-		if (err) {
-			bd_release(bdev);
-			blkdev_put(bdev, BDEV_RAW);
-			goto out;
-		}
-		filp->f_flags |= O_DIRECT;
-		if (++raw_devices[minor].inuse == 1)
-			filp->f_dentry->d_inode->i_mapping =
-				bdev->bd_inode->i_mapping;
-	}
+	if (!bdev)
+		goto out;
+	igrab(bdev->bd_inode);
+	err = blkdev_get(bdev, filp->f_mode, 0, BDEV_RAW);
+	if (err)
+		goto out;
+	err = bd_claim(bdev, raw_open);
+	if (err)
+		goto out1;
+	err = set_blocksize(bdev, bdev_hardsect_size(bdev));
+	if (err)
+		goto out2;
+	filp->f_flags |= O_DIRECT;
+	filp->f_mapping = bdev->bd_inode->i_mapping;
+	if (++raw_devices[minor].inuse == 1)
+		filp->f_dentry->d_inode->i_mapping =
+			bdev->bd_inode->i_mapping;
 	filp->private_data = bdev;
+	up(&raw_mutex);
+	return 0;
+
+out2:
+	bd_release(bdev);
+out1:
+	blkdev_put(bdev, BDEV_RAW);
 out:
 	up(&raw_mutex);
 	return err;
diff -Nru a/drivers/char/rtc.c b/drivers/char/rtc.c
--- a/drivers/char/rtc.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/char/rtc.c	Tue Feb  3 19:45:17 2004
@@ -431,7 +431,7 @@
 		 * means "don't care" or "match all". Only the tm_hour,
 		 * tm_min, and tm_sec values are filled in.
 		 */
-
+		memset(&wtime, 0, sizeof(struct rtc_time));
 		get_rtc_alm_time(&wtime);
 		break; 
 	}
@@ -481,6 +481,7 @@
 	}
 	case RTC_RD_TIME:	/* Read the time/date from RTC	*/
 	{
+		memset(&wtime, 0, sizeof(struct rtc_time));
 		rtc_get_rtc_time(&wtime);
 		break;
 	}
diff -Nru a/drivers/char/sh-sci.c b/drivers/char/sh-sci.c
--- a/drivers/char/sh-sci.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/char/sh-sci.c	Tue Feb  3 19:45:42 2004
@@ -1,4 +1,4 @@
-/* $Id: sh-sci.c,v 1.40 2000/04/15 06:57:29 gniibe Exp $
+/* $Id: sh-sci.c,v 1.15 2003/10/13 07:21:19 lethal Exp $
  *
  *  linux/drivers/char/sh-sci.c
  *
@@ -6,6 +6,7 @@
  *  Copyright (C) 1999, 2000  Niibe Yutaka
  *  Copyright (C) 2000  Sugioka Toshinobu
  *  Modified to support multiple serial ports. Stuart Menefy (May 2000).
+ *  Modified to support SH7760 SCIF. Paul Mundt (Oct 2003).
  *
  * TTY code is based on sx.c (Specialix SX driver) by:
  *
@@ -32,9 +33,13 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/delay.h>
-#ifdef CONFIG_SERIAL_CONSOLE
+#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_SH_KGDB_CONSOLE)
 #include <linux/console.h>
 #endif
+#ifdef CONFIG_CPU_FREQ
+#include <linux/notifier.h>
+#include <linux/cpufreq.h>
+#endif
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -50,17 +55,37 @@
 
 #include "sh-sci.h"
 
+#ifdef CONFIG_SH_KGDB
+#include <asm/kgdb.h>
+
+int kgdb_sci_setup(void);
+static int kgdb_get_char(struct sci_port *port);
+static void kgdb_put_char(struct sci_port *port, char c);
+static void kgdb_handle_error(struct sci_port *port);
+static struct sci_port *kgdb_sci_port;
+
+#ifdef CONFIG_SH_KGDB_CONSOLE
+static struct console kgdbcons;
+void __init kgdb_console_init(void);
+#endif /* CONFIG_SH_KGDB_CONSOLE */
+
+#endif /* CONFIG_SH_KGDB */
+
 #ifdef CONFIG_SERIAL_CONSOLE
 static struct console sercons;
 static struct sci_port* sercons_port=0;
 static int sercons_baud;
-#endif
+#ifdef CONFIG_MAGIC_SYSRQ
+#include <linux/sysrq.h>
+static int break_pressed;
+#endif /* CONFIG_MAGIC_SYSRQ */
+#endif /* CONFIG_SERIAL_CONSOLE */
 
 /* Function prototypes */
 static void sci_init_pins_sci(struct sci_port* port, unsigned int cflag);
 #ifndef SCI_ONLY
 static void sci_init_pins_scif(struct sci_port* port, unsigned int cflag);
-#if defined(__sh3__)
+#if defined(CONFIG_CPU_SH3)
 static void sci_init_pins_irda(struct sci_port* port, unsigned int cflag);
 #endif
 #endif
@@ -71,6 +96,8 @@
 static int  sci_get_CD(void *ptr);
 static void sci_shutdown_port(void *ptr);
 static int sci_set_real_termios(void *ptr);
+static void sci_hungup(void *ptr);
+static void sci_close(void *ptr);
 static int sci_chars_in_buffer(void *ptr);
 static int sci_request_irq(struct sci_port *port);
 static void sci_free_irq(struct sci_port *port);
@@ -94,7 +121,7 @@
 	unsigned long flags;
 	unsigned short status;
 
-	save_and_cli(flags);
+	local_irq_save(flags);
 
 	do
 		status = sci_in(port, SCxSR);
@@ -104,11 +131,11 @@
 	sci_in(port, SCxSR);            /* Dummy read */
 	sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port));
 
-	restore_flags(flags);
+	local_irq_restore(flags);
 }
 #endif
 
-#ifdef CONFIG_SH_STANDARD_BIOS
+#if defined(CONFIG_SH_STANDARD_BIOS) || defined(CONFIG_SH_KGDB)
 
 static void handle_error(struct sci_port *port)
 {				/* Clear error flags */
@@ -121,7 +148,7 @@
 	unsigned short status;
 	int c;
 
-	save_and_cli(flags);
+	local_irq_save(flags);
         do {
 		status = sci_in(port, SCxSR);
 		if (status & SCxSR_ERRORS(port)) {
@@ -132,7 +159,7 @@
 	c = sci_in(port, SCxRDR);
 	sci_in(port, SCxSR);            /* Dummy read */
 	sci_out(port, SCxSR, SCxSR_RDxF_CLEAR(port));
-	restore_flags(flags);
+	local_irq_restore(flags);
 
 	return c;
 }
@@ -150,7 +177,7 @@
 	return hexchars[x & 0xf];
 }
 
-#endif
+#endif /* CONFIG_SH_STANDARD_BIOS || CONFIG_SH_KGDB */
 
 /*
  * Send the packet in buffer.  The host gets one chance to read it.
@@ -162,13 +189,22 @@
 {
 	int i;
 	const unsigned char *p = buffer;
-#ifdef CONFIG_SH_STANDARD_BIOS
+
+#if defined(CONFIG_SH_STANDARD_BIOS) || defined(CONFIG_SH_KGDB)
 	int checksum;
+	int usegdb=0;
 
+#ifdef CONFIG_SH_STANDARD_BIOS
     	/* This call only does a trap the first time it is
 	 * called, and so is safe to do here unconditionally
 	 */
-	if (sh_bios_in_gdb_mode()) {
+	usegdb |= sh_bios_in_gdb_mode();
+#endif
+#ifdef CONFIG_SH_KGDB
+	usegdb |= (kgdb_in_gdb_mode && (port == kgdb_sci_port));
+#endif
+
+	if (usegdb) {
 	    /*  $<packet info>#<checksum>. */
 	    do {
 		unsigned char c;
@@ -191,15 +227,101 @@
 		put_char(port, lowhex(checksum));
 	    } while  (get_char(port) != '+');
 	} else
-#endif
+#endif /* CONFIG_SH_STANDARD_BIOS || CONFIG_SH_KGDB */
 	for (i=0; i<count; i++) {
 		if (*p == 10)
 			put_char(port, '\r');
 		put_char(port, *p++);
 	}
 }
-#endif
+#endif /* CONFIG_SERIAL_CONSOLE */
+
+
+#ifdef CONFIG_SH_KGDB
+
+/* Is the SCI ready, ie is there a char waiting? */
+static int kgdb_is_char_ready(struct sci_port *port)
+{
+        unsigned short status = sci_in(port, SCxSR);
+
+        if (status & (SCxSR_ERRORS(port) | SCxSR_BRK(port)))
+                kgdb_handle_error(port);
+
+        return (status & SCxSR_RDxF(port));
+}
+
+/* Write a char */
+static void kgdb_put_char(struct sci_port *port, char c)
+{
+        unsigned short status;
+
+        do
+                status = sci_in(port, SCxSR);
+        while (!(status & SCxSR_TDxE(port)));
 
+        sci_out(port, SCxTDR, c);
+        sci_in(port, SCxSR);    /* Dummy read */
+        sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port));
+}
+
+/* Get a char if there is one, else ret -1 */
+static int kgdb_get_char(struct sci_port *port)
+{
+        int c;
+
+        if (kgdb_is_char_ready(port) == 0)
+                c = -1;
+        else {
+                c = sci_in(port, SCxRDR);
+                sci_in(port, SCxSR);    /* Dummy read */
+                sci_out(port, SCxSR, SCxSR_RDxF_CLEAR(port));
+        }
+
+        return c;
+}
+
+/* Called from kgdbstub.c to get a character, i.e. is blocking */
+static int kgdb_sci_getchar(void)
+{
+        volatile int c;
+
+        /* Keep trying to read a character, this could be neater */
+        while ((c = kgdb_get_char(kgdb_sci_port)) < 0);
+
+        return c;
+}
+
+/* Called from kgdbstub.c to put a character, just a wrapper */
+static void kgdb_sci_putchar(int c)
+{
+
+        kgdb_put_char(kgdb_sci_port, c);
+}
+
+/* Clear any errors on the SCI */
+static void kgdb_handle_error(struct sci_port *port)
+{
+        sci_out(port, SCxSR, SCxSR_ERROR_CLEAR(port));  /* Clear error flags */
+}
+
+/* Breakpoint if there's a break sent on the serial port */
+static void kgdb_break_interrupt(int irq, void *ptr, struct pt_regs *regs)
+{
+        struct sci_port *port = ptr;
+        unsigned short status = sci_in(port, SCxSR);
+
+        if (status & SCxSR_BRK(port)) {
+
+                /* Break into the debugger if a break is detected */
+                BREAKPOINT();
+
+                /* Clear */
+                sci_out(port, SCxSR, SCxSR_BREAK_CLEAR(port));
+                return;
+        }
+}
+
+#endif /* CONFIG_SH_KGDB */
 
 static struct real_driver sci_real_driver = {
 	sci_disable_tx_interrupts,
@@ -210,6 +332,8 @@
 	sci_shutdown_port,
 	sci_set_real_termios,
 	sci_chars_in_buffer,
+        sci_close,
+        sci_hungup,
 	NULL
 };
 
@@ -220,7 +344,7 @@
 #endif
 
 #if defined(SCIF_ONLY) || defined(SCI_AND_SCIF)
-#if defined(__sh3__)
+#if defined(CONFIG_CPU_SH3)
 /* For SH7707, SH7709, SH7709A, SH7729 */
 static void sci_init_pins_scif(struct sci_port* port, unsigned int cflag)
 {
@@ -232,7 +356,7 @@
 		/* We need to set SCPCR to enable RTS/CTS */
 		data = ctrl_inw(SCPCR);
 		/* Clear out SCP7MD1,0, SCP6MD1,0, SCP4MD1,0*/
-		ctrl_outw(data&0x0fcf, SCPCR);
+		ctrl_outw(data&0x0cff, SCPCR);
 	}
 	if (cflag & CRTSCTS)
 		fcr_val |= SCFCR_MCE;
@@ -243,7 +367,7 @@
 		data = ctrl_inw(SCPCR);
 		/* Clear out SCP7MD1,0, SCP4MD1,0,
 		   Set SCP6MD1,0 = {01} (output)  */
-		ctrl_outw((data&0x0fcf)|0x1000, SCPCR);
+		ctrl_outw((data&0x0cff)|0x1000, SCPCR);
 
 		data = ctrl_inb(SCPDR);
 		/* Set /RTS2 (bit6) = 0 */
@@ -373,7 +497,7 @@
 	if (cflag & PARENB)
 		smr_val |= 0x20;
 	if (cflag & PARODD)
-		smr_val |= 0x10;
+		smr_val |= 0x30;
 	if (cflag & CSTOPB)
 		smr_val |= 0x08;
 	sci_out(port, SCSMR, smr_val);
@@ -393,22 +517,6 @@
 		sci_enable_rx_interrupts(port);
 	}
 
-	/* Tell line discipline whether we will do input cooking */
-	if (I_OTHER(port->gs.tty))
-		clear_bit(TTY_HW_COOK_IN, &port->gs.tty->flags);
-	else
-		set_bit(TTY_HW_COOK_IN, &port->gs.tty->flags);
-
-/* Tell line discipline whether we will do output cooking.
- * If OPOST is set and no other output flags are set then we can do output
- * processing.  Even if only *one* other flag in the O_OTHER group is set
- * we do cooking in software.
- */
-	if (O_OPOST(port->gs.tty) && !O_OTHER(port->gs.tty))
-		set_bit(TTY_HW_COOK_OUT, &port->gs.tty->flags);
-	else
-		clear_bit(TTY_HW_COOK_OUT, &port->gs.tty->flags);
-
 	return 0;
 }
 
@@ -437,7 +545,7 @@
 
 	status = sci_in(port, SCxSR);
 	if (!(status & SCxSR_TDxE(port))) {
-		save_and_cli(flags);
+		local_irq_save(flags);
 		ctrl = sci_in(port, SCSCR);
 		if (port->gs.xmit_cnt == 0) {
 			ctrl &= ~SCI_CTRL_FLAGS_TIE;
@@ -445,7 +553,7 @@
 		} else
 			ctrl |= SCI_CTRL_FLAGS_TIE;
 		sci_out(port, SCSCR, ctrl);
-		restore_flags(flags);
+		local_irq_restore(flags);
 		return;
 	}
 
@@ -459,7 +567,7 @@
 		if (count > txroom)
 			count = txroom;
 
-		/* Don't copy pas the end of the source buffer */
+		/* Don't copy past the end of the source buffer */
 		if (count > SERIAL_XMIT_SIZE - port->gs.xmit_tail)
                 	count = SERIAL_XMIT_SIZE - port->gs.xmit_tail;
 
@@ -486,7 +594,7 @@
 	if (port->gs.xmit_cnt <= port->gs.wakeup_chars)
 		sci_sched_event(port, SCI_EVENT_WRITE_WAKEUP);
 
-	save_and_cli(flags);
+	local_irq_save(flags);
 	ctrl = sci_in(port, SCSCR);
 	if (port->gs.xmit_cnt == 0) {
 		ctrl &= ~SCI_CTRL_FLAGS_TIE;
@@ -499,10 +607,14 @@
 		ctrl |= SCI_CTRL_FLAGS_TIE;
 	}
 	sci_out(port, SCSCR, ctrl);
-	restore_flags(flags);
+	local_irq_restore(flags);
 }
 
-static inline void sci_receive_chars(struct sci_port *port)
+/* On SH3, SCIF may read end-of-break as a space->mark char */
+#define STEPFN(c)  ({int __c=(c); (((__c-1)|(__c)) == -1); })
+
+static inline void sci_receive_chars(struct sci_port *port,
+				     struct pt_regs *regs)
 {
 	int i, count;
 	struct tty_struct *tty;
@@ -525,7 +637,7 @@
 		if (tty->flip.count + count > TTY_FLIPBUF_SIZE)
 			count = TTY_FLIPBUF_SIZE - tty->flip.count;
 
-		/* If for one reason or another, we can't copy more data, we're done! */
+		/* If for any reason we can't copy more data, we're done! */
 		if (count == 0)
 			break;
 
@@ -534,8 +646,42 @@
 			tty->flip.flag_buf_ptr[0] = TTY_NORMAL;
 		} else {
 			for (i=0; i<count; i++) {
-				tty->flip.char_buf_ptr[i] = sci_in(port, SCxRDR);
+				char c = sci_in(port, SCxRDR);
 				status = sci_in(port, SCxSR);
+#if defined(__SH3__)
+				/* Skip "chars" during break */
+				if (port->break_flag) {
+					if ((c == 0) &&
+					    (status & SCxSR_FER(port))) {
+						count--; i--;
+						continue;
+					}
+					/* Nonzero => end-of-break */
+					dprintk("scif: debounce<%02x>\n", c);
+					port->break_flag = 0;
+					if (STEPFN(c)) {
+						count--; i--;
+						continue;
+					}
+				}
+#endif /* __SH3__ */
+#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+				if (break_pressed && (port == sercons_port)) {
+					if (c != 0 &&
+					    time_before(jiffies,
+							break_pressed + HZ*5)) {
+						handle_sysrq(c, regs, NULL);
+						break_pressed = 0;
+						count--; i--;
+						continue;
+					} else if (c != 0) {
+						break_pressed = 0;
+					}
+				}
+#endif /* CONFIG_SERIAL_CONSOLE && CONFIG_MAGIC_SYSRQ */
+
+				/* Store data and status */
+				tty->flip.char_buf_ptr[i] = c;
 				if (status&SCxSR_FER(port)) {
 					tty->flip.flag_buf_ptr[i] = TTY_FRAME;
 					dprintk("sci: frame error\n");
@@ -563,6 +709,10 @@
 	if (copied)
 		/* Tell the rest of the system the news. New characters! */
 		tty_flip_buffer_push(tty);
+	else {
+		sci_in(port, SCxSR); /* dummy read */
+		sci_out(port, SCxSR, SCxSR_RDxF_CLEAR(port));
+	}
 }
 
 static inline int sci_handle_errors(struct sci_port *port)
@@ -615,13 +765,32 @@
 	struct tty_struct *tty = port->gs.tty;
 
 	if (status&SCxSR_BRK(port) && tty->flip.count<TTY_FLIPBUF_SIZE) {
+#if defined(__SH3__)
+		/* Debounce break */
+		if (port->break_flag)
+			goto break_continue;
+		port->break_flag = 1;
+#endif
+#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+		if (port == sercons_port) {
+			if (break_pressed == 0) {
+				break_pressed = jiffies;
+				dprintk("sci: implied sysrq\n");
+				goto break_continue;
+			}
+			/* Double break implies a real break */
+			break_pressed = 0;
+		}
+#endif
 		/* Notify of BREAK */
 		copied++;
 		*tty->flip.flag_buf_ptr++ = TTY_BREAK;
 		dprintk("sci: BREAK detected\n");
 	}
+ break_continue:
 
-#if defined(CONFIG_CPU_SUBTYPE_SH7750) || defined(CONFIG_CPU_SUBTYPE_ST40STB1)
+#if defined(CONFIG_CPU_SUBTYPE_SH7750) || defined(CONFIG_CPU_SUBTYPE_ST40STB1) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7760)
 	/* XXX: Handle SCIF overrun error */
 	if (port->type == PORT_SCIF && (sci_in(port, SCLSR) & SCIF_ORER) != 0) {
 		sci_out(port, SCLSR, 0);
@@ -641,19 +810,22 @@
 	return copied;
 }
 
-static void sci_rx_interrupt(int irq, void *ptr, struct pt_regs *regs)
+static irqreturn_t sci_rx_interrupt(int irq, void *ptr, struct pt_regs *regs)
 {
 	struct sci_port *port = ptr;
 
 	if (port->gs.flags & GS_ACTIVE)
 		if (!(port->gs.flags & SCI_RX_THROTTLE)) {
-			sci_receive_chars(port);
-			return;
+			sci_receive_chars(port, regs);
+			return IRQ_HANDLED;
+
 		}
 	sci_disable_rx_interrupts(port);
+
+	return IRQ_HANDLED;
 }
 
-static void sci_tx_interrupt(int irq, void *ptr, struct pt_regs *regs)
+static irqreturn_t sci_tx_interrupt(int irq, void *ptr, struct pt_regs *regs)
 {
 	struct sci_port *port = ptr;
 
@@ -662,9 +834,11 @@
 	else {
 		sci_disable_tx_interrupts(port);
 	}
+
+	return IRQ_HANDLED;
 }
 
-static void sci_er_interrupt(int irq, void *ptr, struct pt_regs *regs)
+static irqreturn_t sci_er_interrupt(int irq, void *ptr, struct pt_regs *regs)
 {
 	struct sci_port *port = ptr;
 
@@ -683,15 +857,19 @@
 
 	/* Kick the transmission */
 	sci_tx_interrupt(irq, ptr, regs);
+
+	return IRQ_HANDLED;
 }
 
-static void sci_br_interrupt(int irq, void *ptr, struct pt_regs *regs)
+static irqreturn_t sci_br_interrupt(int irq, void *ptr, struct pt_regs *regs)
 {
 	struct sci_port *port = ptr;
 
 	/* Handle BREAKs */
 	sci_handle_breaks(port);
 	sci_out(port, SCxSR, SCxSR_BREAK_CLEAR(port));
+
+	return IRQ_HANDLED;
 }
 
 static void do_softint(void *private_)
@@ -723,11 +901,11 @@
 	unsigned short ctrl;
 
 	/* Clear TIE (Transmit Interrupt Enable) bit in SCSCR */
-	save_and_cli(flags);
+	local_irq_save(flags);
 	ctrl = sci_in(port, SCSCR);
 	ctrl &= ~SCI_CTRL_FLAGS_TIE;
 	sci_out(port, SCSCR, ctrl);
-	restore_flags(flags);
+	local_irq_restore(flags);
 }
 
 static void sci_enable_tx_interrupts(void *ptr)
@@ -746,11 +924,11 @@
 	unsigned short ctrl;
 
 	/* Clear RIE (Receive Interrupt Enable) bit in SCSCR */
-	save_and_cli(flags);
+	local_irq_save(flags);
 	ctrl = sci_in(port, SCSCR);
 	ctrl &= ~SCI_CTRL_FLAGS_RIE;
 	sci_out(port, SCSCR, ctrl);
-	restore_flags(flags);
+	local_irq_restore(flags);
 }
 
 static void sci_enable_rx_interrupts(void * ptr)
@@ -760,11 +938,11 @@
 	unsigned short ctrl;
 
 	/* Set RIE (Receive Interrupt Enable) bit in SCSCR */
-	save_and_cli(flags);
+	local_irq_save(flags);
 	ctrl = sci_in(port, SCSCR);
 	ctrl |= SCI_CTRL_FLAGS_RIE;
 	sci_out(port, SCSCR, ctrl);
-	restore_flags(flags);
+	local_irq_restore(flags);
 }
 
 static int sci_get_CD(void * ptr)
@@ -848,6 +1026,15 @@
 	}
 #endif
 
+#ifdef CONFIG_SH_KGDB_CONSOLE
+        if (kgdbcons.cflag && kgdbcons.index == line) {
+                tty->termios->c_cflag = kgdbcons.cflag;
+                port->gs.baud = kgdb_baud;
+                sercons.cflag = 0;
+                sci_set_real_termios(port);
+        }
+#endif
+
 	sci_enable_rx_interrupts(port);
 
 	return 0;
@@ -859,6 +1046,16 @@
 	return retval;
 }
 
+static void sci_hungup(void *ptr)
+{
+        return;
+}
+
+static void sci_close(void *ptr)
+{
+        return;
+}
+
 static int sci_ioctl(struct tty_struct * tty, struct file * filp, 
                      unsigned int cmd, unsigned long arg)
 {
@@ -870,41 +1067,41 @@
 	switch (cmd) {
 	case TIOCGSOFTCAR:
 		rc = put_user(((tty->termios->c_cflag & CLOCAL) ? 1 : 0),
-		              (unsigned int *) arg);
+		              (unsigned int __user *) arg);
 		break;
 	case TIOCSSOFTCAR:
-		if ((rc = get_user(ival, (unsigned int *) arg)) == 0)
+		if ((rc = get_user(ival, (unsigned int __user *) arg)) == 0)
 			tty->termios->c_cflag =
 				(tty->termios->c_cflag & ~CLOCAL) |
 				(ival ? CLOCAL : 0);
 		break;
 	case TIOCGSERIAL:
-		if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
+		if ((rc = verify_area(VERIFY_WRITE, (void __user *) arg,
 		                      sizeof(struct serial_struct))) == 0)
 			rc = gs_getserial(&port->gs, (struct serial_struct *) arg);
 		break;
 	case TIOCSSERIAL:
-		if ((rc = verify_area(VERIFY_READ, (void *) arg,
+		if ((rc = verify_area(VERIFY_READ, (void __user *) arg,
 		                      sizeof(struct serial_struct))) == 0)
 			rc = gs_setserial(&port->gs,
 					  (struct serial_struct *) arg);
 		break;
 	case TIOCMGET:
 		ival = sci_getsignals(port);
-		rc = put_user(ival, (unsigned int *) arg);
+		rc = put_user(ival, (unsigned int __user *) arg);
 		break;
 	case TIOCMBIS:
-		if ((rc = get_user(ival, (unsigned int *) arg)) == 0)
+		if ((rc = get_user(ival, (unsigned int __user *) arg)) == 0)
 			sci_setsignals(port, ((ival & TIOCM_DTR) ? 1 : -1),
 			                     ((ival & TIOCM_RTS) ? 1 : -1));
 		break;
 	case TIOCMBIC:
-		if ((rc = get_user(ival, (unsigned int *) arg)) == 0)
+		if ((rc = get_user(ival, (unsigned int __user *) arg)) == 0)
 			sci_setsignals(port, ((ival & TIOCM_DTR) ? 0 : -1),
 			                     ((ival & TIOCM_RTS) ? 0 : -1));
 		break;
 	case TIOCMSET:
-		if ((rc = get_user(ival, (unsigned int *)arg)) == 0)
+		if ((rc = get_user(ival, (unsigned int __user *)arg)) == 0)
 			sci_setsignals(port, ((ival & TIOCM_DTR) ? 1 : 0),
 			                     ((ival & TIOCM_RTS) ? 1 : 0));
 		break;
@@ -937,6 +1134,7 @@
 	 * was throttled
 	 */
 	port->gs.flags &= ~SCI_RX_THROTTLE;
+	sci_enable_rx_interrupts(port);
 	return;
 }
 
@@ -972,6 +1170,36 @@
 }
 #endif
 
+#ifdef CONFIG_CPU_FREQ
+/*
+ * Here we define a transistion notifier so that we can update all of our
+ * ports' baud rate when the peripheral clock changes.
+ */
+
+static int sci_notifier(struct notifier_block *self, unsigned long phase, void *p)
+{
+	struct cpufreq_freqs *freqs = p;
+	int i;
+
+	if (phase == CPUFREQ_POSTCHANGE) {
+		for (i = 0; i < SCI_NPORTS; i++) {
+			/*
+			 * This will force a baud rate change in hardware.
+			 */
+			if (sci_ports[i].gs.tty != NULL) {
+				sci_set_baud(&sci_ports[i], sci_ports[i].gs.baud);
+			}
+		}
+		printk("%s: got a postchange notification for cpu %d (old %d, new %d)\n",
+				__FUNCTION__, freqs->cpu, freqs->old, freqs->new);
+	}
+
+	return NOTIFY_OK;
+}
+
+static struct notifier_block sci_nb = { &sci_notifier, NULL, 0 };
+#endif /* CONFIG_CPU_FREQ */
+
 static struct tty_operations sci_ops = {
 	.open	= sci_open,
 	.close = gs_close,
@@ -1040,13 +1268,21 @@
 		port->icount.overrun = port->icount.brk = 0;
 	}
 
+#ifdef CONFIG_CPU_FREQ
+	/* Setup transition notifier */
+	if (cpufreq_register_notifier(&sci_nb, CPUFREQ_TRANSITION_NOTIFIER) < 0) {
+		printk(KERN_ERR "sci: Unable to register CPU frequency notifier\n");
+		return 1;
+	}
+	printk("sci: CPU frequency notifier registered\n");
+#endif
 	return 0;
 }
 
 static int sci_request_irq(struct sci_port *port)
 {
 	int i;
-	void (*handlers[4])(int irq, void *ptr, struct pt_regs *regs) = {
+	irqreturn_t (*handlers[4])(int irq, void *p, struct pt_regs *regs) = {
 		sci_er_interrupt, sci_rx_interrupt, sci_tx_interrupt,
 		sci_br_interrupt,
 	};
@@ -1233,3 +1469,110 @@
 console_initcall(sci_console_init);
 
 #endif /* CONFIG_SERIAL_CONSOLE */
+
+
+#ifdef CONFIG_SH_KGDB
+
+/* Initialise the KGDB serial port */
+int kgdb_sci_setup(void)
+{
+	int cflag = CREAD | HUPCL | CLOCAL;
+
+	if ((kgdb_portnum < 0) || (kgdb_portnum >= SCI_NPORTS))
+		return -1;
+
+        kgdb_sci_port = &sci_ports[kgdb_portnum];
+
+	switch (kgdb_baud) {
+        case 115200:
+                cflag |= B115200;
+                break;
+	case 57600:
+                cflag |= B57600;
+                break;
+        case 38400:
+                cflag |= B38400;
+                break;
+        case 19200:
+                cflag |= B19200;
+                break;
+        case 9600:
+        default:
+                cflag |= B9600;
+                kgdb_baud = 9600;
+                break;
+        }
+
+	switch (kgdb_bits) {
+        case '7':
+                cflag |= CS7;
+                break;
+        default:
+        case '8':
+                cflag |= CS8;
+                break;
+        }
+
+        switch (kgdb_parity) {
+        case 'O':
+                cflag |= PARODD;
+                break;
+        case 'E':
+                cflag |= PARENB;
+                break;
+        }
+
+        kgdb_cflag = cflag;
+        sci_set_termios_cflag(kgdb_sci_port, kgdb_cflag, kgdb_baud);
+
+        /* Set up the interrupt for BREAK from GDB */
+	/* Commented out for now since it may not be possible yet...
+	   request_irq(kgdb_sci_port->irqs[0], kgdb_break_interrupt,
+	               SA_INTERRUPT, "sci", kgdb_sci_port);
+	   sci_enable_rx_interrupts(kgdb_sci_port);
+	*/
+
+	/* Setup complete: initialize function pointers */
+	kgdb_getchar = kgdb_sci_getchar;
+	kgdb_putchar = kgdb_sci_putchar;
+
+        return 0;
+}
+
+#ifdef CONFIG_SH_KGDB_CONSOLE
+
+/* Create a console device */
+static kdev_t kgdb_console_device(struct console *c)
+{
+        return MKDEV(SCI_MAJOR, SCI_MINOR_START + c->index);
+}
+
+/* Set up the KGDB console */
+static int __init kgdb_console_setup(struct console *co, char *options)
+{
+        /* NB we ignore 'options' because we've already done the setup */
+        co->cflag = kgdb_cflag;
+
+        return 0;
+}
+
+/* Register the KGDB console so we get messages (d'oh!) */
+void __init kgdb_console_init(void)
+{
+        register_console(&kgdbcons);
+}
+
+/* The console structure for KGDB */
+static struct console kgdbcons = {
+        name:"ttySC",
+        write:kgdb_console_write,
+        device:kgdb_console_device,
+        wait_key:serial_console_wait_key,
+        setup:kgdb_console_setup,
+        flags:CON_PRINTBUFFER | CON_ENABLED,
+        index:-1,
+};
+
+#endif /* CONFIG_SH_KGDB_CONSOLE */
+
+#endif /* CONFIG_SH_KGDB */
diff -Nru a/drivers/char/sh-sci.h b/drivers/char/sh-sci.h
--- a/drivers/char/sh-sci.h	Tue Feb  3 19:45:33 2004
+++ b/drivers/char/sh-sci.h	Tue Feb  3 19:45:33 2004
@@ -1,4 +1,4 @@
-/* $Id: sh-sci.h,v 1.8 2000/03/08 15:19:39 gniibe Exp $
+/* $Id: sh-sci.h,v 1.6 2003/10/13 01:11:11 lethal Exp $
  *
  *  linux/drivers/char/sh-sci.h
  *
@@ -6,6 +6,7 @@
  *  Copyright (C) 1999, 2000  Niibe Yutaka
  *  Copyright (C) 2000  Greg Banks
  *  Modified to support multiple serial ports. Stuart Menefy (May 2000).
+ *  Modified to support SH7760 SCIF. Paul Mundt (Oct 2003).
  *
  */
 #include <linux/config.h>
@@ -26,6 +27,9 @@
 #define SH3_IRDA_IRQS { 52,  53,  55,  54 }
 #define SH4_SCIF_IRQS { 40,  41,  43,  42 }
 #define STB1_SCIF1_IRQS {23, 24,  26,  25 }
+#define SH7760_SCIF0_IRQS { 52, 53, 55, 54 }
+#define SH7760_SCIF1_IRQS { 72, 73, 75, 74 }
+#define SH7760_SCIF2_IRQS { 76, 77, 79, 78 }
 
 #if defined(CONFIG_CPU_SUBTYPE_SH7708)
 # define SCI_NPORTS 1
@@ -59,6 +63,19 @@
 	0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ : \
 	0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ )
 # define SCI_AND_SCIF
+#elif defined(CONFIG_CPU_SUBTYPE_SH7760)
+# define SCI_NPORTS 3
+# define SCI_INIT { \
+  { {}, PORT_SCIF, 0xfe600000, SH7760_SCIF0_IRQS, sci_init_pins_scif }, \
+  { {}, PORT_SCIF, 0xfe610000, SH7760_SCIF1_IRQS, sci_init_pins_scif }, \
+  { {}, PORT_SCIF, 0xfe620000, SH7760_SCIF2_IRQS, sci_init_pins_scif }  \
+}
+# define SCSPTR0 0xfe600024 /* 16 bit SCIF */
+# define SCSPTR1 0xfe610024 /* 16 bit SCIF */
+# define SCSPTR2 0xfe620024 /* 16 bit SCIF */
+# define SCIF_ORDER 0x0001  /* overrun error bit */
+# define SCSCR_INIT(port)          0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
+# define SCIF_ONLY
 #elif defined(CONFIG_CPU_SUBTYPE_ST40STB1)
 # define SCI_NPORTS 2
 # define SCI_INIT { \
@@ -161,29 +178,6 @@
 /* Generic serial flags */
 #define SCI_RX_THROTTLE		0x0000001
 
-/* generic serial tty */
-#define O_OTHER(tty)    \
-      ((O_OLCUC(tty))  ||\
-      (O_ONLCR(tty))   ||\
-      (O_OCRNL(tty))   ||\
-      (O_ONOCR(tty))   ||\
-      (O_ONLRET(tty))  ||\
-      (O_OFILL(tty))   ||\
-      (O_OFDEL(tty))   ||\
-      (O_NLDLY(tty))   ||\
-      (O_CRDLY(tty))   ||\
-      (O_TABDLY(tty))  ||\
-      (O_BSDLY(tty))   ||\
-      (O_VTDLY(tty))   ||\
-      (O_FFDLY(tty)))
-
-#define I_OTHER(tty)    \
-      ((I_INLCR(tty))  ||\
-      (I_IGNCR(tty))   ||\
-      (I_ICRNL(tty))   ||\
-      (I_IUCLC(tty))   ||\
-      (L_ISIG(tty)))
-
 #define SCI_MAGIC 0xbabeface
 
 /*
@@ -202,6 +196,7 @@
 	struct async_icount icount;
 	struct work_struct tqueue;
 	unsigned long event;
+	int break_flag;
 };
 
 #define SCI_IN(size, offset)					\
@@ -247,7 +242,7 @@
     SCI_OUT(scif_size, scif_offset, value);				\
   }
 
-#ifdef __sh3__
+#ifdef CONFIG_CPU_SH3
 #define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
 		 sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
   CPU_SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh3_scif_offset, sh3_scif_size)
@@ -307,6 +302,16 @@
 #endif
 	return 1;
 }
+#elif defined(CONFIG_CPU_SUBTYPE_SH7760)
+static inline int sci_rxd_in(struct sci_port *port)
+{
+	if (port->base == 0xfe600000)
+		return ctrl_inw(SCSPTR0) & 0x0001 ? 1 : 0; /* SCIF */
+	if (port->base == 0xfe610000)
+		return ctrl_inw(SCSPTR1) & 0x0001 ? 1 : 0; /* SCIF */
+	if (port->base == 0xfe620000)
+		return ctrl_inw(SCSPTR2) & 0x0001 ? 1 : 0; /* SCIF */
+}
 #elif defined(CONFIG_CPU_SUBTYPE_ST40STB1)
 static inline int sci_rxd_in(struct sci_port *port)
 {
@@ -360,4 +365,5 @@
 #define BPS_38400      SCBRR_VALUE(38400)
 #define BPS_57600      SCBRR_VALUE(57600)
 #define BPS_115200     SCBRR_VALUE(115200)
+#define BPS_230400     SCBRR_VALUE(230400)
 
diff -Nru a/drivers/char/sn_serial.c b/drivers/char/sn_serial.c
--- a/drivers/char/sn_serial.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/char/sn_serial.c	Tue Feb  3 19:45:43 2004
@@ -21,8 +21,9 @@
 #include <linux/sysrq.h>
 #include <linux/circ_buf.h>
 #include <linux/serial_reg.h>
+#include <asm/uaccess.h>
 #include <asm/sn/sn_sal.h>
-#include <asm/sn/pci/pciio.h>		/* this is needed for get_console_nasid */
+#include <asm/sn/pci/pciio.h>
 #include <asm/sn/simulator.h>
 #include <asm/sn/sn2/sn_private.h>
 
@@ -771,7 +772,7 @@
 	off_t	begin = 0;
 
 	len += sprintf(page, "sn_serial: nasid:%d irq:%d tx:%d rx:%d\n",
-		       get_console_nasid(), sn_sal_irq,
+		       ia64_sn_get_console_nasid(), sn_sal_irq,
 		       sn_total_tx_count, sn_total_rx_count);
 	*eof = 1;
 
@@ -813,13 +814,18 @@
 {
 	unsigned long flags;
 
-	sn_debug_printf("sn_serial: about to switch to asynchronous console\n");
-
 	/* without early_printk, we may be invoked late enough to race
 	 * with other cpus doing console IO at this point, however
 	 * console interrupts will never be enabled */
 	spin_lock_irqsave(&sn_sal_lock, flags);
 
+	if (sn_sal_is_asynch) {
+		spin_unlock_irqrestore(&sn_sal_lock, flags);
+		return;
+	}
+
+	sn_debug_printf("sn_serial: switch to asynchronous console\n");
+
 	/* early_printk invocation may have done this for us */
 	if (!sn_func) {
 		if (IS_RUNNING_ON_SIMULATOR())
@@ -901,8 +907,7 @@
 	/* when this driver is compiled in, the console initialization
 	 * will have already switched us into asynchronous operation
 	 * before we get here through the module initcalls */
-	if (!sn_sal_is_asynch)
-		sn_sal_switch_to_asynch();
+	sn_sal_switch_to_asynch();
 
 	/* at this point (module_init) we can try to turn on interrupts */
 	if (!IS_RUNNING_ON_SIMULATOR())
diff -Nru a/drivers/char/sysrq.c b/drivers/char/sysrq.c
--- a/drivers/char/sysrq.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/char/sysrq.c	Tue Feb  3 19:45:41 2004
@@ -271,11 +271,11 @@
 };
 
 /* key2index calculation, -1 on invalid index */
-static __inline__ int sysrq_key_table_key2index(int key) {
+static int sysrq_key_table_key2index(int key) {
 	int retval;
-	if ((key >= '0') & (key <= '9')) {
+	if ((key >= '0') && (key <= '9')) {
 		retval = key - '0';
-	} else if ((key >= 'a') & (key <= 'z')) {
+	} else if ((key >= 'a') && (key <= 'z')) {
 		retval = key + 10 - 'a';
 	} else {
 		retval = -1;
diff -Nru a/drivers/char/tty_io.c b/drivers/char/tty_io.c
--- a/drivers/char/tty_io.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/char/tty_io.c	Tue Feb  3 19:45:29 2004
@@ -2069,79 +2069,7 @@
 	tty->driver->write(tty, 0, &ch, 1);
 }
 
-struct tty_dev {
-	struct list_head node;
-	dev_t dev;
-	struct class_device class_dev;
-};
-#define to_tty_dev(d) container_of(d, struct tty_dev, class_dev)
-
-static void release_tty_dev(struct class_device *class_dev)
-{
-	struct tty_dev *tty_dev = to_tty_dev(class_dev);
-	kfree(tty_dev);
-}
-
-static struct class tty_class = {
-	.name		= "tty",
-	.release	= &release_tty_dev,
-};
-
-static LIST_HEAD(tty_dev_list);
-static spinlock_t tty_dev_list_lock = SPIN_LOCK_UNLOCKED;
-
-static ssize_t show_dev(struct class_device *class_dev, char *buf)
-{
-	struct tty_dev *tty_dev = to_tty_dev(class_dev);
-	return print_dev_t(buf, tty_dev->dev);
-}
-static CLASS_DEVICE_ATTR(dev, S_IRUGO, show_dev, NULL);
-
-static void tty_add_class_device(char *name, dev_t dev, struct device *device)
-{
-	struct tty_dev *tty_dev = NULL;
-	int retval;
-
-	tty_dev = kmalloc(sizeof(*tty_dev), GFP_KERNEL);
-	if (!tty_dev)
-		return;
-	memset(tty_dev, 0x00, sizeof(*tty_dev));
-
-	tty_dev->class_dev.dev = device;
-	tty_dev->class_dev.class = &tty_class;
-	snprintf(tty_dev->class_dev.class_id, BUS_ID_SIZE, "%s", name);
-	retval = class_device_register(&tty_dev->class_dev);
-	if (retval)
-		goto error;
-	class_device_create_file (&tty_dev->class_dev, &class_device_attr_dev);
-	tty_dev->dev = dev;
-	spin_lock(&tty_dev_list_lock);
-	list_add(&tty_dev->node, &tty_dev_list);
-	spin_unlock(&tty_dev_list_lock);
-	return;
-error:
-	kfree(tty_dev);
-}
-
-static void tty_remove_class_device(dev_t dev)
-{
-	struct tty_dev *tty_dev = NULL;
-	struct list_head *tmp;
-	int found = 0;
-
-	spin_lock(&tty_dev_list_lock);
-	list_for_each (tmp, &tty_dev_list) {
-		tty_dev = list_entry(tmp, struct tty_dev, node);
-		if (tty_dev->dev == dev) {
-			list_del(&tty_dev->node);
-			found = 1;
-			break;
-		}
-	}
-	spin_unlock(&tty_dev_list_lock);
-	if (found)
-		class_device_unregister(&tty_dev->class_dev);
-}
+static struct class_simple *tty_class;
 
 /**
  * tty_register_device - register a tty device
@@ -2174,7 +2102,7 @@
 	if (driver->type != TTY_DRIVER_TYPE_PTY) {
 		char name[64];
 		tty_line_name(driver, index, name);
-		tty_add_class_device(name, dev, device);
+		class_simple_device_add(tty_class, dev, device, name);
 	}
 }
 
@@ -2189,7 +2117,7 @@
 void tty_unregister_device(struct tty_driver *driver, unsigned index)
 {
 	devfs_remove("%s%d", driver->devfs_name, index + driver->name_base);
-	tty_remove_class_device(MKDEV(driver->major, driver->minor_start) + index);
+	class_simple_device_remove(MKDEV(driver->major, driver->minor_start) + index);
 }
 
 EXPORT_SYMBOL(tty_register_device);
@@ -2406,7 +2334,10 @@
 
 static int __init tty_class_init(void)
 {
-	return class_register(&tty_class);
+	tty_class = class_simple_create(THIS_MODULE, "tty");
+	if (IS_ERR(tty_class))
+		return PTR_ERR(tty_class);
+	return 0;
 }
 
 postcore_initcall(tty_class_init);
@@ -2431,7 +2362,7 @@
 	    register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0)
 		panic("Couldn't register /dev/tty driver\n");
 	devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 0), S_IFCHR|S_IRUGO|S_IWUGO, "tty");
-	tty_add_class_device ("tty", MKDEV(TTYAUX_MAJOR, 0), NULL);
+	class_simple_device_add(tty_class, MKDEV(TTYAUX_MAJOR, 0), NULL, "tty");
 
 	strcpy(console_cdev.kobj.name, "dev.console");
 	cdev_init(&console_cdev, &console_fops);
@@ -2439,7 +2370,7 @@
 	    register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0)
 		panic("Couldn't register /dev/console driver\n");
 	devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 1), S_IFCHR|S_IRUSR|S_IWUSR, "console");
-	tty_add_class_device ("console", MKDEV(TTYAUX_MAJOR, 1), NULL);
+	class_simple_device_add(tty_class, MKDEV(TTYAUX_MAJOR, 1), NULL, "console");
 
 	tty_kobj.kset = tty_cdev.kobj.kset;
 	kobject_register(&tty_kobj);
@@ -2451,7 +2382,7 @@
 	    register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0)
 		panic("Couldn't register /dev/ptmx driver\n");
 	devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 2), S_IFCHR|S_IRUGO|S_IWUGO, "ptmx");
-	tty_add_class_device ("ptmx", MKDEV(TTYAUX_MAJOR, 2), NULL);
+	class_simple_device_add(tty_class, MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx");
 #endif
 	
 #ifdef CONFIG_VT
@@ -2461,7 +2392,7 @@
 	    register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0)
 		panic("Couldn't register /dev/tty0 driver\n");
 	devfs_mk_cdev(MKDEV(TTY_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vc/0");
-	tty_add_class_device ("tty0", MKDEV(TTY_MAJOR, 0), NULL);
+	class_simple_device_add(tty_class, MKDEV(TTY_MAJOR, 0), NULL, "tty0");
 
 	vty_init();
 #endif
diff -Nru a/drivers/char/viocons.c b/drivers/char/viocons.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/char/viocons.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,1424 @@
+/* -*- linux-c -*-
+ *
+ *  drivers/char/viocons.c
+ *
+ *  iSeries Virtual Terminal
+ *
+ *  Authors: Dave Boutcher <boutcher@us.ibm.com>
+ *           Ryan Arnold <ryanarn@us.ibm.com>
+ *           Colin Devilbiss <devilbis@us.ibm.com>
+ *           Stephen Rothwell <sfr@au1.ibm.com>
+ *
+ * (C) Copyright 2000, 2001, 2002, 2003 IBM Corporation
+ *
+ * This program is free software;  you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) anyu later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#include <linux/config.h>
+#include <linux/version.h>
+#include <linux/kernel.h>
+#include <linux/proc_fs.h>
+#include <linux/errno.h>
+#include <linux/vmalloc.h>
+#include <linux/mm.h>
+#include <linux/console.h>
+#include <linux/module.h>
+#include <asm/uaccess.h>
+#include <linux/init.h>
+#include <linux/wait.h>
+#include <linux/spinlock.h>
+#include <asm/ioctls.h>
+#include <linux/kd.h>
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
+#include <linux/sysrq.h>
+
+#include <asm/iSeries/vio.h>
+
+#include <asm/iSeries/HvLpEvent.h>
+#include <asm/iSeries/HvCallEvent.h>
+#include <asm/iSeries/HvLpConfig.h>
+#include <asm/iSeries/HvCall.h>
+
+#ifdef CONFIG_VT
+#error You must turn off CONFIG_VT to use CONFIG_VIOCONS
+#endif
+
+#define VIOTTY_MAGIC (0x0DCB)
+#define VTTY_PORTS 10
+#define VIOTTY_SERIAL_START 65
+
+static spinlock_t consolelock = SPIN_LOCK_UNLOCKED;
+static spinlock_t consoleloglock = SPIN_LOCK_UNLOCKED;
+
+#ifdef CONFIG_MAGIC_SYSRQ
+static int vio_sysrq_pressed;
+extern int sysrq_enabled;
+#endif
+
+/*
+ * The structure of the events that flow between us and OS/400.  You can't
+ * mess with this unless the OS/400 side changes too
+ */
+struct viocharlpevent {
+	struct HvLpEvent event;
+	u32 reserved;
+	u16 version;
+	u16 subtype_result_code;
+	u8 virtual_device;
+	u8 len;
+	u8 data[VIOCHAR_MAX_DATA];
+};
+
+/*
+ * This is a place where we handle the distribution of memory
+ * for copy_from_user() calls.  The buffer_available array is to
+ * help us determine which buffer to use.
+ */
+#define VIOCHAR_NUM_CFU_BUFFERS	7
+static struct viocharlpevent viocons_cfu_buffer[VIOCHAR_NUM_CFU_BUFFERS];
+static atomic_t viocons_cfu_buffer_available[VIOCHAR_NUM_CFU_BUFFERS];
+
+#define VIOCHAR_WINDOW		10
+#define VIOCHAR_HIGHWATERMARK	3
+
+enum viocharsubtype {
+	viocharopen = 0x0001,
+	viocharclose = 0x0002,
+	viochardata = 0x0003,
+	viocharack = 0x0004,
+	viocharconfig = 0x0005
+};
+
+enum viochar_rc {
+	viochar_rc_ebusy = 1
+};
+
+#define VIOCHAR_NUM_BUF		16
+
+/*
+ * Our port information.  We store a pointer to one entry in the
+ * tty_driver_data
+ */
+static struct port_info {
+	int magic;
+	struct tty_struct *tty;
+	HvLpIndex lp;
+	u8 vcons;
+	u64 seq;	/* sequence number of last HV send */
+	u64 ack;	/* last ack from HV */
+/*
+ * When we get writes faster than we can send it to the partition,
+ * buffer the data here. Note that used is a bit map of used buffers.
+ * It had better have enough bits to hold VIOCHAR_NUM_BUF the bitops assume
+ * it is a multiple of unsigned long
+ */
+	unsigned long used;
+	u8 *buffer[VIOCHAR_NUM_BUF];
+	int bufferBytes[VIOCHAR_NUM_BUF];
+	int curbuf;
+	int bufferOverflow;
+	int overflowMessage;
+} port_info[VTTY_PORTS];
+
+#define viochar_is_console(pi)	((pi) == &port_info[0])
+#define viochar_port(pi)	((pi) - &port_info[0])
+
+static void initDataEvent(struct viocharlpevent *viochar, HvLpIndex lp);
+
+static struct tty_driver *viotty_driver;
+static struct tty_driver *viottyS_driver;
+
+void hvlog(char *fmt, ...)
+{
+	int i;
+	unsigned long flags;
+	va_list args;
+	static char buf[256];
+
+	spin_lock_irqsave(&consoleloglock, flags);
+	va_start(args, fmt);
+	i = vsnprintf(buf, sizeof(buf) - 1, fmt, args);
+	va_end(args);
+	buf[i++] = '\r';
+	HvCall_writeLogBuffer(buf, i);
+	spin_unlock_irqrestore(&consoleloglock, flags);
+}
+
+void hvlogOutput(const char *buf, int count)
+{
+	unsigned long flags;
+	int begin;
+	int index;
+	static const char cr = '\r';
+
+	begin = 0;
+	spin_lock_irqsave(&consoleloglock, flags);
+	for (index = 0; index < count; index++) {
+		if (buf[index] == '\n') {
+			/*
+			 * Start right after the last '\n' or at the zeroth
+			 * array position and output the number of characters
+			 * including the newline.
+			 */
+			HvCall_writeLogBuffer(&buf[begin], index - begin + 1);
+			begin = index + 1;
+			HvCall_writeLogBuffer(&cr, 1);
+		}
+	}
+	if ((index - begin) > 0)
+		HvCall_writeLogBuffer(&buf[begin], index - begin);
+	spin_unlock_irqrestore(&consoleloglock, flags);
+}
+
+/*
+ * Make sure we're pointing to a valid port_info structure.  Shamelessly
+ * plagerized from serial.c
+ */
+static inline int viotty_paranoia_check(struct port_info *pi,
+					char *name, const char *routine)
+{
+	static const char *bad_pi_addr = KERN_WARNING_VIO
+		"Warning: bad address for port_info struct (%s) in %s\n";
+	static const char *badmagic = KERN_WARNING_VIO
+		"Warning: bad magic number for port_info struct (%s) in %s\n";
+
+	if ((pi < &port_info[0]) || (viochar_port(pi) > VTTY_PORTS)) {
+		printk(bad_pi_addr, name, routine);
+		return 1;
+	}
+	if (pi->magic != VIOTTY_MAGIC) {
+		printk(badmagic, name, routine);
+		return 1;
+	}
+	return 0;
+}
+
+/*
+ * This function should ONLY be called once from viocons_init2
+ */
+static void viocons_init_cfu_buffer(void)
+{
+	int i;
+
+	for (i = 1; i < VIOCHAR_NUM_CFU_BUFFERS; i++)
+		atomic_set(&viocons_cfu_buffer_available[i], 1);
+}
+
+static struct viocharlpevent *viocons_get_cfu_buffer(void)
+{
+	int i;
+
+	/*
+	 * Grab the first available buffer.  It doesn't matter if we
+	 * are interrupted during this array traversal as long as we
+	 * get an available space.
+	 */
+	for (i = 0; i < VIOCHAR_NUM_CFU_BUFFERS; i++)
+		if (atomic_dec_if_positive(&viocons_cfu_buffer_available[i])
+				== 0 )
+			return &viocons_cfu_buffer[i];
+	hvlog("\n\rviocons: viocons_get_cfu_buffer : no free buffers found");
+	return NULL;
+}
+
+static void viocons_free_cfu_buffer(struct viocharlpevent *buffer)
+{
+	int i;
+
+	i = buffer - &viocons_cfu_buffer[0];
+	if (i >= (sizeof(viocons_cfu_buffer) / sizeof(viocons_cfu_buffer[0]))) {
+		hvlog("\n\rviocons: viocons_free_cfu_buffer : buffer pointer not found in list.");
+		return;
+	}
+	if (atomic_read(&viocons_cfu_buffer_available[i]) != 0) {
+		hvlog("\n\rviocons: WARNING : returning unallocated cfu buffer.");
+		return;
+	}
+	atomic_set(&viocons_cfu_buffer_available[i], 1);
+}
+
+/*
+ * Add data to our pending-send buffers.  
+ *
+ * NOTE: Don't use printk in here because it gets nastily recursive.
+ * hvlog can be used to log to the hypervisor buffer
+ */
+static int buffer_add(struct port_info *pi, const char *buf, size_t len)
+{
+	size_t bleft;
+	size_t curlen;
+	const char *curbuf;
+	int nextbuf;
+
+	curbuf = buf;
+	bleft = len;
+	while (bleft > 0) {
+		/*
+		 * If there is no space left in the current buffer, we have
+		 * filled everything up, so return.  If we filled the previous
+		 * buffer we would already have moved to the next one.
+		 */
+		if (pi->bufferBytes[pi->curbuf] == VIOCHAR_MAX_DATA) {
+			hvlog ("\n\rviocons: No overflow buffer available for memcpy().\n");
+			pi->bufferOverflow++;
+			pi->overflowMessage = 1;
+			break;
+		}
+
+		/*
+		 * Turn on the "used" bit for this buffer.  If it's already on,
+		 * that's fine.
+		 */
+		set_bit(pi->curbuf, &pi->used);
+
+		/*
+		 * See if this buffer has been allocated.  If not, allocate it.
+		 */
+		if (pi->buffer[pi->curbuf] == NULL) {
+			pi->buffer[pi->curbuf] =
+			    kmalloc(VIOCHAR_MAX_DATA, GFP_ATOMIC);
+			if (pi->buffer[pi->curbuf] == NULL) {
+				hvlog("\n\rviocons: kmalloc failed allocating spaces for buffer %d.",
+					pi->curbuf);
+				break;
+			}
+		}
+
+		/* Figure out how much we can copy into this buffer. */
+		if (bleft < (VIOCHAR_MAX_DATA - pi->bufferBytes[pi->curbuf]))
+			curlen = bleft;
+		else
+			curlen = VIOCHAR_MAX_DATA - pi->bufferBytes[pi->curbuf];
+
+		/* Copy the data into the buffer. */
+		memcpy(pi->buffer[pi->curbuf] + pi->bufferBytes[pi->curbuf],
+				curbuf, curlen);
+
+		pi->bufferBytes[pi->curbuf] += curlen;
+		curbuf += curlen;
+		bleft -= curlen;
+
+		/*
+		 * Now see if we've filled this buffer.  If not then
+		 * we'll try to use it again later.  If we've filled it
+		 * up then we'll advance the curbuf to the next in the
+		 * circular queue.
+		 */
+		if (pi->bufferBytes[pi->curbuf] == VIOCHAR_MAX_DATA) {
+			nextbuf = (pi->curbuf + 1) % VIOCHAR_NUM_BUF;
+			/*
+			 * Move to the next buffer if it hasn't been used yet
+			 */
+			if (test_bit(nextbuf, &pi->used) == 0)
+				pi->curbuf = nextbuf;
+		}
+	}
+	return len - bleft;
+}
+
+/*
+ * Send pending data
+ *
+ * NOTE: Don't use printk in here because it gets nastily recursive.
+ * hvlog can be used to log to the hypervisor buffer
+ */
+static void send_buffers(struct port_info *pi)
+{
+	HvLpEvent_Rc hvrc;
+	int nextbuf;
+	struct viocharlpevent *viochar;
+	unsigned long flags;
+
+	spin_lock_irqsave(&consolelock, flags);
+
+	viochar = (struct viocharlpevent *)
+	    vio_get_event_buffer(viomajorsubtype_chario);
+
+	/* Make sure we got a buffer */
+	if (viochar == NULL) {
+		hvlog("\n\rviocons: Can't get viochar buffer in sendBuffers().");
+		spin_unlock_irqrestore(&consolelock, flags);
+		return;
+	}
+
+	if (pi->used == 0) {
+		hvlog("\n\rviocons: in sendbuffers(), but no buffers used.\n");
+		vio_free_event_buffer(viomajorsubtype_chario, viochar);
+		spin_unlock_irqrestore(&consolelock, flags);
+		return;
+	}
+
+	/*
+	 * curbuf points to the buffer we're filling.  We want to
+	 * start sending AFTER this one.  
+	 */
+	nextbuf = (pi->curbuf + 1) % VIOCHAR_NUM_BUF;
+
+	/*
+	 * Loop until we find a buffer with the used bit on
+	 */
+	while (test_bit(nextbuf, &pi->used) == 0)
+		nextbuf = (nextbuf + 1) % VIOCHAR_NUM_BUF;
+
+	initDataEvent(viochar, pi->lp);
+
+	/*
+	 * While we have buffers with data, and our send window
+	 * is open, send them
+	 */
+	while ((test_bit(nextbuf, &pi->used)) &&
+	       ((pi->seq - pi->ack) < VIOCHAR_WINDOW)) {
+		viochar->len = pi->bufferBytes[nextbuf];
+		viochar->event.xCorrelationToken = pi->seq++;
+		viochar->event.xSizeMinus1 =
+			offsetof(struct viocharlpevent, data) + viochar->len;
+
+		memcpy(viochar->data, pi->buffer[nextbuf], viochar->len);
+
+		hvrc = HvCallEvent_signalLpEvent(&viochar->event);
+		if (hvrc) {
+			/*
+			 * MUST unlock the spinlock before doing a printk
+			 */
+			vio_free_event_buffer(viomajorsubtype_chario, viochar);
+			spin_unlock_irqrestore(&consolelock, flags);
+
+			printk(KERN_WARNING_VIO
+			       "console error sending event! return code %d\n",
+			       (int)hvrc);
+			return;
+		}
+
+		/*
+		 * clear the used bit, zero the number of bytes in
+		 * this buffer, and move to the next buffer
+		 */
+		clear_bit(nextbuf, &pi->used);
+		pi->bufferBytes[nextbuf] = 0;
+		nextbuf = (nextbuf + 1) % VIOCHAR_NUM_BUF;
+	}
+
+	/*
+	 * If we have emptied all the buffers, start at 0 again.
+	 * this will re-use any allocated buffers
+	 */
+	if (pi->used == 0) {
+		pi->curbuf = 0;
+
+		if (pi->overflowMessage)
+			pi->overflowMessage = 0;
+
+		if (pi->tty) {
+			if ((pi->tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
+			    (pi->tty->ldisc.write_wakeup))
+				(pi->tty->ldisc.write_wakeup)(pi->tty);
+			wake_up_interruptible(&pi->tty->write_wait);
+		}
+	}
+
+	vio_free_event_buffer(viomajorsubtype_chario, viochar);
+	spin_unlock_irqrestore(&consolelock, flags);
+}
+
+/*
+ * Our internal writer.  Gets called both from the console device and
+ * the tty device.  the tty pointer will be NULL if called from the console.
+ * Return total number of bytes "written".
+ *
+ * NOTE: Don't use printk in here because it gets nastily recursive.  hvlog
+ * can be used to log to the hypervisor buffer
+ */
+static int internal_write(struct port_info *pi, const char *buf,
+			  size_t len, struct viocharlpevent *viochar)
+{
+	HvLpEvent_Rc hvrc;
+	size_t bleft;
+	size_t curlen;
+	const char *curbuf;
+	unsigned long flags;
+	int copy_needed = (viochar == NULL);
+
+	/*
+	 * Write to the hvlog of inbound data are now done prior to
+	 * calling internal_write() since internal_write() is only called in
+	 * the event that an lp event path is active, which isn't the case for
+	 * logging attempts prior to console initialization.
+	 *
+	 * If there is already data queued for this port, send it prior to
+	 * attempting to send any new data.
+	 */
+	if (pi->used)
+		send_buffers(pi);
+
+	spin_lock_irqsave(&consolelock, flags);
+
+	/*
+	 * If the internal_write() was passed a pointer to a
+	 * viocharlpevent then we don't need to allocate a new one
+	 * (this is the case where we are internal_writing user space
+	 * data).  If we aren't writing user space data then we need
+	 * to get an event from viopath.
+	 */
+	if (copy_needed) {
+		/* This one is fetched from the viopath data structure */
+		viochar = (struct viocharlpevent *)
+			vio_get_event_buffer(viomajorsubtype_chario);
+		/* Make sure we got a buffer */
+		if (viochar == NULL) {
+			spin_unlock_irqrestore(&consolelock, flags);
+			hvlog("\n\rviocons: Can't get viochar buffer in internal_write().");
+			return -EAGAIN;
+		}
+		initDataEvent(viochar, pi->lp);
+	}
+
+	curbuf = buf;
+	bleft = len;
+
+	while ((bleft > 0) && (pi->used == 0) &&
+	       ((pi->seq - pi->ack) < VIOCHAR_WINDOW)) {
+		if (bleft > VIOCHAR_MAX_DATA)
+			curlen = VIOCHAR_MAX_DATA;
+		else
+			curlen = bleft;
+
+		viochar->event.xCorrelationToken = pi->seq++;
+
+		if (copy_needed) {
+			memcpy(viochar->data, curbuf, curlen);
+			viochar->len = curlen;
+		}
+
+		viochar->event.xSizeMinus1 =
+		    offsetof(struct viocharlpevent, data) + curlen;
+
+		hvrc = HvCallEvent_signalLpEvent(&viochar->event);
+		if (hvrc) {
+			spin_unlock_irqrestore(&consolelock, flags);
+			if (copy_needed)
+				vio_free_event_buffer(viomajorsubtype_chario, viochar);
+
+			hvlog("viocons: error sending event! %d\n", (int)hvrc);
+			return len - bleft;
+		}
+
+		curbuf += curlen;
+		bleft -= curlen;
+	}
+
+	/* If we didn't send it all, buffer as much of it as we can. */
+	if (bleft > 0)
+		bleft -= buffer_add(pi, curbuf, bleft);
+	/*
+	 * Since we grabbed it from the viopath data structure, return
+	 * it to the data structure.
+	 */
+	if (copy_needed)
+		vio_free_event_buffer(viomajorsubtype_chario, viochar);
+	spin_unlock_irqrestore(&consolelock, flags);
+
+	return len - bleft;
+}
+
+static struct port_info *get_port_data(struct tty_struct *tty)
+{
+	unsigned long flags;
+	struct port_info *pi;
+
+	spin_lock_irqsave(&consolelock, flags);
+	if (tty) {
+		pi = (struct port_info *)tty->driver_data;
+		if (!pi || viotty_paranoia_check(pi, tty->name,
+					     "get_port_data")) {
+			pi = NULL;
+		}
+	} else
+		/*
+		 * If this is the console device, use the lp from
+		 * the first port entry
+		 */
+		pi = &port_info[0];
+	spin_unlock_irqrestore(&consolelock, flags);
+	return pi;
+}
+
+/*
+ * Initialize the common fields in a charLpEvent
+ */
+static void initDataEvent(struct viocharlpevent *viochar, HvLpIndex lp)
+{
+	memset(viochar, 0, sizeof(struct viocharlpevent));
+
+	viochar->event.xFlags.xValid = 1;
+	viochar->event.xFlags.xFunction = HvLpEvent_Function_Int;
+	viochar->event.xFlags.xAckInd = HvLpEvent_AckInd_NoAck;
+	viochar->event.xFlags.xAckType = HvLpEvent_AckType_DeferredAck;
+	viochar->event.xType = HvLpEvent_Type_VirtualIo;
+	viochar->event.xSubtype = viomajorsubtype_chario | viochardata;
+	viochar->event.xSourceLp = HvLpConfig_getLpIndex();
+	viochar->event.xTargetLp = lp;
+	viochar->event.xSizeMinus1 = sizeof(struct viocharlpevent);
+	viochar->event.xSourceInstanceId = viopath_sourceinst(lp);
+	viochar->event.xTargetInstanceId = viopath_targetinst(lp);
+}
+
+/*
+ * early console device write
+ */
+static void viocons_write_early(struct console *co, const char *s, unsigned count)
+{
+	hvlogOutput(s, count);
+}
+
+/*
+ * console device write
+ */
+static void viocons_write(struct console *co, const char *s, unsigned count)
+{
+	int index;
+	int begin;
+	struct port_info *pi;
+
+	static const char cr = '\r';
+
+	/*
+	 * Check port data first because the target LP might be valid but
+	 * simply not active, in which case we want to hvlog the output.
+	 */
+	pi = get_port_data(NULL);
+	if (pi == NULL) {
+		hvlog("\n\rviocons_write: unable to get port data.");
+		return;
+	}
+
+	hvlogOutput(s, count);
+
+	if (!viopath_isactive(pi->lp)) {
+		/*
+		 * This is a VERY noisy trace message in the case where the
+		 * path manager is not active or in the case where this
+		 * function is called prior to viocons initialization.  It is
+		 * being commented out for the sake of a clear trace buffer.
+		 */
+#if 0
+		 hvlog("\n\rviocons_write: path not active to lp %d", pi->lp);
+#endif
+		return;
+	}
+
+	/* 
+	 * Any newline character found will cause a
+	 * carriage return character to be emitted as well. 
+	 */
+	begin = 0;
+	for (index = 0; index < count; index++) {
+		if (s[index] == '\n') {
+			/* 
+			 * Newline found. Print everything up to and 
+			 * including the newline
+			 */
+			internal_write(pi, &s[begin], index - begin + 1,
+					NULL);
+			begin = index + 1;
+			/* Emit a carriage return as well */
+			internal_write(pi, &cr, 1, NULL);
+		}
+	}
+
+	/* If any characters left to write, write them now */
+	if ((index - begin) > 0)
+		internal_write(pi, &s[begin], index - begin, NULL);
+}
+
+/*
+ * Work out the device associate with this console
+ */
+static struct tty_driver *viocons_device(struct console *c, int *index)
+{
+	*index = c->index;
+	return viotty_driver;
+}
+
+/*
+ * console device I/O methods
+ */
+static struct console viocons_early = {
+	.name = "ttyS",
+	.write = viocons_write_early,
+	.flags = CON_PRINTBUFFER,
+	.index = -1,
+};
+
+static struct console viocons = {
+	.name = "ttyS",
+	.write = viocons_write,
+	.device = viocons_device,
+	.flags = CON_PRINTBUFFER,
+	.index = -1,
+};
+
+/*
+ * TTY Open method
+ */
+static int viotty_open(struct tty_struct *tty, struct file *filp)
+{
+	int port;
+	unsigned long flags;
+	struct port_info *pi;
+
+	port = tty->index;
+
+	if (port >= VIOTTY_SERIAL_START)
+		port -= VIOTTY_SERIAL_START;
+
+	if ((port < 0) || (port >= VTTY_PORTS))
+		return -ENODEV;
+
+	spin_lock_irqsave(&consolelock, flags);
+
+	pi = &port_info[port];
+	/* If some other TTY is already connected here, reject the open */
+	if ((pi->tty) && (pi->tty != tty)) {
+		spin_unlock_irqrestore(&consolelock, flags);
+		printk(KERN_WARNING_VIO
+		       "console attempt to open device twice from different ttys\n");
+		return -EBUSY;
+	}
+	tty->driver_data = pi;
+	pi->tty = tty;
+	spin_unlock_irqrestore(&consolelock, flags);
+
+	return 0;
+}
+
+/*
+ * TTY Close method
+ */
+static void viotty_close(struct tty_struct *tty, struct file *filp)
+{
+	unsigned long flags;
+	struct port_info *pi;
+
+	spin_lock_irqsave(&consolelock, flags);
+	pi = (struct port_info *)tty->driver_data;
+
+	if (!pi || viotty_paranoia_check(pi, tty->name, "viotty_close")) {
+		spin_unlock_irqrestore(&consolelock, flags);
+		return;
+	}
+	if (tty->count == 1)
+		pi->tty = NULL;
+	spin_unlock_irqrestore(&consolelock, flags);
+}
+
+/*
+ * TTY Write method
+ */
+static int viotty_write(struct tty_struct *tty, int from_user,
+			const unsigned char *buf, int count)
+{
+	int ret;
+	int total = 0;
+	struct port_info *pi;
+
+	pi = get_port_data(tty);
+	if (pi == NULL) {
+		hvlog("\n\rviotty_write: no port data.");
+		return -ENODEV;
+	}
+
+	if (viochar_is_console(pi))
+		hvlogOutput(buf, count);
+
+	/*
+	 * If the path to this LP is closed, don't bother doing anything more.
+	 * just dump the data on the floor and return count.  For some reason
+	 * some user level programs will attempt to probe available tty's and
+	 * they'll attempt a viotty_write on an invalid port which maps to an
+	 * invalid target lp.  If this is the case then ignore the
+	 * viotty_write call and, since the viopath isn't active to this
+	 * partition, return count.
+	 */
+	if (!viopath_isactive(pi->lp)) {
+		/* Noisy trace.  Commented unless needed. */
+#if 0
+		 hvlog("\n\rviotty_write: viopath NOT active for lp %d.",pi->lp);
+#endif
+		return count;
+	}
+
+	/*
+	 * If the viotty_write is invoked from user space we want to do the
+	 * copy_from_user() into an event buffer from the cfu buffer before
+	 * internal_write() is called because internal_write may need to buffer
+	 * data which will need to grab a spin_lock and we shouldn't
+	 * copy_from_user() while holding a spin_lock.  Should internal_write()
+	 * not need to buffer data then it'll just use the event we created here
+	 * rather than checking one out from vio_get_event_buffer().
+	 */
+	if (from_user) {
+		struct viocharlpevent *viochar;
+		int curlen;
+		const char *curbuf = buf;
+
+		viochar = viocons_get_cfu_buffer();
+		if (viochar == NULL)
+			return -EAGAIN;
+		initDataEvent(viochar, pi->lp);
+		while (count > 0) {
+			if (count > VIOCHAR_MAX_DATA)
+				curlen = VIOCHAR_MAX_DATA;
+			else
+				curlen = count;
+			viochar->len = curlen;
+			ret = copy_from_user(viochar->data, curbuf, curlen);
+			if (ret)
+				break;
+			ret = internal_write(pi, viochar->data,
+					viochar->len, viochar);
+			total += ret;
+			if (ret != curlen)
+				break;
+			count -= curlen;
+			curbuf += curlen;
+		}
+		viocons_free_cfu_buffer(viochar);
+	} else
+		total = internal_write(pi, buf, count, NULL);
+	return total;
+}
+
+/*
+ * TTY put_char method
+ */
+static void viotty_put_char(struct tty_struct *tty, unsigned char ch)
+{
+	struct port_info *pi;
+
+	pi = get_port_data(tty);
+	if (pi == NULL)
+		return;
+
+	/* This will append '\r' as well if the char is '\n' */
+	if (viochar_is_console(pi))
+		hvlogOutput(&ch, 1);
+
+	if (viopath_isactive(pi->lp))
+		internal_write(pi, &ch, 1, NULL);
+}
+
+/*
+ * TTY flush_chars method
+ */
+static void viotty_flush_chars(struct tty_struct *tty)
+{
+}
+
+/*
+ * TTY write_room method
+ */
+static int viotty_write_room(struct tty_struct *tty)
+{
+	int i;
+	int room = 0;
+	struct port_info *pi;
+	unsigned long flags;
+
+	spin_lock_irqsave(&consolelock, flags);
+	pi = (struct port_info *)tty->driver_data;
+	if (!pi || viotty_paranoia_check(pi, tty->name, "viotty_write_room")) {
+		spin_unlock_irqrestore(&consolelock, flags);
+		return 0;
+	}
+
+	/* If no buffers are used, return the max size. */
+	if (pi->used == 0) {
+		spin_unlock_irqrestore(&consolelock, flags);
+		return VIOCHAR_MAX_DATA * VIOCHAR_NUM_BUF;
+	}
+
+	/*
+	 * We retain the spinlock because we want to get an accurate
+	 * count and it can change on us between each operation if we
+	 * don't hold the spinlock.
+	 */
+	for (i = 0; ((i < VIOCHAR_NUM_BUF) && (room < VIOCHAR_MAX_DATA)); i++)
+		room += (VIOCHAR_MAX_DATA - pi->bufferBytes[i]);
+	spin_unlock_irqrestore(&consolelock, flags);
+
+	if (room > VIOCHAR_MAX_DATA)
+		room = VIOCHAR_MAX_DATA;
+	return room;
+}
+
+/*
+ * TTY chars_in_buffer_room method
+ */
+static int viotty_chars_in_buffer(struct tty_struct *tty)
+{
+	return 0;
+}
+
+static void viotty_flush_buffer(struct tty_struct *tty)
+{
+}
+
+static int viotty_ioctl(struct tty_struct *tty, struct file *file,
+			unsigned int cmd, unsigned long arg)
+{
+	switch (cmd) {
+	/*
+	 * the ioctls below read/set the flags usually shown in the leds
+	 * don't use them - they will go away without warning
+	 */
+	case KDGETLED:
+	case KDGKBLED:
+		return put_user(0, (char *)arg);
+
+	case KDSKBLED:
+		return 0;
+	}
+
+	return n_tty_ioctl(tty, file, cmd, arg);
+}
+
+static void viotty_throttle(struct tty_struct *tty)
+{
+}
+
+static void viotty_unthrottle(struct tty_struct *tty)
+{
+}
+
+static void viotty_set_termios(struct tty_struct *tty,
+		struct termios *old_termios)
+{
+}
+
+static void viotty_stop(struct tty_struct *tty)
+{
+}
+
+static void viotty_start(struct tty_struct *tty)
+{
+}
+
+static void viotty_hangup(struct tty_struct *tty)
+{
+}
+
+static void viotty_break(struct tty_struct *tty, int break_state)
+{
+}
+
+static void viotty_send_xchar(struct tty_struct *tty, char ch)
+{
+}
+
+static void viotty_wait_until_sent(struct tty_struct *tty, int timeout)
+{
+}
+
+/*
+ * Handle an open charLpEvent.  Could be either interrupt or ack
+ */
+static void vioHandleOpenEvent(struct HvLpEvent *event)
+{
+	unsigned long flags;
+	struct viocharlpevent *cevent = (struct viocharlpevent *)event;
+	u8 port = cevent->virtual_device;
+	struct port_info *pi;
+	int reject = 0;
+
+	if (event->xFlags.xFunction == HvLpEvent_Function_Ack) {
+		if (port >= VTTY_PORTS)
+			return;
+
+		spin_lock_irqsave(&consolelock, flags);
+		/* Got the lock, don't cause console output */
+
+		pi = &port_info[port];
+		if (event->xRc == HvLpEvent_Rc_Good) {
+			pi->seq = pi->ack = 0;
+			/*
+			 * This line allows connections from the primary
+			 * partition but once one is connected from the
+			 * primary partition nothing short of a reboot
+			 * of linux will allow access from the hosting
+			 * partition again without a required iSeries fix.
+			 */
+			pi->lp = event->xTargetLp;
+		}
+
+		spin_unlock_irqrestore(&consolelock, flags);
+		if (event->xRc != HvLpEvent_Rc_Good)
+			printk(KERN_WARNING_VIO
+			       "viocons: event->xRc != HvLpEvent_Rc_Good, event->xRc == (%d).\n",
+			       event->xRc);
+
+		if (event->xCorrelationToken != 0) {
+			atomic_t *aptr= (atomic_t *)event->xCorrelationToken;
+			atomic_set(aptr, 1);
+		} else
+			printk(KERN_WARNING_VIO
+			       "viocons: wierd...got open ack without atomic\n");
+		return;
+	}
+
+	/* This had better require an ack, otherwise complain */
+	if (event->xFlags.xAckInd != HvLpEvent_AckInd_DoAck) {
+		printk(KERN_WARNING_VIO
+		       "console: viocharopen without ack bit!\n");
+		return;
+	}
+
+	spin_lock_irqsave(&consolelock, flags);
+	/* Got the lock, don't cause console output */
+
+	/* Make sure this is a good virtual tty */
+	if (port >= VTTY_PORTS) {
+		event->xRc = HvLpEvent_Rc_SubtypeError;
+		cevent->subtype_result_code = viorc_openRejected;
+		/*
+		 * Flag state here since we can't printk while holding
+		 * a spinlock.
+		 */
+		reject = 1;
+	} else {
+		pi = &port_info[port];
+		if ((pi->lp != HvLpIndexInvalid) &&
+				(pi->lp != event->xSourceLp)) {
+			/*
+			 * If this is tty is already connected to a different
+			 * partition, fail.
+			 */
+			event->xRc = HvLpEvent_Rc_SubtypeError;
+			cevent->subtype_result_code = viorc_openRejected;
+			reject = 2;
+		} else {
+			pi->lp = event->xSourceLp;
+			event->xRc = HvLpEvent_Rc_Good;
+			cevent->subtype_result_code = viorc_good;
+			pi->seq = pi->ack = 0;
+			reject = 0;
+		}
+	}
+
+	spin_unlock_irqrestore(&consolelock, flags);
+
+	if (reject == 1)
+		printk(KERN_WARNING_VIO
+			"viocons: console open rejected : bad virtual tty.\n");
+	else if (reject == 2)
+		printk(KERN_WARNING_VIO
+			"viocons: console open rejected : console in exclusive use by another partition.\n");
+
+	/* Return the acknowledgement */
+	HvCallEvent_ackLpEvent(event);
+}
+
+/*
+ * Handle a close charLpEvent.  This should ONLY be an Interrupt because the
+ * virtual console should never actually issue a close event to the hypervisor
+ * because the virtual console never goes away.  A close event coming from the
+ * hypervisor simply means that there are no client consoles connected to the
+ * virtual console.
+ *
+ * Regardless of the number of connections masqueraded on the other side of
+ * the hypervisor ONLY ONE close event should be called to accompany the ONE
+ * open event that is called.  The close event should ONLY be called when NO
+ * MORE connections (masqueraded or not) exist on the other side of the
+ * hypervisor.
+ */
+static void vioHandleCloseEvent(struct HvLpEvent *event)
+{
+	unsigned long flags;
+	struct viocharlpevent *cevent = (struct viocharlpevent *)event;
+	u8 port = cevent->virtual_device;
+
+	if (event->xFlags.xFunction == HvLpEvent_Function_Int) {
+		if (port >= VTTY_PORTS) {
+			printk(KERN_WARNING_VIO "viocons: close message from invalid virtual device.\n");
+			return;
+		}
+
+		/* For closes, just mark the console partition invalid */
+		spin_lock_irqsave(&consolelock, flags);
+		/* Got the lock, don't cause console output */
+
+		if (port_info[port].lp == event->xSourceLp)
+			port_info[port].lp = HvLpIndexInvalid;
+
+		spin_unlock_irqrestore(&consolelock, flags);
+		printk(KERN_INFO_VIO
+		       "console close from %d\n", event->xSourceLp);
+	} else
+		printk(KERN_WARNING_VIO
+		       "console got unexpected close acknowlegement\n");
+}
+
+/*
+ * Handle a config charLpEvent.  Could be either interrupt or ack
+ */
+static void vioHandleConfig(struct HvLpEvent *event)
+{
+	struct viocharlpevent *cevent = (struct viocharlpevent *)event;
+
+	HvCall_writeLogBuffer(cevent->data, cevent->len);
+
+	if (cevent->data[0] == 0x01)
+		printk(KERN_INFO_VIO
+		       "console window resized to %d: %d: %d: %d\n",
+		       cevent->data[1], cevent->data[2],
+		       cevent->data[3], cevent->data[4]);
+	else
+		printk(KERN_WARNING_VIO "console unknown config event\n");
+}
+
+/*
+ * Handle a data charLpEvent. 
+ */
+static void vioHandleData(struct HvLpEvent *event)
+{
+	struct tty_struct *tty;
+	unsigned long flags;
+	struct viocharlpevent *cevent = (struct viocharlpevent *)event;
+	struct port_info *pi;
+	int index;
+	u8 port = cevent->virtual_device;
+
+	if (port >= VTTY_PORTS) {
+		printk(KERN_WARNING_VIO
+		       "console data on invalid virtual device %d\n", port);
+		return;
+	}
+
+	/*
+	 * Hold the spinlock so that we don't take an interrupt that
+	 * changes tty between the time we fetch the port_info
+	 * pointer and the time we paranoia check.
+	 */
+	spin_lock_irqsave(&consolelock, flags);
+	pi = &port_info[port];
+
+	/*
+	 * Change 05/01/2003 - Ryan Arnold: If a partition other than
+	 * the current exclusive partition tries to send us data
+	 * events then just drop them on the floor because we don't
+	 * want his stinking data.  He isn't authorized to receive
+	 * data because he wasn't the first one to get the console,
+	 * therefore he shouldn't be allowed to send data either.
+	 * This will work without an iSeries fix.
+	 */
+	if (pi->lp != event->xSourceLp) {
+		spin_unlock_irqrestore(&consolelock, flags);
+		return;
+	}
+
+	tty = pi->tty;
+	if (tty == NULL) {
+		spin_unlock_irqrestore(&consolelock, flags);
+		printk(KERN_WARNING_VIO "no tty for virtual device %d\n", port);
+		return;
+	}
+
+	if (tty->magic != TTY_MAGIC) {
+		spin_unlock_irqrestore(&consolelock, flags);
+		printk(KERN_WARNING_VIO "tty bad magic\n");
+		return;
+	}
+
+	/*
+	 * Just to be paranoid, make sure the tty points back to this port
+	 */
+	pi = (struct port_info *)tty->driver_data;
+	if (!pi || viotty_paranoia_check(pi, tty->name, "vioHandleData")) {
+		spin_unlock_irqrestore(&consolelock, flags);
+		return;
+	}
+	spin_unlock_irqrestore(&consolelock, flags);
+
+	/*
+	 * Change 07/21/2003 - Ryan Arnold: functionality added to
+	 * support sysrq utilizing ^O as the sysrq key.  The sysrq
+	 * functionality will only work if built into the kernel and
+	 * then only if sysrq is enabled through the proc filesystem.
+	 */
+	for (index = 0; index < cevent->len; index++) {
+#ifdef CONFIG_MAGIC_SYSRQ
+		if (sysrq_enabled) {
+			/* 0x0f is the ascii character for ^O */
+			if (cevent->data[index] == '\x0f') {
+				vio_sysrq_pressed = 1;
+				/*
+				 * continue because we don't want to add
+				 * the sysrq key into the data string.
+				 */
+				continue;
+			} else if (vio_sysrq_pressed) {
+				handle_sysrq(cevent->data[index], NULL, tty);
+				vio_sysrq_pressed = 0;
+				/*
+				 * continue because we don't want to add
+				 * the sysrq sequence into the data string.
+				 */
+				continue;
+			}
+		}
+#endif
+		/*
+		 * The sysrq sequence isn't included in this check if
+		 * sysrq is enabled and compiled into the kernel because
+		 * the sequence will never get inserted into the buffer.
+		 * Don't attempt to copy more data into the buffer than we
+		 * have room for because it would fail without indication.
+		 */
+		if ((tty->flip.count + 1) > TTY_FLIPBUF_SIZE) {
+			printk(KERN_WARNING_VIO
+					"console input buffer overflow!\n");
+			break;
+		}
+		tty_insert_flip_char(tty, cevent->data[index], TTY_NORMAL);
+	}
+
+	/* if cevent->len == 0 then no data was added to the buffer and flip.count == 0 */
+	if (tty->flip.count)
+		/* The next call resets flip.count when the data is flushed. */
+		tty_flip_buffer_push(tty);
+}
+
+/*
+ * Handle an ack charLpEvent. 
+ */
+static void vioHandleAck(struct HvLpEvent *event)
+{
+	struct viocharlpevent *cevent = (struct viocharlpevent *)event;
+	unsigned long flags;
+	u8 port = cevent->virtual_device;
+
+	if (port >= VTTY_PORTS) {
+		printk(KERN_WARNING_VIO
+		       "viocons: data on invalid virtual device\n");
+		return;
+	}
+
+	spin_lock_irqsave(&consolelock, flags);
+	port_info[port].ack = event->xCorrelationToken;
+	spin_unlock_irqrestore(&consolelock, flags);
+
+	if (port_info[port].used)
+		send_buffers(&port_info[port]);
+}
+
+/*
+ * Handle charLpEvents and route to the appropriate routine
+ */
+static void vioHandleCharEvent(struct HvLpEvent *event)
+{
+	int charminor;
+
+	if (event == NULL)
+		return;
+
+	charminor = event->xSubtype & VIOMINOR_SUBTYPE_MASK;
+	switch (charminor) {
+	case viocharopen:
+		vioHandleOpenEvent(event);
+		break;
+	case viocharclose:
+		vioHandleCloseEvent(event);
+		break;
+	case viochardata:
+		vioHandleData(event);
+		break;
+	case viocharack:
+		vioHandleAck(event);
+		break;
+	case viocharconfig:
+		vioHandleConfig(event);
+		break;
+	default:
+		if ((event->xFlags.xFunction == HvLpEvent_Function_Int) &&
+		    (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck)) {
+			event->xRc = HvLpEvent_Rc_InvalidSubtype;
+			HvCallEvent_ackLpEvent(event);
+		}
+	}
+}
+
+/*
+ * Send an open event
+ */
+static int send_open(HvLpIndex remoteLp, void *sem)
+{
+	return HvCallEvent_signalLpEventFast(remoteLp,
+			HvLpEvent_Type_VirtualIo,
+			viomajorsubtype_chario | viocharopen,
+			HvLpEvent_AckInd_DoAck, HvLpEvent_AckType_ImmediateAck,
+			viopath_sourceinst(remoteLp),
+			viopath_targetinst(remoteLp),
+			(u64)(unsigned long)sem, VIOVERSION << 16,
+			0, 0, 0, 0);
+}
+
+static struct tty_operations serial_ops = {
+	.open = viotty_open,
+	.close = viotty_close,
+	.write = viotty_write,
+	.put_char = viotty_put_char,
+	.flush_chars = viotty_flush_chars,
+	.write_room = viotty_write_room,
+	.chars_in_buffer = viotty_chars_in_buffer,
+	.flush_buffer = viotty_flush_buffer,
+	.ioctl = viotty_ioctl,
+	.throttle = viotty_throttle,
+	.unthrottle = viotty_unthrottle,
+	.set_termios = viotty_set_termios,
+	.stop = viotty_stop,
+	.start = viotty_start,
+	.hangup = viotty_hangup,
+	.break_ctl = viotty_break,
+	.send_xchar = viotty_send_xchar,
+	.wait_until_sent = viotty_wait_until_sent,
+};
+
+static int __init viocons_init2(void)
+{
+	atomic_t wait_flag;
+	int rc;
+
+	/* Now open to the primary LP */
+	printk(KERN_INFO_VIO "console open path to primary\n");
+	/* +2 for fudge */
+	rc = viopath_open(HvLpConfig_getPrimaryLpIndex(),
+			viomajorsubtype_chario, VIOCHAR_WINDOW + 2);
+	if (rc)
+		printk(KERN_WARNING_VIO "console error opening to primary %d\n",
+				rc);
+
+	if (viopath_hostLp == HvLpIndexInvalid)
+		vio_set_hostlp();
+
+	/*
+	 * And if the primary is not the same as the hosting LP, open to the 
+	 * hosting lp
+	 */
+	if ((viopath_hostLp != HvLpIndexInvalid) &&
+	    (viopath_hostLp != HvLpConfig_getPrimaryLpIndex())) {
+		printk(KERN_INFO_VIO "console open path to hosting (%d)\n",
+				viopath_hostLp);
+		rc = viopath_open(viopath_hostLp, viomajorsubtype_chario,
+				VIOCHAR_WINDOW + 2);	/* +2 for fudge */
+		if (rc)
+			printk(KERN_WARNING_VIO
+				"console error opening to partition %d: %d\n",
+				viopath_hostLp, rc);
+	}
+
+	if (vio_setHandler(viomajorsubtype_chario, vioHandleCharEvent) < 0)
+		printk(KERN_WARNING_VIO
+				"Error seting handler for console events!\n");
+
+	printk(KERN_INFO_VIO "console major number is %d\n", TTY_MAJOR);
+
+	/* First, try to open the console to the hosting lp.
+	 * Wait on a semaphore for the response.
+	 */
+	atomic_set(&wait_flag, 0);
+	if ((viopath_isactive(viopath_hostLp)) &&
+	    (send_open(viopath_hostLp, (void *)&wait_flag) == 0)) {
+		printk(KERN_INFO_VIO
+			"opening console to hosting partition %d\n",
+			viopath_hostLp);
+		while (atomic_read(&wait_flag) == 0)
+			mb();
+		atomic_set(&wait_flag, 0);
+	}
+
+	/*
+	 * If we don't have an active console, try the primary
+	 */
+	if ((!viopath_isactive(port_info[0].lp)) &&
+	    (viopath_isactive(HvLpConfig_getPrimaryLpIndex())) &&
+	    (send_open(HvLpConfig_getPrimaryLpIndex(), (void *)&wait_flag)
+	     == 0)) {
+		printk(KERN_INFO_VIO "opening console to primary partition\n");
+		while (atomic_read(&wait_flag) == 0)
+			mb();
+	}
+
+	/* Initialize the tty_driver structure */
+	viotty_driver = alloc_tty_driver(VTTY_PORTS);
+	viotty_driver->owner = THIS_MODULE;
+	viotty_driver->driver_name = "vioconsole";
+	viotty_driver->devfs_name = "vcs/";
+	viotty_driver->name = "tty";
+	viotty_driver->major = TTY_MAJOR;
+	viotty_driver->minor_start = 1;
+	viotty_driver->type = TTY_DRIVER_TYPE_CONSOLE;
+	viotty_driver->subtype = 1;
+	viotty_driver->init_termios = tty_std_termios;
+	viotty_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS;
+	tty_set_operations(viotty_driver, &serial_ops);
+
+	viottyS_driver = alloc_tty_driver(VTTY_PORTS);
+	viottyS_driver->owner = THIS_MODULE;
+	viottyS_driver->driver_name = "vioconsole";
+	viottyS_driver->devfs_name = "tts/";
+	viottyS_driver->name = "ttyS";
+	viottyS_driver->major = TTY_MAJOR;
+	viottyS_driver->minor_start = VIOTTY_SERIAL_START;
+	viottyS_driver->type = TTY_DRIVER_TYPE_SERIAL;
+	viottyS_driver->subtype = 1;
+	viottyS_driver->init_termios = tty_std_termios;
+	viottyS_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS;
+	tty_set_operations(viottyS_driver, &serial_ops);
+
+	if (tty_register_driver(viotty_driver)) {
+		printk(KERN_WARNING_VIO "Couldn't register console driver\n");
+		put_tty_driver(viotty_driver);
+		viotty_driver = NULL;
+	}
+
+	if (tty_register_driver(viottyS_driver)) {
+		printk(KERN_WARNING_VIO "Couldn't register console S driver\n");
+		put_tty_driver(viottyS_driver);
+		viottyS_driver = NULL;
+	}
+
+	viocons_init_cfu_buffer();
+
+	unregister_console(&viocons_early);
+	register_console(&viocons);
+
+	return 0;
+}
+
+static int __init viocons_init(void)
+{
+	int i;
+
+	printk(KERN_INFO_VIO "registering console\n");
+	for (i = 0; i < VTTY_PORTS; i++) {
+		port_info[i].lp = HvLpIndexInvalid;
+		port_info[i].magic = VIOTTY_MAGIC;
+	}
+	HvCall_setLogBufferFormatAndCodepage(HvCall_LogBuffer_ASCII, 437);
+	register_console(&viocons_early);
+	return 0;
+}
+
+console_initcall(viocons_init);
+module_init(viocons_init2);
diff -Nru a/drivers/char/vt.c b/drivers/char/vt.c
--- a/drivers/char/vt.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/char/vt.c	Tue Feb  3 19:45:41 2004
@@ -530,17 +530,22 @@
 		sw->con_putc(vc_cons[currcons].d, i, y, x);
 }
 
-static void hide_cursor(int currcons)
+static void hide_softcursor(int currcons)
 {
-	if (currcons == sel_cons)
-		clear_selection();
 	if (softcursor_original != -1) {
 		scr_writew(softcursor_original,(u16 *) pos);
 		if (DO_UPDATE)
 			sw->con_putc(vc_cons[currcons].d, softcursor_original, y, x);
 		softcursor_original = -1;
 	}
+}
+
+static void hide_cursor(int currcons)
+{
+	if (currcons == sel_cons)
+		clear_selection();
 	sw->con_cursor(vc_cons[currcons].d,CM_ERASE);
+	hide_softcursor(currcons);
 }
 
 static void set_cursor(int currcons)
diff -Nru a/drivers/char/watchdog/acquirewdt.c b/drivers/char/watchdog/acquirewdt.c
--- a/drivers/char/watchdog/acquirewdt.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/char/watchdog/acquirewdt.c	Tue Feb  3 19:45:30 2004
@@ -100,7 +100,7 @@
 			 * five months ago... */
 			expect_close = 0;
 
-			/* scan to see wether or not we got the magic character */
+			/* scan to see whether or not we got the magic character */
 			for (i = 0; i != count; i++) {
 				char c;
 				if (get_user(c, buf + i))
@@ -263,33 +263,33 @@
 		goto unreg_stop;
 	}
 
-        ret = register_reboot_notifier(&acq_notifier);
-        if (ret != 0) {
-                printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
-                        ret);
-                goto unreg_regions;
-        }
-                                                                                                 
-        ret = misc_register(&acq_miscdev);
-        if (ret != 0) {
-                printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                        WATCHDOG_MINOR, ret);
-                goto unreg_reboot;
-        }
-                                                                                                 
-        printk (KERN_INFO PFX "initialized. (nowayout=%d)\n",
-                nowayout);
-                                                                                                 
+	ret = register_reboot_notifier(&acq_notifier);
+	if (ret != 0) {
+		printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+			ret);
+		goto unreg_regions;
+	}
+
+	ret = misc_register(&acq_miscdev);
+	if (ret != 0) {
+		printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+			WATCHDOG_MINOR, ret);
+		goto unreg_reboot;
+	}
+
+	printk (KERN_INFO PFX "initialized. (nowayout=%d)\n",
+		nowayout);
+
 out:
-        return ret;
+	return ret;
 unreg_reboot:
-        unregister_reboot_notifier(&acq_notifier);
+	unregister_reboot_notifier(&acq_notifier);
 unreg_regions:
-        release_region(wdt_start, 1);
+	release_region(wdt_start, 1);
 unreg_stop:
-        if (wdt_stop != wdt_start)
-                release_region(wdt_stop, 1);
-        goto out;
+	if (wdt_stop != wdt_start)
+		release_region(wdt_stop, 1);
+	goto out;
 }
 
 static void __exit acq_exit(void)
diff -Nru a/drivers/char/watchdog/advantechwdt.c b/drivers/char/watchdog/advantechwdt.c
--- a/drivers/char/watchdog/advantechwdt.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/char/watchdog/advantechwdt.c	Tue Feb  3 19:45:17 2004
@@ -183,7 +183,7 @@
 	}
 
 	default:
-	  return -ENOTTY;
+	  return -ENOIOCTLCMD;
 	}
 	return 0;
 }
diff -Nru a/drivers/char/watchdog/alim1535_wdt.c b/drivers/char/watchdog/alim1535_wdt.c
--- a/drivers/char/watchdog/alim1535_wdt.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/char/watchdog/alim1535_wdt.c	Tue Feb  3 19:45:17 2004
@@ -153,7 +153,7 @@
 			 * five months ago... */
 			ali_expect_release = 0;
 
-			/* scan to see wether or not we got the magic character */
+			/* scan to see whether or not we got the magic character */
 			for (i = 0; i != len; i++) {
 				char c;
 				if(get_user(c, data+i))
@@ -402,7 +402,7 @@
 
 	spin_lock_init(&ali_lock);
 
-	/* Check wether or not the hardware watchdog is there */
+	/* Check whether or not the hardware watchdog is there */
 	if (ali_find_watchdog() != 0) {
 		return -ENODEV;
 	}
diff -Nru a/drivers/char/watchdog/alim7101_wdt.c b/drivers/char/watchdog/alim7101_wdt.c
--- a/drivers/char/watchdog/alim7101_wdt.c	Tue Feb  3 19:45:35 2004
+++ b/drivers/char/watchdog/alim7101_wdt.c	Tue Feb  3 19:45:35 2004
@@ -374,7 +374,7 @@
 err_out_miscdev:
 	misc_deregister(&wdt_miscdev);
 err_out:
-        return rc;
+	return rc;
 }
 
 module_init(alim7101_wdt_init);
diff -Nru a/drivers/char/watchdog/amd7xx_tco.c b/drivers/char/watchdog/amd7xx_tco.c
--- a/drivers/char/watchdog/amd7xx_tco.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/char/watchdog/amd7xx_tco.c	Tue Feb  3 19:45:17 2004
@@ -19,6 +19,7 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
@@ -45,7 +46,7 @@
 #define TCO_TIMEOUT_MASK	0x3f
 #define TCO_STATUS1_REG 0x44
 #define TCO_STATUS2_REG	0x46
-#define NDTO_STS2	(1 << 1)	/* we're interested in the second timeout */ 
+#define NDTO_STS2	(1 << 1)	/* we're interested in the second timeout */
 #define BOOT_STS	(1 << 2)	/* will be set if NDTO_STS2 was set before reboot */
 #define TCO_CTRL1_REG	0x48
 #define TCO_HALT	(1 << 11)
@@ -57,11 +58,20 @@
 static struct pci_dev *dev;
 static struct semaphore open_sem;
 static spinlock_t amdtco_lock;	/* only for device access */
-static int expect_close = 0;
+static char expect_close;
 
-MODULE_PARM(timeout, "i");
+module_param(timeout, int, 0);
 MODULE_PARM_DESC(timeout, "range is 0-38 seconds, default is 38");
 
+#ifdef CONFIG_WATCHDOG_NOWAYOUT
+static int nowayout = 1;
+#else
+static int nowayout = 0;
+#endif
+
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
+
 static inline u8 seconds_to_ticks(int seconds)
 {
 	/* the internal timer is stored as ticks which decrement
@@ -124,7 +134,7 @@
 static inline void amdtco_enable(void)
 {
 	u16 reg;
-	
+
 	spin_lock(&amdtco_lock);
 	reg = inw(pmbase+TCO_CTRL1_REG);
 	reg &= ~TCO_HALT;
@@ -152,13 +162,13 @@
 		timeout = MAX_TIMEOUT;
 
 	amdtco_disable();
-	amdtco_settimeout(timeout);	
+	amdtco_settimeout(timeout);
 	amdtco_global_enable();
 	amdtco_enable();
 	amdtco_ping();
 	printk(KERN_INFO PFX "Watchdog enabled, timeout = %ds of %ds\n",
 		amdtco_gettimeout(), timeout);
-	
+
 	return 0;
 }
 
@@ -170,12 +180,12 @@
 
 	static struct watchdog_info ident = {
 		.options	= WDIOF_SETTIMEOUT | WDIOF_CARDRESET,
-		.identity	= "AMD 766/768"
+		.identity	= "AMD 766/768",
 	};
 
 	switch (cmd) {
 		default:
-			return -ENOTTY;	
+			return -ENOIOCTLCMD;
 
 		case WDIOC_GETSUPPORT:
 			if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof ident))
@@ -184,7 +194,7 @@
 
 		case WDIOC_GETSTATUS:
 			return put_user(amdtco_status(), (int *)arg);
-	
+
 		case WDIOC_KEEPALIVE:
 			amdtco_ping();
 			return 0;
@@ -192,10 +202,10 @@
 		case WDIOC_SETTIMEOUT:
 			if (get_user(new_timeout, (int *)arg))
 				return -EFAULT;
-			
+
 			if (new_timeout < 0)
 				return -EINVAL;
-		
+
 			if (new_timeout > MAX_TIMEOUT)
 				new_timeout = MAX_TIMEOUT;
 
@@ -205,17 +215,17 @@
 
 		case WDIOC_GETTIMEOUT:
 			return put_user(amdtco_gettimeout(), (int *)arg);
-		
+
 		case WDIOC_SETOPTIONS:
 			if (copy_from_user(&tmp, (int *)arg, sizeof tmp))
-                                return -EFAULT;
+				return -EFAULT;
 
 			if (tmp & WDIOS_DISABLECARD)
 				amdtco_disable();
 
 			if (tmp & WDIOS_ENABLECARD)
 				amdtco_enable();
-			
+
 			return 0;
 	}
 }
@@ -223,14 +233,15 @@
 
 static int amdtco_fop_release(struct inode *inode, struct file *file)
 {
-	if (expect_close) {
-		amdtco_disable();	
+	if (expect_close == 42) {
+		amdtco_disable();
 		printk(KERN_INFO PFX "Watchdog disabled\n");
 	} else {
 		amdtco_ping();
 		printk(KERN_CRIT PFX "Unexpected close!, timeout in %d seconds\n", timeout);
-	}	
-	
+	}
+
+	expect_close = 0;
 	up(&open_sem);
 	return 0;
 }
@@ -240,21 +251,21 @@
 {
 	if (ppos != &file->f_pos)
 		return -ESPIPE;
-	
-	if (len) {
-#ifndef CONFIG_WATCHDOG_NOWAYOUT
-		size_t i;
-		char c;
-		expect_close = 0;
-		
-		for (i = 0; i != len; i++) {
-			if (get_user(c, data + i))
-				return -EFAULT;
 
-			if (c == 'V')
-				expect_close = 1;
+	if (len) {
+		if (!nowayout) {
+			size_t i;
+			char c;
+			expect_close = 0;
+
+			for (i = 0; i != len; i++) {
+				if (get_user(c, data + i))
+					return -EFAULT;
+
+				if (c == 'V')
+					expect_close = 42;
+			}
 		}
-#endif
 		amdtco_ping();
 	}
 
@@ -273,7 +284,7 @@
 
 static struct notifier_block amdtco_notifier =
 {
-	.notifier_call = amdtco_notify_sys
+	.notifier_call = amdtco_notify_sys,
 };
 
 static struct file_operations amdtco_fops =
@@ -282,20 +293,20 @@
 	.write		= amdtco_fop_write,
 	.ioctl		= amdtco_fop_ioctl,
 	.open		= amdtco_fop_open,
-	.release	= amdtco_fop_release
+	.release	= amdtco_fop_release,
 };
 
 static struct miscdevice amdtco_miscdev =
 {
 	.minor	= WATCHDOG_MINOR,
 	.name	= "watchdog",
-	.fops	= &amdtco_fops
+	.fops	= &amdtco_fops,
 };
 
 static struct pci_device_id amdtco_pci_tbl[] = {
 	/* AMD 766 PCI_IDs here */
 	{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_OPUS_7443, PCI_ANY_ID, PCI_ANY_ID, },
-	{ 0, }
+	{ 0, },
 };
 
 MODULE_DEVICE_TABLE (pci, amdtco_pci_tbl);
@@ -316,7 +327,7 @@
 	return -ENODEV;
 
 found_one:
-	
+
 	if ((ret = register_reboot_notifier(&amdtco_notifier))) {
 		printk(KERN_ERR PFX "Unable to register reboot notifier err = %d\n", ret);
 		goto out_clean;
diff -Nru a/drivers/char/watchdog/cpu5wdt.c b/drivers/char/watchdog/cpu5wdt.c
--- a/drivers/char/watchdog/cpu5wdt.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/char/watchdog/cpu5wdt.c	Tue Feb  3 19:45:17 2004
@@ -105,8 +105,8 @@
 {
 	if ( !cpu5wdt_device.queue ) {
 		cpu5wdt_device.queue = 1;
-		outb(0, port + CPU5WDT_TIME_A_REG);  
-		outb(0, port + CPU5WDT_TIME_B_REG);  
+		outb(0, port + CPU5WDT_TIME_A_REG);
+		outb(0, port + CPU5WDT_TIME_B_REG);
 		outb(1, port + CPU5WDT_MODE_REG);
 		outb(0, port + CPU5WDT_RESET_REG);
 		outb(0, port + CPU5WDT_ENABLE_REG);
@@ -134,23 +134,15 @@
 
 static int cpu5wdt_open(struct inode *inode, struct file *file)
 {
-	switch(iminor(inode)) {
-		case WATCHDOG_MINOR:
-			if ( test_and_set_bit(0, &cpu5wdt_device.inuse) )
-				return -EBUSY;
-			break;
-		default:
-			return -ENODEV;
-	}
+	if ( test_and_set_bit(0, &cpu5wdt_device.inuse) )
+		return -EBUSY;
 	return 0;
 
 }
 
 static int cpu5wdt_release(struct inode *inode, struct file *file)
 {
-	if(iminor(inode)==WATCHDOG_MINOR) {
-		clear_bit(0, &cpu5wdt_device.inuse);
-	}
+	clear_bit(0, &cpu5wdt_device.inuse);
 	return 0;
 }
 
@@ -160,15 +152,15 @@
 	static struct watchdog_info ident =
 	{
 		.options = WDIOF_CARDRESET,
-		.identity = "CPU5 WDT"
+		.identity = "CPU5 WDT",
 	};
-  
+
 	switch(cmd) {
 		case WDIOC_KEEPALIVE:
 			cpu5wdt_reset();
 			break;
-		case WDIOC_GETSTATUS:    
-			value = inb(port + CPU5WDT_STATUS_REG); 
+		case WDIOC_GETSTATUS:
+			value = inb(port + CPU5WDT_STATUS_REG);
 			value = (value >> 2) & 1;
 			if ( copy_to_user((int *)arg, (int *)&value, sizeof(int)) )
 				return -EFAULT;
@@ -191,7 +183,7 @@
 			}
 			break;
 		default:
-    			return -EINVAL;
+    			return -ENOIOCTLCMD;
 	}
 	return 0;
 }
@@ -200,7 +192,7 @@
 {
 	if ( !count )
 		return -EIO;
-	
+
 	cpu5wdt_reset();
 	return count;
 
@@ -217,7 +209,7 @@
 static struct miscdevice cpu5wdt_misc = {
 	.minor	= WATCHDOG_MINOR,
 	.name	= "watchdog",
-	.fops	= &cpu5wdt_fops
+	.fops	= &cpu5wdt_fops,
 };
 
 /* init/exit function */
@@ -242,7 +234,7 @@
 	}
 
 	/* watchdog reboot? */
-	val = inb(port + CPU5WDT_STATUS_REG); 
+	val = inb(port + CPU5WDT_STATUS_REG);
 	val = (val >> 2) & 1;
 	if ( !val )
 		printk(KERN_INFO PFX "sorry, was my fault\n");
diff -Nru a/drivers/char/watchdog/eurotechwdt.c b/drivers/char/watchdog/eurotechwdt.c
--- a/drivers/char/watchdog/eurotechwdt.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/char/watchdog/eurotechwdt.c	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,5 @@
 /*
- *	Eurotech CPU-1220/1410 on board WDT driver for Linux 2.4.x
+ *	Eurotech CPU-1220/1410 on board WDT driver
  *
  *	(c) Copyright 2001 Ascensit <support@ascensit.com>
  *	(c) Copyright 2001 Rodolfo Giometti <giometti@ascensit.com>
@@ -64,11 +64,11 @@
  * You must set these - there is no sane way to probe for this board.
  * You can use eurwdt=x,y to set these now.
  */
- 
+
 static int io = 0x3f0;
 static int irq = 10;
 static char *ev = "int";
- 
+
 #define WDT_TIMEOUT		60                /* 1 minute */
 
 #ifdef CONFIG_WATCHDOG_NOWAYOUT
@@ -81,7 +81,7 @@
 MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
 
 /*
- * Some symbolic names 
+ * Some symbolic names
  */
 
 #define WDT_CTRL_REG		0x30
@@ -92,7 +92,7 @@
 #define WDT_UNIT_SECS		0x80
 #define WDT_TIMEOUT_VAL		0xf2
 #define WDT_TIMER_CFG		0xf3
- 
+
 
 #ifndef MODULE
 
@@ -104,26 +104,26 @@
  * get the user to tell us the configuration. Sane people build it
  * modular but the others come here.
  */
- 
+
 static int __init eurwdt_setup(char *str)
 {
 	int ints[4];
- 
+
 str = get_options (str, ARRAY_SIZE(ints), ints);
- 
+
 	if (ints[0] > 0) {
 		io = ints[1];
 		if (ints[0] > 1)
 			irq = ints[2];
 	}
- 
+
 	return 1;
 }
- 
+
 __setup("eurwdt=", eurwdt_setup);
 
 #endif /* !MODULE */
- 
+
 MODULE_PARM(io, "i");
 MODULE_PARM_DESC(io, "Eurotech WDT io port (default=0x3f0)");
 MODULE_PARM(irq, "i");
@@ -162,7 +162,7 @@
 {
 	eurwdt_set_timeout(0);
 }
- 
+
 static void eurwdt_activate_timer(void)
 {
 	eurwdt_disable_timer();
@@ -180,18 +180,18 @@
 	eurwdt_write_reg(WDT_TIMER_CFG, irq<<4);
 
 	eurwdt_write_reg(WDT_UNIT_SEL, WDT_UNIT_SECS);	/* we use seconds */
-	eurwdt_set_timeout(0);	/* the default timeout */ 
+	eurwdt_set_timeout(0);	/* the default timeout */
 }
 
 
 /*
  * Kernel methods.
  */
- 
+
 static irqreturn_t eurwdt_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	printk(KERN_CRIT "timeout WDT timeout\n");
- 
+
 #ifdef ONLY_TESTING
 	printk(KERN_CRIT "Would Reboot.\n");
 #else
@@ -207,13 +207,13 @@
  *
  * Reload counter one with the watchdog timeout.
  */
- 
+
 static void eurwdt_ping(void)
 {
 	/* Write the watchdog default value */
 	eurwdt_set_timeout(eurwdt_timeout);
 }
- 
+
 /**
  * eurwdt_write:
  * @file: file handle to the watchdog
@@ -224,14 +224,14 @@
  * A write to a watchdog device is defined as a keepalive signal. Any
  * write of data will do, as we we don't define content meaning.
  */
- 
+
 static ssize_t eurwdt_write(struct file *file, const char *buf, size_t count,
 loff_t *ppos)
 {
 	/*  Can't seek (pwrite) on this device  */
 	if (ppos != &file->f_pos)
 	return -ESPIPE;
- 
+
 	if (count) 	{
 		if (!nowayout) {
 			size_t i;
@@ -262,7 +262,7 @@
  * The watchdog API defines a common set of functions for all watchdogs
  * according to their available features.
  */
- 
+
 static int eurwdt_ioctl(struct inode *inode, struct file *file,
 	unsigned int cmd, unsigned long arg)
 {
@@ -274,15 +274,15 @@
 
 	int time;
 	int options, retval = -EINVAL;
- 
+
 	switch(cmd) {
 	default:
-		return -ENOTTY;
+		return -ENOIOCTLCMD;
 
 	case WDIOC_GETSUPPORT:
 		return copy_to_user((struct watchdog_info *)arg, &ident,
 			sizeof(ident)) ? -EFAULT : 0;
- 
+
 	case WDIOC_GETSTATUS:
 	case WDIOC_GETBOOTSTATUS:
 		return put_user(0, (int *) arg);
@@ -299,8 +299,8 @@
 		if (time < 0 || time > 255)
 			return -EINVAL;
 
-		eurwdt_timeout = time; 
-		eurwdt_set_timeout(time); 
+		eurwdt_timeout = time;
+		eurwdt_set_timeout(time);
 		/* Fall */
 
 	case WDIOC_GETTIMEOUT:
@@ -330,7 +330,7 @@
  * The misc device has been opened. The watchdog device is single
  * open and on opening we load the counter.
  */
- 
+
 static int eurwdt_open(struct inode *inode, struct file *file)
 {
 	if (test_and_set_bit(0, &eurwdt_is_open))
@@ -340,7 +340,7 @@
 	eurwdt_activate_timer();
 	return 0;
 }
- 
+
 /**
  * eurwdt_release:
  * @inode: inode to board
@@ -352,7 +352,7 @@
  * reboots. In the former case we disable the counters, in the latter
  * case you have to open it again very soon.
  */
- 
+
 static int eurwdt_release(struct inode *inode, struct file *file)
 {
 	if (eur_expect_close == 42) {
@@ -360,12 +360,12 @@
 	} else {
 		printk(KERN_CRIT "eurwdt: Unexpected close, not stopping watchdog!\n");
 		eurwdt_ping();
-    }
+	}
 	clear_bit(0, &eurwdt_is_open);
 	eur_expect_close = 0;
 	return 0;
 }
- 
+
 /**
  * eurwdt_notify_sys:
  * @this: our notifier block
@@ -377,7 +377,7 @@
  * test or worse yet during the following fsck. This would suck, in fact
  * trust me - if it happens it does suck.
  */
- 
+
 static int eurwdt_notify_sys(struct notifier_block *this, unsigned long code,
 	void *unused)
 {
@@ -388,12 +388,12 @@
 
 	return NOTIFY_DONE;
 }
- 
+
 /*
  * Kernel Interfaces
  */
- 
- 
+
+
 static struct file_operations eurwdt_fops = {
 	.owner	= THIS_MODULE,
 	.llseek	= no_llseek,
@@ -406,18 +406,18 @@
 static struct miscdevice eurwdt_miscdev = {
 	.minor	= WATCHDOG_MINOR,
 	.name	= "watchdog",
-	.fops	= &eurwdt_fops
+	.fops	= &eurwdt_fops,
 };
- 
+
 /*
  * The WDT card needs to learn about soft shutdowns in order to
  * turn the timebomb registers off.
  */
- 
+
 static struct notifier_block eurwdt_notifier = {
 	.notifier_call = eurwdt_notify_sys,
 };
- 
+
 /**
  * cleanup_module:
  *
@@ -427,7 +427,7 @@
  * will not touch PC memory so all is fine. You just have to load a new
  * module in 60 seconds or reboot.
  */
- 
+
 static void __exit eurwdt_exit(void)
 {
 	eurwdt_lock_chip();
@@ -438,15 +438,15 @@
 	release_region(io, 2);
 	free_irq(irq, NULL);
 }
- 
+
 /**
  * eurwdt_init:
  *
- * Set up the WDT watchdog board. After grabbing the resources 
+ * Set up the WDT watchdog board. After grabbing the resources
  * we require we need also to unlock the device.
  * The open() function will actually kick the board off.
  */
- 
+
 static int __init eurwdt_init(void)
 {
 	int ret;
@@ -477,15 +477,15 @@
 	}
 
 	eurwdt_unlock_chip();
- 
+
 	ret = 0;
 	printk(KERN_INFO "Eurotech WDT driver 0.01 at %X (Interrupt %d)"
-		" - timeout event: %s\n", 
+		" - timeout event: %s\n",
 		io, irq, (!strcmp("int", ev) ? "int" : "reboot"));
 
 out:
 	return ret;
- 
+
 outreg:
 	release_region(io, 2);
 
@@ -496,10 +496,10 @@
 	misc_deregister(&eurwdt_miscdev);
 	goto out;
 }
- 
+
 module_init(eurwdt_init);
 module_exit(eurwdt_exit);
- 
+
 MODULE_AUTHOR("Rodolfo Giometti");
 MODULE_DESCRIPTION("Driver for Eurotech CPU-1220/1410 on board watchdog");
 MODULE_LICENSE("GPL");
diff -Nru a/drivers/char/watchdog/i810-tco.c b/drivers/char/watchdog/i810-tco.c
--- a/drivers/char/watchdog/i810-tco.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/char/watchdog/i810-tco.c	Tue Feb  3 19:45:16 2004
@@ -8,7 +8,7 @@
  *	modify it under the terms of the GNU General Public License
  *	as published by the Free Software Foundation; either version
  *	2 of the License, or (at your option) any later version.
- *	
+ *
  *	Neither kernel concepts nor Nils Faerber admit liability nor provide
  *	warranty for any of this software. This material is provided
  *	"AS-IS" and at no charge.
@@ -112,7 +112,7 @@
 	outb (val, TCO1_CNT + 1);
 	val = inb (TCO1_CNT + 1);
 	spin_unlock(&tco_lock);
-	
+
 	if (val & 0x08)
 		return -1;
 	return 0;
@@ -131,7 +131,7 @@
 	outb (val, TCO1_CNT + 1);
 	val = inb (TCO1_CNT + 1);
 	spin_unlock(&tco_lock);
-	
+
 	if ((val & 0x08) == 0)
 		return -1;
 	return 0;
@@ -148,7 +148,7 @@
 	/* "Values of 0h-3h are ignored and should not be attempted" */
 	if (tmrval > 0x3f || tmrval < 0x04)
 		return -1;
-	
+
 	spin_lock(&tco_lock);
 	val = inb (TCO1_TMR);
 	val &= 0xc0;
@@ -156,7 +156,7 @@
 	outb (val, TCO1_TMR);
 	val = inb (TCO1_TMR);
 	spin_unlock(&tco_lock);
-	
+
 	if ((val & 0x3f) != tmrval)
 		return -1;
 
@@ -197,7 +197,7 @@
 	/*
 	 *      Shut off the timer.
 	 */
-	if (tco_expect_close == 42 && !nowayout) {
+	if (tco_expect_close == 42) {
 		tco_timer_stop ();
 	} else {
 		tco_timer_reload ();
@@ -217,17 +217,21 @@
 
 	/* See if we got the magic character 'V' and reload the timer */
 	if (len) {
-		size_t i;
-
-		tco_expect_close = 0;
+		if (!nowayout) {
+			size_t i;
 
-		/* scan to see whether or not we got the magic character */
-		for (i = 0; i != len; i++) {
-			u8 c;
-			if(get_user(c, data+i))
-				return -EFAULT;
-			if (c == 'V')
-				tco_expect_close = 42;
+			/* note: just in case someone wrote the magic character
+			 * five months ago... */
+			tco_expect_close = 0;
+
+			/* scan to see whether or not we got the magic character */
+			for (i = 0; i != len; i++) {
+				u8 c;
+				if(get_user(c, data+i))
+					return -EFAULT;
+				if (c == 'V')
+					tco_expect_close = 42;
+			}
 		}
 
 		/* someone wrote to us, we should reload the timer */
@@ -251,7 +255,7 @@
 	};
 	switch (cmd) {
 		default:
-			return -ENOTTY;
+			return -ENOIOCTLCMD;
 		case WDIOC_GETSUPPORT:
 			if (copy_to_user
 			    ((struct watchdog_info *) arg, &ident, sizeof (ident)))
diff -Nru a/drivers/char/watchdog/ib700wdt.c b/drivers/char/watchdog/ib700wdt.c
--- a/drivers/char/watchdog/ib700wdt.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/char/watchdog/ib700wdt.c	Tue Feb  3 19:45:42 2004
@@ -1,5 +1,5 @@
 /*
- *	IB700 Single Board Computer WDT driver for Linux 2.4.x
+ *	IB700 Single Board Computer WDT driver
  *
  *	(c) Copyright 2001 Charles Howes <chowes@vsol.net>
  *
@@ -28,7 +28,7 @@
  *      14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
  *           Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
  *           Added timeout module option to override default
- * 
+ *
  */
 
 #include <linux/config.h>
@@ -48,9 +48,9 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 
-static int ibwdt_is_open;
+static unsigned long ibwdt_is_open;
 static spinlock_t ibwdt_lock;
-static int expect_close = 0;
+static char expect_close;
 
 #define PFX "ib700wdt: "
 
@@ -157,7 +157,7 @@
 				if (get_user(c, buf + i))
 					return -EFAULT;
 				if (c == 'V')
-					expect_close = 1;
+					expect_close = 42;
 			}
 		}
 		ibwdt_ping();
@@ -174,7 +174,7 @@
 	static struct watchdog_info ident = {
 		.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
 		.firmware_version = 1,
-		.identity = "IB700 WDT"
+		.identity = "IB700 WDT",
 	};
 
 	switch (cmd) {
@@ -184,9 +184,7 @@
 	  break;
 
 	case WDIOC_GETSTATUS:
-	  if (copy_to_user((int *)arg, &ibwdt_is_open,  sizeof(int)))
-	    return -EFAULT;
-	  break;
+	  return put_user(0, (int *) arg);
 
 	case WDIOC_KEEPALIVE:
 	  ibwdt_ping();
@@ -209,7 +207,7 @@
 	  break;
 
 	default:
-	  return -ENOTTY;
+	  return -ENOIOCTLCMD;
 	}
 	return 0;
 }
@@ -217,38 +215,32 @@
 static int
 ibwdt_open(struct inode *inode, struct file *file)
 {
-	if (iminor(inode) == WATCHDOG_MINOR) {
-		spin_lock(&ibwdt_lock);
-		if (ibwdt_is_open) {
-			spin_unlock(&ibwdt_lock);
-			return -EBUSY;
-		}
-		if (nowayout)
-			__module_get(THIS_MODULE);
-
-		/* Activate */
-		ibwdt_is_open = 1;
-		ibwdt_ping();
+	spin_lock(&ibwdt_lock);
+	if (test_and_set_bit(0, &ibwdt_is_open)) {
 		spin_unlock(&ibwdt_lock);
-		return 0;
-	} else {	
-		return -ENODEV;
+		return -EBUSY;
 	}
+	if (nowayout)
+		__module_get(THIS_MODULE);
+
+	/* Activate */
+	ibwdt_ping();
+	spin_unlock(&ibwdt_lock);
+	return 0;
 }
 
 static int
 ibwdt_close(struct inode *inode, struct file *file)
 {
-	if (iminor(inode) == WATCHDOG_MINOR) {
-		spin_lock(&ibwdt_lock);
-		if (expect_close)
-			outb_p(wd_times[wd_margin], WDT_STOP);
-		else
-			printk(KERN_CRIT PFX "WDT device closed unexpectedly.  WDT will not stop!\n");
+	spin_lock(&ibwdt_lock);
+	if (expect_close == 42)
+		outb_p(wd_times[wd_margin], WDT_STOP);
+	else
+		printk(KERN_CRIT PFX "WDT device closed unexpectedly.  WDT will not stop!\n");
 
-		ibwdt_is_open = 0;
-		spin_unlock(&ibwdt_lock);
-	}
+	clear_bit(0, &ibwdt_is_open);
+	expect_close = 0;
+	spin_unlock(&ibwdt_lock);
 	return 0;
 }
 
@@ -282,7 +274,7 @@
 static struct miscdevice ibwdt_miscdev = {
 	.minor = WATCHDOG_MINOR,
 	.name = "watchdog",
-	.fops = &ibwdt_fops
+	.fops = &ibwdt_fops,
 };
 
 /*
@@ -293,7 +285,7 @@
 static struct notifier_block ibwdt_notifier = {
 	.notifier_call = ibwdt_notify_sys,
 	.next = NULL,
-	.priority = 0
+	.priority = 0,
 };
 
 static int __init ibwdt_init(void)
diff -Nru a/drivers/char/watchdog/indydog.c b/drivers/char/watchdog/indydog.c
--- a/drivers/char/watchdog/indydog.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/char/watchdog/indydog.c	Tue Feb  3 19:45:42 2004
@@ -7,10 +7,10 @@
  *	modify it under the terms of the GNU General Public License
  *	as published by the Free Software Foundation; either version
  *	2 of the License, or (at your option) any later version.
- *	
+ *
  *	based on softdog.c by Alan Cox <alan@redhat.com>
  */
- 
+
 #include <linux/module.h>
 #include <linux/config.h>
 #include <linux/types.h>
@@ -25,8 +25,8 @@
 #include <asm/sgi/sgimc.h>
 
 static unsigned long indydog_alive;
-static struct sgimc_misc_ctrl *mcmisc_regs; 
-static int expect_close = 0;
+static struct sgimc_misc_ctrl *mcmisc_regs;
+static char expect_close;
 
 #ifdef CONFIG_WATCHDOG_NOWAYOUT
 static int nowayout = 1;
@@ -50,7 +50,7 @@
 static int indydog_open(struct inode *inode, struct file *file)
 {
 	u32 mc_ctrl0;
-	
+
 	if( test_and_set_bit(0,&indydog_alive) )
 		return -EBUSY;
 
@@ -65,7 +65,7 @@
 	mc_ctrl0 = mcmisc_regs->cpuctrl0 | SGIMC_CCTRL0_WDOG;
 	mcmisc_regs->cpuctrl0 = mc_ctrl0;
 	indydog_ping();
-			
+
 	printk("Started watchdog timer.\n");
 	return 0;
 }
@@ -77,8 +77,8 @@
 	 * 	Lock it in if it's a module and we set nowayout
 	 */
 
-	if (expect_close) {
-		u32 mc_ctrl0 = mcmisc_regs->cpuctrl0; 
+	if (expect_close == 42) {
+		u32 mc_ctrl0 = mcmisc_regs->cpuctrl0;
 		mc_ctrl0 &= ~SGIMC_CCTRL0_WDOG;
 		mcmisc_regs->cpuctrl0 = mc_ctrl0;
 		printk("Stopped watchdog timer.\n");
@@ -86,6 +86,7 @@
 		printk(KERN_CRIT "WDT device closed unexpectedly.  WDT will not stop!\n");
 	}
 	clear_bit(0,&indydog_alive);
+	expect_close = 0;
 	return 0;
 }
 
@@ -109,7 +110,7 @@
 				if (get_user(c, data + i))
 					return -EFAULT;
 				if (c == 'V')
-					expect_close = 1;
+					expect_close = 42;
 			}
 		}
 		indydog_ping();
diff -Nru a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c
--- a/drivers/char/watchdog/machzwd.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/char/watchdog/machzwd.c	Tue Feb  3 19:45:17 2004
@@ -1,7 +1,7 @@
 /*
  *  MachZ ZF-Logic Watchdog Timer driver for Linux
- *  
- * 
+ *
+ *
  *  This program is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU General Public License
  *  as published by the Free Software Foundation; either version
@@ -14,14 +14,14 @@
  *  Author: Fernando Fuganti <fuganti@conectiva.com.br>
  *
  *  Based on sbc60xxwdt.c by Jakob Oestergaard
- * 
  *
- *  We have two timers (wd#1, wd#2) driven by a 32 KHz clock with the 
+ *
+ *  We have two timers (wd#1, wd#2) driven by a 32 KHz clock with the
  *  following periods:
  *      wd#1 - 2 seconds;
  *      wd#2 - 7.2 ms;
- *  After the expiration of wd#1, it can generate a NMI, SCI, SMI, or 
- *  a system RESET and it starts wd#2 that unconditionaly will RESET 
+ *  After the expiration of wd#1, it can generate a NMI, SCI, SMI, or
+ *  a system RESET and it starts wd#2 that unconditionaly will RESET
  *  the system when the counter reaches zero.
  *
  *  14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
@@ -55,7 +55,7 @@
 
 /* indexes */			/* size */
 #define ZFL_VERSION	0x02	/* 16   */
-#define CONTROL 	0x10	/* 16   */	
+#define CONTROL 	0x10	/* 16   */
 #define STATUS		0x12	/* 8    */
 #define COUNTER_1	0x0C	/* 16   */
 #define COUNTER_2	0x0E	/* 8    */
@@ -111,9 +111,9 @@
 #define PFX "machzwd"
 
 static struct watchdog_info zf_info = {
-	.options		= WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, 
-	.firmware_version	= 1, 
-	.identity		= "ZF-Logic watchdog"
+	.options		= WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
+	.firmware_version	= 1,
+	.identity		= "ZF-Logic watchdog",
 };
 
 
@@ -130,8 +130,8 @@
 MODULE_PARM_DESC(action, "after watchdog resets, generate: 0 = RESET(*)  1 = SMI  2 = NMI  3 = SCI");
 
 static int zf_action = GEN_RESET;
-static int zf_is_open = 0;
-static int zf_expect_close = 0;
+static unsigned long zf_is_open;
+static char zf_expect_close;
 static spinlock_t zf_lock;
 static spinlock_t zf_port_lock;
 static struct timer_list zf_timer;
@@ -225,7 +225,7 @@
 	del_timer_sync(&zf_timer);
 
 	spin_lock_irqsave(&zf_port_lock, flags);
-	/* stop watchdog timer */	
+	/* stop watchdog timer */
 	ctrl_reg = zf_get_control();
 	ctrl_reg |= (ENABLE_WD1|ENABLE_WD2);	/* disable wd1 and wd2 */
 	ctrl_reg &= ~(ENABLE_WD1|ENABLE_WD2);
@@ -237,13 +237,13 @@
 
 
 /*
- * start hardware timer 
+ * start hardware timer
  */
 static void zf_timer_on(void)
 {
 	unsigned int ctrl_reg = 0;
 	unsigned long flags;
-	
+
 	spin_lock_irqsave(&zf_port_lock, flags);
 
 	zf_writeb(PULSE_LEN, 0xff);
@@ -272,26 +272,26 @@
 {
 	unsigned int ctrl_reg = 0;
 	unsigned long flags;
-		
+
 	zf_writeb(COUNTER_2, 0xff);
 
 	if(time_before(jiffies, next_heartbeat)){
 
 		dprintk("time_before: %ld\n", next_heartbeat - jiffies);
-		
-		/* 
+
+		/*
 		 * reset event is activated by transition from 0 to 1 on
 		 * RESET_WD1 bit and we assume that it is already zero...
 		 */
 
 		spin_lock_irqsave(&zf_port_lock, flags);
-		ctrl_reg = zf_get_control();    
-		ctrl_reg |= RESET_WD1;		
-		zf_set_control(ctrl_reg);	
-		
+		ctrl_reg = zf_get_control();
+		ctrl_reg |= RESET_WD1;
+		zf_set_control(ctrl_reg);
+
 		/* ...and nothing changes until here */
 		ctrl_reg &= ~(RESET_WD1);
-		zf_set_control(ctrl_reg);		
+		zf_set_control(ctrl_reg);
 		spin_unlock_irqrestore(&zf_port_lock, flags);
 
 		zf_timer.expires = jiffies + ZF_HW_TIMEO;
@@ -301,7 +301,7 @@
 	}
 }
 
-static ssize_t zf_write(struct file *file, const char *buf, size_t count, 
+static ssize_t zf_write(struct file *file, const char *buf, size_t count,
 								loff_t *ppos)
 {
 	/*  Can't seek (pwrite) on this device  */
@@ -317,21 +317,21 @@
 		 */
 		if (!nowayout) {
 			size_t ofs;
-			
-			/* 
+
+			/*
 			 * note: just in case someone wrote the magic character
 			 * five months ago...
 			 */
 			zf_expect_close = 0;
-			
+
 			/* now scan */
 			for (ofs = 0; ofs != count; ofs++){
 				char c;
 				if (get_user(c, buf + ofs))
 					return -EFAULT;
 				if (c == 'V'){
-					zf_expect_close = 1;
-					dprintk("zf_expect_close 1\n");
+					zf_expect_close = 42;
+					dprintk("zf_expect_close = 42\n");
 				}
 			}
 		}
@@ -342,7 +342,7 @@
 		 */
 		next_heartbeat = jiffies + ZF_USER_TIMEO;
 		dprintk("user ping at %ld\n", jiffies);
-		
+
 	}
 
 	return count;
@@ -353,22 +353,20 @@
 {
 	switch(cmd){
 		case WDIOC_GETSUPPORT:
-			if (copy_to_user((struct watchdog_info *)arg, 
+			if (copy_to_user((struct watchdog_info *)arg,
 					 &zf_info, sizeof(zf_info)))
 				return -EFAULT;
 			break;
-	  
+
 		case WDIOC_GETSTATUS:
-			if (copy_to_user((int *)arg, &zf_is_open, sizeof(int)))
-				return -EFAULT;
-			break;
+			return put_user(0, (int *) arg);
 
 		case WDIOC_KEEPALIVE:
 			zf_ping(0);
 			break;
 
 		default:
-			return -ENOTTY;
+			return -ENOIOCTLCMD;
 	}
 
 	return 0;
@@ -376,47 +374,37 @@
 
 static int zf_open(struct inode *inode, struct file *file)
 {
-	switch(iminor(inode)){
-		case WATCHDOG_MINOR:
-			spin_lock(&zf_lock);
-			if(zf_is_open){
-				spin_unlock(&zf_lock);
-				return -EBUSY;
-			}
-
-			if (nowayout)
-				__module_get(THIS_MODULE);
+	spin_lock(&zf_lock);
+	if(test_and_set_bit(0, &zf_is_open)) {
+		spin_unlock(&zf_lock);
+		return -EBUSY;
+	}
 
-			zf_is_open = 1;
+	if (nowayout)
+		__module_get(THIS_MODULE);
 
-			spin_unlock(&zf_lock);
+	spin_unlock(&zf_lock);
 
-			zf_timer_on();
+	zf_timer_on();
 
-			return 0;
-		default:
-			return -ENODEV;
-	}
+	return 0;
 }
 
 static int zf_close(struct inode *inode, struct file *file)
 {
-	if(iminor(inode) == WATCHDOG_MINOR){
+	if(zf_expect_close == 42){
+		zf_timer_off();
+	} else {
+		del_timer(&zf_timer);
+		printk(KERN_ERR PFX ": device file closed unexpectedly. Will not stop the WDT!\n");
+	}
 
-		if(zf_expect_close){
-			zf_timer_off();
-		} else {
-			del_timer(&zf_timer);
-			printk(KERN_ERR PFX ": device file closed unexpectedly. Will not stop the WDT!\n");
-		}
-		
-		spin_lock(&zf_lock);
-		zf_is_open = 0;
-		spin_unlock(&zf_lock);
+	spin_lock(&zf_lock);
+	clear_bit(0, &zf_is_open);
+	spin_unlock(&zf_lock);
+
+	zf_expect_close = 0;
 
-		zf_expect_close = 0;
-	}
-	
 	return 0;
 }
 
@@ -428,9 +416,9 @@
 								void *unused)
 {
 	if(code == SYS_DOWN || code == SYS_HALT){
-		zf_timer_off();		
+		zf_timer_off();
 	}
-	
+
 	return NOTIFY_DONE;
 }
 
@@ -448,9 +436,9 @@
 static struct miscdevice zf_miscdev = {
 	.minor = WATCHDOG_MINOR,
 	.name = "watchdog",
-	.fops = &zf_fops
+	.fops = &zf_fops,
 };
-                                                                        
+ 
 
 /*
  * The device needs to learn about soft shutdowns in order to
@@ -459,20 +447,20 @@
 static struct notifier_block zf_notifier = {
 	.notifier_call = zf_notify_sys,
 	.next = NULL,
-	.priority = 0
+	.priority = 0,
 };
 
 static void __init zf_show_action(int act)
 {
 	char *str[] = { "RESET", "SMI", "NMI", "SCI" };
-	
+
 	printk(KERN_INFO PFX ": Watchdog using action = %s\n", str[act]);
 }
 
 static int __init zf_init(void)
 {
 	int ret;
-	
+
 	printk(KERN_INFO PFX ": MachZ ZF-Logic Watchdog driver initializing.\n");
 
 	ret = zf_get_ZFL_version();
@@ -486,12 +474,12 @@
 		zf_action = zf_action>>action;
 	} else
 		action = 0;
-	
+
 	zf_show_action(action);
 
 	spin_lock_init(&zf_lock);
 	spin_lock_init(&zf_port_lock);
-	
+
 	ret = misc_register(&zf_miscdev);
 	if (ret){
 		printk(KERN_ERR "can't misc_register on minor=%d\n",
@@ -512,7 +500,7 @@
 									ret);
 		goto no_reboot;
 	}
-	
+
 	zf_set_status(0);
 	zf_set_control(0);
 
@@ -520,7 +508,7 @@
 	init_timer(&zf_timer);
 	zf_timer.function = zf_ping;
 	zf_timer.data = 0;
-	
+
 	return 0;
 
 no_reboot:
@@ -531,11 +519,11 @@
 	return ret;
 }
 
-	
+
 void __exit zf_exit(void)
 {
 	zf_timer_off();
-	
+
 	misc_deregister(&zf_miscdev);
 	unregister_reboot_notifier(&zf_notifier);
 	release_region(ZF_IOBASE, 3);
diff -Nru a/drivers/char/watchdog/mixcomwd.c b/drivers/char/watchdog/mixcomwd.c
--- a/drivers/char/watchdog/mixcomwd.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/char/watchdog/mixcomwd.c	Tue Feb  3 19:45:17 2004
@@ -30,11 +30,11 @@
  *
  * Version 0.5 (2001/12/14) Matt Domsch <Matt_Domsch@dell.com>
  *              - added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
- *	
+ *
  */
 
-#define VERSION "0.5" 
-  
+#define VERSION "0.5"
+
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/config.h>
@@ -55,12 +55,12 @@
 #define FLASHCOM_WATCHDOG_OFFSET 0x4
 #define FLASHCOM_ID 0x18
 
-static long mixcomwd_opened; /* long req'd for setbit --RR */
+static unsigned long mixcomwd_opened; /* long req'd for setbit --RR */
 
 static int watchdog_port;
 static int mixcomwd_timer_alive;
 static struct timer_list mixcomwd_timer = TIMER_INITIALIZER(NULL, 0, 0);
-static int expect_close = 0;
+static char expect_close;
 
 #ifdef CONFIG_WATCHDOG_NOWAYOUT
 static int nowayout = 1;
@@ -80,21 +80,21 @@
 static void mixcomwd_timerfun(unsigned long d)
 {
 	mixcomwd_ping();
-	
+
 	mod_timer(&mixcomwd_timer,jiffies+ 5*HZ);
 }
 
 /*
  *	Allow only one person to hold it open
  */
- 
+
 static int mixcomwd_open(struct inode *inode, struct file *file)
 {
 	if(test_and_set_bit(0,&mixcomwd_opened)) {
 		return -EBUSY;
 	}
 	mixcomwd_ping();
-	
+
 	if (nowayout) {
 		/*
 		 * fops_get() code via open() has already done
@@ -113,7 +113,7 @@
 
 static int mixcomwd_release(struct inode *inode, struct file *file)
 {
-	if (expect_close) {
+	if (expect_close == 42) {
 		if(mixcomwd_timer_alive) {
 			printk(KERN_ERR "mixcomwd: release called while internal timer alive");
 			return -EBUSY;
@@ -129,6 +129,7 @@
 	}
 
 	clear_bit(0,&mixcomwd_opened);
+	expect_close=0;
 	return 0;
 }
 
@@ -152,7 +153,7 @@
 				if (get_user(c, data + i))
 					return -EFAULT;
 				if (c == 'V')
-					expect_close = 1;
+					expect_close = 42;
 			}
 		}
 		mixcomwd_ping();
@@ -167,9 +168,9 @@
 	static struct watchdog_info ident = {
 		.options = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
 		.firmware_version = 1,
-		.identity = "MixCOM watchdog"
+		.identity = "MixCOM watchdog",
 	};
-                                        
+
 	switch(cmd)
 	{
 		case WDIOC_GETSTATUS:
@@ -182,7 +183,7 @@
 			}
 			break;
 		case WDIOC_GETSUPPORT:
-			if (copy_to_user((struct watchdog_info *)arg, &ident, 
+			if (copy_to_user((struct watchdog_info *)arg, &ident,
 			    sizeof(ident))) {
 				return -EFAULT;
 			}
@@ -191,7 +192,7 @@
 			mixcomwd_ping();
 			break;
 		default:
-			return -ENOTTY;
+			return -ENOIOCTLCMD;
 	}
 	return 0;
 }
@@ -207,9 +208,9 @@
 
 static struct miscdevice mixcomwd_miscdev=
 {
-	WATCHDOG_MINOR,
-	"watchdog",
-	&mixcomwd_fops
+	.minor	= WATCHDOG_MINOR,
+	.name	= "watchdog",
+	.fops	= &mixcomwd_fops,
 };
 
 static int __init mixcomwd_checkcard(int port)
@@ -220,7 +221,7 @@
 	if (!request_region(port, 1, "MixCOM watchdog")) {
 		return 0;
 	}
-	
+
 	id=inb_p(port) & 0x3f;
 	if(id!=MIXCOM_ID) {
 		release_region(port, 1);
@@ -232,12 +233,12 @@
 static int __init flashcom_checkcard(int port)
 {
 	int id;
-	
+
 	port += FLASHCOM_WATCHDOG_OFFSET;
 	if (!request_region(port, 1, "MixCOM watchdog")) {
 		return 0;
 	}
-	
+
 	id=inb_p(port);
  	if(id!=FLASHCOM_ID) {
 		release_region(port, 1);
@@ -245,7 +246,7 @@
 	}
  	return port;
  }
- 
+
 static int __init mixcomwd_init(void)
 {
 	int i;
@@ -258,7 +259,7 @@
 			found = 1;
 		}
 	}
-	
+
 	/* The FlashCOM card can be set up at 0x300 -> 0x378, in 0x8 jumps */
 	for (i = 0x300; !found && i < 0x380; i+=0x8) {
 		watchdog_port = flashcom_checkcard(i);
@@ -266,7 +267,7 @@
 			found = 1;
 		}
 	}
-	
+
 	if (!found) {
 		printk("mixcomwd: No card detected, or port not available.\n");
 		return -ENODEV;
@@ -278,11 +279,11 @@
 		release_region(watchdog_port, 1);
 		return ret;
 	}
-	
+
 	printk(KERN_INFO "MixCOM watchdog driver v%s, watchdog port at 0x%3x\n",VERSION,watchdog_port);
 
 	return 0;
-}	
+}
 
 static void __exit mixcomwd_exit(void)
 {
diff -Nru a/drivers/char/watchdog/pcwd.c b/drivers/char/watchdog/pcwd.c
--- a/drivers/char/watchdog/pcwd.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/char/watchdog/pcwd.c	Tue Feb  3 19:45:16 2004
@@ -34,7 +34,7 @@
  * 971222       Changed open/close for temperature handling
  *              Michael Meskes <meskes@debian.org>.
  * 980112       Used minor numbers from include/linux/miscdevice.h
- * 990403       Clear reset status after reading control status register in 
+ * 990403       Clear reset status after reading control status register in
  *              pcwd_showprevstate(). [Marc Boucher <marc@mbsi.ca>]
  * 990605	Made changes to code to support Firmware 1.22a, added
  *		fairly useless proc entry.
@@ -86,10 +86,10 @@
 #define	WD_TIMEOUT		4	/* 2 seconds for a timeout */
 static int timeout_val = WD_TIMEOUT;
 static int timeout = 2;
-static int expect_close = 0;
+static char expect_close;
 
 module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds (default=2)"); 
+MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds (default=2)");
 
 #ifdef CONFIG_WATCHDOG_NOWAYOUT
 static int nowayout = 1;
@@ -248,14 +248,14 @@
 	int cdat, rv;
 	static struct watchdog_info ident=
 	{
-		WDIOF_OVERHEAT|WDIOF_CARDRESET,
-		1,
-		"PCWD"
+		.options =		WDIOF_OVERHEAT|WDIOF_CARDRESET,
+		.firmware_version =	1,
+		.identity =		"PCWD",
 	};
 
 	switch(cmd) {
 	default:
-		return -ENOTTY;
+		return -ENOIOCTLCMD;
 
 	case WDIOC_GETSUPPORT:
 		if(copy_to_user((void*)arg, &ident, sizeof(ident)))
@@ -264,19 +264,19 @@
 
 	case WDIOC_GETSTATUS:
 		spin_lock(&io_lock);
-		if (revision == PCWD_REVISION_A) 
+		if (revision == PCWD_REVISION_A)
 			cdat = inb(current_readport);
 		else
 			cdat = inb(current_readport + 1 );
 		spin_unlock(&io_lock);
 		rv = WDIOF_MAGICCLOSE;
 
-		if (revision == PCWD_REVISION_A) 
+		if (revision == PCWD_REVISION_A)
 		{
 			if (cdat & WD_WDRST)
 				rv |= WDIOF_CARDRESET;
 
-			if (cdat & WD_T110) 
+			if (cdat & WD_T110)
 			{
 				rv |= WDIOF_OVERHEAT;
 
@@ -286,12 +286,12 @@
 				}
 			}
 		}
-		else 
+		else
 		{
 			if (cdat & 0x01)
 				rv |= WDIOF_CARDRESET;
 
-			if (cdat & 0x04) 
+			if (cdat & 0x04)
 			{
 				rv |= WDIOF_OVERHEAT;
 
@@ -309,7 +309,7 @@
 	case WDIOC_GETBOOTSTATUS:
 		rv = 0;
 
-		if (revision == PCWD_REVISION_A) 
+		if (revision == PCWD_REVISION_A)
 		{
 			if (initial_status & WD_WDRST)
 				rv |= WDIOF_CARDRESET;
@@ -333,7 +333,7 @@
 	case WDIOC_GETTEMP:
 
 		rv = 0;
-		if ((supports_temp) && (mode_debug == 0)) 
+		if ((supports_temp) && (mode_debug == 0))
 		{
 			spin_lock(&io_lock);
 			rv = inb(current_readport);
@@ -345,19 +345,19 @@
 		return 0;
 
 	case WDIOC_SETOPTIONS:
-		if (revision == PCWD_REVISION_C) 
+		if (revision == PCWD_REVISION_C)
 		{
 			if(copy_from_user(&rv, (int*) arg, sizeof(int)))
 				return -EFAULT;
 
-			if (rv & WDIOS_DISABLECARD) 
+			if (rv & WDIOS_DISABLECARD)
 			{
 				spin_lock(&io_lock);
 				outb_p(0xA5, current_readport + 3);
 				outb_p(0xA5, current_readport + 3);
 				cdat = inb_p(current_readport + 2);
 				spin_unlock(&io_lock);
-				if ((cdat & 0x10) == 0) 
+				if ((cdat & 0x10) == 0)
 				{
 					printk(KERN_INFO "pcwd: Could not disable card.\n");
 					return -EIO;
@@ -366,13 +366,13 @@
 				return 0;
 			}
 
-			if (rv & WDIOS_ENABLECARD) 
+			if (rv & WDIOS_ENABLECARD)
 			{
 				spin_lock(&io_lock);
 				outb_p(0x00, current_readport + 3);
 				cdat = inb_p(current_readport + 2);
 				spin_unlock(&io_lock);
-				if (cdat & 0x10) 
+				if (cdat & 0x10)
 				{
 					printk(KERN_INFO "pcwd: Could not enable card.\n");
 					return -EIO;
@@ -380,13 +380,13 @@
 				return 0;
 			}
 
-			if (rv & WDIOS_TEMPPANIC) 
+			if (rv & WDIOS_TEMPPANIC)
 			{
 				temp_panic = 1;
 			}
 		}
 		return -EINVAL;
-		
+
 	case WDIOC_KEEPALIVE:
 		pcwd_send_heartbeat();
 		return 0;
@@ -415,7 +415,7 @@
 				if (get_user(c, buf + i))
 					return -EFAULT;
 				if (c == 'V')
-					expect_close = 1;
+					expect_close = 42;
 			}
 		}
 		pcwd_send_heartbeat();
@@ -456,14 +456,14 @@
 	/*  Can't seek (pread) on this device  */
 	if (ppos != &file->f_pos)
 		return -ESPIPE;
-	switch(iminor(file->f_dentry->d_inode)) 
+	switch(iminor(file->f_dentry->d_inode))
 	{
 		case TEMP_MINOR:
 			/*
 			 * Convert metric to Fahrenheit, since this was
 			 * the decided 'standard' for this return value.
 			 */
-			
+
 			c = inb(current_readport);
 			cp = (c * 9 / 5) + 32;
 			if(copy_to_user(buf, &cp, 1))
@@ -477,7 +477,7 @@
 static int pcwd_close(struct inode *ino, struct file *filep)
 {
 	if (iminor(ino)==WATCHDOG_MINOR) {
-		if (expect_close) {
+		if (expect_close == 42) {
 			/*  Disable the board  */
 			if (revision == PCWD_REVISION_C) {
 				spin_lock(&io_lock);
@@ -488,6 +488,7 @@
 			atomic_inc( &open_allowed );
 		}
 	}
+	expect_close = 0;
 	return 0;
 }
 
@@ -500,7 +501,7 @@
 static inline int get_revision(void)
 {
 	int r = PCWD_REVISION_C;
-	
+
 	spin_lock(&io_lock);
 	if ((inb(current_readport + 2) == 0xFF) ||
 	    (inb(current_readport + 3) == 0xFF))
@@ -576,29 +577,29 @@
 };
 
 static struct miscdevice pcwd_miscdev = {
-	WATCHDOG_MINOR,
-	"watchdog",
-	&pcwd_fops
+	.minor =	WATCHDOG_MINOR,
+	.name =		"watchdog",
+	.fops =		&pcwd_fops,
 };
 
 static struct miscdevice temp_miscdev = {
-	TEMP_MINOR,
-	"temperature",
-	&pcwd_fops
+	.minor =	TEMP_MINOR,
+	.name =		"temperature",
+	.fops =		&pcwd_fops,
 };
- 
+
 static void __init pcwd_validate_timeout(void)
 {
 	timeout_val = timeout * 2;
 }
- 
+
 static int __init pcwatchdog_init(void)
 {
 	char *firmware;
 	int i, found = 0;
 	pcwd_validate_timeout();
 	spin_lock_init(&io_lock);
-	
+
 	revision = PCWD_REVISION_A;
 
 	printk(KERN_INFO "pcwd: v%s Ken Hollis (kenji@bitgate.com)\n", WD_VER);
@@ -660,11 +661,11 @@
 
 	if (misc_register(&pcwd_miscdev))
 		return -ENODEV;
-	
+
 	if (supports_temp)
 		if (misc_register(&temp_miscdev)) {
 			misc_deregister(&pcwd_miscdev);
-			return -ENODEV;		
+			return -ENODEV;
 		}
 
 
@@ -673,10 +674,10 @@
 			misc_deregister(&pcwd_miscdev);
 			if (supports_temp)
 				misc_deregister(&pcwd_miscdev);
-			return -EIO;		
+			return -EIO;
 		}
 	}
-	else 
+	else
 		if (!request_region(current_readport, 4, "PCWD Rev.C (Berkshire)")) {
 			misc_deregister(&pcwd_miscdev);
 			if (supports_temp)
diff -Nru a/drivers/char/watchdog/sa1100_wdt.c b/drivers/char/watchdog/sa1100_wdt.c
--- a/drivers/char/watchdog/sa1100_wdt.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/char/watchdog/sa1100_wdt.c	Tue Feb  3 19:45:18 2004
@@ -77,6 +77,7 @@
 	}
 
 	clear_bit(1, &sa1100wdt_users);
+	expect_close = 0;
 
 	return 0;
 }
diff -Nru a/drivers/char/watchdog/sbc60xxwdt.c b/drivers/char/watchdog/sbc60xxwdt.c
--- a/drivers/char/watchdog/sbc60xxwdt.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/char/watchdog/sbc60xxwdt.c	Tue Feb  3 19:45:34 2004
@@ -183,7 +183,7 @@
 			 * five months ago... */
 			wdt_expect_close = 0;
 
-			/* scan to see wether or not we got the magic character */
+			/* scan to see whether or not we got the magic character */
 			for(ofs = 0; ofs != count; ofs++)
 			{
 				char c;
diff -Nru a/drivers/char/watchdog/sc1200wdt.c b/drivers/char/watchdog/sc1200wdt.c
--- a/drivers/char/watchdog/sc1200wdt.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/char/watchdog/sc1200wdt.c	Tue Feb  3 19:45:17 2004
@@ -175,12 +175,12 @@
 	static struct watchdog_info ident = {
 		.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
 		.firmware_version = 0,
-		.identity = "PC87307/PC97307"
+		.identity = "PC87307/PC97307",
 	};
 
 	switch (cmd) {
 		default:
-			return -ENOTTY;	/* Keep Pavel Machek amused ;) */
+			return -ENOIOCTLCMD;	/* Keep Pavel Machek amused ;) */
 
 		case WDIOC_GETSUPPORT:
 			if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof ident))
@@ -256,7 +256,7 @@
 {
 	if (ppos != &file->f_pos)
 		return -ESPIPE;
-	
+
 	if (len) {
 		if (!nowayout) {
 			size_t i;
@@ -292,7 +292,7 @@
 
 static struct notifier_block sc1200wdt_notifier =
 {
-	notifier_call:	sc1200wdt_notify_sys
+	.notifier_call =	sc1200wdt_notify_sys,
 };
 
 static struct file_operations sc1200wdt_fops =
@@ -301,7 +301,7 @@
 	.write		= sc1200wdt_write,
 	.ioctl		= sc1200wdt_ioctl,
 	.open		= sc1200wdt_open,
-	.release	= sc1200wdt_release
+	.release	= sc1200wdt_release,
 };
 
 static struct miscdevice sc1200wdt_miscdev =
@@ -320,7 +320,7 @@
 	 * Nb. This could be done with accuracy by reading the SID registers, but
 	 * we don't have access to those io regions.
 	 */
-	
+
 	unsigned char reg;
 
 	sc1200wdt_read_data(PMC3, &reg);
@@ -334,7 +334,7 @@
 struct pnp_device_id scl200wdt_pnp_devices[] = {
 	/* National Semiconductor PC87307/PC97307 watchdog component */
 	{.id = "NSC0800", .driver_data = 0},
-	{.id = ""}
+	{.id = ""},
 };
 
 static int scl200wdt_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id)
@@ -409,7 +409,7 @@
 		ret = -EBUSY;
 		goto out_clean;
 	}
-	
+
 	ret = sc1200wdt_probe();
 	if (ret)
 		goto out_io;
@@ -438,7 +438,7 @@
 	release_region(io, io_len);
 
 	goto out_clean;
-}	
+}
 
 
 static void __exit sc1200wdt_exit(void)
diff -Nru a/drivers/char/watchdog/scx200_wdt.c b/drivers/char/watchdog/scx200_wdt.c
--- a/drivers/char/watchdog/scx200_wdt.c	Tue Feb  3 19:45:33 2004
+++ b/drivers/char/watchdog/scx200_wdt.c	Tue Feb  3 19:45:33 2004
@@ -1,4 +1,4 @@
-/* linux/drivers/char/scx200_wdt.c 
+/* drivers/char/watchdog/scx200_wdt.c
 
    National Semiconductor SCx200 Watchdog support
 
@@ -51,7 +51,7 @@
 
 static u16 wdto_restart;
 static struct semaphore open_semaphore;
-static unsigned expect_close;
+static char expect_close;
 
 /* Bits of the WDCNFG register */
 #define W_ENABLE 0x00fa		/* Enable watchdog */
@@ -73,7 +73,7 @@
 
 static void scx200_wdt_enable(void)
 {
-	printk(KERN_DEBUG NAME ": enabling watchdog timer, wdto_restart = %d\n", 
+	printk(KERN_DEBUG NAME ": enabling watchdog timer, wdto_restart = %d\n",
 	       wdto_restart);
 
 	outw(0, SCx200_CB_BASE + SCx200_WDT_WDTO);
@@ -86,7 +86,7 @@
 static void scx200_wdt_disable(void)
 {
 	printk(KERN_DEBUG NAME ": disabling watchdog timer\n");
-		
+
 	outw(0, SCx200_CB_BASE + SCx200_WDT_WDTO);
 	outb(SCx200_WDT_WDSTS_WDOVF, SCx200_CB_BASE + SCx200_WDT_WDSTS);
 	outw(W_DISABLE, SCx200_CB_BASE + SCx200_WDT_WDCNFG);
@@ -94,50 +94,50 @@
 
 static int scx200_wdt_open(struct inode *inode, struct file *file)
 {
-        /* only allow one at a time */
-        if (down_trylock(&open_semaphore))
-                return -EBUSY;
+	/* only allow one at a time */
+	if (down_trylock(&open_semaphore))
+		return -EBUSY;
 	scx200_wdt_enable();
-	expect_close = 0;
 
 	return 0;
 }
 
 static int scx200_wdt_release(struct inode *inode, struct file *file)
 {
-	if (!expect_close) {
+	if (expect_close != 42) {
 		printk(KERN_WARNING NAME ": watchdog device closed unexpectedly, will not disable the watchdog timer\n");
 	} else if (!nowayout) {
 		scx200_wdt_disable();
 	}
-        up(&open_semaphore);
+	expect_close = 0;
+	up(&open_semaphore);
 
 	return 0;
 }
 
-static int scx200_wdt_notify_sys(struct notifier_block *this, 
+static int scx200_wdt_notify_sys(struct notifier_block *this,
 				      unsigned long code, void *unused)
 {
-        if (code == SYS_HALT || code == SYS_POWER_OFF)
+	if (code == SYS_HALT || code == SYS_POWER_OFF)
 		if (!nowayout)
 			scx200_wdt_disable();
 
-        return NOTIFY_DONE;
+	return NOTIFY_DONE;
 }
 
 static struct notifier_block scx200_wdt_notifier =
 {
-        .notifier_call = scx200_wdt_notify_sys
+	.notifier_call = scx200_wdt_notify_sys,
 };
 
-static ssize_t scx200_wdt_write(struct file *file, const char *data, 
+static ssize_t scx200_wdt_write(struct file *file, const char *data,
 				     size_t len, loff_t *ppos)
 {
 	if (ppos != &file->f_pos)
 		return -ESPIPE;
 
 	/* check for a magic close character */
-	if (len) 
+	if (len)
 	{
 		size_t i;
 
@@ -149,7 +149,7 @@
 			if (get_user(c, data+i))
 				return -EFAULT;
 			if (c == 'V')
-				expect_close = 1;
+				expect_close = 42;
 		}
 
 		return len;
@@ -163,16 +163,16 @@
 {
 	static struct watchdog_info ident = {
 		.identity = "NatSemi SCx200 Watchdog",
-		.firmware_version = 1, 
+		.firmware_version = 1,
 		.options = (WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING),
 	};
 	int new_margin;
-	
+
 	switch (cmd) {
 	default:
-		return -ENOTTY;
+		return -ENOIOCTLCMD;
 	case WDIOC_GETSUPPORT:
-		if(copy_to_user((struct watchdog_info *)arg, &ident, 
+		if(copy_to_user((struct watchdog_info *)arg, &ident,
 				sizeof(ident)))
 			return -EFAULT;
 		return 0;
@@ -220,7 +220,7 @@
 	printk(KERN_DEBUG NAME ": NatSemi SCx200 Watchdog Driver\n");
 
 	/* First check that this really is a NatSemi SCx200 CPU */
-	if ((pci_find_device(PCI_VENDOR_ID_NS, 
+	if ((pci_find_device(PCI_VENDOR_ID_NS,
 			     PCI_DEVICE_ID_NS_SCx200_BRIDGE,
 			     NULL)) == NULL)
 		return -ENODEV;
@@ -231,8 +231,8 @@
 		return -ENODEV;
 	}
 
-	if (!request_region(SCx200_CB_BASE + SCx200_WDT_OFFSET, 
-			    SCx200_WDT_SIZE, 
+	if (!request_region(SCx200_CB_BASE + SCx200_WDT_OFFSET,
+			    SCx200_WDT_SIZE,
 			    "NatSemi SCx200 Watchdog")) {
 		printk(KERN_WARNING NAME ": watchdog I/O region busy\n");
 		return -EBUSY;
@@ -251,20 +251,20 @@
 	}
 
 	r = register_reboot_notifier(&scx200_wdt_notifier);
-        if (r) {
-                printk(KERN_ERR NAME ": unable to register reboot notifier");
+	if (r) {
+		printk(KERN_ERR NAME ": unable to register reboot notifier");
 		misc_deregister(&scx200_wdt_miscdev);
 		release_region(SCx200_CB_BASE + SCx200_WDT_OFFSET,
 				SCx200_WDT_SIZE);
-                return r;
-        }
+		return r;
+	}
 
 	return 0;
 }
 
 static void __exit scx200_wdt_cleanup(void)
 {
-        unregister_reboot_notifier(&scx200_wdt_notifier);
+	unregister_reboot_notifier(&scx200_wdt_notifier);
 	misc_deregister(&scx200_wdt_miscdev);
 	release_region(SCx200_CB_BASE + SCx200_WDT_OFFSET,
 		       SCx200_WDT_SIZE);
diff -Nru a/drivers/char/watchdog/shwdt.c b/drivers/char/watchdog/shwdt.c
--- a/drivers/char/watchdog/shwdt.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/char/watchdog/shwdt.c	Tue Feb  3 19:45:17 2004
@@ -36,7 +36,7 @@
 /*
  * Default clock division ratio is 5.25 msecs. For an additional table of
  * values, consult the asm-sh/watchdog.h. Overload this at module load
- * time. 
+ * time.
  *
  * In order for this to work reliably we need to have HZ set to 1000 or
  * something quite higher than 100 (or we need a proper high-res timer
@@ -122,7 +122,7 @@
 	csr = sh_wdt_read_rstcsr();
 	csr &= ~RSTCSR_RSTS;
 	sh_wdt_write_rstcsr(csr);
-#endif	
+#endif
 }
 
 /**
@@ -202,7 +202,7 @@
 
 	clear_bit(0, &shwdt_is_open);
 	shwdt_expect_close = 0;
-	
+
 	return 0;
 }
 
@@ -264,7 +264,7 @@
 					  sizeof(sh_wdt_info))) {
 				return -EFAULT;
 			}
-			
+
 			break;
 		case WDIOC_GETSTATUS:
 		case WDIOC_GETBOOTSTATUS:
@@ -299,11 +299,11 @@
 				sh_wdt_start();
 				retval = 0;
 			}
-			
+
 			return retval;
 		}
 		default:
-			return -ENOTTY;
+			return -ENOIOCTLCMD;
 	}
 
 	return 0;
@@ -311,7 +311,7 @@
 
 /**
  * 	sh_wdt_notify_sys - Notifier Handler
- * 	
+ *
  * 	@this: notifier block
  * 	@code: notifier event
  * 	@unused: unused
diff -Nru a/drivers/char/watchdog/softdog.c b/drivers/char/watchdog/softdog.c
--- a/drivers/char/watchdog/softdog.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/char/watchdog/softdog.c	Tue Feb  3 19:45:17 2004
@@ -8,10 +8,10 @@
  *	modify it under the terms of the GNU General Public License
  *	as published by the Free Software Foundation; either version
  *	2 of the License, or (at your option) any later version.
- *	
- *	Neither Alan Cox nor CymruNet Ltd. admit liability nor provide 
- *	warranty for any of this software. This material is provided 
- *	"AS-IS" and at no charge.	
+ *
+ *	Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
+ *	warranty for any of this software. This material is provided
+ *	"AS-IS" and at no charge.
  *
  *	(c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
  *
@@ -28,14 +28,14 @@
  *	Made SMP safe for 2.3.x
  *
  *  20011127 Joel Becker (jlbec@evilplan.org>
- *	Added soft_noboot; Allows testing the softdog trigger without 
+ *	Added soft_noboot; Allows testing the softdog trigger without
  *	requiring a recompile.
  *	Added WDIOC_GETTIMEOUT and WDIOC_SETTIMOUT.
  *
  *  20020530 Joel Becker <joel.becker@oracle.com>
  *  	Added Matt Domsch's nowayout module option.
  */
- 
+
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/config.h>
@@ -49,7 +49,7 @@
 
 #define TIMER_MARGIN	60		/* (secs) Default is 1 minute */
 
-static int expect_close = 0;
+static char expect_close;
 static int soft_margin = TIMER_MARGIN;	/* in seconds */
 #ifdef ONLY_TESTING
 static int soft_noboot = 1;
@@ -73,7 +73,7 @@
 /*
  *	Our timer
  */
- 
+
 static void watchdog_fire(unsigned long);
 
 static struct timer_list watchdog_ticktock =
@@ -84,7 +84,7 @@
 /*
  *	If the timer expires..
  */
- 
+
 static void watchdog_fire(unsigned long data)
 {
 	if (soft_noboot)
@@ -100,12 +100,12 @@
 /*
  *	Allow only one person to hold it open
  */
- 
+
 static int softdog_open(struct inode *inode, struct file *file)
 {
 	if(test_and_set_bit(0, &timer_alive))
 		return -EBUSY;
-	if (nowayout) 
+	if (nowayout)
 		__module_get(THIS_MODULE);
 	/*
 	 *	Activate timer
@@ -120,12 +120,13 @@
 	 *	Shut off the timer.
 	 * 	Lock it in if it's a module and we set nowayout
 	 */
-	if (expect_close) {
+	if (expect_close == 42) {
 		del_timer(&watchdog_ticktock);
 	} else {
 		printk(KERN_CRIT "SOFTDOG: WDT device closed unexpectedly.  WDT will not stop!\n");
 	}
 	clear_bit(0, &timer_alive);
+	expect_close = 0;
 	return 0;
 }
 
@@ -151,7 +152,7 @@
 				if (get_user(c, data + i))
 					return -EFAULT;
 				if (c == 'V')
-					expect_close = 1;
+					expect_close = 42;
 			}
 		}
 		mod_timer(&watchdog_ticktock, jiffies+(soft_margin*HZ));
@@ -169,7 +170,7 @@
 	};
 	switch (cmd) {
 		default:
-			return -ENOTTY;
+			return -ENOIOCTLCMD;
 		case WDIOC_GETSUPPORT:
 			if(copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)))
 				return -EFAULT;
diff -Nru a/drivers/char/watchdog/w83627hf_wdt.c b/drivers/char/watchdog/w83627hf_wdt.c
--- a/drivers/char/watchdog/w83627hf_wdt.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/char/watchdog/w83627hf_wdt.c	Tue Feb  3 19:45:28 2004
@@ -184,7 +184,7 @@
 	}
 
 	default:
-	  return -ENOTTY;
+	  return -ENOIOCTLCMD;
 	}
 	return 0;
 }
diff -Nru a/drivers/char/watchdog/w83877f_wdt.c b/drivers/char/watchdog/w83877f_wdt.c
--- a/drivers/char/watchdog/w83877f_wdt.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/char/watchdog/w83877f_wdt.c	Tue Feb  3 19:45:30 2004
@@ -205,7 +205,7 @@
 			 * five months ago... */
 			wdt_expect_close = 0;
 
-			/* scan to see wether or not we got the magic character */
+			/* scan to see whether or not we got the magic character */
 			for(ofs = 0; ofs != count; ofs++)
 			{
 				char c;
diff -Nru a/drivers/char/watchdog/wafer5823wdt.c b/drivers/char/watchdog/wafer5823wdt.c
--- a/drivers/char/watchdog/wafer5823wdt.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/char/watchdog/wafer5823wdt.c	Tue Feb  3 19:45:42 2004
@@ -109,7 +109,7 @@
 			/* In case it was set long ago */
 			expect_close = 0;
 
-			/* scan to see wether or not we got the magic character */
+			/* scan to see whether or not we got the magic character */
 			for (i = 0; i != count; i++) {
 				char c;
 				if (get_user(c, buf + i))
@@ -182,7 +182,7 @@
 	}
 
 	default:
-		return -ENOTTY;
+		return -ENOIOCTLCMD;
 	}
 	return 0;
 }
diff -Nru a/drivers/char/watchdog/wdt.c b/drivers/char/watchdog/wdt.c
--- a/drivers/char/watchdog/wdt.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/char/watchdog/wdt.c	Tue Feb  3 19:45:28 2004
@@ -8,10 +8,10 @@
  *	modify it under the terms of the GNU General Public License
  *	as published by the Free Software Foundation; either version
  *	2 of the License, or (at your option) any later version.
- *	
- *	Neither Alan Cox nor CymruNet Ltd. admit liability nor provide 
- *	warranty for any of this software. This material is provided 
- *	"AS-IS" and at no charge.	
+ *
+ *	Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
+ *	warranty for any of this software. This material is provided
+ *	"AS-IS" and at no charge.
  *
  *	(c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
  *
@@ -49,13 +49,13 @@
 #include "wd501p.h"
 
 static unsigned long wdt_is_open;
-static int expect_close;
+static char expect_close;
 
 /*
  *	You must set these - there is no sane way to probe for this board.
  *	You can use wdt=x,y to set these now.
  */
- 
+
 static int io=0x240;
 static int irq=11;
 
@@ -80,10 +80,10 @@
  *	@str: command line string
  *
  *	Setup options. The board isn't really probe-able so we have to
- *	get the user to tell us the configuration. Sane people build it 
+ *	get the user to tell us the configuration. Sane people build it
  *	modular but the others come here.
  */
- 
+
 static int __init wdt_setup(char *str)
 {
 	int ints[4];
@@ -108,11 +108,11 @@
 MODULE_PARM_DESC(io, "WDT io port (default=0x240)");
 MODULE_PARM(irq, "i");
 MODULE_PARM_DESC(irq, "WDT irq (default=11)");
- 
+
 /*
  *	Programming support
  */
- 
+
 static void wdt_ctr_mode(int ctr, int mode)
 {
 	ctr<<=6;
@@ -130,29 +130,29 @@
 /*
  *	Kernel methods.
  */
- 
- 
+
+
 /**
  *	wdt_status:
- *	
+ *
  *	Extract the status information from a WDT watchdog device. There are
  *	several board variants so we have to know which bits are valid. Some
  *	bits default to one and some to zero in order to be maximally painful.
  *
  *	we then map the bits onto the status ioctl flags.
  */
- 
+
 static int wdt_status(void)
 {
 	/*
 	 *	Status register to bit flags
 	 */
-	 
+
 	int flag=0;
 	unsigned char status=inb_p(WDT_SR);
 	status|=FEATUREMAP1;
-	status&=~FEATUREMAP2;	
-	
+	status&=~FEATUREMAP2;
+
 	if(!(status&WDC_SR_TGOOD))
 		flag|=WDIOF_OVERHEAT;
 	if(!(status&WDC_SR_PSUOVER))
@@ -178,21 +178,21 @@
  *	map changes in what the board considers an interesting way. That means
  *	a failure condition occurring.
  */
- 
+
 static irqreturn_t wdt_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	/*
 	 *	Read the status register see what is up and
-	 *	then printk it. 
+	 *	then printk it.
 	 */
-	 
+
 	unsigned char status=inb_p(WDT_SR);
-	
+
 	status|=FEATUREMAP1;
-	status&=~FEATUREMAP2;	
-	
+	status&=~FEATUREMAP2;
+
 	printk(KERN_CRIT "WDT status %d\n", status);
-	
+
 	if(!(status&WDC_SR_TGOOD))
 		printk(KERN_CRIT "Overheat alarm.(%d)\n",inb_p(WDT_RT));
 	if(!(status&WDC_SR_PSUOVER))
@@ -205,10 +205,10 @@
 #ifdef SOFTWARE_REBOOT
 #ifdef ONLY_TESTING
 		printk(KERN_CRIT "Would Reboot.\n");
-#else		
+#else
 		printk(KERN_CRIT "Initiating system reboot.\n");
 		machine_restart(NULL);
-#endif		
+#endif
 #else
 		printk(KERN_CRIT "Reset in 5ms.\n");
 #endif
@@ -220,9 +220,9 @@
  *	wdt_ping:
  *
  *	Reload counter one with the watchdog timeout. We don't bother reloading
- *	the cascade counter. 
+ *	the cascade counter.
  */
- 
+
 static void wdt_ping(void)
 {
 	/* Write a watchdog value */
@@ -235,14 +235,14 @@
 /**
  *	wdt_write:
  *	@file: file handle to the watchdog
- *	@buf: buffer to write (unused as data does not matter here 
+ *	@buf: buffer to write (unused as data does not matter here
  *	@count: count of bytes
  *	@ppos: pointer to the position to write. No seeks allowed
  *
  *	A write to a watchdog device is defined as a keepalive signal. Any
  *	write of data will do, as we we don't define content meaning.
  */
- 
+
 static ssize_t wdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
 {
 	/*  Can't seek (pwrite) on this device  */
@@ -261,7 +261,7 @@
 				if (get_user(c, buf + i))
 					return -EFAULT;
 				if (c == 'V')
-					expect_close = 1;
+					expect_close = 42;
 			}
 		}
 		wdt_ping();
@@ -279,12 +279,12 @@
  *	Read reports the temperature in degrees Fahrenheit. The API is in
  *	farenheit. It was designed by an imperial measurement luddite.
  */
- 
+
 static ssize_t wdt_read(struct file *file, char *buf, size_t count, loff_t *ptr)
 {
 	unsigned short c=inb_p(WDT_RT);
 	unsigned char cp;
-	
+
 	/*  Can't seek (pread) on this device  */
 	if (ptr != &file->f_pos)
 		return -ESPIPE;
@@ -312,9 +312,9 @@
  *
  *	The watchdog API defines a common set of functions for all watchdogs
  *	according to their available features. We only actually usefully support
- *	querying capabilities and current status. 
+ *	querying capabilities and current status.
  */
- 
+
 static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	unsigned long arg)
 {
@@ -326,14 +326,14 @@
 					|WDIOF_EXTERN1|WDIOF_EXTERN2|WDIOF_FANFAULT
 					|WDIOF_SETTIMEOUT|WDIOF_MAGICCLOSE,
 		.firmware_version = 1,
-		.identity = "WDT500/501"
+		.identity = "WDT500/501",
 	};
-	
+
 	ident.options&=WDT_OPTION_MASK;	/* Mask down to the card we have */
 	switch(cmd)
 	{
 		default:
-			return -ENOTTY;
+			return -ENOIOCTLCMD;
 		case WDIOC_GETSUPPORT:
 			return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0;
 
@@ -364,12 +364,12 @@
  *	@file: file handle to device
  *
  *	One of our two misc devices has been opened. The watchdog device is
- *	single open and on opening we load the counters. Counter zero is a 
+ *	single open and on opening we load the counters. Counter zero is a
  *	100Hz cascade, into counter 1 which downcounts to reboot. When the
  *	counter triggers counter 2 downcounts the length of the reset pulse
- *	which set set to be as long as possible. 
+ *	which set set to be as long as possible.
  */
- 
+
 static int wdt_open(struct inode *inode, struct file *file)
 {
 	switch(iminor(inode))
@@ -378,9 +378,9 @@
 			if(test_and_set_bit(0, &wdt_is_open))
 				return -EBUSY;
 			/*
-			 *	Activate 
+			 *	Activate
 			 */
-	 
+
 			wdt_is_open=1;
 			inb_p(WDT_DC);		/* Disable */
 			wdt_ctr_mode(0,3);
@@ -403,24 +403,25 @@
  *	@inode: inode to board
  *	@file: file handle to board
  *
- *	The watchdog has a configurable API. There is a religious dispute 
- *	between people who want their watchdog to be able to shut down and 
+ *	The watchdog has a configurable API. There is a religious dispute
+ *	between people who want their watchdog to be able to shut down and
  *	those who want to be sure if the watchdog manager dies the machine
  *	reboots. In the former case we disable the counters, in the latter
  *	case you have to open it again very soon.
  */
- 
+
 static int wdt_release(struct inode *inode, struct file *file)
 {
 	if(iminor(inode)==WATCHDOG_MINOR)
 	{
-		if (expect_close) {
+		if (expect_close == 42) {
 			inb_p(WDT_DC);		/* Disable counters */
 			wdt_ctr_load(2,0);	/* 0 length reset pulses now */
 		} else {
 			printk(KERN_CRIT "wdt: WDT device closed unexpectedly.  WDT will not stop!\n");
 		}
 		clear_bit(0, &wdt_is_open);
+		expect_close = 0;
 	}
 	return 0;
 }
@@ -448,12 +449,12 @@
 	}
 	return NOTIFY_DONE;
 }
- 
+
 /*
  *	Kernel Interfaces
  */
- 
- 
+
+
 static struct file_operations wdt_fops = {
 	.owner		= THIS_MODULE,
 	.llseek		= no_llseek,
@@ -468,7 +469,7 @@
 {
 	.minor	= WATCHDOG_MINOR,
 	.name	= "watchdog",
-	.fops	= &wdt_fops
+	.fops	= &wdt_fops,
 };
 
 #ifdef CONFIG_WDT_501
@@ -476,20 +477,20 @@
 {
 	.minor	= TEMP_MINOR,
 	.name	= "temperature",
-	.fops	= &wdt_fops
+	.fops	= &wdt_fops,
 };
 #endif
 
 /*
  *	The WDT card needs to learn about soft shutdowns in order to
- *	turn the timebomb registers off. 
+ *	turn the timebomb registers off.
  */
- 
+
 static struct notifier_block wdt_notifier=
 {
 	.notifier_call = wdt_notify_sys,
 	.next = NULL,
-	.priority = 0
+	.priority = 0,
 };
 
 /**
@@ -501,13 +502,13 @@
  *	will not touch PC memory so all is fine. You just have to load a new
  *	module in 60 seconds or reboot.
  */
- 
+
 static void __exit wdt_exit(void)
 {
 	misc_deregister(&wdt_miscdev);
-#ifdef CONFIG_WDT_501	
+#ifdef CONFIG_WDT_501
 	misc_deregister(&temp_miscdev);
-#endif	
+#endif
 	unregister_reboot_notifier(&wdt_notifier);
 	release_region(io,8);
 	free_irq(irq, NULL);
@@ -520,7 +521,7 @@
  *	resources we require and bitch if anyone beat us to them.
  *	The open() function will actually kick the board off.
  */
- 
+
 static int __init wdt_init(void)
 {
 	int ret;
diff -Nru a/drivers/char/watchdog/wdt285.c b/drivers/char/watchdog/wdt285.c
--- a/drivers/char/watchdog/wdt285.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/char/watchdog/wdt285.c	Tue Feb  3 19:45:17 2004
@@ -12,9 +12,9 @@
  *	modify it under the terms of the GNU General Public License
  *	as published by the Free Software Foundation; either version
  *	2 of the License, or (at your option) any later version.
- *	
+ *
  */
- 
+
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/types.h>
@@ -79,7 +79,7 @@
 
 	*CSR_TIMER4_CLR = 0;
 	watchdog_ping();
-	*CSR_TIMER4_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD 
+	*CSR_TIMER4_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD
 		| TIMER_CNTL_DIV256;
 
 #ifdef ONLY_TESTING
@@ -132,7 +132,7 @@
 
 static struct watchdog_info ident = {
 	.options	= WDIOF_SETTIMEOUT,
-	.identity	= "Footbridge Watchdog"
+	.identity	= "Footbridge Watchdog",
 };
 
 static int
@@ -192,7 +192,7 @@
 static struct miscdevice watchdog_miscdev = {
 	.minor		= WATCHDOG_MINOR,
 	.name		= "watchdog",
-	.fops		= &watchdog_fops
+	.fops		= &watchdog_fops,
 };
 
 static int __init footbridge_watchdog_init(void)
@@ -206,7 +206,7 @@
 	if (retval < 0)
 		return retval;
 
-	printk("Footbridge Watchdog Timer: 0.01, timer margin: %d sec\n", 
+	printk("Footbridge Watchdog Timer: 0.01, timer margin: %d sec\n",
 	       soft_margin);
 
 	if (machine_is_cats())
diff -Nru a/drivers/char/watchdog/wdt977.c b/drivers/char/watchdog/wdt977.c
--- a/drivers/char/watchdog/wdt977.c	Tue Feb  3 19:45:40 2004
+++ b/drivers/char/watchdog/wdt977.c	Tue Feb  3 19:45:40 2004
@@ -43,7 +43,7 @@
 static	int timeoutM = DEFAULT_TIMEOUT;		/* timeout in minutes */
 static	unsigned long timer_alive;
 static	int testmode;
-static int expect_close = 0;
+static	char expect_close;
 
 module_param(timeout, int, 0);
 MODULE_PARM_DESC(timeout,"Watchdog timeout in seconds (60..15300), default=60");
@@ -165,7 +165,7 @@
 	 *	Shut off the timer.
 	 * 	Lock it in if it's a module and we set nowayout
 	 */
-	if (!nowayout)
+	if (expect_close == 42)
 	{
 		/* unlock the SuperIO chip */
 		outb(0x87,0x370);
@@ -202,6 +202,7 @@
 	} else {
 		printk(KERN_CRIT "WDT device closed unexpectedly.  WDT will not stop!\n");
 	}
+	expect_close = 0;
 	return 0;
 }
 
@@ -235,7 +236,7 @@
 				if (get_user(c, buf + i))
 					return -EFAULT;
 				if (c == 'V')
-					expect_close = 1;
+					expect_close = 42;
 			}
 		}
 
@@ -257,18 +258,18 @@
 
 static struct watchdog_info ident = {
 	.options	= WDIOF_SETTIMEOUT,
-	.identity	= "Winbond 83977"
+	.identity	= "Winbond 83977",
 };
 
 static int wdt977_ioctl(struct inode *inode, struct file *file,
-         unsigned int cmd, unsigned long arg)
+	unsigned int cmd, unsigned long arg)
 {
 	int temp;
 
 	switch(cmd)
 	{
 	default:
-		return -ENOTTY;
+		return -ENOIOCTLCMD;
 
 	case WDIOC_GETSUPPORT:
 	    return copy_to_user((struct watchdog_info *)arg, &ident,
@@ -341,7 +342,7 @@
 {
 	.minor		= WATCHDOG_MINOR,
 	.name		= "watchdog",
-	.fops		= &wdt977_fops
+	.fops		= &wdt977_fops,
 };
 
 static int __init nwwatchdog_init(void)
diff -Nru a/drivers/char/watchdog/wdt_pci.c b/drivers/char/watchdog/wdt_pci.c
--- a/drivers/char/watchdog/wdt_pci.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/char/watchdog/wdt_pci.c	Tue Feb  3 19:45:30 2004
@@ -8,10 +8,10 @@
  *	modify it under the terms of the GNU General Public License
  *	as published by the Free Software Foundation; either version
  *	2 of the License, or (at your option) any later version.
- *	
- *	Neither Alan Cox nor CymruNet Ltd. admit liability nor provide 
- *	warranty for any of this software. This material is provided 
- *	"AS-IS" and at no charge.	
+ *
+ *	Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
+ *	warranty for any of this software. This material is provided
+ *	"AS-IS" and at no charge.
  *
  *	(c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
  *
@@ -72,7 +72,7 @@
 
 static struct semaphore open_sem;
 static spinlock_t wdtpci_lock;
-static int expect_close = 0;
+static char expect_close;
 
 static int io;
 static int irq;
@@ -95,7 +95,7 @@
 /*
  *	Programming support
  */
- 
+
 static void wdtpci_ctr_mode(int ctr, int mode)
 {
 	ctr<<=6;
@@ -113,29 +113,29 @@
 /*
  *	Kernel methods.
  */
- 
- 
+
+
 /**
  *	wdtpci_status:
- *	
+ *
  *	Extract the status information from a WDT watchdog device. There are
  *	several board variants so we have to know which bits are valid. Some
  *	bits default to one and some to zero in order to be maximally painful.
  *
  *	we then map the bits onto the status ioctl flags.
  */
- 
+
 static int wdtpci_status(void)
 {
 	/*
 	 *	Status register to bit flags
 	 */
-	 
+
 	int flag=0;
 	unsigned char status=inb_p(WDT_SR);
 	status|=FEATUREMAP1;
-	status&=~FEATUREMAP2;	
-	
+	status&=~FEATUREMAP2;
+
 	if(!(status&WDC_SR_TGOOD))
 		flag|=WDIOF_OVERHEAT;
 	if(!(status&WDC_SR_PSUOVER))
@@ -161,21 +161,21 @@
  *	map changes in what the board considers an interesting way. That means
  *	a failure condition occurring.
  */
- 
+
 static irqreturn_t wdtpci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	/*
 	 *	Read the status register see what is up and
-	 *	then printk it. 
+	 *	then printk it.
 	 */
-	 
+
 	unsigned char status=inb_p(WDT_SR);
-	
+
 	status|=FEATUREMAP1;
-	status&=~FEATUREMAP2;	
-	
+	status&=~FEATUREMAP2;
+
 	printk(KERN_CRIT "WDT status %d\n", status);
-	
+
 	if(!(status&WDC_SR_TGOOD))
 		printk(KERN_CRIT "Overheat alarm.(%d)\n",inb_p(WDT_RT));
 	if(!(status&WDC_SR_PSUOVER))
@@ -188,10 +188,10 @@
 #ifdef SOFTWARE_REBOOT
 #ifdef ONLY_TESTING
 		printk(KERN_CRIT "Would Reboot.\n");
-#else		
+#else
 		printk(KERN_CRIT "Initiating system reboot.\n");
 		machine_restart(NULL);
-#endif		
+#endif
 #else
 		printk(KERN_CRIT "Reset in 5ms.\n");
 #endif
@@ -203,9 +203,9 @@
  *	wdtpci_ping:
  *
  *	Reload counter one with the watchdog timeout. We don't bother reloading
- *	the cascade counter. 
+ *	the cascade counter.
  */
- 
+
 static void wdtpci_ping(void)
 {
 	unsigned long flags;
@@ -222,14 +222,14 @@
 /**
  *	wdtpci_write:
  *	@file: file handle to the watchdog
- *	@buf: buffer to write (unused as data does not matter here 
+ *	@buf: buffer to write (unused as data does not matter here
  *	@count: count of bytes
  *	@ppos: pointer to the position to write. No seeks allowed
  *
  *	A write to a watchdog device is defined as a keepalive signal. Any
  *	write of data will do, as we we don't define content meaning.
  */
- 
+
 static ssize_t wdtpci_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
 {
 	/*  Can't seek (pwrite) on this device  */
@@ -247,7 +247,7 @@
 				if(get_user(c, buf+i))
 					return -EFAULT;
 				if (c == 'V')
-					expect_close = 1;
+					expect_close = 42;
 			}
 		}
 		wdtpci_ping();
@@ -266,12 +266,12 @@
  *	Read reports the temperature in degrees Fahrenheit. The API is in
  *	fahrenheit. It was designed by an imperial measurement luddite.
  */
- 
+
 static ssize_t wdtpci_read(struct file *file, char *buf, size_t count, loff_t *ptr)
 {
 	unsigned short c=inb_p(WDT_RT);
 	unsigned char cp;
-	
+
 	/*  Can't seek (pread) on this device  */
 	if (ptr != &file->f_pos)
 		return -ESPIPE;
@@ -299,9 +299,9 @@
  *
  *	The watchdog API defines a common set of functions for all watchdogs
  *	according to their available features. We only actually usefully support
- *	querying capabilities and current status. 
+ *	querying capabilities and current status.
  */
- 
+
 static int wdtpci_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	unsigned long arg)
 {
@@ -314,12 +314,12 @@
 		.firmware_version = 1,
 		.identity	  = "WDT500/501PCI",
 	};
-	
+
 	ident.options&=WDT_OPTION_MASK;	/* Mask down to the card we have */
 	switch(cmd)
 	{
 		default:
-			return -ENOTTY;
+			return -ENOIOCTLCMD;
 		case WDIOC_GETSUPPORT:
 			return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0;
 
@@ -351,12 +351,12 @@
  *	@file: file handle to device
  *
  *	One of our two misc devices has been opened. The watchdog device is
- *	single open and on opening we load the counters. Counter zero is a 
+ *	single open and on opening we load the counters. Counter zero is a
  *	100Hz cascade, into counter 1 which downcounts to reboot. When the
  *	counter triggers counter 2 downcounts the length of the reset pulse
- *	which set set to be as long as possible. 
+ *	which set set to be as long as possible.
  */
- 
+
 static int wdtpci_open(struct inode *inode, struct file *file)
 {
 	unsigned long flags;
@@ -371,17 +371,17 @@
 				__module_get(THIS_MODULE);
 			}
 			/*
-			 *	Activate 
+			 *	Activate
 			 */
 			spin_lock_irqsave(&wdtpci_lock, flags);
-			
+
 			inb_p(WDT_DC);		/* Disable */
 
 			/*
 			 * "pet" the watchdog, as Access says.
 			 * This resets the clock outputs.
 			 */
-				
+
 			wdtpci_ctr_mode(2,0);
 			outb_p(0, WDT_DC);
 
@@ -413,19 +413,19 @@
  *	@inode: inode to board
  *	@file: file handle to board
  *
- *	The watchdog has a configurable API. There is a religious dispute 
- *	between people who want their watchdog to be able to shut down and 
+ *	The watchdog has a configurable API. There is a religious dispute
+ *	between people who want their watchdog to be able to shut down and
  *	those who want to be sure if the watchdog manager dies the machine
  *	reboots. In the former case we disable the counters, in the latter
  *	case you have to open it again very soon.
  */
- 
+
 static int wdtpci_release(struct inode *inode, struct file *file)
 {
 
 	if (iminor(inode)==WATCHDOG_MINOR) {
 		unsigned long flags;
-		if (expect_close) {
+		if (expect_close == 42) {
 			spin_lock_irqsave(&wdtpci_lock, flags);
 			inb_p(WDT_DC);		/* Disable counters */
 			wdtpci_ctr_load(2,0);	/* 0 length reset pulses now */
@@ -434,6 +434,7 @@
 			printk(KERN_CRIT PFX "Unexpected close, not stopping timer!");
 			wdtpci_ping();
 		}
+		expect_close = 0;
 		up(&open_sem);
 	}
 	return 0;
@@ -465,12 +466,12 @@
 	}
 	return NOTIFY_DONE;
 }
- 
+
 /*
  *	Kernel Interfaces
  */
- 
- 
+
+
 static struct file_operations wdtpci_fops = {
 	.owner		= THIS_MODULE,
 	.llseek		= no_llseek,
@@ -497,9 +498,9 @@
 
 /*
  *	The WDT card needs to learn about soft shutdowns in order to
- *	turn the timebomb registers off. 
+ *	turn the timebomb registers off.
  */
- 
+
 static struct notifier_block wdtpci_notifier = {
 	.notifier_call = wdtpci_notify_sys,
 };
@@ -584,7 +585,7 @@
 	unregister_reboot_notifier(&wdtpci_notifier);
 #ifdef CONFIG_WDT_501_PCI
 	misc_deregister(&temp_miscdev);
-#endif	
+#endif
 	misc_deregister(&wdtpci_miscdev);
 	free_irq(irq, &wdtpci_miscdev);
 	release_region(io, 16);
@@ -620,7 +621,7 @@
  *	will not touch PC memory so all is fine. You just have to load a new
  *	module in 60 seconds or reboot.
  */
- 
+
 static void __exit wdtpci_cleanup(void)
 {
 	pci_unregister_driver (&wdtpci_driver);
@@ -634,14 +635,14 @@
  *	resources we require and bitch if anyone beat us to them.
  *	The open() function will actually kick the board off.
  */
- 
+
 static int __init wdtpci_init(void)
 {
 	int rc = pci_register_driver (&wdtpci_driver);
-	
+
 	if (rc < 1)
 		return -ENODEV;
-	
+
 	return 0;
 }
 
diff -Nru a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
--- a/drivers/cpufreq/cpufreq.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/cpufreq/cpufreq.c	Tue Feb  3 19:45:17 2004
@@ -868,7 +868,7 @@
 	down(&data->lock);
 
 	memcpy(&policy, 
-	       &data, 
+	       data,
 	       sizeof(struct cpufreq_policy));
 	policy.min = data->user_policy.min;
 	policy.max = data->user_policy.max;
diff -Nru a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
--- a/drivers/i2c/Kconfig	Tue Feb  3 19:45:17 2004
+++ b/drivers/i2c/Kconfig	Tue Feb  3 19:45:17 2004
@@ -37,9 +37,35 @@
 	  This support is also available as a module.  If so, the module 
 	  will be called i2c-dev.
 
-	source drivers/i2c/algos/Kconfig
-	source drivers/i2c/busses/Kconfig
-	source drivers/i2c/chips/Kconfig
+source drivers/i2c/algos/Kconfig
+source drivers/i2c/busses/Kconfig
+source drivers/i2c/chips/Kconfig
+
+config I2C_DEBUG_CORE
+	bool "I2C Core debugging messages"
+	depends on I2C
+	help
+	  Say Y here if you want the I2C core to produce a bunch of debug
+	  messages to the system log.  Select this if you are having a
+	  problem with I2C support and want to see more of what is going on.
+
+config I2C_DEBUG_BUS
+	bool "I2C Bus debugging messages"
+	depends on I2C
+	help
+	  Say Y here if you want the I2C bus drivers to produce a bunch of
+	  debug messages to the system log.  Select this if you are having
+	  a problem with I2C support and want to see more of what is going
+	  on.
+
+config I2C_DEBUG_CHIP
+	bool "I2C Chip debugging messages"
+	depends on I2C
+	help
+	  Say Y here if you want the I2C chip drivers to produce a bunch of
+	  debug messages to the system log.  Select this if you are having
+	  a problem with I2C support and want to see more of what is going
+	  on.
 
 endmenu
 
diff -Nru a/drivers/i2c/algos/Kconfig b/drivers/i2c/algos/Kconfig
--- a/drivers/i2c/algos/Kconfig	Tue Feb  3 19:45:41 2004
+++ b/drivers/i2c/algos/Kconfig	Tue Feb  3 19:45:41 2004
@@ -3,6 +3,7 @@
 #
 
 menu "I2C Algorithms"
+	depends on I2C
 
 config I2C_ALGOBIT
 	tristate "I2C bit-banging interfaces"
diff -Nru a/drivers/i2c/algos/i2c-algo-pcf.h b/drivers/i2c/algos/i2c-algo-pcf.h
--- a/drivers/i2c/algos/i2c-algo-pcf.h	Tue Feb  3 19:45:16 2004
+++ b/drivers/i2c/algos/i2c-algo-pcf.h	Tue Feb  3 19:45:16 2004
@@ -21,8 +21,6 @@
 
 /* With some changes from Frodo Looijaard <frodol@dds.nl> */
 
-/* $Id: i2c-pcf8584.h,v 1.3 2000/01/18 23:54:07 frodo Exp $ */
-
 #ifndef I2C_PCF8584_H
 #define I2C_PCF8584_H 1
 
diff -Nru a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
--- a/drivers/i2c/busses/Kconfig	Tue Feb  3 19:45:41 2004
+++ b/drivers/i2c/busses/Kconfig	Tue Feb  3 19:45:41 2004
@@ -3,6 +3,7 @@
 #
 
 menu "I2C Hardware Bus support"
+	depends on I2C
 
 config I2C_ALI1535
 	tristate "ALI 1535"
@@ -48,7 +49,8 @@
 
 config I2C_ELEKTOR
 	tristate "Elektor ISA card"
-	depends on I2C_ALGOPCF && BROKEN_ON_SMP
+	depends on I2C && ISA && BROKEN_ON_SMP
+	select I2C_ALGOPCF
 	help
 	  This supports the PCF8584 ISA bus I2C adapter.  Say Y if you own
 	  such an adapter.
@@ -58,7 +60,8 @@
 
 config I2C_ELV
 	tristate "ELV adapter"
-	depends on I2C_ALGOBIT && ISA
+	depends on I2C
+	select I2C_ALGOBIT
 	help
 	  This supports parallel-port I2C adapters called ELV.  Say Y if you
 	  own such an adapter.
@@ -72,19 +75,21 @@
 	help
 	  If you say yes to this option, support will be included for the Intel
 	  801 family of mainboard I2C interfaces.  Specifically, the following
-	  versions of the chipset is supported:
+	  versions of the chipset are supported:
 	    82801AA
 	    82801AB
 	    82801BA
 	    82801CA/CAM
 	    82801DB
+	    82801EB
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called i2c-i801.
 
 config I2C_I810
 	tristate "Intel 810/815"
-	depends on I2C_ALGOBIT && PCI && EXPERIMENTAL
+	depends on I2C && PCI && EXPERIMENTAL
+	select I2C_ALGOBIT
 	help
 	  If you say yes to this option, support will be included for the Intel
 	  810/815 family of mainboard I2C interfaces.  Specifically, the 
@@ -107,7 +112,7 @@
 
 config I2C_ISA
 	tristate "ISA Bus support"
-	depends on I2C && ISA && EXPERIMENTAL
+	depends on I2C && EXPERIMENTAL
 	help
 	  If you say yes to this option, support will be included for i2c
 	  interfaces that are on the ISA bus.
@@ -117,7 +122,8 @@
 
 config I2C_ITE
 	tristate "ITE I2C Adapter"
-	depends on I2C_ALGOITE
+	depends on I2C && MIPS_ITE8172
+	select I2C_ALGOITE
 	help
 	  This supports the ITE8172 I2C peripheral found on some MIPS
 	  systems. Say Y if you have one of these. You should also say Y for
@@ -148,13 +154,59 @@
 
 config I2C_PHILIPSPAR
 	tristate "Philips style parallel port adapter"
-	depends on I2C_ALGOBIT && PARPORT
+	depends on I2C && PARPORT
+	select I2C_ALGOBIT
 	help
 	  This supports parallel-port I2C adapters made by Philips.
 
 	  This support is also available as a module.  If so, the module 
 	  will be called i2c-philips-par.
 
+config I2C_PARPORT
+	tristate "Parallel port adapter"
+	depends on I2C && PARPORT
+	select I2C_ALGOBIT
+	help
+	  This supports parallel port I2C adapters such as the ones made by
+	  Philips or Velleman, Analog Devices evaluation boards, and more.
+	  Basically any adapter using the parallel port as an I2C bus with
+	  no extra chipset is supported by this driver, or could be.
+
+	  This driver is a replacement for (and was inspired by) an older
+	  driver named i2c-philips-par.  The new driver supports more devices,
+	  and makes it easier to add support for new devices.
+	  
+	  Another driver exists, named i2c-parport-light, which doesn't depend
+	  on the parport driver.  This is meant for embedded systems. Don't say
+	  Y here if you intend to say Y or M there.
+
+	  This support is also available as a module.  If so, the module 
+	  will be called i2c-parport.
+
+config I2C_PARPORT_LIGHT
+	tristate "Parallel port adapter (light)"
+	depends on I2C
+	select I2C_ALGOBIT
+	help
+	  This supports parallel port I2C adapters such as the ones made by
+	  Philips or Velleman, Analog Devices evaluation boards, and more.
+	  Basically any adapter using the parallel port as an I2C bus with
+	  no extra chipset is supported by this driver, or could be.
+
+	  This driver is a light version of i2c-parport.  It doesn't depend
+	  on the parport driver, and uses direct I/O access instead.  This
+	  might be prefered on embedded systems where wasting memory for
+	  the clean but heavy parport handling is not an option.  The
+	  drawback is a reduced portability and the impossibility to
+	  dasiy-chain other parallel port devices.
+	  
+	  Don't say Y here if you said Y or M to i2c-parport.  Saying M to
+	  both is possible but both modules should not be loaded at the same
+	  time.
+
+	  This support is also available as a module.  If so, the module 
+	  will be called i2c-parport-light.
+
 config I2C_PIIX4
 	tristate "Intel PIIX4"
 	depends on I2C && PCI && EXPERIMENTAL && !64BIT
@@ -174,7 +226,8 @@
 
 config I2C_PROSAVAGE
 	tristate "S3/VIA (Pro)Savage"
-	depends on I2C_ALGOBIT && PCI && EXPERIMENTAL
+	depends on I2C && PCI && EXPERIMENTAL
+	select I2C_ALGOBIT
 	help
 	  If you say yes to this option, support will be included for the
 	  I2C bus and DDC bus of the S3VIA embedded Savage4 and ProSavage8
@@ -187,12 +240,14 @@
 	  will be called i2c-prosavage.
 
 config I2C_RPXLITE
-	tristate "Embedded Planet RPX Lite/Classic suppoort"
-	depends on (RPXLITE || RPXCLASSIC) && I2C_ALGO8XX
+	tristate "Embedded Planet RPX Lite/Classic support"
+	depends on (RPXLITE || RPXCLASSIC) && I2C
+	select I2C_ALGO8XX
 
 config I2C_SAVAGE4
 	tristate "S3 Savage 4"
-	depends on I2C_ALGOBIT && PCI && EXPERIMENTAL
+	depends on I2C && PCI && EXPERIMENTAL
+	select I2C_ALGOBIT
 	help
 	  If you say yes to this option, support will be included for the 
 	  S3 Savage 4 I2C interface.
@@ -202,7 +257,8 @@
 
 config SCx200_I2C
 	tristate "NatSemi SCx200 I2C using GPIO pins"
-	depends on SCx200_GPIO && I2C_ALGOBIT
+	depends on SCx200_GPIO && I2C
+	select I2C_ALGOBIT
 	help
 	  Enable the use of two GPIO pins of a SCx200 processor as an I2C bus.
 
@@ -277,7 +333,8 @@
 
 config I2C_VELLEMAN
 	tristate "Velleman K8000 adapter"
-	depends on I2C_ALGOBIT && ISA
+	depends on I2C
+	select I2C_ALGOBIT
 	help
 	  This supports the Velleman K8000 parallel-port I2C adapter.  Say Y
 	  if you own such an adapter.
@@ -287,7 +344,8 @@
 
 config I2C_VIA
 	tristate "VIA 82C586B"
-	depends on I2C_ALGOBIT && PCI && EXPERIMENTAL
+	depends on I2C && PCI && EXPERIMENTAL
+	select I2C_ALGOBIT
 	help
 
 	  If you say yes to this option, support will be included for the VIA
@@ -317,7 +375,8 @@
 
 config I2C_VOODOO3
 	tristate "Voodoo 3"
-	depends on I2C_ALGOBIT && PCI && EXPERIMENTAL
+	depends on I2C && PCI && EXPERIMENTAL
+	select I2C_ALGOBIT
 	help
 
 	  If you say yes to this option, support will be included for the
diff -Nru a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
--- a/drivers/i2c/busses/Makefile	Tue Feb  3 19:45:16 2004
+++ b/drivers/i2c/busses/Makefile	Tue Feb  3 19:45:16 2004
@@ -17,6 +17,8 @@
 obj-$(CONFIG_I2C_KEYWEST)	+= i2c-keywest.o
 obj-$(CONFIG_I2C_NFORCE2)	+= i2c-nforce2.o
 obj-$(CONFIG_I2C_PHILIPSPAR)	+= i2c-philips-par.o
+obj-$(CONFIG_I2C_PARPORT)	+= i2c-parport.o
+obj-$(CONFIG_I2C_PARPORT_LIGHT)	+= i2c-parport-light.o
 obj-$(CONFIG_I2C_PIIX4)		+= i2c-piix4.o
 obj-$(CONFIG_I2C_PROSAVAGE)	+= i2c-prosavage.o
 obj-$(CONFIG_I2C_RPXLITE)	+= i2c-rpx.o
diff -Nru a/drivers/i2c/busses/i2c-ali1535.c b/drivers/i2c/busses/i2c-ali1535.c
--- a/drivers/i2c/busses/i2c-ali1535.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/i2c/busses/i2c-ali1535.c	Tue Feb  3 19:45:41 2004
@@ -53,7 +53,10 @@
 
 /* Note: we assume there can only be one ALI1535, with one SMBus interface */
 
-/* #define DEBUG 1 */
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
 
 #include <linux/module.h>
 #include <linux/pci.h>
diff -Nru a/drivers/i2c/busses/i2c-ali15x3.c b/drivers/i2c/busses/i2c-ali15x3.c
--- a/drivers/i2c/busses/i2c-ali15x3.c	Tue Feb  3 19:45:27 2004
+++ b/drivers/i2c/busses/i2c-ali15x3.c	Tue Feb  3 19:45:27 2004
@@ -60,7 +60,10 @@
 
 /* Note: we assume there can only be one ALI15X3, with one SMBus interface */
 
-/* #define DEBUG 1 */
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
 
 #include <linux/module.h>
 #include <linux/pci.h>
diff -Nru a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c
--- a/drivers/i2c/busses/i2c-amd756.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/i2c/busses/i2c-amd756.c	Tue Feb  3 19:45:41 2004
@@ -37,7 +37,10 @@
    Note: we assume there can only be one device, with one SMBus interface.
 */
 
-/* #define DEBUG 1 */
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
 
 #include <linux/module.h>
 #include <linux/pci.h>
diff -Nru a/drivers/i2c/busses/i2c-amd8111.c b/drivers/i2c/busses/i2c-amd8111.c
--- a/drivers/i2c/busses/i2c-amd8111.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/i2c/busses/i2c-amd8111.c	Tue Feb  3 19:45:41 2004
@@ -8,6 +8,11 @@
  * the Free Software Foundation version 2.
  */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
diff -Nru a/drivers/i2c/busses/i2c-elektor.c b/drivers/i2c/busses/i2c-elektor.c
--- a/drivers/i2c/busses/i2c-elektor.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/i2c/busses/i2c-elektor.c	Tue Feb  3 19:45:16 2004
@@ -25,6 +25,11 @@
 /* Partialy rewriten by Oleg I. Vdovikin for mmapped support of 
    for Alpha Processor Inc. UP-2000(+) boards */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
 #include <linux/kernel.h>
 #include <linux/ioport.h>
 #include <linux/module.h>
@@ -50,7 +55,6 @@
 static int clock  = 0x1c;
 static int own    = 0x55;
 static int mmapped;
-static int i2c_debug;
 
 /* vdovikin: removed static struct i2c_pcf_isa gpi; code - 
   this module in real supports only one device, due to missing arguments
@@ -60,12 +64,6 @@
 static wait_queue_head_t pcf_wait;
 static int pcf_pending;
 
-/* ----- global defines -----------------------------------------------	*/
-#define DEB(x)	if (i2c_debug>=1) x
-#define DEB2(x) if (i2c_debug>=2) x
-#define DEB3(x) if (i2c_debug>=3) x
-#define DEBE(x)	x	/* error messages 				*/
-
 /* ----- local functions ----------------------------------------------	*/
 
 static void pcf_isa_setbyte(void *data, int ctl, int val)
@@ -77,7 +75,7 @@
 		val |= I2C_PCF_ENI;
 	}
 
-	DEB3(printk(KERN_DEBUG "i2c-elektor: Write 0x%X 0x%02X\n", address, val & 255));
+	pr_debug("i2c-elektor: Write 0x%X 0x%02X\n", address, val & 255);
 
 	switch (mmapped) {
 	case 0: /* regular I/O */
@@ -98,7 +96,7 @@
 	int address = ctl ? (base + 1) : base;
 	int val = mmapped ? readb(address) : inb(address);
 
-	DEB3(printk(KERN_DEBUG "i2c-elektor: Read 0x%X 0x%02X\n", address, val));
+	pr_debug("i2c-elektor: Read 0x%X 0x%02X\n", address, val);
 
 	return (val);
 }
@@ -196,7 +194,7 @@
 			/* yeap, we've found cypress, let's check config */
 			if (!pci_read_config_byte(cy693_dev, 0x47, &config)) {
 				
-				DEB3(printk(KERN_DEBUG "i2c-elektor: found cy82c693, config register 0x47 = 0x%02x.\n", config));
+				pr_debug("i2c-elektor: found cy82c693, config register 0x47 = 0x%02x.\n", config);
 
 				/* UP2000 board has this register set to 0xe1,
                                    but the most significant bit as seems can be 
@@ -280,7 +278,6 @@
 MODULE_PARM(clock, "i");
 MODULE_PARM(own, "i");
 MODULE_PARM(mmapped, "i");
-MODULE_PARM(i2c_debug, "i");
 
 module_init(i2c_pcfisa_init);
 module_exit(i2c_pcfisa_exit);
diff -Nru a/drivers/i2c/busses/i2c-elv.c b/drivers/i2c/busses/i2c-elv.c
--- a/drivers/i2c/busses/i2c-elv.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/i2c/busses/i2c-elv.c	Tue Feb  3 19:45:41 2004
@@ -21,6 +21,11 @@
 /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
    Frodo Looijaard <frodol@dds.nl> */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/delay.h>
@@ -36,12 +41,6 @@
 static int base=0;
 static unsigned char port_data = 0;
 
-/* ----- global defines -----------------------------------------------	*/
-#define DEB(x)		/* should be reasonable open, close &c. 	*/
-#define DEB2(x) 	/* low level debugging - very slow 		*/
-#define DEBE(x)	x	/* error messages 				*/
-#define DEBINIT(x) x	/* detection status messages			*/
-
 /* --- Convenience defines for the parallel port:			*/
 #define BASE	(unsigned int)(data)
 #define DATA	BASE			/* Centronics data port		*/
@@ -89,7 +88,7 @@
 		return -ENODEV;
 
 	if (inb(base+1) & 0x80) {	/* BUSY should be high	*/
-		DEBINIT(printk(KERN_DEBUG "i2c-elv.o: Busy was low.\n"));
+		pr_debug("i2c-elv: Busy was low.\n");
 		goto fail;
 	} 
 
@@ -97,7 +96,7 @@
 	udelay(400);
 	if (!(inb(base+1) && 0x10)) {
 		outb(0x04,base+2);
-		DEBINIT(printk(KERN_DEBUG "i2c-elv.o: Select was high.\n"));
+		pr_debug("i2c-elv: Select was high.\n");
 		goto fail;
 	}
 
@@ -153,7 +152,7 @@
 			return -ENODEV;
 		}
 	}
-	printk(KERN_DEBUG "i2c-elv.o: found device at %#x.\n",base);
+	pr_debug("i2c-elv: found device at %#x.\n",base);
 	return 0;
 }
 
diff -Nru a/drivers/i2c/busses/i2c-frodo.c b/drivers/i2c/busses/i2c-frodo.c
--- a/drivers/i2c/busses/i2c-frodo.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/i2c/busses/i2c-frodo.c	Tue Feb  3 19:45:16 2004
@@ -12,6 +12,11 @@
  * version 2 as published by the Free Software Foundation.
  */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
diff -Nru a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
--- a/drivers/i2c/busses/i2c-i801.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/i2c/busses/i2c-i801.c	Tue Feb  3 19:45:18 2004
@@ -38,7 +38,10 @@
 
 /* Note: we assume there can only be one I801, with one SMBus interface */
 
-/* #define DEBUG 1 */
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
 
 #include <linux/module.h>
 #include <linux/pci.h>
diff -Nru a/drivers/i2c/busses/i2c-i810.c b/drivers/i2c/busses/i2c-i810.c
--- a/drivers/i2c/busses/i2c-i810.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/i2c/busses/i2c-i810.c	Tue Feb  3 19:45:17 2004
@@ -34,6 +34,11 @@
    i815			1132           
 */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
diff -Nru a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
--- a/drivers/i2c/busses/i2c-ibm_iic.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/i2c/busses/i2c-ibm_iic.c	Tue Feb  3 19:45:34 2004
@@ -27,6 +27,12 @@
  * option) any later version.
  *
  */
+
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
@@ -601,7 +607,7 @@
 	
 	/* Register it with i2c layer */
 	adap = &dev->adap;
-	strcpy(adap->dev.name, "IBM IIC");
+	strcpy(adap->name, "IBM IIC");
 	i2c_set_adapdata(adap, dev);
 	adap->id = I2C_HW_OCP | iic_algo.id;
 	adap->algo = &iic_algo;
diff -Nru a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c
--- a/drivers/i2c/busses/i2c-iop3xx.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/i2c/busses/i2c-iop3xx.c	Tue Feb  3 19:45:28 2004
@@ -31,6 +31,10 @@
 
   ---------------------------------------------------------------------------*/
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
 
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
@@ -529,8 +533,3 @@
 MODULE_AUTHOR("D-TACQ Solutions Ltd <www.d-tacq.com>");
 MODULE_DESCRIPTION("IOP3xx iic algorithm and driver");
 MODULE_LICENSE("GPL");
-
-MODULE_PARM(i2c_debug,"i");
-
-MODULE_PARM_DESC(i2c_debug, "debug level - 0 off; 1 normal; 2,3 more verbose; 9 iic-protocol");
-
diff -Nru a/drivers/i2c/busses/i2c-isa.c b/drivers/i2c/busses/i2c-isa.c
--- a/drivers/i2c/busses/i2c-isa.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/i2c/busses/i2c-isa.c	Tue Feb  3 19:45:29 2004
@@ -24,6 +24,11 @@
    the SMBus and the ISA bus very much easier. See lm78.c for an example
    of this. */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
diff -Nru a/drivers/i2c/busses/i2c-ite.c b/drivers/i2c/busses/i2c-ite.c
--- a/drivers/i2c/busses/i2c-ite.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/i2c/busses/i2c-ite.c	Tue Feb  3 19:45:17 2004
@@ -33,6 +33,11 @@
 /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
    Frodo Looijaard <frodol@dds.nl> */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
 #include <linux/kernel.h>
 #include <linux/ioport.h>
 #include <linux/module.h>
@@ -58,26 +63,21 @@
 static int clock = 0;
 static int own   = 0;
 
-static int i2c_debug=0;
 static struct iic_ite gpi;
 static wait_queue_head_t iic_wait;
 static int iic_pending;
 
-/* ----- global defines -----------------------------------------------	*/
-#define DEB(x)	if (i2c_debug>=1) x
-#define DEB2(x) if (i2c_debug>=2) x
-#define DEB3(x) if (i2c_debug>=3) x
-#define DEBE(x)	x	/* error messages 				*/
-
-
 /* ----- local functions ----------------------------------------------	*/
 
 static void iic_ite_setiic(void *data, int ctl, short val)
 {
         unsigned long j = jiffies + 10;
 
-	DEB3(printk(" Write 0x%02x to 0x%x\n",(unsigned short)val, ctl&0xff));
-	DEB3({while (time_before(jiffies, j)) schedule();})
+	pr_debug(" Write 0x%02x to 0x%x\n",(unsigned short)val, ctl&0xff);
+#ifdef DEBUG
+	while (time_before(jiffies, j))
+		schedule();
+#endif
 	outw(val,ctl);
 }
 
@@ -86,7 +86,7 @@
 	short val;
 
 	val = inw(ctl);
-	DEB3(printk("Read 0x%02x from 0x%x\n",(unsigned short)val, ctl&0xff));  
+	pr_debug("Read 0x%02x from 0x%x\n",(unsigned short)val, ctl&0xff);
 	return (val);
 }
 
@@ -145,7 +145,6 @@
 	
    iic_pending = 1;
 
-   DEB2(printk("iic_ite_handler: in interrupt handler\n"));
    wake_up_interruptible(&iic_wait);
 }
 
@@ -263,7 +262,6 @@
 MODULE_PARM(irq, "i");
 MODULE_PARM(clock, "i");
 MODULE_PARM(own, "i");
-MODULE_PARM(i2c_debug,"i");
 
 
 /* Called when module is loaded or when kernel is initialized.
diff -Nru a/drivers/i2c/busses/i2c-keywest.c b/drivers/i2c/busses/i2c-keywest.c
--- a/drivers/i2c/busses/i2c-keywest.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/i2c/busses/i2c-keywest.c	Tue Feb  3 19:45:34 2004
@@ -43,6 +43,11 @@
     sound driver to be happy
 */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
 #include <linux/module.h>
 #include <linux/config.h>
 #include <linux/kernel.h>
@@ -65,20 +70,13 @@
 
 #include "i2c-keywest.h"
 
-#define DBG(x...) do {\
-	if (debug > 0) \
-		printk(KERN_DEBUG "KW:" x); \
-	} while(0)
-
 
 MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>");
 MODULE_DESCRIPTION("I2C driver for Apple's Keywest");
 MODULE_LICENSE("GPL");
 MODULE_PARM(probe, "i");
-MODULE_PARM(debug, "i");
 
-int probe = 0;
-int debug = 0;
+static int probe = 0;
 
 static void
 do_stop(struct keywest_iface* iface, int result)
@@ -95,7 +93,7 @@
 	int ack;
 	int rearm_timer = 1;
 	
-	DBG("handle_interrupt(), got: %x, status: %x, state: %d\n",
+	pr_debug("handle_interrupt(), got: %x, status: %x, state: %d\n",
 		isr, read_reg(reg_status), iface->state);
 	if (isr == 0 && iface->state != state_stop) {
 		do_stop(iface, -1);
@@ -112,7 +110,7 @@
 			break;
 		}
 		ack = read_reg(reg_status);
-		DBG("ack on set address: %x\n", ack);
+		pr_debug("ack on set address: %x\n", ack);
 		if ((ack & KW_I2C_STAT_LAST_AAK) == 0) {
 			do_stop(iface, -1);
 			break;
@@ -127,7 +125,7 @@
 					| KW_I2C_CTL_AAK);
 		} else {
 			iface->state = state_write;
-			DBG("write byte: %x\n", *(iface->data));
+			pr_debug("write byte: %x\n", *(iface->data));
 			write_reg(reg_data, *(iface->data++));
 			iface->datalen--;
 		}
@@ -139,7 +137,7 @@
 			break;
 		}
 		*(iface->data++) = read_reg(reg_data);
-		DBG("read byte: %x\n", *(iface->data-1));
+		pr_debug("read byte: %x\n", *(iface->data-1));
 		iface->datalen--;
 		if (iface->datalen == 0)
 			iface->state = state_stop;
@@ -153,13 +151,13 @@
 		}
 		/* Check ack status */
 		ack = read_reg(reg_status);
-		DBG("ack on data write: %x\n", ack);
+		pr_debug("ack on data write: %x\n", ack);
 		if ((ack & KW_I2C_STAT_LAST_AAK) == 0) {
 			do_stop(iface, -1);
 			break;
 		}
 		if (iface->datalen) {
-			DBG("write byte: %x\n", *(iface->data));
+			pr_debug("write byte: %x\n", *(iface->data));
 			write_reg(reg_data, *(iface->data++));
 			iface->datalen--;
 		} else
@@ -203,7 +201,7 @@
 {
 	struct keywest_iface *iface = (struct keywest_iface *)data;
 
-	DBG("timeout !\n");
+	pr_debug("timeout !\n");
 	spin_lock_irq(&iface->lock);
 	if (handle_interrupt(iface, read_reg(reg_isr)))
 		mod_timer(&iface->timeout_timer, jiffies + POLL_TIMEOUT);
@@ -271,7 +269,7 @@
 
 	down(&iface->sem);
 
-	DBG("chan: %d, addr: 0x%x, transfer len: %d, read: %d\n",
+	pr_debug("chan: %d, addr: 0x%x, transfer len: %d, read: %d\n",
 		chan->chan_no, addr, len, read_write == I2C_SMBUS_READ);
 
 	iface->data = buffer;
@@ -306,7 +304,7 @@
 	wait_for_completion(&iface->complete);	
 
 	rc = iface->result;	
-	DBG("transfer done, result: %d\n", rc);
+	pr_debug("transfer done, result: %d\n", rc);
 
 	if (rc == 0 && size == I2C_SMBUS_WORD_DATA && read_write == I2C_SMBUS_READ)
 	    	data->word = le16_to_cpu(cur_word);
@@ -348,7 +346,7 @@
 			rc = -EINVAL;
 			break;
 		}
-		DBG("xfer: chan: %d, doing %s %d bytes to 0x%02x - %d of %d messages\n",
+		pr_debug("xfer: chan: %d, doing %s %d bytes to 0x%02x - %d of %d messages\n",
 		     chan->chan_no,
 		     pmsg->flags & I2C_M_RD ? "read" : "write",
                      pmsg->len, addr, i, num);
@@ -388,7 +386,7 @@
 		rc = iface->result;
 		if (rc == 0)
 			completed++;
-		DBG("transfer done, result: %d\n", rc);
+		pr_debug("transfer done, result: %d\n", rc);
 	}
 
 	/* Release sem */
diff -Nru a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c
--- a/drivers/i2c/busses/i2c-nforce2.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/i2c/busses/i2c-nforce2.c	Tue Feb  3 19:45:17 2004
@@ -32,6 +32,11 @@
 
 /* Note: we assume there can only be one nForce2, with two SMBus interfaces */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
diff -Nru a/drivers/i2c/busses/i2c-parport-light.c b/drivers/i2c/busses/i2c-parport-light.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/i2c/busses/i2c-parport-light.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,179 @@
+/* ------------------------------------------------------------------------ *
+ * i2c-parport.c I2C bus over parallel port                                 *
+ * ------------------------------------------------------------------------ *
+   Copyright (C) 2003-2004 Jean Delvare <khali@linux-fr.org>
+   
+   Based on older i2c-velleman.c driver
+   Copyright (C) 1995-2000 Simon G. Vogl
+   With some changes from:
+   Frodo Looijaard <frodol@dds.nl>
+   Kyösti Mälkki <kmalkki@cc.hut.fi>
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * ------------------------------------------------------------------------ */
+
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/i2c.h>
+#include <linux/i2c-algo-bit.h>
+#include <asm/io.h>
+#include "i2c-parport.h"
+
+#define DEFAULT_BASE 0x378
+
+static int base;
+MODULE_PARM(base, "i");
+MODULE_PARM_DESC(base, "Base I/O address");
+
+/* ----- Low-level parallel port access ----------------------------------- */
+
+static inline void port_write(unsigned char p, unsigned char d)
+{
+	outb(d, base+p);
+}
+
+static inline unsigned char port_read(unsigned char p)
+{
+	return inb(base+p);
+}
+
+/* ----- Unified line operation functions --------------------------------- */
+
+static inline void line_set(int state, const struct lineop *op)
+{
+	u8 oldval = port_read(op->port);
+
+	/* Touch only the bit(s) needed */
+	if ((op->inverted && !state) || (!op->inverted && state))
+		port_write(op->port, oldval | op->val);
+	else
+		port_write(op->port, oldval & ~op->val);
+}
+
+static inline int line_get(const struct lineop *op)
+{
+	u8 oldval = port_read(op->port);
+
+	return ((op->inverted && (oldval & op->val) != op->val)
+	    || (!op->inverted && (oldval & op->val) == op->val));
+}
+
+/* ----- I2C algorithm call-back functions and structures ----------------- */
+
+static void parport_setscl(void *data, int state)
+{
+	line_set(state, &adapter_parm[type].setscl);
+}
+
+static void parport_setsda(void *data, int state)
+{
+	line_set(state, &adapter_parm[type].setsda);
+}
+
+static int parport_getscl(void *data)
+{
+	return line_get(&adapter_parm[type].getscl);
+}
+
+static int parport_getsda(void *data)
+{
+	return line_get(&adapter_parm[type].getsda);
+}
+
+/* Encapsulate the functions above in the correct structure
+   Note that getscl will be set to NULL by the attaching code for adapters
+   that cannot read SCL back */
+static struct i2c_algo_bit_data parport_algo_data = {
+	.setsda		= parport_setsda,
+	.setscl		= parport_setscl,
+	.getsda		= parport_getsda,
+	.getscl		= parport_getscl,
+	.udelay		= 50,
+	.mdelay		= 50,
+	.timeout	= HZ,
+}; 
+
+/* ----- I2c structure ---------------------------------------------------- */
+
+static struct i2c_adapter parport_adapter = {
+	.owner		= THIS_MODULE,
+	.class		= I2C_ADAP_CLASS_SMBUS,
+	.id		= I2C_HW_B_LP,
+	.algo_data	= &parport_algo_data,
+	.name		= "Parallel port adapter (light)",
+};
+
+/* ----- Module loading, unloading and information ------------------------ */
+
+static int __init i2c_parport_init(void)
+{
+	int type_count;
+
+	type_count = sizeof(adapter_parm)/sizeof(struct adapter_parm);
+	if (type < 0 || type >= type_count) {
+		printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type);
+		type = 0;
+	}
+	
+	if (base == 0) {
+		printk(KERN_INFO "i2c-parport: using default base 0x%x\n", DEFAULT_BASE);
+		base = DEFAULT_BASE;
+	}
+
+	if (!request_region(base, 3, "i2c-parport"))
+		return -ENODEV;
+
+        if (!adapter_parm[type].getscl.val)
+		parport_algo_data.getscl = NULL;
+
+	/* Reset hardware to a sane state (SCL and SDA high) */
+	parport_setsda(NULL, 1);
+	parport_setscl(NULL, 1);
+	/* Other init if needed (power on...) */
+	if (adapter_parm[type].init.val)
+		line_set(1, &adapter_parm[type].init);
+
+	if (i2c_bit_add_bus(&parport_adapter) < 0) {
+		printk(KERN_ERR "i2c-parport: Unable to register with I2C\n");
+		release_region(base, 3);
+		return -ENODEV;
+	}
+	
+	return 0;
+}
+
+static void __exit i2c_parport_exit(void)
+{
+	/* Un-init if needed (power off...) */
+	if (adapter_parm[type].init.val)
+		line_set(0, &adapter_parm[type].init);
+
+	i2c_bit_del_bus(&parport_adapter);
+	release_region(base, 3);
+}
+
+MODULE_AUTHOR("Jean Delvare <khali@linux-fr.org>");
+MODULE_DESCRIPTION("I2C bus over parallel port (light)");
+MODULE_LICENSE("GPL");
+
+module_init(i2c_parport_init);
+module_exit(i2c_parport_exit);
diff -Nru a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/i2c/busses/i2c-parport.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,271 @@
+/* ------------------------------------------------------------------------ *
+ * i2c-parport.c I2C bus over parallel port                                 *
+ * ------------------------------------------------------------------------ *
+   Copyright (C) 2003-2004 Jean Delvare <khali@linux-fr.org>
+   
+   Based on older i2c-philips-par.c driver
+   Copyright (C) 1995-2000 Simon G. Vogl
+   With some changes from:
+   Frodo Looijaard <frodol@dds.nl>
+   Kyösti Mälkki <kmalkki@cc.hut.fi>
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * ------------------------------------------------------------------------ */
+
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/parport.h>
+#include <linux/i2c.h>
+#include <linux/i2c-algo-bit.h>
+#include "i2c-parport.h"
+
+/* ----- Device list ------------------------------------------------------ */
+
+struct i2c_par {
+	struct pardevice *pdev;
+	struct i2c_adapter adapter;
+	struct i2c_algo_bit_data algo_data;
+	struct i2c_par *next;
+};
+
+static struct i2c_par *adapter_list;
+
+/* ----- Low-level parallel port access ----------------------------------- */
+
+static void port_write_data(struct parport *p, unsigned char d)
+{
+	parport_write_data(p, d);
+}
+
+static void port_write_control(struct parport *p, unsigned char d)
+{
+	parport_write_control(p, d);
+}
+
+static unsigned char port_read_data(struct parport *p)
+{
+	return parport_read_data(p);
+}
+
+static unsigned char port_read_status(struct parport *p)
+{
+	return parport_read_status(p);
+}
+
+static unsigned char port_read_control(struct parport *p)
+{
+	return parport_read_control(p);
+}
+
+static void (*port_write[])(struct parport *, unsigned char) = {
+	port_write_data,
+	NULL,
+	port_write_control,
+};
+
+static unsigned char (*port_read[])(struct parport *) = {
+	port_read_data,
+	port_read_status,
+	port_read_control,
+};
+
+/* ----- Unified line operation functions --------------------------------- */
+
+static inline void line_set(struct parport *data, int state,
+	const struct lineop *op)
+{
+	u8 oldval = port_read[op->port](data);
+
+	/* Touch only the bit(s) needed */
+	if ((op->inverted && !state) || (!op->inverted && state))
+		port_write[op->port](data, oldval | op->val);
+	else
+		port_write[op->port](data, oldval & ~op->val);
+}
+
+static inline int line_get(struct parport *data,
+	const struct lineop *op)
+{
+	u8 oldval = port_read[op->port](data);
+
+	return ((op->inverted && (oldval & op->val) != op->val)
+	    || (!op->inverted && (oldval & op->val) == op->val));
+}
+
+/* ----- I2C algorithm call-back functions and structures ----------------- */
+
+static void parport_setscl(void *data, int state)
+{
+	line_set((struct parport *) data, state, &adapter_parm[type].setscl);
+}
+
+static void parport_setsda(void *data, int state)
+{
+	line_set((struct parport *) data, state, &adapter_parm[type].setsda);
+}
+
+static int parport_getscl(void *data)
+{
+	return line_get((struct parport *) data, &adapter_parm[type].getscl);
+}
+
+static int parport_getsda(void *data)
+{
+	return line_get((struct parport *) data, &adapter_parm[type].getsda);
+}
+
+/* Encapsulate the functions above in the correct structure.
+   Note that this is only a template, from which the real structures are
+   copied. The attaching code will set getscl to NULL for adapters that
+   cannot read SCL back, and will also make the the data field point to
+   the parallel port structure. */
+static struct i2c_algo_bit_data parport_algo_data = {
+	.setsda		= parport_setsda,
+	.setscl		= parport_setscl,
+	.getsda		= parport_getsda,
+	.getscl		= parport_getscl,
+	.udelay		= 60,
+	.mdelay		= 60,
+	.timeout	= HZ,
+}; 
+
+/* ----- I2c and parallel port call-back functions and structures --------- */
+
+static struct i2c_adapter parport_adapter = {
+	.owner		= THIS_MODULE,
+	.class		= I2C_ADAP_CLASS_SMBUS,
+	.id		= I2C_HW_B_LP,
+	.name		= "Parallel port adapter",
+};
+
+static void i2c_parport_attach (struct parport *port)
+{
+	struct i2c_par *adapter;
+	
+	adapter = kmalloc(sizeof(struct i2c_par), GFP_KERNEL);
+	if (adapter == NULL) {
+		printk(KERN_ERR "i2c-parport: Failed to kmalloc\n");
+		return;
+	}
+	memset(adapter, 0x00, sizeof(struct i2c_par));
+
+	pr_debug("i2c-parport: attaching to %s\n", port->name);
+	adapter->pdev = parport_register_device(port, "i2c-parport",
+		NULL, NULL, NULL, PARPORT_FLAG_EXCL, NULL);
+	if (!adapter->pdev) {
+		printk(KERN_ERR "i2c-parport: Unable to register with parport\n");
+		goto ERROR0;
+	}
+
+	/* Fill the rest of the structure */
+	adapter->adapter = parport_adapter;
+	adapter->algo_data = parport_algo_data;
+	if (!adapter_parm[type].getscl.val)
+		adapter->algo_data.getscl = NULL;
+	adapter->algo_data.data = port;
+	adapter->adapter.algo_data = &adapter->algo_data;
+
+	if (parport_claim_or_block(adapter->pdev) < 0) {
+		printk(KERN_ERR "i2c-parport: Could not claim parallel port\n");
+		goto ERROR1;
+	}
+
+	/* Reset hardware to a sane state (SCL and SDA high) */
+	parport_setsda(port, 1);
+	parport_setscl(port, 1);
+	/* Other init if needed (power on...) */
+	if (adapter_parm[type].init.val)
+		line_set(port, 1, &adapter_parm[type].init);
+
+	parport_release(adapter->pdev);
+
+	if (i2c_bit_add_bus(&adapter->adapter) < 0) {
+		printk(KERN_ERR "i2c-parport: Unable to register with I2C\n");
+		goto ERROR1;
+	}
+
+	/* Add the new adapter to the list */
+	adapter->next = adapter_list;
+	adapter_list = adapter;
+        return;
+
+ERROR1:
+	parport_unregister_device(adapter->pdev);
+ERROR0:
+	kfree(adapter);
+}
+
+static void i2c_parport_detach (struct parport *port)
+{
+	struct i2c_par *adapter, *prev;
+
+	/* Walk the list */
+	for (prev = NULL, adapter = adapter_list; adapter;
+	     prev = adapter, adapter = adapter->next) {
+		if (adapter->pdev->port == port) {
+			/* Un-init if needed (power off...) */
+			if (adapter_parm[type].init.val)
+				line_set(port, 0, &adapter_parm[type].init);
+				
+			i2c_bit_del_bus(&adapter->adapter);
+			parport_unregister_device(adapter->pdev);
+			if (prev)
+				prev->next = adapter->next;
+			else
+				adapter_list = adapter->next;
+			kfree(adapter);
+			return;
+		}
+	}
+}
+
+static struct parport_driver i2c_driver = {
+	.name	= "i2c-parport",
+	.attach	= i2c_parport_attach,
+	.detach	= i2c_parport_detach,
+};
+
+/* ----- Module loading, unloading and information ------------------------ */
+
+static int __init i2c_parport_init(void)
+{
+	int type_count;
+
+	type_count = sizeof(adapter_parm)/sizeof(struct adapter_parm);
+	if (type < 0 || type >= type_count) {
+		printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type);
+		type = 0;
+	}
+	
+	return parport_register_driver(&i2c_driver);
+}
+
+static void __exit i2c_parport_exit(void)
+{
+	parport_unregister_driver(&i2c_driver);
+}
+
+MODULE_AUTHOR("Jean Delvare <khali@linux-fr.org>");
+MODULE_DESCRIPTION("I2C bus over parallel port");
+MODULE_LICENSE("GPL");
+
+module_init(i2c_parport_init);
+module_exit(i2c_parport_exit);
diff -Nru a/drivers/i2c/busses/i2c-parport.h b/drivers/i2c/busses/i2c-parport.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/i2c/busses/i2c-parport.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,88 @@
+/* ------------------------------------------------------------------------ *
+ * i2c-parport.h I2C bus over parallel port                                 *
+ * ------------------------------------------------------------------------ *
+   Copyright (C) 2003-2004 Jean Delvare <khali@linux-fr.org>
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * ------------------------------------------------------------------------ */
+
+#ifdef DATA
+#undef DATA
+#endif
+
+#define DATA	0
+#define STAT	1
+#define CTRL	2
+
+struct lineop {
+	u8 val;
+	u8 port;
+	u8 inverted;
+};
+
+struct adapter_parm {
+	struct lineop setsda;
+	struct lineop setscl;
+	struct lineop getsda;
+	struct lineop getscl;
+	struct lineop init;
+};
+
+static struct adapter_parm adapter_parm[] = {
+	/* type 0: Philips adapter */
+	{
+		.setsda	= { 0x80, DATA, 1 },
+		.setscl	= { 0x08, CTRL, 0 },
+		.getsda	= { 0x80, STAT, 0 },
+		.getscl	= { 0x08, STAT, 0 },
+	},
+	/* type 1: home brew teletext adapter */
+	{
+		.setsda	= { 0x02, DATA, 0 },
+		.setscl	= { 0x01, DATA, 0 },
+		.getsda	= { 0x80, STAT, 1 },
+	},
+	/* type 2: Velleman K8000 adapter */
+	{
+		.setsda	= { 0x02, CTRL, 1 },
+		.setscl	= { 0x08, CTRL, 1 },
+		.getsda	= { 0x10, STAT, 0 },
+	},
+	/* type 3: ELV adapter */
+	{
+		.setsda	= { 0x02, DATA, 1 },
+		.setscl	= { 0x01, DATA, 1 },
+		.getsda	= { 0x40, STAT, 1 },
+		.getscl	= { 0x08, STAT, 1 },
+	},
+	/* type 4: ADM1025 and ADM1032 evaluation boards */
+	{
+		.setsda	= { 0x02, DATA, 1 },
+		.setscl	= { 0x01, DATA, 1 },
+		.getsda	= { 0x10, STAT, 1 },
+		.init	= { 0xf0, DATA, 0 }, /* ADM1025 doesn't need this,
+						but it doesn't hurt */
+	},
+};
+
+static int type;
+MODULE_PARM(type, "i");
+MODULE_PARM_DESC(type,
+	"Type of adapter:\n"
+	" 0 = Philips adapter\n"
+	" 1 = home brew teletext adapter\n"
+	" 2 = Velleman K8000 adapter\n"
+	" 3 = ELV adapter\n"
+	" 4 = ADM1025 and ADM1032 evaluation boards\n");
diff -Nru a/drivers/i2c/busses/i2c-philips-par.c b/drivers/i2c/busses/i2c-philips-par.c
--- a/drivers/i2c/busses/i2c-philips-par.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/i2c/busses/i2c-philips-par.c	Tue Feb  3 19:45:17 2004
@@ -21,7 +21,10 @@
 /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
    Frodo Looijaard <frodol@dds.nl> */
 
-/* $Id: i2c-philips-par.c,v 1.29 2003/01/21 08:08:16 kmalkki Exp $ */
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
 
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -158,7 +161,7 @@
 	}
 	memset (adapter, 0x00, sizeof(struct i2c_par));
 
-	/* printk(KERN_DEBUG "i2c-philips-par.o: attaching to %s\n", port->name); */
+	/* pr_debug("i2c-philips-par: attaching to %s\n", port->name); */
 
 	adapter->pdev = parport_register_device(port, "i2c-philips-par",
 						NULL, NULL, NULL, 
@@ -181,8 +184,8 @@
 		return;
 	}
 	/* reset hardware to sane state */
-	bit_lp_setsda(port, 1);
-	bit_lp_setscl(port, 1);
+	adapter->bit_lp_data.setsda(port, 1);
+	adapter->bit_lp_data.setscl(port, 1);
 	parport_release(adapter->pdev);
 
 	if (i2c_bit_add_bus(&adapter->adapter) < 0) {
diff -Nru a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
--- a/drivers/i2c/busses/i2c-piix4.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/i2c/busses/i2c-piix4.c	Tue Feb  3 19:45:17 2004
@@ -28,9 +28,13 @@
    Note: we assume there can only be one device, with one SMBus interface.
 */
 
-/* #define DEBUG 1 */
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
 
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
@@ -64,6 +68,9 @@
 #define SMBSLVEVT	(0xA + piix4_smba)
 #define SMBSLVDAT	(0xC + piix4_smba)
 
+/* count for request_region */
+#define SMBIOSIZE	8
+
 /* PCI Address Constants */
 #define SMBBA		0x090
 #define SMBHSTCFG	0x0D2
@@ -88,13 +95,13 @@
 /* If force is set to anything different from 0, we forcibly enable the
    PIIX4. DANGEROUS! */
 static int force = 0;
-MODULE_PARM(force, "i");
+module_param (force, int, 0);
 MODULE_PARM_DESC(force, "Forcibly enable the PIIX4. DANGEROUS!");
 
 /* If force_addr is set to anything different from 0, we forcibly enable
    the PIIX4 at the given address. VERY DANGEROUS! */
 static int force_addr = 0;
-MODULE_PARM(force_addr, "i");
+module_param (force_addr, int, 0);
 MODULE_PARM_DESC(force_addr,
 		 "Forcibly enable the PIIX4 at the given address. "
 		 "EXTREMELY DANGEROUS!");
@@ -102,20 +109,19 @@
 /* If fix_hstcfg is set to anything different from 0, we reset one of the
    registers to be a valid value. */
 static int fix_hstcfg = 0;
-MODULE_PARM(fix_hstcfg, "i");
+module_param (fix_hstcfg, int, 0);
 MODULE_PARM_DESC(fix_hstcfg,
 		"Fix config register. Needed on some boards (Force CPCI735).");
 
 static int piix4_transaction(void);
 
-
 static unsigned short piix4_smba = 0;
 static struct i2c_adapter piix4_adapter;
 
 /*
  * Get DMI information.
  */
-static int ibm_dmi_probe(void)
+static int __devinit ibm_dmi_probe(void)
 {
 #ifdef CONFIG_X86
 	extern int is_unsafe_smbus;
@@ -125,9 +131,9 @@
 #endif
 }
 
-static int piix4_setup(struct pci_dev *PIIX4_dev, const struct pci_device_id *id)
+static int __devinit piix4_setup(struct pci_dev *PIIX4_dev,
+				const struct pci_device_id *id)
 {
-	int error_return = 0;
 	unsigned char temp;
 
 	/* match up the function */
@@ -140,8 +146,7 @@
 		dev_err(&PIIX4_dev->dev, "IBM Laptop detected; this module "
 			"may corrupt your serial eeprom! Refusing to load "
 			"module!\n");
-		error_return = -EPERM;
-		goto END;
+		return -EPERM;
 	}
 
 	/* Determine the address of the SMBus areas */
@@ -159,11 +164,10 @@
 		}
 	}
 
-	if (!request_region(piix4_smba, 8, "piix4-smbus")) {
+	if (!request_region(piix4_smba, SMBIOSIZE, "piix4-smbus")) {
 		dev_err(&PIIX4_dev->dev, "SMB region 0x%x already in use!\n",
 			piix4_smba);
-		error_return = -ENODEV;
-		goto END;
+		return -ENODEV;
 	}
 
 	pci_read_config_byte(PIIX4_dev, SMBHSTCFG, &temp);
@@ -210,8 +214,9 @@
 		} else {
 			dev_err(&PIIX4_dev->dev,
 				"Host SMBus controller not enabled!\n");
-			error_return = -ENODEV;
-			goto END;
+			release_region(piix4_smba, SMBIOSIZE);
+			piix4_smba = 0;
+			return -ENODEV;
 		}
 	}
 
@@ -227,8 +232,7 @@
 	dev_dbg(&PIIX4_dev->dev, "SMBREV = 0x%X\n", temp);
 	dev_dbg(&PIIX4_dev->dev, "SMBA = 0x%X\n", piix4_smba);
 
-END:
-	return error_return;
+	return 0;
 }
 
 /* Another internally used function */
@@ -461,7 +465,8 @@
 	{ 0, }
 };
 
-static int __devinit piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
+static int __devinit piix4_probe(struct pci_dev *dev,
+				const struct pci_device_id *id)
 {
 	int retval;
 
@@ -475,17 +480,24 @@
 	snprintf(piix4_adapter.name, I2C_NAME_SIZE,
 		"SMBus PIIX4 adapter at %04x", piix4_smba);
 
-	retval = i2c_add_adapter(&piix4_adapter);
+	if ((retval = i2c_add_adapter(&piix4_adapter))) {
+		dev_err(&dev->dev, "Couldn't register adapter!\n");
+		release_region(piix4_smba, SMBIOSIZE);
+		piix4_smba = 0;
+	}
 
 	return retval;
 }
 
 static void __devexit piix4_remove(struct pci_dev *dev)
 {
-	i2c_del_adapter(&piix4_adapter);
+	if (piix4_smba) {
+		i2c_del_adapter(&piix4_adapter);
+		release_region(piix4_smba, SMBIOSIZE);
+		piix4_smba = 0;
+	}
 }
 
-
 static struct pci_driver piix4_driver = {
 	.name		= "piix4-smbus",
 	.id_table	= piix4_ids,
@@ -498,15 +510,13 @@
 	return pci_module_init(&piix4_driver);
 }
 
-
 static void __exit i2c_piix4_exit(void)
 {
 	pci_unregister_driver(&piix4_driver);
-	release_region(piix4_smba, 8);
 }
 
-MODULE_AUTHOR
-    ("Frodo Looijaard <frodol@dds.nl> and Philip Edelbrock <phil@netroedge.com>");
+MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl> and "
+		"Philip Edelbrock <phil@netroedge.com>");
 MODULE_DESCRIPTION("PIIX4 SMBus driver");
 MODULE_LICENSE("GPL");
 
diff -Nru a/drivers/i2c/busses/i2c-prosavage.c b/drivers/i2c/busses/i2c-prosavage.c
--- a/drivers/i2c/busses/i2c-prosavage.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/i2c/busses/i2c-prosavage.c	Tue Feb  3 19:45:17 2004
@@ -54,6 +54,11 @@
  *    (Additional documentation needed :(
  */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/pci.h>
diff -Nru a/drivers/i2c/busses/i2c-rpx.c b/drivers/i2c/busses/i2c-rpx.c
--- a/drivers/i2c/busses/i2c-rpx.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/i2c/busses/i2c-rpx.c	Tue Feb  3 19:45:42 2004
@@ -11,12 +11,15 @@
  * changed to eliminate RPXLite references.
  */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
 #include <linux/kernel.h>
-#include <linux/ioport.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/stddef.h>
-#include <linux/parport.h>
 #include <linux/i2c.h>
 #include <linux/i2c-algo-8xx.h>
 #include <asm/mpc8xx.h>
@@ -84,7 +87,7 @@
 	rpx_iic_init(&rpx_data);
 
 	if (i2c_8xx_add_bus(&rpx_ops) < 0) {
-		printk("i2c-rpx: Unable to register with I2C\n");
+		printk(KERN_ERR "i2c-rpx: Unable to register with I2C\n");
 		return -ENODEV;
 	}
 
diff -Nru a/drivers/i2c/busses/i2c-savage4.c b/drivers/i2c/busses/i2c-savage4.c
--- a/drivers/i2c/busses/i2c-savage4.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/i2c/busses/i2c-savage4.c	Tue Feb  3 19:45:18 2004
@@ -29,6 +29,11 @@
    it easier to add later.
 */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
diff -Nru a/drivers/i2c/busses/i2c-sis5595.c b/drivers/i2c/busses/i2c-sis5595.c
--- a/drivers/i2c/busses/i2c-sis5595.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/i2c/busses/i2c-sis5595.c	Tue Feb  3 19:45:17 2004
@@ -55,7 +55,10 @@
  * Add adapter resets
  */
 
-/* #define DEBUG 1 */
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
 
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -311,13 +314,12 @@
 		break;
 /*
 	case I2C_SMBUS_BLOCK_DATA:
-		printk("sis5595.o: Block data not yet implemented!\n");
+		printk(KERN_WARNING "sis5595.o: Block data not yet implemented!\n");
 		return -1;
 		break;
 */
 	default:
-		printk
-		    (KERN_WARNING "sis5595.o: Unsupported transaction %d\n", size);
+		printk(KERN_WARNING "sis5595.o: Unsupported transaction %d\n", size);
 		return -1;
 	}
 
diff -Nru a/drivers/i2c/busses/i2c-sis630.c b/drivers/i2c/busses/i2c-sis630.c
--- a/drivers/i2c/busses/i2c-sis630.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/i2c/busses/i2c-sis630.c	Tue Feb  3 19:45:17 2004
@@ -48,7 +48,10 @@
    Note: we assume there can only be one device, with one SMBus interface.
 */
 
-/* #define DEBUG 1 */
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
 
 #include <linux/kernel.h>
 #include <linux/module.h>
diff -Nru a/drivers/i2c/busses/i2c-sis96x.c b/drivers/i2c/busses/i2c-sis96x.c
--- a/drivers/i2c/busses/i2c-sis96x.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/i2c/busses/i2c-sis96x.c	Tue Feb  3 19:45:17 2004
@@ -32,7 +32,10 @@
     We assume there can only be one SiS96x with one SMBus interface.
 */
 
-/* #define DEBUG */
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
 
 #include <linux/module.h>
 #include <linux/pci.h>
diff -Nru a/drivers/i2c/busses/i2c-velleman.c b/drivers/i2c/busses/i2c-velleman.c
--- a/drivers/i2c/busses/i2c-velleman.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/i2c/busses/i2c-velleman.c	Tue Feb  3 19:45:41 2004
@@ -18,7 +18,10 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.		     */
 /* ------------------------------------------------------------------------- */
 
-/* $Id: i2c-velleman.c,v 1.29 2003/01/21 08:08:16 kmalkki Exp $ */
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
 
 #include <linux/kernel.h>
 #include <linux/ioport.h>
@@ -29,11 +32,6 @@
 #include <linux/i2c-algo-bit.h>
 #include <asm/io.h>
 
-/* ----- global defines -----------------------------------------------	*/
-#define DEB(x)		/* should be reasonable open, close &c. 	*/
-#define DEB2(x) 	/* low level debugging - very slow 		*/
-#define DEBE(x)	x	/* error messages 				*/
-
 					/* Pin Port  Inverted	name	*/
 #define I2C_SDA		0x02		/*  ctrl bit 1 	(inv)	*/
 #define I2C_SCL		0x08		/*  ctrl bit 3 	(inv)	*/
@@ -140,7 +138,7 @@
 			return -ENODEV;
 		}
 	}
-	printk(KERN_DEBUG "i2c-velleman: found device at %#x.\n",base);
+	pr_debug("i2c-velleman: found device at %#x.\n",base);
 	return 0;
 }
 
diff -Nru a/drivers/i2c/busses/i2c-via.c b/drivers/i2c/busses/i2c-via.c
--- a/drivers/i2c/busses/i2c-via.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/i2c/busses/i2c-via.c	Tue Feb  3 19:45:28 2004
@@ -21,7 +21,10 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#define DEBUG
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
 
 #include <linux/kernel.h>
 #include <linux/module.h>
diff -Nru a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c
--- a/drivers/i2c/busses/i2c-viapro.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/i2c/busses/i2c-viapro.c	Tue Feb  3 19:45:34 2004
@@ -33,6 +33,11 @@
    Note: we assume there can only be one device, with one SMBus interface.
 */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
diff -Nru a/drivers/i2c/busses/i2c-voodoo3.c b/drivers/i2c/busses/i2c-voodoo3.c
--- a/drivers/i2c/busses/i2c-voodoo3.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/i2c/busses/i2c-voodoo3.c	Tue Feb  3 19:45:17 2004
@@ -27,6 +27,11 @@
 /* This interfaces to the I2C bus of the Voodoo3 to gain access to
     the BT869 and possibly other I2C devices. */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
diff -Nru a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c
--- a/drivers/i2c/busses/scx200_acb.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/i2c/busses/scx200_acb.c	Tue Feb  3 19:45:18 2004
@@ -25,6 +25,11 @@
 */
 
 #include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
@@ -47,9 +52,7 @@
 MODULE_PARM(base, "1-4i");
 MODULE_PARM_DESC(base, "Base addresses for the ACCESS.bus controllers");
 
-#define DEBUG 0
-
-#if DEBUG
+#ifdef DEBUG
 #define DBG(x...) printk(KERN_DEBUG NAME ": " x)
 #else
 #define DBG(x...)
@@ -374,8 +377,8 @@
 	if (rc == 0 && size == I2C_SMBUS_WORD_DATA && rw == I2C_SMBUS_READ)
 	    	data->word = le16_to_cpu(cur_word);
 
-#if DEBUG
-	printk(KERN_DEBUG NAME ": transfer done, result: %d", rc);
+#ifdef DEBUG
+	DBG(": transfer done, result: %d", rc);
 	if (buffer) {
 		int i;
 		printk(" data:");
@@ -507,7 +510,7 @@
 	int i;
 	int rc;
 
-	printk(KERN_DEBUG NAME ": NatSemi SCx200 ACCESS.bus Driver\n");
+	pr_debug(NAME ": NatSemi SCx200 ACCESS.bus Driver\n");
 
 	/* Verify that this really is a SCx200 processor */
 	if (pci_find_device(PCI_VENDOR_ID_NS,
diff -Nru a/drivers/i2c/busses/scx200_i2c.c b/drivers/i2c/busses/scx200_i2c.c
--- a/drivers/i2c/busses/scx200_i2c.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/i2c/busses/scx200_i2c.c	Tue Feb  3 19:45:18 2004
@@ -22,6 +22,11 @@
 */
 
 #include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_BUS
+#define DEBUG	1
+#endif
+
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
@@ -88,15 +93,14 @@
 
 int scx200_i2c_init(void)
 {
-	printk(KERN_DEBUG NAME ": NatSemi SCx200 I2C Driver\n");
+	pr_debug(NAME ": NatSemi SCx200 I2C Driver\n");
 
 	if (!scx200_gpio_present()) {
 		printk(KERN_ERR NAME ": no SCx200 gpio pins available\n");
 		return -ENODEV;
 	}
 
-	printk(KERN_DEBUG NAME ": SCL=GPIO%02u, SDA=GPIO%02u\n", 
-	       scl, sda);
+	pr_debug(NAME ": SCL=GPIO%02u, SDA=GPIO%02u\n", scl, sda);
 
 	if (scl == -1 || sda == -1 || scl == sda) {
 		printk(KERN_ERR NAME ": scl and sda must be specified\n");
diff -Nru a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig
--- a/drivers/i2c/chips/Kconfig	Tue Feb  3 19:45:28 2004
+++ b/drivers/i2c/chips/Kconfig	Tue Feb  3 19:45:28 2004
@@ -3,6 +3,7 @@
 #
 
 menu "I2C Hardware Sensors Chip support"
+	depends on I2C
 
 config I2C_SENSOR
 	tristate
@@ -21,6 +22,17 @@
 	  This driver can also be built as a module.  If so, the module
 	  will be called adm1021.
 
+config SENSORS_ASB100
+	tristate "Asus ASB100 Bach"
+	depends on I2C && EXPERIMENTAL
+	select I2C_SENSOR
+	help
+	  If you say yes here you get support for the ASB100 Bach sensor
+	  chip found on some Asus mainboards.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called asb100.
+
 config SENSORS_EEPROM
 	tristate "EEPROM (DIMM) reader"
 	depends on I2C && EXPERIMENTAL
@@ -90,10 +102,22 @@
 	  This driver can also be built as a module.  If so, the module
 	  will be called lm85.
 
+config SENSORS_LM90
+	tristate "National Semiconductor LM90 and compatibles"
+	depends on I2C && EXPERIMENTAL
+	select I2C_SENSOR
+	help
+	  If you say yes here you get support for National Semiconductor LM90
+	  and Analog Devices ADM1032 sensor chips.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called lm90.
+
 config SENSORS_VIA686A
 	tristate "VIA686A"
 	depends on I2C && EXPERIMENTAL
 	select I2C_SENSOR
+	select I2C_ISA
 	help
 	  If you say yes here you get support for the integrated sensors in
 	  Via 686A/B South Bridges.
@@ -112,5 +136,17 @@
 	  
 	  This driver can also be built as a module.  If so, the module
 	  will be called w83781d.
+
+config SENSORS_W83L785TS
+	tristate "Winbond W83L785TS-S"
+	depends on I2C && EXPERIMENTAL
+	select I2C_SENSOR
+	help
+	  If you say yes here you get support for the Winbond W83L785TS-S
+	  sensor chip, which is used on the Asus A7N8X, among other
+	  motherboards.
+	  
+	  This driver can also be built as a module.  If so, the module
+	  will be called w83l785ts.
 
 endmenu
diff -Nru a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile
--- a/drivers/i2c/chips/Makefile	Tue Feb  3 19:45:43 2004
+++ b/drivers/i2c/chips/Makefile	Tue Feb  3 19:45:43 2004
@@ -2,7 +2,8 @@
 # Makefile for the kernel hardware sensors chip drivers.
 #
 
-# w83781d goes first, as it can override other driver's addresses.
+# asb100, then w83781d go first, as they can override other drivers' addresses.
+obj-$(CONFIG_SENSORS_ASB100)	+= asb100.o
 obj-$(CONFIG_SENSORS_W83781D)	+= w83781d.o
 
 obj-$(CONFIG_SENSORS_ADM1021)	+= adm1021.o
@@ -12,4 +13,6 @@
 obj-$(CONFIG_SENSORS_LM78)	+= lm78.o
 obj-$(CONFIG_SENSORS_LM83)	+= lm83.o
 obj-$(CONFIG_SENSORS_LM85)	+= lm85.o
+obj-$(CONFIG_SENSORS_LM90)	+= lm90.o
 obj-$(CONFIG_SENSORS_VIA686A)	+= via686a.o
+obj-$(CONFIG_SENSORS_W83L785TS)	+= w83l785ts.o
diff -Nru a/drivers/i2c/chips/adm1021.c b/drivers/i2c/chips/adm1021.c
--- a/drivers/i2c/chips/adm1021.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/i2c/chips/adm1021.c	Tue Feb  3 19:45:16 2004
@@ -19,6 +19,11 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_CHIP
+#define DEBUG	1
+#endif
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
diff -Nru a/drivers/i2c/chips/asb100.c b/drivers/i2c/chips/asb100.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/i2c/chips/asb100.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,1055 @@
+/*
+    asb100.c - Part of lm_sensors, Linux kernel modules for hardware
+	        monitoring
+
+    Copyright (C) 2004 Mark M. Hoffman <mhoffman@lightlink.com>
+
+	(derived from w83781d.c)
+
+    Copyright (C) 1998 - 2003  Frodo Looijaard <frodol@dds.nl>,
+    Philip Edelbrock <phil@netroedge.com>, and
+    Mark Studebaker <mdsxyz123@yahoo.com>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+/*
+    This driver supports the hardware sensor chips: Asus ASB100 and
+    ASB100-A "BACH".
+
+    ASB100-A supports pwm1, while plain ASB100 does not.  There is no known
+    way for the driver to tell which one is there.
+
+    Chip	#vin	#fanin	#pwm	#temp	wchipid	vendid	i2c	ISA
+    asb100	7	3	1	4	0x31	0x0694	yes	no
+*/
+
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_CHIP
+#define DEBUG	1
+#endif
+
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/ioport.h>
+#include <linux/types.h>
+#include <linux/i2c.h>
+#include <linux/i2c-sensor.h>
+#include <linux/i2c-vid.h>
+#include <linux/init.h>
+#include <asm/errno.h>
+#include <asm/io.h>
+#include "lm75.h"
+
+/*
+	HISTORY:
+	2003-12-29	1.0.0	Ported from lm_sensors project for kernel 2.6
+*/
+#define ASB100_VERSION "1.0.0"
+
+/* I2C addresses to scan */
+static unsigned short normal_i2c[] = { I2C_CLIENT_END };
+static unsigned short normal_i2c_range[] = { 0x28, 0x2f, I2C_CLIENT_END };
+
+/* ISA addresses to scan (none) */
+static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END };
+static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END };
+
+/* default VRM to 9.0 instead of 8.2 */
+#define ASB100_DEFAULT_VRM 90
+
+/* Insmod parameters */
+SENSORS_INSMOD_1(asb100);
+I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: "
+	"{bus, clientaddr, subclientaddr1, subclientaddr2}");
+
+/* Voltage IN registers 0-6 */
+#define ASB100_REG_IN(nr)	(0x20 + (nr))
+#define ASB100_REG_IN_MAX(nr)	(0x2b + (nr * 2))
+#define ASB100_REG_IN_MIN(nr)	(0x2c + (nr * 2))
+
+/* FAN IN registers 1-3 */
+#define ASB100_REG_FAN(nr)	(0x28 + (nr))
+#define ASB100_REG_FAN_MIN(nr)	(0x3b + (nr))
+
+/* TEMPERATURE registers 1-4 */
+static const u16 asb100_reg_temp[]	= {0, 0x27, 0x150, 0x250, 0x17};
+static const u16 asb100_reg_temp_max[]	= {0, 0x39, 0x155, 0x255, 0x18};
+static const u16 asb100_reg_temp_hyst[]	= {0, 0x3a, 0x153, 0x253, 0x19};
+
+#define ASB100_REG_TEMP(nr) (asb100_reg_temp[nr])
+#define ASB100_REG_TEMP_MAX(nr) (asb100_reg_temp_max[nr])
+#define ASB100_REG_TEMP_HYST(nr) (asb100_reg_temp_hyst[nr])
+
+#define ASB100_REG_TEMP2_CONFIG	0x0152
+#define ASB100_REG_TEMP3_CONFIG	0x0252
+
+
+#define ASB100_REG_CONFIG	0x40
+#define ASB100_REG_ALARM1	0x41
+#define ASB100_REG_ALARM2	0x42
+#define ASB100_REG_SMIM1	0x43
+#define ASB100_REG_SMIM2	0x44
+#define ASB100_REG_VID_FANDIV	0x47
+#define ASB100_REG_I2C_ADDR	0x48
+#define ASB100_REG_CHIPID	0x49
+#define ASB100_REG_I2C_SUBADDR	0x4a
+#define ASB100_REG_PIN		0x4b
+#define ASB100_REG_IRQ		0x4c
+#define ASB100_REG_BANK		0x4e
+#define ASB100_REG_CHIPMAN	0x4f
+
+#define ASB100_REG_WCHIPID	0x58
+
+/* bit 7 -> enable, bits 0-3 -> duty cycle */
+#define ASB100_REG_PWM1		0x59
+
+/* CONVERSIONS
+   Rounding and limit checking is only done on the TO_REG variants. */
+
+/* These constants are a guess, consistent w/ w83781d */
+#define ASB100_IN_MIN (   0)
+#define ASB100_IN_MAX (4080)
+
+/* IN: 1/1000 V (0V to 4.08V)
+   REG: 16mV/bit */
+static u8 IN_TO_REG(unsigned val)
+{
+	unsigned nval = SENSORS_LIMIT(val, ASB100_IN_MIN, ASB100_IN_MAX);
+	return nval / 16;
+}
+
+static unsigned IN_FROM_REG(u8 reg)
+{
+	return reg * 16;
+}
+
+static u8 FAN_TO_REG(long rpm, int div)
+{
+	if (rpm == -1)
+		return 0;
+	if (rpm == 0)
+		return 255;
+	rpm = SENSORS_LIMIT(rpm, 1, 1000000);
+	return SENSORS_LIMIT((1350000 + rpm * div / 2) / (rpm * div), 1, 254);
+}
+
+static int FAN_FROM_REG(u8 val, int div)
+{
+	return val==0 ? -1 : val==255 ? 0 : 1350000/(val*div);
+}
+
+/* These constants are a guess, consistent w/ w83781d */
+#define ASB100_TEMP_MIN (-128000)
+#define ASB100_TEMP_MAX ( 127000)
+
+/* TEMP: 0.001C/bit (-128C to +127C)
+   REG: 1C/bit, two's complement */
+static u8 TEMP_TO_REG(int temp)
+{
+	int ntemp = SENSORS_LIMIT(temp, ASB100_TEMP_MIN, ASB100_TEMP_MAX);
+	ntemp += (ntemp<0 ? -500 : 500);
+	return (u8)(ntemp / 1000);
+}
+
+static int TEMP_FROM_REG(u8 reg)
+{
+	return (s8)reg * 1000;
+}
+
+/* PWM: 0 - 255 per sensors documentation
+   REG: (6.25% duty cycle per bit) */
+static u8 ASB100_PWM_TO_REG(int pwm)
+{
+	pwm = SENSORS_LIMIT(pwm, 0, 255);
+	return (u8)(pwm / 16);
+}
+
+static int ASB100_PWM_FROM_REG(u8 reg)
+{
+	return reg * 16;
+}
+
+#define ALARMS_FROM_REG(val) (val)
+
+#define DIV_FROM_REG(val) (1 << (val))
+
+/* FAN DIV: 1, 2, 4, or 8 (defaults to 2)
+   REG: 0, 1, 2, or 3 (respectively) (defaults to 1) */
+static u8 DIV_TO_REG(long val)
+{
+	return val==8 ? 3 : val==4 ? 2 : val==1 ? 0 : 1;
+}
+
+/* For each registered client, we need to keep some data in memory. That
+   data is pointed to by client->data. The structure itself is
+   dynamically allocated, at the same time the client itself is allocated. */
+struct asb100_data {
+	struct semaphore lock;
+	enum chips type;
+
+	struct semaphore update_lock;
+	unsigned long last_updated;	/* In jiffies */
+
+	/* array of 2 pointers to subclients */
+	struct i2c_client *lm75[2];
+
+	char valid;		/* !=0 if following fields are valid */
+	u8 in[7];		/* Register value */
+	u8 in_max[7];		/* Register value */
+	u8 in_min[7];		/* Register value */
+	u8 fan[3];		/* Register value */
+	u8 fan_min[3];		/* Register value */
+	u16 temp[4];		/* Register value (0 and 3 are u8 only) */
+	u16 temp_max[4];	/* Register value (0 and 3 are u8 only) */
+	u16 temp_hyst[4];	/* Register value (0 and 3 are u8 only) */
+	u8 fan_div[3];		/* Register encoding, right justified */
+	u8 pwm;			/* Register encoding */
+	u8 vid;			/* Register encoding, combined */
+	u32 alarms;		/* Register encoding, combined */
+	u8 vrm;
+};
+
+static int asb100_read_value(struct i2c_client *client, u16 reg);
+static void asb100_write_value(struct i2c_client *client, u16 reg, u16 val);
+
+static int asb100_attach_adapter(struct i2c_adapter *adapter);
+static int asb100_detect(struct i2c_adapter *adapter, int address, int kind);
+static int asb100_detach_client(struct i2c_client *client);
+static struct asb100_data *asb100_update_device(struct device *dev);
+static void asb100_init_client(struct i2c_client *client);
+
+static struct i2c_driver asb100_driver = {
+	.owner		= THIS_MODULE,
+	.name		= "asb100",
+	.id		= I2C_DRIVERID_ASB100,
+	.flags		= I2C_DF_NOTIFY,
+	.attach_adapter	= asb100_attach_adapter,
+	.detach_client	= asb100_detach_client,
+};
+
+/* 7 Voltages */
+#define show_in_reg(reg) \
+static ssize_t show_##reg (struct device *dev, char *buf, int nr) \
+{ \
+	struct asb100_data *data = asb100_update_device(dev); \
+	return sprintf(buf, "%d\n", IN_FROM_REG(data->reg[nr])); \
+}
+
+show_in_reg(in)
+show_in_reg(in_min)
+show_in_reg(in_max)
+
+#define set_in_reg(REG, reg) \
+static ssize_t set_in_##reg(struct device *dev, const char *buf, \
+		size_t count, int nr) \
+{ \
+	struct i2c_client *client = to_i2c_client(dev); \
+	struct asb100_data *data = i2c_get_clientdata(client); \
+	unsigned long val = simple_strtoul(buf, NULL, 10); \
+	data->in_##reg[nr] = IN_TO_REG(val); \
+	asb100_write_value(client, ASB100_REG_IN_##REG(nr), \
+		data->in_##reg[nr]); \
+	return count; \
+}
+
+set_in_reg(MIN, min)
+set_in_reg(MAX, max)
+
+#define sysfs_in(offset) \
+static ssize_t \
+	show_in##offset (struct device *dev, char *buf) \
+{ \
+	return show_in(dev, buf, 0x##offset); \
+} \
+static DEVICE_ATTR(in_input##offset, S_IRUGO, \
+		show_in##offset, NULL) \
+static ssize_t \
+	show_in##offset##_min (struct device *dev, char *buf) \
+{ \
+	return show_in_min(dev, buf, 0x##offset); \
+} \
+static ssize_t \
+	show_in##offset##_max (struct device *dev, char *buf) \
+{ \
+	return show_in_max(dev, buf, 0x##offset); \
+} \
+static ssize_t set_in##offset##_min (struct device *dev, \
+		const char *buf, size_t count) \
+{ \
+	return set_in_min(dev, buf, count, 0x##offset); \
+} \
+static ssize_t set_in##offset##_max (struct device *dev, \
+		const char *buf, size_t count) \
+{ \
+	return set_in_max(dev, buf, count, 0x##offset); \
+} \
+static DEVICE_ATTR(in_min##offset, S_IRUGO | S_IWUSR, \
+		show_in##offset##_min, set_in##offset##_min) \
+static DEVICE_ATTR(in_max##offset, S_IRUGO | S_IWUSR, \
+		show_in##offset##_max, set_in##offset##_max)
+
+sysfs_in(0)
+sysfs_in(1)
+sysfs_in(2)
+sysfs_in(3)
+sysfs_in(4)
+sysfs_in(5)
+sysfs_in(6)
+
+#define device_create_file_in(client, offset) do { \
+	device_create_file(&client->dev, &dev_attr_in_input##offset); \
+	device_create_file(&client->dev, &dev_attr_in_min##offset); \
+	device_create_file(&client->dev, &dev_attr_in_max##offset); \
+} while (0)
+
+/* 3 Fans */
+static ssize_t show_fan(struct device *dev, char *buf, int nr)
+{
+	struct asb100_data *data = asb100_update_device(dev);
+	return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[nr],
+		DIV_FROM_REG(data->fan_div[nr])));
+}
+
+static ssize_t show_fan_min(struct device *dev, char *buf, int nr)
+{
+	struct asb100_data *data = asb100_update_device(dev);
+	return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan_min[nr],
+		DIV_FROM_REG(data->fan_div[nr])));
+}
+
+static ssize_t show_fan_div(struct device *dev, char *buf, int nr)
+{
+	struct asb100_data *data = asb100_update_device(dev);
+	return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[nr]));
+}
+
+static ssize_t set_fan_min(struct device *dev, const char *buf,
+				size_t count, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct asb100_data *data = i2c_get_clientdata(client);
+	u32 val = simple_strtoul(buf, NULL, 10);
+	data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr]));
+	asb100_write_value(client, ASB100_REG_FAN_MIN(nr), data->fan_min[nr]);
+	return count;
+}
+
+/* Note: we save and restore the fan minimum here, because its value is
+   determined in part by the fan divisor.  This follows the principle of
+   least suprise; the user doesn't expect the fan minimum to change just
+   because the divisor changed. */
+static ssize_t set_fan_div(struct device *dev, const char *buf,
+				size_t count, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct asb100_data *data = i2c_get_clientdata(client);
+	unsigned long min = FAN_FROM_REG(data->fan_min[nr],
+			DIV_FROM_REG(data->fan_div[nr]));
+	unsigned long val = simple_strtoul(buf, NULL, 10);
+	int reg;
+	
+	data->fan_div[nr] = DIV_TO_REG(val);
+
+	switch(nr) {
+	case 0:	/* fan 1 */
+		reg = asb100_read_value(client, ASB100_REG_VID_FANDIV);
+		reg = (reg & 0xcf) | (data->fan_div[0] << 4);
+		asb100_write_value(client, ASB100_REG_VID_FANDIV, reg);
+		break;
+
+	case 1:	/* fan 2 */
+		reg = asb100_read_value(client, ASB100_REG_VID_FANDIV);
+		reg = (reg & 0x3f) | (data->fan_div[1] << 6);
+		asb100_write_value(client, ASB100_REG_VID_FANDIV, reg);
+		break;
+
+	case 2:	/* fan 3 */
+		reg = asb100_read_value(client, ASB100_REG_PIN);
+		reg = (reg & 0x3f) | (data->fan_div[2] << 6);
+		asb100_write_value(client, ASB100_REG_PIN, reg);
+		break;
+	}
+
+	data->fan_min[nr] =
+		FAN_TO_REG(min, DIV_FROM_REG(data->fan_div[nr]));
+	asb100_write_value(client, ASB100_REG_FAN_MIN(nr), data->fan_min[nr]);
+	return count;
+}
+
+#define sysfs_fan(offset) \
+static ssize_t show_fan##offset(struct device *dev, char *buf) \
+{ \
+	return show_fan(dev, buf, offset - 1); \
+} \
+static ssize_t show_fan##offset##_min(struct device *dev, char *buf) \
+{ \
+	return show_fan_min(dev, buf, offset - 1); \
+} \
+static ssize_t show_fan##offset##_div(struct device *dev, char *buf) \
+{ \
+	return show_fan_div(dev, buf, offset - 1); \
+} \
+static ssize_t set_fan##offset##_min(struct device *dev, const char *buf, \
+					size_t count) \
+{ \
+	return set_fan_min(dev, buf, count, offset - 1); \
+} \
+static ssize_t set_fan##offset##_div(struct device *dev, const char *buf, \
+					size_t count) \
+{ \
+	return set_fan_div(dev, buf, count, offset - 1); \
+} \
+static DEVICE_ATTR(fan_input##offset, S_IRUGO, \
+		show_fan##offset, NULL) \
+static DEVICE_ATTR(fan_min##offset, S_IRUGO | S_IWUSR, \
+		show_fan##offset##_min, set_fan##offset##_min) \
+static DEVICE_ATTR(fan_div##offset, S_IRUGO | S_IWUSR, \
+		show_fan##offset##_div, set_fan##offset##_div)
+
+sysfs_fan(1)
+sysfs_fan(2)
+sysfs_fan(3)
+
+#define device_create_file_fan(client, offset) do { \
+	device_create_file(&client->dev, &dev_attr_fan_input##offset); \
+	device_create_file(&client->dev, &dev_attr_fan_min##offset); \
+	device_create_file(&client->dev, &dev_attr_fan_div##offset); \
+} while (0)
+
+/* 4 Temp. Sensors */
+static int sprintf_temp_from_reg(u16 reg, char *buf, int nr)
+{
+	int ret = 0;
+
+	switch (nr) {
+	case 1: case 2:
+		ret = sprintf(buf, "%d\n", LM75_TEMP_FROM_REG(reg));
+		break;
+	case 0: case 3: default:
+		ret = sprintf(buf, "%d\n", TEMP_FROM_REG(reg));
+		break;
+	}
+	return ret;
+}
+		 	
+#define show_temp_reg(reg) \
+static ssize_t show_##reg(struct device *dev, char *buf, int nr) \
+{ \
+	struct asb100_data *data = asb100_update_device(dev); \
+	return sprintf_temp_from_reg(data->reg[nr], buf, nr); \
+}
+
+show_temp_reg(temp)
+show_temp_reg(temp_max)
+show_temp_reg(temp_hyst)
+
+#define set_temp_reg(REG, reg) \
+static ssize_t set_##reg(struct device *dev, const char *buf, \
+			size_t count, int nr) \
+{ \
+	struct i2c_client *client = to_i2c_client(dev); \
+	struct asb100_data *data = i2c_get_clientdata(client); \
+	unsigned long val = simple_strtoul(buf, NULL, 10); \
+	switch (nr) { \
+	case 1: case 2: \
+		data->reg[nr] = LM75_TEMP_TO_REG(val); \
+		break; \
+	case 0: case 3: default: \
+		data->reg[nr] = TEMP_TO_REG(val); \
+		break; \
+	} \
+	asb100_write_value(client, ASB100_REG_TEMP_##REG(nr), \
+			data->reg[nr]); \
+	return count; \
+}
+
+set_temp_reg(MAX, temp_max)
+set_temp_reg(HYST, temp_hyst)
+
+#define sysfs_temp(num) \
+static ssize_t show_temp##num(struct device *dev, char *buf) \
+{ \
+	return show_temp(dev, buf, num-1); \
+} \
+static DEVICE_ATTR(temp_input##num, S_IRUGO, show_temp##num, NULL) \
+static ssize_t show_temp_max##num(struct device *dev, char *buf) \
+{ \
+	return show_temp_max(dev, buf, num-1); \
+} \
+static ssize_t set_temp_max##num(struct device *dev, const char *buf, \
+					size_t count) \
+{ \
+	return set_temp_max(dev, buf, count, num-1); \
+} \
+static DEVICE_ATTR(temp_max##num, S_IRUGO | S_IWUSR, \
+		show_temp_max##num, set_temp_max##num) \
+static ssize_t show_temp_hyst##num(struct device *dev, char *buf) \
+{ \
+	return show_temp_hyst(dev, buf, num-1); \
+} \
+static ssize_t set_temp_hyst##num(struct device *dev, const char *buf, \
+					size_t count) \
+{ \
+	return set_temp_hyst(dev, buf, count, num-1); \
+} \
+static DEVICE_ATTR(temp_hyst##num, S_IRUGO | S_IWUSR, \
+		show_temp_hyst##num, set_temp_hyst##num)
+
+sysfs_temp(1)
+sysfs_temp(2)
+sysfs_temp(3)
+sysfs_temp(4)
+
+/* VID */
+#define device_create_file_temp(client, num) do { \
+	device_create_file(&client->dev, &dev_attr_temp_input##num); \
+	device_create_file(&client->dev, &dev_attr_temp_max##num); \
+	device_create_file(&client->dev, &dev_attr_temp_hyst##num); \
+} while (0)
+
+static ssize_t show_vid(struct device *dev, char *buf)
+{
+	struct asb100_data *data = asb100_update_device(dev);
+	return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm));
+}
+
+static DEVICE_ATTR(vid, S_IRUGO, show_vid, NULL)
+#define device_create_file_vid(client) \
+device_create_file(&client->dev, &dev_attr_vid)
+
+/* VRM */
+static ssize_t show_vrm(struct device *dev, char *buf)
+{
+	struct asb100_data *data = asb100_update_device(dev);
+	return sprintf(buf, "%d\n", data->vrm);
+}
+
+static ssize_t set_vrm(struct device *dev, const char *buf, size_t count)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct asb100_data *data = i2c_get_clientdata(client);
+	unsigned long val = simple_strtoul(buf, NULL, 10);
+	data->vrm = val;
+	return count;
+}
+
+/* Alarms */
+static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm)
+#define device_create_file_vrm(client) \
+device_create_file(&client->dev, &dev_attr_vrm);
+
+static ssize_t show_alarms(struct device *dev, char *buf)
+{
+	struct asb100_data *data = asb100_update_device(dev);
+	return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->alarms));
+}
+
+static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL)
+#define device_create_file_alarms(client) \
+device_create_file(&client->dev, &dev_attr_alarms)
+
+/* 1 PWM */
+static ssize_t show_pwm1(struct device *dev, char *buf)
+{
+	struct asb100_data *data = asb100_update_device(dev);
+	return sprintf(buf, "%d\n", ASB100_PWM_FROM_REG(data->pwm & 0x0f));
+}
+
+static ssize_t set_pwm1(struct device *dev, const char *buf, size_t count)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct asb100_data *data = i2c_get_clientdata(client);
+	unsigned long val = simple_strtoul(buf, NULL, 10);
+	data->pwm &= 0x80; /* keep the enable bit */
+	data->pwm |= (0x0f & ASB100_PWM_TO_REG(val));
+	asb100_write_value(client, ASB100_REG_PWM1, data->pwm);
+	return count;
+}
+
+static ssize_t show_pwm_enable1(struct device *dev, char *buf)
+{
+	struct asb100_data *data = asb100_update_device(dev);
+	return sprintf(buf, "%d\n", (data->pwm & 0x80) ? 1 : 0);
+}
+
+static ssize_t set_pwm_enable1(struct device *dev, const char *buf,
+				size_t count)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct asb100_data *data = i2c_get_clientdata(client);
+	unsigned long val = simple_strtoul(buf, NULL, 10);
+	data->pwm &= 0x0f; /* keep the duty cycle bits */
+	data->pwm |= (val ? 0x80 : 0x00);
+	asb100_write_value(client, ASB100_REG_PWM1, data->pwm);
+	return count;
+}
+
+static DEVICE_ATTR(pwm1, S_IRUGO | S_IWUSR, show_pwm1, set_pwm1)
+static DEVICE_ATTR(pwm_enable1, S_IRUGO | S_IWUSR,
+		show_pwm_enable1, set_pwm_enable1)
+#define device_create_file_pwm1(client) do { \
+	device_create_file(&new_client->dev, &dev_attr_pwm1); \
+	device_create_file(&new_client->dev, &dev_attr_pwm_enable1); \
+} while (0)
+
+/* This function is called when:
+	asb100_driver is inserted (when this module is loaded), for each
+		available adapter
+	when a new adapter is inserted (and asb100_driver is still present)
+ */
+static int asb100_attach_adapter(struct i2c_adapter *adapter)
+{
+	if (!(adapter->class & I2C_ADAP_CLASS_SMBUS))
+		return 0;
+	return i2c_detect(adapter, &addr_data, asb100_detect);
+}
+
+static int asb100_detect_subclients(struct i2c_adapter *adapter, int address,
+		int kind, struct i2c_client *new_client)
+{
+	int i, id, err;
+	struct asb100_data *data = i2c_get_clientdata(new_client);
+
+	data->lm75[0] = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
+	if (!(data->lm75[0])) {
+		err = -ENOMEM;
+		goto ERROR_SC_0;
+	}
+	memset(data->lm75[0], 0x00, sizeof(struct i2c_client));
+
+	data->lm75[1] = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
+	if (!(data->lm75[1])) {
+		err = -ENOMEM;
+		goto ERROR_SC_1;
+	}
+	memset(data->lm75[1], 0x00, sizeof(struct i2c_client));
+
+	id = i2c_adapter_id(adapter);
+
+	if (force_subclients[0] == id && force_subclients[1] == address) {
+		for (i = 2; i <= 3; i++) {
+			if (force_subclients[i] < 0x48 ||
+			    force_subclients[i] > 0x4f) {
+				dev_err(&new_client->dev, "invalid subclient "
+					"address %d; must be 0x48-0x4f\n",
+					force_subclients[i]);
+				err = -ENODEV;
+				goto ERROR_SC_2;
+			}
+		}
+		asb100_write_value(new_client, ASB100_REG_I2C_SUBADDR,
+					(force_subclients[2] & 0x07) |
+					((force_subclients[3] & 0x07) <<4));
+		data->lm75[0]->addr = force_subclients[2];
+		data->lm75[1]->addr = force_subclients[3];
+	} else {
+		int val = asb100_read_value(new_client, ASB100_REG_I2C_SUBADDR);
+		data->lm75[0]->addr = 0x48 + (val & 0x07);
+		data->lm75[1]->addr = 0x48 + ((val >> 4) & 0x07);
+	}
+
+	if(data->lm75[0]->addr == data->lm75[1]->addr) {
+		dev_err(&new_client->dev, "duplicate addresses 0x%x "
+				"for subclients\n", data->lm75[0]->addr);
+		err = -ENODEV;
+		goto ERROR_SC_2;
+	}
+
+	for (i = 0; i <= 1; i++) {
+		i2c_set_clientdata(data->lm75[i], NULL);
+		data->lm75[i]->adapter = adapter;
+		data->lm75[i]->driver = &asb100_driver;
+		data->lm75[i]->flags = 0;
+		strlcpy(data->lm75[i]->name, "asb100 subclient", I2C_NAME_SIZE);
+	}
+
+	if ((err = i2c_attach_client(data->lm75[0]))) {
+		dev_err(&new_client->dev, "subclient %d registration "
+			"at address 0x%x failed.\n", i, data->lm75[0]->addr);
+		goto ERROR_SC_2;
+	}
+
+	if ((err = i2c_attach_client(data->lm75[1]))) {
+		dev_err(&new_client->dev, "subclient %d registration "
+			"at address 0x%x failed.\n", i, data->lm75[1]->addr);
+		goto ERROR_SC_3;
+	}
+
+	return 0;
+
+/* Undo inits in case of errors */
+ERROR_SC_3:
+	i2c_detach_client(data->lm75[0]);
+ERROR_SC_2:
+	kfree(data->lm75[1]);
+ERROR_SC_1:
+	kfree(data->lm75[0]);
+ERROR_SC_0:
+	return err;
+}
+
+static int asb100_detect(struct i2c_adapter *adapter, int address, int kind)
+{
+	int err;
+	struct i2c_client *new_client;
+	struct asb100_data *data;
+
+	/* asb100 is SMBus only */
+	if (i2c_is_isa_adapter(adapter)) {
+		pr_debug("asb100.o: detect failed, "
+				"cannot attach to legacy adapter!\n");
+		err = -ENODEV;
+		goto ERROR0;
+	}
+
+	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
+		pr_debug("asb100.o: detect failed, "
+				"smbus byte data not supported!\n");
+		err = -ENODEV;
+		goto ERROR0;
+	}
+
+	/* OK. For now, we presume we have a valid client. We now create the
+	   client structure, even though we cannot fill it completely yet.
+	   But it allows us to access asb100_{read,write}_value. */
+
+	if (!(new_client = kmalloc(sizeof(struct i2c_client) +
+			sizeof(struct asb100_data), GFP_KERNEL))) {
+		pr_debug("asb100.o: detect failed, kmalloc failed!\n");
+		err = -ENOMEM;
+		goto ERROR0;
+	}
+
+	memset(new_client, 0,
+		sizeof(struct i2c_client) + sizeof(struct asb100_data));
+
+	data = (struct asb100_data *) (new_client + 1);
+	init_MUTEX(&data->lock);
+	i2c_set_clientdata(new_client, data);
+	new_client->addr = address;
+	new_client->adapter = adapter;
+	new_client->driver = &asb100_driver;
+	new_client->flags = 0;
+
+	/* Now, we do the remaining detection. */
+
+	/* The chip may be stuck in some other bank than bank 0. This may
+	   make reading other information impossible. Specify a force=... or
+	   force_*=... parameter, and the chip will be reset to the right
+	   bank. */
+	if (kind < 0) {
+
+		int val1 = asb100_read_value(new_client, ASB100_REG_BANK);
+		int val2 = asb100_read_value(new_client, ASB100_REG_CHIPMAN);
+
+		/* If we're in bank 0 */
+		if ( (!(val1 & 0x07)) &&
+				/* Check for ASB100 ID (low byte) */
+				( ((!(val1 & 0x80)) && (val2 != 0x94)) ||
+				/* Check for ASB100 ID (high byte ) */
+				((val1 & 0x80) && (val2 != 0x06)) ) ) {
+			pr_debug("asb100.o: detect failed, "
+					"bad chip id 0x%02x!\n", val2);
+			err = -ENODEV;
+			goto ERROR1;
+		}
+
+	} /* kind < 0 */
+
+	/* We have either had a force parameter, or we have already detected
+	   Winbond. Put it now into bank 0 and Vendor ID High Byte */
+	asb100_write_value(new_client, ASB100_REG_BANK,
+		(asb100_read_value(new_client, ASB100_REG_BANK) & 0x78) | 0x80);
+
+	/* Determine the chip type. */
+	if (kind <= 0) {
+		int val1 = asb100_read_value(new_client, ASB100_REG_WCHIPID);
+		int val2 = asb100_read_value(new_client, ASB100_REG_CHIPMAN);
+
+		if ((val1 == 0x31) && (val2 == 0x06))
+			kind = asb100;
+		else {
+			if (kind == 0)
+				dev_warn(&new_client->dev, "ignoring "
+					"'force' parameter for unknown chip "
+					"at adapter %d, address 0x%02x.\n",
+					i2c_adapter_id(adapter), address);
+			err = -ENODEV;
+			goto ERROR1;
+		}
+	}
+
+	/* Fill in remaining client fields and put it into the global list */
+	strlcpy(new_client->name, "asb100", I2C_NAME_SIZE);
+	data->type = kind;
+
+	data->valid = 0;
+	init_MUTEX(&data->update_lock);
+
+	/* Tell the I2C layer a new client has arrived */
+	if ((err = i2c_attach_client(new_client)))
+		goto ERROR1;
+
+	/* Attach secondary lm75 clients */
+	if ((err = asb100_detect_subclients(adapter, address, kind,
+			new_client)))
+		goto ERROR2;
+
+	/* Initialize the chip */
+	asb100_init_client(new_client);
+
+	/* Register sysfs hooks */
+	device_create_file_in(new_client, 0);
+	device_create_file_in(new_client, 1);
+	device_create_file_in(new_client, 2);
+	device_create_file_in(new_client, 3);
+	device_create_file_in(new_client, 4);
+	device_create_file_in(new_client, 5);
+	device_create_file_in(new_client, 6);
+
+	device_create_file_fan(new_client, 1);
+	device_create_file_fan(new_client, 2);
+	device_create_file_fan(new_client, 3);
+
+	device_create_file_temp(new_client, 1);
+	device_create_file_temp(new_client, 2);
+	device_create_file_temp(new_client, 3);
+	device_create_file_temp(new_client, 4);
+
+	device_create_file_vid(new_client);
+	device_create_file_vrm(new_client);
+
+	device_create_file_alarms(new_client);
+
+	device_create_file_pwm1(new_client);
+
+	return 0;
+
+ERROR2:
+	i2c_detach_client(new_client);
+ERROR1:
+	kfree(new_client);
+ERROR0:
+	return err;
+}
+
+static int asb100_detach_client(struct i2c_client *client)
+{
+	int err;
+
+	if ((err = i2c_detach_client(client))) {
+		dev_err(&client->dev, "client deregistration failed; "
+			"client not detached.\n");
+		return err;
+	}
+
+	kfree(client);
+
+	return 0;
+}
+
+static u16 swap_bytes(u16 val)
+{
+	return (val >> 8) | (val << 8);
+}
+
+/* The SMBus locks itself, usually, but nothing may access the chip between
+   bank switches. */
+static int asb100_read_value(struct i2c_client *client, u16 reg)
+{
+	struct asb100_data *data = i2c_get_clientdata(client);
+	struct i2c_client *cl;
+	int res, bank;
+
+	down(&data->lock);
+
+	bank = (reg >> 8) & 0x0f;
+	if (bank > 2)
+		/* switch banks */
+		i2c_smbus_write_byte_data(client, ASB100_REG_BANK, bank);
+
+	if (bank == 0 || bank > 2) {
+		res = i2c_smbus_read_byte_data(client, reg & 0xff);
+	} else {
+		/* switch to subclient */
+		cl = data->lm75[bank - 1];
+
+		/* convert from ISA to LM75 I2C addresses */
+		switch (reg & 0xff) {
+		case 0x50: /* TEMP */
+			res = swap_bytes(i2c_smbus_read_word_data (cl, 0));
+			break;
+		case 0x52: /* CONFIG */
+			res = i2c_smbus_read_byte_data(cl, 1);
+			break;
+		case 0x53: /* HYST */
+			res = swap_bytes(i2c_smbus_read_word_data (cl, 2));
+			break;
+		case 0x55: /* MAX */
+		default:
+			res = swap_bytes(i2c_smbus_read_word_data (cl, 3));
+			break;
+		}
+	}
+
+	if (bank > 2)
+		i2c_smbus_write_byte_data(client, ASB100_REG_BANK, 0);
+
+	up(&data->lock);
+
+	return res;
+}
+
+static void asb100_write_value(struct i2c_client *client, u16 reg, u16 value)
+{
+	struct asb100_data *data = i2c_get_clientdata(client);
+	struct i2c_client *cl;
+	int bank;
+
+	down(&data->lock);
+
+	bank = (reg >> 8) & 0x0f;
+	if (bank > 2)
+		/* switch banks */
+		i2c_smbus_write_byte_data(client, ASB100_REG_BANK, bank);
+
+	if (bank == 0 || bank > 2) {
+		i2c_smbus_write_byte_data(client, reg & 0xff, value & 0xff);
+	} else {
+		/* switch to subclient */
+		cl = data->lm75[bank - 1];
+
+		/* convert from ISA to LM75 I2C addresses */
+		switch (reg & 0xff) {
+		case 0x52: /* CONFIG */
+			i2c_smbus_write_byte_data(cl, 1, value & 0xff);
+			break;
+		case 0x53: /* HYST */
+			i2c_smbus_write_word_data(cl, 2, swap_bytes(value));
+			break;
+		case 0x55: /* MAX */
+			i2c_smbus_write_word_data(cl, 3, swap_bytes(value));
+			break;
+		}
+	}
+
+	if (bank > 2)
+		i2c_smbus_write_byte_data(client, ASB100_REG_BANK, 0);
+
+	up(&data->lock);
+}
+
+static void asb100_init_client(struct i2c_client *client)
+{
+	struct asb100_data *data = i2c_get_clientdata(client);
+	int vid = 0;
+
+	vid = asb100_read_value(client, ASB100_REG_VID_FANDIV) & 0x0f;
+	vid |= (asb100_read_value(client, ASB100_REG_CHIPID) & 0x01) << 4;
+	data->vrm = ASB100_DEFAULT_VRM;
+	vid = vid_from_reg(vid, data->vrm);
+
+	/* Start monitoring */
+	asb100_write_value(client, ASB100_REG_CONFIG, 
+		(asb100_read_value(client, ASB100_REG_CONFIG) & 0xf7) | 0x01);
+}
+
+static struct asb100_data *asb100_update_device(struct device *dev)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct asb100_data *data = i2c_get_clientdata(client);
+	int i;
+
+	down(&data->update_lock);
+
+	if (time_after(jiffies - data->last_updated, (unsigned long)(HZ+HZ/2))
+		|| time_before(jiffies, data->last_updated) || !data->valid) {
+
+		dev_dbg(&client->dev, "starting device update...\n");
+
+		/* 7 voltage inputs */
+		for (i = 0; i < 7; i++) {
+			data->in[i] = asb100_read_value(client,
+				ASB100_REG_IN(i));
+			data->in_min[i] = asb100_read_value(client,
+				ASB100_REG_IN_MIN(i));
+			data->in_max[i] = asb100_read_value(client,
+				ASB100_REG_IN_MAX(i));
+		}
+
+		/* 3 fan inputs */
+		for (i = 0; i < 3; i++) {
+			data->fan[i] = asb100_read_value(client,
+					ASB100_REG_FAN(i));
+			data->fan_min[i] = asb100_read_value(client,
+					ASB100_REG_FAN_MIN(i));
+		}
+
+		/* 4 temperature inputs */
+		for (i = 1; i <= 4; i++) {
+			data->temp[i-1] = asb100_read_value(client,
+					ASB100_REG_TEMP(i));
+			data->temp_max[i-1] = asb100_read_value(client,
+					ASB100_REG_TEMP_MAX(i));
+			data->temp_hyst[i-1] = asb100_read_value(client,
+					ASB100_REG_TEMP_HYST(i));
+		}
+
+		/* VID and fan divisors */
+		i = asb100_read_value(client, ASB100_REG_VID_FANDIV);
+		data->vid = i & 0x0f;
+		data->vid |= (asb100_read_value(client,
+				ASB100_REG_CHIPID) & 0x01) << 4;
+		data->fan_div[0] = (i >> 4) & 0x03;
+		data->fan_div[1] = (i >> 6) & 0x03;
+		data->fan_div[2] = (asb100_read_value(client,
+				ASB100_REG_PIN) >> 6) & 0x03;
+
+		/* PWM */
+		data->pwm = asb100_read_value(client, ASB100_REG_PWM1);
+
+		/* alarms */
+		data->alarms = asb100_read_value(client, ASB100_REG_ALARM1) +
+			(asb100_read_value(client, ASB100_REG_ALARM2) << 8);
+
+		data->last_updated = jiffies;
+		data->valid = 1;
+
+		dev_dbg(&client->dev, "... device update complete\n");
+	}
+
+	up(&data->update_lock);
+
+	return data;
+}
+
+static int __init asb100_init(void)
+{
+	return i2c_add_driver(&asb100_driver);
+}
+
+static void __exit asb100_exit(void)
+{
+	i2c_del_driver(&asb100_driver);
+}
+
+MODULE_AUTHOR("Mark M. Hoffman <mhoffman@lightlink.com>");
+MODULE_DESCRIPTION("ASB100 Bach driver");
+MODULE_LICENSE("GPL");
+
+module_init(asb100_init);
+module_exit(asb100_exit);
+
diff -Nru a/drivers/i2c/chips/eeprom.c b/drivers/i2c/chips/eeprom.c
--- a/drivers/i2c/chips/eeprom.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/i2c/chips/eeprom.c	Tue Feb  3 19:45:17 2004
@@ -6,6 +6,11 @@
     Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com>
     Copyright (C) 2003 IBM Corp.
 
+    2004-01-16  Jean Delvare <khali@linux-fr.org>
+    Divide the eeprom in 32-byte (arbitrary) slices. This significantly
+    speeds sensors up, as well as various scripts using the eeprom
+    module.
+
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
@@ -21,12 +26,16 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-/* #define DEBUG */
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_CHIP
+#define DEBUG	1
+#endif
 
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
+#include <linux/sched.h>
 #include <linux/i2c.h>
 #include <linux/i2c-sensor.h>
 
@@ -59,9 +68,10 @@
 /* Each client has this additional data */
 struct eeprom_data {
 	struct semaphore update_lock;
-	char valid;			/* !=0 if following fields are valid */
-	unsigned long last_updated;	/* In jiffies */
+	u8 valid;			/* bitfield, bit!=0 if slice is valid */
+	unsigned long last_updated[8];	/* In jiffies, 8 slices */
 	u8 data[EEPROM_SIZE];		/* Register values */
+	enum eeprom_nature nature;
 };
 
 
@@ -81,35 +91,36 @@
 
 static int eeprom_id = 0;
 
-static void eeprom_update_client(struct i2c_client *client)
+static void eeprom_update_client(struct i2c_client *client, u8 slice)
 {
 	struct eeprom_data *data = i2c_get_clientdata(client);
 	int i, j;
 
 	down(&data->update_lock);
 
-	if ((jiffies - data->last_updated > 300 * HZ) |
-	    (jiffies < data->last_updated) || !data->valid) {
-		dev_dbg(&client->dev, "Starting eeprom update\n");
+	if (!(data->valid & (1 << slice)) ||
+	    (jiffies - data->last_updated[slice] > 300 * HZ) ||
+	    (jiffies < data->last_updated[slice])) {
+		dev_dbg(&client->dev, "Starting eeprom update, slice %u\n", slice);
 
 		if (i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_READ_I2C_BLOCK)) {
-			for (i=0; i < EEPROM_SIZE; i += I2C_SMBUS_I2C_BLOCK_MAX)
+			for (i = slice << 5; i < (slice + 1) << 5; i += I2C_SMBUS_I2C_BLOCK_MAX)
 				if (i2c_smbus_read_i2c_block_data(client, i, data->data + i) != I2C_SMBUS_I2C_BLOCK_MAX)
 					goto exit;
 		} else {
-			if (i2c_smbus_write_byte(client, 0)) {
+			if (i2c_smbus_write_byte(client, slice << 5)) {
 				dev_dbg(&client->dev, "eeprom read start has failed!\n");
 				goto exit;
 			}
-			for (i = 0; i < EEPROM_SIZE; i++) {
+			for (i = slice << 5; i < (slice + 1) << 5; i++) {
 				j = i2c_smbus_read_byte(client);
 				if (j < 0)
 					goto exit;
 				data->data[i] = (u8) j;
 			}
 		}
-		data->last_updated = jiffies;
-		data->valid = 1;
+		data->last_updated[slice] = jiffies;
+		data->valid |= (1 << slice);
 	}
 exit:
 	up(&data->update_lock);
@@ -119,15 +130,27 @@
 {
 	struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj));
 	struct eeprom_data *data = i2c_get_clientdata(client);
-
-	eeprom_update_client(client);
+	u8 slice;
 
 	if (off > EEPROM_SIZE)
 		return 0;
 	if (off + count > EEPROM_SIZE)
 		count = EEPROM_SIZE - off;
 
-	memcpy(buf, &data->data[off], count);
+	/* Only refresh slices which contain requested bytes */
+	for (slice = off >> 5; slice <= (off + count - 1) >> 5; slice++)
+		eeprom_update_client(client, slice);
+
+	/* Hide Vaio security settings to regular users (16 first bytes) */
+	if (data->nature == VAIO && off < 16 && !capable(CAP_SYS_ADMIN)) {
+		int in_row1 = 16 - off;
+		memset(buf, 0, in_row1);
+		if (count - in_row1 > 0)
+			memcpy(buf + in_row1, &data->data[16], count - in_row1);
+	} else {
+		memcpy(buf, &data->data[off], count);
+	}
+
 	return count;
 }
 
@@ -151,7 +174,6 @@
 	int i, cs;
 	struct i2c_client *new_client;
 	struct eeprom_data *data;
-	enum eeprom_nature nature = UNKNOWN;
 	int err = 0;
 
 	/* Make sure we aren't probing the ISA bus!! This is just a safety check
@@ -199,6 +221,7 @@
 			goto exit_kfree;
 	}
 
+	data->nature = UNKNOWN;
 	/* Detect the Vaio nature of EEPROMs.
 	   We use the "PCG-" prefix as the signature. */
 	if (address == 0x57) {
@@ -206,17 +229,7 @@
 		    i2c_smbus_read_byte_data(new_client, 0x81) == 'C' && 
 		    i2c_smbus_read_byte_data(new_client, 0x82) == 'G' &&
 		    i2c_smbus_read_byte_data(new_client, 0x83) == '-')
-			nature = VAIO;
-	}
-
-	/* If this is a VIAO, then we only allow root to read from this file,
-	   as BIOS passwords can be present here in plaintext */
-	switch (nature) {
- 	case VAIO:
-		eeprom_attr.attr.mode = S_IRUSR;
-		break;
-	default:
-		eeprom_attr.attr.mode = S_IRUGO;
+			data->nature = VAIO;
 	}
 
 	/* Fill in the remaining client fields */
diff -Nru a/drivers/i2c/chips/it87.c b/drivers/i2c/chips/it87.c
--- a/drivers/i2c/chips/it87.c	Tue Feb  3 19:45:36 2004
+++ b/drivers/i2c/chips/it87.c	Tue Feb  3 19:45:36 2004
@@ -31,6 +31,11 @@
     type at module load time.
 */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_CHIP
+#define DEBUG	1
+#endif
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
@@ -667,10 +672,10 @@
 		}
 		else {
 			if (kind == 0)
-				printk
-				    ("it87.o: Ignoring 'force' parameter for unknown chip at "
-				     "adapter %d, address 0x%02x\n",
-				     i2c_adapter_id(adapter), address);
+				dev_info(&adapter->dev, 
+					"Ignoring 'force' parameter for unknown chip at "
+					"adapter %d, address 0x%02x\n",
+					i2c_adapter_id(adapter), address);
 			goto ERROR1;
 		}
 	}
diff -Nru a/drivers/i2c/chips/lm75.c b/drivers/i2c/chips/lm75.c
--- a/drivers/i2c/chips/lm75.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/i2c/chips/lm75.c	Tue Feb  3 19:45:16 2004
@@ -18,7 +18,10 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-/* #define DEBUG 1 */
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_CHIP
+#define DEBUG	1
+#endif
 
 #include <linux/module.h>
 #include <linux/init.h>
@@ -101,9 +104,9 @@
 set(temp_max, LM75_REG_TEMP_OS);
 set(temp_hyst, LM75_REG_TEMP_HYST);
 
-static DEVICE_ATTR(temp_max, S_IWUSR | S_IRUGO, show_temp_max, set_temp_max);
-static DEVICE_ATTR(temp_hyst, S_IWUSR | S_IRUGO, show_temp_hyst, set_temp_hyst);
-static DEVICE_ATTR(temp_input, S_IRUGO, show_temp_input, NULL);
+static DEVICE_ATTR(temp_max1, S_IWUSR | S_IRUGO, show_temp_max, set_temp_max);
+static DEVICE_ATTR(temp_hyst1, S_IWUSR | S_IRUGO, show_temp_hyst, set_temp_hyst);
+static DEVICE_ATTR(temp_input1, S_IRUGO, show_temp_input, NULL);
 
 static int lm75_attach_adapter(struct i2c_adapter *adapter)
 {
@@ -194,9 +197,9 @@
 	lm75_init_client(new_client);
 	
 	/* Register sysfs hooks */
-	device_create_file(&new_client->dev, &dev_attr_temp_max);
-	device_create_file(&new_client->dev, &dev_attr_temp_hyst);
-	device_create_file(&new_client->dev, &dev_attr_temp_input);
+	device_create_file(&new_client->dev, &dev_attr_temp_max1);
+	device_create_file(&new_client->dev, &dev_attr_temp_hyst1);
+	device_create_file(&new_client->dev, &dev_attr_temp_input1);
 
 	return 0;
 
diff -Nru a/drivers/i2c/chips/lm78.c b/drivers/i2c/chips/lm78.c
--- a/drivers/i2c/chips/lm78.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/i2c/chips/lm78.c	Tue Feb  3 19:45:41 2004
@@ -18,6 +18,11 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_CHIP
+#define DEBUG	1
+#endif
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
@@ -364,10 +369,10 @@
 	return count;
 }
 
-static DEVICE_ATTR(temp_input, S_IRUGO, show_temp, NULL)
-static DEVICE_ATTR(temp_max, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(temp_input1, S_IRUGO, show_temp, NULL)
+static DEVICE_ATTR(temp_max1, S_IRUGO | S_IWUSR,
 		show_temp_over, set_temp_over)
-static DEVICE_ATTR(temp_hyst, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(temp_hyst1, S_IRUGO | S_IWUSR,
 		show_temp_hyst, set_temp_hyst)
 
 /* 3 Fans */
@@ -615,7 +620,7 @@
 			kind = lm79;
 		else {
 			if (kind == 0)
-				printk(KERN_WARNING "lm78.o: Ignoring 'force' "
+				dev_warn(&adapter->dev, "Ignoring 'force' "
 					"parameter for unknown chip at "
 					"adapter %d, address 0x%02x\n",
 					i2c_adapter_id(adapter), address);
@@ -673,9 +678,9 @@
 	device_create_file(&new_client->dev, &dev_attr_in_input6);
 	device_create_file(&new_client->dev, &dev_attr_in_min6);
 	device_create_file(&new_client->dev, &dev_attr_in_max6);
-	device_create_file(&new_client->dev, &dev_attr_temp_input);
-	device_create_file(&new_client->dev, &dev_attr_temp_max);
-	device_create_file(&new_client->dev, &dev_attr_temp_hyst);
+	device_create_file(&new_client->dev, &dev_attr_temp_input1);
+	device_create_file(&new_client->dev, &dev_attr_temp_max1);
+	device_create_file(&new_client->dev, &dev_attr_temp_hyst1);
 	device_create_file(&new_client->dev, &dev_attr_fan_input1);
 	device_create_file(&new_client->dev, &dev_attr_fan_min1);
 	device_create_file(&new_client->dev, &dev_attr_fan_div1);
diff -Nru a/drivers/i2c/chips/lm83.c b/drivers/i2c/chips/lm83.c
--- a/drivers/i2c/chips/lm83.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/i2c/chips/lm83.c	Tue Feb  3 19:45:17 2004
@@ -27,6 +27,11 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_CHIP
+#define DEBUG	1
+#endif
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
@@ -270,7 +275,7 @@
 		    & 0x48) != 0x00) ||
 		    ((i2c_smbus_read_byte_data(new_client, LM83_REG_R_CONFIG)
 		    & 0x41) != 0x00)) {
-			dev_dbg(&client->dev,
+			dev_dbg(&adapter->dev,
 			    "LM83 detection failed at 0x%02x.\n", address);
 			goto exit_free;
 		}
diff -Nru a/drivers/i2c/chips/lm85.c b/drivers/i2c/chips/lm85.c
--- a/drivers/i2c/chips/lm85.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/i2c/chips/lm85.c	Tue Feb  3 19:45:17 2004
@@ -22,6 +22,11 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_CHIP
+#define DEBUG	1
+#endif
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
@@ -43,9 +48,6 @@
 /* Insmod parameters */
 SENSORS_INSMOD_4(lm85b, lm85c, adm1027, adt7463);
 
-/* Enable debug if true */
-static int	lm85debug = 0;
-
 /* The LM85 registers */
 
 #define	LM85_REG_IN(nr)			(0x20 + (nr))
@@ -797,19 +799,15 @@
 	company = lm85_read_value(new_client, LM85_REG_COMPANY);
 	verstep = lm85_read_value(new_client, LM85_REG_VERSTEP);
 
-	if (lm85debug) {
-		printk("lm85: Detecting device at %d,0x%02x with"
+	dev_dbg(&adapter->dev, "Detecting device at %d,0x%02x with"
 		" COMPANY: 0x%02x and VERSTEP: 0x%02x\n",
 		i2c_adapter_id(new_client->adapter), new_client->addr,
 		company, verstep);
-	}
 
 	/* If auto-detecting, Determine the chip type. */
 	if (kind <= 0) {
-		if (lm85debug) {
-			printk("lm85: Autodetecting device at %d,0x%02x ...\n",
+		dev_dbg(&adapter->dev, "Autodetecting device at %d,0x%02x ...\n",
 			i2c_adapter_id(adapter), address );
-		}
 		if( company == LM85_COMPANY_NATIONAL
 		    && verstep == LM85_VERSTEP_LM85C ) {
 			kind = lm85c ;
@@ -818,8 +816,8 @@
 			kind = lm85b ;
 		} else if( company == LM85_COMPANY_NATIONAL
 		    && (verstep & 0xf0) == LM85_VERSTEP_GENERIC ) {
-			printk("lm85: Unrecgonized version/stepping 0x%02x"
-			    " Defaulting to LM85.\n", verstep );
+			dev_err(&adapter->dev, "Unrecgonized version/stepping 0x%02x"
+				" Defaulting to LM85.\n", verstep);
 			kind = any_chip ;
 		} else if( company == LM85_COMPANY_ANALOG_DEV
 		    && verstep == LM85_VERSTEP_ADM1027 ) {
@@ -829,21 +827,19 @@
 			kind = adt7463 ;
 		} else if( company == LM85_COMPANY_ANALOG_DEV
 		    && (verstep & 0xf0) == LM85_VERSTEP_GENERIC ) {
-			printk("lm85: Unrecgonized version/stepping 0x%02x"
-			    " Defaulting to ADM1027.\n", verstep );
+			dev_err(&adapter->dev, "Unrecgonized version/stepping 0x%02x"
+				" Defaulting to ADM1027.\n", verstep);
 			kind = adm1027 ;
 		} else if( kind == 0 && (verstep & 0xf0) == 0x60) {
-			printk("lm85: Generic LM85 Version 6 detected\n");
+			dev_err(&adapter->dev, "Generic LM85 Version 6 detected\n");
 			/* Leave kind as "any_chip" */
 		} else {
-			if (lm85debug) {
-				printk("lm85: Autodetection failed\n");
-			}
+			dev_dbg(&adapter->dev, "Autodetection failed\n");
 			/* Not an LM85 ... */
 			if( kind == 0 ) {  /* User used force=x,y */
-			    printk("lm85: Generic LM85 Version 6 not"
-				" found at %d,0x%02x. Try force_lm85c.\n",
-				i2c_adapter_id(adapter), address );
+				dev_err(&adapter->dev, "Generic LM85 Version 6 not"
+					" found at %d,0x%02x. Try force_lm85c.\n",
+					i2c_adapter_id(adapter), address );
 			}
 			err = 0 ;
 			goto ERROR1;
@@ -874,12 +870,10 @@
 	data->valid = 0;
 	init_MUTEX(&data->update_lock);
 
-	if (lm85debug) {
-		printk("lm85: Assigning ID %d to %s at %d,0x%02x\n",
+	dev_dbg(&adapter->dev, "Assigning ID %d to %s at %d,0x%02x\n",
 		new_client->id, new_client->name,
 		i2c_adapter_id(new_client->adapter),
 		new_client->addr);
-	}
 
 	/* Tell the I2C layer a new client has arrived */
 	if ((err = i2c_attach_client(new_client)))
@@ -1016,31 +1010,24 @@
 	int value;
 	struct lm85_data *data = i2c_get_clientdata(client);
 
-	if (lm85debug) {
-		printk("lm85(%d): Initializing device\n", client->id);
-	}
+	dev_dbg(&client->dev, "Initializing device\n");
 
 	/* Warn if part was not "READY" */
 	value = lm85_read_value(client, LM85_REG_CONFIG);
-	if (lm85debug) {
-		printk("lm85(%d): LM85_REG_CONFIG is: 0x%02x\n", client->id, value );
-	}
+	dev_dbg(&client->dev, "LM85_REG_CONFIG is: 0x%02x\n", value);
 	if( value & 0x02 ) {
-		printk("lm85(%d): Client (%d,0x%02x) config is locked.\n",
-			    client->id,
+		dev_err(&client->dev, "Client (%d,0x%02x) config is locked.\n",
 			    i2c_adapter_id(client->adapter), client->addr );
 	};
 	if( ! (value & 0x04) ) {
-		printk("lm85(%d): Client (%d,0x%02x) is not ready.\n",
-			    client->id,
+		dev_err(&client->dev, "Client (%d,0x%02x) is not ready.\n",
 			    i2c_adapter_id(client->adapter), client->addr );
 	};
 	if( value & 0x10
 	    && ( data->type == adm1027
 		|| data->type == adt7463 ) ) {
-		printk("lm85(%d): Client (%d,0x%02x) VxI mode is set.  "
+		dev_err(&client->dev, "Client (%d,0x%02x) VxI mode is set.  "
 			"Please report this to the lm85 maintainer.\n",
-			    client->id,
 			    i2c_adapter_id(client->adapter), client->addr );
 	};
 
@@ -1056,11 +1043,8 @@
 	value = lm85_read_value(client, LM85_REG_CONFIG);
 	/* Try to clear LOCK, Set START, save everything else */
 	value = (value & ~ 0x02) | 0x01 ;
-	if (lm85debug) {
-		printk("lm85(%d): Setting CONFIG to: 0x%02x\n", client->id, value );
-	}
+	dev_dbg(&client->dev, "Setting CONFIG to: 0x%02x\n", value);
 	lm85_write_value(client, LM85_REG_CONFIG, value);
-
 }
 
 void lm85_update_client(struct i2c_client *client)
@@ -1073,10 +1057,8 @@
 	if ( !data->valid ||
 	     (jiffies - data->last_reading > LM85_DATA_INTERVAL ) ) {
 		/* Things that change quickly */
-
-		if (lm85debug) {
-			printk("lm85(%d): Reading sensor values\n", client->id);
-		}
+		dev_dbg(&client->dev, "Reading sensor values\n");
+		
 		/* Have to read extended bits first to "freeze" the
 		 * more significant bits that are read later.
 		 */
@@ -1120,10 +1102,8 @@
 	if ( !data->valid ||
 	     (jiffies - data->last_config > LM85_CONFIG_INTERVAL) ) {
 		/* Things that don't change often */
+		dev_dbg(&client->dev, "Reading config values\n");
 
-		if (lm85debug) {
-			printk("lm85(%d): Reading config values\n", client->id);
-		}
 		for (i = 0; i <= 4; ++i) {
 			data->in_min[i] =
 			    lm85_read_value(client, LM85_REG_IN_MIN(i));
@@ -1229,8 +1209,6 @@
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Philip Pokorny <ppokorny@penguincomputing.com>, Margit Schubert-While <margitsw@t-online.de>");
 MODULE_DESCRIPTION("LM85-B, LM85-C driver");
-MODULE_PARM(lm85debug, "i");
-MODULE_PARM_DESC(lm85debug, "Enable debugging statements");
 
 module_init(sm_lm85_init);
 module_exit(sm_lm85_exit);
diff -Nru a/drivers/i2c/chips/lm90.c b/drivers/i2c/chips/lm90.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/i2c/chips/lm90.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,525 @@
+/*
+ * lm90.c - Part of lm_sensors, Linux kernel modules for hardware
+ *          monitoring
+ * Copyright (C) 2003  Jean Delvare <khali@linux-fr.org>
+ *
+ * Based on the lm83 driver. The LM90 is a sensor chip made by National
+ * Semiconductor. It reports up to two temperatures (its own plus up to
+ * one external one) with a 0.125 deg resolution (1 deg for local
+ * temperature) and a 3-4 deg accuracy. Complete datasheet can be
+ * obtained from National's website at:
+ *   http://www.national.com/pf/LM/LM90.html
+ *
+ * This driver also supports the ADM1032, a sensor chip made by Analog
+ * Devices. That chip is similar to the LM90, with a few differences
+ * that are not handled by this driver. Complete datasheet can be
+ * obtained from Analog's website at:
+ *   http://products.analog.com/products/info.asp?product=ADM1032
+ *
+ * Since the LM90 was the first chipset supported by this driver, most
+ * comments will refer to this chipset, but are actually general and
+ * concern all supported chipsets, unless mentioned otherwise.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_CHIP
+#define DEBUG	1
+#endif
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/i2c.h>
+#include <linux/i2c-sensor.h>
+
+/*
+ * Addresses to scan
+ * Address is fully defined internally and cannot be changed.
+ */
+
+static unsigned short normal_i2c[] = { 0x4c, I2C_CLIENT_END };
+static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
+static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END };
+static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END };
+
+/*
+ * Insmod parameters
+ */
+
+SENSORS_INSMOD_2(lm90, adm1032);
+
+/*
+ * The LM90 registers
+ */
+
+#define LM90_REG_R_MAN_ID		0xFE
+#define LM90_REG_R_CHIP_ID		0xFF
+#define LM90_REG_R_CONFIG1		0x03
+#define LM90_REG_W_CONFIG1		0x09
+#define LM90_REG_R_CONFIG2		0xBF
+#define LM90_REG_W_CONFIG2		0xBF
+#define LM90_REG_R_CONVRATE		0x04
+#define LM90_REG_W_CONVRATE		0x0A
+#define LM90_REG_R_STATUS		0x02
+#define LM90_REG_R_LOCAL_TEMP		0x00
+#define LM90_REG_R_LOCAL_HIGH		0x05
+#define LM90_REG_W_LOCAL_HIGH		0x0B
+#define LM90_REG_R_LOCAL_LOW		0x06
+#define LM90_REG_W_LOCAL_LOW		0x0C
+#define LM90_REG_R_LOCAL_CRIT		0x20
+#define LM90_REG_W_LOCAL_CRIT		0x20
+#define LM90_REG_R_REMOTE_TEMPH		0x01
+#define LM90_REG_R_REMOTE_TEMPL		0x10
+#define LM90_REG_R_REMOTE_OFFSH		0x11
+#define LM90_REG_W_REMOTE_OFFSH		0x11
+#define LM90_REG_R_REMOTE_OFFSL		0x12
+#define LM90_REG_W_REMOTE_OFFSL		0x12
+#define LM90_REG_R_REMOTE_HIGHH		0x07
+#define LM90_REG_W_REMOTE_HIGHH		0x0D
+#define LM90_REG_R_REMOTE_HIGHL		0x13
+#define LM90_REG_W_REMOTE_HIGHL		0x13
+#define LM90_REG_R_REMOTE_LOWH		0x08
+#define LM90_REG_W_REMOTE_LOWH		0x0E
+#define LM90_REG_R_REMOTE_LOWL		0x14
+#define LM90_REG_W_REMOTE_LOWL		0x14
+#define LM90_REG_R_REMOTE_CRIT		0x19
+#define LM90_REG_W_REMOTE_CRIT		0x19
+#define LM90_REG_R_TCRIT_HYST		0x21
+#define LM90_REG_W_TCRIT_HYST		0x21
+
+/*
+ * Conversions and various macros
+ * The LM90 uses signed 8-bit values for the local temperatures,
+ * and signed 11-bit values for the remote temperatures (except
+ * T_CRIT). Note that TEMP2_TO_REG does not round values, but
+ * stick to the nearest lower value instead. Fixing it is just
+ * not worth it.
+ */
+
+#define TEMP1_FROM_REG(val)	((val & 0x80 ? val-0x100 : val) * 1000)
+#define TEMP1_TO_REG(val)	((val < 0 ? val+0x100*1000 : val) / 1000)
+#define TEMP2_FROM_REG(val)	(((val & 0x8000 ? val-0x10000 : val) >> 5) * 125)
+#define TEMP2_TO_REG(val)	((((val / 125) << 5) + (val < 0 ? 0x10000 : 0)) & 0xFFE0)
+#define HYST_FROM_REG(val)	(val * 1000)
+#define HYST_TO_REG(val)	(val <= 0 ? 0 : val >= 31000 ? 31 : val / 1000)
+
+/*
+ * Functions declaration
+ */
+
+static int lm90_attach_adapter(struct i2c_adapter *adapter);
+static int lm90_detect(struct i2c_adapter *adapter, int address,
+	int kind);
+static void lm90_init_client(struct i2c_client *client);
+static int lm90_detach_client(struct i2c_client *client);
+static void lm90_update_client(struct i2c_client *client);
+
+/*
+ * Driver data (common to all clients)
+ */
+
+static struct i2c_driver lm90_driver = {
+	.owner		= THIS_MODULE,
+	.name		= "lm90",
+	.id		= I2C_DRIVERID_LM90,
+	.flags		= I2C_DF_NOTIFY,
+	.attach_adapter	= lm90_attach_adapter,
+	.detach_client	= lm90_detach_client,
+};
+
+/*
+ * Client data (each client gets its own)
+ */
+
+struct lm90_data {
+	struct semaphore update_lock;
+	char valid; /* zero until following fields are valid */
+	unsigned long last_updated; /* in jiffies */
+
+	/* registers values */
+	u8 temp_input1, temp_low1, temp_high1; /* local */
+	u16 temp_input2, temp_low2, temp_high2; /* remote, combined */
+	u8 temp_crit1, temp_crit2;
+	u8 temp_hyst;
+	u16 alarms; /* bitvector, combined */
+};
+
+/*
+ * Internal variables
+ */
+
+static int lm90_id = 0;
+
+/*
+ * Sysfs stuff
+ */
+
+#define show_temp(value, converter) \
+static ssize_t show_##value(struct device *dev, char *buf) \
+{ \
+	struct i2c_client *client = to_i2c_client(dev); \
+	struct lm90_data *data = i2c_get_clientdata(client); \
+	lm90_update_client(client); \
+	return sprintf(buf, "%d\n", converter(data->value)); \
+}
+show_temp(temp_input1, TEMP1_FROM_REG);
+show_temp(temp_input2, TEMP2_FROM_REG);
+show_temp(temp_low1, TEMP1_FROM_REG);
+show_temp(temp_low2, TEMP2_FROM_REG);
+show_temp(temp_high1, TEMP1_FROM_REG);
+show_temp(temp_high2, TEMP2_FROM_REG);
+show_temp(temp_crit1, TEMP1_FROM_REG);
+show_temp(temp_crit2, TEMP1_FROM_REG);
+
+#define set_temp1(value, reg) \
+static ssize_t set_##value(struct device *dev, const char *buf, \
+	size_t count) \
+{ \
+	struct i2c_client *client = to_i2c_client(dev); \
+	struct lm90_data *data = i2c_get_clientdata(client); \
+	data->value = TEMP1_TO_REG(simple_strtol(buf, NULL, 10)); \
+	i2c_smbus_write_byte_data(client, reg, data->value); \
+	return count; \
+}
+#define set_temp2(value, regh, regl) \
+static ssize_t set_##value(struct device *dev, const char *buf, \
+	size_t count) \
+{ \
+	struct i2c_client *client = to_i2c_client(dev); \
+	struct lm90_data *data = i2c_get_clientdata(client); \
+	data->value = TEMP2_TO_REG(simple_strtol(buf, NULL, 10)); \
+	i2c_smbus_write_byte_data(client, regh, data->value >> 8); \
+	i2c_smbus_write_byte_data(client, regl, data->value & 0xff); \
+	return count; \
+}
+set_temp1(temp_low1, LM90_REG_W_LOCAL_LOW);
+set_temp2(temp_low2, LM90_REG_W_REMOTE_LOWH, LM90_REG_W_REMOTE_LOWL);
+set_temp1(temp_high1, LM90_REG_W_LOCAL_HIGH);
+set_temp2(temp_high2, LM90_REG_W_REMOTE_HIGHH, LM90_REG_W_REMOTE_HIGHL);
+set_temp1(temp_crit1, LM90_REG_W_LOCAL_CRIT);
+set_temp1(temp_crit2, LM90_REG_W_REMOTE_CRIT);
+
+#define show_temp_hyst(value, basereg) \
+static ssize_t show_##value(struct device *dev, char *buf) \
+{ \
+	struct i2c_client *client = to_i2c_client(dev); \
+	struct lm90_data *data = i2c_get_clientdata(client); \
+	lm90_update_client(client); \
+	return sprintf(buf, "%d\n", TEMP1_FROM_REG(data->basereg) \
+		       - HYST_FROM_REG(data->temp_hyst)); \
+}
+show_temp_hyst(temp_hyst1, temp_crit1);
+show_temp_hyst(temp_hyst2, temp_crit2);
+
+static ssize_t set_temp_hyst1(struct device *dev, const char *buf,
+	size_t count)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct lm90_data *data = i2c_get_clientdata(client);
+	int hyst = TEMP1_FROM_REG(data->temp_crit1) -
+		   simple_strtol(buf, NULL, 10);
+	i2c_smbus_write_byte_data(client, LM90_REG_W_TCRIT_HYST,
+				  HYST_TO_REG(hyst));
+	return count;
+}
+
+static ssize_t show_alarms(struct device *dev, char *buf)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct lm90_data *data = i2c_get_clientdata(client);
+	lm90_update_client(client);
+	return sprintf(buf, "%d\n", data->alarms);
+}
+
+static DEVICE_ATTR(temp_input1, S_IRUGO, show_temp_input1, NULL);
+static DEVICE_ATTR(temp_input2, S_IRUGO, show_temp_input2, NULL);
+static DEVICE_ATTR(temp_min1, S_IWUSR | S_IRUGO, show_temp_low1,
+	set_temp_low1);
+static DEVICE_ATTR(temp_min2, S_IWUSR | S_IRUGO, show_temp_low2,
+	set_temp_low2);
+static DEVICE_ATTR(temp_max1, S_IWUSR | S_IRUGO, show_temp_high1,
+	set_temp_high1);
+static DEVICE_ATTR(temp_max2, S_IWUSR | S_IRUGO, show_temp_high2,
+	set_temp_high2);
+static DEVICE_ATTR(temp_crit1, S_IWUSR | S_IRUGO, show_temp_crit1,
+	set_temp_crit1);
+static DEVICE_ATTR(temp_crit2, S_IWUSR | S_IRUGO, show_temp_crit2,
+	set_temp_crit2);
+static DEVICE_ATTR(temp_hyst1, S_IWUSR | S_IRUGO, show_temp_hyst1,
+	set_temp_hyst1);
+static DEVICE_ATTR(temp_hyst2, S_IRUGO, show_temp_hyst2, NULL);
+static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
+
+/*
+ * Real code
+ */
+
+static int lm90_attach_adapter(struct i2c_adapter *adapter)
+{
+	if (!(adapter->class & I2C_ADAP_CLASS_SMBUS))
+		return 0;
+	return i2c_detect(adapter, &addr_data, lm90_detect);
+}
+
+/*
+ * The following function does more than just detection. If detection
+ * succeeds, it also registers the new chip.
+ */
+static int lm90_detect(struct i2c_adapter *adapter, int address, int kind)
+{
+	struct i2c_client *new_client;
+	struct lm90_data *data;
+	int err = 0;
+	const char *name = "";
+	u8 reg_config1=0, reg_convrate=0;
+
+	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
+		goto exit;
+
+	if (!(new_client = kmalloc(sizeof(struct i2c_client) +
+	    sizeof(struct lm90_data), GFP_KERNEL))) {
+		err = -ENOMEM;
+		goto exit;
+	}
+	memset(new_client, 0x00, sizeof(struct i2c_client) +
+	       sizeof(struct lm90_data));
+
+	/* The LM90-specific data is placed right after the common I2C
+	 * client data. */
+	data = (struct lm90_data *) (new_client + 1);
+	i2c_set_clientdata(new_client, data);
+	new_client->addr = address;
+	new_client->adapter = adapter;
+	new_client->driver = &lm90_driver;
+	new_client->flags = 0;
+
+	/*
+	 * Now we do the remaining detection. A negative kind means that
+	 * the driver was loaded with no force parameter (default), so we
+	 * must both detect and identify the chip. A zero kind means that
+	 * the driver was loaded with the force parameter, the detection
+	 * step shall be skipped. A positive kind means that the driver
+	 * was loaded with the force parameter and a given kind of chip is
+	 * requested, so both the detection and the identification steps
+	 * are skipped.
+	 */
+	if (kind < 0) { /* detection */
+		reg_config1 = i2c_smbus_read_byte_data(new_client,
+			      LM90_REG_R_CONFIG1);
+		reg_convrate = i2c_smbus_read_byte_data(new_client,
+			       LM90_REG_R_CONVRATE);
+
+		if ((reg_config1 & 0x2A) != 0x00
+		 || reg_convrate > 0x0A) {
+			dev_dbg(&adapter->dev,
+				"LM90 detection failed at 0x%02x.\n",
+				address);
+			goto exit_free;
+		}
+	}
+
+	if (kind <= 0) { /* identification */
+		u8 man_id, chip_id;
+
+		man_id = i2c_smbus_read_byte_data(new_client,
+			 LM90_REG_R_MAN_ID);
+		chip_id = i2c_smbus_read_byte_data(new_client,
+			  LM90_REG_R_CHIP_ID);
+		
+		if (man_id == 0x01) { /* National Semiconductor */
+			if (chip_id >= 0x21 && chip_id < 0x30 /* LM90 */
+			 && (kind == 0 /* skip detection */
+			  || ((i2c_smbus_read_byte_data(new_client,
+				LM90_REG_R_CONFIG2) & 0xF8) == 0x00
+			   && reg_convrate <= 0x09))) {
+				kind = lm90;
+				name = "lm90";
+			}
+		}
+		else if (man_id == 0x41) { /* Analog Devices */
+			if ((chip_id & 0xF0) == 0x40 /* ADM1032 */
+			 && (kind == 0 /* skip detection */
+			  || (reg_config1 & 0x3F) == 0x00)) {
+				kind = adm1032;
+				name = "adm1032";
+			}
+		}
+
+		if (kind <= 0) { /* identification failed */
+			dev_info(&adapter->dev,
+			    "Unsupported chip (man_id=0x%02X, "
+			    "chip_id=0x%02X).\n", man_id, chip_id);
+			goto exit_free;
+		}
+	}
+
+	/* We can fill in the remaining client fields */
+	strlcpy(new_client->name, name, I2C_NAME_SIZE);
+	new_client->id = lm90_id++;
+	data->valid = 0;
+	init_MUTEX(&data->update_lock);
+
+	/* Tell the I2C layer a new client has arrived */
+	if ((err = i2c_attach_client(new_client)))
+		goto exit_free;
+
+	/* Initialize the LM90 chip */
+	lm90_init_client(new_client);
+
+	/* Register sysfs hooks */
+	device_create_file(&new_client->dev, &dev_attr_temp_input1);
+	device_create_file(&new_client->dev, &dev_attr_temp_input2);
+	device_create_file(&new_client->dev, &dev_attr_temp_min1);
+	device_create_file(&new_client->dev, &dev_attr_temp_min2);
+	device_create_file(&new_client->dev, &dev_attr_temp_max1);
+	device_create_file(&new_client->dev, &dev_attr_temp_max2);
+	device_create_file(&new_client->dev, &dev_attr_temp_crit1);
+	device_create_file(&new_client->dev, &dev_attr_temp_crit2);
+	device_create_file(&new_client->dev, &dev_attr_temp_hyst1);
+	device_create_file(&new_client->dev, &dev_attr_temp_hyst2);
+	device_create_file(&new_client->dev, &dev_attr_alarms);
+
+	return 0;
+
+exit_free:
+	kfree(new_client);
+exit:
+	return err;
+}
+
+static void lm90_init_client(struct i2c_client *client)
+{
+	u8 config;
+
+	/*
+	 * Start the conversions.
+	 */
+	i2c_smbus_write_byte_data(client, LM90_REG_W_CONVRATE,
+				  5); /* 2 Hz */
+	config = i2c_smbus_read_byte_data(client, LM90_REG_R_CONFIG1);
+	if (config & 0x40)
+		i2c_smbus_write_byte_data(client, LM90_REG_W_CONFIG1,
+					  config & 0xBF); /* run */
+}
+
+static int lm90_detach_client(struct i2c_client *client)
+{
+	int err;
+
+	if ((err = i2c_detach_client(client))) {
+		dev_err(&client->dev, "Client deregistration failed, "
+			"client not detached.\n");
+		return err;
+	}
+
+	kfree(client);
+	return 0;
+}
+
+static void lm90_update_client(struct i2c_client *client)
+{
+	struct lm90_data *data = i2c_get_clientdata(client);
+
+	down(&data->update_lock);
+
+	if ((jiffies - data->last_updated > HZ * 2) ||
+	    (jiffies < data->last_updated) ||
+	    !data->valid) {
+		u8 oldh, newh;
+
+		dev_dbg(&client->dev, "Updating lm90 data.\n");
+		data->temp_input1 = i2c_smbus_read_byte_data(client,
+				    LM90_REG_R_LOCAL_TEMP);
+		data->temp_high1 = i2c_smbus_read_byte_data(client,
+				   LM90_REG_R_LOCAL_HIGH);
+		data->temp_low1 = i2c_smbus_read_byte_data(client,
+				  LM90_REG_R_LOCAL_LOW);
+		data->temp_crit1 = i2c_smbus_read_byte_data(client,
+				   LM90_REG_R_LOCAL_CRIT);
+		data->temp_crit2 = i2c_smbus_read_byte_data(client,
+				   LM90_REG_R_REMOTE_CRIT);
+		data->temp_hyst = i2c_smbus_read_byte_data(client,
+				  LM90_REG_R_TCRIT_HYST);
+
+		/*
+		 * There is a trick here. We have to read two registers to
+		 * have the remote sensor temperature, but we have to beware
+		 * a conversion could occur inbetween the readings. The
+		 * datasheet says we should either use the one-shot
+		 * conversion register, which we don't want to do (disables
+		 * hardware monitoring) or monitor the busy bit, which is
+		 * impossible (we can't read the values and monitor that bit
+		 * at the exact same time). So the solution used here is to
+		 * read the high byte once, then the low byte, then the high
+		 * byte again. If the new high byte matches the old one,
+		 * then we have a valid reading. Else we have to read the low
+		 * byte again, and now we believe we have a correct reading.
+		 */
+		oldh = i2c_smbus_read_byte_data(client,
+		       LM90_REG_R_REMOTE_TEMPH);
+		data->temp_input2 = i2c_smbus_read_byte_data(client,
+				    LM90_REG_R_REMOTE_TEMPL);
+		newh = i2c_smbus_read_byte_data(client,
+		       LM90_REG_R_REMOTE_TEMPH);
+		if (newh != oldh) {
+			data->temp_input2 = i2c_smbus_read_byte_data(client,
+					    LM90_REG_R_REMOTE_TEMPL);
+#ifdef DEBUG
+			oldh = i2c_smbus_read_byte_data(client,
+			       LM90_REG_R_REMOTE_TEMPH);
+			/* oldh is actually newer */
+			if (newh != oldh)
+				dev_warn(&client->dev, "Remote temperature may be "
+					 "wrong.\n");
+#endif
+		}
+		data->temp_input2 |= (newh << 8);
+
+		data->temp_high2 = (i2c_smbus_read_byte_data(client,
+				   LM90_REG_R_REMOTE_HIGHH) << 8) +
+				   i2c_smbus_read_byte_data(client,
+				   LM90_REG_R_REMOTE_HIGHL);
+		data->temp_low2 = (i2c_smbus_read_byte_data(client,
+				  LM90_REG_R_REMOTE_LOWH) << 8) +
+				  i2c_smbus_read_byte_data(client,
+				  LM90_REG_R_REMOTE_LOWL);
+		data->alarms = i2c_smbus_read_byte_data(client,
+			       LM90_REG_R_STATUS);
+
+		data->last_updated = jiffies;
+		data->valid = 1;
+	}
+
+	up(&data->update_lock);
+}
+
+static int __init sensors_lm90_init(void)
+{
+	return i2c_add_driver(&lm90_driver);
+}
+
+static void __exit sensors_lm90_exit(void)
+{
+	i2c_del_driver(&lm90_driver);
+}
+
+MODULE_AUTHOR("Jean Delvare <khali@linux-fr.org>");
+MODULE_DESCRIPTION("LM90/ADM1032 driver");
+MODULE_LICENSE("GPL");
+
+module_init(sensors_lm90_init);
+module_exit(sensors_lm90_exit);
diff -Nru a/drivers/i2c/chips/via686a.c b/drivers/i2c/chips/via686a.c
--- a/drivers/i2c/chips/via686a.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/i2c/chips/via686a.c	Tue Feb  3 19:45:16 2004
@@ -31,6 +31,11 @@
     Warning - only supports a single device.
 */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_CHIP
+#define DEBUG	1
+#endif
+
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/pci.h>
diff -Nru a/drivers/i2c/chips/w83781d.c b/drivers/i2c/chips/w83781d.c
--- a/drivers/i2c/chips/w83781d.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/i2c/chips/w83781d.c	Tue Feb  3 19:45:16 2004
@@ -36,6 +36,11 @@
 
 */
 
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_CHIP
+#define DEBUG	1
+#endif
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
@@ -43,6 +48,7 @@
 #include <linux/i2c-sensor.h>
 #include <linux/i2c-vid.h>
 #include <asm/io.h>
+#include "lm75.h"
 
 /* RT Table support #defined so we can take it out if it gets bothersome */
 #define W83781D_RT			1
@@ -170,17 +176,14 @@
 					((val) == 255 ? 0 : \
 							1350000 / ((val) * (div))))
 
-#define TEMP_TO_REG(val)		(SENSORS_LIMIT(((val / 10) < 0 ? (((val / 10) - 5) / 10) : \
-									 ((val / 10) + 5) / 10), 0, 255))
-#define TEMP_FROM_REG(val)		((((val ) > 0x80 ? (val) - 0x100 : (val)) * 10) * 10)
-
-#define TEMP_ADD_TO_REG(val)		(SENSORS_LIMIT(((((val / 10) + 2) / 5) << 7),\
-                                              0, 0xffff))
-#define TEMP_ADD_FROM_REG(val)		((((val) >> 7) * 5) * 10)
-
-#define AS99127_TEMP_ADD_TO_REG(val)	(SENSORS_LIMIT((((((val / 10) + 2)*4)/10) \
-                                               << 7), 0, 0xffff))
-#define AS99127_TEMP_ADD_FROM_REG(val)	(((((val) >> 7) * 10) / 4) * 10)
+#define TEMP_TO_REG(val)		(SENSORS_LIMIT(((val) < 0 ? (val)+0x100*1000 \
+						: (val)) / 1000, 0, 0xff))
+#define TEMP_FROM_REG(val)		(((val) & 0x80 ? (val)-0x100 : (val)) * 1000)
+
+#define AS99127_TEMP_ADD_TO_REG(val)	(SENSORS_LIMIT((((val) < 0 ? (val)+0x10000*250 \
+						: (val)) / 250) << 7, 0, 0xffff))
+#define AS99127_TEMP_ADD_FROM_REG(val)	((((val) & 0x8000 ? (val)-0x10000 : (val)) \
+						>> 7) * 250)
 
 #define ALARMS_FROM_REG(val)		(val)
 #define PWM_FROM_REG(val)		(val)
@@ -437,8 +440,8 @@
 			return sprintf(buf,"%ld\n", \
 				(long)AS99127_TEMP_ADD_FROM_REG(data->reg##_add[nr-2])); \
 		} else { \
-			return sprintf(buf,"%ld\n", \
-				(long)TEMP_ADD_FROM_REG(data->reg##_add[nr-2])); \
+			return sprintf(buf,"%d\n", \
+				LM75_TEMP_FROM_REG(data->reg##_add[nr-2])); \
 		} \
 	} else {	/* TEMP1 */ \
 		return sprintf(buf,"%ld\n", (long)TEMP_FROM_REG(data->reg)); \
@@ -453,15 +456,15 @@
 { \
 	struct i2c_client *client = to_i2c_client(dev); \
 	struct w83781d_data *data = i2c_get_clientdata(client); \
-	u32 val; \
+	s32 val; \
 	 \
-	val = simple_strtoul(buf, NULL, 10); \
+	val = simple_strtol(buf, NULL, 10); \
 	 \
 	if (nr >= 2) {	/* TEMP2 and TEMP3 */ \
 		if (data->type == as99127f) \
 			data->temp_##reg##_add[nr-2] = AS99127_TEMP_ADD_TO_REG(val); \
 		else \
-			data->temp_##reg##_add[nr-2] = TEMP_ADD_TO_REG(val); \
+			data->temp_##reg##_add[nr-2] = LM75_TEMP_TO_REG(val); \
 		 \
 		w83781d_write_value(client, W83781D_REG_TEMP_##REG(nr), \
 				data->temp_##reg##_add[nr-2]); \
@@ -1653,7 +1656,7 @@
 	if (time_after
 	    (jiffies - data->last_updated, (unsigned long) (HZ + HZ / 2))
 	    || time_before(jiffies, data->last_updated) || !data->valid) {
-		pr_debug(KERN_DEBUG "Starting device update\n");
+		pr_debug("Starting device update\n");
 
 		for (i = 0; i <= 8; i++) {
 			if ((data->type == w83783s || data->type == w83697hf)
diff -Nru a/drivers/i2c/chips/w83l785ts.c b/drivers/i2c/chips/w83l785ts.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/i2c/chips/w83l785ts.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,314 @@
+/*
+ * w83l785ts.c - Part of lm_sensors, Linux kernel modules for hardware
+ *               monitoring
+ * Copyright (C) 2003-2004  Jean Delvare <khali@linux-fr.org>
+ *
+ * Inspired from the lm83 driver. The W83L785TS-S is a sensor chip made
+ * by Winbond. It reports a single external temperature with a 1 deg
+ * resolution and a 3 deg accuracy. Datasheet can be obtained from
+ * Winbond's website at:
+ *   http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/W83L785TS-S.pdf
+ *
+ * Ported to Linux 2.6 by Wolfgang Ziegler <nuppla@gmx.at> and Jean Delvare
+ * <khali@linux-fr.org>.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_CHIP
+#define DEBUG	1
+#endif
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/i2c.h>
+#include <linux/i2c-sensor.h>
+
+/*
+ * Address to scan
+ * Address is fully defined internally and cannot be changed.
+ */
+
+static unsigned short normal_i2c[] = { 0x2e, I2C_CLIENT_END };
+static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
+static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END };
+static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END };
+
+/*
+ * Insmod parameters
+ */
+
+SENSORS_INSMOD_1(w83l785ts);
+
+/*
+ * The W83L785TS-S registers
+ * Manufacturer ID is 0x5CA3 for Winbond.
+ */
+
+#define W83L785TS_REG_MAN_ID1		0x4D
+#define W83L785TS_REG_MAN_ID2		0x4C
+#define W83L785TS_REG_CHIP_ID		0x4E
+#define W83L785TS_REG_CONFIG		0x40
+#define W83L785TS_REG_TYPE		0x52
+#define W83L785TS_REG_TEMP		0x27
+#define W83L785TS_REG_TEMP_OVER		0x53 /* not sure about this one */
+
+/*
+ * Conversions
+ * The W83L785TS-S uses signed 8-bit values.
+ */
+
+#define TEMP_FROM_REG(val)	((val & 0x80 ? val-0x100 : val) * 1000)
+
+/*
+ * Functions declaration
+ */
+
+static int w83l785ts_attach_adapter(struct i2c_adapter *adapter);
+static int w83l785ts_detect(struct i2c_adapter *adapter, int address,
+	int kind);
+static int w83l785ts_detach_client(struct i2c_client *client);
+static void w83l785ts_update_client(struct i2c_client *client);
+
+/*
+ * Driver data (common to all clients)
+ */
+ 
+static struct i2c_driver w83l785ts_driver = {
+	.owner		= THIS_MODULE,
+	.name		= "w83l785ts",
+	.id		= I2C_DRIVERID_W83L785TS,
+	.flags		= I2C_DF_NOTIFY,
+	.attach_adapter	= w83l785ts_attach_adapter,
+	.detach_client	= w83l785ts_detach_client,
+};
+
+/*
+ * Client data (each client gets its own)
+ */
+
+struct w83l785ts_data {
+	
+	struct semaphore update_lock;
+	char valid; /* zero until following fields are valid */
+	unsigned long last_updated; /* in jiffies */
+
+	/* registers values */
+	u8 temp, temp_over;
+};
+
+/*
+ * Internal variables
+ */
+
+static int w83l785ts_id = 0;
+
+/*
+ * Sysfs stuff
+ */
+
+static ssize_t show_temp(struct device *dev, char *buf)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct w83l785ts_data *data = i2c_get_clientdata(client);
+	w83l785ts_update_client(client);
+	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp));
+}
+
+static ssize_t show_temp_over(struct device *dev, char *buf)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct w83l785ts_data *data = i2c_get_clientdata(client);
+	w83l785ts_update_client(client);
+	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over));
+}
+
+static DEVICE_ATTR(temp_input, S_IRUGO, show_temp, NULL)
+static DEVICE_ATTR(temp_max, S_IRUGO, show_temp_over, NULL)
+
+/*
+ * Real code
+ */
+
+static int w83l785ts_attach_adapter(struct i2c_adapter *adapter)
+{
+	if (!(adapter->class & I2C_ADAP_CLASS_SMBUS))
+		return 0;
+	return i2c_detect(adapter, &addr_data, w83l785ts_detect);
+}
+
+/*
+ * The following function does more than just detection. If detection
+ * succeeds, it also registers the new chip.
+ */
+static int w83l785ts_detect(struct i2c_adapter *adapter, int address, int kind)
+{
+	struct i2c_client *new_client;
+	struct w83l785ts_data *data;
+	int err = 0;
+	const char *name = "";
+
+
+	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
+		goto exit;
+
+	if (!(new_client = kmalloc(sizeof(struct i2c_client) +  
+		sizeof(struct w83l785ts_data), GFP_KERNEL))) {
+		err = -ENOMEM;
+		goto exit;
+	}
+	memset(new_client, 0x00, sizeof(struct i2c_client) +
+	       sizeof(struct w83l785ts_data));
+
+
+	/* The W83L785TS-specific data is placed right after the common I2C
+	 * client data. */
+	data = (struct w83l785ts_data *) (new_client + 1);
+	i2c_set_clientdata(new_client, data);
+	new_client->addr = address;
+	new_client->adapter = adapter;
+	new_client->driver = &w83l785ts_driver;
+	new_client->flags = 0;
+
+	/*
+	 * Now we do the remaining detection. A negative kind means that
+	 * the driver was loaded with no force parameter (default), so we
+	 * must both detect and identify the chip (actually there is only
+	 * one possible kind of chip for now, W83L785TS-S). A zero kind means
+	 * that the driver was loaded with the force parameter, the detection
+	 * step shall be skipped. A positive kind means that the driver
+	 * was loaded with the force parameter and a given kind of chip is
+	 * requested, so both the detection and the identification steps
+	 * are skipped.
+	 */
+	if (kind < 0) { /* detection */
+		if (((i2c_smbus_read_byte_data(new_client,
+		      W83L785TS_REG_CONFIG) & 0x80) != 0x00)
+		 || ((i2c_smbus_read_byte_data(new_client,
+		      W83L785TS_REG_TYPE) & 0xFC) != 0x00)) {
+			dev_dbg(&adapter->dev,
+				"W83L785TS-S detection failed at 0x%02x.\n",
+				address);
+			goto exit_free;
+		}
+	}
+
+	if (kind <= 0) { /* identification */
+		u16 man_id;
+		u8 chip_id;
+
+		man_id = (i2c_smbus_read_byte_data(new_client,
+			 W83L785TS_REG_MAN_ID1) << 8) +
+			 i2c_smbus_read_byte_data(new_client,
+			 W83L785TS_REG_MAN_ID2);
+		chip_id = i2c_smbus_read_byte_data(new_client,
+			  W83L785TS_REG_CHIP_ID);
+
+		if (man_id == 0x5CA3) { /* Winbond */
+			if (chip_id == 0x70) { /* W83L785TS-S */
+				kind = w83l785ts;			
+				name = "w83l785ts";
+			}
+		}
+	
+		if (kind <= 0) { /* identification failed */
+			dev_info(&adapter->dev,
+				 "Unsupported chip (man_id=0x%04X, "
+				 "chip_id=0x%02X).\n", man_id, chip_id);
+			goto exit_free;
+		}
+	}
+
+	/* We can fill in the remaining client fields. */
+	strlcpy(new_client->name, name, I2C_NAME_SIZE);
+	new_client->id = w83l785ts_id++;
+	data->valid = 0;
+	init_MUTEX(&data->update_lock);
+
+	/* Tell the I2C layer a new client has arrived. */
+	if ((err = i2c_attach_client(new_client))) 
+		goto exit_free;
+
+	/*
+	 * Initialize the W83L785TS chip
+	 * Nothing yet, assume it is already started.
+	 */
+
+	/* Register sysfs hooks */
+	device_create_file(&new_client->dev, &dev_attr_temp_input);
+	device_create_file(&new_client->dev, &dev_attr_temp_max);
+
+	return 0;
+
+exit_free:
+	kfree(new_client);
+exit:
+	return err;
+}
+
+static int w83l785ts_detach_client(struct i2c_client *client)
+{
+	int err;
+
+	if ((err = i2c_detach_client(client))) {
+		dev_err(&client->dev, "Client deregistration failed, "
+			"client not detached.\n");
+		return err;
+	}
+
+	kfree(client);
+	return 0;
+}
+
+static void w83l785ts_update_client(struct i2c_client *client)
+{
+	struct w83l785ts_data *data = i2c_get_clientdata(client);
+
+	down(&data->update_lock);
+
+	if (!data->valid
+	 || (jiffies - data->last_updated > HZ * 2)
+	 || (jiffies < data->last_updated)) {
+		dev_dbg(&client->dev, "Updating w83l785ts data.\n");
+		data->temp = i2c_smbus_read_byte_data(client,
+			     W83L785TS_REG_TEMP);
+		data->temp_over = i2c_smbus_read_byte_data(client,
+				  W83L785TS_REG_TEMP_OVER);
+
+		data->last_updated = jiffies;
+		data->valid = 1;
+	}
+
+	up(&data->update_lock);
+}
+
+static int __init sensors_w83l785ts_init(void)
+{
+	return i2c_add_driver(&w83l785ts_driver);
+}
+
+static void __exit sensors_w83l785ts_exit(void)
+{
+	i2c_del_driver(&w83l785ts_driver);
+}
+
+MODULE_AUTHOR("Jean Delvare <khali@linux-fr.org>");
+MODULE_DESCRIPTION("W83L785TS-S driver");
+MODULE_LICENSE("GPL");
+
+module_init(sensors_w83l785ts_init);
+module_exit(sensors_w83l785ts_exit);
diff -Nru a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
--- a/drivers/i2c/i2c-core.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/i2c/i2c-core.c	Tue Feb  3 19:45:17 2004
@@ -21,9 +21,10 @@
    All SMBus-related things are written by Frodo Looijaard <frodol@dds.nl>
    SMBus 2.0 support by Mark Studebaker <mdsxyz123@yahoo.com>                */
 
-/* $Id: i2c-core.c,v 1.95 2003/01/22 05:25:08 kmalkki Exp $ */
-
-/* #define DEBUG 1 */		/* needed to pick up the dev_dbg() calls */
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_CORE
+#define DEBUG	1
+#endif
 
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -35,16 +36,10 @@
 #include <asm/uaccess.h>
 
 
-#define DEB(x) if (i2c_debug>=1) x;
-#define DEB2(x) if (i2c_debug>=2) x;
-
 static LIST_HEAD(adapters);
 static LIST_HEAD(drivers);
 static DECLARE_MUTEX(core_lists);
 
-/**** debug level */
-static int i2c_debug;
-
 int i2c_device_probe(struct device *dev)
 {
 	return -ENODEV;
@@ -162,7 +157,7 @@
 	}
 	up(&core_lists);
 
-	DEB(dev_dbg(&adap->dev, "registered as adapter #%d\n", adap->nr));
+	dev_dbg(&adap->dev, "registered as adapter #%d\n", adap->nr);
 	return 0;
 }
 
@@ -217,7 +212,7 @@
 	wait_for_completion(&adap->dev_released);
 	wait_for_completion(&adap->class_dev_released);
 
-	DEB(dev_dbg(&adap->dev, "adapter unregistered\n"));
+	dev_dbg(&adap->dev, "adapter unregistered\n");
 
  out_unlock:
 	up(&core_lists);
@@ -250,7 +245,7 @@
 		goto out_unlock;
 	
 	list_add_tail(&driver->list,&drivers);
-	DEB(printk(KERN_DEBUG "i2c-core.o: driver %s registered.\n",driver->name));
+	pr_debug("i2c-core: driver %s registered.\n", driver->name);
 
 	/* now look for instances of driver on our adapters */
 	if (driver->flags & I2C_DF_NOTIFY) {
@@ -279,14 +274,14 @@
 	 * attached. If so, detach them to be able to kill the driver 
 	 * afterwards.
 	 */
-	DEB2(printk(KERN_DEBUG "i2c-core.o: unregister_driver - looking for clients.\n"));
+	pr_debug("i2c-core: unregister_driver - looking for clients.\n");
 	/* removing clients does not depend on the notify flag, else 
 	 * invalid operation might (will!) result, when using stale client
 	 * pointers.
 	 */
 	list_for_each(item1,&adapters) {
 		adap = list_entry(item1, struct i2c_adapter, list);
-		DEB2(dev_dbg(&adap->dev, "examining adapter\n"));
+		dev_dbg(&adap->dev, "examining adapter\n");
 		if (driver->detach_adapter) {
 			if ((res = driver->detach_adapter(adap))) {
 				dev_warn(&adap->dev, "while unregistering "
@@ -300,9 +295,7 @@
 				client = list_entry(item2, struct i2c_client, list);
 				if (client->driver != driver)
 					continue;
-				DEB2(printk(KERN_DEBUG "i2c-core.o: "
-					    "detaching client %s:\n",
-					    client->name));
+				pr_debug("i2c-core.o: detaching client %s:\n", client->name);
 				if ((res = driver->detach_client(client))) {
 					dev_err(&adap->dev, "while "
 						"unregistering driver "
@@ -321,7 +314,7 @@
 
 	driver_unregister(&driver->driver);
 	list_del(&driver->list);
-	DEB(printk(KERN_DEBUG "i2c-core.o: driver unregistered: %s\n",driver->name));
+	pr_debug("i2c-core: driver unregistered: %s\n", driver->name);
 
  out_unlock:
 	up(&core_lists);
@@ -372,8 +365,8 @@
 		}
 	}
 
-	DEB(dev_dbg(&adapter->dev, "client [%s] registered to adapter\n",
-			client->dev.name));
+	dev_dbg(&adapter->dev, "client [%s] registered to adapter\n",
+		client->name);
 
 	if (client->flags & I2C_CLIENT_ALLOW_USE)
 		client->usage_count = 0;
@@ -385,7 +378,7 @@
 	
 	snprintf(&client->dev.bus_id[0], sizeof(client->dev.bus_id),
 		"%d-%04x", i2c_adapter_id(adapter), client->addr);
-	printk("registering %s\n", client->dev.bus_id);
+	pr_debug("registering %s\n", client->dev.bus_id);
 	device_register(&client->dev);
 	device_create_file(&client->dev, &dev_attr_client_name);
 	
@@ -404,8 +397,8 @@
 	if (adapter->client_unregister)  {
 		res = adapter->client_unregister(client);
 		if (res) {
-			printk(KERN_ERR
-			       "i2c-core.o: client_unregister [%s] failed, "
+			dev_err(&client->dev,
+			       "client_unregister [%s] failed, "
 			       "client not detached", client->name);
 			goto out;
 		}
@@ -467,9 +460,9 @@
 	if(client->flags & I2C_CLIENT_ALLOW_USE) {
 		if(client->usage_count>0)
 			client->usage_count--;
-		else
-		{
-			printk(KERN_WARNING " i2c-core.o: dec_use_client used one too many times\n");
+		else {
+			pr_debug("i2c-core: %s used one too many times\n",
+				__FUNCTION__);
 			return -EPERM;
 		}
 	}
@@ -544,7 +537,7 @@
 	int ret;
 
 	if (adap->algo->master_xfer) {
- 	 	DEB2(dev_dbg(&adap->dev, "master_xfer: with %d msgs.\n", num));
+ 	 	dev_dbg(&adap->dev, "master_xfer: with %d msgs.\n", num);
 
 		down(&adap->bus_lock);
 		ret = adap->algo->master_xfer(adap,msgs,num);
@@ -552,7 +545,7 @@
 
 		return ret;
 	} else {
-		DEB2(dev_dbg(&adap->dev, "I2C level transfers not supported\n"));
+		dev_dbg(&adap->dev, "I2C level transfers not supported\n");
 		return -ENOSYS;
 	}
 }
@@ -569,8 +562,8 @@
 		msg.len = count;
 		msg.buf = (char *)buf;
 	
-		DEB2(dev_dbg(&client->adapter->dev, "master_send: writing %d bytes.\n",
-				count));
+		dev_dbg(&client->adapter->dev, "master_send: writing %d bytes.\n",
+			count);
 	
 		down(&adap->bus_lock);
 		ret = adap->algo->master_xfer(adap,&msg,1);
@@ -598,15 +591,15 @@
 		msg.len = count;
 		msg.buf = buf;
 
-		DEB2(dev_dbg(&client->adapter->dev, "master_recv: reading %d bytes.\n",
-				count));
+		dev_dbg(&client->adapter->dev, "master_recv: reading %d bytes.\n",
+			count);
 	
 		down(&adap->bus_lock);
 		ret = adap->algo->master_xfer(adap,&msg,1);
 		up(&adap->bus_lock);
 	
-		DEB2(printk(KERN_DEBUG "i2c-core.o: master_recv: return:%d (count:%d, addr:0x%02x)\n",
-			ret, count, client->addr));
+		dev_dbg(&client->dev, "master_recv: return:%d (count:%d, addr:0x%02x)\n",
+			ret, count, client->addr);
 	
 		/* if everything went ok (i.e. 1 msg transmitted), return #bytes
 	 	* transmitted, else error code.
@@ -625,8 +618,8 @@
 	int ret = 0;
 	struct i2c_adapter *adap = client->adapter;
 
-	DEB2(printk(KERN_DEBUG "i2c-core.o: i2c ioctl, cmd: 0x%x, arg: %#lx\n", cmd, arg));
-	switch ( cmd ) {
+	dev_dbg(&client->dev, "i2c ioctl, cmd: 0x%x, arg: %#lx\n", cmd, arg);
+	switch (cmd) {
 		case I2C_RETRIES:
 			adap->retries = arg;
 			break;
@@ -670,8 +663,8 @@
 			if (((adap_id == address_data->force[i]) || 
 			     (address_data->force[i] == ANY_I2C_BUS)) &&
 			     (addr == address_data->force[i+1])) {
-				DEB2(printk(KERN_DEBUG "i2c-core.o: found force parameter for adapter %d, addr %04x\n",
-				            adap_id,addr));
+				dev_dbg(&adapter->dev, "found force parameter for adapter %d, addr %04x\n",
+					adap_id, addr);
 				if ((err = found_proc(adapter,addr,0)))
 					return err;
 				found = 1;
@@ -688,8 +681,8 @@
 			if (((adap_id == address_data->ignore[i]) || 
 			    ((address_data->ignore[i] == ANY_I2C_BUS))) &&
 			    (addr == address_data->ignore[i+1])) {
-				DEB2(printk(KERN_DEBUG "i2c-core.o: found ignore parameter for adapter %d, "
-				     "addr %04x\n", adap_id ,addr));
+				dev_dbg(&adapter->dev, "found ignore parameter for adapter %d, "
+					"addr %04x\n", adap_id ,addr);
 				found = 1;
 			}
 		}
@@ -700,8 +693,8 @@
 			    ((address_data->ignore_range[i]==ANY_I2C_BUS))) &&
 			    (addr >= address_data->ignore_range[i+1]) &&
 			    (addr <= address_data->ignore_range[i+2])) {
-				DEB2(printk(KERN_DEBUG "i2c-core.o: found ignore_range parameter for adapter %d, "
-				            "addr %04x\n", adap_id,addr));
+				dev_dbg(&adapter->dev, "found ignore_range parameter for adapter %d, "
+					"addr %04x\n", adap_id,addr);
 				found = 1;
 			}
 		}
@@ -715,8 +708,8 @@
 		     i += 1) {
 			if (addr == address_data->normal_i2c[i]) {
 				found = 1;
-				DEB2(printk(KERN_DEBUG "i2c-core.o: found normal i2c entry for adapter %d, "
-				            "addr %02x", adap_id,addr));
+				dev_dbg(&adapter->dev, "found normal i2c entry for adapter %d, "
+					"addr %02x", adap_id,addr);
 			}
 		}
 
@@ -726,8 +719,8 @@
 			if ((addr >= address_data->normal_i2c_range[i]) &&
 			    (addr <= address_data->normal_i2c_range[i+1])) {
 				found = 1;
-				DEB2(printk(KERN_DEBUG "i2c-core.o: found normal i2c_range entry for adapter %d, "
-				            "addr %04x\n", adap_id,addr));
+				dev_dbg(&adapter->dev, "found normal i2c_range entry for adapter %d, "
+					"addr %04x\n", adap_id,addr);
 			}
 		}
 
@@ -738,8 +731,8 @@
 			    ((address_data->probe[i] == ANY_I2C_BUS))) &&
 			    (addr == address_data->probe[i+1])) {
 				found = 1;
-				DEB2(printk(KERN_DEBUG "i2c-core.o: found probe parameter for adapter %d, "
-				            "addr %04x\n", adap_id,addr));
+				dev_dbg(&adapter->dev, "found probe parameter for adapter %d, "
+					"addr %04x\n", adap_id,addr);
 			}
 		}
 		for (i = 0;
@@ -750,8 +743,8 @@
 			   (addr >= address_data->probe_range[i+1]) &&
 			   (addr <= address_data->probe_range[i+2])) {
 				found = 1;
-				DEB2(printk(KERN_DEBUG "i2c-core.o: found probe_range parameter for adapter %d, "
-				            "addr %04x\n", adap_id,addr));
+				dev_dbg(&adapter->dev, "found probe_range parameter for adapter %d, "
+					"addr %04x\n", adap_id,addr);
 			}
 		}
 		if (!found) 
@@ -908,9 +901,9 @@
 			cpec = rpec = 0;
 			break;
 	}
-	if(rpec != cpec) {
-		DEB(printk(KERN_DEBUG "i2c-core.o: Bad PEC 0x%02x vs. 0x%02x\n",
-		           rpec, cpec));
+	if (rpec != cpec) {
+		pr_debug("i2c-core: Bad PEC 0x%02x vs. 0x%02x\n",
+			rpec, cpec);
 		return -1;
 	}
 	return 0;	
@@ -1130,13 +1123,13 @@
 	case I2C_SMBUS_BLOCK_DATA:
 	case I2C_SMBUS_BLOCK_DATA_PEC:
 		if (read_write == I2C_SMBUS_READ) {
-			printk(KERN_ERR "i2c-core.o: Block read not supported "
+			dev_err(&adapter->dev, "Block read not supported "
 			       "under I2C emulation!\n");
 			return -1;
 		} else {
 			msg[0].len = data->block[0] + 2;
 			if (msg[0].len > I2C_SMBUS_BLOCK_MAX + 2) {
-				printk(KERN_ERR "i2c-core.o: smbus_access called with "
+				dev_err(&adapter->dev, "smbus_access called with "
 				       "invalid block write size (%d)\n",
 				       data->block[0]);
 				return -1;
@@ -1149,7 +1142,7 @@
 		break;
 	case I2C_SMBUS_BLOCK_PROC_CALL:
 	case I2C_SMBUS_BLOCK_PROC_CALL_PEC:
-		printk(KERN_ERR "i2c-core.o: Block process call not supported "
+		dev_dbg(&adapter->dev, "Block process call not supported "
 		       "under I2C emulation!\n");
 		return -1;
 	case I2C_SMBUS_I2C_BLOCK_DATA:
@@ -1158,7 +1151,7 @@
 		} else {
 			msg[0].len = data->block[0] + 1;
 			if (msg[0].len > I2C_SMBUS_I2C_BLOCK_MAX + 1) {
-				printk("i2c-core.o: i2c_smbus_xfer_emulated called with "
+				dev_err(&adapter->dev, "i2c_smbus_xfer_emulated called with "
 				       "invalid block write size (%d)\n",
 				       data->block[0]);
 				return -1;
@@ -1168,7 +1161,7 @@
 		}
 		break;
 	default:
-		printk(KERN_ERR "i2c-core.o: smbus_access called with invalid size (%d)\n",
+		dev_err(&adapter->dev, "smbus_access called with invalid size (%d)\n",
 		       size);
 		return -1;
 	}
@@ -1303,6 +1296,3 @@
 MODULE_AUTHOR("Simon G. Vogl <simon@tk.uni-linz.ac.at>");
 MODULE_DESCRIPTION("I2C-Bus main module");
 MODULE_LICENSE("GPL");
-
-MODULE_PARM(i2c_debug, "i");
-MODULE_PARM_DESC(i2c_debug,"debug level");
diff -Nru a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
--- a/drivers/i2c/i2c-dev.c	Tue Feb  3 19:45:36 2004
+++ b/drivers/i2c/i2c-dev.c	Tue Feb  3 19:45:36 2004
@@ -29,8 +29,10 @@
 /* The devfs code is contributed by Philipp Matthias Hahn 
    <pmhahn@titan.lahn.de> */
 
-/* If you want debugging uncomment: */
-/* #define DEBUG 1 */
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_CORE
+#define DEBUG	1
+#endif
 
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -137,7 +139,7 @@
 	if (tmp==NULL)
 		return -ENOMEM;
 
-	pr_debug("i2c-dev.o: i2c-%d reading %d bytes.\n",
+	pr_debug("i2c-dev: i2c-%d reading %d bytes.\n",
 		iminor(file->f_dentry->d_inode), count);
 
 	ret = i2c_master_recv(client,tmp,count);
@@ -165,7 +167,7 @@
 		return -EFAULT;
 	}
 
-	pr_debug("i2c-dev.o: i2c-%d writing %d bytes.\n",
+	pr_debug("i2c-dev: i2c-%d writing %d bytes.\n",
 		iminor(file->f_dentry->d_inode), count);
 
 	ret = i2c_master_send(client,tmp,count);
diff -Nru a/drivers/i2c/i2c-sensor.c b/drivers/i2c/i2c-sensor.c
--- a/drivers/i2c/i2c-sensor.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/i2c/i2c-sensor.c	Tue Feb  3 19:45:28 2004
@@ -19,7 +19,10 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-/* #define DEBUG 1 */
+#include <linux/config.h>
+#ifdef CONFIG_I2C_DEBUG_CORE
+#define DEBUG	1
+#endif
 
 #include <linux/module.h>
 #include <linux/kernel.h>
diff -Nru a/drivers/ide/Kconfig b/drivers/ide/Kconfig
--- a/drivers/ide/Kconfig	Tue Feb  3 19:45:17 2004
+++ b/drivers/ide/Kconfig	Tue Feb  3 19:45:17 2004
@@ -97,7 +97,7 @@
 
 config BLK_DEV_HD_IDE
 	bool "Use old disk-only driver on primary interface"
-	depends on X86 && X86_PC9800!=y
+	depends on ((X86 && X86_PC9800!=y) || SH_MPC1211)
 	---help---
 	  There are two drivers for MFM/RLL/IDE disks.  Most people use just
 	  the new enhanced driver by itself.  This option however installs the
@@ -296,6 +296,12 @@
 
 comment "IDE chipset support/bugfixes"
 
+config IDE_GENERIC
+	tristate "generic/default IDE chipset support"
+	default y
+	help
+	  If unsure, say Y.
+
 config BLK_DEV_CMD640
 	bool "CMD640 chipset bugfix/support"
 	depends on X86
@@ -734,10 +740,10 @@
 
 # FIXME - probably wants to be one for old and for new
 config PDC202XX_FORCE
-	bool "Special FastTrak Feature"
+	bool "Enable controller even if disabled by BIOS"
 	depends on BLK_DEV_PDC202XX_NEW=y
 	help
-	  For FastTrak enable overriding BIOS.
+	  Enable the PDC202xx controller even if it has been disabled in the BIOS setup.
 
 config BLK_DEV_SVWKS
 	tristate "ServerWorks OSB4/CSB5/CSB6 chipsets support"
@@ -747,7 +753,7 @@
 
 config BLK_DEV_SGIIOC4
 	tristate "Silicon Graphics IOC4 chipset support"
-	depends on IA64_SGI_SN2
+	depends on IA64_SGI_SN2 || IA64_GENERIC
 	help
 	  This driver adds PIO & MultiMode DMA-2 support for the SGI IOC4
 	  chipset, which has one channel and can support two devices.
@@ -899,12 +905,16 @@
 	bool "Amiga Gayle IDE interface support"
 	depends on AMIGA
 	help
-	  This is the IDE driver for the builtin IDE interface on some Amiga
-	  models. It supports both the `A1200 style' (used in A600 and A1200)
-	  and `A4000 style' (used in A4000 and A4000T) of the Gayle IDE
-	  interface. Say Y if you have such an Amiga model and want to use IDE
-	  devices (hard disks, CD-ROM drives, etc.) that are connected to the
-	  builtin IDE interface.
+	  This is the IDE driver for the Amiga Gayle IDE interface. It supports
+	  both the `A1200 style' and `A4000 style' of the Gayle IDE interface,
+	  This includes builtin IDE interfaces on some Amiga models (A600,
+	  A1200, A4000, and A4000T), and IDE interfaces on the Zorro expansion
+	  bus (M-Tech E-Matrix 530 expansion card).
+	  Say Y if you have an Amiga with a Gayle IDE interface and want to use
+	  IDE devices (hard disks, CD-ROM drives, etc.) that are connected to
+	  it.
+	  Note that you also have to enable Zorro bus support if you want to
+	  use Gayle IDE interfaces on the Zorro expansion bus.
 
 config BLK_DEV_IDEDOUBLER
 	bool "Amiga IDE Doubler support (EXPERIMENTAL)"
diff -Nru a/drivers/ide/Makefile b/drivers/ide/Makefile
--- a/drivers/ide/Makefile	Tue Feb  3 19:45:26 2004
+++ b/drivers/ide/Makefile	Tue Feb  3 19:45:26 2004
@@ -8,24 +8,43 @@
 # In the future, some of these should be built conditionally.
 #
 # First come modules that register themselves with the core
+
+EXTRA_CFLAGS				+= -Idrivers/ide
+
 obj-$(CONFIG_BLK_DEV_IDE)		+= pci/
 
+ide-core-y += ide.o ide-default.o ide-io.o ide-iops.o ide-lib.o ide-probe.o \
+	ide-taskfile.o
+
+ide-core-$(CONFIG_BLK_DEV_CMD640)	+= pci/cmd640.o
+
 # Core IDE code - must come before legacy
+ide-core-$(CONFIG_BLK_DEV_IDEPCI)	+= setup-pci.o
+ide-core-$(CONFIG_BLK_DEV_IDEDMA_PCI)	+= ide-dma.o
+ide-core-$(CONFIG_BLK_DEV_IDE_TCQ)	+= ide-tcq.o
+ide-core-$(CONFIG_PROC_FS)		+= ide-proc.o
+ide-core-$(CONFIG_BLK_DEV_IDEPNP)	+= ide-pnp.o
+
+# built-in only drivers from legacy/
+ide-core-$(CONFIG_BLK_DEV_IDE_PC9800)	+= legacy/pc9800.o
+ide-core-$(CONFIG_BLK_DEV_BUDDHA)	+= legacy/buddha.o
+ide-core-$(CONFIG_BLK_DEV_FALCON_IDE)	+= legacy/falconide.o
+ide-core-$(CONFIG_BLK_DEV_GAYLE)	+= legacy/gayle.o
+ide-core-$(CONFIG_BLK_DEV_MAC_IDE)	+= legacy/macide.o
+ide-core-$(CONFIG_BLK_DEV_Q40IDE)	+= legacy/q40ide.o
+
+# built-in only drivers from ppc/
+ide-core-$(CONFIG_BLK_DEV_MPC8xx_IDE)	+= ppc/mpc8xx.o
+ide-core-$(CONFIG_BLK_DEV_IDE_PMAC)	+= ppc/pmac.o
+ide-core-$(CONFIG_BLK_DEV_IDE_SWARM)	+= ppc/swarm.o
+
+obj-$(CONFIG_BLK_DEV_IDE)		+= ide-core.o
+obj-$(CONFIG_IDE_GENERIC)		+= ide-generic.o
 
-obj-$(CONFIG_BLK_DEV_IDE)		+= ide-io.o ide-probe.o ide-iops.o ide-taskfile.o ide.o ide-lib.o ide-default.o
 obj-$(CONFIG_BLK_DEV_IDEDISK)		+= ide-disk.o
 obj-$(CONFIG_BLK_DEV_IDECD)		+= ide-cd.o
 obj-$(CONFIG_BLK_DEV_IDETAPE)		+= ide-tape.o
 obj-$(CONFIG_BLK_DEV_IDEFLOPPY)		+= ide-floppy.o
 
-obj-$(CONFIG_BLK_DEV_IDEPCI)		+= setup-pci.o
-obj-$(CONFIG_BLK_DEV_IDEDMA_PCI)	+= ide-dma.o
-obj-$(CONFIG_BLK_DEV_IDE_TCQ)		+= ide-tcq.o
-obj-$(CONFIG_BLK_DEV_IDEPNP)		+= ide-pnp.o
-
-ifeq ($(CONFIG_BLK_DEV_IDE),y)
-obj-$(CONFIG_PROC_FS)			+= ide-proc.o
-endif
-
-obj-$(CONFIG_BLK_DEV_IDE)		+= legacy/ ppc/ arm/
+obj-$(CONFIG_BLK_DEV_IDE)		+= legacy/ arm/
 obj-$(CONFIG_BLK_DEV_HD)		+= legacy/
diff -Nru a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
--- a/drivers/ide/ide-cd.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/ide/ide-cd.c	Tue Feb  3 19:45:17 2004
@@ -291,10 +291,13 @@
  *			- Use extended sense on drives that support it for
  *			  correctly reporting tray status -- from
  *			  Michael D Johnson <johnsom@orst.edu>
+ * 4.60  Dec 17, 2003	- Add mt rainier support
+ *			- Bump timeout for packet commands, matches sr
+ *			- Odd stuff
  *
  *************************************************************************/
  
-#define IDECD_VERSION "4.59-ac1"
+#define IDECD_VERSION "4.60"
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -774,11 +777,36 @@
 
 		if (sense_key == NOT_READY) {
 			/* Tray open. */
-			cdrom_saw_media_change (drive);
+			if (rq_data_dir(rq) == READ) {
+				cdrom_saw_media_change (drive);
 
-			/* Fail the request. */
-			printk ("%s: tray open\n", drive->name);
-			do_end_request = 1;
+				/* Fail the request. */
+				printk ("%s: tray open\n", drive->name);
+				do_end_request = 1;
+			} else {
+				struct cdrom_info *info = drive->driver_data;
+
+				/* allow the drive 5 seconds to recover, some
+				 * devices will return this error while flushing
+				 * data from cache */
+				if (!rq->errors)
+					info->write_timeout = jiffies + ATAPI_WAIT_WRITE_BUSY;
+				rq->errors = 1;
+				if (time_after(jiffies, info->write_timeout))
+					do_end_request = 1;
+				else {
+					unsigned long flags;
+
+					/*
+					 * take a breather relying on the
+					 * unplug timer to kick us again
+					 */
+					spin_lock_irqsave(&ide_lock, flags);
+					blk_plug_device(drive->queue);
+					spin_unlock_irqrestore(&ide_lock,flags);
+					return 1;
+				}
+			}
 		} else if (sense_key == UNIT_ATTENTION) {
 			/* Media change. */
 			cdrom_saw_media_change (drive);
@@ -844,9 +872,13 @@
 		case GPCMD_BLANK:
 		case GPCMD_FORMAT_UNIT:
 		case GPCMD_RESERVE_RZONE_TRACK:
-			wait = WAIT_CMD;
+		case GPCMD_CLOSE_TRACK:
+		case GPCMD_FLUSH_CACHE:
+			wait = ATAPI_WAIT_PC;
 			break;
 		default:
+			if (!(rq->flags & REQ_QUIET))
+				printk(KERN_INFO "ide-cd: cmd 0x%x timed out\n", rq->cmd[0]);
 			wait = 0;
 			break;
 	}
@@ -894,7 +926,7 @@
  
 	if (CDROM_CONFIG_FLAGS (drive)->drq_interrupt) {
 		/* packet command */
-		ide_execute_command(drive, WIN_PACKETCMD, handler, WAIT_CMD, cdrom_timer_expiry);
+		ide_execute_command(drive, WIN_PACKETCMD, handler, ATAPI_WAIT_PC, cdrom_timer_expiry);
 		return ide_started;
 	} else {
 		/* packet command */
@@ -1167,7 +1199,7 @@
 	}
 
 	/* Done moving data!  Wait for another interrupt. */
-	ide_set_handler(drive, &cdrom_read_intr, WAIT_CMD, NULL);
+	ide_set_handler(drive, &cdrom_read_intr, ATAPI_WAIT_PC, NULL);
 	return ide_started;
 }
 
@@ -1277,7 +1309,7 @@
 		(65534 / CD_FRAMESIZE) : 65535);
 
 	/* Set up the command */
-	rq->timeout = WAIT_CMD;
+	rq->timeout = ATAPI_WAIT_PC;
 
 	/* Send the command to the drive and return. */
 	return cdrom_transfer_packet_command(drive, rq, &cdrom_read_intr);
@@ -1286,7 +1318,7 @@
 
 #define IDECD_SEEK_THRESHOLD	(1000)			/* 1000 blocks */
 #define IDECD_SEEK_TIMER	(5 * WAIT_MIN_SLEEP)	/* 100 ms */
-#define IDECD_SEEK_TIMEOUT     WAIT_CMD			/* 10 sec */
+#define IDECD_SEEK_TIMEOUT	(2 * WAIT_CMD)		/* 20 sec */
 
 static ide_startstop_t cdrom_seek_intr (ide_drive_t *drive)
 {
@@ -1326,7 +1358,7 @@
 	rq->cmd[0] = GPCMD_SEEK;
 	put_unaligned(cpu_to_be32(frame), (unsigned int *) &rq->cmd[2]);
 
-	rq->timeout = WAIT_CMD;
+	rq->timeout = ATAPI_WAIT_PC;
 	return cdrom_transfer_packet_command(drive, rq, &cdrom_seek_intr);
 }
 
@@ -1502,7 +1534,7 @@
 	}
 
 	/* Now we wait for another interrupt. */
-	ide_set_handler(drive, &cdrom_pc_intr, WAIT_CMD, cdrom_timer_expiry);
+	ide_set_handler(drive, &cdrom_pc_intr, ATAPI_WAIT_PC, cdrom_timer_expiry);
 	return ide_started;
 }
 
@@ -1511,7 +1543,7 @@
 	struct request *rq = HWGROUP(drive)->rq;
 
 	if (!rq->timeout)
-		rq->timeout = WAIT_CMD;
+		rq->timeout = ATAPI_WAIT_PC;
 
 	/* Send the command to the drive and return. */
 	return cdrom_transfer_packet_command(drive, rq, &cdrom_pc_intr);
@@ -1716,11 +1748,8 @@
 	/*
 	 * If DRQ is clear, the command has completed.
 	 */
-	if ((stat & DRQ_STAT) == 0) {
-		if (rq->data_len)
-			printk("%s: %u residual after xfer\n", __FUNCTION__, rq->data_len);
+	if ((stat & DRQ_STAT) == 0)
 		goto end_request;
-	}
 
 	/*
 	 * check which way to transfer data
@@ -1826,10 +1855,8 @@
 		}
 	}
 
-	if (cdrom_decode_status(drive, 0, &stat)) {
-		printk("ide-cd: write_intr decode_status bad\n");
+	if (cdrom_decode_status(drive, 0, &stat))
 		return ide_stopped;
-	}
 
 	/*
 	 * using dma, transfer is complete now
@@ -1904,7 +1931,7 @@
 	}
 
 	/* re-arm handler */
-	ide_set_handler(drive, &cdrom_write_intr, 5 * WAIT_CMD, NULL);
+	ide_set_handler(drive, &cdrom_write_intr, ATAPI_WAIT_PC, NULL);
 	return ide_started;
 }
 
@@ -1915,7 +1942,7 @@
 #if 0	/* the immediate bit */
 	rq->cmd[1] = 1 << 3;
 #endif
-	rq->timeout = 2 * WAIT_CMD;
+	rq->timeout = ATAPI_WAIT_PC;
 
 	return cdrom_transfer_packet_command(drive, rq, cdrom_write_intr);
 }
@@ -1956,7 +1983,7 @@
 	struct request *rq = HWGROUP(drive)->rq;
 
 	if (!rq->timeout)
-		rq->timeout = WAIT_CMD;
+		rq->timeout = ATAPI_WAIT_PC;
 
 	return cdrom_transfer_packet_command(drive, rq, cdrom_newpc_intr);
 }
@@ -2242,6 +2269,7 @@
 		struct atapi_toc_header hdr;
 		struct atapi_toc_entry  ent;
 	} ms_tmp;
+	long last_written;
 
 	if (toc == NULL) {
 		/* Try to allocate space. */
@@ -2261,6 +2289,13 @@
 	if (CDROM_STATE_FLAGS(drive)->toc_valid)
 		return 0;
 
+	/* Try to get the total cdrom capacity. */
+	stat = cdrom_read_capacity(drive, &toc->capacity, sense);
+	if (stat)
+		toc->capacity = 0x1fffff;
+
+	set_capacity(drive->disk, toc->capacity * SECTORS_PER_FRAME);
+
 	/* First read just the header, so we know how long the TOC is. */
 	stat = cdrom_read_tocentry(drive, 0, 1, 0, (char *) &toc->hdr,
 				    sizeof(struct atapi_toc_header), sense);
@@ -2368,13 +2403,11 @@
 	toc->xa_flag = (ms_tmp.hdr.first_track != ms_tmp.hdr.last_track);
 
 	/* Now try to get the total cdrom capacity. */
-	stat = cdrom_get_last_written(cdi, (long *) &toc->capacity);
-	if (stat || !toc->capacity)
-		stat = cdrom_read_capacity(drive, &toc->capacity, sense);
-	if (stat)
-		toc->capacity = 0x1fffff;
-
-	set_capacity(drive->disk, toc->capacity * SECTORS_PER_FRAME);
+	stat = cdrom_get_last_written(cdi, &last_written);
+	if (!stat && last_written) {
+		toc->capacity = last_written;
+		set_capacity(drive->disk, toc->capacity * SECTORS_PER_FRAME);
+	}
 
 	/* Remember that we've read this stuff. */
 	CDROM_STATE_FLAGS(drive)->toc_valid = 1;
@@ -2483,7 +2516,7 @@
 	ide_drive_t *drive = (ide_drive_t*) cdi->handle;
 
 	if (cgc->timeout <= 0)
-		cgc->timeout = WAIT_CMD;
+		cgc->timeout = ATAPI_WAIT_PC;
 
 	/* here we queue the commands from the uniform CD-ROM
 	   layer. the packet must be complete, as we do not
@@ -2688,37 +2721,49 @@
         return 0;
 }
 
+/*
+ * add logic to try GET_EVENT command first to check for media and tray
+ * status. this should be supported by newer cd-r/w and all DVD etc
+ * drives
+ */
 static
 int ide_cdrom_drive_status (struct cdrom_device_info *cdi, int slot_nr)
 {
 	ide_drive_t *drive = (ide_drive_t*) cdi->handle;
+	struct media_event_desc med;
+	struct request_sense sense;
+	int stat;
 
-	if (slot_nr == CDSL_CURRENT) {
-		struct request_sense sense;
-		int stat = cdrom_check_status(drive, &sense);
-		if (stat == 0 || sense.sense_key == UNIT_ATTENTION)
-			return CDS_DISC_OK;
+	if (slot_nr != CDSL_CURRENT)
+		return -EINVAL;
 
-		if (sense.sense_key == NOT_READY && sense.asc == 0x04 &&
-		    sense.ascq == 0x04)
-			return CDS_DISC_OK;
+	stat = cdrom_check_status(drive, &sense);
+	if (!stat || sense.sense_key == UNIT_ATTENTION)
+		return CDS_DISC_OK;
 
+	if (!cdrom_get_media_event(cdi, &med)) {
+		if (med.media_present)
+			return CDS_DISC_OK;
+		if (med.door_open)
+			return CDS_TRAY_OPEN;
+	}
 
-		/*
-		 * If not using Mt Fuji extended media tray reports,
-		 * just return TRAY_OPEN since ATAPI doesn't provide
-		 * any other way to detect this...
-		 */
-		if (sense.sense_key == NOT_READY) {
-			if (sense.asc == 0x3a && sense.ascq == 1)
-				return CDS_NO_DISC;
-			else
-				return CDS_TRAY_OPEN;
-		}
+	if (sense.sense_key == NOT_READY && sense.asc == 0x04 && sense.ascq == 0x04)
+		return CDS_DISC_OK;
 
-		return CDS_DRIVE_NOT_READY;
+	/*
+	 * If not using Mt Fuji extended media tray reports,
+	 * just return TRAY_OPEN since ATAPI doesn't provide
+	 * any other way to detect this...
+	 */
+	if (sense.sense_key == NOT_READY) {
+		if (sense.asc == 0x3a && sense.ascq == 1)
+			return CDS_NO_DISC;
+		else
+			return CDS_TRAY_OPEN;
 	}
-	return -EINVAL;
+
+	return CDS_DRIVE_NOT_READY;
 }
 
 static
@@ -2826,7 +2871,8 @@
 				CDC_MEDIA_CHANGED | CDC_PLAY_AUDIO | CDC_RESET |
 				CDC_IOCTLS | CDC_DRIVE_STATUS | CDC_CD_R |
 				CDC_CD_RW | CDC_DVD | CDC_DVD_R| CDC_DVD_RAM |
-				CDC_GENERIC_PACKET | CDC_MO_DRIVE,
+				CDC_GENERIC_PACKET | CDC_MO_DRIVE | CDC_MRW |
+				CDC_MRW_W | CDC_RAM,
 	.generic_packet		= ide_cdrom_packet,
 };
 
@@ -2861,6 +2907,10 @@
 		devinfo->mask |= CDC_CLOSE_TRAY;
 	if (!CDROM_CONFIG_FLAGS(drive)->mo_drive)
 		devinfo->mask |= CDC_MO_DRIVE;
+	if (!CDROM_CONFIG_FLAGS(drive)->mrw)
+		devinfo->mask |= CDC_MRW;
+	if (!CDROM_CONFIG_FLAGS(drive)->mrw_w)
+		devinfo->mask |= CDC_MRW_W;
 
 	return register_cdrom(devinfo);
 }
@@ -2881,14 +2931,6 @@
 	    !strcmp(drive->id->model, "WPI CDS-32X")))
 		size -= sizeof(cap->pad);
 
-	/* we have to cheat a little here. the packet will eventually
-	 * be queued with ide_cdrom_packet(), which extracts the
-	 * drive from cdi->handle. Since this device hasn't been
-	 * registered with the Uniform layer yet, it can't do this.
-	 * Same goes for cdi->ops.
-	 */
-	cdi->handle = (ide_drive_t *) drive;
-	cdi->ops = &ide_cdrom_dops;
 	init_cdrom_command(&cgc, cap, size, CGC_DATA_UNKNOWN);
 	do { /* we seem to get stat=0x01,err=0x00 the first time (??) */
 		stat = cdrom_mode_sense(cdi, &cgc, GPMODE_CAPABILITIES_PAGE, 0);
@@ -2904,23 +2946,43 @@
 	struct cdrom_info *info = drive->driver_data;
 	struct cdrom_device_info *cdi = &info->devinfo;
 	struct atapi_capabilities_page cap;
-	int nslots = 1;
+	int nslots = 1, mrw_write = 0;
 
 	if (drive->media == ide_optical) {
 		CDROM_CONFIG_FLAGS(drive)->mo_drive = 1;
+		CDROM_CONFIG_FLAGS(drive)->ram = 1;
 		printk("%s: ATAPI magneto-optical drive\n", drive->name);
 		return nslots;
 	}
 
-	if (CDROM_CONFIG_FLAGS(drive)->nec260) {
-		CDROM_CONFIG_FLAGS(drive)->no_eject = 0;                       
-		CDROM_CONFIG_FLAGS(drive)->audio_play = 1;       
+	if (CDROM_CONFIG_FLAGS(drive)->nec260 ||
+	    !strcmp(drive->id->model,"STINGRAY 8422 IDE 8X CD-ROM 7-27-95")) {
+		CDROM_CONFIG_FLAGS(drive)->no_eject = 0;
+		CDROM_CONFIG_FLAGS(drive)->audio_play = 1;
 		return nslots;
 	}
 
+	/*
+	 * we have to cheat a little here. the packet will eventually
+	 * be queued with ide_cdrom_packet(), which extracts the
+	 * drive from cdi->handle. Since this device hasn't been
+	 * registered with the Uniform layer yet, it can't do this.
+	 * Same goes for cdi->ops.
+	 */
+	cdi->handle = (ide_drive_t *) drive;
+	cdi->ops = &ide_cdrom_dops;
+
 	if (ide_cdrom_get_capabilities(drive, &cap))
 		return 0;
 
+	if (!cdrom_is_mrw(cdi, &mrw_write)) {
+		CDROM_CONFIG_FLAGS(drive)->mrw = 1;
+		if (mrw_write) {
+			CDROM_CONFIG_FLAGS(drive)->mrw_w = 1;
+			CDROM_CONFIG_FLAGS(drive)->ram = 1;
+		}
+	}
+
 	if (cap.lock == 0)
 		CDROM_CONFIG_FLAGS(drive)->no_doorlock = 1;
 	if (cap.eject)
@@ -2933,8 +2995,10 @@
 		CDROM_CONFIG_FLAGS(drive)->test_write = 1;
 	if (cap.dvd_ram_read || cap.dvd_r_read || cap.dvd_rom)
 		CDROM_CONFIG_FLAGS(drive)->dvd = 1;
-	if (cap.dvd_ram_write)
+	if (cap.dvd_ram_write) {
 		CDROM_CONFIG_FLAGS(drive)->dvd_ram = 1;
+		CDROM_CONFIG_FLAGS(drive)->ram = 1;
+	}
 	if (cap.dvd_r_write)
 		CDROM_CONFIG_FLAGS(drive)->dvd_r = 1;
 	if (cap.audio_play)
@@ -2998,6 +3062,9 @@
         	(CDROM_CONFIG_FLAGS(drive)->cd_r)? "-R" : "", 
         	(CDROM_CONFIG_FLAGS(drive)->cd_rw)? "/RW" : "");
 
+	if (CDROM_CONFIG_FLAGS(drive)->mrw || CDROM_CONFIG_FLAGS(drive)->mrw_w)
+		printk(" CD-MR%s", CDROM_CONFIG_FLAGS(drive)->mrw_w ? "W" : "");
+
         if (CDROM_CONFIG_FLAGS(drive)->is_changer) 
         	printk(" changer w/%d slots", nslots);
         else 	
@@ -3105,14 +3172,11 @@
 	struct cdrom_device_info *cdi = &info->devinfo;
 	int nslots;
 
-	/*
-	 * default to read-only always and fix latter at the bottom
-	 */
-	set_disk_ro(drive->disk, 1);
-	blk_queue_hardsect_size(drive->queue, CD_FRAMESIZE);
-
 	blk_queue_prep_rq(drive->queue, ide_cdrom_prep_fn);
 	blk_queue_dma_alignment(drive->queue, 3);
+	drive->queue->unplug_delay = (1 * HZ) / 1000;
+	if (!drive->queue->unplug_delay)
+		drive->queue->unplug_delay = 1;
 
 	drive->special.all	= 0;
 	drive->ready_stat	= 0;
@@ -3215,8 +3279,11 @@
 
 	nslots = ide_cdrom_probe_capabilities (drive);
 
-	if (CDROM_CONFIG_FLAGS(drive)->dvd_ram)
-		set_disk_ro(drive->disk, 0);
+	/*
+	 * set correct block size and read-only for non-ram media
+	 */
+	set_disk_ro(drive->disk, !CDROM_CONFIG_FLAGS(drive)->ram);
+	blk_queue_hardsect_size(drive->queue, CD_FRAMESIZE);
 
 #if 0
 	drive->dsc_overlap = (HWIF(drive)->no_dsc) ? 0 : 1;
diff -Nru a/drivers/ide/ide-cd.h b/drivers/ide/ide-cd.h
--- a/drivers/ide/ide-cd.h	Tue Feb  3 19:45:43 2004
+++ b/drivers/ide/ide-cd.h	Tue Feb  3 19:45:43 2004
@@ -35,6 +35,12 @@
 #define NO_DOOR_LOCKING 0
 #endif
 
+/*
+ * typical timeout for packet command
+ */
+#define ATAPI_WAIT_PC		(60 * HZ)
+#define ATAPI_WAIT_WRITE_BUSY	(10 * HZ)
+
 /************************************************************************/
 
 #define SECTOR_BITS 		9
@@ -75,6 +81,9 @@
 	__u8 dvd		: 1; /* Drive is a DVD-ROM */
 	__u8 dvd_r		: 1; /* Drive can write DVD-R */
 	__u8 dvd_ram		: 1; /* Drive can write DVD-RAM */
+	__u8 mrw		: 1; /* drive can read mrw */
+	__u8 mrw_w		: 1; /* drive can write mrw */
+	__u8 ram		: 1; /* generic WRITE (dvd-ram/mrw) */
 	__u8 test_write		: 1; /* Drive can fake writes */
 	__u8 supp_disc_present	: 1; /* Changer can report exact contents
 					of slots. */
@@ -482,6 +491,8 @@
 
         /* Per-device info needed by cdrom.c generic driver. */
         struct cdrom_device_info devinfo;
+
+	unsigned long write_timeout;
 };
 
 /****************************************************************************
diff -Nru a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
--- a/drivers/ide/ide-disk.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/ide/ide-disk.c	Tue Feb  3 19:45:17 2004
@@ -239,8 +239,6 @@
  * ide_multwrite() transfers a block of up to mcount sectors of data
  * to a drive as part of a disk multiple-sector write operation.
  *
- * Returns 0 on success.
- *
  * Note that we may be called from two contexts - __ide_do_rw_disk() context
  * and IRQ context. The IRQ can happen any time after we've output the
  * full "mcount" number of sectors, so we must make sure we update the
@@ -251,7 +249,7 @@
  * is shorter or smaller than the BH segment then we should be OKAY.
  * This is only valid if we can rewind the rq->current_nr_sectors counter.
  */
-int ide_multwrite (ide_drive_t *drive, unsigned int mcount)
+static void ide_multwrite(ide_drive_t *drive, unsigned int mcount)
 {
  	ide_hwgroup_t *hwgroup	= HWGROUP(drive);
  	struct request *rq	= &hwgroup->wrq;
@@ -279,7 +277,7 @@
 			 * all bvecs in this one.
 			 */
 			if (++bio->bi_idx >= bio->bi_vcnt) {
-				bio->bi_idx = 0;
+				bio->bi_idx = bio->bi_vcnt - rq->nr_cbio_segments;
 				bio = bio->bi_next;
 			}
 
@@ -288,7 +286,8 @@
 				mcount = 0;
 			} else {
 				rq->bio = bio;
-				rq->current_nr_sectors = bio_iovec(bio)->bv_len >> 9;
+				rq->nr_cbio_segments = bio_segments(bio);
+				rq->current_nr_sectors = bio_cur_sectors(bio);
 				rq->hard_cur_sectors = rq->current_nr_sectors;
 			}
 		}
@@ -300,8 +299,6 @@
 		taskfile_output_data(drive, buffer, nsect<<7);
 		ide_unmap_buffer(rq, buffer, &flags);
 	} while (mcount);
-
-        return 0;
 }
 
 /*
@@ -312,6 +309,7 @@
 	ide_hwgroup_t *hwgroup	= HWGROUP(drive);
 	ide_hwif_t *hwif	= HWIF(drive);
 	struct request *rq	= &hwgroup->wrq;
+	struct bio *bio		= rq->bio;
 	u8 stat;
 
 	stat = hwif->INB(IDE_STATUS_REG);
@@ -322,8 +320,7 @@
 			 *	of the request
 			 */
 			if (rq->nr_sectors) {
-				if (ide_multwrite(drive, drive->mult_count))
-					return ide_stopped;
+				ide_multwrite(drive, drive->mult_count);
 				ide_set_handler(drive, &multwrite_intr, WAIT_CMD, NULL);
 				return ide_started;
 			}
@@ -333,14 +330,17 @@
 			 *	we can end the original request.
 			 */
 			if (!rq->nr_sectors) {	/* all done? */
+				bio->bi_idx = bio->bi_vcnt - rq->nr_cbio_segments;
 				rq = hwgroup->rq;
 				ide_end_request(drive, 1, rq->nr_sectors);
 				return ide_stopped;
 			}
 		}
+		bio->bi_idx = bio->bi_vcnt - rq->nr_cbio_segments;
 		/* the original code did this here (?) */
 		return ide_stopped;
 	}
+	bio->bi_idx = bio->bi_vcnt - rq->nr_cbio_segments;
 	return DRIVER(drive)->error(drive, "multwrite_intr", stat);
 }
 
@@ -506,27 +506,10 @@
 			local_irq_disable();
 		if (drive->mult_count) {
 			ide_hwgroup_t *hwgroup = HWGROUP(drive);
-	/*
-	 * Ugh.. this part looks ugly because we MUST set up
-	 * the interrupt handler before outputting the first block
-	 * of data to be written.  If we hit an error (corrupted buffer list)
-	 * in ide_multwrite(), then we need to remove the handler/timer
-	 * before returning.  Fortunately, this NEVER happens (right?).
-	 *
-	 * Except when you get an error it seems...
-	 *
-	 * MAJOR DATA INTEGRITY BUG !!! only if we error 
-	 */
+
 			hwgroup->wrq = *rq; /* scratchpad */
 			ide_set_handler(drive, &multwrite_intr, WAIT_CMD, NULL);
-			if (ide_multwrite(drive, drive->mult_count)) {
-				unsigned long flags;
-				spin_lock_irqsave(&ide_lock, flags);
-				hwgroup->handler = NULL;
-				del_timer(&hwgroup->timer);
-				spin_unlock_irqrestore(&ide_lock, flags);
-				return ide_stopped;
-			}
+			ide_multwrite(drive, drive->mult_count);
 		} else {
 			unsigned long flags;
 			char *to = ide_map_buffer(rq, &flags);
@@ -1622,8 +1605,8 @@
 	if (drive->addressing == 0 && drive->capacity64 > 1ULL << 28) {
 		printk("%s: cannot use LBA48 - full capacity "
 		       "%llu sectors (%llu MB)\n",
-		       drive->name,
-		       drive->capacity64, sectors_to_MB(drive->capacity64));
+		       drive->name, (unsigned long long)drive->capacity64,
+		       sectors_to_MB(drive->capacity64));
 		drive->capacity64 = 1ULL << 28;
 	}
 
diff -Nru a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/ide/ide-generic.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,34 @@
+/*
+ * generic/default IDE host driver
+ *
+ * Copyright (C) 2004 Bartlomiej Zolnierkiewicz
+ * This code was split off from ide.c.  See it for original copyrights.
+ *
+ * May be copied or modified under the terms of the GNU General Public License.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/ide.h>
+
+static int __init ide_generic_init(void)
+{
+	MOD_INC_USE_COUNT;
+	if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
+		ide_get_lock(NULL, NULL); /* for atari only */
+
+	(void)ideprobe_init();
+
+	if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
+		ide_release_lock();	/* for atari only */
+
+#ifdef CONFIG_PROC_FS
+	create_proc_ide_interfaces();
+#endif
+	return 0;
+}
+
+module_init(ide_generic_init);
+
+MODULE_LICENSE("GPL");
diff -Nru a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
--- a/drivers/ide/ide-probe.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/ide/ide-probe.c	Tue Feb  3 19:45:29 2004
@@ -1322,8 +1322,7 @@
 {
 	unsigned int index;
 	int probe[MAX_HWIFS];
-	
-	MOD_INC_USE_COUNT;
+
 	memset(probe, 0, MAX_HWIFS * sizeof(int));
 	for (index = 0; index < MAX_HWIFS; ++index)
 		probe[index] = !ide_hwifs[index].present;
@@ -1343,32 +1342,14 @@
 			int unit;
 			if (!hwif->present)
 				continue;
+			if (hwif->chipset == ide_unknown || hwif->chipset == ide_forced)
+				hwif->chipset = ide_generic;
 			for (unit = 0; unit < MAX_DRIVES; ++unit)
 				if (hwif->drives[unit].present)
 					ata_attach(&hwif->drives[unit]);
 		}
 	}
-	if (!ide_probe)
-		ide_probe = &ideprobe_init;
-	MOD_DEC_USE_COUNT;
-	return 0;
-}
-
-#ifdef MODULE
-int init_module (void)
-{
-	unsigned int index;
-	
-	for (index = 0; index < MAX_HWIFS; ++index)
-		ide_unregister(index);
-	ideprobe_init();
-	create_proc_ide_interfaces();
 	return 0;
 }
 
-void cleanup_module (void)
-{
-	ide_probe = NULL;
-}
-MODULE_LICENSE("GPL");
-#endif /* MODULE */
+EXPORT_SYMBOL_GPL(ideprobe_init);
diff -Nru a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c
--- a/drivers/ide/ide-proc.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/ide/ide-proc.c	Tue Feb  3 19:45:28 2004
@@ -348,8 +348,10 @@
 	int		len;
 	const char	*name;
 
+	/*
+	 * Neither ide_unknown nor ide_forced should be set at this point.
+	 */
 	switch (hwif->chipset) {
-		case ide_unknown:	name = "(none)";	break;
 		case ide_generic:	name = "generic";	break;
 		case ide_pci:		name = "pci";		break;
 		case ide_cmd640:	name = "cmd640";	break;
diff -Nru a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
--- a/drivers/ide/ide-taskfile.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/ide/ide-taskfile.c	Tue Feb  3 19:45:16 2004
@@ -2208,28 +2208,3 @@
 
 	return ide_started;
 }
-
-/*
- * Beginning of Taskfile OPCODE Library and feature sets.
- */
-
-#ifdef CONFIG_PKT_TASK_IOCTL
-
-int pkt_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
-{
-#if 0
-	switch(req_task->data_phase) {
-		case TASKFILE_P_OUT_DMAQ:
-		case TASKFILE_P_IN_DMAQ:
-		case TASKFILE_P_OUT_DMA:
-		case TASKFILE_P_IN_DMA:
-		case TASKFILE_P_OUT:
-		case TASKFILE_P_IN:
-	}
-#endif
-	return -ENOMSG;
-}
-
-EXPORT_SYMBOL(pkt_taskfile_ioctl);
-
-#endif /* CONFIG_PKT_TASK_IOCTL */
diff -Nru a/drivers/ide/ide.c b/drivers/ide/ide.c
--- a/drivers/ide/ide.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/ide/ide.c	Tue Feb  3 19:45:17 2004
@@ -153,7 +153,6 @@
 #include <linux/cdrom.h>
 #include <linux/seq_file.h>
 #include <linux/device.h>
-#include <linux/kmod.h>
 
 #include <asm/byteorder.h>
 #include <asm/irq.h>
@@ -191,8 +190,6 @@
 EXPORT_SYMBOL(noautodma);
 EXPORT_SYMBOL(ide_bus_type);
 
-int (*ide_probe)(void);
-
 /*
  * This is declared extern in ide.h, for access by other IDE modules:
  */
@@ -443,21 +440,6 @@
 
 EXPORT_SYMBOL(ide_dump_status);
 
-
-
-void ide_probe_module (void)
-{
-	if (!ide_probe) {
-#if defined(CONFIG_KMOD) && defined(CONFIG_BLK_DEV_IDE_MODULE)
-		(void) request_module("ide-probe-mod");
-#endif /* (CONFIG_KMOD) && (CONFIG_BLK_DEV_IDE_MODULE) */
-	} else {
-		(void)ide_probe();
-	}
-}
-
-EXPORT_SYMBOL(ide_probe_module);
-
 static int ide_open (struct inode * inode, struct file * filp)
 {
 	return -ENXIO;
@@ -1033,7 +1015,7 @@
 	hwif->chipset = hw->chipset;
 
 	if (!initializing) {
-		ide_probe_module();
+		probe_hwif_init(hwif);
 #ifdef CONFIG_PROC_FS
 		create_proc_ide_interfaces();
 #endif
@@ -1620,12 +1602,6 @@
 			switch(drive->media) {
 				case ide_disk:
 					return ide_taskfile_ioctl(drive, cmd, arg);
-#ifdef CONFIG_PKT_TASK_IOCTL
-				case ide_cdrom:
-				case ide_tape:
-				case ide_floppy:
-					return pkt_taskfile_ioctl(drive, cmd, arg);
-#endif /* CONFIG_PKT_TASK_IOCTL */
 				default:
 					return -ENOMSG;
 			}
@@ -2185,7 +2161,7 @@
 				memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports));
 				hwif->irq      = vals[2];
 				hwif->noprobe  = 0;
-				hwif->chipset  = ide_generic;
+				hwif->chipset  = ide_forced;
 				goto done;
 
 			case 0: goto bad_option;
@@ -2282,28 +2258,6 @@
 #endif /* CONFIG_BLK_DEV_IDEPNP */
 }
 
-void __init ide_init_builtin_drivers (void)
-{
-	/*
-	 * Probe for special PCI and other "known" interface chipsets
-	 */
-	probe_for_hwifs ();
-
-#ifdef CONFIG_BLK_DEV_IDE
-	if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
-		ide_get_lock(NULL, NULL); /* for atari only */
-
-	(void) ideprobe_init();
-
-	if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
-		ide_release_lock();	/* for atari only */
-#endif /* CONFIG_BLK_DEV_IDE */
-
-#ifdef CONFIG_PROC_FS
-	proc_ide_create();
-#endif
-}
-
 /*
  *	Actually unregister the subdriver. Called with the
  *	request lock dropped.
@@ -2564,7 +2518,6 @@
  */
 
 EXPORT_SYMBOL(ide_lock);
-EXPORT_SYMBOL(ide_probe);
 
 struct bus_type ide_bus_type = {
 	.name		= "ide",
@@ -2607,9 +2560,13 @@
 #endif
 
 	initializing = 1;
-	ide_init_builtin_drivers();
+	/* Probe for special PCI and other "known" interface chipsets. */
+	probe_for_hwifs();
 	initializing = 0;
 
+#ifdef CONFIG_PROC_FS
+	proc_ide_create();
+#endif
 	return 0;
 }
 
diff -Nru a/drivers/ide/legacy/Makefile b/drivers/ide/legacy/Makefile
--- a/drivers/ide/legacy/Makefile	Tue Feb  3 19:45:17 2004
+++ b/drivers/ide/legacy/Makefile	Tue Feb  3 19:45:17 2004
@@ -2,16 +2,9 @@
 obj-$(CONFIG_BLK_DEV_ALI14XX)		+= ali14xx.o
 obj-$(CONFIG_BLK_DEV_DTC2278)		+= dtc2278.o
 obj-$(CONFIG_BLK_DEV_HT6560B)		+= ht6560b.o
-obj-$(CONFIG_BLK_DEV_IDE_PC9800)	+= pc9800.o
 obj-$(CONFIG_BLK_DEV_PDC4030)		+= pdc4030.o
 obj-$(CONFIG_BLK_DEV_QD65XX)		+= qd65xx.o
 obj-$(CONFIG_BLK_DEV_UMC8672)		+= umc8672.o
-
-obj-$(CONFIG_BLK_DEV_BUDDHA)		+= buddha.o
-obj-$(CONFIG_BLK_DEV_FALCON_IDE)	+= falconide.o
-obj-$(CONFIG_BLK_DEV_GAYLE)		+= gayle.o
-obj-$(CONFIG_BLK_DEV_MAC_IDE)		+= macide.o
-obj-$(CONFIG_BLK_DEV_Q40IDE)		+= q40ide.o
 
 obj-$(CONFIG_BLK_DEV_IDECS)		+= ide-cs.o
 
diff -Nru a/drivers/ide/legacy/buddha.c b/drivers/ide/legacy/buddha.c
--- a/drivers/ide/legacy/buddha.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/ide/legacy/buddha.c	Tue Feb  3 19:45:17 2004
@@ -146,6 +146,7 @@
 void __init buddha_init(void)
 {
 	hw_regs_t hw;
+	ide_hwif_t *hwif;
 	int i, index;
 
 	struct zorro_dev *z = NULL;
@@ -212,8 +213,9 @@
 						IRQ_AMIGA_PORTS);
 			}	
 			
-			index = ide_register_hw(&hw, NULL);
+			index = ide_register_hw(&hw, &hwif);
 			if (index != -1) {
+				hwif->mmio = 2;
 				printk("ide%d: ", index);
 				switch(type) {
 				case BOARD_BUDDHA:
diff -Nru a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c
--- a/drivers/ide/legacy/gayle.c	Tue Feb  3 19:45:37 2004
+++ b/drivers/ide/legacy/gayle.c	Tue Feb  3 19:45:37 2004
@@ -29,7 +29,7 @@
      */
 
 #define GAYLE_BASE_4000	0xdd2020	/* A4000/A4000T */
-#define GAYLE_BASE_1200	0xda0000	/* A1200/A600 */
+#define GAYLE_BASE_1200	0xda0000	/* A1200/A600 and E-Matrix 530 */
 
     /*
      *  Offsets from one of the above bases
@@ -118,9 +118,17 @@
     if (!MACH_IS_AMIGA)
 	return;
 
-    if (!(a4000 = AMIGAHW_PRESENT(A4000_IDE)) && !AMIGAHW_PRESENT(A1200_IDE))
-	return;
+    if ((a4000 = AMIGAHW_PRESENT(A4000_IDE)) || AMIGAHW_PRESENT(A1200_IDE))
+	goto found;
+
+#ifdef CONFIG_ZORRO
+    if (zorro_find_device(ZORRO_PROD_MTEC_VIPER_MK_V_E_MATRIX_530_SCSI_IDE,
+			  NULL))
+	goto found;
+#endif
+    return;
 
+found:
     for (i = 0; i < GAYLE_NUM_PROBE_HWIFS; i++) {
 	unsigned long base, ctrlport, irqport;
 	ide_ack_intr_t *ack_intr;
@@ -174,16 +182,5 @@
 	    }
 	} else
 	    release_mem_region(res_start, res_n);
-
-#if 1 /* TESTING */
-	if (i == 1) {
-	    volatile u_short *addr = (u_short *)base;
-	    u_short data;
-	    printk("+++ Probing for IDE doubler... ");
-	    *addr = 0xffff;
-	    data = *addr;
-	    printk("probe returned 0x%02x (PLEASE REPORT THIS!!)\n", data);
-	}
-#endif /* TESTING */
     }
 }
diff -Nru a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
--- a/drivers/ide/legacy/ide-cs.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/ide/legacy/ide-cs.c	Tue Feb  3 19:45:34 2004
@@ -152,7 +152,7 @@
     client_reg.event_handler = &ide_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != CS_SUCCESS) {
 	cs_error(link->handle, RegisterClient, ret);
 	ide_detach(link);
@@ -188,7 +188,7 @@
 	ide_release(link);
     
     if (link->handle) {
-	ret = CardServices(DeregisterClient, link->handle);
+	ret = pcmcia_deregister_client(link->handle);
 	if (ret != CS_SUCCESS)
 	    cs_error(link->handle, DeregisterClient, ret);
     }
@@ -207,11 +207,8 @@
 
 ======================================================================*/
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
-
-#define CFG_CHECK(fn, args...) \
-if (CardServices(fn, args) != 0) goto next_entry
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq)
 {
@@ -241,16 +238,16 @@
     tuple.TupleOffset = 0; tuple.TupleDataMax = 255;
     tuple.Attributes = 0;
     tuple.DesiredTuple = CISTPL_CONFIG;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
-    CS_CHECK(GetTupleData, handle, &tuple);
-    CS_CHECK(ParseTuple, handle, &tuple, &parse);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+    CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
     link->conf.ConfigBase = parse.config.base;
     link->conf.Present = parse.config.rmask[0];
 
     tuple.DesiredTuple = CISTPL_MANFID;
-    if (!CardServices(GetFirstTuple, handle, &tuple) &&
-	!CardServices(GetTupleData, handle, &tuple) &&
-	!CardServices(ParseTuple, handle, &tuple, &parse))
+    if (!pcmcia_get_first_tuple(handle, &tuple) &&
+	!pcmcia_get_tuple_data(handle, &tuple) &&
+	!pcmcia_parse_tuple(handle, &tuple, &parse))
 	is_kme = ((parse.manfid.manf == MANFID_KME) &&
 		  ((parse.manfid.card == PRODID_KME_KXLC005_A) ||
 		   (parse.manfid.card == PRODID_KME_KXLC005_B)));
@@ -259,16 +256,16 @@
     link->state |= DEV_CONFIG;
 
     /* Not sure if this is right... look up the current Vcc */
-    CS_CHECK(GetConfigurationInfo, handle, &conf);
+    CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf));
     link->conf.Vcc = conf.Vcc;
     
     pass = io_base = ctl_base = 0;
     tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
     tuple.Attributes = 0;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
     while (1) {
-	CFG_CHECK(GetTupleData, handle, &tuple);
-	CFG_CHECK(ParseTuple, handle, &tuple, &parse);
+    	if (pcmcia_get_tuple_data(handle, &tuple) != 0) goto next_entry;
+	if (pcmcia_parse_tuple(handle, &tuple, &parse) != 0) goto next_entry;
 
 	/* Check for matching Vcc, unless we're desperate */
 	if (!pass) {
@@ -299,13 +296,15 @@
 		link->io.NumPorts1 = 8;
 		link->io.BasePort2 = io->win[1].base;
 		link->io.NumPorts2 = (is_kme) ? 2 : 1;
-		CFG_CHECK(RequestIO, link->handle, &link->io);
+		if (pcmcia_request_io(link->handle, &link->io) != 0)
+			goto next_entry;
 		io_base = link->io.BasePort1;
 		ctl_base = link->io.BasePort2;
 	    } else if ((io->nwin == 1) && (io->win[0].len >= 16)) {
 		link->io.NumPorts1 = io->win[0].len;
 		link->io.NumPorts2 = 0;
-		CFG_CHECK(RequestIO, link->handle, &link->io);
+		if (pcmcia_request_io(link->handle, &link->io) != 0)
+			goto next_entry;
 		io_base = link->io.BasePort1;
 		ctl_base = link->io.BasePort1+0x0e;
 	    } else goto next_entry;
@@ -316,16 +315,16 @@
     next_entry:
 	if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg;
 	if (pass) {
-	    CS_CHECK(GetNextTuple, handle, &tuple);
-	} else if (CardServices(GetNextTuple, handle, &tuple) != 0) {
-	    CS_CHECK(GetFirstTuple, handle, &tuple);
+	    CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));
+	} else if (pcmcia_get_next_tuple(handle, &tuple) != 0) {
+	    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
 	    memset(&dflt, 0, sizeof(dflt));
 	    pass++;
 	}
     }
     
-    CS_CHECK(RequestIRQ, handle, &link->irq);
-    CS_CHECK(RequestConfiguration, handle, &link->conf);
+    CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq));
+    CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf));
 
     /* deal with brain dead IDE resource management */
     release_region(link->io.BasePort1, link->io.NumPorts1);
@@ -413,9 +412,9 @@
     info->ndev = 0;
     link->dev = NULL;
     
-    CardServices(ReleaseConfiguration, link->handle);
-    CardServices(ReleaseIO, link->handle, &link->io);
-    CardServices(ReleaseIRQ, link->handle, &link->irq);
+    pcmcia_release_configuration(link->handle);
+    pcmcia_release_io(link->handle, &link->io);
+    pcmcia_release_irq(link->handle, &link->irq);
     
     link->state &= ~DEV_CONFIG;
 
@@ -452,14 +451,14 @@
 	/* Fall through... */
     case CS_EVENT_RESET_PHYSICAL:
 	if (link->state & DEV_CONFIG)
-	    CardServices(ReleaseConfiguration, link->handle);
+	    pcmcia_release_configuration(link->handle);
 	break;
     case CS_EVENT_PM_RESUME:
 	link->state &= ~DEV_SUSPEND;
 	/* Fall through... */
     case CS_EVENT_CARD_RESET:
 	if (DEV_OK(link))
-	    CardServices(RequestConfiguration, link->handle, &link->conf);
+	    pcmcia_request_configuration(link->handle, &link->conf);
 	break;
     }
     return 0;
diff -Nru a/drivers/ide/legacy/pdc4030.c b/drivers/ide/legacy/pdc4030.c
--- a/drivers/ide/legacy/pdc4030.c	Tue Feb  3 19:45:26 2004
+++ b/drivers/ide/legacy/pdc4030.c	Tue Feb  3 19:45:26 2004
@@ -443,7 +443,12 @@
 static ide_startstop_t promise_complete_pollfunc(ide_drive_t *drive)
 {
 	ide_hwgroup_t *hwgroup = HWGROUP(drive);
+#ifdef CONFIG_IDE_TASKFILE_IO
 	struct request *rq = hwgroup->rq;
+#else
+	struct request *rq = &hwgroup->wrq;
+	struct bio *bio = rq->bio;
+#endif
 
 	if ((HWIF(drive)->INB(IDE_STATUS_REG)) & BUSY_STAT) {
 		if (time_before(jiffies, hwgroup->poll_timeout)) {
@@ -472,6 +477,8 @@
 	while (rq->bio != rq->cbio)
 		(void) DRIVER(drive)->end_request(drive, 1, bio_sectors(rq->bio));
 #else
+	bio->bi_idx = bio->bi_vcnt - rq->nr_cbio_segments;
+	rq = hwgroup->rq;
 	DRIVER(drive)->end_request(drive, 1, rq->hard_nr_sectors);
 #endif
 	return ide_stopped;
@@ -530,7 +537,7 @@
 			 * all bvecs in this one.
 			 */
 			if (++bio->bi_idx >= bio->bi_vcnt) {
-				bio->bi_idx = 0;
+				bio->bi_idx = bio->bi_vcnt - rq->nr_cbio_segments;
 				bio = bio->bi_next;
 			}
 
@@ -539,7 +546,8 @@
 				mcount = 0;
 			} else {
 				rq->bio = bio;
-				rq->current_nr_sectors = bio_iovec(bio)->bv_len >> 9;
+				rq->nr_cbio_segments = bio_segments(bio);
+				rq->current_nr_sectors = bio_cur_sectors(bio);
 				rq->hard_cur_sectors = rq->current_nr_sectors;
 			}
 		}
@@ -561,6 +569,9 @@
 	ide_hwgroup_t *hwgroup = HWGROUP(drive);
 #ifdef CONFIG_IDE_TASKFILE_IO
 	struct request *rq = hwgroup->rq;
+#else
+	struct request *rq = &hwgroup->wrq;
+	struct bio *bio = rq->bio;
 #endif
 
 	if (HWIF(drive)->INB(IDE_NSECTOR_REG) != 0) {
@@ -575,6 +586,9 @@
 		}
 		hwgroup->poll_timeout = 0;
 		printk(KERN_ERR "%s: write timed-out!\n",drive->name);
+#ifndef CONFIG_IDE_TASKFILE_IO
+		bio->bi_idx = bio->bi_vcnt - rq->nr_cbio_segments;
+#endif
 		return DRIVER(drive)->error(drive, "write timeout",
 				HWIF(drive)->INB(IDE_STATUS_REG));
 	}
diff -Nru a/drivers/ide/pci/Makefile b/drivers/ide/pci/Makefile
--- a/drivers/ide/pci/Makefile	Tue Feb  3 19:45:17 2004
+++ b/drivers/ide/pci/Makefile	Tue Feb  3 19:45:17 2004
@@ -3,7 +3,6 @@
 obj-$(CONFIG_BLK_DEV_AEC62XX)		+= aec62xx.o
 obj-$(CONFIG_BLK_DEV_ALI15X3)		+= alim15x3.o
 obj-$(CONFIG_BLK_DEV_AMD74XX)		+= amd74xx.o
-obj-$(CONFIG_BLK_DEV_CMD640)		+= cmd640.o
 obj-$(CONFIG_BLK_DEV_CMD64X)		+= cmd64x.o
 obj-$(CONFIG_BLK_DEV_CS5520)		+= cs5520.o
 obj-$(CONFIG_BLK_DEV_CS5530)		+= cs5530.o
diff -Nru a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c
--- a/drivers/ide/pci/amd74xx.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/ide/pci/amd74xx.c	Tue Feb  3 19:45:43 2004
@@ -76,9 +76,8 @@
 static unsigned int amd_80w;
 static unsigned int amd_clock;
 
-static unsigned char amd_cyc2udma[] = { 6, 6, 5, 4, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 7 };
-static unsigned char amd_udma2cyc[] = { 4, 6, 8, 10, 3, 2, 1, 15 };
 static char *amd_dma[] = { "MWDMA16", "UDMA33", "UDMA66", "UDMA100", "UDMA133" };
+static unsigned char amd_cyc2udma[] = { 6, 6, 5, 4, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 7 };
 
 /*
  * AMD /proc entry.
@@ -89,6 +88,7 @@
 #include <linux/stat.h>
 #include <linux/proc_fs.h>
 
+static unsigned char amd_udma2cyc[] = { 4, 6, 8, 10, 3, 2, 1, 15 };
 static unsigned long amd_base;
 static struct pci_dev *bmide_dev;
 extern int (*amd74xx_display_info)(char *, char **, off_t, int); /* ide-proc.c */
diff -Nru a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c
--- a/drivers/ide/pci/cmd640.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/ide/pci/cmd640.c	Tue Feb  3 19:45:42 2004
@@ -419,7 +419,7 @@
 	cmd_hwif1 = &ide_hwifs[1]; /* default, if not found below */
 	for (i = 0; i < MAX_HWIFS; i++) {
 		ide_hwif_t *hwif = &ide_hwifs[i];
-		if (hwif->chipset == ide_unknown || hwif->chipset == ide_generic) {
+		if (hwif->chipset == ide_unknown || hwif->chipset == ide_forced) {
 			if (hwif->io_ports[IDE_DATA_OFFSET] == 0x1f0)
 				cmd_hwif0 = hwif;
 			else if (hwif->io_ports[IDE_DATA_OFFSET] == 0x170)
diff -Nru a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
--- a/drivers/ide/pci/pdc202xx_new.c	Tue Feb  3 19:45:35 2004
+++ b/drivers/ide/pci/pdc202xx_new.c	Tue Feb  3 19:45:35 2004
@@ -32,6 +32,11 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 
+#ifdef CONFIG_PPC_PMAC
+#include <asm/prom.h>
+#include <asm/pci-bridge.h>
+#endif
+
 #include "pdc202xx_new.h"
 
 #define PDC202_DEBUG_CABLE	0
@@ -513,6 +518,44 @@
 #endif
 }
 
+#ifdef CONFIG_PPC_PMAC
+static void __devinit apple_kiwi_init(struct pci_dev *pdev)
+{
+	struct device_node *np = pci_device_to_OF_node(pdev);
+	unsigned int class_rev = 0;
+	unsigned long mmio;
+	u8 conf;
+
+	if (np == NULL || !device_is_compatible(np, "kiwi-root"))
+		return;
+
+	pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class_rev);
+	class_rev &= 0xff;
+
+	if (class_rev >= 0x03) {
+		/* Setup chip magic config stuff (from darwin) */
+		pci_read_config_byte(pdev, 0x40, &conf);
+		pci_write_config_byte(pdev, 0x40, conf | 0x01);
+	}
+	mmio = (unsigned long)ioremap(pci_resource_start(pdev, 5),
+				      pci_resource_len(pdev, 5));
+
+	/* Setup some PLL stuffs */
+	switch (pdev->device) {
+	case PCI_DEVICE_ID_PROMISE_20270:
+		writew(0x0d2b, mmio + 0x1202);
+		mdelay(30);
+		break;
+	case PCI_DEVICE_ID_PROMISE_20271:
+		writew(0x0826, mmio + 0x1202);
+		mdelay(30);
+		break;
+	}
+
+	iounmap((void *)mmio);
+}
+#endif /* CONFIG_PPC_PMAC */
+
 static unsigned int __init init_chipset_pdcnew (struct pci_dev *dev, const char *name)
 {
 	if (dev->resource[PCI_ROM_RESOURCE].start) {
@@ -521,6 +564,10 @@
 		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n",
 			name, dev->resource[PCI_ROM_RESOURCE].start);
 	}
+
+#ifdef CONFIG_PPC_PMAC
+	apple_kiwi_init(dev);
+#endif
 
 #if defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS)
 	pdc202_devs[n_pdc202_devs++] = dev;
diff -Nru a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
--- a/drivers/ide/pci/pdc202xx_old.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/ide/pci/pdc202xx_old.c	Tue Feb  3 19:45:42 2004
@@ -361,16 +361,38 @@
 	return ((u8)(CIS & mask));
 }
 
+/*
+ * Set the control register to use the 66MHz system
+ * clock for UDMA 3/4/5 mode operation when necessary.
+ *
+ * It may also be possible to leave the 66MHz clock on
+ * and readjust the timing parameters.
+ */
+static void pdc_old_enable_66MHz_clock(ide_hwif_t *hwif)
+{
+	unsigned long clock_reg = hwif->dma_master + 0x11;
+	u8 clock = hwif->INB(clock_reg);
+
+	hwif->OUTB(clock | (hwif->channel ? 0x08 : 0x02), clock_reg);
+}
+
+static void pdc_old_disable_66MHz_clock(ide_hwif_t *hwif)
+{
+	unsigned long clock_reg = hwif->dma_master + 0x11;
+	u8 clock = hwif->INB(clock_reg);
+
+	hwif->OUTB(clock & ~(hwif->channel ? 0x08 : 0x02), clock_reg);
+}
+
 static int config_chipset_for_dma (ide_drive_t *drive)
 {
 	struct hd_driveid *id	= drive->id;
 	ide_hwif_t *hwif	= HWIF(drive);
 	struct pci_dev *dev	= hwif->pci_dev;
 	u32 drive_conf		= 0;
-	u8 mask			= hwif->channel ? 0x08 : 0x02;
 	u8 drive_pci		= 0x60 + (drive->dn << 2);
 	u8 test1 = 0, test2 = 0, speed = -1;
-	u8 AP = 0, CLKSPD = 0, cable = 0;
+	u8 AP = 0, cable = 0;
 
 	u8 ultra_66		= ((id->dma_ultra & 0x0010) ||
 				   (id->dma_ultra & 0x0008)) ? 1 : 0;
@@ -394,21 +416,6 @@
 			BUG();
 	}
 
-	CLKSPD = hwif->INB(hwif->dma_master + 0x11);
-
-	/*
-	 * Set the control register to use the 66Mhz system
-	 * clock for UDMA 3/4 mode operation. If one drive on
-	 * a channel is U66 capable but the other isn't we
-	 * fall back to U33 mode. The BIOS INT 13 hooks turn
-	 * the clock on then off for each read/write issued. I don't
-	 * do that here because it would require modifying the
-	 * kernel, separating the fop routines from the kernel or
-	 * somehow hooking the fops calls. It may also be possible to
-	 * leave the 66Mhz clock on and readjust the timing
-	 * parameters.
-	 */
-
 	if ((ultra_66) && (cable)) {
 #ifdef DEBUG
 		printk(KERN_DEBUG "ULTRA 66/100/133: %s channel of Ultra 66/100/133 "
@@ -416,29 +423,12 @@
 			hwif->channel ? "Secondary" : "Primary");
 		printk(KERN_DEBUG "         Switching to Ultra33 mode.\n");
 #endif /* DEBUG */
-		/* Primary   : zero out second bit */
-		/* Secondary : zero out fourth bit */
-		hwif->OUTB(CLKSPD & ~mask, (hwif->dma_master + 0x11));
 		printk(KERN_WARNING "Warning: %s channel requires an 80-pin cable for operation.\n", hwif->channel ? "Secondary":"Primary");
 		printk(KERN_WARNING "%s reduced to Ultra33 mode.\n", drive->name);
-	} else {
-		if (ultra_66) {
-			/*
-			 * check to make sure drive on same channel
-			 * is u66 capable
-			 */
-			if (hwif->drives[!(drive->dn%2)].id) {
-				if (hwif->drives[!(drive->dn%2)].id->dma_ultra & 0x0078) {
-					hwif->OUTB(CLKSPD | mask, (hwif->dma_master + 0x11));
-				} else {
-					hwif->OUTB(CLKSPD & ~mask, (hwif->dma_master + 0x11));
-				}
-			} else { /* udma4 drive by itself */
-				hwif->OUTB(CLKSPD | mask, (hwif->dma_master + 0x11));
-			}
-		}
 	}
 
+	pdc_old_disable_66MHz_clock(drive->hwif);
+
 	drive_pci = 0x60 + (drive->dn << 2);
 	pci_read_config_dword(dev, drive_pci, &drive_conf);
 	if ((drive_conf != 0x004ff304) && (drive_conf != 0x004ff3c4))
@@ -536,6 +526,8 @@
 
 static int pdc202xx_old_ide_dma_begin(ide_drive_t *drive)
 {
+	if (drive->current_speed > XFER_UDMA_2)
+		pdc_old_enable_66MHz_clock(drive->hwif);
 	if (drive->addressing == 1) {
 		struct request *rq	= HWGROUP(drive)->rq;
 		ide_hwif_t *hwif	= HWIF(drive);
@@ -569,6 +561,8 @@
 		clock = hwif->INB(high_16 + 0x11);
 		hwif->OUTB(clock & ~(hwif->channel ? 0x08:0x02), high_16+0x11);
 	}
+	if (drive->current_speed > XFER_UDMA_2)
+		pdc_old_disable_66MHz_clock(drive->hwif);
 	return __ide_dma_end(drive);
 }
 
@@ -757,10 +751,7 @@
 
 	hwif->speedproc = &pdc202xx_tune_chipset;
 
-	if (!hwif->dma_base) {
-		hwif->drives[0].autotune = hwif->drives[1].autotune = 1;
-		return;
-	}
+	hwif->drives[0].autotune = hwif->drives[1].autotune = 1;
 
 	hwif->ultra_mask = 0x3f;
 	hwif->mwdma_mask = 0x07;
diff -Nru a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
--- a/drivers/ide/pci/sgiioc4.c	Tue Feb  3 19:45:26 2004
+++ b/drivers/ide/pci/sgiioc4.c	Tue Feb  3 19:45:26 2004
@@ -23,7 +23,6 @@
  * http://oss.sgi.com/projects/GenInfo/NoticeExplan
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/pci.h>
@@ -686,7 +685,7 @@
 			"0x%p to 0x%p ALREADY in use\n",
 		       __FUNCTION__, hwif->name, (void *) base,
 		       (void *) base + IOC4_CMD_CTL_BLK_SIZE);
-		return 1;
+		return -ENOMEM;
 	}
 
 	if (hwif->io_ports[IDE_DATA_OFFSET] != base) {
@@ -726,20 +725,21 @@
 	PCIDMA_ENDIAN_BIG,
 	PCIDMA_ENDIAN_LITTLE
 } pciio_endian_t;
-pciio_endian_t __attribute__ ((weak)) snia_pciio_endian_set(struct pci_dev
-					    *pci_dev, pciio_endian_t device_end,
-					    pciio_endian_t desired_end);
+pciio_endian_t snia_pciio_endian_set(struct pci_dev
+				     *pci_dev, pciio_endian_t device_end,
+				     pciio_endian_t desired_end);
 
 static unsigned int __init
 pci_init_sgiioc4(struct pci_dev *dev, ide_pci_device_t * d)
 {
 	unsigned int class_rev;
+	pciio_endian_t endian_status;
 
 	if (pci_enable_device(dev)) {
 		printk(KERN_ERR
 		       "Failed to enable device %s at slot %s\n",
 		       d->name, dev->slot_name);
-		return 1;
+		return -ENODEV;
 	}
 	pci_set_master(dev);
 
@@ -751,18 +751,17 @@
 		printk(KERN_ERR "Skipping %s IDE controller in slot %s: "
 			"firmware is obsolete - please upgrade to revision"
 			"46 or higher\n", d->name, dev->slot_name);
-		return 1;
+		return -ENODEV;
 	}
 
 	/* Enable Byte Swapping in the PIC... */
-	if (snia_pciio_endian_set) {
-		snia_pciio_endian_set(dev, PCIDMA_ENDIAN_LITTLE,
-				      PCIDMA_ENDIAN_BIG);
-	} else {
+	endian_status = snia_pciio_endian_set(dev, PCIDMA_ENDIAN_LITTLE,
+					      PCIDMA_ENDIAN_BIG);
+	if (endian_status != PCIDMA_ENDIAN_BIG) {
 		printk(KERN_ERR
 		       "Failed to set endianness for device %s at slot %s\n",
 		       d->name, dev->slot_name);
-		return 1;
+		return -ENODEV;
 	}
 
 	return sgiioc4_ide_setup_pci_device(dev, d);
diff -Nru a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
--- a/drivers/ide/pci/siimage.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/ide/pci/siimage.c	Tue Feb  3 19:45:17 2004
@@ -767,19 +767,16 @@
  
 static void proc_reports_siimage (struct pci_dev *dev, u8 clocking, const char *name)
 {
-	if(pdev_is_sata(dev))
-		goto sata_skip;
-
-	printk(KERN_INFO "%s: BASE CLOCK ", name);
-	clocking &= 0x03;
-	switch(clocking) {
-		case 0x03: printk("DISABLED !\n"); break;
-		case 0x02: printk("== 2X PCI \n"); break;
-		case 0x01: printk("== 133 \n"); break;
-		case 0x00: printk("== 100 \n"); break;
+	if (!pdev_is_sata(dev)) {
+		printk(KERN_INFO "%s: BASE CLOCK ", name);
+		clocking &= 0x03;
+		switch (clocking) {
+			case 0x03: printk("DISABLED!\n"); break;
+			case 0x02: printk("== 2X PCI\n"); break;
+			case 0x01: printk("== 133\n"); break;
+			case 0x00: printk("== 100\n"); break;
+		}
 	}
-
-sata_skip:
 
 #if defined(DISPLAY_SIIMAGE_TIMINGS) && defined(CONFIG_PROC_FS)
 	siimage_devs[n_siimage_devs++] = dev;
diff -Nru a/drivers/ide/ppc/Makefile b/drivers/ide/ppc/Makefile
--- a/drivers/ide/ppc/Makefile	Tue Feb  3 19:45:30 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,6 +0,0 @@
-
-obj-$(CONFIG_BLK_DEV_MPC8xx_IDE)	+= mpc8xx.o
-obj-$(CONFIG_BLK_DEV_IDE_PMAC)		+= pmac.o
-obj-$(CONFIG_BLK_DEV_IDE_SWARM)		+= swarm.o
-
-EXTRA_CFLAGS	:= -Idrivers/ide
diff -Nru a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
--- a/drivers/ide/setup-pci.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/ide/setup-pci.c	Tue Feb  3 19:45:17 2004
@@ -59,7 +59,7 @@
 	for (h = 0; h < MAX_HWIFS; ++h) {
 		hwif = &ide_hwifs[h];
 		if (hwif->io_ports[IDE_DATA_OFFSET] == io_base) {
-			if (hwif->chipset == ide_generic)
+			if (hwif->chipset == ide_forced)
 				return hwif; /* a perfect match */
 		}
 	}
diff -Nru a/drivers/ieee1394/Kconfig b/drivers/ieee1394/Kconfig
--- a/drivers/ieee1394/Kconfig	Tue Feb  3 19:45:16 2004
+++ b/drivers/ieee1394/Kconfig	Tue Feb  3 19:45:16 2004
@@ -40,7 +40,7 @@
 	help
 	  If you say Y here, then an OUI list (vendor unique ID's) will be
 	  compiled into the ieee1394 module. This doesn't really do much
-	  accept being able to display the vendor of a hardware node. The
+	  except being able to display the vendor of a hardware node. The
 	  downside is that it adds about 300k to the size of the module,
 	  or kernel (depending on whether you compile ieee1394 as a
 	  module, or static in the kernel).
@@ -51,12 +51,13 @@
 comment "Device Drivers"
 	depends on IEEE1394
 
-comment "Texas Instruments PCILynx requires I2C bit-banging"
-	depends on IEEE1394 && (I2C=n || I2C_ALGOBIT=n)
+comment "Texas Instruments PCILynx requires I2C"
+	depends on IEEE1394 && I2C=n
 
 config IEEE1394_PCILYNX
 	tristate "Texas Instruments PCILynx support"
-	depends on PCI && IEEE1394 && I2C_ALGOBIT
+	depends on PCI && IEEE1394 && I2C
+	select I2C_ALGOBIT
 	help
 	  Say Y here if you have an IEEE-1394 controller with the Texas
 	  Instruments PCILynx chip.  Note: this driver is written for revision
diff -Nru a/drivers/ieee1394/amdtp.c b/drivers/ieee1394/amdtp.c
--- a/drivers/ieee1394/amdtp.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/ieee1394/amdtp.c	Tue Feb  3 19:45:30 2004
@@ -82,6 +82,7 @@
 #include <linux/poll.h>
 #include <linux/ioctl32.h>
 #include <linux/compat.h>
+#include <linux/cdev.h>
 #include <asm/uaccess.h>
 #include <asm/atomic.h>
 
@@ -1196,6 +1197,7 @@
 	return 0;
 }
 
+static struct cdev amdtp_cdev;
 static struct file_operations amdtp_fops =
 {
 	.owner =	THIS_MODULE,
@@ -1262,12 +1264,11 @@
 
 static int __init amdtp_init_module (void)
 {
-	int ret;
-
-	ret = ieee1394_register_chardev(IEEE1394_MINOR_BLOCK_AMDTP,
-					THIS_MODULE, &amdtp_fops);
-	if (ret) {
-		HPSB_ERR("amdtp: unable to get minor device block");
+	cdev_init(&amdtp_cdev, &amdtp_fops);
+	amdtp_cdev.owner = THIS_MODULE;
+	kobject_set_name(&amdtp_cdev.kobj, "amdtp");
+	if (cdev_add(&amdtp_cdev, IEEE1394_AMDTP_DEV, 16)) {
+		HPSB_ERR("amdtp: unable to add char device");
  		return -EIO;
  	}
 
@@ -1276,12 +1277,15 @@
 	hpsb_register_highlevel(&amdtp_highlevel);
 
 #ifdef CONFIG_COMPAT
-	ret = register_ioctl32_conversion(AMDTP_IOC_CHANNEL, NULL);
-	ret |= register_ioctl32_conversion(AMDTP_IOC_PLUG, NULL);
-	ret |= register_ioctl32_conversion(AMDTP_IOC_PING, NULL);
-	ret |= register_ioctl32_conversion(AMDTP_IOC_ZAP, NULL);
-	if (ret)
-		HPSB_ERR("amdtp: Error registering ioctl32 translations");
+	{
+		int ret;
+		ret = register_ioctl32_conversion(AMDTP_IOC_CHANNEL, NULL);
+		ret |= register_ioctl32_conversion(AMDTP_IOC_PLUG, NULL);
+		ret |= register_ioctl32_conversion(AMDTP_IOC_PING, NULL);
+		ret |= register_ioctl32_conversion(AMDTP_IOC_ZAP, NULL);
+		if (ret)
+			HPSB_ERR("amdtp: Error registering ioctl32 translations");
+	}
 #endif
 
 	HPSB_INFO("Loaded AMDTP driver");
@@ -1304,10 +1308,12 @@
 
         hpsb_unregister_highlevel(&amdtp_highlevel);
 	devfs_remove("amdtp");
-        ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_AMDTP);
+	cdev_unmap(IEEE1394_AMDTP_DEV, 16);
+	cdev_del(&amdtp_cdev);
 
 	HPSB_INFO("Unloaded AMDTP driver");
 }
 
 module_init(amdtp_init_module);
 module_exit(amdtp_exit_module);
+MODULE_ALIAS_CHARDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_AMDTP * 16);
diff -Nru a/drivers/ieee1394/cmp.c b/drivers/ieee1394/cmp.c
--- a/drivers/ieee1394/cmp.c	Tue Feb  3 19:45:35 2004
+++ b/drivers/ieee1394/cmp.c	Tue Feb  3 19:45:35 2004
@@ -77,6 +77,25 @@
 
 static struct hpsb_highlevel cmp_highlevel;
 
+static void cmp_add_host(struct hpsb_host *host);
+static void cmp_host_reset(struct hpsb_host *host);
+static int pcr_read(struct hpsb_host *host, int nodeid, quadlet_t *buf,
+		    u64 addr, size_t length, u16 flags);
+static int pcr_lock(struct hpsb_host *host, int nodeid, quadlet_t *store,
+		    u64 addr, quadlet_t data, quadlet_t arg, int extcode, u16 flags);
+
+static struct hpsb_highlevel cmp_highlevel = {
+	.name =		"cmp",
+	.add_host =	cmp_add_host,
+	.host_reset =	cmp_host_reset,
+};
+
+static struct hpsb_address_ops pcr_ops = {
+	.read =	pcr_read,
+	.lock =	pcr_lock,
+};
+
+
 struct cmp_pcr *
 cmp_register_opcr(struct hpsb_host *host, int opcr_number, int payload,
 		  void (*update)(struct cmp_pcr *pcr, void *data),
@@ -137,6 +156,10 @@
 		return;
 	}
 
+	hpsb_register_addrspace(&cmp_highlevel, host, &pcr_ops,
+				CSR_REGISTER_BASE + CSR_PCR_MAP,
+				CSR_REGISTER_BASE + CSR_PCR_MAP_END);
+
 	ch->host = host;
 	ch->u.ompr.rate = IEEE1394_SPEED_100;
 	ch->u.ompr.bcast_channel_base = 63;
@@ -258,17 +281,6 @@
 }
 
 
-static struct hpsb_highlevel cmp_highlevel = {
-	.name =		"cmp",
-	.add_host =	cmp_add_host,
-        .host_reset =	cmp_host_reset,
-};
-
-static struct hpsb_address_ops pcr_ops = {
-	.read =	pcr_read,
-        .lock =	pcr_lock,
-};
-
 /* Module interface */
 
 MODULE_AUTHOR("Kristian Hogsberg <hogsberg@users.sf.net>");
@@ -282,10 +294,6 @@
 static int __init cmp_init_module (void)
 {
 	hpsb_register_highlevel (&cmp_highlevel);
-
-	hpsb_register_addrspace(&cmp_highlevel, &pcr_ops,
-				CSR_REGISTER_BASE + CSR_PCR_MAP,
-				CSR_REGISTER_BASE + CSR_PCR_MAP_END);
 
 	HPSB_INFO("Loaded CMP driver");
 
diff -Nru a/drivers/ieee1394/csr.c b/drivers/ieee1394/csr.c
--- a/drivers/ieee1394/csr.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/ieee1394/csr.c	Tue Feb  3 19:45:17 2004
@@ -35,6 +35,43 @@
 module_param(fcp, int, 0444);
 MODULE_PARM_DESC(fcp, "Map FCP registers (default = 1, disable = 0).");
 
+static void add_host(struct hpsb_host *host);
+static void host_reset(struct hpsb_host *host);
+static int read_maps(struct hpsb_host *host, int nodeid, quadlet_t *buffer,
+		     u64 addr, size_t length, u16 fl);
+static int write_fcp(struct hpsb_host *host, int nodeid, int dest,
+		     quadlet_t *data, u64 addr, size_t length, u16 flags);
+static int read_regs(struct hpsb_host *host, int nodeid, quadlet_t *buf,
+		     u64 addr, size_t length, u16 flags);
+static int write_regs(struct hpsb_host *host, int nodeid, int destid,
+		      quadlet_t *data, u64 addr, size_t length, u16 flags);
+static int lock_regs(struct hpsb_host *host, int nodeid, quadlet_t *store,
+		     u64 addr, quadlet_t data, quadlet_t arg, int extcode, u16 fl);
+static int lock64_regs(struct hpsb_host *host, int nodeid, octlet_t * store,
+		       u64 addr, octlet_t data, octlet_t arg, int extcode, u16 fl);
+
+static struct hpsb_highlevel csr_highlevel = {
+	.name =		"standard registers",
+	.add_host =	add_host,
+	.host_reset =	host_reset,
+};
+
+static struct hpsb_address_ops map_ops = {
+	.read = read_maps,
+};
+
+static struct hpsb_address_ops fcp_ops = {
+	.write = write_fcp,
+};
+
+static struct hpsb_address_ops reg_ops = {
+	.read = read_regs,
+	.write = write_regs,
+	.lock = lock_regs,
+	.lock64 = lock64_regs,
+};
+
+
 static u16 csr_crc16(unsigned *data, int length)
 {
         int check=0, i;
@@ -125,6 +162,24 @@
 
 static void add_host(struct hpsb_host *host)
 {
+	hpsb_register_addrspace(&csr_highlevel, host, &reg_ops,
+				CSR_REGISTER_BASE,
+				CSR_REGISTER_BASE + CSR_CONFIG_ROM);
+	hpsb_register_addrspace(&csr_highlevel, host, &map_ops,
+				CSR_REGISTER_BASE + CSR_CONFIG_ROM,
+				CSR_REGISTER_BASE + CSR_CONFIG_ROM_END);
+	if (fcp) {
+		hpsb_register_addrspace(&csr_highlevel, host, &fcp_ops,
+					CSR_REGISTER_BASE + CSR_FCP_COMMAND,
+					CSR_REGISTER_BASE + CSR_FCP_END);
+	}
+	hpsb_register_addrspace(&csr_highlevel, host, &map_ops,
+				CSR_REGISTER_BASE + CSR_TOPOLOGY_MAP,
+				CSR_REGISTER_BASE + CSR_TOPOLOGY_MAP_END);
+	hpsb_register_addrspace(&csr_highlevel, host, &map_ops,
+				CSR_REGISTER_BASE + CSR_SPEED_MAP,
+				CSR_REGISTER_BASE + CSR_SPEED_MAP_END);
+
         host->csr.lock = SPIN_LOCK_UNLOCKED;
 
         host->csr.rom_size = host->driver->get_rom(host, &host->csr.rom);
@@ -684,48 +739,10 @@
 }
 
 
-static struct hpsb_highlevel csr_highlevel = {
-	.name =		"standard registers",
-	.add_host =	add_host,
-        .host_reset =	host_reset,
-};
-
-
-static struct hpsb_address_ops map_ops = {
-        .read = read_maps,
-};
-
-static struct hpsb_address_ops fcp_ops = {
-        .write = write_fcp,
-};
-
-static struct hpsb_address_ops reg_ops = {
-        .read = read_regs,
-        .write = write_regs,
-        .lock = lock_regs,
-	.lock64 = lock64_regs,
-};
 
 void init_csr(void)
 {
 	hpsb_register_highlevel(&csr_highlevel);
-
-        hpsb_register_addrspace(&csr_highlevel, &reg_ops, CSR_REGISTER_BASE,
-                                CSR_REGISTER_BASE + CSR_CONFIG_ROM);
-        hpsb_register_addrspace(&csr_highlevel, &map_ops, 
-                                CSR_REGISTER_BASE + CSR_CONFIG_ROM,
-                                CSR_REGISTER_BASE + CSR_CONFIG_ROM_END);
-        if (fcp) {
-		hpsb_register_addrspace(&csr_highlevel, &fcp_ops,
-                                CSR_REGISTER_BASE + CSR_FCP_COMMAND,
-                                CSR_REGISTER_BASE + CSR_FCP_END);
-	}
-        hpsb_register_addrspace(&csr_highlevel, &map_ops,
-                                CSR_REGISTER_BASE + CSR_TOPOLOGY_MAP,
-                                CSR_REGISTER_BASE + CSR_TOPOLOGY_MAP_END);
-        hpsb_register_addrspace(&csr_highlevel, &map_ops,
-                                CSR_REGISTER_BASE + CSR_SPEED_MAP,
-                                CSR_REGISTER_BASE + CSR_SPEED_MAP_END);
 }
 
 void cleanup_csr(void)
diff -Nru a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c
--- a/drivers/ieee1394/dv1394.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/ieee1394/dv1394.c	Tue Feb  3 19:45:34 2004
@@ -110,6 +110,7 @@
 #include <linux/string.h>
 #include <linux/ioctl32.h>
 #include <linux/compat.h>
+#include <linux/cdev.h>
 
 #include "ieee1394.h"
 #include "ieee1394_types.h"
@@ -2165,6 +2166,7 @@
 	spin_unlock(&video->spinlock);
 }
 
+static struct cdev dv1394_cdev;
 static struct file_operations dv1394_fops=
 {
 	.owner =	THIS_MODULE,
@@ -2607,17 +2609,17 @@
 	hpsb_unregister_protocol(&dv1394_driver);
 
 	hpsb_unregister_highlevel(&dv1394_highlevel);
-	ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_DV1394);
+	cdev_unmap(IEEE1394_DV1394_DEV, 16);
+	cdev_del(&dv1394_cdev);
 	devfs_remove("ieee1394/dv");
 }
 
 static int __init dv1394_init_module(void)
 {
-	int ret;
-
-	ret = ieee1394_register_chardev(IEEE1394_MINOR_BLOCK_DV1394,
-					THIS_MODULE, &dv1394_fops);
-	if (ret) {
+	cdev_init(&dv1394_cdev, &dv1394_fops);
+	dv1394_cdev.owner = THIS_MODULE;
+	kobject_set_name(&dv1394_cdev.kobj, "dv1394");
+	if (cdev_add(&dv1394_cdev, IEEE1394_DV1394_DEV, 16)) {
 		printk(KERN_ERR "dv1394: unable to register character device\n");
 		return -EIO;
 	}
@@ -2629,18 +2631,22 @@
 	hpsb_register_protocol(&dv1394_driver);
 
 #ifdef CONFIG_COMPAT
-	/* First compatible ones */
-	ret = register_ioctl32_conversion(DV1394_IOC_SHUTDOWN, NULL);
-	ret |= register_ioctl32_conversion(DV1394_IOC_SUBMIT_FRAMES, NULL);
-	ret |= register_ioctl32_conversion(DV1394_IOC_WAIT_FRAMES, NULL);
-	ret |= register_ioctl32_conversion(DV1394_IOC_RECEIVE_FRAMES, NULL);
-	ret |= register_ioctl32_conversion(DV1394_IOC_START_RECEIVE, NULL);
-
-	/* These need to be handled by translation */
-	ret |= register_ioctl32_conversion(DV1394_IOC32_INIT, handle_dv1394_init);
-	ret |= register_ioctl32_conversion(DV1394_IOC32_GET_STATUS, handle_dv1394_get_status);
-	if (ret)
-		printk(KERN_ERR "dv1394: Error registering ioctl32 translations\n");
+	{
+		int ret;
+
+		/* First compatible ones */
+		ret = register_ioctl32_conversion(DV1394_IOC_SHUTDOWN, NULL);
+		ret |= register_ioctl32_conversion(DV1394_IOC_SUBMIT_FRAMES, NULL);
+		ret |= register_ioctl32_conversion(DV1394_IOC_WAIT_FRAMES, NULL);
+		ret |= register_ioctl32_conversion(DV1394_IOC_RECEIVE_FRAMES, NULL);
+		ret |= register_ioctl32_conversion(DV1394_IOC_START_RECEIVE, NULL);
+
+		/* These need to be handled by translation */
+		ret |= register_ioctl32_conversion(DV1394_IOC32_INIT, handle_dv1394_init);
+		ret |= register_ioctl32_conversion(DV1394_IOC32_GET_STATUS, handle_dv1394_get_status);
+		if (ret)
+			printk(KERN_ERR "dv1394: Error registering ioctl32 translations\n");
+	}
 #endif
 
 	return 0;
@@ -2648,3 +2654,4 @@
 
 module_init(dv1394_init_module);
 module_exit(dv1394_exit_module);
+MODULE_ALIAS_CHARDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16);
diff -Nru a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c
--- a/drivers/ieee1394/eth1394.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/ieee1394/eth1394.c	Tue Feb  3 19:45:30 2004
@@ -89,7 +89,7 @@
 #define TRACE() printk(KERN_ERR "%s:%s[%d] ---- TRACE\n", driver_name, __FUNCTION__, __LINE__)
 
 static char version[] __devinitdata =
-	"$Rev: 1079 $ Ben Collins <bcollins@debian.org>";
+	"$Rev: 1096 $ Ben Collins <bcollins@debian.org>";
 
 struct fragment_info {
 	struct list_head list;
@@ -168,6 +168,26 @@
 static int ether1394_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
 static int ether1394_ethtool_ioctl(struct net_device *dev, void *useraddr);
 
+static int ether1394_write(struct hpsb_host *host, int srcid, int destid,
+			   quadlet_t *data, u64 addr, size_t len, u16 flags);
+static void ether1394_add_host (struct hpsb_host *host);
+static void ether1394_remove_host (struct hpsb_host *host);
+static void ether1394_host_reset (struct hpsb_host *host);
+
+/* Function for incoming 1394 packets */
+static struct hpsb_address_ops addr_ops = {
+	.write =	ether1394_write,
+};
+
+/* Ieee1394 highlevel driver functions */
+static struct hpsb_highlevel eth1394_highlevel = {
+	.name =		driver_name,
+	.add_host =	ether1394_add_host,
+	.remove_host =	ether1394_remove_host,
+	.host_reset =	ether1394_host_reset,
+};
+
+
 static void eth1394_iso_shutdown(struct eth1394_priv *priv)
 {
 	priv->bc_state = ETHER1394_BC_CLOSED;
@@ -420,6 +440,10 @@
 	struct eth1394_priv *priv;
 	static int version_printed = 0;
 
+	hpsb_register_addrspace(&eth1394_highlevel, host, &addr_ops,
+				ETHER1394_REGION_ADDR,
+				ETHER1394_REGION_ADDR_END);
+
 	if (version_printed++ == 0)
 		ETH1394_PRINT_G (KERN_INFO, "%s\n", version);
 
@@ -1599,7 +1623,7 @@
 		case ETHTOOL_GDRVINFO: {
 			struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO };
 			strcpy (info.driver, driver_name);
-			strcpy (info.version, "$Rev: 1079 $");
+			strcpy (info.version, "$Rev: 1096 $");
 			/* FIXME XXX provide sane businfo */
 			strcpy (info.bus_info, "ieee1394");
 			if (copy_to_user (useraddr, &info, sizeof (info)))
@@ -1619,18 +1643,6 @@
 	return 0;
 }
 
-/* Function for incoming 1394 packets */
-static struct hpsb_address_ops addr_ops = {
-	.write =	ether1394_write,
-};
-
-/* Ieee1394 highlevel driver functions */
-static struct hpsb_highlevel eth1394_highlevel = {
-	.name =		driver_name,
-	.add_host =	ether1394_add_host,
-	.remove_host =	ether1394_remove_host,
-	.host_reset =	ether1394_host_reset,
-};
 
 static int __init ether1394_init_module (void)
 {
@@ -1639,9 +1651,6 @@
 
 	/* Register ourselves as a highlevel driver */
 	hpsb_register_highlevel(&eth1394_highlevel);
-
-	hpsb_register_addrspace(&eth1394_highlevel, &addr_ops, ETHER1394_REGION_ADDR,
-				 ETHER1394_REGION_ADDR_END);
 
 	return 0;
 }
diff -Nru a/drivers/ieee1394/highlevel.c b/drivers/ieee1394/highlevel.c
--- a/drivers/ieee1394/highlevel.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/ieee1394/highlevel.c	Tue Feb  3 19:45:41 2004
@@ -39,7 +39,10 @@
 
 
 static LIST_HEAD(hl_drivers);
-static rwlock_t hl_drivers_lock = RW_LOCK_UNLOCKED;
+static DECLARE_RWSEM(hl_drivers_sem);
+
+static LIST_HEAD(hl_irqs);
+static rwlock_t hl_irqs_lock = RW_LOCK_UNLOCKED;
 
 static LIST_HEAD(addr_space);
 static rwlock_t addr_space_lock = RW_LOCK_UNLOCKED;
@@ -239,16 +242,18 @@
 
 void hpsb_register_highlevel(struct hpsb_highlevel *hl)
 {
-	unsigned long flags;
-
         INIT_LIST_HEAD(&hl->addr_list);
 	INIT_LIST_HEAD(&hl->host_info_list);
 
 	rwlock_init(&hl->host_info_lock);
 
-	write_lock_irqsave(&hl_drivers_lock, flags);
+	down_write(&hl_drivers_sem);
         list_add_tail(&hl->hl_list, &hl_drivers);
-	write_unlock_irqrestore(&hl_drivers_lock, flags);
+	up_write(&hl_drivers_sem);
+
+	write_lock(&hl_irqs_lock);
+	list_add_tail(&hl->irq_list, &hl_irqs);
+	write_unlock(&hl_irqs_lock);
 
 	if (hl->add_host)
 		nodemgr_for_each_host(hl, highlevel_for_each_host_reg);
@@ -256,39 +261,58 @@
         return;
 }
 
+static void __unregister_host(struct hpsb_highlevel *hl, struct hpsb_host *host)
+{
+	unsigned long flags;
+	struct list_head *lh, *next;
+	struct hpsb_address_serve *as;
+
+	if (hl->remove_host)
+		hl->remove_host(host);
+
+	/* Remove any addresses that are matched for this highlevel driver
+	 * and this particular host. */
+	write_lock_irqsave(&addr_space_lock, flags);
+	list_for_each_safe (lh, next, &hl->addr_list) {
+		as = list_entry(lh, struct hpsb_address_serve, addr_list);
+
+		if (as->host != host)
+			continue;
+
+		if (!list_empty(&as->addr_list)) {
+			list_del(&as->as_list);
+			list_del(&as->addr_list);
+			kfree(as);
+		}
+	}
+	write_unlock_irqrestore(&addr_space_lock, flags);
+
+	hpsb_destroy_hostinfo(hl, host);
+}
+
 static int highlevel_for_each_host_unreg(struct hpsb_host *host, void *__data)
 {
 	struct hpsb_highlevel *hl = __data;
 
-	hl->remove_host(host);
-	hpsb_destroy_hostinfo(hl, host);
+	__unregister_host(hl, host);
 
 	return 0;
 }
 
 void hpsb_unregister_highlevel(struct hpsb_highlevel *hl)
 {
-	struct list_head *lh, *next;
-        struct hpsb_address_serve *as;
-	unsigned long flags;
-
-	write_lock_irqsave(&addr_space_lock, flags);
-	list_for_each_safe (lh, next, &hl->addr_list) {
-                as = list_entry(lh, struct hpsb_address_serve, addr_list);
-                list_del(&as->as_list);
-                kfree(as);
-        }
-	write_unlock_irqrestore(&addr_space_lock, flags);
+	write_lock(&hl_irqs_lock);
+	list_del(&hl->irq_list);
+	write_unlock(&hl_irqs_lock);
 
-	write_lock_irqsave(&hl_drivers_lock, flags);
+	down_write(&hl_drivers_sem);
         list_del(&hl->hl_list);
-	write_unlock_irqrestore(&hl_drivers_lock, flags);
+	up_write(&hl_drivers_sem);
 
-        if (hl->remove_host)
-		nodemgr_for_each_host(hl, highlevel_for_each_host_unreg);
+	nodemgr_for_each_host(hl, highlevel_for_each_host_unreg);
 }
 
-int hpsb_register_addrspace(struct hpsb_highlevel *hl,
+int hpsb_register_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host,
                             struct hpsb_address_ops *ops, u64 start, u64 end)
 {
         struct hpsb_address_serve *as;
@@ -314,7 +338,7 @@
         as->end = end;
 
         write_lock_irqsave(&addr_space_lock, flags);
-        entry = addr_space.next;
+        entry = host->addr_space.next;
 
         while (list_entry(entry, struct hpsb_address_serve, as_list)->end
                <= start) {
@@ -336,7 +360,8 @@
         return retval;
 }
 
-int hpsb_unregister_addrspace(struct hpsb_highlevel *hl, u64 start)
+int hpsb_unregister_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host,
+                              u64 start)
 {
         int retval = 0;
         struct hpsb_address_serve *as;
@@ -350,7 +375,7 @@
         while (entry != &hl->addr_list) {
                 as = list_entry(entry, struct hpsb_address_serve, addr_list);
                 entry = entry->next;
-                if (as->start == start) {
+                if (as->start == start && as->host == host) {
                         list_del(&as->as_list);
                         list_del(&as->addr_list);
                         kfree(as);
@@ -392,92 +417,84 @@
         }
 }
 
+static void init_hpsb_highlevel(struct hpsb_host *host)
+{
+	INIT_LIST_HEAD(&dummy_zero_addr.as_list);
+	INIT_LIST_HEAD(&dummy_zero_addr.addr_list);
+	INIT_LIST_HEAD(&dummy_max_addr.as_list);
+	INIT_LIST_HEAD(&dummy_max_addr.addr_list);
+
+	dummy_zero_addr.op = dummy_max_addr.op = &dummy_ops;
+
+	dummy_zero_addr.start = dummy_zero_addr.end = 0;
+	dummy_max_addr.start = dummy_max_addr.end = ((u64) 1) << 48;
+
+	list_add_tail(&dummy_zero_addr.as_list, &host->addr_space);
+	list_add_tail(&dummy_max_addr.as_list, &host->addr_space);
+}
 
 void highlevel_add_host(struct hpsb_host *host)
 {
-        struct list_head *entry;
         struct hpsb_highlevel *hl;
 
-        read_lock(&hl_drivers_lock);
-        list_for_each(entry, &hl_drivers) {
-                hl = list_entry(entry, struct hpsb_highlevel, hl_list);
+	init_hpsb_highlevel(host);
+
+	down_read(&hl_drivers_sem);
+        list_for_each_entry(hl, &hl_drivers, hl_list) {
 		if (hl->add_host)
 			hl->add_host(host);
         }
-        read_unlock(&hl_drivers_lock);
+	up_read(&hl_drivers_sem);
 }
 
 void highlevel_remove_host(struct hpsb_host *host)
 {
-        struct list_head *entry;
         struct hpsb_highlevel *hl;
 
-	read_lock(&hl_drivers_lock);
-	list_for_each(entry, &hl_drivers) {
-                hl = list_entry(entry, struct hpsb_highlevel, hl_list);
-
-		if (hl->remove_host) {
-			hl->remove_host(host);
-			hpsb_destroy_hostinfo(hl, host);
-		}
-        }
-	read_unlock(&hl_drivers_lock);
+	down_read(&hl_drivers_sem);
+	list_for_each_entry(hl, &hl_drivers, hl_list)
+		__unregister_host(hl, host);
+	up_read(&hl_drivers_sem);
 }
 
 void highlevel_host_reset(struct hpsb_host *host)
 {
-        struct list_head *entry;
         struct hpsb_highlevel *hl;
 
-	read_lock(&hl_drivers_lock);
-	list_for_each(entry, &hl_drivers) {
-                hl = list_entry(entry, struct hpsb_highlevel, hl_list);
-
+	read_lock(&hl_irqs_lock);
+	list_for_each_entry(hl, &hl_irqs, irq_list) {
                 if (hl->host_reset)
                         hl->host_reset(host);
         }
-	read_unlock(&hl_drivers_lock);
+	read_unlock(&hl_irqs_lock);
 }
 
-void highlevel_iso_receive(struct hpsb_host *host, void *data,
-			   size_t length)
+void highlevel_iso_receive(struct hpsb_host *host, void *data, size_t length)
 {
-        struct list_head *entry;
         struct hpsb_highlevel *hl;
         int channel = (((quadlet_t *)data)[0] >> 8) & 0x3f;
 
-        read_lock(&hl_drivers_lock);
-        entry = hl_drivers.next;
-
-        while (entry != &hl_drivers) {
-                hl = list_entry(entry, struct hpsb_highlevel, hl_list);
-                if (hl->iso_receive) {
+        read_lock(&hl_irqs_lock);
+	list_for_each_entry(hl, &hl_irqs, irq_list) {
+                if (hl->iso_receive)
                         hl->iso_receive(host, channel, data, length);
-                }
-                entry = entry->next;
         }
-        read_unlock(&hl_drivers_lock);
+        read_unlock(&hl_irqs_lock);
 }
 
 void highlevel_fcp_request(struct hpsb_host *host, int nodeid, int direction,
 			   void *data, size_t length)
 {
-        struct list_head *entry;
         struct hpsb_highlevel *hl;
         int cts = ((quadlet_t *)data)[0] >> 4;
 
-        read_lock(&hl_drivers_lock);
-        entry = hl_drivers.next;
-
-        while (entry != &hl_drivers) {
-                hl = list_entry(entry, struct hpsb_highlevel, hl_list);
-                if (hl->fcp_request) {
+        read_lock(&hl_irqs_lock);
+	list_for_each_entry(hl, &hl_irqs, irq_list) {
+                if (hl->fcp_request)
                         hl->fcp_request(host, nodeid, direction, cts, data,
-                                            length);
-                }
-                entry = entry->next;
+					length);
         }
-        read_unlock(&hl_drivers_lock);
+        read_unlock(&hl_irqs_lock);
 }
 
 int highlevel_read(struct hpsb_host *host, int nodeid, void *data,
@@ -490,7 +507,7 @@
 
         read_lock(&addr_space_lock);
 
-        entry = addr_space.next;
+        entry = host->addr_space.next;
         as = list_entry(entry, struct hpsb_address_serve, as_list);
 
         while (as->start <= addr) {
@@ -536,7 +553,7 @@
 
         read_lock(&addr_space_lock);
 
-        entry = addr_space.next;
+        entry = host->addr_space.next;
         as = list_entry(entry, struct hpsb_address_serve, as_list);
 
         while (as->start <= addr) {
@@ -582,7 +599,7 @@
 
         read_lock(&addr_space_lock);
 
-        entry = addr_space.next;
+        entry = host->addr_space.next;
         as = list_entry(entry, struct hpsb_address_serve, as_list);
 
         while (as->start <= addr) {
@@ -615,7 +632,7 @@
 
         read_lock(&addr_space_lock);
 
-        entry = addr_space.next;
+        entry = host->addr_space.next;
         as = list_entry(entry, struct hpsb_address_serve, as_list);
 
         while (as->start <= addr) {
@@ -638,20 +655,4 @@
         read_unlock(&addr_space_lock);
 
         return rcode;
-}
-
-void init_hpsb_highlevel(void)
-{
-        INIT_LIST_HEAD(&dummy_zero_addr.as_list);
-        INIT_LIST_HEAD(&dummy_zero_addr.addr_list);
-        INIT_LIST_HEAD(&dummy_max_addr.as_list);
-        INIT_LIST_HEAD(&dummy_max_addr.addr_list);
-
-        dummy_zero_addr.op = dummy_max_addr.op = &dummy_ops;
-
-        dummy_zero_addr.start = dummy_zero_addr.end = 0;
-        dummy_max_addr.start = dummy_max_addr.end = ((u64) 1) << 48;
-
-        list_add_tail(&dummy_zero_addr.as_list, &addr_space);
-        list_add_tail(&dummy_max_addr.as_list, &addr_space);
 }
diff -Nru a/drivers/ieee1394/highlevel.h b/drivers/ieee1394/highlevel.h
--- a/drivers/ieee1394/highlevel.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/ieee1394/highlevel.h	Tue Feb  3 19:45:17 2004
@@ -10,6 +10,8 @@
 
         struct hpsb_address_ops *op;
 
+	struct hpsb_host *host;
+
         /* first address handled and first address behind, quadlet aligned */
         u64 start, end;
 };
@@ -36,9 +38,9 @@
          * hpsb_unregister_highlevel once for each host. */
         void (*remove_host) (struct hpsb_host *host);
 
-        /* Host experienced bus reset with possible configuration changes.  Note
-         * that this one may occur during interrupt/bottom half handling.  You
-         * can not expect to be able to do stock hpsb_reads. */
+        /* Host experienced bus reset with possible configuration changes.
+	 * Note that this one may occur during interrupt/bottom half handling.
+	 * You can not expect to be able to do stock hpsb_reads. */
         void (*host_reset) (struct hpsb_host *host);
 
         /* An isochronous packet was received.  Channel contains the channel
@@ -50,13 +52,14 @@
 
         /* A write request was received on either the FCP_COMMAND (direction =
          * 0) or the FCP_RESPONSE (direction = 1) register.  The cts arg
-         * contains the cts field (first byte of data).
-         */
+         * contains the cts field (first byte of data). */
         void (*fcp_request) (struct hpsb_host *host, int nodeid, int direction,
                              int cts, u8 *data, size_t length);
 
-
+	/* These are initialized by the subsystem when the
+	 * hpsb_higlevel is registered. */
 	struct list_head hl_list;
+	struct list_head irq_list;
 	struct list_head addr_list;
 
 	struct list_head host_info_list;
@@ -137,10 +140,11 @@
  * It returns true for successful allocation.  There is no unregister function,
  * all address spaces are deallocated together with the hpsb_highlevel.
  */
-int hpsb_register_addrspace(struct hpsb_highlevel *hl,
+int hpsb_register_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host,
                             struct hpsb_address_ops *ops, u64 start, u64 end);
 
-int hpsb_unregister_addrspace(struct hpsb_highlevel *hl, u64 start);
+int hpsb_unregister_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host,
+                              u64 start);
 
 /*
  * Enable or disable receving a certain isochronous channel through the
@@ -177,8 +181,5 @@
 
 /* Retrieve hpsb_host using a highlevel handle and a key */
 struct hpsb_host *hpsb_get_host_bykey(struct hpsb_highlevel *hl, unsigned long key);
-
-/* Initialize the highlevel system */
-void init_hpsb_highlevel(void);
 
 #endif /* IEEE1394_HIGHLEVEL_H */
diff -Nru a/drivers/ieee1394/hosts.c b/drivers/ieee1394/hosts.c
--- a/drivers/ieee1394/hosts.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/ieee1394/hosts.c	Tue Feb  3 19:45:17 2004
@@ -89,6 +89,8 @@
         INIT_LIST_HEAD(&h->pending_packets);
         spin_lock_init(&h->pending_pkt_lock);
 
+	INIT_LIST_HEAD(&h->addr_space);
+
 	for (i = 0; i < ARRAY_SIZE(h->tpool); i++)
 		HPSB_TPOOL_INIT(&h->tpool[i]);
 
diff -Nru a/drivers/ieee1394/hosts.h b/drivers/ieee1394/hosts.h
--- a/drivers/ieee1394/hosts.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/ieee1394/hosts.h	Tue Feb  3 19:45:17 2004
@@ -69,6 +69,8 @@
 	int id;
 
 	struct device device;
+
+	struct list_head addr_space;
 };
 
 
diff -Nru a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c
--- a/drivers/ieee1394/ieee1394_core.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/ieee1394/ieee1394_core.c	Tue Feb  3 19:45:17 2004
@@ -993,186 +993,11 @@
 }
 
 
-/*
- * character device dispatching (see ieee1394_core.h)
- * Dan Maas <dmaas@dcine.com>
- */
-
-static struct {
-	struct file_operations *file_ops;
-	struct module *module;
-} ieee1394_chardevs[16];
-
-static rwlock_t ieee1394_chardevs_lock = RW_LOCK_UNLOCKED;
-
-static int ieee1394_dispatch_open(struct inode *inode, struct file *file);
-
-static struct file_operations ieee1394_chardev_ops = {
-	.owner =THIS_MODULE,
-	.open =	ieee1394_dispatch_open,
-};
-
-/* claim a block of minor numbers */
-int ieee1394_register_chardev(int blocknum,
-			      struct module *module,
-			      struct file_operations *file_ops)
-{
-	int retval;
-
-	if ( (blocknum < 0) || (blocknum > 15) )
-		return -EINVAL;
-
-	write_lock(&ieee1394_chardevs_lock);
-
-	if (ieee1394_chardevs[blocknum].file_ops == NULL) {
-		/* grab the minor block */
-		ieee1394_chardevs[blocknum].file_ops = file_ops;
-		ieee1394_chardevs[blocknum].module = module;
-		
-		retval = 0;
-	} else {
-		/* block already taken */
-		retval = -EBUSY;
-	}
-
-	write_unlock(&ieee1394_chardevs_lock);
-
-	return retval;
-}
-
-/* release a block of minor numbers */
-void ieee1394_unregister_chardev(int blocknum)
-{
-	if ( (blocknum < 0) || (blocknum > 15) )
-		return;
-
-	write_lock(&ieee1394_chardevs_lock);
-
-	if (ieee1394_chardevs[blocknum].file_ops) {
-		ieee1394_chardevs[blocknum].file_ops = NULL;
-		ieee1394_chardevs[blocknum].module = NULL;
-	}
-
-	write_unlock(&ieee1394_chardevs_lock);
-}
-
-/*
-  ieee1394_get_chardev() - look up and acquire a character device
-  driver that has previously registered using ieee1394_register_chardev()
-  
-  On success, returns 1 and sets module and file_ops to the driver.
-  The module will have an incremented reference count.
-   
-  On failure, returns 0.
-  The module will NOT have an incremented reference count.
-*/
-
-static int ieee1394_get_chardev(int blocknum,
-				struct module **module,
-				struct file_operations **file_ops)
-{
-	int ret = 0;
-       
-	if ((blocknum < 0) || (blocknum > 15))
-		return ret;
-
-	read_lock(&ieee1394_chardevs_lock);
-
-	*module = ieee1394_chardevs[blocknum].module;
-	*file_ops = ieee1394_chardevs[blocknum].file_ops;
-
-	if (*file_ops == NULL)
-		goto out;
-
-	if (!try_module_get(*module))
-		goto out;
-
-	/* success! */
-	ret = 1;
-
-out:
-	read_unlock(&ieee1394_chardevs_lock);
-	return ret;
-}
-
-/* the point of entry for open() on any ieee1394 character device */
-static int ieee1394_dispatch_open(struct inode *inode, struct file *file)
-{
-	struct file_operations *file_ops;
-	struct module *module;
-	int blocknum;
-	int retval;
-
-	/*
-	  Maintaining correct module reference counts is tricky here!
-
-	  The key thing to remember is that the VFS increments the
-	  reference count of ieee1394 before it calls
-	  ieee1394_dispatch_open().
-
-	  If the open() succeeds, then we need to transfer this extra
-	  reference to the task-specific driver module (e.g. raw1394).
-	  The VFS will deref the driver module automatically when the
-	  file is later released.
-
-	  If the open() fails, then the VFS will drop the
-	  reference count of whatever module file->f_op->owner points
-	  to, immediately after this function returns.
-	*/
-
-        /* shift away lower four bits of the minor
-	   to get the index of the ieee1394_driver
-	   we want */
-
-	blocknum = (iminor(inode) >> 4) & 0xF;
-
-	/* look up the driver */
-
-	if (ieee1394_get_chardev(blocknum, &module, &file_ops) == 0)
-		return -ENODEV;
-
-	/* redirect all subsequent requests to the driver's
-	   own file_operations */
-	file->f_op = file_ops;
-
-	/* at this point BOTH ieee1394 and the task-specific driver have
-	   an extra reference */
-
-	/* follow through with the open() */
-	retval = file_ops->open(inode, file);
-
-	if (retval == 0) {
-		
-		/* If the open() succeeded, then ieee1394 will be left
-		 * with an extra module reference, so we discard it here.
-		 *
-		 * The task-specific driver still has the extra reference
-		 * given to it by ieee1394_get_chardev(). This extra
-		 * reference prevents the module from unloading while the
-		 * file is open, and will be dropped by the VFS when the
-		 * file is released. */
-
-		module_put(THIS_MODULE);
-	} else {
-		/* point the file's f_ops back to ieee1394. The VFS will then
-		   decrement ieee1394's reference count immediately after this
-		   function returns. */
-		
-		file->f_op = &ieee1394_chardev_ops;
-
-		/* If the open() failed, then we need to drop the extra
-		 * reference we gave to the task-specific driver. */
-
-		module_put(module);
-	}
-
-	return retval;
-}
-
 static int __init ieee1394_init(void)
 {
 	devfs_mk_dir("ieee1394");
-	if (register_chrdev(IEEE1394_MAJOR, "ieee1394", &ieee1394_chardev_ops)) {
+
+	if (register_chrdev_region(IEEE1394_CORE_DEV, 256, "ieee1394")) {
 		HPSB_ERR("unable to register character device major %d!\n", IEEE1394_MAJOR);
 		return -ENODEV;
 	}
@@ -1184,7 +1009,6 @@
 
 	bus_register(&ieee1394_bus_type);
 
-	init_hpsb_highlevel();
 	init_csr();
 
 	if (!disable_nodemgr)
@@ -1206,7 +1030,7 @@
 
 	kmem_cache_destroy(hpsb_packet_cache);
 
-	unregister_chrdev(IEEE1394_MAJOR, "ieee1394");
+	unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
 	devfs_remove("ieee1394");
 }
 
@@ -1234,8 +1058,6 @@
 EXPORT_SYMBOL(hpsb_selfid_complete);
 EXPORT_SYMBOL(hpsb_packet_sent);
 EXPORT_SYMBOL(hpsb_packet_received);
-EXPORT_SYMBOL(ieee1394_register_chardev);
-EXPORT_SYMBOL(ieee1394_unregister_chardev);
 
 /** ieee1394_transactions.c **/
 EXPORT_SYMBOL(hpsb_get_tlabel);
diff -Nru a/drivers/ieee1394/ieee1394_core.h b/drivers/ieee1394/ieee1394_core.h
--- a/drivers/ieee1394/ieee1394_core.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/ieee1394/ieee1394_core.h	Tue Feb  3 19:45:17 2004
@@ -176,9 +176,9 @@
  * task-specific interfaces (raw1394, video1394, dv1394, etc) in
  * blocks of 16.
  *
- * The core ieee1394.o modules handles the initial open() for all
- * character devices on major 171; it then dispatches to the
- * appropriate task-specific driver.
+ * The core ieee1394.o module allocates the device number region
+ * 171:0-255, the various drivers must then cdev_add() their cdev
+ * objects to handle their respective sub-regions.
  *
  * Minor device number block allocations:
  *
@@ -199,29 +199,19 @@
 #define IEEE1394_MINOR_BLOCK_AMDTP         3
 #define IEEE1394_MINOR_BLOCK_EXPERIMENTAL 15
 
+#define IEEE1394_CORE_DEV		MKDEV(IEEE1394_MAJOR, 0)
+#define IEEE1394_RAW1394_DEV		MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16)
+#define IEEE1394_VIDEO1394_DEV		MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_VIDEO1394 * 16)
+#define IEEE1394_DV1394_DEV		MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16)
+#define IEEE1394_AMDTP_DEV		MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_AMDTP * 16)
+#define IEEE1394_EXPERIMENTAL_DEV	MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_EXPERIMENTAL * 16)
+
 /* return the index (within a minor number block) of a file */
 static inline unsigned char ieee1394_file_to_instance(struct file *file)
 {
-	unsigned char minor = iminor(file->f_dentry->d_inode);
-	
-	/* return lower 4 bits */
-	return minor & 0xF;
+	return file->f_dentry->d_inode->i_cindex;
 }
 
-/* 
- * Task-specific drivers should call ieee1394_register_chardev() to
- * request a block of 16 minor numbers.
- *
- * Returns 0 if the request was successful, -EBUSY if the block was
- * already taken.
- */
-
-int  ieee1394_register_chardev(int blocknum,           /* 0-15 */
-			       struct module *module,  /* THIS_MODULE */
-			       struct file_operations *file_ops);
-
-/* release a block of minor numbers */
-void ieee1394_unregister_chardev(int blocknum);
 
 /* Our sysfs bus entry */
 extern struct bus_type ieee1394_bus_type;
diff -Nru a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c
--- a/drivers/ieee1394/ohci1394.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/ieee1394/ohci1394.c	Tue Feb  3 19:45:41 2004
@@ -161,7 +161,7 @@
 printk(level "%s: fw-host%d: " fmt "\n" , OHCI1394_DRIVER_NAME, card , ## args)
 
 static char version[] __devinitdata =
-	"$Rev: 1087 $ Ben Collins <bcollins@debian.org>";
+	"$Rev: 1097 $ Ben Collins <bcollins@debian.org>";
 
 /* Module Parameters */
 static int phys_dma = 1;
@@ -174,6 +174,7 @@
 static int alloc_dma_rcv_ctx(struct ti_ohci *ohci, struct dma_rcv_ctx *d,
 			     enum context_type type, int ctx, int num_desc,
 			     int buf_size, int split_buf_size, int context_base);
+static void stop_dma_rcv_ctx(struct dma_rcv_ctx *d);
 static void free_dma_rcv_ctx(struct dma_rcv_ctx *d);
 
 static int alloc_dma_trm_ctx(struct ti_ohci *ohci, struct dma_trm_ctx *d,
@@ -358,7 +359,7 @@
 	reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_softReset);
   
 	for (i = 0; i < OHCI_LOOP_COUNT; i++) {
-		if (!reg_read(ohci, OHCI1394_HCControlSet) & OHCI1394_HCControl_softReset)
+		if (!(reg_read(ohci, OHCI1394_HCControlSet) & OHCI1394_HCControl_softReset))
 			break;
 		mdelay(1);
 	}
@@ -1077,6 +1078,7 @@
                 DBGMSG(ohci->id, "Listening disabled on channel %d", arg);
 
 		if (ohci->ir_legacy_channels == 0) {
+			stop_dma_rcv_ctx(&ohci->ir_legacy_context);
 			free_dma_rcv_ctx(&ohci->ir_legacy_context);
 			DBGMSG(ohci->id, "ISO receive legacy context deactivated");
 		}
@@ -2249,6 +2251,14 @@
 	if (!event)
 		return IRQ_NONE;
 
+	/* If event is ~(u32)0 cardbus card was ejected.  In this case
+	 * we just return, and clean up in the ohci1394_pci_remove
+	 * function. */
+	if (event == ~(u32) 0) {
+		DBGMSG(ohci->id, "Device removed.");
+		return IRQ_NONE;
+	}
+
 	DBGMSG(ohci->id, "IntEvent: %08x", event);
 
 	if (event & OHCI1394_unrecoverableError) {
@@ -2811,15 +2821,8 @@
 	spin_unlock_irqrestore(&d->lock, flags);
 }
 
-static void free_dma_rcv_ctx(struct dma_rcv_ctx *d)
+static void stop_dma_rcv_ctx(struct dma_rcv_ctx *d)
 {
-	int i;
-
-	if (d->ohci == NULL)
-		return;
-
-	DBGMSG(d->ohci->id, "Freeing dma_rcv_ctx %d", d->ctx);
-
 	if (d->ctrlClear) {
 		ohci1394_stop_context(d->ohci, d->ctrlClear, NULL);
 
@@ -2831,6 +2834,17 @@
 			tasklet_kill(&d->task);
 		}
 	}
+}
+
+
+static void free_dma_rcv_ctx(struct dma_rcv_ctx *d)
+{
+	int i;
+
+	if (d->ohci == NULL)
+		return;
+
+	DBGMSG(d->ohci->id, "Freeing dma_rcv_ctx %d", d->ctx);
 
 	if (d->buf_cpu) {
 		for (i=0; i<d->num_desc; i++)
@@ -2982,19 +2996,6 @@
 
 	DBGMSG(d->ohci->id, "Freeing dma_trm_ctx %d", d->ctx);
 
-	if (d->ctrlClear) {
-		ohci1394_stop_context(d->ohci, d->ctrlClear, NULL);
-
-		if (d->type == DMA_CTX_ISO) {
-			/* disable interrupts */
-			reg_write(d->ohci, OHCI1394_IsoXmitIntMaskClear, 1 << d->ctx);
-			ohci1394_unregister_iso_tasklet(d->ohci,
-							&d->ohci->it_legacy_tasklet);
-		} else {
-			tasklet_kill(&d->task);
-		}
-	}
-
 	if (d->prg_cpu) {
 		for (i=0; i<d->num_desc; i++) 
 			if (d->prg_cpu[i] && d->prg_bus[i]) {
@@ -3511,6 +3512,8 @@
 		free_irq(ohci->dev->irq, ohci);
 
 	case OHCI_INIT_HAVE_TXRX_BUFFERS__MAYBE:
+		/* The ohci_soft_reset() stops all DMA contexts, so we
+		 * dont need to do this.  */
 		/* Free AR dma */
 		free_dma_rcv_ctx(&ohci->ar_req_context);
 		free_dma_rcv_ctx(&ohci->ar_resp_context);
diff -Nru a/drivers/ieee1394/oui.db b/drivers/ieee1394/oui.db
--- a/drivers/ieee1394/oui.db	Tue Feb  3 19:45:17 2004
+++ b/drivers/ieee1394/oui.db	Tue Feb  3 19:45:17 2004
@@ -108,7 +108,7 @@
 00006B SILICON GRAPHICS INC./MIPS
 00006D CRAY COMMUNICATIONS, LTD.
 00006E ARTISOFT, INC.
-00006F MADGE NETWORKS LTD.
+00006F Madge Ltd.
 000070 HCL LIMITED
 000071 ADRA SYSTEMS INC.
 000072 MINIWARE TECHNOLOGY
@@ -137,7 +137,7 @@
 000089 CAYMAN SYSTEMS INC.
 00008A DATAHOUSE INFORMATION SYSTEMS
 00008B INFOTRON
-00008C ALLOY COMPUTER PRODUCTS, INC.
+00008C Alloy Computer Products (Australia) Pty Ltd
 00008D VERDIX CORPORATION
 00008E SOLBOURNE COMPUTER, INC.
 00008F RAYTHEON COMPANY
@@ -190,7 +190,7 @@
 0000BE THE NTI GROUP
 0000BF SYMMETRIC COMPUTER SYSTEMS
 0000C0 WESTERN DIGITAL CORPORATION
-0000C1 Madge Networks Ltd.
+0000C1 Madge Ltd.
 0000C2 INFORMATION PRESENTATION TECH.
 0000C3 HARRIS CORP COMPUTER SYS DIV
 0000C4 WATERS DIV. OF MILLIPORE
@@ -202,7 +202,7 @@
 0000CA APPLITEK
 0000CB COMPU-SHACK ELECTRONIC GMBH
 0000CC DENSAN CO., LTD.
-0000CD Centrecom Systems, Ltd.
+0000CD Allied Telesyn Research Ltd.
 0000CE MEGADATA CORP.
 0000CF HAYES MICROCOMPUTER PRODUCTS
 0000D0 DEVELCON ELECTRONICS LTD.
@@ -271,7 +271,7 @@
 000110 Gotham Networks
 000111 iDigm Inc.
 000112 Shark Multimedia Inc.
-000113 OLYMPUS OPTICAL CO., LTD.
+000113 OLYMPUS CORPORATION
 000114 KANDA TSUSHIN KOGYO CO., LTD.
 000115 EXTRATECH CORPORATION
 000116 Netspect Technologies, Inc.
@@ -345,7 +345,7 @@
 00015A Digital Video Broadcasting
 00015B ITALTEL S.p.A/RF-UP-I
 00015C CADANT INC.
-00015D Pirus Networks
+00015D Sun Microsystems, Inc
 00015E BEST TECHNOLOGY CO., LTD.
 00015F DIGITAL DESIGN GmbH
 000160 ELMEX Co., LTD.
@@ -361,7 +361,7 @@
 00016A ALITEC
 00016B LightChip, Inc.
 00016C FOXCONN
-00016D Triton Network Systems
+00016D CarrierComm Inc.
 00016E Conklin Corporation
 00016F HAITAI ELECTRONICS CO., LTD.
 000170 ESE Embedded System Engineer'g
@@ -445,7 +445,7 @@
 0001BE Gigalink Co., Ltd.
 0001BF Teleforce Co., Ltd.
 0001C0 CompuLab, Ltd.
-0001C1 Exbit Technology
+0001C1 Vitesse Semiconductor Corporation
 0001C2 ARK Research Corp.
 0001C3 Acromag, Inc.
 0001C4 NeoWave, Inc.
@@ -495,6 +495,7 @@
 0001EF Camtel Technology Corp.
 0001F0 Tridium, Inc.
 0001F1 Innovative Concepts, Inc.
+0001F2 Mark of the Unicorn, Inc.
 0001F3 QPS, Inc.
 0001F4 Enterasys Networks
 0001F5 ERIM S.A.
@@ -515,6 +516,7 @@
 000204 Bodmann Industries Elektronik GmbH
 000205 Hitachi Denshi, Ltd.
 000206 Telital R&D Denmark A/S
+000207 VisionGlobal Network Corp.
 000208 Unify Networks, Inc.
 000209 Shenzhen SED Information Technology Co., Ltd.
 00020A Gefran Spa
@@ -579,7 +581,7 @@
 000245 Lampus Co, Ltd.
 000246 All-Win Tech Co., Ltd.
 000247 Great Dragon Information Technology (Group) Co., Ltd.
-000248 Pila GmbH & Co.
+000248 Pilz GmbH & Co.
 000249 Aviv Infocom Co, Ltd.
 00024A Cisco Systems, Inc.
 00024B Cisco Systems, Inc.
@@ -600,6 +602,7 @@
 00025A Catena Networks
 00025B Cambridge Silicon Radio
 00025C SCI Systems (Kunshan) Co., Ltd.
+00025D Calix Networks
 00025E High Technology Ltd
 00025F Nortel Networks
 000260 Accordion Networks, Inc.
@@ -635,7 +638,7 @@
 00027E Cisco Systems, Inc.
 00027F ask-technologies.com
 000280 Mu Net, Inc.
-000281 Red-M (Communications) Ltd.
+000281 Madge Ltd.
 000282 ViaClix, Inc.
 000283 Spectrum Controls, Inc.
 000284 Alstom T&D P&C
@@ -662,6 +665,7 @@
 000299 Apex, Inc.
 00029A Storage Apps
 00029B Kreatel Communications AB
+00029C 3COM
 00029D Merix Corp.
 00029E Information Equipment Co., Ltd.
 00029F L-3 Communication Aviation Recorders
@@ -678,7 +682,7 @@
 0002AA PLcom Co., Ltd.
 0002AB CTC Union Technologies Co., Ltd.
 0002AC 3PAR data
-0002AD Asahi Optical Co., Ltd.
+0002AD Pentax Corpotation
 0002AE Scannex Electronics Ltd.
 0002AF TeleCruz Technology, Inc.
 0002B0 Hokubu Communication & Industrial Co., Ltd.
@@ -740,7 +744,7 @@
 0002E8 E.D.&A.
 0002E9 CS Systemes De Securite - C3S
 0002EA Videonics, Inc.
-0002EB Easent Communications
+0002EB Pico Communications
 0002EC Maschoff Design Engineering
 0002ED DXO Telecom Co., Ltd.
 0002EE Nokia Danmark A/S
@@ -760,7 +764,7 @@
 0002FC Cisco Systems, Inc.
 0002FD Cisco Systems, Inc.
 0002FE Viditec, Inc.
-0002FF Handan Broad InfoCom
+0002FF Handan BroadInfoCom
 000300 NetContinuum, Inc.
 000301 Avantas Networks Corporation
 000302 Oasys Telecom, Inc.
@@ -776,7 +780,7 @@
 00030C Telesoft Technologies Ltd.
 00030D Uniwill Computer Corp.
 00030E Core Communications Co., Ltd.
-00030F Legend Digital China Ltd.
+00030F Digital China (Shanghai) Networks Ltd.
 000310 Link Evolution Corp.
 000311 Micro Technology Co., Ltd.
 000312 TR-Systemtechnik GmbH
@@ -797,7 +801,7 @@
 000321 Reco Research Co., Ltd.
 000322 IDIS Co., Ltd.
 000323 Cornet Technology, Inc.
-000324 Tottori SANYO Electric Co., Ltd.
+000324 SANYO Multimedia Tottori Co., Ltd.
 000325 Arima Computer Corp.
 000326 Iwasaki Information Systems Co., Ltd.
 000327 ACT'L
@@ -851,12 +855,12 @@
 000357 Intervoice-Brite, Inc.
 000358 iCable System Co., Ltd.
 000359 DigitalSis
-00035A Phototron Limited
+00035A Photron Limited
 00035B BridgeWave Communications
 00035C Saint Song Corp.
 00035D Bosung Hi-Net Co., Ltd.
 00035E Metropolitan Area Networks, Inc.
-00035F Schuehle Mess - und. Kontrollsysteme
+00035F Prueftechnik Condition Monitoring GmbH & Co. KG
 000360 PAC Interactive Technology, Inc.
 000361 Widcomm, Inc.
 000362 Vodtel Communications, Inc.
@@ -889,6 +893,7 @@
 00037D Stellcom
 00037E PORTech Communications, Inc.
 00037F Atheros Communications, Inc.
+000380 SSH Communications Security Corp.
 000381 Ingenico International
 000382 A-One Co., Ltd.
 000383 Metera Networks, Inc.
@@ -916,7 +921,7 @@
 00039A nSine, Ltd.
 00039B NetChip Technology, Inc.
 00039C OptiMight Communications, Inc.
-00039D Acer Communications & Multimedia, Inc.
+00039D BENQ CORPORATION
 00039E Tera System Co., Ltd.
 00039F Cisco Systems, Inc.
 0003A0 Cisco Systems, Inc.
@@ -1063,7 +1068,7 @@
 00042E Netous Technologies, Ltd.
 00042F International Communications Products, Inc.
 000430 Netgem
-000431 Play Industries
+000431 GlobalStreams, Inc.
 000432 Voyetra Turtle Beach, Inc.
 000433 Cyberboard A/S
 000434 Accelent Systems, Inc.
@@ -1082,7 +1087,7 @@
 000441 Half Dome Systems, Inc.
 000442 NACT
 000443 Agilent Technologies, Inc.
-000444 Wireless Home
+000444 Western Multiplex Corporation
 000445 LMS Skalar Instruments GmbH
 000446 CYZENTECH Co., Ltd.
 000447 Acrowave Systems Co., Ltd.
@@ -1097,7 +1102,7 @@
 000450 DMD Computers SRL
 000451 Medrad, Inc.
 000452 RocketLogix, Inc.
-000453 Yotta Yotta, Inc.
+000453 YottaYotta, Inc.
 000454 Quadriga UK
 000455 ANTARA.net
 000456 PipingHot Networks
@@ -1108,16 +1113,16 @@
 00045B Techsan Electronics Co., Ltd.
 00045C Mobiwave Pte Ltd
 00045D BEKA Elektronik
-00045E Poly Trax Information Technology AG
+00045E PolyTrax Information Technology AG
 00045F Evalue Technology, Inc.
 000460 Knilink Technology, Inc.
 000461 EPOX Computer Co., Ltd.
 000462 DAKOS Data & Communication Co., Ltd.
-000463 Philips Communication Security & Imaging
+000463 Bosch Security Systems
 000464 Fantasma Networks, Inc.
-000465 ist isdn support tecknik GmbH
+000465 i.s.t isdn-support technik GmbH
 000466 ARMITEL Co.
-000467 Wuhan Research Institute
+000467 Wuhan Research Institute of MII
 000468 Vivity, Inc.
 000469 Innocom, Inc.
 00046A Navini Networks
@@ -1133,7 +1138,7 @@
 000474 LEGRAND
 000475 3 Com Corporation
 000476 3 Com Corporation
-000477 e-Appliance Corp.
+000477 Scalant Systems, Inc.
 000478 G. Star Technology Corporation
 000479 Radius Co., Ltd.
 00047A AXXESSIT ASA
@@ -1144,7 +1149,7 @@
 00047F Chr. Mayr GmbH & Co. KG
 000480 Foundry Networks, Inc.
 000481 Econolite Control Products, Inc.
-000482 MediaLogic Corp.
+000482 Medialogic Corp.
 000483 Deltron Technology, Inc.
 000484 Amann GmbH
 000485 PicoLight
@@ -1195,7 +1200,7 @@
 0004B3 Videotek, Inc.
 0004B4 CIAC
 0004B5 Equitrac Corporation
-0004B6 Tellumat (Pty) Ltd.
+0004B6 Stratex Networks, Inc.
 0004B7 AMB i.t. Holding
 0004B8 Kumahira Co., Ltd.
 0004B9 S.I. Soubou, Inc.
@@ -1204,20 +1209,20 @@
 0004BC Giantec, Inc.
 0004BD Motorola BCS
 0004BE OptXCon, Inc.
-0004BF Versa Logic Corp.
+0004BF VersaLogic Corp.
 0004C0 Cisco Systems, Inc.
 0004C1 Cisco Systems, Inc.
 0004C2 Magnipix, Inc.
 0004C3 CASTOR Informatique
-0004C4 Allen & Health
+0004C4 Allen & Heath Limited
 0004C5 ASE Technologies, USA
 0004C6 Yamaha Motor Co., Ltd.
 0004C7 NetMount
-0004C8 LIBA Maschinefabrik GmbH
+0004C8 LIBA Maschinenfabrik GmbH
 0004C9 Micro Electron Co., Ltd.
 0004CA FreeMs Corp.
 0004CB Tdsoft Communication, Ltd.
-0004CC Peek Traffic BV.
+0004CC Peek Traffic B.V.
 0004CD Informedia Research Group
 0004CE Patria Ailon
 0004CF Seagate Technology
@@ -1286,7 +1291,7 @@
 00050E 3ware, Inc.
 00050F Tanaka S/S Ltd.
 000510 Infinite Shanghai Communication Terminals Ltd.
-000511 Complementaty Technologies Ltd
+000511 Complementary Technologies Ltd
 000512 MeshNetworks, Inc.
 000513 VTLinx Multimedia Systems, Inc.
 000514 KDT Systems Co., Ltd.
@@ -1299,7 +1304,7 @@
 00051B Magic Control Technology Corporation
 00051C Xnet Technology Corp.
 00051D Airocon, Inc.
-00051E Rhapsody Networks
+00051E Brocade Communications Systems, Inc.
 00051F Taijin Media Co., Ltd.
 000520 Smartronix, Inc.
 000521 Control Microsystems
@@ -1339,7 +1344,7 @@
 000543 IQ Wireless GmbH
 000544 Valley Technologies, Inc.
 000545 Internet Photonics
-000546 KDD Network Systems Co., Ltd.
+000546 K-Solutions Inc.
 000547 Starent Networks
 000548 Disco Corporation
 000549 Salira Optical Network Systems
@@ -1374,6 +1379,7 @@
 000567 Etymonic Design, Inc.
 000568 Piltofish Networks AB
 000569 VMWARE, Inc.
+00056A Heuft Systemtechnik GmbH
 00056B C.P. Technology Co., Ltd.
 00056C Hung Chang Co., Ltd.
 00056D Pacific Corporation
@@ -1408,18 +1414,18 @@
 00058B IPmental, Inc.
 00058C Opentech Inc.
 00058D Lynx Photonic Networks, Inc.
-00058E Ahead Communications System GmbH
+00058E Flextronics International GmbH & Co. Nfg. KG
 00058F CLCsoft co.
-000590 Ascom Business Systems
+000590 Swissvoice Ltd.
 000591 Active Silicon Ltd.
-000592 Pultex Corp.
+000592 Pultek Corp.
 000593 Grammar Engine Inc.
 000594 IXXAT Automation GmbH
 000595 Alesis Corporation
 000596 Genotech Co., Ltd.
 000597 Eagle Traffic Control Systems
 000598 CRONOS S.r.l.
-000599 PEI Electronics, Inc.
+000599 DRS Test and Energy Management or DRS-TEM
 00059A Cisco Systems, Inc.
 00059B Cisco Systems, Inc.
 00059C Kleinknecht GmbH, Ing. Buero
@@ -1436,7 +1442,7 @@
 0005A7 Hyperchip, Inc.
 0005A8 WYLE ELECTRONICS
 0005A9 Princeton Networks, Inc.
-0005AA Moore Industries Int.
+0005AA Moore Industries International Inc.
 0005AB Cyber Fone, Inc.
 0005AC Northern Digital, Inc.
 0005AD Topspin Communications, Inc.
@@ -1453,13 +1459,14 @@
 0005B8 Electronic Design Associates, Inc.
 0005B9 Airvana, Inc.
 0005BA Area Netwoeks, Inc.
+0005BB Myspace AB
 0005BC Resorsys Ltd.
 0005BD ROAX BV
 0005BE Kongsberg Seatex AS
 0005BF JustEzy Technology, Inc.
 0005C0 Digital Network Alacarte Co., Ltd.
 0005C1 A-Kyung Motion, Inc.
-0005C2 Digital Archway, Inc.
+0005C2 Soronti, Inc.
 0005C3 Pacific Instruments, Inc.
 0005C4 Telect, Inc.
 0005C5 Flaga HF
@@ -1470,13 +1477,13 @@
 0005CA Hitron Technology, Inc.
 0005CB ROIS Technologies, Inc.
 0005CC Sumtel Communications, Inc.
-0005CD Nippon Columbia
+0005CD Denon, Ltd.
 0005CE Prolink Microsystems Corporation
 0005CF Thunder River Technologies, Inc.
 0005D0 Solinet Systems
 0005D1 Metavector Technologies
 0005D2 DAP Technologies
-0005D3 CAC, Inc.
+0005D3 eProduction Solutions, Inc.
 0005D4 FutureSmart Networks, Inc.
 0005D5 Speedcom Wireless
 0005D6 Titan Wireless
@@ -1496,27 +1503,27 @@
 0005E4 Red Lion Controls L.P.
 0005E5 Renishaw PLC
 0005E6 Egenera, Inc.
-0005E7 Netrake
+0005E7 Netrake Corp.
 0005E8 TurboWave, Inc.
-0005E9 Unicess Networks, Inc.
-0005EA Viewcast Corporation
+0005E9 Unicess Network, Inc.
+0005EA Rednix
 0005EB Blue Ridge Networks, Inc.
 0005EC Mosaic Systems Inc.
-0005ED Technikum Joanneaum GmbH
+0005ED Technikum Joanneum GmbH
 0005EE BEWATOR Group
 0005EF ADOIR Digital Technology
 0005F0 SATEC
-0005F1 VRcom, Inc.
+0005F1 Vrcom, Inc.
 0005F2 Power R, Inc.
 0005F3 Weboyn
-0005F4 SystemBase Co., Ltd.
+0005F4 System Base Co., Ltd.
 0005F5 OYO Geospace Corp.
 0005F6 Young Chang Co. Ltd.
 0005F7 Analog Devices, Inc.
 0005F8 Real Time Access, Inc.
-0005F9 Diva Systems
+0005F9 TOA Corporation
 0005FA IPOptical, Inc.
-0005FB Sharegate
+0005FB ShareGate, Inc.
 0005FC Schenck Pegasus Corp.
 0005FD PacketLight Networks Ltd.
 0005FE Traficon N.V.
@@ -1524,23 +1531,23 @@
 000600 Tokyo Electronic Industry Co., Ltd.
 000601 Otanikeiki Co., Ltd.
 000602 Cirkitech Electronics Co.
-000603 Baker Hughes
+000603 Baker Hughes Inc.
 000604 @Track Communications, Inc.
 000605 Inncom International, Inc.
-000606 RapidWan, Inc.
-000607 Omni-Directional Control Technology Inc.
+000606 RapidWAN, Inc.
+000607 Omni Directional Control Technology Inc.
 000608 At-Sky SAS
 000609 Crossport Systems
-00060A Blue2space.com
+00060A Blue2space
 00060B Paceline Systems Corporation
 00060C Melco Industries, Inc.
 00060D Wave7 Optics
-00060E IGSYS Systems, Inc.
+00060E IGYS Systems, Inc.
 00060F Narad Networks Inc
 000610 Abeona Networks Inc
 000611 Zeus Wireless, Inc.
 000612 Accusys, Inc.
-000613 Kawasaki Steel Corporation
+000613 Kawasaki Microelectronics Incorporated
 000614 Prism Holdings
 000615 Kimoto Electric Co., Ltd.
 000616 Tel Net Co., Ltd.
@@ -1557,7 +1564,7 @@
 000621 Hinox, Co., Ltd.
 000622 Chung Fu Chen Yeh Enterprise Corp.
 000623 MGE UPS Systems France
-000624 Gentner Communications
+000624 Gentner Communications Corp.
 000625 The Linksys Group, Inc.
 000626 MWE GmbH
 000627 Uniwide Technologies, Inc.
@@ -1580,7 +1587,7 @@
 000638 Sungjin C&C Co., Ltd.
 000639 Newtec
 00063A Dura Micro, Inc.
-00063B Lineo Canada Corp.
+00063B Arcturus Networks, Inc.
 00063C NMI Electronics Ltd
 00063D Microwave Data Systems Inc.
 00063E Opthos Inc.
@@ -1622,7 +1629,7 @@
 000662 MBM Technology Ltd.
 000663 Human Technology Co., Ltd.
 000664 Fostex Corporation
-000665 Summy Gikem, Inc.
+000665 Sunny Giken, Inc.
 000666 Roving Networks
 000667 Tripp Lite
 000668 Vicon Industries Inc.
@@ -1639,7 +1646,7 @@
 000673 Optelecom, Inc.
 000674 Spectrum Control, Inc.
 000675 Banderacom, Inc.
-000676 Novra Technologies, Inc.
+000676 Novra Technologies Inc.
 000677 SICK AG
 000678 Marantz Japan, Inc.
 000679 Konami Corporation
@@ -1647,18 +1654,2125 @@
 00067B Toplink C&C Corporation
 00067C CISCO SYSTEMS, INC.
 00067D Takasago Ltd.
+00067E WinCom Systems, Inc.
+00067F Rearden Steel Technologies
+000680 Card Access, Inc.
+000681 Goepel Electronic GmbH
+000682 Convedia
+000683 Bravara Communications, Inc.
+000684 Biacore AB
+000685 NetNearU Corporation
+000686 ZARDCOM Co., Ltd.
+000687 Omnitron Systems Technology, Inc.
+000688 Telways Communication Co., Ltd.
+000689 yLez Technologies Pte Ltd
+00068A NeuronNet Co. Ltd. R&D Center
+00068B AirRunner Technologies, Inc.
+00068C 3Com Corporation
+00068D SANgate Systems
+00068E HID Corporation
+00068F Telemonitor, Inc.
+000690 Euracom Communication GmbH
+000691 PT Inovacao
+000692 Intruvert Networks, Inc.
+000693 Flexus Computer Technology, Inc.
+000694 Mobillian Corporation
+000695 Ensure Technologies, Inc.
+000696 Advent Networks
+000697 R & D Center
+000698 egnite Software GmbH
+000699 Vida Design Co.
+00069A e & Tel
+00069B AVT Audio Video Technologies GmbH
+00069C Transmode Systems AB
+00069D Petards Mobile Intelligence
+00069E UNIQA, Inc.
+00069F Kuokoa Networks
+0006A0 Mx Imaging
+0006A1 Celsian Technologies, Inc.
+0006A2 Microtune, Inc.
+0006A3 Bitran Corporation
+0006A4 INNOWELL Corp.
+0006A5 PINON Corp.
+0006A6 Artistic Licence (UK) Ltd
+0006A7 Primarion
+0006A8 KC Technology, Inc.
+0006A9 Universal Instruments Corp.
+0006AA Miltope Corporation
+0006AB W-Link Systems, Inc.
+0006AC Intersoft Co.
+0006AD KB Electronics Ltd.
+0006AE Himachal Futuristic Communications Ltd
+0006B0 Comtech EF Data Corp.
+0006B1 Sonicwall
+0006B2 Linxtek Co.
+0006B3 Diagraph Corporation
+0006B4 Vorne Industries, Inc.
+0006B5 Luminent, Inc.
+0006B6 Nir-Or Israel Ltd.
+0006B7 TELEM GmbH
+0006B8 Bandspeed Pty Ltd
+0006B9 A5TEK Corp.
+0006BA Westwave Communications
+0006BB ATI Technologies Inc.
+0006BC Macrolink, Inc.
+0006BD BNTECHNOLOGY Co., Ltd.
+0006BE Baumer Optronic GmbH
+0006BF Accella Technologies Co., Ltd.
+0006C0 United Internetworks, Inc.
 0006C1 CISCO SYSTEMS, INC.
+0006C2 Smartmatic Corporation
+0006C3 Schindler Elevators Ltd.
+0006C4 Piolink Inc.
+0006C5 INNOVI Technologies Limited
+0006C6 lesswire AG
+0006C7 RFNET Technologies Pte Ltd (S)
+0006C8 Sumitomo Metal Micro Devices, Inc.
+0006C9 Technical Marketing Research, Inc.
+0006CA American Computer & Digital Components, Inc. (ACDC)
+0006CB Jotron Electronics A/S
+0006CC JMI Electronics Co., Ltd.
+0006CD CreoScitex Corporation Ltd.
+0006CE DATENO
+0006CF Thales Avionics In-Flight Systems, LLC
+0006D0 Elgar Electronics Corp.
+0006D1 Tahoe Networks, Inc.
+0006D2 Tundra Semiconductor Corp.
+0006D3 Alpha Telecom, Inc. U.S.A.
+0006D4 Interactive Objects, Inc.
+0006D5 Diamond Systems Corp.
+0006D6 Cisco Systems, Inc.
+0006D7 Cisco Systems, Inc.
+0006D8 Maple Optical Systems
+0006D9 IPM-Net S.p.A.
+0006DA ITRAN Communications Ltd.
+0006DB ICHIPS Co., Ltd.
+0006DC Syabas Technology (Amquest)
+0006DD AT & T Laboratories - Cambridge Ltd
+0006DE Flash Technology
+0006DF AIDONIC Corporation
+0006E0 MAT Co., Ltd.
+0006E1 Techno Trade s.a
+0006E2 Ceemax Technology Co., Ltd.
+0006E3 Quantitative Imaging Corporation
+0006E4 Citel Technologies Ltd.
+0006E5 Fujian Newland Computer Ltd. Co.
+0006E6 DongYang Telecom Co., Ltd.
+0006E7 Bit Blitz Communications Inc.
+0006E8 Optical Network Testing, Inc.
+0006E9 Intime Corp.
+0006EA ELZET80 Mikrocomputer GmbH&Co. KG
+0006EB Global Data
+0006EC M/A COM Private Radio System Inc.
+0006ED Inara Networks
+0006EE Shenyang Neu-era Information & Technology Stock Co., Ltd
+0006EF Maxxan Systems, Inc.
+0006F0 Digeo, Inc.
+0006F1 Optillion
+0006F2 Platys Communications
+0006F3 AcceLight Networks
+0006F4 Prime Electronics & Satellitics Inc.
+0006F9 Mitsui Zosen Systems Research Inc.
+0006FA IP SQUARE Co, Ltd.
+0006FB Hitachi Printing Solutions, Ltd.
+0006FC Fnet Co., Ltd.
+0006FD Comjet Information Systems Corp.
+0006FE Celion Networks, Inc.
+0006FF Sheba Systems Co., Ltd.
+000700 Zettamedia Korea
 000701 RACAL-DATACOM
+000702 Varian Medical Systems
+000703 CSEE Transport
+000705 Endress & Hauser GmbH & Co
+000706 Sanritz Corporation
+000707 Interalia Inc.
+000708 Bitrage Inc.
+000709 Westerstrand Urfabrik AB
+00070A Unicom Automation Co., Ltd.
+00070B Octal, SA
+00070C SVA-Intrusion.com Co. Ltd.
+00070D Cisco Systems Inc.
+00070E Cisco Systems Inc.
+00070F Fujant, Inc.
+000710 Adax, Inc.
+000711 Acterna
+000712 JAL Information Technology
+000713 IP One, Inc.
+000714 Brightcom
+000715 General Research of Electronics, Inc.
+000716 J & S Marine Ltd.
+000717 Wieland Electric GmbH
+000718 iCanTek Co., Ltd.
+000719 Mobiis Co., Ltd.
+00071A Finedigital Inc.
+00071B Position Technology Inc.
+00071C AT&T Fixed Wireless Services
+00071D Satelsa Sistemas Y Aplicaciones De Telecomunicaciones, S.A.
+00071E Tri-M Engineering / Nupak Dev. Corp.
+00071F European Systems Integration
+000720 Trutzschler GmbH & Co. KG
+000721 Formac Elektronik GmbH
+000722 Nielsen Media Research
+000723 ELCON Systemtechnik GmbH
+000724 Telemax Co., Ltd.
+000725 Bematech International Corp.
+000727 Zi Corporation (HK) Ltd.
+000728 Neo Telecom
+000729 Kistler Instrumente AG
+00072A Innovance Networks
+00072B Jung Myung Telecom Co., Ltd.
+00072C Fabricom
+00072D CNSystems
+00072E North Node AB
+00072F Instransa, Inc.
+000730 Hutchison OPTEL Telecom Technology Co., Ltd.
+000731 Spiricon, Inc.
+000732 AAEON Technology Inc.
+000733 DANCONTROL Engineering
+000734 ONStor, Inc.
+000735 Flarion Technologies, Inc.
+000736 Data Video Technologies Co., Ltd.
+000737 Soriya Co. Ltd.
+000738 Young Technology Co., Ltd.
+000739 Motion Media Technology Ltd.
+00073A Inventel Systemes
+00073B Tenovis GmbH & Co KG
+00073C Telecom Design
+00073D Nanjing Postel Telecommunications Co., Ltd.
+00073E China Great-Wall Computer Shenzhen Co., Ltd.
+00073F Woojyun Systec Co., Ltd.
+000740 Melco Inc.
+000741 Sierra Automated Systems
+000742 Current Technologies
+000743 Chelsio Communications
+000744 Unico, Inc.
+000745 Radlan Computer Communications Ltd.
+000746 Interlink BT, LLC
+000747 Mecalc
+000748 The Imaging Source Europe
+000749 CENiX Inc.
+00074A Carl Valentin GmbH
+00074B Daihen Corporation
+00074C Beicom Inc.
+00074D Zebra Technologies Corp.
+00074E Naughty boy co., Ltd.
+00074F Cisco Systems, Inc.
+000750 Cisco Systems, Inc.
+000751 m.u.t. - GmbH
+000752 Rhythm Watch Co., Ltd.
+000753 Beijing Qxcomm Technology Co., Ltd.
+000754 Xyterra Computing, Inc.
+000755 Lafon SA
+000756 Juyoung Telecom
+000757 Topcall International AG
+000758 Dragonwave
+000759 Boris Manufacturing Corp.
+00075A Air Products and Chemicals, Inc.
+00075B Gibson Guitars
+00075C ENCAD, Inc.
+00075D Celleritas Inc.
+00075E Pulsar Technologies, Inc.
+00075F VCS Video Communication Systems AG
+000760 TOMIS Information & Telecom Corp.
+000761 Logitech SA
+000762 Group Sense Limited
+000763 Sunniwell Cyber Tech. Co., Ltd.
+000764 YoungWoo Telecom Co. Ltd.
+000765 Jade Quantum Technologies, Inc.
+000766 Chou Chin Industrial Co., Ltd.
+000767 Yuxing Electronics Company Limited
+000768 Danfoss A/S
+000769 Italiana Macchi SpA
+00076A NEXTEYE Co., Ltd.
+00076B Stralfors AB
+00076C Daehanet, Inc.
+00076D Flexlight Networks
+00076E Sinetica Corporation Ltd.
+00076F Synoptics Limited
+000770 Locusnetworks Corporation
+000771 Embedded System Corporation
+000772 Alcatel Shanghai Bell Co., Ltd.
+000773 Ascom Powerline Communications Ltd.
+000774 GuangZhou Thinker Technology Co. Ltd.
+000775 Valence Semiconductor, Inc.
+000776 Federal APD
+000777 Motah Ltd.
+000778 GERSTEL GmbH & Co. KG
+000779 Sungil Telecom Co., Ltd.
+00077A Infoware System Co., Ltd.
+00077B Millimetrix Broadband Networks
+00077C OnTime Networks
+00077E Elrest GmbH
+00077F J Communications Co., Ltd.
+000780 Bluegiga Technologies OY
+000781 Itron Inc.
+000782 Nauticus Networks, Inc.
+000783 SynCom Network, Inc.
+000784 Cisco Systems Inc.
+000785 Cisco Systems Inc.
+000786 Wireless Networks Inc.
+000787 Idea System Co., Ltd.
+000788 Clipcomm, Inc.
+000789 Eastel Systems Corporation
+00078A Mentor Data System Inc.
+00078B Wegener Communications, Inc.
+00078C Elektronikspecialisten i Borlange AB
+00078D NetEngines Ltd.
+00078E Garz & Friche GmbH
+00078F Emkay Innovative Products
+000790 Tri-M Technologies (s) Limited
+000791 International Data Communications, Inc.
+000792 Suetron Electronic GmbH
+000794 Simple Devices, Inc.
+000795 Elitegroup Computer System Co. (ECS)
+000796 LSI Systems, Inc.
+000797 Netpower Co., Ltd.
+000798 Selea SRL
+000799 Tipping Point Technologies, Inc.
+00079A SmartSight Networks Inc.
+00079B Aurora Networks
+00079C Golden Electronics Technology Co., Ltd.
+00079D Musashi Co., Ltd.
+00079E Ilinx Co., Ltd.
+00079F Action Digital Inc.
+0007A0 e-Watch Inc.
+0007A1 VIASYS Healthcare GmbH
+0007A2 Opteon Corporation
+0007A3 Ositis Software, Inc.
+0007A4 GN Netcom Ltd.
+0007A5 Y.D.K Co. Ltd.
+0007A6 Home Automation, Inc.
+0007A7 A-Z Inc.
+0007A8 Haier Group Technologies Ltd.
+0007A9 Novasonics
+0007AA Quantum Data Inc.
+0007AC Eolring
+0007AD Pentacon GmbH Foto-und Feinwerktechnik
+0007AE Layer N Networks
+0007AF N-Tron Corp.
+0007B0 Office Details, Inc.
+0007B1 Equator Technologies
+0007B2 Transaccess S.A.
+0007B3 Cisco Systems Inc.
+0007B4 Cisco Systems Inc.
+0007B5 Any One Wireless Ltd.
+0007B6 Telecom Technology Ltd.
+0007B7 Samurai Ind. Prods Eletronicos Ltda
+0007B8 American Predator Corp.
+0007B9 Ginganet Corporation
+0007BA Xebeo Communications, Inc.
+0007BB Candera Inc.
+0007BC Identix Inc.
+0007BD Radionet Ltd.
+0007BE DataLogic SpA
+0007BF Armillaire Technologies, Inc.
+0007C0 NetZerver Inc.
+0007C1 Overture Networks, Inc.
+0007C2 Netsys Telecom
+0007C3 Cirpack
+0007C4 JEAN Co. Ltd.
+0007C5 Gcom, Inc.
+0007C6 VDS Vosskuhler GmbH
+0007C7 Synectics Systems Limited
+0007C8 Brain21, Inc.
+0007C9 Technol Seven Co., Ltd.
+0007CA Creatix Polymedia Ges Fur Kommunikaitonssysteme
+0007CB Freebox SA
+0007CC Kaba Benzing GmbH
+0007CD NMTEL Co., Ltd.
+0007CE Cabletime Limited
+0007CF Anoto AB
+0007D0 Automat Engenharia de Automaoa Ltda.
+0007D1 Spectrum Signal Processing Inc.
+0007D2 Logopak Systeme
+0007D3 Stork Digital Imaging B.V.
+0007D4 Zhejiang Yutong Network Communication Co Ltd.
+0007D5 3e Technologies Int;., Inc.
+0007D6 Commil Ltd.
+0007D7 Caporis Networks AG
+0007D8 Hitron Systems Inc.
+0007D9 Splicecom
+0007DA Neuro Telecom Co., Ltd.
+0007DB Kirana Networks, Inc.
+0007DC Atek Co, Ltd.
+0007DD Cradle Technologies
+0007DE eCopilt AB
+0007DF Vbrick Systems Inc.
+0007E0 Palm Inc.
+0007E1 WIS Communications Co. Ltd.
+0007E2 Bitworks, Inc.
+0007E3 Navcom Technology, Inc.
+0007E4 SoftRadio Co., Ltd.
+0007E5 Coup Corporation
+0007E6 edgeflow Canada Inc.
+0007E7 FreeWave Technologies
+0007E8 St. Bernard Software
+0007E9 Intel Corporation
+0007EA Massana, Inc.
+0007EB Cisco Systems Inc.
+0007EC Cisco Systems Inc.
+0007ED Altera Corporation
+0007EE telco Informationssysteme GmbH
+0007EF Lockheed Martin Tactical Systems
+0007F0 LogiSync Corporation
+0007F1 TeraBurst Networks Inc.
+0007F2 IOA Corporation
+0007F3 Think Engine Networks
+0007F4 Eletex Co., Ltd.
+0007F5 Bridgeco Co AG
+0007F6 Qqest Software Systems
+0007F7 Galtronics
+0007F8 ITDevices, Inc.
+0007F9 Phonetics, Inc.
+0007FA ITT Co., Ltd.
+0007FB Giga Stream UMTS Technologies GmbH
+0007FC Adept Systems Inc.
+0007FD LANergy Ltd.
+0007FE Rigaku Corporation
+0007FF Gluon Networks
 000800 MULTITECH SYSTEMS, INC.
+000801 HighSpeed Surfing Inc.
+000802 Compaq Computer Corporation
+000803 Cos Tron
+000804 ICA Inc.
+000805 Techno-Holon Corporation
+000806 Raonet Systems, Inc.
+000807 Access Devices Limited
+000808 PPT Vision, Inc.
+000809 Systemonic AG
+00080A Espera-Werke GmbH
+00080B Birka BPA Informationssystem AB
+00080C VDA elettronica SrL
+00080D Toshiba
+00080E Motorola, BCS
+00080F Proximion Fiber Optics AB
+000810 Key Technology, Inc.
+000811 VOIX Corporation
+000812 GM-2 Corporation
+000813 Diskbank, Inc.
+000814 TIL Technologies
+000815 CATS Co., Ltd.
+000816 Bluetags A/S
+000817 EmergeCore Networks LLC
+000818 Pixelworks, Inc.
+000819 Banksys
+00081A Sanrad Intelligence Storage Communications (2000) Ltd.
+00081B Windigo Systems
+00081C @pos.com
+00081D Ipsil, Incorporated
+00081E Repeatit AB
+00081F Pou Yuen Tech Corp. Ltd.
+000820 Cisco Systems Inc.
+000821 Cisco Systems Inc.
+000822 InPro Comm
+000823 Texa Corp.
+000824 Promatek Industries Ltd.
+000825 Acme Packet
+000826 Colorado Med Tech
+000827 Pirelli Cables & Systems
+000828 Koei Engineering Ltd.
+000829 Aval Nagasaki Corporation
+00082A Powerwallz Network Security
+00082B Wooksung Electronics, Inc.
+00082C Homag AG
+00082D Indus Teqsite Private Limited
+00082E Multitone Electronics PLC
+00084E DivergeNet, Inc.
+00084F Qualstar Corporation
+000850 Arizona Instrument Corp.
+000851 Canadian Bank Note Company, Ltd.
+000852 Davolink Co. Inc.
+000853 Schleicher GmbH & Co. Relaiswerke KG
+000854 Netronix, Inc.
+000855 NASA-Goddard Space Flight Center
+000856 Gamatronic Electronic Industries Ltd.
+000857 Polaris Networks, Inc.
+000858 Novatechnology Inc.
+000859 ShenZhen Unitone Electronics Co., Ltd.
+00085A IntiGate Inc.
+00085B Hanbit Electronics Co., Ltd.
+00085C Shanghai Dare Technologies Co. Ltd.
+00085D Aastra
+00085E PCO AG
+00085F Picanol N.V.
+000860 LodgeNet Entertainment Corp.
+000861 SoftEnergy Co., Ltd.
+000862 NEC Eluminant Technologies, Inc.
+000863 Entrisphere Inc.
+000864 Fasy S.p.A.
+000865 JASCOM CO., LTD
+000866 DSX Access Systems, Inc.
+000867 Uptime Devices
+000868 PurOptix
+000869 Command-e Technology Co.,Ltd.
+00086A Industrie Technik IPS GmbH
+00086B MIPSYS
+00086C Plasmon LMS
+00086D Missouri FreeNet
+00086E Hyglo AB
+00086F Resources Computer Network Ltd.
+000870 Rasvia Systems, Inc.
+000871 NORTHDATA Co., Ltd.
+000872 Sorenson Technologies, Inc.
+000873 DAP Design B.V.
+000874 Dell Computer Corp.
+000875 Acorp Electronics Corp.
+000876 SDSystem
+000877 Liebert HIROSS S.p.A.
+000878 Benchmark Storage Innovations
+000879 CEM Corporation
+00087A Wipotec GmbH
+00087B RTX Telecom A/S
+00087C Cisco Systems, Inc.
+00087D Cisco Systems Inc.
+00087E Bon Electro-Telecom Inc.
+00087F SPAUN electronic GmbH & Co. KG
+000880 BroadTel Canada Communications inc.
+000881 DIGITAL HANDS CO.,LTD.
+000882 SIGMA CORPORATION
+000883 Hewlett-Packard Company
+000884 Index Braille AB
+000885 EMS Dr. Thomas Wuensche
+000886 Hansung Teliann, Inc.
+000887 Maschinenfabrik Reinhausen GmbH
+000888 OULLIM Information Technology Inc,.
+000889 Echostar Technologies Corp
+00088A Minds@Work
+00088B Tropic Networks Inc.
+00088C Quanta Network Systems Inc.
+00088D Sigma-Links Inc.
+00088E Nihon Computer Co., Ltd.
+00088F ADVANCED DIGITAL TECHNOLOGY
+000890 AVILINKS SA
+000891 Lyan Inc.
+000892 EM Solutions
+000894 InnoVISION Multimedia Ltd.
+000895 DIRC Technologie GmbH & Co.KG
+000896 Printronix, Inc.
+000897 Quake Technologies
+000898 Gigabit Optics Corporation
+000899 Netbind, Inc.
+00089A Alcatel Microelectronics
+00089B ICP Electronics Inc.
+00089C Elecs Industry Co., Ltd.
+00089D UHD-Elektronik
+00089E Beijing Enter-Net co.LTD
+00089F EFM Networks
+0008A0 Stotz Feinmesstechnik GmbH
+0008A1 CNet Technology Inc.
+0008A2 ADI Engineering, Inc.
+0008A3 Cisco Systems
+0008A4 Cisco Systems
+0008A5 Peninsula Systems Inc.
+0008A6 Multiware & Image Co., Ltd.
+0008A7 iLogic Inc.
+0008A8 Systec Co., Ltd.
+0008A9 SangSang Technology, Inc.
+0008AA KARAM
+0008AB EnerLinx.com, Inc.
+0008AD Toyo-Linx Co., Ltd.
+0008AE Packetfront
+0008AF Novatec Corporation
+0008B0 BKtel communications GmbH
+0008B1 ProQuent Systems
+0008B2 SHENZHEN COMPASS TECHNOLOGY DEVELOPMENT CO.,LTD
+0008B3 Fastwel
+0008B4 SYSPOL
+0008B5 TAI GUEN ENTERPRISE CO., LTD
+0008B6 RouteFree, Inc.
+0008B7 HIT Incorporated
+0008B8 E.F. Johnson
+0008B9 KAON MEDIA Co., Ltd.
+0008BA Erskine Systems Ltd
+0008BB NetExcell
+0008BC Ilevo AB
+0008BD TEPG-US
+0008BE XENPAK MSA Group
+0008BF Aptus Elektronik AB
+0008C0 ASA SYSTEMS
+0008C1 Avistar Communications Corporation
+0008C2 Cisco Systems
+0008C3 Contex A/S
+0008C4 Hikari Co.,Ltd.
+0008C5 Liontech Co., Ltd.
+0008C6 Philips Consumer Communications
 0008C7 COMPAQ COMPUTER CORPORATION
+0008C8 Soneticom, Inc.
+0008C9 TechniSat Digital GmbH
+0008CA TwinHan Technology Co.,Ltd
+0008CB Zeta Broadband Inc.
+0008CC Remotec, Inc.
+0008CD With-Net Inc
+0008CF Nippon Koei Power Systems Co., Ltd.
+0008D0 Musashi Engineering Co., LTD.
+0008D1 KAREL INC.
+0008D2 ZOOM Networks Inc.
+0008D3 Hercules Technologies S.A.
+0008D4 IneoQuest Technologies, Inc
+0008D5 Vanguard Managed Solutions
+0008D6 HASSNET Inc.
+0008D7 HOW CORPORATION
+0008D8 Dowkey Microwave
+0008D9 Mitadenshi Co.,LTD
+0008DA SofaWare Technologies Ltd.
+0008DB Corrigent Systems
+0008DC Wiznet
+0008DD Telena Communications, Inc.
+0008DE 3UP Systems
+0008DF Alistel Inc.
+0008E0 ATO Technology Ltd.
+0008E1 Barix AG
+0008E2 Cisco Systems
+0008E3 Cisco Systems
+0008E4 Envenergy Inc
+0008E5 IDK Corporation
+0008E6 Littlefeet
+0008E7 SHI ControlSystems,Ltd.
+0008E8 Excel Master Ltd.
+0008E9 NextGig
+0008EA Motion Control Engineering, Inc
+0008EB ROMWin Co.,Ltd.
+0008EC Zonu, Inc.
+0008ED ST&T Instrument Corp.
+0008EE Logic Product Development
+0008EF DIBAL,S.A.
+0008F0 Next Generation Systems, Inc.
+0008F1 Voltaire
+0008F2 C&S Technology
+0008F3 WANY
+0008F4 Bluetake Technology Co., Ltd.
+0008F5 YESTECHNOLOGY Co.,Ltd.
+0008F6 SUMITOMO ELECTRIC HIGHTECHS.co.,ltd.
+0008F7 Hitachi Ltd, Semiconductor &amp; Integrated Circuits Gr
+0008F8 Guardall Ltd
+0008F9 Padcom, Inc.
+0008FA Karl E.Brinkmann GmbH
+0008FB SonoSite, Inc.
+0008FC Gigaphoton Inc.
+0008FD BlueKorea Co., Ltd.
+0008FE UNIK C&C Co.,Ltd.
+0008FF Trilogy Broadcast (Holdings) Ltd
+000900 TMT
+000901 Shenzhen Shixuntong Information & Technoligy Co
+000902 Redline Communications Inc.
+000903 Panasas, Inc
+000904 MONDIAL electronic
+000905 iTEC Technologies Ltd.
+000906 Esteem Networks
+000907 Chrysalis Development
+000908 VTech Technology Corp.
+000909 Telenor Connect A/S
+00090A SnedFar Technology Co., Ltd.
+00090B MTL  Instruments PLC
+00090C Mayekawa Mfg. Co. Ltd.
+00090D LEADER ELECTRONICS CORP.
+00090E Helix Technology Inc.
+00090F Fortinet Inc.
+000910 Simple Access Inc.
+000911 Cisco Systems
+000912 Cisco Systems
+000914 COMPUTROLS INC.
+000915 CAS Corp.
+000916 Listman Home Technologies, Inc.
+000917 WEM Technology Inc
+000918 SAMSUNG TECHWIN CO.,LTD
+000919 MDS Gateways
+00091A Macat Optics & Electronics Co., Ltd.
+00091B Digital Generation Inc.
+00091C CacheVision, Inc
+00091D Proteam Computer Corporation
+00091E Firstech Technology Corp.
+00091F A&amp;D Co., Ltd.
+000920 EpoX COMPUTER CO.,LTD.
+000921 Planmeca Oy
+000922 Touchless Sensor Technology AG
+000923 Heaman System Co., Ltd
+000924 Telebau GmbH
+000925 VSN Systemen BV
+000926 YODA COMMUNICATIONS, INC.
+000927 TOYOKEIKI CO.,LTD.
+000928 Telecore Inc
+000929 Sanyo Industries (UK) Limited
+00092A MYTECS Co.,Ltd.
+00092B iQstor Networks, Inc.
+00092C Hitpoint Inc.
+00092D High Tech Computer, Corp.
+00092E B&Tech System Inc.
+00092F Akom Technology Corporation
+000930 AeroConcierge Inc.
+000931 Future Internet, Inc.
+000932 Omnilux
+000933 OPTOVALLEY Co. Ltd.
+000934 Dream-Multimedia-Tv GmbH
+000935 Sandvine Incorporated
+000936 Ipetronik GmbH & Co.KG
+000937 Inventec Appliance Corp
+000938 Allot Communications
+000939 ShibaSoku Co.,Ltd.
+00093A Molex Fiber Optics
+00093B HYUNDAI NETWORKS INC.
+00093C Jacques Technologies P/L
+00093D Newisys,Inc.
+00093E C&I Technologies
+00093F Double-Win Enterpirse CO., LTD
+000940 AGFEO GmbH & Co. KG
+000941 Allied Telesis K.K.
+000942 CRESCO, LTD.
+000943 Cisco Systems
+000944 Cisco Systems
+000945 Palmmicro Communications Inc
+000946 Cluster Labs GmbH
+000947 Aztek, Inc.
+000948 Vista Control Systems, Corp.
+000949 Glyph Technologies Inc.
+00094A Homenet Communications
+00094B FillFactory NV
+00094C Communication Weaver Co.,Ltd.
+00094D Braintree Communications Pty Ltd
+00094E BARTECH SYSTEMS INTERNATIONAL, INC
+00094F elmegt GmbH & Co. KG
+000950 Independent Storage Corporation
+000951 Apogee Instruments, Inc
+000952 Auerswald GmbH & Co. KG
+000953 Linkage System Integration Co.Ltd.
+000954 AMiT spol. s. r. o.
+000955 Young Generation International Corp.
+000956 Network Systems Group, Ltd. (NSG)
+000957 Supercaller, Inc.
+000958 INTELNET S.A.
+000959 Sitecsoft
+00095A RACEWOOD TECHNOLOGY
+00095B Netgear, Inc.
+00095C Philips Medical Systems - Cardiac and Monitoring Systems (CM
+00095D Dialogue Technology Corp.
+00095E Masstech Group Inc.
+00095F Telebyte, Inc.
+000960 YOZAN Inc.
+000961 Switchgear and Instrumentation Ltd
+000962 Filetrac AS
+000963 Dominion Lasercom Inc.
+000964 Hi-Techniques
+000966 Thales Navigation
+000967 Tachyon, Inc
+000968 TECHNOVENTURE, INC.
+000969 Meret Optical Communications
+00096A Cloverleaf Communications Inc.
+00096B IBM Corporation
+00096C Imedia Semiconductor Corp.
+00096D Powernet Technologies Corp.
+00096E GIANT ELECTRONICS LTD.
+00096F Beijing Zhongqing Elegant Tech. Corp.,Limited
+000970 Vibration Research Corporation
+000971 Time Management, Inc.
+000972 Securebase,Inc
+000973 Lenten Technology Co., Ltd.
+000974 Innopia Technologies, Inc.
+000975 fSONA Communications Corporation
+000976 Datasoft ISDN Systems GmbH
+000977 Brunner Elektronik AG
+000978 AIJI System Co., Ltd.
+000979 Advanced Television Systems Committee, Inc.
+00097A Louis Design Labs.
+00097B Cisco Systems
+00097C Cisco Systems
+00097D SecWell Networks Oy
+00097E IMI TECHNOLOGY CO., LTD
+00097F Vsecure 2000 LTD.
+000980 Power Zenith Inc.
+000981 Newport Networks
+000982 Loewe Opta GmbH
+000983 Gvision Incorporated
+000984 MyCasa Network Inc.
+000985 Auto Telecom Company
+000986 Metalink LTD.
+000987 NISHI NIPPON ELECTRIC WIRE & CABLE CO.,LTD.
+000988 Nudian Electron Co., Ltd.
+000989 VividLogic Inc.
+00098A EqualLogic Inc
+00098B Entropic Communications, Inc.
+00098C Possio AB
+00098D DCT Ltd (Digital Communication Technologies Ltd)
+00098E ipcas GmbH
+00098F Cetacean Networks
+000990 ACKSYS Communications & systems
+000991 GE Fanuc Automation Manufacturing, Inc.
+000992 InterEpoch Technology,INC.
+000993 Visteon Corporation
+000994 Cronyx Engineering
+000995 Castle Technology Ltd
+000996 RDI
+000997 Nortel Networks
+000998 Capinfo Company Limited
+000999 CP GEORGES RENAULT
+00099A ELMO COMPANY, LIMITED
+00099B Western Telematic Inc.
+00099C Naval Research Laboratory
+00099D Haliplex Communications
+00099E Testech, Inc.
+00099F VIDEX INC.
+0009A0 Microtechno Corporation
+0009A1 Telewise Communications, Inc.
+0009A2 Interface Co., Ltd.
+0009A3 Leadfly Techologies Corp. Ltd.
+0009A4 HARTEC Corporation
+0009A5 HANSUNG ELETRONIC INDUSTRIES DEVELOPMENT CO., LTD
+0009A6 Ignis Optics, Inc.
+0009A7 Bang & Olufsen A/S
+0009A8 Eastmode Pte Ltd
+0009A9 Ikanos Communications
+0009AA Data Comm for Business, Inc.
+0009AB Netcontrol Oy
+0009AC LANVOICE
+0009AD HYUNDAI SYSCOMM, INC.
+0009AE OKANO ELECTRIC CO.,LTD
+0009AF e-generis
+0009B0 Onkyo Corporation
+0009B1 Kanematsu Electronics, Ltd.
+0009B2 L&F Inc.
+0009B3 MCM Systems Ltd
+0009B4 KISAN TELECOM CO., LTD.
+0009B5 3J Tech. Co., Ltd.
+0009B6 Cisco Systems
+0009B7 Cisco Systems
+0009B8 Entise Systems
+0009B9 Action Imaging Solutions
+0009BA MAKU Informationstechik GmbH
+0009BB MathStar, Inc.
+0009BC Digital Safety Technologies Inc.
+0009BD Epygi Technologies, Ltd.
+0009BE Mamiya-OP Co.,Ltd.
+0009BF Nintendo Co.,Ltd.
+0009C0 6WIND
+0009C1 PROCES-DATA A/S
+0009C3 NETAS
+0009C4 Medicore Co., Ltd
+0009C5 KINGENE Technology Corporation
+0009C6 Visionics Corporation
+0009C7 Movistec
+0009C8 SINAGAWA TSUSHIN KEISOU SERVICE
+0009C9 BlueWINC Co., Ltd.
+0009CA iMaxNetworks(Shenzhen)Limited.
+0009CB HBrain
+0009CC Moog GmbH
+0009CD HUDSON SOFT CO.,LTD.
+0009CE SpaceBridge Semiconductor Corp.
+0009CF iAd GmbH
+0009D0 Versatel Networks
+0009D1 SERANOA NETWORKS INC
+0009D2 Mai Logic Inc.
+0009D3 Western DataCom Co., Inc.
+0009D4 Transtech Networks
+0009D5 Signal Communication, Inc.
+0009D6 KNC One GmbH
+0009D7 DC Security Products
+0009D9 Neoscale Systems, Inc
+0009DA Control Module Inc.
+0009DB eSpace
+0009DC Galaxis Technology AG
+0009DD Mavin Technology Inc.
+0009DE Samjin Information & Communications Co., Ltd.
+0009DF Vestel Komunikasyon Sanayi ve Ticaret A.S.
+0009E0 XEMICS S.A.
+0009E1 Gemtek Technology Co., Ltd.
+0009E2 Sinbon Electronics Co., Ltd.
+0009E3 Angel Iglesias S.A.
+0009E4 K Tech Infosystem Inc.
+0009E5 Hottinger Baldwin Messtechnik GmbH
+0009E6 Cyber Switching Inc.
+0009E7 ADC Techonology
+0009E8 Cisco Systems
+0009E9 Cisco Systems
+0009EA YEM Inc.
+0009EB HuMANDATA LTD.
+0009EC Daktronics, Inc.
+0009ED CipherOptics
+0009EE MEIKYO ELECTRIC CO.,LTD
+0009EF Vocera Communications
+0009F0 Shimizu Technology Inc.
+0009F1 Yamaki Electric Corporation
+0009F2 Cohu, Inc., Electronics Division
+0009F3 WELL Communication Corp.
+0009F4 Alcon Laboratories, Inc.
+0009F5 Emerson Network Power Co.,Ltd
+0009F6 Shenzhen Eastern Digital Tech Ltd.
+0009F7 SED, a division of Calian
+0009F8 UNIMO TECHNOLOGY CO., LTD.
+0009F9 ART JAPAN CO., LTD.
+0009FB Philips Medizinsysteme Boeblingen GmbH
+0009FC IPFLEX Inc.
+0009FD Ubinetics Limited
+0009FE Daisy Technologies, Inc.
+0009FF X.net 2000 GmbH
+000A00 Mediatek Corp.
+000A01 SOHOware, Inc.
+000A02 ANNSO CO., LTD.
+000A03 ENDESA SERVICIOS, S.L.
+000A04 3Com Europe Ltd
+000A05 Widax Corp.
+000A06 Teledex LLC
+000A07 WebWayOne Ltd
+000A08 ALPINE ELECTRONICS, INC.
+000A09 TaraCom Integrated Products, Inc.
+000A0A SUNIX Co., Ltd.
+000A0B Sealevel Systems, Inc.
+000A0C Scientific Research Corporation
+000A0D MergeOptics GmbH
+000A0E Invivo Research Inc.
+000A0F Ilryung Telesys, Inc
+000A10 FAST media integrations AG
+000A11 ExPet Technologies, Inc
+000A12 Azylex Technology, Inc
+000A13 Silent Witness
+000A14 TECO a.s.
+000A15 Silicon Data, Inc
+000A16 Lassen Research
+000A17 NESTAR COMMUNICATIONS, INC
+000A18 Vichel Inc.
+000A19 Valere Power, Inc.
+000A1A Imerge Ltd
+000A1B Stream Labs
+000A1C Bridge Information Co., Ltd.
+000A1D Optical Communications Products Inc.
+000A1E Red-M (Communications) Limited
+000A1F ART WARE Telecommunication Co., Ltd.
+000A20 SVA Networks, Inc.
+000A21 Integra Telecom Co. Ltd
+000A22 Amperion Inc
+000A23 Parama Networks Inc
+000A24 Octave Communications
+000A25 CERAGON NETWORKS
+000A26 CEIA S.p.A.
 000A27 Apple Computer, Inc.
-001000 CABLE TELEVISION
+000A28 Motorola
+000A29 Pan Dacom Networking AG
+000A2A QSI Systems Inc.
+000A2B Etherstuff
+000A2C Active Tchnology Corporation
+000A2E MAPLE NETWORKS CO., LTD
+000A2F Artnix Inc.
+000A30 Johnson Controls-ASG
+000A31 HCV Wireless
+000A32 Xsido Corporation
+000A33 Sierra Logic, Inc.
+000A34 Identicard Systems Incorporated
+000A35 Xilinx
+000A36 Synelec Telecom Multimedia
+000A37 Procera Networks, Inc.
+000A38 Netlock Technologies, Inc.
+000A39 LoPA Information Technology
+000A3A J-THREE INTERNATIONAL Holding Co., Ltd.
+000A3B GCT Semiconductor, Inc
+000A3C Enerpoint Ltd.
+000A3D Elo Sistemas Eletronicos S.A.
+000A3E EADS Telecom
+000A3F Data East Corporation
+000A40 Crown Audio
+000A41 Cisco Systems
+000A42 Cisco Systems
+000A43 Chunghwa Telecom Co., Ltd.
+000A44 Avery Dennison Deutschland GmbH
+000A45 Audio-Technica Corp.
+000A46 ARO Controls SAS
+000A47 Allied Vision Technologies
+000A48 Albatron Technology
+000A49 Acopia Networks
+000A4A Targa Systems Ltd.
+000A4B DataPower Technology, Inc.
+000A4C Molecular Devices Corporation
+000A4D Noritz Corporation
+000A4E UNITEK Electronics INC.
+000A4F Brain Boxes Limited
+000A50 REMOTEK CORPORATION
+000A51 GyroSignal Technology Co., Ltd.
+000A52 Venitek Co. Ltd.
+000A53 Intronics, Incorporated
+000A54 Laguna Hills, Inc.
+000A55 MARKEM Corporation
+000A56 HITACHI Maxell Ltd.
+000A57 Hewlett-Packard Company - Standards
+000A58 Ingenieur-Buero Freyer & Siegel
+000A59 HW server
+000A5A GreenNET Technologies Co.,Ltd.
+000A5B Power-One as
+000A5C Carel s.p.a.
+000A5D PUC Founder (MSC) Berhad
+000A5E 3COM Corporation
+000A5F almedio inc.
+000A60 Autostar Technology Pte Ltd
+000A61 Cellinx Systems Inc.
+000A62 Crinis Networks, Inc.
+000A63 DHD GmbH
+000A64 Eracom Technologies
+000A65 GentechMedia.co.,ltd.
+000A66 MITSUBISHI ELECTRIC SYSTEM & SERVICE CO.,LTD.
+000A67 OngCorp
+000A68 SolarFlare Communications, Inc.
+000A69 SUNNY bell Technology Co., Ltd.
+000A6A SVM Microwaves s.r.o.
+000A6B Tadiran Telecom Business Systems LTD
+000A6C Walchem Corporation
+000A6D EKS Elektronikservice GmbH
+000A6E Broadcast Technology Limited
+000A6F ZyTera Technologies Inc.
+000A70 MPLS Forum
+000A71 Avrio Technologies, Inc
+000A72 SimpleTech, Inc.
+000A73 Scientific Atlanta
+000A74 Manticom Networks Inc.
+000A75 Cat Electronics
+000A76 Beida Jade Bird Huaguang Technology Co.,Ltd
+000A77 Bluewire Technologies LLC
+000A78 OLITEC
+000A79 corega K.K.
+000A7A Kyoritsu Electric Co., Ltd.
+000A7B Cornelius Consult
+000A7C Tecton Ltd
+000A7D Valo, Inc.
+000A7E The Advantage Group
+000A7F Teradon Industries, Inc
+000A80 Telkonet Inc.
+000A81 TEIMA Audiotex S.L.
+000A82 TATSUTA SYSTEM ELECTRONICS CO.,LTD.
+000A83 SALTO SYSTEMS S.L.
+000A84 Rainsun Enterprise Co., Ltd.
+000A85 PLAT'C2,Inc
+000A86 Lenze
+000A87 Integrated Micromachines Inc.
+000A88 InCypher S.A.
+000A89 Creval Systems, Inc.
+000A8A Cisco Systems
+000A8B Cisco Systems
+000A8C Guardware Systems Ltd.
+000A8D EUROTHERM LIMITED
+000A8E Invacom Ltd
+000A8F Aska International Inc.
+000A90 Bayside Interactive, Inc.
+000A91 HemoCue AB
+000A92 Presonus Corporation
+000A93 W2 Networks, Inc.
+000A94 ShangHai cellink CO., LTD
+000A95 Apple Computer, Inc.
+000A96 MEWTEL TECHNOLOGY INC.
+000A97 SONICblue, Inc.
+000A98 M+F Gwinner GmbH & Co
+000A99 Dataradio Inc.
+000A9A Aiptek International Inc
+000A9B Towa Meccs Corporation
+000A9C Server Technology, Inc.
+000A9D King Young Technology Co. Ltd.
+000A9E BroadWeb Corportation
+000A9F Pannaway Technologies, Inc.
+000AA0 Cedar Point Communications
+000AA1 V V S Limited
+000AA2 SYSTEK INC.
+000AA3 SHIMAFUJI ELECTRIC CO.,LTD.
+000AA4 SHANGHAI SURVEILLANCE TECHNOLOGY CO,LTD
+000AA5 MAXLINK INDUSTRIES LIMITED
+000AA6 Hochiki Corporation
+000AA7 FEI Company
+000AA8 ePipe Pty. Ltd.
+000AA9 Brooks Automation GmbH
+000AAA AltiGen Communications Inc.
+000AAB TOYOTA MACS, INC.
+000AAC TerraTec Electronic GmbH
+000AAD Stargames Corporation
+000AAE Rosemount Process Analytical
+000AAF Pipal Systems
+000AB0 LOYTEC electronics GmbH
+000AB1 GENETEC Corporation
+000AB2 Fresnel Wireless Systems
+000AB3 Fa. GIRA
+000AB4 ETIC Telecommunications
+000AB5 Digital Electronic Network
+000AB6 COMPUNETIX, INC
+000AB7 Cisco Systems
+000AB8 Cisco Systems
+000AB9 Astera Technologies Corp.
+000ABA Arcon Technology Limited
+000ABB Taiwan Secom Co,. Ltd
+000ABC Seabridge Ltd.
+000ABD Rupprecht & Patashnick Co.
+000ABE OPNET Technologies CO., LTD.
+000ABF HIROTA SS
+000AC0 Fuyoh Video Industry CO., LTD.
+000AC1 Futuretel
+000AC2 FiberHome Telecommunication Technologies CO.,LTD
+000AC3 eM Technics Co., Ltd.
+000AC4 Daewoo Teletech Co., Ltd
+000AC5 Color Kinetics
+000AC7 Unication Group
+000AC8 ZPSYS CO.,LTD. (Planning&Management)
+000AC9 Zambeel Inc
+000ACA YOKOYAMA SHOKAI CO.,Ltd.
+000ACB XPAK MSA Group
+000ACC Winnow Networks, Inc.
+000ACD Sunrich Technology Limited
+000ACE RADIANTECH, INC.
+000ACF PROVIDEO Multimedia Co. Ltd.
+000AD0 Niigata Develoment Center,  F.I.T. Co., Ltd.
+000AD1 MWS
+000AD2 JEPICO Corporation
+000AD3 INITECH Co., Ltd
+000AD4 CoreBell Systems Inc.
+000AD5 Brainchild Electronic Co., Ltd.
+000AD6 BeamReach Networks
+000AD8 IPCserv Technology Corp.
+000AD9 Sony Ericsson Mobile Communications AB
+000ADB SkyPilot Network, Inc
+000ADC RuggedCom Inc.
+000ADD InSciTek Microsystems, Inc.
+000ADE Happy Communication Co., Ltd.
+000ADF Gennum Corporation
+000AE0 Fujitsu Softek
+000AE1 EG Technology
+000AE2 Binatone Electronics International, Ltd
+000AE3 YANG MEI TECHNOLOGY CO., LTD
+000AE4 Wistron Corp.
+000AE5 ScottCare Corporation
+000AE6 Elitegroup Computer System Co. (ECS)
+000AE7 ELIOP S.A.
+000AE8 Cathay Roxus Information Technology Co. LTD
+000AE9 AirVast Technology Inc.
+000AEA ADAM ELEKTRONIK LTD.STI.
+000AEB Shenzhen Tp-link Technology Co; Ltd.
+000AEC Koatsu Gas Kogyo Co., Ltd.
+000AED HARTING Vending G.m.b.H. & CO KG
+000AEE GCD Hard- & Software GmbH
+000AEF OTRUM ASA
+000AF0 SHIN-OH ELECTRONICS CO., LTD. R&D
+000AF1 Clarity Design, Inc.
+000AF2 NeoAxiom Corp.
+000AF3 Cisco Systems
+000AF4 Cisco Systems
+000AF5 Airgo Networks, Inc.
+000AF6 Computer Process Controls
+000AF7 Broadcom Corp.
+000AF8 American Telecare Inc.
+000AFA Traverse Technologies Australia
+000AFB Ambri Limited
+000AFC Core Tec Communications, LLC
+000AFD Viking Electronic Services
+000AFE NovaPal Ltd
+000AFF Kilchherr Elektronik AG
+000B00 FUJIAN START COMPUTER EQUIPMENT CO.,LTD
+000B01 DAIICHI ELECTRONICS CO., LTD.
+000B02 Dallmeier electronic
+000B03 Taekwang Industrial Co., Ltd
+000B04 Volktek Corporation
+000B05 Pacific Broadband Networks
+000B06 Motorola BCS
+000B07 Voxpath Networks
+000B08 Pillar Data Systems
+000B09 Ifoundry Systems Singapore
+000B0A dBm Optics
+000B0B Corrent Corporation
+000B0C Agile Systems Inc.
+000B0D Air2U, Inc.
+000B0E Trapeze Networks
+000B0F Nyquist Industrial Control BV
+000B10 11wave Technonlogy Co.,Ltd
+000B11 HIMEJI ABC TRADING CO.,LTD.
+000B13 ZETRON INC
+000B14 ViewSonic Corporation
+000B15 Platypus Technology
+000B16 Communication Machinery Corporation
+000B17 MKS Instruments
+000B19 Vernier Networks, Inc.
+000B1A Teltone Corporation
+000B1B Systronix, Inc.
+000B1D LayerZero Power Systems, Inc.
+000B1E KAPPA opto-electronics GmbH
+000B1F I CON Computer Co.
+000B20 Hirata corporation
+000B21 G-Star Communications Inc.
+000B22 Environmental Systems and Services
+000B23 Efficient Networks, Inc.
+000B24 AirLogic
+000B25 Aeluros
+000B26 Wetek Corporation
+000B27 Scion Corporation
+000B28 Quatech Inc.
+000B29 LG Industrial Systems Co.,Ltd.
+000B2A HOWTEL Co., Ltd.
+000B2B HOSTNET CORPORATION
+000B2C Eiki Industrial Co. Ltd.
+000B2D Danfoss Inc.
+000B2E Cal-Comp Electronics (Thailand) Public Company Limited Taipe
+000B2F bplan GmbH
+000B30 Beijing Gongye Science & Technology Co.,Ltd
+000B31 Yantai ZhiYang Scientific and technology industry CO., LTD
+000B32 VORMETRIC, INC.
+000B33 Vivato
+000B34 ShangHai Broadband Technologies CO.LTD
+000B35 Quad Bit System co., Ltd.
+000B36 Productivity Systems, Inc.
+000B37 MANUFACTURE DES MONTRES ROLEX SA
+000B38 Knuerr AG
+000B39 Keisoku Giken Co.,Ltd.
+000B3A Fortel DTV, Inc.
+000B3B devolo AG
+000B3C Cygnal Integrated Products, Inc.
+000B3D CONTAL OK Ltd.
+000B3E BittWare, Inc
+000B3F Anthology Solutions Inc.
+000B40 OpNext Inc.
+000B41 Ing. Buero Dr. Beutlhauser
+000B42 commax Co., Ltd.
+000B43 Microscan Systems, Inc.
+000B44 Concord IDea Corp.
+000B45 Cisco
+000B46 Cisco
+000B47 Advanced Energy
+000B48 sofrel
+000B49 RF-Link System Inc.
+000B4A Visimetrics (UK) Ltd
+000B4B VISIOWAVE SA
+000B4C Clarion (M) Sdn Bhd
+000B4D Emuzed
+000B4E VertexRSI Antenna Products Division
+000B4F Verifone, INC.
+000B50 Oxygnet
+000B51 Micetek International Inc.
+000B52 JOYMAX ELECTRONICS CORP.
+000B53 INITIUM Co., Ltd.
+000B54 BiTMICRO Networks, Inc.
+000B55 ADInstruments
+000B56 Cybernetics
+000B57 Silicon Laboratories
+000B58 Astronautics C.A  LTD
+000B59 ScriptPro, LLC
+000B5A HyperEdge
+000B5B Rincon Research Corporation
+000B5C Newtech Co.,Ltd
+000B5D FUJITSU LIMITED
+000B5E ATMAVA Ltd
+000B5F Cisco Systems
+000B60 Cisco Systems
+000B61 Friedrich Lütze GmbH &Co.
+000B62 Ingenieurbüro Ingo Mohnen
+000B64 Kieback & Peter GmbH & Co KG
+000B65 Sy.A.C. srl
+000B66 Teralink Communications
+000B67 Topview Technology Corporation
+000B68 Addvalue Communications Pte Ltd
+000B69 Franke Finland Oy
+000B6A Asiarock Incorporation
+000B6B Wistron Neweb Corp.
+000B6C Sychip Inc.
+000B6D SOLECTRON JAPAN NAKANIIDA
+000B6E Neff Instrument Corp.
+000B6F Media Streaming Networks Inc
+000B70 Load Technology, Inc.
+000B71 Litchfield Communications Inc.
+000B72 Lawo AG
+000B73 Kodeos Communications
+000B74 Kingwave Technology Co., Ltd.
+000B75 Iosoft Ltd.
+000B76 ET&T Co. Ltd.
+000B77 Cogent Systems, Inc.
+000B78 TAIFATECH INC.
+000B79 X-COM, Inc.
+000B7B Test-Um Inc.
+000B7C Telex Communications
+000B7D SOLOMON EXTREME INTERNATIONAL LTD.
+000B7E SAGINOMIYA Seisakusho Inc.
+000B7F OmniWerks
+000B81 Kaparel Corporation
+000B82 Grandstream Networks, Inc.
+000B83 DATAWATT B.V.
+000B84 BODET
+000B85 Airespace, Inc.
+000B86 Aruba Networks
+000B87 American Reliance Inc.
+000B88 Vidisco ltd.
+000B89 Top Global Technology, Ltd.
+000B8A MITEQ Inc.
+000B8B KERAJET, S.A.
+000B8C flextronics israel
+000B8D Avvio Networks
+000B8E Ascent Corporation
+000B8F AKITA ELECTRONICS SYSTEMS CO.,LTD.
+000B90 Covaro Networks, Inc.
+000B91 Aglaia Gesellschaft für Bildverarbeitung und Kommunikation m
+000B92 Ascom Danmark A/S
+000B93 Barmag Electronic
+000B94 Digital Monitoring Products, Inc.
+000B95 eBet Gaming Systems Pty Ltd
+000B96 Innotrac Diagnostics Oy
+000B97 Matsushita Electric Industrial Co.,Ltd.
+000B98 NiceTechVision
+000B99 SensAble Technologies, Inc.
+000B9A Shanghai Ulink Telecom Equipment Co. Ltd.
+000B9B Sirius System Co, Ltd.
+000B9C TriBeam Technologies, Inc.
+000B9D TwinMOS Technologies Inc.
+000B9E Yasing Technology Corp.
+000B9F Neue ELSA GmbH
+000BA0 T&L Information Inc.
+000BA1 SYSCOM Ltd.
+000BA2 Sumitomo Electric Networks, Inc
+000BA3 Siemens AG, I&S
+000BA4 Shiron Satellite Communications Ltd. (1996)
+000BA5 Quasar Cipta Mandiri, PT
+000BA6 Miyakawa Electric Works Ltd.
+000BA7 Maranti Networks
+000BA8 HANBACK ELECTRONICS CO., LTD.
+000BAA Aiphone co.,Ltd
+000BAB Advantech Technology (CHINA) Co., Ltd.
+000BAC 3Com Europe Ltd.
+000BAD PC-PoS Inc.
+000BAE Vitals System Inc.
+000BB0 Sysnet Telematica srl
+000BB1 Super Star Technology Co., Ltd.
+000BB2 SMALLBIG TECHNOLOGY
+000BB3 RiT technologies Ltd.
+000BB4 RDC Semiconductor Inc.,
+000BB5 nStor Technologies, Inc.
+000BB6 Mototech Inc.
+000BB7 Micro Systems Co.,Ltd.
+000BB8 Kihoku Electronic Co.
+000BB9 Imsys AB
+000BBA Harmonic Broadband Access Networks
+000BBB Etin Systems Co., Ltd
+000BBC En Garde Systems, Inc.
+000BBD Connexionz Limited
+000BBE Cisco Systems
+000BBF Cisco Systems
+000BC0 China IWNComm Co., Ltd.
+000BC1 Bay Microsystems, Inc.
+000BC2 Corinex Communication Corp.
+000BC3 Multiplex, Inc.
+000BC4 BIOTRONIK GmbH & Co
+000BC5 SMC Networks, Inc.
+000BC6 ISAC, Inc.
+000BC7 ICET S.p.A.
+000BC8 AirFlow Networks
+000BC9 Electroline Equipment
+000BCA DATAVAN International Corporation
+000BCB Fagor Automation , S. Coop
+000BCC JUSAN, S.A.
+000BCD Compaq (HP)
+000BCE Free2move AB
+000BCF AGFA NDT INC.
+000BD0 XiMeta Technology Americas Inc.
+000BD1 Aeronix, Inc.
+000BD2 Remopro Technology Inc.
+000BD3 cd3o
+000BD4 Beijing Wise Technology & Science Development Co.Ltd
+000BD5 Nvergence, Inc.
+000BD6 Paxton Access Ltd
+000BD7 MBB Gelma GmbH
+000BD8 Industrial Scientific Corp.
+000BD9 General Hydrogen
+000BDA EyeCross Co.,Inc.
+000BDB Dell ESG PCBA Test
+000BDC AKCP
+000BDD TOHOKU RICOH Co., LTD.
+000BDF Shenzhen RouterD Networks Limited
+000BE0 SercoNet Ltd.
+000BE2 Lumenera Corporation
+000BE3 Key Stream Co., Ltd.
+000BE4 Hosiden Corporation
+000BE5 HIMS Korea Co., Ltd.
+000BE6 Datel Electronics
+000BE7 COMFLUX TECHNOLOGY INC.
+000BE8 AOIP
+000BEA Zultys Technologies
+000BEB Systegra AG
+000BEC NIPPON ELECTRIC INSTRUMENT, INC.
+000BED ELM Inc.
+000BEE inc.jet, Incorporated
+000BEF Code Corporation
+000BF0 MoTEX Products Co., Ltd.
+000BF1 LAP Laser Applikations
+000BF2 Chih-Kan Technology Co., Ltd.
+000BF3 BAE SYSTEMS
+000BF5 Shanghai Sibo Telecom Technology Co.,Ltd
+000BF6 Nitgen Co., Ltd
+000BF7 NIDEK CO.,LTD
+000BF8 Infinera
+000BF9 Gemstone communications, Inc.
+000BFB D-NET International Corporation
+000BFC Cisco Systems
+000BFD Cisco Systems
+000BFE CASTEL Broadband Limited
+000BFF Berkeley Camera Engineering
+000C00 BEB Industrie-Elektronik AG
+000C01 Abatron AG
+000C02 ABB Oy
+000C03 HDMI Licensing, LLC
+000C04 Tecnova
+000C05 RPA Reserch Co., Ltd.
+000C06 Nixvue Systems  Pte Ltd
+000C07 Iftest AG
+000C08 HUMEX Technologies Corp.
+000C09 Hitachi IE Systems Co., Ltd
+000C0A Guangdong Province Electronic Technology Research Institute
+000C0B Broadbus Technologies
+000C0C APPRO TECHNOLOGY INC.
+000C0D Communications & Power Industries / Satcom Division
+000C0E XtremeSpectrum, Inc.
+000C0F Techno-One Co., Ltd
+000C10 PNI Corporation
+000C11 NIPPON DEMPA CO.,LTD.
+000C12 Micro-Optronic-Messtechnik GmbH
+000C13 MediaQ
+000C14 Diagnostic Instruments, Inc.
+000C15 CyberPower Systems, Inc.
+000C16 Concorde Microsystems Inc.
+000C17 AJA Video Systems Inc
+000C18 Zenisu Keisoku Inc.
+000C19 Telio Communications GmbH
+000C1A Quest Technical Solutions Inc.
+000C1B ORACOM Co, Ltd.
+000C1C MicroWeb Co., Ltd.
+000C1D Mettler & Fuchs AG
+000C1E Global Cache
+000C1F Glimmerglass Networks
+000C20 Fi WIn, Inc.
+000C21 Faculty of Science and Technology, Keio University
+000C22 Double D Electronics Ltd
+000C23 Beijing Lanchuan Tech. Co., Ltd.
+000C25 Allied Telesyn Networks
+000C26 Weintek Labs. Inc.
+000C27 Sammy Corporation
+000C28 RIFATRON
+000C29 VMware, Inc.
+000C2A OCTTEL Communication Co., Ltd.
+000C2B ELIAS Technology, Inc.
+000C2C Enwiser Inc.
+000C2D FullWave Technology Co., Ltd.
+000C2E Openet information technology(shenzhen) Co., Ltd.
+000C2F SeorimTechnology Co.,Ltd.
+000C30 Cisco
+000C31 Cisco
+000C32 Avionic Design Development GmbH
+000C33 Compucase Enterprise Co. Ltd.
+000C34 Vixen Co., Ltd.
+000C35 KaVo Dental GmbH & Co. KG
+000C36 SHARP TAKAYA ELECTRONICS INDUSTRY CO.,LTD.
+000C37 Geomation, Inc.
+000C38 TelcoBridges Inc.
+000C39 Sentinel Wireless Inc.
+000C3A Oxance
+000C3B Orion Electric Co., Ltd.
+000C3C MediaChorus, Inc.
+000C3D Glsystech Co., Ltd.
+000C3E Crest Audio
+000C3F Cogent Defence & Security Networks,
+000C40 Altech Controls
+000C41 The Linksys Group, Inc.
+000C42 Routerboard.com
+000C43 Ralink Technology, Corp.
+000C44 Automated Interfaces, Inc.
+000C45 Animation Technologies Inc.
+000C46 Allied Telesyn Inc.
+000C47 SK Teletech(R&D Planning Team)
+000C48 QoStek Corporation
+000C49 Dangaard Telecom RTC Division A/S
+000C4A Cygnus Microsystems Private Limited
+000C4B Cheops Elektronik
+000C4C Arcor AG&Co.
+000C4D ACRA CONTROL
+000C4E Winbest Technology CO,LT
+000C4F UDTech Japan Corporation
+000C50 Seagate Technology
+000C51 Scientific Technologies Inc.
+000C52 Roll Systems Inc.
+000C54 Pedestal Networks, Inc
+000C55 Microlink Communications Inc.
+000C56 Megatel Computer (1986) Corp.
+000C57 MACKIE Engineering Services Belgium BVBA
+000C58 M&S Systems
+000C59 Indyme Electronics, Inc.
+000C5A IBSmm Industrieelektronik Multimedia
+000C5B HANWANG TECHNOLOGY CO.,LTD
+000C5C GTN Systems B.V.
+000C5D CHIC TECHNOLOGY (CHINA) CORP.
+000C5F Avtec, Inc.
+000C60 ACM Systems
+000C61 AC Tech corporation DBA Advanced Digital
+000C62 ABB Automation Technology Products AB, Control
+000C63 Zenith Electronics Corporation
+000C64 X2 MSA Group
+000C65 Sunin Telecom
+000C66 Pronto Networks Inc
+000C67 OYO ELECTRIC CO.,LTD
+000C68 Oasis Semiconductor, Inc.
+000C69 National Radio Astronomy Observatory
+000C6A MBARI
+000C6B Kurz Industrie-Elektronik GmbH
+000C6C Elgato Systems LLC
+000C6D BOC Edwards
+000C6E ASUSTEK COMPUTER INC.
+000C6F Amtek system co.,LTD.
+000C70 ACC GmbH
+000C71 Wybron, Inc
+000C72 Tempearl Industrial Co., Ltd.
+000C73 TELSON ELECTRONICS CO., LTD
+000C74 RIVERTEC CORPORATION
+000C75 Oriental integrated electronics. LTD
+000C76 MICRO-STAR INTERNATIONAL CO., LTD.
+000C77 Life Racing Ltd
+000C78 In-Tech Electronics Limited
+000C79 Extel Communications P/L
+000C7A DaTARIUS Technologies GmbH
+000C7B ALPHA PROJECT Co.,Ltd.
+000C7C Internet Information Image Inc.
+000C7D TEIKOKU ELECTRIC MFG. CO., LTD
+000C7E Tellium Incorporated
+000C7F synertronixx GmbH
+000C80 Opelcomm Inc.
+000C81 Nulec Industries Pty Ltd
+000C82 NETWORK TECHNOLOGIES INC
+000C83 Logical Solutions
+000C84 Eazix, Inc.
+000C85 Cisco Systems
+000C86 Cisco Systems
+000C87 ATI
+000C88 Apache Micro Peripherals, Inc.
+000C89 AC Electric Vehicles, Ltd.
+000C8A Bose Corporation
+000C8B Connect Tech Inc
+000C8C KODICOM CO.,LTD.
+000C8D MATRIX VISION GmbH
+000C8E Mentor Engineering Inc
+000C8F Nergal s.r.l.
+000C90 Octasic Inc.
+000C91 Riverhead Networks Inc.
+000C92 WolfVision Gmbh
+000C93 Xeline Co., Ltd.
+000C94 United Electronic Industries, Inc.
+000C95 PrimeNet
+000C96 OQO, Inc.
+000C97 NV ADB TTV Technologies SA
+000C98 LETEK Communications Inc.
+000C99 HITEL LINK Co.,Ltd
+000C9A Hitech Electronics Corp.
+000C9B EE Solutions, Inc
+000C9C Chongho information & communications
+000C9D AirWalk Communications, Inc.
+000C9E MemoryLink Corp.
+000C9F NKE Corporation
+000CA0 StorCase Technology, Inc.
+000CA1 SIGMACOM Co., LTD.
+000CA2 Scopus Network Technologies Ltd
+000CA3 Rancho Technology, Inc.
+000CA4 Prompttec Product Management GmbH
+000CA6 Mintera Corporation
+000CA7 Metro (Suzhou) Technologies Co., Ltd.
+000CA8 Garuda Networks Corporation
+000CA9 Ebtron Inc.
+000CAA Cubic Transportation Systems Inc
+000CAB COMMEND International
+000CAC Citizen Watch Co., Ltd.
+000CAD BTU International
+000CAE Ailocom Oy
+000CAF TRI TERM CO.,LTD.
+000CB0 Star Semiconductor Corporation
+000CB1 Salland Engineering (Europe) BV
+000CB2 safei Co., Ltd.
+000CB3 ROUND Co.,Ltd.
+000CB4 Propagate Networks, Inc
+000CB5 Premier Technolgies, Inc
+000CB6 NANJING SEU MOBILE & INTERNET TECHNOLOGY CO.,LTD
+000CB7 Nanjing Huazhuo Electronics Co., Ltd.
+000CB8 MEDION AG
+000CB9 LEA
+000CBA Jamex
+000CBB ISKRAEMECO
+000CBC Iscutum
+000CBD Interface Masters, Inc
+000CBF Holy Stone Ent. Co., Ltd.
+000CC0 Genera Oy
+000CC1 Cooper Industries Inc.
+000CC3 BeWAN systems
+000CC4 Tiptel AG
+000CC5 Nextlink Co., Ltd.
+000CC6 Ka-Ro electronics GmbH
+000CC7 Intelligent Computer Solutions Inc.
+000CC8 Integrated Digital Systems, Inc.
+000CC9 ILWOO DATA & TECHNOLOGY CO.,LTD
+000CCA Hitachi Global Storage Technologies
+000CCB Design Combus Ltd
+000CCC Bluesoft Ltd.
+000CCD IEC - TC57
+000CCE Cisco Systems
+000CCF Cisco Systems
+000CD0 Symetrix
+000CD1 SFOM Technology Corp.
+000CD2 Schaffner EMV AG
+000CD3 Prettl Elektronik Radeberg GmbH
+000CD4 Positron Public Safety Systems inc.
+000CD5 Passave Inc.
+000CD6 PARTNER TECH
+000CD7 Nallatech Ltd
+000CD8 M. K. Juchheim GmbH & Co
+000CD9 Itcare Co., Ltd
+000CDA FreeHand Systems, Inc.
+000CDB Foundry Networks
+000CDC BECS Technology, Inc
+000CDD AOS Technologies AG
+000CDE ABB STOTZ-KONTAKT GmbH
+000CDF PULNiX America, Inc
+000CE0 Trek Diagnostics Inc.
+000CE1 The Open Group
+000CE2 Rolls-Royce
+000CE3 Option International N.V.
+000CE4 NeuroCom International, Inc.
+000CE5 Motorola BCS
+000CE6 Meru Networks Inc
+000CE7 MediaTek Inc.
+000CE8 GuangZhou AnJuBao Co., Ltd
+000CE9 BLOOMBERG L.P.
+000CEA aphona Kommunikationssysteme
+000CEB CNMP Networks, Inc.
+000CEC Spectracom Corp.
+000CED Real Digital Media
+000CEE Q-Networks
+000CEF Open Networks Engineering Ltd
+000CF0 M & N GmbH
+000CF1 Intel Corporation
+000CF2 GAMESA EÓLICA
+000CF3 CALL IMAGE SA
+000CF4 AKATSUKI ELECTRIC MFG.CO.,LTD.
+000CF5 InfoExpress
+000CF6 Sitecom Europe BV
+000CF7 Nortel Networks
+000CF8 Nortel Networks
+000CF9 ITT Flygt AB
+000CFA Digital Systems Corp
+000CFB Korea Network Systems
+000CFC S2io Technologies Corp
+000CFE Grand Electronic Co., Ltd
+000CFF MRO-TEK LIMITED
+000D00 Seaway Networks Inc.
+000D01 P&E Microcomputer Systems, Inc.
+000D02 NEC Access Technica,Ltd
+000D03 Matrics, Inc.
+000D04 Foxboro Eckardt Development GmbH
+000D05 cybernet manufacturing inc.
+000D06 Compulogic Limited
+000D07 Calrec Audio Ltd
+000D08 AboveCable, Inc.
+000D09 Yuehua(Zhuhai) Electronic CO. LTD
+000D0A Projectiondesign as
+000D0B Melco Inc.
+000D0C MDI Security Systems
+000D0D ITSupported, LLC
+000D0E Inqnet Systems, Inc.
+000D0F Finlux Ltd
+000D10 Embedtronics Oy
+000D11 DENTSPLY - Gendex
+000D12 AXELL Corporation
+000D13 Wilhelm Rutenbeck GmbH&Co.
+000D14 Vtech Innovation LP dba Advanced American Telephones
+000D15 Voipac s.r.o.
+000D16 UHS Systems Pty Ltd
+000D17 Turbo Networks Co.Ltd
+000D18 Sunitec Enterprise Co., Ltd.
+000D19 ROBE Show lighting
+000D1A Mustek System Inc.
+000D1B Kyoto Electronics Manufacturing Co., Ltd.
+000D1C I2E TELECOM
+000D1D HIGH-TEK HARNESS ENT. CO., LTD.
+000D1E Control Techniques
+000D1F AV Digital
+000D20 ASAHIKASEI TECHNOSYSTEM CO.,LTD.
+000D21 WISCORE Inc.
+000D22 Unitronics
+000D23 Smart Solution, Inc
+000D24 SENTEC E&E CO., LTD.
+000D25 SANDEN CORPORATION
+000D26 Primagraphics Limited
+000D27 MICROPLEX Printware AG
+000D28 Cisco
+000D29 Cisco
+000D2A Scanmatic AS
+000D2B Racal Instruments
+000D2C Patapsco Designs Ltd
+000D2D NCT Deutschland GmbH
+000D2E Matsushita Avionics Systems Corporation
+000D2F AIN Comm.Tech.Co., LTD
+000D30 IceFyre Semiconductor
+000D31 Compellent Technologies, Inc.
+000D32 DispenseSource, Inc.
+000D33 Prediwave Corp.
+000D34 Shell International Exploration and Production, Inc.
+000D35 PAC International Ltd
+000D36 Wu Han Routon Electronic Co., Ltd
+000D37 WIPLUG
+000D38 NISSIN INC.
+000D39 Network Electronics
+000D3A Microsoft Corp.
+000D3B Microelectronics Technology Inc.
+000D3C i.Tech Dynamic Ltd
+000D3E APLUX Communications Ltd.
+000D3F VXI Technology
+000D40 Verint Loronix Video Solutions
+000D41 Siemens AG ICM MP UC RD IT KLF1
+000D42 Newbest Development Limited
+000D43 DRS Tactical Systems Inc.
+000D45 Tottori SANYO Electric Co., Ltd.
+000D46 Eurotherm Drives, Ltd.
+000D47 Collex
+000D48 AEWIN Technologies Co., Ltd.
+000D49 Triton Systems of Delaware, Inc.
+000D4A Steag ETA-Optik
+000D4B Roku, LLC
+000D4C Outline Electronics Ltd.
+000D4D Ninelanes
+000D4E NDR Co.,LTD.
+000D4F Kenwood Corporation
+000D50 Galazar Networks
+000D51 DIVR Systems, Inc.
+000D52 Comart system
+000D53 Beijing 5w Communication Corp.
+000D54 3Com Europe Ltd
+000D55 SANYCOM Technology Co.,Ltd
+000D56 Dell PCBA Test
+000D57 Fujitsu I-Network Systems Limited.
+000D59 Amity Systems, Inc.
+000D5A Tiesse SpA
+000D5B Smart Empire Investments Limited
+000D5C Robert Bosch GmbH, VT-ATMO
+000D5D Raritan Computer, Inc
+000D5E NEC CustomTechnica, Ltd.
+000D5F Minds Inc
+000D60 IBM Corporation
+000D61 Giga-Byte Technology Co., Ltd.
+000D62 Funkwerk Dabendorf GmbH
+000D63 DENT Instruments, Inc.
+000D64 COMAG Handels AG
+000D65 Cisco Systems
+000D66 Cisco Systems
+000D67 BelAir Networks Inc.
+000D68 Vinci Systems, Inc.
+000D69 TMT&D Corporation
+000D6A Redwood Technologies LTD
+000D6B Mita-Teknik A/S
+000D6C M-Audio
+000D6D K-Tech Devices Corp.
+000D6E K-Patents Oy
+000D6F Ember Corporation
+000D70 Datamax Corporation
+000D71 boca systems
+000D72 2Wire, Inc
+000D73 Technical Support, Inc.
+000D74 Sand Network Systems, Inc.
+000D75 Kobian Pte Ltd - Taiwan Branch
+000D76 Hokuto Denshi Co,. Ltd.
+000D77 FalconStor Software
+000D78 Engineering & Security
+000D79 Dynamic Solutions Co,.Ltd.
+000D7A DiGATTO Asia Pacific Pte Ltd
+000D7B Consensys Computers Inc.
+000D7C Codian Ltd
+000D7D Afco Systems
+000D7E Axiowave Networks, Inc.
+000D7F MIDAS  COMMUNICATION TECHNOLOGIES PTE LTD ( Foreign Branch)
+000D80 Online Development Inc
+000D81 Pepperl+Fuchs GmbH
+000D82 PHS srl
+000D83 Sanmina-SCI Hungary  Ltd.
+000D84 Seodu Inchip, Inc.
+000D85 Tapwave, Inc.
+000D86 Huber + Suhner AG
+000D87 Elitegroup Computer System Co. (ECS)
+000D88 D-Link Corporation
+000D89 Bils Technology Inc
+000D8A Winners Electronics Co., Ltd.
+000D8B T&D Corporation
+000D8C Shanghai Wedone Digital Ltd. CO.
+000D8D ProLinx Communication Gateways, Inc.
+000D8E Koden Electronics Co., Ltd.
+000D8F King Tsushin Kogyo Co., LTD.
+000D90 Factum Electronics AB
+000D91 Eclipse (HQ Espana) S.L.
+000D92 Arima Communication Corporation
+000D93 Apple Computer
+000D94 AFAR Communications,Inc
+000D96 Vtera Technology Inc.
+000D97 Tropos Networks, Inc.
+000D98 S.W.A.C. Schmitt-Walter Automation Consult GmbH
+000D99 Orbital Sciences Corp.; Launch Systems Group
+000D9A INFOTEC LTD
+000D9C Elan GmbH & Co KG
+000D9D Hewlett Packard
+000D9E TOKUDEN OHIZUMI SEISAKUSYO Co.,Ltd.
+000D9F RF Micro Devices
+000DA0 NEDAP N.V.
+000DA1 MIRAE ITS Co.,LTD.
+000DA2 Infrant Technologies, Inc.
+000DA3 Emerging Technologies Limited
+000DA4 DOSCH & AMAND SYSTEMS AG
+000DA5 Fabric7 Systems, Inc
+000DA6 Universal Switching Corporation
+000DA8 Teletronics Technology Corporation
+000DA9 T.E.A.M. S.L.
+000DAA S.A.Tehnology co.,Ltd.
+000DAB Parker Hannifin GmbH Electromechanical Division Europe
+000DAC Japan CBM Corporation
+000DAD Dataprobe Inc
+000DAE SAMSUNG HEAVY INDUSTRIES CO., LTD.
+000DAF Plexus Corp (UK) Ltd
+000DB0 Olym-tech Co.,Ltd.
+000DB1 Japan Network Service Co., Ltd.
+000DB2 Ammasso, Inc.
+000DB3 SDO Communication Corperation
+000DB4 NETASQ
+000DB5 GLOBALSAT TECHNOLOGY CORPORATION
+000DB6 Teknovus, Inc.
+000DB7 SANKO ELECTRIC CO,.LTD
+000DB8 SCHILLER AG
+000DB9 PC Engines GmbH
+000DBA Océ Document Technologies GmbH
+000DBB Nippon Dentsu Co.,Ltd.
+000DBC Cisco Systems
+000DBD Cisco Systems
+000DBE Bel Fuse Europe Ltd.,UK
+000DBF TekTone Sound & Signal Mfg., Inc.
+000DC0 Spagat AS
+000DC1 SafeWeb Inc
+000DC3 First Communication, Inc.
+000DC4 Emcore Corporation
+000DC5 EchoStar International Corporation
+000DC6 DigiRose Technology Co., Ltd.
+000DC7 COSMIC ENGINEERING INC.
+000DC8 AirMagnet, Inc
+000DC9 THALES Elektronik Systeme GmbH
+000DCA Tait Electronics
+000DCB Petcomkorea Co., Ltd.
+000DCC NEOSMART Corp.
+000DCD GROUPE TXCOM
+000DCE Dynavac Technology Pte Ltd
+000DCF Cidra Corp.
+000DD0 TetraTec Instruments GmbH
+000DD1 Stryker Corporation
+000DD2 Simrad Optronics ASA
+000DD3 SAMWOO Telecommunication Co.,Ltd.
+000DD4 Revivio Inc.
+000DD5 O'RITE TECHNOLOGY CO.,LTD
+000DD7 Bright
+000DD8 BBN
+000DD9 Anton Paar GmbH
+000DDA ALLIED TELESIS K.K.
+000DDB AIRWAVE TECHNOLOGIES INC.
+000DDC VAC
+000DDD PROFÝLO TELRA ELEKTRONÝK SANAYÝ VE TÝCARET A.Þ.
+000DDE Joyteck Co., Ltd.
+000DDF Japan Image & Network Inc.
+000DE0 ICPDAS Co.,LTD
+000DE1 Control Products, Inc.
+000DE2 CMZ Sistemi Elettronici
+000DE3 AT Sweden AB
+000DE4 DIGINICS, Inc.
+000DE5 Samsung Thales
+000DE6 YOUNGBO ENGINEERING CO.,LTD
+000DE7 Snap-on OEM Group
+000DE8 Nasaco Electronics Pte. Ltd
+000DE9 Napatech Aps
+000DEA Kingtel Telecommunication Corp.
+000DEB CompXs Limited
+000DEC Cisco Systems
+000DED Cisco Systems
+000DEF Soc. Coop. Bilanciai
+000DF0 QCOM TECHNOLOGY INC.
+000DF1 IONIX INC.
+000DF3 Asmax Solutions
+000DF4 Watertek Co.
+000DF5 Teletronics International Inc.
+000DF6 Technology Thesaurus Corp.
+000DF7 Space Dynamics Lab
+000DF8 ORGA Kartensysteme GmbH
+000DF9 NDS Limited
+000DFA Micro Control Systems Ltd.
+000DFB Komax AG
+000DFC ITFOR Inc. resarch and development
+000DFD Huges Hi-Tech Inc.,
+000DFE Hauppauge Computer Works, Inc.
+000DFF CHENMING MOLD INDUSTRY CORP.
+000E01 ASIP Technologies Inc.
+000E02 Advantech AMT Inc.
+000E03 Aarohi Communications, Inc.
+000E05 WIRELESS MATRIX CORP.
+000E06 Team Simoco Ltd
+000E07 Sony Ericsson Mobile Communications AB
+000E08 Sipura Technology, Inc.
+000E09 Shenzhen Coship Software Co.,LTD.
+000E0B Netac Technology Co., Ltd.
+000E0C Intel Corporation
+000E0D HESCH Schröder GmbH
+000E0E ESA elettronica S.P.A.
+000E0F ERMME
+000E11 BDT Büro- und Datentechnik GmbH & Co. KG
+000E12 Adaptive Micro Systems Inc.
+000E13 Accu-Sort Systems inc.
+000E14 Visionary Solutions, Inc.
+000E15 Tadlys LTD
+000E16 SouthWing
+000E18 MyA Technology
+000E19 LogicaCMG Pty Ltd
+000E1B IAV GmbH
+000E1C Hach Company
+000E1F TCL Networks Equipment Co., Ltd.
+000E20 PalmSource, Inc.
+000E21 MTU Friedrichshafen GmbH
+000E23 Incipient, Inc.
+000E25 Hannae Technology Co., Ltd
+000E26 Gincom Technology Corp.
+000E27 Crere Networks, Inc.
+000E28 Dynamic Ratings P/L
+000E29 Shester Communications Inc
+000E2B Safari Technologies
+000E2C Netcodec co.
+000E2D Hyundai Digital Technology Co.,Ltd.
+000E2E Edimax Technology Co., Ltd.
+000E2F Disetronic Medical Systems AG
+000E30 AERAS Networks, Inc.
+000E31 Olympus BioSystems GmbH
+000E32 Kontron Medical
+000E33 Shuko Electronics Co.,Ltd
+000E34 NexxGenCity
+000E35 Intel Corp
+000E36 HEINESYS, Inc.
+000E37 Harms & Wende GmbH & Co.KG
+000E38 Cisco Systems
+000E39 Cisco Systems
+000E3A Cirrus Logic
+000E3B Hawking Technologies, Inc.
+000E3C TransAct Technoloiges Inc.
+000E3D Televic N.V.
+000E3E Sun Optronics Inc
+000E3F Soronti, Inc.
+000E40 Nortel Networks
+000E41 NIHON MECHATRONICS CO.,LTD.
+000E42 Motic Incoporation Ltd.
+000E43 G-Tek Electronics Sdn. Bhd.
+000E44 Digital 5, Inc.
+000E45 Beijing Newtry Electronic Technology Ltd
+000E46 Niigata Seimitsu Co.,Ltd.
+000E47 NCI System Co.,Ltd.
+000E48 Lipman TransAction Solutions
+000E49 Forsway Scandinavia AB
+000E4A Changchun Huayu WEBPAD Co.,LTD
+000E4B atrium c and i
+000E4C Bermai Inc.
+000E4D Numesa Inc.
+000E4E Waveplus Technology Co., Ltd.
+000E4F Trajet GmbH
+000E50 Thomson Multi Media
+000E51 tecna elettronica srl
+000E52 Optium Corporation
+000E53 AV TECH CORPORATION
+000E54 AlphaCell Wireless Ltd.
+000E55 AUVITRAN
+000E56 4G Systems GmbH
+000E57 Iworld Networking, Inc.
+000E58 Rincon Networks
+000E5A TELEFIELD inc.
+000E5B ParkerVision - Direct2Data
+000E5C Motorola BCS
+000E5D Com-X Networks
+000E5E Beijing Raisecom Science & Technology Development Co.,Ltd
+000E5F activ-net GmbH & Co. KG
+000E60 360SUN Digital Broadband Corporation
+000E61 MICROTROL LIMITED
+000E62 Nortel Networks
+000E63 Lemke Diagnostics GmbH
+000E64 Elphel, Inc
+000E65 TransCore
+000E66 Hitachi Advanced Digital, Inc.
+000E67 Eltis Microelectronics Ltd.
+000E68 E-TOP Network Technology Inc.
+000E69 China Electric Power Research Institute
+000E6A 3COM EUROPE LTD
+000E6B Janitza electronics GmbH
+000E6C Device Drivers Limited
+000E6D Murata Manufacturing Co., Ltd.
+000E6E MICRELEC  ELECTRONICS S.A
+000E6F IRIS Corporation Berhad
+000E70 in2 Networks
+000E71 Gemstar Technology Development Ltd.
+000E72 CTS electronics
+000E73 Tpack A/S
+000E74 Solar Telecom. Tech
+000E75 New York Air Brake Corp.
+000E76 GEMSOC INNOVISION INC.
+000E77 Decru, Inc.
+000E78 Amtelco
+000E79 Ample Communications Inc.
+000E7B Toshiba
+000E7D Electronics Line 3000 Ltd.
+000E7E Comprog Oy
+000E7F Hewlett Packard
+000E81 Instant802 Networks Inc.
+000E82 Commtech Wireless
+000E83 Cisco Systems
+000E84 Cisco Systems
+000E85 Catalyst Enterprises, Inc.
+000E86 Alcatel North America
+000E87 adp Gauselmann GmbH
+000E88 VIDEOTRON CORP.
+000E89 CLEMATIC
+000E8A Avara Technologies Pty. Ltd.
+000E8B Astarte Technology Co, Ltd.
+000E8C Siemens AG A&D ET
+000E8D Systems in Progress Holding GmbH
+000E8E SparkLAN Communications, Inc.
+000E8F Sercomm Corp.
+000E90 PONICO CORP.
+000E92 Millinet Co., Ltd.
+000E93 Milénio 3 Sistemas Electrónicos, Lda.
+000E94 Maas International BV
+000E95 Fujiya Denki Seisakusho Co.,Ltd.
+000E96 Cubic Defense Applications, Inc.
+000E97 Ultracker Technology CO., Inc
+000E98 Vitec CC, INC.
+000E99 Spectrum Digital, Inc
+000E9A BOE TECHNOLOGY GROUP CO.,LTD
+000E9C Pemstar
+000E9D Video Networks Ltd
+000E9E Topfield Co., Ltd
+000E9F TEMIC SDS GmbH
+000EA0 NetKlass Technology Inc.
+000EA1 Formosa Teletek Corporation
+000EA2 CyberGuard Corporation
+000EA3 CNCR-IT CO.,LTD,HangZhou P.R.CHINA
+000EA4 Certance Inc.
+000EA5 BLIP Systems
+000EA6 ASUSTEK COMPUTER INC.
+000EA7 Endace Inc Ltd.
+000EA8 United Technologists Europe Limited
+000EA9 Shanghai Xun Shi Communications Equipment Ltd. Co.
+000EAC MINTRON ENTERPRISE CO., LTD.
+000EAD Metanoia Technologies, Inc.
+000EAE GAWELL TECHNOLOGIES CORP.
+000EAF CASTEL
+000EB0 Solutions Radio BV
+000EB1 Newcotech,Ltd
+000EB2 Micro-Research Finland Oy
+000EB3 LeftHand Networks
+000EB4 GUANGZHOU GAOKE COMMUNICATIONS TECHNOLOGY CO.LTD.
+000EB5 Ecastle Electronics Co., Ltd.
+000EB6 Riverbed Technology, Inc.
+000EB7 Knovative, Inc.
+000EB8 Iiga co.,Ltd
+000EB9 HASHIMOTO Electronics Industry Co.,Ltd.
+000EBA HANMI SEMICONDUCTOR CO., LTD.
+000EBB Everbee Networks
+000EBC Cullmann GmbH
+000EBD Burdick, a Quinton Compny
+000EBE B&B Electronics Manufacturing Co.
+000EC0 Nortel Networks
+000EC1 MYNAH Technologies
+000EC2 Lowrance Electronics, Inc.
+000EC3 Logic Controls, Inc.
+000EC4 Iskra Transmission d.d.
+000EC6 ASIX ELECTRONICS CORP.
+000EC7 Appeal Telecom Co.,Ltd.
+000EC8 Zoran Corporation
+000EC9 YOKO Technology Corp.
+000ECB VineSys Technology
+000ECC Tableau
+000ECD SKOV A/S
+000ECE S.I.T.T.I. S.p.A.
+000ECF PROFIBUS Nutzerorganisation e.V.
+000ED0 Privaris, Inc.
+000ED1 Osaka Micro Computer.
+000ED2 Filtronic plc
+000ED3 Epicenter, Inc.
+000ED4 CRESITT INDUSTRIE
+000ED5 COPAN Systems Inc.
+000ED6 Cisco Systems
+000ED7 Cisco Systems
+000ED8 Aktino, Inc.
+000ED9 Aksys, Ltd.
+000EDA C-TECH UNITED CORP.
+000EDB XiNCOM Corp.
+000EDC Tellion INC.
+000EDD SHURE INCORPORATED
+000EDE REMEC, Inc.
+000EDF PLX Technology
+000EE0 Mcharge
+000EE1 ExtremeSpeed Inc.
+000EE2 Custom Engineering S.p.A.
+000EE3 Chiyu Technology Co.,Ltd
+000EE5 bitWallet, Inc.
+000EE6 Adimos Systems LTD
+000EE7 AAC ELECTRONICS CORP.
+000EE8 zioncom
+000EE9 WayTech Development, Inc.
+000EEA Shadong Luneng Jicheng Electronics,Co.,Ltd
+000EEB Sandmartin(zhong shan)Electronics Co.,Ltd
+000EEC Orban
+000EED Nokia Danmark A/S
+000EEE Muco Industrie BV
+000EF0 Festo AG & Co. KG
+000EF1 EZQUEST INC.
+000EF3 Smarthome
+000EF4 Shenzhen Kasda Digital Technology Co.,Ltd
+000EF5 iPAC Technology Co., Ltd.
+000EF6 E-TEN Information Systems Co., Ltd.
+000EF7 Vulcan Portals Inc
+000EF8 SBC ASI
+000EF9 REA Elektronik GmbH
+000EFA Optoway Technology Incorporation
+000EFB Macey Enterprises
+000EFC JTAG Technologies B.V.
+000EFD FUJI PHOTO OPTICAL CO., LTD.
+000EFE EndRun Technologies LLC
+000EFF Megasolution,Inc.
+000F00 Legra Systems, Inc.
+000F01 DIGITALKS INC
+000F02 Digicube Technology Co., Ltd
+000F03 COM&C CO., LTD
+000F04 cim-usa inc
+000F05 3B SYSTEM INC.
+000F06 Nortel Networks
+000F07 Mangrove Systems, Inc.
+000F08 Indagon Oy
+000F0B Kentima Technologies AB
+000F0C SYNCHRONIC ENGINEERING
+000F0D Hunt Electronic Co., Ltd.
+000F0E WaveSplitter Technologies, Inc.
+000F0F Real ID Technology Co., Ltd.
+000F10 RDM Corporation
+000F11 Prodrive B.V.
+000F12 Panasonic AVC Networks Germany GmbH
+000F13 Nisca corporation
+000F14 Mindray Co., Ltd.
+000F15 Kjaerulff1 A/S
+000F16 JAY HOW TECHNOLOGY CO.,
+000F17 Insta Elektro GmbH
+000F18 Industrial Control Systems
+000F19 Guidant Corporation
+000F1A Gaming Support B.V.
+000F1B Ego Systems Inc.
+000F1C DigitAll World Co., Ltd
+000F1D Cosmo Techs Co., Ltd.
+000F1E Chengdu KT Electric Co.of High & New Technology
+000F1F WW PCBA Test
+000F20 WW Ops
+000F21 Scientific Atlanta, Inc
+000F22 Helius, Inc.
+000F23 Cisco Systems
+000F24 Cisco Systems
+000F25 AimValley B.V.
+000F26 WorldAccxx  LLC
+000F27 TEAL Electronics, Inc.
+000F28 Itronix Corporation
+000F29 Augmentix Corporation
+000F2A Cableware Electronics
+000F2B GREENBELL SYSTEMS
+000F2C Uplogix, Inc.
+001000 CABLE TELEVISION LABORATORIES, INC.
 001001 MCK COMMUNICATIONS
 001002 ACTIA
 001003 IMATRON, INC.
 001004 THE BRANTLEY COILE COMPANY,INC
 001005 UEC COMMERCIAL
-001006 RACAL RECORDERS LTD.
+001006 Thales Contact Solutions Ltd.
 001007 CISCO SYSTEMS, INC.
 001008 VIENNA SYSTEMS CORPORATION
 001009 HORO QUARTZ
@@ -1673,20 +3787,20 @@
 001012 PROCESSOR SYSTEMS (I) PVT LTD
 001013 INDUSTRIAL COMPUTER SOURCE
 001014 CISCO SYSTEMS, INC.
-001015 OOMON INC.
+001015 OOmon Inc.
 001016 T.SQWARE
-001017 MICOS GMBH
+001017 MICOS GmbH
 001018 BROADCOM CORPORATION
-001019 SIRONA DENTAL SYSTEMS
-00101A PICTURETEL CORP.
+001019 SIRONA DENTAL SYSTEMS GmbH & Co. KG
+00101A PictureTel Corp.
 00101B CORNET TECHNOLOGY, INC.
 00101C OHM TECHNOLOGIES INTL, LLC
 00101D WINBOND ELECTRONICS CORP.
-00101E MATSUSHITA ELECTRONIC
+00101E MATSUSHITA ELECTRONIC INSTRUMENTS CORP.
 00101F CISCO SYSTEMS, INC.
 001020 WELCH ALLYN, DATA COLLECTION
 001021 ENCANTO NETWORKS, INC.
-001022 SATCOM MEDIA CORPORATION
+001022 SatCom Media Corporation
 001023 FLOWWISE NETWORKS, INC.
 001024 NAGOYA ELECTRIC WORKS CO., LTD
 001025 GRAYHILL INC.
@@ -1698,18 +3812,18 @@
 00102B UMAX DATA SYSTEMS, INC.
 00102C Lasat Networks A/S
 00102D HITACHI SOFTWARE ENGINEERING
-00102E NETWORK SYSTEMS & TECHNOLOGIES
+00102E NETWORK SYSTEMS & TECHNOLOGIES PVT. LTD.
 00102F CISCO SYSTEMS, INC.
-001030 WI-LAN, INC.
+001030 Wi-LAN, Inc.
 001031 OBJECTIVE COMMUNICATIONS, INC.
 001032 ALTA TECHNOLOGY
 001033 ACCESSLAN COMMUNICATIONS, INC.
-001034 GNP COMPUTERS
-001035 ELITEGROUP COMPUTER
+001034 GNP Computers
+001035 ELITEGROUP COMPUTER SYSTEMS CO., LTD
 001036 INTER-TEL INTEGRATED SYSTEMS
-001037 CYQ'VE TECHNOLOGY CO., LTD.
+001037 CYQ've Technology Co., Ltd.
 001038 MICRO RESEARCH INSTITUTE, INC.
-001039 VECTRON SYSTEMS GMBH
+001039 Vectron Systems AG
 00103A DIAMOND NETWORK TECH
 00103B HIPPI NETWORKING FORUM
 00103C IC ENSEMBLE, INC.
@@ -1718,9 +3832,9 @@
 00103F TOLLGRADE COMMUNICATIONS, INC.
 001040 INTERMEC CORPORATION
 001041 BRISTOL BABCOCK, INC.
-001042 ALACRITECH
+001042 AlacriTech
 001043 A2 CORPORATION
-001044 INNOLABS CORPORATION
+001044 InnoLabs Corporation
 001045 Nortel Networks
 001046 ALCORN MCBRIDE INC.
 001047 ECHO ELETRIC CO. LTD.
@@ -1740,12 +3854,12 @@
 001055 FUJITSU MICROELECTRONICS, INC.
 001056 SODICK CO., LTD.
 001057 Rebel.com, Inc.
-001058 ARROWPOINT COMMUNICATIONS,INC.
+001058 ArrowPoint Communications
 001059 DIABLO RESEARCH CO. LLC
 00105A 3COM CORPORATION
 00105B NET INSIGHT AB
 00105C QUANTUM DESIGNS (H.K.) LTD.
-00105D DRAGER, BUSINESS UNIT
+00105D Draeger Medical
 00105E HEKIMIAN LABORATORIES, INC.
 00105F IN-SNEC
 001060 BILLIONTON SYSTEMS, INC.
@@ -1760,7 +3874,7 @@
 001069 HELIOSS COMMUNICATIONS, INC.
 00106A DIGITAL MICROWAVE CORPORATION
 00106B SONUS NETWORKS, INC.
-00106C INFRATEC PLUS GMBH
+00106C INFRATEC PLUS GmbH
 00106D INTEGRITY COMMUNICATIONS, INC.
 00106E TADIRAN COM. LTD.
 00106F TRENTON TECHNOLOGY INC.
@@ -1770,15 +3884,15 @@
 001073 TECHNOBOX, INC.
 001074 ATEN INTERNATIONAL CO., LTD.
 001075 Maxtor Corporation
-001076 EUREM GMBH
+001076 EUREM GmbH
 001077 SAF DRIVE SYSTEMS, LTD.
 001078 NUERA COMMUNICATIONS, INC.
 001079 CISCO SYSTEMS, INC.
-00107A AMBICOM, INC.
+00107A AmbiCom, Inc.
 00107B CISCO SYSTEMS, INC.
 00107C P-COM, INC.
 00107D AURORA COMMUNICATIONS, LTD.
-00107E BACHMANN ELECTRONIC GMBH
+00107E BACHMANN ELECTRONIC GmbH
 00107F CRESTRON ELECTRONICS, INC.
 001080 METAWAVE COMMUNICATIONS
 001081 DPS, INC.
@@ -1789,23 +3903,23 @@
 001086 ATTO TECHNOLOGY, INC.
 001087 Xstreamis PLC
 001088 AMERICAN NETWORKS INC.
-001089 WEBSONIC
-00108A TERALOGIC, INC.
-00108B LASERANIMATION SOLLINGER GMBH
-00108C FUJITSU TELECOMMUNICATIONS
+001089 WebSonic
+00108A TeraLogic, Inc.
+00108B LASERANIMATION SOLLINGER GmbH
+00108C FUJITSU TELECOMMUNICATIONS EUROPE, LTD.
 00108D JOHNSON CONTROLS, INC.
-00108E HUGH SYMONS CONCEPT
+00108E HUGH SYMONS CONCEPT Technologies Ltd.
 00108F RAPTOR SYSTEMS
 001090 CIMETRICS, INC.
 001091 NO WIRES NEEDED BV
 001092 NETCORE INC.
 001093 CMS COMPUTERS, LTD.
-001094 ADTECH, INC.
-001095 THOMSON CONSUMER ELECTRONICS
+001094 Performance Analysis Broadband, Spirent plc
+001095 Thomson Multimedia, Inc.
 001096 TRACEWELL SYSTEMS, INC.
-001097 WINNET METROPOLITAN
+001097 WinNet Metropolitan Communications Systems, Inc.
 001098 STARNET TECHNOLOGIES, INC.
-001099 INNOMEDIA, INC.
+001099 InnoMedia, Inc.
 00109A NETLINE
 00109B VIXEL CORPORATION
 00109C M-SYSTEM CO., LTD.
@@ -1840,10 +3954,10 @@
 0010B9 MAXTOR CORP.
 0010BA MARTINHO-DAVIS SYSTEMS, INC.
 0010BB DATA & INFORMATION TECHNOLOGY
-0010BC Nortel Networks
-0010BD THE TELECOMMUNICATION
+0010BC Aastra Telecom
+0010BD THE TELECOMMUNICATION TECHNOLOGY COMMITTEE
 0010BE TELEXIS CORP.
-0010BF INTER AIR WIRELESS
+0010BF InterAir Wireless
 0010C0 ARMA, INC.
 0010C1 OI ELECTRIC CO., LTD.
 0010C2 WILLNET, INC.
@@ -1852,11 +3966,11 @@
 0010C5 PROTOCOL TECHNOLOGIES, INC.
 0010C6 USI
 0010C7 DATA TRANSMISSION NETWORK
-0010C8 COMMUNICATIONS ELECTRONICS
-0010C9 MITSUBISHI ELECTRONICS
+0010C8 COMMUNICATIONS ELECTRONICS SECURITY GROUP
+0010C9 MITSUBISHI ELECTRONICS LOGISTIC SUPPORT CO.
 0010CA INTEGRAL ACCESS
 0010CB FACIT K.K.
-0010CC CLP COMPUTER LOGISTIK
+0010CC CLP COMPUTER LOGISTIK PLANUNG GmbH
 0010CD INTERFACE CONCEPT
 0010CE VOLAMP, LTD.
 0010CF FIBERLANE COMMUNICATIONS
@@ -1866,40 +3980,39 @@
 0010D3 GRIPS ELECTRONIC GMBH
 0010D4 STORAGE COMPUTER CORPORATION
 0010D5 IMASDE CANARIAS, S.A.
-0010D6 ITT A/CD
+0010D6 ITT - A/CD
 0010D7 ARGOSY RESEARCH INC.
 0010D8 CALISTA
 0010D9 IBM JAPAN, FUJISAWA MT+D
 0010DA MOTION ENGINEERING, INC.
-0010DB NETSCREEN TECHNOLOGIES, INC.
-0010DC MICRO-STAR INTERNATIONAL
+0010DB NetScreen Technologies, Inc.
+0010DC MICRO-STAR INTERNATIONAL CO., LTD.
 0010DD ENABLE SEMICONDUCTOR, INC.
-0010DE INTERNATIONAL DATACASTING
+0010DE INTERNATIONAL DATACASTING CORPORATION
 0010DF RISE COMPUTER INC.
 0010E0 COBALT MICROSERVER, INC.
 0010E1 S.I. TECH, INC.
-0010E2 ARRAYCOMM, INC.
+0010E2 ArrayComm, Inc.
 0010E3 COMPAQ COMPUTER CORPORATION
 0010E4 NSI CORPORATION
 0010E5 SOLECTRON TEXAS
-0010E6 APPLIED INTELLIGENT
-0010E7 BREEZECOM
+0010E6 APPLIED INTELLIGENT SYSTEMS, INC.
+0010E7 BreezeCom
 0010E8 TELOCITY, INCORPORATED
 0010E9 RAIDTEC LTD.
 0010EA ADEPT TECHNOLOGY
-0010EB SELSIUS SYSTEMS, ILNC.
+0010EB SELSIUS SYSTEMS, INC.
 0010EC RPCG, LLC
 0010ED SUNDANCE TECHNOLOGY, INC.
 0010EE CTI PRODUCTS, INC.
-0010EF DB NETWORKS, INC.
-0010F0 RITTAL-WERK RUDOLF LOH
+0010EF DBTEL INCORPORATED
 0010F1 I-O CORPORATION
 0010F2 ANTEC
-0010F3 NEXCOM INTERNATIONAL CO., LTD.
+0010F3 Nexcom International Co., Ltd.
 0010F4 VERTICAL NETWORKS, INC.
 0010F5 AMHERST SYSTEMS, INC.
 0010F6 CISCO SYSTEMS, INC.
-0010F7 IRIICHI TECHNOLOGIES
+0010F7 IRIICHI TECHNOLOGIES Inc.
 0010F8 KENWOOD TMI CORPORATION
 0010F9 UNIQUE SYSTEMS, INC.
 0010FA ZAYANTE, INC.
@@ -1934,14 +4047,14 @@
 002016 SHOWA ELECTRIC WIRE & CABLE CO
 002017 ORBOTECH
 002018 CIS TECHNOLOGY INC.
-002019 OHLER GMBH
+002019 OHLER GmbH
 00201A N-BASE SWITCH COMMUNICATIONS
 00201B NORTHERN TELECOM/NETWORK
 00201C EXCEL, INC.
 00201D KATANA PRODUCTS
 00201E NETQUEST CORPORATION
 00201F BEST POWER TECHNOLOGY, INC.
-002020 MEGATRON COMPUTER INDUSTRIES
+002020 MEGATRON COMPUTER INDUSTRIES PTY, LTD.
 002021 ALGORITHMS SOFTWARE PVT. LTD.
 002022 TEKNIQUE, INC.
 002023 T.C. TECHNOLOGIES PTY. LTD
@@ -1952,26 +4065,26 @@
 002028 WEST EGG SYSTEMS, INC.
 002029 TELEPROCESSING PRODUCTS, INC.
 00202A N.V. DZINE
-00202B ADVANCED TELECOMMUNICATIONS
+00202B ADVANCED TELECOMMUNICATIONS MODULES, LTD.
 00202C WELLTRONIX CO., LTD.
 00202D TAIYO CORPORATION
 00202E DAYSTAR DIGITAL
 00202F ZETA COMMUNICATIONS, LTD.
 002030 ANALOG & DIGITAL SYSTEMS
-002031 ERTEC GMBH
+002031 ERTEC GmbH
 002032 ALCATEL TAISEL
 002033 SYNAPSE TECHNOLOGIES, INC.
 002034 ROTEC INDUSTRIEAUTOMATION GMBH
 002035 IBM CORPORATION
 002036 BMC SOFTWARE
 002037 SEAGATE TECHNOLOGY
-002038 VME MICROSYSTEMS INTERNATIONAL
+002038 VME MICROSYSTEMS INTERNATIONAL CORPORATION
 002039 SCINETS
 00203A DIGITAL BI0METRICS INC.
 00203B WISDM LTD.
 00203C EUROTIME AB
 00203D NOVAR ELECTRONICS CORPORATION
-00203E LOGICAN TECHNOLOGIES, INC.
+00203E LogiCan Technologies, Inc.
 00203F JUKI CORPORATION
 002040 Motorola Broadband Communications Sector
 002041 DATA NET
@@ -1990,22 +4103,22 @@
 00204E NETWORK SECURITY SYSTEMS, INC.
 00204F DEUTSCHE AEROSPACE AG
 002050 KOREA COMPUTER INC.
-002051 PHOENIX DATA COMMUNUNICATIONS
+002051 Verilink Corporation
 002052 RAGULA SYSTEMS
 002053 HUNTSVILLE MICROSYSTEMS, INC.
 002054 EASTERN RESEARCH, INC.
 002055 ALTECH CO., LTD.
 002056 NEOPRODUCTS
-002057 TITZE DATENTECHNIK GMBH
+002057 TITZE DATENTECHNIK GmbH
 002058 ALLIED SIGNAL INC.
 002059 MIRO COMPUTER PRODUCTS AG
 00205A COMPUTER IDENTICS
 00205B SKYLINE TECHNOLOGY
-00205C INTERNET SYSTEMS/ FLORIDA INC.
+00205C InterNet Systems of Florida, Inc.
 00205D NANOMATIC OY
 00205E CASTLE ROCK, INC.
 00205F GAMMADATA COMPUTER GMBH
-002060 ALCATEL ITALIA S.P.A.
+002060 ALCATEL ITALIA S.p.A.
 002061 DYNATECH COMMUNICATIONS, INC.
 002062 SCORPION LOGIC, LTD.
 002063 WIPRO INFOTECH LTD.
@@ -2015,7 +4128,7 @@
 002068 ISDYNE
 002069 ISDN SYSTEMS CORPORATION
 00206A OSAKA COMPUTER CORP.
-00206B MINOLTA CO., LTD.
+00206B KONICA MINOLTA HOLDINGS, INC.
 00206C EVERGREEN TECHNOLOGY CORP.
 00206D DATA RACE, INC.
 00206E XACT, INC.
@@ -2030,11 +4143,11 @@
 002077 KARDIOS SYSTEMS CORP.
 002078 RUNTOP, INC.
 002079 MIKRON GMBH
-00207A WISE COMMUNICATIONS, INC.
-00207B LEVEL ONE COMMUNICATIONS
-00207C AUTEC GMBH
+00207A WiSE Communications, Inc.
+00207B Intel Corporation
+00207C AUTEC GmbH
 00207D ADVANCED COMPUTER APPLICATIONS
-00207E FINECOM CO., LTD.
+00207E FINECOM Co., Ltd.
 00207F KYOEI SANGYO CO., LTD.
 002080 SYNERGY (UK) LTD.
 002081 TITAN ELECTRONICS
@@ -2052,13 +4165,13 @@
 00208D CMD TECHNOLOGY
 00208E CHEVIN SOFTWARE ENG. LTD.
 00208F ECI TELECOM LTD.
-002090 ADVANCED COMPRESSION
+002090 ADVANCED COMPRESSION TECHNOLOGY, INC.
 002091 J125, NATIONAL SECURITY AGENCY
 002092 CHESS ENGINEERING B.V.
 002093 LANDINGS TECHNOLOGY CORP.
 002094 CUBIX CORPORATION
 002095 RIVA ELECTRONICS
-002096 SIEBE ENVIRONMENTAL CONTROLS
+002096 Invensys
 002097 APPLIED SIGNAL TECHNOLOGY
 002098 HECTRONIC AB
 002099 BON ELECTRIC CO., LTD.
@@ -2066,7 +4179,7 @@
 00209B ERSAT ELECTRONIC GMBH
 00209C PRIMARY ACCESS CORP.
 00209D LIPPERT AUTOMATIONSTECHNIK
-00209E BROWN'S OPERATING SYSTEM
+00209E BROWN'S OPERATING SYSTEM SERVICES, LTD.
 00209F MERCURY COMPUTER SYSTEMS, INC.
 0020A0 OA LABORATORY CO., LTD.
 0020A1 DOVATRON
@@ -2086,7 +4199,7 @@
 0020AF 3COM CORPORATION
 0020B0 GATEWAY DEVICES, INC.
 0020B1 COMTECH RESEARCH INC.
-0020B2 GKD GESELLSCHAFT FUR
+0020B2 GKD Gesellschaft Fur Kommunikation Und Datentechnik
 0020B3 SCLTEC COMMUNICATIONS SYSTEMS
 0020B4 TERMA ELEKTRONIK AS
 0020B5 YASKAWA ELECTRIC CORPORATION
@@ -2123,18 +4236,18 @@
 0020D4 CABLETRON - ZEITTNET INC.
 0020D5 VIPA GMBH
 0020D6 BREEZECOM
-0020D7 JAPAN MINICOMPUTER SYSTEMS CO.
-0020D8 NETWAVE TECHNOLOGIES, INC.
-0020D9 PANASONIC TECHNOLOGIES, INC./
+0020D7 JAPAN MINICOMPUTER SYSTEMS CO., Ltd.
+0020D8 Nortel Networks
+0020D9 PANASONIC TECHNOLOGIES, INC./MIECO-US
 0020DA XYLAN CORPORATION
 0020DB XNET TECHNOLOGY, INC.
 0020DC DENSITRON TAIWAN LTD.
-0020DD AWA LTD.
+0020DD Cybertec Pty Ltd
 0020DE JAPAN DIGITAL LABORAT'Y CO.LTD
 0020DF KYOSAN ELECTRIC MFG. CO., LTD.
 0020E0 PREMAX ELECTRONICS, INC.
 0020E1 ALAMAR ELECTRONICS
-0020E2 INFORMATION RESOURCE
+0020E2 INFORMATION RESOURCE ENGINEERING
 0020E3 MCD KENCOM CORPORATION
 0020E4 HSING TECH ENTERPRISE CO., LTD
 0020E5 APEX DATA, INC.
@@ -2214,7 +4327,7 @@
 00302F Smiths Industries
 003030 HARMONIX CORPORATION
 003031 LIGHTWAVE COMMUNICATIONS, INC.
-003032 MAGICRAM, INC.
+003032 MagicRam, Inc.
 003033 ORIENT TELECOM CO., LTD.
 003036 RMP ELEKTRONIKSYSTEME GMBH
 003037 Packard Bell Nec Services
@@ -2323,7 +4436,7 @@
 00309E WORKBIT CORPORATION.
 00309F AMBER NETWORKS
 0030A0 TYCO SUBMARINE SYSTEMS, LTD.
-0030A1 OPTI TECH CO., LTD.
+0030A1 WEBGATE Inc.
 0030A2 Lightner Engineering
 0030A3 CISCO SYSTEMS, INC.
 0030A4 Woodwind Communications System
@@ -2337,7 +4450,7 @@
 0030AC Systeme Lauer GmbH & Co., Ltd.
 0030AD SHANGHAI COMMUNICATION
 0030AE Times N System, Inc.
-0030AF Honeywell Reqelsysteme GmbH
+0030AF Honeywell GmbH
 0030B0 Convergenet Technologies
 0030B1 GOC GESELLSCHAFT FUR OPTISCHE
 0030B2 WESCAM - HEALDSBURG
@@ -2531,7 +4644,7 @@
 00406F SYNC RESEARCH INC.
 004070 INTERWARE CO., LTD.
 004071 ATM COMPUTER GMBH
-004072 APPLIED INNOVATION, INC.
+004072 Applied Innovation Inc.
 004073 BASS ASSOCIATES
 004074 CABLE AND WIRELESS
 004075 M-TRADE (UK) LTD
@@ -2544,7 +4657,7 @@
 00407C QUME CORPORATION
 00407D EXTENSION TECHNOLOGY CORP.
 00407E EVERGREEN SYSTEMS, INC.
-00407F AGEMA INFRARED SYSTEMS AB
+00407F FLIR Systems
 004080 ATHENIX CORPORATION
 004081 MANNESMANN SCANGRAPHIC GMBH
 004082 LABORATORY EQUIPMENT CORP.
@@ -2673,34 +4786,35 @@
 0040FD LXE
 0040FE SYMPLEX COMMUNICATIONS
 0040FF TELEBIT CORPORATION
+004252 RLX Technologies
 005000 NEXO COMMUNICATIONS, INC.
 005001 YAMASHITA SYSTEMS CORP.
 005002 OMNISEC AG
 005003 GRETAG MACBETH AG
 005004 3COM CORPORATION
 005006 TAC AB
-005007 SIEMENS TELECOMMUNICATION
+005007 SIEMENS TELECOMMUNICATION SYSTEMS LIMITED
 005008 TIVA MICROCOMPUTER CORP. (TMC)
 005009 PHILIPS BROADBAND NETWORKS
 00500A IRIS TECHNOLOGIES, INC.
 00500B CISCO SYSTEMS, INC.
-00500C ETEK LABS, INC.
+00500C e-Tek Labs, Inc.
 00500D SATORI ELECTORIC CO., LTD.
-00500E CHROMATIS NETWORKS,INC.
+00500E CHROMATIS NETWORKS, INC.
 00500F CISCO SYSTEMS, INC.
-005010 NOVANET LEARNING, INC.
+005010 NovaNET Learning, Inc.
 005012 CBL - GMBH
-005013 Chaparral Technologies, Inc.
+005013 Chaparral Network Storage
 005014 CISCO SYSTEMS, INC.
 005015 BRIGHT STAR ENGINEERING
 005016 SST/WOODHEAD INDUSTRIES
 005017 RSR S.R.L.
-005018 ADVANCED MULTIMEDIA INTERNET
+005018 ADVANCED MULTIMEDIA INTERNET TECHNOLOGY INC.
 005019 SPRING TIDE NETWORKS, INC.
 00501A UISIQN
 00501B ABL CANADA, INC.
 00501C JATOM SYSTEMS, INC.
-00501E MIRANDA TECHNOLOGIES, INC.
+00501E Miranda Technologies, Inc.
 00501F MRG SYSTEMS, LTD.
 005020 MEDIASTAR CO., LTD.
 005021 EIS INTERNATIONAL, INC.
@@ -2716,7 +4830,7 @@
 00502C SOYO COMPUTER, INC.
 00502D ACCEL, INC.
 00502E CAMBEX CORPORATION
-00502F TOLLBRIDGE TECHNOLOGIES, INC.
+00502F TollBridge Technologies, Inc.
 005030 FUTURE PLUS SYSTEMS
 005031 AEROFLEX LABORATORIES, INC.
 005032 PICAZO COMMUNICATIONS, INC.
@@ -2732,7 +4846,7 @@
 00503F ANCHOR GAMES
 005040 EMWARE, INC.
 005041 CTX OPTO ELECTRONIC CORP.
-005042 SCI MANUFACTURING
+005042 SCI MANUFACTURING SINGAPORE PTE, LTD.
 005043 MARVELL SEMICONDUCTOR, INC.
 005044 ASACA CORPORATION
 005045 RIOWORKS SOLUTIONS, INC.
@@ -2751,10 +4865,10 @@
 005053 CISCO SYSTEMS, INC.
 005054 CISCO SYSTEMS, INC.
 005055 DOMS A/S
-005056 VMWARE, INC.
+005056 VMWare, Inc.
 005057 BROADBAND ACCESS SYSTEMS
 005058 VEGASTREAM LIMITED
-005059 SUITE TECHNOLOGY SYSTEMS
+005059 SUITE TECHNOLOGY SYSTEMS NETWORK
 00505A NETWORK ALCHEMY, INC.
 00505B KAWASAKI LSI U.S.A., INC.
 00505C TUNDO CORPORATION
@@ -2765,10 +4879,10 @@
 005063 OY COMSEL SYSTEM AB
 005064 CAE ELECTRONICS
 005065 DENSEI-LAMBAD Co., Ltd.
-005066 ATECOM GMBH ADVANCED
+005066 AtecoM GmbH advanced telecomunication modules
 005067 AEROCOMM, INC.
-005068 ELECTRONIC INDUSTRIES
-005069 PIXSTREAM INCORPORATED
+005068 ELECTRONIC INDUSTRIES ASSOCIATION
+005069 PixStream Incorporated
 00506A EDEVA, INC.
 00506B SPX-ATEG
 00506C G & L BEIJER ELECTRONICS AB
@@ -2789,7 +4903,7 @@
 00507C VIDEOCON AG
 00507D IFP
 00507E NEWER TECHNOLOGY
-00507F DRAYTEK CORP.
+00507F DrayTek Corp.
 005080 CISCO SYSTEMS, INC.
 005081 MURATA MACHINERY, LTD.
 005082 FORESSON CORPORATION
@@ -2811,29 +4925,29 @@
 005094 PACE MICRO TECHNOLOGY PLC
 005095 PERACOM NETWORKS
 005096 SALIX TECHNOLOGIES, INC.
-005097 MMC-EMBEDDED
+005097 MMC-EMBEDDED COMPUTERTECHNIK GmbH
 005098 GLOBALOOP, LTD.
 005099 3COM EUROPE, LTD.
 00509A TAG ELECTRONIC SYSTEMS
 00509B SWITCHCORE AB
 00509C BETA RESEARCH
 00509D THE INDUSTREE B.V.
-00509E LES TECHNOLOGIES
+00509E Les Technologies SoftAcoustik Inc.
 00509F HORIZON COMPUTER
 0050A0 DELTA COMPUTER SYSTEMS, INC.
 0050A1 CARLO GAVAZZI, INC.
 0050A2 CISCO SYSTEMS, INC.
-0050A3 TRANSMEDIA COMMUNICATIONS, INC
+0050A3 TransMedia Communications, Inc.
 0050A4 IO TECH, INC.
 0050A5 CAPITOL BUSINESS SYSTEMS, LTD.
 0050A6 OPTRONICS
 0050A7 CISCO SYSTEMS, INC.
-0050A8 OPENCON SYSTEMS, INC.
+0050A8 OpenCon Systems, Inc.
 0050A9 MOLDAT WIRELESS TECHNOLGIES
-0050AA KONICA CORPORATION
+0050AA KONICA MINOLTA HOLDINGS, INC.
 0050AB NALTEC, INC.
 0050AC MAPLE COMPUTER CORPORATION
-0050AD COMMUNIQUE WIRELESS CORP.
+0050AD CommUnique Wireless Corp.
 0050AE IWAKI ELECTRONICS CO., LTD.
 0050AF INTERGON, INC.
 0050B0 TECHNOLOGY ATLANTA CORPORATION
@@ -2857,7 +4971,7 @@
 0050C2 IEEE REGISTRATION AUTHORITY
 0050C4 IMD
 0050C5 ADS TECHNOLOGIES, INC.
-0050C6 LOOP TELECOMMUNICATION
+0050C6 LOOP TELECOMMUNICATION INTERNATIONAL, INC.
 0050C8 ADDONICS COMMUNICATIONS, INC.
 0050C9 MASPRO DENKOH CORP.
 0050CA NET TO NET TECHNOLOGIES
@@ -2865,52 +4979,52 @@
 0050CC XYRATEX
 0050CD DIGIANSWER A/S
 0050CE LG INTERNATIONAL CORP.
-0050CF VANLINK COMMUNICATION
+0050CF VANLINK COMMUNICATION TECHNOLOGY RESEARCH INSTITUTE
 0050D0 MINERVA SYSTEMS
 0050D1 CISCO SYSTEMS, INC.
 0050D2 BAE Systems Canada, Inc.
-0050D3 DIGITAL AUDIO
+0050D3 DIGITAL AUDIO PROCESSING PTY. LTD.
 0050D4 JOOHONG INFORMATION &
 0050D5 AD SYSTEMS CORP.
 0050D6 ATLAS COPCO TOOLS AB
 0050D7 TELSTRAT
 0050D8 UNICORN COMPUTER CORP.
-0050D9 ENGETRON-ENGENHARIA ELETRONICA
+0050D9 ENGETRON-ENGENHARIA ELETRONICA IND. e COM. LTDA
 0050DA 3COM CORPORATION
 0050DB CONTEMPORARY CONTROL
-0050DC TAS TELEFONBAU A. SCHWABE
+0050DC TAS TELEFONBAU A. SCHWABE GMBH & CO. KG
 0050DD SERRA SOLDADURA, S.A.
 0050DE SIGNUM SYSTEMS CORP.
-0050DF AIRFIBER, INC.
+0050DF AirFiber, Inc.
 0050E1 NS TECH ELECTRONICS SDN BHD
 0050E2 CISCO SYSTEMS, INC.
-0050E3 TELEGATE
+0050E3 Terayon Communications Systems
 0050E4 APPLE COMPUTER, INC.
 0050E6 HAKUSAN CORPORATION
 0050E7 PARADISE INNOVATIONS (ASIA)
 0050E8 NOMADIX INC.
-0050EA XEL COMMUNICTIONS, INC.
+0050EA XEL COMMUNICATIONS, INC.
 0050EB ALPHA-TOP CORPORATION
 0050EC OLICOM A/S
 0050ED ANDA NETWORKS
 0050EE TEK DIGITEL CORPORATION
-0050EF SPE SYSTEMHAUS GMBH
+0050EF SPE Systemhaus GmbH
 0050F0 CISCO SYSTEMS, INC.
 0050F1 LIBIT SIGNAL PROCESSING, LTD.
 0050F2 MICROSOFT CORP.
-0050F3 GLOBAL NET INFORMATION CO.,LTD
+0050F3 GLOBAL NET INFORMATION CO., Ltd.
 0050F4 SIGMATEK GMBH & CO. KG
-0050F6 PAN-INTERNATIONAL
-0050F7 VENTURE MANUFACTURING
+0050F6 PAN-INTERNATIONAL INDUSTRIAL CORP.
+0050F7 VENTURE MANUFACTURING (SINGAPORE) LTD.
 0050F8 ENTREGA TECHNOLOGIES, INC.
 0050FA OXTEL, LTD.
 0050FB VSK ELECTRONICS
 0050FC EDIMAX TECHNOLOGY CO., LTD.
-0050FD ISIONCOMM CO., LTD.
-0050FE PCTVNET ASA
+0050FD VISIONCOMM CO., LTD.
+0050FE PCTVnet ASA
 0050FF HAKKO ELECTRONICS CO., LTD.
 006000 XYCOM INC.
-006001 INNOSYS, INC.
+006001 InnoSys, Inc.
 006002 SCREEN SUBTITLING SYSTEMS, LTD
 006003 TERAOKA WEIGH SYSTEM PTE, LTD.
 006004 COMPUTADORES MODULARES SA
@@ -2920,9 +5034,9 @@
 006008 3COM CORPORATION
 006009 CISCO SYSTEMS, INC.
 00600A SORD COMPUTER CORPORATION
-00600B LOGWARE GMBH
+00600B LOGWARE GmbH
 00600C APPLIED DATA SYSTEMS, INC.
-00600D MICRODESIGN GMBH
+00600D Digital Logic GmbH
 00600E WAVENET INTERNATIONAL, INC.
 00600F WESTELL, INC.
 006010 NETWORK MACHINES, INC.
@@ -2934,7 +5048,7 @@
 006016 CLARIION
 006017 TOKIMEC INC.
 006018 STELLAR ONE CORPORATION
-006019 BOEHRINGER MANNHEIM CORP.
+006019 Roche Diagnostics
 00601A KEITHLEY INSTRUMENTS
 00601B MESA ELECTRONICS
 00601C TELXON CORPORATION
@@ -2951,24 +5065,24 @@
 006027 Superior Modular Products
 006028 MACROVISION CORPORATION
 006029 CARY PERIPHERALS INC.
-00602A SYMICRON COMPUTER
+00602A SYMICRON COMPUTER COMMUNICATIONS, LTD.
 00602B PEAK AUDIO
-00602C LINX DATA TERMINALS, INC.
+00602C LINX Data Terminals, Inc.
 00602D ALERTON TECHNOLOGIES, INC.
 00602E CYCLADES CORPORATION
 00602F CISCO SYSTEMS, INC.
-006030 VILLAGE TRONIC
+006030 VILLAGE TRONIC ENTWICKLUNG
 006031 HRK SYSTEMS
 006032 I-CUBE, INC.
 006033 ACUITY IMAGING, INC.
-006034 ROBERT BOSCH GMBH
+006034 ROBERT BOSCH GmbH
 006035 DALLAS SEMICONDUCTOR, INC.
-006036 AUSTRIAN RESEARCH CENTER
+006036 AUSTRIAN RESEARCH CENTER SEIBERSDORF
 006037 PHILIPS SEMICONDUCTORS
 006038 Nortel Networks
-006039 SANCOM TECHNOLOGY, INC.
+006039 SanCom Technology, Inc.
 00603A QUICK CONTROLS LTD.
-00603B AMTEC SPA
+00603B AMTEC spa
 00603C HAGIWARA SYS-COM CO., LTD.
 00603D 3CX
 00603E CISCO SYSTEMS, INC.
@@ -2976,7 +5090,7 @@
 006040 NETRO CORP.
 006041 Yokogawa Electric Corporation
 006042 TKS (USA), INC.
-006043 COMSOFT SYSTEMS, INC.
+006043 ComSoft Systems, Inc.
 006044 LITTON/POLY-SCIENTIFIC
 006045 PATHLIGHT TECHNOLOGIES
 006046 VMETRO, INC.
@@ -2984,23 +5098,23 @@
 006048 EMC CORPORATION
 006049 VINA TECHNOLOGIES
 00604A SAIC IDEAS GROUP
-00604B BIODATA GMBH
+00604B BIODATA GmbH
 00604C SAT
 00604D MMC NETWORKS, INC.
 00604E CYCLE COMPUTER CORPORATION, INC.
 00604F SUZUKI MFG. CO., LTD.
 006050 INTERNIX INC.
 006051 QUALITY SEMICONDUCTOR
-006052 PERIPHERALS ENTERPRISE CO., L.
+006052 PERIPHERALS ENTERPRISE CO., Ltd.
 006053 TOYODA MACHINE WORKS, LTD.
 006054 CONTROLWARE GMBH
 006055 CORNELL UNIVERSITY
 006056 NETWORK TOOLS, INC.
 006057 MURATA MANUFACTURING CO., LTD.
-006058 COPPER MOUNTAIN
+006058 COPPER MOUNTAIN COMMUNICATIONS, INC.
 006059 TECHNICAL COMMUNICATIONS CORP.
 00605A CELCORE, INC.
-00605B INTRASERVER TECHNOLOGY INC.
+00605B IntraServer Technology, Inc.
 00605C CISCO SYSTEMS, INC.
 00605D SCANIVALVE CORP.
 00605E LIBERTY TECHNOLOGY NETWORKING
@@ -3010,13 +5124,13 @@
 006062 TELESYNC, INC.
 006063 PSION DACOM PLC.
 006064 NETCOMM LIMITED
-006065 BERNECKER & RAINER
+006065 BERNECKER & RAINER INDUSTRIE-ELEKTRONIC GmbH
 006066 LACROIX TECHNOLGIE
 006067 ACER NETXUS INC.
 006068 EICON TECHNOLOGY CORPORATION
-006069 BROCADE COMMUNICATIONS SYSTEMS
-00606A MITSUBISHI WIRELESS COMM. INC.
-00606B AICHI ELECTRONICS CO.,LTD.
+006069 BROCADE COMMUNICATIONS SYSTEMS, Inc.
+00606A MITSUBISHI WIRELESS COMMUNICATIONS. INC.
+00606B Synclayer Inc.
 00606C ARESCOM
 00606D DIGITAL EQUIPMENT CORP.
 00606E DAVICOM SEMICONDUCTOR, INC.
@@ -3027,13 +5141,13 @@
 006073 REDCREEK COMMUNICATIONS, INC.
 006074 QSC AUDIO PRODUCTS
 006075 PENTEK, INC.
-006076 SCHLUMBERGER TECHNOLOGIES
+006076 SCHLUMBERGER TECHNOLOGIES RETAIL PETROLEUM SYSTEMS
 006077 PRISA NETWORKS
 006078 POWER MEASUREMENT LTD.
-006079 WAVEPHORE NETWORKS, INC.
-00607A DVS GMBH
+006079 Mainstream Data, Inc.
+00607A DVS GmbH
 00607B FORE SYSTEMS, INC.
-00607C WAVEACCESS, LTD.
+00607C WaveAccess, Ltd.
 00607D SENTIENT NETWORKS INC.
 00607E GIGALABS, INC.
 00607F AURORA TECHNOLOGIES, INC.
@@ -3042,16 +5156,16 @@
 006082 NOVALINK TECHNOLOGIES, INC.
 006083 CISCO SYSTEMS, INC.
 006084 DIGITAL VIDEO
-006085 STORAGE CONCEPTS
+006085 Storage Concepts
 006086 LOGIC REPLACEMENT TECH. LTD.
 006087 KANSAI ELECTRIC CO., LTD.
 006088 WHITE MOUNTAIN DSP, INC.
 006089 XATA
 00608A CITADEL COMPUTER
-00608B CONFERTECH INTERNATIONAL
+00608B ConferTech International
 00608C 3COM CORPORATION
 00608D UNIPULSE CORP.
-00608E HE ELECTRONICS, TECHNOLOGIE &
+00608E HE ELECTRONICS, TECHNOLOGIE & SYSTEMTECHNIK GmbH
 00608F TEKRAM TECHNOLOGY CO., LTD.
 006090 ABLE COMMUNICATIONS, INC.
 006091 FIRST PACIFIC NETWORKS, INC.
@@ -3065,24 +5179,24 @@
 006099 LAN MEDIA CORPORATION
 00609A NJK TECHNO CO.
 00609B ASTRO-MED, INC.
-00609C PERKIN-ELMER CORPORATION
+00609C Perkin-Elmer Incorporated
 00609D PMI FOOD EQUIPMENT GROUP
-00609E X3 - INFORMATION TECHNOLOGY
+00609E ASC X3 - INFORMATION TECHNOLOGY STANDARDS SECRETARIATS
 00609F PHAST CORPORATION
-0060A0 SWITCHED NETWORK
-0060A1 VPNET
+0060A0 SWITCHED NETWORK TECHNOLOGIES, INC.
+0060A1 VPNet, Inc.
 0060A2 NIHON UNISYS LIMITED CO.
 0060A3 CONTINUUM TECHNOLOGY CORP.
 0060A4 GRINAKER SYSTEM TECHNOLOGIES
 0060A5 PERFORMANCE TELECOM CORP.
 0060A6 PARTICLE MEASURING SYSTEMS
-0060A7 MICROSENS GMBH & CO. KG
+0060A7 MICROSENS GmbH & CO. KG
 0060A8 TIDOMAT AB
-0060A9 GESYTEC MBH
+0060A9 GESYTEC MbH
 0060AA INTELLIGENT DEVICES INC. (IDI)
 0060AB LARSCOM INCORPORATED
 0060AC RESILIENCE CORPORATION
-0060AD MEGACHIPS CORPORATION
+0060AD MegaChips Corporation
 0060AE TRIO INFORMATION SYSTEMS AB
 0060AF PACIFIC MICRO DATA, INC.
 0060B0 HEWLETT-PACKARD CO.
@@ -3090,19 +5204,19 @@
 0060B2 PROCESS CONTROL CORP.
 0060B3 Z-COM, INC.
 0060B4 GLENAYRE R&D INC.
-0060B5 KEBA GMBH
+0060B5 KEBA GmbH
 0060B6 LAND COMPUTER CO., LTD.
 0060B7 CHANNELMATIC, INC.
 0060B8 CORELIS INC.
 0060B9 NITSUKO CORPORATION
 0060BA SAHARA NETWORKS, INC.
 0060BB CABLETRON - NETLINK, INC.
-0060BC KEUNYOUNG ELECTRONICS &
+0060BC KeunYoung Electronics & Communication Co., Ltd.
 0060BD HUBBELL-PULSECOM
 0060BE WEBTRONICS
 0060BF MACRAIGOR SYSTEMS, INC.
 0060C0 NERA AS
-0060C1 WAVESPAN CORPORATION
+0060C1 WaveSpan Corporation
 0060C2 MPL AG
 0060C3 NETVISION CORPORATION
 0060C4 SOLITON SYSTEMS K.K.
@@ -3110,40 +5224,40 @@
 0060C6 DCS AG
 0060C7 AMATI COMMUNICATIONS CORP.
 0060C8 KUKA WELDING SYSTEMS & ROBOTS
-0060C9 CONTROLNET, INC.
+0060C9 ControlNet, Inc.
 0060CA HARMONIC SYSTEMS INCORPORATED
 0060CB HITACHI ZOSEN CORPORATION
 0060CC EMTRAK, INCORPORATED
-0060CD VIDEOSERVER, INC.
+0060CD VideoServer, Inc.
 0060CE ACCLAIM COMMUNICATIONS
 0060CF ALTEON NETWORKS, INC.
 0060D0 SNMP RESEARCH INCORPORATED
 0060D1 CASCADE COMMUNICATIONS
-0060D2 LUCENT TECHNOLOGIES TAIWAN
+0060D2 LUCENT TECHNOLOGIES TAIWAN TELECOMMUNICATIONS CO., LTD.
 0060D3 AT&T
 0060D4 ELDAT COMMUNICATION LTD.
 0060D5 MIYACHI TECHNOS CORP.
-0060D6 NOVATEL WIRELESS TECHNOLOGIES
-0060D7 ECOLE POLYTECHNIQUE FEDERALE
+0060D6 NovAtel Wireless Technologies Ltd.
+0060D7 ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE (EPFL)
 0060D8 ELMIC SYSTEMS, INC.
 0060D9 TRANSYS NETWORKS INC.
 0060DA JBM ELECTRONICS CO.
 0060DB NTP ELEKTRONIK A/S
-0060DC TOYO COMMUNICATION EQUIPMENT
+0060DC TOYO COMMUNICATION EQUIPMENT Co., Ltd.
 0060DD MYRICOM, INC.
-0060DE KAYSER-THREDE GMBH
-0060DF INRANGE TECHNOLOGIES CORP.
+0060DE KAYSER-THREDE GmbH
+0060DF CNT Corporation
 0060E0 AXIOM TECHNOLOGY CO., LTD.
 0060E1 ORCKIT COMMUNICATIONS LTD.
-0060E2 QUEST ENGINEERING & DEV.
+0060E2 QUEST ENGINEERING & DEVELOPMENT
 0060E3 ARBIN INSTRUMENTS
 0060E4 COMPUSERVE, INC.
 0060E5 FUJI AUTOMATION CO., LTD.
 0060E6 SHOMITI SYSTEMS INCORPORATED
 0060E7 RANDATA
-0060E8 HITACHI COMPUTER PRODUCTS
+0060E8 HITACHI COMPUTER PRODUCTS (AMERICA), INC.
 0060E9 ATOP TECHNOLOGIES, INC.
-0060EA STREAMLOGIC
+0060EA StreamLogic
 0060EB FOURTHTRACK SYSTEMS
 0060EC HERMARY OPTO ELECTRONICS INC.
 0060ED RICARDO TEST AUTOMATION LTD.
@@ -3152,19 +5266,19 @@
 0060F0 JOHNSON & JOHNSON MEDICAL, INC
 0060F1 EXP COMPUTER, INC.
 0060F2 LASERGRAPHICS, INC.
-0060F3 NETCOM SYSTEMS, INC.
-0060F4 ADVANCED COMPUTER SOLUTIONS,
+0060F3 Performance Analysis Broadband, Spirent plc
+0060F4 ADVANCED COMPUTER SOLUTIONS, Inc.
 0060F5 ICON WEST, INC.
-0060F6 NEXTEST COMMUNICATION
+0060F6 NEXTEST COMMUNICATIONS PRODUCTS, INC.
 0060F7 DATAFUSION SYSTEMS
-0060F8 LORAN INTERNATIONAL TECHN. INC
+0060F8 Loran International Technologies Inc.
 0060F9 DIAMOND LANE COMMUNICATIONS
-0060FA EDUCATIONAL TECHNOLOGY
+0060FA EDUCATIONAL TECHNOLOGY RESOURCES, INC.
 0060FB PACKETEER, INC.
-0060FC CONSERVATION THROUGH
-0060FD NETICS, INC.
+0060FC CONSERVATION THROUGH INNOVATION LTD.
+0060FD NetICs, Inc.
 0060FE LYNX SYSTEM DEVELOPERS, INC.
-0060FF QUVIS, INC.
+0060FF QuVis, Inc.
 0070B0 M/A-COM INC. COMPANIES
 0070B3 DATA RECALL LTD.
 008000 MULTITECH SYSTEMS, INC.
@@ -3200,7 +5314,7 @@
 00801E XINETRON, INC.
 00801F KRUPP ATLAS ELECTRONIK GMBH
 008020 NETWORK PRODUCTS
-008021 NEWBRIDGE RESEARCH CORP.
+008021 Alcatel Canada Inc.
 008022 SCAN-OPTICS
 008023 INTEGRATED BUSINESS NETWORKS
 008024 KALPANA, INC.
@@ -3361,7 +5475,7 @@
 0080BF TAKAOKA ELECTRIC MFG. CO. LTD.
 0080C0 PENRIL DATACOMM
 0080C1 LANEX CORPORATION
-0080C2 IEEE 802 COMMITTEE
+0080C2 IEEE 802.1 COMMITTEE
 0080C3 BICC INFORMATION SYSTEMS & SVC
 0080C4 DOCUMENT TECHNOLOGIES, INC.
 0080C5 NOVELLCO DE MEXICO
@@ -3382,7 +5496,7 @@
 0080D4 CHASE RESEARCH LTD.
 0080D5 CADRE TECHNOLOGIES
 0080D6 NUVOTECH, INC.
-0080D7 FANTUM ENGINEERING, INC.
+0080D7 Fantum Engineering
 0080D8 NETWORK PERIPHERALS INC.
 0080D9 EMK ELEKTRONIK
 0080DA BRUEL & KJAER
@@ -3400,14 +5514,14 @@
 0080E6 PEER NETWORKS, INC.
 0080E7 LYNWOOD SCIENTIFIC DEV. LTD.
 0080E8 CUMULUS CORPORATIION
-0080E9 MADGE NETWORKS
+0080E9 Madge Ltd.
 0080EA ADVA Optical Networking Ltd.
 0080EB COMPCONTROL B.V.
 0080EC SUPERCOMPUTING SOLUTIONS, INC.
 0080ED IQ TECHNOLOGIES, INC.
 0080EE THOMSON CSF
 0080EF RATIONAL
-0080F0 KYUSHU MATSUSHITA ELECTRIC CO.
+0080F0 Panasonic Communications Co., Ltd.
 0080F1 OPUS SYSTEMS
 0080F2 RAYCOM SYSTEMS INC
 0080F3 SUN ELECTRONICS CORP.
@@ -3424,23 +5538,23 @@
 0080FE AZURE TECHNOLOGIES, INC.
 0080FF SOC. DE TELEINFORMATIQUE RTC
 009000 DIAMOND MULTIMEDIA
-009001 NISHIMU ELCTRONICS INDUSTRIES
+009001 NISHIMU ELECTRONICS INDUSTRIES CO., LTD.
 009002 ALLGON AB
 009003 APLIO
 009004 3COM EUROPE LTD.
 009005 PROTECH SYSTEMS CO., LTD.
 009006 HAMAMATSU PHOTONICS K.K.
 009007 DOMEX TECHNOLOGY CORP.
-009008 HAN A SYSTEMS, INC.
+009008 HanA Systems Inc.
 009009 i Controls, Inc.
-00900A PROTON ELECTRONIC INDUSTRIAL
+00900A PROTON ELECTRONIC INDUSTRIAL CO., LTD.
 00900B LANNER ELECTRONICS, INC.
 00900C CISCO SYSTEMS, INC.
 00900D OVERLAND DATA INC.
 00900E HANDLINK TECHNOLOGIES, INC.
 00900F KAWASAKI HEAVY INDUSTRIES, LTD
 009010 SIMULATION LABORATORIES, INC.
-009011 WAVTRACE, INC.
+009011 WAVTrace, Inc.
 009012 GLOBESPAN SEMICONDUCTOR, INC.
 009013 SAMSAN CORP.
 009014 ROTORK INSTRUMENTS, LTD.
@@ -3451,7 +5565,7 @@
 009019 HERMES ELECTRONICS CO., LTD.
 00901A UNISPHERE SOLUTIONS
 00901B DIGITAL CONTROLS
-00901C MPS SOFTWARE GMBH
+00901C mps Software Gmbh
 00901D PEC (NZ) LTD.
 00901E SELESTA INGEGNE RIA S.P.A.
 00901F ADTEC PRODUCTIONS, INC.
@@ -3461,44 +5575,44 @@
 009023 ZILOG INC.
 009024 PIPELINKS, INC.
 009025 VISION SYSTEMS LTD. PTY
-009026 ADVANCED SWITCHING
+009026 ADVANCED SWITCHING COMMUNICATIONS, INC.
 009027 INTEL CORPORATION
 009028 NIPPON SIGNAL CO., LTD.
 009029 CRYPTO AG
 00902A COMMUNICATION DEVICES, INC.
 00902B CISCO SYSTEMS, INC.
 00902C DATA & CONTROL EQUIPMENT LTD.
-00902D DATA ELECTRONICS
+00902D DATA ELECTRONICS (AUST.) PTY, LTD.
 00902E NAMCO LIMITED
 00902F NETCORE SYSTEMS, INC.
 009030 HONEYWELL-DATING
 009031 MYSTICOM, LTD.
 009032 PELCOMBE GROUP LTD.
-009033 INNOVAPHONE GMBH
+009033 INNOVAPHONE GmbH
 009034 IMAGIC, INC.
 009035 ALPHA TELECOM, INC.
-009036 ENS, INC.
+009036 ens, inc.
 009037 ACUCOMM, INC.
 009038 FOUNTAIN TECHNOLOGIES, INC.
 009039 SHASTA NETWORKS
 00903A NIHON MEDIA TOOL INC.
-00903B TRIEMS RESEARCH LAB, INC.
+00903B TriEMS Research Lab, Inc.
 00903C ATLANTIC NETWORK SYSTEMS
 00903D BIOPAC SYSTEMS, INC.
-00903E N.V. PHILIPS INDUSTRIAL
+00903E N.V. PHILIPS INDUSTRIAL ACTIVITIES
 00903F AZTEC RADIOMEDIA
-009040 CASTLE NETWORKS, INC.
+009040 Siemens Network Convergence LLC
 009041 APPLIED DIGITAL ACCESS
-009042 ECCS
+009042 ECCS, Inc.
 009043 NICHIBEI DENSHI CO., LTD.
 009044 ASSURED DIGITAL, INC.
-009045 MARIPOSA TECHNOLOGY
+009045 Marconi Communications
 009046 DEXDYNE, LTD.
 009047 GIGA FAST E. LTD.
 009048 ZEAL CORPORATION
 009049 ENTRIDIA CORPORATION
 00904A CONCUR SYSTEM TECHNOLOGIES
-00904B GEMTEK TECHNOLOGY CO., LTD.
+00904B GemTek Technology Co., Ltd.
 00904C EPIGRAM, INC.
 00904D SPEC S.A.
 00904E DELEM BV
@@ -3508,49 +5622,49 @@
 009052 SELCOM ELETTRONICA S.R.L.
 009053 DAEWOO ELECTRONICS CO., LTD.
 009054 INNOVATIVE SEMICONDUCTORS, INC
-009055 PARKER HANNIFIN CORPORATION
+009055 PARKER HANNIFIN CORPORATION COMPUMOTOR DIVISION
 009056 TELESTREAM, INC.
-009057 AANETCOM, INC.
-009058 ULTRA ELECTRONICS LTD.
+009057 AANetcom, Inc.
+009058 Ultra Electronics Ltd., Command and Control Systems
 009059 TELECOM DEVICE K.K.
 00905A DEARBORN GROUP, INC.
 00905B RAYMOND AND LAE ENGINEERING
 00905C EDMI
-00905D NETCOM SICHERHEITSTECHNIK GMBH
+00905D NETCOM SICHERHEITSTECHNIK GmbH
 00905E RAULAND-BORG CORPORATION
 00905F CISCO SYSTEMS, INC.
 009060 SYSTEM CREATE CORP.
-009061 PACIFIC RESEARCH & ENGINEERING
-009062 ICP VORTEX COMPUTERSYSTEME
-009063 COHERENT COMMUNICATIONS
+009061 PACIFIC RESEARCH & ENGINEERING CORPORATION
+009062 ICP VORTEX COMPUTERSYSTEME GmbH
+009063 COHERENT COMMUNICATIONS SYSTEMS CORPORATION
 009064 THOMSON BROADCAST SYSTEMS
 009065 FINISAR CORPORATION
 009066 Troika Networks, Inc.
-009067 WALKABOUT COMPUTERS, INC.
+009067 WalkAbout Computers, Inc.
 009068 DVT CORP.
 009069 JUNIPER NETWORKS, INC.
 00906A TURNSTONE SYSTEMS, INC.
 00906B APPLIED RESOURCES, INC.
-00906C GWT GLOBAL WEIGHING
+00906C GWT GLOBAL WEIGHING TECHNOLOGIES GmbH
 00906D CISCO SYSTEMS, INC.
 00906E PRAXON, INC.
 00906F CISCO SYSTEMS, INC.
 009070 NEO NETWORKS, INC.
-009071 BADGER TECHNOLOGY, INC.
+009071 Applied Innovation Inc.
 009072 SIMRAD AS
 009073 GAIO TECHNOLOGY
 009074 ARGON NETWORKS, INC.
 009075 NEC DO BRASIL S.A.
-009076 FMT AIRCRAFT GATE SUPPORT
+009076 FMT AIRCRAFT GATE SUPPORT SYSTEMS AB
 009077 ADVANCED FIBRE COMMUNICATIONS
-009078 MER TELEMANAGEMENT
-009079 CLEARONE INC.
+009078 MER TELEMANAGEMENT SOLUTIONS, LTD.
+009079 ClearOne, Inc.
 00907A SPECTRALINK CORP.
 00907B E-TECH, INC.
 00907C DIGITALCAST, INC.
-00907D HOME WIRELESS NETWORKS
+00907D Lake Communications
 00907E VETRONIX CORP.
-00907F WATCHGUARD TECHNOLOGIES, INC.
+00907F WatchGuard Technologies, Inc.
 009080 NOT LIMITED, INC.
 009081 ALOHA NETWORKS, INC.
 009082 FORCE INSTITUTE
@@ -3566,9 +5680,9 @@
 00908C ETREND ELECTRONICS, INC.
 00908D VICKERS ELECTRONICS SYSTEMS
 00908E Nortel Networks Broadband Access
-00908F AUDIOCODES LTD.
+00908F AUDIO CODES LTD.
 009090 I-BUS
-009091 DIGITALSCAPE, INC.
+009091 DigitalScape, Inc.
 009092 CISCO SYSTEMS, INC.
 009093 NANAO CORPORATION
 009094 OSPREY TECHNOLOGIES, INC.
@@ -3576,28 +5690,28 @@
 009096 ASKEY COMPUTER CORP.
 009097 SYCAMORE NETWORKS
 009098 SBC DESIGNS, INC.
-009099 ALLIED TELESIS,K.K.
+009099 ALLIED TELESIS, K.K.
 00909A ONE WORLD SYSTEMS, INC.
 00909B MARKPOINT AB
-00909C COMBOX, LTD.
+00909C Terayon Communications Systems
 00909D GSE SYSTEMS, INC.
-00909E DELPHI ENGINEERING GROUP
+00909E Critical IO, LLC
 00909F DIGI-DATA CORPORATION
 0090A0 8X8 INC.
 0090A1 FLYING PIG SYSTEMS, LTD.
 0090A2 CYBERTAN TECHNOLOGY, INC.
-0090A3 MEDIALINCS CO., LTD.
+0090A3 Corecess Inc.
 0090A4 ALTIGA NETWORKS
 0090A5 SPECTRA LOGIC
 0090A6 CISCO SYSTEMS, INC.
 0090A7 CLIENTEC CORPORATION
-0090A8 NINETILES NETWORKS LTD.
+0090A8 NineTiles Networks, Ltd.
 0090A9 WESTERN DIGITAL
-0090AA INDIGO ACTIVE VISION
+0090AA INDIGO ACTIVE VISION SYSTEMS LIMITED
 0090AB CISCO SYSTEMS, INC.
 0090AC OPTIVISION, INC.
 0090AD ASPECT ELECTRONICS, INC.
-0090AE ITALTEL SPA
+0090AE ITALTEL S.p.A.
 0090AF J. MORITA MFG. CORP.
 0090B0 VADEM
 0090B1 CISCO SYSTEMS, INC.
@@ -3610,46 +5724,46 @@
 0090B8 ROHDE & SCHWARZ GMBH & CO. KG
 0090B9 BERAN INSTRUMENTS LTD.
 0090BA VALID NETWORKS, INC.
-0090BB TAINET COMMUNICATION SYSTEM
+0090BB TAINET COMMUNICATION SYSTEM Corp.
 0090BC TELEMANN CO., LTD.
 0090BD OMNIA COMMUNICATIONS, INC.
-0090BE IBC/INTEGRATED BUSINESS
+0090BE IBC/INTEGRATED BUSINESS COMPUTERS
 0090BF CISCO SYSTEMS, INC.
 0090C0 K.J. LAW ENGINEERS, INC.
-0090C1 EDA INDUSTRIES
-0090C2 JK MICROSYSTEMS, INC.
+0090C1 Peco II, Inc.
+0090C2 JK microsystems, Inc.
 0090C3 TOPIC SEMICONDUCTOR CORP.
 0090C4 JAVELIN SYSTEMS, INC.
 0090C5 INTERNET MAGIC, INC.
 0090C6 OPTIM SYSTEMS, INC.
 0090C7 ICOM INC.
-0090C8 WAVERIDER COMMUNICATIONS
-0090C9 PRODUCTIVITY ENHANCEMENT
-0090CA ACCORD VIDEO
-0090CB WIRELESS ONLINE, INC.
-0090CC PLANEX COMMUNICATIONS, INC.
-0090CD ENT-EMPRESA NACIONAL
-0090CE TETRA GMBH
+0090C8 WAVERIDER COMMUNICATIONS (CANADA) INC.
+0090C9 DPAC Technologies
+0090CA ACCORD VIDEO TELECOMMUNICATIONS, LTD.
+0090CB Wireless OnLine, Inc.
+0090CC PLANET COMMUNICATIONS, INC.
+0090CD ENT-EMPRESA NACIONAL DE TELECOMMUNICACOES, S.A.
+0090CE TETRA GmbH
 0090CF NORTEL
-0090D0 ALCATEL BELL
+0090D0 Thomson Belgium
 0090D1 LEICHU ENTERPRISE CO., LTD.
 0090D2 ARTEL VIDEO SYSTEMS
-0090D3 GIESECKE & DEVRIENT GMBH
-0090D4 BINDVIEW DEVELOPMENT CORP.
+0090D3 GIESECKE & DEVRIENT GmbH
+0090D4 BindView Development Corp.
 0090D5 EUPHONIX, INC.
 0090D6 CRYSTAL GROUP
-0090D7 NETBOOST CORP.
+0090D7 NetBoost Corp.
 0090D8 WHITECROSS SYSTEMS
 0090D9 CISCO SYSTEMS, INC.
 0090DA DYNARC, INC.
 0090DB NEXT LEVEL COMMUNICATIONS
 0090DC TECO INFORMATION SYSTEMS
-0090DD THE MIHARU COMMUNICATIONS
+0090DD THE MIHARU COMMUNICATIONS CO., LTD.
 0090DE CARDKEY SYSTEMS, INC.
-0090DF MITSUBISHI CHEMICAL
+0090DF MITSUBISHI CHEMICAL AMERICA, INC.
 0090E0 SYSTRAN CORP.
 0090E1 TELENA S.P.A.
-0090E2 DISTRIBUTED PROCESSING
+0090E2 DISTRIBUTED PROCESSING TECHNOLOGY
 0090E3 AVEX ELECTRONICS INC.
 0090E4 NEC AMERICA, INC.
 0090E5 TEKNEMA, INC.
@@ -3660,8 +5774,8 @@
 0090EA ALPHA TECHNOLOGIES, INC.
 0090EB SENTRY TELECOM SYSTEMS
 0090EC PYRESCOM
-0090ED CENTRAL SYSTEM RESEARCH
-0090EE PERSONAL COMMUNICATIONS
+0090ED CENTRAL SYSTEM RESEARCH CO., LTD.
+0090EE PERSONAL COMMUNICATIONS TECHNOLOGIES
 0090EF INTEGRIX, INC.
 0090F0 HARMONIC LIGHTWAVES, LTD.
 0090F1 DOT HILL SYSTEMS CORPORATION
@@ -3673,20 +5787,21 @@
 0090F7 NBASE COMMUNICATIONS LTD.
 0090F8 MEDIATRIX TELECOM
 0090F9 LEITCH
-0090FA GIGANET, INC.
+0090FA GigaNet, Inc.
 0090FB PORTWELL, INC.
 0090FC NETWORK COMPUTING DEVICES
-0090FD COPPERCOM, INC.
-0090FE ELECOM CO., LTD.  (LANEED DIV.
+0090FD CopperCom, Inc.
+0090FE ELECOM CO., LTD.  (LANEED DIV.)
 0090FF TELLUS TECHNOLOGY INC.
+0091D6 Crystal Group, Inc.
 009D8E CARDIAC RECORDERS, INC.
 00A000 CENTILLION NETWORKS, INC.
 00A001 WATKINS-JOHNSON COMPANY
-00A002 LEEDS & NORTHRUP AUSTRALIA
+00A002 LEEDS & NORTHRUP AUSTRALIA PTY LTD
 00A003 STAEFA CONTROL SYSTEM
 00A004 NETPOWER, INC.
 00A005 DANIEL INSTRUMENTS, LTD.
-00A006 IMAGE DATA PROCESSING
+00A006 IMAGE DATA PROCESSING SYSTEM GROUP
 00A007 APEXX TECHNOLOGY, INC.
 00A008 NETCORP
 00A009 WHITETREE NETWORK
@@ -3714,8 +5829,8 @@
 00A01F TRICORD SYSTEMS, INC.
 00A020 CITICORP/TTI
 00A021 GENERAL DYNAMICS-
-00A022 CENTRE FOR DEVELOPMENT OF
-00A023 APPLIED CREATIVE TECHNOLOGY,
+00A022 CENTRE FOR DEVELOPMENT OF ADVANCED COMPUTING
+00A023 APPLIED CREATIVE TECHNOLOGY, INC.
 00A024 3COM CORPORATION
 00A025 REDCOM LABS INC.
 00A026 TELDAT, S.A.
@@ -3724,14 +5839,14 @@
 00A029 COULTER CORPORATION
 00A02A TRANCELL SYSTEMS
 00A02B TRANSITIONS RESEARCH CORP.
-00A02C INTERWAVE COMMUNICATIONS
+00A02C interWAVE Communications
 00A02D 1394 Trade Association
 00A02E BRAND COMMUNICATIONS, LTD.
 00A02F PIRELLI CAVI
 00A030 CAPTOR NV/SA
 00A031 HAZELTINE CORPORATION, MS 1-17
 00A032 GES SINGAPORE PTE. LTD.
-00A033 IMC MESS-SYSTEME GMBH
+00A033 imc MeBsysteme GmbH
 00A034 AXEL
 00A035 CYLINK CORPORATION
 00A036 APPLIED NETWORK TECHNOLOGY
@@ -3741,14 +5856,14 @@
 00A03A KUBOTEK CORPORATION
 00A03B TOSHIN ELECTRIC CO., LTD.
 00A03C EG&G NUCLEAR INSTRUMENTS
-00A03D OPTO - 22
+00A03D OPTO-22
 00A03E ATM FORUM
-00A03F COMPUTER SOCIETY MICROPROCES'R
+00A03F COMPUTER SOCIETY MICROPROCESSOR & MICROPROCESSOR STANDARDS C
 00A040 APPLE COMPUTER
 00A041 LEYBOLD-INFICON
 00A042 SPUR PRODUCTS CORP.
 00A043 AMERICAN TECHNOLOGY LABS, INC.
-00A044 NTT INTELLIGENT TECHNOLOGY
+00A044 NTT IT CO., LTD.
 00A045 PHOENIX CONTACT GMBH & CO.
 00A046 SCITEX CORP. LTD.
 00A047 INTEGRATED FITNESS CORP.
@@ -3756,7 +5871,7 @@
 00A049 DIGITECH INDUSTRIES, INC.
 00A04A NISSHIN ELECTRIC CO., LTD.
 00A04B TFL LAN INC.
-00A04C INNOVATIVE SYSTEMS & TECH. INC
+00A04C INNOVATIVE SYSTEMS & TECHNOLOGIES, INC.
 00A04D EDA INSTRUMENTS, INC.
 00A04E VOELKER TECHNOLOGIES, INC.
 00A04F AMERITEC CORP.
@@ -3764,15 +5879,15 @@
 00A051 ANGIA COMMUNICATIONS. INC.
 00A052 STANILITE ELECTRONICS PTY. LTD
 00A053 COMPACT DEVICES, INC.
-00A055 LINKTECH, INC.
+00A055 Data Device Corporation
 00A056 MICROPROSS
-00A057 ELSA AG
+00A057 LANCOM Systems GmbH
 00A058 GLORY, LTD.
 00A059 HAMILTON HALLMARK
 00A05A KOFAX IMAGE PRODUCTS
 00A05B MARQUIP, INC.
 00A05C INVENTORY CONVERSION, INC./
-00A05D CS COMPUTER SYSTEME GMBH
+00A05D CS COMPUTER SYSTEME GmbH
 00A05E MYRIAD LOGIC INC.
 00A05F BTG ENGINEERING BV
 00A060 ACER PERIPHERALS, INC.
@@ -3784,10 +5899,10 @@
 00A066 ISA CO., LTD.
 00A067 NETWORK SERVICES GROUP
 00A068 BHP LIMITED
-00A069 TrueTime
-00A06A VERILINK CORP.
+00A069 Symmetricom, Inc.
+00A06A Verilink Corporation
 00A06B DMS DORSCH MIKROSYSTEM GMBH
-00A06C SHINDENGEN ELECTRIC MFG.
+00A06C SHINDENGEN ELECTRIC MFG. CO., LTD.
 00A06D MANNESMANN TALLY CORPORATION
 00A06E AUSTRON, INC.
 00A06F THE APPCON GROUP, INC.
@@ -3801,7 +5916,7 @@
 00A077 FUJITSU NEXION, INC.
 00A078 Marconi Communications
 00A079 ALPS ELECTRIC (USA), INC.
-00A07A ADVANCED PERIPHERALS
+00A07A ADVANCED PERIPHERALS TECHNOLOGIES, INC.
 00A07B DAWN COMPUTER INCORPORATION
 00A07C TONYANG NYLON CO., LTD.
 00A07D SEEQ TECHNOLOGY, INC.
@@ -3813,28 +5928,28 @@
 00A083 ASIMMPHONY TURKEY
 00A084 DATAPLEX PTY. LTD.
 00A086 AMBER WAVE SYSTEMS, INC.
-00A087 MITEL SEMICONDUCTOR, LTD.
+00A087 Zarlink Semiconductor Ltd.
 00A088 ESSENTIAL COMMUNICATIONS
 00A089 XPOINT TECHNOLOGIES, INC.
 00A08A BROOKTROUT TECHNOLOGY, INC.
 00A08B ASTON ELECTRONIC DESIGNS LTD.
-00A08C MULTIMEDIA LANS, INC.
+00A08C MultiMedia LANs, Inc.
 00A08D JACOMO CORPORATION
 00A08E Nokia Internet Communications
 00A08F DESKNET SYSTEMS, INC.
-00A090 TIMESTEP CORPORATION
+00A090 TimeStep Corporation
 00A091 APPLICOM INTERNATIONAL
 00A092 H. BOLLMANN MANUFACTURERS, LTD
-00A093 B/E AEROSPACE
+00A093 B/E AEROSPACE, Inc.
 00A094 COMSAT CORPORATION
 00A095 ACACIA NETWORKS, INC.
-00A096 MITSUMI ELECTRIC CO., LTD.
+00A096 MITUMI ELECTRIC CO., LTD.
 00A097 JC INFORMATION SYSTEMS
 00A098 NETWORK APPLIANCE CORP.
 00A099 K-NET LTD.
 00A09A NIHON KOHDEN AMERICA
 00A09B QPSX COMMUNICATIONS, LTD.
-00A09C XYPLEX, INC.
+00A09C Xyplex, Inc.
 00A09D JOHNATHON FREEMAN TECHNOLOGIES
 00A09E ICTV
 00A09F COMMVISION CORP.
@@ -3847,7 +5962,7 @@
 00A0A6 M.I. SYSTEMS, K.K.
 00A0A7 VORAX CORPORATION
 00A0A8 RENEX CORPORATION
-00A0A9 GN NETTEST (CANADA) INC.
+00A0A9 GN NETTEST (CANADA) NAVTEL DIVISION
 00A0AA SPACELABS MEDICAL
 00A0AB NETCS INFORMATIONSTECHNIK GMBH
 00A0AC GILAT SATELLITE NETWORKS, LTD.
@@ -3868,7 +5983,7 @@
 00A0BB HILAN GMBH
 00A0BC VIASAT, INCORPORATED
 00A0BD I-TECH CORP.
-00A0BE INTEGRATED CIRCUIT SYSTEMS,INC
+00A0BE INTEGRATED CIRCUIT SYSTEMS, INC. COMMUNICATIONS GROUP
 00A0BF WIRELESS DATA GROUP MOTOROLA
 00A0C0 DIGITAL LINK CORP.
 00A0C1 ORTIVUS MEDICAL AB
@@ -3883,12 +5998,12 @@
 00A0CA FUJITSU DENSO LTD.
 00A0CB ARK TELECOMMUNICATIONS, INC.
 00A0CC LITE-ON COMMUNICATIONS, INC.
-00A0CD DR. JOHANNES HEIDENHAIN GMBH
+00A0CD DR. JOHANNES HEIDENHAIN GmbH
 00A0CE ASTROCOM CORPORATION
 00A0CF SOTAS, INC.
 00A0D0 TEN X TECHNOLOGY, INC.
 00A0D1 INVENTEC CORPORATION
-00A0D2 ALLIED TELESIS INTERNATIONAL
+00A0D2 ALLIED TELESIS INTERNATIONAL CORPORATION
 00A0D3 INSTEM COMPUTER SYSTEMS, LTD.
 00A0D4 RADIOLAN,  INC.
 00A0D5 SIERRA WIRELESS INC.
@@ -3896,14 +6011,14 @@
 00A0D7 KASTEN CHASE APPLIED RESEARCH
 00A0D8 SPECTRA - TEK
 00A0D9 CONVEX COMPUTER CORPORATION
-00A0DA INTEGRATED SYSTEMS
+00A0DA INTEGRATED SYSTEMS Technology, Inc.
 00A0DB FISHER & PAYKEL PRODUCTION
 00A0DC O.N. ELECTRONIC CO., LTD.
 00A0DD AZONIX CORPORATION
 00A0DE YAMAHA CORPORATION
 00A0DF STS TECHNOLOGIES, INC.
 00A0E0 TENNYSON TECHNOLOGIES PTY LTD
-00A0E1 WESTPORT RESEARCH
+00A0E1 WESTPORT RESEARCH ASSOCIATES, INC.
 00A0E2 KEISOKU GIKEN CORP.
 00A0E3 XKL SYSTEMS CORP.
 00A0E4 OPTIQUEST
@@ -3911,9 +6026,9 @@
 00A0E6 DIALOGIC CORPORATION
 00A0E7 CENTRAL DATA CORPORATION
 00A0E8 REUTERS HOLDINGS PLC
-00A0E9 ELECTRONIC RETAILING SYSTEMS
+00A0E9 ELECTRONIC RETAILING SYSTEMS INTERNATIONAL
 00A0EA ETHERCOM CORP.
-00A0EB FASTCOMM COMMUNICATIONS CORP.
+00A0EB Encore Networks
 00A0EC TRANSMITTON LTD.
 00A0ED PRI AUTOMATION
 00A0EE NASHOBA NETWORKS
@@ -3924,7 +6039,7 @@
 00A0F3 STAUBLI
 00A0F4 GE
 00A0F5 RADGUARD LTD.
-00A0F6 AUTOGAS SYSTEMS, INC.
+00A0F6 AutoGas Systems Inc.
 00A0F7 V.I COMPUTER CORP.
 00A0F8 SYMBOL TECHNOLOGIES, INC.
 00A0F9 BINTEC COMMUNICATIONS GMBH
@@ -4016,7 +6131,7 @@
 00C026 LANS TECHNOLOGY CO., LTD.
 00C027 CIPHER SYSTEMS, INC.
 00C028 JASCO CORPORATION
-00C029 KABEL RHEYDT AG
+00C029 Nexans Deutschland AG - ANS
 00C02A OHKURA ELECTRIC CO., LTD.
 00C02B GERLOFF GESELLSCHAFT FUR
 00C02C CENTRUM COMMUNICATIONS, INC.
@@ -4080,7 +6195,7 @@
 00C066 DOCUPOINT, INC.
 00C067 UNITED BARCODE INDUSTRIES
 00C068 PHILIP DRAKE ELECTRONICS LTD.
-00C069 ADAPTIVE BROADBAND CORPORATION
+00C069 Axxcelera Broadband Wireless
 00C06A ZAHNER-ELEKTRIK GMBH & CO. KG
 00C06B OSI PLUS CORPORATION
 00C06C SVEC COMPUTER CORP.
@@ -4157,7 +6272,7 @@
 00C0B3 COMSTAT DATACOMM CORPORATION
 00C0B4 MYSON TECHNOLOGY, INC.
 00C0B5 CORPORATE NETWORK SYSTEMS,INC.
-00C0B6 MERIDIAN DATA, INC.
+00C0B6 Snap Appliance, Inc.
 00C0B7 AMERICAN POWER CONVERSION CORP
 00C0B8 FRASER'S HILL LTD.
 00C0B9 FUNK SOFTWARE, INC.
@@ -4198,7 +6313,7 @@
 00C0DC EOS TECHNOLOGIES, INC.
 00C0DD QLogic Corporation
 00C0DE ZCOMM, INC.
-00C0DF KYE SYSTEMS CORP.
+00C0DF KYE Systems Corp.
 00C0E0 DSC COMMUNICATION CORP.
 00C0E1 SONIC SOLUTIONS
 00C0E2 CALCOMP, INC.
@@ -4275,7 +6390,7 @@
 00D027 APPLIED AUTOMATION, INC.
 00D028 OMNEON VIDEO NETWORKS
 00D029 WAKEFERN FOOD CORPORATION
-00D02A FLEXION SYSTEMS
+00D02A Voxent Systems Ltd.
 00D02B JETCELL, INC.
 00D02C CAMPBELL SCIENTIFIC, INC.
 00D02D ADEMCO
@@ -4294,6 +6409,7 @@
 00D03A ZONEWORX, INC.
 00D03B VISION PRODUCTS PTY. LTD.
 00D03C Vieo, Inc.
+00D03D GALILEO TECHNOLOGY, LTD.
 00D03E ROCKETCHIPS, INC.
 00D03F AMERICAN COMMUNICATION
 00D040 SYSMATE CO., LTD.
@@ -4368,7 +6484,7 @@
 00D085 OTIS ELEVATOR COMPANY
 00D086 FOVEON, INC.
 00D087 MICROFIRST INC.
-00D088 MAINSAIL NETWORKS, INC.
+00D088 Terayon Communications Systems
 00D089 DYNACOLOR, INC.
 00D08A PHOTRON USA
 00D08B ADVA Limited
@@ -4384,7 +6500,7 @@
 00D095 XYLAN CORPORATION
 00D096 3COM EUROPE LTD.
 00D097 CISCO SYSTEMS, INC.
-00D098 IPS AUTOMATION
+00D098 Photon Dynamics Canada Inc.
 00D099 ELCARD OY
 00D09A FILANET CORPORATION
 00D09B SPECTEL LTD.
@@ -4413,9 +6529,9 @@
 00D0B2 XIOTECH CORPORATION
 00D0B3 DRS FLIGHT SAFETY AND
 00D0B4 KATSUJIMA CO., LTD.
-00D0B5 DOTCOM
+00D0B5 IPricot formerly DotCom
 00D0B6 CRESCENT NETWORKS, INC.
-00D0B7 INTEL CORPOTATION
+00D0B7 INTEL CORPORATION
 00D0B8 IOMEGA CORP.
 00D0B9 MICROTEK INTERNATIONAL, INC.
 00D0BA CISCO SYSTEMS, INC.
@@ -4478,7 +6594,7 @@
 00D0F3 SOLARI DI UDINE SPA
 00D0F4 CARINTHIAN TECH INSTITUTE
 00D0F5 ORANGE MICRO, INC.
-00D0F6 NORTHCHURCH COMMUNICATIONS INC
+00D0F6 Alcatel Canada
 00D0F7 NEXT NETS CORPORATION
 00D0F8 FUJIAN STAR TERMINAL
 00D0F9 ACUTE COMMUNICATIONS CORP.
@@ -4520,28 +6636,28 @@
 00E00D RADIANT SYSTEMS
 00E00E AVALON IMAGING SYSTEMS, INC.
 00E00F SHANGHAI BAUD DATA
-00E010 HESS SB-AUTOMATENBAU GMBH
-00E011 UNIDEN SAN DIEGO
-00E012 PLUTO TECHNOLOGIES
+00E010 HESS SB-AUTOMATENBAU GmbH
+00E011 UNIDEN SAN DIEGO R&D CENTER, INC.
+00E012 PLUTO TECHNOLOGIES INTERNATIONAL INC.
 00E013 EASTERN ELECTRONIC CO., LTD.
 00E014 CISCO SYSTEMS, INC.
 00E015 HEIWA CORPORATION
 00E016 RAPID CITY COMMUNICATIONS
-00E017 EXXACT GMBH
+00E017 EXXACT GmbH
 00E018 ASUSTEK COMPUTER INC.
 00E019 ING. GIORDANO ELETTRONICA
 00E01A COMTEC SYSTEMS. CO., LTD.
 00E01B SPHERE COMMUNICATIONS, INC.
 00E01C MOBILITY ELECTRONICSY
-00E01D WEBTV NETWORKS, INC.
+00E01D WebTV NETWORKS, INC.
 00E01E CISCO SYSTEMS, INC.
-00E01F AVIDIA SYSTEMS, INC.
+00E01F AVIDIA Systems, Inc.
 00E020 TECNOMEN OY
 00E021 FREEGATE CORP.
-00E022 MEDIALIGHT INC.
+00E022 MediaLight, Inc.
 00E023 TELRAD
 00E024 GADZOOX NETWORKS
-00E025 DIT CO., LTD.
+00E025 dit CO., LTD.
 00E026 EASTMAN KODAK CO.
 00E027 DUX, INC.
 00E028 APTIX CORPORATION
@@ -4549,13 +6665,13 @@
 00E02A TANDBERG TELEVISION AS
 00E02B EXTREME NETWORKS
 00E02C AST COMPUTER
-00E02D INNOMEDIALOGIC, INC.
+00E02D InnoMediaLogic, Inc.
 00E02E SPC ELECTRONICS CORPORATION
 00E02F MCNS HOLDINGS, L.P.
 00E030 MELITA INTERNATIONAL CORP.
 00E031 HAGIWARA ELECTRIC CO., LTD.
 00E032 MISYS FINANCIAL SYSTEMS, LTD.
-00E033 E.E.P.D. GMBH
+00E033 E.E.P.D. GmbH
 00E034 CISCO SYSTEMS, INC.
 00E035 LOUGHBOROUGH SOUND IMAGES, PLC
 00E036 PIONEER CORPORATION
@@ -4564,64 +6680,64 @@
 00E039 PARADYNE CORP.
 00E03A CABLETRON SYSTEMS, INC.
 00E03B PROMINET CORPORATION
-00E03C ADVANSYS
+00E03C AdvanSys
 00E03D FOCON ELECTRONIC SYSTEMS A/S
 00E03E ALFATECH, INC.
 00E03F JATON CORPORATION
-00E040 DESKSTATION TECHNOLOGY, INC.
+00E040 DeskStation Technology, Inc.
 00E041 CSPI
-00E042 PACOM DATA LTD.
-00E043 VITALCOM
+00E042 Pacom Systems Ltd.
+00E043 VitalCom
 00E044 LSICS CORPORATION
 00E045 TOUCHWAVE, INC.
 00E046 BENTLY NEVADA CORP.
 00E047 INFOCUS SYSTEMS
 00E048 SDL COMMUNICATIONS, INC.
-00E049 MICROWI ELECTRONIC GMBH
-00E04A ENHANCED MESSAGING SYSTEMS,INC
-00E04B JUMP INDUSTRIELLE
+00E049 MICROWI ELECTRONIC GmbH
+00E04A ENHANCED MESSAGING SYSTEMS, INC
+00E04B JUMP INDUSTRIELLE COMPUTERTECHNIK GmbH
 00E04C REALTEK SEMICONDUCTOR CORP.
 00E04D INTERNET INITIATIVE JAPAN, INC
 00E04E SANYO DENKI CO., LTD.
 00E04F CISCO SYSTEMS, INC.
-00E050 EXECUTONE INFORMATION
+00E050 EXECUTONE INFORMATION SYSTEMS, INC.
 00E051 TALX CORPORATION
 00E052 FOUNDRY NETWORKS, INC.
 00E053 CELLPORT LABS, INC.
 00E054 KODAI HITEC CO., LTD.
-00E055 INGENIERIA ELECTRONICA
+00E055 INGENIERIA ELECTRONICA COMERCIAL INELCOM S.A.
 00E056 HOLONTECH CORPORATION
 00E057 HAN MICROTELECOM. CO., LTD.
 00E058 PHASE ONE DENMARK A/S
 00E059 CONTROLLED ENVIRONMENTS, LTD.
 00E05A GALEA NETWORK SECURITY
 00E05B WEST END SYSTEMS CORP.
-00E05C MATSUSHITA KOTOBUKI
+00E05C MATSUSHITA KOTOBUKI ELECTRONICS INDUSTRIES, LTD.
 00E05D UNITEC CO., LTD.
-00E05E JAPAN AVIATION ELECTRONICS
-00E05F E-NET, INC.
+00E05E JAPAN AVIATION ELECTRONICS INDUSTRY, LTD.
+00E05F e-Net, Inc.
 00E060 SHERWOOD
-00E061 EDGEPOINT NETWORKS, INC.
+00E061 EdgePoint Networks, Inc.
 00E062 HOST ENGINEERING
 00E063 CABLETRON - YAGO SYSTEMS, INC.
 00E064 SAMSUNG ELECTRONICS
 00E065 OPTICAL ACCESS INTERNATIONAL
-00E066 PROMAX SYSTEMS, INC.
-00E067 EAC AUTOMATION-CONSULTING GMBH
+00E066 ProMax Systems, Inc.
+00E067 eac AUTOMATION-CONSULTING GmbH
 00E068 MERRIMAC SYSTEMS INC.
-00E069 JAYCOR NETWORKS, INC.
+00E069 JAYCOR
 00E06A KAPSCH AG
 00E06B W&G SPECIAL PRODUCTS
-00E06C BALTIMORE TECHNOLOGIES, LTD.
+00E06C AEP Systems International Ltd
 00E06D COMPUWARE CORPORATION
-00E06E FAR SYSTEMS SPA
-00E06F TERAYON CORP.
+00E06E FAR SYSTEMS S.p.A.
+00E06F Terayon Communications Systems
 00E070 DH TECHNOLOGY
 00E071 EPIS MICROCOMPUTER
 00E072 LYNK
-00E073 NATIONAL AMUSEMENT
+00E073 NATIONAL AMUSEMENT NETWORK, INC.
 00E074 TIERNAN COMMUNICATIONS, INC.
-00E075 ATLAS COMPUTER EQUIPMENT, INC.
+00E075 Verilink Corporation
 00E076 DEVELOPMENT CONCEPTS, INC.
 00E077 WEBGEAR, INC.
 00E078 BERKELEY NETWORKS
@@ -4631,7 +6747,7 @@
 00E07C METTLER-TOLEDO, INC.
 00E07D NETRONIX, INC.
 00E07E WALT DISNEY IMAGINEERING
-00E07F LOGISTISTEM SRL
+00E07F LOGISTISTEM s.r.l.
 00E080 CONTROL RESOURCES CORPORATION
 00E081 TYAN COMPUTER CORP.
 00E082 ANERMA
@@ -4639,11 +6755,11 @@
 00E084 COMPULITE R&D
 00E085 GLOBAL MAINTECH, INC.
 00E086 CYBEX COMPUTER PRODUCTS
-00E087 LECROY
+00E087 LeCroy - Networking Productions Division
 00E088 LTX CORPORATION
 00E089 ION Networks, Inc.
 00E08A GEC AVERY, LTD.
-00E08B QLOGIC CORP.
+00E08B QLogic Corp.
 00E08C NEOPARADIGM LABS, INC.
 00E08D PRESSURE SYSTEMS, INC.
 00E08E UTSTARCOM
@@ -4653,10 +6769,10 @@
 00E092 ADMTEK INCORPORATED
 00E093 ACKFIN NETWORKS
 00E094 OSAI SRL
-00E095 ADVANCED-VISION TECHNOLGIES
+00E095 ADVANCED-VISION TECHNOLGIES CORP.
 00E096 SHIMADZU CORPORATION
 00E097 CARRIER ACCESS CORPORATION
-00E098 ABOCOM SYSTEMS, INC.
+00E098 AboCom Systems, Inc.
 00E099 SAMSON AG
 00E09A POSITRON INDUSTRIES, INC.
 00E09B ENGAGE NETWORKS, INC.
@@ -4665,78 +6781,78 @@
 00E09E QUANTUM CORPORATION
 00E09F PIXEL VISION
 00E0A0 WILTRON CO.
-00E0A1 HIMA PAUL HILDEBRANDT
+00E0A1 HIMA PAUL HILDEBRANDT GmbH Co. KG
 00E0A2 MICROSLATE INC.
 00E0A3 CISCO SYSTEMS, INC.
-00E0A4 ESAOTE S.P.A.
-00E0A5 COMCORE SEMICONDUCTOR, INC.
+00E0A4 ESAOTE S.p.A.
+00E0A5 ComCore Semiconductor, Inc.
 00E0A6 TELOGY NETWORKS, INC.
 00E0A7 IPC INFORMATION SYSTEMS, INC.
-00E0A8 SAT GMBH&CO
+00E0A8 SAT GmbH & Co.
 00E0A9 FUNAI ELECTRIC CO., LTD.
 00E0AA ELECTROSONIC LTD.
 00E0AB DIMAT S.A.
 00E0AC MIDSCO, INC.
 00E0AD EES TECHNOLOGY, LTD.
 00E0AE XAQTI CORPORATION
-00E0AF GENERAL DYNAMICS INFORMATION
+00E0AF GENERAL DYNAMICS INFORMATION SYSTEMS
 00E0B0 CISCO SYSTEMS, INC.
 00E0B1 PACKET ENGINES, INC.
 00E0B2 TELMAX COMMUNICATIONS CORP.
-00E0B3 ETHERWAN SYSTEMS, INC.
+00E0B3 EtherWAN Systems, Inc.
 00E0B4 TECHNO SCOPE CO., LTD.
 00E0B5 ARDENT COMMUNICATIONS CORP.
 00E0B6 Entrada Networks
 00E0B7 PI GROUP, LTD.
 00E0B8 GATEWAY 2000
 00E0B9 BYAS SYSTEMS
-00E0BA BERGHOF AUTOMATIONSTECHNIK
+00E0BA BERGHOF AUTOMATIONSTECHNIK GmbH
 00E0BB NBX CORPORATION
 00E0BC SYMON COMMUNICATIONS, INC.
 00E0BD INTERFACE SYSTEMS, INC.
 00E0BE GENROCO INTERNATIONAL, INC.
-00E0BF TORRENT NETWORKING
-00E0C0 SEIWA ERECTRIC MFG. CO., LTD.
+00E0BF TORRENT NETWORKING TECHNOLOGIES CORP.
+00E0C0 SEIWA ELECTRIC MFG. CO., LTD.
 00E0C1 MEMOREX TELEX JAPAN, LTD.
-00E0C2 NECSY SPA
+00E0C2 NECSY S.p.A.
 00E0C3 SAKAI SYSTEM DEVELOPMENT CORP.
 00E0C4 HORNER ELECTRIC, INC.
 00E0C5 BCOM ELECTRONICS INC.
 00E0C6 LINK2IT, L.L.C.
 00E0C7 EUROTECH SRL
 00E0C8 VIRTUAL ACCESS, LTD.
-00E0C9 AUTOMATEDLOGIC CORPORATION
+00E0C9 AutomatedLogic Corporation
 00E0CA BEST DATA PRODUCTS
 00E0CB RESON, INC.
 00E0CC HERO SYSTEMS, LTD.
 00E0CD SENSIS CORPORATION
 00E0CE ARN
-00E0CF INTEGRATED DEVICE
+00E0CF INTEGRATED DEVICE TECHNOLOGY, INC.
 00E0D0 NETSPEED, INC.
 00E0D1 TELSIS LIMITED
 00E0D2 VERSANET COMMUNICATIONS, INC.
-00E0D3 DATENTECHNIK GMBH
+00E0D3 DATENTECHNIK GmbH
 00E0D4 EXCELLENT COMPUTER
 00E0D5 ARCXEL TECHNOLOGIES, INC.
-00E0D6 COMPUTER & COMMUNICATION
+00E0D6 COMPUTER & COMMUNICATION RESEARCH LAB.
 00E0D7 SUNSHINE ELECTRONICS, INC.
-00E0D8 LANBIT COMPUTER, INC.
+00E0D8 LANBit Computer, Inc.
 00E0D9 TAZMO CO., LTD.
-00E0DA ASSURED ACCESS
-00E0DB VIAVIDEO COMMUNICATIONS
+00E0DA ASSURED ACCESS TECHNOLOGY, INC.
+00E0DB ViaVideo Communications, Inc.
 00E0DC NEXWARE CORP.
 00E0DD ZENITH ELECTRONICS CORPORATION
 00E0DE DATAX NV
 00E0DF KE KOMMUNIKATIONS-ELECTRONIK
 00E0E0 SI ELECTRONICS, LTD.
-00E0E1 G2 NETWORKS, ILNC.
+00E0E1 G2 NETWORKS, INC.
 00E0E2 INNOVA CORP.
-00E0E3 SK-ELEKTRONIK GMBH
-00E0E4 FANUC ROBOTICS NORTH AMERICA,
+00E0E3 SK-ELEKTRONIK GmbH
+00E0E4 FANUC ROBOTICS NORTH AMERICA, Inc.
 00E0E5 CINCO NETWORKS, INC.
 00E0E6 INCAA DATACOM B.V.
 00E0E7 RAYTHEON E-SYSTEMS, INC.
-00E0E8 GRETACODER DATA SYSTEMS AG
+00E0E8 GRETACODER Data Systems AG
 00E0E9 DATA LABS, INC.
 00E0EA INNOVAT COMMUNICATIONS, INC.
 00E0EB DIGICOM SYSTEMS, INCORPORATED
@@ -4747,19 +6863,19 @@
 00E0F0 ABLER TECHNOLOGY, INC.
 00E0F1 THAT CORPORATION
 00E0F2 ARLOTTO COMNET, INC.
-00E0F3 WEBSPRINT COMMUNICATIONS, INC.
-00E0F4 INSIDE TECHNOLOGY A/S
+00E0F3 WebSprint Communications, Inc.
+00E0F4 INSIDE Technology A/S
 00E0F5 TELES AG
 00E0F6 DECISION EUROPE
 00E0F7 CISCO SYSTEMS, INC.
-00E0F8 DIANA CONTROL AB
+00E0F8 DICNA CONTROL AB
 00E0F9 CISCO SYSTEMS, INC.
 00E0FA TRL TECHNOLOGY, LTD.
 00E0FB LEIGHTRONIX, INC.
 00E0FC HUAWEI TECHNOLOGIES CO., LTD.
 00E0FD A-TREND TECHNOLOGY CO., LTD.
 00E0FE CISCO SYSTEMS, INC.
-00E0FF SECURITY DYNAMICS TECHNOLOGIES
+00E0FF SECURITY DYNAMICS TECHNOLOGIES, Inc.
 00E6D3 NIXDORF COMPUTER CORP.
 020701 RACAL-DATACOM
 021C7C PERQ SYSTEMS CORPORATION
@@ -4809,12 +6925,12 @@
 080020 SUN MICROSYSTEMS INC.
 080021 3M COMPANY
 080022 NBI INC.
-080023 MATSUHITA GRAPHIC COMM SYS INC
+080023 Panasonic Communications Co., Ltd.
 080024 10NET COMMUNICATIONS/DCA
 080025 CONTROL DATA
 080026 NORSK DATA A.S.
 080027 CADMUS COMPUTER SYSTEMS
-080028 TEXAS INSTRUMENTS
+080028 Texas Instruments
 080029 MEGATEK CORPORATION
 08002A MOSAIC TECHNOLOGIES INC.
 08002B DIGITAL EQUIPMENT CORPORATION
@@ -4905,10 +7021,10 @@
 080080 AES DATA INC.
 080081 ,ASTECH INC.
 080082 VERITAS SOFTWARE
-080083 SEIKO INSTRUM. AND ELECTRONICS
+080083 Seiko Instruments Inc.
 080084 TOMEN ELECTRONICS CORP.
 080085 ELXSI
-080086 IMAGEN CORPORATION
+080086 KONICA MINOLTA HOLDINGS, INC.
 080087 XYPLEX
 080088 MCDATA CORPORATION
 080089 KINETICS
@@ -4919,7 +7035,8 @@
 08008E TANDEM COMPUTERS
 08008F CHIPCOM CORPORATION
 080090 SONOMA SYSTEMS
-08BBCC AK-NORD EDV VERTRIEBSGES. MBH
+081443 UNIBRAIN S.A.
+08BBCC AK-NORD EDV VERTRIEBSGES. mbH
 10005A IBM CORPORATION
 1000E8 NATIONAL SEMICONDUCTOR
 800010 ATT BELL LABORATORIES
diff -Nru a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c
--- a/drivers/ieee1394/raw1394.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/ieee1394/raw1394.c	Tue Feb  3 19:45:16 2004
@@ -38,6 +38,7 @@
 #include <linux/smp_lock.h>
 #include <linux/interrupt.h>
 #include <linux/vmalloc.h>
+#include <linux/cdev.h>
 #include <asm/uaccess.h>
 #include <asm/atomic.h>
 #include <linux/devfs_fs_kernel.h>
@@ -1695,7 +1696,7 @@
                 spin_unlock_irqrestore(&host_info_lock, flags);
                 return sizeof(struct raw1394_request);
         }
-        retval = hpsb_register_addrspace(&raw1394_highlevel, &arm_ops, req->req.address,
+        retval = hpsb_register_addrspace(&raw1394_highlevel, fi->host, &arm_ops, req->req.address,
                 req->req.address + req->req.length);
         if (retval) {
                /* INSERT ENTRY */
@@ -1782,7 +1783,7 @@
                 spin_unlock_irqrestore(&host_info_lock, flags);
                 return sizeof(struct raw1394_request);
         } 
-        retval = hpsb_unregister_addrspace(&raw1394_highlevel, addr->start);
+        retval = hpsb_unregister_addrspace(&raw1394_highlevel, fi->host, addr->start);
         if (!retval) {
                 printk(KERN_ERR "raw1394: arm_Unregister failed -> EINVAL\n");
                 spin_unlock_irqrestore(&host_info_lock, flags);
@@ -2464,10 +2465,6 @@
 {
         struct file_info *fi;
 
-        if (ieee1394_file_to_instance(file) > 0) {
-                return -ENXIO;
-        }
-
         fi = kmalloc(sizeof(struct file_info), SLAB_KERNEL);
         if (fi == NULL)
                 return -ENOMEM;
@@ -2554,7 +2551,7 @@
                 }
                 if (!another_host) {
                         DBGMSG("raw1394_release: call hpsb_arm_unregister");
-                        retval = hpsb_unregister_addrspace(&raw1394_highlevel, addr->start);
+                        retval = hpsb_unregister_addrspace(&raw1394_highlevel, fi->host, addr->start);
                         if (!retval) {
                                 ++fail;
                                 printk(KERN_ERR "raw1394_release arm_Unregister failed\n");
@@ -2646,7 +2643,8 @@
         .fcp_request = fcp_request,
 };
 
-static struct file_operations file_ops = {
+static struct cdev raw1394_cdev;
+static struct file_operations raw1394_fops = {
 	.owner =	THIS_MODULE,
         .read =		raw1394_read, 
         .write =	raw1394_write,
@@ -2664,8 +2662,10 @@
         devfs_mk_cdev(MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16),
 			S_IFCHR | S_IRUSR | S_IWUSR, RAW1394_DEVICE_NAME);
 
-        if (ieee1394_register_chardev(IEEE1394_MINOR_BLOCK_RAW1394,
-                                      THIS_MODULE, &file_ops)) {
+	cdev_init(&raw1394_cdev, &raw1394_fops);
+	raw1394_cdev.owner = THIS_MODULE;
+	kobject_set_name(&raw1394_cdev.kobj, RAW1394_DEVICE_NAME);
+	if (cdev_add(&raw1394_cdev, IEEE1394_RAW1394_DEV, 1)) {
                 HPSB_ERR("raw1394 failed to register minor device block");
                 devfs_remove(RAW1394_DEVICE_NAME);
                 hpsb_unregister_highlevel(&raw1394_highlevel);
@@ -2682,7 +2682,8 @@
 static void __exit cleanup_raw1394(void)
 {
 	hpsb_unregister_protocol(&raw1394_driver);
-        ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_RAW1394);
+	cdev_unmap(IEEE1394_RAW1394_DEV, 1);
+	cdev_del(&raw1394_cdev);
         devfs_remove(RAW1394_DEVICE_NAME);
         hpsb_unregister_highlevel(&raw1394_highlevel);
 }
@@ -2690,3 +2691,4 @@
 module_init(init_raw1394);
 module_exit(cleanup_raw1394);
 MODULE_LICENSE("GPL");
+MODULE_ALIAS_CHARDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16);
diff -Nru a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
--- a/drivers/ieee1394/sbp2.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/ieee1394/sbp2.c	Tue Feb  3 19:45:17 2004
@@ -77,7 +77,7 @@
 #include "sbp2.h"
 
 static char version[] __devinitdata =
-	"$Rev: 1082 $ Ben Collins <bcollins@debian.org>";
+	"$Rev: 1096 $ Ben Collins <bcollins@debian.org>";
 
 /*
  * Module load parameter definitions
@@ -712,6 +712,18 @@
 		return NULL;
 	}
 
+	/* Register our sbp2 status address space... */
+	hpsb_register_addrspace(&sbp2_highlevel, host, &sbp2_ops,
+				SBP2_STATUS_FIFO_ADDRESS,
+				SBP2_STATUS_FIFO_ADDRESS +
+				SBP2_STATUS_FIFO_ENTRY_TO_OFFSET(SBP2SCSI_MAX_SCSI_IDS+1));
+
+	/* Handle data movement if physical dma is not enabled/supported
+	 * on host controller */
+#ifdef CONFIG_IEEE1394_SBP2_PHYS_DMA
+	hpsb_register_addrspace(&sbp2_highlevel, host, &sbp2_physdma_ops, 0x0ULL, 0xfffffffcULL);
+#endif
+
 	hi = hpsb_create_hostinfo(&sbp2_highlevel, host, sizeof(*hi));
 	if (!hi) {
 		SBP2_ERR("failed to allocate hostinfo");
@@ -733,6 +745,7 @@
 		SBP2_ERR("failed to add scsi host");
 		scsi_host_put(hi->scsi_host);
 		hpsb_destroy_hostinfo(&sbp2_highlevel, host);
+		return NULL;
 	}
 
 	return hi;
@@ -978,6 +991,9 @@
 		return PTR_ERR(sdev);
 	}
 
+	sdev->hostdata = scsi_id;
+	scsi_id->sdev = sdev;
+
 	return 0;
 }
 
@@ -987,7 +1003,6 @@
 static void sbp2_remove_device(struct scsi_id_instance_data *scsi_id)
 {
 	struct sbp2scsi_host_info *hi = scsi_id->hi;
-	struct scsi_device *sdev;
 
 	SBP2_DEBUG("sbp2_remove_device");
 
@@ -995,12 +1010,9 @@
 	sbp2scsi_complete_all_commands(scsi_id, DID_NO_CONNECT);
 
 	/* Remove it from the scsi layer now */
-	/* XXX(hch): why can't we simply cache the scsi_device
-	   	     in struct scsi_id_instance_data? */
-	sdev = scsi_device_lookup(hi->scsi_host, 0, scsi_id->id, 0);
-	if (sdev) {
-		scsi_remove_device(sdev);
-		scsi_device_put(sdev);
+	if (scsi_id->sdev) {
+		scsi_remove_device(scsi_id->sdev);
+		scsi_device_put(scsi_id->sdev);
 	}
 
 	sbp2util_remove_command_orb_pool(scsi_id);
@@ -2837,6 +2849,27 @@
         return "SCSI emulation for IEEE-1394 SBP-2 Devices";
 }
 
+static ssize_t sbp2_sysfs_ieee1394_guid_show(struct device *dev, char *buf)
+{
+	struct scsi_device *sdev;
+	struct scsi_id_instance_data *scsi_id;
+
+	if (!(sdev = to_scsi_device(dev)))
+		return 0;
+
+	if (!(scsi_id = sdev->hostdata))
+		return 0;
+
+	return sprintf(buf, "%016Lx\n", (unsigned long long)scsi_id->ne->guid);
+}
+
+static DEVICE_ATTR(ieee1394_guid, S_IRUGO, sbp2_sysfs_ieee1394_guid_show, NULL);
+
+static struct device_attribute *sbp2_sysfs_sdev_attrs[] = {
+	&dev_attr_ieee1394_guid,
+	NULL
+};
+
 MODULE_AUTHOR("Ben Collins <bcollins@debian.org>");
 MODULE_DESCRIPTION("IEEE-1394 SBP-2 protocol driver");
 MODULE_SUPPORTED_DEVICE(SBP2_DEVICE_NAME);
@@ -2859,6 +2892,7 @@
 	.cmd_per_lun =			SBP2_MAX_CMDS_PER_LUN,
 	.can_queue = 			SBP2_MAX_SCSI_QUEUE,
 	.emulated =			1,
+	.sdev_attrs =			sbp2_sysfs_sdev_attrs,
 };
 
 static int sbp2_module_init(void)
@@ -2880,17 +2914,6 @@
 
 	/* Register our high level driver with 1394 stack */
 	hpsb_register_highlevel(&sbp2_highlevel);
-
-	/* Register our sbp2 status address space... */
-	hpsb_register_addrspace(&sbp2_highlevel, &sbp2_ops, SBP2_STATUS_FIFO_ADDRESS,
-				SBP2_STATUS_FIFO_ADDRESS + 
-				SBP2_STATUS_FIFO_ENTRY_TO_OFFSET(SBP2SCSI_MAX_SCSI_IDS+1));
-
-	/* Handle data movement if physical dma is not enabled/supported
-	 * on host controller */
-#ifdef CONFIG_IEEE1394_SBP2_PHYS_DMA
-	hpsb_register_addrspace(&sbp2_highlevel, &sbp2_physdma_ops, 0x0ULL, 0xfffffffcULL);
-#endif
 
 	hpsb_register_protocol(&sbp2_driver);
 
diff -Nru a/drivers/ieee1394/sbp2.h b/drivers/ieee1394/sbp2.h
--- a/drivers/ieee1394/sbp2.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/ieee1394/sbp2.h	Tue Feb  3 19:45:17 2004
@@ -410,6 +410,9 @@
 	/* A backlink to our host_info */
 	struct sbp2scsi_host_info *hi;
 
+	/* The scsi_device associated with this scsi_id */
+	struct scsi_device *sdev;
+
 	/* Device specific workarounds/brokeness */
 	u32 workarounds;
 };
diff -Nru a/drivers/ieee1394/video1394.c b/drivers/ieee1394/video1394.c
--- a/drivers/ieee1394/video1394.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/ieee1394/video1394.c	Tue Feb  3 19:45:17 2004
@@ -46,6 +46,7 @@
 #include <linux/mm.h>
 #include <linux/ioctl32.h>
 #include <linux/compat.h>
+#include <linux/cdev.h>
 
 #include "ieee1394.h"
 #include "ieee1394_types.h"
@@ -1231,6 +1232,7 @@
 	return 0;
 }
 
+static struct cdev video1394_cdev;
 static struct file_operations video1394_fops=
 {
 	.owner =	THIS_MODULE,
@@ -1445,18 +1447,18 @@
 	hpsb_unregister_highlevel(&video1394_highlevel);
 
 	devfs_remove(VIDEO1394_DRIVER_NAME);
-	ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_VIDEO1394);
+	cdev_unmap(IEEE1394_VIDEO1394_DEV, 16);
+	cdev_del(&video1394_cdev);
 
 	PRINT_G(KERN_INFO, "Removed " VIDEO1394_DRIVER_NAME " module");
 }
 
 static int __init video1394_init_module (void)
 {
-	int ret;
-
-	ret = ieee1394_register_chardev(IEEE1394_MINOR_BLOCK_VIDEO1394,
-					THIS_MODULE, &video1394_fops);
-	if (ret) {
+	cdev_init(&video1394_cdev, &video1394_fops);
+	video1394_cdev.owner = THIS_MODULE;
+	kobject_set_name(&video1394_cdev.kobj, VIDEO1394_DRIVER_NAME);
+	if (cdev_add(&video1394_cdev, IEEE1394_VIDEO1394_DEV, 16)) {
 		PRINT_G(KERN_ERR, "video1394: unable to get minor device block");
 		return -EIO;
         }
@@ -1468,25 +1470,29 @@
 	hpsb_register_protocol(&video1394_driver);
 
 #ifdef CONFIG_COMPAT
-	/* First the compatible ones */
-	ret = register_ioctl32_conversion(VIDEO1394_IOC_LISTEN_CHANNEL, NULL);
-	ret |= register_ioctl32_conversion(VIDEO1394_IOC_UNLISTEN_CHANNEL, NULL);
-	ret |= register_ioctl32_conversion(VIDEO1394_IOC_TALK_CHANNEL, NULL);
-	ret |= register_ioctl32_conversion(VIDEO1394_IOC_UNTALK_CHANNEL, NULL);
-
-	/* These need translation */
-	ret |= register_ioctl32_conversion(VIDEO1394_IOC32_LISTEN_QUEUE_BUFFER,
-				    video1394_w_wait32);
-	ret |= register_ioctl32_conversion(VIDEO1394_IOC32_LISTEN_WAIT_BUFFER,
-				    video1394_wr_wait32);
-	ret |= register_ioctl32_conversion(VIDEO1394_IOC_TALK_QUEUE_BUFFER,
-				    video1394_queue_buf32);
-	ret |= register_ioctl32_conversion(VIDEO1394_IOC32_TALK_WAIT_BUFFER,
-				    video1394_w_wait32);
-	ret |= register_ioctl32_conversion(VIDEO1394_IOC32_LISTEN_POLL_BUFFER,
-				    video1394_wr_wait32);
-	if (ret)
-		PRINT_G(KERN_INFO, "Error registering ioctl32 translations");
+	{
+		int ret;
+
+		/* First the compatible ones */
+		ret = register_ioctl32_conversion(VIDEO1394_IOC_LISTEN_CHANNEL, NULL);
+		ret |= register_ioctl32_conversion(VIDEO1394_IOC_UNLISTEN_CHANNEL, NULL);
+		ret |= register_ioctl32_conversion(VIDEO1394_IOC_TALK_CHANNEL, NULL);
+		ret |= register_ioctl32_conversion(VIDEO1394_IOC_UNTALK_CHANNEL, NULL);
+
+		/* These need translation */
+		ret |= register_ioctl32_conversion(VIDEO1394_IOC32_LISTEN_QUEUE_BUFFER,
+					    video1394_w_wait32);
+		ret |= register_ioctl32_conversion(VIDEO1394_IOC32_LISTEN_WAIT_BUFFER,
+					    video1394_wr_wait32);
+		ret |= register_ioctl32_conversion(VIDEO1394_IOC_TALK_QUEUE_BUFFER,
+					    video1394_queue_buf32);
+		ret |= register_ioctl32_conversion(VIDEO1394_IOC32_TALK_WAIT_BUFFER,
+					    video1394_w_wait32);
+		ret |= register_ioctl32_conversion(VIDEO1394_IOC32_LISTEN_POLL_BUFFER,
+					    video1394_wr_wait32);
+		if (ret)
+			PRINT_G(KERN_INFO, "Error registering ioctl32 translations");
+	}
 #endif
 
 	PRINT_G(KERN_INFO, "Installed " VIDEO1394_DRIVER_NAME " module");
@@ -1496,3 +1502,4 @@
 
 module_init(video1394_init_module);
 module_exit(video1394_exit_module);
+MODULE_ALIAS_CHARDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_VIDEO1394 * 16);
diff -Nru a/drivers/input/evdev.c b/drivers/input/evdev.c
--- a/drivers/input/evdev.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/input/evdev.c	Tue Feb  3 19:45:34 2004
@@ -92,6 +92,7 @@
 static void evdev_free(struct evdev *evdev)
 {
 	devfs_remove("input/event%d", evdev->minor);
+	class_simple_device_remove(MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + evdev->minor));
 	evdev_table[evdev->minor] = NULL;
 	kfree(evdev);
 }
@@ -426,6 +427,9 @@
 
 	devfs_mk_cdev(MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor),
 			S_IFCHR|S_IRUGO|S_IWUSR, "input/event%d", minor);
+	class_simple_device_add(input_class, 
+				MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor),
+				dev->dev, "event%d", minor);
 
 	return &evdev->handle;
 }
diff -Nru a/drivers/input/input.c b/drivers/input/input.c
--- a/drivers/input/input.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/input/input.c	Tue Feb  3 19:45:28 2004
@@ -720,15 +720,13 @@
 static inline int input_proc_init(void) { return 0; }
 #endif
 
-struct class input_class = {
-	.name		= "input",
-};
+struct class_simple *input_class;
 
 static int __init input_init(void)
 {
 	int retval = -ENOMEM;
 
-	class_register(&input_class);
+	input_class = class_simple_create(THIS_MODULE, "input");
 	input_proc_init();
 	retval = register_chrdev(INPUT_MAJOR, "input", &input_fops);
 	if (retval) {
@@ -757,7 +755,7 @@
 
 	devfs_remove("input");
 	unregister_chrdev(INPUT_MAJOR, "input");
-	class_unregister(&input_class);
+	class_simple_destroy(input_class);
 }
 
 subsys_initcall(input_init);
diff -Nru a/drivers/input/joydev.c b/drivers/input/joydev.c
--- a/drivers/input/joydev.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/input/joydev.c	Tue Feb  3 19:45:18 2004
@@ -143,8 +143,9 @@
 
 static void joydev_free(struct joydev *joydev)
 {
-	devfs_remove("js%d", joydev->minor);
+	devfs_remove("input/js%d", joydev->minor);
 	joydev_table[joydev->minor] = NULL;
+	class_simple_device_remove(MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + joydev->minor));
 	kfree(joydev);
 }
 
@@ -290,7 +291,7 @@
 	struct joydev_list *list = file->private_data;
 	struct joydev *joydev = list->joydev;
 	struct input_dev *dev = joydev->handle.dev;
-	int i;
+	int i, j;
 
 	if (!joydev->exist) return -ENODEV;
 
@@ -324,8 +325,14 @@
 		case JSIOCGBUTTONS:
 			return put_user(joydev->nkey, (__u8 *) arg);
 		case JSIOCSCORR:
-			return copy_from_user(joydev->corr, (struct js_corr *) arg,
-						sizeof(struct js_corr) * joydev->nabs) ? -EFAULT : 0;
+			if (copy_from_user(joydev->corr, (struct js_corr *)arg,
+				      sizeof(struct js_corr) * joydev->nabs))
+			    return -EFAULT;
+			for (i = 0; i < joydev->nabs; i++) {
+				j = joydev->abspam[i];
+			        joydev->abs[i] = joydev_correct(dev->abs[j], joydev->corr + i);
+			}
+			return 0;
 		case JSIOCGCORR:
 			return copy_to_user((struct js_corr *) arg, joydev->corr,
 						sizeof(struct js_corr) * joydev->nabs) ? -EFAULT : 0;
@@ -426,6 +433,7 @@
 		j = joydev->abspam[i];
 		if (dev->absmax[j] == dev->absmin[j]) {
 			joydev->corr[i].type = JS_CORR_NONE;
+			joydev->abs[i] = dev->abs[j];
 			continue;
 		}
 		joydev->corr[i].type = JS_CORR_BROKEN;
@@ -443,7 +451,10 @@
 	joydev_table[minor] = joydev;
 	
 	devfs_mk_cdev(MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor),
-			S_IFCHR|S_IRUGO|S_IWUSR, "js%d", minor);
+			S_IFCHR|S_IRUGO|S_IWUSR, "input/js%d", minor);
+	class_simple_device_add(input_class, 
+				MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor),
+				dev->dev, "js%d", minor);
 
 	return &joydev->handle;
 }
diff -Nru a/drivers/input/keyboard/98kbd.c b/drivers/input/keyboard/98kbd.c
--- a/drivers/input/keyboard/98kbd.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/input/keyboard/98kbd.c	Tue Feb  3 19:45:17 2004
@@ -47,9 +47,9 @@
 	  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 43, 14, 15,
 	 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 41, 26, 28, 30, 31, 32,
 	 33, 34, 35, 36, 37, 38, 39, 40, 27, 44, 45, 46, 47, 48, 49, 50,
-	 51, 52, 53, 12, 57,184,109,104,110,111,103,105,106,108,102,107,
-	 74, 98, 71, 72, 73, 55, 75, 76, 77, 78, 79, 80, 81,117, 82,124,
-	 83,185, 87, 88, 85, 89, 90,  0,  0,  0,  0,  0,  0,  0,102,  0,
+	 51, 52, 53, 12, 57, 92,109,104,110,111,103,105,106,108,102,107,
+	 74, 98, 71, 72, 73, 55, 75, 76, 77, 78, 79, 80, 81,117, 82,121,
+	 83, 94, 87, 88,183,184,185,  0,  0,  0,  0,  0,  0,  0,102,  0,
 	 99,133, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,  0,  0,  0,  0,
 	 54, 58, 42, 56, 29
 };
diff -Nru a/drivers/input/keyboard/amikbd.c b/drivers/input/keyboard/amikbd.c
--- a/drivers/input/keyboard/amikbd.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/input/keyboard/amikbd.c	Tue Feb  3 19:45:42 2004
@@ -48,8 +48,8 @@
 static unsigned char amikbd_keycode[0x78] = {
 	 41,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 43,  0, 82,
 	 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,  0, 79, 80, 81,
-	 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,  0,  0, 75, 76, 77,
-	  0, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,  0, 83, 71, 72, 73,
+	 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 43,  0, 75, 76, 77,
+	 86, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,  0, 83, 71, 72, 73,
 	 57, 14, 15, 96, 28,  1,111,  0,  0,  0, 74,  0,103,108,106,105,
 	 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,179,180, 98, 55, 78,138,
 	 42, 54, 58, 29, 56,100,125,126
diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c	Tue Feb  3 19:45:40 2004
+++ b/drivers/input/keyboard/atkbd.c	Tue Feb  3 19:45:40 2004
@@ -19,6 +19,7 @@
 
 #include <linux/delay.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
@@ -35,27 +36,40 @@
 MODULE_LICENSE("GPL");
 
 static int atkbd_set = 2;
-#if defined(__i386__) || defined (__x86_64__)
+module_param_named(set, atkbd_set, int, 0);
+MODULE_PARM_DESC(set, "Select keyboard code set (2 = default, 3, 4)");
+#if defined(__i386__) || defined(__x86_64__) || defined(__hppa__)
 static int atkbd_reset;
 #else
 static int atkbd_reset = 1;
 #endif
 static int atkbd_softrepeat;
 
+module_param_named(reset, atkbd_reset, bool, 0);
+MODULE_PARM_DESC(reset, "Reset keyboard during initialization");
+
+static int atkbd_softrepeat;
+module_param_named(softrepeat, atkbd_softrepeat, bool, 0);
+MODULE_PARM_DESC(softrepeat, "Use software keyboard repeat");
+
 /*
  * Scancode to keycode tables. These are just the default setting, and
  * are loadable via an userland utility.
  */
 
+#if defined(__hppa__)
+#include "hpps2atkbd.h"
+#else
+
 static unsigned char atkbd_set2_keycode[512] = {
 
 	  0, 67, 65, 63, 61, 59, 60, 88,  0, 68, 66, 64, 62, 15, 41,117,
-	  0, 56, 42,182, 29, 16,  2,  0,  0,  0, 44, 31, 30, 17,  3,  0,
-	  0, 46, 45, 32, 18,  5,  4,186,  0, 57, 47, 33, 20, 19,  6, 85,
-	  0, 49, 48, 35, 34, 21,  7, 89,  0,  0, 50, 36, 22,  8,  9, 90,
+	  0, 56, 42, 93, 29, 16,  2,  0,  0,  0, 44, 31, 30, 17,  3,  0,
+	  0, 46, 45, 32, 18,  5,  4, 95,  0, 57, 47, 33, 20, 19,  6,183,
+	  0, 49, 48, 35, 34, 21,  7,184,  0,  0, 50, 36, 22,  8,  9,185,
 	  0, 51, 37, 23, 24, 11, 10,  0,  0, 52, 53, 38, 39, 25, 12,  0,
-	  0,181, 40,  0, 26, 13,  0,  0, 58, 54, 28, 27,  0, 43,  0,194,
-	  0, 86,193,192,184,  0, 14,185,  0, 79,182, 75, 71,124,  0,  0,
+	  0, 89, 40,  0, 26, 13,  0,  0, 58, 54, 28, 27,  0, 43,  0, 85,
+	  0, 86, 91, 90, 92,  0, 14, 94,  0, 79,124, 75, 71,121,  0,  0,
 	 82, 83, 80, 76, 77, 72,  1, 69, 87, 78, 81, 74, 55, 73, 70, 99,
 
 	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
@@ -70,6 +84,8 @@
 	  0,  0,  0, 65, 99,
 };
 
+#endif
+
 static unsigned char atkbd_set3_keycode[512] = {
 
 	  0,  0,  0,  0,  0,  0,  0, 59,  1,138,128,129,130, 15, 41, 60,
@@ -77,11 +93,11 @@
 	134, 46, 45, 32, 18,  5,  4, 63,135, 57, 47, 33, 20, 19,  6, 64,
 	136, 49, 48, 35, 34, 21,  7, 65,137,100, 50, 36, 22,  8,  9, 66,
 	125, 51, 37, 23, 24, 11, 10, 67,126, 52, 53, 38, 39, 25, 12, 68,
-	113,114, 40, 84, 26, 13, 87, 99, 97, 54, 28, 27, 43, 84, 88, 70,
+	113,114, 40, 43, 26, 13, 87, 99, 97, 54, 28, 27, 43, 43, 88, 70,
 	108,105,119,103,111,107, 14,110,  0, 79,106, 75, 71,109,102,104,
-	 82, 83, 80, 76, 77, 72, 69, 98,  0, 96, 81,  0, 78, 73, 55, 85,
+	 82, 83, 80, 76, 77, 72, 69, 98,  0, 96, 81,  0, 78, 73, 55,183,
 
-	 89, 90, 91, 92, 74,185,184,182,  0,  0,  0,125,126,127,112,  0,
+	184,185,186,187, 74, 94, 92, 93,  0,  0,  0,125,126,127,112,  0,
 	  0,139,150,163,165,115,152,150,166,140,160,154,113,114,167,168,
 	148,149,147,140
 };
@@ -236,10 +252,10 @@
 			atkbd->release = 1;
 			goto out;
 		case ATKBD_RET_HANGUEL:
-			atkbd_report_key(&atkbd->dev, regs, KEY_LANG1, 3);
+			atkbd_report_key(&atkbd->dev, regs, KEY_HANGUEL, 3);
 			goto out;
 		case ATKBD_RET_HANJA:
-			atkbd_report_key(&atkbd->dev, regs, KEY_LANG2, 3);
+			atkbd_report_key(&atkbd->dev, regs, KEY_HANJA, 3);
 			goto out;
 		case ATKBD_RET_ERR:
 			printk(KERN_WARNING "atkbd.c: Keyboard on %s reports too many keys pressed.\n", serio->phys);
@@ -262,6 +278,11 @@
 				atkbd->release ? "released" : "pressed",
 				atkbd->translated ? "translated" : "raw", 
 				atkbd->set, code, serio->phys);
+			if (atkbd->translated && atkbd->set == 2 && code == 0x7a)
+				printk(KERN_WARNING "atkbd.c: This is an XFree86 bug. It shouldn't access"
+					" hardware directly.\n");
+			else
+				printk(KERN_WARNING "atkbd.c: Use 'setkeycodes %s%02x <keycode>' to make it known.\n",						code & 0x80 ? "e0" : "", code & 0x7f);
 			break;
 		default:
 			value = atkbd->release ? 0 :
@@ -328,6 +349,10 @@
 
 	if (command == ATKBD_CMD_RESET_BAT)
 		timeout = 2000000; /* 2 sec */
+
+	if (receive && param)
+		for (i = 0; i < receive; i++)
+			atkbd->cmdbuf[(receive - 1) - i] = param[i];
 	
 	if (command & 0xff)
 		if (atkbd_sendbyte(atkbd, command & 0xff))
@@ -380,7 +405,7 @@
 		 133, 149, 167, 182, 200, 217, 232, 250, 270, 303, 333, 370, 400, 435, 470, 500 };
 	const short delay[4] =
 		{ 250, 500, 750, 1000 };
-	char param[2];
+	unsigned char param[2];
 	int i, j;
 
 	if (!atkbd->write)
@@ -390,9 +415,9 @@
 
 		case EV_LED:
 
-			*param = (test_bit(LED_SCROLLL, dev->led) ? 1 : 0)
-			       | (test_bit(LED_NUML,    dev->led) ? 2 : 0)
-			       | (test_bit(LED_CAPSL,   dev->led) ? 4 : 0);
+			param[0] = (test_bit(LED_SCROLLL, dev->led) ? 1 : 0)
+			         | (test_bit(LED_NUML,    dev->led) ? 2 : 0)
+			         | (test_bit(LED_CAPSL,   dev->led) ? 4 : 0);
 		        atkbd_command(atkbd, param, ATKBD_CMD_SETLEDS);
 
 			if (atkbd->set == 4) {
@@ -451,6 +476,7 @@
  * should make sure we don't try to set the LEDs on it.
  */
 
+	param[0] = param[1] = 0xa5;	/* initialize with invalid values */
 	if (atkbd_command(atkbd, param, ATKBD_CMD_GETID)) {
 
 /*
@@ -469,6 +495,11 @@
 		return -1;
 	atkbd->id = (param[0] << 8) | param[1];
 
+	if (atkbd->id == 0xaca1 && atkbd->translated) {
+		printk(KERN_ERR "atkbd.c: NCD terminal keyboards are only supported on non-translating\n");
+		printk(KERN_ERR "atkbd.c: controllers. Use i8042.direct=1 to disable translation.\n");
+		return -1;
+	}
 
 	return 0;
 }
@@ -652,6 +683,7 @@
 
 		if (atkbd_probe(atkbd)) {
 			serio_close(serio);
+			serio->private = NULL;
 			kfree(atkbd);
 			return;
 		}
@@ -759,34 +791,6 @@
 	.disconnect =	atkbd_disconnect,
 	.cleanup =	atkbd_cleanup,
 };
-
-#ifndef MODULE
-static int __init atkbd_setup_set(char *str)
-{
-        int ints[4];
-        str = get_options(str, ARRAY_SIZE(ints), ints);
-        if (ints[0] > 0) atkbd_set = ints[1];
-        return 1;
-}
-static int __init atkbd_setup_reset(char *str)
-{
-        int ints[4];
-        str = get_options(str, ARRAY_SIZE(ints), ints);
-        if (ints[0] > 0) atkbd_reset = ints[1];
-        return 1;
-}
-static int __init atkbd_setup_softrepeat(char *str)
-{
-        int ints[4];
-        str = get_options(str, ARRAY_SIZE(ints), ints);
-        if (ints[0] > 0) atkbd_softrepeat = ints[1];
-        return 1;
-}
-
-__setup("atkbd_set=", atkbd_setup_set);
-__setup("atkbd_reset", atkbd_setup_reset);
-__setup("atkbd_softrepeat=", atkbd_setup_softrepeat);
-#endif
 
 int __init atkbd_init(void)
 {
diff -Nru a/drivers/input/keyboard/hpps2atkbd.h b/drivers/input/keyboard/hpps2atkbd.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/input/keyboard/hpps2atkbd.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,105 @@
+/*
+ * drivers/input/keyboard/hpps2atkbd.h
+ *
+ * Copyright (c) 2004 Helge Deller <deller@gmx.de>
+ * Copyright (c) 2002 Laurent Canet <canetl@esiee.fr>
+ * Copyright (c) 2002 Thibaut Varene <varenet@esiee.fr>
+ *
+ * based on linux-2.4's hp_mouse.c & hp_keyb.c
+ * 	Copyright (c) 1999 Alex deVries <adevries@thepuffingroup.com>
+ *	Copyright (c) 1999-2000 Philipp Rumpf <prumpf@tux.org>
+ *	Copyright (c) 2000 Xavier Debacker <debackex@esiee.fr>
+ *	Copyright (c) 2000-2001 Thomas Marteau <marteaut@esiee.fr>
+ *
+ * HP PS/2 AT-compatible Keyboard, found in PA/RISC Workstations
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+
+#define KBD_UNKNOWN 0
+
+/* Raw SET 2 scancode table */
+
+#if 0
+	/* conflicting keys between a RDI Precisionbook keyboard and a normal HP keyboard */
+        keytable[0x07] = KEY_F1;        /* KEY_F12      */
+        keytable[0x11] = KEY_LEFTCTRL;  /* KEY_LEFTALT  */
+        keytable[0x14] = KEY_CAPSLOCK;  /* KEY_LEFTCTRL */
+        keytable[0x61] = KEY_LEFT;      /* KEY_102ND    */
+#endif
+
+
+static unsigned char atkbd_set2_keycode[512] = {
+
+	/* 00 */  KBD_UNKNOWN,  KEY_F9,        KBD_UNKNOWN,   KEY_F5,        KEY_F3,        KEY_F1,       KEY_F2,        KEY_F1,
+	/* 08 */  KEY_ESC,      KEY_F10,       KEY_F8,        KEY_F6,        KEY_F4,        KEY_TAB,      KEY_GRAVE,     KEY_F2,
+	/* 10 */  KBD_UNKNOWN,  KEY_LEFTCTRL,  KEY_LEFTSHIFT, KBD_UNKNOWN,   KEY_CAPSLOCK,  KEY_Q,        KEY_1,         KEY_F3,
+	/* 18 */  KBD_UNKNOWN,  KEY_LEFTALT,   KEY_Z,         KEY_S,         KEY_A,         KEY_W,        KEY_2,         KEY_F4,
+	/* 20 */  KBD_UNKNOWN,  KEY_C,         KEY_X,         KEY_D,         KEY_E,         KEY_4,        KEY_3,         KEY_F5,
+	/* 28 */  KBD_UNKNOWN,  KEY_SPACE,     KEY_V,         KEY_F,         KEY_T,         KEY_R,        KEY_5,         KEY_F6,
+	/* 30 */  KBD_UNKNOWN,  KEY_N,         KEY_B,         KEY_H,         KEY_G,         KEY_Y,        KEY_6,         KEY_F7,
+	/* 38 */  KBD_UNKNOWN,  KEY_RIGHTALT,  KEY_M,         KEY_J,         KEY_U,         KEY_7,        KEY_8,         KEY_F8,
+	/* 40 */  KBD_UNKNOWN,  KEY_COMMA,     KEY_K,         KEY_I,         KEY_O,         KEY_0,        KEY_9,         KEY_F9,
+	/* 48 */  KBD_UNKNOWN,  KEY_DOT,       KEY_SLASH,     KEY_L,         KEY_SEMICOLON, KEY_P,        KEY_MINUS,     KEY_F10,
+	/* 50 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KEY_APOSTROPHE,KBD_UNKNOWN,   KEY_LEFTBRACE, KEY_EQUAL,    KEY_F11,       KEY_SYSRQ,
+	/* 58 */  KEY_CAPSLOCK, KEY_RIGHTSHIFT,KEY_ENTER,     KEY_RIGHTBRACE,KEY_BACKSLASH, KEY_BACKSLASH,KEY_F12,       KEY_SCROLLLOCK,
+	/* 60 */  KEY_DOWN,     KEY_LEFT,      KEY_PAUSE,     KEY_UP,        KEY_DELETE,    KEY_END,      KEY_BACKSPACE, KEY_INSERT,
+	/* 68 */  KBD_UNKNOWN,  KEY_KP1,       KEY_RIGHT,     KEY_KP4,       KEY_KP7,       KEY_PAGEDOWN, KEY_HOME,      KEY_PAGEUP,
+	/* 70 */  KEY_KP0,      KEY_KPDOT,     KEY_KP2,       KEY_KP5,       KEY_KP6,       KEY_KP8,      KEY_ESC,       KEY_NUMLOCK,
+	/* 78 */  KEY_F11,      KEY_KPPLUS,    KEY_KP3,       KEY_KPMINUS,   KEY_KPASTERISK,KEY_KP9,      KEY_SCROLLLOCK,KEY_103RD,
+	/* 80 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 88 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 90 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 98 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* a0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* a8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* b0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* b8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* c0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* c8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* d0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* d8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* e0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* e8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* f0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* f8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+
+	/* These are offset for escaped keycodes: */
+
+	/* 00 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KEY_F7,        KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 08 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KEY_LEFTMETA,  KEY_RIGHTMETA, KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 10 */  KBD_UNKNOWN,  KEY_RIGHTALT,  KBD_UNKNOWN,   KBD_UNKNOWN,   KEY_RIGHTCTRL, KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 18 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 20 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 28 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 30 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 38 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 40 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 48 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KEY_KPSLASH,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 50 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 58 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KEY_KPENTER,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 60 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 68 */  KBD_UNKNOWN,  KEY_END,       KBD_UNKNOWN,   KEY_LEFT,      KEY_HOME,      KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 70 */  KEY_INSERT,   KEY_DELETE,    KEY_DOWN,      KBD_UNKNOWN,   KEY_RIGHT,     KEY_UP,       KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 78 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KEY_PAGEDOWN,  KBD_UNKNOWN,   KEY_SYSRQ,     KEY_PAGEUP,   KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 80 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 88 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 90 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 98 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* a0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* a8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* b0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* b8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* c0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* c8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* d0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* d8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* e0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* e8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* f0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* f8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN
+
+};
diff -Nru a/drivers/input/keyboard/maple_keyb.c b/drivers/input/keyboard/maple_keyb.c
--- a/drivers/input/keyboard/maple_keyb.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/input/keyboard/maple_keyb.c	Tue Feb  3 19:45:17 2004
@@ -14,18 +14,19 @@
 
 MODULE_AUTHOR("YAEGASHI Takeshi <t@keshi.org>");
 MODULE_DESCRIPTION("SEGA Dreamcast keyboard driver");
+MODULE_LICENSE("GPL");
 
 static unsigned char dc_kbd_keycode[256] = {
 	  0,  0,  0,  0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38,
 	 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44,  2,  3,
 	  4,  5,  6,  7,  8,  9, 10, 11, 28,  1, 14, 15, 57, 12, 13, 26,
-	 27, 43, 84, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64,
+	 27, 43, 43, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64,
 	 65, 66, 67, 68, 87, 88, 99, 70,119,110,102,104,111,107,109,106,
 	105,108,103, 69, 98, 55, 74, 78, 96, 79, 80, 81, 75, 76, 77, 71,
-	 72, 73, 82, 83, 86,127,116,117, 85, 89, 90, 91, 92, 93, 94, 95,
-	120,121,122,123,134,138,130,132,128,129,131,137,133,135,136,113,
-	115,114,  0,  0,  0,124,  0,181,182,183,184,185,186,187,188,189,
-	190,191,192,193,194,195,196,197,198,  0,  0,  0,  0,  0,  0,  0,
+	 72, 73, 82, 83, 86,127,116,117,183,184,185,186,187,188,189,190,
+	191,192,193,194,134,138,130,132,128,129,131,137,133,135,136,113,
+	115,114,  0,  0,  0,121,  0, 89, 93,124, 92, 94, 95,  0,  0,  0,
+	122,123, 90, 91, 85,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
diff -Nru a/drivers/input/keyboard/newtonkbd.c b/drivers/input/keyboard/newtonkbd.c
--- a/drivers/input/keyboard/newtonkbd.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/input/keyboard/newtonkbd.c	Tue Feb  3 19:45:16 2004
@@ -33,6 +33,8 @@
 #include <linux/serio.h>
 
 MODULE_AUTHOR("Justin Cormack <j.cormack@doc.ic.ac.uk>");
+MODULE_DESCRIPTION("Newton keyboard driver");
+MODULE_LICENSE("GPL");
 
 #define NKBD_KEY	0x7f
 #define NKBD_PRESS	0x80
diff -Nru a/drivers/input/mouse/98busmouse.c b/drivers/input/mouse/98busmouse.c
--- a/drivers/input/mouse/98busmouse.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/input/mouse/98busmouse.c	Tue Feb  3 19:45:42 2004
@@ -33,6 +33,7 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/delay.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
@@ -69,12 +70,13 @@
 
 #define PC98BM_IRQ		13
 
-MODULE_PARM(pc98bm_irq, "i");
-
 static int pc98bm_irq = PC98BM_IRQ;
+module_param_named(irq, pc98bm_irq, uint, 0);
+MODULE_PARM_DESC(irq, "IRQ number (13=default)");
+
 static int pc98bm_used = 0;
 
-static void pc98bm_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t pc98bm_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 static int pc98bm_open(struct input_dev *dev)
 {
@@ -113,7 +115,7 @@
 	},
 };
 
-static void pc98bm_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t pc98bm_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	char dx, dy;
 	unsigned char buttons;
@@ -137,18 +139,9 @@
 	input_sync(&pc98bm_dev);
 
 	outb(PC98BM_ENABLE_IRQ, PC98BM_CONTROL_PORT);
-}
 
-#ifndef MODULE
-static int __init pc98bm_setup(char *str)
-{
-        int ints[4];
-        str = get_options(str, ARRAY_SIZE(ints), ints);
-        if (ints[0] > 0) pc98bm_irq = ints[1];
-        return 1;
+	return IRQ_HANDLED;
 }
-__setup("pc98bm_irq=", pc98bm_setup);
-#endif
 
 static int __init pc98bm_init(void)
 {
diff -Nru a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig
--- a/drivers/input/mouse/Kconfig	Tue Feb  3 19:45:41 2004
+++ b/drivers/input/mouse/Kconfig	Tue Feb  3 19:45:41 2004
@@ -29,6 +29,8 @@
 	  and a new verion of GPM at:
 		http://www.geocities.com/dt_or/gpm/gpm.html
 	  to take advantage of the advanced features of the touchpad.
+	  If you do not want install specialized drivers but want tapping
+	  working please use option psmouse.proto=imps.
 
 	  If unsure, say Y.
 
diff -Nru a/drivers/input/mouse/inport.c b/drivers/input/mouse/inport.c
--- a/drivers/input/mouse/inport.c	Tue Feb  3 19:45:27 2004
+++ b/drivers/input/mouse/inport.c	Tue Feb  3 19:45:27 2004
@@ -35,6 +35,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/config.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
@@ -80,10 +81,11 @@
 
 #define INPORT_IRQ		5
 
-MODULE_PARM(inport_irq, "i");
-
 static int inport_irq = INPORT_IRQ;
-static int inport_used = 0;
+module_param_named(irq, inport_irq, uint, 0);
+MODULE_PARM_DESC(irq, "IRQ number (5=default)");
+
+static int inport_used;
 
 static irqreturn_t inport_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
@@ -152,17 +154,6 @@
 	input_sync(&inport_dev);
 	return IRQ_HANDLED;
 }
-
-#ifndef MODULE
-static int __init inport_setup(char *str)
-{
-        int ints[4];
-        str = get_options(str, ARRAY_SIZE(ints), ints);
-        if (ints[0] > 0) inport_irq = ints[1];
-        return 1;
-}
-__setup("inport_irq=", inport_setup);
-#endif
 
 static int __init inport_init(void)
 {
diff -Nru a/drivers/input/mouse/logibm.c b/drivers/input/mouse/logibm.c
--- a/drivers/input/mouse/logibm.c	Tue Feb  3 19:45:26 2004
+++ b/drivers/input/mouse/logibm.c	Tue Feb  3 19:45:26 2004
@@ -36,6 +36,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/delay.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
@@ -70,9 +71,10 @@
 
 #define LOGIBM_IRQ		5
 
-MODULE_PARM(logibm_irq, "i");
-
 static int logibm_irq = LOGIBM_IRQ;
+module_param_named(irq, logibm_irq, uint, 0);
+MODULE_PARM_DESC(irq, "IRQ number (5=default)");
+
 static int logibm_used = 0;
 
 static irqreturn_t logibm_interrupt(int irq, void *dev_id, struct pt_regs *regs);
@@ -141,17 +143,6 @@
 	outb(LOGIBM_ENABLE_IRQ, LOGIBM_CONTROL_PORT);
 	return IRQ_HANDLED;
 }
-
-#ifndef MODULE
-static int __init logibm_setup(char *str)
-{
-        int ints[4];
-        str = get_options(str, ARRAY_SIZE(ints), ints);
-        if (ints[0] > 0) logibm_irq = ints[1];
-        return 1;
-}
-__setup("logibm_irq=", logibm_setup);
-#endif
 
 static int __init logibm_init(void)
 {
diff -Nru a/drivers/input/mouse/logips2pp.c b/drivers/input/mouse/logips2pp.c
--- a/drivers/input/mouse/logips2pp.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/input/mouse/logips2pp.c	Tue Feb  3 19:45:30 2004
@@ -150,7 +150,7 @@
 	static int logitech_wheel[] = { 52, 53, 75, 76, 80, 81, 83, 88, 112, -1 };
 	static int logitech_ps2pp[] = { 12, 13, 40, 41, 42, 43, 50, 51, 52, 53, 73, 75,
 						76, 80, 81, 83, 88, 96, 97, 112, -1 };
-	static int logitech_mx[] = { 112, -1 };
+	static int logitech_mx[] = { 61, 112, -1 };
 
 	psmouse->vendor = "Logitech";
 	psmouse->model = ((param[0] >> 4) & 0x07) | ((param[0] << 3) & 0x78);
diff -Nru a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
--- a/drivers/input/mouse/psmouse-base.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/input/mouse/psmouse-base.c	Tue Feb  3 19:45:17 2004
@@ -26,30 +26,26 @@
 MODULE_DESCRIPTION("PS/2 mouse driver");
 MODULE_LICENSE("GPL");
 
-static int psmouse_noext;
-module_param(psmouse_noext, int, 0);
-MODULE_PARM_DESC(psmouse_noext, "[DEPRECATED] Disable any protocol extensions. Useful for KVM switches.");
-
 static char *psmouse_proto;
 static unsigned int psmouse_max_proto = -1U;
-module_param(psmouse_proto, charp, 0);
-MODULE_PARM_DESC(psmouse_proto, "Highest protocol extension to probe (bare, imps, exps). Useful for KVM switches.");
+module_param_named(proto, psmouse_proto, charp, 0);
+MODULE_PARM_DESC(proto, "Highest protocol extension to probe (bare, imps, exps). Useful for KVM switches.");
 
 int psmouse_resolution = 200;
-module_param(psmouse_resolution, uint, 0);
-MODULE_PARM_DESC(psmouse_resolution, "Resolution, in dpi.");
+module_param_named(resolution, psmouse_resolution, uint, 0);
+MODULE_PARM_DESC(resolution, "Resolution, in dpi.");
 
 unsigned int psmouse_rate = 100;
-module_param(psmouse_rate, uint, 0);
-MODULE_PARM_DESC(psmouse_rate, "Report rate, in reports per second.");
+module_param_named(rate, psmouse_rate, uint, 0);
+MODULE_PARM_DESC(rate, "Report rate, in reports per second.");
 
 int psmouse_smartscroll = 1;
-module_param(psmouse_smartscroll, bool, 0);
-MODULE_PARM_DESC(psmouse_smartscroll, "Logitech Smartscroll autorepeat, 1 = enabled (default), 0 = disabled.");
+module_param_named(smartscroll, psmouse_smartscroll, bool, 0);
+MODULE_PARM_DESC(smartscroll, "Logitech Smartscroll autorepeat, 1 = enabled (default), 0 = disabled.");
 
 unsigned int psmouse_resetafter;
-module_param(psmouse_resetafter, uint, 0);
-MODULE_PARM_DESC(psmouse_resetafter, "Reset Synaptics Touchpad after so many bad packets (0 = never).");
+module_param_named(resetafter, psmouse_resetafter, uint, 0);
+MODULE_PARM_DESC(resetafter, "Reset Synaptics Touchpad after so many bad packets (0 = never).");
 
 static char *psmouse_protocols[] = { "None", "PS/2", "PS2++", "PS2T++", "GenPS/2", "ImPS/2", "ImExPS/2", "SynPS/2"};
 
@@ -125,6 +121,19 @@
 	if (psmouse->state == PSMOUSE_IGNORE)
 		goto out;
 
+	if (flags & (SERIO_PARITY|SERIO_TIMEOUT)) {
+		if (psmouse->state == PSMOUSE_ACTIVATED)
+			printk(KERN_WARNING "psmouse.c: bad data from KBC -%s%s\n",
+				flags & SERIO_TIMEOUT ? " timeout" : "",
+				flags & SERIO_PARITY ? " bad parity" : "");
+		if (psmouse->acking) {
+			psmouse->ack = -1;
+			psmouse->acking = 0;
+		}
+		psmouse->pktcnt = 0;
+		goto out;
+	}
+
 	if (psmouse->acking) {
 		switch (data) {
 			case PSMOUSE_RET_ACK:
@@ -235,6 +244,11 @@
 	if (command == PSMOUSE_CMD_RESET_BAT)
                 timeout = 4000000; /* 4 sec */
 
+	/* initialize cmdbuf with preset values from param */
+	if (receive)
+	   for (i = 0; i < receive; i++)
+		psmouse->cmdbuf[(receive - 1) - i] = param[i];
+
 	if (command & 0xff)
 		if (psmouse_sendbyte(psmouse, command & 0xff))
 			return (psmouse->cmdcnt = 0) - 1;
@@ -245,8 +259,9 @@
 
 	while (psmouse->cmdcnt && timeout--) {
 	
-		if (psmouse->cmdcnt == 1 && command == PSMOUSE_CMD_RESET_BAT)
-			timeout = 100000;
+		if (psmouse->cmdcnt == 1 && command == PSMOUSE_CMD_RESET_BAT &&
+				timeout > 100000) /* do not run in a endless loop */
+			timeout = 100000; /* 1 sec */
 
 		if (psmouse->cmdcnt == 1 && command == PSMOUSE_CMD_GETID &&
 		    psmouse->cmdbuf[1] != 0xab && psmouse->cmdbuf[1] != 0xac) {
@@ -414,7 +429,7 @@
  * in case of an IntelliMouse in 4-byte mode or 0x04 for IM Explorer.
  */
 
-	param[0] = param[1] = 0xa5;
+	param[0] = 0xa5;
 
 	if (psmouse_command(psmouse, param, PSMOUSE_CMD_GETID))
 		return -1;
@@ -578,12 +593,14 @@
 	serio->private = psmouse;
 	if (serio_open(serio, dev)) {
 		kfree(psmouse);
+		serio->private = NULL;
 		return;
 	}
 
 	if (psmouse_probe(psmouse) <= 0) {
 		serio_close(serio);
 		kfree(psmouse);
+		serio->private = NULL;
 		return;
 	}
 	
@@ -665,12 +682,6 @@
 
 static inline void psmouse_parse_proto(void)
 {
-	if (psmouse_noext) {
-		printk(KERN_WARNING "psmouse: 'psmouse_noext' option is deprecated, please use 'psmouse_proto'\n");
-		psmouse_max_proto = PSMOUSE_PS2;
-	}
-
-	/* even is psmouse_noext is present psmouse_proto overrides it */
 	if (psmouse_proto) {
 		if (!strcmp(psmouse_proto, "bare"))
 			psmouse_max_proto = PSMOUSE_PS2;
diff -Nru a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h
--- a/drivers/input/mouse/psmouse.h	Tue Feb  3 19:45:42 2004
+++ b/drivers/input/mouse/psmouse.h	Tue Feb  3 19:45:42 2004
@@ -67,6 +67,7 @@
 int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command);
 
 extern int psmouse_smartscroll;
+extern unsigned int psmouse_rate;
 extern unsigned int psmouse_resetafter;
 
 #endif /* _PSMOUSE_H */
diff -Nru a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
--- a/drivers/input/mouse/synaptics.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/input/mouse/synaptics.c	Tue Feb  3 19:45:17 2004
@@ -214,7 +214,9 @@
 {
 	struct synaptics_data *priv = psmouse->private;
 
-	mode |= SYN_BIT_ABSOLUTE_MODE | SYN_BIT_HIGH_RATE;
+	mode |= SYN_BIT_ABSOLUTE_MODE;
+	if (psmouse_rate >= 80)
+		mode |= SYN_BIT_HIGH_RATE;
 	if (SYN_ID_MAJOR(priv->identity) >= 4)
 		mode |= SYN_BIT_DISABLE_GESTURE;
 	if (SYN_CAP_EXTENDED(priv->capabilities))
@@ -553,15 +555,18 @@
 		finger_width = 0;
 	}
 
-	/* Post events */
+	/* Post events
+	 * BTN_TOUCH has to be first as mousedev relies on it when doing
+	 * absolute -> relative conversion
+	 */
+	if (hw.z > 30) input_report_key(dev, BTN_TOUCH, 1);
+	if (hw.z < 25) input_report_key(dev, BTN_TOUCH, 0);
+
 	if (hw.z > 0) {
 		input_report_abs(dev, ABS_X, hw.x);
 		input_report_abs(dev, ABS_Y, YMAX_NOMINAL + YMIN_NOMINAL - hw.y);
 	}
 	input_report_abs(dev, ABS_PRESSURE, hw.z);
-
-	if (hw.z > 30) input_report_key(dev, BTN_TOUCH, 1);
-	if (hw.z < 25) input_report_key(dev, BTN_TOUCH, 0);
 
 	input_report_abs(dev, ABS_TOOL_WIDTH, finger_width);
 	input_report_key(dev, BTN_TOOL_FINGER, num_fingers == 1);
diff -Nru a/drivers/input/mousedev.c b/drivers/input/mousedev.c
--- a/drivers/input/mousedev.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/input/mousedev.c	Tue Feb  3 19:45:42 2004
@@ -15,6 +15,7 @@
 #include <linux/slab.h>
 #include <linux/poll.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/input.h>
 #include <linux/config.h>
@@ -38,6 +39,14 @@
 #define CONFIG_INPUT_MOUSEDEV_SCREEN_Y	768
 #endif
 
+static int xres = CONFIG_INPUT_MOUSEDEV_SCREEN_X;
+module_param(xres, uint, 0);
+MODULE_PARM_DESC(xres, "Horizontal screen resolution");
+
+static int yres = CONFIG_INPUT_MOUSEDEV_SCREEN_Y;
+module_param(yres, uint, 0);
+MODULE_PARM_DESC(yres, "Vertical screen resolution");
+
 struct mousedev {
 	int exist;
 	int open;
@@ -53,12 +62,14 @@
 	struct fasync_struct *fasync;
 	struct mousedev *mousedev;
 	struct list_head node;
-	int dx, dy, dz, oldx, oldy;
-	signed char ps2[6];
+	int dx, dy, dz;
+	int old_x[4], old_y[4];
 	unsigned long buttons;
+	signed char ps2[6];
 	unsigned char ready, buffer, bufsiz;
 	unsigned char mode, imexseq, impsseq;
-	int finger;
+	unsigned int pkt_count;
+	unsigned char touch;
 };
 
 #define MOUSEDEV_SEQ_LEN	6
@@ -71,52 +82,49 @@
 static struct mousedev *mousedev_table[MOUSEDEV_MINORS];
 static struct mousedev mousedev_mix;
 
-static int xres = CONFIG_INPUT_MOUSEDEV_SCREEN_X;
-static int yres = CONFIG_INPUT_MOUSEDEV_SCREEN_Y;
+#define fx(i)  (list->old_x[(list->pkt_count - (i)) & 03])
+#define fy(i)  (list->old_y[(list->pkt_count - (i)) & 03])
 
 static void mousedev_abs_event(struct input_handle *handle, struct mousedev_list *list, unsigned int code, int value)
 {
 	int size;
+	int touchpad;
 
 	/* Ignore joysticks */
 	if (test_bit(BTN_TRIGGER, handle->dev->keybit))
 		return;
 
-	/* Handle touchpad data */
-	if (test_bit(BTN_TOOL_FINGER, handle->dev->keybit)) {
-
-		if (list->finger && list->finger < 3)
-			list->finger++;
-
-		switch (code) {
-			case ABS_X:
-				if (list->finger == 3)
-					list->dx += (value - list->oldx) / 8;
-				list->oldx = value;
-				return;
-			case ABS_Y:
-				if (list->finger == 3)
-					list->dy -= (value - list->oldy) / 8;
-				list->oldy = value;
-				return;
-		}
-		return;
-	}
+	touchpad = test_bit(BTN_TOOL_FINGER, handle->dev->keybit);
 
-	/* Handle tablet data */
 	switch (code) {
 		case ABS_X:
-			size = handle->dev->absmax[ABS_X] - handle->dev->absmin[ABS_X];
-			if (size == 0) size = xres;
-			list->dx += (value * xres - list->oldx) / size;
-			list->oldx += list->dx * size;
-			return;
+			if (touchpad) {
+				if (list->touch) {
+					fx(0) = value;
+					if (list->pkt_count >= 2)
+						list->dx = ((fx(0) - fx(1)) / 2 + (fx(1) - fx(2)) / 2) / 8;
+				}
+			} else {
+				size = handle->dev->absmax[ABS_X] - handle->dev->absmin[ABS_X];
+				if (size == 0) size = xres;
+				list->dx += (value * xres - list->old_x[0]) / size;
+				list->old_x[0] += list->dx * size;
+			}
+			break;
 		case ABS_Y:
-			size = handle->dev->absmax[ABS_Y] - handle->dev->absmin[ABS_Y];
-			if (size == 0) size = yres;
-			list->dy -= (value * yres - list->oldy) / size;
-			list->oldy -= list->dy * size;
-			return;
+			if (touchpad) {
+				if (list->touch) {
+					fy(0) = value;
+					if (list->pkt_count >= 2)
+						list->dy = -((fy(0) - fy(1)) / 2 + (fy(1) - fy(2)) / 2) / 8;
+				}
+			} else {
+				size = handle->dev->absmax[ABS_Y] - handle->dev->absmin[ABS_Y];
+				if (size == 0) size = yres;
+				list->dy -= (value * yres - list->old_y[0]) / size;
+				list->old_y[0] -= list->dy * size;
+			}
+			break;
 	}
 }
 
@@ -146,12 +154,16 @@
 					break;
 
 				case EV_KEY:
+					if (code == BTN_TOUCH && test_bit(BTN_TOOL_FINGER, handle->dev->keybit)) {
+						/* Handle touchpad data */
+						list->touch = value;
+						if (!list->touch)
+							list->pkt_count = 0;
+						break;
+					}
+
 					switch (code) {
-						case BTN_TOUCH: /* Handle touchpad data */
-							if (test_bit(BTN_TOOL_FINGER, handle->dev->keybit)) {
-								list->finger = value;
-								return;
-							}
+						case BTN_TOUCH:
 						case BTN_0:
 						case BTN_FORWARD:
 						case BTN_LEFT:   index = 0; break;
@@ -178,6 +190,16 @@
 				case EV_SYN:
 					switch (code) {
 						case SYN_REPORT:
+							if (list->touch) {
+								list->pkt_count++;
+								/* Input system eats duplicate events,
+								 * but we need all of them to do correct
+								 * averaging so apply present one forward
+								 */
+								fx(0) = fx(1);
+								fy(0) = fy(1);
+							}
+
 							list->ready = 1;
 							kill_fasync(&list->fasync, SIGIO, POLL_IN);
 							wake = 1;
@@ -203,6 +225,7 @@
 static void mousedev_free(struct mousedev *mousedev)
 {
 	devfs_remove("input/mouse%d", mousedev->minor);
+	class_simple_device_remove(MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + mousedev->minor));
 	mousedev_table[mousedev->minor] = NULL;
 	kfree(mousedev);
 }
@@ -464,6 +487,9 @@
 
 	devfs_mk_cdev(MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + minor),
 			S_IFCHR|S_IRUGO|S_IWUSR, "input/mouse%d", minor);
+	class_simple_device_add(input_class, 
+				MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + minor),
+				dev->dev, "mouse%d", minor);
 
 	return &mousedev->handle;
 }
@@ -542,7 +568,8 @@
 
 	devfs_mk_cdev(MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + MOUSEDEV_MIX),
 			S_IFCHR|S_IRUGO|S_IWUSR, "input/mice");
-
+	class_simple_device_add(input_class, MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + MOUSEDEV_MIX),
+				NULL, "mice");
 
 #ifdef CONFIG_INPUT_MOUSEDEV_PSAUX
 	if (!(mousedev_mix.misc = !misc_register(&psaux_mouse)))
@@ -561,13 +588,9 @@
 		misc_deregister(&psaux_mouse);
 #endif
 	devfs_remove("input/mice");
+	class_simple_device_remove(MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + MOUSEDEV_MIX));
 	input_unregister_handler(&mousedev_handler);
 }
 
 module_init(mousedev_init);
 module_exit(mousedev_exit);
-
-MODULE_PARM(xres, "i");
-MODULE_PARM_DESC(xres, "Horizontal screen resolution");
-MODULE_PARM(yres, "i");
-MODULE_PARM_DESC(yres, "Vertical screen resolution");
diff -Nru a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
--- a/drivers/input/serio/i8042.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/input/serio/i8042.c	Tue Feb  3 19:45:16 2004
@@ -29,22 +29,28 @@
 MODULE_LICENSE("GPL");
 
 static unsigned int i8042_noaux;
-module_param(i8042_noaux, bool, 0);
+module_param_named(noaux, i8042_noaux, bool, 0);
+MODULE_PARM_DESC(noaux, "Do not probe or use AUX (mouse) port.");
 
 static unsigned int i8042_nomux;
-module_param(i8042_nomux, bool, 0);
+module_param_named(nomux, i8042_nomux, bool, 0);
+MODULE_PARM_DESC(nomux, "Do not check whether an active multiplexing conrtoller is present.");
 
 static unsigned int i8042_unlock;
-module_param(i8042_unlock, bool, 0);
+module_param_named(unlock, i8042_unlock, bool, 0);
+MODULE_PARM_DESC(unlock, "Ignore keyboard lock.");
 
 static unsigned int i8042_reset;
-module_param(i8042_reset, bool, 0);
+module_param_named(reset, i8042_reset, bool, 0);
+MODULE_PARM_DESC(reset, "Reset controller during init and cleanup.");
 
 static unsigned int i8042_direct;
-module_param(i8042_direct, bool, 0);
+module_param_named(direct, i8042_direct, bool, 0);
+MODULE_PARM_DESC(direct, "Put keyboard port into non-translated mode.");
 
 static unsigned int i8042_dumbkbd;
-module_param(i8042_dumbkbd, bool, 0);
+module_param_named(dumbkbd, i8042_dumbkbd, bool, 0);
+MODULE_PARM_DESC(dumbkbd, "Pretend that controller can only read data from keyboard");
 
 #undef DEBUG
 #include "i8042.h"
@@ -371,65 +377,63 @@
 	unsigned long flags;
 	unsigned char str, data;
 	unsigned int dfl;
-	struct {
-		int data;
-		int str;
-	} buffer[I8042_BUFFER_SIZE];
-	int i, j = 0;
+	int ret;
 
 	spin_lock_irqsave(&i8042_lock, flags);
-
-	while (j < I8042_BUFFER_SIZE && 
-	    (buffer[j].str = i8042_read_status()) & I8042_STR_OBF)
-		buffer[j++].data = i8042_read_data();
-
+	str = i8042_read_status();
+	data = i8042_read_data();
 	spin_unlock_irqrestore(&i8042_lock, flags);
 
-	for (i = 0; i < j; i++) {
-
-		str = buffer[i].str;
-		data = buffer[i].data;
-
-		dfl = ((str & I8042_STR_PARITY) ? SERIO_PARITY : 0) |
-		      ((str & I8042_STR_TIMEOUT) ? SERIO_TIMEOUT : 0);
-
-		if (i8042_mux_values[0].exists && (str & I8042_STR_AUXDATA)) {
-
-			if (str & I8042_STR_MUXERR) {
-				switch (data) {
-					case 0xfd:
-					case 0xfe: dfl = SERIO_TIMEOUT; break;
-					case 0xff: dfl = SERIO_PARITY; break;
-				}
-				data = 0xfe;
-			} else dfl = 0;
-
-			dbg("%02x <- i8042 (interrupt, aux%d, %d%s%s)",
-				data, (str >> 6), irq, 
-				dfl & SERIO_PARITY ? ", bad parity" : "",
-				dfl & SERIO_TIMEOUT ? ", timeout" : "");
+	if (~str & I8042_STR_OBF) {
+		if (irq) dbg("Interrupt %d, without any data", irq);
+		ret = 0;
+		goto out;
+	}
+
+	dfl = ((str & I8042_STR_PARITY) ? SERIO_PARITY : 0) |
+	      ((str & I8042_STR_TIMEOUT) ? SERIO_TIMEOUT : 0);
+
+	if (i8042_mux_values[0].exists && (str & I8042_STR_AUXDATA)) {
+
+		if (str & I8042_STR_MUXERR) {
+			switch (data) {
+				case 0xfd:
+				case 0xfe: dfl = SERIO_TIMEOUT; break;
+				case 0xff: dfl = SERIO_PARITY; break;
+			}
+			data = 0xfe;
+		} else dfl = 0;
 
-			serio_interrupt(i8042_mux_port + ((str >> 6) & 3), data, dfl, regs);
-			continue;
-		}
-
-		dbg("%02x <- i8042 (interrupt, %s, %d%s%s)",
-			data, (str & I8042_STR_AUXDATA) ? "aux" : "kbd", irq, 
+		dbg("%02x <- i8042 (interrupt, aux%d, %d%s%s)",
+			data, (str >> 6), irq, 
 			dfl & SERIO_PARITY ? ", bad parity" : "",
 			dfl & SERIO_TIMEOUT ? ", timeout" : "");
 
-		if (i8042_aux_values.exists && (str & I8042_STR_AUXDATA)) {
-			serio_interrupt(&i8042_aux_port, data, dfl, regs);
-			continue;
-		}
+		serio_interrupt(i8042_mux_port + ((str >> 6) & 3), data, dfl, regs);
+		
+		goto irq_ret;
+	}
 
-		if (!i8042_kbd_values.exists)
-			continue;
+	dbg("%02x <- i8042 (interrupt, %s, %d%s%s)",
+		data, (str & I8042_STR_AUXDATA) ? "aux" : "kbd", irq, 
+		dfl & SERIO_PARITY ? ", bad parity" : "",
+		dfl & SERIO_TIMEOUT ? ", timeout" : "");
 
-		serio_interrupt(&i8042_kbd_port, data, dfl, regs);
+	if (i8042_aux_values.exists && (str & I8042_STR_AUXDATA)) {
+		serio_interrupt(&i8042_aux_port, data, dfl, regs);
+		goto irq_ret;
 	}
 
-	return IRQ_RETVAL(j);
+	if (!i8042_kbd_values.exists)
+		goto irq_ret;
+
+	serio_interrupt(&i8042_kbd_port, data, dfl, regs);
+
+irq_ret:
+	ret = 1;
+out:
+	mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD);
+	return IRQ_RETVAL(ret);
 }
 
 /*
@@ -513,17 +517,8 @@
 
 static int __init i8042_check_mux(struct i8042_values *values)
 {
-	static int i8042_check_mux_cookie;
 	unsigned char mux_version;
 
-/*
- * Check if AUX irq is available.
- */
-	if (request_irq(values->irq, i8042_interrupt, SA_SHIRQ,
-				"i8042", &i8042_check_mux_cookie))
-                return -1;
-	free_irq(values->irq, &i8042_check_mux_cookie);
-
 	if (i8042_enable_mux_mode(values, &mux_version))
 		return -1;
 
@@ -592,8 +587,10 @@
 	
 	if (i8042_command(&param, I8042_CMD_AUX_DISABLE))
 		return -1;
-	if (i8042_command(&param, I8042_CMD_CTL_RCTR) || (~param & I8042_CTR_AUXDIS))
-		return -1;	
+	if (i8042_command(&param, I8042_CMD_CTL_RCTR) || (~param & I8042_CTR_AUXDIS)) {
+		printk(KERN_WARNING "Failed to disable AUX port, but continuing anyway... Is this a SiS?\n");
+		printk(KERN_WARNING "If AUX port is really absent please use the 'i8042.noaux' option.\n");
+	}
 
 	if (i8042_command(&param, I8042_CMD_AUX_ENABLE))
 		return -1;
@@ -627,6 +624,7 @@
 
 	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
 		printk(KERN_WARNING "i8042.c: Can't write CTR while registering.\n");
+		values->exists = 0;
 		return -1; 
 	}
 
@@ -645,7 +643,6 @@
 static void i8042_timer_func(unsigned long data)
 {
 	i8042_interrupt(0, NULL, NULL);
-	mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD);
 }
 
 
@@ -658,8 +655,6 @@
 static int i8042_controller_init(void)
 {
 
-	if (i8042_noaux)
-		i8042_nomux = 1;
 /*
  * Test the i8042. We need to know if it thinks it's working correctly
  * before doing anything else.
@@ -746,6 +741,29 @@
 
 
 /*
+ * Reset the controller.
+ */
+void i8042_controller_reset(void)
+{
+	if (i8042_reset) {
+		unsigned char param;
+
+		if (i8042_command(&param, I8042_CMD_CTL_TEST))
+			printk(KERN_ERR "i8042.c: i8042 controller reset timeout.\n");
+	}
+
+/*
+ * Restore the original control register setting.
+ */
+
+	i8042_ctr = i8042_initial_ctr;
+
+	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR))
+		printk(KERN_WARNING "i8042.c: Can't restore CTR.\n");
+}
+
+
+/*
  * Here we try to reset everything back to a state in which the BIOS will be
  * able to talk to the hardware when rebooting.
  */
@@ -770,26 +788,20 @@
 		if (i8042_mux_values[i].exists)
 			serio_cleanup(i8042_mux_port + i);
 
-/*
- * Reset the controller.
- */
-
-	if (i8042_reset) {
-		unsigned char param;
+	i8042_controller_reset();
+}
 
-		if (i8042_command(&param, I8042_CMD_CTL_TEST))
-			printk(KERN_ERR "i8042.c: i8042 controller reset timeout.\n");
-	}
 
 /*
- * Restore the original control register setting.
+ * Here we try to restore the original BIOS settings
  */
 
-	i8042_ctr = i8042_initial_ctr;
-
-	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR))
-		printk(KERN_WARNING "i8042.c: Can't restore CTR.\n");
+static int i8042_controller_suspend(void)
+{
+	del_timer_sync(&i8042_timer);
+	i8042_controller_reset();
 
+	return 0;
 }
 
 
@@ -809,7 +821,7 @@
 	if (i8042_mux_present)
 		if (i8042_enable_mux_mode(&i8042_aux_values, NULL) ||
 		    i8042_enable_mux_ports(&i8042_aux_values)) {
-			printk(KERN_WARNING "i8042: failed to resume active multiplexor, mouse won't wotk.\n");
+			printk(KERN_WARNING "i8042: failed to resume active multiplexor, mouse won't work.\n");
 		}
 
 /*
@@ -825,6 +837,10 @@
 	for (i = 0; i < 4; i++)
 		if (i8042_mux_values[i].exists && i8042_activate_port(i8042_mux_port + i) == 0)
 			serio_reconnect(i8042_mux_port + i);
+/*
+ * Restart timer (for polling "stuck" data)
+ */
+	mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD);
 
 	return 0;
 }
@@ -851,16 +867,22 @@
 };
 
 /*
- * Resume handler for the new PM scheme (driver model)
+ * Suspend/resume handlers for the new PM scheme (driver model)
  */
+static int i8042_suspend(struct sys_device *dev, u32 state)
+{
+	return i8042_controller_suspend();
+}
+
 static int i8042_resume(struct sys_device *dev)
 {
 	return i8042_controller_resume();
 }
 
 static struct sysdev_class kbc_sysclass = {
-       set_kset_name("i8042"),
-       .resume = i8042_resume,
+	set_kset_name("i8042"),
+	.suspend = i8042_suspend,
+	.resume = i8042_resume,
 };
 
 static struct sys_device device_i8042 = {
@@ -869,12 +891,17 @@
 };
 
 /*
- * Resume handler for the old PM scheme (APM)
+ * Suspend/resume handler for the old PM scheme (APM)
  */
 static int i8042_pm_callback(struct pm_dev *dev, pm_request_t request, void *dummy)
 {
-	if (request == PM_RESUME)
-		return i8042_controller_resume();
+	switch (request) {
+		case PM_SUSPEND:
+			return i8042_controller_suspend();
+
+		case PM_RESUME:
+			return i8042_controller_resume();
+	}
 
 	return 0;
 }
@@ -899,6 +926,9 @@
 
 	dbg_init();
 
+	init_timer(&i8042_timer);
+	i8042_timer.function = i8042_timer_func;
+
 	if (i8042_platform_init())
 		return -EBUSY;
 
@@ -911,20 +941,18 @@
 	if (i8042_dumbkbd)
 		i8042_kbd_port.write = NULL;
 
-	for (i = 0; i < 4; i++)
-		i8042_init_mux_values(i8042_mux_values + i, i8042_mux_port + i, i);
-
-	if (!i8042_nomux && !i8042_check_mux(&i8042_aux_values))
-		for (i = 0; i < 4; i++)
-			i8042_port_register(i8042_mux_values + i, i8042_mux_port + i);
-	else 
-		if (!i8042_noaux && !i8042_check_aux(&i8042_aux_values))
+	if (!i8042_noaux && !i8042_check_aux(&i8042_aux_values)) {
+		if (!i8042_nomux && !i8042_check_mux(&i8042_aux_values))
+			for (i = 0; i < 4; i++) {
+				i8042_init_mux_values(i8042_mux_values + i, i8042_mux_port + i, i);
+				i8042_port_register(i8042_mux_values + i, i8042_mux_port + i);
+			}
+		else
 			i8042_port_register(&i8042_aux_values, &i8042_aux_port);
+	}
 
 	i8042_port_register(&i8042_kbd_values, &i8042_kbd_port);
 
-	init_timer(&i8042_timer);
-	i8042_timer.function = i8042_timer_func;
 	mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD);
 
         if (sysdev_class_register(&kbc_sysclass) == 0) {
@@ -955,7 +983,7 @@
 		sysdev_class_unregister(&kbc_sysclass);
 	}
 
-	del_timer(&i8042_timer);
+	del_timer_sync(&i8042_timer);
 
 	i8042_controller_cleanup();
 	
diff -Nru a/drivers/input/tsdev.c b/drivers/input/tsdev.c
--- a/drivers/input/tsdev.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/input/tsdev.c	Tue Feb  3 19:45:42 2004
@@ -34,6 +34,7 @@
 #include <linux/slab.h>
 #include <linux/poll.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/input.h>
 #include <linux/major.h>
@@ -51,6 +52,18 @@
 #define CONFIG_INPUT_TSDEV_SCREEN_Y	320
 #endif
 
+MODULE_AUTHOR("James Simmons <jsimmons@transvirtual.com>");
+MODULE_DESCRIPTION("Input driver to touchscreen converter");
+MODULE_LICENSE("GPL");
+
+static int xres = CONFIG_INPUT_TSDEV_SCREEN_X;
+module_param(xres, uint, 0);
+MODULE_PARM_DESC(xres, "Horizontal screen resolution");
+
+static int yres = CONFIG_INPUT_TSDEV_SCREEN_Y;
+module_param(yres, uint, 0);
+MODULE_PARM_DESC(yres, "Vertical screen resolution");
+
 struct tsdev {
 	int exist;
 	int open;
@@ -82,9 +95,6 @@
 
 static struct tsdev *tsdev_table[TSDEV_MINORS];
 
-static int xres = CONFIG_INPUT_TSDEV_SCREEN_X;
-static int yres = CONFIG_INPUT_TSDEV_SCREEN_Y;
-
 static int tsdev_fasync(int fd, struct file *file, int on)
 {
 	struct tsdev_list *list = file->private_data;
@@ -119,6 +129,7 @@
 static void tsdev_free(struct tsdev *tsdev)
 {
 	devfs_remove("input/ts%d", tsdev->minor);
+	class_simple_device_remove(MKDEV(INPUT_MAJOR, TSDEV_MINOR_BASE + tsdev->minor));
 	tsdev_table[tsdev->minor] = NULL;
 	kfree(tsdev);
 }
@@ -333,6 +344,9 @@
 	
 	devfs_mk_cdev(MKDEV(INPUT_MAJOR, TSDEV_MINOR_BASE + minor),
 			S_IFCHR|S_IRUGO|S_IWUSR, "input/ts%d", minor);
+	class_simple_device_add(input_class, 
+				MKDEV(INPUT_MAJOR, TSDEV_MINOR_BASE + minor),
+				dev->dev, "ts%d", minor);
 
 	return &tsdev->handle;
 }
@@ -394,10 +408,3 @@
 
 module_init(tsdev_init);
 module_exit(tsdev_exit);
-
-MODULE_AUTHOR("James Simmons <jsimmons@transvirtual.com>");
-MODULE_DESCRIPTION("Input driver to touchscreen converter");
-MODULE_PARM(xres, "i");
-MODULE_PARM_DESC(xres, "Horizontal screen resolution");
-MODULE_PARM(yres, "i");
-MODULE_PARM_DESC(yres, "Vertical screen resolution");
diff -Nru a/drivers/isdn/Kconfig b/drivers/isdn/Kconfig
--- a/drivers/isdn/Kconfig	Tue Feb  3 19:45:42 2004
+++ b/drivers/isdn/Kconfig	Tue Feb  3 19:45:42 2004
@@ -16,7 +16,7 @@
 	  conversations while downloading stuff.  It only works if your
 	  computer is equipped with an ISDN card and both you and your service
 	  provider purchased an ISDN line from the phone company.  For
-	  details, read <http://alumni.caltech.edu/~dank/isdn/> on the WWW.
+	  details, read <http://www.alumni.caltech.edu/~dank/isdn/> on the WWW.
 
 	  Select this option if you want your kernel to support ISDN.
 
diff -Nru a/drivers/isdn/Makefile b/drivers/isdn/Makefile
--- a/drivers/isdn/Makefile	Tue Feb  3 19:45:42 2004
+++ b/drivers/isdn/Makefile	Tue Feb  3 19:45:42 2004
@@ -12,6 +12,5 @@
 obj-$(CONFIG_ISDN_DRV_SC)		+= sc/
 obj-$(CONFIG_ISDN_DRV_LOOP)		+= isdnloop/
 obj-$(CONFIG_ISDN_DRV_ACT2000)		+= act2000/
-obj-$(CONFIG_ISDN_DRV_EICON)		+= eicon/
 obj-$(CONFIG_HYSDN)			+= hysdn/
 obj-$(CONFIG_ISDN_DRV_TPAM)		+= tpam/
diff -Nru a/drivers/isdn/eicon/Divas_mod.c b/drivers/isdn/eicon/Divas_mod.c
--- a/drivers/isdn/eicon/Divas_mod.c	Tue Feb  3 19:45:16 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,134 +0,0 @@
-/*
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#include <linux/config.h>
-#include <linux/init.h>
-#include <linux/fs.h>
-#undef N_DATA
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/pci.h>
-#include <linux/ioport.h>
-#include <linux/slab.h>
-#include <linux/errno.h>
-
-#include "adapter.h"
-#include "uxio.h"
-
-
-MODULE_DESCRIPTION("ISDN4Linux: Driver for Eicon Diva Server cards");
-MODULE_AUTHOR("Armin Schindler");
-MODULE_LICENSE("GPL");
-
-void DivasInitDpc(void);
-
-#ifdef MODULE
-#include "idi.h"
-void DIVA_DIDD_Write(DESCRIPTOR *, int);
-EXPORT_SYMBOL_NOVERS(DIVA_DIDD_Read);
-EXPORT_SYMBOL_NOVERS(DIVA_DIDD_Write);
-EXPORT_SYMBOL_NOVERS(DivasPrintf);
-#endif
-
-int DivasCardsDiscover(void);
-
-static int __init
-divas_init(void)
-{
-	printk(KERN_DEBUG "DIVA Server Driver - initialising\n");
-	
-	printk(KERN_DEBUG "DIVA Server Driver - Version 2.0.16\n");
-
-#if !defined(CONFIG_PCI)
-	printk(KERN_WARNING "CONFIG_PCI is not defined!\n");
-	return -ENODEV;
-#endif
-
-	DivasInitDpc();
-
-	if (DivasCardsDiscover() < 0)
-	{
-		printk(KERN_WARNING "Divas: Not loaded\n");
-		return -ENODEV;
-	}
-
-    return 0;
-}
-
-static void __exit
-divas_exit(void)
-{
-	card_t *pCard;
-	word wCardIndex;
-	extern int Divas_major;
-
-	printk(KERN_DEBUG "DIVA Server Driver - unloading\n");
-
-	pCard = DivasCards;
-	for (wCardIndex = 0; wCardIndex < MAX_CARDS; wCardIndex++)
-	{
-		if ((pCard->hw) && (pCard->hw->in_use))
-		{
-
-			(*pCard->card_reset)(pCard);
-			
-			UxIsrRemove(pCard->hw, pCard);
-			UxCardHandleFree(pCard->hw);
-
-			if(pCard->e_tbl != NULL)
-			{
-				kfree(pCard->e_tbl);
-			}
-
-			
-			if(pCard->hw->card_type == DIA_CARD_TYPE_DIVA_SERVER_B)
-			{	
-				release_region(pCard->hw->io_base,0x20);		
-				release_region(pCard->hw->reset_base,0x80);		
-			}
-
-			// If this is a 4BRI ...
-			if (pCard->hw->card_type == DIA_CARD_TYPE_DIVA_SERVER_Q)
-			{
-				// Skip over the next 3 virtual adapters
-				wCardIndex += 3;
-
-				// But free their handles 
-				pCard++;
-				UxCardHandleFree(pCard->hw);
-			
-				if(pCard->e_tbl != NULL)
-				{
-					kfree(pCard->e_tbl);
-				}
-				
-				pCard++;
-				UxCardHandleFree(pCard->hw);
-				
-				if(pCard->e_tbl != NULL)
-				{
-					kfree(pCard->e_tbl);
-				}
-				
-				pCard++;
-				UxCardHandleFree(pCard->hw);
-				
-				if(pCard->e_tbl != NULL)
-				{
-					kfree(pCard->e_tbl);
-				}
-			}
-		}
-		pCard++;
-	}
-
-	unregister_chrdev(Divas_major, "Divas");
-}
-
-module_init(divas_init);
-module_exit(divas_exit);
-
diff -Nru a/drivers/isdn/eicon/Kconfig b/drivers/isdn/eicon/Kconfig
--- a/drivers/isdn/eicon/Kconfig	Tue Feb  3 19:45:18 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,53 +0,0 @@
-#
-# Config.in for Eicon active ISDN support
-#
-config ISDN_DRV_EICON
-	bool "Eicon active card support"
-	help
-	  Say Y here if you have an Eicon active ISDN card. In order to use
-	  this card, additional firmware is necessary, which has to be loaded
-	  into the card using the eiconctrl utility which is part of the
-	  latest isdn4k-utils package. Please read the file
-	  <file:Documentation/isdn/README.eicon> for more information.
-
-choice
-	prompt "Eicon active card support"
-	optional
-	depends on ISDN_DRV_EICON && ISDN && m
-
-config ISDN_DRV_EICON_DIVAS
-	tristate "Eicon driver"
-	depends on PCI
-	help
-	  Enable this option if you want the eicon driver as standalone
-	  version with no interface to the ISDN4Linux isdn module. If you
-	  say Y here, the eicon module only supports the Diva Server PCI
-	  cards and will provide its own IDI interface. You should say N
-	  here.
-
-config ISDN_DRV_EICON_OLD
-	tristate "Legacy driver"
-	help
-	  Say Y here to use your Eicon active ISDN card with ISDN4Linux
-	  isdn module.
-
-config ISDN_DRV_EICON_PCI
-	bool "Eicon PCI DIVA Server BRI/PRI/4BRI support"
-	depends on ISDN_DRV_EICON_OLD && PCI
-	help
-	  Say Y here if you have an Eicon Diva Server (BRI/PRI/4BRI) ISDN
-	  card.  Please read <file:Documentation/isdn/README.eicon> for more
-	  information.
-
-config ISDN_DRV_EICON_ISA
-	bool "Eicon S,SX,SCOM,Quadro,S2M support"
-	depends on ISDN_DRV_EICON_OLD
-	help
-	  Say Y here if you have an old-type Eicon active ISDN card. In order
-	  to use this card, additional firmware is necessary, which has to be
-	  loaded into the card using the eiconctrl utility which is part of
-	  the latest isdn4k-utils package. Please read the file
-	  <file:Documentation/isdn/README.eicon> for more information.
-
-endchoice
-
diff -Nru a/drivers/isdn/eicon/Makefile b/drivers/isdn/eicon/Makefile
--- a/drivers/isdn/eicon/Makefile	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,19 +0,0 @@
-# Makefile for the eicon ISDN device driver
-
-# Each configuration option enables a list of files.
-
-obj-$(CONFIG_ISDN_DRV_EICON_OLD)    	+= eicon.o
-obj-$(CONFIG_ISDN_DRV_EICON_DIVAS)	+= divas.o
-
-# Multipart objects.
-
-eicon-y					:= eicon_mod.o eicon_isa.o eicon_pci.o \
-					   eicon_idi.o eicon_io.o
-eicon-$(CONFIG_ISDN_DRV_EICON_PCI)	+= common.o idi.o bri.o pri.o log.o \
-		   			   xlog.o kprintf.o fpga.o fourbri.o lincfg.o \
-					   linchr.o linsys.o linio.o
-
-divas-y					:= common.o idi.o bri.o pri.o log.o xlog.o \
-					   kprintf.o fpga.o fourbri.o lincfg.o \
-					   linchr.o linsys.o linio.o Divas_mod.o
-
diff -Nru a/drivers/isdn/eicon/adapter.h b/drivers/isdn/eicon/adapter.h
--- a/drivers/isdn/eicon/adapter.h	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,247 +0,0 @@
-/*
- * Main internal include file for Diva Server driver
- *
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.7  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#if !defined(ADAPTER_H)
-#define ADAPTER_H
-
-#include "sys.h"
-#include "idi.h"
-#include "divas.h"
-#undef ID_MASK
-#include "pc.h"
-
-#define XMOREC 0x1f
-#define XMOREF 0x20
-#define XBUSY  0x40
-#define RMORE  0x80
-
-        /* structure for all information we have to keep on a per   */
-        /* adapater basis                                           */
-
-typedef struct adapter_s ADAPTER;
-
-struct adapter_s {
-  void * io;
-
-  byte IdTable[256];
-  byte ReadyInt;
-
-  byte (* ram_in)(ADAPTER * a, void * adr);
-  word (* ram_inw)(ADAPTER * a, void * adr);
-  void (* ram_in_buffer)(ADAPTER * a, void * adr, void * P, word length);
-  void (* ram_look_ahead)(ADAPTER * a, PBUFFER * RBuffer, ENTITY * e);
-
-  void (* ram_out)(ADAPTER * a, void * adr, byte data);
-  void (* ram_outw)(ADAPTER * a, void * adr, word data);
-  void (* ram_out_buffer)(ADAPTER * a, void * adr, void * P, word length);
-
-  void (* ram_inc)(ADAPTER * a, void * adr);
-};
-
-typedef struct card card_t;
-
-typedef int	card_load_fn_t(card_t *card, dia_load_t *load);
-typedef int	card_config_fn_t(card_t *card, dia_config_t *config);
-typedef int	card_start_fn_t(card_t *card, byte *channels);
-typedef	int	card_reset_fn_t(card_t *card);
-typedef int card_mem_get_fn_t(card_t *card, mem_block_t *mem_block);
-
-#define	MAX_PENTITIES	256		/* Number of entities primary adapter */
-#define MAX_ENTITIES	16		/* Number of entities standard adapter */
-
-typedef struct e_info_s E_INFO;
-
-struct e_info_s
-{
-	ENTITY		*e;				/* entity pointer */
-	byte		next;			/* chaining index */
-	word		assign_ref;		/* assign reference */
-};
-
-/* DIVA card info (details hidden from user) */
-
-typedef struct	ux_diva_card_s ux_diva_card_t;
-
-/* card info */
-
-struct card
-{
-	ADAPTER				a;				/* per-adapter information */
-	dia_card_t			cfg;			/* card configuration */
-	int 				state;			/* State of the adapter */
-	dword 				serial_no;		/* serial number */
-	int 				test_int_pend;	/* set for interrupt testing */
-	ux_diva_card_t		*hw;			/* O/S-specific handle */
-	card_reset_fn_t		*card_reset;	/* call this to reset card */
-	card_load_fn_t		*card_load;		/* call this to load card */
-	card_config_fn_t	*card_config;	/* call this to config card */
-	card_start_fn_t		*card_start;	/* call this to start card */
-	card_mem_get_fn_t	*card_mem_get;	/* call this to get card memory */
-	E_INFO				*e_tbl;			/* table of ENTITY pointers */
-	byte				e_head;			/* list of active ENTITIES */
-	byte				e_tail;			/* list of active ENTITIES */
-	int					e_count;		/* # of active ENTITIES */
-	int					e_max;			/* total # of ENTITIES */
-	byte				assign;			/* assign queue entry */
-	PBUFFER				RBuffer;		/* Copy of receive lookahead buffer */
-	int					log_types;		/* bit-mask of active logs */
-	word				xlog_offset;	/* offset to XLOG buffer on card */
-	void		(*out)(ADAPTER *a);
-	byte		(*dpc)(ADAPTER * a);
-	byte		(*test_int)(ADAPTER * a);
-	void		(*clear_int)(ADAPTER * a);
-	void		(*reset_int)(card_t *c);
-	int  		is_live;
-
-	int		(*card_isr)(card_t *card);
-
-	int 		int_pend;		/* interrupt pending */
-	long		interrupt_reentered;
-	long 		dpc_reentered;
-	int 		set_xlog_request;
-
-} ;
-
-/* card information */
-
-#define	MAX_CARDS	20		/* max number of cards on a system */
-
-extern
-card_t			DivasCards[];
-
-extern
-int				DivasCardNext;
-
-extern
-dia_config_t	DivasCardConfigs[];
-
-extern
-byte 			DivasFlavourConfig[];
-
-/*------------------------------------------------------------------*/
-/* public functions of IDI common code                              */
-/*------------------------------------------------------------------*/
-
-void DivasOut(ADAPTER * a);
-byte DivasDpc(ADAPTER * a);
-byte DivasTestInt(ADAPTER * a);
-void DivasClearInt(ADAPTER * a);
-
-/*------------------------------------------------------------------*/
-/* public functions of configuration platform-specific code         */
-/*------------------------------------------------------------------*/
-
-int DivasConfigGet(dia_card_t *card);
-
-/*------------------------------------------------------------------*/
-/* public functions of LOG related code                             */
-/*------------------------------------------------------------------*/
-
-void	DivasXlogReq(int card_num);
-int		DivasXlogRetrieve(card_t *card);
-void	DivasLog(dia_log_t *log);
-void	DivasLogIdi(card_t *card, ENTITY *e, int request);
-
-/*------------------------------------------------------------------*/
-/* public functions to initialise cards for each type supported     */
-/*------------------------------------------------------------------*/
-
-int		DivasPriInit(card_t *card, dia_card_t *cfg);
-
-int		DivasBriInit(card_t *card, dia_card_t *cfg);
-int		Divas4BriInit(card_t *card, dia_card_t *cfg);
-void 	DivasBriPatch(card_t *card);
-
-/*------------------------------------------------------------------*/
-/* public functions of log common code                              */
-/*------------------------------------------------------------------*/
-
-extern	char	*DivasLogFifoRead(void);
-extern	void	DivasLogFifoWrite(char *entry, int length);
-extern	int		DivasLogFifoEmpty(void);
-extern	int		DivasLogFifoFull(void);
-extern	void    DivasLogAdd(void *buffer, int length);
-
-/*------------------------------------------------------------------*/
-/* public functions of misc. platform-specific code         		*/
-/*------------------------------------------------------------------*/
-
-int		DivasDpcSchedule(void);
-void		DivasDoDpc(unsigned long);
-int		DivasScheduleRequestDpc(void);
-
-/* table of IDI request functions */
-
-extern
-IDI_CALL	DivasIdiRequest[];
-
-/*
- * initialisation entry point
- */
-
-int		DivasInit(void);
-
-/*
- * Get information on the number and type of cards present
- */
-
-extern
-int 	DivasCardsDiscover(void);
-
-/*
- * initialise a new card
- */
-
-int		DivasCardNew(dia_card_t *card);
-
-/*
- * configure specified card
- */
-
-int		DivasCardConfig(dia_config_t *config);
-
-/*
- * load specified binary code onto card
- */
-
-int		DivasCardLoad(dia_load_t *load);
-
-/*
- * start specified card running
- */
-
-int		DivasCardStart(int card_id);
-
-/*
- * ISR for card
- * Returns 0 if specified card was interrupting
- */
-
-int		DivasIsr(void *arg);
-
-/*
- * Get number of active cards
- */
-
-int		DivasGetNum(void);
-
-/*
- * Get list of active cards
- */
-
-int		DivasGetList(dia_card_list_t *card_list);
-
-/* definitions common to several card types */
-
-#define DIVAS_SHARED_OFFSET     (0x1000)
-
-#endif /* ADAPTER_H */
diff -Nru a/drivers/isdn/eicon/bri.c b/drivers/isdn/eicon/bri.c
--- a/drivers/isdn/eicon/bri.c	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,697 +0,0 @@
-/*
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.8  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#include "eicon.h"
-#include "sys.h"
-#include "idi.h"
-#include "divas.h"
-#include "pc.h"
-#include "pr_pc.h"
-#include "dsp_defs.h"
-
-#include "adapter.h"
-#include "uxio.h"
-
-#define PCI_BADDR0	0x10
-#define PCI_BADDR1	0x14
-#define PCI_BADDR2	0x18
-
-#define DIVAS_SIGNATURE 0x4447
-
-/* offset to start of MAINT area (used by xlog) */
-
-#define	DIVAS_MAINT_OFFSET	0xff00		/* value for BRI card */
-
-#define PROTCAP_TELINDUS	0x1
-#define PROTCAP_V90D		0x8
-
-word GetProtFeatureValue(char *sw_id);
-byte io_in(ADAPTER *a, void *adr);
-word io_inw(ADAPTER *a, void *adr);
-void io_in_buffer(ADAPTER *a, void *adr, void *P, word length);
-void io_look_ahead(ADAPTER *a, PBUFFER *RBuffer, ENTITY *e);
-void io_out(ADAPTER *a, void *adr, byte data);
-void io_outw(ADAPTER *a, void *adr, word data);
-void io_out_buffer(ADAPTER *a, void *adr, void *P, word length);
-void io_inc(ADAPTER *a, void *adr);
-
-static int diva_server_bri_test_int(card_t *card);
-static int bri_ISR (card_t* card);
-
-#define PLX_IOBASE		0
-#define	DIVAS_IOBASE	1
-
-#define	REG_DATA		0x00
-#define	REG_ADDRLO		0x04
-#define REG_ADDRHI		0x0C
-#define REG_IOCTRL		0x10
-
-#define M_PCI_RESET	0x10
-
-byte UxCardPortIoIn(ux_diva_card_t *card, byte *base, int offset);
-word UxCardPortIoInW(ux_diva_card_t *card, byte *base, int offset);
-void UxCardPortIoOut(ux_diva_card_t *card, byte *base, int offset, byte);
-void UxCardPortIoOutW(ux_diva_card_t *card, byte *base, int offset, word);
-
-int DivasBRIInitPCI(card_t *card, dia_card_t *cfg);
-
-static
-int	diva_server_bri_reset(card_t *card)
-{
-	byte *DivasIOBase;
-	word i;
-	dword dwWait;
-
-	UxCardLog(0);
-
-	DPRINTF(("divas: resetting BRI adapter"));
-
-	DivasIOBase = UxCardMemAttach(card->hw, DIVAS_IOBASE);
-
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_IOCTRL, 0);
-
-	for (i=0; i < 50000; i++)
-		;
-
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_ADDRHI, 0);
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 0);
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_DATA  , 0);
-
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_ADDRHI, 0xFF);
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 0x0000);
-
-	for (i=0; i<0x8000; i++)
-	{
-		UxCardPortIoOutW(card->hw, DivasIOBase, REG_DATA , 0);
-	}
-
-	for (dwWait=0; dwWait < 0x00FFFFFF; dwWait++)
-		;
-
-	UxCardMemDetach(card->hw, DivasIOBase);
-
-	return 0;
-}
-
-static
-void diva_server_bri_reset_int(card_t *card)
-{
-	byte *DivasIOBase = NULL;
-
-	DivasIOBase = UxCardMemAttach(card->hw, DIVAS_IOBASE);
-
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_IOCTRL, 0x08);
-
-	UxCardMemDetach(card->hw, DivasIOBase);
-
-	return;
-}
-
-static
-int diva_server_bri_start(card_t *card, byte *channels)
-{
-	byte *DivasIOBase, *PLXIOBase;
-	word wSig = 0;
-	word i;
-	dword dwSerialNum;
-	byte bPLX9060 = FALSE;
-
-	DPRINTF(("divas: starting Diva Server BRI card"));
-
-	card->is_live = FALSE;
-
-	DivasIOBase = UxCardMemAttach(card->hw, DIVAS_IOBASE);
-
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_ADDRHI, 0xFF);
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 0x1E);
-
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA  , 0);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA  , 0);
-	
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_IOCTRL, 0x08);
-
-	/* wait for signature to indicate card has started */
-	for (i = 0; i < 300; i++)
-	{
-		UxCardPortIoOut(card->hw, DivasIOBase, REG_ADDRHI, 0xFF);
-		UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 0x1E);
-		wSig = UxCardPortIoInW(card->hw, DivasIOBase, REG_DATA);
-
-		if (wSig == DIVAS_SIGNATURE)
-		{
-			DPRINTF(("divas: card started after %d ms", i * 10));
-			break;
-		}
-		UxPause(10);
-	}
-
-	if (wSig != DIVAS_SIGNATURE)
-	{
-		DPRINTF(("divas: card failed to start (Sig=0x%x)", wSig));
-		UxCardMemDetach(card->hw, DivasIOBase);
-		return -1;
-	}
-
-	card->is_live = TRUE;
-
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_ADDRHI, 0xFF);
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 0x3F6);
-	*channels = UxCardPortIoInW(card->hw, DivasIOBase, REG_DATA);
-
-	UxCardMemDetach(card->hw, DivasIOBase);
-
-	PLXIOBase = UxCardMemAttach(card->hw, PLX_IOBASE);
-
-	bPLX9060 = UxCardPortIoInW(card->hw, PLXIOBase, 0x6C) | UxCardPortIoInW(card->hw, PLXIOBase, 0x6E);
-
-	if (bPLX9060)
-	{ 
-		dwSerialNum = (UxCardPortIoInW(card->hw, PLXIOBase, 0x1E) << 16) | 
-					(UxCardPortIoInW(card->hw, PLXIOBase, 0x22));
-		DPRINTF(("divas: PLX9060 in use. Serial number 0x%04X", dwSerialNum));
-	}
-	else
-	{
-		dwSerialNum = (UxCardPortIoInW(card->hw, PLXIOBase, 0x22) << 16) | 
-					(UxCardPortIoInW(card->hw, PLXIOBase, 0x26));
-		DPRINTF(("divas: PLX9050 in use. Serial number 0x%04X", dwSerialNum));
-	}
-
-	UxCardMemDetach(card->hw, PLXIOBase);
-
-	card->serial_no = dwSerialNum;
-
-	diva_server_bri_test_int(card);
-	
-	return 0;
-}
-
-static
-int diva_server_bri_load(card_t *card, dia_load_t *load)
-{
-	byte *DivasIOBase;
-	dword r3000_base;
-	dword dwAddr, dwLength, i;
-	word wTest, aWord;
-
-	DPRINTF(("divas: loading Diva Server BRI card"));
-
-	switch (load->code_type)
-	{
-		case DIA_CPU_CODE:
-		DPRINTF(("divas: loading RISC %s", &load->code[0x80]));
-
-		card->hw->features = GetProtFeatureValue((char *)&load->code[0x80]);
-		DPRINTF(("divas: features 0x%x", card->hw->features));
-		if (card->hw->features == 0xFFFF)
-		{
-			DPRINTF(("divas: invalid feature string failed load\n"));
-			return -1;
-		}
-
-		r3000_base = 0;
-		break;
-
-		case DIA_DSP_CODE:
-		DPRINTF(("divas: DSP code \"%s\"", load->code));
-
-		if ((card->hw->features) && (!(card->hw->features & PROTCAP_TELINDUS)))
-		{
-			DPRINTF(("divas: only Telindus style binaries supported"));
-			return -1;
-		}
-
-		if ((card->hw->features) && (card->hw->features & PROTCAP_V90D))
-		{
-			DPRINTF(("divas: V.90 DSP binary"));
-			r3000_base = (0xBF790000 + (((sizeof(dword) + (sizeof(t_dsp_download_desc)* DSP_MAX_DOWNLOAD_COUNT)) + 3) & 0xFFFFFFFC));
-		}
-		else
-		{
-			DPRINTF(("divas: non-V.90 DSP binary"));
-			r3000_base = (0xBF7A0000 + (((sizeof(dword) + (sizeof(t_dsp_download_desc)* DSP_MAX_DOWNLOAD_COUNT)) + 3) & 0xFFFFFFFC));
-		}
-		DPRINTF(("divas: loading at 0x%x", r3000_base));
-		break;
-
-		case DIA_TABLE_CODE:
-		DPRINTF(("divas: TABLE code"));
-		if ((card->hw->features) && (card->hw->features & PROTCAP_V90D))
-		{
-			r3000_base = 0xBF790000 + sizeof(dword);
-		}
-		else
-		{
-			r3000_base = 0xBF7A0000 + sizeof(dword);
-		}
-
-		break;
-
-		case DIA_DLOAD_CNT:
-		DPRINTF(("divas: COUNT code"));
-		if ((card->hw->features) && (card->hw->features & PROTCAP_V90D))
-		{
-			r3000_base = 0xBF790000;
-		}
-		else
-		{
-			r3000_base = 0xBF7A0000;
-		}
-		break;
-
-		default:
-		DPRINTF(("divas: unknown code type %d", load->code_type));
-		return -1;
-		break;
-	}
-
-	DPRINTF(("divas: Writing %d bytes to adapter, address 0x%x", load->length, r3000_base));
-
-	DivasIOBase = UxCardMemAttach(card->hw, DIVAS_IOBASE);
-
-	DPRINTF(("divas: Attached to 0x%04X", DivasIOBase));
-
-	dwLength = load->length;
-
-	for (i=0; i < dwLength; i++)
-	{
-		dwAddr = r3000_base + i;
-
-		UxCardPortIoOut(card->hw, DivasIOBase, REG_ADDRHI, dwAddr >> 16);
-		UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, dwAddr);
-
-		UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, load->code[i]);
-	}
-
-	DPRINTF(("divas: Verifying"));
-
-	for (i=0; i<dwLength; i++)
-	{
-		dwAddr = r3000_base + i;
-
-		UxCardPortIoOut(card->hw, DivasIOBase, REG_ADDRHI, dwAddr >> 16);
-		UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, dwAddr);
-
-		wTest = UxCardPortIoIn(card->hw, DivasIOBase, REG_DATA);
-
-		aWord = load->code[i];
-
-		if (wTest != aWord)
-		{
-			DPRINTF(("divas: load verify failed on byte %d", i));
-			DPRINTF(("divas: RAM 0x%x   File 0x%x",wTest,aWord));
-			
-			UxCardMemDetach(card->hw, DivasIOBase);
-
-			return -1;
-		}
-	}
-
-	DPRINTF(("divas: Loaded and verified. Detaching from adapter"));
-
-	UxCardMemDetach(card->hw, DivasIOBase);
-
-	UxCardLog(0);
-
-	return 0;
-}
-
-static
-int diva_server_bri_config(card_t *card, dia_config_t *config)
-{
-	byte *DivasIOBase, i;
-
-	DPRINTF(("divas: configuring Diva Server BRI card"));
-
-	DivasIOBase = UxCardMemAttach(card->hw, DIVAS_IOBASE);
-
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_ADDRHI, 0xFF);
-
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 8);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->tei);
-
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 9);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->nt2);
-
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 10);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->sig_flags);
-
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 11);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->watchdog);
-
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 12);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->permanent);
-
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 13);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, 0);
-
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 14);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->stable_l2);
-
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 15);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->no_order_check);
-
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 16);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, 0);
-
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 17);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, 0);
-
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 18);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->low_channel);
-
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 19);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->prot_version);
-
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 20);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->crc4);
-
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 21);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, 0);
-
-	if ((card->hw->features) && (card->hw->features & PROTCAP_V90D))
-	{
-		DPRINTF(("divas: Signifying V.90"));
-		UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 22);
-		UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, 4);
-	}
-	else
-	{
-		UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 22);
-		UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, 0);
-	}
-
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 23);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, card->serial_no & 0xFF);
-
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 24);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, (card->serial_no >> 8) & 0xFF);
-
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 25);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, (card->serial_no >> 16) & 0xFF);
-
-	UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 26);
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, 21);
-
-	for (i=0; i<32; i++)
-	{
-		UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 32+i);
-		UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->terminal[0].oad[i]);
-
-		UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 64+i);
-		UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->terminal[0].osa[i]);
-
-		UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 96+i);
-		UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->terminal[0].spid[i]);
-
-
-		UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 128+i);
-		UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->terminal[1].oad[i]);
-
-		UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 160+i);
-		UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->terminal[1].osa[i]);
-
-		UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 192+i);
-		UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->terminal[1].spid[i]);
-	}
-
-	UxCardMemDetach(card->hw, DivasIOBase);
-
-	return 0;
-}
-
-void DivasBriPatch(card_t *card)
-{
-	dword	PLXIOBase = 0;
-	dword	DivasIOBase = 0;
-
-	PLXIOBase = card->cfg.reset_base;
-	DivasIOBase = card->cfg.io_base;
-
-	if(card->hw == NULL)
-	{
-		DPRINTF(("Divas: BRI PATCH (PLX chip) card->hw is null"));
-		return;
-	}
-
-	if (PLXIOBase == 0)
-	{
-		DPRINTF(("Divas: BRI (PLX chip) cannot be patched. The BRI adapter may"));
-		DPRINTF(("Divas:   not function properly. If you do encounter problems,"));
-		DPRINTF(("Divas:   ensure that your machine is using the latest BIOS."));
-		return;
-	}
-
-	DPRINTF(("Divas: PLX I/O Base 0x%x", PLXIOBase));
-	DPRINTF(("Divas: Divas I/O Base 0x%x", DivasIOBase));
-
-	if (PLXIOBase & 0x80)
-	{
-		dword dwSize, dwSerialNum, dwCmd;
-		boolean_t bPLX9060;
-		word wSerHi, wSerLo;
-
-		DPRINTF(("Divas: Patch required"));
-		dwCmd = 0;
-		UxPciConfigWrite(card->hw, 4, PCI_COMMAND, &dwCmd);
-
-		PLXIOBase &= ~0x80;
-		UxPciConfigWrite(card->hw, 4, PCI_BADDR1, &PLXIOBase);
-
-		dwSize = 0xFFFFFFFF;
-		UxPciConfigWrite(card->hw, 4, PCI_BADDR1, &dwSize);
-		UxPciConfigRead(card->hw, 4, PCI_BADDR1, &dwSize);
-		
-		dwSize = (~ (dwSize & ~7)) + 1;
-
-		DivasIOBase = PLXIOBase + dwSize;
-
-		card->cfg.reset_base = PLXIOBase;
-		card->cfg.io_base = DivasIOBase;
-		UxPciConfigWrite(card->hw, 4, PCI_BADDR1, &card->cfg.reset_base);
-		UxPciConfigWrite(card->hw, 4, PCI_BADDR2, &card->cfg.io_base);
-
-		dwCmd = 5;
-		UxPciConfigWrite(card->hw, 4, PCI_COMMAND, &dwCmd);
-
-		bPLX9060 = UxCardPortIoInW(card->hw, (void *) card->cfg.reset_base, 0x6C) | 
-			   UxCardPortIoInW(card->hw, (void *) card->cfg.reset_base, 0x6E);
-
-		if (bPLX9060)
-		{
-			wSerHi = UxCardPortIoInW(card->hw, (void *) card->cfg.reset_base, 0x1E);
-			wSerLo = UxCardPortIoInW(card->hw, (void *) card->cfg.reset_base, 0x22);
-			dwSerialNum = (wSerHi << 16) | wSerLo;
-			UxCardLog(0);
-		}
-		else
-		{
-			wSerHi = UxCardPortIoInW(card->hw, (void *) card->cfg.reset_base, 0x22);
-			wSerLo = UxCardPortIoInW(card->hw, (void *) card->cfg.reset_base, 0x26);
-			dwSerialNum = (wSerHi << 16) | wSerLo;
-			UxCardLog(0);
-		}
-	}
-	else
-	{
-		word wSerHi, wSerLo;
-		boolean_t bPLX9060;
-		dword dwSerialNum;
-
-		DPRINTF(("divas: No patch required"));
-
-		bPLX9060 = UxCardPortIoInW(card->hw, (void *) card->cfg.reset_base, 0x6C) | 
-			   UxCardPortIoInW(card->hw, (void *) card->cfg.reset_base, 0x6E);
-
-		if (bPLX9060)
-		{
-			wSerHi = UxCardPortIoInW(card->hw, (void *) card->cfg.reset_base, 0x1E);
-			wSerLo = UxCardPortIoInW(card->hw, (void *) card->cfg.reset_base, 0x22);
-			dwSerialNum = (wSerHi << 16) | wSerLo;
-		}
-		else
-		{
-			wSerHi = UxCardPortIoInW(card->hw, (void *) card->cfg.reset_base, 0x22);
-			wSerLo = UxCardPortIoInW(card->hw, (void *) card->cfg.reset_base, 0x26);
-			dwSerialNum = (wSerHi << 16) | wSerLo;
-		}
-	}
-	DPRINTF(("Divas: After patching:"));
-	DPRINTF(("Divas: PLX I/O Base 0x%x", PLXIOBase));
-	DPRINTF(("Divas: Divas I/O Base 0x%x", DivasIOBase));
-
-}
-
-#define TEST_INT_DIVAS_BRI	0x12
-static
-int	diva_server_bri_test_int(card_t *card)
-{
-	boolean_t bPLX9060 = FALSE;
-	byte *PLXIOBase = NULL, *DivasIOBase = NULL;
-
-	DPRINTF(("divas: test interrupt for Diva Server BRI card"));
-
-	PLXIOBase = UxCardMemAttach(card->hw, PLX_IOBASE);
-
-	bPLX9060 = UxCardPortIoInW(card->hw, PLXIOBase, 0x6C) || UxCardPortIoInW(card->hw, PLXIOBase, 0x6E);
-
-	if (bPLX9060)
-	{ /* PLX9060 */
-		UxCardPortIoOut(card->hw, PLXIOBase, 0x69, 0x09);
-	}
-	else
-	{ /* PLX9050 */
-		UxCardPortIoOut(card->hw, PLXIOBase, 0x4C, 0x41);
-	}
-
-	card->test_int_pend = TEST_INT_DIVAS_BRI;
-
-	UxCardMemDetach(card->hw, PLXIOBase);
-
-	DivasIOBase = UxCardMemAttach(card->hw, DIVAS_IOBASE);
-
-	UxCardPortIoOut(card->hw, DivasIOBase, REG_IOCTRL, 0x89);
-
-	UxCardMemDetach(card->hw, DivasIOBase);
-	
-	return 0;
-}
-
-static
-int diva_server_bri_mem_get(card_t *card, mem_block_t *mem_block)
-{
-	dword user_addr = mem_block->addr;
-	word	length = 0;
-	dword	addr;
-	word	i;
-	byte *DivasIOBase;
-
-	DPRINTF(("divas: Retrieving memory from 0x%x", user_addr));
-
-	DivasIOBase = UxCardMemAttach(card->hw, DIVAS_IOBASE);
-
-	addr = user_addr;
-
-	for (i=0; i < (16 * 8); i++)
-	{
-		addr = user_addr + i;
-
-		UxCardPortIoOut(card->hw, DivasIOBase, REG_ADDRHI, addr >> 16);
-		UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, (word) addr);
-
-		mem_block->data[i] = UxCardPortIoIn(card->hw, DivasIOBase, REG_DATA);
-		length++;
-	}
-
-	UxCardMemDetach(card->hw, DivasIOBase);
-
-	return length;
-}
-
-int DivasBriInit(card_t *card, dia_card_t *cfg)
-{
-	DPRINTF(("divas: initialise Diva Server BRI card"));
-
-	if (DivasBRIInitPCI(card, cfg) == -1)
-	{
-		return -1;
-	}
-
-	card->card_reset 		= diva_server_bri_reset;
-	card->card_start 		= diva_server_bri_start;
-	card->card_load  		= diva_server_bri_load;
-	card->card_config		= diva_server_bri_config;
-	card->reset_int 		= diva_server_bri_reset_int;
-	card->card_mem_get 		= diva_server_bri_mem_get;
-
-	card->xlog_offset 		= DIVAS_MAINT_OFFSET;
-
-	card->out 			= DivasOut;
-	card->test_int 			= DivasTestInt;
-	card->dpc 			= DivasDpc;
-	card->clear_int 		= DivasClearInt;
-	card->card_isr 			= bri_ISR;
-
-	card->a.ram_out 		= io_out;
-	card->a.ram_outw 		= io_outw;
-	card->a.ram_out_buffer 	= io_out_buffer;
-	card->a.ram_inc 		= io_inc;
-
-	card->a.ram_in 			= io_in;
-	card->a.ram_inw 		= io_inw;
-	card->a.ram_in_buffer 	= io_in_buffer;
-	card->a.ram_look_ahead	= io_look_ahead;
-
-	return 0;
-}
-
-word GetProtFeatureValue(char *sw_id)
-{
-	word features = 0;
-
-	while ((*sw_id) && (sw_id[0] != '['))
-		sw_id++;
-
-	if (sw_id == NULL)
-	{
-		DPRINTF(("divas: no feature string present"));
-		features = -1;
-	}
-	else
-	{
-		byte i, shifter;
-
-		sw_id += 3;
-
-		for (i=0, shifter=12; i<4; i++, shifter-=4)
-		{
-			if ((sw_id[i] >= '0') && (sw_id[i] <= '9'))
-			{
-				features |= (sw_id[i] - '0') << shifter;
-			}
-			else if ((sw_id[i] >= 'a') && (sw_id[i] <= 'f'))
-			{
-				features |= (sw_id[i] - 'a' + 10) << shifter;
-			}
-			else if ((sw_id[i] >= 'A') && (sw_id[i] <= 'F'))
-			{
-				features |= (sw_id[i] - 'A' + 10) << shifter;
-			}
-			else
-			{
-				DPRINTF(("divas: invalid feature string"));
-				return -1;
-			}
-		}
-	}
-
-	return features;
-}
-
-
-int bri_ISR (card_t* card) 
-{
-	int served = 0;
-	byte *DivasIOBase = UxCardMemAttach(card->hw, DIVAS_IOBASE);
-
-	if (UxCardPortIoIn (card->hw, DivasIOBase, M_PCI_RESET) & 0x01) 
-	{
-		served = 1;
-		card->int_pend  += 1;
-		DivasDpcSchedule(); /* ISR DPC */
-		UxCardPortIoOut (card->hw, DivasIOBase, M_PCI_RESET, 0x08);
-	}
-
-	UxCardMemDetach(card->hw, DivasIOBase);
-
-	return (served != 0);
-}
-
-
diff -Nru a/drivers/isdn/eicon/common.c b/drivers/isdn/eicon/common.c
--- a/drivers/isdn/eicon/common.c	Tue Feb  3 19:45:33 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,867 +0,0 @@
-/*
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.15  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#include "eicon.h"
-#include "sys.h"
-#include "idi.h"
-#include "constant.h"
-#include "divas.h"
-#include "pc.h"
-#include "pr_pc.h"
-
-#include "uxio.h"
-
-#define DIVAS_LOAD_CMD		0x02
-#define DIVAS_START_CMD		0x03
-#define DIVAS_IRQ_RESET		0xC18
-#define DIVAS_IRQ_RESET_VAL	0xFE
-
-#define TEST_INT_DIVAS		0x11
-#define TEST_INT_DIVAS_BRI	0x12
-#define TEST_INT_DIVAS_Q	0x13
-
-#define DIVAS_RESET	0x81
-#define DIVAS_LED1	0x04
-#define DIVAS_LED2	0x08
-#define DIVAS_LED3	0x20
-#define DIVAS_LED4	0x40
-
-#define DIVAS_SIGNATURE 0x4447
-
-#define MP_PROTOCOL_ADDR 0xA0011000
-
-#define PLX_IOBASE	0
-#define	DIVAS_IOBASE	1
-
-typedef struct {
-		dword cmd;
-		dword addr;
-		dword len;
-		dword err;
-		dword live;
-		dword reserved[(0x1020>>2)-6];
-		dword signature;
-		byte  data[1];
-} diva_server_boot_t;
-
-int		DivasCardNext;
-card_t	DivasCards[MAX_CARDS];
-
-dia_config_t *DivasConfig(card_t *, dia_config_t *);
-
-static
-DESCRIPTOR DIDD_Table[32];
-
-void    DIVA_DIDD_Read( DESCRIPTOR *table, int tablelength )
-{
-        memset(table, 0, tablelength);
-
-        if (tablelength > sizeof(DIDD_Table))
-          tablelength = sizeof(DIDD_Table);
-
-        if(tablelength % sizeof(DESCRIPTOR)) {
-          tablelength /= sizeof(DESCRIPTOR);
-          tablelength *= sizeof(DESCRIPTOR);
-        }
-
-        if (tablelength > 0)
-          memcpy((void *)table, (void *)DIDD_Table, tablelength);
-
-	return;
-}
-
-void 	DIVA_DIDD_Write(DESCRIPTOR *table, int tablelength)
-{
-        if (tablelength > sizeof(DIDD_Table))
-          tablelength = sizeof(DIDD_Table);
-
-	memcpy((void *)DIDD_Table, (void *)table, tablelength);
-
-	return;
-}
-
-static
-void    init_idi_tab(void)
-{
-    DESCRIPTOR d[32];
-
-    memset(d, 0, sizeof(d));
-
-    d[0].type = IDI_DIMAINT;  /* identify the DIMAINT entry */
-    d[0].channels = 0; /* zero channels associated with dimaint*/
-    d[0].features = 0; /* no features associated with dimaint */
-    d[0].request = (IDI_CALL) DivasPrintf;
-    
-    DIVA_DIDD_Write(d, sizeof(d));
-
-    return;
-}
-
-/*
- * I/O routines for memory mapped cards
- */
-
-byte mem_in(ADAPTER *a, void *adr)
-{
-	card_t			*card = a->io;
-	unsigned char	*b, *m;
-	byte			value;
-
-	m = b = UxCardMemAttach(card->hw, DIVAS_SHARED_MEMORY);
-
-	m += (unsigned int) adr;
-
-	value = UxCardMemIn(card->hw, m);
-
-	UxCardMemDetach(card->hw, b);
-
-	return value;
-}
-
-word mem_inw(ADAPTER *a, void *adr)
-{
-	card_t			*card = a->io;
-	unsigned char	*b, *m;
-	word			value;
-
-	m = b = UxCardMemAttach(card->hw, DIVAS_SHARED_MEMORY);
-
-	m += (unsigned int) adr;
-
-	value = UxCardMemInW(card->hw, m);
-
-	UxCardMemDetach(card->hw, b);
-
-	return value;
-}
-
-void mem_in_buffer(ADAPTER *a, void *adr, void *P, word length)
-{
-	card_t			*card = a->io;
-	unsigned char	*b, *m;
-
-	m = b = UxCardMemAttach(card->hw, DIVAS_SHARED_MEMORY);
-
-	m += (unsigned int) adr;
-
-	UxCardMemInBuffer(card->hw, m, P, length);
-
-	UxCardMemDetach(card->hw, b);
-
-	return;
-}
-
-void mem_look_ahead(ADAPTER *a, PBUFFER *RBuffer, ENTITY *e)
-{
-	card_t			*card = a->io;
-	unsigned char	*b, *m;
-
-	m = b = UxCardMemAttach(card->hw, DIVAS_SHARED_MEMORY);
-
-	m += (dword) &RBuffer->length;
-	card->RBuffer.length = UxCardMemInW(card->hw, m);
-
-	m = b;
-	m += (dword) &RBuffer->P;
-	UxCardMemInBuffer(card->hw, m, card->RBuffer.P, card->RBuffer.length);
-
-	e->RBuffer = (DBUFFER *) &card->RBuffer;
-
-	UxCardMemDetach(card->hw, b);
-
-	return;
-}
-
-void mem_out(ADAPTER *a, void *adr, byte data)
-{
-	card_t			*card = a->io;
-	unsigned char	*b, *m;
-
-	m = b = UxCardMemAttach(card->hw, DIVAS_SHARED_MEMORY);
-
-	m += (unsigned int) adr;
-
-	UxCardMemOut(card->hw, m, data);
-
-	UxCardMemDetach(card->hw, b);
-
-	return;
-}
-
-void mem_outw(ADAPTER *a, void *adr, word data)
-{
-	card_t			*card = a->io;
-	unsigned char	*b, *m;
-
-	m = b = UxCardMemAttach(card->hw, DIVAS_SHARED_MEMORY);
-
-	m += (unsigned int) adr;
-
-	UxCardMemOutW(card->hw, m, data);
-
-	UxCardMemDetach(card->hw, b);
-
-	return;
-}
-
-void mem_out_buffer(ADAPTER *a, void *adr, void *P, word length)
-{
-	card_t			*card = a->io;
-	unsigned char	*b, *m;
-
-	m = b = UxCardMemAttach(card->hw, DIVAS_SHARED_MEMORY);
-
-	m += (unsigned int) adr;
-
-	UxCardMemOutBuffer(card->hw, m, P, length);
-
-	UxCardMemDetach(card->hw, b);
-
-	return;
-}
-
-void mem_inc(ADAPTER *a, void *adr)
-{
-	word			value;
-	card_t			*card = a->io;
-	unsigned char	*b, *m;
-
-	m = b = UxCardMemAttach(card->hw, DIVAS_SHARED_MEMORY);
-
-	m += (unsigned int) adr;
-
-	value = UxCardMemInW(card->hw, m);
-	value++;
-	UxCardMemOutW(card->hw, m, value);
-
-	UxCardMemDetach(card->hw, b);
-
-	return;
-}
-
-/*
- * I/O routines for I/O mapped cards
- */
-
-byte io_in(ADAPTER *a, void *adr)
-{
-	card_t		    *card = a->io;
-	byte		    value;
-	byte	*DivasIOBase = NULL;
-
-	DivasIOBase = UxCardMemAttach(card->hw, DIVAS_IOBASE);
-
-	value = UxCardIoIn(card->hw, DivasIOBase, adr);
-
-	UxCardMemDetach(card->hw, DivasIOBase);
-
-    return value;
-}
-
-word io_inw(ADAPTER *a, void *adr)
-{
-	card_t		*card = a->io;
-	word		value;
-	byte	*DivasIOBase = NULL;
-
-	DivasIOBase = UxCardMemAttach(card->hw, DIVAS_IOBASE);
-
-	value = UxCardIoInW(card->hw, DivasIOBase, adr);
-
-	UxCardMemDetach(card->hw, DivasIOBase);
-
-	return value;
-}
-
-void io_in_buffer(ADAPTER *a, void *adr, void *P, word length)
-{
-	card_t *card = a->io;
-	byte *DivasIOBase = NULL;
-
-	DivasIOBase = UxCardMemAttach(card->hw, DIVAS_IOBASE);
-
-	UxCardIoInBuffer(card->hw, DivasIOBase, adr, P,length);
-
-	UxCardMemDetach(card->hw, DivasIOBase);
-
-    return;
-}
-
-void io_look_ahead(ADAPTER *a, PBUFFER *RBuffer, ENTITY *e)
-{
-	card_t *card = a->io;
-	byte *DivasIOBase = NULL;
-
-	DivasIOBase = UxCardMemAttach(card->hw, DIVAS_IOBASE);
-
-	card->RBuffer.length = UxCardIoInW(card->hw, DivasIOBase, (byte *) RBuffer);
-
-	UxCardIoInBuffer(card->hw, DivasIOBase, &RBuffer->P, card->RBuffer.P, card->RBuffer.length);
-
-	UxCardMemDetach(card->hw, DivasIOBase);
-
-	e->RBuffer = (DBUFFER *) &card->RBuffer;
-
-    return;
-}
-
-void io_out(ADAPTER *a, void *adr, byte data)
-{
-	card_t		*card = a->io;
-	byte	*DivasIOBase = NULL;
-
-	DivasIOBase = UxCardMemAttach(card->hw, DIVAS_IOBASE);
-
-	UxCardIoOut(card->hw, DivasIOBase, adr, data);
-
-	UxCardMemDetach(card->hw, DivasIOBase);
-
-    return;
-}
-
-void io_outw(ADAPTER *a, void *adr, word data)
-{
-	card_t		*card = a->io;
-	byte	*DivasIOBase = NULL;
-
-	DivasIOBase = UxCardMemAttach(card->hw, DIVAS_IOBASE);
-
-	UxCardIoOutW(card->hw, DivasIOBase, adr, data);
-
-	UxCardMemDetach(card->hw, DivasIOBase);
-
-    return;
-}
-
-void io_out_buffer(ADAPTER *a, void *adr, void *P, word length)
-{
-	card_t		*card = a->io;
-	byte *DivasIOBase = NULL;
-
-	DivasIOBase = UxCardMemAttach(card->hw, DIVAS_IOBASE);
-
-	UxCardIoOutBuffer(card->hw, DivasIOBase, adr, P, length);
-
-	UxCardMemDetach(card->hw, DivasIOBase);
-
-    return;
-}
-
-void io_inc(ADAPTER *a, void *adr)
-{
-	word		value;
-	card_t		*card = a->io;
-	byte *DivasIOBase;
-
-	DivasIOBase = UxCardMemAttach(card->hw, DIVAS_IOBASE);
-
-	value = UxCardIoInW(card->hw, DivasIOBase, adr);
-	
-	value++;
-
-	UxCardIoOutW(card->hw, DivasIOBase, adr, value);
-
-	UxCardMemDetach(card->hw, DivasIOBase);
-
-    return;
-}
-
-static
-void test_int(card_t *card)
-
-{
-	byte *shared, *DivasIOBase;
-
-	switch (card->test_int_pend)
-	{
-		case TEST_INT_DIVAS:
-			DPRINTF(("divas: test interrupt pending"));
-			shared = UxCardMemAttach(card->hw, DIVAS_SHARED_MEMORY);
-
-			if (UxCardMemIn(card->hw, &shared[0x3FE]))
-			{
-				UxCardMemOut(card->hw, 
-								&(((struct pr_ram *)shared)->RcOutput), 0);
-				UxCardMemDetach(card->hw, shared);
-            	(*card->reset_int)(card);
-				shared = UxCardMemAttach(card->hw, DIVAS_SHARED_MEMORY);
-				UxCardMemOut(card->hw, &shared[0x3FE], 0);
-				DPRINTF(("divas: test interrupt cleared"));
-			}
-
-			UxCardMemDetach(card->hw, shared);
-
-			card->test_int_pend = 0;
-			break;
-
-		case TEST_INT_DIVAS_BRI:
-			DPRINTF(("divas: BRI test interrupt pending"));
-			(*card->reset_int)(card);
-			DivasIOBase = UxCardMemAttach(card->hw, DIVAS_IOBASE);
-			UxCardIoOutW(card->hw, DivasIOBase, (void *) 0x3FE, 0);
-			UxCardMemDetach(card->hw, DivasIOBase);
-			DPRINTF(("divas: test interrupt cleared"));
-			card->test_int_pend = 0;
-			break;
-
-		case TEST_INT_DIVAS_Q:
-			DPRINTF(("divas: 4BRI test interrupt pending"));
-			(*card->reset_int)(card);
-			card->test_int_pend = 0;
-			break;
-
-		default:
-			DPRINTF(("divas: unknown test interrupt pending"));
-			return;
-	}
-	return;
-}
-
-void card_isr (void *dev_id)
-{
-	card_t *card = (card_t *) dev_id;
-	ADAPTER *a = &card->a;
-	int ipl;
-
-	if (card->test_int_pend)
-	{
-		ipl = UxCardLock(card->hw);
-		card->int_pend=0;
-		test_int(card);
-		UxCardUnlock(card->hw,ipl);
-		return;
-	}
-	
-	if(card->card_isr)
-	{
-		(*(card->card_isr))(card);
-	}
-	else
-	{
-		ipl = UxCardLock(card->hw);
-	
-		if ((card->test_int)(a))
-		{
-			(card->reset_int)(card);
-		}
-		
-		UxCardUnlock(card->hw,ipl);
-		
-	}
-
-}
-
-int DivasCardNew(dia_card_t *card_info)
-{
-	card_t *card;
-	static boolean_t first_call = TRUE;
-	boolean_t NeedISRandReset = FALSE;
-
-	DPRINTF(("divas: new card "));
-
-	if (first_call)
-	{
-		first_call = FALSE;
-		init_idi_tab();
-	}
-
-	DivasConfigGet(card_info);
-	
-	if (DivasCardNext == DIM(DivasCards))
-	{
-		KDPRINTF((KERN_WARNING "Divas: no space available for new card"));
-		return -1;
-	}
-
-	card = &DivasCards[DivasCardNext];
-
-	card->state = DIA_UNKNOWN;
-
-	card->cfg = *card_info;
-
-	card->a.io = card;
-
-	if (UxCardHandleGet(&card->hw, card_info))
-	{
-		KDPRINTF((KERN_WARNING "Divas: cannot get OS specific handle for card"));
-		return -1;
-	}
-
-	if (card_info->card_type == DIA_CARD_TYPE_DIVA_SERVER_B)
-	{
-		DivasBriPatch(card);
-		card_info->io_base = card->cfg.io_base;
-	}
-
-	switch (card_info->card_type)
-	{
-		case DIA_CARD_TYPE_DIVA_SERVER:
-			if (DivasPriInit(card, card_info))
-			{
-				return -1;
-			}
-			NeedISRandReset = TRUE;
-			break;
-
-		case DIA_CARD_TYPE_DIVA_SERVER_B:
-			if (DivasBriInit(card, card_info))
-			{
-				return -1;
-			}
-			NeedISRandReset = TRUE;
-			break;
-
- 		case DIA_CARD_TYPE_DIVA_SERVER_Q:
-			if (Divas4BriInit(card, card_info))
-			{
-				return -1;
-			}
-
-			if (card_info->name[6] == '0')
-			{
-				NeedISRandReset = TRUE;
-			}
-			else // Need to set paramater for ISR anyway
-			{
-				card->hw->user_isr_arg = card;
-				card->hw->user_isr = card_isr;
-			}
-			break;   
-
-		default:
-			KDPRINTF((KERN_WARNING "Divas: unsupported card type (%d)", card_info->card_type));
-			return -1;
-	}
-
-	if (NeedISRandReset)
-	{
-		if (UxIsrInstall(card->hw, card_isr, card))
-		{
-			KDPRINTF((KERN_WARNING "Divas: Install ISR failed (IRQ %d)", card->cfg.irq));
-			UxCardHandleFree(card->hw);
-			return -1;
-		}
-
-		if (card_info->card_type != DIA_CARD_TYPE_DIVA_SERVER_Q)
-		{
-			if ((*card->card_reset)(card))
-			{
-				KDPRINTF((KERN_WARNING "Divas: Adapter reset failed"));
-				return -1;
-			}
-			card->state = DIA_RESET;
-		}
-
-		NeedISRandReset = FALSE;
-	}
-
-	DivasCardNext++;
-
-	return 0;
-}
-
-void	*get_card(int card_id)
-{
-	int i;
-
-	for (i=0; i < DivasCardNext; i++)
-	{
-		if (DivasCards[i].cfg.card_id == card_id)
-		{
-			return(&DivasCards[i]);
-		}
-	}
-
-	DPRINTF(("divas: get_card() : no such card id (%d)", card_id));
-
-	return NULL;
-}
-
-int DivasCardConfig(dia_config_t *config)
-{
-	card_t *card;
-	int status;
-
-	DPRINTF(("divas: configuring card"));
-
-	card = get_card(config->card_id);
-	if (!card)
-	{
-		return -1;
-	}
-
-	config = DivasConfig(card, config);
-
-	status = (*card->card_config)(card, config);
-
-	if (!status)
-	{
-		card->state = DIA_CONFIGURED;
-	}
-	return status;
-}
-
-int DivasCardLoad(dia_load_t *load)
-{
-	card_t *card;
-	int	status;
-
-	card = get_card(load->card_id);
-	if (!card)
-	{
-		return -1;
-	}
-
-	if (card->state == DIA_RUNNING)
-	{
-		(*card->card_reset)(card);
-	}
-
-	status = (*card->card_load)(card, load);
-	if (!status)
-	{
-		card->state = DIA_LOADED;
-	}
-	return status;
-}
-
-static int idi_register(card_t *card, byte channels)
-{
-    DESCRIPTOR d[32];
-    int length, num_entities;
-
-	DPRINTF(("divas: registering card with IDI"));
-
-	num_entities = (channels > 2) ? MAX_PENTITIES : MAX_ENTITIES;
-	card->e_tbl = UxAlloc(sizeof(E_INFO) * num_entities);
-
-	if (!card->e_tbl)
-	{
-		KDPRINTF((KERN_WARNING "Divas: IDI register failed - no memory available"));
-		return -1;
-	}
-
-	memset(card->e_tbl, 0, sizeof(E_INFO) * num_entities);
-	card->e_max = num_entities;
-
-    DIVA_DIDD_Read(d, sizeof(d));
-
-        for(length=0; length < DIM(d); length++)
-          if (d[length].type == 0) break;
-
-	if (length >= DIM(d))
-	{
-		KDPRINTF((KERN_WARNING "Divas: IDI register failed - table full"));
-		return -1;
-	}
-
-	switch (card->cfg.card_type)
-	{
-		case DIA_CARD_TYPE_DIVA_SERVER:
-		d[length].type = IDI_ADAPTER_PR;
-		/* d[length].serial = card->serial_no; */
-		break;
-
-		case DIA_CARD_TYPE_DIVA_SERVER_B:
-		d[length].type = IDI_ADAPTER_MAESTRA;
-		/* d[length].serial = card->serial_no; */
-		break;
-
-		// 4BRI is treated as 4 BRI adapters
-		case DIA_CARD_TYPE_DIVA_SERVER_Q:
-		d[length].type = IDI_ADAPTER_MAESTRA;
-		/* d[length].serial = card->cfg.serial; */
-	}
-
-	d[length].features = 0;
-	d[length].features |= DI_FAX3|DI_MODEM|DI_POST|DI_V110|DI_V120;
-
-	if ( card->hw->features & PROTCAP_MANIF )
-	{
-		d[length].features |= DI_MANAGE ;
-	}
-	if ( card->hw->features & PROTCAP_V_42 )
-	{
-		d[length].features |= DI_V_42 ;
-	}
-	if ( card->hw->features & PROTCAP_EXTD_FAX )
-	{
-		d[length].features |= DI_EXTD_FAX ;
-	}
-
-	d[length].channels = channels;
-	d[length].request = DivasIdiRequest[card - DivasCards];
-
-	length++;
-
-	DIVA_DIDD_Write(d, sizeof(d));
-
-    return 0;
-}
-
-int DivasCardStart(int card_id)
-{
-	card_t *card;
-	byte channels;
-	int status;
-
-	DPRINTF(("divas: starting card"));
-
-	card = get_card(card_id);
-	if (!card)
-	{
-		return -1;
-	}
-
-	status = (*card->card_start)(card, &channels);
-	if (status)
-	{
-		return status;
-	}
-
-	/* 4BRI == 4 x BRI so call idi_register 4 times each with 2 channels */
-	if (card->cfg.card_type == DIA_CARD_TYPE_DIVA_SERVER_Q)
-	{
-		int i;
-		card_t *FourBRISlave;
-
-		for (i=3; i >= 0; i--)
-		{
-			FourBRISlave = get_card(card_id - i); /* 0, 1, 2, 3 */
-			if (FourBRISlave)
-			{
-				idi_register(FourBRISlave, 2);
-				FourBRISlave->state = DIA_RUNNING;
-			}
-		}
-		card->serial_no = card->cfg.serial;
-
-		DPRINTF(("divas: card id %d (4BRI), serial no. 0x%x ready with %d channels", 
-				card_id - 3, card->serial_no, (int) channels));
-	}
-	else
-	{
-		status = idi_register(card, channels);
-		if (!status)
-		{
-			card->state = DIA_RUNNING;
-			DPRINTF(("divas: card id %d, serial no. 0x%x ready with %d channels", 
-						card_id, card->serial_no, (int) channels));
-		}
-	}
-
-	return status;
-}
-
-int DivasGetMem(mem_block_t *mem_block)
-{
-	card_t *card;
-	word	card_id = mem_block->card_id;
-
-	card = get_card(card_id);
-	if (!card)
-	{
-		return 0;
-	}
-
-	return (*card->card_mem_get)(card, mem_block);
-}
-
-
-/*
- * Deleyed Procedure Call for handling interrupts from card
- */
-
-void	DivaDoCardDpc(card_t *card)
-{
-	ADAPTER	*a;
-
-	a = &card->a;
-
-	if(UxInterlockedIncrement(card->hw, &card->dpc_reentered) > 1)
-	{
-		return;
-	}
-
-	do{
-		if((*(card->test_int))(a))
-		{
-			(*(card->dpc))(a);
-			(*(card->clear_int))(a);
-		}
-			(*(card->out))(a);
-	}while(UxInterlockedDecrement(card->hw, &card->dpc_reentered));
-			
-}
-
-void	DivasDoDpc(unsigned long dummy)
-{
-	card_t	*card = DivasCards;
-	int 	i = DivasCardNext;
-	
-	while(i--)
-	{
-            if (card->state == DIA_RUNNING)
-		DivaDoCardDpc(card);
-            card++;
-	}
-}
-
-/*
- * DivasGetNum
- * Returns the number of active adapters
- */
-
-int DivasGetNum(void)
-{
-	return(DivasCardNext);
-}
-
-/*
- * DivasGetList
- * Returns a list of active adapters
- */
-int DivasGetList(dia_card_list_t *card_list)
-{
-	int i;
-
-	memset(card_list, 0, sizeof(dia_card_list_t));
-
-	for(i = 0; i < DivasCardNext; i++)
-	{
-		card_list->card_type = DivasCards[i].cfg.card_type;
-		card_list->card_slot = DivasCards[i].cfg.slot;
-		card_list->state     = DivasCards[i].state;
-		card_list++;
-	}
-
-	return 0;
-
-}
-
-/*
- * control logging for specified card
- */
-
-void	DivasLog(dia_log_t *log)
-{
-	card_t *card;
-
-	card = get_card(log->card_id);
-	if (!card)
-	{
-		return;
-	}
-
-	card->log_types = log->log_types;
-
-	return;
-}
-
diff -Nru a/drivers/isdn/eicon/constant.h b/drivers/isdn/eicon/constant.h
--- a/drivers/isdn/eicon/constant.h	Tue Feb  3 19:45:43 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,161 +0,0 @@
-/*
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.0  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-/*------------------------------------------------------------------*/
-/* Q.931 information elements maximum length                        */
-/* excluding the identifier, including the length field             */
-/*------------------------------------------------------------------*/
-
-#define MAX_LEN_BC      13
-#define MAX_LEN_LLC     19 /* ctr3 */
-#define MAX_LEN_HLC     6  /* ctr3 */
-#define MAX_LEN_UUI     200 /* Hicom USBS req */
-#define MAX_LEN_NUM     24
-#define MAX_LEN_DSP     83 /* ctr3 */
-#define MAX_LEN_NI      4
-#define MAX_LEN_PI      5
-#define MAX_LEN_SIN     3
-#define MAX_LEN_CST     4
-#define MAX_LEN_SIG     2
-#define MAX_LEN_SPID    32
-#define MAX_LEN_EID     3
-#define MAX_LEN_CHI     35  /* ctr3 */
-#define MAX_LEN_CAU     33
-#define MAX_LEN_FTY     130
-#define MAX_LEN_KEY     83  /* ctr3 */
-#define MAX_LEN_RSI     4
-#define MAX_LEN_CAI     11
-#define MAX_NUM_SPID    4
-#define MAX_LEN_USERID  9
-#define MAX_LEN_APPLID  5
-#define MAX_LEN_NTTCIF  15
-
-/*------------------------------------------------------------------*/
-/* decision return values                                           */
-/*------------------------------------------------------------------*/
-
-#define YES             1
-#define NO              0
-
-
-/*-------------------------------------------------------------------*/
-/* w element coding                                                  */
-/*-------------------------------------------------------------------*/
-
-#define NTTCIF          0x01
-#define BC              0x04
-#define CAU             0x08
-#define CAD             0x0c
-#define CAI             0x10
-#define CST             0x14
-#define CHI             0x18
-#define LLI             0x19
-#define CHA             0x1a
-#define FTY             0x1c
-#define PI              0x1e
-#define NFAC            0x20
-#define TC              0x24
-#define ATT_EID         0x26
-#define NI              0x27
-#define DSP             0x28
-#define DT              0x29
-#define KEY             0x2c
-#define KP              0x2c
-#define UID             0x2d
-#define SIG             0x34
-#define FI              0x39
-#define SPID            0x3a
-#define EID             0x3b
-#define DSPF            0x3c
-#define ECAD            0x4c
-#define OAD             0x6c
-#define OSA             0x6d
-#define DAD             0x70
-#define CPN             0x70
-#define DSA             0x71
-#define RDX             0x73
-#define RAD             0x74
-#define RDN             0x74
-#define RSI             0x79
-#define SCR             0x7A   /* internal unscreened CPN          */
-#define MIE             0x7a   /* internal management info element */
-#define LLC             0x7c
-#define HLC             0x7d
-#define UUI             0x7e
-#define ESC             0x7f
-
-#define SHIFT           0x90
-#define MORE            0xa0
-#define CL              0xb0
-
-/* information elements used on the spid interface */
-#define SPID_CMD        0xc0
-#define SPID_LINK       0x10
-#define SPID_DN         0x70
-#define SPID_BC         0x04
-#define SPID_SWITCH     0x11
-
-/*------------------------------------------------------------------*/
-/* global configuration parameters, defined in exec.c               */
-/* these parameters are configured with program loading             */
-/*------------------------------------------------------------------*/
-
-#define PROT_1TR6       0
-#define PROT_ETSI       1
-#define PROT_FRANC      2
-#define PROT_BELG       3
-#define PROT_SWED       4
-#define PROT_NI         5
-#define PROT_5ESS       6
-#define PROT_JAPAN      7
-#define PROT_ATEL       8
-#define PROT_US         9
-#define PROT_ITALY      10
-#define PROT_TWAN       11
-#define PROT_AUSTRAL    12
-
-#define INIT_PROT_1TR6    0x80|PROT_1TR6
-#define INIT_PROT_ETSI    0x80|PROT_ETSI
-#define INIT_PROT_FRANC   0x80|PROT_FRANC
-#define INIT_PROT_BELG    0x80|PROT_BELG
-#define INIT_PROT_SWED    0x80|PROT_SWED
-#define INIT_PROT_NI      0x80|PROT_NI
-#define INIT_PROT_5ESS    0x80|PROT_5ESS
-#define INIT_PROT_JAPAN   0x80|PROT_JAPAN
-#define INIT_PROT_ATEL    0x80|PROT_ATEL
-#define INIT_PROT_ITALY   0x80|PROT_ITALY
-#define INIT_PROT_TWAN    0x80|PROT_TWAN
-#define INIT_PROT_AUSTRAL 0x80|PROT_AUSTRAL
-
-
-/* -----------------------------------------------------------**
-** The PROTOCOL_FEATURE_STRING in feature.h (included         **
-** in prstart.sx and astart.sx) defines capabilities and      **
-** features of the actual protocol code. It's used as a bit   **
-** mask.                                                      **
-** The following Bits are defined:                            **
-** -----------------------------------------------------------*/
-                                           
-#define PROTCAP_TELINDUS  0x0001  /* Telindus Variant of protocol code   */
-#define PROTCAP_MANIF     0x0002  /* Management interface implemented    */
-#define PROTCAP_V_42      0x0004  /* V42 implemented                     */
-#define PROTCAP_V90D      0x0008  /* V.90D (implies up to 384k DSP code) */
-#define PROTCAP_EXTD_FAX  0x0010  /* Extended FAX (ECM, 2D, T6, Polling) */
-#define PROTCAP_FREE4     0x0020  /* not used                            */
-#define PROTCAP_FREE5     0x0040  /* not used                            */
-#define PROTCAP_FREE6     0x0080  /* not used                            */
-#define PROTCAP_FREE7     0x0100  /* not used                            */
-#define PROTCAP_FREE8     0x0200  /* not used                            */
-#define PROTCAP_FREE9     0x0400  /* not used                            */
-#define PROTCAP_FREE10    0x0800  /* not used                            */
-#define PROTCAP_FREE11    0x1000  /* not used                            */
-#define PROTCAP_FREE12    0x2000  /* not used                            */
-#define PROTCAP_FREE13    0x4000  /* not used                            */
-#define PROTCAP_EXTENSION 0x8000  /* used for future extentions          */
diff -Nru a/drivers/isdn/eicon/divalog.h b/drivers/isdn/eicon/divalog.h
--- a/drivers/isdn/eicon/divalog.h	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,38 +0,0 @@
-/*
- * Include file for defining the kernel logger messages
- * These definitions are shared between the klog driver and the
- * klogd daemon process
- *
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.0  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#if !defined(_KLOGMSG_H)
-#define _KLOGMSG_H
-
-/* define a type for a log entry */
-
-#define KLOG_TEXT_MSG   	(0)
-#define KLOG_XLOG_MSG   	(1)
-#define KLOG_XTXT_MSG   	(2)
-#define KLOG_IDI_REQ   		(4)
-#define KLOG_IDI_CALLBACK   (5)
-#define KLOG_CAPI_MSG   	(6)
-
-typedef struct
-{
-    unsigned long   time_stamp; /* in ms since last system boot */
-    int    			card;       /* card number (-1 for all) */
-    unsigned int    type;       /* type of log message (0 is text) */
-    unsigned int    length;     /* message length (non-text messages only) */
-    unsigned short  code;       /* message code (non-text messages only) */
-    char            buffer[110];/* text/data to log */
-} klog_t;
-
-void    DivasLogAdd(void *buffer, int length);
-#endif /* of _KLOGMSG_H */
diff -Nru a/drivers/isdn/eicon/divas.h b/drivers/isdn/eicon/divas.h
--- a/drivers/isdn/eicon/divas.h	Tue Feb  3 19:45:41 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,214 +0,0 @@
-/*
- * External Diva Server driver include file
- *
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.5  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#if !defined(DIVAS_H)
-#define DIVAS_H
-
-#include "sys.h"
-
-
-/* IOCTL commands */
-
-#define	DIA_IOCTL_INIT				(0)
-#define	DIA_IOCTL_LOAD				(1)
-#define	DIA_IOCTL_CONFIG			(2)
-#define	DIA_IOCTL_START				(3)
-#define	DIA_IOCTL_GET_NUM			(4)
-#define	DIA_IOCTL_GET_LIST			(5)
-#define	DIA_IOCTL_LOG				(6)
-#define	DIA_IOCTL_DETECT			(7)
-#define	DIA_IOCTL_SPACE				(8)
-#define DIA_IOCTL_GET_MEM           (9)
-#define DIA_IOCTL_FLAVOUR			(10)
-#define	DIA_IOCTL_XLOG_REQ			(11)
-
-/* Error codes */
-
-#define XLOG_ERR_CARD_NUM	(13)
-#define XLOG_ERR_DONE		(14)
-#define XLOG_ERR_CMD		(15)
-#define XLOG_ERR_TIMEOUT	(16)
-#define XLOG_ERR_CARD_STATE	(17)
-#define XLOG_ERR_UNKNOWN	(18)
-#define XLOG_OK 			(0)
-
-/* Adapter states */
-
-#define DIA_UNKNOWN		(0)
-#define DIA_RESET		(1)
-#define DIA_LOADED		(2)
-#define DIA_CONFIGURED	(3)
-#define DIA_RUNNING		(4)
-
-/* Stucture for getting card specific information from active cad driver */
-
-typedef struct
-{
-	int card_type;
-	int card_slot;
-	int	state;
-} dia_card_list_t;
-
-/* use following to select which logging to have active */
-
-#define	DIVAS_LOG_DEBUG		(1 << 0)
-#define	DIVAS_LOG_XLOG		(1 << 1)
-#define	DIVAS_LOG_IDI		(1 << 2)
-#define	DIVAS_LOG_CAPI		(1 << 3)
-
-/* stucture for DIA_IOCTL_LOG to get information from adapter */
-
-typedef struct
-{
-	int		card_id;
-	int		log_types;	/* bit mask of log types: use DIVAS_LOG_XXX */
-} dia_log_t;
-
-/* list of cards supported by this driver */
-
-#define	DIA_CARD_TYPE_DIVA_SERVER	(0)	/* Diva Server PRI */
-#define	DIA_CARD_TYPE_DIVA_SERVER_B	(1)	/* Diva Server BRI */
-#define	DIA_CARD_TYPE_DIVA_SERVER_Q	(2)	/* Diva Server 4-BRI */
-
-/* bus types */
-
-#define	DIA_BUS_TYPE_ISA		(0)
-#define	DIA_BUS_TYPE_ISA_PNP	(1)
-#define	DIA_BUS_TYPE_PCI		(2)
-#define	DIA_BUS_TYPE_MCA		(3)
-
-/* types of memory used (index for memory array below) */
-
-#define DIVAS_RAM_MEMORY 	0
-#define DIVAS_REG_MEMORY 	1
-#define DIVAS_CFG_MEMORY 	2
-#define DIVAS_SHARED_MEMORY 3
-#define DIVAS_CTL_MEMORY	4
-/*
- * card config information
- * passed as parameter to DIA_IOCTL_INIT ioctl to initialise new card
- */
-
-typedef struct
-{
-	int		card_id;	/* unique id assigned to this card */
-	int		card_type;	/* use DIA_CARD_TYPE_xxx above */
-	int		bus_type;	/* use DIA_BUS_TYPE_xxx above */
-	struct pci_dev *pdev;
-	int		slot;		/* slot number in bus */
-	unsigned char	irq;		/* IRQ number */
-    int     reset_base; /* Reset register  for I/O mapped cards */
-	int		io_base;	/* I/O base for I/O mapped cards */
-	void	*memory[5];	/* memory base addresses for memory mapped cards */
-	char	name[9];	/* name of adapter */
-	int		serial;		/* serial number */
-	unsigned char	int_priority;	/* Interrupt priority */
-} dia_card_t;
-
-/*
- * protocol configuration information
- * passed as parameter to DIA_IOCTL_CONFIG ioctl to configure card
- */
-
-typedef struct
-{
-	int				card_id;			/* to identify particular card */
-	unsigned char	tei;
-	unsigned char	nt2;
-	unsigned char	watchdog;
-	unsigned char	permanent;
-	unsigned char	x_interface;
-	unsigned char	stable_l2;
-	unsigned char	no_order_check;
-	unsigned char	handset_type;
-	unsigned char	sig_flags;
-	unsigned char	low_channel;
-	unsigned char	prot_version;
-	unsigned char	crc4;
-	struct
-	{
-		unsigned char oad[32];
-		unsigned char osa[32];
-		unsigned char spid[32];
-	}terminal[2];
-} dia_config_t;
-
-/*
- * code configuration 
- * passed as parameter to DIA_IOCTL_LOAD ioctl
- * one of these ioctl per code file to load
- */
-
-typedef struct
-{
-	int				card_id;	/* card to load */
-	enum
-	{
-		DIA_CPU_CODE,			/* CPU code */
-		DIA_DSP_CODE,			/* DSP code */
-		DIA_CONT_CODE,			/* continuation of code */
-		DIA_TABLE_CODE,			/* code table */
-	        DIA_DLOAD_CNT,           /* number of downloads*/
-		DIA_FPGA_CODE
-	}				code_type;	/* code for CPU or DSP ? */
-	int				length;		/* length of code */
-	unsigned char	*code;		/* pointer (in user-space) to code */
-} dia_load_t;
-
-/*
- * start configuration 
- * passed as parameter to DIA_IOCTL_START ioctl
- */
-
-typedef struct
-{
-	int				card_id;	/* card to start */
-} dia_start_t;
-
-/* used for retrieving memory from the card */
-
-typedef struct {
-	word	card_id;
-	dword 	addr;
-	byte	data[16 * 8];
-} mem_block_t;
-
-/* DIVA Server specific addresses */
-
-#define DIVAS_CPU_START_ADDR    (0x0)
-#define	ORG_MAX_PROTOCOL_CODE_SIZE	0x000A0000
-#define	ORG_MAX_DSP_CODE_SIZE		(0x000F0000 - ORG_MAX_PROTOCOL_CODE_SIZE)
-#define	ORG_DSP_CODE_BASE		(0xBF7F0000 - ORG_MAX_DSP_CODE_SIZE)
-#define DIVAS_DSP_START_ADDR    (0xBF7A0000)
-#define DIVAS_SHARED_OFFSET     (0x1000)
-#define MP_DSP_CODE_BASE           0xa03a0000
-#define MQ_PROTCODE_OFFSET  0x100000
-#define MQ_SM_OFFSET		0X0f0000
-
-#define	V90D_MAX_PROTOCOL_CODE_SIZE	0x00090000
-#define V90D_MAX_DSP_CODE_SIZE		(0x000F0000 - V90D_MAX_PROTOCOL_CODE_SIZE)
-#define	V90D_DSP_CODE_BASE		(0xBF7F0000 - V90D_MAX_DSP_CODE_SIZE)
-
-#define MQ_ORG_MAX_PROTOCOL_CODE_SIZE   0x000a0000  /* max 640K Protocol-Code */
-#define MQ_ORG_MAX_DSP_CODE_SIZE        0x00050000  /* max 320K DSP-Code */
-#define MQ_ORG_DSP_CODE_BASE           (MQ_MAX_DSP_DOWNLOAD_ADDR \
-                                      - MQ_ORG_MAX_DSP_CODE_SIZE)
-#define MQ_V90D_MAX_PROTOCOL_CODE_SIZE  0x00090000  /* max 576K Protocol-Code */
-#define MQ_V90D_MAX_DSP_CODE_SIZE       0x00060000  /* max 384K DSP-Code if V.90D included */
-#define	MQ_MAX_DSP_DOWNLOAD_ADDR        0xa03f0000
-#define MQ_V90D_DSP_CODE_BASE          (MQ_MAX_DSP_DOWNLOAD_ADDR \
-                                      - MQ_V90D_MAX_DSP_CODE_SIZE)
-
-
-#define ALIGNMENT_MASK_MAESTRA        0xfffffffc
-
-#endif /* DIVAS_H */
diff -Nru a/drivers/isdn/eicon/dsp_defs.h b/drivers/isdn/eicon/dsp_defs.h
--- a/drivers/isdn/eicon/dsp_defs.h	Tue Feb  3 19:45:34 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,286 +0,0 @@
-/*
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.0  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#ifndef DSP_DEFS_H_
-#define DSP_DEFS_H_
-
-#ifndef DSPDIDS_H_
-#include "dspdids.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*---------------------------------------------------------------------------*/
-
-#ifndef NULL
-#define NULL 0
-#endif
-#ifndef TRUE
-#define TRUE (0 == 0)
-#endif
-#ifndef FALSE
-#define FALSE (0 != 0)
-#endif
-
-
-/*---------------------------------------------------------------------------*/
-
-#define DSP_MEMORY_TYPE_EXTERNAL_DM         0
-#define DSP_MEMORY_TYPE_EXTERNAL_PM         1
-#define DSP_MEMORY_TYPE_INTERNAL_DM         2
-#define DSP_MEMORY_TYPE_INTERNAL_PM         3
-
-#define DSP_DOWNLOAD_FLAG_BOOTABLE          0x0001
-#define DSP_DOWNLOAD_FLAG_2181              0x0002
-#define DSP_DOWNLOAD_FLAG_TIMECRITICAL      0x0004
-#define DSP_DOWNLOAD_FLAG_COMPAND           0x0008
-
-#define DSP_MEMORY_BLOCK_COUNT              16
-
-#define DSP_SEGMENT_PM_FLAG                 0x0001
-#define DSP_SEGMENT_SHARED_FLAG             0x0002
-
-#define DSP_SEGMENT_EXTERNAL_DM             DSP_MEMORY_TYPE_EXTERNAL_DM
-#define DSP_SEGMENT_EXTERNAL_PM             DSP_MEMORY_TYPE_EXTERNAL_PM
-#define DSP_SEGMENT_INTERNAL_DM             DSP_MEMORY_TYPE_INTERNAL_DM
-#define DSP_SEGMENT_INTERNAL_PM             DSP_MEMORY_TYPE_INTERNAL_PM
-#define DSP_SEGMENT_FIRST_RELOCATABLE       4
-
-#define DSP_DATA_BLOCK_PM_FLAG              0x0001
-#define DSP_DATA_BLOCK_DWORD_FLAG           0x0002
-#define DSP_DATA_BLOCK_RESOLVE_FLAG         0x0004
-
-#define DSP_RELOC_NONE                      0x00
-#define DSP_RELOC_SEGMENT_MASK              0x3f
-#define DSP_RELOC_TYPE_MASK                 0xc0
-#define DSP_RELOC_TYPE_0                    0x00  /* relocation of address in DM word / high part of PM word */
-#define DSP_RELOC_TYPE_1                    0x40  /* relocation of address in low part of PM data word */
-#define DSP_RELOC_TYPE_2                    0x80  /* relocation of address in standard command */
-#define DSP_RELOC_TYPE_3                    0xc0  /* relocation of address in call/jump on flag in */
-
-#define DSP_COMBIFILE_FORMAT_IDENTIFICATION_SIZE 48
-#define DSP_COMBIFILE_FORMAT_VERSION_BCD    0x0100
-
-#define DSP_FILE_FORMAT_IDENTIFICATION_SIZE 48
-#define DSP_FILE_FORMAT_VERSION_BCD         0x0100
-
-
-typedef struct tag_dsp_combifile_header
-{
-  char                  format_identification[DSP_COMBIFILE_FORMAT_IDENTIFICATION_SIZE];
-  word                  format_version_bcd;
-  word                  header_size;
-  word                  combifile_description_size;
-  word                  directory_entries;
-  word                  directory_size;
-  word                  download_count;
-  word                  usage_mask_size;
-} t_dsp_combifile_header;
-
-typedef struct tag_dsp_combifile_directory_entry
-{
-  word                  card_type_number;
-  word                  file_set_number;
-} t_dsp_combifile_directory_entry;
-
-typedef struct tag_dsp_file_header
-{
-  char                  format_identification[DSP_FILE_FORMAT_IDENTIFICATION_SIZE];
-  word                  format_version_bcd;
-  word                  download_id;
-  word                  download_flags;
-  word                  required_processing_power;
-  word                  interface_channel_count;
-  word                  header_size;
-  word                  download_description_size;
-  word                  memory_block_table_size;
-  word                  memory_block_count;
-  word                  segment_table_size;
-  word                  segment_count;
-  word                  symbol_table_size;
-  word                  symbol_count;
-  word                  total_data_size_dm;
-  word                  data_block_count_dm;
-  word                  total_data_size_pm;
-  word                  data_block_count_pm;
-} t_dsp_file_header;
-
-typedef struct tag_dsp_memory_block_desc
-{
-  word                  alias_memory_block;
-  word                  memory_type;
-  word                  address;
-  word                  size;             /* DSP words */
-} t_dsp_memory_block_desc;
-
-typedef struct tag_dsp_segment_desc
-{
-  word                  memory_block;
-  word                  attributes;
-  word                  base;
-  word                  size;
-  word                  alignment;        /* ==0 -> no other legal start address than base */
-} t_dsp_segment_desc;
-
-typedef struct tag_dsp_symbol_desc
-{
-  word                  symbol_id;
-  word                  segment;
-  word                  offset;
-  word                  size;             /* DSP words */
-} t_dsp_symbol_desc;
-
-typedef struct tag_dsp_data_block_header
-{
-  word                  attributes;
-  word                  segment;
-  word                  offset;
-  word                  size;             /* DSP words */
-} t_dsp_data_block_header;
-
-typedef struct tag_dsp_download_desc      /* be sure to keep native alignment for MAESTRA's */
-{
-  word                  download_id;
-  word                  download_flags;
-  word                  required_processing_power;
-  word                  interface_channel_count;
-  word                  excess_header_size;
-  word                  memory_block_count;
-  word                  segment_count;
-  word                  symbol_count;
-  word                  data_block_count_dm;
-  word                  data_block_count_pm;
-  byte              	*p_excess_header_data;
-  char 					*p_download_description;
-  t_dsp_memory_block_desc *p_memory_block_table;
-  t_dsp_segment_desc 	*p_segment_table;
-  t_dsp_symbol_desc 	*p_symbol_table;
-  word 					*p_data_blocks_dm;
-  word 					*p_data_blocks_pm;
-} t_dsp_download_desc;
-
-#define DSP_DOWNLOAD_INDEX_KERNEL               0
-#define DSP30TX_DOWNLOAD_INDEX_KERNEL           1
-#define DSP30RX_DOWNLOAD_INDEX_KERNEL           2
-#define DSP_MAX_DOWNLOAD_COUNT                  35
-
-
-#define DSP_DOWNLOAD_MAX_SEGMENTS         16
-
-#define DSP_UDATA_REQUEST_RECONFIGURE     0
-/*
-parameters:
-  <word> reconfigure delay (in 8kHz samples)
-  <word> reconfigure code
-  <byte> reconfigure hdlc preamble flags
-*/
-
-#define DSP_RECONFIGURE_TX_FLAG           0x8000
-#define DSP_RECONFIGURE_SHORT_TRAIN_FLAG  0x4000
-#define DSP_RECONFIGURE_ECHO_PROTECT_FLAG 0x2000
-#define DSP_RECONFIGURE_HDLC_FLAG         0x1000
-#define DSP_RECONFIGURE_SYNC_FLAG         0x0800
-#define DSP_RECONFIGURE_PROTOCOL_MASK     0x00ff
-#define DSP_RECONFIGURE_IDLE              0
-#define DSP_RECONFIGURE_V25               1
-#define DSP_RECONFIGURE_V21_CH2           2
-#define DSP_RECONFIGURE_V27_2400          3
-#define DSP_RECONFIGURE_V27_4800          4
-#define DSP_RECONFIGURE_V29_7200          5
-#define DSP_RECONFIGURE_V29_9600          6
-#define DSP_RECONFIGURE_V33_12000         7
-#define DSP_RECONFIGURE_V33_14400         8
-#define DSP_RECONFIGURE_V17_7200          9
-#define DSP_RECONFIGURE_V17_9600          10
-#define DSP_RECONFIGURE_V17_12000         11
-#define DSP_RECONFIGURE_V17_14400         12
-
-/*
-data indications if transparent framer
-  <byte> data 0
-  <byte> data 1
-  ...
-
-data indications if HDLC framer
-  <byte> data 0
-  <byte> data 1
-  ...
-  <byte> CRC 0
-  <byte> CRC 1
-  <byte> preamble flags
-*/
-
-#define DSP_UDATA_INDICATION_SYNC         0
-/*
-returns:
-  <word> time of sync (sampled from counter at 8kHz)
-*/
-
-#define DSP_UDATA_INDICATION_DCD_OFF      1
-/*
-returns:
-  <word> time of DCD off (sampled from counter at 8kHz)
-*/
-
-#define DSP_UDATA_INDICATION_DCD_ON       2
-/*
-returns:
-  <word> time of DCD on (sampled from counter at 8kHz)
-  <byte> connected norm
-  <word> connected options
-  <dword> connected speed (bit/s)
-*/
-
-#define DSP_UDATA_INDICATION_CTS_OFF      3
-/*
-returns:
-  <word> time of CTS off (sampled from counter at 8kHz)
-*/
-
-#define DSP_UDATA_INDICATION_CTS_ON       4
-/*
-returns:
-  <word> time of CTS on (sampled from counter at 8kHz)
-  <byte> connected norm
-  <word> connected options
-  <dword> connected speed (bit/s)
-*/
-
-#define DSP_CONNECTED_NORM_UNSPECIFIED      0
-#define DSP_CONNECTED_NORM_V21              1
-#define DSP_CONNECTED_NORM_V23              2
-#define DSP_CONNECTED_NORM_V22              3
-#define DSP_CONNECTED_NORM_V22_BIS          4
-#define DSP_CONNECTED_NORM_V32_BIS          5
-#define DSP_CONNECTED_NORM_V34              6
-#define DSP_CONNECTED_NORM_V8               7
-#define DSP_CONNECTED_NORM_BELL_212A        8
-#define DSP_CONNECTED_NORM_BELL_103         9
-#define DSP_CONNECTED_NORM_V29_LEASED_LINE  10
-#define DSP_CONNECTED_NORM_V33_LEASED_LINE  11
-#define DSP_CONNECTED_NORM_TFAST            12
-#define DSP_CONNECTED_NORM_V21_CH2          13
-#define DSP_CONNECTED_NORM_V27_TER          14
-#define DSP_CONNECTED_NORM_V29              15
-#define DSP_CONNECTED_NORM_V33              16
-#define DSP_CONNECTED_NORM_V17              17
-
-#define DSP_CONNECTED_OPTION_TRELLIS        0x0001
-
-
-/*---------------------------------------------------------------------------*/
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-/*---------------------------------------------------------------------------*/
diff -Nru a/drivers/isdn/eicon/dspdids.h b/drivers/isdn/eicon/dspdids.h
--- a/drivers/isdn/eicon/dspdids.h	Tue Feb  3 19:45:18 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.0  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#ifndef DSPDIDS_H_
-#define DSPDIDS_H_
-
-
-/*---------------------------------------------------------------------------*/
-
-#define DSP_DID_INVALID			0
-#define DSP_DID_DIVA			1
-#define DSP_DID_DIVA_PRO		2
-#define DSP_DID_DIVA_PRO_20		3
-#define DSP_DID_DIVA_PRO_PCCARD		4
-#define DSP_DID_DIVA_SERVER_BRI_1M	5
-#define DSP_DID_DIVA_SERVER_BRI_2M	6
-#define DSP_DID_DIVA_SERVER_PRI_2M_TX	7
-#define DSP_DID_DIVA_SERVER_PRI_2M_RX	8
-#define DSP_DID_DIVA_SERVER_PRI_30M	9
-#define DSP_DID_TASK_HSCX		100
-#define DSP_DID_TASK_HSCX_PRI_2M_TX	101
-#define DSP_DID_TASK_HSCX_PRI_2M_RX	102
-#define DSP_DID_TASK_V110KRNL		200
-#define DSP_DID_OVERLAY_V1100		201
-#define DSP_DID_OVERLAY_V1101		202
-#define DSP_DID_OVERLAY_V1102		203
-#define DSP_DID_OVERLAY_V1103		204
-#define DSP_DID_OVERLAY_V1104		205
-#define DSP_DID_OVERLAY_V1105		206
-#define DSP_DID_OVERLAY_V1106		207
-#define DSP_DID_OVERLAY_V1107		208
-#define DSP_DID_OVERLAY_V1108		209
-#define DSP_DID_OVERLAY_V1109		210
-#define DSP_DID_TASK_V110_PRI_2M_TX	220
-#define DSP_DID_TASK_V110_PRI_2M_RX	221
-#define DSP_DID_TASK_MODEM		300
-#define DSP_DID_TASK_FAX05		400
-#define DSP_DID_TASK_VOICE		500
-#define DSP_DID_TASK_TIKRNL81		600
-#define DSP_DID_OVERLAY_DIAL		601
-#define DSP_DID_OVERLAY_V22		602
-#define DSP_DID_OVERLAY_V32		603
-#define DSP_DID_OVERLAY_FSK		604
-#define DSP_DID_OVERLAY_FAX		605
-#define DSP_DID_OVERLAY_VXX		606
-#define DSP_DID_OVERLAY_V8		607
-#define DSP_DID_OVERLAY_INFO		608
-#define DSP_DID_OVERLAY_V34		609
-#define DSP_DID_OVERLAY_DFX		610
-#define DSP_DID_PARTIAL_OVERLAY_DIAL	611
-#define DSP_DID_PARTIAL_OVERLAY_FSK	612
-#define DSP_DID_PARTIAL_OVERLAY_FAX	613
-#define DSP_DID_TASK_TIKRNL05		700
-
-
-/*---------------------------------------------------------------------------*/
-
-#endif
-
-/*---------------------------------------------------------------------------*/
diff -Nru a/drivers/isdn/eicon/eicon.h b/drivers/isdn/eicon/eicon.h
--- a/drivers/isdn/eicon/eicon.h	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,386 +0,0 @@
-/* $Id: eicon.h,v 1.1.4.1.2.3 2002/10/01 11:29:13 armin Exp $
- *
- * ISDN low-level module for Eicon active ISDN-Cards.
- *
- * Copyright 1998       by Fritz Elfert (fritz@isdn4linux.de)
- * Copyright 1998-2000  by Armin Schindler (mac@melware.de) 
- * Copyright 1999,2000  Cytronics & Melware (info@melware.de)
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#ifndef eicon_h
-#define eicon_h
-
-#include <linux/interrupt.h>
-
-#define EICON_IOCTL_SETMMIO   0
-#define EICON_IOCTL_GETMMIO   1
-#define EICON_IOCTL_SETIRQ    2
-#define EICON_IOCTL_GETIRQ    3
-#define EICON_IOCTL_LOADBOOT  4
-#define EICON_IOCTL_ADDCARD   5
-#define EICON_IOCTL_GETTYPE   6
-#define EICON_IOCTL_LOADPCI   7 
-#define EICON_IOCTL_LOADISA   8 
-#define EICON_IOCTL_GETVER    9 
-#define EICON_IOCTL_GETXLOG  10 
-
-#define EICON_IOCTL_MANIF    90 
-
-#define EICON_IOCTL_FREEIT   97
-#define EICON_IOCTL_TEST     98
-#define EICON_IOCTL_DEBUGVAR 99
-
-#define EICON_IOCTL_DIA_OFFSET	100
-
-/* Bus types */
-#define EICON_BUS_ISA          1
-#define EICON_BUS_MCA          2
-#define EICON_BUS_PCI          3
-
-/* Constants for describing Card-Type */
-#define EICON_CTYPE_S            0
-#define EICON_CTYPE_SX           1
-#define EICON_CTYPE_SCOM         2
-#define EICON_CTYPE_QUADRO       3
-#define EICON_CTYPE_S2M          4
-#define EICON_CTYPE_MAESTRA      5
-#define EICON_CTYPE_MAESTRAQ     6
-#define EICON_CTYPE_MAESTRAQ_U   7
-#define EICON_CTYPE_MAESTRAP     8
-#define EICON_CTYPE_ISABRI       0x10
-#define EICON_CTYPE_ISAPRI       0x20
-#define EICON_CTYPE_MASK         0x0f
-#define EICON_CTYPE_QUADRO_NR(n) (n<<4)
-
-#define MAX_HEADER_LEN 10
-
-#define MAX_STATUS_BUFFER	150
-
-/* Struct for adding new cards */
-typedef struct eicon_cdef {
-        int membase;
-        int irq;
-        char id[10];
-} eicon_cdef;
-
-#define EICON_ISA_BOOT_MEMCHK 1
-#define EICON_ISA_BOOT_NORMAL 2
-
-/* Struct for downloading protocol via ioctl for ISA cards */
-/* same struct for downloading protocol via ioctl for MCA cards */
-typedef struct {
-	/* start-up parameters */
-	unsigned char tei;
-	unsigned char nt2;
-	unsigned char skip1;
-	unsigned char WatchDog;
-	unsigned char Permanent;
-	unsigned char XInterface;
-	unsigned char StableL2;
-	unsigned char NoOrderCheck;
-	unsigned char HandsetType;
-	unsigned char skip2;
-	unsigned char LowChannel;
-	unsigned char ProtVersion;
-	unsigned char Crc4;
-	unsigned char Loopback;
-	unsigned char oad[32];
-	unsigned char osa[32];
-	unsigned char spid[32];
-	unsigned char boot_opt;
-	unsigned long bootstrap_len;
-	unsigned long firmware_len;
-	unsigned char code[1]; /* Rest (bootstrap- and firmware code) will be allocated */
-} eicon_isa_codebuf;
-
-/* Data for downloading protocol via ioctl */
-typedef union {
-	eicon_isa_codebuf isa;
-	eicon_isa_codebuf mca;
-} eicon_codebuf;
-
-/* Data for Management interface */
-typedef struct {
-	int count;
-	int pos;
-	int length[50];
-	unsigned char data[700]; 
-} eicon_manifbuf;
-
-#define TRACE_OK                 (1)
-
-#ifdef __KERNEL__
-
-/* Kernel includes */
-#include <linux/config.h>
-#include <linux/sched.h>
-#include <linux/string.h>
-#include <linux/workqueue.h>
-#include <linux/interrupt.h>
-#include <linux/skbuff.h>
-#include <linux/errno.h>
-#include <linux/fs.h>
-#include <linux/major.h>
-#include <asm/io.h>
-#include <linux/kernel.h>
-#include <linux/signal.h>
-#include <linux/slab.h>
-#include <linux/mm.h>
-#include <linux/mman.h>
-#include <linux/ioport.h>
-#include <linux/timer.h>
-#include <linux/wait.h>
-#include <linux/delay.h>
-#include <linux/ctype.h>
-#include <linux/pci.h>
-
-#include <linux/isdn.h>
-#include <linux/isdnif.h>
-
-
-typedef struct {
-  __u16 length __attribute__ ((packed)); /* length of data/parameter field */
-  __u8  P[1];                          /* data/parameter field */
-} eicon_PBUFFER;
-
-#include "eicon_isa.h"
-
-#include "idi.h"
-
-typedef struct {
-  __u16 NextReq  __attribute__ ((packed));  /* pointer to next Req Buffer */
-  __u16 NextRc   __attribute__ ((packed));  /* pointer to next Rc Buffer  */
-  __u16 NextInd  __attribute__ ((packed));  /* pointer to next Ind Buffer */
-  __u8 ReqInput  __attribute__ ((packed));  /* number of Req Buffers sent */
-  __u8 ReqOutput  __attribute__ ((packed)); /* number of Req Buffers returned */
-  __u8 ReqReserved  __attribute__ ((packed));/*number of Req Buffers reserved */
-  __u8 Int  __attribute__ ((packed));       /* ISDN-P interrupt           */
-  __u8 XLock  __attribute__ ((packed));     /* Lock field for arbitration */
-  __u8 RcOutput  __attribute__ ((packed));  /* number of Rc buffers received */
-  __u8 IndOutput  __attribute__ ((packed)); /* number of Ind buffers received */
-  __u8 IMask  __attribute__ ((packed));     /* Interrupt Mask Flag        */
-  __u8 Reserved1[2]  __attribute__ ((packed)); /* reserved field, do not use */
-  __u8 ReadyInt  __attribute__ ((packed));  /* request field for ready int */
-  __u8 Reserved2[12]  __attribute__ ((packed)); /* reserved field, do not use */
-  __u8 InterfaceType  __attribute__ ((packed)); /* interface type 1=16K    */
-  __u16 Signature  __attribute__ ((packed));    /* ISDN-P initialized ind  */
-  __u8 B[1];                            /* buffer space for Req,Ind and Rc */
-} eicon_pr_ram;
-
-/* Macro for delay via schedule() */
-#define SLEEP(j) {                     \
-  set_current_state(TASK_UNINTERRUPTIBLE); \
-  schedule_timeout(j);                 \
-}
-
-typedef struct {
-  __u8                  Req;            /* pending request          */
-  __u8                  Rc;             /* return code received     */
-  __u8                  Ind;            /* indication received      */
-  __u8                  ReqCh;          /* channel of current Req   */
-  __u8                  RcCh;           /* channel of current Rc    */
-  __u8                  IndCh;          /* channel of current Ind   */
-  __u8                  D3Id;           /* ID used by this entity   */
-  __u8                  B2Id;           /* ID used by this entity   */
-  __u8                  GlobalId;       /* reserved field           */
-  __u8                  XNum;           /* number of X-buffers      */
-  __u8                  RNum;           /* number of R-buffers      */
-  struct sk_buff_head   X;              /* X-buffer queue           */
-  struct sk_buff_head   R;              /* R-buffer queue           */
-  __u8                  RNR;            /* receive not ready flag   */
-  __u8                  complete;       /* receive complete status  */
-  __u8                  busy;           /* busy flag                */
-  __u16                 ref;            /* saved reference          */
-} entity;
-
-#define FAX_MAX_SCANLINE 256
-
-typedef struct {
-	__u8		PrevObject;
-	__u8		NextObject;
-	__u8		abLine[FAX_MAX_SCANLINE];
-	__u8		abFrame[FAX_MAX_SCANLINE];
-	unsigned int	LineLen;
-	unsigned int	LineDataLen;
-	__u32		LineData;
-	unsigned int	NullBytesPos;
-	__u8		NullByteExist;
-	int		PageCount;
-	__u8		Dle;
-	__u8		Eop;
-} eicon_ch_fax_buf;
-
-typedef struct {
-	int	       No;		 /* Channel Number	        */
-	unsigned short fsm_state;        /* Current D-Channel state     */
-	unsigned short statectrl;	 /* State controling bits	*/
-	unsigned short eazmask;          /* EAZ-Mask for this Channel   */
-	int		queued;          /* User-Data Bytes in TX queue */
-	int		pqueued;         /* User-Data Packets in TX queue */
-	int		waitq;           /* User-Data Bytes in wait queue */
-	int		waitpq;          /* User-Data Bytes in packet queue */
-	struct sk_buff *tskb1;           /* temp skb 1			*/
-	struct sk_buff *tskb2;           /* temp skb 2			*/
-	unsigned char  l2prot;           /* Layer 2 protocol            */
-	unsigned char  l3prot;           /* Layer 3 protocol            */
-#ifdef CONFIG_ISDN_TTY_FAX
-	T30_s		*fax;		 /* pointer to fax data in LL	*/
-	eicon_ch_fax_buf fax2;		 /* fax related struct		*/
-#endif
-	entity		e;		 /* Native Entity		*/
-	ENTITY		de;		 /* Divas D Entity 		*/
-	ENTITY		be;		 /* Divas B Entity 		*/
-	char		cpn[32];	 /* remember cpn		*/
-	char		oad[32];	 /* remember oad		*/
-	char		dsa[32];	 /* remember dsa		*/
-	char		osa[32];	 /* remember osa		*/
-	unsigned char   cause[2];	 /* Last Cause			*/
-	unsigned char	si1;
-	unsigned char	si2;
-	unsigned char	plan;
-	unsigned char	screen;
-} eicon_chan;
-
-typedef struct {
-	eicon_chan *ptr;
-} eicon_chan_ptr;
-
-#include "eicon_pci.h"
-
-#define EICON_FLAGS_RUNNING  1 /* Cards driver activated */
-#define EICON_FLAGS_PVALID   2 /* Cards port is valid    */
-#define EICON_FLAGS_IVALID   4 /* Cards irq is valid     */
-#define EICON_FLAGS_MVALID   8 /* Cards membase is valid */
-#define EICON_FLAGS_LOADED   8 /* Firmware loaded        */
-
-/* D-Channel states */
-#define EICON_STATE_NULL     0
-#define EICON_STATE_ICALL    1
-#define EICON_STATE_OCALL    2
-#define EICON_STATE_IWAIT    3
-#define EICON_STATE_OWAIT    4
-#define EICON_STATE_IBWAIT   5
-#define EICON_STATE_OBWAIT   6
-#define EICON_STATE_BWAIT    7
-#define EICON_STATE_BHWAIT   8
-#define EICON_STATE_BHWAIT2  9
-#define EICON_STATE_DHWAIT  10
-#define EICON_STATE_DHWAIT2 11
-#define EICON_STATE_BSETUP  12
-#define EICON_STATE_ACTIVE  13
-#define EICON_STATE_ICALLW  14
-#define EICON_STATE_LISTEN  15
-#define EICON_STATE_WMCONN  16
-
-#define EICON_MAX_QUEUE  2138
-
-typedef union {
-	eicon_isa_card isa;
-	eicon_pci_card pci;
-	eicon_isa_card mca;
-} eicon_hwif;
-
-typedef struct {
-	__u8 ret;
-	__u8 id;
-	__u8 ch;
-} eicon_ack;
-
-typedef struct {
-	__u8 code;
-	__u8 id;
-	__u8 ch;
-} eicon_req;
-
-typedef struct {
-	__u8 ret;
-	__u8 id;
-	__u8 ch;
-	__u8 more;
-} eicon_indhdr;
-
-/*
- * Per card driver data
- */
-typedef struct eicon_card {
-	eicon_hwif hwif;                 /* Hardware dependent interface     */
-	DESCRIPTOR *d;			 /* IDI Descriptor		     */
-        u_char ptype;                    /* Protocol type (1TR6 or Euro)     */
-        u_char bus;                      /* Bustype (ISA, MCA, PCI)          */
-        u_char type;                     /* Cardtype (EICON_CTYPE_...)       */
-	struct eicon_card *qnext;  	 /* Pointer to next quadro adapter   */
-        int Feature;                     /* Protocol Feature Value           */
-        struct eicon_card *next;	 /* Pointer to next device struct    */
-        int myid;                        /* Driver-Nr. assigned by linklevel */
-        unsigned long flags;             /* Statusflags                      */
-	struct sk_buff_head rcvq;        /* Receive-Message queue            */
-	struct sk_buff_head sndq;        /* Send-Message queue               */
-	struct sk_buff_head rackq;       /* Req-Ack-Message queue            */
-	struct sk_buff_head sackq;       /* Data-Ack-Message queue           */
-	struct sk_buff_head statq;       /* Status-Message queue             */
-	int statq_entries;
-	struct tasklet_struct snd_tq;    /* Task struct for xmit bh          */
-	struct tasklet_struct rcv_tq;    /* Task struct for rcv bh           */
-	struct tasklet_struct ack_tq;    /* Task struct for ack bh           */
-	eicon_chan*	IdTable[256];	 /* Table to find entity   */
-	__u16  ref_in;
-	__u16  ref_out;
-	int    nchannels;                /* Number of B-Channels             */
-	int    ReadyInt;		 /* Ready Interrupt		     */
-	eicon_chan *bch;                 /* B-Channel status/control         */
-	DBUFFER *dbuf;			 /* Dbuffer for Diva Server	     */
-	BUFFERS *sbuf;			 /* Buffer for Diva Server	     */
-	char *sbufp;			 /* Data Buffer for Diva Server	     */
-        isdn_if interface;               /* Interface to upper layer         */
-        char regname[35];                /* Drivers card name 		     */
-#ifdef CONFIG_MCA
-        int	mca_slot;	 	 /* # of cards MCA slot              */
-	int	mca_io;			 /* MCA cards IO port		     */
-#endif /* CONFIG_MCA */
-} eicon_card;
-
-#include "eicon_idi.h"
-
-extern eicon_card *cards;
-extern char *eicon_ctype_name[];
-
-
-extern __inline__ void eicon_schedule_tx(eicon_card *card)
-{
-	tasklet_schedule(&card->snd_tq);
-}
-
-extern __inline__ void eicon_schedule_rx(eicon_card *card)
-{
-	tasklet_schedule(&card->rcv_tq);
-}
-
-extern __inline__ void eicon_schedule_ack(eicon_card *card)
-{
-	tasklet_schedule(&card->ack_tq);
-}
-
-extern int eicon_addcard(int, int, int, char *, int);
-extern void eicon_io_transmit(eicon_card *card);
-extern irqreturn_t eicon_irq(int irq, void *dev_id, struct pt_regs *regs);
-extern void eicon_io_rcv_dispatch(eicon_card *ccard);
-extern void eicon_io_ack_dispatch(eicon_card *ccard);
-#ifdef CONFIG_MCA
-extern int eicon_mca_find_card(int, int, int, char *);
-extern int eicon_mca_probe(int, int, int, int, char *);
-extern int eicon_info(char *, int , void *);
-#endif /* CONFIG_MCA */
-
-extern ulong DebugVar;
-extern void eicon_log(eicon_card * card, int level, const char *fmt, ...);
-extern void eicon_putstatus(eicon_card * card, char * buf);
-
-extern spinlock_t eicon_lock;
-
-#endif  /* __KERNEL__ */
-
-#endif	/* eicon_h */
diff -Nru a/drivers/isdn/eicon/eicon_dsp.h b/drivers/isdn/eicon/eicon_dsp.h
--- a/drivers/isdn/eicon/eicon_dsp.h	Tue Feb  3 19:45:29 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,285 +0,0 @@
-/* $Id: eicon_dsp.h,v 1.1.4.1.2.2 2002/10/01 11:29:13 armin Exp $
- *
- * ISDN lowlevel-module for Eicon active cards.
- * DSP definitions
- *
- * Copyright 1999,2000  by Armin Schindler (mac@melware.de)
- * Copyright 1999,2000  Cytronics & Melware (info@melware.de)
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#ifndef DSP_H 
-#define DSP_H
-
-#include "dsp_defs.h"
-
-
-#define DSP_UDATA_REQUEST_SWITCH_FRAMER         1
-/*
-parameters:
-  <byte> transmit framer type
-  <byte> receive framer type
-*/
-
-#define DSP_REQUEST_SWITCH_FRAMER_HDLC          0
-#define DSP_REQUEST_SWITCH_FRAMER_TRANSPARENT   1
-#define DSP_REQUEST_SWITCH_FRAMER_ASYNC         2
-
-
-#define DSP_UDATA_REQUEST_CLEARDOWN             2
-/*
-parameters:
-  - none -
-*/
-
-
-#define DSP_UDATA_REQUEST_TX_CONFIRMATION_ON    3
-/*
-parameters:
-  - none -
-*/
-
-
-#define DSP_UDATA_REQUEST_TX_CONFIRMATION_OFF   4
-/*
-parameters:
-  - none -
-*/
-
-typedef struct eicon_dsp_ind {
-	__u16	time		__attribute__ ((packed));
-	__u8	norm		__attribute__ ((packed));
-	__u16	options		__attribute__ ((packed));
-	__u32	speed		__attribute__ ((packed));
-	__u16	delay		__attribute__ ((packed));
-	__u32	txspeed		__attribute__ ((packed));
-	__u32	rxspeed		__attribute__ ((packed));
-} eicon_dsp_ind;
-
-#define DSP_CONNECTED_OPTION_V42_TRANS           0x0002
-#define DSP_CONNECTED_OPTION_V42_LAPM            0x0004
-#define DSP_CONNECTED_OPTION_SHORT_TRAIN         0x0008
-#define DSP_CONNECTED_OPTION_TALKER_ECHO_PROTECT 0x0010
-
-#define DSP_UDATA_INDICATION_DISCONNECT         5
-/*
-returns:
-  <byte> cause
-*/
-
-#define DSP_DISCONNECT_CAUSE_NONE               0x00
-#define DSP_DISCONNECT_CAUSE_BUSY_TONE          0x01
-#define DSP_DISCONNECT_CAUSE_CONGESTION_TONE    0x02
-#define DSP_DISCONNECT_CAUSE_INCOMPATIBILITY    0x03
-#define DSP_DISCONNECT_CAUSE_CLEARDOWN          0x04
-#define DSP_DISCONNECT_CAUSE_TRAINING_TIMEOUT   0x05
-
-#define DSP_UDATA_INDICATION_TX_CONFIRMATION    6
-/*
-returns:
-  <word> confirmation number
-*/
-
-
-#define DSP_UDATA_REQUEST_SEND_DTMF_DIGITS      16
-/*
-parameters:
-  <word> tone duration (ms)
-  <word> gap duration (ms)
-  <byte> digit 0 tone code
-  ...
-  <byte> digit n tone code
-*/
-
-#define DSP_SEND_DTMF_DIGITS_HEADER_LENGTH      5
-
-#define DSP_DTMF_DIGIT_TONE_LOW_GROUP_697_HZ    0x00
-#define DSP_DTMF_DIGIT_TONE_LOW_GROUP_770_HZ    0x01
-#define DSP_DTMF_DIGIT_TONE_LOW_GROUP_852_HZ    0x02
-#define DSP_DTMF_DIGIT_TONE_LOW_GROUP_941_HZ    0x03
-#define DSP_DTMF_DIGIT_TONE_LOW_GROUP_MASK      0x03
-#define DSP_DTMF_DIGIT_TONE_HIGH_GROUP_1209_HZ  0x00
-#define DSP_DTMF_DIGIT_TONE_HIGH_GROUP_1336_HZ  0x04
-#define DSP_DTMF_DIGIT_TONE_HIGH_GROUP_1477_HZ  0x08
-#define DSP_DTMF_DIGIT_TONE_HIGH_GROUP_1633_HZ  0x0c
-#define DSP_DTMF_DIGIT_TONE_HIGH_GROUP_MASK     0x0c
-
-#define DSP_DTMF_DIGIT_TONE_CODE_0              0x07
-#define DSP_DTMF_DIGIT_TONE_CODE_1              0x00
-#define DSP_DTMF_DIGIT_TONE_CODE_2              0x04
-#define DSP_DTMF_DIGIT_TONE_CODE_3              0x08
-#define DSP_DTMF_DIGIT_TONE_CODE_4              0x01
-#define DSP_DTMF_DIGIT_TONE_CODE_5              0x05
-#define DSP_DTMF_DIGIT_TONE_CODE_6              0x09
-#define DSP_DTMF_DIGIT_TONE_CODE_7              0x02
-#define DSP_DTMF_DIGIT_TONE_CODE_8              0x06
-#define DSP_DTMF_DIGIT_TONE_CODE_9              0x0a
-#define DSP_DTMF_DIGIT_TONE_CODE_STAR           0x03
-#define DSP_DTMF_DIGIT_TONE_CODE_HASHMARK       0x0b
-#define DSP_DTMF_DIGIT_TONE_CODE_A              0x0c
-#define DSP_DTMF_DIGIT_TONE_CODE_B              0x0d
-#define DSP_DTMF_DIGIT_TONE_CODE_C              0x0e
-#define DSP_DTMF_DIGIT_TONE_CODE_D              0x0f
-
-
-#define DSP_UDATA_INDICATION_DTMF_DIGITS_SENT   16
-/*
-returns:
-  - none -
-  One indication will be sent for every request.
-*/
-
-
-#define DSP_UDATA_REQUEST_ENABLE_DTMF_RECEIVER  17
-/*
-parameters:
-  <word> tone duration (ms)
-  <word> gap duration (ms)
-*/
-typedef struct enable_dtmf_s {
-	__u16 tone;
-	__u16 gap;
-} enable_dtmf_s;
-
-#define DSP_UDATA_REQUEST_DISABLE_DTMF_RECEIVER 18
-/*
-parameters:
-  - none -
-*/
-
-#define DSP_UDATA_INDICATION_DTMF_DIGITS_RECEIVED 17
-/*
-returns:
-  <byte> digit 0 tone code
-  ...
-  <byte> digit n tone code
-*/
-
-#define DSP_DTMF_DIGITS_RECEIVED_HEADER_LENGTH  1
-
-
-#define DSP_UDATA_INDICATION_MODEM_CALLING_TONE 18
-/*
-returns:
-  - none -
-*/
-
-#define DSP_UDATA_INDICATION_FAX_CALLING_TONE   19
-/*
-returns:
-  - none -
-*/
-
-#define DSP_UDATA_INDICATION_ANSWER_TONE        20
-/*
-returns:
-  - none -
-*/
-
-/* ============= FAX ================ */
-
-#define EICON_FAXID_LEN 20
-
-typedef struct eicon_t30_s {
-  __u8          code;
-  __u8          rate;
-  __u8          resolution;
-  __u8          format;
-  __u8          pages_low;
-  __u8          pages_high;
-  __u8          atf;
-  __u8          control_bits_low;
-  __u8          control_bits_high;
-  __u8          feature_bits_low;
-  __u8          feature_bits_high;
-  __u8          universal_5;
-  __u8          universal_6;
-  __u8          universal_7;
-  __u8          station_id_len;
-  __u8          head_line_len;
-  __u8          station_id[EICON_FAXID_LEN];
-/* __u8          head_line[]; */
-} eicon_t30_s;
-
-        /* EDATA transmit messages */
-#define EDATA_T30_DIS       0x01
-#define EDATA_T30_FTT       0x02
-#define EDATA_T30_MCF       0x03
-
-        /* EDATA receive messages */
-#define EDATA_T30_DCS       0x81
-#define EDATA_T30_TRAIN_OK  0x82
-#define EDATA_T30_EOP       0x83
-#define EDATA_T30_MPS       0x84
-#define EDATA_T30_EOM       0x85
-#define EDATA_T30_DTC       0x86
-
-#define T30_FORMAT_SFF            0
-#define T30_FORMAT_ASCII          1
-#define T30_FORMAT_COUNT          2
-
-#define T30_CONTROL_BIT_DISABLE_FINE      0x0001
-#define T30_CONTROL_BIT_ENABLE_ECM        0x0002
-#define T30_CONTROL_BIT_ECM_64_BYTES      0x0004
-#define T30_CONTROL_BIT_ENABLE_2D_CODING  0x0008
-#define T30_CONTROL_BIT_ENABLE_T6_CODING  0x0010
-#define T30_CONTROL_BIT_ENABLE_UNCOMPR    0x0020
-#define T30_CONTROL_BIT_ACCEPT_POLLING    0x0040
-#define T30_CONTROL_BIT_REQUEST_POLLING   0x0080
-#define T30_CONTROL_BIT_MORE_DOCUMENTS    0x0100
-
-#define T30_CONTROL_BIT_ALL_FEATURES\
-  (T30_CONTROL_BIT_ENABLE_ECM | T30_CONTROL_BIT_ENABLE_2D_CODING |\
-   T30_CONTROL_BIT_ENABLE_T6_CODING | T30_CONTROL_BIT_ENABLE_UNCOMPR)
-
-#define T30_FEATURE_BIT_FINE              0x0001
-#define T30_FEATURE_BIT_ECM               0x0002
-#define T30_FEATURE_BIT_ECM_64_BYTES      0x0004
-#define T30_FEATURE_BIT_2D_CODING         0x0008
-#define T30_FEATURE_BIT_T6_CODING         0x0010
-#define T30_FEATURE_BIT_UNCOMPR_ENABLED   0x0020
-#define T30_FEATURE_BIT_POLLING           0x0040
-
-#define FAX_OBJECT_DOCU		1
-#define FAX_OBJECT_PAGE		2
-#define FAX_OBJECT_LINE		3
-
-#define T4_EOL			0x800
-#define T4_EOL_BITSIZE		12
-#define T4_EOL_DWORD		(T4_EOL << (32 - T4_EOL_BITSIZE))
-#define T4_EOL_MASK_DWORD	((__u32) -1 << (32 - T4_EOL_BITSIZE))
-
-#define SFF_LEN_FLD_SIZE	3
-
-#define _DLE_	0x10
-#define _ETX_	0x03
-
-typedef struct eicon_sff_dochead {
-	__u32	id		__attribute__ ((packed));
-	__u8	version		__attribute__ ((packed));
-	__u8	reserved1	__attribute__ ((packed));
-	__u16	userinfo	__attribute__ ((packed));
-	__u16	pagecount	__attribute__ ((packed));
-	__u16	off1pagehead	__attribute__ ((packed));
-	__u32	offnpagehead	__attribute__ ((packed));
-	__u32	offdocend	__attribute__ ((packed));
-} eicon_sff_dochead;
-
-typedef struct eicon_sff_pagehead {
-	__u8	pageheadid	__attribute__ ((packed));
-	__u8	pageheadlen	__attribute__ ((packed));
-	__u8	resvert		__attribute__ ((packed));
-	__u8	reshoriz	__attribute__ ((packed));
-	__u8	coding		__attribute__ ((packed));
-	__u8	reserved2	__attribute__ ((packed));
-	__u16	linelength	__attribute__ ((packed));
-	__u16	pagelength	__attribute__ ((packed));
-	__u32	offprevpage	__attribute__ ((packed));
-	__u32	offnextpage	__attribute__ ((packed));
-} eicon_sff_pagehead;
-
-#endif	/* DSP_H */
-
diff -Nru a/drivers/isdn/eicon/eicon_idi.c b/drivers/isdn/eicon/eicon_idi.c
--- a/drivers/isdn/eicon/eicon_idi.c	Tue Feb  3 19:45:16 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,3197 +0,0 @@
-/* $Id: eicon_idi.c,v 1.1.4.1.2.4 2002/10/01 11:29:13 armin Exp $
- *
- * ISDN lowlevel-module for Eicon active cards.
- * IDI interface 
- *
- * Copyright 1998-2000  by Armin Schindler (mac@melware.de)
- * Copyright 1999,2000  Cytronics & Melware (info@melware.de)
- *
- * Thanks to	Deutsche Mailbox Saar-Lor-Lux GmbH
- *		for sponsoring and testing fax
- *		capabilities with Diva Server cards.
- *		(dor@deutschemailbox.de)
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#include <linux/config.h>
-#include "eicon.h"
-#include "eicon_idi.h"
-#include "eicon_dsp.h"
-#include "uxio.h"
-
-#undef EICON_FULL_SERVICE_OKTETT
-
-char *eicon_idi_revision = "$Revision: 1.1.4.1.2.4 $";
-
-eicon_manifbuf *manbuf;
-
-int eicon_idi_manage_assign(eicon_card *card);
-int eicon_idi_manage_remove(eicon_card *card);
-int idi_fill_in_T30(eicon_chan *chan, unsigned char *buffer);
-
-int
-idi_assign_req(eicon_REQ *reqbuf, int signet, eicon_chan *chan)
-{
-	int l = 0;
-	int tmp;
-
-	tmp = 0;
-  if (!signet) {
-	/* Signal Layer */
-	reqbuf->XBuffer.P[l++] = CAI;
-	reqbuf->XBuffer.P[l++] = 1;
-	reqbuf->XBuffer.P[l++] = 0;
-	reqbuf->XBuffer.P[l++] = KEY;
-	reqbuf->XBuffer.P[l++] = 3;
-	reqbuf->XBuffer.P[l++] = 'I';
-	reqbuf->XBuffer.P[l++] = '4';
-	reqbuf->XBuffer.P[l++] = 'L';
-	reqbuf->XBuffer.P[l++] = SHIFT|6;
-	reqbuf->XBuffer.P[l++] = SIN;
-	reqbuf->XBuffer.P[l++] = 2;
-	reqbuf->XBuffer.P[l++] = 0;
-	reqbuf->XBuffer.P[l++] = 0;
-	reqbuf->XBuffer.P[l++] = 0; /* end */
-	reqbuf->Req = ASSIGN;
-	reqbuf->ReqCh = 0;
-	reqbuf->ReqId = DSIG_ID;
-	reqbuf->XBuffer.length = l;
-	reqbuf->Reference = 0; /* Sig Entity */
-  }
-  else {
-	/* Network Layer */
-	reqbuf->XBuffer.P[l++] = CAI;
-	reqbuf->XBuffer.P[l++] = 1;
-	reqbuf->XBuffer.P[l++] = chan->e.D3Id;
-	reqbuf->XBuffer.P[l++] = LLC;
-	reqbuf->XBuffer.P[l++] = 2;
-	switch(chan->l2prot) {
-		case ISDN_PROTO_L2_V11096:
-		case ISDN_PROTO_L2_V11019:
-		case ISDN_PROTO_L2_V11038:
-		case ISDN_PROTO_L2_TRANS:
-			reqbuf->XBuffer.P[l++] = 2; /* transparent */
-			break;
-		case ISDN_PROTO_L2_X75I:
-		case ISDN_PROTO_L2_X75UI:
-		case ISDN_PROTO_L2_X75BUI:
-			reqbuf->XBuffer.P[l++] = 5; /* X.75 */ 
-			break;
-		case ISDN_PROTO_L2_MODEM:
-  			if (chan->fsm_state == EICON_STATE_IWAIT)
-				reqbuf->XBuffer.P[l++] = 9; /* V.42 incoming */
-			else
-				reqbuf->XBuffer.P[l++] = 10; /* V.42 */
-			break;
-		case ISDN_PROTO_L2_HDLC:
-		case ISDN_PROTO_L2_FAX:
-  			if (chan->fsm_state == EICON_STATE_IWAIT)
-				reqbuf->XBuffer.P[l++] = 3; /* autoconnect on incoming */
-			else
-				reqbuf->XBuffer.P[l++] = 2; /* transparent */
-			break;
-		default:
-			reqbuf->XBuffer.P[l++] = 1;
-	}
-	switch(chan->l3prot) {
-		case ISDN_PROTO_L3_FCLASS2:
-#ifdef CONFIG_ISDN_TTY_FAX
-			reqbuf->XBuffer.P[l++] = 6;
-			reqbuf->XBuffer.P[l++] = NLC;
-			tmp = idi_fill_in_T30(chan, &reqbuf->XBuffer.P[l+1]);
-			reqbuf->XBuffer.P[l++] = tmp; 
-			l += tmp;
-			break;
-#endif
-		case ISDN_PROTO_L3_TRANS:
-		default:
-			reqbuf->XBuffer.P[l++] = 4;
-	}
-	reqbuf->XBuffer.P[l++] = 0; /* end */
-	reqbuf->Req = ASSIGN;
-	reqbuf->ReqCh = 0;
-	reqbuf->ReqId = NL_ID;
-	reqbuf->XBuffer.length = l;
-	reqbuf->Reference = 1; /* Net Entity */
-  }
-   return(0);
-}
-
-int
-idi_put_req(eicon_REQ *reqbuf, int rq, int signet, int Ch)
-{
-	reqbuf->Req = rq;
-	reqbuf->ReqCh = Ch;
-	reqbuf->ReqId = 1;
-	reqbuf->XBuffer.length = 1;
-	reqbuf->XBuffer.P[0] = 0;
-	reqbuf->Reference = signet;
-   return(0);
-}
-
-int
-idi_put_suspend_req(eicon_REQ *reqbuf, eicon_chan *chan)
-{
-	reqbuf->Req = SUSPEND;
-	reqbuf->ReqCh = 0;
-	reqbuf->ReqId = 1;
-	reqbuf->XBuffer.P[0] = CAI;
-	reqbuf->XBuffer.P[1] = 1;
-	reqbuf->XBuffer.P[2] = chan->No;
-	reqbuf->XBuffer.P[3] = 0;
-	reqbuf->XBuffer.length = 4;
-	reqbuf->Reference = 0; /* Sig Entity */
-   return(0);
-}
-
-int
-idi_call_res_req(eicon_REQ *reqbuf, eicon_chan *chan)
-{
-	int l = 9;
-	reqbuf->Req = CALL_RES;
-	reqbuf->ReqCh = 0;
-	reqbuf->ReqId = 1;
-	reqbuf->XBuffer.P[0] = CAI;
-	reqbuf->XBuffer.P[1] = 6;
-	reqbuf->XBuffer.P[2] = 9;
-	reqbuf->XBuffer.P[3] = 0;
-	reqbuf->XBuffer.P[4] = 0;
-	reqbuf->XBuffer.P[5] = 0;
-	reqbuf->XBuffer.P[6] = 32;
-	reqbuf->XBuffer.P[7] = 0;
-	switch(chan->l2prot) {
-		case ISDN_PROTO_L2_X75I:
-		case ISDN_PROTO_L2_X75UI:
-		case ISDN_PROTO_L2_X75BUI:
-		case ISDN_PROTO_L2_HDLC:
-			reqbuf->XBuffer.P[1] = 1;
-			reqbuf->XBuffer.P[2] = 0x05;
-			l = 4;
-			break;
-		case ISDN_PROTO_L2_V11096:
-			reqbuf->XBuffer.P[2] = 0x0d;
-			reqbuf->XBuffer.P[3] = 5;
-			reqbuf->XBuffer.P[4] = 0;
-			break;
-		case ISDN_PROTO_L2_V11019:
-			reqbuf->XBuffer.P[2] = 0x0d;
-			reqbuf->XBuffer.P[3] = 6;
-			reqbuf->XBuffer.P[4] = 0;
-			break;
-		case ISDN_PROTO_L2_V11038:
-			reqbuf->XBuffer.P[2] = 0x0d;
-			reqbuf->XBuffer.P[3] = 7;
-			reqbuf->XBuffer.P[4] = 0;
-			break;
-		case ISDN_PROTO_L2_MODEM:
-			reqbuf->XBuffer.P[2] = 0x11;
-			reqbuf->XBuffer.P[3] = 7;
-			reqbuf->XBuffer.P[4] = 0;
-			reqbuf->XBuffer.P[5] = 0;
-			reqbuf->XBuffer.P[6] = 128;
-			reqbuf->XBuffer.P[7] = 0;
-			break;
-		case ISDN_PROTO_L2_FAX:
-			reqbuf->XBuffer.P[2] = 0x10;
-			reqbuf->XBuffer.P[3] = 0;
-			reqbuf->XBuffer.P[4] = 0;
-			reqbuf->XBuffer.P[5] = 0;
-			reqbuf->XBuffer.P[6] = 128;
-			reqbuf->XBuffer.P[7] = 0;
-			break;
-		case ISDN_PROTO_L2_TRANS:
-			switch(chan->l3prot) {
-				case ISDN_PROTO_L3_TRANSDSP:
-					reqbuf->XBuffer.P[2] = 22; /* DTMF, audio events on */
-			}
-			break;
-	}
-	reqbuf->XBuffer.P[8] = 0;
-	reqbuf->XBuffer.length = l;
-	reqbuf->Reference = 0; /* Sig Entity */
-	eicon_log(NULL, 8, "idi_req: Ch%d: Call_Res\n", chan->No);
-   return(0);
-}
-
-int
-idi_do_req(eicon_card *card, eicon_chan *chan, int cmd, int layer)
-{
-        struct sk_buff *skb;
-        struct sk_buff *skb2;
-	eicon_REQ *reqbuf;
-	eicon_chan_ptr *chan2;
-
-        skb = alloc_skb(270 + sizeof(eicon_REQ), GFP_ATOMIC);
-        skb2 = alloc_skb(sizeof(eicon_chan_ptr), GFP_ATOMIC);
-
-        if ((!skb) || (!skb2)) {
-               	eicon_log(card, 1, "idi_err: Ch%d: alloc_skb failed in do_req()\n", chan->No);
-		if (skb) 
-			dev_kfree_skb(skb);
-		if (skb2) 
-			dev_kfree_skb(skb2);
-                return -ENOMEM; 
-	}
-
-	chan2 = (eicon_chan_ptr *)skb_put(skb2, sizeof(eicon_chan_ptr));
-	chan2->ptr = chan;
-
-	reqbuf = (eicon_REQ *)skb_put(skb, 270 + sizeof(eicon_REQ));
-	eicon_log(card, 8, "idi_req: Ch%d: req %x (%s)\n", chan->No, cmd, (layer)?"Net":"Sig");
-	if (layer) cmd |= 0x700;
-	switch(cmd) {
-		case ASSIGN:
-		case ASSIGN|0x700:
-			idi_assign_req(reqbuf, layer, chan);
-			break;
-		case REMOVE:
-		case REMOVE|0x700:
-			idi_put_req(reqbuf, REMOVE, layer, 0);
-			break;
-		case INDICATE_REQ:
-			idi_put_req(reqbuf, INDICATE_REQ, 0, 0);
-			break;
-		case HANGUP:
-			idi_put_req(reqbuf, HANGUP, 0, 0);
-			break;
-		case SUSPEND:
-			idi_put_suspend_req(reqbuf, chan);
-			break;
-		case RESUME:
-			idi_put_req(reqbuf, RESUME, 0 ,0);
-			break;
-		case REJECT:
-			idi_put_req(reqbuf, REJECT, 0 ,0);
-			break;
-		case CALL_ALERT:
-			idi_put_req(reqbuf, CALL_ALERT, 0, 0);
-			break;
-		case CALL_RES:
-			idi_call_res_req(reqbuf, chan);
-			break;
-		case CALL_HOLD:
-			idi_put_req(reqbuf, CALL_HOLD, 0, 0);
-			break;
-		case N_CONNECT|0x700:
-			idi_put_req(reqbuf, N_CONNECT, 1, 0);
-			break;
-		case N_CONNECT_ACK|0x700:
-			idi_put_req(reqbuf, N_CONNECT_ACK, 1, 0);
-			break;
-		case N_DISC|0x700:
-			idi_put_req(reqbuf, N_DISC, 1, chan->e.IndCh);
-			break;
-		case N_DISC_ACK|0x700:
-			idi_put_req(reqbuf, N_DISC_ACK, 1, chan->e.IndCh);
-			break;
-		default:
-			eicon_log(card, 1, "idi_req: Ch%d: Unknown request\n", chan->No);
-			dev_kfree_skb(skb);
-			dev_kfree_skb(skb2);
-			return(-1);
-	}
-
-	skb_queue_tail(&chan->e.X, skb);
-	skb_queue_tail(&card->sndq, skb2); 
-	eicon_schedule_tx(card);
-	return(0);
-}
-
-int
-eicon_idi_listen_req(eicon_card *card, eicon_chan *chan)
-{
-	if ((!card) || (!chan))
-		return 1;
-
-	eicon_log(card, 16, "idi_req: Ch%d: Listen_Req eazmask=0x%x\n",chan->No, chan->eazmask);
-	if (!chan->e.D3Id) {
-		idi_do_req(card, chan, ASSIGN, 0); 
-	}
-	if (chan->fsm_state == EICON_STATE_NULL) {
-		if (!(chan->statectrl & HAVE_CONN_REQ)) {
-			idi_do_req(card, chan, INDICATE_REQ, 0);
-			chan->fsm_state = EICON_STATE_LISTEN;
-		}
-	}
-  return(0);
-}
-
-unsigned char
-idi_si2bc(int si1, int si2, char *bc, char *hlc)
-{
-  hlc[0] = 0;
-  switch(si1) {
-	case 1:
-		bc[0] = 0x90;		/* 3,1 kHz audio */
-		bc[1] = 0x90;		/* 64 kbit/s */
-		bc[2] = 0xa3;		/* G.711 A-law */
-#ifdef EICON_FULL_SERVICE_OKTETT
-		if (si2 == 1) {
-			bc[0] = 0x80;	/* Speech */
-			hlc[0] = 0x02;	/* hlc len */
-			hlc[1] = 0x91;	/* first hic */
-			hlc[2] = 0x81;	/* Telephony */
-		}
-#endif
-		return(3);
-	case 2:
-		bc[0] = 0x90;		/* 3,1 kHz audio */
-		bc[1] = 0x90;		/* 64 kbit/s */
-		bc[2] = 0xa3;		/* G.711 A-law */
-#ifdef EICON_FULL_SERVICE_OKTETT
-		if (si2 == 2) {
-			hlc[0] = 0x02;	/* hlc len */
-			hlc[1] = 0x91;	/* first hic */
-			hlc[2] = 0x84;	/* Fax Gr.2/3 */
-		}
-#endif
-		return(3);
-	case 5:
-	case 7:
-	default:
-		bc[0] = 0x88;
-		bc[1] = 0x90;
-		return(2);
-  }
- return (0);
-}
-
-int
-idi_hangup(eicon_card *card, eicon_chan *chan)
-{
-	if ((!card) || (!chan))
-		return 1;
-
-	if ((chan->fsm_state == EICON_STATE_ACTIVE) ||
-	    (chan->fsm_state == EICON_STATE_WMCONN)) {
-  		if (chan->e.B2Id) idi_do_req(card, chan, N_DISC, 1);
-	}
-	if (chan->e.B2Id) idi_do_req(card, chan, REMOVE, 1);
-	if (chan->fsm_state != EICON_STATE_NULL) {
-		chan->statectrl |= WAITING_FOR_HANGUP;
-		idi_do_req(card, chan, HANGUP, 0);
-		chan->fsm_state = EICON_STATE_NULL;
-	}
-	eicon_log(card, 8, "idi_req: Ch%d: Hangup\n", chan->No);
-#ifdef CONFIG_ISDN_TTY_FAX
-	chan->fax = 0;
-#endif
-  return(0);
-}
-
-int
-capipmsg(eicon_card *card, eicon_chan *chan, capi_msg *cm)
-{
-	if ((cm->para[0] != 3) || (cm->para[1] != 0))
-		return -1;
-	if (cm->para[2] < 3)
-		return -1;
-	if (cm->para[4] != 0)
-		return -1;
-	switch(cm->para[3]) {
-		case 4: /* Suspend */
-			eicon_log(card, 8, "idi_req: Ch%d: Call Suspend\n", chan->No);
-			if (cm->para[5]) {
-				idi_do_req(card, chan, SUSPEND, 0);
-			} else {
-				idi_do_req(card, chan, CALL_HOLD, 0);
-			}
-			break;
-		case 5: /* Resume */
-			eicon_log(card, 8, "idi_req: Ch%d: Call Resume\n", chan->No);
-			idi_do_req(card, chan, RESUME, 0);
-			break;
-        }
-	return 0;
-}
-
-int
-idi_connect_res(eicon_card *card, eicon_chan *chan)
-{
-	if ((!card) || (!chan))
-		return 1;
-
-	chan->fsm_state = EICON_STATE_IWAIT;
-	
-	/* check if old NetID has been removed */
-	if (chan->e.B2Id) {
-		eicon_log(card, 1, "eicon: Ch%d: old net_id %x still exist, removing.\n",
-			chan->No, chan->e.B2Id);
-		idi_do_req(card, chan, REMOVE, 1);
-	}
-
-	idi_do_req(card, chan, ASSIGN, 1);
-	idi_do_req(card, chan, CALL_RES, 0);
-	return(0);
-}
-
-int
-idi_connect_req(eicon_card *card, eicon_chan *chan, char *phone,
-                    char *eazmsn, int si1, int si2)
-{
-	int l = 0;
-	int i;
-	unsigned char tmp;
-	unsigned char *sub, *sp;
-	unsigned char bc[5];
-	unsigned char hlc[5];
-        struct sk_buff *skb;
-        struct sk_buff *skb2;
-	eicon_REQ *reqbuf;
-	eicon_chan_ptr *chan2;
-
-	if ((!card) || (!chan))
-		return 1;
-
-        skb = alloc_skb(270 + sizeof(eicon_REQ), GFP_ATOMIC);
-        skb2 = alloc_skb(sizeof(eicon_chan_ptr), GFP_ATOMIC);
-
-        if ((!skb) || (!skb2)) {
-               	eicon_log(card, 1, "idi_err: Ch%d: alloc_skb failed in connect_req()\n", chan->No);
-		if (skb) 
-			dev_kfree_skb(skb);
-		if (skb2) 
-			dev_kfree_skb(skb2);
-                return -ENOMEM; 
-	}
-
-	chan2 = (eicon_chan_ptr *)skb_put(skb2, sizeof(eicon_chan_ptr));
-	chan2->ptr = chan;
-
-	reqbuf = (eicon_REQ *)skb_put(skb, 270 + sizeof(eicon_REQ));
-	reqbuf->Req = CALL_REQ;
-	reqbuf->ReqCh = 0;
-	reqbuf->ReqId = 1;
-
-	sub = NULL;
-	sp = phone;
-	while (*sp) {
-		if (*sp == '.') {
-			sub = sp + 1;
-			*sp = 0;
-		} else
-			sp++;
-	}
-	reqbuf->XBuffer.P[l++] = CPN;
-	reqbuf->XBuffer.P[l++] = strlen(phone) + 1;
-	reqbuf->XBuffer.P[l++] = 0x81;
-	for(i=0; i<strlen(phone);i++) 
-		reqbuf->XBuffer.P[l++] = phone[i] & 0x7f;
-	if (sub) {
-		reqbuf->XBuffer.P[l++] = DSA;
-		reqbuf->XBuffer.P[l++] = strlen(sub) + 2;
-		reqbuf->XBuffer.P[l++] = 0x80; /* NSAP coded */
-		reqbuf->XBuffer.P[l++] = 0x50; /* local IDI format */
-		while (*sub)
-			reqbuf->XBuffer.P[l++] = *sub++ & 0x7f;
-	}
-
-	sub = NULL;
-	sp = eazmsn;
-	while (*sp) {
-		if (*sp == '.') {
-			sub = sp + 1;
-			*sp = 0;
-		} else
-			sp++;
-	}
-	reqbuf->XBuffer.P[l++] = OAD;
-	reqbuf->XBuffer.P[l++] = strlen(eazmsn) + 2;
-	reqbuf->XBuffer.P[l++] = 0x01;
-	reqbuf->XBuffer.P[l++] = 0x80;
-	for(i=0; i<strlen(eazmsn);i++) 
-		reqbuf->XBuffer.P[l++] = eazmsn[i] & 0x7f;
-	if (sub) {
-		reqbuf->XBuffer.P[l++] = OSA;
-		reqbuf->XBuffer.P[l++] = strlen(sub) + 2;
-		reqbuf->XBuffer.P[l++] = 0x80; /* NSAP coded */
-		reqbuf->XBuffer.P[l++] = 0x50; /* local IDI format */
-		while (*sub)
-			reqbuf->XBuffer.P[l++] = *sub++ & 0x7f;
-	}
-
-	if (si2 > 2) {
-		reqbuf->XBuffer.P[l++] = SHIFT|6;
-		reqbuf->XBuffer.P[l++] = SIN;
-		reqbuf->XBuffer.P[l++] = 2;
-		reqbuf->XBuffer.P[l++] = si1;
-		reqbuf->XBuffer.P[l++] = si2;
-	}
-	else if ((tmp = idi_si2bc(si1, si2, bc, hlc)) > 0) {
-		reqbuf->XBuffer.P[l++] = BC;
-		reqbuf->XBuffer.P[l++] = tmp;
-		for(i=0; i<tmp;i++) 
-			reqbuf->XBuffer.P[l++] = bc[i];
-		if ((tmp=hlc[0])) {
-			reqbuf->XBuffer.P[l++] = HLC;
-			reqbuf->XBuffer.P[l++] = tmp;
-			for(i=1; i<=tmp;i++) 
-				reqbuf->XBuffer.P[l++] = hlc[i];
-		}
-	}
-
-        reqbuf->XBuffer.P[l++] = CAI;
-        reqbuf->XBuffer.P[l++] = 6;
-        reqbuf->XBuffer.P[l++] = 0x09;
-	reqbuf->XBuffer.P[l++] = 0;
-	reqbuf->XBuffer.P[l++] = 0;
-	reqbuf->XBuffer.P[l++] = 0;
-	reqbuf->XBuffer.P[l++] = 32;
-	reqbuf->XBuffer.P[l++] = 0;
-        switch(chan->l2prot) {
-		case ISDN_PROTO_L2_X75I:
-		case ISDN_PROTO_L2_X75UI:
-		case ISDN_PROTO_L2_X75BUI:
-                case ISDN_PROTO_L2_HDLC:
-                        reqbuf->XBuffer.P[l-6] = 5;
-                        reqbuf->XBuffer.P[l-7] = 1;
-			l -= 5; 
-                        break;
-                case ISDN_PROTO_L2_V11096:
-                        reqbuf->XBuffer.P[l-7] = 3;
-                        reqbuf->XBuffer.P[l-6] = 0x0d;
-                        reqbuf->XBuffer.P[l-5] = 5;
-                        reqbuf->XBuffer.P[l-4] = 0;
-                        l -= 3;
-                        break;
-                case ISDN_PROTO_L2_V11019:
-                        reqbuf->XBuffer.P[l-7] = 3;
-                        reqbuf->XBuffer.P[l-6] = 0x0d;
-                        reqbuf->XBuffer.P[l-5] = 6;
-                        reqbuf->XBuffer.P[l-4] = 0;
-                        l -= 3;
-                        break;
-                case ISDN_PROTO_L2_V11038:
-                        reqbuf->XBuffer.P[l-7] = 3;
-                        reqbuf->XBuffer.P[l-6] = 0x0d;
-                        reqbuf->XBuffer.P[l-5] = 7;
-                        reqbuf->XBuffer.P[l-4] = 0;
-                        l -= 3;
-                        break;
-                case ISDN_PROTO_L2_MODEM:
-			reqbuf->XBuffer.P[l-6] = 0x11;
-			reqbuf->XBuffer.P[l-5] = 7;
-			reqbuf->XBuffer.P[l-4] = 0;
-			reqbuf->XBuffer.P[l-3] = 0;
-			reqbuf->XBuffer.P[l-2] = 128;
-			reqbuf->XBuffer.P[l-1] = 0;
-                        break;
-                case ISDN_PROTO_L2_FAX:
-			reqbuf->XBuffer.P[l-6] = 0x10;
-			reqbuf->XBuffer.P[l-5] = 0;
-			reqbuf->XBuffer.P[l-4] = 0;
-			reqbuf->XBuffer.P[l-3] = 0;
-			reqbuf->XBuffer.P[l-2] = 128;
-			reqbuf->XBuffer.P[l-1] = 0;
-                        break;
-		case ISDN_PROTO_L2_TRANS:
-			switch(chan->l3prot) {
-				case ISDN_PROTO_L3_TRANSDSP:
-					reqbuf->XBuffer.P[l-6] = 22; /* DTMF, audio events on */
-			}
-			break;
-        }
-	
-	reqbuf->XBuffer.P[l++] = 0; /* end */
-	reqbuf->XBuffer.length = l;
-	reqbuf->Reference = 0; /* Sig Entity */
-
-	if (chan->statectrl & WAITING_FOR_HANGUP) {
-		/*	If the line did not disconnect yet,
-			we have to delay this command		*/
-		eicon_log(card, 32, "idi_req: Ch%d: delaying conn_req\n", chan->No);
-		chan->statectrl |= HAVE_CONN_REQ;
-		chan->tskb1 = skb;
-		chan->tskb2 = skb2;
-	} else {
-		skb_queue_tail(&chan->e.X, skb);
-		skb_queue_tail(&card->sndq, skb2); 
-		eicon_schedule_tx(card);
-	}
-
-	eicon_log(card, 8, "idi_req: Ch%d: Conn_Req %s -> %s\n",chan->No, eazmsn, phone);
-   return(0);
-}
-
-
-void
-idi_IndParse(eicon_card *ccard, eicon_chan *chan, idi_ind_message *message, unsigned char *buffer, int len)
-{
-	int i,j;
-	int pos = 0;
-	int codeset = 0;
-	int wlen = 0;
-	int lock = 0;
-	__u8 w;
-	__u16 code;
-	isdn_ctrl cmd;
-
-	memset(message, 0, sizeof(idi_ind_message));
-
-	if ((!len) || (!buffer[pos])) return;
-
-  while(pos <= len) {
-	w = buffer[pos++];
-	if (!w) return;
-	if (w & 0x80) {
-		wlen = 0;
-	}
-	else {
-		wlen = buffer[pos++];
-	}
-
-	if (pos > len) return;
-
-	if (lock & 0x80) lock &= 0x7f;
-	else codeset = lock;
-
-	if((w&0xf0) == SHIFT) {
-		codeset = w;
-		if(!(codeset & 0x08)) lock = codeset & 7;
-		codeset &= 7;
-		lock |= 0x80;
-	}
-	else {
-		if (w==ESC && wlen >=2) {
-			code = buffer[pos++]|0x800;
-			wlen--;
-		}
-		else code = w;
-		code |= (codeset<<8);
-
-		if (pos + wlen > len) {
-			eicon_log(ccard, 1, "idi_err: Ch%d: IElen %d of %x exceeds Ind_Length (+%d)\n", chan->No, 
-					wlen, code, (pos + wlen) - len);
-			return;
-		}
-
-		switch(code) {
-			case OAD:
-				if (wlen > sizeof(message->oad)) {
-					pos += wlen;
-					break;
-				}
-				j = 1;
-				if (wlen) {
-					message->plan = buffer[pos++];
-					if (message->plan &0x80) 
-						message->screen = 0;
-					else {
-						message->screen = buffer[pos++];
-						j = 2;
-					}
-				}
-				for(i=0; i < wlen-j; i++) 
-					message->oad[i] = buffer[pos++];
-				eicon_log(ccard, 2, "idi_inf: Ch%d: OAD=(0x%02x,0x%02x) %s\n", chan->No, 
-					message->plan, message->screen, message->oad);
-				break;
-			case RDN:
-				if (wlen > sizeof(message->rdn)) {
-					pos += wlen;
-					break;
-				}
-				j = 1;
-				if (wlen) {
-					if (!(buffer[pos++] & 0x80)) {
-						pos++; 
-						j = 2;
-					}
-				}
-				for(i=0; i < wlen-j; i++) 
-					message->rdn[i] = buffer[pos++];
-				eicon_log(ccard, 2, "idi_inf: Ch%d: RDN= %s\n", chan->No, 
-						message->rdn);
-				break;
-			case CPN:
-				if (wlen > sizeof(message->cpn)) {
-					pos += wlen;
-					break;
-				}
-				for(i=0; i < wlen; i++) 
-					message->cpn[i] = buffer[pos++];
-				eicon_log(ccard, 2, "idi_inf: Ch%d: CPN=(0x%02x) %s\n", chan->No,
-					(__u8)message->cpn[0], message->cpn + 1);
-				break;
-			case DSA:
-				if (wlen > sizeof(message->dsa)) {
-					pos += wlen;
-					break;
-				}
-				pos += 2;
-				for(i=0; i < wlen-2; i++) 
-					message->dsa[i] = buffer[pos++];
-				eicon_log(ccard, 2, "idi_inf: Ch%d: DSA=%s\n", chan->No, message->dsa);
-				break;
-			case OSA:
-				if (wlen > sizeof(message->osa)) {
-					pos += wlen;
-					break;
-				}
-				pos += 2;
-				for(i=0; i < wlen-2; i++) 
-					message->osa[i] = buffer[pos++];
-				eicon_log(ccard, 2, "idi_inf: Ch%d: OSA=%s\n", chan->No, message->osa);
-				break;
-			case CAD:
-				pos += wlen;
-				eicon_log(ccard, 2, "idi_inf: Ch%d: Connected Address in ind, len:%x\n", 
-					chan->No, wlen);
-				break;
-			case BC:
-				if (wlen > sizeof(message->bc)) {
-					pos += wlen;
-					break;
-				}
-				for(i=0; i < wlen; i++) 
-					message->bc[i] = buffer[pos++];
-				eicon_log(ccard, 4, "idi_inf: Ch%d: BC = 0x%02x 0x%02x 0x%02x\n", chan->No,
-					message->bc[0],message->bc[1],message->bc[2]);
-				break;
-			case 0x800|BC:
-				if (wlen > sizeof(message->e_bc)) {
-					pos += wlen;
-					break;
-				}
-				for(i=0; i < wlen; i++) 
-					message->e_bc[i] = buffer[pos++];
-				eicon_log(ccard, 4, "idi_inf: Ch%d: ESC/BC=%d\n", chan->No, message->bc[0]);
-				break;
-			case LLC:
-				if (wlen > sizeof(message->llc)) {
-					pos += wlen;
-					break;
-				}
-				for(i=0; i < wlen; i++) 
-					message->llc[i] = buffer[pos++];
-				eicon_log(ccard, 4, "idi_inf: Ch%d: LLC=%d %d %d %d ...\n", chan->No, message->llc[0],
-					message->llc[1],message->llc[2],message->llc[3]);
-				break;
-			case HLC:
-				if (wlen > sizeof(message->hlc)) {
-					pos += wlen;
-					break;
-				}
-				for(i=0; i < wlen; i++) 
-					message->hlc[i] = buffer[pos++];
-				eicon_log(ccard, 4, "idi_inf: Ch%d: HLC=%x %x %x %x %x ...\n", chan->No,
-					message->hlc[0], message->hlc[1],
-					message->hlc[2], message->hlc[3], message->hlc[4]);
-				break;
-			case DSP:
-			case 0x600|DSP:
-				if (wlen > sizeof(message->display)) {
-					pos += wlen;
-					break;
-				}
-				for(i=0; i < wlen; i++) 
-					message->display[i] = buffer[pos++];
-				eicon_log(ccard, 4, "idi_inf: Ch%d: Display: %s\n", chan->No,
-					message->display);
-				break;
-			case 0x600|KEY:
-				if (wlen > sizeof(message->keypad)) {
-					pos += wlen;
-					break;
-				}
-				for(i=0; i < wlen; i++) 
-					message->keypad[i] = buffer[pos++];
-				eicon_log(ccard, 4, "idi_inf: Ch%d: Keypad: %s\n", chan->No,
-					message->keypad);
-				break;
-			case NI:
-			case 0x600|NI:
-				if (wlen) {
-					switch(buffer[pos] & 127) {
-						case 0:
-							eicon_log(ccard, 4, "idi_inf: Ch%d: User suspended.\n", chan->No);
-							break;
-						case 1:
-							eicon_log(ccard, 4, "idi_inf: Ch%d: User resumed.\n", chan->No);
-							break;
-						case 2:
-							eicon_log(ccard, 4, "idi_inf: Ch%d: Bearer service change.\n", chan->No);
-							break;
-						default:
-							eicon_log(ccard, 4, "idi_inf: Ch%d: Unknown Notification %x.\n", 
-									chan->No, buffer[pos] & 127);
-					}
-					pos += wlen;
-				}
-				break;
-			case PI:
-			case 0x600|PI:
-				if (wlen > 1) {
-					switch(buffer[pos+1] & 127) {
-						case 1:
-							eicon_log(ccard, 4, "idi_inf: Ch%d: Call is not end-to-end ISDN.\n", chan->No);
-							break;
-						case 2:
-							eicon_log(ccard, 4, "idi_inf: Ch%d: Destination address is non ISDN.\n", chan->No);
-							break;
-						case 3:
-							eicon_log(ccard, 4, "idi_inf: Ch%d: Origination address is non ISDN.\n", chan->No);
-							break;
-						case 4:
-							eicon_log(ccard, 4, "idi_inf: Ch%d: Call has returned to the ISDN.\n", chan->No);
-							break;
-						case 5:
-							eicon_log(ccard, 4, "idi_inf: Ch%d: Interworking has occurred.\n", chan->No);
-							break;
-						case 8:
-							eicon_log(ccard, 4, "idi_inf: Ch%d: In-band information available.\n", chan->No);
-							break;
-						default:
-							eicon_log(ccard, 4, "idi_inf: Ch%d: Unknown Progress %x.\n", 
-									chan->No, buffer[pos+1] & 127);
-					}
-				}
-				pos += wlen;
-				break;
-			case CAU:
-				if (wlen > sizeof(message->cau)) {
-					pos += wlen;
-					break;
-				}
-				for(i=0; i < wlen; i++) 
-					message->cau[i] = buffer[pos++];
-				memcpy(&chan->cause, &message->cau, 2);
-				eicon_log(ccard, 4, "idi_inf: Ch%d: CAU=%d %d\n", chan->No,
-					message->cau[0],message->cau[1]);
-				break;
-			case 0x800|CAU:
-				if (wlen > sizeof(message->e_cau)) {
-					pos += wlen;
-					break;
-				}
-				for(i=0; i < wlen; i++) 
-					message->e_cau[i] = buffer[pos++];
-				eicon_log(ccard, 4, "idi_inf: Ch%d: ECAU=%d %d\n", chan->No,
-					message->e_cau[0],message->e_cau[1]);
-				break;
-			case 0x800|CHI:
-				if (wlen > sizeof(message->e_chi)) {
-					pos += wlen;
-					break;
-				}
-				for(i=0; i < wlen; i++) 
-					message->e_chi[i] = buffer[pos++];
-				eicon_log(ccard, 4, "idi_inf: Ch%d: ESC/CHI=%d\n", chan->No,
-					message->e_cau[0]);
-				break;
-			case 0x800|0x7a:
-				pos ++;
-				message->e_mt=buffer[pos++];
-				eicon_log(ccard, 4, "idi_inf: Ch%d: EMT=0x%x\n", chan->No, message->e_mt);
-				break;
-			case DT:
-				if (wlen > sizeof(message->dt)) {
-					pos += wlen;
-					break;
-				}
-				for(i=0; i < wlen; i++) 
-					message->dt[i] = buffer[pos++];
-				eicon_log(ccard, 4, "idi_inf: Ch%d: DT: %02d.%02d.%02d %02d:%02d:%02d\n", chan->No,
-					message->dt[2], message->dt[1], message->dt[0],
-					message->dt[3], message->dt[4], message->dt[5]);
-				break;
-			case 0x600|SIN:
-				if (wlen > sizeof(message->sin)) {
-					pos += wlen;
-					break;
-				}
-				for(i=0; i < wlen; i++) 
-					message->sin[i] = buffer[pos++];
-				eicon_log(ccard, 2, "idi_inf: Ch%d: SIN=%d %d\n", chan->No,
-					message->sin[0],message->sin[1]);
-				break;
-			case 0x600|CPS:
-				eicon_log(ccard, 2, "idi_inf: Ch%d: Called Party Status in ind\n", chan->No);
-				pos += wlen;
-				break;
-			case 0x600|CIF:
-				for (i = 0; i < wlen; i++)
-					if (buffer[pos + i] != '0') break;
-				memcpy(&cmd.parm.num, &buffer[pos + i], wlen - i);
-				cmd.parm.num[wlen - i] = 0;
-				eicon_log(ccard, 2, "idi_inf: Ch%d: CIF=%s\n", chan->No, cmd.parm.num);
-				pos += wlen;
-				cmd.driver = ccard->myid;
-				cmd.command = ISDN_STAT_CINF;
-				cmd.arg = chan->No;
-				ccard->interface.statcallb(&cmd);
-				break;
-			case 0x600|DATE:
-				eicon_log(ccard, 2, "idi_inf: Ch%d: Date in ind\n", chan->No);
-				pos += wlen;
-				break;
-			case 0xa1: 
-				eicon_log(ccard, 2, "idi_inf: Ch%d: Sending Complete in ind.\n", chan->No);
-				pos += wlen;
-				break;
-			case 0xe08: 
-			case 0xe7a: 
-			case 0xe04: 
-			case 0xe00: 
-				/* *** TODO *** */
-			case CHA:
-				/* Charge advice */
-			case FTY:
-			case 0x600|FTY:
-			case CHI:
-			case 0x800:
-				/* Not yet interested in this */
-				pos += wlen;
-				break;
-			case 0x880:
-				/* Managment Information Element */
-				if (!manbuf) {
-					eicon_log(ccard, 1, "idi_err: manbuf not allocated\n");
-				}
-				else {
-					memcpy(&manbuf->data[manbuf->pos], &buffer[pos], wlen);
-					manbuf->length[manbuf->count] = wlen;
-					manbuf->count++;
-					manbuf->pos += wlen;
-				}
-				pos += wlen;
-				break;
-			default:
-				pos += wlen;
-				eicon_log(ccard, 6, "idi_inf: Ch%d: unknown information element 0x%x in ind, len:%x\n", 
-					chan->No, code, wlen);
-		}
-	}
-  }
-}
-
-void
-idi_bc2si(unsigned char *bc, unsigned char *hlc, unsigned char *sin, unsigned char *si1, unsigned char *si2)
-{
-	si1[0] = 0;
-	si2[0] = 0;
-
-	switch (bc[0] & 0x7f) {
-		case 0x00: /* Speech */
-			si1[0] = 1;
-#ifdef EICON_FULL_SERVICE_OKTETT
-			si1[0] = sin[0];
-			si2[0] = sin[1];
-#endif
-			break;
-		case 0x10: /* 3.1 Khz audio */
-			si1[0] = 1;
-#ifdef EICON_FULL_SERVICE_OKTETT
-			si1[0] = sin[0];
-			si2[0] = sin[1];
-#endif
-			break;
-		case 0x08: /* Unrestricted digital information */
-			si1[0] = 7;
-			si2[0] = sin[1];
-			break;
-		case 0x09: /* Restricted digital information */
-			si1[0] = 2;
-			break;
-		case 0x11:
-			/* Unrestr. digital information  with
-			 * tones/announcements ( or 7 kHz audio
-			 */
-			si1[0] = 3;
-			break;
-		case 0x18: /* Video */
-			si1[0] = 4;
-			break;
-	}
-	switch (bc[1] & 0x7f) {
-		case 0x40: /* packed mode */
-			si1[0] = 8;
-			break;
-		case 0x10: /* 64 kbit */
-		case 0x11: /* 2*64 kbit */
-		case 0x13: /* 384 kbit */
-		case 0x15: /* 1536 kbit */
-		case 0x17: /* 1920 kbit */
-			/* moderate = bc[1] & 0x7f; */
-			break;
-	}
-}
-
-/********************* FAX stuff ***************************/
-
-#ifdef CONFIG_ISDN_TTY_FAX
-
-int
-idi_fill_in_T30(eicon_chan *chan, unsigned char *buffer)
-{
-	eicon_t30_s	*t30 = (eicon_t30_s *) buffer;
-
-	if (!chan->fax) {
-		eicon_log(NULL, 1,"idi_T30: fill_in with NULL fax struct, ERROR\n");
-		return 0;
-	}
-	memset(t30, 0, sizeof(eicon_t30_s));
-	t30->station_id_len = EICON_FAXID_LEN;
-	memcpy(&t30->station_id[0], &chan->fax->id[0], EICON_FAXID_LEN);
-	t30->resolution = chan->fax->resolution;
-	t30->rate = chan->fax->rate + 1;	/* eicon rate starts with 1 */
-	t30->format = T30_FORMAT_SFF;
-	t30->pages_low = 0;
-	t30->pages_high = 0;
-	t30->atf = 1;				/* optimised for AT+F command set */
-	t30->code = 0;
-	t30->feature_bits_low = 0;
-	t30->feature_bits_high = 0;
-	t30->control_bits_low = 0;
-	t30->control_bits_high = 0;
-
-	if (chan->fax->nbc) {
-		/* set compression by DCC value */
-  	  switch(chan->fax->compression) {
-		case (0):	/* 1-D modified */
-			break;
-		case (1):	/* 2-D modified Read */
-			t30->control_bits_low |= T30_CONTROL_BIT_ENABLE_2D_CODING;
-			t30->feature_bits_low |= T30_FEATURE_BIT_2D_CODING;
-			break;
-		case (2):	/* 2-D uncompressed */
-			t30->control_bits_low |= T30_CONTROL_BIT_ENABLE_UNCOMPR;
-			t30->control_bits_low |= T30_CONTROL_BIT_ENABLE_2D_CODING;
-			t30->feature_bits_low |= T30_FEATURE_BIT_UNCOMPR_ENABLED;
-			t30->feature_bits_low |= T30_FEATURE_BIT_2D_CODING;
-			break;
-		case (3):	/* 2-D modified Read */
-			t30->control_bits_low |= T30_CONTROL_BIT_ENABLE_T6_CODING;
-			t30->control_bits_low |= T30_CONTROL_BIT_ENABLE_2D_CODING;
-			t30->control_bits_low |= T30_CONTROL_BIT_ENABLE_UNCOMPR;
-			t30->feature_bits_low |= T30_FEATURE_BIT_UNCOMPR_ENABLED;
-			t30->feature_bits_low |= T30_FEATURE_BIT_T6_CODING;
-			t30->feature_bits_low |= T30_FEATURE_BIT_2D_CODING;
-			t30->control_bits_low |= T30_CONTROL_BIT_ENABLE_ECM;
-			t30->feature_bits_low |= T30_FEATURE_BIT_ECM;
-			break;
-	  }
-	} else {
-		/* set compression to best */
-		t30->control_bits_low |= T30_CONTROL_BIT_ENABLE_T6_CODING;
-		t30->control_bits_low |= T30_CONTROL_BIT_ENABLE_2D_CODING;
-		t30->control_bits_low |= T30_CONTROL_BIT_ENABLE_UNCOMPR;
-		t30->feature_bits_low |= T30_FEATURE_BIT_UNCOMPR_ENABLED;
-		t30->feature_bits_low |= T30_FEATURE_BIT_T6_CODING;
-		t30->feature_bits_low |= T30_FEATURE_BIT_2D_CODING;
-		t30->control_bits_low |= T30_CONTROL_BIT_ENABLE_ECM;
-		t30->feature_bits_low |= T30_FEATURE_BIT_ECM;
-	}
-	switch(chan->fax->ecm) {
-		case (0):	/* disable ECM */
-			break;
-		case (1):
-			t30->control_bits_low |= T30_CONTROL_BIT_ENABLE_ECM;
-			t30->control_bits_low |= T30_CONTROL_BIT_ECM_64_BYTES;
-			t30->feature_bits_low |= T30_FEATURE_BIT_ECM;
-			t30->feature_bits_low |= T30_FEATURE_BIT_ECM_64_BYTES;
-			break;
-		case (2):
-			t30->control_bits_low |= T30_CONTROL_BIT_ENABLE_ECM;
-			t30->feature_bits_low |= T30_FEATURE_BIT_ECM;
-			break;
-	}
-
-	if (DebugVar & 128) {
-		char st[40];
-		eicon_log(NULL, 128, "sT30:code = %x\n", t30->code);
-		eicon_log(NULL, 128, "sT30:rate = %x\n", t30->rate);
-		eicon_log(NULL, 128, "sT30:res  = %x\n", t30->resolution);
-		eicon_log(NULL, 128, "sT30:format = %x\n", t30->format);
-		eicon_log(NULL, 128, "sT30:pages_low = %x\n", t30->pages_low);
-		eicon_log(NULL, 128, "sT30:pages_high = %x\n", t30->pages_high);
-		eicon_log(NULL, 128, "sT30:atf  = %x\n", t30->atf);
-		eicon_log(NULL, 128, "sT30:control_bits_low = %x\n", t30->control_bits_low);
-		eicon_log(NULL, 128, "sT30:control_bits_high = %x\n", t30->control_bits_high);
-		eicon_log(NULL, 128, "sT30:feature_bits_low = %x\n", t30->feature_bits_low);
-		eicon_log(NULL, 128, "sT30:feature_bits_high = %x\n", t30->feature_bits_high);
-		//eicon_log(NULL, 128, "sT30:universal_5 = %x\n", t30->universal_5);
-		//eicon_log(NULL, 128, "sT30:universal_6 = %x\n", t30->universal_6);
-		//eicon_log(NULL, 128, "sT30:universal_7 = %x\n", t30->universal_7);
-		eicon_log(NULL, 128, "sT30:station_id_len = %x\n", t30->station_id_len);
-		eicon_log(NULL, 128, "sT30:head_line_len = %x\n", t30->head_line_len);
-		strlcpy(st, t30->station_id, t30->station_id_len + 1);
-		eicon_log(NULL, 128, "sT30:station_id = <%s>\n", st);
-	}
-	return(sizeof(eicon_t30_s));
-}
-
-/* send fax struct */
-int
-idi_send_edata(eicon_card *card, eicon_chan *chan)
-{
-	struct sk_buff *skb;
-	struct sk_buff *skb2;
-	eicon_REQ *reqbuf;
-	eicon_chan_ptr *chan2;
-
-	if ((chan->fsm_state == EICON_STATE_NULL) || (chan->fsm_state == EICON_STATE_LISTEN)) {
-		eicon_log(card, 1, "idi_snd: Ch%d: send edata on state %d !\n", chan->No, chan->fsm_state);
-		return -ENODEV;
-	}
-	eicon_log(card, 128, "idi_snd: Ch%d: edata (fax)\n", chan->No);
-
-	skb = alloc_skb(sizeof(eicon_REQ) + sizeof(eicon_t30_s), GFP_ATOMIC);
-	skb2 = alloc_skb(sizeof(eicon_chan_ptr), GFP_ATOMIC);
-
-	if ((!skb) || (!skb2)) {
-		eicon_log(card, 1, "idi_err: Ch%d: alloc_skb failed in send_edata()\n", chan->No);
-		if (skb) 
-			dev_kfree_skb(skb);
-		if (skb2) 
-			dev_kfree_skb(skb2);
-		return -ENOMEM;
-	}
-
-	chan2 = (eicon_chan_ptr *)skb_put(skb2, sizeof(eicon_chan_ptr));
-	chan2->ptr = chan;
-
-	reqbuf = (eicon_REQ *)skb_put(skb, sizeof(eicon_t30_s) + sizeof(eicon_REQ));
-
-	reqbuf->Req = N_EDATA;
-	reqbuf->ReqCh = chan->e.IndCh;
-	reqbuf->ReqId = 1;
-
-	reqbuf->XBuffer.length = idi_fill_in_T30(chan, reqbuf->XBuffer.P);
-	reqbuf->Reference = 1; /* Net Entity */
-
-	skb_queue_tail(&chan->e.X, skb);
-	skb_queue_tail(&card->sndq, skb2);
-	eicon_schedule_tx(card);
-	return (0);
-}
-
-void
-idi_parse_edata(eicon_card *ccard, eicon_chan *chan, unsigned char *buffer, int len)
-{
-	eicon_t30_s *p = (eicon_t30_s *)buffer;
-	int i;
-
-	if (DebugVar & 128) {
-		char st[40];
-		eicon_log(ccard, 128, "rT30:len %d , size %d\n", len, sizeof(eicon_t30_s));
-		eicon_log(ccard, 128, "rT30:code = %x\n", p->code);
-		eicon_log(ccard, 128, "rT30:rate = %x\n", p->rate);
-		eicon_log(ccard, 128, "rT30:res  = %x\n", p->resolution);
-		eicon_log(ccard, 128, "rT30:format = %x\n", p->format);
-		eicon_log(ccard, 128, "rT30:pages_low = %x\n", p->pages_low);
-		eicon_log(ccard, 128, "rT30:pages_high = %x\n", p->pages_high);
-		eicon_log(ccard, 128, "rT30:atf  = %x\n", p->atf);
-		eicon_log(ccard, 128, "rT30:control_bits_low = %x\n", p->control_bits_low);
-		eicon_log(ccard, 128, "rT30:control_bits_high = %x\n", p->control_bits_high);
-		eicon_log(ccard, 128, "rT30:feature_bits_low = %x\n", p->feature_bits_low);
-		eicon_log(ccard, 128, "rT30:feature_bits_high = %x\n", p->feature_bits_high);
-		//eicon_log(ccard, 128, "rT30:universal_5 = %x\n", p->universal_5);
-		//eicon_log(ccard, 128, "rT30:universal_6 = %x\n", p->universal_6);
-		//eicon_log(ccard, 128, "rT30:universal_7 = %x\n", p->universal_7);
-		eicon_log(ccard, 128, "rT30:station_id_len = %x\n", p->station_id_len);
-		eicon_log(ccard, 128, "rT30:head_line_len = %x\n", p->head_line_len);
-		strlcpy(st, p->station_id, p->station_id_len + 1);
-		eicon_log(ccard, 128, "rT30:station_id = <%s>\n", st);
-	}
-	if (!chan->fax) {
-		eicon_log(ccard, 1, "idi_edata: parse to NULL fax struct, ERROR\n");
-		return;
-	}
-	chan->fax->code = p->code;
-	i = (p->station_id_len < FAXIDLEN) ? p->station_id_len : (FAXIDLEN - 1);
-	memcpy(chan->fax->r_id, p->station_id, i);
-	chan->fax->r_id[i] = 0;
-	chan->fax->r_resolution = p->resolution;
-	chan->fax->r_rate = p->rate - 1;
-	chan->fax->r_binary = 0; /* no binary support */
-	chan->fax->r_width = 0;
-	chan->fax->r_length = 2;
-	chan->fax->r_scantime = 0;
-	chan->fax->r_compression = 0;
-	chan->fax->r_ecm = 0;
-	if (p->feature_bits_low & T30_FEATURE_BIT_2D_CODING) {
-		chan->fax->r_compression = 1;
-		if (p->feature_bits_low & T30_FEATURE_BIT_UNCOMPR_ENABLED) {
-			chan->fax->r_compression = 2;
-		}
-	}
-	if (p->feature_bits_low & T30_FEATURE_BIT_T6_CODING) {
-		chan->fax->r_compression = 3;
-	}
-
-	if (p->feature_bits_low & T30_FEATURE_BIT_ECM) {
-		chan->fax->r_ecm = 2;
-		if (p->feature_bits_low & T30_FEATURE_BIT_ECM_64_BYTES)
-			chan->fax->r_ecm = 1;
-	}
-}
-
-void
-idi_fax_send_header(eicon_card *card, eicon_chan *chan, int header)
-{
-	static __u16 wd2sff[] = {
-		1728, 2048, 2432, 1216, 864
-	};
-	static __u16 ln2sff[2][3] = {
-		{ 1143, 1401, 0 } , { 2287, 2802, 0 }
-	};
-	struct sk_buff *skb;
-	eicon_sff_dochead *doc;
-	eicon_sff_pagehead *page;
-	u_char *docp;
-
-	if (!chan->fax) {
-		eicon_log(card, 1, "idi_fax: send head with NULL fax struct, ERROR\n");
-		return;
-	}
-	if (header == 2) { /* DocHeader + PageHeader */
-		skb = alloc_skb(sizeof(eicon_sff_dochead) + sizeof(eicon_sff_pagehead), GFP_ATOMIC);
-	} else {
-		skb = alloc_skb(sizeof(eicon_sff_pagehead), GFP_ATOMIC);
-	}
-	if (!skb) {
-		eicon_log(card, 1, "idi_err: Ch%d: alloc_skb failed in fax_send_header()\n", chan->No);
-		return;
-	}
-
-	if (header == 2) { /* DocHeader + PageHeader */
-		docp = skb_put(skb, sizeof(eicon_sff_dochead) + sizeof(eicon_sff_pagehead));
-		doc = (eicon_sff_dochead *) docp;
-		page = (eicon_sff_pagehead *) (docp + sizeof(eicon_sff_dochead));
-		memset(docp, 0,sizeof(eicon_sff_dochead)  + sizeof(eicon_sff_pagehead));
-		doc->id = 0x66666653;
-		doc->version = 0x01;
-		doc->off1pagehead = sizeof(eicon_sff_dochead);
-	} else {
-		page = (eicon_sff_pagehead *)skb_put(skb, sizeof(eicon_sff_pagehead));
-		memset(page, 0, sizeof(eicon_sff_pagehead));
-	}
-
-	switch(header) {
-		case 1:	/* PageHeaderEnd */
-			page->pageheadid = 254;
-			page->pageheadlen = 0; 
-			break;
-		case 0: /* PageHeader */
-		case 2: /* DocHeader + PageHeader */
-			page->pageheadid = 254;
-			page->pageheadlen = sizeof(eicon_sff_pagehead) - 2;
-			page->resvert = chan->fax->resolution;
-			page->reshoriz = 0; /* always 203 dpi */
-			page->coding = 0; /* always 1D */
-			page->linelength = wd2sff[chan->fax->width];
-			page->pagelength = ln2sff[chan->fax->resolution][chan->fax->length]; 
-			eicon_log(card, 128, "sSFF-Head: linelength = %d\n", page->linelength);
-			eicon_log(card, 128, "sSFF-Head: pagelength = %d\n", page->pagelength);
-			break;
-	}
-	idi_send_data(card, chan, 0, skb, 0, 0);
-}
-
-void
-idi_fax_cmd(eicon_card *card, eicon_chan *chan) 
-{
-	isdn_ctrl cmd;
-
-	if ((!card) || (!chan))
-		return;
-
-	if (!chan->fax) {
-		eicon_log(card, 1, "idi_fax: cmd with NULL fax struct, ERROR\n");
-		return;
-	}
-	switch (chan->fax->code) {
-		case ISDN_TTY_FAX_DT:
-			if (chan->fax->phase == ISDN_FAX_PHASE_B) {
-				idi_send_edata(card, chan);
-				break;
-			}
-			if (chan->fax->phase == ISDN_FAX_PHASE_D) {
-				idi_send_edata(card, chan);
-				break;
-			}
-			break;
-
-		case ISDN_TTY_FAX_DR:
-			if (chan->fax->phase == ISDN_FAX_PHASE_B) {
-				idi_send_edata(card, chan);
-
-				cmd.driver = card->myid;
-				cmd.command = ISDN_STAT_FAXIND;
-				cmd.arg = chan->No;
-				chan->fax->r_code = ISDN_TTY_FAX_CFR;
-				card->interface.statcallb(&cmd);
-
-				cmd.driver = card->myid;
-				cmd.command = ISDN_STAT_FAXIND;
-				cmd.arg = chan->No;
-				chan->fax->r_code = ISDN_TTY_FAX_RID;
-				card->interface.statcallb(&cmd);
-
-				/* telling 1-D compression */
-				chan->fax->r_compression = 0;
-				cmd.driver = card->myid;
-				cmd.command = ISDN_STAT_FAXIND;
-				cmd.arg = chan->No;
-				chan->fax->r_code = ISDN_TTY_FAX_DCS;
-				card->interface.statcallb(&cmd);
-
-				chan->fax2.NextObject = FAX_OBJECT_DOCU;
-				chan->fax2.PrevObject = FAX_OBJECT_DOCU;
-
-				break;
-			}
-			if (chan->fax->phase == ISDN_FAX_PHASE_D) {
-				idi_send_edata(card, chan);
-				break;
-			}
-			break;
-
-		case ISDN_TTY_FAX_ET:
-				switch(chan->fax->fet) {
-					case 0:
-					case 1:
-						idi_fax_send_header(card, chan, 0);
-						break;
-					case 2:
-						idi_fax_send_header(card, chan, 1);
-						break;
-				}
-			break;
-	}
-}
-
-void
-idi_edata_rcveop(eicon_card *card, eicon_chan *chan)
-{
-	isdn_ctrl cmd;
-
-	if (!chan->fax) {
-		eicon_log(card, 1, "idi_edata: rcveop with NULL fax struct, ERROR\n");
-		return;
-	}
-	cmd.driver = card->myid;
-	cmd.command = ISDN_STAT_FAXIND;
-	cmd.arg = chan->No;
-	chan->fax->r_code = ISDN_TTY_FAX_ET;
-	card->interface.statcallb(&cmd);
-}
-
-void
-idi_reset_fax_stat(eicon_chan *chan)
-{
-	chan->fax2.LineLen = 0;
-	chan->fax2.LineData = 0;
-	chan->fax2.LineDataLen = 0;
-	chan->fax2.NullByteExist = 0;
-	chan->fax2.Dle = 0;
-	chan->fax2.PageCount = 0;
-	chan->fax2.Eop = 0;
-}
-
-void
-idi_edata_action(eicon_card *ccard, eicon_chan *chan, char *buffer, int len)
-{
-	isdn_ctrl cmd;
-
-	if (!chan->fax) {
-		eicon_log(ccard, 1, "idi_edata: action with NULL fax struct, ERROR\n");
-		return;
-	}
-	if (chan->fax->direction == ISDN_TTY_FAX_CONN_OUT) {
-		idi_parse_edata(ccard, chan, buffer, len);
-
-		if (chan->fax->phase == ISDN_FAX_PHASE_A) {
-			idi_reset_fax_stat(chan);
-
-			chan->fsm_state = EICON_STATE_ACTIVE;
-			cmd.driver = ccard->myid;
-			cmd.command = ISDN_STAT_BCONN;
-			cmd.arg = chan->No;
-			strcpy(cmd.parm.num, "");
-			ccard->interface.statcallb(&cmd);
-
-			cmd.driver = ccard->myid;
-			cmd.command = ISDN_STAT_FAXIND;
-			cmd.arg = chan->No;
-			chan->fax->r_code = ISDN_TTY_FAX_FCON;
-			ccard->interface.statcallb(&cmd);
-
-			cmd.driver = ccard->myid;
-			cmd.command = ISDN_STAT_FAXIND;
-			cmd.arg = chan->No;
-			chan->fax->r_code = ISDN_TTY_FAX_RID;
-			ccard->interface.statcallb(&cmd);
-
-			cmd.driver = ccard->myid;
-			cmd.command = ISDN_STAT_FAXIND;
-			cmd.arg = chan->No;
-			chan->fax->r_code = ISDN_TTY_FAX_DIS;
-			ccard->interface.statcallb(&cmd);
-
-			if (chan->fax->r_compression != 0) {
-			/* telling fake compression in second DIS message */
-				chan->fax->r_compression = 0;
-				cmd.driver = ccard->myid;
-				cmd.command = ISDN_STAT_FAXIND;
-				cmd.arg = chan->No;
-				chan->fax->r_code = ISDN_TTY_FAX_DIS;
-				ccard->interface.statcallb(&cmd);
-			}
-
-			cmd.driver = ccard->myid;
-			cmd.command = ISDN_STAT_FAXIND;
-			cmd.arg = chan->No;
-			chan->fax->r_code = ISDN_TTY_FAX_SENT; /* OK message */
-			ccard->interface.statcallb(&cmd);
-		} else
-		if (chan->fax->phase == ISDN_FAX_PHASE_D) {
-
-			if ((chan->fax->code == EDATA_T30_MCF) &&
-			    (chan->fax->fet != 2)) {
-				cmd.driver = ccard->myid;
-				cmd.command = ISDN_STAT_FAXIND;
-				cmd.arg = chan->No;
-				chan->fax->r_code = ISDN_TTY_FAX_PTS;
-				ccard->interface.statcallb(&cmd);
-			}
-
-			switch(chan->fax->fet) {
-				case 0:	/* new page */
-					/* stay in phase D , wait on cmd +FDT */
-					break;
-				case 1:	/* new document */
-					/* link-level switch to phase B */
-					break;
-				case 2:	/* session end */
-				default:
-					/* send_edata produces error on some */
-					/* fax-machines here, so we don't */
-					/* idi_send_edata(ccard, chan); */
-					break;
-			}
-		}
-	}
-
-	if (chan->fax->direction == ISDN_TTY_FAX_CONN_IN) {
-		idi_parse_edata(ccard, chan, buffer, len);
-
-		if ((chan->fax->code == EDATA_T30_DCS) &&
-		    (chan->fax->phase == ISDN_FAX_PHASE_A)) {
-			idi_reset_fax_stat(chan);
-
-			cmd.driver = ccard->myid;
-			cmd.command = ISDN_STAT_BCONN;
-			cmd.arg = chan->No;
-			strcpy(cmd.parm.num, "");
-			ccard->interface.statcallb(&cmd);
-
-			cmd.driver = ccard->myid;
-			cmd.command = ISDN_STAT_FAXIND;
-			cmd.arg = chan->No;
-			chan->fax->r_code = ISDN_TTY_FAX_FCON_I;
-			ccard->interface.statcallb(&cmd);
-		} else
-		if ((chan->fax->code == EDATA_T30_TRAIN_OK) &&
-		    (chan->fax->phase == ISDN_FAX_PHASE_A)) {
-			cmd.driver = ccard->myid;
-			cmd.command = ISDN_STAT_FAXIND;
-			cmd.arg = chan->No;
-			chan->fax->r_code = ISDN_TTY_FAX_RID;
-			ccard->interface.statcallb(&cmd);
-
-			cmd.driver = ccard->myid;
-			cmd.command = ISDN_STAT_FAXIND;
-			cmd.arg = chan->No;
-			chan->fax->r_code = ISDN_TTY_FAX_TRAIN_OK;
-			ccard->interface.statcallb(&cmd);
-		} else
-		if ((chan->fax->code == EDATA_T30_TRAIN_OK) &&
-		    (chan->fax->phase == ISDN_FAX_PHASE_B)) {
-			cmd.driver = ccard->myid;
-			cmd.command = ISDN_STAT_FAXIND;
-			cmd.arg = chan->No;
-			chan->fax->r_code = ISDN_TTY_FAX_TRAIN_OK;
-			ccard->interface.statcallb(&cmd);
-		} else
-		if (chan->fax->phase == ISDN_FAX_PHASE_C) {
-			switch(chan->fax->code) {
-				case EDATA_T30_TRAIN_OK:
-					idi_send_edata(ccard, chan);
-					break;
-				case EDATA_T30_MPS:
-					chan->fax->fet = 0;
-					idi_edata_rcveop(ccard, chan);
-					break;
-				case EDATA_T30_EOM:
-					chan->fax->fet = 1;
-					idi_edata_rcveop(ccard, chan);
-					break;
-				case EDATA_T30_EOP:
-					chan->fax->fet = 2;
-					idi_edata_rcveop(ccard, chan);
-					break;
-			}
-		}
-	}
-}
-
-void
-fax_put_rcv(eicon_card *ccard, eicon_chan *chan, u_char *Data, int len)
-{
-	struct sk_buff *skb;
-	
-        skb = alloc_skb(len + MAX_HEADER_LEN, GFP_ATOMIC);
-	if (!skb) {
-		eicon_log(ccard, 1, "idi_err: Ch%d: alloc_skb failed in fax_put_rcv()\n", chan->No);
-		return;
-	}
-	skb_reserve(skb, MAX_HEADER_LEN);
-	memcpy(skb_put(skb, len), Data, len);
-	ccard->interface.rcvcallb_skb(ccard->myid, chan->No, skb);
-}
-
-void
-idi_faxdata_rcv(eicon_card *ccard, eicon_chan *chan, struct sk_buff *skb)
-{
-	eicon_OBJBUFFER InBuf;
-	eicon_OBJBUFFER LineBuf;
-	unsigned int Length = 0;
-	unsigned int aLength = 0;
-	unsigned int ObjectSize = 0;
-	unsigned int ObjHeadLen = 0;
-	unsigned int ObjDataLen = 0;
-	__u8 Recordtype;
-	__u8 PageHeaderLen;	
-	__u8 Event;
-	eicon_sff_pagehead *ob_page;
-
-	__u16 Cl2Eol = 0x8000;
-
-#	define EVENT_NONE	0
-#	define EVENT_NEEDDATA	1
-
-	if (!chan->fax) {
-		eicon_log(ccard, 1, "idi_fax: rcvdata with NULL fax struct, ERROR\n");
-		return;
-	}
-
-
-	
-	if (chan->fax->direction == ISDN_TTY_FAX_CONN_IN) {
-		InBuf.Data = skb->data;
-		InBuf.Size = skb->len;
-		InBuf.Len  = 0;
-		InBuf.Next = InBuf.Data;
-		LineBuf.Data = chan->fax2.abLine;
-		LineBuf.Size = sizeof(chan->fax2.abLine);
-		LineBuf.Len  = chan->fax2.LineLen;
-		LineBuf.Next = LineBuf.Data + LineBuf.Len;
-
-		Event = EVENT_NONE;
-		while (Event == EVENT_NONE) {
-			switch(chan->fax2.NextObject) {
-				case FAX_OBJECT_DOCU:
-						Length = LineBuf.Len + (InBuf.Size - InBuf.Len);
-						if (Length < sizeof(eicon_sff_dochead)) {
-							Event = EVENT_NEEDDATA;
-							break;
-						}
-						ObjectSize = sizeof(eicon_sff_dochead);
-						Length = ObjectSize;
-						if (LineBuf.Len < Length) {
-							Length -= LineBuf.Len;
-							LineBuf.Len = 0;
-							LineBuf.Next = LineBuf.Data;
-							InBuf.Len += Length;
-							InBuf.Next += Length;
-						} else {
-							LineBuf.Len -= Length;
-							LineBuf.Next = LineBuf.Data + LineBuf.Len;
-							memmove(LineBuf.Data, LineBuf.Data + Length, LineBuf.Len);
-						}
-						chan->fax2.PrevObject = FAX_OBJECT_DOCU;
-						chan->fax2.NextObject = FAX_OBJECT_PAGE;
-					break;
-
-				case FAX_OBJECT_PAGE:
-						Length = LineBuf.Len + (InBuf.Size - InBuf.Len);
-						if (Length < 2) {
-							Event = EVENT_NEEDDATA;
-							break;
-						}
-						if (LineBuf.Len == 0) {
-							*LineBuf.Next++ = *InBuf.Next++;
-							LineBuf.Len++;
-							InBuf.Len++;
-						}
-						if (LineBuf.Len == 1) {
-							*LineBuf.Next++ = *InBuf.Next++;
-							LineBuf.Len++;
-							InBuf.Len++;
-						}
-						PageHeaderLen = *(LineBuf.Data + 1);
-						ObjectSize = (PageHeaderLen == 0) ? 2 : sizeof(eicon_sff_pagehead);
-						if (Length < ObjectSize) {
-							Event = EVENT_NEEDDATA;
-							break;
-						}
-						Length = ObjectSize;
-						/* extract page dimensions */
-						if (LineBuf.Len < Length) {
-							aLength = Length - LineBuf.Len;
-							memcpy(LineBuf.Next, InBuf.Next, aLength);
-							LineBuf.Next += aLength;
-							InBuf.Next += aLength;
-							LineBuf.Len += aLength;
-							InBuf.Len += aLength;
-						}
-						if (Length > 2) {
-							ob_page = (eicon_sff_pagehead *)LineBuf.Data;
-							switch(ob_page->linelength) {
-								case 2048:
-									chan->fax->r_width = 1;
-									break;
-								case 2432:
-									chan->fax->r_width = 2;
-									break;
-								case 1216:
-									chan->fax->r_width = 3;
-									break;
-								case 864:
-									chan->fax->r_width = 4;
-									break;
-								case 1728:
-								default:
-									chan->fax->r_width = 0;
-							}
-							switch(ob_page->pagelength) {
-								case 1143:
-								case 2287:
-									chan->fax->r_length = 0;
-									break;
-								case 1401:
-								case 2802:
-									chan->fax->r_length = 1;
-									break;
-								default:
-									chan->fax->r_length = 2;
-							}
-							eicon_log(ccard, 128, "rSFF-Head: linelength = %d\n", ob_page->linelength);
-							eicon_log(ccard, 128, "rSFF-Head: pagelength = %d\n", ob_page->pagelength);
-						}
-						LineBuf.Len -= Length;
-						LineBuf.Next = LineBuf.Data + LineBuf.Len;
-						memmove(LineBuf.Data, LineBuf.Data + Length, LineBuf.Len);
-
-						chan->fax2.PrevObject = FAX_OBJECT_PAGE;
-						chan->fax2.NextObject = FAX_OBJECT_LINE;
-					break;
-
-				case FAX_OBJECT_LINE:
-						Length = LineBuf.Len + (InBuf.Size - InBuf.Len);
-						if (Length < 1) {
-							Event = EVENT_NEEDDATA;
-							break;
-						}
-						if (LineBuf.Len == 0) {
-							*LineBuf.Next++ = *InBuf.Next++;
-							LineBuf.Len++;
-							InBuf.Len++;
-						}
-						Recordtype = *LineBuf.Data;
-						if (Recordtype == 0) {
-							/* recordtype pixel row (2 byte length) */
-							ObjHeadLen = 3;
-							if (Length < ObjHeadLen) {
-								Event = EVENT_NEEDDATA;
-								break;
-							}
-							while (LineBuf.Len < ObjHeadLen) {
-								*LineBuf.Next++ = *InBuf.Next++;
-								LineBuf.Len++;
-								InBuf.Len++;
-							}
-							ObjDataLen = *((__u16*) (LineBuf.Data + 1));
-							ObjectSize = ObjHeadLen + ObjDataLen;
-							if (Length < ObjectSize) {
-								Event = EVENT_NEEDDATA;
-								break;
-							}
-						} else
-						if ((Recordtype >= 1) && (Recordtype <= 216)) {
-							/* recordtype pixel row (1 byte length) */
-							ObjHeadLen = 1;
-							ObjDataLen = Recordtype;
-							ObjectSize = ObjHeadLen + ObjDataLen;
-							if (Length < ObjectSize) {
-								Event = EVENT_NEEDDATA;
-								break;
-							}
-						} else
-						if ((Recordtype >= 217) && (Recordtype <= 253)) {
-							/* recordtype empty lines */
-							ObjHeadLen = 1;
-							ObjDataLen = 0;
-							ObjectSize = ObjHeadLen + ObjDataLen;
-							LineBuf.Len--;
-							LineBuf.Next = LineBuf.Data + LineBuf.Len;
-							memmove(LineBuf.Data, LineBuf.Data + 1, LineBuf.Len);
-							break;
-						} else
-						if (Recordtype == 254) {
-							/* recordtype page header */
-							chan->fax2.PrevObject = FAX_OBJECT_LINE;
-							chan->fax2.NextObject = FAX_OBJECT_PAGE;
-							break;
-						} else {
-							/* recordtype user information */
-							ObjHeadLen = 2;
-							if (Length < ObjHeadLen) {
-								Event = EVENT_NEEDDATA;
-								break;
-							}
-							while (LineBuf.Len < ObjHeadLen) {
-								*LineBuf.Next++ = *InBuf.Next++;
-								LineBuf.Len++;
-								InBuf.Len++;
-							}
-							ObjDataLen = *(LineBuf.Data + 1);
-							ObjectSize = ObjHeadLen + ObjDataLen;
-							if (ObjDataLen == 0) {
-								/* illegal line coding */
-								LineBuf.Len -= ObjHeadLen;
-								LineBuf.Next = LineBuf.Data + LineBuf.Len;
-								memmove(LineBuf.Data, LineBuf.Data + ObjHeadLen, LineBuf.Len);
-								break;
-							} else {
-								/* user information */
-								if (Length < ObjectSize) {
-									Event = EVENT_NEEDDATA;
-									break;
-								}
-								Length = ObjectSize;
-								if (LineBuf.Len < Length) {
-									Length -= LineBuf.Len;
-									LineBuf.Len = 0;
-									LineBuf.Next = LineBuf.Data;
-									InBuf.Len += Length;
-									InBuf.Next += Length;
-								} else {
-									LineBuf.Len -= Length;
-									LineBuf.Next = LineBuf.Data + LineBuf.Len;
-									memmove(LineBuf.Data, LineBuf.Data + Length, LineBuf.Len);
-								}
-							}
-							break;	
-						}
-						Length = ObjectSize;
-						if (LineBuf.Len > ObjHeadLen) {
-							fax_put_rcv(ccard, chan, LineBuf.Data + ObjHeadLen,
-									(LineBuf.Len - ObjHeadLen));
-						}
-						Length -= LineBuf.Len;
-						LineBuf.Len = 0;
-						LineBuf.Next = LineBuf.Data;
-						if (Length > 0) {
-							fax_put_rcv(ccard, chan, InBuf.Next, Length);
-							InBuf.Len += Length;
-							InBuf.Next += Length;
-						}
-						fax_put_rcv(ccard, chan, (__u8 *)&Cl2Eol, sizeof(Cl2Eol));
-					break;
-			} /* end of switch (chan->fax2.NextObject) */
-		} /* end of while (Event==EVENT_NONE) */
-		if (InBuf.Len < InBuf.Size) {
-			Length = InBuf.Size - InBuf.Len;
-			if ((LineBuf.Len + Length) > LineBuf.Size) {
-				eicon_log(ccard, 1, "idi_fax: Ch%d: %d bytes dropping, small buffer\n", chan->No,
-					Length);
-				} else {
-					memcpy(LineBuf.Next, InBuf.Next, Length);
-					LineBuf.Len += Length;
-				}
-		}
-		chan->fax2.LineLen = LineBuf.Len;
-	} else { /* CONN_OUT */
-		/* On CONN_OUT we do not need incoming data, drop it */
-		/* maybe later for polling */
-	}
-
-#	undef EVENT_NONE
-#	undef EVENT_NEEDDATA
-
-	return;
-}
-
-int
-idi_fax_send_outbuf(eicon_card *ccard, eicon_chan *chan, eicon_OBJBUFFER *OutBuf)
-{
-	struct sk_buff *skb;
-
-	skb = alloc_skb(OutBuf->Len, GFP_ATOMIC);
-	if (!skb) {
-		eicon_log(ccard, 1, "idi_err: Ch%d: alloc_skb failed in fax_send_outbuf()\n", chan->No);
-		return(-1);
-	}
-	memcpy(skb_put(skb, OutBuf->Len), OutBuf->Data, OutBuf->Len);
-
-	OutBuf->Len = 0;
-	OutBuf->Next = OutBuf->Data;
-
-	return(idi_send_data(ccard, chan, 0, skb, 1, 0));
-}
-
-int
-idi_faxdata_send(eicon_card *ccard, eicon_chan *chan, struct sk_buff *skb)
-{
-	isdn_ctrl cmd;
-	eicon_OBJBUFFER InBuf;
-	__u8 InData;
-	__u8 InMask;
-	eicon_OBJBUFFER OutBuf;
-	eicon_OBJBUFFER LineBuf;
-	__u32 LineData;
-	unsigned int LineDataLen;
-	__u8 Byte;
-	__u8 Event;
-	int ret = 1;
-
-#	define EVENT_NONE	0
-#	define EVENT_EOD	1
-#	define EVENT_EOL 	2
-#	define EVENT_EOP 	3
-
-	if ((!ccard) || (!chan))
-		return -1;
-
-	if (!chan->fax) {
-		eicon_log(ccard, 1, "idi_fax: senddata with NULL fax struct, ERROR\n");
-		return -1;
-	}
-
-	if (chan->fax->direction == ISDN_TTY_FAX_CONN_IN) {
-		/* Simply ignore any data written in data mode when receiving a fax.    */
-		/* This is not completely correct because only XON's should come here.  */
-        	dev_kfree_skb(skb);
-		return 1;
-	}
-
-	if (chan->fax->phase != ISDN_FAX_PHASE_C) {
-        	dev_kfree_skb(skb);
-		return 1;
-	}
-
-        if (chan->queued + skb->len > 1200)
-                return 0;
-	if (chan->pqueued > 1)
-		return 0;
-
-	InBuf.Data = skb->data;
-	InBuf.Size = skb->len;
-	InBuf.Len  = 0;
-	InBuf.Next = InBuf.Data;
-	InData = 0;
-	InMask = 0;
-
-	LineBuf.Data = chan->fax2.abLine;
-	LineBuf.Size = sizeof(chan->fax2.abLine);
-	LineBuf.Len  = chan->fax2.LineLen;
-	LineBuf.Next = LineBuf.Data + LineBuf.Len;
-	LineData = chan->fax2.LineData;
-	LineDataLen = chan->fax2.LineDataLen;
-
-	OutBuf.Data = chan->fax2.abFrame;
-	OutBuf.Size = sizeof(chan->fax2.abFrame);
-	OutBuf.Len = 0;
-	OutBuf.Next = OutBuf.Data;
-
-	Event = EVENT_NONE;
-
-	chan->fax2.Eop = 0;
-
-	for (;;) {
-	  for (;;) {
-		if (InMask == 0) {
-			if (InBuf.Len >= InBuf.Size) {
-				Event = EVENT_EOD;
-				break;
-			}
-			if ((chan->fax2.Dle != _DLE_) && *InBuf.Next == _DLE_) {
-				chan->fax2.Dle = _DLE_;
-				InBuf.Next++;
-				InBuf.Len++;
-				if (InBuf.Len >= InBuf.Size) {
-					Event = EVENT_EOD;
-					break;
-				}
-			}
-			if (chan->fax2.Dle == _DLE_) {
-				chan->fax2.Dle = 0;
-				if (*InBuf.Next == _ETX_) {
-					Event = EVENT_EOP;
-					break;
-				} else
-				if (*InBuf.Next == _DLE_) {
-					/* do nothing */
-				} else {
-					eicon_log(ccard, 1,
-						"idi_err: Ch%d: unknown DLE escape %02x found\n",
-							chan->No, *InBuf.Next);
-					InBuf.Next++;
-					InBuf.Len++;
-					if (InBuf.Len >= InBuf.Size) {
-						Event = EVENT_EOD;
-						break;
-					}
-				}
-			}
-			InBuf.Len++;
-			InData = *InBuf.Next++;
-			InMask = (chan->fax->bor) ? 0x80 : 0x01;
-		}
-		while (InMask) {
-			LineData >>= 1;
-			LineDataLen++;
-			if (InData & InMask)
-				LineData |= 0x80000000;
-			if (chan->fax->bor)
-				InMask >>= 1;
-			else
-				InMask <<= 1;
-
-			if ((LineDataLen >= T4_EOL_BITSIZE) &&
-			   ((LineData & T4_EOL_MASK_DWORD) == T4_EOL_DWORD)) {
-				Event = EVENT_EOL;
-				if (LineDataLen > T4_EOL_BITSIZE) {
-					Byte = (__u8)
-						((LineData & ~T4_EOL_MASK_DWORD) >>
-						(32 - LineDataLen));
-					if (Byte == 0) {
-						if (! chan->fax2.NullByteExist) {
-							chan->fax2.NullBytesPos = LineBuf.Len;
-							chan->fax2.NullByteExist = 1;
-						}
-					} else {
-						chan->fax2.NullByteExist = 0;
-					}
-					if (LineBuf.Len < LineBuf.Size) {
-						*LineBuf.Next++  = Byte;
-						LineBuf.Len++;
-					}
-				}
-				LineDataLen = 0;
-				break;
-			}
-			if (LineDataLen >= T4_EOL_BITSIZE + 8) {
-				Byte = (__u8)
-					((LineData & ~T4_EOL_MASK_DWORD) >>
-					(32 - T4_EOL_BITSIZE - 8));
-				LineData &= T4_EOL_MASK_DWORD;
-				LineDataLen = T4_EOL_BITSIZE;
-				if (Byte == 0) {
-					if (! chan->fax2.NullByteExist) {
-						chan->fax2.NullBytesPos = LineBuf.Len;
-						chan->fax2.NullByteExist = 1;
-					}
-				} else {
-					chan->fax2.NullByteExist = 0;
-				}
-				if (LineBuf.Len < LineBuf.Size) {
-					*LineBuf.Next++  = Byte; 
-					LineBuf.Len++;
-				}
-			}
-		}
-		if (Event != EVENT_NONE)
-			break;
-	  }
-
-		if ((Event != EVENT_EOL) && (Event != EVENT_EOP))
-			break;
-
-		if ((Event == EVENT_EOP) && (LineDataLen > 0)) {
-			LineData >>= 32 - LineDataLen;
-			LineDataLen = 0;
-			while (LineData != 0) {
-				Byte = (__u8) LineData;
-				LineData >>= 8;
-				if (Byte == 0) {
-					if (! chan->fax2.NullByteExist) {
-						chan->fax2.NullBytesPos = LineBuf.Len;
-						chan->fax2.NullByteExist = 1;
-					}
-				} else {
-					chan->fax2.NullByteExist = 0;
-				}
-				if (LineBuf.Len < LineBuf.Size) {
-					*LineBuf.Next++  = Byte;
-					LineBuf.Len++;
-				}
-				
-			}
-		}
-		if (chan->fax2.NullByteExist) {
-			if (chan->fax2.NullBytesPos == 0) {
-				LineBuf.Len = 0;
-			} else {
-				LineBuf.Len = chan->fax2.NullBytesPos + 1;
-			}
-		}
-		if (LineBuf.Len > 0) {
-			if (OutBuf.Len + LineBuf.Len + SFF_LEN_FLD_SIZE > OutBuf.Size) {
-				ret = idi_fax_send_outbuf(ccard, chan, &OutBuf);
-			}
-			if (LineBuf.Len <= 216) {
-				*OutBuf.Next++ = (__u8) LineBuf.Len;
-				OutBuf.Len++;
-			} else {
-				*OutBuf.Next++ = 0;
-				*((__u16 *) OutBuf.Next)++ = (__u16) LineBuf.Len;
-				OutBuf.Len += 3;
-			}
-			memcpy(OutBuf.Next, LineBuf.Data, LineBuf.Len);
-			OutBuf.Next += LineBuf.Len;
-			OutBuf.Len  += LineBuf.Len;
-		}
-		LineBuf.Len = 0;
-		LineBuf.Next = LineBuf.Data;
-		chan->fax2.NullByteExist = 0;
-		if (Event == EVENT_EOP)
-			break;
-
-		Event = EVENT_NONE;
-	}
-
-	if (Event == EVENT_EOP) {
-		chan->fax2.Eop = 1;
-		chan->fax2.PageCount++;
-		cmd.driver = ccard->myid;
-		cmd.command = ISDN_STAT_FAXIND;
-		cmd.arg = chan->No;
-		chan->fax->r_code = ISDN_TTY_FAX_EOP;
-		ccard->interface.statcallb(&cmd);
-	}
-	if (OutBuf.Len > 0) {
-		ret = idi_fax_send_outbuf(ccard, chan, &OutBuf);
-	}
-
-	chan->fax2.LineLen = LineBuf.Len;
-	chan->fax2.LineData = LineData;
-	chan->fax2.LineDataLen = LineDataLen;
-
-#	undef EVENT_NONE
-#	undef EVENT_EOD
-#	undef EVENT_EOL
-#	undef EVENT_EOP
-
-	if (ret >= 0)
-	        dev_kfree_skb(skb);
-	if (ret == 0)
-		ret = 1;
-	return(ret);
-}
-
-void
-idi_fax_hangup(eicon_card *ccard, eicon_chan *chan)
-{
-	isdn_ctrl cmd;
-
-	if (!chan->fax) {
-		eicon_log(ccard, 1, "idi_fax: hangup with NULL fax struct, ERROR\n");
-		return;
-	}
-	if ((chan->fax->direction == ISDN_TTY_FAX_CONN_OUT) &&
-	    (chan->fax->code == 0)) {
-		cmd.driver = ccard->myid;
-		cmd.command = ISDN_STAT_FAXIND;
-		cmd.arg = chan->No;
-		chan->fax->r_code = ISDN_TTY_FAX_PTS;
-		ccard->interface.statcallb(&cmd);
-	}
-	if ((chan->fax->code > 1) && (chan->fax->code < 120))
-		chan->fax->code += 120;
-	eicon_log(ccard, 8, "idi_fax: Ch%d: Hangup (code=%d)\n", chan->No, chan->fax->code);
-	chan->fax->r_code = ISDN_TTY_FAX_HNG;
-	cmd.driver = ccard->myid;
-	cmd.command = ISDN_STAT_FAXIND;
-	cmd.arg = chan->No;
-	ccard->interface.statcallb(&cmd);
-}
-
-#endif	/******** FAX ********/
-
-int
-idi_send_udata(eicon_card *card, eicon_chan *chan, int UReq, u_char *buffer, int len)
-{
-	struct sk_buff *skb;
-	struct sk_buff *skb2;
-	eicon_REQ *reqbuf;
-	eicon_chan_ptr *chan2;
-
-	if ((chan->fsm_state == EICON_STATE_NULL) || (chan->fsm_state == EICON_STATE_LISTEN)) {
-		eicon_log(card, 1, "idi_snd: Ch%d: send udata on state %d !\n", chan->No, chan->fsm_state);
-		return -ENODEV;
-	}
-	eicon_log(card, 8, "idi_snd: Ch%d: udata 0x%x: %d %d %d %d\n", chan->No,
-			UReq, buffer[0], buffer[1], buffer[2], buffer[3]);
-
-	skb = alloc_skb(sizeof(eicon_REQ) + len + 1, GFP_ATOMIC);
-	skb2 = alloc_skb(sizeof(eicon_chan_ptr), GFP_ATOMIC);
-
-	if ((!skb) || (!skb2)) {
-		eicon_log(card, 1, "idi_err: Ch%d: alloc_skb failed in send_udata()\n", chan->No);
-		if (skb) 
-			dev_kfree_skb(skb);
-		if (skb2) 
-			dev_kfree_skb(skb2);
-		return -ENOMEM;
-	}
-
-	chan2 = (eicon_chan_ptr *)skb_put(skb2, sizeof(eicon_chan_ptr));
-	chan2->ptr = chan;
-
-	reqbuf = (eicon_REQ *)skb_put(skb, 1 + len + sizeof(eicon_REQ));
-
-	reqbuf->Req = N_UDATA;
-	reqbuf->ReqCh = chan->e.IndCh;
-	reqbuf->ReqId = 1;
-
-	reqbuf->XBuffer.length = len + 1;
-	reqbuf->XBuffer.P[0] = UReq;
-	memcpy(&reqbuf->XBuffer.P[1], buffer, len);
-	reqbuf->Reference = 1; /* Net Entity */
-
-	skb_queue_tail(&chan->e.X, skb);
-	skb_queue_tail(&card->sndq, skb2);
-	eicon_schedule_tx(card);
-	return (0);
-}
-
-void
-idi_audio_cmd(eicon_card *ccard, eicon_chan *chan, int cmd, u_char *value)
-{
-	u_char buf[6];
-	struct enable_dtmf_s *dtmf_buf = (struct enable_dtmf_s *)buf;
-
-	if ((!ccard) || (!chan))
-		return;
-
-	memset(buf, 0, 6);
-	switch(cmd) {
-		case ISDN_AUDIO_SETDD:
-			if (value[0]) {
-				dtmf_buf->tone = (__u16) (value[1] * 5);
-				dtmf_buf->gap = (__u16) (value[1] * 5);
-				idi_send_udata(ccard, chan,
-					DSP_UDATA_REQUEST_ENABLE_DTMF_RECEIVER,
-					buf, 4);
-			} else {
-				idi_send_udata(ccard, chan,
-					DSP_UDATA_REQUEST_DISABLE_DTMF_RECEIVER,
-					buf, 0);
-			}
-			break;
-	}
-}
-
-void
-idi_parse_udata(eicon_card *ccard, eicon_chan *chan, unsigned char *buffer, int len)
-{
-	isdn_ctrl cmd;
-	eicon_dsp_ind *p = (eicon_dsp_ind *) (&buffer[1]);
-        static char *connmsg[] =
-        {"", "V.21", "V.23", "V.22", "V.22bis", "V.32bis", "V.34",
-         "V.8", "Bell 212A", "Bell 103", "V.29 Leased", "V.33 Leased", "V.90",
-         "V.21 CH2", "V.27ter", "V.29", "V.33", "V.17", "V.32", "K56Flex",
-         "X2", "V.18", "V.18LH", "V.18HL", "V.21LH", "V.21HL",
-         "Bell 103LH", "Bell 103HL", "V.23", "V.23", "EDT 110",
-         "Baudot45", "Baudot47", "Baudot50", "DTMF" };
-	static u_char dtmf_code[] = {
-	'1','4','7','*','2','5','8','0','3','6','9','#','A','B','C','D'
-	};
-
-	if ((!ccard) || (!chan))
-		return;
-
-	switch (buffer[0]) {
-		case DSP_UDATA_INDICATION_SYNC:
-			eicon_log(ccard, 16, "idi_ind: Ch%d: UDATA_SYNC time %d\n", chan->No, p->time);
-			break;
-		case DSP_UDATA_INDICATION_DCD_OFF:
-			eicon_log(ccard, 8, "idi_ind: Ch%d: UDATA_DCD_OFF time %d\n", chan->No, p->time);
-			break;
-		case DSP_UDATA_INDICATION_DCD_ON:
-			if ((chan->l2prot == ISDN_PROTO_L2_MODEM) &&
-			    (chan->fsm_state == EICON_STATE_WMCONN)) {
-				chan->fsm_state = EICON_STATE_ACTIVE;
-				cmd.driver = ccard->myid;
-				cmd.command = ISDN_STAT_BCONN;
-				cmd.arg = chan->No;
-                                if (p->norm > 34) {
-                                  sprintf(cmd.parm.num, "%d/(%d)", p->speed, p->norm);
-                                } else {
-                                  sprintf(cmd.parm.num, "%d/%s", p->speed, connmsg[p->norm]);
-                                }
-				ccard->interface.statcallb(&cmd);
-			}
-			eicon_log(ccard, 8, "idi_ind: Ch%d: UDATA_DCD_ON time %d\n", chan->No, p->time);
-			eicon_log(ccard, 8, "idi_ind: Ch%d: %d %d %d %d\n", chan->No,
-				p->norm, p->options, p->speed, p->delay); 
-			break;
-		case DSP_UDATA_INDICATION_CTS_OFF:
-			eicon_log(ccard, 8, "idi_ind: Ch%d: UDATA_CTS_OFF time %d\n", chan->No, p->time);
-			break;
-		case DSP_UDATA_INDICATION_CTS_ON:
-			eicon_log(ccard, 8, "idi_ind: Ch%d: UDATA_CTS_ON time %d\n", chan->No, p->time);
-			eicon_log(ccard, 8, "idi_ind: Ch%d: %d %d %d %d\n", chan->No,
-				p->norm, p->options, p->speed, p->delay); 
-			break;
-		case DSP_UDATA_INDICATION_DISCONNECT:
-			eicon_log(ccard, 8, "idi_ind: Ch%d: UDATA_DISCONNECT cause %d\n", chan->No, buffer[1]);
-			break;
-		case DSP_UDATA_INDICATION_DTMF_DIGITS_RECEIVED:
-			eicon_log(ccard, 8, "idi_ind: Ch%d: UDATA_DTMF_REC '%c'\n", chan->No,
-				dtmf_code[buffer[1]]);
-			cmd.driver = ccard->myid;
-			cmd.command = ISDN_STAT_AUDIO;
-			cmd.parm.num[0] = ISDN_AUDIO_DTMF;
-			cmd.parm.num[1] = dtmf_code[buffer[1]];
-			cmd.arg = chan->No;
-			ccard->interface.statcallb(&cmd);
-			break;
-		default:
-			eicon_log(ccard, 8, "idi_ind: Ch%d: UNHANDLED UDATA Indication 0x%02x\n", chan->No, buffer[0]);
-	}
-}
-
-void
-eicon_parse_trace(eicon_card *ccard, unsigned char *buffer, int len)
-{
-	int i,j,n;
-	int buflen = len * 3 + 30;
-	char *p;
-	struct trace_s {
-		unsigned long time;
-		unsigned short size;
-		unsigned short code;
-		unsigned char data[1];
-	} *q;
-
-	if (!(p = kmalloc(buflen, GFP_ATOMIC))) {
-		eicon_log(ccard, 1, "idi_err: Ch??: could not allocate trace buffer\n");
-		return;
-	}
-	memset(p, 0, buflen);
-	q = (struct trace_s *)buffer;
-
-	if (DebugVar & 512) {
-		if ((q->code == 3) || (q->code == 4)) {
-			n = (short) *(q->data);
-			if (n) {
-				j = sprintf(p, "DTRC:");
-				for (i = 0; i < n; i++) {
-					j += sprintf(p + j, "%02x ", q->data[i+2]);
-				}
-				j += sprintf(p + j, "\n");
-			}
-		}
-	} else {
-		j = sprintf(p, "XLOG: %lx %04x %04x ",
-			q->time, q->size, q->code);
-
-		for (i = 0; i < q->size; i++) {
-			j += sprintf(p + j, "%02x ", q->data[i]);
-		}
-		j += sprintf(p + j, "\n");
-	}
-	if (strlen(p))
-		eicon_putstatus(ccard, p);
-	kfree(p);
-}
-
-void
-idi_handle_ind(eicon_card *ccard, struct sk_buff *skb)
-{
-	int tmp;
-	char tnum[64];
-	int dlev;
-	int free_buff;
-	ulong flags;
-	struct sk_buff *skb2;
-        eicon_IND *ind = (eicon_IND *)skb->data;
-	eicon_chan *chan;
-	idi_ind_message message;
-	isdn_ctrl cmd;
-
-	if (!ccard) {
-		eicon_log(ccard, 1, "idi_err: Ch??: null card in handle_ind\n");
-  		dev_kfree_skb(skb);
-		return;
-	}
-
-	if ((chan = ccard->IdTable[ind->IndId]) == NULL) {
-		eicon_log(ccard, 1, "idi_err: Ch??: null chan in handle_ind\n");
-  		dev_kfree_skb(skb);
-		return;
-	}
-	
-	if ((ind->Ind != 8) && (ind->Ind != 0xc))
-		dlev = 144;
-	else
-		dlev = 128;
-
-       	eicon_log(ccard, dlev, "idi_hdl: Ch%d: Ind=%x Id=%x Ch=%x MInd=%x MLen=%x Len=%x\n", chan->No,
-	        ind->Ind,ind->IndId,ind->IndCh,ind->MInd,ind->MLength,ind->RBuffer.length);
-
-	free_buff = 1;
-	/* Signal Layer */
-	if (chan->e.D3Id == ind->IndId) {
-		idi_IndParse(ccard, chan, &message, ind->RBuffer.P, ind->RBuffer.length);
-		switch(ind->Ind) {
-			case HANGUP:
-				eicon_log(ccard, 8, "idi_ind: Ch%d: Hangup\n", chan->No);
-		                while((skb2 = skb_dequeue(&chan->e.X))) {
-					dev_kfree_skb(skb2);
-				}
-				spin_lock_irqsave(&eicon_lock, flags);
-				chan->queued = 0;
-				chan->pqueued = 0;
-				chan->waitq = 0;
-				chan->waitpq = 0;
-				spin_unlock_irqrestore(&eicon_lock, flags);
-				if (message.e_cau[0] & 0x7f) {
-					cmd.driver = ccard->myid;
-					cmd.arg = chan->No;
-					sprintf(cmd.parm.num,"E%02x%02x", 
-						chan->cause[0]&0x7f, message.e_cau[0]&0x7f); 
-					cmd.command = ISDN_STAT_CAUSE;
-					ccard->interface.statcallb(&cmd);
-				}
-				chan->cause[0] = 0; 
-				if (((chan->fsm_state == EICON_STATE_ACTIVE) ||
-				    (chan->fsm_state == EICON_STATE_WMCONN)) ||
-				    ((chan->l2prot == ISDN_PROTO_L2_FAX) &&
-				    (chan->fsm_state == EICON_STATE_OBWAIT))) {
-					chan->fsm_state = EICON_STATE_NULL;
-				} else {
-					if (chan->e.B2Id)
-						idi_do_req(ccard, chan, REMOVE, 1);
-					chan->statectrl &= ~WAITING_FOR_HANGUP;
-					chan->statectrl &= ~IN_HOLD;
-					if (chan->statectrl & HAVE_CONN_REQ) {
-						eicon_log(ccard, 32, "idi_req: Ch%d: queueing delayed conn_req\n", chan->No);
-						chan->statectrl &= ~HAVE_CONN_REQ;
-						if ((chan->tskb1) && (chan->tskb2)) {
-							skb_queue_tail(&chan->e.X, chan->tskb1);
-							skb_queue_tail(&ccard->sndq, chan->tskb2); 
-							eicon_schedule_tx(ccard);
-						}
-						chan->tskb1 = NULL;
-						chan->tskb2 = NULL;
-					} else {
-						chan->fsm_state = EICON_STATE_NULL;
-						cmd.driver = ccard->myid;
-						cmd.arg = chan->No;
-						cmd.command = ISDN_STAT_DHUP;
-						ccard->interface.statcallb(&cmd);
-						eicon_idi_listen_req(ccard, chan);
-#ifdef CONFIG_ISDN_TTY_FAX
-						chan->fax = 0;
-#endif
-					}
-				}
-				break;
-			case INDICATE_IND:
-				eicon_log(ccard, 8, "idi_ind: Ch%d: Indicate_Ind\n", chan->No);
-				if (chan->fsm_state != EICON_STATE_LISTEN) {
-					eicon_log(ccard, 1, "idi_err: Ch%d: Incoming call on wrong state (%d).\n",
-						chan->No, chan->fsm_state);
-					idi_do_req(ccard, chan, HANGUP, 0);
-					break;
-				}
-				chan->fsm_state = EICON_STATE_ICALL;
-				idi_bc2si(message.bc, message.hlc, message.sin, &chan->si1, &chan->si2);
-				strcpy(chan->cpn, message.cpn + 1);
-				strcpy(chan->oad, message.oad);
-				strcpy(chan->dsa, message.dsa);
-				strcpy(chan->osa, message.osa);
-				chan->plan = message.plan;
-				chan->screen = message.screen;
-				try_stat_icall_again: 
-				cmd.driver = ccard->myid;
-				cmd.command = ISDN_STAT_ICALL;
-				cmd.arg = chan->No;
-				cmd.parm.setup.si1 = chan->si1;
-				cmd.parm.setup.si2 = chan->si2;
-				strcpy(tnum, chan->cpn);
-				if (strlen(chan->dsa)) {
-					strcat(tnum, ".");
-					strcat(tnum, chan->dsa);
-				}
-				tnum[ISDN_MSNLEN - 1] = 0;
-				strcpy(cmd.parm.setup.eazmsn, tnum);
-				strcpy(tnum, chan->oad);
-				if (strlen(chan->osa)) {
-					strcat(tnum, ".");
-					strcat(tnum, chan->osa);
-				}
-				tnum[ISDN_MSNLEN - 1] = 0;
-				strcpy(cmd.parm.setup.phone, tnum);
-				cmd.parm.setup.plan = chan->plan;
-				cmd.parm.setup.screen = chan->screen;
-				tmp = ccard->interface.statcallb(&cmd);
-				switch(tmp) {
-					case 0: /* no user responding */
-						idi_do_req(ccard, chan, HANGUP, 0);
-						chan->fsm_state = EICON_STATE_NULL;
-						break;
-					case 1: /* alert */
-						eicon_log(ccard, 8, "idi_req: Ch%d: Call Alert\n", chan->No);
-						if ((chan->fsm_state == EICON_STATE_ICALL) || (chan->fsm_state == EICON_STATE_ICALLW)) {
-							chan->fsm_state = EICON_STATE_ICALL;
-							idi_do_req(ccard, chan, CALL_ALERT, 0);
-						}
-						break;
-					case 2: /* reject */
-						eicon_log(ccard, 8, "idi_req: Ch%d: Call Reject\n", chan->No);
-						idi_do_req(ccard, chan, REJECT, 0);
-						break;
-					case 3: /* incomplete number */
-						eicon_log(ccard, 8, "idi_req: Ch%d: Incomplete Number\n", chan->No);
-						chan->fsm_state = EICON_STATE_ICALLW;
-						break;
-				}
-				break;
-			case INFO_IND:
-				eicon_log(ccard, 8, "idi_ind: Ch%d: Info_Ind\n", chan->No);
-				if ((chan->fsm_state == EICON_STATE_ICALLW) &&
-				    (message.cpn[0])) {
-					strcat(chan->cpn, message.cpn + 1);
-					goto try_stat_icall_again;
-				}
-				break;
-			case CALL_IND:
-				eicon_log(ccard, 8, "idi_ind: Ch%d: Call_Ind\n", chan->No);
-				if ((chan->fsm_state == EICON_STATE_ICALL) || (chan->fsm_state == EICON_STATE_IWAIT)) {
-					chan->fsm_state = EICON_STATE_IBWAIT;
-					cmd.driver = ccard->myid;
-					cmd.command = ISDN_STAT_DCONN;
-					cmd.arg = chan->No;
-					ccard->interface.statcallb(&cmd);
-					switch(chan->l2prot) {
-						case ISDN_PROTO_L2_FAX:
-#ifdef CONFIG_ISDN_TTY_FAX
-							if (chan->fax)
-								chan->fax->phase = ISDN_FAX_PHASE_A;
-#endif
-							break;
-						case ISDN_PROTO_L2_MODEM:
-							/* do nothing, wait for connect */
-							break;
-						case ISDN_PROTO_L2_V11096:
-						case ISDN_PROTO_L2_V11019:
-						case ISDN_PROTO_L2_V11038:
-						case ISDN_PROTO_L2_TRANS:
-							idi_do_req(ccard, chan, N_CONNECT, 1);
-							break;
-						default:;
-							/* On most incoming calls we use automatic connect */
-							/* idi_do_req(ccard, chan, N_CONNECT, 1); */
-					}
-				} else {
-					if (chan->fsm_state != EICON_STATE_ACTIVE)
-						idi_hangup(ccard, chan);
-				}
-				break;
-			case CALL_CON:
-				eicon_log(ccard, 8, "idi_ind: Ch%d: Call_Con\n", chan->No);
-				if (chan->fsm_state == EICON_STATE_OCALL) {
-					/* check if old NetID has been removed */
-					if (chan->e.B2Id) {
-						eicon_log(ccard, 1, "eicon: Ch%d: old net_id %x still exist, removing.\n",
-							chan->No, chan->e.B2Id);
-						idi_do_req(ccard, chan, REMOVE, 1);
-					}
-#ifdef CONFIG_ISDN_TTY_FAX
-					if (chan->l2prot == ISDN_PROTO_L2_FAX) {
-						if (chan->fax) {
-							chan->fax->phase = ISDN_FAX_PHASE_A;
-						} else {
-							eicon_log(ccard, 1, "idi_ind: Call_Con with NULL fax struct, ERROR\n");
-							idi_hangup(ccard, chan);
-							break;
-						}
-					}
-#endif
-					chan->fsm_state = EICON_STATE_OBWAIT;
-					cmd.driver = ccard->myid;
-					cmd.command = ISDN_STAT_DCONN;
-					cmd.arg = chan->No;
-					ccard->interface.statcallb(&cmd);
-
-					idi_do_req(ccard, chan, ASSIGN, 1); 
-					idi_do_req(ccard, chan, N_CONNECT, 1);
-				} else
-					idi_hangup(ccard, chan);
-				break;
-			case AOC_IND:
-				eicon_log(ccard, 8, "idi_ind: Ch%d: Advice of Charge\n", chan->No);
-				break;
-			case CALL_HOLD_ACK:
-				chan->statectrl |= IN_HOLD;
-				eicon_log(ccard, 8, "idi_ind: Ch%d: Call Hold Ack\n", chan->No);
-				break;
-			case SUSPEND_REJ:
-				eicon_log(ccard, 8, "idi_ind: Ch%d: Suspend Rejected\n", chan->No);
-				break;
-			case SUSPEND:
-				eicon_log(ccard, 8, "idi_ind: Ch%d: Suspend Ack\n", chan->No);
-				break;
-			case RESUME:
-				eicon_log(ccard, 8, "idi_ind: Ch%d: Resume Ack\n", chan->No);
-				break;
-			default:
-				eicon_log(ccard, 8, "idi_ind: Ch%d: UNHANDLED SigIndication 0x%02x\n", chan->No, ind->Ind);
-		}
-	}
-	/* Network Layer */
-	else if (chan->e.B2Id == ind->IndId) {
-
-		if (chan->No == ccard->nchannels) {
-			/* Management Indication */
-			if (ind->Ind == 0x04) { /* Trace_Ind */
-				eicon_parse_trace(ccard, ind->RBuffer.P, ind->RBuffer.length);
-			} else {
-				idi_IndParse(ccard, chan, &message, ind->RBuffer.P, ind->RBuffer.length);
-				chan->fsm_state = 1;
-			}
-		} 
-		else
-		switch(ind->Ind) {
-			case N_CONNECT_ACK:
-				eicon_log(ccard, 16, "idi_ind: Ch%d: N_Connect_Ack\n", chan->No);
-				if (chan->l2prot == ISDN_PROTO_L2_MODEM) {
-					chan->fsm_state = EICON_STATE_WMCONN;
-					break;
-				}
-				if (chan->l2prot == ISDN_PROTO_L2_FAX) {
-#ifdef CONFIG_ISDN_TTY_FAX
-					chan->fsm_state = EICON_STATE_ACTIVE;
-					idi_parse_edata(ccard, chan, ind->RBuffer.P, ind->RBuffer.length);
-					if (chan->fax) {
-						if (chan->fax->phase == ISDN_FAX_PHASE_B) {
-							idi_fax_send_header(ccard, chan, 2);
-							cmd.driver = ccard->myid;
-							cmd.command = ISDN_STAT_FAXIND;
-							cmd.arg = chan->No;
-							chan->fax->r_code = ISDN_TTY_FAX_DCS;
-							ccard->interface.statcallb(&cmd);
-						}
-					}
-					else {
-						eicon_log(ccard, 1, "idi_ind: N_Connect_Ack with NULL fax struct, ERROR\n");
-					}
-#endif
-					break;
-				}
-				chan->fsm_state = EICON_STATE_ACTIVE;
-				cmd.driver = ccard->myid;
-				cmd.command = ISDN_STAT_BCONN;
-				cmd.arg = chan->No;
-				strcpy(cmd.parm.num, "64000");
-				ccard->interface.statcallb(&cmd);
-				break; 
-			case N_CONNECT:
-				eicon_log(ccard, 16,"idi_ind: Ch%d: N_Connect\n", chan->No);
-				chan->e.IndCh = ind->IndCh;
-				if (chan->e.B2Id) idi_do_req(ccard, chan, N_CONNECT_ACK, 1);
-				if (chan->l2prot == ISDN_PROTO_L2_FAX) {
-					break;
-				}
-				if (chan->l2prot == ISDN_PROTO_L2_MODEM) {
-					chan->fsm_state = EICON_STATE_WMCONN;
-					break;
-				}
-				chan->fsm_state = EICON_STATE_ACTIVE;
-				cmd.driver = ccard->myid;
-				cmd.command = ISDN_STAT_BCONN;
-				cmd.arg = chan->No;
-				strcpy(cmd.parm.num, "64000");
-				ccard->interface.statcallb(&cmd);
-				break; 
-			case N_DISC:
-				eicon_log(ccard, 16, "idi_ind: Ch%d: N_Disc\n", chan->No);
-				if (chan->e.B2Id) {
-		                	while((skb2 = skb_dequeue(&chan->e.X))) {
-						dev_kfree_skb(skb2);
-					}
-					idi_do_req(ccard, chan, N_DISC_ACK, 1);
-					idi_do_req(ccard, chan, REMOVE, 1);
-				}
-#ifdef CONFIG_ISDN_TTY_FAX
-				if ((chan->l2prot == ISDN_PROTO_L2_FAX) && (chan->fax)){
-					idi_parse_edata(ccard, chan, ind->RBuffer.P, ind->RBuffer.length);
-					idi_fax_hangup(ccard, chan);
-				}
-#endif
-				chan->e.IndCh = 0;
-				spin_lock_irqsave(&eicon_lock, flags);
-				chan->queued = 0;
-				chan->pqueued = 0;
-				chan->waitq = 0;
-				chan->waitpq = 0;
-				spin_unlock_irqrestore(&eicon_lock, flags);
-				if (!(chan->statectrl & IN_HOLD)) {
-					idi_do_req(ccard, chan, HANGUP, 0);
-				}
-				if (chan->fsm_state == EICON_STATE_ACTIVE) {
-					cmd.driver = ccard->myid;
-					cmd.command = ISDN_STAT_BHUP;
-					cmd.arg = chan->No;
-					ccard->interface.statcallb(&cmd);
-					chan->fsm_state = EICON_STATE_NULL;
-					if (!(chan->statectrl & IN_HOLD)) {
-						chan->statectrl |= WAITING_FOR_HANGUP;
-					}
-				}
-#ifdef CONFIG_ISDN_TTY_FAX
-				chan->fax = 0;
-#endif
-				break; 
-			case N_DISC_ACK:
-				eicon_log(ccard, 16, "idi_ind: Ch%d: N_Disc_Ack\n", chan->No);
-#ifdef CONFIG_ISDN_TTY_FAX
-				if (chan->l2prot == ISDN_PROTO_L2_FAX) {
-					idi_parse_edata(ccard, chan, ind->RBuffer.P, ind->RBuffer.length);
-					idi_fax_hangup(ccard, chan);
-				}
-#endif
-				break; 
-			case N_DATA_ACK:
-				eicon_log(ccard, 128, "idi_ind: Ch%d: N_Data_Ack\n", chan->No);
-				break;
-			case N_DATA:
-				skb_pull(skb, sizeof(eicon_IND) - 1);
-				eicon_log(ccard, 128, "idi_rcv: Ch%d: %d bytes\n", chan->No, skb->len);
-				if (chan->l2prot == ISDN_PROTO_L2_FAX) {
-#ifdef CONFIG_ISDN_TTY_FAX
-					idi_faxdata_rcv(ccard, chan, skb);
-#endif
-				} else {
-					ccard->interface.rcvcallb_skb(ccard->myid, chan->No, skb);
-					free_buff = 0; 
-				}
-				break; 
-			case N_UDATA:
-				idi_parse_udata(ccard, chan, ind->RBuffer.P, ind->RBuffer.length);
-				break; 
-#ifdef CONFIG_ISDN_TTY_FAX
-			case N_EDATA:
-				idi_edata_action(ccard, chan, ind->RBuffer.P, ind->RBuffer.length);
-				break; 
-#endif
-			default:
-				eicon_log(ccard, 8, "idi_ind: Ch%d: UNHANDLED NetIndication 0x%02x\n", chan->No, ind->Ind);
-		}
-	}
-	else {
-		eicon_log(ccard, 1, "idi_ind: Ch%d: Ind is neither SIG nor NET !\n", chan->No);
-	}
-   if (free_buff)
-	dev_kfree_skb(skb);
-}
-
-int
-idi_handle_ack_ok(eicon_card *ccard, eicon_chan *chan, eicon_RC *ack)
-{
-	ulong flags;
-	isdn_ctrl cmd;
-	int tqueued = 0;
-	int twaitpq = 0;
-
-	if (ack->RcId != ((chan->e.ReqCh) ? chan->e.B2Id : chan->e.D3Id)) {
-		/* I don't know why this happens, should not ! */
-		/* just ignoring this RC */
-		eicon_log(ccard, 16, "idi_ack: Ch%d: RcId %d not equal to last %d\n", chan->No, 
-			ack->RcId, (chan->e.ReqCh) ? chan->e.B2Id : chan->e.D3Id);
-		return 1;
-	}
-
-	/* Management Interface */	
-	if (chan->No == ccard->nchannels) {
-		/* Managementinterface: changing state */
-		if (chan->e.Req != 0x02)
-			chan->fsm_state = 1;
-	}
-
-	/* Remove an Id */
-	if (chan->e.Req == REMOVE) {
-		if (ack->Reference != chan->e.ref) {
-			/* This should not happen anymore */
-			eicon_log(ccard, 16, "idi_ack: Ch%d: Rc-Ref %d not equal to stored %d\n", chan->No,
-				ack->Reference, chan->e.ref);
-		}
-		spin_lock_irqsave(&eicon_lock, flags);
-		ccard->IdTable[ack->RcId] = NULL;
-		if (!chan->e.ReqCh) 
-			chan->e.D3Id = 0;
-		else
-			chan->e.B2Id = 0;
-		spin_unlock_irqrestore(&eicon_lock, flags);
-		eicon_log(ccard, 16, "idi_ack: Ch%d: Removed : Id=%x Ch=%d (%s)\n", chan->No,
-			ack->RcId, ack->RcCh, (chan->e.ReqCh)? "Net":"Sig");
-		return 1;
-	}
-
-	/* Signal layer */
-	if (!chan->e.ReqCh) {
-		eicon_log(ccard, 16, "idi_ack: Ch%d: RC OK Id=%x Ch=%d (ref:%d)\n", chan->No,
-			ack->RcId, ack->RcCh, ack->Reference);
-	} else {
-	/* Network layer */
-		switch(chan->e.Req & 0x0f) {
-			case N_CONNECT:
-				chan->e.IndCh = ack->RcCh;
-				eicon_log(ccard, 16, "idi_ack: Ch%d: RC OK Id=%x Ch=%d (ref:%d)\n", chan->No,
-					ack->RcId, ack->RcCh, ack->Reference);
-				break;
-			case N_MDATA:
-			case N_DATA:
-				tqueued = chan->queued;
-				twaitpq = chan->waitpq;
-				if ((chan->e.Req & 0x0f) == N_DATA) {
-					spin_lock_irqsave(&eicon_lock, flags);
-					chan->waitpq = 0;
-					if(chan->pqueued)
-						chan->pqueued--;
-					spin_unlock_irqrestore(&eicon_lock, flags);
-#ifdef CONFIG_ISDN_TTY_FAX
-					if (chan->l2prot == ISDN_PROTO_L2_FAX) {
-						if (((chan->queued - chan->waitq) < 1) &&
-						    (chan->fax2.Eop)) {
-							chan->fax2.Eop = 0;
-							if (chan->fax) {
-								cmd.driver = ccard->myid;
-								cmd.command = ISDN_STAT_FAXIND;
-								cmd.arg = chan->No;
-								chan->fax->r_code = ISDN_TTY_FAX_SENT;
-								ccard->interface.statcallb(&cmd);
-							}
-							else {
-								eicon_log(ccard, 1, "idi_ack: Sent with NULL fax struct, ERROR\n");
-							}
-						}
-					}
-#endif
-				}
-				spin_lock_irqsave(&eicon_lock, flags);
-				chan->queued -= chan->waitq;
-				if (chan->queued < 0) chan->queued = 0;
-				spin_unlock_irqrestore(&eicon_lock, flags);
-				if (((chan->e.Req & 0x0f) == N_DATA) && (tqueued)) {
-					cmd.driver = ccard->myid;
-					cmd.command = ISDN_STAT_BSENT;
-					cmd.arg = chan->No;
-					cmd.parm.length = twaitpq;
-					ccard->interface.statcallb(&cmd);
-				}
-				break;
-			default:
-				eicon_log(ccard, 16, "idi_ack: Ch%d: RC OK Id=%x Ch=%d (ref:%d)\n", chan->No,
-					ack->RcId, ack->RcCh, ack->Reference);
-		}
-	}
-	return 1;
-}
-
-void
-idi_handle_ack(eicon_card *ccard, struct sk_buff *skb)
-{
-	int j;
-	ulong flags;
-        eicon_RC *ack = (eicon_RC *)skb->data;
-	eicon_chan *chan;
-	isdn_ctrl cmd;
-	int dCh = -1;
-
-	if (!ccard) {
-		eicon_log(ccard, 1, "idi_err: Ch??: null card in handle_ack\n");
-		dev_kfree_skb(skb);
-		return;
-	}
-
-	spin_lock_irqsave(&eicon_lock, flags);
-	if ((chan = ccard->IdTable[ack->RcId]) != NULL)
-		dCh = chan->No;
-	spin_unlock_irqrestore(&eicon_lock, flags);
-
-	switch (ack->Rc) {
-		case OK_FC:
-		case N_FLOW_CONTROL:
-		case ASSIGN_RC:
-			eicon_log(ccard, 1, "idi_ack: Ch%d: unhandled RC 0x%x\n",
-				dCh, ack->Rc);
-			break;
-		case READY_INT:
-		case TIMER_INT:
-			/* we do nothing here */
-			break;
-
-		case OK:
-			if (!chan) {
-				eicon_log(ccard, 1, "idi_ack: Ch%d: OK on chan without Id\n", dCh);
-				break;
-			}
-			if (!idi_handle_ack_ok(ccard, chan, ack))
-				chan = NULL;
-			break;
-
-		case ASSIGN_OK:
-			if (chan) {
-				eicon_log(ccard, 1, "idi_ack: Ch%d: ASSIGN-OK on chan already assigned (%x,%x)\n",
-					chan->No, chan->e.D3Id, chan->e.B2Id);
-			}
-			spin_lock_irqsave(&eicon_lock, flags);
-			for(j = 0; j < ccard->nchannels + 1; j++) {
-				if ((ccard->bch[j].e.ref == ack->Reference) &&
-					(ccard->bch[j].e.Req == ASSIGN)) {
-					if (!ccard->bch[j].e.ReqCh) 
-						ccard->bch[j].e.D3Id  = ack->RcId;
-					else
-						ccard->bch[j].e.B2Id  = ack->RcId;
-					ccard->IdTable[ack->RcId] = &ccard->bch[j];
-					chan = &ccard->bch[j];
-					break;
-				}
-			}
-			spin_unlock_irqrestore(&eicon_lock, flags);
-			eicon_log(ccard, 16, "idi_ack: Ch%d: Id %x assigned (%s)\n", j, 
-				ack->RcId, (ccard->bch[j].e.ReqCh)? "Net":"Sig");
-			if (j > ccard->nchannels) {
-				eicon_log(ccard, 24, "idi_ack: Ch??: ref %d not found for Id %d\n", 
-					ack->Reference, ack->RcId);
-			}
-			break;
-
-		case OUT_OF_RESOURCES:
-		case UNKNOWN_COMMAND:
-		case WRONG_COMMAND:
-		case WRONG_ID:
-		case ADAPTER_DEAD:
-		case WRONG_CH:
-		case UNKNOWN_IE:
-		case WRONG_IE:
-		default:
-			if (!chan) {
-				eicon_log(ccard, 1, "idi_ack: Ch%d: Not OK !! on chan without Id\n", dCh);
-				break;
-			} else
-			switch (chan->e.Req) {
-				case 12:	/* Alert */
-					eicon_log(ccard, 2, "eicon_err: Ch%d: Alert Not OK : Rc=%d Id=%x Ch=%d\n",
-						dCh, ack->Rc, ack->RcId, ack->RcCh);
-					break;
-				default:
-					if (dCh != ccard->nchannels)
-						eicon_log(ccard, 1, "eicon_err: Ch%d: Ack Not OK !!: Rc=%d Id=%x Ch=%d Req=%d\n",
-							dCh, ack->Rc, ack->RcId, ack->RcCh, chan->e.Req);
-			}
-			if (dCh == ccard->nchannels) { /* Management */
-				chan->fsm_state = 2;
-				eicon_log(ccard, 8, "eicon_err: Ch%d: Ack Not OK !!: Rc=%d Id=%x Ch=%d Req=%d\n",
-					dCh, ack->Rc, ack->RcId, ack->RcCh, chan->e.Req);
-			} else if (dCh >= 0) {
-					/* any other channel */
-					/* card reports error: we hangup */
-				idi_hangup(ccard, chan);
-				cmd.driver = ccard->myid;
-				cmd.command = ISDN_STAT_DHUP;
-				cmd.arg = chan->No;
-				ccard->interface.statcallb(&cmd);
-			}
-	}
-	spin_lock_irqsave(&eicon_lock, flags);
-	if (chan) {
-		chan->e.ref = 0;
-		chan->e.busy = 0;
-	}
-	spin_unlock_irqrestore(&eicon_lock, flags);
-	dev_kfree_skb(skb);
-	eicon_schedule_tx(ccard);
-}
-
-int
-idi_send_data(eicon_card *card, eicon_chan *chan, int ack, struct sk_buff *skb, int que, int chk)
-{
-        struct sk_buff *xmit_skb;
-        struct sk_buff *skb2;
-        eicon_REQ *reqbuf;
-        eicon_chan_ptr *chan2;
-        int len, plen = 0, offset = 0;
-	unsigned long flags;
-
-	if ((!card) || (!chan)) {
-		eicon_log(card, 1, "idi_err: Ch??: null card/chan in send_data\n");
-		return -1;
-	}
-
-        if (chan->fsm_state != EICON_STATE_ACTIVE) {
-		eicon_log(card, 1, "idi_snd: Ch%d: send bytes on state %d !\n", chan->No, chan->fsm_state);
-                return -ENODEV;
-	}
-
-        len = skb->len;
-	if (len > EICON_MAX_QUEUE)	/* too much for the shared memory */
-		return -1;
-        if (!len)
-                return 0;
-
-	if ((chk) && (chan->pqueued > 1))
-		return 0;
-
-	eicon_log(card, 128, "idi_snd: Ch%d: %d bytes (Pqueue=%d)\n",
-		chan->No, len, chan->pqueued);
-
-	spin_lock_irqsave(&eicon_lock, flags);
-	while(offset < len) {
-
-		plen = ((len - offset) > 270) ? 270 : len - offset;
-
-	        xmit_skb = alloc_skb(plen + sizeof(eicon_REQ), GFP_ATOMIC);
-        	skb2 = alloc_skb(sizeof(eicon_chan_ptr), GFP_ATOMIC);
-
-	        if ((!xmit_skb) || (!skb2)) {
-			spin_unlock_irqrestore(&eicon_lock, flags);
-        	        eicon_log(card, 1, "idi_err: Ch%d: alloc_skb failed in send_data()\n", chan->No);
-			if (xmit_skb) 
-				dev_kfree_skb(xmit_skb);
-			if (skb2) 
-				dev_kfree_skb(skb2);
-                	return -ENOMEM;
-	        }
-
-	        chan2 = (eicon_chan_ptr *)skb_put(skb2, sizeof(eicon_chan_ptr));
-        	chan2->ptr = chan;
-
-	        reqbuf = (eicon_REQ *)skb_put(xmit_skb, plen + sizeof(eicon_REQ));
-		if ((len - offset) > 270) { 
-		        reqbuf->Req = N_MDATA;
-		} else {
-		        reqbuf->Req = N_DATA;
-			/* if (ack) reqbuf->Req |= N_D_BIT; */
-		}	
-        	reqbuf->ReqCh = chan->e.IndCh;
-	        reqbuf->ReqId = 1;
-		memcpy(&reqbuf->XBuffer.P, skb->data + offset, plen);
-		reqbuf->XBuffer.length = plen;
-		reqbuf->Reference = 1; /* Net Entity */
-
-		skb_queue_tail(&chan->e.X, xmit_skb);
-		skb_queue_tail(&card->sndq, skb2); 
-
-		offset += plen;
-	}
-	if (que) {
-		chan->queued += len;
-		chan->pqueued++;
-	}
-	spin_unlock_irqrestore(&eicon_lock, flags);
-	eicon_schedule_tx(card);
-        dev_kfree_skb(skb);
-        return len;
-}
-
-
-int
-eicon_idi_manage_assign(eicon_card *card)
-{
-        struct sk_buff *skb;
-        struct sk_buff *skb2;
-        eicon_REQ  *reqbuf;
-        eicon_chan     *chan;
-        eicon_chan_ptr *chan2;
-
-        chan = &(card->bch[card->nchannels]);
-
-        skb = alloc_skb(270 + sizeof(eicon_REQ), GFP_ATOMIC);
-        skb2 = alloc_skb(sizeof(eicon_chan_ptr), GFP_ATOMIC);
-
-        if ((!skb) || (!skb2)) {
-		eicon_log(card, 1, "idi_err: alloc_skb failed in manage_assign()\n");
-		if (skb) 
-			dev_kfree_skb(skb);
-		if (skb2) 
-			dev_kfree_skb(skb2);
-                return -ENOMEM;
-        }
-
-        chan2 = (eicon_chan_ptr *)skb_put(skb2, sizeof(eicon_chan_ptr));
-        chan2->ptr = chan;
-
-        reqbuf = (eicon_REQ *)skb_put(skb, 270 + sizeof(eicon_REQ));
-
-        reqbuf->XBuffer.P[0] = 0;
-        reqbuf->Req = ASSIGN;
-        reqbuf->ReqCh = 0;
-        reqbuf->ReqId = MAN_ID;
-        reqbuf->XBuffer.length = 1;
-        reqbuf->Reference = 2; /* Man Entity */
-
-        skb_queue_tail(&chan->e.X, skb);
-        skb_queue_tail(&card->sndq, skb2);
-        eicon_schedule_tx(card);
-        return(0);
-}
-
-
-int
-eicon_idi_manage_remove(eicon_card *card)
-{
-        struct sk_buff *skb;
-        struct sk_buff *skb2;
-        eicon_REQ  *reqbuf;
-        eicon_chan     *chan;
-        eicon_chan_ptr *chan2;
-
-        chan = &(card->bch[card->nchannels]);
-
-        skb = alloc_skb(270 + sizeof(eicon_REQ), GFP_ATOMIC);
-        skb2 = alloc_skb(sizeof(eicon_chan_ptr), GFP_ATOMIC);
-
-        if ((!skb) || (!skb2)) {
-               	eicon_log(card, 1, "idi_err: alloc_skb failed in manage_remove()\n");
-		if (skb) 
-			dev_kfree_skb(skb);
-		if (skb2) 
-			dev_kfree_skb(skb2);
-                return -ENOMEM;
-        }
-
-        chan2 = (eicon_chan_ptr *)skb_put(skb2, sizeof(eicon_chan_ptr));
-        chan2->ptr = chan;
-
-        reqbuf = (eicon_REQ *)skb_put(skb, 270 + sizeof(eicon_REQ));
-
-        reqbuf->Req = REMOVE;
-        reqbuf->ReqCh = 0;
-        reqbuf->ReqId = 1;
-        reqbuf->XBuffer.length = 0;
-        reqbuf->Reference = 2; /* Man Entity */
-
-        skb_queue_tail(&chan->e.X, skb);
-        skb_queue_tail(&card->sndq, skb2);
-        eicon_schedule_tx(card);
-        return(0);
-}
-
-
-int
-eicon_idi_manage(eicon_card *card, eicon_manifbuf *mb)
-{
-	int l = 0;
-	int ret = 0;
-	unsigned long timeout;
-	int i;
-        struct sk_buff *skb;
-        struct sk_buff *skb2;
-        eicon_REQ  *reqbuf;
-        eicon_chan     *chan;
-        eicon_chan_ptr *chan2;
-
-        chan = &(card->bch[card->nchannels]);
-
-	if (!(chan->e.D3Id)) {
-		chan->e.D3Id = 1;
-		while((skb2 = skb_dequeue(&chan->e.X)))
-			dev_kfree_skb(skb2);
-		chan->e.busy = 0;
- 
-		if ((ret = eicon_idi_manage_assign(card))) {
-			chan->e.D3Id = 0;
-			return(ret); 
-		}
-
-	        timeout = jiffies + HZ / 2;
-        	while (time_before(jiffies, timeout)) {
-	                if (chan->e.B2Id) break;
-        	        SLEEP(10);
-	        }
-	        if (!chan->e.B2Id) {
-			chan->e.D3Id = 0;
-			return -EIO;
-		}
-	}
-
-	chan->fsm_state = 0;
-
-	if (!(manbuf = kmalloc(sizeof(eicon_manifbuf), GFP_KERNEL))) {
-               	eicon_log(card, 1, "idi_err: alloc_manifbuf failed\n");
-		return -ENOMEM;
-	}
-	if (copy_from_user(manbuf, mb, sizeof(eicon_manifbuf))) {
-		kfree(manbuf);
-		return -EFAULT;
-	}
-
-        skb = alloc_skb(270 + sizeof(eicon_REQ), GFP_ATOMIC);
-        skb2 = alloc_skb(sizeof(eicon_chan_ptr), GFP_ATOMIC);
-
-        if ((!skb) || (!skb2)) {
-               	eicon_log(card, 1, "idi_err_manif: alloc_skb failed in manage()\n");
-		if (skb) 
-			dev_kfree_skb(skb);
-		if (skb2) 
-			dev_kfree_skb(skb2);
-		kfree(manbuf);
-                return -ENOMEM;
-        }
-
-        chan2 = (eicon_chan_ptr *)skb_put(skb2, sizeof(eicon_chan_ptr));
-        chan2->ptr = chan;
-
-        reqbuf = (eicon_REQ *)skb_put(skb, 270 + sizeof(eicon_REQ));
-
-        reqbuf->XBuffer.P[l++] = ESC;
-        reqbuf->XBuffer.P[l++] = 6;
-        reqbuf->XBuffer.P[l++] = 0x80;
-	for (i = 0; i < manbuf->length[0]; i++)
-	        reqbuf->XBuffer.P[l++] = manbuf->data[i];
-        reqbuf->XBuffer.P[1] = manbuf->length[0] + 1;
-
-        reqbuf->XBuffer.P[l++] = 0;
-        reqbuf->Req = (manbuf->count) ? manbuf->count : MAN_READ;
-        reqbuf->ReqCh = 0;
-        reqbuf->ReqId = 1;
-        reqbuf->XBuffer.length = l;
-        reqbuf->Reference = 2; /* Man Entity */
-
-        skb_queue_tail(&chan->e.X, skb);
-        skb_queue_tail(&card->sndq, skb2);
-
-	manbuf->count = 0;
-	manbuf->pos = 0;
-
-        eicon_schedule_tx(card);
-
-        timeout = jiffies + HZ / 2;
-        while (time_before(jiffies, timeout)) {
-                if (chan->fsm_state) break;
-                SLEEP(10);
-        }
-        if ((!chan->fsm_state) || (chan->fsm_state == 2)) {
-		kfree(manbuf);
-		return -EIO;
-	}
-	if (copy_to_user(mb, manbuf, sizeof(eicon_manifbuf))) {
-		kfree(manbuf);
-		return -EFAULT;
-	}
-
-	kfree(manbuf);
-  return(0);
-}
diff -Nru a/drivers/isdn/eicon/eicon_idi.h b/drivers/isdn/eicon/eicon_idi.h
--- a/drivers/isdn/eicon/eicon_idi.h	Tue Feb  3 19:45:16 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,119 +0,0 @@
-/* $Id: eicon_idi.h,v 1.1.4.1.2.2 2002/10/01 11:29:13 armin Exp $
- *
- * ISDN lowlevel-module for the Eicon active cards.
- * IDI-Interface
- *
- * Copyright 1998-2000  by Armin Schindler (mac@melware.de)
- * Copyright 1999,2000  Cytronics & Melware (info@melware.de)
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#ifndef E_IDI_H
-#define E_IDI_H
-
-#include <linux/config.h>
-
-#undef N_DATA
-#undef ID_MASK
-
-#include "pc.h"
-
-#define AOC_IND  26		/* Advice of Charge                         */
-#define PI  0x1e                /* Progress Indicator               */
-#define NI  0x27                /* Notification Indicator           */
-
-#define CALL_HOLD	0x22
-#define CALL_HOLD_ACK	0x24
-
-/* defines for statectrl */
-#define WAITING_FOR_HANGUP	0x01
-#define HAVE_CONN_REQ		0x02
-#define IN_HOLD			0x04
-
-typedef struct {
-	char cpn[32];
-	char oad[32];
-	char dsa[32];
-	char osa[32];
-	__u8 plan;
-	__u8 screen;
-	__u8 sin[4];
-	__u8 chi[4];
-	__u8 e_chi[4];
-	__u8 bc[12];
-	__u8 e_bc[12];
- 	__u8 llc[18];
-	__u8 hlc[5];
-	__u8 cau[4];
-	__u8 e_cau[2];
-	__u8 e_mt;
-	__u8 dt[6];
-	char display[83];
-	char keypad[35];
-	char rdn[32];
-} idi_ind_message;
-
-typedef struct { 
-  __u16 next            __attribute__ ((packed));
-  __u8  Req             __attribute__ ((packed));
-  __u8  ReqId           __attribute__ ((packed));
-  __u8  ReqCh           __attribute__ ((packed));
-  __u8  Reserved1       __attribute__ ((packed));
-  __u16 Reference       __attribute__ ((packed));
-  __u8  Reserved[8]     __attribute__ ((packed));
-  eicon_PBUFFER XBuffer; 
-} eicon_REQ;
-
-typedef struct {
-  __u16 next            __attribute__ ((packed));
-  __u8  Rc              __attribute__ ((packed));
-  __u8  RcId            __attribute__ ((packed));
-  __u8  RcCh            __attribute__ ((packed));
-  __u8  Reserved1       __attribute__ ((packed));
-  __u16 Reference       __attribute__ ((packed));
-  __u8  Reserved2[8]    __attribute__ ((packed));
-} eicon_RC;
-
-typedef struct {
-  __u16 next            __attribute__ ((packed));
-  __u8  Ind             __attribute__ ((packed));
-  __u8  IndId           __attribute__ ((packed));
-  __u8  IndCh           __attribute__ ((packed));
-  __u8  MInd            __attribute__ ((packed));
-  __u16 MLength         __attribute__ ((packed));
-  __u16 Reference       __attribute__ ((packed));
-  __u8  RNR             __attribute__ ((packed));
-  __u8  Reserved        __attribute__ ((packed));
-  __u32 Ack             __attribute__ ((packed));
-  eicon_PBUFFER RBuffer;
-} eicon_IND;
-
-typedef struct {
-	__u8		*Data;
-	unsigned int	Size;
-	unsigned int	Len;
-	__u8		*Next;
-} eicon_OBJBUFFER;
-
-extern int idi_do_req(eicon_card *card, eicon_chan *chan, int cmd, int layer);
-extern int idi_hangup(eicon_card *card, eicon_chan *chan);
-extern int idi_connect_res(eicon_card *card, eicon_chan *chan);
-extern int eicon_idi_listen_req(eicon_card *card, eicon_chan *chan);
-extern int idi_connect_req(eicon_card *card, eicon_chan *chan, char *phone,
-	                    char *eazmsn, int si1, int si2);
-
-extern void idi_handle_ack(eicon_card *card, struct sk_buff *skb);
-extern void idi_handle_ind(eicon_card *card, struct sk_buff *skb);
-extern int eicon_idi_manage(eicon_card *card, eicon_manifbuf *mb);
-extern int idi_send_data(eicon_card *card, eicon_chan *chan, int ack, struct sk_buff *skb, int que, int chk);
-extern void idi_audio_cmd(eicon_card *ccard, eicon_chan *chan, int cmd, u_char *value);
-extern int capipmsg(eicon_card *card, eicon_chan *chan, capi_msg *cm);
-#ifdef CONFIG_ISDN_TTY_FAX
-extern void idi_fax_cmd(eicon_card *card, eicon_chan *chan);
-extern int idi_faxdata_send(eicon_card *ccard, eicon_chan *chan, struct sk_buff *skb);
-#endif
-
-#endif
diff -Nru a/drivers/isdn/eicon/eicon_io.c b/drivers/isdn/eicon/eicon_io.c
--- a/drivers/isdn/eicon/eicon_io.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,749 +0,0 @@
-/* $Id: eicon_io.c,v 1.1.4.1.2.2 2002/10/01 11:29:13 armin Exp $
- *
- * ISDN low-level module for Eicon active ISDN-Cards.
- * Code for communicating with hardware.
- *
- * Copyright 1999,2000  by Armin Schindler (mac@melware.de)
- * Copyright 1999,2000  Cytronics & Melware (info@melware.de)
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- * Thanks to	Eicon Networks for 
- *		documents, informations and hardware. 
- *
- */
-
-#include <linux/config.h>
-#include "eicon.h"
-#include "uxio.h"
-
-void
-eicon_io_rcv_dispatch(eicon_card *ccard) {
-	ulong flags;
-        struct sk_buff *skb, *skb2, *skb_new;
-        eicon_IND *ind, *ind2, *ind_new;
-        eicon_chan *chan;
-
-        if (!ccard) {
-	        eicon_log(ccard, 1, "eicon_err: NULL card in rcv_dispatch !\n");
-                return;
-        }
-
-	while((skb = skb_dequeue(&ccard->rcvq))) {
-        	ind = (eicon_IND *)skb->data;
-
-		spin_lock_irqsave(&eicon_lock, flags);
-        	if ((chan = ccard->IdTable[ind->IndId]) == NULL) {
-			spin_unlock_irqrestore(&eicon_lock, flags);
-			if (DebugVar & 1) {
-				switch(ind->Ind) {
-					case N_DISC_ACK: 
-						/* doesn't matter if this happens */ 
-						break;
-					default: 
-						eicon_log(ccard, 1, "idi: Indication for unknown channel Ind=%d Id=%x\n", ind->Ind, ind->IndId);
-						eicon_log(ccard, 1, "idi_hdl: Ch??: Ind=%d Id=%x Ch=%d MInd=%d MLen=%d Len=%d\n",
-							ind->Ind,ind->IndId,ind->IndCh,ind->MInd,ind->MLength,ind->RBuffer.length);
-				}
-			}
-	                dev_kfree_skb(skb);
-	                continue;
-	        }
-		spin_unlock_irqrestore(&eicon_lock, flags);
-
-		if (chan->e.complete) { /* check for rec-buffer chaining */
-			if (ind->MLength == ind->RBuffer.length) {
-				chan->e.complete = 1;
-				idi_handle_ind(ccard, skb);
-				continue;
-			}
-			else {
-				chan->e.complete = 0;
-				ind->Ind = ind->MInd;
-				skb_queue_tail(&chan->e.R, skb);
-				continue;
-			}
-		}
-		else {
-			if (!(skb2 = skb_dequeue(&chan->e.R))) {
-				chan->e.complete = 1;
-                		eicon_log(ccard, 1, "eicon: buffer incomplete, but 0 in queue\n");
-	                	dev_kfree_skb(skb);
-				continue;	
-			}
-	        	ind2 = (eicon_IND *)skb2->data;
-			skb_new = alloc_skb(((sizeof(eicon_IND)-1)+ind->RBuffer.length+ind2->RBuffer.length),
-					GFP_ATOMIC);
-			if (!skb_new) {
-                		eicon_log(ccard, 1, "eicon_io: skb_alloc failed in rcv_dispatch()\n");
-	                	dev_kfree_skb(skb);
-	                	dev_kfree_skb(skb2);
-				continue;	
-			}
-			ind_new = (eicon_IND *)skb_put(skb_new,
-					((sizeof(eicon_IND)-1)+ind->RBuffer.length+ind2->RBuffer.length));
-			ind_new->Ind = ind2->Ind;
-			ind_new->IndId = ind2->IndId;
-			ind_new->IndCh = ind2->IndCh;
-			ind_new->MInd = ind2->MInd;
-			ind_new->MLength = ind2->MLength;
-			ind_new->RBuffer.length = ind2->RBuffer.length + ind->RBuffer.length;
-			memcpy(&ind_new->RBuffer.P, &ind2->RBuffer.P, ind2->RBuffer.length);
-			memcpy((&ind_new->RBuffer.P)+ind2->RBuffer.length, &ind->RBuffer.P, ind->RBuffer.length);
-                	dev_kfree_skb(skb);
-                	dev_kfree_skb(skb2);
-			if (ind->MLength == ind->RBuffer.length) {
-				chan->e.complete = 2;
-				idi_handle_ind(ccard, skb_new);
-				continue;
-			}
-			else {
-				chan->e.complete = 0;
-				skb_queue_tail(&chan->e.R, skb_new);
-				continue;
-			}
-		}
-	}
-}
-
-void
-eicon_io_ack_dispatch(eicon_card *ccard) {
-        struct sk_buff *skb;
-
-        if (!ccard) {
-		eicon_log(ccard, 1, "eicon_err: NULL card in ack_dispatch!\n");
-                return;
-        }
-	while((skb = skb_dequeue(&ccard->rackq))) {
-		idi_handle_ack(ccard, skb);
-	}
-}
-
-
-/*
- *  IO-Functions for ISA cards
- */
-
-u8 ram_inb(eicon_card *card, void *adr) {
-        u32 addr = (u32) adr;
-	
-	return(readb(addr));
-}
-
-u16 ram_inw(eicon_card *card, void *adr) {
-        u32 addr = (u32) adr;
-
-	return(readw(addr));
-}
-
-void ram_outb(eicon_card *card, void *adr, u8 data) {
-        u32 addr = (u32) adr;
-
-	writeb(data, addr);
-}
-
-void ram_outw(eicon_card *card, void *adr , u16 data) {
-        u32 addr = (u32) adr;
-
-	writew(data, addr);
-}
-
-void ram_copyfromcard(eicon_card *card, void *adrto, void *adr, int len) {
-	memcpy_fromio(adrto, adr, len);
-}
-
-void ram_copytocard(eicon_card *card, void *adrto, void *adr, int len) {
-	memcpy_toio(adrto, adr, len);
-}
-
-
-#ifdef CONFIG_ISDN_DRV_EICON_PCI
-/*
- *  IDI-Callback function
- */
-void
-eicon_idi_callback(ENTITY *de)
-{
-	eicon_card *ccard = (eicon_card *)de->R;
-	struct sk_buff *skb;
-	eicon_RC *ack;
-	eicon_IND *ind;
-	int len = 0;
-
-	if (de->complete == 255) {
-		/* Return Code */
-		skb = alloc_skb(sizeof(eicon_RC), GFP_ATOMIC);
-		if (!skb) {
-			eicon_log(ccard, 1, "eicon_io: skb_alloc failed in _idi_callback()\n");
-		} else {
-			ack = (eicon_RC *)skb_put(skb, sizeof(eicon_RC));
-			ack->Rc = de->Rc;
-			if (de->Rc == ASSIGN_OK) {
-				ack->RcId = de->Id;
-				de->user[1] = de->Id;
-			} else {
-				ack->RcId = de->user[1];
-			}
-			ack->RcCh = de->RcCh;
-			ack->Reference = de->user[0];
-			skb_queue_tail(&ccard->rackq, skb);
-			eicon_schedule_ack(ccard);
-			eicon_log(ccard, 128, "idi_cbk: Ch%d: Rc=%x Id=%x RLen=%x compl=%x\n",
-				de->user[0], de->Rc, ack->RcId, de->RLength, de->complete);
-		}
-	} else {
-		/* Indication */
-		if (de->complete) {
-			len = de->RLength;
-		} else {
-			len = 270;
-			if (de->RLength <= 270)
-				eicon_log(ccard, 1, "eicon_cbk: ind not complete but <= 270\n");
-		}
-		skb = alloc_skb((sizeof(eicon_IND) + len - 1), GFP_ATOMIC);
-		if (!skb) {
-			eicon_log(ccard, 1, "eicon_io: skb_alloc failed in _idi_callback()\n");
-		} else {
-			ind = (eicon_IND *)skb_put(skb, (sizeof(eicon_IND) + len - 1));
-			ind->Ind = de->Ind;
-			ind->IndId = de->user[1];
-			ind->IndCh = de->IndCh;
-			ind->MInd  = de->Ind;
-			ind->RBuffer.length = len;
-			ind->MLength = de->RLength;
-			memcpy(&ind->RBuffer.P, &de->RBuffer->P, len);
-			skb_queue_tail(&ccard->rcvq, skb);
-			eicon_schedule_rx(ccard);
-			eicon_log(ccard, 128, "idi_cbk: Ch%d: Ind=%x Id=%x RLen=%x compl=%x\n",
-				de->user[0], de->Ind, ind->IndId, de->RLength, de->complete);
-		}
-	}
-
-	de->RNum = 0;
-	de->RNR = 0;
-	de->Rc = 0;
-	de->Ind = 0;
-}
-#endif /* CONFIG_ISDN_DRV_EICON_PCI */
-
-/*
- *  Transmit-Function
- */
-void
-eicon_io_transmit(eicon_card *ccard) {
-        eicon_isa_card *isa_card;
-        struct sk_buff *skb;
-        struct sk_buff *skb2;
-        unsigned long flags;
-	eicon_pr_ram  *prram = 0;
-	eicon_isa_com	*com = 0;
-	eicon_REQ *ReqOut = 0;
-	eicon_REQ *reqbuf = 0;
-	eicon_chan *chan;
-	eicon_chan_ptr *chan2;
-	int ReqCount;
-	int scom = 0;
-	int tmp = 0;
-	int tmpid = 0;
-	int quloop = 1;
-	int dlev = 0;
-	ENTITY *ep = 0;
-
-	isa_card = &ccard->hwif.isa;
-
-        if (!ccard) {
-               	eicon_log(ccard, 1, "eicon_transmit: NULL card!\n");
-                return;
-        }
-
-	switch(ccard->type) {
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-		case EICON_CTYPE_S:
-		case EICON_CTYPE_SX:
-		case EICON_CTYPE_SCOM:
-		case EICON_CTYPE_QUADRO:
-			scom = 1;
-			com = (eicon_isa_com *)isa_card->shmem;
-			break;
-		case EICON_CTYPE_S2M:
-			scom = 0;
-			prram = (eicon_pr_ram *)isa_card->shmem;
-			break;
-#endif
-#ifdef CONFIG_ISDN_DRV_EICON_PCI
-		case EICON_CTYPE_MAESTRAP:
-			scom = 2;
-			break;
-		case EICON_CTYPE_MAESTRAQ:
-			scom = 2;
-			break;
-		case EICON_CTYPE_MAESTRA:
-			scom = 2;
-			break;
-#endif
-		default:
-                	eicon_log(ccard, 1, "eicon_transmit: unsupported card-type!\n");
-			return;
-	}
-
-	ReqCount = 0;
-	if (!(skb2 = skb_dequeue(&ccard->sndq)))
-		quloop = 0; 
-	while(quloop) { 
-		spin_lock_irqsave(&eicon_lock, flags);
-		switch (scom) {
-		  case 1:
-			if ((ram_inb(ccard, &com->Req)) || (ccard->ReadyInt)) {
-				if (!ccard->ReadyInt) {
-					tmp = ram_inb(ccard, &com->ReadyInt) + 1;
-					ram_outb(ccard, &com->ReadyInt, tmp);
-					ccard->ReadyInt++;
-				}
-				spin_unlock_irqrestore(&eicon_lock, flags);
-                	        skb_queue_head(&ccard->sndq, skb2);
-       	                	eicon_log(ccard, 32, "eicon: transmit: Card not ready\n");
-	                        return;
-			}
-			break;
-		  case 0:
-	                if (!(ram_inb(ccard, &prram->ReqOutput) - ram_inb(ccard, &prram->ReqInput))) {
-				spin_unlock_irqrestore(&eicon_lock, flags);
-                	        skb_queue_head(&ccard->sndq, skb2);
-       	                	eicon_log(ccard, 32, "eicon: transmit: Card not ready\n");
-	                        return;
-        	        }
-			break;
-		}
-		spin_unlock_irqrestore(&eicon_lock, flags);
-
-		chan2 = (eicon_chan_ptr *)skb2->data;
-		chan = chan2->ptr;
-		if (!chan->e.busy) {
-		 if((skb = skb_dequeue(&chan->e.X))) { 
-
-		  reqbuf = (eicon_REQ *)skb->data;
-		  if ((reqbuf->Reference) && (chan->e.B2Id == 0) && (reqbuf->ReqId & 0x1f)) {
-			eicon_log(ccard, 16, "eicon: transmit: error Id=0 on %d (Net)\n", chan->No); 
-		  } else {
-			spin_lock_irqsave(&eicon_lock, flags);
-
-			switch (scom) {
-			  case 1:
-				ram_outw(ccard, &com->XBuffer.length, reqbuf->XBuffer.length);
-				ram_copytocard(ccard, &com->XBuffer.P, &reqbuf->XBuffer.P, reqbuf->XBuffer.length);
-				ram_outb(ccard, &com->ReqCh, reqbuf->ReqCh);
-				break;	
-			  case 0:
-				/* get address of next available request buffer */
-				ReqOut = (eicon_REQ *)&prram->B[ram_inw(ccard, &prram->NextReq)];
-				ram_outw(ccard, &ReqOut->XBuffer.length, reqbuf->XBuffer.length);
-				ram_copytocard(ccard, &ReqOut->XBuffer.P, &reqbuf->XBuffer.P, reqbuf->XBuffer.length);
-				ram_outb(ccard, &ReqOut->ReqCh, reqbuf->ReqCh);
-				ram_outb(ccard, &ReqOut->Req, reqbuf->Req); 
-				break;
-			}
-
-			dlev = 160;
-
-			if (reqbuf->ReqId & 0x1f) { /* if this is no ASSIGN */
-
-				if (!reqbuf->Reference) { /* Signal Layer */
-					switch (scom) {
-					  case 1:
-						ram_outb(ccard, &com->ReqId, chan->e.D3Id); 
-						break;
-					  case 0:
-						ram_outb(ccard, &ReqOut->ReqId, chan->e.D3Id); 
-						break;
-					  case 2:
-						ep = &chan->de;
-						break;
-					}
-					tmpid = chan->e.D3Id;
-					chan->e.ReqCh = 0; 
-				}
-				else {			/* Net Layer */
-					switch(scom) {
-					  case 1:
-						ram_outb(ccard, &com->ReqId, chan->e.B2Id); 
-						break;
-					  case 0:
-						ram_outb(ccard, &ReqOut->ReqId, chan->e.B2Id); 
-						break;
-					  case 2:
-						ep = &chan->be;
-						break;
-					}
-					tmpid = chan->e.B2Id;
-					chan->e.ReqCh = 1;
-					if (((reqbuf->Req & 0x0f) == 0x08) ||
-					   ((reqbuf->Req & 0x0f) == 0x01)) { /* Send Data */
-						chan->waitq = reqbuf->XBuffer.length;
-						chan->waitpq += reqbuf->XBuffer.length;
-						dlev = 128;
-					}
-				}
-
-			} else {	/* It is an ASSIGN */
-
-				switch(scom) {
-				  case 1:
-					ram_outb(ccard, &com->ReqId, reqbuf->ReqId); 
-					break;
-				  case 0:
-					ram_outb(ccard, &ReqOut->ReqId, reqbuf->ReqId); 
-					break;
-				  case 2:
-					if (!reqbuf->Reference) 
-						ep = &chan->de;
-					else
-						ep = &chan->be;
-					ep->Id = reqbuf->ReqId;
-					break;
-				}
-				tmpid = reqbuf->ReqId;
-
-				if (!reqbuf->Reference) 
-					chan->e.ReqCh = 0; 
-				 else
-					chan->e.ReqCh = 1; 
-			} 
-
-			switch(scom) {
-			  case 1:
-			 	chan->e.ref = ccard->ref_out++;
-				break;
-			  case 0:
-			 	chan->e.ref = ram_inw(ccard, &ReqOut->Reference);
-				break;
-			  case 2:
-				chan->e.ref = chan->No;
-				break;
-			}
-
-			chan->e.Req = reqbuf->Req;
-			ReqCount++; 
-
-			switch (scom) {
-			  case 1:
-				ram_outb(ccard, &com->Req, reqbuf->Req); 
-				break;
-			  case 0:
-				ram_outw(ccard, &prram->NextReq, ram_inw(ccard, &ReqOut->next)); 
-				break;
-			  case 2:
-#ifdef CONFIG_ISDN_DRV_EICON_PCI
-				if (!ep) break;
-				ep->callback = eicon_idi_callback;
-				ep->R = (BUFFERS *)ccard;
-				ep->user[0] = (word)chan->No;
-				ep->user[1] = (word)tmpid;
-				ep->XNum = 1;
-				ep->RNum = 0;
-				ep->RNR = 0;
-				ep->Rc = 0;
-				ep->Ind = 0;
-				ep->X->PLength = reqbuf->XBuffer.length;
-				memcpy(ep->X->P, &reqbuf->XBuffer.P, reqbuf->XBuffer.length);
-				ep->ReqCh = reqbuf->ReqCh;
-				ep->Req = reqbuf->Req;
-#endif
-				break;
-			}
-
-			chan->e.busy = 1;
-			spin_unlock_irqrestore(&eicon_lock, flags);
-	               	eicon_log(ccard, dlev, "eicon: Req=%d Id=%x Ch=%d Len=%d Ref=%d\n", 
-					reqbuf->Req, tmpid, 
-					reqbuf->ReqCh, reqbuf->XBuffer.length,
-					chan->e.ref); 
-#ifdef CONFIG_ISDN_DRV_EICON_PCI
-			if (scom == 2) {
-				if (ep) {
-					ccard->d->request(ep);
-					if (ep->Rc)
-						eicon_idi_callback(ep);
-				}
-			}
-#endif
-		  }
-		  dev_kfree_skb(skb);
-		 }
-		 dev_kfree_skb(skb2);
-		} 
-		else {
-			skb_queue_tail(&ccard->sackq, skb2);
-        	       	eicon_log(ccard, 128, "eicon: transmit: busy chan %d\n", chan->No); 
-		}
-
-		switch(scom) {
-			case 1:
-				quloop = 0;
-				break;
-			case 0:
-			case 2:
-				if (!(skb2 = skb_dequeue(&ccard->sndq)))
-					quloop = 0;
-				break;
-		}
-
-	}
-	if (!scom)
-		ram_outb(ccard, &prram->ReqInput, (__u8)(ram_inb(ccard, &prram->ReqInput) + ReqCount)); 
-
-	while((skb = skb_dequeue(&ccard->sackq))) { 
-		skb_queue_tail(&ccard->sndq, skb);
-	}
-}
-
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-/*
- * IRQ handler 
- */
-irqreturn_t
-eicon_irq(int irq, void *dev_id, struct pt_regs *regs) {
-	eicon_card *ccard = (eicon_card *)dev_id;
-        eicon_isa_card *isa_card;
-	eicon_pr_ram  *prram = 0;
-	eicon_isa_com	*com = 0;
-        eicon_RC *RcIn;
-        eicon_IND *IndIn;
-	struct sk_buff *skb;
-        int Count = 0;
-	int Rc = 0;
-	int Ind = 0;
-	unsigned char *irqprobe = 0;
-	int scom = 0;
-	int tmp = 0;
-	int dlev = 0;
-
-
-        if (!ccard) {
-                eicon_log(ccard, 1, "eicon_irq: spurious interrupt %d\n", irq);
-                return IRQ_NONE;
-        }
-
-	if (ccard->type == EICON_CTYPE_QUADRO) {
-		tmp = 4;
-		while(tmp) {
-			com = (eicon_isa_com *)ccard->hwif.isa.shmem;
-			if ((readb(ccard->hwif.isa.intack))) { /* quadro found */
-				break;
-			}
-			ccard = ccard->qnext;
-			tmp--;
-		}
-	}
-
-	isa_card = &ccard->hwif.isa;
-
-	switch(ccard->type) {
-		case EICON_CTYPE_S:
-		case EICON_CTYPE_SX:
-		case EICON_CTYPE_SCOM:
-		case EICON_CTYPE_QUADRO:
-			scom = 1;
-			com = (eicon_isa_com *)isa_card->shmem;
-			irqprobe = &isa_card->irqprobe;
-			break;
-		case EICON_CTYPE_S2M:
-			scom = 0;
-			prram = (eicon_pr_ram *)isa_card->shmem;
-			irqprobe = &isa_card->irqprobe;
-			break;
-		default:
-                	eicon_log(ccard, 1, "eicon_irq: unsupported card-type!\n");
-			return IRQ_NONE;
-	}
-
-	if (*irqprobe) {
-		switch(ccard->type) {
-			case EICON_CTYPE_S:
-			case EICON_CTYPE_SX:
-			case EICON_CTYPE_SCOM:
-			case EICON_CTYPE_QUADRO:
-				if (readb(isa_card->intack)) {
-        		               	writeb(0, &com->Rc);
-					writeb(0, isa_card->intack);
-				}
-				(*irqprobe)++;
-				break;
-			case EICON_CTYPE_S2M:
-				if (readb(isa_card->intack)) {
-        		               	writeb(0, &prram->RcOutput);
-					writeb(0, isa_card->intack);
-				}
-				(*irqprobe)++;
-				break;
-		}
-		return IRQ_HANDLED;
-	}
-
-	switch(ccard->type) {
-		case EICON_CTYPE_S:
-		case EICON_CTYPE_SX:
-		case EICON_CTYPE_SCOM:
-		case EICON_CTYPE_QUADRO:
-		case EICON_CTYPE_S2M:
-			if (!(readb(isa_card->intack))) { /* card did not interrupt */
-				eicon_log(ccard, 1, "eicon: IRQ: card reports no interrupt!\n");
-				return IRQ_NONE;
-			} 
-			break;
-	}
-
-    if (scom) {
-
-        /* if a return code is available ...  */
-	if ((tmp = ram_inb(ccard, &com->Rc))) {
-		eicon_RC *ack;
-		if (tmp == READY_INT) {
-                       	eicon_log(ccard, 64, "eicon: IRQ Rc=READY_INT\n");
-			if (ccard->ReadyInt) {
-				ccard->ReadyInt--;
-				ram_outb(ccard, &com->Rc, 0);
-				eicon_schedule_tx(ccard);
-			}
-		} else {
-			skb = alloc_skb(sizeof(eicon_RC), GFP_ATOMIC);
-			if (!skb) {
-                		eicon_log(ccard, 1, "eicon_io: skb_alloc failed in _irq()\n");
-			} else {
-				ack = (eicon_RC *)skb_put(skb, sizeof(eicon_RC));
-				ack->Rc = tmp;
-				ack->RcId = ram_inb(ccard, &com->RcId);
-				ack->RcCh = ram_inb(ccard, &com->RcCh);
-				ack->Reference = ccard->ref_in++;
-               	        	eicon_log(ccard, 128, "eicon: IRQ Rc=%d Id=%x Ch=%d Ref=%d\n",
-					tmp,ack->RcId,ack->RcCh,ack->Reference);
-				skb_queue_tail(&ccard->rackq, skb);
-				eicon_schedule_ack(ccard);
-			}
-			ram_outb(ccard, &com->Req, 0);
-			ram_outb(ccard, &com->Rc, 0);
-		}
-
-	} else {
-
-	        /* if an indication is available ...  */
-		if ((tmp = ram_inb(ccard, &com->Ind))) {
-			eicon_IND *ind;
-			int len = ram_inw(ccard, &com->RBuffer.length);
-			skb = alloc_skb((sizeof(eicon_IND) + len - 1), GFP_ATOMIC);
-			if (!skb) {
-                		eicon_log(ccard, 1, "eicon_io: skb_alloc failed in _irq()\n");
-			} else {
-				ind = (eicon_IND *)skb_put(skb, (sizeof(eicon_IND) + len - 1));
-				ind->Ind = tmp;
-				ind->IndId = ram_inb(ccard, &com->IndId);
-				ind->IndCh = ram_inb(ccard, &com->IndCh);
-				ind->MInd  = ram_inb(ccard, &com->MInd);
-				ind->MLength = ram_inw(ccard, &com->MLength);
-				ind->RBuffer.length = len;
-				if ((tmp == 1) || (tmp == 8))
-					dlev = 128;
-				else
-					dlev = 192;
-                       		eicon_log(ccard, dlev, "eicon: IRQ Ind=%d Id=%x Ch=%d MInd=%d MLen=%d Len=%d\n",
-					tmp,ind->IndId,ind->IndCh,ind->MInd,ind->MLength,len);
-				ram_copyfromcard(ccard, &ind->RBuffer.P, &com->RBuffer.P, len);
-				skb_queue_tail(&ccard->rcvq, skb);
-				eicon_schedule_rx(ccard);
-			}
-			ram_outb(ccard, &com->Ind, 0);
-		}
-	}
-
-    } else {
-
-        /* if return codes are available ...  */
-        if((Count = ram_inb(ccard, &prram->RcOutput))) {
-		eicon_RC *ack;
-                /* get the buffer address of the first return code */
-                RcIn = (eicon_RC *)&prram->B[ram_inw(ccard, &prram->NextRc)];
-                /* for all return codes do ...  */
-                while(Count--) {
-
-                        if((Rc=ram_inb(ccard, &RcIn->Rc))) {
-				skb = alloc_skb(sizeof(eicon_RC), GFP_ATOMIC);
-				if (!skb) {
-                			eicon_log(ccard, 1, "eicon_io: skb_alloc failed in _irq()\n");
-				} else {
-					ack = (eicon_RC *)skb_put(skb, sizeof(eicon_RC));
-					ack->Rc = Rc;
-					ack->RcId = ram_inb(ccard, &RcIn->RcId);
-					ack->RcCh = ram_inb(ccard, &RcIn->RcCh);
-					ack->Reference = ram_inw(ccard, &RcIn->Reference);
-        	                	eicon_log(ccard, 128, "eicon: IRQ Rc=%d Id=%x Ch=%d Ref=%d\n",
-						Rc,ack->RcId,ack->RcCh,ack->Reference);
-					skb_queue_tail(&ccard->rackq, skb);
-					eicon_schedule_ack(ccard);
-				}
-                       		ram_outb(ccard, &RcIn->Rc, 0);
-                        }
-                        /* get buffer address of next return code   */
-                        RcIn = (eicon_RC *)&prram->B[ram_inw(ccard, &RcIn->next)];
-                }
-                /* clear all return codes (no chaining!) */
-                ram_outb(ccard, &prram->RcOutput, 0);
-        }
-
-        /* if indications are available ... */
-        if((Count = ram_inb(ccard, &prram->IndOutput))) {
-		eicon_IND *ind;
-                /* get the buffer address of the first indication */
-                IndIn = (eicon_IND *)&prram->B[ram_inw(ccard, &prram->NextInd)];
-                /* for all indications do ... */
-                while(Count--) {
-			Ind = ram_inb(ccard, &IndIn->Ind);
-			if(Ind) {
-				int len = ram_inw(ccard, &IndIn->RBuffer.length);
-				skb = alloc_skb((sizeof(eicon_IND) + len - 1), GFP_ATOMIC);
-				if (!skb) {
-                			eicon_log(ccard, 1, "eicon_io: skb_alloc failed in _irq()\n");
-				} else {
-					ind = (eicon_IND *)skb_put(skb, (sizeof(eicon_IND) + len - 1));
-					ind->Ind = Ind;
-					ind->IndId = ram_inb(ccard, &IndIn->IndId);
-					ind->IndCh = ram_inb(ccard, &IndIn->IndCh);
-					ind->MInd  = ram_inb(ccard, &IndIn->MInd);
-					ind->MLength = ram_inw(ccard, &IndIn->MLength);
-					ind->RBuffer.length = len;
-					if ((Ind == 1) || (Ind == 8))
-						dlev = 128;
-					else
-						dlev = 192;
-                	        	eicon_log(ccard, dlev, "eicon: IRQ Ind=%d Id=%x Ch=%d MInd=%d MLen=%d Len=%d\n",
-						Ind,ind->IndId,ind->IndCh,ind->MInd,ind->MLength,len);
-	                                ram_copyfromcard(ccard, &ind->RBuffer.P, &IndIn->RBuffer.P, len);
-					skb_queue_tail(&ccard->rcvq, skb);
-					eicon_schedule_rx(ccard);
-				}
-				ram_outb(ccard, &IndIn->Ind, 0);
-                        }
-                        /* get buffer address of next indication  */
-                        IndIn = (eicon_IND *)&prram->B[ram_inw(ccard, &IndIn->next)];
-                }
-                ram_outb(ccard, &prram->IndOutput, 0);
-        }
-
-    } 
-
-	/* clear interrupt */
-	switch(ccard->type) {
-		case EICON_CTYPE_QUADRO:
-			writeb(0, isa_card->intack);
-			writeb(0, &com[0x401]);
-			break;
-		case EICON_CTYPE_S:
-		case EICON_CTYPE_SX:
-		case EICON_CTYPE_SCOM:
-		case EICON_CTYPE_S2M:
-			writeb(0, isa_card->intack);
-			break;
-	}
-
-  return IRQ_HANDLED;
-}
-#endif
diff -Nru a/drivers/isdn/eicon/eicon_isa.c b/drivers/isdn/eicon/eicon_isa.c
--- a/drivers/isdn/eicon/eicon_isa.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,454 +0,0 @@
-/* $Id: eicon_isa.c,v 1.1.4.1.2.3 2002/10/01 11:29:13 armin Exp $
- *
- * ISDN low-level module for Eicon active ISDN-Cards.
- * Hardware-specific code for old ISA cards.
- *
- * Copyright 1998      by Fritz Elfert (fritz@isdn4linux.de)
- * Copyright 1998-2000 by Armin Schindler (mac@melware.de)
- * Copyright 1999,2000 Cytronics & Melware (info@melware.de)
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#include <linux/config.h>
-#include "eicon.h"
-#include "eicon_isa.h"
-
-#define check_shmem   check_region
-#define release_shmem release_region
-#define request_shmem request_region
-
-char *eicon_isa_revision = "$Revision: 1.1.4.1.2.3 $";
-
-#undef EICON_MCA_DEBUG
-
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-
-/* Mask for detecting invalid IRQ parameter */
-static int eicon_isa_valid_irq[] = {
-	0x1c1c, /* 2, 3, 4, 10, 11, 12 (S)*/
-	0x1c1c, /* 2, 3, 4, 10, 11, 12 (SX) */
-	0x1cbc, /* 2, 3, 4, 5, 7, 10, 11, 12 (SCOM) */
-	0x1cbc, /* 2, 3, 4, 5, 6, 10, 11, 12 (Quadro) */
-	0x1cbc  /* 2, 3, 4, 5, 7, 10, 11, 12 (S2M) */
-};
-
-static void
-eicon_isa_release_shmem(eicon_isa_card *card) {
-	if (card->mvalid) {
-		iounmap(card->shmem);
-		release_mem_region(card->physmem, card->ramsize);
-	}
-	card->mvalid = 0;
-}
-
-static void
-eicon_isa_release_irq(eicon_isa_card *card) {
-	if (!card->master)
-		return;
-	if (card->ivalid)
-		free_irq(card->irq, card);
-	card->ivalid = 0;
-}
-
-void
-eicon_isa_release(eicon_isa_card *card) {
-	eicon_isa_release_irq(card);
-	eicon_isa_release_shmem(card);
-}
-
-void
-eicon_isa_printpar(eicon_isa_card *card) {
-	switch (card->type) {
-		case EICON_CTYPE_S:
-		case EICON_CTYPE_SX:
-		case EICON_CTYPE_SCOM:
-		case EICON_CTYPE_QUADRO:
-		case EICON_CTYPE_S2M:
-			printk(KERN_INFO "Eicon %s at 0x%lx, irq %d.\n",
-			       eicon_ctype_name[card->type],
-			       card->physmem,
-			       card->irq);
-	}
-}
-
-int
-eicon_isa_find_card(int Mem, int Irq, char * Id)
-{
-	int primary = 1;
-	unsigned long amem;
-
-	if (!strlen(Id))
-		return -1;
-
-	if (Mem == -1)
-		return -1;
-
-	/* Check for valid membase address */
-	if ((Mem < 0x0c0000) ||
-	    (Mem > 0x0fc000) ||
-	    (Mem & 0xfff)) { 
-		printk(KERN_WARNING "eicon_isa: invalid membase 0x%x for %s\n",
-			 Mem, Id);
-		return -1;
-	}
-	if (check_mem_region(Mem, RAMSIZE)) {
-		printk(KERN_WARNING "eicon_isa_boot: memory at 0x%x already in use.\n", Mem);
-		return -1;
-	}
-
-	amem = (unsigned long) ioremap(Mem, RAMSIZE);
-        writew(0x55aa, amem + 0x402);
-        if (readw(amem + 0x402) != 0x55aa) primary = 0;
-	writew(0, amem + 0x402);
-	if (readw(amem + 0x402) != 0) primary = 0;
-
-	printk(KERN_INFO "Eicon: Driver-ID: %s\n", Id);
-	if (primary) {
-		printk(KERN_INFO "Eicon: assuming pri card at 0x%x\n", Mem);
-		writeb(0, amem + 0x3ffe);
-		iounmap((unsigned char *)amem);
-		return EICON_CTYPE_ISAPRI;
-	} else {
-		printk(KERN_INFO "Eicon: assuming bri card at 0x%x\n", Mem);
-		writeb(0, amem + 0x400);
-		iounmap((unsigned char *)amem);
-		return EICON_CTYPE_ISABRI;
-	}
-	return -1;
-}
-
-int
-eicon_isa_bootload(eicon_isa_card *card, eicon_isa_codebuf *cb) {
-	int	tmp;
-	unsigned long     timeout;
-	eicon_isa_codebuf cbuf;
-	unsigned char     *code;
-	eicon_isa_boot    *boot;
-
-	if (copy_from_user(&cbuf, cb, sizeof(eicon_isa_codebuf)))
-		return -EFAULT;
-
-	/* Allocate code-buffer and copy code from userspace */
-	if (cbuf.bootstrap_len > 1024) {
-		printk(KERN_WARNING "eicon_isa_boot: Invalid startup-code size %ld\n",
-		       cbuf.bootstrap_len);
-		return -EINVAL;
-	}
-	if (!(code = kmalloc(cbuf.bootstrap_len, GFP_KERNEL))) {
-		printk(KERN_WARNING "eicon_isa_boot: Couldn't allocate code buffer\n");
-		return -ENOMEM;
-	}
-	if (copy_from_user(code, &cb->code, cbuf.bootstrap_len)) {
-		kfree(code);
-		return -EFAULT;
-	}
-
-	if (card->type == EICON_CTYPE_ISAPRI)
-		card->ramsize  = RAMSIZE_P;
-	else
-		card->ramsize  = RAMSIZE;
-
-	if (check_mem_region(card->physmem, card->ramsize)) {
-		printk(KERN_WARNING "eicon_isa_boot: memory at 0x%lx already in use.\n",
-			card->physmem);
-		kfree(code);
-		return -EBUSY;
-	}
-	request_mem_region(card->physmem, card->ramsize, "Eicon ISA ISDN");
-	card->shmem = (eicon_isa_shmem *) ioremap(card->physmem, card->ramsize);
-#ifdef EICON_MCA_DEBUG
-	printk(KERN_INFO "eicon_isa_boot: card->ramsize = %d.\n", card->ramsize);
-#endif
-	card->mvalid = 1;
-
-	switch(card->type) {
-		case EICON_CTYPE_S:
-		case EICON_CTYPE_SX:
-		case EICON_CTYPE_SCOM:
-		case EICON_CTYPE_QUADRO:
-		case EICON_CTYPE_ISABRI:
-			card->intack   = (__u8 *)card->shmem + INTACK;
-			card->startcpu = (__u8 *)card->shmem + STARTCPU;
-			card->stopcpu  = (__u8 *)card->shmem + STOPCPU;
-			break;
-		case EICON_CTYPE_S2M:
-		case EICON_CTYPE_ISAPRI:
-			card->intack   = (__u8 *)card->shmem + INTACK_P;
-			card->startcpu = (__u8 *)card->shmem + STARTCPU_P;
-			card->stopcpu  = (__u8 *)card->shmem + STOPCPU_P;
-			break;
-		default:
-			printk(KERN_WARNING "eicon_isa_boot: Invalid card type %d\n", card->type);
-			eicon_isa_release_shmem(card);
-			kfree(code);
-			return -EINVAL;
-	}
-
-	/* clear any pending irq's */
-	readb(card->intack);
-#ifdef CONFIG_MCA
-	if (MCA_bus) {
-		if (card->type == EICON_CTYPE_SCOM) {
-			outb_p(0,card->io+1);
-		}
-		else {
-			printk(KERN_WARNING "eicon_isa_boot: Card type not supported yet.\n");
-			eicon_isa_release_shmem(card);
-			return -EINVAL;
-		};
-
-#ifdef EICON_MCA_DEBUG
-	printk(KERN_INFO "eicon_isa_boot: card->io      = %x.\n", card->io);
-	printk(KERN_INFO "eicon_isa_boot: card->irq     = %d.\n", (int)card->irq);
-#endif
-	}
-#else
-	/* set reset-line active */
-	writeb(0, card->stopcpu); 
-#endif  /* CONFIG_MCA */
-	/* clear irq-requests */
-	writeb(0, card->intack);
-	readb(card->intack);
-
-	/* Copy code into card */
-	memcpy_toio(&card->shmem->c, code, cbuf.bootstrap_len);
-
-	/* Check for properly loaded code */
-	if (!check_signature((unsigned long)&card->shmem->c, code, 1020)) {
-		printk(KERN_WARNING "eicon_isa_boot: Could not load startup-code\n");
-		eicon_isa_release_shmem(card);
-		kfree(code);
-		return -EIO;
-	}
-	/* if 16k-ramsize, duplicate the reset-jump-code */
-	if (card->ramsize == RAMSIZE_P)
-		memcpy_toio((__u8 *)card->shmem + 0x3ff0, &code[0x3f0], 12);
-
-	kfree(code);
-	boot = &card->shmem->boot;
-
-	/* Delay 0.2 sec. */
-	SLEEP(HZ / 5);
-
-	/* Start CPU */
-	writeb(cbuf.boot_opt, &boot->ctrl);
-#ifdef CONFIG_MCA
-	if (MCA_bus) {
-		outb_p(0, card->io);
-	}
-#else 
-	writeb(0, card->startcpu); 
-#endif /* CONFIG_MCA */
-
-	/* Delay 0.2 sec. */
-	SLEEP(HZ / 5);
-
-	timeout = jiffies + (HZ * 22);
-	while (time_before(jiffies, timeout)) {
-		if (readb(&boot->ctrl) == 0)
-			break;
-		SLEEP(10);
-	}
-	if (readb(&boot->ctrl) != 0) {
-		printk(KERN_WARNING "eicon_isa_boot: CPU test failed.\n");
-#ifdef EICON_MCA_DEBUG
-		printk(KERN_INFO "eicon_isa_boot: &boot->ctrl = %d.\n",
-			readb(&boot->ctrl));
-#endif
-		eicon_isa_release_shmem(card);
-		return -EIO;
-	}
-
-	/* Check for memory-test errors */
-	if (readw(&boot->ebit)) {
-		printk(KERN_WARNING "eicon_isa_boot: memory test failed (bit 0x%04x at 0x%08x)\n",
-		       readw(&boot->ebit), readl(&boot->eloc));
-		eicon_isa_release_shmem(card);
-		return -EIO;
-	}
-
-        /* Check card type and memory size */
-        tmp = readb(&boot->card);
-	if ((tmp < 0) || (tmp > 4)) {
-		printk(KERN_WARNING "eicon_isa_boot: Type detect failed\n");
-		eicon_isa_release_shmem(card);
-		return -EIO;
-	}
-	card->type = tmp;
-	((eicon_card *)card->card)->type = tmp;
-
-        tmp = readb(&boot->msize);
-        if (tmp != 8 && tmp != 16 && tmp != 24 &&
-            tmp != 32 && tmp != 48 && tmp != 60) {
-                printk(KERN_WARNING "eicon_isa_boot: invalid memsize\n");
-		eicon_isa_release_shmem(card);
-                return -EIO;
-        }
-	printk(KERN_INFO "%s: startup-code loaded\n", eicon_ctype_name[card->type]); 
-	if ((card->type == EICON_CTYPE_QUADRO) && (card->master)) {
-		tmp = eicon_addcard(card->type, card->physmem, card->irq, 
-				((eicon_card *)card->card)->regname, 0);
-		printk(KERN_INFO "Eicon: %d adapters added\n", tmp);
-	}
-	return 0;
-}
-
-int
-eicon_isa_load(eicon_isa_card *card, eicon_isa_codebuf *cb) {
-	eicon_isa_boot    *boot;
-	int               tmp;
-	unsigned long     timeout;
-	int 		  j;
-	eicon_isa_codebuf cbuf;
-	unsigned char     *code;
-	unsigned char     *p;
-
-	if (copy_from_user(&cbuf, cb, sizeof(eicon_isa_codebuf)))
-		return -EFAULT;
-
-	if (!(code = kmalloc(cbuf.firmware_len, GFP_KERNEL))) {
-		printk(KERN_WARNING "eicon_isa_load: Couldn't allocate code buffer\n");
-		return -ENOMEM;
-	}
-
-	if (copy_from_user(code, &cb->code, cbuf.firmware_len)) {
-		kfree(code);
-		return -EFAULT;
-	}
-
-	boot = &card->shmem->boot;
-
-	if ((!card->ivalid) && card->master) {
-		card->irqprobe = 1;
-		/* Check for valid IRQ */
-		if ((card->irq < 0) || (card->irq > 15) || 
-		    (!((1 << card->irq) & eicon_isa_valid_irq[card->type & 0x0f]))) {
-			printk(KERN_WARNING "eicon_isa_load: invalid irq: %d\n", card->irq);
-			eicon_isa_release_shmem(card);
-			kfree(code);
-			return -EINVAL;
-		}
-		/* Register irq */
-		if (!request_irq(card->irq, &eicon_irq, 0, "Eicon ISA ISDN", card))
-			card->ivalid = 1;
-		else {
-			printk(KERN_WARNING "eicon_isa_load: irq %d already in use.\n",
-			       card->irq);
-			eicon_isa_release_shmem(card);
-			kfree(code);
-			return -EBUSY;
-		}
-	}
-
-        tmp = readb(&boot->msize);
-        if (tmp != 8 && tmp != 16 && tmp != 24 &&
-            tmp != 32 && tmp != 48 && tmp != 60) {
-                printk(KERN_WARNING "eicon_isa_load: invalid memsize\n");
-		eicon_isa_release_shmem(card);
-                return -EIO;
-        }
-
-	eicon_isa_printpar(card);
-
-	/* Download firmware */
-	printk(KERN_INFO "%s %dkB, loading firmware ...\n", 
-	       eicon_ctype_name[card->type],
-	       tmp * 16);
-	tmp = cbuf.firmware_len >> 8;
-	p = code;
-	while (tmp--) {
-		memcpy_toio(&boot->b, p, 256);
-		writeb(1, &boot->ctrl);
-		timeout = jiffies + HZ / 10;
-		while (time_before(jiffies, timeout)) {
-			if (readb(&boot->ctrl) == 0)
-				break;
-			SLEEP(2);
-		}
-		if (readb(&boot->ctrl)) {
-			printk(KERN_WARNING "eicon_isa_load: download timeout at 0x%x\n", p-code);
-			eicon_isa_release(card);
-			kfree(code);
-			return -EIO;
-		}
-		p += 256;
-	}
-	kfree(code);
-
-	/* Initialize firmware parameters */
-	memcpy_toio(&card->shmem->c[8], &cbuf.tei, 14);
-	memcpy_toio(&card->shmem->c[32], &cbuf.oad, 96);
-	memcpy_toio(&card->shmem->c[128], &cbuf.oad, 96);
-	
-	/* Start firmware, wait for signature */
-	writeb(2, &boot->ctrl);
-	timeout = jiffies + (5*HZ);
-	while (time_before(jiffies, timeout)) {
-		if (readw(&boot->signature) == 0x4447)
-			break;
-		SLEEP(2);
-	}
-	if (readw(&boot->signature) != 0x4447) {
-		printk(KERN_WARNING "eicon_isa_load: firmware selftest failed %04x\n",
-		       readw(&boot->signature));
-		eicon_isa_release(card);
-		return -EIO;
-	}
-
-	card->channels = readb(&card->shmem->c[0x3f6]);
-
-	/* clear irq-requests, reset irq-count */
-	readb(card->intack);
-	writeb(0, card->intack);
-
-	if (card->master) {
-		card->irqprobe = 1;
-		/* Trigger an interrupt and check if it is delivered */
-		tmp = readb(&card->shmem->com.ReadyInt);
-		tmp ++;
-		writeb(tmp, &card->shmem->com.ReadyInt);
-		timeout = jiffies + HZ / 5;
-		while (time_before(jiffies, timeout)) {
-			if (card->irqprobe > 1)
-				break;
-			SLEEP(2);
-		}
-		if (card->irqprobe == 1) {
-			printk(KERN_WARNING "eicon_isa_load: IRQ # %d test failed\n", card->irq);
-			eicon_isa_release(card);
-			return -EIO;
-		}
-	}
-#ifdef EICON_MCA_DEBUG
-	printk(KERN_INFO "eicon_isa_load: IRQ # %d test succeeded.\n", card->irq);
-#endif
-
-	writeb(card->irq, &card->shmem->com.Int);
-
-	/* initializing some variables */
-	((eicon_card *)card->card)->ReadyInt = 0;
-	((eicon_card *)card->card)->ref_in  = 1;
-	((eicon_card *)card->card)->ref_out = 1;
-	for(j=0; j<256; j++) ((eicon_card *)card->card)->IdTable[j] = NULL;
-	for(j=0; j< (card->channels + 1); j++) {
-		((eicon_card *)card->card)->bch[j].e.busy = 0;
-		((eicon_card *)card->card)->bch[j].e.D3Id = 0;
-		((eicon_card *)card->card)->bch[j].e.B2Id = 0;
-		((eicon_card *)card->card)->bch[j].e.ref = 0;
-		((eicon_card *)card->card)->bch[j].e.Req = 0;
-		((eicon_card *)card->card)->bch[j].e.complete = 1;
-		((eicon_card *)card->card)->bch[j].fsm_state = EICON_STATE_NULL;
-	}
-
-	printk(KERN_INFO "Eicon: Supported channels: %d\n", card->channels); 
-	printk(KERN_INFO "%s successfully started\n", eicon_ctype_name[card->type]);
-
-	/* Enable normal IRQ processing */
-	card->irqprobe = 0;
-	return 0;
-}
-
-#endif /* CONFIG_ISDN_DRV_EICON_ISA */
diff -Nru a/drivers/isdn/eicon/eicon_isa.h b/drivers/isdn/eicon/eicon_isa.h
--- a/drivers/isdn/eicon/eicon_isa.h	Tue Feb  3 19:45:43 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,121 +0,0 @@
-/* $Id: eicon_isa.h,v 1.1.4.1.2.2 2002/10/01 11:29:13 armin Exp $
- *
- * ISDN low-level module for Eicon active ISDN-Cards.
- *
- * Copyright 1998      by Fritz Elfert (fritz@isdn4linux.de)
- * Copyright 1998-2000 by Armin Schindler (mac@melware.de)
- * Copyright 1999,2000 Cytronics & Melware (info@melware.de)
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#ifndef eicon_isa_h
-#define eicon_isa_h
-
-#ifdef __KERNEL__
-#include <linux/config.h>
-
-/* Factory defaults for ISA-Cards */
-#define EICON_ISA_MEMBASE 0xd0000
-#define EICON_ISA_IRQ     3
-/* shmem offset for Quadro parts */
-#define EICON_ISA_QOFFSET 0x0800
-
-typedef struct {
-        __u16 length __attribute__ ((packed));   /* length of data/parameter field         */
-        __u8  P[270];                            /* data/parameter field                   */
-} eicon_scom_PBUFFER;
-
-/* General communication buffer */
-typedef struct {
-        __u8   Req;                                /* request register                       */
-	__u8   ReqId;                              /* request task/entity identification     */
-	__u8   Rc;                                 /* return code register                   */
-	__u8   RcId;                               /* return code task/entity identification */
-	__u8   Ind;                                /* Indication register                    */
-	__u8   IndId;                              /* Indication task/entity identification  */
-	__u8   IMask;                              /* Interrupt Mask Flag                    */
-	__u8   RNR;                                /* Receiver Not Ready (set by PC)         */
-	__u8   XLock;                              /* XBuffer locked Flag                    */
-	__u8   Int;                                /* ISDN interrupt                         */
-	__u8   ReqCh;                              /* Channel field for layer-3 Requests     */
-	__u8   RcCh;                               /* Channel field for layer-3 Returncodes  */
-	__u8   IndCh;                              /* Channel field for layer-3 Indications  */
-	__u8   MInd;                               /* more data indication field             */
-	__u16  MLength;                            /* more data total packet length          */
-	__u8   ReadyInt;                           /* request field for ready interrupt      */
-	__u8   Reserved[12];                       /* reserved space                         */
-	__u8   IfType;                             /* 1 = 16k-Interface                      */
-	__u16  Signature __attribute__ ((packed)); /* ISDN adapter Signature                 */
-	eicon_scom_PBUFFER XBuffer;                /* Transmit Buffer                        */
-	eicon_scom_PBUFFER RBuffer;                /* Receive Buffer                         */
-} eicon_isa_com;
-
-/* struct for downloading firmware */
-typedef struct {
-	__u8  ctrl;
-	__u8  card;
-	__u8  msize;
-	__u8  fill0;
-	__u16 ebit __attribute__ ((packed));
-	__u32 eloc __attribute__ ((packed));
-	__u8  reserved[20];
-	__u16 signature __attribute__ ((packed));
-	__u8  fill[224];
-	__u8  b[256];
-} eicon_isa_boot;
-
-/* Shared memory */
-typedef union {
-	unsigned char  c[0x400];
-	eicon_isa_com  com;
-	eicon_isa_boot boot;
-} eicon_isa_shmem;
-
-/*
- * card's description
- */
-typedef struct {
-	int               ramsize;
-	int               irq;	    /* IRQ                        */
-	unsigned long	  physmem;  /* physical memory address	  */
-#ifdef CONFIG_MCA
-	int		  io;	    /* IO-port for MCA brand      */
-#endif /* CONFIG_MCA */
-	void*             card;
-	eicon_isa_shmem*  shmem;    /* Shared-memory area         */
-	unsigned char*    intack;   /* Int-Acknowledge            */
-	unsigned char*    stopcpu;  /* Writing here stops CPU     */
-	unsigned char*    startcpu; /* Writing here starts CPU    */
-	unsigned char     type;     /* card type                  */
-	int		  channels; /* No. of channels		  */
-	unsigned char     irqprobe; /* Flag: IRQ-probing          */
-	unsigned char     mvalid;   /* Flag: Memory is valid      */
-	unsigned char     ivalid;   /* Flag: IRQ is valid         */
-	unsigned char     master;   /* Flag: Card ist Quadro 1/4  */
-} eicon_isa_card;
-
-/* Offsets for special locations on standard cards */
-#define INTACK     0x03fe 
-#define STOPCPU    0x0400
-#define STARTCPU   0x0401
-#define RAMSIZE    0x0400
-/* Offsets for special location on PRI card */
-#define INTACK_P   0x3ffc
-#define STOPCPU_P  0x3ffe
-#define STARTCPU_P 0x3fff
-#define RAMSIZE_P  0x4000
-
-
-extern int eicon_isa_load(eicon_isa_card *card, eicon_isa_codebuf *cb);
-extern int eicon_isa_bootload(eicon_isa_card *card, eicon_isa_codebuf *cb);
-extern void eicon_isa_release(eicon_isa_card *card);
-extern void eicon_isa_printpar(eicon_isa_card *card);
-extern void eicon_isa_transmit(eicon_isa_card *card);
-extern int eicon_isa_find_card(int Mem, int Irq, char * Id);
-
-#endif  /* __KERNEL__ */
-
-#endif	/* eicon_isa_h */
diff -Nru a/drivers/isdn/eicon/eicon_mod.c b/drivers/isdn/eicon/eicon_mod.c
--- a/drivers/isdn/eicon/eicon_mod.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,1642 +0,0 @@
-/* $Id: eicon_mod.c,v 1.1.4.1.2.4 2002/10/01 11:29:13 armin Exp $
- *
- * ISDN lowlevel-module for Eicon active cards.
- * 
- * Copyright 1997      by Fritz Elfert (fritz@isdn4linux.de)
- * Copyright 1998-2000 by Armin Schindler (mac@melware.de) 
- * Copyright 1999,2000 Cytronics & Melware (info@melware.de)
- * 
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- * Thanks to    Eicon Networks for
- *              documents, informations and hardware.
- *
- *		Deutsche Mailbox Saar-Lor-Lux GmbH
- *		for sponsoring and testing fax
- *		capabilities with Diva Server cards.
- *		(dor@deutschemailbox.de)
- *
- */
-
-#define DRIVERNAME "Eicon active ISDN driver"
-#define DRIVERRELEASE "2.0"
-#define DRIVERPATCH ".16"
-
-
-#include <linux/config.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#ifdef CONFIG_MCA
-#include <linux/mca.h>
-#include <linux/mca-legacy.h>
-#endif /* CONFIG_MCA */
-
-#include "eicon.h"
-
-#include <linux/isdn/capicmd.h>
-
-#undef N_DATA
-#include "adapter.h"
-#include "uxio.h"
-
-#define INCLUDE_INLINE_FUNCS
-
-static eicon_card *cards = (eicon_card *) NULL;   /* glob. var , contains
-                                                     start of card-list   */
-
-static char *eicon_revision = "$Revision: 1.1.4.1.2.4 $";
-
-extern char *eicon_pci_revision;
-extern char *eicon_isa_revision;
-extern char *eicon_idi_revision;
-
-extern int do_ioctl(struct inode *pDivasInode, struct file *pDivasFile,
-			unsigned int command, unsigned long arg);
-extern void eicon_pci_init_conf(eicon_card *card);
-
-#define EICON_CTRL_VERSION 2 
-
-ulong DebugVar;
-
-spinlock_t eicon_lock;
-
-DESCRIPTOR idi_d[32];
-
-/* Parameters to be set by insmod */
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-static int   membase      = -1;
-static int   irq          = -1;
-#endif
-static char *id           = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
-
-MODULE_DESCRIPTION(             "ISDN4Linux: Driver for Eicon active ISDN cards");
-MODULE_AUTHOR(                  "Armin Schindler");
-MODULE_LICENSE(                 "GPL");
-MODULE_PARM_DESC(id,   		"ID-String of first card");
-MODULE_PARM(id,           	"s");
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-MODULE_PARM_DESC(membase,	"Base address of first ISA card");
-MODULE_PARM_DESC(irq,    	"IRQ of first card");
-MODULE_PARM(membase,    	"i");
-MODULE_PARM(irq,          	"i");
-#endif
-
-char *eicon_ctype_name[] = {
-        "ISDN-S",
-        "ISDN-SX",
-        "ISDN-SCOM",
-        "ISDN-QUADRO",
-        "ISDN-S2M",
-        "DIVA Server BRI/PCI",
-        "DIVA Server 4BRI/PCI",
-        "DIVA Server 4BRI/PCI",
-        "DIVA Server PRI/PCI"
-};
-
-static char *
-eicon_getrev(const char *revision)
-{
-	char *rev;
-	char *p;
-	if ((p = strchr(revision, ':'))) {
-		rev = p + 2;
-		p = strchr(rev, '$');
-		*--p = 0;
-	} else rev = "?.??";
-	return rev;
-
-}
-
-static eicon_chan *
-find_channel(eicon_card *card, int channel)
-{
-	if ((channel >= 0) && (channel < card->nchannels))
-        	return &(card->bch[channel]);
-	eicon_log(card, 1, "eicon: Invalid channel %d\n", channel);
-	return NULL;
-}
-
-#ifdef CONFIG_PCI
-#ifdef CONFIG_ISDN_DRV_EICON_PCI
-/*
- * Find pcicard with given card number 
- */
-static inline eicon_card *
-eicon_findnpcicard(int driverid)
-{
-        eicon_card *p = cards;
-
-        while (p) {
-                if ((p->regname[strlen(p->regname)-1] == (driverid + '0')) &&
-			(p->bus == EICON_BUS_PCI))
-                        return p;
-                p = p->next;
-        }
-        return (eicon_card *) 0;
-}
-#endif
-#endif /* CONFIG_PCI */
-
-static void
-eicon_rcv_dispatch(unsigned long context)
-{
-	struct eicon_card *card = (struct eicon_card *)context;
-
-	switch (card->bus) {
-		case EICON_BUS_ISA:
-		case EICON_BUS_MCA:
-		case EICON_BUS_PCI:
-			eicon_io_rcv_dispatch(card);
-			break;
-		default:
-			eicon_log(card, 1,
-			       "eicon_rcv_dispatch: Illegal bustype %d\n", card->bus);
-	}
-}
-
-static void
-eicon_ack_dispatch(unsigned long context)
-{
-	struct eicon_card *card = (struct eicon_card *)context;
-
-	switch (card->bus) {
-		case EICON_BUS_ISA:
-		case EICON_BUS_MCA:
-		case EICON_BUS_PCI:
-			eicon_io_ack_dispatch(card);
-			break;
-		default:
-			eicon_log(card, 1,
-		       		"eicon_ack_dispatch: Illegal bustype %d\n", card->bus);
-	}
-}
-
-static void
-eicon_transmit(unsigned long context)
-{
-	struct eicon_card *card = (struct eicon_card *)context;
-
-	switch (card->bus) {
-		case EICON_BUS_ISA:
-		case EICON_BUS_MCA:
-		case EICON_BUS_PCI:
-			eicon_io_transmit(card);
-			break;
-		default:
-			eicon_log(card, 1,
-			       "eicon_transmit: Illegal bustype %d\n", card->bus);
-	}
-}
-
-static int
-eicon_command(eicon_card * card, isdn_ctrl * c)
-{
-        ulong a;
-        eicon_chan *chan;
-	eicon_cdef cdef;
-#ifdef CONFIG_PCI
-#ifdef CONFIG_ISDN_DRV_EICON_PCI
-	dia_start_t dstart;
-        int idi_length = 0;
-#endif
-#endif
-	isdn_ctrl cmd;
-	int ret = 0;
-	unsigned long flags;
- 
-	eicon_log(card, 16, "eicon_cmd 0x%x with arg 0x%lx (0x%lx)\n",
-		c->command, c->arg, (ulong) *c->parm.num);
-
-        switch (c->command) {
-		case ISDN_CMD_IOCTL:
-			memcpy(&a, c->parm.num, sizeof(ulong));
-			switch (c->arg) {
-				case EICON_IOCTL_GETVER:
-					return(EICON_CTRL_VERSION);
-				case EICON_IOCTL_GETTYPE:
-					if (card->bus == EICON_BUS_PCI) {
-						if (copy_to_user((char *)a,
-							&card->hwif.pci.master,
-								 sizeof(int)))
-							return -EFAULT;
-					}
-					return(card->type);
-				case EICON_IOCTL_GETMMIO:
-					switch (card->bus) {
-						case EICON_BUS_ISA:
-						case EICON_BUS_MCA:
-							return (int)card->hwif.isa.shmem;
-						default:
-							eicon_log(card, 1,
-							       "eicon: Illegal BUS type %d\n",
-							       card->bus);
-							ret = -ENODEV;
-					}
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-				case EICON_IOCTL_SETMMIO:
-					if (card->flags & EICON_FLAGS_LOADED)
-						return -EBUSY;
-					switch (card->bus) {
-						case EICON_BUS_ISA:
-							if (eicon_isa_find_card(a,
-								card->hwif.isa.irq,
-								card->regname) < 0)
-								return -EFAULT;
-							card->hwif.isa.shmem = (eicon_isa_shmem *)a;
-							return 0;
-						case EICON_BUS_MCA:
-#ifdef CONFIG_MCA
-							if (eicon_mca_find_card(
-								0, a,
-								card->hwif.isa.irq,
-								card->regname) < 0)
-								return -EFAULT;
-							card->hwif.isa.shmem = (eicon_isa_shmem *)a;
-							return 0;
-#endif /* CONFIG_MCA */
-						default:
-							eicon_log(card, 1,
-						      		"eicon: Illegal BUS type %d\n",
-							       card->bus);
-							ret = -ENODEV;
-					}					
-#endif
-				case EICON_IOCTL_GETIRQ:
-					switch (card->bus) {
-						case EICON_BUS_ISA:
-						case EICON_BUS_MCA:
-							return card->hwif.isa.irq;
-						default:
-							eicon_log(card, 1,
-							       "eicon: Illegal BUS type %d\n",
-							       card->bus);
-							ret = -ENODEV;
-					}
-				case EICON_IOCTL_SETIRQ:
-					if (card->flags & EICON_FLAGS_LOADED)
-						return -EBUSY;
-					if ((a < 2) || (a > 15))
-						return -EFAULT;
-					switch (card->bus) {
-						case EICON_BUS_ISA:
-						case EICON_BUS_MCA:
-							card->hwif.isa.irq = a;
-							return 0;
-						default:
-							eicon_log(card, 1,
-						      		"eicon: Illegal BUS type %d\n",
-							       card->bus);
-							ret = -ENODEV;
-					}					
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-				case EICON_IOCTL_LOADBOOT:
-					if (card->flags & EICON_FLAGS_RUNNING)
-						return -EBUSY;  
-					switch (card->bus) {
-						case EICON_BUS_ISA:
-						case EICON_BUS_MCA:
-							ret = eicon_isa_bootload(
-								&(card->hwif.isa),
-								&(((eicon_codebuf *)a)->isa));
-							break;
-						default:
-							eicon_log(card, 1,
-							       "eicon: Illegal BUS type %d\n",
-							       card->bus);
-							ret = -ENODEV;
-					}
-					return ret;
-#endif
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-				case EICON_IOCTL_LOADISA:
-					if (card->flags & EICON_FLAGS_RUNNING)
-						return -EBUSY;  
-					switch (card->bus) {
-						case EICON_BUS_ISA:
-						case EICON_BUS_MCA:
-							ret = eicon_isa_load(
-								&(card->hwif.isa),
-								&(((eicon_codebuf *)a)->isa));
-							if (!ret) {
-                                                                card->flags |= EICON_FLAGS_LOADED;
-                                                                card->flags |= EICON_FLAGS_RUNNING;
-								if (card->hwif.isa.channels > 1) {
-									cmd.command = ISDN_STAT_ADDCH;
-									cmd.driver = card->myid;
-									cmd.arg = card->hwif.isa.channels - 1;
-									card->interface.statcallb(&cmd);
-								}
-								cmd.command = ISDN_STAT_RUN;    
-								cmd.driver = card->myid;        
-								cmd.arg = 0;                    
-								card->interface.statcallb(&cmd);
-							}
-							break;
-						default:
-							eicon_log(card, 1,
-							       "eicon: Illegal BUS type %d\n",
-							       card->bus);
-							ret = -ENODEV;
-					}
-					return ret;
-#endif
-				case EICON_IOCTL_MANIF:
-					if (!card->flags & EICON_FLAGS_RUNNING)
-						return -ENODEV;
-					if (!card->d)
-						return -ENODEV;
-					if (!card->d->features & DI_MANAGE)
-						return -ENODEV;
-					ret = eicon_idi_manage(
-						card, 
-						(eicon_manifbuf *)a);
-					return ret;
-
-				case EICON_IOCTL_GETXLOG:
-					return -ENODEV;
-
-				case EICON_IOCTL_ADDCARD:
-					if (copy_from_user(&cdef, (char *)a,
-							   sizeof(cdef)))
-						return -EFAULT;
-					if (!(eicon_addcard(0, cdef.membase, cdef.irq, cdef.id, 0)))
-						return -EIO;
-					return 0;
-				case EICON_IOCTL_DEBUGVAR:
-					DebugVar = a;
-					eicon_log(card, 1, "Eicon: Debug Value set to %ld\n", DebugVar);
-					return 0;
-				case EICON_IOCTL_LOADPCI:
-					eicon_log(card, 1, "Eicon: Wrong version of load-utility,\n");
-					eicon_log(card, 1, "Eicon: re-compile eiconctrl !\n");
-					eicon_log(card, 1, "Eicon: Maybe update of utility is necessary !\n");
-					return -EINVAL;
-				default:	
-#ifdef CONFIG_PCI
-#ifdef CONFIG_ISDN_DRV_EICON_PCI
-					if (c->arg < EICON_IOCTL_DIA_OFFSET)
-						return -EINVAL;
-					if (copy_from_user(&dstart, (char *)a,
-							   sizeof(dstart)))
-						return -EFAULT;
-					if (!(card = eicon_findnpcicard(dstart.card_id)))
-						return -EINVAL;
-					ret = do_ioctl(NULL, NULL,
-						c->arg - EICON_IOCTL_DIA_OFFSET,
-						(unsigned long) a);
-					if (((c->arg - EICON_IOCTL_DIA_OFFSET)==DIA_IOCTL_START) && (!ret)) {
-						if (card->type != EICON_CTYPE_MAESTRAQ) {
-							DIVA_DIDD_Read(idi_d, sizeof(idi_d));
-                                                        for(idi_length = 0; idi_length < 32; idi_length++) {
-                                                          if (idi_d[idi_length].type == 0) break;
-                                                        }
-                                                        if ((idi_length < 1) || (idi_length >= 32)) {
-					                  eicon_log(card, 1, "eicon: invalid idi table length.\n");
-                                                          break;
-                                                        }
-							card->d = &idi_d[idi_length - 1];
-							card->flags |= EICON_FLAGS_LOADED;
-							card->flags |= EICON_FLAGS_RUNNING;
-							eicon_pci_init_conf(card);
-							if (card->d->channels > 1) {
-								cmd.command = ISDN_STAT_ADDCH;
-								cmd.driver = card->myid;
-								cmd.arg = card->d->channels - 1;
-								card->interface.statcallb(&cmd);
-							}
-							cmd.command = ISDN_STAT_RUN;    
-							cmd.driver = card->myid;        
-							cmd.arg = 0;                    
-							card->interface.statcallb(&cmd);
-							eicon_log(card, 1, "Eicon: %s started, %d channels (feat. 0x%x)\n",
-								(card->type == EICON_CTYPE_MAESTRA) ? "BRI" : "PRI",
-								card->d->channels, card->d->features);
-						} else {
-							int i;
-							DIVA_DIDD_Read(idi_d, sizeof(idi_d));
-                                                        for(idi_length = 0; idi_length < 32; idi_length++)
-                                                          if (idi_d[idi_length].type == 0) break;
-                                                        if ((idi_length < 1) || (idi_length >= 32)) {
-					                  eicon_log(card, 1, "eicon: invalid idi table length.\n");
-                                                          break;
-                                                        }
-        						for(i = 3; i >= 0; i--) {
-								if (!(card = eicon_findnpcicard(dstart.card_id - i)))
-									return -EINVAL;
-	
-								card->flags |= EICON_FLAGS_LOADED;
-								card->flags |= EICON_FLAGS_RUNNING;
-								card->d = &idi_d[idi_length - (i+1)];
-								eicon_pci_init_conf(card);
-								if (card->d->channels > 1) {
-									cmd.command = ISDN_STAT_ADDCH;
-									cmd.driver = card->myid;
-									cmd.arg = card->d->channels - 1;
-									card->interface.statcallb(&cmd);
-								}
-								cmd.command = ISDN_STAT_RUN;    
-								cmd.driver = card->myid;        
-								cmd.arg = 0;                    
-								card->interface.statcallb(&cmd);
-								eicon_log(card, 1, "Eicon: %d/4BRI started, %d channels (feat. 0x%x)\n",
-									4-i, card->d->channels, card->d->features);
-							}
-						}
-					}
-					return ret;
-#else
-					return -EINVAL;
-#endif
-#endif /* CONFIG_PCI */
-			}
-			break;
-		case ISDN_CMD_DIAL:
-			if (!card->flags & EICON_FLAGS_RUNNING)
-				return -ENODEV;
-			if (!(chan = find_channel(card, c->arg & 0x1f)))
-				break;
-			spin_lock_irqsave(&eicon_lock, flags);
-			if ((chan->fsm_state != EICON_STATE_NULL) && (chan->fsm_state != EICON_STATE_LISTEN)) {
-				spin_unlock_irqrestore(&eicon_lock, flags);
-				eicon_log(card, 1, "Dial on channel %d with state %d\n",
-					chan->No, chan->fsm_state);
-				return -EBUSY;
-			}
-			chan->fsm_state = EICON_STATE_OCALL;
-			spin_unlock_irqrestore(&eicon_lock, flags);
-			
-			ret = idi_connect_req(card, chan, c->parm.setup.phone,
-						     c->parm.setup.eazmsn,
-						     c->parm.setup.si1,
-						     c->parm.setup.si2);
-			if (ret) {
-				cmd.driver = card->myid;
-				cmd.command = ISDN_STAT_DHUP;
-				cmd.arg &= 0x1f;
-				card->interface.statcallb(&cmd);
-			}
-			return ret;
-		case ISDN_CMD_ACCEPTD:
-			if (!card->flags & EICON_FLAGS_RUNNING)
-				return -ENODEV;
-			if (!(chan = find_channel(card, c->arg & 0x1f)))
-				break;
-			if (chan->fsm_state == EICON_STATE_ICALL) { 
-				idi_connect_res(card, chan);
-			}
-			return 0;
-		case ISDN_CMD_ACCEPTB:
-			if (!card->flags & EICON_FLAGS_RUNNING)
-				return -ENODEV;
-			return 0;
-		case ISDN_CMD_HANGUP:
-			if (!card->flags & EICON_FLAGS_RUNNING)
-				return -ENODEV;
-			if (!(chan = find_channel(card, c->arg & 0x1f)))
-				break;
-			idi_hangup(card, chan);
-			return 0;
-		case ISDN_CMD_SETEAZ:
-			if (!card->flags & EICON_FLAGS_RUNNING)
-				return -ENODEV;
-			if (!(chan = find_channel(card, c->arg & 0x1f)))
-				break;
-			chan->eazmask = 0x3ff;
-			eicon_idi_listen_req(card, chan);
-			return 0;
-		case ISDN_CMD_CLREAZ:
-			if (!card->flags & EICON_FLAGS_RUNNING)
-				return -ENODEV;
-			if (!(chan = find_channel(card, c->arg & 0x1f)))
-				break;
-			chan->eazmask = 0;
-			eicon_idi_listen_req(card, chan);
-			return 0;
-		case ISDN_CMD_SETL2:
-			if (!card->flags & EICON_FLAGS_RUNNING)
-				return -ENODEV;
-			if (!(chan = find_channel(card, c->arg & 0x1f)))
-				break;
-			chan->l2prot = (c->arg >> 8);
-			return 0;
-		case ISDN_CMD_SETL3:
-			if (!card->flags & EICON_FLAGS_RUNNING)
-				return -ENODEV;
-			if (!(chan = find_channel(card, c->arg & 0x1f)))
-				break;
-			chan->l3prot = (c->arg >> 8);
-#ifdef CONFIG_ISDN_TTY_FAX
-			if (chan->l3prot == ISDN_PROTO_L3_FCLASS2) {
-				chan->fax = c->parm.fax;
-				eicon_log(card, 128, "idi_cmd: Ch%d: SETL3 struct fax=0x%x\n",chan->No, chan->fax);
-			}
-#endif
-			return 0;
-#ifdef CONFIG_ISDN_TTY_FAX
-		case ISDN_CMD_FAXCMD:
-			if (!card->flags & EICON_FLAGS_RUNNING)
-				return -ENODEV;
-			if (!(chan = find_channel(card, c->arg & 0x1f)))
-				break;
-			if (!chan->fax)
-				break;
-			idi_fax_cmd(card, chan);
-			return 0;
-#endif
-		case ISDN_CMD_AUDIO:
-			if (!card->flags & EICON_FLAGS_RUNNING)
-				return -ENODEV;
-			if (!(chan = find_channel(card, c->arg & 0x1f)))
-				break;
-			idi_audio_cmd(card, chan, c->arg >> 8, c->parm.num);
-			return 0;
-		case CAPI_PUT_MESSAGE:
-			if (!card->flags & EICON_FLAGS_RUNNING)
-				return -ENODEV;
-			if (!(chan = find_channel(card, c->arg & 0x1f)))
-				break;
-			if (c->parm.cmsg.Length < 8)
-				break;
-			switch(c->parm.cmsg.Command) {
-				case CAPI_FACILITY:
-					if (c->parm.cmsg.Subcommand == CAPI_REQ)
-						return(capipmsg(card, chan, &c->parm.cmsg));
-					break;
-				case CAPI_MANUFACTURER:
-				default:
-					break;
-			}
-			return 0;
-        }
-	
-        return -EINVAL;
-}
-
-/*
- * Find card with given driverId
- */
-static inline eicon_card *
-eicon_findcard(int driverid)
-{
-        eicon_card *p = cards;
-
-        while (p) {
-                if (p->myid == driverid)
-                        return p;
-                p = p->next;
-        }
-        return (eicon_card *) 0;
-}
-
-/*
- * Wrapper functions for interface to linklevel
- */
-static int
-if_command(isdn_ctrl * c)
-{
-        eicon_card *card = eicon_findcard(c->driver);
-
-        if (card)
-                return (eicon_command(card, c));
-        printk(KERN_ERR
-             "eicon: if_command %d called with invalid driverId %d!\n",
-               c->command, c->driver);
-        return -ENODEV;
-}
-
-static int
-if_writecmd(const u_char * buf, int len, int user, int id, int channel)
-{
-        return (len);
-}
-
-static int
-if_readstatus(u_char * buf, int len, int user, int id, int channel)
-{
-	int count = 0;
-	int cnt = 0;
-	ulong flags = 0;
-	u_char *p = buf;
-	struct sk_buff *skb;
-
-        eicon_card *card = eicon_findcard(id);
-	
-        if (card) {
-                if (!card->flags & EICON_FLAGS_RUNNING)
-                        return -ENODEV;
-	
-		spin_lock_irqsave(&eicon_lock, flags);
-		while((skb = skb_dequeue(&card->statq))) {
-
-			if ((skb->len + count) > len)
-				cnt = len - count;
-			else
-				cnt = skb->len;
-
-			if (user) {
-				spin_unlock_irqrestore(&eicon_lock, flags);
-				if (copy_to_user(p, skb->data, cnt))
-					return -EFAULT;
-				spin_lock_irqsave(&eicon_lock, flags);
-			}
-			else
-				memcpy(p, skb->data, cnt);
-
-			count += cnt;
-			p += cnt;
-
-			if (cnt == skb->len) {
-				dev_kfree_skb(skb);
-				if (card->statq_entries > 0)
-					card->statq_entries--;
-			} else {
-				skb_pull(skb, cnt);
-				skb_queue_head(&card->statq, skb);
-				spin_unlock_irqrestore(&eicon_lock, flags);
-				return count;
-			}
-		}
-		card->statq_entries = 0;
-		spin_unlock_irqrestore(&eicon_lock, flags);
-		return count;
-        }
-        printk(KERN_ERR
-               "eicon: if_readstatus called with invalid driverId!\n");
-        return 0;
-}
-
-static int
-if_sendbuf(int id, int channel, int ack, struct sk_buff *skb)
-{
-        eicon_card *card = eicon_findcard(id);
-	eicon_chan *chan;
-	int ret = 0;
-	int len;
-
-	len = skb->len;
-	
-        if (card) {
-                if (!card->flags & EICON_FLAGS_RUNNING)
-                        return -ENODEV;
-        	if (!(chan = find_channel(card, channel)))
-			return -ENODEV;
-
-		if (chan->fsm_state == EICON_STATE_ACTIVE) {
-#ifdef CONFIG_ISDN_TTY_FAX
-			if (chan->l2prot == ISDN_PROTO_L2_FAX) {
-				if ((ret = idi_faxdata_send(card, chan, skb)) > 0)
-					ret = len;
-			}
-			else
-#endif
-				ret = idi_send_data(card, chan, ack, skb, 1, 1);
-			return (ret);
-		} else {
-			return -ENODEV;
-		}
-        }
-        printk(KERN_ERR
-               "eicon: if_sendbuf called with invalid driverId!\n");
-        return -ENODEV;
-}
-
-/* jiftime() copied from HiSax */
-static inline int jiftime(char *s, long mark)
-{
-        s += 8;
-
-        *s-- = '\0';
-        *s-- = mark % 10 + '0';
-        mark /= 10;
-        *s-- = mark % 10 + '0';
-        mark /= 10;
-        *s-- = '.';
-        *s-- = mark % 10 + '0';
-        mark /= 10;
-        *s-- = mark % 6 + '0';
-        mark /= 6;
-        *s-- = ':';
-        *s-- = mark % 10 + '0';
-        mark /= 10;
-        *s-- = mark % 10 + '0';
-        return(8);
-}
-
-void
-eicon_putstatus(eicon_card * card, char * buf)
-{
-	ulong flags;
-	int count;
-	isdn_ctrl cmd;
-	u_char *p;
-	struct sk_buff *skb;
-
-	if (!card) {
-		if (!(card = cards))
-			return;
-	}
-
-	spin_lock_irqsave(&eicon_lock, flags);
-	count = strlen(buf);
-	skb = alloc_skb(count, GFP_ATOMIC);
-	if (!skb) {
-		spin_unlock_irqrestore(&eicon_lock, flags);
-		printk(KERN_ERR "eicon: could not alloc skb in putstatus\n");
-		return;
-	}
-	p = skb_put(skb, count);
-	memcpy(p, buf, count);
-
-	skb_queue_tail(&card->statq, skb);
-
-	if (card->statq_entries >= MAX_STATUS_BUFFER) {
-		if ((skb = skb_dequeue(&card->statq))) {
-			count -= skb->len;
-			dev_kfree_skb(skb);
-		} else
-			count = 0;
-	} else
-		card->statq_entries++;
-
-	spin_unlock_irqrestore(&eicon_lock, flags);
-        if (count) {
-                cmd.command = ISDN_STAT_STAVAIL;
-                cmd.driver = card->myid;
-                cmd.arg = count;
-		card->interface.statcallb(&cmd);
-        }
-}
-
-/*
- * Debug and Log 
- */
-void
-eicon_log(eicon_card * card, int level, const char *fmt, ...)
-{
-	va_list args;
-	char Line[160];
-	u_char *p;
-
-
-	if ((DebugVar & level) || (DebugVar & 256)) {
-		va_start(args, fmt);
-
-		if (DebugVar & level) {
-			if (DebugVar & 256) {
-				/* log-buffer */
-				p = Line;
-				p += jiftime(p, jiffies);
-				*p++ = 32;
-				p += vsprintf(p, fmt, args);
-				*p = 0;	
-				eicon_putstatus(card, Line);
-			} else {
-				/* printk, syslogd */
-				vsprintf(Line, fmt, args);
-				printk(KERN_DEBUG "%s", Line);
-			}
-		}
-
-		va_end(args);
-	}
-}
-
-
-/*
- * Allocate a new card-struct, initialize it
- * link it into cards-list.
- */
-static void
-eicon_alloccard(int Type, int membase, int irq, char *id, int card_id)
-{
-	int i;
-	int j;
-	int qloop;
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-	char qid[5];
-#endif
-        eicon_card *card;
-
-	qloop = (Type == EICON_CTYPE_QUADRO)?2:0;
-	for (i = 0; i <= qloop; i++) {
-		if (!(card = (eicon_card *) kmalloc(sizeof(eicon_card), GFP_KERNEL))) {
-			eicon_log(card, 1,
-			       "eicon: (%s) Could not allocate card-struct.\n", id);
-			return;
-		}
-		memset((char *) card, 0, sizeof(eicon_card));
-		skb_queue_head_init(&card->sndq);
-		skb_queue_head_init(&card->rcvq);
-		skb_queue_head_init(&card->rackq);
-		skb_queue_head_init(&card->sackq);
-		skb_queue_head_init(&card->statq);
-		card->statq_entries = 0;
-		tasklet_init(&card->snd_tq, eicon_transmit, (unsigned long)card);
-		tasklet_init(&card->rcv_tq, eicon_rcv_dispatch, (unsigned long)card);
-		tasklet_init(&card->ack_tq, eicon_ack_dispatch, (unsigned long)card);
-		card->interface.owner = THIS_MODULE;
-		card->interface.maxbufsize = 4000;
-		card->interface.command = if_command;
-		card->interface.writebuf_skb = if_sendbuf;
-		card->interface.writecmd = if_writecmd;
-		card->interface.readstat = if_readstatus;
-		card->interface.features =
-			ISDN_FEATURE_L2_X75I |
-			ISDN_FEATURE_L2_HDLC |
-			ISDN_FEATURE_L2_TRANS |
-			ISDN_FEATURE_L3_TRANS |
-			ISDN_FEATURE_P_UNKNOWN;
-		card->interface.hl_hdrlen = 20;
-		card->ptype = ISDN_PTYPE_UNKNOWN;
-		strlcpy(card->interface.id, id, sizeof(card->interface.id));
-		card->myid = -1;
-		card->type = Type;
-		switch (Type) {
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-#ifdef CONFIG_MCA /* only needed for MCA */
-                        case EICON_CTYPE_S:
-                        case EICON_CTYPE_SX:
-                        case EICON_CTYPE_SCOM:
-				if (MCA_bus) {
-	                                if (membase == -1)
-        	                                membase = EICON_ISA_MEMBASE;
-                	                if (irq == -1)
-                        	                irq = EICON_ISA_IRQ;
-	                                card->bus = EICON_BUS_MCA;
-        	                        card->hwif.isa.card = (void *)card;
-                	                card->hwif.isa.shmem = (eicon_isa_shmem *)membase;
-					card->hwif.isa.physmem = (unsigned long)membase;
-                        	        card->hwif.isa.master = 1;
-
-	                                card->hwif.isa.irq = irq;
-        	                        card->hwif.isa.type = Type;
-                	                card->nchannels = 2;
-                        	        card->interface.channels = 1;
-				} else {
-					printk(KERN_WARNING
-						"eicon (%s): no MCA bus detected.\n",
-						card->interface.id);
-					kfree(card);
-					return;
-				}
-                                break;
-#endif /* CONFIG_MCA */
-			case EICON_CTYPE_QUADRO:
-				if (membase == -1)
-					membase = EICON_ISA_MEMBASE;
-				if (irq == -1)
-					irq = EICON_ISA_IRQ;
-                                card->bus = EICON_BUS_ISA;
-				card->hwif.isa.card = (void *)card;
-				card->hwif.isa.shmem = (eicon_isa_shmem *)(membase + (i+1) * EICON_ISA_QOFFSET);
-				card->hwif.isa.physmem = (unsigned long)(membase + (i+1) * EICON_ISA_QOFFSET);
-				card->hwif.isa.master = 0;
-				strcpy(card->interface.id, id);
-				if (id[strlen(id) - 1] == 'a') {
-					card->interface.id[strlen(id) - 1] = 'a' + i + 1;
-				} else {
-					sprintf(qid, "_%c",'2' + i);
-					strcat(card->interface.id, qid);
-				}
-				printk(KERN_INFO "Eicon: Quadro: Driver-Id %s added.\n",
-					card->interface.id);
-				if (i == 0) {
-					eicon_card *p = cards;
-					while(p) {
-						if ((p->hwif.isa.master) && (p->hwif.isa.irq == irq)) {
-							p->qnext = card;
-							break;
-						}
-						p = p->next;
-					}
-					if (!p) {
-						eicon_log(card, 1, "eicon_alloccard: Quadro Master not found.\n");
-						kfree(card);
-						return;
-					}
-				} else {
-					cards->qnext = card;
-				}
-				card->hwif.isa.irq = irq;
-				card->hwif.isa.type = Type;
-				card->nchannels = 2;
-				card->interface.channels = 1;
-				break;
-#endif
-#ifdef CONFIG_PCI
-#ifdef CONFIG_ISDN_DRV_EICON_PCI
-			case EICON_CTYPE_MAESTRA:
-                                card->bus = EICON_BUS_PCI;
-				card->interface.features |=
-					ISDN_FEATURE_L2_V11096 |
-					ISDN_FEATURE_L2_V11019 |
-					ISDN_FEATURE_L2_V11038 |
-					ISDN_FEATURE_L2_MODEM |
-					ISDN_FEATURE_L2_FAX | 
-					ISDN_FEATURE_L3_TRANSDSP |
-					ISDN_FEATURE_L3_FCLASS2;
-                                card->hwif.pci.card = (void *)card;
-                                card->hwif.pci.master = card_id;
-                                card->hwif.pci.irq = irq;
-                                card->hwif.pci.type = Type;
-				card->flags = 0;
-                                card->nchannels = 2;
-				card->interface.channels = 1;
-				break;
-
-			case EICON_CTYPE_MAESTRAQ:
-                                card->bus = EICON_BUS_PCI;
-				card->interface.features |=
-					ISDN_FEATURE_L2_V11096 |
-					ISDN_FEATURE_L2_V11019 |
-					ISDN_FEATURE_L2_V11038 |
-					ISDN_FEATURE_L2_MODEM |
-					ISDN_FEATURE_L2_FAX | 
-					ISDN_FEATURE_L3_TRANSDSP |
-					ISDN_FEATURE_L3_FCLASS2;
-                                card->hwif.pci.card = (void *)card;
-                                card->hwif.pci.master = card_id;
-                                card->hwif.pci.irq = irq;
-                                card->hwif.pci.type = Type;
-				card->flags = 0;
-                                card->nchannels = 2;
-				card->interface.channels = 1;
-				break;
-
-			case EICON_CTYPE_MAESTRAP:
-                                card->bus = EICON_BUS_PCI;
-				card->interface.features |=
-					ISDN_FEATURE_L2_V11096 |
-					ISDN_FEATURE_L2_V11019 |
-					ISDN_FEATURE_L2_V11038 |
-					ISDN_FEATURE_L2_MODEM |
-					ISDN_FEATURE_L2_FAX |
-					ISDN_FEATURE_L3_TRANSDSP |
-					ISDN_FEATURE_L3_FCLASS2;
-                                card->hwif.pci.card = (void *)card;
-                                card->hwif.pci.master = card_id;
-                                card->hwif.pci.irq = irq;
-                                card->hwif.pci.type = Type;
-				card->flags = 0;
-                                card->nchannels = 30;
-				card->interface.channels = 1;
-				break;
-#endif
-#endif
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-			case EICON_CTYPE_ISABRI:
-				if (membase == -1)
-					membase = EICON_ISA_MEMBASE;
-				if (irq == -1)
-					irq = EICON_ISA_IRQ;
-				card->bus = EICON_BUS_ISA;
-				card->hwif.isa.card = (void *)card;
-				card->hwif.isa.shmem = (eicon_isa_shmem *)membase;
-				card->hwif.isa.physmem = (unsigned long)membase;
-				card->hwif.isa.master = 1;
-				card->hwif.isa.irq = irq;
-				card->hwif.isa.type = Type;
-				card->nchannels = 2;
-				card->interface.channels = 1;
-				break;
-			case EICON_CTYPE_ISAPRI:
-				if (membase == -1)
-					membase = EICON_ISA_MEMBASE;
-				if (irq == -1)
-					irq = EICON_ISA_IRQ;
-                                card->bus = EICON_BUS_ISA;
-				card->hwif.isa.card = (void *)card;
-				card->hwif.isa.shmem = (eicon_isa_shmem *)membase;
-				card->hwif.isa.physmem = (unsigned long)membase;
-				card->hwif.isa.master = 1;
-				card->hwif.isa.irq = irq;
-				card->hwif.isa.type = Type;
-				card->nchannels = 30;
-				card->interface.channels = 1;
-				break;
-#endif
-			default:
-				eicon_log(card, 1, "eicon_alloccard: Invalid type %d\n", Type);
-				kfree(card);
-				return;
-		}
-		if (!(card->bch = (eicon_chan *) kmalloc(sizeof(eicon_chan) * (card->nchannels + 1)
-							 , GFP_KERNEL))) {
-			eicon_log(card, 1,
-			       "eicon: (%s) Could not allocate bch-struct.\n", id);
-			kfree(card);
-			return;
-		}
-		for (j=0; j< (card->nchannels + 1); j++) {
-			memset((char *)&card->bch[j], 0, sizeof(eicon_chan));
-			card->bch[j].statectrl = 0;
-			card->bch[j].l2prot = ISDN_PROTO_L2_X75I;
-			card->bch[j].l3prot = ISDN_PROTO_L3_TRANS;
-			card->bch[j].e.D3Id = 0;
-			card->bch[j].e.B2Id = 0;
-			card->bch[j].e.Req = 0;
-			card->bch[j].No = j;
-			card->bch[j].tskb1 = NULL;
-			card->bch[j].tskb2 = NULL;
-			skb_queue_head_init(&card->bch[j].e.X);
-			skb_queue_head_init(&card->bch[j].e.R);
-		}
-
-#ifdef CONFIG_ISDN_DRV_EICON_PCI
-		/* *** Diva Server *** */
-		if (!(card->dbuf = (DBUFFER *) kmalloc((sizeof(DBUFFER) * (card->nchannels + 1))*2
-							 , GFP_KERNEL))) {
-			eicon_log(card, 1,
-			       "eicon: (%s) Could not allocate DBUFFER-struct.\n", id);
-			kfree(card);
-			kfree(card->bch);
-			return;
-		}
-		if (!(card->sbuf = (BUFFERS *) kmalloc((sizeof(BUFFERS) * (card->nchannels + 1)) * 2, GFP_KERNEL))) {
-			eicon_log(card, 1,
-			       "eicon: (%s) Could not allocate BUFFERS-struct.\n", id);
-			kfree(card);
-			kfree(card->bch);
-			kfree(card->dbuf);
-			return;
-		}
-		if (!(card->sbufp = (char *) kmalloc((270 * (card->nchannels + 1)) * 2, GFP_KERNEL))) {
-			eicon_log(card, 1,
-			       "eicon: (%s) Could not allocate BUFFERSP-struct.\n", id);
-			kfree(card);
-			kfree(card->bch);
-			kfree(card->dbuf);
-			kfree(card->sbuf);
-			return;
-		}
-		for (j=0; j< (card->nchannels + 1); j++) {
-			memset((char *)&card->dbuf[j], 0, sizeof(DBUFFER));
-			card->bch[j].de.RBuffer = (DBUFFER *)&card->dbuf[j];
-			memset((char *)&card->dbuf[j+(card->nchannels+1)], 0, sizeof(BUFFERS));
-			card->bch[j].be.RBuffer = (DBUFFER *)&card->dbuf[j+(card->nchannels+1)];
-
-			memset((char *)&card->sbuf[j], 0, sizeof(BUFFERS));
-			card->bch[j].de.X = (BUFFERS *)&card->sbuf[j];
-			memset((char *)&card->sbuf[j+(card->nchannels+1)], 0, sizeof(BUFFERS));
-			card->bch[j].be.X = (BUFFERS *)&card->sbuf[j+(card->nchannels+1)];
-
-			memset((char *)&card->sbufp[j], 0, 270);
-			card->bch[j].de.X->P = (char *)&card->sbufp[j * 270];
-			memset((char *)&card->sbufp[j+(card->nchannels+1)], 0, 270);
-			card->bch[j].be.X->P = (char *)&card->sbufp[(j+(card->nchannels+1)) * 270];
-		}
-		/* *** */
-#endif /* CONFIG_ISDN_DRV_EICON_PCI */
-
-		card->next = cards;
-		cards = card;
-	}
-}
-
-/*
- * register card at linklevel
- */
-static int
-eicon_registercard(eicon_card * card)
-{
-        switch (card->bus) {
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-		case EICON_BUS_ISA:
-			/* TODO something to print */
-			break;
-#ifdef CONFIG_MCA
-		case EICON_BUS_MCA:
-			eicon_isa_printpar(&card->hwif.isa);
-			break;
-#endif /* CONFIG_MCA */
-#endif
-		case EICON_BUS_PCI:
-			break;
-		default:
-			eicon_log(card, 1,
-			       "eicon_registercard: Illegal BUS type %d\n",
-			       card->bus);
-			return -1;
-        }
-        if (!register_isdn(&card->interface)) {
-                printk(KERN_WARNING
-                       "eicon_registercard: Unable to register %s\n",
-                       card->interface.id);
-                return -1;
-        }
-        card->myid = card->interface.channels;
-        sprintf(card->regname, "%s", card->interface.id);
-        return 0;
-}
-
-static void __exit
-unregister_card(eicon_card * card)
-{
-        isdn_ctrl cmd;
-
-        cmd.command = ISDN_STAT_UNLOAD;
-        cmd.driver = card->myid;
-        card->interface.statcallb(&cmd);
-        switch (card->bus) {
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-		case EICON_BUS_ISA:
-#ifdef CONFIG_MCA
-		case EICON_BUS_MCA:
-#endif /* CONFIG_MCA */
-			eicon_isa_release(&card->hwif.isa);
-			break;
-#endif
-		case EICON_BUS_PCI:
-			break;
-		default:
-			eicon_log(card, 1,
-			       "eicon: Invalid BUS type %d\n",
-			       card->bus);
-			break;
-        }
-}
-
-static void
-eicon_freecard(eicon_card *card) {
-	int i;
-
-	for(i = 0; i < (card->nchannels + 1); i++) {
-		skb_queue_purge(&card->bch[i].e.X);
-		skb_queue_purge(&card->bch[i].e.R);
-	}
-	skb_queue_purge(&card->sndq);
-	skb_queue_purge(&card->rcvq);
-	skb_queue_purge(&card->rackq);
-	skb_queue_purge(&card->sackq);
-	skb_queue_purge(&card->statq);
-
-#ifdef CONFIG_ISDN_DRV_EICON_PCI
-	kfree(card->sbufp);
-	kfree(card->sbuf);
-	kfree(card->dbuf);
-#endif
-	kfree(card->bch);
-	kfree(card);
-}
-
-int
-eicon_addcard(int Type, int membase, int irq, char *id, int card_id)
-{
-	eicon_card *p;
-	eicon_card *q = NULL;
-	int registered;
-	int added = 0;
-	int failed = 0;
-
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-	if (!Type) /* ISA */
-		if ((Type = eicon_isa_find_card(membase, irq, id)) < 0)
-			return 0;
-#endif
-	eicon_alloccard(Type, membase, irq, id, card_id);
-        p = cards;
-        while (p) {
-		registered = 0;
-		if (!p->interface.statcallb) {
-			/* Not yet registered.
-			 * Try to register and activate it.
-			 */
-			added++;
-			switch (p->bus) {
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-				case EICON_BUS_ISA:
-				case EICON_BUS_MCA:
-					if (eicon_registercard(p))
-						break;
-					registered = 1;
-					break;
-#endif
-				case EICON_BUS_PCI:
-#ifdef CONFIG_PCI
-#ifdef CONFIG_ISDN_DRV_EICON_PCI
-					if (eicon_registercard(p))
-						break;
-					registered = 1;
-					break;
-#endif
-#endif
-				default:
-					printk(KERN_ERR
-					       "eicon: addcard: Invalid BUS type %d\n",
-					       p->bus);
-			}
-		} else
-			/* Card already registered */
-			registered = 1;
-                if (registered) {
-			/* Init OK, next card ... */
-                        q = p;
-                        p = p->next;
-                } else {
-                        /* registering failed, remove card from list, free memory */
-                        printk(KERN_ERR
-                               "eicon: Initialization of %s failed\n",
-                               p->interface.id);
-                        if (q) {
-                                q->next = p->next;
-                                eicon_freecard(p);
-                                p = q->next;
-                        } else {
-                                cards = p->next;
-                                eicon_freecard(p);
-                                p = cards;
-                        }
-			failed++;
-                }
-	}
-        return (added - failed);
-}
-
-
-static int __init
-eicon_init(void)
-{
-	int card_count = 0;
-	char tmprev[50];
-
-	DebugVar = 1;
-	eicon_lock = (spinlock_t) SPIN_LOCK_UNLOCKED;
-
-        printk(KERN_INFO "%s Rev: ", DRIVERNAME);
-	strcpy(tmprev, eicon_revision);
-	printk("%s/", eicon_getrev(tmprev));
-	strcpy(tmprev, eicon_pci_revision);
-#ifdef CONFIG_ISDN_DRV_EICON_PCI
-	printk("%s/", eicon_getrev(tmprev));
-#else
-	printk("---/");
-#endif
-	strcpy(tmprev, eicon_isa_revision);
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-	printk("%s/", eicon_getrev(tmprev));
-#else
-	printk("---/");
-#endif
-	strcpy(tmprev, eicon_idi_revision);
-	printk("%s\n", eicon_getrev(tmprev));
-        printk(KERN_INFO "%s Release: %s%s\n", DRIVERNAME,
-		DRIVERRELEASE, DRIVERPATCH);
-
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-#ifdef CONFIG_MCA
-	/* Check if we have MCA-bus */
-        if (!MCA_bus)
-                {
-                printk(KERN_INFO
-                        "eicon: No MCA bus, ISDN-interfaces  not probed.\n");
-        } else {
-		eicon_log(NULL, 8,
-			"eicon_mca_find_card, irq=%d.\n", 
-				irq);
-               	if (!eicon_mca_find_card(0, membase, irq, id))
-                       card_count++;
-        };
-#else
-	card_count = eicon_addcard(0, membase, irq, id, 0);
-#endif /* CONFIG_MCA */
-#endif /* CONFIG_ISDN_DRV_EICON_ISA */
- 
-#ifdef CONFIG_PCI
-#ifdef CONFIG_ISDN_DRV_EICON_PCI
-	DivasCardsDiscover();
-	card_count += eicon_pci_find_card(id);
-#endif
-#endif
-
-        if (!cards) {
-#ifdef MODULE
-#ifndef CONFIG_ISDN_DRV_EICON_PCI
-#ifndef CONFIG_ISDN_DRV_EICON_ISA
-                printk(KERN_INFO "Eicon: Driver is neither ISA nor PCI compiled !\n");
-                printk(KERN_INFO "Eicon: Driver not loaded !\n");
-#else
-                printk(KERN_INFO "Eicon: No cards defined, driver not loaded !\n");
-#endif
-#else
-                printk(KERN_INFO "Eicon: No PCI-cards found, driver not loaded !\n");
-#endif
-#endif /* MODULE */
-		return -ENODEV;
-
-	} else
-		printk(KERN_INFO "Eicon: %d card%s added\n", card_count, 
-                       (card_count>1)?"s":"");
-        return 0;
-}
-
-#ifdef CONFIG_ISDN_DRV_EICON_PCI
-void DIVA_DIDD_Write(DESCRIPTOR *, int);
-EXPORT_SYMBOL_NOVERS(DIVA_DIDD_Read);
-EXPORT_SYMBOL_NOVERS(DIVA_DIDD_Write);
-EXPORT_SYMBOL_NOVERS(DivasPrintf);
-#else
-int DivasCardNext;
-card_t DivasCards[1];
-#endif
-
-static void __exit
-eicon_exit(void)
-{
-#ifdef CONFIG_PCI	
-#ifdef CONFIG_ISDN_DRV_EICON_PCI
-	card_t *pCard;
-	word wCardIndex;
-	extern int Divas_major;
-	int iTmp = 0;
-#endif
-#endif
-	
-        eicon_card *card = cards;
-        eicon_card *last;
-
-        while (card) {
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-#ifdef CONFIG_MCA
-        	if (MCA_bus)
-                        {
-                        mca_mark_as_unused (card->mca_slot);
-                        mca_set_adapter_procfn(card->mca_slot, NULL, NULL);
-                        };
-#endif /* CONFIG_MCA */
-#endif
-                unregister_card(card); 
-                card = card->next;
-        }
-        card = cards;
-        while (card) {
-                last = card;
-                card = card->next;
-		eicon_freecard(last);
-        }
-
-#ifdef CONFIG_PCI	
-#ifdef CONFIG_ISDN_DRV_EICON_PCI
-	pCard = DivasCards;
-	for (wCardIndex = 0; wCardIndex < MAX_CARDS; wCardIndex++)
-	{
-		if ((pCard->hw) && (pCard->hw->in_use))
-		{
-			(*pCard->card_reset)(pCard);
-			
-			UxIsrRemove(pCard->hw, pCard);
-			UxCardHandleFree(pCard->hw);
-
-			if(pCard->e_tbl != NULL)
-			{
-				kfree(pCard->e_tbl);
-			}
-
-			if(pCard->hw->card_type == DIA_CARD_TYPE_DIVA_SERVER_B)
-			{
-				release_region(pCard->hw->io_base,0x20);
-				release_region(pCard->hw->reset_base,0x80);
-			}
-
-                        // If this is a 4BRI ...
-                        if (pCard->hw->card_type == DIA_CARD_TYPE_DIVA_SERVER_Q)
-                        {
-                                // Skip over the next 3 virtual adapters
-                                wCardIndex += 3;
-
-                                // But free their handles
-				for (iTmp = 0; iTmp < 3; iTmp++)
-				{
-					pCard++;
-					UxCardHandleFree(pCard->hw);
-
-					if(pCard->e_tbl != NULL)
-					{
-						kfree(pCard->e_tbl);
-					}
-				}
-                        }
-		}
-		pCard++;
-	}
-	unregister_chrdev(Divas_major, "Divas");
-#endif
-#endif /* CONFIG_PCI */
-        printk(KERN_INFO "%s unloaded\n", DRIVERNAME);
-}
-
-#ifndef MODULE
-
-static int __init
-eicon_setup(char *line)
-{
-        int i, argc;
-	int ints[5];
-	char *str;
-
-	str = get_options(line, 4, ints);
-
-        argc = ints[0];
-        i = 1;
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-        if (argc) {
-		membase = irq = -1;
-		if (argc) {
-			membase = ints[i];
-			i++;
-			argc--;
-		}
-		if (argc) {
-			irq = ints[i];
-			i++;
-			argc--;
-		}
-		if (strlen(str)) {
-			strcpy(id, str);
-		} else {
-			strcpy(id, "eicon");
-		} 
-       		printk(KERN_INFO "Eicon ISDN active driver setup (id=%s membase=0x%x irq=%d)\n",
-			id, membase, irq);
-	}
-#else
-	printk(KERN_INFO "Eicon ISDN active driver setup\n");
-#endif
-	return(1);
-}
-__setup("eicon=", eicon_setup);
-
-#endif /* MODULE */
-
-#ifdef CONFIG_ISDN_DRV_EICON_ISA
-#ifdef CONFIG_MCA
-
-struct eicon_mca_adapters_struct {
-	char * name;
-	int adf_id;
-};
-/* possible MCA-brands of eicon cards                                         */
-struct eicon_mca_adapters_struct eicon_mca_adapters[] = {
-	{ "ISDN-P/2 Adapter", 0x6abb },
-	{ "ISDN-[S|SX|SCOM]/2 Adapter", 0x6a93 },
-	{ "DIVA /MCA", 0x6336 },
-	{ NULL, 0 },
-};
-
-int eicon_mca_find_card(int type,          /* type-idx of eicon-card          */
-                        int membase,
-		        int irq,
-			char * id)         /* name of eicon-isdn-dev          */
-{
-	int j, curr_slot = 0;
-
-       	eicon_log(NULL, 8,
-		"eicon_mca_find_card type: %d, membase: %#x, irq %d \n",
-		type, membase, irq);
-	/* find a no-driver-assigned eicon card                               */
-	for (j=0; eicon_mca_adapters[j].adf_id != 0; j++) 
-		{
-		for ( curr_slot=0; curr_slot<=MCA_MAX_SLOT_NR; curr_slot++) 
-			{
-			curr_slot = mca_find_unused_adapter(
-				         eicon_mca_adapters[j].adf_id, curr_slot);
-			if (curr_slot != MCA_NOTFOUND) 
-				{
-				/* check if pre-set parameters match
-				   these of the card, check cards memory      */
-				if (!(int) eicon_mca_probe(curr_slot,
-                                                           j,
-                                                	   membase, 
-                                                           irq,
-                                                           id))
-					{
-					return 0;
-					/* means: adapter parms did match     */
-					};
-			};
-			break;
-			/* MCA_NOTFOUND-branch: no matching adapter of
-			   THIS flavor found, next flavor                     */
-
-            	};
-	};
-	/* all adapter flavors checked without match, finito with:            */
-        return -ENODEV;
-};
-
-
-/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- *  stolen from 3c523.c/elmc_getinfo, ewe, 10.5.1999 
- */
-int eicon_info(char * buf, int slot, void *d)
-{
-	int len = 0;
-	struct eicon_card *dev;
-
-        dev = (struct eicon_card *) d;
-
-	if (dev == NULL)
-		return len;
-	len += sprintf(buf+len, "eicon ISDN adapter, type %d.\n",dev->type);
-	len += sprintf(buf+len, "IRQ: %d\n", dev->hwif.isa.irq);
-	len += sprintf(buf+len, "MEMBASE: %#lx\n", (unsigned long)dev->hwif.isa.shmem);
-
-	return len;
-};
-
-int eicon_mca_probe(int slot,  /* slot-nr where the card was detected         */
-		    int a_idx, /* idx-nr of probed card in eicon_mca_adapters */
-                    int membase,
-                    int irq,
-		    char * id) /* name of eicon-isdn-dev                      */
-{				
-	unsigned char adf_pos0;
-	int cards_irq, cards_membase, cards_io;
-	int type = EICON_CTYPE_S;
-	int irq_array[]={0,3,4,2};
-	int irq_array1[]={3,4,0,0,2,10,11,12};
-
-        adf_pos0 = mca_read_stored_pos(slot,2);
-	eicon_log(NULL, 8,
-		"eicon_mca_probe irq=%d, membase=%d\n", 
-		irq,
-		membase);
-	switch (a_idx) {
-		case 0:                /* P/2-Adapter (== PRI/S2M ? )         */
-			cards_membase= 0xC0000+((adf_pos0>>4)*0x4000);
-			if (membase == -1) { 
-				membase = cards_membase;
-			} else {
-				if (membase != cards_membase)
-					return -ENODEV;
-			};
-			cards_irq=irq_array[((adf_pos0 & 0xC)>>2)];
-			if (irq == -1) { 
-				irq = cards_irq;
-			} else {
-				if (irq != cards_irq)
-					return -ENODEV;
-			};
-			cards_io= 0xC00 + ((adf_pos0>>4)*0x10);
-			type = EICON_CTYPE_ISAPRI; 
-			break;
-
-		case 1:                /* [S|SX|SCOM]/2                       */
-			cards_membase= 0xC0000+((adf_pos0>>4)*0x2000);
-			if (membase == -1) { 
-				membase = cards_membase;
-			} else {
-				if (membase != cards_membase)
-					return -ENODEV;
-			};
-			cards_irq=irq_array[((adf_pos0 & 0xC)>>2)];
-			if (irq == -1) { 
-				irq = cards_irq;
-			} else {
-				if (irq != cards_irq)
-					return -ENODEV;
-			};
-
-			cards_io= 0xC00 + ((adf_pos0>>4)*0x10);
-			type = EICON_CTYPE_SCOM; 
-		 	break;	
-
-		case 2:                /* DIVA/MCA                            */
-			cards_io = 0x200+ ((adf_pos0>>4)* 0x20);
-			cards_irq = irq_array1[(adf_pos0 & 0x7)];
-			if (irq == -1) { 
-				irq = cards_irq;
-			} else {
-				if (irq != cards_irq)
-					return -ENODEV;
-			};
-			type = 0; 
-			break;
-		default:
-			return -ENODEV;
-	};
-	/* matching membase & irq */
-	if ( 1 == eicon_addcard(type, membase, irq, id, 0)) { 
-		mca_set_adapter_name(slot, eicon_mca_adapters[a_idx].name);
-  		mca_set_adapter_procfn(slot, (MCA_ProcFn) eicon_info, cards);
-
-        	mca_mark_as_used(slot);
-		cards->mca_slot = slot; 
-		/* card->io noch setzen  oder ?? */
-		cards->mca_io = cards_io;
-		cards->hwif.isa.io = cards_io;
-		/* reset card */
-		outb_p(0,cards_io+1);
-
-		eicon_log(NULL, 8, "eicon_addcard: successful for slot # %d.\n", 
-			cards->mca_slot+1);
-		return  0 ; /* eicon_addcard added a card */
-	} else {
-		return -ENODEV;
-	};
-};
-#endif /* CONFIG_MCA */
-#endif /* CONFIG_ISDN_DRV_EICON_ISA */
-
-module_init(eicon_init);
-module_exit(eicon_exit);
diff -Nru a/drivers/isdn/eicon/eicon_pci.c b/drivers/isdn/eicon/eicon_pci.c
--- a/drivers/isdn/eicon/eicon_pci.c	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,109 +0,0 @@
-/* $Id: eicon_pci.c,v 1.1.4.1.2.3 2002/10/01 11:29:13 armin Exp $
- *
- * ISDN low-level module for Eicon active ISDN-Cards.
- * Hardware-specific code for PCI cards.
- *
- * Copyright 1998-2000 by Armin Schindler (mac@melware.de)
- * Copyright 1999,2000 Cytronics & Melware (info@melware.de)
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- * Thanks to	Eicon Networks for 
- *		documents, informations and hardware. 
- *
- */
-
-#include <linux/config.h>
-#include <linux/pci.h>
-
-#include "eicon.h"
-#include "eicon_pci.h"
-
-#undef N_DATA
-#include "adapter.h"
-#include "uxio.h"
-
-char *eicon_pci_revision = "$Revision: 1.1.4.1.2.3 $";
-
-#ifdef CONFIG_PCI	         /* entire stuff is only for PCI */
-#ifdef CONFIG_ISDN_DRV_EICON_PCI
-
-int eicon_pci_find_card(char *ID)
-{
-	int pci_cards = 0;
-	int card_id = 0;
-	int had_q = 0;
-	int ctype = 0;
-	char did[20];
-	card_t *pCard;
-	word wCardIndex;
-
-	pCard = DivasCards;
-	for (wCardIndex = 0; wCardIndex < MAX_CARDS; wCardIndex++)
-	{
-	if ((pCard->hw) && (pCard->hw->in_use))
-		{
-			switch(pCard->hw->card_type) {
-				case DIA_CARD_TYPE_DIVA_SERVER:
-					ctype = EICON_CTYPE_MAESTRAP;
-					card_id++;
-					had_q = 0;
-					break;
-				case DIA_CARD_TYPE_DIVA_SERVER_B:
-					ctype = EICON_CTYPE_MAESTRA;
-					card_id++;
-					had_q = 0;
-					break;
-				case DIA_CARD_TYPE_DIVA_SERVER_Q:
-					ctype = EICON_CTYPE_MAESTRAQ;
-					if (!had_q)
-						card_id++;
-					if (++had_q >=4)
-						had_q = 0;
-					break;
-				default:
-					printk(KERN_ERR "eicon_pci: unknown card type %d !\n",
-						pCard->hw->card_type);
-					goto err;
-			}
-			sprintf(did, "%s%d", (strlen(ID) < 1) ? "eicon":ID, pci_cards);
-			if ((!ctype) || (!(eicon_addcard(ctype, 0, pCard->hw->irq, did, card_id)))) {
-				printk(KERN_ERR "eicon_pci: Card could not be added !\n");
-			} else {
-				pci_cards++;
-				printk(KERN_INFO "%s: DriverID='%s' CardID=%d\n",
-					eicon_ctype_name[ctype], did, card_id);
-			}
-err:;
-		}
-		pCard++;
-	}
-	return pci_cards;
-}
-
-void
-eicon_pci_init_conf(eicon_card *card)
-{
-	int j;
-
-	/* initializing some variables */
-	card->ReadyInt = 0;
-
-	for(j = 0; j < 256; j++)
-		card->IdTable[j] = NULL;
-
-	for(j = 0; j < (card->d->channels + 1); j++) {
-		card->bch[j].e.busy = 0;
-		card->bch[j].e.D3Id = 0;
-		card->bch[j].e.B2Id = 0;
-		card->bch[j].e.ref = 0;
-		card->bch[j].e.Req = 0;
-		card->bch[j].e.complete = 1;
-		card->bch[j].fsm_state = EICON_STATE_NULL;
-	}
-}
-
-#endif
-#endif	/* CONFIG_PCI */
-
diff -Nru a/drivers/isdn/eicon/eicon_pci.h b/drivers/isdn/eicon/eicon_pci.h
--- a/drivers/isdn/eicon/eicon_pci.h	Tue Feb  3 19:45:33 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,34 +0,0 @@
-/* $Id: eicon_pci.h,v 1.1.4.1.2.2 2002/10/01 11:29:13 armin Exp $
- *
- * ISDN low-level module for Eicon active ISDN-Cards (PCI part).
- *
- * Copyright 1998-2000 by Armin Schindler (mac@melware.de)
- * Copyright 1999,2000 Cytronics & Melware (info@melware.de)
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#ifndef eicon_pci_h
-#define eicon_pci_h
-
-#ifdef __KERNEL__
-
-/*
- * card's description
- */
-typedef struct {
-	int   		  irq;	    /* IRQ		          */
-	int		  channels; /* No. of supported channels  */
-        void*             card;
-        unsigned char     type;     /* card type                  */
-        unsigned char     master;   /* Flag: Card is Quadro 1/4   */
-} eicon_pci_card;
-
-extern int eicon_pci_find_card(char *ID);
-
-#endif  /* __KERNEL__ */
-
-#endif	/* eicon_pci_h */
-
diff -Nru a/drivers/isdn/eicon/fourbri.c b/drivers/isdn/eicon/fourbri.c
--- a/drivers/isdn/eicon/fourbri.c	Tue Feb  3 19:45:28 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,560 +0,0 @@
-/*
- * Diva Server 4BRI specific part of initialisation
- *
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.7  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#include "sys.h"
-#include "idi.h"
-#include "divas.h"
-#include "pc.h"
-#include "pr_pc.h"
-#include "dsp_defs.h"
-#include "constant.h"
-#include "adapter.h"
-#include "uxio.h"
-
-#define TEST_INT_DIVAS_Q	0x13
-
-#define	DIVAS_MAINT_OFFSET	0xff00	/* value for 4BRI card */
-#define MQ_BOARD_DSP_OFFSET 0x00a00000
-#define MQ_DSP1_ADDR_OFFSET 0x00000008
-#define MQ_DSP_JUNK_OFFSET  0x00000400
-#define MQ_DSP1_DATA_OFFSET 0x00000000
-#define MQ_BOARD_ISAC_DSP_RESET  0x00800028
-#define MQ_BREG_RISC  0x1200      /* RISC Reset */
-#define MQ_ISAC_DSP_RESET 0x0028 /* ISAC and DSP reset address offset */
-#define MQ_RISC_COLD_RESET_MASK         0x0001      /* RISC Cold reset                        */
-#define MQ_RISC_WARM_RESET_MASK         0x0002      /* RISC Warm reset                        */
-#define MQ_IRQ_REQ_ON                   0x1
-#define MQ_IRQ_REQ_OFF                  0x0
-#define MQ_BREG_IRQ_TEST                0x0608
-#define PLX9054_INTCSR      0x69 
-#define PLX9054_INT_ENA     0x09
-
-#define DIVAS_IOBASE	0x01
-#define M_PCI_RESET	0x10
-
-byte mem_in(ADAPTER *a, void *adr);
-word mem_inw(ADAPTER *a, void *adr);
-void mem_in_buffer(ADAPTER *a, void *adr, void *P, word length);
-void mem_look_ahead(ADAPTER *a, PBUFFER *RBuffer, ENTITY *e);
-void mem_out(ADAPTER *a, void *adr, byte data);
-void mem_outw(ADAPTER *a, void *adr, word data);
-void mem_out_buffer(ADAPTER *a, void *adr, void *P, word length);
-void mem_inc(ADAPTER *a, void *adr);
-
-int Divas4BRIInitPCI(card_t *card, dia_card_t *cfg);
-static int fourbri_ISR (card_t* card);
-
-int FPGA_Download(word, dword, byte *, byte *, int);
-extern byte FPGA_Bytes[];
-extern void *get_card(int);
-
-byte UxCardPortIoIn(ux_diva_card_t *card, byte *base, int offset);
-void UxCardPortIoOut(ux_diva_card_t *card, byte *base, int offset, byte);
-word GetProtFeatureValue(char *sw_id);
-
-void memcp(byte *dst, byte *src, dword dwLen);
-int memcm(byte *dst, byte *src, dword dwLen);
-
-static int diva_server_4bri_reset(card_t *card)
-{
-	byte *ctl;
-
-	DPRINTF(("divas: reset Diva Server 4BRI"));
-
-	ctl = UxCardMemAttach(card->hw, DIVAS_CTL_MEMORY);
-
-	/* stop RISC, DSP's and ISAC  */
-   UxCardMemOut(card->hw, &ctl[MQ_BREG_RISC], 0);
-   UxCardMemOut(card->hw, &ctl[MQ_ISAC_DSP_RESET], 0);
-
-	UxCardMemDetach(card->hw, ctl);
-
-	return 0;
-}
-
-static int diva_server_4bri_config(card_t *card, dia_config_t *config)
-{
-	byte *shared;
-	int i, j;
-
-	DPRINTF(("divas: configure Diva Server 4BRI"));
-
-	shared = (byte *) UxCardMemAttach(card->hw, DIVAS_SHARED_MEMORY);
-	
-	for (i=0; i<256; i++)
-	{
-		UxCardMemOut(card->hw, &shared[i], 0);
-	}
-
-	UxCardMemOut(card->hw, &shared[ 8], config->tei);
-	UxCardMemOut(card->hw, &shared[ 9], config->nt2);
-	UxCardMemOut(card->hw, &shared[10], config->sig_flags);
-	UxCardMemOut(card->hw, &shared[11], config->watchdog);
-	UxCardMemOut(card->hw, &shared[12], config->permanent);
-	UxCardMemOut(card->hw, &shared[13], config->x_interface);
-	UxCardMemOut(card->hw, &shared[14], config->stable_l2);
-	UxCardMemOut(card->hw, &shared[15], config->no_order_check);
-	UxCardMemOut(card->hw, &shared[16], config->handset_type);
-	UxCardMemOut(card->hw, &shared[17], 0);
-	UxCardMemOut(card->hw, &shared[18], config->low_channel);
-	UxCardMemOut(card->hw, &shared[19], config->prot_version);
-	UxCardMemOut(card->hw, &shared[20], config->crc4);
-
-	if ((card->hw->features) && (card->hw->features & PROTCAP_V90D))
-	{
-		DPRINTF(("divas: Signifying V.90"));
-		UxCardMemOut(card->hw, &shared[22], 4);
-	}
-	else
-	{
-		UxCardMemOut(card->hw, &shared[22], 0);
-	}
-
-	for (i=0; i<2; i++)
-	{
-		for (j=0; j<32; j++)
-		{
-			UxCardMemOut(card->hw, &shared[32+(i*96)+j],config->terminal[i].oad[j]);
-		}
-
-		for (j=0; j<32; j++)
-		{
-			UxCardMemOut(card->hw, &shared[64+(i*96)+j],config->terminal[i].osa[j]);
-		}
-
-		for (j=0; j<32; j++)
-		{
-			UxCardMemOut(card->hw, &shared[96+(i*96)+j],config->terminal[i].spid[j]);
-		}
-	}
-
-	UxCardMemDetach(card->hw, shared);
-
-	return 0;
-}
-
-static
-void diva_server_4bri_reset_int(card_t *card)
-{
-	byte *ctl;
-
-	ctl = UxCardMemAttach(card->hw, DIVAS_CTL_MEMORY);
-
-	UxCardMemOut(card->hw, &ctl[MQ_BREG_IRQ_TEST], MQ_IRQ_REQ_OFF);
-
-	UxCardMemDetach(card->hw, ctl);
-
-	return;
-}
-
- 
-static int diva_server_4bri_test_int(card_t *card)
-{
-	byte *ctl, i;
-	byte *reg;
-
-	DPRINTF(("divas: test interrupt for Diva Server 4BRI"));
-
-	/* We get the last (dummy) adapter in so we need to go back to the first */
-
-	card = get_card(card->cfg.card_id - 3);
-
-	/* Enable interrupts on PLX chip */
-
-	reg = UxCardMemAttach(card->hw, DIVAS_REG_MEMORY);
-
-	UxCardPortIoOut(card->hw, reg, PLX9054_INTCSR, PLX9054_INT_ENA);
-
-	UxCardMemDetach(card->hw, reg);
-
-	/* Set the test interrupt flag */
-	card->test_int_pend = TEST_INT_DIVAS_Q;
-
-	/* Now to trigger the interrupt */
-
-	ctl = UxCardMemAttach(card->hw, DIVAS_CTL_MEMORY);
-
-	UxCardMemOut(card->hw, &ctl[MQ_BREG_IRQ_TEST], MQ_IRQ_REQ_ON);
-
-	UxCardMemDetach(card->hw, ctl);
-
-	for (i = 0; i < 50; i++)
-	{
-		if (!card->test_int_pend)
-		{
-			break;
-		}
-		UxPause(10);
-	}
-
-	if (card->test_int_pend)
-	{
-		DPRINTF(("active: timeout waiting for card to interrupt"));
-		return (-1);
-	}
-	
-	return 0;
-}
-
-
-static void print_hdr(unsigned char *code, int offset)
-{
-	unsigned char hdr[80];
-	int i;
-
-	i = 0;
-
-	while ((i < (DIM(hdr) -1)) && 
-		(code[offset + i] != '\0') &&
-		(code[offset + i] != '\r') &&
-		(code[offset + i] != '\n'))
-	{
-		hdr[i] = code[offset + i];
-		i++;
-	}
-
-	hdr[i] = '\0';
-
-	DPRINTF(("divas: loading %s", hdr));
-}
-
-static int diva_server_4bri_load(card_t *card, dia_load_t *load)
-{
-	byte *pRAM=NULL;
-	int download_offset=0;
-	card_t *FirstCard;
-	byte sw_id[80];
-
-	DPRINTF(("divas: loading Diva Server 4BRI[%d]", load->card_id));
-
-	switch(load->code_type)
-	{
-		case DIA_CPU_CODE:
-			DPRINTF(("divas: RISC code"));
-			print_hdr(load->code, 0x80);
-			card->hw->features = GetProtFeatureValue((char *)&load->code[0x80]);
-			download_offset = 0; // Protocol code written to offset 0
-			pRAM = UxCardMemAttach(card->hw, DIVAS_RAM_MEMORY);
-			break;
-
-		case DIA_DSP_CODE:
-			DPRINTF(("divas: DSP code"));
-			print_hdr(load->code, 0x0); 
-			FirstCard = get_card(load->card_id - 3);
-			if ((card->hw->features) && (card->hw->features & PROTCAP_V90D))
-			{
-				download_offset = MQ_V90D_DSP_CODE_BASE;
-			}
-			else
-			{
-				download_offset = MQ_ORG_DSP_CODE_BASE;
-			}
-			pRAM = UxCardMemAttach(FirstCard->hw, DIVAS_RAM_MEMORY);
-			download_offset += (((sizeof(dword) + (sizeof(t_dsp_download_desc)* DSP_MAX_DOWNLOAD_COUNT)) + 3) & 0xFFFFFFFC);
-
-			break;
-
-		case DIA_TABLE_CODE:
-			DPRINTF(("divas: TABLE code"));
-			FirstCard = get_card(load->card_id - 3);
-			if ((card->hw->features) && (card->hw->features & PROTCAP_V90D))
-			{
-				download_offset = MQ_V90D_DSP_CODE_BASE + sizeof(dword);
-			}
-			else
-			{
-				download_offset = MQ_ORG_DSP_CODE_BASE + sizeof(dword);
-			}
-			pRAM = UxCardMemAttach(FirstCard->hw, DIVAS_RAM_MEMORY);
-			break;
-
-		case DIA_CONT_CODE:
-			DPRINTF(("divas: continuation code"));
-			break;
-
-        case DIA_DLOAD_CNT:
-			DPRINTF(("divas: COUNT code"));
-			FirstCard = get_card(load->card_id - 3);
-			if ((card->hw->features) && (card->hw->features & PROTCAP_V90D))
-			{
-				download_offset = MQ_V90D_DSP_CODE_BASE;
-			}
-			else
-			{
-				download_offset = MQ_ORG_DSP_CODE_BASE;
-			}
-			pRAM = UxCardMemAttach(FirstCard->hw, DIVAS_RAM_MEMORY);
-			break;
-
-		case DIA_FPGA_CODE:
-			DPRINTF(("divas: 4BRI FPGA download - %d bytes", load->length));
-			if (FPGA_Download(IDI_ADAPTER_MAESTRAQ,
- 			card->hw->io_base,
-			 sw_id,
-			 load->code,
-			 load->length
-			) == -1)
-			{
-				DPRINTF(("divas: FPGA download failed"));
-				return -1;
-			}
-
-			/* NOW reset the 4BRI */
-			diva_server_4bri_reset(card);
-			return 0; // No need for anything further loading
-
-		default:
-			DPRINTF(("divas: unknown code type"));
-			return -1;
-	}
-
-   memcp(pRAM + (download_offset & 0x3FFFFF), load->code, load->length);
-
-	{
-		int mism_off;
-	if ((mism_off = memcm(pRAM + (download_offset & 0x3FFFFF), load->code, load->length)))
-	{
-		DPRINTF(("divas: memory mismatch at offset %d", mism_off));
-		UxCardMemDetach(card->hw, pRAM);
-		return -1;
-	}
-	}
-
-	UxCardMemDetach(card->hw, pRAM);
-
-	return 0;
-}
-
-static int diva_server_4bri_start(card_t *card, byte *channels)
-{
-	byte *ctl;
-	byte *shared, i;
-	int adapter_num;
-
-	DPRINTF(("divas: start Diva Server 4BRI"));
-	*channels = 0;
-	card->is_live = FALSE;
-
-	ctl = UxCardMemAttach(card->hw, DIVAS_CTL_MEMORY);
-
-	UxCardMemOutW(card->hw, &ctl[MQ_BREG_RISC], MQ_RISC_COLD_RESET_MASK);
-
-	UxPause(2);
-
-	UxCardMemOutW(card->hw, &ctl[MQ_BREG_RISC], MQ_RISC_WARM_RESET_MASK | MQ_RISC_COLD_RESET_MASK);
-
-	UxPause(10);
-	
-	UxCardMemDetach(card->hw, ctl);
-
-	shared = (byte *) UxCardMemAttach(card->hw, DIVAS_SHARED_MEMORY);
-
-	for ( i = 0 ; i < 300 ; ++i )
-	{
-		UxPause (10) ;
-
-		if ( UxCardMemInW(card->hw, &shared[0x1E]) == 0x4447 )
-		{
-			DPRINTF(("divas: Protocol startup time %d.%02d seconds",
-			         (i / 100), (i % 100) ));
-
-			break;
-		}
-	}
-
-	if (i==300)
-	{
-		DPRINTF(("divas: Timeout starting card"));
-		DPRINTF(("divas: Signature == 0x%04X", UxCardMemInW(card->hw, &shared[0x1E])));
-
-		UxCardMemDetach(card->hw, shared);
-		return -1;
-	}
-
-	UxCardMemDetach(card->hw, shared);
-
-	for (adapter_num=3; adapter_num >= 0; adapter_num--)
-	{
-		card_t *qbri_card;
-
-		qbri_card = get_card(card->cfg.card_id - adapter_num);
-
-		if (qbri_card)
-		{
-			qbri_card->is_live = TRUE;
-			shared = UxCardMemAttach(qbri_card->hw, DIVAS_SHARED_MEMORY);
-			*channels += UxCardMemIn(qbri_card->hw, &shared[0x3F6]);
-			UxCardMemDetach(qbri_card->hw, shared);
-		}
-		else
-		{
-			DPRINTF(("divas: Couldn't get card info %d", card->cfg.card_id));
-		}
-	}
-
-	diva_server_4bri_test_int(card);
-
-	return 0;
-}
-
-static
-int 	diva_server_4bri_mem_get(card_t *card, mem_block_t *mem_block)
-
-{
-	byte	*a;
-	byte	*card_addr;
-	word	length = 0;
-	int		i;
-
-	a = UxCardMemAttach(card->hw, DIVAS_RAM_MEMORY);
-
-	card_addr = a;
-	card_addr += mem_block->addr;
-
-	for (i=0; i < sizeof(mem_block->data); i++)
-	{
-		mem_block->data[i] = UxCardMemIn(card->hw, card_addr);
-		card_addr++;
-		length++;
-	}
-
-	UxCardMemDetach(card->hw, a);
-
-	return length;
-}
-
-/*
- * Initialise 4BRI specific entry points
- */
-
-int Divas4BriInit(card_t *card, dia_card_t *cfg)
-{
-//	byte sw_id[80];
-//	extern int FPGA_Done;
-
-	DPRINTF(("divas: initialise Diva Server 4BRI"));
-
-	if (Divas4BRIInitPCI(card, cfg) == -1)
-	{
-		return -1;
-	}
-
-	/* Need to download the FPGA */
-/*	if (!FPGA_Done)
-	{
-		int retVal;
-
-		retVal=FPGA_Download(IDI_ADAPTER_MAESTRAQ,
- 			cfg->io_base,
-			 sw_id,
-			 FPGA_Bytes
-			);
-		if(retVal==-1)
-		{
-		
-			DPRINTF(("divas: FPGA Download Failed"));
-			return -1;
-
-		}
-		FPGA_Done = 1;
-	} */
-
-	card->card_reset = diva_server_4bri_reset;
-	card->card_load = diva_server_4bri_load;
-	card->card_config = diva_server_4bri_config;
-	card->card_start = diva_server_4bri_start;
-	card->reset_int = diva_server_4bri_reset_int;
-	card->card_mem_get = diva_server_4bri_mem_get;
-
-	card->xlog_offset = DIVAS_MAINT_OFFSET;
-
-	card->out = DivasOut;
-	card->test_int = DivasTestInt;
-	card->dpc = DivasDpc;
-	card->clear_int = DivasClearInt;
-	card->card_isr = fourbri_ISR;
-
-	card->a.ram_out = mem_out;
-	card->a.ram_outw = mem_outw;
-	card->a.ram_out_buffer = mem_out_buffer;
-	card->a.ram_inc = mem_inc;
-
-	card->a.ram_in = mem_in;
-	card->a.ram_inw = mem_inw;
-	card->a.ram_in_buffer = mem_in_buffer;
-	card->a.ram_look_ahead = mem_look_ahead;
-
-	return 0;
-}
-
-void memcp(byte *dst, byte *src, dword dwLen)
-{
-	while (dwLen)
-	{
-		*dst = *src;
-		dst++; src++;
-		dwLen--;
-	}
-}
-
-int memcm(byte *dst, byte *src, dword dwLen)
-{
-	int offset = 0;
-
-	while (offset < dwLen)
-	{
-		if(*dst != *src)
-			return (offset+1);
-
-		offset++;
-		src++;
-		dst++;
-	}
-
-	return 0;
-}
-
-
-
-/*int fourbri_ISR (card_t* card) 
-{
-	int served = 0;
-	byte *DivasIOBase = UxCardMemAttach(card->hw, DIVAS_IOBASE);
-	
-
-	if (UxCardPortIoIn (card->hw, DivasIOBase, M_PCI_RESET) & 0x01) 
-	{
-		served = 1;
-		card->int_pend  += 1;
-		DivasDpcSchedule(); 
-		UxCardPortIoOut (card->hw, DivasIOBase, M_PCI_RESET, 0x08);
-	}
-
-	UxCardMemDetach(card->hw, DivasIOBase);
-
-	return (served != 0);
-}*/
-
-
-static int fourbri_ISR (card_t* card) 
-{
-	byte *ctl;
-
-	card->int_pend  += 1;
-	DivasDpcSchedule(); /* ISR DPC */
-
-	ctl = UxCardMemAttach(card->hw, DIVAS_CTL_MEMORY);
-	UxCardMemOut(card->hw, &ctl[MQ_BREG_IRQ_TEST], MQ_IRQ_REQ_OFF);
-	UxCardMemDetach(card->hw, ctl);
-
-	return (1);
-}
diff -Nru a/drivers/isdn/eicon/fpga.c b/drivers/isdn/eicon/fpga.c
--- a/drivers/isdn/eicon/fpga.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,141 +0,0 @@
-/*
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.2  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#include "sys.h"
-#include "idi.h"
-#include "uxio.h"
-
-#define FPGA_PORT		0x6E
-#define FPGA_DLOAD_BUFLEN   	256
-#define NAME_OFFSET         	0x10
-#define NAME_MAXLEN         	12
-#define DATE_OFFSET         	0x2c
-#define DATE_MAXLEN         	10
-
-word UxCardPortIoInW(ux_diva_card_t *card, byte *base, int offset);
-void UxCardPortIoOutW(ux_diva_card_t *card, byte *base, int offset, word);
-void UxPause(long int);
-
-/*-------------------------------------------------------------------------*/
-/* Loads the FPGA configuration file onto the hardware.                    */
-/* Function returns 0 on success, else an error number.                    */
-/* On success, an identifier string is returned in the buffer              */
-/*                                                                         */
-/* A buffer of FPGA_BUFSIZE, a handle to the already opened bitstream      */
-/* file and a file read function has to be provided by the operating       */
-/* system part.                                                            */
-/* ----------------------------------------------------------------------- */
-int FPGA_Download( word      cardtype,
-                        dword     RegBase,
-                        byte *strbuf,
-                        byte FPGA_SRC[],
-			int FPGA_LEN
-                      )
-{
-  word        i, j, k;
-  word        baseval, Mask_PROGRAM, Mask_DONE, Mask_CCLK, Mask_DIN;
-  dword       addr;
-  byte        *pFPGA;
-
-  //--- check for legal cardtype
-  switch (cardtype)
-  {
-    case IDI_ADAPTER_MAESTRAQ:
-      addr          = RegBase ; // address where to access FPGA
-      Mask_PROGRAM  = 0x0001;         // FPGA pins at address
-      Mask_DONE     = 0x0002;
-      Mask_CCLK     = 0x0100;
-      Mask_DIN      = 0x0400;
-      baseval       = 0x000d;         // PROGRAM hi, CCLK lo, DIN lo by default
-    break;
-      
-    default:
-	
-  	DPRINTF(("divas: FPGA Download ,Illegal Card"));
-      	return -1; // illegal card 
-  }
-
-  //--- generate id string from file content
-  for (j=NAME_OFFSET, k=0; j<(NAME_OFFSET+NAME_MAXLEN); j++, k++) //name
-  {
-    if (!FPGA_SRC[j]) break;
-    strbuf[k] = FPGA_SRC[j];
-  } 
-  strbuf[k++] = ' ';
-  for (j=DATE_OFFSET; j<(DATE_OFFSET+DATE_MAXLEN); j++, k++) // date
-  {
-    if (!FPGA_SRC[j]) break;
-    strbuf[k] = FPGA_SRC[j];
-  } 
-  strbuf[k] = 0;
-
-  DPRINTF(("divas: FPGA Download - %s", strbuf));
-
-  //--- prepare download, Pulse PROGRAM pin down.
-  UxCardPortIoOutW(NULL, (byte *) addr, FPGA_PORT, baseval &~Mask_PROGRAM);  // PROGRAM low pulse
-  UxCardPortIoOutW(NULL, (byte *) addr, FPGA_PORT, baseval);                 // release
-  UxPause(50);  // wait until FPGA finised internal memory clear
-  
-  //--- check done pin, must be low
-  if (UxCardPortIoInW(NULL, (byte *) addr, FPGA_PORT) &Mask_DONE) 
-  {
-    DPRINTF(("divas: FPGA_ERR_DONE_WRONG_LEVEL"));
-    return -1;
-  }
-
-  pFPGA = FPGA_SRC;
-
-  i = 0; 
-  /* Move past the header */
-  while ((FPGA_SRC[i] != 0xFF) && (i < FPGA_LEN)) 
-  {
-    i++;
-  }
-
-  // We've hit the 0xFF so move on to the next byte
-  // i++;
-  DPRINTF(("divas: FPGA Code starts at offset %d", i));
-
-  //--- put data onto the FPGA
-  for (;i<FPGA_LEN; i++)
-  {
-    //--- put byte onto FPGA
-    for (j=0; j<8; j++)
-    {
-      if (FPGA_SRC[i] &(0x80>>j)) baseval |= Mask_DIN; // write a hi
-      else                      baseval &=~Mask_DIN; // write a lo
-      UxCardPortIoOutW(NULL, (byte *) addr, FPGA_PORT, baseval);
-      UxCardPortIoOutW(NULL, (byte *) addr, FPGA_PORT, baseval | Mask_CCLK);     // set CCLK hi
-      UxCardPortIoOutW(NULL, (byte *) addr, FPGA_PORT, baseval);                 // set CCLK lo
-    }
-  }
-
-  //--- add some additional startup clock cycles and check done pin
-  for (i=0; i<5; i++) 
-  {
-    UxCardPortIoOutW(NULL, (byte *) addr, FPGA_PORT, baseval | Mask_CCLK);     // set CCLK hi
-    UxCardPortIoOutW(NULL, (byte *) addr, FPGA_PORT, baseval);                 // set CCLK lo
-  }
-
-  UxPause(100);
-
-  if (UxCardPortIoInW(NULL, (byte *) addr, FPGA_PORT) &Mask_DONE) 
-  {
-    DPRINTF(("divas: FPGA download successful"));
-  }
-  else
-  {
-    DPRINTF(("divas: FPGA download failed - 0x%x", UxCardPortIoInW(NULL, (byte *) addr, FPGA_PORT)));
-	return -1;
-  }
-
-return 0;
-}
-
diff -Nru a/drivers/isdn/eicon/idi.c b/drivers/isdn/eicon/idi.c
--- a/drivers/isdn/eicon/idi.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,854 +0,0 @@
-/*
- * Core driver for Diva Server cards
- * Implements the IDI interface
- *
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.8  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#include "idi.h"
-#include "adapter.h"
-#include "pc.h"
-#include "pr_pc.h"
-#include "sys.h"
-#include "uxio.h"
-
-/* IDI request functions */
-
-static void	request(card_t *card, ENTITY *e);
-
-static void req_0(ENTITY *e)	{ request(&DivasCards[ 0], e); }
-static void req_1(ENTITY *e)	{ request(&DivasCards[ 1], e); }
-static void req_2(ENTITY *e)	{ request(&DivasCards[ 2], e); }
-static void req_3(ENTITY *e)	{ request(&DivasCards[ 3], e); }
-static void req_4(ENTITY *e)	{ request(&DivasCards[ 4], e); }
-static void req_5(ENTITY *e)	{ request(&DivasCards[ 5], e); }
-static void req_6(ENTITY *e)	{ request(&DivasCards[ 6], e); }
-static void req_7(ENTITY *e)	{ request(&DivasCards[ 7], e); }
-static void req_8(ENTITY *e)	{ request(&DivasCards[ 8], e); }
-static void req_9(ENTITY *e)	{ request(&DivasCards[ 9], e); }
-static void req_10(ENTITY *e)	{ request(&DivasCards[10], e); }
-static void req_11(ENTITY *e)	{ request(&DivasCards[11], e); }
-static void req_12(ENTITY *e)	{ request(&DivasCards[12], e); }
-static void req_13(ENTITY *e)	{ request(&DivasCards[13], e); }
-static void req_14(ENTITY *e)	{ request(&DivasCards[14], e); }
-static void req_15(ENTITY *e)	{ request(&DivasCards[15], e); }
-
-IDI_CALL DivasIdiRequest[16] =
-{
-    &req_0,		&req_1,		&req_2,		&req_3,
-    &req_4,		&req_5,		&req_6,		&req_7,
-    &req_8,		&req_9,		&req_10,	&req_11,
-	&req_12,	&req_13,	&req_14,	&req_15
-};
-
-#define PR_RAM  ((struct pr_ram *)0)
-#define RAM ((struct dual *)0)
-
-/*------------------------------------------------------------------*/
-/* local function prototypes                                        */
-/*------------------------------------------------------------------*/
-
-static byte isdn_rc(ADAPTER *, byte, byte, byte, word);
-static byte isdn_ind(ADAPTER *, byte, byte, byte, PBUFFER *, byte, word);
-
-/*
- * IDI related functions
- */
-
-static
-ENTITY	*entity_ptr(ADAPTER *a, byte e_no)
-{
-	card_t	*card;
-
-	card = a->io;
-
-	return card->e_tbl[e_no].e;
-}
-
-static
-void	CALLBACK(ADAPTER *a, ENTITY *e)
-{
-	card_t	*card = a->io;
-
-	if (card->log_types & DIVAS_LOG_IDI)
-	{
-		DivasLogIdi(card, e, FALSE);
-	}
-
-	(*e->callback)(e);
-}
-
-static
-void	*PTR_P(ADAPTER *a, ENTITY *e, void *P)
-{
-	return(P);
-}
-
-static
-void	*PTR_R(ADAPTER *a, ENTITY *e)
-{
-	return((void*)e->R);
-}
-
-static
-void	*PTR_X(ADAPTER *a, ENTITY *e)
-{
-	return((void*)e->X);
-}
-
-static
-void	free_entity(ADAPTER *a, byte e_no) 
-{
-	card_t	*card;
-	int		ipl;
-
-	card = a->io;
-
-	ipl = UxCardLock(card->hw);
-
-	card->e_tbl[e_no].e = NULL;
-	card->e_count--;
-
-	UxCardUnlock(card->hw, ipl);
-
-	return;
-}
-
-static
-void	assign_queue(ADAPTER * a, byte e_no, word ref)
-{
-	card_t	*card;
-	int		ipl;
-
-	card = a->io;
-
-	ipl = UxCardLock(card->hw);
-
-	card->e_tbl[e_no].assign_ref = ref;
-	card->e_tbl[e_no].next = card->assign;
-	card->assign = e_no;
-
-	UxCardUnlock(card->hw, ipl);
-
-	return;
-}
-
-static
-byte	get_assign(ADAPTER *a, word ref)
-{
-	card_t	*card;
-	byte	e_no;
-	int		ipl;
-
-	card = a->io;
-
-	ipl = UxCardLock(card->hw);
-
-	e_no = (byte)card->assign;
-	while (e_no)
-	{
-		if (card->e_tbl[e_no].assign_ref == ref)
-		{
-			break;
-		}
-		e_no = card->e_tbl[e_no].next;
-	}
-
-	UxCardUnlock(card->hw, ipl);
-
-	return e_no;
-}
-
-static
-void	req_queue(ADAPTER * a, byte e_no)
-{
-	card_t	*card;
-	int		ipl;
-
-	card = a->io;
-
-	ipl = UxCardLock(card->hw);
-
-	card->e_tbl[e_no].next = 0;
-
-	if (card->e_head)
-	{
-		card->e_tbl[card->e_tail].next = e_no;
-		card->e_tail = e_no;
-	}
-	else
-	{
-		card->e_head = e_no;
-		card->e_tail = e_no;
-	}
-
-	UxCardUnlock(card->hw, ipl);
-
-	return;
-}
-
-static
-byte	look_req(ADAPTER * a)
-{
-	card_t	*card;
-
-	card = a->io;
-
-	return(card->e_head);
-}
-
-static
-void	next_req(ADAPTER * a)
-{
-	card_t	*card;
-	int		ipl;
-
-
-	card = a->io;
-
-	ipl = UxCardLock(card->hw);
-
-	card->e_head = card->e_tbl[card->e_head].next;
-	if (!card->e_head)
-	{
-		card->e_tail = 0;
-	}
-
-	UxCardUnlock(card->hw, ipl);
-
-	return;
-}
-
-
-/*
- * IDI request function for active cards
- */
-static
-void	request(card_t *card, ENTITY *e)
-{
-	word	*special_req;
-	int		i;
-	int		ipl;
-
-
-	if (card->log_types & DIVAS_LOG_IDI)
-	{
-		DivasLogIdi(card, e, TRUE);
-	}
-
-	if (!e->Req)
-	{
-		special_req = (word *) e;
-
-		switch (*special_req)
-		{
-		case REQ_REMOVE:
-			return;
-
-		case REQ_NAME:
-			for (i=0; i < DIM(card->cfg.name); i++)
-			{
-				((struct get_name_s *) e)->name[i] = card->cfg.name[i];
-			}
-			return;
-
-		case REQ_SERIAL:
-		case REQ_XLOG:
-			DPRINTF(("IDI: attempted REQ_SERIAL or REQ_XLOG"));
-			return;
-
-		default:
-			return;
-		}
-	}
-
-	ipl = UxCardLock(card->hw);
-
-   	if (!(e->Id & 0x1f))
-	{
-		DPRINTF(("IDI: ASSIGN req"));
-
-		for (i = 1; i < card->e_max; i++)
-		{
-			if (!card->e_tbl[i].e)
-			{
-				break;
-			}
-		}
-
-		if (i == card->e_max)
-		{
-			DPRINTF(("IDI: request all ids in use (IDI req ignored)"));
-			UxCardUnlock(card->hw, ipl);
-			e->Rc = OUT_OF_RESOURCES;
-			return;
-		}
-
-		card->e_tbl[i].e = e;
-		card->e_count++;
-
-		e->No = (byte) i;
-		e->More = 0;
-		e->RCurrent = 0xff;
-	}
-	else
-	{
-		i = e->No;
-	}
-    
-    if (e->More & XBUSY)
-	{
-		DPRINTF(("IDI: request - entity is busy"));
-		UxCardUnlock(card->hw, ipl);
-		return;
-	}
-
-	e->More |= XBUSY;
-	e->More &= ~ XMOREF;
-	e->XCurrent = 0;
-	e->XOffset = 0;
-
-	card->e_tbl[i].next = 0;
-
-	if(card->e_head)
-	{
-		card->e_tbl[card->e_tail].next = i;
-		card->e_tail = i;
-	}
-	else
-	{
-		card->e_head = i;
-		card->e_tail = i;
-	}
-
-	UxCardUnlock(card->hw, ipl);
-
-	DivasScheduleRequestDpc();
-
-	return;
-}
-
-static byte pr_ready(ADAPTER * a)
-{
-  byte ReadyCount;
-
-  ReadyCount = (byte)(a->ram_in(a, &PR_RAM->ReqOutput) -
-                      a->ram_in(a, &PR_RAM->ReqInput));
-
-  if(!ReadyCount) {
-    if(!a->ReadyInt) {
-      a->ram_inc(a, &PR_RAM->ReadyInt);
-      a->ReadyInt++;
-    }
-  }
-  return ReadyCount;
-}
-
-/*------------------------------------------------------------------*/
-/* output function                                                  */
-/*------------------------------------------------------------------*/
-
-void DivasOut(ADAPTER * a)
-{
-  byte e_no;
-  ENTITY  * this = NULL;
-  BUFFERS  *X;
-  word length;
-  word i;
-  word clength;
-  REQ * ReqOut;
-  byte more;
-  byte ReadyCount;
-  byte ReqCount;
-  byte Id;
-
-        /* while a request is pending ...                           */
-  e_no = look_req(a);
-  if(!e_no)
-  {
-    return;
-  }
-
-  ReadyCount = pr_ready(a);
-  if(!ReadyCount)
-  {
-    DPRINTF(("IDI: card not ready for next request"));
-    return;
-  }
-
-  ReqCount = 0;
-  while(e_no && ReadyCount) {
-
-    next_req(a);
-
-    this = entity_ptr(a, e_no);
-
-#ifdef	USE_EXTENDED_DEBUGS
-	if ( !this )
-	{
-		ISDN_ADAPTER *io = (ISDN_ADAPTER *)a->io ;
-		DBG_FTL(("!A%d ==> NULL entity ptr - try to ignore", (int)io->ANum))
-		e_no = look_req(a) ;
-		ReadyCount-- ;
-		continue ;
-	}
-	{
-		ISDN_ADAPTER *io = (ISDN_ADAPTER *)a->io ;
-		DPRINTF(("IDI: >A%d Id=0x%x Req=0x%x", io->ANum, this->Id, this->Req))
-	}
-#else
-    DPRINTF(("IDI: >REQ=%x,Id=%x,Ch=%x",this->Req,this->Id,this->ReqCh));
-#endif
-
-        /* get address of next available request buffer             */
-    ReqOut = (REQ *)&PR_RAM->B[a->ram_inw(a, &PR_RAM->NextReq)];
-
-        /* now copy the data from the current data buffer into the  */
-        /* adapters request buffer                                  */
-    length = 0;
-    i = this->XCurrent;
-    X = PTR_X(a,this);
-    while(i<this->XNum && length<270) {
-      clength = (word)(270-length);
-      if (clength > X[i].PLength-this->XOffset)
-	      clength = X[i].PLength-this->XOffset;
-      a->ram_out_buffer(a,
-                        &ReqOut->XBuffer.P[length],
-                        PTR_P(a,this,&X[i].P[this->XOffset]),
-                        clength);
-
-      length +=clength;
-      this->XOffset +=clength;
-      if(this->XOffset==X[i].PLength) {
-        this->XCurrent = (byte)++i;
-        this->XOffset = 0;
-      }
-    }
-
-    a->ram_outw(a, &ReqOut->XBuffer.length, length);
-    a->ram_out(a, &ReqOut->ReqId, this->Id);
-    a->ram_out(a, &ReqOut->ReqCh, this->ReqCh);
-
-        /* if it's a specific request (no ASSIGN) ...                */
-
-    if(this->Id &0x1f) {
-
-        /* if buffers are left in the list of data buffers do       */
-        /* do chaining (LL_MDATA, N_MDATA)                          */
-
-      this->More++;
-      if(i<this->XNum && this->MInd) {
-        a->ram_out(a, &ReqOut->Req, this->MInd);
-        more = TRUE;
-      }
-      else {
-        this->More |=XMOREF;
-        a->ram_out(a, &ReqOut->Req, this->Req);
-        more = FALSE;
-      }
-
-        /* if we did chaining, this entity is put back into the     */
-        /* request queue                                            */
-
-      if(more) {
-        req_queue(a,this->No);
-      }
-    }
-
-        /* else it's a ASSIGN                                       */
-
-    else {
-
-        /* save the request code used for buffer chaining           */
-
-      this->MInd = 0;
-      if (this->Id==BLLC_ID) this->MInd = LL_MDATA;
-      if (this->Id==NL_ID   ||
-          this->Id==TASK_ID ||
-          this->Id==MAN_ID
-        ) this->MInd = N_MDATA;
-
-        /* send the ASSIGN                                          */
-
-      this->More |=XMOREF;
-      a->ram_out(a, &ReqOut->Req, this->Req);
-
-        /* save the reference of the ASSIGN                         */
-
-      assign_queue(a, this->No, a->ram_inw(a, &ReqOut->Reference));
-    }
-    a->ram_outw(a, &PR_RAM->NextReq, a->ram_inw(a, &ReqOut->next));
-    ReadyCount--;
-    ReqCount++;
-
-    e_no = look_req(a);
-  }
-
-        /* send the filled request buffers to the ISDN adapter      */
-
-  a->ram_out(a, &PR_RAM->ReqInput,
-             (byte)(a->ram_in(a, &PR_RAM->ReqInput) + ReqCount));
-
-        /* if it is a 'unreturncoded' UREMOVE request, remove the  */
-        /* Id from our table after sending the request             */
-  if(this->Req==UREMOVE && this->Id) {
-    Id = this->Id;
-    e_no = a->IdTable[Id];
-    free_entity(a, e_no);
-    a->IdTable[Id] = 0;
-    this->Id = 0;
-  }
-
-}
-
-/*------------------------------------------------------------------*/
-/* isdn interrupt handler                                           */
-/*------------------------------------------------------------------*/
-
-byte DivasDpc(ADAPTER * a)
-{
-  byte Count;
-  RC * RcIn;
-  IND * IndIn;
-  byte c;
-  byte RNRId;
-  byte Rc;
-  byte Ind;
-
-        /* if return codes are available ...                        */
-  if((Count = a->ram_in(a, &PR_RAM->RcOutput))) {
-
-    DPRINTF(("IDI: #Rc=%x",Count));
-
-        /* get the buffer address of the first return code          */
-    RcIn = (RC *)&PR_RAM->B[a->ram_inw(a, &PR_RAM->NextRc)];
-
-        /* for all return codes do ...                              */
-    while(Count--) {
-
-      if((Rc=a->ram_in(a, &RcIn->Rc))) {
-
-        /* call return code handler, if it is not our return code   */
-        /* the handler returns 2                                    */
-        /* for all return codes we process, we clear the Rc field   */
-        isdn_rc(a,
-                Rc,
-                a->ram_in(a, &RcIn->RcId),
-                a->ram_in(a, &RcIn->RcCh),
-                a->ram_inw(a, &RcIn->Reference));
-
-        a->ram_out(a, &RcIn->Rc, 0);
-      }
-
-        /* get buffer address of next return code                   */
-      RcIn = (RC *)&PR_RAM->B[a->ram_inw(a, &RcIn->next)];
-    }
-
-        /* clear all return codes (no chaining!)                    */
-    a->ram_out(a, &PR_RAM->RcOutput ,0);
-
-        /* call output function                                     */
-    DivasOut(a);
-  }
-
-        /* clear RNR flag                                           */
-  RNRId = 0;
-
-        /* if indications are available ...                         */
-  if((Count = a->ram_in(a, &PR_RAM->IndOutput))) {
-
-    DPRINTF(("IDI: #Ind=%x",Count));
-
-        /* get the buffer address of the first indication           */
-    IndIn = (IND *)&PR_RAM->B[a->ram_inw(a, &PR_RAM->NextInd)];
-
-        /* for all indications do ...                               */
-    while(Count--) {
-
-        /* if the application marks an indication as RNR, all       */
-        /* indications from the same Id delivered in this interrupt */
-        /* are marked RNR                                           */
-      if(RNRId && RNRId==a->ram_in(a, &IndIn->IndId)) {
-        a->ram_out(a, &IndIn->Ind, 0);
-        a->ram_out(a, &IndIn->RNR, TRUE);
-      }
-      else {
-        Ind = a->ram_in(a, &IndIn->Ind);
-        if(Ind) {
-          RNRId = 0;
-
-        /* call indication handler, a return value of 2 means chain */
-        /* a return value of 1 means RNR                            */
-        /* for all indications we process, we clear the Ind field   */
-          c = isdn_ind(a,
-                       Ind,
-                       a->ram_in(a, &IndIn->IndId),
-                       a->ram_in(a, &IndIn->IndCh),
-                       &IndIn->RBuffer,
-                       a->ram_in(a, &IndIn->MInd),
-                       a->ram_inw(a, &IndIn->MLength));
-
-          if(c==1) {
-            DPRINTF(("IDI: RNR"));
-            a->ram_out(a, &IndIn->Ind, 0);
-            RNRId = a->ram_in(a, &IndIn->IndId);
-            a->ram_out(a, &IndIn->RNR, TRUE);
-          }
-        }
-      }
-
-        /* get buffer address of next indication                    */
-      IndIn = (IND *)&PR_RAM->B[a->ram_inw(a, &IndIn->next)];
-    }
-
-    a->ram_out(a, &PR_RAM->IndOutput, 0);
-  }
-  return FALSE;
-}
-
-byte DivasTestInt(ADAPTER * a)
-{
-  return a->ram_in(a,(void *)0x3fe);
-}
-
-void DivasClearInt(ADAPTER * a)
-{
-  a->ram_out(a,(void *)0x3fe,0); 
-}
-
-/*------------------------------------------------------------------*/
-/* return code handler                                              */
-/*------------------------------------------------------------------*/
-
-static
-byte isdn_rc(ADAPTER * a,
-             byte Rc,
-             byte Id,
-             byte Ch,
-             word Ref)
-{
-  ENTITY  * this;
-  byte e_no;
-
-#ifdef	USE_EXTENDED_DEBUGS
-	{
-		ISDN_ADAPTER *io = (ISDN_ADAPTER *)a->io ;
-		DPRINTF(("IDI: <A%d Id=0x%x Rc=0x%x", io->ANum, Id, Rc))
-	}
-#else
-  DPRINTF(("IDI: <RC(Rc=%x,Id=%x,Ch=%x)",Rc,Id,Ch));
-#endif
-
-        /* check for ready interrupt                                */
-  if(Rc==READY_INT) {
-    if(a->ReadyInt) {
-      a->ReadyInt--;
-      return 0;
-    }
-    return 2;
-  }
-
-        /* if we know this Id ...                                   */
-  e_no = a->IdTable[Id];
-  if(e_no) {
-
-    this = entity_ptr(a,e_no);
-
-    this->RcCh = Ch;
-
-        /* if it is a return code to a REMOVE request, remove the   */
-        /* Id from our table                                        */
-    if(this->Req==REMOVE && Rc==OK) {
-      free_entity(a, e_no);
-      a->IdTable[Id] = 0;
-      this->Id = 0;
-/**************************************************************/
-      if ((this->More & XMOREC) > 1) {
-        this->More &= ~XMOREC;
-	this->More |= 1;
-	DPRINTF(("isdn_rc, Id=%x, correct More on REMOVE", Id));
-      }
-    }
-
-    if (Rc==OK_FC) {
-      this->Rc = Rc;
-      this->More = (this->More & (~XBUSY | XMOREC)) | 1;
-      this->complete = 0xFF;
-      CALLBACK(a, this);
-      return 0;
-    }
-    if(this->More &XMOREC)
-      this->More--;
-
-        /* call the application callback function                   */
-    if(this->More &XMOREF && !(this->More &XMOREC)) {
-      this->Rc = Rc;
-      this->More &=~XBUSY;
-      this->complete=0xff;
-      CALLBACK(a, this);
-    }
-    return 0;
-  }
-
-        /* if it's an ASSIGN return code check if it's a return     */
-        /* code to an ASSIGN request from us                        */
-  if((Rc &0xf0)==ASSIGN_RC) {
-
-    e_no = get_assign(a, Ref);
-
-    if(e_no) {
-
-      this = entity_ptr(a,e_no);
-
-      this->Id = Id;
-
-        /* call the application callback function                   */
-      this->Rc = Rc;
-      this->More &=~XBUSY;
-      this->complete=0xff;
-      CALLBACK(a, this);
-
-      if(Rc==ASSIGN_OK) {
-        a->IdTable[Id] = e_no;
-      }
-      else
-      {
-        free_entity(a, e_no);
-        a->IdTable[Id] = 0;
-        this->Id = 0;
-      }
-      return 1;
-    }
-  }
-  return 2;
-}
-
-/*------------------------------------------------------------------*/
-/* indication handler                                               */
-/*------------------------------------------------------------------*/
-
-static
-byte isdn_ind(ADAPTER * a,
-              byte Ind,
-              byte Id,
-              byte Ch,
-              PBUFFER * RBuffer,
-              byte MInd,
-              word MLength)
-{
-  ENTITY  * this;
-  word clength;
-  word offset;
-  BUFFERS  *R;
-
-#ifdef	USE_EXTENDED_DEBUGS
-	{
-		ISDN_ADAPTER *io = (ISDN_ADAPTER *)a->io ;
-		DPRINTF(("IDI: <A%d Id=0x%x Ind=0x%x", io->ANum, Id, Ind))
-	}
-#else
-  DPRINTF(("IDI: <IND(Ind=%x,Id=%x,Ch=%x)",Ind,Id,Ch));
-#endif
-
-  if(a->IdTable[Id]) {
-
-    this = entity_ptr(a,a->IdTable[Id]);
-
-    this->IndCh = Ch;
-
-        /* if the Receive More flag is not yet set, this is the     */
-        /* first buffer of the packet                               */
-    if(this->RCurrent==0xff) {
-
-        /* check for receive buffer chaining                        */
-      if(Ind==this->MInd) {
-        this->complete = 0;
-        this->Ind = MInd;
-      }
-      else {
-        this->complete = 1;
-        this->Ind = Ind;
-      }
-
-        /* call the application callback function for the receive   */
-        /* look ahead                                               */
-      this->RLength = MLength;
-
-      a->ram_look_ahead(a, RBuffer, this);
-
-      this->RNum = 0;
-      CALLBACK(a, this);
-
-        /* map entity ptr, selector could be re-mapped by call to   */
-        /* IDI from within callback                                 */
-      this = entity_ptr(a,a->IdTable[Id]);
-
-        /* check for RNR                                            */
-      if(this->RNR==1) {
-        this->RNR = 0;
-        return 1;
-      }
-
-        /* if no buffers are provided by the application, the       */
-        /* application want to copy the data itself including       */
-        /* N_MDATA/LL_MDATA chaining                                */
-      if(!this->RNR && !this->RNum) {
-        return 0;
-      }
-
-        /* if there is no RNR, set the More flag                    */
-      this->RCurrent = 0;
-      this->ROffset = 0;
-    }
-
-    if(this->RNR==2) {
-      if(Ind!=this->MInd) {
-        this->RCurrent = 0xff;
-        this->RNR = 0;
-      }
-      return 0;
-    }
-        /* if we have received buffers from the application, copy   */
-        /* the data into these buffers                              */
-    offset = 0;
-    R = PTR_R(a,this);
-    do {
-      if(this->ROffset==R[this->RCurrent].PLength) {
-        this->ROffset = 0;
-        this->RCurrent++;
-      }
-      clength = a->ram_inw(a, &RBuffer->length)-offset;
-      if (clength > R[this->RCurrent].PLength-this->ROffset)
-	      clength = R[this->RCurrent].PLength-this->ROffset;
-      if(R[this->RCurrent].P) {
-        a->ram_in_buffer(a,
-                         &RBuffer->P[offset],
-                         PTR_P(a,this,&R[this->RCurrent].P[this->ROffset]),
-                         clength);
-      }
-      offset +=clength;
-      this->ROffset +=clength;
-    } while(offset<(a->ram_inw(a, &RBuffer->length)));
-
-        /* if it's the last buffer of the packet, call the          */
-        /* application callback function for the receive complete   */
-        /* call                                                     */
-    if(Ind!=this->MInd) {
-      R[this->RCurrent].PLength = this->ROffset;
-      if(this->ROffset) this->RCurrent++;
-      this->RNum = this->RCurrent;
-      this->RCurrent = 0xff;
-      this->Ind = Ind;
-      this->complete = 2;
-      CALLBACK(a, this);
-    }
-    return 0;
-  }
-  return 2;
-}
diff -Nru a/drivers/isdn/eicon/idi.h b/drivers/isdn/eicon/idi.h
--- a/drivers/isdn/eicon/idi.h	Tue Feb  3 19:45:34 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,129 +0,0 @@
-/*
- * External IDI interface
- *
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.0  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#if !defined(IDI_H)
-#define IDI_H
-
-#include "sys.h"
-
-/* typedefs for our data structures */
-
-typedef struct get_name_s GET_NAME;
-typedef struct entity_s ENTITY;
-typedef struct buffers_s BUFFERS;
-
-/* IDI request/callback function pointer */
-
-typedef void (* IDI_CALL)(ENTITY *);
-
-typedef struct {
-  word length;          /* length of data/parameter field           */
-  byte P[270];          /* data/parameter field                     */
-} DBUFFER;
-
-#define REQ_NAME	0x0100
-#define BOARD_NAME_LENGTH 9
-struct get_name_s {
-  word command;         /* command = 0x0100 */
-  byte name[BOARD_NAME_LENGTH];
-};
-
-#define REQ_REMOVE    0x0000    /* pointer to word which is 0 */
-#define REQ_SERIAL    0x0200  
-struct get_serial_s {
-  word      command;            /* command = 0x0200 */
-  dword     serial;             /* serial number */
-};
-
-#define REQ_POSTCALL  0x0300  
-struct postcall_s {
-  word        command;         /* command = 0x0300 */
-  word        dummy;           /* not used */
-  IDI_CALL    callback;        /* routine address to call back */
-  ENTITY      *contxt;         /* ptr to entity to use */
-};
-
-#define REQ_XLOG      0x0400   /* structure is card dependent/defined locally */
-
-struct buffers_s {
-  word PLength;
-  byte *P;
-};
-
-struct entity_s {
-  byte                  Req;            /* pending request          */
-  byte                  Rc;             /* return code received     */
-  byte                  Ind;            /* indication received      */
-  byte                  ReqCh;          /* channel of current Req   */
-  byte                  RcCh;           /* channel of current Rc    */
-  byte                  IndCh;          /* channel of current Ind   */
-  byte                  Id;             /* ID used by this entity   */
-  byte                  GlobalId;       /* reserved field           */
-  byte                  XNum;           /* number of X-buffers      */
-  byte                  RNum;           /* number of R-buffers      */
-  BUFFERS               *X;        		/* pointer to X-buffer list */
-  BUFFERS               *R;        		/* pointer to R-buffer list */
-  word                  RLength;        /* length of current R-data */
-  DBUFFER               *RBuffer;       /* buffer of current R-data */
-  byte                  RNR;            /* receive not ready flag   */
-  byte                  complete;       /* receive complete status  */
-  IDI_CALL              callback;
-
-  word                  user[2];
-
-        /* fields used by the driver internally                     */
-  byte                  No;             /* entity number            */
-  byte                  reserved2;      /* reserved field           */
-  byte                  More;           /* R/X More flags           */
-  byte                  MInd;           /* MDATA coding for this ID */
-  byte                  XCurrent;       /* current transmit buffer  */
-  byte                  RCurrent;       /* current receive buffer   */
-  word                  XOffset;        /* offset in x-buffer       */
-  word                  ROffset;        /* offset in r-buffer       */
-};
-
-typedef struct {
-  byte                  type;
-  byte                  channels;
-  word                  features;
-  /* dword		serial; */
-  IDI_CALL              request;
-} DESCRIPTOR;
-
-extern void    DIVA_DIDD_Read(DESCRIPTOR *, int);
-
-        /* descriptor type field coding */
-#define IDI_ADAPTER_S           1
-#define IDI_ADAPTER_PR          2
-#define IDI_ADAPTER_DIVA        3
-#define IDI_ADAPTER_MAESTRA     4
-#define IDI_ADAPTER_MAESTRAQ    5
-#define IDI_ADAPTER_MAESTRAP    6
-#define IDI_VADAPTER            0x40
-#define IDI_DRIVER              0x80
-#define IDI_DIMAINT             0xff
-
-/* feature bit mask values */
-
-#define DI_VOICE        0x0 /* obsolete define */
-#define DI_FAX3         0x1
-#define DI_MODEM        0x2
-#define DI_POST         0x4
-#define DI_V110         0x8
-#define DI_V120         0x10
-#define DI_POTS         0x20
-#define DI_CODEC        0x40
-#define DI_MANAGE       0x80
-#define DI_V_42         0x0100
-#define DI_EXTD_FAX     0x0200 /* Extended FAX (ECM, 2D, T.6, Polling) */
-
-#endif /* IDI_H */
diff -Nru a/drivers/isdn/eicon/kprintf.c b/drivers/isdn/eicon/kprintf.c
--- a/drivers/isdn/eicon/kprintf.c	Tue Feb  3 19:45:18 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,52 +0,0 @@
-/*
- * Source file for kernel interface to kernel log facility
- *
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.3  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#include "eicon.h"
-#include "sys.h"
-#include <stdarg.h>
-
-#include "divas.h"
-#include "divalog.h"
-#include "uxio.h"
-
-void    DivasPrintf(char  *fmt, ...)
-
-{
-    klog_t      log;            /* log entry buffer */
-
-    va_list     argptr;         /* pointer to additional args */
-
-    va_start(argptr, fmt);
-
-    /* clear log entry */
-
-    memset((void *) &log, 0, sizeof(klog_t));
-
-    log.card = -1;
-    log.type = KLOG_TEXT_MSG;
-
-    /* time stamp the entry */
-
-    log.time_stamp = UxTimeGet();
-
-    /* call vsprintf to format the user's information */
-
-    vsnprintf(log.buffer, DIM(log.buffer), fmt, argptr);
-
-    va_end(argptr);
-
-    /* send to the log streams driver and return */
-
-    DivasLogAdd(&log, sizeof(klog_t));
-
-    return;
-}
diff -Nru a/drivers/isdn/eicon/lincfg.c b/drivers/isdn/eicon/lincfg.c
--- a/drivers/isdn/eicon/lincfg.c	Tue Feb  3 19:45:18 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,257 +0,0 @@
-/*
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.9  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#include <linux/fs.h>
-#undef N_DATA   /* Because we have our own definition */
-
-#include <asm/io.h>
-
-#include "sys.h"
-#include "idi.h"
-#include "constant.h"
-#include "divas.h"
-#undef ID_MASK
-#include "pc.h"
-#include "pr_pc.h"
-
-#include "adapter.h"
-#include "uxio.h"
-
-#include <linux/pci.h>
-#include <linux/kernel.h>
-#include <linux/ioport.h>
-
-struct file_operations Divas_fops;
-int Divas_major;
-
-extern int do_ioctl(struct inode *pDivasInode, struct file *pDivasFile, 
-			 unsigned int command, unsigned long arg);
-extern unsigned int do_poll(struct file *pFile, struct poll_table_struct *pPollTable);
-extern ssize_t do_read(struct file *pFile, char *pUserBuffer, size_t BufferSize, loff_t *pOffset);
-extern int do_open(struct inode *, struct file *);
-extern int do_release(struct inode *, struct file *);
-
-int FPGA_Done=0;
-
-int DivasCardsDiscover(void)
-{
-	struct pci_dev *pdev = NULL;
-	word wNumCards = 0, wDeviceIndex = 0;
-	word PCItmp;
-	dword j, i;
-	unsigned int PCIserial;
-	dia_card_t Card;
-	byte *b;
-	
-	while ((pdev = pci_find_device(PCI_VENDOR_ID_EICON, 
-				      PCI_DEVICE_ID_EICON_MAESTRAQ, 
-				      pdev))) {
-		dword dwRAM, dwDivasIOBase, dwCFG, dwCTL;
-			
-		printk(KERN_DEBUG "Divas: DIVA Server 4BRI Found\n");
-
-		dwRAM = pci_resource_start(pdev, 2);
-		dwDivasIOBase = pci_resource_start(pdev, 1);
-		dwCFG = pci_resource_start(pdev, 0);
-		dwCTL = pci_resource_start(pdev, 3);
-
-		/* Retrieve the serial number */
-		pci_write_config_word(pdev, 0x4E, 0x00FC);
-		for (j=0, PCItmp=0; j<10000 && !PCItmp; j++) {
-			pci_read_config_word(pdev, 0x4E, &PCItmp);
-			PCItmp &= 0x8000;  // extract done flag
-		}
-		pci_read_config_dword(pdev, 0x50, &PCIserial);
-		
-		Card.memory[DIVAS_RAM_MEMORY] = ioremap(dwRAM, 0x400000);
-		Card.memory[DIVAS_CTL_MEMORY] = ioremap(dwCTL, 0x2000);
-		Card.memory[DIVAS_CFG_MEMORY] = ioremap(dwCFG, 0x100);
-		Card.io_base=dwDivasIOBase;
-
-		Card.card_type = DIA_CARD_TYPE_DIVA_SERVER_Q;
-		Card.bus_type = DIA_BUS_TYPE_PCI;
-		Card.pdev = pdev;
-		Card.irq = pdev->irq;
-			
-		FPGA_Done = 0;
-
-		/* Create four virtual card structures as we want to treat 
-		   the 4Bri card as 4 Bri cards*/
-		for(i=0;i<4;i++) {
-			b=Card.memory[DIVAS_RAM_MEMORY];
-			b+=(MQ_PROTCODE_OFFSET) * (i==0?0:1); 
-			DPRINTF(("divas: offset = 0x%x", i* MQ_PROTCODE_OFFSET));
-			Card.memory[DIVAS_RAM_MEMORY]=b;
- 
-			b = Card.memory[DIVAS_RAM_MEMORY];
-			b += MQ_SM_OFFSET;
-			Card.memory[DIVAS_SHARED_MEMORY] = b;
-
-			Card.slot = -1;
-
-			sprintf(Card.name, "DIVASQ%ld", i);
-
-			Card.serial = PCIserial;
-
-			Card.card_id = wNumCards;
-
-			if (DivasCardNew(&Card) != 0) {
-				break;
-			}
-			wNumCards++;
-
-		}
-	}
-
-	pdev = NULL;
-	while ((pdev = pci_find_device(PCI_VENDOR_ID_EICON, 
-				      PCI_DEVICE_ID_EICON_MAESTRA, 
-				      pdev))) {
-		dword dwPLXIOBase, dwDivasIOBase;
-
-		printk(KERN_DEBUG "Divas: DIVA Server BRI (S/T) Found\n");
-		dwPLXIOBase = pci_resource_start(pdev, 1);
-		dwDivasIOBase = pci_resource_start(pdev, 2);
-		
-		Card.card_id = wNumCards;
-		Card.card_type = DIA_CARD_TYPE_DIVA_SERVER_B;
-		Card.bus_type = DIA_BUS_TYPE_PCI;
-		Card.pdev = pdev;
-		Card.irq = pdev->irq;
-		Card.reset_base = dwPLXIOBase;
-		Card.io_base = dwDivasIOBase;
-		Card.slot = -1;
-		strcpy(Card.name, "DIVASB");
-
-		if (check_region(Card.io_base, 0x20)) {
-			printk(KERN_WARNING "Divas: DIVA I/O Base already in use 0x%x-0x%x\n", Card.io_base, Card.io_base + 0x1F);
-		}
-
-		if (check_region(Card.reset_base, 0x80)) {
-			printk(KERN_WARNING "Divas: PLX I/O Base already in use 0x%x-0x%x\n", Card.reset_base, Card.reset_base + 0x7F);
-			continue;
-		}
-		
-		if (DivasCardNew(&Card) != 0) {
-			continue;
-		}
-		wNumCards++;
-	}
-
-	pdev = NULL;
-	while ((pdev = pci_find_device(PCI_VENDOR_ID_EICON, 
-				      PCI_DEVICE_ID_EICON_MAESTRAQ_U, 
-				      pdev))) {
-		dword dwPLXIOBase, dwDivasIOBase;
-
-		printk(KERN_DEBUG "Divas: DIVA Server BRI (U) Found\n");
-
-		dwPLXIOBase = pci_resource_start(pdev, 1);
-		dwDivasIOBase = pci_resource_start(pdev, 2);
-		
-		Card.card_id = wNumCards;
-		Card.card_type = DIA_CARD_TYPE_DIVA_SERVER_B;
-		Card.bus_type = DIA_BUS_TYPE_PCI;
-		Card.pdev = pdev;
-		Card.irq = pdev->irq;
-		Card.reset_base = dwPLXIOBase;
-		Card.io_base = dwDivasIOBase;
-		Card.slot = -1;
-		strcpy(Card.name, "DIVASB");
-
-		if (check_region(Card.io_base, 0x20)) {
-			printk(KERN_WARNING "Divas: DIVA I/O Base already in use 0x%x-0x%x\n", Card.io_base, Card.io_base + 0x1F);	
-			continue;
-		}
-
-		if (check_region(Card.reset_base, 0x80)) {
-			printk(KERN_WARNING "Divas: PLX I/O Base already in use 0x%x-0x%x\n", Card.reset_base, Card.reset_base + 0x7F);
-			continue;
-		}
-
-		if (DivasCardNew(&Card) != 0) {
-			continue;
-		}
-		wNumCards++;
-	}
-
-	wDeviceIndex = 0;
-
-	pdev = NULL;
-	while ((pdev = pci_find_device(PCI_VENDOR_ID_EICON, 
-				      PCI_DEVICE_ID_EICON_MAESTRAQ_U, 
-				      pdev))) {
-		dword dwRAM, dwREG, dwCFG;
-
-		printk(KERN_DEBUG "Divas: DIVA Server PRI Found\n");
-		
-		dwRAM = pci_resource_start(pdev, 0);
-		dwREG = pci_resource_start(pdev, 2);
-		dwCFG = pci_resource_start(pdev, 4);
-		
-		Card.memory[DIVAS_RAM_MEMORY] = ioremap(dwRAM, 0x10000);
-		Card.memory[DIVAS_REG_MEMORY] = ioremap(dwREG, 0x4000);
-		Card.memory[DIVAS_CFG_MEMORY] = ioremap(dwCFG, 0x1000);
-		Card.memory[DIVAS_SHARED_MEMORY] = Card.memory[DIVAS_RAM_MEMORY] + DIVAS_SHARED_OFFSET;
-		
-		Card.card_id = wNumCards;
-		Card.card_type = DIA_CARD_TYPE_DIVA_SERVER;
-		Card.bus_type = DIA_BUS_TYPE_PCI;
-		Card.pdev = pdev;
-		Card.irq = pdev->irq;
-		Card.slot = -1;
-		strcpy(Card.name, "DIVASP");
-		if (DivasCardNew(&Card) != 0) {
-			continue;
-		}
-		wNumCards++;
-	}
-
-
-	printk(KERN_INFO "Divas: %d cards detected\n", wNumCards);
-
-	if(wNumCards == 0) {
-		return -1;
-	}
-
-	Divas_fops.ioctl = do_ioctl;
-	Divas_fops.poll = do_poll;
-	Divas_fops.read = do_read;
-	Divas_fops.open = do_open;
-	Divas_fops.release = do_release;
-
-	Divas_major = register_chrdev(0, "Divas", &Divas_fops);
-
-	if (Divas_major < 0) {
-		printk(KERN_WARNING "Divas: Unable to register character driver\n");
-		return -1;
-	}
-
-	return 0;
-}
-
-/* Error return -1 */
-int DivasConfigGet(dia_card_t *card)
-{
-	/* Retrieve Config from O/S? Not in Linux */
-	return 0;
-}
-
-dia_config_t *DivasConfig(card_t *card, dia_config_t *config)
-{
-	/*	If config retrieved from OS then copy the data into a dia_config_t structure here
-		and return the pointer here. If the config 'came from above' then just 
-
-			return config;
-	*/
-
-	return config;
-}
-
diff -Nru a/drivers/isdn/eicon/linchr.c b/drivers/isdn/eicon/linchr.c
--- a/drivers/isdn/eicon/linchr.c	Tue Feb  3 19:45:16 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,198 +0,0 @@
-/*
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.12  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#include <linux/module.h>
-
-#include <linux/kernel.h>
-#include <linux/poll.h>
-#include <linux/fs.h>
-#include <linux/slab.h>
-
-#undef N_DATA
-
-#include "adapter.h"
-#include "divas.h"
-#include "divalog.h"
-
-extern int DivasCardNext;
-void UxPause(long ms);
-int DivasGetMem(mem_block_t *);
-
-#define DIA_IOCTL_UNLOCK 12
-void UnlockDivas(void);
-
-int do_ioctl(struct inode *pDivasInode, struct file *pDivasFile, 
-			 unsigned int command, unsigned long arg)
-{
-	byte *pUserCards, card_i;
-	word wCardNum;
-
-	switch (command)
-	{
-		case DIA_IOCTL_CONFIG:
-		{
-			dia_config_t DivaConfig;
-			if (copy_from_user(&DivaConfig, (void *)arg, sizeof(dia_config_t)))
-				return -EFAULT;
-			DivasCardConfig(&DivaConfig);
-			return 0;
-		}
-
-		case DIA_IOCTL_DETECT:
-			pUserCards = (byte *) arg;
-
-			if (!verify_area(VERIFY_WRITE, pUserCards, 20))
-			{
-				if(__put_user(DivasCardNext, pUserCards++))
-					return -EFAULT;
-
-				for (card_i=1; card_i < 20; card_i++)
-				{
-					if(__put_user((byte) DivasCards[card_i - 1].cfg.card_type, pUserCards++))
-						return -EFAULT;
-				}
-			}
-			else return -EFAULT;
-
-			return 0;
-
-		case DIA_IOCTL_START:
-		{
-			dia_start_t DivaStart;
-			if (copy_from_user(&DivaStart, (void *)arg, sizeof(dia_start_t)))
-				return -EFAULT;
-			return DivasCardStart(DivaStart.card_id);
-		}
-
-		case DIA_IOCTL_FLAVOUR:
-			return 0;
-
-		case DIA_IOCTL_LOAD:
-		{
-			dia_load_t DivaLoad;
-			if(copy_from_user(&DivaLoad, (void *)arg, sizeof(dia_load_t)))
-				return -EFAULT;
-			if (!verify_area(VERIFY_READ, DivaLoad.code,DivaLoad.length))
-			{
-				if (DivasCardLoad(&DivaLoad))
-				{
-					printk(KERN_WARNING "Divas: Error loading DIVA Server adapter\n");
-					return -EINVAL;
-				}
-				return 0;
-			}
-			return -EFAULT;
-		}
-		case DIA_IOCTL_LOG:
-		{
-			dia_log_t DivaLog;
-			if (copy_from_user(&DivaLog, (void *) arg, sizeof(dia_log_t)))
-				return -EFAULT;
-			DivasLog(&DivaLog);
-			return 0;
-		}
-
-		case DIA_IOCTL_XLOG_REQ:
-			if(get_user(wCardNum, (word *) arg))
-				return -EFAULT;
-			DivasXlogReq(wCardNum);
-			return 0;
-
-		case DIA_IOCTL_GET_NUM:
-			if(put_user(DivasCardNext, (int *)arg))
-				return -EFAULT;
-			return 0;
-
-		case DIA_IOCTL_GET_LIST:
-		{
-			dia_card_list_t cards;
-			DPRINTF(("divas: DIA_IOCTL_GET_LIST"));
-			DivasGetList(&cards);
-			if(copy_to_user((void *)arg, &cards, sizeof(cards)))
-				return -EFAULT;
-			return 0;
-		}
-		case DIA_IOCTL_GET_MEM:
-		{
-			mem_block_t mem_block;
-			if (copy_from_user(&mem_block, (void *)arg, sizeof(mem_block_t)))
-				return -EFAULT;
-			DivasGetMem(&mem_block);
-			return 0;
-		}
-
-		case DIA_IOCTL_UNLOCK:
-			UnlockDivas();
-			return 0;
-
-		default:
-			return -EINVAL;
-	}
-	return -EINVAL;
-}
-
-unsigned int do_poll(struct file *pFile, struct poll_table_struct *pPollTable)
-{
-	word wMask = 0;
-
-	if (!DivasLogFifoEmpty())
-		wMask |= POLLIN | POLLRDNORM;
-	return wMask;
-}
-
-ssize_t do_read(struct file *pFile, char *pUserBuffer, size_t BufferSize, loff_t *pOffset)
-{
-	klog_t *pClientLogBuffer = (klog_t *) pUserBuffer;
-	klog_t *pHeadItem;
-
-	if (BufferSize < sizeof(klog_t))
-		return -EIO;
-
-	pHeadItem = (klog_t *) DivasLogFifoRead();
-
-	if (pHeadItem) {
-		if (copy_to_user(pClientLogBuffer, pHeadItem, sizeof(klog_t))) {
-			kfree(pHeadItem);
-			return -EFAULT;
-		}
-		kfree(pHeadItem);
-		return sizeof(klog_t);
-	}
-
-	return 0;
-}
-static int private_usage_count;
-
-int do_open(struct inode *pInode, struct file *pFile)
-{
-	MOD_INC_USE_COUNT;
-#ifdef MODULE
-	private_usage_count++;
-#endif
-	return 0;
-}
-
-int do_release(struct inode *pInode, struct file *pFile)
-{
-	MOD_DEC_USE_COUNT;
-#ifdef MODULE
-	private_usage_count--;
-#endif
-	return 0;
-}
-
-void UnlockDivas(void)
-{
-	while (private_usage_count > 0)
-	{
-		private_usage_count--;
-		MOD_DEC_USE_COUNT;
-	}
-}
diff -Nru a/drivers/isdn/eicon/linio.c b/drivers/isdn/eicon/linio.c
--- a/drivers/isdn/eicon/linio.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,729 +0,0 @@
-/*
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.16  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#define N_DATA
-
-#include <linux/config.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/interrupt.h>
-#include <linux/smp_lock.h>
-#include <asm/io.h>
-#include <asm/system.h>
-#include <linux/slab.h>
-#include <linux/pci.h>
-#include <linux/delay.h>
-#undef N_DATA
-
-#include "uxio.h"
-
-static
-int log_on=0;
-
-int		Divasdevflag = 0;
-
-spinlock_t diva_lock = SPIN_LOCK_UNLOCKED;
-
-static
-ux_diva_card_t card_pool[MAX_CARDS];
-
-void UxPause(long int ms)
-{
-	unsigned long timeout = jiffies + ((ms * HZ) / 1000);
-
-	while (time_before(jiffies, timeout));
-}
-
-int UxCardHandleGet(ux_diva_card_t **card, dia_card_t *cfg)
-{
-	int 		i;
-	ux_diva_card_t	*c;
-
-	if (cfg->bus_type != DIA_BUS_TYPE_PCI)
-	{
-		DPRINTF(("divas hw: type not PCI (%d)", cfg->bus_type));
-		return -1;
-	}
-
-	for (i = 0; (i < DIM(card_pool)) && (card_pool[i].in_use); i++)
-	{
-		;
-	}
-
-	if (i == DIM(card_pool))
-	{
-		DPRINTF(("divas hw: card_pool exhausted"));
-		return -1;
-	}
-
-	c = *card = &card_pool[i];
-
-	switch (cfg->bus_type)
-	{
-	case DIA_BUS_TYPE_PCI:
-		c->pdev = cfg->pdev;
-		c->io_base = cfg->io_base;
-		c->reset_base = cfg->reset_base;
-		c->card_type    = cfg->card_type;
-		c->mapped = NULL;
-		c->slot 	= cfg->slot;
-		c->irq 		= (int) cfg->irq;
-		c->pDRAM    	= cfg->memory[DIVAS_RAM_MEMORY];
-		c->pDEVICES 	= cfg->memory[DIVAS_REG_MEMORY];
-		c->pCONFIG  	= cfg->memory[DIVAS_CFG_MEMORY];
-		c->pSHARED  	= cfg->memory[DIVAS_SHARED_MEMORY];
-		c->pCONTROL  	= cfg->memory[DIVAS_CTL_MEMORY];
-
-	/*		c->bus_type 	= DIA_BUS_TYPE_PCI;
-		c->bus_num 	= cfg->bus_num & 0x3f;
-		c->slot 	= cfg->slot;
-		c->irq 		= (int) cfg->irq;
-		c->int_priority = (int) cfg->int_priority;
-		c->card_type    = cfg->card_type;
-		c->io_base      = cfg->io_base;
-		c->reset_base   = cfg->reset_base;
-		c->pDRAM    	= cfg->memory[DIVAS_RAM_MEMORY];
-		c->pDEVICES 	= cfg->memory[DIVAS_REG_MEMORY];
-		c->pCONFIG  	= cfg->memory[DIVAS_CFG_MEMORY];
-		c->pSHARED  	= cfg->memory[DIVAS_SHARED_MEMORY];
-		DPRINTF(("divas hw: pDRAM is 0x%x", c->pDRAM));
-		DPRINTF(("divas hw: pSHARED is 0x%x", c->pSHARED));
-		DPRINTF(("divas hw: pCONFIG is 0x%x", c->pCONFIG));
-		c->cm_key		= cm_getbrdkey("Divas", cfg->card_id);*/
-		break;
-	default:
-		break;
-	}
-
-	c->in_use = TRUE;
-
-	return 0;
-}
-
-void UxCardHandleFree(ux_diva_card_t *card)
-{
-	card->in_use = FALSE;
-}
-
-
-#define PLX_IOBASE 0
-#define DIVAS_IOBASE 1
-void *UxCardMemAttach(ux_diva_card_t *card, int id)
-{
-	if (card->card_type == DIA_CARD_TYPE_DIVA_SERVER)
-	{
-		switch (id)
-		{
-		case DIVAS_SHARED_MEMORY:
-			card->mapped = card->pSHARED;
-			return card->pSHARED;
-			break;
-		case DIVAS_RAM_MEMORY:
-			card->mapped = card->pDRAM;
-			return card->pDRAM;
-			break;
-		case DIVAS_REG_MEMORY:
-			card->mapped = card->pDEVICES;
-			return card->pDEVICES;
-			break;
-		case DIVAS_CFG_MEMORY:
-			card->mapped = card->pCONFIG;
-			return card->pCONFIG;
-			break;
-		default:
-			ASSERT(FALSE);
-			card->mapped = NULL;
-			return (void *) 0;
-		}
-	}
-	else if (card->card_type == DIA_CARD_TYPE_DIVA_SERVER_B)
-	{
-		switch (id)
-		{
-		case PLX_IOBASE:
-			return (void *) card->reset_base;
-			break;
-		case DIVAS_IOBASE:
-			return (void *) card->io_base;
-			break;
-		default:
-			ASSERT(FALSE);
-			return 0;
-		}
-	}
-	
-	else if (card->card_type == DIA_CARD_TYPE_DIVA_SERVER_Q)
-	{
-		switch (id)
-		{
-		case DIVAS_SHARED_MEMORY:
-			card->mapped = card->pSHARED;
-			return card->pSHARED;
-			break;
-		case DIVAS_RAM_MEMORY:
-			card->mapped = card->pDRAM;
-			return card->pDRAM;
-			break;
-		case DIVAS_REG_MEMORY:
-			card->mapped = (void *) card->io_base;
-			return (void *) card->io_base;
-			break;
-		case DIVAS_CTL_MEMORY:
-			card->mapped = card->pCONTROL;
-			return card->pCONTROL;
-			break;
-		default:
-			// ASSERT(FALSE);
-			DPRINTF(("divas: Trying to attach to mem %d", id));
-			card->mapped = NULL;
-			return (void *) 0;
-		}
-	} else
-		DPRINTF(("divas: Tried to attach to unknown card"));
-
-	/* Unknown card type */
-	return NULL;
-}
-
-void UxCardMemDetach(ux_diva_card_t *card, void *address)
-{
-	return; // Just a place holder. No un-mapping done.
-}
-
-void UxCardLog(int turn_on)
-{
-	log_on = turn_on;
-}
-
-/*
- * Control Register I/O Routines to be performed on Attached I/O ports
- */
-
-void UxCardPortIoOut(ux_diva_card_t *card, void *AttachedBase, int offset, byte the_byte)
-{
-	word base = (word) (dword) AttachedBase;
-
-	base += offset;
-
-	outb(the_byte, base);
-}
-
-void UxCardPortIoOutW(ux_diva_card_t *card, void *AttachedBase, int offset, word the_word)
-{
-	word base = (word) (dword) AttachedBase;
-
-	base += offset;
-
-	outw(the_word, base);
-}
-
-void UxCardPortIoOutD(ux_diva_card_t *card, void *AttachedBase, int offset, dword the_dword)
-{
-	word base = (word) (dword) AttachedBase;
-
-	base += offset;
-
-	outl(the_dword, base);
-}
-
-byte UxCardPortIoIn(ux_diva_card_t *card, void *AttachedBase, int offset)
-{
-	word base = (word) (dword) AttachedBase;
-
-	base += offset;
-
-	return inb(base);
-}
-
-word UxCardPortIoInW(ux_diva_card_t *card, void *AttachedBase, int offset)
-{
-	word base = (word) (dword) AttachedBase;
-
-	base += offset;
-
-	return inw(base);
-}
-
-/*
- * Memory mapped card I/O functions
- */
-
-byte UxCardMemIn(ux_diva_card_t *card, void *address)
-{
-	byte	b;
-	volatile byte* t = (byte*)address;
-
-	b = *t;
-
-	if (log_on)
-	{
-		byte *a = address;
-		a -= (int) card->mapped;
-		DPRINTF(("divas hw: read 0x%02x from 0x%x (memory mapped)", b & 0xff, a));
-    	}
-
-    return(b); 
-}
-
-word UxCardMemInW(ux_diva_card_t *card, void *address)
-{
-	word	w;
-	volatile word* t = (word*)address;
-
-    w = *t;
-
-	if (log_on)
-    {
-		byte *a = address;
-		a -= (int) card->mapped;
-		DPRINTF(("divas hw: read 0x%04x from 0x%x (memory mapped)", w & 0xffff, a));
-    }
-
-    return (w);
-}
-
-dword UxCardMemInD(ux_diva_card_t *card, void *address)
-{
-	dword	dw;
-	volatile dword* t = (dword*)address;
-
-    dw = *t;
-
-	if (log_on)
-    {
-		byte *a = address;
-		a -= (int) card->mapped;
-		DPRINTF(("divas hw: read 0x%08x from 0x%x (memory mapped)", dw, a));
-    }
-
-    return (dw);
-}
-
-void UxCardMemInBuffer(ux_diva_card_t *card, void *address, void *buffer, int length)
-{
-	volatile byte *pSource = address;
-	byte *pDest = buffer;
-
-	while (length--)
-	{
-		*pDest++ = *pSource++;
-	}
-
-	if (log_on)
-    {
-		byte *a = address;
-		a -= (int) card->mapped;
-		pDest = buffer;
-		DPRINTF(("divas hw: read %02x %02x %02x %02x %02x %02x %02x %02x from 0x%x (memory mapped)", 
-		pDest[0] & 0xff, pDest[1] & 0xff, pDest[2] & 0xff, pDest[3] & 0xff,
-		pDest[4] & 0xff, pDest[5] & 0xff, pDest[6] & 0xff, pDest[7] & 0xff,
-		a));
-    }
-
-    return;
-}
-
-void UxCardMemOut(ux_diva_card_t *card, void *address, byte data)
-{
-	volatile byte* t = (byte*)address;
-
-	if (log_on)
-	{
-		byte *a = address;
-		a -= (int) card->mapped;
-		DPRINTF(("divas hw: wrote 0x%02x to 0x%x (memory mapped)", data & 0xff, a));
-	}
-
-	*t = data;
-
-    	return;
-}
-
-void UxCardMemOutW(ux_diva_card_t *card, void *address, word data)
-{
-	volatile word* t = (word*)address;
-
-	if (log_on)
-	{
-		byte *a = address;
-		a -= (int) card->mapped;
-		DPRINTF(("divas hw: wrote 0x%04x to 0x%x (memory mapped)", data & 0xffff, a));
-	}
-
-	*t = data;
-    return;
-}
-
-void UxCardMemOutD(ux_diva_card_t *card, void *address, dword data)
-{
-	volatile dword* t = (dword*)address;
-
-	if (log_on)
-	{
-		byte *a = address;
-		a -= (int) card->mapped;
-		DPRINTF(("divas hw: wrote 0x%08x to 0x%x (memory mapped)", data, a));
-	}
-
-	*t = data;
-    return;
-}
-
-void UxCardMemOutBuffer(ux_diva_card_t *card, void *address, void *buffer, int length)
-{
-	byte 	*pSource = buffer;
-	byte	*pDest = address;
-
-	while (length--)
-	{
-		*pDest++ = *pSource++;
-	}
-
-	if (log_on)
-    {
-		byte *a = address;
-		a -= (int) card->mapped;
-		pDest = buffer;
-		DPRINTF(("divas hw: wrote %02x %02x %02x %02x %02x %02x %02x %02x to 0x%x (memory mapped)", 
-		pDest[0] & 0xff, pDest[1] & 0xff, pDest[2] & 0xff, pDest[3] & 0xff,
-		pDest[4] & 0xff, pDest[5] & 0xff, pDest[6] & 0xff, pDest[7] & 0xff,
-		a));
-    }
-
-    return;
-}
-
-/*
- * Memory mapped card I/O functions
- */
-
-byte UxCardIoIn(ux_diva_card_t *card, void *AttachedDivasIOBase, void *address)
-
-{
-	byte the_byte;
-
-    outb(0xFF, card->io_base + 0xC);
-	outw((word) (dword) address, card->io_base + 4);
-
-	the_byte = inb(card->io_base);
-
-	if (log_on)
-    {
-		DPRINTF(("divas hw: read 0x%02x from 0x%x (I/O mapped)", 
-					the_byte & 0xff, address));
-    }
-    
-	return the_byte;
-}
-
-word UxCardIoInW(ux_diva_card_t *card, void *AttachedDivasIOBase, void *address)
-
-{
-	word the_word;
-
-	outb(0xFF, card->io_base + 0xC);
-	outw((word) (dword) address, card->io_base + 4);
-	the_word = inw(card->io_base);
-
-	if (log_on)
-    {
-		DPRINTF(("divas hw: read 0x%04x from 0x%x (I/O mapped)", 
-					the_word & 0xffff, address));
-    }
-
-	return the_word;
-}
-
-dword UxCardIoInD(ux_diva_card_t *card, void *AttachedDivasIOBase, void *address)
-
-{
-	dword the_dword;
-
-	outb(0xFF, card->io_base + 0xC);
-	outw((word) (dword) address, card->io_base + 4);
-	the_dword = inl(card->io_base);
-
-	if (log_on)
-    {
-		DPRINTF(("divas hw: read 0x%08x from 0x%x (I/O mapped)", 
-					the_dword, address));
-    }
-
-    return the_dword;
-}
-
-void UxCardIoInBuffer(ux_diva_card_t *card, void *AttachedDivasIOBase, void *address, void *buffer, int length)
-
-{
-	byte *pSource = address;
-	byte *pDest = buffer;
-
-	if ((word) (dword) address & 0x1)
-	{
-		outb(0xFF, card->io_base + 0xC);
-		outw((word) (dword) pSource, card->io_base + 4);
-		*pDest = (byte) inb(card->io_base);
-		pDest++;
-		pSource++;
-		length--;
-		if (!length)
-        {
-            return;
-        }
-    }
-
-	outb(0xFF, card->io_base + 0xC);
-	outw((word) (dword) pSource, card->io_base + 4);
-	insw(card->io_base, (word *)pDest,length%2 ? (length+1)>>1 : length>>1);
-
-	if (log_on)
-    {
-		pDest = buffer;
-		DPRINTF(("divas hw: read %02x %02x %02x %02x %02x %02x %02x %02x from 0x%x (I/O mapped)", 
-		pDest[0] & 0xff, pDest[1] & 0xff, pDest[2] & 0xff, pDest[3] & 0xff,
-		pDest[4] & 0xff, pDest[5] & 0xff, pDest[6] & 0xff, pDest[7] & 0xff,
-		address));
-    }
-
-    return;
-}
-
-/* Output */
-
-void UxCardIoOut(ux_diva_card_t *card, void *AttachedDivasIOBase, void *address, byte data)
-{
-	if (log_on)
-    {
-		DPRINTF(("divas hw: wrote 0x%02x to 0x%x (I/O mapped)", 
-					data & 0xff, address));
-    }
-
-	outb(0xFF, card->io_base + 0xC);
-	outw((word) (dword) address, card->io_base + 4);
-	outb((byte) data & 0xFF, card->io_base);
-
-    return;
-}
-
-void UxCardIoOutW(ux_diva_card_t *card, void *AttachedDivasIOBase, void *address, word data)
-{
-	if (log_on)
-    {
-		DPRINTF(("divas hw: wrote 0x%04x to 0x%x (I/O mapped)", 
-					data & 0xffff, address));
-    }
-
-	outb(0xFF, card->io_base + 0xC);
-	outw((word) (dword) address, card->io_base + 4);
-	outw((word) data & 0xFFFF, card->io_base);
-
-    return;
-}
-
-void UxCardIoOutD(ux_diva_card_t *card, void *AttachedDivasIOBase, void *address, dword data)
-{
-	if (log_on)
-    {
-		DPRINTF(("divas hw: wrote 0x%08x to 0x%x (I/O mapped)", data, address));
-    }
-
-	outb(0xFF, card->io_base + 0xC);
-	outw((word) (dword) address, card->io_base + 4);
-	outl((dword) data & 0xFFFFFFFF, card->io_base);
-
-    return;
-}
-
-void UxCardIoOutBuffer(ux_diva_card_t *card, void *AttachedDivasIOBase, void *address, void *buffer, int length)
-
-{
-	byte 	*pSource = buffer;
-	byte	*pDest = address;
-
-	if ((word) (dword) address & 1)
-	{
-		outb(0xFF, card->io_base + 0xC);
-		outw((word) (dword) pDest, card->io_base + 4);
-		outb(*pSource, card->io_base);
-		pSource++;
-		pDest++;
-		length--;
-		if (!length)
-        {
-			return;
-        }
-	}
-
-    outb(0xFF, card->io_base + 0xC);
-	outw((word) (dword) pDest, card->io_base + 4);
-	outsw(card->io_base, (word *)pSource, length%2 ? (length+1)>>1 : length>>1);
-
-	if (log_on)
-    {
-		pDest = buffer;
-		DPRINTF(("divas hw: wrote %02x %02x %02x %02x %02x %02x %02x %02x to 0x%x (I/O mapped)", 
-		pDest[0] & 0xff, pDest[1] & 0xff, pDest[2] & 0xff, pDest[3] & 0xff,
-		pDest[4] & 0xff, pDest[5] & 0xff, pDest[6] & 0xff, pDest[7] & 0xff,
-		address));
-    }
-
-    return;
-}
-
-irqreturn_t Divasintr(int arg, void *unused, struct pt_regs *unused_regs)
-{
-	int i;
-	card_t *card = NULL;
-	ux_diva_card_t *ux_ref = NULL;
-
-	for (i = 0; i < DivasCardNext; i++)
-	{
-
-		if (arg == DivasCards[i].cfg.irq)
-		{
-			card = &DivasCards[i];
-			ux_ref = card->hw;
-	
-			if ((ux_ref) && (card->is_live))
-			{
-				(*ux_ref->user_isr)(ux_ref->user_isr_arg);	
-			}
-			else 
-			{
-				DPRINTF(("divas: ISR couldn't locate card"));
-			}
-		}
-	}
-
-	return IRQ_HANDLED;
-}
-
-
-int UxIsrInstall(ux_diva_card_t *card, isr_fn_t *isr_fn, void *isr_arg)
-{
-	int result;
-
-        card->user_isr = isr_fn;
-        card->user_isr_arg = isr_arg;
-
-	result = request_irq(card->irq, Divasintr, SA_INTERRUPT | SA_SHIRQ, "Divas", (void *) isr_arg);
-
-	return result;
-}
-
-void UxIsrRemove(ux_diva_card_t *card, void *dev_id)
-{
-	free_irq(card->irq, card->user_isr_arg);
-}
-
-void UxPciConfigWrite(ux_diva_card_t *card, int size, int offset, void *value)
-{
-	switch (size) {
-	case sizeof(byte):
-		pci_write_config_byte(card->pdev, offset, * (byte *) value);
-		break;
-	case sizeof(word):
-		pci_write_config_word(card->pdev, offset, * (word *) value);
-		break;
-	case sizeof(dword):
-		pci_write_config_dword(card->pdev, offset, * (dword *) value);
-		break;
-	default:
-		printk(KERN_WARNING "Divas: Invalid size in UxPciConfigWrite\n");
-	}
-}
-
-void UxPciConfigRead(ux_diva_card_t *card, int size, int offset, void *value)
-{
-	switch (size) {
-	case sizeof(byte):
-		pci_read_config_byte(card->pdev, offset, (byte *) value);
-		break;
-	case sizeof(word):
-		pci_read_config_word(card->pdev, offset, (word *) value);
-		break;
-	case sizeof(dword):
-		pci_read_config_dword(card->pdev, offset, (unsigned int *) value);
-		break;
-	default:
-		printk(KERN_WARNING "Divas: Invalid size in UxPciConfigRead\n");
-	}
-}
-
-void *UxAlloc(unsigned int size)
-{
-	void *m;
-
-	m = kmalloc(size, GFP_ATOMIC);
-
-	return m;
-}
-
-void UxFree(void *ptr)
-{
-	kfree(ptr);
-}
-
-long UxCardLock(ux_diva_card_t *card)
-{
-	unsigned long flags;
-
- 	spin_lock_irqsave(&diva_lock, flags);
-	
-	return flags;
-}
-
-void UxCardUnlock(ux_diva_card_t *card, unsigned long ipl)
-{
-	spin_unlock_irqrestore(&diva_lock, ipl);
-}
-
-dword UxTimeGet(void)
-{
-	return jiffies;
-}
-
-long UxInterlockedIncrement(ux_diva_card_t *card, long *dst)
-{
-	register volatile long *p;
-	register long ret;
-	int ipl;
-
-	p =dst;
-	
-	ipl = UxCardLock(card);
-
-	*p += 1;
-	ret = *p;
-
-	UxCardUnlock(card,ipl);
-
-	return(ret);
-
-}
-
-long UxInterlockedDecrement(ux_diva_card_t *card, long *dst)
-{
-	register volatile long *p;
-	register long ret;
-	int ipl;
-
-	p =dst;
-	
-	ipl = UxCardLock(card);
-
-	*p -= 1;
-	ret = *p;
-
-	UxCardUnlock(card,ipl);
-
-	return(ret);
-
-}
diff -Nru a/drivers/isdn/eicon/linsys.c b/drivers/isdn/eicon/linsys.c
--- a/drivers/isdn/eicon/linsys.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,136 +0,0 @@
-/*
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.10  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#include <linux/sched.h>
-#undef N_DATA
-#include <linux/workqueue.h>
-
-#include <linux/smp.h>
-struct pt_regs;
-#include <linux/interrupt.h>
-#include <linux/ioport.h>
-
-#include "sys.h"
-#include "divas.h"
-#include "adapter.h"
-#include "divalog.h"
-
-#include "uxio.h"
-
-static struct tasklet_struct DivasTask;
-
-int Divas4BRIInitPCI(card_t *card, dia_card_t *cfg)
-{
-	/* Use UxPciConfigWrite	routines to initialise PCI config space */
-
-/*	wPCIcommand = 0x03;
-	cm_write_devconfig16(CMKey, PCI_COMMAND, &wPCIcommand);
-
-	wPCIcommand = 0x280;
-	cm_write_devconfig16(CMKey, PCI_STATUS, &wPCIcommand);
-
-	bPCIcommand = 0x30;
-	cm_write_devconfig16(CMKey, PCI_STATUS, &wPCIcommand);
-*/
-	return 0; 
-}
-
-int DivasPRIInitPCI(card_t *card, dia_card_t *cfg)
-{
-	/* Use UxPciConfigWrite	routines to initialise PCI config space */
-
-/*		wPCIcommand = 0x03;
-	cm_write_devconfig16(CMKey, PCI_COMMAND, &wPCIcommand);
-	
-	wPCIcommand = 0x280;
-	cm_write_devconfig16(CMKey, PCI_STATUS, &wPCIcommand);
-	
-	bPCIcommand = 0x30;
-	cm_write_devconfig8(CMKey, PCI_LATENCY, &bPCIcommand);*/
-
-	return 0;  
-}
-
-int DivasBRIInitPCI(card_t *card, dia_card_t *cfg)
-{
-	/* Need to set these platform dependent values after patching */
-
-	card->hw->reset_base = card->cfg.reset_base;
-	card->hw->io_base = card->cfg.io_base;
-
-	request_region(card->hw->reset_base,0x80,"Divas");
-	request_region(card->hw->io_base,0x20,"Divas");
-
-
-	/* Same as for PRI */
-	return DivasPRIInitPCI(card, cfg);
-}
-
-/* ######################### Stubs of routines that are not done yet ################## */
-/*void DivasLogIdi(card_t *card, ENTITY *e, int request)
-{
-}
-*/
-
-int	DivasDpcSchedule(void)
-{
-	tasklet_schedule(&DivasTask);
-
-	return 0;
-}
-
-int	DivasScheduleRequestDpc(void)
-{
-	tasklet_schedule(&DivasTask);
-
-	return 0;
-}
-
-void DivasInitDpc(void)
-{
-	tasklet_init(&DivasTask, DivasDoDpc, 0);
-}
-
-void    DivasLogAdd(void *buffer, int length)
-{
-    static
-    boolean_t   overflow = FALSE;
-    static
-    boolean_t   busy = FALSE;
-
-    /* make sure we're not interrupting ourselves */
-
-    if (busy)
-    {
-        printk(KERN_DEBUG "Divas: Logging interrupting self !\n");
-        return;
-    }
-    busy = TRUE;
-
-    /* ignore call if daemon isn't running and we've reached limit */
-
-    if (DivasLogFifoFull())
-    {
-        if (!overflow)
-        {
-            printk(KERN_DEBUG "Divas: Trace buffer full\n");
-            overflow = TRUE;
-        }
-        busy = FALSE;
-        return;
-    }
-
-	DivasLogFifoWrite(buffer, length);
-
-    busy = FALSE;
-    return;
-}
-
-/* #################################################################################### */
diff -Nru a/drivers/isdn/eicon/log.c b/drivers/isdn/eicon/log.c
--- a/drivers/isdn/eicon/log.c	Tue Feb  3 19:45:41 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,160 +0,0 @@
-/*
- * Source file for diva log facility
- *
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.5  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#include "sys.h"
-#include "idi.h"
-#include "divas.h"
-#include "adapter.h"
-#include "divalog.h"
-
-#include "uxio.h"
-
-/*Counter to monitor number of messages */ 
-static int m_count;
- 
-#define     MAX_BUFFERED_MSGS   (1000)
-
-/* Our Linked List Structure to hold message */
-typedef struct klog_link{
-  klog_t klog;
-  struct klog_link *next;
-}KNODE;
-
-/* First & Last structures in list*/
-KNODE *head;
-KNODE *tail;
-
-/* 
- * retrieve message from FIFO buffer
- * returns NULL if buffer empty
- * otherwise returns pointer to entry 
- */
-
-char	*DivasLogFifoRead(void)
-
-{
-	KNODE *old_head;
-
-	if(head==NULL) 
-	{
-		/* Buffer Empty - No Messages */
-		return NULL;	
-	}
-
-	m_count--;
-	/* Keep track of message to be read & increment to next message*/
-	old_head = head;
-	head = head->next;
-    /*Return ptr to Msg */	
-    return((char *)old_head);
-}
-
-/* 
- * write message into FIFO buffer
- */
-
-void	DivasLogFifoWrite(char *entry, int length)
-
-{
-    KNODE *new_klog;
-
-    if(head == NULL) 
-    {
-	/* No Entries in Log */
-	tail=NULL;
-	m_count=0;
-	new_klog=UxAlloc(sizeof(KNODE));
-
-	if(new_klog==NULL)
-	{
-		return;
-	}
-
-	m_count++;
-	memset(new_klog, 0, sizeof(KNODE));
-
-	/* Set head & tail to point to the new Msg Struct */
-	head=tail=new_klog;
-	tail->next=NULL;
-    }
-    else
-    {
-	new_klog=UxAlloc(sizeof(KNODE));
-	
-	if(new_klog==NULL)
-	{
-		return;
-	}
-
-	m_count++;
-	memset(new_klog, 0, sizeof(KNODE));
-
-	/* Let last Msg Struct point to new Msg Struct & inc tail */
-	tail->next=new_klog;
-	tail=new_klog;
-	tail->next=NULL;
-    }
-
-    if (length > sizeof(klog_t))
-    {
-        length = sizeof(klog_t);
-    }
-
-    memcpy(&tail->klog, entry, length);
-
-    return;
-}
-
-/*
- * DivaslogFifoEmpty:return TRUE if FIFO buffer is empty,otherwise FALSE
- */
-int DivasLogFifoEmpty(void)
-{
-	return (m_count == 0);
-}
-
-/*
- *DivasLogFifoFull:return TRUE if FIFO buffer is full,otherwise FALSE
- */
-int DivasLogFifoFull(void)
-{
-	return (m_count == MAX_BUFFERED_MSGS);
-}
-
-/*
- * generate an IDI log entry
- */
-
-void	DivasLogIdi(card_t *card, ENTITY *e, int request)
-
-{
-	klog_t		klog;
-
-	memset(&klog, 0, sizeof(klog));
-
-	klog.time_stamp = UxTimeGet();
-
-	klog.length = sizeof(ENTITY) > sizeof(klog.buffer) ?
-						sizeof(klog.buffer) : sizeof(ENTITY);
-
-	klog.card = (int) (card - DivasCards);
-
-	klog.type = request ? KLOG_IDI_REQ : KLOG_IDI_CALLBACK;
-	klog.code = 0;
-	memcpy(klog.buffer, e, klog.length);
-
-    /* send to the log driver and return */
-
-    DivasLogAdd(&klog, sizeof(klog));
-
-	return;
-}
diff -Nru a/drivers/isdn/eicon/pc.h b/drivers/isdn/eicon/pc.h
--- a/drivers/isdn/eicon/pc.h	Tue Feb  3 19:45:41 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,292 +0,0 @@
-/*
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.2  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#ifndef PC_H_INCLUDED
-#define PC_H_INCLUDED
-
-/*------------------------------------------------------------------*/
-/* buffer definition                                                */
-/*------------------------------------------------------------------*/
-
-typedef struct {
-  word length;          /* length of data/parameter field           */
-  byte P[270];          /* data/parameter field                     */
-} PBUFFER;
-
-/*------------------------------------------------------------------*/
-/* dual port ram structure                                          */
-/*------------------------------------------------------------------*/
-
-struct dual
-{
-  byte Req;             /* request register                         */
-  byte ReqId;           /* request task/entity identification       */
-  byte Rc;              /* return code register                     */
-  byte RcId;            /* return code task/entity identification   */
-  byte Ind;             /* Indication register                      */
-  byte IndId;           /* Indication task/entity identification    */
-  byte IMask;           /* Interrupt Mask Flag                      */
-  byte RNR;             /* Receiver Not Ready (set by PC)           */
-  byte XLock;           /* XBuffer locked Flag                      */
-  byte Int;             /* ISDN-S interrupt                         */
-  byte ReqCh;           /* Channel field for layer-3 Requests       */
-  byte RcCh;            /* Channel field for layer-3 Returncodes    */
-  byte IndCh;           /* Channel field for layer-3 Indications    */
-  byte MInd;            /* more data indication field               */
-  word MLength;         /* more data total packet length            */
-  byte ReadyInt;        /* request field for ready interrupt        */
-  byte SWReg;           /* Software register for special purposes   */  
-  byte Reserved[11];    /* reserved space                           */
-  byte InterfaceType;   /* interface type 1=16K interface           */
-  word Signature;       /* ISDN-S adapter Signature (GD)            */
-  PBUFFER XBuffer;      /* Transmit Buffer                          */
-  PBUFFER RBuffer;      /* Receive Buffer                           */
-};
-
-/*------------------------------------------------------------------*/
-/* SWReg Values (0 means no command)                                */
-/*------------------------------------------------------------------*/
-#define SWREG_DIE_WITH_LEDON  0x01
-#define SWREG_HALT_CPU        0x02 /* Push CPU into a while(1) loop */         
-
-/*------------------------------------------------------------------*/
-/* Id Fields Coding                                                 */
-/*------------------------------------------------------------------*/
-
-#define ID_MASK 0xe0    /* Mask for the ID field                    */
-#define GL_ERR_ID 0x1f  /* ID for error reporting on global requests*/
-
-#define DSIG_ID  0x00   /* ID for D-channel signaling               */
-#define NL_ID    0x20   /* ID for network-layer access (B or D)     */
-#define BLLC_ID  0x60   /* ID for B-channel link level access       */
-#define TASK_ID  0x80   /* ID for dynamic user tasks                */
-#define TIMER_ID 0xa0   /* ID for timer task                        */
-#define TEL_ID   0xc0   /* ID for telephone support                 */
-#define MAN_ID   0xe0   /* ID for management                        */
-
-/*------------------------------------------------------------------*/
-/* ASSIGN and REMOVE requests are the same for all entities         */
-/*------------------------------------------------------------------*/
-
-#define ASSIGN  0x01
-#define UREMOVE  0xfe   /* without returncode */  
-#define REMOVE  0xff
-
-/*------------------------------------------------------------------*/
-/* Timer Interrupt Task Interface                                   */
-/*------------------------------------------------------------------*/
-
-#define ASSIGN_TIM 0x01
-#define REMOVE_TIM 0xff
-
-/*------------------------------------------------------------------*/
-/* dynamic user task interface                                      */
-/*------------------------------------------------------------------*/
-
-#define ASSIGN_TSK 0x01
-#define REMOVE_TSK 0xff
-
-#define LOAD 0xf0
-#define RELOCATE 0xf1
-#define START 0xf2
-#define LOAD2 0xf3
-#define RELOCATE2 0xf4
-
-/*------------------------------------------------------------------*/
-/* dynamic user task messages                                       */
-/*------------------------------------------------------------------*/
-
-#define TSK_B2          0x0000
-#define TSK_WAKEUP      0x2000
-#define TSK_TIMER       0x4000
-#define TSK_TSK         0x6000
-#define TSK_PC          0xe000
-
-/*------------------------------------------------------------------*/
-/* LL management primitives                                         */
-/*------------------------------------------------------------------*/
-
-#define ASSIGN_LL 1     /* assign logical link                      */
-#define REMOVE_LL 0xff  /* remove logical link                      */
-
-/*------------------------------------------------------------------*/
-/* LL service primitives                                            */
-/*------------------------------------------------------------------*/
-
-#define LL_UDATA 1      /* link unit data request/indication        */
-#define LL_ESTABLISH 2  /* link establish request/indication        */
-#define LL_RELEASE 3    /* link release request/indication          */
-#define LL_DATA 4       /* data request/indication                  */
-#define LL_LOCAL 5      /* switch to local operation (COM only)     */
-#define LL_DATA_PEND 5  /* data pending indication (SDLC SHM only)  */
-#define LL_REMOTE 6     /* switch to remote operation (COM only)    */
-#define LL_TEST 8       /* link test request                        */
-#define LL_MDATA 9      /* more data request/indication             */
-#define LL_BUDATA 10    /* broadcast unit data request/indication   */
-#define LL_XID 12       /* XID command request/indication           */
-#define LL_XID_R 13     /* XID response request/indication          */
-
-/*------------------------------------------------------------------*/
-/* NL service primitives                                            */
-/*------------------------------------------------------------------*/
-
-#define N_MDATA         1       /* more data to come REQ/IND        */
-#define N_CONNECT       2       /* OSI N-CONNECT REQ/IND            */
-#define N_CONNECT_ACK   3       /* OSI N-CONNECT CON/RES            */
-#define N_DISC          4       /* OSI N-DISC REQ/IND               */
-#define N_DISC_ACK      5       /* OSI N-DISC CON/RES               */
-#define N_RESET         6       /* OSI N-RESET REQ/IND              */
-#define N_RESET_ACK     7       /* OSI N-RESET CON/RES              */
-#define N_DATA          8       /* OSI N-DATA REQ/IND               */
-#define N_EDATA         9       /* OSI N-EXPEDITED DATA REQ/IND     */
-#define N_UDATA         10      /* OSI D-UNIT-DATA REQ/IND          */
-#define N_BDATA         11      /* BROADCAST-DATA REQ/IND           */
-#define N_DATA_ACK      12      /* data ack ind for D-bit procedure */
-#define N_EDATA_ACK     13      /* data ack ind for INTERRUPT       */
-
-#define N_Q_BIT         0x10    /* Q-bit for req/ind                */
-#define N_M_BIT         0x20    /* M-bit for req/ind                */
-#define N_D_BIT         0x40    /* D-bit for req/ind                */
-
-/*------------------------------------------------------------------*/
-/* Signaling management primitives                                  */
-/*------------------------------------------------------------------*/
-
-#define ASSIGN_SIG 1    /* assign signaling task                    */
-#define UREMOVE_SIG 0xfe /* remove signaling task without returncode */
-#define REMOVE_SIG 0xff /* remove signaling task                    */
-
-/*------------------------------------------------------------------*/
-/* Signaling service primitives                                     */
-/*------------------------------------------------------------------*/
-
-#define CALL_REQ 1      /* call request                             */
-#define CALL_CON 1      /* call confirmation                        */
-#define CALL_IND 2      /* incoming call connected                  */
-#define LISTEN_REQ 2    /* listen request                           */
-#define HANGUP 3        /* hangup request/indication                */
-#define SUSPEND 4       /* call suspend request/confirm             */
-#define RESUME 5        /* call resume request/confirm              */
-#define SUSPEND_REJ 6   /* suspend rejected indication              */
-#define USER_DATA 8     /* user data for user to user signaling     */
-#define CONGESTION 9    /* network congestion indication            */
-#define INDICATE_REQ 10 /* request to indicate an incoming call     */
-#define INDICATE_IND 10 /* indicates that there is an incoming call */
-#define CALL_RES 11     /* accept an incoming call                  */
-#define CALL_ALERT 12   /* send ALERT for incoming call             */
-#define INFO_REQ 13     /* INFO request                             */
-#define INFO_IND 13     /* INFO indication                          */
-#define REJECT 14       /* reject an incoming call                  */
-#define RESOURCES 15    /* reserve B-Channel hardware resources     */
-#define TEL_CTRL 16     /* Telephone control request/indication     */
-#define STATUS_REQ 17   /* Request D-State (returned in INFO_IND)   */
-#define FAC_REG_REQ 18  /* connection idependent fac registration   */
-#define FAC_REG_ACK 19  /* fac registration acknowledge             */
-#define FAC_REG_REJ 20  /* fac registration reject                  */
-#define CALL_COMPLETE 21/* send a CALL_PROC for incoming call       */
-#define FACILITY_REQ 22 /* send a Facility Message type             */
-#define FACILITY_IND 22 /* Facility Message type indication         */
-#define SIG_CTRL     29 /* Control for signalling hardware          */
-#define DSP_CTRL     30 /* Control for DSPs                         */
-#define LAW_REQ      31 /* Law config request for (returns info_i)  */ 
-
- 
-/*------------------------------------------------------------------*/
-/* management service primitives                                    */
-/*------------------------------------------------------------------*/
-
-#define MAN_READ        2
-#define MAN_WRITE       3
-#define MAN_EXECUTE     4
-#define MAN_EVENT_ON    5
-#define MAN_EVENT_OFF   6
-#define MAN_LOCK        7
-#define MAN_UNLOCK      8   
-
-#define MAN_INFO_IND    2
-#define MAN_EVENT_IND   3
-#define MAN_TRACE_IND   4  
-
-#define MAN_ESC         0x80
-
-/*------------------------------------------------------------------*/
-/* return code coding                                               */
-/*------------------------------------------------------------------*/
-
-#define UNKNOWN_COMMAND         0x01    /* unknown command          */
-#define WRONG_COMMAND           0x02    /* wrong command            */
-#define WRONG_ID                0x03    /* unknown task/entity id   */
-#define WRONG_CH                0x04    /* wrong task/entity id     */
-#define UNKNOWN_IE              0x05    /* unknown information el.  */
-#define WRONG_IE                0x06    /* wrong information el.    */
-#define OUT_OF_RESOURCES        0x07    /* ISDN-S card out of res.  */
-#define ADAPTER_DEAD            0x08    /* ISDN card CPU halted     */ 
-#define N_FLOW_CONTROL          0x10    /* Flow-Control, retry      */
-#define ASSIGN_RC               0xe0    /* ASSIGN acknowledgement   */
-#define ASSIGN_OK               0xef    /* ASSIGN OK                */
-#define OK_FC                   0xfc    /* Flow-Control RC          */
-#define READY_INT               0xfd    /* Ready interrupt          */
-#define TIMER_INT               0xfe    /* timer interrupt          */
-#define OK                      0xff    /* command accepted         */
-
-/*------------------------------------------------------------------*/
-/* information elements                                             */
-/*------------------------------------------------------------------*/
-
-#define SHIFT 0x90              /* codeset shift                    */
-#define MORE 0xa0               /* more data                        */
-#define CL 0xb0                 /* congestion level                 */
-
-        /* codeset 0                                                */
-
-#define BC  0x04                /* Bearer Capability                */
-#define CAU 0x08                /* cause                            */
-#define CAD 0x0c                /* Connected address                */
-#define CAI 0x10                /* call identity                    */
-#define CHI 0x18                /* channel identification           */
-#define LLI 0x19                /* logical link id                  */
-#define CHA 0x1a                /* charge advice                    */
-#define DT  0x29                /* ETSI date/time                   */
-#define KEY 0x2c                /* keypad information element       */
-#define FTY 0x1c                /* facility information element     */ 
-#define DSP 0x28                /* display                          */
-#define OAD 0x6c                /* origination address              */
-#define OSA 0x6d                /* origination sub-address          */
-#define CPN 0x70                /* called party number              */
-#define DSA 0x71                /* destination sub-address          */
-#define RDX 0x73                /* redirected number extended       */
-#define RDN 0x74                /* redirected number                */  
-#define LLC 0x7c                /* low layer compatibility          */
-#define HLC 0x7d                /* high layer compatibility         */
-#define UUI 0x7e                /* user user information            */
-#define ESC 0x7f                /* escape extension                 */
-
-#define DLC 0x20                /* data link layer configuration    */
-#define NLC 0x21                /* network layer configuration      */
-
-        /* codeset 6                                                */
-
-#define SIN 0x01                /* service indicator                */
-#define CIF 0x02                /* charging information             */
-#define DATE 0x03               /* date                             */
-#define CPS 0x07                /* called party status              */
-
-/*------------------------------------------------------------------*/
-/* TEL_CTRL contents                                                */
-/*------------------------------------------------------------------*/
-
-#define RING_ON         0x01
-#define RING_OFF        0x02
-#define HANDS_FREE_ON   0x03
-#define HANDS_FREE_OFF  0x04
-#define ON_HOOK         0x80
-#define OFF_HOOK        0x90
-
-#endif
diff -Nru a/drivers/isdn/eicon/pc_maint.h b/drivers/isdn/eicon/pc_maint.h
--- a/drivers/isdn/eicon/pc_maint.h	Tue Feb  3 19:45:30 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,148 +0,0 @@
-/*
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.0  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#ifndef PC_MAINT_H
-#define PC_MAINT_H
-
-#if !defined(MIPS_SCOM)
-#define BUFFER_SZ  48
-#define MAINT_OFFS 0x380
-#else
-#define BUFFER_SZ  128
-#define MAINT_OFFS 0xff00
-#endif
-
-#define MIPS_BUFFER_SZ  128
-#define MIPS_MAINT_OFFS 0xff00
-
-#define DO_LOG                     1
-#define MEMR                    2
-#define MEMW                    3
-#define IOR                     4
-#define IOW                     5
-#define B1TEST                  6
-#define B2TEST                  7
-#define BTESTOFF                8
-#define DSIG_STATS              9
-#define B_CH_STATS              10
-#define D_CH_STATS              11
-#define BL1_STATS               12
-#define BL1_STATS_C             13
-#define GET_VERSION             14
-#define OS_STATS                15
-#define XLOG_SET_MASK           16
-#define XLOG_GET_MASK           17
-#define DSP_READ                20
-#define DSP_WRITE               21
-
-#define OK 0xff
-#define MORE_EVENTS 0xfe
-#define NO_EVENT 1
-
-struct DSigStruc
-{
-  byte Id;
-  byte uX;
-  byte listen;
-  byte active;
-  byte sin[3];
-  byte bc[6];
-  byte llc[6];
-  byte hlc[6];
-  byte oad[20];
-};
-
-struct BL1Struc {
-  dword cx_b1;
-  dword cx_b2;
-  dword cr_b1;
-  dword cr_b2;
-  dword px_b1;
-  dword px_b2;
-  dword pr_b1;
-  dword pr_b2;
-  word er_b1;
-  word er_b2;
-};
-
-struct L2Struc {
-  dword XTotal;
-  dword RTotal;
-  word XError;
-  word RError;
-};
-
-struct OSStruc {
-  word free_n;
-};
-
-typedef union
-{
-  struct DSigStruc DSigStats;
-  struct BL1Struc BL1Stats;
-  struct L2Struc L2Stats;
-  struct OSStruc OSStats;
-  byte   b[BUFFER_SZ];
-  word   w[BUFFER_SZ>>1];
-  word   l[BUFFER_SZ>>2]; /* word is wrong, do not use! Use 'd' instead. */
-  dword  d[BUFFER_SZ>>2];
-} BUFFER;
-
-typedef union
-{
-  struct DSigStruc DSigStats;
-  struct BL1Struc BL1Stats;
-  struct L2Struc L2Stats;
-  struct OSStruc OSStats;
-  byte   b[MIPS_BUFFER_SZ];
-  word   w[MIPS_BUFFER_SZ>>1];
-  word   l[BUFFER_SZ>>2]; /* word is wrong, do not use! Use 'd' instead. */
-  dword  d[MIPS_BUFFER_SZ>>2];
-} MIPS_BUFFER;
-
-
-#if !defined(MIPS_SCOM)
-struct pc_maint
-{
-  byte req;
-  byte rc;
-  byte *mem;  /*far*/
-  short length;
-  word port;
-  byte fill[6];
-  BUFFER data;
-};
-#else
-struct pc_maint
-{
-  byte req;
-  byte rc;
-  byte reserved[2];     /* R3000 alignment ... */
-  byte far *mem;
-  short length;
-  word port;
-  byte fill[4];         /* data at offset 16   */
-  BUFFER data;
-};
-#endif
-
-struct mi_pc_maint
-{
-  byte req;
-  byte rc;
-  byte reserved[2];     /* R3000 alignment ... */
-  byte *mem; /*far*/
-  short length;
-  word port;
-  byte fill[4];         /* data at offset 16   */
-  MIPS_BUFFER data;
-};
-
-#endif /* PC_MAINT_H */
diff -Nru a/drivers/isdn/eicon/pr_pc.h b/drivers/isdn/eicon/pr_pc.h
--- a/drivers/isdn/eicon/pr_pc.h	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.0  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-
-#if !defined(PR_PC_H)
-#define PR_PC_H
-
-struct pr_ram {
-  word NextReq;         /* pointer to next Req Buffer               */
-  word NextRc;          /* pointer to next Rc Buffer                */
-  word NextInd;         /* pointer to next Ind Buffer               */
-  byte ReqInput;        /* number of Req Buffers sent               */
-  byte ReqOutput;       /* number of Req Buffers returned           */
-  byte ReqReserved;     /* number of Req Buffers reserved           */
-  byte Int;             /* ISDN-P interrupt                         */
-  byte XLock;           /* Lock field for arbitration               */
-  byte RcOutput;        /* number of Rc buffers received            */
-  byte IndOutput;       /* number of Ind buffers received           */
-  byte IMask;           /* Interrupt Mask Flag                      */
-  byte Reserved1[2];    /* reserved field, do not use               */
-  byte ReadyInt;        /* request field for ready interrupt        */
-  byte Reserved2[12];   /* reserved field, do not use               */
-  byte InterfaceType;   /* interface type 1=16K interface           */
-  word Signature;       /* ISDN-P initialized indication            */
-  byte B[1];            /* buffer space for Req,Ind and Rc          */
-};
-
-typedef struct {
-  word next;
-  byte Req;
-  byte ReqId;
-  byte ReqCh;
-  byte Reserved1;
-  word Reference;
-  byte Reserved[8];
-  PBUFFER XBuffer;
-} REQ;
-
-typedef struct {
-  word next;
-  byte Rc;
-  byte RcId;
-  byte RcCh;
-  byte Reserved1;
-  word Reference;
-  byte Reserved2[8];
-} RC;
-
-typedef struct {
-  word next;
-  byte Ind;
-  byte IndId;
-  byte IndCh;
-  byte MInd;
-  word MLength;
-  word Reference;
-  byte RNR;
-  byte Reserved;
-  dword Ack;
-  PBUFFER RBuffer;
-} IND;
-
-#endif
diff -Nru a/drivers/isdn/eicon/pri.c b/drivers/isdn/eicon/pri.c
--- a/drivers/isdn/eicon/pri.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,517 +0,0 @@
-/*
- * Diva Server PRI specific part of initialisation
- *
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.5  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#include "sys.h"
-#include "idi.h"
-#include "divas.h"
-#include "pc.h"
-#include "pr_pc.h"
-#include "dsp_defs.h"
-
-#include "adapter.h"
-#include "uxio.h"
-
-#define	DIVAS_LOAD_CMD		0x02
-#define	DIVAS_START_CMD		0x03
-#define	DIVAS_IRQ_RESET		0xC18
-#define DIVAS_IRQ_RESET_VAL	0xFE
-
-#define	TEST_INT_DIVAS		0x11
-#define TEST_INT_DIVAS_BRI	0x12
-
-#define DIVAS_RESET	0x81
-#define DIVAS_LED1	0x04
-#define DIVAS_LED2	0x08
-#define DIVAS_LED3	0x20
-#define DIVAS_LED4	0x40
-
-#define	DIVAS_RESET_REG		0x20
-
-#define	DIVAS_SIGNATURE	0x4447
-
-/* offset to start of MAINT area (used by xlog) */
-
-#define	DIVAS_MAINT_OFFSET	0xef00	/* value for PRI card */
-
-#define MP_PROTOCOL_ADDR		0xA0011000
-#define MP_DSP_CODE_BASE		0xa03a0000  
-
-typedef struct {
-		dword cmd;
-		dword addr;
-		dword len;
-		dword err;
-		dword live;
-		dword reserved[(0x1020>>2)-6];
-		dword signature;
-		byte  data[1];
-} diva_server_boot_t;
-
-byte mem_in(ADAPTER *a, void *adr);
-word mem_inw(ADAPTER *a, void *adr);
-void mem_in_buffer(ADAPTER *a, void *adr, void *P, word length);
-void mem_look_ahead(ADAPTER *a, PBUFFER *RBuffer, ENTITY *e);
-void mem_out(ADAPTER *a, void *adr, byte data);
-void mem_outw(ADAPTER *a, void *adr, word data);
-void mem_out_buffer(ADAPTER *a, void *adr, void *P, word length);
-void mem_inc(ADAPTER *a, void *adr);
-
-int DivasPRIInitPCI(card_t *card, dia_card_t *cfg);
-static int pri_ISR (card_t* card);
-
-static int diva_server_reset(card_t *card)
-{
-	byte *reg;
-	diva_server_boot_t *boot = NULL;
-	dword live = 0;
-	int	i = 0;
-	dword	dwWait;
-
-	DPRINTF(("divas: reset Diva Server PRI"));
-
-	reg = UxCardMemAttach(card->hw, DIVAS_REG_MEMORY);
-
-	UxCardMemOut(card->hw, &reg[DIVAS_RESET_REG], DIVAS_RESET | 
-						DIVAS_LED1 | DIVAS_LED2 | DIVAS_LED3 | DIVAS_LED4);
-
-	for (dwWait = 0x000fffff; dwWait; dwWait--)
-		;
-
-	UxCardMemOut(card->hw, &reg[DIVAS_RESET_REG], 0x00);
-
-	for (dwWait = 0x000fffff; dwWait; dwWait--)
-		;
-
-	UxCardMemDetach(card->hw, reg);
-
-	boot = UxCardMemAttach(card->hw, DIVAS_RAM_MEMORY);
-
-	UxCardMemOutD(card->hw, boot->reserved, 0);
-
-	live = UxCardMemInD(card->hw, &boot->live);
-
-	for (i=0; i<5; i++)
-	{
-		if (live != UxCardMemInD(card->hw, &boot->live))
-		{
-			break;
-		}
-		UxPause(10);
-	}
-
-	if (i == 5)
-	{
-		UxCardMemDetach(card->hw, boot);
-
-		DPRINTF(("divas: card is reset but CPU not running"));
-		return -1;
-	}
-
-	UxCardMemDetach(card->hw, boot);
-
-	DPRINTF(("divas: card reset after %d ms", i * 10));
-
-	return 0;
-}
-
-static int diva_server_config(card_t *card, dia_config_t *config)
-{
-	byte *shared;
-	int i, j;
-
-	DPRINTF(("divas: configure Diva Server PRI"));
-
-	shared = UxCardMemAttach(card->hw, DIVAS_SHARED_MEMORY);
-
-	UxCardLog(0);
-	for (i=0; i<256; i++)
-	{
-		UxCardMemOut(card->hw, &shared[i], 0);
-	}
-
-	UxCardMemOut(card->hw, &shared[ 8], config->tei);
-	UxCardMemOut(card->hw, &shared[ 9], config->nt2);
-	UxCardMemOut(card->hw, &shared[10], config->sig_flags);
-	UxCardMemOut(card->hw, &shared[11], config->watchdog);
-	UxCardMemOut(card->hw, &shared[12], config->permanent);
-	UxCardMemOut(card->hw, &shared[13], config->x_interface);
-	UxCardMemOut(card->hw, &shared[14], config->stable_l2);
-	UxCardMemOut(card->hw, &shared[15], config->no_order_check);
-	UxCardMemOut(card->hw, &shared[16], config->handset_type);
-	UxCardMemOut(card->hw, &shared[17], 0);
-	UxCardMemOut(card->hw, &shared[18], config->low_channel);
-	UxCardMemOut(card->hw, &shared[19], config->prot_version);
-	UxCardMemOut(card->hw, &shared[20], config->crc4);
-
-	for (i=0; i<2; i++)
-	{
-		for (j=0; j<32; j++)
-		{
-			UxCardMemOut(card->hw, &shared[32+(i*96)+j],config->terminal[i].oad[j]);
-		}
-
-		for (j=0; j<32; j++)
-		{
-			UxCardMemOut(card->hw, &shared[64+(i*96)+j],config->terminal[i].osa[j]);
-		}
-
-		for (j=0; j<32; j++)
-		{
-			UxCardMemOut(card->hw, &shared[96+(i*96)+j],config->terminal[i].spid[j]);
-		}
-	}
-
-	UxCardMemDetach(card->hw, shared);
-
-	return 0;
-}
-
-static
-void diva_server_reset_int(card_t *card)
-{
-	byte *cfg;
-
-	cfg = UxCardMemAttach(card->hw, DIVAS_CFG_MEMORY);
-
-	UxCardMemOutW(card->hw, &cfg[DIVAS_IRQ_RESET], DIVAS_IRQ_RESET_VAL);
-	UxCardMemOutW(card->hw, &cfg[DIVAS_IRQ_RESET + 2], 0);
-	UxCardMemDetach(card->hw, cfg);
-
-	return;
-}
-
- 
-static int diva_server_test_int(card_t *card)
-{
-	int i;
-	byte *shared;
-	byte req_int;
-
-	DPRINTF(("divas: test interrupt for Diva Server PRI"));
-
-	shared = UxCardMemAttach(card->hw, DIVAS_SHARED_MEMORY);
-
-	UxCardMemIn(card->hw, &shared[0x3FE]);
-	UxCardMemOut(card->hw, &shared[0x3FE], 0);
-	UxCardMemIn(card->hw, &shared[0x3FE]);
-
-	UxCardMemDetach(card->hw, shared);
-
-	diva_server_reset_int(card);
-
-	shared = UxCardMemAttach(card->hw, DIVAS_SHARED_MEMORY);
-
-	card->test_int_pend = TEST_INT_DIVAS;
-
-	req_int = UxCardMemIn(card->hw, &(((struct pr_ram *)shared)->ReadyInt));
-
-	req_int++;
-
-	UxCardMemOut(card->hw, &(((struct pr_ram *)shared)->ReadyInt), req_int);
-
-	UxCardMemDetach(card->hw, shared);
-
-	UxCardLog(0);
-	for (i = 0; i < 50; i++)
-	{
-		if (!card->test_int_pend)
-		{
-			break;
-		}
-		UxPause(10);
-	}
-
-
-	if (card->test_int_pend)
-	{
-
-		DPRINTF(("active: timeout waiting for card to interrupt"));
-		return (-1);
-	
-	}
-	
-	return 0;
-}
-
-
-static void print_hdr(unsigned char *code, int offset)
-{
-	unsigned char hdr[80];
-		int i;
-
-	i = 0;
-
-	while ((i < (DIM(hdr) -1)) && 
-		(code[offset + i] != '\0') &&
-		(code[offset + i] != '\r') &&
-		(code[offset + i] != '\n'))
-	{
-		hdr[i] = code[offset + i];
-		i++;
-	}
-
-	hdr[i] = '\0';
-
-	DPRINTF(("divas: loading %s", hdr));
-}
-
-static int diva_server_load(card_t *card, dia_load_t *load)
-{
-	diva_server_boot_t *boot;
-	int i, offset, length;
-	dword cmd = 0;
-
-	DPRINTF(("divas: loading Diva Server PRI"));
-
-	boot = UxCardMemAttach(card->hw, DIVAS_RAM_MEMORY);
-
-	switch(load->code_type)
-	{
-		case DIA_CPU_CODE:
-			DPRINTF(("divas: RISC code"));
-			print_hdr(load->code, 0x80);
-
-			UxCardMemOutD(card->hw, &boot->addr, MP_PROTOCOL_ADDR);
-			break;
-
-		case DIA_DSP_CODE:
-			DPRINTF(("divas: DSP code"));
-			print_hdr(load->code, 0x0);
-
-			UxCardMemOutD(card->hw, &boot->addr,  
-				(MP_DSP_CODE_BASE + (((sizeof(dword) +
-				(sizeof(t_dsp_download_desc) * DSP_MAX_DOWNLOAD_COUNT))
-				+ ~ALIGNMENT_MASK_MAESTRA) & ALIGNMENT_MASK_MAESTRA)));
-			break;
-
-		case DIA_TABLE_CODE:
-			DPRINTF(("divas: TABLE code"));
-			UxCardMemOutD(card->hw, &boot->addr,
-				(MP_DSP_CODE_BASE + sizeof(dword)));
-			break;
-
-		case DIA_CONT_CODE:
-			DPRINTF(("divas: continuation code"));
-			break;
-
-        case DIA_DLOAD_CNT:
-			DPRINTF(("divas: COUNT code"));
-			UxCardMemOutD(card->hw, &boot->addr, MP_DSP_CODE_BASE);
-			break;
-
-		default:
-			DPRINTF(("divas: unknown code type"));
-			UxCardMemDetach(card->hw, boot);
-			return -1;
-	}
-
-	UxCardLog(0);
-	offset = 0;
-
-	do
-	{
-		length = (load->length - offset >= 400) ? 400 : load->length - offset;
-
-		for (i=0; i<length; i++)
-		{
-			UxCardMemOut(card->hw, &boot->data[i], load->code[offset+i]);
-		}
-
-        for (i=0; i<length; i++)
-		{
-			if (load->code[offset + i] != UxCardMemIn(card->hw, &boot->data[i]))
-			{
-				UxCardMemDetach(card->hw, boot);
-
-				DPRINTF(("divas: card code block verify failed"));
-				return -1;
-			}
-		}
-	
-		UxCardMemOutD(card->hw, &boot->len, (length + 3) / 4);
-		UxCardMemOutD(card->hw, &boot->cmd, DIVAS_LOAD_CMD);
-
-		for (i=0; i<50000; i++)
-		{
-			cmd = UxCardMemInD(card->hw, &boot->cmd);
-			if (!cmd)
-			{
-				break;
-			}
-			/*UxPause(1);*/
-		}
-
-		if (cmd)
-		{
-			DPRINTF(("divas: timeout waiting for card to ACK load (offset = %d)", offset));
-			UxCardMemDetach(card->hw, boot);
-			return -1;
-		}
-
-		offset += length;
-
-	} while (offset < load->length);
-
-	UxCardMemDetach(card->hw, boot);
-
-	DPRINTF(("divas: DIVA Server card loaded"));
-
-	return 0;
-}
-
-static int diva_server_start(card_t *card, byte *channels)
-{
-	diva_server_boot_t *boot;
-	byte *ram;
-	int	i;
-	dword signature = 0;
-
-	DPRINTF(("divas: start Diva Server PRI"));
-
-	card->is_live = FALSE;
-
-	boot = UxCardMemAttach(card->hw, DIVAS_RAM_MEMORY);
-
-	UxCardMemOutD(card->hw, &boot->addr, MP_PROTOCOL_ADDR);
-	UxCardMemOutD(card->hw, &boot->cmd, DIVAS_START_CMD);
-
-	UxCardLog(0);
-
-	for (i = 0; i < 300; i++)
-	{
-		signature = UxCardMemInD(card->hw, &boot->signature);
-		if ((signature >> 16) == DIVAS_SIGNATURE)
-		{
-			DPRINTF(("divas: started card after %d ms", i * 10));
-			break;
-		}
-		UxPause(10);
-	}
-
-	if ((signature >> 16) != DIVAS_SIGNATURE)
-	{
-		UxCardMemDetach(card->hw, boot);
-		DPRINTF(("divas: timeout waiting for card to run protocol code (sig = 0x%x)", signature));
-		return -1;
-	}
-
-	card->is_live = TRUE;
-
-	ram = (byte *) boot;
-	ram += DIVAS_SHARED_OFFSET;
-
-	*channels = UxCardMemIn(card->hw, &ram[0x3F6]);
-	card->serial_no = UxCardMemInD(card->hw, &ram[0x3F0]);
-
-	UxCardMemDetach(card->hw, boot);
-
-	if (diva_server_test_int(card))
-	{
-		DPRINTF(("divas: interrupt test failed"));
-		return -1;	
-	}
-
-	DPRINTF(("divas: DIVA Server card started"));
-
-	return 0;
-}
-
-static
-int 	diva_server_mem_get(card_t *card, mem_block_t *mem_block)
-
-{
-	byte	*a;
-	byte	*card_addr;
-	word	length = 0;
-	int		i;
-
-	a = UxCardMemAttach(card->hw, DIVAS_RAM_MEMORY);
-
-	card_addr = a;
-	card_addr += mem_block->addr;
-
-	for (i=0; i < sizeof(mem_block->data); i++)
-	{
-		mem_block->data[i] = UxCardMemIn(card->hw, card_addr);
-		card_addr++;
-		length++;
-	}
-
-	UxCardMemDetach(card->hw, a);
-
-	return length;
-}
-
-/*
- * Initialise PRI specific entry points
- */
-
-int DivasPriInit(card_t *card, dia_card_t *cfg)
-{
-	DPRINTF(("divas: initialise Diva Server PRI"));
-
-	if (DivasPRIInitPCI(card, cfg) == -1)
-	{
-		return -1;
-	}
-
-	card->card_reset = diva_server_reset;
-	card->card_load = diva_server_load;
-	card->card_config = diva_server_config;
-	card->card_start = diva_server_start;
-	card->reset_int = diva_server_reset_int;
-	card->card_mem_get = diva_server_mem_get;
-
-	card->xlog_offset = DIVAS_MAINT_OFFSET;
-
-	card->out = DivasOut;
-	card->test_int = DivasTestInt;
-	card->dpc = DivasDpc;
-	card->clear_int = DivasClearInt;
-	card->card_isr  = pri_ISR;
-
-	card->a.ram_out = mem_out;
-	card->a.ram_outw = mem_outw;
-	card->a.ram_out_buffer = mem_out_buffer;
-	card->a.ram_inc = mem_inc;
-
-	card->a.ram_in = mem_in;
-	card->a.ram_inw = mem_inw;
-	card->a.ram_in_buffer = mem_in_buffer;
-	card->a.ram_look_ahead = mem_look_ahead;
-
-	return 0;
-}
-
-
-static int pri_ISR (card_t* card) 
-{
-	int served = 0;
-	byte* cfg = UxCardMemAttach(card->hw, DIVAS_CFG_MEMORY);
-	volatile unsigned long* isr = (unsigned long*)&cfg[DIVAS_IRQ_RESET];
-	register unsigned long val = *isr;
-	
-	if (val & 0x80000000)  /* our card had caused interrupt ??? */
-	{
-		served = 1;
-		card->int_pend  += 1;
-		DivasDpcSchedule(); /* ISR DPC */
-
-		*isr = (unsigned long)~0x03E00000; /* Clear interrupt line */
-	}
-
-	UxCardMemDetach(card->hw, cfg);
-
-	return (served != 0);
-}
-
-
diff -Nru a/drivers/isdn/eicon/sys.h b/drivers/isdn/eicon/sys.h
--- a/drivers/isdn/eicon/sys.h	Tue Feb  3 19:45:34 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,95 +0,0 @@
-/*
- * Environment provided by system and miscellaneous definitions
- *
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.2  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#if !defined(SYS_H)
-#define SYS_H
-
-/* abreviations for unsigned types */
-typedef int boolean_t;
-
-typedef unsigned char byte;
-
-typedef unsigned long dword;
-typedef unsigned short word;
-
-/* abreviations for volatile types */
-
-typedef volatile byte	vbyte;
-typedef volatile word	vword;
-typedef volatile dword	vdword;
-
-/* Booleans */
-
-#if !defined(TRUE)
-#define TRUE    (1)
-#define FALSE   (0)
-#endif
-
-/* NULL pointer */
-
-#if !defined(NULL)
-#define NULL    ((void *) 0)
-#endif
-
-/* Return the dimension of an array */
-
-#if !defined(DIM)
-#define DIM(array)  (sizeof (array)/sizeof ((array)[0]))
-#endif
-
-/*
- * Return the number of milliseconds since last boot
- */
-
-extern	dword	UxTimeGet(void);
-
-extern	void 	DivasSprintf(char *buffer, char *format, ...);
-extern	void 	DivasPrintf(char *format, ...);
-
-/* fatal errors, asserts and tracing */
-
-void HwFatalErrorFrom(char *file, int line);
-void HwFatalError(void);
-/* void HwAssert(char *file, int line, char *condition); */
-
-#include <linux/kernel.h>
-#include <linux/string.h>
-
-#define _PRINTK printk
-
-#define _PRINTF	DivasPrintf
-void _PRINTF(char *format, ...);
-#define PRINTF(arg_list)	_PRINTF arg_list
-#if defined DTRACE
-# define DPRINTF(arg_list)	_PRINTF arg_list
-# define KDPRINTF(arg_list)	_PRINTF arg_list ; _PRINTK arg_list ; _PRINTK("\n");
-#else
-# define DPRINTF(arg_list)	(void)0
-# define KDPRINTF(arg_list)	_PRINTK arg_list ; _PRINTK("\n");
-#endif
-
-#if !defined(ASSERT)
-#if defined DEBUG || defined DBG
-# define HwFatalError()	HwFatalErrorFrom(__FILE__, __LINE__)
-# define ASSERT(cond)								\
-		if (!(cond)) 								\
-		{											\
-/*			HwAssert(__FILE__, __LINE__, #cond);*/	\
-		}
-#else
-# define ASSERT(cond)	((void)0)
-#endif
-#endif /* !defined(ASSERT) */
-
-#define TRACE	(_PRINTF(__FILE__"@%d\n", __LINE__))
-
-#endif /* SYS_H */
diff -Nru a/drivers/isdn/eicon/uxio.h b/drivers/isdn/eicon/uxio.h
--- a/drivers/isdn/eicon/uxio.h	Tue Feb  3 19:45:16 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,196 +0,0 @@
-/*
- * Interface to Unix specific code for performing card I/O
- *
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.6  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#if !defined(UXIO_H)
-#define UXIO_H
-
-#include "sys.h"
-#include "adapter.h"
-
-
-struct pt_regs;
-
-/* user callback, returns zero if interrupt was from this card */
-typedef	void		isr_fn_t(void *);
-struct ux_diva_card_s
-{
-	word	in_use;
-	int		io_base;
-	int		reset_base;
-	int		card_type;
-	byte		*mapped;
-	struct pci_dev  *pdev;
-	int		slot;
-	int		irq;
-	byte		*pDRAM;
-	byte		*pDEVICES;
-	byte		*pCONFIG;
-	byte		*pSHARED;
-	byte		*pCONTROL;
-	word		features;
-	void		*user_isr_arg;
-	isr_fn_t	*user_isr;
-};
-
-/*
- * Get a card handle to enable card to be accessed
- */
-
-int		UxCardHandleGet(	ux_diva_card_t	**card,
-							dia_card_t		*cfg);
-
-/*
- * Free a card handle as no longer needed
- */
-
-void	UxCardHandleFree(ux_diva_card_t *card);
-
-/*
- * Lock and unlock access to a card
- */
-
-long		UxCardLock(ux_diva_card_t *card);
-void	UxCardUnlock(ux_diva_card_t *card, unsigned long ipl);
-
-/*
- * Set the mapping address for PCI cards
- */
-
-int		UxCardAddrMappingSet(ux_diva_card_t	*card,
-							int				id,
-							void			*address,
-							int				size);
-
-/*
- * Attach card to memory to enable it to be accessed
- * Returns the mapped address
- */
-
-void	*UxCardMemAttach(ux_diva_card_t *card, int id);
-
-/*
- * map card out of memory after completion of access
- */
-
-void	UxCardMemDetach(ux_diva_card_t *card, void *address);
-
-/*
- * input functions for memory-mapped cards
- */
-
-byte	UxCardMemIn(ux_diva_card_t *card, void *address);
-
-word	UxCardMemInW(ux_diva_card_t *card, void *address);
-
-dword	UxCardMemInD(ux_diva_card_t *card, void *address);
-
-void	UxCardMemInBuffer(	ux_diva_card_t *card,
-							void			*address,
-							void			*buffer,
-							int				length);
-
-/*
- * output functions for memory-mapped cards
- */
-
-void UxCardMemOut(ux_diva_card_t *card, void *address, byte data);
-
-void UxCardMemOutW(ux_diva_card_t *card, void *address, word data);
-
-void UxCardMemOutD(ux_diva_card_t *card, void *address, dword data);
-
-void UxCardMemOutBuffer(	ux_diva_card_t	*card,
-							void			*address,
-							void			*buffer,
-							int				length);
-
-/*
- * input functions for I/O-mapped cards
- */
-
-byte	UxCardIoIn(ux_diva_card_t *card, void *, void *address);
-
-word	UxCardIoInW(ux_diva_card_t *card, void *, void *address);
-
-dword	UxCardIoInD(ux_diva_card_t *card, void *, void *address);
-
-void	UxCardIoInBuffer(	ux_diva_card_t *card,
-							void *, void			*address,
-							void			*buffer,
-							int				length);
-
-/*
- * output functions for I/O-mapped cards
- */
-
-void UxCardIoOut(ux_diva_card_t *card, void *, void *address, byte data);
-
-void UxCardIoOutW(ux_diva_card_t *card, void *, void *address, word data);
-
-void UxCardIoOutD(ux_diva_card_t *card, void *, void *address, dword data);
-
-void UxCardIoOutBuffer(	ux_diva_card_t	*card,
-							void *, void			*address,
-							void			*buffer,
-							int				length);
-
-/*
- * Get specified PCI config
- */
-
-void	UxPciConfigRead(ux_diva_card_t	*card, 
-						int				size,
-						int				offset,
-						void			*value);
-
-/*
- * Set specified PCI config
- */
-
-void	UxPciConfigWrite(ux_diva_card_t	*card, 
-						int				size,
-						int				offset,
-						void			*value);
-
-/* allocate memory, returning NULL if none available */
-
-void	*UxAlloc(unsigned int size);
-
-void	UxFree(void *);
-
-/*
- * Pause for specified number of milli-seconds 
- */
-
-void	UxPause(long ms);
-
-/*
- * Install an ISR for the specified card
- */
-
-int		UxIsrInstall(ux_diva_card_t *card, isr_fn_t *isr_fn, void *isr_arg);
-
-/*
- * Remove an ISR for the specified card
- */
-void	UxIsrRemove(ux_diva_card_t *card, void *);
-
-/*
- * DEBUG function to turn logging ON or OFF
- */
-
-void	UxCardLog(int turn_on);
-
-long	UxInterlockedIncrement(ux_diva_card_t *card, long *dst);
-long	UxInterlockedDecrement(ux_diva_card_t *card, long *dst);
-
-#endif /* of UXIO_H */
diff -Nru a/drivers/isdn/eicon/xlog.c b/drivers/isdn/eicon/xlog.c
--- a/drivers/isdn/eicon/xlog.c	Tue Feb  3 19:45:34 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,164 +0,0 @@
-/*
- * Unix Eicon active card driver
- * XLOG related functions
- *
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * Eicon File Revision :    1.2  
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- */
-
-#include "sys.h"
-#include "idi.h"
-#include "pc.h"
-#include "pc_maint.h"
-#include "divalog.h"
-
-#include "adapter.h"
-#include "uxio.h"
-
-/*
- * convert/copy XLOG info into a KLOG entry
- */
-
-static
-void	xlog_to_klog(byte *b, int size, int card_num)
-
-{
-	typedef struct
-	{
-		word	code;
-		word	time_hi;
-		word	time_lo;
-		word	xcode;
-		byte	data[2];
-	} card_xlog_t;
-
-	card_xlog_t	*x;
-
-	klog_t		klog;
-
-	x = (card_xlog_t *) b;
-
-	memset(&klog, 0, sizeof(klog));
-
-	klog.time_stamp = (dword) x->time_hi;
-	klog.time_stamp = (klog.time_stamp << 16) | (dword) x->time_lo;
-
-	klog.length = size > sizeof(klog.buffer) ? sizeof(klog.buffer) : size;
-
-	klog.card = card_num;
-	if (x->code == 1)
-	{
-		klog.type = KLOG_XTXT_MSG;
-		klog.code = 0;
-		memcpy(klog.buffer, &x->xcode, klog.length);
-	}
-	else if (x->code == 2)
-	{
-		klog.type = KLOG_XLOG_MSG;
-		klog.code = x->xcode;
-		memcpy(klog.buffer, &x->data, klog.length);
-	}
-	else
-	{
-		char	*c; int i;
-		klog.type = KLOG_TEXT_MSG;
-		klog.code = 0;
-		c = "divas: invalid xlog message code from card";
-		i = 0;
-		while (*c)
-		{
-			klog.buffer[i] = *c;
-			c++;
-			i++;
-		}
-		klog.buffer[i] = *c;
-	}
-
-    /* send to the log driver and return */
-
-    DivasLogAdd(&klog, sizeof(klog));
-
-	return;
-}
-
-/*
- * send an XLOG request down to specified card
- * if response available from previous request then read it
- * if not then just send down new request, ready for next time
- */
-
-void	DivasXlogReq(int card_num)
-
-{
-	card_t				*card;
-	ADAPTER 			*a;
-
-	if ((card_num < 0) || (card_num > DivasCardNext))
-	{
-		DPRINTF(("xlog: invalid card number"));
-		return;
-	}
-
-	card = &DivasCards[card_num];
-
-	if (DivasXlogRetrieve(card))
-	{
-		return;
-	}
-
-	/* send down request for next time */
-
-	a = &card->a;
-
-	a->ram_out(a, (word *) (card->xlog_offset + 1), 0);
-	a->ram_out(a, (word *) (dword) (card->xlog_offset), DO_LOG);
-
-	return;
-}
-
-/*
- * retrieve XLOG request from specified card
- * returns non-zero if new request sent to card
- */
-
-int		DivasXlogRetrieve(card_t *card)
-
-{
-	ADAPTER 			*a;
-	struct mi_pc_maint	pcm;
-
-	a = &card->a;
-
-	/* get status of last request */
-
-	pcm.rc = a->ram_in(a, (word *)(card->xlog_offset + 1));
-
-	/* if nothing there from previous request, send down a new one */
-
-	if (pcm.rc == OK)
-	{
-		/* read in response */
-
-		a->ram_in_buffer(a, (word *) (dword) card->xlog_offset, &pcm, sizeof(pcm)); 
-
-		xlog_to_klog((byte *) &pcm.data, sizeof(pcm.data), 
-						(int) (card - DivasCards));
-	}
-
-	/* if any response received from card, re-send request */
-
-	if (pcm.rc)
-	{
-		a->ram_out(a, (word *) (card->xlog_offset + 1), 0);
-		a->ram_out(a, (word *) (dword) (card->xlog_offset), DO_LOG);
-
-		return 1;
-	} 
-
-	return 0;
-}
diff -Nru a/drivers/isdn/hardware/Kconfig b/drivers/isdn/hardware/Kconfig
--- a/drivers/isdn/hardware/Kconfig	Tue Feb  3 19:45:42 2004
+++ b/drivers/isdn/hardware/Kconfig	Tue Feb  3 19:45:42 2004
@@ -25,8 +25,6 @@
 
 source "drivers/isdn/act2000/Kconfig"
 
-source "drivers/isdn/eicon/Kconfig"
-
 source "drivers/isdn/tpam/Kconfig"
 
 source "drivers/isdn/hysdn/Kconfig"
diff -Nru a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c
--- a/drivers/isdn/hardware/avm/avm_cs.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/isdn/hardware/avm/avm_cs.c	Tue Feb  3 19:45:16 2004
@@ -186,7 +186,7 @@
     client_reg.event_handler = &avmcs_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != 0) {
 	cs_error(link->handle, RegisterClient, ret);
 	avmcs_detach(link);
@@ -232,7 +232,7 @@
 
     /* Break the link with Card Services */
     if (link->handle)
-	CardServices(DeregisterClient, link->handle);
+	pcmcia_deregister_client(link->handle);
     
     /* Unlink device structure, free pieces */
     *linkp = link->next;
@@ -251,19 +251,29 @@
     
 ======================================================================*/
 
-static int get_tuple(int fn, client_handle_t handle, tuple_t *tuple,
+static int get_tuple(client_handle_t handle, tuple_t *tuple,
 		     cisparse_t *parse)
 {
-    int i;
-    i = CardServices(fn, handle, tuple);
+    int i = pcmcia_get_tuple_data(handle, tuple);
     if (i != CS_SUCCESS) return i;
-    i = CardServices(GetTupleData, handle, tuple);
+    return pcmcia_parse_tuple(handle, tuple, parse);
+}
+
+static int first_tuple(client_handle_t handle, tuple_t *tuple,
+		     cisparse_t *parse)
+{
+    int i = pcmcia_get_first_tuple(handle, tuple);
     if (i != CS_SUCCESS) return i;
-    return CardServices(ParseTuple, handle, tuple, parse);
+    return get_tuple(handle, tuple, parse);
 }
 
-#define first_tuple(a, b, c) get_tuple(GetFirstTuple, a, b, c)
-#define next_tuple(a, b, c) get_tuple(GetNextTuple, a, b, c)
+static int next_tuple(client_handle_t handle, tuple_t *tuple,
+		     cisparse_t *parse)
+{
+    int i = pcmcia_get_next_tuple(handle, tuple);
+    if (i != CS_SUCCESS) return i;
+    return get_tuple(handle, tuple, parse);
+}
 
 static void avmcs_config(dev_link_t *link)
 {
@@ -287,14 +297,14 @@
     */
     do {
 	tuple.DesiredTuple = CISTPL_CONFIG;
-	i = CardServices(GetFirstTuple, handle, &tuple);
+	i = pcmcia_get_first_tuple(handle, &tuple);
 	if (i != CS_SUCCESS) break;
 	tuple.TupleData = buf;
 	tuple.TupleDataMax = 64;
 	tuple.TupleOffset = 0;
-	i = CardServices(GetTupleData, handle, &tuple);
+	i = pcmcia_get_tuple_data(handle, &tuple);
 	if (i != CS_SUCCESS) break;
-	i = CardServices(ParseTuple, handle, &tuple, &parse);
+	i = pcmcia_parse_tuple(handle, &tuple, &parse);
 	if (i != CS_SUCCESS) break;
 	link->conf.ConfigBase = parse.config.base;
     } while (0);
@@ -337,7 +347,7 @@
                 printk(KERN_INFO "avm_cs: testing i/o %#x-%#x\n",
 			link->io.BasePort1,
 		        link->io.BasePort1+link->io.NumPorts1-1);
-		i = CardServices(RequestIO, link->handle, &link->io);
+		i = pcmcia_request_io(link->handle, &link->io);
 		if (i == CS_SUCCESS) goto found_port;
 	    }
 	    i = next_tuple(handle, &tuple, &parse);
@@ -352,21 +362,21 @@
 	/*
 	 * allocate an interrupt line
 	 */
-	i = CardServices(RequestIRQ, link->handle, &link->irq);
+	i = pcmcia_request_irq(link->handle, &link->irq);
 	if (i != CS_SUCCESS) {
 	    cs_error(link->handle, RequestIRQ, i);
-	    CardServices(ReleaseIO, link->handle, &link->io);
+	    pcmcia_release_io(link->handle, &link->io);
 	    break;
 	}
 	
 	/*
          * configure the PCMCIA socket
 	  */
-	i = CardServices(RequestConfiguration, link->handle, &link->conf);
+	i = pcmcia_request_configuration(link->handle, &link->conf);
 	if (i != CS_SUCCESS) {
 	    cs_error(link->handle, RequestConfiguration, i);
-	    CardServices(ReleaseIO, link->handle, &link->io);
-	    CardServices(ReleaseIRQ, link->handle, &link->irq);
+	    pcmcia_release_io(link->handle, &link->io);
+	    pcmcia_release_irq(link->handle, &link->irq);
 	    break;
 	}
 
@@ -437,9 +447,9 @@
     link->dev = NULL;
     
     /* Don't bother checking to see if these succeed or not */
-    CardServices(ReleaseConfiguration, link->handle);
-    CardServices(ReleaseIO, link->handle, &link->io);
-    CardServices(ReleaseIRQ, link->handle, &link->irq);
+    pcmcia_release_configuration(link->handle);
+    pcmcia_release_io(link->handle, &link->io);
+    pcmcia_release_irq(link->handle, &link->irq);
     link->state &= ~DEV_CONFIG;
     
     if (link->state & DEV_STALE_LINK)
@@ -481,14 +491,14 @@
 	/* Fall through... */
     case CS_EVENT_RESET_PHYSICAL:
 	if (link->state & DEV_CONFIG)
-	    CardServices(ReleaseConfiguration, link->handle);
+	    pcmcia_release_configuration(link->handle);
 	break;
     case CS_EVENT_PM_RESUME:
 	link->state &= ~DEV_SUSPEND;
 	/* Fall through... */
     case CS_EVENT_CARD_RESET:
 	if (link->state & DEV_CONFIG)
-	    CardServices(RequestConfiguration, link->handle, &link->conf);
+	    pcmcia_request_configuration(link->handle, &link->conf);
 	break;
     }
     return 0;
diff -Nru a/drivers/isdn/hardware/eicon/capifunc.c b/drivers/isdn/hardware/eicon/capifunc.c
--- a/drivers/isdn/hardware/eicon/capifunc.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/isdn/hardware/eicon/capifunc.c	Tue Feb  3 19:45:41 2004
@@ -1,4 +1,4 @@
-/* $Id: capifunc.c,v 1.47 2003/09/09 06:52:29 schindler Exp $
+/* $Id: capifunc.c,v 1.48 2004/01/11 19:20:54 armin Exp $
  *
  * ISDN interface module for Eicon active cards DIVA.
  * CAPI Interface common functions
@@ -776,7 +776,7 @@
 	}
 
 	if (application[appl - 1].Id == appl) {
-		DBG_ERR(("CAPI_REGISTER - appl already registered"))
+		DBG_LOG(("CAPI_REGISTER - appl already registered"))
 		return;	/* appl already registered */
 	}
 
diff -Nru a/drivers/isdn/hardware/eicon/divamnt.c b/drivers/isdn/hardware/eicon/divamnt.c
--- a/drivers/isdn/hardware/eicon/divamnt.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/isdn/hardware/eicon/divamnt.c	Tue Feb  3 19:45:28 2004
@@ -1,4 +1,4 @@
-/* $Id: divamnt.c,v 1.28 2003/09/18 06:57:18 schindler Exp $
+/* $Id: divamnt.c,v 1.32 2004/01/15 09:48:13 armin Exp $
  *
  * Driver for Eicon DIVA Server ISDN cards.
  * Maint module
@@ -26,7 +26,7 @@
 #include "divasync.h"
 #include "debug_if.h"
 
-static char *main_revision = "$Revision: 1.28 $";
+static char *main_revision = "$Revision: 1.32 $";
 
 static int major;
 
@@ -53,7 +53,7 @@
 
 extern int mntfunc_init(int *, void **, unsigned long);
 extern void mntfunc_finit(void);
-extern int maint_read_write(void *buf);
+extern int maint_read_write(void *buf, int count);
 
 /*
  *  helper functions
@@ -363,13 +363,13 @@
 static ssize_t divas_maint_write(struct file *file, const char *buf,
 				 size_t count, loff_t * ppos)
 {
-	return (maint_read_write((char *) buf));
+	return (maint_read_write((char *) buf, (int) count));
 }
 
 static ssize_t divas_maint_read(struct file *file, char *buf,
 				size_t count, loff_t * ppos)
 {
-	return (maint_read_write(buf));
+	return (maint_read_write(buf, (int) count));
 }
 
 static struct file_operations divas_maint_fops = {
diff -Nru a/drivers/isdn/hardware/eicon/mntfunc.c b/drivers/isdn/hardware/eicon/mntfunc.c
--- a/drivers/isdn/hardware/eicon/mntfunc.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/isdn/hardware/eicon/mntfunc.c	Tue Feb  3 19:45:16 2004
@@ -1,4 +1,4 @@
-/* $Id: mntfunc.c,v 1.16 2003/09/18 06:57:17 schindler Exp $
+/* $Id: mntfunc.c,v 1.19 2004/01/09 21:22:03 armin Exp $
  *
  * Driver for Eicon DIVA Server ISDN cards.
  * Maint module
@@ -148,12 +148,15 @@
 /*
  * read/write maint
  */
-int maint_read_write(void *buf)
+int maint_read_write(void *buf, int count)
 {
 	byte data[128];
 	dword cmd, id, mask;
 	int ret = 0;
 
+	if (count < (3 * sizeof(dword)))
+		return (-EFAULT);
+
 	if (diva_os_copy_from_user(NULL, (void *) &data[0],
 				   buf, 3 * sizeof(dword))) {
 		return (-EFAULT);
@@ -166,7 +169,7 @@
 	switch (cmd) {
 	case DITRACE_CMD_GET_DRIVER_INFO:
 		if ((ret = diva_get_driver_info(id, data, sizeof(data))) > 0) {
-			if (diva_os_copy_to_user
+			if ((count < ret) || diva_os_copy_to_user
 			    (NULL, buf, (void *) &data[0], ret))
 				ret = -EFAULT;
 		} else {
@@ -176,7 +179,7 @@
 
 	case DITRACE_READ_DRIVER_DBG_MASK:
 		if ((ret = diva_get_driver_dbg_mask(id, (byte *) data)) > 0) {
-			if (diva_os_copy_to_user
+			if ((count < ret) || diva_os_copy_to_user
 			    (NULL, buf, (void *) &data[0], ret))
 				ret = -EFAULT;
 		} else {
@@ -209,7 +212,7 @@
 						ret = size;
 						memcpy(pbuf, pmsg, size);
 						diva_maint_ack_message(1, &old_irql);
-						if (diva_os_copy_to_user (NULL, buf,
+						if ((count < size) || diva_os_copy_to_user (NULL, buf,
 						     (void *) pbuf, size))
 							ret = -EFAULT;
 						diva_os_free_tbuffer(0, pbuf);
@@ -265,7 +268,7 @@
 			pbuf[written++] = 0;
 			pbuf[written++] = 0;
 
-			if (diva_os_copy_to_user(NULL, buf, (void *) pbuf, written)) {
+			if ((count < written) || diva_os_copy_to_user(NULL, buf, (void *) pbuf, written)) {
 				ret = -EFAULT;
 			} else {
 				ret = written;
diff -Nru a/drivers/isdn/hardware/eicon/platform.h b/drivers/isdn/hardware/eicon/platform.h
--- a/drivers/isdn/hardware/eicon/platform.h	Tue Feb  3 19:45:35 2004
+++ b/drivers/isdn/hardware/eicon/platform.h	Tue Feb  3 19:45:35 2004
@@ -1,4 +1,4 @@
-/* $Id: platform.h,v 1.32 2003/09/18 06:59:59 schindler Exp $
+/* $Id: platform.h,v 1.35 2003/12/05 18:45:05 armin Exp $
  *
  * platform.h
  * 
@@ -116,6 +116,8 @@
 #define MEM_TYPE_ADDRESS	6
 #define MEM_TYPE_CONFIG		7
 #define MEM_TYPE_CONTROL	8
+
+#define MAX_MEM_TYPE		10
 
 #define DIVA_OS_MEM_ATTACH_RAM(a)	((a)->ram)
 #define DIVA_OS_MEM_ATTACH_PORT(a)	((a)->port)
diff -Nru a/drivers/isdn/hardware/eicon/s_bri.c b/drivers/isdn/hardware/eicon/s_bri.c
--- a/drivers/isdn/hardware/eicon/s_bri.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/isdn/hardware/eicon/s_bri.c	Tue Feb  3 19:45:42 2004
@@ -61,7 +61,7 @@
 /*
  * check for trapped MIPS 3xxx CPU, dump only exception frame
  */
- if ( READ_WORD(&Xlog[0x80 / sizeof(Xlog[0])]) == 0x99999999 )
+ if ( READ_DWORD(&Xlog[0x80 / sizeof(Xlog[0])]) == 0x99999999 )
  {
   dump_trap_frame (IoAdapter, &((byte *)Xlog)[0x90]) ;
   IoAdapter->trapped = 1 ;
diff -Nru a/drivers/isdn/hardware/eicon/um_idi.c b/drivers/isdn/hardware/eicon/um_idi.c
--- a/drivers/isdn/hardware/eicon/um_idi.c	Tue Feb  3 19:45:33 2004
+++ b/drivers/isdn/hardware/eicon/um_idi.c	Tue Feb  3 19:45:33 2004
@@ -1,4 +1,4 @@
-/* $Id: um_idi.c,v 1.9 2003/09/09 06:00:47 schindler Exp $ */
+/* $Id: um_idi.c,v 1.12 2004/01/12 18:00:09 armin Exp $ */
 
 #include "platform.h"
 #include "di_defs.h"
@@ -252,7 +252,7 @@
 			diva_os_free(0, e);
 			return (0);
 		}
-		if ((diva_data_q_init(&e->rc, 64, 2))) {
+		if ((diva_data_q_init(&e->rc, sizeof(diva_um_idi_ind_hdr_t), 2))) {
 			diva_data_q_finit(&e->data);
 			diva_os_free(0, e->os_context);
 			diva_os_free(0, e);
diff -Nru a/drivers/isdn/hardware/eicon/xdi_adapter.h b/drivers/isdn/hardware/eicon/xdi_adapter.h
--- a/drivers/isdn/hardware/eicon/xdi_adapter.h	Tue Feb  3 19:45:29 2004
+++ b/drivers/isdn/hardware/eicon/xdi_adapter.h	Tue Feb  3 19:45:29 2004
@@ -1,4 +1,4 @@
-/* $Id: xdi_adapter.h,v 1.5 2003/06/21 17:06:08 schindler Exp $ */
+/* $Id: xdi_adapter.h,v 1.6 2003/12/05 18:45:05 armin Exp $ */
 
 #ifndef __DIVA_OS_XDI_ADAPTER_H__
 #define __DIVA_OS_XDI_ADAPTER_H__
@@ -14,7 +14,7 @@
 	dword bar[8];		/* contains context of appropriate BAR Register */
 	void *addr[8];		/* same bar, but mapped into memory */
 	dword length[8];	/* bar length */
-	int mem_type_id[10];
+	int mem_type_id[MAX_MEM_TYPE];
 	unsigned int qoffset;
 	byte irq;
 } divas_pci_card_resources_t;
diff -Nru a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
--- a/drivers/isdn/hisax/avma1_cs.c	Tue Feb  3 19:45:33 2004
+++ b/drivers/isdn/hisax/avma1_cs.c	Tue Feb  3 19:45:33 2004
@@ -204,7 +204,7 @@
     client_reg.event_handler = &avma1cs_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != 0) {
 	cs_error(link->handle, RegisterClient, ret);
 	avma1cs_detach(link);
@@ -252,7 +252,7 @@
 
     /* Break the link with Card Services */
     if (link->handle)
-	CardServices(DeregisterClient, link->handle);
+	pcmcia_deregister_client(link->handle);
     
     /* Unlink device structure, free pieces */
     *linkp = link->next;
@@ -271,19 +271,29 @@
     
 ======================================================================*/
 
-static int get_tuple(int fn, client_handle_t handle, tuple_t *tuple,
+static int get_tuple(client_handle_t handle, tuple_t *tuple,
 		     cisparse_t *parse)
 {
-    int i;
-    i = CardServices(fn, handle, tuple);
+    int i = pcmcia_get_tuple_data(handle, tuple);
     if (i != CS_SUCCESS) return i;
-    i = CardServices(GetTupleData, handle, tuple);
+    return pcmcia_parse_tuple(handle, tuple, parse);
+}
+
+static int first_tuple(client_handle_t handle, tuple_t *tuple,
+		     cisparse_t *parse)
+{
+    int i = pcmcia_get_first_tuple(handle, tuple);
     if (i != CS_SUCCESS) return i;
-    return CardServices(ParseTuple, handle, tuple, parse);
+    return get_tuple(handle, tuple, parse);
 }
 
-#define first_tuple(a, b, c) get_tuple(GetFirstTuple, a, b, c)
-#define next_tuple(a, b, c) get_tuple(GetNextTuple, a, b, c)
+static int next_tuple(client_handle_t handle, tuple_t *tuple,
+		     cisparse_t *parse)
+{
+    int i = pcmcia_get_next_tuple(handle, tuple);
+    if (i != CS_SUCCESS) return i;
+    return get_tuple(handle, tuple, parse);
+}
 
 static void avma1cs_config(dev_link_t *link)
 {
@@ -308,14 +318,14 @@
     */
     do {
 	tuple.DesiredTuple = CISTPL_CONFIG;
-	i = CardServices(GetFirstTuple, handle, &tuple);
+	i = pcmcia_get_first_tuple(handle, &tuple);
 	if (i != CS_SUCCESS) break;
 	tuple.TupleData = buf;
 	tuple.TupleDataMax = 64;
 	tuple.TupleOffset = 0;
-	i = CardServices(GetTupleData, handle, &tuple);
+	i = pcmcia_get_tuple_data(handle, &tuple);
 	if (i != CS_SUCCESS) break;
-	i = CardServices(ParseTuple, handle, &tuple, &parse);
+	i = pcmcia_parse_tuple(handle, &tuple, &parse);
 	if (i != CS_SUCCESS) break;
 	link->conf.ConfigBase = parse.config.base;
     } while (0);
@@ -358,7 +368,7 @@
                 printk(KERN_INFO "avma1_cs: testing i/o %#x-%#x\n",
 			link->io.BasePort1,
 		        link->io.BasePort1+link->io.NumPorts1 - 1);
-		i = CardServices(RequestIO, link->handle, &link->io);
+		i = pcmcia_request_io(link->handle, &link->io);
 		if (i == CS_SUCCESS) goto found_port;
 	    }
 	    i = next_tuple(handle, &tuple, &parse);
@@ -373,21 +383,21 @@
 	/*
 	 * allocate an interrupt line
 	 */
-	i = CardServices(RequestIRQ, link->handle, &link->irq);
+	i = pcmcia_request_irq(link->handle, &link->irq);
 	if (i != CS_SUCCESS) {
 	    cs_error(link->handle, RequestIRQ, i);
-	    CardServices(ReleaseIO, link->handle, &link->io);
+	    pcmcia_release_io(link->handle, &link->io);
 	    break;
 	}
 	
 	/*
          * configure the PCMCIA socket
 	  */
-	i = CardServices(RequestConfiguration, link->handle, &link->conf);
+	i = pcmcia_request_configuration(link->handle, &link->conf);
 	if (i != CS_SUCCESS) {
 	    cs_error(link->handle, RequestConfiguration, i);
-	    CardServices(ReleaseIO, link->handle, &link->io);
-	    CardServices(ReleaseIRQ, link->handle, &link->irq);
+	    pcmcia_release_io(link->handle, &link->io);
+	    pcmcia_release_irq(link->handle, &link->irq);
 	    break;
 	}
 
@@ -445,9 +455,9 @@
     link->dev = NULL;
     
     /* Don't bother checking to see if these succeed or not */
-    CardServices(ReleaseConfiguration, link->handle);
-    CardServices(ReleaseIO, link->handle, &link->io);
-    CardServices(ReleaseIRQ, link->handle, &link->irq);
+    pcmcia_release_configuration(link->handle);
+    pcmcia_release_io(link->handle, &link->io);
+    pcmcia_release_irq(link->handle, &link->irq);
     link->state &= ~DEV_CONFIG;
     
     if (link->state & DEV_STALE_LINK)
@@ -490,14 +500,14 @@
 	/* Fall through... */
     case CS_EVENT_RESET_PHYSICAL:
 	if (link->state & DEV_CONFIG)
-	    CardServices(ReleaseConfiguration, link->handle);
+	    pcmcia_release_configuration(link->handle);
 	break;
     case CS_EVENT_PM_RESUME:
 	link->state &= ~DEV_SUSPEND;
 	/* Fall through... */
     case CS_EVENT_CARD_RESET:
 	if (link->state & DEV_CONFIG)
-	    CardServices(RequestConfiguration, link->handle, &link->conf);
+	    pcmcia_request_configuration(link->handle, &link->conf);
 	break;
     }
     return 0;
diff -Nru a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
--- a/drivers/isdn/hisax/elsa_cs.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/isdn/hisax/elsa_cs.c	Tue Feb  3 19:45:18 2004
@@ -235,7 +235,7 @@
     client_reg.event_handler = &elsa_cs_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != CS_SUCCESS) {
         cs_error(link->handle, RegisterClient, ret);
         elsa_cs_detach(link);
@@ -286,7 +286,7 @@
 
     /* Break the link with Card Services */
     if (link->handle) {
-        ret = CardServices(DeregisterClient, link->handle);
+        ret = pcmcia_deregister_client(link->handle);
 	if (ret != CS_SUCCESS)
 	    cs_error(link->handle, DeregisterClient, ret);
     }
@@ -304,19 +304,29 @@
     device available to the system.
 
 ======================================================================*/
-static int get_tuple(int fn, client_handle_t handle, tuple_t *tuple,
+static int get_tuple(client_handle_t handle, tuple_t *tuple,
                      cisparse_t *parse)
 {
-    int i;
-    i = CardServices(fn, handle, tuple);
+    int i = pcmcia_get_tuple_data(handle, tuple);
     if (i != CS_SUCCESS) return i;
-    i = CardServices(GetTupleData, handle, tuple);
+    return pcmcia_parse_tuple(handle, tuple, parse);
+}
+
+static int first_tuple(client_handle_t handle, tuple_t *tuple,
+                     cisparse_t *parse)
+{
+    int i = pcmcia_get_first_tuple(handle, tuple);
     if (i != CS_SUCCESS) return i;
-    return CardServices(ParseTuple, handle, tuple, parse);
+    return get_tuple(handle, tuple, parse);
 }
 
-#define first_tuple(a, b, c) get_tuple(GetFirstTuple, a, b, c)
-#define next_tuple(a, b, c) get_tuple(GetNextTuple, a, b, c)
+static int next_tuple(client_handle_t handle, tuple_t *tuple,
+                     cisparse_t *parse)
+{
+    int i = pcmcia_get_next_tuple(handle, tuple);
+    if (i != CS_SUCCESS) return i;
+    return get_tuple(handle, tuple, parse);
+}
 
 static void elsa_cs_config(dev_link_t *link)
 {
@@ -362,14 +372,14 @@
             printk(KERN_INFO "(elsa_cs: looks like the 96 model)\n");
             link->conf.ConfigIndex = cf->index;
             link->io.BasePort1 = cf->io.win[0].base;
-            i = CardServices(RequestIO, link->handle, &link->io);
+            i = pcmcia_request_io(link->handle, &link->io);
             if (i == CS_SUCCESS) break;
         } else {
           printk(KERN_INFO "(elsa_cs: looks like the 97 model)\n");
           link->conf.ConfigIndex = cf->index;
           for (i = 0, j = 0x2f0; j > 0x100; j -= 0x10) {
             link->io.BasePort1 = j;
-            i = CardServices(RequestIO, link->handle, &link->io);
+            i = pcmcia_request_io(link->handle, &link->io);
             if (i == CS_SUCCESS) break;
           }
           break;
@@ -382,14 +392,14 @@
 	goto cs_failed;
     }
 
-    i = CardServices(RequestIRQ, link->handle, &link->irq);
+    i = pcmcia_request_irq(link->handle, &link->irq);
     if (i != CS_SUCCESS) {
         link->irq.AssignedIRQ = 0;
 	last_fn = RequestIRQ;
         goto cs_failed;
     }
 
-    i = CardServices(RequestConfiguration, link->handle, &link->conf);
+    i = pcmcia_request_configuration(link->handle, &link->conf);
     if (i != CS_SUCCESS) {
       last_fn = RequestConfiguration;
       goto cs_failed;
@@ -447,10 +457,10 @@
 
     /* Don't bother checking to see if these succeed or not */
     if (link->win)
-        CardServices(ReleaseWindow, link->win);
-    CardServices(ReleaseConfiguration, link->handle);
-    CardServices(ReleaseIO, link->handle, &link->io);
-    CardServices(ReleaseIRQ, link->handle, &link->irq);
+        pcmcia_release_window(link->win);
+    pcmcia_release_configuration(link->handle);
+    pcmcia_release_io(link->handle, &link->io);
+    pcmcia_release_irq(link->handle, &link->irq);
     link->state &= ~DEV_CONFIG;
 
     if (link->state & DEV_STALE_LINK)
@@ -499,14 +509,14 @@
         /* Mark the device as stopped, to block IO until later */
         dev->busy = 1;
         if (link->state & DEV_CONFIG)
-            CardServices(ReleaseConfiguration, link->handle);
+            pcmcia_release_configuration(link->handle);
         break;
     case CS_EVENT_PM_RESUME:
         link->state &= ~DEV_SUSPEND;
         /* Fall through... */
     case CS_EVENT_CARD_RESET:
         if (link->state & DEV_CONFIG)
-            CardServices(RequestConfiguration, link->handle, &link->conf);
+            pcmcia_request_configuration(link->handle, &link->conf);
         dev->busy = 0;
         break;
     }
diff -Nru a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c
--- a/drivers/isdn/hisax/sedlbauer_cs.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/isdn/hisax/sedlbauer_cs.c	Tue Feb  3 19:45:17 2004
@@ -247,7 +247,7 @@
     client_reg.event_handler = &sedlbauer_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != CS_SUCCESS) {
 	cs_error(link->handle, RegisterClient, ret);
 	sedlbauer_detach(link);
@@ -295,7 +295,7 @@
 
     /* Break the link with Card Services */
     if (link->handle)
-	CardServices(DeregisterClient, link->handle);
+	pcmcia_deregister_client(link->handle);
     
     /* Unlink device structure, and free it */
     *linkp = link->next;
@@ -310,12 +310,8 @@
     device available to the system.
     
 ======================================================================*/
-
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn),args))!=0) goto cs_failed
-
-#define CFG_CHECK(fn, args...) \
-if (CardServices(fn, args) != 0) goto next_entry
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static void sedlbauer_config(dev_link_t *link)
 {
@@ -341,9 +337,9 @@
     tuple.TupleData = buf;
     tuple.TupleDataMax = sizeof(buf);
     tuple.TupleOffset = 0;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
-    CS_CHECK(GetTupleData, handle, &tuple);
-    CS_CHECK(ParseTuple, handle, &tuple, &parse);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+    CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
     link->conf.ConfigBase = parse.config.base;
     link->conf.Present = parse.config.rmask[0];
     
@@ -351,7 +347,7 @@
     link->state |= DEV_CONFIG;
 
     /* Look up the current Vcc */
-    CS_CHECK(GetConfigurationInfo, handle, &conf);
+    CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf));
     link->conf.Vcc = conf.Vcc;
 
     /*
@@ -367,12 +363,13 @@
       will only use the CIS to fill in implementation-defined details.
     */
     tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
     while (1) {
 	cistpl_cftable_entry_t dflt = { 0 };
 	cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
-	CFG_CHECK(GetTupleData, handle, &tuple);
-	CFG_CHECK(ParseTuple, handle, &tuple, &parse);
+	if (pcmcia_get_tuple_data(handle, &tuple) != 0 ||
+		pcmcia_parse_tuple(handle, &tuple, &parse) != 0)
+	    goto next_entry;
 
 	if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg;
 	if (cfg->index == 0) goto next_entry;
@@ -425,7 +422,8 @@
 		link->io.NumPorts2 = io->win[1].len;
 	    }
 	    /* This reserves IO space but doesn't actually enable it */
-	    CFG_CHECK(RequestIO, link->handle, &link->io);
+	    if (pcmcia_request_io(link->handle, &link->io) != 0)
+		goto next_entry;
 	}
 
 	/*
@@ -451,10 +449,11 @@
                 req.Size = 0x1000;
 */
 	    req.AccessSpeed = 0;
-	    link->win = (window_handle_t)link->handle;
-	    CFG_CHECK(RequestWindow, &link->win, &req);
+	    if (pcmcia_request_window(&link->handle, &req, &link->win) != 0)
+		goto next_entry;
 	    map.Page = 0; map.CardOffset = mem->win[0].card_addr;
-	    CFG_CHECK(MapMemPage, link->win, &map);
+	    if (pcmcia_map_mem_page(link->win, &map) != 0)
+		goto next_entry;
 	}
 	/* If we got this far, we're cool! */
 	break;
@@ -462,9 +461,9 @@
     next_entry:
 /* new in dummy.cs 2001/01/28 MN 
         if (link->io.NumPorts1)
-           CardServices(ReleaseIO, link->handle, &link->io);
+           pcmcia_release_io(link->handle, &link->io);
 */
-	CS_CHECK(GetNextTuple, handle, &tuple);
+	CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));
     }
     
     /*
@@ -473,14 +472,14 @@
        irq structure is initialized.
     */
     if (link->conf.Attributes & CONF_ENABLE_IRQ)
-	CS_CHECK(RequestIRQ, link->handle, &link->irq);
+	CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));
 	
     /*
        This actually configures the PCMCIA socket -- setting up
        the I/O windows and the interrupt mapping, and putting the
        card and host interface into "Memory and IO" mode.
     */
-    CS_CHECK(RequestConfiguration, link->handle, &link->conf);
+    CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));
 
     /*
       At this point, the dev_node_t structure(s) need to be
@@ -545,12 +544,12 @@
     
     /* Don't bother checking to see if these succeed or not */
     if (link->win)
-	CardServices(ReleaseWindow, link->win);
-    CardServices(ReleaseConfiguration, link->handle);
+	pcmcia_release_window(link->win);
+    pcmcia_release_configuration(link->handle);
     if (link->io.NumPorts1)
-	CardServices(ReleaseIO, link->handle, &link->io);
+	pcmcia_release_io(link->handle, &link->io);
     if (link->irq.AssignedIRQ)
-	CardServices(ReleaseIRQ, link->handle, &link->irq);
+	pcmcia_release_irq(link->handle, &link->irq);
     link->state &= ~DEV_CONFIG;
     
     if (link->state & DEV_STALE_LINK)
@@ -597,14 +596,14 @@
 	/* Mark the device as stopped, to block IO until later */
 	dev->stop = 1;
 	if (link->state & DEV_CONFIG)
-	    CardServices(ReleaseConfiguration, link->handle);
+	    pcmcia_release_configuration(link->handle);
 	break;
     case CS_EVENT_PM_RESUME:
 	link->state &= ~DEV_SUSPEND;
 	/* Fall through... */
     case CS_EVENT_CARD_RESET:
 	if (link->state & DEV_CONFIG)
-	    CardServices(RequestConfiguration, link->handle, &link->conf);
+	    pcmcia_request_configuration(link->handle, &link->conf);
 	dev->stop = 0;
 	/*
 	  In a normal driver, additional code may go here to restore
diff -Nru a/drivers/macintosh/adb-iop.c b/drivers/macintosh/adb-iop.c
--- a/drivers/macintosh/adb-iop.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/macintosh/adb-iop.c	Tue Feb  3 19:45:16 2004
@@ -105,18 +105,19 @@
 	struct adb_iopmsg *amsg = (struct adb_iopmsg *) msg->message;
 	struct adb_request *req;
 	uint flags;
+#ifdef DEBUG_ADB_IOP
+	int i;
+#endif
 
 	local_irq_save(flags);
 
 	req = current_req;
 
 #ifdef DEBUG_ADB_IOP
-	printk("adb_iop_listen: rcvd packet, %d bytes: %02X %02X",
+	printk("adb_iop_listen %p: rcvd packet, %d bytes: %02X %02X", req,
 		(uint) amsg->count + 2, (uint) amsg->flags, (uint) amsg->cmd);
-	i = 0;
-	while (i < amsg->count) {
-		printk(" %02X", (uint) amsg->data[i++]);
-	}
+	for (i = 0; i < amsg->count; i++)
+		printk(" %02X", (uint) amsg->data[i]);
 	printk("\n");
 #endif
 
@@ -134,7 +135,7 @@
 			adb_iop_end_req(req, idle);
 		}
 	} else {
-		/* TODO: is it possible for more tha one chunk of data  */
+		/* TODO: is it possible for more than one chunk of data  */
 		/*       to arrive before the timeout? If so we need to */
 		/*       use reply_ptr here like the other drivers do.  */
 		if ((adb_iop_state == awaiting_reply) &&
@@ -163,6 +164,9 @@
 	unsigned long flags;
 	struct adb_request *req;
 	struct adb_iopmsg amsg;
+#ifdef DEBUG_ADB_IOP
+	int i;
+#endif
 
 	/* get the packet to send */
 	req = current_req;
@@ -171,7 +175,7 @@
 	local_irq_save(flags);
 
 #ifdef DEBUG_ADB_IOP
-	printk("adb_iop_start: sending packet, %d bytes:", req->nbytes);
+	printk("adb_iop_start %p: sending packet, %d bytes:", req, req->nbytes);
 	for (i = 0 ; i < req->nbytes ; i++)
 		printk(" %02X", (uint) req->data[i]);
 	printk("\n");
@@ -267,13 +271,17 @@
 
 int adb_iop_reset_bus(void)
 {
-	struct adb_request req;
+	struct adb_request req = {
+		.reply_expected = 0,
+		.nbytes = 2,
+		.data = { ADB_PACKET, 0 },
+	};
 
-	req.reply_expected = 0;
-	req.nbytes = 2;
-	req.data[0] = ADB_PACKET;
-	req.data[1] = 0; /* RESET */
 	adb_iop_write(&req);
-	while (!req.complete) adb_iop_poll();
+	while (!req.complete) {
+		adb_iop_poll();
+		schedule();
+	}
+
 	return 0;
 }
diff -Nru a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
--- a/drivers/macintosh/adbhid.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/macintosh/adbhid.c	Tue Feb  3 19:45:43 2004
@@ -69,8 +69,8 @@
 	 22, 26, 23, 25, 28, 38, 36, 40, 37, 39, 43, 51, 53, 49, 50, 52,
 	 15, 57, 41, 14, 96,  1, 29,125, 42, 58, 56,105,106,108,103,  0,
 	  0, 83,  0, 55,  0, 78,  0, 69,  0,  0,  0, 98, 96,  0, 74,  0,
-	  0,117, 82, 79, 80, 81, 75, 76, 77, 71,  0, 72, 73,183,181,124,
-	 63, 64, 65, 61, 66, 67,191, 87,190, 99,  0, 70,  0, 68,101, 88,
+	  0,117, 82, 79, 80, 81, 75, 76, 77, 71,  0, 72, 73,124, 89,121,
+	 63, 64, 65, 61, 66, 67,123, 87,122, 99,  0, 70,  0, 68,101, 88,
 	  0,119,110,102,104,111, 62,107, 60,109, 59, 54,100, 97,126,116
 };
 
diff -Nru a/drivers/macintosh/via-macii.c b/drivers/macintosh/via-macii.c
--- a/drivers/macintosh/via-macii.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/macintosh/via-macii.c	Tue Feb  3 19:45:30 2004
@@ -22,13 +22,13 @@
 #include <linux/sched.h>
 #include <linux/adb.h>
 #include <linux/interrupt.h>
+#include <linux/init.h>
 #include <asm/macintosh.h>
 #include <asm/macints.h>
 #include <asm/machw.h>
 #include <asm/mac_via.h>
 #include <asm/io.h>
 #include <asm/system.h>
-#include <asm/init.h>
 
 static volatile unsigned char *via;
 
diff -Nru a/drivers/md/Kconfig b/drivers/md/Kconfig
--- a/drivers/md/Kconfig	Tue Feb  3 19:45:17 2004
+++ b/drivers/md/Kconfig	Tue Feb  3 19:45:17 2004
@@ -107,6 +107,33 @@
 
 	  If unsure, say Y.
 
+config MD_RAID6
+	tristate "RAID-6 mode (EXPERIMENTAL)"
+	depends on BLK_DEV_MD && EXPERIMENTAL
+	---help---
+	  WARNING: RAID-6 is currently highly experimental.  If you
+	  use it, there is no guarantee whatsoever that it won't
+	  destroy your data, eat your disk drives, insult your mother,
+	  or re-appoint George W. Bush.
+
+	  A RAID-6 set of N drives with a capacity of C MB per drive
+	  provides the capacity of C * (N - 2) MB, and protects
+	  against a failure of any two drives. For a given sector
+	  (row) number, (N - 2) drives contain data sectors, and two
+	  drives contains two independent redundancy syndromes.  Like
+	  RAID-5, RAID-6 distributes the syndromes across the drives
+	  in one of the available parity distribution methods.
+
+	  RAID-6 requires mdadm-1.5.0 or later, available at:
+
+	  ftp://ftp.kernel.org/pub/linux/utils/raid/mdadm/
+
+	  If you want to use such a RAID-6 set, say Y.  To compile
+	  this code as a module, choose M here: the module will be
+	  called raid6.
+
+	  If unsure, say N.
+
 config MD_MULTIPATH
 	tristate "Multipath I/O support"
 	depends on BLK_DEV_MD
diff -Nru a/drivers/md/Makefile b/drivers/md/Makefile
--- a/drivers/md/Makefile	Tue Feb  3 19:45:28 2004
+++ b/drivers/md/Makefile	Tue Feb  3 19:45:28 2004
@@ -4,6 +4,11 @@
 
 dm-mod-objs	:= dm.o dm-table.o dm-target.o dm-linear.o dm-stripe.o \
 		   dm-ioctl.o
+raid6-objs	:= raid6main.o raid6algos.o raid6recov.o raid6tables.o \
+		   raid6int1.o raid6int2.o raid6int4.o \
+		   raid6int8.o raid6int16.o raid6int32.o \
+		   raid6mmx.o raid6sse1.o raid6sse2.o
+host-progs	:= mktables
 
 # Note: link order is important.  All raid personalities
 # and xor.o must come before md.o, as they each initialise 
@@ -14,6 +19,31 @@
 obj-$(CONFIG_MD_RAID0)		+= raid0.o
 obj-$(CONFIG_MD_RAID1)		+= raid1.o
 obj-$(CONFIG_MD_RAID5)		+= raid5.o xor.o
+obj-$(CONFIG_MD_RAID6)		+= raid6.o xor.o
 obj-$(CONFIG_MD_MULTIPATH)	+= multipath.o
 obj-$(CONFIG_BLK_DEV_MD)	+= md.o
 obj-$(CONFIG_BLK_DEV_DM)	+= dm-mod.o
+
+# Files generated that shall be removed upon make clean
+clean-files := raid6int*.c raid6tables.c mktables
+
+$(obj)/raid6int1.c:   $(src)/raid6int.uc $(src)/unroll.pl
+	$(PERL) $(src)/unroll.pl 1 < $< > $@ || ( rm -f $@ && exit 1 )
+
+$(obj)/raid6int2.c:   $(src)/raid6int.uc $(src)/unroll.pl
+	$(PERL) $(src)/unroll.pl 2 < $< > $@ || ( rm -f $@ && exit 1 )
+
+$(obj)/raid6int4.c:   $(src)/raid6int.uc $(src)/unroll.pl
+	$(PERL) $(src)/unroll.pl 4 < $< > $@ || ( rm -f $@ && exit 1 )
+
+$(obj)/raid6int8.c:   $(src)/raid6int.uc $(src)/unroll.pl
+	$(PERL) $(src)/unroll.pl 8 < $< > $@ || ( rm -f $@ && exit 1 )
+
+$(obj)/raid6int16.c:  $(src)/raid6int.uc $(src)/unroll.pl
+	$(PERL) $(src)/unroll.pl 16 < $< > $@ || ( rm -f $@ && exit 1 )
+
+$(obj)/raid6int32.c:  $(src)/raid6int.uc $(src)/unroll.pl
+	$(PERL) $(src)/unroll.pl 32 < $< > $@ || ( rm -f $@ && exit 1 )
+
+$(obj)/raid6tables.c: $(obj)/mktables
+	$(obj)/mktables > $@ || ( rm -f $@ && exit 1 )
diff -Nru a/drivers/md/md.c b/drivers/md/md.c
--- a/drivers/md/md.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/md/md.c	Tue Feb  3 19:45:17 2004
@@ -7,6 +7,7 @@
    Changes:
 
    - RAID-1/RAID-5 extensions by Miguel de Icaza, Gadi Oxman, Ingo Molnar
+   - RAID-6 extensions by H. Peter Anvin <hpa@zytor.com>
    - boot support for linear and striped mode by Harald Hoyer <HarryH@Royal.Net>
    - kerneld support by Boris Tobotras <boris@xtalk.msk.su>
    - kmod support by: Cyrus Durgin
@@ -123,11 +124,9 @@
 
 static struct block_device_operations md_fops;
 
-static struct gendisk *disks[MAX_MD_DEVS];
-
 /*
  * Enables to iterate over all existing md arrays
- * all_mddevs_lock protects this list as well as mddev_map.
+ * all_mddevs_lock protects this list.
  */
 static LIST_HEAD(all_mddevs);
 static spinlock_t all_mddevs_lock = SPIN_LOCK_UNLOCKED;
@@ -155,8 +154,6 @@
 		tmp = tmp->next;})					\
 		)
 
-static mddev_t *mddev_map[MAX_MD_DEVS];
-
 static int md_fail_request (request_queue_t *q, struct bio *bio)
 {
 	bio_io_error(bio, bio->bi_size);
@@ -175,7 +172,6 @@
 		return;
 	if (!mddev->raid_disks && list_empty(&mddev->disks)) {
 		list_del(&mddev->all_mddevs);
-		mddev_map[mdidx(mddev)] = NULL;
 		blk_put_queue(mddev->queue);
 		kfree(mddev);
 	}
@@ -188,15 +184,16 @@
 
  retry:
 	spin_lock(&all_mddevs_lock);
-	if (mddev_map[unit]) {
-		mddev =  mddev_get(mddev_map[unit]);
-		spin_unlock(&all_mddevs_lock);
-		if (new)
-			kfree(new);
-		return mddev;
-	}
+	list_for_each_entry(mddev, &all_mddevs, all_mddevs)
+		if (mdidx(mddev) == unit) {
+			mddev_get(mddev);
+			spin_unlock(&all_mddevs_lock);
+			if (new)
+				kfree(new);
+			return mddev;
+		}
+
 	if (new) {
-		mddev_map[unit] = new;
 		list_add(&new->all_mddevs, &all_mddevs);
 		spin_unlock(&all_mddevs_lock);
 		return new;
@@ -245,6 +242,9 @@
 static inline void mddev_unlock(mddev_t * mddev)
 {
 	up(&mddev->reconfig_sem);
+
+	if (mddev->thread)
+		md_wakeup_thread(mddev->thread);
 }
 
 mdk_rdev_t * find_rdev_nr(mddev_t *mddev, int nr)
@@ -1435,11 +1435,12 @@
 		goto abort;
 	}
 
-	if ((mddev->recovery_cp != MaxSector) && ((mddev->level == 1) ||
-			(mddev->level == 4) || (mddev->level == 5)))
+	if ((mddev->recovery_cp != MaxSector) &&
+	    ((mddev->level == 1) ||
+	     ((mddev->level >= 4) && (mddev->level <= 6))))
 		printk(KERN_ERR "md: md%d: raid array is not clean"
-			" -- starting background reconstruction\n", 
-			mdidx(mddev));
+		       " -- starting background reconstruction\n",
+		       mdidx(mddev));
 
 	return 0;
 abort:
@@ -1458,7 +1459,7 @@
 		return NULL;
 
 	down(&disks_sem);
-	if (disks[unit]) {
+	if (mddev->gendisk) {
 		up(&disks_sem);
 		mddev_put(mddev);
 		return NULL;
@@ -1476,7 +1477,7 @@
 	disk->private_data = mddev;
 	disk->queue = mddev->queue;
 	add_disk(disk);
-	disks[mdidx(mddev)] = disk;
+	mddev->gendisk = disk;
 	up(&disks_sem);
 	return NULL;
 }
@@ -1594,7 +1595,7 @@
 
 	unit = mdidx(mddev);
 	md_probe(0, &unit, NULL);
-	disk = disks[unit];
+	disk = mddev->gendisk;
 	if (!disk)
 		return -ENOMEM;
 
@@ -1624,7 +1625,10 @@
 	mddev->in_sync = 1;
 	
 	set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
-	md_wakeup_thread(mddev->thread);
+	
+	if (mddev->sb_dirty)
+		md_update_sb(mddev);
+
 	set_capacity(disk, mddev->array_size<<1);
 
 	/* If we call blk_queue_make_request here, it will
@@ -1642,7 +1646,7 @@
 
 static int restart_array(mddev_t *mddev)
 {
-	struct gendisk *disk = disks[mdidx(mddev)];
+	struct gendisk *disk = mddev->gendisk;
 	int err;
 
 	/*
@@ -1682,7 +1686,7 @@
 static int do_md_stop(mddev_t * mddev, int ro)
 {
 	int err = 0;
-	struct gendisk *disk = disks[mdidx(mddev)];
+	struct gendisk *disk = mddev->gendisk;
 
 	if (mddev->pers) {
 		if (atomic_read(&mddev->active)>2) {
@@ -1715,7 +1719,7 @@
 			if (mddev->ro)
 				mddev->ro = 0;
 		}
-		if (mddev->raid_disks) {
+		if (!mddev->in_sync) {
 			/* mark array as shutdown cleanly */
 			mddev->in_sync = 1;
 			md_update_sb(mddev);
@@ -1733,7 +1737,7 @@
 		export_array(mddev);
 
 		mddev->array_size = 0;
-		disk = disks[mdidx(mddev)];
+		disk = mddev->gendisk;
 		if (disk)
 			set_capacity(disk, 0);
 	} else
@@ -2288,7 +2292,7 @@
 /*
  * set_array_info is used two different ways
  * The original usage is when creating a new array.
- * In this usage, raid_disks is > = and it together with
+ * In this usage, raid_disks is > 0 and it together with
  *  level, size, not_persistent,layout,chunksize determine the
  *  shape of the array.
  *  This will always create an array with a type-0.90.0 superblock.
@@ -2339,6 +2343,7 @@
 
 	mddev->max_disks     = MD_SB_DISKS;
 
+	mddev->sb_dirty      = 1;
 
 	/*
 	 * Generate a 128 bit UUID
@@ -2354,10 +2359,10 @@
 
 	rdev = find_rdev(mddev, dev);
 	if (!rdev)
-		return 0;
+		return -ENODEV;
 
 	md_error(mddev, rdev);
-	return 1;
+	return 0;
 }
 
 static int md_ioctl(struct inode *inode, struct file *file,
@@ -2405,7 +2410,7 @@
 	 * Commands creating/starting a new array:
 	 */
 
-	mddev = inode->i_bdev->bd_inode->u.generic_ip;
+	mddev = inode->i_bdev->bd_disk->private_data;
 
 	if (!mddev) {
 		BUG();
@@ -2523,7 +2528,7 @@
 			err = put_user (4, (char *) &loc->sectors);
 			if (err)
 				goto abort_unlock;
-			err = put_user(get_capacity(disks[mdidx(mddev)])/8,
+			err = put_user(get_capacity(mddev->gendisk)/8,
 						(short *) &loc->cylinders);
 			if (err)
 				goto abort_unlock;
@@ -2569,19 +2574,8 @@
 			goto done_unlock;
 
 		case RUN_ARRAY:
-		{
 			err = do_md_run (mddev);
-			/*
-			 * we have to clean up the mess if
-			 * the array cannot be run for some
-			 * reason ...
-			 * ->pers will not be set, to superblock will
-			 * not be updated.
-			 */
-			if (err)
-				do_md_stop (mddev, 0);
 			goto done_unlock;
-		}
 
 		default:
 			if (_IOC_TYPE(cmd) == MD_MAJOR)
@@ -2608,29 +2602,26 @@
 static int md_open(struct inode *inode, struct file *file)
 {
 	/*
-	 * Succeed if we can find or allocate a mddev structure.
+	 * Succeed if we can lock the mddev, which confirms that
+	 * it isn't being stopped right now.
 	 */
-	mddev_t *mddev = mddev_find(iminor(inode));
-	int err = -ENOMEM;
-
-	if (!mddev)
-		goto out;
+	mddev_t *mddev = inode->i_bdev->bd_disk->private_data;
+	int err;
 
 	if ((err = mddev_lock(mddev)))
-		goto put;
+		goto out;
 
 	err = 0;
+	mddev_get(mddev);
 	mddev_unlock(mddev);
-	inode->i_bdev->bd_inode->u.generic_ip = mddev_get(mddev);
- put:
-	mddev_put(mddev);
+
  out:
 	return err;
 }
 
 static int md_release(struct inode *inode, struct file * file)
 {
- 	mddev_t *mddev = inode->i_bdev->bd_inode->u.generic_ip;
+ 	mddev_t *mddev = inode->i_bdev->bd_disk->private_data;
 
 	if (!mddev)
 		BUG();
@@ -3014,7 +3005,9 @@
 int register_md_personality(int pnum, mdk_personality_t *p)
 {
 	if (pnum >= MAX_PERSONALITY) {
-		MD_BUG();
+		printk(KERN_ERR
+		       "md: tried to install personality %s as nr %d, but max is %lu\n",
+		       p->name, pnum, MAX_PERSONALITY-1);
 		return -EINVAL;
 	}
 
@@ -3111,6 +3104,11 @@
 
 static inline void md_enter_safemode(mddev_t *mddev)
 {
+	if (!mddev->safemode) return;
+	if (mddev->safemode == 2 &&
+	    (atomic_read(&mddev->writes_pending) || mddev->in_sync ||
+		    mddev->recovery_cp != MaxSector))
+		return; /* avoid the lock */
 	mddev_lock_uninterruptible(mddev);
 	if (mddev->safemode && !atomic_read(&mddev->writes_pending) &&
 	    !mddev->in_sync && mddev->recovery_cp == MaxSector) {
@@ -3131,8 +3129,7 @@
 		mddev->safemode = 2;
 		flush_signals(current);
 	}
-	if (mddev->safemode)
-		md_enter_safemode(mddev);
+	md_enter_safemode(mddev);
 }
 
 
@@ -3320,8 +3317,7 @@
 			mddev->recovery_cp = MaxSector;
 	}
 
-	if (mddev->safemode)
-		md_enter_safemode(mddev);
+	md_enter_safemode(mddev);
  skip:
 	mddev->curr_resync = 0;
 	set_bit(MD_RECOVERY_DONE, &mddev->recovery);
@@ -3372,25 +3368,30 @@
 		if (mddev->sb_dirty)
 			md_update_sb(mddev);
 		if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) &&
-		    !test_bit(MD_RECOVERY_DONE, &mddev->recovery))
+		    !test_bit(MD_RECOVERY_DONE, &mddev->recovery)) {
 			/* resync/recovery still happening */
+			clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
 			goto unlock;
+		}
 		if (mddev->sync_thread) {
 			/* resync has finished, collect result */
 			md_unregister_thread(mddev->sync_thread);
 			mddev->sync_thread = NULL;
-			if (!test_bit(MD_RECOVERY_ERR, &mddev->recovery)) {
+			if (!test_bit(MD_RECOVERY_ERR, &mddev->recovery) &&
+			    !test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
 				/* success...*/
 				/* activate any spares */
 				mddev->pers->spare_active(mddev);
 			}
 			md_update_sb(mddev);
 			mddev->recovery = 0;
+			/* flag recovery needed just to double check */
+			set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
 			wake_up(&resync_wait);
 			goto unlock;
 		}
 		if (mddev->recovery) {
-			/* that's odd.. */
+			/* probably just the RECOVERY_NEEDED flag */
 			mddev->recovery = 0;
 			wake_up(&resync_wait);
 		}
@@ -3482,11 +3483,9 @@
 
 	dprintk("md: sizeof(mdp_super_t) = %d\n", (int)sizeof(mdp_super_t));
 
-#ifdef CONFIG_PROC_FS
 	p = create_proc_entry("mdstat", S_IRUGO, NULL);
 	if (p)
 		p->proc_fops = &md_seq_fops;
-#endif
 }
 
 int __init md_init(void)
@@ -3567,6 +3566,8 @@
 
 static __exit void md_exit(void)
 {
+	mddev_t *mddev;
+	struct list_head *tmp;
 	int i;
 	blk_unregister_region(MKDEV(MAJOR_NR,0), MAX_MD_DEVS);
 	for (i=0; i < MAX_MD_DEVS; i++)
@@ -3576,18 +3577,15 @@
 	unregister_blkdev(MAJOR_NR,"md");
 	unregister_reboot_notifier(&md_notifier);
 	unregister_sysctl_table(raid_table_header);
-#ifdef CONFIG_PROC_FS
 	remove_proc_entry("mdstat", NULL);
-#endif
-	for (i = 0; i < MAX_MD_DEVS; i++) {
-		struct gendisk *disk = disks[i];
-		mddev_t *mddev;
-		if (!disks[i])
+	ITERATE_MDDEV(mddev,tmp) {
+		struct gendisk *disk = mddev->gendisk;
+		if (!disk)
 			continue;
-		mddev = disk->private_data;
 		export_array(mddev);
 		del_gendisk(disk);
 		put_disk(disk);
+		mddev->gendisk = NULL;
 		mddev_put(mddev);
 	}
 }
diff -Nru a/drivers/md/mktables.c b/drivers/md/mktables.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/md/mktables.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,125 @@
+#ident "$Id: mktables.c,v 1.2 2002/12/12 22:41:27 hpa Exp $"
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2002 H. Peter Anvin - All Rights Reserved
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ *   Bostom MA 02111-1307, USA; either version 2 of the License, or
+ *   (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * mktables.c
+ *
+ * Make RAID-6 tables.  This is a host user space program to be run at
+ * compile time.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <time.h>
+
+static uint8_t gfmul(uint8_t a, uint8_t b)
+{
+  uint8_t v = 0;
+
+  while ( b ) {
+    if ( b & 1 ) v ^= a;
+    a = (a << 1) ^ (a & 0x80 ? 0x1d : 0);
+    b >>= 1;
+  }
+  return v;
+}
+
+static uint8_t gfpow(uint8_t a, int b)
+{
+  uint8_t v = 1;
+
+  b %= 255;
+  if ( b < 0 )
+    b += 255;
+
+  while ( b ) {
+    if ( b & 1 ) v = gfmul(v,a);
+    a = gfmul(a,a);
+    b >>= 1;
+  }
+  return v;
+}
+
+int main(int argc, char *argv[])
+{
+  int i, j, k;
+  uint8_t v;
+  uint8_t exptbl[256], invtbl[256];
+
+  printf("#include \"raid6.h\"\n");
+
+  /* Compute multiplication table */
+  printf("\nconst u8  __attribute__((aligned(256)))\n"
+	 "raid6_gfmul[256][256] =\n"
+	 "{\n");
+  for ( i = 0 ; i < 256 ; i++ ) {
+    printf("\t{\n");
+    for ( j = 0 ; j < 256 ; j += 8 ) {
+      printf("\t\t");
+      for ( k = 0 ; k < 8 ; k++ ) {
+	printf("0x%02x, ", gfmul(i,j+k));
+      }
+      printf("\n");
+    }
+    printf("\t},\n");
+  }
+  printf("};\n");
+
+  /* Compute power-of-2 table (exponent) */
+  v = 1;
+  printf("\nconst u8 __attribute__((aligned(256)))\n"
+	 "raid6_gfexp[256] =\n"
+	 "{\n");
+  for ( i = 0 ; i < 256 ; i += 8 ) {
+    printf("\t");
+    for ( j = 0 ; j < 8 ; j++ ) {
+      exptbl[i+j] = v;
+      printf("0x%02x, ", v);
+      v = gfmul(v,2);
+      if ( v == 1 ) v = 0;	/* For entry 255, not a real entry */
+    }
+    printf("\n");
+  }
+  printf("};\n");
+
+  /* Compute inverse table x^-1 == x^254 */
+  printf("\nconst u8 __attribute__((aligned(256)))\n"
+	 "raid6_gfinv[256] =\n"
+	 "{\n");
+  for ( i = 0 ; i < 256 ; i += 8 ) {
+    printf("\t");
+    for ( j = 0 ; j < 8 ; j++ ) {
+      invtbl[i+j] = v = gfpow(i+j,254);
+      printf("0x%02x, ", v);
+    }
+    printf("\n");
+  }
+  printf("};\n");
+
+  /* Compute inv(2^x + 1) (exponent-xor-inverse) table */
+  printf("\nconst u8 __attribute__((aligned(256)))\n"
+	 "raid6_gfexi[256] =\n"
+	 "{\n");
+  for ( i = 0 ; i < 256 ; i += 8 ) {
+    printf("\t");
+    for ( j = 0 ; j < 8 ; j++ ) {
+      printf("0x%02x, ", invtbl[exptbl[i+j]^1]);
+    }
+    printf("\n");
+  }
+  printf("};\n\n");
+
+  return 0;
+}
diff -Nru a/drivers/md/raid5.c b/drivers/md/raid5.c
--- a/drivers/md/raid5.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/md/raid5.c	Tue Feb  3 19:45:17 2004
@@ -1395,7 +1395,14 @@
 
 	first_sector = raid5_compute_sector(stripe*data_disks*sectors_per_chunk
 		+ chunk_offset, raid_disks, data_disks, &dd_idx, &pd_idx, conf);
-	sh = get_active_stripe(conf, sector_nr, pd_idx, 0);
+	sh = get_active_stripe(conf, sector_nr, pd_idx, 1);
+	if (sh == NULL) {
+		sh = get_active_stripe(conf, sector_nr, pd_idx, 0);
+		/* make sure we don't swamp the stripe cache if someone else
+		 * is trying to get access 
+		 */
+		yield();
+	}
 	spin_lock(&sh->lock);	
 	set_bit(STRIPE_SYNCING, &sh->state);
 	clear_bit(STRIPE_INSYNC, &sh->state);
diff -Nru a/drivers/md/raid6.h b/drivers/md/raid6.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/md/raid6.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,135 @@
+/* -*- linux-c -*- ------------------------------------------------------- *
+ *
+ *   Copyright 2003 H. Peter Anvin - All Rights Reserved
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ *   Bostom MA 02111-1307, USA; either version 2 of the License, or
+ *   (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef LINUX_RAID_RAID6_H
+#define LINUX_RAID_RAID6_H
+
+#ifdef __KERNEL__
+
+/* Set to 1 to use kernel-wide empty_zero_page */
+#define RAID6_USE_EMPTY_ZERO_PAGE 0
+
+#include <linux/module.h>
+#include <linux/stddef.h>
+#include <linux/compiler.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/mempool.h>
+#include <linux/list.h>
+#include <linux/vmalloc.h>
+#include <linux/raid/md.h>
+#include <linux/raid/raid5.h>
+
+typedef raid5_conf_t raid6_conf_t; /* Same configuration */
+
+/* Additional compute_parity mode -- updates the parity w/o LOCKING */
+#define UPDATE_PARITY	4
+
+/* We need a pre-zeroed page... if we don't want to use the kernel-provided
+   one define it here */
+#if RAID6_USE_EMPTY_ZERO_PAGE
+# define raid6_empty_zero_page empty_zero_page
+#else
+extern const char raid6_empty_zero_page[PAGE_SIZE];
+#endif
+
+#else /* ! __KERNEL__ */
+/* Used for testing in user space */
+
+#include <errno.h>
+#include <inttypes.h>
+#include <limits.h>
+#include <stddef.h>
+#include <sys/mman.h>
+#include <sys/types.h>
+
+/* Not standard, but glibc defines it */
+#define BITS_PER_LONG __WORDSIZE
+
+typedef uint8_t  u8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef uint64_t u64;
+
+#ifndef PAGE_SIZE
+# define PAGE_SIZE 4096
+#endif
+extern const char raid6_empty_zero_page[PAGE_SIZE];
+
+#define __init
+#define __exit
+#define __attribute_const__ __attribute__((const))
+
+#define preempt_enable()
+#define preempt_disable()
+
+#endif /* __KERNEL__ */
+
+/* Routine choices */
+struct raid6_calls {
+	void (*gen_syndrome)(int, size_t, void **);
+	int  (*valid)(void);	/* Returns 1 if this routine set is usable */
+	const char *name;	/* Name of this routine set */
+	int prefer;		/* Has special performance attribute */
+};
+
+/* Selected algorithm */
+extern struct raid6_calls raid6_call;
+
+/* Algorithm list */
+extern const struct raid6_calls * const raid6_algos[];
+int raid6_select_algo(void);
+
+/* Return values from chk_syndrome */
+#define RAID6_OK	0
+#define RAID6_P_BAD	1
+#define RAID6_Q_BAD	2
+#define RAID6_PQ_BAD	3
+
+/* Galois field tables */
+extern const u8 raid6_gfmul[256][256] __attribute__((aligned(256)));
+extern const u8 raid6_gfexp[256]      __attribute__((aligned(256)));
+extern const u8 raid6_gfinv[256]      __attribute__((aligned(256)));
+extern const u8 raid6_gfexi[256]      __attribute__((aligned(256)));
+
+/* Recovery routines */
+void raid6_2data_recov(int disks, size_t bytes, int faila, int failb, void **ptrs);
+void raid6_datap_recov(int disks, size_t bytes, int faila, void **ptrs);
+void raid6_dual_recov(int disks, size_t bytes, int faila, int failb, void **ptrs);
+
+/* Some definitions to allow code to be compiled for testing in userspace */
+#ifndef __KERNEL__
+
+# define jiffies	raid6_jiffies()
+# define printk 	printf
+# define GFP_KERNEL	0
+# define __get_free_pages(x,y)	((unsigned long)mmap(NULL, PAGE_SIZE << (y), PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0))
+# define free_pages(x,y)	munmap((void *)(x), (y)*PAGE_SIZE)
+
+static inline void cpu_relax(void)
+{
+	/* Nothing */
+}
+
+#undef  HZ
+#define HZ 1000
+static inline uint32_t raid6_jiffies(void)
+{
+	struct timeval tv;
+	gettimeofday(&tv, NULL);
+	return tv.tv_sec*1000 + tv.tv_usec/1000;
+}
+
+#endif /* ! __KERNEL__ */
+
+#endif /* LINUX_RAID_RAID6_H */
diff -Nru a/drivers/md/raid6algos.c b/drivers/md/raid6algos.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/md/raid6algos.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,143 @@
+/* -*- linux-c -*- ------------------------------------------------------- *
+ *
+ *   Copyright 2002 H. Peter Anvin - All Rights Reserved
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ *   Bostom MA 02111-1307, USA; either version 2 of the License, or
+ *   (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * raid6algos.c
+ *
+ * Algorithm list and algorithm selection for RAID-6
+ */
+
+#include "raid6.h"
+#ifndef __KERNEL__
+#include <sys/mman.h>
+#endif
+
+struct raid6_calls raid6_call;
+
+/* Various routine sets */
+extern const struct raid6_calls raid6_intx1;
+extern const struct raid6_calls raid6_intx2;
+extern const struct raid6_calls raid6_intx4;
+extern const struct raid6_calls raid6_intx8;
+extern const struct raid6_calls raid6_intx16;
+extern const struct raid6_calls raid6_intx32;
+extern const struct raid6_calls raid6_mmxx1;
+extern const struct raid6_calls raid6_mmxx2;
+extern const struct raid6_calls raid6_sse1x1;
+extern const struct raid6_calls raid6_sse1x2;
+extern const struct raid6_calls raid6_sse2x1;
+extern const struct raid6_calls raid6_sse2x2;
+extern const struct raid6_calls raid6_sse2x4;
+
+const struct raid6_calls * const raid6_algos[] = {
+	&raid6_intx1,
+	&raid6_intx2,
+	&raid6_intx4,
+	&raid6_intx8,
+#if defined(__ia64__)
+	&raid6_intx16,
+	&raid6_intx32,
+#endif
+#if defined(__i386__)
+	&raid6_mmxx1,
+	&raid6_mmxx2,
+	&raid6_sse1x1,
+	&raid6_sse1x2,
+	&raid6_sse2x1,
+	&raid6_sse2x2,
+#endif
+#if defined(__x86_64__)
+	&raid6_sse2x1,
+	&raid6_sse2x2,
+	&raid6_sse2x4,
+#endif
+	NULL
+};
+
+#ifdef __KERNEL__
+#define RAID6_TIME_JIFFIES_LG2	4
+#else
+/* Need more time to be stable in userspace */
+#define RAID6_TIME_JIFFIES_LG2	9
+#endif
+
+/* Try to pick the best algorithm */
+/* This code uses the gfmul table as convenient data set to abuse */
+
+int __init raid6_select_algo(void)
+{
+	const struct raid6_calls * const * algo;
+	const struct raid6_calls * best;
+	char *syndromes;
+	void *dptrs[(65536/PAGE_SIZE)+2];
+	int i, disks;
+	unsigned long perf, bestperf;
+	int bestprefer;
+	unsigned long j0, j1;
+
+	disks = (65536/PAGE_SIZE)+2;
+	for ( i = 0 ; i < disks-2 ; i++ ) {
+		dptrs[i] = ((char *)raid6_gfmul) + PAGE_SIZE*i;
+	}
+
+	/* Normal code - use a 2-page allocation to avoid D$ conflict */
+	syndromes = (void *) __get_free_pages(GFP_KERNEL, 1);
+
+	if ( !syndromes ) {
+		printk("raid6: Yikes!  No memory available.\n");
+		return -ENOMEM;
+	}
+
+	dptrs[disks-2] = syndromes;
+	dptrs[disks-1] = syndromes + PAGE_SIZE;
+
+	bestperf = 0;  bestprefer = 0;  best = NULL;
+
+	for ( algo = raid6_algos ; *algo ; algo++ ) {
+		if ( !(*algo)->valid || (*algo)->valid() ) {
+			perf = 0;
+
+			preempt_disable();
+			j0 = jiffies;
+			while ( (j1 = jiffies) == j0 )
+				cpu_relax();
+			while ( (jiffies-j1) < (1 << RAID6_TIME_JIFFIES_LG2) ) {
+				(*algo)->gen_syndrome(disks, PAGE_SIZE, dptrs);
+				perf++;
+			}
+			preempt_enable();
+
+			if ( (*algo)->prefer > bestprefer ||
+			     ((*algo)->prefer == bestprefer &&
+			      perf > bestperf) ) {
+				best = *algo;
+				bestprefer = best->prefer;
+				bestperf = perf;
+			}
+			printk("raid6: %-8s %5ld MB/s\n", (*algo)->name,
+			       (perf*HZ) >> (20-16+RAID6_TIME_JIFFIES_LG2));
+		}
+	}
+
+	if ( best )
+		printk("raid6: using algorithm %s (%ld MB/s)\n",
+		       best->name,
+		       (bestperf*HZ) >> (20-16+RAID6_TIME_JIFFIES_LG2));
+	else
+		printk("raid6: Yikes!  No algorithm found!\n");
+
+	raid6_call = *best;
+
+	free_pages((unsigned long)syndromes, 1);
+
+	return best ? 0 : -EINVAL;
+}
diff -Nru a/drivers/md/raid6int.uc b/drivers/md/raid6int.uc
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/md/raid6int.uc	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,117 @@
+/* -*- linux-c -*- ------------------------------------------------------- *
+ *
+ *   Copyright 2002-2004 H. Peter Anvin - All Rights Reserved
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ *   Bostom MA 02111-1307, USA; either version 2 of the License, or
+ *   (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * raid6int$#.c
+ *
+ * $#-way unrolled portable integer math RAID-6 instruction set
+ *
+ * This file is postprocessed using unroll.pl
+ */
+
+#include "raid6.h"
+
+/*
+ * This is the C data type to use
+ */
+
+/* Change this from BITS_PER_LONG if there is something better... */
+#if BITS_PER_LONG == 64
+# define NBYTES(x) ((x) * 0x0101010101010101UL)
+# define NSIZE  8
+# define NSHIFT 3
+# define NSTRING "64"
+typedef u64 unative_t;
+#else
+# define NBYTES(x) ((x) * 0x01010101U)
+# define NSIZE  4
+# define NSHIFT 2
+# define NSTRING "32"
+typedef u32 unative_t;
+#endif
+
+
+
+/*
+ * IA-64 wants insane amounts of unrolling.  On other architectures that
+ * is just a waste of space.
+ */
+#if ($# <= 8) || defined(__ia64__)
+
+
+/*
+ * These sub-operations are separate inlines since they can sometimes be
+ * specially optimized using architecture-specific hacks.
+ */
+
+/*
+ * The SHLBYTE() operation shifts each byte left by 1, *not*
+ * rolling over into the next byte
+ */
+static inline __attribute_const__ unative_t SHLBYTE(unative_t v)
+{
+	unative_t vv;
+
+	vv = (v << 1) & NBYTES(0xfe);
+	return vv;
+}
+
+/*
+ * The MASK() operation returns 0xFF in any byte for which the high
+ * bit is 1, 0x00 for any byte for which the high bit is 0.
+ */
+static inline __attribute_const__ unative_t MASK(unative_t v)
+{
+	unative_t vv;
+
+	vv = v & NBYTES(0x80);
+	vv = (vv << 1) - (vv >> 7); /* Overflow on the top bit is OK */
+	return vv;
+}
+
+
+static void raid6_int$#_gen_syndrome(int disks, size_t bytes, void **ptrs)
+{
+	u8 **dptr = (u8 **)ptrs;
+	u8 *p, *q;
+	int d, z, z0;
+
+	unative_t wd$$, wq$$, wp$$, w1$$, w2$$;
+
+	z0 = disks - 3;		/* Highest data disk */
+	p = dptr[z0+1];		/* XOR parity */
+	q = dptr[z0+2];		/* RS syndrome */
+
+	for ( d = 0 ; d < bytes ; d += NSIZE*$# ) {
+		wq$$ = wp$$ = *(unative_t *)&dptr[z0][d+$$*NSIZE];
+		for ( z = z0-1 ; z >= 0 ; z-- ) {
+			wd$$ = *(unative_t *)&dptr[z][d+$$*NSIZE];
+			wp$$ ^= wd$$;
+			w2$$ = MASK(wq$$);
+			w1$$ = SHLBYTE(wq$$);
+			w2$$ &= NBYTES(0x1d);
+			w1$$ ^= w2$$;
+			wq$$ = w1$$ ^ wd$$;
+		}
+		*(unative_t *)&p[d+NSIZE*$$] = wp$$;
+		*(unative_t *)&q[d+NSIZE*$$] = wq$$;
+	}
+}
+
+const struct raid6_calls raid6_intx$# = {
+	raid6_int$#_gen_syndrome,
+	NULL,		/* always valid */
+	"int" NSTRING "x$#",
+	0
+};
+
+#endif
diff -Nru a/drivers/md/raid6main.c b/drivers/md/raid6main.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/md/raid6main.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,1990 @@
+/*
+ * raid6main.c : Multiple Devices driver for Linux
+ *	   Copyright (C) 1996, 1997 Ingo Molnar, Miguel de Icaza, Gadi Oxman
+ *	   Copyright (C) 1999, 2000 Ingo Molnar
+ *	   Copyright (C) 2002, 2003 H. Peter Anvin
+ *
+ * RAID-6 management functions.  This code is derived from raid5.c.
+ * Last merge from raid5.c bkcvs version 1.79 (kernel 2.6.1).
+ *
+ * Thanks to Penguin Computing for making the RAID-6 development possible
+ * by donating a test server!
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * You should have received a copy of the GNU General Public License
+ * (for example /usr/src/linux/COPYING); if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/highmem.h>
+#include <asm/bitops.h>
+#include <asm/atomic.h>
+#include "raid6.h"
+
+/*
+ * Stripe cache
+ */
+
+#define NR_STRIPES		256
+#define STRIPE_SIZE		PAGE_SIZE
+#define STRIPE_SHIFT		(PAGE_SHIFT - 9)
+#define STRIPE_SECTORS		(STRIPE_SIZE>>9)
+#define	IO_THRESHOLD		1
+#define HASH_PAGES		1
+#define HASH_PAGES_ORDER	0
+#define NR_HASH			(HASH_PAGES * PAGE_SIZE / sizeof(struct stripe_head *))
+#define HASH_MASK		(NR_HASH - 1)
+
+#define stripe_hash(conf, sect)	((conf)->stripe_hashtbl[((sect) >> STRIPE_SHIFT) & HASH_MASK])
+
+/* bio's attached to a stripe+device for I/O are linked together in bi_sector
+ * order without overlap.  There may be several bio's per stripe+device, and
+ * a bio could span several devices.
+ * When walking this list for a particular stripe+device, we must never proceed
+ * beyond a bio that extends past this device, as the next bio might no longer
+ * be valid.
+ * This macro is used to determine the 'next' bio in the list, given the sector
+ * of the current stripe+device
+ */
+#define r5_next_bio(bio, sect) ( ( bio->bi_sector + (bio->bi_size>>9) < sect + STRIPE_SECTORS) ? bio->bi_next : NULL)
+/*
+ * The following can be used to debug the driver
+ */
+#define RAID6_DEBUG	0	/* Extremely verbose printk */
+#define RAID6_PARANOIA	1	/* Check spinlocks */
+#define RAID6_DUMPSTATE 0	/* Include stripe cache state in /proc/mdstat */
+#if RAID6_PARANOIA && CONFIG_SMP
+# define CHECK_DEVLOCK() if (!spin_is_locked(&conf->device_lock)) BUG()
+#else
+# define CHECK_DEVLOCK()
+#endif
+
+#define PRINTK(x...) ((void)(RAID6_DEBUG && printk(KERN_DEBUG x)))
+#if RAID6_DEBUG
+#undef inline
+#undef __inline__
+#define inline
+#define __inline__
+#endif
+
+#if !RAID6_USE_EMPTY_ZERO_PAGE
+/* In .bss so it's zeroed */
+const char raid6_empty_zero_page[PAGE_SIZE] __attribute__((aligned(256)));
+#endif
+
+static inline int raid6_next_disk(int disk, int raid_disks)
+{
+	disk++;
+	return (disk < raid_disks) ? disk : 0;
+}
+
+static void print_raid6_conf (raid6_conf_t *conf);
+
+static inline void __release_stripe(raid6_conf_t *conf, struct stripe_head *sh)
+{
+	if (atomic_dec_and_test(&sh->count)) {
+		if (!list_empty(&sh->lru))
+			BUG();
+		if (atomic_read(&conf->active_stripes)==0)
+			BUG();
+		if (test_bit(STRIPE_HANDLE, &sh->state)) {
+			if (test_bit(STRIPE_DELAYED, &sh->state))
+				list_add_tail(&sh->lru, &conf->delayed_list);
+			else
+				list_add_tail(&sh->lru, &conf->handle_list);
+			md_wakeup_thread(conf->mddev->thread);
+		} else {
+			if (test_and_clear_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) {
+				atomic_dec(&conf->preread_active_stripes);
+				if (atomic_read(&conf->preread_active_stripes) < IO_THRESHOLD)
+					md_wakeup_thread(conf->mddev->thread);
+			}
+			list_add_tail(&sh->lru, &conf->inactive_list);
+			atomic_dec(&conf->active_stripes);
+			if (!conf->inactive_blocked ||
+			    atomic_read(&conf->active_stripes) < (NR_STRIPES*3/4))
+				wake_up(&conf->wait_for_stripe);
+		}
+	}
+}
+static void release_stripe(struct stripe_head *sh)
+{
+	raid6_conf_t *conf = sh->raid_conf;
+	unsigned long flags;
+
+	spin_lock_irqsave(&conf->device_lock, flags);
+	__release_stripe(conf, sh);
+	spin_unlock_irqrestore(&conf->device_lock, flags);
+}
+
+static void remove_hash(struct stripe_head *sh)
+{
+	PRINTK("remove_hash(), stripe %llu\n", (unsigned long long)sh->sector);
+
+	if (sh->hash_pprev) {
+		if (sh->hash_next)
+			sh->hash_next->hash_pprev = sh->hash_pprev;
+		*sh->hash_pprev = sh->hash_next;
+		sh->hash_pprev = NULL;
+	}
+}
+
+static __inline__ void insert_hash(raid6_conf_t *conf, struct stripe_head *sh)
+{
+	struct stripe_head **shp = &stripe_hash(conf, sh->sector);
+
+	PRINTK("insert_hash(), stripe %llu\n", (unsigned long long)sh->sector);
+
+	CHECK_DEVLOCK();
+	if ((sh->hash_next = *shp) != NULL)
+		(*shp)->hash_pprev = &sh->hash_next;
+	*shp = sh;
+	sh->hash_pprev = shp;
+}
+
+
+/* find an idle stripe, make sure it is unhashed, and return it. */
+static struct stripe_head *get_free_stripe(raid6_conf_t *conf)
+{
+	struct stripe_head *sh = NULL;
+	struct list_head *first;
+
+	CHECK_DEVLOCK();
+	if (list_empty(&conf->inactive_list))
+		goto out;
+	first = conf->inactive_list.next;
+	sh = list_entry(first, struct stripe_head, lru);
+	list_del_init(first);
+	remove_hash(sh);
+	atomic_inc(&conf->active_stripes);
+out:
+	return sh;
+}
+
+static void shrink_buffers(struct stripe_head *sh, int num)
+{
+	struct page *p;
+	int i;
+
+	for (i=0; i<num ; i++) {
+		p = sh->dev[i].page;
+		if (!p)
+			continue;
+		sh->dev[i].page = NULL;
+		page_cache_release(p);
+	}
+}
+
+static int grow_buffers(struct stripe_head *sh, int num)
+{
+	int i;
+
+	for (i=0; i<num; i++) {
+		struct page *page;
+
+		if (!(page = alloc_page(GFP_KERNEL))) {
+			return 1;
+		}
+		sh->dev[i].page = page;
+	}
+	return 0;
+}
+
+static void raid6_build_block (struct stripe_head *sh, int i);
+
+static inline void init_stripe(struct stripe_head *sh, unsigned long sector, int pd_idx)
+{
+	raid6_conf_t *conf = sh->raid_conf;
+	int disks = conf->raid_disks, i;
+
+	if (atomic_read(&sh->count) != 0)
+		BUG();
+	if (test_bit(STRIPE_HANDLE, &sh->state))
+		BUG();
+
+	CHECK_DEVLOCK();
+	PRINTK("init_stripe called, stripe %llu\n",
+		(unsigned long long)sh->sector);
+
+	remove_hash(sh);
+
+	sh->sector = sector;
+	sh->pd_idx = pd_idx;
+	sh->state = 0;
+
+	for (i=disks; i--; ) {
+		struct r5dev *dev = &sh->dev[i];
+
+		if (dev->toread || dev->towrite || dev->written ||
+		    test_bit(R5_LOCKED, &dev->flags)) {
+			PRINTK("sector=%llx i=%d %p %p %p %d\n",
+			       (unsigned long long)sh->sector, i, dev->toread,
+			       dev->towrite, dev->written,
+			       test_bit(R5_LOCKED, &dev->flags));
+			BUG();
+		}
+		dev->flags = 0;
+		raid6_build_block(sh, i);
+	}
+	insert_hash(conf, sh);
+}
+
+static struct stripe_head *__find_stripe(raid6_conf_t *conf, unsigned long sector)
+{
+	struct stripe_head *sh;
+
+	CHECK_DEVLOCK();
+	PRINTK("__find_stripe, sector %lu\n", sector);
+	for (sh = stripe_hash(conf, sector); sh; sh = sh->hash_next)
+		if (sh->sector == sector)
+			return sh;
+	PRINTK("__stripe %lu not in cache\n", sector);
+	return NULL;
+}
+
+static struct stripe_head *get_active_stripe(raid6_conf_t *conf, unsigned long sector,
+					     int pd_idx, int noblock)
+{
+	struct stripe_head *sh;
+
+	PRINTK("get_stripe, sector %lu\n", sector);
+
+	spin_lock_irq(&conf->device_lock);
+
+	do {
+		sh = __find_stripe(conf, sector);
+		if (!sh) {
+			if (!conf->inactive_blocked)
+				sh = get_free_stripe(conf);
+			if (noblock && sh == NULL)
+				break;
+			if (!sh) {
+				conf->inactive_blocked = 1;
+				wait_event_lock_irq(conf->wait_for_stripe,
+						    !list_empty(&conf->inactive_list) &&
+						    (atomic_read(&conf->active_stripes) < (NR_STRIPES *3/4)
+						     || !conf->inactive_blocked),
+						    conf->device_lock);
+				conf->inactive_blocked = 0;
+			} else
+				init_stripe(sh, sector, pd_idx);
+		} else {
+			if (atomic_read(&sh->count)) {
+				if (!list_empty(&sh->lru))
+					BUG();
+			} else {
+				if (!test_bit(STRIPE_HANDLE, &sh->state))
+					atomic_inc(&conf->active_stripes);
+				if (list_empty(&sh->lru))
+					BUG();
+				list_del_init(&sh->lru);
+			}
+		}
+	} while (sh == NULL);
+
+	if (sh)
+		atomic_inc(&sh->count);
+
+	spin_unlock_irq(&conf->device_lock);
+	return sh;
+}
+
+static int grow_stripes(raid6_conf_t *conf, int num)
+{
+	struct stripe_head *sh;
+	kmem_cache_t *sc;
+	int devs = conf->raid_disks;
+
+	sprintf(conf->cache_name, "md/raid6-%d", conf->mddev->__minor);
+
+	sc = kmem_cache_create(conf->cache_name,
+			       sizeof(struct stripe_head)+(devs-1)*sizeof(struct r5dev),
+			       0, 0, NULL, NULL);
+	if (!sc)
+		return 1;
+	conf->slab_cache = sc;
+	while (num--) {
+		sh = kmem_cache_alloc(sc, GFP_KERNEL);
+		if (!sh)
+			return 1;
+		memset(sh, 0, sizeof(*sh) + (devs-1)*sizeof(struct r5dev));
+		sh->raid_conf = conf;
+		sh->lock = SPIN_LOCK_UNLOCKED;
+
+		if (grow_buffers(sh, conf->raid_disks)) {
+			shrink_buffers(sh, conf->raid_disks);
+			kmem_cache_free(sc, sh);
+			return 1;
+		}
+		/* we just created an active stripe so... */
+		atomic_set(&sh->count, 1);
+		atomic_inc(&conf->active_stripes);
+		INIT_LIST_HEAD(&sh->lru);
+		release_stripe(sh);
+	}
+	return 0;
+}
+
+static void shrink_stripes(raid6_conf_t *conf)
+{
+	struct stripe_head *sh;
+
+	while (1) {
+		spin_lock_irq(&conf->device_lock);
+		sh = get_free_stripe(conf);
+		spin_unlock_irq(&conf->device_lock);
+		if (!sh)
+			break;
+		if (atomic_read(&sh->count))
+			BUG();
+		shrink_buffers(sh, conf->raid_disks);
+		kmem_cache_free(conf->slab_cache, sh);
+		atomic_dec(&conf->active_stripes);
+	}
+	kmem_cache_destroy(conf->slab_cache);
+	conf->slab_cache = NULL;
+}
+
+static int raid6_end_read_request (struct bio * bi, unsigned int bytes_done,
+				   int error)
+{
+ 	struct stripe_head *sh = bi->bi_private;
+	raid6_conf_t *conf = sh->raid_conf;
+	int disks = conf->raid_disks, i;
+	int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags);
+
+	if (bi->bi_size)
+		return 1;
+
+	for (i=0 ; i<disks; i++)
+		if (bi == &sh->dev[i].req)
+			break;
+
+	PRINTK("end_read_request %llu/%d, count: %d, uptodate %d.\n",
+		(unsigned long long)sh->sector, i, atomic_read(&sh->count),
+		uptodate);
+	if (i == disks) {
+		BUG();
+		return 0;
+	}
+
+	if (uptodate) {
+#if 0
+		struct bio *bio;
+		unsigned long flags;
+		spin_lock_irqsave(&conf->device_lock, flags);
+		/* we can return a buffer if we bypassed the cache or
+		 * if the top buffer is not in highmem.  If there are
+		 * multiple buffers, leave the extra work to
+		 * handle_stripe
+		 */
+		buffer = sh->bh_read[i];
+		if (buffer &&
+		    (!PageHighMem(buffer->b_page)
+		     || buffer->b_page == bh->b_page )
+			) {
+			sh->bh_read[i] = buffer->b_reqnext;
+			buffer->b_reqnext = NULL;
+		} else
+			buffer = NULL;
+		spin_unlock_irqrestore(&conf->device_lock, flags);
+		if (sh->bh_page[i]==bh->b_page)
+			set_buffer_uptodate(bh);
+		if (buffer) {
+			if (buffer->b_page != bh->b_page)
+				memcpy(buffer->b_data, bh->b_data, bh->b_size);
+			buffer->b_end_io(buffer, 1);
+		}
+#else
+		set_bit(R5_UPTODATE, &sh->dev[i].flags);
+#endif
+	} else {
+		md_error(conf->mddev, conf->disks[i].rdev);
+		clear_bit(R5_UPTODATE, &sh->dev[i].flags);
+	}
+	atomic_dec(&conf->disks[i].rdev->nr_pending);
+#if 0
+	/* must restore b_page before unlocking buffer... */
+	if (sh->bh_page[i] != bh->b_page) {
+		bh->b_page = sh->bh_page[i];
+		bh->b_data = page_address(bh->b_page);
+		clear_buffer_uptodate(bh);
+	}
+#endif
+	clear_bit(R5_LOCKED, &sh->dev[i].flags);
+	set_bit(STRIPE_HANDLE, &sh->state);
+	release_stripe(sh);
+	return 0;
+}
+
+static int raid6_end_write_request (struct bio *bi, unsigned int bytes_done,
+				    int error)
+{
+ 	struct stripe_head *sh = bi->bi_private;
+	raid6_conf_t *conf = sh->raid_conf;
+	int disks = conf->raid_disks, i;
+	unsigned long flags;
+	int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags);
+
+	if (bi->bi_size)
+		return 1;
+
+	for (i=0 ; i<disks; i++)
+		if (bi == &sh->dev[i].req)
+			break;
+
+	PRINTK("end_write_request %llu/%d, count %d, uptodate: %d.\n",
+		(unsigned long long)sh->sector, i, atomic_read(&sh->count),
+		uptodate);
+	if (i == disks) {
+		BUG();
+		return 0;
+	}
+
+	spin_lock_irqsave(&conf->device_lock, flags);
+	if (!uptodate)
+		md_error(conf->mddev, conf->disks[i].rdev);
+
+	atomic_dec(&conf->disks[i].rdev->nr_pending);
+
+	clear_bit(R5_LOCKED, &sh->dev[i].flags);
+	set_bit(STRIPE_HANDLE, &sh->state);
+	__release_stripe(conf, sh);
+	spin_unlock_irqrestore(&conf->device_lock, flags);
+	return 0;
+}
+
+
+static sector_t compute_blocknr(struct stripe_head *sh, int i);
+
+static void raid6_build_block (struct stripe_head *sh, int i)
+{
+	struct r5dev *dev = &sh->dev[i];
+	int pd_idx = sh->pd_idx;
+	int qd_idx = raid6_next_disk(pd_idx, sh->raid_conf->raid_disks);
+
+	bio_init(&dev->req);
+	dev->req.bi_io_vec = &dev->vec;
+	dev->req.bi_vcnt++;
+	dev->vec.bv_page = dev->page;
+	dev->vec.bv_len = STRIPE_SIZE;
+	dev->vec.bv_offset = 0;
+
+	dev->req.bi_sector = sh->sector;
+	dev->req.bi_private = sh;
+
+	dev->flags = 0;
+	if (i != pd_idx && i != qd_idx)
+		dev->sector = compute_blocknr(sh, i);
+}
+
+static void error(mddev_t *mddev, mdk_rdev_t *rdev)
+{
+	char b[BDEVNAME_SIZE];
+	raid6_conf_t *conf = (raid6_conf_t *) mddev->private;
+	PRINTK("raid6: error called\n");
+
+	if (!rdev->faulty) {
+		mddev->sb_dirty = 1;
+		conf->working_disks--;
+		if (rdev->in_sync) {
+			mddev->degraded++;
+			conf->failed_disks++;
+			rdev->in_sync = 0;
+			/*
+			 * if recovery was running, make sure it aborts.
+			 */
+			set_bit(MD_RECOVERY_ERR, &mddev->recovery);
+		}
+		rdev->faulty = 1;
+		printk (KERN_ALERT
+			"raid6: Disk failure on %s, disabling device."
+			" Operation continuing on %d devices\n",
+			bdevname(rdev->bdev,b), conf->working_disks);
+	}
+}
+
+/*
+ * Input: a 'big' sector number,
+ * Output: index of the data and parity disk, and the sector # in them.
+ */
+static unsigned long raid6_compute_sector(sector_t r_sector, unsigned int raid_disks,
+			unsigned int data_disks, unsigned int * dd_idx,
+			unsigned int * pd_idx, raid6_conf_t *conf)
+{
+	long stripe;
+	unsigned long chunk_number;
+	unsigned int chunk_offset;
+	sector_t new_sector;
+	int sectors_per_chunk = conf->chunk_size >> 9;
+
+	/* First compute the information on this sector */
+
+	/*
+	 * Compute the chunk number and the sector offset inside the chunk
+	 */
+	chunk_offset = sector_div(r_sector, sectors_per_chunk);
+	chunk_number = r_sector;
+	if ( r_sector != chunk_number ) {
+		printk(KERN_CRIT "raid6: ERROR: r_sector = %llu, chunk_number = %lu\n",
+		       (unsigned long long)r_sector, (unsigned long)chunk_number);
+		BUG();
+	}
+
+	/*
+	 * Compute the stripe number
+	 */
+	stripe = chunk_number / data_disks;
+
+	/*
+	 * Compute the data disk and parity disk indexes inside the stripe
+	 */
+	*dd_idx = chunk_number % data_disks;
+
+	/*
+	 * Select the parity disk based on the user selected algorithm.
+	 */
+
+	/**** FIX THIS ****/
+	switch (conf->algorithm) {
+	case ALGORITHM_LEFT_ASYMMETRIC:
+		*pd_idx = raid_disks - 1 - (stripe % raid_disks);
+		if (*pd_idx == raid_disks-1)
+		  	(*dd_idx)++; 	/* Q D D D P */
+		else if (*dd_idx >= *pd_idx)
+		  	(*dd_idx) += 2; /* D D P Q D */
+		break;
+	case ALGORITHM_RIGHT_ASYMMETRIC:
+		*pd_idx = stripe % raid_disks;
+		if (*pd_idx == raid_disks-1)
+		  	(*dd_idx)++; 	/* Q D D D P */
+		else if (*dd_idx >= *pd_idx)
+		  	(*dd_idx) += 2; /* D D P Q D */
+		break;
+	case ALGORITHM_LEFT_SYMMETRIC:
+		*pd_idx = raid_disks - 1 - (stripe % raid_disks);
+		*dd_idx = (*pd_idx + 2 + *dd_idx) % raid_disks;
+		break;
+	case ALGORITHM_RIGHT_SYMMETRIC:
+		*pd_idx = stripe % raid_disks;
+		*dd_idx = (*pd_idx + 2 + *dd_idx) % raid_disks;
+		break;
+	default:
+		printk (KERN_CRIT "raid6: unsupported algorithm %d\n",
+			conf->algorithm);
+	}
+
+	PRINTK("raid6: chunk_number = %lu, pd_idx = %u, dd_idx = %u\n",
+	       chunk_number, *pd_idx, *dd_idx);
+
+	/*
+	 * Finally, compute the new sector number
+	 */
+	new_sector = stripe * sectors_per_chunk + chunk_offset;
+	return new_sector;
+}
+
+
+static sector_t compute_blocknr(struct stripe_head *sh, int i)
+{
+	raid6_conf_t *conf = sh->raid_conf;
+	int raid_disks = conf->raid_disks, data_disks = raid_disks - 2;
+	sector_t new_sector = sh->sector, check;
+	int sectors_per_chunk = conf->chunk_size >> 9;
+	long stripe;
+	int chunk_offset;
+	int chunk_number, dummy1, dummy2, dd_idx = i;
+	sector_t r_sector;
+	int i0 = i;
+
+	chunk_offset = sector_div(new_sector, sectors_per_chunk);
+	stripe = new_sector;
+	if ( new_sector != stripe ) {
+		printk(KERN_CRIT "raid6: ERROR: new_sector = %llu, stripe = %lu\n",
+		       (unsigned long long)new_sector, (unsigned long)stripe);
+		BUG();
+	}
+
+	switch (conf->algorithm) {
+		case ALGORITHM_LEFT_ASYMMETRIC:
+		case ALGORITHM_RIGHT_ASYMMETRIC:
+		  	if (sh->pd_idx == raid_disks-1)
+				i--; 	/* Q D D D P */
+			else if (i > sh->pd_idx)
+				i -= 2; /* D D P Q D */
+			break;
+		case ALGORITHM_LEFT_SYMMETRIC:
+		case ALGORITHM_RIGHT_SYMMETRIC:
+			if (sh->pd_idx == raid_disks-1)
+				i--; /* Q D D D P */
+			else {
+				/* D D P Q D */
+				if (i < sh->pd_idx)
+					i += raid_disks;
+				i -= (sh->pd_idx + 2);
+			}
+			break;
+		default:
+			printk (KERN_CRIT "raid6: unsupported algorithm %d\n",
+				conf->algorithm);
+	}
+
+	PRINTK("raid6: compute_blocknr: pd_idx = %u, i0 = %u, i = %u\n", sh->pd_idx, i0, i);
+
+	chunk_number = stripe * data_disks + i;
+	r_sector = (sector_t)chunk_number * sectors_per_chunk + chunk_offset;
+
+	check = raid6_compute_sector (r_sector, raid_disks, data_disks, &dummy1, &dummy2, conf);
+	if (check != sh->sector || dummy1 != dd_idx || dummy2 != sh->pd_idx) {
+		printk(KERN_CRIT "raid6: compute_blocknr: map not correct\n");
+		return 0;
+	}
+	return r_sector;
+}
+
+
+
+/*
+ * Copy data between a page in the stripe cache, and one or more bion
+ * The page could align with the middle of the bio, or there could be
+ * several bion, each with several bio_vecs, which cover part of the page
+ * Multiple bion are linked together on bi_next.  There may be extras
+ * at the end of this list.  We ignore them.
+ */
+static void copy_data(int frombio, struct bio *bio,
+		     struct page *page,
+		     sector_t sector)
+{
+	char *pa = page_address(page);
+	struct bio_vec *bvl;
+	int i;
+
+	for (;bio && bio->bi_sector < sector+STRIPE_SECTORS;
+	      bio = r5_next_bio(bio, sector) ) {
+		int page_offset;
+		if (bio->bi_sector >= sector)
+			page_offset = (signed)(bio->bi_sector - sector) * 512;
+		else
+			page_offset = (signed)(sector - bio->bi_sector) * -512;
+		bio_for_each_segment(bvl, bio, i) {
+			int len = bio_iovec_idx(bio,i)->bv_len;
+			int clen;
+			int b_offset = 0;
+
+			if (page_offset < 0) {
+				b_offset = -page_offset;
+				page_offset += b_offset;
+				len -= b_offset;
+			}
+
+			if (len > 0 && page_offset + len > STRIPE_SIZE)
+				clen = STRIPE_SIZE - page_offset;
+			else clen = len;
+
+			if (clen > 0) {
+				char *ba = __bio_kmap_atomic(bio, i, KM_USER0);
+				if (frombio)
+					memcpy(pa+page_offset, ba+b_offset, clen);
+				else
+					memcpy(ba+b_offset, pa+page_offset, clen);
+				__bio_kunmap_atomic(ba, KM_USER0);
+			}
+			if (clen < len) /* hit end of page */
+				break;
+			page_offset +=  len;
+		}
+	}
+}
+
+#define check_xor() 	do { 						\
+			   if (count == MAX_XOR_BLOCKS) {		\
+				xor_block(count, STRIPE_SIZE, ptr);	\
+				count = 1;				\
+			   }						\
+			} while(0)
+
+/* Compute P and Q syndromes */
+static void compute_parity(struct stripe_head *sh, int method)
+{
+	raid6_conf_t *conf = sh->raid_conf;
+	int i, pd_idx = sh->pd_idx, qd_idx, d0_idx, disks = conf->raid_disks, count;
+	struct bio *chosen;
+	/**** FIX THIS: This could be very bad if disks is close to 256 ****/
+	void *ptrs[disks];
+
+	qd_idx = raid6_next_disk(pd_idx, disks);
+	d0_idx = raid6_next_disk(qd_idx, disks);
+
+	PRINTK("compute_parity, stripe %llu, method %d\n",
+		(unsigned long long)sh->sector, method);
+
+	switch(method) {
+	case READ_MODIFY_WRITE:
+		BUG();		/* READ_MODIFY_WRITE N/A for RAID-6 */
+	case RECONSTRUCT_WRITE:
+	case UPDATE_PARITY:	/* Is this right? */
+		for (i= disks; i-- ;)
+			if ( i != pd_idx && i != qd_idx && sh->dev[i].towrite ) {
+				chosen = sh->dev[i].towrite;
+				sh->dev[i].towrite = NULL;
+				if (sh->dev[i].written) BUG();
+				sh->dev[i].written = chosen;
+			}
+		break;
+	case CHECK_PARITY:
+		BUG();		/* Not implemented yet */
+	}
+
+	for (i = disks; i--;)
+		if (sh->dev[i].written) {
+			sector_t sector = sh->dev[i].sector;
+			struct bio *wbi = sh->dev[i].written;
+			while (wbi && wbi->bi_sector < sector + STRIPE_SECTORS) {
+				copy_data(1, wbi, sh->dev[i].page, sector);
+				wbi = r5_next_bio(wbi, sector);
+			}
+
+			set_bit(R5_LOCKED, &sh->dev[i].flags);
+			set_bit(R5_UPTODATE, &sh->dev[i].flags);
+		}
+
+//	switch(method) {
+//	case RECONSTRUCT_WRITE:
+//	case CHECK_PARITY:
+//	case UPDATE_PARITY:
+		/* Note that unlike RAID-5, the ordering of the disks matters greatly. */
+		/* FIX: Is this ordering of drives even remotely optimal? */
+		count = 0;
+		i = d0_idx;
+		do {
+			ptrs[count++] = page_address(sh->dev[i].page);
+
+			i = raid6_next_disk(i, disks);
+		} while ( i != d0_idx );
+//		break;
+//	}
+
+	raid6_call.gen_syndrome(disks, STRIPE_SIZE, ptrs);
+
+	switch(method) {
+	case RECONSTRUCT_WRITE:
+		set_bit(R5_UPTODATE, &sh->dev[pd_idx].flags);
+		set_bit(R5_UPTODATE, &sh->dev[qd_idx].flags);
+		set_bit(R5_LOCKED,   &sh->dev[pd_idx].flags);
+		set_bit(R5_LOCKED,   &sh->dev[qd_idx].flags);
+		break;
+	case UPDATE_PARITY:
+		set_bit(R5_UPTODATE, &sh->dev[pd_idx].flags);
+		set_bit(R5_UPTODATE, &sh->dev[qd_idx].flags);
+		break;
+	}
+}
+
+/* Compute one missing block */
+static void compute_block_1(struct stripe_head *sh, int dd_idx)
+{
+	raid6_conf_t *conf = sh->raid_conf;
+	int i, count, disks = conf->raid_disks;
+	void *ptr[MAX_XOR_BLOCKS], *p;
+	int pd_idx = sh->pd_idx;
+	int qd_idx = raid6_next_disk(pd_idx, disks);
+
+	PRINTK("compute_block_1, stripe %llu, idx %d\n",
+		(unsigned long long)sh->sector, dd_idx);
+
+	if ( dd_idx == qd_idx ) {
+		/* We're actually computing the Q drive */
+		compute_parity(sh, UPDATE_PARITY);
+	} else {
+		ptr[0] = page_address(sh->dev[dd_idx].page);
+		memset(ptr[0], 0, STRIPE_SIZE);
+		count = 1;
+		for (i = disks ; i--; ) {
+			if (i == dd_idx || i == qd_idx)
+				continue;
+			p = page_address(sh->dev[i].page);
+			if (test_bit(R5_UPTODATE, &sh->dev[i].flags))
+				ptr[count++] = p;
+			else
+				PRINTK("compute_block() %d, stripe %llu, %d"
+				       " not present\n", dd_idx,
+				       (unsigned long long)sh->sector, i);
+
+			check_xor();
+		}
+		if (count != 1)
+			xor_block(count, STRIPE_SIZE, ptr);
+		set_bit(R5_UPTODATE, &sh->dev[dd_idx].flags);
+	}
+}
+
+/* Compute two missing blocks */
+static void compute_block_2(struct stripe_head *sh, int dd_idx1, int dd_idx2)
+{
+	raid6_conf_t *conf = sh->raid_conf;
+	int i, count, disks = conf->raid_disks;
+	int pd_idx = sh->pd_idx;
+	int qd_idx = raid6_next_disk(pd_idx, disks);
+	int d0_idx = raid6_next_disk(qd_idx, disks);
+	int faila, failb;
+
+	/* faila and failb are disk numbers relative to d0_idx */
+	/* pd_idx become disks-2 and qd_idx become disks-1 */
+	faila = (dd_idx1 < d0_idx) ? dd_idx1+(disks-d0_idx) : dd_idx1-d0_idx;
+	failb = (dd_idx2 < d0_idx) ? dd_idx2+(disks-d0_idx) : dd_idx2-d0_idx;
+
+	BUG_ON(faila == failb);
+	if ( failb < faila ) { int tmp = faila; faila = failb; failb = tmp; }
+
+	PRINTK("compute_block_2, stripe %llu, idx %d,%d (%d,%d)\n",
+	       (unsigned long long)sh->sector, dd_idx1, dd_idx2, faila, failb);
+
+	if ( failb == disks-1 ) {
+		/* Q disk is one of the missing disks */
+		if ( faila == disks-2 ) {
+			/* Missing P+Q, just recompute */
+			compute_parity(sh, UPDATE_PARITY);
+			return;
+		} else {
+			/* We're missing D+Q; recompute D from P */
+			compute_block_1(sh, (dd_idx1 == qd_idx) ? dd_idx2 : dd_idx1);
+			compute_parity(sh, UPDATE_PARITY); /* Is this necessary? */
+			return;
+		}
+	}
+
+	/* We're missing D+P or D+D; build pointer table */
+	{
+		/**** FIX THIS: This could be very bad if disks is close to 256 ****/
+		void *ptrs[disks];
+
+		count = 0;
+		i = d0_idx;
+		do {
+			ptrs[count++] = page_address(sh->dev[i].page);
+			i = raid6_next_disk(i, disks);
+		} while ( i != d0_idx );
+
+		if ( failb == disks-2 ) {
+			/* We're missing D+P. */
+			raid6_datap_recov(disks, STRIPE_SIZE, faila, ptrs);
+		} else {
+			/* We're missing D+D. */
+			raid6_2data_recov(disks, STRIPE_SIZE, faila, failb, ptrs);
+		}
+
+		/* Both the above update both missing blocks */
+		set_bit(R5_UPTODATE, &sh->dev[dd_idx1].flags);
+		set_bit(R5_UPTODATE, &sh->dev[dd_idx2].flags);
+	}
+}
+
+
+/*
+ * Each stripe/dev can have one or more bion attached.
+ * toread/towrite point to the first in a chain.
+ * The bi_next chain must be in order.
+ */
+static void add_stripe_bio (struct stripe_head *sh, struct bio *bi, int dd_idx, int forwrite)
+{
+	struct bio **bip;
+	raid6_conf_t *conf = sh->raid_conf;
+
+	PRINTK("adding bh b#%llu to stripe s#%llu\n",
+		(unsigned long long)bi->bi_sector,
+		(unsigned long long)sh->sector);
+
+
+	spin_lock(&sh->lock);
+	spin_lock_irq(&conf->device_lock);
+	if (forwrite)
+		bip = &sh->dev[dd_idx].towrite;
+	else
+		bip = &sh->dev[dd_idx].toread;
+	while (*bip && (*bip)->bi_sector < bi->bi_sector) {
+		BUG_ON((*bip)->bi_sector + ((*bip)->bi_size >> 9) > bi->bi_sector);
+		bip = & (*bip)->bi_next;
+	}
+/* FIXME do I need to worry about overlapping bion */
+	if (*bip && bi->bi_next && (*bip) != bi->bi_next)
+		BUG();
+	if (*bip)
+		bi->bi_next = *bip;
+	*bip = bi;
+	bi->bi_phys_segments ++;
+	spin_unlock_irq(&conf->device_lock);
+	spin_unlock(&sh->lock);
+
+	PRINTK("added bi b#%llu to stripe s#%llu, disk %d.\n",
+		(unsigned long long)bi->bi_sector,
+		(unsigned long long)sh->sector, dd_idx);
+
+	if (forwrite) {
+		/* check if page is coverred */
+		sector_t sector = sh->dev[dd_idx].sector;
+		for (bi=sh->dev[dd_idx].towrite;
+		     sector < sh->dev[dd_idx].sector + STRIPE_SECTORS &&
+			     bi && bi->bi_sector <= sector;
+		     bi = r5_next_bio(bi, sh->dev[dd_idx].sector)) {
+			if (bi->bi_sector + (bi->bi_size>>9) >= sector)
+				sector = bi->bi_sector + (bi->bi_size>>9);
+		}
+		if (sector >= sh->dev[dd_idx].sector + STRIPE_SECTORS)
+			set_bit(R5_OVERWRITE, &sh->dev[dd_idx].flags);
+	}
+}
+
+
+/*
+ * handle_stripe - do things to a stripe.
+ *
+ * We lock the stripe and then examine the state of various bits
+ * to see what needs to be done.
+ * Possible results:
+ *    return some read request which now have data
+ *    return some write requests which are safely on disc
+ *    schedule a read on some buffers
+ *    schedule a write of some buffers
+ *    return confirmation of parity correctness
+ *
+ * Parity calculations are done inside the stripe lock
+ * buffers are taken off read_list or write_list, and bh_cache buffers
+ * get BH_Lock set before the stripe lock is released.
+ *
+ */
+
+static void handle_stripe(struct stripe_head *sh)
+{
+	raid6_conf_t *conf = sh->raid_conf;
+	int disks = conf->raid_disks;
+	struct bio *return_bi= NULL;
+	struct bio *bi;
+	int i;
+	int syncing;
+	int locked=0, uptodate=0, to_read=0, to_write=0, failed=0, written=0;
+	int non_overwrite = 0;
+	int failed_num[2] = {0, 0};
+	struct r5dev *dev, *pdev, *qdev;
+	int pd_idx = sh->pd_idx;
+	int qd_idx = raid6_next_disk(pd_idx, disks);
+	int p_failed, q_failed;
+
+	PRINTK("handling stripe %llu, state=%#lx cnt=%d, pd_idx=%d, qd_idx=%d\n",
+	       (unsigned long long)sh->sector, sh->state, atomic_read(&sh->count),
+	       pd_idx, qd_idx);
+
+	spin_lock(&sh->lock);
+	clear_bit(STRIPE_HANDLE, &sh->state);
+	clear_bit(STRIPE_DELAYED, &sh->state);
+
+	syncing = test_bit(STRIPE_SYNCING, &sh->state);
+	/* Now to look around and see what can be done */
+
+	for (i=disks; i--; ) {
+		mdk_rdev_t *rdev;
+		dev = &sh->dev[i];
+		clear_bit(R5_Insync, &dev->flags);
+		clear_bit(R5_Syncio, &dev->flags);
+
+		PRINTK("check %d: state 0x%lx read %p write %p written %p\n",
+			i, dev->flags, dev->toread, dev->towrite, dev->written);
+		/* maybe we can reply to a read */
+		if (test_bit(R5_UPTODATE, &dev->flags) && dev->toread) {
+			struct bio *rbi, *rbi2;
+			PRINTK("Return read for disc %d\n", i);
+			spin_lock_irq(&conf->device_lock);
+			rbi = dev->toread;
+			dev->toread = NULL;
+			spin_unlock_irq(&conf->device_lock);
+			while (rbi && rbi->bi_sector < dev->sector + STRIPE_SECTORS) {
+				copy_data(0, rbi, dev->page, dev->sector);
+				rbi2 = r5_next_bio(rbi, dev->sector);
+				spin_lock_irq(&conf->device_lock);
+				if (--rbi->bi_phys_segments == 0) {
+					rbi->bi_next = return_bi;
+					return_bi = rbi;
+				}
+				spin_unlock_irq(&conf->device_lock);
+				rbi = rbi2;
+			}
+		}
+
+		/* now count some things */
+		if (test_bit(R5_LOCKED, &dev->flags)) locked++;
+		if (test_bit(R5_UPTODATE, &dev->flags)) uptodate++;
+
+
+		if (dev->toread) to_read++;
+		if (dev->towrite) {
+			to_write++;
+			if (!test_bit(R5_OVERWRITE, &dev->flags))
+				non_overwrite++;
+		}
+		if (dev->written) written++;
+		rdev = conf->disks[i].rdev; /* FIXME, should I be looking rdev */
+		if (!rdev || !rdev->in_sync) {
+			if ( failed < 2 )
+				failed_num[failed] = i;
+			failed++;
+		} else
+			set_bit(R5_Insync, &dev->flags);
+	}
+	PRINTK("locked=%d uptodate=%d to_read=%d"
+	       " to_write=%d failed=%d failed_num=%d,%d\n",
+	       locked, uptodate, to_read, to_write, failed,
+	       failed_num[0], failed_num[1]);
+	/* check if the array has lost >2 devices and, if so, some requests might
+	 * need to be failed
+	 */
+	if (failed > 2 && to_read+to_write+written) {
+		spin_lock_irq(&conf->device_lock);
+		for (i=disks; i--; ) {
+			/* fail all writes first */
+			bi = sh->dev[i].towrite;
+			sh->dev[i].towrite = NULL;
+			if (bi) to_write--;
+
+			while (bi && bi->bi_sector < sh->dev[i].sector + STRIPE_SECTORS){
+				struct bio *nextbi = r5_next_bio(bi, sh->dev[i].sector);
+				clear_bit(BIO_UPTODATE, &bi->bi_flags);
+				if (--bi->bi_phys_segments == 0) {
+					md_write_end(conf->mddev);
+					bi->bi_next = return_bi;
+					return_bi = bi;
+				}
+				bi = nextbi;
+			}
+			/* and fail all 'written' */
+			bi = sh->dev[i].written;
+			sh->dev[i].written = NULL;
+			while (bi && bi->bi_sector < sh->dev[i].sector + STRIPE_SECTORS) {
+				struct bio *bi2 = r5_next_bio(bi, sh->dev[i].sector);
+				clear_bit(BIO_UPTODATE, &bi->bi_flags);
+				if (--bi->bi_phys_segments == 0) {
+					md_write_end(conf->mddev);
+					bi->bi_next = return_bi;
+					return_bi = bi;
+				}
+				bi = bi2;
+			}
+
+			/* fail any reads if this device is non-operational */
+			if (!test_bit(R5_Insync, &sh->dev[i].flags)) {
+				bi = sh->dev[i].toread;
+				sh->dev[i].toread = NULL;
+				if (bi) to_read--;
+				while (bi && bi->bi_sector < sh->dev[i].sector + STRIPE_SECTORS){
+					struct bio *nextbi = r5_next_bio(bi, sh->dev[i].sector);
+					clear_bit(BIO_UPTODATE, &bi->bi_flags);
+					if (--bi->bi_phys_segments == 0) {
+						bi->bi_next = return_bi;
+						return_bi = bi;
+					}
+					bi = nextbi;
+				}
+			}
+		}
+		spin_unlock_irq(&conf->device_lock);
+	}
+	if (failed > 2 && syncing) {
+		md_done_sync(conf->mddev, STRIPE_SECTORS,0);
+		clear_bit(STRIPE_SYNCING, &sh->state);
+		syncing = 0;
+	}
+
+	/*
+	 * might be able to return some write requests if the parity blocks
+	 * are safe, or on a failed drive
+	 */
+	pdev = &sh->dev[pd_idx];
+	p_failed = (failed >= 1 && failed_num[0] == pd_idx)
+		|| (failed >= 2 && failed_num[1] == pd_idx);
+	qdev = &sh->dev[qd_idx];
+	q_failed = (failed >= 1 && failed_num[0] == qd_idx)
+		|| (failed >= 2 && failed_num[1] == qd_idx);
+
+	if ( written &&
+	     ( p_failed || ((test_bit(R5_Insync, &pdev->flags)
+			     && !test_bit(R5_LOCKED, &pdev->flags)
+			     && test_bit(R5_UPTODATE, &pdev->flags))) ) &&
+	     ( q_failed || ((test_bit(R5_Insync, &qdev->flags)
+			     && !test_bit(R5_LOCKED, &qdev->flags)
+			     && test_bit(R5_UPTODATE, &qdev->flags))) ) ) {
+		/* any written block on an uptodate or failed drive can be
+		 * returned.  Note that if we 'wrote' to a failed drive,
+		 * it will be UPTODATE, but never LOCKED, so we don't need
+		 * to test 'failed' directly.
+		 */
+		for (i=disks; i--; )
+			if (sh->dev[i].written) {
+				dev = &sh->dev[i];
+				if (!test_bit(R5_LOCKED, &dev->flags) &&
+				    test_bit(R5_UPTODATE, &dev->flags) ) {
+					/* We can return any write requests */
+					struct bio *wbi, *wbi2;
+					PRINTK("Return write for stripe %llu disc %d\n",
+					       (unsigned long long)sh->sector, i);
+					spin_lock_irq(&conf->device_lock);
+					wbi = dev->written;
+					dev->written = NULL;
+					while (wbi && wbi->bi_sector < dev->sector + STRIPE_SECTORS) {
+						wbi2 = r5_next_bio(wbi, dev->sector);
+						if (--wbi->bi_phys_segments == 0) {
+							md_write_end(conf->mddev);
+							wbi->bi_next = return_bi;
+							return_bi = wbi;
+						}
+						wbi = wbi2;
+					}
+					spin_unlock_irq(&conf->device_lock);
+				}
+			}
+	}
+
+	/* Now we might consider reading some blocks, either to check/generate
+	 * parity, or to satisfy requests
+	 * or to load a block that is being partially written.
+	 */
+	if (to_read || non_overwrite || (syncing && (uptodate+failed < disks))) {
+		for (i=disks; i--;) {
+			dev = &sh->dev[i];
+			if (!test_bit(R5_LOCKED, &dev->flags) && !test_bit(R5_UPTODATE, &dev->flags) &&
+			    (dev->toread ||
+			     (dev->towrite && !test_bit(R5_OVERWRITE, &dev->flags)) ||
+			     syncing ||
+			     (failed >= 1 && (sh->dev[failed_num[0]].toread ||
+					 (sh->dev[failed_num[0]].towrite && !test_bit(R5_OVERWRITE, &sh->dev[failed_num[0]].flags)))) ||
+			     (failed >= 2 && (sh->dev[failed_num[1]].toread ||
+					 (sh->dev[failed_num[1]].towrite && !test_bit(R5_OVERWRITE, &sh->dev[failed_num[1]].flags))))
+				    )
+				) {
+				/* we would like to get this block, possibly
+				 * by computing it, but we might not be able to
+				 */
+				if (uptodate == disks-1) {
+					PRINTK("Computing stripe %llu block %d\n",
+					       (unsigned long long)sh->sector, i);
+					compute_block_1(sh, i);
+					uptodate++;
+				} else if ( uptodate == disks-2 && failed >= 2 ) {
+					/* Computing 2-failure is *very* expensive; only do it if failed >= 2 */
+					int other;
+					for (other=disks; other--;) {
+						if ( other == i )
+							continue;
+						if ( !test_bit(R5_UPTODATE, &sh->dev[other].flags) )
+							break;
+					}
+					BUG_ON(other < 0);
+					PRINTK("Computing stripe %llu blocks %d,%d\n",
+					       (unsigned long long)sh->sector, i, other);
+					compute_block_2(sh, i, other);
+					uptodate += 2;
+				} else if (test_bit(R5_Insync, &dev->flags)) {
+					set_bit(R5_LOCKED, &dev->flags);
+					set_bit(R5_Wantread, &dev->flags);
+#if 0
+					/* if I am just reading this block and we don't have
+					   a failed drive, or any pending writes then sidestep the cache */
+					if (sh->bh_read[i] && !sh->bh_read[i]->b_reqnext &&
+					    ! syncing && !failed && !to_write) {
+						sh->bh_cache[i]->b_page =  sh->bh_read[i]->b_page;
+						sh->bh_cache[i]->b_data =  sh->bh_read[i]->b_data;
+					}
+#endif
+					locked++;
+					PRINTK("Reading block %d (sync=%d)\n",
+						i, syncing);
+					if (syncing)
+						md_sync_acct(conf->disks[i].rdev, STRIPE_SECTORS);
+				}
+			}
+		}
+		set_bit(STRIPE_HANDLE, &sh->state);
+	}
+
+	/* now to consider writing and what else, if anything should be read */
+	if (to_write) {
+		int rcw=0, must_compute=0;
+		for (i=disks ; i--;) {
+			dev = &sh->dev[i];
+			/* Would I have to read this buffer for reconstruct_write */
+			if (!test_bit(R5_OVERWRITE, &dev->flags)
+			    && i != pd_idx && i != qd_idx
+			    && (!test_bit(R5_LOCKED, &dev->flags)
+#if 0
+				|| sh->bh_page[i] != bh->b_page
+#endif
+				    ) &&
+			    !test_bit(R5_UPTODATE, &dev->flags)) {
+				if (test_bit(R5_Insync, &dev->flags)) rcw++;
+				else {
+					PRINTK("raid6: must_compute: disk %d flags=%#lx\n", i, dev->flags);
+					must_compute++;
+				}
+			}
+		}
+		PRINTK("for sector %llu, rcw=%d, must_compute=%d\n",
+		       (unsigned long long)sh->sector, rcw, must_compute);
+		set_bit(STRIPE_HANDLE, &sh->state);
+
+		if (rcw > 0)
+			/* want reconstruct write, but need to get some data */
+			for (i=disks; i--;) {
+				dev = &sh->dev[i];
+				if (!test_bit(R5_OVERWRITE, &dev->flags)
+				    && !(failed == 0 && (i == pd_idx || i == qd_idx))
+				    && !test_bit(R5_LOCKED, &dev->flags) && !test_bit(R5_UPTODATE, &dev->flags) &&
+				    test_bit(R5_Insync, &dev->flags)) {
+					if (test_bit(STRIPE_PREREAD_ACTIVE, &sh->state))
+					{
+						PRINTK("Read_old stripe %llu block %d for Reconstruct\n",
+						       (unsigned long long)sh->sector, i);
+						set_bit(R5_LOCKED, &dev->flags);
+						set_bit(R5_Wantread, &dev->flags);
+						locked++;
+					} else {
+						PRINTK("Request delayed stripe %llu block %d for Reconstruct\n",
+						       (unsigned long long)sh->sector, i);
+						set_bit(STRIPE_DELAYED, &sh->state);
+						set_bit(STRIPE_HANDLE, &sh->state);
+					}
+				}
+			}
+		/* now if nothing is locked, and if we have enough data, we can start a write request */
+		if (locked == 0 && rcw == 0) {
+			if ( must_compute > 0 ) {
+				/* We have failed blocks and need to compute them */
+				switch ( failed ) {
+				case 0:	BUG();
+				case 1: compute_block_1(sh, failed_num[0]); break;
+				case 2: compute_block_2(sh, failed_num[0], failed_num[1]); break;
+				default: BUG();	/* This request should have been failed? */
+				}
+			}
+
+			PRINTK("Computing parity for stripe %llu\n", (unsigned long long)sh->sector);
+			compute_parity(sh, RECONSTRUCT_WRITE);
+			/* now every locked buffer is ready to be written */
+			for (i=disks; i--;)
+				if (test_bit(R5_LOCKED, &sh->dev[i].flags)) {
+					PRINTK("Writing stripe %llu block %d\n",
+					       (unsigned long long)sh->sector, i);
+					locked++;
+					set_bit(R5_Wantwrite, &sh->dev[i].flags);
+#if 0 /**** FIX: I don't understand the logic here... ****/
+					if (!test_bit(R5_Insync, &sh->dev[i].flags)
+					    || ((i==pd_idx || i==qd_idx) && failed == 0)) /* FIX? */
+						set_bit(STRIPE_INSYNC, &sh->state);
+#endif
+				}
+			if (test_and_clear_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) {
+				atomic_dec(&conf->preread_active_stripes);
+				if (atomic_read(&conf->preread_active_stripes) < IO_THRESHOLD)
+					md_wakeup_thread(conf->mddev->thread);
+			}
+		}
+	}
+
+	/* maybe we need to check and possibly fix the parity for this stripe
+	 * Any reads will already have been scheduled, so we just see if enough data
+	 * is available
+	 */
+	if (syncing && locked == 0 &&
+	    !test_bit(STRIPE_INSYNC, &sh->state) && failed <= 2) {
+		set_bit(STRIPE_HANDLE, &sh->state);
+#if 0 /* RAID-6: Don't support CHECK PARITY yet */
+		if (failed == 0) {
+			char *pagea;
+			if (uptodate != disks)
+				BUG();
+			compute_parity(sh, CHECK_PARITY);
+			uptodate--;
+			pagea = page_address(sh->dev[pd_idx].page);
+			if ((*(u32*)pagea) == 0 &&
+			    !memcmp(pagea, pagea+4, STRIPE_SIZE-4)) {
+				/* parity is correct (on disc, not in buffer any more) */
+				set_bit(STRIPE_INSYNC, &sh->state);
+			}
+		}
+#endif
+		if (!test_bit(STRIPE_INSYNC, &sh->state)) {
+			int failed_needupdate[2];
+			struct r5dev *adev, *bdev;
+
+			if ( failed < 1 )
+				failed_num[0] = pd_idx;
+			if ( failed < 2 )
+				failed_num[1] = (failed_num[0] == qd_idx) ? pd_idx : qd_idx;
+
+			failed_needupdate[0] = !test_bit(R5_UPTODATE, &sh->dev[failed_num[0]].flags);
+			failed_needupdate[1] = !test_bit(R5_UPTODATE, &sh->dev[failed_num[1]].flags);
+
+			PRINTK("sync: failed=%d num=%d,%d fnu=%u%u\n",
+			       failed, failed_num[0], failed_num[1], failed_needupdate[0], failed_needupdate[1]);
+
+#if 0  /* RAID-6: This code seems to require that CHECK_PARITY destroys the uptodateness of the parity */
+			/* should be able to compute the missing block(s) and write to spare */
+			if ( failed_needupdate[0] ^ failed_needupdate[1] ) {
+				if (uptodate+1 != disks)
+					BUG();
+				compute_block_1(sh, failed_needupdate[0] ? failed_num[0] : failed_num[1]);
+				uptodate++;
+			} else if ( failed_needupdate[0] & failed_needupdate[1] ) {
+				if (uptodate+2 != disks)
+					BUG();
+				compute_block_2(sh, failed_num[0], failed_num[1]);
+				uptodate += 2;
+			}
+#else
+			compute_block_2(sh, failed_num[0], failed_num[1]);
+			uptodate += failed_needupdate[0] + failed_needupdate[1];
+#endif
+
+			if (uptodate != disks)
+				BUG();
+
+			PRINTK("Marking for sync stripe %llu blocks %d,%d\n",
+			       (unsigned long long)sh->sector, failed_num[0], failed_num[1]);
+
+			/**** FIX: Should we really do both of these unconditionally? ****/
+			adev = &sh->dev[failed_num[0]];
+			locked += !test_bit(R5_LOCKED, &adev->flags);
+			set_bit(R5_LOCKED, &adev->flags);
+			set_bit(R5_Wantwrite, &adev->flags);
+			bdev = &sh->dev[failed_num[1]];
+			locked += !test_bit(R5_LOCKED, &bdev->flags);
+			set_bit(R5_LOCKED, &bdev->flags);
+			set_bit(R5_Wantwrite, &bdev->flags);
+
+			set_bit(STRIPE_INSYNC, &sh->state);
+			set_bit(R5_Syncio, &adev->flags);
+			set_bit(R5_Syncio, &bdev->flags);
+		}
+	}
+	if (syncing && locked == 0 && test_bit(STRIPE_INSYNC, &sh->state)) {
+		md_done_sync(conf->mddev, STRIPE_SECTORS,1);
+		clear_bit(STRIPE_SYNCING, &sh->state);
+	}
+
+	spin_unlock(&sh->lock);
+
+	while ((bi=return_bi)) {
+		int bytes = bi->bi_size;
+
+		return_bi = bi->bi_next;
+		bi->bi_next = NULL;
+		bi->bi_size = 0;
+		bi->bi_end_io(bi, bytes, 0);
+	}
+	for (i=disks; i-- ;) {
+		int rw;
+		struct bio *bi;
+		mdk_rdev_t *rdev;
+		if (test_and_clear_bit(R5_Wantwrite, &sh->dev[i].flags))
+			rw = 1;
+		else if (test_and_clear_bit(R5_Wantread, &sh->dev[i].flags))
+			rw = 0;
+		else
+			continue;
+
+		bi = &sh->dev[i].req;
+
+		bi->bi_rw = rw;
+		if (rw)
+			bi->bi_end_io = raid6_end_write_request;
+		else
+			bi->bi_end_io = raid6_end_read_request;
+
+		spin_lock_irq(&conf->device_lock);
+		rdev = conf->disks[i].rdev;
+		if (rdev && rdev->faulty)
+			rdev = NULL;
+		if (rdev)
+			atomic_inc(&rdev->nr_pending);
+		spin_unlock_irq(&conf->device_lock);
+
+		if (rdev) {
+			if (test_bit(R5_Syncio, &sh->dev[i].flags))
+				md_sync_acct(rdev, STRIPE_SECTORS);
+
+			bi->bi_bdev = rdev->bdev;
+			PRINTK("for %llu schedule op %ld on disc %d\n",
+				(unsigned long long)sh->sector, bi->bi_rw, i);
+			atomic_inc(&sh->count);
+			bi->bi_sector = sh->sector + rdev->data_offset;
+			bi->bi_flags = 1 << BIO_UPTODATE;
+			bi->bi_vcnt = 1;
+			bi->bi_idx = 0;
+			bi->bi_io_vec = &sh->dev[i].vec;
+			bi->bi_io_vec[0].bv_len = STRIPE_SIZE;
+			bi->bi_io_vec[0].bv_offset = 0;
+			bi->bi_size = STRIPE_SIZE;
+			bi->bi_next = NULL;
+			generic_make_request(bi);
+		} else {
+			PRINTK("skip op %ld on disc %d for sector %llu\n",
+				bi->bi_rw, i, (unsigned long long)sh->sector);
+			clear_bit(R5_LOCKED, &sh->dev[i].flags);
+			set_bit(STRIPE_HANDLE, &sh->state);
+		}
+	}
+}
+
+static inline void raid6_activate_delayed(raid6_conf_t *conf)
+{
+	if (atomic_read(&conf->preread_active_stripes) < IO_THRESHOLD) {
+		while (!list_empty(&conf->delayed_list)) {
+			struct list_head *l = conf->delayed_list.next;
+			struct stripe_head *sh;
+			sh = list_entry(l, struct stripe_head, lru);
+			list_del_init(l);
+			clear_bit(STRIPE_DELAYED, &sh->state);
+			if (!test_and_set_bit(STRIPE_PREREAD_ACTIVE, &sh->state))
+				atomic_inc(&conf->preread_active_stripes);
+			list_add_tail(&sh->lru, &conf->handle_list);
+		}
+	}
+}
+static void raid6_unplug_device(void *data)
+{
+	request_queue_t *q = data;
+	mddev_t *mddev = q->queuedata;
+	raid6_conf_t *conf = mddev_to_conf(mddev);
+	unsigned long flags;
+
+	spin_lock_irqsave(&conf->device_lock, flags);
+
+	if (blk_remove_plug(q))
+		raid6_activate_delayed(conf);
+	md_wakeup_thread(mddev->thread);
+
+	spin_unlock_irqrestore(&conf->device_lock, flags);
+}
+
+static inline void raid6_plug_device(raid6_conf_t *conf)
+{
+	spin_lock_irq(&conf->device_lock);
+	blk_plug_device(conf->mddev->queue);
+	spin_unlock_irq(&conf->device_lock);
+}
+
+static int make_request (request_queue_t *q, struct bio * bi)
+{
+	mddev_t *mddev = q->queuedata;
+	raid6_conf_t *conf = mddev_to_conf(mddev);
+	const unsigned int raid_disks = conf->raid_disks;
+	const unsigned int data_disks = raid_disks - 2;
+	unsigned int dd_idx, pd_idx;
+	sector_t new_sector;
+	sector_t logical_sector, last_sector;
+	struct stripe_head *sh;
+
+	logical_sector = bi->bi_sector & ~(STRIPE_SECTORS-1);
+	last_sector = bi->bi_sector + (bi->bi_size>>9);
+
+	bi->bi_next = NULL;
+	bi->bi_phys_segments = 1;	/* over-loaded to count active stripes */
+	if ( bio_data_dir(bi) == WRITE )
+		md_write_start(mddev);
+	for (;logical_sector < last_sector; logical_sector += STRIPE_SECTORS) {
+
+		new_sector = raid6_compute_sector(logical_sector,
+						  raid_disks, data_disks, &dd_idx, &pd_idx, conf);
+
+		PRINTK("raid6: make_request, sector %Lu logical %Lu\n",
+		       (unsigned long long)new_sector,
+		       (unsigned long long)logical_sector);
+
+		sh = get_active_stripe(conf, new_sector, pd_idx, (bi->bi_rw&RWA_MASK));
+		if (sh) {
+
+			add_stripe_bio(sh, bi, dd_idx, (bi->bi_rw&RW_MASK));
+
+			raid6_plug_device(conf);
+			handle_stripe(sh);
+			release_stripe(sh);
+		} else {
+			/* cannot get stripe for read-ahead, just give-up */
+			clear_bit(BIO_UPTODATE, &bi->bi_flags);
+			break;
+		}
+
+	}
+	spin_lock_irq(&conf->device_lock);
+	if (--bi->bi_phys_segments == 0) {
+		int bytes = bi->bi_size;
+
+		if ( bio_data_dir(bi) == WRITE )
+			md_write_end(mddev);
+		bi->bi_size = 0;
+		bi->bi_end_io(bi, bytes, 0);
+	}
+	spin_unlock_irq(&conf->device_lock);
+	return 0;
+}
+
+/* FIXME go_faster isn't used */
+static int sync_request (mddev_t *mddev, sector_t sector_nr, int go_faster)
+{
+	raid6_conf_t *conf = (raid6_conf_t *) mddev->private;
+	struct stripe_head *sh;
+	int sectors_per_chunk = conf->chunk_size >> 9;
+	sector_t x;
+	unsigned long stripe;
+	int chunk_offset;
+	int dd_idx, pd_idx;
+	unsigned long first_sector;
+	int raid_disks = conf->raid_disks;
+	int data_disks = raid_disks - 2;
+
+	if (sector_nr >= mddev->size <<1)
+		/* just being told to finish up .. nothing to do */
+		return 0;
+
+	x = sector_nr;
+	chunk_offset = sector_div(x, sectors_per_chunk);
+	stripe = x;
+	BUG_ON(x != stripe);
+
+	first_sector = raid6_compute_sector(stripe*data_disks*sectors_per_chunk
+		+ chunk_offset, raid_disks, data_disks, &dd_idx, &pd_idx, conf);
+	sh = get_active_stripe(conf, sector_nr, pd_idx, 1);
+	if (sh == NULL) {
+		sh = get_active_stripe(conf, sector_nr, pd_idx, 0);
+		/* make sure we don't swamp the stripe cache if someone else
+		 * is trying to get access
+		 */
+		yield();
+	}
+	spin_lock(&sh->lock);
+	set_bit(STRIPE_SYNCING, &sh->state);
+	clear_bit(STRIPE_INSYNC, &sh->state);
+	spin_unlock(&sh->lock);
+
+	handle_stripe(sh);
+	release_stripe(sh);
+
+	return STRIPE_SECTORS;
+}
+
+/*
+ * This is our raid6 kernel thread.
+ *
+ * We scan the hash table for stripes which can be handled now.
+ * During the scan, completed stripes are saved for us by the interrupt
+ * handler, so that they will not have to wait for our next wakeup.
+ */
+static void raid6d (mddev_t *mddev)
+{
+	struct stripe_head *sh;
+	raid6_conf_t *conf = mddev_to_conf(mddev);
+	int handled;
+
+	PRINTK("+++ raid6d active\n");
+
+	md_check_recovery(mddev);
+	md_handle_safemode(mddev);
+
+	handled = 0;
+	spin_lock_irq(&conf->device_lock);
+	while (1) {
+		struct list_head *first;
+
+		if (list_empty(&conf->handle_list) &&
+		    atomic_read(&conf->preread_active_stripes) < IO_THRESHOLD &&
+		    !blk_queue_plugged(mddev->queue) &&
+		    !list_empty(&conf->delayed_list))
+			raid6_activate_delayed(conf);
+
+		if (list_empty(&conf->handle_list))
+			break;
+
+		first = conf->handle_list.next;
+		sh = list_entry(first, struct stripe_head, lru);
+
+		list_del_init(first);
+		atomic_inc(&sh->count);
+		if (atomic_read(&sh->count)!= 1)
+			BUG();
+		spin_unlock_irq(&conf->device_lock);
+
+		handled++;
+		handle_stripe(sh);
+		release_stripe(sh);
+
+		spin_lock_irq(&conf->device_lock);
+	}
+	PRINTK("%d stripes handled\n", handled);
+
+	spin_unlock_irq(&conf->device_lock);
+
+	PRINTK("--- raid6d inactive\n");
+}
+
+static int run (mddev_t *mddev)
+{
+	raid6_conf_t *conf;
+	int raid_disk, memory;
+	mdk_rdev_t *rdev;
+	struct disk_info *disk;
+	struct list_head *tmp;
+
+	if (mddev->level != 6) {
+		PRINTK("raid6: md%d: raid level not set to 6 (%d)\n", mdidx(mddev), mddev->level);
+		return -EIO;
+	}
+
+	mddev->private = kmalloc (sizeof (raid6_conf_t)
+				  + mddev->raid_disks * sizeof(struct disk_info),
+				  GFP_KERNEL);
+	if ((conf = mddev->private) == NULL)
+		goto abort;
+	memset (conf, 0, sizeof (*conf) + mddev->raid_disks * sizeof(struct disk_info) );
+	conf->mddev = mddev;
+
+	if ((conf->stripe_hashtbl = (struct stripe_head **) __get_free_pages(GFP_ATOMIC, HASH_PAGES_ORDER)) == NULL)
+		goto abort;
+	memset(conf->stripe_hashtbl, 0, HASH_PAGES * PAGE_SIZE);
+
+	conf->device_lock = SPIN_LOCK_UNLOCKED;
+	init_waitqueue_head(&conf->wait_for_stripe);
+	INIT_LIST_HEAD(&conf->handle_list);
+	INIT_LIST_HEAD(&conf->delayed_list);
+	INIT_LIST_HEAD(&conf->inactive_list);
+	atomic_set(&conf->active_stripes, 0);
+	atomic_set(&conf->preread_active_stripes, 0);
+
+	mddev->queue->unplug_fn = raid6_unplug_device;
+
+	PRINTK("raid6: run(md%d) called.\n", mdidx(mddev));
+
+	ITERATE_RDEV(mddev,rdev,tmp) {
+		raid_disk = rdev->raid_disk;
+		if (raid_disk >= mddev->raid_disks
+		    || raid_disk < 0)
+			continue;
+		disk = conf->disks + raid_disk;
+
+		disk->rdev = rdev;
+
+		if (rdev->in_sync) {
+			char b[BDEVNAME_SIZE];
+			printk(KERN_INFO "raid6: device %s operational as raid"
+			       " disk %d\n", bdevname(rdev->bdev,b),
+			       raid_disk);
+			conf->working_disks++;
+		}
+	}
+
+	conf->raid_disks = mddev->raid_disks;
+
+	/*
+	 * 0 for a fully functional array, 1 or 2 for a degraded array.
+	 */
+	mddev->degraded = conf->failed_disks = conf->raid_disks - conf->working_disks;
+	conf->mddev = mddev;
+	conf->chunk_size = mddev->chunk_size;
+	conf->level = mddev->level;
+	conf->algorithm = mddev->layout;
+	conf->max_nr_stripes = NR_STRIPES;
+
+	if (conf->raid_disks < 4) {
+		printk(KERN_ERR "raid6: not enough configured devices for md%d (%d, minimum 4)\n",
+		       mdidx(mddev), conf->raid_disks);
+		goto abort;
+	}
+	if (!conf->chunk_size || conf->chunk_size % 4) {
+		printk(KERN_ERR "raid6: invalid chunk size %d for md%d\n",
+		       conf->chunk_size, mdidx(mddev));
+		goto abort;
+	}
+	if (conf->algorithm > ALGORITHM_RIGHT_SYMMETRIC) {
+		printk(KERN_ERR
+		       "raid6: unsupported parity algorithm %d for md%d\n",
+		       conf->algorithm, mdidx(mddev));
+		goto abort;
+	}
+	if (mddev->degraded > 2) {
+		printk(KERN_ERR "raid6: not enough operational devices for md%d"
+		       " (%d/%d failed)\n",
+		       mdidx(mddev), conf->failed_disks, conf->raid_disks);
+		goto abort;
+	}
+
+#if 0				/* FIX: For now */
+	if (mddev->degraded > 0 &&
+	    mddev->recovery_cp != MaxSector) {
+		printk(KERN_ERR "raid6: cannot start dirty degraded array for md%d\n", mdidx(mddev));
+		goto abort;
+	}
+#endif
+
+	{
+		mddev->thread = md_register_thread(raid6d, mddev, "md%d_raid6");
+		if (!mddev->thread) {
+			printk(KERN_ERR
+			       "raid6: couldn't allocate thread for md%d\n",
+			       mdidx(mddev));
+			goto abort;
+		}
+	}
+
+	memory = conf->max_nr_stripes * (sizeof(struct stripe_head) +
+		 conf->raid_disks * ((sizeof(struct bio) + PAGE_SIZE))) / 1024;
+	if (grow_stripes(conf, conf->max_nr_stripes)) {
+		printk(KERN_ERR
+		       "raid6: couldn't allocate %dkB for buffers\n", memory);
+		shrink_stripes(conf);
+		md_unregister_thread(mddev->thread);
+		goto abort;
+	} else
+		printk(KERN_INFO "raid6: allocated %dkB for md%d\n",
+		       memory, mdidx(mddev));
+
+	if (mddev->degraded == 0)
+		printk(KERN_INFO "raid6: raid level %d set md%d active with %d out of %d"
+		       " devices, algorithm %d\n", conf->level, mdidx(mddev),
+		       mddev->raid_disks-mddev->degraded, mddev->raid_disks,
+		       conf->algorithm);
+	else
+		printk(KERN_ALERT "raid6: raid level %d set md%d active with %d"
+		       " out of %d devices, algorithm %d\n", conf->level,
+		       mdidx(mddev), mddev->raid_disks - mddev->degraded,
+		       mddev->raid_disks, conf->algorithm);
+
+	print_raid6_conf(conf);
+
+	/* read-ahead size must cover a whole stripe, which is
+	 * (n-2) * chunksize where 'n' is the number of raid devices
+	 */
+	{
+		int stripe = (mddev->raid_disks-2) * mddev->chunk_size
+			/ PAGE_CACHE_SIZE;
+		if (mddev->queue->backing_dev_info.ra_pages < stripe)
+			mddev->queue->backing_dev_info.ra_pages = stripe;
+	}
+
+	/* Ok, everything is just fine now */
+	mddev->array_size =  mddev->size * (mddev->raid_disks - 2);
+	return 0;
+abort:
+	if (conf) {
+		print_raid6_conf(conf);
+		if (conf->stripe_hashtbl)
+			free_pages((unsigned long) conf->stripe_hashtbl,
+							HASH_PAGES_ORDER);
+		kfree(conf);
+	}
+	mddev->private = NULL;
+	printk(KERN_ALERT "raid6: failed to run raid set md%d\n", mdidx(mddev));
+	return -EIO;
+}
+
+
+
+static int stop (mddev_t *mddev)
+{
+	raid6_conf_t *conf = (raid6_conf_t *) mddev->private;
+
+	md_unregister_thread(mddev->thread);
+	mddev->thread = NULL;
+	shrink_stripes(conf);
+	free_pages((unsigned long) conf->stripe_hashtbl, HASH_PAGES_ORDER);
+	kfree(conf);
+	mddev->private = NULL;
+	return 0;
+}
+
+#if RAID6_DUMPSTATE
+static void print_sh (struct seq_file *seq, struct stripe_head *sh)
+{
+	int i;
+
+	seq_printf(seq, "sh %llu, pd_idx %d, state %ld.\n",
+		   (unsigned long long)sh->sector, sh->pd_idx, sh->state);
+	seq_printf(seq, "sh %llu,  count %d.\n",
+		   (unsigned long long)sh->sector, atomic_read(&sh->count));
+	seq_printf(seq, "sh %llu, ", (unsigned long long)sh->sector);
+	for (i = 0; i < sh->raid_conf->raid_disks; i++) {
+		seq_printf(seq, "(cache%d: %p %ld) ",
+			   i, sh->dev[i].page, sh->dev[i].flags);
+	}
+	seq_printf(seq, "\n");
+}
+
+static void printall (struct seq_file *seq, raid6_conf_t *conf)
+{
+	struct stripe_head *sh;
+	int i;
+
+	spin_lock_irq(&conf->device_lock);
+	for (i = 0; i < NR_HASH; i++) {
+		sh = conf->stripe_hashtbl[i];
+		for (; sh; sh = sh->hash_next) {
+			if (sh->raid_conf != conf)
+				continue;
+			print_sh(seq, sh);
+		}
+	}
+	spin_unlock_irq(&conf->device_lock);
+}
+#endif
+
+static void status (struct seq_file *seq, mddev_t *mddev)
+{
+	raid6_conf_t *conf = (raid6_conf_t *) mddev->private;
+	int i;
+
+	seq_printf (seq, " level %d, %dk chunk, algorithm %d", mddev->level, mddev->chunk_size >> 10, mddev->layout);
+	seq_printf (seq, " [%d/%d] [", conf->raid_disks, conf->working_disks);
+	for (i = 0; i < conf->raid_disks; i++)
+ 		seq_printf (seq, "%s",
+			    conf->disks[i].rdev &&
+			    conf->disks[i].rdev->in_sync ? "U" : "_");
+	seq_printf (seq, "]");
+#if RAID6_DUMPSTATE
+	seq_printf (seq, "\n");
+	printall(seq, conf);
+#endif
+}
+
+static void print_raid6_conf (raid6_conf_t *conf)
+{
+	int i;
+	struct disk_info *tmp;
+
+	printk("RAID6 conf printout:\n");
+	if (!conf) {
+		printk("(conf==NULL)\n");
+		return;
+	}
+	printk(" --- rd:%d wd:%d fd:%d\n", conf->raid_disks,
+		 conf->working_disks, conf->failed_disks);
+
+	for (i = 0; i < conf->raid_disks; i++) {
+		char b[BDEVNAME_SIZE];
+		tmp = conf->disks + i;
+		if (tmp->rdev)
+		printk(" disk %d, o:%d, dev:%s\n",
+			i, !tmp->rdev->faulty,
+			bdevname(tmp->rdev->bdev,b));
+	}
+}
+
+static int raid6_spare_active(mddev_t *mddev)
+{
+	int i;
+	raid6_conf_t *conf = mddev->private;
+	struct disk_info *tmp;
+
+	spin_lock_irq(&conf->device_lock);
+	for (i = 0; i < conf->raid_disks; i++) {
+		tmp = conf->disks + i;
+		if (tmp->rdev
+		    && !tmp->rdev->faulty
+		    && !tmp->rdev->in_sync) {
+			mddev->degraded--;
+			conf->failed_disks--;
+			conf->working_disks++;
+			tmp->rdev->in_sync = 1;
+		}
+	}
+	spin_unlock_irq(&conf->device_lock);
+	print_raid6_conf(conf);
+	return 0;
+}
+
+static int raid6_remove_disk(mddev_t *mddev, int number)
+{
+	raid6_conf_t *conf = mddev->private;
+	int err = 1;
+	struct disk_info *p = conf->disks + number;
+
+	print_raid6_conf(conf);
+	spin_lock_irq(&conf->device_lock);
+
+	if (p->rdev) {
+		if (p->rdev->in_sync ||
+		    atomic_read(&p->rdev->nr_pending)) {
+			err = -EBUSY;
+			goto abort;
+		}
+		p->rdev = NULL;
+		err = 0;
+	}
+	if (err)
+		MD_BUG();
+abort:
+	spin_unlock_irq(&conf->device_lock);
+	print_raid6_conf(conf);
+	return err;
+}
+
+static int raid6_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
+{
+	raid6_conf_t *conf = mddev->private;
+	int found = 0;
+	int disk;
+	struct disk_info *p;
+
+	spin_lock_irq(&conf->device_lock);
+	/*
+	 * find the disk ...
+	 */
+	for (disk=0; disk < mddev->raid_disks; disk++)
+		if ((p=conf->disks + disk)->rdev == NULL) {
+			p->rdev = rdev;
+			rdev->in_sync = 0;
+			rdev->raid_disk = disk;
+			found = 1;
+			break;
+		}
+	spin_unlock_irq(&conf->device_lock);
+	print_raid6_conf(conf);
+	return found;
+}
+
+static mdk_personality_t raid6_personality=
+{
+	.name		= "raid6",
+	.owner		= THIS_MODULE,
+	.make_request	= make_request,
+	.run		= run,
+	.stop		= stop,
+	.status		= status,
+	.error_handler	= error,
+	.hot_add_disk	= raid6_add_disk,
+	.hot_remove_disk= raid6_remove_disk,
+	.spare_active	= raid6_spare_active,
+	.sync_request	= sync_request,
+};
+
+static int __init raid6_init (void)
+{
+	int e;
+
+	e = raid6_select_algo();
+	if ( e )
+		return e;
+
+	return register_md_personality (RAID6, &raid6_personality);
+}
+
+static void raid6_exit (void)
+{
+	unregister_md_personality (RAID6);
+}
+
+module_init(raid6_init);
+module_exit(raid6_exit);
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("md-personality-8"); /* RAID6 */
diff -Nru a/drivers/md/raid6mmx.c b/drivers/md/raid6mmx.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/md/raid6mmx.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,150 @@
+/* -*- linux-c -*- ------------------------------------------------------- *
+ *
+ *   Copyright 2002 H. Peter Anvin - All Rights Reserved
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ *   Bostom MA 02111-1307, USA; either version 2 of the License, or
+ *   (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * raid6mmx.c
+ *
+ * MMX implementation of RAID-6 syndrome functions
+ */
+
+#if defined(__i386__)
+
+#include "raid6.h"
+#include "raid6x86.h"
+
+/* Shared with raid6sse1.c */
+const struct raid6_mmx_constants {
+	u64 x1d;
+} raid6_mmx_constants = {
+	0x1d1d1d1d1d1d1d1dULL,
+};
+
+static int raid6_have_mmx(void)
+{
+#ifdef __KERNEL__
+	/* Not really "boot_cpu" but "all_cpus" */
+	return boot_cpu_has(X86_FEATURE_MMX);
+#else
+	/* User space test code */
+	u32 features = cpuid_features();
+	return ( (features & (1<<23)) == (1<<23) );
+#endif
+}
+
+/*
+ * Plain MMX implementation
+ */
+static void raid6_mmx1_gen_syndrome(int disks, size_t bytes, void **ptrs)
+{
+	u8 **dptr = (u8 **)ptrs;
+	u8 *p, *q;
+	int d, z, z0;
+	raid6_mmx_save_t sa;
+
+	z0 = disks - 3;		/* Highest data disk */
+	p = dptr[z0+1];		/* XOR parity */
+	q = dptr[z0+2];		/* RS syndrome */
+
+	raid6_before_mmx(&sa);
+
+	asm volatile("movq %0,%%mm0" : : "m" (raid6_mmx_constants.x1d));
+	asm volatile("pxor %mm5,%mm5");	/* Zero temp */
+
+	for ( d = 0 ; d < bytes ; d += 8 ) {
+		asm volatile("movq %0,%%mm2" : : "m" (dptr[z0][d])); /* P[0] */
+		asm volatile("movq %mm2,%mm4");	/* Q[0] */
+		for ( z = z0-1 ; z >= 0 ; z-- ) {
+			asm volatile("movq %0,%%mm6" : : "m" (dptr[z][d]));
+			asm volatile("pcmpgtb %mm4,%mm5");
+			asm volatile("paddb %mm4,%mm4");
+			asm volatile("pand %mm0,%mm5");
+			asm volatile("pxor %mm5,%mm4");
+			asm volatile("pxor %mm5,%mm5");
+			asm volatile("pxor %mm6,%mm2");
+			asm volatile("pxor %mm6,%mm4");
+		}
+		asm volatile("movq %%mm2,%0" : "=m" (p[d]));
+		asm volatile("pxor %mm2,%mm2");
+		asm volatile("movq %%mm4,%0" : "=m" (q[d]));
+		asm volatile("pxor %mm4,%mm4");
+	}
+
+	raid6_after_mmx(&sa);
+}
+
+const struct raid6_calls raid6_mmxx1 = {
+	raid6_mmx1_gen_syndrome,
+	raid6_have_mmx,
+	"mmxx1",
+	0
+};
+
+/*
+ * Unrolled-by-2 MMX implementation
+ */
+static void raid6_mmx2_gen_syndrome(int disks, size_t bytes, void **ptrs)
+{
+	u8 **dptr = (u8 **)ptrs;
+	u8 *p, *q;
+	int d, z, z0;
+	raid6_mmx_save_t sa;
+
+	z0 = disks - 3;		/* Highest data disk */
+	p = dptr[z0+1];		/* XOR parity */
+	q = dptr[z0+2];		/* RS syndrome */
+
+	raid6_before_mmx(&sa);
+
+	asm volatile("movq %0,%%mm0" : : "m" (raid6_mmx_constants.x1d));
+	asm volatile("pxor %mm5,%mm5");	/* Zero temp */
+	asm volatile("pxor %mm7,%mm7"); /* Zero temp */
+
+	for ( d = 0 ; d < bytes ; d += 16 ) {
+		asm volatile("movq %0,%%mm2" : : "m" (dptr[z0][d])); /* P[0] */
+		asm volatile("movq %0,%%mm3" : : "m" (dptr[z0][d+8]));
+		asm volatile("movq %mm2,%mm4"); /* Q[0] */
+		asm volatile("movq %mm3,%mm6"); /* Q[1] */
+		for ( z = z0-1 ; z >= 0 ; z-- ) {
+			asm volatile("pcmpgtb %mm4,%mm5");
+			asm volatile("pcmpgtb %mm6,%mm7");
+			asm volatile("paddb %mm4,%mm4");
+			asm volatile("paddb %mm6,%mm6");
+			asm volatile("pand %mm0,%mm5");
+			asm volatile("pand %mm0,%mm7");
+			asm volatile("pxor %mm5,%mm4");
+			asm volatile("pxor %mm7,%mm6");
+			asm volatile("movq %0,%%mm5" : : "m" (dptr[z][d]));
+			asm volatile("movq %0,%%mm7" : : "m" (dptr[z][d+8]));
+			asm volatile("pxor %mm5,%mm2");
+			asm volatile("pxor %mm7,%mm3");
+			asm volatile("pxor %mm5,%mm4");
+			asm volatile("pxor %mm7,%mm6");
+			asm volatile("pxor %mm5,%mm5");
+			asm volatile("pxor %mm7,%mm7");
+		}
+		asm volatile("movq %%mm2,%0" : "=m" (p[d]));
+		asm volatile("movq %%mm3,%0" : "=m" (p[d+8]));
+		asm volatile("movq %%mm4,%0" : "=m" (q[d]));
+		asm volatile("movq %%mm6,%0" : "=m" (q[d+8]));
+	}
+
+	raid6_after_mmx(&sa);
+}
+
+const struct raid6_calls raid6_mmxx2 = {
+	raid6_mmx2_gen_syndrome,
+	raid6_have_mmx,
+	"mmxx2",
+	0
+};
+
+#endif
diff -Nru a/drivers/md/raid6recov.c b/drivers/md/raid6recov.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/md/raid6recov.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,133 @@
+/* -*- linux-c -*- ------------------------------------------------------- *
+ *
+ *   Copyright 2002 H. Peter Anvin - All Rights Reserved
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ *   Bostom MA 02111-1307, USA; either version 2 of the License, or
+ *   (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * raid6recov.c
+ *
+ * RAID-6 data recovery in dual failure mode.  In single failure mode,
+ * use the RAID-5 algorithm (or, in the case of Q failure, just reconstruct
+ * the syndrome.)
+ */
+
+#include "raid6.h"
+
+/* Recover two failed data blocks. */
+void raid6_2data_recov(int disks, size_t bytes, int faila, int failb,
+		       void **ptrs)
+{
+	u8 *p, *q, *dp, *dq;
+	u8 px, qx, db;
+	const u8 *pbmul;	/* P multiplier table for B data */
+	const u8 *qmul;		/* Q multiplier table (for both) */
+
+	p = (u8 *)ptrs[disks-2];
+	q = (u8 *)ptrs[disks-1];
+
+	/* Compute syndrome with zero for the missing data pages
+	   Use the dead data pages as temporary storage for
+	   delta p and delta q */
+	dp = (u8 *)ptrs[faila];
+	ptrs[faila] = (void *)raid6_empty_zero_page;
+	ptrs[disks-2] = dp;
+	dq = (u8 *)ptrs[failb];
+	ptrs[failb] = (void *)raid6_empty_zero_page;
+	ptrs[disks-1] = dq;
+
+	raid6_call.gen_syndrome(disks, bytes, ptrs);
+
+	/* Restore pointer table */
+	ptrs[faila]   = dp;
+	ptrs[failb]   = dq;
+	ptrs[disks-2] = p;
+	ptrs[disks-1] = q;
+
+	/* Now, pick the proper data tables */
+	pbmul = raid6_gfmul[raid6_gfexi[failb-faila]];
+	qmul  = raid6_gfmul[raid6_gfinv[raid6_gfexp[faila]^raid6_gfexp[failb]]];
+
+	/* Now do it... */
+	while ( bytes-- ) {
+		px    = *p ^ *dp;
+		qx    = qmul[*q ^ *dq];
+		*dq++ = db = pbmul[px] ^ qx; /* Reconstructed B */
+		*dp++ = db ^ px; /* Reconstructed A */
+		p++; q++;
+	}
+}
+
+
+
+
+/* Recover failure of one data block plus the P block */
+void raid6_datap_recov(int disks, size_t bytes, int faila, void **ptrs)
+{
+	u8 *p, *q, *dq;
+	const u8 *qmul;		/* Q multiplier table */
+
+	p = (u8 *)ptrs[disks-2];
+	q = (u8 *)ptrs[disks-1];
+
+	/* Compute syndrome with zero for the missing data page
+	   Use the dead data page as temporary storage for delta q */
+	dq = (u8 *)ptrs[faila];
+	ptrs[faila] = (void *)raid6_empty_zero_page;
+	ptrs[disks-1] = dq;
+
+	raid6_call.gen_syndrome(disks, bytes, ptrs);
+
+	/* Restore pointer table */
+	ptrs[faila]   = dq;
+	ptrs[disks-1] = q;
+
+	/* Now, pick the proper data tables */
+	qmul  = raid6_gfmul[raid6_gfinv[raid6_gfexp[faila]]];
+
+	/* Now do it... */
+	while ( bytes-- ) {
+		*p++ ^= *dq = qmul[*q ^ *dq];
+		q++; dq++;
+	}
+}
+
+
+#ifndef __KERNEL__		/* Testing only */
+
+/* Recover two failed blocks. */
+void raid6_dual_recov(int disks, size_t bytes, int faila, int failb, void **ptrs)
+{
+	if ( faila > failb ) {
+		int tmp = faila;
+		faila = failb;
+		failb = tmp;
+	}
+
+	if ( failb == disks-1 ) {
+		if ( faila == disks-2 ) {
+			/* P+Q failure.  Just rebuild the syndrome. */
+			raid6_call.gen_syndrome(disks, bytes, ptrs);
+		} else {
+			/* data+Q failure.  Reconstruct data from P,
+			   then rebuild syndrome. */
+			/* NOT IMPLEMENTED - equivalent to RAID-5 */
+		}
+	} else {
+		if ( failb == disks-2 ) {
+			/* data+P failure. */
+			raid6_datap_recov(disks, bytes, faila, ptrs);
+		} else {
+			/* data+data failure. */
+			raid6_2data_recov(disks, bytes, faila, failb, ptrs);
+		}
+	}
+}
+
+#endif
diff -Nru a/drivers/md/raid6sse1.c b/drivers/md/raid6sse1.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/md/raid6sse1.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,171 @@
+/* -*- linux-c -*- ------------------------------------------------------- *
+ *
+ *   Copyright 2002 H. Peter Anvin - All Rights Reserved
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ *   Bostom MA 02111-1307, USA; either version 2 of the License, or
+ *   (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * raid6sse1.c
+ *
+ * SSE-1/MMXEXT implementation of RAID-6 syndrome functions
+ *
+ * This is really an MMX implementation, but it requires SSE-1 or
+ * AMD MMXEXT for prefetch support and a few other features.  The
+ * support for nontemporal memory accesses is enough to make this
+ * worthwhile as a separate implementation.
+ */
+
+#if defined(__i386__)
+
+#include "raid6.h"
+#include "raid6x86.h"
+
+/* Defined in raid6mmx.c */
+extern const struct raid6_mmx_constants {
+	u64 x1d;
+} raid6_mmx_constants;
+
+static int raid6_have_sse1_or_mmxext(void)
+{
+#ifdef __KERNEL__
+	/* Not really boot_cpu but "all_cpus" */
+	return boot_cpu_has(X86_FEATURE_MMX) &&
+		(boot_cpu_has(X86_FEATURE_XMM) ||
+		 boot_cpu_has(X86_FEATURE_MMXEXT));
+#else
+	/* User space test code - this incorrectly breaks on some Athlons */
+	u32 features = cpuid_features();
+	return ( (features & (5<<23)) == (5<<23) );
+#endif
+}
+
+/*
+ * Plain SSE1 implementation
+ */
+static void raid6_sse11_gen_syndrome(int disks, size_t bytes, void **ptrs)
+{
+	u8 **dptr = (u8 **)ptrs;
+	u8 *p, *q;
+	int d, z, z0;
+	raid6_mmx_save_t sa;
+
+	z0 = disks - 3;		/* Highest data disk */
+	p = dptr[z0+1];		/* XOR parity */
+	q = dptr[z0+2];		/* RS syndrome */
+
+	/* This is really MMX code, not SSE */
+	raid6_before_mmx(&sa);
+
+	asm volatile("movq %0,%%mm0" : : "m" (raid6_mmx_constants.x1d));
+	asm volatile("pxor %mm5,%mm5");	/* Zero temp */
+
+	for ( d = 0 ; d < bytes ; d += 8 ) {
+		asm volatile("prefetchnta %0" : : "m" (dptr[z0][d]));
+		asm volatile("movq %0,%%mm2" : : "m" (dptr[z0][d])); /* P[0] */
+		asm volatile("prefetchnta %0" : : "m" (dptr[z0-1][d]));
+		asm volatile("movq %mm2,%mm4");	/* Q[0] */
+		asm volatile("movq %0,%%mm6" : : "m" (dptr[z0-1][d]));
+		for ( z = z0-2 ; z >= 0 ; z-- ) {
+			asm volatile("prefetchnta %0" : : "m" (dptr[z][d]));
+			asm volatile("pcmpgtb %mm4,%mm5");
+			asm volatile("paddb %mm4,%mm4");
+			asm volatile("pand %mm0,%mm5");
+			asm volatile("pxor %mm5,%mm4");
+			asm volatile("pxor %mm5,%mm5");
+			asm volatile("pxor %mm6,%mm2");
+			asm volatile("pxor %mm6,%mm4");
+			asm volatile("movq %0,%%mm6" : : "m" (dptr[z][d]));
+		}
+		asm volatile("pcmpgtb %mm4,%mm5");
+		asm volatile("paddb %mm4,%mm4");
+		asm volatile("pand %mm0,%mm5");
+		asm volatile("pxor %mm5,%mm4");
+		asm volatile("pxor %mm5,%mm5");
+		asm volatile("pxor %mm6,%mm2");
+		asm volatile("pxor %mm6,%mm4");
+
+		asm volatile("movntq %%mm2,%0" : "=m" (p[d]));
+		asm volatile("movntq %%mm4,%0" : "=m" (q[d]));
+	}
+
+	raid6_after_mmx(&sa);
+	asm volatile("sfence" : : : "memory");
+}
+
+const struct raid6_calls raid6_sse1x1 = {
+	raid6_sse11_gen_syndrome,
+	raid6_have_sse1_or_mmxext,
+	"sse1x1",
+	1			/* Has cache hints */
+};
+
+/*
+ * Unrolled-by-2 SSE1 implementation
+ */
+static void raid6_sse12_gen_syndrome(int disks, size_t bytes, void **ptrs)
+{
+	u8 **dptr = (u8 **)ptrs;
+	u8 *p, *q;
+	int d, z, z0;
+	raid6_mmx_save_t sa;
+
+	z0 = disks - 3;		/* Highest data disk */
+	p = dptr[z0+1];		/* XOR parity */
+	q = dptr[z0+2];		/* RS syndrome */
+
+	raid6_before_mmx(&sa);
+
+	asm volatile("movq %0,%%mm0" : : "m" (raid6_mmx_constants.x1d));
+	asm volatile("pxor %mm5,%mm5");	/* Zero temp */
+	asm volatile("pxor %mm7,%mm7"); /* Zero temp */
+
+	/* We uniformly assume a single prefetch covers at least 16 bytes */
+	for ( d = 0 ; d < bytes ; d += 16 ) {
+		asm volatile("prefetchnta %0" : : "m" (dptr[z0][d]));
+		asm volatile("movq %0,%%mm2" : : "m" (dptr[z0][d])); /* P[0] */
+		asm volatile("movq %0,%%mm3" : : "m" (dptr[z0][d+8])); /* P[1] */
+		asm volatile("movq %mm2,%mm4");	/* Q[0] */
+		asm volatile("movq %mm3,%mm6"); /* Q[1] */
+		for ( z = z0-1 ; z >= 0 ; z-- ) {
+			asm volatile("prefetchnta %0" : : "m" (dptr[z][d]));
+			asm volatile("pcmpgtb %mm4,%mm5");
+			asm volatile("pcmpgtb %mm6,%mm7");
+			asm volatile("paddb %mm4,%mm4");
+			asm volatile("paddb %mm6,%mm6");
+			asm volatile("pand %mm0,%mm5");
+			asm volatile("pand %mm0,%mm7");
+			asm volatile("pxor %mm5,%mm4");
+			asm volatile("pxor %mm7,%mm6");
+			asm volatile("movq %0,%%mm5" : : "m" (dptr[z][d]));
+			asm volatile("movq %0,%%mm7" : : "m" (dptr[z][d+8]));
+			asm volatile("pxor %mm5,%mm2");
+			asm volatile("pxor %mm7,%mm3");
+			asm volatile("pxor %mm5,%mm4");
+			asm volatile("pxor %mm7,%mm6");
+			asm volatile("pxor %mm5,%mm5");
+			asm volatile("pxor %mm7,%mm7");
+		}
+		asm volatile("movntq %%mm2,%0" : "=m" (p[d]));
+		asm volatile("movntq %%mm3,%0" : "=m" (p[d+8]));
+		asm volatile("movntq %%mm4,%0" : "=m" (q[d]));
+		asm volatile("movntq %%mm6,%0" : "=m" (q[d+8]));
+	}
+
+	raid6_after_mmx(&sa);
+	asm volatile("sfence" : :: "memory");
+}
+
+const struct raid6_calls raid6_sse1x2 = {
+	raid6_sse12_gen_syndrome,
+	raid6_have_sse1_or_mmxext,
+	"sse1x2",
+	1			/* Has cache hints */
+};
+
+#endif
diff -Nru a/drivers/md/raid6sse2.c b/drivers/md/raid6sse2.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/md/raid6sse2.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,270 @@
+/* -*- linux-c -*- ------------------------------------------------------- *
+ *
+ *   Copyright 2002 H. Peter Anvin - All Rights Reserved
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ *   Bostom MA 02111-1307, USA; either version 2 of the License, or
+ *   (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * raid6sse2.c
+ *
+ * SSE-2 implementation of RAID-6 syndrome functions
+ *
+ */
+
+#if defined(__i386__) || defined(__x86_64__)
+
+#include "raid6.h"
+#include "raid6x86.h"
+
+static const struct raid6_sse_constants {
+	u64 x1d[2];
+} raid6_sse_constants  __attribute__((aligned(16))) = {
+	{ 0x1d1d1d1d1d1d1d1dULL, 0x1d1d1d1d1d1d1d1dULL },
+};
+
+static int raid6_have_sse2(void)
+{
+#ifdef __KERNEL__
+	/* Not really boot_cpu but "all_cpus" */
+	return boot_cpu_has(X86_FEATURE_MMX) &&
+		boot_cpu_has(X86_FEATURE_FXSR) &&
+		boot_cpu_has(X86_FEATURE_XMM) &&
+		boot_cpu_has(X86_FEATURE_XMM2);
+#else
+	/* User space test code */
+	u32 features = cpuid_features();
+	return ( (features & (15<<23)) == (15<<23) );
+#endif
+}
+
+/*
+ * Plain SSE2 implementation
+ */
+static void raid6_sse21_gen_syndrome(int disks, size_t bytes, void **ptrs)
+{
+	u8 **dptr = (u8 **)ptrs;
+	u8 *p, *q;
+	int d, z, z0;
+	raid6_sse_save_t sa;
+
+	z0 = disks - 3;		/* Highest data disk */
+	p = dptr[z0+1];		/* XOR parity */
+	q = dptr[z0+2];		/* RS syndrome */
+
+	raid6_before_sse2(&sa);
+
+	asm volatile("movdqa %0,%%xmm0" : : "m" (raid6_sse_constants.x1d[0]));
+	asm volatile("pxor %xmm5,%xmm5");	/* Zero temp */
+
+	for ( d = 0 ; d < bytes ; d += 16 ) {
+		asm volatile("prefetchnta %0" : : "m" (dptr[z0][d]));
+		asm volatile("movdqa %0,%%xmm2" : : "m" (dptr[z0][d])); /* P[0] */
+		asm volatile("prefetchnta %0" : : "m" (dptr[z0-1][d]));
+		asm volatile("movdqa %xmm2,%xmm4"); /* Q[0] */
+		asm volatile("movdqa %0,%%xmm6" : : "m" (dptr[z0-1][d]));
+		for ( z = z0-2 ; z >= 0 ; z-- ) {
+			asm volatile("prefetchnta %0" : : "m" (dptr[z][d]));
+			asm volatile("pcmpgtb %xmm4,%xmm5");
+			asm volatile("paddb %xmm4,%xmm4");
+			asm volatile("pand %xmm0,%xmm5");
+			asm volatile("pxor %xmm5,%xmm4");
+			asm volatile("pxor %xmm5,%xmm5");
+			asm volatile("pxor %xmm6,%xmm2");
+			asm volatile("pxor %xmm6,%xmm4");
+			asm volatile("movdqa %0,%%xmm6" : : "m" (dptr[z][d]));
+		}
+		asm volatile("pcmpgtb %xmm4,%xmm5");
+		asm volatile("paddb %xmm4,%xmm4");
+		asm volatile("pand %xmm0,%xmm5");
+		asm volatile("pxor %xmm5,%xmm4");
+		asm volatile("pxor %xmm5,%xmm5");
+		asm volatile("pxor %xmm6,%xmm2");
+		asm volatile("pxor %xmm6,%xmm4");
+
+		asm volatile("movntdq %%xmm2,%0" : "=m" (p[d]));
+		asm volatile("pxor %xmm2,%xmm2");
+		asm volatile("movntdq %%xmm4,%0" : "=m" (q[d]));
+		asm volatile("pxor %xmm4,%xmm4");
+	}
+
+	raid6_after_sse2(&sa);
+	asm volatile("sfence" : : : "memory");
+}
+
+const struct raid6_calls raid6_sse2x1 = {
+	raid6_sse21_gen_syndrome,
+	raid6_have_sse2,
+	"sse2x1",
+	1			/* Has cache hints */
+};
+
+/*
+ * Unrolled-by-2 SSE2 implementation
+ */
+static void raid6_sse22_gen_syndrome(int disks, size_t bytes, void **ptrs)
+{
+	u8 **dptr = (u8 **)ptrs;
+	u8 *p, *q;
+	int d, z, z0;
+	raid6_sse_save_t sa;
+
+	z0 = disks - 3;		/* Highest data disk */
+	p = dptr[z0+1];		/* XOR parity */
+	q = dptr[z0+2];		/* RS syndrome */
+
+	raid6_before_sse2(&sa);
+
+	asm volatile("movdqa %0,%%xmm0" : : "m" (raid6_sse_constants.x1d[0]));
+	asm volatile("pxor %xmm5,%xmm5"); /* Zero temp */
+	asm volatile("pxor %xmm7,%xmm7"); /* Zero temp */
+
+	/* We uniformly assume a single prefetch covers at least 32 bytes */
+	for ( d = 0 ; d < bytes ; d += 32 ) {
+		asm volatile("prefetchnta %0" : : "m" (dptr[z0][d]));
+		asm volatile("movdqa %0,%%xmm2" : : "m" (dptr[z0][d]));    /* P[0] */
+		asm volatile("movdqa %0,%%xmm3" : : "m" (dptr[z0][d+16])); /* P[1] */
+		asm volatile("movdqa %xmm2,%xmm4"); /* Q[0] */
+		asm volatile("movdqa %xmm3,%xmm6"); /* Q[1] */
+		for ( z = z0-1 ; z >= 0 ; z-- ) {
+			asm volatile("prefetchnta %0" : : "m" (dptr[z][d]));
+			asm volatile("pcmpgtb %xmm4,%xmm5");
+			asm volatile("pcmpgtb %xmm6,%xmm7");
+			asm volatile("paddb %xmm4,%xmm4");
+			asm volatile("paddb %xmm6,%xmm6");
+			asm volatile("pand %xmm0,%xmm5");
+			asm volatile("pand %xmm0,%xmm7");
+			asm volatile("pxor %xmm5,%xmm4");
+			asm volatile("pxor %xmm7,%xmm6");
+			asm volatile("movdqa %0,%%xmm5" : : "m" (dptr[z][d]));
+			asm volatile("movdqa %0,%%xmm7" : : "m" (dptr[z][d+16]));
+			asm volatile("pxor %xmm5,%xmm2");
+			asm volatile("pxor %xmm7,%xmm3");
+			asm volatile("pxor %xmm5,%xmm4");
+			asm volatile("pxor %xmm7,%xmm6");
+			asm volatile("pxor %xmm5,%xmm5");
+			asm volatile("pxor %xmm7,%xmm7");
+		}
+		asm volatile("movntdq %%xmm2,%0" : "=m" (p[d]));
+		asm volatile("movntdq %%xmm3,%0" : "=m" (p[d+16]));
+		asm volatile("movntdq %%xmm4,%0" : "=m" (q[d]));
+		asm volatile("movntdq %%xmm6,%0" : "=m" (q[d+16]));
+	}
+
+	raid6_after_sse2(&sa);
+	asm volatile("sfence" : : : "memory");
+}
+
+const struct raid6_calls raid6_sse2x2 = {
+	raid6_sse22_gen_syndrome,
+	raid6_have_sse2,
+	"sse2x2",
+	1			/* Has cache hints */
+};
+
+#endif
+
+#ifdef __x86_64__
+
+/*
+ * Unrolled-by-4 SSE2 implementation
+ */
+static void raid6_sse24_gen_syndrome(int disks, size_t bytes, void **ptrs)
+{
+	u8 **dptr = (u8 **)ptrs;
+	u8 *p, *q;
+	int d, z, z0;
+	raid6_sse16_save_t sa;
+
+	z0 = disks - 3;		/* Highest data disk */
+	p = dptr[z0+1];		/* XOR parity */
+	q = dptr[z0+2];		/* RS syndrome */
+
+	raid6_before_sse16(&sa);
+
+	asm volatile("movdqa %0,%%xmm0" :: "m" (raid6_sse_constants.x1d[0]));
+	asm volatile("pxor %xmm2,%xmm2");	/* P[0] */
+	asm volatile("pxor %xmm3,%xmm3");	/* P[1] */
+	asm volatile("pxor %xmm4,%xmm4"); 	/* Q[0] */
+	asm volatile("pxor %xmm5,%xmm5");	/* Zero temp */
+	asm volatile("pxor %xmm6,%xmm6"); 	/* Q[1] */
+	asm volatile("pxor %xmm7,%xmm7"); 	/* Zero temp */
+	asm volatile("pxor %xmm10,%xmm10");	/* P[2] */
+	asm volatile("pxor %xmm11,%xmm11");	/* P[3] */
+	asm volatile("pxor %xmm12,%xmm12"); 	/* Q[2] */
+	asm volatile("pxor %xmm13,%xmm13");	/* Zero temp */
+	asm volatile("pxor %xmm14,%xmm14"); 	/* Q[3] */
+	asm volatile("pxor %xmm15,%xmm15"); 	/* Zero temp */
+
+	for ( d = 0 ; d < bytes ; d += 64 ) {
+		for ( z = z0 ; z >= 0 ; z-- ) {
+			/* The second prefetch seems to improve performance... */
+			asm volatile("prefetchnta %0" :: "m" (dptr[z][d]));
+			asm volatile("prefetchnta %0" :: "m" (dptr[z][d+32]));
+			asm volatile("pcmpgtb %xmm4,%xmm5");
+			asm volatile("pcmpgtb %xmm6,%xmm7");
+			asm volatile("pcmpgtb %xmm12,%xmm13");
+			asm volatile("pcmpgtb %xmm14,%xmm15");
+			asm volatile("paddb %xmm4,%xmm4");
+			asm volatile("paddb %xmm6,%xmm6");
+			asm volatile("paddb %xmm12,%xmm12");
+			asm volatile("paddb %xmm14,%xmm14");
+			asm volatile("pand %xmm0,%xmm5");
+			asm volatile("pand %xmm0,%xmm7");
+			asm volatile("pand %xmm0,%xmm13");
+			asm volatile("pand %xmm0,%xmm15");
+			asm volatile("pxor %xmm5,%xmm4");
+			asm volatile("pxor %xmm7,%xmm6");
+			asm volatile("pxor %xmm13,%xmm12");
+			asm volatile("pxor %xmm15,%xmm14");
+			asm volatile("movdqa %0,%%xmm5" :: "m" (dptr[z][d]));
+			asm volatile("movdqa %0,%%xmm7" :: "m" (dptr[z][d+16]));
+			asm volatile("movdqa %0,%%xmm13" :: "m" (dptr[z][d+32]));
+			asm volatile("movdqa %0,%%xmm15" :: "m" (dptr[z][d+48]));
+			asm volatile("pxor %xmm5,%xmm2");
+			asm volatile("pxor %xmm7,%xmm3");
+			asm volatile("pxor %xmm13,%xmm10");
+			asm volatile("pxor %xmm15,%xmm11");
+			asm volatile("pxor %xmm5,%xmm4");
+			asm volatile("pxor %xmm7,%xmm6");
+			asm volatile("pxor %xmm13,%xmm12");
+			asm volatile("pxor %xmm15,%xmm14");
+			asm volatile("pxor %xmm5,%xmm5");
+			asm volatile("pxor %xmm7,%xmm7");
+			asm volatile("pxor %xmm13,%xmm13");
+			asm volatile("pxor %xmm15,%xmm15");
+		}
+		asm volatile("movntdq %%xmm2,%0" : "=m" (p[d]));
+		asm volatile("pxor %xmm2,%xmm2");
+		asm volatile("movntdq %%xmm3,%0" : "=m" (p[d+16]));
+		asm volatile("pxor %xmm3,%xmm3");
+		asm volatile("movntdq %%xmm10,%0" : "=m" (p[d+32]));
+		asm volatile("pxor %xmm10,%xmm10");
+		asm volatile("movntdq %%xmm11,%0" : "=m" (p[d+48]));
+		asm volatile("pxor %xmm11,%xmm11");
+		asm volatile("movntdq %%xmm4,%0" : "=m" (q[d]));
+		asm volatile("pxor %xmm4,%xmm4");
+		asm volatile("movntdq %%xmm6,%0" : "=m" (q[d+16]));
+		asm volatile("pxor %xmm6,%xmm6");
+		asm volatile("movntdq %%xmm12,%0" : "=m" (q[d+32]));
+		asm volatile("pxor %xmm12,%xmm12");
+		asm volatile("movntdq %%xmm14,%0" : "=m" (q[d+48]));
+		asm volatile("pxor %xmm14,%xmm14");
+	}
+	asm volatile("sfence" : : : "memory");
+	raid6_after_sse16(&sa);
+}
+
+const struct raid6_calls raid6_sse2x4 = {
+	raid6_sse24_gen_syndrome,
+	raid6_have_sse2,
+	"sse2x4",
+	1			/* Has cache hints */
+};
+
+#endif
diff -Nru a/drivers/md/raid6test/Makefile b/drivers/md/raid6test/Makefile
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/md/raid6test/Makefile	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,58 @@
+#
+# This is a simple Makefile to test some of the RAID-6 code
+# from userspace.
+#
+
+CC	 = gcc
+OPTFLAGS = -O2			# Adjust as desired
+CFLAGS	 = -I.. -g $(OPTFLAGS)
+LD	 = ld
+PERL	 = perl
+
+.c.o:
+	$(CC) $(CFLAGS) -c -o $@ $<
+
+%.c: ../%.c
+	cp -f $< $@
+
+%.uc: ../%.uc
+	cp -f $< $@
+
+all:	raid6.o raid6test
+
+raid6.o: raid6int1.o raid6int2.o raid6int4.o raid6int8.o raid6int16.o \
+	 raid6int32.o \
+	 raid6mmx.o raid6sse1.o raid6sse2.o \
+	 raid6recov.o raid6algos.o \
+	 raid6tables.o
+	$(LD) -r -o $@ $^
+
+raid6test: raid6.o test.c
+	$(CC) $(CFLAGS) -o raid6test $^
+
+raid6int1.c: raid6int.uc ../unroll.pl
+	$(PERL) ../unroll.pl 1 < raid6int.uc > $@
+
+raid6int2.c: raid6int.uc ../unroll.pl
+	$(PERL) ../unroll.pl 2 < raid6int.uc > $@
+
+raid6int4.c: raid6int.uc ../unroll.pl
+	$(PERL) ../unroll.pl 4 < raid6int.uc > $@
+
+raid6int8.c: raid6int.uc ../unroll.pl
+	$(PERL) ../unroll.pl 8 < raid6int.uc > $@
+
+raid6int16.c: raid6int.uc ../unroll.pl
+	$(PERL) ../unroll.pl 16 < raid6int.uc > $@
+
+raid6int32.c: raid6int.uc ../unroll.pl
+	$(PERL) ../unroll.pl 32 < raid6int.uc > $@
+
+raid6tables.c: mktables
+	./mktables > raid6tables.c
+
+clean:
+	rm -f *.o mktables mktables.c raid6int.uc raid6*.c raid6test
+
+spotless: clean
+	rm -f *~
diff -Nru a/drivers/md/raid6test/test.c b/drivers/md/raid6test/test.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/md/raid6test/test.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,103 @@
+/* -*- linux-c -*- ------------------------------------------------------- *
+ *
+ *   Copyright 2002 H. Peter Anvin - All Rights Reserved
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ *   Bostom MA 02111-1307, USA; either version 2 of the License, or
+ *   (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * raid6test.c
+ *
+ * Test RAID-6 recovery with various algorithms
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "raid6.h"
+
+#define NDISKS		16	/* Including P and Q */
+
+const char raid6_empty_zero_page[PAGE_SIZE] __attribute__((aligned(256)));
+struct raid6_calls raid6_call;
+
+char *dataptrs[NDISKS];
+char data[NDISKS][PAGE_SIZE];
+char recovi[PAGE_SIZE], recovj[PAGE_SIZE];
+
+void makedata(void)
+{
+	int i, j;
+
+	for (  i = 0 ; i < NDISKS ; i++ ) {
+		for ( j = 0 ; j < PAGE_SIZE ; j++ ) {
+			data[i][j] = rand();
+		}
+		dataptrs[i] = data[i];
+	}
+}
+
+int main(int argc, char *argv[])
+{
+	const struct raid6_calls * const * algo;
+	int i, j;
+	int erra, errb;
+
+	makedata();
+
+	for ( algo = raid6_algos ; *algo ; algo++ ) {
+		if ( !(*algo)->valid || (*algo)->valid() ) {
+			raid6_call = **algo;
+
+			/* Nuke syndromes */
+			memset(data[NDISKS-2], 0xee, 2*PAGE_SIZE);
+
+			/* Generate assumed good syndrome */
+			raid6_call.gen_syndrome(NDISKS, PAGE_SIZE, (void **)&dataptrs);
+
+			for ( i = 0 ; i < NDISKS-1 ; i++ ) {
+				for ( j = i+1 ; j < NDISKS ; j++ ) {
+					memset(recovi, 0xf0, PAGE_SIZE);
+					memset(recovj, 0xba, PAGE_SIZE);
+
+					dataptrs[i] = recovi;
+					dataptrs[j] = recovj;
+
+					raid6_dual_recov(NDISKS, PAGE_SIZE, i, j, (void **)&dataptrs);
+
+					erra = memcmp(data[i], recovi, PAGE_SIZE);
+					errb = memcmp(data[j], recovj, PAGE_SIZE);
+
+					if ( i < NDISKS-2 && j == NDISKS-1 ) {
+						/* We don't implement the DQ failure scenario, since it's
+						   equivalent to a RAID-5 failure (XOR, then recompute Q) */
+					} else {
+						printf("algo=%-8s  faila=%3d(%c)  failb=%3d(%c)  %s\n",
+						       raid6_call.name,
+						       i, (i==NDISKS-2)?'P':'D',
+						       j, (j==NDISKS-1)?'Q':(j==NDISKS-2)?'P':'D',
+						       (!erra && !errb) ? "OK" :
+						       !erra ? "ERRB" :
+						       !errb ? "ERRA" :
+						       "ERRAB");
+					}
+
+					dataptrs[i] = data[i];
+					dataptrs[j] = data[j];
+				}
+			}
+		}
+		printf("\n");
+	}
+
+	printf("\n");
+	/* Pick the best algorithm test */
+	raid6_select_algo();
+
+	return 0;
+}
diff -Nru a/drivers/md/raid6x86.h b/drivers/md/raid6x86.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/md/raid6x86.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,246 @@
+#ident "$Id: raid6x86.h,v 1.3 2002/12/12 22:41:27 hpa Exp $"
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2002-2004 H. Peter Anvin - All Rights Reserved
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ *   Bostom MA 02111-1307, USA; either version 2 of the License, or
+ *   (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * raid6x86.h
+ *
+ * Definitions common to x86 and x86-64 RAID-6 code only
+ */
+
+#ifndef LINUX_RAID_RAID6X86_H
+#define LINUX_RAID_RAID6X86_H
+
+#if defined(__i386__) || defined(__x86_64__)
+
+#ifdef __x86_64__
+
+typedef struct {
+	unsigned int fsave[27];
+	unsigned long cr0;
+} raid6_mmx_save_t __attribute__((aligned(16)));
+
+/* N.B.: For SSE we only save %xmm0-%xmm7 even for x86-64, since
+   the code doesn't know about the additional x86-64 registers */
+typedef struct {
+	unsigned int sarea[8*4+2];
+	unsigned long cr0;
+} raid6_sse_save_t __attribute__((aligned(16)));
+
+/* This is for x86-64-specific code which uses all 16 XMM registers */
+typedef struct {
+	unsigned int sarea[16*4+2];
+	unsigned long cr0;
+} raid6_sse16_save_t __attribute__((aligned(16)));
+
+/* On x86-64 the stack *SHOULD* be 16-byte aligned, but currently this
+   is buggy in the kernel and it's only 8-byte aligned in places, so
+   we need to do this anyway.  Sigh. */
+#define SAREA(x) ((unsigned int *)((((unsigned long)&(x)->sarea)+15) & ~15))
+
+#else /* __i386__ */
+
+typedef struct {
+	unsigned int fsave[27];
+	unsigned long cr0;
+} raid6_mmx_save_t;
+
+/* On i386, the stack is only 8-byte aligned, but SSE requires 16-byte
+   alignment.  The +3 is so we have the slack space to manually align
+   a properly-sized area correctly.  */
+typedef struct {
+	unsigned int sarea[8*4+3];
+	unsigned long cr0;
+} raid6_sse_save_t;
+
+/* Find the 16-byte aligned save area */
+#define SAREA(x) ((unsigned int *)((((unsigned long)&(x)->sarea)+15) & ~15))
+
+#endif
+
+#ifdef __KERNEL__ /* Real code */
+
+/* Note: %cr0 is 32 bits on i386 and 64 bits on x86-64 */
+
+static inline unsigned long raid6_get_fpu(void)
+{
+	unsigned long cr0;
+
+	preempt_disable();
+	asm volatile("mov %%cr0,%0 ; clts" : "=r" (cr0));
+	return cr0;
+}
+
+static inline void raid6_put_fpu(unsigned long cr0)
+{
+	asm volatile("mov %0,%%cr0" : : "r" (cr0));
+	preempt_enable();
+}
+
+#else /* Dummy code for user space testing */
+
+static inline unsigned long raid6_get_fpu(void)
+{
+	return 0xf00ba6;
+}
+
+static inline void raid6_put_fpu(unsigned long cr0)
+{
+	(void)cr0;
+}
+
+#endif
+
+static inline void raid6_before_mmx(raid6_mmx_save_t *s)
+{
+	s->cr0 = raid6_get_fpu();
+	asm volatile("fsave %0 ; fwait" : "=m" (s->fsave[0]));
+}
+
+static inline void raid6_after_mmx(raid6_mmx_save_t *s)
+{
+	asm volatile("frstor %0" : : "m" (s->fsave[0]));
+	raid6_put_fpu(s->cr0);
+}
+
+static inline void raid6_before_sse(raid6_sse_save_t *s)
+{
+	unsigned int *rsa = SAREA(s);
+
+	s->cr0 = raid6_get_fpu();
+
+	asm volatile("movaps %%xmm0,%0" : "=m" (rsa[0]));
+	asm volatile("movaps %%xmm1,%0" : "=m" (rsa[4]));
+	asm volatile("movaps %%xmm2,%0" : "=m" (rsa[8]));
+	asm volatile("movaps %%xmm3,%0" : "=m" (rsa[12]));
+	asm volatile("movaps %%xmm4,%0" : "=m" (rsa[16]));
+	asm volatile("movaps %%xmm5,%0" : "=m" (rsa[20]));
+	asm volatile("movaps %%xmm6,%0" : "=m" (rsa[24]));
+	asm volatile("movaps %%xmm7,%0" : "=m" (rsa[28]));
+}
+
+static inline void raid6_after_sse(raid6_sse_save_t *s)
+{
+	unsigned int *rsa = SAREA(s);
+
+	asm volatile("movaps %0,%%xmm0" : : "m" (rsa[0]));
+	asm volatile("movaps %0,%%xmm1" : : "m" (rsa[4]));
+	asm volatile("movaps %0,%%xmm2" : : "m" (rsa[8]));
+	asm volatile("movaps %0,%%xmm3" : : "m" (rsa[12]));
+	asm volatile("movaps %0,%%xmm4" : : "m" (rsa[16]));
+	asm volatile("movaps %0,%%xmm5" : : "m" (rsa[20]));
+	asm volatile("movaps %0,%%xmm6" : : "m" (rsa[24]));
+	asm volatile("movaps %0,%%xmm7" : : "m" (rsa[28]));
+
+	raid6_put_fpu(s->cr0);
+}
+
+static inline void raid6_before_sse2(raid6_sse_save_t *s)
+{
+	unsigned int *rsa = SAREA(s);
+
+	s->cr0 = raid6_get_fpu();
+
+	asm volatile("movdqa %%xmm0,%0" : "=m" (rsa[0]));
+	asm volatile("movdqa %%xmm1,%0" : "=m" (rsa[4]));
+	asm volatile("movdqa %%xmm2,%0" : "=m" (rsa[8]));
+	asm volatile("movdqa %%xmm3,%0" : "=m" (rsa[12]));
+	asm volatile("movdqa %%xmm4,%0" : "=m" (rsa[16]));
+	asm volatile("movdqa %%xmm5,%0" : "=m" (rsa[20]));
+	asm volatile("movdqa %%xmm6,%0" : "=m" (rsa[24]));
+	asm volatile("movdqa %%xmm7,%0" : "=m" (rsa[28]));
+}
+
+static inline void raid6_after_sse2(raid6_sse_save_t *s)
+{
+	unsigned int *rsa = SAREA(s);
+
+	asm volatile("movdqa %0,%%xmm0" : : "m" (rsa[0]));
+	asm volatile("movdqa %0,%%xmm1" : : "m" (rsa[4]));
+	asm volatile("movdqa %0,%%xmm2" : : "m" (rsa[8]));
+	asm volatile("movdqa %0,%%xmm3" : : "m" (rsa[12]));
+	asm volatile("movdqa %0,%%xmm4" : : "m" (rsa[16]));
+	asm volatile("movdqa %0,%%xmm5" : : "m" (rsa[20]));
+	asm volatile("movdqa %0,%%xmm6" : : "m" (rsa[24]));
+	asm volatile("movdqa %0,%%xmm7" : : "m" (rsa[28]));
+
+	raid6_put_fpu(s->cr0);
+}
+
+#ifdef __x86_64__
+
+static inline void raid6_before_sse16(raid6_sse16_save_t *s)
+{
+	unsigned int *rsa = SAREA(s);
+
+	s->cr0 = raid6_get_fpu();
+
+	asm volatile("movdqa %%xmm0,%0" : "=m" (rsa[0]));
+	asm volatile("movdqa %%xmm1,%0" : "=m" (rsa[4]));
+	asm volatile("movdqa %%xmm2,%0" : "=m" (rsa[8]));
+	asm volatile("movdqa %%xmm3,%0" : "=m" (rsa[12]));
+	asm volatile("movdqa %%xmm4,%0" : "=m" (rsa[16]));
+	asm volatile("movdqa %%xmm5,%0" : "=m" (rsa[20]));
+	asm volatile("movdqa %%xmm6,%0" : "=m" (rsa[24]));
+	asm volatile("movdqa %%xmm7,%0" : "=m" (rsa[28]));
+	asm volatile("movdqa %%xmm8,%0" : "=m" (rsa[32]));
+	asm volatile("movdqa %%xmm9,%0" : "=m" (rsa[36]));
+	asm volatile("movdqa %%xmm10,%0" : "=m" (rsa[40]));
+	asm volatile("movdqa %%xmm11,%0" : "=m" (rsa[44]));
+	asm volatile("movdqa %%xmm12,%0" : "=m" (rsa[48]));
+	asm volatile("movdqa %%xmm13,%0" : "=m" (rsa[52]));
+	asm volatile("movdqa %%xmm14,%0" : "=m" (rsa[56]));
+	asm volatile("movdqa %%xmm15,%0" : "=m" (rsa[60]));
+}
+
+static inline void raid6_after_sse16(raid6_sse16_save_t *s)
+{
+	unsigned int *rsa = SAREA(s);
+
+	asm volatile("movdqa %0,%%xmm0" : : "m" (rsa[0]));
+	asm volatile("movdqa %0,%%xmm1" : : "m" (rsa[4]));
+	asm volatile("movdqa %0,%%xmm2" : : "m" (rsa[8]));
+	asm volatile("movdqa %0,%%xmm3" : : "m" (rsa[12]));
+	asm volatile("movdqa %0,%%xmm4" : : "m" (rsa[16]));
+	asm volatile("movdqa %0,%%xmm5" : : "m" (rsa[20]));
+	asm volatile("movdqa %0,%%xmm6" : : "m" (rsa[24]));
+	asm volatile("movdqa %0,%%xmm7" : : "m" (rsa[28]));
+	asm volatile("movdqa %0,%%xmm8" : : "m" (rsa[32]));
+	asm volatile("movdqa %0,%%xmm9" : : "m" (rsa[36]));
+	asm volatile("movdqa %0,%%xmm10" : : "m" (rsa[40]));
+	asm volatile("movdqa %0,%%xmm11" : : "m" (rsa[44]));
+	asm volatile("movdqa %0,%%xmm12" : : "m" (rsa[48]));
+	asm volatile("movdqa %0,%%xmm13" : : "m" (rsa[52]));
+	asm volatile("movdqa %0,%%xmm14" : : "m" (rsa[56]));
+	asm volatile("movdqa %0,%%xmm15" : : "m" (rsa[60]));
+
+	raid6_put_fpu(s->cr0);
+}
+
+#endif /* __x86_64__ */
+
+/* User space test hack */
+#ifndef __KERNEL__
+static inline int cpuid_features(void)
+{
+	u32 eax = 1;
+	u32 ebx, ecx, edx;
+
+	asm volatile("cpuid" :
+		     "+a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx));
+
+	return edx;
+}
+#endif /* ndef __KERNEL__ */
+
+#endif
+#endif
diff -Nru a/drivers/md/unroll.pl b/drivers/md/unroll.pl
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/md/unroll.pl	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,24 @@
+#!/usr/bin/perl
+#
+# Take a piece of C code and for each line which contains the sequence $$
+# repeat n times with $ replaced by 0...n-1; the sequence $# is replaced
+# by the unrolling factor, and $* with a single $
+#
+
+($n) = @ARGV;
+$n += 0;
+
+while ( defined($line = <STDIN>) ) {
+    if ( $line =~ /\$\$/ ) {
+	$rep = $n;
+    } else {
+	$rep = 1;
+    }
+    for ( $i = 0 ; $i < $rep ; $i++ ) {
+	$tmp = $line;
+	$tmp =~ s/\$\$/$i/g;
+	$tmp =~ s/\$\#/$n/g;
+	$tmp =~ s/\$\*/\$/g;
+	print $tmp;
+    }
+}
diff -Nru a/drivers/media/Kconfig b/drivers/media/Kconfig
--- a/drivers/media/Kconfig	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/Kconfig	Tue Feb  3 19:45:17 2004
@@ -34,19 +34,26 @@
 
 config VIDEO_TUNER
 	tristate
-	default y if VIDEO_BT848=y || VIDEO_SAA7134=y || VIDEO_MXB=y
-	default m if VIDEO_BT848=m || VIDEO_SAA7134=m || VIDEO_MXB=m
+	default y if VIDEO_BT848=y || VIDEO_SAA7134=y || VIDEO_MXB=y || VIDEO_CX88=y
+	default m if VIDEO_BT848=m || VIDEO_SAA7134=m || VIDEO_MXB=m || VIDEO_CX88=m
 	depends on VIDEO_DEV
 
 config VIDEO_BUF
 	tristate
-	default y if VIDEO_BT848=y || VIDEO_SAA7134=y || VIDEO_SAA7146=y
-	default m if VIDEO_BT848=m || VIDEO_SAA7134=m || VIDEO_SAA7146=m
+	default y if VIDEO_BT848=y || VIDEO_SAA7134=y || VIDEO_SAA7146=y || VIDEO_CX88=y
+	default m if VIDEO_BT848=m || VIDEO_SAA7134=m || VIDEO_SAA7146=m || VIDEO_CX88=m
 	depends on VIDEO_DEV
 
 config VIDEO_BTCX
 	tristate
-	default VIDEO_BT848
+	default y if VIDEO_BT848=y || VIDEO_CX88=y
+	default m if VIDEO_BT848=m || VIDEO_CX88=m
+	depends on VIDEO_DEV
+
+config VIDEO_IR
+	tristate
+	default y if VIDEO_BT848=y || VIDEO_SAA7134=y
+	default m if VIDEO_BT848=m || VIDEO_SAA7134=m
 	depends on VIDEO_DEV
 
 endmenu
diff -Nru a/drivers/media/common/Makefile b/drivers/media/common/Makefile
--- a/drivers/media/common/Makefile	Tue Feb  3 19:45:41 2004
+++ b/drivers/media/common/Makefile	Tue Feb  3 19:45:41 2004
@@ -3,4 +3,4 @@
 
 obj-$(CONFIG_VIDEO_SAA7146) += saa7146.o
 obj-$(CONFIG_VIDEO_SAA7146_VV) += saa7146_vv.o
-
+obj-$(CONFIG_VIDEO_IR) += ir-common.o
diff -Nru a/drivers/media/common/ir-common.c b/drivers/media/common/ir-common.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/common/ir-common.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,218 @@
+/*
+ * some common structs and functions to handle infrared remotes via
+ * input layer ...
+ *
+ * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/module.h>
+
+#include <media/ir-common.h>
+
+/* -------------------------------------------------------------------------- */
+
+MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
+MODULE_LICENSE("GPL");
+
+static int repeat = 1;
+MODULE_PARM(repeat,"i");
+MODULE_PARM_DESC(repeat,"auto-repeat for IR keys (default: on)");
+
+static int debug = 0;    /* debug level (0,1,2) */
+MODULE_PARM(debug,"i");
+
+#define dprintk(level, fmt, arg...)	if (debug >= level) \
+	printk(KERN_DEBUG fmt , ## arg)
+
+/* -------------------------------------------------------------------------- */
+
+/* generic RC5 keytable                                          */
+/* see http://users.pandora.be/nenya/electronics/rc5/codes00.htm */
+IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE] = {
+	[ 0x00 ] = KEY_KP0,             // 0
+	[ 0x01 ] = KEY_KP1,             // 1
+	[ 0x02 ] = KEY_KP2,             // 2
+	[ 0x03 ] = KEY_KP3,             // 3
+	[ 0x04 ] = KEY_KP4,             // 4
+	[ 0x05 ] = KEY_KP5,             // 5
+	[ 0x06 ] = KEY_KP6,             // 6
+	[ 0x07 ] = KEY_KP7,             // 7
+	[ 0x08 ] = KEY_KP8,             // 8
+	[ 0x09 ] = KEY_KP9,             // 9
+
+	[ 0x0b ] = KEY_CHANNEL,         // channel / program (japan: 11)
+	[ 0x0c ] = KEY_POWER,           // standby
+	[ 0x0d ] = KEY_MUTE,            // mute / demute
+	[ 0x0f ] = KEY_TV,              // display
+	[ 0x10 ] = KEY_VOLUMEUP,        // volume +
+	[ 0x11 ] = KEY_VOLUMEDOWN,      // volume -
+	[ 0x12 ] = KEY_BRIGHTNESSUP,    // brightness +
+	[ 0x13 ] = KEY_BRIGHTNESSDOWN,  // brightness -
+	[ 0x1e ] = KEY_SEARCH,          // search +
+	[ 0x20 ] = KEY_CHANNELUP,       // channel / program +
+	[ 0x21 ] = KEY_CHANNELDOWN,     // channel / program -
+	[ 0x22 ] = KEY_CHANNEL,         // alt / channel
+	[ 0x23 ] = KEY_LANGUAGE,        // 1st / 2nd language
+	[ 0x26 ] = KEY_SLEEP,           // sleeptimer
+	[ 0x2e ] = KEY_MENU,            // 2nd controls (USA: menu)
+	[ 0x30 ] = KEY_PAUSE,           // pause
+	[ 0x32 ] = KEY_REWIND,          // rewind
+	[ 0x33 ] = KEY_GOTO,            // go to
+	[ 0x35 ] = KEY_PLAY,            // play
+	[ 0x36 ] = KEY_STOP,            // stop
+	[ 0x37 ] = KEY_RECORD,          // recording
+
+#if 0 /* FIXME */
+	[ 0x0a ] = KEY_RESERVED,        // 1/2/3 digits (japan: 10)
+	[ 0x0e ] = KEY_RESERVED,        // P.P. (personal preference)
+	[ 0x14 ] = KEY_RESERVED,        // colour saturation +
+	[ 0x15 ] = KEY_RESERVED,        // colour saturation -
+	[ 0x16 ] = KEY_RESERVED,        // bass +
+	[ 0x17 ] = KEY_RESERVED,        // bass -
+	[ 0x18 ] = KEY_RESERVED,        // treble +
+	[ 0x19 ] = KEY_RESERVED,        // treble -
+	[ 0x1a ] = KEY_RESERVED,        // balance right
+	[ 0x1b ] = KEY_RESERVED,        // balance left
+	[ 0x1c ] = KEY_RESERVED,        // contrast +
+	[ 0x1d ] = KEY_RESERVED,        // contrast -
+	[ 0x1f ] = KEY_RESERVED,        // tint/hue +
+	[ 0x24 ] = KEY_RESERVED,        // spacial stereo on/off
+	[ 0x25 ] = KEY_RESERVED,        // mono / stereo (USA)
+	[ 0x27 ] = KEY_RESERVED,        // tint / hue -
+	[ 0x28 ] = KEY_RESERVED,        // RF switch/PIP select
+	[ 0x29 ] = KEY_RESERVED,        // vote
+	[ 0x2a ] = KEY_RESERVED,        // timed page/channel clck
+	[ 0x2b ] = KEY_RESERVED,        // increment (USA)
+	[ 0x2c ] = KEY_RESERVED,        // decrement (USA)
+	[ 0x2d ] = KEY_RESERVED,        // 
+	[ 0x2f ] = KEY_RESERVED,        // PIP shift
+	[ 0x31 ] = KEY_RESERVED,        // erase
+	[ 0x34 ] = KEY_RESERVED,        // wind
+	[ 0x38 ] = KEY_RESERVED,        // external 1
+	[ 0x39 ] = KEY_RESERVED,        // external 2
+	[ 0x3a ] = KEY_RESERVED,        // PIP display mode
+	[ 0x3b ] = KEY_RESERVED,        // view data mode / advance
+	[ 0x3c ] = KEY_RESERVED,        // teletext submode (Japan: 12)
+	[ 0x3d ] = KEY_RESERVED,        // system standby
+	[ 0x3e ] = KEY_RESERVED,        // crispener on/off
+	[ 0x3f ] = KEY_RESERVED,        // system select
+#endif
+};
+EXPORT_SYMBOL_GPL(ir_codes_rc5_tv);
+
+/* empty keytable, can be used as placeholder for not-yet created keytables */
+IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE] = {
+	[ 42 ] = KEY_COFFEE,
+};
+EXPORT_SYMBOL_GPL(ir_codes_empty);
+
+/* -------------------------------------------------------------------------- */
+
+static void ir_input_key_event(struct input_dev *dev, struct ir_input_state *ir)
+{
+	if (KEY_RESERVED == ir->keycode) {
+		printk(KERN_INFO "%s: unknown key: key=0x%02x raw=0x%02x down=%d\n",
+		       dev->name,ir->ir_key,ir->ir_raw,ir->keypressed);
+		return;
+	}
+	dprintk(1,"%s: key event code=%d down=%d\n",
+		dev->name,ir->keycode,ir->keypressed);
+	input_report_key(dev,ir->keycode,ir->keypressed);
+        input_sync(dev);
+}
+
+/* -------------------------------------------------------------------------- */
+
+void ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
+		   int ir_type, IR_KEYTAB_TYPE *ir_codes)
+{
+	int i;
+	
+	ir->ir_type = ir_type;
+	if (ir_codes)
+		memcpy(ir->ir_codes, ir_codes, sizeof(ir->ir_codes));
+
+        init_input_dev(dev);
+	dev->keycode     = ir->ir_codes;
+	dev->keycodesize = sizeof(IR_KEYTAB_TYPE);
+	dev->keycodemax  = IR_KEYTAB_SIZE;
+	for (i = 0; i < IR_KEYTAB_SIZE; i++)
+		set_bit(ir->ir_codes[i], dev->keybit);
+	clear_bit(0, dev->keybit);
+
+	set_bit(EV_KEY, dev->evbit);
+	if (repeat)
+		set_bit(EV_REP, dev->evbit);
+}
+
+void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir)
+{
+	if (ir->keypressed) {
+		ir->keypressed = 0;
+		ir_input_key_event(dev,ir);
+	}
+}
+
+void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir,
+		      u32 ir_key, u32 ir_raw)
+{
+	u32 keycode = IR_KEYCODE(ir->ir_codes, ir_key);
+	
+	if (ir->keypressed && ir->keycode != keycode) {
+		ir->keypressed = 0;
+		ir_input_key_event(dev,ir);
+	}
+	if (!ir->keypressed) {
+		ir->ir_key  = ir_key;
+		ir->ir_raw  = ir_raw;
+		ir->keycode = keycode;
+		ir->keypressed = 1;
+		ir_input_key_event(dev,ir);
+	}
+#if 0
+	/* maybe do something like this ??? */
+	input_event(a, EV_IR, ir->ir_type, ir->ir_raw);
+#endif
+}
+
+u32 ir_extract_bits(u32 data, u32 mask)
+{
+	int mbit, vbit;
+	u32 value;
+
+	value = 0;
+	vbit  = 0;
+	for (mbit = 0; mbit < 32; mbit++) {
+		if (!(mask & ((u32)1 << mbit)))
+			continue;
+		if (data & ((u32)1 << mbit))
+			value |= (1 << vbit);
+		vbit++;
+	}
+	return value;
+}
+
+EXPORT_SYMBOL_GPL(ir_input_init);
+EXPORT_SYMBOL_GPL(ir_input_nokey);
+EXPORT_SYMBOL_GPL(ir_input_keydown);
+EXPORT_SYMBOL_GPL(ir_extract_bits);
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff -Nru a/drivers/media/common/saa7146_core.c b/drivers/media/common/saa7146_core.c
--- a/drivers/media/common/saa7146_core.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/media/common/saa7146_core.c	Tue Feb  3 19:45:34 2004
@@ -137,7 +137,6 @@
 
 char *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct saa7146_pgtable *pt)
 {
-	struct scatterlist *slist = NULL;
 	int pages = (length+PAGE_SIZE-1)/PAGE_SIZE;
 	char *mem = vmalloc_32(length);
 	int slen = 0;
@@ -146,35 +145,36 @@
 		return NULL;
 	}
 
-	if (!(slist = vmalloc_to_sg(mem, pages))) {
+	if (!(pt->slist = vmalloc_to_sg(mem, pages))) {
 		vfree(mem);
 		return NULL;
 	}
 
 	if (saa7146_pgtable_alloc(pci, pt)) {
-		kfree(slist);
+		kfree(pt->slist);
+		pt->slist = NULL;
 		vfree(mem);
 		return NULL;
 	}
 	
-	slen = pci_map_sg(pci,slist,pages,PCI_DMA_FROMDEVICE);
-	if (0 != saa7146_pgtable_build_single(pci, pt, slist, slen)) {
+	slen = pci_map_sg(pci,pt->slist,pages,PCI_DMA_FROMDEVICE);
+	if (0 != saa7146_pgtable_build_single(pci, pt, pt->slist, slen)) {
 		return NULL;
 	}
 
-	/* fixme: here's a memory leak: slist never gets freed by any other
-	   function ...*/
 	return mem;
 }
 
 void saa7146_pgtable_free(struct pci_dev *pci, struct saa7146_pgtable *pt)
 {
-//fm	DEB_EE(("pci:%p, pt:%p\n",pci,pt));
-
 	if (NULL == pt->cpu)
 		return;
 	pci_free_consistent(pci, pt->size, pt->cpu, pt->dma);
 	pt->cpu = NULL;
+	if (NULL != pt->slist) {
+		kfree(pt->slist);
+		pt->slist = NULL;
+	}
 }
 
 int saa7146_pgtable_alloc(struct pci_dev *pci, struct saa7146_pgtable *pt)
@@ -182,11 +182,8 @@
         u32          *cpu;
         dma_addr_t   dma_addr;
 
-//fm	DEB_EE(("pci:%p, pt:%p\n",pci,pt));
-
 	cpu = pci_alloc_consistent(pci, SAA7146_PGTABLE_SIZE, &dma_addr);
 	if (NULL == cpu) {
-//fm		ERR(("pci_alloc_consistent() failed."));
 		return -ENOMEM;
 	}
 	pt->size = SAA7146_PGTABLE_SIZE;
diff -Nru a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c
--- a/drivers/media/common/saa7146_fops.c	Tue Feb  3 19:45:26 2004
+++ b/drivers/media/common/saa7146_fops.c	Tue Feb  3 19:45:26 2004
@@ -2,6 +2,65 @@
 
 #define BOARD_CAN_DO_VBI(dev)   (dev->revision != 0 && dev->vv_data->vbi_minor != -1) 
 
+/****************************************************************************/
+/* resource management functions, shamelessly stolen from saa7134 driver */
+
+int saa7146_res_get(struct saa7146_fh *fh, unsigned int bit)
+{
+	struct saa7146_dev *dev = fh->dev;
+	struct saa7146_vv *vv = dev->vv_data;
+
+	if (fh->resources & bit)
+		/* have it already allocated */
+		return 1;
+
+	/* is it free? */
+	DEB_D(("getting lock...\n"));
+	down(&dev->lock);
+	DEB_D(("got lock\n"));
+	if (vv->resources & bit) {
+		DEB_D(("locked! vv->resources:0x%02x, we want:0x%02x\n",vv->resources,bit));
+		/* no, someone else uses it */
+		up(&dev->lock);
+		return 0;
+	}
+	/* it's free, grab it */
+	fh->resources  |= bit;
+	vv->resources |= bit;
+	DEB_D(("res: get %d\n",bit));
+	up(&dev->lock);
+	return 1;
+}
+
+int saa7146_res_check(struct saa7146_fh *fh, unsigned int bit)
+{
+	return (fh->resources & bit);
+}
+
+int saa7146_res_locked(struct saa7146_dev *dev, unsigned int bit)
+{
+	struct saa7146_vv *vv = dev->vv_data;
+	return (vv->resources & bit);
+}
+
+void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits)
+{
+	struct saa7146_dev *dev = fh->dev;
+	struct saa7146_vv *vv = dev->vv_data;
+
+	if ((fh->resources & bits) != bits)
+		BUG();
+
+	DEB_D(("getting lock...\n"));
+	down(&dev->lock);
+	DEB_D(("got lock\n"));
+	fh->resources  &= ~bits;
+	vv->resources &= ~bits;
+	DEB_D(("res: put %d\n",bits));
+	up(&dev->lock);
+}
+
+
 /********************************************************************************/
 /* common dma functions */
 
@@ -216,29 +275,32 @@
 	}
 	memset(fh,0,sizeof(*fh));
 	
-	// FIXME: do we need to increase *our* usage count?
-
-	if( 0 == try_module_get(dev->ext->module)) {
-		result = -EINVAL;
-		goto out;
-	}
-
 	file->private_data = fh;
 	fh->dev = dev;
 	fh->type = type;
 
 	if( fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
 		DEB_S(("initializing vbi...\n"));
-		saa7146_vbi_uops.open(dev,file);
+		result = saa7146_vbi_uops.open(dev,file);
 	} else {
 		DEB_S(("initializing video...\n"));
-		saa7146_video_uops.open(dev,file);
+		result = saa7146_video_uops.open(dev,file);
+	}
+
+	if (0 != result) {
+		goto out;
+	}
+
+	if( 0 == try_module_get(dev->ext->module)) {
+		result = -EINVAL;
+		goto out;
 	}
 
 	result = 0;
 out:
 	if( fh != 0 && result != 0 ) {
 		kfree(fh);
+		file->private_data = NULL;
 	}
 	up(&saa7146_devices_lock);
         return result;
diff -Nru a/drivers/media/common/saa7146_hlp.c b/drivers/media/common/saa7146_hlp.c
--- a/drivers/media/common/saa7146_hlp.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/media/common/saa7146_hlp.c	Tue Feb  3 19:45:30 2004
@@ -1,10 +1,6 @@
+#include <linux/kernel.h>
 #include <media/saa7146_vv.h>
 
-#define my_min(type,x,y) \
-	({ type __x = (x), __y = (y); __x < __y ? __x: __y; })
-#define my_max(type,x,y) \
-	({ type __x = (x), __y = (y); __x > __y ? __x: __y; })
-
 static void calculate_output_format_register(struct saa7146_dev* saa, u32 palette, u32* clip_format)
 {
 	/* clear out the necessary bits */
@@ -152,8 +148,7 @@
 	if( 1 == xpsc ) {
 		xacm = 1;
 		dcgx = 0;
-	}
-	else {
+	} else {
 		xacm = 0;
 		/* get best match in the table of attenuations
 		   for horizontal scaling */
@@ -268,8 +263,7 @@
 		ype = ysci / 16;
 		ypo = ype + (ysci / 64);
 		
-	}
-	else {
+	} else {
 		yacm = 1;	
 
 		/* calculate scaling increment */
@@ -285,8 +279,7 @@
 						... */
 		if ( ysci < 512) {
 			yacl = 0;
-		}
-		else {
+		} else {
 			yacl = ( ysci / (1024 - ysci) );
 		}
 
@@ -401,11 +394,11 @@
 		b = y[i]+h[i];
 		
 		/* insert left/right coordinates */
-		pixel_list[ 2*i   ] = my_min(int, l, width);
-		pixel_list[(2*i)+1] = my_min(int, r, width);
+		pixel_list[ 2*i   ] = min_t(int, l, width);
+		pixel_list[(2*i)+1] = min_t(int, r, width);
 		/* insert top/bottom coordinates */
-		line_list[ 2*i   ] = my_min(int, t, height);
-		line_list[(2*i)+1] = my_min(int, b, height);
+		line_list[ 2*i   ] = min_t(int, t, height);
+		line_list[(2*i)+1] = min_t(int, b, height);
 	}
 
 	/* sort and eliminate lists */
@@ -414,9 +407,9 @@
 	sort_and_eliminate( &line_list[0], &cnt_line );
 
 	/* calculate the number of used u32s */
-	numdwords = my_max(int, (cnt_line+1), (cnt_pixel+1))*2; 
-	numdwords = my_max(int, 4, numdwords);
-	numdwords = my_min(int, 64, numdwords);
+	numdwords = max_t(int, (cnt_line+1), (cnt_pixel+1))*2;
+	numdwords = max_t(int, 4, numdwords);
+	numdwords = min_t(int, 64, numdwords);
 
 	/* fill up cliptable */
 	for(i = 0; i < cnt_pixel; i++) {
@@ -488,33 +481,31 @@
  	saa7146_write(dev, MC2, (MASK_05 | MASK_21));
  
  	/* disable video dma2 */
-	saa7146_write(dev, MC1, (MASK_21));
+	saa7146_write(dev, MC1, MASK_21);
 }
 
-static void saa7146_set_clipping_rect(struct saa7146_dev *dev, struct saa7146_fh *fh)
+static void saa7146_set_clipping_rect(struct saa7146_fh *fh)
 {
+	struct saa7146_dev *dev = fh->dev;
 	enum v4l2_field field = fh->ov.win.field;
-	int clipcount = fh->ov.nclips;
-	
 	struct	saa7146_video_dma vdma2;
-
-	u32 clip_format	= saa7146_read(dev, CLIP_FORMAT_CTRL);
-	u32 arbtr_ctrl	= saa7146_read(dev, PCI_BT_V1);
-
-	// fixme: is this used at all? SAA7146_CLIPPING_RECT_INVERTED;
-	u32 type = SAA7146_CLIPPING_RECT;
+	u32 clip_format;
+	u32 arbtr_ctrl;
 
 	/* check clipcount, disable clipping if clipcount == 0*/
-	if( clipcount == 0 ) {
+	if( fh->ov.nclips == 0 ) {
 		saa7146_disable_clipping(dev);
 		return;
 	}
 
+	clip_format = saa7146_read(dev, CLIP_FORMAT_CTRL);
+	arbtr_ctrl = saa7146_read(dev, PCI_BT_V1);
+
 	calculate_clipping_registers_rect(dev, fh, &vdma2, &clip_format, &arbtr_ctrl, field);
 
 	/* set clipping format */
 	clip_format &= 0xffff0008;
-	clip_format |= (type << 4);
+	clip_format |= (SAA7146_CLIPPING_RECT << 4);
 
 	/* prepare video dma2 */
 	saa7146_write(dev, BASE_EVEN2,		vdma2.base_even);
@@ -660,25 +651,28 @@
 	vv->current_hps_sync = sync;
 } 
 
-/* reprogram hps, enable(1) / disable(0) video */
-void saa7146_set_overlay(struct saa7146_dev *dev, struct saa7146_fh *fh, int v)
+int saa7146_enable_overlay(struct saa7146_fh *fh)
 {
+	struct saa7146_dev *dev = fh->dev;
 	struct saa7146_vv *vv = dev->vv_data;
 
-	/* enable ? */
-	if( 0 == v) {
-		/* disable video dma1 */
-      		saa7146_write(dev, MC1, MASK_22);
-		return;
-	}
-
 	saa7146_set_window(dev, fh->ov.win.w.width, fh->ov.win.w.height, fh->ov.win.field);
 	saa7146_set_position(dev, fh->ov.win.w.left, fh->ov.win.w.top, fh->ov.win.w.height, fh->ov.win.field);
 	saa7146_set_output_format(dev, vv->ov_fmt->trans);
-	saa7146_set_clipping_rect(dev, fh);
+	saa7146_set_clipping_rect(fh);
 
 	/* enable video dma1 */
 	saa7146_write(dev, MC1, (MASK_06 | MASK_22));
+	return 0;
+}
+
+void saa7146_disable_overlay(struct saa7146_fh *fh)
+{
+	struct saa7146_dev *dev = fh->dev;
+
+	/* disable clipping + video dma1 */
+ 	saa7146_disable_clipping(dev);
+	saa7146_write(dev, MC1, MASK_22);
 }		
 
 void saa7146_write_out_dma(struct saa7146_dev* dev, int which, struct saa7146_video_dma* vdma) 
@@ -692,15 +686,8 @@
 	/* calculate starting address */
 	where  = (which-1)*0x18;
 
-/*
-	if( 0 != (dev->ext_vv_data->flags & SAA7146_EXT_SWAP_ODD_EVEN)) {
-		saa7146_write(dev, where, 	vdma->base_even);
-		saa7146_write(dev, where+0x04, 	vdma->base_odd);
-	} else {
-*/
 		saa7146_write(dev, where, 	vdma->base_odd);
 		saa7146_write(dev, where+0x04, 	vdma->base_even);
-//	}
 	saa7146_write(dev, where+0x08, 	vdma->prot_addr);
 	saa7146_write(dev, where+0x0c, 	vdma->pitch);
 	saa7146_write(dev, where+0x10, 	vdma->base_page);
@@ -937,7 +924,7 @@
 	}	
 
 	saa7146_write_out_dma(dev, 1, &vdma1);
-	if( sfmt->swap != 0 ) {
+	if( (sfmt->flags & FORMAT_BYTE_SWAP) != 0 ) {
 		saa7146_write_out_dma(dev, 3, &vdma2);
 		saa7146_write_out_dma(dev, 2, &vdma3);
 	} else {
@@ -955,13 +942,6 @@
 	unsigned long e_wait = vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? CMD_E_FID_A : CMD_E_FID_B;
 	unsigned long o_wait = vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? CMD_O_FID_A : CMD_O_FID_B;
 
-/*
-	if( 0 != (dev->ext_vv_data->flags & SAA7146_EXT_SWAP_ODD_EVEN)) {
-		unsigned long tmp = e_wait;
-		e_wait = o_wait;
-		o_wait = tmp;
-	}
-*/
 	/* wait for o_fid_a/b / e_fid_a/b toggle only if rps register 0 is not set*/
 	WRITE_RPS0(CMD_PAUSE | CMD_OAN | CMD_SIG0 | o_wait);
 	WRITE_RPS0(CMD_PAUSE | CMD_OAN | CMD_SIG0 | e_wait);
diff -Nru a/drivers/media/common/saa7146_vbi.c b/drivers/media/common/saa7146_vbi.c
--- a/drivers/media/common/saa7146_vbi.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/media/common/saa7146_vbi.c	Tue Feb  3 19:45:16 2004
@@ -366,7 +366,7 @@
 	init_waitqueue_head(&vv->vbi_wq);
 }
 
-static void vbi_open(struct saa7146_dev *dev, struct file *file)
+static int vbi_open(struct saa7146_dev *dev, struct file *file)
 {
 	struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data;
 	
@@ -375,6 +375,12 @@
 	
 	DEB_VBI(("dev:%p, fh:%p\n",dev,fh));
 
+	ret = saa7146_res_get(fh, RESOURCE_DMA3_BRS);
+	if (0 == ret) {
+		DEB_S(("cannot get vbi RESOURCE_DMA3_BRS resource\n"));
+		return -EBUSY;
+	}
+
 	/* adjust arbitrition control for video dma 3 */
 	arbtr_ctrl &= ~0x1f0000;
 	arbtr_ctrl |=  0x1d0000;
@@ -419,6 +425,7 @@
 
 	/* upload brs register */
 	saa7146_write(dev, MC2, (MASK_08|MASK_24));		
+	return 0;
 }
 
 static void vbi_close(struct saa7146_dev *dev, struct file *file)
@@ -430,6 +437,7 @@
 	if( fh == vv->vbi_streaming ) {
 		vbi_stop(fh, file);
 	}
+	saa7146_res_free(fh, RESOURCE_DMA3_BRS);
 }
 
 static void vbi_irq_done(struct saa7146_dev *dev, unsigned long status)
diff -Nru a/drivers/media/common/saa7146_video.c b/drivers/media/common/saa7146_video.c
--- a/drivers/media/common/saa7146_video.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/media/common/saa7146_video.c	Tue Feb  3 19:45:30 2004
@@ -12,48 +12,55 @@
 		.pixelformat	= V4L2_PIX_FMT_RGB332,
 		.trans 		= RGB08_COMPOSED,
 		.depth		= 8,
+		.flags		= 0,
 	}, {
-		.name 		= "RGB-16 (5/B-6/G-5/R)", 	/* really? */
+		.name 		= "RGB-16 (5/B-6/G-5/R)",
 		.pixelformat	= V4L2_PIX_FMT_RGB565,
 		.trans 		= RGB16_COMPOSED,
 		.depth		= 16,
+		.flags		= 0,
 	}, {
 		.name 		= "RGB-24 (B-G-R)",
 		.pixelformat	= V4L2_PIX_FMT_BGR24,
 		.trans 		= RGB24_COMPOSED,
 		.depth		= 24,
+		.flags		= 0,
 	}, {
 		.name 		= "RGB-32 (B-G-R)",
 		.pixelformat	= V4L2_PIX_FMT_BGR32,
 		.trans 		= RGB32_COMPOSED,
 		.depth		= 32,
+		.flags		= 0,
 	}, {
 		.name 		= "Greyscale-8",
 		.pixelformat	= V4L2_PIX_FMT_GREY,
 		.trans 		= Y8,
 		.depth		= 8,
+		.flags		= 0,
 	}, {
 		.name 		= "YUV 4:2:2 planar (Y-Cb-Cr)",
 		.pixelformat	= V4L2_PIX_FMT_YUV422P,
 		.trans 		= YUV422_DECOMPOSED,
 		.depth		= 16,
-		.swap		= 1,
+		.flags		= FORMAT_BYTE_SWAP|FORMAT_IS_PLANAR,
 	}, {
 		.name 		= "YVU 4:2:0 planar (Y-Cb-Cr)",
 		.pixelformat	= V4L2_PIX_FMT_YVU420,
 		.trans 		= YUV420_DECOMPOSED,
 		.depth		= 12,
-		.swap		= 1,
+		.flags		= FORMAT_BYTE_SWAP|FORMAT_IS_PLANAR,
 	}, {
 		.name 		= "YUV 4:2:0 planar (Y-Cb-Cr)",
 		.pixelformat	= V4L2_PIX_FMT_YUV420,
 		.trans 		= YUV420_DECOMPOSED,
 		.depth		= 12,
+		.flags		= FORMAT_IS_PLANAR,
 	}, {
 		.name 		= "YUV 4:2:2 (U-Y-V-Y)",
 		.pixelformat	= V4L2_PIX_FMT_UYVY,
 		.trans 		= YUV422_COMPOSED,
 		.depth		= 16,
+		.flags		= 0,
 	}
 };
 
@@ -243,13 +250,13 @@
 {
 	struct saa7146_dev *dev = fh->dev;
 	struct saa7146_vv *vv = dev->vv_data;
-	int err = 0;
+	int ret = 0, err = 0;
 
 	DEB_EE(("dev:%p, fh:%p\n",dev,fh));
 
 	/* check if we have overlay informations */
 	if( NULL == fh->ov.fh ) {
-		DEB_D(("not overlay data available. try S_FMT first.\n"));
+		DEB_D(("no overlay data available. try S_FMT first.\n"));
 		return -EAGAIN;
 	}
 
@@ -280,7 +287,11 @@
 		fh->ov.win.w.left,fh->ov.win.w.top,
 		vv->ov_fmt->name,v4l2_field_names[fh->ov.win.field]));
 	
-	saa7146_set_overlay(dev, fh, 1);
+	if (0 != (ret = saa7146_enable_overlay(fh))) {
+		vv->ov_data = NULL;
+		DEB_D(("enabling overlay failed: %d\n",ret));
+		return ret;
+	}
 
 	return 0;
 }
@@ -290,7 +301,7 @@
 	struct saa7146_dev *dev = fh->dev;
 	struct saa7146_vv *vv = dev->vv_data;
 
-	DEB_EE(("saa7146.o: saa7146_stop_preview()\n"));
+	DEB_EE(("dev:%p, fh:%p\n",dev,fh));
 
 	/* check if overlay is running */
 	if( 0 == vv->ov_data ) {
@@ -300,11 +311,11 @@
 
 	if( fh != vv->ov_data->fh ) {
 		DEB_D(("overlay is active, but for another open.\n"));
-		return -EBUSY;
+		return 0;
 	}
 
-	saa7146_set_overlay(dev, fh, 0);
 	vv->ov_data = NULL;
+	saa7146_disable_overlay(fh);
 	
 	return 0;
 }
@@ -675,21 +686,37 @@
 {
 	struct saa7146_dev *dev = fh->dev;
 	struct saa7146_vv *vv = dev->vv_data;
+	struct saa7146_format *fmt = NULL;
 	unsigned long flags;
+	unsigned int resource;
+	int ret = 0;
 
 	DEB_EE(("dev:%p, fh:%p\n",dev,fh));
 
 	if( fh == vv->streaming ) {
 		DEB_S(("already capturing.\n"));
-		return 0;
+		return -EBUSY;
 	}
 	if( vv->streaming != 0 ) {
 		DEB_S(("already capturing, but in another open.\n"));
 		return -EBUSY;
 	}
 
-	/* fixme: check for planar formats here, if we will interfere with
-	   vbi capture for example */	
+	fmt = format_by_fourcc(dev,fh->video_fmt.pixelformat);
+	/* we need to have a valid format set here */
+	BUG_ON(NULL == fmt);
+
+	if (0 != (fmt->flags & FORMAT_IS_PLANAR)) {
+		resource = RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP|RESOURCE_DMA3_BRS;
+	} else {
+		resource = RESOURCE_DMA1_HPS;
+	}
+
+	ret = saa7146_res_get(fh, resource);
+	if (0 == ret) {
+		DEB_S(("cannot get capture resource %d\n",resource));
+		return -EBUSY;
+	}
 
 	spin_lock_irqsave(&dev->slock,flags);
 
@@ -708,8 +735,10 @@
 {
 	struct saa7146_dev *dev = fh->dev;
 	struct saa7146_vv *vv = dev->vv_data;
+	struct saa7146_format *fmt = NULL;
 	unsigned long flags;
-	
+	unsigned int resource;
+	u32 dmas = 0;
 	DEB_EE(("dev:%p, fh:%p\n",dev,fh));
 
 	if( vv->streaming != fh ) {
@@ -717,6 +746,19 @@
 		return -EINVAL;
 	}
 
+	fmt = format_by_fourcc(dev,fh->video_fmt.pixelformat);
+	/* we need to have a valid format set here */
+	BUG_ON(NULL == fmt);
+
+	if (0 != (fmt->flags & FORMAT_IS_PLANAR)) {
+		resource = RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP|RESOURCE_DMA3_BRS;
+		dmas = MASK_22 | MASK_21 | MASK_20;
+	} else {
+		resource = RESOURCE_DMA1_HPS;
+		dmas = MASK_22;
+	}
+	saa7146_res_free(fh, resource);
+
 	spin_lock_irqsave(&dev->slock,flags);
 
 	/* disable rps0  */
@@ -725,14 +767,8 @@
 	/* disable rps0 irqs */
 	IER_DISABLE(dev, MASK_27);
 
-	// fixme: only used formats here!
-	/* fixme: look at planar formats here, especially at the
-	   shutdown of planar formats! */
-
 	/* shut down all used video dma transfers */
-	/* fixme: what about the budget-dvb cards? they use
-	   video-dma3, but video_end should not get called anyway ...*/
-	saa7146_write(dev, MC1, 0x00700000);
+	saa7146_write(dev, MC1, dmas);
 
 	vv->streaming = NULL;
 
@@ -849,8 +885,12 @@
 			return -EINVAL;
 		}
 		
-		down(&dev->lock);
+		/* planar formats are not allowed for overlay video, clipping and video dma would clash */
+		if (0 != (fmt->flags & FORMAT_IS_PLANAR)) {
+			DEB_S(("planar pixelformat '%4.4s' not allowed for overlay\n",(char *)&fmt->pixelformat));
+		}
 
+		down(&dev->lock);
 		if( vv->ov_data != NULL ) {
 			ov_fh = vv->ov_data->fh;
 			saa7146_stop_preview(ov_fh);
@@ -1002,7 +1042,9 @@
 			return -EBUSY;
 		}
 
+		DEB_D(("before getting lock...\n"));
 		down(&dev->lock);
+		DEB_D(("got lock\n"));
 
 		if( vv->ov_data != NULL ) {
 			ov_fh = vv->ov_data->fh;
@@ -1047,22 +1089,36 @@
 		if( 0 != on ) {
 			if( vv->ov_data != NULL ) {
 				if( fh != vv->ov_data->fh) {
+					DEB_D(("overlay already active in another open\n"));
 					return -EAGAIN;
 				}
 			}
+
+			if (0 == saa7146_res_get(fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP)) {
+				DEB_D(("cannot get overlay resources\n"));
+				return -EBUSY;
+			}
+
 			spin_lock_irqsave(&dev->slock,flags);
 			err = saa7146_start_preview(fh);
 			spin_unlock_irqrestore(&dev->slock,flags);
-		} else {
+			return err;
+		}
+
 			if( vv->ov_data != NULL ) {
 				if( fh != vv->ov_data->fh) {
+				DEB_D(("overlay is active, but in another open\n"));
 					return -EAGAIN;
 				}
+		} else {
+			DEB_D(("overlay is not active\n"));
+			return 0;		
 			}
 			spin_lock_irqsave(&dev->slock,flags);
 			err = saa7146_stop_preview(fh);
 			spin_unlock_irqrestore(&dev->slock,flags);
-		}
+		/* free resources */
+		saa7146_res_free(fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP);
 		return err;
 	}
 	case VIDIOC_REQBUFS: {
@@ -1093,7 +1149,13 @@
 		int *type = arg;
 		DEB_D(("VIDIOC_STREAMON, type:%d\n",*type));
 
-		if( 0 != (err = video_begin(fh))) {
+		if( fh == vv->streaming ) {
+			DEB_D(("already capturing.\n"));
+			return 0;
+		}
+
+		err = video_begin(fh);
+		if( 0 != err) {
 				return err;
 			}
 		err = videobuf_streamon(file,q);
@@ -1103,6 +1165,12 @@
 		int *type = arg;
 
 		DEB_D(("VIDIOC_STREAMOFF, type:%d\n",*type));
+
+		if( fh != vv->streaming ) {
+			DEB_D(("this open is not capturing.\n"));
+			return -EINVAL;
+		}
+
 		err = videobuf_streamoff(file,q);
 		video_end(fh, file);
 		return err;
@@ -1309,7 +1377,7 @@
 }
 
 
-static void video_open(struct saa7146_dev *dev, struct file *file)
+static int video_open(struct saa7146_dev *dev, struct file *file)
 {
 	struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data;
 	struct saa7146_format *sfmt;
@@ -1329,6 +1397,8 @@
 			    sizeof(struct saa7146_buf));
 
 	init_MUTEX(&fh->video_q.lock);
+
+	return 0;
 }
 
 
@@ -1381,20 +1451,35 @@
 
 	DEB_EE(("called.\n"));
 
+	/* fixme: should we allow read() captures while streaming capture? */
+	if( 0 != vv->streaming ) {
+		DEB_S(("already capturing.\n"));
+		return -EBUSY;
+	}
+
+	/* stop any active overlay */
 	if( vv->ov_data != NULL ) {
 		ov_fh = vv->ov_data->fh;
 		saa7146_stop_preview(ov_fh);
+		saa7146_res_free(ov_fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP);
 		restart_overlay = 1;
 	}
 
-	if( 0 != video_begin(fh)) {
-		return -EAGAIN;
+	ret = video_begin(fh);
+	if( 0 != ret) {
+		goto out;
 	}
+
 	ret = videobuf_read_one(file,&fh->video_q , data, count, ppos);
 	video_end(fh, file);
 
+out:
 	/* restart overlay if it was active before */
 	if( 0 != restart_overlay ) {
+		if (0 == saa7146_res_get(ov_fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP)) {
+			DEB_D(("cannot get overlay resources again!\n"));
+			BUG();
+		}
 		saa7146_start_preview(ov_fh);
 	}
 	
diff -Nru a/drivers/media/dvb/dvb-core/dvb_demux.c b/drivers/media/dvb/dvb-core/dvb_demux.c
--- a/drivers/media/dvb/dvb-core/dvb_demux.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/dvb/dvb-core/dvb_demux.c	Tue Feb  3 19:45:17 2004
@@ -395,17 +395,35 @@
 	}
 }
 
+#define DVR_FEED(f)							\
+	(((f)->type == DMX_TYPE_TS) &&					\
+	((f)->feed.ts.is_filtering) &&					\
+	(((f)->ts_type & (TS_PACKET|TS_PAYLOAD_ONLY)) == TS_PACKET))
 
 void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf)
 {
 	struct dvb_demux_feed *feed;
 	struct list_head *pos, *head=&demux->feed_list;
 	u16 pid = ts_pid(buf);
+	int dvr_done = 0;
 
 	list_for_each(pos, head) {
 		feed = list_entry(pos, struct dvb_demux_feed, list_head);
-		if (feed->pid == pid)
+
+		if ((feed->pid != pid) && (feed->pid != 0x2000))
+			continue;
+
+		/* copy each packet only once to the dvr device, even
+		 * if a PID is in multiple filters (e.g. video + PCR) */
+		if ((DVR_FEED(feed)) && (dvr_done++))
+			continue;
+
+		if (feed->pid == pid) {
 			dvb_dmx_swfilter_packet_type (feed, buf);
+			if (DVR_FEED(feed))
+				continue;
+		}
+
 		if (feed->pid == 0x2000)
 			feed->cb.ts(buf, 188, 0, 0, &feed->feed.ts, DMX_OK);
 	}
diff -Nru a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c	Tue Feb  3 19:45:17 2004
@@ -67,6 +67,7 @@
 	pid_t thread_pid;
 	unsigned long release_jiffies;
 	unsigned long lost_sync_jiffies;
+	int acquire_signal;
 	int bending;
 	int lnb_drift;
 	int timeout_count;
@@ -305,6 +306,7 @@
 		fe->lost_sync_count = 0;
 		fe->lost_sync_jiffies = jiffies;
 		fe->lnb_drift = 0;
+		fe->acquire_signal = 1;
 		if (fe->status & ~FE_TIMEDOUT)
 			dvb_frontend_add_event (fe, 0);
 		memcpy (&fe->parameters, param,
@@ -364,6 +366,9 @@
  */
 static void dvb_frontend_recover (struct dvb_frontend_data *fe)
 {
+	int j = fe->lost_sync_count;
+	int stepsize;
+
 	dprintk ("%s\n", __FUNCTION__);
 
 #if 0
@@ -383,10 +388,6 @@
 	/**
 	 *  let's start a zigzag scan to compensate LNB drift...
 	 */
-	{
-		int j = fe->lost_sync_count;
-		int stepsize;
-		
 		if (fe->info->type == FE_QPSK)
 			stepsize = fe->parameters.u.qpsk.symbol_rate / 16000;
 		else if (fe->info->type == FE_QAM)
@@ -403,7 +404,6 @@
 		}
 
 		dvb_frontend_set_parameters (fe, &fe->parameters, 0);
-	}
 
 	dvb_frontend_internal_ioctl (&fe->frontend, FE_RESET, NULL);
 }
@@ -467,13 +467,19 @@
 		if (s & FE_HAS_LOCK) {
 			fe->timeout_count = 0;
 			fe->lost_sync_count = 0;
+			fe->acquire_signal = 0;
 		} else {
 			fe->lost_sync_count++;
 			if (!(fe->info->caps & FE_CAN_RECOVER)) {
 				if (!(fe->info->caps & FE_CAN_CLEAN_SETUP)) {
-					if (fe->lost_sync_count < 10)
+					if (fe->lost_sync_count < 10) {
+						if (fe->acquire_signal)
+							dvb_frontend_internal_ioctl(
+									&fe->frontend,
+									FE_RESET, NULL);
 						continue;
 				}
+				}
 				dvb_frontend_recover (fe);
 				delay = HZ/5;
 			}
@@ -589,6 +595,9 @@
 		break;
 	case FE_SET_FRONTEND:
 		err = dvb_frontend_set_parameters (fe, parg, 1);
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(1);
+		wake_up_interruptible(&fe->wait_queue);
 		break;
 	case FE_GET_EVENT:
 		err = dvb_frontend_get_event (fe, parg, file->f_flags);
diff -Nru a/drivers/media/dvb/frontends/alps_tdmb7.c b/drivers/media/dvb/frontends/alps_tdmb7.c
--- a/drivers/media/dvb/frontends/alps_tdmb7.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/dvb/frontends/alps_tdmb7.c	Tue Feb  3 19:45:17 2004
@@ -374,7 +374,7 @@
 		cx22700_set_inversion (i2c, p->inversion);
                 cx22700_set_tps (i2c, &p->u.ofdm);
 		cx22700_writereg (i2c, 0x37, 0x01);  /* PAL loop filter off */
-		cx22700_writereg (i2c, 0x00, 0x01);  /* restart aquire */
+		cx22700_writereg (i2c, 0x00, 0x01);  /* restart acquire */
                 break;
         }
 
diff -Nru a/drivers/media/dvb/frontends/nxt6000.c b/drivers/media/dvb/frontends/nxt6000.c
--- a/drivers/media/dvb/frontends/nxt6000.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/media/dvb/frontends/nxt6000.c	Tue Feb  3 19:45:34 2004
@@ -123,7 +123,19 @@
 	struct nxt6000_config *nxt = FE2NXT(fe);
 
 	return nxt6000_read(fe->i2c, nxt->demod_addr, reg);
+}
+
+static int pll_test(struct dvb_i2c_bus *i2c, u8 demod_addr, u8 tuner_addr)
+{
+	u8 buf [1];
+	struct i2c_msg msg = {.addr = tuner_addr >> 1,.flags = I2C_M_RD,.buf = buf,.len = 1 };
+	int ret;
 
+	nxt6000_write(i2c, demod_addr, ENABLE_TUNER_IIC, 0x01);	/* open i2c bus switch */
+	ret = i2c->xfer(i2c, &msg, 1);
+	nxt6000_write(i2c, demod_addr, ENABLE_TUNER_IIC, 0x00);	/* close i2c bus switch */
+
+	return (ret != 1) ? -EFAULT : 0;
 }
 
 static int pll_write(struct dvb_i2c_bus *i2c, u8 demod_addr, u8 tuner_addr, u8 *buf, u8 len)
@@ -833,21 +845,21 @@
 		if (nxt6000_read(i2c, demod_addr_tbl[addr_nr], OFDM_MSC_REV) != NXT6000ASICDEVICE)
 			continue;
 
-		if (pll_write(i2c, demod_addr_tbl[addr_nr], 0xC0, NULL, 0) == 0) {
+		if (pll_test(i2c, demod_addr_tbl[addr_nr], 0xC0) == 0) {
 			nxt->tuner_addr = 0xC0;
 			nxt->tuner_type = TUNER_TYPE_ALP510;
 			nxt->clock_inversion = 1;
 	
 			dprintk("nxt6000: detected TI ALP510 tuner at 0x%02X\n", nxt->tuner_addr);
 		
-		} else if (pll_write(i2c, demod_addr_tbl[addr_nr], 0xC2, NULL, 0) == 0) {
+		} else if (pll_test(i2c, demod_addr_tbl[addr_nr], 0xC2) == 0) {
 			nxt->tuner_addr = 0xC2;
 			nxt->tuner_type = TUNER_TYPE_SP5659;
 			nxt->clock_inversion = 0;
 
 			dprintk("nxt6000: detected MITEL SP5659 tuner at 0x%02X\n", nxt->tuner_addr);
 		
-		} else if (pll_write(i2c, demod_addr_tbl[addr_nr], 0xC0, NULL, 0) == 0) {
+		} else if (pll_test(i2c, demod_addr_tbl[addr_nr], 0xC0) == 0) {
 			nxt->tuner_addr = 0xC0;
 			nxt->tuner_type = TUNER_TYPE_SP5730;
 			nxt->clock_inversion = 0;
diff -Nru a/drivers/media/dvb/frontends/ves1x93.c b/drivers/media/dvb/frontends/ves1x93.c
--- a/drivers/media/dvb/frontends/ves1x93.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/dvb/frontends/ves1x93.c	Tue Feb  3 19:45:17 2004
@@ -395,9 +395,6 @@
 	else
 		ves1x93_writereg (i2c, 0x05, init_1x93_tab[0x05] & 0x7f);
 
-	ves1x93_writereg (i2c, 0x00, 0x00);
-	ves1x93_writereg (i2c, 0x00, 0x01);
-
 	/* ves1993 hates this, will lose lock */
 	if (demod_type != DEMOD_VES1993)
 		ves1x93_clr_bit (i2c);
diff -Nru a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig
--- a/drivers/media/dvb/ttpci/Kconfig	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/dvb/ttpci/Kconfig	Tue Feb  3 19:45:17 2004
@@ -66,6 +66,9 @@
 	  (so called Budget- or Nova-PCI cards) without onboard
 	  MPEG2 decoder, but with onboard Common Interface connector.
 
+	  Note: The Common Interface is not yet supported by this driver
+	  due to lack of information from the vendor.
+
 	  Say Y if you own such a card and want to use it.
 
 	  To compile this driver as a module, choose M here: the
diff -Nru a/drivers/media/dvb/ttpci/Makefile b/drivers/media/dvb/ttpci/Makefile
--- a/drivers/media/dvb/ttpci/Makefile	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/dvb/ttpci/Makefile	Tue Feb  3 19:45:17 2004
@@ -3,7 +3,7 @@
 # and the AV7110 DVB device driver
 #
 
-dvb-ttpci-objs := av7110.o av7110_ipack.o av7110_ir.o
+dvb-ttpci-objs := av7110_hw.o av7110_v4l.o av7110_av.o av7110_ca.o av7110.o av7110_ipack.o av7110_ir.o
 
 obj-$(CONFIG_DVB_BUDGET) += budget-core.o budget.o ttpci-eeprom.o
 obj-$(CONFIG_DVB_BUDGET_AV) += budget-core.o budget-av.o ttpci-eeprom.o
diff -Nru a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
--- a/drivers/media/dvb/ttpci/av7110.c	Tue Feb  3 19:45:33 2004
+++ b/drivers/media/dvb/ttpci/av7110.c	Tue Feb  3 19:45:33 2004
@@ -1,5 +1,6 @@
 /*
- * av7110.c: driver for the SAA7146 based AV110 cards (like the Fujitsu-Siemens DVB)
+ * driver for the SAA7146 based AV110 cards (like the Fujitsu-Siemens DVB)
+ * av7110.c: initialization and demux stuff
  *
  * Copyright (C) 1999-2002 Ralph  Metzler 
  *                       & Marcus Metzler for convergence integrated media GmbH
@@ -28,45 +29,28 @@
  * the project's page is at http://www.linuxtv.org/dvb/
  */
 
-#define NEW_CI 1
 
-/* for debugging ARM communication: */
-//#define COM_DEBUG
-
-#define __KERNEL_SYSCALLS__
 #include <linux/module.h>
 #include <linux/kmod.h>
 #include <linux/delay.h>
 #include <linux/fs.h>
 #include <linux/timer.h>
 #include <linux/poll.h>
-#include <linux/unistd.h>
 #include <linux/byteorder/swabb.h>
 #include <linux/smp_lock.h>
-#include <stdarg.h>
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/types.h>
 #include <linux/fcntl.h>
 #include <linux/interrupt.h>
-#include <linux/ptrace.h>
-#include <linux/ioport.h>
-#include <linux/in.h>
 #include <linux/string.h>
 #include <linux/pci.h>
 #include <linux/vmalloc.h>
-#include <linux/netdevice.h>
-#include <linux/inetdevice.h>
-#include <linux/etherdevice.h>
-#include <linux/skbuff.h>
 #include <linux/firmware.h>
 #include <linux/crc32.h>
 
 #include <asm/system.h>
-#include <asm/bitops.h>
-#include <asm/io.h>
-#include <asm/dma.h>
 #include <asm/semaphore.h>
 
 #include <linux/dvb/frontend.h>
@@ -76,31 +60,19 @@
 #include "dvb_functions.h"
 
 
-#if 1 
 	#define DEBUG_VARIABLE av7110_debug
-#else
-	#define DEB_S(x) 
-	#define DEB_D(x) 
-	#define DEB_EE(x)
-#endif
 
 #include "ttpci-eeprom.h"
 #include "av7110.h"
+#include "av7110_hw.h"
+#include "av7110_av.h"
+#include "av7110_ca.h"
 #include "av7110_ipack.h"
 
-static int AV_StartPlay(struct av7110 *av7110, int av);
-static void restart_feeds(struct av7110 *av7110);
-static int bootarm(struct av7110 *av7110);
-static inline int i2c_writereg(struct av7110 *av7110, u8 id, u8 reg, u8 val);
-static inline u8 i2c_readreg(struct av7110 *av7110, u8 id, u8 reg);
-static int  outcom(struct av7110 *av7110, int type, int com, int num, ...);
-static void SetMode(struct av7110 *av7110, int mode);
-static void dvb_video_add_event (struct av7110 *av7110, struct video_event *event);
 
-void pes_to_ts(u8 const *buf, long int length, u16 pid, struct av7110_p2t *p);
-void p_to_t(u8 const *buf, long int length, u16 pid, u8 *counter, struct dvb_demux_feed *feed);
+static void restart_feeds(struct av7110 *av7110);
 
-static int av7110_debug = 0;
+int av7110_debug = 0;
 
 static int vidmode=CVBS_RGB_OUT;
 static int pids_off;
@@ -110,183 +82,15 @@
 
 int av7110_num = 0;
 
-#define FW_CI_LL_SUPPORT(arm_app) ((arm_app) & 0x80000000)
-#define FW_VERSION(arm_app)       ((arm_app) & 0x0000FFFF)
-
-/****************************************************************************
- * DEBI functions
- ****************************************************************************/
-
-#define wait_for_debi_done(x) \
-       saa7146_wait_for_debi_done(x->dev) \
-
-/* This DEBI code is based on the Stradis driver 
-   by Nathan Laredo <laredo@gnu.org> */
-
-static int debiwrite(struct av7110 *av7110, u32 config, 
-                     int addr, u32 val, int count)
-{
-        struct saa7146_dev *dev = av7110->dev;
-	u32 cmd;
-
-	if (count <= 0 || count > 32764)
-		return -1;
-	if (wait_for_debi_done(av7110) < 0)
-		return -1;
-	saa7146_write(dev, DEBI_CONFIG, config);
-	if (count <= 4)		/* immediate transfer */
-		saa7146_write(dev, DEBI_AD, val );
-	else			/* block transfer */
-		saa7146_write(dev, DEBI_AD, av7110->debi_bus);
-	saa7146_write(dev, DEBI_COMMAND, (cmd = (count << 17) | (addr & 0xffff)));
-	saa7146_write(dev, MC2, (2 << 16) | 2);
-	return 0;
-}
-
-static u32 debiread(struct av7110 *av7110, u32 config, int addr, int count)
-{
-        struct saa7146_dev *dev = av7110->dev;
-	u32 result = 0;
-
-	if (count > 32764 || count <= 0)
-		return 0;
-	if (wait_for_debi_done(av7110) < 0)
-		return 0;
-	saa7146_write(dev, DEBI_AD, av7110->debi_bus);
-	saa7146_write(dev, DEBI_COMMAND, (count << 17) | 0x10000 | (addr & 0xffff));
-
-	saa7146_write(dev, DEBI_CONFIG, config);
-	saa7146_write(dev, MC2, (2 << 16) | 2);
-	if (count > 4)	
-		return count;
-	wait_for_debi_done(av7110);
-	result = saa7146_read(dev, DEBI_AD);
-        result &= (0xffffffffUL >> ((4-count)*8));
-	return result;
-}
-
-
-/* DEBI during interrupt */
-/* single word writes */
-static inline void iwdebi(struct av7110 *av7110, u32 config, int addr, u32 val, int count)
-{
-        debiwrite(av7110, config, addr, val, count);
-}
-
-/* buffer writes */
-static inline void mwdebi(struct av7110 *av7110, u32 config, int addr, char *val, int count)
-{
-	memcpy(av7110->debi_virt, val, count);
-        debiwrite(av7110, config, addr, 0, count);
-}
-
-
-static inline u32 irdebi(struct av7110 *av7110, u32 config, int addr, u32 val, int count)
-{
-        u32 res;
-
-        res=debiread(av7110, config, addr, count);
-        if (count<=4) 
-                memcpy(av7110->debi_virt, (char *) &res, count);
-        return res;
-}
-
-/* DEBI outside interrupts, only for count<=4! */
-
-static inline void wdebi(struct av7110 *av7110, u32 config, int addr, u32 val, int count)
-{
-        unsigned long flags;
-
-        spin_lock_irqsave(&av7110->debilock, flags);
-        debiwrite(av7110, config, addr, val, count);
-        spin_unlock_irqrestore(&av7110->debilock, flags);
-}
-
-static inline u32 rdebi(struct av7110 *av7110, u32 config, int addr, u32 val, int count)
-{
-        unsigned long flags;
-        u32 res;
-
-        spin_lock_irqsave(&av7110->debilock, flags);
-        res=debiread(av7110, config, addr, count);
-        spin_unlock_irqrestore(&av7110->debilock, flags);
-        return res;
-}
-
-
-static inline char chtrans(char c)
-{
-        if (c<32 || c>126)
-                c=0x20;
-        return c;
-}
-
-
-/* handle mailbox registers of the dual ported RAM */
-
-static inline void ARM_ResetMailBox(struct av7110 *av7110)
-{
-        unsigned long flags;
-
-	DEB_EE(("av7110: %p\n",av7110));
-
-        spin_lock_irqsave(&av7110->debilock, flags);
-        debiread(av7110, DEBINOSWAP, IRQ_RX, 2);
-        //printk("dvb: IRQ_RX=%d\n", debiread(av7110, DEBINOSWAP, IRQ_RX, 2));
-        debiwrite(av7110, DEBINOSWAP, IRQ_RX, 0, 2);
-        spin_unlock_irqrestore(&av7110->debilock, flags);
-}
-
-static inline void ARM_ClearMailBox(struct av7110 *av7110)
-{
-        iwdebi(av7110, DEBINOSWAP, IRQ_RX, 0, 2);
-}
-
-static inline void ARM_ClearIrq(struct av7110 *av7110)
-{
-	irdebi(av7110, DEBINOSWAP, IRQ_RX, 0, 2);
-}
-
-static void reset_arm(struct av7110 *av7110)
-{
-        saa7146_setgpio(av7110->dev, RESET_LINE, SAA7146_GPIO_OUTLO);
-
-        /* Disable DEBI and GPIO irq */
-	IER_DISABLE(av7110->dev, (MASK_19 | MASK_03));
-//        saa7146_write(av7110->dev, IER, 
-//                      saa7146_read(av7110->dev, IER) & ~(MASK_19 | MASK_03));
-        saa7146_write(av7110->dev, ISR, (MASK_19 | MASK_03));
-
-        mdelay(800);
-        saa7146_setgpio(av7110->dev, RESET_LINE, SAA7146_GPIO_OUTHI);
-        mdelay(800);
-
-        ARM_ResetMailBox(av7110); 
-
-        saa7146_write(av7110->dev, ISR, (MASK_19 | MASK_03));
-
-	IER_ENABLE(av7110->dev, MASK_03);
-//        saa7146_write(av7110->dev, IER, 
-//                      saa7146_read(av7110->dev, IER) | MASK_03 );
-
-        av7110->arm_ready=1;
-        printk("av7110: ARM RESET\n");
-}
 
 static void recover_arm(struct av7110 *av7110)
 {
 	DEB_EE(("av7110: %p\n",av7110));
 
-        if (current->files)
-                bootarm(av7110);
-        else {
-                printk("OOPS, no current->files\n");
-                reset_arm(av7110);
-        }
-
+	av7110_bootarm(av7110);
         dvb_delay(100); 
         restart_feeds(av7110);
-        outcom(av7110, COMTYPE_PIDFILTER, SetIR, 1, av7110->ir_config);
+	av7110_fw_cmd(av7110, COMTYPE_PIDFILTER, SetIR, 1, av7110->ir_config);
 }
 
 static void arm_error(struct av7110 *av7110)
@@ -340,149 +144,6 @@
 }
 
 
-static int record_cb(struct dvb_filter_pes2ts *p2t, u8 *buf, size_t len)
-{
-        struct dvb_demux_feed *dvbdmxfeed=(struct dvb_demux_feed *) p2t->priv;
-
-//	DEB_EE(("struct dvb_filter_pes2ts:%p\n",p2t));
-
-        if (!(dvbdmxfeed->ts_type & TS_PACKET)) 
-                return 0;
-	if (buf[3]==0xe0)        // video PES do not have a length in TS
-                buf[4]=buf[5]=0;
-        if (dvbdmxfeed->ts_type & TS_PAYLOAD_ONLY) 
-                return dvbdmxfeed->cb.ts(buf, len, 0, 0, 
-                                         &dvbdmxfeed->feed.ts, DMX_OK); 
-        else
-                return dvb_filter_pes2ts(p2t, buf, len, 1);
-}
-
-static int dvb_filter_pes2ts_cb(void *priv, unsigned char *data)
-{
-        struct dvb_demux_feed *dvbdmxfeed=(struct dvb_demux_feed *) priv;
-
-//	DEB_EE(("dvb_demux_feed:%p\n",dvbdmxfeed));
-        
-        dvbdmxfeed->cb.ts(data, 188, 0, 0,
-                          &dvbdmxfeed->feed.ts,
-                          DMX_OK); 
-        return 0;
-}
-
-static int AV_StartRecord(struct av7110 *av7110, int av,
-               struct dvb_demux_feed *dvbdmxfeed)
-{
-        struct dvb_demux *dvbdmx=dvbdmxfeed->demux;
-  
-	DEB_EE(("av7110: %p, dvb_demux_feed:%p\n",av7110,dvbdmxfeed));
-
-        if (av7110->playing||(av7110->rec_mode&av))
-                return -EBUSY;
-        outcom(av7110, COMTYPE_REC_PLAY, __Stop, 0);
-        dvbdmx->recording=1;
-        av7110->rec_mode|=av;
-
-        switch (av7110->rec_mode) {
-        case RP_AUDIO:
-                dvb_filter_pes2ts_init (&av7110->p2t[0],
-					dvbdmx->pesfilter[0]->pid,
-					dvb_filter_pes2ts_cb,
-					(void *)dvbdmx->pesfilter[0]);
-                outcom(av7110, COMTYPE_REC_PLAY, __Record, 2, AudioPES, 0);
-                break;
-
-	case RP_VIDEO:
-                dvb_filter_pes2ts_init (&av7110->p2t[1],
-					dvbdmx->pesfilter[1]->pid,
-					dvb_filter_pes2ts_cb,
-					(void *)dvbdmx->pesfilter[1]);
-                outcom(av7110, COMTYPE_REC_PLAY, __Record, 2, VideoPES, 0);
-                break;
-
-	case RP_AV:
-                dvb_filter_pes2ts_init (&av7110->p2t[0],
-					dvbdmx->pesfilter[0]->pid,
-					dvb_filter_pes2ts_cb,
-					(void *)dvbdmx->pesfilter[0]);
-                dvb_filter_pes2ts_init (&av7110->p2t[1],
-					dvbdmx->pesfilter[1]->pid,
-					dvb_filter_pes2ts_cb,
-					(void *)dvbdmx->pesfilter[1]);
-                outcom(av7110, COMTYPE_REC_PLAY, __Record, 2, AV_PES, 0);
-                break;
-        }
-        return 0;
-}
-
-static int AV_StartPlay(struct av7110 *av7110, int av)
-{
-	DEB_EE(("av7110: %p\n",av7110));
-	
-        if (av7110->rec_mode)
-                return -EBUSY;
-        if (av7110->playing&av)
-                return -EBUSY;
-
-        outcom(av7110, COMTYPE_REC_PLAY, __Stop, 0);
-
-        if (av7110->playing == RP_NONE) {
-                av7110_ipack_reset(&av7110->ipack[0]);
-                av7110_ipack_reset(&av7110->ipack[1]);
-        }
-
-        av7110->playing|=av;
-        switch (av7110->playing) {
-        case RP_AUDIO:
-                outcom(av7110, COMTYPE_REC_PLAY, __Play, 2, AudioPES, 0);
-                break;
-        case RP_VIDEO:
-                outcom(av7110, COMTYPE_REC_PLAY, __Play, 2, VideoPES, 0);
-                av7110->sinfo=0;
-                break;
-        case RP_AV:
-                av7110->sinfo=0;
-                outcom(av7110, COMTYPE_REC_PLAY, __Play, 2, AV_PES, 0);
-                break;
-        }
-        return av7110->playing;
-}
-
-static void AV_Stop(struct av7110 *av7110, int av)
-{
-	DEB_EE(("av7110: %p\n",av7110));
-
-	if (!(av7110->playing&av) && !(av7110->rec_mode&av))
-                return;
-
-        outcom(av7110, COMTYPE_REC_PLAY, __Stop, 0);
-        if (av7110->playing) {
-                av7110->playing&=~av;
-                switch (av7110->playing) {
-                case RP_AUDIO:
-                        outcom(av7110, COMTYPE_REC_PLAY, __Play, 2, AudioPES, 0);
-                        break;
-                case RP_VIDEO:
-                        outcom(av7110, COMTYPE_REC_PLAY, __Play, 2, VideoPES, 0);
-                        break;
-                case RP_NONE:
-                        SetMode(av7110, av7110->vidmode);
-                        break;
-                }
-        } else {
-                av7110->rec_mode&=~av;
-                switch (av7110->rec_mode) {
-                case RP_AUDIO:
-                        outcom(av7110, COMTYPE_REC_PLAY, __Record, 2, AudioPES, 0);
-                        break;
-                case RP_VIDEO:
-                        outcom(av7110, COMTYPE_REC_PLAY, __Record, 2, VideoPES, 0);
-                        break;
-                case RP_NONE:
-                        break;
-                }
-        }
-}
-
 /**
  *  Hack! we save the last av7110 ptr. This should be ok, since
  *  you rarely will use more then one IR control. 
@@ -501,7 +162,7 @@
 		last = av7110;
 
 	if (av7110) {
-		outcom(av7110, COMTYPE_PIDFILTER, SetIR, 1, ir_config);
+		av7110_fw_cmd(av7110, COMTYPE_PIDFILTER, SetIR, 1, ir_config);
 		av7110->ir_config = ir_config;
 	}
 }
@@ -510,13 +171,13 @@
 
 void av7110_register_irc_handler(void (*func)(u32)) 
 {
-        //DEB_EE(("registering %08x\n",func));
+	DEB_EE(("registering %p\n", func));
         irc_handler = func;
 }
 
 void av7110_unregister_irc_handler(void (*func)(u32)) 
 {
-        //DEB_EE(("unregistering %08x\n",func));
+	DEB_EE(("unregistering %p\n", func));
         irc_handler = NULL;
 }
 
@@ -539,39 +200,6 @@
  * IRQ handling
  ****************************************************************************/
 
-void CI_handle(struct av7110 *av7110, u8 *data, u16 len) 
-{
-        //CI_out(av7110, data, len);
-
-	DEB_EE(("av7110: %p\n",av7110));
-
-        if (len<3)
-                return;
-        switch (data[0]) {
-        case CI_MSG_CI_INFO:
-                if (data[2]!=1 && data[2]!=2)
-                        break;
-                switch (data[1]) {
-                case 0:
-                        av7110->ci_slot[data[2]-1].flags=0;
-                        break;
-                case 1:
-                        av7110->ci_slot[data[2]-1].flags|=CA_CI_MODULE_PRESENT;
-                        break;
-                case 2:
-                        av7110->ci_slot[data[2]-1].flags|=CA_CI_MODULE_READY;
-                        break;
-                }
-                break;
-        case CI_SWITCH_PRG_REPLY:
-                //av7110->ci_stat=data[1];
-                break;
-        default:
-                break;
-        }
-
-}
-
 static inline int DvbDmxFilterCallback(u8 * buffer1, size_t buffer1_len,
                      u8 * buffer2, size_t buffer2_len,
                      struct dvb_demux_filter *dvbdmxfilter,
@@ -614,7 +242,7 @@
                                                          &dvbdmxfilter->feed->feed.ts,
                                                          DMX_OK); 
                 else
-                        pes_to_ts(buffer1, buffer1_len, 
+			av7110_p2t_write(buffer1, buffer1_len,
                                   dvbdmxfilter->feed->pid, 
                                   &av7110->p2t_filter[dvbdmxfilter->index]);
 	default:
@@ -623,15 +251,6 @@
 }
 
 
-u8 pshead[0x26] = {
-        0x00, 0x00, 0x01, 0xba, 0x5f, 0xff, 0xfe, 0xe6, 
-        0xc4, 0x01, 0x01, 0x89, 0xc3, 0xf8, 0x00, 0x00,
-        0x01, 0xbb, 0x00, 0x12, 0x80, 0xc4, 0xe1, 0x00,
-        0xe1, 0xff, 0xb9, 0xe0, 0xe8, 0xb8, 0xc0, 0x20,
-        0xbd, 0xe0, 0x44, 0xbf, 0xe0, 0x02,
-};								
-
-
 //#define DEBUG_TIMING
 static inline void print_time(char *s)
 {
@@ -642,19 +261,6 @@
 #endif
 }
 
-static void ci_get_data(struct dvb_ringbuffer *cibuf, u8 *data, int len)
-{
-        if (dvb_ringbuffer_free(cibuf) < len+2)
-                return;
-
-        DVB_RINGBUFFER_WRITE_BYTE(cibuf,len>>8);
-        DVB_RINGBUFFER_WRITE_BYTE(cibuf,len&0xff);   
-
-        dvb_ringbuffer_write(cibuf,data,len,0);
-
-        wake_up_interruptible(&cibuf->queue);
-}
-
 static void debiirq (unsigned long data)
 {
 	struct av7110 *av7110 = (struct av7110*) data;
@@ -669,7 +275,9 @@
         saa7146_write(av7110->dev, ISR, MASK_19 );
 
         if (type==-1) {
-                printk("DEBI irq oops @ %ld, psr:0x%08x, ssr:0x%08x\n",jiffies,saa7146_read(av7110->dev,PSR),saa7146_read(av7110->dev,SSR));
+		printk("DEBI irq oops @ %ld, psr:0x%08x, ssr:0x%08x\n",
+		       jiffies, saa7146_read(av7110->dev, PSR),
+		       saa7146_read(av7110->dev, SSR));
 		spin_lock(&av7110->debilock);
                 ARM_ClearMailBox(av7110);
                 ARM_ClearIrq(av7110);
@@ -692,7 +300,7 @@
 
         case DATA_PES_RECORD:
                 if (av7110->demux.recording) 
-                        record_cb(&av7110->p2t[handle], 
+			av7110_record_cb(&av7110->p2t[handle],
                                   (u8 *)av7110->debi_virt,
                                   av7110->debilen);
                 spin_lock(&av7110->debilock);
@@ -785,50 +393,6 @@
         spin_unlock(&av7110->debilock);
 }
 
-static int pes_play(void *dest, struct dvb_ringbuffer *buf, int dlen)
-{
-        int len;
-        u32 sync;
-        u16 blen;
-
-	DEB_EE(("dvb_ring_buffer_t: %p\n",buf));
-
-        if (!dlen) {
-                wake_up(&buf->queue);
-                return -1;
-        }
-        while (1) {
-                if ((len=dvb_ringbuffer_avail(buf)) < 6)
-                        return -1;
-                sync= DVB_RINGBUFFER_PEEK(buf,0)<<24;
-                sync|=DVB_RINGBUFFER_PEEK(buf,1)<<16;
-                sync|=DVB_RINGBUFFER_PEEK(buf,2)<<8;
-                sync|=DVB_RINGBUFFER_PEEK(buf,3);
-                
-                if (((sync&~0x0f)==0x000001e0) ||
-                    ((sync&~0x1f)==0x000001c0) ||
-                    (sync==0x000001bd))
-                        break;
-                printk("resync\n");
-                DVB_RINGBUFFER_SKIP(buf,1);
-        }
-        blen= DVB_RINGBUFFER_PEEK(buf,4)<<8;
-        blen|=DVB_RINGBUFFER_PEEK(buf,5);
-        blen+=6;
-        if (len<blen || blen>dlen) {
-                //printk("buffer empty - avail %d blen %u dlen %d\n",len,blen,dlen);
-                wake_up(&buf->queue);
-                return -1;
-        }
-
-        (void)dvb_ringbuffer_read(buf,dest,(size_t)blen,0);
-
-        DEB_S(("pread=0x%08lx, pwrite=0x%08lx\n",(unsigned long)buf->pread, (unsigned long)buf->pwrite));
-        wake_up(&buf->queue);
-        return blen;
-}
-
-
 static void gpioirq (unsigned long data)
 {
 	struct av7110 *av7110 = (struct av7110*) data;
@@ -838,7 +402,9 @@
         //printk("GPIO0 irq\n");        
 
         if (av7110->debitype !=-1)
-                printk("GPIO0 irq oops @ %ld, psr:0x%08x, ssr:0x%08x\n",jiffies,saa7146_read(av7110->dev,PSR),saa7146_read(av7110->dev,SSR));
+		printk("GPIO0 irq oops @ %ld, psr:0x%08x, ssr:0x%08x\n",
+		       jiffies, saa7146_read(av7110->dev, PSR),
+		       saa7146_read(av7110->dev, SSR));
        
         spin_lock(&av7110->debilock);
 
@@ -850,10 +416,9 @@
 
         av7110->debitype = irdebi(av7110, DEBINOSWAP, IRQ_STATE, 0, 2);
         av7110->debilen  = irdebi(av7110, DEBINOSWAP, IRQ_STATE_EXT, 0, 2);
-        av7110->debibuf  = 0;
         rxbuf=irdebi(av7110, DEBINOSWAP, RX_BUFF, 0, 2);
         txbuf=irdebi(av7110, DEBINOSWAP, TX_BUFF, 0, 2);
-        len=(av7110->debilen+3)&(~3);
+	len = (av7110->debilen + 3) & ~3;
 
 //        DEB_D(("GPIO0 irq %d %d\n", av7110->debitype, av7110->debilen));
         print_time("gpio");
@@ -933,10 +498,11 @@
                 wake_up(&cibuf->queue);
                 iwdebi(av7110, DEBINOSWAP, TX_LEN, len, 2);
                 iwdebi(av7110, DEBINOSWAP, IRQ_STATE_EXT, len, 2);
-                wait_for_debi_done(av7110);
+		saa7146_wait_for_debi_done(av7110->dev);
                 saa7146_write(av7110->dev, IER, 
                               saa7146_read(av7110->dev, IER) | MASK_19 );
-                if (len<5) len=5; /* we want a real DEBI DMA */
+		if (len < 5)
+			len = 5; /* we want a real DEBI DMA */
                 iwdebi(av7110, DEBISWAB, DPRAM_BASE+txbuf, 0, (len+3)&~3);
                 spin_unlock(&av7110->debilock);
                 return;
@@ -952,13 +518,13 @@
                 len=0;
                 if (av7110->debitype&0x100) {
                         spin_lock(&av7110->aout.lock);
-                        len=pes_play(av7110->debi_virt, &av7110->aout, 2048);
+			len=av7110_pes_play(av7110->debi_virt, &av7110->aout, 2048);
                         spin_unlock(&av7110->aout.lock);
                 }
                 if (len<=0 && (av7110->debitype&0x200)
                         &&av7110->videostate.play_state!=VIDEO_FREEZED) {
                         spin_lock(&av7110->avout.lock);
-                        len=pes_play(av7110->debi_virt, &av7110->avout, 2048);
+			len=av7110_pes_play(av7110->debi_virt, &av7110->avout, 2048);
                         spin_unlock(&av7110->avout.lock);
                 }
                 if (len<=0) {
@@ -970,7 +536,7 @@
                 DEB_D(("GPIO0 PES_PLAY len=%04x\n", len));        
                 iwdebi(av7110, DEBINOSWAP, TX_LEN, len, 2);
                 iwdebi(av7110, DEBINOSWAP, IRQ_STATE_EXT, len, 2);
-                wait_for_debi_done(av7110);
+		saa7146_wait_for_debi_done(av7110->dev);
                 saa7146_write(av7110->dev, IER, 
                               saa7146_read(av7110->dev, IER) | MASK_19 );
 
@@ -997,10 +563,11 @@
                 memcpy(av7110->debi_virt, av7110->bmpbuf+av7110->bmpp, len);
                 av7110->bmpp+=len;
                 av7110->bmplen-=len;
-                wait_for_debi_done(av7110);
+		saa7146_wait_for_debi_done(av7110->dev);
                 saa7146_write(av7110->dev, IER, 
                               saa7146_read(av7110->dev, IER) | MASK_19 );
-                if (len<5) len=5; /* we want a real DEBI DMA */
+		if (len < 5)
+			len = 5; /* we want a real DEBI DMA */
                 iwdebi(av7110, DEBISWAB, DPRAM_BASE+txbuf, 0, (len+3)&~3);
                 spin_unlock(&av7110->debilock);
                 return;
@@ -1013,10 +580,12 @@
                 if (!len || len>4*1024) {
                         iwdebi(av7110, DEBINOSWAP, RX_BUFF, 0, 2);
                         break;
-                }                  /* yes, fall through */
+		}
+		/* fall through */
+
         case DATA_TS_RECORD:
         case DATA_PES_RECORD:
-                wait_for_debi_done(av7110);
+		saa7146_wait_for_debi_done(av7110->dev);
                 saa7146_write(av7110->dev, IER, 
                               saa7146_read(av7110->dev, IER) | MASK_19);
                 irdebi(av7110, DEBISWAB, DPRAM_BASE+rxbuf, 0, len);
@@ -1024,7 +593,7 @@
                 return;
 
         case DATA_DEBUG_MESSAGE:
-                wait_for_debi_done(av7110);
+		saa7146_wait_for_debi_done(av7110->dev);
                 if (!len || len>0xff) {
                         iwdebi(av7110, DEBINOSWAP, RX_BUFF, 0, 2);
                         break;
@@ -1052,786 +621,20 @@
 }
 
 
-/****************************************************************************
- * DEBI command polling 
- ****************************************************************************/
-
-
-static int OutCommand(struct av7110 *av7110, u16* buf, int length)
-{
-        int i;
-        u32 start;
-#ifdef COM_DEBUG
-        u32 stat;
-#endif
-
-//	DEB_EE(("av7110: %p\n",av7110));
-
-	if (!av7110->arm_ready) {
-		DEB_D(("arm not ready.\n"));
-		return -1;
-	}
-
-        start = jiffies;
-        while ( rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 ) )
-        {
-                dvb_delay(1);
-                if ((jiffies - start) > ARM_WAIT_FREE) {
-			printk(KERN_ERR "%s: timeout waiting for COMMAND idle\n", __FUNCTION__);
-                        return -1;
-                }
-        }
-
-#ifndef _NOHANDSHAKE
-        start = jiffies;
-        while ( rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 ) )
-        {
-                dvb_delay(1);
-                if ((jiffies - start) > ARM_WAIT_SHAKE) {
-			printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__);
-                        return -1;
-                }
-        }
-#endif
-
-        start = jiffies;
-        while ( rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2) & OSDQFull )
-        {
-                dvb_delay(1);
-                if ((jiffies - start) > ARM_WAIT_OSD) {
-			printk(KERN_ERR "%s: timeout waiting for !OSDQFull\n", __FUNCTION__);
-			return -1;
-                }
-        }
-        for (i=2; i<length; i++)
-                wdebi(av7110, DEBINOSWAP, COMMAND + 2*i, (u32) buf[i], 2);
-
-        if (length)
-                wdebi(av7110, DEBINOSWAP, COMMAND + 2, (u32) buf[1], 2);
-        else
-                wdebi(av7110, DEBINOSWAP, COMMAND + 2, 0, 2);
-
-        wdebi(av7110, DEBINOSWAP, COMMAND, (u32) buf[0], 2);
-
-#ifdef COM_DEBUG
-        start = jiffies;
-        while ( rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 ) )
-        {
-                dvb_delay(1);
-                if ((jiffies - start) > ARM_WAIT_FREE) {
-                        printk(KERN_ERR "%s: timeout waiting for COMMAND to complete\n", __FUNCTION__);
-                        return -1;
-                }
-        }
-
-	stat = rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2);
-	if (stat & GPMQOver) {
-		printk(KERN_ERR "%s: GPMQOver\n", __FUNCTION__);
-		return -1;
-	}
-	else if (stat & OSDQOver) {
-		printk(KERN_ERR "%s: OSDQOver\n", __FUNCTION__);
-		return -1;
-	}
-#endif
-
-        return 0;
-}
-
-static inline int SOutCommand(struct av7110 *av7110, u16* buf, int length)
-{
-        int ret;
-        
-// 	DEB_EE(("av7110: %p\n",av7110));
-
-        if (!av7110->arm_ready) {
-		DEB_D(("arm not ready.\n"));
-		return -1;
-	}
-	
-        if (down_interruptible(&av7110->dcomlock))
-		return -ERESTARTSYS;
-
-        ret=OutCommand(av7110, buf, length);
-        up(&av7110->dcomlock);
-	if (ret)
-                printk("SOutCommand error\n");
-        return ret;
-}
-
-
-static int outcom(struct av7110 *av7110, int type, int com, int num, ...)
-{
-	va_list args;
-        u16 buf[num+2];
-        int i, ret;
-
-// 	DEB_EE(("av7110: %p\n",av7110));
-
-        buf[0]=(( type << 8 ) | com);
-        buf[1]=num;
-
-        if (num) {
-                va_start(args, num);
-                for (i=0; i<num; i++)
-                        buf[i+2]=va_arg(args, u32);
-                va_end(args);
-        }
-
-        ret = SOutCommand(av7110, buf, num+2);
-	if (ret)
-                printk("outcom error\n");
-	return ret;
-}
-
-int SendCICommand(struct av7110 *av7110, u8 subcom, u8 *Params, u8 ParamLen)
-{
-        int i, ret;
-        u16 CommandBuffer[18] = { ((COMTYPE_COMMON_IF << 8) + subcom),
-                                  16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-        
- 	DEB_EE(("av7110: %p\n",av7110));
-
-	for(i=0; (i<ParamLen)&&(i<32); i++)	
-	{
-		if(i%2 == 0)
-			CommandBuffer[(i/2)+2] = (u16)(Params[i]) << 8;
-		else
-			CommandBuffer[(i/2)+2] |= Params[i];
-	}
-
-        ret = SOutCommand(av7110, CommandBuffer, 18);
-	if (ret)
-                printk("SendCICommand error\n");
-	return ret;
-}
-
-
-static int CommandRequest(struct av7110 *av7110, u16 *Buff, int length, u16 *buf, int n)
-{
-	int err;
-        s16 i;
-        u32 start;
-#ifdef COM_DEBUG
-        u32 stat;
-#endif
-
-	DEB_EE(("av7110: %p\n",av7110));
-
-        if (!av7110->arm_ready) {
-		DEB_D(("arm not ready.\n"));
-		return -1;
-	}
-
-        if (down_interruptible(&av7110->dcomlock))
-		return -ERESTARTSYS;
-
-        if ((err = OutCommand(av7110, Buff, length)) < 0) {
-		up(&av7110->dcomlock);
-		printk("CommandRequest error\n");
-		return err;
-	}
-
-        start = jiffies;
-        while ( rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2) )
-        {
-#ifdef _NOHANDSHAKE
-                dvb_delay(1);
-#endif
-                if ((jiffies - start) > ARM_WAIT_FREE) {
-			printk("%s: timeout waiting for COMMAND to complete\n", __FUNCTION__);
-                        up(&av7110->dcomlock);
-                        return -1;
-                }
-        }
-
-#ifndef _NOHANDSHAKE
-        start = jiffies;
-        while ( rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 ) ) {
-                dvb_delay(1);
-                if ((jiffies - start) > ARM_WAIT_SHAKE) {
-			printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__);
-                        up(&av7110->dcomlock);
-                        return -1;
-                }
-        }
-#endif
-
-#ifdef COM_DEBUG
-	stat = rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2);
-	if (stat & GPMQOver) {
-		printk(KERN_ERR "%s: GPMQOver\n", __FUNCTION__);
-                up(&av7110->dcomlock);
-		return -1;
-	}
-	else if (stat & OSDQOver) {
-		printk(KERN_ERR "%s: OSDQOver\n", __FUNCTION__);
-                up(&av7110->dcomlock);
-		return -1;
-	}
-#endif
-
-        for (i=0; i<n; i++)
-                buf[i] = rdebi(av7110, DEBINOSWAP, COM_BUFF + 2*i, 0, 2);
-
-	up(&av7110->dcomlock);
-        return 0;
-}
-
-
-static inline int  RequestParameter(struct av7110 *av7110, u16 tag, u16* Buff, s16 length)
-{
-	int ret;
-        ret = CommandRequest(av7110, &tag, 0, Buff, length);
-	if (ret)
-		printk("RequestParameter error\n");
-	return ret;
-}
-
-
-/****************************************************************************
- * Firmware commands 
- ****************************************************************************/
-
-/* msp3400 i2c subaddresses */
-#define MSP_WR_DEM 0x10
-#define MSP_RD_DEM 0x11
-#define MSP_WR_DSP 0x12
-#define MSP_RD_DSP 0x13
-
-static inline int msp_writereg(struct av7110 *av7110, u8 dev, u16 reg, u16 val)
-{
-        u8 msg[5]={ dev, reg>>8, reg&0xff, val>>8 , val&0xff }; 
-        struct dvb_i2c_bus *i2c = av7110->i2c_bus;
-        struct i2c_msg msgs = { .flags = 0, .addr = 0x40, .len = 5, .buf = msg};
-
-        if (i2c->xfer(i2c, &msgs, 1) != 1) {
-		printk("av7110(%d): %s(%u = %u) failed\n",
-				av7110->dvb_adapter->num, __FUNCTION__, reg, val);
-		return -EIO;
-	}
-	return 0;
-}
-
-static inline int msp_readreg(struct av7110 *av7110, u8 dev, u16 reg, u16 *val)
-{
-        u8 msg1[3]={ dev, reg>>8, reg&0xff };
-        u8 msg2[2];
-        struct dvb_i2c_bus *i2c = av7110->i2c_bus;
-        struct i2c_msg msgs[2] = {
-		{ .flags = 0,        .addr = 0x40, .len = 3, .buf = msg1},
-		{ .flags = I2C_M_RD, .addr = 0x40, .len = 2, .buf = msg2}
-	};
-
-        if (i2c->xfer(i2c, msgs, 2) != 2) {
-		printk("av7110(%d): %s(%u) failed\n",
-				av7110->dvb_adapter->num, __FUNCTION__, reg);
-		return -EIO;
-	}
-	*val = (msg2[0] << 8) | msg2[1];
-	return 0;
-}
-
-static inline int SendDAC(struct av7110 *av7110, u8 addr, u8 data)
-{
-// 	DEB_EE(("av7110: %p\n",av7110));
-
-        return outcom(av7110, COMTYPE_AUDIODAC, AudioDAC, 2, addr, data);
-}
-
-static int SetVolume(struct av7110 *av7110, int volleft, int volright)
-{
-        int err, vol, val, balance = 0;
-        
- 	DEB_EE(("av7110: %p\n",av7110));
-
-        switch (av7110->adac_type) {
-        case DVB_ADAC_TI:
-                volleft = (volleft * 256) / 1036;
-                volright = (volright * 256) / 1036;
-                if (volleft > 0x3f)
-                        volleft = 0x3f;
-                if (volright > 0x3f)
-                        volright = 0x3f;
-                if ((err = SendDAC(av7110, 3, 0x80 + volleft)))
-                        return err;
-                return SendDAC(av7110, 4, volright);
-                
-        case DVB_ADAC_CRYSTAL:
-                volleft=127-volleft/2;
-                volright=127-volright/2;
-                i2c_writereg(av7110, 0x20, 0x03, volleft);
-                i2c_writereg(av7110, 0x20, 0x04, volright);
-                return 0;
-
-        case DVB_ADAC_MSP:
-                vol  = (volleft > volright) ? volleft : volright;
-		val     = (vol * 0x73 / 255) << 8;
-		if (vol > 0) {
-		       balance = ((volright-volleft) * 127) / vol;
-		}
-		msp_writereg(av7110, MSP_WR_DSP, 0x0001, balance << 8);
-		msp_writereg(av7110, MSP_WR_DSP, 0x0000, val); /* loudspeaker */
-		msp_writereg(av7110, MSP_WR_DSP, 0x0006, val); /* headphonesr */
-		return 0;
-        }
-        return 0;
-}
-
 #ifdef CONFIG_DVB_AV7110_OSD
-
-static inline int ResetBlend(struct av7110 *av7110, u8 windownr)
-{
-        return outcom(av7110, COMTYPE_OSD, SetNonBlend, 1, windownr);
-}
-
-static inline int SetColorBlend(struct av7110 *av7110, u8 windownr)
-{
-        return outcom(av7110, COMTYPE_OSD, SetCBlend, 1, windownr); 
-}
-
-static inline int SetWindowBlend(struct av7110 *av7110, u8 windownr, u8 blending)
-{
-        return outcom(av7110, COMTYPE_OSD, SetWBlend, 2, windownr, blending); 
-}
-
-static inline int SetBlend_(struct av7110 *av7110, u8 windownr,
-                     enum av7110_osd_palette_type colordepth, u16 index, u8 blending)
-{
-        return outcom(av7110, COMTYPE_OSD, SetBlend, 4,
-                      windownr, colordepth, index, blending);
-} 
-
-static inline int SetColor_(struct av7110 *av7110, u8 windownr,
-                     enum av7110_osd_palette_type colordepth, u16 index, u16 colorhi, u16 colorlo)
-{
-        return outcom(av7110, COMTYPE_OSD, SetColor, 5,
-                      windownr, colordepth, index, colorhi, colorlo);
-} 
-
-static inline int BringToTop(struct av7110 *av7110, u8 windownr)
-{
-        return outcom(av7110, COMTYPE_OSD, WTop, 1, windownr);
-} 
-
-static inline int SetFont(struct av7110 *av7110, u8 windownr, u8 fontsize,
-                   u16 colorfg, u16 colorbg)
-{
-        return outcom(av7110, COMTYPE_OSD, Set_Font, 4,
-                      windownr, fontsize, colorfg, colorbg);
-} 
-
-static int FlushText(struct av7110 *av7110)
-{
-        u32 start;
-
-        if (down_interruptible(&av7110->dcomlock))
-		return -ERESTARTSYS;
-        start = jiffies;
-        while ( rdebi(av7110, DEBINOSWAP, BUFF1_BASE, 0, 2 ) ) {
-                dvb_delay(1); 
-                if ((jiffies - start) > ARM_WAIT_OSD) {
-                        printk(KERN_ERR "%s: timeout waiting for BUFF1_BASE == 0\n", __FUNCTION__);
-                        up(&av7110->dcomlock);
-                        return -1;
-                }
-        }
-        up(&av7110->dcomlock);
-        return 0;
-}
-
-static int WriteText(struct av7110 *av7110, u8 win, u16 x, u16 y, u8* buf)
-{
-        int i, ret;
-        u32 start;
-        int length=strlen(buf)+1;
-        u16 cbuf[5] = { (COMTYPE_OSD<<8) + DText, 3, win, x, y };
-        
-        if (down_interruptible(&av7110->dcomlock))
-		return -ERESTARTSYS;
-
-        start = jiffies;
-        while ( rdebi(av7110, DEBINOSWAP, BUFF1_BASE, 0, 2 ) ) {
-                dvb_delay(1);
-                if ((jiffies - start) > ARM_WAIT_OSD) {
-                        printk(KERN_ERR "%s: timeout waiting for BUFF1_BASE == 0\n", __FUNCTION__);
-                        up(&av7110->dcomlock);
-                        return -1;
-                }
-        }
-#ifndef _NOHANDSHAKE
-        start = jiffies;
-        while ( rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 ) ) {
-                dvb_delay(1);
-                if ((jiffies - start) > ARM_WAIT_SHAKE) {
-                        printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__);
-                        up(&av7110->dcomlock);
-                        return -1;
-                }
-        }
-#endif
-        for (i=0; i<length/2; i++)
-                wdebi(av7110, DEBINOSWAP, BUFF1_BASE + i*2, 
-                      swab16(*(u16 *)(buf+2*i)), 2);
-        if (length&1)
-                wdebi(av7110, DEBINOSWAP, BUFF1_BASE + i*2, 0, 2);
-        ret=OutCommand(av7110, cbuf, 5);
-        up(&av7110->dcomlock);
-	if (ret)
-		printk("WriteText error\n");
-        return ret;
-}
-
-static inline int DrawLine(struct av7110 *av7110, u8 windownr, 
-                    u16 x, u16 y, u16 dx, u16 dy, u16 color)
-{
-        return outcom(av7110, COMTYPE_OSD, DLine, 6,
-                      windownr, x, y, dx, dy, color);
-} 
-
-static inline int DrawBlock(struct av7110 *av7110, u8 windownr, 
-                    u16 x, u16 y, u16 dx, u16 dy, u16 color)
-{
-        return outcom(av7110, COMTYPE_OSD, DBox, 6,
-                      windownr, x, y, dx, dy, color);
-} 
-
-static inline int HideWindow(struct av7110 *av7110, u8 windownr)
-{
-        return outcom(av7110, COMTYPE_OSD, WHide, 1, windownr);
-} 
-
-static inline int MoveWindowRel(struct av7110 *av7110, u8 windownr, u16 x, u16 y)
-{
-        return outcom(av7110, COMTYPE_OSD, WMoveD, 3, windownr, x, y);
-} 
-
-static inline int MoveWindowAbs(struct av7110 *av7110, u8 windownr, u16 x, u16 y)
-{
-        return outcom(av7110, COMTYPE_OSD, WMoveA, 3, windownr, x, y);
-} 
-
-static inline int DestroyOSDWindow(struct av7110 *av7110, u8 windownr)
-{
-        return outcom(av7110, COMTYPE_OSD, WDestroy, 1, windownr);
-} 
-
-#if 0
-static void DestroyOSDWindows(struct av7110 *av7110)
-{
-        int i;
-
-        for (i=1; i<7; i++)
-                outcom(av7110, COMTYPE_OSD, WDestroy, 1, i);
-} 
-#endif
-
-static inline int CreateOSDWindow(struct av7110 *av7110, u8 windownr,
-                           enum av7110_window_display_type disptype, u16 width, u16 height)
-{
-        return outcom(av7110, COMTYPE_OSD, WCreate, 4,
-                      windownr, disptype, width, height);
-} 
-
-
-static enum av7110_osd_palette_type bpp2pal[8]={Pal1Bit, Pal2Bit, 0, Pal4Bit, 0, 0, 0, Pal8Bit}; 
-static enum av7110_window_display_type   bpp2bit[8]={BITMAP1, BITMAP2, 0, BITMAP4, 0, 0, 0, BITMAP8}; 
-
-static inline int LoadBitmap(struct av7110 *av7110, u16 format, u16 dx, u16 dy, int inc, u8* data)
-{
-        int bpp;
-        int i;
-        int d, delta; 
-        u8 c;
-        DECLARE_WAITQUEUE(wait, current);
-        
- 	DEB_EE(("av7110: %p\n",av7110));
-
-        if (av7110->bmp_state==BMP_LOADING) {
-                add_wait_queue(&av7110->bmpq, &wait);
-                while (1) {
-                        set_current_state(TASK_INTERRUPTIBLE);
-                        if (av7110->bmp_state!=BMP_LOADING
-                            || signal_pending(current))
-                                break;
-                        schedule();
-                }
-                set_current_state(TASK_RUNNING);
-                remove_wait_queue(&av7110->bmpq, &wait);
-        }
-        if (av7110->bmp_state==BMP_LOADING)
-                return -1;
-        av7110->bmp_state=BMP_LOADING;
-        if      (format==BITMAP8) { bpp=8; delta = 1; } 
-        else if (format==BITMAP4) { bpp=4; delta = 2; }
-        else if (format==BITMAP2) { bpp=2; delta = 4; }
-        else if (format==BITMAP1) { bpp=1; delta = 8; }
-        else {
-                av7110->bmp_state=BMP_NONE;
-                return -1;
-        }
-        av7110->bmplen= ((dx*dy*bpp+7)&~7)/8; 
-        av7110->bmpp=0;
-        if (av7110->bmplen>32768) {
-                av7110->bmp_state=BMP_NONE;
-                return -1;
-        }
-        for (i=0; i<dy; i++) {
-                if (copy_from_user(av7110->bmpbuf+1024+i*dx, data+i*inc, dx)) { 
-                        av7110->bmp_state=BMP_NONE;
-                        return -1;
-                }
-        }
-        if (format != BITMAP8) {
-                for (i=0; i<dx*dy/delta; i++) {
-                        c = ((u8 *)av7110->bmpbuf)[1024+i*delta+delta-1];
-                        for (d=delta-2; d>=0; d--) {
-                                c |= (((u8 *)av7110->bmpbuf)[1024+i*delta+d] 
-                                      << ((delta-d-1)*bpp));
-                                ((u8 *)av7110->bmpbuf)[1024+i] = c;
-                        }
-                }
-        }
-        av7110->bmplen+=1024;
-        return outcom(av7110, COMTYPE_OSD, LoadBmp, 3, format, dx, dy);
-} 
-
-static int BlitBitmap(struct av7110 *av7110, u16 win, u16 x, u16 y, u16 trans)
-{
-        DECLARE_WAITQUEUE(wait, current);
-        
-  	DEB_EE(("av7110: %p\n",av7110));
-
-       if (av7110->bmp_state==BMP_NONE)
-                return -1;
-        if (av7110->bmp_state==BMP_LOADING) {
-                add_wait_queue(&av7110->bmpq, &wait);
-                while (1) {
-                        set_current_state(TASK_INTERRUPTIBLE);
-                        if (av7110->bmp_state!=BMP_LOADING
-                            || signal_pending(current))
-                                break;
-                        schedule();
-                }
-                set_current_state(TASK_RUNNING);
-                remove_wait_queue(&av7110->bmpq, &wait);
-        }
-        if (av7110->bmp_state==BMP_LOADED)
-                return outcom(av7110, COMTYPE_OSD, BlitBmp, 4, win, x, y, trans);
-        return -1;
-} 
-
-static inline int  ReleaseBitmap(struct av7110 *av7110)
-{
- 	DEB_EE(("av7110: %p\n",av7110));
-
-        if (av7110->bmp_state!=BMP_LOADED)
-                return -1;
-        av7110->bmp_state=BMP_NONE;
-        return outcom(av7110, COMTYPE_OSD, ReleaseBmp, 0);
-} 
-
-static u32 RGB2YUV(u16 R, u16 G, u16 B)
-{
-        u16 y, u, v;
-        u16 Y, Cr, Cb;
-
-        y = R * 77 + G * 150 + B * 29;  // Luma=0.299R+0.587G+0.114B 0..65535
-        u = 2048+B * 8 -(y>>5);    // Cr 0..4095
-        v = 2048+R * 8 -(y>>5);    // Cb 0..4095
-
-        Y=y/256;
-        Cb=u/16;
-        Cr=v/16;
-
-        return Cr|(Cb<<16)|(Y<<8);
-}
-
-static void OSDSetColor(struct av7110 *av7110, u8 color, u8 r, u8 g, u8 b, u8 blend)
-{
-        u16 ch, cl;
-        u32 yuv;
-
-        yuv=blend ? RGB2YUV(r,g,b) : 0;
-        cl=(yuv&0xffff);
-        ch=((yuv>>16)&0xffff);
-        SetColor_(av7110, av7110->osdwin, bpp2pal[av7110->osdbpp[av7110->osdwin]],
-                  color, ch, cl);
-        SetBlend_(av7110, av7110->osdwin, bpp2pal[av7110->osdbpp[av7110->osdwin]],
-                  color, ((blend>>4)&0x0f));
-}
-
-static int OSDSetPalette(struct av7110 *av7110, u32 *colors, u8 first, u8 last)
-{
-       int i;
-       int length = last - first + 1;
-
-       if (length * 4 > DATA_BUFF3_SIZE)
-               return -1;
-
-       for (i=0; i<length; i++) {
-               u32 blend = (colors[i] & 0xF0000000) >> 4;
-               u32 yuv = blend ? RGB2YUV(colors[i] & 0xFF, (colors[i] >> 8) & 0xFF, (colors[i] >> 16) & 0xFF) | blend : 0;
-               yuv = ((yuv & 0xFFFF0000) >> 16) | ((yuv & 0x0000FFFF) << 16); // TODO kls2003-06-15: not sure if this is endian-proof
-               wdebi(av7110, DEBINOSWAP, DATA_BUFF3_BASE + i*4, yuv, 4);
-       }
-       return outcom(av7110, COMTYPE_OSD, Set_Palette, 4,
-               av7110->osdwin, bpp2pal[av7110->osdbpp[av7110->osdwin]], first, last);
-}
-
-static int OSDSetBlock(struct av7110 *av7110, int x0, int y0, int x1, int y1, int inc, u8 *data)
-{
-        uint w, h, bpp, bpl, size, lpb, bnum, brest;
-        int i;
-
-        w=x1-x0+1; h=y1-y0+1;
-        if (inc<=0)
-                inc=w; 
-        if (w<=0 || w>720 || h<=0 || h>576) 
-                return -1;
-        bpp=av7110->osdbpp[av7110->osdwin]+1; 
-        bpl=((w*bpp+7)&~7)/8; 
-        size=h*bpl;
-        lpb=(32*1024)/bpl; 
-        bnum=size/(lpb*bpl);
-        brest=size-bnum*lpb*bpl;
-
-        for (i=0; i<bnum; i++) {
-                LoadBitmap(av7110, bpp2bit[av7110->osdbpp[av7110->osdwin]], w, lpb, inc, data); 
-                BlitBitmap(av7110, av7110->osdwin, x0, y0+i*lpb, 0);
-                data+=lpb*inc; 
-        }
-        if (brest) {
-                LoadBitmap(av7110, bpp2bit[av7110->osdbpp[av7110->osdwin]], w, brest/bpl, inc, data); 
-                BlitBitmap(av7110, av7110->osdwin, x0, y0+bnum*lpb, 0);
-        }
-        ReleaseBitmap(av7110);
-        return 0;
-}
-
-static int OSD_DrawCommand(struct av7110 *av7110, osd_cmd_t *dc)
-{
-        switch (dc->cmd) {
-        case OSD_Close:
-                DestroyOSDWindow(av7110, av7110->osdwin);
-                return 0;
-        case OSD_Open:
-                av7110->osdbpp[av7110->osdwin]=(dc->color-1)&7;
-                CreateOSDWindow(av7110, av7110->osdwin, bpp2bit[av7110->osdbpp[av7110->osdwin]],
-                                dc->x1-dc->x0+1, dc->y1-dc->y0+1);
-                if (!dc->data) {
-                        MoveWindowAbs(av7110, av7110->osdwin, dc->x0, dc->y0);
-                        SetColorBlend(av7110, av7110->osdwin);
-                }
-                return 0;
-        case OSD_Show:
-                MoveWindowRel(av7110, av7110->osdwin, 0, 0);
-                return 0;
-        case OSD_Hide:
-                HideWindow(av7110, av7110->osdwin);
-                return 0;
-        case OSD_Clear:
-                DrawBlock(av7110, av7110->osdwin, 0, 0, 720, 576, 0);
-                return 0;
-        case OSD_Fill:
-                DrawBlock(av7110, av7110->osdwin, 0, 0, 720, 576, dc->color);
-                return 0;
-        case OSD_SetColor:
-                OSDSetColor(av7110, dc->color, dc->x0, dc->y0, dc->x1, dc->y1); 
-                return 0;
-        case OSD_SetPalette:
-        {      
-                if (FW_VERSION(av7110->arm_app) >= 0x2618)
-                        OSDSetPalette(av7110, (u32 *)dc->data, dc->color, dc->x0);
-                else {
-                int i, len=dc->x0-dc->color+1;
-                u8 *colors=(u8 *)dc->data;
-
-                for (i=0; i<len; i++)
-                        OSDSetColor(av7110, dc->color+i,
-                                    colors[i*4]  , colors[i*4+1],
-                                    colors[i*4+2], colors[i*4+3]);
-                }
-                return 0;
-        }
-        case OSD_SetTrans: 
-                return 0;
-        case OSD_SetPixel:
-                DrawLine(av7110, av7110->osdwin,
-                         dc->x0, dc->y0, 0, 0,
-                         dc->color);
-                return 0;
-        case OSD_GetPixel: 
-                return 0;
-
-        case OSD_SetRow:   
-                dc->y1=dc->y0;
-        case OSD_SetBlock:
-                OSDSetBlock(av7110, dc->x0, dc->y0, dc->x1, dc->y1, dc->color, dc->data);
-                return 0;
-
-        case OSD_FillRow:
-                DrawBlock(av7110, av7110->osdwin, dc->x0, dc->y0,
-                          dc->x1-dc->x0+1, dc->y1,
-                          dc->color);
-                return 0;
-        case OSD_FillBlock:
-                DrawBlock(av7110, av7110->osdwin, dc->x0, dc->y0,
-                          dc->x1-dc->x0+1, dc->y1-dc->y0+1,
-                          dc->color);
-                return 0;
-        case OSD_Line:
-                DrawLine(av7110, av7110->osdwin,
-                         dc->x0, dc->y0, dc->x1-dc->x0, dc->y1-dc->y0,
-                         dc->color);
-                return 0;
-        case OSD_Query: 
-                return 0;
-        case OSD_Test:
-                return 0;
-        case OSD_Text:
-        {
-                char textbuf[240];
-                
-                if (strncpy_from_user(textbuf, dc->data, 240)<0)
-                        return -EFAULT;
-                textbuf[239]=0;
-                if (dc->x1>3) 
-                        dc->x1=3;
-                SetFont(av7110, av7110->osdwin, dc->x1,
-                        (u16) (dc->color&0xffff), (u16) (dc->color>>16));
-                FlushText(av7110);
-                WriteText(av7110, av7110->osdwin, dc->x0, dc->y0, textbuf);
-                return 0;
-        }
-        case OSD_SetWindow:
-                if (dc->x0<1 || dc->x0>7)
-                        return -EINVAL;
-                av7110->osdwin=dc->x0;
-                return 0;
-        case OSD_MoveWindow:
-                MoveWindowAbs(av7110, av7110->osdwin, dc->x0, dc->y0);
-                SetColorBlend(av7110, av7110->osdwin);
-                return 0;
-        default:
-                return -EINVAL;
-        }
-}
-
-
 static int dvb_osd_ioctl(struct inode *inode, struct file *file,
-            unsigned int cmd, void *parg)
+			 unsigned int cmd, void *parg)
 {
-	struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
-        struct av7110 *av7110=(struct av7110 *) dvbdev->priv;
+	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
+	struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
 
- 	DEB_EE(("av7110: %p\n",av7110));
+	DEB_EE(("av7110: %p\n", av7110));
 
-        if (cmd==OSD_SEND_CMD)
-                return OSD_DrawCommand(av7110, (osd_cmd_t *)parg);
+	if (cmd == OSD_SEND_CMD)
+		return av7110_osd_cmd(av7110, (osd_cmd_t *) parg);
 
 	return -EINVAL;
-}
+        }
 
 
 static struct file_operations dvb_osd_fops = {
@@ -1848,212 +651,13 @@
 	.fops		= &dvb_osd_fops,
 	.kernel_ioctl	= dvb_osd_ioctl,
 };
-
 #endif /* CONFIG_DVB_AV7110_OSD */
 
 
-/* get version of the firmware ROM, RTSL, video ucode and ARM application  */
-
-static void firmversion(struct av7110 *av7110)
-{
-        u16 buf[20];
-
-        u16 tag = ((COMTYPE_REQUEST << 8) + ReqVersion);
-        
- 	DEB_EE(("av7110: %p\n",av7110));
-
-        RequestParameter(av7110, tag, buf, 16);
-        
-        av7110->arm_fw=(buf[0] << 16) + buf[1];
-        av7110->arm_rtsl=(buf[2] << 16) + buf[3];
-        av7110->arm_vid=(buf[4] << 16) + buf[5];
-        av7110->arm_app=(buf[6] << 16) + buf[7];
-        av7110->avtype=(buf[8] << 16) + buf[9];
-
-        printk ("DVB: AV711%d(%d) - firm %08x, rtsl %08x, vid %08x, app %08x\n",
-		av7110->avtype, av7110->dvb_adapter->num, av7110->arm_fw, 
-                av7110->arm_rtsl, av7110->arm_vid, av7110->arm_app);
-
-	/* print firmware capabilities */
-	if (FW_CI_LL_SUPPORT(av7110->arm_app))
-		printk ("DVB: AV711%d(%d) - firmware supports CI link layer interface\n",
-				av7110->avtype, av7110->dvb_adapter->num);
-	else
-		printk ("DVB: AV711%d(%d) - no firmware support for CI link layer interface\n",
-				av7110->avtype, av7110->dvb_adapter->num);
-
-        return;
-}
-
-static int waitdebi(struct av7110 *av7110, int adr, int state)
-{
-        int k;
-        
- 	DEB_EE(("av7110: %p\n",av7110));
-
-        for (k=0; k<100; k++, udelay(500)) {
-                if (irdebi(av7110, DEBINOSWAP, adr, 0, 2) == state) 
-                        return 0;
-        }
-        return -1;
-}
-
-
-static int load_dram(struct av7110 *av7110, u32 *data, int len)
-{
-        int i;
-        int blocks, rest;
-        u32 base, bootblock=BOOT_BLOCK;
-        
- 	DEB_EE(("av7110: %p\n",av7110));
-
-        blocks=len/BOOT_MAX_SIZE;
-        rest=len % BOOT_MAX_SIZE;
-        base=DRAM_START_CODE;
-        
-        for (i=0; i<blocks; i++) {
-                if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0)
-                        return -1;
-                DEB_D(("Writing DRAM block %d\n",i));
-                mwdebi(av7110, DEBISWAB, bootblock,
-                       ((char*)data) + i*(BOOT_MAX_SIZE),
-                       BOOT_MAX_SIZE);
-                bootblock^=0x1400;
-                iwdebi(av7110, DEBISWAB, BOOT_BASE, swab32(base), 4);
-                iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, BOOT_MAX_SIZE, 2);
-                iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
-                base+=BOOT_MAX_SIZE;
-        }
-        
-        if (rest > 0) {
-                if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0)
-                        return -1;
-                if (rest>4)
-                        mwdebi(av7110, DEBISWAB, bootblock, ((char*)data) + i*(BOOT_MAX_SIZE), rest);
-                else
-                        mwdebi(av7110, DEBISWAB, bootblock, ((char*)data) + i*(BOOT_MAX_SIZE) - 4, rest+4);
-                
-                iwdebi(av7110, DEBISWAB, BOOT_BASE, swab32(base), 4);
-                iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, rest, 2);
-                iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
-        }
-        if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0)
-                return -1;
-        iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, 0, 2);
-        iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
-        if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BOOT_COMPLETE) < 0)
-                return -1;
-        return 0;
-}
-
-
-static u8 bootcode[] = {
-        0xea, 0x00, 0x00, 0x0e, 0xe1, 0xb0, 0xf0, 0x0e, /* 0x0000 */
-        0xe2, 0x5e, 0xf0, 0x04, 0xe2, 0x5e, 0xf0, 0x04,
-        0xe2, 0x5e, 0xf0, 0x08, 0xe2, 0x5e, 0xf0, 0x04,
-        0xe2, 0x5e, 0xf0, 0x04, 0xe2, 0x5e, 0xf0, 0x04,
-        0x2c, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x0c,
-        0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x34,
-        0x00, 0x00, 0x00, 0x00, 0xa5, 0xa5, 0x5a, 0x5a,
-        0x00, 0x1f, 0x15, 0x55, 0x00, 0x00, 0x00, 0x09,
-        0xe5, 0x9f, 0xd0, 0x5c, 0xe5, 0x9f, 0x40, 0x54, /* 0x0040 */
-        0xe3, 0xa0, 0x00, 0x00, 0xe5, 0x84, 0x00, 0x00,
-        0xe5, 0x84, 0x00, 0x04, 0xe1, 0xd4, 0x10, 0xb0,
-        0xe3, 0x51, 0x00, 0x00, 0x0a, 0xff, 0xff, 0xfc,
-        0xe1, 0xa0, 0x10, 0x0d, 0xe5, 0x94, 0x30, 0x04,
-        0xe1, 0xd4, 0x20, 0xb2, 0xe2, 0x82, 0x20, 0x3f,
-        0xe1, 0xb0, 0x23, 0x22, 0x03, 0xa0, 0x00, 0x02,
-        0xe1, 0xc4, 0x00, 0xb0, 0x0a, 0xff, 0xff, 0xf4,
-        0xe8, 0xb1, 0x1f, 0xe0, 0xe8, 0xa3, 0x1f, 0xe0, /* 0x0080 */
-        0xe8, 0xb1, 0x1f, 0xe0, 0xe8, 0xa3, 0x1f, 0xe0,
-        0xe2, 0x52, 0x20, 0x01, 0x1a, 0xff, 0xff, 0xf9,
-        0xe2, 0x2d, 0xdb, 0x05, 0xea, 0xff, 0xff, 0xec,
-        0x2c, 0x00, 0x03, 0xf8, 0x2c, 0x00, 0x04, 0x00,
-};
-
-static int bootarm(struct av7110 *av7110)
-{
-	struct saa7146_dev *dev= av7110->dev;
-        u32 ret;
-        int i;
-
- 	DEB_EE(("av7110: %p\n",av7110));
-
-        saa7146_setgpio(dev, RESET_LINE, SAA7146_GPIO_OUTLO);
-
-        /* Disable DEBI and GPIO irq */
-	IER_DISABLE(av7110->dev, MASK_03|MASK_19);
-/*
-        saa7146_write(av7110->dev, IER, 
-                      saa7146_read(av7110->dev, IER) & 
-                      ~(MASK_19 | MASK_03));
-*/
-        saa7146_write(av7110->dev, ISR, (MASK_19 | MASK_03));
-
-        /* enable DEBI */
-        saa7146_write(av7110->dev, MC1, 0x08800880);
-        saa7146_write(av7110->dev, DD1_STREAM_B, 0x00000000);
-        saa7146_write(av7110->dev, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26));
-        
-        /* test DEBI */
-        iwdebi(av7110, DEBISWAP, DPRAM_BASE, 0x76543210, 4);
-        if ((ret=irdebi(av7110, DEBINOSWAP, DPRAM_BASE, 0, 4))!=0x10325476) {
-                printk(KERN_ERR "dvb: debi test in bootarm() failed: "
-                       "%08x != %08x\n", ret, 0x10325476);;
-                return -1;
-        }
-        for (i=0; i<8192; i+=4) 
-                iwdebi(av7110, DEBISWAP, DPRAM_BASE+i, 0x00, 4);
-        DEB_D(("bootarm: debi test OK\n"));
-
-        /* boot */
-        DEB_D(("bootarm: load boot code\n"));
-
-        saa7146_setgpio(dev, ARM_IRQ_LINE, SAA7146_GPIO_IRQLO);
-        //saa7146_setgpio(dev, DEBI_DONE_LINE, SAA7146_GPIO_INPUT);
-        //saa7146_setgpio(dev, 3, SAA7146_GPIO_INPUT);
-
-	mwdebi(av7110, DEBISWAB, DPRAM_BASE, bootcode, sizeof(bootcode));
-        iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
-        
-        wait_for_debi_done(av7110);
-        saa7146_setgpio(dev, RESET_LINE, SAA7146_GPIO_OUTHI);
-        set_current_state(TASK_INTERRUPTIBLE);
-        schedule_timeout(HZ);
-        
-        DEB_D(("bootarm: load dram code\n"));
-
-	if (load_dram(av7110, (u32 *)av7110->bin_root, av7110->size_root)<0)
-		return -1;
-
-	saa7146_setgpio(dev, RESET_LINE, SAA7146_GPIO_OUTLO);
-        mdelay(1);
-        
-        DEB_D(("bootarm: load dpram code\n"));
-
-	mwdebi(av7110, DEBISWAB, DPRAM_BASE, av7110->bin_dpram, av7110->size_dpram);
-
-	wait_for_debi_done(av7110);
-
-        saa7146_setgpio(dev, RESET_LINE, SAA7146_GPIO_OUTHI);
-        mdelay(800);
-
-        //ARM_ClearIrq(av7110); 
-        ARM_ResetMailBox(av7110); 
-        saa7146_write(av7110->dev, ISR, (MASK_19 | MASK_03));
-	IER_ENABLE(av7110->dev, MASK_03);
-//      saa7146_write(av7110->dev, IER, 
-//                      saa7146_read(av7110->dev, IER) | MASK_03 );
-
-        av7110->arm_errors=0;
-        av7110->arm_ready=1;
-        return 0;
-}
-
-static inline int SetPIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid, 
-        u16 subpid, u16 pcrpid)
-{
- 	DEB_EE(("av7110: %p\n",av7110));
+static inline int SetPIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid,
+			  u16 subpid, u16 pcrpid)
+        {
+	DEB_EE(("av7110: %p\n", av7110));
 
 	if (vpid == 0x1fff || apid == 0x1fff ||
 	    ttpid == 0x1fff || subpid == 0x1fff || pcrpid == 0x1fff) {
@@ -2064,1223 +668,281 @@
 		av7110->pids[DMX_PES_PCR] = 0;
 	}
 
-        return outcom(av7110, COMTYPE_PIDFILTER, MultiPID, 5, 
-                      pcrpid, vpid, apid, ttpid, subpid);
-}
-
-static void ChangePIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid, 
-        u16 subpid, u16 pcrpid)
-{
- 	DEB_EE(("av7110: %p\n",av7110));
-
-        if (down_interruptible(&av7110->pid_mutex))
-		return;
-
-        if (!(vpid&0x8000))  av7110->pids[DMX_PES_VIDEO]=vpid;
-        if (!(apid&0x8000))  av7110->pids[DMX_PES_AUDIO]=apid;
-        if (!(ttpid&0x8000)) av7110->pids[DMX_PES_TELETEXT]=ttpid;
-        if (!(pcrpid&0x8000)) av7110->pids[DMX_PES_PCR]=pcrpid;
-
-        av7110->pids[DMX_PES_SUBTITLE]=0;
-
-        if (av7110->fe_synced) {
-                pcrpid = av7110->pids[DMX_PES_PCR];
-                SetPIDs(av7110, vpid, apid, ttpid, subpid, pcrpid);
-        }
-
-        up(&av7110->pid_mutex);
-}
-
-
-static void SetMode(struct av7110 *av7110, int mode)
-{
- 	DEB_EE(("av7110: %p\n",av7110));
-
-        outcom(av7110, COMTYPE_ENCODER, LoadVidCode, 1, mode);
-        
-        if (!av7110->playing) {
-                ChangePIDs(av7110, av7110->pids[DMX_PES_VIDEO], 
-                           av7110->pids[DMX_PES_AUDIO], 
-                           av7110->pids[DMX_PES_TELETEXT],  
-                           0, av7110->pids[DMX_PES_PCR]);
-                outcom(av7110, COMTYPE_PIDFILTER, Scan, 0);
-        }
-}
-
-static inline void TestMode(struct av7110 *av7110, int mode)
-{
-//	DEB_EE(("av7110: %p\n",av7110));
-        outcom(av7110, COMTYPE_ENCODER, SetTestMode, 1, mode);
-}
-
-static inline void VidMode(struct av7110 *av7110, int mode)
-{
-// 	DEB_EE(("av7110: %p\n",av7110));
-        outcom(av7110, COMTYPE_ENCODER, SetVidMode, 1, mode);
-}
-           
-
-static int inline vidcom(struct av7110 *av7110, u32 com, u32 arg)
-{
-// 	DEB_EE(("av7110: %p\n",av7110));
-        return outcom(av7110, 0x80, 0x02, 4, 
-                      (com>>16), (com&0xffff), 
-                      (arg>>16), (arg&0xffff));
-}
-
-static int inline audcom(struct av7110 *av7110, u32 com)
-{
-//	DEB_EE(("av7110: %p\n",av7110));
-	return outcom(av7110, 0x80, 0x03, 4, 
-                      (com>>16), (com&0xffff));
-}
-
-static inline void Set22K(struct av7110 *av7110, int state)
-{
- 	DEB_EE(("av7110: %p\n",av7110));
-	outcom(av7110, COMTYPE_AUDIODAC, (state ? ON22K : OFF22K), 0);
-}
-
-
-static int SendDiSEqCMsg(struct av7110 *av7110, int len, u8 *msg, unsigned long burst)
-{
-        int i;
-	u16 buf[18] = { ((COMTYPE_AUDIODAC << 8) + SendDiSEqC),
-                        16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-
- 	DEB_EE(("av7110: %p\n",av7110));
-
-	if (len>10)
-		len=10;
-
-	buf[1] = len+2;
-	buf[2] = len;
-
-	if (burst!=-1)
-		buf[3]=burst ? 0x01 : 0x00;
-	else
-		buf[3]=0xffff;
-
-	for (i=0; i<len; i++)
-		buf[i+4]=msg[i];
-
-	if (SOutCommand(av7110, buf, 18))
-		printk("SendDiSEqCMsg error\n");
-
-        return 0;
-}
-
-/****************************************************************************
- * I2C client commands
- ****************************************************************************/
-
-static inline int i2c_writereg(struct av7110 *av7110, u8 id, u8 reg, u8 val)
-{
-        u8 msg[2]={ reg, val }; 
-        struct dvb_i2c_bus *i2c = av7110->i2c_bus;
-        struct i2c_msg msgs;
-
-        msgs.flags=0;
-        msgs.addr=id/2;
-        msgs.len=2;
-        msgs.buf=msg;
-        return i2c->xfer (i2c, &msgs, 1);
-}
-
-static inline u8 i2c_readreg(struct av7110 *av7110, u8 id, u8 reg)
-{
-        struct dvb_i2c_bus *i2c = av7110->i2c_bus;
-        u8 mm1[] = {0x00};
-        u8 mm2[] = {0x00};
-        struct i2c_msg msgs[2];
-
-        msgs[0].flags=0;
-        msgs[1].flags=I2C_M_RD;
-        msgs[0].addr=msgs[1].addr=id/2;
-        mm1[0]=reg;
-        msgs[0].len=1; msgs[1].len=1;
-        msgs[0].buf=mm1; msgs[1].buf=mm2;
-        i2c->xfer(i2c, msgs, 2);
-
-        return mm2[0];
+	return av7110_fw_cmd(av7110, COMTYPE_PIDFILTER, MultiPID, 5,
+			     pcrpid, vpid, apid, ttpid, subpid);
 }
 
-
-/****************************************************************************
- * I/O buffer management and control
- ****************************************************************************/
-
-static int sw2mode[16] = {
-        VIDEO_MODE_PAL, VIDEO_MODE_NTSC, VIDEO_MODE_NTSC, VIDEO_MODE_PAL,
-        VIDEO_MODE_NTSC, VIDEO_MODE_NTSC, VIDEO_MODE_PAL, VIDEO_MODE_NTSC,
-        VIDEO_MODE_PAL, VIDEO_MODE_PAL, VIDEO_MODE_PAL, VIDEO_MODE_PAL,
-        VIDEO_MODE_PAL, VIDEO_MODE_PAL, VIDEO_MODE_PAL, VIDEO_MODE_PAL,
-};
-
-static void get_video_format(struct av7110 *av7110, u8 *buf, int count)
+void ChangePIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid,
+		u16 subpid, u16 pcrpid)
 {
-        int i;
-	int hsize,vsize;
-        int sw;
-        u8 *p;
-
- 	DEB_EE(("av7110: %p\n",av7110));
-
-        if (av7110->sinfo)
-                return;
-        for (i=7; i<count-10; i++) {
-                p=buf+i;
-                if (p[0] || p[1] || p[2]!=0x01 || p[3]!=0xb3)
-                        continue;
-                p+=4;
-                hsize = ((p[1] &0xF0) >> 4) | (p[0] << 4);
-                vsize = ((p[1] &0x0F) << 8) | (p[2]);
-                sw = (p[3]&0x0F);
-                SetMode(av7110, sw2mode[sw]);
-                DEB_S(("dvb: playback %dx%d fr=%d\n", hsize, vsize, sw));
-                av7110->sinfo=1;
-                break;
-        }
-}
-
-static inline long aux_ring_buffer_write(struct dvb_ringbuffer *rbuf, const char *buf, unsigned long count)
-{
-        unsigned long todo = count;
-        int free;
-    
-        while (todo > 0) {
-                if (dvb_ringbuffer_free(rbuf)<2048) {
-                        if (wait_event_interruptible(rbuf->queue,
-                                                     (dvb_ringbuffer_free(rbuf)>=2048)))
-                        	return count-todo;
-                }   
-                free = dvb_ringbuffer_free(rbuf);
-                if (free > todo)
-                        free = todo;
-                (void)dvb_ringbuffer_write(rbuf,buf,free,0);
-                todo -= free;
-                buf += free;
-        }
-
-	return count-todo;
-}
-
-static void play_video_cb(u8 *buf, int count, void *priv)
-{
-        struct av7110 *av7110=(struct av7110 *) priv;
- 	DEB_EE(("av7110: %p\n",av7110));
-
-        if ((buf[3]&0xe0)==0xe0) {
-                get_video_format(av7110, buf, count);
-                aux_ring_buffer_write(&av7110->avout, buf, count);
-        } else
-                aux_ring_buffer_write(&av7110->aout, buf, count);
-}
-
-static void play_audio_cb(u8 *buf, int count, void *priv)
-{
-        struct av7110 *av7110=(struct av7110 *) priv;
- 	DEB_EE(("av7110: %p\n",av7110));
+	DEB_EE(("av7110: %p\n", av7110));
         
-        aux_ring_buffer_write(&av7110->aout, buf, count);
-}
-
-#define FREE_COND (dvb_ringbuffer_free(&av7110->avout)>=20*1024 && dvb_ringbuffer_free(&av7110->aout)>=20*1024)
-
-static ssize_t dvb_play(struct av7110 *av7110, const u8 *buf,
-         unsigned long count, int nonblock, int type, int umem)
-{
-        unsigned long todo = count, n;
- 	DEB_EE(("av7110: %p\n",av7110));
-
-        if (!av7110->kbuf[type])
-                return -ENOBUFS;
-
-	if (nonblock && !FREE_COND)
-                return -EWOULDBLOCK;
-                
-        while (todo>0) {
-                if (!FREE_COND) {
-                        if (nonblock)
-                                return count-todo;
-                        if (wait_event_interruptible(av7110->avout.queue,
-                                                     FREE_COND))
-                        	return count-todo;
-                } 
-		n=todo;
-                if (n>IPACKS*2)
-                        n=IPACKS*2;
-                if (umem) {
-                        if (copy_from_user(av7110->kbuf[type], buf, n)) 
-                                return -EFAULT;
-                        av7110_ipack_instant_repack(av7110->kbuf[type], n,
-						    &av7110->ipack[type]);
-                } else {
-                        av7110_ipack_instant_repack(buf, n,
-						    &av7110->ipack[type]);
-		}
-                todo -= n;
-                buf += n;
-        }
-	return count-todo;
-}
+	if (down_interruptible(&av7110->pid_mutex))
+		return;
 
-static ssize_t dvb_aplay(struct av7110 *av7110, const u8 *buf,
-         unsigned long count, int nonblock, int type)
-{
-        unsigned long todo = count, n;
-	DEB_EE(("av7110: %p\n",av7110));
+	if (!(vpid & 0x8000))
+		av7110->pids[DMX_PES_VIDEO] = vpid;
+	if (!(apid & 0x8000))
+		av7110->pids[DMX_PES_AUDIO] = apid;
+	if (!(ttpid & 0x8000))
+		av7110->pids[DMX_PES_TELETEXT] = ttpid;
+	if (!(pcrpid & 0x8000))
+		av7110->pids[DMX_PES_PCR] = pcrpid;
+	
+	av7110->pids[DMX_PES_SUBTITLE] = 0;
 
-        if (!av7110->kbuf[type])
-                return -ENOBUFS;
-        if (nonblock && dvb_ringbuffer_free(&av7110->aout)<20*1024)
-                return -EWOULDBLOCK;
-                
-        while (todo>0) {
-                if (dvb_ringbuffer_free(&av7110->aout)<20*1024) {
-                        if (nonblock)
-                                return count-todo;
-                        if (wait_event_interruptible(av7110->aout.queue,
-                                                     (dvb_ringbuffer_free(&av7110->aout)>=
-                                                      20*1024)))
-                        	return count-todo;
-                } 
-		n=todo;
-                if (n>IPACKS*2)
-                        n=IPACKS*2;
-                if (copy_from_user(av7110->kbuf[type], buf, n)) 
-                        return -EFAULT;
-                av7110_ipack_instant_repack(av7110->kbuf[type], n,
-					    &av7110->ipack[type]);
-//                        memcpy(dvb->kbuf[type], buf, n); 
-                todo -= n;
-                buf += n;
+	if (av7110->fe_synced) {
+		pcrpid = av7110->pids[DMX_PES_PCR];
+		SetPIDs(av7110, vpid, apid, ttpid, subpid, pcrpid);
         }
-	return count-todo;
-}
-
-void init_p2t(struct av7110_p2t *p, struct dvb_demux_feed *feed)
-{
-	memset(p->pes,0,TS_SIZE);
-	p->counter = 0;
-	p->pos = 0;
-	p->frags = 0;
-	if (feed) p->feed = feed;
-}
-
-void clear_p2t(struct av7110_p2t *p)
-{
-	memset(p->pes,0,TS_SIZE);
-//	p->counter = 0;
-	p->pos = 0;
-	p->frags = 0;
-}
-
-
-long int find_pes_header(u8 const *buf, long int length, int *frags)
-{
-	int c = 0;
-	int found = 0;
-
-	*frags = 0;
-
-	while (c < length-3 && !found) {
-		if (buf[c] == 0x00 && buf[c+1] == 0x00 && 
-		    buf[c+2] == 0x01) {
-			switch ( buf[c+3] ) {
-				
-			case PROG_STREAM_MAP:
-			case PRIVATE_STREAM2:
-			case PROG_STREAM_DIR:
-			case ECM_STREAM     :
-			case EMM_STREAM     :
-			case PADDING_STREAM :
-			case DSM_CC_STREAM  :
-			case ISO13522_STREAM:
-			case PRIVATE_STREAM1:
-			case AUDIO_STREAM_S ... AUDIO_STREAM_E:
-			case VIDEO_STREAM_S ... VIDEO_STREAM_E:
-				found = 1;
-				break;
-				
-			default:
-				c++;
-				break;
-			}	
-		} else c++;
-	}
-	if (c == length-3 && !found){
-		if (buf[length-1] == 0x00) *frags = 1;
-		if (buf[length-2] == 0x00 &&
-		    buf[length-1] == 0x00) *frags = 2;
-		if (buf[length-3] == 0x00 &&
-		    buf[length-2] == 0x00 &&
-		    buf[length-1] == 0x01) *frags = 3;
-		return -1;
-	}
-
-	return c;
-}
-
-void pes_to_ts( u8 const *buf, long int length, u16 pid, struct av7110_p2t *p)
-{
-	int c,c2,l,add;
-	int check,rest;
-
-	c = 0;
-	c2 = 0;
-	if (p->frags){
-		check = 0;
-		switch(p->frags){
-		case 1:
-			if ( buf[c] == 0x00 && buf[c+1] == 0x01 ){
-				check = 1;
-				c += 2;
-			}
-			break;
-		case 2:
-			if ( buf[c] == 0x01 ){
-				check = 1;
-				c++;
-			}
-			break;
-		case 3:
-			check = 1;
-		}
-		if(check){
-			switch ( buf[c] ) {
-				
-			case PROG_STREAM_MAP:
-			case PRIVATE_STREAM2:
-			case PROG_STREAM_DIR:
-			case ECM_STREAM     :
-			case EMM_STREAM     :
-			case PADDING_STREAM :
-			case DSM_CC_STREAM  :
-			case ISO13522_STREAM:
-			case PRIVATE_STREAM1:
-			case AUDIO_STREAM_S ... AUDIO_STREAM_E:
-			case VIDEO_STREAM_S ... VIDEO_STREAM_E:
-				p->pes[0] = 0x00;
-				p->pes[1] = 0x00;
-				p->pes[2] = 0x01;
-				p->pes[3] = buf[c];
-				p->pos=4;
-				memcpy(p->pes+p->pos,buf+c,(TS_SIZE-4)-p->pos);
-				c += (TS_SIZE-4)-p->pos;
-				p_to_t(p->pes,(TS_SIZE-4),pid,&p->counter,
-				       p->feed);
-				clear_p2t(p);
-				break;
-				
-			default:
-				c=0;
-				break;
-			}
-		}
-		p->frags = 0;
-	}
-		
-	if (p->pos){
-		c2 = find_pes_header(buf+c,length-c,&p->frags);
-		if (c2 >= 0 && c2 < (TS_SIZE-4)-p->pos){
-			l = c2+c;
-		} else l = (TS_SIZE-4)-p->pos;
-		memcpy(p->pes+p->pos,buf,l);
-		c += l;
-		p->pos += l;
-		p_to_t(p->pes,p->pos,pid,&p->counter, p->feed);
-		clear_p2t(p);
-	}
-			
-	add = 0;
-	while (c < length){
-		c2 = find_pes_header(buf+c+add,length-c-add,&p->frags);
-		if (c2 >= 0) {
-			c2 += c+add;
-			if (c2 > c){
-				p_to_t(buf+c,c2-c,pid,&p->counter,
-				       p->feed);
-				c = c2;
-				clear_p2t(p);
-				add = 0;
-			} else add = 1;
-		} else {
-			l = length-c;
-			rest = l % (TS_SIZE-4);
-			l -= rest;
-			p_to_t(buf+c,l,pid,&p->counter,
-			       p->feed);
-			memcpy(p->pes,buf+c+l,rest);
-			p->pos = rest;
-			c = length;
-		}
-	}
-}
-
-
-int write_ts_header2(u16 pid, u8 *counter, int pes_start, u8 *buf, u8 length)
-{
-	int i;
-	int c = 0;
-	int fill;
-	u8 tshead[4] = { 0x47, 0x00, 0x00, 0x10}; 
-        
-	fill = (TS_SIZE-4)-length;
-        if (pes_start) tshead[1] = 0x40;
-	if (fill) tshead[3] = 0x30;
-        tshead[1] |= (u8)((pid & 0x1F00) >> 8);
-        tshead[2] |= (u8)(pid & 0x00FF);
-        tshead[3] |= ((*counter)++ & 0x0F) ;
-        memcpy(buf,tshead,4);
-	c+=4;
-
-
-	if (fill){
-		buf[4] = fill-1;
-		c++;
-		if (fill >1){
-			buf[5] = 0x00;
-			c++;
-		}
-		for ( i = 6; i < fill+4; i++){
-			buf[i] = 0xFF;
-			c++;
-		}
-	}
-
-        return c;
-}
-
-
-void p_to_t(u8 const *buf, long int length, u16 pid, u8 *counter, 
-            struct dvb_demux_feed *feed)
-{
-  
-	int l, pes_start;
-	u8 obuf[TS_SIZE];
-	long int c = 0;
-
-	pes_start = 0;
-	if ( length > 3 && 
-             buf[0] == 0x00 && buf[1] == 0x00 && buf[2] == 0x01 )
-		switch (buf[3]){
-			case PROG_STREAM_MAP:
-			case PRIVATE_STREAM2:
-			case PROG_STREAM_DIR:
-			case ECM_STREAM     :
-			case EMM_STREAM     :
-			case PADDING_STREAM :
-			case DSM_CC_STREAM  :
-			case ISO13522_STREAM:
-			case PRIVATE_STREAM1:
-			case AUDIO_STREAM_S ... AUDIO_STREAM_E:
-			case VIDEO_STREAM_S ... VIDEO_STREAM_E:
-				pes_start = 1;
-				break;
-				
-			default:
-				break;
-		}			
-
-	while ( c < length ){
-		memset(obuf,0,TS_SIZE);
-		if (length - c >= (TS_SIZE-4)){
-			l = write_ts_header2(pid, counter, pes_start
-					     , obuf, (TS_SIZE-4));
-			memcpy(obuf+l, buf+c, TS_SIZE-l);
-			c += TS_SIZE-l;
-		} else { 
-			l = write_ts_header2(pid, counter, pes_start
-					     , obuf, length-c);
-			memcpy(obuf+l, buf+c, TS_SIZE-l);
-			c = length;
-		}
-                feed->cb.ts(obuf, 188, 0, 0, &feed->feed.ts, DMX_OK); 
-		pes_start = 0;
-	}
-}
-
-/****************************************************************************
- * V4L SECTION
- ****************************************************************************/
-
-static struct v4l2_input inputs[2] = {
-	{	
-		.index 		= 0,
-		.name 		= "DVB",
-		.type		= V4L2_INPUT_TYPE_CAMERA,
-		.audioset 	= 1,
-		.tuner		= 0, /* ignored */
-		.std		= V4L2_STD_PAL_BG|V4L2_STD_NTSC_M,
-		.status		= 0,
-	}, { 
-		.index 		= 1,
-		.name 		= "Television",
-		.type		= V4L2_INPUT_TYPE_TUNER,
-		.audioset 	= 2,
-		.tuner		= 0,
-		.std		= V4L2_STD_PAL_BG|V4L2_STD_NTSC_M,
-		.status		= 0,
-	}
-};
-
-/* taken from ves1820.c */
-static int ves1820_writereg(struct saa7146_dev *dev, u8 reg, u8 data)
-{
-	u8 addr = 0x09;
-        u8 buf[] = { 0x00, reg, data };
-	struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = buf, .len = 3 };
-
-  	DEB_EE(("av7710: dev: %p\n",dev));
-
-	if( 1 != saa7146_i2c_transfer(dev, &msg, 1, 1)) {
-		return -1;
-	}
-	return 0;
-}
-
-static int tuner_write(struct saa7146_dev *dev, u8 addr, u8 data [4])
-{
-        struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = data, .len = 4 };
-
-  	DEB_EE(("av7710: dev: %p\n",dev));
-
-	if( 1 != saa7146_i2c_transfer(dev, &msg, 1, 1)) {
-		return -1;
-	}
-	return 0;
-}
-
-
-/**
- *   set up the downconverter frequency divisor for a
- *   reference clock comparision frequency of 62.5 kHz.
- */
-static int tuner_set_tv_freq (struct saa7146_dev *dev, u32 freq)
-{
-        u32 div;
-	u8 config;
-        u8 buf [4];
-
- 	DEB_EE(("av7710: freq: 0x%08x\n",freq));
-
-	/* magic number: 614. tuning with the frequency given by v4l2
-	   is always off by 614*62.5 = 38375 kHz...*/
-	div = freq + 614;
-
-	buf[0] = (div >> 8) & 0x7f;
-	buf[1] = div & 0xff;
-	buf[2] = 0x8e;
-
-	if (freq < (u32) (16*168.25) )
-		config = 0xa0;
-	else if (freq < (u32) (16*447.25) )
-		config = 0x90;
-	else
-		config = 0x30;
-	config &= ~0x02;
-
-	buf[3] = config;
-
-        return tuner_write (dev, 0x61, buf);
-}
-
-static struct saa7146_standard analog_standard[];
-static struct saa7146_standard dvb_standard[];
-static struct saa7146_standard standard[];
-
-static struct v4l2_audio msp3400_v4l2_audio = {
-	.index = 0,
-	.name = "Television",
-	.capability = V4L2_AUDCAP_STEREO
-};
-
-int av7110_dvb_c_switch(struct saa7146_fh *fh)
-{
-	struct saa7146_dev *dev = fh->dev;
-	struct saa7146_vv *vv = dev->vv_data;
-	struct av7110 *av7110 = (struct av7110*)dev->ext_priv;
-	u16 adswitch;
-	u8 band = 0;
-	int source, sync;
-	struct saa7146_fh *ov_fh = NULL;
-	int restart_overlay = 0;
-
-	DEB_EE(("av7110: %p\n",av7110));
-
-	if( vv->ov_data != NULL ) {
-		ov_fh = vv->ov_data->fh;
-		saa7146_stop_preview(ov_fh);
-		restart_overlay = 1;
-	}
-
-	if( 0 != av7110->current_input ) {
-		adswitch = 1;
-		band = 0x68; /* analog band */
-		source = SAA7146_HPS_SOURCE_PORT_B;
-		sync = SAA7146_HPS_SYNC_PORT_B;
-		memcpy(standard,analog_standard,sizeof(struct saa7146_standard)*2);
-		printk("av7110: switching to analog TV\n");
-		msp_writereg(av7110, MSP_WR_DSP, 0x0008, 0x0000); // loudspeaker source
-		msp_writereg(av7110, MSP_WR_DSP, 0x0009, 0x0000); // headphone source
-		msp_writereg(av7110, MSP_WR_DSP, 0x000a, 0x0000); // SCART 1 source
-		msp_writereg(av7110, MSP_WR_DSP, 0x000e, 0x3000); // FM matrix, mono
-		msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0x4f00); // loudspeaker + headphone
-		msp_writereg(av7110, MSP_WR_DSP, 0x0007, 0x4f00); // SCART 1 volume
-	} else {
-		adswitch = 0;
-		band = 0x28; /* digital band */	
-		source = SAA7146_HPS_SOURCE_PORT_A;
-		sync = SAA7146_HPS_SYNC_PORT_A;
-		memcpy(standard,dvb_standard,sizeof(struct saa7146_standard)*2);
-		printk("av7110: switching DVB mode\n");
-		msp_writereg(av7110, MSP_WR_DSP, 0x0008, 0x0220); // loudspeaker source
-		msp_writereg(av7110, MSP_WR_DSP, 0x0009, 0x0220); // headphone source
-		msp_writereg(av7110, MSP_WR_DSP, 0x000a, 0x0220); // SCART 1 source
-		msp_writereg(av7110, MSP_WR_DSP, 0x000e, 0x3000); // FM matrix, mono
-		msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0x7f00); // loudspeaker + headphone
-		msp_writereg(av7110, MSP_WR_DSP, 0x0007, 0x7f00); // SCART 1 volume
-	}
-
-	/* hmm, this does not do anything!? */
-	if (outcom(av7110, COMTYPE_AUDIODAC, ADSwitch, 1, adswitch))
-		printk("ADSwitch error\n");
-
-	if( 0 != ves1820_writereg(dev, 0x0f, band )) {
-		printk("setting band in demodulator failed.\n");
-	}
-	saa7146_set_hps_source_and_sync(dev, source, sync);
-
-	/* restart overlay if it was active before */
-	if( 0 != restart_overlay ) {
-		saa7146_start_preview(ov_fh);
-	}
-
-	return 0;
-}
-
-int av7110_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 
-{
-	struct saa7146_dev *dev = fh->dev;
-	struct av7110 *av7110 = (struct av7110*)dev->ext_priv;
- 	DEB_EE(("saa7146_dev: %p\n",dev));
-
-	switch(cmd) {
-	case VIDIOC_G_TUNER:
-	{
-		struct v4l2_tuner *t = arg;
-		u16 stereo_det;
-		s8 stereo;
-
-		DEB_EE(("VIDIOC_G_TUNER: %d\n", t->index));
-
-		if( 0 == av7110->has_analog_tuner || t->index != 0 ) {
-			return -EINVAL;
-		}
-
-		memset(t,0,sizeof(*t));
-		strcpy(t->name, "Television");
-
-		t->type = V4L2_TUNER_ANALOG_TV;
-		t->capability = V4L2_TUNER_CAP_NORM | V4L2_TUNER_CAP_STEREO |
-			V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2 | V4L2_TUNER_CAP_SAP;
-		t->rangelow = 772;	/* 48.25 MHZ / 62.5 kHz = 772, see fi1216mk2-specs, page 2 */
-		t->rangehigh = 13684;	/* 855.25 MHz / 62.5 kHz = 13684 */
-		/* FIXME: add the real signal strength here */
-		t->signal = 0xffff;
-		t->afc = 0;		
-
-msp_readreg(av7110, MSP_RD_DEM, 0x007e, &stereo_det);
-printk("VIDIOC_G_TUNER: msp3400 TV standard detection: 0x%04x\n", stereo_det);
-
-		msp_readreg(av7110, MSP_RD_DSP, 0x0018, &stereo_det);
-		printk("VIDIOC_G_TUNER: msp3400 stereo detection: 0x%04x\n", stereo_det);
-		stereo = (s8)(stereo_det >> 8);
-		if (stereo > 0x10) {
-			/* stereo */
-		t->rxsubchans 	= V4L2_TUNER_SUB_STEREO | V4L2_TUNER_SUB_MONO;
-			t->audmode = V4L2_TUNER_MODE_STEREO;
-		}
-		else if (stereo < -0x10) {
-			/* bilingual*/
-			t->rxsubchans = V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2;
-			 t->audmode = V4L2_TUNER_MODE_LANG1;
-		}
-		else /* mono */
-			t->rxsubchans = V4L2_TUNER_SUB_MONO;
-
-		return 0;
-	}
-	case VIDIOC_S_TUNER:
-	{
-		struct v4l2_tuner *t = arg;
-		u16 fm_matrix, src;
-		DEB_EE(("VIDIOC_S_TUNER: %d\n", t->index));
-
-		if( 0 == av7110->has_analog_tuner || av7110->current_input != 1 ) {
-			return -EINVAL;
-		}
-
-
-		switch(t->audmode) {
-		case V4L2_TUNER_MODE_STEREO:
-				DEB_D(("VIDIOC_S_TUNER: V4L2_TUNER_MODE_STEREO\n"));
-			fm_matrix = 0x3001; // stereo
-			src = 0x0020;
-				break;
-		case V4L2_TUNER_MODE_LANG1:
-				DEB_D(("VIDIOC_S_TUNER: V4L2_TUNER_MODE_LANG1\n"));
-			fm_matrix = 0x3000; // mono
-			src = 0x0000;
-				break;
-		case V4L2_TUNER_MODE_LANG2:
-				DEB_D(("VIDIOC_S_TUNER: V4L2_TUNER_MODE_LANG2\n"));
-			fm_matrix = 0x3000; // mono
-			src = 0x0010;
-				break;
-		default: /* case V4L2_TUNER_MODE_MONO: {*/
-				DEB_D(("VIDIOC_S_TUNER: TDA9840_SET_MONO\n"));
-			fm_matrix = 0x3000; // mono
-			src = 0x0030;
-				break;
-			}
-		msp_writereg(av7110, MSP_WR_DSP, 0x000e, fm_matrix);
-		msp_writereg(av7110, MSP_WR_DSP, 0x0008, src);
-		msp_writereg(av7110, MSP_WR_DSP, 0x0009, src);
-		msp_writereg(av7110, MSP_WR_DSP, 0x000a, src);
-
-		return 0;
-	}
-	case VIDIOC_G_FREQUENCY:
-	{
-		struct v4l2_frequency *f = arg;
-
-		DEB_EE(("VIDIOC_G_FREQ: freq:0x%08x.\n", f->frequency));
-
-		if( 0 == av7110->has_analog_tuner || av7110->current_input != 1 ) {
-			return -EINVAL;
-		}
-
-		memset(f,0,sizeof(*f));
-		f->type = V4L2_TUNER_ANALOG_TV;
-		f->frequency =  av7110->current_freq;
-
-		return 0;
-	}
-	case VIDIOC_S_FREQUENCY:
-	{
-		struct v4l2_frequency *f = arg;
-
-		DEB_EE(("VIDIOC_S_FREQUENCY: freq:0x%08x.\n",f->frequency));
-
-		if( 0 == av7110->has_analog_tuner || av7110->current_input != 1 ) {
-			return -EINVAL;
-		}
-
-		if (V4L2_TUNER_ANALOG_TV != f->type)
-			return -EINVAL;
-
-		msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0xffe0); // fast mute
-		msp_writereg(av7110, MSP_WR_DSP, 0x0007, 0xffe0);
-
-		/* tune in desired frequency */			
-		tuner_set_tv_freq(dev, f->frequency);
-		av7110->current_freq = f->frequency;
-
-		msp_writereg(av7110, MSP_WR_DSP, 0x0015, 0x003f); // start stereo detection
-		msp_writereg(av7110, MSP_WR_DSP, 0x0015, 0x0000);
-		msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0x4f00); // loudspeaker + headphone
-		msp_writereg(av7110, MSP_WR_DSP, 0x0007, 0x4f00); // SCART 1 volume
-
-		return 0;
-	}
-	case VIDIOC_ENUMINPUT:
-	{
-		struct v4l2_input *i = arg;
-		
-		DEB_EE(("VIDIOC_ENUMINPUT: %d\n", i->index));
-
-		if( 0 != av7110->has_analog_tuner ) {
-			if( i->index < 0 || i->index >= 2) {
-				return -EINVAL;
-			}
-		} else {
-		if( i->index != 0 ) {
-			return -EINVAL;
-		}
-		}		
-
-		memcpy(i, &inputs[i->index], sizeof(struct v4l2_input));
-		
-		return 0;
-	}
-	case VIDIOC_G_INPUT:
-	{
-		int *input = (int *)arg;
-		*input = av7110->current_input;
-		DEB_EE(("VIDIOC_G_INPUT: %d\n", *input));
-		return 0;		
-	}	
-	case VIDIOC_S_INPUT:
-	{
-		int input = *(int *)arg;
-
-		DEB_EE(("VIDIOC_S_INPUT: %d\n", input));
-
-		if( 0 == av7110->has_analog_tuner ) {
-		return 0;		
-	}	
-		
-		if( input < 0 || input >= 2) {
-			return -EINVAL;
-		}
-		
-		/* fixme: switch inputs here */
-		av7110->current_input = input;
-		return av7110_dvb_c_switch(fh);
-	}	
-	case VIDIOC_G_AUDIO:
-	{
-		struct v4l2_audio *a = arg;
 
-		DEB_EE(("VIDIOC_G_AUDIO: %d\n", a->index));
-		if (a->index != 0)
-			return -EINVAL;
-		memcpy(a, &msp3400_v4l2_audio, sizeof(struct v4l2_audio));
-		break;
-	}
-	case VIDIOC_S_AUDIO:
-	{
-		struct v4l2_audio *a = arg;
-		DEB_EE(("VIDIOC_S_AUDIO: %d\n", a->index));
-		break;
-	}
-	default:
-		printk("no such ioctl\n");
-		return -ENOIOCTLCMD;
-	}
-	return 0;
-}	
-
-static unsigned int dvb_audio_poll(struct file *file, poll_table *wait)
-{
-	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
-        struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
-        unsigned int mask = 0;
-
-	DEB_EE(("av7110: %p\n",av7110));
-
-	poll_wait(file, &av7110->aout.queue, wait);
-
-	if (av7110->playing) {
-                if (dvb_ringbuffer_free(&av7110->aout)>=20*1024)
-                        mask |= (POLLOUT | POLLWRNORM);
-        } else /* if not playing: may play if asked for */
-		mask = (POLLOUT | POLLWRNORM);
-
-	return mask;
+	up(&av7110->pid_mutex);
 }
 
 
-/****************************************************************************
- * END OF V4L SECTION
- ****************************************************************************/
-
-
-/****************************************************************************
- * DVB API SECTION
- ****************************************************************************/
-
-
 /******************************************************************************
  * hardware filter functions
  ******************************************************************************/
 
 static int StartHWFilter(struct dvb_demux_filter *dvbdmxfilter)
 {
-        struct dvb_demux_feed *dvbdmxfeed=dvbdmxfilter->feed;
-        struct av7110 *av7110=(struct av7110 *) dvbdmxfeed->demux->priv;
-        u16 buf[20];
-        int ret, i;
-        u16 handle;
-//        u16 mode=0x0320;
-        u16 mode=0xb96a;
-        
- 	DEB_EE(("av7110: %p\n",av7110));
+	struct dvb_demux_feed *dvbdmxfeed = dvbdmxfilter->feed;
+	struct av7110 *av7110 = (struct av7110 *) dvbdmxfeed->demux->priv;
+	u16 buf[20];
+	int ret, i;
+	u16 handle;
+//	u16 mode=0x0320;
+	u16 mode=0xb96a;
+
+	DEB_EE(("av7110: %p\n",av7110));
 
-        if (dvbdmxfilter->type==DMX_TYPE_SEC) {
+	if (dvbdmxfilter->type == DMX_TYPE_SEC) {
 		if (hw_sections) {
-	                buf[4]=(dvbdmxfilter->filter.filter_value[0]<<8)|
-        	                dvbdmxfilter->maskandmode[0];
-                	for (i=3; i<18; i++)
-                        	buf[i+4-2]=(dvbdmxfilter->filter.filter_value[i]<<8)|
-                                	dvbdmxfilter->maskandmode[i];
-	                mode=4;
-		}
-        } else
-        if ((dvbdmxfeed->ts_type & TS_PACKET) &&
-            !(dvbdmxfeed->ts_type & TS_PAYLOAD_ONLY)) 
-                init_p2t(&av7110->p2t_filter[dvbdmxfilter->index], dvbdmxfeed);
-
-        buf[0] = (COMTYPE_PID_FILTER << 8) + AddPIDFilter; 
-        buf[1] = 16;	
-        buf[2] = dvbdmxfeed->pid;
-        buf[3] = mode;
+			buf[4] = (dvbdmxfilter->filter.filter_value[0] << 8) |
+				dvbdmxfilter->maskandmode[0];
+			for (i = 3; i < 18; i++)
+				buf[i + 4 - 2] =
+					(dvbdmxfilter->filter.filter_value[i] << 8) |
+					dvbdmxfilter->maskandmode[i];
+			mode = 4;
+                }
+	} else if ((dvbdmxfeed->ts_type & TS_PACKET) &&
+		   !(dvbdmxfeed->ts_type & TS_PAYLOAD_ONLY)) {
+		av7110_p2t_init(&av7110->p2t_filter[dvbdmxfilter->index], dvbdmxfeed);
+        }
+
+	buf[0] = (COMTYPE_PID_FILTER << 8) + AddPIDFilter;
+	buf[1] = 16;
+	buf[2] = dvbdmxfeed->pid;
+	buf[3] = mode;
 
-        ret=CommandRequest(av7110, buf, 20, &handle, 1);          
-        if (ret<0) {
+	ret = av7110_fw_request(av7110, buf, 20, &handle, 1);
+	if (ret < 0) {
 		printk("StartHWFilter error\n");
-                return ret;
-	}
+		return ret;
+        }
 
-        av7110->handle2filter[handle]=dvbdmxfilter;
-        dvbdmxfilter->hw_handle=handle;
+	av7110->handle2filter[handle] = dvbdmxfilter;
+	dvbdmxfilter->hw_handle = handle;
 
-        return ret;
-}
+	return ret;
+                }
 
 static int StopHWFilter(struct dvb_demux_filter *dvbdmxfilter)
 {
-        struct av7110 *av7110=(struct av7110 *) dvbdmxfilter->feed->demux->priv;
-        u16 buf[3];
-        u16 answ[2];
-        int ret;
-        u16 handle;
-                
- 	DEB_EE(("av7110: %p\n",av7110));
+	struct av7110 *av7110 = (struct av7110 *) dvbdmxfilter->feed->demux->priv;
+	u16 buf[3];
+	u16 answ[2];
+	int ret;
+	u16 handle;
+        
+	DEB_EE(("av7110: %p\n", av7110));
 
-        handle=dvbdmxfilter->hw_handle;
-        if (handle>32) {
-                DEB_S(("dvb: StopHWFilter tried to stop invalid filter %d.\n",
-                       handle));
-                DEB_S(("dvb: filter type = %d\n",  dvbdmxfilter->type));
-                return 0;
-        }
+	handle = dvbdmxfilter->hw_handle;
+	if (handle > 32) {
+		DEB_S(("dvb: StopHWFilter tried to stop invalid filter %d.\n",
+		       handle));
+		DEB_S(("dvb: filter type = %d\n", dvbdmxfilter->type));
+		return 0;
+                }
 
-        av7110->handle2filter[handle]=NULL;
+	av7110->handle2filter[handle] = NULL;
 
-        buf[0] = (COMTYPE_PID_FILTER << 8) + DelPIDFilter; 
-        buf[1] = 1;	
-        buf[2] = handle;
-        ret=CommandRequest(av7110, buf, 3, answ, 2);          
+	buf[0] = (COMTYPE_PID_FILTER << 8) + DelPIDFilter;
+	buf[1] = 1;
+	buf[2] = handle;
+	ret = av7110_fw_request(av7110, buf, 3, answ, 2);
 	if (ret)
 		printk("StopHWFilter error\n");
 
-        if (answ[1] != handle) {
-                DEB_S(("dvb: filter %d shutdown error :%d\n", handle, answ[1]));
-                ret=-1;
+	if (answ[1] != handle) {
+		DEB_S(("dvb: filter %d shutdown error :%d\n", handle, answ[1]));
+		ret = -1;
         }
         return ret;
 }
 
 
-static int av7110_write_to_decoder(struct dvb_demux_feed *feed, const u8 *buf, size_t len)
+static void dvb_feed_start_pid(struct dvb_demux_feed *dvbdmxfeed)
 {
-        struct dvb_demux *demux = feed->demux;
-        struct av7110 *av7110 = (struct av7110 *) demux->priv;
-        struct ipack *ipack = &av7110->ipack[feed->pes_type];
+	struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
+	struct av7110 *av7110 = (struct av7110 *) dvbdmx->priv;
+	u16 *pid = dvbdmx->pids, npids[5];
+	int i;
 
 	DEB_EE(("av7110: %p\n",av7110));
 
-        switch (feed->pes_type) {
-        case 0:
-                if (av7110->audiostate.stream_source==AUDIO_SOURCE_MEMORY)
-                        return -EINVAL;
-                break;
-        case 1:
-                if (av7110->videostate.stream_source==VIDEO_SOURCE_MEMORY)
-                        return -EINVAL;
-                break;
-        default:
-                return -1;
-        }
-
-        if (!(buf[3] & 0x10)) { // no payload?
-                return -1;
-        }
-        if (buf[1] & 0x40)
-                av7110_ipack_flush(ipack);
-
-        if (buf[3] & 0x20) {  // adaptation field?
-                len -= buf[4]+1;
-                buf += buf[4]+1;
-                if (!len)
-                        return 0;
-        }
-        
-        av7110_ipack_instant_repack(buf+4, len-4, &av7110->ipack[feed->pes_type]);
-        return 0;
-}
-
-
-static void dvb_feed_start_pid(struct dvb_demux_feed *dvbdmxfeed)
-{
-        struct dvb_demux *dvbdmx=dvbdmxfeed->demux;
-        struct av7110 *av7110=(struct av7110 *) dvbdmx->priv;
-        u16 *pid=dvbdmx->pids, npids[5];
-        int i;
+	npids[0] = npids[1] = npids[2] = npids[3] = npids[4] = 0xffff;
+	i = dvbdmxfeed->pes_type;
+	npids[i] = (pid[i]&0x8000) ? 0 : pid[i];
+	if ((i == 2) && npids[i] && (dvbdmxfeed->ts_type & TS_PACKET)) {
+		npids[i] = 0;
+		ChangePIDs(av7110, npids[1], npids[0], npids[2], npids[3], npids[4]);
+		StartHWFilter(dvbdmxfeed->filter);
+		return;
+	}
+	if (dvbdmxfeed->pes_type <= 2 || dvbdmxfeed->pes_type == 4)
+		ChangePIDs(av7110, npids[1], npids[0], npids[2], npids[3], npids[4]);
         
-	DEB_EE(("av7110: %p\n",av7110));
-
-        npids[0]=npids[1]=npids[2]=npids[3]=0xffff;
-        npids[4]=0xffff;
-        i=dvbdmxfeed->pes_type;
-        npids[i]=(pid[i]&0x8000) ? 0 : pid[i];
-        if ((i==2) && npids[i] && (dvbdmxfeed->ts_type & TS_PACKET)) {
-                npids[i]=0;
-                ChangePIDs(av7110, npids[1], npids[0], npids[2], npids[3], npids[4]);
-                StartHWFilter(dvbdmxfeed->filter); 
-                return;
-        }
-        if (dvbdmxfeed->pes_type<=2 || dvbdmxfeed->pes_type==4)
-                ChangePIDs(av7110, npids[1], npids[0], npids[2], npids[3], npids[4]);
-
-        if (dvbdmxfeed->pes_type<2 && npids[0])
-                if (av7110->fe_synced) 
-                        outcom(av7110, COMTYPE_PIDFILTER, Scan, 0);
-
-        if ((dvbdmxfeed->ts_type & TS_PACKET)) { 
-                if (dvbdmxfeed->pes_type == 0 && 
-                    !(dvbdmx->pids[0]&0x8000))
-                        AV_StartRecord(av7110, RP_AUDIO, 
-                                       dvbdmxfeed);
-                if (dvbdmxfeed->pes_type == 1 && 
-                    !(dvbdmx->pids[1]&0x8000))
-                        AV_StartRecord(av7110, RP_VIDEO, 
-                                       dvbdmxfeed);
-        }
+	if (dvbdmxfeed->pes_type < 2 && npids[0])
+		if (av7110->fe_synced)
+			av7110_fw_cmd(av7110, COMTYPE_PIDFILTER, Scan, 0);
+
+	if ((dvbdmxfeed->ts_type & TS_PACKET)) {
+		if (dvbdmxfeed->pes_type == 0 && !(dvbdmx->pids[0] & 0x8000))
+			av7110_av_start_record(av7110, RP_AUDIO, dvbdmxfeed);
+		if (dvbdmxfeed->pes_type == 1 && !(dvbdmx->pids[1] & 0x8000))
+			av7110_av_start_record(av7110, RP_VIDEO, dvbdmxfeed);
+	}
 }
-
+                
 static void dvb_feed_stop_pid(struct dvb_demux_feed *dvbdmxfeed)
 {
-        struct dvb_demux *dvbdmx=dvbdmxfeed->demux;
-        struct av7110 *av7110=(struct av7110 *) dvbdmx->priv;
-        u16 *pid=dvbdmx->pids, npids[5];
-        int i;
-        
-	DEB_EE(("av7110: %p\n",av7110));
-
-        if (dvbdmxfeed->pes_type<=1) {
-                AV_Stop(av7110, dvbdmxfeed->pes_type ? 
-                        RP_VIDEO : RP_AUDIO);
-                if (!av7110->rec_mode)
-                        dvbdmx->recording=0;
-                if (!av7110->playing)
-                        dvbdmx->playing=0;
-        }
-        npids[0]=npids[1]=npids[2]=npids[3]=0xffff;
-        npids[4]=0xffff;
-        i=dvbdmxfeed->pes_type;
-        switch (i) {
-        case 2: //teletext
-                if (dvbdmxfeed->ts_type & TS_PACKET)
-                        StopHWFilter(dvbdmxfeed->filter); 
-                npids[2]=0;
-                break;
-        case 0:
-        case 1:
-        case 4:
-                if (!pids_off) 
-                        return;
-                npids[i]=(pid[i]&0x8000) ? 0 : pid[i];
+	struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
+	struct av7110 *av7110 = (struct av7110 *) dvbdmx->priv;
+	u16 *pid = dvbdmx->pids, npids[5];
+	int i;
+                
+	DEB_EE(("av7110: %p\n", av7110));
+                
+	if (dvbdmxfeed->pes_type <= 1) {
+		av7110_av_stop(av7110, dvbdmxfeed->pes_type ?  RP_VIDEO : RP_AUDIO);
+		if (!av7110->rec_mode)
+			dvbdmx->recording = 0;
+		if (!av7110->playing)
+			dvbdmx->playing = 0;
+	}
+	npids[0] = npids[1] = npids[2] = npids[3] = npids[4] = 0xffff;
+	i = dvbdmxfeed->pes_type;
+	switch (i) {
+	case 2: //teletext
+		if (dvbdmxfeed->ts_type & TS_PACKET)
+			StopHWFilter(dvbdmxfeed->filter);
+		npids[2] = 0;
+                break;
+	case 0:
+	case 1:
+	case 4:
+		if (!pids_off)
+			return;
+		npids[i] = (pid[i]&0x8000) ? 0 : pid[i];
                 break;
         }
-        ChangePIDs(av7110, npids[1], npids[0], npids[2], npids[3], npids[4]);
+	ChangePIDs(av7110, npids[1], npids[0], npids[2], npids[3], npids[4]);
 }
-
+        
 static int av7110_start_feed(struct dvb_demux_feed *feed)
 {
-        struct dvb_demux *demux = feed->demux;
-        struct av7110 *av7110 = (struct av7110 *) demux->priv;
-
-	DEB_EE(("av7110: %p\n",av7110));
-
-        if (!demux->dmx.frontend)
-                return -EINVAL;
-
-        if (feed->pid > 0x1fff) 
-                return -EINVAL;
-
-        if (feed->type == DMX_TYPE_TS) {
-	        if ((feed->ts_type & TS_DECODER) &&
+	struct dvb_demux *demux = feed->demux;
+	struct av7110 *av7110 = (struct av7110 *) demux->priv;
+                
+	DEB_EE(("av7110: %p\n", av7110));
+                
+	if (!demux->dmx.frontend)
+		return -EINVAL;
+                        
+	if (feed->pid > 0x1fff)
+		return -EINVAL;
+                        
+	if (feed->type == DMX_TYPE_TS) {
+		if ((feed->ts_type & TS_DECODER) &&
 		    (feed->pes_type < DMX_TS_PES_OTHER)) {
-		        switch (demux->dmx.frontend->source) {
-			case DMX_MEMORY_FE: 
-			        if (feed->ts_type & TS_DECODER)
-				       if (feed->pes_type < 2 && 
-                                           !(demux->pids[0] & 0x8000) &&
+			switch (demux->dmx.frontend->source) {
+			case DMX_MEMORY_FE:
+				if (feed->ts_type & TS_DECODER)
+				       if (feed->pes_type < 2 &&
+					   !(demux->pids[0] & 0x8000) &&
 					   !(demux->pids[1] & 0x8000)) {
-                                               dvb_ringbuffer_flush_spinlock_wakeup(&av7110->avout);
-                                               dvb_ringbuffer_flush_spinlock_wakeup(&av7110->aout);
-                                               AV_StartPlay(av7110,RP_AV);
-                                               demux->playing = 1;
+					       dvb_ringbuffer_flush_spinlock_wakeup(&av7110->avout);
+					       dvb_ringbuffer_flush_spinlock_wakeup(&av7110->aout);
+					       av7110_av_start_play(av7110,RP_AV);
+					       demux->playing = 1;
 					}
-				break;
-			default:
-                                dvb_feed_start_pid(feed);
-				break;
-			}
-		} else
-		        if ((feed->ts_type & TS_PACKET) &&
-                            (demux->dmx.frontend->source!=DMX_MEMORY_FE))
-                                StartHWFilter(feed->filter); 
-        }
-        
-        if (feed->type == DMX_TYPE_SEC) {
-                int i;
-
-	        for (i=0; i<demux->filternum; i++) {
-		        if (demux->filter[i].state!=DMX_STATE_READY)
-			        continue;
-			if (demux->filter[i].type!=DMX_TYPE_SEC)
-			        continue;
-			if (demux->filter[i].filter.parent!=&feed->feed.sec)
-			        continue;
-			demux->filter[i].state=DMX_STATE_GO;
-                        if (demux->dmx.frontend->source!=DMX_MEMORY_FE)
-                                StartHWFilter(&demux->filter[i]); 
+                        break;
+                default:
+				dvb_feed_start_pid(feed);
+                        break;
                 }
+		} else if ((feed->ts_type & TS_PACKET) &&
+			   (demux->dmx.frontend->source != DMX_MEMORY_FE)) {
+			StartHWFilter(feed->filter);
+		}
 	}
+                
+	if (feed->type == DMX_TYPE_SEC) {
+		int i;
 
-        return 0;
+		for (i = 0; i < demux->filternum; i++) {
+			if (demux->filter[i].state != DMX_STATE_READY)
+				continue;
+			if (demux->filter[i].type != DMX_TYPE_SEC)
+				continue;
+			if (demux->filter[i].filter.parent != &feed->feed.sec)
+				continue;
+			demux->filter[i].state = DMX_STATE_GO;
+			if (demux->dmx.frontend->source != DMX_MEMORY_FE)
+				StartHWFilter(&demux->filter[i]);
+        }
+        }
+
+	return 0;
 }
 
 
 static int av7110_stop_feed(struct dvb_demux_feed *feed)
 {
-        struct dvb_demux *demux = feed->demux;
-        struct av7110 *av7110 = (struct av7110 *) demux->priv;
+	struct dvb_demux *demux = feed->demux;
+	struct av7110 *av7110 = (struct av7110 *) demux->priv;
 
 	DEB_EE(("av7110: %p\n",av7110));
 
-        if (feed->type == DMX_TYPE_TS) {
-                if (feed->ts_type & TS_DECODER) {
-                        if (feed->pes_type >= DMX_TS_PES_OTHER ||
-                            !demux->pesfilter[feed->pes_type]) 
-                                return -EINVAL;
-                        demux->pids[feed->pes_type]|=0x8000;
-                        demux->pesfilter[feed->pes_type]=0;
-                }
-                if (feed->ts_type & TS_DECODER &&
+	if (feed->type == DMX_TYPE_TS) {
+		if (feed->ts_type & TS_DECODER) {
+			if (feed->pes_type >= DMX_TS_PES_OTHER ||
+			    !demux->pesfilter[feed->pes_type])
+				return -EINVAL;
+			demux->pids[feed->pes_type] |= 0x8000;
+			demux->pesfilter[feed->pes_type] = 0;
+		}
+		if (feed->ts_type & TS_DECODER &&
 		    feed->pes_type < DMX_TS_PES_OTHER) {
-                        dvb_feed_stop_pid(feed);
-                } else 
-                        if ((feed->ts_type & TS_PACKET) &&
-                            (demux->dmx.frontend->source != DMX_MEMORY_FE))
-                                StopHWFilter(feed->filter); 
-        }
-        
-        if (feed->type == DMX_TYPE_SEC) {
-                int i;
+			dvb_feed_stop_pid(feed);
+		} else
+			if ((feed->ts_type & TS_PACKET) &&
+			    (demux->dmx.frontend->source != DMX_MEMORY_FE))
+				StopHWFilter(feed->filter);
+	}
 
-	        for (i=0; i<demux->filternum; i++)
-		        if (demux->filter[i].state==DMX_STATE_GO && 
-			    demux->filter[i].filter.parent==&feed->feed.sec) {
-			        demux->filter[i].state=DMX_STATE_READY;
-                                if (demux->dmx.frontend->source!=DMX_MEMORY_FE)
-                                        StopHWFilter(&demux->filter[i]); 
-                }
+	if (feed->type == DMX_TYPE_SEC) {
+		int i;
+
+		for (i=0; i<demux->filternum; i++)
+			if (demux->filter[i].state == DMX_STATE_GO &&
+			    demux->filter[i].filter.parent == &feed->feed.sec) {
+				demux->filter[i].state = DMX_STATE_READY;
+				if (demux->dmx.frontend->source != DMX_MEMORY_FE)
+					StopHWFilter(&demux->filter[i]);
+		}
 	}
 
         return 0;
@@ -3289,33 +951,33 @@
 
 static void restart_feeds(struct av7110 *av7110)
 {
-        struct dvb_demux *dvbdmx=&av7110->demux;
-        struct dvb_demux_feed *feed;
-        int mode;
-        int i;
+	struct dvb_demux *dvbdmx = &av7110->demux;
+	struct dvb_demux_feed *feed;
+	int mode;
+	int i;
 
 	DEB_EE(("av7110: %p\n",av7110));
 
-        mode=av7110->playing;
-        av7110->playing=0;
-        av7110->rec_mode=0;
-
-        for (i=0; i<dvbdmx->filternum; i++) {
-                feed=&dvbdmx->feed[i];
-                if (feed->state==DMX_STATE_GO)
-                        av7110_start_feed(feed);
-        }
+	mode = av7110->playing;
+	av7110->playing = 0;
+	av7110->rec_mode = 0;
+
+	for (i = 0; i < dvbdmx->filternum; i++) {
+		feed = &dvbdmx->feed[i];
+		if (feed->state == DMX_STATE_GO)
+			av7110_start_feed(feed);
+	}
 
-        if (mode)
-                AV_StartPlay(av7110, mode);
+	if (mode)
+		av7110_av_start_play(av7110, mode);
 }
 
 static int dvb_get_stc(struct dmx_demux *demux, unsigned int num,
-		uint64_t *stc, unsigned int *base)
+		       uint64_t *stc, unsigned int *base)
 {
 	int ret;
-        u16 fwstc[4];
-        u16 tag = ((COMTYPE_REQUEST << 8) + ReqSTC);
+	u16 fwstc[4];
+	u16 tag = ((COMTYPE_REQUEST << 8) + ReqSTC);
 	struct dvb_demux *dvbdemux;
 	struct av7110 *av7110;
 
@@ -3332,18 +994,18 @@
 	if (num != 0)
 		return -EINVAL;
 
-        ret = CommandRequest(av7110, &tag, 0, fwstc, 4);
+	ret = av7110_fw_request(av7110, &tag, 0, fwstc, 4);
 	if (ret) {
-		printk(KERN_ERR "%s: CommandRequest error\n", __FUNCTION__);
+		printk(KERN_ERR "%s: av7110_fw_request error\n", __FUNCTION__);
 		return -EIO;
-	}
+}
 	DEB_EE(("av7110: fwstc = %04hx %04hx %04hx %04hx\n",
-			fwstc[0], fwstc[1], fwstc[2], fwstc[3]));
+		fwstc[0], fwstc[1], fwstc[2], fwstc[3]));
 
-	*stc =  (((uint64_t) ((fwstc[3] & 0x8000) >> 15)) << 32) |
-		(((uint64_t)fwstc[1])     << 16) | ((uint64_t)fwstc[0]);
+	*stc =	(((uint64_t) ((fwstc[3] & 0x8000) >> 15)) << 32) |
+		(((uint64_t)  fwstc[1]) << 16) | ((uint64_t) fwstc[0]);
 	*base = 1;
-
+        
 	DEB_EE(("av7110: stc = %lu\n", (unsigned long)*stc));
 
 	return 0;
@@ -3354,893 +1016,45 @@
  * SEC device file operations
  ******************************************************************************/
 
-static int av7110_diseqc_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
+static int av7110_diseqc_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *arg)
 {
 	struct av7110 *av7110 = fe->before_after_data;
 
-	DEB_EE(("av7110: %p\n",av7110));
+	DEB_EE(("av7110: %p\n", av7110));
 
 	switch (cmd) {
 	case FE_SET_TONE:
 		switch ((fe_sec_tone_mode_t) arg) {
 		case SEC_TONE_ON:
-			Set22K (av7110, 1);
+			Set22K(av7110, 1);
 			break;
 		case SEC_TONE_OFF:
-			Set22K (av7110, 0);
+			Set22K(av7110, 0);
 			break;
 		default:
 			return -EINVAL;
-		};
+};
 		break;
 
 	case FE_DISEQC_SEND_MASTER_CMD:
 	{
 		struct dvb_diseqc_master_cmd *cmd = arg;
-		SendDiSEqCMsg (av7110, cmd->msg_len, cmd->msg, -1);
+		av7110_diseqc_send(av7110, cmd->msg_len, cmd->msg, -1);
 		break;
 	}
 
 	case FE_DISEQC_SEND_BURST:
-		SendDiSEqCMsg (av7110, 0, NULL, (unsigned long)arg);
+		av7110_diseqc_send(av7110, 0, NULL, (unsigned long) arg);
 		break;
 
 	default:
 		return -EOPNOTSUPP;
-	};
-
-	return 0;
-}
-
-/******************************************************************************
- * CI link layer file ops (FIXME: move this to separate module later)
- ******************************************************************************/
-
-int ci_ll_init(struct dvb_ringbuffer *cirbuf, struct dvb_ringbuffer *ciwbuf, int size)
-{
-        dvb_ringbuffer_init(cirbuf, vmalloc(size), size);
-        dvb_ringbuffer_init(ciwbuf, vmalloc(size), size);
-        return 0;
-}
-
-void ci_ll_flush(struct dvb_ringbuffer *cirbuf, struct dvb_ringbuffer *ciwbuf)
-{
-        dvb_ringbuffer_flush_spinlock_wakeup(cirbuf);
-        dvb_ringbuffer_flush_spinlock_wakeup(ciwbuf);
-}
-
-void ci_ll_release(struct dvb_ringbuffer *cirbuf, struct dvb_ringbuffer *ciwbuf)
-{
-        vfree(cirbuf->data);
-        cirbuf->data=0;
-        vfree(ciwbuf->data);
-        ciwbuf->data=0;
-}
-
-
-int ci_ll_reset(struct dvb_ringbuffer *cibuf, struct file *file, 
-                int slots, ca_slot_info_t *slot)
-{
-	int i;
-	int len=0;
-	u8 msg[8]={0x00,0x06,0,0x00,0xff,0x02,0x00,0x00};
-
-	for (i=0; i<2; i++) {
-		if (slots & (1<<i)) 
-			len+=8;
-	}
-
-	if (dvb_ringbuffer_free(cibuf) < len)
-		return -EBUSY;
-
-	for (i=0; i<2; i++) {
-		if (slots & (1<<i)) {
-			msg[2]=i;
-			dvb_ringbuffer_write(cibuf,msg,8,0);
-			slot[i].flags=0;
-		}
-	}
-
-	return 0;
-}
-
-static ssize_t ci_ll_write(struct dvb_ringbuffer *cibuf, struct file *file, const char *buf, size_t count, loff_t *ppos)
-{
-        int free;
-        int non_blocking=file->f_flags&O_NONBLOCK;
-
-        if (count>2048)
-                return -EINVAL;
-        free=dvb_ringbuffer_free(cibuf);
-        if (count+2>free) { 
-                if (non_blocking)
-                        return -EWOULDBLOCK;
-                if (wait_event_interruptible(cibuf->queue,
-                                             (dvb_ringbuffer_free(cibuf)>=count+2)))
-                        return 0;
-        }
-
-        DVB_RINGBUFFER_WRITE_BYTE(cibuf,count>>8);   
-        DVB_RINGBUFFER_WRITE_BYTE(cibuf,count&0xff); 
-
-        return dvb_ringbuffer_write(cibuf,buf,count,1);
-}
-
-static ssize_t ci_ll_read(struct dvb_ringbuffer *cibuf, struct file *file, char *buf, size_t count, loff_t *ppos)
-{
-	int avail;
-	int non_blocking=file->f_flags&O_NONBLOCK;
-	ssize_t len;
-
-	if (!cibuf->data || !count)
-	        return 0;
-	if (non_blocking && (dvb_ringbuffer_empty(cibuf)))
-	        return -EWOULDBLOCK;
-	if (wait_event_interruptible(cibuf->queue, 
-				     !dvb_ringbuffer_empty(cibuf)))
-		return 0;
-	avail=dvb_ringbuffer_avail(cibuf);
-	if (avail<4) 
-		return 0;
-	len= DVB_RINGBUFFER_PEEK(cibuf,0)<<8;
-	len|=DVB_RINGBUFFER_PEEK(cibuf,1);
-	if (avail<len+2 || count<len) 
-		return -EINVAL;
-	DVB_RINGBUFFER_SKIP(cibuf,2);
-
-	return dvb_ringbuffer_read(cibuf,buf,len,1);
-}
-
-static int dvb_ca_open(struct inode *inode, struct file *file)
-{
-	struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
-        struct av7110 *av7110=(struct av7110 *) dvbdev->priv;
-        int err=dvb_generic_open(inode, file);
-
-	DEB_EE(("av7110: %p\n",av7110));
-
-        if (err<0)
-                return err;
-        ci_ll_flush(&av7110->ci_rbuffer, &av7110->ci_wbuffer);
-        return 0;
-}
-
-static unsigned int dvb_ca_poll (struct file *file, poll_table *wait)
-{
-	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
-        struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
-        struct dvb_ringbuffer *rbuf = &av7110->ci_rbuffer;
-        struct dvb_ringbuffer *wbuf = &av7110->ci_wbuffer;
-        unsigned int mask = 0;
-
-	DEB_EE(("av7110: %p\n",av7110));
-
-        poll_wait (file, &rbuf->queue, wait);
-        
-        if (!dvb_ringbuffer_empty(rbuf))
-                mask |= POLLIN;
-
-	if (dvb_ringbuffer_avail(wbuf)>1024)
-                mask |= POLLOUT;
-
-        return mask;
-}
-
-static int dvb_ca_ioctl(struct inode *inode, struct file *file, 
-                 unsigned int cmd, void *parg)
-{
-	struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
-        struct av7110 *av7110=(struct av7110 *) dvbdev->priv;
-        unsigned long arg=(unsigned long) parg;
-
-	DEB_EE(("av7110: %p\n",av7110));
-
-        switch (cmd) {
-        case CA_RESET:
-#ifdef NEW_CI
-                
-                return ci_ll_reset(&av7110->ci_wbuffer, file, arg, &av7110->ci_slot[0]);
-#endif                        
-                break;
-                
-        case CA_GET_CAP:
-        {
-                ca_caps_t cap;
-                
-                cap.slot_num=2;
-#ifdef NEW_CI
-                cap.slot_type=(FW_CI_LL_SUPPORT(av7110->arm_app) ? CA_CI_LINK : CA_CI) | CA_DESCR;
-#else
-                cap.slot_type=CA_CI|CA_DESCR;
-#endif
-                cap.descr_num=16;
-                cap.descr_type=CA_ECD;
-                memcpy(parg, &cap, sizeof(cap));
-        }
-        break;
-
-        case CA_GET_SLOT_INFO:
-        {
-                ca_slot_info_t *info=(ca_slot_info_t *)parg;
-
-                if (info->num>1)
-                        return -EINVAL;
-                av7110->ci_slot[info->num].num = info->num;
-#ifdef NEW_CI
-                av7110->ci_slot[info->num].type = FW_CI_LL_SUPPORT(av7110->arm_app) ? CA_CI_LINK : CA_CI;
-#else
-                av7110->ci_slot[info->num].type = CA_CI;
-#endif
-                memcpy(info, &av7110->ci_slot[info->num], sizeof(ca_slot_info_t));
-        }
-        break;
-
-        case CA_GET_MSG:
-                break;
-
-        case CA_SEND_MSG:
-                break;
-                
-        case CA_GET_DESCR_INFO:
-        {
-                ca_descr_info_t info;
-
-                info.num=16;
-                info.type=CA_ECD;
-                memcpy (parg, &info, sizeof (info));
-        }
-        break;
-
-        case CA_SET_DESCR:
-        {
-                ca_descr_t *descr=(ca_descr_t*) parg;
-
-                if (descr->index>=16)
-                        return -EINVAL;
-                if (descr->parity>1)
-                        return -EINVAL;
-                outcom(av7110, COMTYPE_PIDFILTER, SetDescr, 5,
-                       (descr->index<<8)|descr->parity,
-                       (descr->cw[0]<<8)|descr->cw[1],
-                       (descr->cw[2]<<8)|descr->cw[3],
-                       (descr->cw[4]<<8)|descr->cw[5],
-                       (descr->cw[6]<<8)|descr->cw[7]);
-        }
-        break;
-
-        default:
-                return -EINVAL;
-        }
-        return 0;
-}
-
-static ssize_t dvb_ca_write(struct file *file, const char *buf, 
-             size_t count, loff_t *ppos)
-{
-	struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
-        struct av7110 *av7110=(struct av7110 *) dvbdev->priv;
-        
-	DEB_EE(("av7110: %p\n",av7110));
-        return ci_ll_write(&av7110->ci_wbuffer, file, buf, count, ppos);
-}
-
-static ssize_t dvb_ca_read(struct file *file, char *buf, size_t count, loff_t *ppos)
-{
-	struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
-        struct av7110 *av7110=(struct av7110 *) dvbdev->priv;
-
-	DEB_EE(("av7110: %p\n",av7110));
-        return ci_ll_read(&av7110->ci_rbuffer, file, buf, count, ppos);
-}
-
-
-
-/******************************************************************************
- * Video MPEG decoder events
- ******************************************************************************/
-static void dvb_video_add_event (struct av7110 *av7110, struct video_event *event)
-{
-	struct dvb_video_events *events = &av7110->video_events;
-	int wp;
-
-	DEB_D(("\n"));
-
-	spin_lock_bh(&events->lock);
-
-	wp = (events->eventw + 1) % MAX_VIDEO_EVENT;
-
-	if (wp == events->eventr) {
-		events->overflow = 1;
-		events->eventr = (events->eventr + 1) % MAX_VIDEO_EVENT;
-	}
-
-	//FIXME: timestamp?
-	memcpy(&events->events[events->eventw], event, sizeof(struct video_event));
-
-	events->eventw = wp;
-
-	spin_unlock_bh(&events->lock);
-
-	wake_up_interruptible (&events->wait_queue);
-}
-
-
-static int dvb_video_get_event (struct av7110 *av7110, struct video_event *event, int flags)
-{
-	struct dvb_video_events *events = &av7110->video_events;
-
-	DEB_D(("\n"));
-
-	if (events->overflow) {
-                events->overflow = 0;
-                return -EOVERFLOW;
-        }
-
-        if (events->eventw == events->eventr) {
-		int ret;
-
-                if (flags & O_NONBLOCK)
-                        return -EWOULDBLOCK;
-
-                ret = wait_event_interruptible (events->wait_queue,
-                                                events->eventw != events->eventr);
-                if (ret < 0)
-                        return ret;
-        }
-
-	spin_lock_bh(&events->lock);
-
-	memcpy (event, &events->events[events->eventr],
-		sizeof(struct video_event));
-
-        events->eventr = (events->eventr + 1) % MAX_VIDEO_EVENT;
-
-	spin_unlock_bh(&events->lock);
-
-        return 0;
-}
-
-
-/******************************************************************************
- * DVB device file operations
- ******************************************************************************/
-
-static unsigned int dvb_video_poll(struct file *file, poll_table *wait)
-{
-	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
-        struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
-        unsigned int mask = 0;
-
-	DEB_EE(("av7110: %p\n",av7110));
-
-	if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
-	poll_wait(file, &av7110->avout.queue, wait);
-	}
-	
-	poll_wait(file, &av7110->video_events.wait_queue, wait);
-
-	if (av7110->video_events.eventw != av7110->video_events.eventr)
-		mask = POLLPRI;
-
-	if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
-	if (av7110->playing) {
-                if (FREE_COND)
-                        mask |= (POLLOUT | POLLWRNORM);
-        } else /* if not playing: may play if asked for */
-                mask |= (POLLOUT | POLLWRNORM);
-	}
-
-        return mask;
-}
-
-static ssize_t dvb_video_write(struct file *file, const char *buf, 
-                size_t count, loff_t *ppos)
-{
-	struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
-        struct av7110 *av7110=(struct av7110 *) dvbdev->priv;
-
-	DEB_EE(("av7110: %p\n",av7110));
-
-	if ((file->f_flags & O_ACCMODE) == O_RDONLY) {
-		return -EPERM;
-	}
-
-        if (av7110->videostate.stream_source!=VIDEO_SOURCE_MEMORY) 
-                return -EPERM;
-
-	return dvb_play(av7110, buf, count, file->f_flags&O_NONBLOCK, 1, 1);
-}
-
-static ssize_t dvb_audio_write(struct file *file, const char *buf, 
-                size_t count, loff_t *ppos)
-{
-	struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
-        struct av7110 *av7110=(struct av7110 *) dvbdev->priv;
-
-	DEB_EE(("av7110: %p\n",av7110));
-
-        if (av7110->audiostate.stream_source!=AUDIO_SOURCE_MEMORY) {
-                printk(KERN_ERR "not audio source memory\n");
-                return -EPERM;
-        }
-        return dvb_aplay(av7110, buf, count, file->f_flags&O_NONBLOCK, 0);
-}
-
-u8 iframe_header[] = { 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x80, 0x00, 0x00 };
-
-#define MIN_IFRAME 400000
-
-static int play_iframe(struct av7110 *av7110, u8 *buf, unsigned int len, int nonblock)
-{
-        int i, n=1;
-       
-	DEB_EE(("av7110: %p\n",av7110));
-
-        if (!(av7110->playing&RP_VIDEO)) {
-                if (AV_StartPlay(av7110, RP_VIDEO) < 0)
-			return -EBUSY;
-                n=MIN_IFRAME/len+1;
-        }
-
-	/* setting n always > 1, fixes problems when playing stillframes
-	   consisting of I- and P-Frames */
-	n=MIN_IFRAME/len+1;
-	
-	/* FIXME: nonblock? */
-	dvb_play(av7110, iframe_header, sizeof(iframe_header), 0, 1, 0);
-
-	for (i=0; i<n; i++) 
-                dvb_play(av7110, buf, len, 0, 1, 1);
+};
 
-	av7110_ipack_flush(&av7110->ipack[1]);
 	return 0;
 }
 
 
-static int dvb_video_ioctl(struct inode *inode, struct file *file,
-            unsigned int cmd, void *parg)
-{
-	struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
-        struct av7110 *av7110=(struct av7110 *) dvbdev->priv;
-        unsigned long arg=(unsigned long) parg;
-        int ret=0;
-        
-	DEB_EE(("av7110: %p\n",av7110));
-
-        if ((file->f_flags&O_ACCMODE)==O_RDONLY) {
-		if ( cmd!=VIDEO_GET_STATUS && cmd!=VIDEO_GET_EVENT && 
-		     cmd!=VIDEO_GET_SIZE ) {
-                return -EPERM;
-		}
-	}
-        
-        switch (cmd) {
-        case VIDEO_STOP:
-                av7110->videostate.play_state=VIDEO_STOPPED;
-                if (av7110->videostate.stream_source==VIDEO_SOURCE_MEMORY)
-                        AV_Stop(av7110, RP_VIDEO);
-                else
-                        vidcom(av7110, 0x000e, 
-                               av7110->videostate.video_blank ? 0 : 1);
-                av7110->trickmode=TRICK_NONE;
-                break; 
-                
-        case VIDEO_PLAY:
-                av7110->trickmode=TRICK_NONE;
-                if (av7110->videostate.play_state==VIDEO_FREEZED) {
-                        av7110->videostate.play_state=VIDEO_PLAYING;
-                        vidcom(av7110, 0x000d, 0);
-                } 
-                
-                if (av7110->videostate.stream_source==VIDEO_SOURCE_MEMORY) {
-                        if (av7110->playing==RP_AV) {
-                                outcom(av7110, COMTYPE_REC_PLAY, __Stop, 0);
-                                av7110->playing&=~RP_VIDEO;
-                        }
-                        AV_StartPlay(av7110,RP_VIDEO);
-                        vidcom(av7110, 0x000d, 0);
-                } else {
-                        //AV_Stop(av7110, RP_VIDEO);
-                        vidcom(av7110, 0x000d, 0);
-                }
-                av7110->videostate.play_state=VIDEO_PLAYING;
-                break;
-                
-        case VIDEO_FREEZE:
-                av7110->videostate.play_state=VIDEO_FREEZED;
-                if (av7110->playing&RP_VIDEO) 
-                        outcom(av7110, COMTYPE_REC_PLAY, __Pause, 0);
-                else
-                        vidcom(av7110, 0x0102, 1);
-                av7110->trickmode=TRICK_FREEZE;
-                break;
-                
-        case VIDEO_CONTINUE:
-                if (av7110->playing&RP_VIDEO) 
-                        outcom(av7110, COMTYPE_REC_PLAY, __Continue, 0);
-                vidcom(av7110, 0x000d, 0);
-                av7110->videostate.play_state=VIDEO_PLAYING;
-                av7110->trickmode=TRICK_NONE;
-                break;
-                
-        case VIDEO_SELECT_SOURCE:
-                av7110->videostate.stream_source=(video_stream_source_t) arg;
-                break;
-                
-        case VIDEO_SET_BLANK:
-                av7110->videostate.video_blank=(int) arg;
-		break;
-                
-        case VIDEO_GET_STATUS:
-                memcpy(parg, &av7110->videostate, sizeof(struct video_status));
-                break;
-                
-        case VIDEO_GET_EVENT:
-                ret=dvb_video_get_event(av7110, parg, file->f_flags);
-		break;
-
-	case VIDEO_GET_SIZE:
-                memcpy(parg, &av7110->video_size, sizeof(video_size_t));
-		break;
-                
-        case VIDEO_SET_DISPLAY_FORMAT:
-        {
-                video_displayformat_t format=(video_displayformat_t) arg;
-                u16 val=0;
-                
-                switch(format) {
-                case VIDEO_PAN_SCAN:
-                        val=VID_PAN_SCAN_PREF;
-                        break;
-                        
-                case VIDEO_LETTER_BOX:
-                        val=VID_VC_AND_PS_PREF;
-                        break;
-                        
-                case VIDEO_CENTER_CUT_OUT:
-                        val=VID_CENTRE_CUT_PREF;
-                        break;
-                        
-                default:
-                        ret=-EINVAL;
-                        break;
-                }
-                if (ret<0)
-                        break;
-                av7110->videostate.video_format=format;
-                ret=outcom(av7110, COMTYPE_ENCODER, SetPanScanType, 
-                           1, (u16) val);
-                break;
-        }
-        
-        case VIDEO_SET_FORMAT:
-                if (arg>1) {
-                        ret=-EINVAL;
-                        break;
-                }
-                av7110->display_ar=arg;
-                ret=outcom(av7110, COMTYPE_ENCODER, SetMonitorType, 
-                           1, (u16) arg);
-                break;
-                
-        case VIDEO_STILLPICTURE:
-        { 
-                struct video_still_picture *pic=
-                        (struct video_still_picture *) parg;
-                av7110->videostate.stream_source = VIDEO_SOURCE_MEMORY;
-                dvb_ringbuffer_flush_spinlock_wakeup(&av7110->avout);
-                ret = play_iframe(av7110, pic->iFrame, pic->size,
-                            file->f_flags&O_NONBLOCK);
-                break;
-        }
-        
-        case VIDEO_FAST_FORWARD:
-                //note: arg is ignored by firmware
-                if (av7110->playing&RP_VIDEO) 
-                        outcom(av7110, COMTYPE_REC_PLAY, 
-                               __Scan_I, 2, AV_PES, 0);
-                else 
-                        vidcom(av7110, 0x16, arg); 
-                av7110->trickmode=TRICK_FAST;
-                av7110->videostate.play_state=VIDEO_PLAYING;
-                break;
-                
-        case VIDEO_SLOWMOTION:
-                if (av7110->playing&RP_VIDEO) {
-                        outcom(av7110, COMTYPE_REC_PLAY, __Slow, 2, 0, 0);
-                        vidcom(av7110, 0x22, arg);
-                } else {
-                        vidcom(av7110, 0x0d, 0);
-                        vidcom(av7110, 0x0e, 0);
-                        vidcom(av7110, 0x22, arg);
-                }
-                av7110->trickmode=TRICK_SLOW;
-                av7110->videostate.play_state=VIDEO_PLAYING;
-                break;
-                
-        case VIDEO_GET_CAPABILITIES:
-                *(int *)parg=VIDEO_CAP_MPEG1|
-                        VIDEO_CAP_MPEG2|
-                        VIDEO_CAP_SYS|
-                        VIDEO_CAP_PROG;
-                break;
-        
-        case VIDEO_CLEAR_BUFFER:
-                dvb_ringbuffer_flush_spinlock_wakeup(&av7110->avout);
-                av7110_ipack_reset(&av7110->ipack[1]);
-                
-                if (av7110->playing==RP_AV) {
-                        outcom(av7110, COMTYPE_REC_PLAY, 
-                               __Play, 2, AV_PES, 0);
-                        if (av7110->trickmode==TRICK_FAST)
-                                outcom(av7110, COMTYPE_REC_PLAY, 
-                                       __Scan_I, 2, AV_PES, 0);
-                        if (av7110->trickmode==TRICK_SLOW) {
-                                outcom(av7110, COMTYPE_REC_PLAY, __Slow, 2, 0, 0);
-                                vidcom(av7110, 0x22, arg);
-                        }
-                        if (av7110->trickmode==TRICK_FREEZE)
-                                vidcom(av7110, 0x000e, 1);
-                }
-                break;
-                
-        case VIDEO_SET_STREAMTYPE:
-                
-                break;
-                
-        default:
-                ret=-ENOIOCTLCMD;
-                break;
-        }
-        return ret;
-}
-
-static int dvb_audio_ioctl(struct inode *inode, struct file *file,
-            unsigned int cmd, void *parg)
-{
-	struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
-        struct av7110 *av7110=(struct av7110 *) dvbdev->priv;
-        unsigned long arg=(unsigned long) parg;
-        int ret=0;
-
-	DEB_EE(("av7110: %p\n",av7110));
-
-        if (((file->f_flags&O_ACCMODE)==O_RDONLY) &&
-            (cmd!=AUDIO_GET_STATUS))
-                return -EPERM;
-        
-        switch (cmd) {
-        case AUDIO_STOP:
-                if (av7110->audiostate.stream_source==AUDIO_SOURCE_MEMORY)
-                        AV_Stop(av7110, RP_AUDIO);
-                else
-                        audcom(av7110, 1);
-                av7110->audiostate.play_state=AUDIO_STOPPED;
-                break;
-                
-        case AUDIO_PLAY:
-                if (av7110->audiostate.stream_source==AUDIO_SOURCE_MEMORY)
-                        AV_StartPlay(av7110, RP_AUDIO);
-                audcom(av7110, 2);
-                av7110->audiostate.play_state=AUDIO_PLAYING;
-                break;
-                
-        case AUDIO_PAUSE:
-                audcom(av7110, 1);
-                av7110->audiostate.play_state=AUDIO_PAUSED;
-                break;
-                
-        case AUDIO_CONTINUE:
-                if (av7110->audiostate.play_state==AUDIO_PAUSED) {
-                        av7110->audiostate.play_state=AUDIO_PLAYING;
-                        audcom(av7110, 0x12);
-                } 
-                break;
-                
-        case AUDIO_SELECT_SOURCE:
-                av7110->audiostate.stream_source=(audio_stream_source_t) arg;
-                break;
-                
-        case AUDIO_SET_MUTE:
-        {
-                audcom(av7110, arg ? 1 : 2);
-                av7110->audiostate.mute_state=(int) arg;
-                break;
-        }
-        
-        case AUDIO_SET_AV_SYNC:
-                av7110->audiostate.AV_sync_state=(int) arg;
-                audcom(av7110, arg ? 0x0f : 0x0e);
-                break;
-                
-        case AUDIO_SET_BYPASS_MODE:
-                ret=-EINVAL;
-                break;
-                
-        case AUDIO_CHANNEL_SELECT:
-                av7110->audiostate.channel_select=(audio_channel_select_t) arg;
-                
-                switch(av7110->audiostate.channel_select) {
-                case AUDIO_STEREO:
-                        audcom(av7110, 0x80);
-                        break;
-                        
-                case AUDIO_MONO_LEFT:
-                        audcom(av7110, 0x100);
-                        break;
-                        
-                case AUDIO_MONO_RIGHT:
-                        audcom(av7110, 0x200);
-                        break;
-                        
-                default:
-                        ret=-EINVAL;
-                        break;
-                }
-                break;
-                
-        case AUDIO_GET_STATUS:
-                memcpy(parg, &av7110->audiostate, sizeof(struct audio_status));
-                break;
-                
-        case AUDIO_GET_CAPABILITIES:
-                *(int *)parg=AUDIO_CAP_LPCM|
-                        AUDIO_CAP_MP1|
-                        AUDIO_CAP_MP2;
-                break;
-
-        case AUDIO_CLEAR_BUFFER:
-                dvb_ringbuffer_flush_spinlock_wakeup(&av7110->aout);
-                av7110_ipack_reset(&av7110->ipack[0]);
-                if (av7110->playing==RP_AV)
-                        outcom(av7110, COMTYPE_REC_PLAY, 
-                               __Play, 2, AV_PES, 0);
-                break;
-        case AUDIO_SET_ID:
-                
-                break;
-        case AUDIO_SET_MIXER:
-        {
-                struct audio_mixer *amix=(struct audio_mixer *)parg;
-
-                SetVolume(av7110, amix->volume_left, amix->volume_right);
-                break;
-        }
-        case AUDIO_SET_STREAMTYPE:
-                break;
-        default:
-                ret=-ENOIOCTLCMD;
-                break;
-        }
-        return ret;
-}
-
-
-static int dvb_video_open(struct inode *inode, struct file *file)
-{
-	struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
-        struct av7110 *av7110=(struct av7110 *) dvbdev->priv;
-        int err;
-
-	DEB_EE(("av7110: %p\n",av7110));
-
-        if ((err=dvb_generic_open(inode, file))<0)
-                return err;
-
-	if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
-        dvb_ringbuffer_flush_spinlock_wakeup(&av7110->aout);
-        dvb_ringbuffer_flush_spinlock_wakeup(&av7110->avout);
-        av7110->video_blank=1;
-        av7110->audiostate.AV_sync_state=1;
-        av7110->videostate.stream_source=VIDEO_SOURCE_DEMUX;
-
-		/*  empty event queue */
-		av7110->video_events.eventr = av7110->video_events.eventw = 0;
-	}
-
-        return 0;
-}
-
-static int dvb_video_release(struct inode *inode, struct file *file)
-{
-	struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
-        struct av7110 *av7110=(struct av7110 *) dvbdev->priv;
-
-	DEB_EE(("av7110: %p\n",av7110));
-
-	if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
-        AV_Stop(av7110, RP_VIDEO);
-	}
-
-        return dvb_generic_release(inode, file);
-}
-
-static int dvb_audio_open(struct inode *inode, struct file *file)
-{
-	struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
-        struct av7110 *av7110=(struct av7110 *) dvbdev->priv;
-        int err=dvb_generic_open(inode, file);
-
-	DEB_EE(("av7110: %p\n",av7110));
-
-        if (err<0)
-                return err;
-        dvb_ringbuffer_flush_spinlock_wakeup(&av7110->aout);
-        av7110->audiostate.stream_source=AUDIO_SOURCE_DEMUX;
-        return 0;
-}
-
-static int dvb_audio_release(struct inode *inode, struct file *file)
-{
-	struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
-        struct av7110 *av7110=(struct av7110 *) dvbdev->priv;
-        
-	DEB_EE(("av7110: %p\n",av7110));
-
-        AV_Stop(av7110, RP_AUDIO);
-        return dvb_generic_release(inode, file);
-}
-
-
-
-/******************************************************************************
- * driver registration 
- ******************************************************************************/
-
-static struct file_operations dvb_video_fops = {
-	.owner		= THIS_MODULE,
-	.write		= dvb_video_write,
-	.ioctl		= dvb_generic_ioctl,
-	.open		= dvb_video_open,
-	.release	= dvb_video_release,
-	.poll		= dvb_video_poll,
-};
-
-static struct dvb_device dvbdev_video = {
-	.priv		= 0,
-	.users		= 6,
-	.readers	= 5,	/* arbitrary */
-	.writers	= 1,
-	.fops		= &dvb_video_fops,
-	.kernel_ioctl	= dvb_video_ioctl,
-};
-
-static struct file_operations dvb_audio_fops = {
-	.owner		= THIS_MODULE,
-	.write		= dvb_audio_write,
-	.ioctl		= dvb_generic_ioctl,
-	.open		= dvb_audio_open,
-	.release	= dvb_audio_release,
-	.poll		= dvb_audio_poll,
-};
-
-static struct dvb_device dvbdev_audio = {
-	.priv		= 0,
-	.users		= 1,
-	.writers	= 1,
-	.fops		= &dvb_audio_fops,
-	.kernel_ioctl	= dvb_audio_ioctl,
-};
-
-static struct file_operations dvb_ca_fops = {
-	.owner		= THIS_MODULE,
-	.read		= dvb_ca_read,
-	.write		= dvb_ca_write,
-	.ioctl		= dvb_generic_ioctl,
-	.open		= dvb_ca_open,
-	.release	= dvb_generic_release,
-	.poll		= dvb_ca_poll,
-};
-
-static struct dvb_device dvbdev_ca = {
-	.priv		= 0,
-	.users		= 1,
-	.writers	= 1,
-	.fops		= &dvb_ca_fops,
-	.kernel_ioctl	= dvb_ca_ioctl,
-};
-
-
 static void av7110_before_after_tune (fe_status_t s, void *data)
 {
 	struct av7110 *av7110 = data;
@@ -4260,10 +1074,10 @@
                         av7110->pids[DMX_PES_AUDIO], 
                         av7110->pids[DMX_PES_TELETEXT], 0, 
                         av7110->pids[DMX_PES_PCR]);
-        	outcom(av7110, COMTYPE_PIDFILTER, Scan, 0);
+		av7110_fw_cmd(av7110, COMTYPE_PIDFILTER, Scan, 0);
 	} else {
 		SetPIDs(av7110, 0, 0, 0, 0, 0);
-        	outcom(av7110, COMTYPE_PIDFILTER, FlushTSQueue, 0);
+		av7110_fw_cmd(av7110, COMTYPE_PIDFILTER, FlushTSQueue, 0);
 	}
 
         up(&av7110->pid_mutex);
@@ -4291,20 +1105,6 @@
 	dvb_add_frontend_ioctls (av7110->dvb_adapter,
 				 av7110_diseqc_ioctl, NULL, av7110);
 
-	av7110->audiostate.AV_sync_state=0;
-	av7110->audiostate.mute_state=0;
-	av7110->audiostate.play_state=AUDIO_STOPPED;
-	av7110->audiostate.stream_source=AUDIO_SOURCE_DEMUX;
-	av7110->audiostate.channel_select=AUDIO_STEREO;
-	av7110->audiostate.bypass_mode=0;
-
-	av7110->videostate.video_blank=0;
-	av7110->videostate.play_state=VIDEO_STOPPED;
-	av7110->videostate.stream_source=VIDEO_SOURCE_DEMUX;
-	av7110->videostate.video_format=VIDEO_FORMAT_4_3;
-	av7110->videostate.display_format=VIDEO_CENTER_CUT_OUT;
-        av7110->display_ar=VIDEO_FORMAT_4_3;
-
         dvbdemux->priv = (void *) av7110;
 
 	for (i=0; i<32; i++)
@@ -4346,32 +1146,13 @@
         if (ret < 0)
                 return ret;
 
-	init_waitqueue_head(&av7110->video_events.wait_queue);
-	spin_lock_init(&av7110->video_events.lock);
-	av7110->video_events.eventw = av7110->video_events.eventr = 0;
-	av7110->video_events.overflow = 0;
-	memset(&av7110->video_size, 0, sizeof (video_size_t));
-
-	dvb_register_device(av7110->dvb_adapter, &av7110->video_dev,
-			    &dvbdev_video, av7110, DVB_DEVICE_VIDEO);
-          
-	dvb_register_device(av7110->dvb_adapter, &av7110->audio_dev,
-			    &dvbdev_audio, av7110, DVB_DEVICE_AUDIO);
-  
-	dvb_register_device(av7110->dvb_adapter, &av7110->ca_dev,  
-                                    &dvbdev_ca, av7110, DVB_DEVICE_CA);
+	av7110_av_register(av7110);
+	av7110_ca_register(av7110);
+
 #ifdef CONFIG_DVB_AV7110_OSD
 	dvb_register_device(av7110->dvb_adapter, &av7110->osd_dev,
 			    &dvbdev_osd, av7110, DVB_DEVICE_OSD);
 #endif
-#ifdef USE_DVB_DSP
-                dvb->dsp_dev = dvb_register_dsp(dvb_audio_open, 
-                                                dvb_audio_release, 
-                                                dvb_audio_ioctl, 
-                                                dvb_audio_write, 
-                                                av7110->audio_dev);
-#endif
-//        }
         
         dvb_net_init(av7110->dvb_adapter, &av7110->dvb_net, &dvbdemux->dmx);
 
@@ -4403,163 +1184,73 @@
 	dvb_remove_frontend_ioctls (av7110->dvb_adapter,
 				    av7110_diseqc_ioctl, NULL);
 
-	dvb_unregister_device(av7110->audio_dev);
-	dvb_unregister_device(av7110->video_dev);
 	dvb_unregister_device(av7110->osd_dev);
-	dvb_unregister_device(av7110->ca_dev);
-#ifdef USE_DVB_DSP
-	dvb_unregister_dsp(av7110->dsp_dev);
-#endif
-//        }
+	av7110_av_unregister(av7110);
+	av7110_ca_unregister(av7110);
 }
 
-static int master_xfer (struct dvb_i2c_bus *i2c, const struct i2c_msg msgs[], int num)
-{
-	struct saa7146_dev *dev = i2c->data;
-	return saa7146_i2c_transfer(dev, msgs, num, 6);
-}
 
 /****************************************************************************
- * INITIALIZATION
+ * I2C client commands
  ****************************************************************************/
 
-struct saa7146_extension_ioctls ioctls[] = {
-	{ VIDIOC_ENUMINPUT, 	SAA7146_EXCLUSIVE },
-	{ VIDIOC_G_INPUT,	SAA7146_EXCLUSIVE },
-	{ VIDIOC_S_INPUT,	SAA7146_EXCLUSIVE },
-	{ VIDIOC_G_FREQUENCY,	SAA7146_EXCLUSIVE },
-	{ VIDIOC_S_FREQUENCY, 	SAA7146_EXCLUSIVE },
-	{ VIDIOC_G_TUNER, 	SAA7146_EXCLUSIVE },
-	{ VIDIOC_S_TUNER, 	SAA7146_EXCLUSIVE },
-	{ VIDIOC_G_AUDIO,	SAA7146_EXCLUSIVE },
-	{ VIDIOC_S_AUDIO,	SAA7146_EXCLUSIVE },
-	{ 0, 0 }
-};
-
-static u8 saa7113_init_regs[] = {
-	0x02, 0xd0,
-	0x03, 0x23,
-	0x04, 0x00,
-	0x05, 0x00,
-	0x06, 0xe9,
-	0x07, 0x0d,
-	0x08, 0x98,
-	0x09, 0x02,
-	0x0a, 0x80,
-	0x0b, 0x40,
-	0x0c, 0x40,
-	0x0d, 0x00,
-	0x0e, 0x01,
-	0x0f, 0x7c,
-	0x10, 0x48,
-	0x11, 0x0c,
-	0x12, 0x8b,
-	0x13, 0x1a,
-	0x14, 0x00,
-	0x15, 0x00,
-	0x16, 0x00,
-	0x17, 0x00,
-	0x18, 0x00,
-	0x19, 0x00,
-	0x1a, 0x00,
-	0x1b, 0x00,
-	0x1c, 0x00,
-	0x1d, 0x00,
-	0x1e, 0x00,
-
-	0x41, 0x77,
-	0x42, 0x77,
-	0x43, 0x77,
-	0x44, 0x77,
-	0x45, 0x77,
-	0x46, 0x77,
-	0x47, 0x77,
-	0x48, 0x77,
-	0x49, 0x77,
-	0x4a, 0x77,
-	0x4b, 0x77,
-	0x4c, 0x77,
-	0x4d, 0x77,
-	0x4e, 0x77,
-	0x4f, 0x77,
-	0x50, 0x77,
-	0x51, 0x77,
-	0x52, 0x77,
-	0x53, 0x77,
-	0x54, 0x77,
-	0x55, 0x77,
-	0x56, 0x77,
-	0x57, 0xff,
+int i2c_writereg(struct av7110 *av7110, u8 id, u8 reg, u8 val)
+{
+	u8 msg[2] = { reg, val };
+	struct dvb_i2c_bus *i2c = av7110->i2c_bus;
+	struct i2c_msg msgs;
 	
-	0xff
-};
+	msgs.flags = 0;
+	msgs.addr = id / 2;
+	msgs.len = 2;
+	msgs.buf = msg;
+	return i2c->xfer(i2c, &msgs, 1);
+}
 
+u8 i2c_readreg(struct av7110 *av7110, u8 id, u8 reg)
+{
+	struct dvb_i2c_bus *i2c = av7110->i2c_bus;
+	u8 mm1[] = {0x00};
+	u8 mm2[] = {0x00};
+	struct i2c_msg msgs[2];
 
-static struct saa7146_ext_vv av7110_vv_data_st;
-static struct saa7146_ext_vv av7110_vv_data_c;
+	msgs[0].flags = 0;
+	msgs[1].flags = I2C_M_RD;
+	msgs[0].addr = msgs[1].addr = id / 2;
+	mm1[0] = reg;
+	msgs[0].len = 1; msgs[1].len = 1;
+	msgs[0].buf = mm1; msgs[1].buf = mm2;
+	i2c->xfer(i2c, msgs, 2);
 
+	return mm2[0];
+}
 
+static int master_xfer(struct dvb_i2c_bus *i2c, const struct i2c_msg msgs[], int num)
+{
+	struct saa7146_dev *dev = i2c->data;
+	return saa7146_i2c_transfer(dev, msgs, num, 6);
+}
 
+/****************************************************************************
+ * INITIALIZATION
+ ****************************************************************************/
 
 
-#ifdef CONFIG_DVB_AV7110_FIRMWARE_FILE
-#include "av7110_firm.h"
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
+#define CONFIG_DVB_AV7110_FIRMWARE_FILE
 #endif
 
-static int av7110_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_data *pci_ext)
+static int check_firmware(struct av7110* av7110)
 {
-#ifndef CONFIG_DVB_AV7110_FIRMWARE_FILE
-	const struct firmware *fw;
-#endif
-	struct av7110 *av7110 = NULL;
-	int ret = 0;
 	u32 crc = 0, len = 0;
 	unsigned char *ptr;
 		
-	DEB_EE(("dev: %p, av7110: %p\n",dev,av7110));
-
-#ifndef CONFIG_DVB_AV7110_FIRMWARE_FILE 
-	/* request the av7110 firmware, this will block until someone uploads it */
-	ret = request_firmware(&fw, "dvb-ttpci-01.fw", &dev->pci->dev);
-	if ( 0 != ret ) {
-		printk("dvb-ttpci: cannot request firmware!\n");
-		return -EINVAL;
-	}
-
-	if (fw->size <= 200000) {
-		printk("dvb-ttpci: this firmware is way too small.\n");
-		return -EINVAL;
-	}
-#endif
-
-	/* prepare the av7110 device struct */
-	if (!(av7110 = kmalloc (sizeof (struct av7110), GFP_KERNEL))) {
-		printk ("%s: out of memory!\n", __FUNCTION__);
-		return -ENOMEM;
-	}
-	memset(av7110, 0, sizeof(struct av7110));
-	
-#ifndef CONFIG_DVB_AV7110_FIRMWARE_FILE 
-	/* check if the firmware is available */
-	av7110->bin_fw = (unsigned char*)vmalloc(fw->size);
-	if (NULL == av7110->bin_fw) {
-		DEB_D(("out of memory\n"));
-		kfree(av7110);
-		return -ENOMEM;
-	}
-	memcpy(av7110->bin_fw, fw->data, fw->size);
-	av7110->size_fw = fw->size;
-#else
-	av7110->bin_fw = dvb_ttpci_fw;
-	av7110->size_fw = sizeof dvb_ttpci_fw;
-#endif
-
 	/* check for firmware magic */
 	ptr = av7110->bin_fw;
 	if (ptr[0] != 'A' || ptr[1] != 'V' || 
 	    ptr[2] != 'F' || ptr[3] != 'W') {
 		printk("dvb-ttpci: this is not an av7110 firmware\n");
-		goto fw_error;
+		return -EINVAL;
 	}
 	ptr += 4;
 
@@ -4570,11 +1261,11 @@
 	ptr += 4;
 	if (len >= 512) {
 		printk("dvb-ttpci: dpram file is way to big.\n");
-		goto fw_error;
+		return -EINVAL;
 	}
 	if( crc != crc32_le(0,ptr,len)) {
 		printk("dvb-ttpci: crc32 of dpram file does not match.\n");
-		goto fw_error;
+		return -EINVAL;
 	}
 	av7110->bin_dpram = ptr;
 	av7110->size_dpram = len;
@@ -4586,21 +1277,81 @@
 	len = ntohl(*(u32*)ptr);
 	ptr += 4;
 	
-	if (len <= 200000 || len >= 300000 || len > ((av7110->bin_fw+av7110->size_fw)-ptr) ) {
+	if (len <= 200000 || len >= 300000 ||
+	    len > ((av7110->bin_fw + av7110->size_fw) - ptr)) {
 		printk("dvb-ttpci: root file has strange size (%d). aborting.\n",len);
-		goto fw_error;
+		return -EINVAL;
 	}
 	if( crc != crc32_le(0,ptr,len)) {
 		printk("dvb-ttpci: crc32 of dpram file does not match.\n");
-		goto fw_error;
+		return -EINVAL;
 	}
 	av7110->bin_root = ptr;
 	av7110->size_root = len;
+	return 0;
+}
+
+#ifdef CONFIG_DVB_AV7110_FIRMWARE_FILE
+#include "av7110_firm.h"
+static inline int get_firmware(struct av7110* av7110)
+{
+	av7110->bin_fw = dvb_ttpci_fw;
+	av7110->size_fw = sizeof(dvb_ttpci_fw);
+	return check_firmware(av7110);
+}
+#else
+static int get_firmware(struct av7110* av7110)
+{
+	int ret;
+	const struct firmware *fw;
+
+	/* request the av7110 firmware, this will block until someone uploads it */
+	ret = request_firmware(&fw, "dvb-ttpci-01.fw", &av7110->dev->pci->dev);
+	if (ret) {
+		printk("dvb-ttpci: cannot request firmware!\n");
+		return -EINVAL;
+	}
+	if (fw->size <= 200000) {
+		printk("dvb-ttpci: this firmware is way too small.\n");
+		return -EINVAL;
+	}
+	/* check if the firmware is available */
+	av7110->bin_fw = (unsigned char*) vmalloc(fw->size);
+	if (NULL == av7110->bin_fw) {
+		DEB_D(("out of memory\n"));
+		return -ENOMEM;
+	}
+	memcpy(av7110->bin_fw, fw->data, fw->size);
+	av7110->size_fw = fw->size;
+	if ((ret = check_firmware(av7110)))
+		vfree(av7110->bin_fw);
+	return ret;
+}
+#endif
+
+static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_data *pci_ext)
+{
+	struct av7110 *av7110 = NULL;
+	int ret = 0;
+
+	DEB_EE(("dev: %p\n", dev));
+
+	/* prepare the av7110 device struct */
+	if (!(av7110 = kmalloc (sizeof (struct av7110), GFP_KERNEL))) {
+		printk ("%s: out of memory!\n", __FUNCTION__);
+		return -ENOMEM;
+	}
+	DEB_EE(("av7110: %p\n", av7110));
+	memset(av7110, 0, sizeof(struct av7110));
 	
-	/* go on with regular device initialization */
 	av7110->card_name = (char*)pci_ext->ext_priv;
 	av7110->dev=(struct saa7146_dev *)dev;
-	(struct av7110*)dev->ext_priv = av7110;
+	dev->ext_priv = av7110;
+
+	if ((ret = get_firmware(av7110))) {
+		kfree(av7110);
+		return ret;
+	}
 
 	dvb_register_adapter(&av7110->dvb_adapter, av7110->card_name);
 
@@ -4651,14 +1402,6 @@
 	init_waitqueue_head(&av7110->arm_wait);
         av7110->arm_thread=0;
      
-        av7110->vidmode=VIDEO_MODE_PAL;
-
-        av7110_ipack_init(&av7110->ipack[0], IPACKS, play_audio_cb);
-        av7110->ipack[0].data=(void *) av7110;
-        av7110_ipack_init(&av7110->ipack[1], IPACKS, play_video_cb);
-        av7110->ipack[1].data=(void *) av7110;
-        
-
         /* allocate and init buffers */
         av7110->debi_virt = pci_alloc_consistent(dev->pci, 8192,
 						 &av7110->debi_bus);
@@ -4673,25 +1416,17 @@
                 goto err;
 	}
 
-        dvb_ringbuffer_init(&av7110->avout, av7110->iobuf, AVOUTLEN);
-        dvb_ringbuffer_init(&av7110->aout, av7110->iobuf+AVOUTLEN, AOUTLEN);
+	av7110_av_init(av7110);
 
         /* init BMP buffer */
         av7110->bmpbuf=av7110->iobuf+AVOUTLEN+AOUTLEN;
         init_waitqueue_head(&av7110->bmpq);
         
-        av7110->kbuf[0]=(u8 *)(av7110->iobuf+AVOUTLEN+AOUTLEN+BMPLEN);
-        av7110->kbuf[1]=av7110->kbuf[0]+2*IPACKS;
-
-        /* CI link layer buffers */
-        ci_ll_init(&av7110->ci_rbuffer, &av7110->ci_wbuffer, 8192);
-
-        /* handle different card types */
+	av7110_ca_init(av7110);
 
         /* load firmware into AV7110 cards */
-
-	bootarm(av7110);
-	firmversion(av7110);
+	av7110_bootarm(av7110);
+	av7110_firmversion(av7110);
 
 	if (FW_VERSION(av7110->arm_app)<0x2501)
 		printk ("av7110: Warning, firmware version 0x%04x is too old. "
@@ -4701,10 +1436,11 @@
 
 	/* set internal volume control to maximum */
 	av7110->adac_type = DVB_ADAC_TI;
-	SetVolume(av7110, 0xff, 0xff);
+	av7110_set_volume(av7110, 0xff, 0xff);
 
 	VidMode(av7110, vidmode);
 
+	/* handle different card types */
 	/* remaining inits according to card and frontend type */
 	av7110->has_analog_tuner = 0;
 	av7110->current_input = 0;
@@ -4720,72 +1456,8 @@
 	/**
 	 * some special handling for the Siemens DVB-C cards...
 	 */
-	} else if (i2c_writereg(av7110, 0x80, 0x0, 0x80) == 1
-			&& i2c_writereg(av7110, 0x80, 0x0, 0) == 1) {
-		u16 version1, version2;
-		printk ("av7110(%d): DVB-C analog module detected, "
-			"initializing MSP3400\n",
-			av7110->dvb_adapter->num);
-		av7110->adac_type = DVB_ADAC_MSP;
-		dvb_delay(100); // the probing above resets the msp...
-		msp_readreg(av7110, MSP_RD_DSP, 0x001e, &version1);
-		msp_readreg(av7110, MSP_RD_DSP, 0x001f, &version2);
-		printk("av7110(%d): MSP3400 version 0x%04x 0x%04x\n",
-			av7110->dvb_adapter->num, version1, version2);
-		msp_writereg(av7110, MSP_WR_DSP, 0x0013, 0x0c00);
-		msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0x7f00); // loudspeaker + headphone
-		msp_writereg(av7110, MSP_WR_DSP, 0x0008, 0x0220); // loudspeaker source
-		msp_writereg(av7110, MSP_WR_DSP, 0x0009, 0x0220); // headphone source
-		msp_writereg(av7110, MSP_WR_DSP, 0x0004, 0x7f00); // loudspeaker volume
-		msp_writereg(av7110, MSP_WR_DSP, 0x000a, 0x0220); // SCART 1 source
-		msp_writereg(av7110, MSP_WR_DSP, 0x0007, 0x7f00); // SCART 1 volume
-		msp_writereg(av7110, MSP_WR_DSP, 0x000d, 0x4800); // prescale SCART
-		
-		if (i2c_writereg(av7110, 0x48, 0x01, 0x00)!=1) {
-			INFO(("saa7113 not accessible.\n"));
-		}
-		else {
-			u8 *i = saa7113_init_regs;
-			av7110->has_analog_tuner = 1;
-			/* init the saa7113 */
-			while (*i != 0xff) {
-				if (i2c_writereg(av7110, 0x48, i[0], i[1]) != 1) {
-					printk("av7110(%d): saa7113 initialization failed",
-							av7110->dvb_adapter->num);
-					break;
-				}
-				i += 2;
-			}
-			/* setup msp for analog sound: B/G Dual-FM */
-			msp_writereg(av7110, MSP_WR_DEM, 0x00bb, 0x02d0); // AD_CV
-			msp_writereg(av7110, MSP_WR_DEM, 0x0001,  3); // FIR1
-			msp_writereg(av7110, MSP_WR_DEM, 0x0001, 18); // FIR1
-			msp_writereg(av7110, MSP_WR_DEM, 0x0001, 27); // FIR1
-			msp_writereg(av7110, MSP_WR_DEM, 0x0001, 48); // FIR1
-			msp_writereg(av7110, MSP_WR_DEM, 0x0001, 66); // FIR1
-			msp_writereg(av7110, MSP_WR_DEM, 0x0001, 72); // FIR1
-			msp_writereg(av7110, MSP_WR_DEM, 0x0005,  4); // FIR2
-			msp_writereg(av7110, MSP_WR_DEM, 0x0005, 64); // FIR2
-			msp_writereg(av7110, MSP_WR_DEM, 0x0005,  0); // FIR2
-			msp_writereg(av7110, MSP_WR_DEM, 0x0005,  3); // FIR2
-			msp_writereg(av7110, MSP_WR_DEM, 0x0005, 18); // FIR2
-			msp_writereg(av7110, MSP_WR_DEM, 0x0005, 27); // FIR2
-			msp_writereg(av7110, MSP_WR_DEM, 0x0005, 48); // FIR2
-			msp_writereg(av7110, MSP_WR_DEM, 0x0005, 66); // FIR2
-			msp_writereg(av7110, MSP_WR_DEM, 0x0005, 72); // FIR2
-			msp_writereg(av7110, MSP_WR_DEM, 0x0083, 0xa000); // MODE_REG
-			msp_writereg(av7110, MSP_WR_DEM, 0x0093, 0x00aa); // DCO1_LO 5.74MHz
-			msp_writereg(av7110, MSP_WR_DEM, 0x009b, 0x04fc); // DCO1_HI
-			msp_writereg(av7110, MSP_WR_DEM, 0x00a3, 0x038e); // DCO2_LO 5.5MHz
-			msp_writereg(av7110, MSP_WR_DEM, 0x00ab, 0x04c6); // DCO2_HI
-			msp_writereg(av7110, MSP_WR_DEM, 0x0056, 0); // LOAD_REG 1/2
-		}	
-
-		memcpy(standard,dvb_standard,sizeof(struct saa7146_standard)*2);
-		/* set dd1 stream a & b */
-      		saa7146_write(dev, DD1_STREAM_B, 0x00000000);
-		saa7146_write(dev, DD1_INIT, 0x03000700);
-		saa7146_write(dev, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26));
+	} else if (0 == av7110_init_analog_module(av7110)) {
+		/* done. */
 	}
 	else if (dev->pci->subsystem_vendor == 0x110a) {
 		printk("av7110(%d): DVB-C w/o analog module detected\n",
@@ -4800,14 +1472,14 @@
 
 	if (av7110->adac_type == DVB_ADAC_NONE || av7110->adac_type == DVB_ADAC_MSP) {
 		// switch DVB SCART on
-		outcom(av7110, COMTYPE_AUDIODAC, MainSwitch, 1, 0);
-		outcom(av7110, COMTYPE_AUDIODAC, ADSwitch, 1, 1);
+		av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, MainSwitch, 1, 0);
+		av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, ADSwitch, 1, 1);
 		if (rgb_on)
 			saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTHI); // RGB on, SCART pin 16
 		//saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); // SCARTpin 8
 	}
 	
-	SetVolume(av7110, 0xff, 0xff);
+	av7110_set_volume(av7110, 0xff, 0xff);
 
 	av7110_setup_irc_config (av7110, 0);
 	av7110_register(av7110);
@@ -4815,40 +1487,16 @@
 	/* special case DVB-C: these cards have an analog tuner
 	   plus need some special handling, so we have separate
 	   saa7146_ext_vv data for these... */
-	if (0 != av7110->has_analog_tuner) {
-		ret = saa7146_vv_init(dev, &av7110_vv_data_c);
-	} else {
-		ret = saa7146_vv_init(dev, &av7110_vv_data_st);
-	}
+	ret = av7110_init_v4l(av7110);
 	
-	if ( 0 != ret) {
-		ERR(("cannot init capture device. skipping.\n"));
-		ret = -ENODEV;
+	if (ret)
 		goto err;
-	}
-
-	if (saa7146_register_device(&av7110->v4l_dev, dev, "av7110", VFL_TYPE_GRABBER)) {
-		ERR(("cannot register capture device. skipping.\n"));
-		ret = -ENODEV;
-		goto video_err;
-	}
-	
-	if (0 != av7110->has_analog_tuner) {
-		if( 0 != saa7146_register_device(&av7110->vbi_dev, dev, "av7110", VFL_TYPE_VBI)) {
-			ERR(("cannot register vbi v4l2 device. skipping.\n"));
-		}
-		/* we use this to remember that this dvb-c card cannot do vbi */
-		av7110->has_analog_tuner = 2;
-	}	
 
 	printk(KERN_INFO "av7110: found av7110-%d.\n",av7110_num);
 	av7110->device_initialized = 1;
 	av7110_num++;
         return 0;
 
-video_err:
-	saa7146_vv_release(dev);
-
 err:
 	if (NULL != av7110 ) {
 		kfree(av7110);
@@ -4866,12 +1514,6 @@
 	dvb_unregister_adapter (av7110->dvb_adapter);
 
 	return ret;
-fw_error:
-#ifndef CONFIG_DVB_AV7110_FIRMWARE_FILE 
-	vfree(av7110->bin_fw);
-#endif
-	kfree(av7110);
-	return -EINVAL;
 }
 
 static int av7110_detach (struct saa7146_dev* saa)
@@ -4883,10 +1525,7 @@
 		return 0;
 	}
 
-	saa7146_unregister_device(&av7110->v4l_dev, saa);
-	if (2 == av7110->has_analog_tuner) {
-		saa7146_unregister_device(&av7110->vbi_dev, saa);
-	}	
+	av7110_exit_v4l(av7110);
 
 	av7110->arm_rmmod=1;
 	wake_up_interruptible(&av7110->arm_wait);
@@ -4902,9 +1541,9 @@
 	
 	saa7146_write(av7110->dev, ISR,(MASK_19 | MASK_03));
 
-	ci_ll_release(&av7110->ci_rbuffer, &av7110->ci_wbuffer);
-	av7110_ipack_free(&av7110->ipack[0]);
-	av7110_ipack_free(&av7110->ipack[1]);
+	av7110_ca_exit(av7110);
+	av7110_av_exit(av7110);
+
 	vfree(av7110->iobuf);
 	pci_free_consistent(saa->pci, 8192, av7110->debi_virt,
 			    av7110->debi_bus);
@@ -4914,9 +1553,8 @@
 
 	av7110_num--;
 #ifndef CONFIG_DVB_AV7110_FIRMWARE_FILE 
-	if (NULL != av7110->bin_fw ) {
+	if (av7110->bin_fw)
 		vfree(av7110->bin_fw);
-	}
 #endif
 	kfree (av7110);
 	saa->ext_priv = NULL;
@@ -4939,50 +1577,6 @@
 }
 
 
-/* FIXME: these values are experimental values that look better than the
-   values from the latest "official" driver -- at least for me... (MiHu) */
-static struct saa7146_standard standard[] = {
-	{
-		.name	= "PAL", 	.id		= V4L2_STD_PAL_BG,
-		.v_offset	= 0x15,	.v_field 	= 288,		.v_calc	= 576,
-		.h_offset	= 0x4a,	.h_pixels 	= 708,		.h_calc	= 709,
-		.v_max_out	= 576,	.h_max_out	= 768,
-	}, {
-		.name	= "NTSC", 	.id		= V4L2_STD_NTSC,
-		.v_offset	= 0x10,	.v_field 	= 244,		.v_calc	= 480,
-		.h_offset	= 0x40,	.h_pixels 	= 708,		.h_calc	= 709,
-		.v_max_out	= 480,	.h_max_out	= 640,
-	}
-};
-
-static struct saa7146_standard analog_standard[] = {
-	{
-		.name	= "PAL", 	.id		= V4L2_STD_PAL_BG,
-		.v_offset	= 0x18 /* 0 */ ,	.v_field 	= 288,		.v_calc	= 576,
-		.h_offset	= 0x08,	.h_pixels 	= 708,		.h_calc	= 709,
-		.v_max_out	= 576,	.h_max_out	= 768,
-	}, {
-		.name	= "NTSC", 	.id		= V4L2_STD_NTSC,
-		.v_offset	= 0x10,	.v_field 	= 244,		.v_calc	= 480,
-		.h_offset	= 0x40,	.h_pixels 	= 708,		.h_calc	= 709,
-		.v_max_out	= 480,	.h_max_out	= 640,
-	}
-};
-
-static struct saa7146_standard dvb_standard[] = {
-	{
-		.name	= "PAL", 	.id		= V4L2_STD_PAL_BG,
-		.v_offset	= 0x14,	.v_field 	= 288,		.v_calc	= 576,
-		.h_offset	= 0x4a,	.h_pixels 	= 708,		.h_calc	= 709,
-		.v_max_out	= 576,	.h_max_out	= 768,
-	}, {
-		.name	= "NTSC", 	.id		= V4L2_STD_NTSC,
-		.v_offset	= 0x10,	.v_field 	= 244,		.v_calc	= 480,
-		.h_offset	= 0x40,	.h_pixels 	= 708,		.h_calc	= 709,
-		.v_max_out	= 480,	.h_max_out	= 640,
-	}
-};
-
 static struct saa7146_extension av7110_extension;
 
 #define MAKE_AV7110_INFO(x_var,x_name) \
@@ -5023,52 +1617,6 @@
 };
 
 MODULE_DEVICE_TABLE(pci, pci_tbl);
-
-static int std_callback(struct saa7146_dev* dev, struct saa7146_standard *std)
-{
-	struct av7110 *av7110 = (struct av7110*)dev->ext_priv;
-	if (std->id == V4L2_STD_PAL) {
-                av7110->vidmode = VIDEO_MODE_PAL;
-		SetMode(av7110, av7110->vidmode);
-	}
-	else if (std->id == V4L2_STD_NTSC) {
-		av7110->vidmode = VIDEO_MODE_NTSC;
-		SetMode(av7110, av7110->vidmode);
-	}
-	else
-		return -1;
-
-	return 0;
-}
-
-
-static struct saa7146_ext_vv av7110_vv_data_st = {
-	.inputs		= 1,
-	.audios 	= 1,
-	.capabilities	= 0,
-	.flags		= 0, 
-
-	.stds		= &standard[0],
-	.num_stds	= sizeof(standard)/sizeof(struct saa7146_standard),
-	.std_callback	= &std_callback, 
-
-	.ioctls		= &ioctls[0],
-	.ioctl		= av7110_ioctl,
-};
-
-static struct saa7146_ext_vv av7110_vv_data_c = {
-	.inputs		= 1,
-	.audios 	= 1,
-	.capabilities	= V4L2_CAP_TUNER | V4L2_CAP_VBI_CAPTURE,
-	.flags		= SAA7146_USE_PORT_B_FOR_VBI,
-
-	.stds		= &standard[0],
-	.num_stds	= sizeof(standard)/sizeof(struct saa7146_standard),
-	.std_callback	= &std_callback, 
-
-	.ioctls		= &ioctls[0],
-	.ioctl		= av7110_ioctl,
-};
 
 
 static struct saa7146_extension av7110_extension = {
diff -Nru a/drivers/media/dvb/ttpci/av7110.h b/drivers/media/dvb/ttpci/av7110.h
--- a/drivers/media/dvb/ttpci/av7110.h	Tue Feb  3 19:45:16 2004
+++ b/drivers/media/dvb/ttpci/av7110.h	Tue Feb  3 19:45:16 2004
@@ -11,18 +11,6 @@
 
 #include <media/saa7146_vv.h>
 
-/* DEBI transfer mode defs */
-
-#define DEBINOSWAP 0x000e0000
-#define DEBISWAB   0x001e0000
-#define DEBISWAP   0x002e0000
-
-#define ARM_WAIT_FREE  (HZ)
-#define ARM_WAIT_SHAKE (HZ/5)
-#define ARM_WAIT_OSD (HZ)
-
-#define WAIT_QUEUE                 wait_queue_head_t
-
 #include <linux/dvb/video.h>
 #include <linux/dvb/audio.h>
 #include <linux/dvb/dmx.h>
@@ -38,336 +26,9 @@
 #include "dvb_net.h"
 #include "dvb_ringbuffer.h"
 
-enum av7110_bootstate
-{
-	BOOTSTATE_BUFFER_EMPTY	= 0,
-	BOOTSTATE_BUFFER_FULL	= 1,
-	BOOTSTATE_BOOT_COMPLETE	= 2
-};
-
-enum av7110_type_rec_play_format
-{	RP_None,
-	AudioPES,
-	AudioMp2,
-	AudioPCM,
-	VideoPES,
-	AV_PES
-};
-
-enum av7110_osd_palette_type
-{
-	NoPalet =  0,      /* No palette */
-	Pal1Bit =  2,      /* 2 colors for 1 Bit Palette    */
-	Pal2Bit =  4,      /* 4 colors for 2 bit palette    */
-	Pal4Bit =  16,     /* 16 colors for 4 bit palette   */
-	Pal8Bit =  256     /* 256 colors for 16 bit palette */
-};
-
-enum av7110_window_display_type {
-   BITMAP1,           /* 1 bit bitmap */
-   BITMAP2,           /* 2 bit bitmap */
-   BITMAP4,           /* 4 bit bitmap */
-   BITMAP8,           /* 8 bit bitmap */
-   BITMAP1HR,         /* 1 Bit bitmap half resolution */
-   BITMAP2HR,         /* 2 bit bitmap half resolution */
-   BITMAP4HR,         /* 4 bit bitmap half resolution */
-   BITMAP8HR,         /* 8 bit bitmap half resolution */
-   YCRCB422,          /* 4:2:2 YCRCB Graphic Display */
-   YCRCB444,          /* 4:4:4 YCRCB Graphic Display */
-   YCRCB444HR,        /* 4:4:4 YCRCB graphic half resolution */
-   VIDEOTSIZE,        /* True Size Normal MPEG Video Display */
-   VIDEOHSIZE,        /* MPEG Video Display Half Resolution */
-   VIDEOQSIZE,        /* MPEG Video Display Quarter Resolution */
-   VIDEODSIZE,        /* MPEG Video Display Double Resolution */
-   VIDEOTHSIZE,       /* True Size MPEG Video Display Half Resolution */
-   VIDEOTQSIZE,       /* True Size MPEG Video Display Quarter Resolution*/
-   VIDEOTDSIZE,       /* True Size MPEG Video Display Double Resolution */
-   VIDEONSIZE,        /* Full Size MPEG Video Display */
-   CURSOR             /* Cursor */
-};
-
-/* switch defines */
-#define SB_GPIO 3
-#define SB_OFF	SAA7146_GPIO_OUTLO  //SlowBlank aus (TV-Mode)
-#define SB_ON	SAA7146_GPIO_INPUT  //SlowBlank an  (AV-Mode)
-#define SB_WIDE SAA7146_GPIO_OUTHI  //SlowBlank 6V  (16/9-Mode) nicht realisiert
-
-#define FB_GPIO 1
-#define FB_OFF	SAA7146_GPIO_LO     //FastBlank aus (CVBS-Mode)
-#define FB_ON   SAA7146_GPIO_OUTHI  //FastBlank an  (RGB-Mode)
-#define FB_LOOP	SAA7146_GPIO_INPUT  //FastBlank der PC-Grafik durchschleifen
-
-enum av7110_video_output_mode
-{
-        NO_OUT       = 0,		//disable analog Output
-	CVBS_RGB_OUT = 1,
-	CVBS_YC_OUT  = 2,
-	YC_OUT	     = 3
-};
-
-#define GPMQFull        0x0001                  //Main Message Queue Full
-#define GPMQOver        0x0002                  //Main Message Queue Overflow
-#define HPQFull         0x0004                  //High Priority Msg Queue Full
-#define HPQOver         0x0008
-#define OSDQFull        0x0010                  //OSD Queue Full
-#define OSDQOver        0x0020
-
-#define	SECTION_EIT	        0x01
-#define	SECTION_SINGLE	        0x00
-#define	SECTION_CYCLE		0x02
-#define	SECTION_CONTINUOS	0x04
-#define	SECTION_MODE		0x06
-#define SECTION_IPMPE		0x0C	// bis zu 4k groß
-#define SECTION_HIGH_SPEED	0x1C	// vergrößerter Puffer für High Speed Filter
-#define DATA_PIPING_FLAG	0x20	// für Data Piping Filter
-
-#define	PBUFSIZE_NONE 0x0000
-#define	PBUFSIZE_1P   0x0100
-#define	PBUFSIZE_2P   0x0200
-#define	PBUFSIZE_1K   0x0300
-#define	PBUFSIZE_2K   0x0400
-#define	PBUFSIZE_4K   0x0500
-#define	PBUFSIZE_8K   0x0600
-#define PBUFSIZE_16K  0x0700
-#define PBUFSIZE_32K  0x0800
-
-enum av7110_osd_command {	
-        WCreate,
-	WDestroy,
-	WMoveD,
-	WMoveA,
-	WHide,
-	WTop,
-	DBox,
-	DLine,
-	DText,
-	Set_Font,
-	SetColor,
-	SetBlend,
-	SetWBlend,
-	SetCBlend,
-	SetNonBlend,
-	LoadBmp,
-	BlitBmp,
-	ReleaseBmp,
-	SetWTrans,
-        SetWNoTrans,
-        Set_Palette
-};
-
-enum av7110_pid_command { 
-	MultiPID,
-        VideoPID,
-	AudioPID,
-	InitFilt,
-	FiltError,
-	NewVersion,
-	CacheError,
-	AddPIDFilter,
-	DelPIDFilter,
-	Scan,
-	SetDescr,
-        SetIR,
-        FlushTSQueue
-};
-			
-enum av7110_mpeg_command {
-        SelAudChannels
-};
-
-enum av7110_audio_command { 
-        AudioDAC,
-	CabADAC,
-	ON22K,
-	OFF22K,
-	MainSwitch,
-	ADSwitch,
-	SendDiSEqC,
-	SetRegister
-};
-
-enum av7110_request_command {
-        AudioState,
-	AudioBuffState,
-	VideoState1,
-	VideoState2,
-	VideoState3,
-	CrashCounter,
-	ReqVersion,
-	ReqVCXO,
-	ReqRegister,
-	ReqSecFilterError,
-	ReqSTC
-};
-
-enum av7110_encoder_command {
-        SetVidMode,
-	SetTestMode,
-	LoadVidCode,
-	SetMonitorType,
-	SetPanScanType,
-	SetFreezeMode
-};
-
-enum av7110_rec_play_state { 
-        __Record,
-	__Stop,
-	__Play,
-	__Pause,
-	__Slow,
-	__FF_IP,
-	__Scan_I,
-	__Continue
-};
-
-enum av7110_command_type { 
-        COMTYPE_NOCOM,
-	COMTYPE_PIDFILTER,
-	COMTYPE_MPEGDECODER,
-	COMTYPE_OSD,
-	COMTYPE_BMP,
-	COMTYPE_ENCODER,
-	COMTYPE_AUDIODAC,
-	COMTYPE_REQUEST,
-	COMTYPE_SYSTEM,
-	COMTYPE_REC_PLAY,
-	COMTYPE_COMMON_IF,
-	COMTYPE_PID_FILTER,
-        COMTYPE_PES,
-        COMTYPE_TS,
-	COMTYPE_VIDEO,
-	COMTYPE_AUDIO,
-	COMTYPE_CI_LL,
-};
-
-#define VID_NONE_PREF           0x00    /* No aspect ration processing preferred */
-#define VID_PAN_SCAN_PREF       0x01    /* Pan and Scan Display preferred */
-#define VID_VERT_COMP_PREF      0x02    /* Vertical compression display preferred */
-#define VID_VC_AND_PS_PREF      0x03    /* PanScan and vertical Compression if allowed */
-#define VID_CENTRE_CUT_PREF     0x05    /* PanScan with zero vector */
-
-#define DATA_NONE                0x00
-#define DATA_FSECTION            0x01
-#define DATA_IPMPE               0x02
-#define DATA_MPEG_RECORD         0x03
-#define DATA_DEBUG_MESSAGE       0x04
-#define DATA_COMMON_INTERFACE    0x05
-#define DATA_MPEG_PLAY           0x06
-#define DATA_BMP_LOAD            0x07
-#define DATA_IRCOMMAND           0x08
-#define DATA_PIPING              0x09
-#define DATA_STREAMING           0x0a
-#define DATA_CI_GET              0x0b
-#define DATA_CI_PUT              0x0c
-#define DATA_MPEG_VIDEO_EVENT    0x0d
-
-#define DATA_PES_RECORD          0x10
-#define DATA_PES_PLAY            0x11
-#define DATA_TS_RECORD           0x12
-#define DATA_TS_PLAY             0x13
-
-#define CI_CMD_ERROR             0x00
-#define CI_CMD_ACK               0x01
-#define CI_CMD_SYSTEM_READY      0x02
-#define CI_CMD_KEYPRESS          0x03
-#define CI_CMD_ON_TUNED          0x04
-#define CI_CMD_ON_SWITCH_PROGRAM 0x05
-#define CI_CMD_SECTION_ARRIVED   0x06
-#define CI_CMD_SECTION_TIMEOUT   0x07
-#define CI_CMD_TIME              0x08
-#define CI_CMD_ENTER_MENU        0x09
-#define CI_CMD_FAST_PSI          0x0a
-#define CI_CMD_GET_SLOT_INFO     0x0b
-
-#define CI_MSG_NONE              0x00
-#define CI_MSG_CI_INFO           0x01
-#define CI_MSG_MENU              0x02
-#define CI_MSG_LIST              0x03
-#define CI_MSG_TEXT              0x04
-#define CI_MSG_REQUEST_INPUT     0x05
-#define CI_MSG_INPUT_COMPLETE    0x06
-#define CI_MSG_LIST_MORE         0x07
-#define CI_MSG_MENU_MORE         0x08
-#define CI_MSG_CLOSE_MMI_IMM     0x09
-#define CI_MSG_SECTION_REQUEST   0x0a
-#define CI_MSG_CLOSE_FILTER      0x0b
-#define CI_PSI_COMPLETE          0x0c
-#define CI_MODULE_READY          0x0d
-#define CI_SWITCH_PRG_REPLY      0x0e
-#define CI_MSG_TEXT_MORE         0x0f
-
-#define CI_MSG_CA_PMT            0xe0
-#define CI_MSG_ERROR             0xf0
-
-
-#define PROG_STREAM_MAP  0xBC
-#define PRIVATE_STREAM1  0xBD
-#define PADDING_STREAM   0xBE
-#define PRIVATE_STREAM2  0xBF
-#define AUDIO_STREAM_S   0xC0
-#define AUDIO_STREAM_E   0xDF
-#define VIDEO_STREAM_S   0xE0
-#define VIDEO_STREAM_E   0xEF
-#define ECM_STREAM       0xF0
-#define EMM_STREAM       0xF1
-#define DSM_CC_STREAM    0xF2
-#define ISO13522_STREAM  0xF3
-#define PROG_STREAM_DIR  0xFF
-
-#define PTS_DTS_FLAGS    0xC0
-
-//pts_dts flags
-#define PTS_ONLY         0x80
-#define PTS_DTS          0xC0
-#define TS_SIZE          188
-#define TRANS_ERROR      0x80
-#define PAY_START        0x40
-#define TRANS_PRIO       0x20
-#define PID_MASK_HI      0x1F
-//flags
-#define TRANS_SCRMBL1    0x80
-#define TRANS_SCRMBL2    0x40
-#define ADAPT_FIELD      0x20
-#define PAYLOAD          0x10
-#define COUNT_MASK       0x0F
-
-// adaptation flags
-#define DISCON_IND       0x80
-#define RAND_ACC_IND     0x40
-#define ES_PRI_IND       0x20
-#define PCR_FLAG         0x10
-#define OPCR_FLAG        0x08
-#define SPLICE_FLAG      0x04
-#define TRANS_PRIV       0x02
-#define ADAP_EXT_FLAG    0x01
-
-// adaptation extension flags
-#define LTW_FLAG         0x80
-#define PIECE_RATE       0x40
-#define SEAM_SPLICE      0x20
-
-#define MAX_PLENGTH      0xFFFF
-#define MAX_VID_PES      0x1FFF
-
-#define MY_STATE_PES_START     1
-#define MY_STATE_PES_STARTED   2
-#define MY_STATE_FULL          4
 
-#define MASKL   DMX_MAX_FILTER_SIZE
 #define MAXFILT 32
 
-struct dvb_filter {
-        int               state;
-        int               flags;
-        int               type;
-        u8                ts_state;
-
-        u16               pid;
-        u8                value[MASKL];
-        u8                mask[MASKL];
-};
-
-
 enum {AV_PES_STREAM, PS_STREAM, TS_STREAM, PES_STREAM};
 
 struct av7110_p2t {
@@ -436,15 +97,12 @@
 
         int                     bmpp;
         int                     bmplen;
-        int                     bmp_win;
-        u16                     bmp_x, bmp_y;
-        int                     bmp_trans;
         int                     bmp_state;
 #define BMP_NONE     0
 #define BMP_LOADING  1
 #define BMP_LOADINGS 2
 #define BMP_LOADED   3
-        WAIT_QUEUE              bmpq;
+	wait_queue_head_t	bmpq;
 
 
         /* DEBI and polled command interface */
@@ -453,7 +111,6 @@
         struct semaphore        dcomlock;
         int                     debitype;
         int                     debilen;
-        int                     debibuf;
 
 
         /* Recording and playback flags */
@@ -518,7 +175,7 @@
         u32                 avtype;
         int                 arm_ready;
         struct task_struct *arm_thread;
-        WAIT_QUEUE          arm_wait;
+	wait_queue_head_t   arm_wait;
         u16                 arm_loops;
         int                 arm_rmmod;
 
@@ -540,8 +197,6 @@
 	struct dvb_video_events  video_events;
 	video_size_t             video_size;
 
-        int                 dsp_dev;
-
         u32                 ir_config;
 	
 	/* firmware stuff */
@@ -558,81 +213,8 @@
 };
 
 
-#define	DPRAM_BASE 0x4000
-
-#define BOOT_STATE	(DPRAM_BASE + 0x3F8)
-#define BOOT_SIZE	(DPRAM_BASE + 0x3FA)
-#define BOOT_BASE	(DPRAM_BASE + 0x3FC)
-#define BOOT_BLOCK	(DPRAM_BASE + 0x400)
-#define BOOT_MAX_SIZE	0xc00
-
-#define IRQ_STATE	(DPRAM_BASE + 0x0F4)
-#define IRQ_STATE_EXT	(DPRAM_BASE + 0x0F6)
-#define MSGSTATE	(DPRAM_BASE + 0x0F8)
-#define FILT_STATE	(DPRAM_BASE + 0x0FA)
-#define COMMAND		(DPRAM_BASE + 0x0FC)
-#define COM_BUFF	(DPRAM_BASE + 0x100)
-#define COM_BUFF_SIZE	0x20
-
-#define BUFF1_BASE	(DPRAM_BASE + 0x120)
-#define BUFF1_SIZE	0xE0
-
-#define DATA_BUFF_BASE	(DPRAM_BASE + 0x200)
-#define DATA_BUFF_SIZE	0x1C00
-
-/* new buffers */
-
-#define DATA_BUFF0_BASE	(DPRAM_BASE + 0x200)
-#define DATA_BUFF0_SIZE	0x0800
-
-#define DATA_BUFF1_BASE	(DATA_BUFF0_BASE+DATA_BUFF0_SIZE)
-#define DATA_BUFF1_SIZE	0x0800
-
-#define DATA_BUFF2_BASE	(DATA_BUFF1_BASE+DATA_BUFF1_SIZE)
-#define DATA_BUFF2_SIZE	0x0800
-
-#define DATA_BUFF3_BASE (DATA_BUFF2_BASE+DATA_BUFF2_SIZE)
-#define DATA_BUFF3_SIZE 0x0400
-
-#define Reserved	(DPRAM_BASE + 0x1E00)
-#define Reserved_SIZE	0x1C0
-
-#define STATUS_BASE	(DPRAM_BASE + 0x1FC0)
-#define STATUS_SCR      (STATUS_BASE + 0x00)
-#define STATUS_MODES    (STATUS_BASE + 0x04)
-#define STATUS_LOOPS    (STATUS_BASE + 0x08)
-
-#define STATUS_MPEG_WIDTH     (STATUS_BASE + 0x0C)
-/* ((aspect_ratio & 0xf) << 12) | (height & 0xfff) */
-#define STATUS_MPEG_HEIGHT_AR (STATUS_BASE + 0x0E)
-
-#define RX_TYPE         (DPRAM_BASE + 0x1FE8)
-#define RX_LEN          (DPRAM_BASE + 0x1FEA)
-#define TX_TYPE         (DPRAM_BASE + 0x1FEC)
-#define TX_LEN          (DPRAM_BASE + 0x1FEE)
-
-#define RX_BUFF         (DPRAM_BASE + 0x1FF4)
-#define TX_BUFF 	(DPRAM_BASE + 0x1FF6)
-
-#define HANDSHAKE_REG	(DPRAM_BASE + 0x1FF8)
-#define COM_IF_LOCK	(DPRAM_BASE + 0x1FFA)
-
-#define IRQ_RX		(DPRAM_BASE + 0x1FFC)
-#define IRQ_TX		(DPRAM_BASE + 0x1FFE)
-
-#define DRAM_START_CODE		0x2e000404
-#define DRAM_MAX_CODE_SIZE	0x00100000
-
-#define RESET_LINE		2
-#define DEBI_DONE_LINE		1
-#define ARM_IRQ_LINE		0
-
-#define DAC_CS	0x8000
-#define DAC_CDS	0x0000
-
-
-extern unsigned char *av7110_dpram_addr, *av7110_root_addr;
-extern int av7110_dpram_len, av7110_root_len;
+extern void ChangePIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid,
+		       u16 subpid, u16 pcrpid);
 
 extern void av7110_register_irc_handler(void (*func)(u32));
 extern void av7110_unregister_irc_handler(void (*func)(u32)); 
@@ -641,6 +223,21 @@
 extern int av7110_ir_init (void);
 extern void av7110_ir_exit (void);
 
+/* msp3400 i2c subaddresses */
+#define MSP_WR_DEM 0x10
+#define MSP_RD_DEM 0x11
+#define MSP_WR_DSP 0x12
+#define MSP_RD_DSP 0x13
+
+extern int i2c_writereg(struct av7110 *av7110, u8 id, u8 reg, u8 val);
+extern u8 i2c_readreg(struct av7110 *av7110, u8 id, u8 reg);
+extern int msp_writereg(struct av7110 *av7110, u8 dev, u16 reg, u16 val);
+extern int msp_readreg(struct av7110 *av7110, u8 dev, u16 reg, u16 *val);
+
+
+extern int av7110_init_analog_module(struct av7110 *av7110);
+extern int av7110_init_v4l(struct av7110 *av7110);
+extern int av7110_exit_v4l(struct av7110 *av7110);
 
 #endif /* _AV7110_H_ */
 
diff -Nru a/drivers/media/dvb/ttpci/av7110_av.c b/drivers/media/dvb/ttpci/av7110_av.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/dvb/ttpci/av7110_av.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,1436 @@
+/*
+ * av7110_av.c: audio and video MPEG decoder stuff
+ *
+ * Copyright (C) 1999-2002 Ralph  Metzler
+ *                       & Marcus Metzler for convergence integrated media GmbH
+ *
+ * originally based on code by:
+ * Copyright (C) 1998,1999 Christian Theiss <mistert@rz.fh-augsburg.de>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
+ *
+ *
+ * the project's page is at http://www.linuxtv.org/dvb/
+ */
+
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/sched.h>
+#include <linux/delay.h>
+#include <linux/byteorder/swabb.h>
+#include <linux/smp_lock.h>
+#include <linux/fs.h>
+
+#define DEBUG_VARIABLE av7110_debug
+extern int av7110_debug;
+
+#include "av7110.h"
+#include "av7110_hw.h"
+#include "av7110_av.h"
+#include "av7110_ipack.h"
+#include "dvb_functions.h"
+
+/* MPEG-2 (ISO 13818 / H.222.0) stream types */
+#define PROG_STREAM_MAP  0xBC
+#define PRIVATE_STREAM1  0xBD
+#define PADDING_STREAM	 0xBE
+#define PRIVATE_STREAM2  0xBF
+#define AUDIO_STREAM_S	 0xC0
+#define AUDIO_STREAM_E	 0xDF
+#define VIDEO_STREAM_S	 0xE0
+#define VIDEO_STREAM_E	 0xEF
+#define ECM_STREAM	 0xF0
+#define EMM_STREAM	 0xF1
+#define DSM_CC_STREAM	 0xF2
+#define ISO13522_STREAM  0xF3
+#define PROG_STREAM_DIR  0xFF
+
+#define PTS_DTS_FLAGS	 0xC0
+
+//pts_dts flags
+#define PTS_ONLY	 0x80
+#define PTS_DTS		 0xC0
+#define TS_SIZE		 188
+#define TRANS_ERROR	 0x80
+#define PAY_START	 0x40
+#define TRANS_PRIO	 0x20
+#define PID_MASK_HI	 0x1F
+//flags
+#define TRANS_SCRMBL1	 0x80
+#define TRANS_SCRMBL2	 0x40
+#define ADAPT_FIELD	 0x20
+#define PAYLOAD		 0x10
+#define COUNT_MASK	 0x0F
+
+// adaptation flags
+#define DISCON_IND	 0x80
+#define RAND_ACC_IND	 0x40
+#define ES_PRI_IND	 0x20
+#define PCR_FLAG	 0x10
+#define OPCR_FLAG	 0x08
+#define SPLICE_FLAG	 0x04
+#define TRANS_PRIV	 0x02
+#define ADAP_EXT_FLAG	 0x01
+
+// adaptation extension flags
+#define LTW_FLAG	 0x80
+#define PIECE_RATE	 0x40
+#define SEAM_SPLICE	 0x20
+
+
+static void p_to_t(u8 const *buf, long int length, u16 pid,
+		   u8 *counter, struct dvb_demux_feed *feed);
+
+
+int av7110_record_cb(struct dvb_filter_pes2ts *p2t, u8 *buf, size_t len)
+{
+	struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *) p2t->priv;
+
+//	DEB_EE(("struct dvb_filter_pes2ts:%p\n", p2t));
+
+	if (!(dvbdmxfeed->ts_type & TS_PACKET))
+		return 0;
+	if (buf[3] == 0xe0)	 // video PES do not have a length in TS
+		buf[4] = buf[5] = 0;
+	if (dvbdmxfeed->ts_type & TS_PAYLOAD_ONLY)
+		return dvbdmxfeed->cb.ts(buf, len, 0, 0,
+					 &dvbdmxfeed->feed.ts, DMX_OK);
+	else
+		return dvb_filter_pes2ts(p2t, buf, len, 1);
+}
+
+static int dvb_filter_pes2ts_cb(void *priv, unsigned char *data)
+{
+	struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *) priv;
+
+//	DEB_EE(("dvb_demux_feed:%p\n", dvbdmxfeed));
+
+	dvbdmxfeed->cb.ts(data, 188, 0, 0,
+			  &dvbdmxfeed->feed.ts, DMX_OK);
+	return 0;
+}
+
+int av7110_av_start_record(struct av7110 *av7110, int av,
+			   struct dvb_demux_feed *dvbdmxfeed)
+{
+	struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
+
+	DEB_EE(("av7110: %p, dvb_demux_feed:%p\n", av7110, dvbdmxfeed));
+
+	if (av7110->playing || (av7110->rec_mode & av))
+		return -EBUSY;
+	av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Stop, 0);
+	dvbdmx->recording = 1;
+	av7110->rec_mode |= av;
+
+	switch (av7110->rec_mode) {
+	case RP_AUDIO:
+		dvb_filter_pes2ts_init(&av7110->p2t[0],
+				       dvbdmx->pesfilter[0]->pid,
+				       dvb_filter_pes2ts_cb,
+				       (void *) dvbdmx->pesfilter[0]);
+		av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Record, 2, AudioPES, 0);
+		break;
+
+	case RP_VIDEO:
+		dvb_filter_pes2ts_init(&av7110->p2t[1],
+				       dvbdmx->pesfilter[1]->pid,
+				       dvb_filter_pes2ts_cb,
+				       (void *) dvbdmx->pesfilter[1]);
+		av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Record, 2, VideoPES, 0);
+		break;
+
+	case RP_AV:
+		dvb_filter_pes2ts_init(&av7110->p2t[0],
+				       dvbdmx->pesfilter[0]->pid,
+				       dvb_filter_pes2ts_cb,
+				       (void *) dvbdmx->pesfilter[0]);
+		dvb_filter_pes2ts_init(&av7110->p2t[1],
+				       dvbdmx->pesfilter[1]->pid,
+				       dvb_filter_pes2ts_cb,
+				       (void *) dvbdmx->pesfilter[1]);
+		av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Record, 2, AV_PES, 0);
+		break;
+	}
+	return 0;
+}
+
+int av7110_av_start_play(struct av7110 *av7110, int av)
+{
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if (av7110->rec_mode)
+		return -EBUSY;
+	if (av7110->playing & av)
+		return -EBUSY;
+
+	av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Stop, 0);
+
+	if (av7110->playing == RP_NONE) {
+		av7110_ipack_reset(&av7110->ipack[0]);
+		av7110_ipack_reset(&av7110->ipack[1]);
+	}
+
+	av7110->playing |= av;
+	switch (av7110->playing) {
+	case RP_AUDIO:
+		av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Play, 2, AudioPES, 0);
+		break;
+	case RP_VIDEO:
+		av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Play, 2, VideoPES, 0);
+		av7110->sinfo = 0;
+		break;
+	case RP_AV:
+		av7110->sinfo = 0;
+		av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Play, 2, AV_PES, 0);
+		break;
+	}
+	return av7110->playing;
+}
+
+void av7110_av_stop(struct av7110 *av7110, int av)
+{
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if (!(av7110->playing & av) && !(av7110->rec_mode & av))
+		return;
+
+	av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Stop, 0);
+	if (av7110->playing) {
+		av7110->playing &= ~av;
+		switch (av7110->playing) {
+		case RP_AUDIO:
+			av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Play, 2, AudioPES, 0);
+			break;
+		case RP_VIDEO:
+			av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Play, 2, VideoPES, 0);
+			break;
+		case RP_NONE:
+			av7110_set_vidmode(av7110, av7110->vidmode);
+			break;
+		}
+	} else {
+		av7110->rec_mode &= ~av;
+		switch (av7110->rec_mode) {
+		case RP_AUDIO:
+			av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Record, 2, AudioPES, 0);
+			break;
+		case RP_VIDEO:
+			av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Record, 2, VideoPES, 0);
+			break;
+		case RP_NONE:
+			break;
+		}
+	}
+}
+
+
+int av7110_pes_play(void *dest, struct dvb_ringbuffer *buf, int dlen)
+{
+	int len;
+	u32 sync;
+	u16 blen;
+
+	DEB_EE(("dvb_ring_buffer_t: %p\n", buf));
+
+	if (!dlen) {
+		wake_up(&buf->queue);
+		return -1;
+	}
+	while (1) {
+		if ((len = dvb_ringbuffer_avail(buf)) < 6)
+			return -1;
+		sync =  DVB_RINGBUFFER_PEEK(buf, 0) << 24;
+		sync |= DVB_RINGBUFFER_PEEK(buf, 1) << 16;
+		sync |= DVB_RINGBUFFER_PEEK(buf, 2) << 8;
+		sync |= DVB_RINGBUFFER_PEEK(buf, 3);
+
+		if (((sync &~ 0x0f) == 0x000001e0) ||
+		    ((sync &~ 0x1f) == 0x000001c0) ||
+		    (sync == 0x000001bd))
+			break;
+		printk("resync\n");
+		DVB_RINGBUFFER_SKIP(buf, 1);
+	}
+	blen =  DVB_RINGBUFFER_PEEK(buf, 4) << 8;
+	blen |= DVB_RINGBUFFER_PEEK(buf, 5);
+	blen += 6;
+	if (len < blen || blen > dlen) {
+		//printk("buffer empty - avail %d blen %u dlen %d\n", len, blen, dlen);
+		wake_up(&buf->queue);
+		return -1;
+	}
+
+	dvb_ringbuffer_read(buf, dest, (size_t) blen, 0);
+
+	DEB_S(("pread=0x%08lx, pwrite=0x%08lx\n",
+	       (unsigned long) buf->pread, (unsigned long) buf->pwrite));
+	wake_up(&buf->queue);
+	return blen;
+}
+
+
+int av7110_set_volume(struct av7110 *av7110, int volleft, int volright)
+{
+	int err, vol, val, balance = 0;
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	switch (av7110->adac_type) {
+	case DVB_ADAC_TI:
+		volleft = (volleft * 256) / 1036;
+		volright = (volright * 256) / 1036;
+		if (volleft > 0x3f)
+			volleft = 0x3f;
+		if (volright > 0x3f)
+			volright = 0x3f;
+		if ((err = SendDAC(av7110, 3, 0x80 + volleft)))
+			return err;
+		return SendDAC(av7110, 4, volright);
+
+	case DVB_ADAC_CRYSTAL:
+		volleft = 127 - volleft / 2;
+		volright = 127 - volright / 2;
+		i2c_writereg(av7110, 0x20, 0x03, volleft);
+		i2c_writereg(av7110, 0x20, 0x04, volright);
+		return 0;
+
+	case DVB_ADAC_MSP:
+		vol  = (volleft > volright) ? volleft : volright;
+		val	= (vol * 0x73 / 255) << 8;
+		if (vol > 0)
+		       balance = ((volright - volleft) * 127) / vol;
+		msp_writereg(av7110, MSP_WR_DSP, 0x0001, balance << 8);
+		msp_writereg(av7110, MSP_WR_DSP, 0x0000, val); /* loudspeaker */
+		msp_writereg(av7110, MSP_WR_DSP, 0x0006, val); /* headphonesr */
+		return 0;
+	}
+	return 0;
+}
+
+void av7110_set_vidmode(struct av7110 *av7110, int mode)
+{
+	DEB_EE(("av7110: %p\n", av7110));
+
+	av7110_fw_cmd(av7110, COMTYPE_ENCODER, LoadVidCode, 1, mode);
+
+	if (!av7110->playing) {
+		ChangePIDs(av7110, av7110->pids[DMX_PES_VIDEO],
+			   av7110->pids[DMX_PES_AUDIO],
+			   av7110->pids[DMX_PES_TELETEXT],
+			   0, av7110->pids[DMX_PES_PCR]);
+		av7110_fw_cmd(av7110, COMTYPE_PIDFILTER, Scan, 0);
+	}
+}
+
+
+static int sw2mode[16] = {
+	VIDEO_MODE_PAL, VIDEO_MODE_NTSC, VIDEO_MODE_NTSC, VIDEO_MODE_PAL,
+	VIDEO_MODE_NTSC, VIDEO_MODE_NTSC, VIDEO_MODE_PAL, VIDEO_MODE_NTSC,
+	VIDEO_MODE_PAL, VIDEO_MODE_PAL, VIDEO_MODE_PAL, VIDEO_MODE_PAL,
+	VIDEO_MODE_PAL, VIDEO_MODE_PAL, VIDEO_MODE_PAL, VIDEO_MODE_PAL,
+};
+
+static void get_video_format(struct av7110 *av7110, u8 *buf, int count)
+{
+	int i;
+	int hsize, vsize;
+	int sw;
+	u8 *p;
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if (av7110->sinfo)
+		return;
+	for (i = 7; i < count - 10; i++) {
+		p = buf + i;
+		if (p[0] || p[1] || p[2] != 0x01 || p[3] != 0xb3)
+			continue;
+		p += 4;
+		hsize = ((p[1] &0xF0) >> 4) | (p[0] << 4);
+		vsize = ((p[1] &0x0F) << 8) | (p[2]);
+		sw = (p[3] & 0x0F);
+		av7110_set_vidmode(av7110, sw2mode[sw]);
+		DEB_S(("dvb: playback %dx%d fr=%d\n", hsize, vsize, sw));
+		av7110->sinfo = 1;
+		break;
+	}
+}
+
+
+/****************************************************************************
+ * I/O buffer management and control
+ ****************************************************************************/
+
+static inline long aux_ring_buffer_write(struct dvb_ringbuffer *rbuf,
+					 const char *buf, unsigned long count)
+{
+	unsigned long todo = count;
+	int free;
+
+	while (todo > 0) {
+		if (dvb_ringbuffer_free(rbuf) < 2048) {
+			if (wait_event_interruptible(rbuf->queue,
+						     (dvb_ringbuffer_free(rbuf) >= 2048)))
+				return count - todo;
+		}
+		free = dvb_ringbuffer_free(rbuf);
+		if (free > todo)
+			free = todo;
+		dvb_ringbuffer_write(rbuf, buf, free, 0);
+		todo -= free;
+		buf += free;
+	}
+
+	return count - todo;
+}
+
+static void play_video_cb(u8 *buf, int count, void *priv)
+{
+	struct av7110 *av7110 = (struct av7110 *) priv;
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if ((buf[3] & 0xe0) == 0xe0) {
+		get_video_format(av7110, buf, count);
+		aux_ring_buffer_write(&av7110->avout, buf, count);
+	} else
+		aux_ring_buffer_write(&av7110->aout, buf, count);
+}
+
+static void play_audio_cb(u8 *buf, int count, void *priv)
+{
+	struct av7110 *av7110 = (struct av7110 *) priv;
+	DEB_EE(("av7110: %p\n", av7110));
+
+	aux_ring_buffer_write(&av7110->aout, buf, count);
+}
+
+#define FREE_COND (dvb_ringbuffer_free(&av7110->avout) >= 20 * 1024 && \
+		   dvb_ringbuffer_free(&av7110->aout) >= 20 * 1024)
+
+static ssize_t dvb_play(struct av7110 *av7110, const u8 *buf,
+			unsigned long count, int nonblock, int type, int umem)
+{
+	unsigned long todo = count, n;
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if (!av7110->kbuf[type])
+		return -ENOBUFS;
+
+	if (nonblock && !FREE_COND)
+		return -EWOULDBLOCK;
+
+	while (todo > 0) {
+		if (!FREE_COND) {
+			if (nonblock)
+				return count - todo;
+			if (wait_event_interruptible(av7110->avout.queue,
+						     FREE_COND))
+				return count - todo;
+		}
+		n = todo;
+		if (n > IPACKS * 2)
+			n = IPACKS * 2;
+		if (umem) {
+			if (copy_from_user(av7110->kbuf[type], buf, n))
+				return -EFAULT;
+			av7110_ipack_instant_repack(av7110->kbuf[type], n,
+						    &av7110->ipack[type]);
+		} else {
+			av7110_ipack_instant_repack(buf, n,
+						    &av7110->ipack[type]);
+		}
+		todo -= n;
+		buf += n;
+	}
+	return count - todo;
+}
+
+static ssize_t dvb_aplay(struct av7110 *av7110, const u8 *buf,
+			 unsigned long count, int nonblock, int type)
+{
+	unsigned long todo = count, n;
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if (!av7110->kbuf[type])
+		return -ENOBUFS;
+	if (nonblock && dvb_ringbuffer_free(&av7110->aout) < 20 * 1024)
+		return -EWOULDBLOCK;
+
+	while (todo > 0) {
+		if (dvb_ringbuffer_free(&av7110->aout) < 20 * 1024) {
+			if (nonblock)
+				return count - todo;
+			if (wait_event_interruptible(av7110->aout.queue,
+					(dvb_ringbuffer_free(&av7110->aout) >= 20 * 1024)))
+				return count-todo;
+		}
+		n = todo;
+		if (n > IPACKS * 2)
+			n = IPACKS * 2;
+		if (copy_from_user(av7110->kbuf[type], buf, n))
+			return -EFAULT;
+		av7110_ipack_instant_repack(av7110->kbuf[type], n,
+					    &av7110->ipack[type]);
+		todo -= n;
+		buf += n;
+	}
+	return count - todo;
+}
+
+void av7110_p2t_init(struct av7110_p2t *p, struct dvb_demux_feed *feed)
+{
+	memset(p->pes, 0, TS_SIZE);
+	p->counter = 0;
+	p->pos = 0;
+	p->frags = 0;
+	if (feed)
+		p->feed = feed;
+}
+
+static void clear_p2t(struct av7110_p2t *p)
+{
+	memset(p->pes, 0, TS_SIZE);
+//	p->counter = 0;
+	p->pos = 0;
+	p->frags = 0;
+}
+
+
+static int find_pes_header(u8 const *buf, long int length, int *frags)
+{
+	int c = 0;
+	int found = 0;
+
+	*frags = 0;
+
+	while (c < length - 3 && !found) {
+		if (buf[c] == 0x00 && buf[c + 1] == 0x00 &&
+		    buf[c + 2] == 0x01) {
+			switch ( buf[c + 3] ) {
+			case PROG_STREAM_MAP:
+			case PRIVATE_STREAM2:
+			case PROG_STREAM_DIR:
+			case ECM_STREAM     :
+			case EMM_STREAM     :
+			case PADDING_STREAM :
+			case DSM_CC_STREAM  :
+			case ISO13522_STREAM:
+			case PRIVATE_STREAM1:
+			case AUDIO_STREAM_S ... AUDIO_STREAM_E:
+			case VIDEO_STREAM_S ... VIDEO_STREAM_E:
+				found = 1;
+				break;
+
+			default:
+				c++;
+				break;
+			}
+		} else
+			c++;
+	}
+	if (c == length - 3 && !found) {
+		if (buf[length - 1] == 0x00)
+			*frags = 1;
+		if (buf[length - 2] == 0x00 &&
+		    buf[length - 1] == 0x00)
+			*frags = 2;
+		if (buf[length - 3] == 0x00 &&
+		    buf[length - 2] == 0x00 &&
+		    buf[length - 1] == 0x01)
+			*frags = 3;
+		return -1;
+	}
+
+	return c;
+}
+
+void av7110_p2t_write(u8 const *buf, long int length, u16 pid, struct av7110_p2t *p)
+{
+	int c, c2, l, add;
+	int check, rest;
+
+	c = 0;
+	c2 = 0;
+	if (p->frags){
+		check = 0;
+		switch(p->frags) {
+		case 1:
+			if (buf[c] == 0x00 && buf[c + 1] == 0x01) {
+				check = 1;
+				c += 2;
+			}
+			break;
+		case 2:
+			if (buf[c] == 0x01) {
+				check = 1;
+				c++;
+			}
+			break;
+		case 3:
+			check = 1;
+		}
+		if (check) {
+			switch (buf[c]) {
+			case PROG_STREAM_MAP:
+			case PRIVATE_STREAM2:
+			case PROG_STREAM_DIR:
+			case ECM_STREAM     :
+			case EMM_STREAM     :
+			case PADDING_STREAM :
+			case DSM_CC_STREAM  :
+			case ISO13522_STREAM:
+			case PRIVATE_STREAM1:
+			case AUDIO_STREAM_S ... AUDIO_STREAM_E:
+			case VIDEO_STREAM_S ... VIDEO_STREAM_E:
+				p->pes[0] = 0x00;
+				p->pes[1] = 0x00;
+				p->pes[2] = 0x01;
+				p->pes[3] = buf[c];
+				p->pos = 4;
+				memcpy(p->pes + p->pos, buf + c, (TS_SIZE - 4) - p->pos);
+				c += (TS_SIZE - 4) - p->pos;
+				p_to_t(p->pes, (TS_SIZE - 4), pid, &p->counter, p->feed);
+				clear_p2t(p);
+				break;
+
+			default:
+				c = 0;
+				break;
+			}
+		}
+		p->frags = 0;
+	}
+
+	if (p->pos) {
+		c2 = find_pes_header(buf + c, length - c, &p->frags);
+		if (c2 >= 0 && c2 < (TS_SIZE - 4) - p->pos)
+			l = c2+c;
+		else
+			l = (TS_SIZE - 4) - p->pos;
+		memcpy(p->pes + p->pos, buf, l);
+		c += l;
+		p->pos += l;
+		p_to_t(p->pes, p->pos, pid, &p->counter, p->feed);
+		clear_p2t(p);
+	}
+
+	add = 0;
+	while (c < length) {
+		c2 = find_pes_header(buf + c + add, length - c - add, &p->frags);
+		if (c2 >= 0) {
+			c2 += c + add;
+			if (c2 > c){
+				p_to_t(buf + c, c2 - c, pid, &p->counter, p->feed);
+				c = c2;
+				clear_p2t(p);
+				add = 0;
+			} else
+				add = 1;
+		} else {
+			l = length - c;
+			rest = l % (TS_SIZE - 4);
+			l -= rest;
+			p_to_t(buf + c, l, pid, &p->counter, p->feed);
+			memcpy(p->pes, buf + c + l, rest);
+			p->pos = rest;
+			c = length;
+		}
+	}
+}
+
+
+int write_ts_header2(u16 pid, u8 *counter, int pes_start, u8 *buf, u8 length)
+{
+	int i;
+	int c = 0;
+	int fill;
+	u8 tshead[4] = { 0x47, 0x00, 0x00, 0x10 };
+
+	fill = (TS_SIZE - 4) - length;
+	if (pes_start)
+		tshead[1] = 0x40;
+	if (fill)
+		tshead[3] = 0x30;
+	tshead[1] |= (u8)((pid & 0x1F00) >> 8);
+	tshead[2] |= (u8)(pid & 0x00FF);
+	tshead[3] |= ((*counter)++ & 0x0F);
+	memcpy(buf, tshead, 4);
+	c += 4;
+
+	if (fill) {
+		buf[4] = fill - 1;
+		c++;
+		if (fill > 1) {
+			buf[5] = 0x00;
+			c++;
+		}
+		for (i = 6; i < fill + 4; i++) {
+			buf[i] = 0xFF;
+			c++;
+		}
+	}
+
+	return c;
+}
+
+
+static void p_to_t(u8 const *buf, long int length, u16 pid, u8 *counter,
+		   struct dvb_demux_feed *feed)
+{
+	int l, pes_start;
+	u8 obuf[TS_SIZE];
+	long c = 0;
+
+	pes_start = 0;
+	if (length > 3 &&
+	     buf[0] == 0x00 && buf[1] == 0x00 && buf[2] == 0x01)
+		switch (buf[3]) {
+			case PROG_STREAM_MAP:
+			case PRIVATE_STREAM2:
+			case PROG_STREAM_DIR:
+			case ECM_STREAM     :
+			case EMM_STREAM     :
+			case PADDING_STREAM :
+			case DSM_CC_STREAM  :
+			case ISO13522_STREAM:
+			case PRIVATE_STREAM1:
+			case AUDIO_STREAM_S ... AUDIO_STREAM_E:
+			case VIDEO_STREAM_S ... VIDEO_STREAM_E:
+				pes_start = 1;
+				break;
+
+			default:
+				break;
+		}
+
+	while (c < length) {
+		memset(obuf, 0, TS_SIZE);
+		if (length - c >= (TS_SIZE - 4)){
+			l = write_ts_header2(pid, counter, pes_start,
+					     obuf, (TS_SIZE - 4));
+			memcpy(obuf + l, buf + c, TS_SIZE - l);
+			c += TS_SIZE - l;
+		} else {
+			l = write_ts_header2(pid, counter, pes_start,
+					     obuf, length - c);
+			memcpy(obuf + l, buf + c, TS_SIZE - l);
+			c = length;
+		}
+		feed->cb.ts(obuf, 188, 0, 0, &feed->feed.ts, DMX_OK);
+		pes_start = 0;
+	}
+}
+
+
+int av7110_write_to_decoder(struct dvb_demux_feed *feed, const u8 *buf, size_t len)
+{
+	struct dvb_demux *demux = feed->demux;
+	struct av7110 *av7110 = (struct av7110 *) demux->priv;
+	struct ipack *ipack = &av7110->ipack[feed->pes_type];
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	switch (feed->pes_type) {
+	case 0:
+		if (av7110->audiostate.stream_source == AUDIO_SOURCE_MEMORY)
+			return -EINVAL;
+		break;
+	case 1:
+		if (av7110->videostate.stream_source == VIDEO_SOURCE_MEMORY)
+			return -EINVAL;
+		break;
+	default:
+		return -1;
+	}
+
+	if (!(buf[3] & 0x10)) /* no payload? */
+		return -1;
+	if (buf[1] & 0x40)
+		av7110_ipack_flush(ipack);
+
+	if (buf[3] & 0x20) {  /* adaptation field? */
+		len -= buf[4] + 1;
+		buf += buf[4] + 1;
+		if (!len)
+			return 0;
+	}
+
+	av7110_ipack_instant_repack(buf + 4, len - 4, &av7110->ipack[feed->pes_type]);
+	return 0;
+}
+
+
+
+/******************************************************************************
+ * Video MPEG decoder events
+ ******************************************************************************/
+void dvb_video_add_event(struct av7110 *av7110, struct video_event *event)
+{
+	struct dvb_video_events *events = &av7110->video_events;
+	int wp;
+
+	DEB_D(("\n"));
+
+	spin_lock_bh(&events->lock);
+
+	wp = (events->eventw + 1) % MAX_VIDEO_EVENT;
+	if (wp == events->eventr) {
+		events->overflow = 1;
+		events->eventr = (events->eventr + 1) % MAX_VIDEO_EVENT;
+	}
+
+	//FIXME: timestamp?
+	memcpy(&events->events[events->eventw], event, sizeof(struct video_event));
+	events->eventw = wp;
+
+	spin_unlock_bh(&events->lock);
+
+	wake_up_interruptible(&events->wait_queue);
+}
+
+
+static int dvb_video_get_event (struct av7110 *av7110, struct video_event *event, int flags)
+{
+	struct dvb_video_events *events = &av7110->video_events;
+
+	DEB_D(("\n"));
+
+	if (events->overflow) {
+		events->overflow = 0;
+		return -EOVERFLOW;
+	}
+	if (events->eventw == events->eventr) {
+		int ret;
+
+		if (flags & O_NONBLOCK)
+			return -EWOULDBLOCK;
+
+		ret = wait_event_interruptible(events->wait_queue,
+					       events->eventw != events->eventr);
+		if (ret < 0)
+			return ret;
+	}
+
+	spin_lock_bh(&events->lock);
+
+	memcpy(event, &events->events[events->eventr],
+	       sizeof(struct video_event));
+	events->eventr = (events->eventr + 1) % MAX_VIDEO_EVENT;
+
+	spin_unlock_bh(&events->lock);
+
+	return 0;
+}
+
+
+/******************************************************************************
+ * DVB device file operations
+ ******************************************************************************/
+
+static unsigned int dvb_video_poll(struct file *file, poll_table *wait)
+{
+	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
+	struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+	unsigned int mask = 0;
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if ((file->f_flags & O_ACCMODE) != O_RDONLY)
+		poll_wait(file, &av7110->avout.queue, wait);
+
+	poll_wait(file, &av7110->video_events.wait_queue, wait);
+
+	if (av7110->video_events.eventw != av7110->video_events.eventr)
+		mask = POLLPRI;
+
+	if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
+		if (av7110->playing) {
+			if (FREE_COND)
+				mask |= (POLLOUT | POLLWRNORM);
+			} else /* if not playing: may play if asked for */
+				mask |= (POLLOUT | POLLWRNORM);
+	}
+
+	return mask;
+}
+
+static ssize_t dvb_video_write(struct file *file, const char *buf,
+			       size_t count, loff_t *ppos)
+{
+	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
+	struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if ((file->f_flags & O_ACCMODE) == O_RDONLY)
+		return -EPERM;
+
+	if (av7110->videostate.stream_source != VIDEO_SOURCE_MEMORY)
+		return -EPERM;
+
+	return dvb_play(av7110, buf, count, file->f_flags & O_NONBLOCK, 1, 1);
+}
+
+static unsigned int dvb_audio_poll(struct file *file, poll_table *wait)
+{
+	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
+	struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+	unsigned int mask = 0;
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	poll_wait(file, &av7110->aout.queue, wait);
+
+	if (av7110->playing) {
+		if (dvb_ringbuffer_free(&av7110->aout) >= 20 * 1024)
+			mask |= (POLLOUT | POLLWRNORM);
+	} else /* if not playing: may play if asked for */
+		mask = (POLLOUT | POLLWRNORM);
+
+	return mask;
+}
+
+static ssize_t dvb_audio_write(struct file *file, const char *buf,
+			       size_t count, loff_t *ppos)
+{
+	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
+	struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if (av7110->audiostate.stream_source != AUDIO_SOURCE_MEMORY) {
+		printk(KERN_ERR "not audio source memory\n");
+		return -EPERM;
+	}
+	return dvb_aplay(av7110, buf, count, file->f_flags & O_NONBLOCK, 0);
+}
+
+u8 iframe_header[] = { 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x80, 0x00, 0x00 };
+
+#define MIN_IFRAME 400000
+
+static int play_iframe(struct av7110 *av7110, u8 *buf, unsigned int len, int nonblock)
+{
+	int i, n;
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if (!(av7110->playing & RP_VIDEO)) {
+		if (av7110_av_start_play(av7110, RP_VIDEO) < 0)
+			return -EBUSY;
+	}
+
+	/* setting n always > 1, fixes problems when playing stillframes
+	   consisting of I- and P-Frames */
+	n = MIN_IFRAME / len + 1;
+
+	/* FIXME: nonblock? */
+	dvb_play(av7110, iframe_header, sizeof(iframe_header), 0, 1, 0);
+
+	for (i = 0; i < n; i++)
+		dvb_play(av7110, buf, len, 0, 1, 1);
+
+	av7110_ipack_flush(&av7110->ipack[1]);
+	return 0;
+}
+
+
+static int dvb_video_ioctl(struct inode *inode, struct file *file,
+			   unsigned int cmd, void *parg)
+{
+	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
+	struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+	unsigned long arg = (unsigned long) parg;
+	int ret = 0;
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if ((file->f_flags & O_ACCMODE) == O_RDONLY) {
+		if ( cmd != VIDEO_GET_STATUS && cmd != VIDEO_GET_EVENT &&
+		     cmd != VIDEO_GET_SIZE ) {
+			return -EPERM;
+		}
+	}
+
+	switch (cmd) {
+	case VIDEO_STOP:
+		av7110->videostate.play_state = VIDEO_STOPPED;
+		if (av7110->videostate.stream_source == VIDEO_SOURCE_MEMORY)
+			av7110_av_stop(av7110, RP_VIDEO);
+		else
+			vidcom(av7110, 0x000e,
+			       av7110->videostate.video_blank ? 0 : 1);
+		av7110->trickmode = TRICK_NONE;
+		break;
+
+	case VIDEO_PLAY:
+		av7110->trickmode = TRICK_NONE;
+		if (av7110->videostate.play_state == VIDEO_FREEZED) {
+			av7110->videostate.play_state = VIDEO_PLAYING;
+			vidcom(av7110, 0x000d, 0);
+		}
+
+		if (av7110->videostate.stream_source == VIDEO_SOURCE_MEMORY) {
+			if (av7110->playing == RP_AV) {
+				av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Stop, 0);
+				av7110->playing &= ~RP_VIDEO;
+			}
+			av7110_av_start_play(av7110, RP_VIDEO);
+			vidcom(av7110, 0x000d, 0);
+		} else {
+			//av7110_av_stop(av7110, RP_VIDEO);
+			vidcom(av7110, 0x000d, 0);
+		}
+		av7110->videostate.play_state = VIDEO_PLAYING;
+		break;
+
+	case VIDEO_FREEZE:
+		av7110->videostate.play_state = VIDEO_FREEZED;
+		if (av7110->playing & RP_VIDEO)
+			av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Pause, 0);
+		else
+			vidcom(av7110, 0x0102, 1);
+		av7110->trickmode = TRICK_FREEZE;
+		break;
+
+	case VIDEO_CONTINUE:
+		if (av7110->playing & RP_VIDEO)
+			av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Continue, 0);
+		vidcom(av7110, 0x000d, 0);
+		av7110->videostate.play_state = VIDEO_PLAYING;
+		av7110->trickmode = TRICK_NONE;
+		break;
+
+	case VIDEO_SELECT_SOURCE:
+		av7110->videostate.stream_source = (video_stream_source_t) arg;
+		break;
+
+	case VIDEO_SET_BLANK:
+		av7110->videostate.video_blank = (int) arg;
+		break;
+
+	case VIDEO_GET_STATUS:
+		memcpy(parg, &av7110->videostate, sizeof(struct video_status));
+		break;
+
+	case VIDEO_GET_EVENT:
+		ret=dvb_video_get_event(av7110, parg, file->f_flags);
+		break;
+
+	case VIDEO_GET_SIZE:
+		memcpy(parg, &av7110->video_size, sizeof(video_size_t));
+		break;
+
+	case VIDEO_SET_DISPLAY_FORMAT:
+	{
+		video_displayformat_t format = (video_displayformat_t) arg;
+		u16 val = 0;
+
+		switch (format) {
+		case VIDEO_PAN_SCAN:
+			val = VID_PAN_SCAN_PREF;
+			break;
+
+		case VIDEO_LETTER_BOX:
+			val = VID_VC_AND_PS_PREF;
+			break;
+
+		case VIDEO_CENTER_CUT_OUT:
+			val = VID_CENTRE_CUT_PREF;
+			break;
+
+		default:
+			ret = -EINVAL;
+		}
+		if (ret < 0)
+			break;
+		av7110->videostate.video_format = format;
+		ret = av7110_fw_cmd(av7110, COMTYPE_ENCODER, SetPanScanType,
+				    1, (u16) val);
+		break;
+	}
+
+	case VIDEO_SET_FORMAT:
+		if (arg > 1) {
+			ret = -EINVAL;
+			break;
+		}
+		av7110->display_ar = arg;
+		ret = av7110_fw_cmd(av7110, COMTYPE_ENCODER, SetMonitorType,
+				    1, (u16) arg);
+		break;
+
+	case VIDEO_STILLPICTURE:
+	{
+		struct video_still_picture *pic =
+			(struct video_still_picture *) parg;
+		av7110->videostate.stream_source = VIDEO_SOURCE_MEMORY;
+		dvb_ringbuffer_flush_spinlock_wakeup(&av7110->avout);
+		ret = play_iframe(av7110, pic->iFrame, pic->size,
+				  file->f_flags & O_NONBLOCK);
+		break;
+	}
+
+	case VIDEO_FAST_FORWARD:
+		//note: arg is ignored by firmware
+		if (av7110->playing & RP_VIDEO)
+			av7110_fw_cmd(av7110, COMTYPE_REC_PLAY,
+				      __Scan_I, 2, AV_PES, 0);
+		else
+			vidcom(av7110, 0x16, arg);
+		av7110->trickmode = TRICK_FAST;
+		av7110->videostate.play_state = VIDEO_PLAYING;
+		break;
+
+	case VIDEO_SLOWMOTION:
+		if (av7110->playing&RP_VIDEO) {
+			av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Slow, 2, 0, 0);
+			vidcom(av7110, 0x22, arg);
+		} else {
+			vidcom(av7110, 0x0d, 0);
+			vidcom(av7110, 0x0e, 0);
+			vidcom(av7110, 0x22, arg);
+		}
+		av7110->trickmode = TRICK_SLOW;
+		av7110->videostate.play_state = VIDEO_PLAYING;
+		break;
+
+	case VIDEO_GET_CAPABILITIES:
+		*(int *)parg = VIDEO_CAP_MPEG1 | VIDEO_CAP_MPEG2 |
+			VIDEO_CAP_SYS | VIDEO_CAP_PROG;
+		break;
+
+	case VIDEO_CLEAR_BUFFER:
+		dvb_ringbuffer_flush_spinlock_wakeup(&av7110->avout);
+		av7110_ipack_reset(&av7110->ipack[1]);
+
+		if (av7110->playing == RP_AV) {
+			av7110_fw_cmd(av7110, COMTYPE_REC_PLAY,
+				      __Play, 2, AV_PES, 0);
+			if (av7110->trickmode == TRICK_FAST)
+				av7110_fw_cmd(av7110, COMTYPE_REC_PLAY,
+					      __Scan_I, 2, AV_PES, 0);
+			if (av7110->trickmode == TRICK_SLOW) {
+				av7110_fw_cmd(av7110, COMTYPE_REC_PLAY,
+					      __Slow, 2, 0, 0);
+				vidcom(av7110, 0x22, arg);
+			}
+			if (av7110->trickmode == TRICK_FREEZE)
+				vidcom(av7110, 0x000e, 1);
+		}
+		break;
+
+	case VIDEO_SET_STREAMTYPE:
+
+		break;
+
+	default:
+		ret = -ENOIOCTLCMD;
+		break;
+	}
+	return ret;
+}
+
+static int dvb_audio_ioctl(struct inode *inode, struct file *file,
+			   unsigned int cmd, void *parg)
+{
+	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
+	struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+	unsigned long arg = (unsigned long) parg;
+	int ret = 0;
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if (((file->f_flags & O_ACCMODE) == O_RDONLY) &&
+	    (cmd != AUDIO_GET_STATUS))
+		return -EPERM;
+
+	switch (cmd) {
+	case AUDIO_STOP:
+		if (av7110->audiostate.stream_source == AUDIO_SOURCE_MEMORY)
+			av7110_av_stop(av7110, RP_AUDIO);
+		else
+			audcom(av7110, 1);
+		av7110->audiostate.play_state = AUDIO_STOPPED;
+		break;
+
+	case AUDIO_PLAY:
+		if (av7110->audiostate.stream_source == AUDIO_SOURCE_MEMORY)
+			av7110_av_start_play(av7110, RP_AUDIO);
+		audcom(av7110, 2);
+		av7110->audiostate.play_state = AUDIO_PLAYING;
+		break;
+
+	case AUDIO_PAUSE:
+		audcom(av7110, 1);
+		av7110->audiostate.play_state = AUDIO_PAUSED;
+		break;
+
+	case AUDIO_CONTINUE:
+		if (av7110->audiostate.play_state == AUDIO_PAUSED) {
+			av7110->audiostate.play_state = AUDIO_PLAYING;
+			audcom(av7110, 0x12);
+		}
+		break;
+
+	case AUDIO_SELECT_SOURCE:
+		av7110->audiostate.stream_source = (audio_stream_source_t) arg;
+		break;
+
+	case AUDIO_SET_MUTE:
+	{
+		audcom(av7110, arg ? 1 : 2);
+		av7110->audiostate.mute_state = (int) arg;
+		break;
+	}
+
+	case AUDIO_SET_AV_SYNC:
+		av7110->audiostate.AV_sync_state = (int) arg;
+		audcom(av7110, arg ? 0x0f : 0x0e);
+		break;
+
+	case AUDIO_SET_BYPASS_MODE:
+		ret = -EINVAL;
+		break;
+
+	case AUDIO_CHANNEL_SELECT:
+		av7110->audiostate.channel_select = (audio_channel_select_t) arg;
+
+		switch(av7110->audiostate.channel_select) {
+		case AUDIO_STEREO:
+			audcom(av7110, 0x80);
+			break;
+
+		case AUDIO_MONO_LEFT:
+			audcom(av7110, 0x100);
+			break;
+
+		case AUDIO_MONO_RIGHT:
+			audcom(av7110, 0x200);
+			break;
+
+		default:
+			ret = -EINVAL;
+			break;
+		}
+		break;
+
+	case AUDIO_GET_STATUS:
+		memcpy(parg, &av7110->audiostate, sizeof(struct audio_status));
+		break;
+
+	case AUDIO_GET_CAPABILITIES:
+		*(int *)parg = AUDIO_CAP_LPCM | AUDIO_CAP_MP1 | AUDIO_CAP_MP2;
+		break;
+
+	case AUDIO_CLEAR_BUFFER:
+		dvb_ringbuffer_flush_spinlock_wakeup(&av7110->aout);
+		av7110_ipack_reset(&av7110->ipack[0]);
+		if (av7110->playing == RP_AV)
+			av7110_fw_cmd(av7110, COMTYPE_REC_PLAY,
+			       __Play, 2, AV_PES, 0);
+		break;
+	case AUDIO_SET_ID:
+
+		break;
+	case AUDIO_SET_MIXER:
+	{
+		struct audio_mixer *amix = (struct audio_mixer *)parg;
+
+		av7110_set_volume(av7110, amix->volume_left, amix->volume_right);
+		break;
+	}
+	case AUDIO_SET_STREAMTYPE:
+		break;
+	default:
+		ret = -ENOIOCTLCMD;
+	}
+	return ret;
+}
+
+
+static int dvb_video_open(struct inode *inode, struct file *file)
+{
+	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
+	struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+	int err;
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if ((err = dvb_generic_open(inode, file)) < 0)
+		return err;
+
+	if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
+		dvb_ringbuffer_flush_spinlock_wakeup(&av7110->aout);
+		dvb_ringbuffer_flush_spinlock_wakeup(&av7110->avout);
+		av7110->video_blank = 1;
+		av7110->audiostate.AV_sync_state = 1;
+		av7110->videostate.stream_source = VIDEO_SOURCE_DEMUX;
+
+		/*  empty event queue */
+		av7110->video_events.eventr = av7110->video_events.eventw = 0;
+	}
+
+	return 0;
+}
+
+static int dvb_video_release(struct inode *inode, struct file *file)
+{
+	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
+	struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
+		av7110_av_stop(av7110, RP_VIDEO);
+	}
+
+	return dvb_generic_release(inode, file);
+}
+
+static int dvb_audio_open(struct inode *inode, struct file *file)
+{
+	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
+	struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+	int err=dvb_generic_open(inode, file);
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if (err < 0)
+		return err;
+	dvb_ringbuffer_flush_spinlock_wakeup(&av7110->aout);
+	av7110->audiostate.stream_source = AUDIO_SOURCE_DEMUX;
+	return 0;
+}
+
+static int dvb_audio_release(struct inode *inode, struct file *file)
+{
+	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
+	struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	av7110_av_stop(av7110, RP_AUDIO);
+	return dvb_generic_release(inode, file);
+}
+
+
+
+/******************************************************************************
+ * driver registration
+ ******************************************************************************/
+
+static struct file_operations dvb_video_fops = {
+	.owner		= THIS_MODULE,
+	.write		= dvb_video_write,
+	.ioctl		= dvb_generic_ioctl,
+	.open		= dvb_video_open,
+	.release	= dvb_video_release,
+	.poll		= dvb_video_poll,
+};
+
+static struct dvb_device dvbdev_video = {
+	.priv		= 0,
+	.users		= 6,
+	.readers	= 5,	/* arbitrary */
+	.writers	= 1,
+	.fops		= &dvb_video_fops,
+	.kernel_ioctl	= dvb_video_ioctl,
+};
+
+static struct file_operations dvb_audio_fops = {
+	.owner		= THIS_MODULE,
+	.write		= dvb_audio_write,
+	.ioctl		= dvb_generic_ioctl,
+	.open		= dvb_audio_open,
+	.release	= dvb_audio_release,
+	.poll		= dvb_audio_poll,
+};
+
+static struct dvb_device dvbdev_audio = {
+	.priv		= 0,
+	.users		= 1,
+	.writers	= 1,
+	.fops		= &dvb_audio_fops,
+	.kernel_ioctl	= dvb_audio_ioctl,
+};
+
+
+int av7110_av_register(struct av7110 *av7110)
+{
+	av7110->audiostate.AV_sync_state = 0;
+	av7110->audiostate.mute_state = 0;
+	av7110->audiostate.play_state = AUDIO_STOPPED;
+	av7110->audiostate.stream_source = AUDIO_SOURCE_DEMUX;
+	av7110->audiostate.channel_select = AUDIO_STEREO;
+	av7110->audiostate.bypass_mode = 0;
+
+	av7110->videostate.video_blank = 0;
+	av7110->videostate.play_state = VIDEO_STOPPED;
+	av7110->videostate.stream_source = VIDEO_SOURCE_DEMUX;
+	av7110->videostate.video_format = VIDEO_FORMAT_4_3;
+	av7110->videostate.display_format = VIDEO_CENTER_CUT_OUT;
+	av7110->display_ar = VIDEO_FORMAT_4_3;
+
+	init_waitqueue_head(&av7110->video_events.wait_queue);
+	spin_lock_init(&av7110->video_events.lock);
+	av7110->video_events.eventw = av7110->video_events.eventr = 0;
+	av7110->video_events.overflow = 0;
+	memset(&av7110->video_size, 0, sizeof (video_size_t));
+
+	dvb_register_device(av7110->dvb_adapter, &av7110->video_dev,
+			    &dvbdev_video, av7110, DVB_DEVICE_VIDEO);
+
+	dvb_register_device(av7110->dvb_adapter, &av7110->audio_dev,
+			    &dvbdev_audio, av7110, DVB_DEVICE_AUDIO);
+
+	return 0;
+}
+
+void av7110_av_unregister(struct av7110 *av7110)
+{
+	dvb_unregister_device(av7110->audio_dev);
+	dvb_unregister_device(av7110->video_dev);
+}
+
+int av7110_av_init(struct av7110 *av7110)
+{
+	av7110->vidmode = VIDEO_MODE_PAL;
+
+	av7110_ipack_init(&av7110->ipack[0], IPACKS, play_audio_cb);
+	av7110->ipack[0].data = (void *) av7110;
+	av7110_ipack_init(&av7110->ipack[1], IPACKS, play_video_cb);
+	av7110->ipack[1].data = (void *) av7110;
+
+	dvb_ringbuffer_init(&av7110->avout, av7110->iobuf, AVOUTLEN);
+	dvb_ringbuffer_init(&av7110->aout, av7110->iobuf + AVOUTLEN, AOUTLEN);
+
+	av7110->kbuf[0] = (u8 *)(av7110->iobuf + AVOUTLEN + AOUTLEN + BMPLEN);
+	av7110->kbuf[1] = av7110->kbuf[0] + 2 * IPACKS;
+
+	return 0;
+}
+
+int av7110_av_exit(struct av7110 *av7110)
+{
+	av7110_ipack_free(&av7110->ipack[0]);
+	av7110_ipack_free(&av7110->ipack[1]);
+	return 0;
+}
diff -Nru a/drivers/media/dvb/ttpci/av7110_av.h b/drivers/media/dvb/ttpci/av7110_av.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/dvb/ttpci/av7110_av.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,29 @@
+#ifndef _AV7110_AV_H_
+#define _AV7110_AV_H_
+
+struct av7110;
+
+extern void av7110_set_vidmode(struct av7110 *av7110, int mode);
+
+extern int av7110_record_cb(struct dvb_filter_pes2ts *p2t, u8 *buf, size_t len);
+extern int av7110_pes_play(void *dest, struct dvb_ringbuffer *buf, int dlen);
+extern int av7110_write_to_decoder(struct dvb_demux_feed *feed, const u8 *buf, size_t len);
+
+extern int av7110_set_volume(struct av7110 *av7110, int volleft, int volright);
+extern void av7110_av_stop(struct av7110 *av7110, int av);
+extern int av7110_av_start_record(struct av7110 *av7110, int av,
+			  struct dvb_demux_feed *dvbdmxfeed);
+extern int av7110_av_start_play(struct av7110 *av7110, int av);
+
+extern void dvb_video_add_event(struct av7110 *av7110, struct video_event *event);
+
+extern void av7110_p2t_init(struct av7110_p2t *p, struct dvb_demux_feed *feed);
+extern void av7110_p2t_write(u8 const *buf, long int length, u16 pid, struct av7110_p2t *p);
+
+extern int av7110_av_register(struct av7110 *av7110);
+extern void av7110_av_unregister(struct av7110 *av7110);
+extern int av7110_av_init(struct av7110 *av7110);
+extern int av7110_av_exit(struct av7110 *av7110);
+
+
+#endif /* _AV7110_AV_H_ */
diff -Nru a/drivers/media/dvb/ttpci/av7110_ca.c b/drivers/media/dvb/ttpci/av7110_ca.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/dvb/ttpci/av7110_ca.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,364 @@
+/*
+ * av7110_ca.c: CA and CI stuff
+ *
+ * Copyright (C) 1999-2002 Ralph  Metzler
+ *                       & Marcus Metzler for convergence integrated media GmbH
+ *
+ * originally based on code by:
+ * Copyright (C) 1998,1999 Christian Theiss <mistert@rz.fh-augsburg.de>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
+ *
+ *
+ * the project's page is at http://www.linuxtv.org/dvb/
+ */
+
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/types.h>
+#include <linux/delay.h>
+#include <linux/fs.h>
+#include <linux/timer.h>
+#include <linux/poll.h>
+#include <linux/byteorder/swabb.h>
+#include <linux/smp_lock.h>
+
+#define DEBUG_VARIABLE av7110_debug
+extern int av7110_debug;
+
+#include "dvb_i2c.h"
+#include "av7110.h"
+#include "av7110_hw.h"
+#include "dvb_functions.h"
+
+
+void CI_handle(struct av7110 *av7110, u8 *data, u16 len)
+{
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if (len < 3)
+		return;
+	switch (data[0]) {
+	case CI_MSG_CI_INFO:
+		if (data[2] != 1 && data[2] != 2)
+			break;
+		switch (data[1]) {
+		case 0:
+			av7110->ci_slot[data[2] - 1].flags = 0;
+			break;
+		case 1:
+			av7110->ci_slot[data[2] - 1].flags |= CA_CI_MODULE_PRESENT;
+			break;
+		case 2:
+			av7110->ci_slot[data[2] - 1].flags |= CA_CI_MODULE_READY;
+			break;
+		}
+		break;
+	case CI_SWITCH_PRG_REPLY:
+		//av7110->ci_stat=data[1];
+		break;
+	default:
+		break;
+	}
+}
+
+
+void ci_get_data(struct dvb_ringbuffer *cibuf, u8 *data, int len)
+{
+	if (dvb_ringbuffer_free(cibuf) < len + 2)
+		return;
+
+	DVB_RINGBUFFER_WRITE_BYTE(cibuf, len >> 8);
+	DVB_RINGBUFFER_WRITE_BYTE(cibuf, len & 0xff);
+	dvb_ringbuffer_write(cibuf, data, len, 0);
+	wake_up_interruptible(&cibuf->queue);
+}
+
+
+/******************************************************************************
+ * CI link layer file ops
+ ******************************************************************************/
+
+int ci_ll_init(struct dvb_ringbuffer *cirbuf, struct dvb_ringbuffer *ciwbuf, int size)
+{
+	dvb_ringbuffer_init(cirbuf, vmalloc(size), size);
+	dvb_ringbuffer_init(ciwbuf, vmalloc(size), size);
+	return 0;
+}
+
+void ci_ll_flush(struct dvb_ringbuffer *cirbuf, struct dvb_ringbuffer *ciwbuf)
+{
+	dvb_ringbuffer_flush_spinlock_wakeup(cirbuf);
+	dvb_ringbuffer_flush_spinlock_wakeup(ciwbuf);
+}
+
+void ci_ll_release(struct dvb_ringbuffer *cirbuf, struct dvb_ringbuffer *ciwbuf)
+{
+	vfree(cirbuf->data);
+	cirbuf->data = 0;
+	vfree(ciwbuf->data);
+	ciwbuf->data = 0;
+}
+
+int ci_ll_reset(struct dvb_ringbuffer *cibuf, struct file *file,
+		int slots, ca_slot_info_t *slot)
+{
+	int i;
+	int len = 0;
+	u8 msg[8] = { 0x00, 0x06, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00 };
+
+	for (i = 0; i < 2; i++) {
+		if (slots & (1 << i))
+			len += 8;
+	}
+
+	if (dvb_ringbuffer_free(cibuf) < len)
+		return -EBUSY;
+
+	for (i = 0; i < 2; i++) {
+		if (slots & (1 << i)) {
+			msg[2] = i;
+			dvb_ringbuffer_write(cibuf, msg, 8, 0);
+			slot[i].flags = 0;
+		}
+	}
+
+	return 0;
+}
+
+static ssize_t ci_ll_write(struct dvb_ringbuffer *cibuf, struct file *file,
+			   const char *buf, size_t count, loff_t *ppos)
+{
+	int free;
+	int non_blocking = file->f_flags & O_NONBLOCK;
+
+	if (count > 2048)
+		return -EINVAL;
+	free = dvb_ringbuffer_free(cibuf);
+	if (count + 2 > free) {
+		if (non_blocking)
+			return -EWOULDBLOCK;
+		if (wait_event_interruptible(cibuf->queue,
+					     (dvb_ringbuffer_free(cibuf) >= count + 2)))
+			return -ERESTARTSYS;
+	}
+
+	DVB_RINGBUFFER_WRITE_BYTE(cibuf, count >> 8);
+	DVB_RINGBUFFER_WRITE_BYTE(cibuf, count & 0xff);
+
+	return dvb_ringbuffer_write(cibuf, buf, count, 1);
+}
+
+static ssize_t ci_ll_read(struct dvb_ringbuffer *cibuf, struct file *file,
+			  char *buf, size_t count, loff_t *ppos)
+{
+	int avail;
+	int non_blocking = file->f_flags & O_NONBLOCK;
+	ssize_t len;
+
+	if (!cibuf->data || !count)
+		return 0;
+	if (non_blocking && (dvb_ringbuffer_empty(cibuf)))
+		return -EWOULDBLOCK;
+	if (wait_event_interruptible(cibuf->queue,
+				     !dvb_ringbuffer_empty(cibuf)))
+		return -ERESTARTSYS;
+	avail = dvb_ringbuffer_avail(cibuf);
+	if (avail < 4)
+		return 0;
+	len = DVB_RINGBUFFER_PEEK(cibuf, 0) << 8;
+	len |= DVB_RINGBUFFER_PEEK(cibuf, 1);
+	if (avail < len + 2 || count < len)
+		return -EINVAL;
+	DVB_RINGBUFFER_SKIP(cibuf, 2);
+
+	return dvb_ringbuffer_read(cibuf, buf, len, 1);
+}
+
+static int dvb_ca_open(struct inode *inode, struct file *file)
+{
+	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
+	struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+	int err = dvb_generic_open(inode, file);
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if (err < 0)
+		return err;
+	ci_ll_flush(&av7110->ci_rbuffer, &av7110->ci_wbuffer);
+	return 0;
+}
+
+static unsigned int dvb_ca_poll (struct file *file, poll_table *wait)
+{
+	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
+	struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+	struct dvb_ringbuffer *rbuf = &av7110->ci_rbuffer;
+	struct dvb_ringbuffer *wbuf = &av7110->ci_wbuffer;
+	unsigned int mask = 0;
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	poll_wait(file, &rbuf->queue, wait);
+	if (!dvb_ringbuffer_empty(rbuf))
+		mask |= POLLIN;
+	if (dvb_ringbuffer_avail(wbuf) > 1024)
+		mask |= POLLOUT;
+
+	return mask;
+}
+
+static int dvb_ca_ioctl(struct inode *inode, struct file *file,
+		 unsigned int cmd, void *parg)
+{
+	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
+	struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+	unsigned long arg = (unsigned long) parg;
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	switch (cmd) {
+	case CA_RESET:
+		return ci_ll_reset(&av7110->ci_wbuffer, file, arg, &av7110->ci_slot[0]);
+		break;
+	case CA_GET_CAP:
+	{
+		ca_caps_t cap;
+
+		cap.slot_num = 2;
+		cap.slot_type = (FW_CI_LL_SUPPORT(av7110->arm_app) ?
+				 CA_CI_LINK : CA_CI) | CA_DESCR;
+		cap.descr_num = 16;
+		cap.descr_type = CA_ECD;
+		memcpy(parg, &cap, sizeof(cap));
+		break;
+	}
+
+	case CA_GET_SLOT_INFO:
+	{
+		ca_slot_info_t *info=(ca_slot_info_t *)parg;
+
+		if (info->num > 1)
+			return -EINVAL;
+		av7110->ci_slot[info->num].num = info->num;
+		av7110->ci_slot[info->num].type = FW_CI_LL_SUPPORT(av7110->arm_app) ?
+							CA_CI_LINK : CA_CI;
+		memcpy(info, &av7110->ci_slot[info->num], sizeof(ca_slot_info_t));
+		break;
+	}
+
+	case CA_GET_MSG:
+		break;
+
+	case CA_SEND_MSG:
+		break;
+
+	case CA_GET_DESCR_INFO:
+	{
+		ca_descr_info_t info;
+
+		info.num = 16;
+		info.type = CA_ECD;
+		memcpy(parg, &info, sizeof (info));
+		break;
+	}
+
+	case CA_SET_DESCR:
+	{
+		ca_descr_t *descr = (ca_descr_t*) parg;
+
+		if (descr->index >= 16)
+			return -EINVAL;
+		if (descr->parity > 1)
+			return -EINVAL;
+		av7110_fw_cmd(av7110, COMTYPE_PIDFILTER, SetDescr, 5,
+			      (descr->index<<8)|descr->parity,
+			      (descr->cw[0]<<8)|descr->cw[1],
+			      (descr->cw[2]<<8)|descr->cw[3],
+			      (descr->cw[4]<<8)|descr->cw[5],
+			      (descr->cw[6]<<8)|descr->cw[7]);
+		break;
+	}
+
+	default:
+		return -EINVAL;
+	}
+	return 0;
+}
+
+static ssize_t dvb_ca_write(struct file *file, const char *buf,
+			    size_t count, loff_t *ppos)
+{
+	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
+	struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+
+	DEB_EE(("av7110: %p\n", av7110));
+	return ci_ll_write(&av7110->ci_wbuffer, file, buf, count, ppos);
+}
+
+static ssize_t dvb_ca_read(struct file *file, char *buf,
+			   size_t count, loff_t *ppos)
+{
+	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
+	struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+
+	DEB_EE(("av7110: %p\n", av7110));
+	return ci_ll_read(&av7110->ci_rbuffer, file, buf, count, ppos);
+}
+
+
+
+static struct file_operations dvb_ca_fops = {
+	.owner		= THIS_MODULE,
+	.read		= dvb_ca_read,
+	.write		= dvb_ca_write,
+	.ioctl		= dvb_generic_ioctl,
+	.open		= dvb_ca_open,
+	.release	= dvb_generic_release,
+	.poll		= dvb_ca_poll,
+};
+
+static struct dvb_device dvbdev_ca = {
+	.priv		= 0,
+	.users		= 1,
+	.writers	= 1,
+	.fops		= &dvb_ca_fops,
+	.kernel_ioctl	= dvb_ca_ioctl,
+};
+
+
+int av7110_ca_register(struct av7110 *av7110)
+{
+	return dvb_register_device(av7110->dvb_adapter, &av7110->ca_dev,
+				   &dvbdev_ca, av7110, DVB_DEVICE_CA);
+}
+
+void av7110_ca_unregister(struct av7110 *av7110)
+{
+	dvb_unregister_device(av7110->ca_dev);
+}
+
+void av7110_ca_init(struct av7110* av7110)
+{
+	ci_ll_init(&av7110->ci_rbuffer, &av7110->ci_wbuffer, 8192);
+}
+
+void av7110_ca_exit(struct av7110* av7110)
+{
+	ci_ll_release(&av7110->ci_rbuffer, &av7110->ci_wbuffer);
+}
diff -Nru a/drivers/media/dvb/ttpci/av7110_ca.h b/drivers/media/dvb/ttpci/av7110_ca.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/dvb/ttpci/av7110_ca.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,14 @@
+#ifndef _AV7110_CA_H_
+#define _AV7110_CA_H_
+
+struct av7110;
+
+extern void CI_handle(struct av7110 *av7110, u8 *data, u16 len);
+extern void ci_get_data(struct dvb_ringbuffer *cibuf, u8 *data, int len);
+
+extern int av7110_ca_register(struct av7110 *av7110);
+extern void av7110_ca_unregister(struct av7110 *av7110);
+extern void av7110_ca_init(struct av7110* av7110);
+extern void av7110_ca_exit(struct av7110* av7110);
+
+#endif /* _AV7110_CA_H_ */
diff -Nru a/drivers/media/dvb/ttpci/av7110_hw.c b/drivers/media/dvb/ttpci/av7110_hw.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/dvb/ttpci/av7110_hw.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,1025 @@
+/*
+ * av7110_hw.c: av7110 low level hardware access and firmware interface
+ *
+ * Copyright (C) 1999-2002 Ralph  Metzler
+ *                       & Marcus Metzler for convergence integrated media GmbH
+ *
+ * originally based on code by:
+ * Copyright (C) 1998,1999 Christian Theiss <mistert@rz.fh-augsburg.de>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
+ *
+ * the project's page is at http://www.linuxtv.org/dvb/
+ */
+
+/* for debugging ARM communication: */
+//#define COM_DEBUG
+
+#include <stdarg.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/sched.h>
+#include <linux/delay.h>
+#include <linux/byteorder/swabb.h>
+#include <linux/smp_lock.h>
+#include <linux/fs.h>
+
+#define DEBUG_VARIABLE av7110_debug
+extern int av7110_debug;
+
+#include "av7110.h"
+#include "av7110_hw.h"
+#include "dvb_functions.h"
+
+/****************************************************************************
+ * DEBI functions
+ ****************************************************************************/
+
+/* This DEBI code is based on the Stradis driver
+   by Nathan Laredo <laredo@gnu.org> */
+
+int av7110_debiwrite(struct av7110 *av7110, u32 config,
+		     int addr, u32 val, int count)
+{
+	struct saa7146_dev *dev = av7110->dev;
+
+	if (count <= 0 || count > 32764)
+		return -1;
+	if (saa7146_wait_for_debi_done(av7110->dev) < 0)
+		return -1;
+	saa7146_write(dev, DEBI_CONFIG, config);
+	if (count <= 4)		/* immediate transfer */
+		saa7146_write(dev, DEBI_AD, val);
+	else			/* block transfer */
+		saa7146_write(dev, DEBI_AD, av7110->debi_bus);
+	saa7146_write(dev, DEBI_COMMAND, (count << 17) | (addr & 0xffff));
+	saa7146_write(dev, MC2, (2 << 16) | 2);
+	return 0;
+}
+
+u32 av7110_debiread(struct av7110 *av7110, u32 config, int addr, int count)
+{
+	struct saa7146_dev *dev = av7110->dev;
+	u32 result = 0;
+
+	if (count > 32764 || count <= 0)
+		return 0;
+	if (saa7146_wait_for_debi_done(av7110->dev) < 0)
+		return 0;
+	saa7146_write(dev, DEBI_AD, av7110->debi_bus);
+	saa7146_write(dev, DEBI_COMMAND, (count << 17) | 0x10000 | (addr & 0xffff));
+
+	saa7146_write(dev, DEBI_CONFIG, config);
+	saa7146_write(dev, MC2, (2 << 16) | 2);
+	if (count > 4)
+		return count;
+	saa7146_wait_for_debi_done(av7110->dev);
+	result = saa7146_read(dev, DEBI_AD);
+	result &= (0xffffffffUL >> ((4 - count) * 8));
+	return result;
+}
+
+
+
+/* av7110 ARM core boot stuff */
+
+void av7110_reset_arm(struct av7110 *av7110)
+{
+	saa7146_setgpio(av7110->dev, RESET_LINE, SAA7146_GPIO_OUTLO);
+
+	/* Disable DEBI and GPIO irq */
+	IER_DISABLE(av7110->dev, (MASK_19 | MASK_03));
+	saa7146_write(av7110->dev, ISR, (MASK_19 | MASK_03));
+
+	//FIXME: are those mdelays really necessary?
+	mdelay(800);
+	saa7146_setgpio(av7110->dev, RESET_LINE, SAA7146_GPIO_OUTHI);
+	mdelay(800);
+
+	ARM_ResetMailBox(av7110);
+
+	saa7146_write(av7110->dev, ISR, (MASK_19 | MASK_03));
+	IER_ENABLE(av7110->dev, MASK_03);
+
+	av7110->arm_ready = 1;
+	printk("av7110: ARM RESET\n");
+}
+
+
+static int waitdebi(struct av7110 *av7110, int adr, int state)
+{
+	int k;
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	for (k = 0; k < 100; k++) {
+		if (irdebi(av7110, DEBINOSWAP, adr, 0, 2) == state)
+			return 0;
+		udelay(500);
+	}
+	return -1;
+}
+
+static int load_dram(struct av7110 *av7110, u32 *data, int len)
+{
+	int i;
+	int blocks, rest;
+	u32 base, bootblock = BOOT_BLOCK;
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	blocks = len / BOOT_MAX_SIZE;
+	rest = len % BOOT_MAX_SIZE;
+	base = DRAM_START_CODE;
+
+	for (i = 0; i < blocks; i++) {
+		if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0)
+			return -1;
+		DEB_D(("Writing DRAM block %d\n", i));
+		mwdebi(av7110, DEBISWAB, bootblock,
+		       ((char*)data) + i * BOOT_MAX_SIZE, BOOT_MAX_SIZE);
+		bootblock ^= 0x1400;
+		iwdebi(av7110, DEBISWAB, BOOT_BASE, swab32(base), 4);
+		iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, BOOT_MAX_SIZE, 2);
+		iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
+		base += BOOT_MAX_SIZE;
+	}
+
+	if (rest > 0) {
+		if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0)
+			return -1;
+		if (rest > 4)
+			mwdebi(av7110, DEBISWAB, bootblock,
+			       ((char*)data) + i * BOOT_MAX_SIZE, rest);
+		else
+			mwdebi(av7110, DEBISWAB, bootblock,
+			       ((char*)data) + i * BOOT_MAX_SIZE - 4, rest + 4);
+
+		iwdebi(av7110, DEBISWAB, BOOT_BASE, swab32(base), 4);
+		iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, rest, 2);
+		iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
+	}
+	if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0)
+		return -1;
+	iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, 0, 2);
+	iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
+	if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BOOT_COMPLETE) < 0)
+		return -1;
+	return 0;
+}
+
+
+/* we cannot write av7110 DRAM directly, so load a bootloader into
+ * the DPRAM which implements a simple boot protocol */
+static u8 bootcode[] = {
+	0xea, 0x00, 0x00, 0x0e, 0xe1, 0xb0, 0xf0, 0x0e, /* 0x0000 */
+	0xe2, 0x5e, 0xf0, 0x04, 0xe2, 0x5e, 0xf0, 0x04,
+	0xe2, 0x5e, 0xf0, 0x08, 0xe2, 0x5e, 0xf0, 0x04,
+	0xe2, 0x5e, 0xf0, 0x04, 0xe2, 0x5e, 0xf0, 0x04,
+	0x2c, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x0c,
+	0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x34,
+	0x00, 0x00, 0x00, 0x00, 0xa5, 0xa5, 0x5a, 0x5a,
+	0x00, 0x1f, 0x15, 0x55, 0x00, 0x00, 0x00, 0x09,
+	0xe5, 0x9f, 0xd0, 0x5c, 0xe5, 0x9f, 0x40, 0x54, /* 0x0040 */
+	0xe3, 0xa0, 0x00, 0x00, 0xe5, 0x84, 0x00, 0x00,
+	0xe5, 0x84, 0x00, 0x04, 0xe1, 0xd4, 0x10, 0xb0,
+	0xe3, 0x51, 0x00, 0x00, 0x0a, 0xff, 0xff, 0xfc,
+	0xe1, 0xa0, 0x10, 0x0d, 0xe5, 0x94, 0x30, 0x04,
+	0xe1, 0xd4, 0x20, 0xb2, 0xe2, 0x82, 0x20, 0x3f,
+	0xe1, 0xb0, 0x23, 0x22, 0x03, 0xa0, 0x00, 0x02,
+	0xe1, 0xc4, 0x00, 0xb0, 0x0a, 0xff, 0xff, 0xf4,
+	0xe8, 0xb1, 0x1f, 0xe0, 0xe8, 0xa3, 0x1f, 0xe0, /* 0x0080 */
+	0xe8, 0xb1, 0x1f, 0xe0, 0xe8, 0xa3, 0x1f, 0xe0,
+	0xe2, 0x52, 0x20, 0x01, 0x1a, 0xff, 0xff, 0xf9,
+	0xe2, 0x2d, 0xdb, 0x05, 0xea, 0xff, 0xff, 0xec,
+	0x2c, 0x00, 0x03, 0xf8, 0x2c, 0x00, 0x04, 0x00,
+};
+
+int av7110_bootarm(struct av7110 *av7110)
+{
+	struct saa7146_dev *dev = av7110->dev;
+	u32 ret;
+	int i;
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	saa7146_setgpio(dev, RESET_LINE, SAA7146_GPIO_OUTLO);
+
+	/* Disable DEBI and GPIO irq */
+	IER_DISABLE(av7110->dev, MASK_03 | MASK_19);
+	saa7146_write(av7110->dev, ISR, (MASK_19 | MASK_03));
+
+	/* enable DEBI */
+	saa7146_write(av7110->dev, MC1, 0x08800880);
+	saa7146_write(av7110->dev, DD1_STREAM_B, 0x00000000);
+	saa7146_write(av7110->dev, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26));
+
+	/* test DEBI */
+	iwdebi(av7110, DEBISWAP, DPRAM_BASE, 0x76543210, 4);
+	if ((ret=irdebi(av7110, DEBINOSWAP, DPRAM_BASE, 0, 4)) != 0x10325476) {
+		printk(KERN_ERR "dvb: debi test in av7110_bootarm() failed: "
+		       "%08x != %08x (check your BIOS notplug settings)\n",
+		       ret, 0x10325476);
+		return -1;
+	}
+	for (i = 0; i < 8192; i += 4)
+		iwdebi(av7110, DEBISWAP, DPRAM_BASE + i, 0x00, 4);
+	DEB_D(("av7110_bootarm: debi test OK\n"));
+
+	/* boot */
+	DEB_D(("av7110_bootarm: load boot code\n"));
+	saa7146_setgpio(dev, ARM_IRQ_LINE, SAA7146_GPIO_IRQLO);
+	//saa7146_setgpio(dev, DEBI_DONE_LINE, SAA7146_GPIO_INPUT);
+	//saa7146_setgpio(dev, 3, SAA7146_GPIO_INPUT);
+
+	mwdebi(av7110, DEBISWAB, DPRAM_BASE, bootcode, sizeof(bootcode));
+	iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
+
+	saa7146_wait_for_debi_done(av7110->dev);
+	saa7146_setgpio(dev, RESET_LINE, SAA7146_GPIO_OUTHI);
+	//FIXME: necessary?
+	set_current_state(TASK_INTERRUPTIBLE);
+	schedule_timeout(HZ);
+
+	DEB_D(("av7110_bootarm: load dram code\n"));
+	if (load_dram(av7110, (u32 *)av7110->bin_root, av7110->size_root) < 0)
+		return -1;
+
+	saa7146_setgpio(dev, RESET_LINE, SAA7146_GPIO_OUTLO);
+	mdelay(1);
+
+	DEB_D(("av7110_bootarm: load dpram code\n"));
+	mwdebi(av7110, DEBISWAB, DPRAM_BASE, av7110->bin_dpram, av7110->size_dpram);
+
+	saa7146_wait_for_debi_done(av7110->dev);
+	saa7146_setgpio(dev, RESET_LINE, SAA7146_GPIO_OUTHI);
+	//FIXME: necessary?
+	mdelay(800);
+
+	//ARM_ClearIrq(av7110);
+	ARM_ResetMailBox(av7110);
+	saa7146_write(av7110->dev, ISR, (MASK_19 | MASK_03));
+	IER_ENABLE(av7110->dev, MASK_03);
+
+	av7110->arm_errors = 0;
+	av7110->arm_ready = 1;
+	return 0;
+}
+
+
+/****************************************************************************
+ * DEBI command polling
+ ****************************************************************************/
+
+int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length)
+{
+	int i;
+	unsigned long start;
+#ifdef COM_DEBUG
+	u32 stat;
+#endif
+
+//	DEB_EE(("av7110: %p\n", av7110));
+
+	if (!av7110->arm_ready) {
+		DEB_D(("arm not ready.\n"));
+		return -1;
+	}
+
+	start = jiffies;
+	while (rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 )) {
+		dvb_delay(1);
+		if (time_after(jiffies, start + ARM_WAIT_FREE)) {
+			printk(KERN_ERR "%s: timeout waiting for COMMAND idle\n", __FUNCTION__);
+			return -1;
+		}
+	}
+
+#ifndef _NOHANDSHAKE
+	start = jiffies;
+	while (rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 )) {
+		dvb_delay(1);
+		if (time_after(jiffies, start + ARM_WAIT_SHAKE)) {
+			printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__);
+			return -1;
+		}
+	}
+#endif
+
+	start = jiffies;
+	while (rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2) & OSDQFull) {
+		dvb_delay(1);
+		if (time_after(jiffies, start + ARM_WAIT_OSD)) {
+			printk(KERN_ERR "%s: timeout waiting for !OSDQFull\n", __FUNCTION__);
+			return -1;
+		}
+	}
+	for (i = 2; i < length; i++)
+		wdebi(av7110, DEBINOSWAP, COMMAND + 2 * i, (u32) buf[i], 2);
+
+	if (length)
+		wdebi(av7110, DEBINOSWAP, COMMAND + 2, (u32) buf[1], 2);
+	else
+		wdebi(av7110, DEBINOSWAP, COMMAND + 2, 0, 2);
+
+	wdebi(av7110, DEBINOSWAP, COMMAND, (u32) buf[0], 2);
+
+#ifdef COM_DEBUG
+	start = jiffies;
+	while (rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 )) {
+		dvb_delay(1);
+		if (time_after(jiffies, start + ARM_WAIT_FREE)) {
+			printk(KERN_ERR "%s: timeout waiting for COMMAND to complete\n",
+			       __FUNCTION__);
+			return -1;
+		}
+	}
+
+	stat = rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2);
+	if (stat & GPMQOver) {
+		printk(KERN_ERR "%s: GPMQOver\n", __FUNCTION__);
+		return -1;
+	}
+	else if (stat & OSDQOver) {
+		printk(KERN_ERR "%s: OSDQOver\n", __FUNCTION__);
+		return -1;
+	}
+#endif
+
+	return 0;
+}
+
+int av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length)
+{
+	int ret;
+
+//	DEB_EE(("av7110: %p\n", av7110));
+
+	if (!av7110->arm_ready) {
+		DEB_D(("arm not ready.\n"));
+		return -1;
+	}
+	if (down_interruptible(&av7110->dcomlock))
+		return -ERESTARTSYS;
+
+	ret = __av7110_send_fw_cmd(av7110, buf, length);
+	up(&av7110->dcomlock);
+	if (ret)
+		printk("av7110_send_fw_cmd error\n");
+	return ret;
+}
+
+int av7110_fw_cmd(struct av7110 *av7110, int type, int com, int num, ...)
+{
+	va_list args;
+	u16 buf[num + 2];
+	int i, ret;
+
+//	DEB_EE(("av7110: %p\n",av7110));
+
+	buf[0] = ((type << 8) | com);
+	buf[1] = num;
+
+	if (num) {
+		va_start(args, num);
+		for (i = 0; i < num; i++)
+			buf[i + 2] = va_arg(args, u32);
+		va_end(args);
+	}
+
+	ret = av7110_send_fw_cmd(av7110, buf, num + 2);
+	if (ret)
+		printk("av7110_fw_cmd error\n");
+	return ret;
+}
+
+int av7110_send_ci_cmd(struct av7110 *av7110, u8 subcom, u8 *buf, u8 len)
+{
+	int i, ret;
+	u16 cmd[18] = { ((COMTYPE_COMMON_IF << 8) + subcom),
+		16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	for(i = 0; i < len && i < 32; i++)
+	{
+		if(i % 2 == 0)
+			cmd[(i / 2) + 2] = (u16)(buf[i]) << 8;
+		else
+			cmd[(i / 2) + 2] |= buf[i];
+	}
+
+	ret = av7110_send_fw_cmd(av7110, cmd, 18);
+	if (ret)
+		printk("av7110_send_ci_cmd error\n");
+	return ret;
+}
+
+int av7110_fw_request(struct av7110 *av7110, u16 *request_buf,
+		      int request_buf_len, u16 *reply_buf, int reply_buf_len)
+{
+	int err;
+	s16 i;
+	unsigned long start;
+#ifdef COM_DEBUG
+	u32 stat;
+#endif
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if (!av7110->arm_ready) {
+		DEB_D(("arm not ready.\n"));
+		return -1;
+	}
+
+	if (down_interruptible(&av7110->dcomlock))
+		return -ERESTARTSYS;
+
+	if ((err = __av7110_send_fw_cmd(av7110, request_buf, request_buf_len)) < 0) {
+		up(&av7110->dcomlock);
+		printk("av7110_fw_request error\n");
+		return err;
+	}
+
+	start = jiffies;
+	while (rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2)) {
+#ifdef _NOHANDSHAKE
+		dvb_delay(1);
+#endif
+		if (time_after(jiffies, start + ARM_WAIT_FREE)) {
+			printk("%s: timeout waiting for COMMAND to complete\n", __FUNCTION__);
+			up(&av7110->dcomlock);
+			return -1;
+		}
+	}
+
+#ifndef _NOHANDSHAKE
+	start = jiffies;
+	while (rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 )) {
+		dvb_delay(1);
+		if (time_after(jiffies, start + ARM_WAIT_SHAKE)) {
+			printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__);
+			up(&av7110->dcomlock);
+			return -1;
+		}
+	}
+#endif
+
+#ifdef COM_DEBUG
+	stat = rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2);
+	if (stat & GPMQOver) {
+		printk(KERN_ERR "%s: GPMQOver\n", __FUNCTION__);
+		up(&av7110->dcomlock);
+		return -1;
+	}
+	else if (stat & OSDQOver) {
+		printk(KERN_ERR "%s: OSDQOver\n", __FUNCTION__);
+		up(&av7110->dcomlock);
+		return -1;
+	}
+#endif
+
+	for (i = 0; i < reply_buf_len; i++)
+		reply_buf[i] = rdebi(av7110, DEBINOSWAP, COM_BUFF + 2 * i, 0, 2);
+
+	up(&av7110->dcomlock);
+	return 0;
+}
+
+int av7110_fw_query(struct av7110 *av7110, u16 tag, u16* buf, s16 length)
+{
+	int ret;
+	ret = av7110_fw_request(av7110, &tag, 0, buf, length);
+	if (ret)
+		printk("av7110_fw_query error\n");
+	return ret;
+}
+
+
+/****************************************************************************
+ * Firmware commands
+ ****************************************************************************/
+
+/* get version of the firmware ROM, RTSL, video ucode and ARM application  */
+void av7110_firmversion(struct av7110 *av7110)
+{
+	u16 buf[20];
+	u16 tag = ((COMTYPE_REQUEST << 8) + ReqVersion);
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	av7110_fw_query(av7110, tag, buf, 16);
+
+	av7110->arm_fw = (buf[0] << 16) + buf[1];
+	av7110->arm_rtsl = (buf[2] << 16) + buf[3];
+	av7110->arm_vid = (buf[4] << 16) + buf[5];
+	av7110->arm_app = (buf[6] << 16) + buf[7];
+	av7110->avtype = (buf[8] << 16) + buf[9];
+
+	printk("DVB: AV711%d(%d) - firm %08x, rtsl %08x, vid %08x, app %08x\n",
+	       av7110->avtype, av7110->dvb_adapter->num, av7110->arm_fw,
+	       av7110->arm_rtsl, av7110->arm_vid, av7110->arm_app);
+
+	/* print firmware capabilities */
+	if (FW_CI_LL_SUPPORT(av7110->arm_app))
+		printk("DVB: AV711%d(%d) - firmware supports CI link layer interface\n",
+		       av7110->avtype, av7110->dvb_adapter->num);
+	else
+		printk("DVB: AV711%d(%d) - no firmware support for CI link layer interface\n",
+		       av7110->avtype, av7110->dvb_adapter->num);
+
+	return;
+}
+
+
+int av7110_diseqc_send(struct av7110 *av7110, int len, u8 *msg, unsigned long burst)
+{
+	int i;
+	u16 buf[18] = { ((COMTYPE_AUDIODAC << 8) + SendDiSEqC),
+			16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if (len > 10)
+		len = 10;
+
+	buf[1] = len + 2;
+	buf[2] = len;
+
+	if (burst != -1)
+		buf[3] = burst ? 0x01 : 0x00;
+	else
+		buf[3] = 0xffff;
+
+	for (i = 0; i < len; i++)
+		buf[i + 4] = msg[i];
+
+	if (av7110_send_fw_cmd(av7110, buf, 18))
+		printk("av7110_diseqc_send error\n");
+
+	return 0;
+}
+
+
+#ifdef CONFIG_DVB_AV7110_OSD
+
+static inline int ResetBlend(struct av7110 *av7110, u8 windownr)
+{
+	return av7110_fw_cmd(av7110, COMTYPE_OSD, SetNonBlend, 1, windownr);
+}
+
+static inline int SetColorBlend(struct av7110 *av7110, u8 windownr)
+{
+	return av7110_fw_cmd(av7110, COMTYPE_OSD, SetCBlend, 1, windownr);
+}
+
+static inline int SetWindowBlend(struct av7110 *av7110, u8 windownr, u8 blending)
+{
+	return av7110_fw_cmd(av7110, COMTYPE_OSD, SetWBlend, 2, windownr, blending);
+}
+
+static inline int SetBlend_(struct av7110 *av7110, u8 windownr,
+		     enum av7110_osd_palette_type colordepth, u16 index, u8 blending)
+{
+	return av7110_fw_cmd(av7110, COMTYPE_OSD, SetBlend, 4,
+			     windownr, colordepth, index, blending);
+}
+
+static inline int SetColor_(struct av7110 *av7110, u8 windownr,
+		     enum av7110_osd_palette_type colordepth, u16 index, u16 colorhi, u16 colorlo)
+{
+	return av7110_fw_cmd(av7110, COMTYPE_OSD, SetColor, 5,
+			     windownr, colordepth, index, colorhi, colorlo);
+}
+
+static inline int BringToTop(struct av7110 *av7110, u8 windownr)
+{
+	return av7110_fw_cmd(av7110, COMTYPE_OSD, WTop, 1, windownr);
+}
+
+static inline int SetFont(struct av7110 *av7110, u8 windownr, u8 fontsize,
+			  u16 colorfg, u16 colorbg)
+{
+	return av7110_fw_cmd(av7110, COMTYPE_OSD, Set_Font, 4,
+			     windownr, fontsize, colorfg, colorbg);
+}
+
+static int FlushText(struct av7110 *av7110)
+{
+	unsigned long start;
+
+	if (down_interruptible(&av7110->dcomlock))
+		return -ERESTARTSYS;
+	start = jiffies;
+	while (rdebi(av7110, DEBINOSWAP, BUFF1_BASE, 0, 2)) {
+		dvb_delay(1);
+		if (time_after(jiffies, start + ARM_WAIT_OSD)) {
+			printk(KERN_ERR "%s: timeout waiting for BUFF1_BASE == 0\n",
+			       __FUNCTION__);
+			up(&av7110->dcomlock);
+			return -1;
+		}
+	}
+	up(&av7110->dcomlock);
+	return 0;
+}
+
+static int WriteText(struct av7110 *av7110, u8 win, u16 x, u16 y, u8* buf)
+{
+	int i, ret;
+	unsigned long start;
+	int length = strlen(buf) + 1;
+	u16 cbuf[5] = { (COMTYPE_OSD << 8) + DText, 3, win, x, y };
+
+	if (down_interruptible(&av7110->dcomlock))
+		return -ERESTARTSYS;
+
+	start = jiffies;
+	while (rdebi(av7110, DEBINOSWAP, BUFF1_BASE, 0, 2)) {
+		dvb_delay(1);
+		if (time_after(jiffies, start + ARM_WAIT_OSD)) {
+			printk(KERN_ERR "%s: timeout waiting for BUFF1_BASE == 0\n",
+			       __FUNCTION__);
+			up(&av7110->dcomlock);
+			return -1;
+		}
+	}
+#ifndef _NOHANDSHAKE
+	start = jiffies;
+	while (rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2)) {
+		dvb_delay(1);
+		if (time_after(jiffies, start + ARM_WAIT_SHAKE)) {
+			printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n",
+			       __FUNCTION__);
+			up(&av7110->dcomlock);
+			return -1;
+		}
+	}
+#endif
+	for (i = 0; i < length / 2; i++)
+		wdebi(av7110, DEBINOSWAP, BUFF1_BASE + i * 2,
+		      swab16(*(u16 *)(buf + 2 * i)), 2);
+	if (length & 1)
+		wdebi(av7110, DEBINOSWAP, BUFF1_BASE + i * 2, 0, 2);
+	ret = __av7110_send_fw_cmd(av7110, cbuf, 5);
+	up(&av7110->dcomlock);
+	if (ret)
+		printk("WriteText error\n");
+	return ret;
+}
+
+static inline int DrawLine(struct av7110 *av7110, u8 windownr,
+			   u16 x, u16 y, u16 dx, u16 dy, u16 color)
+{
+	return av7110_fw_cmd(av7110, COMTYPE_OSD, DLine, 6,
+			     windownr, x, y, dx, dy, color);
+}
+
+static inline int DrawBlock(struct av7110 *av7110, u8 windownr,
+			    u16 x, u16 y, u16 dx, u16 dy, u16 color)
+{
+	return av7110_fw_cmd(av7110, COMTYPE_OSD, DBox, 6,
+			     windownr, x, y, dx, dy, color);
+}
+
+static inline int HideWindow(struct av7110 *av7110, u8 windownr)
+{
+	return av7110_fw_cmd(av7110, COMTYPE_OSD, WHide, 1, windownr);
+}
+
+static inline int MoveWindowRel(struct av7110 *av7110, u8 windownr, u16 x, u16 y)
+{
+	return av7110_fw_cmd(av7110, COMTYPE_OSD, WMoveD, 3, windownr, x, y);
+}
+
+static inline int MoveWindowAbs(struct av7110 *av7110, u8 windownr, u16 x, u16 y)
+{
+	return av7110_fw_cmd(av7110, COMTYPE_OSD, WMoveA, 3, windownr, x, y);
+}
+
+static inline int DestroyOSDWindow(struct av7110 *av7110, u8 windownr)
+{
+	return av7110_fw_cmd(av7110, COMTYPE_OSD, WDestroy, 1, windownr);
+}
+
+static inline int CreateOSDWindow(struct av7110 *av7110, u8 windownr,
+				  enum av7110_window_display_type disptype,
+				  u16 width, u16 height)
+{
+	return av7110_fw_cmd(av7110, COMTYPE_OSD, WCreate, 4,
+			     windownr, disptype, width, height);
+}
+
+
+static enum av7110_osd_palette_type bpp2pal[8] = {
+	Pal1Bit, Pal2Bit, 0, Pal4Bit, 0, 0, 0, Pal8Bit
+};
+static enum av7110_window_display_type bpp2bit[8] = {
+	BITMAP1, BITMAP2, 0, BITMAP4, 0, 0, 0, BITMAP8
+};
+
+static inline int LoadBitmap(struct av7110 *av7110, u16 format,
+			     u16 dx, u16 dy, int inc, u8* data)
+{
+	int bpp;
+	int i;
+	int d, delta;
+	u8 c;
+	DECLARE_WAITQUEUE(wait, current);
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if (av7110->bmp_state == BMP_LOADING) {
+		add_wait_queue(&av7110->bmpq, &wait);
+		while (1) {
+			set_current_state(TASK_INTERRUPTIBLE);
+			if (av7110->bmp_state != BMP_LOADING
+			    || signal_pending(current))
+				break;
+			schedule();
+		}
+		set_current_state(TASK_RUNNING);
+		remove_wait_queue(&av7110->bmpq, &wait);
+	}
+	if (av7110->bmp_state == BMP_LOADING)
+		return -1;
+	av7110->bmp_state = BMP_LOADING;
+	if	(format == BITMAP8) {
+		bpp=8; delta = 1;
+	} else if (format == BITMAP4) {
+		bpp=4; delta = 2;
+	} else if (format == BITMAP2) {
+		bpp=2; delta = 4;
+	} else if (format == BITMAP1) {
+		bpp=1; delta = 8;
+	} else {
+		av7110->bmp_state = BMP_NONE;
+		return -1;
+	}
+	av7110->bmplen = ((dx * dy * bpp + 7) & ~7) / 8;
+	av7110->bmpp = 0;
+	if (av7110->bmplen > 32768) {
+		av7110->bmp_state = BMP_NONE;
+		return -1;
+	}
+	for (i = 0; i < dy; i++) {
+		if (copy_from_user(av7110->bmpbuf + 1024 + i * dx, data + i * inc, dx)) {
+			av7110->bmp_state = BMP_NONE;
+			return -1;
+		}
+	}
+	if (format != BITMAP8) {
+		for (i = 0; i < dx * dy / delta; i++) {
+			c = ((u8 *)av7110->bmpbuf)[1024 + i * delta + delta - 1];
+			for (d = delta - 2; d >= 0; d--) {
+				c |= (((u8 *)av7110->bmpbuf)[1024 + i * delta + d]
+				      << ((delta - d - 1) * bpp));
+				((u8 *)av7110->bmpbuf)[1024 + i] = c;
+			}
+		}
+	}
+	av7110->bmplen += 1024;
+	return av7110_fw_cmd(av7110, COMTYPE_OSD, LoadBmp, 3, format, dx, dy);
+}
+
+static int BlitBitmap(struct av7110 *av7110, u16 win, u16 x, u16 y, u16 trans)
+{
+	DECLARE_WAITQUEUE(wait, current);
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+       if (av7110->bmp_state == BMP_NONE)
+		return -1;
+	if (av7110->bmp_state == BMP_LOADING) {
+		add_wait_queue(&av7110->bmpq, &wait);
+		while (1) {
+			set_current_state(TASK_INTERRUPTIBLE);
+			if (av7110->bmp_state != BMP_LOADING
+			    || signal_pending(current))
+				break;
+			schedule();
+		}
+		set_current_state(TASK_RUNNING);
+		remove_wait_queue(&av7110->bmpq, &wait);
+	}
+	if (av7110->bmp_state == BMP_LOADED)
+		return av7110_fw_cmd(av7110, COMTYPE_OSD, BlitBmp, 4, win, x, y, trans);
+	return -1;
+}
+
+static inline int ReleaseBitmap(struct av7110 *av7110)
+{
+	DEB_EE(("av7110: %p\n",av7110));
+
+	if (av7110->bmp_state != BMP_LOADED)
+		return -1;
+	av7110->bmp_state = BMP_NONE;
+	return av7110_fw_cmd(av7110, COMTYPE_OSD, ReleaseBmp, 0);
+}
+
+static u32 RGB2YUV(u16 R, u16 G, u16 B)
+{
+	u16 y, u, v;
+	u16 Y, Cr, Cb;
+
+	y = R * 77 + G * 150 + B * 29;	/* Luma=0.299R+0.587G+0.114B 0..65535 */
+	u = 2048 + B * 8 -(y >> 5);	/* Cr 0..4095 */
+	v = 2048 + R * 8 -(y >> 5);	/* Cb 0..4095 */
+
+	Y = y / 256;
+	Cb = u / 16;
+	Cr = v / 16;
+
+	return Cr | (Cb << 16) | (Y << 8);
+}
+
+static void OSDSetColor(struct av7110 *av7110, u8 color, u8 r, u8 g, u8 b, u8 blend)
+{
+	u16 ch, cl;
+	u32 yuv;
+
+	yuv = blend ? RGB2YUV(r,g,b) : 0;
+	cl = (yuv & 0xffff);
+	ch = ((yuv >> 16) & 0xffff);
+	SetColor_(av7110, av7110->osdwin, bpp2pal[av7110->osdbpp[av7110->osdwin]],
+		  color, ch, cl);
+	SetBlend_(av7110, av7110->osdwin, bpp2pal[av7110->osdbpp[av7110->osdwin]],
+		  color, ((blend >> 4) & 0x0f));
+}
+
+static int OSDSetPalette(struct av7110 *av7110, u32 *colors, u8 first, u8 last)
+{
+       int i;
+       int length = last - first + 1;
+
+       if (length * 4 > DATA_BUFF3_SIZE)
+	       return -1;
+
+       for (i = 0; i < length; i++) {
+	       u32 blend = (colors[i] & 0xF0000000) >> 4;
+	       u32 yuv = blend ? RGB2YUV(colors[i] & 0xFF, (colors[i] >> 8) & 0xFF,
+					 (colors[i] >> 16) & 0xFF) | blend : 0;
+	       yuv = ((yuv & 0xFFFF0000) >> 16) | ((yuv & 0x0000FFFF) << 16);
+	       wdebi(av7110, DEBINOSWAP, DATA_BUFF3_BASE + i * 4, yuv, 4);
+       }
+       return av7110_fw_cmd(av7110, COMTYPE_OSD, Set_Palette, 4,
+			    av7110->osdwin,
+			    bpp2pal[av7110->osdbpp[av7110->osdwin]],
+			    first, last);
+}
+
+static int OSDSetBlock(struct av7110 *av7110, int x0, int y0,
+		       int x1, int y1, int inc, u8 *data)
+{
+	uint w, h, bpp, bpl, size, lpb, bnum, brest;
+	int i;
+
+	w = x1 - x0 + 1;
+	h = y1 - y0 + 1;
+	if (inc <= 0)
+		inc = w;
+	if (w <= 0 || w > 720 || h <= 0 || h > 576)
+		return -1;
+	bpp = av7110->osdbpp[av7110->osdwin] + 1;
+	bpl = ((w * bpp + 7) & ~7) / 8;
+	size = h * bpl;
+	lpb = (32 * 1024) / bpl;
+	bnum = size / (lpb * bpl);
+	brest = size - bnum * lpb * bpl;
+
+	for (i = 0; i < bnum; i++) {
+		LoadBitmap(av7110, bpp2bit[av7110->osdbpp[av7110->osdwin]],
+			   w, lpb, inc, data);
+		BlitBitmap(av7110, av7110->osdwin, x0, y0 + i * lpb, 0);
+		data += lpb * inc;
+	}
+	if (brest) {
+		LoadBitmap(av7110, bpp2bit[av7110->osdbpp[av7110->osdwin]],
+			   w, brest / bpl, inc, data);
+		BlitBitmap(av7110, av7110->osdwin, x0, y0 + bnum * lpb, 0);
+	}
+	ReleaseBitmap(av7110);
+	return 0;
+}
+
+int av7110_osd_cmd(struct av7110 *av7110, osd_cmd_t *dc)
+{
+	switch (dc->cmd) {
+	case OSD_Close:
+		DestroyOSDWindow(av7110, av7110->osdwin);
+		return 0;
+	case OSD_Open:
+		av7110->osdbpp[av7110->osdwin] = (dc->color - 1) & 7;
+		CreateOSDWindow(av7110, av7110->osdwin,
+				bpp2bit[av7110->osdbpp[av7110->osdwin]],
+				dc->x1 - dc->x0 + 1, dc->y1 - dc->y0 + 1);
+		if (!dc->data) {
+			MoveWindowAbs(av7110, av7110->osdwin, dc->x0, dc->y0);
+			SetColorBlend(av7110, av7110->osdwin);
+		}
+		return 0;
+	case OSD_Show:
+		MoveWindowRel(av7110, av7110->osdwin, 0, 0);
+		return 0;
+	case OSD_Hide:
+		HideWindow(av7110, av7110->osdwin);
+		return 0;
+	case OSD_Clear:
+		DrawBlock(av7110, av7110->osdwin, 0, 0, 720, 576, 0);
+		return 0;
+	case OSD_Fill:
+		DrawBlock(av7110, av7110->osdwin, 0, 0, 720, 576, dc->color);
+		return 0;
+	case OSD_SetColor:
+		OSDSetColor(av7110, dc->color, dc->x0, dc->y0, dc->x1, dc->y1);
+		return 0;
+	case OSD_SetPalette:
+	{
+		if (FW_VERSION(av7110->arm_app) >= 0x2618)
+			OSDSetPalette(av7110, (u32 *)dc->data, dc->color, dc->x0);
+		else {
+			int i, len = dc->x0-dc->color+1;
+			u8 *colors = (u8 *)dc->data;
+
+			for (i = 0; i<len; i++)
+				OSDSetColor(av7110, dc->color + i,
+					colors[i * 4], colors[i * 4 + 1],
+					colors[i * 4 + 2], colors[i * 4 + 3]);
+		}
+		return 0;
+	}
+	case OSD_SetTrans:
+		return 0;
+	case OSD_SetPixel:
+		DrawLine(av7110, av7110->osdwin,
+			 dc->x0, dc->y0, 0, 0, dc->color);
+		return 0;
+	case OSD_GetPixel:
+		return 0;
+
+	case OSD_SetRow:
+		dc->y1 = dc->y0;
+		/* fall through */
+	case OSD_SetBlock:
+		OSDSetBlock(av7110, dc->x0, dc->y0, dc->x1, dc->y1, dc->color, dc->data);
+		return 0;
+
+	case OSD_FillRow:
+		DrawBlock(av7110, av7110->osdwin, dc->x0, dc->y0,
+			  dc->x1-dc->x0+1, dc->y1, dc->color);
+		return 0;
+	case OSD_FillBlock:
+		DrawBlock(av7110, av7110->osdwin, dc->x0, dc->y0,
+			  dc->x1 - dc->x0 + 1, dc->y1 - dc->y0 + 1, dc->color);
+		return 0;
+	case OSD_Line:
+		DrawLine(av7110, av7110->osdwin,
+			 dc->x0, dc->y0, dc->x1 - dc->x0, dc->y1 - dc->y0, dc->color);
+		return 0;
+	case OSD_Query:
+		return 0;
+	case OSD_Test:
+		return 0;
+	case OSD_Text:
+	{
+		char textbuf[240];
+
+		if (strncpy_from_user(textbuf, dc->data, 240) < 0)
+			return -EFAULT;
+		textbuf[239] = 0;
+		if (dc->x1 > 3)
+			dc->x1 = 3;
+		SetFont(av7110, av7110->osdwin, dc->x1,
+			(u16) (dc->color & 0xffff), (u16) (dc->color >> 16));
+		FlushText(av7110);
+		WriteText(av7110, av7110->osdwin, dc->x0, dc->y0, textbuf);
+		return 0;
+	}
+	case OSD_SetWindow:
+		if (dc->x0 < 1 || dc->x0 > 7)
+			return -EINVAL;
+		av7110->osdwin = dc->x0;
+		return 0;
+	case OSD_MoveWindow:
+		MoveWindowAbs(av7110, av7110->osdwin, dc->x0, dc->y0);
+		SetColorBlend(av7110, av7110->osdwin);
+		return 0;
+	default:
+		return -EINVAL;
+	}
+}
+#endif /* CONFIG_DVB_AV7110_OSD */
diff -Nru a/drivers/media/dvb/ttpci/av7110_hw.h b/drivers/media/dvb/ttpci/av7110_hw.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/dvb/ttpci/av7110_hw.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,493 @@
+#ifndef _AV7110_HW_H_
+#define _AV7110_HW_H_
+
+#include "av7110.h"
+
+/* DEBI transfer mode defs */
+
+#define DEBINOSWAP 0x000e0000
+#define DEBISWAB   0x001e0000
+#define DEBISWAP   0x002e0000
+
+#define ARM_WAIT_FREE  (HZ)
+#define ARM_WAIT_SHAKE (HZ/5)
+#define ARM_WAIT_OSD (HZ)
+
+
+enum av7110_bootstate
+{
+	BOOTSTATE_BUFFER_EMPTY	= 0,
+	BOOTSTATE_BUFFER_FULL	= 1,
+	BOOTSTATE_BOOT_COMPLETE	= 2
+};
+
+enum av7110_type_rec_play_format
+{	RP_None,
+	AudioPES,
+	AudioMp2,
+	AudioPCM,
+	VideoPES,
+	AV_PES
+};
+
+enum av7110_osd_palette_type
+{
+	NoPalet =  0,	   /* No palette */
+	Pal1Bit =  2,	   /* 2 colors for 1 Bit Palette    */
+	Pal2Bit =  4,	   /* 4 colors for 2 bit palette    */
+	Pal4Bit =  16,	   /* 16 colors for 4 bit palette   */
+	Pal8Bit =  256	   /* 256 colors for 16 bit palette */
+};
+
+enum av7110_window_display_type {
+	BITMAP1,	   /* 1 bit bitmap */
+	BITMAP2,	   /* 2 bit bitmap */
+	BITMAP4,	   /* 4 bit bitmap */
+	BITMAP8,	   /* 8 bit bitmap */
+	BITMAP1HR,	   /* 1 Bit bitmap half resolution */
+	BITMAP2HR,	   /* 2 bit bitmap half resolution */
+	BITMAP4HR,	   /* 4 bit bitmap half resolution */
+	BITMAP8HR,	   /* 8 bit bitmap half resolution */
+	YCRCB422,	   /* 4:2:2 YCRCB Graphic Display */
+	YCRCB444,	   /* 4:4:4 YCRCB Graphic Display */
+	YCRCB444HR,	   /* 4:4:4 YCRCB graphic half resolution */
+	VIDEOTSIZE,	   /* True Size Normal MPEG Video Display */
+	VIDEOHSIZE,	   /* MPEG Video Display Half Resolution */
+	VIDEOQSIZE,	   /* MPEG Video Display Quarter Resolution */
+	VIDEODSIZE,	   /* MPEG Video Display Double Resolution */
+	VIDEOTHSIZE,	   /* True Size MPEG Video Display Half Resolution */
+	VIDEOTQSIZE,	   /* True Size MPEG Video Display Quarter Resolution*/
+	VIDEOTDSIZE,	   /* True Size MPEG Video Display Double Resolution */
+	VIDEONSIZE,	   /* Full Size MPEG Video Display */
+	CURSOR		   /* Cursor */
+};
+
+/* switch defines */
+#define SB_GPIO 3
+#define SB_OFF	SAA7146_GPIO_OUTLO  /* SlowBlank off (TV-Mode) */
+#define SB_ON	SAA7146_GPIO_INPUT  /* SlowBlank on  (AV-Mode) */
+#define SB_WIDE SAA7146_GPIO_OUTHI  /* SlowBlank 6V  (16/9-Mode) (not implemented) */
+
+#define FB_GPIO 1
+#define FB_OFF	SAA7146_GPIO_LO     /* FastBlank off (CVBS-Mode) */
+#define FB_ON	SAA7146_GPIO_OUTHI  /* FastBlank on  (RGB-Mode) */
+#define FB_LOOP	SAA7146_GPIO_INPUT  /* FastBlank loop-through (PC graphics ???) */
+
+enum av7110_video_output_mode
+{
+	NO_OUT	     = 0,		/* disable analog output */
+	CVBS_RGB_OUT = 1,
+	CVBS_YC_OUT  = 2,
+	YC_OUT	     = 3
+};
+
+/* firmware internal msg q status: */
+#define GPMQFull	0x0001		/* Main Message Queue Full */
+#define GPMQOver	0x0002		/* Main Message Queue Overflow */
+#define HPQFull		0x0004		/* High Priority Msg Queue Full */
+#define HPQOver		0x0008
+#define OSDQFull	0x0010		/* OSD Queue Full */
+#define OSDQOver	0x0020
+
+/* hw section filter flags */
+#define	SECTION_EIT		0x01
+#define	SECTION_SINGLE		0x00
+#define	SECTION_CYCLE		0x02
+#define	SECTION_CONTINUOS	0x04
+#define	SECTION_MODE		0x06
+#define SECTION_IPMPE		0x0C	/* size up to 4k */
+#define SECTION_HIGH_SPEED	0x1C	/* larger buffer */
+#define DATA_PIPING_FLAG	0x20	/* for Data Piping Filter */
+
+#define	PBUFSIZE_NONE 0x0000
+#define	PBUFSIZE_1P   0x0100
+#define	PBUFSIZE_2P   0x0200
+#define	PBUFSIZE_1K   0x0300
+#define	PBUFSIZE_2K   0x0400
+#define	PBUFSIZE_4K   0x0500
+#define	PBUFSIZE_8K   0x0600
+#define PBUFSIZE_16K  0x0700
+#define PBUFSIZE_32K  0x0800
+
+
+/* firmware command codes */
+enum av7110_osd_command {
+	WCreate,
+	WDestroy,
+	WMoveD,
+	WMoveA,
+	WHide,
+	WTop,
+	DBox,
+	DLine,
+	DText,
+	Set_Font,
+	SetColor,
+	SetBlend,
+	SetWBlend,
+	SetCBlend,
+	SetNonBlend,
+	LoadBmp,
+	BlitBmp,
+	ReleaseBmp,
+	SetWTrans,
+	SetWNoTrans,
+	Set_Palette
+};
+
+enum av7110_pid_command {
+	MultiPID,
+	VideoPID,
+	AudioPID,
+	InitFilt,
+	FiltError,
+	NewVersion,
+	CacheError,
+	AddPIDFilter,
+	DelPIDFilter,
+	Scan,
+	SetDescr,
+	SetIR,
+	FlushTSQueue
+};
+
+enum av7110_mpeg_command {
+	SelAudChannels
+};
+
+enum av7110_audio_command {
+	AudioDAC,
+	CabADAC,
+	ON22K,
+	OFF22K,
+	MainSwitch,
+	ADSwitch,
+	SendDiSEqC,
+	SetRegister
+};
+
+enum av7110_request_command {
+	AudioState,
+	AudioBuffState,
+	VideoState1,
+	VideoState2,
+	VideoState3,
+	CrashCounter,
+	ReqVersion,
+	ReqVCXO,
+	ReqRegister,
+	ReqSecFilterError,
+	ReqSTC
+};
+
+enum av7110_encoder_command {
+	SetVidMode,
+	SetTestMode,
+	LoadVidCode,
+	SetMonitorType,
+	SetPanScanType,
+	SetFreezeMode
+};
+
+enum av7110_rec_play_state {
+	__Record,
+	__Stop,
+	__Play,
+	__Pause,
+	__Slow,
+	__FF_IP,
+	__Scan_I,
+	__Continue
+};
+
+enum av7110_command_type {
+	COMTYPE_NOCOM,
+	COMTYPE_PIDFILTER,
+	COMTYPE_MPEGDECODER,
+	COMTYPE_OSD,
+	COMTYPE_BMP,
+	COMTYPE_ENCODER,
+	COMTYPE_AUDIODAC,
+	COMTYPE_REQUEST,
+	COMTYPE_SYSTEM,
+	COMTYPE_REC_PLAY,
+	COMTYPE_COMMON_IF,
+	COMTYPE_PID_FILTER,
+	COMTYPE_PES,
+	COMTYPE_TS,
+	COMTYPE_VIDEO,
+	COMTYPE_AUDIO,
+	COMTYPE_CI_LL,
+};
+
+#define VID_NONE_PREF		0x00	/* No aspect ration processing preferred */
+#define VID_PAN_SCAN_PREF	0x01	/* Pan and Scan Display preferred */
+#define VID_VERT_COMP_PREF	0x02	/* Vertical compression display preferred */
+#define VID_VC_AND_PS_PREF	0x03	/* PanScan and vertical Compression if allowed */
+#define VID_CENTRE_CUT_PREF	0x05	/* PanScan with zero vector */
+
+/* firmware data interface codes */
+#define DATA_NONE		 0x00
+#define DATA_FSECTION		 0x01
+#define DATA_IPMPE		 0x02
+#define DATA_MPEG_RECORD	 0x03
+#define DATA_DEBUG_MESSAGE	 0x04
+#define DATA_COMMON_INTERFACE	 0x05
+#define DATA_MPEG_PLAY		 0x06
+#define DATA_BMP_LOAD		 0x07
+#define DATA_IRCOMMAND		 0x08
+#define DATA_PIPING		 0x09
+#define DATA_STREAMING		 0x0a
+#define DATA_CI_GET		 0x0b
+#define DATA_CI_PUT		 0x0c
+#define DATA_MPEG_VIDEO_EVENT	 0x0d
+
+#define DATA_PES_RECORD		 0x10
+#define DATA_PES_PLAY		 0x11
+#define DATA_TS_RECORD		 0x12
+#define DATA_TS_PLAY		 0x13
+
+/* ancient CI command codes, only two are actually still used
+ * by the link level CI firmware */
+#define CI_CMD_ERROR		 0x00
+#define CI_CMD_ACK		 0x01
+#define CI_CMD_SYSTEM_READY	 0x02
+#define CI_CMD_KEYPRESS		 0x03
+#define CI_CMD_ON_TUNED		 0x04
+#define CI_CMD_ON_SWITCH_PROGRAM 0x05
+#define CI_CMD_SECTION_ARRIVED	 0x06
+#define CI_CMD_SECTION_TIMEOUT	 0x07
+#define CI_CMD_TIME		 0x08
+#define CI_CMD_ENTER_MENU	 0x09
+#define CI_CMD_FAST_PSI		 0x0a
+#define CI_CMD_GET_SLOT_INFO	 0x0b
+
+#define CI_MSG_NONE		 0x00
+#define CI_MSG_CI_INFO		 0x01
+#define CI_MSG_MENU		 0x02
+#define CI_MSG_LIST		 0x03
+#define CI_MSG_TEXT		 0x04
+#define CI_MSG_REQUEST_INPUT	 0x05
+#define CI_MSG_INPUT_COMPLETE	 0x06
+#define CI_MSG_LIST_MORE	 0x07
+#define CI_MSG_MENU_MORE	 0x08
+#define CI_MSG_CLOSE_MMI_IMM	 0x09
+#define CI_MSG_SECTION_REQUEST	 0x0a
+#define CI_MSG_CLOSE_FILTER	 0x0b
+#define CI_PSI_COMPLETE		 0x0c
+#define CI_MODULE_READY		 0x0d
+#define CI_SWITCH_PRG_REPLY	 0x0e
+#define CI_MSG_TEXT_MORE	 0x0f
+
+#define CI_MSG_CA_PMT		 0xe0
+#define CI_MSG_ERROR		 0xf0
+
+
+/* base address of the dual ported RAM which serves as communication
+ * area between PCI bus and av7110,
+ * as seen by the DEBI bus of the saa7146 */
+#define	DPRAM_BASE 0x4000
+
+/* boot protocol area */
+#define BOOT_STATE	(DPRAM_BASE + 0x3F8)
+#define BOOT_SIZE	(DPRAM_BASE + 0x3FA)
+#define BOOT_BASE	(DPRAM_BASE + 0x3FC)
+#define BOOT_BLOCK	(DPRAM_BASE + 0x400)
+#define BOOT_MAX_SIZE	0xc00
+
+/* firmware command protocol area */
+#define IRQ_STATE	(DPRAM_BASE + 0x0F4)
+#define IRQ_STATE_EXT	(DPRAM_BASE + 0x0F6)
+#define MSGSTATE	(DPRAM_BASE + 0x0F8)
+#define FILT_STATE	(DPRAM_BASE + 0x0FA)
+#define COMMAND		(DPRAM_BASE + 0x0FC)
+#define COM_BUFF	(DPRAM_BASE + 0x100)
+#define COM_BUFF_SIZE	0x20
+
+/* various data buffers */
+#define BUFF1_BASE	(DPRAM_BASE + 0x120)
+#define BUFF1_SIZE	0xE0
+
+#define DATA_BUFF0_BASE	(DPRAM_BASE + 0x200)
+#define DATA_BUFF0_SIZE	0x0800
+
+#define DATA_BUFF1_BASE	(DATA_BUFF0_BASE+DATA_BUFF0_SIZE)
+#define DATA_BUFF1_SIZE	0x0800
+
+#define DATA_BUFF2_BASE	(DATA_BUFF1_BASE+DATA_BUFF1_SIZE)
+#define DATA_BUFF2_SIZE	0x0800
+
+#define DATA_BUFF3_BASE (DATA_BUFF2_BASE+DATA_BUFF2_SIZE)
+#define DATA_BUFF3_SIZE 0x0400
+
+#define Reserved	(DPRAM_BASE + 0x1E00)
+#define Reserved_SIZE	0x1C0
+
+
+/* firmware status area */
+#define STATUS_BASE	(DPRAM_BASE + 0x1FC0)
+#define STATUS_SCR	(STATUS_BASE + 0x00)
+#define STATUS_MODES	(STATUS_BASE + 0x04)
+#define STATUS_LOOPS	(STATUS_BASE + 0x08)
+
+#define STATUS_MPEG_WIDTH     (STATUS_BASE + 0x0C)
+/* ((aspect_ratio & 0xf) << 12) | (height & 0xfff) */
+#define STATUS_MPEG_HEIGHT_AR (STATUS_BASE + 0x0E)
+
+/* firmware data protocol area */
+#define RX_TYPE		(DPRAM_BASE + 0x1FE8)
+#define RX_LEN		(DPRAM_BASE + 0x1FEA)
+#define TX_TYPE		(DPRAM_BASE + 0x1FEC)
+#define TX_LEN		(DPRAM_BASE + 0x1FEE)
+
+#define RX_BUFF		(DPRAM_BASE + 0x1FF4)
+#define TX_BUFF		(DPRAM_BASE + 0x1FF6)
+
+#define HANDSHAKE_REG	(DPRAM_BASE + 0x1FF8)
+#define COM_IF_LOCK	(DPRAM_BASE + 0x1FFA)
+
+#define IRQ_RX		(DPRAM_BASE + 0x1FFC)
+#define IRQ_TX		(DPRAM_BASE + 0x1FFE)
+
+/* used by boot protocol to load firmware into av7110 DRAM */
+#define DRAM_START_CODE		0x2e000404
+#define DRAM_MAX_CODE_SIZE	0x00100000
+
+/* saa7146 gpio lines */
+#define RESET_LINE		2
+#define DEBI_DONE_LINE		1
+#define ARM_IRQ_LINE		0
+
+
+
+extern void av7110_reset_arm(struct av7110 *av7110);
+extern int av7110_bootarm(struct av7110 *av7110);
+extern void av7110_firmversion(struct av7110 *av7110);
+#define FW_CI_LL_SUPPORT(arm_app) ((arm_app) & 0x80000000)
+#define FW_VERSION(arm_app)	  ((arm_app) & 0x0000FFFF)
+
+extern int av7110_fw_cmd(struct av7110 *av7110, int type, int com, int num, ...);
+extern int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length);
+extern int av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length);
+extern int av7110_send_ci_cmd(struct av7110 *av7110, u8 subcom, u8 *buf, u8 len);
+extern int av7110_fw_request(struct av7110 *av7110, u16 *request_buf,
+			     int request_buf_len, u16 *reply_buf, int reply_buf_len);
+extern int av7110_fw_query(struct av7110 *av7110, u16 tag, u16* Buff, s16 length);
+
+
+/* DEBI (saa7146 data extension bus interface) access */
+extern int av7110_debiwrite(struct av7110 *av7110, u32 config,
+			    int addr, u32 val, int count);
+extern u32 av7110_debiread(struct av7110 *av7110, u32 config,
+			   int addr, int count);
+
+
+/* DEBI during interrupt */
+/* single word writes */
+static inline void iwdebi(struct av7110 *av7110, u32 config, int addr, u32 val, int count)
+{
+	av7110_debiwrite(av7110, config, addr, val, count);
+}
+
+/* buffer writes */
+static inline void mwdebi(struct av7110 *av7110, u32 config, int addr, char *val, int count)
+{
+	memcpy(av7110->debi_virt, val, count);
+	av7110_debiwrite(av7110, config, addr, 0, count);
+}
+
+static inline u32 irdebi(struct av7110 *av7110, u32 config, int addr, u32 val, int count)
+{
+	u32 res;
+
+	res=av7110_debiread(av7110, config, addr, count);
+	if (count<=4)
+		memcpy(av7110->debi_virt, (char *) &res, count);
+	return res;
+}
+
+/* DEBI outside interrupts, only for count <= 4! */
+static inline void wdebi(struct av7110 *av7110, u32 config, int addr, u32 val, int count)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&av7110->debilock, flags);
+	av7110_debiwrite(av7110, config, addr, val, count);
+	spin_unlock_irqrestore(&av7110->debilock, flags);
+}
+
+static inline u32 rdebi(struct av7110 *av7110, u32 config, int addr, u32 val, int count)
+{
+	unsigned long flags;
+	u32 res;
+
+	spin_lock_irqsave(&av7110->debilock, flags);
+	res=av7110_debiread(av7110, config, addr, count);
+	spin_unlock_irqrestore(&av7110->debilock, flags);
+	return res;
+}
+
+/* handle mailbox registers of the dual ported RAM */
+static inline void ARM_ResetMailBox(struct av7110 *av7110)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&av7110->debilock, flags);
+	av7110_debiread(av7110, DEBINOSWAP, IRQ_RX, 2);
+	av7110_debiwrite(av7110, DEBINOSWAP, IRQ_RX, 0, 2);
+	spin_unlock_irqrestore(&av7110->debilock, flags);
+}
+
+static inline void ARM_ClearMailBox(struct av7110 *av7110)
+{
+	iwdebi(av7110, DEBINOSWAP, IRQ_RX, 0, 2);
+}
+
+static inline void ARM_ClearIrq(struct av7110 *av7110)
+{
+	irdebi(av7110, DEBINOSWAP, IRQ_RX, 0, 2);
+}
+
+/****************************************************************************
+ * Firmware commands
+ ****************************************************************************/
+
+static inline int SendDAC(struct av7110 *av7110, u8 addr, u8 data)
+{
+	return av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, AudioDAC, 2, addr, data);
+}
+
+static inline void VidMode(struct av7110 *av7110, int mode)
+{
+	av7110_fw_cmd(av7110, COMTYPE_ENCODER, SetVidMode, 1, mode);
+}
+
+static int inline vidcom(struct av7110 *av7110, u32 com, u32 arg)
+{
+	return av7110_fw_cmd(av7110, 0x80, 0x02, 4,
+			     (com>>16), (com&0xffff),
+			     (arg>>16), (arg&0xffff));
+}
+
+static int inline audcom(struct av7110 *av7110, u32 com)
+{
+	return av7110_fw_cmd(av7110, 0x80, 0x03, 4,
+			     (com>>16), (com&0xffff));
+}
+
+static inline void Set22K(struct av7110 *av7110, int state)
+{
+	av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, (state ? ON22K : OFF22K), 0);
+}
+
+
+extern int av7110_diseqc_send(struct av7110 *av7110, int len, u8 *msg, unsigned long burst);
+
+
+#ifdef CONFIG_DVB_AV7110_OSD
+extern int av7110_osd_cmd(struct av7110 *av7110, osd_cmd_t *dc);
+#endif /* CONFIG_DVB_AV7110_OSD */
+
+
+
+#endif /* _AV7110_HW_H_ */
diff -Nru a/drivers/media/dvb/ttpci/av7110_ipack.c b/drivers/media/dvb/ttpci/av7110_ipack.c
--- a/drivers/media/dvb/ttpci/av7110_ipack.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/dvb/ttpci/av7110_ipack.c	Tue Feb  3 19:45:17 2004
@@ -20,16 +20,18 @@
 }
 
 
-void av7110_ipack_init(struct ipack *p, int size,
+int av7110_ipack_init(struct ipack *p, int size,
 		       void (*func)(u8 *buf, int size, void *priv))
 {
 	if ( !(p->buf = vmalloc(size*sizeof(u8))) ){
 		printk ("Couldn't allocate memory for ipack\n");
+		return -ENOMEM;
 	}
 	p->size = size;
 	p->func = func;
 	p->repack_subids = 0;
 	av7110_ipack_reset(p);
+	return 0;
 }
 
 
@@ -51,16 +53,15 @@
 
 	switch ( p->mpeg ){
 	case 2:		
-		if (p->count < 10) return;
+		if (p->count < 10)
+			return;
 		p->buf[3] = p->cid;
-		
-		p->buf[4] = (u8)(((p->count-6) & 0xFF00) >> 8);
-		p->buf[5] = (u8)((p->count-6) & 0x00FF);
+		p->buf[4] = (u8)(((p->count - 6) & 0xff00) >> 8);
+		p->buf[5] = (u8)((p->count - 6) & 0x00ff);
 		if (p->repack_subids && p->cid == PRIVATE_STREAM1){
-			
 			off = 9+p->buf[8];
 			streamid = p->buf[off];
-			if ((streamid & 0xF8) == 0x80){
+			if ((streamid & 0xf8) == 0x80) {
 				ai.off = 0;
 				ac3_off = ((p->buf[off+2] << 8)| 
 					   p->buf[off+3]);
@@ -70,12 +71,10 @@
 				if ( !f ){
 					nframes = (p->count-off-3-ac3_off)/ 
 						ai.framesize + 1;
-					p->buf[off+2] = (ac3_off >> 8)& 0xFF;
-					p->buf[off+3] = (ac3_off)& 0xFF;
+					p->buf[off + 2] = (ac3_off >> 8) & 0xff;
+					p->buf[off + 3] = (ac3_off) & 0xff;
 					p->buf[off+1] = nframes;
-					
-					ac3_off +=  nframes * ai.framesize - 
-						p->count;
+					ac3_off +=  nframes * ai.framesize - p->count;
 				}
 			}
 		} 
@@ -86,24 +85,24 @@
 		p->buf[8] = 0x00;
 		p->count = 9;
 		if (p->repack_subids && p->cid == PRIVATE_STREAM1 
-		    && (streamid & 0xF8)==0x80 ){
+		    && (streamid & 0xf8) == 0x80) {
 			p->count += 4;
 			p->buf[9] = streamid;
-			p->buf[10] = (ac3_off >> 8)& 0xFF;
-			p->buf[11] = (ac3_off)& 0xFF;
+			p->buf[10] = (ac3_off >> 8) & 0xff;
+			p->buf[11] = (ac3_off) & 0xff;
 			p->buf[12] = 0;
 		}
-
 		break;
+
 	case 1:
-		if (p->count < 8) return;
+		if (p->count < 8)
+			return;
 		p->buf[3] = p->cid;
-		
-		p->buf[4] = (u8)(((p->count-6) & 0xFF00) >> 8);
-		p->buf[5] = (u8)((p->count-6) & 0x00FF);
+		p->buf[4] = (u8)(((p->count - 6) & 0xff00) >> 8);
+		p->buf[5] = (u8)((p->count - 6) & 0x00ff);
 		p->func(p->buf, p->count, p->data);
 	
-		p->buf[6] = 0x0F;
+		p->buf[6] = 0x0f;
 		p->count = 7;
 		break;
 	}
@@ -156,15 +155,19 @@
 		switch ( p->found ){
 		case 0:
 		case 1:
-			if (buf[c] == 0x00) p->found++;
-			else p->found = 0;
+			if (buf[c] == 0x00)
+				p->found++;
+			else
+				p->found = 0;
 			c++;
 			break;
 		case 2:
-			if (buf[c] == 0x01) p->found++;
-			else if (buf[c] == 0) {
+			if (buf[c] == 0x01)
+				p->found++;
+			else if (buf[c] == 0)
 				p->found = 2;
-			} else p->found = 0;
+			else
+				p->found = 0;
 			c++;
 			break;
 		case 3:
@@ -179,6 +182,7 @@
 			case DSM_CC_STREAM  :
 			case ISO13522_STREAM:
 				p->done = 1;
+				/* fall through */
 			case PRIVATE_STREAM1:
 			case VIDEO_STREAM_S ... VIDEO_STREAM_E:
 			case AUDIO_STREAM_S ... AUDIO_STREAM_E:
@@ -217,7 +221,8 @@
 				p->flag1 = buf[c];
 				c++;
 				p->found++;
-				if ( (p->flag1 & 0xC0) == 0x80 ) p->mpeg = 2;
+				if ((p->flag1 & 0xc0) == 0x80)
+					p->mpeg = 2;
 				else {
 					p->hlength = 0;
 					p->which = 0;
@@ -242,16 +247,14 @@
 				p->found++;
 			}
 			break;
-			
-		default:
-
-			break;
 		}
 	}
 
-	if (c == count) return count;
+	if (c == count)
+		return count;
 
-	if (!p->plength) p->plength = MMAX_PLENGTH-6;
+	if (!p->plength)
+		p->plength = MMAX_PLENGTH - 6;
 
 	if ( p->done || ((p->mpeg == 2 && p->found >= 9) || 
 	     (p->mpeg == 1 && p->found >= 7)) ){
@@ -278,7 +281,8 @@
 					c++;
 					p->found++;
 				}
-				if (c == count) return count;
+				if (c == count)
+					return count;
 			}
 
 			if (p->mpeg == 1 && p->which < 2000) {
@@ -289,7 +293,7 @@
 				}
 
 				while (!p->which && c < count && 
-				       p->check == 0xFF){
+				       p->check == 0xff){
 					p->check = buf[c];
 					write_ipack(p, buf+c, 1);
 					c++;
@@ -297,9 +301,10 @@
 					p->hlength++;
 				}
 				
-				if ( c == count) return count;
+				if (c == count)
+					return count;
 				
-				if ( (p->check & 0xC0) == 0x40 && !p->which){
+				if ((p->check & 0xc0) == 0x40 && !p->which) {
 					p->check = buf[c];
 					write_ipack(p, buf+c, 1);
 					c++;
@@ -307,14 +312,16 @@
 					p->hlength++;
 					
 					p->which = 1;
-					if ( c == count) return count;
+					if (c == count)
+						return count;
 					p->check = buf[c];
 					write_ipack(p, buf+c, 1);
 					c++;
 					p->found++;
 					p->hlength++;
 					p->which = 2;
-					if ( c == count) return count;
+					if (c == count)
+						return count;
 				}
 				
 				if (p->which == 1){
@@ -324,45 +331,42 @@
 					p->found++;
 					p->hlength++;
 					p->which = 2;
-					if ( c == count) return count;
+					if (c == count)
+						return count;
 				}
 				
-				if ( (p->check & 0x30) && p->check != 0xFF){
-					p->flag2 = (p->check & 0xF0) << 2;
+				if ((p->check & 0x30) && p->check != 0xff) {
+					p->flag2 = (p->check & 0xf0) << 2;
 					p->pts[0] = p->check;
 					p->which = 3;
 				} 
 			
-				if ( c == count) return count;
+				if (c == count)
+					return count;
 				if (p->which > 2){
-					if ((p->flag2 & PTS_DTS_FLAGS)
-					    == PTS_ONLY){
-						while (c < count && 
-						       p->which < 7){
-							p->pts[p->which-2] =
-								buf[c];
+					if ((p->flag2 & PTS_DTS_FLAGS) == PTS_ONLY) {
+						while (c < count && p->which < 7) {
+							p->pts[p->which - 2] = buf[c];
 							write_ipack(p,buf+c,1);
 							c++;
 							p->found++;
 							p->which++;
 							p->hlength++;
 						}
-						if ( c == count) return count;
-					} else if ((p->flag2 & PTS_DTS_FLAGS) 
-						   == PTS_DTS){
-						while (c < count && 
-						       p->which< 12){
+						if (c == count)
+							return count;
+					} else if ((p->flag2 & PTS_DTS_FLAGS) == PTS_DTS) {
+						while (c < count && p->which < 12) {
 							if (p->which< 7)
-								p->pts[p->which
-								      -2] =
-									buf[c];
+								p->pts[p->which - 2] = buf[c];
 							write_ipack(p,buf+c,1);
 							c++;
 							p->found++;
 							p->which++;
 							p->hlength++;
 						}
-						if ( c == count) return count;
+						if (c == count)
+							return count;
 					}
 					p->which = 2000;
 				}
diff -Nru a/drivers/media/dvb/ttpci/av7110_ipack.h b/drivers/media/dvb/ttpci/av7110_ipack.h
--- a/drivers/media/dvb/ttpci/av7110_ipack.h	Tue Feb  3 19:45:16 2004
+++ b/drivers/media/dvb/ttpci/av7110_ipack.h	Tue Feb  3 19:45:16 2004
@@ -1,7 +1,7 @@
 #ifndef _AV7110_IPACK_H_
 #define _AV7110_IPACK_H_
 
-extern void av7110_ipack_init(struct ipack *p, int size,
+extern int av7110_ipack_init(struct ipack *p, int size,
 			      void (*func)(u8 *buf,  int size, void *priv));
 
 extern void av7110_ipack_reset(struct ipack *p);
diff -Nru a/drivers/media/dvb/ttpci/av7110_ir.c b/drivers/media/dvb/ttpci/av7110_ir.c
--- a/drivers/media/dvb/ttpci/av7110_ir.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/dvb/ttpci/av7110_ir.c	Tue Feb  3 19:45:17 2004
@@ -7,6 +7,11 @@
 
 #include "av7110.h"
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+#include "input_fake.h"
+#endif
+
+
 #define UP_TIMEOUT (HZ/4)
 
 static int av7110_ir_debug = 0;
@@ -51,7 +56,7 @@
 }
 
 
-static struct timer_list keyup_timer = { function: av7110_emit_keyup };
+static struct timer_list keyup_timer = { .function = av7110_emit_keyup };
 
 
 static void av7110_emit_key (u32 ircom)
@@ -84,8 +89,7 @@
 			return;
 
 	if (!keycode) {
-		printk ("%s: unknown key 0x%02x!!\n",
-			__FUNCTION__, data);
+		printk ("%s: unknown key 0x%02x!!\n", __FUNCTION__, data);
 		return;
 	}
 
@@ -144,9 +148,8 @@
 		return -EINVAL;
 	
 	page = (char *)vmalloc(size);
-	if( NULL == page ) {
+	if (!page)
 		return -ENOMEM;
-	}
 	
 	if (copy_from_user(page, buffer, size)) {
 		vfree(page);
diff -Nru a/drivers/media/dvb/ttpci/av7110_v4l.c b/drivers/media/dvb/ttpci/av7110_v4l.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/dvb/ttpci/av7110_v4l.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,712 @@
+/*
+ * av7110_v4l.c: av7110 video4linux interface for DVB and Siemens DVB-C analog module
+ *
+ * Copyright (C) 1999-2002 Ralph  Metzler
+ *                       & Marcus Metzler for convergence integrated media GmbH
+ *
+ * originally based on code by:
+ * Copyright (C) 1998,1999 Christian Theiss <mistert@rz.fh-augsburg.de>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
+ *
+ * the project's page is at http://www.linuxtv.org/dvb/
+ */
+
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/types.h>
+#include <linux/delay.h>
+#include <linux/fs.h>
+#include <linux/timer.h>
+#include <linux/poll.h>
+#include <linux/byteorder/swabb.h>
+#include <linux/smp_lock.h>
+
+#define DEBUG_VARIABLE av7110_debug
+extern int av7110_debug;
+
+#include "dvb_i2c.h"
+#include "av7110.h"
+#include "av7110_hw.h"
+#include "av7110_av.h"
+#include "dvb_functions.h"
+
+
+int msp_writereg(struct av7110 *av7110, u8 dev, u16 reg, u16 val)
+{
+	u8 msg[5] = { dev, reg >> 8, reg & 0xff, val >> 8 , val & 0xff };
+	struct dvb_i2c_bus *i2c = av7110->i2c_bus;
+	struct i2c_msg msgs = { .flags = 0, .addr = 0x40, .len = 5, .buf = msg };
+
+	if (i2c->xfer(i2c, &msgs, 1) != 1) {
+		printk("av7110(%d): %s(%u = %u) failed\n",
+		       av7110->dvb_adapter->num, __FUNCTION__, reg, val);
+		return -EIO;
+	}
+	return 0;
+}
+
+int msp_readreg(struct av7110 *av7110, u8 dev, u16 reg, u16 *val)
+{
+	u8 msg1[3] = { dev, reg >> 8, reg & 0xff };
+	u8 msg2[2];
+	struct dvb_i2c_bus *i2c = av7110->i2c_bus;
+	struct i2c_msg msgs[2] = {
+		{ .flags = 0,	     .addr = 0x40, .len = 3, .buf = msg1 },
+		{ .flags = I2C_M_RD, .addr = 0x40, .len = 2, .buf = msg2 }
+	};
+
+	if (i2c->xfer(i2c, msgs, 2) != 2) {
+		printk("av7110(%d): %s(%u) failed\n",
+		       av7110->dvb_adapter->num, __FUNCTION__, reg);
+		return -EIO;
+	}
+	*val = (msg2[0] << 8) | msg2[1];
+	return 0;
+}
+
+
+
+static struct v4l2_input inputs[2] = {
+	{
+		.index		= 0,
+		.name		= "DVB",
+		.type		= V4L2_INPUT_TYPE_CAMERA,
+		.audioset	= 1,
+		.tuner		= 0, /* ignored */
+		.std		= V4L2_STD_PAL_BG|V4L2_STD_NTSC_M,
+		.status		= 0,
+	}, {
+		.index		= 1,
+		.name		= "Television",
+		.type		= V4L2_INPUT_TYPE_TUNER,
+		.audioset	= 2,
+		.tuner		= 0,
+		.std		= V4L2_STD_PAL_BG|V4L2_STD_NTSC_M,
+		.status		= 0,
+	}
+};
+
+/* for Siemens DVB-C analog module: (taken from ves1820.c) */
+static int ves1820_writereg(struct saa7146_dev *dev, u8 reg, u8 data)
+{
+	u8 addr = 0x09;
+	u8 buf[] = { 0x00, reg, data };
+	struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = buf, .len = 3 };
+
+	DEB_EE(("av7710: dev: %p\n", dev));
+
+	if (1 != saa7146_i2c_transfer(dev, &msg, 1, 1))
+		return -1;
+	return 0;
+}
+
+static int tuner_write(struct saa7146_dev *dev, u8 addr, u8 data [4])
+{
+	struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = data, .len = 4 };
+
+	DEB_EE(("av7710: dev: %p\n", dev));
+
+	if (1 != saa7146_i2c_transfer(dev, &msg, 1, 1))
+		return -1;
+	return 0;
+}
+
+
+/**
+ *   set up the downconverter frequency divisor for a
+ *   reference clock comparision frequency of 62.5 kHz.
+ */
+static int tuner_set_tv_freq(struct saa7146_dev *dev, u32 freq)
+{
+	u32 div;
+	u8 config;
+	u8 buf[4];
+
+	DEB_EE(("av7710: freq: 0x%08x\n", freq));
+
+	/* magic number: 614. tuning with the frequency given by v4l2
+	   is always off by 614*62.5 = 38375 kHz...*/
+	div = freq + 614;
+
+	buf[0] = (div >> 8) & 0x7f;
+	buf[1] = div & 0xff;
+	buf[2] = 0x8e;
+
+	if (freq < (u32) (16 * 168.25))
+		config = 0xa0;
+	else if (freq < (u32) (16 * 447.25))
+		config = 0x90;
+	else
+		config = 0x30;
+	config &= ~0x02;
+
+	buf[3] = config;
+
+	return tuner_write(dev, 0x61, buf);
+}
+
+
+static struct saa7146_standard analog_standard[];
+static struct saa7146_standard dvb_standard[];
+static struct saa7146_standard standard[];
+
+static struct v4l2_audio msp3400_v4l2_audio = {
+	.index = 0,
+	.name = "Television",
+	.capability = V4L2_AUDCAP_STEREO
+};
+
+int av7110_dvb_c_switch(struct saa7146_fh *fh)
+{
+	struct saa7146_dev *dev = fh->dev;
+	struct saa7146_vv *vv = dev->vv_data;
+	struct av7110 *av7110 = (struct av7110*)dev->ext_priv;
+	u16 adswitch;
+	u8 band = 0;
+	int source, sync;
+	struct saa7146_fh *ov_fh = NULL;
+	int restart_overlay = 0;
+
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if (vv->ov_data != NULL) {
+		ov_fh = vv->ov_data->fh;
+		saa7146_stop_preview(ov_fh);
+		restart_overlay = 1;
+	}
+
+	if (0 != av7110->current_input) {
+		adswitch = 1;
+		band = 0x68; /* analog band */
+		source = SAA7146_HPS_SOURCE_PORT_B;
+		sync = SAA7146_HPS_SYNC_PORT_B;
+		memcpy(standard, analog_standard, sizeof(struct saa7146_standard) * 2);
+		DEB_S(("av7110: switching to analog TV\n"));
+		msp_writereg(av7110, MSP_WR_DSP, 0x0008, 0x0000); // loudspeaker source
+		msp_writereg(av7110, MSP_WR_DSP, 0x0009, 0x0000); // headphone source
+		msp_writereg(av7110, MSP_WR_DSP, 0x000a, 0x0000); // SCART 1 source
+		msp_writereg(av7110, MSP_WR_DSP, 0x000e, 0x3000); // FM matrix, mono
+		msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0x4f00); // loudspeaker + headphone
+		msp_writereg(av7110, MSP_WR_DSP, 0x0007, 0x4f00); // SCART 1 volume
+	} else {
+		adswitch = 0;
+		band = 0x28; /* digital band */
+		source = SAA7146_HPS_SOURCE_PORT_A;
+		sync = SAA7146_HPS_SYNC_PORT_A;
+		memcpy(standard, dvb_standard, sizeof(struct saa7146_standard) * 2);
+		DEB_S(("av7110: switching DVB mode\n"));
+		msp_writereg(av7110, MSP_WR_DSP, 0x0008, 0x0220); // loudspeaker source
+		msp_writereg(av7110, MSP_WR_DSP, 0x0009, 0x0220); // headphone source
+		msp_writereg(av7110, MSP_WR_DSP, 0x000a, 0x0220); // SCART 1 source
+		msp_writereg(av7110, MSP_WR_DSP, 0x000e, 0x3000); // FM matrix, mono
+		msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0x7f00); // loudspeaker + headphone
+		msp_writereg(av7110, MSP_WR_DSP, 0x0007, 0x7f00); // SCART 1 volume
+	}
+
+	/* hmm, this does not do anything!? */
+	if (av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, ADSwitch, 1, adswitch))
+		printk("ADSwitch error\n");
+
+	if (ves1820_writereg(dev, 0x0f, band))
+		printk("setting band in demodulator failed.\n");
+	saa7146_set_hps_source_and_sync(dev, source, sync);
+
+	if (restart_overlay)
+		saa7146_start_preview(ov_fh);
+
+	return 0;
+}
+
+int av7110_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
+{
+	struct saa7146_dev *dev = fh->dev;
+	struct av7110 *av7110 = (struct av7110*) dev->ext_priv;
+	DEB_EE(("saa7146_dev: %p\n", dev));
+
+	switch (cmd) {
+	case VIDIOC_G_TUNER:
+	{
+		struct v4l2_tuner *t = arg;
+		u16 stereo_det;
+		s8 stereo;
+
+		DEB_EE(("VIDIOC_G_TUNER: %d\n", t->index));
+
+		if (!av7110->has_analog_tuner || t->index != 0)
+			return -EINVAL;
+
+		memset(t, 0, sizeof(*t));
+		strcpy(t->name, "Television");
+
+		t->type = V4L2_TUNER_ANALOG_TV;
+		t->capability = V4L2_TUNER_CAP_NORM | V4L2_TUNER_CAP_STEREO |
+			V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2 | V4L2_TUNER_CAP_SAP;
+		t->rangelow = 772;	/* 48.25 MHZ / 62.5 kHz = 772, see fi1216mk2-specs, page 2 */
+		t->rangehigh = 13684;	/* 855.25 MHz / 62.5 kHz = 13684 */
+		/* FIXME: add the real signal strength here */
+		t->signal = 0xffff;
+		t->afc = 0;
+
+		// FIXME: standard / stereo detection is still broken
+		msp_readreg(av7110, MSP_RD_DEM, 0x007e, &stereo_det);
+		DEB_S(("VIDIOC_G_TUNER: msp3400 TV standard detection: 0x%04x\n", stereo_det));
+
+		msp_readreg(av7110, MSP_RD_DSP, 0x0018, &stereo_det);
+		DEB_S(("VIDIOC_G_TUNER: msp3400 stereo detection: 0x%04x\n", stereo_det));
+		stereo = (s8)(stereo_det >> 8);
+		if (stereo > 0x10) {
+			/* stereo */
+			t->rxsubchans = V4L2_TUNER_SUB_STEREO | V4L2_TUNER_SUB_MONO;
+			t->audmode = V4L2_TUNER_MODE_STEREO;
+		}
+		else if (stereo < -0x10) {
+			/* bilingual*/
+			t->rxsubchans = V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2;
+			t->audmode = V4L2_TUNER_MODE_LANG1;
+		}
+		else /* mono */
+			t->rxsubchans = V4L2_TUNER_SUB_MONO;
+
+		return 0;
+	}
+	case VIDIOC_S_TUNER:
+	{
+		struct v4l2_tuner *t = arg;
+		u16 fm_matrix, src;
+		DEB_EE(("VIDIOC_S_TUNER: %d\n", t->index));
+
+		if (!av7110->has_analog_tuner || av7110->current_input != 1)
+			return -EINVAL;
+
+		switch (t->audmode) {
+		case V4L2_TUNER_MODE_STEREO:
+			DEB_D(("VIDIOC_S_TUNER: V4L2_TUNER_MODE_STEREO\n"));
+			fm_matrix = 0x3001; // stereo
+			src = 0x0020;
+			break;
+		case V4L2_TUNER_MODE_LANG1:
+			DEB_D(("VIDIOC_S_TUNER: V4L2_TUNER_MODE_LANG1\n"));
+			fm_matrix = 0x3000; // mono
+			src = 0x0000;
+			break;
+		case V4L2_TUNER_MODE_LANG2:
+			DEB_D(("VIDIOC_S_TUNER: V4L2_TUNER_MODE_LANG2\n"));
+			fm_matrix = 0x3000; // mono
+			src = 0x0010;
+			break;
+		default: /* case V4L2_TUNER_MODE_MONO: {*/
+			DEB_D(("VIDIOC_S_TUNER: TDA9840_SET_MONO\n"));
+			fm_matrix = 0x3000; // mono
+			src = 0x0030;
+			break;
+		}
+		msp_writereg(av7110, MSP_WR_DSP, 0x000e, fm_matrix);
+		msp_writereg(av7110, MSP_WR_DSP, 0x0008, src);
+		msp_writereg(av7110, MSP_WR_DSP, 0x0009, src);
+		msp_writereg(av7110, MSP_WR_DSP, 0x000a, src);
+		return 0;
+	}
+	case VIDIOC_G_FREQUENCY:
+	{
+		struct v4l2_frequency *f = arg;
+
+		DEB_EE(("VIDIOC_G_FREQ: freq:0x%08x.\n", f->frequency));
+
+		if (!av7110->has_analog_tuner || av7110->current_input != 1)
+			return -EINVAL;
+
+		memset(f, 0, sizeof(*f));
+		f->type = V4L2_TUNER_ANALOG_TV;
+		f->frequency =	av7110->current_freq;
+		return 0;
+	}
+	case VIDIOC_S_FREQUENCY:
+	{
+		struct v4l2_frequency *f = arg;
+
+		DEB_EE(("VIDIOC_S_FREQUENCY: freq:0x%08x.\n", f->frequency));
+
+		if (!av7110->has_analog_tuner || av7110->current_input != 1)
+			return -EINVAL;
+
+		if (V4L2_TUNER_ANALOG_TV != f->type)
+			return -EINVAL;
+
+		msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0xffe0); // fast mute
+		msp_writereg(av7110, MSP_WR_DSP, 0x0007, 0xffe0);
+
+		/* tune in desired frequency */
+		tuner_set_tv_freq(dev, f->frequency);
+		av7110->current_freq = f->frequency;
+
+		msp_writereg(av7110, MSP_WR_DSP, 0x0015, 0x003f); // start stereo detection
+		msp_writereg(av7110, MSP_WR_DSP, 0x0015, 0x0000);
+		msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0x4f00); // loudspeaker + headphone
+		msp_writereg(av7110, MSP_WR_DSP, 0x0007, 0x4f00); // SCART 1 volume
+		return 0;
+	}
+	case VIDIOC_ENUMINPUT:
+	{
+		struct v4l2_input *i = arg;
+
+		DEB_EE(("VIDIOC_ENUMINPUT: %d\n", i->index));
+
+		if (av7110->has_analog_tuner ) {
+			if (i->index < 0 || i->index >= 2)
+				return -EINVAL;
+		} else {
+			if (i->index != 0)
+				return -EINVAL;
+		}
+
+		memcpy(i, &inputs[i->index], sizeof(struct v4l2_input));
+
+		return 0;
+	}
+	case VIDIOC_G_INPUT:
+	{
+		int *input = (int *)arg;
+		*input = av7110->current_input;
+		DEB_EE(("VIDIOC_G_INPUT: %d\n", *input));
+		return 0;
+	}
+	case VIDIOC_S_INPUT:
+	{
+		int input = *(int *)arg;
+
+		DEB_EE(("VIDIOC_S_INPUT: %d\n", input));
+
+		if (!av7110->has_analog_tuner )
+			return 0;
+
+		if (input < 0 || input >= 2)
+			return -EINVAL;
+
+		/* FIXME: switch inputs here */
+		av7110->current_input = input;
+		return av7110_dvb_c_switch(fh);
+	}
+	case VIDIOC_G_AUDIO:
+	{
+		struct v4l2_audio *a = arg;
+
+		DEB_EE(("VIDIOC_G_AUDIO: %d\n", a->index));
+		if (a->index != 0)
+			return -EINVAL;
+		memcpy(a, &msp3400_v4l2_audio, sizeof(struct v4l2_audio));
+		break;
+	}
+	case VIDIOC_S_AUDIO:
+	{
+		struct v4l2_audio *a = arg;
+		DEB_EE(("VIDIOC_S_AUDIO: %d\n", a->index));
+		break;
+	}
+	default:
+		printk("no such ioctl\n");
+		return -ENOIOCTLCMD;
+	}
+	return 0;
+}
+
+
+/****************************************************************************
+ * INITIALIZATION
+ ****************************************************************************/
+
+struct saa7146_extension_ioctls ioctls[] = {
+	{ VIDIOC_ENUMINPUT,	SAA7146_EXCLUSIVE },
+	{ VIDIOC_G_INPUT,	SAA7146_EXCLUSIVE },
+	{ VIDIOC_S_INPUT,	SAA7146_EXCLUSIVE },
+	{ VIDIOC_G_FREQUENCY,	SAA7146_EXCLUSIVE },
+	{ VIDIOC_S_FREQUENCY,	SAA7146_EXCLUSIVE },
+	{ VIDIOC_G_TUNER,	SAA7146_EXCLUSIVE },
+	{ VIDIOC_S_TUNER,	SAA7146_EXCLUSIVE },
+	{ VIDIOC_G_AUDIO,	SAA7146_EXCLUSIVE },
+	{ VIDIOC_S_AUDIO,	SAA7146_EXCLUSIVE },
+	{ 0, 0 }
+};
+
+static u8 saa7113_init_regs[] = {
+	0x02, 0xd0,
+	0x03, 0x23,
+	0x04, 0x00,
+	0x05, 0x00,
+	0x06, 0xe9,
+	0x07, 0x0d,
+	0x08, 0x98,
+	0x09, 0x02,
+	0x0a, 0x80,
+	0x0b, 0x40,
+	0x0c, 0x40,
+	0x0d, 0x00,
+	0x0e, 0x01,
+	0x0f, 0x7c,
+	0x10, 0x48,
+	0x11, 0x0c,
+	0x12, 0x8b,
+	0x13, 0x1a,
+	0x14, 0x00,
+	0x15, 0x00,
+	0x16, 0x00,
+	0x17, 0x00,
+	0x18, 0x00,
+	0x19, 0x00,
+	0x1a, 0x00,
+	0x1b, 0x00,
+	0x1c, 0x00,
+	0x1d, 0x00,
+	0x1e, 0x00,
+
+	0x41, 0x77,
+	0x42, 0x77,
+	0x43, 0x77,
+	0x44, 0x77,
+	0x45, 0x77,
+	0x46, 0x77,
+	0x47, 0x77,
+	0x48, 0x77,
+	0x49, 0x77,
+	0x4a, 0x77,
+	0x4b, 0x77,
+	0x4c, 0x77,
+	0x4d, 0x77,
+	0x4e, 0x77,
+	0x4f, 0x77,
+	0x50, 0x77,
+	0x51, 0x77,
+	0x52, 0x77,
+	0x53, 0x77,
+	0x54, 0x77,
+	0x55, 0x77,
+	0x56, 0x77,
+	0x57, 0xff,
+
+	0xff
+};
+
+
+static struct saa7146_ext_vv av7110_vv_data_st;
+static struct saa7146_ext_vv av7110_vv_data_c;
+
+int av7110_init_analog_module(struct av7110 *av7110)
+{
+	u16 version1, version2;
+
+	if (i2c_writereg(av7110, 0x80, 0x0, 0x80) != 1
+	    || i2c_writereg(av7110, 0x80, 0x0, 0) != 1)
+		return -ENODEV;
+
+	printk("av7110(%d): DVB-C analog module detected, initializing MSP3400\n",
+		av7110->dvb_adapter->num);
+	av7110->adac_type = DVB_ADAC_MSP;
+	dvb_delay(100); // the probing above resets the msp...
+	msp_readreg(av7110, MSP_RD_DSP, 0x001e, &version1);
+	msp_readreg(av7110, MSP_RD_DSP, 0x001f, &version2);
+	printk("av7110(%d): MSP3400 version 0x%04x 0x%04x\n",
+		av7110->dvb_adapter->num, version1, version2);
+	msp_writereg(av7110, MSP_WR_DSP, 0x0013, 0x0c00);
+	msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0x7f00); // loudspeaker + headphone
+	msp_writereg(av7110, MSP_WR_DSP, 0x0008, 0x0220); // loudspeaker source
+	msp_writereg(av7110, MSP_WR_DSP, 0x0009, 0x0220); // headphone source
+	msp_writereg(av7110, MSP_WR_DSP, 0x0004, 0x7f00); // loudspeaker volume
+	msp_writereg(av7110, MSP_WR_DSP, 0x000a, 0x0220); // SCART 1 source
+	msp_writereg(av7110, MSP_WR_DSP, 0x0007, 0x7f00); // SCART 1 volume
+	msp_writereg(av7110, MSP_WR_DSP, 0x000d, 0x4800); // prescale SCART
+
+	if (i2c_writereg(av7110, 0x48, 0x01, 0x00)!=1) {
+		INFO(("saa7113 not accessible.\n"));
+	} else {
+		u8 *i = saa7113_init_regs;
+		av7110->has_analog_tuner = 1;
+		/* init the saa7113 */
+		while (*i != 0xff) {
+			if (i2c_writereg(av7110, 0x48, i[0], i[1]) != 1) {
+				printk("av7110(%d): saa7113 initialization failed",
+						av7110->dvb_adapter->num);
+				break;
+			}
+			i += 2;
+		}
+		/* setup msp for analog sound: B/G Dual-FM */
+		msp_writereg(av7110, MSP_WR_DEM, 0x00bb, 0x02d0); // AD_CV
+		msp_writereg(av7110, MSP_WR_DEM, 0x0001,  3); // FIR1
+		msp_writereg(av7110, MSP_WR_DEM, 0x0001, 18); // FIR1
+		msp_writereg(av7110, MSP_WR_DEM, 0x0001, 27); // FIR1
+		msp_writereg(av7110, MSP_WR_DEM, 0x0001, 48); // FIR1
+		msp_writereg(av7110, MSP_WR_DEM, 0x0001, 66); // FIR1
+		msp_writereg(av7110, MSP_WR_DEM, 0x0001, 72); // FIR1
+		msp_writereg(av7110, MSP_WR_DEM, 0x0005,  4); // FIR2
+		msp_writereg(av7110, MSP_WR_DEM, 0x0005, 64); // FIR2
+		msp_writereg(av7110, MSP_WR_DEM, 0x0005,  0); // FIR2
+		msp_writereg(av7110, MSP_WR_DEM, 0x0005,  3); // FIR2
+		msp_writereg(av7110, MSP_WR_DEM, 0x0005, 18); // FIR2
+		msp_writereg(av7110, MSP_WR_DEM, 0x0005, 27); // FIR2
+		msp_writereg(av7110, MSP_WR_DEM, 0x0005, 48); // FIR2
+		msp_writereg(av7110, MSP_WR_DEM, 0x0005, 66); // FIR2
+		msp_writereg(av7110, MSP_WR_DEM, 0x0005, 72); // FIR2
+		msp_writereg(av7110, MSP_WR_DEM, 0x0083, 0xa000); // MODE_REG
+		msp_writereg(av7110, MSP_WR_DEM, 0x0093, 0x00aa); // DCO1_LO 5.74MHz
+		msp_writereg(av7110, MSP_WR_DEM, 0x009b, 0x04fc); // DCO1_HI
+		msp_writereg(av7110, MSP_WR_DEM, 0x00a3, 0x038e); // DCO2_LO 5.5MHz
+		msp_writereg(av7110, MSP_WR_DEM, 0x00ab, 0x04c6); // DCO2_HI
+		msp_writereg(av7110, MSP_WR_DEM, 0x0056, 0); // LOAD_REG 1/2
+	}
+
+	memcpy(standard, dvb_standard, sizeof(struct saa7146_standard) * 2);
+	/* set dd1 stream a & b */
+	saa7146_write(av7110->dev, DD1_STREAM_B, 0x00000000);
+	saa7146_write(av7110->dev, DD1_INIT, 0x03000700);
+	saa7146_write(av7110->dev, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26));
+
+	return 0;
+}
+
+int av7110_init_v4l(struct av7110 *av7110)
+{
+	struct saa7146_dev* dev = av7110->dev;
+	int ret;
+
+	/* special case DVB-C: these cards have an analog tuner
+	   plus need some special handling, so we have separate
+	   saa7146_ext_vv data for these... */
+	if (av7110->has_analog_tuner)
+		ret = saa7146_vv_init(dev, &av7110_vv_data_c);
+	else
+		ret = saa7146_vv_init(dev, &av7110_vv_data_st);
+
+	if (ret) {
+		ERR(("cannot init capture device. skipping.\n"));
+		return -ENODEV;
+	}
+
+	if (saa7146_register_device(&av7110->v4l_dev, dev, "av7110", VFL_TYPE_GRABBER)) {
+		ERR(("cannot register capture device. skipping.\n"));
+		saa7146_vv_release(dev);
+		return -ENODEV;
+	}
+	if (av7110->has_analog_tuner) {
+		if (saa7146_register_device(&av7110->vbi_dev, dev, "av7110", VFL_TYPE_VBI)) {
+			ERR(("cannot register vbi v4l2 device. skipping.\n"));
+		} else
+			/* we use this to remember that this dvb-c card can do vbi */
+			av7110->has_analog_tuner = 2;
+	}
+	return 0;
+}
+
+int av7110_exit_v4l(struct av7110 *av7110)
+{
+	saa7146_unregister_device(&av7110->v4l_dev, av7110->dev);
+	if (2 == av7110->has_analog_tuner)
+		saa7146_unregister_device(&av7110->vbi_dev, av7110->dev);
+	return 0;
+}
+
+
+
+/* FIXME: these values are experimental values that look better than the
+   values from the latest "official" driver -- at least for me... (MiHu) */
+static struct saa7146_standard standard[] = {
+	{
+		.name	= "PAL",	.id		= V4L2_STD_PAL_BG,
+		.v_offset	= 0x15,	.v_field	= 288,		.v_calc	= 576,
+		.h_offset	= 0x4a,	.h_pixels	= 708,		.h_calc	= 709,
+		.v_max_out	= 576,	.h_max_out	= 768,
+	}, {
+		.name	= "NTSC",	.id		= V4L2_STD_NTSC,
+		.v_offset	= 0x10,	.v_field	= 244,		.v_calc	= 480,
+		.h_offset	= 0x40,	.h_pixels	= 708,		.h_calc	= 709,
+		.v_max_out	= 480,	.h_max_out	= 640,
+	}
+};
+
+static struct saa7146_standard analog_standard[] = {
+	{
+		.name	= "PAL",	.id		= V4L2_STD_PAL_BG,
+		.v_offset	= 0x18 /* 0 */ ,	.v_field	= 288,		.v_calc	= 576,
+		.h_offset	= 0x08,	.h_pixels	= 708,		.h_calc	= 709,
+		.v_max_out	= 576,	.h_max_out	= 768,
+	}, {
+		.name	= "NTSC",	.id		= V4L2_STD_NTSC,
+		.v_offset	= 0x10,	.v_field	= 244,		.v_calc	= 480,
+		.h_offset	= 0x40,	.h_pixels	= 708,		.h_calc	= 709,
+		.v_max_out	= 480,	.h_max_out	= 640,
+	}
+};
+
+static struct saa7146_standard dvb_standard[] = {
+	{
+		.name	= "PAL",	.id		= V4L2_STD_PAL_BG,
+		.v_offset	= 0x14,	.v_field	= 288,		.v_calc	= 576,
+		.h_offset	= 0x4a,	.h_pixels	= 708,		.h_calc	= 709,
+		.v_max_out	= 576,	.h_max_out	= 768,
+	}, {
+		.name	= "NTSC",	.id		= V4L2_STD_NTSC,
+		.v_offset	= 0x10,	.v_field	= 244,		.v_calc	= 480,
+		.h_offset	= 0x40,	.h_pixels	= 708,		.h_calc	= 709,
+		.v_max_out	= 480,	.h_max_out	= 640,
+	}
+};
+
+static int std_callback(struct saa7146_dev* dev, struct saa7146_standard *std)
+{
+	struct av7110 *av7110 = (struct av7110*) dev->ext_priv;
+
+	if (std->id == V4L2_STD_PAL) {
+		av7110->vidmode = VIDEO_MODE_PAL;
+		av7110_set_vidmode(av7110, av7110->vidmode);
+	}
+	else if (std->id == V4L2_STD_NTSC) {
+		av7110->vidmode = VIDEO_MODE_NTSC;
+		av7110_set_vidmode(av7110, av7110->vidmode);
+	}
+	else
+		return -1;
+
+	return 0;
+}
+
+
+static struct saa7146_ext_vv av7110_vv_data_st = {
+	.inputs		= 1,
+	.audios		= 1,
+	.capabilities	= 0,
+	.flags		= 0,
+
+	.stds		= &standard[0],
+	.num_stds	= sizeof(standard) / sizeof(struct saa7146_standard),
+	.std_callback	= &std_callback,
+
+	.ioctls		= &ioctls[0],
+	.ioctl		= av7110_ioctl,
+};
+
+static struct saa7146_ext_vv av7110_vv_data_c = {
+	.inputs		= 1,
+	.audios		= 1,
+	.capabilities	= V4L2_CAP_TUNER | V4L2_CAP_VBI_CAPTURE,
+	.flags		= SAA7146_USE_PORT_B_FOR_VBI,
+
+	.stds		= &standard[0],
+	.num_stds	= sizeof(standard) / sizeof(struct saa7146_standard),
+	.std_callback	= &std_callback,
+
+	.ioctls		= &ioctls[0],
+	.ioctl		= av7110_ioctl,
+};
+
diff -Nru a/drivers/media/dvb/ttpci/budget-patch.c b/drivers/media/dvb/ttpci/budget-patch.c
--- a/drivers/media/dvb/ttpci/budget-patch.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/dvb/ttpci/budget-patch.c	Tue Feb  3 19:45:17 2004
@@ -32,6 +32,7 @@
 
 #include "budget.h"
 #include "av7110.h"
+#include "av7110_hw.h"
 
 #define budget_patch budget
 
@@ -46,7 +47,7 @@
         }
 };
 
-static int wdebi(struct budget_patch *budget, u32 config, int addr, u32 val, int count)
+static int budget_wdebi(struct budget_patch *budget, u32 config, int addr, u32 val, int count)
 {
         struct saa7146_dev *dev=budget->dev;
 
@@ -66,21 +67,21 @@
 }
 
 
-static int SOutCommand(struct budget_patch *budget, u16* buf, int length)
+static int budget_av7110_send_fw_cmd(struct budget_patch *budget, u16* buf, int length)
 {
         int i;
 
         DEB_EE(("budget: %p\n", budget));
 
         for (i = 2; i < length; i++)
-                wdebi(budget, DEBINOSWAP, COMMAND + 2*i, (u32) buf[i], 2);
+                budget_wdebi(budget, DEBINOSWAP, COMMAND + 2*i, (u32) buf[i], 2);
 
         if (length)
-                wdebi(budget, DEBINOSWAP, COMMAND + 2, (u32) buf[1], 2);
+                budget_wdebi(budget, DEBINOSWAP, COMMAND + 2, (u32) buf[1], 2);
         else
-                wdebi(budget, DEBINOSWAP, COMMAND + 2, 0, 2);
+                budget_wdebi(budget, DEBINOSWAP, COMMAND + 2, 0, 2);
 
-        wdebi(budget, DEBINOSWAP, COMMAND, (u32) buf[0], 2);
+        budget_wdebi(budget, DEBINOSWAP, COMMAND, (u32) buf[0], 2);
         return 0;
 }
 
@@ -90,7 +91,7 @@
         u16 buf[2] = {( COMTYPE_AUDIODAC << 8) | (state ? ON22K : OFF22K), 0};
         
         DEB_EE(("budget: %p\n", budget));
-        SOutCommand(budget, buf, 2);
+        budget_av7110_send_fw_cmd(budget, buf, 2);
 }
 
 
@@ -116,7 +117,7 @@
         for (i=0; i<len; i++)
                 buf[i+4]=msg[i];
 
-        SOutCommand(budget, buf, 18);
+        budget_av7110_send_fw_cmd(budget, buf, 18);
         return 0;
 }
 
diff -Nru a/drivers/media/dvb/ttusb-budget/Kconfig b/drivers/media/dvb/ttusb-budget/Kconfig
--- a/drivers/media/dvb/ttusb-budget/Kconfig	Tue Feb  3 19:45:16 2004
+++ b/drivers/media/dvb/ttusb-budget/Kconfig	Tue Feb  3 19:45:16 2004
@@ -1,6 +1,6 @@
 config DVB_TTUSB_BUDGET
 	tristate "Technotrend/Hauppauge Nova-USB devices"
-	depends on DVB_CORE
+	depends on DVB_CORE && USB
 	help
 	  Support for external USB adapters designed by Technotrend and
 	  produced by Hauppauge, shipped under the brand name 'Nova-USB'.
diff -Nru a/drivers/media/dvb/ttusb-dec/Kconfig b/drivers/media/dvb/ttusb-dec/Kconfig
--- a/drivers/media/dvb/ttusb-dec/Kconfig	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/dvb/ttusb-dec/Kconfig	Tue Feb  3 19:45:17 2004
@@ -2,6 +2,7 @@
 	tristate "Technotrend/Hauppauge USB DEC devices"
 	depends on DVB_CORE && USB
 	select FW_LOADER
+	select CRC32
 	help
 	  Support for external USB adapters designed by Technotrend and
 	  produced by Hauppauge, shipped under the brand name 'DEC2000-t'
diff -Nru a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
--- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c	Tue Feb  3 19:45:42 2004
@@ -20,9 +20,9 @@
  */
 
 #include <asm/semaphore.h>
+#include <linux/crc32.h>
 #include <linux/list.h>
 #include <linux/module.h>
-#include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
@@ -30,6 +30,7 @@
 #include <linux/version.h>
 #include <linux/interrupt.h>
 #include <linux/firmware.h>
+#include <linux/init.h>
 
 #include "dmxdev.h"
 #include "dvb_demux.h"
@@ -39,6 +40,7 @@
 #include "dvb_net.h"
 
 static int debug = 0;
+static int output_pva = 0;
 
 #define dprintk	if (debug) printk
 
@@ -46,34 +48,44 @@
 
 #define COMMAND_PIPE		0x03
 #define RESULT_PIPE		0x84
-#define STREAM_PIPE		0x88
+#define IN_PIPE			0x88
+#define OUT_PIPE		0x07
 
 #define COMMAND_PACKET_SIZE	0x3c
 #define ARM_PACKET_SIZE		0x1000
 
 #define ISO_BUF_COUNT		0x04
 #define FRAMES_PER_ISO_BUF	0x04
-#define ISO_FRAME_SIZE		0x0380
+#define ISO_FRAME_SIZE		0x03FF
 
-#define	MAX_AV_PES_LENGTH	6144
+#define	MAX_PVA_LENGTH		6144
 
 #define LOF_HI			10600000
 #define LOF_LO			9750000
 
 enum ttusb_dec_model {
 	TTUSB_DEC2000T,
+	TTUSB_DEC2540T,
 	TTUSB_DEC3000S
 };
 
 enum ttusb_dec_packet_type {
-	PACKET_AV_PES,
-	PACKET_SECTION
+	TTUSB_DEC_PACKET_PVA,
+	TTUSB_DEC_PACKET_SECTION,
+	TTUSB_DEC_PACKET_EMPTY
+};
+
+enum ttusb_dec_interface {
+	TTUSB_DEC_INTERFACE_INITIAL,
+	TTUSB_DEC_INTERFACE_IN,
+	TTUSB_DEC_INTERFACE_OUT
 };
 
 struct ttusb_dec {
 	enum ttusb_dec_model		model;
 	char				*model_name;
 	char				*firmware_name;
+	int				can_playback;
 
 	/* DVB bits */
 	struct dvb_adapter		*adapter;
@@ -93,8 +105,9 @@
 	u8			trans_count;
 	unsigned int		command_pipe;
 	unsigned int		result_pipe;
-	unsigned int		stream_pipe;
-	int			interface;
+	unsigned int			in_pipe;
+	unsigned int			out_pipe;
+	enum ttusb_dec_interface	interface;
 	struct semaphore	usb_sem;
 
 	void			*iso_buffer;
@@ -103,19 +116,20 @@
 	int			iso_stream_count;
 	struct semaphore	iso_sem;
 
-	u8				packet[MAX_AV_PES_LENGTH + 4];
+	u8				packet[MAX_PVA_LENGTH + 4];
 	enum ttusb_dec_packet_type	packet_type;
 	int				packet_state;
 	int				packet_length;
 	int				packet_payload_length;
+	u16				next_packet_id;
 
-	int				av_pes_stream_count;
+	int				pva_stream_count;
 	int				filter_stream_count;
 
 	struct dvb_filter_pes2ts	a_pes2ts;
 	struct dvb_filter_pes2ts	v_pes2ts;
 
-	u8			v_pes[16 + MAX_AV_PES_LENGTH];
+	u8			v_pes[16 + MAX_PVA_LENGTH];
 	int			v_pes_length;
 	int			v_pes_postbytes;
 
@@ -123,6 +137,8 @@
 	struct tasklet_struct	urb_tasklet;
 	spinlock_t		urb_frame_list_lock;
 
+	struct dvb_demux_filter	*audio_filter;
+	struct dvb_demux_filter	*video_filter;
 	struct list_head	filter_info_list;
 	spinlock_t		filter_info_list_lock;
 
@@ -167,6 +183,22 @@
 		FE_CAN_HIERARCHY_AUTO,
 };
 
+static void ttusb_dec_set_model(struct ttusb_dec *dec,
+				enum ttusb_dec_model model);
+
+static u16 crc16(u16 crc, const u8 *buf, size_t len)
+{
+	u16 tmp;
+
+	while (len--) {
+		crc ^= *buf++;
+		crc ^= (u8)crc >> 4;
+		tmp = (u8)crc;
+		crc ^= (tmp ^ (tmp << 1)) << 4;
+	}
+	return crc;
+}
+
 static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 				  int param_length, const u8 params[],
 				  int *result_length, u8 cmd_result[])
@@ -234,11 +266,57 @@
 	}
 }
 
-static int ttusb_dec_av_pes2ts_cb(void *priv, unsigned char *data)
+static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
+				    unsigned int *model, unsigned int *version)
+{
+	u8 c[COMMAND_PACKET_SIZE];
+	int c_length;
+	int result;
+	unsigned int tmp;
+
+	dprintk("%s\n", __FUNCTION__);
+
+	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
+	if (result)
+		return result;
+
+	if (c_length >= 0x0c) {
+		if (mode != NULL) {
+			memcpy(&tmp, c, 4);
+			*mode = ntohl(tmp);
+		}
+		if (model != NULL) {
+			memcpy(&tmp, &c[4], 4);
+			*model = ntohl(tmp);
+		}
+		if (version != NULL) {
+			memcpy(&tmp, &c[8], 4);
+			*version = ntohl(tmp);
+		}
+		return 0;
+	} else {
+		return -1;
+	}
+}
+
+static int ttusb_dec_audio_pes2ts_cb(void *priv, unsigned char *data)
 {
-	struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)priv;
+	struct ttusb_dec *dec = (struct ttusb_dec *)priv;
 
-	dvbdmxfeed->cb.ts(data, 188, 0, 0, &dvbdmxfeed->feed.ts, DMX_OK);
+	dec->audio_filter->feed->cb.ts(data, 188, 0, 0,
+				       &dec->audio_filter->feed->feed.ts,
+				       DMX_OK);
+
+	return 0;
+}
+
+static int ttusb_dec_video_pes2ts_cb(void *priv, unsigned char *data)
+{
+	struct ttusb_dec *dec = (struct ttusb_dec *)priv;
+
+	dec->video_filter->feed->cb.ts(data, 188, 0, 0,
+				       &dec->video_filter->feed->feed.ts,
+				       DMX_OK);
 
 	return 0;
 }
@@ -262,64 +340,69 @@
 	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
 
 		dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO],
-				       ttusb_dec_av_pes2ts_cb, dec->demux.feed);
+			       ttusb_dec_audio_pes2ts_cb, dec);
 		dvb_filter_pes2ts_init(&dec->v_pes2ts, dec->pid[DMX_PES_VIDEO],
-				       ttusb_dec_av_pes2ts_cb, dec->demux.feed);
+			       ttusb_dec_video_pes2ts_cb, dec);
 	dec->v_pes_length = 0;
 	dec->v_pes_postbytes = 0;
 }
 
-static void ttusb_dec_process_av_pes(struct ttusb_dec * dec, u8 * av_pes,
-				     int length)
+static void ttusb_dec_process_pva(struct ttusb_dec *dec, u8 *pva, int length)
 {
 	if (length < 8) {
 		printk("%s: packet too short - discarding\n", __FUNCTION__);
 		return;
 	}
 
-	if (length > 8 + MAX_AV_PES_LENGTH) {
+	if (length > 8 + MAX_PVA_LENGTH) {
 		printk("%s: packet too long - discarding\n", __FUNCTION__);
 		return;
 	}
 
-	switch (av_pes[2]) {
+	switch (pva[2]) {
 
 	case 0x01: {		/* VideoStream */
-			int prebytes = av_pes[5] & 0x03;
-			int postbytes = (av_pes[5] & 0x0c) >> 2;
+		int prebytes = pva[5] & 0x03;
+		int postbytes = (pva[5] & 0x0c) >> 2;
 			u16 v_pes_payload_length;
 
+		if (output_pva) {
+			dec->video_filter->feed->cb.ts(pva, length, 0, 0,
+				&dec->video_filter->feed->feed.ts, DMX_OK);
+			return;
+		}
+
 			if (dec->v_pes_postbytes > 0 &&
 			    dec->v_pes_postbytes == prebytes) {
 				memcpy(&dec->v_pes[dec->v_pes_length],
-				       &av_pes[12], prebytes);
+			       &pva[12], prebytes);
 
 				dvb_filter_pes2ts(&dec->v_pes2ts, dec->v_pes,
 					  dec->v_pes_length + prebytes, 1);
 			}
 
-			if (av_pes[5] & 0x10) {
+		if (pva[5] & 0x10) {
 				dec->v_pes[7] = 0x80;
 				dec->v_pes[8] = 0x05;
 
-			dec->v_pes[9] = 0x21 | ((av_pes[8] & 0xc0) >> 5);
-				dec->v_pes[10] = ((av_pes[8] & 0x3f) << 2) |
-						 ((av_pes[9] & 0xc0) >> 6);
+			dec->v_pes[9] = 0x21 | ((pva[8] & 0xc0) >> 5);
+			dec->v_pes[10] = ((pva[8] & 0x3f) << 2) |
+					 ((pva[9] & 0xc0) >> 6);
 				dec->v_pes[11] = 0x01 |
-						 ((av_pes[9] & 0x3f) << 2) |
-						 ((av_pes[10] & 0x80) >> 6);
-				dec->v_pes[12] = ((av_pes[10] & 0x7f) << 1) |
-						 ((av_pes[11] & 0xc0) >> 7);
-			dec->v_pes[13] = 0x01 | ((av_pes[11] & 0x7f) << 1);
+					 ((pva[9] & 0x3f) << 2) |
+					 ((pva[10] & 0x80) >> 6);
+			dec->v_pes[12] = ((pva[10] & 0x7f) << 1) |
+					 ((pva[11] & 0xc0) >> 7);
+			dec->v_pes[13] = 0x01 | ((pva[11] & 0x7f) << 1);
 
-				memcpy(&dec->v_pes[14], &av_pes[12 + prebytes],
+			memcpy(&dec->v_pes[14], &pva[12 + prebytes],
 			       length - 12 - prebytes);
 			dec->v_pes_length = 14 + length - 12 - prebytes;
 			} else {
 				dec->v_pes[7] = 0x00;
 				dec->v_pes[8] = 0x00;
 
-			memcpy(&dec->v_pes[9], &av_pes[8], length - 8);
+			memcpy(&dec->v_pes[9], &pva[8], length - 8);
 			dec->v_pes_length = 9 + length - 8;
 			}
 
@@ -344,13 +427,19 @@
 		}
 
 	case 0x02:		/* MainAudioStream */
-		dvb_filter_pes2ts(&dec->a_pes2ts, &av_pes[8], length - 8,
-				  av_pes[5] & 0x10);
+		if (output_pva) {
+			dec->audio_filter->feed->cb.ts(pva, length, 0, 0,
+				&dec->audio_filter->feed->feed.ts, DMX_OK);
+			return;
+		}
+
+		dvb_filter_pes2ts(&dec->a_pes2ts, &pva[8], length - 8,
+				  pva[5] & 0x10);
 		break;
 
 	default:
-		printk("%s: unknown AV_PES type: %02x.\n", __FUNCTION__,
-		       av_pes[2]);
+		printk("%s: unknown PVA type: %02x.\n", __FUNCTION__,
+		       pva[2]);
 		break;
 	}
 }
@@ -385,6 +474,7 @@
 {
 	int i;
 	u16 csum = 0;
+	u16 packet_id;
 
 	if (dec->packet_length % 2) {
 		printk("%s: odd sized packet - discarding\n", __FUNCTION__);
@@ -399,18 +489,34 @@
 		return;
 	}
 
+	packet_id = dec->packet[dec->packet_length - 4] << 8;
+	packet_id += dec->packet[dec->packet_length - 3];
+
+	if ((packet_id != dec->next_packet_id) && dec->next_packet_id) {
+		printk("%s: warning: lost packets between %u and %u\n",
+		       __FUNCTION__, dec->next_packet_id - 1, packet_id);
+	}
+
+	if (packet_id == 0xffff)
+		dec->next_packet_id = 0x8000;
+	else
+		dec->next_packet_id = packet_id + 1;
+
 	switch (dec->packet_type) {
-	case PACKET_AV_PES:
-		if (dec->av_pes_stream_count)
-			ttusb_dec_process_av_pes(dec, dec->packet,
+	case TTUSB_DEC_PACKET_PVA:
+		if (dec->pva_stream_count)
+			ttusb_dec_process_pva(dec, dec->packet,
 						 dec->packet_payload_length);
 		break;
 
-	case PACKET_SECTION:
+	case TTUSB_DEC_PACKET_SECTION:
 		if (dec->filter_stream_count)
 			ttusb_dec_process_filter(dec, dec->packet,
 						 dec->packet_payload_length);
 		break;
+
+	case TTUSB_DEC_PACKET_EMPTY:
+		break;
 	}
 }
 
@@ -446,28 +552,39 @@
 			break;
 
 		case 3:
-			if (*b++ == 0x00) {
+			if (*b == 0x00) {
 				dec->packet_state++;
 				dec->packet_length = 0;
-			} else {
+			} else if (*b != 0xaa) {
 				dec->packet_state = 0;
 			}
 
+			b++;
 			length--;
 			break;
 
 		case 4:
 			dec->packet[dec->packet_length++] = *b++;
 
-			if (dec->packet_length == 3) {
+			if (dec->packet_length == 2) {
 				if (dec->packet[0] == 'A' &&
 				    dec->packet[1] == 'V') {
-					dec->packet_type = PACKET_AV_PES;
+					dec->packet_type =
+						TTUSB_DEC_PACKET_PVA;
 					dec->packet_state++;
 				} else if (dec->packet[0] == 'S') {
-					dec->packet_type = PACKET_SECTION;
+					dec->packet_type =
+						TTUSB_DEC_PACKET_SECTION;
 					dec->packet_state++;
+				} else if (dec->packet[0] == 0x00) {
+					dec->packet_type =
+						TTUSB_DEC_PACKET_EMPTY;
+					dec->packet_payload_length = 2;
+					dec->packet_state = 7;
 			} else {
+					printk("%s: unknown packet type: "
+					       "%02x%02x\n", __FUNCTION__,
+					       dec->packet[0], dec->packet[1]);
 					dec->packet_state = 0;
 				}
 			}
@@ -478,13 +595,14 @@
 		case 5:
 			dec->packet[dec->packet_length++] = *b++;
 
-			if (dec->packet_type == PACKET_AV_PES &&
+			if (dec->packet_type == TTUSB_DEC_PACKET_PVA &&
 			    dec->packet_length == 8) {
 				dec->packet_state++;
 				dec->packet_payload_length = 8 +
 					(dec->packet[6] << 8) +
 					dec->packet[7];
-			} else if (dec->packet_type == PACKET_SECTION &&
+			} else if (dec->packet_type ==
+					TTUSB_DEC_PACKET_SECTION &&
 				   dec->packet_length == 5) {
 				dec->packet_state++;
 				dec->packet_payload_length = 5 +
@@ -521,7 +639,7 @@
 
 			dec->packet[dec->packet_length++] = *b++;
 
-			if (dec->packet_type == PACKET_SECTION &&
+			if (dec->packet_type == TTUSB_DEC_PACKET_SECTION &&
 			    dec->packet_payload_length % 2)
 				tail++;
 
@@ -627,10 +745,9 @@
 		urb->dev = dec->udev;
 		urb->context = dec;
 		urb->complete = ttusb_dec_process_urb;
-		urb->pipe = dec->stream_pipe;
+		urb->pipe = dec->in_pipe;
 		urb->transfer_flags = URB_ISO_ASAP;
 		urb->interval = 1;
-
 		urb->number_of_packets = FRAMES_PER_ISO_BUF;
 		urb->transfer_buffer_length = ISO_FRAME_SIZE *
 					      FRAMES_PER_ISO_BUF;
@@ -668,12 +785,36 @@
  * for a short period, so it's important not to call this function just before
  * trying to talk to it.
  */
-static void ttusb_dec_set_streaming_interface(struct ttusb_dec *dec)
+static int ttusb_dec_set_interface(struct ttusb_dec *dec,
+				   enum ttusb_dec_interface interface)
 {
-	if (!dec->interface) {
-		usb_set_interface(dec->udev, 0, 8);
-		dec->interface = 8;
+	int result = 0;
+	u8 b[] = { 0x05 };
+
+	if (interface != dec->interface) {
+		switch (interface) {
+		case TTUSB_DEC_INTERFACE_INITIAL:
+			result = usb_set_interface(dec->udev, 0, 0);
+			break;
+		case TTUSB_DEC_INTERFACE_IN:
+			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
+							b, NULL, NULL);
+			if (result)
+				return result;
+			result = usb_set_interface(dec->udev, 0, 7);
+			break;
+		case TTUSB_DEC_INTERFACE_OUT:
+			result = usb_set_interface(dec->udev, 0, 1);
+			break;
+		}
+
+		if (result)
+			return result;
+
+		dec->interface = interface;
 	}
+
+	return 0;
 }
 
 static int ttusb_dec_start_iso_xfer(struct ttusb_dec *dec)
@@ -688,6 +829,10 @@
 	if (!dec->iso_stream_count) {
 		ttusb_dec_setup_urbs(dec);
 
+		dec->packet_state = 0;
+		dec->v_pes_postbytes = 0;
+		dec->next_packet_id = 0;
+
 		for (i = 0; i < ISO_BUF_COUNT; i++) {
 			if ((result = usb_submit_urb(dec->iso_urb[i],
 						     GFP_ATOMIC))) {
@@ -703,9 +848,6 @@
 				return result;
 			}
 		}
-
-		dec->packet_state = 0;
-		dec->v_pes_postbytes = 0;
 	}
 
 	dec->iso_stream_count++;
@@ -720,6 +862,7 @@
 	struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
 	struct ttusb_dec *dec = dvbdmx->priv;
 	u8 b0[] = { 0x05 };
+	int result = 0;
 
 	dprintk("%s\n", __FUNCTION__);
 
@@ -742,12 +885,14 @@
 		dprintk("  pes_type: DMX_TS_PES_VIDEO\n");
 		dec->pid[DMX_PES_PCR] = dvbdmxfeed->pid;
 		dec->pid[DMX_PES_VIDEO] = dvbdmxfeed->pid;
+		dec->video_filter = dvbdmxfeed->filter;
 		ttusb_dec_set_pids(dec);
 		break;
 
 	case DMX_TS_PES_AUDIO:
 		dprintk("  pes_type: DMX_TS_PES_AUDIO\n");
 		dec->pid[DMX_PES_AUDIO] = dvbdmxfeed->pid;
+		dec->audio_filter = dvbdmxfeed->filter;
 		ttusb_dec_set_pids(dec);
 		break;
 
@@ -772,12 +917,12 @@
 
 	}
 
-	ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
-
-	dec->av_pes_stream_count++;
-	ttusb_dec_start_iso_xfer(dec);
+	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
+	if (result)
+		return result;
 
-	return 0;
+	dec->pva_stream_count++;
+	return ttusb_dec_start_iso_xfer(dec);
 }
 
 static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
@@ -827,9 +972,7 @@
 			dvbdmxfeed->priv = finfo;
 
 			dec->filter_stream_count++;
-			ttusb_dec_start_iso_xfer(dec);
-
-			return 0;
+			return ttusb_dec_start_iso_xfer(dec);
 		}
 
 		return -EAGAIN;
@@ -872,7 +1015,7 @@
 
 	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
 
-	dec->av_pes_stream_count--;
+	dec->pva_stream_count--;
 
 	ttusb_dec_stop_iso_xfer(dec);
 
@@ -991,7 +1134,8 @@
 
 	dec->command_pipe = usb_sndbulkpipe(dec->udev, COMMAND_PIPE);
 	dec->result_pipe = usb_rcvbulkpipe(dec->udev, RESULT_PIPE);
-	dec->stream_pipe = usb_rcvisocpipe(dec->udev, STREAM_PIPE);
+	dec->in_pipe = usb_rcvisocpipe(dec->udev, IN_PIPE);
+	dec->out_pipe = usb_sndisocpipe(dec->udev, OUT_PIPE);
 
 	ttusb_dec_alloc_iso_urbs(dec);
 }
@@ -1001,14 +1145,16 @@
 	int i, j, actual_len, result, size, trans_count;
 	u8 b0[] = { 0x00, 0x00, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
-		    0x00, 0x00 };
+		    0x61, 0x00 };
 	u8 b1[] = { 0x61 };
-	u8 b[ARM_PACKET_SIZE];
+	u8 *b;
+	char idstring[21];
 	u8 *firmware = NULL;
 	size_t firmware_size = 0;
-	u32 firmware_csum = 0;
+	u16 firmware_csum = 0;
+	u16 firmware_csum_ns;
 	u32 firmware_size_nl;
-	u32 firmware_csum_nl;
+	u32 crc32_csum, crc32_check, tmp;
 	const struct firmware *fw_entry = NULL;
 
 	dprintk("%s\n", __FUNCTION__);
@@ -1022,20 +1168,33 @@
 	firmware = fw_entry->data;
 	firmware_size = fw_entry->size;
 
-	switch (dec->model) {
-		case TTUSB_DEC2000T:
-			firmware_csum = 0x1bc86100;
-			break;
-
-		case TTUSB_DEC3000S:
-			firmware_csum = 0x00000000;
-			break;
-	}
+	if (firmware_size < 60) {
+		printk("%s: firmware size too small for DSP code (%u < 60).\n",
+			__FUNCTION__, firmware_size);
+		return -1;
+	}
+
+	/* a 32 bit checksum over the first 56 bytes of the DSP Code is stored
+	   at offset 56 of file, so use it to check if the firmware file is
+	   valid. */
+	crc32_csum = crc32(~0L, firmware, 56) ^ ~0L;
+	memcpy(&tmp, &firmware[56], 4);
+	crc32_check = htonl(tmp);
+	if (crc32_csum != crc32_check) {
+		printk("%s: crc32 check of DSP code failed (calculated "
+		       "0x%08x != 0x%08x in file), file invalid.\n",
+			__FUNCTION__, crc32_csum, crc32_check);
+		return -1;
+	}
+	memcpy(idstring, &firmware[36], 20);
+	idstring[20] = '\0';
+	printk(KERN_INFO "ttusb_dec: found DSP code \"%s\".\n", idstring);
 
 	firmware_size_nl = htonl(firmware_size);
 	memcpy(b0, &firmware_size_nl, 4);
-	firmware_csum_nl = htonl(firmware_csum);
-	memcpy(&b0[6], &firmware_csum_nl, 4);
+	firmware_csum = crc16(~0, firmware, firmware_size) ^ ~0;
+	firmware_csum_ns = htons(firmware_csum);
+	memcpy(&b0[6], &firmware_csum_ns, 2);
 
 	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
 
@@ -1045,6 +1204,10 @@
 	trans_count = 0;
 	j = 0;
 
+	b = kmalloc(ARM_PACKET_SIZE, GFP_KERNEL);
+	if (b == NULL)
+		return -ENOMEM;
+
 	for (i = 0; i < firmware_size; i += COMMAND_PACKET_SIZE) {
 		size = firmware_size - i;
 		if (size > COMMAND_PACKET_SIZE)
@@ -1072,25 +1235,63 @@
 
 	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
 
+	kfree(b);
+
 	return result;
 }
 
 static int ttusb_dec_init_stb(struct ttusb_dec *dec)
 {
-	u8 c[COMMAND_PACKET_SIZE];
-	int c_length;
 	int result;
+	unsigned int mode, model, version;
 
 	dprintk("%s\n", __FUNCTION__);
 
-	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
+	result = ttusb_dec_get_stb_state(dec, &mode, &model, &version);
 
 	if (!result) {
-		if (c_length != 0x0c || (c_length == 0x0c && c[9] != 0x63))
-			return ttusb_dec_boot_dsp(dec);
+		if (!mode) {
+			if (version == 0xABCDEFAB)
+				printk(KERN_INFO "ttusb_dec: no version "
+				       "info in Firmware\n");
+			else
+				printk(KERN_INFO "ttusb_dec: Firmware "
+				       "%x.%02x%c%c\n",
+				       version >> 24, (version >> 16) & 0xff,
+				       (version >> 8) & 0xff, version & 0xff);
+
+			result = ttusb_dec_boot_dsp(dec);
+			if (result)
+				return result;
 		else
+				return 1;
+		} else {
+			/* We can't trust the USB IDs that some firmwares
+			   give the box */
+			switch (model) {
+			case 0x00070008:
+				ttusb_dec_set_model(dec, TTUSB_DEC3000S);
+				break;
+			case 0x00070009:
+				ttusb_dec_set_model(dec, TTUSB_DEC2000T);
+				break;
+			case 0x00070011:
+				ttusb_dec_set_model(dec, TTUSB_DEC2540T);
+				break;
+			default:
+				printk(KERN_ERR "%s: unknown model returned "
+				       "by firmware (%08x) - please report\n",
+				       __FUNCTION__, model);
+				return -1;
+				break;
+			}
+
+			if (version >= 0x01770000)
+				dec->can_playback = 1;
+
 			return 0;
 	}
+	}
 	else
 		return result;
 }
@@ -1101,7 +1302,8 @@
 
 	dprintk("%s\n", __FUNCTION__);
 
-	if ((result = dvb_register_adapter(&dec->adapter, dec->model_name)) < 0) {
+	if ((result = dvb_register_adapter(&dec->adapter,
+					   dec->model_name)) < 0) {
 		printk("%s: dvb_register_adapter failed: error %d\n",
 		       __FUNCTION__, result);
 
@@ -1449,18 +1651,6 @@
 {
 	dec->i2c_bus.adapter = dec->adapter;
 
-	switch (dec->model) {
-		case TTUSB_DEC2000T:
-			dec->frontend_info = &dec2000t_frontend_info;
-			dec->frontend_ioctl = ttusb_dec_2000t_frontend_ioctl;
-			break;
-
-		case TTUSB_DEC3000S:
-			dec->frontend_info = &dec3000s_frontend_info;
-			dec->frontend_ioctl = ttusb_dec_3000s_frontend_ioctl;
-			break;
-	}
-
 	dvb_register_frontend(dec->frontend_ioctl, &dec->i2c_bus, (void *)dec,
 			      dec->frontend_info);
 }
@@ -1509,15 +1699,15 @@
 
 	switch (id->idProduct) {
 		case 0x1006:
-			dec->model = TTUSB_DEC3000S;
-			dec->model_name = "DEC3000-s";
-		dec->firmware_name = "dvb-ttusb-dec-3000s-2.15a.fw";
+		ttusb_dec_set_model(dec, TTUSB_DEC3000S);
 			break;
 
 		case 0x1008:
-			dec->model = TTUSB_DEC2000T;
-			dec->model_name = "DEC2000-t";
-		dec->firmware_name = "dvb-ttusb-dec-2000t-2.15a.fw";
+		ttusb_dec_set_model(dec, TTUSB_DEC2000T);
+		break;
+
+	case 0x1009:
+		ttusb_dec_set_model(dec, TTUSB_DEC2540T);
 			break;
 	}
 
@@ -1536,7 +1726,7 @@
 
 	dec->active = 1;
 
-	ttusb_dec_set_streaming_interface(dec);
+	ttusb_dec_set_interface(dec, TTUSB_DEC_INTERFACE_IN);
 
 	return 0;
 }
@@ -1560,15 +1750,45 @@
 	kfree(dec);
 }
 
+static void ttusb_dec_set_model(struct ttusb_dec *dec,
+				enum ttusb_dec_model model)
+{
+	dec->model = model;
+
+	switch (model) {
+	case TTUSB_DEC2000T:
+		dec->model_name = "DEC2000-t";
+		dec->firmware_name = "dvb-ttusb-dec-2000t.fw";
+		dec->frontend_info = &dec2000t_frontend_info;
+		dec->frontend_ioctl = ttusb_dec_2000t_frontend_ioctl;
+		break;
+
+	case TTUSB_DEC2540T:
+		dec->model_name = "DEC2540-t";
+		dec->firmware_name = "dvb-ttusb-dec-2540t.fw";
+		dec->frontend_info = &dec2000t_frontend_info;
+		dec->frontend_ioctl = ttusb_dec_2000t_frontend_ioctl;
+		break;
+
+	case TTUSB_DEC3000S:
+		dec->model_name = "DEC3000-s";
+		dec->firmware_name = "dvb-ttusb-dec-3000s.fw";
+		dec->frontend_info = &dec3000s_frontend_info;
+		dec->frontend_ioctl = ttusb_dec_3000s_frontend_ioctl;
+		break;
+	}
+}
+
 static struct usb_device_id ttusb_dec_table[] = {
 	{USB_DEVICE(0x0b48, 0x1006)},	/* DEC3000-s */
 	/*{USB_DEVICE(0x0b48, 0x1007)},	   Unconfirmed */
 	{USB_DEVICE(0x0b48, 0x1008)},	/* DEC2000-t */
+	{USB_DEVICE(0x0b48, 0x1009)},	/* DEC2540-t */
 	{}
 };
 
 static struct usb_driver ttusb_dec_driver = {
-      .name		= DRIVER_NAME,
+	.name		= "ttusb-dec",
       .probe		= ttusb_dec_probe,
       .disconnect	= ttusb_dec_disconnect,
       .id_table		= ttusb_dec_table,
@@ -1602,3 +1822,5 @@
 
 MODULE_PARM(debug, "i");
 MODULE_PARM_DESC(debug, "Debug level");
+MODULE_PARM(output_pva, "i");
+MODULE_PARM_DESC(output_pva, "Output PVA from dvr device");
diff -Nru a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
--- a/drivers/media/video/Kconfig	Tue Feb  3 19:45:42 2004
+++ b/drivers/media/video/Kconfig	Tue Feb  3 19:45:42 2004
@@ -9,7 +9,8 @@
 
 config VIDEO_BT848
 	tristate "BT848 Video For Linux"
-	depends on VIDEO_DEV && PCI && I2C_ALGOBIT && SOUND
+	depends on VIDEO_DEV && PCI && I2C && SOUND
+	select I2C_ALGOBIT
 	---help---
 	  Support for BT848 based frame grabber/overlay boards. This includes
 	  the Miro, Hauppauge and STB boards. Please read the material in
@@ -273,6 +274,16 @@
 	  
 	  To compile this driver as a module, choose M here: the
 	  module will be called hexium_gemini.
+
+config VIDEO_CX88
+	tristate "Conexant 2388x (bt878 successor) support"
+	depends on VIDEO_DEV && PCI && I2C_ALGOBIT && EXPERIMENTAL
+	---help---
+	  This is a video4linux driver for Conexant 2388x based
+	  TV cards.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called cx8800
 
 endmenu
 
diff -Nru a/drivers/media/video/Makefile b/drivers/media/video/Makefile
--- a/drivers/media/video/Makefile	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/video/Makefile	Tue Feb  3 19:45:17 2004
@@ -3,7 +3,7 @@
 #
 
 bttv-objs	:=	bttv-driver.o bttv-cards.o bttv-if.o \
-			bttv-risc.o bttv-vbi.o
+			bttv-risc.o bttv-vbi.o bttv-i2c.o bttv-gpio.o
 zoran-objs      :=	zr36120.o zr36120_i2c.o zr36120_mem.o
 zr36067-objs	:=	zoran_procfs.o zoran_device.o \
 			zoran_driver.o zoran_card.o
@@ -11,7 +11,7 @@
 obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o v4l1-compat.o
 
 obj-$(CONFIG_VIDEO_BT848) += bttv.o msp3400.o tvaudio.o \
-	tda7432.o tda9875.o
+	tda7432.o tda9875.o ir-kbd-i2c.o ir-kbd-gpio.o
 obj-$(CONFIG_SOUND_TVMIXER) += tvmixer.o
 
 obj-$(CONFIG_VIDEO_ZR36120) += zoran.o
@@ -35,6 +35,7 @@
 obj-$(CONFIG_VIDEO_CPIA_USB) += cpia_usb.o
 obj-$(CONFIG_VIDEO_MEYE) += meye.o
 obj-$(CONFIG_VIDEO_SAA7134) += saa7134/
+obj-$(CONFIG_VIDEO_CX88) += cx88/
 obj-$(CONFIG_VIDEO_MXB) += saa7111.o tuner.o tda9840.o tea6415c.o tea6420.o mxb.o
 obj-$(CONFIG_VIDEO_HEXIUM_ORION) += hexium_orion.o
 obj-$(CONFIG_VIDEO_HEXIUM_GEMINI) += hexium_gemini.o
diff -Nru a/drivers/media/video/bt848.h b/drivers/media/video/bt848.h
--- a/drivers/media/video/bt848.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/video/bt848.h	Tue Feb  3 19:45:17 2004
@@ -158,6 +158,9 @@
 #define BT848_ADC_C_SLEEP      (1<<1)
 #define BT848_ADC_CRUSH        (1<<0)
 
+#define BT848_WC_UP            0x044
+#define BT848_WC_DOWN          0x078
+
 #define BT848_E_VTC            0x06C
 #define BT848_O_VTC            0x0EC
 #define BT848_VTC_HSFMT        (1<<7)
diff -Nru a/drivers/media/video/bttv-cards.c b/drivers/media/video/bttv-cards.c
--- a/drivers/media/video/bttv-cards.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/media/video/bttv-cards.c	Tue Feb  3 19:45:18 2004
@@ -53,6 +53,8 @@
 static void lt9415_audio(struct bttv *btv, struct video_audio *v, int set);
 static void avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v,
 				    int set);
+static void avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v,
+				      int set);
 static void terratv_audio(struct bttv *btv, struct video_audio *v, int set);
 static void gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set);
 static void winfast2000_audio(struct bttv *btv, struct video_audio *v, int set);
@@ -64,6 +66,7 @@
 static void eagle_muxsel(struct bttv *btv, unsigned int input);
 static void xguard_muxsel(struct bttv *btv, unsigned int input);
 static void ivc120_muxsel(struct bttv *btv, unsigned int input);
+static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
 
 static int terratec_active_radio_upgrade(struct bttv *btv);
 static int tea5757_read(struct bttv *btv);
@@ -77,10 +80,11 @@
 static unsigned int latency = UNSET;
 unsigned int no_overlay=-1;
 
-static unsigned int card[BTTV_MAX]  = { [ 0 ... (BTTV_MAX-1) ] = UNSET};
-static unsigned int pll[BTTV_MAX]   = { [ 0 ... (BTTV_MAX-1) ] = UNSET};
-static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET};
-static unsigned int svhs[BTTV_MAX]  = { [ 0 ... (BTTV_MAX-1) ] = UNSET};
+static unsigned int card[BTTV_MAX]   = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
+static unsigned int pll[BTTV_MAX]    = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
+static unsigned int tuner[BTTV_MAX]  = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
+static unsigned int svhs[BTTV_MAX]   = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
+static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
 #ifdef MODULE
 static unsigned int autoload = 1;
 #else
@@ -108,6 +112,10 @@
 MODULE_PARM_DESC(tuner,"specify installed tuner type");
 MODULE_PARM(autoload,"i");
 MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)");
+
+MODULE_PARM(svhs,"1-" __stringify(BTTV_MAX) "i");
+MODULE_PARM(remote,"1-" __stringify(BTTV_MAX) "i");
+
 MODULE_PARM(gpiomask,"i");
 MODULE_PARM(audioall,"i");
 MODULE_PARM(audiomux,"1-5i");
@@ -155,12 +163,13 @@
 	{ 0x00031002, BTTV_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
 
 	{ 0x6606107d, BTTV_WINFAST2000,   "Leadtek WinFast TV 2000" },
-	{ 0x6607107d, BTTV_WINFAST2000,   "Leadtek WinFast VC 100" },
+	{ 0x6607107d, BTTV_WINFASTVC100,  "Leadtek WinFast VC 100" },
 	{ 0x263610b4, BTTV_STB2,          "STB TV PCI FM, Gateway P/N 6000704" },
 	{ 0x264510b4, BTTV_STB2,          "STB TV PCI FM, Gateway P/N 6000704" },
  	{ 0x402010fc, BTTV_GVBCTV3PCI,    "I-O Data Co. GV-BCTV3/PCI" },
 	{ 0x405010fc, BTTV_GVBCTV4PCI,    "I-O Data Co. GV-BCTV4/PCI" },
 	{ 0x407010fc, BTTV_GVBCTV5PCI,    "I-O Data Co. GV-BCTV5/PCI" },
+ 	{ 0xd01810fc, BTTV_GVBCTV3PCI,    "I-O Data Co. GV-BCTV3/PCI" },
 
 	{ 0x001211bd, BTTV_PINNACLE,      "Pinnacle PCTV" },
 	{ 0x001c11bd, BTTV_PINNACLESAT,   "Pinnacle PCTV Sat" },
@@ -175,16 +184,15 @@
 	{ 0x3002144f, BTTV_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
 	{ 0x3005144f, BTTV_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
 	{ 0x5000144f, BTTV_MAGICTVIEW061, "Askey CPH050" },
-	
+	{ 0x300014ff, BTTV_MAGICTVIEW061, "TView 99 (CPH061)" },
+	{ 0x300214ff, BTTV_PHOEBE_TVMAS,  "Phoebe TV Master (CPH060)" },
+
 	{ 0x00011461, BTTV_AVPHONE98,     "AVerMedia TVPhone98" },
 	{ 0x00021461, BTTV_AVERMEDIA98,   "AVermedia TVCapture 98" },
 	{ 0x00031461, BTTV_AVPHONE98,     "AVerMedia TVPhone98" },
 	{ 0x00041461, BTTV_AVERMEDIA98,   "AVerMedia TVCapture 98" },
 	{ 0x03001461, BTTV_AVERMEDIA98,   "VDOMATE TV TUNER CARD" },
 
-	{ 0x300014ff, BTTV_MAGICTVIEW061, "TView 99 (CPH061)" },
-	{ 0x300214ff, BTTV_PHOEBE_TVMAS,  "Phoebe TV Master (CPH060)" },
-
 	{ 0x1117153b, BTTV_TERRATVALUE,   "Terratec TValue (Philips PAL B/G)" },
 	{ 0x1118153b, BTTV_TERRATVALUE,   "Terratec TValue (Temic PAL B/G)" },
 	{ 0x1119153b, BTTV_TERRATVALUE,   "Terratec TValue (Philips PAL I)" },
@@ -253,16 +261,27 @@
 	{ 0x18501851, BTTV_CHRONOS_VS2,   "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
 	{ 0x18511851, BTTV_FLYVIDEO98EZ,  "FlyVideo 98EZ (LR51)/ CyberMail AV" },
 	{ 0x18521852, BTTV_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
+	{ 0x41a0a051, BTTV_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
 	{ 0x10b42636, BTTV_HAUPPAUGE878,  "STB ???" },
 	{ 0x217d6606, BTTV_WINFAST2000,   "Leadtek WinFast TV 2000" },
+	{ 0xfff6f6ff, BTTV_WINFAST2000,   "Leadtek WinFast TV 2000" },
 	{ 0x03116000, BTTV_SENSORAY311,   "Sensoray 311" },
 	{ 0x00790e11, BTTV_WINDVR,        "Canopus WinDVR PCI" },
 	{ 0xa0fca1a0, BTTV_ZOLTRIX,       "Face to Face Tvmax" },
-	{ 0x01010071, BTTV_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
+	{ 0x20007063, BTTV_PC_HDTV,       "pcHDTV HD-2000 TV"},
+	{ 0x82b2aa6a, BTTV_SIMUS_GVC1100, "SIMUS GVC1100" },
+
+	{ 0x40111554, BTTV_PV_BT878P_9B,  "Prolink Pixelview PV-BT" },
+	{ 0x17de0a01, BTTV_KWORLD,        "Mecer TV/FM/Video Tuner" },
 
 	// likely broken, vendor id doesn't match the other magic views ...
 	//{ 0xa0fca04f, BTTV_MAGICTVIEW063, "Guillemot Maxi TV Video 3" },
 	
+	// DVB cards (using pci function .1 for mpeg data xfer)
+	{ 0x01010071, BTTV_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
+	{ 0x002611bd, BTTV_TWINHAN_DST,   "Pinnacle PCTV SAT CI" },
+	{ 0x00011822, BTTV_TWINHAN_DST,   "Twinhan VisionPlus DVB-T" },
+	
 	{ 0, -1, NULL }
 };
 
@@ -352,6 +371,7 @@
 	.needs_tvaudio	= 1,
 	.tuner_type	= -1,
 	.audio_hook	= avermedia_tvphone_audio,
+	.has_remote     = 1,
 },{
 	.name		= "MATRIX-Vision MV-Delta",
 	.video_inputs	= 5,
@@ -438,6 +458,7 @@
 	.msp34xx_alt    = 1,
 	.pll		= PLL_28,
 	.tuner_type	= TUNER_PHILIPS_PAL,
+	.audio_hook     = avermedia_tv_stereo_audio,
 },{
 	.name		= "Aimslab Video Highway Xtreme (VHX)",
 	.video_inputs	= 3,
@@ -471,7 +492,13 @@
 	.svhs		= 2,
 	.gpiomask	= 0x01fe00,
 	.muxsel		= { 2, 3, 1, 1},
+#if 0
+	// old
 	.audiomux	= { 0x01c000, 0, 0x018000, 0x014000, 0x002000, 0 },
+#else
+	// 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru>
+	.audiomux       = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
+#endif
 	.needs_tvaudio	= 1,
 	.pll		= PLL_28,
 	.tuner_type	= -1,
@@ -733,6 +760,7 @@
 	.has_radio	= 1,
 	.tuner_type	= 5, // default for now, gpio reads BFFF06 for Pal bg+dk
 	.audio_hook	= winfast2000_audio,
+	.has_remote     = 1,
 },{
 	.name		= "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
 	.video_inputs	= 4,
@@ -988,7 +1016,7 @@
 	/* Claas Langbehn <claas@bigfoot.com>,
 	   Sven Grothklags <sven@upb.de> */
 	.name		= "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
-	.video_inputs	= 3,
+	.video_inputs	= 4,
 	.audio_inputs	= 3,
 	.tuner		= 0,
 	.svhs		= 2,
@@ -997,7 +1025,7 @@
 	.audiomux	= { 0, 0, 0x10, 8, 4 },
 	.needs_tvaudio	= 1,
 	.pll		= PLL_28,
-	.tuner_type	= TUNER_PHILIPS_PAL_I,
+	.tuner_type	= TUNER_PHILIPS_PAL,
 	.has_radio	= 1,
 },{
 	/* Tim Röstermundt <rosterm@uni-muenster.de>
@@ -1248,6 +1276,7 @@
         .needs_tvaudio  = 1,
         .pll            = PLL_28,
         .tuner_type     = 25,
+	.has_remote     = 1,
 	/* GPIO wiring:
 		GPIO0: U4.A0 (hef4052bt)
 		GPIO1: U4.A1
@@ -1283,6 +1312,7 @@
 	.tuner_type	= 5,
 	.audio_hook	= pvbt878p9b_audio, // Note: not all cards have stereo
 	.has_radio	= 1,  // Note: not all cards have radio
+	.has_remote     = 1,
 	/* GPIO wiring:
 		GPIO0: A0 hef4052
 		GPIO1: A1 hef4052
@@ -1751,7 +1781,8 @@
 	.no_tda7432     = 1,
 	.pll            = PLL_28,
 	.tuner_type     = -1,
-	.no_video       = 1,
+	.has_dvb        = 1,
+	.no_gpioirq     = 1,
 },{
 	/* Jorge Boncompte - DTI2 <jorge@dti2.net> */
 	.name           = "ProVideo PV143",
@@ -1850,6 +1881,86 @@
 			    0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
 	.muxsel_hook    = ivc120_muxsel,
 	.pll            = PLL_28,
+},{
+
+	/* ---- card 0x70 ---------------------------------- */
+	.name           = "pcHDTV HD-2000 TV",
+	.video_inputs   = 4,
+	.audio_inputs   = 1,
+	.tuner          = 0,
+	.svhs           = 2,
+	.muxsel         = { 2, 3, 1, 0},
+	.tuner_type     = TUNER_PHILIPS_ATSC,
+},{
+	.name           = "Twinhan DST + clones",
+	.no_msp34xx     = 1,
+	.no_tda9875     = 1,
+	.no_tda7432     = 1,
+	.tuner_type     = TUNER_ABSENT,
+	.no_video       = 1,
+	.has_dvb        = 1,
+},{
+        .name           = "Winfast VC100",
+	.video_inputs   = 3,
+	.audio_inputs   = 0,
+	.svhs           = 1,
+	.tuner          = -1, // no tuner
+	.muxsel         = { 3, 1, 1, 3}, // Vid In, SVid In, Vid over SVid in connector
+        .no_msp34xx     = 1,
+        .no_tda9875     = 1,
+        .no_tda7432     = 1,
+        .tuner_type     = TUNER_ABSENT,
+        .no_video       = 1,
+	.pll            = PLL_28,
+},{
+	.name           = "Teppro TEV-560/InterVision IV-560",
+	.video_inputs   = 3,
+	.audio_inputs   = 1,
+	.tuner          = 0,
+	.svhs           = 2,
+	.gpiomask       = 3,
+	.muxsel         = { 2, 3, 1, 1},
+	.audiomux       = { 1, 1, 1, 1, 0},
+	.needs_tvaudio  = 1,
+	.tuner_type     = TUNER_PHILIPS_PAL,
+	.pll            = PLL_35,
+},{
+
+	/* ---- card 0x74 ---------------------------------- */
+        .name           = "SIMUS GVC1100",
+        .video_inputs   = 4,
+        .audio_inputs   = 0,
+        .tuner          = -1,
+        .svhs           = -1,
+        .tuner_type     = -1,
+        .pll            = PLL_28,
+        .muxsel         = { 2, 2, 2, 2},
+        .gpiomask       = 0x3F,
+	.muxsel_hook    = gvc1100_muxsel,
+},{
+        /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
+        .name           = "NGS NGSTV+",
+        .video_inputs   = 3,
+        .tuner          = 0,
+        .svhs           = 2,
+        .gpiomask       = 0x008007,
+        .muxsel         = {2, 3, 0, 0},
+        .audiomux       = {0, 0, 0, 0, 0x000003, 0},
+        .pll            = PLL_28,
+        .tuner_type     = TUNER_PHILIPS_PAL,
+        .has_remote     = 1,
+},{
+        /* http://linuxmedialabs.com */
+        .name           = "LMLBT4",
+        .video_inputs   = 4, /* IN1,IN2,IN3,IN4 */
+        .audio_inputs   = 0,
+        .tuner          = -1,
+        .svhs           = -1,
+        .muxsel         = { 2, 3, 1, 0 },
+        .no_msp34xx     = 1,
+        .no_tda9875     = 1,
+        .no_tda7432     = 1,
+        .needs_tvaudio  = 0,
 }};
 
 const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
@@ -1868,9 +1979,9 @@
 	unsigned short tmp;
 
 	/* read PCI subsystem ID */
-	pci_read_config_word(btv->dev, PCI_SUBSYSTEM_ID, &tmp);
+	pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
 	btv->cardid = tmp << 16;
-	pci_read_config_word(btv->dev, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
+	pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
 	btv->cardid |= tmp;
 
 	if (0 != btv->cardid && 0xffffffff != btv->cardid) {
@@ -1883,14 +1994,14 @@
 			/* found it */
 			printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
 			       "PCI subsystem ID is %04x:%04x\n",
-			       btv->nr,cards[type].name,cards[type].cardnr,
+			       btv->c.nr,cards[type].name,cards[type].cardnr,
 			       btv->cardid & 0xffff,
 			       (btv->cardid >> 16) & 0xffff);
-			btv->type = cards[type].cardnr;
+			btv->c.type = cards[type].cardnr;
 		} else {
 			/* 404 */
 			printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
-			       btv->nr, btv->cardid & 0xffff,
+			       btv->c.nr, btv->cardid & 0xffff,
 			       (btv->cardid >> 16) & 0xffff);
 			printk(KERN_DEBUG "please mail id, board name and "
 			       "the correct card= insmod option to kraxel@bytesex.org\n");
@@ -1898,13 +2009,13 @@
 	} 
 
 	/* let the user override the autodetected type */
-	if (card[btv->nr] < bttv_num_tvcards)
-		btv->type=card[btv->nr];
+	if (card[btv->c.nr] < bttv_num_tvcards)
+		btv->c.type=card[btv->c.nr];
 	
 	/* print which card config we are using */
-	printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->nr,
-	       bttv_tvcards[btv->type].name, btv->type,
-	       card[btv->nr] < bttv_num_tvcards
+	printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
+	       bttv_tvcards[btv->c.type].name, btv->c.type,
+	       card[btv->c.nr] < bttv_num_tvcards
 	       ? "insmod option" : "autodetected");
 
 	/* overwrite gpio stuff ?? */
@@ -1914,20 +2025,20 @@
 	if (UNSET != audiomux[0]) {
 		gpiobits = 0;
 		for (i = 0; i < 5; i++) {
-			bttv_tvcards[btv->type].audiomux[i] = audiomux[i];
+			bttv_tvcards[btv->c.type].audiomux[i] = audiomux[i];
 			gpiobits |= audiomux[i];
 		}
 	} else {
 		gpiobits = audioall;
 		for (i = 0; i < 5; i++) {
-			bttv_tvcards[btv->type].audiomux[i] = audioall;
+			bttv_tvcards[btv->c.type].audiomux[i] = audioall;
 		}
 	}
-	bttv_tvcards[btv->type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
+	bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
 	printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
-	       btv->nr,bttv_tvcards[btv->type].gpiomask);
+	       btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
 	for (i = 0; i < 5; i++) {
-		printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->type].audiomux[i]);
+		printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].audiomux[i]);
 	}
 	printk("\n");
 }
@@ -1941,7 +2052,7 @@
 {
 	int type = -1;
 	
-	if (0 == strncmp(eeprom_data,"GET.MM20xPCTV",13))
+	if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
 		type = BTTV_MODTEC_205;
 	else if (0 == strncmp(eeprom_data+20,"Picolo",7))
 		type = BTTV_EURESYS_PICOLO;
@@ -1949,22 +2060,22 @@
                 type = BTTV_HAUPPAUGE; /* old bt848 */
 
 	if (-1 != type) {
-		btv->type = type;
+		btv->c.type = type;
 		printk("bttv%d: detected by eeprom: %s [card=%d]\n",
-		       btv->nr, bttv_tvcards[btv->type].name, btv->type);
+		       btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
 	}
 }
 
 static void flyvideo_gpio(struct bttv *btv)
 { 
-	int gpio,outbits,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;
+	int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;
 	int tuner=-1,ttype;
-	
-	outbits = btread(BT848_GPIO_OUT_EN);
-	btwrite(0x00, BT848_GPIO_OUT_EN);
+
+	gpio_inout(0xffffff, 0);
 	udelay(8);  // without this we would see the 0x1800 mask
-	gpio=btread(BT848_GPIO_DATA);
-	btwrite(outbits, BT848_GPIO_OUT_EN);
+	gpio = gpio_read();
+	/* FIXME: must restore OUR_EN ??? */
+
 	// all cards provide GPIO info, some have an additional eeprom
 	// LR50: GPIO coding can be found lower right CP1 .. CP9
 	//       CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
@@ -1989,7 +2100,7 @@
 	case 0xC: tuner=3; // Philips SECAM(+PAL) FQ1216ME or FI1216MF
 		break;
 	default:
-		printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->nr);
+		printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
 	}
 
 	has_remote          =   gpio & 0x800000;
@@ -2005,9 +2116,9 @@
 		tuner=4; // No tuner present 
 
 	printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n", 
-	       btv->nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio); 
+	       btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio); 
 	printk(KERN_INFO "bttv%d: FlyVideo  LR90=%s tda9821/tda9820=%s capture_only=%s\n",
-		btv->nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ", 
+		btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ", 
 		is_capture_only?"yes":"no ");
 
 	if(tuner!= -1) // only set if known tuner autodetected, else let insmod option through
@@ -2031,8 +2142,8 @@
 	int id,msp,gpio;
 	char *info;
 
-	btwrite(0,BT848_GPIO_OUT_EN);
-        gpio = btread(BT848_GPIO_DATA);
+	gpio_inout(0xffffff, 0);
+        gpio = gpio_read();
 	id   = ((gpio>>10) & 63) -1;
 	msp  = bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx");
 	if (id < 32) {
@@ -2051,14 +2162,14 @@
 			btv->has_radio = 0;
 		}
 		if (-1 != msp) {
-			if (btv->type == BTTV_MIRO)
-				btv->type = BTTV_MIROPRO;
-			if (btv->type == BTTV_PINNACLE)
-				btv->type = BTTV_PINNACLEPRO;
+			if (btv->c.type == BTTV_MIRO)
+				btv->c.type = BTTV_MIROPRO;
+			if (btv->c.type == BTTV_PINNACLE)
+				btv->c.type = BTTV_PINNACLEPRO;
 		}
 		printk(KERN_INFO
 		       "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
-		       btv->nr, id+1, btv->tuner_type,
+		       btv->c.nr, id+1, btv->tuner_type,
 		       !btv->has_radio ? "no" :
 		       (btv->has_matchbox ? "matchbox" : "fmtuner"),
 		       (-1 == msp) ? "no" : "yes");
@@ -2087,15 +2198,18 @@
 		case 6:
 			info = "NTSC / stereo";
 			break;
+		case 7:
+			info = "PAL / stereo";
+			break;
 		default:
 			info = "oops: unknown card";
 			break;
 		}
 		if (-1 != msp)
-			btv->type = BTTV_PINNACLEPRO;
+			btv->c.type = BTTV_PINNACLEPRO;
 		printk(KERN_INFO
 		       "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
-		       btv->nr, id, info, btv->has_radio ? "yes" : "no");
+		       btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
 		btv->tuner_type  = 33;
 		btv->pinnacle_id = id;
 	}
@@ -2106,16 +2220,14 @@
 
 static void init_ids_eagle(struct bttv *btv)
 {
-	btwrite(0xFFFF37, BT848_GPIO_OUT_EN);
-	btwrite(0x000000, BT848_GPIO_REG_INP);
-	
-	btwrite(0x200020, BT848_GPIO_DATA);
+	gpio_inout(0xffffff,0xFFFF37);
+	gpio_write(0x200020);
 	
 	/* flash strobe inverter ?! */
-	btwrite(0x200024, BT848_GPIO_DATA);
+	gpio_write(0x200024);
 	
 	/* switch sync drive off */
-	btor(LM1882_SYNC_DRIVE, BT848_GPIO_DATA);
+	gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
 	
 	/* set BT848 muxel to 2 */
 	btaor((2)<<5, ~(2<<5), BT848_IFORM);
@@ -2127,8 +2239,7 @@
 static void eagle_muxsel(struct bttv *btv, unsigned int input)
 {
 	btaor((2)<<5, ~(3<<5), BT848_IFORM);
-	btaor((bttv_tvcards[btv->type].muxsel[input&7]&3),
-	      ~3, BT848_GPIO_DATA);
+	gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
 
 #if 0
        /* svhs */
@@ -2147,9 +2258,37 @@
 #endif
 
        /* switch sync drive off */
-       btor(LM1882_SYNC_DRIVE, BT848_GPIO_DATA);
+       gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
+}
+
+static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
+{
+        static const int masks[] = {0x30, 0x01, 0x12, 0x23};
+	gpio_write(masks[input%4]);
 }
 
+/* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
+   alarms output
+
+   GPIObit    | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
+   assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1|   |   |
+
+   IN - sensor inputs, INx - sensor inputs and TI XORed together
+   O1,O2,O3 - alarm outputs (relays)
+
+   OUT ENABLE   1    1   0  . 1  1   0   0 . 0   0   0    0   = 0x6C0
+
+*/
+
+static void init_lmlbt4x(struct bttv *btv)
+{
+	printk(KERN_DEBUG "LMLBT4x init\n");
+	btwrite(0x000000, BT848_GPIO_REG_INP);
+	gpio_inout(0xffffff, 0x0006C0);
+	gpio_write(0x000000);
+}
+
+
 /* ----------------------------------------------------------------------- */
 
 void bttv_reset_audio(struct bttv *btv)
@@ -2167,7 +2306,7 @@
 		return;
 	
 	if (bttv_debug)
-		printk("bttv%d: BT878A ARESET\n",btv->nr);
+		printk("bttv%d: BT878A ARESET\n",btv->c.nr);
 	btwrite((1<<7), 0x058);
 	udelay(10);
 	btwrite(     0, 0x058);
@@ -2176,7 +2315,7 @@
 /* initialization part one -- before registering i2c bus */
 void __devinit bttv_init_card1(struct bttv *btv)
 {
-	switch (btv->type) {
+	switch (btv->c.type) {
 	case BTTV_HAUPPAUGE:
 	case BTTV_HAUPPAUGE878:
                 boot_msp34xx(btv,5);
@@ -2198,12 +2337,12 @@
 {
         btv->tuner_type = -1;
 
-	if (BTTV_UNKNOWN == btv->type) {
+	if (BTTV_UNKNOWN == btv->c.type) {
 		bttv_readee(btv,eeprom_data,0xa0);
 		identify_by_eeprom(btv,eeprom_data);
 	}
 
-	switch (btv->type) {
+	switch (btv->c.type) {
 	case BTTV_MIRO:
 	case BTTV_MIROPRO:
 	case BTTV_PINNACLE:
@@ -2255,7 +2394,7 @@
 	case BTTV_MAGICTVIEW061:
 		if (btv->cardid == 0x3002144f) {
 			btv->has_radio=1;
-			printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->nr);
+			printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
 		}
 		break;
        case BTTV_STB2:
@@ -2287,21 +2426,24 @@
 		bttv_readee(btv,eeprom_data,0xa0);
 		modtec_eeprom(btv);
 		break;
+	case BTTV_LMLBT4:
+		init_lmlbt4x(btv);
+		break;
 	}
 
 	/* pll configuration */
         if (!(btv->id==848 && btv->revision==0x11)) {
 		/* defaults from card list */
-		if (PLL_28 == bttv_tvcards[btv->type].pll) {
+		if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
 			btv->pll.pll_ifreq=28636363;
 			btv->pll.pll_crystal=BT848_IFORM_XT0;
 		}
-		if (PLL_35 == bttv_tvcards[btv->type].pll) {
+		if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
 			btv->pll.pll_ifreq=35468950;
 			btv->pll.pll_crystal=BT848_IFORM_XT1;
 		}
 		/* insmod options can override */
-                switch (pll[btv->nr]) {
+                switch (pll[btv->c.nr]) {
                 case 0: /* none */
 			btv->pll.pll_crystal = 0;
 			btv->pll.pll_ifreq   = 0;
@@ -2324,27 +2466,33 @@
 	btv->pll.pll_current = -1;
 
 	/* tuner configuration (from card list / autodetect / insmod option) */
- 	if (UNSET != bttv_tvcards[btv->type].tuner_type)
+ 	if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
 		if(UNSET == btv->tuner_type) 
-                	btv->tuner_type = bttv_tvcards[btv->type].tuner_type;
-	if (UNSET != tuner[btv->nr])
-		btv->tuner_type = tuner[btv->nr];
-	printk("bttv%d: using tuner=%d\n",btv->nr,btv->tuner_type);
+                	btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
+	if (UNSET != tuner[btv->c.nr])
+		btv->tuner_type = tuner[btv->c.nr];
+	printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type);
 	if (btv->pinnacle_id != UNSET)
 		bttv_call_i2c_clients(btv,AUDC_CONFIG_PINNACLE,
 				      &btv->pinnacle_id);
 	if (btv->tuner_type != UNSET)
 		bttv_call_i2c_clients(btv,TUNER_SET_TYPE,&btv->tuner_type);
-	btv->svhs = bttv_tvcards[btv->type].svhs;
-	if (svhs[btv->nr] != UNSET)
-		btv->svhs = svhs[btv->nr];
+	btv->svhs = bttv_tvcards[btv->c.type].svhs;
+	if (svhs[btv->c.nr] != UNSET)
+		btv->svhs = svhs[btv->c.nr];
+	if (remote[btv->c.nr] != UNSET)
+		btv->has_remote = remote[btv->c.nr];
 
-	if (bttv_tvcards[btv->type].has_radio)
+	if (bttv_tvcards[btv->c.type].has_radio)
 		btv->has_radio=1;
-	if (bttv_tvcards[btv->type].audio_hook)
-		btv->audio_hook=bttv_tvcards[btv->type].audio_hook;
+	if (bttv_tvcards[btv->c.type].has_remote)
+		btv->has_remote=1;
+	if (bttv_tvcards[btv->c.type].no_gpioirq)
+		btv->gpioirq=0;
+	if (bttv_tvcards[btv->c.type].audio_hook)
+		btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook;
 
-	if (bttv_tvcards[btv->type].digital_mode == DIGITAL_MODE_CAMERA) {
+	if (bttv_tvcards[btv->c.type].digital_mode == DIGITAL_MODE_CAMERA) {
 		/* detect Bt832 chip for quartzsight digital camera */
 		if ((bttv_I2CRead(btv, I2C_BT832_ALT1, "Bt832") >=0) ||
 		    (bttv_I2CRead(btv, I2C_BT832_ALT2, "Bt832") >=0))
@@ -2352,31 +2500,31 @@
 	}
 
 	/* try to detect audio/fader chips */
-	if (!bttv_tvcards[btv->type].no_msp34xx &&
+	if (!bttv_tvcards[btv->c.type].no_msp34xx &&
 	    bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx") >=0) {
 		if (autoload)
 			request_module("msp3400");
 	}
 
-	if (bttv_tvcards[btv->type].msp34xx_alt &&
+	if (bttv_tvcards[btv->c.type].msp34xx_alt &&
 	    bttv_I2CRead(btv, I2C_MSP3400_ALT, "MSP34xx (alternate address)") >=0) {
 		if (autoload)
 			request_module("msp3400");
 	}
 
-	if (!bttv_tvcards[btv->type].no_tda9875 &&
+	if (!bttv_tvcards[btv->c.type].no_tda9875 &&
 	    bttv_I2CRead(btv, I2C_TDA9875, "TDA9875") >=0) {
 		if (autoload)
 			request_module("tda9875");
 	}
 
-	if (!bttv_tvcards[btv->type].no_tda7432 && 
+	if (!bttv_tvcards[btv->c.type].no_tda7432 && 
 	    bttv_I2CRead(btv, I2C_TDA7432, "TDA7432") >=0) {
 		if (autoload)
 			request_module("tda7432");
 	}
 
-	if (bttv_tvcards[btv->type].needs_tvaudio) {
+	if (bttv_tvcards[btv->c.type].needs_tvaudio) {
 		if (autoload)
 			request_module("tvaudio");
 	}
@@ -2460,11 +2608,15 @@
 {
 	if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
 		btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
-		printk("bttv Modtec: Tuner autodetected %s\n",
-		       &eeprom_data[0x1e]);
+		printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
+		       btv->c.nr,&eeprom_data[0x1e]);
+	} else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
+		btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
+		printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
+                       btv->c.nr,&eeprom_data[0x1e]);
 	} else {
-		printk("bttv Modtec: Unknown TunerString:%s\n",
-		       &eeprom_data[0x1e]);
+		printk("bttv%d: Modtec: Unknown TunerString: %s\n",
+		       btv->c.nr,&eeprom_data[0x1e]);
 	}
 }
 
@@ -2474,7 +2626,7 @@
 
 	if (eeprom_data[0] != 0x84 || eeprom_data[2] != 0)
 		printk(KERN_WARNING "bttv%d: Hauppauge eeprom: invalid\n",
-		       btv->nr);
+		       btv->c.nr);
 
 	/* Block 2 starts after len+3 bytes header */
 	blk2 = eeprom_data[1] + 3;
@@ -2492,7 +2644,7 @@
 	if (bttv_verbose)
 		printk(KERN_INFO "bttv%d: Hauppauge eeprom: model=%d, "
 		       "tuner=%s (%d), radio=%s\n",
-		       btv->nr, model, hauppauge_tuner[tuner].name,
+		       btv->c.nr, model, hauppauge_tuner[tuner].name,
 		       btv->tuner_type, radio ? "yes" : "no");
 }
 
@@ -2516,7 +2668,7 @@
 	tea5757_write(btv, 5 * freq + 0x358); // write 0x1ed8
 	if (0x1ed8 == tea5757_read(btv)) {
 		printk("bttv%d: Terratec Active Radio Upgrade found.\n",
-		       btv->nr);
+		       btv->c.nr);
 		btv->has_radio    = 1;
 		btv->has_matchbox = 1;
 	} else {
@@ -2547,36 +2699,35 @@
 	u32 n;
   	u8 bits;
 	int i;
- 
-	btwrite(BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG,
-		BT848_GPIO_OUT_EN);
-	btwrite(0,BT848_GPIO_DATA);
+
+	gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
+	gpio_write(0);
 	udelay(PVR_GPIO_DELAY);
 	
-	btwrite(BTTV_ALT_NCONFIG,BT848_GPIO_DATA);
+	gpio_write(BTTV_ALT_NCONFIG);
 	udelay(PVR_GPIO_DELAY);
 
 	for (n = 0; n < microlen; n++) {
 		bits = micro[n];
 		for ( i = 0 ; i < 8 ; i++ ) {
-			btand(~BTTV_ALT_DCLK,BT848_GPIO_DATA);
-			if (bits & 0x01) 
-				btor(BTTV_ALT_DATA,BT848_GPIO_DATA);
+			gpio_bits(BTTV_ALT_DCLK,0);
+			if (bits & 0x01)
+				gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
 			else 
-				btand(~BTTV_ALT_DATA,BT848_GPIO_DATA);
-			btor(BTTV_ALT_DCLK,BT848_GPIO_DATA);
+				gpio_bits(BTTV_ALT_DATA,0);
+			gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
 			bits >>= 1;
 		}
 	}
-	btand(~BTTV_ALT_DCLK,BT848_GPIO_DATA);
+	gpio_bits(BTTV_ALT_DCLK,0);
 	udelay(PVR_GPIO_DELAY);
 	
 	/* begin Altera init loop (Not necessary,but doesn't hurt) */
 	for (i = 0 ; i < 30 ; i++) {
-		btand(~BTTV_ALT_DCLK,BT848_GPIO_DATA);
-		btor(BTTV_ALT_DCLK,BT848_GPIO_DATA);
+		gpio_bits(BTTV_ALT_DCLK,0);
+		gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
 	}
-	btand(~BTTV_ALT_DCLK,BT848_GPIO_DATA);
+	gpio_bits(BTTV_ALT_DCLK,0);
 	return 0;
 }
 
@@ -2599,15 +2750,15 @@
 	microlen = mod_firmware_load(firm_altera, (char**) &micro);
 	if (!microlen) {
 		printk(KERN_WARNING "bttv%d: altera firmware not found [%s]\n",
-		       btv->nr, firm_altera);
+		       btv->c.nr, firm_altera);
 		return -1;
 	}
 	
 	printk(KERN_INFO "bttv%d: uploading altera firmware [%s] ...\n",
-	       btv->nr, firm_altera);
+	       btv->c.nr, firm_altera);
 	result = pvr_altera_load(btv, micro, microlen);
 	printk(KERN_INFO "bttv%d: ... upload %s\n",
-	       btv->nr, (result < 0) ? "failed" : "ok");
+	       btv->c.nr, (result < 0) ? "failed" : "ok");
 	vfree(micro);
 	return result;
 }
@@ -2619,15 +2770,15 @@
         const struct firmware *fw_entry;
 	int rc;
 
-	rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->dev->dev);
+	rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
 	if (rc != 0) {
 		printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
-		       btv->nr);
+		       btv->c.nr);
                 return rc;
         }
 	rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
 	printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
-	       btv->nr, (rc < 0) ? "failed" : "ok");
+	       btv->c.nr, (rc < 0) ? "failed" : "ok");
         release_firmware(fw_entry);
 	return rc;
 }	
@@ -2642,7 +2793,7 @@
        unsigned char *ee = eeprom_data;
        unsigned long serial = 0;
     
-       if (btv->type == 0) {
+       if (btv->c.type == 0) {
                /* this might be an antique... check for MMAC label in eeprom */
                if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {
                        unsigned char checksum = 0;
@@ -2650,7 +2801,7 @@
 			       checksum += ee[i];
                        if (checksum != ee[21])
 			       return;
-		       btv->type = BTTV_OSPREY1x0_848;
+		       btv->c.type = BTTV_OSPREY1x0_848;
 		       for (i = 12; i < 21; i++)
 			       serial *= 10, serial += ee[i] - '0';
                }
@@ -2679,49 +2830,49 @@
 
 	       /* 848 based */
 	       case 0x0004:
-		       btv->type = BTTV_OSPREY1x0_848;
+		       btv->c.type = BTTV_OSPREY1x0_848;
 		       break;
 	       case 0x0005:
-		       btv->type = BTTV_OSPREY101_848;
+		       btv->c.type = BTTV_OSPREY101_848;
 		       break;
 		       
                /* 878 based */
 	       case 0x0012:
 	       case 0x0013:
-		       btv->type = BTTV_OSPREY1x0;
+		       btv->c.type = BTTV_OSPREY1x0;
 		       break;
 	       case 0x0014:
 	       case 0x0015:
-		       btv->type = BTTV_OSPREY1x1;
+		       btv->c.type = BTTV_OSPREY1x1;
 		       break;
 	       case 0x0016:
 	       case 0x0017:
 	       case 0x0020:
-		       btv->type = BTTV_OSPREY1x1_SVID;
+		       btv->c.type = BTTV_OSPREY1x1_SVID;
 		       break;
 	       case 0x0018:
 	       case 0x0019:
 	       case 0x001E:
 	       case 0x001F:
-		       btv->type = BTTV_OSPREY2xx;
+		       btv->c.type = BTTV_OSPREY2xx;
 		       break;
 	       case 0x001A:
 	       case 0x001B:
-		       btv->type = BTTV_OSPREY2x0_SVID;
+		       btv->c.type = BTTV_OSPREY2x0_SVID;
 		       break;
 	       case 0x0040:
-		       btv->type = BTTV_OSPREY500;
+		       btv->c.type = BTTV_OSPREY500;
 		       break;
 	       case 0x0050:
 	       case 0x0056:
-		       btv->type = BTTV_OSPREY540;
+		       btv->c.type = BTTV_OSPREY540;
 		       /* bttv_osprey_540_init(btv); */
 		       break;
 	       case 0x0060:
 	       case 0x0070:
-		       btv->type = BTTV_OSPREY2x0;
+		       btv->c.type = BTTV_OSPREY2x0;
 		       //enable output on select control lines
-		       btwrite(0x000303, BT848_GPIO_OUT_EN);
+		       gpio_inout(0xffffff,0x000303);
 		       break;
 	       default:
 		       /* unknown...leave generic, but get serial # */
@@ -2734,7 +2885,7 @@
        }
        
        printk(KERN_INFO "bttv%d: osprey eeprom: card=%d name=%s serial=%ld\n",
-	      btv->nr, btv->type, bttv_tvcards[btv->type].name,serial);
+	      btv->c.nr, btv->c.type, bttv_tvcards[btv->c.type].name,serial);
 }	
 
 /* ----------------------------------------------------------------------- */
@@ -2779,7 +2930,7 @@
 			tuner = tuner_1_table[tuner_format];
 	
 	printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
-		btv->nr,eeprom_data[0x41],eeprom_data[0x42]);
+		btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]);
 	if(tuner) {
 		btv->tuner_type=tuner;
 		printk("%d",tuner);
@@ -2805,8 +2956,8 @@
 		dprintk("bttv_tda9880_setnorm to PAL\n");
 	}
 	// set GPIO according
-	btaor(bttv_tvcards[btv->type].audiomux[btv->audio],
-              ~bttv_tvcards[btv->type].gpiomask, BT848_GPIO_DATA);
+	gpio_bits(bttv_tvcards[btv->c.type].gpiomask,
+		  bttv_tvcards[btv->c.type].audiomux[btv->audio]);
 }
 
 
@@ -2821,23 +2972,23 @@
 {
 	int mask = (1 << pin);
 
-        btaor(mask, ~mask, BT848_GPIO_OUT_EN);
-        btaor(0, ~mask, BT848_GPIO_DATA);
+	gpio_inout(mask,mask);
+	gpio_bits(mask,0);
         udelay(2500);
-        btaor(mask, ~mask, BT848_GPIO_DATA);
+	gpio_bits(mask,mask);
+
 	if (bttv_gpio)
 		bttv_gpio_tracking(btv,"msp34xx");
-
 	if (bttv_verbose)
 		printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
-		       "init [%d]\n", btv->nr, pin);
+		       "init [%d]\n", btv->c.nr, pin);
 }
 
 static void __devinit boot_bt832(struct bttv *btv)
 {
-	int outbits,databits,resetbit=0;
+	int resetbit=0;
 
-	switch (btv->type) {
+	switch (btv->c.type) {
 	case BTTV_PXELVWPLTVPAK:
 		resetbit = 0x400000;
 		break;
@@ -2851,18 +3002,14 @@
 	request_module("bt832");
 	bttv_call_i2c_clients(btv, BT832_HEXDUMP, NULL);
 
-	printk("bttv%d: Reset Bt832 [line=0x%x]\n",btv->nr,resetbit);
-	btwrite(0, BT848_GPIO_DATA);
-	outbits = btread(BT848_GPIO_OUT_EN);
-	databits= btread(BT848_GPIO_DATA);
-	btwrite(resetbit, BT848_GPIO_OUT_EN);
+	printk("bttv%d: Reset Bt832 [line=0x%x]\n",btv->c.nr,resetbit);
+	gpio_write(0);
+	gpio_inout(resetbit, resetbit);
 	udelay(5);
-	btwrite(resetbit, BT848_GPIO_DATA);
+	gpio_bits(resetbit, resetbit);
 	udelay(5);
-	btwrite(0, BT848_GPIO_DATA);
+	gpio_bits(resetbit, 0);
 	udelay(5);
-	btwrite(outbits, BT848_GPIO_OUT_EN);
-	btwrite(databits, BT848_GPIO_DATA);
 
 	// bt832 on pixelview changes from i2c 0x8a to 0x88 after
 	// being reset as above. So we must follow by this:
@@ -2885,13 +3032,13 @@
 	u32 val;
 	
 	/* Initialise GPIO-connevted stuff */
-	btwrite(1<<13,BT848_GPIO_OUT_EN); /* Reset pin only */
-	btwrite(0,BT848_GPIO_DATA);
+	gpio_bits(0xffffff, (1<<13));
+	gpio_write(0);
 	udelay(3);
-	btwrite(1<<13,BT848_GPIO_DATA);
+	gpio_write(1<<13);
 	/* GPIO inputs are pulled up, so no need to drive 
 	 * reset pin any longer */
-	btwrite(0,BT848_GPIO_OUT_EN);
+	gpio_bits(0xffffff, 0);
 	if (bttv_gpio)
 		bttv_gpio_tracking(btv,"pxc200");
 
@@ -2926,10 +3073,10 @@
 	 * device same as above for the reset line, but not the same
 	 * value sent to the GPIO-connected stuff
 	 * which one is the good one? */
-	btwrite( (1<<2), BT848_GPIO_OUT_EN); /* only the reset pin */
-	btwrite(0, BT848_GPIO_DATA);
+	gpio_inout(0xffffff,(1<<2));
+	gpio_write(0);
 	udelay(10);
-	btwrite(1<<2, BT848_GPIO_DATA);
+	gpio_write(1<<2);
 
        	for (i = 0; i < ARRAY_SIZE(vals); i++) {
 		tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
@@ -2956,17 +3103,16 @@
 void bus_low(struct bttv *btv, int bit)
 {
 	if (btv->mbox_ior) {
-		btor(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
-		     BT848_GPIO_DATA);
+		gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
+			  btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
 		udelay(5);
 	}
 
-	btand(~(bit), BT848_GPIO_DATA);
+	gpio_bits(bit,0);
 	udelay(5);
 
 	if (btv->mbox_ior) {
-		btand(~(btv->mbox_iow | btv->mbox_csel),
-		      BT848_GPIO_DATA);
+		gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
 		udelay(5);
 	}
 }
@@ -2974,17 +3120,16 @@
 void bus_high(struct bttv *btv, int bit)
 {
 	if (btv->mbox_ior) {
-		btor(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
-		     BT848_GPIO_DATA);
+		gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
+			  btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
 		udelay(5);
 	}
 
-	btor((bit), BT848_GPIO_DATA);
+	gpio_bits(bit,bit);
 	udelay(5);
 
 	if (btv->mbox_ior) {
-		btand(~(btv->mbox_iow | btv->mbox_csel),
-		      BT848_GPIO_DATA);
+		gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
 		udelay(5);
 	}
 }
@@ -2992,15 +3137,14 @@
 int bus_in(struct bttv *btv, int bit)
 {
 	if (btv->mbox_ior) {
-		btor(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
-		     BT848_GPIO_DATA);
+		gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
+			  btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
 		udelay(5);
 
-		btand(~(btv->mbox_ior | btv->mbox_csel),
-		      BT848_GPIO_DATA);
+		gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
 		udelay(5);
 	}
-	return btread(BT848_GPIO_DATA) & (bit);
+	return gpio_read() & (bit);
 }
 
 /* TEA5757 register bits */
@@ -3038,12 +3182,11 @@
 	int i;
 	
 	/* better safe than sorry */
-	btaor((btv->mbox_clk | btv->mbox_we),
-	      ~btv->mbox_mask, BT848_GPIO_OUT_EN);
+	gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
 
 	if (btv->mbox_ior) {
-		btor(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
-		     BT848_GPIO_DATA);
+		gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
+			  btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
 		udelay(5);
 	}
 
@@ -3060,11 +3203,11 @@
 	while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
 		schedule();
 	if (bus_in(btv,btv->mbox_data)) {
-		printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->nr);
+		printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
 		return -1;
 	}
 
-	dprintk("bttv%d: tea5757:",btv->nr);
+	dprintk("bttv%d: tea5757:",btv->c.nr);
 	for(i = 0; i < 24; i++)
 	{
 		udelay(5);
@@ -3076,7 +3219,7 @@
 		value |= (bus_in(btv,btv->mbox_data) == 0)?0:1;  /* MSB first */
 		dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
 	}
-	dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->nr, value);
+	dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
 	return value;
 }
 
@@ -3085,18 +3228,17 @@
 	int i;
 	int reg = value;
 	
-	btaor(btv->mbox_clk | btv->mbox_we | btv->mbox_data,
-	      ~btv->mbox_mask, BT848_GPIO_OUT_EN);
+	gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
 
 	if (btv->mbox_ior) {
-		btor(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
-		     BT848_GPIO_DATA);
+		gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
+			  btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
 		udelay(5);
 	}
 	if (bttv_gpio)
 		bttv_gpio_tracking(btv,"tea5757 write");
 
-	dprintk("bttv%d: tea5757: write 0x%X\n", btv->nr, value);
+	dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
 	bus_low(btv,btv->mbox_clk);
 	bus_high(btv,btv->mbox_we);
 	for(i = 0; i < 25; i++)
@@ -3122,7 +3264,7 @@
 #if 0
 	/* breaks Miro PCTV */
 	value = tea5757_read(btv);
-	dprintk("bttv%d: tea5757 readback=0x%x\n",btv->nr,value);
+	dprintk("bttv%d: tea5757 readback=0x%x\n",btv->c.nr,value);
 #endif
 }
 
@@ -3148,7 +3290,7 @@
 	/* tens */
 	bits_out |= (PT2254_DBS_IN_10>>(vol/5));
 	bits_out |= PT2254_L_CHANNEL | PT2254_R_CHANNEL;
-	data = btread(BT848_GPIO_DATA);
+	data = gpio_read();
 	data &= ~(WINVIEW_PT2254_CLK| WINVIEW_PT2254_DATA|
 		  WINVIEW_PT2254_STROBE);
 	for (loops = 17; loops >= 0 ; loops--) {
@@ -3156,20 +3298,20 @@
 			data |=  WINVIEW_PT2254_DATA;
 		else
 			data &= ~WINVIEW_PT2254_DATA;
-		btwrite(data, BT848_GPIO_DATA);
+		gpio_write(data);
 		udelay(5);
 		data |= WINVIEW_PT2254_CLK;
-		btwrite(data, BT848_GPIO_DATA);
+		gpio_write(data);
 		udelay(5);
 		data &= ~WINVIEW_PT2254_CLK;
-		btwrite(data, BT848_GPIO_DATA);
+		gpio_write(data);
 	}
 	data |=  WINVIEW_PT2254_STROBE;
 	data &= ~WINVIEW_PT2254_DATA;
-	btwrite(data, BT848_GPIO_DATA);
+	gpio_write(data);
 	udelay(10);                     
 	data &= ~WINVIEW_PT2254_STROBE;
-	btwrite(data, BT848_GPIO_DATA);
+	gpio_write(data);
 }
 
 /* ----------------------------------------------------------------------- */
@@ -3182,7 +3324,7 @@
 	unsigned int con = 0;
 
 	if (set) {
-		btor(0x300, BT848_GPIO_OUT_EN);
+		gpio_inout(0x300, 0x300);
 		if (v->mode & VIDEO_SOUND_LANG1)
 			con = 0x000;
 		if (v->mode & VIDEO_SOUND_LANG2)
@@ -3191,7 +3333,7 @@
 			con = 0x200;
 //		if (v->mode & VIDEO_SOUND_MONO)
 //			con = 0x100;
-		btaor(con, ~0x300, BT848_GPIO_DATA);
+		gpio_bits(0x300, con);
 	} else {
 		v->mode = VIDEO_SOUND_STEREO |
 			  VIDEO_SOUND_LANG1  | VIDEO_SOUND_LANG2;
@@ -3217,12 +3359,12 @@
 	int val = 0;
 
 	if (set) {
-		if (v->mode & VIDEO_SOUND_LANG1)   /* SAP */
+		if (v->mode & VIDEO_SOUND_LANG2)   /* SAP */
 			val = 0x02;
 		if (v->mode & VIDEO_SOUND_STEREO)
 			val = 0x01;
 		if (val) {
-			btaor(val, ~0x03, BT848_GPIO_DATA);
+			gpio_bits(0x03,val);
 			if (bttv_gpio)
 				bttv_gpio_tracking(btv,"avermedia");
 		}
@@ -3233,13 +3375,33 @@
 	}
 }
 
+static void
+avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set)
+{
+	int val = 0;
+	
+	if (set) {
+		if (v->mode & VIDEO_SOUND_LANG2)   /* SAP */
+			val = 0x01;
+		if (v->mode & VIDEO_SOUND_STEREO)  /* STEREO */
+			val = 0x02;
+		btaor(val, ~0x03, BT848_GPIO_DATA);
+		if (bttv_gpio)
+			bttv_gpio_tracking(btv,"avermedia");
+	} else {
+		v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
+			VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
+		return;
+	}
+}
+
 /* Lifetec 9415 handling */
 static void
 lt9415_audio(struct bttv *btv, struct video_audio *v, int set)
 {
         int val = 0;
 
-        if (btread(BT848_GPIO_DATA) & 0x4000) {
+        if (gpio_read() & 0x4000) {
 		v->mode = VIDEO_SOUND_MONO;
 		return;
 	}
@@ -3252,7 +3414,7 @@
                 if ((v->mode & VIDEO_SOUND_LANG1) ||
 		    (v->mode & VIDEO_SOUND_MONO))
 			val = 0;
-                btaor(val, ~0x0880, BT848_GPIO_DATA);
+		gpio_bits(0x0880, val);
                 if (bttv_gpio)
                         bttv_gpio_tracking(btv,"lt9415");
         } else {
@@ -3270,12 +3432,12 @@
 	unsigned int con = 0;
 
 	if (set) {
-		btor(0x180000, BT848_GPIO_OUT_EN);
+		gpio_inout(0x180000,0x180000);
 		if (v->mode & VIDEO_SOUND_LANG2)
 			con = 0x080000;
 		if (v->mode & VIDEO_SOUND_STEREO)
 			con = 0x180000;
-		btaor(con, ~0x180000, BT848_GPIO_DATA);
+		gpio_bits(0x180000, con);
 		if (bttv_gpio)
 			bttv_gpio_tracking(btv,"terratv");
 	} else {
@@ -3300,7 +3462,7 @@
 		if (v->mode & VIDEO_SOUND_STEREO)	/* Stereo */
 			val = 0x020000;
 		if (val) {
-			btaor(val, ~0x430000, BT848_GPIO_DATA);
+			gpio_bits(0x430000, val);
 			if (bttv_gpio)
 				bttv_gpio_tracking(btv,"winfast2000");
 		}
@@ -3340,7 +3502,7 @@
 			val = 0x02;
 		}
 		if (val) {
-			btaor(val, ~0x03, BT848_GPIO_DATA);
+			gpio_bits(0x03,val);
 			if (bttv_gpio)
 				bttv_gpio_tracking(btv,"pvbt878p9b");
 		}
@@ -3376,7 +3538,7 @@
 			val = 0x1080; //-dk-???: 0x0880, 0x0080, 0x1800 ...
 		}
 		if (val != 0xffff) {
-			btaor(val, ~0x1800, BT848_GPIO_DATA);
+			gpio_bits(0x1800, val);
 			if (bttv_gpio)
 				bttv_gpio_tracking(btv,"fv2000s");
 		}
@@ -3405,7 +3567,7 @@
                 if (v->mode & VIDEO_SOUND_STEREO)
                         val = 0;
                 if (val) {
-                        btaor(val, ~0x140000, BT848_GPIO_DATA);
+			gpio_bits(0x140000, val);
                         if (bttv_gpio)
                                 bttv_gpio_tracking(btv,"windvr");
                 }
@@ -3437,7 +3599,7 @@
 		if (v->mode & VIDEO_SOUND_MONO)
 			con = 0x00060000;
 		if (con != 0xffffff) {
-			btaor(con, ~0x1e0000, BT848_GPIO_DATA);
+			gpio_bits(0x1e0000,con);
 			if (bttv_gpio)
 				bttv_gpio_tracking(btv, "adtvk503");
 		}
@@ -3474,16 +3636,16 @@
 static void rv605_muxsel(struct bttv *btv, unsigned int input)
 {
 	/* reset all conections */
-	btaor(0x200,~0x200, BT848_GPIO_DATA);
+	gpio_bits(0x200,0x200);
 	mdelay(1);
-	btaor(0x000,~0x200, BT848_GPIO_DATA);
+	gpio_bits(0x200,0x000);
 	mdelay(1);
 
 	/* create a new conection */
-	btaor(0x080,~0x480, BT848_GPIO_DATA);
-	btaor(0x480,~0x480, BT848_GPIO_DATA);
+	gpio_bits(0x480,0x080);
+	gpio_bits(0x480,0x480);
 	mdelay(1);
-	btaor(0x080,~0x480, BT848_GPIO_DATA);
+	gpio_bits(0x480,0x080);
 	mdelay(1);
 }
 
@@ -3513,7 +3675,7 @@
                 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
                 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
 	};
-        btwrite(masks[input%16], BT848_GPIO_DATA);
+	gpio_write(masks[input%16]);
 }
 
 /*
@@ -3555,7 +3717,7 @@
 	int matrix = input / 4;
 	
 	dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
-		btv->nr, input, matrix, key);
+		btv->c.nr, input, matrix, key);
 	
 	// Handles the input selection on the TDA8540's
 	bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
@@ -3641,12 +3803,12 @@
 
 	if (bttv_verbose) {
 		if (triton1)
-			printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->nr);
+			printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
 		if (vsfx && btv->id >= 878)
-			printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->nr);
+			printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
 		if (UNSET != latency)
 			printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
-			       btv->nr,latency);
+			       btv->c.nr,latency);
 	}
 
 	if (btv->id < 878) {
@@ -3655,15 +3817,15 @@
 			btv->triton1 = BT848_INT_ETBF;
 	} else {
 		/* bt878 has a bit in the pci config space for it */
-                pci_read_config_byte(btv->dev, BT878_DEVCTRL, &command);
+                pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
 		if (triton1)
 			command |= BT878_EN_TBFX;
 		if (vsfx)
 			command |= BT878_EN_VSFX;
-                pci_write_config_byte(btv->dev, BT878_DEVCTRL, command);
+                pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
         }
 	if (UNSET != latency)
-		pci_write_config_byte(btv->dev, PCI_LATENCY_TIMER, latency);
+		pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);
 	return 0;
 }
 
diff -Nru a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c
--- a/drivers/media/video/bttv-driver.c	Tue Feb  3 19:45:35 2004
+++ b/drivers/media/video/bttv-driver.c	Tue Feb  3 19:45:35 2004
@@ -68,11 +68,12 @@
 static unsigned int automute    = 1;
 static unsigned int chroma_agc  = 0;
 static unsigned int adc_crush   = 1;
+static unsigned int whitecrush_upper = 0xCF;
+static unsigned int whitecrush_lower = 0x7F;
 static unsigned int vcr_hack    = 0;
 static unsigned int irq_iswitch = 0;
 
 /* API features (turn on/off stuff for testing) */
-static unsigned int sloppy     = 0;
 static unsigned int v4l2       = 1;
 
 
@@ -108,12 +109,15 @@
 MODULE_PARM_DESC(chroma_agc,"enables the AGC of chroma signal, default is 0 (no)");
 MODULE_PARM(adc_crush,"i");
 MODULE_PARM_DESC(adc_crush,"enables the luminance ADC crush, default is 1 (yes)");
+MODULE_PARM(whitecrush_upper,"i");
+MODULE_PARM_DESC(whitecrush_upper,"sets the white crush upper value, default is 207");
+MODULE_PARM(whitecrush_lower,"i");
+MODULE_PARM_DESC(whitecrush_lower,"sets the white crush lower value, default is 127");
 MODULE_PARM(vcr_hack,"i");
 MODULE_PARM_DESC(vcr_hack,"enables the VCR hack (improves synch on poor VCR tapes), default is 0 (no)");
 MODULE_PARM(irq_iswitch,"i");
 MODULE_PARM_DESC(irq_iswitch,"switch inputs in irq handler");
 
-MODULE_PARM(sloppy,"i");
 MODULE_PARM(v4l2,"i");
 
 MODULE_DESCRIPTION("bttv - v4l/v4l2 driver module for bt848/878 based cards");
@@ -133,7 +137,7 @@
 {
 	struct video_device *vfd = to_video_device(cd);
 	struct bttv *btv = dev_get_drvdata(vfd->dev);
-	return sprintf(buf, "%d\n", btv ? btv->type : UNSET);
+	return sprintf(buf, "%d\n", btv ? btv->c.type : UNSET);
 }
 static CLASS_DEVICE_ATTR(card, S_IRUGO, show_card, NULL);
 
@@ -479,7 +483,9 @@
 #define V4L2_CID_PRIVATE_LUMAFILTER  (V4L2_CID_PRIVATE_BASE + 3)
 #define V4L2_CID_PRIVATE_AGC_CRUSH   (V4L2_CID_PRIVATE_BASE + 4)
 #define V4L2_CID_PRIVATE_VCR_HACK    (V4L2_CID_PRIVATE_BASE + 5)
-#define V4L2_CID_PRIVATE_LASTP1      (V4L2_CID_PRIVATE_BASE + 6)
+#define V4L2_CID_PRIVATE_WHITECRUSH_UPPER   (V4L2_CID_PRIVATE_BASE + 6)
+#define V4L2_CID_PRIVATE_WHITECRUSH_LOWER   (V4L2_CID_PRIVATE_BASE + 7)
+#define V4L2_CID_PRIVATE_LASTP1      (V4L2_CID_PRIVATE_BASE + 8)
 
 static const struct v4l2_queryctrl no_ctl = {
 	.name  = "42",
@@ -597,7 +603,24 @@
 		.minimum       = 0,
 		.maximum       = 1,
 		.type          = V4L2_CTRL_TYPE_BOOLEAN,
+	},{
+		.id            = V4L2_CID_PRIVATE_WHITECRUSH_UPPER,
+		.name          = "whitecrush upper",
+		.minimum       = 0,
+		.maximum       = 255,
+		.step          = 1,
+		.default_value = 0xCF,
+		.type          = V4L2_CTRL_TYPE_INTEGER,
+	},{
+		.id            = V4L2_CID_PRIVATE_WHITECRUSH_LOWER,
+		.name          = "whitecrush lower",
+		.minimum       = 0,
+		.maximum       = 255,
+		.step          = 1,
+		.default_value = 0x7F,
+		.type          = V4L2_CTRL_TYPE_INTEGER,
 	}
+
 };
 const int BTTV_CTLS = ARRAY_SIZE(bttv_ctls);
 
@@ -695,7 +718,7 @@
                 return;
 
 	if (btv->pll.pll_ofreq == btv->pll.pll_current) {
-		dprintk("bttv%d: PLL: no change required\n",btv->nr);
+		dprintk("bttv%d: PLL: no change required\n",btv->c.nr);
                 return;
         }
 
@@ -704,22 +727,22 @@
                 if (btv->pll.pll_current == 0)
                         return;
 		vprintk(KERN_INFO "bttv%d: PLL can sleep, using XTAL (%d).\n",
-			btv->nr,btv->pll.pll_ifreq);
+			btv->c.nr,btv->pll.pll_ifreq);
                 btwrite(0x00,BT848_TGCTRL);
                 btwrite(0x00,BT848_PLL_XCI);
                 btv->pll.pll_current = 0;
                 return;
         }
 
-	vprintk(KERN_INFO "bttv%d: PLL: %d => %d ",btv->nr,
+	vprintk(KERN_INFO "bttv%d: PLL: %d => %d ",btv->c.nr,
 		btv->pll.pll_ifreq, btv->pll.pll_ofreq);
 	set_pll_freq(btv, btv->pll.pll_ifreq, btv->pll.pll_ofreq);
 
         for (i=0; i<10; i++) {
 		/*  Let other people run while the PLL stabilizes */
 		vprintk(".");
-		current->state = TASK_INTERRUPTIBLE;
-		schedule_timeout(HZ/10);
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(HZ/50);
 		
                 if (btread(BT848_DSTATUS) & BT848_DSTATUS_PLOCK) {
 			btwrite(0,BT848_DSTATUS);
@@ -742,9 +765,9 @@
 	int table_idx = bttv_tvnorms[btv->tvnorm].sram;
 	int fsc       = bttv_tvnorms[btv->tvnorm].Fsc;
 
-	if (UNSET == bttv_tvcards[btv->type].muxsel[btv->input]) {
+	if (UNSET == bttv_tvcards[btv->c.type].muxsel[btv->input]) {
 		dprintk("bttv%d: load digital timing table (table_idx=%d)\n",
-			btv->nr,table_idx);
+			btv->c.nr,table_idx);
 
 		/* timing change...reset timing generator address */
        		btwrite(0x00, BT848_TGCTRL);
@@ -828,13 +851,13 @@
 {
 	int mux,mask2;
 
-	if (input >= bttv_tvcards[btv->type].video_inputs)
+	if (input >= bttv_tvcards[btv->c.type].video_inputs)
 		return -EINVAL;
 
         /* needed by RemoteVideo MX */
-	mask2 = bttv_tvcards[btv->type].gpiomask2;
+	mask2 = bttv_tvcards[btv->c.type].gpiomask2;
 	if (mask2)
-		btaor(mask2,~mask2,BT848_GPIO_OUT_EN);
+		gpio_inout(mask2,mask2);
 
 	if (input == btv->svhs)  {
 		btor(BT848_CONTROL_COMP, BT848_E_CONTROL);
@@ -843,14 +866,14 @@
 		btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
 		btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
 	}
-	mux = bttv_tvcards[btv->type].muxsel[input] & 3;
+	mux = bttv_tvcards[btv->c.type].muxsel[input] & 3;
 	btaor(mux<<5, ~(3<<5), BT848_IFORM);
 	dprintk(KERN_DEBUG "bttv%d: video mux: input=%d mux=%d\n",
-		btv->nr,input,mux);
+		btv->c.nr,input,mux);
 
 	/* card specific hook */
-	if(bttv_tvcards[btv->type].muxsel_hook)
-		bttv_tvcards[btv->type].muxsel_hook (btv, input);
+	if(bttv_tvcards[btv->c.type].muxsel_hook)
+		bttv_tvcards[btv->c.type].muxsel_hook (btv, input);
 	return 0;
 }
 
@@ -863,9 +886,9 @@
 audio_mux(struct bttv *btv, int mode)
 {
 	int val,mux,i2c_mux,signal;
-	
-	btaor(bttv_tvcards[btv->type].gpiomask,
-	      ~bttv_tvcards[btv->type].gpiomask,BT848_GPIO_OUT_EN);
+
+	gpio_inout(bttv_tvcards[btv->c.type].gpiomask,
+		   bttv_tvcards[btv->c.type].gpiomask);
 	signal = btread(BT848_DSTATUS) & BT848_DSTATUS_HLOC;
 
 	switch (mode) {
@@ -887,12 +910,12 @@
 		mux = AUDIO_OFF;
 #if 0
 	printk("bttv%d: amux: mode=%d audio=%d signal=%s mux=%d/%d irq=%s\n",
-	       btv->nr, mode, btv->audio, signal ? "yes" : "no",
+	       btv->c.nr, mode, btv->audio, signal ? "yes" : "no",
 	       mux, i2c_mux, in_interrupt() ? "yes" : "no");
 #endif
 
-	val = bttv_tvcards[btv->type].audiomux[mux];
-	btaor(val,~bttv_tvcards[btv->type].gpiomask, BT848_GPIO_DATA);
+	val = bttv_tvcards[btv->c.type].audiomux[mux];
+	gpio_bits(bttv_tvcards[btv->c.type].gpiomask,val);
 	if (bttv_gpio)
 		bttv_gpio_tracking(btv,audio_modes[mux]);
 	if (!in_interrupt())
@@ -909,7 +932,7 @@
 	c.norm    = btv->tvnorm;
 	c.channel = btv->input;
 	bttv_call_i2c_clients(btv,VIDIOCSCHAN,&c);
-	if (btv->type == BTTV_VOODOOTV_FM)
+	if (btv->c.type == BTTV_VOODOOTV_FM)
 		bttv_tda9880_setnorm(btv,c.norm);
 }
 
@@ -932,7 +955,7 @@
 	btwrite(1, BT848_VBI_PACK_DEL);
 	bt848A_set_timing(btv);
 
-	switch (btv->type) {
+	switch (btv->c.type) {
 	case BTTV_VOODOOTV_FM:
 		bttv_tda9880_setnorm(btv,norm);
 		break;
@@ -963,16 +986,43 @@
 	} else {
 		video_mux(btv,input);
 	}
-	audio_mux(btv,(input == bttv_tvcards[btv->type].tuner ?
+	audio_mux(btv,(input == bttv_tvcards[btv->c.type].tuner ?
 		       AUDIO_TUNER : AUDIO_EXTERN));
 	set_tvnorm(btv,btv->tvnorm);
 }
 
+static void init_irqreg(struct bttv *btv)
+{
+	/* clear status */
+	btwrite(0xfffffUL, BT848_INT_STAT);
+
+	if (bttv_tvcards[btv->c.type].no_video) {
+		/* i2c only */
+		btwrite(BT848_INT_I2CDONE,
+			BT848_INT_MASK);
+	} else {
+		/* full video */
+		btwrite((btv->triton1)  |
+			(btv->gpioirq ? BT848_INT_GPINT : 0) |
+			BT848_INT_SCERR |
+			(fdsr ? BT848_INT_FDSR : 0) |
+			BT848_INT_RISCI|BT848_INT_OCERR|BT848_INT_VPRES|
+			BT848_INT_FMTCHG|BT848_INT_HLOCK|
+			BT848_INT_I2CDONE,
+			BT848_INT_MASK);
+	}
+}
+
 static void init_bt848(struct bttv *btv)
 {
 	int val;
 	
-	btwrite(0, BT848_SRESET);
+	if (bttv_tvcards[btv->c.type].no_video) {
+		/* very basic init only */
+		init_irqreg(btv);
+		return;
+	}
+
 	btwrite(0x00, BT848_CAP_CTL);
 	btwrite(BT848_COLOR_CTL_GAMMA, BT848_COLOR_CTL);
 	btwrite(BT848_IFORM_XTAUTO | BT848_IFORM_AUTO, BT848_IFORM);
@@ -995,6 +1045,9 @@
         btwrite(BT848_ADC_RESERVED | (btv->opt_adc_crush ? BT848_ADC_CRUSH : 0),
 		BT848_ADC);
 
+	btwrite(whitecrush_upper, BT848_WC_UP);
+	btwrite(whitecrush_lower, BT848_WC_DOWN);
+
 	if (btv->opt_lumafilter) {
 		btwrite(0, BT848_E_CONTROL);
 		btwrite(0, BT848_O_CONTROL);
@@ -1004,14 +1057,7 @@
 	}
 
         /* interrupt */
-        btwrite(0xfffffUL, BT848_INT_STAT);
-        btwrite((btv->triton1)  |
-                BT848_INT_GPINT |
-                BT848_INT_SCERR |
-                (fdsr ? BT848_INT_FDSR : 0) |
-                BT848_INT_RISCI|BT848_INT_OCERR|BT848_INT_VPRES|
-                BT848_INT_FMTCHG|BT848_INT_HLOCK,
-                BT848_INT_MASK);
+	init_irqreg(btv);
 }
 
 extern void bttv_reinit_bt848(struct bttv *btv)
@@ -1019,7 +1065,7 @@
 	unsigned long flags;
 
 	if (bttv_verbose)
-		printk(KERN_INFO "bttv%d: reset, reinitialize\n",btv->nr);
+		printk(KERN_INFO "bttv%d: reset, reinitialize\n",btv->c.nr);
 	spin_lock_irqsave(&btv->s_lock,flags);
 	btv->errors=0;
 	bttv_set_dma(btv,0,0);
@@ -1094,6 +1140,12 @@
 	case V4L2_CID_PRIVATE_VCR_HACK:
 		c->value = btv->opt_vcr_hack;
 		break;
+	case V4L2_CID_PRIVATE_WHITECRUSH_UPPER:
+		c->value = btv->opt_whitecrush_upper;
+		break;
+	case V4L2_CID_PRIVATE_WHITECRUSH_LOWER:
+		c->value = btv->opt_whitecrush_lower;
+		break;
 	default:
 		return -EINVAL;
 	}
@@ -1182,6 +1234,14 @@
 	case V4L2_CID_PRIVATE_VCR_HACK:
 		btv->opt_vcr_hack = c->value;
 		break;
+	case V4L2_CID_PRIVATE_WHITECRUSH_UPPER:
+		btv->opt_whitecrush_upper = c->value;
+		btwrite(c->value, BT848_WC_UP);
+		break;
+	case V4L2_CID_PRIVATE_WHITECRUSH_LOWER:
+		btv->opt_whitecrush_lower = c->value;
+		btwrite(c->value, BT848_WC_DOWN);
+		break;
 	default:
 		return -EINVAL;
 	}
@@ -1201,7 +1261,7 @@
 	outbits = btread(BT848_GPIO_OUT_EN);
 	data    = btread(BT848_GPIO_DATA);
 	printk(KERN_DEBUG "bttv%d: gpio: en=%08x, out=%08x in=%08x [%s]\n",
-	       btv->nr,outbits,data & outbits, data & ~outbits, comment);
+	       btv->c.nr,outbits,data & outbits, data & ~outbits, comment);
 }
 
 void bttv_field_count(struct bttv *btv)
@@ -1325,7 +1385,7 @@
 	/* alloc risc memory */
 	if (STATE_NEEDS_INIT == buf->vb.state) {
 		redo_dma_risc = 1;
-		if (0 != (rc = videobuf_iolock(btv->dev,&buf->vb,&btv->fbuf)))
+		if (0 != (rc = videobuf_iolock(btv->c.pci,&buf->vb,&btv->fbuf)))
 			goto fail;
 	}
 
@@ -1428,7 +1488,7 @@
 	{
 		struct video_tuner *v = arg;
 		
-		if (UNSET == bttv_tvcards[btv->type].tuner)
+		if (UNSET == bttv_tvcards[btv->c.type].tuner)
 			return -EINVAL;
 		if (v->tuner) /* Only tuner 0 */
 			return -EINVAL;
@@ -1462,13 +1522,13 @@
                 struct video_channel *v = arg;
 		unsigned int channel = v->channel;
 
-                if (channel >= bttv_tvcards[btv->type].video_inputs)
+                if (channel >= bttv_tvcards[btv->c.type].video_inputs)
                         return -EINVAL;
                 v->tuners=0;
                 v->flags = VIDEO_VC_AUDIO;
                 v->type = VIDEO_TYPE_CAMERA;
                 v->norm = btv->tvnorm;
-		if (channel == bttv_tvcards[btv->type].tuner)  {
+		if (channel == bttv_tvcards[btv->c.type].tuner)  {
                         strcpy(v->name,"Television");
                         v->flags|=VIDEO_VC_TUNER;
                         v->type=VIDEO_TYPE_TV;
@@ -1485,7 +1545,7 @@
                 struct video_channel *v = arg;
 		unsigned int channel = v->channel;
 
-		if (channel >= bttv_tvcards[btv->type].video_inputs)
+		if (channel >= bttv_tvcards[btv->c.type].video_inputs)
 			return -EINVAL;
 		if (v->norm >= BTTV_TVNORMS)
 			return -EINVAL;
@@ -1528,7 +1588,7 @@
 		struct video_audio *v = arg;
 		unsigned int audio = v->audio;
 
-		if (audio >= bttv_tvcards[btv->type].audio_inputs)
+		if (audio >= bttv_tvcards[btv->c.type].audio_inputs)
 			return -EINVAL;
 
 		down(&btv->lock);
@@ -1596,13 +1656,13 @@
 		unsigned int n;
 		
 		n = i->index;
-		if (n >= bttv_tvcards[btv->type].video_inputs)
+		if (n >= bttv_tvcards[btv->c.type].video_inputs)
 			return -EINVAL;
 		memset(i,0,sizeof(*i));
 		i->index    = n;
 		i->type     = V4L2_INPUT_TYPE_CAMERA;
 		i->audioset = 1;
-		if (i->index == bttv_tvcards[btv->type].tuner) {
+		if (i->index == bttv_tvcards[btv->c.type].tuner) {
 			sprintf(i->name, "Television");
 			i->type  = V4L2_INPUT_TYPE_TUNER;
 			i->tuner = 0;
@@ -1632,7 +1692,7 @@
 	{
 		unsigned int *i = arg;
 		
-		if (*i > bttv_tvcards[btv->type].video_inputs)
+		if (*i > bttv_tvcards[btv->c.type].video_inputs)
 			return -EINVAL;
 		down(&btv->lock);
 		set_input(btv,*i);
@@ -1645,7 +1705,7 @@
 	{
 		struct v4l2_tuner *t = arg;
 
-		if (UNSET == bttv_tvcards[btv->type].tuner)
+		if (UNSET == bttv_tvcards[btv->c.type].tuner)
 			return -EINVAL;
 		if (0 != t->index)
 			return -EINVAL;
@@ -1683,7 +1743,7 @@
 	{
 		struct v4l2_tuner *t = arg;
 
-		if (UNSET == bttv_tvcards[btv->type].tuner)
+		if (UNSET == bttv_tvcards[btv->c.type].tuner)
 			return -EINVAL;
 		if (0 != t->index)
 			return -EINVAL;
@@ -2061,16 +2121,16 @@
 		switch (_IOC_TYPE(cmd)) {
 		case 'v':
 			printk("bttv%d: ioctl 0x%x (v4l1, VIDIOC%s)\n",
-			       btv->nr, cmd, (_IOC_NR(cmd) < V4L1_IOCTLS) ?
+			       btv->c.nr, cmd, (_IOC_NR(cmd) < V4L1_IOCTLS) ?
 			       v4l1_ioctls[_IOC_NR(cmd)] : "???");
 			break;
 		case 'V':
 			printk("bttv%d: ioctl 0x%x (v4l2, %s)\n",
-			       btv->nr, cmd,  v4l2_ioctl_names[_IOC_NR(cmd)]);
+			       btv->c.nr, cmd,  v4l2_ioctl_names[_IOC_NR(cmd)]);
 			break;
 		default:
 			printk("bttv%d: ioctl 0x%x (???)\n",
-			       btv->nr, cmd);
+			       btv->c.nr, cmd);
 		}
 	}
 	if (btv->errors)
@@ -2110,8 +2170,8 @@
 				VID_TYPE_OVERLAY|
 				VID_TYPE_CLIPPING|
 				VID_TYPE_SCALES;
-			cap->channels  = bttv_tvcards[btv->type].video_inputs;
-			cap->audios    = bttv_tvcards[btv->type].audio_inputs;
+			cap->channels  = bttv_tvcards[btv->c.type].video_inputs;
+			cap->audios    = bttv_tvcards[btv->c.type].audio_inputs;
 			cap->maxwidth  = bttv_tvnorms[btv->tvnorm].swidth;
 			cap->maxheight = bttv_tvnorms[btv->tvnorm].sheight;
 			cap->minwidth  = 48;
@@ -2144,7 +2204,7 @@
 		if (NULL == fmt)
 			return -EINVAL;
 		down(&fh->cap.lock);
-		if (fmt->depth != pic->depth && !sloppy) {
+		if (fmt->depth != pic->depth) {
 			retval = -EINVAL;
 			goto fh_unlock_and_return;
 		}
@@ -2228,43 +2288,35 @@
 			fbuf->height * fbuf->bytesperline;
 		down(&fh->cap.lock);
 		retval = -EINVAL;
-		if (sloppy) {
-			/* also set the default palette -- for backward
-			   compatibility with older versions */
-			switch (fbuf->depth) {
-			case 8:
-				fmt = format_by_palette(VIDEO_PALETTE_HI240);
-				break;
-			case 16:
-				fmt = format_by_palette(VIDEO_PALETTE_RGB565);
-				break;
-			case 24:
-				fmt = format_by_palette(VIDEO_PALETTE_RGB24);
-				break;
-			case 32:
-				fmt = format_by_palette(VIDEO_PALETTE_RGB32);
-				break;
-			case 15:
-				fbuf->depth = 16;
-				fmt = format_by_palette(VIDEO_PALETTE_RGB555);
-				break;
-			default:
-				fmt = NULL;
-				break;
-			}
-			if (NULL == fmt)
-				goto fh_unlock_and_return;
-			fh->ovfmt = fmt;
-			fh->fmt   = fmt;
-			btv->init.ovfmt = fmt;
-			btv->init.fmt   = fmt;
-		} else {
-			if (15 == fbuf->depth)
-				fbuf->depth = 16;
-			if (fbuf->depth !=  8 && fbuf->depth != 16 &&
-			    fbuf->depth != 24 && fbuf->depth != 32)
-				goto fh_unlock_and_return;
+
+		switch (fbuf->depth) {
+		case 8:
+			fmt = format_by_palette(VIDEO_PALETTE_HI240);
+			break;
+		case 16:
+			fmt = format_by_palette(VIDEO_PALETTE_RGB565);
+			break;
+		case 24:
+			fmt = format_by_palette(VIDEO_PALETTE_RGB24);
+			break;
+		case 32:
+			fmt = format_by_palette(VIDEO_PALETTE_RGB32);
+			break;
+		case 15:
+			fbuf->depth = 16;
+			fmt = format_by_palette(VIDEO_PALETTE_RGB555);
+			break;
+		default:
+			fmt = NULL;
+			break;
 		}
+		if (NULL == fmt)
+			goto fh_unlock_and_return;
+
+		fh->ovfmt = fmt;
+		fh->fmt   = fmt;
+		btv->init.ovfmt = fmt;
+		btv->init.fmt   = fmt;
 		btv->fbuf.base             = fbuf->base;
 		btv->fbuf.fmt.width        = fbuf->width;
 		btv->fbuf.fmt.height       = fbuf->height;
@@ -2287,7 +2339,7 @@
 			if (NULL == btv->fbuf.base)
 				return -EINVAL;
 			if (!fh->ov.setup_ok) {
-				dprintk("bttv%d: overlay: !setup_ok\n",btv->nr);
+				dprintk("bttv%d: overlay: !setup_ok\n",btv->c.nr);
 				return -EINVAL;
 			}
 		}
@@ -2383,7 +2435,7 @@
 			retval = -EIO;
 			/* fall through */
 		case STATE_DONE:
-			videobuf_dma_pci_sync(btv->dev,&buf->vb.dma);
+			videobuf_dma_pci_sync(btv->c.pci,&buf->vb.dma);
 			bttv_dma_free(btv,buf);
 			break;
 		default:
@@ -2464,7 +2516,7 @@
 			return -EINVAL;
                 strcpy(cap->driver,"bttv");
                 strlcpy(cap->card,btv->video_dev->name,sizeof(cap->card));
-		sprintf(cap->bus_info,"PCI:%s",pci_name(btv->dev));
+		sprintf(cap->bus_info,"PCI:%s",pci_name(btv->c.pci));
 		cap->version = BTTV_VERSION_CODE;
 		cap->capabilities =
 			V4L2_CAP_VIDEO_CAPTURE |
@@ -2768,7 +2820,7 @@
 	if (fh->btv->errors)
 		bttv_reinit_bt848(fh->btv);
 	dprintk("bttv%d: read count=%d type=%s\n",
-		fh->btv->nr,(int)count,v4l2_type_names[fh->type]);
+		fh->btv->c.nr,(int)count,v4l2_type_names[fh->type]);
 
 	switch (fh->type) {
 	case V4L2_BUF_TYPE_VIDEO_CAPTURE:
@@ -2849,12 +2901,14 @@
 	dprintk(KERN_DEBUG "bttv: open minor=%d\n",minor);
 
 	for (i = 0; i < bttv_num; i++) {
-		if (bttvs[i].video_dev->minor == minor) {
+		if (bttvs[i].video_dev &&
+		    bttvs[i].video_dev->minor == minor) {
 			btv = &bttvs[i];
 			type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 			break;
 		}
-		if (bttvs[i].vbi_dev->minor == minor) {
+		if (bttvs[i].vbi_dev &&
+		    bttvs[i].vbi_dev->minor == minor) {
 			btv = &bttvs[i];
 			type = V4L2_BUF_TYPE_VBI_CAPTURE;
 			break;
@@ -2864,7 +2918,7 @@
 		return -ENODEV;
 
 	dprintk(KERN_DEBUG "bttv%d: open called (type=%s)\n",
-		btv->nr,v4l2_type_names[type]);
+		btv->c.nr,v4l2_type_names[type]);
 
 	/* allocate per filehandle data */
 	fh = kmalloc(sizeof(*fh),GFP_KERNEL);
@@ -2879,12 +2933,12 @@
 #endif
 
 	videobuf_queue_init(&fh->cap, &bttv_video_qops,
-			    btv->dev, &btv->s_lock,
+			    btv->c.pci, &btv->s_lock,
 			    V4L2_BUF_TYPE_VIDEO_CAPTURE,
 			    V4L2_FIELD_INTERLACED,
 			    sizeof(struct bttv_buffer));
 	videobuf_queue_init(&fh->vbi, &bttv_vbi_qops,
-			    btv->dev, &btv->s_lock,
+			    btv->c.pci, &btv->s_lock,
 			    V4L2_BUF_TYPE_VBI_CAPTURE,
 			    V4L2_FIELD_SEQ_TB,
 			    sizeof(struct bttv_buffer));
@@ -2942,7 +2996,7 @@
 	struct bttv_fh *fh = file->private_data;
 
 	dprintk("bttv%d: mmap type=%s 0x%lx+%ld\n",
-		fh->btv->nr, v4l2_type_names[fh->type],
+		fh->btv->c.nr, v4l2_type_names[fh->type],
 		vma->vm_start, vma->vm_end - vma->vm_start);
 	return videobuf_mmap_mapper(vma,bttv_queue(fh));
 }
@@ -2998,7 +3052,7 @@
 	if (NULL == btv)
 		return -ENODEV;
 
-	dprintk("bttv%d: open called (radio)\n",btv->nr);
+	dprintk("bttv%d: open called (radio)\n",btv->c.nr);
 	down(&btv->lock);
 	if (btv->radio_user) {
 		up(&btv->lock);
@@ -3196,7 +3250,7 @@
 
 	dprintk("bttv%d: next set: top=%p bottom=%p vbi=%p "
 		"[screen=%p,irq=%d,%d]\n",
-		btv->nr,set->top, set->bottom, set->vbi,
+		btv->c.nr,set->top, set->bottom, set->vbi,
 		btv->screen,set->irqflags,set->topirq);
 	return 0;
 }
@@ -3218,7 +3272,7 @@
 	if (wakeup->top == wakeup->bottom) {
 		if (NULL != wakeup->top && curr->top != wakeup->top) {
 			if (irq_debug > 1)
-				printk("bttv%d: wakeup: both=%p\n",btv->nr,wakeup->top);
+				printk("bttv%d: wakeup: both=%p\n",btv->c.nr,wakeup->top);
 			wakeup->top->vb.ts = ts;
 			wakeup->top->vb.field_count = btv->field_count;
 			wakeup->top->vb.state = state;
@@ -3227,7 +3281,7 @@
 	} else {
 		if (NULL != wakeup->top && curr->top != wakeup->top) {
 			if (irq_debug > 1)
-				printk("bttv%d: wakeup: top=%p\n",btv->nr,wakeup->top);
+				printk("bttv%d: wakeup: top=%p\n",btv->c.nr,wakeup->top);
 			wakeup->top->vb.ts = ts;
 			wakeup->top->vb.field_count = btv->field_count;
 			wakeup->top->vb.state = state;
@@ -3235,7 +3289,7 @@
 		}
 		if (NULL != wakeup->bottom && curr->bottom != wakeup->bottom) {
 			if (irq_debug > 1)
-				printk("bttv%d: wakeup: bottom=%p\n",btv->nr,wakeup->bottom);
+				printk("bttv%d: wakeup: bottom=%p\n",btv->c.nr,wakeup->bottom);
 			wakeup->bottom->vb.ts = ts;
 			wakeup->bottom->vb.field_count = btv->field_count;
 			wakeup->bottom->vb.state = state;
@@ -3249,15 +3303,17 @@
 	struct bttv *btv = (struct bttv *)data;
 	struct bttv_buffer_set old,new;
 	struct bttv_buffer *item;
+	unsigned long flags;
 	
 	if (bttv_verbose) {
-		printk(KERN_INFO "bttv%d: timeout: risc=%08x, ",
-		       btv->nr,btread(BT848_RISC_COUNT));
+		printk(KERN_INFO "bttv%d: timeout: irq=%d/%d, risc=%08x, ",
+		       btv->c.nr, btv->irq_me, btv->irq_total,
+		       btread(BT848_RISC_COUNT));
 		bttv_print_irqbits(btread(BT848_INT_STAT),0);
 		printk("\n");
 	}
 
-	spin_lock(&btv->s_lock);
+	spin_lock_irqsave(&btv->s_lock,flags);
 	
 	/* deactivate stuff */
 	memset(&new,0,sizeof(new));
@@ -3284,7 +3340,7 @@
 	}
 	
 	btv->errors++;
-	spin_unlock(&btv->s_lock);	
+	spin_unlock_irqrestore(&btv->s_lock,flags);
 }
 
 static void
@@ -3321,8 +3377,13 @@
 	rc = btread(BT848_RISC_COUNT);
 	if (rc < btv->main.dma || rc > btv->main.dma + 0x100) {
 		if (1 /* irq_debug */)
-			printk("bttv%d: skipped frame. no signal? high irq latency?\n",
-			       btv->nr);
+			printk("bttv%d: skipped frame. no signal? high irq latency? "
+			       "[main=%lx,o_vbi=%lx,o_field=%lx,rc=%lx]\n",
+			       btv->c.nr,
+			       (unsigned long)btv->main.dma,
+			       (unsigned long)btv->main.cpu[RISC_SLOT_O_VBI+1],
+			       (unsigned long)btv->main.cpu[RISC_SLOT_O_FIELD+1],
+			       (unsigned long)rc);
 		spin_unlock(&btv->s_lock);
 		return;
 	}
@@ -3369,7 +3430,7 @@
 		if (irq_debug) {
 			printk(KERN_DEBUG "bttv%d: irq loop=%d fc=%d "
 			       "riscs=%x, riscc=%08x, ",
-			       btv->nr, count, btv->field_count,
+			       btv->c.nr, count, btv->field_count,
 			       stat>>28, btread(BT848_RISC_COUNT));
 			bttv_print_irqbits(stat,astat);
 			if (stat & BT848_INT_HLOCK)
@@ -3388,11 +3449,13 @@
                         btv->field_count++;
 
 		if (astat & BT848_INT_GPINT) {
-#ifdef CONFIG_VIDEO_IR
-			if (btv->remote)
-				bttv_input_irq(btv);
-#endif
 			wake_up(&btv->gpioq);
+			bttv_gpio_irq(&btv->c);
+		}
+
+		if (astat & BT848_INT_I2CDONE) {
+			btv->i2c_done = stat;
+			wake_up(&btv->i2c_queue);
 		}
 
                 if ((astat & BT848_INT_RISCI)  &&  (stat & (2<<28)))
@@ -3405,7 +3468,7 @@
 			audio_mux(btv, -1);
 
 		if (astat & (BT848_INT_SCERR|BT848_INT_OCERR)) {
-			printk(KERN_INFO "bttv%d: %s%s @ %08x,",btv->nr,
+			printk(KERN_INFO "bttv%d: %s%s @ %08x,",btv->c.nr,
 			       (astat & BT848_INT_SCERR) ? "SCERR" : "",
 			       (astat & BT848_INT_OCERR) ? "OCERR" : "",
 			       btread(BT848_RISC_COUNT));
@@ -3416,7 +3479,7 @@
 		}
 		if (fdsr && astat & BT848_INT_FDSR) {
 			printk(KERN_INFO "bttv%d: FDSR @ %08x\n",
-			       btv->nr,btread(BT848_RISC_COUNT));
+			       btv->c.nr,btread(BT848_RISC_COUNT));
 			if (bttv_debug)
 				bttv_print_riscaddr(btv);
 		}
@@ -3425,11 +3488,14 @@
 		if (count > 4) {
 			btwrite(0, BT848_INT_MASK);
 			printk(KERN_ERR 
-			       "bttv%d: IRQ lockup, cleared int mask [", btv->nr);
+			       "bttv%d: IRQ lockup, cleared int mask [", btv->c.nr);
 			bttv_print_irqbits(stat,astat);
 			printk("]\n");
 		}
 	}
+	btv->irq_total++;
+	if (handled)
+		btv->irq_me++;
 	return IRQ_RETVAL(handled);
 }
 
@@ -3448,11 +3514,11 @@
 		return NULL;
 	*vfd = *template;
 	vfd->minor   = -1;
-	vfd->dev     = &btv->dev->dev;
+	vfd->dev     = &btv->c.pci->dev;
 	vfd->release = video_device_release;
 	snprintf(vfd->name, sizeof(vfd->name), "BT%d%s %s (%s)",
 		 btv->id, (btv->id==848 && btv->revision==0x12) ? "A" : "",
-		 type, bttv_tvcards[btv->type].name);
+		 type, bttv_tvcards[btv->c.type].name);
 	return vfd;
 }
 
@@ -3491,7 +3557,7 @@
 	if (video_register_device(btv->video_dev,VFL_TYPE_GRABBER,video_nr)<0)
 		goto err;
 	printk(KERN_INFO "bttv%d: registered device video%d\n",
-	       btv->nr,btv->video_dev->minor & 0x1f);
+	       btv->c.nr,btv->video_dev->minor & 0x1f);
 	video_device_create_file(btv->video_dev, &class_device_attr_card);
 
 	/* vbi */
@@ -3501,7 +3567,7 @@
         if (video_register_device(btv->vbi_dev,VFL_TYPE_VBI,vbi_nr)<0)
 		goto err;
 	printk(KERN_INFO "bttv%d: registered device vbi%d\n",
-	       btv->nr,btv->vbi_dev->minor & 0x1f);
+	       btv->c.nr,btv->vbi_dev->minor & 0x1f);
 
         if (!btv->has_radio)
 		return 0;
@@ -3512,7 +3578,7 @@
 	if (video_register_device(btv->radio_dev, VFL_TYPE_RADIO,radio_nr)<0)
 		goto err;
 	printk(KERN_INFO "bttv%d: registered device radio%d\n",
-	       btv->nr,btv->radio_dev->minor & 0x1f);
+	       btv->c.nr,btv->radio_dev->minor & 0x1f);
 
 	/* all done */
 	return 0;
@@ -3548,14 +3614,17 @@
 	printk(KERN_INFO "bttv: Bt8xx card found (%d).\n", bttv_num);
         btv=&bttvs[bttv_num];
 	memset(btv,0,sizeof(*btv));
-	btv->nr  = bttv_num;
-	sprintf(btv->name,"bttv%d",btv->nr);
+	btv->c.nr  = bttv_num;
+	sprintf(btv->c.name,"bttv%d",btv->c.nr);
 
 	/* initialize structs / fill in defaults */
         init_MUTEX(&btv->lock);
         init_MUTEX(&btv->reslock);
-        btv->s_lock = SPIN_LOCK_UNLOCKED;
+        btv->s_lock    = SPIN_LOCK_UNLOCKED;
+        btv->gpio_lock = SPIN_LOCK_UNLOCKED;
         init_waitqueue_head(&btv->gpioq);
+        init_waitqueue_head(&btv->i2c_queue);
+        INIT_LIST_HEAD(&btv->c.subs);
         INIT_LIST_HEAD(&btv->capture);
         INIT_LIST_HEAD(&btv->vcapture);
 #ifdef VIDIOC_G_PRIORITY
@@ -3570,33 +3639,34 @@
         btv->tuner_type  = UNSET;
         btv->pinnacle_id = UNSET;
 	btv->new_input   = UNSET;
-	btv->has_radio=radio[btv->nr];
+	btv->gpioirq     = 1;
+	btv->has_radio=radio[btv->c.nr];
 	
 	/* pci stuff (init, get irq/mmio, ... */
-	btv->dev = dev;
+	btv->c.pci = dev;
         btv->id  = dev->device;
 	if (pci_enable_device(dev)) {
                 printk(KERN_WARNING "bttv%d: Can't enable device.\n",
-		       btv->nr);
+		       btv->c.nr);
 		return -EIO;
 	}
         if (pci_set_dma_mask(dev, 0xffffffff)) {
                 printk(KERN_WARNING "bttv%d: No suitable DMA available.\n",
-		       btv->nr);
+		       btv->c.nr);
 		return -EIO;
         }
 	if (!request_mem_region(pci_resource_start(dev,0),
 				pci_resource_len(dev,0),
-				btv->name)) {
+				btv->c.name)) {
                 printk(KERN_WARNING "bttv%d: can't request iomem (0x%lx).\n",
-		       btv->nr, pci_resource_start(dev,0));
+		       btv->c.nr, pci_resource_start(dev,0));
 		return -EBUSY;
 	}
         pci_set_master(dev);
 	pci_set_command(dev);
 	pci_set_drvdata(dev,btv);
 	if (!pci_dma_supported(dev,0xffffffff)) {
-		printk("bttv%d: Oops: no 32bit PCI DMA ???\n", btv->nr);
+		printk("bttv%d: Oops: no 32bit PCI DMA ???\n", btv->c.nr);
 		result = -EIO;
 		goto fail1;
 	}
@@ -3606,12 +3676,12 @@
         printk(KERN_INFO "bttv%d: Bt%d (rev %d) at %s, ",
                bttv_num,btv->id, btv->revision, pci_name(dev));
         printk("irq: %d, latency: %d, mmio: 0x%lx\n",
-	       btv->dev->irq, lat, pci_resource_start(dev,0));
+	       btv->c.pci->irq, lat, pci_resource_start(dev,0));
 	schedule();
 	
 	btv->bt848_mmio=ioremap(pci_resource_start(dev,0), 0x1000);
 	if (NULL == ioremap(pci_resource_start(dev,0), 0x1000)) {
-		printk("bttv%d: ioremap() failed\n", btv->nr);
+		printk("bttv%d: ioremap() failed\n", btv->c.nr);
 		result = -EIO;
 		goto fail1;
 	}
@@ -3621,11 +3691,11 @@
 
         /* disable irqs, register irq handler */
 	btwrite(0, BT848_INT_MASK);
-        result = request_irq(btv->dev->irq, bttv_irq,
-                             SA_SHIRQ | SA_INTERRUPT,btv->name,(void *)btv);
+        result = request_irq(btv->c.pci->irq, bttv_irq,
+                             SA_SHIRQ | SA_INTERRUPT,btv->c.name,(void *)btv);
         if (result < 0) {
                 printk(KERN_ERR "bttv%d: can't get IRQ %d\n",
-		       bttv_num,btv->dev->irq);
+		       bttv_num,btv->c.pci->irq);
 		goto fail1;
         }
 
@@ -3641,6 +3711,8 @@
 	btv->opt_chroma_agc = chroma_agc;
 	btv->opt_adc_crush  = adc_crush;
 	btv->opt_vcr_hack   = vcr_hack;
+	btv->opt_whitecrush_upper  = whitecrush_upper;
+	btv->opt_whitecrush_lower  = whitecrush_lower;
 	
 	/* fill struct bttv with some useful defaults */
 	btv->init.btv         = btv;
@@ -3657,31 +3729,27 @@
                 bttv_gpio_tracking(btv,"pre-init");
 
 	bttv_risc_init_main(btv);
-	if (!bttv_tvcards[btv->type].no_video)
-		init_bt848(btv);
+	init_bt848(btv);
 
 	/* gpio */
         btwrite(0x00, BT848_GPIO_REG_INP);
         btwrite(0x00, BT848_GPIO_OUT_EN);
-        if (bttv_gpio)
+        if (bttv_verbose)
                 bttv_gpio_tracking(btv,"init");
 
         /* needs to be done before i2c is registered */
         bttv_init_card1(btv);
 
-        /* register i2c */
+        /* register i2c + gpio */
         init_bttv_i2c(btv);
 
         /* some card-specific stuff (needs working i2c) */
         bttv_init_card2(btv);
+	init_irqreg(btv);
 
         /* register video4linux + input */
-	if (!bttv_tvcards[btv->type].no_video) {
+	if (!bttv_tvcards[btv->c.type].no_video) {
 		bttv_register_video(btv);
-#ifdef CONFIG_VIDEO_IR
-		bttv_input_init(btv);
-#endif
-
 		bt848_bright(btv,32768);
 		bt848_contrast(btv,32768);
 		bt848_hue(btv,32768);
@@ -3690,18 +3758,24 @@
 		set_input(btv,0);
 	}
 
+	/* add subdevices */
+	if (btv->has_remote)
+		bttv_sub_add_device(&btv->c, "remote");
+	if (bttv_tvcards[btv->c.type].has_dvb)
+		bttv_sub_add_device(&btv->c, "dvb");
+
 	/* everything is fine */
 	bttv_num++;
         return 0;
 
  fail2:
-        free_irq(btv->dev->irq,btv);
+        free_irq(btv->c.pci->irq,btv);
 	
  fail1:
 	if (btv->bt848_mmio)
 		iounmap(btv->bt848_mmio);
-	release_mem_region(pci_resource_start(btv->dev,0),
-			   pci_resource_len(btv->dev,0));
+	release_mem_region(pci_resource_start(btv->c.pci,0),
+			   pci_resource_len(btv->c.pci,0));
 	pci_set_drvdata(dev,NULL);
 	return result;
 }
@@ -3711,7 +3785,7 @@
         struct bttv *btv = pci_get_drvdata(pci_dev);
 
 	if (bttv_verbose)
-		printk("bttv%d: unloading\n",btv->nr);
+		printk("bttv%d: unloading\n",btv->c.nr);
 
         /* shutdown everything (DMA+IRQs) */
 	btand(~15, BT848_GPIO_DMA_CTL);
@@ -3724,29 +3798,92 @@
 	/* tell gpio modules we are leaving ... */
 	btv->shutdown=1;
 	wake_up(&btv->gpioq);
-
+	bttv_sub_del_devices(&btv->c);
+	
         /* unregister i2c_bus + input */
 	fini_bttv_i2c(btv);
-#ifdef CONFIG_VIDEO_IR
-	bttv_input_fini(btv);
-#endif
 
 	/* unregister video4linux */
 	bttv_unregister_video(btv);
 
 	/* free allocated memory */
-	btcx_riscmem_free(btv->dev,&btv->main);
+	btcx_riscmem_free(btv->c.pci,&btv->main);
 
 	/* free ressources */
-        free_irq(btv->dev->irq,btv);
+        free_irq(btv->c.pci->irq,btv);
 	iounmap(btv->bt848_mmio);
-        release_mem_region(pci_resource_start(btv->dev,0),
-                           pci_resource_len(btv->dev,0));
+        release_mem_region(pci_resource_start(btv->c.pci,0),
+                           pci_resource_len(btv->c.pci,0));
 
 	pci_set_drvdata(pci_dev, NULL);
         return;
 }
 
+static int bttv_suspend(struct pci_dev *pci_dev, u32 state)
+{
+        struct bttv *btv = pci_get_drvdata(pci_dev);
+	struct bttv_buffer_set idle;
+	unsigned long flags;
+
+	printk("bttv%d: suspend %d\n", btv->c.nr, state);
+
+	/* stop dma + irqs */
+	spin_lock_irqsave(&btv->s_lock,flags);
+	memset(&idle, 0, sizeof(idle));
+	btv->state.set = btv->curr;
+	btv->curr = idle;
+	bttv_buffer_set_activate(btv, &idle);
+	bttv_set_dma(btv, 0, 0);
+	btwrite(0, BT848_INT_MASK);
+	spin_unlock_irqrestore(&btv->s_lock,flags);
+
+	/* save bt878 state */
+	btv->state.gpio_enable = btread(BT848_GPIO_OUT_EN);
+	btv->state.gpio_data   = gpio_read();
+
+	/* save pci state */
+	pci_save_state(pci_dev, btv->state.pci_cfg);
+	if (0 != pci_set_power_state(pci_dev, state)) {
+		pci_disable_device(pci_dev);
+		btv->state.disabled = 1;
+	}
+	return 0;
+}
+
+static int bttv_resume(struct pci_dev *pci_dev)
+{
+        struct bttv *btv = pci_get_drvdata(pci_dev);
+	unsigned long flags;
+
+	printk("bttv%d: resume\n", btv->c.nr);
+
+	/* restore pci state */
+	if (btv->state.disabled) {
+		pci_enable_device(pci_dev);
+		btv->state.disabled = 0;
+	}
+	pci_set_power_state(pci_dev, 0);
+	pci_restore_state(pci_dev, btv->state.pci_cfg);
+
+	/* restore bt878 state */
+	bttv_reinit_bt848(btv);
+	gpio_inout(0xffffff, btv->state.gpio_enable);
+	gpio_write(btv->state.gpio_data);
+
+	bt848_bright(btv,   btv->bright);
+	bt848_hue(btv,      btv->hue);
+	bt848_contrast(btv, btv->contrast);
+	bt848_sat(btv,      btv->saturation);
+
+	/* restart dma */
+	spin_lock_irqsave(&btv->s_lock,flags);
+	btv->curr = btv->state.set;
+	bttv_buffer_set_activate(btv, &btv->curr);
+	bttv_set_dma(btv, 0, btv->curr.irqflags);
+	spin_unlock_irqrestore(&btv->s_lock,flags);
+	return 0;
+}
+
 static struct pci_device_id bttv_pci_tbl[] = {
         {PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT848,
          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
@@ -3766,6 +3903,9 @@
         .id_table = bttv_pci_tbl,
         .probe    = bttv_probe,
         .remove   = __devexit_p(bttv_remove),
+
+	.suspend    = bttv_suspend,
+	.resume     = bttv_resume,
 };
 
 static int bttv_init_module(void)
@@ -3777,6 +3917,10 @@
 	       (BTTV_VERSION_CODE >> 16) & 0xff,
 	       (BTTV_VERSION_CODE >> 8) & 0xff,
 	       BTTV_VERSION_CODE & 0xff);
+#ifdef SNAPSHOT
+	printk(KERN_INFO "bttv: snapshot date %04d-%02d-%02d\n",
+	       SNAPSHOT/10000, (SNAPSHOT/100)%100, SNAPSHOT%100);
+#endif
 	if (gbuffers < 2 || gbuffers > VIDEO_MAX_FRAME)
 		gbuffers = 2;
 	if (gbufsize < 0 || gbufsize > BTTV_MAX_FBUF)
@@ -3788,6 +3932,7 @@
 
 	bttv_check_chipset();
 
+	bus_register(&bttv_sub_bus_type);
 	rc = pci_module_init(&bttv_pci_driver);
 	if (-ENODEV == rc) {
 		/* plenty of people trying to use bttv for the cx2388x ... */
@@ -3800,6 +3945,7 @@
 static void bttv_cleanup_module(void)
 {
 	pci_unregister_driver(&bttv_pci_driver);
+	bus_unregister(&bttv_sub_bus_type);
 	return;
 }
 
diff -Nru a/drivers/media/video/bttv-gpio.c b/drivers/media/video/bttv-gpio.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/video/bttv-gpio.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,183 @@
+/*
+    bttv-gpio.c  --  gpio sub drivers
+
+    sysfs-based sub driver interface for bttv
+    mainly intented for gpio access
+
+
+    Copyright (C) 1996,97,98 Ralph  Metzler (rjkm@thp.uni-koeln.de)
+                           & Marcus Metzler (mocm@thp.uni-koeln.de)
+    (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+    
+*/
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/device.h>
+#include <asm/io.h>
+
+#include "bttvp.h"
+
+/* ----------------------------------------------------------------------- */
+/* internal: the bttv "bus"                                                */
+
+static int bttv_sub_bus_match(struct device *dev, struct device_driver *drv)
+{
+	struct bttv_sub_driver *sub = to_bttv_sub_drv(drv);
+	int len = strlen(sub->wanted);
+
+	if (0 == strncmp(dev->bus_id, sub->wanted, len))
+		return 1;
+	return 0;
+}
+
+struct bus_type bttv_sub_bus_type = {
+	.name  = "bttv-sub",
+	.match = &bttv_sub_bus_match,
+};
+EXPORT_SYMBOL(bttv_sub_bus_type);
+
+static void release_sub_device(struct device *dev)
+{
+	struct bttv_sub_device *sub = to_bttv_sub_dev(dev);
+	kfree(sub);
+}
+
+int bttv_sub_add_device(struct bttv_core *core, char *name)
+{
+	struct bttv_sub_device *sub;
+
+	sub = kmalloc(sizeof(*sub),GFP_KERNEL);
+	if (NULL == sub)
+		return -ENOMEM;
+	memset(sub,0,sizeof(*sub));
+
+	sub->core        = core;
+	sub->dev.parent  = &core->pci->dev;
+	sub->dev.bus     = &bttv_sub_bus_type;
+	sub->dev.release = release_sub_device;
+	snprintf(sub->dev.bus_id,sizeof(sub->dev.bus_id),"%s%d",
+		 name, core->nr);
+
+	printk("bttv%d: add subdevice \"%s\"\n", core->nr, sub->dev.bus_id);
+	list_add_tail(&sub->list,&core->subs);
+	device_register(&sub->dev);
+	return 0;
+}
+
+int bttv_sub_del_devices(struct bttv_core *core)
+{
+	struct bttv_sub_device *sub;
+	struct list_head *item,*save;
+
+	list_for_each_safe(item,save,&core->subs) {
+		sub = list_entry(item,struct bttv_sub_device,list);
+		device_unregister(&sub->dev);
+	}
+	return 0;
+}
+
+void bttv_gpio_irq(struct bttv_core *core)
+{
+	struct bttv_sub_driver *drv;
+	struct bttv_sub_device *dev;
+	struct list_head *item;
+
+	list_for_each(item,&core->subs) {
+		dev = list_entry(item,struct bttv_sub_device,list);
+		drv = to_bttv_sub_drv(dev->dev.driver);
+		if (drv && drv->gpio_irq)
+			drv->gpio_irq(dev);
+	}
+}
+
+/* ----------------------------------------------------------------------- */
+/* external: sub-driver register/unregister                                */
+
+int bttv_sub_register(struct bttv_sub_driver *sub, char *wanted)
+{
+	sub->drv.bus = &bttv_sub_bus_type;
+	snprintf(sub->wanted,sizeof(sub->wanted),"%s",wanted);
+	driver_register(&sub->drv);
+	return 0;
+}
+EXPORT_SYMBOL(bttv_sub_register);
+
+int bttv_sub_unregister(struct bttv_sub_driver *sub)
+{
+	driver_unregister(&sub->drv);
+	return 0;
+}
+EXPORT_SYMBOL(bttv_sub_unregister);
+
+/* ----------------------------------------------------------------------- */
+/* external: gpio access functions                                         */
+
+void bttv_gpio_inout(struct bttv_core *core, u32 mask, u32 outbits)
+{
+	struct bttv *btv = container_of(core, struct bttv, c);
+	unsigned long flags;
+	u32 data;
+
+	spin_lock_irqsave(&btv->gpio_lock,flags);
+	data = btread(BT848_GPIO_OUT_EN);
+	data = data & ~mask;
+	data = data | (mask & outbits);
+	btwrite(data,BT848_GPIO_OUT_EN);
+	spin_unlock_irqrestore(&btv->gpio_lock,flags);
+}
+EXPORT_SYMBOL(bttv_gpio_inout);
+
+u32 bttv_gpio_read(struct bttv_core *core)
+{
+	struct bttv *btv = container_of(core, struct bttv, c);
+	u32 value;
+
+	value = btread(BT848_GPIO_DATA);
+	return value;
+}
+EXPORT_SYMBOL(bttv_gpio_read);
+
+void bttv_gpio_write(struct bttv_core *core, u32 value)
+{
+	struct bttv *btv = container_of(core, struct bttv, c);
+
+	btwrite(value,BT848_GPIO_DATA);
+}
+EXPORT_SYMBOL(bttv_gpio_write);
+
+void bttv_gpio_bits(struct bttv_core *core, u32 mask, u32 bits)
+{
+	struct bttv *btv = container_of(core, struct bttv, c);
+	unsigned long flags;
+	u32 data;
+
+	spin_lock_irqsave(&btv->gpio_lock,flags);
+	data = btread(BT848_GPIO_DATA);
+	data = data & ~mask;
+	data = data | (mask & bits);
+	btwrite(data,BT848_GPIO_DATA);
+	spin_unlock_irqrestore(&btv->gpio_lock,flags);
+}
+EXPORT_SYMBOL(bttv_gpio_bits);
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff -Nru a/drivers/media/video/bttv-i2c.c b/drivers/media/video/bttv-i2c.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/video/bttv-i2c.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,471 @@
+/*
+    bttv-i2c.c  --  all the i2c code is here
+
+    bttv - Bt848 frame grabber driver
+
+    Copyright (C) 1996,97,98 Ralph  Metzler (rjkm@thp.uni-koeln.de)
+                           & Marcus Metzler (mocm@thp.uni-koeln.de)
+    (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+    
+*/
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <asm/io.h>
+
+#include "bttvp.h"
+
+static struct i2c_algo_bit_data bttv_i2c_algo_bit_template;
+static struct i2c_adapter bttv_i2c_adap_sw_template;
+static struct i2c_adapter bttv_i2c_adap_hw_template;
+static struct i2c_client bttv_i2c_client_template;
+
+#ifndef I2C_PEC
+static void bttv_inc_use(struct i2c_adapter *adap);
+static void bttv_dec_use(struct i2c_adapter *adap);
+#endif
+static int attach_inform(struct i2c_client *client);
+
+static int i2c_debug = 0;
+static int i2c_hw = 0;
+MODULE_PARM(i2c_debug,"i");
+MODULE_PARM(i2c_hw,"i");
+
+/* ----------------------------------------------------------------------- */
+/* I2C functions - bitbanging adapter (software i2c)                       */
+
+void bttv_bit_setscl(void *data, int state)
+{
+	struct bttv *btv = (struct bttv*)data;
+
+	if (state)
+		btv->i2c_state |= 0x02;
+	else
+		btv->i2c_state &= ~0x02;
+	btwrite(btv->i2c_state, BT848_I2C);
+	btread(BT848_I2C);
+}
+
+void bttv_bit_setsda(void *data, int state)
+{
+	struct bttv *btv = (struct bttv*)data;
+
+	if (state)
+		btv->i2c_state |= 0x01;
+	else
+		btv->i2c_state &= ~0x01;
+	btwrite(btv->i2c_state, BT848_I2C);
+	btread(BT848_I2C);
+}
+
+static int bttv_bit_getscl(void *data)
+{
+	struct bttv *btv = (struct bttv*)data;
+	int state;
+	
+	state = btread(BT848_I2C) & 0x02 ? 1 : 0;
+	return state;
+}
+
+static int bttv_bit_getsda(void *data)
+{
+	struct bttv *btv = (struct bttv*)data;
+	int state;
+
+	state = btread(BT848_I2C) & 0x01;
+	return state;
+}
+
+static struct i2c_algo_bit_data bttv_i2c_algo_bit_template = {
+	.setsda  = bttv_bit_setsda,
+	.setscl  = bttv_bit_setscl,
+	.getsda  = bttv_bit_getsda,
+	.getscl  = bttv_bit_getscl,
+	.udelay  = 16,
+	.mdelay  = 10,
+	.timeout = 200,
+};
+
+static struct i2c_adapter bttv_i2c_adap_sw_template = {
+#ifdef I2C_PEC
+	.owner             = THIS_MODULE,
+#else
+	.inc_use           = bttv_inc_use,
+	.dec_use           = bttv_dec_use,
+#endif
+#ifdef I2C_ADAP_CLASS_TV_ANALOG
+	.class             = I2C_ADAP_CLASS_TV_ANALOG,
+#endif
+	I2C_DEVNAME("bt848"),
+	.id                = I2C_HW_B_BT848,
+	.client_register   = attach_inform,
+};
+
+/* ----------------------------------------------------------------------- */
+/* I2C functions - hardware i2c                                            */
+
+static int algo_control(struct i2c_adapter *adapter, 
+			unsigned int cmd, unsigned long arg)
+{
+	return 0;
+}
+
+static u32 functionality(struct i2c_adapter *adap)
+{
+	return I2C_FUNC_SMBUS_EMUL;
+}
+
+static int
+bttv_i2c_wait_done(struct bttv *btv)
+{
+	DECLARE_WAITQUEUE(wait, current);
+	int rc = 0;
+	
+	add_wait_queue(&btv->i2c_queue, &wait);
+	set_current_state(TASK_INTERRUPTIBLE);
+	if (0 == btv->i2c_done)
+		schedule_timeout(HZ/50+1);
+	set_current_state(TASK_RUNNING);
+	remove_wait_queue(&btv->i2c_queue, &wait);
+
+	if (0 == btv->i2c_done)
+		/* timeout */
+		rc = -EIO;
+	if (btv->i2c_done & BT848_INT_RACK)
+		rc = 1;
+	btv->i2c_done = 0;
+	return rc;
+}
+
+#define I2C_HW (BT878_I2C_MODE  | BT848_I2C_SYNC |\
+		BT848_I2C_SCL | BT848_I2C_SDA)
+
+static int
+bttv_i2c_sendbytes(struct bttv *btv, const struct i2c_msg *msg, int last)
+{
+	u32 xmit;
+	int retval,cnt;
+
+	/* sanity checks */
+	if (0 == msg->len)
+		return -EINVAL;
+
+	/* start, address + first byte */
+	xmit = (msg->addr << 25) | (msg->buf[0] << 16) | I2C_HW;
+	if (msg->len > 1 || !last)
+		xmit |= BT878_I2C_NOSTOP;
+	btwrite(xmit, BT848_I2C);
+	retval = bttv_i2c_wait_done(btv);
+	if (retval < 0)
+		goto err;
+	if (retval == 0)
+		goto eio;
+	if (i2c_debug) {
+		printk(" <W %02x %02x", msg->addr << 1, msg->buf[0]);
+		if (!(xmit & BT878_I2C_NOSTOP))
+			printk(" >\n");
+	}
+
+	for (cnt = 1; cnt < msg->len; cnt++ ) {
+		/* following bytes */
+		xmit = (msg->buf[cnt] << 24) | I2C_HW | BT878_I2C_NOSTART;
+		if (cnt < msg->len-1 || !last)
+			xmit |= BT878_I2C_NOSTOP;
+		btwrite(xmit, BT848_I2C);
+		retval = bttv_i2c_wait_done(btv);
+		if (retval < 0)
+			goto err;
+		if (retval == 0)
+			goto eio;
+		if (i2c_debug) {
+			printk(" %02x", msg->buf[cnt]);
+			if (!(xmit & BT878_I2C_NOSTOP))
+				printk(" >\n");
+		}
+	}
+	return msg->len;
+
+ eio:
+	retval = -EIO;
+ err:
+	if (i2c_debug)
+		printk(" ERR: %d\n",retval);
+	return retval;
+}
+
+static int
+bttv_i2c_readbytes(struct bttv *btv, const struct i2c_msg *msg, int last)
+{
+	u32 xmit;
+	u32 cnt;
+	int retval;
+
+	for(cnt = 0; cnt < msg->len; cnt++) {
+		xmit = (msg->addr << 25) | (1 << 24) | I2C_HW;
+		if (cnt < msg->len-1)
+			xmit |= BT848_I2C_W3B;
+		if (cnt < msg->len-1 || !last)
+			xmit |= BT878_I2C_NOSTOP;
+		if (cnt)
+			xmit |= BT878_I2C_NOSTART;
+		btwrite(xmit, BT848_I2C);
+		retval = bttv_i2c_wait_done(btv);
+		if (retval < 0)
+			goto err;
+		if (retval == 0)
+			goto eio;
+		msg->buf[cnt] = ((u32)btread(BT848_I2C) >> 8) & 0xff;
+		if (i2c_debug) {
+			if (!(xmit & BT878_I2C_NOSTART))
+				printk(" <R %02x", (msg->addr << 1) +1);
+			printk(" =%02x", msg->buf[cnt]);
+			if (!(xmit & BT878_I2C_NOSTOP))
+				printk(" >\n");
+		}
+	}
+	return msg->len;
+
+ eio:
+	retval = -EIO;
+ err:
+	if (i2c_debug)
+		printk(" ERR: %d\n",retval);
+       	return retval;
+}
+
+int bttv_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
+{
+	struct bttv *btv = i2c_get_adapdata(i2c_adap);
+	int retval = 0;
+	int i;
+
+	if (i2c_debug)
+		printk("bt-i2c:");
+	btwrite(BT848_INT_I2CDONE|BT848_INT_RACK, BT848_INT_STAT);
+	for (i = 0 ; i < num; i++) {
+		if (msgs[i].flags & I2C_M_RD) {
+			/* read */
+			retval = bttv_i2c_readbytes(btv, &msgs[i], i+1 == num);
+			if (retval < 0)
+				goto err;
+		} else {
+			/* write */
+			retval = bttv_i2c_sendbytes(btv, &msgs[i], i+1 == num);
+			if (retval < 0)
+				goto err;
+		}
+	}
+	return num;
+
+ err:
+	return retval;
+}
+
+static struct i2c_algorithm bttv_algo = {
+	.name          = "bt878",
+	.id            = I2C_ALGO_BIT | I2C_HW_B_BT848 /* FIXME */,
+	.master_xfer   = bttv_i2c_xfer,
+	.algo_control  = algo_control,
+	.functionality = functionality,
+};
+
+static struct i2c_adapter bttv_i2c_adap_hw_template = {
+#ifdef I2C_PEC
+	.owner         = THIS_MODULE,
+#else
+	.inc_use       = bttv_inc_use,
+	.dec_use       = bttv_dec_use,
+#endif
+#ifdef I2C_ADAP_CLASS_TV_ANALOG
+	.class         = I2C_ADAP_CLASS_TV_ANALOG,
+#endif
+	I2C_DEVNAME("bt878"),
+	.id            = I2C_ALGO_BIT | I2C_HW_B_BT848 /* FIXME */,
+	.algo          = &bttv_algo,
+	.client_register = attach_inform,
+};
+
+/* ----------------------------------------------------------------------- */
+/* I2C functions - common stuff                                            */
+
+#ifndef I2C_PEC
+static void bttv_inc_use(struct i2c_adapter *adap)
+{
+	MOD_INC_USE_COUNT;
+}
+
+static void bttv_dec_use(struct i2c_adapter *adap)
+{
+	MOD_DEC_USE_COUNT;
+}
+#endif
+
+static int attach_inform(struct i2c_client *client)
+{
+        struct bttv *btv = i2c_get_adapdata(client->adapter);
+
+	if (btv->tuner_type != UNSET)
+		bttv_call_i2c_clients(btv,TUNER_SET_TYPE,&btv->tuner_type);
+	if (btv->pinnacle_id != UNSET)
+		bttv_call_i2c_clients(btv,AUDC_CONFIG_PINNACLE,
+				      &btv->pinnacle_id);
+
+        if (bttv_debug)
+		printk("bttv%d: i2c attach [client=%s]\n",
+		       btv->c.nr, i2c_clientname(client));
+        return 0;
+}
+
+void bttv_call_i2c_clients(struct bttv *btv, unsigned int cmd, void *arg)
+{
+	if (0 != btv->i2c_rc)
+		return;
+	i2c_clients_command(&btv->c.i2c_adap, cmd, arg);
+}
+
+void bttv_i2c_call(unsigned int card, unsigned int cmd, void *arg)
+{
+	if (card >= bttv_num)
+		return;
+	bttv_call_i2c_clients(&bttvs[card], cmd, arg);
+}
+
+static struct i2c_client bttv_i2c_client_template = {
+	I2C_DEVNAME("bttv internal"),
+        .id       = -1,
+};
+
+
+/* read I2C */
+int bttv_I2CRead(struct bttv *btv, unsigned char addr, char *probe_for) 
+{
+        unsigned char buffer = 0;
+
+	if (0 != btv->i2c_rc)
+		return -1;
+	if (bttv_verbose && NULL != probe_for)
+		printk(KERN_INFO "bttv%d: i2c: checking for %s @ 0x%02x... ",
+		       btv->c.nr,probe_for,addr);
+        btv->i2c_client.addr = addr >> 1;
+        if (1 != i2c_master_recv(&btv->i2c_client, &buffer, 1)) {
+		if (NULL != probe_for) {
+			if (bttv_verbose)
+				printk("not found\n");
+		} else
+			printk(KERN_WARNING "bttv%d: i2c read 0x%x: error\n",
+			       btv->c.nr,addr);
+                return -1;
+	}
+	if (bttv_verbose && NULL != probe_for)
+		printk("found\n");
+        return buffer;
+}
+
+/* write I2C */
+int bttv_I2CWrite(struct bttv *btv, unsigned char addr, unsigned char b1,
+                    unsigned char b2, int both)
+{
+        unsigned char buffer[2];
+        int bytes = both ? 2 : 1;
+
+	if (0 != btv->i2c_rc)
+		return -1;
+        btv->i2c_client.addr = addr >> 1;
+        buffer[0] = b1;
+        buffer[1] = b2;
+        if (bytes != i2c_master_send(&btv->i2c_client, buffer, bytes))
+		return -1;
+        return 0;
+}
+
+/* read EEPROM content */
+void __devinit bttv_readee(struct bttv *btv, unsigned char *eedata, int addr)
+{
+	int i;
+        
+	if (bttv_I2CWrite(btv, addr, 0, -1, 0)<0) {
+		printk(KERN_WARNING "bttv: readee error\n");
+		return;
+	}
+	btv->i2c_client.addr = addr >> 1;
+	for (i=0; i<256; i+=16) {
+		if (16 != i2c_master_recv(&btv->i2c_client,eedata+i,16)) {
+			printk(KERN_WARNING "bttv: readee error\n");
+			break;
+		}
+	}
+}
+
+/* init + register i2c algo-bit adapter */
+int __devinit init_bttv_i2c(struct bttv *btv)
+{
+	int use_hw = (btv->id == 878) && i2c_hw;
+
+	memcpy(&btv->i2c_client, &bttv_i2c_client_template,
+	       sizeof(bttv_i2c_client_template));
+
+	if (use_hw) {
+		/* bt878 */
+		memcpy(&btv->c.i2c_adap, &bttv_i2c_adap_hw_template,
+		       sizeof(bttv_i2c_adap_hw_template));
+	} else {
+		/* bt848 */
+		memcpy(&btv->c.i2c_adap, &bttv_i2c_adap_sw_template,
+		       sizeof(bttv_i2c_adap_sw_template));
+		memcpy(&btv->i2c_algo, &bttv_i2c_algo_bit_template,
+		       sizeof(bttv_i2c_algo_bit_template));
+		btv->i2c_algo.data = btv;
+		btv->c.i2c_adap.algo_data = &btv->i2c_algo;
+	}
+
+	btv->c.i2c_adap.dev.parent = &btv->c.pci->dev;
+	snprintf(btv->c.i2c_adap.name, sizeof(btv->c.i2c_adap.name),
+		 "bt%d #%d [%s]", btv->id, btv->c.nr, use_hw ? "hw" : "sw");
+
+        i2c_set_adapdata(&btv->c.i2c_adap, btv);
+        btv->i2c_client.adapter = &btv->c.i2c_adap;
+
+	if (use_hw) {
+		btv->i2c_rc = i2c_add_adapter(&btv->c.i2c_adap);
+	} else {
+		bttv_bit_setscl(btv,1);
+		bttv_bit_setsda(btv,1);
+		btv->i2c_rc = i2c_bit_add_bus(&btv->c.i2c_adap);
+	}
+	return btv->i2c_rc;
+}
+
+int __devexit fini_bttv_i2c(struct bttv *btv)
+{
+	int use_hw = (btv->id == 878) && i2c_hw;
+
+	if (0 != btv->i2c_rc)
+		return 0;
+
+	if (use_hw) {
+		return i2c_del_adapter(&btv->c.i2c_adap);
+	} else {
+		return i2c_bit_del_bus(&btv->c.i2c_adap);
+	}
+}
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff -Nru a/drivers/media/video/bttv-if.c b/drivers/media/video/bttv-if.c
--- a/drivers/media/video/bttv-if.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/video/bttv-if.c	Tue Feb  3 19:45:17 2004
@@ -1,7 +1,7 @@
 /*
-    bttv-if.c  --  interfaces to other kernel modules
-	all the i2c code is here
-	also the gpio interface exported by bttv (used by lirc)
+    bttv-if.c  --  old gpio interface to other kernel modules
+                   don't use in new code, will go away in 2.7
+		   have a look at bttv-gpio.c instead.
 
     bttv - Bt848 frame grabber driver
 
@@ -28,22 +28,10 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/delay.h>
-
 #include <asm/io.h>
 
 #include "bttvp.h"
 
-static struct i2c_algo_bit_data bttv_i2c_algo_bit_template;
-static struct i2c_adapter bttv_i2c_adap_sw_template;
-static struct i2c_adapter bttv_i2c_adap_hw_template;
-static struct i2c_client bttv_i2c_client_template;
-
-#ifndef I2C_PEC
-static void bttv_inc_use(struct i2c_adapter *adap);
-static void bttv_dec_use(struct i2c_adapter *adap);
-#endif
-static int attach_inform(struct i2c_client *client);
-
 EXPORT_SYMBOL(bttv_get_cardinfo);
 EXPORT_SYMBOL(bttv_get_pcidev);
 EXPORT_SYMBOL(bttv_get_id);
@@ -53,11 +41,6 @@
 EXPORT_SYMBOL(bttv_get_gpio_queue);
 EXPORT_SYMBOL(bttv_i2c_call);
 
-static int i2c_debug = 0;
-static int i2c_hw = 0;
-MODULE_PARM(i2c_debug,"i");
-MODULE_PARM(i2c_hw,"i");
-
 /* ----------------------------------------------------------------------- */
 /* Exported functions - for other modules which want to access the         */
 /*                      gpio ports (IR for example)                        */
@@ -68,7 +51,7 @@
 	if (card >= bttv_num) {
 		return -1;
 	}
-	*type   = bttvs[card].type;
+	*type   = bttvs[card].c.type;
 	*cardid = bttvs[card].cardid;
 	return 0;
 }
@@ -77,7 +60,7 @@
 {
 	if (card >= bttv_num)
 		return NULL;
-	return bttvs[card].dev;
+	return bttvs[card].c.pci;
 }
 
 int bttv_get_id(unsigned int card)
@@ -86,7 +69,7 @@
 	if (card >= bttv_num) {
 		return -1;
 	}
-	return bttvs[card].type;
+	return bttvs[card].c.type;
 }
 
 
@@ -99,7 +82,7 @@
 	}
 	
 	btv = &bttvs[card];
-	btaor(data, ~mask, BT848_GPIO_OUT_EN);
+	gpio_inout(mask,data);
 	if (bttv_gpio)
 		bttv_gpio_tracking(btv,"extern enable");
 	return 0;
@@ -121,7 +104,7 @@
 
 /* prior setting BT848_GPIO_REG_INP is (probably) not needed 
    because we set direct input on init */
-	*data = btread(BT848_GPIO_DATA);
+	*data = gpio_read();
 	return 0;
 }
 
@@ -137,7 +120,7 @@
 
 /* prior setting BT848_GPIO_REG_INP is (probably) not needed 
    because direct input is set on init */
-	btaor(data & mask, ~mask, BT848_GPIO_DATA);
+	gpio_bits(mask,data);
 	if (bttv_gpio)
 		bttv_gpio_tracking(btv,"extern write");
 	return 0;
@@ -156,418 +139,6 @@
 		return NULL;
 	}
 	return &btv->gpioq;
-}
-
-
-/* ----------------------------------------------------------------------- */
-/* I2C functions - bitbanging adapter (software i2c)                       */
-
-void bttv_bit_setscl(void *data, int state)
-{
-	struct bttv *btv = (struct bttv*)data;
-
-	if (state)
-		btv->i2c_state |= 0x02;
-	else
-		btv->i2c_state &= ~0x02;
-	btwrite(btv->i2c_state, BT848_I2C);
-	btread(BT848_I2C);
-}
-
-void bttv_bit_setsda(void *data, int state)
-{
-	struct bttv *btv = (struct bttv*)data;
-
-	if (state)
-		btv->i2c_state |= 0x01;
-	else
-		btv->i2c_state &= ~0x01;
-	btwrite(btv->i2c_state, BT848_I2C);
-	btread(BT848_I2C);
-}
-
-static int bttv_bit_getscl(void *data)
-{
-	struct bttv *btv = (struct bttv*)data;
-	int state;
-	
-	state = btread(BT848_I2C) & 0x02 ? 1 : 0;
-	return state;
-}
-
-static int bttv_bit_getsda(void *data)
-{
-	struct bttv *btv = (struct bttv*)data;
-	int state;
-
-	state = btread(BT848_I2C) & 0x01;
-	return state;
-}
-
-static struct i2c_algo_bit_data bttv_i2c_algo_bit_template = {
-	.setsda  = bttv_bit_setsda,
-	.setscl  = bttv_bit_setscl,
-	.getsda  = bttv_bit_getsda,
-	.getscl  = bttv_bit_getscl,
-	.udelay  = 16,
-	.mdelay  = 10,
-	.timeout = 200,
-};
-
-static struct i2c_adapter bttv_i2c_adap_sw_template = {
-#ifdef I2C_PEC
-	.owner             = THIS_MODULE,
-#else
-	.inc_use           = bttv_inc_use,
-	.dec_use           = bttv_dec_use,
-#endif
-#ifdef I2C_ADAP_CLASS_TV_ANALOG
-	.class             = I2C_ADAP_CLASS_TV_ANALOG,
-#endif
-	I2C_DEVNAME("bt848"),
-	.id                = I2C_HW_B_BT848,
-	.client_register   = attach_inform,
-};
-
-/* ----------------------------------------------------------------------- */
-/* I2C functions - hardware i2c                                            */
-
-static int algo_control(struct i2c_adapter *adapter, 
-			unsigned int cmd, unsigned long arg)
-{
-	return 0;
-}
-
-static u32 functionality(struct i2c_adapter *adap)
-{
-	return I2C_FUNC_SMBUS_EMUL;
-}
-
-static int
-bttv_i2c_wait_done(struct bttv *btv)
-{
-	u32 stat;
-	unsigned long timeout;
-
-	timeout = jiffies + HZ/100 + 1; /* 10ms */
-	for (;;) {
-		stat = btread(BT848_INT_STAT);
-		if (stat & BT848_INT_I2CDONE)
-			break;
-		if (time_after(jiffies,timeout))
-			return -EIO;
-		udelay(10);
-	}
-	btwrite(BT848_INT_I2CDONE|BT848_INT_RACK, BT848_INT_STAT);
-	return ((stat & BT848_INT_RACK) ? 1 : 0);
-}
-
-#define I2C_HW (BT878_I2C_MODE  | BT848_I2C_SYNC |\
-		BT848_I2C_SCL | BT848_I2C_SDA)
-
-static int
-bttv_i2c_sendbytes(struct bttv *btv, const struct i2c_msg *msg, int last)
-{
-	u32 xmit;
-	int retval,cnt;
-
-	/* start, address + first byte */
-	xmit = (msg->addr << 25) | (msg->buf[0] << 16) | I2C_HW;
-	if (msg->len > 1 || !last)
-		xmit |= BT878_I2C_NOSTOP;
-	btwrite(xmit, BT848_I2C);
-	retval = bttv_i2c_wait_done(btv);
-	if (retval < 0)
-		goto err;
-	if (retval == 0)
-		goto eio;
-	if (i2c_debug) {
-		printk(" <W %02x %02x", msg->addr << 1, msg->buf[0]);
-		if (!(xmit & BT878_I2C_NOSTOP))
-			printk(" >\n");
-	}
-
-	for (cnt = 1; cnt < msg->len; cnt++ ) {
-		/* following bytes */
-		xmit = (msg->buf[cnt] << 24) | I2C_HW | BT878_I2C_NOSTART;
-		if (cnt < msg->len-1 || !last)
-			xmit |= BT878_I2C_NOSTOP;
-		btwrite(xmit, BT848_I2C);
-		retval = bttv_i2c_wait_done(btv);
-		if (retval < 0)
-			goto err;
-		if (retval == 0)
-			goto eio;
-		if (i2c_debug) {
-			printk(" %02x", msg->buf[cnt]);
-			if (!(xmit & BT878_I2C_NOSTOP))
-				printk(" >\n");
-		}
-	}
-	return msg->len;
-
- eio:
-	retval = -EIO;
- err:
-	if (i2c_debug)
-		printk(" ERR: %d\n",retval);
-	return retval;
-}
-
-static int
-bttv_i2c_readbytes(struct bttv *btv, const struct i2c_msg *msg, int last)
-{
-	u32 xmit;
-	u32 cnt;
-	int retval;
-
-	for(cnt = 0; cnt < msg->len; cnt++) {
-		xmit = (msg->addr << 25) | (1 << 24) | I2C_HW;
-		if (cnt < msg->len-1)
-			xmit |= BT848_I2C_W3B;
-		if (cnt < msg->len-1 || !last)
-			xmit |= BT878_I2C_NOSTOP;
-		if (cnt)
-			xmit |= BT878_I2C_NOSTART;
-		btwrite(xmit, BT848_I2C);
-		retval = bttv_i2c_wait_done(btv);
-		if (retval < 0)
-			goto err;
-		if (retval == 0)
-			goto eio;
-		msg->buf[cnt] = ((u32)btread(BT848_I2C) >> 8) & 0xff;
-		if (i2c_debug) {
-			if (!(xmit & BT878_I2C_NOSTART))
-				printk(" <R %02x", (msg->addr << 1) +1);
-			printk(" =%02x", msg->buf[cnt]);
-			if (!(xmit & BT878_I2C_NOSTOP))
-				printk(" >\n");
-		}
-	}
-	return msg->len;
-
- eio:
-	retval = -EIO;
- err:
-	if (i2c_debug)
-		printk(" ERR: %d\n",retval);
-       	return retval;
-}
-
-int bttv_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
-{
-	struct bttv *btv = i2c_get_adapdata(i2c_adap);
-	int retval = 0;
-	int i;
-
-	if (i2c_debug)
-		printk("bt-i2c:");
-	btwrite(BT848_INT_I2CDONE|BT848_INT_RACK, BT848_INT_STAT);
-	for (i = 0 ; i < num; i++) {
-		if (msgs[i].flags & I2C_M_RD) {
-			/* read */
-			retval = bttv_i2c_readbytes(btv, &msgs[i], i+1 == num);
-			if (retval < 0)
-				goto err;
-		} else {
-			/* write */
-			retval = bttv_i2c_sendbytes(btv, &msgs[i], i+1 == num);
-			if (retval < 0)
-				goto err;
-		}
-	}
-	return num;
-
- err:
-	return retval;
-}
-
-static struct i2c_algorithm bttv_algo = {
-	.name          = "bt878",
-	.id            = I2C_ALGO_BIT | I2C_HW_B_BT848 /* FIXME */,
-	.master_xfer   = bttv_i2c_xfer,
-	.algo_control  = algo_control,
-	.functionality = functionality,
-};
-
-static struct i2c_adapter bttv_i2c_adap_hw_template = {
-#ifdef I2C_PEC
-	.owner         = THIS_MODULE,
-#else
-	.inc_use       = bttv_inc_use,
-	.dec_use       = bttv_dec_use,
-#endif
-#ifdef I2C_ADAP_CLASS_TV_ANALOG
-	.class         = I2C_ADAP_CLASS_TV_ANALOG,
-#endif
-	I2C_DEVNAME("bt878"),
-	.id            = I2C_ALGO_BIT | I2C_HW_B_BT848 /* FIXME */,
-	.algo          = &bttv_algo,
-	.client_register = attach_inform,
-};
-
-/* ----------------------------------------------------------------------- */
-/* I2C functions - common stuff                                            */
-
-#ifndef I2C_PEC
-static void bttv_inc_use(struct i2c_adapter *adap)
-{
-	MOD_INC_USE_COUNT;
-}
-
-static void bttv_dec_use(struct i2c_adapter *adap)
-{
-	MOD_DEC_USE_COUNT;
-}
-#endif
-
-static int attach_inform(struct i2c_client *client)
-{
-        struct bttv *btv = i2c_get_adapdata(client->adapter);
-
-	if (btv->tuner_type != UNSET)
-		bttv_call_i2c_clients(btv,TUNER_SET_TYPE,&btv->tuner_type);
-	if (btv->pinnacle_id != UNSET)
-		bttv_call_i2c_clients(btv,AUDC_CONFIG_PINNACLE,
-				      &btv->pinnacle_id);
-
-        if (bttv_debug)
-		printk("bttv%d: i2c attach [client=%s]\n",
-		       btv->nr, i2c_clientname(client));
-        return 0;
-}
-
-void bttv_call_i2c_clients(struct bttv *btv, unsigned int cmd, void *arg)
-{
-	if (0 != btv->i2c_rc)
-		return;
-	i2c_clients_command(&btv->i2c_adap, cmd, arg);
-}
-
-void bttv_i2c_call(unsigned int card, unsigned int cmd, void *arg)
-{
-	if (card >= bttv_num)
-		return;
-	bttv_call_i2c_clients(&bttvs[card], cmd, arg);
-}
-
-static struct i2c_client bttv_i2c_client_template = {
-	I2C_DEVNAME("bttv internal"),
-        .id       = -1,
-};
-
-
-/* read I2C */
-int bttv_I2CRead(struct bttv *btv, unsigned char addr, char *probe_for) 
-{
-        unsigned char buffer = 0;
-
-	if (0 != btv->i2c_rc)
-		return -1;
-	if (bttv_verbose && NULL != probe_for)
-		printk(KERN_INFO "bttv%d: i2c: checking for %s @ 0x%02x... ",
-		       btv->nr,probe_for,addr);
-        btv->i2c_client.addr = addr >> 1;
-        if (1 != i2c_master_recv(&btv->i2c_client, &buffer, 1)) {
-		if (NULL != probe_for) {
-			if (bttv_verbose)
-				printk("not found\n");
-		} else
-			printk(KERN_WARNING "bttv%d: i2c read 0x%x: error\n",
-			       btv->nr,addr);
-                return -1;
-	}
-	if (bttv_verbose && NULL != probe_for)
-		printk("found\n");
-        return buffer;
-}
-
-/* write I2C */
-int bttv_I2CWrite(struct bttv *btv, unsigned char addr, unsigned char b1,
-                    unsigned char b2, int both)
-{
-        unsigned char buffer[2];
-        int bytes = both ? 2 : 1;
-
-	if (0 != btv->i2c_rc)
-		return -1;
-        btv->i2c_client.addr = addr >> 1;
-        buffer[0] = b1;
-        buffer[1] = b2;
-        if (bytes != i2c_master_send(&btv->i2c_client, buffer, bytes))
-		return -1;
-        return 0;
-}
-
-/* read EEPROM content */
-void __devinit bttv_readee(struct bttv *btv, unsigned char *eedata, int addr)
-{
-	int i;
-        
-	if (bttv_I2CWrite(btv, addr, 0, -1, 0)<0) {
-		printk(KERN_WARNING "bttv: readee error\n");
-		return;
-	}
-	btv->i2c_client.addr = addr >> 1;
-	for (i=0; i<256; i+=16) {
-		if (16 != i2c_master_recv(&btv->i2c_client,eedata+i,16)) {
-			printk(KERN_WARNING "bttv: readee error\n");
-			break;
-		}
-	}
-}
-
-/* init + register i2c algo-bit adapter */
-int __devinit init_bttv_i2c(struct bttv *btv)
-{
-	int use_hw = (btv->id == 878) && i2c_hw;
-
-	memcpy(&btv->i2c_client, &bttv_i2c_client_template,
-	       sizeof(bttv_i2c_client_template));
-
-	if (use_hw) {
-		/* bt878 */
-		memcpy(&btv->i2c_adap, &bttv_i2c_adap_hw_template,
-		       sizeof(bttv_i2c_adap_hw_template));
-	} else {
-		/* bt848 */
-		memcpy(&btv->i2c_adap, &bttv_i2c_adap_sw_template,
-		       sizeof(bttv_i2c_adap_sw_template));
-		memcpy(&btv->i2c_algo, &bttv_i2c_algo_bit_template,
-		       sizeof(bttv_i2c_algo_bit_template));
-		btv->i2c_algo.data = btv;
-		btv->i2c_adap.algo_data = &btv->i2c_algo;
-	}
-
-	btv->i2c_adap.dev.parent = &btv->dev->dev;
-	snprintf(btv->i2c_adap.name, sizeof(btv->i2c_adap.name),
-		 "bt%d #%d [%s]", btv->id, btv->nr, use_hw ? "hw" : "sw");
-
-        i2c_set_adapdata(&btv->i2c_adap, btv);
-        btv->i2c_client.adapter = &btv->i2c_adap;
-
-	if (use_hw) {
-		btv->i2c_rc = i2c_add_adapter(&btv->i2c_adap);
-	} else {
-		bttv_bit_setscl(btv,1);
-		bttv_bit_setsda(btv,1);
-		btv->i2c_rc = i2c_bit_add_bus(&btv->i2c_adap);
-	}
-	return btv->i2c_rc;
-}
-
-int __devexit fini_bttv_i2c(struct bttv *btv)
-{
-	int use_hw = (btv->id == 878) && i2c_hw;
-
-	if (0 != btv->i2c_rc)
-		return 0;
-
-	if (use_hw) {
-		return i2c_del_adapter(&btv->i2c_adap);
-	} else {
-		return i2c_bit_del_bus(&btv->i2c_adap);
-	}
 }
 
 /*
diff -Nru a/drivers/media/video/bttv-risc.c b/drivers/media/video/bttv-risc.c
--- a/drivers/media/video/bttv-risc.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/media/video/bttv-risc.c	Tue Feb  3 19:45:18 2004
@@ -5,7 +5,7 @@
 	- memory management
 	- generation
 
-    (c) 2000 Gerd Knorr <kraxel@bytesex.org>
+    (c) 2000-2003 Gerd Knorr <kraxel@bytesex.org>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -53,7 +53,7 @@
 	   one write per scan line + sync + jump (all 2 dwords) */
 	instructions  = (bpl * lines) / PAGE_SIZE + lines;
 	instructions += 2;
-	if ((rc = btcx_riscmem_alloc(btv->dev,risc,instructions*8)) < 0)
+	if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,instructions*8)) < 0)
 		return rc;
 
 	/* sync instruction */
@@ -67,7 +67,7 @@
 		if ((btv->opt_vcr_hack) &&
 		    (line >= (lines - VCR_HACK_LINES)))
 			continue;
-		while (offset >= sg_dma_len(sg)) {
+		while (offset && offset >= sg_dma_len(sg)) {
 			offset -= sg_dma_len(sg);
 			sg++;
 		}
@@ -100,7 +100,7 @@
 		}
 		offset += padding;
 	}
-	dprintk("bttv%d: risc planar: %d sglist elems\n", btv->nr, (int)(sg-sglist));
+	dprintk("bttv%d: risc planar: %d sglist elems\n", btv->c.nr, (int)(sg-sglist));
 
 	/* save pointer to jmp instruction address */
 	risc->jmp = rp;
@@ -128,7 +128,7 @@
 	   plus sync + jump (2 dwords) */
 	instructions  = (ybpl * ylines * 2) / PAGE_SIZE + ylines;
 	instructions += 2;
-	if ((rc = btcx_riscmem_alloc(btv->dev,risc,instructions*4*5)) < 0)
+	if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,instructions*4*5)) < 0)
 		return rc;
 
 	/* sync instruction */
@@ -152,15 +152,15 @@
 		}
 		for (todo = ybpl; todo > 0; todo -= ylen) {
 			/* go to next sg entry if needed */
-			while (yoffset >= sg_dma_len(ysg)) {
+			while (yoffset && yoffset >= sg_dma_len(ysg)) {
 				yoffset -= sg_dma_len(ysg);
 				ysg++;
 			}
-			while (uoffset >= sg_dma_len(usg)) {
+			while (uoffset && uoffset >= sg_dma_len(usg)) {
 				uoffset -= sg_dma_len(usg);
 				usg++;
 			}
-			while (voffset >= sg_dma_len(vsg)) {
+			while (voffset && voffset >= sg_dma_len(vsg)) {
 				voffset -= sg_dma_len(vsg);
 				vsg++;
 			}
@@ -227,7 +227,7 @@
 	instructions  = (ov->nclips + 1) *
 		((skip_even || skip_odd) ? ov->w.height>>1 :  ov->w.height);
 	instructions += 2;
-	if ((rc = btcx_riscmem_alloc(btv->dev,risc,instructions*8)) < 0) {
+	if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,instructions*8)) < 0) {
 		kfree(skips);
 		return rc;
 	}
@@ -247,9 +247,6 @@
 		if ((btv->opt_vcr_hack) &&
 		     (line >= (ov->w.height - VCR_HACK_LINES)))
 			continue;
- 		if ((line%2) == 0  &&  skip_even)
- 			continue;
- 		if ((line%2) == 1  &&  skip_odd)
 		if ((line%2) == 0  &&  skip_even)
 			continue;
 		if ((line%2) == 1  &&  skip_odd)
@@ -310,7 +307,7 @@
 	int totalwidth   = tvnorm->totalwidth;
 	int scaledtwidth = tvnorm->scaledtwidth;
 
-	if (bttv_tvcards[btv->type].muxsel[btv->input] < 0) {
+	if (bttv_tvcards[btv->c.type].muxsel[btv->input] < 0) {
 		swidth       = 720;
 		totalwidth   = 858;
 		scaledtwidth = 858;
@@ -391,7 +388,7 @@
 
 	d2printk(KERN_DEBUG
 		 "bttv%d: capctl=%x irq=%d top=%08Lx/%08Lx even=%08Lx/%08Lx\n",
-		 btv->nr,capctl,irqflags,
+		 btv->c.nr,capctl,irqflags,
 		 btv->curr.vbi     ? (unsigned long long)btv->curr.vbi->top.dma        : 0,
 		 btv->curr.top     ? (unsigned long long)btv->curr.top->top.dma        : 0,
 		 btv->curr.vbi     ? (unsigned long long)btv->curr.vbi->bottom.dma     : 0,
@@ -429,10 +426,10 @@
 {
 	int rc;
 	
-	if ((rc = btcx_riscmem_alloc(btv->dev,&btv->main,PAGE_SIZE)) < 0)
+	if ((rc = btcx_riscmem_alloc(btv->c.pci,&btv->main,PAGE_SIZE)) < 0)
 		return rc;
 	dprintk(KERN_DEBUG "bttv%d: risc main @ %08Lx\n",
-		btv->nr,(unsigned long long)btv->main.dma);
+		btv->c.nr,(unsigned long long)btv->main.dma);
 
 	btv->main.cpu[0] = cpu_to_le32(BT848_RISC_SYNC | BT848_RISC_RESYNC |
 				       BT848_FIFO_STATUS_VRE);
@@ -472,11 +469,11 @@
 
 	if (NULL == risc) {
 		d2printk(KERN_DEBUG "bttv%d: risc=%p slot[%d]=NULL\n",
-			 btv->nr,risc,slot);
+			 btv->c.nr,risc,slot);
 		btv->main.cpu[slot+1] = cpu_to_le32(next);
 	} else {
 		d2printk(KERN_DEBUG "bttv%d: risc=%p slot[%d]=%08Lx irq=%d\n",
-			 btv->nr,risc,slot,(unsigned long long)risc->dma,irqflags);
+			 btv->c.nr,risc,slot,(unsigned long long)risc->dma,irqflags);
 		cmd = BT848_RISC_JUMP;
 		if (irqflags) {
 			cmd |= BT848_RISC_IRQ;
@@ -496,10 +493,10 @@
 	if (in_interrupt())
 		BUG();
 	videobuf_waiton(&buf->vb,0,0);
-	videobuf_dma_pci_unmap(btv->dev, &buf->vb.dma);
+	videobuf_dma_pci_unmap(btv->c.pci, &buf->vb.dma);
 	videobuf_dma_free(&buf->vb.dma);
-	btcx_riscmem_free(btv->dev,&buf->bottom);
-	btcx_riscmem_free(btv->dev,&buf->top);
+	btcx_riscmem_free(btv->c.pci,&buf->bottom);
+	btcx_riscmem_free(btv->c.pci,&buf->top);
 	buf->vb.state = STATE_NEEDS_INIT;
 }
 
@@ -577,7 +574,7 @@
 
 	dprintk(KERN_DEBUG
 		"bttv%d: buffer field: %s  format: %s  size: %dx%d\n",
-		btv->nr, v4l2_field_names[buf->vb.field],
+		btv->c.nr, v4l2_field_names[buf->vb.field],
 		buf->fmt->name, buf->vb.width, buf->vb.height);
 
 	/* packed pixel modes */
@@ -731,7 +728,7 @@
 	/* check interleave, bottom+top fields */
 	dprintk(KERN_DEBUG
 		"bttv%d: overlay fields: %s format: %s  size: %dx%d\n",
-		btv->nr, v4l2_field_names[buf->vb.field],
+		btv->c.nr, v4l2_field_names[buf->vb.field],
 		fmt->name,ov->w.width,ov->w.height);
 
 	/* calculate geometry */
diff -Nru a/drivers/media/video/bttv-vbi.c b/drivers/media/video/bttv-vbi.c
--- a/drivers/media/video/bttv-vbi.c	Tue Feb  3 19:45:33 2004
+++ b/drivers/media/video/bttv-vbi.c	Tue Feb  3 19:45:33 2004
@@ -44,7 +44,7 @@
 # undef dprintk
 #endif
 #define dprintk(fmt, arg...)	if (vbi_debug) \
-	printk(KERN_DEBUG "bttv%d/vbi: " fmt, btv->nr, ## arg)
+	printk(KERN_DEBUG "bttv%d/vbi: " fmt, btv->c.nr , ## arg)
 
 /* ----------------------------------------------------------------------- */
 /* vbi risc code + mm                                                      */
@@ -87,7 +87,7 @@
 		return -EINVAL;
 
 	if (STATE_NEEDS_INIT == buf->vb.state) {
-		if (0 != (rc = videobuf_iolock(btv->dev, &buf->vb, NULL)))
+		if (0 != (rc = videobuf_iolock(btv->c.pci, &buf->vb, NULL)))
 			goto fail;
 		if (0 != (rc = vbi_buffer_risc(btv,buf,fh->lines)))
 			goto fail;
diff -Nru a/drivers/media/video/bttv.h b/drivers/media/video/bttv.h
--- a/drivers/media/video/bttv.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/video/bttv.h	Tue Feb  3 19:45:17 2004
@@ -14,6 +14,7 @@
 #define _BTTV_H_
 
 #include <linux/videodev.h>
+#include <linux/i2c.h>
 
 /* ---------------------------------------------------------- */
 /* exported by bttv-cards.c                                   */
@@ -117,6 +118,12 @@
 #define BTTV_PV143          0x69
 #define BTTV_IVC100         0x6e
 #define BTTV_IVC120         0x6f
+#define BTTV_PC_HDTV        0x70
+#define BTTV_TWINHAN_DST    0x71
+#define BTTV_WINFASTVC100   0x72
+#define BTTV_SIMUS_GVC1100  0x74
+#define BTTV_NGSTV_PLUS     0x75
+#define BTTV_LMLBT4         0x76
 
 /* i2c address list */
 #define I2C_TSA5522        0xc2
@@ -150,6 +157,18 @@
 #define DIGITAL_MODE_VIDEO 1
 #define DIGITAL_MODE_CAMERA 2
 
+struct bttv_core {
+	/* device structs */
+	struct pci_dev       *pci;
+	struct i2c_adapter   i2c_adap;
+	struct list_head     subs;     /* struct bttv_sub_device */
+
+	/* device config */
+        unsigned int         nr;       /* dev nr (for printk("bttv%d: ...");  */
+	unsigned int         type;     /* card type (pointer into tvcards[])  */
+	char                 name[8];  /* dev name */
+};
+
 struct bttv;
 
 struct tvcard
@@ -173,7 +192,10 @@
 	unsigned int msp34xx_alt:1;
 
 	/* flag: video pci function is unused */
-	unsigned int no_video;
+	unsigned int no_video:1;
+	unsigned int has_dvb:1;
+	unsigned int has_remote:1;
+	unsigned int no_gpioirq:1;
 
 	/* other settings */
 	unsigned int pll;
@@ -208,7 +230,9 @@
 
 /* ---------------------------------------------------------- */
 /* exported by bttv-if.c                                      */
-/* interface for gpio access by other modules                 */
+
+/* this obsolete -- please use the sysfs-based
+   interface below for new code */
 
 /* returns card type + card ID (for bt878-based ones)
    for possible values see lines below beginning with #define BTTV_UNKNOWN
@@ -256,7 +280,43 @@
 extern void bttv_i2c_call(unsigned int card, unsigned int cmd, void *arg);
 
 
-/* i2c */
+
+/* ---------------------------------------------------------- */
+/* sysfs/driver-moded based gpio access interface             */
+
+
+struct bttv_sub_device {
+	struct device    dev;
+	struct bttv_core *core;
+	struct list_head list;
+};
+#define to_bttv_sub_dev(x) container_of((x), struct bttv_sub_device, dev)
+
+struct bttv_sub_driver {
+	struct device_driver   drv;
+	char                   wanted[BUS_ID_SIZE];
+	void                   (*gpio_irq)(struct bttv_sub_device *sub);
+};
+#define to_bttv_sub_drv(x) container_of((x), struct bttv_sub_driver, drv)
+
+int bttv_sub_register(struct bttv_sub_driver *drv, char *wanted);
+int bttv_sub_unregister(struct bttv_sub_driver *drv);
+
+/* gpio access functions */
+void bttv_gpio_inout(struct bttv_core *core, u32 mask, u32 outbits);
+u32 bttv_gpio_read(struct bttv_core *core);
+void bttv_gpio_write(struct bttv_core *core, u32 value);
+void bttv_gpio_bits(struct bttv_core *core, u32 mask, u32 bits);
+
+#define gpio_inout(mask,bits)  bttv_gpio_inout(&btv->c, mask, bits)
+#define gpio_read()            bttv_gpio_read(&btv->c)
+#define gpio_write(value)      bttv_gpio_write(&btv->c, value)
+#define gpio_bits(mask,bits)   bttv_gpio_bits(&btv->c, mask, bits)
+
+
+/* ---------------------------------------------------------- */
+/* i2c                                                        */
+
 extern void bttv_bit_setscl(void *data, int state);
 extern void bttv_bit_setsda(void *data, int state);
 extern void bttv_call_i2c_clients(struct bttv *btv, unsigned int cmd, void *arg);
diff -Nru a/drivers/media/video/bttvp.h b/drivers/media/video/bttvp.h
--- a/drivers/media/video/bttvp.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/video/bttvp.h	Tue Feb  3 19:45:17 2004
@@ -41,13 +41,11 @@
 #include <media/video-buf.h>
 #include <media/audiochip.h>
 #include <media/tuner.h>
+#include <media/ir-common.h>
 
 #include "bt848.h"
 #include "bttv.h"
 #include "btcx-risc.h"
-#ifdef CONFIG_VIDEO_IR
-#include "ir-common.h"
-#endif
 
 #ifdef __KERNEL__
 
@@ -219,11 +217,14 @@
 extern struct videobuf_queue_ops bttv_vbi_qops;
 
 /* ---------------------------------------------------------- */
-/* bttv-input.c                                               */
+/* bttv-gpio.c */
+
+
+extern struct bus_type bttv_sub_bus_type;
+int bttv_sub_add_device(struct bttv_core *core, char *name);
+int bttv_sub_del_devices(struct bttv_core *core);
+void bttv_gpio_irq(struct bttv_core *core);
 
-int bttv_input_init(struct bttv *btv);
-void bttv_input_fini(struct bttv *btv);
-void bttv_input_irq(struct bttv *btv);
 
 /* ---------------------------------------------------------- */
 /* bttv-driver.c                                              */
@@ -263,7 +264,6 @@
 	unsigned int pll_current;  /* Currently programmed ofreq */
 };
 
-#ifdef CONFIG_VIDEO_IR
 /* for gpio-connected remote control */
 struct bttv_input {
 	struct input_dev      dev;
@@ -273,36 +273,46 @@
 	u32                   mask_keycode;
 	u32                   mask_keydown;
 };
-#endif
+
+struct bttv_suspend_state {
+	u32  pci_cfg[64 / sizeof(u32)];
+	u32  gpio_enable;
+	u32  gpio_data;
+	int  disabled;
+	struct bttv_buffer_set set;
+};
 
 struct bttv {
+	struct bttv_core c;
+
 	/* pci device config */
-	struct pci_dev *dev;
 	unsigned short id;
 	unsigned char revision;
 	unsigned char *bt848_mmio;   /* pointer to mmio */
 
 	/* card configuration info */
-        unsigned int nr;       /* dev nr (for printk("bttv%d: ...");  */
-	char name[8];          /* dev name */
 	unsigned int cardid;   /* pci subsystem id (bt878 based ones) */
-	unsigned int type;     /* card type (pointer into tvcards[])  */
         unsigned int tuner_type;  /* tuner chip type */
         unsigned int pinnacle_id;
 	unsigned int svhs;
 	struct bttv_pll_info pll;
 	int triton1;
+	int gpioirq;
 
-	/* gpio interface */
+	/* old gpio interface */
 	wait_queue_head_t gpioq;
 	int shutdown;
 	void (*audio_hook)(struct bttv *btv, struct video_audio *v, int set);
-	
+
+	/* new gpio interface */
+	spinlock_t gpio_lock;
+
 	/* i2c layer */
-	struct i2c_adapter         i2c_adap;
 	struct i2c_algo_bit_data   i2c_algo;
 	struct i2c_client          i2c_client;
 	int                        i2c_state, i2c_rc;
+	int                        i2c_done;
+	wait_queue_head_t          i2c_queue;
 
 	/* video4linux (1) */
 	struct video_device *video_dev;
@@ -311,9 +321,7 @@
 
 	/* infrared remote */
 	int has_remote;
-#ifdef CONFIG_VIDEO_IR
 	struct bttv_input *remote;
-#endif
 
 	/* locking */
 	spinlock_t s_lock;
@@ -339,6 +347,8 @@
 	int opt_chroma_agc;
 	int opt_adc_crush;
 	int opt_vcr_hack;
+	int opt_whitecrush_upper;
+	int opt_whitecrush_lower;
 
 	/* radio data/state */
 	int has_radio;
@@ -371,6 +381,11 @@
 	unsigned long cap_ctl;
 	unsigned long dma_on;
 	struct timer_list timeout;
+	struct bttv_suspend_state state;
+
+	/* stats */
+	unsigned int irq_total;
+	unsigned int irq_me;
 	unsigned int errors;
 
 	unsigned int users;
diff -Nru a/drivers/media/video/cx88/Makefile b/drivers/media/video/cx88/Makefile
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/video/cx88/Makefile	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,6 @@
+cx88xx-objs	:= cx88-cards.o cx88-core.o
+cx8800-objs	:= cx88-video.o cx88-tvaudio.o cx88-i2c.o
+
+obj-$(CONFIG_VIDEO_CX88) += cx88xx.o cx8800.o
+
+EXTRA_CFLAGS = -I$(src)/..
diff -Nru a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/video/cx88/cx88-cards.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,396 @@
+/*
+ * device driver for Conexant 2388x based TV cards
+ * card-specific stuff.
+ *
+ * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+
+#include "cx88.h"
+
+/* ------------------------------------------------------------------ */
+/* board config info                                                  */
+
+struct cx88_board cx88_boards[] = {
+	[CX88_BOARD_UNKNOWN] = {
+		.name		= "UNKNOWN/GENERIC",
+		.tuner_type     = UNSET,
+		.input          = {{
+			.type   = CX88_VMUX_COMPOSITE1,
+			.vmux   = 0,
+		},{
+			.type   = CX88_VMUX_COMPOSITE2,
+			.vmux   = 1,
+		},{
+			.type   = CX88_VMUX_COMPOSITE3,
+			.vmux   = 2,
+		},{
+			.type   = CX88_VMUX_COMPOSITE4,
+			.vmux   = 3,
+		}},
+	},
+	[CX88_BOARD_HAUPPAUGE] = {
+		.name		= "Hauppauge WinTV 34xxx models",
+		.tuner_type     = UNSET,
+		.input          = {{
+			.type   = CX88_VMUX_TELEVISION,
+			.vmux   = 0,
+			//.gpio0  = 0xff03,
+			.gpio0  = 0xff01,
+		},{
+			.type   = CX88_VMUX_DEBUG,
+			.vmux   = 0,
+			.gpio0  = 0xff00,
+		},{
+			.type   = CX88_VMUX_COMPOSITE1,
+			.vmux   = 1,
+			.gpio0  = 0xff02,
+		}},
+		.radio = {
+			.type   = CX88_RADIO,
+			.gpio0  = 0xff01,
+		},
+	},
+	[CX88_BOARD_GDI] = {
+		.name		= "GDI Black Gold",
+		.tuner_type     = UNSET,
+		.input          = {{
+			.type   = CX88_VMUX_TELEVISION,
+			.vmux   = 0,
+		}},
+	},
+	[CX88_BOARD_PIXELVIEW] = {
+		.name           = "PixelView",
+		.tuner_type     = UNSET,
+		.input          = {{
+			.type   = CX88_VMUX_TELEVISION,
+			.vmux   = 0,
+		},{
+			.type   = CX88_VMUX_COMPOSITE1,
+			.vmux   = 1,
+		},{
+			.type   = CX88_VMUX_SVIDEO,
+			.vmux   = 2,
+		}},
+	},
+	[CX88_BOARD_ATI_WONDER_PRO] = {
+		.name           = "ATI TV Wonder Pro",
+		.tuner_type     = UNSET,
+		.input          = {{
+			.type   = CX88_VMUX_TELEVISION,
+			.vmux   = 0,
+		}},
+	},
+        [CX88_BOARD_WINFAST2000XP] = {
+                .name           = "Leadtek Winfast 2000XP Expert",
+                .tuner_type     = 38,
+                .input          = {{
+                        .type   = CX88_VMUX_TELEVISION,
+                        .vmux   = 0,
+                }},
+                .radio = {
+                        .type   = CX88_RADIO,
+                },
+        },
+	[CX88_BOARD_AVERTV_303] = {
+		.name           = "AverTV Studio 303 (M126)",
+		.tuner_type     = TUNER_PHILIPS_PAL_DK,
+		.input          = {{
+			.type   = CX88_VMUX_TELEVISION,
+			.vmux   = 0,
+		}},
+	},
+	[CX88_BOARD_MSI_TVANYWHERE] = {
+		.name           = "MSI TV-@nywhere Master",
+		.tuner_type     = 33,
+		.input          = {{
+			.type   = CX88_VMUX_TELEVISION,
+			.vmux   = 0,
+		},{
+                        .type   = CX88_VMUX_COMPOSITE1,
+                        .vmux   = 1,
+		},{
+                        .type   = CX88_VMUX_SVIDEO,
+                        .vmux   = 2,
+                }},
+                .radio = {
+                        .type   = CX88_RADIO,
+                },
+	},
+	[CX88_BOARD_WINFAST_DV2000] = {
+                .name           = "Leadtek Winfast DV2000",
+                .tuner_type     = 38,
+                .input          = {{
+                        .type   = CX88_VMUX_TELEVISION,
+                        .vmux   = 0,
+                }},
+                .radio = {
+                        .type   = CX88_RADIO,
+                },
+        },
+
+};
+const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
+
+/* ------------------------------------------------------------------ */
+/* PCI subsystem IDs                                                  */
+
+struct cx88_subid cx88_subids[] = {
+	{
+		.subvendor = 0x0070,
+		.subdevice = 0x3400,
+		.card      = CX88_BOARD_HAUPPAUGE,
+	},{
+		.subvendor = 0x0070,
+		.subdevice = 0x3401,
+		.card      = CX88_BOARD_HAUPPAUGE,
+	},{
+		.subvendor = 0x14c7,
+		.subdevice = 0x0106,
+		.card      = CX88_BOARD_GDI,
+	},{
+		.subvendor = 0x14c7,
+		.subdevice = 0x0107, /* with mpeg encoder */
+		.card      = CX88_BOARD_GDI,
+	},{
+		.subvendor = PCI_VENDOR_ID_ATI,
+		.subdevice = 0x00f8,
+		.card      = CX88_BOARD_ATI_WONDER_PRO,
+	},{
+                .subvendor = 0x107d,
+                .subdevice = 0x6611,
+                .card      = CX88_BOARD_WINFAST2000XP,
+	},{
+		.subvendor = 0x107d,
+                .subdevice = 0x6620,
+                .card      = CX88_BOARD_WINFAST_DV2000,
+        },{
+		.subvendor = 0x1461,
+		.subdevice = 0x000b,
+		.card      = CX88_BOARD_AVERTV_303,
+	},{
+		.subvendor = 0x1462,
+		.subdevice = 0x8606,
+		.card      = CX88_BOARD_MSI_TVANYWHERE,
+	}
+};
+const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
+
+/* ----------------------------------------------------------------------- */
+/* some hauppauge specific stuff                                           */
+
+static struct {
+        int  id;
+        char *name;
+} hauppauge_tuner[] __devinitdata = {
+        { TUNER_ABSENT,        "" },
+        { TUNER_ABSENT,        "External" },
+        { TUNER_ABSENT,        "Unspecified" },
+        { TUNER_PHILIPS_PAL,   "Philips FI1216" },
+        { TUNER_PHILIPS_SECAM, "Philips FI1216MF" },
+        { TUNER_PHILIPS_NTSC,  "Philips FI1236" },
+        { TUNER_PHILIPS_PAL_I, "Philips FI1246" },
+        { TUNER_PHILIPS_PAL_DK,"Philips FI1256" },
+        { TUNER_PHILIPS_PAL,   "Philips FI1216 MK2" },
+        { TUNER_PHILIPS_SECAM, "Philips FI1216MF MK2" },
+        { TUNER_PHILIPS_NTSC,  "Philips FI1236 MK2" },
+        { TUNER_PHILIPS_PAL_I, "Philips FI1246 MK2" },
+        { TUNER_PHILIPS_PAL_DK,"Philips FI1256 MK2" },
+        { TUNER_TEMIC_NTSC,    "Temic 4032FY5" },
+        { TUNER_TEMIC_PAL,     "Temic 4002FH5" },
+        { TUNER_TEMIC_PAL_I,   "Temic 4062FY5" },
+        { TUNER_PHILIPS_PAL,   "Philips FR1216 MK2" },
+        { TUNER_PHILIPS_SECAM, "Philips FR1216MF MK2" },
+        { TUNER_PHILIPS_NTSC,  "Philips FR1236 MK2" },
+        { TUNER_PHILIPS_PAL_I, "Philips FR1246 MK2" },
+        { TUNER_PHILIPS_PAL_DK,"Philips FR1256 MK2" },
+        { TUNER_PHILIPS_PAL,   "Philips FM1216" },
+        { TUNER_PHILIPS_SECAM, "Philips FM1216MF" },
+        { TUNER_PHILIPS_NTSC,  "Philips FM1236" },
+        { TUNER_PHILIPS_PAL_I, "Philips FM1246" },
+        { TUNER_PHILIPS_PAL_DK,"Philips FM1256" },
+        { TUNER_TEMIC_4036FY5_NTSC, "Temic 4036FY5" },
+        { TUNER_ABSENT,        "Samsung TCPN9082D" },
+        { TUNER_ABSENT,        "Samsung TCPM9092P" },
+        { TUNER_TEMIC_4006FH5_PAL, "Temic 4006FH5" },
+        { TUNER_ABSENT,        "Samsung TCPN9085D" },
+        { TUNER_ABSENT,        "Samsung TCPB9085P" },
+        { TUNER_ABSENT,        "Samsung TCPL9091P" },
+        { TUNER_TEMIC_4039FR5_NTSC, "Temic 4039FR5" },
+        { TUNER_PHILIPS_FQ1216ME,   "Philips FQ1216 ME" },
+        { TUNER_TEMIC_4066FY5_PAL_I, "Temic 4066FY5" },
+        { TUNER_PHILIPS_NTSC,        "Philips TD1536" },
+        { TUNER_PHILIPS_NTSC,        "Philips TD1536D" },
+	{ TUNER_PHILIPS_NTSC,  "Philips FMR1236" }, /* mono radio */
+        { TUNER_ABSENT,        "Philips FI1256MP" },
+        { TUNER_ABSENT,        "Samsung TCPQ9091P" },
+        { TUNER_TEMIC_4006FN5_MULTI_PAL, "Temic 4006FN5" },
+        { TUNER_TEMIC_4009FR5_PAL, "Temic 4009FR5" },
+        { TUNER_TEMIC_4046FM5,     "Temic 4046FM5" },
+	{ TUNER_TEMIC_4009FN5_MULTI_PAL_FM, "Temic 4009FN5" },
+	{ TUNER_ABSENT,        "Philips TD1536D_FH_44"},
+	{ TUNER_LG_NTSC_FM,    "LG TPI8NSR01F"},
+	{ TUNER_LG_PAL_FM,     "LG TPI8PSB01D"},
+	{ TUNER_LG_PAL,        "LG TPI8PSB11D"},	
+	{ TUNER_LG_PAL_I_FM,   "LG TAPC-I001D"},
+	{ TUNER_LG_PAL_I,      "LG TAPC-I701D"}
+};
+
+static void __devinit hauppauge_eeprom(struct cx8800_dev *dev, u8 *eeprom_data)
+{
+	unsigned int blk2,tuner,radio,model;
+
+	if (eeprom_data[0] != 0x84 || eeprom_data[2] != 0) {
+		printk(KERN_WARNING "%s: Hauppauge eeprom: invalid\n",
+		       dev->name);
+		return;
+	}
+
+	/* Block 2 starts after len+3 bytes header */
+	blk2 = eeprom_data[1] + 3;
+
+	/* decode + use some config infos */
+	model = eeprom_data[12] << 8 | eeprom_data[11];
+	tuner = eeprom_data[9];
+	radio = eeprom_data[blk2-1] & 0x01;
+	
+        if (tuner < ARRAY_SIZE(hauppauge_tuner))
+                dev->tuner_type = hauppauge_tuner[tuner].id;
+	if (radio)
+		dev->has_radio = 1;
+	
+	printk(KERN_INFO "%s: hauppauge eeprom: model=%d, "
+	       "tuner=%s (%d), radio=%s\n",
+	       dev->name, model, hauppauge_tuner[tuner].name,
+	       dev->tuner_type, radio ? "yes" : "no");
+}
+
+/* ----------------------------------------------------------------------- */
+/* some GDI (was: Modular Technology) specific stuff                       */
+
+static struct {
+	int  id;
+	int  fm;
+	char *name;
+} gdi_tuner[] = {
+	[ 0x01 ] = { .id   = TUNER_ABSENT,
+		     .name = "NTSC_M" },
+	[ 0x02 ] = { .id   = TUNER_ABSENT,
+		     .name = "PAL_B" },
+	[ 0x03 ] = { .id   = TUNER_ABSENT,
+		     .name = "BAL_I" },
+	[ 0x04 ] = { .id   = TUNER_ABSENT,
+		     .name = "PAL_D" },
+	[ 0x05 ] = { .id   = TUNER_ABSENT,
+		     .name = "SECAM" },
+
+	[ 0x10 ] = { .id   = TUNER_ABSENT, .fm = 1, 
+		     .name = "TEMIC_4049" },
+	[ 0x11 ] = { .id   = TUNER_TEMIC_4136FY5,
+		     .name = "TEMIC_4136" },
+	[ 0x12 ] = { .id   = TUNER_ABSENT,
+		     .name = "TEMIC_4146" },
+
+	[ 0x20 ] = { .id   = TUNER_PHILIPS_FQ1216ME, .fm = 1,
+		     .name = "PHILIPS_FQ1216_MK3" },
+	[ 0x21 ] = { .id   = TUNER_ABSENT, .fm = 1,
+		     .name = "PHILIPS_FQ1236_MK3" },
+	[ 0x22 ] = { .id   = TUNER_ABSENT,
+		     .name = "PHILIPS_FI1236_MK3" },
+	[ 0x23 ] = { .id   = TUNER_ABSENT,
+		     .name = "PHILIPS_FI1216_MK3" },
+};
+
+static void __devinit gdi_eeprom(struct cx8800_dev *dev, u8 *eeprom_data)
+{
+	char *name = (eeprom_data[0x0d] < ARRAY_SIZE(gdi_tuner))
+		? gdi_tuner[eeprom_data[0x0d]].name : NULL;
+
+	printk(KERN_INFO "%s: GDI: tuner=%s\n", dev->name,
+	       name ? name : "unknown");
+	if (NULL == name)
+		return;
+	dev->tuner_type = gdi_tuner[eeprom_data[0x0d]].id;
+	dev->has_radio  = gdi_tuner[eeprom_data[0x0d]].fm;
+}
+
+/* ----------------------------------------------------------------------- */
+
+static int
+i2c_eeprom(struct i2c_client *c, unsigned char *eedata, int len)
+{
+	unsigned char buf;
+	int err;
+
+	c->addr = 0xa0 >> 1;
+	buf = 0;
+	if (1 != (err = i2c_master_send(c,&buf,1))) {
+		printk(KERN_INFO "cx88: Huh, no eeprom present (err=%d)?\n",
+		       err);
+		return -1;
+	}
+	if (len != (err = i2c_master_recv(c,eedata,len))) {
+		printk(KERN_WARNING "cx88: i2c eeprom read error (err=%d)\n",
+		       err);
+		return -1;
+	}
+#if 0
+	for (i = 0; i < len; i++) {
+		if (0 == (i % 16))
+			printk(KERN_INFO "cx88 ee: %02x:",i);
+		printk(" %02x",eedata[i]);
+		if (15 == (i % 16))
+			printk("\n");
+	}
+#endif
+	return 0;
+}
+
+void __devinit cx88_card_setup(struct cx8800_dev *dev)
+{
+	static u8 eeprom[128];
+		
+	switch (dev->board) {
+	case CX88_BOARD_HAUPPAUGE:
+		if (0 == dev->i2c_rc)
+			i2c_eeprom(&dev->i2c_client,eeprom,sizeof(eeprom));
+		hauppauge_eeprom(dev,eeprom+8);
+		break;
+	case CX88_BOARD_GDI:
+		if (0 == dev->i2c_rc)
+			i2c_eeprom(&dev->i2c_client,eeprom,sizeof(eeprom));
+		gdi_eeprom(dev,eeprom);
+		break;
+	}
+}
+
+/* ------------------------------------------------------------------ */
+
+EXPORT_SYMBOL(cx88_boards);
+EXPORT_SYMBOL(cx88_bcount);
+EXPORT_SYMBOL(cx88_subids);
+EXPORT_SYMBOL(cx88_idcount);
+EXPORT_SYMBOL(cx88_card_setup);
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff -Nru a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/video/cx88/cx88-core.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,612 @@
+/*
+ * device driver for Conexant 2388x based TV cards
+ * driver core
+ *
+ * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/init.h>
+#include <linux/list.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/slab.h>
+#include <linux/kmod.h>
+#include <linux/sound.h>
+#include <linux/interrupt.h>
+#include <linux/pci.h>
+#include <linux/videodev.h>
+
+#include "cx88.h"
+
+MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards");
+MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
+MODULE_LICENSE("GPL");
+
+/* ------------------------------------------------------------------ */
+
+#if 0
+static unsigned int gpio_tracking = 0;
+MODULE_PARM(gpio_tracking,"i");
+MODULE_PARM_DESC(gpio_tracking,"enable debug messages [gpio]");
+
+static unsigned int ts_nr = -1;
+MODULE_PARM(ts_nr,"i");
+MODULE_PARM_DESC(ts_nr,"ts device number");
+
+static unsigned int vbi_nr = -1;
+MODULE_PARM(vbi_nr,"i");
+MODULE_PARM_DESC(vbi_nr,"vbi device number");
+
+static unsigned int radio_nr = -1;
+MODULE_PARM(radio_nr,"i");
+MODULE_PARM_DESC(radio_nr,"radio device number");
+
+static unsigned int oss = 0;
+MODULE_PARM(oss,"i");
+MODULE_PARM_DESC(oss,"register oss devices (default: no)");
+
+static unsigned int dsp_nr = -1;
+MODULE_PARM(dsp_nr,"i");
+MODULE_PARM_DESC(dsp_nr,"oss dsp device number");
+
+static unsigned int mixer_nr = -1;
+MODULE_PARM(mixer_nr,"i");
+MODULE_PARM_DESC(mixer_nr,"oss mixer device number");
+#endif
+
+static unsigned int core_debug = 0;
+MODULE_PARM(core_debug,"i");
+MODULE_PARM_DESC(core_debug,"enable debug messages [core]");
+
+#define dprintk(fmt, arg...)	if (core_debug) \
+	printk(KERN_DEBUG "%s/core: " fmt, dev->name , ## arg)
+
+/* ------------------------------------------------------------------ */
+/* debug help functions                                               */
+
+static const char *v4l1_ioctls[] = {
+	"0", "CGAP", "GCHAN", "SCHAN", "GTUNER", "STUNER", "GPICT", "SPICT",
+	"CCAPTURE", "GWIN", "SWIN", "GFBUF", "SFBUF", "KEY", "GFREQ",
+	"SFREQ", "GAUDIO", "SAUDIO", "SYNC", "MCAPTURE", "GMBUF", "GUNIT",
+	"GCAPTURE", "SCAPTURE", "SPLAYMODE", "SWRITEMODE", "GPLAYINFO",
+	"SMICROCODE", "GVBIFMT", "SVBIFMT" };
+#define V4L1_IOCTLS ARRAY_SIZE(v4l1_ioctls)
+
+static const char *v4l2_ioctls[] = {
+	"QUERYCAP", "1", "ENUM_PIXFMT", "ENUM_FBUFFMT", "G_FMT", "S_FMT",
+	"G_COMP", "S_COMP", "REQBUFS", "QUERYBUF", "G_FBUF", "S_FBUF",
+	"G_WIN", "S_WIN", "PREVIEW", "QBUF", "16", "DQBUF", "STREAMON",
+	"STREAMOFF", "G_PERF", "G_PARM", "S_PARM", "G_STD", "S_STD",
+	"ENUMSTD", "ENUMINPUT", "G_CTRL", "S_CTRL", "G_TUNER", "S_TUNER",
+	"G_FREQ", "S_FREQ", "G_AUDIO", "S_AUDIO", "35", "QUERYCTRL",
+	"QUERYMENU", "G_INPUT", "S_INPUT", "ENUMCVT", "41", "42", "43",
+	"44", "45",  "G_OUTPUT", "S_OUTPUT", "ENUMOUTPUT", "G_AUDOUT",
+	"S_AUDOUT", "ENUMFX", "G_EFFECT", "S_EFFECT", "G_MODULATOR",
+	"S_MODULATOR"
+};
+#define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls)
+
+static const char *osspcm_ioctls[] = {
+	"RESET", "SYNC", "SPEED", "STEREO", "GETBLKSIZE", "SETFMT",
+	"CHANNELS", "?", "POST", "SUBDIVIDE", "SETFRAGMENT", "GETFMTS",
+	"GETOSPACE", "GETISPACE", "NONBLOCK", "GETCAPS", "GET/SETTRIGGER",
+	"GETIPTR", "GETOPTR", "MAPINBUF", "MAPOUTBUF", "SETSYNCRO",
+	"SETDUPLEX", "GETODELAY"
+};
+#define OSSPCM_IOCTLS ARRAY_SIZE(v4l2_ioctls)
+
+void cx88_print_ioctl(char *name, unsigned int cmd)
+{
+	char *dir;
+
+	switch (_IOC_DIR(cmd)) {
+	case _IOC_NONE:              dir = "--"; break;
+	case _IOC_READ:              dir = "r-"; break;
+	case _IOC_WRITE:             dir = "-w"; break;
+	case _IOC_READ | _IOC_WRITE: dir = "rw"; break;
+	default:                     dir = "??"; break;
+	}
+	switch (_IOC_TYPE(cmd)) {
+	case 'v':
+		printk(KERN_DEBUG "%s: ioctl 0x%08x (v4l1, %s, VIDIOC%s)\n",
+		       name, cmd, dir, (_IOC_NR(cmd) < V4L1_IOCTLS) ?
+		       v4l1_ioctls[_IOC_NR(cmd)] : "???");
+		break;
+	case 'V':
+		printk(KERN_DEBUG "%s: ioctl 0x%08x (v4l2, %s, VIDIOC_%s)\n",
+		       name, cmd, dir, (_IOC_NR(cmd) < V4L2_IOCTLS) ?
+		       v4l2_ioctls[_IOC_NR(cmd)] : "???");
+		break;
+	case 'P':
+		printk(KERN_DEBUG "%s: ioctl 0x%08x (oss dsp, %s, SNDCTL_DSP_%s)\n",
+		       name, cmd, dir, (_IOC_NR(cmd) < OSSPCM_IOCTLS) ?
+		       osspcm_ioctls[_IOC_NR(cmd)] : "???");
+		break;
+	case 'M':
+		printk(KERN_DEBUG "%s: ioctl 0x%08x (oss mixer, %s, #%d)\n",
+		       name, cmd, dir, _IOC_NR(cmd));
+		break;
+	default:
+		printk(KERN_DEBUG "%s: ioctl 0x%08x (???, %s, #%d)\n",
+		       name, cmd, dir, _IOC_NR(cmd));
+	}
+}
+
+/* ------------------------------------------------------------------ */
+
+static u32* cx88_risc_field(u32 *rp, struct scatterlist *sglist,
+			    unsigned int offset, u32 sync_line,
+			    unsigned int bpl, unsigned int padding,
+			    unsigned int lines)
+{
+	struct scatterlist *sg;
+	unsigned int line,todo;
+
+	/* sync instruction */
+	*(rp++) = cpu_to_le32(RISC_RESYNC | sync_line);
+	
+	/* scan lines */
+	sg = sglist;
+	for (line = 0; line < lines; line++) {
+		while (offset && offset >= sg_dma_len(sg)) {
+			offset -= sg_dma_len(sg);
+			sg++;
+		}
+		if (bpl <= sg_dma_len(sg)-offset) {
+			/* fits into current chunk */
+                        *(rp++)=cpu_to_le32(RISC_WRITE|RISC_SOL|RISC_EOL|bpl);
+                        *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset);
+                        offset+=bpl;
+		} else {
+			/* scanline needs to be splitted */
+                        todo = bpl;
+                        *(rp++)=cpu_to_le32(RISC_WRITE|RISC_SOL|
+					    (sg_dma_len(sg)-offset));
+                        *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset);
+                        todo -= (sg_dma_len(sg)-offset);
+                        offset = 0;
+                        sg++;
+                        while (todo > sg_dma_len(sg)) {
+                                *(rp++)=cpu_to_le32(RISC_WRITE|
+						    sg_dma_len(sg));
+                                *(rp++)=cpu_to_le32(sg_dma_address(sg));
+				todo -= sg_dma_len(sg);
+				sg++;
+			}
+                        *(rp++)=cpu_to_le32(RISC_WRITE|RISC_EOL|todo);
+			*(rp++)=cpu_to_le32(sg_dma_address(sg));
+			offset += todo;
+		}
+		offset += padding;
+	}
+
+	return rp;
+}
+
+int cx88_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc,
+		     struct scatterlist *sglist,
+		     unsigned int top_offset, unsigned int bottom_offset,
+		     unsigned int bpl, unsigned int padding, unsigned int lines)
+{
+	u32 instructions,fields;
+	u32 *rp;
+	int rc;
+
+	fields = 0;
+	if (UNSET != top_offset)
+		fields++;
+	if (UNSET != bottom_offset)
+		fields++;
+
+	/* estimate risc mem: worst case is one write per page border +
+	   one write per scan line + syncs + jump (all 2 dwords) */
+	instructions  = (bpl * lines * fields) / PAGE_SIZE + lines * fields;
+	instructions += 3 + 4;
+	if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0)
+		return rc;
+
+	/* write risc instructions */
+	rp = risc->cpu;
+	if (UNSET != top_offset)
+		rp = cx88_risc_field(rp, sglist, top_offset, 0,
+				     bpl, padding, lines);
+	if (UNSET != bottom_offset)
+		rp = cx88_risc_field(rp, sglist, bottom_offset, 0x200,
+				     bpl, padding, lines);
+
+	/* save pointer to jmp instruction address */
+	risc->jmp = rp;
+	return 0;
+}
+
+int cx88_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc,
+		      u32 reg, u32 mask, u32 value)
+{
+	u32 *rp;
+	int rc;
+
+	if ((rc = btcx_riscmem_alloc(pci, risc, 4*16)) < 0)
+		return rc;
+
+	/* write risc instructions */
+	rp = risc->cpu;
+	*(rp++) = cpu_to_le32(RISC_WRITECR  | RISC_IRQ2 | RISC_IMM);
+	*(rp++) = cpu_to_le32(reg);
+	*(rp++) = cpu_to_le32(value);
+	*(rp++) = cpu_to_le32(mask);
+	*(rp++) = cpu_to_le32(RISC_JUMP);
+	*(rp++) = cpu_to_le32(risc->dma);
+	return 0;
+}
+
+void
+cx88_free_buffer(struct pci_dev *pci, struct cx88_buffer *buf)
+{
+	if (in_interrupt())
+		BUG();
+	videobuf_waiton(&buf->vb,0,0);
+	videobuf_dma_pci_unmap(pci, &buf->vb.dma);
+	videobuf_dma_free(&buf->vb.dma);
+	btcx_riscmem_free(pci, &buf->risc);
+	buf->vb.state = STATE_NEEDS_INIT;
+}
+
+/* ------------------------------------------------------------------ */
+/* our SRAM memory layout                                             */
+
+/* we are going to put all thr risc programs into host memory, so we
+ * can use the whole SDRAM for the DMA fifos.  To simplify things, we
+ * use a static memory layout.  That surely will waste memory in case
+ * we don't use all DMA channels at the same time (which will be the
+ * case most of the time).  But that still gives us enougth FIFO space
+ * to be able to deal with insane long pci latencies ...
+ *
+ * FIFO space allocations:
+ *    channel  21    (y video)  - 10.0k
+ *    channel  24    (vbi)      -  4.0k
+ *    channels 25+26 (audio)    -  0.5k
+ *    everything else           -  2.0k
+ *    TOTAL                     = 29.0k
+ *
+ * Every channel has 160 bytes control data (64 bytes instruction
+ * queue and 6 CDT entries), which is close to 2k total.
+ * 
+ * Address layout:
+ *    0x0000 - 0x03ff    CMDs / reserved
+ *    0x0400 - 0x0bff    instruction queues + CDs
+ *    0x0c00 -           FIFOs
+ */
+
+struct sram_channel cx88_sram_channels[] = {
+	[SRAM_CH21] = {
+		.name       = "video y / packed",
+		.cmds_start = 0x180040,
+		.ctrl_start = 0x180400,
+		.fifo_start = 0x180c00,
+		.fifo_size  = 0x002800,
+		.ptr1_reg   = MO_DMA21_PTR1,
+		.ptr2_reg   = MO_DMA21_PTR2,
+		.cnt1_reg   = MO_DMA21_CNT1,
+		.cnt2_reg   = MO_DMA21_CNT2,
+	},
+	[SRAM_CH22] = {
+		.name       = "video u",
+		.cmds_start = 0x180080,
+		.ctrl_start = 0x1804a0,
+		.fifo_start = 0x183400,
+		.fifo_size  = 0x000800,
+		.ptr1_reg   = MO_DMA22_PTR1,
+		.ptr2_reg   = MO_DMA22_PTR2,
+		.cnt1_reg   = MO_DMA22_CNT1,
+		.cnt2_reg   = MO_DMA22_CNT2,
+	},
+	[SRAM_CH23] = {
+		.name       = "video v",
+		.cmds_start = 0x1800c0,
+		.ctrl_start = 0x180540,
+		.fifo_start = 0x183c00,
+		.fifo_size  = 0x000800,
+		.ptr1_reg   = MO_DMA23_PTR1,
+		.ptr2_reg   = MO_DMA23_PTR2,
+		.cnt1_reg   = MO_DMA23_CNT1,
+		.cnt2_reg   = MO_DMA23_CNT2,
+	},
+	[SRAM_CH24] = {
+		.name       = "vbi",
+		.cmds_start = 0x180100,
+		.ctrl_start = 0x1805e0,
+		.fifo_start = 0x184400,
+		.fifo_size  = 0x001000,
+		.ptr1_reg   = MO_DMA24_PTR1,
+		.ptr2_reg   = MO_DMA24_PTR2,
+		.cnt1_reg   = MO_DMA24_CNT1,
+		.cnt2_reg   = MO_DMA24_CNT2,
+	},
+	[SRAM_CH25] = {
+		.name       = "audio from",
+		.cmds_start = 0x180140,
+		.ctrl_start = 0x180680,
+		.fifo_start = 0x185400,
+		.fifo_size  = 0x000200,
+		.ptr1_reg   = MO_DMA25_PTR1,
+		.ptr2_reg   = MO_DMA25_PTR2,
+		.cnt1_reg   = MO_DMA25_CNT1,
+		.cnt2_reg   = MO_DMA25_CNT2,
+	},
+	[SRAM_CH26] = {
+		.name       = "audio to",
+		.cmds_start = 0x180180,
+		.ctrl_start = 0x180720,
+		.fifo_start = 0x185600,
+		.fifo_size  = 0x000200,
+		.ptr1_reg   = MO_DMA26_PTR1,
+		.ptr2_reg   = MO_DMA26_PTR2,
+		.cnt1_reg   = MO_DMA26_CNT1,
+		.cnt2_reg   = MO_DMA26_CNT2,
+	},
+};
+
+int cx88_sram_channel_setup(struct cx8800_dev *dev,
+			    struct sram_channel *ch,
+			    unsigned int bpl, u32 risc)
+{
+	unsigned int i,lines;
+	u32 cdt;
+
+	bpl   = (bpl + 7) & ~7; /* alignment */
+	cdt   = ch->ctrl_start + 64;
+	lines = ch->fifo_size / bpl;
+	if (lines > 6)
+		lines = 6;
+	BUG_ON(lines < 2);
+
+	/* write CDT */
+	for (i = 0; i < lines; i++)
+		cx_write(cdt + 16*i, ch->fifo_start + bpl*i);
+
+	/* write CMDS */
+	cx_write(ch->cmds_start +  0, risc);
+	cx_write(ch->cmds_start +  4, cdt);
+	cx_write(ch->cmds_start +  8, (lines*16) >> 3);
+	cx_write(ch->cmds_start + 12, ch->ctrl_start);
+	cx_write(ch->cmds_start + 16, 64 >> 2);
+	for (i = 20; i < 64; i += 4)
+		cx_write(ch->cmds_start + i, 0);
+
+	/* fill registers */
+	cx_write(ch->ptr1_reg, ch->fifo_start);
+	cx_write(ch->ptr2_reg, cdt);
+	cx_write(ch->cnt1_reg, bpl >> 3);
+	cx_write(ch->cnt2_reg, (lines*16) >> 3);
+
+	dprintk("sram setup %s: bpl=%d lines=%d\n", ch->name, bpl, lines);
+	return 0;
+}
+
+/* ------------------------------------------------------------------ */
+/* debug helper code                                                  */
+
+int cx88_risc_decode(u32 risc)
+{
+	static char *instr[16] = {
+		[ RISC_SYNC    >> 28 ] = "sync",
+		[ RISC_WRITE   >> 28 ] = "write",
+		[ RISC_WRITEC  >> 28 ] = "writec",
+		[ RISC_READ    >> 28 ] = "read",
+		[ RISC_READC   >> 28 ] = "readc",
+		[ RISC_JUMP    >> 28 ] = "jump",
+		[ RISC_SKIP    >> 28 ] = "skip",
+		[ RISC_WRITERM >> 28 ] = "writerm",
+		[ RISC_WRITECM >> 28 ] = "writecm",
+		[ RISC_WRITECR >> 28 ] = "writecr",
+	};
+	static int incr[16] = {
+		[ RISC_WRITE   >> 28 ] = 2,
+		[ RISC_JUMP    >> 28 ] = 2,
+		[ RISC_WRITERM >> 28 ] = 3,
+		[ RISC_WRITECM >> 28 ] = 3,
+		[ RISC_WRITECR >> 28 ] = 4,
+	};
+	static char *bits[] = {
+		"12",   "13",   "14",   "resync",
+		"cnt0", "cnt1", "18",   "19",
+		"20",   "21",   "22",   "23",
+		"irq1", "irq2", "eol",  "sol",
+	};
+	int i;
+
+	printk("0x%08x [ %s", risc, instr[risc >> 28] ?
+				instr[risc >> 28] : "INVALID");
+	for (i = ARRAY_SIZE(bits)-1; i >= 0; i--)
+		if (risc & (1 << (i + 12)))
+			printk(" %s",bits[i]);
+	printk(" count=%d ]\n", risc & 0xfff);
+	return incr[risc >> 28] ? 1 : incr[risc >> 28];
+}
+
+void cx88_risc_disasm(struct cx8800_dev *dev,
+		      struct btcx_riscmem *risc)
+{
+	unsigned int i,j,n;
+	
+	printk("%s: risc disasm: %p [dma=0x%08lx]\n",
+	       dev->name, risc->cpu, (unsigned long)risc->dma);
+	for (i = 0; i < (risc->size >> 2); i += n) {
+		printk("%s:   %04d: ", dev->name, i);
+		n = cx88_risc_decode(risc->cpu[i]);
+		for (j = 1; j < n; j++)
+			printk("%s:   %04d: 0x%08x [ arg #%d ]\n",
+			       dev->name, i+j, risc->cpu[i+j], j);
+		if (risc->cpu[i] == RISC_JUMP)
+			break;
+	}
+}
+
+void cx88_sram_channel_dump(struct cx8800_dev *dev,
+			    struct sram_channel *ch)
+{
+	static char *name[] = {
+		"initial risc",
+		"cdt base",
+		"cdt size",
+		"iq base",
+		"iq size",
+		"risc pc",
+		"iq wr ptr",
+		"iq rd ptr",
+		"cdt current",
+		"pci target",
+		"line / byte",
+	};
+	u32 risc;
+	unsigned int i,j,n;
+
+	printk("%s: %s - dma channel status dump\n",dev->name,ch->name);
+	for (i = 0; i < ARRAY_SIZE(name); i++)
+		printk("%s:   cmds: %-12s: 0x%08x\n",
+		       dev->name,name[i],
+		       cx_read(ch->cmds_start + 4*i));
+	for (i = 0; i < 4; i++) {
+		risc = cx_read(ch->cmds_start + 4 * (i+11));
+		printk("%s:   risc%d: ", dev->name, i);
+		cx88_risc_decode(risc);
+	}
+	for (i = 0; i < 16; i += n) {
+		risc = cx_read(ch->ctrl_start + 4 * i);
+		printk("%s:   iq %x: ", dev->name, i);
+		n = cx88_risc_decode(risc);
+		for (j = 1; j < n; j++) {
+			risc = cx_read(ch->ctrl_start + 4 * (i+j));
+			printk("%s:   iq %x: 0x%08x [ arg #%d ]\n",
+			       dev->name, i+j, risc, j);
+		}
+	}
+
+	printk("%s: fifo: 0x%08x -> 0x%x\n",
+	       dev->name, ch->fifo_start, ch->fifo_start+ch->fifo_size);
+	printk("%s: ctrl: 0x%08x -> 0x%x\n",
+	       dev->name, ch->ctrl_start, ch->ctrl_start+6*16);
+	printk("%s:   ptr1_reg: 0x%08x\n",
+	       dev->name,cx_read(ch->ptr1_reg));
+	printk("%s:   ptr2_reg: 0x%08x\n",
+	       dev->name,cx_read(ch->ptr2_reg));
+	printk("%s:   cnt1_reg: 0x%08x\n",
+	       dev->name,cx_read(ch->cnt1_reg));
+	printk("%s:   cnt2_reg: 0x%08x\n",
+	       dev->name,cx_read(ch->cnt2_reg));
+}
+
+char *cx88_pci_irqs[32] = {
+	"vid", "aud", "ts", "vip", "hst", "5", "6", "tm1", 
+	"src_dma", "dst_dma", "risc_rd_err", "risc_wr_err",
+	"brdg_err", "src_dma_err", "dst_dma_err", "ipb_dma_err",
+	"i2c", "i2c_rack", "ir_smp", "gpio0", "gpio1"
+};
+char *cx88_vid_irqs[32] = {
+	"y_risci1", "u_risci1", "v_risci1", "vbi_risc1", 
+	"y_risci2", "u_risci2", "v_risci2", "vbi_risc2",
+	"y_oflow",  "u_oflow",  "v_oflow",  "vbi_oflow",
+	"y_sync",   "u_sync",   "v_sync",   "vbi_sync",
+	"opc_err",  "par_err",  "rip_err",  "pci_abort",
+};
+
+void cx88_print_irqbits(char *name, char *tag, char **strings,
+			u32 bits, u32 mask)
+{
+	unsigned int i;
+
+	printk(KERN_DEBUG "%s: %s [0x%x]", name, tag, bits);
+	for (i = 0; i < 32; i++) {
+		if (!(bits & (1 << i)))
+			continue;
+		printk(" %s",strings[i]);
+		if (!(mask & (1 << i)))
+			continue;
+		printk("*");
+	}
+	printk("\n");
+}
+
+/* ------------------------------------------------------------------ */
+
+int cx88_pci_quirks(char *name, struct pci_dev *pci, unsigned int *latency)
+{
+	u8 ctrl = 0;
+	u8 value;
+
+	if (0 == pci_pci_problems)
+		return 0;
+
+	if (pci_pci_problems & PCIPCI_TRITON) {
+		printk(KERN_INFO "%s: quirk: PCIPCI_TRITON -- set TBFX\n",
+		       name);
+		ctrl |= CX88X_EN_TBFX;
+	}
+	if (pci_pci_problems & PCIPCI_NATOMA) {
+		printk(KERN_INFO "%s: quirk: PCIPCI_NATOMA -- set TBFX\n",
+		       name);
+		ctrl |= CX88X_EN_TBFX;
+	}
+	if (pci_pci_problems & PCIPCI_VIAETBF) {
+		printk(KERN_INFO "%s: quirk: PCIPCI_VIAETBF -- set TBFX\n",
+		       name);
+		ctrl |= CX88X_EN_TBFX;
+	}
+	if (pci_pci_problems & PCIPCI_VSFX) {
+		printk(KERN_INFO "%s: quirk: PCIPCI_VSFX -- set VSFX\n",
+		       name);
+		ctrl |= CX88X_EN_VSFX;
+	}
+#ifdef PCIPCI_ALIMAGIK
+	if (pci_pci_problems & PCIPCI_ALIMAGIK) {
+		printk(KERN_INFO "%s: quirk: PCIPCI_ALIMAGIK -- latency fixup\n",
+		       name);
+		*latency = 0x0A;
+	}
+#endif
+	if (ctrl) {
+		pci_read_config_byte(pci, CX88X_DEVCTRL, &value);
+		value |= ctrl;
+		pci_write_config_byte(pci, CX88X_DEVCTRL, value);
+	}
+	return 0;
+}
+
+/* ------------------------------------------------------------------ */
+
+EXPORT_SYMBOL(cx88_print_ioctl);
+EXPORT_SYMBOL(cx88_pci_irqs);
+EXPORT_SYMBOL(cx88_vid_irqs);
+EXPORT_SYMBOL(cx88_print_irqbits);
+
+EXPORT_SYMBOL(cx88_risc_buffer);
+EXPORT_SYMBOL(cx88_risc_stopper);
+EXPORT_SYMBOL(cx88_free_buffer);
+
+EXPORT_SYMBOL(cx88_risc_disasm);
+
+EXPORT_SYMBOL(cx88_sram_channels);
+EXPORT_SYMBOL(cx88_sram_channel_setup);
+EXPORT_SYMBOL(cx88_sram_channel_dump);
+
+EXPORT_SYMBOL(cx88_pci_quirks);
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff -Nru a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/video/cx88/cx88-i2c.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,172 @@
+/*
+    cx88-i2c.c  --  all the i2c code is here
+
+    Copyright (C) 1996,97,98 Ralph  Metzler (rjkm@thp.uni-koeln.de)
+                           & Marcus Metzler (mocm@thp.uni-koeln.de)
+    (c) 2002 Yurij Sysoev <yurij@naturesoft.net>
+    (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+    
+*/
+
+#define __NO_VERSION__ 1
+
+#include <linux/module.h>
+#include <linux/init.h>
+
+#include <asm/io.h>
+
+#include "cx88.h"
+
+/* ----------------------------------------------------------------------- */
+
+void cx8800_bit_setscl(void *data, int state)
+{
+	struct cx8800_dev *dev = data;
+
+	if (state)
+		dev->i2c_state |= 0x02;
+	else
+		dev->i2c_state &= ~0x02;
+	cx_write(MO_I2C, dev->i2c_state);
+	cx_read(MO_I2C);
+}
+
+void cx8800_bit_setsda(void *data, int state)
+{
+	struct cx8800_dev *dev = data;
+
+	if (state)
+		dev->i2c_state |= 0x01;
+	else
+		dev->i2c_state &= ~0x01;
+	cx_write(MO_I2C, dev->i2c_state);
+	cx_read(MO_I2C);
+}
+
+static int cx8800_bit_getscl(void *data)
+{
+	struct cx8800_dev *dev = data;
+	u32 state;
+	
+	state = cx_read(MO_I2C);
+	return state & 0x02 ? 1 : 0;
+}
+
+static int cx8800_bit_getsda(void *data)
+{
+	struct cx8800_dev *dev = data;
+	u32 state;
+
+	state = cx_read(MO_I2C);
+	return state & 0x01;
+}
+
+/* ----------------------------------------------------------------------- */
+
+#ifndef I2C_PEC
+static void cx8800_inc_use(struct i2c_adapter *adap)
+{
+	MOD_INC_USE_COUNT;
+}
+
+static void cx8800_dec_use(struct i2c_adapter *adap)
+{
+	MOD_DEC_USE_COUNT;
+}
+#endif
+
+static int attach_inform(struct i2c_client *client)
+{
+        struct cx8800_dev *dev = i2c_get_adapdata(client->adapter);
+
+	if (dev->tuner_type != UNSET)
+		cx8800_call_i2c_clients(dev,TUNER_SET_TYPE,&dev->tuner_type);
+
+        if (1 /* fixme: debug */)
+		printk("%s: i2c attach [client=%s]\n",
+		       dev->name, i2c_clientname(client));
+        return 0;
+}
+
+void cx8800_call_i2c_clients(struct cx8800_dev *dev, unsigned int cmd, void *arg)
+{
+	if (0 != dev->i2c_rc)
+		return;
+	i2c_clients_command(&dev->i2c_adap, cmd, arg);
+}
+
+static struct i2c_algo_bit_data cx8800_i2c_algo_template = {
+	.setsda  = cx8800_bit_setsda,
+	.setscl  = cx8800_bit_setscl,
+	.getsda  = cx8800_bit_getsda,
+	.getscl  = cx8800_bit_getscl,
+	.udelay  = 16,
+	.mdelay  = 10,
+	.timeout = 200,
+};
+
+/* ----------------------------------------------------------------------- */
+
+static struct i2c_adapter cx8800_i2c_adap_template = {
+#ifdef I2C_PEC
+	.owner             = THIS_MODULE,
+#else
+	.inc_use           = cx8800_inc_use,
+	.dec_use           = cx8800_dec_use,
+#endif
+#ifdef I2C_ADAP_CLASS_TV_ANALOG
+	.class             = I2C_ADAP_CLASS_TV_ANALOG,
+#endif
+	I2C_DEVNAME("cx2388x"),
+	.id                = I2C_HW_B_BT848,
+	.client_register   = attach_inform,
+};
+
+static struct i2c_client cx8800_i2c_client_template = {
+        I2C_DEVNAME("cx88xx internal"),
+        .id   = -1,
+};
+
+/* init + register i2c algo-bit adapter */
+int __devinit cx8800_i2c_init(struct cx8800_dev *dev)
+{
+	memcpy(&dev->i2c_adap, &cx8800_i2c_adap_template,
+	       sizeof(dev->i2c_adap));
+	memcpy(&dev->i2c_algo, &cx8800_i2c_algo_template,
+	       sizeof(dev->i2c_algo));
+	memcpy(&dev->i2c_client, &cx8800_i2c_client_template,
+	       sizeof(dev->i2c_client));
+
+	dev->i2c_adap.dev.parent = &dev->pci->dev;
+	strcpy(dev->i2c_adap.name,dev->name);
+        dev->i2c_algo.data = dev;
+        i2c_set_adapdata(&dev->i2c_adap,dev);
+        dev->i2c_adap.algo_data = &dev->i2c_algo;
+        dev->i2c_client.adapter = &dev->i2c_adap;
+
+	cx8800_bit_setscl(dev,1);
+	cx8800_bit_setsda(dev,1);
+
+	dev->i2c_rc = i2c_bit_add_bus(&dev->i2c_adap);
+	return dev->i2c_rc;
+}
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff -Nru a/drivers/media/video/cx88/cx88-reg.h b/drivers/media/video/cx88/cx88-reg.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/video/cx88/cx88-reg.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,770 @@
+/* 
+    cx88x-hw.h - CX2388x register offsets
+
+    Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
+                  2001 Michael Eskin
+                  2002 Yurij Sysoev <yurij@naturesoft.net>
+                  2003 Gerd Knorr <kraxel@bytesex.org>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef _CX88_REG_H_
+#define _CX88_REG_H_
+
+/* ---------------------------------------------------------------------- */
+/* PCI IDs and config space                                               */
+
+#ifndef PCI_VENDOR_ID_CONEXANT
+# define PCI_VENDOR_ID_CONEXANT		0x14F1
+#endif
+#ifndef PCI_DEVICE_ID_CX2300_VID
+# define PCI_DEVICE_ID_CX2300_VID	0x8800
+#endif
+
+#define CX88X_DEVCTRL 0x40
+#define CX88X_EN_TBFX 0x02
+#define CX88X_EN_VSFX 0x04
+
+
+/* ---------------------------------------------------------------------- */
+/* DMA Controller registers                                               */
+
+#define MO_PDMA_STHRSH      0x200000 // Source threshold
+#define MO_PDMA_STADRS      0x200004 // Source target address
+#define MO_PDMA_SIADRS      0x200008 // Source internal address
+#define MO_PDMA_SCNTRL      0x20000C // Source control
+#define MO_PDMA_DTHRSH      0x200010 // Destination threshold
+#define MO_PDMA_DTADRS      0x200014 // Destination target address
+#define MO_PDMA_DIADRS      0x200018 // Destination internal address
+#define MO_PDMA_DCNTRL      0x20001C // Destination control
+#define MO_LD_SSID          0x200030 // Load subsystem ID
+#define MO_DEV_CNTRL2       0x200034 // Device control
+#define MO_PCI_INTMSK       0x200040 // PCI interrupt mask
+#define MO_PCI_INTSTAT      0x200044 // PCI interrupt status
+#define MO_PCI_INTMSTAT     0x200048 // PCI interrupt masked status
+#define MO_VID_INTMSK       0x200050 // Video interrupt mask
+#define MO_VID_INTSTAT      0x200054 // Video interrupt status
+#define MO_VID_INTMSTAT     0x200058 // Video interrupt masked status
+#define MO_VID_INTSSTAT     0x20005C // Video interrupt set status
+#define MO_AUD_INTMSK       0x200060 // Audio interrupt mask
+#define MO_AUD_INTSTAT      0x200064 // Audio interrupt status
+#define MO_AUD_INTMSTAT     0x200068 // Audio interrupt masked status
+#define MO_AUD_INTSSTAT     0x20006C // Audio interrupt set status
+#define MO_TS_INTMSK        0x200070 // Transport stream interrupt mask
+#define MO_TS_INTSTAT       0x200074 // Transport stream interrupt status
+#define MO_TS_INTMSTAT      0x200078 // Transport stream interrupt mask status
+#define MO_TS_INTSSTAT      0x20007C // Transport stream interrupt set status
+#define MO_VIP_INTMSK       0x200080 // VIP interrupt mask
+#define MO_VIP_INTSTAT      0x200084 // VIP interrupt status
+#define MO_VIP_INTMSTAT     0x200088 // VIP interrupt masked status
+#define MO_VIP_INTSSTAT     0x20008C // VIP interrupt set status
+#define MO_GPHST_INTMSK     0x200090 // Host interrupt mask
+#define MO_GPHST_INTSTAT    0x200094 // Host interrupt status
+#define MO_GPHST_INTMSTAT   0x200098 // Host interrupt masked status
+#define MO_GPHST_INTSSTAT   0x20009C // Host interrupt set status
+
+// DMA Channels 1-6 belong to SPIPE
+#define MO_DMA7_PTR1        0x300018 // {24}RW* DMA Current Ptr : Ch#7
+#define MO_DMA8_PTR1        0x30001C // {24}RW* DMA Current Ptr : Ch#8
+
+// DMA Channels 9-20 belong to SPIPE
+#define MO_DMA21_PTR1       0x300080 // {24}R0* DMA Current Ptr : Ch#21
+#define MO_DMA22_PTR1       0x300084 // {24}R0* DMA Current Ptr : Ch#22
+#define MO_DMA23_PTR1       0x300088 // {24}R0* DMA Current Ptr : Ch#23
+#define MO_DMA24_PTR1       0x30008C // {24}R0* DMA Current Ptr : Ch#24
+#define MO_DMA25_PTR1       0x300090 // {24}R0* DMA Current Ptr : Ch#25
+#define MO_DMA26_PTR1       0x300094 // {24}R0* DMA Current Ptr : Ch#26
+#define MO_DMA27_PTR1       0x300098 // {24}R0* DMA Current Ptr : Ch#27
+#define MO_DMA28_PTR1       0x30009C // {24}R0* DMA Current Ptr : Ch#28
+#define MO_DMA29_PTR1       0x3000A0 // {24}R0* DMA Current Ptr : Ch#29
+#define MO_DMA30_PTR1       0x3000A4 // {24}R0* DMA Current Ptr : Ch#30
+#define MO_DMA31_PTR1       0x3000A8 // {24}R0* DMA Current Ptr : Ch#31
+#define MO_DMA32_PTR1       0x3000AC // {24}R0* DMA Current Ptr : Ch#32
+
+#define MO_DMA21_PTR2       0x3000C0 // {24}RW* DMA Tab Ptr : Ch#21
+#define MO_DMA22_PTR2       0x3000C4 // {24}RW* DMA Tab Ptr : Ch#22
+#define MO_DMA23_PTR2       0x3000C8 // {24}RW* DMA Tab Ptr : Ch#23
+#define MO_DMA24_PTR2       0x3000CC // {24}RW* DMA Tab Ptr : Ch#24
+#define MO_DMA25_PTR2       0x3000D0 // {24}RW* DMA Tab Ptr : Ch#25
+#define MO_DMA26_PTR2       0x3000D4 // {24}RW* DMA Tab Ptr : Ch#26
+#define MO_DMA27_PTR2       0x3000D8 // {24}RW* DMA Tab Ptr : Ch#27
+#define MO_DMA28_PTR2       0x3000DC // {24}RW* DMA Tab Ptr : Ch#28
+#define MO_DMA29_PTR2       0x3000E0 // {24}RW* DMA Tab Ptr : Ch#29
+#define MO_DMA30_PTR2       0x3000E4 // {24}RW* DMA Tab Ptr : Ch#30
+#define MO_DMA31_PTR2       0x3000E8 // {24}RW* DMA Tab Ptr : Ch#31
+#define MO_DMA32_PTR2       0x3000EC // {24}RW* DMA Tab Ptr : Ch#32
+
+#define MO_DMA21_CNT1       0x300100 // {11}RW* DMA Buffer Size : Ch#21
+#define MO_DMA22_CNT1       0x300104 // {11}RW* DMA Buffer Size : Ch#22
+#define MO_DMA23_CNT1       0x300108 // {11}RW* DMA Buffer Size : Ch#23
+#define MO_DMA24_CNT1       0x30010C // {11}RW* DMA Buffer Size : Ch#24
+#define MO_DMA25_CNT1       0x300110 // {11}RW* DMA Buffer Size : Ch#25
+#define MO_DMA26_CNT1       0x300114 // {11}RW* DMA Buffer Size : Ch#26
+#define MO_DMA27_CNT1       0x300118 // {11}RW* DMA Buffer Size : Ch#27
+#define MO_DMA28_CNT1       0x30011C // {11}RW* DMA Buffer Size : Ch#28
+#define MO_DMA29_CNT1       0x300120 // {11}RW* DMA Buffer Size : Ch#29
+#define MO_DMA30_CNT1       0x300124 // {11}RW* DMA Buffer Size : Ch#30
+#define MO_DMA31_CNT1       0x300128 // {11}RW* DMA Buffer Size : Ch#31
+#define MO_DMA32_CNT1       0x30012C // {11}RW* DMA Buffer Size : Ch#32
+
+#define MO_DMA21_CNT2       0x300140 // {11}RW* DMA Table Size : Ch#21
+#define MO_DMA22_CNT2       0x300144 // {11}RW* DMA Table Size : Ch#22
+#define MO_DMA23_CNT2       0x300148 // {11}RW* DMA Table Size : Ch#23
+#define MO_DMA24_CNT2       0x30014C // {11}RW* DMA Table Size : Ch#24
+#define MO_DMA25_CNT2       0x300150 // {11}RW* DMA Table Size : Ch#25
+#define MO_DMA26_CNT2       0x300154 // {11}RW* DMA Table Size : Ch#26
+#define MO_DMA27_CNT2       0x300158 // {11}RW* DMA Table Size : Ch#27
+#define MO_DMA28_CNT2       0x30015C // {11}RW* DMA Table Size : Ch#28
+#define MO_DMA29_CNT2       0x300160 // {11}RW* DMA Table Size : Ch#29
+#define MO_DMA30_CNT2       0x300164 // {11}RW* DMA Table Size : Ch#30
+#define MO_DMA31_CNT2       0x300168 // {11}RW* DMA Table Size : Ch#31
+#define MO_DMA32_CNT2       0x30016C // {11}RW* DMA Table Size : Ch#32
+
+
+/* ---------------------------------------------------------------------- */
+/* Video registers                                                        */
+
+#define MO_VIDY_DMA         0x310000 // {64}RWp Video Y
+#define MO_VIDU_DMA         0x310008 // {64}RWp Video U
+#define MO_VIDV_DMA         0x310010 // {64}RWp Video V
+#define MO_VBI_DMA          0x310018 // {64}RWp VBI (Vertical blanking interval)
+
+#define MO_DEVICE_STATUS    0x310100
+#define MO_INPUT_FORMAT     0x310104
+#define MO_AGC_BURST        0x31010c
+#define MO_CONTR_BRIGHT     0x310110
+#define MO_HTOTAL           0x310120
+#define MO_HDELAY_EVEN      0x310124
+#define MO_HDELAY_ODD       0x310128
+#define MO_VDELAY_ODD       0x31012c
+#define MO_VDELAY_EVEN      0x310130
+#define MO_HACTIVE_EVEN     0x31013c
+#define MO_HACTIVE_ODD      0x310140
+#define MO_VACTIVE_EVEN     0x310144
+#define MO_VACTIVE_ODD      0x310148
+#define MO_HSCALE_EVEN      0x31014c
+#define MO_HSCALE_ODD       0x310150
+#define MO_VSCALE_EVEN      0x310154
+#define MO_FILTER_EVEN      0x31015c
+#define MO_VSCALE_ODD       0x310158
+#define MO_FILTER_ODD       0x310160
+#define MO_OUTPUT_FORMAT    0x310164
+
+#define MO_PLL_REG          0x310168 // PLL register
+#define MO_PLL_ADJ_CTRL     0x31016c // PLL adjust control register
+#define MO_SCONV_REG        0x310170 // sample rate conversion register
+#define MO_SCONV_FIFO       0x310174 // sample rate conversion fifo
+#define MO_SUB_STEP         0x310178 // subcarrier step size
+#define MO_SUB_STEP_DR      0x31017c // subcarrier step size for DR line
+
+#define MO_CAPTURE_CTRL     0x310180 // capture control
+#define MO_COLOR_CTRL       0x310184
+#define MO_VBI_PACKET       0x310188 // vbi packet size / delay
+#define MO_FIELD_COUNT      0x310190 // field counter
+#define MO_VIP_CONFIG       0x310194
+
+#define MO_AGC_BACK_VBI     0x310200
+#define MO_AGC_SYNC_TIP1    0x310208
+
+#define MO_VIDY_GPCNT       0x31C020 // {16}RO Video Y general purpose counter
+#define MO_VIDU_GPCNT       0x31C024 // {16}RO Video U general purpose counter
+#define MO_VIDV_GPCNT       0x31C028 // {16}RO Video V general purpose counter
+#define MO_VBI_GPCNT        0x31C02C // {16}RO VBI general purpose counter
+#define MO_VIDY_GPCNTRL     0x31C030 // {2}WO Video Y general purpose control
+#define MO_VIDU_GPCNTRL     0x31C034 // {2}WO Video U general purpose control
+#define MO_VIDV_GPCNTRL     0x31C038 // {2}WO Video V general purpose control
+#define MO_VBI_GPCNTRL      0x31C03C // {2}WO VBI general purpose counter
+#define MO_VID_DMACNTRL     0x31C040 // {8}RW Video DMA control
+#define MO_VID_XFR_STAT     0x31C044 // {1}RO Video transfer status
+
+
+/* ---------------------------------------------------------------------- */
+/* audio registers                                                        */
+
+#define MO_AUDD_DMA         0x320000 // {64}RWp Audio downstream
+#define MO_AUDU_DMA         0x320008 // {64}RWp Audio upstream
+#define MO_AUDR_DMA         0x320010 // {64}RWp Audio RDS (downstream)
+#define MO_AUDD_GPCNT       0x32C020 // {16}RO Audio down general purpose counter
+#define MO_AUDU_GPCNT       0x32C024 // {16}RO Audio up general purpose counter
+#define MO_AUDR_GPCNT       0x32C028 // {16}RO Audio RDS general purpose counter
+#define MO_AUDD_GPCNTRL     0x32C030 // {2}WO Audio down general purpose control
+#define MO_AUDU_GPCNTRL     0x32C034 // {2}WO Audio up general purpose control
+#define MO_AUDR_GPCNTRL     0x32C038 // {2}WO Audio RDS general purpose control
+#define MO_AUD_DMACNTRL     0x32C040 // {6}RW Audio DMA control
+#define MO_AUD_XFR_STAT     0x32C044 // {1}RO Audio transfer status
+#define MO_AUDD_LNGTH       0x32C048 // {12}RW Audio down line length
+#define MO_AUDR_LNGTH       0x32C04C // {12}RW Audio RDS line length
+
+#define AUD_INIT                 0x320100
+#define AUD_INIT_LD              0x320104
+#define AUD_SOFT_RESET           0x320108
+#define AUD_I2SINPUTCNTL         0x320120
+#define AUD_BAUDRATE             0x320124
+#define AUD_I2SOUTPUTCNTL        0x320128
+#define AAGC_HYST                0x320134
+#define AAGC_GAIN                0x320138
+#define AAGC_DEF                 0x32013c
+#define AUD_IIR1_0_SEL           0x320150
+#define AUD_IIR1_0_SHIFT         0x320154
+#define AUD_IIR1_1_SEL           0x320158
+#define AUD_IIR1_1_SHIFT         0x32015c
+#define AUD_IIR1_2_SEL           0x320160
+#define AUD_IIR1_2_SHIFT         0x320164
+#define AUD_IIR1_3_SEL           0x320168
+#define AUD_IIR1_3_SHIFT         0x32016c
+#define AUD_IIR1_4_SEL           0x320170
+#define AUD_IIR1_4_SHIFT         0x32017c
+#define AUD_IIR1_5_SEL           0x320180
+#define AUD_IIR1_5_SHIFT         0x320184
+#define AUD_IIR2_0_SEL           0x320190
+#define AUD_IIR2_0_SHIFT         0x320194
+#define AUD_IIR2_1_SEL           0x320198
+#define AUD_IIR2_1_SHIFT         0x32019c
+#define AUD_IIR2_2_SEL           0x3201a0
+#define AUD_IIR2_2_SHIFT         0x3201a4
+#define AUD_IIR2_3_SEL           0x3201a8
+#define AUD_IIR2_3_SHIFT         0x3201ac
+#define AUD_IIR3_0_SEL           0x3201c0
+#define AUD_IIR3_0_SHIFT         0x3201c4
+#define AUD_IIR3_1_SEL           0x3201c8
+#define AUD_IIR3_1_SHIFT         0x3201cc
+#define AUD_IIR3_2_SEL           0x3201d0
+#define AUD_IIR3_2_SHIFT         0x3201d4
+#define AUD_IIR4_0_SEL           0x3201e0
+#define AUD_IIR4_0_SHIFT         0x3201e4
+#define AUD_IIR4_1_SEL           0x3201e8
+#define AUD_IIR4_1_SHIFT         0x3201ec
+#define AUD_IIR4_2_SEL           0x3201f0
+#define AUD_IIR4_2_SHIFT         0x3201f4
+#define AUD_IIR4_0_CA0           0x320200
+#define AUD_IIR4_0_CA1           0x320204
+#define AUD_IIR4_0_CA2           0x320208
+#define AUD_IIR4_0_CB0           0x32020c
+#define AUD_IIR4_0_CB1           0x320210
+#define AUD_IIR4_1_CA0           0x320214
+#define AUD_IIR4_1_CA1           0x320218
+#define AUD_IIR4_1_CA2           0x32021c
+#define AUD_IIR4_1_CB0           0x320220
+#define AUD_IIR4_1_CB1           0x320224
+#define AUD_IIR4_2_CA0           0x320228
+#define AUD_IIR4_2_CA1           0x32022c
+#define AUD_IIR4_2_CA2           0x320230
+#define AUD_IIR4_2_CB0           0x320234
+#define AUD_IIR4_2_CB1           0x320238
+#define AUD_HP_MD_IIR4_1         0x320250
+#define AUD_HP_PROG_IIR4_1       0x320254
+#define AUD_FM_MODE_ENABLE       0x320258
+#define AUD_POLY0_DDS_CONSTANT   0x320270
+#define AUD_DN0_FREQ             0x320274
+#define AUD_DN1_FREQ             0x320278
+#define AUD_DN1_FREQ_SHIFT       0x32027c
+#define AUD_DN1_AFC              0x320280
+#define AUD_DN1_SRC_SEL          0x320284
+#define AUD_DN1_SHFT             0x320288
+#define AUD_DN2_FREQ             0x32028c
+#define AUD_DN2_FREQ_SHIFT       0x320290
+#define AUD_DN2_AFC              0x320294
+#define AUD_DN2_SRC_SEL          0x320298
+#define AUD_DN2_SHFT             0x32029c
+#define AUD_CRDC0_SRC_SEL        0x320300
+#define AUD_CRDC0_SHIFT          0x320304
+#define AUD_CORDIC_SHIFT_0       0x320308
+#define AUD_CRDC1_SRC_SEL        0x32030c
+#define AUD_CRDC1_SHIFT          0x320310
+#define AUD_CORDIC_SHIFT_1       0x320314
+#define AUD_DCOC_0_SRC           0x320320
+#define AUD_DCOC0_SHIFT          0x320324
+#define AUD_DCOC_0_SHIFT_IN0     0x320328
+#define AUD_DCOC_0_SHIFT_IN1     0x32032c
+#define AUD_DCOC_1_SRC           0x320330
+#define AUD_DCOC1_SHIFT          0x320334
+#define AUD_DCOC_1_SHIFT_IN0     0x320338
+#define AUD_DCOC_1_SHIFT_IN1     0x32033c
+#define AUD_DCOC_2_SRC           0x320340
+#define AUD_DCOC2_SHIFT          0x320344
+#define AUD_DCOC_2_SHIFT_IN0     0x320348
+#define AUD_DCOC_2_SHIFT_IN1     0x32034c
+#define AUD_DCOC_PASS_IN         0x320350
+#define AUD_PDET_SRC             0x320370
+#define AUD_PDET_SHIFT           0x320374
+#define AUD_PILOT_BQD_1_K0       0x320380
+#define AUD_PILOT_BQD_1_K1       0x320384
+#define AUD_PILOT_BQD_1_K2       0x320388
+#define AUD_PILOT_BQD_1_K3       0x32038c
+#define AUD_PILOT_BQD_1_K4       0x320390
+#define AUD_PILOT_BQD_2_K0       0x320394
+#define AUD_PILOT_BQD_2_K1       0x320398
+#define AUD_PILOT_BQD_2_K2       0x32039c
+#define AUD_PILOT_BQD_2_K3       0x3203a0
+#define AUD_PILOT_BQD_2_K4       0x3203a4
+#define AUD_THR_FR               0x3203c0
+#define AUD_X_PROG               0x3203c4
+#define AUD_Y_PROG               0x3203c8
+#define AUD_HARMONIC_MULT        0x3203cc
+#define AUD_C1_UP_THR            0x3203d0
+#define AUD_C1_LO_THR            0x3203d4
+#define AUD_C2_UP_THR            0x3203d8
+#define AUD_C2_LO_THR            0x3203dc
+#define AUD_PLL_EN               0x320400
+#define AUD_PLL_SRC              0x320404
+#define AUD_PLL_SHIFT            0x320408
+#define AUD_PLL_IF_SEL           0x32040c
+#define AUD_PLL_IF_SHIFT         0x320410
+#define AUD_BIQUAD_PLL_K0        0x320414
+#define AUD_BIQUAD_PLL_K1        0x320418
+#define AUD_BIQUAD_PLL_K2        0x32041c
+#define AUD_BIQUAD_PLL_K3        0x320420
+#define AUD_BIQUAD_PLL_K4        0x320424
+#define AUD_DEEMPH0_SRC_SEL      0x320440
+#define AUD_DEEMPH0_SHIFT        0x320444
+#define AUD_DEEMPH0_G0           0x320448
+#define AUD_DEEMPH0_A0           0x32044c
+#define AUD_DEEMPH0_B0           0x320450
+#define AUD_DEEMPH0_A1           0x320454
+#define AUD_DEEMPH0_B1           0x320458
+#define AUD_DEEMPH1_SRC_SEL      0x32045c
+#define AUD_DEEMPH1_SHIFT        0x320460
+#define AUD_DEEMPH1_G0           0x320464
+#define AUD_DEEMPH1_A0           0x320468
+#define AUD_DEEMPH1_B0           0x32046c
+#define AUD_DEEMPH1_A1           0x320470
+#define AUD_DEEMPH1_B1           0x320474
+#define AUD_OUT0_SEL             0x320490
+#define AUD_OUT0_SHIFT           0x320494
+#define AUD_OUT1_SEL             0x320498
+#define AUD_OUT1_SHIFT           0x32049c
+#define AUD_RDSI_SEL             0x3204a0
+#define AUD_RDSI_SHIFT           0x3204a4
+#define AUD_RDSQ_SEL             0x3204a8
+#define AUD_RDSQ_SHIFT           0x3204ac
+#define AUD_DBX_IN_GAIN          0x320500
+#define AUD_DBX_WBE_GAIN         0x320504
+#define AUD_DBX_SE_GAIN          0x320508
+#define AUD_DBX_RMS_WBE          0x32050c
+#define AUD_DBX_RMS_SE           0x320510
+#define AUD_DBX_SE_BYPASS        0x320514
+#define AUD_FAWDETCTL            0x320530
+#define AUD_FAWDETWINCTL         0x320534
+#define AUD_DEEMPHGAIN_R         0x320538
+#define AUD_DEEMPHNUMER1_R       0x32053c
+#define AUD_DEEMPHNUMER2_R       0x320540
+#define AUD_DEEMPHDENOM1_R       0x320544
+#define AUD_DEEMPHDENOM2_R       0x320548
+#define AUD_ERRLOGPERIOD_R       0x32054c
+#define AUD_ERRINTRPTTHSHLD1_R   0x320550
+#define AUD_ERRINTRPTTHSHLD2_R   0x320554
+#define AUD_ERRINTRPTTHSHLD3_R   0x320558
+#define AUD_NICAM_STATUS1        0x32055c
+#define AUD_NICAM_STATUS2        0x320560
+#define AUD_ERRLOG1              0x320564
+#define AUD_ERRLOG2              0x320568
+#define AUD_ERRLOG3              0x32056c
+#define AUD_DAC_BYPASS_L         0x320580
+#define AUD_DAC_BYPASS_R         0x320584
+#define AUD_DAC_BYPASS_CTL       0x320588
+#define AUD_CTL                  0x32058c
+#define AUD_STATUS               0x320590
+#define AUD_VOL_CTL              0x320594
+#define AUD_BAL_CTL              0x320598
+#define AUD_START_TIMER          0x3205b0
+#define AUD_MODE_CHG_TIMER       0x3205b4
+#define AUD_POLYPH80SCALEFAC     0x3205b8
+#define AUD_DMD_RA_DDS           0x3205bc
+#define AUD_I2S_RA_DDS           0x3205c0
+#define AUD_RATE_THRES_DMD       0x3205d0
+#define AUD_RATE_THRES_I2S       0x3205d4
+#define AUD_RATE_ADJ1            0x3205d8
+#define AUD_RATE_ADJ2            0x3205dc
+#define AUD_RATE_ADJ3            0x3205e0
+#define AUD_RATE_ADJ4            0x3205e4
+#define AUD_RATE_ADJ5            0x3205e8
+#define AUD_APB_IN_RATE_ADJ      0x3205ec
+#define AUD_PHASE_FIX_CTL        0x3205f0
+#define AUD_PLL_PRESCALE         0x320600
+#define AUD_PLL_DDS              0x320604
+#define AUD_PLL_INT              0x320608
+#define AUD_PLL_FRAC             0x32060c
+#define AUD_PLL_JTAG             0x320620
+#define AUD_PLL_SPMP             0x320624
+#define AUD_AFE_12DB_EN          0x320628
+
+// Audio QAM Register Addresses
+#define AUD_PDF_DDS_CNST_BYTE2   0x320d01
+#define AUD_PDF_DDS_CNST_BYTE1   0x320d02
+#define AUD_PDF_DDS_CNST_BYTE0   0x320d03
+#define AUD_PHACC_FREQ_8MSB      0x320d2a
+#define AUD_PHACC_FREQ_8LSB      0x320d23
+#define AUD_QAM_MODE             0x320d04
+
+
+/* ---------------------------------------------------------------------- */
+/* transport stream registers                                             */
+
+#define MO_TS_DMA           0x330000 // {64}RWp Transport stream downstream
+#define MO_TS_GPCNT         0x33C020 // {16}RO TS general purpose counter
+#define MO_TS_GPCNTRL       0x33C030 // {2}WO TS general purpose control
+#define MO_TS_DMACNTRL      0x33C040 // {6}RW TS DMA control
+#define MO_TS_XFR_STAT      0x33C044 // {1}RO TS transfer status
+#define MO_TS_LNGTH         0x33C048 // {12}RW TS line length
+
+#define TS_HW_SOP_CNTRL     0x33C04C
+#define TS_GEN_CNTRL        0x33C050
+#define TS_BD_PKT_STAT      0x33C054
+#define TS_SOP_STAT         0x33C058
+#define TS_FIFO_OVFL_STAT   0x33C05C
+#define TS_VALERR_CNTRL     0x33C060
+
+
+/* ---------------------------------------------------------------------- */
+/* VIP registers                                                          */
+
+#define MO_VIPD_DMA         0x340000 // {64}RWp VIP downstream
+#define MO_VIPU_DMA         0x340008 // {64}RWp VIP upstream
+#define MO_VIPD_GPCNT       0x34C020 // {16}RO VIP down general purpose counter
+#define MO_VIPU_GPCNT       0x34C024 // {16}RO VIP up general purpose counter
+#define MO_VIPD_GPCNTRL     0x34C030 // {2}WO VIP down general purpose control
+#define MO_VIPU_GPCNTRL     0x34C034 // {2}WO VIP up general purpose control
+#define MO_VIP_DMACNTRL     0x34C040 // {6}RW VIP DMA control
+#define MO_VIP_XFR_STAT     0x34C044 // {1}RO VIP transfer status
+#define MO_VIP_CFG          0x340048 // VIP configuration
+#define MO_VIPU_CNTRL       0x34004C // VIP upstream control #1
+#define MO_VIPD_CNTRL       0x340050 // VIP downstream control #2
+#define MO_VIPD_LNGTH       0x340054 // VIP downstream line length
+#define MO_VIP_BRSTLN       0x340058 // VIP burst length
+#define MO_VIP_INTCNTRL     0x34C05C // VIP Interrupt Control
+#define MO_VIP_XFTERM       0x340060 // VIP transfer terminate
+
+
+/* ---------------------------------------------------------------------- */
+/* misc registers                                                         */
+
+#define MO_M2M_DMA          0x350000 // {64}RWp Mem2Mem DMA Bfr
+#define MO_GP0_IO           0x350010 // {32}RW* GPIOoutput enablesdata I/O
+#define MO_GP1_IO           0x350014 // {32}RW* GPIOoutput enablesdata I/O
+#define MO_GP2_IO           0x350018 // {32}RW* GPIOoutput enablesdata I/O
+#define MO_GP3_IO           0x35001C // {32}RW* GPIO Mode/Ctrloutput enables
+#define MO_GPIO             0x350020 // {32}RW* GPIO I2C Ctrldata I/O
+#define MO_GPOE             0x350024 // {32}RW  GPIO I2C Ctrloutput enables
+#define MO_GP_ISM           0x350028 // {16}WO  GPIO Intr Sens/Pol
+
+#define MO_PLL_B            0x35C008 // {32}RW* PLL Control for ASB bus clks
+#define MO_M2M_CNT          0x35C024 // {32}RW  Mem2Mem DMA Cnt
+#define MO_M2M_XSUM         0x35C028 // {32}RO  M2M XOR-Checksum
+#define MO_CRC              0x35C02C // {16}RW  CRC16 init/result
+#define MO_CRC_D            0x35C030 // {32}WO  CRC16 new data in
+#define MO_TM_CNT_LDW       0x35C034 // {32}RO  Timer : Counter low dword
+#define MO_TM_CNT_UW        0x35C038 // {16}RO  Timer : Counter high word
+#define MO_TM_LMT_LDW       0x35C03C // {32}RW  Timer : Limit low dword
+#define MO_TM_LMT_UW        0x35C040 // {32}RW  Timer : Limit high word
+#define MO_PINMUX_IO        0x35C044 // {8}RW  Pin Mux Control
+#define MO_TSTSEL_IO        0x35C048 // {2}RW  Pin Mux Control
+#define MO_AFECFG_IO        0x35C04C // AFE configuration reg
+#define MO_DDS_IO           0x35C050 // DDS Increment reg
+#define MO_DDSCFG_IO        0x35C054 // DDS Configuration reg
+#define MO_SAMPLE_IO        0x35C058 // IRIn sample reg
+#define MO_SRST_IO          0x35C05C // Output system reset reg
+
+#define MO_INT1_MSK         0x35C060 // DMA RISC interrupt mask
+#define MO_INT1_STAT        0x35C064 // DMA RISC interrupt status
+#define MO_INT1_MSTAT       0x35C068 // DMA RISC interrupt masked status
+
+
+/* ---------------------------------------------------------------------- */
+/* i2c bus registers                                                      */
+
+#define MO_I2C              0x368000 // I2C data/control
+#define MO_I2C_DIV          (0xf<<4)
+#define MO_I2C_SYNC         (1<<3)
+#define MO_I2C_W3B          (1<<2)
+#define MO_I2C_SCL          (1<<1)
+#define MO_I2C_SDA          (1<<0)
+
+
+/* ---------------------------------------------------------------------- */
+/* general purpose host registers                                         */
+/* FIXME: tyops?  s/0x35/0x38/ ??                                         */
+
+#define MO_GPHSTD_DMA       0x350000 // {64}RWp Host downstream
+#define MO_GPHSTU_DMA       0x350008 // {64}RWp Host upstream
+#define MO_GPHSTD_GPCNT     0x35C020 // Host down general purpose counter
+#define MO_GPHSTU_GPCNT     0x35C024 // Host up general purpose counter
+#define MO_GPHSTD_GPCNTRL   0x38C030 // Host down general purpose control
+#define MO_GPHSTU_GPCNTRL   0x38C034 // Host up general purpose control
+#define MO_GPHST_DMACNTRL   0x38C040 // Host DMA control
+#define MO_GPHST_XFR_STAT   0x38C044 // Host transfer status
+#define MO_GPHSTU_CNTRL     0x380048 // Host upstream control #1
+#define MO_GPHSTD_CNTRL     0x38004C // Host downstream control #2
+#define MO_GPHSTD_LNGTH     0x380050 // Host downstream line length
+#define MO_GPHST_WSC        0x380054 // Host wait state control
+#define MO_GPHST_XFR        0x380058 // Host transfer control
+#define MO_GPHST_WDTH       0x38005C // Host interface width
+#define MO_GPHST_HDSHK      0x380060 // Host peripheral handshake
+#define MO_GPHST_MUX16      0x380064 // Host muxed 16-bit transfer parameters
+#define MO_GPHST_MODE       0x380068 // Host mode select
+
+
+/* ---------------------------------------------------------------------- */
+/* RISC instructions                                                      */
+
+#define RISC_SYNC		 0x80000000
+#define RISC_SYNC_ODD		 0x80000000
+#define RISC_SYNC_EVEN		 0x80000200
+#define RISC_RESYNC		 0x80008000
+#define RISC_RESYNC_ODD		 0x80008000
+#define RISC_RESYNC_EVEN	 0x80008200
+#define RISC_WRITE		 0x10000000
+#define RISC_WRITEC		 0x50000000
+#define RISC_READ		 0x90000000
+#define RISC_READC		 0xA0000000
+#define RISC_JUMP		 0x70000000
+#define RISC_SKIP		 0x20000000
+#define RISC_WRITERM		 0xB0000000
+#define RISC_WRITECM		 0xC0000000
+#define RISC_WRITECR		 0xD0000000
+#define RISC_IMM		 0x00000001
+
+#define RISC_SOL		 0x08000000
+#define RISC_EOL		 0x04000000
+
+#define RISC_IRQ2		 0x02000000
+#define RISC_IRQ1		 0x01000000
+
+#define RISC_CNT_NONE		 0x00000000
+#define RISC_CNT_INC		 0x00010000
+#define RISC_CNT_RSVR		 0x00020000
+#define RISC_CNT_RESET		 0x00030000
+#define RISC_JMP_SRP         	 0x01
+
+
+/* ---------------------------------------------------------------------- */
+/* various constants                                                      */
+
+#define SEL_BTSC     0x01 
+#define SEL_EIAJ     0x02 
+#define SEL_A2       0x04 
+#define SEL_SAP      0x08
+#define SEL_NICAM    0x10 
+#define SEL_FMRADIO  0x20
+
+// AUD_CTL
+#define EN_BTSC_FORCE_MONO      0
+#define EN_BTSC_FORCE_STEREO    1
+#define EN_BTSC_FORCE_SAP       2
+#define EN_BTSC_AUTO_STEREO     3
+#define EN_BTSC_AUTO_SAP        4
+
+#define EN_A2_FORCE_MONO1       8
+#define EN_A2_FORCE_MONO2       9
+#define EN_A2_FORCE_STEREO      10
+#define EN_A2_AUTO_MONO2        11
+#define EN_A2_AUTO_STEREO       12
+
+#define EN_EIAJ_FORCE_MONO1     16
+#define EN_EIAJ_FORCE_MONO2     17
+#define EN_EIAJ_FORCE_STEREO    18
+#define EN_EIAJ_AUTO_MONO2      19
+#define EN_EIAJ_AUTO_STEREO     20
+
+#define EN_NICAM_FORCE_MONO1    32
+#define EN_NICAM_FORCE_MONO2    33
+#define EN_NICAM_FORCE_STEREO   34
+#define EN_NICAM_AUTO_MONO2     35
+#define EN_NICAM_AUTO_STEREO    36
+
+#define EN_FMRADIO_FORCE_MONO   24
+#define EN_FMRADIO_FORCE_STEREO 25
+#define EN_FMRADIO_AUTO_STEREO  26
+
+#define EN_NICAM_AUTO_FALLBACK  0x00000040
+#define EN_FMRADIO_EN_RDS       0x00000200
+#define EN_NICAM_TRY_AGAIN_BIT  0x00000400
+#define EN_DAC_ENABLE           0x00001000
+#define EN_I2SOUT_ENABLE        0x00002000
+#define EN_I2SIN_STR2DAC        0x00004000
+#define EN_I2SIN_ENABLE         0x00008000
+
+#define EN_DMTRX_SUMDIFF        0x00000800
+#define EN_DMTRX_SUMR           0x00000880
+#define EN_DMTRX_LR             0x00000900
+#define EN_DMTRX_MONO           0x00000980
+
+// Video 
+#define VID_CAPTURE_CONTROL		0x310180
+
+#define CX23880_CAP_CTL_CAPTURE_VBI_ODD  (1<<3)
+#define CX23880_CAP_CTL_CAPTURE_VBI_EVEN (1<<2)
+#define CX23880_CAP_CTL_CAPTURE_ODD      (1<<1)
+#define CX23880_CAP_CTL_CAPTURE_EVEN     (1<<0)
+
+#define VideoInputMux0		 0x0
+#define VideoInputMux1		 0x1
+#define VideoInputMux2		 0x2
+#define VideoInputMux3		 0x3
+#define VideoInputTuner		 0x0 
+#define VideoInputComposite	 0x1 
+#define VideoInputSVideo	 0x2
+#define VideoInputOther		 0x3 
+
+#define Xtal0		 0x1
+#define Xtal1		 0x2
+#define XtalAuto	 0x3
+
+#define VideoFormatAuto		 0x0
+#define VideoFormatNTSC		 0x1
+#define VideoFormatNTSCJapan	 0x2
+#define VideoFormatNTSC443	 0x3
+#define VideoFormatPAL		 0x4
+#define VideoFormatPALB		 0x4 
+#define VideoFormatPALD		 0x4 
+#define VideoFormatPALG		 0x4 
+#define VideoFormatPALH		 0x4 
+#define VideoFormatPALI		 0x4 
+#define VideoFormatPALBDGHI	 0x4 
+#define VideoFormatPALM		 0x5
+#define VideoFormatPALN		 0x6
+#define VideoFormatPALNC	 0x7
+#define VideoFormatPAL60	 0x8
+#define VideoFormatSECAM	 0x9
+
+#define VideoFormatAuto27MHz		 0x10
+#define VideoFormatNTSC27MHz		 0x11
+#define VideoFormatNTSCJapan27MHz	 0x12
+#define VideoFormatNTSC44327MHz		 0x13
+#define VideoFormatPAL27MHz		 0x14
+#define VideoFormatPALB27MHz		 0x14 
+#define VideoFormatPALD27MHz		 0x14 
+#define VideoFormatPALG27MHz		 0x14 
+#define VideoFormatPALH27MHz		 0x14 
+#define VideoFormatPALI27MHz		 0x14 
+#define VideoFormatPALBDGHI27MHz	 0x14 
+#define VideoFormatPALM27MHz		 0x15
+#define VideoFormatPALN27MHz		 0x16
+#define VideoFormatPALNC27MHz		 0x17
+#define VideoFormatPAL6027MHz		 0x18
+#define VideoFormatSECAM27MHz		 0x19
+
+#define NominalUSECAM	 0x87
+#define NominalVSECAM	 0x85
+#define NominalUNTSC	 0xFE
+#define NominalVNTSC	 0xB4
+
+#define NominalContrast  0xD8
+
+#define HFilterAutoFormat	 0x0
+#define HFilterCIF		 0x1
+#define HFilterQCIF		 0x2
+#define HFilterICON		 0x3
+
+#define VFilter2TapInterpolate  0
+#define VFilter3TapInterpolate  1
+#define VFilter4TapInterpolate  2
+#define VFilter5TapInterpolate  3
+#define VFilter2TapNoInterpolate  4
+#define VFilter3TapNoInterpolate  5
+#define VFilter4TapNoInterpolate  6
+#define VFilter5TapNoInterpolate  7
+
+#define ColorFormatRGB32	 0x0000
+#define ColorFormatRGB24	 0x0011
+#define ColorFormatRGB16	 0x0022
+#define ColorFormatRGB15	 0x0033
+#define ColorFormatYUY2		 0x0044
+#define ColorFormatBTYUV	 0x0055
+#define ColorFormatY8		 0x0066
+#define ColorFormatRGB8		 0x0077
+#define ColorFormatPL422	 0x0088
+#define ColorFormatPL411	 0x0099
+#define ColorFormatYUV12	 0x00AA
+#define ColorFormatYUV9		 0x00BB
+#define ColorFormatRAW		 0x00EE
+#define ColorFormatBSWAP         0x0300
+#define ColorFormatWSWAP         0x0c00
+#define ColorFormatEvenMask      0x050f
+#define ColorFormatOddMask       0x0af0
+#define ColorFormatGamma         0x1000
+
+#define Interlaced		 0x1
+#define NonInterlaced	 	 0x0
+
+#define FieldEven		 0x1
+#define FieldOdd		 0x0
+
+#define TGReadWriteMode	 	 0x0
+#define TGEnableMode	 	 0x1
+
+#define DV_CbAlign		 0x0
+#define DV_Y0Align		 0x1
+#define DV_CrAlign		 0x2
+#define DV_Y1Align		 0x3
+
+#define DVF_Analog		 0x0
+#define DVF_CCIR656		 0x1
+#define DVF_ByteStream		 0x2
+#define DVF_ExtVSYNC		 0x4
+#define DVF_ExtField		 0x5
+
+#define CHANNEL_VID_Y		 0x1
+#define CHANNEL_VID_U		 0x2
+#define CHANNEL_VID_V		 0x3
+#define CHANNEL_VID_VBI		 0x4
+#define CHANNEL_AUD_DN		 0x5
+#define CHANNEL_AUD_UP		 0x6
+#define CHANNEL_AUD_RDS_DN	 0x7
+#define CHANNEL_MPEG_DN		 0x8
+#define CHANNEL_VIP_DN		 0x9
+#define CHANNEL_VIP_UP		 0xA
+#define CHANNEL_HOST_DN		 0xB
+#define CHANNEL_HOST_UP		 0xC
+#define CHANNEL_FIRST		 0x1 
+#define CHANNEL_LAST		 0xC 
+
+#define GP_COUNT_CONTROL_NONE		 0x0
+#define GP_COUNT_CONTROL_INC		 0x1
+#define GP_COUNT_CONTROL_RESERVED	 0x2
+#define GP_COUNT_CONTROL_RESET		 0x3
+
+#define PLL_PRESCALE_BY_2  2
+#define PLL_PRESCALE_BY_3  3
+#define PLL_PRESCALE_BY_4  4
+#define PLL_PRESCALE_BY_5  5
+
+#define HLNotchFilter4xFsc	 0
+#define HLNotchFilterSquare	 1
+#define HLNotchFilter135NTSC	 2
+#define HLNotchFilter135PAL	 3
+
+#define NTSC_8x_SUB_CARRIER  28.63636E6
+#define PAL_8x_SUB_CARRIER  35.46895E6
+
+// Default analog settings
+#define DEFAULT_HUE_NTSC			0x00
+#define DEFAULT_BRIGHTNESS_NTSC			0x00
+#define DEFAULT_CONTRAST_NTSC			0x39
+#define DEFAULT_SAT_U_NTSC			0x7F
+#define DEFAULT_SAT_V_NTSC			0x5A
+
+typedef enum                                                                          
+{                                                                                     
+	SOURCE_TUNER = 0,                                                             
+	SOURCE_COMPOSITE,                                                             
+	SOURCE_SVIDEO,                                                                
+	SOURCE_OTHER1,                                                                
+	SOURCE_OTHER2,                                                                
+	SOURCE_COMPVIASVIDEO,                                                         
+	SOURCE_CCIR656                                                                    
+} VIDEOSOURCETYPE;
+
+#endif /* _CX88_REG_H_ */
diff -Nru a/drivers/media/video/cx88/cx88-tvaudio.c b/drivers/media/video/cx88/cx88-tvaudio.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/video/cx88/cx88-tvaudio.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,472 @@
+/*
+    cx88x-audio.c - Conexant CX23880/23881 audio downstream driver driver
+
+     (c) 2001 Michael Eskin, Tom Zakrajsek [Windows version]
+     (c) 2002 Yurij Sysoev <yurij@naturesoft.net>
+     (c) 2003 Gerd Knorr <kraxel@bytesex.org>
+
+    -----------------------------------------------------------------------
+
+    Lot of voodoo here.  Even the data sheet doesn't help to
+    understand what is going on here, the documentation for the audio
+    part of the cx2388x chip is *very* bad.
+
+    Some of this comes from party done linux driver sources I got from
+    [undocumented].
+
+    Some comes from the dscaler sources, the dscaler driver guy works
+    for Conexant ...
+    
+    -----------------------------------------------------------------------
+    
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/slab.h>
+#include <linux/mm.h>
+#include <linux/poll.h>
+#include <linux/pci.h>
+#include <linux/signal.h>
+#include <linux/ioport.h>
+#include <linux/sched.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
+#include <linux/vmalloc.h>
+#include <linux/init.h>
+
+#include "cx88.h"
+
+static unsigned int audio_debug = UNSET;
+MODULE_PARM(audio_debug,"i");
+MODULE_PARM_DESC(audio_debug,"enable debug messages [audio]");
+
+#define dprintk(fmt, arg...)	if (audio_debug) \
+	printk(KERN_DEBUG "%s: " fmt, dev->name , ## arg)
+
+/* ----------------------------------------------------------- */
+
+struct rlist {
+	u32 reg;
+	u32 val;
+};
+
+static void set_audio_registers(struct cx8800_dev *dev,
+				const struct rlist *l)
+{
+	int i;
+
+	for (i = 0; l[i].reg; i++)
+		cx_write(l[i].reg, l[i].val);
+}
+
+static void set_audio_standard_BTSC(struct cx8800_dev *dev, unsigned int sap)
+{
+	dprintk("set_audio_standard_BTSC() [TODO]\n");
+}
+
+static void set_audio_standard_NICAM(struct cx8800_dev *dev)
+{
+	static const struct rlist nicam[] = {
+		//  increase level of input by 12dB
+		{ AUD_AFE_12DB_EN,         0x00000001 },
+
+    		// initialize NICAM                 
+    		{ AUD_INIT,                0x00000010 },
+    		{ AUD_INIT_LD,             0x00000001 },
+    		{ AUD_SOFT_RESET,          0x00000001 },
+    
+   		// WARNING!!!! Stereo mode is FORCED!!!!
+    		{ AUD_CTL,                 EN_DAC_ENABLE | EN_DMTRX_LR | EN_NICAM_FORCE_STEREO },
+    
+    		{ AUD_SOFT_RESET,          0x00000001 },
+    		{ AUD_RATE_ADJ1,           0x00000010 },
+    		{ AUD_RATE_ADJ2,           0x00000040 },
+    		{ AUD_RATE_ADJ3,           0x00000100 },
+    		{ AUD_RATE_ADJ4,           0x00000400 },
+    		{ AUD_RATE_ADJ5,           0x00001000 },
+    //		{ AUD_DMD_RA_DDS,          0x00c0d5ce },
+
+                { /* end of list */ },
+        };
+
+        printk("set_audio_standard_NICAM()\n");
+        set_audio_registers(dev, nicam);
+
+    	// setup QAM registers
+    	cx_write(0x320d01,                0x06);
+    	cx_write(0x320d02,                0x82);
+    	cx_write(0x320d03,                0x16);
+    	cx_write(0x320d04,                0x05);
+    	cx_write(0x320d2a,                0x34);
+    	cx_write(0x320d2b,                0x4c);
+
+    	// setup Audio PLL
+    	//cx_write(AUD_PLL_PRESCALE,        0x0002);
+    	//cx_write(AUD_PLL_INT,             0x001f);
+
+    	// de-assert Audio soft reset
+    	cx_write(AUD_SOFT_RESET,          0x00000000);  // Causes a pop every time
+}
+
+static void set_audio_standard_A2(struct cx8800_dev *dev)
+{
+	static const struct rlist a2[] = {
+		//  increase level of input by 12dB
+		{ AUD_AFE_12DB_EN,         0x00000001 },
+
+		//  initialize A2
+		{ AUD_INIT,                0x00000004 },
+		{ AUD_INIT_LD,             0x00000001 },
+		{ AUD_SOFT_RESET,          0x00000001 },
+    
+		// ; WARNING!!! A2 STEREO DEMATRIX HAS TO BE
+		// ; SET MANUALLY!!!  Value sould be 0x100c
+		{ AUD_CTL, EN_DAC_ENABLE | EN_DMTRX_SUMR | EN_A2_AUTO_STEREO },
+
+		{ AUD_DN0_FREQ,            0x0000312b },
+		{ AUD_POLY0_DDS_CONSTANT,  0x000a62b4 },
+		{ AUD_IIR1_0_SEL,          0x00000000 },
+		{ AUD_IIR1_1_SEL,          0x00000001 },
+		{ AUD_IIR1_2_SEL,          0x0000001f },
+		{ AUD_IIR1_3_SEL,          0x00000020 },
+		{ AUD_IIR1_4_SEL,          0x00000023 },
+		{ AUD_IIR1_5_SEL,          0x00000007 },
+		{ AUD_IIR1_0_SHIFT,        0x00000000 },
+		{ AUD_IIR1_1_SHIFT,        0x00000000 },
+		{ AUD_IIR1_2_SHIFT,        0x00000007 },
+		{ AUD_IIR1_3_SHIFT,        0x00000007 },
+		{ AUD_IIR1_4_SHIFT,        0x00000007 },
+		{ AUD_IIR1_5_SHIFT,        0x00000000 },
+		{ AUD_IIR2_0_SEL,          0x00000002 },
+		{ AUD_IIR2_1_SEL,          0x00000003 },
+		{ AUD_IIR2_2_SEL,          0x00000004 },
+		{ AUD_IIR2_3_SEL,          0x00000005 },
+		{ AUD_IIR3_0_SEL,          0x00000021 },
+		{ AUD_IIR3_1_SEL,          0x00000023 },
+		{ AUD_IIR3_2_SEL,          0x00000016 },
+		{ AUD_IIR3_0_SHIFT,        0x00000000 },
+		{ AUD_IIR3_1_SHIFT,        0x00000000 },
+		{ AUD_IIR3_2_SHIFT,        0x00000000 },
+		{ AUD_IIR4_0_SEL,          0x0000001d },
+		{ AUD_IIR4_1_SEL,          0x00000019 },
+		{ AUD_IIR4_2_SEL,          0x00000008 },
+		{ AUD_IIR4_0_SHIFT,        0x00000000 },
+		{ AUD_IIR4_1_SHIFT,        0x00000000 },
+		{ AUD_IIR4_2_SHIFT,        0x00000001 },
+		{ AUD_IIR4_0_CA0,          0x0003e57e },
+		{ AUD_IIR4_0_CA1,          0x00005e11 },
+		{ AUD_IIR4_0_CA2,          0x0003a7cf },
+		{ AUD_IIR4_0_CB0,          0x00002368 },
+		{ AUD_IIR4_0_CB1,          0x0003bf1b },
+		{ AUD_IIR4_1_CA0,          0x00006349 },
+		{ AUD_IIR4_1_CA1,          0x00006f27 },
+		{ AUD_IIR4_1_CA2,          0x0000e7a3 },
+		{ AUD_IIR4_1_CB0,          0x00005653 },
+		{ AUD_IIR4_1_CB1,          0x0000cf97 },
+		{ AUD_IIR4_2_CA0,          0x00006349 },
+		{ AUD_IIR4_2_CA1,          0x00006f27 },
+		{ AUD_IIR4_2_CA2,          0x0000e7a3 },
+		{ AUD_IIR4_2_CB0,          0x00005653 },
+		{ AUD_IIR4_2_CB1,          0x0000cf97 },
+		{ AUD_HP_MD_IIR4_1,        0x00000001 },
+		{ AUD_HP_PROG_IIR4_1,      0x00000017 },
+		{ AUD_DN1_FREQ,            0x00003618 },
+		{ AUD_DN1_SRC_SEL,         0x00000017 },
+		{ AUD_DN1_SHFT,            0x00000007 },
+		{ AUD_DN1_AFC,             0x00000000 },
+		{ AUD_DN1_FREQ_SHIFT,      0x00000000 },
+		{ AUD_DN2_SRC_SEL,         0x00000040 },
+		{ AUD_DN2_SHFT,            0x00000000 },
+		{ AUD_DN2_AFC,             0x00000002 },
+		{ AUD_DN2_FREQ,            0x0000caaf },
+		{ AUD_DN2_FREQ_SHIFT,      0x00000000 },
+		{ AUD_PDET_SRC,            0x00000014 },
+		{ AUD_PDET_SHIFT,          0x00000000 },
+		{ AUD_DEEMPH0_SRC_SEL,     0x00000011 },
+		{ AUD_DEEMPH1_SRC_SEL,     0x00000013 },
+		{ AUD_DEEMPH0_SHIFT,       0x00000000 },
+		{ AUD_DEEMPH1_SHIFT,       0x00000000 },
+		{ AUD_DEEMPH0_G0,          0x000004da },
+		{ AUD_DEEMPH0_A0,          0x0000777a },
+		{ AUD_DEEMPH0_B0,          0x00000000 },
+		{ AUD_DEEMPH0_A1,          0x0003f062 },
+		{ AUD_DEEMPH0_B1,          0x00000000 },
+		{ AUD_DEEMPH1_G0,          0x000004da },
+		{ AUD_DEEMPH1_A0,          0x0000777a },
+		{ AUD_DEEMPH1_B0,          0x00000000 },
+		{ AUD_DEEMPH1_A1,          0x0003f062 },
+		{ AUD_DEEMPH1_B1,          0x00000000 },
+		{ AUD_PLL_EN,              0x00000000 },
+		{ AUD_DMD_RA_DDS,          0x002a4efb },
+		{ AUD_RATE_ADJ1,           0x00001000 },
+		{ AUD_RATE_ADJ2,           0x00002000 },
+		{ AUD_RATE_ADJ3,           0x00003000 },
+		{ AUD_RATE_ADJ4,           0x00004000 },
+		{ AUD_RATE_ADJ5,           0x00005000 },
+		{ AUD_C2_UP_THR,           0x0000ffff },
+		{ AUD_C2_LO_THR,           0x0000e800 },
+		{ AUD_C1_UP_THR,           0x00008c00 },
+		{ AUD_C1_LO_THR,           0x00006c00 },
+
+		//   ; Completely ditch AFC feedback
+		{ AUD_DCOC_0_SRC,          0x00000021 },
+		{ AUD_DCOC_1_SRC,          0x0000001a },
+		{ AUD_DCOC1_SHIFT,         0x00000000 },
+		{ AUD_DCOC_1_SHIFT_IN0,    0x0000000a },
+		{ AUD_DCOC_1_SHIFT_IN1,    0x00000008 },
+		{ AUD_DCOC_PASS_IN,        0x00000000 },
+		{ AUD_IIR4_0_SEL,          0x00000023 },
+
+		//  ; Completely ditc FM-2 AFC feedback
+		{ AUD_DN1_AFC,             0x00000000 },
+		{ AUD_DCOC_2_SRC,          0x0000001b },
+		{ AUD_IIR4_1_SEL,          0x00000025 },
+
+		// ; WARNING!!! THIS CHANGE WAS NOT EXPECTED!!!
+		// ; Swap I & Q inputs into second rotator
+		// ; to reverse frequency and therefor invert
+		// ; phase from the cordic FM demodulator
+		// ; (frequency rotation must also be reversed
+		{ AUD_DN2_SRC_SEL,         0x00000001 },
+		{ AUD_DN2_FREQ,            0x00003551 },
+
+
+		//  setup Audio PLL
+		{ AUD_PLL_PRESCALE,        0x00000002 },
+		{ AUD_PLL_INT,             0x0000001f },
+
+		//  de-assert Audio soft reset
+		{ AUD_SOFT_RESET,          0x00000000 },
+
+		{ /* end of list */ },
+	};
+
+	dprintk("set_audio_standard_A2()\n");
+	set_audio_registers(dev, a2);
+}
+
+static void set_audio_standard_EIAJ(struct cx8800_dev *dev)
+{
+	dprintk("set_audio_standard_EIAJ() [TODO]\n");
+}
+
+static void set_audio_standard_FM(struct cx8800_dev *dev)
+{
+	dprintk("set_audio_standard_FM\n");
+
+	// initialize FM Radio
+	cx_write(AUD_INIT,0x0020);
+	cx_write(AUD_INIT_LD,0x0001);
+	cx_write(AUD_SOFT_RESET,0x0001);
+
+#if 0 /* FIXME */
+	switch (dev->audio_properties.FM_deemphasis)
+	{
+		case WW_FM_DEEMPH_50:
+			//Set De-emphasis filter coefficients for 50 usec
+			cx_write(AUD_DEEMPH0_G0, 0x0C45);
+			cx_write(AUD_DEEMPH0_A0, 0x6262);
+			cx_write(AUD_DEEMPH0_B0, 0x1C29);
+			cx_write(AUD_DEEMPH0_A1, 0x3FC66);
+			cx_write(AUD_DEEMPH0_B1, 0x399A);
+
+			cx_write(AUD_DEEMPH1_G0, 0x0D80);
+			cx_write(AUD_DEEMPH1_A0, 0x6262);
+			cx_write(AUD_DEEMPH1_B0, 0x1C29);
+			cx_write(AUD_DEEMPH1_A1, 0x3FC66);
+			cx_write(AUD_DEEMPH1_B1, 0x399A);
+			
+			break;
+
+		case WW_FM_DEEMPH_75:
+			//Set De-emphasis filter coefficients for 75 usec
+			cx_write(AUD_DEEMPH0_G0, 0x91B );
+			cx_write(AUD_DEEMPH0_A0, 0x6B68);
+			cx_write(AUD_DEEMPH0_B0, 0x11EC);
+			cx_write(AUD_DEEMPH0_A1, 0x3FC66);
+			cx_write(AUD_DEEMPH0_B1, 0x399A);
+
+			cx_write(AUD_DEEMPH1_G0, 0xAA0 );
+			cx_write(AUD_DEEMPH1_A0, 0x6B68);
+			cx_write(AUD_DEEMPH1_B0, 0x11EC);
+			cx_write(AUD_DEEMPH1_A1, 0x3FC66);
+			cx_write(AUD_DEEMPH1_B1, 0x399A);
+
+			break;
+	}
+#endif
+
+	// de-assert Audio soft reset
+	cx_write(AUD_SOFT_RESET,0x0000);
+
+	// AB: 10/2/01: this register is not being reset appropriately on occasion.
+	cx_write(AUD_POLYPH80SCALEFAC,3);
+}
+
+/* ----------------------------------------------------------- */
+
+void cx88_set_tvaudio(struct cx8800_dev *dev)
+{
+	cx_write(AUD_CTL, 0x00);
+
+	switch (dev->tvaudio) {
+	case WW_BTSC:
+		set_audio_standard_BTSC(dev,0);
+		break;
+	case WW_NICAM_I:
+	case WW_NICAM_BGDKL:
+		set_audio_standard_NICAM(dev);
+		break;
+	case WW_A2_BG:
+	case WW_A2_DK:
+	case WW_A2_M:
+		set_audio_standard_A2(dev);
+		break;
+	case WW_EIAJ:
+		set_audio_standard_EIAJ(dev);
+		break;
+	case WW_FM:
+		set_audio_standard_FM(dev);
+		break;
+	case WW_NONE:
+	default:
+		printk("%s: unknown tv audio mode [%d]\n",
+		       dev->name, dev->tvaudio);
+		break;
+	}
+
+	// unmute
+	cx_set(AUD_CTL, EN_DAC_ENABLE);
+	cx_write(AUD_VOL_CTL, 0x00);
+	return;
+}
+
+void cx88_get_stereo(struct cx8800_dev *dev, struct v4l2_tuner *t)
+{
+	static char *m[] = {"mono", "dual mono", "stereo", "sap"};
+	static char *p[] = {"no pilot", "pilot c1", "pilot c2", "?"};
+	u32 reg,mode,pilot;
+
+	reg   = cx_read(AUD_STATUS);
+	mode  = reg & 0x03;
+	pilot = (reg >> 2) & 0x03;
+	dprintk("AUD_STATUS: %s / %s [status=0x%x,ctl=0x%x,vol=0x%x]\n",
+		m[mode], p[pilot], reg,
+		cx_read(AUD_CTL), cx_read(AUD_VOL_CTL));
+
+	t->capability = V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_SAP |
+		V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2;
+	t->rxsubchans = V4L2_TUNER_SUB_MONO;
+	t->audmode    = V4L2_TUNER_MODE_MONO;
+
+	switch (dev->tvaudio) {
+	case WW_A2_BG:
+ 		if (2 == pilot) {
+			/* stereo */
+			t->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
+			if (2 == mode)
+				t->audmode = V4L2_TUNER_MODE_STEREO;
+		}
+ 		if (1 == pilot) {
+			/* dual language -- FIXME */
+			t->rxsubchans = V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2;
+			t->audmode = V4L2_TUNER_MODE_LANG1;
+		}
+		break;
+	case WW_NICAM_BGDKL:
+		if (2 == mode)
+			t->audmode = V4L2_TUNER_MODE_STEREO;
+		break;
+	default:
+		t->rxsubchans = V4L2_TUNER_SUB_MONO;
+		t->audmode    = V4L2_TUNER_MODE_MONO;
+		break;
+	}
+	return;
+}
+
+void cx88_set_stereo(struct cx8800_dev *dev, u32 mode)
+{
+	u32 ctl  = UNSET;
+	u32 mask = UNSET;
+
+	switch (dev->tvaudio) {
+	case WW_A2_BG:
+		switch (mode) {
+		case V4L2_TUNER_MODE_MONO:   
+		case V4L2_TUNER_MODE_LANG1:
+			ctl  = EN_A2_FORCE_MONO1;
+			mask = 0x3f;
+			break;
+		case V4L2_TUNER_MODE_LANG2:
+			ctl  = EN_A2_AUTO_MONO2;
+			mask = 0x3f;
+			break;
+		case V4L2_TUNER_MODE_STEREO:
+			ctl  = EN_A2_AUTO_STEREO | EN_DMTRX_SUMR;
+			mask = 0x8bf;
+			break;
+		}
+		break;
+	case WW_NICAM_BGDKL:
+		switch (mode) {
+		case V4L2_TUNER_MODE_MONO:   
+			ctl  = EN_NICAM_FORCE_MONO1;
+			mask = 0x3f;
+			break;
+		case V4L2_TUNER_MODE_LANG1:
+			ctl  = EN_NICAM_AUTO_MONO2;
+			mask = 0x3f;
+			break;
+		case V4L2_TUNER_MODE_STEREO:
+			ctl  = EN_NICAM_FORCE_STEREO | EN_DMTRX_LR;
+			mask = 0x93f;
+			break;
+		}
+		break;	
+	case WW_FM:
+		switch (mode) {
+		case V4L2_TUNER_MODE_MONO:   
+			ctl  = EN_FMRADIO_FORCE_MONO;
+			mask = 0x3f;
+			break;
+		case V4L2_TUNER_MODE_STEREO:
+			ctl  = EN_FMRADIO_AUTO_STEREO;
+			mask = 0x3f;
+			break;
+		}
+		break;	
+	}
+
+	if (UNSET != ctl) {
+		cx_write(AUD_SOFT_RESET, 0x0001);
+		cx_andor(AUD_CTL, mask, ctl);
+		cx_write(AUD_SOFT_RESET, 0x0000);
+		dprintk("cx88_set_stereo: mask 0x%x, ctl 0x%x "
+			"[status=0x%x,ctl=0x%x,vol=0x%x]\n",
+			mask, ctl, cx_read(AUD_STATUS),
+			cx_read(AUD_CTL), cx_read(AUD_VOL_CTL));
+	}
+	return;
+}
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff -Nru a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/video/cx88/cx88-video.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,2246 @@
+/*
+ * device driver for Conexant 2388x based TV cards
+ * video4linux video interface
+ *
+ * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#define __NO_VERSION__ 1
+
+#include <linux/init.h>
+#include <linux/list.h>
+#include <linux/module.h>
+#include <linux/kmod.h>
+#include <linux/kernel.h>
+#include <linux/slab.h>
+#include <linux/interrupt.h>
+#include <asm/div64.h>
+
+#include "cx88.h"
+
+MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards");
+MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
+MODULE_LICENSE("GPL");
+
+/* ------------------------------------------------------------------ */
+
+static unsigned int video_nr[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
+MODULE_PARM(video_nr,"1-" __stringify(CX88_MAXBOARDS) "i");
+MODULE_PARM_DESC(video_nr,"video device numbers");
+
+static unsigned int radio_nr[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
+MODULE_PARM(radio_nr,"1-" __stringify(CX88_MAXBOARDS) "i");
+MODULE_PARM_DESC(radio_nr,"radio device numbers");
+
+static unsigned int latency = UNSET;
+MODULE_PARM(latency,"i");
+MODULE_PARM_DESC(latency,"pci latency timer");
+
+static unsigned int video_debug = 0;
+MODULE_PARM(video_debug,"i");
+MODULE_PARM_DESC(video_debug,"enable debug messages [video]");
+
+static unsigned int irq_debug = 0;
+MODULE_PARM(irq_debug,"i");
+MODULE_PARM_DESC(irq_debug,"enable debug messages [IRQ handler]");
+
+static unsigned int vid_limit = 16;
+MODULE_PARM(vid_limit,"i");
+MODULE_PARM_DESC(vid_limit,"capture memory limit in megabytes");
+
+static unsigned int tuner[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
+MODULE_PARM(tuner,"1-" __stringify(CX88_MAXBOARDS) "i");
+MODULE_PARM_DESC(tuner,"tuner type");
+
+static unsigned int card[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
+MODULE_PARM(card,"1-" __stringify(CX88_MAXBOARDS) "i");
+MODULE_PARM_DESC(card,"card type");
+
+static unsigned int nicam = 0;
+MODULE_PARM(nicam,"i");
+MODULE_PARM_DESC(nicam,"tv audio is nicam");
+
+#define dprintk(level,fmt, arg...)	if (video_debug >= level) \
+	printk(KERN_DEBUG "%s: " fmt, dev->name , ## arg)
+
+/* ------------------------------------------------------------------ */
+
+static struct list_head  cx8800_devlist;
+static unsigned int      cx8800_devcount;
+
+/* ------------------------------------------------------------------- */
+/* static data                                                         */
+
+static unsigned int inline norm_swidth(struct cx8800_tvnorm *norm)
+{
+	return (norm->id & V4L2_STD_625_50) ? 922 : 754;
+}
+
+static unsigned int inline norm_hdelay(struct cx8800_tvnorm *norm)
+{
+	return (norm->id & V4L2_STD_625_50) ? 186 : 135;
+}
+
+static unsigned int inline norm_vdelay(struct cx8800_tvnorm *norm)
+{
+	return (norm->id & V4L2_STD_625_50) ? 0x24 : 0x18;
+}
+
+static unsigned int inline norm_maxw(struct cx8800_tvnorm *norm)
+{
+	return (norm->id & V4L2_STD_625_50) ? 768 : 640;
+//	return (norm->id & V4L2_STD_625_50) ? 720 : 640;
+}
+
+static unsigned int inline norm_maxh(struct cx8800_tvnorm *norm)
+{
+	return (norm->id & V4L2_STD_625_50) ? 576 : 480;
+}
+
+static unsigned int inline norm_fsc8(struct cx8800_tvnorm *norm)
+{
+	static const unsigned int ntsc = 28636360;
+	static const unsigned int pal  = 35468950;
+	
+	return (norm->id & V4L2_STD_625_50) ? pal : ntsc;
+}
+
+static unsigned int inline norm_notchfilter(struct cx8800_tvnorm *norm)
+{
+	return (norm->id & V4L2_STD_625_50)
+		? HLNotchFilter135PAL
+		: HLNotchFilter135NTSC;
+}
+
+static unsigned int inline norm_htotal(struct cx8800_tvnorm *norm)
+{
+	return (norm->id & V4L2_STD_625_50) ? 1135 : 910;
+}
+
+static struct cx8800_tvnorm tvnorms[] = {
+	{
+		.name      = "NTSC-M",
+		.id        = V4L2_STD_NTSC_M,
+		.cxiformat = VideoFormatNTSC,
+	},{
+		.name      = "NTSC-JP",
+		.id        = V4L2_STD_NTSC_M_JP,
+		.cxiformat = VideoFormatNTSCJapan,
+#if 0
+	},{
+		.name      = "NTSC-4.43",
+		.id        = FIXME,
+		.cxiformat = VideoFormatNTSC443,
+#endif
+	},{
+		.name      = "PAL",
+		.id        = V4L2_STD_PAL,
+		.cxiformat = VideoFormatPAL,
+        },{
+		.name      = "PAL-M",
+		.id        = V4L2_STD_PAL_M,
+		.cxiformat = VideoFormatPALM,
+	},{
+		.name      = "PAL-N",
+		.id        = V4L2_STD_PAL_N,
+		.cxiformat = VideoFormatPALN,
+	},{
+		.name      = "PAL-Nc",
+		.id        = V4L2_STD_PAL_Nc,
+		.cxiformat = VideoFormatPALNC,
+	},{
+		.name      = "PAL-60",
+		.id        = V4L2_STD_PAL_60,
+		.cxiformat = VideoFormatPAL60,
+	},{
+		.name      = "SECAM",
+		.id        = V4L2_STD_SECAM,
+		.cxiformat = VideoFormatSECAM,
+	}
+};
+
+static struct cx8800_fmt formats[] = {
+	{
+		.name     = "8 bpp, gray",
+		.fourcc   = V4L2_PIX_FMT_GREY,
+		.cxformat = ColorFormatY8,
+		.depth    = 8,
+		.flags    = FORMAT_FLAGS_PACKED,
+	},{
+		.name     = "15 bpp RGB, le",
+		.fourcc   = V4L2_PIX_FMT_RGB555,
+		.cxformat = ColorFormatRGB15,
+		.depth    = 16,
+		.flags    = FORMAT_FLAGS_PACKED,
+	},{
+		.name     = "15 bpp RGB, be",
+		.fourcc   = V4L2_PIX_FMT_RGB555X,
+		.cxformat = ColorFormatRGB15 | ColorFormatBSWAP,
+		.depth    = 16,
+		.flags    = FORMAT_FLAGS_PACKED,
+	},{
+		.name     = "16 bpp RGB, le",
+		.fourcc   = V4L2_PIX_FMT_RGB565,
+		.cxformat = ColorFormatRGB16,
+		.depth    = 16,
+		.flags    = FORMAT_FLAGS_PACKED,
+	},{
+		.name     = "16 bpp RGB, be",
+		.fourcc   = V4L2_PIX_FMT_RGB565X,
+		.cxformat = ColorFormatRGB16 | ColorFormatBSWAP,
+		.depth    = 16,
+		.flags    = FORMAT_FLAGS_PACKED,
+	},{
+		.name     = "24 bpp RGB, le",
+		.fourcc   = V4L2_PIX_FMT_BGR24,
+		.cxformat = ColorFormatRGB24,
+		.depth    = 24,
+		.flags    = FORMAT_FLAGS_PACKED,
+	},{
+		.name     = "32 bpp RGB, le",
+		.fourcc   = V4L2_PIX_FMT_BGR32,
+		.cxformat = ColorFormatRGB32,
+		.depth    = 32,
+		.flags    = FORMAT_FLAGS_PACKED,
+	},{
+		.name     = "32 bpp RGB, be",
+		.fourcc   = V4L2_PIX_FMT_RGB32,
+		.cxformat = ColorFormatRGB32 | ColorFormatBSWAP | ColorFormatWSWAP,
+		.depth    = 32,
+		.flags    = FORMAT_FLAGS_PACKED,
+	},{
+		.name     = "4:2:2, packed, YUYV",
+		.fourcc   = V4L2_PIX_FMT_YUYV,
+		.cxformat = ColorFormatYUY2,
+		.depth    = 16,
+		.flags    = FORMAT_FLAGS_PACKED,
+	},{
+		.name     = "4:2:2, packed, UYVY",
+		.fourcc   = V4L2_PIX_FMT_UYVY,
+		.cxformat = ColorFormatYUY2 | ColorFormatBSWAP,
+		.depth    = 16,
+		.flags    = FORMAT_FLAGS_PACKED,
+	},
+};
+
+static struct cx8800_fmt* format_by_fourcc(unsigned int fourcc)
+{
+	unsigned int i;
+	
+	for (i = 0; i < ARRAY_SIZE(formats); i++)
+		if (formats[i].fourcc == fourcc)
+			return formats+i;
+	return NULL;
+}
+
+/* ------------------------------------------------------------------- */
+
+static const struct v4l2_queryctrl no_ctl = {
+	.name  = "42",
+	.flags = V4L2_CTRL_FLAG_DISABLED,
+};
+
+static struct cx88_ctrl cx8800_ctls[] = {
+	/* --- video --- */
+	{
+		.v = {
+			.id            = V4L2_CID_BRIGHTNESS,
+			.name          = "Brightness",
+			.minimum       = 0x00,
+			.maximum       = 0xff,
+			.step          = 1,
+			.default_value = 0,
+			.type          = V4L2_CTRL_TYPE_INTEGER,
+		},
+		.off             = 128,
+		.reg             = MO_CONTR_BRIGHT,
+		.mask            = 0x00ff,
+		.shift           = 0,
+	},{
+		.v = {
+			.id            = V4L2_CID_CONTRAST,
+			.name          = "Contrast",
+			.minimum       = 0,
+			.maximum       = 0xff,
+			.step          = 1,
+			.default_value = 0,
+			.type          = V4L2_CTRL_TYPE_INTEGER,
+		},
+		.reg             = MO_CONTR_BRIGHT,
+		.mask            = 0xff00,
+		.shift           = 8,
+	},{
+	/* --- audio --- */
+#if 0
+		.v = {
+			.id            = V4L2_CID_AUDIO_MUTE,
+			.name          = "Mute",
+			.minimum       = 0,
+			.maximum       = 1,
+			.type          = V4L2_CTRL_TYPE_BOOLEAN,
+		},
+		.reg             = AUD_VOL_CTL,
+		.mask            = (1 << 6),
+		.shift           = 6,
+	},{
+#endif
+		.v = {
+			.id            = V4L2_CID_AUDIO_VOLUME,
+			.name          = "Volume",
+			.minimum       = 0,
+			.maximum       = 0x3f,
+			.step          = 1,
+			.default_value = 0,
+			.type          = V4L2_CTRL_TYPE_INTEGER,
+		},
+		.reg             = AUD_VOL_CTL,
+		.mask            = 0x3f,
+		.shift           = 0,
+	}
+};
+const int CX8800_CTLS = ARRAY_SIZE(cx8800_ctls);
+
+/* ------------------------------------------------------------------- */
+/* resource management                                                 */
+
+static int res_get(struct cx8800_dev *dev, struct cx8800_fh *fh, unsigned int bit)
+{
+	if (fh->resources & bit)
+		/* have it already allocated */
+		return 1;
+
+	/* is it free? */
+	down(&dev->lock);
+	if (dev->resources & bit) {
+		/* no, someone else uses it */
+		up(&dev->lock);
+		return 0;
+	}
+	/* it's free, grab it */
+	fh->resources  |= bit;
+	dev->resources |= bit;
+	dprintk(1,"res: get %d\n",bit);
+	up(&dev->lock);
+	return 1;
+}
+
+static
+int res_check(struct cx8800_fh *fh, unsigned int bit)
+{
+	return (fh->resources & bit);
+}
+
+#if 0
+static
+int res_locked(struct cx8800_dev *dev, unsigned int bit)
+{
+	return (dev->resources & bit);
+}
+#endif
+
+static
+void res_free(struct cx8800_dev *dev, struct cx8800_fh *fh, unsigned int bits)
+{
+	if ((fh->resources & bits) != bits)
+		BUG();
+
+	down(&dev->lock);
+	fh->resources  &= ~bits;
+	dev->resources &= ~bits;
+	dprintk(1,"res: put %d\n",bits);
+	up(&dev->lock);
+}
+
+/* ------------------------------------------------------------------ */
+
+static const u32 xtal = 28636363;
+
+static int set_pll(struct cx8800_dev *dev, int prescale, u32 ofreq)
+{
+	static u32 pre[] = { 0, 0, 0, 3, 2, 1 };
+	u64 pll;
+	u32 reg;
+	int i;
+
+	if (prescale < 2)
+		prescale = 2;
+	if (prescale > 5)
+		prescale = 5;
+
+	pll = ofreq * 8 * prescale * (u64)(1 << 20);
+	do_div(pll,xtal);
+	reg = (pll & 0x3ffffff) | (pre[prescale] << 26);
+	if (((reg >> 20) & 0x3f) < 14) {
+		printk("%s: pll out of range\n",dev->name);
+		return -1;
+	}
+		
+	dprintk(1,"set_pll:    MO_PLL_REG       0x%08x [old=0x%08x,freq=%d]\n",
+		reg, cx_read(MO_PLL_REG), ofreq);
+	cx_write(MO_PLL_REG, reg);
+	for (i = 0; i < 10; i++) {
+		reg = cx_read(MO_DEVICE_STATUS);
+		if (reg & (1<<2)) {
+			dprintk(1,"pll locked [pre=%d,ofreq=%d]\n",
+				prescale,ofreq);
+			return 0;
+		}
+		dprintk(1,"pll not locked yet, waiting ...\n");
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(HZ/10);
+	}
+	dprintk(1,"pll NOT locked [pre=%d,ofreq=%d]\n",prescale,ofreq);
+	return -1;
+}
+
+static int set_tvaudio(struct cx8800_dev *dev)
+{
+	if (CX88_VMUX_TELEVISION != INPUT(dev->input)->type)
+		return 0;
+
+
+	dev->tvaudio = 0;
+	if (dev->tvnorm->id & V4L2_STD_PAL) {
+		if (nicam)
+			dev->tvaudio = WW_NICAM_BGDKL;
+		else
+			dev->tvaudio = WW_A2_BG;
+	}
+	if (0 == dev->tvaudio)
+		return 0;
+
+	cx_andor(MO_AFECFG_IO,    0x1f, 0x0);
+	cx88_set_tvaudio(dev);
+	//cx88_set_stereo(dev,norm->tvaudio, V4L2_TUNER_MODE_MONO);
+	//cx_write(MO_AUD_DMACNTRL, 0x03); /* need audio fifo */
+	return 0;
+}
+
+static int set_tvnorm(struct cx8800_dev *dev, struct cx8800_tvnorm *norm)
+{
+	u32 fsc8;
+	u32 adc_clock;
+	u32 vdec_clock;
+	u64 tmp64;
+	u32 bdelay,agcdelay,htotal;
+	struct video_channel c;
+	
+	dev->tvnorm = norm;
+	fsc8       = norm_fsc8(norm);
+	adc_clock  = xtal;
+	vdec_clock = fsc8;
+
+	dprintk(1,"set_tvnorm: \"%s\" fsc8=%d adc=%d vdec=%d\n",
+		norm->name, fsc8, adc_clock, vdec_clock);
+	set_pll(dev,2,vdec_clock);
+	
+	dprintk(1,"set_tvnorm: MO_INPUT_FORMAT  0x%08x [old=0x%08x]\n",
+		norm->cxiformat, cx_read(MO_INPUT_FORMAT) & 0x0f);
+	cx_andor(MO_INPUT_FORMAT, 0xf, norm->cxiformat);
+
+#if 1
+	// FIXME: as-is from DScaler
+	dprintk(1,"set_tvnorm: MO_OUTPUT_FORMAT 0x%08x [old=0x%08x]\n",
+		0x1c1f0008, cx_read(MO_OUTPUT_FORMAT));
+	cx_write(MO_OUTPUT_FORMAT, 0x1c1f0008);
+#endif
+
+	// MO_SCONV_REG = adc clock / video dec clock * 2^17
+	tmp64  = adc_clock * (u64)(1 << 17);
+	do_div(tmp64, vdec_clock);
+	dprintk(1,"set_tvnorm: MO_SCONV_REG     0x%08x [old=0x%08x]\n",
+		(u32)tmp64, cx_read(MO_SCONV_REG));
+	cx_write(MO_SCONV_REG, (u32)tmp64);
+
+	// MO_SUB_STEP = 8 * fsc / video dec clock * 2^22
+	tmp64  = fsc8 * (u64)(1 << 22);
+	do_div(tmp64, vdec_clock);
+	dprintk(1,"set_tvnorm: MO_SUB_STEP      0x%08x [old=0x%08x]\n",
+		(u32)tmp64, cx_read(MO_SUB_STEP));
+	cx_write(MO_SUB_STEP, (u32)tmp64);
+
+	// MO_SUB_STEP_DR = 8 * 4406250 / video dec clock * 2^22
+	tmp64  = 4406250 * 8 * (u64)(1 << 22);
+	do_div(tmp64, vdec_clock);
+	dprintk(1,"set_tvnorm: MO_SUB_STEP_DR   0x%08x [old=0x%08x]\n",
+		(u32)tmp64, cx_read(MO_SUB_STEP_DR));
+	cx_write(MO_SUB_STEP_DR, (u32)tmp64);
+
+	// bdelay + agcdelay
+	bdelay   = vdec_clock * 65 / 20000000 + 21;
+	agcdelay = vdec_clock * 68 / 20000000 + 15;
+	dprintk(1,"set_tvnorm: MO_AGC_BURST     0x%08x [old=0x%08x,bdelay=%d,agcdelay=%d]\n",
+		(bdelay << 8) | agcdelay, cx_read(MO_AGC_BURST), bdelay, agcdelay);
+	cx_write(MO_AGC_BURST, (bdelay << 8) | agcdelay);
+
+	// htotal
+	tmp64 = norm_htotal(norm) * (u64)vdec_clock;
+	do_div(tmp64, fsc8);
+	htotal = (u32)tmp64 | (norm_notchfilter(norm) << 11);
+	dprintk(1,"set_tvnorm: MO_HTOTAL        0x%08x [old=0x%08x,htotal=%d]\n",
+		htotal, cx_read(MO_HTOTAL), (u32)tmp64);
+	cx_write(MO_HTOTAL, htotal);
+	
+	// audio
+	set_tvaudio(dev);
+
+	// tell i2c chips
+	memset(&c,0,sizeof(c));
+	c.channel = dev->input;
+	c.norm = VIDEO_MODE_PAL;
+	if ((norm->id & (V4L2_STD_NTSC_M|V4L2_STD_NTSC_M_JP)))
+		c.norm = VIDEO_MODE_NTSC;
+	if (norm->id & V4L2_STD_SECAM)
+		c.norm = VIDEO_MODE_SECAM;
+	cx8800_call_i2c_clients(dev,VIDIOCSCHAN,&c);
+
+	// done
+	return 0;
+}
+
+static int set_scale(struct cx8800_dev *dev, unsigned int width, unsigned int height,
+		     int interlaced)
+{
+	unsigned int swidth  = norm_swidth(dev->tvnorm);
+	unsigned int sheight = norm_maxh(dev->tvnorm);
+	u32 value;
+
+	dprintk(1,"set_scale: %dx%d [%s]\n", width, height, dev->tvnorm->name);
+
+	// recalc H delay and scale registers
+	value = (width * norm_hdelay(dev->tvnorm)) / swidth;
+	cx_write(MO_HDELAY_EVEN,  value);
+	cx_write(MO_HDELAY_ODD,   value);
+	dprintk(1,"set_scale: hdelay  0x%04x\n", value);
+	
+	value = (swidth * 4096 / width) - 4096;
+	cx_write(MO_HSCALE_EVEN,  value);
+	cx_write(MO_HSCALE_ODD,   value);
+	dprintk(1,"set_scale: hscale  0x%04x\n", value);
+
+	cx_write(MO_HACTIVE_EVEN, width);
+	cx_write(MO_HACTIVE_ODD,  width);
+	dprintk(1,"set_scale: hactive 0x%04x\n", width);
+	
+	// recalc V scale Register (delay is constant)
+	cx_write(MO_VDELAY_EVEN, norm_vdelay(dev->tvnorm));
+	cx_write(MO_VDELAY_ODD,  norm_vdelay(dev->tvnorm));
+	dprintk(1,"set_scale: vdelay  0x%04x\n", norm_vdelay(dev->tvnorm));
+	
+	value = (0x10000 - (sheight * 512 / height - 512)) & 0x1fff;
+	cx_write(MO_VSCALE_EVEN,  value);
+	cx_write(MO_VSCALE_ODD,   value);
+	dprintk(1,"set_scale: vscale  0x%04x\n", value);
+
+	cx_write(MO_VACTIVE_EVEN, sheight);
+	cx_write(MO_VACTIVE_ODD,  sheight);
+	dprintk(1,"set_scale: vactive 0x%04x\n", sheight);
+
+	// setup filters
+	value = 0;
+	value |= (1 << 19);  // CFILT (default)
+	if (interlaced)
+		value |= (1 << 3); // VINT (interlaced vertical scaling)
+	cx_write(MO_FILTER_EVEN,  value);
+	cx_write(MO_FILTER_ODD,   value);
+	dprintk(1,"set_scale: filter  0x%04x\n", value);
+	
+	return 0;
+}
+
+static int video_mux(struct cx8800_dev *dev, unsigned int input)
+{
+	dprintk(1,"video_mux: %d [vmux=%d,gpio=0x%x]\n",
+		input, INPUT(input)->vmux, INPUT(input)->gpio0);
+	dev->input = input;
+	cx_andor(MO_INPUT_FORMAT, 0x03 << 14, INPUT(input)->vmux << 14);
+	cx_write(MO_GP0_IO, INPUT(input)->gpio0);
+	return 0;
+}
+
+/* ------------------------------------------------------------------ */
+
+static int start_video_dma(struct cx8800_dev    *dev,
+			   struct cx88_dmaqueue *q,
+			   struct cx88_buffer   *buf)
+{
+	/* setup fifo + format */
+	cx88_sram_channel_setup(dev, &cx88_sram_channels[SRAM_CH21],
+				buf->bpl, buf->risc.dma);
+	set_scale(dev, buf->vb.width, buf->vb.height, 1);
+	cx_write(MO_COLOR_CTRL, buf->fmt->cxformat | ColorFormatGamma);
+
+	/* reset counter */
+	cx_write(MO_VIDY_GPCNTRL,0x3);
+	q->count = 1;
+
+	/* enable irqs */
+	cx_set(MO_PCI_INTMSK, 0x00fc01);
+	cx_set(MO_VID_INTMSK, 0x0f0011);
+	
+	/* enable capture */
+	cx_set(VID_CAPTURE_CONTROL,0x06);
+	
+	/* start dma */
+	cx_set(MO_DEV_CNTRL2, (1<<5));
+	cx_set(MO_VID_DMACNTRL, 0x11);
+
+	return 0;
+}
+
+static int restart_video_queue(struct cx8800_dev    *dev,
+			       struct cx88_dmaqueue *q)
+{
+	struct cx88_buffer *buf, *prev;
+	struct list_head *item;
+	
+	if (!list_empty(&q->active)) {
+	        buf = list_entry(q->active.next, struct cx88_buffer, vb.queue);
+		dprintk(2,"restart_queue [%p/%d]: restart dma\n",
+			buf, buf->vb.i);
+		start_video_dma(dev, q, buf);
+		list_for_each(item,&q->active) {
+			buf = list_entry(item, struct cx88_buffer, vb.queue);
+			buf->count    = q->count++;
+		}
+		mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
+		return 0;
+	}
+
+	prev = NULL;
+	for (;;) {
+		if (list_empty(&q->queued))
+			return 0;
+	        buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue);
+		if (NULL == prev) {
+			list_del(&buf->vb.queue);
+			list_add_tail(&buf->vb.queue,&q->active);
+			start_video_dma(dev, q, buf);
+			buf->vb.state = STATE_ACTIVE;
+			buf->count    = q->count++;
+			mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
+			dprintk(2,"[%p/%d] restart_queue - first active\n",
+				buf,buf->vb.i);
+
+		} else if (prev->vb.width  == buf->vb.width  &&
+			   prev->vb.height == buf->vb.height &&
+			   prev->fmt       == buf->fmt) {
+			list_del(&buf->vb.queue);
+			list_add_tail(&buf->vb.queue,&q->active);
+			buf->vb.state = STATE_ACTIVE;
+			buf->count    = q->count++;
+			prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
+			dprintk(2,"[%p/%d] restart_queue - move to active\n",
+				buf,buf->vb.i);
+		} else {
+			return 0;
+		}
+		prev = buf;
+	}
+}
+
+/* ------------------------------------------------------------------ */
+
+static int
+buffer_setup(struct file *file, unsigned int *count, unsigned int *size)
+{
+	struct cx8800_fh *fh = file->private_data;
+	
+	*size = fh->fmt->depth*fh->width*fh->height >> 3;
+	if (0 == *count)
+		*count = 32;
+	while (*size * *count > vid_limit * 1024 * 1024)
+		(*count)--;
+	return 0;
+}
+
+static int
+buffer_prepare(struct file *file, struct videobuf_buffer *vb,
+	       enum v4l2_field field)
+{
+	struct cx8800_fh   *fh  = file->private_data;
+	struct cx8800_dev  *dev = fh->dev;
+	struct cx88_buffer *buf = (struct cx88_buffer*)vb;
+	int rc, init_buffer = 0;
+
+	BUG_ON(NULL == fh->fmt);
+	if (fh->width  < 48 || fh->width  > norm_maxw(dev->tvnorm) ||
+	    fh->height < 32 || fh->height > norm_maxh(dev->tvnorm))
+		return -EINVAL;
+	buf->vb.size = (fh->width * fh->height * fh->fmt->depth) >> 3;
+	if (0 != buf->vb.baddr  &&  buf->vb.bsize < buf->vb.size)
+		return -EINVAL;
+
+	if (buf->fmt       != fh->fmt    ||
+	    buf->vb.width  != fh->width  ||
+	    buf->vb.height != fh->height ||
+	    buf->vb.field  != field) {
+		buf->fmt       = fh->fmt;
+		buf->vb.width  = fh->width;
+		buf->vb.height = fh->height;
+		buf->vb.field  = field;
+		init_buffer = 1;
+	}
+
+	if (STATE_NEEDS_INIT == buf->vb.state) {
+		init_buffer = 1;
+		if (0 != (rc = videobuf_iolock(dev->pci,&buf->vb,NULL)))
+			goto fail;
+	}
+
+	if (init_buffer) {
+		buf->bpl = buf->vb.width * buf->fmt->depth >> 3;
+		switch (buf->vb.field) {
+		case V4L2_FIELD_TOP:
+			cx88_risc_buffer(dev->pci, &buf->risc,
+					 buf->vb.dma.sglist, 0, UNSET,
+					 buf->bpl, 0, buf->vb.height);
+			break;
+		case V4L2_FIELD_BOTTOM:
+			cx88_risc_buffer(dev->pci, &buf->risc,
+					 buf->vb.dma.sglist, UNSET, 0,
+					 buf->bpl, 0, buf->vb.height);
+			break;
+		case V4L2_FIELD_INTERLACED:
+			cx88_risc_buffer(dev->pci, &buf->risc,
+					 buf->vb.dma.sglist, 0, buf->bpl,
+					 buf->bpl, buf->bpl,
+					 buf->vb.height >> 1);
+			break;
+		default:
+			BUG();
+		}
+	}
+	dprintk(2,"[%p/%d] buffer_prepare - %dx%d %dbpp \"%s\" - dma=0x%08lx\n",
+		buf, buf->vb.i,
+		fh->width, fh->height, fh->fmt->depth, fh->fmt->name,
+		(unsigned long)buf->risc.dma);
+
+	buf->vb.state = STATE_PREPARED;
+	return 0;
+
+ fail:
+	cx88_free_buffer(dev->pci,buf);
+	return rc;
+}
+
+static void
+buffer_queue(struct file *file, struct videobuf_buffer *vb)
+{
+	struct cx88_buffer    *buf  = (struct cx88_buffer*)vb;
+	struct cx88_buffer    *prev;
+	struct cx8800_fh      *fh   = file->private_data;
+	struct cx8800_dev     *dev  = fh->dev;
+	struct cx88_dmaqueue  *q    = &dev->vidq;
+
+	/* add jump to stopper */
+	buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP | RISC_IRQ1 | 0x10000);
+	buf->risc.jmp[1] = cpu_to_le32(q->stopper.dma);
+
+	if (!list_empty(&q->queued)) {
+		list_add_tail(&buf->vb.queue,&q->queued);
+		buf->vb.state = STATE_QUEUED;
+		dprintk(2,"[%p/%d] buffer_queue - append to queued\n",
+			buf, buf->vb.i);
+
+	} else if (list_empty(&q->active)) {
+		list_add_tail(&buf->vb.queue,&q->active);
+		start_video_dma(dev, q, buf);
+		buf->vb.state = STATE_ACTIVE;
+		buf->count    = q->count++;
+		mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
+		dprintk(2,"[%p/%d] buffer_queue - first active\n",
+			buf, buf->vb.i);
+
+	} else {
+		prev = list_entry(q->active.prev, struct cx88_buffer, vb.queue);
+		if (prev->vb.width  == buf->vb.width  &&
+		    prev->vb.height == buf->vb.height &&
+		    prev->fmt       == buf->fmt) {
+			list_add_tail(&buf->vb.queue,&q->active);
+			buf->vb.state = STATE_ACTIVE;
+			buf->count    = q->count++;
+			prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
+			dprintk(2,"[%p/%d] buffer_queue - append to active\n",
+				buf, buf->vb.i);
+
+		} else {
+			list_add_tail(&buf->vb.queue,&q->queued);
+			buf->vb.state = STATE_QUEUED;
+			dprintk(2,"[%p/%d] buffer_queue - first queued\n",
+				buf, buf->vb.i);
+		}
+	}
+}
+
+static void buffer_release(struct file *file, struct videobuf_buffer *vb)
+{
+	struct cx88_buffer *buf = (struct cx88_buffer*)vb;
+	struct cx8800_fh   *fh  = file->private_data;
+
+	cx88_free_buffer(fh->dev->pci,buf);
+}
+
+static struct videobuf_queue_ops cx8800_video_qops = {
+	.buf_setup    = buffer_setup,
+	.buf_prepare  = buffer_prepare,
+	.buf_queue    = buffer_queue,
+	.buf_release  = buffer_release,
+};
+
+/* ------------------------------------------------------------------ */
+
+#if 0 /* overlay support not finished yet */
+static u32* ov_risc_field(struct cx8800_dev *dev, struct cx8800_fh *fh,
+			  u32 *rp, struct btcx_skiplist *skips,
+			  u32 sync_line, int skip_even, int skip_odd)
+{
+	int line,maxy,start,end,skip,nskips;
+	u32 ri,ra;
+	u32 addr;
+
+	/* sync instruction */
+	*(rp++) = cpu_to_le32(RISC_RESYNC | sync_line);
+
+	addr  = (unsigned long)dev->fbuf.base;
+	addr += dev->fbuf.fmt.bytesperline * fh->win.w.top;
+	addr += (fh->fmt->depth >> 3)      * fh->win.w.left;
+
+	/* scan lines */
+	for (maxy = -1, line = 0; line < fh->win.w.height;
+	     line++, addr += dev->fbuf.fmt.bytesperline) {
+		if ((line%2) == 0  &&  skip_even)
+			continue;
+		if ((line%2) == 1  &&  skip_odd)
+			continue;
+
+		/* calculate clipping */
+		if (line > maxy)
+			btcx_calc_skips(line, fh->win.w.width, &maxy,
+					skips, &nskips, fh->clips, fh->nclips);
+
+		/* write out risc code */
+		for (start = 0, skip = 0; start < fh->win.w.width; start = end) {
+			if (skip >= nskips) {
+				ri  = RISC_WRITE;
+				end = fh->win.w.width;
+			} else if (start < skips[skip].start) {
+				ri  = RISC_WRITE;
+				end = skips[skip].start;
+			} else {
+				ri  = RISC_SKIP;
+				end = skips[skip].end;
+				skip++;
+			}
+			if (RISC_WRITE == ri)
+				ra = addr + (fh->fmt->depth>>3)*start;
+			else
+				ra = 0;
+				
+			if (0 == start)
+				ri |= RISC_SOL;
+			if (fh->win.w.width == end)
+				ri |= RISC_EOL;
+			ri |= (fh->fmt->depth>>3) * (end-start);
+
+			*(rp++)=cpu_to_le32(ri);
+			if (0 != ra)
+				*(rp++)=cpu_to_le32(ra);
+		}
+	}
+	kfree(skips);
+	return rp;
+}
+
+static int ov_risc_frame(struct cx8800_dev *dev, struct cx8800_fh *fh,
+			 struct cx88_buffer *buf)
+{
+	struct btcx_skiplist *skips;
+	u32 instructions,fields;
+	u32 *rp;
+	int rc;
+	
+	/* skip list for window clipping */
+	if (NULL == (skips = kmalloc(sizeof(*skips) * fh->nclips,GFP_KERNEL)))
+		return -ENOMEM;
+	
+	fields = 0;
+	if (V4L2_FIELD_HAS_TOP(fh->win.field))
+		fields++;
+	if (V4L2_FIELD_HAS_BOTTOM(fh->win.field))
+		fields++;
+
+        /* estimate risc mem: worst case is (clip+1) * lines instructions
+           + syncs + jump (all 2 dwords) */
+	instructions  = (fh->nclips+1) * fh->win.w.height;
+	instructions += 3 + 4;
+	if ((rc = btcx_riscmem_alloc(dev->pci,&buf->risc,instructions*8)) < 0) {
+		kfree(skips);
+		return rc;
+	}
+
+	/* write risc instructions */
+	rp = buf->risc.cpu;
+	switch (fh->win.field) {
+	case V4L2_FIELD_TOP:
+		rp = ov_risc_field(dev, fh, rp, skips, 0,     0, 0);
+		break;
+	case V4L2_FIELD_BOTTOM:
+		rp = ov_risc_field(dev, fh, rp, skips, 0x200, 0, 0);
+		break;
+	case V4L2_FIELD_INTERLACED:
+		rp = ov_risc_field(dev, fh, rp, skips, 0,     0, 1);
+		rp = ov_risc_field(dev, fh, rp, skips, 0x200, 1, 0);
+		break;
+	default:
+		BUG();
+	}
+
+	/* save pointer to jmp instruction address */
+	buf->risc.jmp = rp;
+	kfree(skips);
+	return 0;
+}
+
+static int verify_window(struct cx8800_dev *dev, struct v4l2_window *win)
+{
+	enum v4l2_field field;
+	int maxw, maxh;
+
+	if (NULL == dev->fbuf.base)
+		return -EINVAL;
+	if (win->w.width < 48 || win->w.height <  32)
+		return -EINVAL;
+	if (win->clipcount > 2048)
+		return -EINVAL;
+
+	field = win->field;
+	maxw  = norm_maxw(dev->tvnorm);
+	maxh  = norm_maxh(dev->tvnorm);
+
+	if (V4L2_FIELD_ANY == field) {
+                field = (win->w.height > maxh/2)
+                        ? V4L2_FIELD_INTERLACED
+                        : V4L2_FIELD_TOP;
+        }
+        switch (field) {
+        case V4L2_FIELD_TOP:
+        case V4L2_FIELD_BOTTOM:
+                maxh = maxh / 2;
+                break;
+        case V4L2_FIELD_INTERLACED:
+                break;
+        default:
+                return -EINVAL;
+        }
+
+	win->field = field;
+	if (win->w.width > maxw)
+		win->w.width = maxw;
+	if (win->w.height > maxh)
+		win->w.height = maxh;
+	return 0;
+}
+
+static int setup_window(struct cx8800_dev *dev, struct cx8800_fh *fh,
+			struct v4l2_window *win)
+{
+	struct v4l2_clip *clips = NULL;
+	int n,size,retval = 0;
+
+	if (NULL == fh->fmt)
+		return -EINVAL;
+	retval = verify_window(dev,win);
+	if (0 != retval)
+		return retval;
+
+	/* copy clips  --  luckily v4l1 + v4l2 are binary
+	   compatible here ...*/
+	n = win->clipcount;
+	size = sizeof(*clips)*(n+4);
+	clips = kmalloc(size,GFP_KERNEL);
+	if (NULL == clips)
+		return -ENOMEM;
+	if (n > 0) {
+		if (copy_from_user(clips,win->clips,sizeof(struct v4l2_clip)*n)) {
+			kfree(clips);
+			return -EFAULT;
+		}
+	}
+
+	/* clip against screen */
+	if (NULL != dev->fbuf.base)
+		n = btcx_screen_clips(dev->fbuf.fmt.width, dev->fbuf.fmt.height,
+				      &win->w, clips, n);
+	btcx_sort_clips(clips,n);
+
+	/* 4-byte alignments */
+	switch (fh->fmt->depth) {
+	case 8:
+	case 24:
+		btcx_align(&win->w, clips, n, 3);
+		break;
+	case 16:
+		btcx_align(&win->w, clips, n, 1);
+		break;
+	case 32:
+		/* no alignment fixups needed */
+		break;
+	default:
+		BUG();
+	}
+	
+	down(&fh->vidq.lock);
+	if (fh->clips)
+		kfree(fh->clips);
+	fh->clips    = clips;
+	fh->nclips   = n;
+	fh->win      = *win;
+#if 0
+	fh->ov.setup_ok = 1;
+#endif
+	
+	/* update overlay if needed */
+	retval = 0;
+#if 0
+	if (check_btres(fh, RESOURCE_OVERLAY)) {
+		struct bttv_buffer *new;
+		
+		new = videobuf_alloc(sizeof(*new));
+		bttv_overlay_risc(btv, &fh->ov, fh->ovfmt, new);
+		retval = bttv_switch_overlay(btv,fh,new);
+	}
+#endif
+	up(&fh->vidq.lock);
+	return retval;
+}
+#endif
+
+/* ------------------------------------------------------------------ */
+
+static int video_open(struct inode *inode, struct file *file)
+{
+	int minor = iminor(inode);
+	struct cx8800_dev *h,*dev = NULL;
+	struct cx8800_fh *fh;
+	struct list_head *list;
+	enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+	int radio = 0;
+	
+	list_for_each(list,&cx8800_devlist) {
+		h = list_entry(list, struct cx8800_dev, devlist);
+		if (h->video_dev->minor == minor)
+			dev = h;
+		if (h->radio_dev &&
+		    h->radio_dev->minor == minor) {
+			radio = 1;
+			dev   = h;
+		}
+	}
+	if (NULL == dev)
+		return -ENODEV;
+
+	dprintk(1,"open minor=%d radio=%d type=%s\n",
+		minor,radio,v4l2_type_names[type]);
+
+	/* allocate + initialize per filehandle data */
+	fh = kmalloc(sizeof(*fh),GFP_KERNEL);
+	if (NULL == fh)
+		return -ENOMEM;
+	memset(fh,0,sizeof(*fh));
+	file->private_data = fh;
+	fh->dev      = dev;
+	fh->radio    = radio;
+	fh->type     = type;
+	fh->width    = 320;
+	fh->height   = 240;
+	fh->fmt      = format_by_fourcc(V4L2_PIX_FMT_BGR24);
+
+	videobuf_queue_init(&fh->vidq, &cx8800_video_qops,
+			    dev->pci, &dev->slock,
+			    V4L2_BUF_TYPE_VIDEO_CAPTURE,
+			    V4L2_FIELD_INTERLACED,
+			    sizeof(struct cx88_buffer));
+	init_MUTEX(&fh->vidq.lock);
+
+	if (fh->radio) {
+		dprintk(1,"video_open: setting radio device\n");
+		cx_write(MO_GP0_IO, cx88_boards[dev->board].radio.gpio0);
+		dev->tvaudio = WW_FM;
+		cx88_set_tvaudio(dev);
+		cx88_set_stereo(dev,V4L2_TUNER_MODE_STEREO);
+		cx8800_call_i2c_clients(dev,AUDC_SET_RADIO,NULL);
+	}
+
+        return 0;
+}
+
+static ssize_t
+video_read(struct file *file, char *data, size_t count, loff_t *ppos)
+{
+	struct cx8800_fh *fh = file->private_data;
+
+	return videobuf_read_one(file, &fh->vidq, data, count, ppos);
+}
+
+static unsigned int
+video_poll(struct file *file, struct poll_table_struct *wait)
+{
+	return POLLERR;
+}
+
+static int video_release(struct inode *inode, struct file *file)
+{
+	struct cx8800_fh  *fh  = file->private_data;
+	struct cx8800_dev *dev = fh->dev;
+
+	/* turn off overlay */
+	if (res_check(fh, RESOURCE_OVERLAY)) {
+		/* FIXME */
+		res_free(dev,fh,RESOURCE_OVERLAY);
+	}
+
+	/* stop video capture */
+	if (res_check(fh, RESOURCE_VIDEO)) {
+		videobuf_queue_cancel(file,&fh->vidq);
+		res_free(dev,fh,RESOURCE_VIDEO);
+	}
+	if (fh->vidq.read_buf) {
+		buffer_release(file,fh->vidq.read_buf);
+		kfree(fh->vidq.read_buf);
+	}
+
+	file->private_data = NULL;
+	kfree(fh);
+	return 0;
+}
+
+static int
+video_mmap(struct file *file, struct vm_area_struct * vma)
+{
+	struct cx8800_fh *fh = file->private_data;
+
+	return videobuf_mmap_mapper(vma,&fh->vidq);
+}
+
+/* ------------------------------------------------------------------ */
+
+static int get_control(struct cx8800_dev *dev, struct v4l2_control *ctl)
+{
+	struct cx88_ctrl *c = NULL;
+	u32 value;
+	int i;
+	
+	for (i = 0; i < CX8800_CTLS; i++)
+		if (cx8800_ctls[i].v.id == ctl->id)
+			c = &cx8800_ctls[i];
+	if (NULL == c)
+		return -EINVAL;
+
+	value = cx_read(c->reg);
+	ctl->value = ((value + (c->off << c->shift)) & c->mask) >> c->shift;
+	return 0;
+}
+
+static int set_control(struct cx8800_dev *dev, struct v4l2_control *ctl)
+{
+	struct cx88_ctrl *c = NULL;
+	u32 value;
+	int i;
+
+	for (i = 0; i < CX8800_CTLS; i++)
+		if (cx8800_ctls[i].v.id == ctl->id)
+			c = &cx8800_ctls[i];
+	if (NULL == c)
+		return -EINVAL;
+
+	if (ctl->value < c->v.minimum)
+		return -ERANGE;
+	if (ctl->value > c->v.maximum)
+		return -ERANGE;
+	value = ((ctl->value - c->off) << c->shift) & c->mask;
+	cx_andor(c->reg, c->mask, value);
+	return 0;
+}
+
+/* ------------------------------------------------------------------ */
+
+static int cx8800_g_fmt(struct cx8800_dev *dev, struct cx8800_fh *fh,
+			struct v4l2_format *f)
+{
+	switch (f->type) {
+	case V4L2_BUF_TYPE_VIDEO_CAPTURE:
+		memset(&f->fmt.pix,0,sizeof(f->fmt.pix));
+		f->fmt.pix.width        = fh->width;
+		f->fmt.pix.height       = fh->height;
+		f->fmt.pix.field        = fh->vidq.field;
+		f->fmt.pix.pixelformat  = fh->fmt->fourcc;
+		f->fmt.pix.bytesperline =
+			(f->fmt.pix.width * fh->fmt->depth) >> 3;
+		f->fmt.pix.sizeimage =
+			f->fmt.pix.height * f->fmt.pix.bytesperline;
+		return 0;
+	default:
+		return -EINVAL;
+	}
+}
+
+static int cx8800_try_fmt(struct cx8800_dev *dev, struct cx8800_fh *fh,
+			  struct v4l2_format *f)
+{
+	switch (f->type) {
+	case V4L2_BUF_TYPE_VIDEO_CAPTURE:
+	{
+		struct cx8800_fmt *fmt;
+		enum v4l2_field field;
+		unsigned int maxw, maxh;
+
+		fmt = format_by_fourcc(f->fmt.pix.pixelformat);
+		if (NULL == fmt)
+			return -EINVAL;
+
+		field = f->fmt.pix.field;
+		maxw  = norm_maxw(dev->tvnorm);
+		maxh  = norm_maxh(dev->tvnorm);
+
+#if 0
+		if (V4L2_FIELD_ANY == field) {
+			field = (f->fmt.pix.height > maxh/2)
+				? V4L2_FIELD_INTERLACED
+				: V4L2_FIELD_BOTTOM;
+		}
+#else
+		field = V4L2_FIELD_INTERLACED;
+#endif
+		switch (field) {
+		case V4L2_FIELD_TOP:
+		case V4L2_FIELD_BOTTOM:
+			maxh = maxh / 2;
+			break;
+		case V4L2_FIELD_INTERLACED:
+			break;
+		default:
+			return -EINVAL;
+		}
+
+		f->fmt.pix.field = field;
+		if (f->fmt.pix.width < 48)
+			f->fmt.pix.width = 48;
+		if (f->fmt.pix.height < 32)
+			f->fmt.pix.height = 32;
+		if (f->fmt.pix.width > maxw)
+			f->fmt.pix.width = maxw;
+		if (f->fmt.pix.height > maxh)
+			f->fmt.pix.height = maxh;
+		f->fmt.pix.bytesperline =
+			(f->fmt.pix.width * fmt->depth) >> 3;
+		f->fmt.pix.sizeimage =
+			f->fmt.pix.height * f->fmt.pix.bytesperline;
+
+		return 0;
+	}
+	default:
+		return -EINVAL;
+	}
+}
+
+static int cx8800_s_fmt(struct cx8800_dev *dev, struct cx8800_fh *fh,
+			struct v4l2_format *f)
+{
+	int err;
+	
+	switch (f->type) {
+	case V4L2_BUF_TYPE_VIDEO_CAPTURE:
+		err = cx8800_try_fmt(dev,fh,f);
+		if (0 != err)
+			return err;
+
+		fh->fmt        = format_by_fourcc(f->fmt.pix.pixelformat);
+		fh->width      = f->fmt.pix.width;
+		fh->height     = f->fmt.pix.height;
+		fh->vidq.field = f->fmt.pix.field;
+		return 0;
+	default:
+		return -EINVAL;
+	}
+}
+
+/*
+ * This function is _not_ called directly, but from
+ * video_generic_ioctl (and maybe others).  userspace
+ * copying is done already, arg is a kernel pointer.
+ */
+static int video_do_ioctl(struct inode *inode, struct file *file,
+			  unsigned int cmd, void *arg)
+{
+	struct cx8800_fh  *fh  = file->private_data;
+	struct cx8800_dev *dev = fh->dev;
+#if 0
+	unsigned long flags;
+#endif
+	int err;
+
+	if (video_debug > 1)
+		cx88_print_ioctl(dev->name,cmd);
+	switch (cmd) {
+	case VIDIOC_QUERYCAP:
+	{
+		struct v4l2_capability *cap = arg;
+		
+		memset(cap,0,sizeof(*cap));
+                strcpy(cap->driver, "cx8800");
+		strlcpy(cap->card, cx88_boards[dev->board].name,
+			sizeof(cap->card));
+		sprintf(cap->bus_info,"PCI:%s",pci_name(dev->pci));
+		cap->version = CX88_VERSION_CODE;
+		cap->capabilities =
+			V4L2_CAP_VIDEO_CAPTURE |
+			V4L2_CAP_READWRITE     |
+			V4L2_CAP_STREAMING     |
+#if 0
+			V4L2_CAP_VIDEO_OVERLAY |
+			V4L2_CAP_VBI_CAPTURE   |
+#endif
+			0;
+		if (UNSET != dev->tuner_type)
+			cap->capabilities |= V4L2_CAP_TUNER;
+
+		return 0;
+	}
+
+	/* ---------- tv norms ---------- */
+	case VIDIOC_ENUMSTD:
+	{
+		struct v4l2_standard *e = arg;
+		unsigned int i;
+
+		i = e->index;
+		if (i >= ARRAY_SIZE(tvnorms))
+			return -EINVAL;
+		err = v4l2_video_std_construct(e, tvnorms[e->index].id,
+					       tvnorms[e->index].name);
+		e->index = i;
+		if (err < 0)
+			return err;
+		return 0;
+	}
+	case VIDIOC_G_STD:
+	{
+		v4l2_std_id *id = arg;
+
+		*id = dev->tvnorm->id;
+		return 0;
+	}
+	case VIDIOC_S_STD:
+	{
+		v4l2_std_id *id = arg;
+		unsigned int i;
+
+		for(i = 0; i < ARRAY_SIZE(tvnorms); i++)
+			if (*id & tvnorms[i].id)
+				break;
+		if (i == ARRAY_SIZE(tvnorms))
+			return -EINVAL;
+
+		down(&dev->lock);
+		set_tvnorm(dev,&tvnorms[i]);
+		up(&dev->lock);
+		return 0;
+	}
+
+	/* ------ input switching ---------- */
+	case VIDIOC_ENUMINPUT:
+	{
+		static const char *iname[] = {
+			[ CX88_VMUX_COMPOSITE1 ] = "Composite1",
+			[ CX88_VMUX_COMPOSITE2 ] = "Composite2",
+			[ CX88_VMUX_COMPOSITE3 ] = "Composite3",
+			[ CX88_VMUX_COMPOSITE4 ] = "Composite4",
+			[ CX88_VMUX_TELEVISION ] = "Television",
+			[ CX88_VMUX_SVIDEO     ] = "S-Video",
+			[ CX88_VMUX_DEBUG      ] = "for debug only",
+		};
+		struct v4l2_input *i = arg;
+		unsigned int n;
+
+		n = i->index;
+		if (n >= 4)
+			return -EINVAL;
+		if (0 == INPUT(n)->type)
+			return -EINVAL;
+		memset(i,0,sizeof(*i));
+		i->index = n;
+		i->type  = V4L2_INPUT_TYPE_CAMERA;
+		strcpy(i->name,iname[INPUT(n)->type]);
+		if (CX88_VMUX_TELEVISION == INPUT(n)->type)
+			i->type = V4L2_INPUT_TYPE_TUNER;
+		for (n = 0; n < ARRAY_SIZE(tvnorms); n++)
+			i->std |= tvnorms[n].id;
+		return 0;
+	}
+	case VIDIOC_G_INPUT:
+	{
+		unsigned int *i = arg;
+
+		*i = dev->input;
+		return 0;
+	}
+	case VIDIOC_S_INPUT:
+	{
+		unsigned int *i = arg;
+		
+		if (*i >= 4)
+			return -EINVAL;
+		down(&dev->lock);
+		video_mux(dev,*i);
+		up(&dev->lock);
+		return 0;
+	}
+
+	/* --- capture ioctls ---------------------------------------- */
+	case VIDIOC_ENUM_FMT:
+	{
+		struct v4l2_fmtdesc *f = arg;
+		enum v4l2_buf_type type;
+		unsigned int index;
+
+		index = f->index;
+		type  = f->type;
+		switch (type) {
+		case V4L2_BUF_TYPE_VIDEO_CAPTURE:
+			if (index >= ARRAY_SIZE(formats))
+				return -EINVAL;
+			memset(f,0,sizeof(*f));
+			f->index = index;
+			f->type  = type;
+			strlcpy(f->description,formats[index].name,sizeof(f->description));
+			f->pixelformat = formats[index].fourcc;
+			break;
+		default:
+			return -EINVAL;
+		}
+		return 0;
+	}
+	case VIDIOC_G_FMT:
+	{
+		struct v4l2_format *f = arg;
+		return cx8800_g_fmt(dev,fh,f);
+	}
+	case VIDIOC_S_FMT:
+	{
+		struct v4l2_format *f = arg;
+		return cx8800_s_fmt(dev,fh,f);
+	}
+	case VIDIOC_TRY_FMT:
+	{
+		struct v4l2_format *f = arg;
+		return cx8800_try_fmt(dev,fh,f);
+	}
+
+	/* --- controls ---------------------------------------------- */
+	case VIDIOC_QUERYCTRL:
+	{
+		struct v4l2_queryctrl *c = arg;
+		int i;
+
+		if (c->id <  V4L2_CID_BASE ||
+		    c->id >= V4L2_CID_LASTP1)
+			return -EINVAL;
+		for (i = 0; i < CX8800_CTLS; i++)
+			if (cx8800_ctls[i].v.id == c->id)
+				break;
+		if (i == CX8800_CTLS) {
+			*c = no_ctl;
+			return 0;
+		}
+		*c = cx8800_ctls[i].v;
+		return 0;
+	}
+	case VIDIOC_G_CTRL:
+		return get_control(dev,arg);
+	case VIDIOC_S_CTRL:
+		return set_control(dev,arg);
+		
+	/* --- tuner ioctls ------------------------------------------ */
+	case VIDIOC_G_TUNER:
+	{
+		struct v4l2_tuner *t = arg;
+		u32 reg;
+		
+		if (UNSET == dev->tuner_type)
+			return -EINVAL;
+		if (0 != t->index)
+			return -EINVAL;
+
+		memset(t,0,sizeof(*t));
+		strcpy(t->name, "Television");
+		t->type       = V4L2_TUNER_ANALOG_TV;
+		t->capability = V4L2_TUNER_CAP_NORM;
+		t->rangehigh  = 0xffffffffUL;
+
+		cx88_get_stereo(dev ,t);
+		reg = cx_read(MO_DEVICE_STATUS);
+                t->signal = (reg & (1<<5)) ? 0xffff : 0x0000;
+		return 0;
+	}
+	case VIDIOC_S_TUNER:
+	{
+		struct v4l2_tuner *t = arg;
+
+		if (UNSET == dev->tuner_type)
+			return -EINVAL;
+		if (0 != t->index)
+			return -EINVAL;
+		cx88_set_stereo(dev,t->audmode);
+		return 0;
+	}
+	case VIDIOC_G_FREQUENCY:
+	{
+		struct v4l2_frequency *f = arg;
+
+		if (UNSET == dev->tuner_type)
+			return -EINVAL;
+		if (f->tuner != 0)
+			return -EINVAL;
+		memset(f,0,sizeof(*f));
+		f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
+		f->frequency = dev->freq;
+		return 0;
+	}
+	case VIDIOC_S_FREQUENCY:
+	{
+		struct v4l2_frequency *f = arg;
+
+		if (UNSET == dev->tuner_type)
+			return -EINVAL;
+		if (f->tuner != 0)
+			return -EINVAL;
+		if (0 == fh->radio && f->type != V4L2_TUNER_ANALOG_TV)
+			return -EINVAL;
+		if (1 == fh->radio && f->type != V4L2_TUNER_RADIO)
+			return -EINVAL;
+		down(&dev->lock);
+		dev->freq = f->frequency;
+		cx8800_call_i2c_clients(dev,VIDIOCSFREQ,&dev->freq);
+		up(&dev->lock);
+		return 0;
+	}
+
+	/* --- streaming capture ------------------------------------- */
+	case VIDIOC_REQBUFS:
+		return videobuf_reqbufs(file,&fh->vidq,arg);
+
+	case VIDIOC_QUERYBUF:
+		return videobuf_querybuf(&fh->vidq,arg);
+
+	case VIDIOC_QBUF:
+		return videobuf_qbuf(file,&fh->vidq,arg);
+
+	case VIDIOC_DQBUF:
+		return videobuf_dqbuf(file,&fh->vidq,arg);
+
+	case VIDIOC_STREAMON:
+	{
+                if (!res_get(dev,fh,RESOURCE_VIDEO))
+			return -EBUSY;
+		return videobuf_streamon(file,&fh->vidq);
+	}
+	case VIDIOC_STREAMOFF:
+	{
+		err = videobuf_streamoff(file,&fh->vidq);
+		if (err < 0)
+			return err;
+		res_free(dev,fh,RESOURCE_VIDEO);
+		return 0;
+	}
+
+	default:
+		return v4l_compat_translate_ioctl(inode,file,cmd,arg,
+						  video_do_ioctl);
+	}
+	return 0;
+}
+
+static int video_ioctl(struct inode *inode, struct file *file,
+		       unsigned int cmd, unsigned long arg)
+{
+	return video_usercopy(inode, file, cmd, arg, video_do_ioctl);
+}
+
+/* ----------------------------------------------------------- */
+
+static int radio_do_ioctl(struct inode *inode, struct file *file,
+			unsigned int cmd, void *arg)
+{
+	struct cx8800_fh *fh = file->private_data;
+	struct cx8800_dev *dev = fh->dev;
+	
+	if (video_debug > 1)
+		cx88_print_ioctl(dev->name,cmd);
+
+	switch (cmd) {
+	case VIDIOC_QUERYCAP:
+	{
+		struct v4l2_capability *cap = arg;
+		
+		memset(cap,0,sizeof(*cap));
+                strcpy(cap->driver, "cx8800");
+		strlcpy(cap->card, cx88_boards[dev->board].name,
+			sizeof(cap->card));
+		sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci));
+		cap->version = CX88_VERSION_CODE;
+		cap->capabilities = V4L2_CAP_TUNER;
+		return 0;
+	}
+	case VIDIOC_G_TUNER:
+	{
+		struct v4l2_tuner *t = arg;
+		struct video_tuner vt;
+
+		if (t->index > 0)
+			return -EINVAL;
+
+		memset(t,0,sizeof(*t));
+		strcpy(t->name, "Radio");
+                t->rangelow  = (int)(65*16);
+                t->rangehigh = (int)(108*16);
+		
+		memset(&vt,0,sizeof(vt));
+		cx8800_call_i2c_clients(dev,VIDIOCGTUNER,&vt);
+		t->signal = vt.signal;
+		return 0;
+	}
+	case VIDIOC_ENUMINPUT:
+	{
+		struct v4l2_input *i = arg;
+		
+		if (i->index != 0)
+			return -EINVAL;
+		strcpy(i->name,"Radio");
+		i->type = V4L2_INPUT_TYPE_TUNER;
+		return 0;
+	}
+	case VIDIOC_G_INPUT:
+	{
+		int *i = arg;
+		*i = 0;
+		return 0;
+	}
+	case VIDIOC_G_AUDIO:
+	{
+		struct v4l2_audio *a = arg;
+
+		memset(a,0,sizeof(*a));
+		strcpy(a->name,"Radio");
+		return 0;
+	}
+	case VIDIOC_G_STD:
+	{
+		v4l2_std_id *id = arg;
+		*id = 0;
+		return 0;
+	}
+	case VIDIOC_S_AUDIO:
+	case VIDIOC_S_TUNER:
+	case VIDIOC_S_INPUT:
+	case VIDIOC_S_STD:
+		return 0;
+
+	case VIDIOC_QUERYCTRL:
+	{
+		struct v4l2_queryctrl *c = arg;
+		int i;
+
+		if (c->id <  V4L2_CID_BASE ||
+		    c->id >= V4L2_CID_LASTP1)
+			return -EINVAL;
+		if (c->id == V4L2_CID_AUDIO_MUTE) {
+			for (i = 0; i < CX8800_CTLS; i++)
+				if (cx8800_ctls[i].v.id == c->id)
+					break;
+			*c = cx8800_ctls[i].v;
+		} else
+			*c = no_ctl;
+		return 0;
+	}
+
+
+	case VIDIOC_G_CTRL:
+	case VIDIOC_S_CTRL:
+	case VIDIOC_G_FREQUENCY:
+	case VIDIOC_S_FREQUENCY:
+		return video_do_ioctl(inode,file,cmd,arg);
+		
+	default:
+		return v4l_compat_translate_ioctl(inode,file,cmd,arg,
+						  radio_do_ioctl);
+	}
+	return 0;
+};
+
+static int radio_ioctl(struct inode *inode, struct file *file,
+			unsigned int cmd, unsigned long arg)
+{
+	return video_usercopy(inode, file, cmd, arg, radio_do_ioctl);
+};
+
+/* ----------------------------------------------------------- */
+
+static void cx8800_vid_timeout(unsigned long data)
+{
+	struct cx8800_dev *dev = (struct cx8800_dev*)data;
+	struct cx88_dmaqueue *q = &dev->vidq;
+	struct cx88_buffer *buf;
+	unsigned long flags;
+
+	cx88_sram_channel_dump(dev, &cx88_sram_channels[SRAM_CH21]);
+	//cx88_risc_disasm(dev,&dev->vidq.stopper);
+	
+	cx_clear(MO_VID_DMACNTRL, 0x11);
+	cx_clear(VID_CAPTURE_CONTROL, 0x06);
+
+	spin_lock_irqsave(&dev->slock,flags);
+	while (!list_empty(&q->active)) {
+		buf = list_entry(q->active.next, struct cx88_buffer, vb.queue);
+		list_del(&buf->vb.queue);
+		buf->vb.state = STATE_ERROR;
+		wake_up(&buf->vb.done);
+		printk("%s: [%p/%d] timeout - dma=0x%08lx\n", dev->name,
+		       buf, buf->vb.i, (unsigned long)buf->risc.dma);
+	}
+	restart_video_queue(dev,q);
+	spin_unlock_irqrestore(&dev->slock,flags);
+}
+
+static void cx8800_vid_irq(struct cx8800_dev *dev)
+{
+	struct cx88_buffer *buf;
+	u32 status, mask, count;
+
+	status = cx_read(MO_VID_INTSTAT);
+	mask   = cx_read(MO_VID_INTMSK);
+	if (0 == (status & mask))
+		return;
+	cx_write(MO_VID_INTSTAT, status);
+	if (irq_debug  ||  (status & mask & ~0xff))
+		cx88_print_irqbits(dev->name, "irq vid",
+				   cx88_vid_irqs, status, mask);
+
+	/* risc op code error */
+	if (status & (1 << 16)) {
+		printk(KERN_WARNING "%s: video risc op code error\n",dev->name);
+		cx_clear(MO_VID_DMACNTRL, 0x11);
+		cx_clear(VID_CAPTURE_CONTROL, 0x06);
+		cx88_sram_channel_dump(dev, &cx88_sram_channels[SRAM_CH21]);
+	}
+	
+	/* risc1 y */
+	if (status & 0x01) {
+		spin_lock(&dev->slock);
+		count = cx_read(MO_VIDY_GPCNT);
+		for (;;) {
+			if (list_empty(&dev->vidq.active))
+				break;
+			buf = list_entry(dev->vidq.active.next,
+					 struct cx88_buffer, vb.queue);
+			if (buf->count > count)
+				break;
+			do_gettimeofday(&buf->vb.ts);
+			dprintk(2,"[%p/%d] wakeup reg=%d buf=%d\n",buf,buf->vb.i,
+				count, buf->count);
+			buf->vb.state = STATE_DONE;
+			list_del(&buf->vb.queue);
+			wake_up(&buf->vb.done);
+		}
+		if (list_empty(&dev->vidq.active)) {
+			del_timer(&dev->vidq.timeout);
+		} else {
+			mod_timer(&dev->vidq.timeout, jiffies+BUFFER_TIMEOUT);
+		}
+		spin_unlock(&dev->slock);
+	}
+
+	/* risc2 y */
+	if (status & 0x10) {
+		dprintk(2,"stopper\n");
+		spin_lock(&dev->slock);
+		restart_video_queue(dev,&dev->vidq);
+		spin_unlock(&dev->slock);
+	}
+}
+
+static irqreturn_t cx8800_irq(int irq, void *dev_id, struct pt_regs *regs)
+{
+	struct cx8800_dev *dev = dev_id;
+	u32 status, mask;
+	int loop, handled = 0;
+
+	for (loop = 0; loop < 10; loop++) {
+		status = cx_read(MO_PCI_INTSTAT);
+		mask   = cx_read(MO_PCI_INTMSK);
+		if (0 == (status & mask))
+			goto out;
+		handled = 1;
+		cx_write(MO_PCI_INTSTAT, status);
+		if (irq_debug  ||  (status & mask & ~0x1f))
+			cx88_print_irqbits(dev->name, "irq pci",
+					   cx88_pci_irqs, status, mask);
+
+		if (status & 1)
+			cx8800_vid_irq(dev);
+	};
+	if (10 == loop) {
+		printk(KERN_WARNING "%s: irq loop -- clearing mask\n",
+		       dev->name);
+		cx_write(MO_PCI_INTMSK,0);
+	}
+	
+ out:
+	return IRQ_RETVAL(handled);
+}
+
+/* ----------------------------------------------------------- */
+/* exported stuff                                              */
+
+static struct file_operations video_fops =
+{
+	.owner	       = THIS_MODULE,
+	.open	       = video_open,
+	.release       = video_release,
+	.read	       = video_read,
+	.poll          = video_poll,
+	.mmap	       = video_mmap,
+	.ioctl	       = video_ioctl,
+	.llseek        = no_llseek,
+};
+
+struct video_device cx8800_video_template =
+{
+	.name          = "cx8800-video",
+	.type          = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_OVERLAY|
+	                 VID_TYPE_CLIPPING|VID_TYPE_SCALES,
+	.hardware      = 0,
+	.fops          = &video_fops,
+	.minor         = -1,
+};
+
+static struct file_operations radio_fops =
+{
+	.owner         = THIS_MODULE,
+	.open          = video_open,
+	.release       = video_release,
+	.ioctl         = radio_ioctl,
+	.llseek        = no_llseek,
+};
+
+struct video_device cx8800_radio_template =
+{
+	.name          = "cx8800-radio",
+	.type          = VID_TYPE_TUNER,
+	.hardware      = 0,
+	.fops          = &radio_fops,
+	.minor         = -1,
+};
+
+/* ----------------------------------------------------------- */
+
+static void cx8800_shutdown(struct cx8800_dev *dev)
+{
+	/* disable RISC controller + IRQs */
+	cx_write(MO_DEV_CNTRL2, 0);
+
+	/* stop dma transfers */
+	cx_write(MO_VID_DMACNTRL, 0x0);
+	cx_write(MO_AUD_DMACNTRL, 0x0);
+	cx_write(MO_TS_DMACNTRL, 0x0);
+	cx_write(MO_VIP_DMACNTRL, 0x0);
+	cx_write(MO_GPHST_DMACNTRL, 0x0);
+
+	/* stop interupts */
+	cx_write(MO_PCI_INTMSK, 0x0);
+	cx_write(MO_VID_INTMSK, 0x0);
+	cx_write(MO_AUD_INTMSK, 0x0);
+	cx_write(MO_TS_INTMSK, 0x0);
+	cx_write(MO_VIP_INTMSK, 0x0);
+	cx_write(MO_GPHST_INTMSK, 0x0);
+
+	/* stop capturing */
+	cx_write(VID_CAPTURE_CONTROL, 0);
+}
+
+static int cx8800_reset(struct cx8800_dev *dev)
+{
+	dprintk(1,"cx8800_reset\n");
+
+	cx8800_shutdown(dev);
+	
+	/* clear irq status */
+	cx_write(MO_VID_INTSTAT, 0xFFFFFFFF); // Clear PIV int
+	cx_write(MO_PCI_INTSTAT, 0xFFFFFFFF); // Clear PCI int
+	cx_write(MO_INT1_STAT,   0xFFFFFFFF); // Clear RISC int
+
+	/* wait a bit */
+	set_current_state(TASK_INTERRUPTIBLE);
+	schedule_timeout(HZ/10);
+	
+	/* init sram */
+	cx88_sram_channel_setup(dev, &cx88_sram_channels[SRAM_CH21], 720*4, 0);
+	cx88_sram_channel_setup(dev, &cx88_sram_channels[SRAM_CH22], 128, 0);
+	cx88_sram_channel_setup(dev, &cx88_sram_channels[SRAM_CH23], 128, 0);
+	cx88_sram_channel_setup(dev, &cx88_sram_channels[SRAM_CH24], 128, 0);
+	cx88_sram_channel_setup(dev, &cx88_sram_channels[SRAM_CH25], 128, 0);
+	cx88_sram_channel_setup(dev, &cx88_sram_channels[SRAM_CH26], 128, 0);
+	
+	/* misc init ... */
+	cx_write(MO_INPUT_FORMAT, ((1 << 13) |   // agc enable
+				   (1 << 12) |   // agc gain
+				   (1 << 11) |   // adaptibe agc
+				   (0 << 10) |   // chroma agc
+				   (0 <<  9) |   // ckillen
+				   (7)));
+
+	/* setup image format */
+	cx_andor(MO_COLOR_CTRL, 0x4000, 0x4000);
+
+	/* setup FIFO Threshholds */
+	cx_write(MO_PDMA_STHRSH,   0x0807);
+	cx_write(MO_PDMA_DTHRSH,   0x0807);
+
+	/* fixes flashing of image */
+	cx_write(MO_AGC_SYNC_TIP1, 0x0380000F);
+	cx_write(MO_AGC_BACK_VBI,  0x00E00555);
+	
+	cx_write(MO_VID_INTSTAT,   0xFFFFFFFF); // Clear PIV int
+	cx_write(MO_PCI_INTSTAT,   0xFFFFFFFF); // Clear PCI int
+	cx_write(MO_INT1_STAT,     0xFFFFFFFF); // Clear RISC int
+
+	return 0;
+}
+
+static struct video_device *vdev_init(struct cx8800_dev *dev,
+				      struct video_device *template,
+				      char *type)
+{
+	struct video_device *vfd;
+
+	vfd = video_device_alloc();
+	if (NULL == vfd)
+		return NULL;
+	*vfd = *template;
+	vfd->minor   = -1;
+	vfd->dev     = &dev->pci->dev;
+	vfd->release = video_device_release;
+	snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)",
+		 dev->name, type, cx88_boards[dev->board].name);
+	return vfd;
+}
+
+static void cx8800_unregister_video(struct cx8800_dev *dev)
+{
+	if (dev->radio_dev) {
+		if (-1 != dev->radio_dev->minor)
+			video_unregister_device(dev->radio_dev);
+		else
+			video_device_release(dev->radio_dev);
+		dev->radio_dev = NULL;
+	}
+	if (dev->video_dev) {
+		if (-1 != dev->video_dev->minor)
+			video_unregister_device(dev->video_dev);
+		else
+			video_device_release(dev->video_dev);
+		dev->video_dev = NULL;
+	}
+}
+
+static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
+				    const struct pci_device_id *pci_id)
+{
+	struct cx8800_dev *dev;
+	unsigned int i;
+	int err;
+
+	dev = kmalloc(sizeof(*dev),GFP_KERNEL);
+	if (NULL == dev)
+		return -ENOMEM;
+	memset(dev,0,sizeof(*dev));
+
+	/* pci init */
+	dev->pci = pci_dev;
+	if (pci_enable_device(pci_dev)) {
+		err = -EIO;
+		goto fail1;
+	}
+	sprintf(dev->name,"cx%x[%d]",pci_dev->device,cx8800_devcount);
+
+	/* pci quirks */
+	cx88_pci_quirks(dev->name, dev->pci, &latency);
+	if (UNSET != latency) {
+		printk(KERN_INFO "%s: setting pci latency timer to %d\n",
+		       dev->name,latency);
+		pci_write_config_byte(pci_dev, PCI_LATENCY_TIMER, latency);
+	}
+
+	/* print pci info */
+	pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev);
+        pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER,  &dev->pci_lat);
+        printk(KERN_INFO "%s: found at %s, rev: %d, irq: %d, "
+	       "latency: %d, mmio: 0x%lx\n", dev->name,
+	       pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
+	       dev->pci_lat,pci_resource_start(pci_dev,0));
+
+	pci_set_master(pci_dev);
+	if (!pci_dma_supported(pci_dev,0xffffffff)) {
+		printk("%s: Oops: no 32bit PCI DMA ???\n",dev->name);
+		err = -EIO;
+		goto fail1;
+	}
+
+	/* board config */
+	dev->board = card[cx8800_devcount];
+	for (i = 0; UNSET == dev->board  &&  i < cx88_idcount; i++) 
+		if (pci_dev->subsystem_vendor == cx88_subids[i].subvendor &&
+		    pci_dev->subsystem_device == cx88_subids[i].subdevice)
+			dev->board = cx88_subids[i].card;
+	if (UNSET == dev->board)
+		dev->board = CX88_BOARD_UNKNOWN;
+        printk(KERN_INFO "%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n",
+	       dev->name,pci_dev->subsystem_vendor,
+	       pci_dev->subsystem_device,cx88_boards[dev->board].name,
+	       dev->board, card[cx8800_devcount] == dev->board ?
+	       "insmod option" : "autodetected");
+
+	dev->tuner_type = tuner[cx8800_devcount];
+	if (UNSET == dev->tuner_type)
+		dev->tuner_type = cx88_boards[dev->board].tuner_type;
+
+	/* get mmio */
+	if (!request_mem_region(pci_resource_start(pci_dev,0),
+				pci_resource_len(pci_dev,0),
+				dev->name)) {
+		err = -EBUSY;
+		printk(KERN_ERR "%s: can't get MMIO memory @ 0x%lx\n",
+		       dev->name,pci_resource_start(pci_dev,0));
+		goto fail1;
+	}
+	dev->lmmio = ioremap(pci_resource_start(pci_dev,0),
+			     pci_resource_len(pci_dev,0));
+
+	/* initialize driver struct */
+        init_MUTEX(&dev->lock);
+	dev->slock = SPIN_LOCK_UNLOCKED;
+	dev->tvnorm = tvnorms;
+
+	/* init dma queues */
+	INIT_LIST_HEAD(&dev->vidq.active);
+	INIT_LIST_HEAD(&dev->vidq.queued);
+	dev->vidq.timeout.function = cx8800_vid_timeout;
+	dev->vidq.timeout.data     = (unsigned long)dev;
+	init_timer(&dev->vidq.timeout);
+	cx88_risc_stopper(dev->pci,&dev->vidq.stopper,
+			  MO_VID_DMACNTRL,0x11,0x00);
+	
+	/* initialize hardware */
+	cx8800_reset(dev);
+
+	/* get irq */
+	err = request_irq(pci_dev->irq, cx8800_irq,
+			  SA_SHIRQ | SA_INTERRUPT, dev->name, dev);
+	if (err < 0) {
+		printk(KERN_ERR "%s: can't get IRQ %d\n",
+		       dev->name,pci_dev->irq);
+		goto fail2;
+	}
+
+	/* register i2c bus + load i2c helpers */
+	cx8800_i2c_init(dev);
+	cx88_card_setup(dev);
+
+	/* load and configure helper modules */
+	if (TUNER_ABSENT != dev->tuner_type)
+		request_module("tuner");
+	if (dev->tuner_type != UNSET)
+		cx8800_call_i2c_clients(dev,TUNER_SET_TYPE,&dev->tuner_type);
+
+	/* register v4l devices */
+	dev->video_dev = vdev_init(dev,&cx8800_video_template,"video");
+	err = video_register_device(dev->video_dev,VFL_TYPE_GRABBER,
+				    video_nr[cx8800_devcount]);
+	if (err < 0) {
+		printk(KERN_INFO "%s: can't register video device\n",
+		       dev->name);
+		goto fail3;
+	}
+	printk(KERN_INFO "%s: registered device video%d [v4l2]\n",
+	       dev->name,dev->video_dev->minor & 0x1f);
+
+	if (dev->has_radio) {
+		dev->radio_dev = vdev_init(dev,&cx8800_radio_template,"radio");
+		err = video_register_device(dev->radio_dev,VFL_TYPE_RADIO,
+					    radio_nr[cx8800_devcount]);
+		if (err < 0) {
+			printk(KERN_INFO "%s: can't register radio device\n",
+			       dev->name);
+			goto fail3;
+		}
+		printk(KERN_INFO "%s: registered device radio%d\n",
+		       dev->name,dev->radio_dev->minor & 0x1f);
+	}
+
+	/* everything worked */
+	list_add_tail(&dev->devlist,&cx8800_devlist);
+	pci_set_drvdata(pci_dev,dev);
+	cx8800_devcount++;
+
+	/* initial device configuration */
+	down(&dev->lock);
+	set_tvnorm(dev,tvnorms);
+	video_mux(dev,0);
+	up(&dev->lock);
+	return 0;
+
+ fail3:
+	cx8800_unregister_video(dev);
+	if (0 == dev->i2c_rc)
+		i2c_bit_del_bus(&dev->i2c_adap);
+	free_irq(pci_dev->irq, dev);
+ fail2:
+	release_mem_region(pci_resource_start(pci_dev,0),
+			   pci_resource_len(pci_dev,0));
+ fail1:
+	kfree(dev);
+	return err;
+}
+
+static void __devexit cx8800_finidev(struct pci_dev *pci_dev)
+{
+        struct cx8800_dev *dev = pci_get_drvdata(pci_dev);
+
+	cx8800_shutdown(dev);
+	pci_disable_device(pci_dev);
+
+	/* unregister stuff */	
+	if (0 == dev->i2c_rc)
+		i2c_bit_del_bus(&dev->i2c_adap);
+
+	free_irq(pci_dev->irq, dev);
+	release_mem_region(pci_resource_start(pci_dev,0),
+			   pci_resource_len(pci_dev,0));
+
+	cx8800_unregister_video(dev);
+	pci_set_drvdata(pci_dev, NULL);
+
+	/* free memory */
+	btcx_riscmem_free(dev->pci,&dev->vidq.stopper);
+	list_del(&dev->devlist);
+	cx8800_devcount--;
+	kfree(dev);
+}
+
+static int cx8800_suspend(struct pci_dev *pci_dev, u32 state)
+{
+        struct cx8800_dev *dev = pci_get_drvdata(pci_dev);
+
+	printk("%s: suspend %d\n", dev->name, state);
+
+	cx8800_shutdown(dev);
+	del_timer(&dev->vidq.timeout);
+	
+	pci_save_state(pci_dev, dev->state.pci_cfg);
+	if (0 != pci_set_power_state(pci_dev, state)) {
+		pci_disable_device(pci_dev);
+		dev->state.disabled = 1;
+	}
+	return 0;
+}
+
+static int cx8800_resume(struct pci_dev *pci_dev)
+{
+        struct cx8800_dev *dev = pci_get_drvdata(pci_dev);
+
+	printk("%s: resume\n", dev->name);
+
+	if (dev->state.disabled) {
+		pci_enable_device(pci_dev);
+		dev->state.disabled = 0;
+	}
+	pci_set_power_state(pci_dev, 0);
+	pci_restore_state(pci_dev, dev->state.pci_cfg);
+
+	/* re-initialize hardware */
+	cx8800_reset(dev);
+
+	/* restart video capture */
+	spin_lock(&dev->slock);
+	restart_video_queue(dev,&dev->vidq);
+	spin_unlock(&dev->slock);
+
+	return 0;
+}
+
+/* ----------------------------------------------------------- */
+
+struct pci_device_id cx8800_pci_tbl[] = {
+	{
+		.vendor       = 0x14f1,
+		.device       = 0x8800,
+                .subvendor    = PCI_ANY_ID,
+                .subdevice    = PCI_ANY_ID,
+	},{
+		/* --- end of list --- */
+	}
+};
+MODULE_DEVICE_TABLE(pci, cx8800_pci_tbl);
+
+static struct pci_driver cx8800_pci_driver = {
+        .name     = "cx8800",
+        .id_table = cx8800_pci_tbl,
+        .probe    = cx8800_initdev,
+        .remove   = cx8800_finidev,
+
+	.suspend  = cx8800_suspend,
+	.resume   = cx8800_resume,
+};
+
+static int cx8800_init(void)
+{
+	INIT_LIST_HEAD(&cx8800_devlist);
+	printk(KERN_INFO "cx2388x v4l2 driver version %d.%d.%d loaded\n",
+	       (CX88_VERSION_CODE >> 16) & 0xff,
+	       (CX88_VERSION_CODE >>  8) & 0xff,
+	       CX88_VERSION_CODE & 0xff);
+#ifdef SNAPSHOT
+	printk(KERN_INFO "cx2388x: snapshot date %04d-%02d-%02d\n",
+	       SNAPSHOT/10000, (SNAPSHOT/100)%100, SNAPSHOT%100);
+#endif
+	return pci_module_init(&cx8800_pci_driver);
+}
+
+static void cx8800_fini(void)
+{
+	pci_unregister_driver(&cx8800_pci_driver);
+}
+
+module_init(cx8800_init);
+module_exit(cx8800_fini);
+
+/* ----------------------------------------------------------- */
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff -Nru a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/video/cx88/cx88.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,339 @@
+/*
+ * v4l2 device driver for philips saa7134 based TV cards
+ *
+ * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/pci.h>
+#include <linux/i2c.h>
+#include <linux/i2c-algo-bit.h>
+#include <linux/videodev.h>
+#include <linux/kdev_t.h>
+
+#include <media/video-buf.h>
+#include <media/tuner.h>
+#include <media/audiochip.h>
+
+#include "btcx-risc.h"
+#include "cx88-reg.h"
+
+#include <linux/version.h>
+#define CX88_VERSION_CODE KERNEL_VERSION(0,0,1)
+
+#ifndef TRUE
+# define TRUE (1==1)
+#endif
+#ifndef FALSE
+# define FALSE (1==0)
+#endif
+#define UNSET (-1U)
+
+#define CX88_MAXBOARDS 8
+
+/* ----------------------------------------------------------- */
+/* defines and enums                                           */
+
+#define FORMAT_FLAGS_PACKED       0x01
+#define FORMAT_FLAGS_PLANAR       0x02
+
+/* ----------------------------------------------------------- */
+/* static data                                                 */
+
+struct cx8800_tvnorm {
+	char                   *name;
+	v4l2_std_id            id;
+	u32                    cxiformat;
+	u32                    cxoformat;
+};
+
+struct cx8800_fmt {
+	char  *name;
+	u32   fourcc;          /* v4l2 format id */
+	int   depth;
+	int   flags;
+	u32   cxformat;
+};
+
+struct cx88_ctrl {
+	struct v4l2_queryctrl  v;
+	u32                    off;
+	u32                    reg;
+	u32                    mask;
+	u32                    shift;
+};
+
+/* ----------------------------------------------------------- */
+/* SRAM memory management data (see cx88-core.c)               */
+
+#define SRAM_CH21 0   /* video */
+#define SRAM_CH22 1
+#define SRAM_CH23 2
+#define SRAM_CH24 3   /* vbi   */
+#define SRAM_CH25 4   /* audio */
+#define SRAM_CH26 5
+/* more */
+
+struct sram_channel {
+	char *name;
+	u32  cmds_start;
+	u32  ctrl_start;
+	u32  fifo_start;
+	u32  fifo_size;
+	u32  ptr1_reg;
+	u32  ptr2_reg;
+	u32  cnt1_reg;
+	u32  cnt2_reg;
+};
+extern struct sram_channel cx88_sram_channels[];
+
+/* ----------------------------------------------------------- */
+/* card configuration                                          */
+
+#define CX88_BOARD_NOAUTO        UNSET
+#define CX88_BOARD_UNKNOWN           0
+#define CX88_BOARD_HAUPPAUGE         1
+#define CX88_BOARD_GDI               2
+#define CX88_BOARD_PIXELVIEW         3
+#define CX88_BOARD_ATI_WONDER_PRO    4
+#define CX88_BOARD_WINFAST2000XP     5
+#define CX88_BOARD_AVERTV_303        6
+#define CX88_BOARD_MSI_TVANYWHERE    7
+#define CX88_BOARD_WINFAST_DV2000    8
+
+
+enum cx88_itype {
+	CX88_VMUX_COMPOSITE1 = 1,
+	CX88_VMUX_COMPOSITE2 = 2,
+	CX88_VMUX_COMPOSITE3 = 3,
+	CX88_VMUX_COMPOSITE4 = 4,
+	CX88_VMUX_TELEVISION = 5,
+	CX88_VMUX_SVIDEO     = 6,
+	CX88_VMUX_DEBUG      = 7,
+	CX88_RADIO           = 8,
+};
+
+struct cx88_input {
+	enum cx88_itype type;
+	unsigned int    vmux;
+	u32             gpio0;
+};
+
+struct cx88_board {
+	char                    *name;
+	unsigned int            tuner_type;
+	struct cx88_input       input[8];
+	struct cx88_input       radio;
+};
+
+struct cx88_subid {
+	u16     subvendor;
+	u16     subdevice;
+	u32     card;
+};
+
+#define INPUT(nr) (&cx88_boards[dev->board].input[nr])
+
+/* ----------------------------------------------------------- */
+/* device / file handle status                                 */
+
+#define RESOURCE_OVERLAY       1
+#define RESOURCE_VIDEO         2
+#define RESOURCE_VBI           4
+
+//#define BUFFER_TIMEOUT     (HZ/2)  /* 0.5 seconds */
+#define BUFFER_TIMEOUT     (HZ*2)
+
+struct cx8800_dev;
+
+/* buffer for one video frame */
+struct cx88_buffer {
+	/* common v4l buffer stuff -- must be first */
+	struct videobuf_buffer vb;
+
+	/* cx88 specific */
+	unsigned int           bpl;
+	struct btcx_riscmem    risc;
+	struct cx8800_fmt      *fmt;
+	u32                    count;
+};
+
+struct cx88_dmaqueue {
+	struct list_head       active;
+	struct list_head       queued;
+	struct timer_list      timeout;
+	struct btcx_riscmem    stopper;
+	u32                    count;
+};
+
+/* video filehandle status */
+struct cx8800_fh {
+	struct cx8800_dev          *dev;
+	enum v4l2_buf_type         type;
+	int                        radio;
+	unsigned int               resources;
+
+	/* video overlay */
+	struct v4l2_window         win;
+	struct v4l2_clip           *clips;
+	unsigned int               nclips;
+
+	/* video capture */
+	struct cx8800_fmt          *fmt;
+	unsigned int               width,height;
+	struct videobuf_queue      vidq;
+};
+
+struct cx8800_suspend_state {
+	u32                        pci_cfg[64 / sizeof(u32)];
+	int                        disabled;
+};
+
+/* global device status */
+struct cx8800_dev {
+	struct list_head           devlist;
+        struct semaphore           lock;
+       	spinlock_t                 slock;
+
+	/* various device info */
+	unsigned int               resources;
+	struct video_device        *video_dev;
+	struct video_device        *radio_dev;
+
+	/* pci i/o */
+	char                       name[32];
+	struct pci_dev             *pci;
+	unsigned char              pci_rev,pci_lat;
+        u32                        *lmmio;
+
+	/* config info */
+	unsigned int               board;
+	unsigned int               tuner_type;
+	unsigned int               has_radio;
+
+	/* i2c i/o */
+	struct i2c_adapter         i2c_adap;
+	struct i2c_algo_bit_data   i2c_algo;
+	struct i2c_client          i2c_client;
+	u32                        i2c_state, i2c_rc;
+
+	/* video overlay */
+	struct v4l2_framebuffer    fbuf;
+	struct cx88_buffer         *screen;
+
+	/* capture queues */
+	struct cx88_dmaqueue       vidq;
+
+	/* various v4l controls */
+	struct cx8800_tvnorm       *tvnorm;
+	u32                        tvaudio;
+	u32                        input;
+	u32                        freq;
+
+	/* other global state info */
+	struct cx8800_suspend_state state;
+};
+
+/* ----------------------------------------------------------- */
+
+#define cx_read(reg)             readl(dev->lmmio + ((reg)>>2))
+#define cx_write(reg,value)      writel((value), dev->lmmio + ((reg)>>2));
+
+#define cx_andor(reg,mask,value) \
+  writel((readl(dev->lmmio+((reg)>>2)) & ~(mask)) |\
+  ((value) & (mask)), dev->lmmio+((reg)>>2))
+#define cx_set(reg,bit)          cx_andor((reg),(bit),(bit))
+#define cx_clear(reg,bit)        cx_andor((reg),(bit),0)
+
+#define cx_wait(d) { if (need_resched()) schedule(); else udelay(d);}
+
+
+/* ----------------------------------------------------------- */
+/* cx88-core.c                                                 */
+
+extern char *cx88_pci_irqs[32];
+extern char *cx88_vid_irqs[32];
+extern void cx88_print_irqbits(char *name, char *tag, char **strings,
+			       u32 bits, u32 mask);
+extern void cx88_print_ioctl(char *name, unsigned int cmd);
+
+extern int
+cx88_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc,
+		 struct scatterlist *sglist,
+		 unsigned int top_offset, unsigned int bottom_offset,
+		 unsigned int bpl, unsigned int padding, unsigned int lines);
+extern int
+cx88_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc,
+		  u32 reg, u32 mask, u32 value);
+extern void
+cx88_free_buffer(struct pci_dev *pci, struct cx88_buffer *buf);
+
+extern void cx88_risc_disasm(struct cx8800_dev *dev,
+			     struct btcx_riscmem *risc);
+
+extern int cx88_sram_channel_setup(struct cx8800_dev *dev,
+				   struct sram_channel *ch,
+				   unsigned int bpl, u32 risc);
+extern void cx88_sram_channel_dump(struct cx8800_dev *dev,
+				   struct sram_channel *ch);
+
+extern int cx88_pci_quirks(char *name, struct pci_dev *pci,
+			   unsigned int *latency);
+
+/* ----------------------------------------------------------- */
+/* cx88-i2c.c                                                  */
+
+extern int cx8800_i2c_init(struct cx8800_dev *dev);
+extern void cx8800_call_i2c_clients(struct cx8800_dev *dev,
+				    unsigned int cmd, void *arg);
+
+
+/* ----------------------------------------------------------- */
+/* cx88-cards.c                                                */
+
+extern struct cx88_board cx88_boards[];
+extern const unsigned int cx88_bcount;
+
+extern struct cx88_subid cx88_subids[];
+extern const unsigned int cx88_idcount;
+
+extern void cx88_card_setup(struct cx8800_dev *dev);
+
+/* ----------------------------------------------------------- */
+/* cx88-tvaudio.c                                              */
+
+#define WW_NONE		 1
+#define WW_BTSC		 2
+#define WW_NICAM_I	 3
+#define WW_NICAM_BGDKL	 4
+#define WW_A1		 5
+#define WW_A2_BG	 6
+#define WW_A2_DK	 7
+#define WW_A2_M		 8
+#define WW_EIAJ		 9
+#define WW_SYSTEM_L_AM	10
+#define WW_I2SPT	11
+#define WW_FM		12
+
+void cx88_set_tvaudio(struct cx8800_dev *dev);
+void cx88_get_stereo(struct cx8800_dev *dev, struct v4l2_tuner *t);
+void cx88_set_stereo(struct cx8800_dev *dev, u32 mode);
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff -Nru a/drivers/media/video/ir-kbd-gpio.c b/drivers/media/video/ir-kbd-gpio.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/video/ir-kbd-gpio.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,380 @@
+/*
+ * Copyright (c) 2003 Gerd Knorr
+ * Copyright (c) 2003 Pavel Machek
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/init.h>
+#include <linux/input.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/input.h>
+#include <linux/pci.h>
+
+#include <media/ir-common.h>
+
+#include "bttv.h"
+
+/* ---------------------------------------------------------------------- */
+
+static IR_KEYTAB_TYPE ir_codes_avermedia[IR_KEYTAB_SIZE] = {
+	[ 17 ] = KEY_KP0, 
+	[ 20 ] = KEY_KP1, 
+	[ 12 ] = KEY_KP2, 
+	[ 28 ] = KEY_KP3, 
+	[ 18 ] = KEY_KP4, 
+	[ 10 ] = KEY_KP5, 
+	[ 26 ] = KEY_KP6, 
+	[ 22 ] = KEY_KP7, 
+	[ 14 ] = KEY_KP8, 
+	[ 30 ] = KEY_KP9, 
+
+	[ 24 ] = KEY_EJECTCD,     // Unmarked on my controller
+	[  0 ] = KEY_POWER, 
+	[  9 ] = BTN_LEFT,        // DISPLAY/L
+	[ 25 ] = BTN_RIGHT,       // LOOP/R
+	[  5 ] = KEY_MUTE, 
+	[ 19 ] = KEY_RECORD, 
+	[ 11 ] = KEY_PAUSE, 
+	[ 27 ] = KEY_STOP, 
+	[ 15 ] = KEY_VOLUMEDOWN, 
+	[ 31 ] = KEY_VOLUMEUP, 
+
+	[ 16 ] = KEY_TUNER,       // TV/FM
+	[  8 ] = KEY_CD, 
+	[  4 ] = KEY_VIDEO, 
+	[  2 ] = KEY_AUDIO, 
+	[  6 ] = KEY_ZOOM,        // full screen
+	[  1 ] = KEY_INFO,        // preview 
+	[ 21 ] = KEY_SEARCH,      // autoscan
+	[ 13 ] = KEY_STOP,        // freeze 
+	[ 29 ] = KEY_RECORD,      // capture 
+	[  3 ] = KEY_PLAY,        // unmarked
+	[ 24 ] = KEY_RED,         // unmarked
+	[  7 ] = KEY_GREEN,       // unmarked
+
+#if 0
+	[ 16 ] = KEY_YELLOW,      // unmarked
+	[  8 ] = KEY_CHANNELDOWN, 
+	[ 24 ] = KEY_CHANNELUP, 
+	[  0 ] = KEY_BLUE,        // unmarked
+#endif
+};
+
+static IR_KEYTAB_TYPE winfast_codes[IR_KEYTAB_SIZE] = {
+	[  5 ] = KEY_KP1,
+	[  6 ] = KEY_KP2,
+	[  7 ] = KEY_KP3,
+	[  9 ] = KEY_KP4,
+	[ 10 ] = KEY_KP5,
+	[ 11 ] = KEY_KP6,
+	[ 13 ] = KEY_KP7,
+	[ 14 ] = KEY_KP8,
+	[ 15 ] = KEY_KP9,
+	[ 18 ] = KEY_KP0,
+
+	[  0 ] = KEY_POWER,
+//      [ 27 ] = MTS button
+	[  2 ] = KEY_TUNER,     // TV/FM
+	[ 30 ] = KEY_VIDEO,
+//      [ 22 ] = display button
+	[  4 ] = KEY_VOLUMEUP,
+	[  8 ] = KEY_VOLUMEDOWN,
+	[ 12 ] = KEY_CHANNELUP,
+	[ 16 ] = KEY_CHANNELDOWN,
+	[  3 ] = KEY_ZOOM,      // fullscreen
+	[ 31 ] = KEY_SUBTITLE,  // closed caption/teletext
+	[ 32 ] = KEY_SLEEP,
+//      [ 41 ] = boss key
+	[ 20 ] = KEY_MUTE,
+	[ 43 ] = KEY_RED,
+	[ 44 ] = KEY_GREEN,
+	[ 45 ] = KEY_YELLOW,
+	[ 46 ] = KEY_BLUE,
+	[ 24 ] = KEY_KPPLUS,    //fine tune +
+	[ 25 ] = KEY_KPMINUS,   //fine tune -
+//      [ 42 ] = picture in picture
+        [ 33 ] = KEY_KPDOT,
+	[ 19 ] = KEY_KPENTER,
+//      [ 17 ] = recall
+	[ 34 ] = KEY_BACK,
+	[ 35 ] = KEY_PLAYPAUSE,
+	[ 36 ] = KEY_NEXT,
+//      [ 37 ] = time shifting
+	[ 38 ] = KEY_STOP,
+	[ 39 ] = KEY_RECORD
+//      [ 40 ] = snapshot
+};
+
+static IR_KEYTAB_TYPE ir_codes_pixelview[IR_KEYTAB_SIZE] = {
+	[  2 ] = KEY_KP0,
+	[  1 ] = KEY_KP1,
+	[ 11 ] = KEY_KP2,
+	[ 27 ] = KEY_KP3,
+	[  5 ] = KEY_KP4,
+	[  9 ] = KEY_KP5,
+	[ 21 ] = KEY_KP6,
+	[  6 ] = KEY_KP7,
+	[ 10 ] = KEY_KP8,
+	[ 18 ] = KEY_KP9,
+	
+	[  3 ] = KEY_TUNER,       // TV/FM
+	[  7 ] = KEY_SEARCH,      // scan
+	[ 28 ] = KEY_ZOOM,        // full screen
+	[ 30 ] = KEY_POWER,
+	[ 23 ] = KEY_VOLUMEDOWN,
+	[ 31 ] = KEY_VOLUMEUP,
+	[ 20 ] = KEY_CHANNELDOWN,
+	[ 22 ] = KEY_CHANNELUP,
+	[ 24 ] = KEY_MUTE,
+	
+	[  0 ] = KEY_LIST,        // source
+	[ 19 ] = KEY_INFO,        // loop
+	[ 16 ] = KEY_LAST,        // +100
+	[ 13 ] = KEY_CLEAR,       // reset
+	[ 12 ] = BTN_RIGHT,       // fun++
+	[  4 ] = BTN_LEFT,        // fun--
+	[ 14 ] = KEY_GOTO,        // function
+	[ 15 ] = KEY_STOP,         // freeze
+};
+
+/* ---------------------------------------------------------------------- */
+
+struct IR {
+	struct bttv_sub_device  *sub;
+	struct input_dev        input;
+	struct ir_input_state   ir;
+	char                    name[32];
+	char                    phys[32];
+	u32                     mask_keycode;
+	u32                     mask_keydown;
+	u32                     mask_keyup;
+
+	int                     polling;
+	u32                     last_gpio;
+	struct work_struct      work;
+	struct timer_list       timer;
+};
+
+static int debug;
+module_param(debug, int, 0644);    /* debug level (0,1,2) */
+
+#define DEVNAME "ir-kbd-gpio"
+#define dprintk(fmt, arg...)	if (debug) \
+	printk(KERN_DEBUG DEVNAME ": " fmt , ## arg)
+
+static void ir_irq(struct bttv_sub_device *sub);
+static int ir_probe(struct device *dev);
+static int ir_remove(struct device *dev);
+
+static struct bttv_sub_driver driver = {
+	.drv = {
+		.name	= DEVNAME,
+		.probe	= ir_probe,
+		.remove	= ir_remove,
+	},
+	.gpio_irq       = ir_irq,
+};
+
+/* ---------------------------------------------------------------------- */
+
+static void ir_handle_key(struct IR *ir)
+{
+	u32 gpio,data;
+
+	/* read gpio value */
+	gpio = bttv_gpio_read(ir->sub->core);
+	if (ir->polling) {
+		if (ir->last_gpio == gpio)
+			return;
+		ir->last_gpio = gpio;
+	}
+	
+	/* extract data */
+	data = ir_extract_bits(gpio, ir->mask_keycode);
+	dprintk(DEVNAME ": irq gpio=0x%x code=%d | %s%s%s\n",
+		gpio, data,
+		ir->polling               ? "poll"  : "irq",
+		(gpio & ir->mask_keydown) ? " down" : "",
+		(gpio & ir->mask_keyup)   ? " up"   : "");
+
+	if (ir->mask_keydown) {
+		/* bit set on keydown */
+		if (gpio & ir->mask_keydown) {
+			ir_input_keydown(&ir->input,&ir->ir,data,data);
+		} else {
+			ir_input_nokey(&ir->input,&ir->ir);
+		}
+
+	} else if (ir->mask_keyup) {
+		/* bit cleared on keydown */
+		if (0 == (gpio & ir->mask_keyup)) {
+			ir_input_keydown(&ir->input,&ir->ir,data,data);
+		} else {
+			ir_input_nokey(&ir->input,&ir->ir);
+		}
+
+	} else {
+		/* can't disturgissh keydown/up :-/ */
+		ir_input_keydown(&ir->input,&ir->ir,data,data);
+		ir_input_nokey(&ir->input,&ir->ir);
+	}
+}
+
+static void ir_irq(struct bttv_sub_device *sub)
+{
+	struct IR *ir = dev_get_drvdata(&sub->dev);
+
+	if (!ir->polling)
+		ir_handle_key(ir);
+}
+
+static void ir_timer(unsigned long data)
+{
+	struct IR *ir = (struct IR*)data;
+
+	schedule_work(&ir->work);
+}
+
+static void ir_work(void *data)
+{
+	struct IR *ir = data;
+	unsigned long timeout;
+
+	ir_handle_key(ir);
+	timeout = jiffies + (ir->polling * HZ / 1000);
+	mod_timer(&ir->timer, timeout);
+}
+
+/* ---------------------------------------------------------------------- */
+
+static int ir_probe(struct device *dev)
+{
+	struct bttv_sub_device *sub = to_bttv_sub_dev(dev);
+	struct IR *ir;
+	IR_KEYTAB_TYPE *ir_codes = NULL;
+	int ir_type = IR_TYPE_OTHER;
+
+	ir = kmalloc(sizeof(*ir),GFP_KERNEL);
+	if (NULL == ir)
+		return -ENOMEM;
+	memset(ir,0,sizeof(*ir));
+
+	/* detect & configure */
+	switch (sub->core->type) {
+	case BTTV_AVERMEDIA:
+	case BTTV_AVPHONE98:
+		ir_codes         = ir_codes_avermedia;
+		ir->mask_keycode = 0xf80000;
+		ir->mask_keydown = 0x010000;
+		break;
+	case BTTV_WINFAST2000:
+		ir_codes         = winfast_codes;
+		ir->mask_keycode = 0x8f8;
+		break;
+	case BTTV_PV_BT878P_9B:
+	case BTTV_PV_BT878P_PLUS:
+		ir_codes         = ir_codes_pixelview;
+		ir->mask_keycode = 0x001f00;
+		ir->mask_keyup   = 0x008000;
+		ir->polling      = 50; // ms
+                break;
+	}
+	if (NULL == ir_codes) {
+		kfree(ir);
+		return -ENODEV;
+	}
+
+	/* init hardware-specific stuff */
+	bttv_gpio_inout(sub->core, ir->mask_keycode | ir->mask_keydown, 0);
+	ir->sub = sub;
+	
+	/* init input device */
+	snprintf(ir->name, sizeof(ir->name), "bttv IR (card=%d)",
+		 sub->core->type);
+	snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0",
+		 pci_name(sub->core->pci));
+
+	ir_input_init(&ir->input, &ir->ir, ir_type, ir_codes);
+	ir->input.name = ir->name;
+	ir->input.phys = ir->phys;
+	ir->input.id.bustype = BUS_PCI;
+	ir->input.id.version = 1;
+	if (sub->core->pci->subsystem_vendor) {
+		ir->input.id.vendor  = sub->core->pci->subsystem_vendor;
+		ir->input.id.product = sub->core->pci->subsystem_device;
+	} else {
+		ir->input.id.vendor  = sub->core->pci->vendor;
+		ir->input.id.product = sub->core->pci->device;
+	}
+
+	if (ir->polling) {
+		INIT_WORK(&ir->work, ir_work, ir);
+		init_timer(&ir->timer);
+		ir->timer.function = ir_timer;
+		ir->timer.data     = (unsigned long)ir;
+		schedule_work(&ir->work);
+	}
+
+	/* all done */
+	dev_set_drvdata(dev,ir);
+	input_register_device(&ir->input);
+	printk(DEVNAME ": %s detected at %s\n",ir->input.name,ir->input.phys);
+
+	return 0;
+}
+
+static int ir_remove(struct device *dev)
+{
+	struct IR *ir = dev_get_drvdata(dev);
+
+	if (ir->polling) {
+		del_timer(&ir->timer);
+		flush_scheduled_work();
+	}
+
+	input_unregister_device(&ir->input);
+	kfree(ir);
+	return 0;
+}
+
+/* ---------------------------------------------------------------------- */
+
+MODULE_AUTHOR("Gerd Knorr, Pavel Machek");
+MODULE_DESCRIPTION("input driver for bt8x8 gpio IR remote controls");
+MODULE_LICENSE("GPL");
+
+static int ir_init(void)
+{
+	return bttv_sub_register(&driver, "remote");
+}
+
+static void ir_fini(void)
+{
+	bttv_sub_unregister(&driver);
+}
+
+module_init(ir_init);
+module_exit(ir_fini);
+
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff -Nru a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/video/ir-kbd-i2c.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,373 @@
+/*
+ * keyboard input driver for i2c IR remote controls
+ *
+ * Copyright (c) 2000-2003 Gerd Knorr <kraxel@bytesex.org>
+ * modified for PixelView (BT878P+W/FM) by
+ *      Michal Kochanowicz <mkochano@pld.org.pl>
+ *      Christoph Bartelmus <lirc@bartelmus.de>
+ * modified for KNC ONE TV Station/Anubis Typhoon TView Tuner by
+ *      Ulrich Mueller <ulrich.mueller42@web.de>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/string.h>
+#include <linux/timer.h>
+#include <linux/delay.h>
+#include <linux/errno.h>
+#include <linux/slab.h>
+#include <linux/i2c.h>
+#include <linux/workqueue.h>
+
+#include <asm/semaphore.h>
+
+#include <media/ir-common.h>
+
+struct IR;
+struct IR {
+	struct i2c_client      c;
+	struct input_dev       input;
+	struct ir_input_state  ir;
+
+	struct work_struct     work;
+	struct timer_list      timer;
+	char                   phys[32];
+	int                    (*get_key)(struct IR*, u32*, u32*);
+};
+
+/* ----------------------------------------------------------------------- */
+/* insmod parameters                                                       */
+
+static int debug;
+module_param(debug, int, 0644);    /* debug level (0,1,2) */
+
+#define DEVNAME "ir-kbd-i2c"
+#define dprintk(level, fmt, arg...)	if (debug >= level) \
+	printk(KERN_DEBUG DEVNAME ": " fmt , ## arg)
+
+/* ----------------------------------------------------------------------- */
+
+static inline int reverse(int data, int bits)
+{
+	int i,c;
+	
+	for (c=0,i=0; i<bits; i++) {
+		c |= (((data & (1<<i)) ? 1:0)) << (bits-1-i);
+	}
+	return c;
+}
+
+static int get_key_haup(struct IR *ir, u32 *ir_key, u32 *ir_raw)
+{
+	unsigned char buf[3];
+	int start, toggle, dev, code;
+
+	/* poll IR chip */
+	if (3 != i2c_master_recv(&ir->c,buf,3))
+		return -EIO;
+
+	/* split rc5 data block ... */
+	start  = (buf[0] >> 6) &    3;
+	toggle = (buf[0] >> 5) &    1;
+	dev    =  buf[0]       & 0x1f;
+	code   = (buf[1] >> 2) & 0x3f;
+
+	if (3 != start)
+		/* no key pressed */
+		return 0;
+	dprintk(1,"ir hauppauge (rc5): s%d t%d dev=%d code=%d\n",
+		start, toggle, dev, code);
+
+	/* return key */
+	*ir_key = code;
+	*ir_raw = (start << 12) | (toggle << 11) | (dev << 6) | code;
+	return 1;
+}
+
+static int get_key_pixelview(struct IR *ir, u32 *ir_key, u32 *ir_raw)
+{
+        unsigned char b;
+	
+	/* poll IR chip */
+	if (1 != i2c_master_recv(&ir->c,&b,1)) {
+		dprintk(1,"read error\n");
+		return -EIO;
+	}
+	*ir_key = b;
+	*ir_raw = b;
+	return 1;
+}
+
+static int get_key_pv951(struct IR *ir, u32 *ir_key, u32 *ir_raw)
+{
+        unsigned char b;
+	
+	/* poll IR chip */
+	if (1 != i2c_master_recv(&ir->c,&b,1)) {
+		dprintk(1,"read error\n");
+		return -EIO;
+	}
+
+	/* ignore 0xaa */
+	if (b==0xaa)
+		return 0;
+	dprintk(2,"key %02x\n", b);
+	
+	*ir_key = b;
+	*ir_raw = b;
+	return 1;
+}
+
+static int get_key_knc1(struct IR *ir, u32 *ir_key, u32 *ir_raw)
+{
+	unsigned char b;
+	
+	/* poll IR chip */
+	if (1 != i2c_master_recv(&ir->c,&b,1)) {
+		dprintk(1,"read error\n");
+		return -EIO;
+	}
+	
+	/* it seems that 0xFE indicates that a button is still hold
+	   down, while 0xFF indicates that no button is hold
+	   down. 0xFE sequences are sometimes interrupted by 0xFF */
+	
+	dprintk(2,"key %02x\n", b);
+	
+	if (b == 0xFF)
+		return 0;
+	
+	if (b == 0xFE)
+		/* keep old data */
+		return 1;
+	
+	*ir_key = b;
+	*ir_raw = b;
+	return 1;
+}
+
+/* ----------------------------------------------------------------------- */
+
+static void ir_key_poll(struct IR *ir)
+{
+	u32 ir_key, ir_raw;
+	int rc;
+
+	dprintk(2,"ir_poll_key\n");
+	rc = ir->get_key(ir, &ir_key, &ir_raw);
+	if (rc < 0) {
+		dprintk(2,"error\n");
+		return;
+	}
+
+	if (0 == rc) {
+		ir_input_nokey(&ir->input,&ir->ir);
+	} else {
+		ir_input_keydown(&ir->input,&ir->ir, ir_key, ir_raw);
+	}
+}
+
+static void ir_timer(unsigned long data)
+{
+	struct IR *ir = (struct IR*)data;
+	schedule_work(&ir->work);
+}
+
+static void ir_work(void *data)
+{
+	struct IR *ir = data;
+	ir_key_poll(ir);
+	mod_timer(&ir->timer, jiffies+HZ/10);
+}
+
+/* ----------------------------------------------------------------------- */
+
+static int ir_attach(struct i2c_adapter *adap, int addr,
+		      unsigned short flags, int kind);
+static int ir_detach(struct i2c_client *client);
+static int ir_probe(struct i2c_adapter *adap);
+
+static struct i2c_driver driver = {
+        .name           = "ir remote kbd driver",
+        .id             = I2C_DRIVERID_EXP3, /* FIXME */
+        .flags          = I2C_DF_NOTIFY,
+        .attach_adapter = ir_probe,
+        .detach_client  = ir_detach,
+};
+
+static struct i2c_client client_template = 
+{
+        I2C_DEVNAME("unset"),
+        .driver = &driver
+};
+
+static int ir_attach(struct i2c_adapter *adap, int addr,
+		     unsigned short flags, int kind)
+{
+	IR_KEYTAB_TYPE *ir_codes = NULL;
+	char *name;
+	int ir_type;
+        struct IR *ir;
+		
+        if (NULL == (ir = kmalloc(sizeof(struct IR),GFP_KERNEL)))
+                return -ENOMEM;
+	memset(ir,0,sizeof(*ir));
+	ir->c = client_template;
+
+	i2c_set_clientdata(&ir->c, ir);
+	ir->c.adapter = adap;
+	ir->c.addr    = addr;
+
+	switch(addr) {
+	case 0x64:
+		name        = "Pixelview";
+		ir->get_key = get_key_pixelview;
+		ir_type     = IR_TYPE_OTHER;
+		ir_codes    = ir_codes_empty;
+		break;
+	case 0x4b:
+		name        = "PV951";
+		ir->get_key = get_key_pv951;
+		ir_type     = IR_TYPE_OTHER;
+		ir_codes    = ir_codes_empty;
+		break;
+	case 0x18:
+	case 0x1a:
+		name        = "Hauppauge";
+		ir->get_key = get_key_haup;
+		ir_type     = IR_TYPE_RC5;
+		ir_codes    = ir_codes_rc5_tv;
+		break;
+	case 0x30:
+		name        = "KNC One";
+		ir->get_key = get_key_knc1;
+		ir_type     = IR_TYPE_OTHER;
+		ir_codes    = ir_codes_empty;
+		break;
+	default:
+		/* shouldn't happen */
+		printk(DEVNAME ": Huh? unknown i2c address (0x%02x)?\n",addr);
+		kfree(ir);
+		return -1;
+	}
+
+	/* register i2c device */
+	i2c_attach_client(&ir->c);
+	snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (%s)", name);
+	snprintf(ir->phys, sizeof(ir->phys), "%s/%s/ir0",
+		 ir->c.adapter->dev.bus_id,
+		 ir->c.dev.bus_id);
+
+	/* init + register input device */
+	ir_input_init(&ir->input,&ir->ir,ir_type,ir_codes);
+	ir->input.id.bustype = BUS_I2C;
+	ir->input.name       = ir->c.name;
+	ir->input.phys       = ir->phys;
+	input_register_device(&ir->input);
+	printk(DEVNAME ": %s detected at %s\n",ir->input.name,ir->input.phys);
+	       
+	/* start polling via eventd */
+	INIT_WORK(&ir->work, ir_work, ir);
+	init_timer(&ir->timer);
+	ir->timer.function = ir_timer;
+	ir->timer.data     = (unsigned long)ir;
+	schedule_work(&ir->work);
+	
+	return 0;
+}
+
+static int ir_detach(struct i2c_client *client)
+{
+        struct IR *ir = i2c_get_clientdata(client);
+
+	/* kill outstanding polls */
+	del_timer(&ir->timer);
+	flush_scheduled_work();
+
+	/* unregister devices */
+	input_unregister_device(&ir->input);
+	i2c_detach_client(&ir->c);
+
+	/* free memory */
+	kfree(ir);
+	return 0;
+}
+
+static int ir_probe(struct i2c_adapter *adap)
+{
+	
+	/* The external IR receiver is at i2c address 0x34 (0x35 for
+	   reads).  Future Hauppauge cards will have an internal
+	   receiver at 0x30 (0x31 for reads).  In theory, both can be
+	   fitted, and Hauppauge suggest an external overrides an
+	   internal. 
+	   
+	   That's why we probe 0x1a (~0x34) first. CB 
+	*/
+	
+	static const int probe[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1};
+	struct i2c_client c; char buf; int i,rc;
+
+	if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_BT848)) {
+		memset(&c,0,sizeof(c));
+		c.adapter = adap;
+		for (i = 0; -1 != probe[i]; i++) {
+			c.addr = probe[i];
+			rc = i2c_master_recv(&c,&buf,1);
+			dprintk(1,"probe 0x%02x @ %s: %s\n",
+				probe[i], adap->name, 
+				(1 == rc) ? "yes" : "no");
+			if (1 == rc) {
+				ir_attach(adap,probe[i],0,0);
+				break;
+			}
+		}
+	}
+	return 0;
+}
+
+/* ----------------------------------------------------------------------- */
+
+MODULE_AUTHOR("Gerd Knorr, Michal Kochanowicz, Christoph Bartelmus, Ulrich Mueller");
+MODULE_DESCRIPTION("input driver for i2c IR remote controls");
+MODULE_LICENSE("GPL");
+
+static int ir_init(void)
+{
+	i2c_add_driver(&driver);
+	return 0;
+}
+
+static void ir_fini(void)
+{
+	i2c_del_driver(&driver);
+}
+
+module_init(ir_init);
+module_exit(ir_fini);
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff -Nru a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c
--- a/drivers/media/video/msp3400.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/media/video/msp3400.c	Tue Feb  3 19:45:30 2004
@@ -50,10 +50,6 @@
 #include <asm/semaphore.h>
 #include <asm/pgtable.h>
 
-/* kernel_thread */
-#define __KERNEL_SYSCALLS__
-#include <linux/unistd.h>
-
 #include <media/audiochip.h>
 #include "msp3400.h"
 
@@ -194,7 +190,7 @@
 		err++;
 		printk(KERN_WARNING "msp34xx: I/O error #%d (read 0x%02x/0x%02x)\n",
 		       err, dev, addr);
-		current->state = TASK_INTERRUPTIBLE;
+		set_current_state(TASK_INTERRUPTIBLE);
 		schedule_timeout(HZ/10);
 	}
 	if (3 == err) {
@@ -223,7 +219,7 @@
 		err++;
 		printk(KERN_WARNING "msp34xx: I/O error #%d (write 0x%02x/0x%02x)\n",
 		       err, dev, addr);
-		current->state = TASK_INTERRUPTIBLE;
+		set_current_state(TASK_INTERRUPTIBLE);
 		schedule_timeout(HZ/10);
 	}
 	if (3 == err) {
@@ -804,7 +800,7 @@
 		}
 
 		/* some time for the tuner to sync */
-		current->state   = TASK_INTERRUPTIBLE;
+		set_current_state(TASK_INTERRUPTIBLE);
 		schedule_timeout(HZ/5);
 		if (signal_pending(current))
 			goto done;
@@ -839,7 +835,7 @@
 		for (this = 0; this < count; this++) {
 			msp3400c_setcarrier(client, cd[this].cdo,cd[this].cdo);
 
-			current->state   = TASK_INTERRUPTIBLE;
+			set_current_state(TASK_INTERRUPTIBLE);
 			schedule_timeout(HZ/10);
 			if (signal_pending(current))
 				goto done;
@@ -876,7 +872,7 @@
 		for (this = 0; this < count; this++) {
 			msp3400c_setcarrier(client, cd[this].cdo,cd[this].cdo);
 
-			current->state   = TASK_INTERRUPTIBLE;
+			set_current_state(TASK_INTERRUPTIBLE);
 			schedule_timeout(HZ/10);
 			if (signal_pending(current))
 				goto done;
@@ -1052,7 +1048,7 @@
 		}
 	
 		/* some time for the tuner to sync */
-		current->state   = TASK_INTERRUPTIBLE;
+		set_current_state(TASK_INTERRUPTIBLE);
 		schedule_timeout(HZ/5);
 		if (signal_pending(current))
 			goto done;
@@ -1113,7 +1109,7 @@
 		} else {
 			/* triggered autodetect */
 			for (;;) {
-				current->state   = TASK_INTERRUPTIBLE;
+				set_current_state(TASK_INTERRUPTIBLE);
 				schedule_timeout(HZ/10);
 				if (signal_pending(current))
 					goto done;
@@ -1204,6 +1200,8 @@
 #endif
 			break;
 		case 0x0003:
+		case 0x0004:
+		case 0x0005:
 			msp->mode   = MSP_MODE_FM_TERRA;
 			msp->stereo = VIDEO_SOUND_MONO;
 			msp->nicam_on = 0;
@@ -1262,7 +1260,7 @@
 	DECLARE_MUTEX_LOCKED(sem);
 	struct msp3400c *msp;
         struct i2c_client *c;
-	int i;
+	int i, rc;
 
         client_template.adapter = adap;
         client_template.addr = addr;
@@ -1316,7 +1314,7 @@
 #endif
 	msp3400c_setvolume(c,msp->muted,msp->left,msp->right);
 
-	snprintf(c->name, I2C_NAME_SIZE, "MSP34%02d%c-%c%d",
+	snprintf(c->name, sizeof(c->name), "MSP34%02d%c-%c%d",
 		 (msp->rev2>>8)&0xff, (msp->rev1&0xff)+'@',
 		 ((msp->rev1>>8)&0xff)+'@', msp->rev2&0x1f);
 
@@ -1345,9 +1343,12 @@
 
 	/* startup control thread */
 	msp->notify = &sem;
-	kernel_thread(msp->simple ? msp3410d_thread : msp3400c_thread,
-		      (void *)c, 0);
-	down(&sem);
+	rc = kernel_thread(msp->simple ? msp3410d_thread : msp3400c_thread,
+			   (void *)c, 0);
+	if (rc < 0)
+		printk(KERN_WARNING "msp34xx: kernel_thread() failed\n");
+	else
+		down(&sem);
 	msp->notify = NULL;
 	wake_up_interruptible(&msp->wq);
 
@@ -1398,8 +1399,13 @@
 
 static int msp_probe(struct i2c_adapter *adap)
 {
+#ifdef I2C_ADAP_CLASS_TV_ANALOG
 	if (adap->class & I2C_ADAP_CLASS_TV_ANALOG)
 		return i2c_probe(adap, &addr_data, msp_attach);
+#else
+	if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_BT848))
+		return i2c_probe(adap, &addr_data, msp_attach);
+#endif
 	return 0;
 }
 
diff -Nru a/drivers/media/video/saa7134/Makefile b/drivers/media/video/saa7134/Makefile
--- a/drivers/media/video/saa7134/Makefile	Tue Feb  3 19:45:43 2004
+++ b/drivers/media/video/saa7134/Makefile	Tue Feb  3 19:45:43 2004
@@ -1,7 +1,7 @@
 
 saa7134-objs :=	saa7134-cards.o saa7134-core.o saa7134-i2c.o	\
 		saa7134-oss.o saa7134-ts.o saa7134-tvaudio.o	\
-		saa7134-vbi.o saa7134-video.o
+		saa7134-vbi.o saa7134-video.o saa7134-input.o
 
 obj-$(CONFIG_VIDEO_SAA7134) += saa7134.o
 
diff -Nru a/drivers/media/video/saa7134/saa6752hs.c b/drivers/media/video/saa7134/saa6752hs.c
--- a/drivers/media/video/saa7134/saa6752hs.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/media/video/saa7134/saa6752hs.c	Tue Feb  3 19:45:42 2004
@@ -168,13 +168,13 @@
 		}
 	
 		// wait a bit
-		current->state = TASK_INTERRUPTIBLE;
-		schedule_timeout(1);
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(HZ/100);
 	}
 
 	// delay a bit to let encoder settle
-	current->state = TASK_INTERRUPTIBLE;
-	schedule_timeout(5);
+	set_current_state(TASK_INTERRUPTIBLE);
+	schedule_timeout(HZ/20);
 	
 	// done
   	return status;
@@ -230,6 +230,7 @@
 static int saa6752hs_init(struct i2c_client* client, struct mpeg_params* params)
 {  
 	unsigned char buf[3];
+	void *data;
 
 	// check the bitrate parameters first
 	if (params != NULL) {
@@ -281,12 +282,13 @@
 	i2c_master_send(client,buf,3);
   
         // setup bitrate settings
+	data = i2c_get_clientdata(client);
 	if (params) {
 		saa6752hs_set_bitrate(client, params);
-		memcpy(client->data, params, sizeof(struct mpeg_params));
+		memcpy(data, params, sizeof(struct mpeg_params));
 	} else {
 		// parameters were not supplied. use the previous set
-   		saa6752hs_set_bitrate(client, (struct mpeg_params*) client->data);
+   		saa6752hs_set_bitrate(client, (struct mpeg_params*) data);
 	}
 	  
 	// Send SI tables
@@ -324,7 +326,7 @@
 	if (NULL == (params = kmalloc(sizeof(struct mpeg_params), GFP_KERNEL)))
 		return -ENOMEM;
 	memcpy(params,&mpeg_params_template,sizeof(struct mpeg_params));
-	client->data = params;
+	i2c_set_clientdata(client, params);
 
         i2c_attach_client(client);
   
@@ -341,8 +343,11 @@
 
 static int saa6752hs_detach(struct i2c_client *client)
 {
+	void *data;
+
+	data = i2c_get_clientdata(client);
 	i2c_detach_client(client);
-	kfree(client->data);
+	kfree(data);
 	kfree(client);
 	return 0;
 }
diff -Nru a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
--- a/drivers/media/video/saa7134/saa7134-cards.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/media/video/saa7134/saa7134-cards.c	Tue Feb  3 19:45:41 2004
@@ -2,7 +2,7 @@
  * device driver for philips saa7134 based TV cards
  * card-specific stuff.
  *
- * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
+ * (c) 2001-03 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -70,6 +70,10 @@
 			.amux = LINE2,
 			.tv   = 1,
 		}},
+		.radio = {
+			.name = name_radio,
+			.amux = LINE2,
+		},
 	},
 	[SAA7134_BOARD_FLYVIDEO3000] = {
 		/* "Marco d'Itri" <md@Linux.IT> */
@@ -235,7 +239,8 @@
 		},
 	},
 	[SAA7134_BOARD_TVSTATION_RDS] = {
-		.name		= "KNC One TV-Station RDS",
+                /* Typhoon TV Tuner RDS: Art.Nr. 50694 */
+		.name		= "KNC One TV-Station RDS / Typhoon TV Tuner RDS",
 		.audio_clock	= 0x00200000,
 		.tuner_type	= TUNER_PHILIPS_FM1216ME_MK3,
 		.need_tda9887   = 1,
@@ -245,18 +250,61 @@
 			.amux = TV,
 			.tv   = 1,
 		},{
+			.name = name_tv_mono,
+                        .vmux = 1,
+                        .amux   = LINE2,
+                        .tv   = 1,
+                },{
+
+			.name = name_svideo,
+			.vmux = 8,
+			.amux = LINE1,
+		},{
 			.name = name_comp1,
-			.vmux = 2,
+			.vmux = 3,
 			.amux = LINE1,
 		},{
-			.name = name_comp2,
+
+                        .name = "CVid over SVid",
+                        .vmux = 0,
+                        .amux = LINE1,
+                }},
+		.radio = {
+			.name = name_radio,
+			.amux = LINE2,
+		},
+	},
+	[SAA7134_BOARD_TVSTATION_DVR] = {
+		.name		= "KNC One TV-Station DVR",
+		.audio_clock	= 0x00200000,
+		.tuner_type	= TUNER_PHILIPS_FM1216ME_MK3,
+		.need_tda9887	= 1,
+		.gpiomask	= 0x820000,
+		.inputs		= {{
+			.name = name_tv,
+			.vmux = 1,
+			.amux = LINE2,
+			.tv   = 1,
+			.gpio = 0x20000,
+		},{
+			.name = name_svideo,
+			.vmux = 8,
+			.amux = LINE1,
+			.gpio = 0x20000,
+		},{
+			.name = name_comp1,
 			.vmux = 3,
 			.amux = LINE1,
+			.gpio = 0x20000,
 		}},
-		.radio = {
+		.radio		= {
 			.name = name_radio,
 			.amux = LINE2,
+			.gpio = 0x20000,
 		},
+		.i2s_rate	= 48000,
+		.has_ts		= 1,
+		.video_out	= CCIR656,
 	},
 	[SAA7134_BOARD_CINERGY400] = {
                 .name           = "Terratec Cinergy 400 TV",
@@ -283,7 +331,7 @@
         },
 	[SAA7134_BOARD_MD5044] = {
 		.name           = "Medion 5044",
-		.audio_clock    = 0x00200000,
+		.audio_clock    = 0x00187de7, // was: 0x00200000,
 		.tuner_type     = TUNER_PHILIPS_FM1216ME_MK3,
 		.need_tda9887   = 1,
 		.inputs         = {{
@@ -393,11 +441,11 @@
 		},
 	},
 	[SAA7134_BOARD_TYPHOON_90031] = {
-		/* Christian Rothlï¿½nder <Christian@Rothlaender.net> */
+		/* aka Typhoon "TV+Radio", Art.Nr 90031 */
+		/* Tom Zoerner <tomzo at users sourceforge net> */
 		.name           = "Typhoon TV+Radio 90031",
 		.audio_clock    = 0x00200000,
-		//.tuner_type     = TUNER_PHILIPS_PAL,
-		.tuner_type     = TUNER_PHILIPS_FM1216ME_MK3,
+		.tuner_type     = TUNER_PHILIPS_PAL,
 		.need_tda9887   = 1,
 		.inputs         = {{
 			.name   = name_tv,
@@ -450,6 +498,11 @@
 			.vmux = 8,
 			.amux = TV,
 			.tv   = 1,
+		},{
+			.name = name_tv_mono,
+			.vmux = 8,
+			.amux = LINE2,
+			.tv   = 1,
 		}},
         },
 	[SAA7134_BOARD_ASUSTeK_TVFM7134] = {
@@ -505,6 +558,45 @@
                         .tv   = 1,
                 }},
 	},
+	[SAA7134_BOARD_10MOONSTVMASTER] = {
+		/* "lilicheng" <llc@linuxfans.org> */
+		.name           = "10MOONS PCI TV CAPTURE CARD",
+		.audio_clock    = 0x00200000,
+		.tuner_type     = TUNER_LG_PAL_NEW_TAPC,
+		.gpiomask       = 0xe000,
+		.inputs         = {{
+			.name = name_tv,
+			.vmux = 1,
+			.amux = LINE2,
+			.gpio = 0x0000,
+			.tv   = 1,
+		},{
+			.name = name_comp1,
+			.vmux = 0,
+			.amux = LINE2,
+			.gpio = 0x4000,
+		},{
+			.name = name_comp2,
+			.vmux = 3,
+			.amux = LINE2,
+			.gpio = 0x4000,
+		},{
+			.name = name_svideo,
+			.vmux = 8,
+			.amux = LINE2,
+			.gpio = 0x4000,
+		}},
+                .radio = {
+                        .name = name_radio,
+                        .amux = LINE2,
+			.gpio = 0x2000,
+                },
+		.mute = {
+			.name = name_mute,
+                        .amux = LINE2,
+			.gpio = 0x8000,
+		},
+	},
 	[SAA7134_BOARD_BMK_MPEX_NOTUNER] = {
 		/* "Andrew de Quincey" <adq@lidskialf.net> */
 		.name		= "BMK MPEX No Tuner",
@@ -555,13 +647,224 @@
                 }},
         },
 	[SAA7134_BOARD_CRONOS_PLUS] = {
+		/* gpio pins:
+		   0  .. 3   BASE_ID
+		   4  .. 7   PROTECT_ID
+		   8  .. 11  USER_OUT
+		   12 .. 13  USER_IN
+		   14 .. 15  VIDIN_SEL */
 		.name           = "Matrox CronosPlus",
 		.tuner_type     = TUNER_ABSENT,
+		.gpiomask       = 0xcf00,
+                .inputs         = {{
+                        .name = name_comp1,
+                        .vmux = 0,
+			.gpio = 2 << 14,
+		},{
+                        .name = name_comp2,
+                        .vmux = 0,
+			.gpio = 1 << 14,
+		},{
+                        .name = name_comp3,
+                        .vmux = 0,
+			.gpio = 0 << 14,
+		},{
+                        .name = name_comp4,
+                        .vmux = 0,
+			.gpio = 3 << 14,
+		},{
+			.name = name_svideo,
+			.vmux = 8,
+			.gpio = 2 << 14,
+                }},
+        },
+	[SAA7134_BOARD_MD2819] = {
+		.name           = "Medion 2819/ AverMedia M156",
+		.audio_clock    = 0x00187de7,
+		.tuner_type     = TUNER_PHILIPS_FM1216ME_MK3,
+		.need_tda9887   = 1,
+		.inputs         = {{
+			.name = name_tv,
+			.vmux = 1,
+			.amux = TV,
+			.tv   = 1,
+		},{
+			.name = name_comp1,
+			.vmux = 0,
+			.amux = LINE2,
+		},{
+			.name = name_comp2,
+			.vmux = 3,
+			.amux = LINE2,
+		},{
+			.name = name_svideo,
+			.vmux = 8,
+			.amux = LINE2,
+		}},
+		.radio = {
+			.name = name_radio,
+			.amux = LINE2,
+		},
+	},
+	[SAA7134_BOARD_BMK_MPEX_TUNER] = {
+		/* "Greg Wickham <greg.wickham@grangenet.net> */
+		.name           = "BMK MPEX Tuner",
+		.audio_clock    = 0x200000,
+		.tuner_type     = TUNER_PHILIPS_PAL,
+		.inputs         = {{
+			.name = name_comp1,
+			.vmux = 1,
+			.amux = LINE1,
+		},{
+			.name = name_svideo,
+			.vmux = 8,
+			.amux = LINE1,
+		},{
+			.name = name_tv,
+			.vmux = 3,
+			.amux = LINE2,
+			.tv   = 1,
+		}},
+		.i2s_rate  = 48000,
+		.has_ts    = 1,
+		.video_out = CCIR656,
+        },
+        [SAA7134_BOARD_ASUSTEK_TVFM7133] = {
+                .name           = "ASUS TV-FM 7133",
+                .audio_clock    = 0x00187de7,
+                .tuner_type     = TUNER_PHILIPS_FM1236_MK3,
+                .need_tda9887   = 1,
+                .inputs         = {{
+                        .name = name_tv,
+                        .vmux = 1,
+                        .amux = TV,
+                        .tv   = 1,
+                }},
+                .radio = {
+                        .name = name_radio,
+                        .amux = LINE1,
+                },
+        },
+	[SAA7134_BOARD_PINNACLE_PCTV_STEREO] = {
+                .name           = "Pinnacle PCTV Stereo (saa7134)",
+                .audio_clock    = 0x00187de7,
+                .tuner_type     = TUNER_MT2032,
+                .need_tda9887   = 1,
                 .inputs         = {{
+                        .name = name_tv,
+                        .vmux = 3,
+                        .amux = TV,
+                        .tv   = 1,
+                },{
                         .name = name_comp1,
                         .vmux = 0,
+                        .amux = LINE2,
+                },{
+                        .name = name_comp2,
+                        .vmux = 1,
+                        .amux = LINE2,
+                },{
+                        .name = name_svideo,
+                        .vmux = 8,
+                        .amux = LINE2,
                 }},
         },
+	[SAA7134_BOARD_MANLI_MTV002] = {
+		/* Ognjen Nastic <ognjen@logosoft.ba> */
+		.name           = "Manli MuchTV M-TV002",
+		.audio_clock    = 0x00200000,
+		.tuner_type     = TUNER_PHILIPS_PAL,
+		.inputs         = {{
+			.name = name_svideo,
+			.vmux = 8,
+			.amux = LINE1,
+		},{
+			.name   = name_comp1,
+			.vmux   = 1,
+			.amux   = LINE1,
+		},{
+			.name = name_tv,
+			.vmux = 3,
+			.amux = LINE2,
+			.tv   = 1,
+		}},
+		.radio = {
+			.name = name_radio,
+			.amux = LINE2,
+		},
+	},
+	[SAA7134_BOARD_MANLI_MTV001] = {
+		/* Ognjen Nastic <ognjen@logosoft.ba> UNTESTED */
+		.name           = "Manli MuchTV M-TV001",
+		.audio_clock    = 0x00200000,
+		.tuner_type     = TUNER_PHILIPS_PAL,
+		.inputs         = {{
+			.name = name_svideo,
+			.vmux = 8,
+			.amux = LINE1,
+		},{			
+			.name = name_comp1,
+			.vmux = 1,
+			.amux = LINE1,
+		},{
+			.name = name_tv,
+			.vmux = 3,
+			.amux = LINE2,
+			.tv   = 1,
+		}},
+        },
+	[SAA7134_BOARD_TG3000TV] = {
+		/* TransGear 3000TV */
+		.name           = "Nagase Sangyo TransGear 3000TV",
+		.audio_clock    = 0x00187de7,
+		.tuner_type     = TUNER_PHILIPS_NTSC_M,
+		.inputs         = {{
+			.name = name_tv,
+			.vmux = 1,
+			.amux = LINE2,
+			.tv   = 1,
+		},{
+			.name = name_comp1,
+			.vmux = 3,
+			.amux = LINE2,
+		},{
+			.name = name_svideo,
+			.vmux = 8,
+			.amux = LINE2,
+		}},
+	},
+        [SAA7134_BOARD_ECS_TVP3XP] = {
+                .name           = "Elitegroup ECS TVP3XP FM1216 Tuner Card",
+                .audio_clock    = 0x187de7,  // xtal 32.1 MHz
+                .tuner_type     = TUNER_PHILIPS_PAL,
+                .inputs         = {{
+                        .name   = name_tv,
+                        .vmux   = 1,
+                        .amux   = TV,
+                        .tv     = 1,
+                },{
+                        .name   = name_tv_mono,
+                        .vmux   = 1,
+                        .amux   = LINE2,
+                        .tv     = 1,
+                },{
+                        .name   = name_comp1,
+                        .vmux   = 3,
+                        .amux   = LINE1,
+                },{
+                        .name   = name_svideo,
+                        .vmux   = 8,
+                        .amux   = LINE1,
+		},{
+			.name   = "CVid over SVid",
+			.vmux   = 0,
+			.amux   = LINE1,
+		}},
+                .radio = {
+                        .name   = name_radio,
+                        .amux   = LINE2,
+                },
+        },
 };
 const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
 
@@ -613,6 +916,12 @@
 		.driver_data  = SAA7134_BOARD_FLYVIDEO3000,
         },{
 		.vendor       = PCI_VENDOR_ID_PHILIPS,
+                .device       = PCI_DEVICE_ID_PHILIPS_SAA7134,
+                .subvendor    = 0x4e42,				//"Typhoon PCI Capture TV Card" Art.No. 50673
+                .subdevice    = 0x0138,
+                .driver_data  = SAA7134_BOARD_FLYVIDEO3000,
+        },{
+		.vendor       = PCI_VENDOR_ID_PHILIPS,
 		.device       = PCI_DEVICE_ID_PHILIPS_SAA7130,
 		.subvendor    = 0x5168,
 		.subdevice    = 0x0138,
@@ -648,11 +957,35 @@
                 .subdevice    = 0x4830,
                 .driver_data  = SAA7134_BOARD_ASUSTeK_TVFM7134,
         },{
+                .vendor       = PCI_VENDOR_ID_PHILIPS,
+                .device       = PCI_DEVICE_ID_PHILIPS_SAA7133,
+                .subvendor    = PCI_VENDOR_ID_ASUSTEK,
+                .subdevice    = 0x4843,
+                .driver_data  = SAA7134_BOARD_ASUSTEK_TVFM7133,
+	},{
+                .vendor       = PCI_VENDOR_ID_PHILIPS,
+                .device       = PCI_DEVICE_ID_PHILIPS_SAA7134,
+                .subvendor    = PCI_VENDOR_ID_ASUSTEK,
+                .subdevice    = 0x4840,
+                .driver_data  = SAA7134_BOARD_ASUSTeK_TVFM7134,
+        },{
 		.vendor       = PCI_VENDOR_ID_PHILIPS,
 		.device       = PCI_DEVICE_ID_PHILIPS_SAA7134,
 		.subvendor    = PCI_VENDOR_ID_PHILIPS,
 		.subdevice    = 0xfe01,
-		.driver_data  = SAA7134_BOARD_TYPHOON_90031,
+		.driver_data  = SAA7134_BOARD_TVSTATION_RDS,
+	},{
+		.vendor       = PCI_VENDOR_ID_PHILIPS,
+		.device       = PCI_DEVICE_ID_PHILIPS_SAA7134,
+		.subvendor    = 0x1894,
+		.subdevice    = 0xfe01,
+		.driver_data  = SAA7134_BOARD_TVSTATION_RDS,
+	},{
+		.vendor       = PCI_VENDOR_ID_PHILIPS,
+		.device       = PCI_DEVICE_ID_PHILIPS_SAA7134,
+		.subvendor    = 0x1894,
+		.subdevice    = 0xa006,
+		.driver_data  = SAA7134_BOARD_TVSTATION_DVR,
 	},{
 		.vendor       = PCI_VENDOR_ID_PHILIPS,
 		.device       = PCI_DEVICE_ID_PHILIPS_SAA7134,
@@ -661,6 +994,12 @@
 		.driver_data  = SAA7134_BOARD_VA1000POWER,
         },{
 		.vendor       = PCI_VENDOR_ID_PHILIPS,
+		.device       = PCI_DEVICE_ID_PHILIPS_SAA7130,
+                .subvendor    = PCI_VENDOR_ID_PHILIPS,
+                .subdevice    = 0x2001,
+		.driver_data  = SAA7134_BOARD_10MOONSTVMASTER,
+        },{
+		.vendor       = PCI_VENDOR_ID_PHILIPS,
 		.device       = PCI_DEVICE_ID_PHILIPS_SAA7133,
                 .subvendor    = 0x185b,
                 .subdevice    = 0xc100,
@@ -672,6 +1011,38 @@
                 .subdevice    = 0x48d0,
 		.driver_data  = SAA7134_BOARD_CRONOS_PLUS,
 	},{
+		.vendor       = PCI_VENDOR_ID_PHILIPS,
+		.device       = PCI_DEVICE_ID_PHILIPS_SAA7134,
+                .subvendor    = 0x1461, /* Avermedia Technologies Inc */
+                .subdevice    = 0xa70b,
+		.driver_data  = SAA7134_BOARD_MD2819,
+	},{
+		/* AverMedia Studio 305, using AverMedia M156 entry for now */
+		.vendor       = PCI_VENDOR_ID_PHILIPS,
+		.device       = PCI_DEVICE_ID_PHILIPS_SAA7134,
+                .subvendor    = 0x1461, /* Avermedia Technologies Inc */
+                .subdevice    = 0x2115,
+		.driver_data  = SAA7134_BOARD_MD2819,
+        },{
+		/* TransGear 3000TV */
+		.vendor       = PCI_VENDOR_ID_PHILIPS,
+		.device       = PCI_DEVICE_ID_PHILIPS_SAA7130,
+                .subvendor    = 0x1461, /* Avermedia Technologies Inc */
+                .subdevice    = 0x050c,
+		.driver_data  = SAA7134_BOARD_TG3000TV,
+	},{
+                .vendor       = PCI_VENDOR_ID_PHILIPS,
+                .device       = PCI_DEVICE_ID_PHILIPS_SAA7134,
+                .subvendor    = 0x11bd,
+                .subdevice    = 0x002b,
+                .driver_data  = SAA7134_BOARD_PINNACLE_PCTV_STEREO,
+        },{
+                .vendor       = PCI_VENDOR_ID_PHILIPS,
+                .device       = PCI_DEVICE_ID_PHILIPS_SAA7134,
+                .subvendor    = 0x1019,
+                .subdevice    = 0x4cb4,
+                .driver_data  = SAA7134_BOARD_ECS_TVP3XP,
+        },{
 		
 		/* --- boards without eeprom + subsystem ID --- */
                 .vendor       = PCI_VENDOR_ID_PHILIPS,
@@ -777,6 +1148,7 @@
 		dev->has_remote = 1;
 		break;
 	case SAA7134_BOARD_CINERGY400:
+	case SAA7134_BOARD_CINERGY600:
 		dev->has_remote = 1;
 		break;
 	}
diff -Nru a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
--- a/drivers/media/video/saa7134/saa7134-core.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/video/saa7134/saa7134-core.c	Tue Feb  3 19:45:17 2004
@@ -599,12 +599,10 @@
 		if ((report & SAA7134_IRQ_REPORT_DONE_RA3))
 			saa7134_irq_oss_done(dev,status);
 
-#ifdef CONFIG_VIDEO_IR
 		if ((report & (SAA7134_IRQ_REPORT_GPIO16 |
 			       SAA7134_IRQ_REPORT_GPIO18)) &&
 		    dev->remote)
 			saa7134_input_irq(dev);
-#endif
 
 	};
 	if (10 == loop) {
@@ -636,9 +634,7 @@
 	saa7134_vbi_init1(dev);
 	if (card_has_ts(dev))
 		saa7134_ts_init1(dev);
-#ifdef CONFIG_VIDEO_IR
 	saa7134_input_init1(dev);
-#endif
 
 	switch (dev->pci->device) {
 	case PCI_DEVICE_ID_PHILIPS_SAA7134:
@@ -714,9 +710,7 @@
 	}
 	if (card_has_ts(dev))
 		saa7134_ts_fini(dev);
-#ifdef CONFIG_VIDEO_IR
 	saa7134_input_fini(dev);
-#endif
 	saa7134_vbi_fini(dev);
 	saa7134_video_fini(dev);
 	saa7134_tvaudio_fini(dev);
@@ -907,7 +901,7 @@
 	}
 
 	/* wait a bit, register i2c bus */
-	current->state = TASK_INTERRUPTIBLE;
+	set_current_state(TASK_INTERRUPTIBLE);
 	schedule_timeout(HZ/10);
 	saa7134_i2c_register(dev);
 
@@ -922,6 +916,10 @@
   	if (card_has_ts(dev))
 		request_module("saa6752hs");
 
+#ifdef VIDIOC_G_PRIORITY
+	v4l2_prio_init(&dev->prio);
+#endif
+
 	/* register v4l devices */
 	dev->video_dev = vdev_init(dev,&saa7134_video_template,"video");
 	err = video_register_device(dev->video_dev,VFL_TYPE_GRABBER,
@@ -1041,18 +1039,7 @@
 	saa_writel(SAA7134_MAIN_CTRL,0);
 
 	/* shutdown subsystems */
-	switch (dev->pci->device) {
-	case PCI_DEVICE_ID_PHILIPS_SAA7134:
-	case PCI_DEVICE_ID_PHILIPS_SAA7133:
-	case PCI_DEVICE_ID_PHILIPS_SAA7135:
-		saa7134_oss_fini(dev);
-		break;
-	}
-	if (card_has_ts(dev))
-		saa7134_ts_fini(dev);
-	saa7134_vbi_fini(dev);
-	saa7134_video_fini(dev);
-	saa7134_tvaudio_fini(dev);
+	saa7134_hwfini(dev);
 
 	/* unregister */
 	saa7134_i2c_unregister(dev);
@@ -1099,6 +1086,10 @@
 	       (SAA7134_VERSION_CODE >> 16) & 0xff,
 	       (SAA7134_VERSION_CODE >>  8) & 0xff,
 	       SAA7134_VERSION_CODE & 0xff);
+#ifdef SNAPSHOT
+	printk(KERN_INFO "saa7130/34: snapshot date %04d-%02d-%02d\n",
+	       SNAPSHOT/10000, (SNAPSHOT/100)%100, SNAPSHOT%100);
+#endif
 	return pci_module_init(&saa7134_pci_driver);
 }
 
diff -Nru a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/media/video/saa7134/saa7134-input.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,218 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Should you need to contact me, the author, you can do so either by
+ * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
+ * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/input.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/input.h>
+
+#include "saa7134-reg.h"
+#include "saa7134.h"
+
+/* ---------------------------------------------------------------------- */
+
+static IR_KEYTAB_TYPE flyvideo_codes[IR_KEYTAB_SIZE] = {
+	[   15 ] = KEY_KP0,
+	[    3 ] = KEY_KP1,
+	[    4 ] = KEY_KP2,
+	[    5 ] = KEY_KP3,
+	[    7 ] = KEY_KP4,
+	[    8 ] = KEY_KP5,
+	[    9 ] = KEY_KP6,
+	[   11 ] = KEY_KP7,
+	[   12 ] = KEY_KP8,
+	[   13 ] = KEY_KP9,
+
+	[   14 ] = KEY_TUNER,        // Air/Cable
+	[   17 ] = KEY_VIDEO,        // Video
+	[   21 ] = KEY_AUDIO,        // Audio
+	[    0 ] = KEY_POWER,        // Pover
+	[    2 ] = KEY_ZOOM,         // Fullscreen
+	[   27 ] = KEY_MUTE,         // Mute
+	[   20 ] = KEY_VOLUMEUP,
+	[   23 ] = KEY_VOLUMEDOWN,
+	[   18 ] = KEY_CHANNELUP,    // Channel +
+	[   19 ] = KEY_CHANNELDOWN,  // Channel - 
+	[    6 ] = KEY_AGAIN,        // Recal
+	[   16 ] = KEY_KPENTER,      // Enter
+
+#if 1 /* FIXME */
+	[   26 ] = KEY_F22,          // Stereo
+	[   24 ] = KEY_EDIT,         // AV Source
+#endif
+};
+
+static IR_KEYTAB_TYPE cinergy_codes[IR_KEYTAB_SIZE] = {
+	[    0 ] = KEY_KP0,
+	[    1 ] = KEY_KP1,
+	[    2 ] = KEY_KP2,
+	[    3 ] = KEY_KP3,
+	[    4 ] = KEY_KP4,
+	[    5 ] = KEY_KP5,
+	[    6 ] = KEY_KP6,
+	[    7 ] = KEY_KP7,
+	[    8 ] = KEY_KP8,
+	[    9 ] = KEY_KP9,
+
+	[ 0x0a ] = KEY_POWER,
+	[ 0x0b ] = KEY_PROG1,           // app
+	[ 0x0c ] = KEY_ZOOM,            // zoom/fullscreen
+	[ 0x0d ] = KEY_CHANNELUP,       // channel
+	[ 0x0e ] = KEY_CHANNELDOWN,     // channel-
+	[ 0x0f ] = KEY_VOLUMEUP,
+	[ 0x10 ] = KEY_VOLUMEDOWN,
+	[ 0x11 ] = KEY_TUNER,           // AV
+	[ 0x12 ] = KEY_NUMLOCK,         // -/--
+	[ 0x13 ] = KEY_AUDIO,           // audio
+	[ 0x14 ] = KEY_MUTE,
+	[ 0x15 ] = KEY_UP,
+	[ 0x16 ] = KEY_DOWN,
+	[ 0x17 ] = KEY_LEFT,
+	[ 0x18 ] = KEY_RIGHT,
+	[ 0x19 ] = BTN_LEFT,
+	[ 0x1a ] = BTN_RIGHT,
+	[ 0x1b ] = KEY_WWW,             // text
+	[ 0x1c ] = KEY_REWIND,
+	[ 0x1d ] = KEY_FORWARD,
+	[ 0x1e ] = KEY_RECORD,
+	[ 0x1f ] = KEY_PLAY,
+	[ 0x20 ] = KEY_PREVIOUSSONG,
+	[ 0x21 ] = KEY_NEXTSONG,
+	[ 0x22 ] = KEY_PAUSE,
+	[ 0x23 ] = KEY_STOP,
+};
+
+/* ---------------------------------------------------------------------- */
+
+static int build_key(struct saa7134_dev *dev)
+{
+	struct saa7134_ir *ir = dev->remote;
+	u32 gpio, data;
+
+	/* rising SAA7134_GPIO_GPRESCAN reads the status */
+	saa_clearb(SAA7134_GPIO_GPMODE3,SAA7134_GPIO_GPRESCAN);
+	saa_setb(SAA7134_GPIO_GPMODE3,SAA7134_GPIO_GPRESCAN);
+	gpio = saa_readl(SAA7134_GPIO_GPSTATUS0 >> 2);
+	data = ir_extract_bits(gpio, ir->mask_keycode);
+
+	printk("%s: build_key gpio=0x%x mask=0x%x data=%d\n",
+	       dev->name, gpio, ir->mask_keycode, data);
+
+	if ((ir->mask_keydown  &&  (0 != (gpio & ir->mask_keydown))) ||
+	    (ir->mask_keyup    &&  (0 == (gpio & ir->mask_keyup)))) {
+		ir_input_keydown(&ir->dev,&ir->ir,data,data);
+	} else {
+		ir_input_nokey(&ir->dev,&ir->ir);
+	}
+	return 0;
+}
+
+/* ---------------------------------------------------------------------- */
+
+void saa7134_input_irq(struct saa7134_dev *dev)
+{
+	build_key(dev);
+}
+
+int saa7134_input_init1(struct saa7134_dev *dev)
+{
+	struct saa7134_ir *ir;
+	IR_KEYTAB_TYPE *ir_codes = NULL;
+	u32 mask_keycode = 0;
+	u32 mask_keydown = 0;
+	u32 mask_keyup   = 0;
+	int ir_type      = IR_TYPE_OTHER;
+
+	/* detect & configure */
+	if (!dev->has_remote)
+		return -ENODEV;
+	switch (dev->board) {
+	case SAA7134_BOARD_FLYVIDEO2000:
+	case SAA7134_BOARD_FLYVIDEO3000:
+		ir_codes     = flyvideo_codes;
+		mask_keycode = 0xEC00000;
+		mask_keydown = 0x0040000;
+		break;
+	case SAA7134_BOARD_CINERGY400:
+	case SAA7134_BOARD_CINERGY600:
+		ir_codes     = cinergy_codes;
+		mask_keycode = 0x00003f;
+		mask_keyup   = 0x040000;
+		break;
+	}
+	if (NULL == ir_codes) {
+		printk("%s: Oops: IR config error [card=%d]\n",
+		       dev->name, dev->board);
+		return -ENODEV;
+	}
+
+	ir = kmalloc(sizeof(*ir),GFP_KERNEL);
+	if (NULL == ir)
+		return -ENOMEM;
+	memset(ir,0,sizeof(*ir));
+
+	/* init hardware-specific stuff */
+	ir->mask_keycode = mask_keycode;
+	ir->mask_keydown = mask_keydown;
+	ir->mask_keyup   = mask_keyup;
+	
+	/* init input device */
+	snprintf(ir->name, sizeof(ir->name), "saa7134 IR (%s)",
+		 saa7134_boards[dev->board].name);
+	snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0",
+		 pci_name(dev->pci));
+
+	ir_input_init(&ir->dev, &ir->ir, ir_type, ir_codes);
+	ir->dev.name = ir->name;
+	ir->dev.phys = ir->phys;
+	ir->dev.id.bustype = BUS_PCI;
+	ir->dev.id.version = 1;
+	if (dev->pci->subsystem_vendor) {
+		ir->dev.id.vendor  = dev->pci->subsystem_vendor;
+		ir->dev.id.product = dev->pci->subsystem_device;
+	} else {
+		ir->dev.id.vendor  = dev->pci->vendor;
+		ir->dev.id.product = dev->pci->device;
+	}
+
+	/* all done */
+	dev->remote = ir;
+	input_register_device(&dev->remote->dev);
+	printk("%s: registered input device for IR\n",dev->name);
+	return 0;
+}
+
+void saa7134_input_fini(struct saa7134_dev *dev)
+{
+	if (NULL == dev->remote)
+		return;
+	
+	input_unregister_device(&dev->remote->dev);
+	kfree(dev->remote);
+	dev->remote = NULL;
+}
+
+/* ----------------------------------------------------------------------
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff -Nru a/drivers/media/video/saa7134/saa7134-oss.c b/drivers/media/video/saa7134/saa7134-oss.c
--- a/drivers/media/video/saa7134/saa7134-oss.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/media/video/saa7134/saa7134-oss.c	Tue Feb  3 19:45:18 2004
@@ -40,7 +40,7 @@
 MODULE_PARM_DESC(oss_rate,"sample rate (valid are: 32000,48000)");
 
 #define dprintk(fmt, arg...)	if (oss_debug) \
-	printk(KERN_DEBUG "%s/oss: " fmt, dev->name, ## arg)
+	printk(KERN_DEBUG "%s/oss: " fmt, dev->name , ## arg)
 
 /* ------------------------------------------------------------------ */
 
@@ -295,8 +295,10 @@
 				break;
 			}
 			up(&dev->oss.lock);
-			current->state = TASK_INTERRUPTIBLE;
-			schedule();
+			set_current_state(TASK_INTERRUPTIBLE);
+			if (0 == dev->oss.read_count)
+				schedule();
+			set_current_state(TASK_RUNNING);
 			down(&dev->oss.lock);
 			if (signal_pending(current)) {
 				if (0 == ret)
@@ -328,7 +330,6 @@
 	}
 	up(&dev->oss.lock);
 	remove_wait_queue(&dev->oss.wq, &wait);
-	current->state = TASK_RUNNING;
 	return ret;
 }
 
@@ -777,7 +778,7 @@
 
 	spin_lock(&dev->slock);
 	if (UNSET == dev->oss.dma_blk) {
-		dprintk("irq: recording stopped%s\n","");
+		dprintk("irq: recording stopped\n");
 		goto done;
 	}
 	if (0 != (status & 0x0f000000))
diff -Nru a/drivers/media/video/saa7134/saa7134-ts.c b/drivers/media/video/saa7134/saa7134-ts.c
--- a/drivers/media/video/saa7134/saa7134-ts.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/media/video/saa7134/saa7134-ts.c	Tue Feb  3 19:45:16 2004
@@ -45,7 +45,7 @@
 #define TS_NR_PACKETS 312
 
 #define dprintk(fmt, arg...)	if (ts_debug) \
-	printk(KERN_DEBUG "%s/ts: " fmt, dev->name, ## arg)
+	printk(KERN_DEBUG "%s/ts: " fmt, dev->name , ## arg)
 
 /* ------------------------------------------------------------------ */
 
@@ -173,7 +173,7 @@
 	saa_writeb(SAA7134_SPECIAL_MODE, 0x00);
 	mdelay(10);
    	saa_writeb(SAA7134_SPECIAL_MODE, 0x01);
-   	current->state = TASK_INTERRUPTIBLE;
+   	set_current_state(TASK_INTERRUPTIBLE);
 	schedule_timeout(HZ/10);
 }
 
@@ -196,7 +196,7 @@
 	
 	list_for_each(list,&saa7134_devlist) {
 		h = list_entry(list, struct saa7134_dev, devlist);
-		if (h->ts_dev->minor == minor)
+		if (h->ts_dev && h->ts_dev->minor == minor)
 			dev = h;
 	}
 	if (NULL == dev)
diff -Nru a/drivers/media/video/saa7134/saa7134-tvaudio.c b/drivers/media/video/saa7134/saa7134-tvaudio.c
--- a/drivers/media/video/saa7134/saa7134-tvaudio.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/media/video/saa7134/saa7134-tvaudio.c	Tue Feb  3 19:45:16 2004
@@ -41,8 +41,16 @@
 MODULE_PARM(audio_carrier,"i");
 MODULE_PARM_DESC(audio_carrier,"audio carrier location");
 
+static unsigned int audio_ddep = 0;
+MODULE_PARM(audio_ddep,"i");
+MODULE_PARM_DESC(audio_ddep,"audio ddep overwrite");
+
+static int audio_clock_tweak = 0;
+MODULE_PARM(audio_clock_tweak, "i");
+MODULE_PARM_DESC(audio_clock_tweak, "Audio clock tick fine tuning for cards with audio crystal that's slightly off (range [-1024 .. 1024])");
+
 #define dprintk(fmt, arg...)	if (audio_debug) \
-	printk(KERN_DEBUG "%s/audio: " fmt, dev->name, ## arg)
+	printk(KERN_DEBUG "%s/audio: " fmt, dev->name , ## arg)
 #define d2printk(fmt, arg...)	if (audio_debug > 1) \
 	printk(KERN_DEBUG "%s/audio: " fmt, dev->name, ## arg)
 
@@ -50,7 +58,7 @@
 		dev->name,(SAA7134_##reg),(#reg),saa_readb((SAA7134_##reg)))
 
 #define SCAN_INITIAL_DELAY  (HZ)
-#define SCAN_SAMPLE_DELAY   (HZ/10)
+#define SCAN_SAMPLE_DELAY   (HZ/5)
 
 /* ------------------------------------------------------------------ */
 /* saa7134 code                                                       */
@@ -186,8 +194,11 @@
 			in = &card(dev).mute;
 	}
 	if (dev->hw_mute  == mute &&
-	    dev->hw_input == in)
+	    dev->hw_input == in) {
+		dprintk("mute/input: nothing to do [mute=%d,input=%s]\n",
+			mute,in->name);
 		return;
+	}
 
 	dprintk("ctl_mute=%d automute=%d input=%s  =>  mute=%d input=%s\n",
 		dev->ctl_mute,dev->automute,dev->input->name,mute,in->name);
@@ -221,21 +232,27 @@
 			    struct saa7134_tvaudio *audio,
 			    char *note)
 {
-	if (note)
-		dprintk("tvaudio_setmode: %s %s [%d.%03d/%d.%03d MHz]\n",
-			note,audio->name,
-			audio->carr1 / 1000, audio->carr1 % 1000,
-			audio->carr2 / 1000, audio->carr2 % 1000);
+	int acpf, tweak = 0;
 
 	if (dev->tvnorm->id == V4L2_STD_NTSC) {
-		saa_writeb(SAA7134_AUDIO_CLOCKS_PER_FIELD0, 0xde);
-		saa_writeb(SAA7134_AUDIO_CLOCKS_PER_FIELD1, 0x15);
-		saa_writeb(SAA7134_AUDIO_CLOCKS_PER_FIELD2, 0x02);
+		acpf = 0x19066;
 	} else {
-		saa_writeb(SAA7134_AUDIO_CLOCKS_PER_FIELD0, 0x00);
-		saa_writeb(SAA7134_AUDIO_CLOCKS_PER_FIELD1, 0x80);
-		saa_writeb(SAA7134_AUDIO_CLOCKS_PER_FIELD2, 0x02);
+		acpf = 0x1e000;
 	}
+	if (audio_clock_tweak > -1024 && audio_clock_tweak < 1024)
+		tweak = audio_clock_tweak;
+
+	if (note)
+		dprintk("tvaudio_setmode: %s %s [%d.%03d/%d.%03d MHz] acpf=%d%+d\n",
+			note,audio->name,
+			audio->carr1 / 1000, audio->carr1 % 1000,
+			audio->carr2 / 1000, audio->carr2 % 1000,
+			acpf, tweak);
+
+	acpf += tweak;
+	saa_writeb(SAA7134_AUDIO_CLOCKS_PER_FIELD0, (acpf & 0x0000ff) >> 0);
+	saa_writeb(SAA7134_AUDIO_CLOCKS_PER_FIELD1, (acpf & 0x00ff00) >> 8);
+	saa_writeb(SAA7134_AUDIO_CLOCKS_PER_FIELD2, (acpf & 0x030000) >> 16);
 	tvaudio_setcarrier(dev,audio->carr1,audio->carr2);
 	
 	switch (audio->mode) {
@@ -259,18 +276,19 @@
 		saa_writeb(SAA7134_DCXO_IDENT_CTRL,           0x00);
 		saa_writeb(SAA7134_FM_DEEMPHASIS,             0x44);
 		saa_writeb(SAA7134_STEREO_DAC_OUTPUT_SELECT,  0xa1);
+		saa_writeb(SAA7134_NICAM_CONFIG,              0x00);
 		break;
 	case TVAUDIO_NICAM_AM:
 		saa_writeb(SAA7134_DEMODULATOR,               0x12);
 		saa_writeb(SAA7134_DCXO_IDENT_CTRL,           0x00);
 		saa_writeb(SAA7134_FM_DEEMPHASIS,             0x44);
 		saa_writeb(SAA7134_STEREO_DAC_OUTPUT_SELECT,  0xa1);
+		saa_writeb(SAA7134_NICAM_CONFIG,              0x00);
 		break;
 	case TVAUDIO_FM_SAT_STEREO:
 		/* not implemented (yet) */
 		break;
 	}
-	saa_writel(0x174 >> 2, 0x0001e000); /* FIXME */
 }
 
 static int tvaudio_sleep(struct saa7134_dev *dev, int timeout)
@@ -278,7 +296,7 @@
 	DECLARE_WAITQUEUE(wait, current);
 	
 	add_wait_queue(&dev->thread.wq, &wait);
-	current->state = TASK_INTERRUPTIBLE;
+	set_current_state(TASK_INTERRUPTIBLE);
 	schedule_timeout(timeout);
 	remove_wait_queue(&dev->thread.wq, &wait);
 	return dev->thread.scan1 != dev->thread.scan2;
@@ -437,7 +455,7 @@
 	const int *carr_scan;
 	int carr_vals[4];
 	unsigned int i, audio;
-	int max1,max2,carrier,rx,mode;
+	int max1,max2,carrier,rx,mode,lastmode;
 
 	lock_kernel();
 	daemonize("%s", dev->name);
@@ -535,7 +553,7 @@
 			if (UNSET == audio)
 				audio = i;
 			tvaudio_setmode(dev,&tvaudio[i],"trying");
-			if (tvaudio_sleep(dev,HZ))
+			if (tvaudio_sleep(dev,HZ*2))
 				goto restart;
 			if (-1 != tvaudio_getstereo(dev,&tvaudio[i])) {
 				audio = i;
@@ -549,8 +567,9 @@
 		tvaudio_setstereo(dev,&tvaudio[audio],V4L2_TUNER_MODE_MONO);
 		dev->tvaudio = &tvaudio[audio];
 
+		lastmode = 42;
 		for (;;) {
-			if (tvaudio_sleep(dev,3*HZ))
+			if (tvaudio_sleep(dev,5*HZ))
 				goto restart;
 			if (dev->thread.exit || signal_pending(current))
 				break;
@@ -560,7 +579,10 @@
 			} else {
 				mode = dev->thread.mode;
 			}
-			tvaudio_setstereo(dev,&tvaudio[audio],mode);
+			if (lastmode != mode) {
+				tvaudio_setstereo(dev,&tvaudio[audio],mode);
+				lastmode = mode;
+			}
 		}
 	}
 
@@ -602,8 +624,8 @@
 	[0x1f] = "??? [in progress]",
 };
 
-#define DSP_RETRY 30
-#define DSP_DELAY 10
+#define DSP_RETRY 32
+#define DSP_DELAY 16
 
 static inline int saa_dsp_wait_bit(struct saa7134_dev *dev, int bit)
 {
@@ -721,15 +743,34 @@
 		dev->thread.scan1 = dev->thread.scan2;
 		dprintk("tvaudio thread scan start [%d]\n",dev->thread.scan1);
 
-		norms = 0;
-		if (dev->tvnorm->id & V4L2_STD_PAL)
-			norms |= 0x2c; /* B/G + D/K + I */
-		if (dev->tvnorm->id & V4L2_STD_NTSC)
-			norms |= 0x40; /* M */
-		if (dev->tvnorm->id & V4L2_STD_SECAM)
-			norms |= 0x18; /* L + D/K */
-		if (0 == norms)
-			norms = 0x0000007c;
+		if (audio_ddep >= 0x04 && audio_ddep <= 0x0e) {
+			/* insmod option override */
+			norms = (audio_ddep << 2) | 0x01;
+			dprintk("ddep override: %s\n",stdres[audio_ddep]);
+		} else{
+			/* (let chip) scan for sound carrier */
+			norms = 0;
+			if (dev->tvnorm->id & V4L2_STD_PAL) {
+				dprintk("PAL scan\n");
+				norms |= 0x2c; /* B/G + D/K + I */
+			}
+			if (dev->tvnorm->id & V4L2_STD_NTSC) {
+				dprintk("NTSC scan\n");
+				norms |= 0x40; /* M */
+			}
+			if (dev->tvnorm->id & V4L2_STD_SECAM) {
+				dprintk("SECAM scan\n");
+				norms |= 0x18; /* L + D/K */
+			}
+			if (0 == norms)
+				norms = 0x7c; /* all */
+			dprintk("scanning:%s%s%s%s%s\n",
+				(norms & 0x04) ? " B/G"  : "",
+				(norms & 0x08) ? " D/K"  : "",
+				(norms & 0x10) ? " L/L'" : "",
+				(norms & 0x20) ? " I"    : "",
+				(norms & 0x40) ? " M"    : "");
+		}
 
 		/* quick & dirty -- to be fixed up later ... */
 		saa_dsp_writel(dev, 0x454 >> 2, 0);
@@ -856,17 +897,12 @@
 
 	/* enable I2S audio output */
 	if (saa7134_boards[dev->board].i2s_rate) {
-		int rate = (32000 == saa7134_boards[dev->board].i2s_rate)
-			? 0x01 : 0x03;
+		int i2sform = (32000 == saa7134_boards[dev->board].i2s_rate) ? 0x00 : 0x01;
 		
-		/* set rate */ 
-		saa_andorb(SAA7134_SIF_SAMPLE_FREQ, 0x03, rate);
-
 		/* enable I2S output */
-		saa_writeb(SAA7134_DSP_OUTPUT_SELECT,  0x80);
-		saa_writeb(SAA7134_I2S_OUTPUT_SELECT,  0x80);
-		saa_writeb(SAA7134_I2S_OUTPUT_FORMAT,  0x01);
-		saa_writeb(SAA7134_I2S_OUTPUT_LEVEL,   0x00);	
+		saa_writeb(SAA7134_I2S_OUTPUT_SELECT,  0x80); 
+		saa_writeb(SAA7134_I2S_OUTPUT_FORMAT,  i2sform); 
+		saa_writeb(SAA7134_I2S_OUTPUT_LEVEL,   0x0F);	
 		saa_writeb(SAA7134_I2S_AUDIO_OUTPUT,   0x01);
 	}
 
diff -Nru a/drivers/media/video/saa7134/saa7134-vbi.c b/drivers/media/video/saa7134/saa7134-vbi.c
--- a/drivers/media/video/saa7134/saa7134-vbi.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/media/video/saa7134/saa7134-vbi.c	Tue Feb  3 19:45:42 2004
@@ -39,7 +39,7 @@
 MODULE_PARM_DESC(vbibufs,"number of vbi buffers, range 2-32");
 
 #define dprintk(fmt, arg...)	if (vbi_debug) \
-	printk(KERN_DEBUG "%s/vbi: " fmt, dev->name, ## arg)
+	printk(KERN_DEBUG "%s/vbi: " fmt, dev->name , ## arg)
 
 /* ------------------------------------------------------------------ */
 
diff -Nru a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
--- a/drivers/media/video/saa7134/saa7134-video.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/video/saa7134/saa7134-video.c	Tue Feb  3 19:45:17 2004
@@ -40,7 +40,7 @@
 MODULE_PARM_DESC(gbuffers,"number of capture buffers, range 2-32");
 
 #define dprintk(fmt, arg...)	if (video_debug) \
-	printk(KERN_DEBUG "%s/video: " fmt, dev->name, ## arg)
+	printk(KERN_DEBUG "%s/video: " fmt, dev->name , ## arg)
 
 /* ------------------------------------------------------------------ */
 /* data structs for video                                             */
@@ -83,6 +83,12 @@
 		.depth    = 24,
 		.pm       = 0x11,
 	},{
+		.name     = "24 bpp RGB, be",
+		.fourcc   = V4L2_PIX_FMT_RGB24,
+		.depth    = 24,
+		.pm       = 0x11,
+		.bswap    = 1,
+	},{
 		.name     = "32 bpp RGB, le",
 		.fourcc   = V4L2_PIX_FMT_BGR32,
 		.depth    = 32,
@@ -125,6 +131,16 @@
 		.planar   = 1,
 		.hshift   = 1,
 		.vshift   = 1,
+	},{
+		.name     = "4:2:0 planar, Y-Cb-Cr",
+		.fourcc   = V4L2_PIX_FMT_YVU420,
+		.depth    = 12,
+		.pm       = 0x0a,
+		.yuv      = 1,
+		.planar   = 1,
+		.uvswap   = 1,
+		.hshift   = 1,
+		.vshift   = 1,
 	}
 };
 #define FORMATS ARRAY_SIZE(formats)
@@ -788,7 +804,7 @@
 			   struct saa7134_buf *next)
 {
 	unsigned long base,control,bpl;
-	unsigned long bpl_uv,lines_uv,base2,base3; /* planar */
+	unsigned long bpl_uv,lines_uv,base2,base3,tmp; /* planar */
 
 	dprintk("buffer_activate buf=%p\n",buf);
 	buf->vb.state = STATE_ACTIVE;
@@ -834,6 +850,8 @@
 		lines_uv = buf->vb.height >> buf->fmt->vshift;
 		base2    = base + bpl * buf->vb.height;
 		base3    = base2 + bpl_uv * lines_uv;
+		if (buf->fmt->uvswap)
+			tmp = base2, base2 = base3, base3 = tmp;
 		dprintk("uv: bpl=%ld lines=%ld base2/3=%ld/%ld\n",
 			bpl_uv,lines_uv,base2,base3);
 		if (V4L2_FIELD_HAS_BOTH(buf->vb.field)) {
@@ -1160,6 +1178,9 @@
 	fh->fmt      = format_by_fourcc(V4L2_PIX_FMT_BGR24);
 	fh->width    = 768;
 	fh->height   = 576;
+#ifdef VIDIOC_G_PRIORITY
+	v4l2_prio_open(&dev->prio,&fh->prio);
+#endif
 
 	videobuf_queue_init(&fh->cap, &video_qops,
 			    dev->pci, &dev->slock,
@@ -1268,7 +1289,7 @@
 
 	/* stop video capture */
 	if (res_check(fh, RESOURCE_VIDEO)) {
-		videobuf_queue_cancel(file,&fh->cap);
+		videobuf_streamoff(file,&fh->cap);
 		res_free(dev,fh,RESOURCE_VIDEO);
 	}
 	if (fh->cap.read_buf) {
@@ -1287,7 +1308,10 @@
 
 	saa7134_pgtable_free(dev->pci,&fh->pt_cap);
 	saa7134_pgtable_free(dev->pci,&fh->pt_vbi);
-	
+
+#ifdef VIDIOC_G_PRIORITY
+	v4l2_prio_close(&dev->prio,&fh->prio);
+#endif
 	file->private_data = NULL;
 	kfree(fh);
 	return 0;
@@ -1568,6 +1592,20 @@
 
 	if (video_debug > 1)
 		saa7134_print_ioctl(dev->name,cmd);
+
+#ifdef VIDIOC_G_PRIORITY
+	switch (cmd) {
+	case VIDIOC_S_CTRL:
+	case VIDIOC_S_STD:
+	case VIDIOC_S_INPUT:
+	case VIDIOC_S_TUNER:
+	case VIDIOC_S_FREQUENCY:
+		err = v4l2_prio_check(&dev->prio,&fh->prio);
+		if (0 != err)
+			return err;
+	}
+#endif
+
 	switch (cmd) {
 	case VIDIOC_QUERYCAP:
 	{
@@ -1697,6 +1735,7 @@
 		down(&dev->lock);
 		dev->ctl_freq = f->frequency;
 		saa7134_i2c_call_clients(dev,VIDIOCSFREQ,&dev->ctl_freq);
+		saa7134_tvaudio_do_scan(dev);
 		up(&dev->lock);
 		return 0;
 	}
@@ -1727,6 +1766,22 @@
                 return 0;
         }
 
+#ifdef VIDIOC_G_PRIORITY
+        case VIDIOC_G_PRIORITY:
+        {
+                enum v4l2_priority *p = arg;
+
+                *p = v4l2_prio_max(&dev->prio);
+                return 0;
+        }
+        case VIDIOC_S_PRIORITY:
+        {
+                enum v4l2_priority *prio = arg;
+
+                return v4l2_prio_change(&dev->prio, &fh->prio, *prio);
+        }
+#endif
+
 	/* --- preview ioctls ---------------------------------------- */
 	case VIDIOC_ENUM_FMT:
 	{
@@ -2148,8 +2203,8 @@
 	
 	spin_lock(&dev->slock);
 	if (dev->video_q.curr) {
+		dev->video_fieldcount++;
 		field = dev->video_q.curr->vb.field;
-		
 		if (V4L2_FIELD_HAS_BOTH(field)) {
 			/* make sure we have seen both fields */
 			if ((status & 0x10) == 0x00) {
@@ -2165,6 +2220,7 @@
 			if ((status & 0x10) != 0x00)
 				goto done;
 		}
+		dev->video_q.curr->vb.field_count = dev->video_fieldcount;
 		saa7134_buffer_finish(dev,&dev->video_q,STATE_DONE);
 	}
 	saa7134_buffer_next(dev,&dev->video_q);
diff -Nru a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
--- a/drivers/media/video/saa7134/saa7134.h	Tue Feb  3 19:45:34 2004
+++ b/drivers/media/video/saa7134/saa7134.h	Tue Feb  3 19:45:34 2004
@@ -29,14 +29,11 @@
 
 #include <asm/io.h>
 
-#ifdef CONFIG_VIDEO_IR
-#include "ir-common.h"
-#endif
-
 #include <media/video-buf.h>
 #include <media/tuner.h>
 #include <media/audiochip.h>
 #include <media/id.h>
+#include <media/ir-common.h>
 
 #ifndef TRUE
 # define TRUE (1==1)
@@ -116,6 +113,7 @@
 	unsigned int   wswap:1;
 	unsigned int   yuv:1;
 	unsigned int   planar:1;
+	unsigned int   uvswap:1;
 };
 
 /* ----------------------------------------------------------- */
@@ -143,6 +141,16 @@
 #define SAA7134_BOARD_BMK_MPEX_NOTUNER 18
 #define SAA7134_BOARD_VIDEOMATE_TV     19
 #define SAA7134_BOARD_CRONOS_PLUS      20
+#define SAA7134_BOARD_10MOONSTVMASTER  21
+#define SAA7134_BOARD_MD2819           22
+#define SAA7134_BOARD_BMK_MPEX_TUNER   23
+#define SAA7134_BOARD_TVSTATION_DVR    24
+#define SAA7134_BOARD_ASUSTEK_TVFM7133	25
+#define SAA7134_BOARD_PINNACLE_PCTV_STEREO 26
+#define SAA7134_BOARD_MANLI_MTV002     27
+#define SAA7134_BOARD_MANLI_MTV001     28
+#define SAA7134_BOARD_TG3000TV         29
+#define SAA7134_BOARD_ECS_TVP3XP       30
 
 #define SAA7134_INPUT_MAX 8
 
@@ -242,11 +250,15 @@
 	struct saa7134_dev         *dev;
 	unsigned int               radio;
 	enum v4l2_buf_type         type;
+	unsigned int               resources;
+#ifdef VIDIOC_G_PRIORITY 
+	enum v4l2_priority	   prio;
+#endif
 
+	/* video overlay */
 	struct v4l2_window         win;
 	struct v4l2_clip           clips[8];
 	unsigned int               nclips;
-	unsigned int               resources;
 
 	/* video capture */
 	struct saa7134_format      *fmt;
@@ -298,7 +310,6 @@
 	unsigned int               read_count;
 };
 
-#ifdef CONFIG_VIDEO_IR
 /* IR input */
 struct saa7134_ir {
 	struct input_dev           dev;
@@ -307,14 +318,17 @@
 	char                       phys[32];
 	u32                        mask_keycode;
 	u32                        mask_keydown;
+	u32                        mask_keyup;
 };
-#endif
 
 /* global device status */
 struct saa7134_dev {
 	struct list_head           devlist;
         struct semaphore           lock;
        	spinlock_t                 slock;
+#ifdef VIDIOC_G_PRIORITY 
+	struct v4l2_prio_state     prio;
+#endif
 
 	/* various device info */
 	unsigned int               resources;
@@ -327,9 +341,7 @@
 
 	/* infrared remote */
 	int                        has_remote;
-#ifdef CONFIG_VIDEO_IR
 	struct saa7134_ir          *remote;
-#endif
 
 	/* pci i/o */
 	char                       name[32];
@@ -358,6 +370,7 @@
 	struct saa7134_dmaqueue    video_q;
 	struct saa7134_dmaqueue    ts_q;
 	struct saa7134_dmaqueue    vbi_q;
+	unsigned int               video_fieldcount;
 	unsigned int               vbi_fieldcount;
 
 	/* various v4l controls */
@@ -403,9 +416,7 @@
 #define saa_setb(reg,bit)          saa_andorb((reg),(bit),(bit))
 #define saa_clearb(reg,bit)        saa_andorb((reg),(bit),0)
 
-//#define saa_wait(d) { if (need_resched()) schedule(); else udelay(d);}
 #define saa_wait(d) { udelay(d); }
-//#define saa_wait(d) { schedule_timeout(HZ*d/1000 ?:1); }
 
 /* ----------------------------------------------------------- */
 /* saa7134-core.c                                              */
diff -Nru a/drivers/media/video/saa7146.h b/drivers/media/video/saa7146.h
--- a/drivers/media/video/saa7146.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/video/saa7146.h	Tue Feb  3 19:45:17 2004
@@ -25,7 +25,6 @@
 #include <linux/types.h>
 #include <linux/wait.h>
 
-#include <linux/i2c.h>
 #include <linux/videodev.h>
 
 #ifndef O_NONCAP  
diff -Nru a/drivers/media/video/tda7432.c b/drivers/media/video/tda7432.c
--- a/drivers/media/video/tda7432.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/media/video/tda7432.c	Tue Feb  3 19:45:34 2004
@@ -338,8 +338,13 @@
 
 static int tda7432_probe(struct i2c_adapter *adap)
 {
+#ifdef I2C_ADAP_CLASS_TV_ANALOG
 	if (adap->class & I2C_ADAP_CLASS_TV_ANALOG)
 		return i2c_probe(adap, &addr_data, tda7432_attach);
+#else
+	if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_BT848))
+		return i2c_probe(adap, &addr_data, tda7432_attach);
+#endif
 	return 0;
 }
 
diff -Nru a/drivers/media/video/tda9875.c b/drivers/media/video/tda9875.c
--- a/drivers/media/video/tda9875.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/video/tda9875.c	Tue Feb  3 19:45:17 2004
@@ -272,8 +272,13 @@
 
 static int tda9875_probe(struct i2c_adapter *adap)
 {
+#ifdef I2C_ADAP_CLASS_TV_ANALOG
 	if (adap->class & I2C_ADAP_CLASS_TV_ANALOG)
 		return i2c_probe(adap, &addr_data, tda9875_attach);
+#else
+	if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_BT848))
+		return i2c_probe(adap, &addr_data, tda9875_attach);
+#endif
 	return 0;
 }
 
diff -Nru a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c
--- a/drivers/media/video/tda9887.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/media/video/tda9887.c	Tue Feb  3 19:45:16 2004
@@ -169,7 +169,7 @@
 		bDeEmphVal   = cDeemphasis50;
 		bModulation  = cNegativeFmTV;
 		bOutPort1    = cOutputPort1Inactive;
-		if (1 == t->pinnacle_id) {
+		if ((1 == t->pinnacle_id) || (7 == t->pinnacle_id)) {
 			bCarrierMode = cIntercarrier;
 		} else {
 			// stereo boards
@@ -366,8 +366,18 @@
 
 static int tda9887_probe(struct i2c_adapter *adap)
 {
+#ifdef I2C_ADAP_CLASS_TV_ANALOG
 	if (adap->class & I2C_ADAP_CLASS_TV_ANALOG)
 		return i2c_probe(adap, &addr_data, tda9887_attach);
+#else
+	switch (adap->id) {
+	case I2C_ALGO_BIT | I2C_HW_B_BT848:
+	case I2C_ALGO_BIT | I2C_HW_B_RIVA:
+	case I2C_ALGO_SAA7134:
+		return i2c_probe(adap, &addr_data, tda9887_attach);
+		break;
+	}
+#endif
 	return 0;
 }
 
@@ -439,9 +449,9 @@
 };
 static struct i2c_client client_template =
 {
-	.flags  = I2C_CLIENT_ALLOW_USE,
-        .driver = &driver,
-	.name	= "tda9887",
+	I2C_DEVNAME("tda9887"),
+	.flags     = I2C_CLIENT_ALLOW_USE,
+        .driver    = &driver,
 };
 
 static int tda9887_init_module(void)
diff -Nru a/drivers/media/video/tuner.c b/drivers/media/video/tuner.c
--- a/drivers/media/video/tuner.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/media/video/tuner.c	Tue Feb  3 19:45:41 2004
@@ -45,18 +45,21 @@
 static int this_adap;
 #define dprintk     if (debug) printk
 
-struct tuner
-{
+struct tuner {
 	unsigned int type;            /* chip type */
 	unsigned int freq;            /* keep track of the current settings */
 	unsigned int std;
 	
 	unsigned int radio;
 	unsigned int mode;            /* current norm for multi-norm tuners */
+	unsigned int input;
 	
 	// only for MT2032
 	unsigned int xogc;
 	unsigned int radio_if2;
+
+	void (*tv_freq)(struct i2c_client *c, unsigned int freq);
+	void (*radio_freq)(struct i2c_client *c, unsigned int freq);
 };
 
 static struct i2c_driver driver;
@@ -207,7 +210,7 @@
 
 	{ "Samsung PAL TCPM9091PD27", Samsung, PAL,  /* from sourceforge v3tv */
           16*169,16*464,0xA0,0x90,0x30,0x8e,623},
-	{ "MT2032 universal", Microtune,PAL|NTSC,
+	{ "MT20xx universal", Microtune,PAL|NTSC,
                0,0,0,0,0,0,0},
 	{ "Temic PAL_BG (4106 FH5)", TEMIC, PAL,
           16*141.00, 16*464.00, 0xa0,0x90,0x30,0x8e,623},
@@ -225,6 +228,12 @@
 
 	{ "HITACHI V7-J180AT", HITACHI, NTSC,
 	  16*170.00, 16*450.00, 0x01,0x02,0x00,0x8e,940 },
+	{ "Philips PAL_MK (FI1216 MK)", Philips, PAL,
+	  16*140.25,16*463.25,0x01,0xc2,0xcf,0x8e,623},
+	{ "Philips 1236D ATSC/NTSC daul in",Philips,ATSC,
+	  16*157.25,16*454.00,0xa0,0x90,0x30,0x8e,732},
+        { "Philips NTSC MK3 (FM1236MK3 or FM1236/F)", Philips, NTSC,
+          16*160.00,16*442.00,0x01,0x02,0x04,0x8,732},
 };
 #define TUNERS ARRAY_SIZE(tuners)
 
@@ -279,86 +288,19 @@
 }
 #endif
 
-// Initalization as described in "MT203x Programming Procedures", Rev 1.2, Feb.2001
-static int mt2032_init(struct i2c_client *c)
-{
-        unsigned char buf[21];
-        int ret,xogc,xok=0;
-	struct tuner *t = i2c_get_clientdata(c);
-
-        buf[0]=0;
-        ret=i2c_master_send(c,buf,1);
-        i2c_master_recv(c,buf,21);
-
-        printk("MT2032: Companycode=%02x%02x Part=%02x Revision=%02x\n",
-                buf[0x11],buf[0x12],buf[0x13],buf[0x14]);
-
-        if(debug) {
-                int i;
-                printk("MT2032 hexdump:\n");
-                for(i=0;i<21;i++) {
-                        printk(" %02x",buf[i]);
-                        if(((i+1)%8)==0) printk(" ");
-                        if(((i+1)%16)==0) printk("\n ");
-                }
-                printk("\n ");
-        }
-	// Look for MT2032 id:
-	// part= 0x04(MT2032), 0x06(MT2030), 0x07(MT2040)
-        if((buf[0x11] != 0x4d) || (buf[0x12] != 0x54) || (buf[0x13] != 0x04)) {
-                printk("not a MT2032.\n");
-                return 0;
-        }
-
-
-        // Initialize Registers per spec.
-        buf[1]=2; // Index to register 2
-        buf[2]=0xff;
-        buf[3]=0x0f;
-        buf[4]=0x1f;
-        ret=i2c_master_send(c,buf+1,4);
-
-        buf[5]=6; // Index register 6
-        buf[6]=0xe4;
-        buf[7]=0x8f;
-        buf[8]=0xc3;
-        buf[9]=0x4e;
-        buf[10]=0xec;
-        ret=i2c_master_send(c,buf+5,6);
-
-        buf[12]=13;  // Index register 13
-        buf[13]=0x32;
-        ret=i2c_master_send(c,buf+12,2);
-
-        // Adjust XOGC (register 7), wait for XOK
-        xogc=7;
-        do {
-		dprintk("mt2032: xogc = 0x%02x\n",xogc&0x07);
-                mdelay(10);
-                buf[0]=0x0e;
-                i2c_master_send(c,buf,1);
-                i2c_master_recv(c,buf,1);
-                xok=buf[0]&0x01;
-                dprintk("mt2032: xok = 0x%02x\n",xok);
-                if (xok == 1) break;
-
-                xogc--;
-                dprintk("mt2032: xogc = 0x%02x\n",xogc&0x07);
-                if (xogc == 3) {
-                        xogc=4; // min. 4 per spec
-                        break;
-                }
-                buf[0]=0x07;
-                buf[1]=0x88 + xogc;
-                ret=i2c_master_send(c,buf,2);
-                if (ret!=2)
-                        printk("mt2032_init failed with %d\n",ret);
-        } while (xok != 1 );
-	t->xogc=xogc;
-
-        return(1);
-}
+/* ---------------------------------------------------------------------- */
 
+#define MT2032 0x04
+#define MT2030 0x06
+#define MT2040 0x07
+#define MT2050 0x42
+
+static char *microtune_part[] = {
+	[ MT2030 ] = "MT2030",
+	[ MT2032 ] = "MT2032",
+	[ MT2040 ] = "MT2040",
+	[ MT2050 ] = "MT2050",
+};
 
 // IsSpurInBand()?
 static int mt2032_spurcheck(int f1, int f2, int spectrum_from,int spectrum_to)
@@ -583,13 +525,13 @@
 }
 
 
-static void mt2032_set_tv_freq(struct i2c_client *c,
-			       unsigned int freq, unsigned int norm)
+static void mt2032_set_tv_freq(struct i2c_client *c, unsigned int freq)
 {
+	struct tuner *t = i2c_get_clientdata(c);
 	int if2,from,to;
 
 	// signal bandwidth and picture carrier
-	if (norm==VIDEO_MODE_NTSC) {
+	if (t->mode == VIDEO_MODE_NTSC) {
 		from=40750*1000;
 		to=46750*1000;
 		if2=45750*1000; 
@@ -604,36 +546,248 @@
 			   1090*1000*1000, if2, from, to);
 }
 
+static void mt2032_set_radio_freq(struct i2c_client *c, unsigned int freq)
+{
+	struct tuner *t = i2c_get_clientdata(c);
+	int if2 = t->radio_if2;
 
-// Set tuner frequency,  freq in Units of 62.5kHz = 1/16MHz
-static void set_tv_freq(struct i2c_client *c, unsigned int freq)
+	// per Manual for FM tuning: first if center freq. 1085 MHz
+        mt2032_set_if_freq(c, freq*62500 /* freq*1000*1000/16 */,
+			   1085*1000*1000,if2,if2,if2);
+}
+
+// Initalization as described in "MT203x Programming Procedures", Rev 1.2, Feb.2001
+static int mt2032_init(struct i2c_client *c)
 {
-	u8 config;
-	u16 div;
-	struct tunertype *tun;
 	struct tuner *t = i2c_get_clientdata(c);
-        unsigned char buffer[4];
-	int rc;
+        unsigned char buf[21];
+        int ret,xogc,xok=0;
 
-	if (t->type == UNSET) {
-		printk("tuner: tuner type not set\n");
-		return;
-	}
-	if (t->type == TUNER_MT2032) {
-		mt2032_set_tv_freq(c,freq,t->mode);
-		return;
+	// Initialize Registers per spec.
+        buf[1]=2; // Index to register 2
+        buf[2]=0xff;
+        buf[3]=0x0f;
+        buf[4]=0x1f;
+        ret=i2c_master_send(c,buf+1,4);
+
+        buf[5]=6; // Index register 6
+        buf[6]=0xe4;
+        buf[7]=0x8f;
+        buf[8]=0xc3;
+        buf[9]=0x4e;
+        buf[10]=0xec;
+        ret=i2c_master_send(c,buf+5,6);
+
+        buf[12]=13;  // Index register 13
+        buf[13]=0x32;
+        ret=i2c_master_send(c,buf+12,2);
+
+        // Adjust XOGC (register 7), wait for XOK
+        xogc=7;
+        do {
+		dprintk("mt2032: xogc = 0x%02x\n",xogc&0x07);
+                mdelay(10);
+                buf[0]=0x0e;
+                i2c_master_send(c,buf,1);
+                i2c_master_recv(c,buf,1);
+                xok=buf[0]&0x01;
+                dprintk("mt2032: xok = 0x%02x\n",xok);
+                if (xok == 1) break;
+
+                xogc--;
+                dprintk("mt2032: xogc = 0x%02x\n",xogc&0x07);
+                if (xogc == 3) {
+                        xogc=4; // min. 4 per spec
+                        break;
+                }
+                buf[0]=0x07;
+                buf[1]=0x88 + xogc;
+                ret=i2c_master_send(c,buf,2);
+                if (ret!=2)
+                        printk("mt2032_init failed with %d\n",ret);
+        } while (xok != 1 );
+	t->xogc=xogc;
+
+	t->tv_freq    = mt2032_set_tv_freq;
+	t->radio_freq = mt2032_set_radio_freq;
+        return(1);
+}
+
+static void mt2050_set_if_freq(struct i2c_client *c,unsigned int freq, unsigned int if2)
+{
+	unsigned int if1=1218*1000*1000;
+	unsigned int f_lo1,f_lo2,lo1,lo2,f_lo1_modulo,f_lo2_modulo,num1,num2,div1a,div1b,div2a,div2b;
+	int ret;
+	unsigned char buf[6];
+	
+	dprintk("mt2050_set_if_freq freq=%d\n",freq);
+	
+	f_lo1=freq+if1;
+	f_lo1=(f_lo1/1000000)*1000000;
+	
+	f_lo2=f_lo1-freq-if2;
+	f_lo2=(f_lo2/50000)*50000;
+	
+	lo1=f_lo1/4000000;
+	lo2=f_lo2/4000000;
+	
+	f_lo1_modulo= f_lo1-(lo1*4000000);
+	f_lo2_modulo= f_lo2-(lo2*4000000);
+	
+	num1=4*f_lo1_modulo/4000000;
+	num2=4096*(f_lo2_modulo/1000)/4000;
+	
+	// todo spurchecks
+	
+	div1a=(lo1/12)-1;
+	div1b=lo1-(div1a+1)*12;
+	
+	div2a=(lo2/8)-1;
+	div2b=lo2-(div2a+1)*8;
+	
+	dprintk("lo1 lo2 = %d %d\n", lo1, lo2);
+        dprintk("num1 num2 div1a div1b div2a div2b= %x %x %x %x %x %x\n",num1,num2,div1a,div1b,div2a,div2b);
+	
+	
+	buf[0]=1;
+	buf[1]= 4*div1b + num1;
+	if(freq<275*1000*1000) buf[1] = buf[1]|0x80;
+	
+	buf[2]=div1a;
+	buf[3]=32*div2b + num2/256;
+	buf[4]=num2-(num2/256)*256;
+	buf[5]=div2a;
+	if(num2!=0) buf[5]=buf[5]|0x40;
+	
+	if(debug) {
+		int i;
+		printk("bufs is: ");
+		for(i=0;i<6;i++)
+			printk("%x ",buf[i]);
+		printk("\n");
 	}
+	
+	ret=i2c_master_send(c,buf,6);
+        if (ret!=6)
+                printk("mt2050_set_if_freq failed with %d\n",ret);
+}
 
-	if (freq < tv_range[0]*16 || freq > tv_range[1]*16) {
-		/* FIXME: better do that chip-specific, but
-		   right now we don't have that in the config
-		   struct and this way is still better than no
-		   check at all */
-		printk("tuner: TV freq (%d.%02d) out of range (%d-%d)\n",
-		       freq/16,freq%16*100/16,tv_range[0],tv_range[1]);
-		return;
+static void mt2050_set_tv_freq(struct i2c_client *c, unsigned int freq)
+{
+	struct tuner *t = i2c_get_clientdata(c);
+	unsigned int if2;
+	
+	if (t->mode == VIDEO_MODE_NTSC) {
+                if2=45750*1000;
+        } else {
+                // Pal
+                if2=38900*1000;
+        }
+	mt2050_set_if_freq(c,freq*62500,if2);
+}
+
+static void mt2050_set_radio_freq(struct i2c_client *c, unsigned int freq)
+{
+	struct tuner *t = i2c_get_clientdata(c);
+	int if2 = t->radio_if2;
+	
+	mt2050_set_if_freq(c, freq*62500, if2);
+}
+
+static int mt2050_init(struct i2c_client *c)
+{
+	struct tuner *t = i2c_get_clientdata(c);
+	unsigned char buf[2];
+	int ret;
+	
+	buf[0]=6;
+	buf[1]=0x10;
+	ret=i2c_master_send(c,buf,2); //  power
+	
+	buf[0]=0x0f;
+	buf[1]=0x0f;
+	ret=i2c_master_send(c,buf,2); // m1lo
+	
+	buf[0]=0x0d;
+	ret=i2c_master_send(c,buf,1);
+	i2c_master_recv(c,buf,1);
+	
+	dprintk("mt2050: sro is %x\n",buf[0]);
+	t->tv_freq    = mt2050_set_tv_freq;
+	t->radio_freq = mt2050_set_radio_freq;
+	return 0;
+}
+
+static int microtune_init(struct i2c_client *c)
+{
+	struct tuner *t = i2c_get_clientdata(c);
+	char *name;
+        unsigned char buf[21];
+	int company_code;
+	
+        buf[0] = 0;
+	t->tv_freq = NULL;
+	t->radio_freq = NULL;
+	name = "unknown";
+
+        i2c_master_send(c,buf,1);
+        i2c_master_recv(c,buf,21);
+        if(debug) {
+                int i;
+                printk(KERN_DEBUG "tuner: MT2032 hexdump:\n");
+                for(i=0;i<21;i++) {
+                        printk(" %02x",buf[i]);
+                        if(((i+1)%8)==0) printk(" ");
+                        if(((i+1)%16)==0) printk("\n ");
+                }
+                printk("\n ");
+        }
+	company_code = buf[0x11] << 8 | buf[0x12];
+        printk("tuner: microtune: companycode=%04x part=%02x rev=%02x\n",
+	       company_code,buf[0x13],buf[0x14]);
+	switch (company_code) {
+	case 0x3cbf:
+	case 0x3dbf:
+	case 0x4d54:
+	case 0x8e81:
+	case 0x8e91:
+		/* ok (?) */
+		break;
+	default:
+		printk("tuner: microtune: unknown companycode\n");
+		return 0;
 	}
 
+	if (buf[0x13] < ARRAY_SIZE(microtune_part) &&
+	    NULL != microtune_part[buf[0x13]])
+		name = microtune_part[buf[0x13]];
+	switch (buf[0x13]) {
+	case MT2032:
+		mt2032_init(c);
+		break;
+	case MT2050:
+		mt2050_init(c);
+		break;
+	default:
+		printk("tuner: microtune %s found, not (yet?) supported, sorry :-/\n",
+		       name);
+                return 0;
+        }
+	printk("tuner: microtune %s found, OK\n",name);
+	return 0;
+}
+
+/* ---------------------------------------------------------------------- */
+
+static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
+{
+	struct tuner *t = i2c_get_clientdata(c);
+	u8 config;
+	u16 div;
+	struct tunertype *tun;
+        unsigned char buffer[4];
+	int rc;
+
 	tun=&tuners[t->type];
 	if (freq < tun->thresh1) 
 		config = tun->VHF_L;
@@ -700,6 +854,20 @@
 			break;
 		}
 		break;
+
+	case TUNER_PHILIPS_ATSC:
+		/* 0x00 -> ATSC antenna input 1 */
+		/* 0x01 -> ATSC antenna input 2 */
+		/* 0x02 -> NTSC antenna input 1 */
+		/* 0x03 -> NTSC antenna input 2 */
+		
+		config &= ~0x03;
+#ifdef VIDEO_MODE_ATSC
+		if (VIDEO_MODE_ATSC != t->mode)
+			config |= 2;
+#endif
+		/* FIXME: input */
+		break;
 	}
 
 	
@@ -737,17 +905,7 @@
 
 }
 
-static void mt2032_set_radio_freq(struct i2c_client *c, unsigned int freq)
-{
-	struct tuner *t = i2c_get_clientdata(c);
-	int if2 = t->radio_if2;
-
-	// per Manual for FM tuning: first if center freq. 1085 MHz
-        mt2032_set_if_freq(c, freq*62500 /* freq*1000*1000/16 */,
-			   1085*1000*1000,if2,if2,if2);
-}
-
-static void set_radio_freq(struct i2c_client *c, unsigned int freq)
+static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
 {
 	struct tunertype *tun;
 	struct tuner *t = i2c_get_clientdata(c);
@@ -755,22 +913,6 @@
 	unsigned div;
 	int rc;
 
-	if (freq < radio_range[0]*16 || freq > radio_range[1]*16) {
-		printk("tuner: radio freq (%d.%02d) out of range (%d-%d)\n",
-		       freq/16,freq%16*100/16,
-		       radio_range[0],radio_range[1]);
-		return;
-	}
-	if (t->type == UNSET) {
-		printk("tuner: tuner type not set\n");
-		return;
-	}
-
-        if (t->type == TUNER_MT2032) {
-                mt2032_set_radio_freq(c,freq);
-		return;
-	}
-
 	tun=&tuners[t->type];
 	div = freq + (int)(16*10.7);
         buffer[0] = (div>>8) & 0x7f;
@@ -778,6 +920,7 @@
 	buffer[2] = tun->config;
 	switch (t->type) {
 	case TUNER_PHILIPS_FM1216ME_MK3:
+	case TUNER_PHILIPS_FM1236_MK3:
 		buffer[3] = 0x19;
 		break;
 	default:
@@ -794,6 +937,80 @@
 
 /* ---------------------------------------------------------------------- */
 
+// Set tuner frequency,  freq in Units of 62.5kHz = 1/16MHz
+static void set_tv_freq(struct i2c_client *c, unsigned int freq)
+{
+	struct tuner *t = i2c_get_clientdata(c);
+
+	if (t->type == UNSET) {
+		printk("tuner: tuner type not set\n");
+		return;
+	}
+	if (NULL == t->tv_freq) {
+		printk("tuner: Huh? tv_set is NULL?\n");
+		return;
+	}
+	if (freq < tv_range[0]*16 || freq > tv_range[1]*16) {
+		/* FIXME: better do that chip-specific, but
+		   right now we don't have that in the config
+		   struct and this way is still better than no
+		   check at all */
+		printk("tuner: TV freq (%d.%02d) out of range (%d-%d)\n",
+		       freq/16,freq%16*100/16,tv_range[0],tv_range[1]);
+		return;
+	}
+	t->tv_freq(c,freq);
+}
+
+static void set_radio_freq(struct i2c_client *c, unsigned int freq)
+{
+	struct tuner *t = i2c_get_clientdata(c);
+
+	if (t->type == UNSET) {
+		printk("tuner: tuner type not set\n");
+		return;
+	}
+	if (NULL == t->radio_freq) {
+		printk("tuner: no radio tuning for this one, sorry.\n");
+		return;
+	}
+	if (freq < radio_range[0]*16 || freq > radio_range[1]*16) {
+		printk("tuner: radio freq (%d.%02d) out of range (%d-%d)\n",
+		       freq/16,freq%16*100/16,
+		       radio_range[0],radio_range[1]);
+		return;
+	}
+	t->radio_freq(c,freq);
+}
+
+static void set_type(struct i2c_client *c, unsigned int type)
+{
+	struct tuner *t = i2c_get_clientdata(c);
+
+	if (t->type != UNSET) {
+		printk("tuner: type already set (%d)\n",t->type);
+		return;
+	}
+	if (type >= TUNERS)
+		return;
+
+	t->type = type;
+	printk("tuner: type set to %d (%s)\n", t->type,tuners[t->type].name);
+	strlcpy(c->name, tuners[t->type].name, sizeof(c->name));
+
+	switch (t->type) {
+	case TUNER_MT2032:
+		microtune_init(c);
+		break;
+	default:
+		t->tv_freq    = default_set_tv_freq;
+		t->radio_freq = default_set_radio_freq;
+		break;
+	}
+}
+
+/* ---------------------------------------------------------------------- */
+
 static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
 {
 	struct tuner *t;
@@ -821,15 +1038,12 @@
 	t->type       = UNSET;
 	t->radio_if2  = 10700*1000; // 10.7MHz - FM radio
 
+        i2c_attach_client(client);
 	if (type < TUNERS) {
-		t->type = type;
-		printk("tuner(bttv): type forced to %d (%s) [insmod]\n",t->type,tuners[t->type].name);
-		strlcpy(client->name, tuners[t->type].name, I2C_NAME_SIZE);
+		printk("tuner: type forced to %d (%s) [insmod]\n",
+		       t->type,tuners[t->type].name);
+		set_type(client,type);
 	}
-        i2c_attach_client(client);
-        if (t->type == TUNER_MT2032)
-                 mt2032_init(client);
-
 	return 0;
 }
 
@@ -841,8 +1055,19 @@
 	}
 	this_adap = 0;
 
+#ifdef I2C_ADAP_CLASS_TV_ANALOG
 	if (adap->class & I2C_ADAP_CLASS_TV_ANALOG)
 		return i2c_probe(adap, &addr_data, tuner_attach);
+#else
+	switch (adap->id) {
+	case I2C_ALGO_BIT | I2C_HW_B_BT848:
+	case I2C_ALGO_BIT | I2C_HW_B_RIVA:
+	case I2C_ALGO_SAA7134:
+	case I2C_ALGO_SAA7146:
+		return i2c_probe(adap, &addr_data, tuner_attach);
+		break;
+	}
+#endif
 	return 0;
 }
 
@@ -866,21 +1091,13 @@
 
 	/* --- configuration --- */
 	case TUNER_SET_TYPE:
-		if (t->type != UNSET) {
-			printk("tuner: type already set (%d)\n",t->type);
-			return 0;
-		}
-		if (*iarg >= TUNERS)
-			return 0;
-		t->type = *iarg;
-		printk("tuner: type set to %d (%s)\n",
-                        t->type,tuners[t->type].name);
-		strlcpy(client->name, tuners[t->type].name, I2C_NAME_SIZE);
-		if (t->type == TUNER_MT2032)
-                        mt2032_init(client);
+		set_type(client,*iarg);
 		break;
 	case AUDC_SET_RADIO:
-		t->radio = 1;
+		if (!t->radio) {
+			set_tv_freq(client,400 * 16);
+			t->radio = 1;
+		}
 		break;
 	case AUDC_CONFIG_PINNACLE:
 		switch (*iarg) {
@@ -913,12 +1130,12 @@
 		unsigned long *v = arg;
 
 		if (t->radio) {
-			dprintk("tuner: radio freq set to %d.%02d\n",
-				(*iarg)/16,(*iarg)%16*100/16);
+			dprintk("tuner: radio freq set to %lu.%02lu\n",
+				(*v)/16,(*v)%16*100/16);
 			set_radio_freq(client,*v);
 		} else {
-			dprintk("tuner: tv freq set to %d.%02d\n",
-				(*iarg)/16,(*iarg)%16*100/16);
+			dprintk("tuner: tv freq set to %lu.%02lu\n",
+				(*v)/16,(*v)%16*100/16);
 			set_tv_freq(client,*v);
 		}
 		t->freq = *v;
@@ -960,9 +1177,9 @@
 };
 static struct i2c_client client_template =
 {
-	.flags  = I2C_CLIENT_ALLOW_USE,
-	.driver = &driver,
-	.name   = "(tuner unset)",
+	I2C_DEVNAME("(tuner unset)"),
+	.flags      = I2C_CLIENT_ALLOW_USE,
+        .driver     = &driver,
 };
 
 static int tuner_init_module(void)
diff -Nru a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c
--- a/drivers/media/video/tvaudio.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/video/tvaudio.c	Tue Feb  3 19:45:17 2004
@@ -1420,6 +1420,7 @@
 {
 	struct CHIPSTATE *chip;
 	struct CHIPDESC  *desc;
+	int rc;
 
 	chip = kmalloc(sizeof(*chip),GFP_KERNEL);
 	if (!chip)
@@ -1487,8 +1488,12 @@
 		chip->wt.function = chip_thread_wake;
 		chip->wt.data     = (unsigned long)chip;
 		init_waitqueue_head(&chip->wq);
-		kernel_thread(chip_thread,(void *)chip,0);
-		down(&sem);
+		rc = kernel_thread(chip_thread,(void *)chip,0);
+		if (rc < 0)
+			printk(KERN_WARNING "%s: kernel_thread() failed\n",
+			       i2c_clientname(&chip->c));
+		else
+			down(&sem);
 		chip->notify = NULL;
 		wake_up_interruptible(&chip->wq);
 	}
@@ -1497,8 +1502,17 @@
 
 static int chip_probe(struct i2c_adapter *adap)
 {
+#ifdef I2C_ADAP_CLASS_TV_ANALOG
 	if (adap->class & I2C_ADAP_CLASS_TV_ANALOG)
 		return i2c_probe(adap, &addr_data, chip_attach);
+#else
+	switch (adap->id) {
+	case I2C_ALGO_BIT | I2C_HW_B_BT848:
+	case I2C_ALGO_BIT | I2C_HW_B_RIVA:
+	case I2C_ALGO_SAA7134:
+		return i2c_probe(adap, &addr_data, chip_attach);
+	}
+#endif
 	return 0;
 }
 
diff -Nru a/drivers/media/video/tvmixer.c b/drivers/media/video/tvmixer.c
--- a/drivers/media/video/tvmixer.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/media/video/tvmixer.c	Tue Feb  3 19:45:42 2004
@@ -190,6 +190,10 @@
 
 	/* lock bttv in memory while the mixer is in use  */
 	file->private_data = mix;
+#ifndef I2C_PEC
+	if (client->adapter->inc_use)
+		client->adapter->inc_use(client->adapter);
+#endif
 	if (client->adapter->owner)
 		try_module_get(client->adapter->owner);
         return 0;
@@ -205,17 +209,27 @@
 		return -ENODEV;
 	}
 
+#ifndef I2C_PEC
+	if (client->adapter->dec_use)
+		client->adapter->dec_use(client->adapter);
+#endif
 	if (client->adapter->owner)
 		module_put(client->adapter->owner);
 	return 0;
 }
 
 static struct i2c_driver driver = {
+#ifdef I2C_PEC
 	.owner           = THIS_MODULE,
+#endif
 	.name            = "tv card mixer driver",
         .id              = I2C_DRIVERID_TVMIXER,
+#ifdef I2C_DF_DUMMY
+	.flags           = I2C_DF_DUMMY,
+#else
 	.flags           = I2C_DF_NOTIFY,
         .detach_adapter  = tvmixer_adapters,
+#endif
         .attach_adapter  = tvmixer_adapters,
         .detach_client   = tvmixer_clients,
 };
@@ -247,8 +261,21 @@
 	struct video_audio va;
 	int i,minor;
 
+#ifdef I2C_ADAP_CLASS_TV_ANALOG
 	if (!(client->adapter->class & I2C_ADAP_CLASS_TV_ANALOG))
 		return -1;
+#else
+	/* TV card ??? */
+	switch (client->adapter->id) {
+	case I2C_ALGO_BIT | I2C_HW_B_BT848:
+	case I2C_ALGO_BIT | I2C_HW_B_RIVA:
+		/* ok, have a look ... */
+		break;
+	default:
+		/* ignore that one */
+		return -1;
+	}
+#endif
 
 	/* unregister ?? */
 	for (i = 0; i < DEV_MAX; i++) {
diff -Nru a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c
--- a/drivers/media/video/v4l1-compat.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/media/video/v4l1-compat.c	Tue Feb  3 19:45:28 2004
@@ -21,7 +21,6 @@
 
 #include <linux/config.h>
 
-#include <linux/version.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/types.h>
@@ -52,7 +51,7 @@
 MODULE_LICENSE("GPL");
 
 #define dprintk(fmt, arg...)	if (debug) \
-	printk(KERN_DEBUG "v4l1-compat: " fmt, ## arg)
+	printk(KERN_DEBUG "v4l1-compat: " fmt , ## arg)
 
 /*
  *	I O C T L   T R A N S L A T I O N
@@ -80,8 +79,10 @@
 	{
 		ctrl2.id = qctrl2.id;
 		err = drv(inode, file, VIDIOC_G_CTRL, &ctrl2);
-		if (err < 0)
+		if (err < 0) {
 			dprintk("VIDIOC_G_CTRL: %d\n",err);
+			return 0;
+		}
 		return ((ctrl2.value - qctrl2.minimum) * 65535
 			 + (qctrl2.maximum - qctrl2.minimum) / 2)
 			/ (qctrl2.maximum - qctrl2.minimum);
@@ -207,17 +208,10 @@
 {
 	int retval = 1;
 	poll_table *table;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,48)
-	poll_table wait_table;
-
-	poll_initwait(&wait_table);
-	table = &wait_table;
-#else
 	struct poll_wqueues pwq;
 
 	poll_initwait(&pwq);
 	table = &pwq.pt;
-#endif
 	for (;;) {
 		int mask;
 		set_current_state(TASK_INTERRUPTIBLE);
@@ -231,12 +225,8 @@
 		}
 		schedule();
 	}
-	current->state = TASK_RUNNING;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,48)
-	poll_freewait(&wait_table);
-#else
+	set_current_state(TASK_RUNNING);
 	poll_freewait(&pwq);
-#endif
 	return retval;
 }
 
@@ -482,6 +472,7 @@
 			fmt2->fmt.pix.width  = win->width;
 			fmt2->fmt.pix.height = win->height;
 			fmt2->fmt.pix.field  = V4L2_FIELD_ANY;
+			fmt2->fmt.pix.bytesperline = 0;
 			err = drv(inode, file, VIDIOC_S_FMT, fmt2);
 			if (err < 0)
 				dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %d\n",
@@ -509,6 +500,14 @@
 	}
 	case VIDIOCCAPTURE: /*  turn on/off preview  */
 	{
+		int *on = arg;
+
+		if (0 == *on) {
+			/* dirty hack time.  But v4l1 has no STREAMOFF
+			 * equivalent in the API, and this one at
+			 * least comes close ... */
+			drv(inode, file, VIDIOC_STREAMOFF, NULL);
+		}
 		err = drv(inode, file, VIDIOC_OVERLAY, arg);
 		if (err < 0)
 			dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %d\n",err);
@@ -719,7 +718,8 @@
 	case VIDIOCGFREQ: /*  get frequency  */
 	{
 		int *freq = arg;
-		
+
+		freq2.tuner = 0;
 		err = drv(inode, file, VIDIOC_G_FREQUENCY, &freq2);
 		if (err < 0)
 			dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %d\n",err);
@@ -731,6 +731,7 @@
 	{
 		int *freq = arg;
 
+		freq2.tuner = 0;
 		drv(inode, file, VIDIOC_G_FREQUENCY, &freq2);
 		freq2.frequency = *freq;
 		err = drv(inode, file, VIDIOC_S_FREQUENCY, &freq2);
@@ -877,6 +878,7 @@
 			fmt2->fmt.pix.pixelformat =
 				palette_to_pixelformat(mm->format);
 			fmt2->fmt.pix.field = V4L2_FIELD_ANY;
+			fmt2->fmt.pix.bytesperline = 0;
 			err = drv(inode, file, VIDIOC_S_FMT, fmt2);
 			if (err < 0) {
 				dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %d\n",err);
@@ -895,7 +897,7 @@
 			dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %d\n",err);
 			break;
 		}
-		err = drv(inode, file, VIDIOC_STREAMON, &buf2.type);
+		err = drv(inode, file, VIDIOC_STREAMON, NULL);
 		if (err < 0)
 			dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %d\n",err);
 		break;
@@ -989,7 +991,7 @@
 
 		if (fmt2->fmt.vbi.samples_per_line != fmt->samples_per_line ||
 		    fmt2->fmt.vbi.sampling_rate    != fmt->sampling_rate    ||
-		    fmt2->fmt.vbi.sample_format    != V4L2_PIX_FMT_GREY     ||
+		    VIDEO_PALETTE_RAW              != fmt->sample_format    ||
 		    fmt2->fmt.vbi.start[0]         != fmt->start[0]         ||
 		    fmt2->fmt.vbi.count[0]         != fmt->count[0]         ||
 		    fmt2->fmt.vbi.start[1]         != fmt->start[1]         ||
@@ -999,10 +1001,9 @@
 			break;
 		}
 		err = drv(inode, file, VIDIOC_S_FMT, fmt2);
-		if (err < 0) {
+		if (err < 0)
 			dprintk("VIDIOCSVBIFMT / VIDIOC_S_FMT: %d\n", err);
-			break;
-		}
+		break;
 	}
 	
 	default:
diff -Nru a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
--- a/drivers/media/video/v4l2-common.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/media/video/v4l2-common.c	Tue Feb  3 19:45:42 2004
@@ -67,6 +67,7 @@
 #include <linux/ust.h>
 #endif
 
+
 #include <linux/videodev.h>
 
 MODULE_AUTHOR("Bill Dirks, Justin Schoeman, Gerd Knorr");
@@ -100,9 +101,11 @@
 int v4l2_video_std_construct(struct v4l2_standard *vs,
 			     int id, char *name)
 {
-	memset(vs, 0, sizeof(struct v4l2_standard));
+	u32 index = vs->index;
 
-	vs->id = id;
+	memset(vs, 0, sizeof(struct v4l2_standard));
+	vs->index = index;
+	vs->id    = id;
 	if (id & (V4L2_STD_NTSC | V4L2_STD_PAL_M)) {
 		vs->frameperiod.numerator = 1001;
 		vs->frameperiod.denominator = 30000;
@@ -118,6 +121,66 @@
 
 
 /* ----------------------------------------------------------------- */
+/* priority handling                                                 */
+
+#define V4L2_PRIO_VALID(val) (val == V4L2_PRIORITY_BACKGROUND   || \
+			      val == V4L2_PRIORITY_INTERACTIVE  || \
+			      val == V4L2_PRIORITY_RECORD)
+
+int v4l2_prio_init(struct v4l2_prio_state *global)
+{
+	memset(global,0,sizeof(*global));
+	return 0;
+}
+	
+int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local,
+		     enum v4l2_priority new)
+{
+	if (!V4L2_PRIO_VALID(new))
+		return -EINVAL;
+	if (*local == new)
+		return 0;
+
+	atomic_inc(&global->prios[new]);
+	if (V4L2_PRIO_VALID(*local))
+		atomic_dec(&global->prios[*local]);
+	*local = new;
+	return 0;
+}
+
+int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local)
+{
+	return v4l2_prio_change(global,local,V4L2_PRIORITY_DEFAULT);
+}
+
+int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local)
+{
+	if (V4L2_PRIO_VALID(*local))
+		atomic_dec(&global->prios[*local]);
+	return 0;
+}
+
+enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global)
+{
+	if (atomic_read(&global->prios[V4L2_PRIORITY_RECORD]) > 0)
+		return V4L2_PRIORITY_RECORD;
+	if (atomic_read(&global->prios[V4L2_PRIORITY_INTERACTIVE]) > 0)
+		return V4L2_PRIORITY_INTERACTIVE;
+	if (atomic_read(&global->prios[V4L2_PRIORITY_BACKGROUND]) > 0)
+		return V4L2_PRIORITY_BACKGROUND;
+	return V4L2_PRIORITY_UNSET;
+}
+
+int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local)
+{
+	if (*local < v4l2_prio_max(global))
+		return -EBUSY;
+	return 0;
+}
+
+
+/* ----------------------------------------------------------------- */
+/* some arrays for pretty-printing debug messages                    */
 
 char *v4l2_field_names[] = {
 	[V4L2_FIELD_ANY]        = "any",
@@ -198,6 +261,13 @@
 
 EXPORT_SYMBOL(v4l2_video_std_fps);
 EXPORT_SYMBOL(v4l2_video_std_construct);
+
+EXPORT_SYMBOL(v4l2_prio_init);
+EXPORT_SYMBOL(v4l2_prio_change);
+EXPORT_SYMBOL(v4l2_prio_open);
+EXPORT_SYMBOL(v4l2_prio_close);
+EXPORT_SYMBOL(v4l2_prio_max);
+EXPORT_SYMBOL(v4l2_prio_check);
 
 EXPORT_SYMBOL(v4l2_field_names);
 EXPORT_SYMBOL(v4l2_type_names);
diff -Nru a/drivers/media/video/video-buf.c b/drivers/media/video/video-buf.c
--- a/drivers/media/video/video-buf.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/media/video/video-buf.c	Tue Feb  3 19:45:18 2004
@@ -26,11 +26,6 @@
 #include <asm/page.h>
 #include <asm/pgtable.h>
 
-#ifndef TryLockPage
-# include "linux/page-flags.h"
-# define TryLockPage TestSetPageLocked
-#endif
-
 #include <media/video-buf.h>
 
 static int debug = 0;
@@ -41,7 +36,7 @@
 MODULE_PARM(debug,"i");
 
 #define dprintk(level, fmt, arg...)	if (debug >= level) \
-	printk(KERN_DEBUG "vbuf: " fmt, ## arg)
+	printk(KERN_DEBUG "vbuf: " fmt , ## arg)
 
 struct scatterlist*
 videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages)
@@ -112,36 +107,6 @@
 	return NULL;
 }
 
-int videobuf_lock(struct page **pages, int nr_pages)
-{
-	int i;
-
-	dprintk(2,"lock start ...\n");
-	for (i = 0; i < nr_pages; i++)
-		if (TryLockPage(pages[i]))
-			goto err;
-	dprintk(2,"lock ok [%d pages]\n",nr_pages);
-	return 0;
-
- err:
-	dprintk(2,"lock failed, unlock ...\n");
-	while (i > 0)
-		unlock_page(pages[--i]);
-	dprintk(2,"lock quit\n");
-	return -EINVAL;
-}
-
-int videobuf_unlock(struct page **pages, int nr_pages)
-{
-	int i;
-
-	dprintk(2,"unlock start ...\n");
-	for (i = 0; i < nr_pages; i++)
-		unlock_page(pages[i]);
-	dprintk(2,"unlock ok [%d pages]\n",nr_pages);
-	return 0;
-}
-
 /* --------------------------------------------------------------------- */
 
 int videobuf_dma_init_user(struct videobuf_dmabuf *dma, int direction,
@@ -213,20 +178,12 @@
 
 int videobuf_dma_pci_map(struct pci_dev *dev, struct videobuf_dmabuf *dma)
 {
-	int err;
-
 	if (0 == dma->nr_pages)
 		BUG();
 	
 	if (dma->pages) {
-		if (0 != (err = videobuf_lock(dma->pages, dma->nr_pages))) {
-			dprintk(1,"videobuf_lock: %d\n",err);
-			return err;
-		}
 		dma->sglist = videobuf_pages_to_sg(dma->pages, dma->nr_pages,
 						   dma->offset);
-		if (NULL == dma->sglist)
-			videobuf_unlock(dma->pages, dma->nr_pages);
 	}
 	if (dma->vmalloc) {
 		dma->sglist = videobuf_vmalloc_to_sg
@@ -236,8 +193,8 @@
 		dma->sglist = kmalloc(sizeof(struct scatterlist), GFP_KERNEL);
 		if (NULL != dma->sglist) {
 			dma->sglen  = 1;
-			sg_dma_address(&dma->sglist[0]) = dma->bus_addr & ~PAGE_MASK;
-			dma->sglist[0].offset           = dma->bus_addr & PAGE_MASK;
+			sg_dma_address(&dma->sglist[0]) = dma->bus_addr & PAGE_MASK;
+			dma->sglist[0].offset           = dma->bus_addr & ~PAGE_MASK;
 			sg_dma_len(&dma->sglist[0])     = dma->nr_pages * PAGE_SIZE;
 		}
 	}
@@ -272,8 +229,6 @@
 	kfree(dma->sglist);
 	dma->sglist = NULL;
 	dma->sglen = 0;
-	if (dma->pages)
-		videobuf_unlock(dma->pages, dma->nr_pages);
 	return 0;
 }
 
@@ -325,8 +280,8 @@
 			retval = -EAGAIN;
 			break;
 		}
-		set_current_state(intr ? TASK_INTERRUPTIBLE :
-					TASK_UNINTERRUPTIBLE);
+		set_current_state(intr  ? TASK_INTERRUPTIBLE
+					: TASK_UNINTERRUPTIBLE);
 		if (vb->state == STATE_ACTIVE || vb->state == STATE_QUEUED)
 			schedule();
 		set_current_state(TASK_RUNNING);
@@ -969,8 +924,10 @@
 			retval      += bytes;
 			q->read_off += bytes;
 		} else {
-			/* some error -- skip buffer */
+			/* some error */
 			q->read_off = q->read_buf->size;
+			if (0 == retval)
+				retval = -EIO;
 		}
 
 		/* requeue buffer when done with copying */
@@ -982,6 +939,8 @@
 			spin_unlock_irqrestore(q->irqlock,flags);
 			q->read_buf = NULL;
 		}
+		if (retval < 0)
+			break;
 	}
 
  done:
@@ -1078,7 +1037,7 @@
  */
 static struct page*
 videobuf_vm_nopage(struct vm_area_struct *vma, unsigned long vaddr,
-		  int *type)
+		   int *type)
 {
 	struct page *page;
 
@@ -1232,8 +1191,6 @@
 /* --------------------------------------------------------------------- */
 
 EXPORT_SYMBOL_GPL(videobuf_vmalloc_to_sg);
-EXPORT_SYMBOL_GPL(videobuf_lock);
-EXPORT_SYMBOL_GPL(videobuf_unlock);
 
 EXPORT_SYMBOL_GPL(videobuf_dma_init_user);
 EXPORT_SYMBOL_GPL(videobuf_dma_init_kernel);
diff -Nru a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
--- a/drivers/media/video/videodev.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/video/videodev.c	Tue Feb  3 19:45:17 2004
@@ -140,6 +140,30 @@
 /*
  * helper function -- handles userspace copying for ioctl arguments
  */
+
+static unsigned int
+video_fix_command(unsigned int cmd)
+{
+	switch (cmd) {
+	case VIDIOC_OVERLAY_OLD:
+		cmd = VIDIOC_OVERLAY;
+		break;
+	case VIDIOC_S_PARM_OLD:
+		cmd = VIDIOC_S_PARM;
+		break;
+	case VIDIOC_S_CTRL_OLD:
+		cmd = VIDIOC_S_CTRL;
+		break;
+	case VIDIOC_G_AUDIO_OLD:
+		cmd = VIDIOC_G_AUDIO;
+		break;
+	case VIDIOC_G_AUDOUT_OLD:
+		cmd = VIDIOC_G_AUDOUT;
+		break;
+	}
+	return cmd;
+}
+
 int
 video_usercopy(struct inode *inode, struct file *file,
 	       unsigned int cmd, unsigned long arg,
@@ -151,12 +175,14 @@
 	void	*parg = NULL;
 	int	err  = -EINVAL;
 
+	cmd = video_fix_command(cmd);
+
 	/*  Copy arguments into temp kernel buffer  */
 	switch (_IOC_DIR(cmd)) {
 	case _IOC_NONE:
 		parg = (void *)arg;
 		break;
-	case _IOC_READ: /* some v4l ioctls are marked wrong ... */
+	case _IOC_READ:
 	case _IOC_WRITE:
 	case (_IOC_WRITE | _IOC_READ):
 		if (_IOC_SIZE(cmd) <= sizeof(sbuf)) {
@@ -170,8 +196,9 @@
 		}
 		
 		err = -EFAULT;
-		if (copy_from_user(parg, (void *)arg, _IOC_SIZE(cmd)))
-			goto out;
+		if (_IOC_DIR(cmd) & _IOC_WRITE)
+			if (copy_from_user(parg, (void *)arg, _IOC_SIZE(cmd)))
+				goto out;
 		break;
 	}
 
diff -Nru a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c
--- a/drivers/media/video/w9966.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/media/video/w9966.c	Tue Feb  3 19:45:17 2004
@@ -875,6 +875,7 @@
 	unsigned char addr = 0xa0;	// ECP, read, CCD-transfer, 00000
 	unsigned char* dest = (unsigned char*)buf;
 	unsigned long dleft = count;
+	unsigned char *tbuf;
 	
 	// Why would anyone want more than this??
 	if (count > cam->width * cam->height * 2)
@@ -894,25 +895,33 @@
 		w9966_pdev_release(cam);
 		return -EFAULT;
 	}
-	
+
+	tbuf = kmalloc(W9966_RBUFFER, GFP_KERNEL);
+	if (tbuf == NULL) {
+		count = -ENOMEM;
+		goto out;
+	}
+
 	while(dleft > 0)
 	{
 		unsigned long tsize = (dleft > W9966_RBUFFER) ? W9966_RBUFFER : dleft;
-		unsigned char tbuf[W9966_RBUFFER];
 	
 		if (parport_read(cam->pport, tbuf, tsize) < tsize) {
-			w9966_pdev_release(cam);
-			return -EFAULT;
+			count = -EFAULT;
+			goto out;
 		}
 		if (copy_to_user(dest, tbuf, tsize) != 0) {
-			w9966_pdev_release(cam);
-			return -EFAULT;
+			count = -EFAULT;
+			goto out;
 		}
 		dest += tsize;
 		dleft -= tsize;
 	}
-	
+
 	w9966_wReg(cam, 0x01, 0x18);	// Disable capture
+
+out:
+	kfree(tbuf);
 	w9966_pdev_release(cam);
 
 	return count;
diff -Nru a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
--- a/drivers/message/fusion/mptbase.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/message/fusion/mptbase.h	Tue Feb  3 19:45:17 2004
@@ -80,8 +80,8 @@
 #define COPYRIGHT	"Copyright (c) 1999-2003 " MODULEAUTHOR
 #endif
 
-#define MPT_LINUX_VERSION_COMMON	"2.05.00.05"
-#define MPT_LINUX_PACKAGE_NAME		"@(#)mptlinux-2.05.00.05"
+#define MPT_LINUX_VERSION_COMMON	"2.05.00.06"
+#define MPT_LINUX_PACKAGE_NAME		"@(#)mptlinux-2.05.00.06"
 #define WHAT_MAGIC_STRING		"@" "(" "#" ")"
 
 #define show_mptmod_ver(s,ver)  \
diff -Nru a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
--- a/drivers/message/fusion/mptscsih.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/message/fusion/mptscsih.c	Tue Feb  3 19:45:17 2004
@@ -1231,7 +1231,9 @@
 	} else {
 		mem = (u8 *) hd->ReqToChain;
 	}
-	memset(mem, 0xFF, sz);
+/*	memset(mem, 0xFF, sz); */
+	for(ii=0;ii<hd->ioc->req_depth;ii++)
+		hd->ReqToChain[ii] = MPT_HOST_NO_CHAIN;
 
 
 	/* ChainToChain size must equal the total number
diff -Nru a/drivers/message/i2o/Kconfig b/drivers/message/i2o/Kconfig
--- a/drivers/message/i2o/Kconfig	Tue Feb  3 19:45:16 2004
+++ b/drivers/message/i2o/Kconfig	Tue Feb  3 19:45:16 2004
@@ -3,7 +3,7 @@
 
 config I2O
 	tristate "I2O support"
-	depends on PCI
+	depends on PCI && !64BIT
 	---help---
 	  The Intelligent Input/Output (I2O) architecture allows hardware
 	  drivers to be split into two parts: an operating system specific
diff -Nru a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c
--- a/drivers/mtd/maps/pcmciamtd.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/mtd/maps/pcmciamtd.c	Tue Feb  3 19:45:17 2004
@@ -125,7 +125,7 @@
 		DEBUG(2, "Remapping window from 0x%8.8x to 0x%8.8x",
 		      dev->offset, mrq.CardOffset);
 		mrq.Page = 0;
-		if( (ret = CardServices(MapMemPage, win, &mrq)) != CS_SUCCESS) {
+		if( (ret = pcmcia_map_mem_page(win, &mrq)) != CS_SUCCESS) {
 			cs_error(dev->link.handle, MapMemPage, ret);
 			return NULL;
 		}
@@ -332,7 +332,7 @@
 	mod.Vpp1 = mod.Vpp2 = on ? dev->vpp : 0;
 
 	DEBUG(2, "dev = %p on = %d vpp = %d\n", dev, on, dev->vpp);
-	ret = CardServices(ModifyConfiguration, link->handle, &mod);
+	ret = pcmcia_modify_configuration(link->handle, &mod);
 	if(ret != CS_SUCCESS) {
 		cs_error(link->handle, ModifyConfiguration, ret);
 	}
@@ -355,9 +355,9 @@
 			iounmap(dev->win_base);
 			dev->win_base = NULL;
 		}
-		CardServices(ReleaseWindow, link->win);
+		pcmcia_release_window(link->win);
 	}
-	CardServices(ReleaseConfiguration, link->handle);
+	pcmcia_release_configuration(link->handle);
 	link->state &= ~DEV_CONFIG;
 }
 
@@ -375,14 +375,14 @@
 	tuple.TupleOffset = 0;
 	tuple.DesiredTuple = RETURN_FIRST_TUPLE;
 
-	rc = CardServices(GetFirstTuple, link->handle, &tuple);
+	rc = pcmcia_get_first_tuple(link->handle, &tuple);
 	while(rc == CS_SUCCESS) {
-		rc = CardServices(GetTupleData, link->handle, &tuple);
+		rc = pcmcia_get_tuple_data(link->handle, &tuple);
 		if(rc != CS_SUCCESS) {
 			cs_error(link->handle, GetTupleData, rc);
 			break;
 		}
-		rc = CardServices(ParseTuple, link->handle, &tuple, &parse);
+		rc = pcmcia_parse_tuple(link->handle, &tuple, &parse);
 		if(rc != CS_SUCCESS) {
 			cs_error(link->handle, ParseTuple, rc);
 			break;
@@ -455,7 +455,7 @@
 			DEBUG(2, "Unknown tuple code %d", tuple.TupleCode);
 		}
 		
-		rc = CardServices(GetNextTuple, link->handle, &tuple, &parse);
+		rc = pcmcia_get_next_tuple(link->handle, &tuple);
 	}
 	if(!dev->pcmcia_map.size)
 		dev->pcmcia_map.size = MAX_PCMCIA_ADDR;
@@ -489,8 +489,8 @@
  * MTD device available to the system.
  */
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static void pcmciamtd_config(dev_link_t *link)
 {
@@ -512,7 +512,7 @@
 	link->state |= DEV_CONFIG;
 
 	DEBUG(2, "Validating CIS");
-	ret = CardServices(ValidateCIS, link->handle, &cisinfo);
+	ret = pcmcia_validate_cis(link->handle, &cisinfo);
 	if(ret != CS_SUCCESS) {
 		cs_error(link->handle, GetTupleData, ret);
 	} else {
@@ -547,8 +547,7 @@
 		int ret;
 		DEBUG(2, "requesting window with size = %dKiB memspeed = %d",
 		      req.Size >> 10, req.AccessSpeed);
-		link->win = (window_handle_t)link->handle;
-		ret = CardServices(RequestWindow, &link->win, &req);
+		ret = pcmcia_request_window(&link->handle, &req, &link->win);
 		DEBUG(2, "ret = %d dev->win_size = %d", ret, dev->win_size);
 		if(ret) {
 			req.Size >>= 1;
@@ -569,7 +568,7 @@
 	DEBUG(1, "Allocated a window of %dKiB", dev->win_size >> 10);
 		
 	/* Get write protect status */
-	CS_CHECK(GetStatus, link->handle, &status);
+	CS_CHECK(GetStatus, pcmcia_get_status(link->handle, &status));
 	DEBUG(2, "status value: 0x%x window handle = 0x%8.8lx",
 	      status.CardState, (unsigned long)link->win);
 	dev->win_base = ioremap(req.Base, req.Size);
@@ -586,7 +585,7 @@
 	dev->pcmcia_map.map_priv_2 = (unsigned long)link->win;
 
 	DEBUG(2, "Getting configuration");
-	CS_CHECK(GetConfigurationInfo, link->handle, &t);
+	CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link->handle, &t));
 	DEBUG(2, "Vcc = %d Vpp1 = %d Vpp2 = %d", t.Vcc, t.Vpp1, t.Vpp2);
 	dev->vpp = (vpp) ? vpp : t.Vpp1;
 	link->conf.Attributes = 0;
@@ -608,7 +607,7 @@
 	link->conf.ConfigIndex = 0;
 	link->conf.Present = t.Present;
 	DEBUG(2, "Setting Configuration");
-	ret = CardServices(RequestConfiguration, link->handle, &link->conf);
+	ret = pcmcia_request_configuration(link->handle, &link->conf);
 	if(ret != CS_SUCCESS) {
 		cs_error(link->handle, RequestConfiguration, ret);
 	}
@@ -757,7 +756,7 @@
 	if (link->handle) {
 		int ret;
 		DEBUG(2, "Deregistering with card services");
-		ret = CardServices(DeregisterClient, link->handle);
+		ret = pcmcia_deregister_client(link->handle);
 		if (ret != CS_SUCCESS)
 			cs_error(link->handle, DeregisterClient, ret);
 	}
@@ -804,7 +803,7 @@
 	client_reg.Version = 0x0210;
 	client_reg.event_callback_args.client_data = link;
 	DEBUG(2, "Calling RegisterClient");
-	ret = CardServices(RegisterClient, &link->handle, &client_reg);
+	ret = pcmcia_register_client(&link->handle, &client_reg);
 	if (ret != 0) {
 		cs_error(link->handle, RegisterClient, ret);
 		pcmciamtd_detach(link);
diff -Nru a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c
--- a/drivers/mtd/maps/sa1100-flash.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/mtd/maps/sa1100-flash.c	Tue Feb  3 19:45:17 2004
@@ -154,50 +154,34 @@
 
 #ifdef CONFIG_SA1100_CERF
 #ifdef CONFIG_SA1100_CERF_FLASH_32MB
-static struct mtd_partition cerf_partitions[] = {
-	{
-		.name		= "firmware",
-		.size		= 0x00040000,
-		.offset		= 0,
-	}, {
-		.name		= "params",
-		.size		= 0x00040000,
-		.offset		= 0x00040000,
-	}, {
-		.name		= "kernel",
-		.size		= 0x00100000,
-		.offset		= 0x00080000,
-	}, {
-		.name		= "rootdisk",
-		.size		= 0x01E80000,
-		.offset		= 0x00180000,
-	}
-};
+#  define CERF_FLASH_SIZE	0x02000000
 #elif defined CONFIG_SA1100_CERF_FLASH_16MB
+#  define CERF_FLASH_SIZE	0x01000000
+#elif defined CONFIG_SA1100_CERF_FLASH_8MB
+#  define CERF_FLASH_SIZE	0x00800000
+#else
+#  error "Undefined flash size for CERF in sa1100-flash.c"
+#endif
+
 static struct mtd_partition cerf_partitions[] = {
 	{
-		.name		= "firmware",
+		.name		= "Bootloader",
 		.size		= 0x00020000,
-		.offset		= 0,
+		.offset		= 0x00000000,
 	}, {
-		.name		= "params",
-		.size		= 0x00020000,
+		.name		= "Params",
+		.size		= 0x00040000,
 		.offset		= 0x00020000,
 	}, {
-		.name		= "kernel",
+		.name		= "Kernel",
 		.size		= 0x00100000,
-		.offset		= 0x00040000,
+		.offset		= 0x00060000,
 	}, {
-		.name		= "rootdisk",
-		.size		= 0x00EC0000,
-		.offset		= 0x00140000,
+		.name		= "Filesystem",
+		.size		= CERF_FLASH_SIZE-0x00160000,
+		.offset		= 0x00160000,
 	}
 };
-#elif defined CONFIG_SA1100_CERF_FLASH_8MB
-#   error "Unwritten type definition"
-#else
-#   error "Undefined memory orientation for CERF in sa1100-flash.c"
-#endif
 #endif
 
 #ifdef CONFIG_SA1100_CONSUS
diff -Nru a/drivers/net/3c527.c b/drivers/net/3c527.c
--- a/drivers/net/3c527.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/net/3c527.c	Tue Feb  3 19:45:29 2004
@@ -1,9 +1,10 @@
-/* 3c527.c: 3Com Etherlink/MC32 driver for Linux 2.4
+/* 3c527.c: 3Com Etherlink/MC32 driver for Linux 2.4 and 2.6.
  *
  *	(c) Copyright 1998 Red Hat Software Inc
  *	Written by Alan Cox. 
  *	Further debugging by Carl Drougge.
- *      Modified by Richard Procter (rnp@netlink.co.nz)
+ *      Initial SMP support by Felipe W Damasio <felipewd@terra.com.br>
+ *      Heavily modified by Richard Procter <rnp@paradise.net.nz>
  *
  *	Based on skeleton.c written 1993-94 by Donald Becker and ne2.c
  *	(for the MCA stuff) written by Wim Dumon.
@@ -17,11 +18,11 @@
  */
 
 #define DRV_NAME		"3c527"
-#define DRV_VERSION		"0.6a"
-#define DRV_RELDATE		"2001/11/17"
+#define DRV_VERSION		"0.7-SMP"
+#define DRV_RELDATE		"2003/09/21"
 
 static const char *version =
-DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Richard Proctor (rnp@netlink.co.nz)\n";
+DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Richard Procter <rnp@paradise.net.nz>\n";
 
 /**
  * DOC: Traps for the unwary
@@ -100,7 +101,9 @@
 #include <linux/string.h>
 #include <linux/wait.h>
 #include <linux/ethtool.h>
+#include <linux/completion.h>
 
+#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/bitops.h>
@@ -143,19 +146,19 @@
 static const int WORKAROUND_82586=1;
 
 /* Pointers to buffers and their on-card records */
-
 struct mc32_ring_desc 
 {
 	volatile struct skb_header *p;                    
 	struct sk_buff *skb;          
 };
 
-
 /* Information that needs to be kept for each board. */
 struct mc32_local 
 {
-	struct net_device_stats net_stats;
 	int slot;
+
+	u32 base;
+	struct net_device_stats net_stats;
 	volatile struct mc32_mailbox *rx_box;
 	volatile struct mc32_mailbox *tx_box;
 	volatile struct mc32_mailbox *exec_box;
@@ -165,22 +168,23 @@
         u16 tx_len;             /* Transmit list count */ 
         u16 rx_len;             /* Receive list count */
 
-	u32 base;
-	u16 exec_pending;
-	u16 mc_reload_wait;	/* a multicast load request is pending */
+	u16 xceiver_desired_state; /* HALTED or RUNNING */
+	u16 cmd_nonblocking;    /* Thread is uninterested in command result */
+	u16 mc_reload_wait;	/* A multicast load request is pending */
 	u32 mc_list_valid;	/* True when the mclist is set */
-	u16 xceiver_state;      /* Current transceiver state. bitmapped */ 
-	u16 desired_state;      /* The state we want the transceiver to be in */ 
-	atomic_t tx_count;	/* buffers left */
-	wait_queue_head_t event;
 
 	struct mc32_ring_desc tx_ring[TX_RING_LEN];	/* Host Transmit ring */
 	struct mc32_ring_desc rx_ring[RX_RING_LEN];	/* Host Receive ring */
 
+	atomic_t tx_count;	/* buffers left */
+	atomic_t tx_ring_head;  /* index to tx en-queue end */
 	u16 tx_ring_tail;       /* index to tx de-queue end */
-	u16 tx_ring_head;       /* index to tx en-queue end */
 
 	u16 rx_ring_tail;       /* index to rx de-queue end */ 
+
+	struct semaphore cmd_mutex;    /* Serialises issuing of execute commands */
+        struct completion execution_cmd; /* Card has completed an execute command */
+	struct completion xceiver_cmd;   /* Card has completed a tx or rx command */
 };
 
 /* The station (ethernet) address prefix, used for a sanity check. */
@@ -236,7 +240,6 @@
 {
 	static int current_mca_slot = -1;
 	int i;
-	int adapter_found = 0;
 
 	SET_MODULE_OWNER(dev);
 
@@ -247,11 +250,11 @@
 	   Autodetecting MCA cards is extremely simple. 
 	   Just search for the card. */
 
-	for(i = 0; (mc32_adapters[i].name != NULL) && !adapter_found; i++) {
+	for(i = 0; (mc32_adapters[i].name != NULL); i++) {
 		current_mca_slot = 
 			mca_find_unused_adapter(mc32_adapters[i].id, 0);
 
-		if((current_mca_slot != MCA_NOTFOUND) && !adapter_found) {
+		if(current_mca_slot != MCA_NOTFOUND) {
 			if(!mc32_probe1(dev, current_mca_slot))
 			{
 				mca_set_adapter_name(current_mca_slot, 
@@ -409,7 +412,7 @@
 	 *	Grab the IRQ
 	 */
 
-	i = request_irq(dev->irq, &mc32_interrupt, SA_SHIRQ, dev->name, dev);
+	i = request_irq(dev->irq, &mc32_interrupt, SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev);
 	if (i) {
 		release_region(dev->base_addr, MC32_IO_EXTENT);
 		printk(KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, dev->irq);
@@ -498,7 +501,9 @@
 	lp->tx_len 		= lp->exec_box->data[9];   /* Transmit list count */ 
 	lp->rx_len 		= lp->exec_box->data[11];  /* Receive list count */
 
-	init_waitqueue_head(&lp->event);
+	init_MUTEX_LOCKED(&lp->cmd_mutex);
+	init_completion(&lp->execution_cmd);
+	init_completion(&lp->xceiver_cmd);
 	
 	printk("%s: Firmware Rev %d. %d RX buffers, %d TX buffers. Base of 0x%08X.\n",
 		dev->name, lp->exec_box->data[12], lp->rx_len, lp->tx_len, lp->base);
@@ -511,10 +516,6 @@
 	dev->tx_timeout		= mc32_timeout;
 	dev->watchdog_timeo	= HZ*5;	/* Board does all the work */
 	dev->ethtool_ops	= &netdev_ethtool_ops;
-	
-	lp->xceiver_state = HALTED; 
-	
-	lp->tx_ring_tail=lp->tx_ring_head=0;
 
 	/* Fill in the fields of the device structure with ethernet values. */
 	ether_setup(dev);
@@ -539,7 +540,7 @@
  *	status of any pending commands and takes very little time at all.
  */
  
-static void mc32_ready_poll(struct net_device *dev)
+static inline void mc32_ready_poll(struct net_device *dev)
 {
 	int ioaddr = dev->base_addr;
 	while(!(inb(ioaddr+HOST_STATUS)&HOST_STATUS_CRR));
@@ -554,31 +555,38 @@
  *	@len: Length of the data block
  *
  *	Send a command from interrupt state. If there is a command
- *	currently being executed then we return an error of -1. It simply
- *	isn't viable to wait around as commands may be slow. Providing we
- *	get in, we busy wait for the board to become ready to accept the
- *	command and issue it. We do not wait for the command to complete
- *	--- the card will interrupt us when it's done.
+ *	currently being executed then we return an error of -1. It
+ *	simply isn't viable to wait around as commands may be
+ *	slow. This can theoretically be starved on SMP, but it's hard
+ *	to see a realistic situation.  We do not wait for the command
+ *	to complete --- we rely on the interrupt handler to tidy up
+ *	after us.
  */
 
 static int mc32_command_nowait(struct net_device *dev, u16 cmd, void *data, int len)
 {
 	struct mc32_local *lp = (struct mc32_local *)dev->priv;
 	int ioaddr = dev->base_addr;
+	int ret = -1;
 
-	if(lp->exec_pending)
-		return -1;
-	
-	lp->exec_pending=3;
-	lp->exec_box->mbox=0;
-	lp->exec_box->mbox=cmd;
-	memcpy((void *)lp->exec_box->data, data, len);
-	barrier();	/* the memcpy forgot the volatile so be sure */
+	if (down_trylock(&lp->cmd_mutex) == 0)
+	{
+		lp->cmd_nonblocking=1;
+		lp->exec_box->mbox=0;
+		lp->exec_box->mbox=cmd;
+		memcpy((void *)lp->exec_box->data, data, len);
+		barrier();	/* the memcpy forgot the volatile so be sure */
+
+		/* Send the command */
+		mc32_ready_poll(dev);
+		outb(1<<6, ioaddr+HOST_CMD);
 
-	/* Send the command */
-	while(!(inb(ioaddr+HOST_STATUS)&HOST_STATUS_CRR));
-	outb(1<<6, ioaddr+HOST_CMD);	
-	return 0;
+		ret = 0;
+
+		/* Interrupt handler will signal mutex on completion */
+	}
+
+	return ret;
 }
 
 
@@ -592,76 +600,47 @@
  *	Sends exec commands in a user context. This permits us to wait around
  *	for the replies and also to wait for the command buffer to complete
  *	from a previous command before we execute our command. After our 
- *	command completes we will complete any pending multicast reload
+ *	command completes we will attempt any pending multicast reload
  *	we blocked off by hogging the exec buffer.
  *
  *	You feed the card a command, you wait, it interrupts you get a 
  *	reply. All well and good. The complication arises because you use
  *	commands for filter list changes which come in at bh level from things
  *	like IPV6 group stuff.
- *
- *	We have a simple state machine
- *
- *	0	- nothing issued
- *
- *	1	- command issued, wait reply
- *
- *	2	- reply waiting - reader then goes to state 0
- *
- *	3	- command issued, trash reply. In which case the irq
- *		  takes it back to state 0
- *
  */
   
 static int mc32_command(struct net_device *dev, u16 cmd, void *data, int len)
 {
 	struct mc32_local *lp = (struct mc32_local *)dev->priv;
 	int ioaddr = dev->base_addr;
-	unsigned long flags;
 	int ret = 0;
 	
+	down(&lp->cmd_mutex);
+
 	/*
-	 *	Wait for a command
-	 */
-	 
-	save_flags(flags);
-	cli();
-	 
-	while(lp->exec_pending)
-		sleep_on(&lp->event);
-		
-	/*
-	 *	Issue mine
+	 *     My Turn
 	 */
 
-	lp->exec_pending=1;
-	
-	restore_flags(flags);
-	
+	lp->cmd_nonblocking=0;
 	lp->exec_box->mbox=0;
 	lp->exec_box->mbox=cmd;
 	memcpy((void *)lp->exec_box->data, data, len);
 	barrier();	/* the memcpy forgot the volatile so be sure */
 
-	/* Send the command */
-	while(!(inb(ioaddr+HOST_STATUS)&HOST_STATUS_CRR));
-	outb(1<<6, ioaddr+HOST_CMD);	
-
-	save_flags(flags);
-	cli();
+	mc32_ready_poll(dev);
+	outb(1<<6, ioaddr+HOST_CMD);
 
-	while(lp->exec_pending!=2)
-		sleep_on(&lp->event);
-	lp->exec_pending=0;
-	restore_flags(flags);
+	wait_for_completion(&lp->execution_cmd);
 	
 	if(lp->exec_box->mbox&(1<<13))
 		ret = -1;
 
+	up(&lp->cmd_mutex);
+
 	/*
-	 *	A multicast set got blocked - do it now
-	 */
-		
+	 *	A multicast set got blocked - try it now
+         */
+
 	if(lp->mc_reload_wait)
 	{
 		mc32_reset_multicast_list(dev);
@@ -678,11 +657,9 @@
  *	This may be called from the interrupt state, where it is used
  *	to restart the rx ring if the card runs out of rx buffers. 
  *	
- * 	First, we check if it's ok to start the transceiver. We then show
- * 	the card where to start in the rx ring and issue the
- * 	commands to start reception and transmission. We don't wait
- * 	around for these to complete.
- */ 
+ * 	We must first check if it's ok to (re)start the transceiver. See
+ *      mc32_close for details.
+ */
 
 static void mc32_start_transceiver(struct net_device *dev) {
 
@@ -690,24 +667,20 @@
 	int ioaddr = dev->base_addr;
 
 	/* Ignore RX overflow on device closure */ 
-	if (lp->desired_state==HALTED)  
+	if (lp->xceiver_desired_state==HALTED)
 		return; 
 
+	/* Give the card the offset to the post-EOL-bit RX descriptor */
 	mc32_ready_poll(dev); 
-
-	lp->tx_box->mbox=0;
 	lp->rx_box->mbox=0;
-
-	/* Give the card the offset to the post-EOL-bit RX descriptor */ 
 	lp->rx_box->data[0]=lp->rx_ring[prev_rx(lp->rx_ring_tail)].p->next; 
-
 	outb(HOST_CMD_START_RX, ioaddr+HOST_CMD);      
 
 	mc32_ready_poll(dev); 
+	lp->tx_box->mbox=0;
 	outb(HOST_CMD_RESTRT_TX, ioaddr+HOST_CMD);   /* card ignores this on RX restart */ 
 	
 	/* We are not interrupted on start completion */ 
-	lp->xceiver_state=RUNNING; 
 }
 
 
@@ -727,25 +700,17 @@
 {
 	struct mc32_local *lp = (struct mc32_local *)dev->priv;
 	int ioaddr = dev->base_addr;
-	unsigned long flags;
 
 	mc32_ready_poll(dev);	
-
-	lp->tx_box->mbox=0;
 	lp->rx_box->mbox=0;
-
 	outb(HOST_CMD_SUSPND_RX, ioaddr+HOST_CMD);			
+	wait_for_completion(&lp->xceiver_cmd);
+
 	mc32_ready_poll(dev); 
+	lp->tx_box->mbox=0;
 	outb(HOST_CMD_SUSPND_TX, ioaddr+HOST_CMD);	
-		
-	save_flags(flags);
-	cli();
-		
-	while(lp->xceiver_state!=HALTED) 
-		sleep_on(&lp->event); 
-		
-	restore_flags(flags);	
-} 
+	wait_for_completion(&lp->xceiver_cmd);
+}
 
 
 /**
@@ -756,7 +721,7 @@
  *	the point where mc32_start_transceiver() can be called.
  *
  *	The card sets up the receive ring for us. We are required to use the
- *	ring it provides although we can change the size of the ring.
+ *	ring it provides, although the size of the ring is configurable.
  *
  * 	We allocate an sk_buff for each ring entry in turn and
  * 	initalise its house-keeping info. At the same time, we read
@@ -777,7 +742,7 @@
 	
 	rx_base=lp->rx_chain;
 
-	for(i=0;i<RX_RING_LEN;i++)
+	for(i=0; i<RX_RING_LEN; i++)
 	{
 		lp->rx_ring[i].skb=alloc_skb(1532, GFP_KERNEL);
 		skb_reserve(lp->rx_ring[i].skb, 18);  
@@ -814,21 +779,19 @@
  *
  *	Free the buffer for each ring slot. This may be called 
  *      before mc32_load_rx_ring(), eg. on error in mc32_open().
+ *      Requires rx skb pointers to point to a valid skb, or NULL.
  */
 
 static void mc32_flush_rx_ring(struct net_device *dev)
 {
 	struct mc32_local *lp = (struct mc32_local *)dev->priv;
-	
-	struct sk_buff *skb;
 	int i; 
 
 	for(i=0; i < RX_RING_LEN; i++) 
 	{ 
-		skb = lp->rx_ring[i].skb;
-		if (skb!=NULL) {
-			kfree_skb(skb);
-			skb=NULL; 
+		if (lp->rx_ring[i].skb) {
+			dev_kfree_skb(lp->rx_ring[i].skb);
+			lp->rx_ring[i].skb = NULL;
 		}
 		lp->rx_ring[i].p=NULL; 
 	} 
@@ -860,7 +823,7 @@
 
 	tx_base=lp->tx_box->data[0]; 
 
-	for(i=0;i<lp->tx_len;i++) 
+	for(i=0 ; i<TX_RING_LEN ; i++)
 	{
 		p=isa_bus_to_virt(lp->base+tx_base);
 		lp->tx_ring[i].p=p; 
@@ -869,11 +832,12 @@
 		tx_base=p->next;
 	}
 
-	/* -1 so that tx_ring_head cannot "lap" tx_ring_tail,           */
-	/* which would be bad news for mc32_tx_ring as cur. implemented */ 
+	/* -1 so that tx_ring_head cannot "lap" tx_ring_tail */
+	/* see mc32_tx_ring */
 
 	atomic_set(&lp->tx_count, TX_RING_LEN-1); 
-	lp->tx_ring_head=lp->tx_ring_tail=0; 
+	atomic_set(&lp->tx_ring_head, 0); 
+	lp->tx_ring_tail=0; 
 } 
 
 
@@ -881,47 +845,29 @@
  *	mc32_flush_tx_ring 	-	free transmit ring
  *	@lp: Local data of 3c527 to flush the tx ring of
  *
- *	We have to consider two cases here. We want to free the pending
- *	buffers only. If the ring buffer head is past the start then the
- *	ring segment we wish to free wraps through zero. The tx ring 
- *	house-keeping variables are then reset.
+ *      If the ring is non-empty, zip over the it, freeing any
+ *      allocated skb_buffs.  The tx ring house-keeping variables are
+ *      then reset. Requires rx skb pointers to point to a valid skb,
+ *      or NULL.
  */
 
 static void mc32_flush_tx_ring(struct net_device *dev)
 {
 	struct mc32_local *lp = (struct mc32_local *)dev->priv;
-	
-	if(lp->tx_ring_tail!=lp->tx_ring_head)
+	int i;
+
+	for (i=0; i < TX_RING_LEN; i++)
 	{
-		int i;	
-		if(lp->tx_ring_tail < lp->tx_ring_head)
+		if (lp->tx_ring[i].skb)
 		{
-			for(i=lp->tx_ring_tail;i<lp->tx_ring_head;i++)
-			{
-				dev_kfree_skb(lp->tx_ring[i].skb);
-				lp->tx_ring[i].skb=NULL;
-				lp->tx_ring[i].p=NULL; 
-			}
-		}
-		else
-		{
-			for(i=lp->tx_ring_tail; i<TX_RING_LEN; i++) 
-			{
-				dev_kfree_skb(lp->tx_ring[i].skb);
-				lp->tx_ring[i].skb=NULL;
-				lp->tx_ring[i].p=NULL; 
-			}
-			for(i=0; i<lp->tx_ring_head; i++) 
-			{
-				dev_kfree_skb(lp->tx_ring[i].skb);
-				lp->tx_ring[i].skb=NULL;
-				lp->tx_ring[i].p=NULL; 
-			}
+			dev_kfree_skb(lp->tx_ring[i].skb);
+			lp->tx_ring[i].skb = NULL;
 		}
 	}
-	
+
 	atomic_set(&lp->tx_count, 0); 
-	lp->tx_ring_tail=lp->tx_ring_head=0;
+	atomic_set(&lp->tx_ring_head, 0); 
+	lp->tx_ring_tail=0;
 }
  	
 
@@ -958,6 +904,12 @@
 	regs|=HOST_CTRL_INTE;
 	outb(regs, ioaddr+HOST_CTRL);
 	
+	/*
+	 *      Allow ourselves to issue commands
+	 */
+
+	up(&lp->cmd_mutex);
+
 
 	/*
 	 *	Send the indications on command
@@ -1010,7 +962,7 @@
 		return -ENOBUFS;
 	}
 
-	lp->desired_state = RUNNING; 
+	lp->xceiver_desired_state = RUNNING;
 	
 	/* And finally, set the ball rolling... */
 	mc32_start_transceiver(dev);
@@ -1047,61 +999,64 @@
  *	Transmit a buffer. This normally means throwing the buffer onto
  *	the transmit queue as the queue is quite large. If the queue is
  *	full then we set tx_busy and return. Once the interrupt handler
- *	gets messages telling it to reclaim transmit queue entries we will
+ *	gets messages telling it to reclaim transmit queue entries, we will
  *	clear tx_busy and the kernel will start calling this again.
  *
- *	We use cli rather than spinlocks. Since I have no access to an SMP
- *	MCA machine I don't plan to change it. It is probably the top 
- *	performance hit for this driver on SMP however.
+ *      We do not disable interrupts or acquire any locks; this can
+ *      run concurrently with mc32_tx_ring(), and the function itself
+ *      is serialised at a higher layer. However, similarly for the
+ *      card itself, we must ensure that we update tx_ring_head only
+ *      after we've established a valid packet on the tx ring (and
+ *      before we let the card "see" it, to prevent it racing with the
+ *      irq handler).
+ * 
  */
 
 static int mc32_send_packet(struct sk_buff *skb, struct net_device *dev)
 {
 	struct mc32_local *lp = (struct mc32_local *)dev->priv;
-	unsigned long flags;
-
+	u32 head = atomic_read(&lp->tx_ring_head);
+	
 	volatile struct skb_header *p, *np;
 
 	netif_stop_queue(dev);
 
-	save_flags(flags);
-	cli();
-		
-	if(atomic_read(&lp->tx_count)==0)
-	{
-		restore_flags(flags);
+	if(atomic_read(&lp->tx_count)==0) {
 		return 1;
 	}
 
+	skb = skb_padto(skb, ETH_ZLEN);
+	if (skb == NULL) {
+		netif_wake_queue(dev);
+		return 0;
+	}
+
 	atomic_dec(&lp->tx_count); 
 
 	/* P is the last sending/sent buffer as a pointer */
-	p=lp->tx_ring[lp->tx_ring_head].p; 
+	p=lp->tx_ring[head].p;
 		
-	lp->tx_ring_head=next_tx(lp->tx_ring_head); 
+	head = next_tx(head);
 
 	/* NP is the buffer we will be loading */
-	np=lp->tx_ring[lp->tx_ring_head].p; 
-
-   	if (skb->len < ETH_ZLEN) {
-   		skb = skb_padto(skb, ETH_ZLEN);
-   		if (skb == NULL)
-   			goto out;
-   	}
-
+	np=lp->tx_ring[head].p; 
+	
 	/* We will need this to flush the buffer out */
-	lp->tx_ring[lp->tx_ring_head].skb = skb;
-   	   
-	np->length = (skb->len < ETH_ZLEN) ? ETH_ZLEN : skb->len; 
-			
+	lp->tx_ring[head].skb=skb;
+
+	np->length      = unlikely(skb->len < ETH_ZLEN) ? ETH_ZLEN : skb->len;			
 	np->data	= isa_virt_to_bus(skb->data);
 	np->status	= 0;
 	np->control     = CONTROL_EOP | CONTROL_EOL;     
 	wmb();
 		
-	p->control     &= ~CONTROL_EOL;     /* Clear EOL on p */ 
-out:	
-	restore_flags(flags);
+	/*
+	 * The new frame has been setup; we can now
+	 * let the interrupt handler and card "see" it
+	 */
+
+	atomic_set(&lp->tx_ring_head, head); 
+	p->control     &= ~CONTROL_EOL;
 
 	netif_wake_queue(dev);
 	return 0;
@@ -1182,10 +1137,11 @@
 {
 	struct mc32_local *lp=dev->priv;		
 	volatile struct skb_header *p;
-	u16 rx_ring_tail = lp->rx_ring_tail;
-	u16 rx_old_tail = rx_ring_tail; 
-
+	u16 rx_ring_tail;
+	u16 rx_old_tail;
 	int x=0;
+
+	rx_old_tail = rx_ring_tail = lp->rx_ring_tail;
 	
 	do
 	{ 
@@ -1275,9 +1231,14 @@
 	struct mc32_local *lp=(struct mc32_local *)dev->priv;
 	volatile struct skb_header *np;
 
-	/* NB: lp->tx_count=TX_RING_LEN-1 so that tx_ring_head cannot "lap" tail here */
+	/*
+	 * We rely on head==tail to mean 'queue empty'.
+	 * This is why lp->tx_count=TX_RING_LEN-1: in order to prevent
+	 * tx_ring_head wrapping to tail and confusing a 'queue empty'
+	 * condition with 'queue full'
+	 */
 
-	while (lp->tx_ring_tail != lp->tx_ring_head)  
+	while (lp->tx_ring_tail != atomic_read(&lp->tx_ring_head))  
 	{   
 		u16 t; 
 
@@ -1388,8 +1349,7 @@
 				break;
 			case 3: /* Halt */
 			case 4: /* Abort */
-				lp->xceiver_state |= TX_HALTED; 
-				wake_up(&lp->event);
+				complete(&lp->xceiver_cmd);
 				break;
 			default:
 				printk("%s: strange tx ack %d\n", dev->name, status&7);
@@ -1404,8 +1364,7 @@
 				break;
 			case 3: /* Halt */
 			case 4: /* Abort */
-				lp->xceiver_state |= RX_HALTED;
-				wake_up(&lp->event);
+				complete(&lp->xceiver_cmd);
 				break;
 			case 6:
 				/* Out of RX buffers stat */
@@ -1421,26 +1380,17 @@
 		status>>=3;
 		if(status&1)
 		{
-
-			/* 0=no 1=yes 2=replied, get cmd, 3 = wait reply & dump it */
-			
-			if(lp->exec_pending!=3) {
-				lp->exec_pending=2;
-				wake_up(&lp->event);
-			}
-			else 
-			{				
-			  	lp->exec_pending=0;
-
-				/* A new multicast set may have been
-				   blocked while the old one was
-				   running. If so, do it now. */
+			/*
+			 * No thread is waiting: we need to tidy
+			 * up ourself.
+			 */
 				   
+			if (lp->cmd_nonblocking) {
+				up(&lp->cmd_mutex);
 				if (lp->mc_reload_wait) 
 					mc32_reset_multicast_list(dev);
-				else 
-					wake_up(&lp->event);			       
 			}
+			else complete(&lp->execution_cmd);
 		}
 		if(status&2)
 		{
@@ -1493,12 +1443,12 @@
 static int mc32_close(struct net_device *dev)
 {
 	struct mc32_local *lp = (struct mc32_local *)dev->priv;
-
 	int ioaddr = dev->base_addr;
+
 	u8 regs;
 	u16 one=1;
 	
-	lp->desired_state = HALTED;
+	lp->xceiver_desired_state = HALTED;
 	netif_stop_queue(dev);
 
 	/*
@@ -1511,11 +1461,10 @@
 
 	mc32_halt_transceiver(dev); 
 	
-	/* Catch any waiting commands */
+	/* Ensure we issue no more commands beyond this point */
+
+	down(&lp->cmd_mutex);
 	
-	while(lp->exec_pending==1)
-		sleep_on(&lp->event);
-	       
 	/* Ok the card is now stopping */	
 	
 	regs=inb(ioaddr+HOST_CTRL);
@@ -1542,12 +1491,9 @@
 
 static struct net_device_stats *mc32_get_stats(struct net_device *dev)
 {
-	struct mc32_local *lp;
+	struct mc32_local *lp = (struct mc32_local *)dev->priv;
 	
 	mc32_update_stats(dev); 
-
-	lp = (struct mc32_local *)dev->priv;
-
 	return &lp->net_stats;
 }
 
diff -Nru a/drivers/net/3c527.h b/drivers/net/3c527.h
--- a/drivers/net/3c527.h	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/3c527.h	Tue Feb  3 19:45:16 2004
@@ -27,10 +27,8 @@
 
 #define HOST_RAMPAGE		8
 
-#define RX_HALTED (1<<0)
-#define TX_HALTED (1<<1)  
-#define HALTED (RX_HALTED | TX_HALTED)
-#define RUNNING 0
+#define HALTED 0
+#define RUNNING 1
 
 struct mc32_mailbox
 {
diff -Nru a/drivers/net/3c59x.c b/drivers/net/3c59x.c
--- a/drivers/net/3c59x.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/3c59x.c	Tue Feb  3 19:45:16 2004
@@ -211,11 +211,11 @@
 /* Set the copy breakpoint for the copy-only-tiny-frames scheme.
    Setting to > 1512 effectively disables this feature. */
 #ifndef __arm__
-static const int rx_copybreak = 200;
+static int rx_copybreak = 200;
 #else
 /* ARM systems perform better by disregarding the bus-master
    transfer capability of these cards. -- rmk */
-static const int rx_copybreak = 1513;
+static int rx_copybreak = 1513;
 #endif
 /* Allow setting MTU to a larger size, bypassing the normal ethernet setup. */
 static const int mtu = 1500;
diff -Nru a/drivers/net/68360enet.c b/drivers/net/68360enet.c
--- a/drivers/net/68360enet.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,951 +0,0 @@
-/*
- * Ethernet driver for Motorola MPC8xx.
- * Copyright (c) 2000 Michael Leslie <mleslie@lineo.com>
- * Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
- *
- * I copied the basic skeleton from the lance driver, because I did not
- * know how to write the Linux driver, but I did know how the LANCE worked.
- *
- * This version of the driver is somewhat selectable for the different
- * processor/board combinations.  It works for the boards I know about
- * now, and should be easily modified to include others.  Some of the
- * configuration information is contained in "commproc.h" and the
- * remainder is here.
- *
- * Buffer descriptors are kept in the CPM dual port RAM, and the frame
- * buffers are in the host memory.
- *
- * Right now, I am very watseful with the buffers.  I allocate memory
- * pages and then divide them into 2K frame buffers.  This way I know I
- * have buffers large enough to hold one frame within one buffer descriptor.
- * Once I get this working, I will use 64 or 128 byte CPM buffers, which
- * will be much more memory efficient and will easily handle lots of
- * small packets.
- *
- */
-#include <linux/config.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/ptrace.h>
-#include <linux/errno.h>
-#include <linux/ioport.h>
-#include <linux/interrupt.h>
-#include <linux/pci.h>
-#include <linux/init.h>
-#include <linux/delay.h>
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
-#include <linux/skbuff.h>
-#include <linux/spinlock.h> 
-
-#include <asm/irq.h>
-#include <asm/m68360.h>
-/* #include <asm/8xx_immap.h> */
-/* #include <asm/pgtable.h> */
-/* #include <asm/mpc8xx.h> */
-#include <asm/bitops.h>
-/* #include <asm/uaccess.h> */
-#include <asm/commproc.h>
-
-
-/*
- *				Theory of Operation
- *
- * The MPC8xx CPM performs the Ethernet processing on SCC1.  It can use
- * an aribtrary number of buffers on byte boundaries, but must have at
- * least two receive buffers to prevent constant overrun conditions.
- *
- * The buffer descriptors are allocated from the CPM dual port memory
- * with the data buffers allocated from host memory, just like all other
- * serial communication protocols.  The host memory buffers are allocated
- * from the free page pool, and then divided into smaller receive and
- * transmit buffers.  The size of the buffers should be a power of two,
- * since that nicely divides the page.  This creates a ring buffer
- * structure similar to the LANCE and other controllers.
- *
- * Like the LANCE driver:
- * The driver runs as two independent, single-threaded flows of control.  One
- * is the send-packet routine, which enforces single-threaded use by the
- * cep->tx_busy flag.  The other thread is the interrupt handler, which is
- * single threaded by the hardware and other software.
- *
- * The send packet thread has partial control over the Tx ring and the
- * 'cep->tx_busy' flag.  It sets the tx_busy flag whenever it's queuing a Tx
- * packet. If the next queue slot is empty, it clears the tx_busy flag when
- * finished otherwise it sets the 'lp->tx_full' flag.
- *
- * The MBX has a control register external to the MPC8xx that has some
- * control of the Ethernet interface.  Information is in the manual for
- * your board.
- *
- * The RPX boards have an external control/status register.  Consult the
- * programming documents for details unique to your board.
- *
- * For the TQM8xx(L) modules, there is no control register interface.
- * All functions are directly controlled using I/O pins.  See commproc.h.
- */
-
-
-/* The transmitter timeout
- */
-#define TX_TIMEOUT	(2*HZ)
-
-/* The number of Tx and Rx buffers.  These are allocated statically here.
- * We don't need to allocate pages for the transmitter.  We just use
- * the skbuffer directly.
- */
-#ifdef CONFIG_ENET_BIG_BUFFERS
-#define RX_RING_SIZE		64
-#define TX_RING_SIZE		64	/* Must be power of two */
-#define TX_RING_MOD_MASK	63	/*   for this to work */
-#else
-#define RX_RING_SIZE		8
-#define TX_RING_SIZE		8	/* Must be power of two */
-#define TX_RING_MOD_MASK	7	/*   for this to work */
-#endif
-
-#define CPM_ENET_RX_FRSIZE  2048 /* overkill left over from ppc page-based allocation */
-static char rx_buf_pool[RX_RING_SIZE * CPM_ENET_RX_FRSIZE];
-
-
-/* The CPM stores dest/src/type, data, and checksum for receive packets.
- */
-#define PKT_MAXBUF_SIZE		1518
-#define PKT_MINBUF_SIZE		64
-#define PKT_MAXBLR_SIZE		1520
-
-/* The CPM buffer descriptors track the ring buffers.  The rx_bd_base and
- * tx_bd_base always point to the base of the buffer descriptors.  The
- * cur_rx and cur_tx point to the currently available buffer.
- * The dirty_tx tracks the current buffer that is being sent by the
- * controller.  The cur_tx and dirty_tx are equal under both completely
- * empty and completely full conditions.  The empty/ready indicator in
- * the buffer descriptor determines the actual condition.
- */
-struct scc_enet_private {
-	/* The saved address of a sent-in-place packet/buffer, for skfree(). */
-	struct	sk_buff* tx_skbuff[TX_RING_SIZE];
-	ushort	skb_cur;
-	ushort	skb_dirty;
-
-	/* CPM dual port RAM relative addresses.
-	*/
-	QUICC_BD	*rx_bd_base;		/* Address of Rx and Tx buffers. */
-	QUICC_BD	*tx_bd_base;
-	QUICC_BD	*cur_rx, *cur_tx;		/* The next free ring entry */
-	QUICC_BD	*dirty_tx;	/* The ring entries to be free()ed. */
-	volatile struct scc_regs	*sccp;
-	/* struct	net_device_stats stats; */
-	struct	net_device_stats stats;
-	uint	tx_full;
-	/* spinlock_t lock; */
-	volatile unsigned int lock;
-};
-
-
-
-static int scc_enet_open(struct net_device *dev);
-static int scc_enet_start_xmit(struct sk_buff *skb, struct net_device *dev);
-static int scc_enet_rx(struct net_device *dev);
-static irqreturn_t scc_enet_interrupt(int vec, void *dev_id, struct pt_regs *fp);
-static int scc_enet_close(struct net_device *dev);
-/* static struct net_device_stats *scc_enet_get_stats(struct net_device *dev); */
-static struct net_device_stats *scc_enet_get_stats(struct net_device *dev);
-static void set_multicast_list(struct net_device *dev);
-
-/* Get this from various configuration locations (depends on board).
-*/
-/*static	ushort	my_enet_addr[] = { 0x0800, 0x3e26, 0x1559 };*/
-
-/* Typically, 860(T) boards use SCC1 for Ethernet, and other 8xx boards
- * use SCC2.  This is easily extended if necessary.
- */
-
-#define CONFIG_SCC1_ENET /* by default */
-
-#ifdef CONFIG_SCC1_ENET
-#define CPM_CR_ENET CPM_CR_CH_SCC1
-#define PROFF_ENET	PROFF_SCC1
-#define SCC_ENET	0
-#define CPMVEC_ENET	CPMVEC_SCC1
-#endif
-
-#ifdef CONFIG_SCC2_ENET
-#define CPM_CR_ENET	CPM_CR_CH_SCC2
-#define PROFF_ENET	PROFF_SCC2
-#define SCC_ENET	1		/* Index, not number! */
-#define CPMVEC_ENET	CPMVEC_SCC2
-#endif
-
-static int
-scc_enet_open(struct net_device *dev)
-{
-
-	/* I should reset the ring buffers here, but I don't yet know
-	 * a simple way to do that.
-	 * mleslie: That's no biggie. Worth doing, too.
-	 */
-
-	/* netif_start_queue(dev); */
-	return 0;					/* Always succeed */
-}
-
-
-static int
-scc_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
-{
-	struct scc_enet_private *cep = (struct scc_enet_private *)dev->priv;
-	volatile QUICC_BD	*bdp;
-
-	/* Fill in a Tx ring entry */
-	bdp = cep->cur_tx;
-
-#ifndef final_version
-	if (bdp->status & BD_ENET_TX_READY) {
-		/* Ooops.  All transmit buffers are full.  Bail out.
-		 * This should not happen, since cep->tx_busy should be set.
-		 */
-		printk("%s: tx queue full!.\n", dev->name);
-		return 1;
-	}
-#endif
-
-	/* Clear all of the status flags.
-	 */
-	bdp->status &= ~BD_ENET_TX_STATS;
-
-	/* If the frame is short, tell CPM to pad it.
-	*/
-	if (skb->len <= ETH_ZLEN)
-		bdp->status |= BD_ENET_TX_PAD;
-	else
-		bdp->status &= ~BD_ENET_TX_PAD;
-
-	/* Set buffer length and buffer pointer.
-	*/
-	bdp->length = skb->len;
-	/* bdp->buf = __pa(skb->data); */
-	bdp->buf = skb->data;
-
-	/* Save skb pointer.
-	*/
-	cep->tx_skbuff[cep->skb_cur] = skb;
-
-	/* cep->stats.tx_bytes += skb->len; */ /* TODO: It would really be nice... */
-
-	cep->skb_cur = (cep->skb_cur+1) & TX_RING_MOD_MASK;
-	
-
-	/* Push the data cache so the CPM does not get stale memory
-	 * data.
-	 */
-/* 	flush_dcache_range((unsigned long)(skb->data), */
-/* 					(unsigned long)(skb->data + skb->len)); */
-
-	/* spin_lock_irq(&cep->lock); */ /* TODO: SPINLOCK */
-	local_irq_disable();
-	if (cep->lock > 0) {
-		printk ("scc_enet_start_xmit() lock == %d\n", cep->lock);
-	} else {
-		cep->lock++;
-	}
-
-	/* Send it on its way.  Tell CPM its ready, interrupt when done,
-	 * its the last BD of the frame, and to put the CRC on the end.
-	 */
-	bdp->status |= (BD_ENET_TX_READY | BD_ENET_TX_INTR | BD_ENET_TX_LAST | BD_ENET_TX_TC);
-
-	dev->trans_start = jiffies;
-
-	/* If this was the last BD in the ring, start at the beginning again.
-	*/
-	if (bdp->status & BD_ENET_TX_WRAP)
-		bdp = cep->tx_bd_base;
-	else
-		bdp++;
-
-	if (bdp->status & BD_ENET_TX_READY) {
-		/* netif_stop_queue(dev); */
-		cep->tx_full = 1;
-	}
-
-	cep->cur_tx = (QUICC_BD *)bdp;
-
-	/* spin_unlock_irq(&cep->lock); */ /* TODO: SPINLOCK */
-	cep->lock--;
-	sti();
-
-	return 0;
-}
-
-#if 0
-static void
-scc_enet_timeout(struct net_device *dev)
-{
-	struct scc_enet_private *cep = (struct scc_enet_private *)dev->priv;
-
-	printk("%s: transmit timed out.\n", dev->name);
-	cep->stats.tx_errors++;
-#ifndef final_version
-	{
-		int	i;
-		QUICC_BD	*bdp;
-		printk(" Ring data dump: cur_tx %p%s cur_rx %p.\n",
-		       cep->cur_tx, cep->tx_full ? " (full)" : "",
-		       cep->cur_rx);
-		bdp = cep->tx_bd_base;
-		for (i = 0 ; i < TX_RING_SIZE; i++, bdp++)
-			printk("%04x %04x %08x\n",
-			       bdp->status,
-			       bdp->length,
-			       (int)(bdp->buf));
-		bdp = cep->rx_bd_base;
-		for (i = 0 ; i < RX_RING_SIZE; i++, bdp++)
-			printk("%04x %04x %08x\n",
-			       bdp->status,
-			       bdp->length,
-			       (int)(bdp->buf));
-	}
-#endif
-/* 	if (!cep->tx_full) */
-/* 		netif_wake_queue(dev); */
-}
-#endif
-
-/* The interrupt handler.
- * This is called from the CPM handler, not the MPC core interrupt.
- */
-static irqreturn_t scc_enet_interrupt(int vec, void *dev_id, struct pt_regs *fp)
-{
-	struct	net_device *dev = (struct net_device *)dev_id;
-	volatile struct	scc_enet_private *cep;
-	volatile QUICC_BD	*bdp;
-	ushort	int_events;
-	int	must_restart;
-
-	cep = (struct scc_enet_private *)dev->priv;
-
-	/* Get the interrupt events that caused us to be here.
-	*/
-	int_events = cep->sccp->scc_scce;
-	cep->sccp->scc_scce = int_events;
-	must_restart = 0;
-
-	/* Handle receive event in its own function.
-	*/
-	if (int_events & SCCE_ENET_RXF)
-		scc_enet_rx(dev_id);
-
-	/* Check for a transmit error.  The manual is a little unclear
-	 * about this, so the debug code until I get it figured out.  It
-	 * appears that if TXE is set, then TXB is not set.  However,
-	 * if carrier sense is lost during frame transmission, the TXE
-	 * bit is set, "and continues the buffer transmission normally."
-	 * I don't know if "normally" implies TXB is set when the buffer
-	 * descriptor is closed.....trial and error :-).
-	 */
-
-	/* Transmit OK, or non-fatal error.  Update the buffer descriptors.
-	*/
-	if (int_events & (SCCE_ENET_TXE | SCCE_ENET_TXB)) {
-	    /* spin_lock(&cep->lock); */ /* TODO: SPINLOCK */
-		/* local_irq_disable(); */
-		if (cep->lock > 0) {
-			printk ("scc_enet_interrupt() lock == %d\n", cep->lock);
-		} else {
-			cep->lock++;
-		}
-
-	    bdp = cep->dirty_tx;
-	    while ((bdp->status&BD_ENET_TX_READY)==0) {
-		if ((bdp==cep->cur_tx) && (cep->tx_full == 0))
-		    break;
-
-		if (bdp->status & BD_ENET_TX_HB)	/* No heartbeat */
-			cep->stats.tx_heartbeat_errors++;
-		if (bdp->status & BD_ENET_TX_LC)	/* Late collision */
-			cep->stats.tx_window_errors++;
-		if (bdp->status & BD_ENET_TX_RL)	/* Retrans limit */
-			cep->stats.tx_aborted_errors++;
-		if (bdp->status & BD_ENET_TX_UN)	/* Underrun */
-			cep->stats.tx_fifo_errors++;
-		if (bdp->status & BD_ENET_TX_CSL)	/* Carrier lost */
-			cep->stats.tx_carrier_errors++;
-
-
-		/* No heartbeat or Lost carrier are not really bad errors.
-		 * The others require a restart transmit command.
-		 */
-		if (bdp->status &
-		    (BD_ENET_TX_LC | BD_ENET_TX_RL | BD_ENET_TX_UN)) {
-			must_restart = 1;
-			cep->stats.tx_errors++;
-		}
-
-		cep->stats.tx_packets++;
-
-		/* Deferred means some collisions occurred during transmit,
-		 * but we eventually sent the packet OK.
-		 */
-		if (bdp->status & BD_ENET_TX_DEF)
-			cep->stats.collisions++;
-
-		/* Free the sk buffer associated with this last transmit.
-		*/
-		/* dev_kfree_skb_irq(cep->tx_skbuff[cep->skb_dirty]); */
-		dev_kfree_skb (cep->tx_skbuff[cep->skb_dirty]);
-		cep->skb_dirty = (cep->skb_dirty + 1) & TX_RING_MOD_MASK;
-
-		/* Update pointer to next buffer descriptor to be transmitted.
-		*/
-		if (bdp->status & BD_ENET_TX_WRAP)
-			bdp = cep->tx_bd_base;
-		else
-			bdp++;
-
-		/* I don't know if we can be held off from processing these
-		 * interrupts for more than one frame time.  I really hope
-		 * not.  In such a case, we would now want to check the
-		 * currently available BD (cur_tx) and determine if any
-		 * buffers between the dirty_tx and cur_tx have also been
-		 * sent.  We would want to process anything in between that
-		 * does not have BD_ENET_TX_READY set.
-		 */
-
-		/* Since we have freed up a buffer, the ring is no longer
-		 * full.
-		 */
-		if (cep->tx_full) {
-			cep->tx_full = 0;
-/* 			if (netif_queue_stopped(dev)) */
-/* 				netif_wake_queue(dev); */
-		}
-
-		cep->dirty_tx = (QUICC_BD *)bdp;
-	    }
-
-	    if (must_restart) {
-			volatile QUICC *cp;
-
-		/* Some transmit errors cause the transmitter to shut
-		 * down.  We now issue a restart transmit.  Since the
-		 * errors close the BD and update the pointers, the restart
-		 * _should_ pick up without having to reset any of our
-		 * pointers either.
-		 */
-		cp = pquicc;
-		cp->cp_cr =
-		    mk_cr_cmd(CPM_CR_ENET, CPM_CR_RESTART_TX) | CPM_CR_FLG;
-		while (cp->cp_cr & CPM_CR_FLG);
-	    }
-	    /* spin_unlock(&cep->lock); */ /* TODO: SPINLOCK */
-		/* sti(); */
-		cep->lock--;
-	}
-
-	/* Check for receive busy, i.e. packets coming but no place to
-	 * put them.  This "can't happen" because the receive interrupt
-	 * is tossing previous frames.
-	 */
-	if (int_events & SCCE_ENET_BSY) {
-		cep->stats.rx_dropped++;
-		printk("CPM ENET: BSY can't happen.\n");
-	}
-
-	return IRQ_HANDLED;
-}
-
-/* During a receive, the cur_rx points to the current incoming buffer.
- * When we update through the ring, if the next incoming buffer has
- * not been given to the system, we just set the empty indicator,
- * effectively tossing the packet.
- */
-static int
-scc_enet_rx(struct net_device *dev)
-{
-	struct	scc_enet_private *cep;
-	volatile QUICC_BD	*bdp;
-	struct	sk_buff *skb;
-	ushort	pkt_len;
-
-	cep = (struct scc_enet_private *)dev->priv;
-
-	/* First, grab all of the stats for the incoming packet.
-	 * These get messed up if we get called due to a busy condition.
-	 */
-	bdp = cep->cur_rx;
-
-	for (;;) {
-		if (bdp->status & BD_ENET_RX_EMPTY)
-			break;
-		
-#ifndef final_version
-		/* Since we have allocated space to hold a complete frame, both
-		 * the first and last indicators should be set.
-		 */
-		if ((bdp->status & (BD_ENET_RX_FIRST | BD_ENET_RX_LAST)) !=
-			(BD_ENET_RX_FIRST | BD_ENET_RX_LAST))
-			printk("CPM ENET: rcv is not first+last\n");
-#endif
-
-		/* Frame too long or too short.
-		 */
-		if (bdp->status & (BD_ENET_RX_LG | BD_ENET_RX_SH))
-			cep->stats.rx_length_errors++;
-		if (bdp->status & BD_ENET_RX_NO)	/* Frame alignment */
-			cep->stats.rx_frame_errors++;
-		if (bdp->status & BD_ENET_RX_CR)	/* CRC Error */
-			cep->stats.rx_crc_errors++;
-		if (bdp->status & BD_ENET_RX_OV)	/* FIFO overrun */
-			cep->stats.rx_crc_errors++;
-
-		/* Report late collisions as a frame error.
-		 * On this error, the BD is closed, but we don't know what we
-		 * have in the buffer.  So, just drop this frame on the floor.
-		 */
-		if (bdp->status & BD_ENET_RX_CL) {
-			cep->stats.rx_frame_errors++;
-		}
-		else {
-			
-			/* Process the incoming frame.
-			 */
-			cep->stats.rx_packets++;
-			pkt_len = bdp->length;
-			/* cep->stats.rx_bytes += pkt_len; */  /* TODO: It would really be nice... */
-
-			/* This does 16 byte alignment, much more than we need.
-			 * The packet length includes FCS, but we don't want to
-			 * include that when passing upstream as it messes up
-			 * bridging applications.
-			 */
-			skb = dev_alloc_skb(pkt_len-4);
-
-			if (skb == NULL) {
-				printk("%s: Memory squeeze, dropping packet.\n", dev->name);
-				cep->stats.rx_dropped++;
-			}
-			else {
-				skb->dev = dev;
-				skb_put(skb,pkt_len-4);	/* Make room */
-				eth_copy_and_sum(skb, (unsigned char *)bdp->buf, pkt_len-4, 0);
-				skb->protocol=eth_type_trans(skb,dev);
-				netif_rx(skb);
-			}
-		}
-
-		/* Clear the status flags for this buffer.
-		 */
-		bdp->status &= ~BD_ENET_RX_STATS;
-
-		/* Mark the buffer empty.
-		 */
-		bdp->status |= BD_ENET_RX_EMPTY;
-
-		/* Update BD pointer to next entry.
-		 */
-		if (bdp->status & BD_ENET_RX_WRAP)
-			bdp = cep->rx_bd_base;
-		else
-			bdp++;
-
-	}
-	cep->cur_rx = (QUICC_BD *)bdp;
-
-	return 0;
-}
-
-static int
-scc_enet_close(struct net_device *dev)
-{
-	/* Don't know what to do yet.
-	*/
-	/* netif_stop_queue(dev); */
-
-	return 0;
-}
-
-/* static struct net_device_stats *scc_enet_get_stats(struct net_device *dev) */
-static struct net_device_stats *scc_enet_get_stats(struct net_device *dev)
-{
-	struct scc_enet_private *cep = (struct scc_enet_private *)dev->priv;
-
-	return &cep->stats;
-}
-
-/* Set or clear the multicast filter for this adaptor.
- * Skeleton taken from sunlance driver.
- * The CPM Ethernet implementation allows Multicast as well as individual
- * MAC address filtering.  Some of the drivers check to make sure it is
- * a group multicast address, and discard those that are not.  I guess I
- * will do the same for now, but just remove the test if you want
- * individual filtering as well (do the upper net layers want or support
- * this kind of feature?).
- */
-
-static void set_multicast_list(struct net_device *dev)
-{
-	struct	scc_enet_private *cep;
-	struct	dev_mc_list *dmi;
-	u_char	*mcptr, *tdptr;
-	volatile scc_enet_t *ep;
-	int	i, j;
-	volatile QUICC *cp = pquicc;
-
-	cep = (struct scc_enet_private *)dev->priv;
-
-	/* Get pointer to SCC area in parameter RAM.
-	*/
-	ep = (scc_enet_t *)dev->base_addr;
-
-	if (dev->flags&IFF_PROMISC) {
-	  
-		/* Log any net taps. */
-		printk("%s: Promiscuous mode enabled.\n", dev->name);
-		cep->sccp->scc_psmr |= ETHER_PRO; 
-	} else {
-
-		cep->sccp->scc_psmr &= ~ETHER_PRO;
-
-		if (dev->flags & IFF_ALLMULTI) {
-			/* Catch all multicast addresses, so set the
-			 * filter to all 1's.
-			 */
-			ep->sen_gaddr1 = 0xffff;
-			ep->sen_gaddr2 = 0xffff;
-			ep->sen_gaddr3 = 0xffff;
-			ep->sen_gaddr4 = 0xffff;
-		}
-		else {
-			/* Clear filter and add the addresses in the list.
-			*/
-			ep->sen_gaddr1 = 0;
-			ep->sen_gaddr2 = 0;
-			ep->sen_gaddr3 = 0;
-			ep->sen_gaddr4 = 0;
-
-			dmi = dev->mc_list;
-
-			for (i=0; i<dev->mc_count; i++) {
-				
-				/* Only support group multicast for now.
-				*/
-				if (!(dmi->dmi_addr[0] & 1))
-					continue;
-
-				/* The address in dmi_addr is LSB first,
-				 * and taddr is MSB first.  We have to
-				 * copy bytes MSB first from dmi_addr.
-				 */
-				mcptr = (u_char *)dmi->dmi_addr + 5;
-				tdptr = (u_char *)&ep->sen_taddrh;
-				for (j=0; j<6; j++)
-					*tdptr++ = *mcptr--;
-
-				/* Ask CPM to run CRC and set bit in
-				 * filter mask.
-				 */
-				cp->cp_cr = mk_cr_cmd(CPM_CR_ENET, CPM_CR_SET_GADDR) | CPM_CR_FLG;
-				/* this delay is necessary here -- Cort */
-				udelay(10);
-				while (cp->cp_cr & CPM_CR_FLG);
-			}
-		}
-	}
-}
-
-
-/* Initialize the CPM Ethernet on SCC.
- */
-int scc_enet_init(void)
-{
-	struct net_device *dev;
-	struct scc_enet_private *cep;
-	int i, j;
-	unsigned char	*eap;
-	/* unsigned long	mem_addr; */
-	/* pte_t		*pte; */
-	/* bd_t		*bd; */ /* `board tag' used by ppc - TODO: integrate uC bootloader vars */
-	volatile	QUICC_BD	*bdp;
-	volatile	QUICC	*cp;
-	volatile struct scc_regs	*sccp;
-	volatile struct	ethernet_pram	*ep;
-	/* volatile	immap_t		*immap; */
-
-	cp = pquicc;	/* Get pointer to Communication Processor */
-
-	/* immap = (immap_t *)IMAP_ADDR; */	/* and to internal registers */
-
-	/* bd = (bd_t *)__res; */
-
-	/* Allocate some private information.
-	*/
-	cep = (struct scc_enet_private *)kmalloc(sizeof(*cep), GFP_KERNEL);
-	memset(cep, 0, sizeof(*cep));
-	/* __clear_user(cep,sizeof(*cep)); */
-	/* spin_lock_init(&cep->lock); */ /* TODO: SPINLOCK */
-
-	/* Create an Ethernet device instance.
-	 */
-	dev = init_etherdev(0, 0);
-
-	/* Get pointer to SCC area in parameter RAM.
-	*/
-	/* ep = (ethernet_pram *)(&cp->cp_dparam[PROFF_ENET]); */
-	ep = &pquicc->pram[SCC_ENET].enet_scc;
-
-	/* And another to the SCC register area.
-	*/
-	sccp = &pquicc->scc_regs[SCC_ENET];
-	cep->sccp = sccp;		/* Keep the pointer handy */
-
-	/* Disable receive and transmit in case EPPC-Bug started it.
-	*/
-	sccp->scc_gsmr.w.low &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
-
-	/* Set up 360 pins for SCC interface to ethernet transceiver.
-	 * Pin mappings (PA_xx and PC_xx) are defined in commproc.h
-	 */
-
-	/* Configure port A pins for Txd and Rxd.
-	 */
-	pquicc->pio_papar |= (PA_ENET_RXD | PA_ENET_TXD);
-	pquicc->pio_padir &= ~(PA_ENET_RXD | PA_ENET_TXD);
-	pquicc->pio_paodr &= ~PA_ENET_TXD;
-
-	/* Configure port C pins to enable CLSN and RENA.
-	 */
-	pquicc->pio_pcpar &= ~(PC_ENET_CLSN | PC_ENET_RENA);
-	pquicc->pio_pcdir &= ~(PC_ENET_CLSN | PC_ENET_RENA);
-	pquicc->pio_pcso |= (PC_ENET_CLSN | PC_ENET_RENA);
-
-	/* Configure port A for TCLK and RCLK.
-	*/
-	pquicc->pio_papar |= (PA_ENET_TCLK | PA_ENET_RCLK);
-	pquicc->pio_padir &= ~(PA_ENET_TCLK | PA_ENET_RCLK);
-
-	/* Configure Serial Interface clock routing.
-	 * First, clear all SCC bits to zero, then set the ones we want.
-	 */
-	pquicc->si_sicr &= ~SICR_ENET_MASK;
-	pquicc->si_sicr |= SICR_ENET_CLKRT;
-
-
-	/* Allocate space for the buffer descriptors in the DP ram.
-	 * These are relative offsets in the DP ram address space.
-	 * Initialize base addresses for the buffer descriptors.
-	 */
-	i = m360_cpm_dpalloc(sizeof(QUICC_BD) * RX_RING_SIZE);
-	ep->rbase = i;
-	cep->rx_bd_base = (QUICC_BD *)((uint)pquicc + i);
-
-	i = m360_cpm_dpalloc(sizeof(QUICC_BD) * TX_RING_SIZE);
-	ep->tbase = i;
-	cep->tx_bd_base = (QUICC_BD *)((uint)pquicc + i);
-
-	cep->dirty_tx = cep->cur_tx = cep->tx_bd_base;
-	cep->cur_rx = cep->rx_bd_base;
-
-	/* Issue init Rx BD command for SCC.
-	 * Manual says to perform an Init Rx parameters here.  We have
-	 * to perform both Rx and Tx because the SCC may have been
-	 * already running. [In uCquicc's case, I don't think that is so - mles]
-	 * In addition, we have to do it later because we don't yet have
-	 * all of the BD control/status set properly.
-	cp->cp_cpcr = mk_cr_cmd(CPM_CR_ENET, CPM_CR_INIT_RX) | CPM_CR_FLG;
-	while (cp->cp_cpcr & CPM_CR_FLG);
-	 */
-
-	/* Initialize function code registers for big-endian.
-	*/
-	ep->rfcr = (SCC_EB | SCC_FC_DMA);
-	ep->tfcr = (SCC_EB | SCC_FC_DMA);
-
-	/* Set maximum bytes per receive buffer.
-	 * This appears to be an Ethernet frame size, not the buffer
-	 * fragment size.  It must be a multiple of four.
-	 */
-	ep->mrblr  = PKT_MAXBLR_SIZE;
-
-	/* Set CRC preset and mask.
-	 */
-	ep->c_pres = 0xffffffff;
-	ep->c_mask = 0xdebb20e3; /* see 360UM p. 7-247 */
-
-	ep->crcec  = 0;	/* CRC Error counter */
-	ep->alec   = 0;	/* alignment error counter */
-	ep->disfc  = 0;	/* discard frame counter */
-
-	ep->pads   = 0x8888;	/* Tx short frame pad character */
-	ep->ret_lim = 0x000f;	/* Retry limit threshold */
-
-	ep->mflr   = PKT_MAXBUF_SIZE;	/* maximum frame length register */
-	ep->minflr = PKT_MINBUF_SIZE;	/* minimum frame length register */
-
-	ep->maxd1 = PKT_MAXBLR_SIZE;	/* maximum DMA1 length */
-	ep->maxd2 = PKT_MAXBLR_SIZE;	/* maximum DMA2 length */
-
-	/* Clear hash tables, group and individual.
-	 */
-	ep->gaddr1 = ep->gaddr2 = ep->gaddr3 = ep->gaddr4 = 0;
-	ep->iaddr1 = ep->iaddr2 = ep->iaddr3 = ep->iaddr4 = 0;
-
-	/* Set Ethernet station address.
-	 *
-	 * The uCbootloader provides a hook to the kernel to retrieve
-	 * stuff like the MAC address. This is retrieved in config_BSP()
-	 */
-#if defined (CONFIG_UCQUICC)
-	{
- 		extern unsigned char *scc1_hwaddr;
-
-		eap = (char *)ep->paddr.b;
-		for (i=5; i>=0; i--)
-			*eap++ = dev->dev_addr[i] = scc1_hwaddr[i];
-	}
-#endif
-
-
-/* #ifndef CONFIG_MBX */
-/* 	eap = (unsigned char *)&(ep->paddrh); */
-
-/* 	for (i=5; i>=0; i--) */
-/* 		*eap++ = dev->dev_addr[i] = bd->bi_enetaddr[i]; */
-/* #else */
-/* 	for (i=5; i>=0; i--) */
-/* 		dev->dev_addr[i] = *eap++; */
-/* #endif */
-
-	ep->p_per   = 0;	/* 'cause the book says so */
-	ep->taddr_l = 0;	/* temp address (LSB) */
-	ep->taddr_m = 0;
-	ep->taddr_h = 0;	/* temp address (MSB) */
-
-	/* Now allocate the host memory pages and initialize the
-	 * buffer descriptors.
-	 */
-	/* initialize rx buffer descriptors */
-	bdp = cep->tx_bd_base;
-	for (j=0; j<(TX_RING_SIZE-1); j++) {
-		bdp->buf = 0;
-		bdp->status = 0;
-		bdp++;
-	}
-	bdp->buf = 0;
-	bdp->status = BD_SC_WRAP;
-
-
-	/* initialize rx buffer descriptors */
-	bdp = cep->rx_bd_base;
-	for (j=0; j<(RX_RING_SIZE-1); j++) {
-		bdp->buf = &rx_buf_pool[j * CPM_ENET_RX_FRSIZE];
-		bdp->status = BD_SC_EMPTY | BD_SC_INTRPT;
-		bdp++;
-	}
-	bdp->buf = &rx_buf_pool[j * CPM_ENET_RX_FRSIZE];
-	bdp->status = BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT;
-
-
-
-	/* Let's re-initialize the channel now.  We have to do it later
-	 * than the manual describes because we have just now finished
-	 * the BD initialization.
-	 */
-	cp->cp_cr = mk_cr_cmd(CPM_CR_ENET, CPM_CR_INIT_TRX) | CPM_CR_FLG;
-	while (cp->cp_cr & CPM_CR_FLG);
-
-	cep->skb_cur = cep->skb_dirty = 0;
-
-	sccp->scc_scce = 0xffff;	/* Clear any pending events */
-
-	/* Enable interrupts for transmit error, complete frame
-	 * received, and any transmit buffer we have also set the
-	 * interrupt flag.
-	 */
-	sccp->scc_sccm = (SCCE_ENET_TXE | SCCE_ENET_RXF | SCCE_ENET_TXB);
-
-	/* Install our interrupt handler.
-	 */
-	/* cpm_install_handler(CPMVEC_ENET, scc_enet_interrupt, dev); */
-	request_irq(CPMVEC_ENET, scc_enet_interrupt,
-		IRQ_FLG_LOCK, dev->name, (void *)dev);
-
-	/* Set GSMR_H to enable all normal operating modes.
-	 * Set GSMR_L to enable Ethernet to MC68160.
-	 */
-	sccp->scc_gsmr.w.high = 0;
-	sccp->scc_gsmr.w.low  = (SCC_GSMRL_TCI | SCC_GSMRL_TPL_48 |
-							 SCC_GSMRL_TPP_10 | SCC_GSMRL_MODE_ENET);
-
-	/* Set sync/delimiters.
-	 */
-	sccp->scc_dsr = 0xd555;
-
-	/* Set processing mode.  Use Ethernet CRC, catch broadcast, and
-	 * start frame search 22 bit times after RENA.
-	 */
-	sccp->scc_psmr = (SCC_PMSR_ENCRC       /* Ethernet CRC mode */
-			  /* | SCC_PSMR_HBC */ /* Enable heartbeat */
-			  /* | SCC_PMSR_PRO */ /* Promiscuous mode */
-			  /* | SCC_PMSR_FDE */ /* Full duplex enable */
-			  | ETHER_NIB_22);
-	/* sccp->scc_psmr = (SCC_PMSR_PRO | ETHER_CRC_32 | ETHER_NIB_22); */
-
-
-	/* It is now OK to enable the Ethernet transmitter.
-	 * Unfortunately, there are board implementation differences here.
-	 */
-#if defined(CONFIG_UCQUICC)
-/* 	 immap->im_ioport.iop_pcpar |= PC_ENET_TENA; */
-/* 	 immap->im_ioport.iop_pcdir &= ~PC_ENET_TENA; */
-	 cp->pio_pcpar |=  PC_ENET_TENA; /* t_en */
-	 cp->pio_pcdir &= ~PC_ENET_TENA;
-
-	 cp->pip_pbpar &= ~(0x00000200); /* power up ethernet transceiver */
-	 cp->pip_pbdir |=  (0x00000200);
-	 cp->pip_pbdat |=  (0x00000200);
-#endif
-
-
-	dev->base_addr = (unsigned long)ep;
-	dev->priv = cep;
-#if 0
-	dev->name = "CPM_ENET";
-#endif
-
-	/* The CPM Ethernet specific entries in the device structure. */
-	dev->open = scc_enet_open;
-	dev->hard_start_xmit = scc_enet_start_xmit;
-	/* dev->tx_timeout = scc_enet_timeout; */
-	/* dev->watchdog_timeo = TX_TIMEOUT; */
-	dev->stop = scc_enet_close;
-	dev->get_stats = scc_enet_get_stats;
-	dev->set_multicast_list = set_multicast_list;
-
-	/* And last, enable the transmit and receive processing.
-	*/
-	sccp->scc_gsmr.w.low |= (SCC_GSMRL_ENR | SCC_GSMRL_ENT);
-
-	printk("%s: CPM ENET Version 0.3, ", dev->name);
-	for (i=0; i<5; i++)
-		printk("%02x:", dev->dev_addr[i]);
-	printk("%02x\n", dev->dev_addr[5]);
-
-	return 0;
-}
-
-
-
-int m68360_enet_probe(struct device *dev)
-{
-	return(scc_enet_init ());
-}
-
-
-/*
- * Local variables:
- *  c-indent-level: 4
- *  c-basic-offset: 4
- *  tab-width: 4
- * End:
- */
diff -Nru a/drivers/net/8139cp.c b/drivers/net/8139cp.c
--- a/drivers/net/8139cp.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/8139cp.c	Tue Feb  3 19:45:17 2004
@@ -615,8 +615,10 @@
 		if (cpr16(IntrStatus) & cp_rx_intr_mask)
 			goto rx_status_loop;
 
-		netif_rx_complete(dev);
+		local_irq_disable();
 		cpw16_f(IntrMask, cp_intr_mask);
+		__netif_rx_complete(dev);
+		local_irq_enable();
 
 		return 0;	/* done */
 	}
@@ -643,6 +645,12 @@
 
 	spin_lock(&cp->lock);
 
+	/* close possible race's with dev_close */
+	if (unlikely(!netif_running(dev))) {
+		cpw16(IntrMask, 0);
+		goto out;
+	}
+
 	if (status & (RxOK | RxErr | RxEmpty | RxFIFOOvr)) {
 		if (netif_rx_schedule_prep(dev)) {
 			cpw16_f(IntrMask, cp_norx_intr_mask);
@@ -664,7 +672,7 @@
 
 		/* TODO: reset hardware */
 	}
-
+out:
 	spin_unlock(&cp->lock);
 	return IRQ_HANDLED;
 }
diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig
--- a/drivers/net/Kconfig	Tue Feb  3 19:45:41 2004
+++ b/drivers/net/Kconfig	Tue Feb  3 19:45:41 2004
@@ -657,7 +657,7 @@
 
 config ELMC_II
 	tristate "3c527 \"EtherLink/MC 32\" support (EXPERIMENTAL)"
-	depends on NET_VENDOR_3COM && MCA && EXPERIMENTAL && BROKEN_ON_SMP
+	depends on NET_VENDOR_3COM && MCA && MCA_LEGACY
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
@@ -1283,6 +1283,19 @@
 	  <file:Documentation/networking/net-modules.txt>.  The module will be
 	  called b44.
 
+config FORCEDETH
+	tristate "Reverse Engineered nForce Ethernet support (EXPERIMENTAL)"
+	depends on NET_PCI && PCI && EXPERIMENTAL
+	help
+	  If you have a network (Ethernet) controller of this type, say Y and
+	  read the Ethernet-HOWTO, available from
+	  <http://www.tldp.org/docs.html#howto>.
+
+	  To compile this driver as a module, choose M here and read
+	  <file:Documentation/networking/net-modules.txt>.  The module will be
+	  called forcedeth.
+
+
 config CS89x0
 	tristate "CS89x0 support"
 	depends on NET_PCI && ISA
@@ -1684,7 +1697,7 @@
 	  <file:Documentation/Changes>) and you can say N here.
 
 	  Laptop users should read the Linux Laptop home page at
-	  <http://www.cs.utexas.edu/users/kharker/linux-laptop/>.
+	  <http://www.linux-on-laptops.com/>.
 
 	  Note that the answer to this question doesn't directly affect the
 	  kernel: saying N will just cause the configurator to skip all
@@ -1957,9 +1970,11 @@
 	    - EG1032 v2 Instant Gigabit Network Adapter
 	    - EG1064 v2 Instant Gigabit Network Adapter
 	    - Marvell 88E8001 Gigabit LOM Ethernet Adapter (Abit)
+	    - Marvell 88E8001 Gigabit LOM Ethernet Adapter (Albatron)
 	    - Marvell 88E8001 Gigabit LOM Ethernet Adapter (Asus)
 	    - Marvell 88E8001 Gigabit LOM Ethernet Adapter (ECS)
 	    - Marvell 88E8001 Gigabit LOM Ethernet Adapter (Epox)
+	    - Marvell 88E8001 Gigabit LOM Ethernet Adapter (Foxconn)
 	    - Marvell 88E8001 Gigabit LOM Ethernet Adapter (Gigabyte)
 	    - Marvell 88E8001 Gigabit LOM Ethernet Adapter (Iwill)
 	    - Marvell RDK-8001 Adapter
@@ -2005,8 +2020,10 @@
 	  Questions concerning this driver may be addressed to:
 	      linux@syskonnect.de
 	  
-	  To compile this driver as a module, choose M here: the module
-	  will be called sk98lin.  This is recommended.
+	  If you want to compile this driver as a module ( = code which can be
+	  inserted in and removed from the running kernel whenever you want),
+	  say M here and read Documentation/modules.txt. This is recommended.
+	  The module will be called sk98lin. This is recommended.
 
 config TIGON3
 	tristate "Broadcom Tigon3 support"
diff -Nru a/drivers/net/Makefile b/drivers/net/Makefile
--- a/drivers/net/Makefile	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/Makefile	Tue Feb  3 19:45:17 2004
@@ -95,6 +95,7 @@
 obj-$(CONFIG_NE3210) += ne3210.o 8390.o
 obj-$(CONFIG_NET_SB1250_MAC) += sb1250-mac.o
 obj-$(CONFIG_B44) += b44.o
+obj-$(CONFIG_FORCEDETH) += forcedeth.o
 
 obj-$(CONFIG_PPP) += ppp_generic.o slhc.o
 obj-$(CONFIG_PPP_ASYNC) += ppp_async.o
diff -Nru a/drivers/net/dummy.c b/drivers/net/dummy.c
--- a/drivers/net/dummy.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/dummy.c	Tue Feb  3 19:45:17 2004
@@ -33,6 +33,9 @@
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
 #include <linux/init.h>
+#include <linux/moduleparam.h>
+
+static int numdummies = 1;
 
 static int dummy_xmit(struct sk_buff *skb, struct net_device *dev);
 static struct net_device_stats *dummy_get_stats(struct net_device *dev);
@@ -83,10 +86,14 @@
 	return dev->priv;
 }
 
-static struct net_device *dev_dummy;
+static struct net_device **dummies;
 
-static int __init dummy_init_module(void)
+/* Number of dummy devices to be set up by this module. */
+module_param(numdummies, int, 0);
+
+static int __init dummy_init_one(int index)
 {
+	struct net_device *dev_dummy;
 	int err;
 
 	dev_dummy = alloc_netdev(sizeof(struct net_device_stats),
@@ -98,15 +105,40 @@
 	if ((err = register_netdev(dev_dummy))) {
 		kfree(dev_dummy);
 		dev_dummy = NULL;
+	} else {
+		dummies[index] = dev_dummy; 
 	}
+
 	return err;
 }
 
+static void dummy_free_one(int index)
+{
+	unregister_netdev(dummies[index]);
+	free_netdev(dummies[index]);
+} 
+
+static int __init dummy_init_module(void)
+{ 
+	int i, err = 0;
+	dummies = kmalloc(numdummies * sizeof(void *), GFP_KERNEL); 
+	if (!dummies)
+		return -ENOMEM; 
+	for (i = 0; i < numdummies && !err; i++)
+		err = dummy_init_one(i); 
+	if (err) { 
+		while (--i >= 0)
+			dummy_free_one(i);
+	}
+	return err;
+} 
+
 static void __exit dummy_cleanup_module(void)
 {
-	unregister_netdev(dev_dummy);
-	free_netdev(dev_dummy);
-	dev_dummy = NULL;
+	int i;
+	for (i = 0; i < numdummies; i++) 
+		dummy_free_one(i); 
+	kfree(dummies);	
 }
 
 module_init(dummy_init_module);
diff -Nru a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/net/forcedeth.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,1501 @@
+/*
+ * forcedeth: Ethernet driver for NVIDIA nForce media access controllers.
+ *
+ * Note: This driver is a cleanroom reimplementation based on reverse
+ *      engineered documentation written by Carl-Daniel Hailfinger
+ *      and Andrew de Quincey. It's neither supported nor endorsed
+ *      by NVIDIA Corp. Use at your own risk.
+ *
+ * NVIDIA, nForce and other NVIDIA marks are trademarks or registered
+ * trademarks of NVIDIA Corporation in the United States and other
+ * countries.
+ *
+ * Copyright (C) 2003 Manfred Spraul
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Changelog:
+ * 	0.01: 05 Oct 2003: First release that compiles without warnings.
+ * 	0.02: 05 Oct 2003: Fix bug for drain_tx: do not try to free NULL skbs.
+ * 			   Check all PCI BARs for the register window.
+ * 			   udelay added to mii_rw.
+ * 	0.03: 06 Oct 2003: Initialize dev->irq.
+ * 	0.04: 07 Oct 2003: Initialize np->lock, reduce handled irqs, add printks.
+ * 	0.05: 09 Oct 2003: printk removed again, irq status print tx_timeout.
+ * 	0.06: 10 Oct 2003: MAC Address read updated, pff flag generation updated,
+ * 			   irq mask updated
+ * 	0.07: 14 Oct 2003: Further irq mask updates.
+ * 	0.08: 20 Oct 2003: rx_desc.Length initialization added, alloc_rx refill
+ * 			   added into irq handler, NULL check for drain_ring.
+ * 	0.09: 20 Oct 2003: Basic link speed irq implementation. Only handle the
+ * 			   requested interrupt sources.
+ * 	0.10: 20 Oct 2003: First cleanup for release.
+ * 	0.11: 21 Oct 2003: hexdump for tx added, rx buffer sizes increased.
+ * 			   MAC Address init fix, set_multicast cleanup.
+ * 	0.12: 23 Oct 2003: Cleanups for release.
+ * 	0.13: 25 Oct 2003: Limit for concurrent tx packets increased to 10.
+ * 			   Set link speed correctly. start rx before starting
+ * 			   tx (start_rx sets the link speed).
+ * 	0.14: 25 Oct 2003: Nic dependant irq mask.
+ * 	0.15: 08 Nov 2003: fix smp deadlock with set_multicast_list during
+ * 			   open.
+ * 	0.16: 15 Nov 2003: include file cleanup for ppc64, rx buffer size
+ * 			   increased to 1628 bytes.
+ * 	0.17: 16 Nov 2003: undo rx buffer size increase. Substract 1 from
+ * 			   the tx length.
+ * 	0.18: 17 Nov 2003: fix oops due to late initialization of dev_stats
+ * 	0.19: 29 Nov 2003: Handle RxNoBuf, detect & handle invalid mac
+ * 			   addresses, really stop rx if already running
+ * 			   in start_rx, clean up a bit.
+ * 				(C) Carl-Daniel Hailfinger
+ * 	0.20: 07 Dev 2003: alloc fixes
+ *
+ * Known bugs:
+ * The irq handling is wrong - no tx done interrupts are generated.
+ * This means recovery from netif_stop_queue only happens in the hw timer
+ * interrupt (1/2 second on nForce2, 1/100 second on nForce3), or if an
+ * rx packet arrives by chance.
+ */
+#define FORCEDETH_VERSION		"0.19"
+
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <linux/interrupt.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/delay.h>
+#include <linux/spinlock.h>
+#include <linux/ethtool.h>
+#include <linux/timer.h>
+#include <linux/skbuff.h>
+#include <linux/mii.h>
+#include <linux/random.h>
+#include <linux/init.h>
+
+#include <asm/irq.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+
+#if 0
+#define dprintk			printk
+#else
+#define dprintk(x...)		do { } while (0)
+#endif
+
+
+/*
+ * Hardware access:
+ */
+
+#define DEV_NEED_LASTPACKET1	0x0001
+#define DEV_IRQMASK_1		0x0002
+#define DEV_IRQMASK_2		0x0004
+
+enum {
+	NvRegIrqStatus = 0x000,
+#define NVREG_IRQSTAT_MIIEVENT	0x040
+#define NVREG_IRQSTAT_MASK		0x1ff
+	NvRegIrqMask = 0x004,
+#define NVREG_IRQ_RX			0x0002
+#define NVREG_IRQ_RX_NOBUF		0x0004
+#define NVREG_IRQ_TX_ERR		0x0008
+#define NVREG_IRQ_TX2			0x0010
+#define NVREG_IRQ_TIMER			0x0020
+#define NVREG_IRQ_LINK			0x0040
+#define NVREG_IRQ_TX1			0x0100
+#define NVREG_IRQMASK_WANTED_1		0x005f
+#define NVREG_IRQMASK_WANTED_2		0x0147
+#define NVREG_IRQ_UNKNOWN		(~(NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF|NVREG_IRQ_TX_ERR|NVREG_IRQ_TX2|NVREG_IRQ_TIMER|NVREG_IRQ_LINK|NVREG_IRQ_TX1))
+
+	NvRegUnknownSetupReg6 = 0x008,
+#define NVREG_UNKSETUP6_VAL		3
+
+	NvRegPollingInterval = 0x00c,
+	NvRegMisc1 = 0x080,
+#define NVREG_MISC1_HD		0x02
+#define NVREG_MISC1_FORCE	0x3b0f3c
+
+	NvRegTransmitterControl = 0x084,
+#define NVREG_XMITCTL_START	0x01
+	NvRegTransmitterStatus = 0x088,
+#define NVREG_XMITSTAT_BUSY	0x01
+
+	NvRegPacketFilterFlags = 0x8c,
+#define NVREG_PFF_ALWAYS	0x7F0008
+#define NVREG_PFF_PROMISC	0x80
+#define NVREG_PFF_MYADDR	0x20
+
+	NvRegOffloadConfig = 0x90,
+#define NVREG_OFFLOAD_HOMEPHY	0x601
+#define NVREG_OFFLOAD_NORMAL	0x5ee
+	NvRegReceiverControl = 0x094,
+#define NVREG_RCVCTL_START	0x01
+	NvRegReceiverStatus = 0x98,
+#define NVREG_RCVSTAT_BUSY	0x01
+
+	NvRegRandomSeed = 0x9c,
+#define NVREG_RNDSEED_MASK	0x00ff
+#define NVREG_RNDSEED_FORCE	0x7f00
+
+	NvRegUnknownSetupReg1 = 0xA0,
+#define NVREG_UNKSETUP1_VAL	0x16070f
+	NvRegUnknownSetupReg2 = 0xA4,
+#define NVREG_UNKSETUP2_VAL	0x16
+	NvRegMacAddrA = 0xA8,
+	NvRegMacAddrB = 0xAC,
+	NvRegMulticastAddrA = 0xB0,
+#define NVREG_MCASTADDRA_FORCE	0x01
+	NvRegMulticastAddrB = 0xB4,
+	NvRegMulticastMaskA = 0xB8,
+	NvRegMulticastMaskB = 0xBC,
+
+	NvRegTxRingPhysAddr = 0x100,
+	NvRegRxRingPhysAddr = 0x104,
+	NvRegRingSizes = 0x108,
+#define NVREG_RINGSZ_TXSHIFT 0
+#define NVREG_RINGSZ_RXSHIFT 16
+	NvRegUnknownTransmitterReg = 0x10c,
+	NvRegLinkSpeed = 0x110,
+#define NVREG_LINKSPEED_FORCE 0x10000
+#define NVREG_LINKSPEED_10	10
+#define NVREG_LINKSPEED_100	100
+#define NVREG_LINKSPEED_1000	1000
+	NvRegUnknownSetupReg5 = 0x130,
+#define NVREG_UNKSETUP5_BIT31	(1<<31)
+	NvRegUnknownSetupReg3 = 0x134,
+#define NVREG_UNKSETUP3_VAL1	0x200010
+	NvRegTxRxControl = 0x144,
+#define NVREG_TXRXCTL_KICK	0x0001
+#define NVREG_TXRXCTL_BIT1	0x0002
+#define NVREG_TXRXCTL_BIT2	0x0004
+#define NVREG_TXRXCTL_IDLE	0x0008
+#define NVREG_TXRXCTL_RESET	0x0010
+	NvRegMIIStatus = 0x180,
+#define NVREG_MIISTAT_ERROR		0x0001
+#define NVREG_MIISTAT_LINKCHANGE	0x0008
+#define NVREG_MIISTAT_MASK		0x000f
+#define NVREG_MIISTAT_MASK2		0x000f
+	NvRegUnknownSetupReg4 = 0x184,
+#define NVREG_UNKSETUP4_VAL	8
+
+	NvRegAdapterControl = 0x188,
+#define NVREG_ADAPTCTL_START	0x02
+#define NVREG_ADAPTCTL_LINKUP	0x04
+#define NVREG_ADAPTCTL_PHYVALID	0x4000
+#define NVREG_ADAPTCTL_RUNNING	0x100000
+#define NVREG_ADAPTCTL_PHYSHIFT	24
+	NvRegMIISpeed = 0x18c,
+#define NVREG_MIISPEED_BIT8	(1<<8)
+#define NVREG_MIIDELAY	5
+	NvRegMIIControl = 0x190,
+#define NVREG_MIICTL_INUSE	0x10000
+#define NVREG_MIICTL_WRITE	0x08000
+#define NVREG_MIICTL_ADDRSHIFT	5
+	NvRegMIIData = 0x194,
+	NvRegWakeUpFlags = 0x200,
+#define NVREG_WAKEUPFLAGS_VAL		0x7770
+#define NVREG_WAKEUPFLAGS_BUSYSHIFT	24
+#define NVREG_WAKEUPFLAGS_ENABLESHIFT	16
+#define NVREG_WAKEUPFLAGS_D3SHIFT	12
+#define NVREG_WAKEUPFLAGS_D2SHIFT	8
+#define NVREG_WAKEUPFLAGS_D1SHIFT	4
+#define NVREG_WAKEUPFLAGS_D0SHIFT	0
+#define NVREG_WAKEUPFLAGS_ACCEPT_MAGPAT		0x01
+#define NVREG_WAKEUPFLAGS_ACCEPT_WAKEUPPAT	0x02
+#define NVREG_WAKEUPFLAGS_ACCEPT_LINKCHANGE	0x04
+
+	NvRegPatternCRC = 0x204,
+	NvRegPatternMask = 0x208,
+	NvRegPowerCap = 0x268,
+#define NVREG_POWERCAP_D3SUPP	(1<<30)
+#define NVREG_POWERCAP_D2SUPP	(1<<26)
+#define NVREG_POWERCAP_D1SUPP	(1<<25)
+	NvRegPowerState = 0x26c,
+#define NVREG_POWERSTATE_POWEREDUP	0x8000
+#define NVREG_POWERSTATE_VALID		0x0100
+#define NVREG_POWERSTATE_MASK		0x0003
+#define NVREG_POWERSTATE_D0		0x0000
+#define NVREG_POWERSTATE_D1		0x0001
+#define NVREG_POWERSTATE_D2		0x0002
+#define NVREG_POWERSTATE_D3		0x0003
+};
+
+struct ring_desc {
+	u32 PacketBuffer;
+	u16 Length;
+	u16 Flags;
+};
+
+#define NV_TX_LASTPACKET	(1<<0)
+#define NV_TX_RETRYERROR	(1<<3)
+#define NV_TX_LASTPACKET1	(1<<8)
+#define NV_TX_DEFERRED		(1<<10)
+#define NV_TX_CARRIERLOST	(1<<11)
+#define NV_TX_LATECOLLISION	(1<<12)
+#define NV_TX_UNDERFLOW		(1<<13)
+#define NV_TX_ERROR		(1<<14)
+#define NV_TX_VALID		(1<<15)
+
+#define NV_RX_DESCRIPTORVALID	(1<<0)
+#define NV_RX_MISSEDFRAME	(1<<1)
+#define NV_RX_SUBSTRACT1	(1<<3)
+#define NV_RX_ERROR1		(1<<7)
+#define NV_RX_ERROR2		(1<<8)
+#define NV_RX_ERROR3		(1<<9)
+#define NV_RX_ERROR4		(1<<10)
+#define NV_RX_CRCERR		(1<<11)
+#define NV_RX_OVERFLOW		(1<<12)
+#define NV_RX_FRAMINGERR	(1<<13)
+#define NV_RX_ERROR		(1<<14)
+#define NV_RX_AVAIL		(1<<15)
+
+/* Miscelaneous hardware related defines: */
+#define NV_PCI_REGSZ		0x270
+
+/* various timeout delays: all in usec */
+#define NV_TXRX_RESET_DELAY	4
+#define NV_TXSTOP_DELAY1	10
+#define NV_TXSTOP_DELAY1MAX	500000
+#define NV_TXSTOP_DELAY2	100
+#define NV_RXSTOP_DELAY1	10
+#define NV_RXSTOP_DELAY1MAX	500000
+#define NV_RXSTOP_DELAY2	100
+#define NV_SETUP5_DELAY		5
+#define NV_SETUP5_DELAYMAX	50000
+#define NV_POWERUP_DELAY	5
+#define NV_POWERUP_DELAYMAX	5000
+#define NV_MIIBUSY_DELAY	50
+#define NV_MIIPHY_DELAY	10
+#define NV_MIIPHY_DELAYMAX	10000
+
+#define NV_WAKEUPPATTERNS	5
+#define NV_WAKEUPMASKENTRIES	4
+
+/* General driver defaults */
+#define NV_WATCHDOG_TIMEO	(2*HZ)
+#define DEFAULT_MTU		1500	/* also maximum supported, at least for now */
+
+#define RX_RING		128
+#define TX_RING		16
+/* limited to 1 packet until we understand NV_TX_LASTPACKET */
+#define TX_LIMIT_STOP	10
+#define TX_LIMIT_START	5
+
+/* rx/tx mac addr + type + vlan + align + slack*/
+#define RX_NIC_BUFSIZE		(DEFAULT_MTU + 64)
+/* even more slack */
+#define RX_ALLOC_BUFSIZE	(DEFAULT_MTU + 128)
+
+#define OOM_REFILL	(1+HZ/20)
+#define POLL_WAIT	(1+HZ/100)
+
+/*
+ * SMP locking:
+ * All hardware access under dev->priv->lock, except the performance
+ * critical parts:
+ * - rx is (pseudo-) lockless: it relies on the single-threading provided
+ * 	by the arch code for interrupts.
+ * - tx setup is lockless: it relies on dev->xmit_lock. Actual submission
+ *	needs dev->priv->lock :-(
+ * - set_multicast_list: preparation lockless, relies on dev->xmit_lock.
+ */
+
+/* in dev: base, irq */
+struct fe_priv {
+	spinlock_t lock;
+
+	/* General data:
+	 * Locking: spin_lock(&np->lock); */
+	struct net_device_stats stats;
+	int in_shutdown;
+	u32 linkspeed;
+	int duplex;
+	int phyaddr;
+
+	/* General data: RO fields */
+	dma_addr_t ring_addr;
+	struct pci_dev *pci_dev;
+	u32 orig_mac[2];
+	u32 irqmask;
+
+	/* rx specific fields.
+	 * Locking: Within irq hander or disable_irq+spin_lock(&np->lock);
+	 */
+	struct ring_desc *rx_ring;
+	unsigned int cur_rx, refill_rx;
+	struct sk_buff *rx_skbuff[RX_RING];
+	dma_addr_t rx_dma[RX_RING];
+	unsigned int rx_buf_sz;
+	struct timer_list oom_kick;
+	struct timer_list nic_poll;
+
+	/*
+	 * tx specific fields.
+	 */
+	struct ring_desc *tx_ring;
+	unsigned int next_tx, nic_tx;
+	struct sk_buff *tx_skbuff[TX_RING];
+	dma_addr_t tx_dma[TX_RING];
+	u16 tx_flags;
+};
+
+/*
+ * Maximum number of loops until we assume that a bit in the irq mask
+ * is stuck. Overridable with module param.
+ */
+static int max_interrupt_work = 5;
+
+static inline struct fe_priv *get_nvpriv(struct net_device *dev)
+{
+	return (struct fe_priv *) dev->priv;
+}
+
+static inline u8 *get_hwbase(struct net_device *dev)
+{
+	return (u8 *) dev->base_addr;
+}
+
+static inline void pci_push(u8 * base)
+{
+	/* force out pending posted writes */
+	readl(base);
+}
+
+static int reg_delay(struct net_device *dev, int offset, u32 mask, u32 target,
+				int delay, int delaymax, const char *msg)
+{
+	u8 *base = get_hwbase(dev);
+
+	pci_push(base);
+	do {
+		udelay(delay);
+		delaymax -= delay;
+		if (delaymax < 0) {
+			if (msg)
+				printk(msg);
+			return 1;
+		}
+	} while ((readl(base + offset) & mask) != target);
+	return 0;
+}
+
+#define MII_READ	(-1)
+/* mii_rw: read/write a register on the PHY.
+ *
+ * Caller must guarantee serialization
+ */
+static int mii_rw(struct net_device *dev, int addr, int miireg, int value)
+{
+	u8 *base = get_hwbase(dev);
+	int was_running;
+	u32 reg;
+	int retval;
+
+	writel(NVREG_MIISTAT_MASK, base + NvRegMIIStatus);
+	was_running = 0;
+	reg = readl(base + NvRegAdapterControl);
+	if (reg & NVREG_ADAPTCTL_RUNNING) {
+		was_running = 1;
+		writel(reg & ~NVREG_ADAPTCTL_RUNNING, base + NvRegAdapterControl);
+	}
+	reg = readl(base + NvRegMIIControl);
+	if (reg & NVREG_MIICTL_INUSE) {
+		writel(NVREG_MIICTL_INUSE, base + NvRegMIIControl);
+		udelay(NV_MIIBUSY_DELAY);
+	}
+
+	reg = NVREG_MIICTL_INUSE | (addr << NVREG_MIICTL_ADDRSHIFT) | miireg;
+	if (value != MII_READ) {
+		writel(value, base + NvRegMIIData);
+		reg |= NVREG_MIICTL_WRITE;
+	}
+	writel(reg, base + NvRegMIIControl);
+
+	if (reg_delay(dev, NvRegMIIControl, NVREG_MIICTL_INUSE, 0,
+			NV_MIIPHY_DELAY, NV_MIIPHY_DELAYMAX, NULL)) {
+		dprintk(KERN_DEBUG "%s: mii_rw of reg %d at PHY %d timed out.\n",
+				dev->name, miireg, addr);
+		retval = -1;
+	} else if (value != MII_READ) {
+		/* it was a write operation - fewer failures are detectable */
+		dprintk(KERN_DEBUG "%s: mii_rw wrote 0x%x to reg %d at PHY %d\n",
+				dev->name, value, miireg, addr);
+		retval = 0;
+	} else if (readl(base + NvRegMIIStatus) & NVREG_MIISTAT_ERROR) {
+		dprintk(KERN_DEBUG "%s: mii_rw of reg %d at PHY %d failed.\n",
+				dev->name, miireg, addr);
+		retval = -1;
+	} else {
+		/* FIXME: why is that required? */
+		udelay(50);
+		retval = readl(base + NvRegMIIData);
+		dprintk(KERN_DEBUG "%s: mii_rw read from reg %d at PHY %d: 0x%x.\n",
+				dev->name, miireg, addr, retval);
+	}
+	if (was_running) {
+		reg = readl(base + NvRegAdapterControl);
+		writel(reg | NVREG_ADAPTCTL_RUNNING, base + NvRegAdapterControl);
+	}
+	return retval;
+}
+
+static void start_rx(struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+	u8 *base = get_hwbase(dev);
+
+	dprintk(KERN_DEBUG "%s: start_rx\n", dev->name);
+	/* Already running? Stop it. */
+	if (readl(base + NvRegReceiverControl) & NVREG_RCVCTL_START) {
+		writel(0, base + NvRegReceiverControl);
+		pci_push(base);
+	}
+	writel(np->linkspeed, base + NvRegLinkSpeed);
+	pci_push(base);
+	writel(NVREG_RCVCTL_START, base + NvRegReceiverControl);
+	pci_push(base);
+}
+
+static void stop_rx(struct net_device *dev)
+{
+	u8 *base = get_hwbase(dev);
+
+	dprintk(KERN_DEBUG "%s: stop_rx\n", dev->name);
+	writel(0, base + NvRegReceiverControl);
+	reg_delay(dev, NvRegReceiverStatus, NVREG_RCVSTAT_BUSY, 0,
+		       NV_RXSTOP_DELAY1, NV_RXSTOP_DELAY1MAX,
+		       KERN_INFO "stop_rx: ReceiverStatus remained busy");
+
+	udelay(NV_RXSTOP_DELAY2);
+	writel(0, base + NvRegLinkSpeed);
+}
+
+static void start_tx(struct net_device *dev)
+{
+	u8 *base = get_hwbase(dev);
+
+	dprintk(KERN_DEBUG "%s: start_tx\n", dev->name);
+	writel(NVREG_XMITCTL_START, base + NvRegTransmitterControl);
+	pci_push(base);
+}
+
+static void stop_tx(struct net_device *dev)
+{
+	u8 *base = get_hwbase(dev);
+
+	dprintk(KERN_DEBUG "%s: stop_tx\n", dev->name);
+	writel(0, base + NvRegTransmitterControl);
+	reg_delay(dev, NvRegTransmitterStatus, NVREG_XMITSTAT_BUSY, 0,
+		       NV_TXSTOP_DELAY1, NV_TXSTOP_DELAY1MAX,
+		       KERN_INFO "stop_tx: TransmitterStatus remained busy");
+
+	udelay(NV_TXSTOP_DELAY2);
+	writel(0, base + NvRegUnknownTransmitterReg);
+}
+
+static void txrx_reset(struct net_device *dev)
+{
+	u8 *base = get_hwbase(dev);
+
+	dprintk(KERN_DEBUG "%s: txrx_reset\n", dev->name);
+	writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET, base + NvRegTxRxControl);
+	pci_push(base);
+	udelay(NV_TXRX_RESET_DELAY);
+	writel(NVREG_TXRXCTL_BIT2, base + NvRegTxRxControl);
+	pci_push(base);
+}
+
+/*
+ * get_stats: dev->get_stats function
+ * Get latest stats value from the nic.
+ * Called with read_lock(&dev_base_lock) held for read -
+ * only synchronized against unregister_netdevice.
+ */
+static struct net_device_stats *get_stats(struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+
+	/* It seems that the nic always generates interrupts and doesn't
+	 * accumulate errors internally. Thus the current values in np->stats
+	 * are already up to date.
+	 */
+	return &np->stats;
+}
+
+
+/*
+ * nic_ioctl: dev->do_ioctl function
+ * Called with rtnl_lock held.
+ */
+static int nic_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+{
+	return -EOPNOTSUPP;
+}
+
+/*
+ * alloc_rx: fill rx ring entries.
+ * Return 1 if the allocations for the skbs failed and the
+ * rx engine is without Available descriptors
+ */
+static int alloc_rx(struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+	unsigned int refill_rx = np->refill_rx;
+
+	while (np->cur_rx != refill_rx) {
+		int nr = refill_rx % RX_RING;
+		struct sk_buff *skb;
+
+		if (np->rx_skbuff[nr] == NULL) {
+
+			skb = dev_alloc_skb(RX_ALLOC_BUFSIZE);
+			if (!skb)
+				break;
+
+			skb->dev = dev;
+			np->rx_skbuff[nr] = skb;
+		} else {
+			skb = np->rx_skbuff[nr];
+		}
+		np->rx_dma[nr] = pci_map_single(np->pci_dev, skb->data, skb->len,
+						PCI_DMA_FROMDEVICE);
+		np->rx_ring[nr].PacketBuffer = cpu_to_le32(np->rx_dma[nr]);
+		np->rx_ring[nr].Length = cpu_to_le16(RX_NIC_BUFSIZE);
+		wmb();
+		np->rx_ring[nr].Flags = cpu_to_le16(NV_RX_AVAIL);
+		dprintk(KERN_DEBUG "%s: alloc_rx: Packet  %d marked as Available\n",
+					dev->name, refill_rx);
+		refill_rx++;
+	}
+	np->refill_rx = refill_rx;
+	if (np->cur_rx - refill_rx == RX_RING)
+		return 1;
+	return 0;
+}
+
+static void do_rx_refill(unsigned long data)
+{
+	struct net_device *dev = (struct net_device *) data;
+	struct fe_priv *np = get_nvpriv(dev);
+
+	disable_irq(dev->irq);
+	if (alloc_rx(dev)) {
+		spin_lock(&np->lock);
+		if (!np->in_shutdown)
+			mod_timer(&np->oom_kick, jiffies + OOM_REFILL);
+		spin_unlock(&np->lock);
+	}
+	enable_irq(dev->irq);
+}
+
+static int init_ring(struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+	int i;
+
+	np->next_tx = np->nic_tx = 0;
+	for (i = 0; i < TX_RING; i++) {
+		np->tx_ring[i].Flags = 0;
+	}
+
+	np->cur_rx = RX_RING;
+	np->refill_rx = 0;
+	for (i = 0; i < RX_RING; i++) {
+		np->rx_ring[i].Flags = 0;
+	}
+	return alloc_rx(dev);
+}
+
+static void drain_tx(struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+	int i;
+	for (i = 0; i < TX_RING; i++) {
+		np->tx_ring[i].Flags = 0;
+		if (np->tx_skbuff[i]) {
+			pci_unmap_single(np->pci_dev, np->tx_dma[i],
+						np->tx_skbuff[i]->len,
+						PCI_DMA_TODEVICE);
+			dev_kfree_skb(np->tx_skbuff[i]);
+			np->tx_skbuff[i] = NULL;
+			np->stats.tx_dropped++;
+		}
+	}
+}
+
+static void drain_rx(struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+	int i;
+	for (i = 0; i < RX_RING; i++) {
+		np->rx_ring[i].Flags = 0;
+		wmb();
+		if (np->rx_skbuff[i]) {
+			pci_unmap_single(np->pci_dev, np->rx_dma[i],
+						np->rx_skbuff[i]->len,
+						PCI_DMA_FROMDEVICE);
+			dev_kfree_skb(np->rx_skbuff[i]);
+			np->rx_skbuff[i] = NULL;
+		}
+	}
+}
+
+static void drain_ring(struct net_device *dev)
+{
+	drain_tx(dev);
+	drain_rx(dev);
+}
+
+/*
+ * start_xmit: dev->hard_start_xmit function
+ * Called with dev->xmit_lock held.
+ */
+static int start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+	int nr = np->next_tx % TX_RING;
+
+	np->tx_skbuff[nr] = skb;
+	np->tx_dma[nr] = pci_map_single(np->pci_dev, skb->data,skb->len,
+					PCI_DMA_TODEVICE);
+
+	np->tx_ring[nr].PacketBuffer = cpu_to_le32(np->tx_dma[nr]);
+	np->tx_ring[nr].Length = cpu_to_le16(skb->len-1);
+
+	spin_lock_irq(&np->lock);
+	wmb();
+	np->tx_ring[nr].Flags = np->tx_flags;
+	dprintk(KERN_DEBUG "%s: start_xmit: packet packet %d queued for transmission.\n",
+				dev->name, np->next_tx);
+	{
+		int j;
+		for (j=0; j<64; j++) {
+			if ((j%16) == 0)
+				dprintk("\n%03x:", j);
+			dprintk(" %02x", ((unsigned char*)skb->data)[j]);
+		}
+		dprintk("\n");
+	}
+
+	np->next_tx++;
+
+	dev->trans_start = jiffies;
+	if (np->next_tx - np->nic_tx >= TX_LIMIT_STOP)
+		netif_stop_queue(dev);
+	spin_unlock_irq(&np->lock);
+	writel(NVREG_TXRXCTL_KICK, get_hwbase(dev) + NvRegTxRxControl);
+	return 0;
+}
+
+/*
+ * tx_done: check for completed packets, release the skbs.
+ *
+ * Caller must own np->lock.
+ */
+static void tx_done(struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+
+	while (np->nic_tx < np->next_tx) {
+		struct ring_desc *prd;
+		int i = np->nic_tx % TX_RING;
+
+		prd = &np->tx_ring[i];
+
+		dprintk(KERN_DEBUG "%s: tx_done: looking at packet %d, Flags 0x%x.\n",
+					dev->name, np->nic_tx, prd->Flags);
+		if (prd->Flags & cpu_to_le16(NV_TX_VALID))
+			break;
+		if (prd->Flags & cpu_to_le16(NV_TX_RETRYERROR|NV_TX_CARRIERLOST|NV_TX_LATECOLLISION|
+						NV_TX_UNDERFLOW|NV_TX_ERROR)) {
+			if (prd->Flags & cpu_to_le16(NV_TX_UNDERFLOW))
+				np->stats.tx_fifo_errors++;
+			if (prd->Flags & cpu_to_le16(NV_TX_CARRIERLOST))
+				np->stats.tx_carrier_errors++;
+			np->stats.tx_errors++;
+		} else {
+			np->stats.tx_packets++;
+			np->stats.tx_bytes += np->tx_skbuff[i]->len;
+		}
+		pci_unmap_single(np->pci_dev, np->tx_dma[i],
+					np->tx_skbuff[i]->len,
+					PCI_DMA_TODEVICE);
+		dev_kfree_skb_irq(np->tx_skbuff[i]);
+		np->tx_skbuff[i] = NULL;
+		np->nic_tx++;
+	}
+	if (np->next_tx - np->nic_tx < TX_LIMIT_START)
+		netif_wake_queue(dev);
+}
+
+/*
+ * tx_timeout: dev->tx_timeout function
+ * Called with dev->xmit_lock held.
+ */
+static void tx_timeout(struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+	u8 *base = get_hwbase(dev);
+
+	dprintk(KERN_DEBUG "%s: Got tx_timeout. irq: %08x\n", dev->name,
+			readl(base + NvRegIrqStatus) & NVREG_IRQSTAT_MASK);
+
+	spin_lock_irq(&np->lock);
+
+	/* 1) stop tx engine */
+	stop_tx(dev);
+
+	/* 2) check that the packets were not sent already: */
+	tx_done(dev);
+
+	/* 3) if there are dead entries: clear everything */
+	if (np->next_tx != np->nic_tx) {
+		printk(KERN_DEBUG "%s: tx_timeout: dead entries!\n", dev->name);
+		drain_tx(dev);
+		np->next_tx = np->nic_tx = 0;
+		writel((u32) (np->ring_addr + RX_RING*sizeof(struct ring_desc)), base + NvRegTxRingPhysAddr);
+		netif_wake_queue(dev);
+	}
+
+	/* 4) restart tx engine */
+	start_tx(dev);
+	spin_unlock_irq(&np->lock);
+}
+
+static void rx_process(struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+
+	for (;;) {
+		struct ring_desc *prd;
+		struct sk_buff *skb;
+		int len;
+		int i;
+		if (np->cur_rx - np->refill_rx >= RX_RING)
+			break;	/* we scanned the whole ring - do not continue */
+
+		i = np->cur_rx % RX_RING;
+		prd = &np->rx_ring[i];
+		dprintk(KERN_DEBUG "%s: rx_process: looking at packet %d, Flags 0x%x.\n",
+					dev->name, np->cur_rx, prd->Flags);
+
+		if (prd->Flags & cpu_to_le16(NV_RX_AVAIL))
+			break;	/* still owned by hardware, */
+
+		/*
+		 * the packet is for us - immediately tear down the pci mapping, and
+		 * prefetch the first cacheline of the packet.
+		 */
+		pci_unmap_single(np->pci_dev, np->rx_dma[i],
+				np->rx_skbuff[i]->len,
+				PCI_DMA_FROMDEVICE);
+		prefetch(np->rx_skbuff[i]->data);
+
+		{
+			int j;
+			dprintk(KERN_DEBUG "Dumping packet (flags 0x%x).",prd->Flags);
+			for (j=0; j<64; j++) {
+				if ((j%16) == 0)
+					dprintk("\n%03x:", j);
+				dprintk(" %02x", ((unsigned char*)np->rx_skbuff[i]->data)[j]);
+			}
+			dprintk("\n");
+		}
+		/* look at what we actually got: */
+		if (!(prd->Flags & cpu_to_le16(NV_RX_DESCRIPTORVALID)))
+			goto next_pkt;
+
+
+		len = le16_to_cpu(prd->Length);
+
+		if (prd->Flags & cpu_to_le16(NV_RX_MISSEDFRAME)) {
+			np->stats.rx_missed_errors++;
+			np->stats.rx_errors++;
+			goto next_pkt;
+		}
+		if (prd->Flags & cpu_to_le16(NV_RX_ERROR1|NV_RX_ERROR2|NV_RX_ERROR3|NV_RX_ERROR4)) {
+			np->stats.rx_errors++;
+			goto next_pkt;
+		}
+		if (prd->Flags & cpu_to_le16(NV_RX_CRCERR)) {
+			np->stats.rx_crc_errors++;
+			np->stats.rx_errors++;
+			goto next_pkt;
+		}
+		if (prd->Flags & cpu_to_le16(NV_RX_OVERFLOW)) {
+			np->stats.rx_over_errors++;
+			np->stats.rx_errors++;
+			goto next_pkt;
+		}
+		if (prd->Flags & cpu_to_le16(NV_RX_ERROR)) {
+			/* framing errors are soft errors, the rest is fatal. */
+			if (prd->Flags & cpu_to_le16(NV_RX_FRAMINGERR)) {
+				if (prd->Flags & cpu_to_le16(NV_RX_SUBSTRACT1)) {
+					len--;
+				}
+			} else {
+				np->stats.rx_errors++;
+				goto next_pkt;
+			}
+		}
+		/* got a valid packet - forward it to the network core */
+		skb = np->rx_skbuff[i];
+		np->rx_skbuff[i] = NULL;
+
+		skb_put(skb, len);
+		skb->protocol = eth_type_trans(skb, dev);
+		dprintk(KERN_DEBUG "%s: rx_process: packet %d with %d bytes, proto %d accepted.\n",
+					dev->name, np->cur_rx, len, skb->protocol);
+		netif_rx(skb);
+		dev->last_rx = jiffies;
+		np->stats.rx_packets++;
+		np->stats.rx_bytes += len;
+next_pkt:
+		np->cur_rx++;
+	}
+}
+
+/*
+ * change_mtu: dev->change_mtu function
+ * Called with dev_base_lock held for read.
+ */
+static int change_mtu(struct net_device *dev, int new_mtu)
+{
+	if (new_mtu > DEFAULT_MTU)
+		return -EINVAL;
+	dev->mtu = new_mtu;
+	return 0;
+}
+
+/*
+ * change_mtu: dev->change_mtu function
+ * Called with dev->xmit_lock held.
+ */
+static void set_multicast(struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+	u8 *base = get_hwbase(dev);
+	u32 addr[2];
+	u32 mask[2];
+	u32 pff;
+
+	memset(addr, 0, sizeof(addr));
+	memset(mask, 0, sizeof(mask));
+
+	if (dev->flags & IFF_PROMISC) {
+		printk(KERN_NOTICE "%s: Promiscuous mode enabled.\n", dev->name);
+		pff = NVREG_PFF_PROMISC;
+	} else {
+		pff = NVREG_PFF_MYADDR;
+
+		if (dev->flags & IFF_ALLMULTI || dev->mc_list) {
+			u32 alwaysOff[2];
+			u32 alwaysOn[2];
+
+			alwaysOn[0] = alwaysOn[1] = alwaysOff[0] = alwaysOff[1] = 0xffffffff;
+			if (dev->flags & IFF_ALLMULTI) {
+				alwaysOn[0] = alwaysOn[1] = alwaysOff[0] = alwaysOff[1] = 0;
+			} else {
+				struct dev_mc_list *walk;
+
+				walk = dev->mc_list;
+				while (walk != NULL) {
+					u32 a, b;
+					a = le32_to_cpu(*(u32 *) walk->dmi_addr);
+					b = le16_to_cpu(*(u16 *) (&walk->dmi_addr[4]));
+					alwaysOn[0] &= a;
+					alwaysOff[0] &= ~a;
+					alwaysOn[1] &= b;
+					alwaysOff[1] &= ~b;
+					walk = walk->next;
+				}
+			}
+			addr[0] = alwaysOn[0];
+			addr[1] = alwaysOn[1];
+			mask[0] = alwaysOn[0] | alwaysOff[0];
+			mask[1] = alwaysOn[1] | alwaysOff[1];
+		}
+	}
+	addr[0] |= NVREG_MCASTADDRA_FORCE;
+	pff |= NVREG_PFF_ALWAYS;
+	spin_lock_irq(&np->lock);
+	stop_rx(dev);
+	writel(addr[0], base + NvRegMulticastAddrA);
+	writel(addr[1], base + NvRegMulticastAddrB);
+	writel(mask[0], base + NvRegMulticastMaskA);
+	writel(mask[1], base + NvRegMulticastMaskB);
+	writel(pff, base + NvRegPacketFilterFlags);
+	start_rx(dev);
+	spin_unlock_irq(&np->lock);
+}
+
+static int update_linkspeed(struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+	int adv, lpa, newls, newdup;
+
+	adv = mii_rw(dev, np->phyaddr, MII_ADVERTISE, MII_READ);
+	lpa = mii_rw(dev, np->phyaddr, MII_LPA, MII_READ);
+	dprintk(KERN_DEBUG "%s: update_linkspeed: PHY advertises 0x%04x, lpa 0x%04x.\n",
+				dev->name, adv, lpa);
+
+	/* FIXME: handle parallel detection properly, handle gigabit ethernet */
+	lpa = lpa & adv;
+	if (lpa  & LPA_100FULL) {
+		newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_100;
+		newdup = 1;
+	} else if (lpa & LPA_100HALF) {
+		newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_100;
+		newdup = 0;
+	} else if (lpa & LPA_10FULL) {
+		newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10;
+		newdup = 1;
+	} else if (lpa & LPA_10HALF) {
+		newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10;
+		newdup = 0;
+	} else {
+		dprintk(KERN_DEBUG "%s: bad ability %04x - falling back to 10HD.\n", dev->name, lpa);
+		newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10;
+		newdup = 0;
+	}
+	if (np->duplex != newdup || np->linkspeed != newls) {
+		np->duplex = newdup;
+		np->linkspeed = newls;
+		return 1;
+	}
+	return 0;
+}
+
+static void link_irq(struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+	u8 *base = get_hwbase(dev);
+	u32 miistat;
+	int miival;
+
+	miistat = readl(base + NvRegMIIStatus);
+	writel(NVREG_MIISTAT_MASK, base + NvRegMIIStatus);
+	printk(KERN_DEBUG "%s: link change notification, status 0x%x.\n", dev->name, miistat);
+
+	miival = mii_rw(dev, np->phyaddr, MII_BMSR, MII_READ);
+	if (miival & BMSR_ANEGCOMPLETE) {
+		update_linkspeed(dev);
+
+		if (netif_carrier_ok(dev)) {
+			stop_rx(dev);
+		} else {
+			netif_carrier_on(dev);
+			printk(KERN_INFO "%s: link up.\n", dev->name);
+		}
+		writel(NVREG_MISC1_FORCE | ( np->duplex ? 0 : NVREG_MISC1_HD),
+					base + NvRegMisc1);
+		start_rx(dev);
+	} else {
+		if (netif_carrier_ok(dev)) {
+			netif_carrier_off(dev);
+			printk(KERN_INFO "%s: link down.\n", dev->name);
+			stop_rx(dev);
+		}
+		writel(np->linkspeed, base + NvRegLinkSpeed);
+		pci_push(base);
+	}
+}
+
+static irqreturn_t nic_irq(int foo, void *data, struct pt_regs *regs)
+{
+	struct net_device *dev = (struct net_device *) data;
+	struct fe_priv *np = get_nvpriv(dev);
+	u8 *base = get_hwbase(dev);
+	u32 events;
+	int i;
+
+	dprintk(KERN_DEBUG "%s: nic_irq\n", dev->name);
+
+	for (i=0; ; i++) {
+		events = readl(base + NvRegIrqStatus) & NVREG_IRQSTAT_MASK;
+		writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
+		pci_push(base);
+		dprintk(KERN_DEBUG "%s: irq: %08x\n", dev->name, events);
+		if (!(events & np->irqmask))
+			break;
+
+		if (events & (NVREG_IRQ_TX1|NVREG_IRQ_TX2|NVREG_IRQ_TX_ERR)) {
+			spin_lock(&np->lock);
+			tx_done(dev);
+			spin_unlock(&np->lock);
+		}
+
+		if (events & (NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF)) {
+			rx_process(dev);
+			if (alloc_rx(dev)) {
+				spin_lock(&np->lock);
+				if (!np->in_shutdown)
+					mod_timer(&np->oom_kick, jiffies + OOM_REFILL);
+				spin_unlock(&np->lock);
+			}
+		}
+
+		if (events & NVREG_IRQ_LINK) {
+			spin_lock(&np->lock);
+			link_irq(dev);
+			spin_unlock(&np->lock);
+		}
+		if (events & (NVREG_IRQ_TX_ERR)) {
+			dprintk(KERN_DEBUG "%s: received irq with events 0x%x. Probably TX fail.\n",
+						dev->name, events);
+		}
+		if (events & (NVREG_IRQ_UNKNOWN)) {
+			printk(KERN_DEBUG "%s: received irq with unknown events 0x%x. Please report\n",
+						dev->name, events);
+ 		}
+		if (i > max_interrupt_work) {
+			spin_lock(&np->lock);
+			/* disable interrupts on the nic */
+			writel(0, base + NvRegIrqMask);
+			pci_push(base);
+
+			if (!np->in_shutdown)
+				mod_timer(&np->nic_poll, jiffies + POLL_WAIT);
+			printk(KERN_DEBUG "%s: too many iterations (%d) in nic_irq.\n", dev->name, i);
+			spin_unlock(&np->lock);
+			break;
+		}
+
+	}
+	dprintk(KERN_DEBUG "%s: nic_irq completed\n", dev->name);
+
+	return IRQ_RETVAL(i);
+}
+
+static void do_nic_poll(unsigned long data)
+{
+	struct net_device *dev = (struct net_device *) data;
+	struct fe_priv *np = get_nvpriv(dev);
+	u8 *base = get_hwbase(dev);
+
+	disable_irq(dev->irq);
+	/*
+	 * reenable interrupts on the nic, we have to do this before calling
+	 * nic_irq because that may decide to do otherwise
+	 */
+	writel(np->irqmask, base + NvRegIrqMask);
+	pci_push(base);
+	nic_irq((int) 0, (void *) data, (struct pt_regs *) NULL);
+	enable_irq(dev->irq);
+}
+
+static int open(struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+	u8 *base = get_hwbase(dev);
+	int ret, oom, i;
+
+	dprintk(KERN_DEBUG "forcedeth: open\n");
+
+	/* 1) erase previous misconfiguration */
+	/* 4.1-1: stop adapter: ignored, 4.3 seems to be overkill */
+	writel(NVREG_MCASTADDRA_FORCE, base + NvRegMulticastAddrA);
+	writel(0, base + NvRegMulticastAddrB);
+	writel(0, base + NvRegMulticastMaskA);
+	writel(0, base + NvRegMulticastMaskB);
+	writel(0, base + NvRegPacketFilterFlags);
+	writel(0, base + NvRegAdapterControl);
+	writel(0, base + NvRegLinkSpeed);
+	writel(0, base + NvRegUnknownTransmitterReg);
+	txrx_reset(dev);
+	writel(0, base + NvRegUnknownSetupReg6);
+
+	/* 2) initialize descriptor rings */
+	np->in_shutdown = 0;
+	oom = init_ring(dev);
+
+	/* 3) set mac address */
+	{
+		u32 mac[2];
+
+		mac[0] = (dev->dev_addr[0] <<  0) + (dev->dev_addr[1] <<  8) +
+				(dev->dev_addr[2] << 16) + (dev->dev_addr[3] << 24);
+		mac[1] = (dev->dev_addr[4] << 0) + (dev->dev_addr[5] << 8);
+
+		writel(mac[0], base + NvRegMacAddrA);
+		writel(mac[1], base + NvRegMacAddrB);
+	}
+
+	/* 4) continue setup */
+	np->linkspeed = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10;
+	np->duplex = 0;
+	writel(NVREG_UNKSETUP3_VAL1, base + NvRegUnknownSetupReg3);
+	writel(0, base + NvRegTxRxControl);
+	pci_push(base);
+	writel(NVREG_TXRXCTL_BIT1, base + NvRegTxRxControl);
+	reg_delay(dev, NvRegUnknownSetupReg5, NVREG_UNKSETUP5_BIT31, NVREG_UNKSETUP5_BIT31,
+			NV_SETUP5_DELAY, NV_SETUP5_DELAYMAX,
+			KERN_INFO "open: SetupReg5, Bit 31 remained off\n");
+	writel(0, base + NvRegUnknownSetupReg4);
+
+	/* 5) Find a suitable PHY */
+	writel(NVREG_MIISPEED_BIT8|NVREG_MIIDELAY, base + NvRegMIISpeed);
+	for (i = 1; i < 32; i++) {
+		int id1, id2;
+
+		id1 = mii_rw(dev, i, MII_PHYSID1, MII_READ);
+		if (id1 < 0)
+			continue;
+		id2 = mii_rw(dev, i, MII_PHYSID2, MII_READ);
+		if (id2 < 0)
+			continue;
+		dprintk(KERN_DEBUG "%s: open: Found PHY %04x:%04x at address %d.\n",
+				dev->name, id1, id2, i);
+		np->phyaddr = i;
+
+		update_linkspeed(dev);
+
+		break;
+	}
+	if (i == 32) {
+		printk(KERN_INFO "%s: open: failing due to lack of suitable PHY.\n",
+				dev->name);
+		ret = -EINVAL;
+		goto out_drain;
+	}
+
+	/* 6) continue setup */
+	writel(NVREG_MISC1_FORCE | ( np->duplex ? 0 : NVREG_MISC1_HD),
+				base + NvRegMisc1);
+	writel(readl(base + NvRegTransmitterStatus), base + NvRegTransmitterStatus);
+	writel(NVREG_PFF_ALWAYS, base + NvRegPacketFilterFlags);
+	writel(NVREG_OFFLOAD_NORMAL, base + NvRegOffloadConfig);
+
+	writel(readl(base + NvRegReceiverStatus), base + NvRegReceiverStatus);
+	get_random_bytes(&i, sizeof(i));
+	writel(NVREG_RNDSEED_FORCE | (i&NVREG_RNDSEED_MASK), base + NvRegRandomSeed);
+	writel(NVREG_UNKSETUP1_VAL, base + NvRegUnknownSetupReg1);
+	writel(NVREG_UNKSETUP2_VAL, base + NvRegUnknownSetupReg2);
+	writel(NVREG_UNKSETUP6_VAL, base + NvRegUnknownSetupReg6);
+	writel((np->phyaddr << NVREG_ADAPTCTL_PHYSHIFT)|NVREG_ADAPTCTL_PHYVALID,
+			base + NvRegAdapterControl);
+	writel(NVREG_UNKSETUP4_VAL, base + NvRegUnknownSetupReg4);
+	writel(NVREG_WAKEUPFLAGS_VAL, base + NvRegWakeUpFlags);
+
+	/* 7) start packet processing */
+	writel((u32) np->ring_addr, base + NvRegRxRingPhysAddr);
+	writel((u32) (np->ring_addr + RX_RING*sizeof(struct ring_desc)), base + NvRegTxRingPhysAddr);
+	writel( ((RX_RING-1) << NVREG_RINGSZ_RXSHIFT) + ((TX_RING-1) << NVREG_RINGSZ_TXSHIFT),
+			base + NvRegRingSizes);
+
+	i = readl(base + NvRegPowerState);
+	if ( (i & NVREG_POWERSTATE_POWEREDUP) == 0) {
+		writel(NVREG_POWERSTATE_POWEREDUP|i, base + NvRegPowerState);
+	}
+	pci_push(base);
+	udelay(10);
+	writel(readl(base + NvRegPowerState) | NVREG_POWERSTATE_VALID, base + NvRegPowerState);
+	writel(NVREG_ADAPTCTL_RUNNING, base + NvRegAdapterControl);
+
+
+	writel(0, base + NvRegIrqMask);
+	pci_push(base);
+	writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
+	pci_push(base);
+	writel(NVREG_MIISTAT_MASK2, base + NvRegMIIStatus);
+	writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
+	pci_push(base);
+
+	ret = request_irq(dev->irq, &nic_irq, SA_SHIRQ, dev->name, dev);
+	if (ret)
+		goto out_drain;
+
+	writel(np->irqmask, base + NvRegIrqMask);
+
+	spin_lock_irq(&np->lock);
+	writel(NVREG_MCASTADDRA_FORCE, base + NvRegMulticastAddrA);
+	writel(0, base + NvRegMulticastAddrB);
+	writel(0, base + NvRegMulticastMaskA);
+	writel(0, base + NvRegMulticastMaskB);
+	writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags);
+	start_rx(dev);
+	start_tx(dev);
+	netif_start_queue(dev);
+	if (oom)
+		mod_timer(&np->oom_kick, jiffies + OOM_REFILL);
+	if (!(mii_rw(dev, np->phyaddr, MII_BMSR, MII_READ) & BMSR_ANEGCOMPLETE)) {
+		printk("%s: no link during initialization.\n", dev->name);
+		netif_carrier_off(dev);
+	}
+
+	spin_unlock_irq(&np->lock);
+
+	return 0;
+out_drain:
+	drain_ring(dev);
+	return ret;
+}
+
+static int close(struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+
+	spin_lock_irq(&np->lock);
+	np->in_shutdown = 1;
+	spin_unlock_irq(&np->lock);
+	synchronize_irq(dev->irq);
+
+	del_timer_sync(&np->oom_kick);
+	del_timer_sync(&np->nic_poll);
+
+	netif_stop_queue(dev);
+	spin_lock_irq(&np->lock);
+	stop_tx(dev);
+	stop_rx(dev);
+	spin_unlock_irq(&np->lock);
+
+	free_irq(dev->irq, dev);
+
+	drain_ring(dev);
+
+	/* FIXME: power down nic */
+
+	return 0;
+}
+
+static int __devinit probe_nic(struct pci_dev *pci_dev, const struct pci_device_id *id)
+{
+	struct net_device *dev;
+	struct fe_priv *np;
+	unsigned long addr;
+	u8 *base;
+	int err, i;
+
+	dev = alloc_etherdev(sizeof(struct fe_priv));
+	np = get_nvpriv(dev);
+	err = -ENOMEM;
+	if (!dev)
+		goto out;
+
+	np->pci_dev = pci_dev;
+	spin_lock_init(&np->lock);
+	SET_MODULE_OWNER(dev);
+	SET_NETDEV_DEV(dev, &pci_dev->dev);
+
+	init_timer(&np->oom_kick);
+	np->oom_kick.data = (unsigned long) dev;
+	np->oom_kick.function = &do_rx_refill;	/* timer handler */
+	init_timer(&np->nic_poll);
+	np->nic_poll.data = (unsigned long) dev;
+	np->nic_poll.function = &do_nic_poll;	/* timer handler */
+
+	err = pci_enable_device(pci_dev);
+	if (err) {
+		printk(KERN_INFO "forcedeth: pci_enable_dev failed (%d) for device %s\n",
+				err, pci_name(pci_dev));
+		goto out_free;
+	}
+
+	pci_set_master(pci_dev);
+
+	err = pci_request_regions(pci_dev, dev->name);
+	if (err < 0)
+		goto out_disable;
+
+	err = -EINVAL;
+	addr = 0;
+	for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
+		dprintk(KERN_DEBUG "%s: resource %d start %p len %ld flags 0x%08lx.\n",
+				pci_name(pci_dev), i, (void*)pci_resource_start(pci_dev, i),
+				pci_resource_len(pci_dev, i),
+				pci_resource_flags(pci_dev, i));
+		if (pci_resource_flags(pci_dev, i) & IORESOURCE_MEM &&
+				pci_resource_len(pci_dev, i) >= NV_PCI_REGSZ) {
+			addr = pci_resource_start(pci_dev, i);
+			break;
+		}
+	}
+	if (i == DEVICE_COUNT_RESOURCE) {
+		printk(KERN_INFO "forcedeth: Couldn't find register window for device %s.\n",
+					pci_name(pci_dev));
+		goto out_relreg;
+	}
+
+	err = -ENOMEM;
+	dev->base_addr = (unsigned long) ioremap(addr, NV_PCI_REGSZ);
+	if (!dev->base_addr)
+		goto out_disable;
+	dev->irq = pci_dev->irq;
+	np->rx_ring = pci_alloc_consistent(pci_dev, sizeof(struct ring_desc) * (RX_RING + TX_RING),
+						&np->ring_addr);
+	if (!np->rx_ring)
+		goto out_unmap;
+	np->tx_ring = &np->rx_ring[RX_RING];
+
+	dev->open = open;
+	dev->stop = close;
+	dev->hard_start_xmit = start_xmit;
+	dev->get_stats = get_stats;
+	dev->change_mtu = change_mtu;
+	dev->set_multicast_list = set_multicast;
+	dev->do_ioctl = nic_ioctl;
+	dev->tx_timeout = tx_timeout;
+	dev->watchdog_timeo = NV_WATCHDOG_TIMEO;
+
+	pci_set_drvdata(pci_dev, dev);
+
+
+	/* read the mac address */
+	base = get_hwbase(dev);
+	np->orig_mac[0] = readl(base + NvRegMacAddrA);
+	np->orig_mac[1] = readl(base + NvRegMacAddrB);
+
+	dev->dev_addr[0] = (np->orig_mac[1] >>  8) & 0xff;
+	dev->dev_addr[1] = (np->orig_mac[1] >>  0) & 0xff;
+	dev->dev_addr[2] = (np->orig_mac[0] >> 24) & 0xff;
+	dev->dev_addr[3] = (np->orig_mac[0] >> 16) & 0xff;
+	dev->dev_addr[4] = (np->orig_mac[0] >>  8) & 0xff;
+	dev->dev_addr[5] = (np->orig_mac[0] >>  0) & 0xff;
+
+	if (!is_valid_ether_addr(dev->dev_addr)) {
+		/*
+		 * Bad mac address. At least one bios sets the mac address
+		 * to 01:23:45:67:89:ab
+		 */
+		printk(KERN_ERR "%s: Invalid Mac address detected: %02x:%02x:%02x:%02x:%02x:%02x\n",
+			pci_name(pci_dev),
+			dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
+			dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+		printk(KERN_ERR "Please complain to your hardware vendor. Switching to a random MAC.\n");
+		dev->dev_addr[0] = 0x00;
+		dev->dev_addr[1] = 0x00;
+		dev->dev_addr[2] = 0x6c;
+		get_random_bytes(&dev->dev_addr[3], 3);
+	}
+
+	dprintk(KERN_DEBUG "%s: MAC Address %02x:%02x:%02x:%02x:%02x:%02x\n", pci_name(pci_dev),
+			dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
+			dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+
+	np->tx_flags = cpu_to_le16(NV_TX_LASTPACKET|NV_TX_LASTPACKET1|NV_TX_VALID);
+	if (id->driver_data & DEV_NEED_LASTPACKET1)
+		np->tx_flags |= cpu_to_le16(NV_TX_LASTPACKET1);
+	if (id->driver_data & DEV_IRQMASK_1)
+		np->irqmask = NVREG_IRQMASK_WANTED_1;
+	if (id->driver_data & DEV_IRQMASK_2)
+		np->irqmask = NVREG_IRQMASK_WANTED_2;
+
+	err = register_netdev(dev);
+	if (err) {
+		printk(KERN_INFO "forcedeth: unable to register netdev: %d\n", err);
+		goto out_freering;
+	}
+	printk(KERN_INFO "%s: forcedeth.c: subsystem: %05x:%04x bound to %s\n",
+			dev->name, pci_dev->subsystem_vendor, pci_dev->subsystem_device,
+			pci_name(pci_dev));
+
+	return 0;
+
+out_freering:
+	pci_free_consistent(np->pci_dev, sizeof(struct ring_desc) * (RX_RING + TX_RING),
+				np->rx_ring, np->ring_addr);
+out_unmap:
+	iounmap(get_hwbase(dev));
+out_relreg:
+	pci_release_regions(pci_dev);
+out_disable:
+	pci_disable_device(pci_dev);
+out_free:
+	free_netdev(dev);
+	pci_set_drvdata(pci_dev, NULL);
+out:
+	return err;
+}
+
+static void __devexit remove_nic(struct pci_dev *pci_dev)
+{
+	struct net_device *dev = pci_get_drvdata(pci_dev);
+	struct fe_priv *np = get_nvpriv(dev);
+	u8 *base = get_hwbase(dev);
+
+	unregister_netdev(dev);
+
+	/* special op: write back the misordered MAC address - otherwise
+	 * the next probe_nic would see a wrong address.
+	 */
+	writel(np->orig_mac[0], base + NvRegMacAddrA);
+	writel(np->orig_mac[1], base + NvRegMacAddrB);
+
+	/* free all structures */
+	pci_free_consistent(np->pci_dev, sizeof(struct ring_desc) * (RX_RING + TX_RING), np->rx_ring, np->ring_addr);
+	iounmap(get_hwbase(dev));
+	pci_release_regions(pci_dev);
+	pci_disable_device(pci_dev);
+	free_netdev(dev);
+	pci_set_drvdata(pci_dev, NULL);
+}
+
+static struct pci_device_id pci_tbl[] = {
+	{	/* nForce Ethernet Controller */
+		.vendor = PCI_VENDOR_ID_NVIDIA,
+		.device = 0x1C3,
+		.subvendor = PCI_ANY_ID,
+		.subdevice = PCI_ANY_ID,
+		.driver_data = DEV_IRQMASK_1,
+	},
+	{	/* nForce2 Ethernet Controller */
+		.vendor = PCI_VENDOR_ID_NVIDIA,
+		.device = 0x0066,
+		.subvendor = PCI_ANY_ID,
+		.subdevice = PCI_ANY_ID,
+		.driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2,
+	},
+	{	/* nForce3 Ethernet Controller */
+		.vendor = PCI_VENDOR_ID_NVIDIA,
+		.device = 0x00D6,
+		.subvendor = PCI_ANY_ID,
+		.subdevice = PCI_ANY_ID,
+		.driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2,
+	},
+	{0,},
+};
+
+static struct pci_driver driver = {
+	.name = "forcedeth",
+	.id_table = pci_tbl,
+	.probe = probe_nic,
+	.remove = __devexit_p(remove_nic),
+};
+
+
+static int __init init_nic(void)
+{
+	printk(KERN_INFO "forcedeth.c: Reverse Engineered nForce ethernet driver. Version %s.\n", FORCEDETH_VERSION);
+	return pci_module_init(&driver);
+}
+
+static void __exit exit_nic(void)
+{
+	pci_unregister_driver(&driver);
+}
+
+MODULE_PARM(max_interrupt_work, "i");
+MODULE_PARM_DESC(max_interrupt_work, "forcedeth maximum events handled per interrupt");
+ 
+MODULE_AUTHOR("Manfred Spraul <manfred@colorfullife.com>");
+MODULE_DESCRIPTION("Reverse Engineered nForce ethernet driver");
+MODULE_LICENSE("GPL");
+
+MODULE_DEVICE_TABLE(pci, pci_tbl);
+
+module_init(init_nic);
+module_exit(exit_nic);
diff -Nru a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
--- a/drivers/net/hamradio/bpqether.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/hamradio/bpqether.c	Tue Feb  3 19:45:17 2004
@@ -606,33 +606,20 @@
  */
 static int __init bpq_init_driver(void)
 {
-	struct net_device *dev;
-
-	dev_add_pack(&bpq_packet_type);
-
-	register_netdevice_notifier(&bpq_dev_notifier);
-
-	printk(banner);
-
 #ifdef CONFIG_PROC_FS
 	if (!proc_net_fops_create("bpqether", S_IRUGO, &bpq_info_fops)) {
 		printk(KERN_ERR
 			"bpq: cannot create /proc/net/bpqether entry.\n");
-		unregister_netdevice_notifier(&bpq_dev_notifier);
-		dev_remove_pack(&bpq_packet_type);
 		return -ENOENT;
 	}
 #endif  /* CONFIG_PROC_FS */
 
-	rtnl_lock();
-	for (dev = dev_base; dev != NULL; dev = dev->next) {
-		if (dev_is_ethdev(dev) && bpq_new_device(dev)) {
-			printk(KERN_ERR
-			       "bpq: cannot setup dev for '%s'\n",
-			       dev->name);
-		}
-	}
-	rtnl_unlock();
+	dev_add_pack(&bpq_packet_type);
+
+	register_netdevice_notifier(&bpq_dev_notifier);
+
+	printk(banner);
+
 	return 0;
 }
 
diff -Nru a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig
--- a/drivers/net/irda/Kconfig	Tue Feb  3 19:45:35 2004
+++ b/drivers/net/irda/Kconfig	Tue Feb  3 19:45:35 2004
@@ -65,6 +65,75 @@
 	  dongles you will have to start irattach like this:
 	  "irattach -d tekram".
 
+config LITELINK_DONGLE
+	tristate "Parallax LiteLink dongle"
+	depends on DONGLE && IRDA
+	help
+	  Say Y here if you want to build support for the Parallax Litelink
+	  dongle.  To compile it as a module, choose M here.  The Parallax
+	  dongle attaches to the normal 9-pin serial port connector, and can
+	  currently only be used by IrTTY.  To activate support for Parallax
+	  dongles you will have to start irattach like this:
+	  "irattach -d litelink".
+
+config MA600_DONGLE
+	tristate "Mobile Action MA600 dongle"
+	depends on DONGLE && IRDA && EXPERIMENTAL
+	help
+	  Say Y here if you want to build support for the Mobile Action MA600
+	  dongle.  To compile it as a module, choose M here. The MA600 dongle
+	  attaches to the normal 9-pin serial port connector, and can
+	  currently only be used by IrTTY.  The driver should also support
+	  the MA620 USB version of the dongle, if the integrated USB-to-RS232
+	  converter is supported by usbserial. To activate support for
+	  MA600 dongle you will have to start irattach like this:
+	  "irattach -d ma600".
+
+config GIRBIL_DONGLE
+	tristate "Greenwich GIrBIL dongle"
+	depends on DONGLE && IRDA && EXPERIMENTAL
+	help
+	  Say Y here if you want to build support for the Greenwich GIrBIL
+	  dongle.  If you want to compile it as a module, choose M here.
+	  The Greenwich dongle attaches to the normal 9-pin serial port
+	  connector, and can currently only be used by IrTTY.  To activate
+	  support for Greenwich dongles you will have to start irattach
+	  like this: "irattach -d girbil".
+
+config MCP2120_DONGLE
+	tristate "Microchip MCP2120"
+	depends on DONGLE && IRDA && EXPERIMENTAL
+	help
+	  Say Y here if you want to build support for the Microchip MCP2120
+	  dongle.  If you want to compile it as a module, choose M here.
+	  The MCP2120 dongle attaches to the normal 9-pin serial port
+	  connector, and can currently only be used by IrTTY.  To activate
+	  support for MCP2120 dongles you will have to start irattach
+	  like this: "irattach -d mcp2120".
+
+	  You must build this dongle yourself.  For more information see:
+	  <http://www.eyetap.org/~tangf/irda_sir_linux.html>
+
+config OLD_BELKIN_DONGLE
+	tristate "Old Belkin dongle"
+	depends on DONGLE && IRDA && EXPERIMENTAL
+	help
+	  Say Y here if you want to build support for the Adaptec Airport 1000
+	  and 2000 dongles.  If you want to compile it as a module, choose
+	  M here. Some information is contained in the comments
+	  at the top of <file:drivers/net/irda/old_belkin.c>.
+
+config ACT200L_DONGLE
+	tristate "ACTiSYS IR-200L dongle"
+	depends on DONGLE && IRDA && EXPERIMENTAL
+	help
+	  Say Y here if you want to build support for the ACTiSYS IR-200L
+	  dongle. If you want to compile it as a module, choose M here.
+	  The ACTiSYS IR-200L dongle attaches to the normal 9-pin serial
+	  port connector, and can currently only be used by IrTTY.
+	  To activate support for ACTiSYS IR-200L dongle you will have to
+	  start irattach like this: "irattach -d act200l".
+
 comment "Old SIR device drivers"
 
 config IRPORT_SIR
@@ -130,7 +199,7 @@
 	  dongles you will have to start irattach like this:
 	  "irattach -d tekram".
 
-config GIRBIL_DONGLE
+config GIRBIL_DONGLE_OLD
 	tristate "Greenwich GIrBIL dongle"
 	depends on DONGLE_OLD && IRDA
 	help
@@ -141,7 +210,7 @@
 	  dongles you will have to insert "irattach -d girbil" in the
 	  /etc/irda/drivers script.
 
-config LITELINK_DONGLE
+config LITELINK_DONGLE_OLD
 	tristate "Parallax LiteLink dongle"
 	depends on DONGLE_OLD && IRDA
 	help
@@ -152,7 +221,7 @@
 	  dongles you will have to start irattach like this:
 	  "irattach -d litelink".
 
-config MCP2120_DONGLE
+config MCP2120_DONGLE_OLD
 	tristate "Microchip MCP2120"
 	depends on DONGLE_OLD && IRDA
 	help
@@ -166,7 +235,7 @@
 	  You must build this dongle yourself.  For more information see:
 	  <http://www.eyetap.org/~tangf/irda_sir_linux.html>
 
-config OLD_BELKIN_DONGLE
+config OLD_BELKIN_DONGLE_OLD
 	tristate "Old Belkin dongle"
 	depends on DONGLE_OLD && IRDA
 	help
@@ -175,11 +244,7 @@
 	  will be called old_belkin.  Some information is contained in the
 	  comments at the top of <file:drivers/net/irda/old_belkin.c>.
 
-config EP7211_IR
-	tristate "EP7211 I/R support"
-	depends on DONGLE_OLD && ARCH_EP7211 && IRDA
-
-config ACT200L_DONGLE
+config ACT200L_DONGLE_OLD
 	tristate "ACTiSYS IR-200L dongle (EXPERIMENTAL)"
 	depends on DONGLE_OLD && EXPERIMENTAL && IRDA
 	help
@@ -190,7 +255,7 @@
 	  ACTiSYS IR-200L dongles you will have to start irattach like this:
 	  "irattach -d act200l".
 
-config MA600_DONGLE
+config MA600_DONGLE_OLD
 	tristate "Mobile Action MA600 dongle (EXPERIMENTAL)"
 	depends on DONGLE_OLD && EXPERIMENTAL && IRDA
 	---help---
@@ -205,6 +270,10 @@
 
 	  There is a pre-compiled module on
 	  <http://engsvr.ust.hk/~eetwl95/download/ma600-2.4.x.tar.gz>
+
+config EP7211_IR
+	tristate "EP7211 I/R support"
+	depends on DONGLE_OLD && ARCH_EP7211 && IRDA
 
 comment "FIR device drivers"
 
diff -Nru a/drivers/net/irda/Makefile b/drivers/net/irda/Makefile
--- a/drivers/net/irda/Makefile	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/irda/Makefile	Tue Feb  3 19:45:17 2004
@@ -21,20 +21,26 @@
 obj-$(CONFIG_ESI_DONGLE_OLD)		+= esi.o
 obj-$(CONFIG_TEKRAM_DONGLE_OLD)	+= tekram.o
 obj-$(CONFIG_ACTISYS_DONGLE_OLD)	+= actisys.o
-obj-$(CONFIG_GIRBIL_DONGLE)	+= girbil.o
-obj-$(CONFIG_LITELINK_DONGLE)	+= litelink.o
-obj-$(CONFIG_OLD_BELKIN_DONGLE)	+= old_belkin.o
+obj-$(CONFIG_GIRBIL_DONGLE_OLD)	+= girbil.o
+obj-$(CONFIG_LITELINK_DONGLE_OLD)	+= litelink.o
+obj-$(CONFIG_OLD_BELKIN_DONGLE_OLD)	+= old_belkin.o
+obj-$(CONFIG_MCP2120_DONGLE_OLD)	+= mcp2120.o
+obj-$(CONFIG_ACT200L_DONGLE_OLD)	+= act200l.o
+obj-$(CONFIG_MA600_DONGLE_OLD)	+= ma600.o
 obj-$(CONFIG_EP7211_IR)		+= ep7211_ir.o
-obj-$(CONFIG_MCP2120_DONGLE)	+= mcp2120.o
 obj-$(CONFIG_AU1000_FIR)	+= au1k_ir.o
-obj-$(CONFIG_ACT200L_DONGLE)	+= act200l.o
-obj-$(CONFIG_MA600_DONGLE)	+= ma600.o
 # New SIR drivers
 obj-$(CONFIG_IRTTY_SIR)		+= irtty-sir.o	sir-dev.o
 # New dongles drivers for new SIR drivers
 obj-$(CONFIG_ESI_DONGLE)	+= esi-sir.o
 obj-$(CONFIG_TEKRAM_DONGLE)	+= tekram-sir.o
 obj-$(CONFIG_ACTISYS_DONGLE)	+= actisys-sir.o
+obj-$(CONFIG_LITELINK_DONGLE)	+= litelink-sir.o
+obj-$(CONFIG_GIRBIL_DONGLE)	+= girbil-sir.o
+obj-$(CONFIG_OLD_BELKIN_DONGLE)	+= old_belkin-sir.o
+obj-$(CONFIG_MCP2120_DONGLE)	+= mcp2120-sir.o
+obj-$(CONFIG_ACT200L_DONGLE)	+= act200l-sir.o
+obj-$(CONFIG_MA600_DONGLE)	+= ma600-sir.o
 
 # The SIR helper module
 sir-dev-objs := sir_core.o sir_dev.o sir_dongle.o sir_kthread.o
diff -Nru a/drivers/net/irda/act200l-sir.c b/drivers/net/irda/act200l-sir.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/net/irda/act200l-sir.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,258 @@
+/*********************************************************************
+ *
+ * Filename:      act200l.c
+ * Version:       0.8
+ * Description:   Implementation for the ACTiSYS ACT-IR200L dongle
+ * Status:        Experimental.
+ * Author:        SHIMIZU Takuya <tshimizu@ga2.so-net.ne.jp>
+ * Created at:    Fri Aug  3 17:35:42 2001
+ * Modified at:   Fri Aug 17 10:22:40 2001
+ * Modified by:   SHIMIZU Takuya <tshimizu@ga2.so-net.ne.jp>
+ *
+ *     Copyright (c) 2001 SHIMIZU Takuya, All Rights Reserved.
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of
+ *     the License, or (at your option) any later version.
+ *
+ ********************************************************************/
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+
+#include <net/irda/irda.h>
+
+#include "sir-dev.h"
+
+static int act200l_reset(struct sir_dev *dev);
+static int act200l_open(struct sir_dev *dev);
+static int act200l_close(struct sir_dev *dev);
+static int act200l_change_speed(struct sir_dev *dev, unsigned speed);
+
+/* Regsiter 0: Control register #1 */
+#define ACT200L_REG0    0x00
+#define ACT200L_TXEN    0x01 /* Enable transmitter */
+#define ACT200L_RXEN    0x02 /* Enable receiver */
+
+/* Register 1: Control register #2 */
+#define ACT200L_REG1    0x10
+#define ACT200L_LODB    0x01 /* Load new baud rate count value */
+#define ACT200L_WIDE    0x04 /* Expand the maximum allowable pulse */
+
+/* Register 4: Output Power register */
+#define ACT200L_REG4    0x40
+#define ACT200L_OP0     0x01 /* Enable LED1C output */
+#define ACT200L_OP1     0x02 /* Enable LED2C output */
+#define ACT200L_BLKR    0x04
+
+/* Register 5: Receive Mode register */
+#define ACT200L_REG5    0x50
+#define ACT200L_RWIDL   0x01 /* fixed 1.6us pulse mode */
+
+/* Register 6: Receive Sensitivity register #1 */
+#define ACT200L_REG6    0x60
+#define ACT200L_RS0     0x01 /* receive threshold bit 0 */
+#define ACT200L_RS1     0x02 /* receive threshold bit 1 */
+
+/* Register 7: Receive Sensitivity register #2 */
+#define ACT200L_REG7    0x70
+#define ACT200L_ENPOS   0x04 /* Ignore the falling edge */
+
+/* Register 8,9: Baud Rate Dvider register #1,#2 */
+#define ACT200L_REG8    0x80
+#define ACT200L_REG9    0x90
+
+#define ACT200L_2400    0x5f
+#define ACT200L_9600    0x17
+#define ACT200L_19200   0x0b
+#define ACT200L_38400   0x05
+#define ACT200L_57600   0x03
+#define ACT200L_115200  0x01
+
+/* Register 13: Control register #3 */
+#define ACT200L_REG13   0xd0
+#define ACT200L_SHDW    0x01 /* Enable access to shadow registers */
+
+/* Register 15: Status register */
+#define ACT200L_REG15   0xf0
+
+/* Register 21: Control register #4 */
+#define ACT200L_REG21   0x50
+#define ACT200L_EXCK    0x02 /* Disable clock output driver */
+#define ACT200L_OSCL    0x04 /* oscillator in low power, medium accuracy mode */
+
+static struct dongle_driver act200l = {
+	.owner		= THIS_MODULE,
+	.driver_name	= "ACTiSYS ACT-IR200L",
+	.type		= IRDA_ACT200L_DONGLE,
+	.open		= act200l_open,
+	.close		= act200l_close,
+	.reset		= act200l_reset,
+	.set_speed	= act200l_change_speed,
+};
+
+static int __init act200l_init(void)
+{
+	return irda_register_dongle(&act200l);
+}
+
+static void __exit act200l_cleanup(void)
+{
+	irda_unregister_dongle(&act200l);
+}
+
+static int act200l_open(struct sir_dev *dev)
+{
+	struct qos_info *qos = &dev->qos;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
+
+	/* Power on the dongle */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+	/* Set the speeds we can accept */
+	qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;
+	qos->min_turn_time.bits = 0x03;
+	irda_qos_bits_to_value(qos);
+
+	/* irda thread waits 50 msec for power settling */
+
+	return 0;
+}
+
+static int act200l_close(struct sir_dev *dev)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
+
+	/* Power off the dongle */
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
+
+	return 0;
+}
+
+/*
+ * Function act200l_change_speed (dev, speed)
+ *
+ *    Set the speed for the ACTiSYS ACT-IR200L type dongle.
+ *
+ */
+static int act200l_change_speed(struct sir_dev *dev, unsigned speed)
+{
+	u8 control[3];
+	int ret = 0;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
+
+	/* Clear DTR and set RTS to enter command mode */
+	sirdev_set_dtr_rts(dev, FALSE, TRUE);
+
+	switch (speed) {
+	default:
+		ret = -EINVAL;
+		/* fall through */
+	case 9600:
+		control[0] = ACT200L_REG8 |  (ACT200L_9600       & 0x0f);
+		control[1] = ACT200L_REG9 | ((ACT200L_9600 >> 4) & 0x0f);
+		break;
+	case 19200:
+		control[0] = ACT200L_REG8 |  (ACT200L_19200       & 0x0f);
+		control[1] = ACT200L_REG9 | ((ACT200L_19200 >> 4) & 0x0f);
+		break;
+	case 38400:
+		control[0] = ACT200L_REG8 |  (ACT200L_38400       & 0x0f);
+		control[1] = ACT200L_REG9 | ((ACT200L_38400 >> 4) & 0x0f);
+		break;
+	case 57600:
+		control[0] = ACT200L_REG8 |  (ACT200L_57600       & 0x0f);
+		control[1] = ACT200L_REG9 | ((ACT200L_57600 >> 4) & 0x0f);
+		break;
+	case 115200:
+		control[0] = ACT200L_REG8 |  (ACT200L_115200       & 0x0f);
+		control[1] = ACT200L_REG9 | ((ACT200L_115200 >> 4) & 0x0f);
+		break;
+	}
+	control[2] = ACT200L_REG1 | ACT200L_LODB | ACT200L_WIDE;
+
+	/* Write control bytes */
+	sirdev_raw_write(dev, control, 3);
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout(MSECS_TO_JIFFIES(5));
+
+	/* Go back to normal mode */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+	dev->speed = speed;
+	return ret;
+}
+
+/*
+ * Function act200l_reset (driver)
+ *
+ *    Reset the ACTiSYS ACT-IR200L type dongle.
+ */
+
+#define ACT200L_STATE_WAIT1_RESET	(SIRDEV_STATE_DONGLE_RESET+1)
+#define ACT200L_STATE_WAIT2_RESET	(SIRDEV_STATE_DONGLE_RESET+2)
+
+static int act200l_reset(struct sir_dev *dev)
+{
+	unsigned state = dev->fsm.substate;
+	unsigned delay = 0;
+	u8 control[9] = {
+		ACT200L_REG15,
+		ACT200L_REG13 | ACT200L_SHDW,
+		ACT200L_REG21 | ACT200L_EXCK | ACT200L_OSCL,
+		ACT200L_REG13,
+		ACT200L_REG7  | ACT200L_ENPOS,
+		ACT200L_REG6  | ACT200L_RS0  | ACT200L_RS1,
+		ACT200L_REG5  | ACT200L_RWIDL,
+		ACT200L_REG4  | ACT200L_OP0  | ACT200L_OP1 | ACT200L_BLKR,
+		ACT200L_REG0  | ACT200L_TXEN | ACT200L_RXEN
+	};
+	int ret = 0;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
+
+	switch (state) {
+	case SIRDEV_STATE_DONGLE_RESET:
+		/* Reset the dongle : set RTS low for 25 ms */
+		sirdev_set_dtr_rts(dev, TRUE, FALSE);
+		state = ACT200L_STATE_WAIT1_RESET;
+		delay = 50;
+		break;
+
+	case ACT200L_STATE_WAIT1_RESET:
+		/* Clear DTR and set RTS to enter command mode */
+		sirdev_set_dtr_rts(dev, FALSE, TRUE);
+
+		udelay(25);			/* better wait for some short while */
+
+		/* Write control bytes */
+		sirdev_raw_write(dev, control, sizeof(control));
+		state = ACT200L_STATE_WAIT2_RESET;
+		delay = 15;
+		break;
+
+	case ACT200L_STATE_WAIT2_RESET:
+		/* Go back to normal mode */
+		sirdev_set_dtr_rts(dev, TRUE, TRUE);
+		dev->speed = 9600;
+		break;
+	default:
+		ERROR("%s(), unknown state %d\n", __FUNCTION__, state);
+		ret = -1;
+		break;
+	}
+	dev->fsm.substate = state;
+	return (delay > 0) ? delay : ret;
+}
+
+MODULE_AUTHOR("SHIMIZU Takuya <tshimizu@ga2.so-net.ne.jp>");
+MODULE_DESCRIPTION("ACTiSYS ACT-IR200L dongle driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("irda-dongle-10"); /* IRDA_ACT200L_DONGLE */
+
+module_init(act200l_init);
+module_exit(act200l_cleanup);
diff -Nru a/drivers/net/irda/act200l.c b/drivers/net/irda/act200l.c
--- a/drivers/net/irda/act200l.c	Tue Feb  3 19:45:26 2004
+++ b/drivers/net/irda/act200l.c	Tue Feb  3 19:45:26 2004
@@ -92,12 +92,12 @@
 	.owner = THIS_MODULE,
 };
 
-int __init act200l_init(void)
+static int __init act200l_init(void)
 {
 	return irda_device_register_dongle(&dongle);
 }
 
-void __exit act200l_cleanup(void)
+static void __exit act200l_cleanup(void)
 {
 	irda_device_unregister_dongle(&dongle);
 }
diff -Nru a/drivers/net/irda/actisys-sir.c b/drivers/net/irda/actisys-sir.c
--- a/drivers/net/irda/actisys-sir.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/net/irda/actisys-sir.c	Tue Feb  3 19:45:29 2004
@@ -65,7 +65,7 @@
 
 /* These are the baudrates supported, in the order available */
 /* Note : the 220L doesn't support 38400, but we will fix that below */
-static __u32 baud_rates[] = { 9600, 19200, 57600, 115200, 38400 };
+static unsigned baud_rates[] = { 9600, 19200, 57600, 115200, 38400 };
 
 #define MAX_SPEEDS (sizeof(baud_rates)/sizeof(baud_rates[0]))
 
@@ -89,7 +89,7 @@
 	.set_speed	= actisys_change_speed,
 };
 
-int __init actisys_sir_init(void)
+static int __init actisys_sir_init(void)
 {
 	int ret;
 
@@ -107,7 +107,7 @@
 	return 0;
 }
 
-void __exit actisys_sir_cleanup(void)
+static void __exit actisys_sir_cleanup(void)
 {
 	/* We have to remove both dongles */
 	irda_unregister_dongle(&act220l_plus);
@@ -118,7 +118,7 @@
 {
 	struct qos_info *qos = &dev->qos;
 
-	dev->set_dtr_rts(dev, TRUE, TRUE);
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
 
 	/* Set the speeds we can accept */
 	qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;
@@ -130,13 +130,15 @@
 	qos->min_turn_time.bits = 0x7f; /* Needs 0.01 ms */
 	irda_qos_bits_to_value(qos);
 
+	/* irda thread waits 50 msec for power settling */
+
 	return 0;
 }
 
 static int actisys_close(struct sir_dev *dev)
 {
 	/* Power off the dongle */
-	dev->set_dtr_rts(dev, FALSE, FALSE);
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
 
 	return 0;
 }
@@ -174,23 +176,25 @@
 	 * Now, we can set the speed requested. Send RTS pulses until we
          * reach the target speed 
 	 */
-	for (i=0; i<MAX_SPEEDS; i++) {
+	for (i = 0; i < MAX_SPEEDS; i++) {
 		if (speed == baud_rates[i]) {
-			dev->speed = baud_rates[i];
+			dev->speed = speed;
 			break;
 		}
 		/* Set RTS low for 10 us */
-		dev->set_dtr_rts(dev, TRUE, FALSE);
+		sirdev_set_dtr_rts(dev, TRUE, FALSE);
 		udelay(MIN_DELAY);
 
 		/* Set RTS high for 10 us */
-		dev->set_dtr_rts(dev, TRUE, TRUE);
+		sirdev_set_dtr_rts(dev, TRUE, TRUE);
 		udelay(MIN_DELAY);
 	}
 
 	/* Check if life is sweet... */
-	if (i >= MAX_SPEEDS)
-		ret = -1;  /* This should not happen */
+	if (i >= MAX_SPEEDS) {
+		actisys_reset(dev);
+		ret = -EINVAL;  /* This should not happen */
+	}
 
 	/* Basta lavoro, on se casse d'ici... */
 	return ret;
@@ -221,11 +225,11 @@
 static int actisys_reset(struct sir_dev *dev)
 {
 	/* Reset the dongle : set DTR low for 10 us */
-	dev->set_dtr_rts(dev, FALSE, TRUE);
+	sirdev_set_dtr_rts(dev, FALSE, TRUE);
 	udelay(MIN_DELAY);
 
 	/* Go back to normal mode */
-	dev->set_dtr_rts(dev, TRUE, TRUE);
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
 	
 	dev->speed = 9600;	/* That's the default */
 
diff -Nru a/drivers/net/irda/actisys.c b/drivers/net/irda/actisys.c
--- a/drivers/net/irda/actisys.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/net/irda/actisys.c	Tue Feb  3 19:45:43 2004
@@ -91,7 +91,7 @@
  *	So, we register a dongle of each sort and let irattach
  * pick the right one...
  */
-int __init actisys_init(void)
+static int __init actisys_init(void)
 {
 	int ret;
 
@@ -108,7 +108,7 @@
 	return 0;
 }
 
-void __exit actisys_cleanup(void)
+static void __exit actisys_cleanup(void)
 {
 	/* We have to remove both dongles */
 	irda_device_unregister_dongle(&dongle);
diff -Nru a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c
--- a/drivers/net/irda/ali-ircc.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/irda/ali-ircc.c	Tue Feb  3 19:45:17 2004
@@ -133,7 +133,7 @@
  *    Initialize chip. Find out whay kinds of chips we are dealing with
  *    and their configuation registers address
  */
-int __init ali_ircc_init(void)
+static int __init ali_ircc_init(void)
 {
 	ali_chip_t *chip;
 	chipio_t info;
diff -Nru a/drivers/net/irda/ep7211_ir.c b/drivers/net/irda/ep7211_ir.c
--- a/drivers/net/irda/ep7211_ir.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/irda/ep7211_ir.c	Tue Feb  3 19:45:16 2004
@@ -97,7 +97,7 @@
  *    Initialize EP7211 I/R module
  *
  */
-int __init ep7211_ir_init(void)
+static int __init ep7211_ir_init(void)
 {
 	return irda_device_register_dongle(&dongle);
 }
diff -Nru a/drivers/net/irda/esi-sir.c b/drivers/net/irda/esi-sir.c
--- a/drivers/net/irda/esi-sir.c	Tue Feb  3 19:45:37 2004
+++ b/drivers/net/irda/esi-sir.c	Tue Feb  3 19:45:37 2004
@@ -68,11 +68,14 @@
 {
 	struct qos_info *qos = &dev->qos;
 
+	/* Power up and set dongle to 9600 baud */
+	sirdev_set_dtr_rts(dev, FALSE, TRUE);
+
 	qos->baud_rate.bits &= IR_9600|IR_19200|IR_115200;
 	qos->min_turn_time.bits = 0x01; /* Needs at least 10 ms */
 	irda_qos_bits_to_value(qos);
 
-	/* shouldn't we do set_dtr_rts(FALSE, TRUE) here (power up at 9600)? */
+	/* irda thread waits 50 msec for power settling */
 
 	return 0;
 }
@@ -80,7 +83,7 @@
 static int esi_close(struct sir_dev *dev)
 {
 	/* Power off dongle */
-	dev->set_dtr_rts(dev, FALSE, FALSE);
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
 
 	return 0;
 }
@@ -88,11 +91,13 @@
 /*
  * Function esi_change_speed (task)
  *
- *    Set the speed for the Extended Systems JetEye PC ESI-9680 type dongle
+ * Set the speed for the Extended Systems JetEye PC ESI-9680 type dongle
+ * Apparently (see old esi-driver) no delays are needed here...
  *
  */
 static int esi_change_speed(struct sir_dev *dev, unsigned speed)
 {
+	int ret = 0;
 	int dtr, rts;
 	
 	switch (speed) {
@@ -104,6 +109,7 @@
 		dtr = rts = TRUE;
 		break;
 	default:
+		ret = -EINVAL;
 		speed = 9600;
 		/* fall through */
 	case 9600:
@@ -113,12 +119,10 @@
 	}
 
 	/* Change speed of dongle */
-	dev->set_dtr_rts(dev, dtr, rts);
+	sirdev_set_dtr_rts(dev, dtr, rts);
 	dev->speed = speed;
 
-	/* do we need some delay for power stabilization? */
-
-	return 0;
+	return ret;
 }
 
 /*
@@ -129,9 +133,18 @@
  */
 static int esi_reset(struct sir_dev *dev)
 {
-	dev->set_dtr_rts(dev, FALSE, FALSE);
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
+
+	/* Hm, the old esi-driver left the dongle unpowered relying on
+	 * the following speed change to repower. This might work for
+	 * the esi because we only need the modem lines. However, now the
+	 * general rule is reset must bring the dongle to some working
+	 * well-known state because speed change might write to registers.
+	 * The old esi-driver didn't any delay here - let's hope it' fine.
+	 */
 
-	/* Hm, probably repower to 9600 and some delays? */
+	sirdev_set_dtr_rts(dev, FALSE, TRUE);
+	dev->speed = 9600;
 
 	return 0;
 }
diff -Nru a/drivers/net/irda/esi.c b/drivers/net/irda/esi.c
--- a/drivers/net/irda/esi.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/net/irda/esi.c	Tue Feb  3 19:45:28 2004
@@ -52,12 +52,12 @@
 	.owner = THIS_MODULE,
 };
 
-int __init esi_init(void)
+static int __init esi_init(void)
 {
 	return irda_device_register_dongle(&dongle);
 }
 
-void __exit esi_cleanup(void)
+static void __exit esi_cleanup(void)
 {
 	irda_device_unregister_dongle(&dongle);
 }
diff -Nru a/drivers/net/irda/girbil-sir.c b/drivers/net/irda/girbil-sir.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/net/irda/girbil-sir.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,258 @@
+/*********************************************************************
+ *
+ * Filename:      girbil.c
+ * Version:       1.2
+ * Description:   Implementation for the Greenwich GIrBIL dongle
+ * Status:        Experimental.
+ * Author:        Dag Brattli <dagb@cs.uit.no>
+ * Created at:    Sat Feb  6 21:02:33 1999
+ * Modified at:   Fri Dec 17 09:13:20 1999
+ * Modified by:   Dag Brattli <dagb@cs.uit.no>
+ *
+ *     Copyright (c) 1999 Dag Brattli, All Rights Reserved.
+ *     
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of
+ *     the License, or (at your option) any later version.
+ * 
+ *     Neither Dag Brattli nor University of Tromsø admit liability nor
+ *     provide warranty for any of this software. This material is
+ *     provided "AS-IS" and at no charge.
+ *
+ ********************************************************************/
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+
+#include <net/irda/irda.h>
+
+#include "sir-dev.h"
+
+static int girbil_reset(struct sir_dev *dev);
+static int girbil_open(struct sir_dev *dev);
+static int girbil_close(struct sir_dev *dev);
+static int girbil_change_speed(struct sir_dev *dev, unsigned speed);
+
+/* Control register 1 */
+#define GIRBIL_TXEN    0x01 /* Enable transmitter */
+#define GIRBIL_RXEN    0x02 /* Enable receiver */
+#define GIRBIL_ECAN    0x04 /* Cancel self emmited data */
+#define GIRBIL_ECHO    0x08 /* Echo control characters */
+
+/* LED Current Register (0x2) */
+#define GIRBIL_HIGH    0x20
+#define GIRBIL_MEDIUM  0x21
+#define GIRBIL_LOW     0x22
+
+/* Baud register (0x3) */
+#define GIRBIL_2400    0x30
+#define GIRBIL_4800    0x31
+#define GIRBIL_9600    0x32
+#define GIRBIL_19200   0x33
+#define GIRBIL_38400   0x34
+#define GIRBIL_57600   0x35
+#define GIRBIL_115200  0x36
+
+/* Mode register (0x4) */
+#define GIRBIL_IRDA    0x40
+#define GIRBIL_ASK     0x41
+
+/* Control register 2 (0x5) */
+#define GIRBIL_LOAD    0x51 /* Load the new baud rate value */
+
+static struct dongle_driver girbil = {
+	.owner		= THIS_MODULE,
+	.driver_name	= "Greenwich GIrBIL",
+	.type		= IRDA_GIRBIL_DONGLE,
+	.open		= girbil_open,
+	.close		= girbil_close,
+	.reset		= girbil_reset,
+	.set_speed	= girbil_change_speed,
+};
+
+static int __init girbil_init(void)
+{
+	return irda_register_dongle(&girbil);
+}
+
+static void __exit girbil_cleanup(void)
+{
+	irda_unregister_dongle(&girbil);
+}
+
+static int girbil_open(struct sir_dev *dev)
+{
+	struct qos_info *qos = &dev->qos;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* Power on dongle */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+	qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;
+	qos->min_turn_time.bits = 0x03;
+	irda_qos_bits_to_value(qos);
+
+	/* irda thread waits 50 msec for power settling */
+
+	return 0;
+}
+
+static int girbil_close(struct sir_dev *dev)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* Power off dongle */
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
+
+	return 0;
+}
+
+/*
+ * Function girbil_change_speed (dev, speed)
+ *
+ *    Set the speed for the Girbil type dongle.
+ *
+ */
+
+#define GIRBIL_STATE_WAIT_SPEED	(SIRDEV_STATE_DONGLE_SPEED + 1)
+
+static int girbil_change_speed(struct sir_dev *dev, unsigned speed)
+{
+	unsigned state = dev->fsm.substate;
+	unsigned delay = 0;
+	u8 control[2];
+	static int ret = 0;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* dongle alread reset - port and dongle at default speed */
+
+	switch(state) {
+
+	case SIRDEV_STATE_DONGLE_SPEED:
+
+		/* Set DTR and Clear RTS to enter command mode */
+		sirdev_set_dtr_rts(dev, FALSE, TRUE);
+
+		udelay(25);		/* better wait a little while */
+
+		ret = 0;
+		switch (speed) {
+		default:
+			ret = -EINVAL;
+			/* fall through */
+		case 9600:
+			control[0] = GIRBIL_9600;
+			break;
+		case 19200:
+			control[0] = GIRBIL_19200;
+			break;
+		case 34800:
+			control[0] = GIRBIL_38400;
+			break;
+		case 57600:
+			control[0] = GIRBIL_57600;
+			break;
+		case 115200:
+			control[0] = GIRBIL_115200;
+			break;
+		}
+		control[1] = GIRBIL_LOAD;
+	
+		/* Write control bytes */
+		sirdev_raw_write(dev, control, 2);
+
+		dev->speed = speed;
+
+		state = GIRBIL_STATE_WAIT_SPEED;
+		delay = 100;
+		break;
+
+	case GIRBIL_STATE_WAIT_SPEED:
+		/* Go back to normal mode */
+		sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+		udelay(25);		/* better wait a little while */
+		break;
+
+	default:
+		ERROR("%s - undefined state %d\n", __FUNCTION__, state);
+		ret = -EINVAL;
+		break;
+	}
+	dev->fsm.substate = state;
+	return (delay > 0) ? delay : ret;
+}
+
+/*
+ * Function girbil_reset (driver)
+ *
+ *      This function resets the girbil dongle.
+ *
+ *      Algorithm:
+ *    	  0. set RTS, and wait at least 5 ms
+ *        1. clear RTS
+ */
+
+
+#define GIRBIL_STATE_WAIT1_RESET	(SIRDEV_STATE_DONGLE_RESET + 1)
+#define GIRBIL_STATE_WAIT2_RESET	(SIRDEV_STATE_DONGLE_RESET + 2)
+#define GIRBIL_STATE_WAIT3_RESET	(SIRDEV_STATE_DONGLE_RESET + 3)
+
+static int girbil_reset(struct sir_dev *dev)
+{
+	unsigned state = dev->fsm.substate;
+	unsigned delay = 0;
+	u8 control = GIRBIL_TXEN | GIRBIL_RXEN;
+	int ret = 0;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	switch (state) {
+	case SIRDEV_STATE_DONGLE_RESET:
+		/* Reset dongle */
+		sirdev_set_dtr_rts(dev, TRUE, FALSE);
+		/* Sleep at least 5 ms */
+		delay = 20;
+		state = GIRBIL_STATE_WAIT1_RESET;
+		break;
+
+	case GIRBIL_STATE_WAIT1_RESET:
+		/* Set DTR and clear RTS to enter command mode */
+		sirdev_set_dtr_rts(dev, FALSE, TRUE);
+		delay = 20;
+		state = GIRBIL_STATE_WAIT2_RESET;
+		break;
+
+	case GIRBIL_STATE_WAIT2_RESET:
+		/* Write control byte */
+		sirdev_raw_write(dev, &control, 1);
+		delay = 20;
+		state = GIRBIL_STATE_WAIT3_RESET;
+		break;
+
+	case GIRBIL_STATE_WAIT3_RESET:
+		/* Go back to normal mode */
+		sirdev_set_dtr_rts(dev, TRUE, TRUE);
+		dev->speed = 9600;
+		break;
+
+	default:
+		ERROR("%s(), undefined state %d\n", __FUNCTION__, state);
+		ret = -1;
+		break;
+	}
+	dev->fsm.substate = state;
+	return (delay > 0) ? delay : ret;
+}
+
+MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no>");
+MODULE_DESCRIPTION("Greenwich GIrBIL dongle driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("irda-dongle-4"); /* IRDA_GIRBIL_DONGLE */
+
+module_init(girbil_init);
+module_exit(girbil_cleanup);
diff -Nru a/drivers/net/irda/girbil.c b/drivers/net/irda/girbil.c
--- a/drivers/net/irda/girbil.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/irda/girbil.c	Tue Feb  3 19:45:16 2004
@@ -71,12 +71,12 @@
 	.owner = THIS_MODULE,
 };
 
-int __init girbil_init(void)
+static int __init girbil_init(void)
 {
 	return irda_device_register_dongle(&dongle);
 }
 
-void __exit girbil_cleanup(void)
+static void __exit girbil_cleanup(void)
 {
 	irda_device_unregister_dongle(&dongle);
 }
diff -Nru a/drivers/net/irda/irport.c b/drivers/net/irda/irport.c
--- a/drivers/net/irda/irport.c	Tue Feb  3 19:45:33 2004
+++ b/drivers/net/irda/irport.c	Tue Feb  3 19:45:33 2004
@@ -98,7 +98,7 @@
 EXPORT_SYMBOL(irport_net_open);
 EXPORT_SYMBOL(irport_net_close);
 
-int __init irport_init(void)
+static int __init irport_init(void)
 {
  	int i;
 
diff -Nru a/drivers/net/irda/litelink-sir.c b/drivers/net/irda/litelink-sir.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/net/irda/litelink-sir.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,209 @@
+/*********************************************************************
+ *                
+ * Filename:      litelink.c
+ * Version:       1.1
+ * Description:   Driver for the Parallax LiteLink dongle
+ * Status:        Stable
+ * Author:        Dag Brattli <dagb@cs.uit.no>
+ * Created at:    Fri May  7 12:50:33 1999
+ * Modified at:   Fri Dec 17 09:14:23 1999
+ * Modified by:   Dag Brattli <dagb@cs.uit.no>
+ * 
+ *     Copyright (c) 1999 Dag Brattli, All Rights Reserved.
+ *     
+ *     This program is free software; you can redistribute it and/or 
+ *     modify it under the terms of the GNU General Public License as 
+ *     published by the Free Software Foundation; either version 2 of 
+ *     the License, or (at your option) any later version.
+ * 
+ *     This program is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *     GNU General Public License for more details.
+ * 
+ *     You should have received a copy of the GNU General Public License 
+ *     along with this program; if not, write to the Free Software 
+ *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
+ *     MA 02111-1307 USA
+ *     
+ ********************************************************************/
+
+/*
+ * Modified at:   Thu Jan 15 2003
+ * Modified by:   Eugene Crosser <crosser@average.org>
+ *
+ * Convert to "new" IRDA infrastructure for kernel 2.6
+ */
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+
+#include <net/irda/irda.h>
+
+#include "sir-dev.h"
+
+#define MIN_DELAY 25      /* 15 us, but wait a little more to be sure */
+#define MAX_DELAY 10000   /* 1 ms */
+
+static int litelink_open(struct sir_dev *dev);
+static int litelink_close(struct sir_dev *dev);
+static int litelink_change_speed(struct sir_dev *dev, unsigned speed);
+static int litelink_reset(struct sir_dev *dev);
+
+/* These are the baudrates supported - 9600 must be last one! */
+static unsigned baud_rates[] = { 115200, 57600, 38400, 19200, 9600 };
+
+static struct dongle_driver litelink = {
+	.owner		= THIS_MODULE,
+	.driver_name	= "Parallax LiteLink",
+	.type		= IRDA_LITELINK_DONGLE,
+	.open		= litelink_open,
+	.close		= litelink_close,
+	.reset		= litelink_reset,
+	.set_speed	= litelink_change_speed,
+};
+
+static int __init litelink_sir_init(void)
+{
+	return irda_register_dongle(&litelink);
+}
+
+static void __exit litelink_sir_cleanup(void)
+{
+	irda_unregister_dongle(&litelink);
+}
+
+static int litelink_open(struct sir_dev *dev)
+{
+	struct qos_info *qos = &dev->qos;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* Power up dongle */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+	/* Set the speeds we can accept */
+	qos->baud_rate.bits &= IR_115200|IR_57600|IR_38400|IR_19200|IR_9600;
+	qos->min_turn_time.bits = 0x7f; /* Needs 0.01 ms */
+	irda_qos_bits_to_value(qos);
+
+	/* irda thread waits 50 msec for power settling */
+
+	return 0;
+}
+
+static int litelink_close(struct sir_dev *dev)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* Power off dongle */
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
+
+	return 0;
+}
+
+/*
+ * Function litelink_change_speed (task)
+ *
+ *    Change speed of the Litelink dongle. To cycle through the available 
+ *    baud rates, pulse RTS low for a few ms.  
+ */
+static int litelink_change_speed(struct sir_dev *dev, unsigned speed)
+{
+        int i;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* dongle already reset by irda-thread - current speed (dongle and
+	 * port) is the default speed (115200 for litelink!)
+	 */
+
+	/* Cycle through avaiable baudrates until we reach the correct one */
+	for (i = 0; baud_rates[i] != speed; i++) {
+
+		/* end-of-list reached due to invalid speed request */
+		if (baud_rates[i] == 9600)
+			break;
+
+		/* Set DTR, clear RTS */
+		sirdev_set_dtr_rts(dev, FALSE, TRUE);
+
+		/* Sleep a minimum of 15 us */
+		udelay(MIN_DELAY);
+
+		/* Set DTR, Set RTS */
+		sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+		/* Sleep a minimum of 15 us */
+		udelay(MIN_DELAY);
+        }
+
+	dev->speed = baud_rates[i];
+
+	/* invalid baudrate should not happen - but if, we return -EINVAL and
+	 * the dongle configured for 9600 so the stack has a chance to recover
+	 */
+
+	return (dev->speed == speed) ? 0 : -EINVAL;
+}
+
+/*
+ * Function litelink_reset (task)
+ *
+ *      Reset the Litelink type dongle.
+ *
+ */
+static int litelink_reset(struct sir_dev *dev)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* probably the power-up can be dropped here, but with only
+	 * 15 usec delay it's not worth the risk unless somebody with
+	 * the hardware confirms it doesn't break anything...
+	 */
+
+	/* Power on dongle */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+	/* Sleep a minimum of 15 us */
+	udelay(MIN_DELAY);
+
+	/* Clear RTS to reset dongle */
+	sirdev_set_dtr_rts(dev, TRUE, FALSE);
+
+	/* Sleep a minimum of 15 us */
+	udelay(MIN_DELAY);
+
+	/* Go back to normal mode */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+	/* Sleep a minimum of 15 us */
+	udelay(MIN_DELAY);
+
+	/* This dongles speed defaults to 115200 bps */
+	dev->speed = 115200;
+
+	return 0;
+}
+
+MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no>");
+MODULE_DESCRIPTION("Parallax Litelink dongle driver");	
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("irda-dongle-5"); /* IRDA_LITELINK_DONGLE */
+
+/*
+ * Function init_module (void)
+ *
+ *    Initialize Litelink module
+ *
+ */
+module_init(litelink_sir_init);
+
+/*
+ * Function cleanup_module (void)
+ *
+ *    Cleanup Litelink module
+ *
+ */
+module_exit(litelink_sir_cleanup);
diff -Nru a/drivers/net/irda/litelink.c b/drivers/net/irda/litelink.c
--- a/drivers/net/irda/litelink.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/net/irda/litelink.c	Tue Feb  3 19:45:28 2004
@@ -56,12 +56,12 @@
 	.owner = THIS_MODULE,
 };
 
-int __init litelink_init(void)
+static int __init litelink_init(void)
 {
 	return irda_device_register_dongle(&dongle);
 }
 
-void __exit litelink_cleanup(void)
+static void __exit litelink_cleanup(void)
 {
 	irda_device_unregister_dongle(&dongle);
 }
diff -Nru a/drivers/net/irda/ma600-sir.c b/drivers/net/irda/ma600-sir.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/net/irda/ma600-sir.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,268 @@
+/*********************************************************************
+ *                
+ * Filename:      ma600.c
+ * Version:       0.1
+ * Description:   Implementation of the MA600 dongle
+ * Status:        Experimental.
+ * Author:        Leung <95Etwl@alumni.ee.ust.hk> http://www.engsvr.ust/~eetwl95
+ * Created at:    Sat Jun 10 20:02:35 2000
+ * Modified at:   Sat Aug 16 09:34:13 2003
+ * Modified by:   Martin Diehl <mad@mdiehl.de> (modified for new sir_dev)
+ *
+ * Note: very thanks to Mr. Maru Wang <maru@mobileaction.com.tw> for providing 
+ *       information on the MA600 dongle
+ * 
+ *     Copyright (c) 2000 Leung, All Rights Reserved.
+ *      
+ *     This program is free software; you can redistribute it and/or 
+ *     modify it under the terms of the GNU General Public License as 
+ *     published by the Free Software Foundation; either version 2 of 
+ *     the License, or (at your option) any later version.
+ *  
+ *     This program is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *     GNU General Public License for more details.
+ * 
+ *     You should have received a copy of the GNU General Public License 
+ *     along with this program; if not, write to the Free Software 
+ *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
+ *     MA 02111-1307 USA
+ *     
+ ********************************************************************/
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+
+#include <net/irda/irda.h>
+
+#include "sir-dev.h"
+
+static int ma600_open(struct sir_dev *);
+static int ma600_close(struct sir_dev *);
+static int ma600_change_speed(struct sir_dev *, unsigned);
+static int ma600_reset(struct sir_dev *);
+
+/* control byte for MA600 */
+#define MA600_9600	0x00
+#define MA600_19200	0x01
+#define MA600_38400	0x02
+#define MA600_57600	0x03
+#define MA600_115200	0x04
+#define MA600_DEV_ID1	0x05
+#define MA600_DEV_ID2	0x06
+#define MA600_2400	0x08
+
+static struct dongle_driver ma600 = {
+	.owner          = THIS_MODULE,
+	.driver_name    = "MA600",
+	.type           = IRDA_MA600_DONGLE,
+	.open           = ma600_open,
+	.close          = ma600_close,
+	.reset          = ma600_reset,
+	.set_speed      = ma600_change_speed,
+};
+
+
+static int __init ma600_sir_init(void)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+	return irda_register_dongle(&ma600);
+}
+
+static void __exit ma600_sir_cleanup(void)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+	irda_unregister_dongle(&ma600);
+}
+
+/*
+	Power on:
+		(0) Clear RTS and DTR for 1 second
+		(1) Set RTS and DTR for 1 second
+		(2) 9600 bps now
+	Note: assume RTS, DTR are clear before
+*/
+static int ma600_open(struct sir_dev *dev)
+{
+	struct qos_info *qos = &dev->qos;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+	/* Explicitly set the speeds we can accept */
+	qos->baud_rate.bits &= IR_2400|IR_9600|IR_19200|IR_38400
+				|IR_57600|IR_115200;
+	/* Hm, 0x01 means 10ms - for >= 1ms we would need 0x07 */
+	qos->min_turn_time.bits = 0x01;		/* Needs at least 1 ms */	
+	irda_qos_bits_to_value(qos);
+
+	/* irda thread waits 50 msec for power settling */
+
+	return 0;
+}
+
+static int ma600_close(struct sir_dev *dev)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* Power off dongle */
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
+
+	return 0;
+}
+
+static __u8 get_control_byte(__u32 speed)
+{
+	__u8 byte;
+
+	switch (speed) {
+	default:
+	case 115200:
+		byte = MA600_115200;
+		break;
+	case 57600:
+		byte = MA600_57600;
+		break;
+	case 38400:
+		byte = MA600_38400;
+		break;
+	case 19200:
+		byte = MA600_19200;
+		break;
+	case 9600:
+		byte = MA600_9600;
+		break;
+	case 2400:
+		byte = MA600_2400;
+		break;
+	}
+
+	return byte;
+}
+
+/*
+ * Function ma600_change_speed (dev, speed)
+ *
+ *    Set the speed for the MA600 type dongle.
+ *
+ *    The dongle has already been reset to a known state (dongle default)
+ *    We cycle through speeds by pulsing RTS low and then high.
+ */
+
+/*
+ * Function ma600_change_speed (dev, speed)
+ *
+ *    Set the speed for the MA600 type dongle.
+ *
+ *    Algorithm
+ *    1. Reset (already done by irda thread state machine)
+ *    2. clear RTS, set DTR and wait for 1ms
+ *    3. send Control Byte to the MA600 through TXD to set new baud rate
+ *       wait until the stop bit of Control Byte is sent (for 9600 baud rate, 
+ *       it takes about 10 msec)
+ *    4. set RTS, set DTR (return to NORMAL Operation)
+ *    5. wait at least 10 ms, new setting (baud rate, etc) takes effect here 
+ *       after
+ */
+
+/* total delays are only about 20ms - let's just sleep for now to
+ * avoid the state machine complexity before we get things working
+ */
+
+static int ma600_change_speed(struct sir_dev *dev, unsigned speed)
+{
+	u8	byte;
+	
+	IRDA_DEBUG(2, "%s(), speed=%d (was %d)\n", __FUNCTION__,
+		speed, dev->speed);
+
+	/* dongle already reset, dongle and port at default speed (9600) */
+
+	/* Set RTS low for 1 ms */
+	sirdev_set_dtr_rts(dev, TRUE, FALSE);
+	mdelay(1);
+
+	/* Write control byte */
+	byte = get_control_byte(speed);
+	sirdev_raw_write(dev, &byte, sizeof(byte));
+
+	/* Wait at least 10ms: fake wait_until_sent - 10 bits at 9600 baud*/
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout(MSECS_TO_JIFFIES(15));		/* old ma600 uses 15ms */
+
+#if 1
+	/* read-back of the control byte. ma600 is the first dongle driver
+	 * which uses this so there might be some unidentified issues.
+	 * Disable this in case of problems with readback.
+	 */
+
+	sirdev_raw_read(dev, &byte, sizeof(byte));
+	if (byte != get_control_byte(speed))  {
+		WARNING("%s(): bad control byte read-back %02x != %02x\n",
+			__FUNCTION__, (unsigned) byte,
+			(unsigned) get_control_byte(speed));
+		return -1;
+	}
+	else
+		IRDA_DEBUG(2, "%s() control byte write read OK\n", __FUNCTION__);
+#endif
+
+	/* Set DTR, Set RTS */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+	/* Wait at least 10ms */
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout(MSECS_TO_JIFFIES(10));
+
+	/* dongle is now switched to the new speed */
+	dev->speed = speed;
+
+	return 0;
+}
+
+/*
+ * Function ma600_reset (dev)
+ *
+ *      This function resets the ma600 dongle.
+ *
+ *      Algorithm:
+ *    	  0. DTR=0, RTS=1 and wait 10 ms
+ *    	  1. DTR=1, RTS=1 and wait 10 ms
+ *        2. 9600 bps now
+ */
+
+/* total delays are only about 20ms - let's just sleep for now to
+ * avoid the state machine complexity before we get things working
+ */
+
+int ma600_reset(struct sir_dev *dev)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* Reset the dongle : set DTR low for 10 ms */
+	sirdev_set_dtr_rts(dev, FALSE, TRUE);
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout(MSECS_TO_JIFFIES(10));
+
+	/* Go back to normal mode */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout(MSECS_TO_JIFFIES(10));
+
+	dev->speed = 9600;      /* That's the dongle-default */
+
+	return 0;
+}
+
+MODULE_AUTHOR("Leung <95Etwl@alumni.ee.ust.hk> http://www.engsvr.ust/~eetwl95");
+MODULE_DESCRIPTION("MA600 dongle driver version 0.1");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("irda-dongle-11"); /* IRDA_MA600_DONGLE */
+		
+module_init(ma600_sir_init);
+module_exit(ma600_sir_cleanup);
+
diff -Nru a/drivers/net/irda/ma600.c b/drivers/net/irda/ma600.c
--- a/drivers/net/irda/ma600.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/irda/ma600.c	Tue Feb  3 19:45:17 2004
@@ -82,13 +82,13 @@
 	.owner = THIS_MODULE,
 };
 
-int __init ma600_init(void)
+static int __init ma600_init(void)
 {
 	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 	return irda_device_register_dongle(&dongle);
 }
 
-void __exit ma600_cleanup(void)
+static void __exit ma600_cleanup(void)
 {
 	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 	irda_device_unregister_dongle(&dongle);
diff -Nru a/drivers/net/irda/mcp2120-sir.c b/drivers/net/irda/mcp2120-sir.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/net/irda/mcp2120-sir.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,230 @@
+/*********************************************************************
+ *            
+ *    
+ * Filename:      mcp2120.c
+ * Version:       1.0
+ * Description:   Implementation for the MCP2120 (Microchip)
+ * Status:        Experimental.
+ * Author:        Felix Tang (tangf@eyetap.org)
+ * Created at:    Sun Mar 31 19:32:12 EST 2002
+ * Based on code by:   Dag Brattli <dagb@cs.uit.no>
+ * 
+ *     Copyright (c) 2002 Felix Tang, All Rights Reserved.
+ *      
+ *     This program is free software; you can redistribute it and/or 
+ *     modify it under the terms of the GNU General Public License as 
+ *     published by the Free Software Foundation; either version 2 of 
+ *     the License, or (at your option) any later version.
+ *  
+ ********************************************************************/
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+
+#include <net/irda/irda.h>
+
+#include "sir-dev.h"
+
+static int mcp2120_reset(struct sir_dev *dev);
+static int mcp2120_open(struct sir_dev *dev);
+static int mcp2120_close(struct sir_dev *dev);
+static int mcp2120_change_speed(struct sir_dev *dev, unsigned speed);
+
+#define MCP2120_9600    0x87
+#define MCP2120_19200   0x8B
+#define MCP2120_38400   0x85
+#define MCP2120_57600   0x83
+#define MCP2120_115200  0x81
+
+#define MCP2120_COMMIT  0x11
+
+static struct dongle_driver mcp2120 = {
+	.owner		= THIS_MODULE,
+	.driver_name	= "Microchip MCP2120",
+	.type		= IRDA_MCP2120_DONGLE,
+	.open		= mcp2120_open,
+	.close		= mcp2120_close,
+	.reset		= mcp2120_reset,
+	.set_speed	= mcp2120_change_speed,
+};
+
+static int __init mcp2120_init(void)
+{
+	return irda_register_dongle(&mcp2120);
+}
+
+static void __exit mcp2120_cleanup(void)
+{
+	irda_unregister_dongle(&mcp2120);
+}
+
+static int mcp2120_open(struct sir_dev *dev)
+{
+	struct qos_info *qos = &dev->qos;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* seems no explicit power-on required here and reset switching it on anyway */
+
+	qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;
+	qos->min_turn_time.bits = 0x01;
+	irda_qos_bits_to_value(qos);
+
+	return 0;
+}
+
+static int mcp2120_close(struct sir_dev *dev)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* Power off dongle */
+        /* reset and inhibit mcp2120 */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+	// sirdev_set_dtr_rts(dev, FALSE, FALSE);
+
+	return 0;
+}
+
+/*
+ * Function mcp2120_change_speed (dev, speed)
+ *
+ *    Set the speed for the MCP2120.
+ *
+ */
+
+#define MCP2120_STATE_WAIT_SPEED	(SIRDEV_STATE_DONGLE_SPEED+1)
+
+static int mcp2120_change_speed(struct sir_dev *dev, unsigned speed)
+{
+	unsigned state = dev->fsm.substate;
+	unsigned delay = 0;
+	u8 control[2];
+	static int ret = 0;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	switch (state) {
+	case SIRDEV_STATE_DONGLE_SPEED:
+		/* Set DTR to enter command mode */
+		sirdev_set_dtr_rts(dev, TRUE, FALSE);
+                udelay(500);
+
+		ret = 0;
+		switch (speed) {
+		default:
+			speed = 9600;
+			ret = -EINVAL;
+			/* fall through */
+		case 9600:
+			control[0] = MCP2120_9600;
+                        //printk("mcp2120 9600\n");
+			break;
+		case 19200:
+			control[0] = MCP2120_19200;
+                        //printk("mcp2120 19200\n");
+			break;
+		case 34800:
+			control[0] = MCP2120_38400;
+                        //printk("mcp2120 38400\n");
+			break;
+		case 57600:
+			control[0] = MCP2120_57600;
+                        //printk("mcp2120 57600\n");
+			break;
+		case 115200:
+                        control[0] = MCP2120_115200;
+                        //printk("mcp2120 115200\n");
+			break;
+		}
+		control[1] = MCP2120_COMMIT;
+	
+		/* Write control bytes */
+		sirdev_raw_write(dev, control, 2);
+		dev->speed = speed;
+
+		state = MCP2120_STATE_WAIT_SPEED;
+		delay = 100;
+                //printk("mcp2120_change_speed: dongle_speed\n");
+		break;
+
+	case MCP2120_STATE_WAIT_SPEED:
+		/* Go back to normal mode */
+		sirdev_set_dtr_rts(dev, FALSE, FALSE);
+                //printk("mcp2120_change_speed: mcp_wait\n");
+		break;
+
+	default:
+		ERROR("%s(), undefine state %d\n", __FUNCTION__, state);
+		ret = -EINVAL;
+		break;
+	}
+	dev->fsm.substate = state;
+	return (delay > 0) ? delay : ret;
+}
+
+/*
+ * Function mcp2120_reset (driver)
+ *
+ *      This function resets the mcp2120 dongle.
+ *      
+ *      Info: -set RTS to reset mcp2120
+ *            -set DTR to set mcp2120 software command mode
+ *            -mcp2120 defaults to 9600 baud after reset
+ *
+ *      Algorithm:
+ *      0. Set RTS to reset mcp2120.
+ *      1. Clear RTS and wait for device reset timer of 30 ms (max).
+ *      
+ */
+
+#define MCP2120_STATE_WAIT1_RESET	(SIRDEV_STATE_DONGLE_RESET+1)
+#define MCP2120_STATE_WAIT2_RESET	(SIRDEV_STATE_DONGLE_RESET+2)
+
+static int mcp2120_reset(struct sir_dev *dev)
+{
+	unsigned state = dev->fsm.substate;
+	unsigned delay = 0;
+	int ret = 0;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	switch (state) {
+	case SIRDEV_STATE_DONGLE_RESET:
+                //printk("mcp2120_reset: dongle_reset\n");
+		/* Reset dongle by setting RTS*/
+		sirdev_set_dtr_rts(dev, TRUE, TRUE);
+		state = MCP2120_STATE_WAIT1_RESET;
+		delay = 50;
+		break;
+
+	case MCP2120_STATE_WAIT1_RESET:
+                //printk("mcp2120_reset: mcp2120_wait1\n");
+                /* clear RTS and wait for at least 30 ms. */
+		sirdev_set_dtr_rts(dev, FALSE, FALSE);
+		state = MCP2120_STATE_WAIT2_RESET;
+		delay = 50;
+		break;
+
+	case MCP2120_STATE_WAIT2_RESET:
+                //printk("mcp2120_reset mcp2120_wait2\n");
+		/* Go back to normal mode */
+		sirdev_set_dtr_rts(dev, FALSE, FALSE);
+		break;
+
+	default:
+		ERROR("%s(), undefined state %d\n", __FUNCTION__, state);
+		ret = -EINVAL;
+		break;
+	}
+	dev->fsm.substate = state;
+	return (delay > 0) ? delay : ret;
+}
+
+MODULE_AUTHOR("Felix Tang <tangf@eyetap.org>");
+MODULE_DESCRIPTION("Microchip MCP2120");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("irda-dongle-9"); /* IRDA_MCP2120_DONGLE */
+
+module_init(mcp2120_init);
+module_exit(mcp2120_cleanup);
diff -Nru a/drivers/net/irda/mcp2120.c b/drivers/net/irda/mcp2120.c
--- a/drivers/net/irda/mcp2120.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/net/irda/mcp2120.c	Tue Feb  3 19:45:42 2004
@@ -48,12 +48,12 @@
 	.owner = THIS_MODULE,
 };
 
-int __init mcp2120_init(void)
+static int __init mcp2120_init(void)
 {
 	return irda_device_register_dongle(&dongle);
 }
 
-void __exit mcp2120_cleanup(void)
+static void __exit mcp2120_cleanup(void)
 {
 	irda_device_unregister_dongle(&dongle);
 }
diff -Nru a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c
--- a/drivers/net/irda/nsc-ircc.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/irda/nsc-ircc.c	Tue Feb  3 19:45:16 2004
@@ -155,7 +155,7 @@
  *    Initialize chip. Just try to find out how many chips we are dealing with
  *    and where they are
  */
-int __init nsc_ircc_init(void)
+static int __init nsc_ircc_init(void)
 {
 	chipio_t info;
 	nsc_chip_t *chip;
diff -Nru a/drivers/net/irda/old_belkin-sir.c b/drivers/net/irda/old_belkin-sir.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/net/irda/old_belkin-sir.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,156 @@
+/*********************************************************************
+ *                
+ * Filename:      old_belkin.c
+ * Version:       1.1
+ * Description:   Driver for the Belkin (old) SmartBeam dongle
+ * Status:        Experimental...
+ * Author:        Jean Tourrilhes <jt@hpl.hp.com>
+ * Created at:    22/11/99
+ * Modified at:   Fri Dec 17 09:13:32 1999
+ * Modified by:   Dag Brattli <dagb@cs.uit.no>
+ * 
+ *     Copyright (c) 1999 Jean Tourrilhes, All Rights Reserved.
+ *     
+ *     This program is free software; you can redistribute it and/or 
+ *     modify it under the terms of the GNU General Public License as 
+ *     published by the Free Software Foundation; either version 2 of 
+ *     the License, or (at your option) any later version.
+ * 
+ *     This program is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *     GNU General Public License for more details.
+ * 
+ *     You should have received a copy of the GNU General Public License 
+ *     along with this program; if not, write to the Free Software 
+ *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
+ *     MA 02111-1307 USA
+ *     
+ ********************************************************************/
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+
+#include <net/irda/irda.h>
+// #include <net/irda/irda_device.h>
+
+#include "sir-dev.h"
+
+/*
+ * Belkin is selling a dongle called the SmartBeam.
+ * In fact, there is two hardware version of this dongle, of course with
+ * the same name and looking the exactly same (grrr...).
+ * I guess that I've got the old one, because inside I don't have
+ * a jumper for IrDA/ASK...
+ *
+ * As far as I can make it from info on their web site, the old dongle 
+ * support only 9600 b/s, which make our life much simpler as far as
+ * the driver is concerned, but you might not like it very much ;-)
+ * The new SmartBeam does 115 kb/s, and I've not tested it...
+ *
+ * Belkin claim that the correct driver for the old dongle (in Windows)
+ * is the generic Parallax 9500a driver, but the Linux LiteLink driver
+ * fails for me (probably because Linux-IrDA doesn't rate fallback),
+ * so I created this really dumb driver...
+ *
+ * In fact, this driver doesn't do much. The only thing it does is to
+ * prevent Linux-IrDA to use any other speed than 9600 b/s ;-) This
+ * driver is called "old_belkin" so that when the new SmartBeam is supported
+ * its driver can be called "belkin" instead of "new_belkin".
+ *
+ * Note : this driver was written without any info/help from Belkin,
+ * so a lot of info here might be totally wrong. Blame me ;-)
+ */
+
+static int old_belkin_open(struct sir_dev *dev);
+static int old_belkin_close(struct sir_dev *dev);
+static int old_belkin_change_speed(struct sir_dev *dev, unsigned speed);
+static int old_belkin_reset(struct sir_dev *dev);
+
+static struct dongle_driver old_belkin = {
+	.owner		= THIS_MODULE,
+	.driver_name	= "Old Belkin SmartBeam",
+	.type		= IRDA_OLD_BELKIN_DONGLE,
+	.open		= old_belkin_open,
+	.close		= old_belkin_close,
+	.reset		= old_belkin_reset,
+	.set_speed	= old_belkin_change_speed,
+};
+
+static int __init old_belkin_init(void)
+{
+	return irda_register_dongle(&old_belkin);
+}
+
+static void __exit old_belkin_cleanup(void)
+{
+	irda_unregister_dongle(&old_belkin);
+}
+
+static int old_belkin_open(struct sir_dev *dev)
+{
+	struct qos_info *qos = &dev->qos;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* Power on dongle */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+	/* Not too fast, please... */
+	qos->baud_rate.bits &= IR_9600;
+	/* Needs at least 10 ms (totally wild guess, can do probably better) */
+	qos->min_turn_time.bits = 0x01;
+	irda_qos_bits_to_value(qos);
+
+	/* irda thread waits 50 msec for power settling */
+
+	return 0;
+}
+
+static int old_belkin_close(struct sir_dev *dev)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* Power off dongle */
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
+
+	return 0;
+}
+
+/*
+ * Function old_belkin_change_speed (task)
+ *
+ *    With only one speed available, not much to do...
+ */
+static int old_belkin_change_speed(struct sir_dev *dev, unsigned speed)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	dev->speed = 9600;
+	return (speed==dev->speed) ? 0 : -EINVAL;
+}
+
+/*
+ * Function old_belkin_reset (task)
+ *
+ *      Reset the Old-Belkin type dongle.
+ *
+ */
+static int old_belkin_reset(struct sir_dev *dev)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* This dongles speed "defaults" to 9600 bps ;-) */
+	dev->speed = 9600;
+
+	return 0;
+}
+
+MODULE_AUTHOR("Jean Tourrilhes <jt@hpl.hp.com>");
+MODULE_DESCRIPTION("Belkin (old) SmartBeam dongle driver");	
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("irda-dongle-7"); /* IRDA_OLD_BELKIN_DONGLE */
+
+module_init(old_belkin_init);
+module_exit(old_belkin_cleanup);
diff -Nru a/drivers/net/irda/old_belkin.c b/drivers/net/irda/old_belkin.c
--- a/drivers/net/irda/old_belkin.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/net/irda/old_belkin.c	Tue Feb  3 19:45:42 2004
@@ -82,12 +82,12 @@
 	.owner = THIS_MODULE,
 };
 
-int __init old_belkin_init(void)
+static int __init old_belkin_init(void)
 {
 	return irda_device_register_dongle(&dongle);
 }
 
-void __exit old_belkin_cleanup(void)
+static void __exit old_belkin_cleanup(void)
 {
 	irda_device_unregister_dongle(&dongle);
 }
diff -Nru a/drivers/net/irda/sir-dev.h b/drivers/net/irda/sir-dev.h
--- a/drivers/net/irda/sir-dev.h	Tue Feb  3 19:45:28 2004
+++ b/drivers/net/irda/sir-dev.h	Tue Feb  3 19:45:28 2004
@@ -121,15 +121,17 @@
 extern void sirdev_write_complete(struct sir_dev *dev);
 extern int sirdev_receive(struct sir_dev *dev, const unsigned char *cp, size_t count);
 
+/* low level helpers for SIR device/dongle setup */
+extern int sirdev_raw_write(struct sir_dev *dev, const char *buf, int len);
+extern int sirdev_raw_read(struct sir_dev *dev, char *buf, int len);
+extern int sirdev_set_dtr_rts(struct sir_dev *dev, int dtr, int rts);
+
 /* not exported */
 
 extern int sirdev_get_dongle(struct sir_dev *self, IRDA_DONGLE type);
 extern int sirdev_put_dongle(struct sir_dev *self);
 
-extern int sirdev_raw_write(struct sir_dev *dev, const char *buf, int len);
-extern int sirdev_raw_read(struct sir_dev *dev, char *buf, int len);
 extern void sirdev_enable_rx(struct sir_dev *dev);
-
 extern int sirdev_schedule_request(struct sir_dev *dev, int state, unsigned param);
 extern int __init irda_thread_create(void);
 extern void __exit irda_thread_join(void);
@@ -179,6 +181,7 @@
 
 	struct sir_fsm fsm;
 	atomic_t enable_rx;
+	int raw_tx;
 	spinlock_t tx_lock;
 
 	u32 new_speed;
@@ -194,10 +197,6 @@
 	const struct sir_driver * drv;
 	void *priv;
 
-	/* dongle callbacks to the SIR device */
-	int (*read)(struct sir_dev *, char *buf, int len);
-	int (*write)(struct sir_dev *, const char *buf, int len);
-	int (*set_dtr_rts)(struct sir_dev *, int dtr, int rts);
 };
 
 #endif	/* IRDA_SIR_H */
diff -Nru a/drivers/net/irda/sir_core.c b/drivers/net/irda/sir_core.c
--- a/drivers/net/irda/sir_core.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/irda/sir_core.c	Tue Feb  3 19:45:17 2004
@@ -37,6 +37,10 @@
 EXPORT_SYMBOL(sirdev_write_complete);
 EXPORT_SYMBOL(sirdev_receive);
 
+EXPORT_SYMBOL(sirdev_raw_write);
+EXPORT_SYMBOL(sirdev_raw_read);
+EXPORT_SYMBOL(sirdev_set_dtr_rts);
+
 static int __init sir_core_init(void)
 {
 	return irda_thread_create();
diff -Nru a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c
--- a/drivers/net/irda/sir_dev.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/net/irda/sir_dev.c	Tue Feb  3 19:45:30 2004
@@ -31,7 +31,9 @@
 
 	/* flush rx-buffer - should also help in case of problems with echo cancelation */
 	dev->rx_buff.data = dev->rx_buff.head;
-	dev->tx_buff.len = 0;
+	dev->rx_buff.len = 0;
+	dev->rx_buff.in_frame = FALSE;
+	dev->rx_buff.state = OUTSIDE_FRAME;
 	atomic_set(&dev->enable_rx, 1);
 }
 
@@ -62,24 +64,34 @@
 
 int sirdev_raw_write(struct sir_dev *dev, const char *buf, int len)
 {
+	unsigned long flags;
 	int ret;
 
 	if (unlikely(len > dev->tx_buff.truesize))
 		return -ENOSPC;
 
-	spin_lock_bh(&dev->tx_lock);		/* serialize with other tx operations */
-	while (dev->tx_buff.len > 0) {		/* wait until tx idle */
-		spin_unlock_bh(&dev->tx_lock);
+	spin_lock_irqsave(&dev->tx_lock, flags);	/* serialize with other tx operations */
+	while (dev->tx_buff.len > 0) {			/* wait until tx idle */
+		spin_unlock_irqrestore(&dev->tx_lock, flags);
 		set_current_state(TASK_UNINTERRUPTIBLE);
 		schedule_timeout(MSECS_TO_JIFFIES(10));
-		spin_lock_bh(&dev->tx_lock);
+		spin_lock_irqsave(&dev->tx_lock, flags);
 	}
 
 	dev->tx_buff.data = dev->tx_buff.head;
 	memcpy(dev->tx_buff.data, buf, len);	
+	dev->tx_buff.len = len;
 
 	ret = dev->drv->do_write(dev, dev->tx_buff.data, dev->tx_buff.len);
-	spin_unlock_bh(&dev->tx_lock);
+	if (ret > 0) {
+		IRDA_DEBUG(3, "%s(), raw-tx started\n", __FUNCTION__);
+
+		dev->tx_buff.data += ret;
+		dev->tx_buff.len -= ret;
+		dev->raw_tx = 1;
+		ret = len;		/* all data is going to be sent */
+	}
+	spin_unlock_irqrestore(&dev->tx_lock, flags);
 	return ret;
 }
 
@@ -94,17 +106,25 @@
 
 	count = (len < dev->rx_buff.len) ? len : dev->rx_buff.len;
 
-	if (count > 0)
-		memcpy(buf, dev->rx_buff.head, count);
+	if (count > 0) {
+		memcpy(buf, dev->rx_buff.data, count);
+		dev->rx_buff.data += count;
+		dev->rx_buff.len -= count;
+	}
 
-	/* forget trailing stuff */
-	dev->rx_buff.data = dev->rx_buff.head;
-	dev->rx_buff.len = 0;
-	dev->rx_buff.state = OUTSIDE_FRAME;
+	/* remaining stuff gets flushed when re-enabling normal rx */
 
 	return count;
 }
 
+int sirdev_set_dtr_rts(struct sir_dev *dev, int dtr, int rts)
+{
+	int ret = -ENXIO;
+	if (dev->drv->set_dtr_rts != 0)
+		ret =  dev->drv->set_dtr_rts(dev, dtr, rts);
+	return ret;
+}
+	
 /**********************************************************************/
 
 /* called from client driver - likely with bh-context - to indicate
@@ -114,11 +134,12 @@
 
 void sirdev_write_complete(struct sir_dev *dev)
 {
+	unsigned long flags;
 	struct sk_buff *skb;
 	int actual = 0;
 	int err;
 	
-	spin_lock_bh(&dev->tx_lock);
+	spin_lock_irqsave(&dev->tx_lock, flags);
 
 	IRDA_DEBUG(3, "%s() - dev->tx_buff.len = %d\n",
 		   __FUNCTION__, dev->tx_buff.len);
@@ -143,11 +164,24 @@
 			dev->tx_buff.len = 0;
 		}
 		if (dev->tx_buff.len > 0) {
-			spin_unlock_bh(&dev->tx_lock);
+			spin_unlock_irqrestore(&dev->tx_lock, flags);
 			return;
 		}
 	}
 
+	if (unlikely(dev->raw_tx != 0)) {
+		/* in raw mode we are just done now after the buffer was sent
+		 * completely. Since this was requested by some dongle driver
+		 * running under the control of the irda-thread we must take
+		 * care here not to re-enable the queue. The queue will be
+		 * restarted when the irda-thread has completed the request.
+		 */
+
+		IRDA_DEBUG(3, "%s(), raw-tx done\n", __FUNCTION__);
+		dev->raw_tx = 0;
+		return;
+	}
+
 	/* we have finished now sending this skb.
 	 * update statistics and free the skb.
 	 * finally we check and trigger a pending speed change, if any.
@@ -190,7 +224,7 @@
 		netif_wake_queue(dev->netdev);
 	}
 
-	spin_unlock_bh(&dev->tx_lock);
+	spin_unlock_irqrestore(&dev->tx_lock, flags);
 }
 
 /* called from client driver - likely with bh-context - to give us
@@ -258,6 +292,7 @@
 static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
 {
 	struct sir_dev *dev = ndev->priv;
+	unsigned long flags;
 	int actual = 0;
 	int err;
 	s32 speed;
@@ -307,7 +342,7 @@
 	}
 
 	/* serialize with write completion */
-	spin_lock_bh(&dev->tx_lock);
+	spin_lock_irqsave(&dev->tx_lock, flags);
 
         /* Copy skb to tx_buff while wrapping, stuffing and making CRC */
 	dev->tx_buff.len = async_wrap_skb(skb, dev->tx_buff.data, dev->tx_buff.truesize); 
@@ -337,7 +372,7 @@
 		dev->stats.tx_dropped++;		      
 		netif_wake_queue(ndev);
 	}
-	spin_unlock_bh(&dev->tx_lock);
+	spin_unlock_irqrestore(&dev->tx_lock, flags);
 
 	return 0;
 }
@@ -479,6 +514,7 @@
 		goto errout_free;
 
 	sirdev_enable_rx(dev);
+	dev->raw_tx = 0;
 
 	netif_start_queue(ndev);
 	dev->irlap = irlap_open(ndev, &dev->qos, dev->hwname);
diff -Nru a/drivers/net/irda/sir_dongle.c b/drivers/net/irda/sir_dongle.c
--- a/drivers/net/irda/sir_dongle.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/irda/sir_dongle.c	Tue Feb  3 19:45:17 2004
@@ -102,12 +102,6 @@
 		err = -ESTALE;
 		goto out_unlock;	/* rmmod already pending */
 	}
-
-	/* Initialize dongle driver callbacks */
-	dev->read        = sirdev_raw_read;
-	dev->write       = sirdev_raw_write;
-	dev->set_dtr_rts = dev->drv->set_dtr_rts;
-
 	dev->dongle_drv = drv;
 
 	if (!drv->open  ||  (err=drv->open(dev))!=0)
diff -Nru a/drivers/net/irda/sir_kthread.c b/drivers/net/irda/sir_kthread.c
--- a/drivers/net/irda/sir_kthread.c	Tue Feb  3 19:45:40 2004
+++ b/drivers/net/irda/sir_kthread.c	Tue Feb  3 19:45:40 2004
@@ -311,15 +311,9 @@
 			break;
 
 		case SIRDEV_STATE_SET_DTR_RTS:
-			if (dev->drv->set_dtr_rts) {
-				int	dtr, rts;
-
-				dtr = (fsm->param&0x02) ? TRUE : FALSE;
-				rts = (fsm->param&0x01) ? TRUE : FALSE;
-				ret = dev->drv->set_dtr_rts(dev,dtr,rts);
-			}
-			else
-				ret = -EINVAL;
+			ret = sirdev_set_dtr_rts(dev,
+				(fsm->param&0x02) ? TRUE : FALSE,
+				(fsm->param&0x01) ? TRUE : FALSE);
 			next_state = SIRDEV_STATE_DONE;
 			break;
 
@@ -436,14 +430,13 @@
 
 	IRDA_DEBUG(2, "%s - state=0x%04x / param=%u\n", __FUNCTION__, initial_state, param);
 
-	if (in_interrupt()) {
-		if (down_trylock(&fsm->sem)) {
+	if (down_trylock(&fsm->sem)) {
+		if (in_interrupt()  ||  in_atomic()  ||  irqs_disabled()) {
 			IRDA_DEBUG(1, "%s(), state machine busy!\n", __FUNCTION__);
 			return -EWOULDBLOCK;
-		}
+		} else
+			down(&fsm->sem);
 	}
-	else
-		down(&fsm->sem);
 
 	if (fsm->state == SIRDEV_STATE_DEAD) {
 		/* race with sirdev_close should never happen */
diff -Nru a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c
--- a/drivers/net/irda/smsc-ircc2.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/net/irda/smsc-ircc2.c	Tue Feb  3 19:45:30 2004
@@ -322,7 +322,7 @@
  *    Initialize chip. Just try to find out how many chips we are dealing with
  *    and where they are
  */
-int __init smsc_ircc_init(void)
+static int __init smsc_ircc_init(void)
 {
 	int ret=-ENODEV;
 
@@ -1727,7 +1727,7 @@
 	return 0;
 }
 
-void __exit smsc_ircc_cleanup(void)
+static void __exit smsc_ircc_cleanup(void)
 {
 	int i;
 
diff -Nru a/drivers/net/irda/tekram-sir.c b/drivers/net/irda/tekram-sir.c
--- a/drivers/net/irda/tekram-sir.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/irda/tekram-sir.c	Tue Feb  3 19:45:17 2004
@@ -34,7 +34,7 @@
 
 MODULE_PARM(tekram_delay, "i");
 MODULE_PARM_DESC(tekram_delay, "tekram dongle write complete delay");
-static int tekram_delay = 50;		/* default is 50 ms */
+static int tekram_delay = 150;		/* default is 150 ms */
 
 static int tekram_open(struct sir_dev *);
 static int tekram_close(struct sir_dev *);
@@ -59,14 +59,16 @@
 	.set_speed	= tekram_change_speed,
 };
 
-int __init tekram_sir_init(void)
+static int __init tekram_sir_init(void)
 {
-	if (tekram_delay < 1  ||  tekram_delay>500)
+	if (tekram_delay < 1  ||  tekram_delay > 500)
 		tekram_delay = 200;
+	IRDA_DEBUG(1, "%s - using %d ms delay\n",
+		tekram.driver_name, tekram_delay);
 	return irda_register_dongle(&tekram);
 }
 
-void __exit tekram_sir_cleanup(void)
+static void __exit tekram_sir_cleanup(void)
 {
 	irda_unregister_dongle(&tekram);
 }
@@ -77,7 +79,8 @@
 
 	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
-	dev->set_dtr_rts(dev, TRUE, TRUE);
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
 	qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;
 	qos->min_turn_time.bits = 0x01; /* Needs at least 10 ms */	
 	irda_qos_bits_to_value(qos);
@@ -92,7 +95,7 @@
 	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	/* Power off dongle */
-	dev->set_dtr_rts(dev, FALSE, FALSE);
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
 
 	return 0;
 }
@@ -122,19 +125,20 @@
 
 static int tekram_change_speed(struct sir_dev *dev, unsigned speed)
 {
+	unsigned state = dev->fsm.substate;
 	unsigned delay = 0;
-	unsigned next_state = dev->fsm.substate;
 	u8 byte;
+	static int ret = 0;
 	
 	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
-	switch(dev->fsm.substate) {
-
+	switch(state) {
 	case SIRDEV_STATE_DONGLE_SPEED:
 
 		switch (speed) {
 		default:
 			speed = 9600;
+			ret = -EINVAL;
 			/* fall thru */
 		case 9600:
 			byte = TEKRAM_PW|TEKRAM_9600;
@@ -154,36 +158,34 @@
 		}
 
 		/* Set DTR, Clear RTS */
-		dev->set_dtr_rts(dev, TRUE, FALSE);
+		sirdev_set_dtr_rts(dev, TRUE, FALSE);
 	
 		/* Wait at least 7us */
 		udelay(14);
 
 		/* Write control byte */
-		dev->write(dev, &byte, 1);
+		sirdev_raw_write(dev, &byte, 1);
 		
 		dev->speed = speed;
 
-		next_state = TEKRAM_STATE_WAIT_SPEED;
-		delay = tekram_delay;		/* default: 50 ms */
+		state = TEKRAM_STATE_WAIT_SPEED;
+		delay = tekram_delay;
 		break;
 
 	case TEKRAM_STATE_WAIT_SPEED:
 		/* Set DTR, Set RTS */
-		dev->set_dtr_rts(dev, TRUE, TRUE);
-
+		sirdev_set_dtr_rts(dev, TRUE, TRUE);
 		udelay(50);
-
-		return 0;
+		break;
 
 	default:
-		ERROR("%s - undefined state\n", __FUNCTION__);
-		return -EINVAL;
+		ERROR("%s - undefined state %d\n", __FUNCTION__, state);
+		ret = -EINVAL;
+		break;
 	}
 
-	dev->fsm.substate = next_state;
-
-	return delay;
+	dev->fsm.substate = state;
+	return (delay > 0) ? delay : ret;
 }
 
 /*
@@ -200,43 +202,26 @@
  *         operation
  */
 
-
-#define TEKRAM_STATE_WAIT_RESET	(SIRDEV_STATE_DONGLE_RESET + 1)
-
 static int tekram_reset(struct sir_dev *dev)
 {
-	unsigned delay = 0;
-	unsigned next_state = dev->fsm.substate;
-
 	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
-	switch(dev->fsm.substate) {
-
-	case SIRDEV_STATE_DONGLE_RESET:
-		/* Clear DTR, Set RTS */
-		dev->set_dtr_rts(dev, FALSE, TRUE); 
+	/* Clear DTR, Set RTS */
+	sirdev_set_dtr_rts(dev, FALSE, TRUE); 
 
-		next_state = TEKRAM_STATE_WAIT_RESET;
-		delay = 1;		/* Should sleep 1 ms */
-		break;
+	/* Should sleep 1 ms */
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout(MSECS_TO_JIFFIES(1));
 
-	case TEKRAM_STATE_WAIT_RESET:
-		/* Set DTR, Set RTS */
-		dev->set_dtr_rts(dev, TRUE, TRUE);
+	/* Set DTR, Set RTS */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
 	
-		/* Wait at least 50 us */
-		udelay(75);
+	/* Wait at least 50 us */
+	udelay(75);
 
-		return 0;
+	dev->speed = 9600;
 
-	default:
-		ERROR("%s - undefined state\n", __FUNCTION__);
-		return -EINVAL;
-	}
-
-	dev->fsm.substate = next_state;
-
-	return delay;
+	return 0;
 }
 
 MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no>");
diff -Nru a/drivers/net/irda/tekram.c b/drivers/net/irda/tekram.c
--- a/drivers/net/irda/tekram.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/net/irda/tekram.c	Tue Feb  3 19:45:28 2004
@@ -52,12 +52,12 @@
 	.owner = THIS_MODULE,
 };
 
-int __init tekram_init(void)
+static int __init tekram_init(void)
 {
 	return irda_device_register_dongle(&dongle);
 }
 
-void __exit tekram_cleanup(void)
+static void __exit tekram_cleanup(void)
 {
 	irda_device_unregister_dongle(&dongle);
 }
diff -Nru a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c
--- a/drivers/net/irda/via-ircc.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/irda/via-ircc.c	Tue Feb  3 19:45:16 2004
@@ -145,7 +145,7 @@
  *
  *    Initialize chip. Just find out chip type and resource.
  */
-int __init via_ircc_init(void)
+static int __init via_ircc_init(void)
 {
 	int rc;
 
diff -Nru a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c
--- a/drivers/net/irda/w83977af_ir.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/irda/w83977af_ir.c	Tue Feb  3 19:45:17 2004
@@ -110,7 +110,7 @@
  *    Initialize chip. Just try to find out how many chips we are dealing with
  *    and where they are
  */
-int __init w83977af_init(void)
+static int __init w83977af_init(void)
 {
         int i;
 
@@ -129,7 +129,7 @@
  *    Close all configured chips
  *
  */
-void __exit w83977af_cleanup(void)
+static void __exit w83977af_cleanup(void)
 {
 	int i;
 
diff -Nru a/drivers/net/natsemi.c b/drivers/net/natsemi.c
--- a/drivers/net/natsemi.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/natsemi.c	Tue Feb  3 19:45:16 2004
@@ -765,19 +765,13 @@
 	SET_NETDEV_DEV(dev, &pdev->dev);
 
 	i = pci_request_regions(pdev, dev->name);
-	if (i) {
-		free_netdev(dev);
-		return i;
-	}
+	if (i)
+		goto err_pci_request_regions;
 
-	{
-		void *mmio = ioremap (ioaddr, iosize);
-		if (!mmio) {
-			pci_release_regions(pdev);
-			free_netdev(dev);
-			return -ENOMEM;
-		}
-		ioaddr = (unsigned long) mmio;
+	ioaddr = (unsigned long) ioremap (ioaddr, iosize);
+	if (!ioaddr) {
+		i = -ENOMEM;
+		goto err_ioremap;
 	}
 
 	/* Work around the dropped serial bit. */
@@ -835,13 +829,9 @@
 		dev->mtu = mtu;
 
 	i = register_netdev(dev);
-	if (i) {
-		pci_release_regions(pdev);
-		unregister_netdev(dev);
-		free_netdev(dev);
-		pci_set_drvdata(pdev, NULL);
-		return i;
-	}
+	if (i)
+		goto err_register_netdev;
+
 	netif_carrier_off(dev);
 
 	if (netif_msg_drv(np)) {
@@ -878,6 +868,17 @@
 
 
 	return 0;
+
+ err_register_netdev:
+	iounmap ((void *) dev->base_addr);
+
+ err_ioremap:
+	pci_release_regions(pdev);
+	pci_set_drvdata(pdev, NULL);
+
+ err_pci_request_regions:
+	free_netdev(dev);
+	return i;
 }
 
 
diff -Nru a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c
--- a/drivers/net/ne2k-pci.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/ne2k-pci.c	Tue Feb  3 19:45:17 2004
@@ -115,6 +115,7 @@
 	CH_Winbond_W89C940F,
 	CH_Holtek_HT80232,
 	CH_Holtek_HT80229,
+	CH_Winbond_89C940_8c4a,
 };
 
 
@@ -132,6 +133,7 @@
 	{"Winbond W89C940F", 0},
 	{"Holtek HT80232", ONLY_16BIT_IO | HOLTEK_FDX},
 	{"Holtek HT80229", ONLY_32BIT_IO | HOLTEK_FDX | STOP_PG_0x60 },
+	{"Winbond W89C940(misprogrammed)", 0},
 	{0,}
 };
 
@@ -147,6 +149,7 @@
 	{ 0x1050, 0x5a5a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Winbond_W89C940F },
 	{ 0x12c3, 0x0058, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Holtek_HT80232 },
 	{ 0x12c3, 0x5598, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Holtek_HT80229 },
+	{ 0x8c4a, 0x1980, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Winbond_89C940_8c4a },
 	{ 0, }
 };
 MODULE_DEVICE_TABLE(pci, ne2k_pci_tbl);
diff -Nru a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
--- a/drivers/net/pcmcia/3c574_cs.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/pcmcia/3c574_cs.c	Tue Feb  3 19:45:17 2004
@@ -330,7 +330,7 @@
 	client_reg.event_handler = &tc574_event;
 	client_reg.Version = 0x0210;
 	client_reg.event_callback_args.client_data = link;
-	ret = CardServices(RegisterClient, &link->handle, &client_reg);
+	ret = pcmcia_register_client(&link->handle, &client_reg);
 	if (ret != 0) {
 		cs_error(link->handle, RegisterClient, ret);
 		tc574_detach(link);
@@ -369,7 +369,7 @@
 	}
 
 	if (link->handle)
-		CardServices(DeregisterClient, link->handle);
+		pcmcia_deregister_client(link->handle);
 
 	/* Unlink device structure, free bits */
 	*linkp = link->next;
@@ -387,8 +387,8 @@
 	ethernet device available to the system.
 */
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
+#define CS_CHECK(fn, ret) \
+  do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static void tc574_config(dev_link_t *link)
 {
@@ -409,12 +409,12 @@
 
 	tuple.Attributes = 0;
 	tuple.DesiredTuple = CISTPL_CONFIG;
-	CS_CHECK(GetFirstTuple, handle, &tuple);
+	CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
 	tuple.TupleData = (cisdata_t *)buf;
 	tuple.TupleDataMax = 64;
 	tuple.TupleOffset = 0;
-	CS_CHECK(GetTupleData, handle, &tuple);
-	CS_CHECK(ParseTuple, handle, &tuple, &parse);
+	CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+	CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
 	link->conf.ConfigBase = parse.config.base;
 	link->conf.Present = parse.config.rmask[0];
 
@@ -424,15 +424,15 @@
 	link->io.IOAddrLines = 16;
 	for (i = j = 0; j < 0x400; j += 0x20) {
 		link->io.BasePort1 = j ^ 0x300;
-		i = CardServices(RequestIO, link->handle, &link->io);
+		i = pcmcia_request_io(link->handle, &link->io);
 		if (i == CS_SUCCESS) break;
 	}
 	if (i != CS_SUCCESS) {
 		cs_error(link->handle, RequestIO, i);
 		goto failed;
 	}
-	CS_CHECK(RequestIRQ, link->handle, &link->irq);
-	CS_CHECK(RequestConfiguration, link->handle, &link->conf);
+	CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));
+	CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));
 
 	dev->irq = link->irq.AssignedIRQ;
 	dev->base_addr = link->io.BasePort1;
@@ -451,8 +451,8 @@
 	   the hardware address.  The future products may include a modem chip
 	   and put the address in the CIS. */
 	tuple.DesiredTuple = 0x88;
-	if (CardServices(GetFirstTuple, handle, &tuple) == CS_SUCCESS) {
-		CardServices(GetTupleData, handle, &tuple);
+	if (pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) {
+		pcmcia_get_tuple_data(handle, &tuple);
 		for (i = 0; i < 3; i++)
 			phys_addr[i] = htons(buf[i]);
 	} else {
@@ -466,9 +466,9 @@
 		}
 	}
 	tuple.DesiredTuple = CISTPL_VERS_1;
-	if (CardServices(GetFirstTuple, handle, &tuple) == CS_SUCCESS &&
-		CardServices(GetTupleData, handle, &tuple) == CS_SUCCESS &&
-		CardServices(ParseTuple, handle, &tuple, &parse) == CS_SUCCESS) {
+	if (pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS &&
+		pcmcia_get_tuple_data(handle, &tuple) == CS_SUCCESS &&
+		pcmcia_parse_tuple(handle, &tuple, &parse) == CS_SUCCESS) {
 		cardname = parse.version_1.str + parse.version_1.ofs[1];
 	} else
 		cardname = "3Com 3c574";
@@ -564,9 +564,9 @@
 		return;
 	}
 
-	CardServices(ReleaseConfiguration, link->handle);
-	CardServices(ReleaseIO, link->handle, &link->io);
-	CardServices(ReleaseIRQ, link->handle, &link->irq);
+	pcmcia_release_configuration(link->handle);
+	pcmcia_release_io(link->handle, &link->io);
+	pcmcia_release_irq(link->handle, &link->irq);
 
 	link->state &= ~DEV_CONFIG;
 
@@ -608,7 +608,7 @@
 		if (link->state & DEV_CONFIG) {
 			if (link->open)
 				netif_device_detach(dev);
-			CardServices(ReleaseConfiguration, link->handle);
+			pcmcia_release_configuration(link->handle);
 		}
 		break;
 	case CS_EVENT_PM_RESUME:
@@ -616,7 +616,7 @@
 		/* Fall through... */
 	case CS_EVENT_CARD_RESET:
 		if (link->state & DEV_CONFIG) {
-			CardServices(RequestConfiguration, link->handle, &link->conf);
+			pcmcia_request_configuration(link->handle, &link->conf);
 			if (link->open) {
 				tc574_reset(dev);
 				netif_device_attach(dev);
diff -Nru a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
--- a/drivers/net/pcmcia/3c589_cs.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/net/pcmcia/3c589_cs.c	Tue Feb  3 19:45:42 2004
@@ -244,7 +244,7 @@
     client_reg.event_handler = &tc589_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != 0) {
 	cs_error(link->handle, RegisterClient, ret);
 	tc589_detach(link);
@@ -283,7 +283,7 @@
     }
     
     if (link->handle)
-	CardServices(DeregisterClient, link->handle);
+	pcmcia_deregister_client(link->handle);
     
     /* Unlink device structure, free bits */
     *linkp = link->next;
@@ -303,8 +303,8 @@
     
 ======================================================================*/
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static void tc589_config(dev_link_t *link)
 {
@@ -323,20 +323,20 @@
     phys_addr = (u16 *)dev->dev_addr;
     tuple.Attributes = 0;
     tuple.DesiredTuple = CISTPL_CONFIG;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
     tuple.TupleData = (cisdata_t *)buf;
     tuple.TupleDataMax = sizeof(buf);
     tuple.TupleOffset = 0;
-    CS_CHECK(GetTupleData, handle, &tuple);
-    CS_CHECK(ParseTuple, handle, &tuple, &parse);
+    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+    CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
     link->conf.ConfigBase = parse.config.base;
     link->conf.Present = parse.config.rmask[0];
     
     /* Is this a 3c562? */
     tuple.DesiredTuple = CISTPL_MANFID;
     tuple.Attributes = TUPLE_RETURN_COMMON;
-    if ((CardServices(GetFirstTuple, handle, &tuple) == CS_SUCCESS) &&
-	(CardServices(GetTupleData, handle, &tuple) == CS_SUCCESS)) {
+    if ((pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) &&
+	(pcmcia_get_tuple_data(handle, &tuple) == CS_SUCCESS)) {
 	if (le16_to_cpu(buf[0]) != MANFID_3COM)
 	    printk(KERN_INFO "3c589_cs: hmmm, is this really a "
 		   "3Com card??\n");
@@ -351,15 +351,15 @@
     for (i = j = 0; j < 0x400; j += 0x10) {
 	if (multi && (j & 0x80)) continue;
 	link->io.BasePort1 = j ^ 0x300;
-	i = CardServices(RequestIO, link->handle, &link->io);
+	i = pcmcia_request_io(link->handle, &link->io);
 	if (i == CS_SUCCESS) break;
     }
     if (i != CS_SUCCESS) {
 	cs_error(link->handle, RequestIO, i);
 	goto failed;
     }
-    CS_CHECK(RequestIRQ, link->handle, &link->irq);
-    CS_CHECK(RequestConfiguration, link->handle, &link->conf);
+    CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));
+    CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));
 	
     dev->irq = link->irq.AssignedIRQ;
     dev->base_addr = link->io.BasePort1;
@@ -374,8 +374,8 @@
     /* The 3c589 has an extra EEPROM for configuration info, including
        the hardware address.  The 3c562 puts the address in the CIS. */
     tuple.DesiredTuple = 0x88;
-    if (CardServices(GetFirstTuple, handle, &tuple) == CS_SUCCESS) {
-	CardServices(GetTupleData, handle, &tuple);
+    if (pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) {
+	pcmcia_get_tuple_data(handle, &tuple);
 	for (i = 0; i < 3; i++)
 	    phys_addr[i] = htons(buf[i]);
     } else {
@@ -440,9 +440,9 @@
 	return;
     }
     
-    CardServices(ReleaseConfiguration, link->handle);
-    CardServices(ReleaseIO, link->handle, &link->io);
-    CardServices(ReleaseIRQ, link->handle, &link->irq);
+    pcmcia_release_configuration(link->handle);
+    pcmcia_release_io(link->handle, &link->io);
+    pcmcia_release_irq(link->handle, &link->irq);
     
     link->state &= ~DEV_CONFIG;
 
@@ -486,7 +486,7 @@
 	if (link->state & DEV_CONFIG) {
 	    if (link->open)
 		netif_device_detach(dev);
-	    CardServices(ReleaseConfiguration, link->handle);
+	    pcmcia_release_configuration(link->handle);
 	}
 	break;
     case CS_EVENT_PM_RESUME:
@@ -494,7 +494,7 @@
 	/* Fall through... */
     case CS_EVENT_CARD_RESET:
 	if (link->state & DEV_CONFIG) {
-	    CardServices(RequestConfiguration, link->handle, &link->conf);
+	    pcmcia_request_configuration(link->handle, &link->conf);
 	    if (link->open) {
 		tc589_reset(dev);
 		netif_device_attach(dev);
diff -Nru a/drivers/net/pcmcia/Kconfig b/drivers/net/pcmcia/Kconfig
--- a/drivers/net/pcmcia/Kconfig	Tue Feb  3 19:45:35 2004
+++ b/drivers/net/pcmcia/Kconfig	Tue Feb  3 19:45:35 2004
@@ -119,7 +119,7 @@
 
 config PCMCIA_IBMTR
 	tristate "IBM PCMCIA tokenring adapter support"
-	depends on NET_PCMCIA && IBMTR!=y && TR && PCMCIA
+	depends on NET_PCMCIA && IBMTR!=y && TR && PCMCIA && !64BIT
 	help
 	  Say Y here if you intend to attach this type of Token Ring PCMCIA
 	  card to your computer. You then also need to say Y to "Token Ring
diff -Nru a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
--- a/drivers/net/pcmcia/axnet_cs.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/net/pcmcia/axnet_cs.c	Tue Feb  3 19:45:29 2004
@@ -205,7 +205,7 @@
     client_reg.event_handler = &axnet_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != CS_SUCCESS) {
 	cs_error(link->handle, RegisterClient, ret);
 	axnet_detach(link);
@@ -244,7 +244,7 @@
     }
 
     if (link->handle)
-	CardServices(DeregisterClient, link->handle);
+	pcmcia_deregister_client(link->handle);
 
     /* Unlink device structure, free bits */
     *linkp = link->next;
@@ -313,11 +313,8 @@
 
 ======================================================================*/
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
-
-#define CFG_CHECK(fn, args...) \
-if (CardServices(fn, args) != 0) goto next_entry
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static int try_io_port(dev_link_t *link)
 {
@@ -340,12 +337,12 @@
 	for (j = 0; j < 0x400; j += 0x20) {
 	    link->io.BasePort1 = j ^ 0x300;
 	    link->io.BasePort2 = (j ^ 0x300) + 0x10;
-	    ret = CardServices(RequestIO, link->handle, &link->io);
+	    ret = pcmcia_request_io(link->handle, &link->io);
 	    if (ret == CS_SUCCESS) return ret;
 	}
 	return ret;
     } else {
-	return CardServices(RequestIO, link->handle, &link->io);
+	return pcmcia_request_io(link->handle, &link->io);
     }
 }
 
@@ -367,9 +364,9 @@
     tuple.TupleDataMax = sizeof(buf);
     tuple.TupleOffset = 0;
     tuple.DesiredTuple = CISTPL_CONFIG;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
-    CS_CHECK(GetTupleData, handle, &tuple);
-    CS_CHECK(ParseTuple, handle, &tuple, &parse);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+    CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
     link->conf.ConfigBase = parse.config.base;
     /* don't trust the CIS on this; Linksys got it wrong */
     link->conf.Present = 0x63;
@@ -378,19 +375,19 @@
     link->state |= DEV_CONFIG;
 
     /* Look up current Vcc */
-    CS_CHECK(GetConfigurationInfo, handle, &conf);
+    CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf));
     link->conf.Vcc = conf.Vcc;
 
     tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
     tuple.Attributes = 0;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
     while (last_ret == CS_SUCCESS) {
 	cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
 	cistpl_io_t *io = &(parse.cftable_entry.io);
 	
-	CFG_CHECK(GetTupleData, handle, &tuple);
-	CFG_CHECK(ParseTuple, handle, &tuple, &parse);
-	if ((cfg->index == 0) || (cfg->io.nwin == 0))
+	if (pcmcia_get_tuple_data(handle, &tuple) != 0 ||
+		pcmcia_parse_tuple(handle, &tuple, &parse) != 0 ||
+		cfg->index == 0 || cfg->io.nwin == 0)
 	    goto next_entry;
 	
 	link->conf.ConfigIndex = 0x05;
@@ -411,21 +408,21 @@
 	    if (last_ret == CS_SUCCESS) break;
 	}
     next_entry:
-	last_ret = CardServices(GetNextTuple, handle, &tuple);
+	last_ret = pcmcia_get_next_tuple(handle, &tuple);
     }
     if (last_ret != CS_SUCCESS) {
 	cs_error(handle, RequestIO, last_ret);
 	goto failed;
     }
 
-    CS_CHECK(RequestIRQ, handle, &link->irq);
+    CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq));
     
     if (link->io.NumPorts2 == 8) {
 	link->conf.Attributes |= CONF_ENABLE_SPKR;
 	link->conf.Status = CCSR_AUDIO_ENA;
     }
     
-    CS_CHECK(RequestConfiguration, handle, &link->conf);
+    CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf));
     dev->irq = link->irq.AssignedIRQ;
     dev->base_addr = link->io.BasePort1;
     if (register_netdev(dev) != 0) {
@@ -476,7 +473,7 @@
        Bit 2 of CCSR is active low. */ 
     if (i == 32) {
 	conf_reg_t reg = { 0, CS_WRITE, CISREG_CCSR, 0x04 };
- 	CardServices(AccessConfigurationRegister, link->handle, &reg);
+ 	pcmcia_access_configuration_register(link->handle, &reg);
 	for (i = 0; i < 32; i++) {
 	    j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1);
 	    if ((j != 0) && (j != 0xffff)) break;
@@ -520,9 +517,9 @@
 	return;
     }
 
-    CardServices(ReleaseConfiguration, link->handle);
-    CardServices(ReleaseIO, link->handle, &link->io);
-    CardServices(ReleaseIRQ, link->handle, &link->irq);
+    pcmcia_release_configuration(link->handle);
+    pcmcia_release_io(link->handle, &link->io);
+    pcmcia_release_irq(link->handle, &link->irq);
 
     link->state &= ~DEV_CONFIG;
 
@@ -566,7 +563,7 @@
 	if (link->state & DEV_CONFIG) {
 	    if (link->open)
 		netif_device_detach(&info->dev);
-	    CardServices(ReleaseConfiguration, link->handle);
+	    pcmcia_release_configuration(link->handle);
 	}
 	break;
     case CS_EVENT_PM_RESUME:
@@ -574,7 +571,7 @@
 	/* Fall through... */
     case CS_EVENT_CARD_RESET:
 	if (link->state & DEV_CONFIG) {
-	    CardServices(RequestConfiguration, link->handle, &link->conf);
+	    pcmcia_request_configuration(link->handle, &link->conf);
 	    if (link->open) {
 		axnet_reset_8390(&info->dev);
 		AX88190_init(&info->dev, 1);
diff -Nru a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
--- a/drivers/net/pcmcia/com20020_cs.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/pcmcia/com20020_cs.c	Tue Feb  3 19:45:17 2004
@@ -227,7 +227,7 @@
     client_reg.event_handler = &com20020_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != 0) {
         cs_error(link->handle, RegisterClient, ret);
         com20020_detach(link);
@@ -277,7 +277,7 @@
     }
 
     if (link->handle)
-        CardServices(DeregisterClient, link->handle);
+        pcmcia_deregister_client(link->handle);
 
     /* Unlink device structure, free bits */
     DEBUG(1,"unlinking...\n");
@@ -325,8 +325,8 @@
 
 ======================================================================*/
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static void com20020_config(dev_link_t *link)
 {
@@ -353,9 +353,9 @@
     tuple.TupleDataMax = 64;
     tuple.TupleOffset = 0;
     tuple.DesiredTuple = CISTPL_CONFIG;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
-    CS_CHECK(GetTupleData, handle, &tuple);
-    CS_CHECK(ParseTuple, handle, &tuple, &parse);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+    CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
     link->conf.ConfigBase = parse.config.base;
 
     /* Configure card */
@@ -368,13 +368,13 @@
 	for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10)
 	{
 	    link->io.BasePort1 = ioaddr;
-	    i = CardServices(RequestIO, link->handle, &link->io);
+	    i = pcmcia_request_io(link->handle, &link->io);
 	    if (i == CS_SUCCESS)
 		break;
 	}
     }
     else
-	i = CardServices(RequestIO, link->handle, &link->io);
+	i = pcmcia_request_io(link->handle, &link->io);
     
     if (i != CS_SUCCESS)
     {
@@ -388,7 +388,7 @@
     DEBUG(1,"arcnet: request IRQ %d (%Xh/%Xh)\n",
 	   link->irq.AssignedIRQ,
 	   link->irq.IRQInfo1, link->irq.IRQInfo2);
-    i = CardServices(RequestIRQ, link->handle, &link->irq);
+    i = pcmcia_request_irq(link->handle, &link->irq);
     if (i != CS_SUCCESS)
     {
 	DEBUG(1,"arcnet: requestIRQ failed totally!\n");
@@ -397,7 +397,7 @@
 
     dev->irq = link->irq.AssignedIRQ;
 
-    CS_CHECK(RequestConfiguration, link->handle, &link->conf);
+    CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));
 
     if (com20020_check(dev))
     {
@@ -454,9 +454,9 @@
         return;
     }
 
-    CardServices(ReleaseConfiguration, link->handle);
-    CardServices(ReleaseIO, link->handle, &link->io);
-    CardServices(ReleaseIRQ, link->handle, &link->irq);
+    pcmcia_release_configuration(link->handle);
+    pcmcia_release_io(link->handle, &link->io);
+    pcmcia_release_irq(link->handle, &link->irq);
 
     link->state &= ~(DEV_CONFIG | DEV_RELEASE_PENDING);
 
@@ -502,7 +502,7 @@
             if (link->open) {
                 netif_device_detach(dev);
             }
-            CardServices(ReleaseConfiguration, link->handle);
+            pcmcia_release_configuration(link->handle);
         }
         break;
     case CS_EVENT_PM_RESUME:
@@ -510,7 +510,7 @@
         /* Fall through... */
     case CS_EVENT_CARD_RESET:
         if (link->state & DEV_CONFIG) {
-            CardServices(RequestConfiguration, link->handle, &link->conf);
+            pcmcia_request_configuration(link->handle, &link->conf);
             if (link->open) {
 		int ioaddr = dev->base_addr;
 		struct arcnet_local *lp = (struct arcnet_local *)dev->priv;
diff -Nru a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
--- a/drivers/net/pcmcia/fmvj18x_cs.c	Tue Feb  3 19:45:33 2004
+++ b/drivers/net/pcmcia/fmvj18x_cs.c	Tue Feb  3 19:45:33 2004
@@ -307,7 +307,7 @@
     client_reg.event_handler = &fmvj18x_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != 0) {
 	cs_error(link->handle, RegisterClient, ret);
 	fmvj18x_detach(link);
@@ -340,7 +340,7 @@
 
     /* Break the link with Card Services */
     if (link->handle)
-	CardServices(DeregisterClient, link->handle);
+	pcmcia_deregister_client(link->handle);
     
     /* Unlink device structure, free pieces */
     *linkp = link->next;
@@ -354,8 +354,8 @@
 
 /*====================================================================*/
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static int mfc_try_io_port(dev_link_t *link)
 {
@@ -369,7 +369,7 @@
 	    link->io.NumPorts2 = 0;
 	    printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n");
 	}
-	ret = CardServices(RequestIO, link->handle, &link->io);
+	ret = pcmcia_request_io(link->handle, &link->io);
 	if (ret == CS_SUCCESS) return ret;
     }
     return ret;
@@ -385,7 +385,7 @@
     */
     for (ioaddr = 0x300; ioaddr < 0x3e0; ioaddr += 0x20) {
 	link->io.BasePort1 = ioaddr;
-	ret = CardServices(RequestIO, link->handle, &link->io);
+	ret = pcmcia_request_io(link->handle, &link->io);
 	if (ret == CS_SUCCESS) {
 	    /* calculate ConfigIndex value */
 	    link->conf.ConfigIndex = 
@@ -417,12 +417,12 @@
        registers.
     */
     tuple.DesiredTuple = CISTPL_CONFIG;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
     tuple.TupleData = (u_char *)buf;
     tuple.TupleDataMax = 64;
     tuple.TupleOffset = 0;
-    CS_CHECK(GetTupleData, handle, &tuple);
-    CS_CHECK(ParseTuple, handle, &tuple, &parse);
+    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+    CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
     
     /* Configure card */
     link->state |= DEV_CONFIG;
@@ -432,16 +432,16 @@
 
     tuple.DesiredTuple = CISTPL_FUNCE;
     tuple.TupleOffset = 0;
-    if (CardServices(GetFirstTuple, handle, &tuple) == CS_SUCCESS) {
+    if (pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) {
 	/* Yes, I have CISTPL_FUNCE. Let's check CISTPL_MANFID */
 	tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
-	CS_CHECK(GetFirstTuple, handle, &tuple);
-	CS_CHECK(GetTupleData, handle, &tuple);
-	CS_CHECK(ParseTuple, handle, &tuple, &parse);
+	CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+	CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+	CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
 	link->conf.ConfigIndex = parse.cftable_entry.index;
 	tuple.DesiredTuple = CISTPL_MANFID;
-	if (CardServices(GetFirstTuple, handle, &tuple) == CS_SUCCESS)
-	    CS_CHECK(GetTupleData, handle, &tuple);
+	if (pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS)
+	    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
 	else
 	    buf[0] = 0xffff;
 	switch (le16_to_cpu(buf[0])) {
@@ -449,7 +449,7 @@
 	    cardtype = TDK;
 	    if (le16_to_cpu(buf[1]) == PRODID_TDK_CF010) {
 		cs_status_t status;
-		CardServices(GetStatus, handle, &status);
+		pcmcia_get_status(handle, &status);
 		if (status.CardState & CS_EVENT_3VCARD)
 		    link->conf.Vcc = 33; /* inserted in 3.3V slot */
 	    } else if (le16_to_cpu(buf[1]) == PRODID_TDK_GN3410) {
@@ -478,8 +478,8 @@
     } else {
 	/* old type card */
 	tuple.DesiredTuple = CISTPL_MANFID;
-	if (CardServices(GetFirstTuple, handle, &tuple) == CS_SUCCESS)
-	    CS_CHECK(GetTupleData, handle, &tuple);
+	if (pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS)
+	    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
 	else
 	    buf[0] = 0xffff;
 	switch (le16_to_cpu(buf[0])) {
@@ -510,10 +510,10 @@
 	ret = ungermann_try_io_port(link);
 	if (ret != CS_SUCCESS) goto cs_failed;
     } else { 
-	CS_CHECK(RequestIO, link->handle, &link->io);
+	CS_CHECK(RequestIO, pcmcia_request_io(link->handle, &link->io));
     }
-    CS_CHECK(RequestIRQ, link->handle, &link->irq);
-    CS_CHECK(RequestConfiguration, link->handle, &link->conf);
+    CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));
+    CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));
     dev->irq = link->irq.AssignedIRQ;
     dev->base_addr = link->io.BasePort1;
     if (register_netdev(dev) != 0) {
@@ -546,17 +546,17 @@
     case CONTEC:
 	tuple.DesiredTuple = CISTPL_FUNCE;
 	tuple.TupleOffset = 0;
-	CS_CHECK(GetFirstTuple, handle, &tuple);
+	CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
 	tuple.TupleOffset = 0;
-	CS_CHECK(GetTupleData, handle, &tuple);
+	CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
 	if (cardtype == MBH10304) {
 	    /* MBH10304's CIS_FUNCE is corrupted */
 	    node_id = &(tuple.TupleData[5]);
 	    card_name = "FMV-J182";
 	} else {
 	    while (tuple.TupleData[0] != CISTPL_FUNCE_LAN_NODE_ID ) {
-		CS_CHECK(GetNextTuple, handle, &tuple) ;
-		CS_CHECK(GetTupleData, handle, &tuple) ;
+		CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));
+		CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
 	    }
 	    node_id = &(tuple.TupleData[2]);
 	    if( cardtype == TDK ) {
@@ -633,8 +633,7 @@
     req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
     req.Base = 0; req.Size = 0;
     req.AccessSpeed = 0;
-    link->win = (window_handle_t)link->handle;
-    i = CardServices(RequestWindow, &link->win, &req);
+    i = pcmcia_request_window(&link->handle, &req, &link->win);
     if (i != CS_SUCCESS) {
 	cs_error(link->handle, RequestWindow, i);
 	return -1;
@@ -643,7 +642,7 @@
     base = ioremap(req.Base, req.Size);
     mem.Page = 0;
     mem.CardOffset = 0;
-    CardServices(MapMemPage, link->win, &mem);
+    pcmcia_map_mem_page(link->win, &mem);
 
     /*
      *  MBH10304 CISTPL_FUNCE_LAN_NODE_ID format
@@ -668,7 +667,7 @@
     }
 
     iounmap(base);
-    j = CardServices(ReleaseWindow, link->win);
+    j = pcmcia_release_window(link->win);
     if (j != CS_SUCCESS)
 	cs_error(link->handle, ReleaseWindow, j);
     return (i != 0x200) ? 0 : -1;
@@ -689,8 +688,7 @@
     req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
     req.Base = 0; req.Size = 0;
     req.AccessSpeed = 0;
-    link->win = (window_handle_t)link->handle;
-    i = CardServices(RequestWindow, &link->win, &req);
+    i = pcmcia_request_window(&link->handle, &req, &link->win);
     if (i != CS_SUCCESS) {
 	cs_error(link->handle, RequestWindow, i);
 	return -1;
@@ -699,7 +697,7 @@
     base = ioremap(req.Base, req.Size);
     mem.Page = 0;
     mem.CardOffset = 0;
-    CardServices(MapMemPage, link->win, &mem);
+    pcmcia_map_mem_page(link->win, &mem);
 
     ioaddr = dev->base_addr;
     writeb(0x47, base+0x800);	/* Config Option Register of LAN */
@@ -712,7 +710,7 @@
     writeb(0x8, base+0x822);	/* Config and Status Register */
 
     iounmap(base);
-    j = CardServices(ReleaseWindow, link->win);
+    j = pcmcia_release_window(link->win);
     if (j != CS_SUCCESS)
 	cs_error(link->handle, ReleaseWindow, j);
     return 0;
@@ -737,10 +735,10 @@
     }
 
     /* Don't bother checking to see if these succeed or not */
-    CardServices(ReleaseWindow, link->win);
-    CardServices(ReleaseConfiguration, link->handle);
-    CardServices(ReleaseIO, link->handle, &link->io);
-    CardServices(ReleaseIRQ, link->handle, &link->irq);
+    pcmcia_release_window(link->win);
+    pcmcia_release_configuration(link->handle);
+    pcmcia_release_io(link->handle, &link->io);
+    pcmcia_release_irq(link->handle, &link->irq);
     
     link->state &= ~DEV_CONFIG;
 
@@ -777,7 +775,7 @@
 	if (link->state & DEV_CONFIG) {
 	    if (link->open)
 		netif_device_detach(dev);
-	    CardServices(ReleaseConfiguration, link->handle);
+	    pcmcia_release_configuration(link->handle);
 	}
 	break;
     case CS_EVENT_PM_RESUME:
@@ -785,7 +783,7 @@
 	/* Fall through... */
     case CS_EVENT_CARD_RESET:
 	if (link->state & DEV_CONFIG) {
-	    CardServices(RequestConfiguration, link->handle, &link->conf);
+	    pcmcia_request_configuration(link->handle, &link->conf);
 	    if (link->open) {
 		fjn_reset(dev);
 		netif_device_attach(dev);
diff -Nru a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
--- a/drivers/net/pcmcia/ibmtr_cs.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/net/pcmcia/ibmtr_cs.c	Tue Feb  3 19:45:28 2004
@@ -214,7 +214,7 @@
     client_reg.event_handler = &ibmtr_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != 0) {
         cs_error(link->handle, RegisterClient, ret);
 	goto out_detach;
@@ -264,7 +264,7 @@
     }
 
     if (link->handle)
-        CardServices(DeregisterClient, link->handle);
+        pcmcia_deregister_client(link->handle);
 
     /* Unlink device structure, free bits */
     *linkp = link->next;
@@ -281,8 +281,8 @@
 
 ======================================================================*/
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static void ibmtr_config(dev_link_t *link)
 {
@@ -304,9 +304,9 @@
     tuple.TupleDataMax = 64;
     tuple.TupleOffset = 0;
     tuple.DesiredTuple = CISTPL_CONFIG;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
-    CS_CHECK(GetTupleData, handle, &tuple);
-    CS_CHECK(ParseTuple, handle, &tuple, &parse);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+    CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
     link->conf.ConfigBase = parse.config.base;
 
     /* Configure card */
@@ -318,18 +318,18 @@
 
     /* Try PRIMARY card at 0xA20-0xA23 */
     link->io.BasePort1 = 0xA20;
-    i = CardServices(RequestIO, link->handle, &link->io);
+    i = pcmcia_request_io(link->handle, &link->io);
     if (i == CS_SUCCESS) {
 	memcpy(info->node.dev_name, "tr0\0", 4);
     } else {
 	/* Couldn't get 0xA20-0xA23.  Try ALTERNATE at 0xA24-0xA27. */
 	link->io.BasePort1 = 0xA24;
-	CS_CHECK(RequestIO, link->handle, &link->io);
+	CS_CHECK(RequestIO, pcmcia_request_io(link->handle, &link->io));
 	memcpy(info->node.dev_name, "tr1\0", 4);
     }
     dev->base_addr = link->io.BasePort1;
 
-    CS_CHECK(RequestIRQ, link->handle, &link->irq);
+    CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));
     dev->irq = link->irq.AssignedIRQ;
     ti->irq = link->irq.AssignedIRQ;
     ti->global_int_enable=GLOBAL_INT_ENABLE+((dev->irq==9) ? 2 : dev->irq);
@@ -340,12 +340,11 @@
     req.Base = 0; 
     req.Size = 0x2000;
     req.AccessSpeed = 250;
-    link->win = (window_handle_t)link->handle;
-    CS_CHECK(RequestWindow, &link->win, &req);
+    CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &link->win));
 
     mem.CardOffset = mmiobase;
     mem.Page = 0;
-    CS_CHECK(MapMemPage, link->win, &mem);
+    CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem));
     ti->mmio = ioremap(req.Base, req.Size);
 
     /* Allocate the SRAM memory window */
@@ -354,17 +353,16 @@
     req.Base = 0;
     req.Size = sramsize * 1024;
     req.AccessSpeed = 250;
-    info->sram_win_handle = (window_handle_t)link->handle;
-    CS_CHECK(RequestWindow, &info->sram_win_handle, &req);
+    CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &info->sram_win_handle));
 
     mem.CardOffset = srambase;
     mem.Page = 0;
-    CS_CHECK(MapMemPage, info->sram_win_handle, &mem);
+    CS_CHECK(MapMemPage, pcmcia_map_mem_page(info->sram_win_handle, &mem));
 
     ti->sram_base = mem.CardOffset >> 12;
     ti->sram_virt = (u_long)ioremap(req.Base, req.Size);
 
-    CS_CHECK(RequestConfiguration, link->handle, &link->conf);
+    CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));
 
     /*  Set up the Token-Ring Controller Configuration Register and
         turn on the card.  Check the "Local Area Network Credit Card
@@ -419,14 +417,14 @@
         return;
     }
 
-    CardServices(ReleaseConfiguration, link->handle);
-    CardServices(ReleaseIO, link->handle, &link->io);
-    CardServices(ReleaseIRQ, link->handle, &link->irq);
+    pcmcia_release_configuration(link->handle);
+    pcmcia_release_io(link->handle, &link->io);
+    pcmcia_release_irq(link->handle, &link->irq);
     if (link->win) {
 	struct tok_info *ti = dev->priv;
 	iounmap((void *)ti->mmio);
-	CardServices(ReleaseWindow, link->win);
-	CardServices(ReleaseWindow, info->sram_win_handle);
+	pcmcia_release_window(link->win);
+	pcmcia_release_window(info->sram_win_handle);
     }
 
     link->state &= ~DEV_CONFIG;
@@ -474,7 +472,7 @@
         if (link->state & DEV_CONFIG) {
             if (link->open)
 		netif_device_detach(dev);
-            CardServices(ReleaseConfiguration, link->handle);
+            pcmcia_release_configuration(link->handle);
         }
         break;
     case CS_EVENT_PM_RESUME:
@@ -482,7 +480,7 @@
         /* Fall through... */
     case CS_EVENT_CARD_RESET:
         if (link->state & DEV_CONFIG) {
-            CardServices(RequestConfiguration, link->handle, &link->conf);
+            pcmcia_request_configuration(link->handle, &link->conf);
             if (link->open) {
 		(dev->init)(dev);
 		netif_device_attach(dev);
diff -Nru a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
--- a/drivers/net/pcmcia/nmclan_cs.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/pcmcia/nmclan_cs.c	Tue Feb  3 19:45:16 2004
@@ -520,7 +520,7 @@
     client_reg.event_handler = &nmclan_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != 0) {
 	cs_error(link->handle, RegisterClient, ret);
 	nmclan_detach(link);
@@ -558,7 +558,7 @@
     }
 
     if (link->handle)
-	CardServices(DeregisterClient, link->handle);
+	pcmcia_deregister_client(link->handle);
 
     /* Unlink device structure, free bits */
     *linkp = link->next;
@@ -706,8 +706,8 @@
 	ethernet device available to the system.
 ---------------------------------------------------------------------------- */
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
+#define CS_CHECK(fn, ret) \
+  do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static void nmclan_config(dev_link_t *link)
 {
@@ -727,17 +727,17 @@
   tuple.TupleDataMax = 64;
   tuple.TupleOffset = 0;
   tuple.DesiredTuple = CISTPL_CONFIG;
-  CS_CHECK(GetFirstTuple, handle, &tuple);
-  CS_CHECK(GetTupleData, handle, &tuple);
-  CS_CHECK(ParseTuple, handle, &tuple, &parse);
+  CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+  CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+  CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
   link->conf.ConfigBase = parse.config.base;
 
   /* Configure card */
   link->state |= DEV_CONFIG;
 
-  CS_CHECK(RequestIO, handle, &link->io);
-  CS_CHECK(RequestIRQ, handle, &link->irq);
-  CS_CHECK(RequestConfiguration, handle, &link->conf);
+  CS_CHECK(RequestIO, pcmcia_request_io(handle, &link->io));
+  CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq));
+  CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf));
   dev->irq = link->irq.AssignedIRQ;
   dev->base_addr = link->io.BasePort1;
   i = register_netdev(dev);
@@ -753,8 +753,8 @@
   tuple.TupleData = buf;
   tuple.TupleDataMax = 64;
   tuple.TupleOffset = 0;
-  CS_CHECK(GetFirstTuple, handle, &tuple);
-  CS_CHECK(GetTupleData, handle, &tuple);
+  CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+  CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
   memcpy(dev->dev_addr, tuple.TupleData, ETHER_ADDR_LEN);
 
   /* Verify configuration by reading the MACE ID. */
@@ -819,9 +819,9 @@
     return;
   }
 
-  CardServices(ReleaseConfiguration, link->handle);
-  CardServices(ReleaseIO, link->handle, &link->io);
-  CardServices(ReleaseIRQ, link->handle, &link->irq);
+  pcmcia_release_configuration(link->handle);
+  pcmcia_release_io(link->handle, &link->io);
+  pcmcia_release_irq(link->handle, &link->irq);
 
   link->state &= ~DEV_CONFIG;
 
@@ -863,7 +863,7 @@
       if (link->state & DEV_CONFIG) {
 	if (link->open)
 	  netif_device_detach(dev);
-	CardServices(ReleaseConfiguration, link->handle);
+	pcmcia_release_configuration(link->handle);
       }
       break;
     case CS_EVENT_PM_RESUME:
@@ -871,7 +871,7 @@
       /* Fall through... */
     case CS_EVENT_CARD_RESET:
       if (link->state & DEV_CONFIG) {
-	CardServices(RequestConfiguration, link->handle, &link->conf);
+	pcmcia_request_configuration(link->handle, &link->conf);
 	if (link->open) {
 	  nmclan_reset(dev);
 	  netif_device_attach(dev);
@@ -903,7 +903,7 @@
   reg.Action = CS_READ;
   reg.Offset = CISREG_COR;
   reg.Value = 0;
-  CardServices(AccessConfigurationRegister, link->handle, &reg);
+  pcmcia_access_configuration_register(link->handle, &reg);
   OrigCorValue = reg.Value;
 
   /* Reset Xilinx */
@@ -912,12 +912,12 @@
   DEBUG(1, "nmclan_reset: OrigCorValue=0x%lX, resetting...\n",
 	OrigCorValue);
   reg.Value = COR_SOFT_RESET;
-  CardServices(AccessConfigurationRegister, link->handle, &reg);
+  pcmcia_access_configuration_register(link->handle, &reg);
   /* Need to wait for 20 ms for PCMCIA to finish reset. */
 
   /* Restore original COR configuration index */
   reg.Value = COR_LEVEL_REQ | (OrigCorValue & COR_CONFIG_MASK);
-  CardServices(AccessConfigurationRegister, link->handle, &reg);
+  pcmcia_access_configuration_register(link->handle, &reg);
   /* Xilinx is now completely reset along with the MACE chip. */
   lp->tx_free_frames=AM2150_MAX_TX_FRAMES;
 
@@ -1046,7 +1046,7 @@
   printk(KERN_NOTICE "%s: transmit timed out -- ", dev->name);
 #if RESET_ON_TIMEOUT
   printk("resetting card\n");
-  CardServices(ResetCard, link->handle);
+  pcmcia_reset_card(link->handle, NULL);
 #else /* #if RESET_ON_TIMEOUT */
   printk("NOT resetting card\n");
 #endif /* #if RESET_ON_TIMEOUT */
diff -Nru a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
--- a/drivers/net/pcmcia/pcnet_cs.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/net/pcmcia/pcnet_cs.c	Tue Feb  3 19:45:41 2004
@@ -303,7 +303,7 @@
     client_reg.event_handler = &pcnet_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != CS_SUCCESS) {
 	cs_error(link->handle, RegisterClient, ret);
 	pcnet_detach(link);
@@ -342,7 +342,7 @@
     }
 
     if (link->handle)
-	CardServices(DeregisterClient, link->handle);
+	pcmcia_deregister_client(link->handle);
 
     /* Unlink device structure, free bits */
     *linkp = link->next;
@@ -373,8 +373,7 @@
     req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
     req.Base = 0; req.Size = 0;
     req.AccessSpeed = 0;
-    link->win = (window_handle_t)link->handle;
-    i = CardServices(RequestWindow, &link->win, &req);
+    i = pcmcia_request_window(&link->handle, &req, &link->win);
     if (i != CS_SUCCESS) {
 	cs_error(link->handle, RequestWindow, i);
 	return NULL;
@@ -384,7 +383,7 @@
     mem.Page = 0;
     for (i = 0; i < NR_INFO; i++) {
 	mem.CardOffset = hw_info[i].offset & ~(req.Size-1);
-	CardServices(MapMemPage, link->win, &mem);
+	pcmcia_map_mem_page(link->win, &mem);
 	base = &virt[hw_info[i].offset & (req.Size-1)];
 	if ((readb(base+0) == hw_info[i].a0) &&
 	    (readb(base+2) == hw_info[i].a1) &&
@@ -397,7 +396,7 @@
     }
     
     iounmap(virt);
-    j = CardServices(ReleaseWindow, link->win);
+    j = pcmcia_release_window(link->win);
     if (j != CS_SUCCESS)
 	cs_error(link->handle, ReleaseWindow, j);
     return (i < NR_INFO) ? hw_info+i : NULL;
@@ -544,11 +543,8 @@
 
 ======================================================================*/
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
-
-#define CFG_CHECK(fn, args...) \
-if (CardServices(fn, args) != 0) goto next_entry
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static int try_io_port(dev_link_t *link)
 {
@@ -571,12 +567,12 @@
 	for (j = 0; j < 0x400; j += 0x20) {
 	    link->io.BasePort1 = j ^ 0x300;
 	    link->io.BasePort2 = (j ^ 0x300) + 0x10;
-	    ret = CardServices(RequestIO, link->handle, &link->io);
+	    ret = pcmcia_request_io(link->handle, &link->io);
 	    if (ret == CS_SUCCESS) return ret;
 	}
 	return ret;
     } else {
-	return CardServices(RequestIO, link->handle, &link->io);
+	return pcmcia_request_io(link->handle, &link->io);
     }
 }
 
@@ -600,9 +596,9 @@
     tuple.TupleDataMax = sizeof(buf);
     tuple.TupleOffset = 0;
     tuple.DesiredTuple = CISTPL_CONFIG;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
-    CS_CHECK(GetTupleData, handle, &tuple);
-    CS_CHECK(ParseTuple, handle, &tuple, &parse);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+    CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
     link->conf.ConfigBase = parse.config.base;
     link->conf.Present = parse.config.rmask[0];
 
@@ -610,28 +606,28 @@
     link->state |= DEV_CONFIG;
 
     /* Look up current Vcc */
-    CS_CHECK(GetConfigurationInfo, handle, &conf);
+    CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf));
     link->conf.Vcc = conf.Vcc;
 
     tuple.DesiredTuple = CISTPL_MANFID;
     tuple.Attributes = TUPLE_RETURN_COMMON;
-    if ((CardServices(GetFirstTuple, handle, &tuple) == CS_SUCCESS) &&
- 	(CardServices(GetTupleData, handle, &tuple) == CS_SUCCESS)) {
+    if ((pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) &&
+ 	(pcmcia_get_tuple_data(handle, &tuple) == CS_SUCCESS)) {
 	manfid = le16_to_cpu(buf[0]);
 	prodid = le16_to_cpu(buf[1]);
     }
     
     tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
     tuple.Attributes = 0;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
     while (last_ret == CS_SUCCESS) {
 	cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
 	cistpl_io_t *io = &(parse.cftable_entry.io);
 	
-	CFG_CHECK(GetTupleData, handle, &tuple);
-	CFG_CHECK(ParseTuple, handle, &tuple, &parse);
-	if ((cfg->index == 0) || (cfg->io.nwin == 0))
-	    goto next_entry;
+	if (pcmcia_get_tuple_data(handle, &tuple) != 0 ||
+			pcmcia_parse_tuple(handle, &tuple, &parse) != 0 ||
+			cfg->index == 0 || cfg->io.nwin == 0)
+		goto next_entry;
 	
 	link->conf.ConfigIndex = cfg->index;
 	/* For multifunction cards, by convention, we configure the
@@ -653,14 +649,14 @@
 	    if (last_ret == CS_SUCCESS) break;
 	}
     next_entry:
-	last_ret = CardServices(GetNextTuple, handle, &tuple);
+	last_ret = pcmcia_get_next_tuple(handle, &tuple);
     }
     if (last_ret != CS_SUCCESS) {
 	cs_error(handle, RequestIO, last_ret);
 	goto failed;
     }
 
-    CS_CHECK(RequestIRQ, handle, &link->irq);
+    CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq));
     
     if (link->io.NumPorts2 == 8) {
 	link->conf.Attributes |= CONF_ENABLE_SPKR;
@@ -670,7 +666,7 @@
 	(prodid == PRODID_IBM_HOME_AND_AWAY))
 	link->conf.ConfigIndex |= 0x10;
     
-    CS_CHECK(RequestConfiguration, handle, &link->conf);
+    CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf));
     dev->irq = link->irq.AssignedIRQ;
     dev->base_addr = link->io.BasePort1;
     if (info->flags & HAS_MISC_REG) {
@@ -799,11 +795,11 @@
 
     if (info->flags & USE_SHMEM) {
 	iounmap(info->base);
-	CardServices(ReleaseWindow, link->win);
+	pcmcia_release_window(link->win);
     }
-    CardServices(ReleaseConfiguration, link->handle);
-    CardServices(ReleaseIO, link->handle, &link->io);
-    CardServices(ReleaseIRQ, link->handle, &link->irq);
+    pcmcia_release_configuration(link->handle);
+    pcmcia_release_io(link->handle, &link->io);
+    pcmcia_release_irq(link->handle, &link->irq);
 
     link->state &= ~DEV_CONFIG;
 
@@ -847,7 +843,7 @@
 	if (link->state & DEV_CONFIG) {
 	    if (link->open)
 		netif_device_detach(&info->dev);
-	    CardServices(ReleaseConfiguration, link->handle);
+	    pcmcia_release_configuration(link->handle);
 	}
 	break;
     case CS_EVENT_PM_RESUME:
@@ -855,7 +851,7 @@
 	/* Fall through... */
     case CS_EVENT_CARD_RESET:
 	if (link->state & DEV_CONFIG) {
-	    CardServices(RequestConfiguration, link->handle, &link->conf);
+	    pcmcia_request_configuration(link->handle, &link->conf);
 	    if (link->open) {
 		pcnet_reset_8390(&info->dev);
 		NS8390_init(&info->dev, 1);
@@ -1620,14 +1616,13 @@
     req.Attributes |= WIN_USE_WAIT;
     req.Base = 0; req.Size = window_size;
     req.AccessSpeed = mem_speed;
-    link->win = (window_handle_t)link->handle;
-    CS_CHECK(RequestWindow, &link->win, &req);
+    CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &link->win));
 
     mem.CardOffset = (start_pg << 8) + cm_offset;
     offset = mem.CardOffset % window_size;
     mem.CardOffset -= offset;
     mem.Page = 0;
-    CS_CHECK(MapMemPage, link->win, &mem);
+    CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem));
 
     /* Try scribbling on the buffer */
     info->base = ioremap(req.Base, window_size);
@@ -1639,7 +1634,7 @@
     pcnet_reset_8390(dev);
     if (i != (TX_PAGES<<8)) {
 	iounmap(info->base);
-	CardServices(ReleaseWindow, link->win);
+	pcmcia_release_window(link->win);
 	info->base = NULL; link->win = NULL;
 	goto failed;
     }
diff -Nru a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
--- a/drivers/net/pcmcia/smc91c92_cs.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/net/pcmcia/smc91c92_cs.c	Tue Feb  3 19:45:34 2004
@@ -379,7 +379,7 @@
     client_reg.event_handler = &smc91c92_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != 0) {
 	cs_error(link->handle, RegisterClient, ret);
 	smc91c92_detach(link);
@@ -418,7 +418,7 @@
     }
 
     if (link->handle)
-	CardServices(DeregisterClient, link->handle);
+	pcmcia_deregister_client(link->handle);
 
     /* Unlink device structure, free bits */
     *linkp = link->next;
@@ -453,19 +453,27 @@
 
 /*====================================================================*/
 
-static int get_tuple(int fn, client_handle_t handle, tuple_t *tuple,
-		     cisparse_t *parse)
+static int first_tuple(client_handle_t handle, tuple_t *tuple,
+		cisparse_t *parse)
 {
-    int i;
-    i = CardServices(fn, handle, tuple);
-    if (i != CS_SUCCESS) return i;
-    i = CardServices(GetTupleData, handle, tuple);
-    if (i != CS_SUCCESS) return i;
-    return CardServices(ParseTuple, handle, tuple, parse);
+	int i;
+
+	if ((i = pcmcia_get_first_tuple(handle, tuple)) != CS_SUCCESS ||
+			(i = pcmcia_get_tuple_data(handle, tuple)) != CS_SUCCESS)
+		return i;
+	return pcmcia_parse_tuple(handle, tuple, parse);
 }
 
-#define first_tuple(a, b, c) get_tuple(GetFirstTuple, a, b, c)
-#define next_tuple(a, b, c) get_tuple(GetNextTuple, a, b, c)
+static int next_tuple(client_handle_t handle, tuple_t *tuple,
+		cisparse_t *parse)
+{
+	int i;
+
+	if ((i = pcmcia_get_next_tuple(handle, tuple)) != CS_SUCCESS ||
+			(i = pcmcia_get_tuple_data(handle, tuple)) != CS_SUCCESS)
+		return i;
+	return pcmcia_parse_tuple(handle, tuple, parse);
+}
 
 /*======================================================================
 
@@ -534,7 +542,7 @@
 	for (k = 0; k < 0x400; k += 0x10) {
 	    if (k & 0x80) continue;
 	    link->io.BasePort1 = k ^ 0x300;
-	    i = CardServices(RequestIO, link->handle, &link->io);
+	    i = pcmcia_request_io(link->handle, &link->io);
 	    if (i == CS_SUCCESS) break;
 	}
 	if (i == CS_SUCCESS) break;
@@ -548,15 +556,14 @@
     req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
     req.Base = req.Size = 0;
     req.AccessSpeed = 0;
-    link->win = (window_handle_t)link->handle;
-    i = CardServices(RequestWindow, &link->win, &req);
+    i = pcmcia_request_window(&link->handle, &req, &link->win);
     if (i != CS_SUCCESS)
 	return i;
     smc->base = ioremap(req.Base, req.Size);
     mem.CardOffset = mem.Page = 0;
     if (smc->manfid == MANFID_MOTOROLA)
 	mem.CardOffset = link->conf.ConfigBase;
-    i = CardServices(MapMemPage, link->win, &mem);
+    i = pcmcia_map_mem_page(link->win, &mem);
 
     if ((i == CS_SUCCESS)
 	&& (smc->manfid == MANFID_MEGAHERTZ)
@@ -594,9 +601,9 @@
 
     /* Another possibility: for the EM3288, in a special tuple */
     tuple.DesiredTuple = 0x81;
-    if (CardServices(GetFirstTuple, handle, &tuple) != CS_SUCCESS)
+    if (pcmcia_get_first_tuple(handle, &tuple) != CS_SUCCESS)
 	return -1;
-    if (CardServices(GetTupleData, handle, &tuple) != CS_SUCCESS)
+    if (pcmcia_get_tuple_data(handle, &tuple) != CS_SUCCESS)
 	return -1;
     buf[12] = '\0';
     if (cvt_ascii_address(dev, buf) == 0)
@@ -690,7 +697,7 @@
 	    link->conf.ConfigIndex = cf->index;
 	    link->io.BasePort1 = cf->io.win[0].base;
 	    link->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK;
-	    i = CardServices(RequestIO, link->handle, &link->io);
+	    i = pcmcia_request_io(link->handle, &link->io);
 	    if (i == CS_SUCCESS) break;
 	}
 	i = next_tuple(link->handle, &tuple, &parse);
@@ -763,14 +770,14 @@
 
     for (i = j = 0; j < 4; j++) {
 	link->io.BasePort2 = com[j];
-	i = CardServices(RequestIO, link->handle, &link->io);
+	i = pcmcia_request_io(link->handle, &link->io);
 	if (i == CS_SUCCESS) break;
     }
     if (i != CS_SUCCESS) {
 	/* Fallback: turn off hard decode */
 	link->conf.ConfigIndex = 0x03;
 	link->io.NumPorts2 = 0;
-	i = CardServices(RequestIO, link->handle, &link->io);
+	i = pcmcia_request_io(link->handle, &link->io);
     }
     dev->base_addr = link->io.BasePort1 + 0x10;
     return i;
@@ -791,12 +798,12 @@
 
     /* Read the station address from tuple 0x90, subtuple 0x04 */
     tuple.DesiredTuple = 0x90;
-    i = CardServices(GetFirstTuple, handle, &tuple);
+    i = pcmcia_get_first_tuple(handle, &tuple);
     while (i == CS_SUCCESS) {
-	i = CardServices(GetTupleData, handle, &tuple);
+	i = pcmcia_get_tuple_data(handle, &tuple);
 	if ((i != CS_SUCCESS) || (buf[0] == 0x04))
 	    break;
-	i = CardServices(GetNextTuple, handle, &tuple);
+	i = pcmcia_get_next_tuple(handle, &tuple);
     }
     if (i != CS_SUCCESS)
 	return -1;
@@ -869,9 +876,9 @@
 	printk(KERN_INFO "smc91c92_cs: using 8-bit IO window.\n");
 	args.client_data = link;
 	smc91c92_event(CS_EVENT_RESET_PHYSICAL, 0, &args);
-	CardServices(ReleaseIO, link->handle, &link->io);
+	pcmcia_release_io(link->handle, &link->io);
 	link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-	CardServices(RequestIO, link->handle, &link->io);
+	pcmcia_request_io(link->handle, &link->io);
 	smc91c92_event(CS_EVENT_CARD_RESET, 0, &args);
 	return check_sig(link);
     }
@@ -936,9 +943,9 @@
     }
     CS_EXIT_TEST(i, RequestIO, config_failed);
 
-    i = CardServices(RequestIRQ, link->handle, &link->irq);
+    i = pcmcia_request_irq(link->handle, &link->irq);
     CS_EXIT_TEST(i, RequestIRQ, config_failed);
-    i = CardServices(RequestConfiguration, link->handle, &link->conf);
+    i = pcmcia_request_configuration(link->handle, &link->conf);
     CS_EXIT_TEST(i, RequestConfiguration, config_failed);
 
     if (smc->manfid == MANFID_MOTOROLA)
@@ -1070,14 +1077,14 @@
 	return;
     }
 
-    CardServices(ReleaseConfiguration, link->handle);
-    CardServices(ReleaseIO, link->handle, &link->io);
-    CardServices(ReleaseIRQ, link->handle, &link->irq);
+    pcmcia_release_configuration(link->handle);
+    pcmcia_release_io(link->handle, &link->io);
+    pcmcia_release_irq(link->handle, &link->irq);
     if (link->win) {
 	struct net_device *dev = link->priv;
 	struct smc_private *smc = dev->priv;
 	iounmap(smc->base);
-	CardServices(ReleaseWindow, link->win);
+	pcmcia_release_window(link->win);
     }
 
     link->state &= ~DEV_CONFIG;
@@ -1124,7 +1131,7 @@
 	if (link->state & DEV_CONFIG) {
 	    if (link->open)
 		netif_device_detach(dev);
-	    CardServices(ReleaseConfiguration, link->handle);
+	    pcmcia_release_configuration(link->handle);
 	}
 	break;
     case CS_EVENT_PM_RESUME:
@@ -1135,7 +1142,7 @@
 	    if ((smc->manfid == MANFID_MEGAHERTZ) &&
 		(smc->cardid == PRODID_MEGAHERTZ_EM3288))
 		mhz_3288_power(link);
-	    CardServices(RequestConfiguration, link->handle, &link->conf);
+	    pcmcia_request_configuration(link->handle, &link->conf);
 	    if (smc->manfid == MANFID_MOTOROLA)
 		mot_config(link);
 	    if ((smc->manfid == MANFID_OSITECH) &&
diff -Nru a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
--- a/drivers/net/pcmcia/xirc2ps_cs.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/pcmcia/xirc2ps_cs.c	Tue Feb  3 19:45:17 2004
@@ -391,28 +391,27 @@
 
 /*=============== Helper functions =========================*/
 static int
-get_tuple_data(int fn, client_handle_t handle, tuple_t *tuple)
+first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
 {
-    int err;
+	int err;
 
-    if ((err=CardServices(fn, handle, tuple)))
+	if ((err = pcmcia_get_first_tuple(handle, tuple)) == 0 &&
+			(err = pcmcia_get_tuple_data(handle, tuple)) == 0)
+		err = pcmcia_parse_tuple(handle, tuple, parse);
 	return err;
-    return CardServices(GetTupleData, handle, tuple);
 }
 
 static int
-get_tuple(int fn, client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
+next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
 {
-    int err;
+	int err;
 
-    if ((err=get_tuple_data(fn, handle, tuple)))
+	if ((err = pcmcia_get_next_tuple(handle, tuple)) == 0 &&
+			(err = pcmcia_get_tuple_data(handle, tuple)) == 0)
+		err = pcmcia_parse_tuple(handle, tuple, parse);
 	return err;
-    return CardServices(ParseTuple, handle, tuple, parse);
 }
 
-#define first_tuple(a, b, c) get_tuple(GetFirstTuple, a, b, c)
-#define next_tuple(a, b, c)  get_tuple(GetNextTuple, a, b, c)
-
 #define SelectPage(pgnr)   outb((pgnr), ioaddr + XIRCREG_PR)
 #define GetByte(reg)	   ((unsigned)inb(ioaddr + (reg)))
 #define GetWord(reg)	   ((unsigned)inw(ioaddr + (reg)))
@@ -636,7 +635,7 @@
     client_reg.event_handler = &xirc2ps_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    if ((err = CardServices(RegisterClient, &link->handle, &client_reg))) {
+    if ((err = pcmcia_register_client(&link->handle, &client_reg))) {
 	cs_error(link->handle, RegisterClient, err);
 	xirc2ps_detach(link);
 	return NULL;
@@ -680,7 +679,7 @@
 
     /* Break the link with Card Services */
     if (link->handle)
-	CardServices(DeregisterClient, link->handle);
+	pcmcia_deregister_client(link->handle);
 
     /* Unlink device structure, free it */
     *linkp = link->next;
@@ -887,7 +886,8 @@
     }
     if (err) { /* not found: try to get the node-id from tuple 0x89 */
 	tuple.DesiredTuple = 0x89;  /* data layout looks like tuple 0x22 */
-	if (!(err = get_tuple_data(GetFirstTuple, handle, &tuple))) {
+	if ((err = pcmcia_get_first_tuple(handle, &tuple)) == 0 &&
+		(err = pcmcia_get_tuple_data(handle, &tuple)) == 0) {
 	    if (tuple.TupleDataLen == 8 && *buf == CISTPL_FUNCE_LAN_NODE_ID)
 		memcpy(&parse, buf, 8);
 	    else
@@ -953,8 +953,7 @@
 			link->conf.ConfigIndex = cf->index ;
 			link->io.BasePort2 = cf->io.win[0].base;
 			link->io.BasePort1 = ioaddr;
-			if (!(err=CardServices(RequestIO, link->handle,
-								&link->io)))
+			if (!(err=pcmcia_request_io(link->handle, &link->io)))
 			    goto port_found;
 		    }
 		}
@@ -976,8 +975,7 @@
 			link->io.BasePort1 = link->io.BasePort2
 				    + (pass ? (cf->index & 0x20 ? -24:8)
 					    : (cf->index & 0x20 ?   8:-24));
-			if (!(err=CardServices(RequestIO, link->handle,
-								&link->io)))
+			if (!(err=pcmcia_request_io(link->handle, &link->io)))
 			    goto port_found;
 		    }
 		}
@@ -992,11 +990,11 @@
 	link->io.NumPorts1 = 16;
 	for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) {
 	    link->io.BasePort1 = ioaddr;
-	    if (!(err=CardServices(RequestIO, link->handle, &link->io)))
+	    if (!(err=pcmcia_request_io(link->handle, &link->io)))
 		goto port_found;
 	}
 	link->io.BasePort1 = 0; /* let CS decide */
-	if ((err=CardServices(RequestIO, link->handle, &link->io))) {
+	if ((err=pcmcia_request_io(link->handle, &link->io))) {
 	    cs_error(link->handle, RequestIO, err);
 	    goto config_error;
 	}
@@ -1009,7 +1007,7 @@
      * Now allocate an interrupt line.	Note that this does not
      * actually assign a handler to the interrupt.
      */
-    if ((err=CardServices(RequestIRQ, link->handle, &link->irq))) {
+    if ((err=pcmcia_request_irq(link->handle, &link->irq))) {
 	cs_error(link->handle, RequestIRQ, err);
 	goto config_error;
     }
@@ -1018,8 +1016,7 @@
      * This actually configures the PCMCIA socket -- setting up
      * the I/O windows and the interrupt mapping.
      */
-    if ((err=CardServices(RequestConfiguration,
-			  link->handle, &link->conf))) {
+    if ((err=pcmcia_request_configuration(link->handle, &link->conf))) {
 	cs_error(link->handle, RequestConfiguration, err);
 	goto config_error;
     }
@@ -1037,16 +1034,14 @@
 	reg.Action = CS_WRITE;
 	reg.Offset = CISREG_IOBASE_0;
 	reg.Value = link->io.BasePort2 & 0xff;
-	if ((err = CardServices(AccessConfigurationRegister, link->handle,
-				&reg))) {
+	if ((err = pcmcia_access_configuration_register(link->handle, &reg))) {
 	    cs_error(link->handle, AccessConfigurationRegister, err);
 	    goto config_error;
 	}
 	reg.Action = CS_WRITE;
 	reg.Offset = CISREG_IOBASE_1;
 	reg.Value = (link->io.BasePort2 >> 8) & 0xff;
-	if ((err = CardServices(AccessConfigurationRegister, link->handle,
-				&reg))) {
+	if ((err = pcmcia_access_configuration_register(link->handle, &reg))) {
 	    cs_error(link->handle, AccessConfigurationRegister, err);
 	    goto config_error;
 	}
@@ -1058,15 +1053,14 @@
 	req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
 	req.Base = req.Size = 0;
 	req.AccessSpeed = 0;
-	link->win = (window_handle_t)link->handle;
-	if ((err = CardServices(RequestWindow, &link->win, &req))) {
+	if ((err = pcmcia_request_window(&link->handle, &req, &link->win))) {
 	    cs_error(link->handle, RequestWindow, err);
 	    goto config_error;
 	}
 	local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800;
 	mem.CardOffset = 0x0;
 	mem.Page = 0;
-	if ((err = CardServices(MapMemPage, link->win, &mem))) {
+	if ((err = pcmcia_map_mem_page(link->win, &mem))) {
 	    cs_error(link->handle, MapMemPage, err);
 	    goto config_error;
 	}
@@ -1171,11 +1165,11 @@
 	local_info_t *local = dev->priv;
 	if (local->dingo)
 	    iounmap(local->dingo_ccr - 0x0800);
-	CardServices(ReleaseWindow, link->win);
+	pcmcia_release_window(link->win);
     }
-    CardServices(ReleaseConfiguration, link->handle);
-    CardServices(ReleaseIO, link->handle, &link->io);
-    CardServices(ReleaseIRQ, link->handle, &link->irq);
+    pcmcia_release_configuration(link->handle);
+    pcmcia_release_io(link->handle, &link->io);
+    pcmcia_release_irq(link->handle, &link->irq);
     link->state &= ~DEV_CONFIG;
 
 } /* xirc2ps_release */
@@ -1227,7 +1221,7 @@
 		netif_device_detach(dev);
 		do_powerdown(dev);
 	    }
-	    CardServices(ReleaseConfiguration, link->handle);
+	    pcmcia_release_configuration(link->handle);
 	}
 	break;
     case CS_EVENT_PM_RESUME:
@@ -1235,7 +1229,7 @@
 	/* Fall through... */
     case CS_EVENT_CARD_RESET:
 	if (link->state & DEV_CONFIG) {
-	    CardServices(RequestConfiguration, link->handle, &link->conf);
+	    pcmcia_request_configuration(link->handle, &link->conf);
 	    if (link->open) {
 		do_reset(dev,1);
 		netif_device_attach(dev);
diff -Nru a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c
--- a/drivers/net/ppp_async.c	Tue Feb  3 19:45:35 2004
+++ b/drivers/net/ppp_async.c	Tue Feb  3 19:45:35 2004
@@ -16,8 +16,6 @@
  * Part of the code in this driver was inspired by the old async-only
  * PPP driver, written by Michael Callahan and Al Longyear, and
  * subsequently hacked by Paul Mackerras.
- *
- * ==FILEVERSION 20020125==
  */
 
 #include <linux/module.h>
@@ -61,6 +59,9 @@
 
 	struct sk_buff	*rpkt;
 	int		lcp_fcs;
+	struct sk_buff_head rqueue;
+
+	struct tasklet_struct tsk;
 
 	atomic_t	refcnt;
 	struct semaphore dead_sem;
@@ -74,8 +75,9 @@
 #define XMIT_BUSY	2
 
 /* State bits */
-#define SC_TOSS		0x20000000
-#define SC_ESCAPE	0x40000000
+#define SC_TOSS		1
+#define SC_ESCAPE	2
+#define SC_PREV_ERROR	4
 
 /* Bits in rbits */
 #define SC_RCV_BITS	(SC_RCV_B7_1|SC_RCV_B7_0|SC_RCV_ODDP|SC_RCV_EVNP)
@@ -97,6 +99,8 @@
 			    char *flags, int count);
 static int ppp_async_ioctl(struct ppp_channel *chan, unsigned int cmd,
 			   unsigned long arg);
+static void ppp_async_process(unsigned long arg);
+
 static void async_lcp_peek(struct asyncppp *ap, unsigned char *data,
 			   int len, int inbound);
 
@@ -165,6 +169,9 @@
 	ap->olim = ap->obuf;
 	ap->lcp_fcs = -1;
 
+	skb_queue_head_init(&ap->rqueue);
+	tasklet_init(&ap->tsk, ppp_async_process, (unsigned long) ap);
+
 	atomic_set(&ap->refcnt, 1);
 	init_MUTEX_LOCKED(&ap->dead_sem);
 
@@ -214,10 +221,12 @@
 	 */
 	if (!atomic_dec_and_test(&ap->refcnt))
 		down(&ap->dead_sem);
+	tasklet_kill(&ap->tsk);
 
 	ppp_unregister_channel(&ap->chan);
 	if (ap->rpkt != 0)
 		kfree_skb(ap->rpkt);
+	skb_queue_purge(&ap->rqueue);
 	if (ap->tpkt != 0)
 		kfree_skb(ap->tpkt);
 	kfree(ap);
@@ -316,17 +325,24 @@
 	return 65535;
 }
 
+/*
+ * This can now be called from hard interrupt level as well
+ * as soft interrupt level or mainline.
+ */
 static void
 ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf,
-		  char *flags, int count)
+		  char *cflags, int count)
 {
 	struct asyncppp *ap = ap_get(tty);
+	unsigned long flags;
 
 	if (ap == 0)
 		return;
-	spin_lock_bh(&ap->recv_lock);
-	ppp_async_input(ap, buf, flags, count);
-	spin_unlock_bh(&ap->recv_lock);
+	spin_lock_irqsave(&ap->recv_lock, flags);
+	ppp_async_input(ap, buf, cflags, count);
+	spin_unlock_irqrestore(&ap->recv_lock, flags);
+	if (skb_queue_len(&ap->rqueue))
+		tasklet_schedule(&ap->tsk);
 	ap_put(ap);
 	if (test_and_clear_bit(TTY_THROTTLED, &tty->flags)
 	    && tty->driver->unthrottle)
@@ -341,8 +357,8 @@
 	clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
 	if (ap == 0)
 		return;
-	if (ppp_async_push(ap))
-		ppp_output_wakeup(&ap->chan);
+	set_bit(XMIT_WAKEUP, &ap->xmit_flags);
+	tasklet_schedule(&ap->tsk);
 	ap_put(ap);
 }
 
@@ -396,9 +412,9 @@
 		if (get_user(val, (int *) arg))
 			break;
 		ap->flags = val & ~SC_RCV_BITS;
-		spin_lock_bh(&ap->recv_lock);
+		spin_lock_irq(&ap->recv_lock);
 		ap->rbits = val & SC_RCV_BITS;
-		spin_unlock_bh(&ap->recv_lock);
+		spin_unlock_irq(&ap->recv_lock);
 		err = 0;
 		break;
 
@@ -460,6 +476,28 @@
 }
 
 /*
+ * This is called at softirq level to deliver received packets
+ * to the ppp_generic code, and to tell the ppp_generic code
+ * if we can accept more output now.
+ */
+static void ppp_async_process(unsigned long arg)
+{
+	struct asyncppp *ap = (struct asyncppp *) arg;
+	struct sk_buff *skb;
+
+	/* process received packets */
+	while ((skb = skb_dequeue(&ap->rqueue)) != NULL) {
+		if (skb->cb[0])
+			ppp_input_error(&ap->chan, 0);
+		ppp_input(&ap->chan, skb);
+	}
+
+	/* try to push more stuff out */
+	if (test_bit(XMIT_WAKEUP, &ap->xmit_flags) && ppp_async_push(ap))
+		ppp_output_wakeup(&ap->chan);
+}
+
+/*
  * Procedures for encapsulation and framing.
  */
 
@@ -641,7 +679,6 @@
 	struct tty_struct *tty = ap->tty;
 	int tty_stuffed = 0;
 
-	set_bit(XMIT_WAKEUP, &ap->xmit_flags);
 	/*
 	 * We can get called recursively here if the tty write
 	 * function calls our wakeup function.  This can happen
@@ -752,22 +789,19 @@
 }
 
 /* called when a flag is seen - do end-of-packet processing */
-static inline void
+static void
 process_input_packet(struct asyncppp *ap)
 {
 	struct sk_buff *skb;
 	unsigned char *p;
 	unsigned int len, fcs, proto;
-	int code = 0;
 
 	skb = ap->rpkt;
-	ap->rpkt = 0;
-	if ((ap->state & (SC_TOSS | SC_ESCAPE)) || skb == 0) {
-		ap->state &= ~(SC_TOSS | SC_ESCAPE);
-		if (skb != 0)
-			kfree_skb(skb);
-		return;
-	}
+	if (ap->state & (SC_TOSS | SC_ESCAPE))
+		goto err;
+
+	if (skb == NULL)
+		return;		/* 0-length packet */
 
 	/* check the FCS */
 	p = skb->data;
@@ -801,20 +835,18 @@
 			async_lcp_peek(ap, p, skb->len, 1);
 	}
 
-	/* all OK, give it to the generic layer */
-	ppp_input(&ap->chan, skb);
+	/* queue the frame to be processed */
+	skb->cb[0] = ap->state;
+	skb_queue_tail(&ap->rqueue, skb);
+	ap->rpkt = 0;
+	ap->state = 0;
 	return;
 
  err:
-	kfree_skb(skb);
-	ppp_input_error(&ap->chan, code);
-}
-
-static inline void
-input_error(struct asyncppp *ap, int code)
-{
-	ap->state |= SC_TOSS;
-	ppp_input_error(&ap->chan, code);
+	/* frame had an error, remember that, reset SC_TOSS & SC_ESCAPE */
+	ap->state = SC_PREV_ERROR;
+	if (skb)
+		skb_trim(skb, 0);
 }
 
 /* called when the tty driver has data for us. */
@@ -856,7 +888,7 @@
 		}
 		if (f != 0) {
 			/* start tossing */
-			input_error(ap, f);
+			ap->state |= SC_TOSS;
 
 		} else if (n > 0 && (ap->state & SC_TOSS) == 0) {
 			/* stuff the chars in the skb */
@@ -872,7 +904,7 @@
 			}
 			if (n > skb_tailroom(skb)) {
 				/* packet overflowed MRU */
-				input_error(ap, 1);
+				ap->state |= SC_TOSS;
 			} else {
 				sp = skb_put(skb, n);
 				memcpy(sp, buf, n);
@@ -909,7 +941,7 @@
 
  nomem:
 	printk(KERN_ERR "PPPasync: no memory (input pkt)\n");
-	input_error(ap, 0);
+	ap->state |= SC_TOSS;
 }
 
 /*
diff -Nru a/drivers/net/pppoe.c b/drivers/net/pppoe.c
--- a/drivers/net/pppoe.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/net/pppoe.c	Tue Feb  3 19:45:30 2004
@@ -775,8 +775,8 @@
 }
 
 
-static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m,
-		  int total_len)
+static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock, 
+		  struct msghdr *m, size_t total_len)
 {
 	struct sk_buff *skb = NULL;
 	struct sock *sk = sock->sk;
@@ -939,7 +939,7 @@
 };
 
 static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock,
-		  struct msghdr *m, int total_len, int flags)
+		  struct msghdr *m, size_t total_len, int flags)
 {
 	struct sock *sk = sock->sk;
 	struct sk_buff *skb = NULL;
diff -Nru a/drivers/net/sk98lin/Makefile b/drivers/net/sk98lin/Makefile
--- a/drivers/net/sk98lin/Makefile	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/sk98lin/Makefile	Tue Feb  3 19:45:16 2004
@@ -76,7 +76,7 @@
 # SK_DBGCAT_DRV_INT_SRC         0x04000000      interrupts sources
 # SK_DBGCAT_DRV_EVENT           0x08000000      driver events
 
-EXTRA_CFLAGS += -Idrivers/net/sk98lin -DSK_USE_CSUM -DGENESIS -DYUKON $(DBGDEF) $(SKPARAM)
+EXTRA_CFLAGS += -Idrivers/net/sk98lin -DSK_DIAG_SUPPORT -DSK_USE_CSUM -DGENESIS -DYUKON $(DBGDEF) $(SKPARAM)
 
 clean:
 	rm -f core *.o *.a *.s
diff -Nru a/drivers/net/sk98lin/h/skcsum.h b/drivers/net/sk98lin/h/skcsum.h
--- a/drivers/net/sk98lin/h/skcsum.h	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/sk98lin/h/skcsum.h	Tue Feb  3 19:45:16 2004
@@ -2,8 +2,8 @@
  *
  * Name:	skcsum.h
  * Project:	GEnesis - SysKonnect SK-NET Gigabit Ethernet (SK-98xx)
- * Version:	$Revision: 1.9 $
- * Date:	$Date: 2001/02/06 11:21:39 $
+ * Version:	$Revision: 1.10 $
+ * Date:	$Date: 2003/08/20 13:59:57 $
  * Purpose:	Store/verify Internet checksum in send/receive packets.
  *
  ******************************************************************************/
@@ -26,6 +26,10 @@
  * History:
  *
  *	$Log: skcsum.h,v $
+ *	Revision 1.10  2003/08/20 13:59:57  mschmid
+ *	Changed notation of #ifndef SkCsCalculateChecksum to
+ *	#ifndef SK_CS_CALCULATE_CHECKSUM
+ *	
  *	Revision 1.9  2001/02/06 11:21:39  rassmann
  *	Editorial changes.
  *	
@@ -226,11 +230,11 @@
 
 /* function prototypes ********************************************************/
 
-#ifndef SkCsCalculateChecksum
+#ifndef SK_CS_CALCULATE_CHECKSUM
 extern unsigned SkCsCalculateChecksum(
 	void		*pData,
 	unsigned	Length);
-#endif
+#endif /* SK_CS_CALCULATE_CHECKSUM */
 
 extern int SkCsEvent(
 	SK_AC		*pAc,
diff -Nru a/drivers/net/sk98lin/h/skdrv1st.h b/drivers/net/sk98lin/h/skdrv1st.h
--- a/drivers/net/sk98lin/h/skdrv1st.h	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/sk98lin/h/skdrv1st.h	Tue Feb  3 19:45:16 2004
@@ -2,15 +2,16 @@
  *
  * Name:	skdrv1st.h
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.1 $
- * Date:	$Date: 2003/07/21 07:22:43 $
+ * Version:	$Revision: 1.4 $
+ * Date:	$Date: 2003/11/12 14:28:14 $
  * Purpose:	First header file for driver and all other modules
  *
  ******************************************************************************/
 
 /******************************************************************************
  *
- *	(C)Copyright 1998-2003 SysKonnect GmbH.
+ *	(C)Copyright 1998-2002 SysKonnect GmbH.
+ *	(C)Copyright 2002-2003 Marvell.
  *
  *	This program is free software; you can redistribute it and/or modify
  *	it under the terms of the GNU General Public License as published by
@@ -26,6 +27,15 @@
  * History:
  *
  *	$Log: skdrv1st.h,v $
+ *	Revision 1.4  2003/11/12 14:28:14  rroesler
+ *	Fix: use dedicated ip_fast_csum() on X86_64 systems
+ *	
+ *	Revision 1.3  2003/10/07 08:16:52  mlindner
+ *	Fix: Copyright changes
+ *	
+ *	Revision 1.2  2003/09/29 12:05:59  mlindner
+ *	Fix: Added define SK_CS_CALCULSTE_CHECKSUM
+ *	
  *	Revision 1.1  2003/07/21 07:22:43  rroesler
  *	Fix: Re-Enter after CVS crash
  *	
@@ -110,6 +120,9 @@
 #ifndef __INC_SKDRV1ST_H
 #define __INC_SKDRV1ST_H
 
+/* Check kernel version */
+#include <linux/version.h>
+
 typedef struct s_AC	SK_AC;
 
 /* Set card versions */
@@ -124,17 +137,15 @@
 #define SK_PNMI_READ_U32(p,v)		memcpy((char*)&(v),(char*)(p),4)
 #define SK_PNMI_READ_U64(p,v)		memcpy((char*)&(v),(char*)(p),8)
 
-#define SkCsCalculateChecksum(p,l)	((~ip_compute_csum(p, l)) & 0xffff)
-
 #define SK_ADDR_EQUAL(a1,a2)		(!memcmp(a1,a2,6))
 
-
 #if !defined(__OPTIMIZE__)  ||  !defined(__KERNEL__)
 #warning  You must compile this file with the correct options!
 #warning  See the last lines of the source file.
 #error You must compile this driver with "-O".
 #endif
 
+#include <linux/version.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -153,6 +164,13 @@
 #include <linux/init.h>
 #include <asm/uaccess.h>
 #include <net/checksum.h>
+
+#define SK_CS_CALCULATE_CHECKSUM
+#ifndef CONFIG_X86_64
+#define SkCsCalculateChecksum(p,l)	((~ip_compute_csum(p, l)) & 0xffff)
+#else
+#define SkCsCalculateChecksum(p,l)	((~ip_fast_csum(p, l)) & 0xffff)
+#endif
 
 #include	"h/sktypes.h"
 #include	"h/skerror.h"
diff -Nru a/drivers/net/sk98lin/h/skdrv2nd.h b/drivers/net/sk98lin/h/skdrv2nd.h
--- a/drivers/net/sk98lin/h/skdrv2nd.h	Tue Feb  3 19:45:43 2004
+++ b/drivers/net/sk98lin/h/skdrv2nd.h	Tue Feb  3 19:45:43 2004
@@ -2,15 +2,16 @@
  *
  * Name:	skdrv2nd.h
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.3 $
- * Date:	$Date: 2003/08/12 16:51:18 $
+ * Version:	$Revision: 1.10 $
+ * Date:	$Date: 2003/12/11 16:04:45 $
  * Purpose:	Second header file for driver and all other modules
  *
  ******************************************************************************/
 
 /******************************************************************************
  *
- *	(C)Copyright 1998-2003 SysKonnect GmbH.
+ *	(C)Copyright 1998-2002 SysKonnect GmbH.
+ *	(C)Copyright 2002-2003 Marvell.
  *
  *	This program is free software; you can redistribute it and/or modify
  *	it under the terms of the GNU General Public License as published by
@@ -26,6 +27,27 @@
  * History:
  *
  *	$Log: skdrv2nd.h,v $
+ *	Revision 1.10  2003/12/11 16:04:45  mlindner
+ *	Add: New pnmi data backup structure
+ *	
+ *	Revision 1.9  2003/11/10 09:31:37  rroesler
+ *	Add: pnmiBackup structure for DIAG backup restore
+ *	
+ *	Revision 1.8  2003/10/22 14:18:32  rroesler
+ *	Fix: DIAG handling for DualNet cards
+ *	
+ *	Revision 1.7  2003/10/07 09:34:59  mlindner
+ *	Add: New defines for lower and upper range values (interrupt moderation)
+ *	
+ *	Revision 1.6  2003/10/07 08:16:51  mlindner
+ *	Fix: Copyright changes
+ *	
+ *	Revision 1.5  2003/09/01 13:10:39  rroesler
+ *	Add: Prototypes for DIAG Attach/Detach functions
+ *	
+ *	Revision 1.4  2003/09/01 12:33:38  rroesler
+ *	Add: Defines for optimized DIAG interaction
+ *	
  *	Revision 1.3  2003/08/12 16:51:18  mlindner
  *	Fix: UDP and TCP Proto checks
  *	Fix: UDP header offset
@@ -206,6 +228,11 @@
 extern int		SkPciWriteCfgByte(SK_AC*, int, SK_U8);
 extern int		SkDrvEvent(SK_AC*, SK_IOC IoC, SK_U32, SK_EVPARA);
 
+#ifdef SK_DIAG_SUPPORT
+extern int		SkDrvEnterDiagMode(SK_AC *pAc);
+extern int		SkDrvLeaveDiagMode(SK_AC *pAc);
+#endif
+
 struct s_DrvRlmtMbuf {
 	SK_MBUF		*pNext;		/* Pointer to next RLMT Mbuf. */
 	SK_U8		*pData;		/* Data buffer (virtually contig.). */
@@ -247,6 +274,7 @@
 #define		SK_IOCTL_SETMIB		(SK_IOCTL_BASE + 1)
 #define		SK_IOCTL_PRESETMIB	(SK_IOCTL_BASE + 2)
 #define		SK_IOCTL_GEN		(SK_IOCTL_BASE + 3)
+#define		SK_IOCTL_DIAG		(SK_IOCTL_BASE + 4)
 
 typedef struct s_IOCTL	SK_GE_IOCTL;
 
@@ -462,6 +490,9 @@
 #define C_INTS_PER_SEC_DEFAULT      2000 
 #define C_INT_MOD_ENABLE_PERCENTAGE   50 /* if higher 50% enable */
 #define C_INT_MOD_DISABLE_PERCENTAGE  50 /* if lower 50% disable */
+#define C_INT_MOD_IPS_LOWER_RANGE     30
+#define C_INT_MOD_IPS_UPPER_RANGE     40000
+
 
 typedef struct s_DynIrqModInfo  DIM_INFO;
 struct s_DynIrqModInfo {
@@ -493,6 +524,11 @@
 
 #define SK_ALLOC_IRQ	0x00000001
 
+#ifdef SK_DIAG_SUPPORT
+#define	DIAG_ACTIVE		1
+#define	DIAG_NOTACTIVE		0
+#endif
+
 /****************************************************************************
  * Per board structure / Adapter Context structure:
  *	Allocated within attach(9e) and freed within detach(9e).
@@ -563,9 +599,18 @@
 	int		PortUp;
 	int		PortDown;
 	int		ChipsetType;	/*  Chipset family type 
-							 *  0 == Genesis family support
-							 *  1 == Yukon family support
-							 */
+					 *  0 == Genesis family support
+					 *  1 == Yukon family support
+					 */
+#ifdef SK_DIAG_SUPPORT
+	SK_U32		DiagModeActive;		/* is diag active?	*/
+	SK_BOOL		DiagFlowCtrl;		/* for control purposes	*/
+	SK_PNMI_STRUCT_DATA PnmiBackup;		/* backup structure for all Pnmi-Data */
+	SK_BOOL         WasIfUp[SK_MAX_MACS];   /* for OpenClose while 
+						 * DIAG is busy with NIC 
+						 */
+#endif
+
 };
 
 
diff -Nru a/drivers/net/sk98lin/h/skgehw.h b/drivers/net/sk98lin/h/skgehw.h
--- a/drivers/net/sk98lin/h/skgehw.h	Tue Feb  3 19:45:42 2004
+++ b/drivers/net/sk98lin/h/skgehw.h	Tue Feb  3 19:45:42 2004
@@ -2,8 +2,8 @@
  *
  * Name:	skgehw.h
  * Project:	Gigabit Ethernet Adapters, Common Modules
- * Version:	$Revision: 1.53 $
- * Date:	$Date: 2003/07/04 12:39:01 $
+ * Version:	$Revision: 1.56 $
+ * Date:	$Date: 2003/09/23 09:01:00 $
  * Purpose:	Defines and Macros for the Gigabit Ethernet Adapter Product Family
  *
  ******************************************************************************/
@@ -26,6 +26,17 @@
  *
  * History:
  * $Log: skgehw.h,v $
+ * Revision 1.56  2003/09/23 09:01:00  malthoff
+ * Minor change: Define I2C device size constants as long.
+ *
+ * Revision 1.55  2003/09/16 14:03:34  rschmidt
+ * Added define for YUKON-Lite Rev. A1,A2 Chip Revision
+ * Moved defines for PHY power down modes to skgeinit.h
+ * Editorial changes
+ *
+ * Revision 1.54  2003/09/16 07:37:58  mschmid
+ * Added defines for Marvell PHY low power modes
+ *
  * Revision 1.53  2003/07/04 12:39:01  rschmidt
  * Added SK_FAR to pointers in XM_IN32() and GM_IN32() macros (for PXE)
  * Editorial changes
@@ -84,7 +95,7 @@
  * Editorial changes
  *
  * Revision 1.39  2002/06/10 09:37:07  rschmidt
- * Added macros for the ADDR-Modul
+ * Added macros for the ADDR-Module
  *
  * Revision 1.38  2002/06/05 08:15:19  rschmidt
  * Added defines for WOL Registers
@@ -628,12 +639,12 @@
 #define B2_FAR			0x0120	/* 32 bit	Flash-Prom Addr Reg/Cnt */
 #define B2_FDP			0x0124	/*  8 bit	Flash-Prom Data Port */
 	/* 0x0125 - 0x0127:	reserved */
-#define B2_LD_CRTL		0x0128	/*  8 bit	EPROM loader control register */
+#define B2_LD_CTRL		0x0128	/*  8 bit	EPROM loader control register */
 #define B2_LD_TEST		0x0129	/*  8 bit	EPROM loader test register */
 	/* 0x012a - 0x012f:	reserved */
 #define B2_TI_INI		0x0130	/* 32 bit	Timer Init Value */
 #define B2_TI_VAL		0x0134	/* 32 bit	Timer Value */
-#define B2_TI_CRTL		0x0138	/*  8 bit	Timer Control */
+#define B2_TI_CTRL		0x0138	/*  8 bit	Timer Control */
 #define B2_TI_TEST		0x0139	/*  8 Bit	Timer Test */
 	/* 0x013a - 0x013f:	reserved */
 #define B2_IRQM_INI		0x0140	/* 32 bit	IRQ Moderation Timer Init Reg.*/
@@ -1021,7 +1032,7 @@
 								/* Bit 7:	reserved */
 #define RAP_RAP			0x3f	/* Bit 6..0:	0 = block 0,..,6f = block 6f */
 
-/*	B0_CTST		16 bit	Control/Status register */
+/*	B0_CTST			16 bit	Control/Status register */
 								/* Bit 15..14:	reserved */
 #define CS_CLK_RUN_HOT	BIT_13S		/* CLK_RUN hot m. (YUKON-Lite only) */
 #define CS_CLK_RUN_RST	BIT_12S		/* CLK_RUN reset  (YUKON-Lite only) */
@@ -1038,7 +1049,7 @@
 #define CS_RST_CLR		BIT_1S		/* Clear Software reset	*/
 #define CS_RST_SET		BIT_0S		/* Set   Software reset	*/
 
-/*	B0_LED		 8 Bit	LED register */
+/*	B0_LED			 8 Bit	LED register */
 								/* Bit  7.. 2:	reserved */
 #define LED_STAT_ON		BIT_1S		/* Status LED on	*/
 #define LED_STAT_OFF	BIT_0S		/* Status LED off	*/
@@ -1053,9 +1064,9 @@
 #define PC_VCC_ON		BIT_1       /* Switch VCC On  */
 #define PC_VCC_OFF		BIT_0       /* Switch VCC Off */
 
-/*	B0_ISRC		32 bit	Interrupt Source Register */
-/*	B0_IMSK		32 bit	Interrupt Mask Register */
-/*	B0_SP_ISRC	32 bit	Special Interrupt Source Reg */
+/*	B0_ISRC			32 bit	Interrupt Source Register */
+/*	B0_IMSK			32 bit	Interrupt Mask Register */
+/*	B0_SP_ISRC		32 bit	Special Interrupt Source Reg */
 /*	B2_IRQM_MSK 	32 bit	IRQ Moderation Mask */
 #define IS_ALL_MSK		0xbfffffffUL	/* All Interrupt bits */
 #define IS_HW_ERR		BIT_31		/* Interrupt HW Error */
@@ -1099,9 +1110,9 @@
 #define IS_XA2_C		BIT_0		/* Q_XA2 Encoding Error */
 
 
-/*	B0_HWE_ISRC	32 bit	HW Error Interrupt Src Reg */
-/*	B0_HWE_IMSK	32 bit	HW Error Interrupt Mask Reg */
-/*	B2_IRQM_HWE_MSK 32 bit	IRQ Moderation HW Error Mask */
+/*	B0_HWE_ISRC		32 bit	HW Error Interrupt Src Reg */
+/*	B0_HWE_IMSK		32 bit	HW Error Interrupt Mask Reg */
+/*	B2_IRQM_HWE_MSK	32 bit	IRQ Moderation HW Error Mask */
 #define IS_ERR_MSK		0x00000fffL	/* 		All Error bits */
 								/* Bit 31..14:	reserved */
 #define IS_IRQ_TIST_OV	BIT_13	/* Time Stamp Timer Overflow (YUKON only) */
@@ -1119,29 +1130,32 @@
 #define IS_R1_PAR_ERR	BIT_1	/* Queue R1 Parity Error */
 #define IS_R2_PAR_ERR	BIT_0	/* Queue R2 Parity Error */
 
-/*	B2_CONN_TYP	 8 bit	Connector type */
-/*	B2_PMD_TYP	 8 bit	PMD type */
+/*	B2_CONN_TYP		 8 bit	Connector type */
+/*	B2_PMD_TYP		 8 bit	PMD type */
 /*	Values of connector and PMD type comply to SysKonnect internal std */
 
-/*	B2_MAC_CFG	 8 bit	MAC Configuration / Chip Revision */
+/*	B2_MAC_CFG		 8 bit	MAC Configuration / Chip Revision */
 #define CFG_CHIP_R_MSK	(0xf<<4)	/* Bit 7.. 4: Chip Revision */
 									/* Bit 3.. 2:	reserved */
 #define CFG_DIS_M2_CLK	BIT_1S		/* Disable Clock for 2nd MAC */
 #define CFG_SNG_MAC		BIT_0S		/* MAC Config: 0=2 MACs / 1=1 MAC*/
 
-/*	B2_CHIP_ID	 8 bit 	Chip Identification Number */
+/*	B2_CHIP_ID		 8 bit 	Chip Identification Number */
 #define CHIP_ID_GENESIS		0x0a	/* Chip ID for GENESIS */
 #define CHIP_ID_YUKON		0xb0	/* Chip ID for YUKON */
-#define CHIP_ID_YUKON_LITE	0xb1	/* Chip ID for YUKON-Lite (Rev. A1) */
+#define CHIP_ID_YUKON_LITE	0xb1	/* Chip ID for YUKON-Lite (Rev. A1-A3) */
 #define CHIP_ID_YUKON_LP	0xb2	/* Chip ID for YUKON-LP */
 
-/*	B2_FAR		32 bit	Flash-Prom Addr Reg/Cnt */
+#define CHIP_REV_YU_LITE_A1	3		/* Chip Rev. for YUKON-Lite A1,A2 */
+#define CHIP_REV_YU_LITE_A3	7		/* Chip Rev. for YUKON-Lite A3 */
+
+/*	B2_FAR			32 bit	Flash-Prom Addr Reg/Cnt */
 #define FAR_ADDR		0x1ffffL	/* Bit 16.. 0:	FPROM Address mask */
 
-/*	B2_LD_CRTL	 8 bit	EPROM loader control register */
+/*	B2_LD_CTRL		 8 bit	EPROM loader control register */
 /*	Bits are currently reserved */
 
-/*	B2_LD_TEST	 8 bit	EPROM loader test register */
+/*	B2_LD_TEST		 8 bit	EPROM loader test register */
 								/* Bit 7.. 4:	reserved */
 #define LD_T_ON			BIT_3S	/* Loader Test mode on */
 #define LD_T_OFF		BIT_2S	/* Loader Test mode off */
@@ -1151,16 +1165,16 @@
 /*
  *	Timer Section
  */
-/*	B2_TI_CRTL	 8 bit	Timer control */
+/*	B2_TI_CTRL		 8 bit	Timer control */
 /*	B2_IRQM_CTRL	 8 bit	IRQ Moderation Timer Control */
 								/* Bit 7.. 3:	reserved */
 #define TIM_START		BIT_2S	/* Start Timer */
 #define TIM_STOP		BIT_1S	/* Stop  Timer */
 #define TIM_CLR_IRQ		BIT_0S	/* Clear Timer IRQ (!IRQM) */
 
-/*	B2_TI_TEST	 8 Bit	Timer Test */
+/*	B2_TI_TEST		 8 Bit	Timer Test */
 /*	B2_IRQM_TEST	 8 bit	IRQ Moderation Timer Test */
-/*	B28_DPT_TST	 8 bit	Descriptor Poll Timer Test Reg */
+/*	B28_DPT_TST		 8 bit	Descriptor Poll Timer Test Reg */
 								/* Bit 7.. 3:	reserved */
 #define TIM_T_ON		BIT_2S	/* Test mode on */
 #define TIM_T_OFF		BIT_1S	/* Test mode off */
@@ -1197,7 +1211,7 @@
 #define TST_FRC_APERR_1M64	BIT_1S	/* AddrPERR on 1. phase */
 #define TST_FRC_APERR_2M64	BIT_0S	/* AddrPERR on 2. phase */
 
-/*	B2_GP_IO	32 bit	General Purpose I/O Register */
+/*	B2_GP_IO		32 bit	General Purpose I/O Register */
 							/* Bit 31..26:	reserved */
 #define GP_DIR_9	BIT_25	/* IO_9 direct, 0=In/1=Out */
 #define GP_DIR_8	BIT_24	/* IO_8 direct, 0=In/1=Out */
@@ -1221,28 +1235,28 @@
 #define GP_IO_1		BIT_1	/* IO_1 pin */
 #define GP_IO_0		BIT_0	/* IO_0 pin */
 
-/*	B2_I2C_CTRL	32 bit	I2C HW Control Register */
+/*	B2_I2C_CTRL		32 bit	I2C HW Control Register */
 #define I2C_FLAG		BIT_31		/* Start read/write if WR */
 #define I2C_ADDR		(0x7fffL<<16)	/* Bit 30..16:	Addr to be RD/WR */
 #define I2C_DEV_SEL		(0x7fL<<9)		/* Bit 15.. 9:	I2C Device Select */
 								/* Bit	8.. 5:	reserved	*/
 #define I2C_BURST_LEN	BIT_4		/* Burst Len, 1/4 bytes */
-#define I2C_DEV_SIZE	(7L<<1)		/* Bit	3.. 1:	I2C Device Size	*/
-#define I2C_025K_DEV	(0L<<1)		/*		0: 256 Bytes or smal. */
-#define I2C_05K_DEV		(1L<<1)		/* 		1: 512	Bytes	*/
-#define I2C_1K_DEV		(2L<<1)		/*		2: 1024 Bytes	*/
-#define I2C_2K_DEV		(3L<<1)		/*		3: 2048	Bytes	*/
-#define I2C_4K_DEV		(4L<<1)		/*		4: 4096 Bytes	*/
-#define I2C_8K_DEV		(5L<<1)		/*		5: 8192 Bytes	*/
-#define I2C_16K_DEV		(6L<<1)		/*		6: 16384 Bytes	*/
-#define I2C_32K_DEV		(7L<<1)		/*		7: 32768 Bytes	*/
+#define I2C_DEV_SIZE	(7<<1)		/* Bit	3.. 1:	I2C Device Size	*/
+#define I2C_025K_DEV	(0<<1)		/*		0: 256 Bytes or smal. */
+#define I2C_05K_DEV		(1<<1)		/* 		1: 512	Bytes	*/
+#define I2C_1K_DEV		(2<<1)		/*		2: 1024 Bytes	*/
+#define I2C_2K_DEV		(3<<1)		/*		3: 2048	Bytes	*/
+#define I2C_4K_DEV		(4<<1)		/*		4: 4096 Bytes	*/
+#define I2C_8K_DEV		(5<<1)		/*		5: 8192 Bytes	*/
+#define I2C_16K_DEV		(6<<1)		/*		6: 16384 Bytes	*/
+#define I2C_32K_DEV		(7<<1)		/*		7: 32768 Bytes	*/
 #define I2C_STOP		BIT_0		/* Interrupt I2C transfer */
 
-/*	B2_I2C_IRQ	32 bit	I2C HW IRQ Register */
+/*	B2_I2C_IRQ		32 bit	I2C HW IRQ Register */
 								/* Bit 31.. 1	reserved */
 #define I2C_CLR_IRQ		BIT_0	/* Clear I2C IRQ */
 
-/*	B2_I2C_SW	32 bit (8 bit access)	I2C HW SW Port Register */
+/*	B2_I2C_SW		32 bit (8 bit access)	I2C HW SW Port Register */
 								/* Bit  7.. 3:	reserved */
 #define I2C_DATA_DIR	BIT_2S		/* direction of I2C_DATA */
 #define I2C_DATA		BIT_1S		/* I2C Data Port	*/
@@ -1254,27 +1268,27 @@
 #define I2C_SENS_ADDR	LM80_ADDR	/* I2C Sensor Address, (Volt and Temp)*/
 
 
-/*	B2_BSC_CTRL	 8 bit	Blink Source Counter Control */
+/*	B2_BSC_CTRL		 8 bit	Blink Source Counter Control */
 							/* Bit  7.. 2:	reserved */
 #define BSC_START	BIT_1S		/* Start Blink Source Counter */
 #define BSC_STOP	BIT_0S		/* Stop  Blink Source Counter */
 
-/*	B2_BSC_STAT	 8 bit	Blink Source Counter Status */
+/*	B2_BSC_STAT		 8 bit	Blink Source Counter Status */
 							/* Bit  7.. 1:	reserved */
 #define BSC_SRC		BIT_0S		/* Blink Source, 0=Off / 1=On */
 
-/*	B2_BSC_TST	16 bit	Blink Source Counter Test Reg */
+/*	B2_BSC_TST		16 bit	Blink Source Counter Test Reg */
 #define BSC_T_ON	BIT_2S		/* Test mode on */
 #define BSC_T_OFF	BIT_1S		/* Test mode off */
 #define BSC_T_STEP	BIT_0S		/* Test step */
 
 
-/*	B3_RAM_ADDR	32 bit	RAM Address, to read or write */
+/*	B3_RAM_ADDR		32 bit	RAM Address, to read or write */
 					/* Bit 31..19:	reserved */
 #define RAM_ADR_RAN	0x0007ffffL	/* Bit 18.. 0:	RAM Address Range */
 
 /* RAM Interface Registers */
-/*	B3_RI_CTRL	16 bit	RAM Iface Control Register */
+/*	B3_RI_CTRL		16 bit	RAM Iface Control Register */
 								/* Bit 15..10:	reserved */
 #define RI_CLR_RD_PERR	BIT_9S	/* Clear IRQ RAM Read Parity Err */
 #define RI_CLR_WR_PERR	BIT_8S	/* Clear IRQ RAM Write Parity Err*/
@@ -1282,7 +1296,7 @@
 #define RI_RST_CLR		BIT_1S	/* Clear RAM Interface Reset */
 #define RI_RST_SET		BIT_0S	/* Set   RAM Interface Reset */
 
-/*	B3_RI_TEST	 8 bit	RAM Iface Test Register */
+/*	B3_RI_TEST		 8 bit	RAM Iface Test Register */
 								/* Bit 15.. 4:	reserved */
 #define RI_T_EV			BIT_3S	/* Timeout Event occured */
 #define RI_T_ON			BIT_2S	/* Timeout Timer Test On */
@@ -1309,7 +1323,7 @@
 #define MA_DIS_REC_RX1	BIT_0S	/* Disable Recovery Timer RX1 */
 
 /* Packet Arbiter Registers */
-/*	B3_PA_CTRL	16 bit	Packet Arbiter Ctrl Register */
+/*	B3_PA_CTRL		16 bit	Packet Arbiter Ctrl Register */
 								/* Bit 15..14:	reserved */
 #define PA_CLR_TO_TX2	BIT_13S	/* Clear IRQ Packet Timeout TX2 */
 #define PA_CLR_TO_TX1	BIT_12S	/* Clear IRQ Packet Timeout TX1 */
@@ -1332,7 +1346,7 @@
 /* Rx/Tx Path related Arbiter Test Registers */
 /*	B3_MA_TO_TEST	16 bit	MAC Arbiter Timeout Test Reg */
 /*	B3_MA_RC_TEST	16 bit	MAC Arbiter Recovery Test Reg */
-/*	B3_PA_TEST	16 bit	Packet Arbiter Test Register */
+/*	B3_PA_TEST		16 bit	Packet Arbiter Test Register */
 /*			Bit 15, 11, 7, and 3 are reserved in B3_PA_TEST */
 #define TX2_T_EV	BIT_15S		/* TX2 Timeout/Recv Event occured */
 #define TX2_T_ON	BIT_14S		/* TX2 Timeout/Recv Timer Test On */
@@ -1353,14 +1367,14 @@
 
 
 /* Transmit Arbiter Registers MAC 1 and 2, use MR_ADDR() to access */
-/*	TXA_ITI_INI	32 bit	Tx Arb Interval Timer Init Val */
-/*	TXA_ITI_VAL	32 bit	Tx Arb Interval Timer Value */
-/*	TXA_LIM_INI	32 bit	Tx Arb Limit Counter Init Val */
-/*	TXA_LIM_VAL	32 bit	Tx Arb Limit Counter Value */
+/*	TXA_ITI_INI		32 bit	Tx Arb Interval Timer Init Val */
+/*	TXA_ITI_VAL		32 bit	Tx Arb Interval Timer Value */
+/*	TXA_LIM_INI		32 bit	Tx Arb Limit Counter Init Val */
+/*	TXA_LIM_VAL		32 bit	Tx Arb Limit Counter Value */
 								/* Bit 31..24:	reserved */
 #define TXA_MAX_VAL	0x00ffffffUL/* Bit 23.. 0:	Max TXA Timer/Cnt Val */
 
-/*	TXA_CTRL	 8 bit	Tx Arbiter Control Register */
+/*	TXA_CTRL		 8 bit	Tx Arbiter Control Register */
 #define TXA_ENA_FSYNC	BIT_7S	/* Enable  force of sync Tx queue */
 #define TXA_DIS_FSYNC	BIT_6S	/* Disable force of sync Tx queue */
 #define TXA_ENA_ALLOC	BIT_5S	/* Enable  alloc of free bandwidth */
@@ -1370,7 +1384,7 @@
 #define TXA_ENA_ARB		BIT_1S	/* Enable  Tx Arbiter */
 #define TXA_DIS_ARB		BIT_0S	/* Disable Tx Arbiter */
 
-/*	TXA_TEST	 8 bit	Tx Arbiter Test Register */
+/*	TXA_TEST		 8 bit	Tx Arbiter Test Register */
 								/* Bit 7.. 6:	reserved */
 #define TXA_INT_T_ON	BIT_5S	/* Tx Arb Interval Timer Test On */
 #define TXA_INT_T_OFF	BIT_4S	/* Tx Arb Interval Timer Test Off */
@@ -1379,22 +1393,22 @@
 #define TXA_LIM_T_OFF	BIT_1S	/* Tx Arb Limit Timer Test Off */
 #define TXA_LIM_T_STEP	BIT_0S	/* Tx Arb Limit Timer Step */
 
-/*	TXA_STAT	 8 bit	Tx Arbiter Status Register */
+/*	TXA_STAT		 8 bit	Tx Arbiter Status Register */
 								/* Bit 7.. 1:	reserved */
 #define TXA_PRIO_XS		BIT_0S	/* sync queue has prio to send */
 
-/*	Q_BC	32 bit	Current Byte Counter */
+/*	Q_BC			32 bit	Current Byte Counter */
 								/* Bit 31..16:	reserved */
 #define BC_MAX			0xffff	/* Bit 15.. 0:	Byte counter */
 
 /* BMU Control Status Registers */
-/*	B0_R1_CSR	32 bit	BMU Ctrl/Stat Rx Queue 1 */
-/*	B0_R2_CSR	32 bit	BMU Ctrl/Stat Rx Queue 2 */
-/*	B0_XA1_CSR	32 bit	BMU Ctrl/Stat Sync Tx Queue 1 */
-/*	B0_XS1_CSR	32 bit	BMU Ctrl/Stat Async Tx Queue 1 */
-/*	B0_XA2_CSR	32 bit	BMU Ctrl/Stat Sync Tx Queue 2 */
-/*	B0_XS2_CSR	32 bit	BMU Ctrl/Stat Async Tx Queue 2 */
-/*	Q_CSR		32 bit	BMU Control/Status Register */
+/*	B0_R1_CSR		32 bit	BMU Ctrl/Stat Rx Queue 1 */
+/*	B0_R2_CSR		32 bit	BMU Ctrl/Stat Rx Queue 2 */
+/*	B0_XA1_CSR		32 bit	BMU Ctrl/Stat Sync Tx Queue 1 */
+/*	B0_XS1_CSR		32 bit	BMU Ctrl/Stat Async Tx Queue 1 */
+/*	B0_XA2_CSR		32 bit	BMU Ctrl/Stat Sync Tx Queue 2 */
+/*	B0_XS2_CSR		32 bit	BMU Ctrl/Stat Async Tx Queue 2 */
+/*	Q_CSR			32 bit	BMU Control/Status Register */
 								/* Bit 31..25:	reserved */
 #define CSR_SV_IDLE		BIT_24		/* BMU SM Idle */
 								/* Bit 23..22:	reserved */
@@ -1428,7 +1442,7 @@
 						CSR_SV_RUN | CSR_DREAD_RUN | CSR_DWRITE_RUN |\
 						CSR_TRANS_RUN)
 
-/*	Q_F	32 bit	Flag Register */
+/*	Q_F				32 bit	Flag Register */
 									/* Bit 31..28:	reserved */
 #define F_ALM_FULL		BIT_27		/* Rx FIFO: almost full */
 #define F_EMPTY			BIT_27		/* Tx FIFO: empty flag */
@@ -1439,17 +1453,17 @@
 									/* Bit 15..11: 	reserved */
 #define F_WATER_MARK	0x0007ffL	/* Bit 10.. 0:	Watermark */
 
-/*	Q_T1	32 bit	Test Register 1 */
+/*	Q_T1			32 bit	Test Register 1 */
 /*		Holds four State Machine control Bytes */
-#define SM_CRTL_SV_MSK	(0xffL<<24)	/* Bit 31..24:	Control Supervisor SM */
-#define SM_CRTL_RD_MSK	(0xffL<<16)	/* Bit 23..16:	Control Read Desc SM */
-#define SM_CRTL_WR_MSK	(0xffL<<8)	/* Bit 15.. 8:	Control Write Desc SM */
-#define SM_CRTL_TR_MSK	0xffL		/* Bit	7.. 0:	Control Transfer SM */
-
-/*	Q_T1_TR	 8 bit	Test Register 1 Transfer SM */
-/*	Q_T1_WR	 8 bit	Test Register 1 Write Descriptor SM */
-/*	Q_T1_RD	 8 bit	Test Register 1 Read Descriptor SM */
-/*	Q_T1_SV	 8 bit	Test Register 1 Supervisor SM */
+#define SM_CTRL_SV_MSK	(0xffL<<24)	/* Bit 31..24:	Control Supervisor SM */
+#define SM_CTRL_RD_MSK	(0xffL<<16)	/* Bit 23..16:	Control Read Desc SM */
+#define SM_CTRL_WR_MSK	(0xffL<<8)	/* Bit 15.. 8:	Control Write Desc SM */
+#define SM_CTRL_TR_MSK	0xffL		/* Bit	7.. 0:	Control Transfer SM */
+
+/*	Q_T1_TR			 8 bit	Test Register 1 Transfer SM */
+/*	Q_T1_WR			 8 bit	Test Register 1 Write Descriptor SM */
+/*	Q_T1_RD			 8 bit	Test Register 1 Read Descriptor SM */
+/*	Q_T1_SV			 8 bit	Test Register 1 Supervisor SM */
 
 /* The control status byte of each machine looks like ... */
 #define SM_STATE		0xf0	/* Bit 7.. 4:	State which shall be loaded */
@@ -1459,7 +1473,7 @@
 #define SM_STEP			BIT_0S	/* Step the State Machine */
 /* The encoding of the states is not supported by the Diagnostics Tool */
 
-/*	Q_T2	32 bit	Test Register 2	*/
+/*	Q_T2			32 bit	Test Register 2	*/
 								/* Bit 31.. 8:	reserved */
 #define T2_AC_T_ON		BIT_7	/* Address Counter Test Mode on */
 #define T2_AC_T_OFF		BIT_6	/* Address Counter Test Mode off */
@@ -1470,23 +1484,23 @@
 #define T2_STEP02		BIT_1	/* Inc AC/Dec BC by 2 */
 #define T2_STEP01		BIT_0	/* Inc AC/Dec BC by 1 */
 
-/*	Q_T3	32 bit	Test Register 3	*/
+/*	Q_T3			32 bit	Test Register 3	*/
 								/* Bit 31.. 7:	reserved */
 #define T3_MUX_MSK		(7<<4)	/* Bit  6.. 4:	Mux Position */
 								/* Bit  3:	reserved */
 #define T3_VRAM_MSK		7		/* Bit  2.. 0:	Virtual RAM Buffer Address */
 
 /* RAM Buffer Register Offsets, use RB_ADDR(Queue, Offs) to access */
-/*	RB_START	32 bit	RAM Buffer Start Address */
-/*	RB_END		32 bit	RAM Buffer End Address */
-/*	RB_WP		32 bit	RAM Buffer Write Pointer */
-/*	RB_RP		32 bit	RAM Buffer Read Pointer */
-/*	RB_RX_UTPP	32 bit	Rx Upper Threshold, Pause Pack */
-/*	RB_RX_LTPP	32 bit	Rx Lower Threshold, Pause Pack */
-/*	RB_RX_UTHP	32 bit	Rx Upper Threshold, High Prio */
-/*	RB_RX_LTHP	32 bit	Rx Lower Threshold, High Prio */
-/*	RB_PC		32 bit	RAM Buffer Packet Counter */
-/*	RB_LEV		32 bit	RAM Buffer Level Register */
+/*	RB_START		32 bit	RAM Buffer Start Address */
+/*	RB_END			32 bit	RAM Buffer End Address */
+/*	RB_WP			32 bit	RAM Buffer Write Pointer */
+/*	RB_RP			32 bit	RAM Buffer Read Pointer */
+/*	RB_RX_UTPP		32 bit	Rx Upper Threshold, Pause Pack */
+/*	RB_RX_LTPP		32 bit	Rx Lower Threshold, Pause Pack */
+/*	RB_RX_UTHP		32 bit	Rx Upper Threshold, High Prio */
+/*	RB_RX_LTHP		32 bit	Rx Lower Threshold, High Prio */
+/*	RB_PC			32 bit	RAM Buffer Packet Counter */
+/*	RB_LEV			32 bit	RAM Buffer Level Register */
 				/* Bit 31..19:	reserved */
 #define RB_MSK	0x0007ffff	/* Bit 18.. 0:	RAM Buffer Pointer Bits */
 
@@ -1519,17 +1533,17 @@
 
 /* Receive and Transmit MAC FIFO Registers (GENESIS only) */
 
-/*	RX_MFF_EA	32 bit	Receive MAC FIFO End Address */
-/*	RX_MFF_WP	32 bit 	Receive MAC FIFO Write Pointer */
-/*	RX_MFF_RP	32 bit	Receive MAC FIFO Read Pointer */
-/*	RX_MFF_PC	32 bit	Receive MAC FIFO Packet Counter */
-/*	RX_MFF_LEV	32 bit	Receive MAC FIFO Level */
-/*	TX_MFF_EA	32 bit	Transmit MAC FIFO End Address */
-/*	TX_MFF_WP	32 bit 	Transmit MAC FIFO Write Pointer */
-/*	TX_MFF_WSP	32 bit	Transmit MAC FIFO WR Shadow Pointer */
-/*	TX_MFF_RP	32 bit	Transmit MAC FIFO Read Pointer */
-/*	TX_MFF_PC	32 bit	Transmit MAC FIFO Packet Cnt */
-/*	TX_MFF_LEV	32 bit	Transmit MAC FIFO Level */
+/*	RX_MFF_EA		32 bit	Receive MAC FIFO End Address */
+/*	RX_MFF_WP		32 bit 	Receive MAC FIFO Write Pointer */
+/*	RX_MFF_RP		32 bit	Receive MAC FIFO Read Pointer */
+/*	RX_MFF_PC		32 bit	Receive MAC FIFO Packet Counter */
+/*	RX_MFF_LEV		32 bit	Receive MAC FIFO Level */
+/*	TX_MFF_EA		32 bit	Transmit MAC FIFO End Address */
+/*	TX_MFF_WP		32 bit 	Transmit MAC FIFO Write Pointer */
+/*	TX_MFF_WSP		32 bit	Transmit MAC FIFO WR Shadow Pointer */
+/*	TX_MFF_RP		32 bit	Transmit MAC FIFO Read Pointer */
+/*	TX_MFF_PC		32 bit	Transmit MAC FIFO Packet Cnt */
+/*	TX_MFF_LEV		32 bit	Transmit MAC FIFO Level */
 								/* Bit 31.. 6:	reserved */
 #define MFF_MSK			0x007fL	/* Bit	5.. 0:	MAC FIFO Address/Ptr Bits */
 
@@ -1682,7 +1696,7 @@
 
 #define RX_GMF_FL_THR_DEF	0x0a	/* Rx GMAC FIFO Flush Threshold default */
 
-/*	GMAC_TI_ST_CTRL		  8 bit	Time Stamp Timer Ctrl Reg (YUKON only) */
+/*	GMAC_TI_ST_CTRL	 8 bit	Time Stamp Timer Ctrl Reg (YUKON only) */
 								/* Bit 7.. 3:	reserved */
 #define GMT_ST_START	BIT_2S		/* Start Time Stamp Timer */
 #define GMT_ST_STOP		BIT_1S		/* Stop  Time Stamp Timer */
@@ -1766,13 +1780,13 @@
 #define GMAC_DEF_MSK	(GM_IS_TX_CO_OV | GM_IS_RX_CO_OV | \
 						GM_IS_TX_FF_UR)
 
-/*	GMAC_LINK_CTRL		16 bit	GMAC Link Control Reg (YUKON only) */
+/*	GMAC_LINK_CTRL	16 bit	GMAC Link Control Reg (YUKON only) */
 						/* Bits 15.. 2:	reserved */
 #define GMLC_RST_CLR	BIT_1S		/* Clear GMAC Link Reset */
 #define GMLC_RST_SET	BIT_0S		/* Set   GMAC Link Reset */
 
 
-/*	WOL_CTRL_STAT		16 bit	WOL Control/Status Reg */
+/*	WOL_CTRL_STAT	16 bit	WOL Control/Status Reg */
 #define WOL_CTL_LINK_CHG_OCC			BIT_15S
 #define WOL_CTL_MAGIC_PKT_OCC			BIT_14S
 #define WOL_CTL_PATTERN_OCC				BIT_13S
@@ -1801,7 +1815,7 @@
 	WOL_CTL_DIS_PATTERN_UNIT |		\
 	WOL_CTL_DIS_MAGIC_PKT_UNIT)
 
-/*	WOL_MATCH_CTL		 8 bit	WOL Match Control Reg */
+/*	WOL_MATCH_CTL	 8 bit	WOL Match Control Reg */
 #define WOL_CTL_PATT_ENA(x)				(BIT_0 << (x))
 
 #define SK_NUM_WOL_PATTERN		7
diff -Nru a/drivers/net/sk98lin/h/skgehwt.h b/drivers/net/sk98lin/h/skgehwt.h
--- a/drivers/net/sk98lin/h/skgehwt.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/sk98lin/h/skgehwt.h	Tue Feb  3 19:45:17 2004
@@ -1,9 +1,9 @@
 /******************************************************************************
  *
  * Name:	skhwt.h
- * Project:	Gigabit Ethernet Adapters, Schedule-Modul
- * Version:	$Revision: 1.6 $
- * Date:	$Date: 2003/05/13 17:57:48 $
+ * Project:	Gigabit Ethernet Adapters, Event Scheduler Module
+ * Version:	$Revision: 1.7 $
+ * Date:	$Date: 2003/09/16 12:55:08 $
  * Purpose:	Defines for the hardware timer functions
  *
  ******************************************************************************/
@@ -27,6 +27,9 @@
  * History:
  *
  *	$Log: skgehwt.h,v $
+ *	Revision 1.7  2003/09/16 12:55:08  rschmidt
+ *	Editorial changes
+ *	
  *	Revision 1.6  2003/05/13 17:57:48  mkarl
  *	Editorial changes.
  *	
@@ -34,7 +37,7 @@
  *	Changed license header to GPL.
  *	
  *	Revision 1.4  1998/08/19 09:50:58  gklug
- *	fix: remove struct keyword from c-code (see CCC) add typedefs
+ *	fix: remove struct keyword from C-code (see CCC) add typedefs
  *	
  *	Revision 1.3  1998/08/14 07:09:29  gklug
  *	fix: chg pAc -> pAC
@@ -44,10 +47,6 @@
  *	
  *	Revision 1.1  1998/08/07 09:32:58  gklug
  *	first version
- *	
- *	
- *	
- *	
  *
  ******************************************************************************/
 
@@ -64,14 +63,14 @@
  * - use in Adapters context name pAC->Hwt
  */
 typedef	struct s_Hwt {
-	SK_U32		TStart ;	/* HWT start */
-	SK_U32		TStop ;		/* HWT stop */
-	int		TActive ;	/* HWT: flag : active/inactive */
+	SK_U32		TStart;	/* HWT start */
+	SK_U32		TStop;	/* HWT stop */
+	int		TActive;	/* HWT: flag : active/inactive */
 } SK_HWT;
 
 extern void SkHwtInit(SK_AC *pAC, SK_IOC Ioc);
 extern void SkHwtStart(SK_AC *pAC, SK_IOC Ioc, SK_U32 Time);
 extern void SkHwtStop(SK_AC *pAC, SK_IOC Ioc);
-extern SK_U32 SkHwtRead(SK_AC *pAC,SK_IOC Ioc);
+extern SK_U32 SkHwtRead(SK_AC *pAC, SK_IOC Ioc);
 extern void SkHwtIsr(SK_AC *pAC, SK_IOC Ioc);
 #endif	/* _SKGEHWT_H_ */
diff -Nru a/drivers/net/sk98lin/h/skgei2c.h b/drivers/net/sk98lin/h/skgei2c.h
--- a/drivers/net/sk98lin/h/skgei2c.h	Tue Feb  3 19:45:35 2004
+++ b/drivers/net/sk98lin/h/skgei2c.h	Tue Feb  3 19:45:35 2004
@@ -1,16 +1,17 @@
 /******************************************************************************
  *
  * Name:	skgei2c.h
- * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.23 $
- * Date:	$Date: 2002/12/19 14:34:27 $
- * Purpose:	Special GEnesis defines for TWSI
+ * Project:	Gigabit Ethernet Adapters, TWSI-Module
+ * Version:	$Revision: 1.25 $
+ * Date:	$Date: 2003/10/20 09:06:05 $
+ * Purpose:	Special defines for TWSI
  *
  ******************************************************************************/
 
 /******************************************************************************
  *
- *	(C)Copyright 1998-2002 SysKonnect GmbH.
+ *	(C)Copyright 1998-2002 SysKonnect.
+ *	(C)Copyright 2002-2003 Marvell.
  *
  *	This program is free software; you can redistribute it and/or modify
  *	it under the terms of the GNU General Public License as published by
@@ -26,6 +27,12 @@
  * History:
  *
  *	$Log: skgei2c.h,v $
+ *	Revision 1.25  2003/10/20 09:06:05  rschmidt
+ *	Editorial changes.
+ *	
+ *	Revision 1.24  2003/09/23 09:31:15  malthoff
+ *	Parameter dev_size added to macro definition of SK_I2C_CTL.
+ *	
  *	Revision 1.23  2002/12/19 14:34:27  rschmidt
  *	Added cast in macros SK_I2C_SET_BIT() and SK_I2C_CLR_BIT()
  *	Editorial changes (TWSI)
@@ -107,8 +114,6 @@
  *	Revision 1.1  1998/07/17 11:27:56  gklug
  *	Created.
  *
- *
- *
  ******************************************************************************/
 
 /*
@@ -121,12 +126,13 @@
 /*
  * Macros to access the B2_I2C_CTRL
  */
-#define SK_I2C_CTL(IoC, flag, dev, reg, burst) \
+#define SK_I2C_CTL(IoC, flag, dev, dev_size, reg, burst) \
 	SK_OUT32(IoC, B2_I2C_CTRL,\
 		(flag ? 0x80000000UL : 0x0L) | \
-		(((SK_U32) reg << 16) & I2C_ADDR) | \
-		(((SK_U32) dev << 9) & I2C_DEV_SEL) | \
-		(( burst << 4) & I2C_BURST_LEN))
+		(((SK_U32)reg << 16) & I2C_ADDR) | \
+		(((SK_U32)dev << 9) & I2C_DEV_SEL) | \
+		(dev_size & I2C_DEV_SIZE) | \
+		((burst << 4) & I2C_BURST_LEN))
 
 #define SK_I2C_STOP(IoC) {				\
 	SK_U32	I2cCtrl;				\
@@ -166,42 +172,42 @@
  */
 #define	SK_LM80_VT_LSB		22	/* 22mV LSB resolution */
 #define	SK_LM80_TEMP_LSB	10	/* 1 degree LSB resolution */
-#define	SK_LM80_TEMPEXT_LSB	5	/* 0.5 degree LSB resolution for the
-					 * extension value
-					 */
-#define SK_LM80_FAN_FAKTOR	((22500L*60)/(1*2))
-/* formula: counter = (22500*60)/(rpm * divisor * pulses/2)
+#define	SK_LM80_TEMPEXT_LSB	 5	/* 0.5 degree LSB resolution for ext. val. */
+
+/*
+ * formula: counter = (22500*60)/(rpm * divisor * pulses/2)
  * assuming: 6500rpm, 4 pulses, divisor 1
  */
+#define SK_LM80_FAN_FAKTOR	((22500L*60)/(1*2))
 
 /*
  * Define sensor management data
- * Maximum is reached on copperfield with dual Broadcom.
+ * Maximum is reached on Genesis copper dual port and Yukon-64
  * Board specific maximum is in pAC->I2c.MaxSens
  */
 #define	SK_MAX_SENSORS	8	/* maximal no. of installed sensors */
 #define	SK_MIN_SENSORS	5	/* minimal no. of installed sensors */
 
 /*
- * To watch the statemachine (JS) use the timer in two ways instead of one as hitherto
+ * To watch the state machine (SM) use the timer in two ways
+ * instead of one as hitherto
  */
-#define	SK_TIMER_WATCH_STATEMACHINE	0	/* Watch the statemachine to finish in a specific time */
-#define	SK_TIMER_NEW_GAUGING    	1	/* Start a new gauging when timer expires */
-
+#define	SK_TIMER_WATCH_SM		0	/* Watch the SM to finish in a spec. time */
+#define	SK_TIMER_NEW_GAUGING	1	/* Start a new gauging when timer expires */
 
 /*
- * Defines for the individual Thresholds
+ * Defines for the individual thresholds
  */
 
 /* Temperature sensor */
-#define	SK_SEN_TEMP_HIGH_ERR    800	/* Temperature High Err  Threshold */
+#define	SK_SEN_TEMP_HIGH_ERR	800	/* Temperature High Err  Threshold */
 #define	SK_SEN_TEMP_HIGH_WARN	700	/* Temperature High Warn Threshold */
 #define	SK_SEN_TEMP_LOW_WARN	100	/* Temperature Low  Warn Threshold */
-#define	SK_SEN_TEMP_LOW_ERR       0	/* Temperature Low  Err  Threshold */
+#define	SK_SEN_TEMP_LOW_ERR		  0	/* Temperature Low  Err  Threshold */
 
 /* VCC which should be 5 V */
-#define	SK_SEN_PCI_5V_HIGH_ERR  	5588	/* Voltage PCI High Err  Threshold */
-#define	SK_SEN_PCI_5V_HIGH_WARN     5346	/* Voltage PCI High Warn Threshold */
+#define	SK_SEN_PCI_5V_HIGH_ERR		5588	/* Voltage PCI High Err  Threshold */
+#define	SK_SEN_PCI_5V_HIGH_WARN		5346	/* Voltage PCI High Warn Threshold */
 #define	SK_SEN_PCI_5V_LOW_WARN		4664	/* Voltage PCI Low  Warn Threshold */
 #define	SK_SEN_PCI_5V_LOW_ERR		4422	/* Voltage PCI Low  Err  Threshold */
 
@@ -229,17 +235,16 @@
 #define	SK_SEN_PCI_IO_3V3_HIGH_ERR	3850	/* + 15% V PCI-IO High Err Threshold */
 #define	SK_SEN_PCI_IO_3V3_HIGH_WARN	3674	/* + 10% V PCI-IO High Warn Threshold */
 					/*		3300	mVolt */
-#define	SK_SEN_PCI_IO_3V3_LOW_WARN  2926	/* - 10% V PCI-IO Low Warn Threshold */
-#define	SK_SEN_PCI_IO_3V3_LOW_ERR   2772	/* - 15% V PCI-IO Low Err  Threshold */
-
+#define	SK_SEN_PCI_IO_3V3_LOW_WARN	2926	/* - 10% V PCI-IO Low Warn Threshold */
+#define	SK_SEN_PCI_IO_3V3_LOW_ERR	2772	/* - 15% V PCI-IO Low Err  Threshold */
 
 /*
  * VDD voltage
  */
-#define	SK_SEN_VDD_HIGH_ERR	    3630	/* Voltage ASIC High Err  Threshold */
-#define	SK_SEN_VDD_HIGH_WARN    3476	/* Voltage ASIC High Warn Threshold */
-#define	SK_SEN_VDD_LOW_WARN     3146	/* Voltage ASIC Low  Warn Threshold */
-#define	SK_SEN_VDD_LOW_ERR      2970	/* Voltage ASIC Low  Err  Threshold */
+#define	SK_SEN_VDD_HIGH_ERR		3630	/* Voltage ASIC High Err  Threshold */
+#define	SK_SEN_VDD_HIGH_WARN	3476	/* Voltage ASIC High Warn Threshold */
+#define	SK_SEN_VDD_LOW_WARN		3146	/* Voltage ASIC Low  Warn Threshold */
+#define	SK_SEN_VDD_LOW_ERR		2970	/* Voltage ASIC Low  Err  Threshold */
 
 /*
  * PHY PLL 3V3 voltage
@@ -255,8 +260,8 @@
 #define	SK_SEN_VAUX_3V3_HIGH_ERR	3630	/* Voltage VAUX High Err Threshold */
 #define	SK_SEN_VAUX_3V3_HIGH_WARN	3476	/* Voltage VAUX High Warn Threshold */
 #define	SK_SEN_VAUX_3V3_LOW_WARN	3146	/* Voltage VAUX Low Warn Threshold */
-#define	SK_SEN_VAUX_3V3_LOW_ERR	    2970	/* Voltage VAUX Low Err Threshold */
-#define	SK_SEN_VAUX_0V_WARN_ERR	       0	/* if VAUX not present */
+#define	SK_SEN_VAUX_3V3_LOW_ERR		2970	/* Voltage VAUX Low Err Threshold */
+#define	SK_SEN_VAUX_0V_WARN_ERR		   0	/* if VAUX not present */
 #define	SK_SEN_VAUX_RANGE_LIMITER	1000	/* 1000 mV range delimiter */
 
 /*
@@ -270,7 +275,7 @@
 /*
  * ASIC Core 1V5 voltage (YUKON only)
  */
-#define	SK_SEN_CORE_1V5_HIGH_ERR    1650	/* Voltage ASIC Core High Err Threshold */
+#define	SK_SEN_CORE_1V5_HIGH_ERR	1650	/* Voltage ASIC Core High Err Threshold */
 #define	SK_SEN_CORE_1V5_HIGH_WARN	1575	/* Voltage ASIC Core High Warn Threshold */
 #define	SK_SEN_CORE_1V5_LOW_WARN	1425	/* Voltage ASIC Core Low Warn Threshold */
 #define	SK_SEN_CORE_1V5_LOW_ERR 	1350	/* Voltage ASIC Core Low Err Threshold */
@@ -285,8 +290,8 @@
  */
 #define	SK_SEN_FAN_HIGH_ERR		20000	/* FAN Speed High Err Threshold */
 #define	SK_SEN_FAN_HIGH_WARN	20000	/* FAN Speed High Warn Threshold */
-#define	SK_SEN_FAN_LOW_WARN 	5200	/* FAN Speed Low Warn Threshold */
-#define	SK_SEN_FAN_LOW_ERR		4550	/* FAN Speed Low Err Threshold */
+#define	SK_SEN_FAN_LOW_WARN		 5200	/* FAN Speed Low Warn Threshold */
+#define	SK_SEN_FAN_LOW_ERR		 4550	/* FAN Speed Low Err Threshold */
 
 /*
  * Some Voltages need dynamic thresholds
diff -Nru a/drivers/net/sk98lin/h/skgeinit.h b/drivers/net/sk98lin/h/skgeinit.h
--- a/drivers/net/sk98lin/h/skgeinit.h	Tue Feb  3 19:45:35 2004
+++ b/drivers/net/sk98lin/h/skgeinit.h	Tue Feb  3 19:45:35 2004
@@ -2,8 +2,8 @@
  *
  * Name:	skgeinit.h
  * Project:	Gigabit Ethernet Adapters, Common Modules
- * Version:	$Revision: 1.81 $
- * Date:	$Date: 2003/07/04 12:30:38 $
+ * Version:	$Revision: 1.83 $
+ * Date:	$Date: 2003/09/16 14:07:37 $
  * Purpose:	Structures and prototypes for the GE Init Module
  *
  ******************************************************************************/
@@ -27,6 +27,23 @@
  * History:
  *
  *	$Log: skgeinit.h,v $
+ *	Revision 1.83  2003/09/16 14:07:37  rschmidt
+ *	Moved defines for PHY power down modes from skgehw.h
+ *	Added prototypes for SkMacClearRst()
+ *	Editorial changes
+ *	
+ *	Revision 1.82  2003/09/16 07:18:36  mschmid
+ *	Added members to port structure for MAC control
+ *	- PMacColThres
+ *	- PMacJamLen
+ *	- PMacJamIpgVal
+ *	- PMacJamIpgData
+ *	- PMacIpgData
+ *	- PMacLimit4
+ *	Added PHY power state to port structure
+ *	- PPhyPowerState
+ *	Added function prototypes to enter and leave low power modes
+ *	
  *	Revision 1.81  2003/07/04 12:30:38  rschmidt
  *	Added SK_FAR to pointers in MAC statistic functions (for PXE)
  *	Editorial changes
@@ -594,6 +611,13 @@
 #define SK_PRT_INIT		2	/* the port is initialized */
 #define SK_PRT_RUN		3	/* the port has an active link */
 
+/* PHY power down modes */
+#define PHY_PM_OPERATIONAL_MODE		0	/* PHY operational mode */
+#define PHY_PM_DEEP_SLEEP			1	/* coma mode --> minimal power */
+#define PHY_PM_IEEE_POWER_DOWN		2	/* IEEE 22.2.4.1.5 compl. power down */
+#define PHY_PM_ENERGY_DETECT		3	/* energy detect */
+#define PHY_PM_ENERGY_DETECT_PLUS	4	/* energy detect plus */
+
 /* Default receive frame limit for Workaround of XMAC Errata */
 #define SK_DEF_RX_WA_LIM	SK_CONSTU64(100)
 
@@ -685,6 +709,13 @@
 	SK_U8	PCableLen;		/* Cable Length */
 	SK_U8	PMdiPairLen[4];	/* MDI[0..3] Pair Length */
 	SK_U8	PMdiPairSts[4];	/* MDI[0..3] Pair Diagnostic Status */
+	SK_U8	PPhyPowerState;	/* PHY current power state */
+	int		PMacColThres;	/* MAC Collision Threshold */
+	int		PMacJamLen;		/* MAC Jam length */
+	int		PMacJamIpgVal;	/* MAC Jam IPG */
+	int		PMacJamIpgData;	/* MAC IPG Jam to Data */
+	int		PMacIpgData;	/* MAC Data IPG */
+	SK_BOOL PMacLimit4;		/* reset collision counter and backoff algorithm */
 } SK_GEPORT;
 
 /*
@@ -865,6 +896,11 @@
 	SK_IOC	IoC,
 	int		Port);
 
+extern void	SkMacClearRst(
+	SK_AC	*pAC,
+	SK_IOC	IoC,
+	int		Port);
+
 extern void	SkXmInitMac(
 	SK_AC	*pAC,
 	SK_IOC	IoC,
@@ -1040,6 +1076,17 @@
 	int		Port,
 	SK_BOOL	StartTest);
 
+extern int SkGmEnterLowPowerMode(
+	SK_AC	*pAC,
+	SK_IOC	IoC,
+	int		Port,
+	SK_U8	Mode);
+
+extern int SkGmLeaveLowPowerMode(
+	SK_AC	*pAC,
+	SK_IOC	IoC,
+	int		Port);
+
 #ifdef SK_DIAG
 extern void	SkGePhyRead(
 	SK_AC	*pAC,
@@ -1101,6 +1148,7 @@
 extern void SkMacRxTxDisable();
 extern void	SkMacSoftRst();
 extern void	SkMacHardRst();
+extern void	SkMacClearRst();
 extern void SkMacInitPhy();
 extern int  SkMacRxTxEnable();
 extern void SkMacPromiscMode();
@@ -1131,6 +1179,8 @@
 extern int	SkXmOverflowStatus();
 extern int	SkGmOverflowStatus();
 extern int	SkGmCableDiagStatus();
+extern int	SkGmEnterLowPowerMode();
+extern int	SkGmLeaveLowPowerMode();
 
 #ifdef SK_DIAG
 extern void	SkGePhyRead();
diff -Nru a/drivers/net/sk98lin/h/skgepnmi.h b/drivers/net/sk98lin/h/skgepnmi.h
--- a/drivers/net/sk98lin/h/skgepnmi.h	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/sk98lin/h/skgepnmi.h	Tue Feb  3 19:45:16 2004
@@ -2,8 +2,8 @@
  *
  * Name:	skgepnmi.h
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.61 $
- * Date:	$Date: 2003/05/23 12:53:52 $
+ * Version:	$Revision: 1.62 $
+ * Date:	$Date: 2003/08/15 12:31:52 $
  * Purpose:	Defines for Private Network Management Interface
  *
  ****************************************************************************/
@@ -27,6 +27,18 @@
  * History:
  *
  *	$Log: skgepnmi.h,v $
+ *	Revision 1.62  2003/08/15 12:31:52  tschilli
+ *	Added new OIDs:
+ *	OID_SKGE_DRIVER_RELDATE
+ *	OID_SKGE_DRIVER_FILENAME
+ *	OID_SKGE_CHIPID
+ *	OID_SKGE_RAMSIZE
+ *	OID_SKGE_VAUXAVAIL
+ *	OID_SKGE_PHY_TYPE
+ *	OID_SKGE_PHY_LP_MODE
+ *	
+ *	Added new define SK_DIAG_ATTACHED for OID_SKGE_DIAG_MODE handling.
+ *	
  *	Revision 1.61  2003/05/23 12:53:52  tschilli
  *	Generic PNMI IOCTL subcommands added.
  *	Function prototype SkPnmiGenIoctl() added.
@@ -568,15 +580,23 @@
 #define OID_SKGE_ALL_DATA				0xFF020190
 
 /* Defines for VCT. */
-#define OID_SKGE_VCT_GET			0xFF020200
-#define OID_SKGE_VCT_SET			0xFF020201
-#define OID_SKGE_VCT_STATUS			0xFF020202
+#define OID_SKGE_VCT_GET				0xFF020200
+#define OID_SKGE_VCT_SET				0xFF020201
+#define OID_SKGE_VCT_STATUS				0xFF020202
 
 #ifdef SK_DIAG_SUPPORT
 /* Defines for driver DIAG mode. */
-#define OID_SKGE_DIAG_MODE			0xFF020204
+#define OID_SKGE_DIAG_MODE				0xFF020204
 #endif /* SK_DIAG_SUPPORT */
 
+/* New OIDs */
+#define OID_SKGE_DRIVER_RELDATE			0xFF020210
+#define OID_SKGE_DRIVER_FILENAME		0xFF020211
+#define OID_SKGE_CHIPID					0xFF020212
+#define OID_SKGE_RAMSIZE				0xFF020213
+#define OID_SKGE_VAUXAVAIL				0xFF020214
+#define OID_SKGE_PHY_TYPE				0xFF020215
+#define OID_SKGE_PHY_LP_MODE			0xFF020216
 
 /* VCT struct to store a backup copy of VCT data after a port reset. */
 typedef struct s_PnmiVct {
@@ -613,6 +633,12 @@
 #define OID_SKGE_TRAP_RLMT_PORT_UP		523
 #define OID_SKGE_TRAP_RLMT_SEGMENTATION	524
 
+#ifdef SK_DIAG_SUPPORT
+/* Defines for driver DIAG mode. */
+#define SK_DIAG_ATTACHED	2
+#define SK_DIAG_RUNNING		1
+#define SK_DIAG_IDLE		0
+#endif /* SK_DIAG_SUPPORT */
 
 /*
  * Generic PNMI IOCTL subcommand definitions.
@@ -730,6 +756,14 @@
 #define SK_PNMI_ERR051MSG	"SkPnmiEvent: Port switch suspicious"
 #define SK_PNMI_ERR052		(SK_ERRBASE_PNMI + 52)
 #define SK_PNMI_ERR052MSG	""
+#define SK_PNMI_ERR053		(SK_ERRBASE_PNMI + 53)
+#define SK_PNMI_ERR053MSG	"General: Driver release date not initialized"
+#define SK_PNMI_ERR054		(SK_ERRBASE_PNMI + 54)
+#define SK_PNMI_ERR054MSG	"General: Driver release date string too long"
+#define SK_PNMI_ERR055		(SK_ERRBASE_PNMI + 55)
+#define SK_PNMI_ERR055MSG	"General: Driver file name not initialized"
+#define SK_PNMI_ERR056		(SK_ERRBASE_PNMI + 56)
+#define SK_PNMI_ERR056MSG	"General: Driver file name string too long"
 
 /*
  * Management counter macros called by the driver
@@ -740,6 +774,11 @@
 #define SK_PNMI_SET_DRIVER_VER(pAC,v)	((pAC)->Pnmi.pDriverVersion = \
 	(char *)(v))
 
+#define SK_PNMI_SET_DRIVER_RELDATE(pAC,v)	((pAC)->Pnmi.pDriverReleaseDate = \
+	(char *)(v))
+
+#define SK_PNMI_SET_DRIVER_FILENAME(pAC,v)	((pAC)->Pnmi.pDriverFileName = \
+	(char *)(v))
 
 #define SK_PNMI_CNT_TX_QUEUE_LEN(pAC,v,p) \
 	{ \
@@ -916,6 +955,8 @@
 	char			ConfMacFactoryAddr[6];
 	SK_U8			ConfPMD;
 	SK_U8			ConfConnector;
+	SK_U32			ConfPhyType;
+	SK_U32			ConfPhyMode;
 	SK_U8			ConfLinkCapability;
 	SK_U8			ConfLinkMode;
 	SK_U8			ConfLinkModeStatus;
@@ -964,9 +1005,14 @@
 	SK_U32			DeviceType;
 	char			DriverDescr[SK_PNMI_STRINGLEN1];
 	char			DriverVersion[SK_PNMI_STRINGLEN2];
+	char			DriverReleaseDate[SK_PNMI_STRINGLEN1];
+	char			DriverFileName[SK_PNMI_STRINGLEN1];
 	char			HwDescr[SK_PNMI_STRINGLEN1];
 	char			HwVersion[SK_PNMI_STRINGLEN2];
 	SK_U16			Chipset;
+	SK_U32			ChipId;
+	SK_U8			VauxAvail;
+	SK_U32			RamSize;
 	SK_U32			MtuSize;
 	SK_U32			Action;
 	SK_U32			TestResult;
@@ -1090,6 +1136,8 @@
 
 	char			*pDriverDescription;
 	char			*pDriverVersion;
+	char			*pDriverReleaseDate;
+	char			*pDriverFileName;
 
 	int				MacUpdatedFlag;
 	int				RlmtUpdatedFlag;
@@ -1119,6 +1167,9 @@
 	SK_U8		VctStatus[SK_MAX_MACS];
 	SK_PNMI_VCT	VctBackup[SK_MAX_MACS];
 	SK_PNMI_VCT_TIMER VctTimeout[SK_MAX_MACS];
+#ifdef SK_DIAG_SUPPORT
+	SK_U32			DiagAttached;
+#endif /* SK_DIAG_SUPPORT */
 } SK_PNMI;
 
 
diff -Nru a/drivers/net/sk98lin/h/ski2c.h b/drivers/net/sk98lin/h/ski2c.h
--- a/drivers/net/sk98lin/h/ski2c.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/sk98lin/h/ski2c.h	Tue Feb  3 19:45:17 2004
@@ -1,16 +1,17 @@
 /******************************************************************************
  *
  * Name:	ski2c.h
- * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.34 $
- * Date:	$Date: 2003/01/28 09:11:21 $
+ * Project:	Gigabit Ethernet Adapters, TWSI-Module
+ * Version:	$Revision: 1.35 $
+ * Date:	$Date: 2003/10/20 09:06:30 $
  * Purpose:	Defines to access Voltage and Temperature Sensor
  *
  ******************************************************************************/
 
 /******************************************************************************
  *
- *	(C)Copyright 1998-2003 SysKonnect GmbH.
+ *	(C)Copyright 1998-2002 SysKonnect.
+ *	(C)Copyright 2002-2003 Marvell.
  *
  *	This program is free software; you can redistribute it and/or modify
  *	it under the terms of the GNU General Public License as published by
@@ -26,6 +27,10 @@
  * History:
  *
  *	$Log: ski2c.h,v $
+ *	Revision 1.35  2003/10/20 09:06:30  rschmidt
+ *	Added prototypes for SkI2cRead() and SkI2cWrite().
+ *	Editorial changes.
+ *	
  *	Revision 1.34  2003/01/28 09:11:21  rschmidt
  *	Editorial changes
  *	
@@ -137,7 +142,6 @@
  *	Revision 1.1  1998/06/19 14:30:10  malthoff
  *	Created. Sources taken from ML Project.
  *
- *
  ******************************************************************************/
 
 /*
@@ -252,7 +256,7 @@
 	SK_I32	SenThreWarnLow;		/* Lower warning Threshold of the sensor */
 	int		SenErrFlag;			/* Sensor indicated an error */
 	SK_BOOL	SenInit;			/* Is sensor initialized ? */
-	SK_U64	SenErrCts;			/* Error  trap counter */
+	SK_U64	SenErrCts;			/* Error trap counter */
 	SK_U64	SenWarnCts;			/* Warning trap counter */
 	SK_U64	SenBegErrTS;		/* Begin error timestamp */
 	SK_U64	SenBegWarnTS;		/* Begin warning timestamp */
@@ -279,13 +283,17 @@
 #endif /* !SK_DIAG */
 } SK_I2C;
 
+extern int SkI2cInit(SK_AC *pAC, SK_IOC IoC, int Level);
+extern int SkI2cWrite(SK_AC *pAC, SK_IOC IoC, SK_U32 Data, int Dev, int Size,
+					   int Reg, int Burst);
 extern int SkI2cReadSensor(SK_AC *pAC, SK_IOC IoC, SK_SENSOR *pSen);
-#ifndef SK_DIAG
+#ifdef SK_DIAG
+extern	SK_U32 SkI2cRead(SK_AC *pAC, SK_IOC IoC, int Dev, int Size, int Reg,
+						 int Burst);
+#else /* !SK_DIAG */
 extern int SkI2cEvent(SK_AC *pAC, SK_IOC IoC, SK_U32 Event, SK_EVPARA Para);
-extern int SkI2cInit(SK_AC *pAC, SK_IOC IoC, int Level);
 extern void SkI2cWaitIrq(SK_AC *pAC, SK_IOC IoC);
 extern void SkI2cIsr(SK_AC *pAC, SK_IOC IoC);
-
-#endif
+#endif /* !SK_DIAG */
 #endif /* n_SKI2C_H */
 
diff -Nru a/drivers/net/sk98lin/h/skqueue.h b/drivers/net/sk98lin/h/skqueue.h
--- a/drivers/net/sk98lin/h/skqueue.h	Tue Feb  3 19:45:43 2004
+++ b/drivers/net/sk98lin/h/skqueue.h	Tue Feb  3 19:45:43 2004
@@ -1,9 +1,9 @@
 /******************************************************************************
  *
  * Name:	skqueue.h
- * Project:	Gigabit Ethernet Adapters, Schedule-Modul
- * Version:	$Revision: 1.15 $
- * Date:	$Date: 2003/05/13 17:54:57 $
+ * Project:	Gigabit Ethernet Adapters, Event Scheduler Module
+ * Version:	$Revision: 1.16 $
+ * Date:	$Date: 2003/09/16 12:50:32 $
  * Purpose:	Defines for the Event queue
  *
  ******************************************************************************/
@@ -27,6 +27,9 @@
  * History:
  *
  *	$Log: skqueue.h,v $
+ *	Revision 1.16  2003/09/16 12:50:32  rschmidt
+ *	Editorial changes
+ *	
  *	Revision 1.15  2003/05/13 17:54:57  mkarl
  *	Editorial changes.
  *	
@@ -47,7 +50,7 @@
  *	add: typedef SK_QUEUE
  *	
  *	Revision 1.9  1998/08/19 09:50:59  gklug
- *	fix: remove struct keyword from c-code (see CCC) add typedefs
+ *	fix: remove struct keyword from C-code (see CCC) add typedefs
  *	
  *	Revision 1.8  1998/08/18 07:00:01  gklug
  *	fix: SK_PTR not defined use void * instead.
@@ -74,8 +77,6 @@
  *	Revision 1.1  1998/07/30 14:52:12  gklug
  *	Initial version.
  *	Defines Event Classes, Event structs and queue management variables.
- *	
- *	
  *
  ******************************************************************************/
 
@@ -92,7 +93,7 @@
  */
 #define	SKGE_DRV	1	/* Driver Event Class */
 #define	SKGE_RLMT	2	/* RLMT Event Class */
-#define	SKGE_I2C	3	/* i2C Event Class */
+#define	SKGE_I2C	3	/* I2C Event Class */
 #define	SKGE_PNMI	4	/* PNMI Event Class */
 #define	SKGE_CSUM	5	/* Checksum Event Class */
 #define	SKGE_HWAC	6	/* Hardware Access Event Class */
@@ -121,25 +122,25 @@
  * Event Queue
  *	skqueue.c
  * events are class/value pairs
- *	class	is addressee, e.g. RMT, PCM etc.
+ *	class	is addressee, e.g. RLMT, PNMI etc.
  *	value	is command, e.g. line state change, ring op change etc.
  */
 typedef	struct s_EventElem {
-	SK_U32		Class ;			/* Event class */
-	SK_U32		Event ;			/* Event value */
-	SK_EVPARA	Para ;			/* Event parameter */
+	SK_U32		Class;			/* Event class */
+	SK_U32		Event;			/* Event value */
+	SK_EVPARA	Para;			/* Event parameter */
 } SK_EVENTELEM;
 
 typedef	struct s_Queue {
 	SK_EVENTELEM	EvQueue[SK_MAX_EVENT];
-	SK_EVENTELEM	*EvPut ;
-	SK_EVENTELEM	*EvGet ;
+	SK_EVENTELEM	*EvPut;
+	SK_EVENTELEM	*EvGet;
 } SK_QUEUE;
 
 extern	void SkEventInit(SK_AC *pAC, SK_IOC Ioc, int Level);
 extern	void SkEventQueue(SK_AC *pAC, SK_U32 Class, SK_U32 Event,
 	SK_EVPARA Para);
-extern	int SkEventDispatcher(SK_AC *pAC,SK_IOC Ioc);
+extern	int SkEventDispatcher(SK_AC *pAC, SK_IOC Ioc);
 
 
 /* Define Error Numbers and messages */
diff -Nru a/drivers/net/sk98lin/h/sktimer.h b/drivers/net/sk98lin/h/sktimer.h
--- a/drivers/net/sk98lin/h/sktimer.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/sk98lin/h/sktimer.h	Tue Feb  3 19:45:17 2004
@@ -1,9 +1,9 @@
 /******************************************************************************
  *
  * Name:	sktimer.h
- * Project:	Gigabit Ethernet Adapters, Schedule-Modul
- * Version:	$Revision: 1.10 $
- * Date:	$Date: 2003/05/13 17:56:44 $
+ * Project:	Gigabit Ethernet Adapters, Event Scheduler Module
+ * Version:	$Revision: 1.11 $
+ * Date:	$Date: 2003/09/16 12:58:18 $
  * Purpose:	Defines for the timer functions
  *
  ******************************************************************************/
@@ -27,6 +27,9 @@
  * History:
  *
  *	$Log: sktimer.h,v $
+ *	Revision 1.11  2003/09/16 12:58:18  rschmidt
+ *	Editorial changes
+ *	
  *	Revision 1.10  2003/05/13 17:56:44  mkarl
  *	Editorial changes.
  *	
@@ -40,7 +43,7 @@
  *	fix: SK_TIMCTRL needs to be defined
  *	
  *	Revision 1.6  1998/08/19 09:51:00  gklug
- *	fix: remove struct keyword from c-code (see CCC) add typedefs
+ *	fix: remove struct keyword from C-code (see CCC) add typedefs
  *	
  *	Revision 1.5  1998/08/17 13:43:21  gklug
  *	chg: Parameter will be union of 64bit para, 2 times SK_U32 or SK_PTR
@@ -78,25 +81,25 @@
 typedef	struct s_Timer SK_TIMER;
 
 struct s_Timer {
-	SK_TIMER	*TmNext ;	/* linked list */
-	SK_U32		TmClass ;	/* Timer Event class */
-	SK_U32		TmEvent ;	/* Timer Event value */
-	SK_EVPARA	TmPara ;	/* Timer Event parameter */
-	SK_U32		TmDelta ;	/* delta time */
-	int		TmActive ;	/* flag : active/inactive */
-} ;
+	SK_TIMER	*TmNext;	/* linked list */
+	SK_U32		TmClass;	/* Timer Event class */
+	SK_U32		TmEvent;	/* Timer Event value */
+	SK_EVPARA	TmPara;		/* Timer Event parameter */
+	SK_U32		TmDelta;	/* delta time */
+	int			TmActive;	/* flag: active/inactive */
+};
 
 /*
  * Timer control struct.
  * - use in Adapters context name pAC->Tim
  */
 typedef	struct s_TimCtrl {
-	SK_TIMER	*StQueue ;	/* Head of Timer queue */
-} SK_TIMCTRL ;
+	SK_TIMER	*StQueue;	/* Head of Timer queue */
+} SK_TIMCTRL;
 
-extern void SkTimerInit(SK_AC *pAC,SK_IOC Ioc, int Level);
-extern void SkTimerStop(SK_AC *pAC,SK_IOC Ioc,SK_TIMER *pTimer);
-extern void SkTimerStart(SK_AC *pAC,SK_IOC Ioc,SK_TIMER *pTimer,
-	SK_U32 Time,SK_U32 Class,SK_U32 Event,SK_EVPARA Para);
-extern void SkTimerDone(SK_AC *pAC,SK_IOC Ioc);
+extern void SkTimerInit(SK_AC *pAC, SK_IOC Ioc, int Level);
+extern void SkTimerStop(SK_AC *pAC, SK_IOC Ioc, SK_TIMER *pTimer);
+extern void SkTimerStart(SK_AC *pAC, SK_IOC Ioc, SK_TIMER *pTimer,
+	SK_U32 Time, SK_U32 Class, SK_U32 Event, SK_EVPARA Para);
+extern void SkTimerDone(SK_AC *pAC, SK_IOC Ioc);
 #endif	/* _SKTIMER_H_ */
diff -Nru a/drivers/net/sk98lin/h/sktypes.h b/drivers/net/sk98lin/h/sktypes.h
--- a/drivers/net/sk98lin/h/sktypes.h	Tue Feb  3 19:45:43 2004
+++ b/drivers/net/sk98lin/h/sktypes.h	Tue Feb  3 19:45:43 2004
@@ -2,15 +2,16 @@
  *
  * Name:	sktypes.h
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.1 $
- * Date:	$Date: 2003/07/21 07:26:01 $
+ * Version:	$Revision: 1.2 $
+ * Date:	$Date: 2003/10/07 08:16:51 $
  * Purpose:	Define data types for Linux
  *
  ******************************************************************************/
 
 /******************************************************************************
  *
- *	(C)Copyright 1998-2003 SysKonnect GmbH.
+ *	(C)Copyright 1998-2002 SysKonnect GmbH.
+ *	(C)Copyright 2002-2003 Marvell.
  *
  *	This program is free software; you can redistribute it and/or modify
  *	it under the terms of the GNU General Public License as published by
@@ -26,6 +27,9 @@
  * History:
  *
  *	$Log: sktypes.h,v $
+ *	Revision 1.2  2003/10/07 08:16:51  mlindner
+ *	Fix: Copyright changes
+ *	
  *	Revision 1.1  2003/07/21 07:26:01  rroesler
  *	Fix: Re-Enter after CVS crash
  *	
diff -Nru a/drivers/net/sk98lin/h/skversion.h b/drivers/net/sk98lin/h/skversion.h
--- a/drivers/net/sk98lin/h/skversion.h	Tue Feb  3 19:45:29 2004
+++ b/drivers/net/sk98lin/h/skversion.h	Tue Feb  3 19:45:29 2004
@@ -2,15 +2,16 @@
  *
  * Name:	version.h
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.3 $
- * Date:	$Date: 2003/08/25 13:34:48 $
+ * Version:	$Revision: 1.5 $
+ * Date:	$Date: 2003/10/07 08:16:51 $
  * Purpose:	SK specific Error log support
  *
  ******************************************************************************/
 
 /******************************************************************************
  *
- *	(C)Copyright 1998-2003 SysKonnect GmbH.
+ *	(C)Copyright 1998-2002 SysKonnect GmbH.
+ *	(C)Copyright 2002-2003 Marvell.
  *
  *	This program is free software; you can redistribute it and/or modify
  *	it under the terms of the GNU General Public License as published by
@@ -25,6 +26,12 @@
  *
  * History:
  *	$Log: skversion.h,v $
+ *	Revision 1.5  2003/10/07 08:16:51  mlindner
+ *	Fix: Copyright changes
+ *	
+ *	Revision 1.4  2003/09/22 08:40:10  mlindner
+ *	Add: Added DRIVER_FILE_NAME and DRIVER_REL_DATE
+ *	
  *	Revision 1.3  2003/08/25 13:34:48  mlindner
  *	Fix: Lint changes
  *	
@@ -54,12 +61,14 @@
 #ifdef	lint
 static const char SysKonnectFileId[] = "@(#) (C) SysKonnect GmbH.";
 static const char SysKonnectBuildNumber[] =
-	"@(#)SK-BUILD: 6.18 PL: 01"; 
+	"@(#)SK-BUILD: 6.22 PL: 01"; 
 #endif	/* !defined(lint) */
 
-#define BOOT_STRING	"sk98lin: Network Device Driver v6.18\n" \
-			"(C)Copyright 1999-2003 Marvell(R)."
+#define BOOT_STRING	"sk98lin: Network Device Driver v6.22\n" \
+			"(C)Copyright 1999-2004 Marvell(R)."
 
-#define VER_STRING	"6.18"
+#define VER_STRING	"6.22"
+#define DRIVER_FILE_NAME	"sk98lin"
+#define DRIVER_REL_DATE		"Jan-30-2004"
 
 
diff -Nru a/drivers/net/sk98lin/h/xmac_ii.h b/drivers/net/sk98lin/h/xmac_ii.h
--- a/drivers/net/sk98lin/h/xmac_ii.h	Tue Feb  3 19:45:41 2004
+++ b/drivers/net/sk98lin/h/xmac_ii.h	Tue Feb  3 19:45:41 2004
@@ -2,8 +2,8 @@
  *
  * Name:	xmac_ii.h
  * Project:	Gigabit Ethernet Adapters, Common Modules
- * Version:	$Revision: 1.48 $
- * Date:	$Date: 2003/05/13 17:17:55 $
+ * Version:	$Revision: 1.52 $
+ * Date:	$Date: 2003/10/02 16:35:50 $
  * Purpose:	Defines and Macros for Gigabit Ethernet Controller
  *
  ******************************************************************************/
@@ -27,6 +27,22 @@
  * History:
  *
  *	$Log: xmac_ii.h,v $
+ *	Revision 1.52  2003/10/02 16:35:50  rschmidt
+ *	Added defines for default values of GMAC parameters
+ *	Changed defines for setting GMAC parameters
+ *	Editorial changes
+ *	
+ *	Revision 1.51  2003/09/23 09:04:27  malthoff
+ *	Add bit definitions for PHY_MARV_EXT_P_STAT.
+ *	
+ *	Revision 1.50  2003/09/16 14:15:07  rschmidt
+ *	Added defines for Extended PHY Specific Control
+ *	Editorial changes
+ *	
+ *	Revision 1.49  2003/09/16 07:22:46  mschmid
+ *	Added defines for Marvell PHY energy detect modes
+ *	Added macros for MAC parameter setting in port structure
+ *	
  *	Revision 1.48  2003/05/13 17:17:55  mkarl
  *	Editorial changes.
  *	
@@ -676,7 +692,7 @@
 #define PHY_XMAC_AUNE_LP	0x05	/* 16 bit r/o	Link Partner Abi Reg */
 #define PHY_XMAC_AUNE_EXP	0x06	/* 16 bit r/o	Auto-Neg. Expansion Reg */
 #define PHY_XMAC_NEPG		0x07	/* 16 bit r/w	Next Page Register */
-#define PHY_XMAC_NEPG_LP	0x08	/* 16 bit r/o	Next Page Link P Reg */
+#define PHY_XMAC_NEPG_LP	0x08	/* 16 bit r/o	Next Page Link Partner */
 	/* 0x09 - 0x0e:		reserved */
 #define PHY_XMAC_EXT_STAT	0x0f	/* 16 bit r/o	Ext Status Register */
 #define PHY_XMAC_RES_ABI	0x10	/* 16 bit r/o	PHY Resolved Ability */
@@ -693,7 +709,7 @@
 #define PHY_BCOM_AUNE_LP	0x05	/* 16 bit r/o	Link Part Ability Reg */
 #define PHY_BCOM_AUNE_EXP	0x06	/* 16 bit r/o	Auto-Neg. Expansion Reg */
 #define PHY_BCOM_NEPG		0x07	/* 16 bit r/w	Next Page Register */
-#define PHY_BCOM_NEPG_LP	0x08	/* 16 bit r/o	Next Page Link P Reg */
+#define PHY_BCOM_NEPG_LP	0x08	/* 16 bit r/o	Next Page Link Partner */
 	/* Broadcom-specific registers */
 #define PHY_BCOM_1000T_CTRL	0x09	/* 16 bit r/w	1000Base-T Ctrl Reg */
 #define PHY_BCOM_1000T_STAT	0x0a	/* 16 bit r/o	1000Base-T Status Reg */
@@ -702,7 +718,7 @@
 #define PHY_BCOM_P_EXT_CTRL	0x10	/* 16 bit r/w	PHY Extended Ctrl Reg */
 #define PHY_BCOM_P_EXT_STAT	0x11	/* 16 bit r/o	PHY Extended Stat Reg */
 #define PHY_BCOM_RE_CTR		0x12	/* 16 bit r/w	Receive Error Counter */
-#define PHY_BCOM_FC_CTR		0x13	/* 16 bit r/w	False Carr Sense Cnt */
+#define PHY_BCOM_FC_CTR		0x13	/* 16 bit r/w	False Carrier Sense Cnt */
 #define PHY_BCOM_RNO_CTR	0x14	/* 16 bit r/w	Receiver NOT_OK Cnt */
 	/* 0x15 - 0x17:		reserved */
 #define PHY_BCOM_AUX_CTRL	0x18	/* 16 bit r/w	Auxiliary Control Reg */
@@ -724,7 +740,7 @@
 #define PHY_MARV_AUNE_LP	0x05	/* 16 bit r/o	Link Part Ability Reg */
 #define PHY_MARV_AUNE_EXP	0x06	/* 16 bit r/o	Auto-Neg. Expansion Reg */
 #define PHY_MARV_NEPG		0x07	/* 16 bit r/w	Next Page Register */
-#define PHY_MARV_NEPG_LP	0x08	/* 16 bit r/o	Next Page Link P Reg */
+#define PHY_MARV_NEPG_LP	0x08	/* 16 bit r/o	Next Page Link Partner */
 	/* Marvel-specific registers */
 #define PHY_MARV_1000T_CTRL	0x09	/* 16 bit r/w	1000Base-T Ctrl Reg */
 #define PHY_MARV_1000T_STAT	0x0a	/* 16 bit r/o	1000Base-T Status Reg */
@@ -757,7 +773,7 @@
 #define PHY_LONE_AUNE_LP	0x05	/* 16 bit r/o	Link Part Ability Reg */
 #define PHY_LONE_AUNE_EXP	0x06	/* 16 bit r/o	Auto-Neg. Expansion Reg */
 #define PHY_LONE_NEPG		0x07	/* 16 bit r/w	Next Page Register */
-#define PHY_LONE_NEPG_LP	0x08	/* 16 bit r/o	Next Page Link Partner*/
+#define PHY_LONE_NEPG_LP	0x08	/* 16 bit r/o	Next Page Link Partner */
 	/* Level One-specific registers */
 #define PHY_LONE_1000T_CTRL	0x09	/* 16 bit r/w	1000Base-T Control Reg*/
 #define PHY_LONE_1000T_STAT	0x0a	/* 16 bit r/o	1000Base-T Status Reg */
@@ -804,12 +820,13 @@
 /*
  * PHY bit definitions
  * Bits defined as PHY_X_..., PHY_B_..., PHY_L_... or PHY_N_... are
- * Xmac/Broadcom/LevelOne/National-specific.
+ * XMAC/Broadcom/LevelOne/National/Marvell-specific.
  * All other are general.
  */
 
 /*****  PHY_XMAC_CTRL	16 bit r/w	PHY Control Register *****/
 /*****  PHY_BCOM_CTRL	16 bit r/w	PHY Control Register *****/
+/*****  PHY_MARV_CTRL	16 bit r/w	PHY Status Register *****/
 /*****  PHY_LONE_CTRL	16 bit r/w	PHY Control Register *****/
 #define PHY_CT_RESET	(1<<15)	/* Bit 15: (sc)	clear all PHY related regs */
 #define PHY_CT_LOOP		(1<<14)	/* Bit 14:	enable Loopback over PHY */
@@ -909,27 +926,20 @@
 
 /*****  PHY_XMAC_AUNE_EXP	16 bit r/o	Auto-Negotiation Expansion Reg *****/
 								/* Bit 15..4:	reserved */
-#define PHY_AN_LP_NP	(1<<3)	/* Bit  3:	Link Partner can Next Page */
-#define PHY_AN_LOC_NP	(1<<2)	/* Bit  2:	Local PHY can Next Page */
-#define PHY_AN_RX_PG	(1<<1)	/* Bit  1:	Page Received */
+#define PHY_ANE_LP_NP	(1<<3)	/* Bit  3:	Link Partner can Next Page */
+#define PHY_ANE_LOC_NP	(1<<2)	/* Bit  2:	Local PHY can Next Page */
+#define PHY_ANE_RX_PG	(1<<1)	/* Bit  1:	Page Received */
 								/* Bit  0:	reserved */
 
 /*****  PHY_BCOM_AUNE_EXP	16 bit r/o	Auto-Negotiation Expansion Reg *****/
-								/* Bit 15..5:	reserved */
-#define PHY_B_AN_PDF	(1<<4)	/* Bit  4:	Parallel Detection Fault */
-/*	PHY_AN_LP_NP		(see XMAC) Bit  3:	Link Partner can Next Page */
-/*	PHY_AN_LOC_NP		(see XMAC) Bit  2:	Local PHY can Next Page */
-/*	PHY_AN_RX_PG		(see XMAC) Bit  1:	Page Received */
-#define PHY_B_AN_LP_CAP	(1<<0)	/* Bit  0:	Link Partner Auto-Neg. Cap. */ 	
-
 /*****  PHY_LONE_AUNE_EXP	16 bit r/o	Auto-Negotiation Expansion Reg *****/
-#define PHY_L_AN_BP		(1<<5)	/* Bit  5:	Base Page Indication */
-#define PHY_L_AN_PDF	(1<<4)	/* Bit  4:	Parallel Detection Fault */
-/*	PHY_AN_LP_NP		(see XMAC) Bit  3:	Link Partner can Next Page */
-/*	PHY_AN_LOC_NP		(see XMAC) Bit  2:	Local PHY can Next Page */
-/*	PHY_AN_RX_PG		(see XMAC) Bit  1:	Page Received */
-#define PHY_B_AN_LP_CAP	(1<<0)	/* Bit  0:	Link Partner Auto-Neg. Cap. */ 	
-
+/*****  PHY_MARV_AUNE_EXP	16 bit r/o	Auto-Negotiation Expansion Reg *****/
+								/* Bit 15..5:	reserved */
+#define PHY_ANE_PAR_DF	(1<<4)	/* Bit  4:	Parallel Detection Fault */
+/*	PHY_ANE_LP_NP		(see XMAC) Bit  3:	Link Partner can Next Page */
+/*	PHY_ANE_LOC_NP		(see XMAC) Bit  2:	Local PHY can Next Page */
+/*	PHY_ANE_RX_PG		(see XMAC) Bit  1:	Page Received */
+#define PHY_ANE_LP_CAP	(1<<0)	/* Bit  0:	Link Partner Auto-Neg. Cap. */ 	
 
 /*****  PHY_XMAC_NEPG		16 bit r/w	Next Page Register *****/
 /*****  PHY_BCOM_NEPG		16 bit r/w	Next Page Register *****/
@@ -958,7 +968,7 @@
 #define PHY_X_RS_HD		(1<<6)	/* Bit  6:	Half Duplex Mode selected */
 #define PHY_X_RS_FD		(1<<5)	/* Bit  5:	Full Duplex Mode selected */
 #define PHY_X_RS_ABLMIS (1<<4)	/* Bit  4:	duplex or pause cap mismatch */
-#define PHY_X_RS_PAUMIS (1<<3)	/* Bit  3:	pause capability missmatch */
+#define PHY_X_RS_PAUMIS (1<<3)	/* Bit  3:	pause capability mismatch */
 								/* Bit  2..0:	reserved */
 /*
  * Remote Fault Bits (PHY_X_AN_RFB) encoding
@@ -990,6 +1000,7 @@
 									/* Bit  7..0:	reserved */
 
 /*****  PHY_BCOM_1000T_STAT	16 bit r/o	1000Base-T Status Reg *****/
+/*****  PHY_MARV_1000T_STAT	16 bit r/o	1000Base-T Status Reg *****/
 #define PHY_B_1000S_MSF		(1<<15)	/* Bit 15:	Master/Slave Fault */
 #define PHY_B_1000S_MSR		(1<<14)	/* Bit 14:	Master/Slave Result */
 #define PHY_B_1000S_LRS		(1<<13)	/* Bit 13:	Local Receiver Status */
@@ -1309,7 +1320,6 @@
 									/* Bit  7..0:	reserved */
 
 /*****  PHY_MARV_PHY_CTRL	16 bit r/w	PHY Specific Ctrl Reg *****/
-
 #define PHY_M_PC_TX_FFD_MSK	(3<<14)	/* Bit 15..14:	Tx FIFO Depth Mask */
 #define PHY_M_PC_RX_FFD_MSK	(3<<12)	/* Bit 13..12:	Rx FIFO Depth Mask */
 #define PHY_M_PC_ASS_CRS_TX	(1<<11)	/* Bit 11:	Assert CRS on Transmit */
@@ -1323,6 +1333,9 @@
 #define PHY_M_PC_POL_R_DIS	(1<<1)	/* Bit  1:	Polarity Reversal Disabled */
 #define PHY_M_PC_DIS_JABBER	(1<<0)	/* Bit  0:	Disable Jabber */
 
+#define PHY_M_PC_EN_DET			SHIFT8(2)	/* Energy Detect (Mode 1) */
+#define PHY_M_PC_EN_DET_PLUS	SHIFT8(3)	/* Energy Detect Plus (Mode 2) */
+
 #define PHY_M_PC_MDI_XMODE(x)	SHIFT5(x)	
 #define PHY_M_PC_MAN_MDI	0    	/* 00 = Manual MDI configuration */
 #define PHY_M_PC_MAN_MDIX	1		/* 01 = Manual MDIX configuration */
@@ -1373,6 +1386,7 @@
 #define PHY_M_EC_M_DSC_MSK	(3<<10)	/* Bit 11..10:	Master downshift counter */
 #define PHY_M_EC_S_DSC_MSK	(3<<8)	/* Bit  9.. 8:	Slave  downshift counter */
 #define PHY_M_EC_MAC_S_MSK	(7<<4)	/* Bit  6.. 4:	Def. MAC interface speed */
+#define PHY_M_EC_FIB_AN_ENA	(1<<3)	/* Bit  3:	Fiber Auto-Neg. Enable */
 
 #define PHY_M_EC_M_DSC(x)		SHIFT10(x)	/* 00=1x; 01=2x; 10=3x; 11=4x */
 #define PHY_M_EC_S_DSC(x)		SHIFT8(x)	/* 00=dis; 01=1x; 10=2x; 11=3x */
@@ -1434,6 +1448,18 @@
 #define PHY_M_EC2_FO_BOOST	(1<<3)	/* Bit  3:	Fiber Output Boost */
 #define PHY_M_EC2_FO_AM_MSK	7		/* Bit  2.. 0:	Fiber Output Amplitude */
 
+/*****	PHY_MARV_EXT_P_STAT 16 bit r/w	Ext. PHY Specific Status *****/
+#define PHY_M_FC_AUTO_SEL	(1<<15)	/* Bit 15:	Fiber/Copper Auto Sel. dis. */
+#define PHY_M_FC_AN_REG_ACC (1<<14) /* Bit 14:	Fiber/Copper Autoneg. reg acc */
+#define PHY_M_FC_RESULUTION (1<<13)	/* Bit 13:	Fiber/Copper Resulution */
+#define PHY_M_SER_IF_AN_BP  (1<<12) /* Bit 12:	Ser IF autoneg. bypass enable */
+#define PHY_M_SER_IF_BP_ST	(1<<11) /* Bit 11:	Ser IF autoneg. bypass status */
+#define PHY_M_IRQ_POLARITY	(1<<10) /* Bit 10:	IRQ polarity */
+									/* Bit 9..4: reserved */
+#define PHY_M_UNDOC1		(1<< 7) /* undocumented bit !! */
+#define PHY_M_MODE_MASK		(0xf<<0)/* Bit 3..0: copy of HWCFG MODE[3:0] */
+
+
 /*****  PHY_MARV_CABLE_DIAG	16 bit r/o	Cable Diagnostic Reg *****/
 #define PHY_M_CABD_ENA_TEST	(1<<15)	/* Bit 15:	Enable Test */
 #define PHY_M_CABD_STAT_MSK	(3<<13)	/* Bit 14..13:	Status */
@@ -1531,7 +1557,7 @@
 #define GM_RXF_SHT \
 			(GM_MIB_CNT_BASE + 80)	/* Frames <64 Byte Received OK */
 #define GM_RXE_FRAG \
-			(GM_MIB_CNT_BASE + 88)	/* Frames <64 Byte Receeived with FCS Err */
+			(GM_MIB_CNT_BASE + 88)	/* Frames <64 Byte Received with FCS Err */
 #define GM_RXF_64B \
 			(GM_MIB_CNT_BASE + 96)	/* 64 Byte Rx Frame */
 #define GM_RXF_127B \
@@ -1606,7 +1632,6 @@
  */
 
 /*	GM_GP_STAT	16 bit r/o	General Purpose Status Register */
-
 #define GM_GPSR_SPEED		(1<<15) /* Bit 15:	Port Speed (1 = 100 Mbps) */
 #define GM_GPSR_DUPLEX		(1<<14) /* Bit 14:	Duplex Mode (1 = Full) */
 #define GM_GPSR_FC_TX_DIS	(1<<13) /* Bit 13:	Tx Flow-Control Mode Disabled */
@@ -1646,11 +1671,14 @@
 							 GM_GPCR_AU_SPD_DIS)
 	
 /*	GM_TX_CTRL				16 bit r/w	Transmit Control Register */
-
 #define GM_TXCR_FORCE_JAM	(1<<15)	/* Bit 15:	Force Jam / Flow-Control */
 #define GM_TXCR_CRC_DIS		(1<<14)	/* Bit 14:	Disable insertion of CRC */
 #define GM_TXCR_PAD_DIS		(1<<13)	/* Bit 13:	Disable padding of packets */
-#define GM_TXCR_COL_THR		(4<<10)	/* Bit 12..10:	Collision Threshold */
+#define GM_TXCR_COL_THR_MSK	(1<<10)	/* Bit 12..10:	Collision Threshold */
+
+#define TX_COL_THR(x)		(SHIFT10(x) & GM_TXCR_COL_THR_MSK)
+
+#define TX_COL_DEF			0x04
 	
 /*	GM_RX_CTRL				16 bit r/w	Receive Control Register */
 #define GM_RXCR_UCF_ENA		(1<<15)	/* Bit 15:	Enable Unicast filtering */
@@ -1663,35 +1691,41 @@
 #define GM_TXPA_JAMIPG_MSK	(0x1f<<9)	/* Bit 13..9:	Jam IPG */
 #define GM_TXPA_JAMDAT_MSK	(0x1f<<4)	/* Bit  8..4:	IPG Jam to Data */
 								/* Bit  3..0:	reserved */
-#define JAM_LEN_VAL(x)		SHIFT14(x)
-#define JAM_IPG_VAL(x)		SHIFT9(x)
-#define IPG_JAM_DATA(x)		SHIFT4(x)
+
+#define TX_JAM_LEN_VAL(x)	(SHIFT14(x) & GM_TXPA_JAMLEN_MSK)
+#define TX_JAM_IPG_VAL(x)	(SHIFT9(x) & GM_TXPA_JAMIPG_MSK)
+#define TX_IPG_JAM_DATA(x)	(SHIFT4(x) & GM_TXPA_JAMDAT_MSK)
+
+#define TX_JAM_LEN_DEF		0x03
+#define TX_JAM_IPG_DEF		0x0b
+#define TX_IPG_JAM_DEF		0x1c
 
 /*	GM_SERIAL_MODE			16 bit r/w	Serial Mode Register */
-#define GM_SMOD_DATABL_MSK	(0x1f<<11)	/* Bit 15..11:	Data Blinder */
+#define GM_SMOD_DATABL_MSK	(0x1f<<11)	/* Bit 15..11:	Data Blinder (r/o) */
 #define GM_SMOD_LIMIT_4		(1<<10)	/* Bit 10:	4 consecutive Tx trials */
 #define GM_SMOD_VLAN_ENA	(1<<9)	/* Bit  9:	Enable VLAN  (Max. Frame Len) */
 #define GM_SMOD_JUMBO_ENA	(1<<8)	/* Bit  8:	Enable Jumbo (Max. Frame Len) */
 								/* Bit  7..5:	reserved */
 #define GM_SMOD_IPG_MSK		0x1f	/* Bit 4..0:	Inter-Packet Gap (IPG) */
 	
-#define DATA_BLIND_VAL(x)	SHIFT11(x)
-#define DATA_BLIND_FAST_ETH	0x1c
-#define DATA_BLIND_GIGABIT	4
+#define DATA_BLIND_VAL(x)	(SHIFT11(x) & GM_SMOD_DATABL_MSK)
+#define DATA_BLIND_DEF		0x04
 
-#define IPG_VAL_FAST_ETH	0x1e
-#define IPG_VAL_GIGABIT		6
+#define IPG_DATA_VAL(x)		(x & GM_SMOD_IPG_MSK)
+#define IPG_DATA_DEF		0x1e
 
 /*	GM_SMI_CTRL				16 bit r/w	SMI Control Register */
-
-#define GM_SMI_CT_PHY_AD(x)	SHIFT11(x)
-#define GM_SMI_CT_REG_AD(x)	SHIFT6(x)
+#define GM_SMI_CT_PHY_A_MSK	(0x1f<<11)	/* Bit 15..11:	PHY Device Address */
+#define GM_SMI_CT_REG_A_MSK	(0x1f<<6)	/* Bit 10.. 6:	PHY Register Address */
 #define GM_SMI_CT_OP_RD		(1<<5)	/* Bit  5:	OpCode Read (0=Write)*/
 #define GM_SMI_CT_RD_VAL	(1<<4)	/* Bit  4:	Read Valid (Read completed) */
 #define GM_SMI_CT_BUSY		(1<<3)	/* Bit  3:	Busy (Operation in progress) */
 								/* Bit   2..0:	reserved */
 	
-/*	GM_PHY_ADDR				16 bit r/w	GPHY Address Register */
+#define GM_SMI_CT_PHY_AD(x)	(SHIFT11(x) & GM_SMI_CT_PHY_A_MSK)
+#define GM_SMI_CT_REG_AD(x)	(SHIFT6(x) & GM_SMI_CT_REG_A_MSK)
+
+	/*	GM_PHY_ADDR				16 bit r/w	GPHY Address Register */
 								/* Bit  15..6:	reserved */
 #define GM_PAR_MIB_CLR		(1<<5)	/* Bit  5:	Set MIB Clear Counter Mode */
 #define GM_PAR_MIB_TST		(1<<4)	/* Bit  4:	MIB Load Counter (Test Mode) */
diff -Nru a/drivers/net/sk98lin/skcsum.c b/drivers/net/sk98lin/skcsum.c
--- a/drivers/net/sk98lin/skcsum.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/sk98lin/skcsum.c	Tue Feb  3 19:45:16 2004
@@ -2,8 +2,8 @@
  *
  * Name:	skcsum.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.11 $
- * Date:	$Date: 2003/03/11 14:05:55 $
+ * Version:	$Revision: 1.12 $
+ * Date:	$Date: 2003/08/20 13:55:53 $
  * Purpose:	Store/verify Internet checksum in send/receive packets.
  *
  ******************************************************************************/
@@ -26,6 +26,10 @@
  * History:
  *
  *	$Log: skcsum.c,v $
+ *	Revision 1.12  2003/08/20 13:55:53  mschmid
+ *	Changed notation of #ifndef SkCsCalculateChecksum to
+ *	#ifndef SK_CS_CALCULATE_CHECKSUM
+ *	
  *	Revision 1.11  2003/03/11 14:05:55  rschmidt
  *	Replaced memset() by macro SK_MEMSET()
  *	Editorial changes
@@ -78,7 +82,7 @@
 
 #ifndef lint
 static const char SysKonnectFileId[] =
-	"@(#) $Id: skcsum.c,v 1.11 2003/03/11 14:05:55 rschmidt Exp $ (C) SysKonnect.";
+	"@(#) $Id: skcsum.c,v 1.12 2003/08/20 13:55:53 mschmid Exp $ (C) SysKonnect.";
 #endif	/* !lint */
 
 /******************************************************************************
@@ -791,7 +795,7 @@
 	*pChecksum2Offset = SKCS_MAC_HEADER_SIZE + SKCS_IP_HEADER_SIZE;
 }	/* SkCsSetReceiveFlags */
 
-#ifndef SkCsCalculateChecksum
+#ifndef SK_CS_CALCULATE_CHECKSUM
 
 /******************************************************************************
  *
@@ -856,7 +860,7 @@
 	return ((unsigned) Checksum);
 }	/* SkCsCalculateChecksum */
 
-#endif /* SkCsCalculateChecksum */
+#endif /* SK_CS_CALCULATE_CHECKSUM */
 
 /******************************************************************************
  *
diff -Nru a/drivers/net/sk98lin/skdim.c b/drivers/net/sk98lin/skdim.c
--- a/drivers/net/sk98lin/skdim.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/sk98lin/skdim.c	Tue Feb  3 19:45:17 2004
@@ -2,8 +2,8 @@
  *
  * Name:	skdim.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.2 $
- * Date:	$Date: 2003/08/21 12:35:05 $
+ * Version:	$Revision: 1.5 $
+ * Date:	$Date: 2003/11/28 12:55:40 $
  * Purpose:	All functions to maintain interrupt moderation
  *
  ******************************************************************************/
@@ -11,6 +11,7 @@
 /******************************************************************************
  *
  *	(C)Copyright 1998-2002 SysKonnect GmbH.
+ *	(C)Copyright 2002-2003 Marvell.
  *
  *	This program is free software; you can redistribute it and/or modify
  *	it under the terms of the GNU General Public License as published by
@@ -26,6 +27,15 @@
  * History:
  *	
  *	$Log: skdim.c,v $
+ *	Revision 1.5  2003/11/28 12:55:40  rroesler
+ *	Fix: support for new process timing interface added
+ *	
+ *	Revision 1.4  2003/10/10 10:58:56  mlindner
+ *	Fix: CPU detection under the kernel 2.6
+ *	
+ *	Revision 1.3  2003/10/07 08:17:08  mlindner
+ *	Fix: Copyright changes
+ *	
  *	Revision 1.2  2003/08/21 12:35:05  mlindner
  *	Fix: Corrected CPU detection and compile errors on single CPU machines
  *	
@@ -62,7 +72,7 @@
 
 #ifndef	lint
 static const char SysKonnectFileId[] =
-	"@(#) $Id: skdim.c,v 1.2 2003/08/21 12:35:05 mlindner Exp $ (C) SysKonnect.";
+	"@(#) $Id: skdim.c,v 1.5 2003/11/28 12:55:40 rroesler Exp $ (C) SysKonnect.";
 #endif
 
 #define __SKADDR_C
@@ -327,7 +337,9 @@
 	**
 	**      struct kernel_stat kstat
 	**
-	** is not marked as an exported symbol
+	** is not marked as an exported symbol in the file
+	**
+	**      kernel/ksyms.c 
 	**
 	** As a consequence, using this driver as KLM is not possible
 	** and any access of the structure kernel_stat via the 
diff -Nru a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
--- a/drivers/net/sk98lin/skge.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/sk98lin/skge.c	Tue Feb  3 19:45:17 2004
@@ -1,35 +1,20 @@
 /******************************************************************************
  *
- * Name:    skge.c
+ * Name:	skge.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.11 $
- * Date:       	$Date: 2003/08/26 16:05:19 $
+ * Version:	$Revision: 1.43 $
+ * Date:       	$Date: 2004/01/29 15:47:07 $
  * Purpose:	The main driver source module
  *
  ******************************************************************************/
 
 /******************************************************************************
  *
- *	(C)Copyright 1998-2003 SysKonnect GmbH.
+ *	(C)Copyright 1998-2002 SysKonnect GmbH.
+ *	(C)Copyright 2002-2003 Marvell.
  *
- *	Driver for SysKonnect Gigabit Ethernet Server Adapters:
- *
- *	SK-9871 (single link 1000Base-ZX)
- *	SK-9872 (dual link   1000Base-ZX)
- *	SK-9861 (single link 1000Base-SX, VF45 Volition Plug)
- *	SK-9862 (dual link   1000Base-SX, VF45 Volition Plug)
- *	SK-9841 (single link 1000Base-LX)
- *	SK-9842 (dual link   1000Base-LX)
- *	SK-9843 (single link 1000Base-SX)
- *	SK-9844 (dual link   1000Base-SX)
- *	SK-9821 (single link 1000Base-T)
- *	SK-9822 (dual link   1000Base-T)
- *	SK-9881 (single link 1000Base-SX V2 LC)
- *	SK-9871 (single link 1000Base-ZX V2)
- *	SK-9861 (single link 1000Base-SX V2, VF45 Volition Plug)
- *	SK-9841 (single link 1000Base-LX V2)
- *	SK-9843 (single link 1000Base-SX V2)
- *	SK-9821 (single link 1000Base-T V2)
+ *	Driver for Marvell Yukon chipset and SysKonnect Gigabit Ethernet 
+ *      Server Adapters.
  *
  *	Created 10-Feb-1999, based on Linux' acenic.c, 3c59x.c and
  *	SysKonnects GEnesis Solaris driver
@@ -56,6 +41,90 @@
  * History:
  *
  *	$Log: skge.c,v $
+ *	Revision 1.43  2004/01/29 15:47:07  mlindner
+ *	Fix: Reset Xmac when stopping the port
+ *	
+ *	Revision 1.42  2003/12/12 10:05:43  mlindner
+ *	Fix: Format of error message corrected
+ *	
+ *	Revision 1.41  2003/12/11 16:03:57  mlindner
+ *	Fix: Create backup from pnmi data structure
+ *	
+ *	Revision 1.40  2003/12/11 12:14:48  mlindner
+ *	Fix: Initalize Board before network configuration
+ *	Fix: Change device names to driver name
+ *	
+ *	Revision 1.39  2003/12/10 08:57:38  rroesler
+ *	Fix: Modifications regarding try_module_get() and capable()
+ *	
+ *	Revision 1.38  2003/12/01 17:16:50  mlindner
+ *	Fix: Remove useless register_netdev
+ *	
+ *	Revision 1.37  2003/12/01 17:11:30  mlindner
+ *	Fix: Register net device before SkGeBoardInit
+ *	
+ *	Revision 1.36  2003/11/28 13:04:27  rroesler
+ *	Fix: do not print interface status in case DIAG is used
+ *	
+ *	Revision 1.35  2003/11/17 14:41:06  mlindner
+ *	Fix: Endif command
+ *	
+ *	Revision 1.34  2003/11/17 13:29:05  mlindner
+ *	Fix: Editorial changes
+ *	
+ *	Revision 1.33  2003/11/14 14:56:54  rroesler
+ *	Fix: corrected compilation warnings kernel 2.2
+ *	
+ *	Revision 1.32  2003/11/13 14:18:47  rroesler
+ *	Fix: added latest changes regarding the use of the proc system
+ *	
+ *	Revision 1.31  2003/11/13 09:28:35  rroesler
+ *	Fix: removed kernel warning 'driver changed get_stats after register'
+ *	
+ *	Revision 1.30  2003/11/11 13:15:27  rroesler
+ *	Fix: use suitables kernel usage count macros when using the diag
+ *	
+ *	Revision 1.29  2003/11/10 09:38:26  rroesler
+ *	Fix: restore PNMI structure backup for DIAG actions
+ *	
+ *	Revision 1.28  2003/11/07 17:28:45  rroesler
+ *	Fix: Additions for the LeaveDiagMode
+ *	
+ *	Revision 1.27  2003/11/03 13:21:14  mlindner
+ *	Add: SkGeBuffPad function for padding to ensure the trailing bytes exist
+ *	
+ *	Revision 1.26  2003/10/30 09:20:40  mlindner
+ *	Fix: Control bit check
+ *	
+ *	Revision 1.25  2003/10/29 07:43:37  rroesler
+ *	Fix: Implemented full None values handling for parameter Moderation
+ *	
+ *	Revision 1.24  2003/10/22 14:18:12  rroesler
+ *	Fix: DIAG handling for DualNet cards
+ *	
+ *	Revision 1.23  2003/10/17 10:05:13  mlindner
+ *	Add: New blinkmode for Morvell cards
+ *	
+ *	Revision 1.22  2003/10/15 12:31:25  rroesler
+ *	Fix: Corrected bugreport #10954 (Linux System crash when using vlans)
+ *	
+ *	Revision 1.21  2003/10/07 12:32:28  mlindner
+ *	Fix: Editorial changes
+ *	
+ *	Revision 1.20  2003/10/07 12:22:40  mlindner
+ *	Fix: Compiler warnings
+ *	
+ *	Revision 1.19  2003/10/07 09:33:40  mlindner
+ *	Fix: No warnings for illegal values of Mod and IntsPerSec
+ *	Fix: Speed 100 in Half Duplex not allowed for Yukon
+ *	Fix: PrefPort=B not allowed on single NICs
+ *	
+ *	Revision 1.18  2003/10/07 08:17:08  mlindner
+ *	Fix: Copyright changes
+ *	
+ *	Revision 1.17  2003/09/29 12:06:59  mlindner
+ *	*** empty log message ***
+ *	
  *	Revision 1.16  2003/09/23 11:07:35  mlindner
  *	Fix: IO-control return race condition
  *	Fix: Interrupt moderation value check
@@ -68,6 +137,12 @@
  *	Add: Yukon Plus changes (ChipID, PCI...)
  *	Fix: TCP and UDP Checksum calculation
  *	
+ *	Revision 1.13  2003/09/01 13:30:08  rroesler
+ *	Fix: Corrected missing defines
+ *	
+ *	Revision 1.12  2003/09/01 13:12:02  rroesler
+ *	Add: Code for improved DIAG Attach/Detach interface
+ *	
  *	Revision 1.11  2003/08/26 16:05:19  mlindner
  *	Fix: Compiler warnings (void *)
  *	
@@ -406,7 +481,6 @@
  *	<linux/module.h>
  *
  *	"h/skdrv1st.h"
- *		<linux/version.h>
  *		<linux/types.h>
  *		<linux/kernel.h>
  *		<linux/string.h>
@@ -568,6 +642,12 @@
 static void	StopDrvCleanupTimer(SK_AC *pAC);
 static int	XmitFrameSG(SK_AC*, TX_PORT*, struct sk_buff*);
 
+#ifdef SK_DIAG_SUPPORT
+static SK_U32   ParseDeviceNbrFromSlotName(const char *SlotName);
+static int      SkDrvInitAdapter(SK_AC *pAC, int devNbr);
+static int      SkDrvDeInitAdapter(SK_AC *pAC, int devNbr);
+#endif
+
 /*******************************************************************************
  *
  * Extern Function Prototypes
@@ -576,8 +656,8 @@
 
 #ifdef CONFIG_PROC_FS
 static const char 	SK_Root_Dir_entry[] = "sk98lin";
-static struct		proc_dir_entry *pSkRootDir;
-extern struct		file_operations sk_proc_fops;
+static struct		proc_dir_entry *pSkRootDir = NULL;
+extern struct	file_operations sk_proc_fops;
 #endif
 
 extern void SkDimEnableModerationIfNeeded(SK_AC *pAC);	
@@ -595,12 +675,19 @@
 static const char *BootString = BOOT_STRING;
 struct SK_NET_DEVICE *SkGeRootDev = NULL;
 static int probed __initdata = 0;
+static SK_BOOL DoPrintInterfaceChange = SK_TRUE;
 
 /* local variables **********************************************************/
 static uintptr_t TxQueueAddr[SK_MAX_MACS][2] = {{0x680, 0x600},{0x780, 0x700}};
 static uintptr_t RxQueueAddr[SK_MAX_MACS] = {0x400, 0x480};
 
 
+#ifdef CONFIG_PROC_FS
+static struct proc_dir_entry	*pSkRootDir;
+#endif
+
+
+
 /*****************************************************************************
  *
  * 	skge_probe - find all SK-98xx adapters
@@ -626,6 +713,7 @@
 	SK_BOOL BootStringCount = SK_FALSE;
 	int			retval;
 #ifdef CONFIG_PROC_FS
+	int			proc_root_initialized = 0;
 	struct proc_dir_entry	*pProcFile;
 #endif
 
@@ -700,6 +788,7 @@
 		dev->stop =		&SkGeClose;
 		dev->hard_start_xmit =	&SkGeXmit;
 		dev->get_stats =	&SkGeStats;
+		dev->last_stats =	&SkGeStats;
 		dev->set_multicast_list = &SkGeSetRxMode;
 		dev->set_mac_address =	&SkGeSetMacAddr;
 		dev->do_ioctl =		&SkGeIoctl;
@@ -718,15 +807,13 @@
 #endif
 
 		pAC->Index = boards_found;
+
 		if (SkGeBoardInit(dev, pAC)) {
-			FreeResources(dev);
 			free_netdev(dev);
 			continue;
 		}
 
-		memcpy((caddr_t) &dev->dev_addr,
-			(caddr_t) &pAC->Addr.Net[0].CurrentMacAddress, 6);
-
+		/* Register net device */
 		if (register_netdev(dev)) {
 			printk(KERN_ERR "SKGE: Could not register device.\n");
 			FreeResources(dev);
@@ -734,6 +821,25 @@
 			continue;
 		}
 
+		/* Print adapter specific string from vpd */
+		ProductStr(pAC);
+		printk("%s: %s\n", dev->name, pAC->DeviceStr);
+
+		/* Print configuration settings */
+		printk("      PrefPort:%c  RlmtMode:%s\n",
+			'A' + pAC->Rlmt.Net[0].Port[pAC->Rlmt.Net[0].PrefPort]->PortNumber,
+			(pAC->RlmtMode==0)  ? "Check Link State" :
+			((pAC->RlmtMode==1) ? "Check Link State" :
+			((pAC->RlmtMode==3) ? "Check Local Port" :
+			((pAC->RlmtMode==7) ? "Check Segmentation" :
+			((pAC->RlmtMode==17) ? "Dual Check Link State" :"Error")))));
+
+		SkGeYellowLED(pAC, pAC->IoBase, 1);
+
+
+		memcpy((caddr_t) &dev->dev_addr,
+			(caddr_t) &pAC->Addr.Net[0].CurrentMacAddress, 6);
+
 		/* First adapter... Create proc and print message */
 #ifdef CONFIG_PROC_FS
 		if (!DeviceFound) {
@@ -744,25 +850,27 @@
 			/*Create proc (directory)*/
 			if(!pSkRootDir) {
 				pSkRootDir = proc_mkdir(SK_Root_Dir_entry, proc_net);
-				if (!pSkRootDir) 
+				if (!pSkRootDir) {
 					printk(KERN_WARNING "%s: Unable to create /proc/net/%s",
-					       dev->name, SK_Root_Dir_entry);
-				else
+						dev->name, SK_Root_Dir_entry);
+				} else {
 					pSkRootDir->owner = THIS_MODULE;
+				}
 			}
 		}
-		
+
 		/* Create proc file */
-		if (pSkRootDir 
-		    && (pProcFile = create_proc_entry(dev->name, S_IRUGO,
-						      pSkRootDir))) {
+		if (pSkRootDir && 
+			(pProcFile = create_proc_entry(dev->name, S_IRUGO,
+				pSkRootDir))) {
 			pProcFile->proc_fops = &sk_proc_fops;
-			pProcFile->data = dev;
+			pProcFile->data      = dev;
 		}
+
 #endif
 
 		pNet->PortNr = 0;
-		pNet->NetNr = 0;
+		pNet->NetNr  = 0;
 
 		boards_found++;
 
@@ -774,23 +882,24 @@
 				break;
 			}
 
-			pAC->dev[1] = dev;
-			pNet = dev->priv;
-			pNet->PortNr = 1;
-			pNet->NetNr = 1;
-			pNet->pAC = pAC;
-			pNet->Mtu = 1500;
-			pNet->Up = 0;
-
-			dev->open =		&SkGeOpen;
-			dev->stop =		&SkGeClose;
-			dev->hard_start_xmit =	&SkGeXmit;
-			dev->get_stats =	&SkGeStats;
+			pAC->dev[1]   = dev;
+			pNet          = dev->priv;
+			pNet->PortNr  = 1;
+			pNet->NetNr   = 1;
+			pNet->pAC     = pAC;
+			pNet->Mtu     = 1500;
+			pNet->Up      = 0;
+
+			dev->open               = &SkGeOpen;
+			dev->stop               = &SkGeClose;
+			dev->hard_start_xmit    = &SkGeXmit;
+			dev->get_stats          = &SkGeStats;
+			dev->last_stats         = &SkGeStats;
 			dev->set_multicast_list = &SkGeSetRxMode;
-			dev->set_mac_address =	&SkGeSetMacAddr;
-			dev->do_ioctl =		&SkGeIoctl;
-			dev->change_mtu =	&SkGeChangeMtu;
-			dev->flags &= 		~IFF_RUNNING;
+			dev->set_mac_address    = &SkGeSetMacAddr;
+			dev->do_ioctl           = &SkGeIoctl;
+			dev->change_mtu         = &SkGeChangeMtu;
+			dev->flags             &= ~IFF_RUNNING;
 
 #ifdef SK_ZEROCOPY
 #ifdef USE_SK_TX_CHECKSUM
@@ -802,34 +911,39 @@
 #endif
 
 			if (register_netdev(dev)) {
-				printk(KERN_ERR "SKGE: Could not register "
-				       "second port.\n");
+				printk(KERN_ERR "SKGE: Could not register device.\n");
 				free_netdev(dev);
 				pAC->dev[1] = pAC->dev[0];
 			} else {
 #ifdef CONFIG_PROC_FS
 				if (pSkRootDir 
 				    && (pProcFile = create_proc_entry(dev->name, 
-								      S_IRUGO,
-								      pSkRootDir))) {
+								S_IRUGO, pSkRootDir))) {
 					pProcFile->proc_fops = &sk_proc_fops;
-					pProcFile->data = dev;
+					pProcFile->data      = dev;
 				}
 #endif
 
-				memcpy((caddr_t) &dev->dev_addr,
-				       (caddr_t) &pAC->Addr.Net[1].CurrentMacAddress, 6);
+			memcpy((caddr_t) &dev->dev_addr,
+			(caddr_t) &pAC->Addr.Net[1].CurrentMacAddress, 6);
 	
-				printk("%s: %s\n", dev->name, pAC->DeviceStr);
-				printk("      PrefPort:B  RlmtMode:Dual Check Link State\n");
+			printk("%s: %s\n", dev->name, pAC->DeviceStr);
+			printk("      PrefPort:B  RlmtMode:Dual Check Link State\n");
 			}
 		}
 
-
 		/* Save the hardware revision */
 		pAC->HWRevision = (((pAC->GIni.GIPciHwRev >> 4) & 0x0F)*10) +
 			(pAC->GIni.GIPciHwRev & 0x0F);
 
+		/* Set driver globals */
+		pAC->Pnmi.pDriverFileName    = DRIVER_FILE_NAME;
+		pAC->Pnmi.pDriverReleaseDate = DRIVER_REL_DATE;
+
+		SK_MEMSET(&(pAC->PnmiBackup), 0, sizeof(SK_PNMI_STRUCT_DATA));
+		SK_MEMCPY(&(pAC->PnmiBackup), &(pAC->PnmiStruct), 
+				sizeof(SK_PNMI_STRUCT_DATA));
+
 		/*
 		 * This is bollocks, but we need to tell the net-init
 		 * code that it shall go for the next device.
@@ -849,7 +963,6 @@
 } /* skge_probe */
 
 
-
 /*****************************************************************************
  *
  * 	SkGeInitPCI - Init the PCI resources
@@ -1161,8 +1274,7 @@
 
 #ifdef CONFIG_PROC_FS
 	/* clear proc-dir */
-	if (pSkRootDir) 
-		remove_proc_entry(pSkRootDir->name, proc_net);
+	remove_proc_entry(pSkRootDir->name, proc_net);
 #endif
 
 } /* skge_cleanup_module */
@@ -1224,7 +1336,7 @@
 	SkAddrInit( pAC, pAC->IoBase, SK_INIT_DATA);
 	SkRlmtInit( pAC, pAC->IoBase, SK_INIT_DATA);
 	SkTimerInit(pAC, pAC->IoBase, SK_INIT_DATA);
-	
+
 	pAC->BoardLevel = SK_INIT_DATA;
 	pAC->RxBufSize  = ETH_BUF_SIZE;
 
@@ -1236,7 +1348,7 @@
 	/* level 1 init common modules here (HW init) */
 	spin_lock_irqsave(&pAC->SlowPathLock, Flags);
 	if (SkGeInit(pAC, pAC->IoBase, SK_INIT_IO) != 0) {
-		printk("HWInit (1) failed.\n");
+		printk("sk98lin: HWInit (1) failed.\n");
 		spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
 		return(-EAGAIN);
 	}
@@ -1268,14 +1380,14 @@
 		Ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ,
 			pAC->Name, dev);
 	} else {
-		printk(KERN_WARNING "%s: Illegal number of ports: %d\n",
-		       dev->name, pAC->GIni.GIMacsFound);
+		printk(KERN_WARNING "sk98lin: Illegal number of ports: %d\n",
+		       pAC->GIni.GIMacsFound);
 		return -EAGAIN;
 	}
 
 	if (Ret) {
-		printk(KERN_WARNING "%s: Requested IRQ %d is busy.\n",
-		       dev->name, dev->irq);
+		printk(KERN_WARNING "sk98lin: Requested IRQ %d is busy.\n",
+		       dev->irq);
 		return -EAGAIN;
 	}
 	pAC->AllocFlag |= SK_ALLOC_IRQ;
@@ -1303,25 +1415,10 @@
 		pAC->ActivePort,
 		DualNet)) {
 		BoardFreeMem(pAC);
-		printk("SkGeInitAssignRamToQueues failed.\n");
+		printk("sk98lin: SkGeInitAssignRamToQueues failed.\n");
 		return(-EAGAIN);
 	}
 
-	/* Print adapter specific string from vpd */
-	ProductStr(pAC);
-	printk("%s: %s\n", dev->name, pAC->DeviceStr);
-
-	/* Print configuration settings */
-	printk("      PrefPort:%c  RlmtMode:%s\n",
-		'A' + pAC->Rlmt.Net[0].Port[pAC->Rlmt.Net[0].PrefPort]->PortNumber,
-		(pAC->RlmtMode==0)  ? "Check Link State" :
-		((pAC->RlmtMode==1) ? "Check Link State" :
-		((pAC->RlmtMode==3) ? "Check Local Port" :
-		((pAC->RlmtMode==7) ? "Check Segmentation" :
-		((pAC->RlmtMode==17) ? "Dual Check Link State" :"Error")))));
-
-	SkGeYellowLED(pAC, pAC->IoBase, 1);
-
 	/*
 	 * Register the device here
 	 */
@@ -1879,14 +1976,26 @@
 	SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
 		("SkGeOpen: pAC=0x%lX:\n", (unsigned long)pAC));
 
+#ifdef SK_DIAG_SUPPORT
+	if (pAC->DiagModeActive == DIAG_ACTIVE) {
+		if (pAC->Pnmi.DiagAttached == SK_DIAG_RUNNING) {
+			return (-1);   /* still in use by diag; deny actions */
+		} 
+	}
+#endif
+
+	if (!try_module_get(THIS_MODULE)) {
+		return (-1);	/* increase of usage count not possible */
+	}
 
 	/* Set blink mode */
-	if (pAC->PciDev->vendor == 0x1186)
+	if ((pAC->PciDev->vendor == 0x1186) || (pAC->PciDev->vendor == 0x11ab ))
 		pAC->GIni.GILedBlinkCtrl = OEM_CONFIG_VALUE;
 
 	if (pAC->BoardLevel == SK_INIT_DATA) {
 		/* level 1 init common modules here */
 		if (SkGeInit(pAC, pAC->IoBase, SK_INIT_IO) != 0) {
+			module_put(THIS_MODULE); /* decrease usage count */
 			printk("%s: HWInit (1) failed.\n", pAC->dev[pNet->PortNr]->name);
 			return (-1);
 		}
@@ -1902,6 +2011,7 @@
 	if (pAC->BoardLevel != SK_INIT_RUN) {
 		/* tschilling: Level 2 init modules here, check return value. */
 		if (SkGeInit(pAC, pAC->IoBase, SK_INIT_RUN) != 0) {
+			module_put(THIS_MODULE); /* decrease usage count */
 			printk("%s: HWInit (2) failed.\n", pAC->dev[pNet->PortNr]->name);
 			return (-1);
 		}
@@ -1953,7 +2063,6 @@
 	pAC->MaxPorts++;
 	pNet->Up = 1;
 
-	try_module_get(THIS_MODULE);
 
 	SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
 		("SkGeOpen suceeded\n"));
@@ -1976,26 +2085,50 @@
 static int SkGeClose(
 struct SK_NET_DEVICE	*dev)
 {
-	DEV_NET			*pNet;
-	SK_AC			*pAC;
+	DEV_NET		*pNet;
+	DEV_NET		*newPtrNet;
+	SK_AC		*pAC;
 
 	unsigned long	Flags;		/* for spin lock */
-	int				i;
-	int				PortIdx;
-	SK_EVPARA		EvPara;
+	int		i;
+	int		PortIdx;
+	SK_EVPARA	EvPara;
+
+	SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
+		("SkGeClose: pAC=0x%lX ", (unsigned long)pAC));
 
-	netif_stop_queue(dev);
 	pNet = (DEV_NET*) dev->priv;
 	pAC = pNet->pAC;
 
+#ifdef SK_DIAG_SUPPORT
+	if (pAC->DiagModeActive == DIAG_ACTIVE) {
+		if (pAC->DiagFlowCtrl == SK_FALSE) {
+			module_put(THIS_MODULE);
+			/* 
+			** notify that the interface which has been closed
+			** by operator interaction must not be started up 
+			** again when the DIAG has finished. 
+			*/
+			newPtrNet = (DEV_NET *) pAC->dev[0]->priv;
+			if (newPtrNet == pNet) {
+				pAC->WasIfUp[0] = SK_FALSE;
+			} else {
+				pAC->WasIfUp[1] = SK_FALSE;
+			}
+			return 0; /* return to system everything is fine... */
+		} else {
+			pAC->DiagFlowCtrl = SK_FALSE;
+		}
+	}
+#endif
+
+	netif_stop_queue(dev);
+
 	if (pAC->RlmtNets == 1)
 		PortIdx = pAC->ActivePort;
 	else
 		PortIdx = pNet->NetNr;
 
-	SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
-		("SkGeClose: pAC=0x%lX ", (unsigned long)pAC));
-
         StopDrvCleanupTimer(pAC);
 
 	/*
@@ -2024,6 +2157,7 @@
 		EvPara.Para32[0] = pNet->NetNr;
 		EvPara.Para32[1] = -1;
 		SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara);
+		SkPnmiEvent(pAC, pAC->IoBase, SK_PNMI_EVT_XMAC_RESET, EvPara);
 		SkEventDispatcher(pAC, pAC->IoBase);
 		spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
 		
@@ -2053,6 +2187,10 @@
 	SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
 		("SkGeClose: done "));
 
+	SK_MEMSET(&(pAC->PnmiBackup), 0, sizeof(SK_PNMI_STRUCT_DATA));
+	SK_MEMCPY(&(pAC->PnmiBackup), &(pAC->PnmiStruct), 
+			sizeof(SK_PNMI_STRUCT_DATA));
+
 	pAC->MaxPorts--;
 	pNet->Up = 0;
 
@@ -2199,9 +2337,10 @@
 	** This is to resolve faulty padding by the HW with 0xaa bytes.
 	*/
 	if (BytesSend < C_LEN_ETHERNET_MINSIZE) {
-	    skb_put(pMessage, (C_LEN_ETHERNET_MINSIZE-BytesSend));
-	    SK_MEMSET( ((char *)(pMessage->data))+BytesSend,
-	            0, C_LEN_ETHERNET_MINSIZE-BytesSend);
+		if ((pMessage = skb_padto(pMessage, C_LEN_ETHERNET_MINSIZE)) == NULL) {
+			return 0;
+		}
+		pMessage->len = C_LEN_ETHERNET_MINSIZE;
 	}
 
 	/* 
@@ -3318,6 +3457,16 @@
 		return -EINVAL;
 	}
 
+#ifdef SK_DIAG_SUPPORT
+	if (pAC->DiagModeActive == DIAG_ACTIVE) {
+		if (pAC->DiagFlowCtrl == SK_FALSE) {
+			return -1; /* still in use, deny any actions of MTU */
+		} else {
+			pAC->DiagFlowCtrl = SK_FALSE;
+		}
+	}
+#endif
+
 	pNet->Mtu = NewMtu;
 	pOtherNet = (DEV_NET*)pAC->dev[1 - pNet->NetNr]->priv;
 	if ((pOtherNet->Mtu>1500) && (NewMtu<=1500) && (pOtherNet->Up==1)) {
@@ -3537,11 +3686,20 @@
 	SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
 		("SkGeStats starts now...\n"));
 	pPnmiStruct = &pAC->PnmiStruct;
-        memset(pPnmiStruct, 0, sizeof(SK_PNMI_STRUCT_DATA));
+
+#ifdef SK_DIAG_SUPPORT
+        if ((pAC->DiagModeActive == DIAG_NOTACTIVE) &&
+                (pAC->BoardLevel == SK_INIT_RUN)) {
+#endif
+        SK_MEMSET(pPnmiStruct, 0, sizeof(SK_PNMI_STRUCT_DATA));
         spin_lock_irqsave(&pAC->SlowPathLock, Flags);
         Size = SK_PNMI_STRUCT_SIZE;
 		SkPnmiGetStruct(pAC, pAC->IoBase, pPnmiStruct, &Size, pNet->NetNr);
         spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
+#ifdef SK_DIAG_SUPPORT
+	}
+#endif
+
         pPnmiStat = &pPnmiStruct->Stat[0];
         pPnmiConf = &pPnmiStruct->Conf[0];
 
@@ -3604,7 +3762,7 @@
 DEV_NET		*pNet;
 SK_AC		*pAC;
 void		*pMemBuf;
-
+struct pci_dev  *pdev = NULL;
 SK_GE_IOCTL	Ioctl;
 unsigned int	Err = 0;
 int		Size = 0;
@@ -3671,6 +3829,45 @@
 fault_gen:
 		kfree(pMemBuf); /* cleanup everything */
 		break;
+#ifdef SK_DIAG_SUPPORT
+       case SK_IOCTL_DIAG:
+		if (!capable(CAP_NET_ADMIN)) return -EPERM;
+		if (Ioctl.Len < (sizeof(pAC->PnmiStruct) + HeaderLength)) {
+			Length = Ioctl.Len;
+		} else {
+			Length = sizeof(pAC->PnmiStruct) + HeaderLength;
+		}
+		if (NULL == (pMemBuf = kmalloc(Length, GFP_KERNEL))) {
+			return -ENOMEM;
+		}
+		if(copy_from_user(pMemBuf, Ioctl.pData, Length)) {
+			Err = -EFAULT;
+			goto fault_diag;
+		}
+		pdev = pAC->PciDev;
+		Length = 3 * sizeof(SK_U32);  /* Error, Bus and Device */
+		/* 
+		** While coding this new IOCTL interface, only a few lines of code
+		** are to to be added. Therefore no dedicated function has been 
+		** added. If more functionality is added, a separate function 
+		** should be used...
+		*/
+		* ((SK_U32 *)pMemBuf) = 0;
+		* ((SK_U32 *)pMemBuf + 1) = pdev->bus->number;
+		* ((SK_U32 *)pMemBuf + 2) = ParseDeviceNbrFromSlotName(pdev->slot_name);
+		if(copy_to_user(Ioctl.pData, pMemBuf, Length) ) {
+			Err = -EFAULT;
+			goto fault_diag;
+		}
+		Ioctl.Len = Length;
+		if(copy_to_user(rq->ifr_data, &Ioctl, sizeof(SK_GE_IOCTL))) {
+			Err = -EFAULT;
+			goto fault_diag;
+		}
+fault_diag:
+		kfree(pMemBuf); /* cleanup everything */
+		break;
+#endif
 	default:
 		Err = -EOPNOTSUPP;
 	}
@@ -3826,10 +4023,9 @@
 				(strcmp(ConType[pAC->Index],"Auto")!=0) &&
 				(strcmp(ConType[pAC->Index],"")!=0)) {
 				/* Set the speed parameter back */
-					printk("%s: Illegal value \"%s\" " 
+					printk("sk98lin: Illegal value \"%s\" " 
 							"for ConType."
 							" Using Auto.\n", 
-							pAC->dev[0]->name, 
 							ConType[pAC->Index]);
 
 					sprintf(ConType[pAC->Index], "Auto");	
@@ -3873,8 +4069,8 @@
 			M_CurrPort.PLinkSpeed    = SK_LSPEED_10MBPS;
 		    }
                 } else { 
-		    printk("%s: Illegal value \"%s\" for ConType\n", 
-			pAC->dev[0]->name, ConType[pAC->Index]);
+		    printk("sk98lin: Illegal value \"%s\" for ConType\n", 
+			ConType[pAC->Index]);
 		    IsConTypeDefined = SK_FALSE; /* Wrong ConType defined */
 		}
         } else {
@@ -3898,8 +4094,8 @@
 		} else if (strcmp(Speed_A[pAC->Index],"1000")==0) {
 		    LinkSpeed = SK_LSPEED_1000MBPS;
 		} else {
-		    printk("%s: Illegal value \"%s\" for Speed_A\n",
-			pAC->dev[0]->name, Speed_A[pAC->Index]);
+		    printk("sk98lin: Illegal value \"%s\" for Speed_A\n",
+			Speed_A[pAC->Index]);
 		    IsLinkSpeedDefined = SK_FALSE;
 		}
 	} else {
@@ -3913,9 +4109,9 @@
 	if (((!pAC->ChipsetType) || (pAC->GIni.GICopperType != SK_TRUE)) &&
 		((LinkSpeed != SK_LSPEED_AUTO) &&
 		(LinkSpeed != SK_LSPEED_1000MBPS))) {
-		printk("%s: Illegal value for Speed_A. "
+		printk("sk98lin: Illegal value for Speed_A. "
 			"Not a copper card or GE V2 card\n    Using "
-			"speed 1000\n", pAC->dev[0]->name);
+			"speed 1000\n");
 		LinkSpeed = SK_LSPEED_1000MBPS;
 	}
 	
@@ -3945,8 +4141,8 @@
 		} else if (strcmp(AutoNeg_A[pAC->Index],"Sense")==0) {
 		    AutoNeg = AN_SENS;
 		} else {
-		    printk("%s: Illegal value \"%s\" for AutoNeg_A\n",
-			pAC->dev[0]->name, AutoNeg_A[pAC->Index]);
+		    printk("sk98lin: Illegal value \"%s\" for AutoNeg_A\n",
+			AutoNeg_A[pAC->Index]);
 		}
 	}
 
@@ -3964,33 +4160,32 @@
 		} else if (strcmp(DupCap_A[pAC->Index],"Half")==0) {
 		    DuplexCap = DC_HALF;
 		} else {
-		    printk("%s: Illegal value \"%s\" for DupCap_A\n",
-			pAC->dev[0]->name, DupCap_A[pAC->Index]);
+		    printk("sk98lin: Illegal value \"%s\" for DupCap_A\n",
+			DupCap_A[pAC->Index]);
 		}
 	}
-	
+
 	/* 
 	** Check for illegal combinations 
 	*/
-	if ((LinkSpeed = SK_LSPEED_1000MBPS) &&
+	if ((LinkSpeed == SK_LSPEED_1000MBPS) &&
 		((DuplexCap == SK_LMODE_STAT_AUTOHALF) ||
 		(DuplexCap == SK_LMODE_STAT_HALF)) &&
 		(pAC->ChipsetType)) {
-		    printk("%s: Half Duplex not possible with Gigabit speed!\n"
-					"    Using Full Duplex.\n",
-				pAC->dev[0]->name);
+		    printk("sk98lin: Half Duplex not possible with Gigabit speed!\n"
+					"    Using Full Duplex.\n");
 				DuplexCap = DC_FULL;
 	}
 
 	if ( AutoSet && AutoNeg==AN_SENS && DupSet) {
-		printk("%s, Port A: DuplexCapabilities"
-			" ignored using Sense mode\n", pAC->dev[0]->name);
+		printk("sk98lin, Port A: DuplexCapabilities"
+			" ignored using Sense mode\n");
 	}
 
 	if (AutoSet && AutoNeg==AN_OFF && DupSet && DuplexCap==DC_BOTH){
-		printk("%s, Port A: Illegal combination"
+		printk("sk98lin: Port A: Illegal combination"
 			" of values AutoNeg. and DuplexCap.\n    Using "
-			"Full Duplex\n", pAC->dev[0]->name);
+			"Full Duplex\n");
 		DuplexCap = DC_FULL;
 	}
 
@@ -3999,10 +4194,9 @@
 	}
 	
 	if (!AutoSet && DupSet) {
-		printk("%s, Port A: Duplex setting not"
+		printk("sk98lin: Port A: Duplex setting not"
 			" possible in\n    default AutoNegotiation mode"
-			" (Sense).\n    Using AutoNegotiation On\n",
-			pAC->dev[0]->name);
+			" (Sense).\n    Using AutoNegotiation On\n");
 		AutoNeg = AN_ON;
 	}
 	
@@ -4029,8 +4223,8 @@
 		} else if (strcmp(FlowCtrl_A[pAC->Index],"None")==0) {
 		    FlowCtrl = SK_FLOW_MODE_NONE;
 		} else {
-		    printk("%s: Illegal value \"%s\" for FlowCtrl_A\n",
-                        pAC->dev[0]->name, FlowCtrl_A[pAC->Index]);
+		    printk("sk98lin: Illegal value \"%s\" for FlowCtrl_A\n",
+                        FlowCtrl_A[pAC->Index]);
 		    IsFlowCtrlDefined = SK_FALSE;
 		}
 	} else {
@@ -4039,9 +4233,9 @@
 
 	if (IsFlowCtrlDefined) {
 	    if ((AutoNeg == AN_OFF) && (FlowCtrl != SK_FLOW_MODE_NONE)) {
-		printk("%s, Port A: FlowControl"
+		printk("sk98lin: Port A: FlowControl"
 			" impossible without AutoNegotiation,"
-			" disabled\n", pAC->dev[0]->name);
+			" disabled\n");
 		FlowCtrl = SK_FLOW_MODE_NONE;
 	    }
 	    pAC->GIni.GP[0].PFlowCtrlMode = FlowCtrl;
@@ -4061,8 +4255,8 @@
 		} else if (strcmp(Role_A[pAC->Index],"Slave")==0) {
 		    MSMode = SK_MS_MODE_SLAVE;
 		} else {
-		    printk("%s: Illegal value \"%s\" for Role_A\n",
-			pAC->dev[0]->name, Role_A[pAC->Index]);
+		    printk("sk98lin: Illegal value \"%s\" for Role_A\n",
+			Role_A[pAC->Index]);
 		    IsRoleDefined = SK_FALSE;
 		}
 	} else {
@@ -4097,8 +4291,8 @@
 		} else if (strcmp(Speed_B[pAC->Index],"1000")==0) {
 		    LinkSpeed = SK_LSPEED_1000MBPS;
 		} else {
-		    printk("%s: Illegal value \"%s\" for Speed_B\n",
-			pAC->dev[1]->name, Speed_B[pAC->Index]);
+		    printk("sk98lin: Illegal value \"%s\" for Speed_B\n",
+			Speed_B[pAC->Index]);
 		    IsLinkSpeedDefined = SK_FALSE;
 		}
 	} else {
@@ -4112,9 +4306,9 @@
 	if (((!pAC->ChipsetType) || (pAC->GIni.GICopperType != SK_TRUE)) &&
 		((LinkSpeed != SK_LSPEED_AUTO) &&
 		(LinkSpeed != SK_LSPEED_1000MBPS))) {
-		printk("%s: Illegal value for Speed_B. "
+		printk("sk98lin: Illegal value for Speed_B. "
 			"Not a copper card or GE V2 card\n    Using "
-			"speed 1000\n", pAC->dev[1]->name);
+			"speed 1000\n");
 		LinkSpeed = SK_LSPEED_1000MBPS;
 	}
 
@@ -4144,8 +4338,8 @@
 		} else if (strcmp(AutoNeg_B[pAC->Index],"Sense")==0) {
 		    AutoNeg = AN_SENS;
 		} else {
-		    printk("%s: Illegal value \"%s\" for AutoNeg_B\n",
-			pAC->dev[0]->name, AutoNeg_B[pAC->Index]);
+		    printk("sk98lin: Illegal value \"%s\" for AutoNeg_B\n",
+			AutoNeg_B[pAC->Index]);
 		}
 	}
 
@@ -4163,8 +4357,8 @@
 		} else if (strcmp(DupCap_B[pAC->Index],"Half")==0) {
 		    DuplexCap = DC_HALF;
 		} else {
-		    printk("%s: Illegal value \"%s\" for DupCap_B\n",
-			pAC->dev[0]->name, DupCap_B[pAC->Index]);
+		    printk("sk98lin: Illegal value \"%s\" for DupCap_B\n",
+			DupCap_B[pAC->Index]);
 		}
 	}
 
@@ -4172,25 +4366,24 @@
 	/* 
 	** Check for illegal combinations 
 	*/
-	if ((LinkSpeed = SK_LSPEED_1000MBPS) &&
+	if ((LinkSpeed == SK_LSPEED_1000MBPS) &&
 		((DuplexCap == SK_LMODE_STAT_AUTOHALF) ||
 		(DuplexCap == SK_LMODE_STAT_HALF)) &&
 		(pAC->ChipsetType)) {
-		    printk("%s: Half Duplex not possible with Gigabit speed!\n"
-					"    Using Full Duplex.\n",
-				pAC->dev[1]->name);
+		    printk("sk98lin: Half Duplex not possible with Gigabit speed!\n"
+					"    Using Full Duplex.\n");
 				DuplexCap = DC_FULL;
 	}
 
 	if (AutoSet && AutoNeg==AN_SENS && DupSet) {
-		printk("%s, Port B: DuplexCapabilities"
-			" ignored using Sense mode\n", pAC->dev[1]->name);
+		printk("sk98lin, Port B: DuplexCapabilities"
+			" ignored using Sense mode\n");
 	}
 
 	if (AutoSet && AutoNeg==AN_OFF && DupSet && DuplexCap==DC_BOTH){
-		printk("%s, Port B: Illegal combination"
+		printk("sk98lin: Port B: Illegal combination"
 			" of values AutoNeg. and DuplexCap.\n    Using "
-			"Full Duplex\n", pAC->dev[1]->name);
+			"Full Duplex\n");
 		DuplexCap = DC_FULL;
 	}
 
@@ -4199,10 +4392,9 @@
 	}
 	
 	if (!AutoSet && DupSet) {
-		printk("%s, Port B: Duplex setting not"
+		printk("sk98lin: Port B: Duplex setting not"
 			" possible in\n    default AutoNegotiation mode"
-			" (Sense).\n    Using AutoNegotiation On\n",
-			pAC->dev[1]->name);
+			" (Sense).\n    Using AutoNegotiation On\n");
 		AutoNeg = AN_ON;
 	}
 
@@ -4229,8 +4421,8 @@
 		} else if (strcmp(FlowCtrl_B[pAC->Index],"None")==0) {
 		    FlowCtrl = SK_FLOW_MODE_NONE;
 		} else {
-		    printk("%s: Illegal value \"%s\" for FlowCtrl_B\n",
-			pAC->dev[0]->name, FlowCtrl_B[pAC->Index]);
+		    printk("sk98lin: Illegal value \"%s\" for FlowCtrl_B\n",
+			FlowCtrl_B[pAC->Index]);
 		    IsFlowCtrlDefined = SK_FALSE;
 		}
 	} else {
@@ -4239,9 +4431,9 @@
 
 	if (IsFlowCtrlDefined) {
 	    if ((AutoNeg == AN_OFF) && (FlowCtrl != SK_FLOW_MODE_NONE)) {
-		printk("%s, Port B: FlowControl"
+		printk("sk98lin: Port B: FlowControl"
 			" impossible without AutoNegotiation,"
-			" disabled\n", pAC->dev[1]->name);
+			" disabled\n");
 		FlowCtrl = SK_FLOW_MODE_NONE;
 	    }
 	    pAC->GIni.GP[1].PFlowCtrlMode = FlowCtrl;
@@ -4261,8 +4453,8 @@
 		} else if (strcmp(Role_B[pAC->Index],"Slave")==0) {
 		    MSMode = SK_MS_MODE_SLAVE;
 		} else {
-		    printk("%s: Illegal value \"%s\" for Role_B\n",
-			pAC->dev[1]->name, Role_B[pAC->Index]);
+		    printk("sk98lin: Illegal value \"%s\" for Role_B\n",
+			Role_B[pAC->Index]);
 		    IsRoleDefined = SK_FALSE;
 		}
 	} else {
@@ -4280,28 +4472,37 @@
 	if (PrefPort != NULL && pAC->Index<SK_MAX_CARD_PARAM &&
 		PrefPort[pAC->Index] != NULL) {
 		if (strcmp(PrefPort[pAC->Index],"") == 0) { /* Auto */
-		    pAC->ActivePort             =  0;
-		    pAC->Rlmt.Net[0].Preference = -1; /* auto */
-		    pAC->Rlmt.Net[0].PrefPort   =  0;
+			pAC->ActivePort             =  0;
+			pAC->Rlmt.Net[0].Preference = -1; /* auto */
+			pAC->Rlmt.Net[0].PrefPort   =  0;
 		} else if (strcmp(PrefPort[pAC->Index],"A") == 0) {
-		    /*
-		    ** do not set ActivePort here, thus a port
-		    ** switch is issued after net up.
-		    */
-		    Port                        = 0;
-		    pAC->Rlmt.Net[0].Preference = Port;
-		    pAC->Rlmt.Net[0].PrefPort   = Port;
+			/*
+			** do not set ActivePort here, thus a port
+			** switch is issued after net up.
+			*/
+			Port                        = 0;
+			pAC->Rlmt.Net[0].Preference = Port;
+			pAC->Rlmt.Net[0].PrefPort   = Port;
 		} else if (strcmp(PrefPort[pAC->Index],"B") == 0) {
-		    /*
-		    ** do not set ActivePort here, thus a port
-		    ** switch is issued after net up.
-		    */
-		    Port                        = 1;
-		    pAC->Rlmt.Net[0].Preference = Port;
-		    pAC->Rlmt.Net[0].PrefPort   = Port;
+			/*
+			** do not set ActivePort here, thus a port
+			** switch is issued after net up.
+			*/
+			if (pAC->GIni.GIMacsFound == 1) {
+				printk("sk98lin: Illegal value \"B\" for PrefPort.\n"
+					"      Port B not available on single port adapters.\n");
+
+				pAC->ActivePort             =  0;
+				pAC->Rlmt.Net[0].Preference = -1; /* auto */
+				pAC->Rlmt.Net[0].PrefPort   =  0;
+			} else {
+				Port                        = 1;
+				pAC->Rlmt.Net[0].Preference = Port;
+				pAC->Rlmt.Net[0].PrefPort   = Port;
+			}
 		} else {
-		    printk("%s: Illegal value \"%s\" for PrefPort\n",
-			pAC->dev[0]->name, PrefPort[pAC->Index]);
+		    printk("sk98lin: Illegal value \"%s\" for PrefPort\n",
+			PrefPort[pAC->Index]);
 		}
 	}
 
@@ -4325,9 +4526,9 @@
 			pAC->RlmtMode = SK_RLMT_CHECK_LINK;
 			pAC->RlmtNets = 2;
 		} else {
-		    printk("%s: Illegal value \"%s\" for"
+		    printk("sk98lin: Illegal value \"%s\" for"
 			" RlmtMode, using default\n", 
-			pAC->dev[0]->name, RlmtMode[pAC->Index]);
+			RlmtMode[pAC->Index]);
 			pAC->RlmtMode = 0;
 		}
 	} else {
@@ -4338,97 +4539,111 @@
 	** Check the interrupt moderation parameters
 	*/
 	if (Moderation[pAC->Index] != NULL) {
-	    if (strcmp(Moderation[pAC->Index], "Static") == 0) {
-                pAC->DynIrqModInfo.IntModTypeSelect = C_INT_MOD_STATIC;
-	    } else if (strcmp(Moderation[pAC->Index], "Dynamic") == 0) {
-	        pAC->DynIrqModInfo.IntModTypeSelect = C_INT_MOD_DYNAMIC;
-	    } else {
-	        pAC->DynIrqModInfo.IntModTypeSelect = C_INT_MOD_NONE;
-	    }
+		if (strcmp(Moderation[pAC->Index], "") == 0) {
+			pAC->DynIrqModInfo.IntModTypeSelect = C_INT_MOD_NONE;
+		} else if (strcmp(Moderation[pAC->Index], "Static") == 0) {
+			pAC->DynIrqModInfo.IntModTypeSelect = C_INT_MOD_STATIC;
+		} else if (strcmp(Moderation[pAC->Index], "Dynamic") == 0) {
+			pAC->DynIrqModInfo.IntModTypeSelect = C_INT_MOD_DYNAMIC;
+		} else if (strcmp(Moderation[pAC->Index], "None") == 0) {
+			pAC->DynIrqModInfo.IntModTypeSelect = C_INT_MOD_NONE;
+		} else {
+	   		printk("sk98lin: Illegal value \"%s\" for Moderation.\n"
+				"      Disable interrupt moderation.\n",
+				Moderation[pAC->Index]);
+			pAC->DynIrqModInfo.IntModTypeSelect = C_INT_MOD_NONE;
+		}
 	} else {
-	    pAC->DynIrqModInfo.IntModTypeSelect = C_INT_MOD_NONE;
+		pAC->DynIrqModInfo.IntModTypeSelect = C_INT_MOD_NONE;
 	}
 
 	if (Stats[pAC->Index] != NULL) {
-	    if (strcmp(Stats[pAC->Index], "Yes") == 0) {
-	        pAC->DynIrqModInfo.DisplayStats = SK_TRUE;
-	    } else {
-		pAC->DynIrqModInfo.DisplayStats = SK_FALSE;
-	    }
+		if (strcmp(Stats[pAC->Index], "Yes") == 0) {
+			pAC->DynIrqModInfo.DisplayStats = SK_TRUE;
+		} else {
+			pAC->DynIrqModInfo.DisplayStats = SK_FALSE;
+		}
 	} else {
-	    pAC->DynIrqModInfo.DisplayStats = SK_FALSE;
+		pAC->DynIrqModInfo.DisplayStats = SK_FALSE;
 	}
 
-        if (ModerationMask[pAC->Index] != NULL) {
-           if (strcmp(ModerationMask[pAC->Index], "Rx") == 0) {
-               pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_ONLY;
-           } else if (strcmp(ModerationMask[pAC->Index], "Tx") == 0) {
-               pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_TX_ONLY;
-           } else if (strcmp(ModerationMask[pAC->Index], "Sp") == 0) {
-               pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_SP_ONLY;
-           } else if (strcmp(ModerationMask[pAC->Index], "RxSp") == 0) {
-               pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_SP_RX;
-           } else if (strcmp(ModerationMask[pAC->Index], "SpRx") == 0) {
-               pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_SP_RX;
-           } else if (strcmp(ModerationMask[pAC->Index], "RxTx") == 0) {
-               pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_TX_RX;
-           } else if (strcmp(ModerationMask[pAC->Index], "TxRx") == 0) {
-               pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_TX_RX;
-           } else if (strcmp(ModerationMask[pAC->Index], "TxSp") == 0) {
-               pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_SP_TX;
-           } else if (strcmp(ModerationMask[pAC->Index], "SpTx") == 0) {
-               pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_SP_TX;
-           } else if (strcmp(ModerationMask[pAC->Index], "RxTxSp") == 0) {
-               pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_TX_SP;
-           } else if (strcmp(ModerationMask[pAC->Index], "RxSpTx") == 0) {
-               pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_TX_SP;
-           } else if (strcmp(ModerationMask[pAC->Index], "TxRxSp") == 0) {
-               pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_TX_SP;
-           } else if (strcmp(ModerationMask[pAC->Index], "TxSpRx") == 0) {
-               pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_TX_SP;
-           } else if (strcmp(ModerationMask[pAC->Index], "SpTxRx") == 0) {
-               pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_TX_SP;
-           } else if (strcmp(ModerationMask[pAC->Index], "SpRxTx") == 0) {
-               pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_TX_SP;
-           } else { /* some rubbish */
-               pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_ONLY;
-           }
-        } else {  /* operator has stated nothing */
-           pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_TX_RX;
-        }
-
-        if (AutoSizing[pAC->Index] != NULL) {
-           if (strcmp(AutoSizing[pAC->Index], "On") == 0) {
-               pAC->DynIrqModInfo.AutoSizing = SK_FALSE;
-           } else {
-               pAC->DynIrqModInfo.AutoSizing = SK_FALSE;
-           }
-        } else {  /* operator has stated nothing */
-           pAC->DynIrqModInfo.AutoSizing = SK_FALSE;
-        }
+	if (ModerationMask[pAC->Index] != NULL) {
+		if (strcmp(ModerationMask[pAC->Index], "Rx") == 0) {
+			pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_ONLY;
+		} else if (strcmp(ModerationMask[pAC->Index], "Tx") == 0) {
+			pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_TX_ONLY;
+		} else if (strcmp(ModerationMask[pAC->Index], "Sp") == 0) {
+			pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_SP_ONLY;
+		} else if (strcmp(ModerationMask[pAC->Index], "RxSp") == 0) {
+			pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_SP_RX;
+		} else if (strcmp(ModerationMask[pAC->Index], "SpRx") == 0) {
+			pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_SP_RX;
+		} else if (strcmp(ModerationMask[pAC->Index], "RxTx") == 0) {
+			pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_TX_RX;
+		} else if (strcmp(ModerationMask[pAC->Index], "TxRx") == 0) {
+			pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_TX_RX;
+		} else if (strcmp(ModerationMask[pAC->Index], "TxSp") == 0) {
+			pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_SP_TX;
+		} else if (strcmp(ModerationMask[pAC->Index], "SpTx") == 0) {
+			pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_SP_TX;
+		} else if (strcmp(ModerationMask[pAC->Index], "RxTxSp") == 0) {
+			pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_TX_SP;
+		} else if (strcmp(ModerationMask[pAC->Index], "RxSpTx") == 0) {
+			pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_TX_SP;
+		} else if (strcmp(ModerationMask[pAC->Index], "TxRxSp") == 0) {
+			pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_TX_SP;
+		} else if (strcmp(ModerationMask[pAC->Index], "TxSpRx") == 0) {
+			pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_TX_SP;
+		} else if (strcmp(ModerationMask[pAC->Index], "SpTxRx") == 0) {
+			pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_TX_SP;
+		} else if (strcmp(ModerationMask[pAC->Index], "SpRxTx") == 0) {
+			pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_TX_SP;
+		} else { /* some rubbish */
+			pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_ONLY;
+		}
+	} else {  /* operator has stated nothing */
+		pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_TX_RX;
+	}
+
+	if (AutoSizing[pAC->Index] != NULL) {
+		if (strcmp(AutoSizing[pAC->Index], "On") == 0) {
+			pAC->DynIrqModInfo.AutoSizing = SK_FALSE;
+		} else {
+			pAC->DynIrqModInfo.AutoSizing = SK_FALSE;
+		}
+	} else {  /* operator has stated nothing */
+		pAC->DynIrqModInfo.AutoSizing = SK_FALSE;
+	}
 
-        if (IntsPerSec[pAC->Index] != 0) {
-           if ((IntsPerSec[pAC->Index]< 30) || (IntsPerSec[pAC->Index]> 40000)) {
-              pAC->DynIrqModInfo.MaxModIntsPerSec = C_INTS_PER_SEC_DEFAULT;
-           } else {
-              pAC->DynIrqModInfo.MaxModIntsPerSec = IntsPerSec[pAC->Index];
-           }
-        } else {
-           pAC->DynIrqModInfo.MaxModIntsPerSec = C_INTS_PER_SEC_DEFAULT;
-        }
+	if (IntsPerSec[pAC->Index] != 0) {
+		if ((IntsPerSec[pAC->Index]< C_INT_MOD_IPS_LOWER_RANGE) || 
+			(IntsPerSec[pAC->Index] > C_INT_MOD_IPS_UPPER_RANGE)) {
+	   		printk("sk98lin: Illegal value \"%d\" for IntsPerSec. (Range: %d - %d)\n"
+				"      Using default value of %i.\n", 
+				IntsPerSec[pAC->Index],
+				C_INT_MOD_IPS_LOWER_RANGE,
+				C_INT_MOD_IPS_UPPER_RANGE,
+				C_INTS_PER_SEC_DEFAULT);
+			pAC->DynIrqModInfo.MaxModIntsPerSec = C_INTS_PER_SEC_DEFAULT;
+		} else {
+			pAC->DynIrqModInfo.MaxModIntsPerSec = IntsPerSec[pAC->Index];
+		}
+	} else {
+		pAC->DynIrqModInfo.MaxModIntsPerSec = C_INTS_PER_SEC_DEFAULT;
+	}
 
-        /*
+	/*
 	** Evaluate upper and lower moderation threshold
 	*/
-        pAC->DynIrqModInfo.MaxModIntsPerSecUpperLimit =
-            pAC->DynIrqModInfo.MaxModIntsPerSec +
-            (pAC->DynIrqModInfo.MaxModIntsPerSec / 2);
-
-        pAC->DynIrqModInfo.MaxModIntsPerSecLowerLimit =
-            pAC->DynIrqModInfo.MaxModIntsPerSec -
-            (pAC->DynIrqModInfo.MaxModIntsPerSec / 2);
+	pAC->DynIrqModInfo.MaxModIntsPerSecUpperLimit =
+		pAC->DynIrqModInfo.MaxModIntsPerSec +
+		(pAC->DynIrqModInfo.MaxModIntsPerSec / 2);
+
+	pAC->DynIrqModInfo.MaxModIntsPerSecLowerLimit =
+		pAC->DynIrqModInfo.MaxModIntsPerSec -
+		(pAC->DynIrqModInfo.MaxModIntsPerSec / 2);
 
-        pAC->DynIrqModInfo.PrevTimeVal = jiffies;  /* initial value */
+	pAC->DynIrqModInfo.PrevTimeVal = jiffies;  /* initial value */
 
 
 } /* GetConfiguration */
@@ -4791,6 +5006,7 @@
 		spin_lock_irqsave(
 			&pAC->TxPort[FromPort][TX_PRIO_LOW].TxDesRingLock,
 			Flags);
+
 		SkGeStopPort(pAC, IoC, FromPort, SK_STOP_ALL, SK_HARD_RST);
 		pAC->dev[Param.Para32[0]]->flags &= ~IFF_RUNNING;
 		spin_unlock_irqrestore(
@@ -4826,6 +5042,10 @@
 		FromPort = Param.Para32[0];
 		SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT,
 			("NET UP EVENT, Port: %d ", Param.Para32[0]));
+		/* Mac update */
+		SkAddrMcUpdate(pAC,IoC, FromPort);
+
+		if (DoPrintInterfaceChange) {
 		printk("%s: network connection up using"
 			" port %c\n", pAC->dev[Param.Para32[0]]->name, 'A'+Param.Para32[0]);
 
@@ -4841,8 +5061,6 @@
 			printk("    speed:           unknown\n");
 		}
 
-		/* Mac update */
-		SkAddrMcUpdate(pAC,IoC, FromPort);
 
 		Stat = pAC->GIni.GP[FromPort].PLinkModeStatus;
 		if (Stat == SK_LMODE_STAT_AUTOHALF ||
@@ -4920,6 +5138,9 @@
 			printk("    rx-checksum:     disabled\n");
 #endif
 
+		} else {
+                        DoPrintInterfaceChange = SK_TRUE;
+                }
 	
 		if ((Param.Para32[0] != pAC->ActivePort) &&
 			(pAC->RlmtNets == 1)) {
@@ -4937,7 +5158,12 @@
 		/* action list 7 */
 		SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT,
 			("NET DOWN EVENT "));
-		printk("%s: network connection down\n", pAC->dev[Param.Para32[1]]->name);
+		if (DoPrintInterfaceChange) {
+			printk("%s: network connection down\n", 
+				pAC->dev[Param.Para32[1]]->name);
+		} else {
+			DoPrintInterfaceChange = SK_TRUE;
+		}
 		pAC->dev[Param.Para32[1]]->flags &= ~IFF_RUNNING;
 		break;
 	case SK_DRV_SWITCH_HARD: /* SK_U32 FromPortIdx SK_U32 ToPortIdx */
@@ -5121,6 +5347,231 @@
 		ClassStr, ErrNum, pErrorMsg);
 
 } /* SkErrorLog */
+
+#ifdef SK_DIAG_SUPPORT
+
+/*****************************************************************************
+ *
+ *	SkDrvEnterDiagMode - handles DIAG attach request
+ *
+ * Description:
+ *	Notify the kernel to NOT access the card any longer due to DIAG
+ *	Deinitialize the Card
+ *
+ * Returns:
+ *	int
+ */
+int SkDrvEnterDiagMode(
+SK_AC   *pAc)   /* pointer to adapter context */
+{
+	SK_AC   *pAC  = NULL;
+	DEV_NET *pNet = NULL;
+
+	pNet = (DEV_NET *) pAc->dev[0]->priv;
+	pAC = pNet->pAC;
+
+	SK_MEMCPY(&(pAc->PnmiBackup), &(pAc->PnmiStruct), 
+			sizeof(SK_PNMI_STRUCT_DATA));
+
+	pAC->DiagModeActive = DIAG_ACTIVE;
+	if (pAC->BoardLevel > SK_INIT_DATA) {
+		if (pNet->Up) {
+			pAC->WasIfUp[0] = SK_TRUE;
+			pAC->DiagFlowCtrl = SK_TRUE; /* for SkGeClose      */
+			DoPrintInterfaceChange = SK_FALSE;
+			SkDrvDeInitAdapter(pAC, 0);  /* performs SkGeClose */
+		} else {
+			pAC->WasIfUp[0] = SK_FALSE;
+		}
+		if (pNet != (DEV_NET *) pAc->dev[1]->priv) {
+			pNet = (DEV_NET *) pAc->dev[1]->priv;
+			if (pNet->Up) {
+				pAC->WasIfUp[1] = SK_TRUE;
+				pAC->DiagFlowCtrl = SK_TRUE; /* for SkGeClose */
+				DoPrintInterfaceChange = SK_FALSE;
+				SkDrvDeInitAdapter(pAC, 1);  /* do SkGeClose  */
+			} else {
+				pAC->WasIfUp[1] = SK_FALSE;
+			}
+		}
+		pAC->BoardLevel = SK_INIT_DATA;
+	}
+	return(0);
+}
+
+/*****************************************************************************
+ *
+ *	SkDrvLeaveDiagMode - handles DIAG detach request
+ *
+ * Description:
+ *	Notify the kernel to may access the card again after use by DIAG
+ *	Initialize the Card
+ *
+ * Returns:
+ * 	int
+ */
+int SkDrvLeaveDiagMode(
+SK_AC   *pAc)   /* pointer to adapter control context */
+{ 
+	SK_MEMCPY(&(pAc->PnmiStruct), &(pAc->PnmiBackup), 
+			sizeof(SK_PNMI_STRUCT_DATA));
+	pAc->DiagModeActive    = DIAG_NOTACTIVE;
+	pAc->Pnmi.DiagAttached = SK_DIAG_IDLE;
+        if (pAc->WasIfUp[0] == SK_TRUE) {
+                pAc->DiagFlowCtrl = SK_TRUE; /* for SkGeClose */
+		DoPrintInterfaceChange = SK_FALSE;
+                SkDrvInitAdapter(pAc, 0);    /* first device  */
+        }
+        if (pAc->WasIfUp[1] == SK_TRUE) {
+                pAc->DiagFlowCtrl = SK_TRUE; /* for SkGeClose */
+		DoPrintInterfaceChange = SK_FALSE;
+                SkDrvInitAdapter(pAc, 1);    /* second device */
+        }
+	return(0);
+}
+
+/*****************************************************************************
+ *
+ *	ParseDeviceNbrFromSlotName - Evaluate PCI device number
+ *
+ * Description:
+ * 	This function parses the PCI slot name information string and will
+ *	retrieve the devcie number out of it. The slot_name maintianed by
+ *	linux is in the form of '02:0a.0', whereas the first two characters 
+ *	represent the bus number in hex (in the sample above this is 
+ *	pci bus 0x02) and the next two characters the device number (0x0a).
+ *
+ * Returns:
+ *	SK_U32: The device number from the PCI slot name
+ */ 
+
+static SK_U32 ParseDeviceNbrFromSlotName(
+const char *SlotName)   /* pointer to pci slot name eg. '02:0a.0' */
+{
+	char	*CurrCharPos	= (char *) SlotName;
+	int	FirstNibble	= -1;
+	int	SecondNibble	= -1;
+	SK_U32	Result		=  0;
+
+	while (*CurrCharPos != '\0') {
+		if (*CurrCharPos == ':') { 
+			while (*CurrCharPos != '.') {
+				CurrCharPos++;  
+				if (	(*CurrCharPos >= '0') && 
+					(*CurrCharPos <= '9')) {
+					if (FirstNibble == -1) {
+						/* dec. value for '0' */
+						FirstNibble = *CurrCharPos - 48;
+					} else {
+						SecondNibble = *CurrCharPos - 48;
+					}  
+				} else if (	(*CurrCharPos >= 'a') && 
+						(*CurrCharPos <= 'f')  ) {
+					if (FirstNibble == -1) {
+						FirstNibble = *CurrCharPos - 87; 
+					} else {
+						SecondNibble = *CurrCharPos - 87; 
+					}
+				} else {
+					Result = 0;
+				}
+			}
+
+			Result = FirstNibble;
+			Result = Result << 4; /* first nibble is higher one */
+			Result = Result | SecondNibble;
+		}
+		CurrCharPos++;   /* next character */
+	}
+	return (Result);
+}
+
+/****************************************************************************
+ *
+ *	SkDrvDeInitAdapter - deinitialize adapter (this function is only 
+ *				called if Diag attaches to that card)
+ *
+ * Description:
+ *	Close initialized adapter.
+ *
+ * Returns:
+ *	0 - on success
+ *	error code - on error
+ */
+static int SkDrvDeInitAdapter(
+SK_AC   *pAC,		/* pointer to adapter context   */
+int      devNbr)	/* what device is to be handled */
+{
+	struct SK_NET_DEVICE *dev;
+
+	dev = pAC->dev[devNbr];
+
+	/*
+	** Function SkGeClose() uses MOD_DEC_USE_COUNT (2.2/2.4)
+	** or module_put() (2.6) to decrease the number of users for
+	** a device, but if a device is to be put under control of 
+	** the DIAG, that count is OK already and does not need to 
+	** be adapted! Hence the opposite MOD_INC_USE_COUNT or 
+	** try_module_get() needs to be used again to correct that.
+	*/
+	if (!try_module_get(THIS_MODULE)) {
+		return (-1);
+	}
+
+	if (SkGeClose(dev) != 0) {
+		module_put(THIS_MODULE);
+		return (-1);
+	}
+	return (0);
+
+} /* SkDrvDeInitAdapter() */
+
+/****************************************************************************
+ *
+ *	SkDrvInitAdapter - Initialize adapter (this function is only 
+ *				called if Diag deattaches from that card)
+ *
+ * Description:
+ *	Close initialized adapter.
+ *
+ * Returns:
+ *	0 - on success
+ *	error code - on error
+ */
+static int SkDrvInitAdapter(
+SK_AC   *pAC,		/* pointer to adapter context   */
+int      devNbr)	/* what device is to be handled */
+{
+	struct SK_NET_DEVICE *dev;
+
+	dev = pAC->dev[devNbr];
+
+	if (SkGeOpen(dev) != 0) {
+		return (-1);
+	} else {
+		/*
+		** Function SkGeOpen() uses MOD_INC_USE_COUNT (2.2/2.4) 
+		** or try_module_get() (2.6) to increase the number of 
+		** users for a device, but if a device was just under 
+		** control of the DIAG, that count is OK already and 
+		** does not need to be adapted! Hence the opposite 
+		** MOD_DEC_USE_COUNT or module_put() needs to be used 
+		** again to correct that.
+		*/
+		module_put(THIS_MODULE);
+	}
+
+	/*
+	** Use correct MTU size and indicate to kernel TX queue can be started
+	*/ 
+	if (SkGeChangeMtu(dev, dev->mtu) != 0) {
+		return (-1);
+	} 
+	return (0);
+
+} /* SkDrvInitAdapter */
+
+#endif
 
 #ifdef DEBUG
 /****************************************************************************/
diff -Nru a/drivers/net/sk98lin/skgehwt.c b/drivers/net/sk98lin/skgehwt.c
--- a/drivers/net/sk98lin/skgehwt.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/net/sk98lin/skgehwt.c	Tue Feb  3 19:45:42 2004
@@ -1,10 +1,10 @@
 /******************************************************************************
  *
  * Name:	skgehwt.c
- * Project:	Gigabit Ethernet Adapters, Common Modules
- * Version:	$Revision: 1.14 $
- * Date:	$Date: 2003/05/13 18:01:58 $
- * Purpose:	Hardware Timer.
+ * Project:	Gigabit Ethernet Adapters, Event Scheduler Module
+ * Version:	$Revision: 1.15 $
+ * Date:	$Date: 2003/09/16 13:41:23 $
+ * Purpose:	Hardware Timer
  *
  ******************************************************************************/
 
@@ -27,6 +27,10 @@
  * History:
  *
  *	$Log: skgehwt.c,v $
+ *	Revision 1.15  2003/09/16 13:41:23  rschmidt
+ *	Added (C) Marvell to SysKonnectFileId
+ *	Editorial changes
+ *	
  *	Revision 1.14  2003/05/13 18:01:58  mkarl
  *	Editorial changes.
  *	
@@ -69,19 +73,15 @@
  *	
  *	Revision 1.1  1998/08/05 11:28:36  gklug
  *	first version: adapted from SMT/FDDI
- *	
- *	
- *	
  *
  ******************************************************************************/
 
-
 /*
-	Event queue and dispatcher
-*/
+ *	Event queue and dispatcher
+ */
 #if (defined(DEBUG) || ((!defined(LINT)) && (!defined(SK_SLIM))))
 static const char SysKonnectFileId[] =
-	"$Header: /usr56/projects/ge/schedule/skgehwt.c,v 1.14 2003/05/13 18:01:58 mkarl Exp $" ;
+	"@(#) $Id: skgehwt.c,v 1.15 2003/09/16 13:41:23 rschmidt Exp $ (C) Marvell.";
 #endif
 
 #include "h/skdrv1st.h"		/* Driver Specific Definitions */
@@ -89,10 +89,7 @@
 
 #ifdef __C2MAN__
 /*
-	Hardware Timer function queue management.
-
-	General Description:
-
+ *   Hardware Timer function queue management.
  */
 intro()
 {}
@@ -117,9 +114,9 @@
 {
 	pAC->Hwt.TStart = 0 ;
 	pAC->Hwt.TStop	= 0 ;
-	pAC->Hwt.TActive = SK_FALSE ;
+	pAC->Hwt.TActive = SK_FALSE;
 
-	SkHwtStop(pAC,Ioc) ;
+	SkHwtStop(pAC, Ioc);
 }
 
 /*
@@ -132,28 +129,29 @@
 SK_IOC	Ioc,	/* IoContext */
 SK_U32	Time)	/* Time in units of 16us to load the timer with. */
 {
-	SK_U32	Cnt ;
+	SK_U32	Cnt;
 
 	if (Time > SK_HWT_MAX)
-		Time = SK_HWT_MAX ;
+		Time = SK_HWT_MAX;
 
-	pAC->Hwt.TStart = Time ;
-	pAC->Hwt.TStop = 0L ;
+	pAC->Hwt.TStart = Time;
+	pAC->Hwt.TStop = 0L;
 
-	Cnt = Time ;
+	Cnt = Time;
 
 	/*
 	 * if time < 16 us
 	 *	time = 16 us
 	 */
 	if (!Cnt) {
-		Cnt++ ;
+		Cnt++;
 	}
 
-	SK_OUT32(Ioc, B2_TI_INI, Cnt * SK_HWT_FAC) ;
-	SK_OUT16(Ioc, B2_TI_CRTL, TIM_START) ;	/* Start timer. */
+	SK_OUT32(Ioc, B2_TI_INI, Cnt * SK_HWT_FAC);
+	
+	SK_OUT16(Ioc, B2_TI_CTRL, TIM_START);	/* Start timer. */
 
-	pAC->Hwt.TActive = SK_TRUE ;
+	pAC->Hwt.TActive = SK_TRUE;
 }
 
 /*
@@ -164,10 +162,11 @@
 SK_AC	*pAC,	/* Adapters context */
 SK_IOC	Ioc)	/* IoContext */
 {
-	SK_OUT16(Ioc, B2_TI_CRTL, TIM_STOP) ;
-	SK_OUT16(Ioc, B2_TI_CRTL, TIM_CLR_IRQ) ;
+	SK_OUT16(Ioc, B2_TI_CTRL, TIM_STOP);
+	
+	SK_OUT16(Ioc, B2_TI_CTRL, TIM_CLR_IRQ);
 
-	pAC->Hwt.TActive = SK_FALSE ;
+	pAC->Hwt.TActive = SK_FALSE;
 }
 
 
@@ -182,26 +181,31 @@
 SK_AC	*pAC,	/* Adapters context */
 SK_IOC	Ioc)	/* IoContext */
 {
-	SK_U32	TRead ;
-	SK_U32	IStatus ;
+	SK_U32	TRead;
+	SK_U32	IStatus;
 
 	if (pAC->Hwt.TActive) {
-		SkHwtStop(pAC,Ioc) ;
+		
+		SkHwtStop(pAC, Ioc);
 
 		SK_IN32(Ioc, B2_TI_VAL, &TRead);
 		TRead /= SK_HWT_FAC;
 
 		SK_IN32(Ioc, B0_ISRC, &IStatus);
 
-		/* Check if timer expired (or wraparound). */
+		/* Check if timer expired (or wraped around) */
 		if ((TRead > pAC->Hwt.TStart) || (IStatus & IS_TIMINT)) {
-			SkHwtStop(pAC,Ioc) ;
-			pAC->Hwt.TStop = pAC->Hwt.TStart ;
-		} else {
-			pAC->Hwt.TStop = pAC->Hwt.TStart - TRead ;
+			
+			SkHwtStop(pAC, Ioc);
+			
+			pAC->Hwt.TStop = pAC->Hwt.TStart;
+		}
+		else {
+			
+			pAC->Hwt.TStop = pAC->Hwt.TStart - TRead;
 		}
 	}
-	return (pAC->Hwt.TStop) ;
+	return(pAC->Hwt.TStop);
 }
 
 /*
@@ -211,9 +215,11 @@
 SK_AC	*pAC,	/* Adapters context */
 SK_IOC	Ioc)	/* IoContext */
 {
-	SkHwtStop(pAC,Ioc);
+	SkHwtStop(pAC, Ioc);
+	
 	pAC->Hwt.TStop = pAC->Hwt.TStart;
-	SkTimerDone(pAC,Ioc) ;
+	
+	SkTimerDone(pAC, Ioc);
 }
 
 /* End of file */
diff -Nru a/drivers/net/sk98lin/skgeinit.c b/drivers/net/sk98lin/skgeinit.c
--- a/drivers/net/sk98lin/skgeinit.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/net/sk98lin/skgeinit.c	Tue Feb  3 19:45:28 2004
@@ -2,8 +2,8 @@
  *
  * Name:	skgeinit.c
  * Project:	Gigabit Ethernet Adapters, Common Modules
- * Version:	$Revision: 1.93 $
- * Date:	$Date: 2003/05/28 15:44:43 $
+ * Version:	$Revision: 1.97 $
+ * Date:	$Date: 2003/10/02 16:45:31 $
  * Purpose:	Contains functions to initialize the adapter
  *
  ******************************************************************************/
@@ -27,6 +27,32 @@
  * History:
  *
  *	$Log: skgeinit.c,v $
+ *	Revision 1.97  2003/10/02 16:45:31  rschmidt
+ *	Replaced default values of GMAC parameters with defines.
+ *	Removed hard reset of MACs in SkGeDeInit().
+ *	Added define SK_PHY_LP_MODE around power saving mode in SkGeDeInit().
+ *	Added check for VAUX available before switch power to VAUX.
+ *	
+ *	Revision 1.96  2003/09/18 14:02:41  rroesler
+ *	Add: Perform a hardreset of MACs in GeDeInit()
+ *	
+ *	Revision 1.95  2003/09/16 14:26:59  rschmidt
+ *	Added switch power to VCC (WA for VAUX problem) in SkGeInit1().
+ *	Fixed setting PHY to coma mode and D3 power state in SkGeDeInit().
+ *	Editorial changes.
+ *	
+ *	Revision 1.94  2003/09/16 07:17:10  mschmid
+ *	Added init for new members in port structure for MAC control
+ *	- PMacColThres
+ *	- PMacJamLen
+ *	- PMacJamIpgVal
+ *	- PMacJamIpgData
+ *	- PMacIpgData
+ *	- PMacLimit4
+ *	Added init for PHY power state in port structure
+ *	- PPhyPowerState
+ *	Added shutdown handling for Yukon Plus in SkGeDeInit()
+ *	
  *	Revision 1.93  2003/05/28 15:44:43  rschmidt
  *	Added check for chip Id on WOL WA for chip Rev. A.
  *	Added setting of GILevel in SkGeDeInit().
@@ -446,7 +472,7 @@
 
 #if (defined(DEBUG) || ((!defined(LINT)) && (!defined(SK_SLIM))))
 static const char SysKonnectFileId[] =
-	"@(#) $Id: skgeinit.c,v 1.93 2003/05/28 15:44:43 rschmidt Exp $ (C) Marvell.";
+	"@(#) $Id: skgeinit.c,v 1.97 2003/10/02 16:45:31 rschmidt Exp $ (C) Marvell.";
 #endif
 
 struct s_QOffTab {
@@ -1013,8 +1039,6 @@
 	 *	- enable the FIFO
 	 */
 	
-	Word = (SK_U16)GMF_RX_CTRL_DEF;
-	
 #ifdef GENESIS
 	if (pAC->GIni.GIGenesis) {
 		/* Configure Rx MAC FIFO */
@@ -1039,6 +1063,8 @@
 		/* set Rx GMAC FIFO Flush Mask */
 		SK_OUT16(IoC, MR_ADDR(Port, RX_GMF_FL_MSK), (SK_U16)RX_FF_FL_DEF_MSK);
 		
+		Word = (SK_U16)GMF_RX_CTRL_DEF;
+
 		/* disable Rx GMAC FIFO Flush for YUKON-Lite Rev. A0 only */
 		if (pAC->GIni.GIYukonLite && pAC->GIni.GIChipId == CHIP_ID_YUKON) {
 
@@ -1809,6 +1835,13 @@
 		pPrt->PAutoNegFail = SK_FALSE;
 		pPrt->PHWLinkUp = SK_FALSE;
 		pPrt->PLinkBroken = SK_TRUE; /* See WA code */
+		pPrt->PPhyPowerState = PHY_PM_OPERATIONAL_MODE;
+		pPrt->PMacColThres = TX_COL_DEF;
+		pPrt->PMacJamLen = TX_JAM_LEN_DEF;
+		pPrt->PMacJamIpgVal	= TX_JAM_IPG_DEF;
+		pPrt->PMacJamIpgData = TX_IPG_JAM_DEF;
+		pPrt->PMacIpgData = IPG_DATA_DEF;
+		pPrt->PMacLimit4 = SK_FALSE;
 	}
 
 	pAC->GIni.GIPortUsage = SK_RED_LINK;
@@ -1963,7 +1996,7 @@
 	/* restore CLK_RUN bits */
 	SK_OUT16(IoC, B0_CTST, (SK_U16)(CtrlStat &
 		(CS_CLK_RUN_HOT | CS_CLK_RUN_RST | CS_CLK_RUN_ENA)));
-	
+
 	/* read Chip Identification Number */
 	SK_IN8(IoC, B2_CHIP_ID, &Byte);
 	pAC->GIni.GIChipId = Byte;
@@ -2053,6 +2086,10 @@
 			}
 		}
 
+		/* switch power to VCC (WA for VAUX problem) */
+		SK_OUT8(IoC, B0_POWER_CTRL, (SK_U8)(PC_VAUX_ENA | PC_VCC_ENA |
+			PC_VAUX_OFF | PC_VCC_ON));
+
 		/* read the Interrupt source */
 		SK_IN32(IoC, B0_ISRC, &DWord);
 		
@@ -2395,6 +2432,11 @@
 	int	i;
 	SK_U16	Word;
 
+#ifdef SK_PHY_LP_MODE
+	SK_U8	Byte;
+	SK_U16	PmCtlSts;
+#endif /* SK_PHY_LP_MODE */
+
 #if (!defined(SK_SLIM) && !defined(VCPU))
 	/* ensure I2C is ready */
 	SkI2cWaitIrq(pAC, IoC);
@@ -2408,6 +2450,38 @@
 			SkGeStopPort(pAC, IoC, i, SK_STOP_ALL, SK_HARD_RST);
 		}
 	}
+
+#ifdef SK_PHY_LP_MODE
+    /*
+	 * for power saving purposes within mobile environments
+	 * we set the PHY to coma mode and switch to D3 power state.
+	 */
+	if (pAC->GIni.GIYukonLite &&
+		pAC->GIni.GIChipRev == CHIP_REV_YU_LITE_A3) {
+
+		/* for all ports switch PHY to coma mode */
+		for (i = 0; i < pAC->GIni.GIMacsFound; i++) {
+			
+			SkGmEnterLowPowerMode(pAC, IoC, i, PHY_PM_DEEP_SLEEP);
+		}
+
+		if (pAC->GIni.GIVauxAvail) {
+			/* switch power to VAUX */
+			Byte = PC_VAUX_ENA | PC_VCC_ENA | PC_VAUX_ON | PC_VCC_OFF;
+
+			SK_OUT8(IoC, B0_POWER_CTRL, Byte);
+		}
+		
+		/* switch to D3 state */
+		SK_IN16(IoC, PCI_C(PCI_PM_CTL_STS), &PmCtlSts);
+
+		PmCtlSts |= PCI_PM_STATE_D3;
+
+		SK_OUT8(IoC, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+
+		SK_OUT16(IoC, PCI_C(PCI_PM_CTL_STS), PmCtlSts);
+	}
+#endif /* SK_PHY_LP_MODE */
 
 	/* Reset all bits in the PCI STATUS register */
 	/*
diff -Nru a/drivers/net/sk98lin/skgemib.c b/drivers/net/sk98lin/skgemib.c
--- a/drivers/net/sk98lin/skgemib.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/sk98lin/skgemib.c	Tue Feb  3 19:45:16 2004
@@ -2,8 +2,8 @@
  *
  * Name:	skgemib.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.9 $
- * Date:	$Date: 2003/05/23 12:55:20 $
+ * Version:	$Revision: 1.11 $
+ * Date:	$Date: 2003/09/15 13:38:12 $
  * Purpose:	Private Network Management Interface Management Database
  *
  ****************************************************************************/
@@ -27,6 +27,19 @@
  * History:
  *
  *	$Log: skgemib.c,v $
+ *	Revision 1.11  2003/09/15 13:38:12  tschilli
+ *	OID_SKGE_PHY_LP_MODE included only after using #define SK_PHY_LP_MODE.
+ *	
+ *	Revision 1.10  2003/08/15 12:28:59  tschilli
+ *	Added new OIDs:
+ *	OID_SKGE_DRIVER_RELDATE
+ *	OID_SKGE_DRIVER_FILENAME
+ *	OID_SKGE_CHIPID
+ *	OID_SKGE_RAMSIZE
+ *	OID_SKGE_VAUXAVAIL
+ *	OID_SKGE_PHY_TYPE
+ *	OID_SKGE_PHY_LP_MODE
+ *	
  *	Revision 1.9  2003/05/23 12:55:20  tschilli
  *	OID_SKGE_BOARDLEVEL added.
  *	
@@ -356,6 +369,16 @@
 		0,
 		SK_PNMI_MAI_OFF(DriverVersion),
 		SK_PNMI_RO, General, 0},
+	{OID_SKGE_DRIVER_RELDATE,
+		1,
+		0,
+		SK_PNMI_MAI_OFF(DriverReleaseDate),
+		SK_PNMI_RO, General, 0},
+	{OID_SKGE_DRIVER_FILENAME,
+		1,
+		0,
+		SK_PNMI_MAI_OFF(DriverFileName),
+		SK_PNMI_RO, General, 0},
 	{OID_SKGE_HW_DESCR,
 		1,
 		0,
@@ -371,6 +394,21 @@
 		0,
 		SK_PNMI_MAI_OFF(Chipset),
 		SK_PNMI_RO, General, 0},
+	{OID_SKGE_CHIPID,
+		1,
+		0,
+		SK_PNMI_MAI_OFF(ChipId),
+		SK_PNMI_RO, General, 0},
+	{OID_SKGE_RAMSIZE,
+		1,
+		0,
+		SK_PNMI_MAI_OFF(RamSize),
+		SK_PNMI_RO, General, 0},
+	{OID_SKGE_VAUXAVAIL,
+		1,
+		0,
+		SK_PNMI_MAI_OFF(VauxAvail),
+		SK_PNMI_RO, General, 0},
 	{OID_SKGE_ACTION,
 		1,
 		0,
@@ -876,6 +914,18 @@
 		sizeof(SK_PNMI_CONF),
 		SK_PNMI_OFF(Conf) + SK_PNMI_CNF_OFF(ConfConnector),
 		SK_PNMI_RO, MacPrivateConf, 0},
+	{OID_SKGE_PHY_TYPE,
+		SK_PNMI_MAC_ENTRIES,
+		sizeof(SK_PNMI_CONF),
+		SK_PNMI_OFF(Conf) + SK_PNMI_CNF_OFF(ConfPhyType),
+		SK_PNMI_RO, MacPrivateConf, 0},
+#ifdef SK_PHY_LP_MODE
+		{OID_SKGE_PHY_LP_MODE,
+		SK_PNMI_MAC_ENTRIES,
+		sizeof(SK_PNMI_CONF),
+		SK_PNMI_OFF(Conf) + SK_PNMI_CNF_OFF(ConfPhyMode),
+		SK_PNMI_RW, MacPrivateConf, 0},
+#endif	
 	{OID_SKGE_LINK_CAP,
 		SK_PNMI_MAC_ENTRIES,
 		sizeof(SK_PNMI_CONF),
diff -Nru a/drivers/net/sk98lin/skgepnmi.c b/drivers/net/sk98lin/skgepnmi.c
--- a/drivers/net/sk98lin/skgepnmi.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/net/sk98lin/skgepnmi.c	Tue Feb  3 19:45:34 2004
@@ -2,8 +2,8 @@
  *
  * Name:	skgepnmi.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.109 $
- * Date:	$Date: 2003/07/17 14:15:24 $
+ * Version:	$Revision: 1.111 $
+ * Date:	$Date: 2003/09/15 13:35:35 $
  * Purpose:	Private Network Management Interface
  *
  ****************************************************************************/
@@ -27,6 +27,22 @@
  * History:
  *
  *	$Log: skgepnmi.c,v $
+ *	Revision 1.111  2003/09/15 13:35:35  tschilli
+ *	Code for OID_SKGE_PHY_LP_MODE completed (using #define SK_PHY_LP_MODE).
+ *	SK_DIAG_ATTACHED handling for OID_SKGE_DIAG_MODE in DiagActions() changed.
+ *	
+ *	Revision 1.110  2003/08/15 12:28:04  tschilli
+ *	Added new OIDs:
+ *	OID_SKGE_DRIVER_RELDATE
+ *	OID_SKGE_DRIVER_FILENAME
+ *	OID_SKGE_CHIPID
+ *	OID_SKGE_RAMSIZE
+ *	OID_SKGE_VAUXAVAIL
+ *	OID_SKGE_PHY_TYPE
+ *	OID_SKGE_PHY_LP_MODE
+ *	
+ *	Added SK_DIAG_ATTACHED handling for OID_SKGE_DIAG_MODE in DiagActions().
+ *	
  *	Revision 1.109  2003/07/17 14:15:24  tschilli
  *	Bug in SkPnmiGenIoctl() fixed.
  *	
@@ -471,7 +487,7 @@
 
 #ifndef _lint
 static const char SysKonnectFileId[] =
-	"@(#) $Id: skgepnmi.c,v 1.109 2003/07/17 14:15:24 tschilli Exp $ (C) Marvell.";
+	"@(#) $Id: skgepnmi.c,v 1.111 2003/09/15 13:35:35 tschilli Exp $ (C) Marvell.";
 #endif /* !_lint */
 
 #include "h/skdrv1st.h"
@@ -4008,14 +4024,6 @@
 #endif /* SK_NDIS_64BIT_CTR */
 		break;
 
-	case OID_SKGE_BOARDLEVEL:
-		if (*pLen < sizeof(SK_U32)) {
-
-			*pLen = sizeof(SK_U32);
-			return (SK_PNMI_ERR_TOO_SHORT);
-		}
-		break;
-
 	case OID_SKGE_PORT_NUMBER:
 	case OID_SKGE_DEVICE_TYPE:
 	case OID_SKGE_RESULT:
@@ -4023,6 +4031,9 @@
 	case OID_GEN_TRANSMIT_QUEUE_LENGTH:
 	case OID_SKGE_TRAP_NUMBER:
 	case OID_SKGE_MDB_VERSION:
+	case OID_SKGE_BOARDLEVEL:
+	case OID_SKGE_CHIPID:
+	case OID_SKGE_RAMSIZE:
 		if (*pLen < sizeof(SK_U32)) {
 
 			*pLen = sizeof(SK_U32);
@@ -4043,6 +4054,7 @@
 	case OID_SKGE_BUS_WIDTH:
 	case OID_SKGE_SENSOR_NUMBER:
 	case OID_SKGE_CHKSM_NUMBER:
+	case OID_SKGE_VAUXAVAIL:
 		if (*pLen < sizeof(SK_U8)) {
 
 			*pLen = sizeof(SK_U8);
@@ -4234,6 +4246,66 @@
 		*pLen = Len;
 		break;
 
+	case OID_SKGE_DRIVER_RELDATE:
+		if (pAC->Pnmi.pDriverReleaseDate == NULL) {
+
+			SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR030,
+				SK_PNMI_ERR053MSG);
+
+			*pLen = 0;
+			return (SK_PNMI_ERR_GENERAL);
+		}
+
+		Len = SK_STRLEN(pAC->Pnmi.pDriverReleaseDate) + 1;
+		if (Len > SK_PNMI_STRINGLEN1) {
+
+			SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR031,
+				SK_PNMI_ERR054MSG);
+
+			*pLen = 0;
+			return (SK_PNMI_ERR_GENERAL);
+		}
+
+		if (*pLen < Len) {
+
+			*pLen = Len;
+			return (SK_PNMI_ERR_TOO_SHORT);
+		}
+		*pBuf = (char)(Len - 1);
+		SK_MEMCPY(pBuf + 1, pAC->Pnmi.pDriverReleaseDate, Len - 1);
+		*pLen = Len;
+		break;
+
+	case OID_SKGE_DRIVER_FILENAME:
+		if (pAC->Pnmi.pDriverFileName == NULL) {
+
+			SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR030,
+				SK_PNMI_ERR055MSG);
+
+			*pLen = 0;
+			return (SK_PNMI_ERR_GENERAL);
+		}
+
+		Len = SK_STRLEN(pAC->Pnmi.pDriverFileName) + 1;
+		if (Len > SK_PNMI_STRINGLEN1) {
+
+			SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR031,
+				SK_PNMI_ERR056MSG);
+
+			*pLen = 0;
+			return (SK_PNMI_ERR_GENERAL);
+		}
+
+		if (*pLen < Len) {
+
+			*pLen = Len;
+			return (SK_PNMI_ERR_TOO_SHORT);
+		}
+		*pBuf = (char)(Len - 1);
+		SK_MEMCPY(pBuf + 1, pAC->Pnmi.pDriverFileName, Len - 1);
+		*pLen = Len;
+		break;
+
 	case OID_SKGE_HW_DESCR:
 		/*
 		 * The hardware description is located in the VPD. This
@@ -4291,8 +4363,25 @@
 		*pLen = sizeof(SK_U16);
 		break;
 
+	case OID_SKGE_CHIPID:
+		Val32 = pAC->GIni.GIChipId;
+		SK_PNMI_STORE_U32(pBuf, Val32);
+		*pLen = sizeof(SK_U32);
+		break;
+
+	case OID_SKGE_RAMSIZE:
+		Val32 = pAC->GIni.GIRamSize;
+		SK_PNMI_STORE_U32(pBuf, Val32);
+		*pLen = sizeof(SK_U32);
+		break;
+
+	case OID_SKGE_VAUXAVAIL:
+		*pBuf = (char) pAC->GIni.GIVauxAvail;
+		*pLen = sizeof(char);
+		break;
+
 	case OID_SKGE_BUS_TYPE:
-		*pBuf = (char)SK_PNMI_BUS_PCI;
+		*pBuf = (char) SK_PNMI_BUS_PCI;
 		*pLen = sizeof(char);
 		break;
 
@@ -5435,6 +5524,9 @@
 		case OID_SKGE_SPEED_CAP:
 		case OID_SKGE_SPEED_MODE:
 		case OID_SKGE_SPEED_STATUS:
+#ifdef SK_PHY_LP_MODE
+		case OID_SKGE_PHY_LP_MODE:
+#endif
 			if (*pLen < (Limit - LogPortIndex) * sizeof(SK_U8)) {
 
 				*pLen = (Limit - LogPortIndex) * sizeof(SK_U8);
@@ -5443,6 +5535,7 @@
 			break;
 
         case OID_SKGE_MTU:
+        case OID_SKGE_PHY_TYPE:
 			if (*pLen < (Limit - LogPortIndex) * sizeof(SK_U32)) {
 
 				*pLen = (Limit - LogPortIndex) * sizeof(SK_U32);
@@ -5488,6 +5581,49 @@
 				Offset += sizeof(char);
 				break;
 
+			case OID_SKGE_PHY_TYPE:
+				if (!pAC->Pnmi.DualNetActiveFlag) { /* SingleNetMode */
+					if (LogPortIndex == 0) {
+						continue;
+					}
+					else {
+						/* Get value for physical ports */
+						PhysPortIndex = SK_PNMI_PORT_LOG2PHYS(
+							pAC, LogPortIndex);
+						Val32 = pAC->GIni.GP[PhysPortIndex].PhyType;
+						SK_PNMI_STORE_U32(pBufPtr, Val32);
+					}
+				}
+				else { /* DualNetMode */
+					
+					Val32 = pAC->GIni.GP[NetIndex].PhyType;
+					SK_PNMI_STORE_U32(pBufPtr, Val32);
+				}
+				Offset += sizeof(SK_U32);
+				break;
+
+#ifdef SK_PHY_LP_MODE
+			case OID_SKGE_PHY_LP_MODE:
+				if (!pAC->Pnmi.DualNetActiveFlag) { /* SingleNetMode */
+					if (LogPortIndex == 0) {
+						continue;
+					}
+					else {
+						/* Get value for physical ports */
+						PhysPortIndex = SK_PNMI_PORT_LOG2PHYS(pAC, LogPortIndex);
+						Val8 = (SK_U8) pAC->GIni.GP[PhysPortIndex].PPhyPowerState;
+						*pBufPtr = Val8;
+					}
+				}
+				else { /* DualNetMode */
+					
+					Val8 = (SK_U8) pAC->GIni.GP[PhysPortIndex].PPhyPowerState;
+					*pBufPtr = Val8;
+				}
+				Offset += sizeof(SK_U8);
+				break;
+#endif
+
 			case OID_SKGE_LINK_CAP:
 				if (!pAC->Pnmi.DualNetActiveFlag) { /* SingleNetMode */
 					if (LogPortIndex == 0) {
@@ -5804,6 +5940,16 @@
 		}
 		break;
 
+#ifdef SK_PHY_LP_MODE
+	case OID_SKGE_PHY_LP_MODE:
+		if (*pLen < Limit - LogPortIndex) {
+
+			*pLen = Limit - LogPortIndex;
+			return (SK_PNMI_ERR_TOO_SHORT);
+		}
+		break;
+#endif
+
 	case OID_SKGE_MTU:
 		if (*pLen < sizeof(SK_U32)) {
 
@@ -6160,6 +6306,116 @@
 
 			Offset += sizeof(SK_U32);
 			break;
+		
+#ifdef SK_PHY_LP_MODE
+		case OID_SKGE_PHY_LP_MODE:
+			/* The preset ends here */
+			if (Action == SK_PNMI_PRESET) {
+
+				return (SK_PNMI_ERR_OK);
+			}
+
+			if (!pAC->Pnmi.DualNetActiveFlag) { /* SingleNetMode */
+				if (LogPortIndex == 0) {
+					Offset = 0;
+					continue;
+				}
+				else {
+					/* Set value for physical ports */
+					PhysPortIndex = SK_PNMI_PORT_LOG2PHYS(pAC, LogPortIndex);
+
+					switch (*(pBuf + Offset)) {
+						case 0:
+							/* If LowPowerMode is active, we can leave it. */
+							if (pAC->GIni.GP[PhysPortIndex].PPhyPowerState) {
+
+								Val32 = SkGmLeaveLowPowerMode(pAC, IoC, PhysPortIndex);
+								
+								if (pAC->GIni.GP[PhysPortIndex].PPhyPowerState < 3)	{
+									
+									SkDrvInitAdapter(pAC);
+								}
+								break;
+							}
+							else {
+								*pLen = 0;
+								return (SK_PNMI_ERR_GENERAL);
+							}
+						case 1:
+						case 2:
+						case 3:
+						case 4:
+							/* If no LowPowerMode is active, we can enter it. */
+							if (!pAC->GIni.GP[PhysPortIndex].PPhyPowerState) {
+
+								if ((*(pBuf + Offset)) < 3)	{
+								
+									SkDrvDeInitAdapter(pAC);
+								}
+
+								Val32 = SkGmEnterLowPowerMode(pAC, IoC, PhysPortIndex, *pBuf);
+								break;
+							}
+							else {
+								*pLen = 0;
+								return (SK_PNMI_ERR_GENERAL);
+							}
+						default:
+							*pLen = 0;
+							return (SK_PNMI_ERR_BAD_VALUE);
+					}
+				}
+			}
+			else { /* DualNetMode */
+				
+				switch (*(pBuf + Offset)) {
+					case 0:
+						/* If we are in a LowPowerMode, we can leave it. */
+						if (pAC->GIni.GP[PhysPortIndex].PPhyPowerState) {
+
+							Val32 = SkGmLeaveLowPowerMode(pAC, IoC, PhysPortIndex);
+							
+							if (pAC->GIni.GP[PhysPortIndex].PPhyPowerState < 3)	{
+
+								SkDrvInitAdapter(pAC);
+							}
+							break;
+						}
+						else {
+							*pLen = 0;
+							return (SK_PNMI_ERR_GENERAL);
+						}
+					
+					case 1:
+					case 2:
+					case 3:
+					case 4:
+						/* If we are not already in LowPowerMode, we can enter it. */
+						if (!pAC->GIni.GP[PhysPortIndex].PPhyPowerState) {
+
+							if ((*(pBuf + Offset)) < 3)	{
+
+								SkDrvDeInitAdapter(pAC);
+							}
+							else {
+
+								Val32 = SkGmEnterLowPowerMode(pAC, IoC, PhysPortIndex, *pBuf);
+							}
+							break;
+						}
+						else {
+							*pLen = 0;
+							return (SK_PNMI_ERR_GENERAL);
+						}
+					
+					default:
+						*pLen = 0;
+						return (SK_PNMI_ERR_BAD_VALUE);
+				}
+			}
+			Offset += sizeof(SK_U8);
+			break;
+#endif
 
 		default:
             SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_ERR,
@@ -6318,6 +6574,7 @@
 	unsigned int	PhysPortMax;
 	unsigned int	PhysPortIndex;
 	SK_U8		Val8;
+	SK_U32		Val32;
 	SK_BOOL		PortActiveFlag;
 	SK_GEPORT	*pPrt;
 
@@ -6340,6 +6597,14 @@
 
 		switch (Id) {
 
+		case OID_SKGE_PHY_TYPE:
+			/* Check if it is the first active port */
+			if (*pBuf == 0) {
+				Val32 = pPrt->PhyType;
+				SK_PNMI_STORE_U32(pBuf, Val32);
+				continue;
+			}
+
 		case OID_SKGE_LINK_CAP:
 
 			/*
@@ -7974,6 +8239,7 @@
 SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode always zero */
 {
 
+	SK_U32	DiagStatus;
 	SK_U32	RetCode = SK_PNMI_ERR_GENERAL;
 
 	/*
@@ -8012,7 +8278,8 @@
 		switch (Id) {
 
 		case OID_SKGE_DIAG_MODE:
-			SK_PNMI_STORE_U32(pBuf, pAC->DiagModeActive);
+			DiagStatus = pAC->Pnmi.DiagAttached;
+			SK_PNMI_STORE_U32(pBuf, DiagStatus);
 			*pLen = sizeof(SK_U32);	
 			RetCode = SK_PNMI_ERR_OK;
 			break;
@@ -8022,7 +8289,6 @@
 			RetCode = SK_PNMI_ERR_GENERAL;
 			break;
 		}
-
 		return (RetCode); 
 	}
 
@@ -8039,23 +8305,84 @@
 
 			/* Handle the SET. */
 			switch (*pBuf) {
-		
+
+				/* Attach the DIAG to this adapter. */
+				case SK_DIAG_ATTACHED:
+					/* Check if we come from running */
+					if (pAC->Pnmi.DiagAttached == SK_DIAG_RUNNING) {
+
+						RetCode = SkDrvLeaveDiagMode(pAC);
+
+					}
+					else if (pAC->Pnmi.DiagAttached == SK_DIAG_IDLE) {
+
+						RetCode = SK_PNMI_ERR_OK;
+					}	
+					
+					else {
+
+						RetCode = SK_PNMI_ERR_GENERAL;
+
+					}
+					
+					if (RetCode == SK_PNMI_ERR_OK) {
+
+						pAC->Pnmi.DiagAttached = SK_DIAG_ATTACHED;
+					}
+					break;
+
 				/* Enter the DIAG mode in the driver. */
-				case 1:
-					/* If DiagMode is not active, we can enter it. */
-					if (!pAC->DiagModeActive) {
+				case SK_DIAG_RUNNING:
+					RetCode = SK_PNMI_ERR_OK;
+					
+					/*
+					 * If DiagAttached is set, we can tell the driver
+					 * to enter the DIAG mode.
+					 */
+					if (pAC->Pnmi.DiagAttached == SK_DIAG_ATTACHED) {
+						/* If DiagMode is not active, we can enter it. */
+						if (!pAC->DiagModeActive) {
+
+							RetCode = SkDrvEnterDiagMode(pAC); 
+						}
+						else {
 
-						RetCode = SkDrvEnterDiagMode(pAC);	
+							RetCode = SK_PNMI_ERR_GENERAL;
+						}
 					}
 					else {
 
 						RetCode = SK_PNMI_ERR_GENERAL;
 					}
+					
+					if (RetCode == SK_PNMI_ERR_OK) {
+
+						pAC->Pnmi.DiagAttached = SK_DIAG_RUNNING;
+					}
 					break;
 
-				/* Leave the DIAG mode in the driver. */
-				case 0:
-					RetCode = SkDrvLeaveDiagMode(pAC);	
+				case SK_DIAG_IDLE:
+					/* Check if we come from running */
+					if (pAC->Pnmi.DiagAttached == SK_DIAG_RUNNING) {
+
+						RetCode = SkDrvLeaveDiagMode(pAC);
+
+					}
+					else if (pAC->Pnmi.DiagAttached == SK_DIAG_ATTACHED) {
+
+						RetCode = SK_PNMI_ERR_OK;
+					}	
+					
+					else {
+
+						RetCode = SK_PNMI_ERR_GENERAL;
+
+					}
+
+					if (RetCode == SK_PNMI_ERR_OK) {
+
+						pAC->Pnmi.DiagAttached = SK_DIAG_IDLE;
+					}
 					break;
 
 				default:
diff -Nru a/drivers/net/sk98lin/skgesirq.c b/drivers/net/sk98lin/skgesirq.c
--- a/drivers/net/sk98lin/skgesirq.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/sk98lin/skgesirq.c	Tue Feb  3 19:45:16 2004
@@ -2,8 +2,8 @@
  *
  * Name:	skgesirq.c
  * Project:	Gigabit Ethernet Adapters, Common Modules
- * Version:	$Revision: 1.91 $
- * Date:	$Date: 2003/07/04 12:46:22 $
+ * Version:	$Revision: 1.92 $
+ * Date:	$Date: 2003/09/16 14:37:07 $
  * Purpose:	Special IRQ module
  *
  ******************************************************************************/
@@ -27,6 +27,12 @@
  * History:
  *
  *	$Log: skgesirq.c,v $
+ *	Revision 1.92  2003/09/16 14:37:07  rschmidt
+ *	Added debug messages in some SkGePortCheckUp...() routines.
+ *	Fixed compiler warnings for different types.
+ *	Avoided port check up in reset state (eg. coma mode).
+ *	Editorial changes.
+ *	
  *	Revision 1.91  2003/07/04 12:46:22  rschmidt
  *	Added debug messages in SkGePortCheckUpGmac().
  *	Added error log message and new driver event SK_DRV_DOWNSHIFT_DET
@@ -410,7 +416,7 @@
 
 #if (defined(DEBUG) || ((!defined(LINT)) && (!defined(SK_SLIM))))
 static const char SysKonnectFileId[] =
-	"@(#) $Id: skgesirq.c,v 1.91 2003/07/04 12:46:22 rschmidt Exp $ (C) Marvell.";
+	"@(#) $Id: skgesirq.c,v 1.92 2003/09/16 14:37:07 rschmidt Exp $ (C) Marvell.";
 #endif
 
 #include "h/skdrv1st.h"		/* Driver Specific Definitions */
@@ -490,7 +496,7 @@
 		("AutoSensing: First mode %d on Port %d\n",
 		(int)SK_LMODE_AUTOFULL, Port));
 
-	pPrt->PLinkMode = SK_LMODE_AUTOFULL;
+	pPrt->PLinkMode = (SK_U8)SK_LMODE_AUTOFULL;
 
 	return;
 }	/* SkHWInitDefSense */
@@ -606,7 +612,7 @@
 	/* Reset Port stati */
     pPrt->PLinkModeStatus = (SK_U8)SK_LMODE_STAT_UNKNOWN;
     pPrt->PFlowCtrlStatus = (SK_U8)SK_FLOW_STAT_NONE;
-	pPrt->PLinkSpeedUsed = SK_LSPEED_STAT_INDETERMINATED;
+	pPrt->PLinkSpeedUsed = (SK_U8)SK_LSPEED_STAT_INDETERMINATED;
 
 	/* Re-init Phy especially when the AutoSense default is set now */
 	SkMacInitPhy(pAC, IoC, Port, SK_FALSE);
@@ -655,19 +661,19 @@
 		case SK_LSPEED_AUTO:
 			/* default is 1000 Mbps */
 		case SK_LSPEED_1000MBPS:
-			pPrt->PLinkSpeedUsed = SK_LSPEED_STAT_1000MBPS;
+			pPrt->PLinkSpeedUsed = (SK_U8)SK_LSPEED_STAT_1000MBPS;
 			break;
 		case SK_LSPEED_100MBPS:
-			pPrt->PLinkSpeedUsed = SK_LSPEED_STAT_100MBPS;
+			pPrt->PLinkSpeedUsed = (SK_U8)SK_LSPEED_STAT_100MBPS;
 			break;
 		case SK_LSPEED_10MBPS:
-			pPrt->PLinkSpeedUsed = SK_LSPEED_STAT_10MBPS;
+			pPrt->PLinkSpeedUsed = (SK_U8)SK_LSPEED_STAT_10MBPS;
 			break;
 		}
 
 		/* Set Link Mode Status */
 		if (pPrt->PLinkMode == SK_LMODE_FULL) {
-			pPrt->PLinkModeStatus = SK_LMODE_STAT_FULL;
+			pPrt->PLinkModeStatus = (SK_U8)SK_LMODE_STAT_FULL;
 		}
 		else {
             pPrt->PLinkModeStatus = (SK_U8)SK_LMODE_STAT_HALF;
@@ -1598,8 +1604,7 @@
 			 * (clear Page Received bit if set)
 			 */
 			SkXmPhyRead(pAC, IoC, Port, PHY_XMAC_AUNE_EXP, &ExtStat);
-			SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
-				("AutoNeg done Port %d\n", Port));
+			
 			return(SK_HW_PS_LINK);
 		}
 		
@@ -1870,7 +1875,7 @@
 	SkMacAutoNegLipaPhy(pAC, IoC, Port, PhyStat);
 	
 	SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
-		("AutoNeg: %d, PhyStat: 0x%04X\n", AutoNeg, PhyStat));
+		("CheckUp Port %d, PhyStat: 0x%04X\n", Port, PhyStat));
 
 	SkXmPhyRead(pAC, IoC, Port, PHY_BCOM_1000T_STAT, &ResAb);
 
@@ -1897,8 +1902,11 @@
 
 	if (AutoNeg) {
 		if ((PhyStat & PHY_ST_AN_OVER) != 0) {
+			
 			SkHWLinkUp(pAC, IoC, Port);
+			
 			Done = SkMacAutoNegDone(pAC, IoC, Port);
+			
 			if (Done != SK_AND_OK) {
 #ifdef DEBUG
 				/* Get PHY parameters, for debugging only */
@@ -1924,9 +1932,6 @@
 						(void *)NULL);
 				}
 #endif /* DEBUG */
-				
-				SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
-					("AutoNeg done Port %d\n", Port));
 				return(SK_HW_PS_LINK);
 			}
 		}
@@ -1989,9 +1994,22 @@
 	SK_U16		PhySpecStat;/* PHY Specific Status */
 	SK_U16		ResAb;		/* Master/Slave resolution */
 	SK_EVPARA	Para;
+#ifdef DEBUG
+	SK_U16		Word;		/* I/O helper */
+#endif /* DEBUG */
 
 	pPrt = &pAC->GIni.GP[Port];
 
+	if (pPrt->PHWLinkUp) {
+		return(SK_HW_PS_NONE);
+	}
+
+	/* Read PHY Status */
+	SkGmPhyRead(pAC, IoC, Port, PHY_MARV_STAT, &PhyStat);
+
+	SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
+		("CheckUp Port %d, PhyStat: 0x%04X\n", Port, PhyStat));
+
 	/* Read PHY Interrupt Status */
 	SkGmPhyRead(pAC, IoC, Port, PHY_MARV_INT_STAT, &PhyIsrc);
 
@@ -2005,16 +2023,6 @@
 			("Link Speed Changed, PhyIsrc: 0x%04X\n", PhyIsrc));
 	}
 
-	if (pPrt->PHWLinkUp) {
-		return(SK_HW_PS_NONE);
-	}
-
-	/* Read PHY Status */
-	SkGmPhyRead(pAC, IoC, Port, PHY_MARV_STAT, &PhyStat);
-
-	SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
-		("AutoNeg: %d, PhyStat: 0x%04X\n", AutoNeg, PhyStat));
-
 	SkMacAutoNegLipaPhy(pAC, IoC, Port, PhyStat);
 	
 	SkGmPhyRead(pAC, IoC, Port, PHY_MARV_1000T_STAT, &ResAb);
@@ -2034,7 +2042,20 @@
 	SkGmPhyRead(pAC, IoC, Port, PHY_MARV_PHY_STAT, &PhySpecStat);
 	
 	SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
-		("AutoNeg: %d, PhySpecStat: 0x%04X\n", AutoNeg, PhySpecStat));
+		("Phy1000BT: 0x%04X, PhySpecStat: 0x%04X\n", ResAb, PhySpecStat));
+
+#ifdef DEBUG
+	SkGmPhyRead(pAC, IoC, Port, PHY_MARV_AUNE_EXP, &Word);
+
+	if ((PhyIsrc & PHY_M_IS_AN_PR) != 0 || (Word & PHY_ANE_RX_PG) != 0 ||
+		(PhySpecStat & PHY_M_PS_PAGE_REC) != 0)  {
+		/* Read PHY Next Page Link Partner */
+		SkGmPhyRead(pAC, IoC, Port, PHY_MARV_NEPG_LP, &Word);
+
+		SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
+			("Page Received, NextPage: 0x%04X\n", Word));
+	}
+#endif /* DEBUG */
 
 	if ((PhySpecStat & PHY_M_PS_LINK_UP) == 0) {
 		return(SK_HW_PS_NONE);
@@ -2069,8 +2090,6 @@
 				return(SK_HW_PS_RESTART);
 			}
 			
-			SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
-				("AutoNeg done Port %d\n", Port));
 			return(SK_HW_PS_LINK);
 		}
 	}
@@ -2179,8 +2198,6 @@
 				 * extra link down/ups
 				 */
 				SkXmPhyRead(pAC, IoC, Port, PHY_LONE_INT_STAT, &ExtStat);
-				SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
-					("AutoNeg done Port %d\n", Port));
 				return(SK_HW_PS_LINK);
 			}
 		}
@@ -2278,8 +2295,14 @@
 
 	switch (Event) {
 	case SK_HWEV_WATIM:
-		/* Check whether port came up */
-		PortStat = SkGePortCheckUp(pAC, IoC, (int)Port);
+		if (pPrt->PState == SK_PRT_RESET) {
+		
+			PortStat = SK_HW_PS_NONE;
+		}
+		else {
+			/* Check whether port came up */
+			PortStat = SkGePortCheckUp(pAC, IoC, (int)Port);
+		}
 
 		switch (PortStat) {
 		case SK_HW_PS_RESTART:
diff -Nru a/drivers/net/sk98lin/ski2c.c b/drivers/net/sk98lin/ski2c.c
--- a/drivers/net/sk98lin/ski2c.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/sk98lin/ski2c.c	Tue Feb  3 19:45:16 2004
@@ -1,16 +1,17 @@
 /******************************************************************************
  *
  * Name:	ski2c.c
- * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.57 $
- * Date:	$Date: 2003/01/28 09:17:38 $
+ * Project:	Gigabit Ethernet Adapters, TWSI-Module
+ * Version:	$Revision: 1.59 $
+ * Date:	$Date: 2003/10/20 09:07:25 $
  * Purpose:	Functions to access Voltage and Temperature Sensor
  *
  ******************************************************************************/
 
 /******************************************************************************
  *
- *	(C)Copyright 1998-2003 SysKonnect GmbH.
+ *	(C)Copyright 1998-2002 SysKonnect.
+ *	(C)Copyright 2002-2003 Marvell.
  *
  *	This program is free software; you can redistribute it and/or modify
  *	it under the terms of the GNU General Public License as published by
@@ -26,6 +27,14 @@
  * History:
  *
  *	$Log: ski2c.c,v $
+ *	Revision 1.59  2003/10/20 09:07:25  rschmidt
+ *	Added cast SK_U32 in SkI2cWrite() to avoid compiler warning.
+ *	Editorial changes.
+ *	
+ *	Revision 1.58  2003/09/23 09:22:53  malthoff
+ *	Parameter I2cDevSize added in SkI2cRead and SkI2cWrite to
+ *	support larger devices on the TWSI bus.
+ *	
  *	Revision 1.57  2003/01/28 09:17:38  rschmidt
  *	Fixed handling for sensors on YUKON Fiber.
  *	Editorial changes.
@@ -224,15 +233,15 @@
  *	Created. Sources taken from ML Projekt.
  *	Sources have to be reworked for GE.
  *
- *
  ******************************************************************************/
 
-
 /*
  *	I2C Protocol
  */
+#if (defined(DEBUG) || ((!defined(LINT)) && (!defined(SK_SLIM))))
 static const char SysKonnectFileId[] =
-	"$Id: ski2c.c,v 1.57 2003/01/28 09:17:38 rschmidt Exp $";
+	"@(#) $Id: ski2c.c,v 1.59 2003/10/20 09:07:25 rschmidt Exp $ (C) Marvell. ";
+#endif
 
 #include "h/skdrv1st.h"		/* Driver Specific Definitions */
 #include "h/lm80.h"
@@ -312,7 +321,7 @@
 {}
 #endif
 
-#ifdef	SK_DIAG
+#ifdef SK_DIAG
 /*
  * I2C Fast Mode timing values used by the LM80.
  * If new devices are added to the I2C bus the timing values have to be checked.
@@ -516,7 +525,6 @@
 {
 	/*
 	 * Received bit must be zero.
-	 *
 	 */
 	SkI2cSndBit(IoC, 0);
 }	/* SkI2cSndAck */
@@ -590,7 +598,7 @@
 	return(SkI2cSndByte(IoC, (Addr<<1) | Rw));
 }	/* SkI2cSndDev */
 
-#endif	/* SK_DIAG */
+#endif /* SK_DIAG */
 
 /*----------------- I2C CTRL Register Functions ----------*/
 
@@ -620,7 +628,7 @@
 			SK_I2C_STOP(IoC);
 #ifndef SK_DIAG
 			SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_I2C_E002, SKERR_I2C_E002MSG);
-#endif	/* !SK_DIAG */
+#endif /* !SK_DIAG */
 			return(1);
 		}
 		
@@ -661,15 +669,19 @@
 	}
 
 	StartTime = SkOsGetTime(pAC);
+	
 	do {
 		if (SkOsGetTime(pAC) - StartTime > SK_TICKS_PER_SEC / 8) {
+			
 			SK_I2C_STOP(IoC);
 #ifndef SK_DIAG
 			SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_I2C_E016, SKERR_I2C_E016MSG);
-#endif	/* !SK_DIAG */
+#endif /* !SK_DIAG */
 			return;
 		}
+		
 		SK_IN32(IoC, B0_ISRC, &IrqSrc);
+
 	} while ((IrqSrc & IS_I2C_READY) == 0);
 
 	pSen->SenState = SK_SEN_IDLE;
@@ -687,18 +699,19 @@
 SK_IOC	IoC,		/* I/O Context */
 SK_U32	I2cData,	/* I2C Data to write */
 int		I2cDev,		/* I2C Device Address */
+int		I2cDevSize, /* I2C Device Size (e.g. I2C_025K_DEV or I2C_2K_DEV) */
 int		I2cReg,		/* I2C Device Register Address */
 int		I2cBurst)	/* I2C Burst Flag */
 {
 	SK_OUT32(IoC, B2_I2C_DATA, I2cData);
-	SK_I2C_CTL(IoC, I2C_WRITE, I2cDev, I2cReg, I2cBurst);
+	
+	SK_I2C_CTL(IoC, I2C_WRITE, I2cDev, I2cDevSize, I2cReg, I2cBurst);
 	
 	return(SkI2cWait(pAC, IoC, I2C_WRITE));
 }	/* SkI2cWrite*/
 
 
 #ifdef	SK_DIAG
-
 /*
  * reads a single byte or 4 bytes from the I2C device
  *
@@ -708,23 +721,24 @@
 SK_AC	*pAC,		/* Adapter Context */
 SK_IOC	IoC,		/* I/O Context */
 int		I2cDev,		/* I2C Device Address */
+int		I2cDevSize, /* I2C Device Size (e.g. I2C_025K_DEV or I2C_2K_DEV) */
 int		I2cReg,		/* I2C Device Register Address */
 int		I2cBurst)	/* I2C Burst Flag */
 {
 	SK_U32	Data;
 
 	SK_OUT32(IoC, B2_I2C_DATA, 0);
-	SK_I2C_CTL(IoC, I2C_READ, I2cDev, I2cReg, I2cBurst);
+	SK_I2C_CTL(IoC, I2C_READ, I2cDev, I2cDevSize, I2cReg, I2cBurst);
 	
 	if (SkI2cWait(pAC, IoC, I2C_READ) != 0) {
 		w_print("%s\n", SKERR_I2C_E002MSG);
 	}
 	
 	SK_IN32(IoC, B2_I2C_DATA, &Data);
+	
 	return(Data);
 }	/* SkI2cRead */
-
-#endif	/* SK_DIAG */
+#endif /* SK_DIAG */
 
 
 /*
@@ -745,9 +759,10 @@
     if (pSen->SenRead != NULL) {
         return((*pSen->SenRead)(pAC, IoC, pSen));
     }
-    else
+	else {
         return(0); /* no success */
-}	/* SkI2cReadSensor*/
+	}
+}	/* SkI2cReadSensor */
 
 /*
  * Do the Init state 0 initialization
@@ -761,12 +776,12 @@
 	pAC->I2c.CurrSens = 0;
 	
 	/* Begin with timeout control for state machine */
-	pAC->I2c.TimerMode = SK_TIMER_WATCH_STATEMACHINE;
+	pAC->I2c.TimerMode = SK_TIMER_WATCH_SM;
 	
 	/* Set sensor number to zero */
 	pAC->I2c.MaxSens = 0;
 
-#ifndef	SK_DIAG
+#ifndef SK_DIAG
 	/* Initialize Number of Dummy Reads */
 	pAC->I2c.DummyReads = SK_MAX_SENSORS;
 #endif
@@ -840,19 +855,20 @@
     }
 
 	/* Check for 64 Bit Yukon without sensors */
-	if (SkI2cWrite(pAC, IoC, 0, LM80_ADDR, LM80_CFG, 0) != 0) {
+	if (SkI2cWrite(pAC, IoC, 0, LM80_ADDR, I2C_025K_DEV, LM80_CFG, 0) != 0) {
         return(0);
     }
 
-	(void)SkI2cWrite(pAC, IoC, 0xff, LM80_ADDR, LM80_IMSK_1, 0);
+	(void)SkI2cWrite(pAC, IoC, 0xffUL, LM80_ADDR, I2C_025K_DEV, LM80_IMSK_1, 0);
 	
-	(void)SkI2cWrite(pAC, IoC, 0xff, LM80_ADDR, LM80_IMSK_2, 0);
+	(void)SkI2cWrite(pAC, IoC, 0xffUL, LM80_ADDR, I2C_025K_DEV, LM80_IMSK_2, 0);
 	
-	(void)SkI2cWrite(pAC, IoC, 0, LM80_ADDR, LM80_FAN_CTRL, 0);
+	(void)SkI2cWrite(pAC, IoC, 0, LM80_ADDR, I2C_025K_DEV, LM80_FAN_CTRL, 0);
 	
-	(void)SkI2cWrite(pAC, IoC, 0, LM80_ADDR, LM80_TEMP_CTRL, 0);
+	(void)SkI2cWrite(pAC, IoC, 0, LM80_ADDR, I2C_025K_DEV, LM80_TEMP_CTRL, 0);
 	
-	(void)SkI2cWrite(pAC, IoC, LM80_CFG_START, LM80_ADDR, LM80_CFG, 0);
+	(void)SkI2cWrite(pAC, IoC, (SK_U32)LM80_CFG_START, LM80_ADDR, I2C_025K_DEV,
+		LM80_CFG, 0);
 	
 	/*
 	 * MaxSens has to be updated here, because PhyType is not
@@ -957,7 +973,7 @@
 				pAC->I2c.SenTable[i].SenThreErrLow = SK_SEN_PHY_2V5_LOW_ERR;
 			}
 			else {
-				pAC->I2c.SenTable[i].SenDesc = "Voltage ASIC-Co 1V5";
+				pAC->I2c.SenTable[i].SenDesc = "Voltage Core 1V5";
 				pAC->I2c.SenTable[i].SenThreErrHigh = SK_SEN_CORE_1V5_HIGH_ERR;
 				pAC->I2c.SenTable[i].SenThreWarnHigh = SK_SEN_CORE_1V5_HIGH_WARN;
 				pAC->I2c.SenTable[i].SenThreWarnLow = SK_SEN_CORE_1V5_LOW_WARN;
@@ -1015,9 +1031,9 @@
 		pAC->I2c.SenTable[i].SenDev = LM80_ADDR;
 	}
 
-#ifndef	SK_DIAG
+#ifndef SK_DIAG
 	pAC->I2c.DummyReads = pAC->I2c.MaxSens;
-#endif	/* !SK_DIAG */
+#endif /* !SK_DIAG */
 	
 	/* Clear I2C IRQ */
 	SK_OUT32(IoC, B2_I2C_IRQ, I2C_CLR_IRQ);
@@ -1208,15 +1224,13 @@
 			pSen->SenLastErrLogTS = CurrTime;
 
 			if (pSen->SenType == SK_SEN_TEMP) {
-				SK_ERR_LOG(pAC, SK_ERRCL_HW, SKERR_I2C_E011,
-					SKERR_I2C_E011MSG);
-			} else if (pSen->SenType == SK_SEN_VOLT) {
-				SK_ERR_LOG(pAC, SK_ERRCL_HW, SKERR_I2C_E012,
-					SKERR_I2C_E012MSG);
-			} else
-			{
-				SK_ERR_LOG(pAC, SK_ERRCL_HW, SKERR_I2C_E015,
-					SKERR_I2C_E015MSG);
+				SK_ERR_LOG(pAC, SK_ERRCL_HW, SKERR_I2C_E011, SKERR_I2C_E011MSG);
+			}
+			else if (pSen->SenType == SK_SEN_VOLT) {
+				SK_ERR_LOG(pAC, SK_ERRCL_HW, SKERR_I2C_E012, SKERR_I2C_E012MSG);
+			}
+			else {
+				SK_ERR_LOG(pAC, SK_ERRCL_HW, SKERR_I2C_E015, SKERR_I2C_E015MSG);
 			}
 		}
 	}
@@ -1235,8 +1249,7 @@
 			/* This state is the former one */
 
 			/* So check first whether we have to send a trap */
-			if (pSen->SenLastWarnTrapTS + SK_SEN_WARN_TR_HOLD >
-			    CurrTime) {
+			if (pSen->SenLastWarnTrapTS + SK_SEN_WARN_TR_HOLD > CurrTime) {
 				/*
 				 * Do NOT send the Trap. The hold back time
 				 * has to run out first.
@@ -1245,8 +1258,7 @@
 			}
 
 			/* Check now whether we have to log an Error */
-			if (pSen->SenLastWarnLogTS + SK_SEN_WARN_LOG_HOLD >
-			    CurrTime) {
+			if (pSen->SenLastWarnLogTS + SK_SEN_WARN_LOG_HOLD > CurrTime) {
 				/*
 				 * Do NOT log the error. The hold back time
 				 * has to run out first.
@@ -1277,15 +1289,13 @@
 			pSen->SenLastWarnLogTS = CurrTime;
 
 			if (pSen->SenType == SK_SEN_TEMP) {
-				SK_ERR_LOG(pAC, SK_ERRCL_HW, SKERR_I2C_E009,
-					SKERR_I2C_E009MSG);
-			} else if (pSen->SenType == SK_SEN_VOLT) {
-				SK_ERR_LOG(pAC, SK_ERRCL_HW, SKERR_I2C_E010,
-					SKERR_I2C_E010MSG);
-			} else
-			{
-				SK_ERR_LOG(pAC, SK_ERRCL_HW, SKERR_I2C_E014,
-					SKERR_I2C_E014MSG);
+				SK_ERR_LOG(pAC, SK_ERRCL_HW, SKERR_I2C_E009, SKERR_I2C_E009MSG);
+			}
+			else if (pSen->SenType == SK_SEN_VOLT) {
+				SK_ERR_LOG(pAC, SK_ERRCL_HW, SKERR_I2C_E010, SKERR_I2C_E010MSG);
+			}
+			else {
+				SK_ERR_LOG(pAC, SK_ERRCL_HW, SKERR_I2C_E014, SKERR_I2C_E014MSG);
 			}
 		}
 	}
@@ -1317,7 +1327,7 @@
 		}
 	}
 	
-#if 0
+#ifdef TEST_ONLY
     /* Dynamic thresholds also for VAUX of LM80 sensor */
 	if (pSen->SenInit == SK_SEN_DYN_INIT_VAUX) {
 
@@ -1359,7 +1369,7 @@
 	if (pSen->SenInit != SK_SEN_DYN_INIT_NONE) {
 		SK_ERR_LOG(pAC, SK_ERRCL_HW, SKERR_I2C_E013, SKERR_I2C_E013MSG);
 	}
-}	/* SkI2cCheckSensor*/
+}	/* SkI2cCheckSensor */
 
 
 /*
@@ -1390,7 +1400,7 @@
 
 		if (ReadComplete) {
 			/* Check sensor against defined thresholds */
-			SkI2cCheckSensor (pAC, pSen);
+			SkI2cCheckSensor(pAC, pSen);
 
 			/* Increment Current sensor and set appropriate Timeout */
 			pAC->I2c.CurrSens++;
@@ -1414,7 +1424,7 @@
 			/* Start Timer */
 			ParaLocal.Para64 = (SK_U64)0;
 
-			pAC->I2c.TimerMode = SK_TIMER_WATCH_STATEMACHINE;
+			pAC->I2c.TimerMode = SK_TIMER_WATCH_SM;
 
             SkTimerStart(pAC, IoC, &pAC->I2c.SenTimer, SK_I2C_TIM_WATCH,
 				SKGE_I2C, SK_I2CEV_TIM, ParaLocal);
@@ -1431,7 +1441,7 @@
 
 			if (ReadComplete) {
 				/* Check sensor against defined thresholds */
-				SkI2cCheckSensor (pAC, pSen);
+				SkI2cCheckSensor(pAC, pSen);
 
 				/* Increment Current sensor and set appropriate Timeout */
 				pAC->I2c.CurrSens++;
@@ -1496,4 +1506,4 @@
 	return(0);
 }	/* SkI2cEvent*/
 
-#endif	/* !SK_DIAG */
+#endif /* !SK_DIAG */
diff -Nru a/drivers/net/sk98lin/sklm80.c b/drivers/net/sk98lin/sklm80.c
--- a/drivers/net/sk98lin/sklm80.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/net/sk98lin/sklm80.c	Tue Feb  3 19:45:41 2004
@@ -1,16 +1,17 @@
 /******************************************************************************
  *
  * Name:	sklm80.c
- * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.20 $
- * Date:	$Date: 2002/08/13 09:16:27 $
- * Purpose:	Funktions to access Voltage and Temperature Sensor (LM80)
+ * Project:	Gigabit Ethernet Adapters, TWSI-Module
+ * Version:	$Revision: 1.22 $
+ * Date:	$Date: 2003/10/20 09:08:21 $
+ * Purpose:	Functions to access Voltage and Temperature Sensor (LM80)
  *
  ******************************************************************************/
 
 /******************************************************************************
  *
- *	(C)Copyright 1998-2002 SysKonnect GmbH.
+ *	(C)Copyright 1998-2002 SysKonnect.
+ *	(C)Copyright 2002-2003 Marvell.
  *
  *	This program is free software; you can redistribute it and/or modify
  *	it under the terms of the GNU General Public License as published by
@@ -26,15 +27,21 @@
  * History:
  *
  *	$Log: sklm80.c,v $
+ *	Revision 1.22  2003/10/20 09:08:21  rschmidt
+ *	Editorial changes.
+ *	
+ *	Revision 1.21  2003/09/23 09:29:04  malthoff
+ *	Parameter Dev_Size added to macro SK_I2C_CTL.
+ *	
  *	Revision 1.20  2002/08/13 09:16:27  rschmidt
  *	Changed return value for SkLm80ReadSensor() back to 'int'
- *	Editorial changes
+ *	Editorial changes.
  *	
  *	Revision 1.19  2002/08/06 09:43:31  jschmalz
- *	Extensions and changes for Yukon
+ *	Extensions and changes for Yukon.
  *	
  *	Revision 1.18  2002/08/02 12:26:57  rschmidt
- *	Editorial changes
+ *	Editorial changes.
  *	
  *	Revision 1.17  1999/11/22 13:35:51  cgoos
  *	Changed license header to GPL.
@@ -93,16 +100,15 @@
  *	Revision 1.1  1998/07/17 09:57:12  gklug
  *	initial version
  *
- *
- *
  ******************************************************************************/
 
-
 /*
 	LM80 functions
 */
+#if (defined(DEBUG) || ((!defined(LINT)) && (!defined(SK_SLIM))))
 static const char SysKonnectFileId[] =
-	"$Id: sklm80.c,v 1.20 2002/08/13 09:16:27 rschmidt Exp $" ;
+	"@(#) $Id: sklm80.c,v 1.22 2003/10/20 09:08:21 rschmidt Exp $ (C) Marvell. ";
+#endif
 
 #include "h/skdrv1st.h"		/* Driver Specific Definitions */
 #include "h/lm80.h"
@@ -202,7 +208,7 @@
 	switch (pSen->SenState) {
 	case SK_SEN_IDLE:
 		/* Send address to ADDR register */
-		SK_I2C_CTL(IoC, I2C_READ, pSen->SenDev, pSen->SenReg, 0);
+		SK_I2C_CTL(IoC, I2C_READ, pSen->SenDev, I2C_025K_DEV, pSen->SenReg, 0);
 
 		pSen->SenState = SK_SEN_VALUE ;
 		BREAK_OR_WAIT(pAC, IoC, I2C_READ);
@@ -250,7 +256,7 @@
 			(pSen->SenValue % SK_LM80_TEMP_LSB);
 
 		/* Send address to ADDR register */
-		SK_I2C_CTL(IoC, I2C_READ, pSen->SenDev, LM80_TEMP_CTRL, 0);
+		SK_I2C_CTL(IoC, I2C_READ, pSen->SenDev, I2C_025K_DEV, LM80_TEMP_CTRL, 0);
 
 		pSen->SenState = SK_SEN_VALEXT ;
 		BREAK_OR_WAIT(pAC, IoC, I2C_READ);
@@ -284,3 +290,4 @@
 	/* Not completed */
 	return(0);
 }
+
diff -Nru a/drivers/net/sk98lin/skproc.c b/drivers/net/sk98lin/skproc.c
--- a/drivers/net/sk98lin/skproc.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/sk98lin/skproc.c	Tue Feb  3 19:45:16 2004
@@ -1,16 +1,17 @@
 /******************************************************************************
  *
- * Name:    skproc.c
+ * Name:	skproc.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.2 $
- * Date:    $Date: 2003/08/12 16:45:29 $
+ * Version:	$Revision: 1.11 $
+ * Date:	$Date: 2003/12/11 16:03:57 $
  * Purpose:	Funktions to display statictic data
  *
  ******************************************************************************/
  
 /******************************************************************************
  *
- *	(C)Copyright 1998-2003 SysKonnect GmbH.
+ *	(C)Copyright 1998-2002 SysKonnect GmbH.
+ *	(C)Copyright 2002-2003 Marvell.
  *
  *	This program is free software; you can redistribute it and/or modify
  *	it under the terms of the GNU General Public License as published by
@@ -28,6 +29,33 @@
  * History:
  *
  *	$Log: skproc.c,v $
+ *	Revision 1.11  2003/12/11 16:03:57  mlindner
+ *	Fix: Create backup from pnmi data structure
+ *	
+ *	Revision 1.10  2003/11/19 16:25:36  mlindner
+ *	Fix: Print output as 64-bit digit
+ *	
+ *	Revision 1.9  2003/11/17 13:29:05  mlindner
+ *	Fix: Editorial changes
+ *	
+ *	Revision 1.8  2003/11/13 14:18:48  rroesler
+ *	Fix: added latest changes regarding the use of the proc system
+ *	
+ *	Revision 1.7  2003/11/10 09:35:07  rroesler
+ *	Fix: diag backup restore of PNMI structure
+ *	
+ *	Revision 1.6  2003/11/07 17:31:39  rroesler
+ *	Add: security counter for the proc file system
+ *	
+ *	Revision 1.5  2003/10/07 08:17:08  mlindner
+ *	Fix: Copyright changes
+ *	
+ *	Revision 1.4  2003/09/01 15:29:24  mlindner
+ *	Fix: Editorial changes
+ *	
+ *	Revision 1.3  2003/08/29 12:30:58  mlindner
+ *	Add: Version entry in the proc file system
+ *	
  *	Revision 1.2  2003/08/12 16:45:29  mlindner
  *	Add: Removed SkNumber and SkDoDiv
  *	Add: Counter output as (unsigned long long)
@@ -94,223 +122,350 @@
 
 #include "h/skdrv1st.h"
 #include "h/skdrv2nd.h"
+#include "h/skversion.h"
 
-#ifdef CONFIG_PROC_FS
+extern struct SK_NET_DEVICE *SkGeRootDev;
+static int sk_proc_print(void *writePtr, char *format, ...);
+static void sk_gen_browse(void *buffer);
+int len;
 
-extern struct net_device	*SkGeRootDev;
+static int sk_seq_show(struct seq_file *seq, void *v);
+static int sk_proc_open(struct inode *inode, struct file *file);
+struct file_operations sk_proc_fops = {
+	.owner		= THIS_MODULE,
+	.open		= sk_proc_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= single_release,
+};
+struct net_device *currDev = NULL;
 
-static int sk_seq_show(struct seq_file *seq, void *v)
+/*****************************************************************************
+ *
+ * 	sk_gen_browse -generic  print "summaries" entry 
+ *
+ * Description:
+ *  This function fills the proc entry with statistic data about 
+ *  the ethernet device.
+ *  
+ * Returns: -
+ *	
+ */
+static void sk_gen_browse(void *buffer)
 {
-	struct net_device *dev = seq->private;
-	DEV_NET		*pNet = dev->priv;
-	SK_AC		*pAC = pNet->pAC;
-	SK_PNMI_STRUCT_DATA *pPnmiStruct = &pAC->PnmiStruct;
-	SK_PNMI_STAT	*pPnmiStat = &pPnmiStruct->Stat[0];
-	int unit = !(pAC->dev[0] == dev);
-	int i;
-	char sens_msg[50];
-
-	seq_printf(seq,
-		   "\nDetailed statistic for device %s\n",
-		   dev->name);
-	seq_printf(seq,
-		   "=======================================\n");
-	
-	/* Board statistics */
-	seq_printf(seq, 
-		   "\nBoard statistics\n\n");
-	seq_printf(seq,
-		   "Active Port                    %c\n",
-		   'A' + pAC->Rlmt.Net[unit].Port[pAC->Rlmt.
-						 Net[unit].PrefPort]->PortNumber);
-	seq_printf(seq,
-		   "Preferred Port                 %c\n",
-		   'A' + pAC->Rlmt.Net[unit].Port[pAC->Rlmt.
-						 Net[unit].PrefPort]->PortNumber);
-
-	seq_printf(seq,
-		   "Bus speed (MHz)                %d\n",
-		   pPnmiStruct->BusSpeed);
-
-	seq_printf(seq,
-		   "Bus width (Bit)                %d\n",
-		   pPnmiStruct->BusWidth);
-	seq_printf(seq,
-		   "Hardware revision              v%d.%d\n",
-		   (pAC->GIni.GIPciHwRev >> 4) & 0x0F,
-		   pAC->GIni.GIPciHwRev & 0x0F);
-
-	/* Print sensor informations */
-	for (i=0; i < pAC->I2c.MaxSens; i ++) {
-		/* Check type */
-		switch (pAC->I2c.SenTable[i].SenType) {
-		case 1:
-			strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc);
-			strcat(sens_msg, " (C)");
-			seq_printf(seq,
-				   "%-25s      %d.%02d\n",
-				   sens_msg,
-				   pAC->I2c.SenTable[i].SenValue / 10,
-				   pAC->I2c.SenTable[i].SenValue % 10);
-
-			strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc);
-			strcat(sens_msg, " (F)");
-			seq_printf(seq,
-				   "%-25s      %d.%02d\n",
-				   sens_msg,
-				   ((((pAC->I2c.SenTable[i].SenValue)
-				      *10)*9)/5 + 3200)/100,
-				   ((((pAC->I2c.SenTable[i].SenValue)
-				      *10)*9)/5 + 3200) % 10);
-			break;
-		case 2:
-			strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc);
-			strcat(sens_msg, " (V)");
-			seq_printf(seq,
-				   "%-25s      %d.%03d\n",
-				   sens_msg,
-				   pAC->I2c.SenTable[i].SenValue / 1000,
-				   pAC->I2c.SenTable[i].SenValue % 1000);
-			break;
-		case 3:
-			strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc);
-			strcat(sens_msg, " (rpm)");
-			seq_printf(seq,
-				   "%-25s      %d\n",
-				   sens_msg,
-				   pAC->I2c.SenTable[i].SenValue);
-			break;
-		default:
-			break;
+	struct SK_NET_DEVICE	*SkgeProcDev = SkGeRootDev;
+	struct SK_NET_DEVICE	*next;
+	SK_PNMI_STRUCT_DATA 	*pPnmiStruct;
+	SK_PNMI_STAT		*pPnmiStat;
+	unsigned long		Flags;	
+	unsigned int		Size;
+	DEV_NET			*pNet;
+	SK_AC			*pAC;
+	char			sens_msg[50];
+	int			MaxSecurityCount = 0;
+	int 			t;
+	int 			i;
+
+	while (SkgeProcDev) {
+		MaxSecurityCount++;
+		if (MaxSecurityCount > 100) {
+			printk("Max limit for sk_proc_read security counter!\n");
+			return;
 		}
-	}
+		pNet = (DEV_NET*) SkgeProcDev->priv;
+		pAC = pNet->pAC;
+		next = pAC->Next;
+		pPnmiStruct = &pAC->PnmiStruct;
+		/* NetIndex in GetStruct is now required, zero is only dummy */
+
+		for (t=pAC->GIni.GIMacsFound; t > 0; t--) {
+			if ((pAC->GIni.GIMacsFound == 2) && pAC->RlmtNets == 1)
+				t--;
+
+			spin_lock_irqsave(&pAC->SlowPathLock, Flags);
+			Size = SK_PNMI_STRUCT_SIZE;
+#ifdef SK_DIAG_SUPPORT
+			if (pAC->BoardLevel == SK_INIT_DATA) {
+				SK_MEMCPY(&(pAC->PnmiStruct), &(pAC->PnmiBackup), sizeof(SK_PNMI_STRUCT_DATA));
+				if (pAC->DiagModeActive == DIAG_NOTACTIVE) {
+					pAC->Pnmi.DiagAttached = SK_DIAG_IDLE;
+				}
+			} else {
+				SkPnmiGetStruct(pAC, pAC->IoBase, pPnmiStruct, &Size, t-1);
+			}
+#else
+			SkPnmiGetStruct(pAC, pAC->IoBase, 
+				pPnmiStruct, &Size, t-1);
+#endif
+			spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
+	
+			if (strcmp(pAC->dev[t-1]->name, currDev->name) == 0) {
+				pPnmiStat = &pPnmiStruct->Stat[0];
+				len = sk_proc_print(buffer, 
+					"\nDetailed statistic for device %s\n",
+					pAC->dev[t-1]->name);
+				len += sk_proc_print(buffer,
+					"=======================================\n");
+	
+				/* Board statistics */
+				len += sk_proc_print(buffer, 
+					"\nBoard statistics\n\n");
+				len += sk_proc_print(buffer,
+					"Active Port                    %c\n",
+					'A' + pAC->Rlmt.Net[t-1].Port[pAC->Rlmt.
+					Net[t-1].PrefPort]->PortNumber);
+				len += sk_proc_print(buffer,
+					"Preferred Port                 %c\n",
+					'A' + pAC->Rlmt.Net[t-1].Port[pAC->Rlmt.
+					Net[t-1].PrefPort]->PortNumber);
+
+				len += sk_proc_print(buffer,
+					"Bus speed (MHz)                %d\n",
+					pPnmiStruct->BusSpeed);
+
+				len += sk_proc_print(buffer,
+					"Bus width (Bit)                %d\n",
+					pPnmiStruct->BusWidth);
+				len += sk_proc_print(buffer,
+					"Driver version                 %s\n",
+					VER_STRING);
+				len += sk_proc_print(buffer,
+					"Hardware revision              v%d.%d\n",
+					(pAC->GIni.GIPciHwRev >> 4) & 0x0F,
+					pAC->GIni.GIPciHwRev & 0x0F);
+
+				/* Print sensor informations */
+				for (i=0; i < pAC->I2c.MaxSens; i ++) {
+					/* Check type */
+					switch (pAC->I2c.SenTable[i].SenType) {
+					case 1:
+						strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc);
+						strcat(sens_msg, " (C)");
+						len += sk_proc_print(buffer,
+							"%-25s      %d.%02d\n",
+							sens_msg,
+							pAC->I2c.SenTable[i].SenValue / 10,
+							pAC->I2c.SenTable[i].SenValue % 10);
+
+						strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc);
+						strcat(sens_msg, " (F)");
+						len += sk_proc_print(buffer,
+							"%-25s      %d.%02d\n",
+							sens_msg,
+							((((pAC->I2c.SenTable[i].SenValue)
+							*10)*9)/5 + 3200)/100,
+							((((pAC->I2c.SenTable[i].SenValue)
+							*10)*9)/5 + 3200) % 10);
+						break;
+					case 2:
+						strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc);
+						strcat(sens_msg, " (V)");
+						len += sk_proc_print(buffer,
+							"%-25s      %d.%03d\n",
+							sens_msg,
+							pAC->I2c.SenTable[i].SenValue / 1000,
+							pAC->I2c.SenTable[i].SenValue % 1000);
+						break;
+					case 3:
+						strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc);
+						strcat(sens_msg, " (rpm)");
+						len += sk_proc_print(buffer,
+							"%-25s      %d\n",
+							sens_msg,
+							pAC->I2c.SenTable[i].SenValue);
+						break;
+					default:
+						break;
+					}
+				}
 				
-	/*Receive statistics */
-	seq_printf(seq, 
-		   "\nReceive statistics\n\n");
-
-	seq_printf(seq,
-		   "Received bytes                 %Ld\n",
-		   (unsigned long long) pPnmiStat->StatRxOctetsOkCts);
-	seq_printf(seq,
-		   "Received packets               %Ld\n",
-		   (unsigned long long) pPnmiStat->StatRxOkCts);
+				/*Receive statistics */
+				len += sk_proc_print(buffer, 
+				"\nReceive statistics\n\n");
+
+				len += sk_proc_print(buffer,
+					"Received bytes                 %Lu\n",
+					(unsigned long long) pPnmiStat->StatRxOctetsOkCts);
+				len += sk_proc_print(buffer,
+					"Received packets               %Lu\n",
+					(unsigned long long) pPnmiStat->StatRxOkCts);
 #if 0
-	if (pAC->GIni.GP[0].PhyType == SK_PHY_XMAC && 
-	    pAC->HWRevision < 12) {
-		pPnmiStruct->InErrorsCts = pPnmiStruct->InErrorsCts - 
-			pPnmiStat->StatRxShortsCts;
-		pPnmiStat->StatRxShortsCts = 0;
-	}
+				if (pAC->GIni.GP[0].PhyType == SK_PHY_XMAC && 
+					pAC->HWRevision < 12) {
+					pPnmiStruct->InErrorsCts = pPnmiStruct->InErrorsCts - 
+						pPnmiStat->StatRxShortsCts;
+					pPnmiStat->StatRxShortsCts = 0;
+				}
 #endif
-	if (pNet->Mtu > 1500) 
-		pPnmiStruct->InErrorsCts = pPnmiStruct->InErrorsCts -
-			pPnmiStat->StatRxTooLongCts;
-
-	seq_printf(seq,
-		   "Receive errors                 %Ld\n",
-		   (unsigned long long) pPnmiStruct->InErrorsCts);
-	seq_printf(seq,
-		   "Receive dropped                %Ld\n",
-		   (unsigned long long) pPnmiStruct->RxNoBufCts);
-	seq_printf(seq,
-		   "Received multicast             %Ld\n",
-		   (unsigned long long) pPnmiStat->StatRxMulticastOkCts);
-	seq_printf(seq,
-		   "Receive error types\n");
-	seq_printf(seq,
-		   "   length                      %Ld\n",
-		   (unsigned long long) pPnmiStat->StatRxRuntCts);
-	seq_printf(seq,
-		   "   buffer overflow             %Ld\n",
-		   (unsigned long long) pPnmiStat->StatRxFifoOverflowCts);
-	seq_printf(seq,
-		   "   bad crc                     %Ld\n",
-		   (unsigned long long) pPnmiStat->StatRxFcsCts);
-	seq_printf(seq,
-		   "   framing                     %Ld\n",
-		   (unsigned long long) pPnmiStat->StatRxFramingCts);
-	seq_printf(seq,
-		   "   missed frames               %Ld\n",
-		   (unsigned long long) pPnmiStat->StatRxMissedCts);
-
-	if (pNet->Mtu > 1500)
-		pPnmiStat->StatRxTooLongCts = 0;
-
-	seq_printf(seq,
-		   "   too long                    %Ld\n",
-		   (unsigned long long) pPnmiStat->StatRxTooLongCts);					
-	seq_printf(seq,
-		   "   carrier extension           %Ld\n",
-		   (unsigned long long) pPnmiStat->StatRxCextCts);				
-	seq_printf(seq,
-		   "   too short                   %Ld\n",
-		   (unsigned long long) pPnmiStat->StatRxShortsCts);				
-	seq_printf(seq,
-		   "   symbol                      %Ld\n",
-		   (unsigned long long) pPnmiStat->StatRxSymbolCts);				
-	seq_printf(seq,
-		   "   LLC MAC size                %Ld\n",
-		   (unsigned long long) pPnmiStat->StatRxIRLengthCts);				
-	seq_printf(seq,
-		   "   carrier event               %Ld\n",
-		   (unsigned long long) pPnmiStat->StatRxCarrierCts);				
-	seq_printf(seq,
-		   "   jabber                      %Ld\n",
-		   (unsigned long long) pPnmiStat->StatRxJabberCts);				
-
-
-	/*Transmit statistics */
-	seq_printf(seq, 
-		   "\nTransmit statistics\n\n");
+				if (pNet->Mtu > 1500) 
+					pPnmiStruct->InErrorsCts = pPnmiStruct->InErrorsCts -
+						pPnmiStat->StatRxTooLongCts;
+
+				len += sk_proc_print(buffer,
+					"Receive errors                 %Lu\n",
+					(unsigned long long) pPnmiStruct->InErrorsCts);
+				len += sk_proc_print(buffer,
+					"Receive dropped                %Lu\n",
+					(unsigned long long) pPnmiStruct->RxNoBufCts);
+				len += sk_proc_print(buffer,
+					"Received multicast             %Lu\n",
+					(unsigned long long) pPnmiStat->StatRxMulticastOkCts);
+				len += sk_proc_print(buffer,
+					"Receive error types\n");
+				len += sk_proc_print(buffer,
+					"   length                      %Lu\n",
+					(unsigned long long) pPnmiStat->StatRxRuntCts);
+				len += sk_proc_print(buffer,
+					"   buffer overflow             %Lu\n",
+					(unsigned long long) pPnmiStat->StatRxFifoOverflowCts);
+				len += sk_proc_print(buffer,
+					"   bad crc                     %Lu\n",
+					(unsigned long long) pPnmiStat->StatRxFcsCts);
+				len += sk_proc_print(buffer,
+					"   framing                     %Lu\n",
+					(unsigned long long) pPnmiStat->StatRxFramingCts);
+				len += sk_proc_print(buffer,
+					"   missed frames               %Lu\n",
+					(unsigned long long) pPnmiStat->StatRxMissedCts);
+
+				if (pNet->Mtu > 1500)
+					pPnmiStat->StatRxTooLongCts = 0;
+
+				len += sk_proc_print(buffer,
+					"   too long                    %Lu\n",
+					(unsigned long long) pPnmiStat->StatRxTooLongCts);					
+				len += sk_proc_print(buffer,
+					"   carrier extension           %Lu\n",
+					(unsigned long long) pPnmiStat->StatRxCextCts);				
+				len += sk_proc_print(buffer,
+					"   too short                   %Lu\n",
+					(unsigned long long) pPnmiStat->StatRxShortsCts);				
+				len += sk_proc_print(buffer,
+					"   symbol                      %Lu\n",
+					(unsigned long long) pPnmiStat->StatRxSymbolCts);				
+				len += sk_proc_print(buffer,
+					"   LLC MAC size                %Lu\n",
+					(unsigned long long) pPnmiStat->StatRxIRLengthCts);				
+				len += sk_proc_print(buffer,
+					"   carrier event               %Lu\n",
+					(unsigned long long) pPnmiStat->StatRxCarrierCts);				
+				len += sk_proc_print(buffer,
+					"   jabber                      %Lu\n",
+					(unsigned long long) pPnmiStat->StatRxJabberCts);				
+
+
+				/*Transmit statistics */
+				len += sk_proc_print(buffer, 
+				"\nTransmit statistics\n\n");
 				
-	seq_printf(seq,
-		   "Transmited bytes               %Ld\n",
-		   (unsigned long long) pPnmiStat->StatTxOctetsOkCts);
-	seq_printf(seq,
-		   "Transmited packets             %Ld\n",
-		   (unsigned long long) pPnmiStat->StatTxOkCts);
-	seq_printf(seq,
-		   "Transmit errors                %Ld\n",
-		   (unsigned long long) pPnmiStat->StatTxSingleCollisionCts);
-	seq_printf(seq,
-		   "Transmit dropped               %Ld\n",
-		   (unsigned long long) pPnmiStruct->TxNoBufCts);
-	seq_printf(seq,
-		   "Transmit collisions            %Ld\n",
-		   (unsigned long long) pPnmiStat->StatTxSingleCollisionCts);
-	seq_printf(seq,
-		   "Transmit error types\n");
-	seq_printf(seq,
-		   "   excessive collision         %ld\n",
-		   pAC->stats.tx_aborted_errors);
-	seq_printf(seq,
-		   "   carrier                     %Ld\n",
-		   (unsigned long long) pPnmiStat->StatTxCarrierCts);
-	seq_printf(seq,
-		   "   fifo underrun               %Ld\n",
-		   (unsigned long long) pPnmiStat->StatTxFifoUnderrunCts);
-	seq_printf(seq,
-		   "   heartbeat                   %Ld\n",
-		   (unsigned long long) pPnmiStat->StatTxCarrierCts);
-	seq_printf(seq,
-		   "   window                      %ld\n",
-		   pAC->stats.tx_window_errors);
+				len += sk_proc_print(buffer,
+					"Transmited bytes               %Lu\n",
+					(unsigned long long) pPnmiStat->StatTxOctetsOkCts);
+				len += sk_proc_print(buffer,
+					"Transmited packets             %Lu\n",
+					(unsigned long long) pPnmiStat->StatTxOkCts);
+				len += sk_proc_print(buffer,
+					"Transmit errors                %Lu\n",
+					(unsigned long long) pPnmiStat->StatTxSingleCollisionCts);
+				len += sk_proc_print(buffer,
+					"Transmit dropped               %Lu\n",
+					(unsigned long long) pPnmiStruct->TxNoBufCts);
+				len += sk_proc_print(buffer,
+					"Transmit collisions            %Lu\n",
+					(unsigned long long) pPnmiStat->StatTxSingleCollisionCts);
+				len += sk_proc_print(buffer,
+					"Transmit error types\n");
+				len += sk_proc_print(buffer,
+					"   excessive collision         %ld\n",
+					pAC->stats.tx_aborted_errors);
+				len += sk_proc_print(buffer,
+					"   carrier                     %Lu\n",
+					(unsigned long long) pPnmiStat->StatTxCarrierCts);
+				len += sk_proc_print(buffer,
+					"   fifo underrun               %Lu\n",
+					(unsigned long long) pPnmiStat->StatTxFifoUnderrunCts);
+				len += sk_proc_print(buffer,
+					"   heartbeat                   %Lu\n",
+					(unsigned long long) pPnmiStat->StatTxCarrierCts);
+				len += sk_proc_print(buffer,
+					"   window                      %ld\n",
+					pAC->stats.tx_window_errors);
 				
-	return 0;
+			} /* if (strcmp(pACname, currDeviceName) == 0) */
+		}
+		SkgeProcDev = next;
+	}
 }
 
+/*****************************************************************************
+ *
+ *      sk_proc_print -generic line print  
+ *
+ * Description:
+ *  This function fills the proc entry with statistic data about 
+ *  the ethernet device.
+ *  
+ * Returns: number of bytes written
+ *      
+ */ 
+static int sk_proc_print(void *writePtr, char *format, ...)
+{   
+#define MAX_LEN_SINGLE_LINE 256
+	char     str[MAX_LEN_SINGLE_LINE];
+	va_list  a_start;
+	int      lenght = 0;
+
+	struct seq_file *seq = (struct seq_file *) writePtr;
+
+	SK_MEMSET(str, 0, MAX_LEN_SINGLE_LINE);
+
+	va_start(a_start, format);
+	vsprintf(str, format, a_start);
+	va_end(a_start);
+
+	lenght = strlen(str);
 
+	seq_printf(seq, str);
+	return lenght;
+}
+
+/*****************************************************************************
+ *
+ *      sk_seq_show - show proc information of a particular adapter
+ *
+ * Description:
+ *  This function fills the proc entry with statistic data about 
+ *  the ethernet device. It invokes the generic sk_gen_browse() to
+ *  print out all items one per one.
+ *  
+ * Returns: number of bytes written
+ *      
+ */
+static int sk_seq_show(struct seq_file *seq, void *v)
+{
+    void *castedBuffer = (void *) seq;
+    currDev = seq->private;
+    sk_gen_browse(castedBuffer);
+    return 0;
+}
+
+/*****************************************************************************
+ *
+ *      sk_proc_open - register the show function when proc is open'ed
+ *  
+ * Description:
+ *  This function is called whenever a sk98lin proc file is queried.
+ *  
+ * Returns: the return value of single_open()
+ *      
+ */
 static int sk_proc_open(struct inode *inode, struct file *file)
 {
-	return single_open(file, sk_seq_show, PDE(inode)->data);
+    return single_open(file, sk_seq_show, PDE(inode)->data);
 }
 
-struct file_operations sk_proc_fops = {
-	.owner = THIS_MODULE,
-	.open  = sk_proc_open,
-	.read  = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
-#endif
+/*******************************************************************************
+ *
+ * End of file
+ *
+ ******************************************************************************/
diff -Nru a/drivers/net/sk98lin/skqueue.c b/drivers/net/sk98lin/skqueue.c
--- a/drivers/net/sk98lin/skqueue.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/sk98lin/skqueue.c	Tue Feb  3 19:45:17 2004
@@ -1,9 +1,9 @@
 /******************************************************************************
  *
  * Name:	skqueue.c
- * Project:	Gigabit Ethernet Adapters, Schedule-Modul
- * Version:	$Revision: 1.19 $
- * Date:	$Date: 2003/05/13 18:00:07 $
+ * Project:	Gigabit Ethernet Adapters, Event Scheduler Module
+ * Version:	$Revision: 1.20 $
+ * Date:	$Date: 2003/09/16 13:44:00 $
  * Purpose:	Management of an event queue.
  *
  ******************************************************************************/
@@ -27,6 +27,10 @@
  * History:
  *
  *	$Log: skqueue.c,v $
+ *	Revision 1.20  2003/09/16 13:44:00  rschmidt
+ *	Added (C) Marvell to SysKonnectFileId
+ *	Editorial changes
+ *	
  *	Revision 1.19  2003/05/13 18:00:07  mkarl
  *	Removed calls to RLMT, TWSI, and PNMI for SLIM driver (SK_SLIM).
  *	Editorial changes.
@@ -85,18 +89,16 @@
  *	
  *	Revision 1.1  1998/07/30 15:14:01  gklug
  *	Initial version. Adapted from SMT
- *	
- *	
  *
  ******************************************************************************/
 
 
 /*
-	Event queue and dispatcher
-*/
+ *	Event queue and dispatcher
+ */
 #if (defined(DEBUG) || ((!defined(LINT)) && (!defined(SK_SLIM))))
 static const char SysKonnectFileId[] =
-	"$Header: /usr56/projects/ge/schedule/skqueue.c,v 1.19 2003/05/13 18:00:07 mkarl Exp $" ;
+	"@(#) $Id: skqueue.c,v 1.20 2003/09/16 13:44:00 rschmidt Exp $ (C) Marvell.";
 #endif
 
 #include "h/skdrv1st.h"		/* Driver Specific Definitions */
@@ -124,11 +126,11 @@
 void	SkEventInit(
 SK_AC	*pAC,	/* Adapter context */
 SK_IOC	Ioc,	/* IO context */
-int	Level)	/* Init level */
+int		Level)	/* Init level */
 {
 	switch (Level) {
 	case SK_INIT_DATA:
-		pAC->Event.EvPut = pAC->Event.EvGet = pAC->Event.EvQueue ;
+		pAC->Event.EvPut = pAC->Event.EvGet = pAC->Event.EvQueue;
 		break;
 	default:
 		break;
@@ -144,14 +146,15 @@
 SK_U32		Event,	/* Event to be queued */
 SK_EVPARA	Para)	/* Event parameter */
 {
-	pAC->Event.EvPut->Class = Class ;
-	pAC->Event.EvPut->Event = Event ;
-	pAC->Event.EvPut->Para = Para ;
+	pAC->Event.EvPut->Class = Class;
+	pAC->Event.EvPut->Event = Event;
+	pAC->Event.EvPut->Para = Para;
+	
 	if (++pAC->Event.EvPut == &pAC->Event.EvQueue[SK_MAX_EVENT])
-		pAC->Event.EvPut = pAC->Event.EvQueue ;
+		pAC->Event.EvPut = pAC->Event.EvQueue;
 
 	if (pAC->Event.EvPut == pAC->Event.EvGet) {
-		SK_ERR_LOG(pAC, SK_ERRCL_NORES, SKERR_Q_E001, SKERR_Q_E001MSG) ;
+		SK_ERR_LOG(pAC, SK_ERRCL_NORES, SKERR_Q_E001, SKERR_Q_E001MSG);
 	}
 }
 
@@ -168,77 +171,79 @@
 SK_AC	*pAC,	/* Adapters Context */
 SK_IOC	Ioc)	/* Io context */
 {
-	SK_EVENTELEM	*pEv ;	/* pointer into queue */
-	SK_U32			Class ;
-	int			Rtv ;
-
-	pEv = pAC->Event.EvGet ;
-	PRINTF("dispatch get %x put %x\n",pEv,pAC->Event.ev_put) ;
+	SK_EVENTELEM	*pEv;	/* pointer into queue */
+	SK_U32			Class;
+	int			Rtv;
+
+	pEv = pAC->Event.EvGet;
+	
+	PRINTF("dispatch get %x put %x\n", pEv, pAC->Event.ev_put);
+	
 	while (pEv != pAC->Event.EvPut) {
-		PRINTF("dispatch Class %d Event %d\n",pEv->Class,pEv->Event) ;
-		switch(Class = pEv->Class) {
+		PRINTF("dispatch Class %d Event %d\n", pEv->Class, pEv->Event);
+
+		switch (Class = pEv->Class) {
 #ifndef SK_USE_LAC_EV
 #ifndef SK_SLIM
-		case SKGE_RLMT :	/* RLMT Event */
-			Rtv = SkRlmtEvent(pAC,Ioc,pEv->Event,pEv->Para);
-			break ;
-		case SKGE_I2C :		/* I2C Event */
-			Rtv = SkI2cEvent(pAC,Ioc,pEv->Event,pEv->Para);
-			break ;
-		case SKGE_PNMI :
-			Rtv = SkPnmiEvent(pAC,Ioc,pEv->Event,pEv->Para);
-			break ;
+		case SKGE_RLMT:		/* RLMT Event */
+			Rtv = SkRlmtEvent(pAC, Ioc, pEv->Event, pEv->Para);
+			break;
+		case SKGE_I2C:		/* I2C Event */
+			Rtv = SkI2cEvent(pAC, Ioc, pEv->Event, pEv->Para);
+			break;
+		case SKGE_PNMI:		/* PNMI Event */
+			Rtv = SkPnmiEvent(pAC, Ioc, pEv->Event, pEv->Para);
+			break;
 #endif	/* not SK_SLIM */
 #endif	/* not SK_USE_LAC_EV */
-		case SKGE_DRV :		/* Driver Event */
-			Rtv = SkDrvEvent(pAC,Ioc,pEv->Event,pEv->Para);
-			break ;
-#ifndef SK_USE_SW_TIMER        
-		case SKGE_HWAC :
-			Rtv = SkGeSirqEvent(pAC,Ioc,pEv->Event,pEv->Para);
-			break ;
+		case SKGE_DRV:		/* Driver Event */
+			Rtv = SkDrvEvent(pAC, Ioc, pEv->Event, pEv->Para);
+			break;
+#ifndef SK_USE_SW_TIMER
+		case SKGE_HWAC:
+			Rtv = SkGeSirqEvent(pAC, Ioc, pEv->Event, pEv->Para);
+			break;
 #else /* !SK_USE_SW_TIMER */
-        case SKGE_SWT : 
-			Rtv = SkSwtEvent(pAC,Ioc,pEv->Event,pEv->Para);
-			break ;
+        case SKGE_SWT :
+			Rtv = SkSwtEvent(pAC, Ioc, pEv->Event, pEv->Para);
+			break;
 #endif /* !SK_USE_SW_TIMER */
-#ifdef SK_USE_LAC_EV        
+#ifdef SK_USE_LAC_EV
 		case SKGE_LACP :
-			Rtv = SkLacpEvent(pAC,Ioc,pEv->Event,pEv->Para);
-			break ;
+			Rtv = SkLacpEvent(pAC, Ioc, pEv->Event, pEv->Para);
+			break;
 		case SKGE_RSF :
-			Rtv = SkRsfEvent(pAC,Ioc,pEv->Event,pEv->Para);
-			break ;
+			Rtv = SkRsfEvent(pAC, Ioc, pEv->Event, pEv->Para);
+			break;
 		case SKGE_MARKER :
-			Rtv = SkMarkerEvent(pAC,Ioc,pEv->Event,pEv->Para);
-			break ;
+			Rtv = SkMarkerEvent(pAC, Ioc, pEv->Event, pEv->Para);
+			break;
 		case SKGE_FD :
-			Rtv = SkFdEvent(pAC,Ioc,pEv->Event,pEv->Para);
-			break ;
+			Rtv = SkFdEvent(pAC, Ioc, pEv->Event, pEv->Para);
+			break;
 #endif /* SK_USE_LAC_EV */
 #ifdef	SK_USE_CSUM
 		case SKGE_CSUM :
-			Rtv = SkCsEvent(pAC,Ioc,pEv->Event,pEv->Para);
-			break ;
+			Rtv = SkCsEvent(pAC, Ioc, pEv->Event, pEv->Para);
+			break;
 #endif	/* SK_USE_CSUM */
 		default :
-			SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_Q_E002,
-				SKERR_Q_E002MSG) ;
+			SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_Q_E002, SKERR_Q_E002MSG);
 			Rtv = 0;
 		}
 
 		if (Rtv != 0) {
-			return(Rtv) ;
+			return(Rtv);
 		}
 
 		if (++pEv == &pAC->Event.EvQueue[SK_MAX_EVENT])
-			pEv = pAC->Event.EvQueue ;
+			pEv = pAC->Event.EvQueue;
 
 		/* Renew get: it is used in queue_events to detect overruns */
 		pAC->Event.EvGet = pEv;
 	}
 
-	return(0) ;
+	return(0);
 }
 
 /* End of file */
diff -Nru a/drivers/net/sk98lin/sktimer.c b/drivers/net/sk98lin/sktimer.c
--- a/drivers/net/sk98lin/sktimer.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/sk98lin/sktimer.c	Tue Feb  3 19:45:16 2004
@@ -1,9 +1,9 @@
 /******************************************************************************
  *
  * Name:	sktimer.c
- * Project:	Gigabit Ethernet Adapters, Schedule-Modul
- * Version:	$Revision: 1.13 $
- * Date:	$Date: 2003/05/13 18:01:01 $
+ * Project:	Gigabit Ethernet Adapters, Event Scheduler Module
+ * Version:	$Revision: 1.14 $
+ * Date:	$Date: 2003/09/16 13:46:51 $
  * Purpose:	High level timer functions.
  *
  ******************************************************************************/
@@ -27,6 +27,10 @@
  * History:
  *
  *	$Log: sktimer.c,v $
+ *	Revision 1.14  2003/09/16 13:46:51  rschmidt
+ *	Added (C) Marvell to SysKonnectFileId
+ *	Editorial changes
+ *	
  *	Revision 1.13  2003/05/13 18:01:01  mkarl
  *	Editorial changes.
  *	
@@ -68,19 +72,16 @@
  *	
  *	Revision 1.1  1998/08/05 11:27:55  gklug
  *	first version: adapted from SMT
- *	
- *	
- *	
  *
  ******************************************************************************/
 
 
 /*
-	Event queue and dispatcher
-*/
+ *	Event queue and dispatcher
+ */
 #if (defined(DEBUG) || ((!defined(LINT)) && (!defined(SK_SLIM))))
 static const char SysKonnectFileId[] =
-	"$Header: /usr56/projects/ge/schedule/sktimer.c,v 1.13 2003/05/13 18:01:01 mkarl Exp $" ;
+	"@(#) $Id: sktimer.c,v 1.14 2003/09/16 13:46:51 rschmidt Exp $ (C) Marvell.";
 #endif
 
 #include "h/skdrv1st.h"		/* Driver Specific Definitions */
@@ -110,14 +111,14 @@
 void	SkTimerInit(
 SK_AC	*pAC,		/* Adapters context */
 SK_IOC	Ioc,		/* IoContext */
-int	Level)		/* Init Level */
+int		Level)		/* Init Level */
 {
 	switch (Level) {
 	case SK_INIT_DATA:
-		pAC->Tim.StQueue = 0 ;
+		pAC->Tim.StQueue = 0;
 		break;
 	case SK_INIT_IO:
-		SkHwtInit(pAC,Ioc) ;
+		SkHwtInit(pAC, Ioc);
 		SkTimerDone(pAC, Ioc);
 		break;
 	default:
@@ -134,31 +135,34 @@
 SK_IOC		Ioc,		/* IoContext */
 SK_TIMER	*pTimer)	/* Timer Pointer to be started */
 {
-	SK_TIMER	**ppTimPrev ;
-	SK_TIMER	*pTm ;
+	SK_TIMER	**ppTimPrev;
+	SK_TIMER	*pTm;
 
 	/*
 	 * remove timer from queue
 	 */
-	pTimer->TmActive = SK_FALSE ;
+	pTimer->TmActive = SK_FALSE;
+	
 	if (pAC->Tim.StQueue == pTimer && !pTimer->TmNext) {
-		SkHwtStop(pAC,Ioc) ;
+		SkHwtStop(pAC, Ioc);
 	}
-	for (ppTimPrev = &pAC->Tim.StQueue ; (pTm = *ppTimPrev) ;
+	
+	for (ppTimPrev = &pAC->Tim.StQueue; (pTm = *ppTimPrev);
 		ppTimPrev = &pTm->TmNext ) {
+		
 		if (pTm == pTimer) {
 			/*
 			 * Timer found in queue
 			 * - dequeue it and
 			 * - correct delta of the next timer
 			 */
-			*ppTimPrev = pTm->TmNext ;
+			*ppTimPrev = pTm->TmNext;
 
 			if (pTm->TmNext) {
 				/* correct delta of next timer in queue */
-				pTm->TmNext->TmDelta += pTm->TmDelta ;
+				pTm->TmNext->TmDelta += pTm->TmDelta;
 			}
-			return ;
+			return;
 		}
 	}
 }
@@ -175,65 +179,67 @@
 SK_U32		Event,		/* Event Value for this timer */
 SK_EVPARA	Para)		/* Event Parameter for this timer */
 {
-	SK_TIMER	**ppTimPrev ;
-	SK_TIMER	*pTm ;
-	SK_U32		Delta ;
+	SK_TIMER	**ppTimPrev;
+	SK_TIMER	*pTm;
+	SK_U32		Delta;
 
-	Time /= 16 ;		/* input is uS, clock ticks are 16uS */
+	Time /= 16;		/* input is uS, clock ticks are 16uS */
+	
 	if (!Time)
-		Time = 1 ;
+		Time = 1;
 
-	SkTimerStop(pAC,Ioc,pTimer) ;
+	SkTimerStop(pAC, Ioc, pTimer);
 
-	pTimer->TmClass = Class ;
-	pTimer->TmEvent = Event ;
-	pTimer->TmPara = Para ;
-	pTimer->TmActive = SK_TRUE ;
+	pTimer->TmClass = Class;
+	pTimer->TmEvent = Event;
+	pTimer->TmPara = Para;
+	pTimer->TmActive = SK_TRUE;
 
 	if (!pAC->Tim.StQueue) {
 		/* First Timer to be started */
-		pAC->Tim.StQueue = pTimer ;
-		pTimer->TmNext = 0 ;
-		pTimer->TmDelta = Time ;
-		SkHwtStart(pAC,Ioc,Time) ;
-		return ;
+		pAC->Tim.StQueue = pTimer;
+		pTimer->TmNext = 0;
+		pTimer->TmDelta = Time;
+		
+		SkHwtStart(pAC, Ioc, Time);
+		
+		return;
 	}
 
 	/*
 	 * timer correction
 	 */
-	timer_done(pAC,Ioc,0) ;
+	timer_done(pAC, Ioc, 0);
 
 	/*
 	 * find position in queue
 	 */
-	Delta = 0 ;
-	for (ppTimPrev = &pAC->Tim.StQueue ; (pTm = *ppTimPrev) ;
+	Delta = 0;
+	for (ppTimPrev = &pAC->Tim.StQueue; (pTm = *ppTimPrev);
 		ppTimPrev = &pTm->TmNext ) {
+		
 		if (Delta + pTm->TmDelta > Time) {
 			/* Position found */
 			/* Here the timer needs to be inserted. */
-			break ;
+			break;
 		}
-		Delta += pTm->TmDelta ;
+		Delta += pTm->TmDelta;
 	}
 
 	/* insert in queue */
-	*ppTimPrev = pTimer ;
-	pTimer->TmNext = pTm ;
-	pTimer->TmDelta = Time - Delta ;
+	*ppTimPrev = pTimer;
+	pTimer->TmNext = pTm;
+	pTimer->TmDelta = Time - Delta;
 
 	if (pTm) {
 		/* There is a next timer
 		 * -> correct its Delta value.
 		 */
-		pTm->TmDelta -= pTimer->TmDelta ;
+		pTm->TmDelta -= pTimer->TmDelta;
 	}
 
-	/*
-	 * start new with first
-	 */
-	SkHwtStart(pAC,Ioc,pAC->Tim.StQueue->TmDelta) ;
+	/* restart with first */
+	SkHwtStart(pAC, Ioc, pAC->Tim.StQueue->TmDelta);
 }
 
 
@@ -241,55 +247,56 @@
 SK_AC	*pAC,		/* Adapters context */
 SK_IOC	Ioc)		/* IoContext */
 {
-	timer_done(pAC,Ioc,1) ;
+	timer_done(pAC, Ioc, 1);
 }
 
 
 static void	timer_done(
 SK_AC	*pAC,		/* Adapters context */
 SK_IOC	Ioc,		/* IoContext */
-int	Restart)	/* Do we need to restart the Hardware timer ? */
+int		Restart)	/* Do we need to restart the Hardware timer ? */
 {
-	SK_U32		Delta ;
-	SK_TIMER	*pTm ;
-	SK_TIMER	*pTComp ;	/* Timer completed now now */
-	SK_TIMER	**ppLast ;	/* Next field of Last timer to be deq */
-	int		Done = 0 ;
-
-	Delta = SkHwtRead(pAC,Ioc) ;
-	ppLast = &pAC->Tim.StQueue ;
-	pTm = pAC->Tim.StQueue ;
+	SK_U32		Delta;
+	SK_TIMER	*pTm;
+	SK_TIMER	*pTComp;	/* Timer completed now now */
+	SK_TIMER	**ppLast;	/* Next field of Last timer to be deq */
+	int		Done = 0;
+
+	Delta = SkHwtRead(pAC, Ioc);
+	
+	ppLast = &pAC->Tim.StQueue;
+	pTm = pAC->Tim.StQueue;
 	while (pTm && !Done) {
 		if (Delta >= pTm->TmDelta) {
 			/* Timer ran out */
-			pTm->TmActive = SK_FALSE ;
-			Delta -= pTm->TmDelta ;
-			ppLast = &pTm->TmNext ;
-			pTm = pTm->TmNext ;
-		} else {
+			pTm->TmActive = SK_FALSE;
+			Delta -= pTm->TmDelta;
+			ppLast = &pTm->TmNext;
+			pTm = pTm->TmNext;
+		}
+		else {
 			/* We found the first timer that did not run out */
-			pTm->TmDelta -= Delta ;
-			Delta = 0 ;
-			Done = 1 ;
+			pTm->TmDelta -= Delta;
+			Delta = 0;
+			Done = 1;
 		}
 	}
-	*ppLast = 0 ;
+	*ppLast = 0;
 	/*
 	 * pTm points to the first Timer that did not run out.
 	 * StQueue points to the first Timer that run out.
 	 */
 
-	for ( pTComp = pAC->Tim.StQueue ; pTComp ; pTComp = pTComp->TmNext) {
-		SkEventQueue(pAC,pTComp->TmClass, pTComp->TmEvent,
-			pTComp->TmPara) ;
+	for ( pTComp = pAC->Tim.StQueue; pTComp; pTComp = pTComp->TmNext) {
+		SkEventQueue(pAC,pTComp->TmClass, pTComp->TmEvent, pTComp->TmPara);
 	}
 
 	/* Set head of timer queue to the first timer that did not run out */
-	pAC->Tim.StQueue = pTm ;
+	pAC->Tim.StQueue = pTm;
 
 	if (Restart && pAC->Tim.StQueue) {
 		/* Restart HW timer */
-		SkHwtStart(pAC,Ioc,pAC->Tim.StQueue->TmDelta) ;
+		SkHwtStart(pAC, Ioc, pAC->Tim.StQueue->TmDelta);
 	}
 }
 
diff -Nru a/drivers/net/sk98lin/skxmac2.c b/drivers/net/sk98lin/skxmac2.c
--- a/drivers/net/sk98lin/skxmac2.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/net/sk98lin/skxmac2.c	Tue Feb  3 19:45:42 2004
@@ -2,8 +2,8 @@
  *
  * Name:	skxmac2.c
  * Project:	Gigabit Ethernet Adapters, Common Modules
- * Version:	$Revision: 1.99 $
- * Date:	$Date: 2003/07/11 12:19:33 $
+ * Version:	$Revision: 1.102 $
+ * Date:	$Date: 2003/10/02 16:53:58 $
  * Purpose:	Contains functions to initialize the MACs and PHYs
  *
  ******************************************************************************/
@@ -27,6 +27,23 @@
  * History:
  *
  *	$Log: skxmac2.c,v $
+ *	Revision 1.102  2003/10/02 16:53:58  rschmidt
+ *	Changed setting of GMAC parameters with new macros.
+ *	Added define SLIM around SkGm...LowPowerMode().
+ *	Editorial changes.
+ *	
+ *	Revision 1.101  2003/09/16 14:49:07  rschmidt
+ *	Added routines SkGmClearRst(), SkXmClearRst, SkMacClearRst().
+ *	Added WA code for Yukon-Lite's COMA mode in SkGmHardRst().
+ *	Replaced PCI-Config R/W through internal access.
+ *	Fixed return from coma mode in SkGmLeaveLowPowerMode().
+ *	Fixed compiler warnings for different types.
+ *	Editorial changes.
+ *	
+ *	Revision 1.100  2003/09/16 07:09:11  mschmid
+ *	Added functions SkGmEnterLowPowerMode() and
+ *	SkGmLeaveLowPowerMode()
+ *	
  *	Revision 1.99  2003/07/11 12:19:33  rschmidt
  *	Reduced init values for Master & Slave downshift counters to
  *	minimum values.
@@ -164,7 +181,7 @@
  *	Revision 1.74  2002/08/12 14:00:17  rschmidt
  *	Replaced usage of Broadcom PHY Ids with defines.
  *	Corrected error messages in SkGmMacStatistic().
- *	Made SkMacPromiscMode() public for ADDR-Modul.
+ *	Made SkMacPromiscMode() public for ADDR-Module.
  *	Editorial changes.
  *	
  *	Revision 1.73  2002/08/08 16:26:24  rschmidt
@@ -475,7 +492,7 @@
 
 #if (defined(DEBUG) || ((!defined(LINT)) && (!defined(SK_SLIM))))
 static const char SysKonnectFileId[] =
-	"@(#) $Id: skxmac2.c,v 1.99 2003/07/11 12:19:33 rschmidt Exp $ (C) Marvell.";
+	"@(#) $Id: skxmac2.c,v 1.102 2003/10/02 16:53:58 rschmidt Exp $ (C) Marvell.";
 #endif
 
 #ifdef GENESIS
@@ -1343,7 +1360,7 @@
  * Description:
  *	The XMAC of the specified 'Port' and all connected devices
  *	(PHY and SERDES) will receive a reset signal on its *Reset pins.
- *	External PHYs must be reset be clearing a bit in the GPIO register
+ *	External PHYs must be reset by clearing a bit in the GPIO register
  *  (Timing requirements: Broadcom: 400ns, Level One: none, National: 80ns).
  *
  * ATTENTION:
@@ -1386,23 +1403,62 @@
 
 	/* For external PHYs there must be special handling */
 	if (pAC->GIni.GP[Port].PhyType != SK_PHY_XMAC) {
-		/* reset external PHY */
+		
 		SK_IN32(IoC, B2_GP_IO, &Reg);
+		
 		if (Port == 0) {
-			Reg |= GP_DIR_0; /* set to output */
-			Reg &= ~GP_IO_0;
+			Reg |= GP_DIR_0; 	/* set to output */
+			Reg &= ~GP_IO_0;	/* set PHY reset (active low) */
 		}
 		else {
-			Reg |= GP_DIR_2; /* set to output */
-			Reg &= ~GP_IO_2;
+			Reg |= GP_DIR_2;	/* set to output */
+			Reg &= ~GP_IO_2;	/* set PHY reset (active low) */
 		}
+		/* reset external PHY */
 		SK_OUT32(IoC, B2_GP_IO, Reg);
 
 		/* short delay */
 		SK_IN32(IoC, B2_GP_IO, &Reg);
 	}
-
 }	/* SkXmHardRst */
+
+
+/******************************************************************************
+ *
+ *	SkXmClearRst() - Release the PHY & XMAC reset
+ *
+ * Description:
+ *
+ * Returns:
+ *	nothing
+ */
+static void SkXmClearRst(
+SK_AC	*pAC,	/* adapter context */
+SK_IOC	IoC,	/* IO context */
+int		Port)	/* Port Index (MAC_1 + n) */
+{
+	SK_U32	DWord;
+	
+	/* clear HW reset */
+	SK_OUT16(IoC, MR_ADDR(Port, TX_MFF_CTRL1), MFF_CLR_MAC_RST);
+
+	if (pAC->GIni.GP[Port].PhyType != SK_PHY_XMAC) {
+
+		SK_IN32(IoC, B2_GP_IO, &DWord);
+
+		if (Port == 0) {
+			DWord |= (GP_DIR_0 | GP_IO_0); /* set to output */
+		}
+		else {
+			DWord |= (GP_DIR_2 | GP_IO_2); /* set to output */
+		}
+		/* Clear PHY reset */
+		SK_OUT32(IoC, B2_GP_IO, DWord);
+
+		/* Enable GMII interface */
+		XM_OUT16(IoC, Port, XM_HW_CFG, XM_HW_GMII_MD);
+	}
+}	/* SkXmClearRst */
 #endif /* GENESIS */
 
 
@@ -1452,10 +1508,6 @@
  *
  * Description:
  *
- * ATTENTION:
- * 	It is absolutely necessary to reset the SW_RST Bit first
- *	before calling this function.
- *
  * Returns:
  *	nothing
  */
@@ -1464,6 +1516,20 @@
 SK_IOC	IoC,	/* IO context */
 int		Port)	/* Port Index (MAC_1 + n) */
 {
+	SK_U32	DWord;
+	
+	/* WA code for COMA mode */
+	if (pAC->GIni.GIYukonLite &&
+		pAC->GIni.GIChipRev == CHIP_REV_YU_LITE_A3) {
+		
+		SK_IN32(IoC, B2_GP_IO, &DWord);
+
+		DWord |= (GP_DIR_9 | GP_IO_9);
+
+		/* set PHY reset */
+		SK_OUT32(IoC, B2_GP_IO, DWord);
+	}
+
 	/* set GPHY Control reset */
 	SK_OUT32(IoC, MR_ADDR(Port, GPHY_CTRL), GPC_RST_SET);
 
@@ -1471,6 +1537,73 @@
 	SK_OUT32(IoC, MR_ADDR(Port, GMAC_CTRL), GMC_RST_SET);
 
 }	/* SkGmHardRst */
+
+
+/******************************************************************************
+ *
+ *	SkGmClearRst() - Release the GPHY & GMAC reset
+ *
+ * Description:
+ *
+ * Returns:
+ *	nothing
+ */
+static void SkGmClearRst(
+SK_AC	*pAC,	/* adapter context */
+SK_IOC	IoC,	/* IO context */
+int		Port)	/* Port Index (MAC_1 + n) */
+{
+	SK_U32	DWord;
+	
+#ifdef XXX
+		/* clear GMAC Control reset */
+		SK_OUT32(IoC, MR_ADDR(Port, GMAC_CTRL), GMC_RST_CLR);
+
+		/* set GMAC Control reset */
+		SK_OUT32(IoC, MR_ADDR(Port, GMAC_CTRL), GMC_RST_SET);
+#endif /* XXX */
+
+	/* WA code for COMA mode */
+	if (pAC->GIni.GIYukonLite &&
+		pAC->GIni.GIChipRev == CHIP_REV_YU_LITE_A3) {
+		
+		SK_IN32(IoC, B2_GP_IO, &DWord);
+
+		DWord |= GP_DIR_9;		/* set to output */
+		DWord &= ~GP_IO_9;		/* clear PHY reset (active high) */
+
+		/* clear PHY reset */
+		SK_OUT32(IoC, B2_GP_IO, DWord);
+	}
+
+	/* set HWCFG_MODE */
+	DWord = GPC_INT_POL_HI | GPC_DIS_FC | GPC_DIS_SLEEP |
+		GPC_ENA_XC | GPC_ANEG_ADV_ALL_M | GPC_ENA_PAUSE |
+		(pAC->GIni.GICopperType ? GPC_HWCFG_GMII_COP :
+		GPC_HWCFG_GMII_FIB);
+
+	/* set GPHY Control reset */
+	SK_OUT32(IoC, MR_ADDR(Port, GPHY_CTRL), DWord | GPC_RST_SET);
+
+	/* release GPHY Control reset */
+	SK_OUT32(IoC, MR_ADDR(Port, GPHY_CTRL), DWord | GPC_RST_CLR);
+
+#ifdef VCPU
+	VCpuWait(9000);
+#endif /* VCPU */
+
+	/* clear GMAC Control reset */
+	SK_OUT32(IoC, MR_ADDR(Port, GMAC_CTRL), GMC_PAUSE_ON | GMC_RST_CLR);
+
+#ifdef VCPU
+	VCpuWait(2000);
+	
+	SK_IN32(IoC, MR_ADDR(Port, GPHY_CTRL), &DWord);
+			
+	SK_IN32(IoC, B0_ISRC, &DWord);
+#endif /* VCPU */
+
+}	/* SkGmClearRst */
 #endif /* YUKON */
 
 
@@ -1553,6 +1686,38 @@
 }	/* SkMacHardRst */
 
 
+/******************************************************************************
+ *
+ *	SkMacClearRst() - Clear the MAC reset
+ *
+ * Description:	calls a clear MAC reset routine dep. on board type
+ *
+ * Returns:
+ *	nothing
+ */
+void SkMacClearRst(
+SK_AC	*pAC,	/* adapter context */
+SK_IOC	IoC,	/* IO context */
+int		Port)	/* Port Index (MAC_1 + n) */
+{
+	
+#ifdef GENESIS
+	if (pAC->GIni.GIGenesis) {
+		
+		SkXmClearRst(pAC, IoC, Port);
+	}
+#endif /* GENESIS */
+	
+#ifdef YUKON
+	if (pAC->GIni.GIYukon) {
+		
+		SkGmClearRst(pAC, IoC, Port);
+	}
+#endif /* YUKON */
+
+}	/* SkMacClearRst */
+
+
 #ifdef GENESIS
 /******************************************************************************
  *
@@ -1574,7 +1739,6 @@
 int		Port)		/* Port Index (MAC_1 + n) */
 {
 	SK_GEPORT	*pPrt;
-	SK_U32		Reg;
 	int			i;
 	SK_U16		SWord;
 
@@ -1594,32 +1758,10 @@
 	}
 
 	if (pPrt->PState == SK_PRT_RESET) {
-		/*
-		 * clear HW reset
-		 * Note: The SW reset is self clearing, therefore there is
-		 *	 nothing to do here.
-		 */
-		SK_OUT16(IoC, MR_ADDR(Port, TX_MFF_CTRL1), MFF_CLR_MAC_RST);
 
-		/* Ensure that XMAC reset release is done (errata from LReinbold?) */
-		SK_IN16(IoC, MR_ADDR(Port, TX_MFF_CTRL1), &SWord);
+		SkXmClearRst(pAC, IoC, Port);
 
-		/* Clear PHY reset */
 		if (pPrt->PhyType != SK_PHY_XMAC) {
-
-			SK_IN32(IoC, B2_GP_IO, &Reg);
-			
-			if (Port == 0) {
-				Reg |= (GP_DIR_0 | GP_IO_0); /* set to output */
-			}
-			else {
-				Reg |= (GP_DIR_2 | GP_IO_2); /* set to output */
-			}
-			SK_OUT32(IoC, B2_GP_IO, Reg);
-
-			/* Enable GMII interface */
-			XM_OUT16(IoC, Port, XM_HW_CFG, XM_HW_GMII_MD);
-
 			/* read Id from external PHY (all have the same address) */
 			SkXmPhyRead(pAC, IoC, Port, PHY_XMAC_ID1, &pPrt->PhyId1);
 
@@ -1831,43 +1973,11 @@
 	}
 
 	if (pPrt->PState == SK_PRT_RESET) {
-		/* set GPHY Control reset */
-		SK_OUT32(IoC, MR_ADDR(Port, GPHY_CTRL), GPC_RST_SET);
-
-		/* set GMAC Control reset */
-		SK_OUT32(IoC, MR_ADDR(Port, GMAC_CTRL), GMC_RST_SET);
-
-#ifdef XXX
-		/* clear GMAC Control reset */
-		SK_OUT32(IoC, MR_ADDR(Port, GMAC_CTRL), GMC_RST_CLR);
-
-		/* set GMAC Control reset */
-		SK_OUT32(IoC, MR_ADDR(Port, GMAC_CTRL), GMC_RST_SET);
-#endif /* XXX */
-
-		/* set HWCFG_MODE */
-		DWord = GPC_INT_POL_HI | GPC_DIS_FC | GPC_DIS_SLEEP |
-			GPC_ENA_XC | GPC_ANEG_ADV_ALL_M | GPC_ENA_PAUSE |
-			(pAC->GIni.GICopperType ? GPC_HWCFG_GMII_COP :
-			GPC_HWCFG_GMII_FIB);
-
-		/* set GPHY Control reset */
-		SK_OUT32(IoC, MR_ADDR(Port, GPHY_CTRL), DWord | GPC_RST_SET);
-
-		/* release GPHY Control reset */
-		SK_OUT32(IoC, MR_ADDR(Port, GPHY_CTRL), DWord | GPC_RST_CLR);
-
-#ifdef VCPU
-		VCpuWait(9000);
-#endif /* VCPU */
-
-		/* clear GMAC Control reset */
-		SK_OUT32(IoC, MR_ADDR(Port, GMAC_CTRL), GMC_PAUSE_ON | GMC_RST_CLR);
-
-#ifdef VCPU
-		VCpuWait(2000);
-#endif /* VCPU */
+		
+		SkGmHardRst(pAC, IoC, Port);
 
+		SkGmClearRst(pAC, IoC, Port);
+		
 		/* Auto-negotiation ? */
 		if (pPrt->PLinkMode == SK_LMODE_HALF || pPrt->PLinkMode == SK_LMODE_FULL) {
 			/* Auto-negotiation disabled */
@@ -1906,6 +2016,7 @@
 			SWord |= GM_GPCR_DUP_FULL;
 		}
 
+		/* flow-control settings */
 		switch (pPrt->PFlowCtrlMode) {
 		case SK_FLOW_MODE_NONE:
 			/* set Pause Off */
@@ -1940,7 +2051,7 @@
 	(void)SkGmResetCounter(pAC, IoC, Port);
 
 	/* setup Transmit Control Register */
-	GM_OUT16(IoC, Port, GM_TX_CTRL, GM_TXCR_COL_THR);
+	GM_OUT16(IoC, Port, GM_TX_CTRL, TX_COL_THR(pPrt->PMacColThres));
 
 	/* setup Receive Control Register */
 	GM_OUT16(IoC, Port, GM_RX_CTRL, GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA |
@@ -1954,7 +2065,9 @@
 	GM_IN16(IoC, Port, GM_TX_PARAM, &SWord);
 #endif /* VCPU */
 
-    SWord = (SK_U16)(JAM_LEN_VAL(3) | JAM_IPG_VAL(11) | IPG_JAM_DATA(26));
+    SWord = TX_JAM_LEN_VAL(pPrt->PMacJamLen) |
+			TX_JAM_IPG_VAL(pPrt->PMacJamIpgVal) |
+			TX_IPG_JAM_DATA(pPrt->PMacJamIpgData);
 	
 	GM_OUT16(IoC, Port, GM_TX_PARAM, SWord);
 
@@ -1963,7 +2076,12 @@
 	GM_IN16(IoC, Port, GM_SERIAL_MODE, &SWord);
 #endif /* VCPU */
 	
-	SWord = GM_SMOD_VLAN_ENA | IPG_VAL_FAST_ETH;
+	SWord = GM_SMOD_VLAN_ENA | IPG_DATA_VAL(pPrt->PMacIpgData);
+
+	if (pPrt->PMacLimit4) {
+		/* reset of collision counter after 4 consecutive collisions */
+		SWord |= GM_SMOD_LIMIT_4;
+	}
 
 	if (pAC->GIni.GIPortUsage == SK_JUMBO_LINK) {
 		/* enable jumbo mode (Max. Frame Length = 9018) */
@@ -2021,11 +2139,13 @@
 	GM_OUT16(IoC, Port, GM_RX_IRQ_MSK, 0);
 	GM_OUT16(IoC, Port, GM_TR_IRQ_MSK, 0);
 
+#if defined(SK_DIAG) || defined(DEBUG)
 	/* read General Purpose Status */
 	GM_IN16(IoC, Port, GM_GP_STAT, &SWord);
 	
 	SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
-		("MAC Stat Reg=0x%04X\n", SWord));
+		("MAC Stat Reg.=0x%04X\n", SWord));
+#endif /* SK_DIAG || DEBUG */
 
 #ifdef SK_DIAG
 	c_print("MAC Stat Reg=0x%04X\n", SWord);
@@ -2226,6 +2346,7 @@
 				SKERR_HWI_E015MSG);
 		}
 
+		/* Set Flow-control capabilities */
 		switch (pPrt->PFlowCtrlMode) {
 		case SK_FLOW_MODE_NONE:
 			Ctrl |= PHY_X_P_NO_PAUSE;
@@ -2306,7 +2427,9 @@
 		SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
 			("InitPhyBcom: no auto-negotiation Port %d\n", Port));
 		/* Set DuplexMode in Config register */
-		Ctrl1 |= (pPrt->PLinkMode == SK_LMODE_FULL ? PHY_CT_DUP_MD : 0);
+		if (pPrt->PLinkMode == SK_LMODE_FULL) {
+			Ctrl1 |= PHY_CT_DUP_MD;
+		}
 
 		/* Determine Master/Slave manually if not already done */
 		if (pPrt->PMSMode == SK_MS_MODE_AUTO) {
@@ -2346,6 +2469,7 @@
 				SKERR_HWI_E015MSG);
 		}
 
+		/* Set Flow-control capabilities */
 		switch (pPrt->PFlowCtrlMode) {
 		case SK_FLOW_MODE_NONE:
 			Ctrl3 |= PHY_B_P_NO_PAUSE;
@@ -2375,12 +2499,12 @@
 	/* Write 1000Base-T Control Register */
 	SkXmPhyWrite(pAC, IoC, Port, PHY_BCOM_1000T_CTRL, Ctrl2);
 	SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
-		("1000B-T Ctrl Reg=0x%04X\n", Ctrl2));
+		("Set 1000B-T Ctrl Reg=0x%04X\n", Ctrl2));
 	
 	/* Write AutoNeg Advertisement Register */
 	SkXmPhyWrite(pAC, IoC, Port, PHY_BCOM_AUNE_ADV, Ctrl3);
 	SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
-		("Auto-Neg.Adv.Reg=0x%04X\n", Ctrl3));
+		("Set Auto-Neg.Adv.Reg=0x%04X\n", Ctrl3));
 	
 	if (DoLoop) {
 		/* Set the Phy Loopback bit, too */
@@ -2409,6 +2533,281 @@
 
 
 #ifdef YUKON
+#ifndef SK_SLIM
+/******************************************************************************
+ *
+ *	SkGmEnterLowPowerMode()
+ *
+ * Description:	
+ *	This function sets the Marvell Alaska PHY to the low power mode
+ *	given by parameter mode.
+ *	The following low power modes are available:
+ *		
+ *		- Coma Mode (Deep Sleep):
+ *			Power consumption: ~15 - 30 mW
+ *			The PHY cannot wake up on its own.
+ *
+ *		- IEEE 22.2.4.1.5 compatible power down mode
+ *			Power consumption: ~240 mW
+ *			The PHY cannot wake up on its own.
+ *
+ *		- energy detect mode
+ *			Power consumption: ~160 mW
+ *			The PHY can wake up on its own by detecting activity
+ *			on the CAT 5 cable.
+ *
+ *		- energy detect plus mode
+ *			Power consumption: ~150 mW
+ *			The PHY can wake up on its own by detecting activity
+ *			on the CAT 5 cable.
+ *			Connected devices can be woken up by sending normal link
+ *			pulses every one second.
+ *
+ * Note:
+ *
+ * Returns:
+ *		0: ok
+ *		1: error
+ */
+int SkGmEnterLowPowerMode(
+SK_AC	*pAC,		/* adapter context */
+SK_IOC	IoC,		/* IO context */
+int		Port,		/* Port Index (e.g. MAC_1) */
+SK_U8	Mode)		/* low power mode */
+{
+	SK_U16	Word;
+	SK_U32	DWord;
+	SK_U8	LastMode;
+	int		Ret = 0;
+
+	if (pAC->GIni.GIYukonLite &&
+	    pAC->GIni.GIChipRev == CHIP_REV_YU_LITE_A3) {
+
+		/* save current power mode */
+		LastMode = pAC->GIni.GP[Port].PPhyPowerState;
+		pAC->GIni.GP[Port].PPhyPowerState = Mode;
+
+		switch (Mode) {
+			/* coma mode (deep sleep) */
+			case PHY_PM_DEEP_SLEEP:
+				/* setup General Purpose Control Register */
+				GM_OUT16(IoC, 0, GM_GP_CTRL, GM_GPCR_FL_PASS |
+					GM_GPCR_SPEED_100 | GM_GPCR_AU_ALL_DIS);
+
+				/* apply COMA mode workaround */
+				SkGmPhyWrite(pAC, IoC, Port, 29, 0x001f);
+				SkGmPhyWrite(pAC, IoC, Port, 30, 0xfff3);
+
+				SK_IN32(IoC, PCI_C(PCI_OUR_REG_1), &DWord);
+
+				SK_OUT8(IoC, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+				
+				/* Set PHY to Coma Mode */
+				SK_OUT32(IoC, PCI_C(PCI_OUR_REG_1), DWord | PCI_PHY_COMA);
+				
+				SK_OUT8(IoC, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+
+			break;
+			
+			/* IEEE 22.2.4.1.5 compatible power down mode */
+			case PHY_PM_IEEE_POWER_DOWN:
+				/*
+				 * - disable MAC 125 MHz clock
+				 * - allow MAC power down
+				 */
+				SkGmPhyRead(pAC, IoC, Port, PHY_MARV_PHY_CTRL, &Word);
+				Word |= PHY_M_PC_DIS_125CLK;
+				Word &=	~PHY_M_PC_MAC_POW_UP;
+				SkGmPhyWrite(pAC, IoC, Port, PHY_MARV_PHY_CTRL, Word);
+
+				/*
+				 * register changes must be followed by a software
+				 * reset to take effect
+				 */
+				SkGmPhyRead(pAC, IoC, Port, PHY_MARV_CTRL, &Word);
+				Word |= PHY_CT_RESET;
+				SkGmPhyWrite(pAC, IoC, Port, PHY_MARV_CTRL, Word);
+
+				/* switch IEEE compatible power down mode on */
+				SkGmPhyRead(pAC, IoC, Port, PHY_MARV_CTRL, &Word);
+				Word |= PHY_CT_PDOWN;
+				SkGmPhyWrite(pAC, IoC, Port, PHY_MARV_CTRL, Word);
+			break;
+
+			/* energy detect and energy detect plus mode */
+			case PHY_PM_ENERGY_DETECT:
+			case PHY_PM_ENERGY_DETECT_PLUS:
+				/*
+				 * - disable MAC 125 MHz clock
+				 */
+				SkGmPhyRead(pAC, IoC, Port, PHY_MARV_PHY_CTRL, &Word);
+				Word |= PHY_M_PC_DIS_125CLK;
+				SkGmPhyWrite(pAC, IoC, Port, PHY_MARV_PHY_CTRL, Word);
+				
+				/* activate energy detect mode 1 */
+				SkGmPhyRead(pAC, IoC, Port, PHY_MARV_PHY_CTRL, &Word);
+
+				/* energy detect mode */
+				if (Mode == PHY_PM_ENERGY_DETECT) {
+					Word |= PHY_M_PC_EN_DET;
+				}
+				/* energy detect plus mode */
+				else {
+					Word |= PHY_M_PC_EN_DET_PLUS;
+				}
+
+				SkGmPhyWrite(pAC, IoC, Port, PHY_MARV_PHY_CTRL, Word);
+
+				/*
+				 * reinitialize the PHY to force a software reset
+				 * which is necessary after the register settings
+				 * for the energy detect modes.
+				 * Furthermore reinitialisation prevents that the
+				 * PHY is running out of a stable state.
+				 */
+				SkGmInitPhyMarv(pAC, IoC, Port, SK_FALSE);
+			break;
+
+			/* don't change current power mode */
+			default:
+				pAC->GIni.GP[Port].PPhyPowerState = LastMode;
+				Ret = 1;
+			break;
+		}
+	}
+	/* low power modes are not supported by this chip */
+	else {
+		Ret = 1;
+	}
+
+	return(Ret);
+
+}	/* SkGmEnterLowPowerMode */
+
+/******************************************************************************
+ *
+ *	SkGmLeaveLowPowerMode()
+ *
+ * Description:	
+ *	Leave the current low power mode and switch to normal mode
+ *
+ * Note:
+ *
+ * Returns:
+ *		0:	ok
+ *		1:	error
+ */
+int SkGmLeaveLowPowerMode(
+SK_AC	*pAC,		/* adapter context */
+SK_IOC	IoC,		/* IO context */
+int		Port)		/* Port Index (e.g. MAC_1) */
+{
+	SK_U32	DWord;
+	SK_U16	Word;
+	SK_U8	LastMode;
+	int		Ret = 0;
+
+	if (pAC->GIni.GIYukonLite &&
+		pAC->GIni.GIChipRev == CHIP_REV_YU_LITE_A3) {
+
+		/* save current power mode */
+		LastMode = pAC->GIni.GP[Port].PPhyPowerState;
+		pAC->GIni.GP[Port].PPhyPowerState = PHY_PM_OPERATIONAL_MODE;
+
+		switch (LastMode) {
+			/* coma mode (deep sleep) */
+			case PHY_PM_DEEP_SLEEP:
+				SK_IN32(IoC, PCI_C(PCI_OUR_REG_1), &DWord);
+
+				SK_OUT8(IoC, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+				
+				/* Release PHY from Coma Mode */
+				SK_OUT32(IoC, PCI_C(PCI_OUR_REG_1), DWord & ~PCI_PHY_COMA);
+				
+				SK_OUT8(IoC, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+				
+				SK_IN32(IoC, B2_GP_IO, &DWord);
+
+				/* set to output */
+				DWord |= (GP_DIR_9 | GP_IO_9);
+
+				/* set PHY reset */
+				SK_OUT32(IoC, B2_GP_IO, DWord);
+
+				DWord &= ~GP_IO_9; /* clear PHY reset (active high) */
+
+				/* clear PHY reset */
+				SK_OUT32(IoC, B2_GP_IO, DWord);
+			break;
+			
+			/* IEEE 22.2.4.1.5 compatible power down mode */
+			case PHY_PM_IEEE_POWER_DOWN:
+				/*
+				 * - enable MAC 125 MHz clock
+				 * - set MAC power up
+				 */
+				SkGmPhyRead(pAC, IoC, Port, PHY_MARV_PHY_CTRL, &Word);
+				Word &= ~PHY_M_PC_DIS_125CLK;
+				Word |=	PHY_M_PC_MAC_POW_UP;
+				SkGmPhyWrite(pAC, IoC, Port, PHY_MARV_PHY_CTRL, Word);
+
+				/*
+				 * register changes must be followed by a software
+				 * reset to take effect
+				 */
+				SkGmPhyRead(pAC, IoC, Port, PHY_MARV_CTRL, &Word);
+				Word |= PHY_CT_RESET;
+				SkGmPhyWrite(pAC, IoC, Port, PHY_MARV_CTRL, Word);
+
+				/* switch IEEE compatible power down mode off */
+				SkGmPhyRead(pAC, IoC, Port, PHY_MARV_CTRL, &Word);
+				Word &= ~PHY_CT_PDOWN;
+				SkGmPhyWrite(pAC, IoC, Port, PHY_MARV_CTRL, Word);
+			break;
+
+			/* energy detect and energy detect plus mode */
+			case PHY_PM_ENERGY_DETECT:
+			case PHY_PM_ENERGY_DETECT_PLUS:
+				/*
+				 * - enable MAC 125 MHz clock
+				 */
+				SkGmPhyRead(pAC, IoC, Port, PHY_MARV_PHY_CTRL, &Word);
+				Word &= ~PHY_M_PC_DIS_125CLK;
+				SkGmPhyWrite(pAC, IoC, Port, PHY_MARV_PHY_CTRL, Word);
+				
+				/* disable energy detect mode */
+				SkGmPhyRead(pAC, IoC, Port, PHY_MARV_PHY_CTRL, &Word);
+				Word &= ~PHY_M_PC_EN_DET_MSK;
+				SkGmPhyWrite(pAC, IoC, Port, PHY_MARV_PHY_CTRL, Word);
+
+				/*
+				 * reinitialize the PHY to force a software reset
+				 * which is necessary after the register settings
+				 * for the energy detect modes.
+				 * Furthermore reinitialisation prevents that the
+				 * PHY is running out of a stable state.
+				 */
+				SkGmInitPhyMarv(pAC, IoC, Port, SK_FALSE);
+			break;
+
+			/* don't change current power mode */
+			default:
+				pAC->GIni.GP[Port].PPhyPowerState = LastMode;
+				Ret = 1;
+			break;
+		}
+	}
+	/* low power modes are not supported by this chip */
+	else {
+		Ret = 1;
+	}
+
+	return(Ret);
+
+}	/* SkGmLeaveLowPowerMode */
+#endif /* !SK_SLIM */
+
+
 /******************************************************************************
  *
  *	SkGmInitPhyMarv() - Initialize the Marvell Phy registers
@@ -2457,7 +2856,6 @@
 	VCPUprintf(0, "SkGmInitPhyMarv(), Port=%u, DoLoop=%u\n",
 		Port, DoLoop);
 #else /* VCPU */
-	
 	if (DoLoop) {
 		/* Set 'MAC Power up'-bit, set Manual MDI configuration */
 		SkGmPhyWrite(pAC, IoC, Port, PHY_MARV_PHY_CTRL,
@@ -2475,16 +2873,20 @@
 	
 		SkGmPhyWrite(pAC, IoC, Port, PHY_MARV_EXT_CTRL, ExtPhyCtrl);
 		SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
-			("Ext. PHY Ctrl=0x%04X\n", ExtPhyCtrl));
+			("Set Ext. PHY Ctrl=0x%04X\n", ExtPhyCtrl));
 	}
 
 	/* Read PHY Control */
 	SkGmPhyRead(pAC, IoC, Port, PHY_MARV_CTRL, &PhyCtrl);
 
+	if (!AutoNeg) {
+		/* Disable Auto-negotiation */
+		PhyCtrl &= ~PHY_CT_ANE;
+	}
+
 	PhyCtrl |= PHY_CT_RESET;
 	/* Assert software reset */
 	SkGmPhyWrite(pAC, IoC, Port, PHY_MARV_CTRL, PhyCtrl);
-
 #endif /* VCPU */
 
 	PhyCtrl = 0 /* PHY_CT_COL_TST */;
@@ -2533,13 +2935,9 @@
 		if (!DoLoop) {
 			PhyCtrl |= PHY_CT_RESET;
 		}
-		/*
-		 * Do NOT enable Auto-negotiation here. This would hold
-		 * the link down because no IDLES are transmitted
-		 */
 	}
 	else {
-		PhyCtrl |= PHY_CT_ANE;
+		/* Set Auto-negotiation advertisement */
 		
 		if (pAC->GIni.GICopperType) {
 			/* Set Speed capabilities */
@@ -2554,6 +2952,7 @@
 				break;
 			case SK_LSPEED_100MBPS:
 				AutoNegAdv |= PHY_M_AN_100_FD | PHY_M_AN_100_HD |
+					/* advertise 10Base-T also */
 					PHY_M_AN_10_FD | PHY_M_AN_10_HD;
 				break;
 			case SK_LSPEED_10MBPS:
@@ -2581,7 +2980,7 @@
 					SKERR_HWI_E015MSG);
 			}
 			
-			/* Set Auto-negotiation advertisement */
+			/* Set Flow-control capabilities */
 			switch (pPrt->PFlowCtrlMode) {
 			case SK_FLOW_MODE_NONE:
 				AutoNegAdv |= PHY_B_P_NO_PAUSE;
@@ -2618,7 +3017,7 @@
 					SKERR_HWI_E015MSG);
 			}
 			
-			/* Set Auto-negotiation advertisement */
+			/* Set Flow-control capabilities */
 			switch (pPrt->PFlowCtrlMode) {
 			case SK_FLOW_MODE_NONE:
 				AutoNegAdv |= PHY_M_P_NO_PAUSE_X;
@@ -2640,7 +3039,7 @@
 
 		if (!DoLoop) {
 			/* Restart Auto-negotiation */
-			PhyCtrl |= PHY_CT_RE_CFG;
+			PhyCtrl |= PHY_CT_ANE | PHY_CT_RE_CFG;
 		}
 	}
 	
@@ -2659,12 +3058,12 @@
 	/* Write 1000Base-T Control Register */
 	SkGmPhyWrite(pAC, IoC, Port, PHY_MARV_1000T_CTRL, C1000BaseT);
 	SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
-		("1000B-T Ctrl=0x%04X\n", C1000BaseT));
+		("Set 1000B-T Ctrl =0x%04X\n", C1000BaseT));
 	
 	/* Write AutoNeg Advertisement Register */
 	SkGmPhyWrite(pAC, IoC, Port, PHY_MARV_AUNE_ADV, AutoNegAdv);
 	SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
-		("Auto-Neg.Ad.=0x%04X\n", AutoNegAdv));
+		("Set Auto-Neg.Adv.=0x%04X\n", AutoNegAdv));
 #endif /* VCPU */
 	
 	if (DoLoop) {
@@ -2694,6 +3093,8 @@
 
 	/* Write to the PHY Control register */
 	SkGmPhyWrite(pAC, IoC, Port, PHY_MARV_CTRL, PhyCtrl);
+	SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
+		("Set PHY Ctrl Reg.=0x%04X\n", PhyCtrl));
 
 #ifdef VCPU
 	VCpuWait(2000);
@@ -2712,7 +3113,7 @@
 	SkGmPhyWrite(pAC, IoC, Port, PHY_MARV_LED_CTRL, LedCtrl);
 
 	if ((pAC->GIni.GILedBlinkCtrl & SK_LED_LINK100_ON) != 0) {
-		/* only in forced 100Mbps mode */
+		/* only in forced 100 Mbps mode */
 		if (!AutoNeg && pPrt->PLinkSpeed == SK_LSPEED_100MBPS) {
 
 			SkGmPhyWrite(pAC, IoC, Port, PHY_MARV_LED_OVER,
@@ -2741,7 +3142,7 @@
 	/* Read AutoNeg Advertisement Register */
 	SkGmPhyRead(pAC, IoC, Port, PHY_MARV_AUNE_ADV, &AutoNegAdv);
 	SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
-		("Auto-Neg. Ad.=0x%04X\n", AutoNegAdv));
+		("Auto-Neg.Adv.=0x%04X\n", AutoNegAdv));
 	
 	/* Read Ext. PHY Specific Control */
 	SkGmPhyRead(pAC, IoC, Port, PHY_MARV_EXT_CTRL, &ExtPhyCtrl);
@@ -2818,13 +3219,15 @@
 	/* Auto-negotiation ? */
 	if (pPrt->PLinkMode == SK_LMODE_HALF || pPrt->PLinkMode == SK_LMODE_FULL) {
 		/*
-		 * level one spec say: "1000Mbps: manual mode not allowed"
+		 * level one spec say: "1000 Mbps: manual mode not allowed"
 		 * but lets see what happens...
 		 */
 		SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
 			("InitPhyLone: no auto-negotiation Port %d\n", Port));
 		/* Set DuplexMode in Config register */
-		Ctrl1 = (pPrt->PLinkMode == SK_LMODE_FULL ? PHY_CT_DUP_MD : 0);
+		if (pPrt->PLinkMode == SK_LMODE_FULL) {
+			Ctrl1 |= PHY_CT_DUP_MD;
+		}
 
 		/* Determine Master/Slave manually if not already done */
 		if (pPrt->PMSMode == SK_MS_MODE_AUTO) {
@@ -2857,6 +3260,7 @@
 				SKERR_HWI_E015MSG);
 		}
 
+		/* Set Flow-control capabilities */
 		switch (pPrt->PFlowCtrlMode) {
 		case SK_FLOW_MODE_NONE:
 			Ctrl3 |= PHY_L_P_NO_PAUSE;
@@ -2877,7 +3281,6 @@
 
 		/* Restart Auto-negotiation */
 		Ctrl1 = PHY_CT_ANE | PHY_CT_RE_CFG;
-
 	}
 	
 	/* Write 1000Base-T Control Register */
@@ -3019,10 +3422,10 @@
 
 	/* Check Duplex mismatch */
 	if ((ResAb & (PHY_X_RS_HD | PHY_X_RS_FD)) == PHY_X_RS_FD) {
-		pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOFULL;
+		pPrt->PLinkModeStatus = (SK_U8)SK_LMODE_STAT_AUTOFULL;
 	}
 	else if ((ResAb & (PHY_X_RS_HD | PHY_X_RS_FD)) == PHY_X_RS_HD) {
-		pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOHALF;
+		pPrt->PLinkModeStatus = (SK_U8)SK_LMODE_STAT_AUTOHALF;
 	}
 	else {
 		/* Error */
@@ -3055,7 +3458,7 @@
 		/* PAUSE mismatch -> no PAUSE */
 		pPrt->PFlowCtrlStatus = SK_FLOW_STAT_NONE;
 	}
-	pPrt->PLinkSpeedUsed = SK_LSPEED_STAT_1000MBPS;
+	pPrt->PLinkSpeedUsed = (SK_U8)SK_LSPEED_STAT_1000MBPS;
 
 	return(SK_AND_OK);
 }	/* SkXmAutoNegDoneXmac */
@@ -3110,10 +3513,10 @@
 
 	/* Check Duplex mismatch */
 	if ((AuxStat & PHY_B_AS_AN_RES_MSK) == PHY_B_RES_1000FD) {
-		pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOFULL;
+		pPrt->PLinkModeStatus = (SK_U8)SK_LMODE_STAT_AUTOFULL;
 	}
 	else if ((AuxStat & PHY_B_AS_AN_RES_MSK) == PHY_B_RES_1000HD) {
-		pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOHALF;
+		pPrt->PLinkModeStatus = (SK_U8)SK_LMODE_STAT_AUTOHALF;
 	}
 	else {
 		/* Error */
@@ -3156,7 +3559,7 @@
 		/* PAUSE mismatch -> no PAUSE */
 		pPrt->PFlowCtrlStatus = SK_FLOW_STAT_NONE;
 	}
-	pPrt->PLinkSpeedUsed = SK_LSPEED_STAT_1000MBPS;
+	pPrt->PLinkSpeedUsed = (SK_U8)SK_LSPEED_STAT_1000MBPS;
 
 	return(SK_AND_OK);
 }	/* SkXmAutoNegDoneBcom */
@@ -3192,6 +3595,8 @@
 
 	/* Get PHY parameters */
 	SkGmPhyRead(pAC, IoC, Port, PHY_MARV_AUNE_LP, &LPAb);
+	SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
+		("Link P.Abil.=0x%04X\n", LPAb));
 	
 	if ((LPAb & PHY_M_AN_RF) != 0) {
 		SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
@@ -3222,15 +3627,15 @@
 		SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
 			("AutoNegFail: Speed & Duplex not resolved, Port %d\n", Port));
 		pPrt->PAutoNegFail = SK_TRUE;
-		pPrt->PLinkModeStatus = SK_LMODE_STAT_UNKNOWN;
+		pPrt->PLinkModeStatus = (SK_U8)SK_LMODE_STAT_UNKNOWN;
 		return(SK_AND_DUP_CAP);
 	}
 	
 	if ((AuxStat & PHY_M_PS_FULL_DUP) != 0) {
-		pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOFULL;
+		pPrt->PLinkModeStatus = (SK_U8)SK_LMODE_STAT_AUTOFULL;
 	}
 	else {
-		pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOHALF;
+		pPrt->PLinkModeStatus = (SK_U8)SK_LMODE_STAT_AUTOHALF;
 	}
 	
 	/* Check PAUSE mismatch ??? */
@@ -3255,13 +3660,13 @@
 	/* set used link speed */
 	switch ((unsigned)(AuxStat & PHY_M_PS_SPEED_MSK)) {
 	case (unsigned)PHY_M_PS_SPEED_1000:
-		pPrt->PLinkSpeedUsed = SK_LSPEED_STAT_1000MBPS;
+		pPrt->PLinkSpeedUsed = (SK_U8)SK_LSPEED_STAT_1000MBPS;
 		break;
 	case PHY_M_PS_SPEED_100:
-		pPrt->PLinkSpeedUsed = SK_LSPEED_STAT_100MBPS;
+		pPrt->PLinkSpeedUsed = (SK_U8)SK_LSPEED_STAT_100MBPS;
 		break;
 	default:
-		pPrt->PLinkSpeedUsed = SK_LSPEED_STAT_10MBPS;
+		pPrt->PLinkSpeedUsed = (SK_U8)SK_LSPEED_STAT_10MBPS;
 	}
 
 	return(SK_AND_OK);
@@ -3312,10 +3717,10 @@
 
 	/* Check Duplex mismatch */
 	if ((QuickStat & PHY_L_QS_DUP_MOD) != 0) {
-		pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOFULL;
+		pPrt->PLinkModeStatus = (SK_U8)SK_LMODE_STAT_AUTOFULL;
 	}
 	else {
-		pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOHALF;
+		pPrt->PLinkModeStatus = (SK_U8)SK_LMODE_STAT_AUTOHALF;
 	}
 	
 	/* Check Master/Slave resolution */
@@ -3338,6 +3743,7 @@
 	/* We are using IEEE 802.3z/D5.0 Table 37-4 */
 	/* we must manually resolve the abilities here */
 	pPrt->PFlowCtrlStatus = SK_FLOW_STAT_NONE;
+	
 	switch (pPrt->PFlowCtrlMode) {
 	case SK_FLOW_MODE_NONE:
 		/* default */
@@ -3457,6 +3863,9 @@
 		return(Rtv);
 	}
 
+	SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL,
+		("AutoNeg done Port %d\n", Port));
+	
 	/* We checked everything and may now enable the link */
 	pPrt->PAutoNegFail = SK_FALSE;
 
diff -Nru a/drivers/net/starfire.c b/drivers/net/starfire.c
--- a/drivers/net/starfire.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/starfire.c	Tue Feb  3 19:45:17 2004
@@ -139,7 +139,6 @@
 #include <linux/config.h>
 #include <linux/version.h>
 #include <linux/module.h>
-#include <asm/io.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/netdevice.h>
diff -Nru a/drivers/net/stnic.c b/drivers/net/stnic.c
--- a/drivers/net/stnic.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/net/stnic.c	Tue Feb  3 19:45:34 2004
@@ -306,12 +306,12 @@
 }
 
 /* Hardware interrupt handler.  */
-extern void ei_interrupt (int irq, void *dev_id, struct pt_regs *regs);
+irqreturn_t ei_interrupt (int irq, void *dev_id, struct pt_regs *regs);
 
-void
+irqreturn_t
 do_stnic_intr (int irq, void *dev_id, struct pt_regs *regs)
 {
-  ei_interrupt (0, stnic_dev, regs);
+  return ei_interrupt (0, stnic_dev, regs);
 }
 
 module_init(stnic_probe);
diff -Nru a/drivers/net/tg3.c b/drivers/net/tg3.c
--- a/drivers/net/tg3.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/net/tg3.c	Tue Feb  3 19:45:28 2004
@@ -56,8 +56,8 @@
 
 #define DRV_MODULE_NAME		"tg3"
 #define PFX DRV_MODULE_NAME	": "
-#define DRV_MODULE_VERSION	"2.5"
-#define DRV_MODULE_RELDATE	"December 22, 2003"
+#define DRV_MODULE_VERSION	"2.6"
+#define DRV_MODULE_RELDATE	"February 3, 2004"
 
 #define TG3_DEF_MAC_MODE	0
 #define TG3_DEF_RX_MODE		0
@@ -5904,7 +5904,8 @@
 	GET_REG32_LOOP(MSGINT_MODE, 0x0c);
 	GET_REG32_1(DMAC_MODE);
 	GET_REG32_LOOP(GRC_MODE, 0x4c);
-	GET_REG32_LOOP(NVRAM_CMD, 0x24);
+	if (tp->tg3_flags & TG3_FLAG_NVRAM)
+		GET_REG32_LOOP(NVRAM_CMD, 0x24);
 
 #undef __GET_REG32
 #undef GET_REG32_LOOP
@@ -7190,26 +7191,33 @@
 	test_desc.addr_lo = buf_dma & 0xffffffff;
 	test_desc.nic_mbuf = 0x00002100;
 	test_desc.len = size;
+
+	/*
+	 * HP ZX1 was seeing test failures for 5701 cards running at 33Mhz
+	 * the *second* time the tg3 driver was getting loaded after an
+	 * initial scan.
+	 *
+	 * Broadcom tells me:
+	 *   ...the DMA engine is connected to the GRC block and a DMA
+	 *   reset may affect the GRC block in some unpredictable way...
+	 *   The behavior of resets to individual blocks has not been tested.
+	 *
+	 * Broadcom noted the GRC reset will also reset all sub-components.
+	 */
 	if (to_device) {
 		test_desc.cqid_sqid = (13 << 8) | 2;
-		tw32(RDMAC_MODE, RDMAC_MODE_RESET);
-		tr32(RDMAC_MODE);
-		udelay(40);
 
 		tw32(RDMAC_MODE, RDMAC_MODE_ENABLE);
 		tr32(RDMAC_MODE);
 		udelay(40);
 	} else {
 		test_desc.cqid_sqid = (16 << 8) | 7;
-		tw32(WDMAC_MODE, WDMAC_MODE_RESET);
-		tr32(WDMAC_MODE);
-		udelay(40);
 
 		tw32(WDMAC_MODE, WDMAC_MODE_ENABLE);
 		tr32(WDMAC_MODE);
 		udelay(40);
 	}
-	test_desc.flags = 0x00000004;
+	test_desc.flags = 0x00000005;
 
 	for (i = 0; i < (sizeof(test_desc) / sizeof(u32)); i++) {
 		u32 val;
@@ -7368,9 +7376,19 @@
 	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701) {
 		/* Remove this if it causes problems for some boards. */
 		tp->dma_rwctrl |= DMA_RWCTRL_USE_MEM_READ_MULT;
-	}
 
-	tp->dma_rwctrl |= DMA_RWCTRL_ASSERT_ALL_BE;
+		/* On 5700/5701 chips, we need to set this bit.
+		 * Otherwise the chip will issue cacheline transactions
+		 * to streamable DMA memory with not all the byte
+		 * enables turned on.  This is an error on several
+		 * RISC PCI controllers, in particular sparc64.
+		 *
+		 * On 5703/5704 chips, this bit has been reassigned
+		 * a different meaning.  In particular, it is used
+		 * on those chips to enable a PCI-X workaround.
+		 */
+		tp->dma_rwctrl |= DMA_RWCTRL_ASSERT_ALL_BE;
+	}
 
 	tw32(TG3PCI_DMA_RW_CTRL, tp->dma_rwctrl);
 
@@ -7385,28 +7403,38 @@
 		goto out;
 
 	while (1) {
-		u32 *p, i;
+		u32 *p = buf, i;
 
-		p = buf;
 		for (i = 0; i < TEST_BUFFER_SIZE / sizeof(u32); i++)
 			p[i] = i;
 
 		/* Send the buffer to the chip. */
 		ret = tg3_do_test_dma(tp, buf, buf_dma, TEST_BUFFER_SIZE, 1);
-		if (ret)
+		if (ret) {
+			printk(KERN_ERR "tg3_test_dma() Write the buffer failed %d\n", ret);
 			break;
+		}
 
-		p = buf;
-		for (i = 0; i < TEST_BUFFER_SIZE / sizeof(u32); i++)
+		/* validate data reached card RAM correctly. */
+		for (i = 0; i < TEST_BUFFER_SIZE / sizeof(u32); i++) {
+			u32 val;
+			tg3_read_mem(tp, 0x2100 + (i*4), &val);
+			if (val != p[i]) {
+				printk( KERN_ERR "  tg3_test_dma()  Card buffer currupted on write! (%d != %d)\n", val, i);
+				/* ret = -ENODEV here? */
+			}
 			p[i] = 0;
+		}
 
 		/* Now read it back. */
 		ret = tg3_do_test_dma(tp, buf, buf_dma, TEST_BUFFER_SIZE, 0);
-		if (ret)
+		if (ret) {
+			printk(KERN_ERR "tg3_test_dma() Read the buffer failed %d\n", ret);
+
 			break;
+		}
 
 		/* Verify it. */
-		p = buf;
 		for (i = 0; i < TEST_BUFFER_SIZE / sizeof(u32); i++) {
 			if (p[i] == i)
 				continue;
@@ -7417,6 +7445,7 @@
 				tw32(TG3PCI_DMA_RW_CTRL, tp->dma_rwctrl);
 				break;
 			} else {
+				printk(KERN_ERR "tg3_test_dma() buffer corrupted on read back! (%d != %d)\n", p[i], i);
 				ret = -ENODEV;
 				goto out;
 			}
diff -Nru a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
--- a/drivers/net/tokenring/olympic.c	Tue Feb  3 19:45:36 2004
+++ b/drivers/net/tokenring/olympic.c	Tue Feb  3 19:45:36 2004
@@ -468,14 +468,7 @@
 	printk("Before the open command \n");
 #endif	
 	do {
-		int i;
-
-		for(i=0;i<SRB_COMMAND_SIZE;i+=4)
-			writel(0,init_srb+i);
-		if(SRB_COMMAND_SIZE & 2)
-			writew(0,init_srb+(SRB_COMMAND_SIZE & ~3));
-		if(SRB_COMMAND_SIZE & 1)
-			writeb(0,init_srb+(SRB_COMMAND_SIZE & ~1));
+		memset_io(init_srb,0,SRB_COMMAND_SIZE);
 
 		writeb(SRB_OPEN_ADAPTER,init_srb) ; 	/* open */
 		writeb(OLYMPIC_CLEAR_RET_CODE,init_srb+2);
diff -Nru a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c
--- a/drivers/net/tokenring/smctr.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/net/tokenring/smctr.c	Tue Feb  3 19:45:18 2004
@@ -729,10 +729,6 @@
 
 	netif_stop_queue(dev);
 	
-#ifdef MODULE
-        MOD_DEC_USE_COUNT;
-#endif
-
 	tp->cleanup = 1;
 
         /* Check to see if adapter is already in a closed state. */
@@ -3489,10 +3485,6 @@
         err = smctr_init_adapter(dev);
         if(err < 0)
                 return (err);
-
-#ifdef MODULE
-        MOD_INC_USE_COUNT;
-#endif
 
         return (err);
 }
diff -Nru a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c
--- a/drivers/net/tulip/xircom_cb.c	Tue Feb  3 19:45:37 2004
+++ b/drivers/net/tulip/xircom_cb.c	Tue Feb  3 19:45:37 2004
@@ -342,6 +342,11 @@
 	printk("tx status 0x%08x 0x%08x \n",card->tx_buffer[0],card->tx_buffer[4]);
 	printk("rx status 0x%08x 0x%08x \n",card->rx_buffer[0],card->rx_buffer[4]);
 #endif	
+	/* Handle shared irq and hotplug */
+	if (status == 0 || status == 0xffffffff) {
+		spin_unlock(&card->lock);
+		return IRQ_NONE;
+	}
 
 	if (link_status_changed(card)) {
 		int newlink;
diff -Nru a/drivers/net/wan/Kconfig b/drivers/net/wan/Kconfig
--- a/drivers/net/wan/Kconfig	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/wan/Kconfig	Tue Feb  3 19:45:17 2004
@@ -325,6 +325,21 @@
 comment "X.25/LAPB support is disabled"
 	depends on WAN && HDLC && (LAPB!=m || HDLC!=m) && LAPB!=y
 
+config PCI200SYN
+	tristate "Goramo PCI200SYN support"
+	depends on HDLC && PCI
+	help
+	  This driver is for PCI200SYN cards made by Goramo sp. j.
+	  If you have such a card, say Y here and see
+	  <http://hq.pm.waw.pl/pub/hdlc/>
+
+	  If you want to compile the driver as a module ( = code which can be
+	  inserted in and removed from the running kernel whenever you want),
+	  say M here and read <file:Documentation/modules.txt>.  The module
+	  will be called pci200syn.
+
+	  If unsure, say N here.
+
 config WANXL
 	tristate "SBE Inc. wanXL support"
 	depends on HDLC && PCI
@@ -367,7 +382,7 @@
 
 config PC300_MLPPP
 	bool "Cyclades-PC300 MLPPP support"
-	depends on PC300 && PPP_MULTILINK && PPP_SYNC_TTY && HDLC_PPP
+	depends on PC300 && PPP_MULTILINK && PPP_SYNC_TTY && HDLC_PPP && BROKEN
 	help
 	  Say 'Y' to this option if you are planning to use Multilink PPP over the
 	  PC300 synchronous communication boards.
diff -Nru a/drivers/net/wan/Makefile b/drivers/net/wan/Makefile
--- a/drivers/net/wan/Makefile	Tue Feb  3 19:45:29 2004
+++ b/drivers/net/wan/Makefile	Tue Feb  3 19:45:29 2004
@@ -67,6 +67,7 @@
 obj-$(CONFIG_N2)		+= n2.o
 obj-$(CONFIG_C101)		+= c101.o
 obj-$(CONFIG_WANXL)		+= wanxl.o
+obj-$(CONFIG_PCI200SYN)		+= pci200syn.o
 
 ifeq ($(CONFIG_WANXL_BUILD_FIRMWARE),y)
 ifeq ($(ARCH),m68k)
diff -Nru a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
--- a/drivers/net/wan/farsync.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/net/wan/farsync.c	Tue Feb  3 19:45:34 2004
@@ -1313,8 +1313,6 @@
         if ( err )
                 return err;
 
-        MOD_INC_USE_COUNT;
-
         fst_openport ( dev_to_port ( dev ));
         netif_wake_queue ( dev );
         return 0;
@@ -1326,7 +1324,6 @@
         netif_stop_queue ( dev );
         fst_closeport ( dev_to_port ( dev ));
         hdlc_close ( dev_to_hdlc  ( dev ));
-        MOD_DEC_USE_COUNT;
         return 0;
 }
 
diff -Nru a/drivers/net/wan/hd64572.h b/drivers/net/wan/hd64572.h
--- a/drivers/net/wan/hd64572.h	Tue Feb  3 19:45:34 2004
+++ b/drivers/net/wan/hd64572.h	Tue Feb  3 19:45:34 2004
@@ -23,8 +23,8 @@
  *
  */
 
-#ifndef _HD64572_H
-#define _HD64572_H
+#ifndef __HD64572_H
+#define __HD64572_H
 
 /* Illegal Access Register */
 #define	ILAR	0x00
@@ -59,6 +59,9 @@
 #define IR0_M(val, chan)	((val)<<(8*(chan)))		/* Int MSCI */
 
 /* MSCI Channel Registers */
+#define MSCI0_OFFSET 0x00
+#define MSCI1_OFFSET 0x80
+
 #define MD0	0x138	/* Mode reg 0 */
 #define MD1	0x139	/* Mode reg 1 */
 #define MD2	0x13a	/* Mode reg 2 */
@@ -107,6 +110,11 @@
 #define RCR	0x156	/* Rx DMA Critical Request Reg */
 
 /* Timer Registers */
+#define TIMER0RX_OFFSET 0x00
+#define TIMER0TX_OFFSET 0x10
+#define TIMER1RX_OFFSET 0x20
+#define TIMER1TX_OFFSET 0x30
+
 #define TCNTL	0x200	/* Timer Upcounter L */
 #define TCNTH	0x201	/* Timer Upcounter H */
 #define TCONRL	0x204	/* Timer Constant Register L */
@@ -132,6 +140,11 @@
 #define DCR_TX(chan)	(0x59 + 2*chan)	/* DMA Command Reg (Tx) */
 
 /* DMA Channel Registers */
+#define DMAC0RX_OFFSET 0x00
+#define DMAC0TX_OFFSET 0x20
+#define DMAC1RX_OFFSET 0x40
+#define DMAC1TX_OFFSET 0x60
+
 #define DARL	0x80	/* Dest Addr Register L (single-block, RX only) */
 #define DARH	0x81	/* Dest Addr Register H (single-block, RX only) */
 #define DARB	0x82	/* Dest Addr Register B (single-block, RX only) */
@@ -166,7 +179,17 @@
 	unsigned char	filler[5];	/* alignment filler (16 bytes) */ 
 } pcsca_bd_t;
 
-/* 
+/* Block Descriptor Structure */
+typedef struct {
+	u32 cp;			/* pointer to next block descriptor */
+	u32 bp;			/* buffer pointer */
+	u16 len;		/* data length */
+	u8 stat;		/* status */
+	u8 unused;		/* pads to 4-byte boundary */
+}pkt_desc;
+
+
+/*
 	Descriptor Status definitions:
 
 	Bit	Transmission	Reception
@@ -190,6 +213,23 @@
 #define DST_SHRT	0x40	/* Short Frame  */
 #define DST_EOM		0x80	/* End of Message  */
 
+/* Packet Descriptor Status bits */
+
+#define ST_TX_EOM     0x80	/* End of frame */
+#define ST_TX_UNDRRUN 0x08
+#define ST_TX_OWNRSHP 0x02
+#define ST_TX_EOT     0x01	/* End of transmition */
+
+#define ST_RX_EOM     0x80	/* End of frame */
+#define ST_RX_SHORT   0x40	/* Short frame */
+#define ST_RX_ABORT   0x20	/* Abort */
+#define ST_RX_RESBIT  0x10	/* Residual bit */
+#define ST_RX_OVERRUN 0x08	/* Overrun */
+#define ST_RX_CRC     0x04	/* CRC */
+#define ST_RX_OWNRSHP 0x02
+
+#define ST_ERROR_MASK 0x7C
+
 /* Status Counter Registers */
 #define CMCR	0x158	/* Counter Master Ctl Reg */
 #define TECNTL	0x160	/* Tx EOM Counter L */
@@ -246,11 +286,25 @@
 #define MD0_BIT_SYNC	0x80
 #define MD0_TRANSP	0xc0
 
+#define MD0_HDLC        0x80	/* Bit-sync HDLC mode */
+
+#define MD0_CRC_NONE	0x00
+#define MD0_CRC_16_0	0x04
+#define MD0_CRC_16	0x05
+#define MD0_CRC_ITU32	0x06
+#define MD0_CRC_ITU	0x07
+
 #define MD1_NOADDR	0x00
 #define MD1_SADDR1	0x40
 #define MD1_SADDR2	0x80
 #define MD1_DADDR	0xc0
 
+#define MD2_NRZI_IEEE	0x40
+#define MD2_MANCHESTER	0x80
+#define MD2_FM_MARK	0xA0
+#define MD2_FM_SPACE	0xC0
+#define MD2_LOOPBACK	0x03	/* Local data Loopback */
+
 #define MD2_F_DUPLEX	0x00
 #define MD2_AUTO_ECHO	0x01
 #define MD2_LOOP_HI_Z	0x02
@@ -274,6 +328,10 @@
 #define CTL_URSKP	0x40
 #define CTL_URCT	0x80
 
+#define CTL_NORTS	0x01
+#define CTL_NODTR	0x02
+#define CTL_IDLE	0x10
+
 #define	RXS_BR0		0x01
 #define	RXS_BR1		0x02
 #define	RXS_BR2		0x04
@@ -302,6 +360,12 @@
 #define	EXS_TES1	0x20
 #define	EXS_TES2	0x40
 
+#define CLK_BRG_MASK	0x0F
+#define CLK_PIN_OUT	0x80
+#define CLK_LINE    	0x00	/* clock line input */
+#define CLK_BRG     	0x40	/* internal baud rate generator */
+#define CLK_TX_RXCLK	0x60	/* TX clock from RX clock */
+
 #define CMD_RX_RST	0x11
 #define CMD_RX_ENA	0x12
 #define CMD_RX_DIS	0x13
@@ -324,6 +388,10 @@
 #define CMD_SRCH_MODE	0x31
 #define CMD_NOP		0x00
 
+#define CMD_RESET	0x21
+#define CMD_TX_ENABLE	0x02
+#define CMD_RX_ENABLE	0x12
+
 #define ST0_RXRDY	0x01
 #define ST0_TXRDY	0x02
 #define ST0_RXINTB	0x20
@@ -374,6 +442,8 @@
 #define IE0_RXINTB	0x20
 #define IE0_RXINTA	0x40
 #define IE0_TXINT	0x80
+#define IE0_UDRN	0x00008000 /* TX underrun MSCI interrupt enable */
+#define IE0_CDCD	0x00000400 /* CD level change interrupt enable */
 
 #define IE1_IDLD	0x01
 #define IE1_ABTD	0x02
@@ -424,14 +494,28 @@
 #define DIR_EOM		0x40
 #define DIR_EOT		0x80
 
+#define DIR_REFE	0x04
+#define DIR_UDRFE	0x04
+#define DIR_COAE	0x08
+#define DIR_COFE	0x10
+#define DIR_BOFE	0x20
+#define DIR_EOME	0x40
+#define DIR_EOTE	0x80
+
 #define DMR_CNTE	0x02
 #define DMR_NF		0x04
 #define DMR_SEOME	0x08
 #define DMR_TMOD	0x10
 
+#define DMER_DME        0x80	/* DMA Master Enable */
+
 #define DCR_SW_ABT	0x01
 #define DCR_FCT_CLR	0x02
 
+#define DCR_ABORT	0x01
+#define DCR_CLEAR_EOF	0x02
+
+#define PCR_COTE	0x80
 #define PCR_PR0		0x01
 #define PCR_PR1		0x02
 #define PCR_PR2		0x04
@@ -440,4 +524,4 @@
 #define PCR_OSB		0x40
 #define PCR_BURST	0x80
 
-#endif /* (_HD64572_H) */
+#endif /* (__HD64572_H) */
diff -Nru a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
--- a/drivers/net/wan/lapbether.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/wan/lapbether.c	Tue Feb  3 19:45:17 2004
@@ -448,21 +448,11 @@
 
 static int __init lapbeth_init_driver(void)
 {
-	struct net_device *dev;
-
 	dev_add_pack(&lapbeth_packet_type);
 
 	register_netdevice_notifier(&lapbeth_dev_notifier);
 
 	printk(banner);
-
-	rtnl_lock();
-	for (dev = dev_base; dev; dev = dev->next) {
-		if (dev_is_ethdev(dev)) {
-			lapbeth_new_device(dev);
-		}
-	}
-	rtnl_unlock();
 
 	return 0;
 }
diff -Nru a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c
--- a/drivers/net/wan/pc300_drv.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/net/wan/pc300_drv.c	Tue Feb  3 19:45:42 2004
@@ -6,9 +6,9 @@
  * pc300.c	Cyclades-PC300(tm) Driver.
  *
  * Author:	Ivan Passos <ivan@cyclades.com>
- * Maintainer:	Henrique Gobbi <henrique@cyclades.com>
+ * Maintainer:	PC300 Maintainer <pc300@cyclades.com>
  *
- * Copyright:	(c) 1999-2002 Cyclades Corp.
+ * Copyright:	(c) 1999-2003 Cyclades Corp.
  *
  *	This program is free software; you can redistribute it and/or
  *	modify it under the terms of the GNU General Public License
@@ -252,7 +252,7 @@
 #undef	PC300_DEBUG_RX
 #undef	PC300_DEBUG_OTHER
 
-static struct pci_device_id cpc_pci_dev_id[] = {
+static struct pci_device_id cpc_pci_dev_id[] __devinitdata = {
 	/* PC300/RSV or PC300/X21, 2 chan */
 	{0x120e, 0x300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0x300},
 	/* PC300/RSV or PC300/X21, 1 chan */
@@ -1961,7 +1961,7 @@
 		}
 		stats->rx_packets++;
 		skb->mac.raw = skb->data;
-		skb->protocol = htons(ETH_P_HDLC);
+		skb->protocol = hdlc_type_trans(skb, dev);
 		netif_rx(skb);
 	}
 }
@@ -2088,9 +2088,10 @@
 					}
 				}
 				if (!(dsr_rx = cpc_readb(scabase + DSR_RX(ch)) & DSR_DE)) {
-
-printk("%s: RX intr chan[%d] (st=0x%08lx, dsr=0x%02x, dsr2=0x%02x)\n", 
-	dev->name, ch, status, drx_stat, dsr_rx);
+#ifdef PC300_DEBUG_INTR
+		printk("%s: RX intr chan[%d] (st=0x%08lx, dsr=0x%02x, dsr2=0x%02x)\n",
+			dev->name, ch, status, drx_stat, dsr_rx);
+#endif
 					cpc_writeb(scabase + DSR_RX(ch), (dsr_rx | DSR_DE) & 0xfe);
 				}
 			}
@@ -2770,6 +2771,10 @@
 					if (!capable(CAP_NET_ADMIN)) {
 						return -EPERM;
 					}
+					/* incorrect data len? */
+					if (ifr->ifr_settings.size != size) {
+						return -ENOBUFS;
+					}
 
 					if (copy_from_user(&conf->phys_settings, 
 							   settings->ifs_ifsu.sync, size)) {
@@ -2788,12 +2793,18 @@
 				case IF_IFACE_T1:
 				case IF_IFACE_E1:
 				{
+					const size_t te_size = sizeof(te1_settings);
 					const size_t size = sizeof(sync_serial_settings);
 
 					if (!capable(CAP_NET_ADMIN)) {
 						return -EPERM;
 					}
-					
+
+					/* incorrect data len? */
+					if (ifr->ifr_settings.size != te_size) {
+						return -ENOBUFS;
+					}
+
 					if (copy_from_user(&conf->phys_settings, 
 							   settings->ifs_ifsu.te1, size)) {
 						return -EFAULT;
@@ -3165,7 +3176,6 @@
 		return result;
 	}
 
-	MOD_INC_USE_COUNT;
 	sprintf(ifr.ifr_name, "%s", dev->name);
 	cpc_opench(d);
 	netif_start_queue(dev);
@@ -3201,7 +3211,6 @@
 	}
 #endif
 
-	MOD_DEC_USE_COUNT;
 	return 0;
 }
 
@@ -3669,12 +3678,10 @@
 }
 
 static struct pci_driver cpc_driver = {
-	.name = "pc300",
-	.id_table = cpc_pci_dev_id,
-	.probe = cpc_init_one,
-	.remove = cpc_remove_one,
-	.suspend = NULL,
-	.resume = NULL,
+	.name           = "pc300",
+	.id_table       = cpc_pci_dev_id,
+	.probe          = cpc_init_one,
+	.remove         = __devexit_p(cpc_remove_one),
 };
 
 static int __init cpc_init(void)
@@ -3692,6 +3699,6 @@
 
 MODULE_DESCRIPTION("Cyclades-PC300 cards driver");
 MODULE_AUTHOR(  "Author: Ivan Passos <ivan@cyclades.com>\r\n"
-                "Maintainer: Henrique Gobbi <henrique.gobbi@cyclades.com");
+                "Maintainer: PC300 Maintainer <pc300@cyclades.com");
 MODULE_LICENSE("GPL");
 
diff -Nru a/drivers/net/wan/pci200syn.c b/drivers/net/wan/pci200syn.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/net/wan/pci200syn.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,475 @@
+/*
+ * Goramo PCI200SYN synchronous serial card driver for Linux
+ *
+ * Copyright (C) 2002-2003 Krzysztof Halasa <khc@pm.waw.pl>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License
+ * as published by the Free Software Foundation.
+ *
+ * For information see http://hq.pm.waw.pl/hdlc/
+ *
+ * Sources of information:
+ *    Hitachi HD64572 SCA-II User's Manual
+ *    PLX Technology Inc. PCI9052 Data Book
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/slab.h>
+#include <linux/sched.h>
+#include <linux/types.h>
+#include <linux/fcntl.h>
+#include <linux/in.h>
+#include <linux/string.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/moduleparam.h>
+#include <linux/netdevice.h>
+#include <linux/hdlc.h>
+#include <linux/pci.h>
+#include <asm/delay.h>
+#include <asm/io.h>
+
+#include "hd64572.h"
+
+static const char* version = "Goramo PCI200SYN driver version: 1.16";
+static const char* devname = "PCI200SYN";
+
+#undef DEBUG_PKT
+#define DEBUG_RINGS
+
+#define PCI200SYN_PLX_SIZE	0x80	/* PLX control window size (128b) */
+#define PCI200SYN_SCA_SIZE	0x400	/* SCA window size (1Kb) */
+#define ALL_PAGES_ALWAYS_MAPPED
+#define NEED_DETECT_RAM
+#define NEED_SCA_MSCI_INTR
+#define MAX_TX_BUFFERS		10
+
+static int pci_clock_freq = 33000000;
+#define CLOCK_BASE pci_clock_freq
+
+#define PCI_VENDOR_ID_GORAMO	0x10B5	/* uses PLX:9050 ID - this card	*/
+#define PCI_DEVICE_ID_PCI200SYN	0x9050	/* doesn't have its own ID	*/
+
+
+/*
+ *      PLX PCI9052 local configuration and shared runtime registers.
+ *      This structure can be used to access 9052 registers (memory mapped).
+ */
+typedef struct {
+	u32 loc_addr_range[4];	/* 00-0Ch : Local Address Ranges */
+	u32 loc_rom_range;	/* 10h : Local ROM Range */
+	u32 loc_addr_base[4];	/* 14-20h : Local Address Base Addrs */
+	u32 loc_rom_base;	/* 24h : Local ROM Base */
+	u32 loc_bus_descr[4];	/* 28-34h : Local Bus Descriptors */
+	u32 rom_bus_descr;	/* 38h : ROM Bus Descriptor */
+	u32 cs_base[4];		/* 3C-48h : Chip Select Base Addrs */
+	u32 intr_ctrl_stat;	/* 4Ch : Interrupt Control/Status */
+	u32 init_ctrl;		/* 50h : EEPROM ctrl, Init Ctrl, etc */
+}plx9052;
+
+
+
+typedef struct port_s {
+	hdlc_device hdlc;	/* HDLC device struct - must be first */
+	struct card_s *card;
+	spinlock_t lock;	/* TX lock */
+	sync_serial_settings settings;
+	int rxpart;		/* partial frame received, next frame invalid*/
+	unsigned short encoding;
+	unsigned short parity;
+	u16 rxin;		/* rx ring buffer 'in' pointer */
+	u16 txin;		/* tx ring buffer 'in' and 'last' pointers */
+	u16 txlast;
+	u8 rxs, txs, tmc;	/* SCA registers */
+	u8 phy_node;		/* physical port # - 0 or 1 */
+}port_t;
+
+
+
+typedef struct card_s {
+	u8* rambase;		/* buffer memory base (virtual) */
+	u8* scabase;		/* SCA memory base (virtual) */
+	plx9052* plxbase;	/* PLX registers memory base (virtual) */
+	u16 rx_ring_buffers;	/* number of buffers in a ring */
+	u16 tx_ring_buffers;
+	u16 buff_offset;	/* offset of first buffer of first channel */
+	u8 irq;			/* interrupt request level */
+
+	port_t ports[2];
+}card_t;
+
+
+#define sca_in(reg, card)	     readb(card->scabase + (reg))
+#define sca_out(value, reg, card)    writeb(value, card->scabase + (reg))
+#define sca_inw(reg, card)	     readw(card->scabase + (reg))
+#define sca_outw(value, reg, card)   writew(value, card->scabase + (reg))
+#define sca_inl(reg, card)	     readl(card->scabase + (reg))
+#define sca_outl(value, reg, card)   writel(value, card->scabase + (reg))
+
+#define port_to_card(port)	     (port->card)
+#define log_node(port)		     (port->phy_node)
+#define phy_node(port)		     (port->phy_node)
+#define winbase(card)		     (card->rambase)
+#define get_port(card, port)	     (&card->ports[port])
+#define sca_flush(card)		     (sca_in(IER0, card));
+
+static inline void new_memcpy_toio(char *dest, char *src, int length)
+{
+	int len;
+	do {
+		len = length > 256 ? 256 : length;
+		memcpy_toio(dest, src, len);
+		dest += len;
+		src += len;
+		length -= len;
+		readb(dest);
+	} while (len);
+}
+
+#undef memcpy_toio
+#define memcpy_toio new_memcpy_toio
+
+#include "hd6457x.c"
+
+
+static void pci200_set_iface(port_t *port)
+{
+	card_t *card = port->card;
+	u16 msci = get_msci(port);
+	u8 rxs = port->rxs & CLK_BRG_MASK;
+	u8 txs = port->txs & CLK_BRG_MASK;
+
+	sca_out(EXS_TES1, (phy_node(port) ? MSCI1_OFFSET : MSCI0_OFFSET) + EXS,
+		port_to_card(port));
+	switch(port->settings.clock_type) {
+	case CLOCK_INT:
+		rxs |= CLK_BRG; /* BRG output */
+		txs |= CLK_PIN_OUT | CLK_TX_RXCLK; /* RX clock */
+		break;
+
+	case CLOCK_TXINT:
+		rxs |= CLK_LINE; /* RXC input */
+		txs |= CLK_PIN_OUT | CLK_BRG; /* BRG output */
+		break;
+
+	case CLOCK_TXFROMRX:
+		rxs |= CLK_LINE; /* RXC input */
+		txs |= CLK_PIN_OUT | CLK_TX_RXCLK; /* RX clock */
+		break;
+
+	default:		/* EXTernal clock */
+		rxs |= CLK_LINE; /* RXC input */
+		txs |= CLK_PIN_OUT | CLK_LINE; /* TXC input */
+		break;
+	}
+
+	port->rxs = rxs;
+	port->txs = txs;
+	sca_out(rxs, msci + RXS, card);
+	sca_out(txs, msci + TXS, card);
+	sca_set_port(port);
+}
+
+
+
+static int pci200_open(struct net_device *dev)
+{
+	hdlc_device *hdlc = dev_to_hdlc(dev);
+	port_t *port = hdlc_to_port(hdlc);
+
+	int result = hdlc_open(hdlc);
+	if (result)
+		return result;
+
+	sca_open(hdlc);
+	pci200_set_iface(port);
+	sca_flush(port_to_card(port));
+	return 0;
+}
+
+
+
+static int pci200_close(struct net_device *dev)
+{
+	hdlc_device *hdlc = dev_to_hdlc(dev);
+	sca_close(hdlc);
+	sca_flush(port_to_card(dev_to_port(dev)));
+	hdlc_close(hdlc);
+	return 0;
+}
+
+
+
+static int pci200_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+{
+	const size_t size = sizeof(sync_serial_settings);
+	sync_serial_settings new_line, *line = ifr->ifr_settings.ifs_ifsu.sync;
+	hdlc_device *hdlc = dev_to_hdlc(dev);
+	port_t *port = hdlc_to_port(hdlc);
+
+#ifdef DEBUG_RINGS
+	if (cmd == SIOCDEVPRIVATE) {
+		sca_dump_rings(hdlc);
+		return 0;
+	}
+#endif
+	if (cmd != SIOCWANDEV)
+		return hdlc_ioctl(dev, ifr, cmd);
+
+	switch(ifr->ifr_settings.type) {
+	case IF_GET_IFACE:
+		ifr->ifr_settings.type = IF_IFACE_V35;
+		if (ifr->ifr_settings.size < size) {
+			ifr->ifr_settings.size = size; /* data size wanted */
+			return -ENOBUFS;
+		}
+		if (copy_to_user(line, &port->settings, size))
+			return -EFAULT;
+		return 0;
+
+	case IF_IFACE_V35:
+	case IF_IFACE_SYNC_SERIAL:
+		if (!capable(CAP_NET_ADMIN))
+			return -EPERM;
+
+		if (copy_from_user(&new_line, line, size))
+			return -EFAULT;
+
+		if (new_line.clock_type != CLOCK_EXT &&
+		    new_line.clock_type != CLOCK_TXFROMRX &&
+		    new_line.clock_type != CLOCK_INT &&
+		    new_line.clock_type != CLOCK_TXINT)
+		return -EINVAL;	/* No such clock setting */
+
+		if (new_line.loopback != 0 && new_line.loopback != 1)
+			return -EINVAL;
+
+		memcpy(&port->settings, &new_line, size); /* Update settings */
+		pci200_set_iface(port);
+		sca_flush(port_to_card(port));
+		return 0;
+
+	default:
+		return hdlc_ioctl(dev, ifr, cmd);
+	}
+}
+
+
+
+static void pci200_pci_remove_one(struct pci_dev *pdev)
+{
+	int i;
+	card_t *card = pci_get_drvdata(pdev);
+
+	for(i = 0; i < 2; i++)
+		if (card->ports[i].card)
+			unregister_hdlc_device(&card->ports[i].hdlc);
+
+	if (card->irq)
+		free_irq(card->irq, card);
+
+	if (card->rambase)
+		iounmap(card->rambase);
+	if (card->scabase)
+		iounmap(card->scabase);
+	if (card->plxbase)
+		iounmap(card->plxbase);
+
+	pci_release_regions(pdev);
+	pci_disable_device(pdev);
+	pci_set_drvdata(pdev, NULL);
+	kfree(card);
+}
+
+
+
+static int __devinit pci200_pci_init_one(struct pci_dev *pdev,
+					 const struct pci_device_id *ent)
+{
+	card_t *card;
+	u8 rev_id;
+	u32 *p;
+	int i;
+	u32 ramsize;
+	u32 ramphys;		/* buffer memory base */
+	u32 scaphys;		/* SCA memory base */
+	u32 plxphys;		/* PLX registers memory base */
+
+#ifndef MODULE
+	static int printed_version;
+	if (!printed_version++)
+		printk(KERN_INFO "%s\n", version);
+#endif
+
+	i = pci_enable_device(pdev);
+	if (i)
+		return i;
+
+	i = pci_request_regions(pdev, "PCI200SYN");
+	if (i) {
+		pci_disable_device(pdev);
+		return i;
+	}
+
+	card = kmalloc(sizeof(card_t), GFP_KERNEL);
+	if (card == NULL) {
+		printk(KERN_ERR "pci200syn: unable to allocate memory\n");
+		pci_release_regions(pdev);
+		pci_disable_device(pdev);
+		return -ENOBUFS;
+	}
+	memset(card, 0, sizeof(card_t));
+	pci_set_drvdata(pdev, card);
+
+	pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id);
+	if (pci_resource_len(pdev, 0) != PCI200SYN_PLX_SIZE ||
+	    pci_resource_len(pdev, 2) != PCI200SYN_SCA_SIZE ||
+	    pci_resource_len(pdev, 3) < 16384) {
+		printk(KERN_ERR "pci200syn: invalid card EEPROM parameters\n");
+		pci200_pci_remove_one(pdev);
+		return -EFAULT;
+	}
+
+	plxphys = pci_resource_start(pdev,0) & PCI_BASE_ADDRESS_MEM_MASK;
+	card->plxbase = ioremap(plxphys, PCI200SYN_PLX_SIZE);
+
+	scaphys = pci_resource_start(pdev,2) & PCI_BASE_ADDRESS_MEM_MASK;
+	card->scabase = ioremap(scaphys, PCI200SYN_SCA_SIZE);
+
+	ramphys = pci_resource_start(pdev,3) & PCI_BASE_ADDRESS_MEM_MASK;
+	card->rambase = ioremap(ramphys, pci_resource_len(pdev,3));
+
+	if (card->plxbase == NULL ||
+	    card->scabase == NULL ||
+	    card->rambase == NULL) {
+		printk(KERN_ERR "pci200syn: ioremap() failed\n");
+		pci200_pci_remove_one(pdev);
+	}
+
+	/* Reset PLX */
+	p = &card->plxbase->init_ctrl;
+	writel(readl(p) | 0x40000000, p);
+	readl(p);		/* Flush the write - do not use sca_flush */
+	udelay(1);
+
+	writel(readl(p) & ~0x40000000, p);
+	readl(p);		/* Flush the write - do not use sca_flush */
+	udelay(1);
+
+	ramsize = sca_detect_ram(card, card->rambase,
+				 pci_resource_len(pdev, 3));
+
+	/* number of TX + RX buffers for one port - this is dual port card */
+	i = ramsize / (2 * (sizeof(pkt_desc) + HDLC_MAX_MRU));
+	card->tx_ring_buffers = min(i / 2, MAX_TX_BUFFERS);
+	card->rx_ring_buffers = i - card->tx_ring_buffers;
+
+	card->buff_offset = 2 * sizeof(pkt_desc) * (card->tx_ring_buffers +
+						    card->rx_ring_buffers);
+
+	printk(KERN_INFO "pci200syn: %u KB RAM at 0x%x, IRQ%u, using %u TX +"
+	       " %u RX packets rings\n", ramsize / 1024, ramphys,
+	       pdev->irq, card->tx_ring_buffers, card->rx_ring_buffers);
+
+	if (card->tx_ring_buffers < 1) {
+		printk(KERN_ERR "pci200syn: RAM test failed\n");
+		pci200_pci_remove_one(pdev);
+		return -EFAULT;
+	}
+
+	/* Enable interrupts on the PCI bridge */
+	p = &card->plxbase->intr_ctrl_stat;
+	writew(readw(p) | 0x0040, p);
+
+	/* Allocate IRQ */
+	if(request_irq(pdev->irq, sca_intr, SA_SHIRQ, devname, card)) {
+		printk(KERN_WARNING "pci200syn: could not allocate IRQ%d.\n",
+		       pdev->irq);
+		pci200_pci_remove_one(pdev);
+		return -EBUSY;
+	}
+	card->irq = pdev->irq;
+
+	sca_init(card, 0);
+
+	for(i = 0; i < 2; i++) {
+		port_t *port = &card->ports[i];
+		struct net_device *dev = hdlc_to_dev(&port->hdlc);
+		port->phy_node = i;
+
+		spin_lock_init(&port->lock);
+		SET_MODULE_OWNER(dev);
+		dev->irq = card->irq;
+		dev->mem_start = ramphys;
+		dev->mem_end = ramphys + ramsize - 1;
+		dev->tx_queue_len = 50;
+		dev->do_ioctl = pci200_ioctl;
+		dev->open = pci200_open;
+		dev->stop = pci200_close;
+		port->hdlc.attach = sca_attach;
+		port->hdlc.xmit = sca_xmit;
+		port->settings.clock_type = CLOCK_EXT;
+		if(register_hdlc_device(&port->hdlc)) {
+			printk(KERN_ERR "pci200syn: unable to register hdlc "
+			       "device\n");
+			pci200_pci_remove_one(pdev);
+			return -ENOBUFS;
+		}
+		port->card = card;
+		sca_init_sync_port(port);	/* Set up SCA memory */
+
+		printk(KERN_INFO "%s: PCI200SYN node %d\n",
+		       hdlc_to_name(&port->hdlc), port->phy_node);
+	}
+
+	sca_flush(card);
+	return 0;
+}
+
+
+
+static struct pci_device_id pci200_pci_tbl[] __devinitdata = {
+	{ PCI_VENDOR_ID_GORAMO, PCI_DEVICE_ID_PCI200SYN, PCI_ANY_ID,
+	  PCI_ANY_ID, 0, 0, 0 },
+	{ 0, }
+};
+
+
+static struct pci_driver pci200_pci_driver = {
+	name:	  "PCI200SYN",
+	id_table: pci200_pci_tbl,
+	probe:	  pci200_pci_init_one,
+	remove:	  pci200_pci_remove_one,
+};
+
+
+static int __init pci200_init_module(void)
+{
+#ifdef MODULE
+	printk(KERN_INFO "%s\n", version);
+#endif
+	if (pci_clock_freq < 1000000 || pci_clock_freq > 80000000) {
+		printk(KERN_ERR "pci200syn: Invalid PCI clock frequency\n");
+		return -EINVAL;
+	}
+	return pci_module_init(&pci200_pci_driver);
+}
+
+
+
+static void __exit pci200_cleanup_module(void)
+{
+	pci_unregister_driver(&pci200_pci_driver);
+}
+
+MODULE_AUTHOR("Krzysztof Halasa <khc@pm.waw.pl>");
+MODULE_DESCRIPTION("Goramo PCI200SYN serial port driver");
+MODULE_LICENSE("GPL v2");
+MODULE_DEVICE_TABLE(pci, pci200_pci_tbl);
+module_param(pci_clock_freq, int, 0444);
+MODULE_PARM_DESC(pci_clock_freq, "System PCI clock frequency in Hz");
+module_init(pci200_init_module);
+module_exit(pci200_cleanup_module);
diff -Nru a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
--- a/drivers/net/wireless/Kconfig	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/wireless/Kconfig	Tue Feb  3 19:45:17 2004
@@ -282,7 +282,7 @@
          one of these, you will need to provide a firmware image
 	 to be loaded into the card by the driver. The Atmel
 	 firmware package can be downloaded from
-	 http://www.thekelleys.org.uk/atmel/atmel_firmware.tar.gz
+	 http://www.thekelleys.org.uk/atmel
 
 config PCMCIA_WL3501
       tristate "Planet WL3501 PCMCIA cards"
diff -Nru a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
--- a/drivers/net/wireless/airo.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/wireless/airo.c	Tue Feb  3 19:45:16 2004
@@ -1027,7 +1027,6 @@
 #define FLAG_802_11	7
 #define FLAG_PENDING_XMIT 9
 #define FLAG_PENDING_XMIT11 10
-#define FLAG_PCI	11
 #define JOB_MASK	0x1ff0000
 #define JOB_DIE		16
 #define JOB_XMIT	17
@@ -4623,7 +4622,6 @@
 		return -ENODEV;
 
 	pci_set_drvdata(pdev, dev);
-	set_bit (FLAG_PCI, &((struct airo_info *)dev->priv)->flags);
 	return 0;
 }
 
@@ -4653,7 +4651,7 @@
 
 #ifdef CONFIG_PCI
 	printk( KERN_INFO "airo:  Probing for PCI adapters\n" );
-	pci_module_init(&airo_driver);
+	pci_register_driver(&airo_driver);
 	printk( KERN_INFO "airo:  Finished probing for PCI adapters\n" );
 #endif
 
@@ -4665,22 +4663,15 @@
 
 static void __exit airo_cleanup_module( void )
 {
-	int is_pci = 0;
 	while( airo_devices ) {
 		printk( KERN_INFO "airo: Unregistering %s\n", airo_devices->dev->name );
-#ifdef CONFIG_PCI
-		if (test_bit(FLAG_PCI, &((struct airo_info *)airo_devices->dev->priv)->flags))
-			is_pci = 1;
-#endif
 		stop_airo_card( airo_devices->dev, 1 );
 	}
 	remove_proc_entry("aironet", proc_root_driver);
 
-	if (is_pci) {
 #ifdef CONFIG_PCI
-		pci_unregister_driver(&airo_driver);
+	pci_unregister_driver(&airo_driver);
 #endif
-	}
 }
 
 #ifdef WIRELESS_EXT
diff -Nru a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
--- a/drivers/net/wireless/airo_cs.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/net/wireless/airo_cs.c	Tue Feb  3 19:45:41 2004
@@ -233,7 +233,7 @@
 	client_reg.event_handler = &airo_event;
 	client_reg.Version = 0x0210;
 	client_reg.event_callback_args.client_data = link;
-	ret = CardServices(RegisterClient, &link->handle, &client_reg);
+	ret = pcmcia_register_client(&link->handle, &client_reg);
 	if (ret != 0) {
 		cs_error(link->handle, RegisterClient, ret);
 		airo_detach(link);
@@ -277,7 +277,7 @@
 	
 	/* Break the link with Card Services */
 	if (link->handle)
-		CardServices(DeregisterClient, link->handle);
+		pcmcia_deregister_client(link->handle);
 	
 	
 	
@@ -298,11 +298,8 @@
   
   ======================================================================*/
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn),args))!=0) goto cs_failed
-
-#define CFG_CHECK(fn, args...) \
-if (CardServices(fn, args) != 0) goto next_entry
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static void airo_config(dev_link_t *link)
 {
@@ -329,9 +326,9 @@
 	tuple.TupleData = buf;
 	tuple.TupleDataMax = sizeof(buf);
 	tuple.TupleOffset = 0;
-	CS_CHECK(GetFirstTuple, handle, &tuple);
-	CS_CHECK(GetTupleData, handle, &tuple);
-	CS_CHECK(ParseTuple, handle, &tuple, &parse);
+	CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+	CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+	CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
 	link->conf.ConfigBase = parse.config.base;
 	link->conf.Present = parse.config.rmask[0];
 	
@@ -351,12 +348,13 @@
 	  will only use the CIS to fill in implementation-defined details.
 	*/
 	tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
-	CS_CHECK(GetFirstTuple, handle, &tuple);
+	CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
 	while (1) {
 		cistpl_cftable_entry_t dflt = { 0 };
 		cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
-		CFG_CHECK(GetTupleData, handle, &tuple);
-		CFG_CHECK(ParseTuple, handle, &tuple, &parse);
+		if (pcmcia_get_tuple_data(handle, &tuple) != 0 ||
+				pcmcia_parse_tuple(handle, &tuple, &parse) != 0)
+			goto next_entry;
 		
 		if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg;
 		if (cfg->index == 0) goto next_entry;
@@ -405,7 +403,8 @@
 		}
 		
 		/* This reserves IO space but doesn't actually enable it */
-		CFG_CHECK(RequestIO, link->handle, &link->io); 
+		if (pcmcia_request_io(link->handle, &link->io) != 0)
+			goto next_entry;
 		
 		/*
 		  Now set up a common memory window, if needed.  There is room
@@ -425,16 +424,17 @@
 			req.Base = mem->win[0].host_addr;
 			req.Size = mem->win[0].len;
 			req.AccessSpeed = 0;
-			link->win = (window_handle_t)link->handle;
-			CFG_CHECK(RequestWindow, &link->win, &req);
+			if (pcmcia_request_window(&link->handle, &req, &link->win) != 0)
+				goto next_entry;
 			map.Page = 0; map.CardOffset = mem->win[0].card_addr;
-			CFG_CHECK(MapMemPage, link->win, &map);
+			if (pcmcia_map_mem_page(link->win, &map) != 0)
+				goto next_entry;
 		}
 		/* If we got this far, we're cool! */
 		break;
 		
 	next_entry:
-		CS_CHECK(GetNextTuple, handle, &tuple);
+		CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));
 	}
 	
     /*
@@ -443,14 +443,14 @@
       irq structure is initialized.
     */
 	if (link->conf.Attributes & CONF_ENABLE_IRQ)
-		CS_CHECK(RequestIRQ, link->handle, &link->irq);
+		CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));
 	
 	/*
 	  This actually configures the PCMCIA socket -- setting up
 	  the I/O windows and the interrupt mapping, and putting the
 	  card and host interface into "Memory and IO" mode.
 	*/
-	CS_CHECK(RequestConfiguration, link->handle, &link->conf);
+	CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));
 	((local_info_t*)link->priv)->eth_dev = 
 		init_airo_card( link->irq.AssignedIRQ,
 				link->io.BasePort1, 1 );
@@ -526,12 +526,12 @@
 	
 	/* Don't bother checking to see if these succeed or not */
 	if (link->win)
-		CardServices(ReleaseWindow, link->win);
-	CardServices(ReleaseConfiguration, link->handle);
+		pcmcia_release_window(link->win);
+	pcmcia_release_configuration(link->handle);
 	if (link->io.NumPorts1)
-		CardServices(ReleaseIO, link->handle, &link->io);
+		pcmcia_release_io(link->handle, &link->io);
 	if (link->irq.AssignedIRQ)
-		CardServices(ReleaseIRQ, link->handle, &link->irq);
+		pcmcia_release_irq(link->handle, &link->irq);
 	link->state &= ~DEV_CONFIG;
 
 	if (link->state & DEV_STALE_CONFIG)
@@ -576,7 +576,7 @@
 	case CS_EVENT_RESET_PHYSICAL:
 		if (link->state & DEV_CONFIG) {
 			netif_device_detach(local->eth_dev);
-			CardServices(ReleaseConfiguration, link->handle);
+			pcmcia_release_configuration(link->handle);
 		}
 		break;
 	case CS_EVENT_PM_RESUME:
@@ -584,7 +584,7 @@
 		/* Fall through... */
 	case CS_EVENT_CARD_RESET:
 		if (link->state & DEV_CONFIG) {
-			CardServices(RequestConfiguration, link->handle, &link->conf);
+			pcmcia_request_configuration(link->handle, &link->conf);
 			reset_airo_card(local->eth_dev);
 			netif_device_attach(local->eth_dev);
 		}
diff -Nru a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
--- a/drivers/net/wireless/atmel.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/wireless/atmel.c	Tue Feb  3 19:45:17 2004
@@ -67,7 +67,7 @@
 #include "ieee802_11.h"
 
 #define DRIVER_MAJOR 0
-#define DRIVER_MINOR 8
+#define DRIVER_MINOR 9
 
 MODULE_AUTHOR("Simon Kelley");
 MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards.");
@@ -153,12 +153,15 @@
 #define C80211_MGMT_ElementID_ChallengeText     16
 #define C80211_MGMT_CAPABILITY_ShortPreamble    0x0020
 
+#define MIB_MAX_DATA_BYTES    212
+#define MIB_HEADER_SIZE       4    /* first four fields */
+
 struct get_set_mib {
         u8 type;
         u8 size;
         u8 index;
         u8 reserved;
-        u8 data[72];
+        u8 data[MIB_MAX_DATA_BYTES];
 };
 
 struct rx_desc {
@@ -195,32 +198,40 @@
 
 
 struct tx_desc {
-   u32       NextDescriptor;
-   u16       TxStartOfFrame;
-   u16       TxLength;
-   
-   u8        TxState;
-   u8        TxStatus;
-   u8        RetryCount;
-
-   u8        TxRate;
-   u32       TxTime;
-   u8        Reserved;
-   u8        PacketType;
-   u16       HostTxLength;
-
+	u32       NextDescriptor;
+	u16       TxStartOfFrame;
+	u16       TxLength;
+	
+	u8        TxState;
+	u8        TxStatus;
+	u8        RetryCount;
+	
+	u8        TxRate;
+
+	u8        KeyIndex;
+	u8        ChiperType;
+	u8        ChipreLength;
+        u8        Reserved1;
+
+	u8        Reserved;
+	u8        PacketType;
+	u16       HostTxLength;
+	
 };
 
 
-#define TX_DESC_NEXT_OFFSET        0
-#define TX_DESC_POS_OFFSET         4
-#define TX_DESC_SIZE_OFFSET        6
-#define TX_DESC_FLAGS_OFFSET       8
-#define TX_DESC_STATUS_OFFSET      9
-#define TX_DESC_RETRY_OFFSET       10
-#define TX_DESC_RATE_OFFSET        11
-#define TX_DESC_PACKET_TYPE_OFFSET 17
-#define TX_DESC_HOST_LENGTH_OFFSET 18
+#define TX_DESC_NEXT_OFFSET          0
+#define TX_DESC_POS_OFFSET           4
+#define TX_DESC_SIZE_OFFSET          6
+#define TX_DESC_FLAGS_OFFSET         8
+#define TX_DESC_STATUS_OFFSET        9
+#define TX_DESC_RETRY_OFFSET         10
+#define TX_DESC_RATE_OFFSET          11
+#define TX_DESC_KEY_INDEX_OFFSET     12
+#define TX_DESC_CIPHER_TYPE_OFFSET   13
+#define TX_DESC_CIPHER_LENGTH_OFFSET 14
+#define TX_DESC_PACKET_TYPE_OFFSET   17
+#define TX_DESC_HOST_LENGTH_OFFSET   18
 
 
 
@@ -324,6 +335,9 @@
 #define ACTIVE_MODE 	1
 #define PS_MODE 	2
 
+#define MAX_ENCRYPTION_KEYS 4
+#define MAX_ENCRYPTION_KEY_SIZE 40
+
 ///////////////////////////////////////////////////////////////////////////
 // 802.11 related definitions
 ///////////////////////////////////////////////////////////////////////////
@@ -370,6 +384,14 @@
 #define IFACE_FUNC_CTRL_OFFSET		28
 #define IFACE_MAC_STAT_OFFSET		30
 #define IFACE_GENERIC_INT_TYPE_OFFSET	32
+
+#define CIPHER_SUITE_NONE     0 
+#define CIPHER_SUITE_WEP_64   1
+#define CIPHER_SUITE_TKIP     2
+#define CIPHER_SUITE_AES      3
+#define CIPHER_SUITE_CCX      4
+#define CIPHER_SUITE_WEP_128  5
+
 //
 // IFACE MACROS & definitions
 //
@@ -432,6 +454,7 @@
 	void *card; /* Bus dependent stucture varies for PCcard */
 	int (*present_callback)(void *); /* And callback which uses it */
 	char firmware_id[32];
+	char firmware_template[32];
 	unsigned char *firmware;
 	int firmware_length;
 	struct timer_list management_timer;
@@ -457,20 +480,11 @@
 	u16 frag_seq, frag_len, frag_no;
 	u8 frag_source[6]; 
 	
-	int wep_key_len[4]; /* need to know these and not stored in Mib. */
-	struct { /* NB this is matched to the hardware, don't change. */
-		u8 wep_is_on;                 
-		u8 default_key; /* 0..3 */
-		u8 reserved;
-		u8 exclude_unencrypted;
-		
-		u32 WEPICV_error_count;
-		u32 WEP_excluded_count;
-		
-		u8 wep_keys[4][13];
-		u8 encryption_level; /* 0, 1, 2 */
-		u8 reserved2[3];
-	} wep;
+	u8 wep_is_on, default_key, exclude_unencrypted, encryption_level;
+	u8 group_cipher_suite, pairwise_cipher_suite;
+	u8 wep_keys[MAX_ENCRYPTION_KEYS][MAX_ENCRYPTION_KEY_SIZE];
+	int wep_key_len[MAX_ENCRYPTION_KEYS]; 
+	int use_wpa;
 
 	u16 host_info_base;
 	struct host_info_struct { 
@@ -510,8 +524,6 @@
 		STATION_STATE_ASSOCIATING,
 		STATION_STATE_READY,
 		STATION_STATE_REASSOCIATING,
-		STATION_STATE_FORCED_JOINNING,
-		STATION_STATE_FORCED_JOIN_FAILURE,
 		STATION_STATE_DOWN,
 		STATION_STATE_NO_CARD,
 		STATION_STATE_MGMT_ERROR 
@@ -564,6 +576,7 @@
 
 static u8 atmel_basic_rates[4] = {0x82,0x84,0x0b,0x16};
 
+static void build_wpa_mib(struct atmel_private *priv);
 static int atmel_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 static void atmel_copy_to_card(struct net_device *dev, u16 dest, unsigned char *src, u16 len);
 static void atmel_copy_to_host(struct net_device *dev, unsigned char *dest, u16 src, u16 len);
@@ -717,14 +730,54 @@
 	return 0;
 }
 
-static void tx_update_descriptor(struct atmel_private *priv, u16 len, u16 buff, u8 type)
+static void tx_update_descriptor(struct atmel_private *priv, int is_bcast, u16 len, u16 buff, u8 type)
 {
 	atmel_wmem16(priv, atmel_tx(priv, TX_DESC_POS_OFFSET, priv->tx_desc_tail), buff);
 	atmel_wmem16(priv, atmel_tx(priv, TX_DESC_SIZE_OFFSET, priv->tx_desc_tail), len);
-	atmel_wmem16(priv, atmel_tx(priv, TX_DESC_HOST_LENGTH_OFFSET, priv->tx_desc_tail), len);
+	if (!priv->use_wpa)
+		atmel_wmem16(priv, atmel_tx(priv, TX_DESC_HOST_LENGTH_OFFSET, priv->tx_desc_tail), len);
 	atmel_wmem8(priv, atmel_tx(priv, TX_DESC_PACKET_TYPE_OFFSET, priv->tx_desc_tail), type);
 	atmel_wmem8(priv, atmel_tx(priv, TX_DESC_RATE_OFFSET, priv->tx_desc_tail), priv->tx_rate);
 	atmel_wmem8(priv, atmel_tx(priv, TX_DESC_RETRY_OFFSET, priv->tx_desc_tail), 0);
+	if (priv->use_wpa) {
+		int cipher_type, cipher_length;
+		if (is_bcast) {
+			cipher_type = priv->group_cipher_suite;
+			if (cipher_type == CIPHER_SUITE_WEP_64 || 
+			    cipher_type == CIPHER_SUITE_WEP_128 )
+				cipher_length = 8;
+			else if (cipher_type == CIPHER_SUITE_TKIP)
+				cipher_length = 12;
+			else if (priv->pairwise_cipher_suite == CIPHER_SUITE_WEP_64 ||
+				 priv->pairwise_cipher_suite == CIPHER_SUITE_WEP_128) {
+				cipher_type = priv->pairwise_cipher_suite;
+				cipher_length = 8;
+			} else {
+				cipher_type = CIPHER_SUITE_NONE;
+				cipher_length = 0;
+			}
+		} else {
+			cipher_type = priv->pairwise_cipher_suite;
+			if (cipher_type == CIPHER_SUITE_WEP_64 || 
+			    cipher_type == CIPHER_SUITE_WEP_128 )
+				cipher_length = 8;
+			else if (cipher_type == CIPHER_SUITE_TKIP)
+				cipher_length = 12;
+			else if (priv->group_cipher_suite == CIPHER_SUITE_WEP_64 ||
+				 priv->group_cipher_suite == CIPHER_SUITE_WEP_128) {
+				cipher_type = priv->group_cipher_suite;
+				cipher_length = 8;
+			} else {
+				cipher_type = CIPHER_SUITE_NONE;
+				cipher_length = 0;
+			}
+		}
+		
+		atmel_wmem8(priv, atmel_tx(priv, TX_DESC_CIPHER_TYPE_OFFSET, priv->tx_desc_tail),
+			    cipher_type);	
+		atmel_wmem8(priv, atmel_tx(priv, TX_DESC_CIPHER_LENGTH_OFFSET, priv->tx_desc_tail),
+			    cipher_length);
+	}
 	atmel_wmem32(priv, atmel_tx(priv, TX_DESC_NEXT_OFFSET, priv->tx_desc_tail), 0x80000000L);
 	atmel_wmem8(priv, atmel_tx(priv, TX_DESC_FLAGS_OFFSET, priv->tx_desc_tail), TX_FIRM_OWN);
 	if (priv->tx_desc_previous != priv->tx_desc_tail)
@@ -745,16 +798,19 @@
 	struct ieee802_11_hdr header;
 	unsigned long flags;
 	u16 buff, frame_ctl, len = (ETH_ZLEN < skb->len) ? skb->len : ETH_ZLEN;
-	
-	if(priv->station_state != STATION_STATE_READY) {
+	u8 SNAP_RFC1024[6] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00};
+ 
+	if (priv->station_state != STATION_STATE_READY) {
 		priv->stats.tx_errors++;
-		goto done;
+		dev_kfree_skb(skb);
+		return 0;
 	}
 	
 	if (priv->card && priv->present_callback && 
 	    !(*priv->present_callback)(priv->card)) {
 		priv->stats.tx_errors++;
-		goto done;
+		dev_kfree_skb(skb);
+		return 0;
 	}
 	
 	/* first ensure the timer func cannot run */
@@ -778,7 +834,7 @@
 	frame_ctl = IEEE802_11_FTYPE_DATA;
 	header.duration_id = 0;
 	header.seq_ctl = 0;
-	if (priv->wep.wep_is_on)
+	if (priv->wep_is_on)
 		frame_ctl |= IEEE802_11_FCTL_WEP;
 	if (priv->operating_mode == IW_MODE_ADHOC) {
 		memcpy(&header.addr1, skb->data, 6);
@@ -791,6 +847,9 @@
 		memcpy(&header.addr3, skb->data, 6);
 	}
 	
+	if (priv->use_wpa)
+		memcpy(&header.addr4, SNAP_RFC1024, 6);
+
 	header.frame_ctl = cpu_to_le16(frame_ctl);
 	/* Copy the wireless header into the card */
 	atmel_copy_to_card(dev, buff, (unsigned char *)&header, DATA_FRAME_WS_HEADER_SIZE);
@@ -798,14 +857,13 @@
 	atmel_copy_to_card(dev, buff + DATA_FRAME_WS_HEADER_SIZE, skb->data + 12, len - 12);
 	priv->tx_buff_tail += len - 12 + DATA_FRAME_WS_HEADER_SIZE;
 	
-	tx_update_descriptor(priv, len + 18, buff, TX_PACKET_TYPE_DATA);
+	/* low bit of first byte of destination tells us if broadcast */
+	tx_update_descriptor(priv, *(skb->data) & 0x01, len + 18, buff, TX_PACKET_TYPE_DATA);
 	dev->trans_start = jiffies;
 	priv->stats.tx_bytes += len;
 	
 	spin_unlock_irqrestore(&priv->irqlock, flags);
 	spin_unlock_bh(&priv->timerlock);
-
-done:
 	dev_kfree_skb(skb);
 	
 	return 0;	
@@ -824,7 +882,7 @@
 	atmel_copy_to_card(priv->dev, buff, (u8 *)header, MGMT_FRAME_BODY_OFFSET);
 	atmel_copy_to_card(priv->dev, buff + MGMT_FRAME_BODY_OFFSET, body, body_len);
 	priv->tx_buff_tail += len;
-	tx_update_descriptor(priv, len, buff, TX_PACKET_TYPE_MGMT);
+	tx_update_descriptor(priv, header->addr1[0] & 0x01, len, buff, TX_PACKET_TYPE_MGMT);
 }
 	
 static void fast_rx_path(struct atmel_private *priv, struct ieee802_11_hdr *header, 
@@ -1027,7 +1085,7 @@
 		/* probe for CRC use here if needed  once five packets have arrived with
 		   the same crc status, we assume we know what's happening and stop probing */
 		if (priv->probe_crc) {
-			if (!priv->wep.wep_is_on || !(frame_ctl & IEEE802_11_FCTL_WEP)) {
+			if (!priv->wep_is_on || !(frame_ctl & IEEE802_11_FCTL_WEP)) {
 				priv->do_rx_crc = probe_crc(priv, rx_packet_loc, msdu_size);
 			} else {
 				priv->do_rx_crc = probe_crc(priv, rx_packet_loc + 24, msdu_size - 24);
@@ -1042,7 +1100,7 @@
 		}
 		    
 		/* don't CRC header when WEP in use */
-		if (priv->do_rx_crc && (!priv->wep.wep_is_on || !(frame_ctl & IEEE802_11_FCTL_WEP))) {
+		if (priv->do_rx_crc && (!priv->wep_is_on || !(frame_ctl & IEEE802_11_FCTL_WEP))) {
 			crc = crc32_le(0xffffffff, (unsigned char *)&header, 24);
 		}
 		msdu_size -= 24; /* header */
@@ -1158,6 +1216,9 @@
 			reset_irq_status(priv, ISR_IBSS_MERGE);
 			atmel_get_mib(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_CUR_BSSID_POS, 
 				      priv->CurrentBSSID, 6);
+			/* The WPA stuff cares about the current AP address */
+			if (priv->use_wpa)
+				build_wpa_mib(priv);
 		} else if (isr & ISR_GENERIC_IRQ) {
 			reset_irq_status(priv, ISR_GENERIC_IRQ);
 			printk(KERN_INFO "%s: Generic_irq recieved.\n", dev->name);
@@ -1237,6 +1298,7 @@
 {
 	struct atmel_private *priv = (struct atmel_private *) dev->priv;
 		
+	netif_carrier_off(dev);	
 	if (netif_running(dev))
 		netif_stop_queue(dev);
 	
@@ -1255,17 +1317,17 @@
 	p += sprintf(p, "Driver version:\t\t%d.%d\n", DRIVER_MAJOR, DRIVER_MINOR);
 	
 	if (priv->station_state != STATION_STATE_DOWN) {
-		p += sprintf(p, "Firmware version:\t%d.%d build %d ", 
+		p += sprintf(p, "Firmware version:\t%d.%d build %d\nFirmware location:\t", 
 			     priv->host_info.major_version,
 			     priv->host_info.minor_version,
 			     priv->host_info.build_version);
 		
 		if (priv->card_type != CARD_TYPE_EEPROM) 
-			p += sprintf(p, "[built-in]\n");
+			p += sprintf(p, "on card\n");
 		else if (priv->firmware) 
-			p += sprintf(p, "[%s loaded by host]\n", priv->firmware_id);
+			p += sprintf(p, "%s loaded by host\n", priv->firmware_id);
 		else
-			p += sprintf(p, "[%s loaded by hotplug]\n", priv->firmware_id);
+			p += sprintf(p, "%s loaded by hotplug\n", priv->firmware_id);
 		
 		switch(priv->card_type) {
 		case CARD_TYPE_PARALLEL_FLASH: c = "Parallel flash"; break;
@@ -1289,6 +1351,8 @@
 		p += sprintf(p, "Regulatory domain:\t%s\n", r);
 		p += sprintf(p, "Host CRC checking:\t%s\n", 
 			     priv->do_rx_crc ? "On" : "Off");
+		p += sprintf(p, "WPA-capable firmware:\t%s\n",
+			     priv->use_wpa ? "Yes" : "No");
 	}
 	
 	switch(priv->station_state) {
@@ -1299,8 +1363,6 @@
 	case STATION_STATE_ASSOCIATING: s = "Associating"; break;
 	case STATION_STATE_READY: s = "Ready"; break;
 	case STATION_STATE_REASSOCIATING: s = "Reassociating"; break;
-	case STATION_STATE_FORCED_JOINNING: s = "Forced joining"; break;
-	case STATION_STATE_FORCED_JOIN_FAILURE: s = "Forced join failure"; break;
 	case STATION_STATE_NO_CARD: s = "No card"; break;
 	case STATION_STATE_MGMT_ERROR: s = "Management error"; break;
 	case STATION_STATE_DOWN: s = "Down"; break;
@@ -1348,12 +1410,12 @@
 	priv->present_callback = card_present;
 	priv->card = card;
 	priv->firmware = NULL;
+	priv->firmware_id[0] = '\0';
+	priv->firmware_template[0] = '\0';
 	if (firmware) /* module parameter */
 		strcpy(priv->firmware_id, firmware);
 	else if (firmware_id) /* from PCMCIA card-matching or PCI */
-		strcpy(priv->firmware_id, firmware_id);
-	else
-		priv->firmware_id[0] = '\0';
+		strcpy(priv->firmware_template, firmware_id);
 	priv->bus_type = card_present ? BUS_TYPE_PCCARD : BUS_TYPE_PCI;
 	priv->station_state = STATION_STATE_DOWN;
 	priv->is3com = is3com;
@@ -1389,9 +1451,16 @@
 	priv->rts_threshold = 2347;
 	priv->short_retry = 7;
 	priv->long_retry = 4;
-	priv->wep.wep_is_on = 0;
-	priv->wep.default_key = 0;
-	priv->wep.encryption_level = 0;
+
+	priv->wep_is_on = 0;
+	priv->default_key = 0;
+	priv->encryption_level = 0;
+	priv->exclude_unencrypted = 0;
+	priv->group_cipher_suite = priv->pairwise_cipher_suite = CIPHER_SUITE_NONE;
+	priv->use_wpa = 0;
+	memset(priv->wep_keys, 0, sizeof(priv->wep_keys));
+	memset(priv->wep_key_len, 0, sizeof(priv->wep_key_len));
+
 	priv->default_beacon_period = priv->beacon_period = 100;
 	priv->listen_interval = 1;
 
@@ -1426,8 +1495,12 @@
 	if (register_netdev(dev))
 		goto err_out_res;
 	
-	if (!probe_atmel_card(dev))
+	if (!probe_atmel_card(dev)){
+		unregister_netdev(dev);
 		goto err_out_res;
+	}
+	
+	netif_carrier_off(dev);
 	
 	create_proc_read_entry ("driver/atmel", 0, 0, atmel_read_proc, priv);	
 	
@@ -1443,7 +1516,7 @@
  err_out_irq:
 	free_irq(dev->irq, dev);
  err_out_free:
-	kfree(dev);
+	free_netdev(dev);
 	return NULL;
 }
 
@@ -1582,7 +1655,7 @@
 	 * don't do it. - Jean II */
 	if (dwrq->length > 0) {
 		int index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
-		int current_index = priv->wep.default_key;
+		int current_index = priv->default_key;
 		/* Check the size of the key */
 		if (dwrq->length > 13) {
 			return -EINVAL;
@@ -1591,7 +1664,7 @@
 		if (index < 0 || index >= 4)
 			index = current_index;
 		else
-			priv->wep.default_key = index;
+			priv->default_key = index;
 		/* Set the length */
 		if (dwrq->length > 5)
 			priv->wep_key_len[index] = 13;
@@ -1604,27 +1677,30 @@
 		/* Check if the key is not marked as invalid */
 		if(!(dwrq->flags & IW_ENCODE_NOKEY)) {
 			/* Cleanup */
-			memset(priv->wep.wep_keys[index], 0, 13);
+			memset(priv->wep_keys[index], 0, 13);
 			/* Copy the key in the driver */
-			memcpy(priv->wep.wep_keys[index], extra, dwrq->length);
+			memcpy(priv->wep_keys[index], extra, dwrq->length);
 		}
 		/* WE specify that if a valid key is set, encryption
 		 * should be enabled (user may turn it off later)
 		 * This is also how "iwconfig ethX key on" works */
 		if (index == current_index && 
 		    priv->wep_key_len[index] > 0) {
-			priv->wep.wep_is_on = 1;
-			priv->wep.exclude_unencrypted = 1;
-			if (priv->wep_key_len[index] > 5)
-				priv->wep.encryption_level = 2;
-			else
-				priv->wep.encryption_level = 1;
+			priv->wep_is_on = 1;
+			priv->exclude_unencrypted = 1;
+			if (priv->wep_key_len[index] > 5) {
+				priv->pairwise_cipher_suite = CIPHER_SUITE_WEP_64;
+				priv->encryption_level = 2;
+			} else {
+				priv->pairwise_cipher_suite = CIPHER_SUITE_WEP_128;
+				priv->encryption_level = 1;
+			}
 		}
 	} else {
 		/* Do we want to just set the transmit key index ? */
 		int index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
 		if ( index>=0 && index < 4 ) {
-			priv->wep.default_key = index;
+			priv->default_key = index;
 		} else
 			/* Don't complain if only change the mode */
 			if(!dwrq->flags & IW_ENCODE_MODE) {
@@ -1633,19 +1709,23 @@
 	}
 	/* Read the flags */
 	if(dwrq->flags & IW_ENCODE_DISABLED) {
-		priv->wep.wep_is_on = 0;
-		priv->wep.encryption_level = 0; 
+		priv->wep_is_on = 0;
+		priv->encryption_level = 0; 	
+		priv->pairwise_cipher_suite = CIPHER_SUITE_NONE;
 	} else {
-		priv->wep.wep_is_on = 1;
-		if (priv->wep_key_len[priv->wep.default_key] > 5)
-			priv->wep.encryption_level = 2;
-		else
-			priv->wep.encryption_level = 1;
+		priv->wep_is_on = 1;
+		if (priv->wep_key_len[priv->default_key] > 5) {
+			priv->pairwise_cipher_suite = CIPHER_SUITE_WEP_128;
+			priv->encryption_level = 2;
+		} else {
+			priv->pairwise_cipher_suite = CIPHER_SUITE_WEP_64;
+			priv->encryption_level = 1;
+		}
 	}
 	if(dwrq->flags & IW_ENCODE_RESTRICTED)
-		priv->wep.exclude_unencrypted = 1;
+		priv->exclude_unencrypted = 1;
 	if(dwrq->flags & IW_ENCODE_OPEN)
-		priv->wep.exclude_unencrypted = 0;
+		priv->exclude_unencrypted = 0;
 	
 	return -EINPROGRESS;		/* Call commit handler */
 }
@@ -1659,16 +1739,16 @@
 	struct atmel_private *priv = dev->priv;
 	int index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
 	
-	if (!priv->wep.wep_is_on)
+	if (!priv->wep_is_on)
 		dwrq->flags = IW_ENCODE_DISABLED;
-	else if (priv->wep.exclude_unencrypted)
+	else if (priv->exclude_unencrypted)
 		dwrq->flags = IW_ENCODE_RESTRICTED;
 	else
 		dwrq->flags = IW_ENCODE_OPEN;
 		
 		/* Which key do we want ? -1 -> tx index */
 	if (index < 0 || index >= 4)
-		index = priv->wep.default_key;
+		index = priv->default_key;
 	dwrq->flags |= index + 1;
 	/* Copy the key to the user buffer */
 	dwrq->length = priv->wep_key_len[index];
@@ -1676,7 +1756,7 @@
 		dwrq->length=0;
 	} else {
 		memset(extra, 0, 16);
-		memcpy(extra, priv->wep.wep_keys[index], dwrq->length);
+		memcpy(extra, priv->wep_keys[index], dwrq->length);
 	}
 	
 	return 0;
@@ -1711,10 +1791,10 @@
 		} else {
 		/* Setting by frequency value */
 			switch (vwrq->value) {
-			case (int)1e6: priv->tx_rate = 0; break;
-			case (int)2e6: priv->tx_rate = 1; break;
-			case (int)5.5e6: priv->tx_rate = 2; break;
-			case (int)11e6:  priv->tx_rate = 3; break;
+			case  1000000: priv->tx_rate = 0; break;
+			case  2000000: priv->tx_rate = 1; break;
+			case  5500000: priv->tx_rate = 2; break;
+			case 11000000: priv->tx_rate = 3; break;
 			default: return -EINVAL;
 			}
 		}
@@ -1757,14 +1837,14 @@
 
 	if (priv->auto_tx_rate) {
 		vwrq->fixed = 0;
-		vwrq->value = 11e6;
+		vwrq->value = 11000000;
 	} else {
 		vwrq->fixed = 1;
 		switch(priv->tx_rate) {
-		case 0: vwrq->value = 1e6; break;
-		case 1: vwrq->value = 2e6; break;
-		case 2: vwrq->value = 5.5e6; break;
-		case 3: vwrq->value = 11e6; break;
+		case 0: vwrq->value =  1000000; break;
+		case 1: vwrq->value =  2000000; break;
+		case 2: vwrq->value =  5500000; break;
+		case 3: vwrq->value = 11000000; break;
 		}
 	}
 	return 0;
@@ -1982,6 +2062,7 @@
 	
 	atmel_clear_gcr(dev, GCR_ENINT); /* disable interrupts */
 	del_timer_sync(&priv->management_timer);
+	priv->fast_scan = 0;
 	atmel_scan(priv, 0);
 	atmel_set_gcr(dev, GCR_ENINT); /* enable interrupts */
 	
@@ -2073,10 +2154,10 @@
 	range->max_qual.noise = 0;
 	range->sensitivity = 0;
 
-	range->bitrate[0] = 1e6;
-	range->bitrate[1] = 2e6;
-	range->bitrate[2] = 5.5e6;
-	range->bitrate[3] = 11e6;
+	range->bitrate[0] =  1000000;
+	range->bitrate[1] =  2000000;
+	range->bitrate[2] =  5500000;
+	range->bitrate[3] = 11000000;
 	range->num_bitrates = 4;
 
 	range->min_rts = 0;
@@ -2129,9 +2210,9 @@
 	
 	for(i=0; i<priv->BSS_list_entries; i++) {
 		if (memcmp(priv->BSSinfo[i].BSSID, awrq->sa_data, 6) == 0) {
-			if (!priv->wep.wep_is_on && priv->BSSinfo[i].UsingWEP) {
+			if (!priv->wep_is_on && priv->BSSinfo[i].UsingWEP) {
 				return -EINVAL;
-			} else if  (priv->wep.wep_is_on && !priv->BSSinfo[i].UsingWEP) {
+			} else if  (priv->wep_is_on && !priv->BSSinfo[i].UsingWEP) {
 				return -EINVAL;
 			} else 
 				atmel_join_bss(priv, i);  
@@ -2313,10 +2394,13 @@
 	if (new_state == old_state)
 		return;
 
-	if (new_state == STATION_STATE_READY)
+	if (new_state == STATION_STATE_READY) {
 		netif_start_queue(priv->dev);
+		netif_carrier_on(priv->dev);
+	}
 
 	if (old_state == STATION_STATE_READY) {
+		netif_carrier_off(priv->dev);
 		netif_stop_queue(priv->dev);
 		priv->last_beacon_timestamp = 0;
 	}
@@ -2453,7 +2537,7 @@
 	memcpy(header.addr2, priv->dev->dev_addr, 6);
 	memcpy(header.addr3, priv->CurrentBSSID, 6);
 	
-	if (priv->wep.wep_is_on) {
+	if (priv->wep_is_on) {
 		auth.alg = C80211_MGMT_AAN_SHAREDKEY; 
 		/* no WEP for authentication frames with TrSeqNo 1 */
 		if (priv->CurrentAuthentTransactionSeqNum != 1)
@@ -2504,7 +2588,7 @@
 	memcpy(header.addr3, priv->CurrentBSSID, 6); 
 
 	body.capability = cpu_to_le16(C80211_MGMT_CAPABILITY_ESS);
-	if (priv->wep.wep_is_on)
+	if (priv->wep_is_on)
 		body.capability |= cpu_to_le16(C80211_MGMT_CAPABILITY_Privacy);
 	if (priv->preamble == SHORT_PREAMBLE)
 		body.capability |= cpu_to_le16(C80211_MGMT_CAPABILITY_ShortPreamble);
@@ -2555,8 +2639,8 @@
 		priv->current_BSS = 0;
 		for(i=0; i<priv->BSS_list_entries; i++) { 
 			if (priv->operating_mode == priv->BSSinfo[i].BSStype &&
-			    ((!priv->wep.wep_is_on && !priv->BSSinfo[i].UsingWEP) || 
-			     (priv->wep.wep_is_on && priv->BSSinfo[i].UsingWEP)) &&
+			    ((!priv->wep_is_on && !priv->BSSinfo[i].UsingWEP) || 
+			     (priv->wep_is_on && priv->BSSinfo[i].UsingWEP)) &&
 			    !(priv->BSSinfo[i].channel & 0x80)) {
 				max_rssi = priv->BSSinfo[i].RSSI;
 				priv->current_BSS = max_index = i;
@@ -2630,7 +2714,7 @@
 	u16 status = le16_to_cpu(auth->status);
 	u16 trans_seq_no = le16_to_cpu(auth->trans_seq);
 	
-	if (status == C80211_MGMT_SC_Success && !priv->wep.wep_is_on) { 
+	if (status == C80211_MGMT_SC_Success && !priv->wep_is_on) { 
 		/* no WEP */
 		if (priv->station_was_associated) {
 			atmel_enter_state(priv, STATION_STATE_REASSOCIATING);
@@ -2643,7 +2727,7 @@
 		} 
 	}
 		
-	if (status == C80211_MGMT_SC_Success && priv->wep.wep_is_on) { 
+	if (status == C80211_MGMT_SC_Success && priv->wep_is_on) { 
 		/* WEP */
 		if (trans_seq_no != priv->ExpectedAuthentTransactionSeqNum)
 			return;
@@ -2765,6 +2849,10 @@
 
 	memcpy(priv->CurrentBSSID, bss->BSSID, 6);
 	memcpy(priv->SSID, bss->SSID, priv->SSID_size = bss->SSIDsize);
+
+	/* The WPA stuff cares about the current AP address */
+	if (priv->use_wpa)
+		build_wpa_mib(priv);
 	
 	/* When switching to AdHoc turn OFF Power Save if needed */
 
@@ -2786,13 +2874,13 @@
 		atmel_set_mib8(priv, Local_Mib_Type, LOCAL_MIB_PREAMBLE_TYPE, bss->preamble);
 	}
 	
-	if (!priv->wep.wep_is_on && bss->UsingWEP) {
+	if (!priv->wep_is_on && bss->UsingWEP) {
 		atmel_enter_state(priv, STATION_STATE_MGMT_ERROR);
 		priv->station_is_associated = 0;
 		return;
 	}
 		
-	if (priv->wep.wep_is_on && !bss->UsingWEP) {
+	if (priv->wep_is_on && !bss->UsingWEP) {
 		atmel_enter_state(priv, STATION_STATE_MGMT_ERROR);
 		priv->station_is_associated = 0;
 		return;
@@ -3071,6 +3159,7 @@
 				priv->fast_scan = !fast_scan;
 				atmel_scan(priv, 1);
 			}
+			priv->site_survey_state = SITE_SURVEY_COMPLETED;
 		}
 		break;
 		
@@ -3104,12 +3193,8 @@
 			return;
 		}
 		
-
-		if (priv->station_state == STATION_STATE_FORCED_JOINNING) {
-			atmel_enter_state(priv, STATION_STATE_FORCED_JOIN_FAILURE); 
-		} else {
-			atmel_scan(priv, 1);
-		}
+		atmel_scan(priv, 1);
+		
 	}
 }
 
@@ -3275,7 +3360,7 @@
 			printk(KERN_ALERT "%s: *** Invalid MAC address. UPGRADE Firmware ****\n", dev->name);
 			memcpy(dev->dev_addr, default_mac, 6);
 		}
-		printk(KERN_INFO "%s: MAC address %x:%x:%x:%x:%x:%x\n",
+		printk(KERN_INFO "%s: MAC address %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
 		       dev->name,
 		       dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
 		       dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5] );
@@ -3285,6 +3370,105 @@
 	return rc;
 }
 
+static void build_wep_mib(struct atmel_private *priv)
+/* Move the encyption information on the MIB structure.
+   This routine is for the pre-WPA firmware: later firmware has
+   a different format MIB and a different routine. */
+{
+	struct { /* NB this is matched to the hardware, don't change. */
+		u8 wep_is_on;                 
+		u8 default_key; /* 0..3 */
+		u8 reserved;
+		u8 exclude_unencrypted;
+		
+		u32 WEPICV_error_count;
+		u32 WEP_excluded_count;
+		
+		u8 wep_keys[MAX_ENCRYPTION_KEYS][13];
+ 		u8 encryption_level; /* 0, 1, 2 */
+		u8 reserved2[3]; 
+	} mib;
+	int i;
+
+	mib.wep_is_on = priv->wep_is_on;
+	if (priv->wep_is_on) {
+		if (priv->wep_key_len[priv->default_key] > 5)
+			mib.encryption_level = 2;
+		else
+			mib.encryption_level = 1;	
+	} else {
+		mib.encryption_level = 0;
+	}
+
+	mib.default_key = priv->default_key;
+	mib.exclude_unencrypted = priv->exclude_unencrypted;
+	
+	for(i = 0; i < MAX_ENCRYPTION_KEYS;  i++)
+		memcpy(mib.wep_keys[i], priv->wep_keys[i], 13);
+		
+	atmel_set_mib(priv, Mac_Wep_Mib_Type, 0, (u8 *)&mib, sizeof(mib));
+}
+
+static void build_wpa_mib(struct atmel_private *priv)
+{
+	/* This is for the later (WPA enabled) firmware. */	   
+
+	struct { /* NB this is matched to the hardware, don't change. */
+		u8 cipher_default_key_value[MAX_ENCRYPTION_KEYS][MAX_ENCRYPTION_KEY_SIZE];
+		u8 receiver_address[6];
+		u8 wep_is_on;                 
+		u8 default_key; /* 0..3 */
+		u8 group_key;
+		u8 exclude_unencrypted;
+		u8 encryption_type;
+		u8 reserved;
+		
+		u32 WEPICV_error_count;
+		u32 WEP_excluded_count;
+		
+		u8 key_RSC[4][8];
+	} mib;
+	
+	int i;
+
+	mib.wep_is_on = priv->wep_is_on;
+	mib.exclude_unencrypted = priv->exclude_unencrypted;
+	memcpy(mib.receiver_address, priv->CurrentBSSID, 6);
+	
+	/* zero all the keys before adding in valid ones. */
+	memset(mib.cipher_default_key_value, 0, sizeof(mib.cipher_default_key_value));
+	
+	if (priv->wep_is_on) {
+		/* There's a comment in the Atmel code to the effect that this is only valid
+		   when still using WEP, it may need to be set to something to use WPA */
+		memset(mib.key_RSC, 0, sizeof(mib.key_RSC));
+		
+		mib.default_key = mib.group_key = 255;
+		for (i = 0; i < MAX_ENCRYPTION_KEYS; i++) {
+			if (priv->wep_key_len[i] > 0) {
+				memcpy(mib.cipher_default_key_value[i], priv->wep_keys[i], MAX_ENCRYPTION_KEY_SIZE);
+				if (i == priv->default_key) {
+					mib.default_key = i;
+					mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-1] = 7;
+					mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-2] = priv->pairwise_cipher_suite; 
+				} else {
+					mib.group_key = i;
+					priv->group_cipher_suite = priv->pairwise_cipher_suite;
+				        mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-1] = 1;
+					mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-2] = priv->group_cipher_suite;	
+				}
+			}
+		}
+		if (mib.default_key == 255)
+			mib.default_key = mib.group_key != 255 ? mib.group_key : 0;
+		if (mib.group_key == 255)
+			mib.group_key = mib.default_key;
+		
+	}
+	
+	atmel_set_mib(priv, Mac_Wep_Mib_Type, 0, (u8 *)&mib, sizeof(mib));
+}
+					
 int reset_atmel_card(struct net_device *dev) 
 {
 	/* do everything necessary to wake up the hardware, including
@@ -3305,6 +3489,15 @@
 	struct atmel_private *priv = dev->priv;
 	u8 configuration;
 	
+	/* data to add to the firmware names, in priority order
+	   this implemenents firmware versioning */
+	
+	static char *firmware_modifier[] = {
+		"-wpa",
+		"",
+		NULL
+	};
+	
 	if (priv->station_state == STATION_STATE_NO_CARD ||
 	    priv->station_state == STATION_STATE_DOWN)
 		return 0;
@@ -3341,21 +3534,41 @@
 		unsigned char *fw;
 		int len = priv->firmware_length;
 		if (!(fw = priv->firmware)) { 
-			if (strlen(priv->firmware_id) == 0) {
-				printk(KERN_INFO
-				       "%s: card type is unknown: assuming at76c502 firmware is OK.\n",
-				       dev->name);
-				printk(KERN_INFO
-				       "%s: if not, use the firmware= module parameter.\n", 
-				       dev->name);
-				strcpy(priv->firmware_id, "atmel_at76c502.bin");
-			}
-			if (request_firmware(&fw_entry, priv->firmware_id, priv->sys_dev) != 0) {
-				printk(KERN_ALERT 
-				       "%s: firmware %s is missing, cannot start.\n", 
-				       dev->name, priv->firmware_id);
-				return 0;
+			if (strlen(priv->firmware_template) == 0) {	
+				if (strlen(priv->firmware_id) == 0) {
+					printk(KERN_INFO
+					       "%s: card type is unknown: assuming at76c502 firmware is OK.\n",
+					       dev->name);
+					printk(KERN_INFO
+					       "%s: if not, use the firmware= module parameter.\n", 
+					       dev->name);
+					strcpy(priv->firmware_id, "atmel_at76c502.bin");
+				}
+				if (request_firmware(&fw_entry, priv->firmware_id, priv->sys_dev) != 0) {
+					printk(KERN_ALERT 
+					       "%s: firmware %s is missing, cannot continue.\n", 
+					       dev->name, priv->firmware_id);
+					return 0;
+					
+				} 
+			} else {
+				int i;
+				
+				for (i = 0; firmware_modifier[i]; i++) {
+					sprintf(priv->firmware_id, priv->firmware_template, firmware_modifier[i]);
+					if (request_firmware(&fw_entry, priv->firmware_id, priv->sys_dev) == 0) 
+						break;
+				}
+				if (!firmware_modifier[i]) {
+					printk(KERN_ALERT 
+					       "%s: firmware %s is missing, cannot start.\n", 
+					       dev->name, priv->firmware_id);
+					priv->firmware_id[0] = '\0';
+					return 0;	
+				}
+				priv->firmware_template[0] = '\0';	
 			}
+			
 			fw = fw_entry->data;
 			len = fw_entry->size;
 		}
@@ -3379,6 +3592,10 @@
 
 	if (!atmel_wakeup_firmware(priv))
 		return 0;
+
+	/* Check the version and set the correct flag for wpa stuff,
+	   old and new firmware is incompatible. */
+	priv->use_wpa = (priv->host_info.major_version >= 4);
 	
         /* unmask all irq sources */
 	atmel_wmem8(priv, atmel_hi(priv, IFACE_INT_MASK_OFFSET), 0xff);
@@ -3447,9 +3664,12 @@
 	atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_LISTEN_INTERVAL_POS, 1);
 	atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_BEACON_PER_POS, priv->default_beacon_period);
 	atmel_set_mib(priv, Phy_Mib_Type, PHY_MIB_RATE_SET_POS, atmel_basic_rates, 4);
-	atmel_set_mib8(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_CUR_PRIVACY_POS, priv->wep.wep_is_on);
-	atmel_set_mib(priv, Mac_Wep_Mib_Type, 0, (u8 *)&priv->wep, sizeof(priv->wep));
-		
+	atmel_set_mib8(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_CUR_PRIVACY_POS, priv->wep_is_on);
+	if (priv->use_wpa)
+		build_wpa_mib(priv);
+	else
+		build_wep_mib(priv);
+	
 	atmel_scan(priv, 1);
 	
 	atmel_set_gcr(priv->dev, GCR_ENINT); /* enable interrupts */
@@ -3500,8 +3720,8 @@
 	m.size = 1;
 	m.index = index;
 
-	atmel_send_command_wait(priv, CMD_Get_MIB_Vars, &m, sizeof(m));
-	return atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_PARAMETERS_OFFSET + 4));
+	atmel_send_command_wait(priv, CMD_Get_MIB_Vars, &m, MIB_HEADER_SIZE + 1);
+	return atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_PARAMETERS_OFFSET + MIB_HEADER_SIZE));
 }
 
 static void atmel_set_mib8(struct atmel_private *priv, u8 type, u8 index, u8 data)
@@ -3512,7 +3732,7 @@
 	m.index = index;
 	m.data[0] = data;
 
-	atmel_send_command_wait(priv, CMD_Set_MIB_Vars, &m, sizeof(m));
+	atmel_send_command_wait(priv, CMD_Set_MIB_Vars, &m, MIB_HEADER_SIZE + 1);
 }
 
 static void atmel_set_mib16(struct atmel_private *priv, u8 type, u8 index, u16 data)
@@ -3524,7 +3744,7 @@
 	m.data[0] = data;
 	m.data[1] = data >> 8;
 
-	atmel_send_command_wait(priv, CMD_Set_MIB_Vars, &m, sizeof(m));
+	atmel_send_command_wait(priv, CMD_Set_MIB_Vars, &m, MIB_HEADER_SIZE + 2);
 }
 
 static void atmel_set_mib(struct atmel_private *priv, u8 type, u8 index, u8 *data, int data_len)
@@ -3534,8 +3754,11 @@
 	m.size = data_len;
 	m.index = index;
 
+	if (data_len > MIB_MAX_DATA_BYTES)
+		printk(KERN_ALERT "%s: MIB buffer too small.\n", priv->dev->name);
+	
 	memcpy(m.data, data, data_len);
-	atmel_send_command_wait(priv, CMD_Set_MIB_Vars, &m, sizeof(m));
+	atmel_send_command_wait(priv, CMD_Set_MIB_Vars, &m, MIB_HEADER_SIZE + data_len);
 }
 
 static void atmel_get_mib(struct atmel_private *priv, u8 type, u8 index, u8 *data, int data_len)
@@ -3545,10 +3768,14 @@
 	m.size = data_len;
 	m.index = index;
 	
-	atmel_send_command_wait(priv, CMD_Get_MIB_Vars, &m, sizeof(m));
-	atmel_copy_to_host(priv->dev, data, atmel_co(priv, CMD_BLOCK_PARAMETERS_OFFSET + 4), data_len);
-}
+	if (data_len > MIB_MAX_DATA_BYTES)
+		printk(KERN_ALERT "%s: MIB buffer too small.\n", priv->dev->name);
 	
+	atmel_send_command_wait(priv, CMD_Get_MIB_Vars, &m, MIB_HEADER_SIZE + data_len);
+	atmel_copy_to_host(priv->dev, data, 
+			   atmel_co(priv, CMD_BLOCK_PARAMETERS_OFFSET + MIB_HEADER_SIZE), data_len);
+}
+
 static void atmel_writeAR(struct net_device *dev, u16 data)
 {
 	int i;
diff -Nru a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
--- a/drivers/net/wireless/atmel_cs.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/net/wireless/atmel_cs.c	Tue Feb  3 19:45:18 2004
@@ -246,7 +246,7 @@
 	client_reg.event_handler = &atmel_event;
 	client_reg.Version = 0x0210;
 	client_reg.event_callback_args.client_data = link;
-	ret = CardServices(RegisterClient, &link->handle, &client_reg);
+	ret = pcmcia_register_client(&link->handle, &client_reg);
 	if (ret != 0) {
 		cs_error(link->handle, RegisterClient, ret);
 		atmel_detach(link);
@@ -282,7 +282,7 @@
 		
 	/* Break the link with Card Services */
 	if (link->handle)
-		CardServices(DeregisterClient, link->handle);
+		pcmcia_deregister_client(link->handle);
 
 	/* Unlink device structure, free pieces */
 	*linkp = link->next;
@@ -299,11 +299,8 @@
   
   ======================================================================*/
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn),args))!=0) goto cs_failed
-
-#define CFG_CHECK(fn, args...) \
-if (CardServices(fn, args) != 0) goto next_entry
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 /* Call-back function to interrogate PCMCIA-specific information
    about the current existance of the card */
@@ -330,20 +327,20 @@
 	char *firmware;
 	char *name;
 } card_table[] = {
-	{ 0, 0, "WLAN/802.11b PC CARD", "atmel_at76c502d.bin", "Actiontec 802CAT1" },  
-	{ 0, 0, "ATMEL/AT76C502AR", "atmel_at76c502.bin", "NoName-RFMD" }, 
-	{ 0, 0, "ATMEL/AT76C502AR_D", "atmel_at76c502d.bin", "NoName-revD" }, 
-	{ 0, 0, "ATMEL/AT76C502AR_E", "atmel_at76c502e.bin", "NoName-revE" },
-	{ 0, 0, "ATMEL/AT76C504", "atmel_at76c504.bin", "NoName-504" },
-	{ MANFID_3COM, 0x0620, NULL, "atmel_at76c502_3com.bin", "3com 3CRWE62092B" }, 
-	{ MANFID_3COM, 0x0696, NULL, "atmel_at76c502_3com.bin", "3com 3CRSHPW_96" }, 
-	{ 0, 0, "SMC/2632W-V2", "atmel_at76c502.bin", "SMC 2632W-V2" },
-        { 0, 0, "SMC/2632W", "atmel_at76c502d.bin", "SMC 2632W-V3" },
-	{ 0xd601, 0x0007, NULL, "atmel_at76c502.bin", "Sitecom WLAN-011"}, /* suspect - from a usenet posting. */
-	{ 0x01bf, 0x3302, NULL, "atmel_at76c502d.bin", "Belkin F5D6060u"},  /*    "        "  "    "      "     */
-	{ 0, 0, "BT/Voyager 1020 Laptop Adapter", "atmel_at76c502.bin", "BT Voyager 1020"},
-        { 0, 0, "IEEE 802.11b/Wireless LAN PC Card", "atmel_at76c502.bin", "Siemens Gigaset PC Card II" },
-	{ 0, 0, "CNet/CNWLC 11Mbps Wireless PC Card V-5", "atmel_at76c502e.bin", "CNet CNWLC-811ARL" }
+	{ 0, 0, "WLAN/802.11b PC CARD", "atmel_at76c502d%s.bin", "Actiontec 802CAT1" },  
+	{ 0, 0, "ATMEL/AT76C502AR", "atmel_at76c502%s.bin", "NoName-RFMD" }, 
+	{ 0, 0, "ATMEL/AT76C502AR_D", "atmel_at76c502d%s.bin", "NoName-revD" }, 
+	{ 0, 0, "ATMEL/AT76C502AR_E", "atmel_at76c502e%s.bin", "NoName-revE" },
+	{ 0, 0, "ATMEL/AT76C504", "atmel_at76c504%s.bin", "NoName-504" },
+	{ MANFID_3COM, 0x0620, NULL, "atmel_at76c502_3com%s.bin", "3com 3CRWE62092B" }, 
+	{ MANFID_3COM, 0x0696, NULL, "atmel_at76c502_3com%s.bin", "3com 3CRSHPW_96" }, 
+	{ 0, 0, "SMC/2632W-V2", "atmel_at76c502%s.bin", "SMC 2632W-V2" },
+        { 0, 0, "SMC/2632W", "atmel_at76c502d%s.bin", "SMC 2632W-V3" },
+	{ 0xd601, 0x0007, NULL, "atmel_at76c502%s.bin", "Sitecom WLAN-011"}, /* suspect - from a usenet posting. */
+	{ 0x01bf, 0x3302, NULL, "atmel_at76c502d%s.bin", "Belkin F5D6060u"},  /*    "        "  "    "      "     */
+	{ 0, 0, "BT/Voyager 1020 Laptop Adapter", "atmel_at76c502%s.bin", "BT Voyager 1020"},
+        { 0, 0, "IEEE 802.11b/Wireless LAN PC Card", "atmel_at76c502%s.bin", "Siemens Gigaset PC Card II" },
+	{ 0, 0, "CNet/CNWLC 11Mbps Wireless PC Card V-5", "atmel_at76c502e%s.bin", "CNet CNWLC-811ARL" }
 };
 
 /* This is strictly temporary, until PCMCIA devices get integrated into the device model. */
@@ -372,11 +369,11 @@
 	tuple.TupleOffset = 0;
 	
 	tuple.DesiredTuple = CISTPL_MANFID;
-	if (CardServices(GetFirstTuple, handle, &tuple) == 0) {
+	if (pcmcia_get_first_tuple(handle, &tuple) == 0) {
 		int i;
 		cistpl_manfid_t *manfid;
-		CS_CHECK(GetTupleData, handle, &tuple);
-		CS_CHECK(ParseTuple, handle, &tuple, &parse);
+		CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+		CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
 		manfid = &(parse.manfid);
 		for (i = 0; i < sizeof(card_table)/sizeof(card_table[0]); i++) {
 			if (!card_table[i].ver1 &&
@@ -389,11 +386,11 @@
 	}
 
 	tuple.DesiredTuple = CISTPL_VERS_1;
-	if (!done && (CardServices(GetFirstTuple, handle, &tuple) == 0)) {
+	if (!done && (pcmcia_get_first_tuple(handle, &tuple) == 0)) {
 		int i, j, k;
 		cistpl_vers_1_t *ver1;
-		CS_CHECK(GetTupleData, handle, &tuple);
-		CS_CHECK(ParseTuple, handle, &tuple, &parse);
+		CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+		CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
 		ver1 = &(parse.version_1);
 		
 		for (i = 0; i < sizeof(card_table)/sizeof(card_table[0]); i++) {
@@ -429,9 +426,9 @@
 	  registers.
 	*/
 	tuple.DesiredTuple = CISTPL_CONFIG;
-	CS_CHECK(GetFirstTuple, handle, &tuple);
-	CS_CHECK(GetTupleData, handle, &tuple);
-	CS_CHECK(ParseTuple, handle, &tuple, &parse);
+	CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+	CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+	CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
 	link->conf.ConfigBase = parse.config.base;
 	link->conf.Present = parse.config.rmask[0];
 	
@@ -451,12 +448,13 @@
 	  will only use the CIS to fill in implementation-defined details.
 	*/
 	tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
-	CS_CHECK(GetFirstTuple, handle, &tuple);
+	CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
 	while (1) {
 		cistpl_cftable_entry_t dflt = { 0 };
 		cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
-		CFG_CHECK(GetTupleData, handle, &tuple);
-		CFG_CHECK(ParseTuple, handle, &tuple, &parse);
+		if (pcmcia_get_tuple_data(handle, &tuple) != 0 ||
+				pcmcia_parse_tuple(handle, &tuple, &parse) != 0)
+			goto next_entry;
 		
 		if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg;
 		if (cfg->index == 0) goto next_entry;
@@ -505,12 +503,14 @@
 		}
 		
 		/* This reserves IO space but doesn't actually enable it */
-		CFG_CHECK(RequestIO, link->handle, &link->io); 
+		if (pcmcia_request_io(link->handle, &link->io) != 0)
+			goto next_entry;
+
 		/* If we got this far, we're cool! */
 		break;
 		
 	next_entry:
-		CS_CHECK(GetNextTuple, handle, &tuple);
+		CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));
 	}
 	
 	/*
@@ -519,14 +519,14 @@
 	  irq structure is initialized.
 	*/
 	if (link->conf.Attributes & CONF_ENABLE_IRQ)
-		CS_CHECK(RequestIRQ, link->handle, &link->irq);
+		CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));
 	
 	/*
 	  This actually configures the PCMCIA socket -- setting up
 	  the I/O windows and the interrupt mapping, and putting the
 	  card and host interface into "Memory and IO" mode.
 	*/
-	CS_CHECK(RequestConfiguration, link->handle, &link->conf);
+	CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));
 	
 	if (link->irq.AssignedIRQ == 0) {
 		printk(KERN_ALERT 
@@ -602,11 +602,11 @@
 	((local_info_t*)link->priv)->eth_dev = 0; 
 	
 	/* Don't bother checking to see if these succeed or not */
-	CardServices(ReleaseConfiguration, link->handle);
+	pcmcia_release_configuration(link->handle);
 	if (link->io.NumPorts1)
-		CardServices(ReleaseIO, link->handle, &link->io);
+		pcmcia_release_io(link->handle, &link->io);
 	if (link->irq.AssignedIRQ)
-		CardServices(ReleaseIRQ, link->handle, &link->irq);
+		pcmcia_release_irq(link->handle, &link->irq);
 	link->state &= ~DEV_CONFIG;
 }
 
@@ -648,7 +648,7 @@
 	case CS_EVENT_RESET_PHYSICAL:
 		if (link->state & DEV_CONFIG) {
 			netif_device_detach(local->eth_dev);
-			CardServices(ReleaseConfiguration, link->handle);
+			pcmcia_release_configuration(link->handle);
 		}
 		break;
 	case CS_EVENT_PM_RESUME:
@@ -656,7 +656,7 @@
 		/* Fall through... */
 	case CS_EVENT_CARD_RESET:
 		if (link->state & DEV_CONFIG) {
-			CardServices(RequestConfiguration, link->handle, &link->conf);
+			pcmcia_request_configuration(link->handle, &link->conf);
 			reset_atmel_card(local->eth_dev);
 			netif_device_attach(local->eth_dev);
 		}
diff -Nru a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c
--- a/drivers/net/wireless/netwave_cs.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/net/wireless/netwave_cs.c	Tue Feb  3 19:45:42 2004
@@ -513,7 +513,7 @@
     client_reg.event_handler = &netwave_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != 0) {
 	cs_error(link->handle, RegisterClient, ret);
 	netwave_detach(link);
@@ -555,7 +555,7 @@
 	
     /* Break the link with Card Services */
     if (link->handle)
-	CardServices(DeregisterClient, link->handle);
+	pcmcia_deregister_client(link->handle);
     
     /* Locate device structure */
     for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
@@ -998,8 +998,8 @@
  *
  */
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static void netwave_pcmcia_config(dev_link_t *link) {
     client_handle_t handle = link->handle;
@@ -1024,9 +1024,9 @@
     tuple.TupleDataMax = 64;
     tuple.TupleOffset = 0;
     tuple.DesiredTuple = CISTPL_CONFIG;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
-    CS_CHECK(GetTupleData, handle, &tuple);
-    CS_CHECK(ParseTuple, handle, &tuple, &parse);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+    CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
     link->conf.ConfigBase = parse.config.base;
     link->conf.Present = parse.config.rmask[0];
 
@@ -1040,7 +1040,7 @@
      */
     for (i = j = 0x0; j < 0x400; j += 0x20) {
 	link->io.BasePort1 = j ^ 0x300;
-	i = CardServices(RequestIO, link->handle, &link->io);
+	i = pcmcia_request_io(link->handle, &link->io);
 	if (i == CS_SUCCESS) break;
     }
     if (i != CS_SUCCESS) {
@@ -1052,13 +1052,13 @@
      *  Now allocate an interrupt line.  Note that this does not
      *  actually assign a handler to the interrupt.
      */
-    CS_CHECK(RequestIRQ, handle, &link->irq);
+    CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq));
 
     /*
      *  This actually configures the PCMCIA socket -- setting up
      *  the I/O windows and the interrupt mapping.
      */
-    CS_CHECK(RequestConfiguration, handle, &link->conf);
+    CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf));
 
     /*
      *  Allocate a 32K memory window.  Note that the dev_link_t
@@ -1071,10 +1071,9 @@
     req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_CM|WIN_ENABLE;
     req.Base = 0; req.Size = 0x8000;
     req.AccessSpeed = mem_speed;
-    link->win = (window_handle_t)link->handle;
-    CS_CHECK(RequestWindow, &link->win, &req);
+    CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &link->win));
     mem.CardOffset = 0x20000; mem.Page = 0; 
-    CS_CHECK(MapMemPage, link->win, &mem);
+    CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem));
 
     /* Store base address of the common window frame */
     ramBase = ioremap(req.Base, 0x8000);
@@ -1145,11 +1144,11 @@
     /* Don't bother checking to see if these succeed or not */
     if (link->win) {
 	iounmap(priv->ramBase);
-	CardServices(ReleaseWindow, link->win);
+	pcmcia_release_window(link->win);
     }
-    CardServices(ReleaseConfiguration, link->handle);
-    CardServices(ReleaseIO, link->handle, &link->io);
-    CardServices(ReleaseIRQ, link->handle, &link->irq);
+    pcmcia_release_configuration(link->handle);
+    pcmcia_release_io(link->handle, &link->io);
+    pcmcia_release_irq(link->handle, &link->irq);
 
     link->state &= ~DEV_CONFIG;
 
@@ -1201,7 +1200,7 @@
 	if (link->state & DEV_CONFIG) {
 	    if (link->open)
 		netif_device_detach(dev);
-	    CardServices(ReleaseConfiguration, link->handle);
+	    pcmcia_release_configuration(link->handle);
 	}
 	break;
     case CS_EVENT_PM_RESUME:
@@ -1209,7 +1208,7 @@
 	/* Fall through... */
     case CS_EVENT_CARD_RESET:
 	if (link->state & DEV_CONFIG) {
-	    CardServices(RequestConfiguration, link->handle, &link->conf);
+	    pcmcia_request_configuration(link->handle, &link->conf);
 	    if (link->open) {
 		netwave_reset(dev);
 		netif_device_attach(dev);
diff -Nru a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c
--- a/drivers/net/wireless/orinoco_cs.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/net/wireless/orinoco_cs.c	Tue Feb  3 19:45:42 2004
@@ -131,7 +131,7 @@
 	/* We need atomic ops here, because we're not holding the lock */
 	set_bit(0, &card->hard_reset_in_progress);
 
-	err = CardServices(ResetCard, link->handle, NULL);
+	err = pcmcia_reset_card(link->handle, NULL);
 	if (err)
 		return err;
 
@@ -150,7 +150,7 @@
 orinoco_cs_error(client_handle_t handle, int func, int ret)
 {
 	error_info_t err = { func, ret };
-	CardServices(ReportError, handle, &err);
+	pcmcia_report_error(handle, &err);
 }
 
 /*
@@ -214,7 +214,7 @@
 	client_reg.Version = 0x0210; /* FIXME: what does this mean? */
 	client_reg.event_callback_args.client_data = link;
 
-	ret = CardServices(RegisterClient, &link->handle, &client_reg);
+	ret = pcmcia_register_client(&link->handle, &client_reg);
 	if (ret != CS_SUCCESS) {
 		orinoco_cs_error(link->handle, RegisterClient, ret);
 		orinoco_cs_detach(link);
@@ -250,7 +250,7 @@
 
 	/* Break the link with Card Services */
 	if (link->handle)
-		CardServices(DeregisterClient, link->handle);
+		pcmcia_deregister_client(link->handle);
 
 	/* Unlink device structure, and free it */
 	*linkp = link->next;
@@ -269,11 +269,8 @@
  * device available to the system.
  */
 
-#define CS_CHECK(fn, args...) \
-	while ((last_ret=CardServices(last_fn=(fn),args))!=0) goto cs_failed
-
-#define CFG_CHECK(fn, args...) \
-	if (CardServices(fn, args) != 0) goto next_entry
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static void
 orinoco_cs_config(dev_link_t *link)
@@ -290,7 +287,7 @@
 	tuple_t tuple;
 	cisparse_t parse;
 
-	CS_CHECK(ValidateCIS, handle, &info);
+	CS_CHECK(ValidateCIS, pcmcia_validate_cis(handle, &info));
 
 	/*
 	 * This reads the card's CONFIG tuple to find its
@@ -301,9 +298,9 @@
 	tuple.TupleData = buf;
 	tuple.TupleDataMax = sizeof(buf);
 	tuple.TupleOffset = 0;
-	CS_CHECK(GetFirstTuple, handle, &tuple);
-	CS_CHECK(GetTupleData, handle, &tuple);
-	CS_CHECK(ParseTuple, handle, &tuple, &parse);
+	CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+	CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+	CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
 	link->conf.ConfigBase = parse.config.base;
 	link->conf.Present = parse.config.rmask[0];
 
@@ -311,7 +308,7 @@
 	link->state |= DEV_CONFIG;
 
 	/* Look up the current Vcc */
-	CS_CHECK(GetConfigurationInfo, handle, &conf);
+	CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf));
 	link->conf.Vcc = conf.Vcc;
 
 	/*
@@ -329,13 +326,14 @@
 	 * implementation-defined details.
 	 */
 	tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
-	CS_CHECK(GetFirstTuple, handle, &tuple);
+	CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
 	while (1) {
 		cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
 		cistpl_cftable_entry_t dflt = { .index = 0 };
 
-		CFG_CHECK(GetTupleData, handle, &tuple);
-		CFG_CHECK(ParseTuple, handle, &tuple, &parse);
+		if (pcmcia_get_tuple_data(handle, &tuple) != 0 ||
+				pcmcia_parse_tuple(handle, &tuple, &parse) != 0)
+			goto next_entry;
 
 		if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
 			dflt = *cfg;
@@ -400,7 +398,8 @@
 			}
 
 			/* This reserves IO space but doesn't actually enable it */
-			CFG_CHECK(RequestIO, link->handle, &link->io);
+			if (pcmcia_request_io(link->handle, &link->io) != 0)
+				goto next_entry;
 		}
 
 
@@ -410,8 +409,8 @@
 		
 	next_entry:
 		if (link->io.NumPorts1)
-			CardServices(ReleaseIO, link->handle, &link->io);
-		last_ret = CardServices(GetNextTuple, handle, &tuple);
+			pcmcia_release_io(link->handle, &link->io);
+		last_ret = pcmcia_get_next_tuple(handle, &tuple);
 		if (last_ret  == CS_NO_MORE_ITEMS) {
 			printk(KERN_ERR "GetNextTuple().  No matching CIS configuration, "
 			       "maybe you need the ignore_cis_vcc=1 parameter.\n");
@@ -438,7 +437,7 @@
   		link->irq.Handler = orinoco_interrupt; 
   		link->irq.Instance = dev; 
 		
-		CS_CHECK(RequestIRQ, link->handle, &link->irq);
+		CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));
 	}
 
 	/* We initialize the hermes structure before completing PCMCIA
@@ -452,7 +451,7 @@
 	 * the I/O windows and the interrupt mapping, and putting the
 	 * card and host interface into "Memory and IO" mode.
 	 */
-	CS_CHECK(RequestConfiguration, link->handle, &link->conf);
+	CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));
 
 	/* Ok, we have the configuration, prepare to register the netdev */
 	dev->base_addr = link->io.BasePort1;
@@ -521,11 +520,11 @@
 	spin_unlock_irqrestore(&priv->lock, flags);
 
 	/* Don't bother checking to see if these succeed or not */
-	CardServices(ReleaseConfiguration, link->handle);
+	pcmcia_release_configuration(link->handle);
 	if (link->io.NumPorts1)
-		CardServices(ReleaseIO, link->handle, &link->io);
+		pcmcia_release_io(link->handle, &link->io);
 	if (link->irq.AssignedIRQ)
-		CardServices(ReleaseIRQ, link->handle, &link->irq);
+		pcmcia_release_irq(link->handle, &link->irq);
 	link->state &= ~DEV_CONFIG;
 }				/* orinoco_cs_release */
 
@@ -587,7 +586,7 @@
 				spin_unlock_irqrestore(&priv->lock, flags);
 			}
 
-			CardServices(ReleaseConfiguration, link->handle);
+			pcmcia_release_configuration(link->handle);
 		}
 		break;
 
@@ -598,8 +597,7 @@
 		if (link->state & DEV_CONFIG) {
 			/* FIXME: should we double check that this is
 			 * the same card as we had before */
-			CardServices(RequestConfiguration, link->handle,
-				     &link->conf);
+			pcmcia_request_configuration(link->handle, &link->conf);
 
 			if (! test_bit(0, &card->hard_reset_in_progress)) {
 				err = orinoco_reinit_firmware(dev);
diff -Nru a/drivers/net/wireless/orinoco_pci.c b/drivers/net/wireless/orinoco_pci.c
--- a/drivers/net/wireless/orinoco_pci.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/net/wireless/orinoco_pci.c	Tue Feb  3 19:45:34 2004
@@ -360,6 +360,7 @@
 }
 
 static struct pci_device_id orinoco_pci_pci_id_table[] = {
+	{0x1260, 0x3872, PCI_ANY_ID, PCI_ANY_ID,},
 	{0x1260, 0x3873, PCI_ANY_ID, PCI_ANY_ID,},
 	{0,},
 };
diff -Nru a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
--- a/drivers/net/wireless/ray_cs.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/net/wireless/ray_cs.c	Tue Feb  3 19:45:17 2004
@@ -420,7 +420,7 @@
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
 
-    DEBUG(2,"ray_cs ray_attach calling CardServices(RegisterClient...)\n");
+    DEBUG(2,"ray_cs ray_attach calling pcmcia_register_client(...)\n");
 
     init_timer(&local->timer);
 
@@ -490,8 +490,8 @@
     is received, to configure the PCMCIA socket, and to make the
     ethernet device available to the system.
 =============================================================================*/
-#define CS_CHECK(fn, args...) \
-while ((last_ret=fn(args))!=0) goto cs_failed
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 #define MAX_TUPLE_SIZE 128
 static void ray_config(dev_link_t *link)
 {
@@ -510,23 +510,23 @@
 
     /* This reads the card's CONFIG tuple to find its configuration regs */
     tuple.DesiredTuple = CISTPL_CONFIG;
-    CS_CHECK(pcmcia_get_first_tuple, handle, &tuple);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
     tuple.TupleData = buf;
     tuple.TupleDataMax = MAX_TUPLE_SIZE;
     tuple.TupleOffset = 0;
-    CS_CHECK(pcmcia_get_tuple_data, handle, &tuple);
-    CS_CHECK(pcmcia_parse_tuple, handle, &tuple, &parse);
+    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+    CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
     link->conf.ConfigBase = parse.config.base;
     link->conf.Present = parse.config.rmask[0];
 
     /* Determine card type and firmware version */
     buf[0] = buf[MAX_TUPLE_SIZE - 1] = 0;
     tuple.DesiredTuple = CISTPL_VERS_1;
-    CS_CHECK(pcmcia_get_first_tuple, handle, &tuple);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
     tuple.TupleData = buf;
     tuple.TupleDataMax = MAX_TUPLE_SIZE;
     tuple.TupleOffset = 2;
-    CS_CHECK(pcmcia_get_tuple_data, handle, &tuple);
+    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
 
     for (i=0; i<tuple.TupleDataLen - 4; i++) 
         if (buf[i] == 0) buf[i] = ' ';
@@ -538,22 +538,22 @@
     /* Now allocate an interrupt line.  Note that this does not
        actually assign a handler to the interrupt.
     */
-    CS_CHECK(pcmcia_request_irq, link->handle, &link->irq);
+    CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));
     dev->irq = link->irq.AssignedIRQ;
     
     /* This actually configures the PCMCIA socket -- setting up
        the I/O windows and the interrupt mapping.
     */
-    CS_CHECK(pcmcia_request_configuration, link->handle, &link->conf);
+    CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));
 
 /*** Set up 32k window for shared memory (transmit and control) ************/
     req.Attributes = WIN_DATA_WIDTH_8 | WIN_MEMORY_TYPE_CM | WIN_ENABLE | WIN_USE_WAIT;
     req.Base = 0;
     req.Size = 0x8000;
     req.AccessSpeed = ray_mem_speed;
-    CS_CHECK(pcmcia_request_window, &link->handle, &req, &link->win);
+    CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &link->win));
     mem.CardOffset = 0x0000; mem.Page = 0;
-    CS_CHECK(pcmcia_map_mem_page, link->win, &mem);
+    CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem));
     local->sram = (UCHAR *)(ioremap(req.Base,req.Size));
 
 /*** Set up 16k window for shared memory (receive buffer) ***************/
@@ -561,9 +561,9 @@
     req.Base = 0;
     req.Size = 0x4000;
     req.AccessSpeed = ray_mem_speed;
-    CS_CHECK(pcmcia_request_window, &link->handle, &req, &local->rmem_handle);
+    CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &local->rmem_handle));
     mem.CardOffset = 0x8000; mem.Page = 0;
-    CS_CHECK(pcmcia_map_mem_page, local->rmem_handle, &mem);
+    CS_CHECK(MapMemPage, pcmcia_map_mem_page(local->rmem_handle, &mem));
     local->rmem = (UCHAR *)(ioremap(req.Base,req.Size));
 
 /*** Set up window for attribute memory ***********************************/
@@ -571,9 +571,9 @@
     req.Base = 0;
     req.Size = 0x1000;
     req.AccessSpeed = ray_mem_speed;
-    CS_CHECK(pcmcia_request_window, &link->handle, &req, &local->amem_handle);
+    CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &local->amem_handle));
     mem.CardOffset = 0x0000; mem.Page = 0;
-    CS_CHECK(pcmcia_map_mem_page, local->amem_handle, &mem);
+    CS_CHECK(MapMemPage, pcmcia_map_mem_page(local->amem_handle, &mem));
     local->amem = (UCHAR *)(ioremap(req.Base,req.Size));
 
     DEBUG(3,"ray_config sram=%p\n",local->sram);
diff -Nru a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c
--- a/drivers/net/wireless/wavelan_cs.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/net/wireless/wavelan_cs.c	Tue Feb  3 19:45:29 2004
@@ -3802,7 +3802,7 @@
   printk(KERN_DEBUG "%s: ->wv_pcmcia_reset()\n", dev->name);
 #endif
 
-  i = CardServices(AccessConfigurationRegister, link->handle, &reg);
+  i = pcmcia_access_configuration_register(link->handle, &reg);
   if(i != CS_SUCCESS)
     {
       cs_error(link->handle, AccessConfigurationRegister, i);
@@ -3816,7 +3816,7 @@
 
   reg.Action = CS_WRITE;
   reg.Value = reg.Value | COR_SW_RESET;
-  i = CardServices(AccessConfigurationRegister, link->handle, &reg);
+  i = pcmcia_access_configuration_register(link->handle, &reg);
   if(i != CS_SUCCESS)
     {
       cs_error(link->handle, AccessConfigurationRegister, i);
@@ -3825,7 +3825,7 @@
       
   reg.Action = CS_WRITE;
   reg.Value = COR_LEVEL_IRQ | COR_CONFIG;
-  i = CardServices(AccessConfigurationRegister, link->handle, &reg);
+  i = pcmcia_access_configuration_register(link->handle, &reg);
   if(i != CS_SUCCESS)
     {
       cs_error(link->handle, AccessConfigurationRegister, i);
@@ -4018,16 +4018,16 @@
     {
       tuple.Attributes = 0;
       tuple.DesiredTuple = CISTPL_CONFIG;
-      i = CardServices(GetFirstTuple, handle, &tuple);
+      i = pcmcia_get_first_tuple(handle, &tuple);
       if(i != CS_SUCCESS)
 	break;
       tuple.TupleData = (cisdata_t *)buf;
       tuple.TupleDataMax = 64;
       tuple.TupleOffset = 0;
-      i = CardServices(GetTupleData, handle, &tuple);
+      i = pcmcia_get_tuple_data(handle, &tuple);
       if(i != CS_SUCCESS)
 	break;
-      i = CardServices(ParseTuple, handle, &tuple, &parse);
+      i = pcmcia_parse_tuple(handle, &tuple, &parse);
       if(i != CS_SUCCESS)
 	break;
       link->conf.ConfigBase = parse.config.base;
@@ -4045,7 +4045,7 @@
   link->state |= DEV_CONFIG;
   do
     {
-      i = CardServices(RequestIO, link->handle, &link->io);
+      i = pcmcia_request_io(link->handle, &link->io);
       if(i != CS_SUCCESS)
 	{
 	  cs_error(link->handle, RequestIO, i);
@@ -4056,7 +4056,7 @@
        * Now allocate an interrupt line.  Note that this does not
        * actually assign a handler to the interrupt.
        */
-      i = CardServices(RequestIRQ, link->handle, &link->irq);
+      i = pcmcia_request_irq(link->handle, &link->irq);
       if(i != CS_SUCCESS)
 	{
 	  cs_error(link->handle, RequestIRQ, i);
@@ -4068,7 +4068,7 @@
        * the I/O windows and the interrupt mapping.
        */
       link->conf.ConfigIndex = 1;
-      i = CardServices(RequestConfiguration, link->handle, &link->conf);
+      i = pcmcia_request_configuration(link->handle, &link->conf);
       if(i != CS_SUCCESS)
 	{
 	  cs_error(link->handle, RequestConfiguration, i);
@@ -4084,8 +4084,7 @@
       req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
       req.Base = req.Size = 0;
       req.AccessSpeed = mem_speed;
-      link->win = (window_handle_t)link->handle;
-      i = CardServices(RequestWindow, &link->win, &req);
+      i = pcmcia_request_window(&link->handle, &req, &link->win);
       if(i != CS_SUCCESS)
 	{
 	  cs_error(link->handle, RequestWindow, i);
@@ -4096,7 +4095,7 @@
       dev->mem_end = dev->mem_start + req.Size;
 
       mem.CardOffset = 0; mem.Page = 0;
-      i = CardServices(MapMemPage, link->win, &mem);
+      i = pcmcia_map_mem_page(link->win, &mem);
       if(i != CS_SUCCESS)
 	{
 	  cs_error(link->handle, MapMemPage, i);
@@ -4170,10 +4169,10 @@
 
   /* Don't bother checking to see if these succeed or not */
   iounmap((u_char *)dev->mem_start);
-  CardServices(ReleaseWindow, link->win);
-  CardServices(ReleaseConfiguration, link->handle);
-  CardServices(ReleaseIO, link->handle, &link->io);
-  CardServices(ReleaseIRQ, link->handle, &link->irq);
+  pcmcia_release_window(link->win);
+  pcmcia_release_configuration(link->handle);
+  pcmcia_release_io(link->handle, &link->io);
+  pcmcia_release_irq(link->handle, &link->irq);
 
   link->state &= ~DEV_CONFIG;
 
@@ -4772,10 +4771,10 @@
   client_reg.event_callback_args.client_data = link;
 
 #ifdef DEBUG_CONFIG_INFO
-  printk(KERN_DEBUG "wavelan_attach(): almost done, calling CardServices\n");
+  printk(KERN_DEBUG "wavelan_attach(): almost done, calling pcmcia_register_client\n");
 #endif
 
-  ret = CardServices(RegisterClient, &link->handle, &client_reg);
+  ret = pcmcia_register_client(&link->handle, &client_reg);
   if(ret != 0)
     {
       cs_error(link->handle, RegisterClient, ret);
@@ -4826,7 +4825,7 @@
 
   /* Break the link with Card Services */
   if(link->handle)
-    CardServices(DeregisterClient, link->handle);
+    pcmcia_deregister_client(link->handle);
     
   /* Remove the interface data from the linked list */
   if(dev_list == link)
@@ -4955,7 +4954,7 @@
 	  {
       	    if(link->open)
 	      netif_device_detach(dev);
-      	    CardServices(ReleaseConfiguration, link->handle);
+      	    pcmcia_release_configuration(link->handle);
 	  }
 	break;
 
@@ -4965,7 +4964,7 @@
       case CS_EVENT_CARD_RESET:
 	if(link->state & DEV_CONFIG)
 	  {
-      	    CardServices(RequestConfiguration, link->handle, &link->conf);
+      	    pcmcia_request_configuration(link->handle, &link->conf);
       	    if(link->open)	/* If RESET -> True, If RESUME -> False ? */
 	      {
 		wv_hw_reset(dev);
diff -Nru a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
--- a/drivers/net/wireless/wl3501_cs.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/net/wireless/wl3501_cs.c	Tue Feb  3 19:45:16 2004
@@ -1586,7 +1586,7 @@
 
 	/* Break the link with Card Services */
 	if (link->handle)
-		CardServices(DeregisterClient, link->handle);
+		pcmcia_deregister_client(link->handle);
 
 	/* Unlink device structure, free pieces */
 	*linkp = link->next;
@@ -2083,7 +2083,7 @@
 	client_reg.event_handler = wl3501_event;
 	client_reg.Version	 = 0x0210;
 	client_reg.event_callback_args.client_data = link;
-	ret = CardServices(RegisterClient, &link->handle, &client_reg);
+	ret = pcmcia_register_client(&link->handle, &client_reg);
 	if (ret) {
 		cs_error(link->handle, RegisterClient, ret);
 		wl3501_detach(link);
@@ -2097,8 +2097,8 @@
 	goto out;
 }
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret = CardServices(last_fn = (fn), args)) != 0) goto cs_failed
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 /**
  * wl3501_config - configure the PCMCIA socket and make eth device available
@@ -2121,12 +2121,12 @@
 	/* This reads the card's CONFIG tuple to find its config registers. */
 	tuple.Attributes	= 0;
 	tuple.DesiredTuple	= CISTPL_CONFIG;
-	CS_CHECK(GetFirstTuple, handle, &tuple);
+	CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
 	tuple.TupleData		= bf;
 	tuple.TupleDataMax	= sizeof(bf);
 	tuple.TupleOffset	= 0;
-	CS_CHECK(GetTupleData, handle, &tuple);
-	CS_CHECK(ParseTuple, handle, &tuple, &parse);
+	CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+	CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
 	link->conf.ConfigBase	= parse.config.base;
 	link->conf.Present	= parse.config.rmask[0];
 
@@ -2142,7 +2142,7 @@
 		 * 0x200-0x2ff, and so on, because this seems safer */
 		link->io.BasePort1 = j;
 		link->io.BasePort2 = link->io.BasePort1 + 0x10;
-		i = CardServices(RequestIO, link->handle, &link->io);
+		i = pcmcia_request_io(link->handle, &link->io);
 		if (i == CS_SUCCESS)
 			break;
 	}
@@ -2154,12 +2154,12 @@
 	/* Now allocate an interrupt line. Note that this does not actually
 	 * assign a handler to the interrupt. */
 
-	CS_CHECK(RequestIRQ, link->handle, &link->irq);
+	CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));
 
 	/* This actually configures the PCMCIA socket -- setting up the I/O
 	 * windows and the interrupt mapping.  */
 
-	CS_CHECK(RequestConfiguration, link->handle, &link->conf);
+	CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));
 
 	dev->irq = link->irq.AssignedIRQ;
 	dev->base_addr = link->io.BasePort1;
@@ -2249,9 +2249,9 @@
 	}
 
 	/* Don't bother checking to see if these succeed or not */
-	CardServices(ReleaseConfiguration, link->handle);
-	CardServices(ReleaseIO, link->handle, &link->io);
-	CardServices(ReleaseIRQ, link->handle, &link->irq);
+	pcmcia_release_configuration(link->handle);
+	pcmcia_release_io(link->handle, &link->io);
+	pcmcia_release_irq(link->handle, &link->irq);
 	link->state &= ~DEV_CONFIG;
 
 	if (link->state & DEV_STALE_CONFIG)
@@ -2301,7 +2301,7 @@
 		if (link->state & DEV_CONFIG) {
 			if (link->open)
 				netif_device_detach(dev);
-			CardServices(ReleaseConfiguration, link->handle);
+			pcmcia_release_configuration(link->handle);
 		}
 		break;
 	case CS_EVENT_PM_RESUME:
@@ -2310,8 +2310,7 @@
 		/* Fall through... */
 	case CS_EVENT_CARD_RESET:
 		if (link->state & DEV_CONFIG) {
-			CardServices(RequestConfiguration, link->handle,
-				     &link->conf);
+			pcmcia_request_configuration(link->handle, &link->conf);
 			if (link->open) {
 				wl3501_reset(dev);
 				netif_device_attach(dev);
diff -Nru a/drivers/oprofile/oprofile_stats.c b/drivers/oprofile/oprofile_stats.c
--- a/drivers/oprofile/oprofile_stats.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/oprofile/oprofile_stats.c	Tue Feb  3 19:45:34 2004
@@ -9,6 +9,7 @@
 
 #include <linux/oprofile.h>
 #include <linux/smp.h>
+#include <linux/cpumask.h>
 #include <linux/threads.h>
  
 #include "oprofile_stats.h"
diff -Nru a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c
--- a/drivers/parport/parport_cs.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/parport/parport_cs.c	Tue Feb  3 19:45:43 2004
@@ -151,7 +151,7 @@
     client_reg.event_handler = &parport_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != CS_SUCCESS) {
 	cs_error(link->handle, RegisterClient, ret);
 	parport_detach(link);
@@ -187,7 +187,7 @@
 	parport_cs_release(link);
     
     if (link->handle) {
-	ret = CardServices(DeregisterClient, link->handle);
+	ret = pcmcia_deregister_client(link->handle);
 	if (ret != CS_SUCCESS)
 	    cs_error(link->handle, DeregisterClient, ret);
     }
@@ -206,11 +206,8 @@
 
 ======================================================================*/
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
-
-#define CFG_CHECK(fn, args...) \
-if (CardServices(fn, args) != 0) goto next_entry
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 void parport_config(dev_link_t *link)
 {
@@ -231,9 +228,9 @@
     tuple.TupleOffset = 0; tuple.TupleDataMax = 255;
     tuple.Attributes = 0;
     tuple.DesiredTuple = CISTPL_CONFIG;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
-    CS_CHECK(GetTupleData, handle, &tuple);
-    CS_CHECK(ParseTuple, handle, &tuple, &parse);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+    CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
     link->conf.ConfigBase = parse.config.base;
     link->conf.Present = parse.config.rmask[0];
     
@@ -241,14 +238,15 @@
     link->state |= DEV_CONFIG;
 
     /* Not sure if this is right... look up the current Vcc */
-    CS_CHECK(GetConfigurationInfo, handle, &conf);
+    CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf));
     
     tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
     tuple.Attributes = 0;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
     while (1) {
-	CFG_CHECK(GetTupleData, handle, &tuple);
-	CFG_CHECK(ParseTuple, handle, &tuple, &parse);
+	if (pcmcia_get_tuple_data(handle, &tuple) != 0 ||
+		pcmcia_parse_tuple(handle, &tuple, &parse) != 0)
+	    goto next_entry;
 
 	if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
 	    cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
@@ -262,18 +260,19 @@
 		link->io.BasePort2 = io->win[1].base;
 		link->io.NumPorts2 = io->win[1].len;
 	    }
-	    CFG_CHECK(RequestIO, link->handle, &link->io);
+	    if (pcmcia_request_io(link->handle, &link->io) != 0)
+		goto next_entry;
 	    /* If we've got this far, we're done */
 	    break;
 	}
 	
     next_entry:
 	if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg;
-	CS_CHECK(GetNextTuple, handle, &tuple);
+	CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));
     }
     
-    CS_CHECK(RequestIRQ, handle, &link->irq);
-    CS_CHECK(RequestConfiguration, handle, &link->conf);
+    CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq));
+    CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf));
 
     release_region(link->io.BasePort1, link->io.NumPorts1);
     if (link->io.NumPorts2)
@@ -335,9 +334,9 @@
     info->ndev = 0;
     link->dev = NULL;
     
-    CardServices(ReleaseConfiguration, link->handle);
-    CardServices(ReleaseIO, link->handle, &link->io);
-    CardServices(ReleaseIRQ, link->handle, &link->irq);
+    pcmcia_release_configuration(link->handle);
+    pcmcia_release_io(link->handle, &link->io);
+    pcmcia_release_irq(link->handle, &link->irq);
     
     link->state &= ~DEV_CONFIG;
 
@@ -372,14 +371,14 @@
 	/* Fall through... */
     case CS_EVENT_RESET_PHYSICAL:
 	if (link->state & DEV_CONFIG)
-	    CardServices(ReleaseConfiguration, link->handle);
+	    pcmcia_release_configuration(link->handle);
 	break;
     case CS_EVENT_PM_RESUME:
 	link->state &= ~DEV_SUSPEND;
 	/* Fall through... */
     case CS_EVENT_CARD_RESET:
 	if (DEV_OK(link))
-	    CardServices(RequestConfiguration, link->handle, &link->conf);
+	    pcmcia_request_configuration(link->handle, &link->conf);
 	break;
     }
     return 0;
diff -Nru a/drivers/pci/bus.c b/drivers/pci/bus.c
--- a/drivers/pci/bus.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/pci/bus.c	Tue Feb  3 19:45:42 2004
@@ -116,6 +116,8 @@
 			list_add_tail(&dev->subordinate->node, &dev->bus->children);
 			spin_unlock(&pci_bus_lock);
 			pci_bus_add_devices(dev->subordinate);
+
+			sysfs_create_link(&dev->subordinate->class_dev.kobj, &dev->dev.kobj, "bridge");
 		}
 	}
 }
diff -Nru a/drivers/pci/gen-devlist.c b/drivers/pci/gen-devlist.c
--- a/drivers/pci/gen-devlist.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/pci/gen-devlist.c	Tue Feb  3 19:45:18 2004
@@ -7,12 +7,13 @@
 #include <stdio.h>
 #include <string.h>
 
-#define MAX_NAME_SIZE 79
+#define MAX_NAME_SIZE 89
 
 static void
-pq(FILE *f, const char *c)
+pq(FILE *f, const char *c, int len)
 {
-	while (*c) {
+	int i = 1;
+	while (*c && i != len) {
 		if (*c == '"')
 			fprintf(f, "\\\"");
 		else {
@@ -23,6 +24,7 @@
 			}
 		}
 		c++;
+		i++;
 	}
 }
 
@@ -72,13 +74,13 @@
 						if (bra && bra > c && bra[-1] == ' ')
 							bra[-1] = 0;
 						if (vendor_len + strlen(c) + 1 > MAX_NAME_SIZE) {
-							fprintf(stderr, "Line %d: Device name too long\n", lino);
+							fprintf(stderr, "Line %d: Device name too long. Name truncated.\n", lino);
 							fprintf(stderr, "%s\n", c);
-							return 1;
+							/*return 1;*/
 						}
 					}
 					fprintf(devf, "\tDEVICE(%s,%s,\"", vend, line+1);
-					pq(devf, c);
+					pq(devf, c, MAX_NAME_SIZE - vendor_len - 1);
 					fputs("\")\n", devf);
 				} else goto err;
 				break;
@@ -107,7 +109,7 @@
 				return 1;
 			}
 			fprintf(devf, "VENDOR(%s,\"", vend);
-			pq(devf, c);
+			pq(devf, c, 0);
 			fputs("\")\n", devf);
 			mode = 1;
 		} else {
diff -Nru a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h
--- a/drivers/pci/hotplug/acpiphp.h	Tue Feb  3 19:45:43 2004
+++ b/drivers/pci/hotplug/acpiphp.h	Tue Feb  3 19:45:43 2004
@@ -201,7 +201,7 @@
 
 #define SLOT_POWEREDON		(0x00000001)
 #define SLOT_ENABLED		(0x00000002)
-#define SLOT_MULTIFUNCTION	(x000000004)
+#define SLOT_MULTIFUNCTION	(0x00000004)
 
 /* function flags */
 
@@ -212,8 +212,6 @@
 #define FUNC_HAS_PS2		(0x00000040)
 #define FUNC_HAS_PS3		(0x00000080)
 
-#define FUNC_EXISTS		(0x10000000) /* to make sure we call _EJ0 only for existing funcs */
-
 /* function prototypes */
 
 /* acpiphp_glue.c */
@@ -231,6 +229,7 @@
 extern u8 acpiphp_get_attention_status (struct acpiphp_slot *slot);
 extern u8 acpiphp_get_latch_status (struct acpiphp_slot *slot);
 extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot);
+extern u32 acpiphp_get_address (struct acpiphp_slot *slot);
 
 /* acpiphp_pci.c */
 extern struct pci_dev *acpiphp_allocate_pcidev (struct pci_bus *pbus, int dev, int fn);
diff -Nru a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c
--- a/drivers/pci/hotplug/acpiphp_core.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/pci/hotplug/acpiphp_core.c	Tue Feb  3 19:45:30 2004
@@ -30,14 +30,14 @@
  *
  */
 
-#include <linux/config.h>
-#include <linux/kernel.h>
+#include <linux/init.h>
 #include <linux/module.h>
+
+#include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
-#include <linux/init.h>
 #include "pci_hotplug.h"
 #include "acpiphp.h"
 
@@ -71,6 +71,7 @@
 static int hardware_test	(struct hotplug_slot *slot, u32 value);
 static int get_power_status	(struct hotplug_slot *slot, u8 *value);
 static int get_attention_status	(struct hotplug_slot *slot, u8 *value);
+static int get_address		(struct hotplug_slot *slot, u32 *value);
 static int get_latch_status	(struct hotplug_slot *slot, u8 *value);
 static int get_adapter_status	(struct hotplug_slot *slot, u8 *value);
 static int get_max_bus_speed	(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value);
@@ -86,6 +87,7 @@
 	.get_attention_status	= get_attention_status,
 	.get_latch_status	= get_latch_status,
 	.get_adapter_status	= get_adapter_status,
+	.get_address		= get_address,
 	.get_max_bus_speed	= get_max_bus_speed,
 	.get_cur_bus_speed	= get_cur_bus_speed,
 };
@@ -317,6 +319,28 @@
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	*value = acpiphp_get_adapter_status(slot->acpi_slot);
+
+	return retval;
+}
+
+
+/**
+ * get_address - get pci address of a slot
+ * @hotplug_slot: slot to get status
+ * @busdev: pointer to struct pci_busdev (seg, bus, dev)
+ *
+ */
+static int get_address (struct hotplug_slot *hotplug_slot, u32 *value)
+{
+	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+	int retval = 0;
+
+	if (slot == NULL)
+		return -ENODEV;
+
+	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+
+	*value = acpiphp_get_address(slot->acpi_slot);
 
 	return retval;
 }
diff -Nru a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
--- a/drivers/pci/hotplug/acpiphp_glue.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/pci/hotplug/acpiphp_glue.c	Tue Feb  3 19:45:17 2004
@@ -26,12 +26,12 @@
  *
  */
 
-#include <linux/config.h>
-#include <linux/kernel.h>
+#include <linux/init.h>
 #include <linux/module.h>
+
+#include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/smp_lock.h>
-#include <linux/init.h>
 #include <asm/semaphore.h>
 
 #include "../pci.h"
@@ -245,7 +245,9 @@
 	acpi_resource_to_address64(resource, &address);
 
 	if (address.producer_consumer == ACPI_PRODUCER && address.address_length > 0) {
-		dbg("resource type: %d: 0x%llx - 0x%llx\n", address.resource_type, address.min_address_range, address.max_address_range);
+		dbg("resource type: %d: 0x%llx - 0x%llx\n", address.resource_type,
+		    (unsigned long long)address.min_address_range,
+		    (unsigned long long)address.max_address_range);
 		res = acpiphp_make_resource(address.min_address_range,
 				    address.address_length);
 		if (!res) {
@@ -684,7 +686,7 @@
 	struct list_head *l;
 	int retval = 0;
 
-	/* is this already enabled? */
+	/* if already enabled, just skip */
 	if (slot->flags & SLOT_POWEREDON)
 		goto err_exit;
 
@@ -722,14 +724,14 @@
 
 	int retval = 0;
 
-	/* is this already enabled? */
+	/* if already disabled, just skip */
 	if ((slot->flags & SLOT_POWEREDON) == 0)
 		goto err_exit;
 
 	list_for_each (l, &slot->funcs) {
 		func = list_entry(l, struct acpiphp_func, sibling);
 
-		if (func->flags & (FUNC_HAS_PS3 | FUNC_EXISTS)) {
+		if (func->pci_dev && (func->flags & FUNC_HAS_PS3)) {
 			status = acpi_evaluate_object(func->handle, "_PS3", NULL, NULL);
 			if (ACPI_FAILURE(status)) {
 				warn("%s: _PS3 failed\n", __FUNCTION__);
@@ -743,7 +745,7 @@
 		func = list_entry(l, struct acpiphp_func, sibling);
 
 		/* We don't want to call _EJ0 on non-existing functions. */
-		if (func->flags & (FUNC_HAS_EJ0 | FUNC_EXISTS)) {
+		if (func->pci_dev && (func->flags & FUNC_HAS_EJ0)) {
 			/* _EJ0 method take one argument */
 			arg_list.count = 1;
 			arg_list.pointer = &arg;
@@ -756,7 +758,6 @@
 				retval = -1;
 				goto err_exit;
 			}
-			func->flags &= (~FUNC_EXISTS);
 		}
 	}
 
@@ -836,8 +837,6 @@
 		retval = acpiphp_configure_function(func);
 		if (retval)
 			goto err_exit;
-
-		func->flags |= FUNC_EXISTS;
 	}
 
 	slot->flags |= SLOT_ENABLED;
@@ -974,6 +973,21 @@
 		dbg("%s: Device eject notify on %s\n", __FUNCTION__, objname);
 		break;
 
+	case ACPI_NOTIFY_FREQUENCY_MISMATCH:
+		printk(KERN_ERR "Device %s cannot be configured due"
+				" to a frequency mismatch\n", objname);
+		break;
+
+	case ACPI_NOTIFY_BUS_MODE_MISMATCH:
+		printk(KERN_ERR "Device %s cannot be configured due"
+				" to a bus mode mismatch\n", objname);
+		break;
+
+	case ACPI_NOTIFY_POWER_FAULT:
+		printk(KERN_ERR "Device %s has suffered a power fault\n",
+				objname);
+		break;
+
 	default:
 		warn("notify_handler: unknown event type 0x%x for %s\n", type, objname);
 		break;
@@ -1331,4 +1345,19 @@
 	sta = get_slot_status(slot);
 
 	return (sta == 0) ? 0 : 1;
+}
+
+
+/*
+ * pci address (seg/bus/dev)
+ */
+u32 acpiphp_get_address (struct acpiphp_slot *slot)
+{
+	u32 address;
+
+	address = ((slot->bridge->seg) << 16) |
+		  ((slot->bridge->bus) << 8) |
+		  slot->device;
+
+	return address;
 }
diff -Nru a/drivers/pci/hotplug/acpiphp_pci.c b/drivers/pci/hotplug/acpiphp_pci.c
--- a/drivers/pci/hotplug/acpiphp_pci.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/pci/hotplug/acpiphp_pci.c	Tue Feb  3 19:45:16 2004
@@ -29,11 +29,11 @@
  *
  */
 
-#include <linux/config.h>
-#include <linux/kernel.h>
+#include <linux/init.h>
 #include <linux/module.h>
+
+#include <linux/kernel.h>
 #include <linux/pci.h>
-#include <linux/init.h>
 #include <linux/acpi.h>
 #include "../pci.h"
 #include "pci_hotplug.h"
diff -Nru a/drivers/pci/hotplug/acpiphp_res.c b/drivers/pci/hotplug/acpiphp_res.c
--- a/drivers/pci/hotplug/acpiphp_res.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/pci/hotplug/acpiphp_res.c	Tue Feb  3 19:45:17 2004
@@ -29,7 +29,7 @@
  *
  */
 
-#include <linux/config.h>
+#include <linux/init.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
@@ -39,7 +39,6 @@
 #include <linux/pci.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
-#include <linux/init.h>
 
 #include <linux/string.h>
 #include <linux/mm.h>
diff -Nru a/drivers/pci/hotplug/cpcihp_zt5550.c b/drivers/pci/hotplug/cpcihp_zt5550.c
--- a/drivers/pci/hotplug/cpcihp_zt5550.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/pci/hotplug/cpcihp_zt5550.c	Tue Feb  3 19:45:30 2004
@@ -133,6 +133,8 @@
 {
 	if(!hc_dev)
 		return -ENODEV;
+
+	iounmap(hc_registers);
 	release_mem_region(pci_resource_start(hc_dev, 1),
 			   pci_resource_len(hc_dev, 1));
 	return 0;
diff -Nru a/drivers/pci/hotplug/pci_hotplug.h b/drivers/pci/hotplug/pci_hotplug.h
--- a/drivers/pci/hotplug/pci_hotplug.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/pci/hotplug/pci_hotplug.h	Tue Feb  3 19:45:17 2004
@@ -74,6 +74,9 @@
  * @get_adapter_status: Called to get see if an adapter is present in the slot or not.
  *	If this field is NULL, the value passed in the struct hotplug_slot_info
  *	will be used when this value is requested by a user.
+ * @get_address: Called to get pci address of a slot.
+ *	If this field is NULL, the value passed in the struct hotplug_slot_info
+ *	will be used when this value is requested by a user.
  * @get_max_bus_speed: Called to get the max bus speed for a slot.
  *	If this field is NULL, the value passed in the struct hotplug_slot_info
  *	will be used when this value is requested by a user.
@@ -96,6 +99,7 @@
 	int (*get_attention_status)	(struct hotplug_slot *slot, u8 *value);
 	int (*get_latch_status)		(struct hotplug_slot *slot, u8 *value);
 	int (*get_adapter_status)	(struct hotplug_slot *slot, u8 *value);
+	int (*get_address)		(struct hotplug_slot *slot, u32 *value);
 	int (*get_max_bus_speed)	(struct hotplug_slot *slot, enum pci_bus_speed *value);
 	int (*get_cur_bus_speed)	(struct hotplug_slot *slot, enum pci_bus_speed *value);
 };
@@ -106,6 +110,7 @@
  * @attention_status: if the attention light is enabled or not (1/0)
  * @latch_status: if the latch (if any) is open or closed (1/0)
  * @adapter_present: if there is a pci board present in the slot or not (1/0)
+ * @address: (domain << 16 | bus << 8 | dev)
  *
  * Used to notify the hotplug pci core of the status of a specific slot.
  */
@@ -114,6 +119,7 @@
 	u8	attention_status;
 	u8	latch_status;
 	u8	adapter_status;
+	u32	address;
 	enum pci_bus_speed	max_bus_speed;
 	enum pci_bus_speed	cur_bus_speed;
 };
diff -Nru a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
--- a/drivers/pci/hotplug/pci_hotplug_core.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/pci/hotplug/pci_hotplug_core.c	Tue Feb  3 19:45:41 2004
@@ -159,6 +159,7 @@
 GET_STATUS(attention_status, u8)
 GET_STATUS(latch_status, u8)
 GET_STATUS(adapter_status, u8)
+GET_STATUS(address, u32)
 GET_STATUS(max_bus_speed, enum pci_bus_speed)
 GET_STATUS(cur_bus_speed, enum pci_bus_speed)
 
@@ -302,6 +303,28 @@
 	.show = presence_read_file,
 };
 
+static ssize_t address_read_file (struct hotplug_slot *slot, char *buf)
+{
+	int retval;
+	u32 address;
+
+	retval = get_address (slot, &address);
+	if (retval)
+		goto exit;
+	retval = sprintf (buf, "%04x:%02x:%02x\n",
+			  (address >> 16) & 0xffff,
+			  (address >> 8) & 0xff,
+			  address & 0xff);
+
+exit:
+	return retval;
+}
+
+static struct hotplug_slot_attribute hotplug_slot_attr_address = {
+	.attr = {.name = "address", .mode = S_IFREG | S_IRUGO},
+	.show = address_read_file,
+};
+
 static char *unknown_speed = "Unknown bus speed";
 
 static ssize_t max_bus_speed_read_file (struct hotplug_slot *slot, char *buf)
@@ -425,6 +448,15 @@
 	return -ENOENT;
 }
 
+static int has_address_file (struct hotplug_slot *slot)
+{
+	if ((!slot) || (!slot->ops))
+		return -ENODEV;
+	if (slot->ops->get_address)
+		return 0;
+	return -ENOENT;
+}
+
 static int has_max_bus_speed_file (struct hotplug_slot *slot)
 {
 	if ((!slot) || (!slot->ops))
@@ -466,6 +498,9 @@
 	if (has_adapter_file(slot) == 0)
 		sysfs_create_file(&slot->kobj, &hotplug_slot_attr_presence.attr);
 
+	if (has_address_file(slot) == 0)
+		sysfs_create_file(&slot->kobj, &hotplug_slot_attr_address.attr);
+
 	if (has_max_bus_speed_file(slot) == 0)
 		sysfs_create_file(&slot->kobj, &hotplug_slot_attr_max_bus_speed.attr);
 
@@ -492,6 +527,9 @@
 	if (has_adapter_file(slot) == 0)
 		sysfs_remove_file(&slot->kobj, &hotplug_slot_attr_presence.attr);
 
+	if (has_address_file(slot) == 0)
+		sysfs_remove_file(&slot->kobj, &hotplug_slot_attr_address.attr);
+
 	if (has_max_bus_speed_file(slot) == 0)
 		sysfs_remove_file(&slot->kobj, &hotplug_slot_attr_max_bus_speed.attr);
 
@@ -533,7 +571,7 @@
 	if ((slot->info == NULL) || (slot->ops == NULL))
 		return -EINVAL;
 
-	strlcpy(slot->kobj.name, slot->name, KOBJ_NAME_LEN);
+	kobject_set_name(&slot->kobj, slot->name);
 	kobj_set_kset_s(slot, pci_hotplug_slots_subsys);
 
 	/* this can fail if we have already registered a slot with the same name */
@@ -611,6 +649,10 @@
 	if ((has_adapter_file(slot) == 0) &&
 	    (slot->info->adapter_status != info->adapter_status))
 		sysfs_update_file(&slot->kobj, &hotplug_slot_attr_presence.attr);
+
+	if ((has_address_file(slot) == 0) &&
+	    (slot->info->address != info->address))
+		sysfs_update_file(&slot->kobj, &hotplug_slot_attr_address.attr);
 
 	if ((has_max_bus_speed_file(slot) == 0) &&
 	    (slot->info->max_bus_speed != info->max_bus_speed))
diff -Nru a/drivers/pci/hotplug/pcihp_skeleton.c b/drivers/pci/hotplug/pcihp_skeleton.c
--- a/drivers/pci/hotplug/pcihp_skeleton.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/pci/hotplug/pcihp_skeleton.c	Tue Feb  3 19:45:28 2004
@@ -370,10 +370,10 @@
 		 * Initilize the slot info structure with some known
 		 * good values.
 		 */
-		info->power_status = get_skel_power_status(slot);
-		info->attention_status = get_skel_attention_status(slot);
-		info->latch_status = get_skel_latch_status(slot);
-		info->adapter_status = get_skel_adapter_status(slot);
+		info->power_status = get_power_status(slot);
+		info->attention_status = get_attention_status(slot);
+		info->latch_status = get_latch_status(slot);
+		info->adapter_status = get_adapter_status(slot);
 		
 		dbg ("registering slot %d\n", i);
 		retval = pci_hp_register (slot->hotplug_slot);
diff -Nru a/drivers/pci/names.c b/drivers/pci/names.c
--- a/drivers/pci/names.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/pci/names.c	Tue Feb  3 19:45:16 2004
@@ -86,8 +86,7 @@
 
 		/* Full match */
 		match_device: {
-			char *n = name + sprintf(name, "%." PCI_NAME_HALF
-					"s %." PCI_NAME_HALF "s",
+			char *n = name + sprintf(name, "%s %s",
 					vendor_p->name, device_p->name);
 			int nr = device_p->seen + 1;
 			device_p->seen = nr;
diff -Nru a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
--- a/drivers/pci/pci-sysfs.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/pci/pci-sysfs.c	Tue Feb  3 19:45:28 2004
@@ -160,6 +160,7 @@
 	.attr =	{
 		.name = "config",
 		.mode = S_IRUGO | S_IWUSR,
+		.owner = THIS_MODULE,
 	},
 	.size = 256,
 	.read = pci_read_config,
diff -Nru a/drivers/pci/pci.ids b/drivers/pci/pci.ids
--- a/drivers/pci/pci.ids	Tue Feb  3 19:45:28 2004
+++ b/drivers/pci/pci.ids	Tue Feb  3 19:45:28 2004
@@ -7,7 +7,7 @@
 #	so if you have anything to contribute, please visit the home page or
 #	send a diff -u against the most recent pci.ids to pci-ids@ucw.cz.
 #
-#	$Id: pci.ids,v 1.48 2002/12/26 13:03:41 mares Exp $
+#	Daily snapshot on Wed 2004-01-14 11:00:17
 #
 
 # Vendors, devices and subsystems. Please keep sorted.
@@ -118,6 +118,8 @@
 		0e11 7004  Embedded Ultra Wide SCSI Controller
 		1092 8760  FirePort 40 Dual SCSI Controller
 		1de1 3904  DC390F Ultra Wide SCSI Controller
+		4c53 1000  CC7/CR7/CP7/VC7/VP7/VR7 mainboard
+		4c53 1050  CT7 mainboard
 	0010  53c895
 		0e11 4040  Integrated Array Controller
 		0e11 4048  Integrated Array Controller
@@ -126,7 +128,10 @@
 	0020  53c1010 Ultra3 SCSI Adapter
 		1de1 1020  DC-390U3W
 	0021  53c1010 66MHz  Ultra3 SCSI Adapter
-	0030  53c1030
+		4c53 1080  CT8 mainboard
+		4c53 1300  P017 mezzanine (32-bit PMC)
+		4c53 1310  P017 mezzanine (64-bit PMC)
+	0030  53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI
 		1028 1010  LSI U320 SCSI Controller
 	0040  53c1035
 	008f  53c875J
@@ -161,10 +166,17 @@
 	0017  PROTO-3 PCI Prototyping board
 	9100  INI-9100/9100W SCSI Host
 1002  ATI Technologies Inc
+	4136  Radeon IGP 320 M
+	4144  Radeon R300 AD [Radeon 9500 Pro]
+	4145  Radeon R300 AE [Radeon 9500 Pro]
+	4146  Radeon R300 AF [Radeon 9500 Pro]
+	4147  Radeon R300 AG [FireGL Z1/X1]
 	4158  68800AX [Mach32]
+	4164  Radeon R300 Secondary (DVI) output
 	4242  Radeon R200 BB [Radeon All in Wonder 8500DV]
 		1002 02aa  Radeon 8500 AIW DV Edition
 	4336  Radeon Mobility U1
+	4337  Radeon IGP 340M
 	4354  215CT [Mach64 CT]
 	4358  210888CX [Mach64 CX]
 	4554  210888ET [Mach64 ET]
@@ -214,6 +226,8 @@
 	4752  Rage XL
 		1002 0008  Rage XL
 		1002 4752  Rage XL
+		1002 8008  Rage XL
+		1028 00ce  PowerEdge 1400
 		1028 00d1  PowerEdge 2550
 	4753  Rage XC
 		1002 4753  Rage XC
@@ -238,6 +252,8 @@
 		10f1 0002  R250 If [Tachyon G9000 PRO]
 		148c 2039  R250 If [Radeon 9000 Pro "Evil Commando"]
 		1509 9a00  R250 If [Radeon 9000 "AT009"]
+# New subdevice - 3D Prophet 9000 PCI by Hercules.  AGP version probably would have same ID, so not specified.
+		1681 0040  R250 If [3D prophet 9000]
 		174b 7176  R250 If [Sapphire Radeon 9000 Pro]
 		174b 7192  R250 If [Radeon 9000 "Atlantis"]
 		17af 2005  R250 If [Excalibur Radeon 9000 Pro]
@@ -255,6 +271,7 @@
 	4c44  3D Rage LT Pro AGP-66
 	4c45  Rage Mobility M3 AGP
 	4c46  Rage Mobility M3 AGP 2x
+		1028 00b1  Latitude C600
 	4c47  3D Rage LT-G 215LG
 	4c49  3D Rage LT Pro
 		1002 0004  Rage LT Pro
@@ -262,8 +279,11 @@
 		1002 0044  Rage LT Pro
 		1002 4c49  Rage LT Pro
 	4c4d  Rage Mobility P/M AGP 2x
+		0e11 b111  Armada M700
+		0e11 b160  Armada E500
 		1002 0084  Xpert 98 AGP 2X (Mobility)
 		1014 0154  ThinkPad A20m
+		1028 00aa  Latitude CPt
 	4c4e  Rage Mobility L AGP 2x
 	4c50  3D Rage LT Pro
 		1002 4c50  Rage LT Pro
@@ -274,23 +294,33 @@
 	4c57  Radeon Mobility M7 LW [Radeon Mobility 7500]
 		1014 0517  ThinkPad T30
 		1028 00e6  Radeon Mobility M7 LW (Dell Inspiron 8100)
-	4c58  Radeon Mobility M7 LX [Radeon Mobility FireGL 7800]
+		144d c006  Radeon Mobility M7 LW in vpr Matrix 170B4
+	4c58  Radeon RV200 LX [Mobility FireGL 7800 M7]
 	4c59  Radeon Mobility M6 LY
 		1014 0235  ThinkPad A30p (2653-64G)
 		1014 0239  ThinkPad X22/X23/X24
 		104d 80e7  VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
 	4c5a  Radeon Mobility M6 LZ
-	4c64  Radeon R250 Ld [Radeon Mobility 9000]
-	4c65  Radeon R250 Le [Radeon Mobility 9000]
-	4c66  Radeon R250 Lf [Radeon Mobility 9000]
-	4c67  Radeon R250 Lg [Radeon Mobility 9000]
+	4c64  Radeon R250 Ld [Radeon Mobility 9000 M9]
+	4c65  Radeon R250 Le [Radeon Mobility 9000 M9]
+	4c66  Radeon R250 Lf [Radeon Mobility 9000 M9]
+	4c67  Radeon R250 Lg [Radeon Mobility 9000 M9]
+# Secondary chip to the Lf
+	4c6e  Radeon R250 Ln [Radeon Mobility 9000 M9] [Secondary]
 	4d46  Rage Mobility M4 AGP
 	4d4c  Rage Mobility M4 AGP
-	4e44  Radeon R300 ND [Radeon 9700]
-	4e45  Radeon R300 NE [Radeon 9700]
+	4e44  Radeon R300 ND [Radeon 9700 Pro]
+	4e45  Radeon R300 NE [Radeon 9500 Pro]
+		1002 0002  Radeon R300 NE [Radeon 9500 Pro]
 	4e46  Radeon R300 NF [Radeon 9700]
-	4e47  Radeon R300 NG [Radeon 9700]
-	4e64  Radeon R300 [Radeon 9700] (Secondary)
+	4e47  Radeon R300 NG [FireGL X1]
+	4e48  Radeon R350 [Radeon 9800]
+	4e64  Radeon R300 [Radeon 9700 Pro] (Secondary)
+	4e65  Radeon R300 [Radeon 9500 Pro] (Secondary)
+		1002 0003  Radeon R300 NE [Radeon 9500 Pro]
+	4e66  Radeon R300 [Radeon 9700] (Secondary)
+	4e67  Radeon R300 [FireGL X1] (Secondary)
+	4e68  Radeon R350 [Radeon 9800] (Secondary)
 	5041  Rage 128 PA/PRO
 	5042  Rage 128 PB/PRO AGP 2x
 	5043  Rage 128 PC/PRO AGP 4x
@@ -327,7 +357,7 @@
 	5056  Rage 128 PV/PRO TMDS
 	5057  Rage 128 PW/PRO AGP 2x TMDS
 	5058  Rage 128 PX/PRO AGP 4x TMDS
-	5144  Radeon R100 QD [Radeon 64 DDR]
+	5144  Radeon R100 QD [Radeon 7200]
 		1002 0008  Radeon 7000/Radeon VE
 		1002 0009  Radeon 7000/Radeon
 		1002 000a  Radeon 7000/Radeon
@@ -345,8 +375,10 @@
 	5146  Radeon R100 QF
 	5147  Radeon R100 QG
 	5148  Radeon R200 QH [Radeon 8500]
-		1002 0152  FireGL 8800
-		1002 0172  FireGL 8700
+		1002 010a  FireGL 8800 64Mb
+		1002 0152  FireGL 8800 128Mb
+		1002 0162  FireGL 8700 32Mb
+		1002 0172  FireGL 8700 64Mb
 	5149  Radeon R200 QI
 	514a  Radeon R200 QJ
 	514b  Radeon R200 QK
@@ -355,6 +387,9 @@
 		1002 013a  Radeon 8500
 		148c 2026  R200 QL [Radeon 8500 Evil Master II Multi Display Edition]
 		174b 7149  Radeon R200 QL [Sapphire Radeon 8500 LE]
+	514d  Radeon R200 QM [Radeon 9100]
+	514e  Radeon R200 QN [Radeon 8500LE]
+	514f  Radeon R200 QO [Radeon 8500LE]
 	5157  Radeon RV200 QW [Radeon 7500]
 		1002 013a  Radeon 7500
 		1458 4000  RV200 QW [RADEON 7500 PRO MAYA AR]
@@ -365,7 +400,7 @@
 		174b 7161  Radeon RV200 QW [Radeon 7500 LE]
 		17af 0202  RV200 QW [Excalibur Radeon 7500LE]
 	5158  Radeon RV200 QX [Radeon 7500]
-	5159  Radeon VE QY
+	5159  Radeon RV100 QY [Radeon 7000/VE]
 		1002 000a  Radeon 7000/Radeon VE
 		1002 000b  Radeon 7000
 		1002 0038  Radeon 7000/Radeon VE
@@ -377,11 +412,13 @@
 		148c 2023  RV100 QY [Radeon 7000 Evil Master Multi-Display]
 		174b 7112  RV100 QY [Sapphire Radeon VE 7000]
 		1787 0202  RV100 QY [Excalibur Radeon 7000]
-	515a  Radeon VE QZ
+	515a  Radeon RV100 QZ [Radeon 7000/VE]
 	5168  Radeon R200 Qh
 	5169  Radeon R200 Qi
 	516a  Radeon R200 Qj
 	516b  Radeon R200 Qk
+# This one is not in ATI documentation, but is in XFree86 source code
+	516c  Radeon R200 Ql
 	5245  Rage 128 RE/SG
 		1002 0008  Xpert 128
 		1002 0028  Rage 128 AIW
@@ -401,6 +438,7 @@
 		1002 0088  Xpert 99
 	5345  Rage 128 SE/4x
 	5346  Rage 128 SF/4x AGP 2x
+		1002 0048  RAGE 128 16MB VGA TVOUT AMC PAL
 	5347  Rage 128 SG/4x AGP 4x
 	5348  Rage 128 SH
 	534b  Rage 128 SK/4x
@@ -431,7 +469,11 @@
 		1002 5654  Mach64VT Reference
 	5655  264VT3 [Mach64 VT3]
 	5656  264VT4 [Mach64 VT4]
-	700f  U1/A3 AGP Bridge [IGP 320M]
+	5961  Radeon RV280 [Radeon 9200]
+	700f  PCI Bridge [IGP 320M]
+	7010  PCI Bridge [IGP 340M]
+	cab0  AGP Bridge [IGP 320M]
+	cab2  RS200/RS200M AGP Bridge [IGP 340M]
 1003  ULSI Systems
 	0201  US201
 1004  VLSI Technology Inc
@@ -485,7 +527,14 @@
 	0011  NS87560 National PCI System I/O
 	0012  USB Controller
 	0020  DP83815 (MacPhyter) Ethernet Controller
+		1385 f311  FA311 / FA312 (FA311 with WoL HW)
 	0022  DP83820 10/100/1000 Ethernet Controller
+	0028  CS5535 Host bridge
+	002b  CS5535 ISA bridge
+	002d  CS5535 IDE
+	002e  CS5535 Audio
+	002f  CS5535 USB
+	0030  CS5535 Video
 	0500  SCx200 Bridge
 	0501  SCx200 SMI
 	0502  SCx200 IDE
@@ -537,6 +586,7 @@
 	0014  DECchip 21041 [Tulip Pass 3]
 		1186 0100  DE-530+
 	0016  DGLPB [OPPO]
+	0017  PV-PCI Graphics Controller (ZLXp-L)
 	0019  DECchip 21142/43
 		1011 500a  DE500A Fast Ethernet
 		1011 500b  DE500B Fast Ethernet
@@ -567,6 +617,7 @@
 		1374 0002  Cardbus Ethernet Card 10/100
 		1374 0007  Cardbus Ethernet Card 10/100
 		1374 0008  Cardbus Ethernet Card 10/100
+		1385 2100  FA510
 		1395 0001  10/100 Ethernet CardBus PC Card
 		13d1 ab01  EtherFast 10/100 Cardbus (PCMPC200)
 		8086 0001  EtherExpress PRO/100 Mobile CardBus 32
@@ -585,7 +636,9 @@
 		0e11 4051  Integrated Smart Array
 		0e11 4058  Integrated Smart Array
 		103c 10c2  Hewlett-Packard NetRAID-4M
-		12d9 000a  VoIP PCI Gateway
+		12d9 000a  IP Telephony card
+		4c53 1050  CT7 mainboard
+		4c53 1051  CE7 mainboard
 		9005 0365  Adaptec 5400S
 		9005 1364  Dell PowerEdge RAID Controller 2
 		9005 1365  Dell PowerEdge RAID Controller 2
@@ -650,14 +703,17 @@
 	001b  GXT-150P
 	001c  Carrera
 	001d  82G2675
-	0020  MCA
+	0020  GXT1000 Graphics Adapter
 	0022  IBM27-82351
 	002d  Python
-	002e  ServeRAID Controller
+# [official name in AIX 5]
+	002e  SCSI RAID Adapter [ServeRAID]
 		1014 002e  ServeRAID-3x
 		1014 022e  ServeRAID-4H
+	0031  2 Port Serial Adapter
 	0036  Miami
 	003a  CPU to PCI Bridge
+	003c  GXT250P/GXT255P Graphics Adapter
 	003e  16/4 Token ring UTP/STP controller
 		1014 003e  Token-Ring Adapter
 		1014 00cd  Token-Ring Adapter + Wake-On-LAN
@@ -675,23 +731,30 @@
 	004f  ATM Controller (14104f00)
 	0050  ATM Controller (14105000)
 	0053  25 MBit ATM Controller
+	0054  GXT500P/GXT550P Graphics Adapter
 	0057  MPEG PCI Bridge
 	005c  i82557B 10/100
+	005e  GXT800P Graphics Adapter
 	007c  ATM Controller (14107c00)
 	007d  3780IDSP [MWave]
+	008e  GXT3000P Graphics Adapter
 	0090  GXT 3000P
 		1014 008e  GXT-3000P
+	0091  SSA Adapter
 	0095  20H2999 PCI Docking Bridge
 	0096  Chukar chipset SCSI controller
 		1014 0097  iSeries 2778 DASD IOA
 		1014 0098  iSeries 2763 DASD IOA
 		1014 0099  iSeries 2748 DASD IOA
+	009f  PCI 4758 Cryptographic Accelerator
 	00a5  ATM Controller (1410a500)
 	00a6  ATM 155MBPS MM Controller (1410a600)
 	00b7  256-bit Graphics Rasterizer [Fire GL1]
+	00b8  GXT2000P Graphics Adapter
 	00be  ATM 622MBPS Controller (1410be00)
 	00dc  Advanced Systems Management Adapter (ASMA)
 	00fc  CPC710 Dual Bridge and Memory Controller (PCI-64)
+	0104  Gigabit Ethernet-SX Adapter
 	0105  CPC710 Dual Bridge and Memory Controller (PCI-32)
 	010f  Remote Supervisor Adapter (RSA)
 	0142  Yotta Video Compositor Input
@@ -699,6 +762,14 @@
 	0144  Yotta Video Compositor Output
 		1014 0145  Yotta Output Controller (ytout)
 	0156  405GP PLB to PCI Bridge
+	015e  622Mbps ATM PCI Adapter
+	0160  64bit/66MHz PCI ATM 155 MMF
+	016e  GXT4000P Graphics Adapter
+	0170  GXT6000P Graphics Adapter
+	017d  GXT300P Graphics Adapter
+	0180  Snipe chipset SCSI controller
+		1014 0241  iSeries 2757 DASD IOA
+		1014 0264  Quad Channel PCI-X U320 SCSI RAID Adapter (2780)
 	01a7  PCI-X to PCI-X Bridge
 	01bd  ServeRAID Controller
 		1014 01be  ServeRAID-4M
@@ -708,6 +779,19 @@
 		1014 022e  ServeRAID-4H
 		1014 0258  ServeRAID-5i
 		1014 0259  ServeRAID-5i
+	01c1  64bit/66MHz PCI ATM 155 UTP
+	01e6  Cryptographic Accelerator
+	01ff  10/100 Mbps Ethernet
+	0219  Multiport Serial Adapter
+		1014 021a  Dual RVX
+		1014 0251  Internal Modem/RVX
+		1014 0252  Quad Internal Modem
+	021b  GXT6500P Graphics Adapter
+	021c  GXT4500P Graphics Adapter
+	0233  GXT135P Graphics Adapter
+	0266  PCI-X Dual Channel SCSI
+	0268  Gigabit Ethernet-SX Adapter (PCI-X)
+	0269  10/100/1000 Base-TX Ethernet Adapter (PCI-X)
 	0302  XA-32 chipset [Summit]
 	ffff  MPIC-2 interrupt controller
 1015  LSI Logic Corp of Canada
@@ -770,9 +854,16 @@
 		1259 2454  AT-2450v4 10Mb Ethernet Adapter
 		1259 2700  AT-2700TX 10/100 Fast Ethernet
 		1259 2701  AT-2700FX 100Mb Ethernet
+		4c53 1000  CC7/CR7/CP7/VC7/VP7/VR7 mainboard
+		4c53 1010  CP5/CR6 mainboard
+		4c53 1020  VR6 mainboard
+		4c53 1030  PC5 mainboard
+		4c53 1040  CL7 mainboard
+		4c53 1060  PC7 mainboard
 	2001  79c978 [HomePNA]
 		1092 0a78  Multimedia Home Network Adapter
 		1668 0299  ActionLink Home Network Adapter
+	2003  Am 1771 MBW [Alchemy]
 	2020  53c974 [PCscsi]
 	2040  79c974
 	3000  ELanSC520 Microcontroller
@@ -817,6 +908,7 @@
 	746b  AMD-8111 ACPI
 	746d  AMD-8111 AC97 Audio
 	746e  AMD-8111 MC97 Modem
+	756b  AMD-8111 ACPI
 1023  Trident Microsystems
 	0194  82C194
 	2000  4DWave DX
@@ -939,13 +1031,15 @@
 		1028 00d0  PowerEdge Expandable RAID Controller 3/Si
 	0005  PowerEdge Expandable RAID Controller 3/Di
 	0006  PowerEdge Expandable RAID Controller 3/Di
-	0007  Remote Assistant Card 3
-	0008  PowerEdge Expandable RAID Controller 3/Di
+	0007  Remote Access Controller:DRAC III
+	0008  Remote Access Controller
+	0009  BMC/SMIC device not present
 	000a  PowerEdge Expandable RAID Controller 3
 		1028 0106  PowerEdge Expandable RAID Controller 3/Di
 		1028 011b  PowerEdge Expandable RAID Controller 3/Di
 		1028 0121  PowerEdge Expandable RAID Controller 3/Di
-	000c  Embedded Systems Management Device 4
+	000c  Remote Access Controller:ERA or ERA/O
+	000d  BMC/SMIC device
 	000e  PowerEdge Expandable RAID Controller
 	000f  PowerEdge Expandable RAID Controller 4/Di
 1029  Siemens Nixdorf IS
@@ -955,9 +1049,11 @@
 102b  Matrox Graphics, Inc.
 # DJ: I've a suspicion that 0010 is a duplicate of 0d10.
 	0010  MGA-I [Impression?]
+	0100  MGA 1064SG [Mystique]
 	0518  MGA-II [Athena]
 	0519  MGA 2064W [Millennium]
 	051a  MGA 1064SG [Mystique]
+		102b 0100  MGA-1064SG Mystique
 		102b 1100  MGA-1084SG Mystique
 		102b 1200  MGA-1084SG Mystique
 		1100 102b  MGA-1084SG Mystique
@@ -1081,6 +1177,12 @@
 	00b8  F64310
 	00c0  F69000 HiQVideo
 		102c 00c0  F69000 HiQVideo
+		4c53 1000  CC7/CR7/CP7/VC7/VP7/VR7 mainboard
+		4c53 1010  CP5/CR6 mainboard
+		4c53 1020  VR6 mainboard
+		4c53 1030  PC5 mainboard
+		4c53 1050  CT7 mainboard
+		4c53 1051  CE7 mainboard
 	00d0  F65545
 	00d8  F65545
 	00dc  F65548
@@ -1092,6 +1194,11 @@
 	00f4  F68554 HiQVision
 	00f5  F68555
 	0c30  F69030
+		4c53 1000  CC7/CR7/CP7/VC7/VP7/VR7 mainboard
+		4c53 1050  CT7 mainboard
+		4c53 1051  CE7 mainboard
+# C5C project cancelled
+		4c53 1080  CT8 mainboard
 102d  Wyse Technology Inc.
 	50dc  3328 Audio
 102e  Olivetti Advanced Technology
@@ -1107,6 +1214,7 @@
 	6057  MiroVideo DC10/DC30+
 1032  Compaq
 1033  NEC Corporation
+	0000  Vr4181A USB Host or Function Control Unit
 	0001  PCI to 486-like bus Bridge
 	0002  PCI to VL98 Bridge
 	0003  ATM Controller
@@ -1147,9 +1255,11 @@
 	00a6  VRC5477 AC97
 	00cd  IEEE 1394 [OrangeLink] Host Controller
 		12ee 8011  Root hub
+	00df  Vr4131
 	00e0  USB 2.0
 		12ee 7001  Root hub
 		1799 0002  Root Hub
+	00f3  uPD6113x Multimedia Decoder/Processor [EMMA2]
 1034  Framatome Connectors USA Inc.
 1035  Comp. & Comm. Research Lab
 1036  Future Domain Corp.
@@ -1157,7 +1267,8 @@
 1037  Hitachi Micro Systems
 1038  AMP, Inc
 1039  Silicon Integrated Systems [SiS]
-	0001  5591/5592 AGP
+# This is what all my tests report. I don't know if this is equivalent to "5591/5592 AGP".
+	0001  SiS 530 Virtual PCI-to-PCI bridge (AGP)
 	0002  SG86C202
 	0006  85C501/2/3
 	0008  85C503/5513
@@ -1167,8 +1278,12 @@
 		1039 0000  SiS5597 SVGA (Shared RAM)
 	0204  82C204
 	0205  SG86C205
-	0300  300/200
+	0300  SiS300/305 PCI/AGP VGA Display Adapter
 		107d 2720  Leadtek WinFast VR300
+	0310  SiS315H PCI/AGP VGA Display Adapter
+	0315  SiS315 PCI/AGP VGA Display Adapter
+	0325  SiS315PRO PCI/AGP VGA Display Adapter
+	0330  SiS330 [Xabre] PCI/AGP VGA Display Adapter
 	0406  85C501/2
 	0496  85C496
 	0530  530 Host
@@ -1181,6 +1296,7 @@
 	0635  635 Host
 	0645  SiS645 Host & Memory & AGP Controller
 	0646  SiS645DX Host & Memory & AGP Controller
+	0648  SiS 645xx
 	0650  650 Host
 	0651  SiS651 Host
 	0730  730 Host
@@ -1188,18 +1304,23 @@
 	0735  735 Host
 	0740  740 Host
 	0745  745 Host
+	0746  746 Host
+	0755  SiS 755 Host Bridge
 	0900  SiS900 10/100 Ethernet
 		1039 0900  SiS900 10/100 Ethernet Adapter
+		1043 8035  CUSI-FX motherboard
 	0961  SiS961 [MuTIOL Media IO]
 	0962  SiS962 [MuTIOL Media IO]
 	3602  83C602
 	5107  5107
 	5300  SiS540 PCI Display Adapter
+	5315  SiS550 AGP/VGA VGA Display Adapter
 	5401  486 PCI Chipset
 	5511  5511/5512
 	5513  5513 [IDE]
 		1019 0970  P6STP-FL motherboard
 		1039 5513  SiS5513 EIDE Controller (A,B step)
+		1043 8035  CUSI-FX motherboard
 	5517  5517
 	5571  5571
 	5581  5581 Pentium Chipset
@@ -1213,8 +1334,10 @@
 	6236  6236 3D-AGP
 	6300  SiS630 GUI Accelerator+3D
 		1019 0970  P6STP-FL motherboard
+		1043 8035  CUSI-FX motherboard
 	6306  SiS530 3D PCI/AGP
 		1039 6306  SiS530,620 GUI Accelerator+3D
+	6325  SiS650/651/M650/740 PCI/AGP VGA Display Adapter
 	6326  86C326 5598/6326
 		1039 6326  SiS6326 GUI Accelerator
 		1092 0a50  SpeedStar A50
@@ -1222,14 +1345,14 @@
 		1092 4910  SpeedStar A70
 		1092 4920  SpeedStar A70
 		1569 6326  SiS6326 GUI Accelerator
-	7001  7001
+	7001  USB 1.0 Controller
 		1039 7000  Onboard USB Controller
-	7002  SiS7002 USB 2.0
+	7002  USB 2.0 Controller
 		1509 7002  Onboard USB Controller
 	7007  FireWire Controller
-	7012  SiS7012 PCI Audio Accelerator
-	7013  56k Winmodem (Smart Link HAMR5600 compatible)
-	7016  SiS7016 10/100 Ethernet Adapter
+	7012  Sound Controller
+	7013  Intel 537 [56k Winmodem]
+	7016  10/100 Ethernet Adapter
 		1039 7016  SiS7016 10/100 Ethernet Adapter
 	7018  SiS PCI Audio Accelerator
 		1014 01b6  SiS PCI Audio Accelerator
@@ -1254,6 +1377,7 @@
 		15c5 0111  SiS PCI Audio Accelerator
 		270f a171  SiS PCI Audio Accelerator
 		a0a0 0022  SiS PCI Audio Accelerator
+	7019  SiS7019 Audio Accelerator
 103a  Seiko Epson Corporation
 103b  Tatung Co. of America
 103c  Hewlett-Packard Company
@@ -1286,7 +1410,6 @@
 		103c 1226  Keystone SP2
 		103c 1227  Powerbar SP2
 		103c 1282  Everest SP2
-	1054  PCI Local Bus Adapter
 	1064  79C970 PCnet Ethernet Controller
 	108b  Visualize FXe
 	10c1  NetServer Smart IRQ Router
@@ -1298,7 +1421,7 @@
 	121c  NetServer PCI COM Port Decoder
 	1229  zx1 System Bus Adapter
 	122a  zx1 I/O Controller
-	122e  PCI-X/AGP Local Bus Adapter
+	122e  zx1 Local Bus Adapter
 	1290  Auxiliary Diva Serial Port
 	2910  E2910A PCIBus Exerciser
 	2925  E2925A 32 Bit, 33 MHzPCI Exerciser & Analyzer
@@ -1307,13 +1430,15 @@
 1040  Accelgraphics Inc.
 1041  Computrend
 1042  Micron
-	1000  FDC 37C665
-	1001  37C922
+	1000  PC Tech RZ1000
+	1001  PC Tech RZ1001
 	3000  Samurai_0
 	3010  Samurai_1
 	3020  Samurai_IDE
 1043  Asustek Computer, Inc.
 	0675  ISDNLink P-IN100-ST-D
+	4021  v7100 Combo Deluxe [GeForce2 MX + TV tuner]
+	4057  v8200 GeForce 3
 1044  Distributed Processing Technology
 	1012  Domino RAID Engine
 	a400  SmartCache/Raid I-IV Controller
@@ -1375,7 +1500,7 @@
 	c832  82C832
 	c861  82C861
 	c895  82C895
-	c935  EV1935 ECTIVA MachOne PCI Audio
+	c935  EV1935 ECTIVA MachOne PCIAudio
 	d568  82C825 [Firebridge 2]
 	d721  IDE [FireStar]
 1046  IPC Corporation, Ltd.
@@ -1385,14 +1510,24 @@
 	1000  QuickStep 1000
 	3000  QuickStep 3000
 1049  Fountain Technologies, Inc.
-104a  SGS Thomson Microelectronics
+# # nee SGS Thomson Microelectronics
+104a  STMicroelectronics
 	0008  STG 2000X
 	0009  STG 1764X
 	0010  STG4000 [3D Prophet Kyro Series]
+	0209  STPC Consumer/Industrial North- and Southbridge
+	020a  STPC Atlas/ConsumerS/Consumer IIA Northbridge
+# From <http://gatekeeper.dec.com/pub/BSD/FreeBSD/FreeBSD-stable/src/share/misc/pci_vendors>
+	0210  STPC Atlas ISA Bridge
+	021a  STPC Consumer S Southbridge
+	021b  STPC Consumer IIA Southbridge
+	0500  ST70137 [Unicorn] ADSL DMT Transceiver
+	0564  STPC Client Northbridge
 	0981  DEC-Tulip compatible 10/100 Ethernet
 	1746  STG 1764X
 	2774  DEC-Tulip compatible 10/100 Ethernet
 	3520  MPEG-II decoder card
+	55cc  STPC Client Southbridge
 104b  BusLogic
 	0140  BT-946C (old) [multimaster  01]
 	1040  BT-946C (BA80C30) [MultiMaster 10]
@@ -1401,6 +1536,7 @@
 	0500  100 MBit LAN Controller
 	0508  TMS380C2X Compressor Interface
 	1000  Eagle i/f AS
+	104c  PCI1510 PC card Cardbus Controller
 	3d04  TVP4010 [Permedia]
 	3d07  TVP4020 [Permedia 2]
 		1011 4d10  Comet
@@ -1444,7 +1580,11 @@
 	8026  TSB43AB21 IEEE-1394a-2000 Controller (PHY/Link)
 	8027  PCI4451 IEEE-1394 Controller
 		1028 00e6  PCI4451 IEEE-1394 Controller (Dell Inspiron 8100)
-	8400  USR2210 22Mbps Wireless PC Card
+	8029  PCI4510 IEEE-1394 Controller
+	8400  ACX 100 22Mbps Wireless Interface
+	8401  ACX 100 22Mbps Wireless Interface
+# OK, this info is almost useless as is, but at least it's known that it's a wireless card. More info requested from reporter (whi
+	9000  Wireless Interface (of unknown type)
 	a001  TDC1570
 	a100  TDC1561
 	a102  TNETA1575 HyperSAR Plus w/PCI Host i/f & UTOPIA i/f
@@ -1460,7 +1600,9 @@
 	ac19  PCI1221
 	ac1a  PCI1210
 	ac1b  PCI1450
+		0e11 b113  Armada M700
 	ac1c  PCI1225
+		0e11 b121  Armada E500
 	ac1d  PCI1251A
 	ac1e  PCI1211
 	ac1f  PCI1251B
@@ -1474,15 +1616,18 @@
 	ac41  PCI4410 PC card Cardbus Controller
 	ac42  PCI4451 PC card Cardbus Controller
 		1028 00e6  PCI4451 PC card CardBus Controller (Dell Inspiron 8100)
+	ac44  PCI4510 PC card Cardbus Controller
 	ac50  PCI1410 PC card Cardbus Controller
 	ac51  PCI1420
 		1014 023b  ThinkPad T23 (2647-4MG)
+		1028 00b1  Latitude C600
 		10cf 1095  Lifebook C6155
 		e4bf 1000  CP2-2-HIPHOP
 	ac52  PCI1451 PC card Cardbus Controller
 	ac53  PCI1421 PC card Cardbus Controller
 	ac55  PCI1250 PC card Cardbus Controller
 		1014 0512  ThinkPad T30
+	ac56  PCI1510 PC card Cardbus Controller
 	ac60  PCI2040 PCI to DSP Bridge Controller
 	fe00  FireWire Host Controller
 	fe03  12C01A FireWire Host Controller
@@ -1564,7 +1709,9 @@
 	0d38  20263
 		105a 4d39  Fasttrak66
 	1275  20275
+	3318  PDC20318 (SATA150 TX4)
 	3376  PDC20376
+		1043 809e  A7V8X motherboard
 	4d30  20267
 		105a 4d33  Ultra100
 		105a 4d39  Fasttrak100
@@ -1577,6 +1724,7 @@
 	4d68  20268
 		105a 4d68  Ultra100TX2
 	4d69  20269
+		105a 4d68  Ultra133TX2
 	5275  PDC20276 IDE
 		105a 0275  SuperTrak SX6000 IDE
 	5300  DC5300
@@ -1584,6 +1732,7 @@
 	6269  PDC20271
 		105a 6269  FastTrak TX2/TX2000
 	6621  PDC20621 [SX4000] 4 Channel IDE RAID Controller
+	6629  PDC20619 FastTrak TX4000 RAID
 	7275  PDC20277
 105b  Foxconn International, Inc.
 105c  Wipro Infotech Limited
@@ -1621,6 +1770,7 @@
 		13cc 0009  Barco Metheus 5 Megapixel, Dual Head
 		13cc 000a  Barco Metheus 5 Megapixel, Dual Head
 	5348  Revolution 4
+		105d 0037  Revolution IV-FP AGP (For SGI 1600SW)
 105e  Vtech Computers Ltd
 105f  Infotronic America Inc
 1060  United Microelectronics [UMC]
@@ -1669,6 +1819,7 @@
 	0002  DAC960PD
 	0010  DAC960PX
 	0050  AcceleRAID 352/170/160 support Device
+	b166  Gemstone chipset SCSI controller
 	ba55  eXtremeRAID 1100 support Device
 	ba56  eXtremeRAID 2000/3000 support Device
 106a  Aten Research Inc
@@ -1759,6 +1910,7 @@
 	2100  QLA2100 64-bit Fibre Channel Adapter
 		1077 0001  QLA2100 64-bit Fibre Channel Adapter
 	2200  QLA2200
+		1077 0002  QLA2200
 	2300  QLA2300 64-bit FC-AL Adapter
 	2312  QLA2312 Fibre Channel Adapter
 1078  Cyrix Corporation
@@ -1856,7 +2008,6 @@
 	8001  Schizo PCI Bus Module
 	a000  Ultra IIi
 	a001  Ultra IIe
-	a801  Tomatillo PCI Bus Module
 108f  Systemsoft
 1090  Encore Computer Corporation
 1091  Intergraph Corporation
@@ -1896,6 +2047,8 @@
 	1190  PCI-MIO-16E-4
 	1330  PCI-6031E
 	1350  PCI-6071E
+	17d0  PCI-6503
+	2410  PCI-6733
 	2a60  PCI-6023E
 	b001  IMAQ-PCI-1408
 	b011  IMAQ-PXI-1408
@@ -1911,6 +2064,7 @@
 	c831  PCI-GPIB bridge
 1094  First International Computers [FIC]
 1095  CMD Technology Inc
+	0240  Adaptec AAR-1210SA SATA HostRAID Controller
 	0640  PCI0640
 	0643  PCI0643
 	0646  PCI0646
@@ -1925,6 +2079,7 @@
 		1095 0670  USB0670
 	0673  USB0673
 	0680  PCI0680
+	3112  Silicon Image SiI 3112 SATARaid Controller
 1096  Alacron
 1097  Appian Technology
 1098  Quantum Designs (H.K.) Ltd
@@ -1944,8 +2099,10 @@
 	036c  Bt879(??) Video Capture
 		13e9 0070  Win/TV (Video Section)
 	036e  Bt878 Video Capture
-		0070 13eb  WinTV/GO
+		0070 13eb  WinTV Series
 		0070 ff01  Viewcast Osprey 200
+		107d 6606  WinFast TV 2000
+		11bd 0012  PCTV pro (TV + FM stereo receiver)
 		11bd 001c  PCTV Sat (DBC receiver)
 		127a 0001  Bt878 Mediastream Controller NTSC
 		127a 0002  Bt878 Mediastream Controller PAL BG
@@ -1996,10 +2153,11 @@
 		1851 1851  FlyVideo'98 EZ - video
 		1852 1852  FlyVideo'98 (with FM Tuner)
 	0878  Bt878 Audio Capture
-		0070 13eb  WinTV/GO
+		0070 13eb  WinTV Series
 		0070 ff01  Viewcast Osprey 200
 		1002 0001  TV-Wonder
 		1002 0003  TV-Wonder/VE
+		11bd 0012  PCTV pro (TV + FM stereo receiver, audio section)
 		11bd 001c  PCTV Sat (DBC receiver)
 		127a 0001  Bt878 Video Capture (Audio Section)
 		127a 0002  Bt878 Video Capture (Audio Section)
@@ -2055,6 +2213,7 @@
 10a3  Everex Systems Inc
 10a4  Globe Manufacturing Sales
 10a5  Smart Link Ltd.
+	3052  SmartPCI562 56K Modem
 	5449  SmartPCI561 modem
 10a6  Informtech Industrial Ltd.
 10a7  Benchmarq Microelectronics
@@ -2070,6 +2229,7 @@
 	0007  RPCEX
 	0008  DiVO VIP
 	0009  Alteon Gigabit Ethernet
+		10a9 8002  Acenic Gigabit Ethernet
 	0010  AMP Video I/O
 	0011  GRIP
 	0012  SGH PSHAC GSN
@@ -2081,6 +2241,7 @@
 	1006  Dual JPEG 4
 	1007  Dual JPEG 5
 	1008  Cesium
+	100a  IOC4 I/O controller
 	2001  Fibre Channel
 	2002  ASDE
 	8001  O2 1394
@@ -2134,6 +2295,7 @@
 		15ed 1001  Macrolink MCCS 16-port Serial
 		15ed 1002  Macrolink MCCS 8-port Serial Hot Swap
 		15ed 1003  Macrolink MCCS 16-port Serial Hot Swap
+		5654 5634  OpenLine4 Telephony Card
 		d531 c002  PCIntelliCAN 2xSJA1000 CAN bus
 		d84d 4006  EX-4006 1P
 		d84d 4008  EX-4008 1P EPP/ECP
@@ -2154,6 +2316,8 @@
 		d84d 4078  EX-4078 2S(16C552) RS-232+1P
 	9054  PCI <-> IOBus Bridge
 		10b5 2455  Wessex Techology PHIL-PCI
+		10b5 2696  Innes Corp AM Radcap card
+		12d9 0002  PCI Prosody Card rev 1.5
 	9060  9060
 	906d  9060SD
 		125c 0640  Aries 16000P
@@ -2161,6 +2325,8 @@
 	9080  9080
 		10b5 9080  9080 [real subsystem ID not set]
 		129d 0002  Aculab PCI Prosidy card
+		12d9 0002  PCI Prosody Card
+	bb04  B&B 3PCIOSD1A Isolated PCI Serial
 10b6  Madge Networks
 	0001  Smart 16/4 PCI Ringnode
 	0002  Smart 16/4 PCI Ringnode Mk2
@@ -2188,12 +2354,11 @@
 	1001  Collage 155 ATM Server Adapter
 10b7  3Com Corporation
 	0001  3c985 1000BaseSX (SX/TX)
+	0910  3C910-A01
 	1006  MINI PCI type 3B Data Fax Modem
 	1007  Mini PCI 56k Winmodem
 		10b7 615c  Mini PCI 56K Modem
-	1700  Gigabit Ethernet Adapter
-		10b7 0010  3Com 3C940 Gigabit LOM Ethernet Adapter
-		10b7 0020  3Com 3C941 Gigabit LOM Ethernet Adapter
+	1700  3c940 1000Base?
 	3390  3c339 TokenLink Velocity
 	3590  3c359 TokenLink Velocity XL
 		10b7 3590  TokenLink Velocity XL Adapter (3C359/359B)
@@ -2226,6 +2391,7 @@
 		10b7 656b  3CCFEM656 10/100 LAN+56K Modem CardBus
 	6564  3CCFEM656 [id 6564] Cyclone CardBus
 	7646  3cSOHO100-TX Hurricane
+	7770  3CRWE777 PCI(PLX) Wireless Adaptor [Airconnect]
 	7940  3c803 FDDILink UTP Controller
 	7980  3c804 FDDILink SAS Controller
 	7990  3c805 FDDILink DAS Controller
@@ -2266,10 +2432,11 @@
 	9058  3c905B-Combo [Deluxe Etherlink XL 10/100]
 	905a  3c905B-FX [Fast Etherlink XL FX 10/100]
 	9200  3c905C-TX/TX-M [Tornado]
-		1028 0095  Integrated 3C905C-TX Fast Etherlink for PC Management NIC
+		1028 0095  3C920 Integrated Fast Ethernet Controller
+		1028 0097  3C920 Integrated Fast Ethernet Controller
 		10b7 1000  3C905C-TX Fast Etherlink for PC Management NIC
 		10b7 7000  10/100 Mini PCI Ethernet Adapter
-	9210  3C920B-EMB-WNM Integrated Fast Ethernet Controller
+	9201  3C920B-EMB Integrated Fast Ethernet Controller
 	9300  3CSOHO100B-TX  [910-A01]
 	9800  3c980-TX [Fast Etherlink XL Server Adapter]
 		10b7 9800  3c980-TX Fast Etherlink XL Server Adapter
@@ -2277,6 +2444,7 @@
 		10b7 1201  3c982-TXM 10/100baseTX Dual Port A [Hydra]
 		10b7 1202  3c982-TXM 10/100baseTX Dual Port B [Hydra]
 		10b7 9805  3c980 10/100baseTX NIC [Python-T]
+		10f1 2462  Thunder K7 S2462
 	9900  3C990-TX [Typhoon]
 	9902  3CR990-TX-95 [Typhoon 56-bit]
 	9903  3CR990-TX-97 [Typhoon 168-bit]
@@ -2370,12 +2538,16 @@
 	5251  M5251 P1394 OHCI 1.0 Controller
 	5253  M5253 P1394 OHCI 1.1 Controller
 	5261  M5261 Ethernet Controller
+	5450  Lucent Technologies Soft Modem AMR
 	5451  M5451 PCI AC-Link Controller Audio Device
 		1014 0506  ThinkPad R30
 	5453  M5453 PCI AC-Link Controller Modem Device
 	5455  M5455 PCI AC-Link Controller Audio Device
-	5457  M5457 AC-Link Modem Interface Controller
-	5459  SmartPCI561 56K Modem
+	5457  Intel 537 [M5457 AC-Link Modem]
+# Same but more usefull for driver's lookup
+	5459  SmartLink SmartPCI561 56K Modem
+# SmartLink PCI SoftModem
+	545a  SmartLink SmartPCI563 56K Modem
 	5471  M5471 Memory Stick Controller
 	5473  M5473 SD-MMC Controller
 	7101  M7101 PMU
@@ -2444,7 +2616,10 @@
 10c9  Dataexpert Corporation
 10ca  Fujitsu Microelectr., Inc.
 10cb  Omron Corporation
-10cc  Mentor ARC Inc
+# nee Mentor ARC Inc
+10cc  Mai Logic Incorporated
+	0660  Articia S Host Bridge
+	0661  Articia S PCI Bridge
 10cd  Advanced System Products, Inc
 	1100  ASC1100
 	1200  ASC1200 [(abp940) Fast SCSI-II]
@@ -2453,9 +2628,9 @@
 	2300  ABP940-UW
 	2500  ABP940-U2W
 10ce  Radius
-10cf  Citicorp TTI
+# nee Citicorp TTI
+10cf  Fujitsu Limited.
 	2001  mb86605
-10d0  Fujitsu Limited
 10d1  FuturePlus Systems Corp.
 10d2  Molex Incorporated
 10d3  Jabil Circuit Inc
@@ -2485,7 +2660,7 @@
 	0008  NV1 [EDGE 3D]
 	0009  NV1 [EDGE 3D]
 	0010  NV2 [Mutara V08]
-	0020  NV4 [Riva TnT]
+	0020  NV4 [RIVA TNT]
 		1043 0200  V3400 TNT
 		1048 0c18  Erazor II SGRAM
 		1048 0c1b  Erazor II
@@ -2507,11 +2682,12 @@
 		10de 0020  Riva TNT
 		1102 1015  Graphics Blaster CT6710
 		1102 1016  Graphics Blaster RIVA TNT
-	0028  NV5 [Riva TnT2]
+	0028  NV5 [RIVA TNT2/TNT2 Pro]
 		1043 0200  AGP-V3800 SGRAM
 		1043 0201  AGP-V3800 SDRAM
 		1043 0205  PCI-V3800
 		1043 4000  AGP-V3800PRO
+		1048 0c21  Synergy II
 		1092 4804  Viper V770
 		1092 4a00  Viper V770
 		1092 4a02  Viper V770 Ultra
@@ -2523,7 +2699,7 @@
 		1102 1020  3D Blaster RIVA TNT2
 		1102 1026  3D Blaster RIVA TNT2 Digital
 		14af 5810  Maxi Gamer Xentor
-	0029  NV5 [Riva TnT2 Ultra]
+	0029  NV5 [RIVA TNT2 Ultra]
 		1043 0200  AGP-V3800 Deluxe
 		1043 0201  AGP-V3800 Ultra SDRAM
 		1043 0205  PCI-V3800 Ultra
@@ -2533,17 +2709,18 @@
 		14af 5820  Maxi Gamer Xentor 32
 	002a  NV5 [Riva TnT2]
 	002b  NV5 [Riva TnT2]
-	002c  NV6 [Vanta]
+	002c  NV6 [Vanta/Vanta LT]
 		1043 0200  AGP-V3800 Combat SDRAM
 		1043 0201  AGP-V3800 Combat
 		1092 6820  Viper V730
 		1102 1031  CT6938 VANTA 8MB
 		1102 1034  CT6894 VANTA 16MB
 		14af 5008  Maxi Gamer Phoenix 2
-	002d  RIVA TNT2 Model 64
+	002d  NV5M64 [RIVA TNT2 Model 64/Model 64 Pro]
 		1043 0200  AGP-V3800M
 		1043 0201  AGP-V3800M
 		1048 0c3a  Erazor III LT
+		10de 001e  M64 AGP4x
 		1102 1023  CT6892 RIVA TNT2 Value
 		1102 1024  CT6932 RIVA TNT2 Value 32Mb
 		1102 102c  CT6931 RIVA TNT2 Value [Jumper]
@@ -2551,8 +2728,32 @@
 		1554 1041  PixelView RIVA TNT2 M64 32MB
 	002e  NV6 [Vanta]
 	002f  NV6 [Vanta]
-	00a0  NV5 [Riva TNT2]
+	0060  nForce2 ISA Bridge
+		1043 80ad  A7N8X Mainboard
+	0064  nForce2 SMBus (MCP)
+	0065  nForce2 IDE
+	0066  nForce2 Ethernet Controller
+	0067  nForce2 USB Controller
+		1043 0c11  A7N8X Mainboard
+	0068  nForce2 USB Controller
+		1043 0c11  A7N8X Mainboard
+	006a  nForce2 AC97 Audio Controler (MCP)
+	006b  nForce MultiMedia audio [Via VT82C686B]
+	006c  nForce2 External PCI Bridge
+	006d  nForce2 PCI Bridge
+	006e  nForce2 FireWire (IEEE 1394) Controller
+	00a0  NV5 [Aladdin TNT2]
 		14af 5810  Maxi Gamer Xentor
+	00d0  nForce3 LPC Bridge
+	00d1  nForce3 Host Bridge
+	00d2  nForce3 AGP Bridge
+	00d4  nForce3 SMBus
+	00d5  nForce3 IDE
+	00d6  nForce3 Ethernet
+	00d7  nForce3 USB 1.1
+	00d8  nForce3 USB 2.0
+	00da  nForce3 Audio
+	00dd  nForce3 PCI Bridge
 	0100  NV10 [GeForce 256 SDR]
 		1043 0200  AGP-V6600 SGRAM
 		1043 0201  AGP-V6600 SDRAM
@@ -2560,45 +2761,57 @@
 		1043 4009  AGP-V6600 SDRAM
 		1102 102d  CT6941 GeForce 256
 		14af 5022  3D Prophet SE
-	0101  NV10 [GeForce 256 DDR]
+	0101  NV10DDR [GeForce 256 DDR]
 		1043 0202  AGP-V6800 DDR
 		1043 400a  AGP-V6800 DDR SGRAM
 		1043 400b  AGP-V6800 DDR SDRAM
+		107d 2822  WinFast GeForce 256
 		1102 102e  CT6971 GeForce 256 DDR
 		14af 5021  3D Prophet DDR-DVI
-	0103  NV10 [Quadro]
-	0110  NV11 [GeForce2 MX]
+	0103  NV10GL [Quadro]
+	0110  NV11 [GeForce2 MX/MX 400]
 		1043 4015  AGP-V7100 Pro
 		1043 4031  V7100 Pro with TV output
+		1462 8817  MSI GeForce2 MX400 Pro32S [MS-8817]
 		14af 7102  3D Prophet II MX
 		14af 7103  3D Prophet II MX Dual-Display
-	0111  NV11 [GeForce2 MX DDR]
+	0111  NV11DDR [GeForce2 MX 100 DDR/200 DDR]
 	0112  NV11 [GeForce2 Go]
-	0113  NV11 [GeForce2 MXR]
-	0150  NV15 [GeForce2 GTS]
+	0113  NV11GL [Quadro2 MXR/EX]
+	0150  NV15 [GeForce2 GTS/Pro]
 		1043 4016  V7700 AGP Video Card
 		107d 2840  WinFast GeForce2 GTS with TV output
 		1462 8831  Creative GeForce2 Pro
-	0151  NV15 [GeForce2 Ti]
+	0151  NV15DDR [GeForce2 Ti]
 		1043 405f  V7700Ti
-	0152  NV15 [GeForce2 Ultra, Bladerunner]
+	0152  NV15BR [GeForce2 Ultra, Bladerunner]
 		1048 0c56  GLADIAC Ultra
-	0153  NV15 [Quadro2 Pro]
-	0170  NV17 [GeForce4 MX460]
-	0171  NV17 [GeForce4 MX440]
+	0153  NV15GL [Quadro2 Pro]
+	0170  NV17 [GeForce4 MX 460]
+	0171  NV17 [GeForce4 MX 440]
+		10b0 0002  Gainward Pro/600 TV
 		1462 8661  G4MX440-VTP
-	0172  NV17 [GeForce4 MX420]
-	0173  NV1x
+		1462 8730  MX440SES-T (MS-8873)
+		147b 8f00  Abit Siluro GeForce4MX440
+	0172  NV17 [GeForce4 MX 420]
+	0173  NV17 [GeForce4 MX 440-SE]
 	0174  NV17 [GeForce4 440 Go]
 	0175  NV17 [GeForce4 420 Go]
 	0176  NV17 [GeForce4 420 Go 32M]
-	0178  Quadro4 500XGL
+	0178  NV17GL [Quadro4 550 XGL]
 	0179  NV17 [GeForce4 440 Go 64M]
-	017a  Quadro4 200/400NVS
-	017b  Quadro4 550XGL
-	017c  Quadro4 550 GoGL
-	0181  NV18 [GeForce4 MX440 AGP 8x]
-	01a0  NV15 [GeForce2 - nForce GPU]
+	017a  NV17GL [Quadro4 200/400 NVS]
+	017b  NV17GL [Quadro4 550 XGL]
+	017c  NV17GL [Quadro4 550 GoGL]
+	0181  NV18 [GeForce4 MX 440 AGP 8x]
+		1043 806f  V9180 Magic
+		1462 8880  MS-StarForce GeForce4 MX 440 with AGP8X
+	0182  NV18 [GeForce4 MX 440SE AGP 8x]
+	0183  NV18 [GeForce4 MX 420 AGP 8x]
+	0188  NV18GL [Quadro4 580 XGL]
+	018a  NV18GL [Quadro4 NVS AGP 8x]
+	018b  NV18GL [Quadro4 380 XGL]
+	01a0  NVCrush11 [GeForce2 MX Integrated Graphics]
 	01a4  nForce CPU bridge
 	01ab  nForce 420 Memory Controller (DDR)
 	01ac  nForce 220/420 Memory Controller
@@ -2609,24 +2822,53 @@
 	01b7  nForce AGP to PCI Bridge
 	01b8  nForce PCI-to-PCI bridge
 	01bc  nForce IDE
-	01c1  nForce MC97 Modem (Smart Link HAMR5600 compatible)
+	01c1  Intel 537 [nForce MC97 Modem]
 	01c2  nForce USB Controller
 	01c3  nForce Ethernet Controller
+	01e0  nForce2 AGP (different version?)
+	01e8  nForce2 AGP
+	01ea  nForce2 Memory Controller 0
+	01eb  nForce2 Memory Controller 1
+	01ec  nForce2 Memory Controller 2
+	01ed  nForce2 Memory Controller 3
+	01ee  nForce2 Memory Controller 4
+	01ef  nForce2 Memory Controller 5
+	01f0  NV18 [GeForce4 MX - nForce GPU]
 	0200  NV20 [GeForce3]
 		1043 402f  AGP-V8200 DDR
-	0201  NV20 [GeForce3 Ti200]
-	0202  NV20 [GeForce3 Ti500]
+	0201  NV20 [GeForce3 Ti 200]
+	0202  NV20 [GeForce3 Ti 500]
 		1043 405b  V8200 T5
 		1545 002f  Xtasy 6964
-	0203  NV20 [Quadro DCC]
-	0250  NV25 [GeForce4 Ti4600]
-	0251  NV25 [GeForce4 Ti4400]
-	0253  NV25 [GeForce4 Ti4200]
+	0203  NV20DCC [Quadro DCC]
+	0250  NV25 [GeForce4 Ti 4600]
+	0251  NV25 [GeForce4 Ti 4400]
+	0252  NV25 [GeForce4 Ti]
+	0253  NV25 [GeForce4 Ti 4200]
 		107d 2896  WinFast A250 LE TD (Dual VGA/TV-out/DVI)
 		147b 8f09  Siluro (Dual VGA/TV-out/DVI)
-	0258  Quadro4 900XGL
-	0259  Quadro4 750XGL
-	025b  Quadro4 700XGL
+	0258  NV25GL [Quadro4 900 XGL]
+	0259  NV25GL [Quadro4 750 XGL]
+	025b  NV25GL [Quadro4 700 XGL]
+	0280  NV28 [GeForce4 Ti 4800]
+	0281  NV28 [GeForce4 Ti 4200 AGP 8x]
+	0282  NV28 [GeForce4 Ti 4800 SE]
+	0286  NV28 [GeForce4 Ti 4200 Go AGP 8x]
+	0288  NV28GL [Quadro4 980 XGL]
+	0289  NV28GL [Quadro4 780 XGL]
+	0300  NV30 [GeForce FX]
+	0301  NV30 [GeForce FX 5800 Ultra]
+	0302  NV30 [GeForce FX 5800]
+	0308  NV30GL [Quadro FX 2000]
+	0309  NV30GL [Quadro FX 1000]
+	0311  NV31 [GeForce FX 5600 Ultra]
+	0312  NV31 [GeForce FX 5600]
+	0321  NV34 [GeForce FX 5200 Ultra]
+	0322  NV34 [GeForce FX 5200]
+	032b  NV34GL [Quadro FX 500]
+	0330  NV35 [GeForce FX 5900 Ultra]
+	0331  NV35 [GeForce FX 5900]
+	0338  NV35GL [Quadro FX 3000]
 10df  Emulex Corporation
 	1ae5  LP6000 Fibre Channel Host Adapter
 	f085  LP850 Fibre Channel Adapter
@@ -2652,6 +2894,7 @@
 10e3  Tundra Semiconductor Corp.
 	0000  CA91C042 [Universe]
 	0860  CA91C860 [QSpan]
+	0862  CA91C862A [QSpan-II]
 10e4  Tandem Computers
 10e5  Micro Industries Corporation
 10e6  Gainbery Computer Products Inc.
@@ -2672,6 +2915,7 @@
 	811a  PCI-IEEE1355-DS-DE Interface
 	8170  S5933 [Matchmaker] (Chipset Development Tool)
 	82db  AJA HDNTV HD SDI Framestore
+	8851  S5933 on Innes Corp FM Radio Capture card
 10e9  Alps Electric Co., Ltd.
 10ea  Intergraphics Systems
 	1680  IGA-1680
@@ -2681,6 +2925,7 @@
 	2010  CyberPro 2000A
 	5000  CyberPro 5000
 	5050  CyberPro 5050
+	5202  CyberPro 5202
 10eb  Artists Graphics
 	0101  3GA
 	8111  Twist3 Frame Grabber
@@ -2719,6 +2964,7 @@
 		8e2e 7100  KF-230TX/2
 		a0a0 0007  ALN-325C
 	8169  RTL-8169
+		1371 434e  ProG-2000L
 	8197  SmartLAN56 56K Modem
 10ed  Ascii Corporation
 	7310  V7310
@@ -2729,6 +2975,7 @@
 	3fc3  RME Digi96/8 Pad
 	3fc4  RME Digi9652 (Hammerfall)
 	3fc5  RME Hammerfall DSP
+	8381  Ellips Santos Frame Grabber
 10ef  Racore Computer Products, Inc.
 	8154  M815x Token Ring Adapter
 10f0  Peritek Corporation
@@ -2777,6 +3024,8 @@
 		1102 8040  CT4760 SBLive!
 		1102 8051  CT4850 SBLive! Value
 		1102 8061  SBLive! Player 5.1
+		1102 8064  SB Live! 5.1 Model SB0100
+		1102 8065  SBLive! 5.1 Digital Model SB0220
 	0004  SB Audigy
 		1102 0051  SB0090 Audigy Player
 		1102 0053  SB0090 Audigy Player/OEM
@@ -2788,7 +3037,8 @@
 	7003  SB Audigy MIDI/Game port
 		1102 0040  SB Audigy MIDI/Game Port
 	7004  [SB Live! Value] Input device controller
-	8938  ES1371
+	8064  SB0100 [SBLive! 5.1 OEM]
+	8938  Ectiva EV1938
 1103  Triones Technologies, Inc.
 	0003  HPT343
 # Revisions: 01=HPT366, 03=HPT370, 04=HPT370A, 05=HPT372
@@ -2799,6 +3049,7 @@
 	0006  HPT302
 	0007  HPT371
 	0008  HPT374
+	0009  HPT372N
 1104  RasterOps Corp.
 1105  Sigma Designs, Inc.
 	1105  REALmagic Xcard MPEG 1/2/3/4 DVD Decoder
@@ -2809,15 +3060,21 @@
 	0130  VT6305 1394.A Controller
 	0305  VT8363/8365 [KT133/KM133]
 		1043 8033  A7V Mainboard
+		1043 803e  A7V-E Mainboard
 		1043 8042  A7V133/A7V133-C Mainboard
 		147b a401  KT7/KT7-RAID/KT7A/KT7A-RAID Mainboard
 	0391  VT8371 [KX133]
 	0501  VT8501 [Apollo MVP4]
 	0505  VT82C505
-	0561  VT82C561
-	0571  VT82C586/B/686A/B PIPC Bus Master IDE
+# Shares chip with :0576. The VT82C576M has :1571 instead of :0561.
+	0561  VT82C576MV
+	0571  VT82C586A/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE
+		1019 0985  P6VXA Motherboard
 		1043 8052  VT8233A Bus Master ATA100/66/33 IDE
-		1106 0571  VT8235 Bus Master ATA133/100/66/33 IDE
+		1043 808c  A7V8X motherboard
+		1106 0571  VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE
+		1179 0001  Magnia Z310
+		1297 f641  FX41 motherboard
 		1458 5002  GA-7VAX Mainboard
 	0576  VT82C576 3V [Apollo Master]
 	0585  VT82C585VP [Apollo VP1/VPX]
@@ -2831,24 +3088,36 @@
 	0598  VT82C598 [Apollo MVP3]
 	0601  VT8601 [Apollo ProMedia]
 	0605  VT8605 [ProSavage PM133]
+		1043 802c  CUV4X mainboard
 	0680  VT82C680 [Apollo P6]
 	0686  VT82C686 [Apollo Super South]
+		1019 0985  P6VXA Motherboard
+		1043 802c  CUV4X mainboard
 		1043 8033  A7V Mainboard
+		1043 803e  A7V-E Mainboard
 		1043 8040  A7M266 Mainboard
 		1043 8042  A7V133/A7V133-C Mainboard
 		1106 0000  VT82C686/A PCI to ISA Bridge
 		1106 0686  VT82C686/A PCI to ISA Bridge
+		1179 0001  Magnia Z310
+		147b a702  KG7-Lite Mainboard
 	0691  VT82C693A/694x [Apollo PRO133x]
+		1019 0985  P6VXA Motherboard
+		1179 0001  Magnia Z310
 		1458 0691  VT82C691 Apollo Pro System Controller
 	0693  VT82C693 [Apollo Pro Plus]
 	0698  VT82C693A [Apollo Pro133 AGP]
 	0926  VT82C926 [Amazon]
 	1000  VT82C570MV
 	1106  VT82C570MV
-	1571  VT82C416MV
+	1571  VT82C576M/VT82C586
 	1595  VT82C595/97 [Apollo VP2/97]
 	3038  USB
-		0925 1234  MVP3 USB Controller
+		0925 1234  USB Controller
+		1019 0985  P6VXA Motherboard
+		1043 808c  A7V8X motherboard
+		1179 0001  Magnia Z310
+		1458 5004  GA-7VAX Mainboard
 	3040  VT82C586B ACPI
 	3043  VT86C100A [Rhine]
 		10bd 0000  VT86C100A Fast Ethernet Adapter
@@ -2858,22 +3127,29 @@
 	3050  VT82C596 Power Management
 	3051  VT82C596 Power Management
 	3057  VT82C686 [Apollo Super ACPI]
+		1019 0985  P6VXA Motherboard
 		1043 8033  A7V Mainboard
+		1043 803e  A7V-E Mainboard
 		1043 8040  A7M266 Mainboard
 		1043 8042  A7V133/A7V133-C Mainboard
+		1179 0001  Magnia Z310
 	3058  VT82C686 AC97 Audio Controller
 		0e11 b194  Soundmax integrated digital audio
+		1019 0985  P6VXA Motherboard
 		1106 4511  Onboard Audio on EP7KXA
 		1458 7600  Onboard Audio
 		1462 3091  MS-6309 Onboard Audio
 		15dd 7609  Onboard Audio
-	3059  VT8233 AC97 Audio Controller
+	3059  VT8233/A/8235 AC97 Audio Controller
+		1043 8095  A7V8X Motherboard (Realtek ALC650 codec)
+		1297 c160  FX41 motherboard (Realtek ALC650 codec)
 		1458 a002  GA-7VAX Onboard Audio (Realtek ALC650)
 	3065  VT6102 [Rhine-II]
 		1106 0102  VT6102 [Rhine II] Embeded Ethernet Controller on VT8235
 		1186 1400  DFE-530TX rev A
 		1186 1401  DFE-530TX rev B
-	3068  AC97 Modem Controller
+		13b9 1421  LD-10/100AL PCI Fast Ethernet Adapter (rev.B)
+	3068  Intel 537 [AC97 Modem]
 	3074  VT8233 PCI to ISA Bridge
 		1043 8052  VT8233A
 	3091  VT8633 [Apollo Pro266]
@@ -2884,11 +3160,18 @@
 	3102  VT8662 Host Bridge
 	3103  VT8615 Host Bridge
 	3104  USB 2.0
+		1043 808c  A7V8X motherboard
+		1297 f641  FX41 motherboard
 		1458 5004  GA-7VAX Mainboard
 	3106  VT6105 [Rhine-III]
 	3109  VT8233C PCI to ISA Bridge
 	3112  VT8361 [KLE133] Host Bridge
-	3116  VT8375 [KM266] Host Bridge
+	3116  VT8375 [KM266/KL266] Host Bridge
+		1297 f641  FX41 motherboard
+# found on EPIA M6000/9000 mainboard
+	3122  VT8623 [Apollo CLE266] integrated CastleRock graphics
+# found on EPIA M6000/9000 mainboard
+	3123  VT8623 [Apollo CLE266]
 	3128  VT8753 [P4X266 AGP]
 	3133  VT3133 Host Bridge
 	3147  VT8233A ISA Bridge
@@ -2896,8 +3179,11 @@
 	3156  P/KN266 Host Bridge
 	3168  VT8374 P4X400 Host Controller/AGP Bridge
 	3177  VT8235 ISA Bridge
+		1043 808c  A7V8X motherboard
+		1297 f641  FX41 motherboard
 		1458 5001  GA-7VAX Mainboard
 	3189  VT8377 [KT400 AGP] Host Bridge
+		1043 807f  A7V8X motherboard
 		1458 5000  GA-7VAX Mainboard
 	5030  VT82C596 ACPI [Apollo PRO]
 	6100  VT85C100A [Rhine II]
@@ -2909,6 +3195,7 @@
 	8596  VT82C596 [Apollo PRO AGP]
 	8597  VT82C597 [Apollo VP3 AGP]
 	8598  VT82C598/694x [Apollo MVP3/Pro133x AGP]
+		1019 0985  P6VXA Motherboard
 	8601  VT8601 [Apollo ProMedia AGP]
 	8605  VT8605 [PM133 AGP]
 	8691  VT82C691 [Apollo Pro]
@@ -2920,6 +3207,7 @@
 	b103  VT8615 AGP Bridge
 	b112  VT8361 [KLE133] AGP Bridge
 	b168  VT8235 PCI Bridge
+	b198  VT8237 PCI Bridge
 1107  Stratus Computers
 	0576  VIA VT82C570MV [Apollo] (Wrong vendor ID!)
 1108  Proteon, Inc.
@@ -2936,7 +3224,14 @@
 110a  Siemens Nixdorf AG
 	0002  Pirahna 2-port
 	0005  Tulip controller, power management, switch extender
+	0006  FSC PINC (I/O-APIC)
+	0015  FSC Multiprocessor Interrupt Controller
+	001d  FSC Copernicus Management Controller
+	007b  FSC Remote Service Controller, mailbox device
+	007c  FSC Remote Service Controller, shared memory device
+	007d  FSC Remote Service Controller, SMIC device
 	2102  DSCC4 WAN adapter
+	4021  SIMATIC NET CP 5512 (Profibus and MPI Cardbus Adapter)
 	4942  FPGA I-Bus Tracer for MBD
 	6120  SZB6120
 110b  Chromatic Research Inc.
@@ -3102,10 +3397,16 @@
 	0001  MVC IM-PCI Video frame grabber/processor
 1130  Computervision
 1131  Philips Semiconductors
+	1561  USB 1.1 Host Controller
+	1562  USB 2.0 Host Controller
 	3400  SmartPCI56(UCB1500) 56K Modem
 	7130  SAA7130 Video Broadcast Decoder
+		5168 0138  LiveView FlyVideo 2000
+	7133  SAA7133 Audio+video broadcast decoder
+		5168 0138  LifeView FlyVideo 3000
 # PCI audio and video broadcast decoder (http://www.semiconductors.philips.com/pip/saa7134hl)
 	7134  SAA7134
+	7135  SAA7135 Audio+video broadcast decoder
 	7145  SAA7145
 	7146  SAA7146
 		114b 2003  DVRaptor Video Edit/Capture Card
@@ -3124,24 +3425,59 @@
 	b921  EiconCard P92
 	b922  EiconCard P92
 	b923  EiconCard P92
-	e001  DIVA 20PRO
-		1133 e001  DIVA Pro 2.0 S/T
-	e002  DIVA 20
-		1133 e002  DIVA 2.0 S/T
-	e003  DIVA 20PRO_U
-		1133 e003  DIVA Pro 2.0 U
-	e004  DIVA 20_U
-		1133 e004  DIVA 2.0 U
-	e005  DIVA LOW
-		1133 e005  DIVA 2.01 S/T
-	e00b  Eicon Diva 2.02
-	e010  DIVA Server BRI-2M
-		1133 e010  DIVA Server BRI-2M
-	e012  DIVA Server BRI-8M
-		1133 e012  DIVA Server BRI-8M
-	e014  DIVA Server PRI-30M
-		1133 e014  DIVA Server PRI-30M
-	e018  DIVA Server BRI-2M/-2F
+	e001  Diva Pro 2.0 S/T
+	e002  Diva 2.0 S/T PCI
+	e003  Diva Pro 2.0 U
+	e004  Diva 2.0 U PCI
+	e005  Diva 2.01 S/T PCI
+	e006  Diva CT S/T PCI
+	e007  Diva CT U PCI
+	e008  Diva CT Lite S/T PCI
+	e009  Diva CT Lite U PCI
+	e00a  Diva ISDN+V.90 PCI
+	e00b  Diva 2.02 PCI S/T
+	e00c  Diva 2.02 PCI U
+	e00d  Diva ISDN Pro 3.0 PCI
+	e00e  Diva ISDN+CT S/T PCI Rev 2
+	e010  Diva Server BRI-2M PCI
+		110a 0021  Fujitsu Siemens ISDN S0
+		8001 0014  Diva Server BRI-2M PCI Cornet NQ
+	e011  Diva Server BRI S/T Rev 2
+	e012  Diva Server 4BRI-8M PCI
+		8001 0014  Diva Server 4BRI-8M PCI Cornet NQ
+	e013  Diva Server 4BRI-8M Rev 2
+		8001 0014  Diva Server 4BRI-8M Cornet NQ 2
+	e014  Diva Server PRI-30M PCI
+		0008 0100  Diva Server PRI-30M PCI
+		8001 0014  Diva Server PRI-30M PCI Cornet NQ
+	e015  DIVA Server PRI-30M 2.0
+		8001 0014  Diva Server PRI Cornet NQ 2
+	e016  Diva Server Voice 4BRI PCI
+		8001 0014  Diva Server PRI Cornet NQ
+	e017  Diva Server Voice 4BRI PCI Rev 2
+		8001 0014  Diva Server Voice 4BRI PCI Cornet NQ 2
+	e018  Diva Server BRI 2M Revision 2
+		8001 0014  Diva Server BRI 2M Cornet NQ 2
+	e019  Diva Server Voice PRI PCI Rev 2
+		8001 0014  Diva Server Voice PRI PCI Cornet NQ 2
+	e01a  Diva Server 2FX
+	e01b  Diva Server BRI-2M Voice Revision 2
+		8001 0014  Diva Server BRI-2M Voice Cornet NQ 2
+	e01c  Diva Server PRI Rev 3.0
+		1133 1c01  Diva Server PRI/E1/T1-8 Rev 3.0
+		1133 1c02  Diva Server PRI/T1-24 Rev 3.0
+		1133 1c03  Diva Server PRI/E1-30 Rev 3.0
+		1133 1c04  Diva Server V-PRI/E1/T1 Rev 3.0
+		1133 1c05  Diva Server V-PRI/T1-24 Rev 3.0
+		1133 1c06  Diva Server V-PRI/E1-30 Rev 3.0
+		1133 1c07  Diva Server PRI/E1/T1-8 Cornet NQ 3
+		1133 1c08  Diva Server PRI/T1-24 Cornet NQ 3
+		1133 1c09  Diva Server PRI/E1-30 Cornet NQ 3
+		1133 1c0a  Diva Server V-PRI/E1/T1 Cornet NQ 3
+		1133 1c0b  Diva Server V-PRI/T1-24 Cornet NQ 3
+		1133 1c0c  Diva Server V-PRI/E1-30 Cornet NQ 3
+	e01e  Diva Server 2PRI
+	e020  Diva Server 4PRI
 1134  Mercury Computer Systems
 	0001  Raceway Bridge
 1135  Fuji Xerox Co Ltd
@@ -3209,37 +3545,24 @@
 		1148 5843  FDDI SK-5843 (SK-NET FDDI-LP64)
 		1148 5844  FDDI SK-5844 (SK-NET FDDI-LP64 DAS)
 	4200  Token Ring adapter
-	4300  SK-98xx Gigabit Ethernet Server Adapter
-		1148 9821  SK-9821 Gigabit Ethernet Server Adapter (SK-NET GE-T)
-		1148 9822  SK-9822 Gigabit Ethernet Server Adapter (SK-NET GE-T dual link)
-		1148 9841  SK-9841 Gigabit Ethernet Server Adapter (SK-NET GE-LX)
-		1148 9842  SK-9842 Gigabit Ethernet Server Adapter (SK-NET GE-LX dual link)
-		1148 9843  SK-9843 Gigabit Ethernet Server Adapter (SK-NET GE-SX)
-		1148 9844  SK-9844 Gigabit Ethernet Server Adapter (SK-NET GE-SX dual link)
-		1148 9861  SK-9861 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition)
-		1148 9862  SK-9862 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition dual link)
-		1148 9871  SK-9871 Gigabit Ethernet Server Adapter (SK-NET GE-ZX)
-		1148 9872  SK-9872 Gigabit Ethernet Server Adapter (SK-NET GE-ZX dual link)
-		1259 2970  Allied Telesyn AT-2970SX Gigabit Ethernet Adapter
-		1259 2971  Allied Telesyn AT-2970LX Gigabit Ethernet Adapter
-		1259 2972  Allied Telesyn AT-2970TX Gigabit Ethernet Adapter
-		1259 2973  Allied Telesyn AT-2971SX Gigabit Ethernet Adapter
-		1259 2974  Allied Telesyn AT-2971T Gigabit Ethernet Adapter
-		1259 2975  Allied Telesyn AT-2970SX/2SC Gigabit Ethernet Adapter
-		1259 2976  Allied Telesyn AT-2970LX/2SC Gigabit Ethernet Adapter
-		1259 2977  Allied Telesyn AT-2970TX/2TX Gigabit Ethernet Adapter
-	4320  SK-98xx V2.0 Gigabit Ethernet Adapter
-		1148 0121  Marvell RDK-8001 Adapter
-		1148 0221  Marvell RDK-8002 Adapter
-		1148 0321  Marvell RDK-8003 Adapter
-		1148 0421  Marvell RDK-8004 Adapter
-		1148 0621  Marvell RDK-8006 Adapter
-		1148 0721  Marvell RDK-8007 Adapter
-		1148 0821  Marvell RDK-8008 Adapter
-		1148 0921  Marvell RDK-8009 Adapter
-		1148 1121  Marvell RDK-8011 Adapter
-		1148 1221  Marvell RDK-8012 Adapter
-		1148 3221  SK-9521 V2.0 10/100/1000Base-T Adapter
+	4300  Gigabit Ethernet
+		1148 9821  SK-9821 (1000Base-T single link)
+		1148 9822  SK-9822 (1000Base-T dual link)
+		1148 9841  SK-9841 (1000Base-LX single link)
+		1148 9842  SK-9842 (1000Base-LX dual link)
+		1148 9843  SK-9843 (1000Base-SX single link)
+		1148 9844  SK-9844 (1000Base-SX dual link)
+		1148 9861  SK-9861 (1000Base-SX VF45 single link)
+		1148 9862  SK-9862 (1000Base-SX VF45 dual link)
+# Information got from SysKonnekt
+		1148 9871  SK-9871 (1000Base-ZX single link)
+# Information got from SysKonnekt
+		1148 9872  SK-9872 (1000Base-ZX dual link)
+		1259 2970  AT-2970SX [Allied Telesyn]
+		1259 2972  AT-2970T [Allied Telesyn]
+		1259 2975  AT-2970SX [Allied Telesyn]
+		1259 2977  AT-2970T [Allied Telesyn]
+	4320  SK-98xx Gigabit Ethernet Server Adapter
 		1148 5021  SK-9821 V2.0 Gigabit Ethernet 10/100/1000Base-T Adapter
 		1148 5041  SK-9841 V2.0 Gigabit Ethernet 1000Base-LX Adapter
 		1148 5043  SK-9843 V2.0 Gigabit Ethernet 1000Base-SX Adapter
@@ -3247,8 +3570,7 @@
 		1148 5061  SK-9861 V2.0 Gigabit Ethernet 1000Base-SX Adapter
 		1148 5071  SK-9871 V2.0 Gigabit Ethernet 1000Base-ZX Adapter
 		1148 9521  SK-9521 10/100/1000Base-T Adapter
-	4400 SK-9Dxx Gigabit Ethernet Adapter
-	4500 SK-9Mxx Gigabit Ethernet Adapter
+	4400  Gigabit Ethernet
 1149  Win System Corporation
 114a  VMIC
 	5579  VMIPCI-5579 (Reflective Memory Card)
@@ -3364,6 +3686,7 @@
 	0001  Motion TPEG Recorder/Player with audio
 1166  ServerWorks
 	0005  CNB20-LE Host Bridge
+	0006  CNB20HE Host Bridge
 	0007  CNB20-LE Host Bridge
 	0008  CNB20HE Host Bridge
 	0009  CNB20LE Host Bridge
@@ -3377,14 +3700,20 @@
 	0017  GCNB-LE Host Bridge
 	0200  OSB4 South Bridge
 	0201  CSB5 South Bridge
+		4c53 1080  CT8 mainboard
 	0203  CSB6 South Bridge
 	0211  OSB4 IDE Controller
 	0212  CSB5 IDE Controller
+		4c53 1080  CT8 mainboard
 	0213  CSB6 RAID/IDE Controller
 	0220  OSB4/CSB5 OHCI USB Controller
+		4c53 1080  CT8 mainboard
 	0221  CSB6 OHCI USB Controller
 	0225  GCLE Host Bridge
+# cancelled
+		4c53 1080  CT8 mainboard
 	0227  GCLE-2 Host Bridge
+		4c53 1080  CT8 mainboard
 1167  Mutoh Industries Inc
 1168  Thine Electronics Inc
 1169  Centre for Development of Advanced Computing
@@ -3435,7 +3764,9 @@
 	0465  RL5c465
 	0466  RL5c466
 	0475  RL5c475
+		144d c006  vpr Matrix 170B4 CardBus bridge
 	0476  RL5c476 II
+		1014 0185  ThinkPad A/T/X Series
 		104d 80df  Vaio PCG-FX403
 		104d 80e7  VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
 	0477  RL5c477
@@ -3444,7 +3775,9 @@
 	0522  R5C522 IEEE 1394 Controller
 		1014 01cf  ThinkPad A30p (2653-64G)
 	0551  R5C551 IEEE 1394 Controller
+		144d c006  vpr Matrix 170B4
 	0552  R5C552 IEEE 1394 Controller
+		1014 0511  ThinkPad A/T/X Series
 1181  Telmatics International
 1183  Fujikura Ltd
 1184  Forks Inc
@@ -3460,8 +3793,6 @@
 	1340  DFE-690TXD CardBus PC Card
 	1561  DRP-32TXD Cardbus PC Card
 	4000  DL2K Ethernet
-	4c00  Gigabit Ethernet Adapter
-		1186 4c00  DGE-530T Gigabit Ethernet Adapter
 1187  Advanced Technology Laboratories, Inc.
 1188  Shima Seiki Manufacturing Ltd.
 1189  Matsushita Electronics Co Ltd
@@ -3539,8 +3870,6 @@
 11aa  Actel
 11ab  Galileo Technology Ltd.
 	0146  GT-64010/64010A System Controller
-	4320  Gigabit Ethernet Adapter
-		11ab 9521  Marvell Yukon Gigabit Ethernet 10/100/1000Base-T Adapter
 	4611  GT-64115 System Controller
 	4620  GT-64120/64120A/64121A System Controller
 	4801  GT-48001
@@ -3636,6 +3965,7 @@
 	0443  LT WinModem
 	0444  LT WinModem
 	0445  LT WinModem
+		8086 2203  PRO/100+ MiniPCI (probably an Ambit U98.003.C.00 combo card)
 	0446  LT WinModem
 	0447  LT WinModem
 	0448  WinModem 56k
@@ -3665,6 +3995,7 @@
 	044e  LT WinModem
 	044f  V90 WildWire Modem
 	0450  LT WinModem
+		1033 80a8  Versa Note Vxi
 		144f 4005  Magnia SG20
 	0451  LT WinModem
 	0452  LT WinModem
@@ -3682,6 +4013,8 @@
 	0480  Venus Modem (V90, 56KFlex)
 	5801  USB
 	5802  USS-312 USB Controller
+# 4 port PCI USB Controller made by Agere (formely Lucent)
+	5803  USS-344S USB Controller
 	5811  FW323
 		dead 0800  FireWire Host Bus Adapter
 11c2  Sand Microelectronics
@@ -3784,32 +4117,28 @@
 11fc  Silicon Magic
 11fd  High Street Consultants
 11fe  Comtrol Corporation
-	0001  Rocketport 32 port w/external I/F
-	0002  Rocketport 8 port w/external I/F
-	0003  Rocketport 16 port w/external I/F
-	0004  Rocketport 4 port w/quad cable
-	0005  Rocketport 8 port w/octa cable
-	0006  Rocketport 8 port w/RJ11 connectors
-	0007  Rocketport 4 port w/RJ11 connectors
-	0008  Rocketport 8 port w/ DB78 SNI (Siemens) connector
-	0009  Rocketport 16 port w/ DB78 SNI (Siemens) connector
-	000a  Rocketport Plus 4 port
-	000b  Rocketport Plus 8 port
-	000c  RocketModem 6 port
-	000d  RocketModem 4-port
-	000e  Rocketport Plus 2 port RS232
-	000f  Rocketport Plus 2 port RS422
-	0801  Rocketport UPCI 32 port w/external I/F
-	0802  Rocketport UPCI 8 port w/external I/F
-	0803  Rocketport UPCI 16 port w/external I/F
-	0805  Rocketport UPCI 8 port w/octa cable
-	080C  RocketModem III 8 port
-	080D  RocketModem III 4 port
-	0903  Rocketport Compact PCI 16 port w/external I/F
+	0001  RocketPort 8 Oct
+	0002  RocketPort 8 Intf
+	0003  RocketPort 16 Intf
+	0004  RocketPort 32 Intf
+	0005  RocketPort Octacable
+	0006  RocketPort 8J
+	0007  RocketPort 4-port
+	0008  RocketPort 8-port
+	0009  RocketPort 16-port
+	000a  RocketPort Plus Quadcable
+	000b  RocketPort Plus Octacable
+	000c  RocketPort 8-port Modem
+	8015  RocketPort 4-port UART 16954
 11ff  Scion Corporation
 1200  CSS Corporation
 1201  Vista Controls Corp
 1202  Network General Corp.
+	4300  Gigabit Ethernet Adapter
+		1202 9841  SK-9841 LX
+		1202 9842  SK-9841 LX dual link
+		1202 9843  SK-9843 SX
+		1202 9844  SK-9843 SX dual link
 1203  Bayer Corporation, Agfa Division
 1204  Lattice Semiconductor Corporation
 1205  Array Corporation
@@ -3856,6 +4185,7 @@
 	6933  OZ6933 Cardbus Controller
 		1025 1016  Travelmate 612 TX
 	6972  OZ6912 Cardbus Controller
+		1179 0001  Magnia Z310
 1218  Hybricon Corp.
 1219  First Virtual Corporation
 121a  3Dfx Interactive, Inc.
@@ -3973,6 +4303,8 @@
 		1242 6562  FCX2-6562 Dual Channel PCI-X Fibre Channel Adapter
 		1242 656a  FCX-6562 PCI-X Fibre Channel Adapter
 	4643  FCI-1063 Fibre Channel Adapter
+	6562  FCX2-6562 Dual Channel PCI-X Fibre Channel Adapter
+	656a  FCX-6562 PCI-X Fibre Channel Adapter
 1243  Delphax
 1244  AVM Audiovisuelles MKTG & Computer System GmbH
 	0700  B1 ISDN
@@ -4033,6 +4365,7 @@
 		1014 0166  ES1969 SOLO-1 AudioDrive on IBM Aptiva Mainboard
 		125d 8888  Solo-1 Audio Adapter
 	1978  ES1978 Maestro 2E
+		0e11 b112  Armada M700/E500
 		1033 803c  ES1978 Maestro-2E Audiodrive
 		1033 8058  ES1978 Maestro-2E Audiodrive
 		1092 4000  Monster Sound MX400
@@ -4043,6 +4376,7 @@
 	1989  ESS Modem
 		125d 1989  ESS Modem
 	1998  ES1983S Maestro-3i PCI Audio Accelerator
+		1028 00b1  Latitude C600
 		1028 00e6  ES1983S Maestro-3i (Dell Inspiron 8100)
 	1999  ES1983S Maestro-3i PCI Modem Accelerator
 	199a  ES1983S Maestro-3i PCI Audio Accelerator
@@ -4065,8 +4399,9 @@
 	3873  Prism 2.5 Wavelan chipset
 		1186 3501  DWL-520 Wireless PCI Adapter
 		1668 0414  HWP01170-01 802.11b PCI Wireless Adapter
-		1737 3874  WMP11 Wireless 802.11b PCI Adaptor
+		1737 3874  WMP11 Wireless 802.11b PCI Adapter
 		8086 2513  Wireless 802.11b MiniPCI Adapter
+	3890  D-Links DWL-g650 A1
 	8130  HMP8130 NTSC/PAL Video Decoder
 	8131  HMP8131 NTSC/PAL Video Decoder
 1261  Matsushita-Kotobuki Electronics Industries, Ltd.
@@ -4092,6 +4427,7 @@
 	0710  SM710 LynxEM
 	0712  SM712 LynxEM+
 	0720  SM720 Lynx3DM
+	0730  SM731 Cougar3DR
 	0810  SM810 LynxE
 	0811  SM811 LynxE
 	0820  SM820 Lynx3D
@@ -4102,6 +4438,7 @@
 1273  Hughes Network Systems
 	0002  DirecPC
 1274  Ensoniq
+	1171  ES1373 [AudioPCI] (also Creative Labs CT5803)
 	1371  ES1371 [AudioPCI-97]
 		0e11 0024  AudioPCI on Motherboard Compaq Deskpro
 		0e11 b1a7  ES1371, ES1373 AudioPCI
@@ -4171,6 +4508,7 @@
 1277  Comstream
 1278  Transtech Parallel Systems Ltd.
 	0701  TPE3/TM3 PowerPC Node
+	0710  TPE5 PowerPC PCI board
 1279  Transmeta Corporation
 	0295  Northbridge
 	0395  LongRun Northbridge
@@ -4366,6 +4704,7 @@
 		12ae 0001  Gigabit Ethernet-SX (Universal)
 		1410 0104  Gigabit Ethernet-SX PCI Adapter
 	0002  AceNIC Gigabit Ethernet (Copper)
+		10a9 8002  Acenic Gigabit Ethernet
 		12ae 0002  Gigabit Ethernet-T (3C986-T)
 12af  TDK USA Corp
 12b0  Jorge Scientific Corp
@@ -4377,7 +4716,7 @@
 12b6  Natural Microsystems
 12b7  Cognex Modular Vision Systems Div. - Acumen Inc.
 12b8  Korg
-12b9  US Robotics/3Com
+12b9  5610 56K FaxModem
 	1006  WinModem
 		12b9 005c  USR 56k Internal Voice WinModem (Model 3472)
 		12b9 005e  USR 56k Internal WinModem (Models 662975)
@@ -4460,16 +4799,20 @@
 	00a0  ITNT2
 12d3  Vingmed Sound A/S
 12d4  Ulticom (Formerly DGM&S)
+	0200  T1 Card
 12d5  Equator Technologies
 12d6  Analogic Corp
 12d7  Biotronic SRL
 12d8  Pericom Semiconductor
 12d9  Aculab PLC
+	0002  PCI Prosody
+	0004  cPCI Prosody
 12da  True Time Inc.
 12db  Annapolis Micro Systems, Inc
 12dc  Symicron Computer Communication Ltd.
 12dd  Management Graphics
 12de  Rainbow Technologies
+	0200  CryptoSwift CS200
 12df  SBS Technologies Inc
 12e0  Chase Research
 	0010  ST16C654 Quad UART
@@ -4582,6 +4925,7 @@
 	0036  PCI-DAS64/M2/16
 	0037  PCI-DAS64/M3/16
 	004c  PCI-DAS1000
+	004d  PCI-QUAD04
 1308  Jato Technologies Inc.
 	0001  NetCelerator Adapter
 		1308 0001  NetCelerator Adapter
@@ -4667,8 +5011,13 @@
 132d  Integrated Silicon Solution, Inc.
 1330  MMC Networks
 1331  Radisys Corp.
+	8200  82600 Host Bridge
+	8201  82600 IDE
+	8202  82600 USB
+	8210  82600 PCI Bridge
 1332  Micro Memory
 	5415  MM-5415CN PCI Memory Module with Battery Backup
+	5425  MM-5425CN PCI 64/66 Memory Module with Battery Backup
 1334  Redcreek Communications, Inc
 1335  Videomail, Inc
 1337  Third Planet Publishing
@@ -4694,6 +5043,7 @@
 134c  Chori Joho System Co. Ltd
 134d  PCTel Inc
 	7890  HSP MicroModem 56
+		134d 0001  PCT789 adapter
 	7891  HSP MicroModem 56
 		134d 0001  HSP MicroModem 56
 	7892  HSP MicroModem 56
@@ -4753,13 +5103,12 @@
 1369  Digigram
 136a  High Soft Tech
 136b  Kawasaki Steel Corporation
+	ff01  KL5A72002 Motion JPEG
 136c  Adtek System Science Co Ltd
 136d  Gigalabs Inc
 136f  Applied Magic Inc
 1370  ATL Products
 1371  CNet Technology Inc
-	434e  GigaCard Network Adapter
-		1371 434e  N-Way PCI-Bus Giga-Card 1000/100/10Mbps(L)
 1373  Silicon Vision Inc
 1374  Silicom Ltd
 1375  Argosystems Inc
@@ -4780,6 +5129,7 @@
 1384  Reality Simulation Systems Inc
 1385  Netgear
 	4100  802.11b Wireless Adapter (MA301)
+	4105  MA311 802.11b wireless adapter
 	620a  GA620
 	622a  GA622
 	630a  GA630
@@ -4889,6 +5239,8 @@
 13ce  Cocom A/S
 13cf  Studio Audio & Video Ltd
 13d0  Techsan Electronics Co Ltd
+# http://www.b2c2inc.com/products/pc-specs.html
+	2103  B2C2 Sky2PC PCI [SkyStar2]
 13d1  Abocom Systems Inc
 	ab02  ADMtek Centaur-C rev 17 [D-Link DFE-680TX] CardBus Fast Ethernet Adapter
 	ab06  RTL8139 [FE2000VX] CardBus Fast Ethernet Attached Port Adapter
@@ -4917,7 +5269,7 @@
 13e6  Argosy research Inc
 13e7  NAC Incorporated
 13e8  Chip Express Corporation
-13e9  Chip Express Corporation
+13e9  Intraserver Technology Inc
 13ea  Dallas Semiconductor
 13eb  Hauppauge Computer Works Inc
 13ec  Zydacron Inc
@@ -4939,9 +5291,11 @@
 		13f6 0101  CMI8338-031 PCI Audio Device
 	0111  CM8738
 		1019 0970  P6STP-FL motherboard
+		1043 8035  CUSI-FX motherboard
 		1043 8077  CMI8738 6-channel audio controller
 		1043 80e2  CMI8738 6ch-MX
 		13f6 0111  CMI8738/C3DX PCI Audio Device
+		1681 a000  Gamesurround MUSE XL
 	0211  CM8738
 13f7  Wildfire Communications
 13f8  Ad Lib Multimedia Inc
@@ -4965,8 +5319,6 @@
 	0100  Lava Dual Serial
 	0101  Lava Quatro A
 	0102  Lava Quatro B
-	0180  Lava Octo A
-	0181  Lava Octo B
 	0200  Lava Port Plus
 	0201  Lava Quad A
 	0202  Lava Quad B
@@ -5014,6 +5366,8 @@
 141e  Fanuc Ltd
 141f  Visiontech Ltd
 1420  Psion Dacom plc
+	8002  Gold Card NetGlobal 56k+10/100Mb CardBus (Ethernet part)
+	8003  Gold Card NetGlobal 56k+10/100Mb CardBus (Modem part)
 1421  Ads Technologies Inc
 1422  Ygrec Systems Co Ltd
 1423  Custom Technology Corp.
@@ -5088,7 +5442,7 @@
 	0001  NextMove PCI
 1460  DYNARC INC
 1461  Avermedia Technologies Inc
-1462  Micro-star International Co Ltd
+1462  Micro-Star International Co., Ltd.
 1463  Fast Corporation
 1464  Interactive Circuits & Systems Ltd
 1465  GN NETTEST Telecom DIV.
@@ -5099,6 +5453,7 @@
 146a  IFR
 146b  Parascan Technologies Ltd
 146c  Ruby Tech Corp.
+	1430  FE-1430TX Fast Ethernet PCI Adapter
 146d  Tachyon, INC.
 146e  Williams Electronics Games, Inc.
 146f  Multi Dimensional Consulting Inc
@@ -5149,6 +5504,7 @@
 149b  SEIKO Instruments Inc
 149c  OVISLINK Corp.
 149d  NEWTEK Inc
+	0001  Video Toaster for PC
 149e  Mapletree Networks Inc.
 149f  LECTRON Co Ltd
 14a0  SOFTING GmBH
@@ -5175,6 +5531,14 @@
 	0000  DSL NIC
 14b4  PHILIPS Business Electronics B.V.
 14b5  Creamware GmBH
+	0200  Scope
+	0300  Pulsar
+	0400  Pulsar2
+	0600  Pulsar2
+	0800  DSP-Board
+	0900  DSP-Board
+	0a00  DSP-Board
+	0b00  DSP-Board
 14b6  Quantum Data Corp.
 14b7  PROXIM Inc
 	0001  Symphony 4110
@@ -5283,6 +5647,9 @@
 		0e11 009a  NC7770 Gigabit Server Adapter (PCI-X, 10/100/1000-T)
 		0e11 00c1  NC6770 Gigabit Server Adapter (PCI-X, 1000-SX)
 		1028 0121  Broadcom BCM5701 1000Base-T
+		10a9 8010  SGI IO9 Gigabit Ethernet (Copper)
+		10a9 8011  SGI Gigabit Ethernet (Copper)
+		10a9 8012  SGI Gigabit Ethernet (Fiber)
 		10b7 1004  3C996-SX 1000Base-SX
 		10b7 1006  3C996B-T 1000Base-T
 		10b7 1007  3C1000-T 1000Base-T
@@ -5300,6 +5667,7 @@
 	1647  NetXtreme BCM5703 Gigabit Ethernet
 		0e11 0099  NC7780 1000BaseTX
 		0e11 009a  NC7770 1000BaseTX
+		10a9 8010  SGI IO9 Gigabit Ethernet (Copper)
 		14e4 0009  BCM5703 1000BaseTX
 		14e4 000a  BCM5703 1000BaseSX
 		14e4 000b  BCM5703 1000BaseTX
@@ -5312,13 +5680,9 @@
 		10b7 2000  3C998-T Dual Port 10/100/1000 PCI-X
 		10b7 3000  3C999-T Quad Port 10/100/1000 PCI-X
 		1166 1648  NetXtreme CIOB-E 1000Base-T
-	1649  NetXtreme BCM5704S Gigabit Ethernet
 	164d  NetXtreme BCM5702FE Gigabit Ethernet
 	1653  NetXtreme BCM5705 Gigabit Ethernet
-	1654  NetXtreme BCM5705 Gigabit Ethernet
 	165d  NetXtreme BCM5705M Gigabit Ethernet
-	165e  NetXtreme BCM5705M Gigabit Ethernet
-	166e  NetXtreme BCM5705F Gigabit Ethernet
 	1696  NetXtreme BCM5782 Gigabit Ethernet
 		14e4 000d  NetXtreme BCM5782 1000Base-T
 	169c  NetXtreme BCM5788 Gigabit Ethernet
@@ -5343,13 +5707,14 @@
 	16c7  NetXtreme BCM5703 Gigabit Ethernet
 		14e4 0009  NetXtreme BCM5703 1000Base-T
 		14e4 000a  NetXtreme BCM5703 1000Base-SX
-	170d  NetXtreme BCM5901 Gigabit Ethernet
-	170e  NetXtreme BCM5901 Gigabit Ethernet
 	4210  BCM4210 iLine10 HomePNA 2.0
 	4211  BCM4211 iLine10 HomePNA 2.0 + V.90 56k modem
 	4212  BCM4212 v.90 56k modem
 	4301  BCM4301 802.11b
+	4320  BCM94306 802.11g
+		1737 4320  WPC54G
 	4401  BCM4401 100Base-T
+		1043 80a8  A7V8X motherboard
 	4402  BCM4402 Integrated 10/100BaseT
 	4410  BCM4413 iLine32 HomePNA 2.0
 	4411  BCM4413 V.90 56k modem
@@ -5438,6 +5803,9 @@
 		122d 4302  Dell MP3930V-W(C) MiniPCI
 	1610  ADSL AccessRunner PCI Arbitration Device
 	1611  AccessRunner PCI ADSL Interface Device
+	1620  ADSL AccessRunner V2 PCI Arbitration Device
+	1621  AccessRunner V2 PCI ADSL Interface Device
+	1622  AccessRunner V2 PCI ADSL Yukon WAN Adapter
 	1803  HCF 56k Modem
 		0e11 0023  623-LAN Grizzly
 		0e11 0043  623-LAN Yogi
@@ -5503,11 +5871,6 @@
 		14f1 2004  Dynalink 56PMi
 	8234  RS8234 ATM SAR Controller [ServiceSAR Plus]
 14f2  MOBILITY Electronics
-	0120  EV1000 bridge
-	0121  EV1000 Parallel port
-	0122  EV1000 Serial port
-	0123  EV1000 Keyboard controller
-	0124  EV1000 Mouse controller
 14f3  BROADLOGIC
 14f4  TOKYO Electronic Industry CO Ltd
 14f5  SOPAC Ltd
@@ -5580,6 +5943,8 @@
 		1522 0400  RockForceDUO+ 2 Port V.92/V.44 Data/Fax/Voice Modem
 		1522 0500  RockForceQUATRO+ 4 Port V.92/V.44 Data/Fax/Voice Modem
 		1522 0600  RockForce+ 2 Port V.90 Data/Fax/Voice Modem
+		1522 0700  RockForce+ 4 Port V.90 Data/Fax/Voice Modem
+		1522 0800  RockForceOCTO+ 8 Port V.92/V.44 Data/Fax/Voice Modem
 1523  MUSIC Semiconductors
 1524  ENE Technology Inc
 	1211  CB1211 Cardbus Controller
@@ -5616,6 +5981,7 @@
 1541  MACHONE Communications
 1542  VIVID Technology Inc
 1543  SILICON Laboratories
+	3052  Intel 537 [Winmodem]
 	4c22  Si3036 MC'97 DAA
 1544  DCM DATA Systems
 1545  VISIONTEK
@@ -5856,6 +6222,7 @@
 1638  Standard Microsystems Corp [SMC]
 	1100  SMC2602W EZConnect / Addtron AWA-100
 163c  Smart Link Ltd.
+	3052  SmartLink SmartPCI562 56K Modem
 	5449  SmartPCI561 Modem
 1657  Brocade Communications Systems, Inc.
 165a  Epix Inc
@@ -5869,6 +6236,8 @@
 16ab  Global Sun Technology Inc
 	1102  PCMCIA-to-PCI Wireless Network Bridge
 16be  Creatix Polymedia GmbH
+16ca  CENATEK Inc
+	0001  Rocket Drive DL
 16ec  U.S. Robotics
 	3685  Wireless Access PCI Adapter Model 022415
 16f6  VideoTele.com, Inc.
@@ -5877,16 +6246,10 @@
 170c  YottaYotta Inc.
 172a  Accelerated Encryption
 1737  Linksys
-	1032  Gigabit Network Adapter
-		1737 0015  EG1032 v2 Instant Gigabit Network Adapter
-	1064  Gigabit Network Adapter
-		1737 0016  EG1064 v2 Instant Gigabit Network Adapter
 173b  Altima (nee Broadcom)
 	03e8  AC1000 Gigabit Ethernet
-	03e9  AC1001 Gigabit Ethernet
 	03ea  AC9100 Gigabit Ethernet
 		173b 0001  AC1002
-	03eb  AC1003 Gigabit Ethernet
 1743  Peppercon AG
 	8139  ROL/F-100 Fast Ethernet Adapter with ROL
 174b  PC Partner Limited
@@ -5902,6 +6265,8 @@
 	0006  AMCC HOTlink
 1799  Belkin
 17af  Hightech Information System Ltd.
+17cc  NetChip Technology, Inc
+	2280  USB 2.0
 1813  Ambient Technologies Inc
 	4000  HaM controllerless modem
 		16be 0001  V9x HAM Data Fax Modem
@@ -5909,6 +6274,11 @@
 		16be 0002  V9x HAM 1394
 1851  Microtune, Inc.
 1852  Anritsu Corp.
+1888  Varisys Ltd
+	0301  VMFX1 FPGA PMC module
+	0601  VSM2 dual PMC carrier
+	0710  VS14x series PowerPC PCI board
+	0720  VS24x series PowerPC PCI board
 1a08  Sierra semiconductor
 	0000  SC15064
 1b13  Jaton Corp
@@ -5921,7 +6291,12 @@
 	2020  DC-390
 	690c  690c
 	dc29  DC290
+1fc0  Tumsan Oy
+	0300  E2200 Dual E1/Rawpipe Card
+2000  Smart Link Ltd.
 2001  Temporal Research Ltd
+2003  Smart Link Ltd.
+2004  Smart Link Ltd.
 21c3  21st Century Computer Corp.
 2348  Racore
 	2010  8142 100VG/AnyLAN
@@ -5933,7 +6308,15 @@
 3000  Hansol Electronics Inc.
 3142  Post Impression Systems.
 3388  Hint Corp
-	0021  HB1-SE33 PCI-PCI Bridge
+	0013  HiNT HC4 PCI to ISDN bridge, Multimedia audio controller
+	0014  HiNT HC4 PCI to ISDN bridge, Network controller
+	0020  HB6 Universal PCI-PCI bridge (transparent mode)
+	0021  HB6 Universal PCI-PCI bridge (non-transparent mode)
+		4c53 1050  CT7 mainboard
+		4c53 1080  CT8 mainboard
+		4c53 3010  PPCI mezzanine (32-bit PMC)
+	101a  E.Band [AudioTrak Inca88]
+	101b  E.Band [AudioTrak Inca88]
 	8011  VXPro II Chipset
 		3388 8011  VXPro II Chipset CPU to PCI Bridge
 	8012  VXPro II Chipset
@@ -5993,6 +6376,7 @@
 	0100  AladdinCARD
 	0200  CPC
 4444  Internext Compression Inc
+	0803  iTVC15 MPEG-2 Encoder
 4468  Bridgeport machines
 4594  Cogetec Informatique Inc
 45fb  Baldor Electric Company
@@ -6038,6 +6422,7 @@
 5143  Qualcomm Inc
 5145  Ensoniq (Old)
 	3031  Concert AudioPCI
+5168  Animation Technologies Inc.
 5301  Alliance Semiconductor Corp.
 	0001  ProMotion aT3D
 5333  S3 Inc.
@@ -6148,6 +6533,7 @@
 	8c12  86C270-294 Savage/IX-MV
 		1014 017f  ThinkPad T20
 	8c13  86C270-294 Savage/IX
+		1179 0001  Magnia Z310
 	8c22  SuperSavage MX/128
 	8c24  SuperSavage MX/64
 	8c26  SuperSavage MX/64C
@@ -6158,10 +6544,10 @@
 	8c2e  SuperSavage IX/C SDR
 		1014 01fc  ThinkPad T23 (2647-4MG)
 	8c2f  SuperSavage IX/C DDR
-# Integrated in VIA ProSavage PN133 North Bridge
-	8d01  VT8603 [ProSavage PN133] AGP4X VGA Controller (Twister)
+	8d01  86C380 [ProSavageDDR K4M266]
 	8d02  VT8636A [ProSavage KN133] AGP4X VGA Controller (TwisterK)
-	8d04  VT8751 [ProSavageDDR P4M266] VGA Controller
+	8d03  VT8751 [ProSavageDDR P4M266]
+	8d04  VT8375 [ProSavage8 KM266/KL266]
 	9102  86C410 Savage 2000
 		1092 5932  Viper II Z200
 		1092 5934  Viper II Z200
@@ -6173,6 +6559,7 @@
 		1092 5a57  Viper II Z200
 	ca00  SonicVibes
 544c  Teralogic Inc
+	0350  TL880-based HDTV/ATSC tuner
 5455  Technische University Berlin
 	4458  S5933
 5519  Cnet Technologies, Inc.
@@ -6180,6 +6567,7 @@
 	0001  I-30xx Scanner Interface
 5555  Genroco, Inc
 	0003  TURBOstor HFP-832 [HiPPI NIC]
+5654  VoiceTronix Pty Ltd
 5700  Netpower
 6356  UltraStor
 6374  c't Magazin für Computertechnik
@@ -6255,13 +6643,14 @@
 	1029  82559 Ethernet Controller
 	1030  82559 InBusiness 10/100
 	1031  82801CAM (ICH3) PRO/100 VE (LOM) Ethernet Controller
-		1014 0209  ThinkPad A30p/T30
+		1014 0209  ThinkPad A/T/X Series
 		104d 80e7  Vaio PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
 		107b 5350  EtherExpress PRO/100 VE
 		1179 0001  EtherExpress PRO/100 VE
 		144d c000  EtherExpress PRO/100 VE
 		144d c001  EtherExpress PRO/100 VE
 		144d c003  EtherExpress PRO/100 VE
+		144d c006  vpr Matrix 170B4
 	1032  82801CAM (ICH3) PRO/100 VE Ethernet Controller
 	1033  82801CAM (ICH3) PRO/100 VM (LOM) Ethernet Controller
 	1034  82801CAM (ICH3) PRO/100 VM Ethernet Controller
@@ -6277,18 +6666,20 @@
 	103e  82801BD PRO/100 VM (MOB) Ethernet Controller
 	1040  536EP Data Fax Modem
 		16be 1040  V.9X DSP Data Fax Modem
-	1048  82597EX 10GbE Ethernet Controller
-		8086 a01f  PRO/10GbE LR Server Adapter
-		8086 a11f  PRO/10GbE LR Server Adapter
+	1043  PRO/Wireless LAN 2100 3B Mini PCI Adapter
 	1059  82551QM Ethernet Controller
 	1130  82815 815 Chipset Host Bridge and Memory Controller Hub
 		1025 1016  Travelmate 612 TX
 		1043 8027  TUSL2-C Mainboard
 		104d 80df  Vaio PCG-FX403
+		8086 4532  D815EEA2 mainboard
+		8086 4557  D815EGEW Mainboard
 	1131  82815 815 Chipset AGP Bridge
 	1132  82815 CGC [Chipset Graphics Controller]
 		1025 1016  Travelmate 612 TX
 		104d 80df  Vaio PCG-FX403
+		8086 4532  D815EEA2 Mainboard
+		8086 4557  D815EGEW Mainboard
 	1161  82806AA PCI64 Hub Advanced Programmable Interrupt Controller
 		8086 1161  82806AA PCI64 Hub APIC
 	1162  Xscale 80200 Big Endian Companion Chip
@@ -6473,6 +6864,7 @@
 		8086 8000  82806AA PCI64 Hub Controller (HRes)
 	1460  82870P2 P64H2 Hub PCI Bridge
 	1461  82870P2 P64H2 I/OxAPIC
+		15d9 3480  P4DP6
 	1462  82870P2 P64H2 Hot Plug Controller
 	1960  80960RP [i960RP Microprocessor]
 		101e 0431  MegaRAID 431 RAID Controller
@@ -6524,23 +6916,33 @@
 	2428  82801AB PCI Bridge
 	2440  82801BA ISA Bridge (LPC)
 	2442  82801BA/BAM USB (Hub #1)
+		1014 01c6  Netvista A40/A40p
+		1025 1016  Travelmate 612 TX
 		104d 80df  Vaio PCG-FX403
 		147b 0507  TH7II-RAID
+		8086 4532  D815EEA2 mainboard
+		8086 4557  D815EGEW Mainboard
 	2443  82801BA/BAM SMBus
+		1014 01c6  Netvista A40/A40p
 		1025 1016  Travelmate 612 TX
 		1043 8027  TUSL2-C Mainboard
 		104d 80df  Vaio PCG-FX403
 		147b 0507  TH7II-RAID
+		8086 4532  D815EEA2 mainboard
+		8086 4557  D815EGEW Mainboard
 	2444  82801BA/BAM USB (Hub #2)
 		1025 1016  Travelmate 612 TX
 		104d 80df  Vaio PCG-FX403
 		147b 0507  TH7II-RAID
+		8086 4532  D815EEA2 mainboard
 	2445  82801BA/BAM AC'97 Audio
+		1014 01c6  Netvista A40/A40p
 		1025 1016  Travelmate 612 TX
 		104d 80df  Vaio PCG-FX403
 		1462 3370  STAC9721 AC
 		147b 0507  TH7II-RAID
-	2446  82801BA/BAM AC'97 Modem
+		8086 4557  D815EGEW Mainboard
+	2446  Intel 537 [82801BA/BAM AC'97 Modem]
 		1025 1016  Travelmate 612 TX
 		104d 80df  Vaio PCG-FX403
 	2448  82801BAM/CAM PCI Bridge
@@ -6558,8 +6960,12 @@
 		1014 023d  EtherExpress PRO/100 VE
 		1014 0244  EtherExpress PRO/100 VE
 		1014 0245  EtherExpress PRO/100 VE
+		1014 0265  PRO/100 VE Desktop Connection
+		1014 0267  PRO/100 VE Desktop Connection
+		1014 026a  PRO/100 VE Desktop Connection
 		109f 315d  EtherExpress PRO/100 VE
 		109f 3181  EtherExpress PRO/100 VE
+		1179 ff01  PRO/100 VE Network Connection
 		1186 7801  EtherExpress PRO/100 VE
 		144d 2602  HomePNA 1M CNR
 		8086 3010  EtherExpress PRO/100 VE
@@ -6575,10 +6981,13 @@
 		1025 1016  Travelmate 612TX
 		104d 80df  Vaio PCG-FX403
 	244b  82801BA IDE U100
+		1014 01c6  Netvista A40/A40p
 		1043 8027  TUSL2-C Mainboard
 		147b 0507  TH7II-RAID
+		8086 4532  D815EEA2 mainboard
+		8086 4557  D815EGEW Mainboard
 	244c  82801BAM ISA Bridge (LPC)
-	244e  82801BA/CA/DB PCI Bridge
+	244e  82801BA/CA/DB/EB PCI Bridge
 	2450  82801E ISA Bridge (LPC)
 	2452  82801E USB
 	2453  82801E SMBus
@@ -6586,44 +6995,80 @@
 	245b  82801E IDE U100
 	245d  82801E Ethernet Controller 1
 	245e  82801E PCI Bridge
-	2480  82801CA ISA Bridge (LPC)
+	2480  82801CA LPC Interface Controller
 	2482  82801CA/CAM USB (Hub #1)
-		1014 0220  ThinkPad T23/A30p/T30
+		1014 0220  ThinkPad A/T/X Series
 		104d 80e7  VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
-	2483  82801CA/CAM SMBus
-		1014 0220  ThinkPad T23/A30p/T30
+		15d9 3480  P4DP6
+		8086 1958  vpr Matrix 170B4
+	2483  82801CA/CAM SMBus Controller
+		1014 0220  ThinkPad A/T/X Series
 		104d 80e7  VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
+		15d9 3480  P4DP6
+		8086 1958  vpr Matrix 170B4
 	2484  82801CA/CAM USB (Hub #2)
-		1014 0220  ThinkPad T23/A30p/T30
+		1014 0220  ThinkPad A/T/X Series
 		104d 80e7  VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
-	2485  82801CA/CAM AC'97 Audio
+		15d9 3480  P4DP6
+		8086 1958  vpr Matrix 170B4
+	2485  82801CA/CAM AC'97 Audio Controller
 		1014 0222  ThinkPad T23 (2647-4MG) or A30p (2653-64G)
 		1014 0508  ThinkPad T30
+		1014 051c  ThinkPad A/T/X Series
 		104d 80e7  VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
-	2486  82801CA/CAM AC'97 Modem
-		1014 0223  ThinkPad A30p (2653-64G)
+		144d c006  vpr Matrix 170B4
+	2486  82801CA/CAM AC'97 Modem Controller
+		1014 0223  ThinkPad A/T/X Series
 		1014 0503  ThinkPad R31 2656BBG
-		1014 051a  ThinkPad T30
+		1014 051a  ThinkPad A/T/X Series
 		104d 80e7  VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
+		1179 0001  Toshiba Satellite 1110 Z15 internal Modem
 		134d 4c21  Dell Inspiron 2100 internal modem
+		144d 2115  vpr Matrix 170B4 internal modem
 		14f1 5421  MD56ORD V.92 MDC Modem
 	2487  82801CA/CAM USB (Hub #3)
-		1014 0220  ThinkPad T23/A30p/T30
+		1014 0220  ThinkPad A/T/X Series
 		104d 80e7  VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
+		15d9 3480  P4DP6
+		8086 1958  vpr Matrix 170B4
 	248a  82801CAM IDE U100
-		1014 0220  ThinkPad T23/A30p/T30
+		1014 0220  ThinkPad A/T/X Series
 		104d 80e7  VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
-	248b  82801CA IDE U100
+		8086 1958  vpr Matrix 170B4
+	248b  82801CA Ultra ATA Storage Controller
+		15d9 3480  P4DP6
 	248c  82801CAM ISA Bridge (LPC)
-	24c0  82801DB ISA Bridge (LPC)
+	24c0  82801DB LPC Interface Controller
+		1462 5800  845PE Max (MS-6580)
 	24c2  82801DB USB (Hub #1)
-	24c3  82801DB SMBus
+		1462 5800  845PE Max (MS-6580)
+	24c3  82801DB/DBM SMBus Controller
+		1462 5800  845PE Max (MS-6580)
 	24c4  82801DB USB (Hub #2)
-	24c5  82801DB AC'97 Audio
-	24c6  82801DB AC'97 Modem
+		1462 5800  845PE Max (MS-6580)
+	24c5  82801DB AC'97 Audio Controller
+		1462 5800  845PE Max (MS-6580)
+	24c6  82801DB AC'97 Modem Controller
 	24c7  82801DB USB (Hub #3)
-	24cb  82801DB ICH4 IDE
-	24cd  82801DB USB EHCI Controller
+		1462 5800  845PE Max (MS-6580)
+	24ca  82801DBM Ultra ATA Storage Controller
+	24cb  82801DB Ultra ATA Storage Controller
+		1462 5800  845PE Max (MS-6580)
+	24cc  82801DBM LPC Interface Controller
+	24cd  82801DB USB2
+		1462 3981  845PE Max (MS-6580) Onboard USB EHCI Controller
+	24d0  82801EB LPC Interface Controller
+	24d1  82801EB Ultra ATA Storage Controller
+	24d2  82801EB USB
+	24d3  82801EB SMBus Controller
+	24d4  82801EB USB
+	24d5  82801EB AC'97 Audio Controller
+	24d6  82801EB AC'97 Modem Controller
+	24d7  82801EB USB
+	24db  82801EB Ultra ATA Storage Controller
+	24dc  82801EB LPC Interface Controller
+	24dd  82801EB USB2
+	24de  82801EB USB
 	2500  82820 820 (Camino) Chipset Host Bridge (MCH)
 		1028 0095  Precision Workstation 220 Chipset
 		1043 801c  P3C-2000 system chipset
@@ -6639,24 +7084,48 @@
 	2532  82850 850 (Tehama) Chipset AGP Bridge
 	2533  82860 860 (Wombat) Chipset AGP Bridge
 	2534  82860 860 (Wombat) Chipset PCI Bridge
-	2540  e7500 [Plumas] DRAM Controller
-	2541  e7500 [Plumas] DRAM Controller Error Reporting
-	2543  e7500 [Plumas] HI_B Virtual PCI Bridge (F0)
-	2544  e7500 [Plumas] HI_B Virtual PCI Bridge (F1)
-	2545  e7500 [Plumas] HI_C Virtual PCI Bridge (F0)
-	2546  e7500 [Plumas] HI_C Virtual PCI Bridge (F1)
-	2547  e7500 [Plumas] HI_D Virtual PCI Bridge (F0)
-	2548  e7500 [Plumas] HI_D Virtual PCI Bridge (F1)
+	2540  E7500 Memory Controller Hub
+		15d9 3480  P4DP6
+	2541  E7000 Series Host RASUM Controller
+		15d9 3480  P4DP6
+	2543  E7000 Series Hub Interface B PCI-to-PCI Bridge
+	2544  E7000 Series Hub Interface B RASUM Controller
+	2545  E7000 Series Hub Interface C PCI-to-PCI Bridge
+	2546  E7000 Series Hub Interface C RASUM Controller
+	2547  E7000 Series Hub Interface D PCI-to-PCI Bridge
+	2548  E7000 Series Hub Interface D RASUM Controller
+	254c  E7501 Memory Controller Hub
+	2550  E7505 Memory Controller Hub
+	2551  E7000 Series RAS Controller
+	2552  E7000 Series Processor to AGP Controller
+	2553  E7000 Series Hub Interface B PCI-to-PCI Bridge
+	2554  E7000 Series Hub Interface B PCI-to-PCI Bridge RAS Controller
+	255d  E7205 Memory Controller Hub
 	2560  82845G/GL [Brookdale-G] Chipset Host Bridge
+		1462 5800  845PE Max (MS-6580)
 	2561  82845G/GL [Brookdale-G] Chipset AGP Bridge
 	2562  82845G/GL [Brookdale-G] Chipset Integrated Graphics Device
+	2570  82865G/PE/P Processor to I/O Controller
+	2571  82865G/PE/P Processor to AGP Controller
+	2572  82865G Integrated Graphics Device
+	2573  82865G/PE/P Processor to PCI to CSA Bridge
+	2576  82864G/PE/P Processor to I/O Memory Interface
+	2578  82875P Memory Controller Hub
+	2579  82875P Processor to AGP Controller
+	257b  82875P Processor to PCI to CSA Bridge
+	257e  82875P Processor to I/O Memory Interface
 	3092  Integrated RAID
+	3340  82855PM Processor to I/O Controller
+	3341  82855PM Processor to AGP Controller
 	3575  82830 830 Chipset Host Bridge
-		1014 021d  ThinkPad T23 (2647-4MG) or A30p (2653-64G)
+		1014 021d  ThinkPad A/T/X Series
 		104d 80e7  VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
 	3576  82830 830 Chipset AGP Bridge
 	3577  82830 CGC [Chipset Graphics Controller]
+		1014 0513  ThinkPad A/T/X Series
 	3578  82830 830 Chipset Host Bridge
+	3580  82852/855GM Host Bridge
+	3582  82852/855GM Integrated Graphics Device
 	5200  EtherExpress PRO/100 Intelligent Server
 	5201  EtherExpress PRO/100 Intelligent Server
 		8086 0001  EtherExpress PRO/100 Server Ethernet Adapter
@@ -6672,6 +7141,7 @@
 	7113  82371AB/EB/MB PIIX4 ACPI
 	7120  82810 GMCH [Graphics Memory Controller Hub]
 	7121  82810 CGC [Chipset Graphics Controller]
+		8086 4341  Cayman (CA810) Mainboard
 	7122  82810 DC-100 GMCH [Graphics Memory Controller Hub]
 	7123  82810 DC-100 CGC [Chipset Graphics Controller]
 	7124  82810E DC-133 GMCH [Graphics Memory Controller Hub]
@@ -6683,6 +7153,7 @@
 	7181  440LX/EX - 82443LX/EX AGP bridge
 	7190  440BX/ZX/DX - 82443BX/ZX/DX Host bridge
 		0e11 0500  Armada 1750 Laptop System Chipset
+		0e11 b110  Armada M700
 		1179 0001  Toshiba Tecra 8100 Laptop System Chipset
 	7191  440BX/ZX/DX - 82443BX/ZX/DX AGP bridge
 	7192  440BX/ZX/DX - 82443BX/ZX/DX Host bridge (AGP disabled)
@@ -6759,9 +7230,6 @@
 	5478  AIC-7850
 	5575  AVA-2930
 	5578  AIC-7855
-	5647  ANA-7711 TCP Offload Engine
-		9004 7710  ANA-7711F TCP Offload Engine - Optical
-		9004 7711  ANA-7711LP TCP Offload Engine - Copper
 	5675  AIC-755x
 	5678  AIC-7856
 	5775  AIC-755x
@@ -6803,6 +7271,8 @@
 	7478  AHA-2944/2944W / AIC-7874
 	7578  AHA-3944/3944W / AIC-7875
 	7678  AHA-4944W/UW / AIC-7876
+	7710  ANA-7711F Network Accelerator Card (NAC) - Optical
+	7711  ANA-7711C Network Accelerator Card (NAC) - Copper
 	7778  AIC-787x
 	7810  AIC-7810
 	7815  AIC-7815 RAID+Memory Controller IC
@@ -6879,6 +7349,8 @@
 		9005 62a1  19160 Ultra160 SCSI Controller
 	0083  AIC-7892D U160/m
 	008f  AIC-7892P U160/m
+		1179 0001  Magnia Z310
+		15d9 9005  Onboard SCSI Host Adapter
 	00c0  AHA-3960D / AIC-7899A U160/m
 		0e11 f620  Compaq 64-Bit/66MHz Dual Channel Wide Ultra3 SCSI Adapter
 		9005 f620  AHA-3960D U160/m
@@ -6888,6 +7360,8 @@
 		1028 00c5  PowerEdge 2550
 	00cf  AIC-7899P U160/m
 		1028 00d1  PowerEdge 2550
+		10f1 2462  Thunder K7 S2462
+		15d9 9005  Onboard SCSI Host Adapter
 	0250  ServeRAID Controller
 		1014 0279  ServeRAID-xx
 		1014 028c  ServeRAID-xx
@@ -6904,11 +7378,18 @@
 	8014  ASC-29320LP U320
 	801e  AIC-7901A U320
 	801f  AIC-7902 U320
+	8080  ASC-29320A U320 w/HostRAID
+	808f  AIC-7901 U320 w/HostRAID
 	8090  ASC-39320 U320 w/HostRAID
 	8091  ASC-39320D U320 w/HostRAID
 	8092  ASC-29320 U320 w/HostRAID
 	8093  ASC-29320B U320 w/HostRAID
 	8094  ASC-29320LP U320 w/HostRAID
+	8095  ASC-39320(B) U320 w/HostRAID
+	8096  ASC-39320A U320 w/HostRAID
+	8097  ASC-29320ALP U320 w/HostRAID
+	809c  ASC-39320D(B) U320 w/HostRAID
+	809d  AIC-7902(B) U320 w/HostRAID
 	809e  AIC-7901A U320 w/HostRAID
 	809f  AIC-7902 U320 w/HostRAID
 907f  Atronics
@@ -6951,7 +7432,7 @@
 e000  Winbond
 	e000  W89C940
 e159  Tiger Jet Network Inc.
-	0001  Model 300 128k [Catawba TJ]
+	0001  Intel 537
 		0059 0001  128k ISDN-S/T Adapter
 		0059 0003  128k ISDN-U Adapter
 	0002  Tiger100APC ISDN chipset
@@ -6997,7 +7478,9 @@
 	facd  KONA HD SMPTE 292M I/O
 fa57  Fast Search & Transfer ASA
 febd  Ultraview Corp.
-feda  Epigram Inc
+feda  Broadcom Inc (nee Epigram)
+	a0fa  BCM4210 iLine10 HomePNA 2.0
+	a10e  BCM4230 iLine10 HomePNA 2.0
 fffe  VMWare Inc
 	0710  Virtual SVGA
 ffff  Illegal Vendor ID
diff -Nru a/drivers/pci/probe.c b/drivers/pci/probe.c
--- a/drivers/pci/probe.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/pci/probe.c	Tue Feb  3 19:45:34 2004
@@ -6,6 +6,7 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/module.h>
+#include <linux/cpumask.h>
 
 #undef DEBUG
 
@@ -25,6 +26,43 @@
 LIST_HEAD(pci_devices);
 
 /*
+ * PCI Bus Class
+ */
+static void release_pcibus_dev(struct class_device *class_dev)
+{
+	struct pci_bus *pci_bus = to_pci_bus(class_dev);
+	if (pci_bus->bridge)
+		put_device(pci_bus->bridge);
+	kfree(pci_bus);
+}
+
+static struct class pcibus_class = {
+	.name		= "pci_bus",
+	.release	= &release_pcibus_dev,
+};
+
+static int __init pcibus_class_init(void)
+{
+	return class_register(&pcibus_class);
+}
+postcore_initcall(pcibus_class_init);
+
+/*
+ * PCI Bus Class Devices
+ */
+static ssize_t pci_bus_show_cpuaffinity(struct class_device *class_dev, char *buf)
+{
+	cpumask_t cpumask = pcibus_to_cpumask((to_pci_bus(class_dev))->number);
+	int ret;
+
+	ret = cpumask_snprintf(buf, PAGE_SIZE, cpumask);
+	if (ret < PAGE_SIZE)
+		buf[ret++] = '\n';
+	return ret;
+}
+static CLASS_DEVICE_ATTR(cpuaffinity, S_IRUGO, pci_bus_show_cpuaffinity, NULL);
+
+/*
  * Translate the low bits of the PCI base
  * to the resource type
  */
@@ -238,37 +276,40 @@
 pci_alloc_child_bus(struct pci_bus *parent, struct pci_dev *bridge, int busnr)
 {
 	struct pci_bus *child;
+	int i;
 
 	/*
 	 * Allocate a new bus, and inherit stuff from the parent..
 	 */
 	child = pci_alloc_bus();
+	if (!child)
+		return NULL;
 
-	if (child) {
-		int i;
-
-		child->self = bridge;
-		child->parent = parent;
-		child->ops = parent->ops;
-		child->sysdata = parent->sysdata;
-		child->dev = &bridge->dev;
-
-		/*
-		 * Set up the primary, secondary and subordinate
-		 * bus numbers.
-		 */
-		child->number = child->secondary = busnr;
-		child->primary = parent->secondary;
-		child->subordinate = 0xff;
-
-		/* Set up default resource pointers and names.. */
-		for (i = 0; i < 4; i++) {
-			child->resource[i] = &bridge->resource[PCI_BRIDGE_RESOURCES+i];
-			child->resource[i]->name = child->name;
-		}
+	child->self = bridge;
+	child->parent = parent;
+	child->ops = parent->ops;
+	child->sysdata = parent->sysdata;
+	child->bridge = get_device(&bridge->dev);
+
+	child->class_dev.class = &pcibus_class;
+	sprintf(child->class_dev.class_id, "%04x:%02x", pci_domain_nr(child), busnr);
+	class_device_register(&child->class_dev);
+	class_device_create_file(&child->class_dev, &class_device_attr_cpuaffinity);
 
-		bridge->subordinate = child;
+	/*
+	 * Set up the primary, secondary and subordinate
+	 * bus numbers.
+	 */
+	child->number = child->secondary = busnr;
+	child->primary = parent->secondary;
+	child->subordinate = 0xff;
+
+	/* Set up default resource pointers and names.. */
+	for (i = 0; i < 4; i++) {
+		child->resource[i] = &bridge->resource[PCI_BRIDGE_RESOURCES+i];
+		child->resource[i]->name = child->name;
 	}
+	bridge->subordinate = child;
 
 	return child;
 }
@@ -300,25 +341,31 @@
 	struct pci_bus *child;
 	int is_cardbus = (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS);
 	u32 buses;
+	u16 bctl;
 
 	pci_read_config_dword(dev, PCI_PRIMARY_BUS, &buses);
 
 	DBG("Scanning behind PCI bridge %s, config %06x, pass %d\n",
 	    pci_name(dev), buses & 0xffffff, pass);
 
+	/* Disable MasterAbortMode during probing to avoid reporting
+	   of bus errors (in some architectures) */ 
+	pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &bctl);
+	pci_write_config_word(dev, PCI_BRIDGE_CONTROL,
+			      bctl & ~PCI_BRIDGE_CTL_MASTER_ABORT);
+
 	if ((buses & 0xffff00) && !pcibios_assign_all_busses() && !is_cardbus) {
-		unsigned int cmax;
+		unsigned int cmax, busnr;
 		/*
 		 * Bus already configured by firmware, process it in the first
 		 * pass and just note the configuration.
 		 */
 		if (pass)
 			return max;
-		child = pci_alloc_child_bus(bus, dev, 0);
+		busnr = (buses >> 8) & 0xFF;
+		child = pci_alloc_child_bus(bus, dev, busnr);
 		child->primary = buses & 0xFF;
-		child->secondary = (buses >> 8) & 0xFF;
 		child->subordinate = (buses >> 16) & 0xFF;
-		child->number = child->secondary;
 		cmax = pci_scan_child_bus(child);
 		if (cmax > max) max = cmax;
 	} else {
@@ -370,6 +417,8 @@
 		pci_write_config_byte(dev, PCI_SUBORDINATE_BUS, max);
 	}
 
+	pci_write_config_word(dev, PCI_BRIDGE_CONTROL, bctl);
+
 	sprintf(child->name, (is_cardbus ? "PCI CardBus #%02x" : "PCI Bus #%02x"), child->number);
 
 	return max;
@@ -508,7 +557,7 @@
 	memset(dev, 0, sizeof(struct pci_dev));
 	dev->bus = bus;
 	dev->sysdata = bus->sysdata;
-	dev->dev.parent = bus->dev;
+	dev->dev.parent = bus->bridge;
 	dev->dev.bus = &pci_bus_type;
 	dev->devfn = devfn;
 	dev->hdr_type = hdr_type & 0x7f;
@@ -535,6 +584,30 @@
 	return dev;
 }
 
+struct pci_dev * __devinit
+pci_scan_single_device(struct pci_bus *bus, int devfn)
+{
+	struct pci_dev *dev;
+
+	dev = pci_scan_device(bus, devfn);
+	pci_scan_msi_device(dev);
+
+	if (!dev)
+		return NULL;
+	
+	/* Fix up broken headers */
+	pci_fixup_device(PCI_FIXUP_HEADER, dev);
+
+	/*
+	 * Add the device to our list of discovered devices
+	 * and the bus list for fixup functions, etc.
+	 */
+	INIT_LIST_HEAD(&dev->global_list);
+	list_add_tail(&dev->bus_list, &bus->devices);
+
+	return dev;
+}
+
 /**
  * pci_scan_slot - scan a PCI slot on a bus for devices.
  * @bus: PCI bus to scan
@@ -551,34 +624,25 @@
 	for (func = 0; func < 8; func++, devfn++) {
 		struct pci_dev *dev;
 
-		dev = pci_scan_device(bus, devfn);
-		pci_scan_msi_device(dev);
-		if (func == 0) {
-			if (!dev)
-				break;
+		dev = pci_scan_single_device(bus, devfn);
+		if (dev) {
+			nr++;
+
+			/*
+		 	 * If this is a single function device,
+		 	 * don't scan past the first function.
+		 	 */
+			if (!dev->multifunction) {
+				if (func > 0) {
+					dev->multifunction = 1;
+				} else {
+ 					break;
+				}
+			}
 		} else {
-			if (!dev)
-				continue;
-			dev->multifunction = 1;
+			if (func == 0)
+				break;
 		}
-
-		/* Fix up broken headers */
-		pci_fixup_device(PCI_FIXUP_HEADER, dev);
-
-		/*
-		 * Add the device to our list of discovered devices
-		 * and the bus list for fixup functions, etc.
-		 */
-		INIT_LIST_HEAD(&dev->global_list);
-		list_add_tail(&dev->bus_list, &bus->devices);
-		nr++;
-
-		/*
-		 * If this is a single function device,
-		 * don't scan past the first function.
-		 */
-		if (!dev->multifunction)
-			break;
 	}
 	return nr;
 }
@@ -635,13 +699,14 @@
 struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, int bus, struct pci_ops *ops, void *sysdata)
 {
 	struct pci_bus *b;
+	struct device *dev;
 
 	b = pci_alloc_bus();
 	if (!b)
 		return NULL;
 
-	b->dev = kmalloc(sizeof(*(b->dev)),GFP_KERNEL);
-	if (!b->dev){
+	dev = kmalloc(sizeof(*dev), GFP_KERNEL);
+	if (!dev){
 		kfree(b);
 		return NULL;
 	}
@@ -652,17 +717,24 @@
 	if (pci_find_bus(pci_domain_nr(b), bus)) {
 		/* If we already got to this bus through a different bridge, ignore it */
 		DBG("PCI: Bus %02x already known\n", bus);
-		kfree(b->dev);
+		kfree(dev);
 		kfree(b);
 		return NULL;
 	}
-
 	list_add_tail(&b->node, &pci_root_buses);
 
-	memset(b->dev,0,sizeof(*(b->dev)));
-	b->dev->parent = parent;
-	sprintf(b->dev->bus_id,"pci%04x:%02x", pci_domain_nr(b), bus);
-	device_register(b->dev);
+	memset(dev, 0, sizeof(*dev));
+	dev->parent = parent;
+	sprintf(dev->bus_id, "pci%04x:%02x", pci_domain_nr(b), bus);
+	device_register(dev);
+	b->bridge = get_device(dev);
+
+	b->class_dev.class = &pcibus_class;
+	sprintf(b->class_dev.class_id, "%04x:%02x", pci_domain_nr(b), bus);
+	class_device_register(&b->class_dev);
+	class_device_create_file(&b->class_dev, &class_device_attr_cpuaffinity);
+
+	sysfs_create_link(&b->class_dev.kobj, &b->bridge->kobj, "bridge");
 
 	b->number = b->secondary = bus;
 	b->resource[0] = &ioport_resource;
@@ -681,4 +753,5 @@
 EXPORT_SYMBOL(pci_do_scan_bus);
 EXPORT_SYMBOL(pci_scan_slot);
 EXPORT_SYMBOL(pci_scan_bridge);
+EXPORT_SYMBOL(pci_scan_single_device);
 #endif
diff -Nru a/drivers/pci/quirks.c b/drivers/pci/quirks.c
--- a/drivers/pci/quirks.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/pci/quirks.c	Tue Feb  3 19:45:16 2004
@@ -858,6 +858,7 @@
 	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C586_0,	quirk_isa_dma_hangs },
 	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C596,	quirk_isa_dma_hangs },
 	{ PCI_FIXUP_FINAL,      PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_82371SB_0,  quirk_isa_dma_hangs },
+	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_AL,	PCI_DEVICE_ID_AL_M1533, 	quirk_isa_dma_hangs },
 	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82454NX,	quirk_disable_pxb },
 	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_NEC,	PCI_DEVICE_ID_NEC_CBUS_1,	quirk_isa_dma_hangs },
 	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_NEC,	PCI_DEVICE_ID_NEC_CBUS_2,	quirk_isa_dma_hangs },
diff -Nru a/drivers/pci/search.c b/drivers/pci/search.c
--- a/drivers/pci/search.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/pci/search.c	Tue Feb  3 19:45:16 2004
@@ -104,6 +104,41 @@
 }
 
 /**
+ * pci_get_slot - locate PCI device for a given PCI slot
+ * @bus: PCI bus on which desired PCI device resides
+ * @devfn: encodes number of PCI slot in which the desired PCI 
+ * device resides and the logical device number within that slot 
+ * in case of multi-function devices.
+ *
+ * Given a PCI bus and slot/function number, the desired PCI device 
+ * is located in the list of PCI devices.
+ * If the device is found, its reference count is increased and this
+ * function returns a pointer to its data structure.  The caller must
+ * decrement the reference count by calling pci_dev_put().
+ * If no device is found, %NULL is returned.
+ */
+struct pci_dev * pci_get_slot(struct pci_bus *bus, unsigned int devfn)
+{
+	struct list_head *tmp;
+	struct pci_dev *dev;
+
+	WARN_ON(in_interrupt());
+	spin_lock(&pci_bus_lock);
+
+	list_for_each(tmp, &bus->devices) {
+		dev = pci_dev_b(tmp);
+		if (dev->devfn == devfn)
+			goto out;
+	}
+
+	dev = NULL;
+ out:
+	pci_dev_get(dev);
+	spin_unlock(&pci_bus_lock);
+	return dev;
+}
+
+/**
  * pci_find_subsys - begin or continue searching for a PCI device by vendor/subvendor/device/subdevice id
  * @vendor: PCI vendor id to match, or %PCI_ANY_ID to match all vendor ids
  * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids
@@ -319,3 +354,4 @@
 EXPORT_SYMBOL(pci_find_subsys);
 EXPORT_SYMBOL(pci_get_device);
 EXPORT_SYMBOL(pci_get_subsys);
+EXPORT_SYMBOL(pci_get_slot);
diff -Nru a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
--- a/drivers/pcmcia/cs.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/pcmcia/cs.c	Tue Feb  3 19:45:17 2004
@@ -2289,149 +2289,6 @@
     return CS_SUCCESS;
 } /* report_error */
 
-/*====================================================================*/
-
-int CardServices(int func, void *a1, void *a2, void *a3)
-{
-
-#ifdef PCMCIA_DEBUG
-    if (pc_debug > 2) {
-	int i;
-	for (i = 0; i < SERVICE_COUNT; i++)
-	    if (service_table[i].key == func) break;
-	if (i < SERVICE_COUNT)
-	    printk(KERN_DEBUG "cs: CardServices(%s, 0x%p, 0x%p)\n",
-		   service_table[i].msg, a1, a2);
-	else
-	    printk(KERN_DEBUG "cs: CardServices(Unknown func %d, "
-		   "0x%p, 0x%p)\n", func, a1, a2);
-    }
-#endif
-    switch (func) {
-    case AccessConfigurationRegister:
-	return pcmcia_access_configuration_register(a1, a2); break;
-    case AdjustResourceInfo:
-	return pcmcia_adjust_resource_info(a1, a2); break;
-    case CheckEraseQueue:
-	return pcmcia_check_erase_queue(a1); break;
-    case CloseMemory:
-	return pcmcia_close_memory(a1); break;
-    case CopyMemory:
-	return pcmcia_copy_memory(a1, a2); break;
-    case DeregisterClient:
-	return pcmcia_deregister_client(a1); break;
-    case DeregisterEraseQueue:
-	return pcmcia_deregister_erase_queue(a1); break;
-    case GetFirstClient:
-	return pcmcia_get_first_client(a1, a2); break;
-    case GetCardServicesInfo:
-	return pcmcia_get_card_services_info(a1); break;
-    case GetConfigurationInfo:
-	return pcmcia_get_configuration_info(a1, a2); break;
-    case GetNextClient:
-	return pcmcia_get_next_client(a1, a2); break;
-    case GetFirstRegion:
-	return pcmcia_get_first_region(a1, a2); break;
-    case GetFirstTuple:
-	return pcmcia_get_first_tuple(a1, a2); break;
-    case GetNextRegion:
-	return pcmcia_get_next_region(a1, a2); break;
-    case GetNextTuple:
-	return pcmcia_get_next_tuple(a1, a2); break;
-    case GetStatus:
-	return pcmcia_get_status(a1, a2); break;
-    case GetTupleData:
-	return pcmcia_get_tuple_data(a1, a2); break;
-    case MapMemPage:
-	return pcmcia_map_mem_page(a1, a2); break;
-    case ModifyConfiguration:
-	return pcmcia_modify_configuration(a1, a2); break;
-    case ModifyWindow:
-	return pcmcia_modify_window(a1, a2); break;
-    case OpenMemory:
-/*	return pcmcia_open_memory(a1, a2); */
-    {
-	memory_handle_t m;
-        int ret = pcmcia_open_memory(a1, a2, &m);
-        *(memory_handle_t *)a1 = m;
-	return  ret;
-    }
-        break;
-    case ParseTuple:
-	return pcmcia_parse_tuple(a1, a2, a3); break;
-    case ReadMemory:
-	return pcmcia_read_memory(a1, a2, a3); break;
-    case RegisterClient:
-	return pcmcia_register_client(a1, a2); break;
-    case RegisterEraseQueue:
-    {
-	eraseq_handle_t w;
-        int ret = pcmcia_register_erase_queue(a1, a2, &w);
-        *(eraseq_handle_t *)a1 = w;
-	return  ret;
-    }
-        break;
-/*	return pcmcia_register_erase_queue(a1, a2); break; */
-
-	return pcmcia_register_mtd(a1, a2); break;
-    case ReleaseConfiguration:
-	return pcmcia_release_configuration(a1); break;
-    case ReleaseIO:
-	return pcmcia_release_io(a1, a2); break;
-    case ReleaseIRQ:
-	return pcmcia_release_irq(a1, a2); break;
-    case ReleaseWindow:
-	return pcmcia_release_window(a1); break;
-    case RequestConfiguration:
-	return pcmcia_request_configuration(a1, a2); break;
-    case RequestIO:
-	return pcmcia_request_io(a1, a2); break;
-    case RequestIRQ:
-	return pcmcia_request_irq(a1, a2); break;
-    case RequestWindow:
-    {
-	window_handle_t w;
-        int ret = pcmcia_request_window(a1, a2, &w);
-        *(window_handle_t *)a1 = w;
-	return  ret;
-    }
-        break;
-    case ResetCard:
-	return pcmcia_reset_card(a1, a2); break;
-    case SetEventMask:
-	return pcmcia_set_event_mask(a1, a2); break;
-    case ValidateCIS:
-	return pcmcia_validate_cis(a1, a2); break;
-    case WriteMemory:
-	return pcmcia_write_memory(a1, a2, a3); break;
-    case BindDevice:
-	return pcmcia_bind_device(a1); break;
-    case BindMTD:
-	return pcmcia_bind_mtd(a1); break;
-    case ReportError:
-	return pcmcia_report_error(a1, a2); break;
-    case SuspendCard:
-	return pcmcia_suspend_card(a1, a2); break;
-    case ResumeCard:
-	return pcmcia_resume_card(a1, a2); break;
-    case EjectCard:
-	return pcmcia_eject_card(a1, a2); break;
-    case InsertCard:
-	return pcmcia_insert_card(a1, a2); break;
-    case ReplaceCIS:
-	return pcmcia_replace_cis(a1, a2); break;
-    case GetFirstWindow:
-	return pcmcia_get_first_window(a1, a2); break;
-    case GetNextWindow:
-	return pcmcia_get_next_window(a1, a2); break;
-    case GetMemPage:
-	return pcmcia_get_mem_page(a1, a2); break;
-    default:
-	return CS_UNSUPPORTED_FUNCTION; break;
-    }
-    
-} /* CardServices */
-
 /*======================================================================
 
     OS-specific module glue goes here
@@ -2489,7 +2346,6 @@
 EXPORT_SYMBOL(pcmcia_write_memory);
 
 EXPORT_SYMBOL(dead_socket);
-EXPORT_SYMBOL(CardServices);
 EXPORT_SYMBOL(MTDHelperEntry);
 EXPORT_SYMBOL(pcmcia_parse_events);
 
diff -Nru a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
--- a/drivers/pcmcia/ds.c	Tue Feb  3 19:45:35 2004
+++ b/drivers/pcmcia/ds.c	Tue Feb  3 19:45:35 2004
@@ -51,6 +51,8 @@
 #include <linux/list.h>
 #include <linux/workqueue.h>
 
+#include <asm/atomic.h>
+
 #include <pcmcia/version.h>
 #include <pcmcia/cs_types.h>
 #include <pcmcia/cs.h>
@@ -95,10 +97,12 @@
     int			event_head, event_tail;
     event_t		event[MAX_EVENTS];
     struct user_info_t	*next;
+    struct pcmcia_bus_socket *socket;
 } user_info_t;
 
 /* Socket state information */
 struct pcmcia_bus_socket {
+	atomic_t		refcount;
 	client_handle_t		handle;
 	int			state;
 	user_info_t		*user;
@@ -106,13 +110,13 @@
 	wait_queue_head_t	queue, request;
 	struct work_struct	removal;
 	socket_bind_t		*bind;
-	struct device		*socket_dev;
 	struct pcmcia_socket	*parent;
 };
 
 #define SOCKET_PRESENT		0x01
 #define SOCKET_BUSY		0x02
 #define SOCKET_REMOVAL_PENDING	0x10
+#define SOCKET_DEAD		0x80
 
 /*====================================================================*/
 
@@ -137,6 +141,24 @@
 static struct pcmcia_driver * get_pcmcia_driver (dev_info_t *dev_info);
 static struct pcmcia_bus_socket * get_socket_info_by_nr(unsigned int nr);
 
+static void pcmcia_put_bus_socket(struct pcmcia_bus_socket *s)
+{
+	if (atomic_dec_and_test(&s->refcount))
+		kfree(s);
+}
+
+static struct pcmcia_bus_socket *pcmcia_get_bus_socket(int nr)
+{
+	struct pcmcia_bus_socket *s;
+
+	s = get_socket_info_by_nr(nr);
+	if (s) {
+		WARN_ON(atomic_read(&s->refcount) == 0);
+		atomic_inc(&s->refcount);
+	}
+	return s;
+}
+
 /**
  * pcmcia_register_driver - register a PCMCIA driver with the bus core
  *
@@ -230,13 +252,10 @@
     if (s->state & SOCKET_BUSY)
 	s->req_pending = 1;
     handle_event(s, event);
-    if (s->req_pending > 0) {
-	interruptible_sleep_on(&s->request);
-	if (signal_pending(current))
-	    return CS_IN_USE;
-	else
-	    return s->req_result;
-    }
+    if (wait_event_interruptible(s->request, s->req_pending <= 0))
+        return CS_IN_USE;
+    if (s->state & SOCKET_BUSY)
+        return s->req_result;
     return CS_SUCCESS;
 }
 
@@ -501,7 +520,7 @@
 
     DEBUG(0, "ds_open(socket %d)\n", i);
 
-    s = get_socket_info_by_nr(i);
+    s = pcmcia_get_bus_socket(i);
     if (!s)
 	    return -ENODEV;
 
@@ -517,6 +536,7 @@
     user->event_tail = user->event_head = 0;
     user->next = s->user;
     user->user_magic = USER_MAGIC;
+    user->socket = s;
     s->user = user;
     file->private_data = user;
     
@@ -529,23 +549,23 @@
 
 static int ds_release(struct inode *inode, struct file *file)
 {
-    socket_t i = iminor(inode);
     struct pcmcia_bus_socket *s;
     user_info_t *user, **link;
 
-    DEBUG(0, "ds_release(socket %d)\n", i);
-
-    s = get_socket_info_by_nr(i);
-    if (!s)
-	    return 0;
+    DEBUG(0, "ds_release(socket %d)\n", iminor(inode));
 
     user = file->private_data;
     if (CHECK_USER(user))
 	goto out;
 
+    s = user->socket;
+
     /* Unlink user data structure */
-    if ((file->f_flags & O_ACCMODE) != O_RDONLY)
+    if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
 	s->state &= ~SOCKET_BUSY;
+	s->req_pending = 0;
+	wake_up_interruptible(&s->request);
+    }
     file->private_data = NULL;
     for (link = &s->user; *link; link = &(*link)->next)
 	if (*link == user) break;
@@ -554,6 +574,7 @@
     *link = user->next;
     user->user_magic = 0;
     kfree(user);
+    pcmcia_put_bus_socket(s);
 out:
     return 0;
 } /* ds_release */
@@ -563,30 +584,28 @@
 static ssize_t ds_read(struct file *file, char *buf,
 		       size_t count, loff_t *ppos)
 {
-    socket_t i = iminor(file->f_dentry->d_inode);
     struct pcmcia_bus_socket *s;
     user_info_t *user;
+    int ret;
 
-    DEBUG(2, "ds_read(socket %d)\n", i);
+    DEBUG(2, "ds_read(socket %d)\n", iminor(inode));
     
     if (count < 4)
 	return -EINVAL;
 
-    s = get_socket_info_by_nr(i);
-    if (!s)
-	    return -ENODEV;
-
     user = file->private_data;
     if (CHECK_USER(user))
 	return -EIO;
     
-    if (queue_empty(user)) {
-	interruptible_sleep_on(&s->queue);
-	if (signal_pending(current))
-	    return -EINTR;
-    }
+    s = user->socket;
+    if (s->state & SOCKET_DEAD)
+        return -EIO;
+
+    ret = wait_event_interruptible(s->queue, !queue_empty(user));
+    if (ret == 0)
+	ret = put_user(get_queued_event(user), (int *)buf) ? -EFAULT : 4;
 
-    return put_user(get_queued_event(user), (int *)buf) ? -EFAULT : 4;
+    return ret;
 } /* ds_read */
 
 /*====================================================================*/
@@ -594,25 +613,24 @@
 static ssize_t ds_write(struct file *file, const char *buf,
 			size_t count, loff_t *ppos)
 {
-    socket_t i = iminor(file->f_dentry->d_inode);
     struct pcmcia_bus_socket *s;
     user_info_t *user;
 
-    DEBUG(2, "ds_write(socket %d)\n", i);
+    DEBUG(2, "ds_write(socket %d)\n", iminor(inode));
     
     if (count != 4)
 	return -EINVAL;
     if ((file->f_flags & O_ACCMODE) == O_RDONLY)
 	return -EBADF;
 
-    s = get_socket_info_by_nr(i);
-    if (!s)
-	    return -ENODEV;
-
     user = file->private_data;
     if (CHECK_USER(user))
 	return -EIO;
 
+    s = user->socket;
+    if (s->state & SOCKET_DEAD)
+        return -EIO;
+
     if (s->req_pending) {
 	s->req_pending--;
 	get_user(s->req_result, (int *)buf);
@@ -629,19 +647,19 @@
 /* No kernel lock - fine */
 static u_int ds_poll(struct file *file, poll_table *wait)
 {
-    socket_t i = iminor(file->f_dentry->d_inode);
     struct pcmcia_bus_socket *s;
     user_info_t *user;
 
-    DEBUG(2, "ds_poll(socket %d)\n", i);
+    DEBUG(2, "ds_poll(socket %d)\n", iminor(inode));
     
-    s = get_socket_info_by_nr(i);
-    if (!s)
-	    return POLLERR;
-
     user = file->private_data;
     if (CHECK_USER(user))
 	return POLLERR;
+    s = user->socket;
+    /*
+     * We don't check for a dead socket here since that
+     * will send cardmgr into an endless spin.
+     */
     poll_wait(file, &s->queue, wait);
     if (!queue_empty(user))
 	return POLLIN | POLLRDNORM;
@@ -653,17 +671,21 @@
 static int ds_ioctl(struct inode * inode, struct file * file,
 		    u_int cmd, u_long arg)
 {
-    socket_t i = iminor(inode);
     struct pcmcia_bus_socket *s;
     u_int size;
     int ret, err;
     ds_ioctl_arg_t buf;
+    user_info_t *user;
 
-    DEBUG(2, "ds_ioctl(socket %d, %#x, %#lx)\n", i, cmd, arg);
+    DEBUG(2, "ds_ioctl(socket %d, %#x, %#lx)\n", iminor(inode), cmd, arg);
     
-    s = get_socket_info_by_nr(i);
-    if (!s)
-	    return -ENODEV;
+    user = file->private_data;
+    if (CHECK_USER(user))
+	return -EIO;
+
+    s = user->socket;
+    if (s->state & SOCKET_DEAD)
+        return -EIO;
     
     size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT;
     if (size > sizeof(ds_ioctl_arg_t)) return -EINVAL;
@@ -833,6 +855,7 @@
 	if(!s)
 		return -ENOMEM;
 	memset(s, 0, sizeof(struct pcmcia_bus_socket));
+	atomic_set(&s->refcount, 1);
     
 	/*
 	 * Ugly. But we want to wait for the socket threads to have started up.
@@ -845,7 +868,6 @@
 	init_waitqueue_head(&s->request);
 
 	/* initialize data */
-	s->socket_dev = socket->dev.dev;
 	INIT_WORK(&s->removal, handle_removal, s);
 	s->parent = socket;
 
@@ -894,7 +916,8 @@
 
 	pcmcia_deregister_client(socket->pcmcia->handle);
 
-	kfree(socket->pcmcia);
+	socket->pcmcia->state |= SOCKET_DEAD;
+	pcmcia_put_bus_socket(socket->pcmcia);
 	socket->pcmcia = NULL;
 
 	return;
diff -Nru a/drivers/pcmcia/sa1100_cerf.c b/drivers/pcmcia/sa1100_cerf.c
--- a/drivers/pcmcia/sa1100_cerf.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/pcmcia/sa1100_cerf.c	Tue Feb  3 19:45:42 2004
@@ -11,27 +11,25 @@
 #include <linux/sched.h>
 #include <linux/device.h>
 #include <linux/init.h>
+#include <linux/delay.h>
 
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/irq.h>
+#include <asm/arch/cerf.h>
 #include "sa1100_generic.h"
 
-#ifdef CONFIG_SA1100_CERF_CPLD
-#define CERF_SOCKET	0
-#else
 #define CERF_SOCKET	1
-#endif
 
 static struct pcmcia_irqs irqs[] = {
-	{ CERF_SOCKET, IRQ_GPIO_CF_CD,   "CF_CD"   },
-	{ CERF_SOCKET, IRQ_GPIO_CF_BVD2, "CF_BVD2" },
-	{ CERF_SOCKET, IRQ_GPIO_CF_BVD1, "CF_BVD1" }
+	{ CERF_SOCKET, CERF_IRQ_GPIO_CF_CD,   "CF_CD"   },
+	{ CERF_SOCKET, CERF_IRQ_GPIO_CF_BVD2, "CF_BVD2" },
+	{ CERF_SOCKET, CERF_IRQ_GPIO_CF_BVD1, "CF_BVD1" }
 };
 
 static int cerf_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
 {
-	skt->irq = IRQ_GPIO_CF_IRQ;
+	skt->irq = CERF_IRQ_GPIO_CF_IRQ;
 
 	return sa11xx_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
@@ -46,13 +44,13 @@
 {
 	unsigned long levels = GPLR;
 
-	state->detect=((levels & GPIO_CF_CD)==0)?1:0;
-	state->ready=(levels & GPIO_CF_IRQ)?1:0;
-	state->bvd1=(levels & GPIO_CF_BVD1)?1:0;
-	state->bvd2=(levels & GPIO_CF_BVD2)?1:0;
-	state->wrprot=0;
-	state->vs_3v=1;
-	state->vs_Xv=0;
+	state->detect	= (levels & CERF_GPIO_CF_CD)  ?0:1;
+	state->ready	= (levels & CERF_GPIO_CF_IRQ) ?1:0;
+	state->bvd1	= (levels & CERF_GPIO_CF_BVD1)?1:0;
+	state->bvd2	= (levels & CERF_GPIO_CF_BVD2)?1:0;
+	state->wrprot	= 0;
+	state->vs_3v	= 1;
+	state->vs_Xv	= 0;
 }
 
 static int
@@ -61,13 +59,8 @@
 {
 	switch (state->Vcc) {
 	case 0:
-		break;
-
 	case 50:
 	case 33:
-#ifdef CONFIG_SA1100_CERF_CPLD
-		GPCR = GPIO_PWR_SHUTDOWN;
-#endif
 		break;
 
 	default:
@@ -77,13 +70,9 @@
 	}
 
 	if (state->flags & SS_RESET) {
-#ifdef CONFIG_SA1100_CERF_CPLD
-		GPSR = GPIO_CF_RESET;
-#endif
+		GPSR = CERF_GPIO_CF_RESET;
 	} else {
-#ifdef CONFIG_SA1100_CERF_CPLD
-		GPCR = GPIO_CF_RESET;
-#endif
+		GPCR = CERF_GPIO_CF_RESET;
 	}
 
 	return 0;
@@ -101,8 +90,8 @@
 
 static struct pcmcia_low_level cerf_pcmcia_ops = { 
 	.owner			= THIS_MODULE,
-	.init			= cerf_pcmcia_hw_init,
-	.shutdown		= cerf_pcmcia_hw_shutdown,
+	.hw_init		= cerf_pcmcia_hw_init,
+	.hw_shutdown		= cerf_pcmcia_hw_shutdown,
 	.socket_state		= cerf_pcmcia_socket_state,
 	.configure_socket	= cerf_pcmcia_configure_socket,
 
diff -Nru a/drivers/pnp/Kconfig b/drivers/pnp/Kconfig
--- a/drivers/pnp/Kconfig	Tue Feb  3 19:45:26 2004
+++ b/drivers/pnp/Kconfig	Tue Feb  3 19:45:26 2004
@@ -6,6 +6,7 @@
 
 config PNP
 	bool "Plug and Play support"
+	depends on ISA
 	---help---
 	  Plug and Play (PnP) is a standard for peripherals which allows those
 	  peripherals to be configured by software, e.g. assign IRQ's or other
diff -Nru a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
--- a/drivers/s390/block/dasd.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/block/dasd.c	Tue Feb  3 19:45:17 2004
@@ -7,7 +7,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
  *
- * $Revision: 1.114 $
+ * $Revision: 1.123 $
  */
 
 #include <linux/config.h>
@@ -43,7 +43,6 @@
 		   " Copyright 2000 IBM Corporation");
 MODULE_SUPPORTED_DEVICE("dasd");
 MODULE_PARM(dasd, "1-" __MODULE_STRING(256) "s");
-MODULE_PARM(dasd_disciplines, "1-" __MODULE_STRING(8) "s");
 MODULE_LICENSE("GPL");
 
 /*
@@ -57,7 +56,6 @@
 static void dasd_flush_ccw_queue(struct dasd_device *, int);
 static void dasd_tasklet(struct dasd_device *);
 static void do_kick_device(void *data);
-static int  dasd_add_sysfs_files(struct ccw_device *cdev);
 
 /*
  * SECTION: Operations on the device structure.
@@ -93,6 +91,7 @@
 
 	dasd_init_chunklist(&device->ccw_chunks, device->ccw_mem, PAGE_SIZE*2);
 	dasd_init_chunklist(&device->erp_chunks, device->erp_mem, PAGE_SIZE);
+	spin_lock_init(&device->mem_lock);
 	spin_lock_init(&device->request_queue_lock);
 	atomic_set (&device->tasklet_scheduled, 0);
 	tasklet_init(&device->tasklet, 
@@ -860,7 +859,7 @@
 
 	device = (struct dasd_device *) cqr->device;
 	if (device == NULL ||
-	    device != cdev->dev.driver_data ||
+	    device != dasd_device_from_cdev(cdev) ||
 	    strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) {
 		MESSAGE(KERN_DEBUG, "invalid device in request: bus_id %s",
 			cdev->dev.bus_id);
@@ -872,6 +871,7 @@
 
 	dasd_clear_timer(device);
 	dasd_schedule_bh(device);
+	dasd_put_device(device);
 }
 
 static void
@@ -931,7 +931,11 @@
 	/* first of all check for state change pending interrupt */
 	mask = DEV_STAT_ATTENTION | DEV_STAT_DEV_END | DEV_STAT_UNIT_EXCEP;
 	if ((irb->scsw.dstat & mask) == mask) {
-		dasd_handle_state_change_pending(cdev->dev.driver_data);
+		device = dasd_device_from_cdev(cdev);
+		if (!IS_ERR(device)) {
+			dasd_handle_state_change_pending(device);
+			dasd_put_device(device);
+		}
 		return;
 	}
 
@@ -949,7 +953,6 @@
 
 	device = (struct dasd_device *) cqr->device;
 	if (device == NULL ||
-	    device != cdev->dev.driver_data ||
 	    strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) {
 		MESSAGE(KERN_DEBUG, "invalid device in request: bus_id %s",
 			cdev->dev.bus_id);
@@ -959,17 +962,19 @@
 	DBF_DEV_EVENT(DBF_DEBUG, device, "Int: CS/DS 0x%04x",
 		      ((irb->scsw.cstat << 8) | irb->scsw.dstat));
 
-	/* Find out the appropriate era_action. */
-	era = dasd_era_none;
-	if (irb->scsw.dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END) ||
-	    irb->esw.esw0.erw.cons) {
-		/* The request did end abnormally. */
-		if (irb->scsw.fctl & SCSW_FCTL_HALT_FUNC)
-			era = dasd_era_fatal;
-		else
-			era = device->discipline->examine_error(cqr, irb);
-		DBF_EVENT(DBF_NOTICE, "era_code %d", era);
-	}
+ 	/* Find out the appropriate era_action. */
+	if (irb->scsw.fctl & SCSW_FCTL_HALT_FUNC) 
+		era = dasd_era_fatal;
+	else if (irb->scsw.dstat == (DEV_STAT_CHN_END | DEV_STAT_DEV_END) &&
+		 irb->scsw.cstat == 0 &&
+		 !irb->esw.esw0.erw.cons)
+		era = dasd_era_none;
+	else if (irb->esw.esw0.erw.cons)
+		era = device->discipline->examine_error(cqr, irb);
+	else 
+		era = dasd_era_recover;
+
+	DBF_DEV_EVENT(DBF_DEBUG, device, "era_code %d", era);
 	expires = 0;
 	if (era == dasd_era_none) {
 		cqr->status = DASD_CQR_DONE;
@@ -1149,6 +1154,11 @@
 			dasd_end_request(req, 0);
 			continue;
 		}
+		if (device->stopped & DASD_STOPPED_DC_EIO) {
+			blkdev_dequeue_request(req);
+			dasd_end_request(req, 0);
+			continue;
+		}
 		cqr = device->discipline->build_cp(device, req);
 		if (IS_ERR(cqr)) {
 			if (PTR_ERR(cqr) == -ENOMEM)
@@ -1728,17 +1738,10 @@
 dasd_generic_probe (struct ccw_device *cdev,
 		    struct dasd_discipline *discipline)
 {
-	int ret = 0;
-
-	if (dasd_autodetect &&
-	    (ret = dasd_add_busid(cdev->dev.bus_id, DASD_FEATURE_DEFAULT))) {
-		printk (KERN_WARNING
-			"dasd_generic_probe: cannot autodetect %s\n",
-			cdev->dev.bus_id);
-		return ret;
-	}
+	int ret;
 
-	if (!ret && (ret = dasd_add_sysfs_files(cdev))) {
+	ret = dasd_add_sysfs_files(cdev);
+	if (ret) {
 		printk(KERN_WARNING
 		       "dasd_generic_probe: could not add driverfs entries"
 		       "for %s\n", cdev->dev.bus_id);
@@ -1751,16 +1754,17 @@
 
 /* this will one day be called from a global not_oper handler.
  * It is also used by driver_unregister during module unload */
-int
+void
 dasd_generic_remove (struct ccw_device *cdev)
 {
 	struct dasd_device *device;
 
-	device = cdev->dev.driver_data;
-	cdev->dev.driver_data = NULL;
-	if (device)
-		kfree(device);
-	return 0;
+	device = dasd_device_from_cdev(cdev);
+	if (!IS_ERR(device)) {
+		dasd_set_target_state(device, DASD_STATE_NEW);
+		/* dasd_delete_device destroys the device reference. */
+		dasd_delete_device(device);
+	}
 }
 
 /* activate a device. This is called from dasd_{eckd,fba}_probe() when either
@@ -1779,24 +1783,14 @@
 		return PTR_ERR(device);
 
 	if (device->use_diag_flag)
-		device->discipline = dasd_diag_discipline_pointer;
-
-	rc = 0;
-	if (!device->discipline ||
-	    (rc = device->discipline->check_device(device))) {
-		pr_debug("device %s is not diag (%d)\n", 
-			 cdev->dev.bus_id, rc);
-		if (device->private != NULL) {
-			kfree(device->private);
-			device->private = NULL;
-		}
-		device->discipline = discipline;
-		rc = discipline->check_device(device);
-	}
-
+		discipline = dasd_diag_discipline_pointer;
+	device->discipline = discipline;
+	rc = discipline->check_device(device);
 	if (rc) {
-		printk (KERN_WARNING "dasd_generic found a bad device %s\n", 
-			cdev->dev.bus_id);
+		printk (KERN_WARNING
+			"dasd_generic couldn't online device %s "
+			"with discipline %s\n", 
+			cdev->dev.bus_id, discipline->name);
 		dasd_delete_device(device);
 		return rc;
 	}
@@ -1809,16 +1803,16 @@
 		rc = -ENODEV;
 		dasd_set_target_state(device, DASD_STATE_NEW);
 		dasd_delete_device(device);
-	} else {
+	} else
 		pr_debug("dasd_generic device %s found\n",
 				cdev->dev.bus_id);
-		cdev->dev.driver_data = device;
-	}
 
 	/* FIXME: we have to wait for the root device but we don't want
 	 * to wait for each single device but for all at once. */
 	wait_event(dasd_init_waitq, _wait_for_device(device));
 
+	dasd_put_device(device);
+
 	return rc;
 }
 
@@ -1827,18 +1821,68 @@
 {
 	struct dasd_device *device;
 
-	device = cdev->dev.driver_data;
-	dasd_set_target_state(device, DASD_STATE_NEW);
-	dasd_delete_device(device);
-	
+	device = dasd_device_from_cdev(cdev);
+	if (atomic_read(&device->open_count) > 0) {
+		printk (KERN_WARNING "Can't offline dasd device with open"
+			" count = %i.\n",
+			atomic_read(&device->open_count));
+		dasd_put_device(device);
+		return -EBUSY;
+	}
+	dasd_put_device(device);
+	dasd_generic_remove (cdev);
 	return 0;
 }
 
+int
+dasd_generic_notify(struct ccw_device *cdev, int event)
+{
+	struct dasd_device *device;
+	struct dasd_ccw_req *cqr;
+	unsigned long flags;
+	int ret;
+
+	device = dasd_device_from_cdev(cdev);
+	if (IS_ERR(device))
+		return 0;
+	spin_lock_irqsave(get_ccwdev_lock(cdev), flags);
+	ret = 0;
+	switch (event) {
+	case CIO_GONE:
+	case CIO_NO_PATH:
+		if (device->state < DASD_STATE_BASIC)
+			break;
+		/* Device is active. We want to keep it. */
+		if (device->disconnect_error_flag) {
+			list_for_each_entry(cqr, &device->ccw_queue, list)
+				if (cqr->status == DASD_CQR_IN_IO)
+					cqr->status = DASD_CQR_FAILED;
+			device->stopped |= DASD_STOPPED_DC_EIO;
+			dasd_schedule_bh(device);
+		} else {
+			list_for_each_entry(cqr, &device->ccw_queue, list)
+				if (cqr->status == DASD_CQR_IN_IO)
+					cqr->status = DASD_CQR_QUEUED;
+			device->stopped |= DASD_STOPPED_DC_WAIT;
+			dasd_set_timer(device, 0);
+		}
+		ret = 1;
+		break;
+	case CIO_OPER:
+		/* FIXME: add a sanity check. */
+		device->stopped &= ~(DASD_STOPPED_DC_WAIT|DASD_STOPPED_DC_EIO);
+		dasd_schedule_bh(device);
+		ret = 1;
+		break;
+	}
+	spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags);
+	dasd_put_device(device);
+	return ret;
+}
+
 /*
  * Automatically online either all dasd devices (dasd_autodetect) or
- * all devices specified with dasd= parameters. For dasd_autodetect
- * dasd_generic_probe has added devmaps for all dasd devices. We
- * scan all present dasd devmaps and call ccw_device_set_online.
+ * all devices specified with dasd= parameters.
  */
 void
 dasd_generic_auto_online (struct ccw_driver *dasd_discipline_driver)
@@ -1861,97 +1905,6 @@
 	}
 	up_read(&drv->bus->subsys.rwsem);
 	put_driver(drv);
-}
-
-/*
- * SECTION: files in sysfs
- */
-
-/*
- * readonly controls the readonly status of a dasd
- */
-static ssize_t
-dasd_ro_show(struct device *dev, char *buf)
-{
-	struct dasd_device *device;
-
-	device = dev->driver_data;
-	if (!device)
-		return snprintf(buf, PAGE_SIZE, "n/a\n");
-
-	return snprintf(buf, PAGE_SIZE, device->ro_flag ? "1\n" : "0\n");
-}
-
-static ssize_t
-dasd_ro_store(struct device *dev, const char *buf, size_t count)
-{
-	struct dasd_device *device = dev->driver_data;
-
-	if (device)
-		device->ro_flag = (buf[0] == '1') ? 1 : 0;
-	return count;
-}
-
-static DEVICE_ATTR(readonly, 0644, dasd_ro_show, dasd_ro_store);
-
-/*
- * use_diag controls whether the driver should use diag rather than ssch
- * to talk to the device
- */
-/* TODO: Implement */
-static ssize_t 
-dasd_use_diag_show(struct device *dev, char *buf)
-{
-	struct dasd_device *device;
-
-	device = dev->driver_data;
-	if (!device)
-		return sprintf(buf, "n/a\n");
-
-	return sprintf(buf, device->use_diag_flag ? "1\n" : "0\n");
-}
-
-static ssize_t
-dasd_use_diag_store(struct device *dev, const char *buf, size_t count)
-{
-	struct dasd_device *device = dev->driver_data;
-
-	if (device)
-		device->use_diag_flag = (buf[0] == '1') ? 1 : 0;
-	return count;
-}
-
-static
-DEVICE_ATTR(use_diag, 0644, dasd_use_diag_show, dasd_use_diag_store);
-
-static ssize_t
-dasd_discipline_show(struct device *dev, char *buf)
-{
-	struct dasd_device *device;
-
-	device = dev->driver_data;
-	if (!device || !device->discipline)
-		return sprintf(buf, "none\n");
-	return snprintf(buf, PAGE_SIZE, "%s\n", device->discipline->name);
-}
-
-static DEVICE_ATTR(discipline, 0444, dasd_discipline_show, NULL);
-
-static struct attribute * dasd_attrs[] = {
-	&dev_attr_readonly.attr,
-	&dev_attr_discipline.attr,
-	&dev_attr_use_diag.attr,
-	NULL,
-};
-
-static struct attribute_group dasd_attr_group = {
-	.attrs = dasd_attrs,
-};
-
-static int
-dasd_add_sysfs_files(struct ccw_device *cdev)
-{
-	return sysfs_create_group(&cdev->dev.kobj, &dasd_attr_group);
 }
 
 static int __init
diff -Nru a/drivers/s390/block/dasd_3990_erp.c b/drivers/s390/block/dasd_3990_erp.c
--- a/drivers/s390/block/dasd_3990_erp.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/s390/block/dasd_3990_erp.c	Tue Feb  3 19:45:41 2004
@@ -5,7 +5,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000, 2001
  *
- * $Revision: 1.25 $
+ * $Revision: 1.26 $
  */
 
 #include <linux/timer.h>
@@ -312,7 +312,8 @@
 			    erp->lpm, erp->dstat->esw.esw0.sublog.lpum, opm);
 
 		/* reset status to queued to handle the request again... */
-		erp->status = DASD_CQR_QUEUED;
+		if (erp->status > DASD_CQR_QUEUED)
+			erp->status = DASD_CQR_QUEUED;
 		erp->retries = 1;
 	} else {
 		DEV_MESSAGE(KERN_ERR, device,
@@ -321,7 +322,8 @@
 			    erp->dstat->esw.esw0.sublog.lpum, opm);
 
 		/* post request with permanent error */
-		erp->status = DASD_CQR_FAILED;
+		if (erp->status > DASD_CQR_QUEUED)
+			erp->status = DASD_CQR_FAILED;
 	}
 }				/* end dasd_3990_erp_alternate_path */
 
diff -Nru a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
--- a/drivers/s390/block/dasd_devmap.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/s390/block/dasd_devmap.c	Tue Feb  3 19:45:28 2004
@@ -11,7 +11,7 @@
  * functions may not be called from interrupt context. In particular
  * dasd_get_device is a no-no from interrupt context.
  *
- * $Revision: 1.19 $
+ * $Revision: 1.25 $
  */
 
 #include <linux/config.h>
@@ -79,6 +79,8 @@
 static struct list_head dasd_hashlists[256];
 int dasd_max_devindex;
 
+static struct dasd_devmap *dasd_add_busid(char *, int);
+
 static inline int
 dasd_hash_busid(char *bus_id)
 {
@@ -168,12 +170,16 @@
 		*endp = str;
 		return DASD_FEATURE_DEFAULT;
 	}
+	str++;
 	features = 0;
+
 	while (1) {
 		for (len = 0; 
 		     str[len] && str[len] != ':' && str[len] != ')'; len++);
 		if (len == 2 && !strncmp(str, "ro", 2))
 			features |= DASD_FEATURE_READONLY;
+		else if (len == 4 && !strncmp(str, "diag", 4))
+			features |= DASD_FEATURE_USEDIAG;
 		else {
 			MESSAGE(KERN_WARNING,
 				"unsupported feature: %*s, "
@@ -203,6 +209,7 @@
 static inline int
 dasd_ranges_list(char *str)
 {
+	struct dasd_devmap *devmap;
 	int from, from_id0, from_id1;
 	int to, to_id0, to_id1;
 	int features, rc;
@@ -233,9 +240,9 @@
 		while (from <= to) {
 			sprintf(bus_id, "%01x.%01x.%04x",
 				from_id0, from_id1, from++);
-			rc = dasd_add_busid(bus_id, features);
-			if (rc)
-				return rc;
+			devmap = dasd_add_busid(bus_id, features);
+			if (IS_ERR(devmap))
+				return PTR_ERR(devmap);
 		}
 		if (*str != ',')
 			break;
@@ -299,7 +306,7 @@
  * added through this function will define the kdevs for the individual
  * devices. 
  */
-int
+static struct dasd_devmap *
 dasd_add_busid(char *bus_id, int features)
 {
 	struct dasd_devmap *devmap, *new, *tmp;
@@ -308,7 +315,7 @@
 	new = (struct dasd_devmap *)
 		kmalloc(sizeof(struct dasd_devmap), GFP_KERNEL);
 	if (!new)
-		return -ENOMEM;
+		return ERR_PTR(-ENOMEM);
 	spin_lock(&dasd_devmap_lock);
 	devmap = 0;
 	hash = dasd_hash_busid(bus_id);
@@ -330,7 +337,7 @@
 	spin_unlock(&dasd_devmap_lock);
 	if (new)
 		kfree(new);
-	return 0;
+	return devmap;
 }
 
 /*
@@ -343,7 +350,7 @@
 	int hash;
 
 	spin_lock(&dasd_devmap_lock);
-	devmap = 0;
+	devmap = ERR_PTR(-ENODEV);
 	hash = dasd_hash_busid(bus_id);
 	list_for_each_entry(tmp, &dasd_hashlists[hash], list) {
 		if (strncmp(tmp->bus_id, bus_id, BUS_ID_SIZE) == 0) {
@@ -361,7 +368,7 @@
 int
 dasd_busid_known(char *bus_id)
 {
-	return dasd_find_busid(bus_id) ? 0 : -ENOENT;
+	return IS_ERR(dasd_find_busid(bus_id)) ? -ENOENT : 0;
 }
 
 /*
@@ -415,6 +422,28 @@
 }
 
 /*
+ * Return devmap for cdev. If no devmap exists yet, create one and
+ * connect it to the cdev.
+ */
+static struct dasd_devmap *
+dasd_devmap_from_cdev(struct ccw_device *cdev)
+{
+	struct dasd_devmap *devmap;
+
+	if (cdev->dev.driver_data)
+		return (struct dasd_devmap *) cdev->dev.driver_data;
+	devmap = dasd_find_busid(cdev->dev.bus_id);
+	if (!IS_ERR(devmap)) {
+		cdev->dev.driver_data = devmap;
+		return devmap;
+	}
+	devmap = dasd_add_busid(cdev->dev.bus_id, DASD_FEATURE_DEFAULT);
+	if (!IS_ERR(devmap))
+		cdev->dev.driver_data = devmap;
+	return devmap;
+}
+
+/*
  * Create a dasd device structure for cdev.
  */
 struct dasd_device *
@@ -424,41 +453,35 @@
 	struct dasd_device *device;
 	int rc;
 
-	rc = dasd_add_busid(cdev->dev.bus_id, DASD_FEATURE_DEFAULT);
-	if (rc)
-		return ERR_PTR(rc);
-
-	devmap = dasd_find_busid(cdev->dev.bus_id);
+	devmap = dasd_devmap_from_cdev(cdev);
 	if (IS_ERR(devmap))
 		return (void *) devmap;
 
 	device = dasd_alloc_device();
 	if (IS_ERR(device))
 		return device;
-	atomic_set(&device->ref_count, 1);
-	device->devindex = devmap->devindex;
-	device->ro_flag = (devmap->features & DASD_FEATURE_READONLY) ? 1 : 0;
-	device->use_diag_flag = 1;
+	atomic_set(&device->ref_count, 2);
 
-	spin_lock_irq(get_ccwdev_lock(cdev));
-	if (cdev->dev.driver_data == NULL) {
+	spin_lock(&dasd_devmap_lock);
+	if (!devmap->device) {
+		devmap->device = device;
+		device->devindex = devmap->devindex;
+		device->ro_flag = 
+			(devmap->features & DASD_FEATURE_READONLY) != 0;
+		device->use_diag_flag = 
+			(devmap->features & DASD_FEATURE_USEDIAG) != 0;
 		get_device(&cdev->dev);
-		cdev->dev.driver_data = device;
 		device->cdev = cdev;
 		rc = 0;
 	} else
 		/* Someone else was faster. */
 		rc = -EBUSY;
-	spin_unlock_irq(get_ccwdev_lock(cdev));
+	spin_unlock(&dasd_devmap_lock);
+
 	if (rc) {
 		dasd_free_device(device);
 		return ERR_PTR(rc);
 	}
-	/* Device created successfully. Make it known via devmap. */
-	spin_lock(&dasd_devmap_lock);
-	devmap->device = device;
-	spin_unlock(&dasd_devmap_lock);
-
 	return device;
 }
 
@@ -468,7 +491,8 @@
 static DECLARE_WAIT_QUEUE_HEAD(dasd_delete_wq);
 
 /*
- * Remove a dasd device structure.
+ * Remove a dasd device structure. The passed referenced
+ * is destroyed.
  */
 void
 dasd_delete_device(struct dasd_device *device)
@@ -479,17 +503,24 @@
 	/* First remove device pointer from devmap. */
 	devmap = dasd_find_busid(device->cdev->dev.bus_id);
 	spin_lock(&dasd_devmap_lock);
+	if (devmap->device != device) {
+		spin_unlock(&dasd_devmap_lock);
+		dasd_put_device(device);
+		return;
+	}
 	devmap->device = NULL;
 	spin_unlock(&dasd_devmap_lock);
 
+	/* Drop ref_count by 2, one for the devmap reference and
+	 * one for the passed reference. */
+	atomic_sub(2, &device->ref_count);
+
 	/* Wait for reference counter to drop to zero. */
-	atomic_dec(&device->ref_count);
 	wait_event(dasd_delete_wq, atomic_read(&device->ref_count) == 0);
 
 	/* Disconnect dasd_device structure from ccw_device structure. */
 	cdev = device->cdev;
 	device->cdev = NULL;
-	cdev->dev.driver_data = NULL;
 
 	/* Put ccw_device structure. */
 	put_device(&cdev->dev);
@@ -506,6 +537,148 @@
 dasd_put_device_wake(struct dasd_device *device)
 {
 	wake_up(&dasd_delete_wq);
+}
+
+/*
+ * Return dasd_device structure associated with cdev.
+ */
+struct dasd_device *
+dasd_device_from_cdev(struct ccw_device *cdev)
+{
+	struct dasd_devmap *devmap;
+	struct dasd_device *device;
+
+	device = ERR_PTR(-ENODEV);
+	spin_lock(&dasd_devmap_lock);
+	devmap = cdev->dev.driver_data;
+	if (devmap && devmap->device) {
+		device = devmap->device;
+		dasd_get_device(device);
+	}
+	spin_unlock(&dasd_devmap_lock);
+	return device;
+}
+
+/*
+ * SECTION: files in sysfs
+ */
+
+/*
+ * readonly controls the readonly status of a dasd
+ */
+static ssize_t
+dasd_ro_show(struct device *dev, char *buf)
+{
+	struct dasd_devmap *devmap;
+	int ro_flag;
+
+	devmap = dev->driver_data;
+	if (devmap)
+		ro_flag = (devmap->features & DASD_FEATURE_READONLY) != 0;
+	else
+		ro_flag = (DASD_FEATURE_DEFAULT & DASD_FEATURE_READONLY) != 0;
+	return snprintf(buf, PAGE_SIZE, ro_flag ? "1\n" : "0\n");
+}
+
+static ssize_t
+dasd_ro_store(struct device *dev, const char *buf, size_t count)
+{
+	struct dasd_devmap *devmap;
+	int ro_flag;
+
+	devmap = dasd_devmap_from_cdev(to_ccwdev(dev));
+	ro_flag = buf[0] == '1';
+	spin_lock(&dasd_devmap_lock);
+	if (ro_flag)
+		devmap->features |= DASD_FEATURE_READONLY;
+	else
+		devmap->features &= ~DASD_FEATURE_READONLY;
+	if (devmap->device) {
+		if (devmap->device->gdp)
+			set_disk_ro(devmap->device->gdp, ro_flag);
+		devmap->device->ro_flag = ro_flag;
+	}
+	spin_unlock(&dasd_devmap_lock);
+	return count;
+}
+
+static DEVICE_ATTR(readonly, 0644, dasd_ro_show, dasd_ro_store);
+
+/*
+ * use_diag controls whether the driver should use diag rather than ssch
+ * to talk to the device
+ */
+/* TODO: Implement */
+static ssize_t 
+dasd_use_diag_show(struct device *dev, char *buf)
+{
+	struct dasd_devmap *devmap;
+	int use_diag;
+
+	devmap = dev->driver_data;
+	if (devmap)
+		use_diag = (devmap->features & DASD_FEATURE_USEDIAG) != 0;
+	else
+		use_diag = (DASD_FEATURE_DEFAULT & DASD_FEATURE_USEDIAG) != 0;
+	return sprintf(buf, use_diag ? "1\n" : "0\n");
+}
+
+static ssize_t
+dasd_use_diag_store(struct device *dev, const char *buf, size_t count)
+{
+	struct dasd_devmap *devmap;
+	int use_diag;
+
+	devmap = dasd_devmap_from_cdev(to_ccwdev(dev));
+	use_diag = buf[0] == '1';
+	spin_lock(&dasd_devmap_lock);
+	/* Changing diag discipline flag is only allowed in offline state. */
+	if (!devmap->device) {
+		if (use_diag)
+			devmap->features |= DASD_FEATURE_USEDIAG;
+		else
+			devmap->features &= ~DASD_FEATURE_USEDIAG;
+	} else
+		count = -EPERM;
+	spin_unlock(&dasd_devmap_lock);
+	return count;
+}
+
+static
+DEVICE_ATTR(use_diag, 0644, dasd_use_diag_show, dasd_use_diag_store);
+
+static ssize_t
+dasd_discipline_show(struct device *dev, char *buf)
+{
+	struct dasd_devmap *devmap;
+	char *dname;
+
+	spin_lock(&dasd_devmap_lock);
+	dname = "none";
+	devmap = dev->driver_data;
+	if (devmap && devmap->device && devmap->device->discipline)
+		dname = devmap->device->discipline->name;
+	spin_unlock(&dasd_devmap_lock);
+	return snprintf(buf, PAGE_SIZE, "%s\n", dname);
+}
+
+static DEVICE_ATTR(discipline, 0444, dasd_discipline_show, NULL);
+
+static struct attribute * dasd_attrs[] = {
+	&dev_attr_readonly.attr,
+	&dev_attr_discipline.attr,
+	&dev_attr_use_diag.attr,
+	NULL,
+};
+
+static struct attribute_group dasd_attr_group = {
+	.attrs = dasd_attrs,
+};
+
+int
+dasd_add_sysfs_files(struct ccw_device *cdev)
+{
+	return sysfs_create_group(&cdev->dev.kobj, &dasd_attr_group);
 }
 
 int
diff -Nru a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
--- a/drivers/s390/block/dasd_diag.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/s390/block/dasd_diag.c	Tue Feb  3 19:45:16 2004
@@ -6,7 +6,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
  *
- * $Revision: 1.32 $
+ * $Revision: 1.33 $
  */
 
 #include <linux/config.h>
@@ -393,7 +393,7 @@
 	recid = first_rec;
 	rq_for_each_bio(bio, req) {
 		bio_for_each_segment(bv, bio, i) {
-			dst = kmap(bv->bv_page) + bv->bv_offset;
+			dst = page_address(bv->bv_page) + bv->bv_offset;
 			for (off = 0; off < bv->bv_len; off += blksize) {
 				memset(dbio, 0, sizeof (struct dasd_diag_bio));
 				dbio->type = rw_cmd;
diff -Nru a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
--- a/drivers/s390/block/dasd_eckd.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/s390/block/dasd_eckd.c	Tue Feb  3 19:45:16 2004
@@ -7,7 +7,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
  *
- * $Revision: 1.47 $
+ * $Revision: 1.49 $
  */
 
 #include <linux/config.h>
@@ -103,6 +103,7 @@
 	.remove      = dasd_generic_remove,
 	.set_offline = dasd_generic_set_offline,
 	.set_online  = dasd_eckd_set_online,
+	.notify      = dasd_generic_notify,
 };
 
 static const int sizes_trk0[] = { 28, 148, 84 };
@@ -460,8 +461,8 @@
 	/* Invalidate status of initial analysis. */
 	private->init_cqr_status = -1;
 	/* Set default cache operations. */
-	private->attrib.operation = DASD_SEQ_ACCESS;
-	private->attrib.nr_cyl = 0x02;
+	private->attrib.operation = DASD_NORMAL_CACHE;
+	private->attrib.nr_cyl = 0;
 
 	/* Read Device Characteristics */
 	rdc_data = (void *) &(private->rdc_data);
@@ -1292,6 +1293,36 @@
 }
 
 /*
+ * Get attributes (cache operations)
+ * Returnes the cache attributes used in Define Extend (DE).
+ */
+static int
+dasd_eckd_get_attrib (struct block_device *bdev, int no, long args)
+{
+	struct dasd_device *device;
+        struct dasd_eckd_private *private;
+        struct attrib_data_t attrib;
+	int rc;
+
+        if (!capable(CAP_SYS_ADMIN))
+                return -EACCES;
+        if (!args)
+                return -EINVAL;
+
+        device = bdev->bd_disk->private_data;
+        if (device == NULL)
+                return -ENODEV;
+
+        private = (struct dasd_eckd_private *) device->private;
+        attrib = private->attrib;
+	
+        rc = copy_to_user((long *) args, (long *) &attrib,
+			  sizeof (struct attrib_data_t));
+	
+	return rc;
+}
+
+/*
  * Set attributes (cache operations)
  * Stores the attributes for cache operation to be used in Define Extend (DE).
  */
@@ -1433,6 +1464,8 @@
 {
 	int ret;
 
+	dasd_ioctl_no_register(THIS_MODULE, BIODASDGATTR,
+			       dasd_eckd_get_attrib);
 	dasd_ioctl_no_register(THIS_MODULE, BIODASDSATTR,
 			       dasd_eckd_set_attrib);
 	dasd_ioctl_no_register(THIS_MODULE, BIODASDPSRD,
@@ -1448,6 +1481,8 @@
 
 	ret = ccw_driver_register(&dasd_eckd_driver);
 	if (ret) {
+		dasd_ioctl_no_unregister(THIS_MODULE, BIODASDGATTR,
+					 dasd_eckd_get_attrib);
 		dasd_ioctl_no_unregister(THIS_MODULE, BIODASDSATTR,
 					 dasd_eckd_set_attrib);
 		dasd_ioctl_no_unregister(THIS_MODULE, BIODASDPSRD,
@@ -1470,6 +1505,8 @@
 {
 	ccw_driver_unregister(&dasd_eckd_driver);
 
+	dasd_ioctl_no_unregister(THIS_MODULE, BIODASDGATTR,
+				 dasd_eckd_get_attrib);
 	dasd_ioctl_no_unregister(THIS_MODULE, BIODASDSATTR,
 				 dasd_eckd_set_attrib);
 	dasd_ioctl_no_unregister(THIS_MODULE, BIODASDPSRD,
diff -Nru a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c
--- a/drivers/s390/block/dasd_fba.c	Tue Feb  3 19:45:33 2004
+++ b/drivers/s390/block/dasd_fba.c	Tue Feb  3 19:45:33 2004
@@ -4,7 +4,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
  *
- * $Revision: 1.30 $
+ * $Revision: 1.32 $
  */
 
 #include <linux/config.h>
@@ -80,6 +80,7 @@
 	.remove      = dasd_generic_remove,
 	.set_offline = dasd_generic_set_offline,
 	.set_online  = dasd_fba_set_online,
+	.notify      = dasd_generic_notify,
 };
 
 static inline void
@@ -269,7 +270,7 @@
 				return ERR_PTR(-EINVAL);
 			count += bv->bv_len >> (device->s2b_shift + 9);
 #if defined(CONFIG_ARCH_S390X)
-			cidaw += idal_nr_words(kmap(bv->bv_page) +
+			cidaw += idal_nr_words(page_address(bv->bv_page) +
 					       bv->bv_offset, bv->bv_len);
 #endif
 		}
@@ -309,7 +310,7 @@
 	}
 	recid = first_rec;
 	rq_for_each_bio(bio, req) bio_for_each_segment(bv, bio, i) {
-		dst = kmap(bv->bv_page) + bv->bv_offset;
+		dst = page_address(bv->bv_page) + bv->bv_offset;
 		for (off = 0; off < bv->bv_len; off += blksize) {
 			/* Locate record for stupid devices. */
 			if (private->rdc_data.mode.bits.data_chain == 0) {
diff -Nru a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c
--- a/drivers/s390/block/dasd_genhd.c	Tue Feb  3 19:45:35 2004
+++ b/drivers/s390/block/dasd_genhd.c	Tue Feb  3 19:45:35 2004
@@ -9,7 +9,7 @@
  *
  * gendisk related functions for the dasd driver.
  *
- * $Revision: 1.41 $
+ * $Revision: 1.42 $
  */
 
 #include <linux/config.h>
@@ -31,7 +31,6 @@
 dasd_gendisk_alloc(struct dasd_device *device)
 {
 	struct gendisk *gdp;
-	int len;
 
 	/* Make sure the minor for this device exists. */
 	if (device->devindex >= DASD_PER_MAJOR)
@@ -47,22 +46,8 @@
 	gdp->fops = &dasd_device_operations;
 	gdp->driverfs_dev = &device->cdev->dev;
 
-	/*
-	 * Set device name.
-	 *   dasda - dasdz : 26 devices
-	 *   dasdaa - dasdzz : 676 devices, added up = 702
-	 *   dasdaaa - dasdzzz : 17576 devices, added up = 18278
-	 */
-	len = sprintf(gdp->disk_name, "dasd");
-	if (device->devindex > 25) {
-		if (device->devindex > 701)
-			len += sprintf(gdp->disk_name + len, "%c",
-				       'a'+(((device->devindex-702)/676)%26));
-		len += sprintf(gdp->disk_name + len, "%c",
-			       'a'+(((device->devindex-26)/26)%26));
-	}
-	len += sprintf(gdp->disk_name + len, "%c", 'a'+(device->devindex%26));
-
+	/* Set device name */
+ 	sprintf(gdp->disk_name, "dasd_%s_", device->cdev->dev.bus_id);
  	sprintf(gdp->devfs_name, "dasd/%s", device->cdev->dev.bus_id);
 
 	if (device->ro_flag)
diff -Nru a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
--- a/drivers/s390/block/dasd_int.h	Tue Feb  3 19:45:34 2004
+++ b/drivers/s390/block/dasd_int.h	Tue Feb  3 19:45:34 2004
@@ -6,7 +6,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
  *
- * $Revision: 1.48 $
+ * $Revision: 1.52 $
  */
 
 #ifndef DASD_INT_H
@@ -268,6 +268,7 @@
 	unsigned int s2b_shift;		/* log2 (bp_block/512) */
 	int ro_flag;			/* read-only flag */
 	int use_diag_flag;		/* diag allowed flag */
+	int disconnect_error_flag;	/* return -EIO when disconnected */
 
 
 	/* Device discipline stuff. */
@@ -308,6 +309,8 @@
 #define DASD_STOPPED_NOT_ACC 1         /* not accessible */
 #define DASD_STOPPED_QUIESCE 2         /* Quiesced */
 #define DASD_STOPPED_PENDING 4         /* long busy */
+#define DASD_STOPPED_DC_WAIT 8         /* disconnected, wait */
+#define DASD_STOPPED_DC_EIO  16        /* disconnected, return -EIO */
 
 
 void dasd_put_device_wake(struct dasd_device *);
@@ -458,9 +461,10 @@
 void dasd_clear_timer(struct dasd_device *);
 int  dasd_cancel_req(struct dasd_ccw_req *);
 int dasd_generic_probe (struct ccw_device *, struct dasd_discipline *);
-int dasd_generic_remove (struct ccw_device *cdev);
+void dasd_generic_remove (struct ccw_device *cdev);
 int dasd_generic_set_online(struct ccw_device *, struct dasd_discipline *);
 int dasd_generic_set_offline (struct ccw_device *cdev);
+int dasd_generic_notify(struct ccw_device *, int);
 void dasd_generic_auto_online (struct ccw_driver *);
 
 /* externals in dasd_devmap.c */
@@ -474,10 +478,11 @@
 struct dasd_device *dasd_create_device(struct ccw_device *);
 void dasd_delete_device(struct dasd_device *);
 
+int dasd_add_sysfs_files(struct ccw_device *);
+struct dasd_device *dasd_device_from_cdev(struct ccw_device *);
 struct dasd_device *dasd_device_from_devindex(int);
 
 int dasd_parse(void);
-int dasd_add_busid(char *, int);
 int dasd_busid_known(char *);
 
 /* externals in dasd_gendisk.c */
diff -Nru a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c
--- a/drivers/s390/block/dasd_proc.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/block/dasd_proc.c	Tue Feb  3 19:45:17 2004
@@ -9,7 +9,7 @@
  *
  * /proc interface for the dasd driver.
  *
- * $Revision: 1.23 $
+ * $Revision: 1.24 $
  */
 
 #include <linux/config.h>
@@ -67,15 +67,10 @@
 		seq_printf(m, "(none)");
 	/* Print kdev. */
 	if (device->gdp)
-		seq_printf(m, " at (%3d:%3d)",
+		seq_printf(m, " at (%3d:%7d)",
 			   device->gdp->major, device->gdp->first_minor);
 	else
-		seq_printf(m, "  at (???:???)");
-	/* Print device name. */
-	if (device->gdp)
-		seq_printf(m, " is %-7s", device->gdp->disk_name);
-	else
-		seq_printf(m, " is ???????");
+		seq_printf(m, "  at (???:???????)");
 	/* Print devices features. */
 	substr = device->ro_flag ? "(ro)" : " ";
 	seq_printf(m, "%4s: ", substr);
diff -Nru a/drivers/s390/char/Makefile b/drivers/s390/char/Makefile
--- a/drivers/s390/char/Makefile	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/char/Makefile	Tue Feb  3 19:45:17 2004
@@ -2,18 +2,20 @@
 # S/390 character devices
 #
 
-tub3270-objs := tuball.o tubfs.o tubtty.o \
-                     tubttyaid.o tubttybld.o tubttyscl.o \
-                     tubttyrcl.o tubttysiz.o
+obj-y += ctrlchar.o keyboard.o defkeymap.o
+
+tub3270-objs := raw3270.o tty3270.o fs3270.o
+obj-$(CONFIG_TN3270) += tub3270.o
+obj-$(CONFIG_TN3270_CONSOLE) += con3270.o
 
-obj-y += ctrlchar.o
 obj-$(CONFIG_TN3215) += con3215.o
+
 obj-$(CONFIG_SCLP) += sclp.o sclp_rw.o
 obj-$(CONFIG_SCLP_TTY) += sclp_tty.o
 obj-$(CONFIG_SCLP_CONSOLE) += sclp_con.o
 obj-$(CONFIG_SCLP_VT220_TTY) += sclp_vt220.o
 obj-$(CONFIG_SCLP_CPI) += sclp_cpi.o
-obj-$(CONFIG_TN3270) += tub3270.o
+
 tape-$(CONFIG_S390_TAPE_BLOCK) += tape_block.o
 tape-$(CONFIG_PROC_FS) += tape_proc.o
 tape-objs := tape_core.o tape_std.o tape_char.o $(tape-y)
diff -Nru a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
--- a/drivers/s390/char/con3215.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/s390/char/con3215.c	Tue Feb  3 19:45:34 2004
@@ -96,6 +96,7 @@
 	int msg_dstat;		      /* dstat for pending message */
 	int msg_cstat;		      /* cstat for pending message */
 	int line_pos;		      /* position on the line (for tabs) */
+	char ubuffer[80];	      /* copy_from_user buffer */
 };
 
 /* array of 3215 devices structures */
@@ -532,15 +533,12 @@
 /*
  * String write routine for 3215 devices
  */
-static int
-raw3215_write(struct raw3215_info *raw, const char *str,
-	      int from_user, unsigned int length)
+static void
+raw3215_write(struct raw3215_info *raw, const char *str, unsigned int length)
 {
 	unsigned long flags;
-	int ret, c;
-	int count;
+	int c, count;
 
-	ret = 0;
 	while (length > 0) {
 		spin_lock_irqsave(raw->lock, flags);
 		count = (length > RAW3215_BUFFER_SIZE) ?
@@ -550,46 +548,19 @@
 		raw3215_make_room(raw, count);
 
 		/* copy string to output buffer and convert it to EBCDIC */
-		if (from_user) {
-			while (1) {
-				c = min_t(int, count,
-					min(RAW3215_BUFFER_SIZE - raw->count,
-					    RAW3215_BUFFER_SIZE - raw->head));
-				if (c <= 0)
-					break;
-				c -= copy_from_user(raw->buffer + raw->head,
-						    str, c);
-				if (c == 0) {
-					if (!ret)
-						ret = -EFAULT;
-					break;
-				}
-				ASCEBC(raw->buffer + raw->head, c);
-				raw->head = (raw->head + c) &
-					    (RAW3215_BUFFER_SIZE - 1);
-				raw->count += c;
-				raw->line_pos += c;
-				str += c;
-				count -= c;
-				ret += c;
-			}
-		} else {
-			while (1) {
-				c = min_t(int, count,
-					min(RAW3215_BUFFER_SIZE - raw->count,
-					    RAW3215_BUFFER_SIZE - raw->head));
-				if (c <= 0)
-					break;
-				memcpy(raw->buffer + raw->head, str, c);
-				ASCEBC(raw->buffer + raw->head, c);
-				raw->head = (raw->head + c) &
-					    (RAW3215_BUFFER_SIZE - 1);
-				raw->count += c;
-				raw->line_pos += c;
-				str += c;
-				count -= c;
-				ret += c;
-			}
+		while (1) {
+			c = min_t(int, count,
+				  min(RAW3215_BUFFER_SIZE - raw->count,
+				      RAW3215_BUFFER_SIZE - raw->head));
+			if (c <= 0)
+				break;
+			memcpy(raw->buffer + raw->head, str, c);
+			ASCEBC(raw->buffer + raw->head, c);
+			raw->head = (raw->head + c) & (RAW3215_BUFFER_SIZE - 1);
+			raw->count += c;
+			raw->line_pos += c;
+			str += c;
+			count -= c;
 		}
 		if (!(raw->flags & RAW3215_WORKING)) {
 			raw3215_mk_write_req(raw);
@@ -598,8 +569,6 @@
 		}
 		spin_unlock_irqrestore(raw->lock, flags);
 	}
-
-	return ret;
 }
 
 /*
@@ -752,11 +721,12 @@
 	return 0;
 }
 
-static int
+static void
 raw3215_remove (struct ccw_device *cdev)
 {
 	struct raw3215_info *raw;
 
+	ccw_device_set_offline(cdev);
 	raw = cdev->dev.driver_data;
 	if (raw) {
 		cdev->dev.driver_data = NULL;
@@ -764,7 +734,6 @@
 			kfree(raw->buffer);
 		kfree(raw);
 	}
-	return 0;
 }
 
 static int
@@ -825,7 +794,7 @@
 		for (i = 0; i < count; i++)
 			if (str[i] == '\t' || str[i] == '\n')
 				break;
-		raw3215_write(raw, str, 0, i);
+		raw3215_write(raw, str, i);
 		count -= i;
 		str += i;
 		if (count > 0) {
@@ -1021,12 +990,29 @@
 	      const unsigned char *buf, int count)
 {
 	struct raw3215_info *raw;
-	int ret = 0;
+	int length, ret;
 
 	if (!tty)
 		return 0;
 	raw = (struct raw3215_info *) tty->driver_data;
-	ret = raw3215_write(raw, buf, from_user, count);
+	if (!from_user) {
+		raw3215_write(raw, buf, count);
+		return count;
+	}
+	ret = 0;
+	while (count > 0) {
+		length = count < 80 ? count : 80;
+		length -= copy_from_user(raw->ubuffer, buf, length);
+		if (length == 0) {
+			if (!ret)
+				ret = -EFAULT;
+			break;
+		}
+		raw3215_write(raw, raw->ubuffer, count);
+		buf += length;
+		count -= length;
+		ret += length;
+	}
 	return ret;
 }
 
diff -Nru a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/s390/char/con3270.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,639 @@
+/*
+ *  drivers/s390/char/con3270.c
+ *    IBM/3270 Driver - console view.
+ *
+ *  Author(s):
+ *    Original 3270 Code for 2.4 written by Richard Hitt (UTS Global)
+ *    Rewritten for 2.5 by Martin Schwidefsky <schwidefsky@de.ibm.com>
+ *	-- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ */
+
+#include <linux/config.h>
+#include <linux/bootmem.h>
+#include <linux/console.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/list.h>
+#include <linux/types.h>
+
+#include <asm/ccwdev.h>
+#include <asm/cio.h>
+#include <asm/cpcmd.h>
+#include <asm/ebcdic.h>
+
+#include "raw3270.h"
+#include "ctrlchar.h"
+
+#define CON3270_OUTPUT_BUFFER_SIZE 1024
+#define CON3270_STRING_PAGES 4
+
+static struct raw3270_fn con3270_fn;
+
+/*
+ * Main 3270 console view data structure.
+ */
+struct con3270 {
+	struct raw3270_view view;
+	spinlock_t lock;
+	struct list_head freemem;	/* list of free memory for strings. */
+
+	/* Output stuff. */
+	struct list_head lines;		/* list of lines. */
+	struct list_head update;	/* list of lines to update. */
+	int line_nr;			/* line number for next update. */
+	int nr_lines;			/* # lines in list. */
+	int nr_up;			/* # lines up in history. */
+	unsigned long update_flags;	/* Update indication bits. */
+	struct string *cline;		/* current output line. */
+	struct string *status;		/* last line of display. */
+	struct raw3270_request *write;	/* single write request. */
+	struct timer_list timer;
+
+	/* Input stuff. */
+	struct string *input;		/* input string for read request. */
+	struct raw3270_request *read;	/* single read request. */
+	struct raw3270_request *kreset;	/* single keyboard reset request. */
+	struct tasklet_struct readlet;	/* tasklet to issue read request. */
+};
+
+static struct con3270 *condev;
+
+/* con3270->update_flags. See con3270_update for details. */
+#define CON_UPDATE_ERASE	1	/* Use EWRITEA instead of WRITE. */
+#define CON_UPDATE_LIST		2	/* Update lines in tty3270->update. */
+#define CON_UPDATE_STATUS	4	/* Update status line. */
+#define CON_UPDATE_ALL		7
+
+static void con3270_update(struct con3270 *);
+
+/*
+ * Setup timeout for a device. On timeout trigger an update.
+ */
+void
+con3270_set_timer(struct con3270 *cp, int expires)
+{
+	if (expires == 0) {
+		if (timer_pending(&cp->timer))
+			del_timer(&cp->timer);
+		return;
+	}
+	if (timer_pending(&cp->timer)) {
+		if (mod_timer(&cp->timer, jiffies + expires))
+			return;
+	}
+	cp->timer.function = (void (*)(unsigned long)) con3270_update;
+	cp->timer.data = (unsigned long) cp;
+	cp->timer.expires = jiffies + expires;
+	add_timer(&cp->timer);
+}
+
+/*
+ * The status line is the last line of the screen. It shows the string
+ * "console view" in the lower left corner and "Running"/"More..."/"Holding"
+ * in the lower right corner of the screen.
+ */
+static void
+con3270_update_status(struct con3270 *cp)
+{
+	char *str;
+
+	str = (cp->nr_up != 0) ? "History" : "Running";
+	memcpy(cp->status->string + 24, str, 7);
+	codepage_convert(cp->view.ascebc, cp->status->string + 24, 7);
+	cp->update_flags |= CON_UPDATE_STATUS;
+}
+
+static void
+con3270_create_status(struct con3270 *cp)
+{
+	static const unsigned char blueprint[] =
+		{ TO_SBA, 0, 0, TO_SF,TF_LOG,TO_SA,TAT_COLOR, TAC_GREEN,
+		  'c','o','n','s','o','l','e',' ','v','i','e','w',
+		  TO_RA,0,0,0,'R','u','n','n','i','n','g',TO_SF,TF_LOG };
+
+	cp->status = alloc_string(&cp->freemem, sizeof(blueprint));
+	/* Copy blueprint to status line */
+	memcpy(cp->status->string, blueprint, sizeof(blueprint));
+	/* Set TO_RA addresses. */
+	raw3270_buffer_address(cp->view.dev, cp->status->string + 1,
+			       cp->view.cols * (cp->view.rows - 1));
+	raw3270_buffer_address(cp->view.dev, cp->status->string + 21,
+			       cp->view.cols * cp->view.rows - 8);
+	/* Convert strings to ebcdic. */
+	codepage_convert(cp->view.ascebc, cp->status->string + 8, 12);
+	codepage_convert(cp->view.ascebc, cp->status->string + 24, 7);
+}
+
+/*
+ * Set output offsets to 3270 datastream fragment of a console string.
+ */
+static void
+con3270_update_string(struct con3270 *cp, struct string *s, int nr)
+{
+	if (s->len >= cp->view.cols - 5)
+		return;
+	raw3270_buffer_address(cp->view.dev, s->string + s->len - 3,
+			       cp->view.cols * (nr + 1));
+}
+
+/*
+ * Rebuild update list to print all lines.
+ */
+static void
+con3270_rebuild_update(struct con3270 *cp)
+{
+	struct string *s, *n;
+	int nr;
+
+	/* 
+	 * Throw away update list and create a new one,
+	 * containing all lines that will fit on the screen.
+	 */
+	list_for_each_entry_safe(s, n, &cp->update, update)
+		list_del_init(&s->update);
+	nr = cp->view.rows - 2 + cp->nr_up;
+	list_for_each_entry_reverse(s, &cp->lines, list) {
+		if (nr < cp->view.rows - 1)
+			list_add(&s->update, &cp->update);
+		if (--nr < 0)
+			break;
+	}
+	cp->line_nr = 0;
+	cp->update_flags |= CON_UPDATE_LIST;
+}
+
+/*
+ * Alloc string for size bytes. Free strings from history if necessary.
+ */
+static struct string *
+con3270_alloc_string(struct con3270 *cp, size_t size)
+{
+	struct string *s, *n;
+
+	s = alloc_string(&cp->freemem, size);
+	if (s)
+		return s;
+	list_for_each_entry_safe(s, n, &cp->lines, list) {
+		list_del(&s->list);
+		if (!list_empty(&s->update))
+			list_del(&s->update);
+		cp->nr_lines--;
+		if (free_string(&cp->freemem, s) >= size)
+			break;
+	}
+	s = alloc_string(&cp->freemem, size);
+	BUG_ON(!s);
+	if (cp->nr_up != 0 && cp->nr_up + cp->view.rows > cp->nr_lines) {
+		cp->nr_up = cp->nr_lines - cp->view.rows + 1;
+		con3270_rebuild_update(cp);
+		con3270_update_status(cp);
+	}
+	return s;
+}
+
+/*
+ * Write completion callback.
+ */
+static void
+con3270_write_callback(struct raw3270_request *rq, void *data)
+{
+	raw3270_request_reset(rq);
+	xchg(&((struct con3270 *) rq->view)->write, rq);
+}
+
+/*
+ * Update console display.
+ */
+static void
+con3270_update(struct con3270 *cp)
+{
+	struct raw3270_request *wrq;
+	char wcc, prolog[6];
+	unsigned long flags;
+	unsigned long updated;
+	struct string *s, *n;
+	int rc;
+
+	wrq = xchg(&cp->write, 0);
+	if (!wrq) {
+		con3270_set_timer(cp, 1);
+		return;
+	}
+
+	spin_lock_irqsave(&cp->view.lock, flags);
+	updated = 0;
+	if (cp->update_flags & CON_UPDATE_ERASE) {
+		/* Use erase write alternate to initialize display. */
+		raw3270_request_set_cmd(wrq, TC_EWRITEA);
+		updated |= CON_UPDATE_ERASE;
+	} else
+		raw3270_request_set_cmd(wrq, TC_WRITE);
+
+	wcc = TW_NONE;
+	raw3270_request_add_data(wrq, &wcc, 1);
+
+	/*
+	 * Update status line.
+	 */
+	if (cp->update_flags & CON_UPDATE_STATUS)
+		if (raw3270_request_add_data(wrq, cp->status->string,
+					     cp->status->len) == 0)
+			updated |= CON_UPDATE_STATUS;
+
+	if (cp->update_flags & CON_UPDATE_LIST) {
+		prolog[0] = TO_SBA;
+		prolog[3] = TO_SA;
+		prolog[4] = TAT_COLOR;
+		prolog[5] = TAC_TURQ;
+		raw3270_buffer_address(cp->view.dev, prolog + 1,
+				       cp->view.cols * cp->line_nr);
+		raw3270_request_add_data(wrq, prolog, 6);
+		/* Write strings in the update list to the screen. */
+		list_for_each_entry_safe(s, n, &cp->update, update) {
+			if (s != cp->cline)
+				con3270_update_string(cp, s, cp->line_nr);
+			if (raw3270_request_add_data(wrq, s->string,
+						     s->len) != 0)
+				break;
+			list_del_init(&s->update);
+			if (s != cp->cline)
+				cp->line_nr++;
+		}
+		if (list_empty(&cp->update))
+			updated |= CON_UPDATE_LIST;
+	}
+	wrq->callback = con3270_write_callback;
+	rc = raw3270_start(&cp->view, wrq);
+	if (rc == 0) {
+		cp->update_flags &= ~updated;
+		if (cp->update_flags)
+			con3270_set_timer(cp, 1);
+	} else {
+		raw3270_request_reset(wrq);
+		xchg(&cp->write, wrq);
+	}
+	spin_unlock_irqrestore(&cp->view.lock, flags);
+}
+
+/*
+ * Read tasklet.
+ */
+static void
+con3270_read_tasklet(struct raw3270_request *rrq)
+{
+	static char kreset_data = TW_KR;
+	struct con3270 *cp;
+	unsigned long flags;
+	int nr_up, deactivate;
+
+	cp = (struct con3270 *) rrq->view;
+	spin_lock_irqsave(&cp->view.lock, flags);
+	nr_up = cp->nr_up;
+	deactivate = 0;
+	/* Check aid byte. */
+	switch (cp->input->string[0]) {
+	case 0x7d:	/* enter: jump to bottom. */
+		nr_up = 0;
+		break;
+	case 0xf3:	/* PF3: deactivate the console view. */
+		deactivate = 1;
+		break;
+	case 0x6d:	/* clear: start from scratch. */
+		con3270_rebuild_update(cp);
+		cp->update_flags = CON_UPDATE_ALL;
+		con3270_set_timer(cp, 1);
+		break;
+	case 0xf7:	/* PF7: do a page up in the console log. */
+		nr_up += cp->view.rows - 2;
+		if (nr_up + cp->view.rows - 1 > cp->nr_lines) {
+			nr_up = cp->nr_lines - cp->view.rows + 1;
+			if (nr_up < 0)
+				nr_up = 0;
+		}
+		break;
+	case 0xf8:	/* PF8: do a page down in the console log. */
+		nr_up -= cp->view.rows - 2;
+		if (nr_up < 0)
+			nr_up = 0;
+		break;
+	}
+	if (nr_up != cp->nr_up) {
+		cp->nr_up = nr_up;
+		con3270_rebuild_update(cp);
+		con3270_update_status(cp);
+		con3270_set_timer(cp, 1);
+	}
+	spin_unlock_irqrestore(&cp->view.lock, flags);
+
+	/* Start keyboard reset command. */
+	raw3270_request_reset(cp->kreset);
+	raw3270_request_set_cmd(cp->kreset, TC_WRITE);
+	raw3270_request_add_data(cp->kreset, &kreset_data, 1);
+	raw3270_start(&cp->view, cp->kreset);
+
+	if (deactivate)
+		raw3270_deactivate_view(&cp->view);
+
+	raw3270_request_reset(rrq);
+	xchg(&cp->read, rrq);
+	raw3270_put_view(&cp->view);
+}
+
+/*
+ * Read request completion callback.
+ */
+static void
+con3270_read_callback(struct raw3270_request *rq, void *data)
+{
+	raw3270_get_view(rq->view);
+	/* Schedule tasklet to pass input to tty. */
+	tasklet_schedule(&((struct con3270 *) rq->view)->readlet);
+}
+
+/*
+ * Issue a read request. Called only from interrupt function.
+ */
+static void
+con3270_issue_read(struct con3270 *cp)
+{
+	struct raw3270_request *rrq;
+	int rc;
+
+	rrq = xchg(&cp->read, 0);
+	if (!rrq)
+		/* Read already scheduled. */
+		return;
+	rrq->callback = con3270_read_callback;
+	rrq->callback_data = cp;
+	raw3270_request_set_cmd(rrq, TC_READMOD);
+	raw3270_request_set_data(rrq, cp->input->string, cp->input->len);
+	/* Issue the read modified request. */
+	rc = raw3270_start_irq(&cp->view, rrq);
+	if (rc)
+		raw3270_request_reset(rrq);
+}
+
+/*
+ * Switch to the console view.
+ */
+static int
+con3270_activate(struct raw3270_view *view)
+{
+	unsigned long flags;
+	struct con3270 *cp;
+
+	cp = (struct con3270 *) view;
+	spin_lock_irqsave(&cp->view.lock, flags);
+	cp->nr_up = 0;
+	con3270_rebuild_update(cp);
+	con3270_update_status(cp);
+	cp->update_flags = CON_UPDATE_ALL;
+	con3270_set_timer(cp, 1);
+	spin_unlock_irqrestore(&cp->view.lock, flags);
+	return 0;
+}
+
+static void
+con3270_deactivate(struct raw3270_view *view)
+{
+	unsigned long flags;
+	struct con3270 *cp;
+
+	cp = (struct con3270 *) view;
+	spin_lock_irqsave(&cp->view.lock, flags);
+	del_timer(&cp->timer);
+	spin_unlock_irqrestore(&cp->view.lock, flags);
+}
+
+static int
+con3270_irq(struct con3270 *cp, struct raw3270_request *rq, struct irb *irb)
+{
+	/* Handle ATTN. Schedule tasklet to read aid. */
+	if (irb->scsw.dstat & DEV_STAT_ATTENTION)
+		con3270_issue_read(cp);
+
+	if (rq) {
+		if (irb->scsw.dstat & DEV_STAT_UNIT_CHECK)
+			rq->rc = -EIO;
+		else
+			/* Normal end. Copy residual count. */
+			rq->rescnt = irb->scsw.count;
+	}
+	return RAW3270_IO_DONE;
+}
+
+/* Console view to a 3270 device. */
+static struct raw3270_fn con3270_fn = {
+	.activate = con3270_activate,
+	.deactivate = con3270_deactivate,
+	.intv = (void *) con3270_irq
+};
+
+static inline void
+con3270_cline_add(struct con3270 *cp)
+{
+	if (!list_empty(&cp->cline->list))
+		/* Already added. */
+		return;
+	list_add_tail(&cp->cline->list, &cp->lines);
+	cp->nr_lines++;
+	con3270_rebuild_update(cp);
+}
+
+static inline void
+con3270_cline_insert(struct con3270 *cp, unsigned char c)
+{
+	cp->cline->string[cp->cline->len++] = 
+		cp->view.ascebc[(c < ' ') ? ' ' : c];
+	if (list_empty(&cp->cline->update)) {
+		list_add_tail(&cp->cline->update, &cp->update);
+		cp->update_flags |= CON_UPDATE_LIST;
+	}
+}
+
+static inline void
+con3270_cline_end(struct con3270 *cp)
+{
+	struct string *s;
+	unsigned int size;
+
+	/* Copy cline. */
+	size = (cp->cline->len < cp->view.cols - 5) ?
+		cp->cline->len + 4 : cp->view.cols;
+	s = con3270_alloc_string(cp, size);
+	memcpy(s->string, cp->cline->string, cp->cline->len);
+	if (s->len < cp->view.cols - 5) {
+		s->string[s->len - 4] = TO_RA;
+		s->string[s->len - 1] = 0;
+	} else {
+		while (--size > cp->cline->len)
+			s->string[size] = cp->view.ascebc[' '];
+	}
+	/* Replace cline with allocated line s and reset cline. */
+	list_add(&s->list, &cp->cline->list);
+	list_del_init(&cp->cline->list);
+	if (!list_empty(&cp->cline->update)) {
+		list_add(&s->update, &cp->cline->update);
+		list_del_init(&cp->cline->update);
+	}
+	cp->cline->len = 0;
+}
+
+/*
+ * Write a string to the 3270 console
+ */
+static void
+con3270_write(struct console *co, const char *str, unsigned int count)
+{
+	struct con3270 *cp;
+	unsigned long flags;
+	unsigned char c;
+
+	cp = condev;
+	if (cp->view.dev)
+		raw3270_activate_view(&cp->view);
+	spin_lock_irqsave(&cp->view.lock, flags);
+	while (count-- > 0) {
+		c = *str++;
+		if (cp->cline->len == 0)
+			con3270_cline_add(cp);
+		if (c != '\n')
+			con3270_cline_insert(cp, c);
+		if (c == '\n' || cp->cline->len >= cp->view.cols)
+			con3270_cline_end(cp);
+	}
+	/* Setup timer to output current console buffer after 1/10 second */
+	if (cp->view.dev && !timer_pending(&cp->timer))
+		con3270_set_timer(cp, HZ/10);
+	spin_unlock_irqrestore(&cp->view.lock,flags);
+}
+
+extern struct tty_driver *tty3270_driver;
+
+static struct tty_driver *
+con3270_device(struct console *c, int *index)
+{
+	*index = c->index;
+	return tty3270_driver;
+}
+
+/*
+ * Wait for end of write request.
+ */
+static void
+con3270_wait_write(struct con3270 *cp)
+{
+	while (!cp->write) {
+		raw3270_wait_cons_dev(cp->view.dev);
+		barrier();
+	}
+}
+
+/*
+ * panic() calls console_unblank before the system enters a
+ * disabled, endless loop.
+ */
+static void
+con3270_unblank(void)
+{
+	struct con3270 *cp;
+	unsigned long flags;
+
+	cp = condev;
+	if (!cp->view.dev)
+		return;
+	spin_lock_irqsave(&cp->view.lock, flags);
+	con3270_wait_write(cp);
+	cp->nr_up = 0;
+	con3270_rebuild_update(cp);
+	con3270_update_status(cp);
+	while (cp->update_flags != 0) {
+		spin_unlock_irqrestore(&cp->view.lock, flags);
+		con3270_update(cp);
+		spin_lock_irqsave(&cp->view.lock, flags);
+		con3270_wait_write(cp);
+	}
+	spin_unlock_irqrestore(&cp->view.lock, flags);
+}
+
+static int __init 
+con3270_consetup(struct console *co, char *options)
+{
+	return 0;
+}
+
+/*
+ *  The console structure for the 3270 console
+ */
+static struct console con3270 = {
+	.name	 = "tty3270",
+	.write	 = con3270_write,
+	.device	 = con3270_device,
+	.unblank = con3270_unblank,
+	.setup	 = con3270_consetup,
+	.flags	 = CON_PRINTBUFFER,
+};
+
+/*
+ * 3270 console initialization code called from console_init().
+ * NOTE: This is called before kmalloc is available.
+ */
+static int __init
+con3270_init(void)
+{
+	struct ccw_device *cdev;
+	struct raw3270 *rp;
+	void *cbuf;
+	int i;
+
+	/* Check if 3270 is to be the console */
+	if (!CONSOLE_IS_3270)
+		return -ENODEV;
+
+	/* Set the console mode for VM */
+	if (MACHINE_IS_VM) {
+		cpcmd("TERM CONMODE 3270", 0, 0);
+		cpcmd("TERM AUTOCR OFF", 0, 0);
+	}
+
+	cdev = ccw_device_probe_console();
+	if (!cdev)
+		return -ENODEV;
+	rp = raw3270_setup_console(cdev);
+	if (IS_ERR(rp))
+		return PTR_ERR(rp);
+
+	condev = (struct con3270 *) alloc_bootmem_low(sizeof(struct con3270));
+	memset(condev, 0, sizeof(struct con3270));
+	condev->view.dev = rp;
+
+	condev->read = raw3270_request_alloc_bootmem(0);
+	condev->read->callback = con3270_read_callback;
+	condev->read->callback_data = condev;
+	condev->write = 
+		raw3270_request_alloc_bootmem(CON3270_OUTPUT_BUFFER_SIZE);
+	condev->kreset = raw3270_request_alloc_bootmem(1);
+
+	INIT_LIST_HEAD(&condev->lines);
+	INIT_LIST_HEAD(&condev->update);
+	init_timer(&condev->timer);
+	tasklet_init(&condev->readlet, 
+		     (void (*)(unsigned long)) con3270_read_tasklet,
+		     (unsigned long) condev->read);
+
+	raw3270_add_view(&condev->view, &con3270_fn, 0);
+
+	INIT_LIST_HEAD(&condev->freemem);
+	for (i = 0; i < CON3270_STRING_PAGES; i++) {
+		cbuf = (void *) alloc_bootmem_low_pages(PAGE_SIZE);
+		add_string_memory(&condev->freemem, cbuf, PAGE_SIZE);
+	}
+	condev->cline = alloc_string(&condev->freemem, condev->view.cols);
+	condev->cline->len = 0;
+	con3270_create_status(condev);
+	condev->input = alloc_string(&condev->freemem, 80);
+	register_console(&con3270);
+	return 0;
+}
+
+console_initcall(con3270_init);
diff -Nru a/drivers/s390/char/defkeymap.c b/drivers/s390/char/defkeymap.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/s390/char/defkeymap.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,156 @@
+
+/* Do not edit this file! It was automatically generated by   */
+/*    loadkeys --mktable defkeymap.map > defkeymap.c          */
+
+#include <linux/types.h>
+#include <linux/keyboard.h>
+#include <linux/kd.h>
+
+u_short plain_map[NR_KEYS] = {
+	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,
+	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,
+	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,
+	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,
+	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,
+	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,
+	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,
+	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,	0xf000,
+	0xf020,	0xf000,	0xf0e2,	0xf0e4,	0xf0e0,	0xf0e1,	0xf0e3,	0xf0e5,
+	0xf0e7,	0xf0f1,	0xf0a2,	0xf02e,	0xf03c,	0xf028,	0xf02b,	0xf07c,
+	0xf026,	0xf0e9,	0xf0e2,	0xf0eb,	0xf0e8,	0xf0ed,	0xf0ee,	0xf0ef,
+	0xf0ec,	0xf0df,	0xf021,	0xf024,	0xf02a,	0xf029,	0xf03b,	0xf0ac,
+	0xf02d,	0xf02f,	0xf0c2,	0xf0c4,	0xf0c0,	0xf0c1,	0xf0c3,	0xf0c5,
+	0xf0c7,	0xf0d1,	0xf0a6,	0xf02c,	0xf025,	0xf05f,	0xf03e,	0xf03f,
+	0xf0f8,	0xf0c9,	0xf0ca,	0xf0cb,	0xf0c8,	0xf0cd,	0xf0ce,	0xf0cf,
+	0xf0cc,	0xf060,	0xf03a,	0xf023,	0xf040,	0xf027,	0xf03d,	0xf022,
+};
+
+static u_short shift_map[NR_KEYS] = {
+	0xf0d8,	0xf061,	0xf062,	0xf063,	0xf064,	0xf065,	0xf066,	0xf067,
+	0xf068,	0xf069,	0xf0ab,	0xf0bb,	0xf0f0,	0xf0fd,	0xf0fe,	0xf0b1,
+	0xf0b0,	0xf06a,	0xf06b,	0xf06c,	0xf06d,	0xf06e,	0xf06f,	0xf070,
+	0xf071,	0xf072,	0xf000,	0xf000,	0xf0e6,	0xf0b8,	0xf0c6,	0xf0a4,
+	0xf0b5,	0xf07e,	0xf073,	0xf074,	0xf075,	0xf076,	0xf077,	0xf078,
+	0xf079,	0xf07a,	0xf0a1,	0xf0bf,	0xf0d0,	0xf0dd,	0xf0de,	0xf0ae,
+	0xf402,	0xf0a3,	0xf0a5,	0xf0b7,	0xf0a9,	0xf0a7,	0xf0b6,	0xf0bc,
+	0xf0bd,	0xf0be,	0xf05b,	0xf05d,	0xf000,	0xf0a8,	0xf0b4,	0xf0d7,
+	0xf07b,	0xf041,	0xf042,	0xf043,	0xf044,	0xf045,	0xf046,	0xf047,
+	0xf048,	0xf049,	0xf000,	0xf0f4,	0xf0f6,	0xf0f2,	0xf0f3,	0xf0f5,
+	0xf07d,	0xf04a,	0xf04b,	0xf04c,	0xf04d,	0xf04e,	0xf04f,	0xf050,
+	0xf051,	0xf052,	0xf0b9,	0xf0fb,	0xf0fc,	0xf0f9,	0xf0fa,	0xf0ff,
+	0xf05c,	0xf0f7,	0xf053,	0xf054,	0xf055,	0xf056,	0xf057,	0xf058,
+	0xf059,	0xf05a,	0xf0b2,	0xf0d4,	0xf0d6,	0xf0d2,	0xf0d3,	0xf0d5,
+	0xf030,	0xf031,	0xf032,	0xf033,	0xf034,	0xf035,	0xf036,	0xf037,
+	0xf038,	0xf039,	0xf0b3,	0xf0db,	0xf0dc,	0xf0d9,	0xf0da,	0xf000,
+};
+
+static u_short ctrl_map[NR_KEYS] = {
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf11f,	0xf120,	0xf121,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf01a,	0xf003,	0xf212,	0xf004,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf109,	0xf10a,	0xf206,	0xf00a,	0xf200,	0xf200,
+};
+
+static u_short shift_ctrl_map[NR_KEYS] = {
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf10c,	0xf10d,	0xf10e,	0xf10f,	0xf110,	0xf111,	0xf112,
+	0xf113,	0xf11e,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf100,	0xf101,	0xf211,	0xf103,	0xf104,	0xf105,	0xf20b,
+	0xf20a,	0xf108,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+};
+
+ushort *key_maps[MAX_NR_KEYMAPS] = {
+	plain_map, shift_map, 0, 0,
+	ctrl_map, shift_ctrl_map,	0
+};
+
+unsigned int keymap_count = 4;
+
+
+/*
+ * Philosophy: most people do not define more strings, but they who do
+ * often want quite a lot of string space. So, we statically allocate
+ * the default and allocate dynamically in chunks of 512 bytes.
+ */
+
+char func_buf[] = {
+	'\033', '[', '[', 'A', 0, 
+	'\033', '[', '[', 'B', 0, 
+	'\033', '[', '[', 'C', 0, 
+	'\033', '[', '[', 'D', 0, 
+	'\033', '[', '[', 'E', 0, 
+	'\033', '[', '1', '7', '~', 0, 
+	'\033', '[', '1', '8', '~', 0, 
+	'\033', '[', '1', '9', '~', 0, 
+	'\033', '[', '2', '0', '~', 0, 
+	'\033', '[', '2', '1', '~', 0, 
+	'\033', '[', '2', '3', '~', 0, 
+	'\033', '[', '2', '4', '~', 0, 
+	'\033', '[', '2', '5', '~', 0, 
+	'\033', '[', '2', '6', '~', 0, 
+	'\033', '[', '2', '8', '~', 0, 
+	'\033', '[', '2', '9', '~', 0, 
+	'\033', '[', '3', '1', '~', 0, 
+	'\033', '[', '3', '2', '~', 0, 
+	'\033', '[', '3', '3', '~', 0, 
+	'\033', '[', '3', '4', '~', 0, 
+};
+
+
+char *funcbufptr = func_buf;
+int funcbufsize = sizeof(func_buf);
+int funcbufleft = 0;          /* space left */
+
+char *func_table[MAX_NR_FUNC] = {
+	func_buf + 0,
+	func_buf + 5,
+	func_buf + 10,
+	func_buf + 15,
+	func_buf + 20,
+	func_buf + 25,
+	func_buf + 31,
+	func_buf + 37,
+	func_buf + 43,
+	func_buf + 49,
+	func_buf + 55,
+	func_buf + 61,
+	func_buf + 67,
+	func_buf + 73,
+	func_buf + 79,
+	func_buf + 85,
+	func_buf + 91,
+	func_buf + 97,
+	func_buf + 103,
+	func_buf + 109,
+	0,
+};
+
+struct kbdiacr accent_table[MAX_DIACR] = {
+	{'^', 'c', '\003'},	{'^', 'd', '\004'},
+	{'^', 'z', '\032'},	{'^', '\012', '\000'},
+};
+
+unsigned int accent_table_size = 4;
diff -Nru a/drivers/s390/char/defkeymap.map b/drivers/s390/char/defkeymap.map
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/s390/char/defkeymap.map	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,191 @@
+# Default keymap for 3270 (ebcdic codepage 037).
+keymaps 0-1,4-5
+
+keycode   0 = nul		Oslash
+keycode   1 = nul		a
+keycode   2 = nul		b
+keycode   3 = nul		c
+keycode   4 = nul		d
+keycode   5 = nul		e
+keycode   6 = nul		f
+keycode   7 = nul		g
+keycode   8 = nul		h
+keycode   9 = nul		i
+keycode  10 = nul		guillemotleft
+keycode  11 = nul		guillemotright
+keycode  12 = nul		eth
+keycode  13 = nul		yacute
+keycode  14 = nul		thorn
+keycode  15 = nul		plusminus
+keycode  16 = nul		degree
+keycode  17 = nul		j
+keycode  18 = nul		k
+keycode  19 = nul		l
+keycode  20 = nul		m
+keycode  21 = nul		n
+keycode  22 = nul		o
+keycode  23 = nul		p
+keycode  24 = nul		q
+keycode  25 = nul		r
+keycode  26 = nul		nul
+keycode  27 = nul		nul
+keycode  28 = nul		ae
+keycode  29 = nul		cedilla
+keycode  30 = nul		AE
+keycode  31 = nul		currency
+keycode  32 = nul		mu
+keycode  33 = nul		tilde
+keycode  34 = nul		s
+keycode  35 = nul		t
+keycode  36 = nul		u
+keycode  37 = nul		v
+keycode  38 = nul		w
+keycode  39 = nul		x
+keycode  40 = nul		y
+keycode  41 = nul		z
+keycode  42 = nul		exclamdown
+keycode  43 = nul		questiondown
+keycode  44 = nul		ETH
+keycode  45 = nul		Yacute
+keycode  46 = nul		THORN
+keycode  47 = nul		registered
+keycode  48 = nul		dead_circumflex
+keycode  49 = nul		sterling
+keycode  50 = nul		yen
+keycode  51 = nul		periodcentered
+keycode  52 = nul		copyright
+keycode  53 = nul		section
+keycode  54 = nul		paragraph
+keycode  55 = nul		onequarter
+keycode  56 = nul		onehalf
+keycode  57 = nul		threequarters
+keycode  58 = nul		bracketleft
+keycode  59 = nul		bracketright
+keycode  60 = nul		nul
+keycode  61 = nul		diaeresis
+keycode  62 = nul		acute
+keycode  63 = nul		multiply
+keycode  64 = space		braceleft
+keycode  65 = nul		A
+keycode  66 = acircumflex	B
+keycode  67 = adiaeresis	C
+keycode  68 = agrave		D
+keycode  69 = aacute		E
+keycode  70 = atilde		F
+keycode  71 = aring		G
+keycode  72 = ccedilla		H
+keycode  73 = ntilde		I
+keycode  74 = cent		nul
+keycode  75 = period		ocircumflex
+keycode  76 = less		odiaeresis
+keycode  77 = parenleft		ograve
+keycode  78 = plus		oacute
+keycode  79 = bar		otilde
+keycode  80 = ampersand		braceright
+keycode  81 = eacute		J
+keycode  82 = acircumflex	K
+keycode  83 = ediaeresis	L
+keycode  84 = egrave		M
+keycode  85 = iacute		N
+keycode  86 = icircumflex	O
+keycode  87 = idiaeresis	P
+keycode  88 = igrave		Q
+keycode  89 = ssharp		R
+keycode  90 = exclam		onesuperior
+keycode  91 = dollar		ucircumflex
+keycode  92 = asterisk		udiaeresis
+keycode  93 = parenright	ugrave
+keycode  94 = semicolon		uacute
+keycode  95 = notsign		ydiaeresis
+keycode  96 = minus		backslash
+keycode  97 = slash		division
+keycode  98 = Acircumflex	S
+keycode  99 = Adiaeresis	T
+keycode 100 = Agrave		U
+keycode 101 = Aacute		V
+keycode 102 = Atilde		W
+keycode 103 = Aring		X
+keycode 104 = Ccedilla		Y
+keycode 105 = Ntilde		Z
+keycode 106 = brokenbar		twosuperior
+keycode 107 = comma		Ocircumflex
+keycode 108 = percent		Odiaeresis
+keycode 109 = underscore	Ograve
+keycode 110 = greater		Oacute
+keycode 111 = question		Otilde
+keycode 112 = oslash		zero
+keycode 113 = Eacute		one
+keycode 114 = Ecircumflex	two
+keycode 115 = Ediaeresis	three
+keycode 116 = Egrave		four
+keycode 117 = Iacute		five
+keycode 118 = Icircumflex	six
+keycode 119 = Idiaeresis	seven
+keycode 120 = Igrave		eight
+keycode 121 = grave		nine
+keycode 122 = colon		threesuperior
+keycode 123 = numbersign	Ucircumflex
+keycode 124 = at		Udiaeresis
+keycode 125 = apostrophe	Ugrave
+keycode 126 = equal		Uacute
+keycode 127 = quotedbl		nul
+
+# AID keys
+control keycode  74 = F22
+control keycode  75 = F23
+control keycode  76 = F24
+control keycode 107 = Control_z		# PA3
+control keycode 108 = Control_c		# PA1
+control keycode 109 = KeyboardSignal	# Clear
+control keycode 110 = Control_d		# PA2
+control keycode 122 = F10
+control keycode 123 = F11		# F11
+control keycode 124 = Last_Console	# F12
+control keycode 125 = Linefeed
+shift control keycode  65 = F13
+shift control keycode  66 = F14
+shift control keycode  67 = F15
+shift control keycode  68 = F16
+shift control keycode  69 = F17
+shift control keycode  70 = F18
+shift control keycode  71 = F19
+shift control keycode  72 = F20
+shift control keycode  73 = F21
+shift control keycode 113 = F1
+shift control keycode 114 = F2
+shift control keycode 115 = Incr_Console
+shift control keycode 116 = F4
+shift control keycode 117 = F5
+shift control keycode 118 = F6
+shift control keycode 119 = Scroll_Backward
+shift control keycode 120 = Scroll_Forward
+shift control keycode 121 = F9
+
+string F1 = "\033[[A"
+string F2 = "\033[[B"
+string F3 = "\033[[C"
+string F4 = "\033[[D"
+string F5 = "\033[[E"
+string F6 = "\033[17~"
+string F7 = "\033[18~"
+string F8 = "\033[19~"
+string F9 = "\033[20~"
+string F10 = "\033[21~"
+string F11 = "\033[23~"
+string F12 = "\033[24~"
+string F13 = "\033[25~"
+string F14 = "\033[26~"
+string F15 = "\033[28~"
+string F16 = "\033[29~"
+string F17 = "\033[31~"
+string F18 = "\033[32~"
+string F19 = "\033[33~"
+string F20 = "\033[34~"
+# string F21 ??
+# string F22 ??
+# string F23 ??
+# string F24 ??
+compose '^' 'c' to Control_c
+compose '^' 'd' to Control_d
+compose '^' 'z' to Control_z
+compose '^' '\012' to nul
diff -Nru a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/s390/char/fs3270.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,373 @@
+/*
+ *  drivers/s390/char/fs3270.c
+ *    IBM/3270 Driver - fullscreen driver.
+ *
+ *  Author(s):
+ *    Original 3270 Code for 2.4 written by Richard Hitt (UTS Global)
+ *    Rewritten for 2.5/2.6 by Martin Schwidefsky <schwidefsky@de.ibm.com>
+ *	-- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ */
+
+#include <linux/config.h>
+#include <linux/bootmem.h>
+#include <linux/console.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/list.h>
+#include <linux/types.h>
+
+#include <asm/ccwdev.h>
+#include <asm/cio.h>
+#include <asm/cpcmd.h>
+#include <asm/ebcdic.h>
+#include <asm/idals.h>
+
+#include "raw3270.h"
+#include "ctrlchar.h"
+
+struct raw3270_fn fs3270_fn;
+
+struct fs3270 {
+	struct raw3270_view view;
+	pid_t fs_pid;			/* Pid of controlling program. */
+	int read_command;		/* ccw command to use for reads. */
+	int write_command;		/* ccw command to use for writes. */
+	int attention;			/* Got attention. */
+	struct raw3270_request *clear;	/* single clear request. */
+	wait_queue_head_t attn_wait;	/* Attention wait queue. */
+};
+
+static void
+fs3270_wake_up(struct raw3270_request *rq, void *data)
+{
+	wake_up((wait_queue_head_t *) data);
+}
+
+static int
+fs3270_do_io(struct raw3270_view *view, struct raw3270_request *rq)
+{
+	wait_queue_head_t wq;
+	int rc;
+
+	init_waitqueue_head(&wq);
+	rq->callback = fs3270_wake_up;
+	rq->callback_data = &wq;
+	rc = raw3270_start(view, rq);
+	if (rc)
+		return rc;
+	/* Started sucessfully. Now wait for completion. */
+	wait_event(wq, raw3270_request_final(rq));
+	return rq->rc;
+}
+
+static void
+fs3270_reset_callback(struct raw3270_request *rq, void *data)
+{
+	raw3270_request_reset(rq);
+}
+
+/*
+ * Switch to the fullscreen view.
+ */
+static int
+fs3270_activate(struct raw3270_view *view)
+{
+	struct fs3270 *fp;
+
+	fp = (struct fs3270 *) view;
+	raw3270_request_set_cmd(fp->clear, TC_EWRITEA);
+	fp->clear->callback = fs3270_reset_callback;
+	return raw3270_start(view, fp->clear);
+}
+
+/*
+ * Shutdown fullscreen view.
+ */
+static void
+fs3270_deactivate(struct raw3270_view *view)
+{
+	// FIXME: is this a good idea? The user program using fullscreen 3270
+	// will die just because a console message appeared. On the other
+	// hand the fullscreen device is unoperational now.
+	struct fs3270 *fp;
+
+	fp = (struct fs3270 *) view;
+	if (fp->fs_pid != 0)
+		kill_proc(fp->fs_pid, SIGHUP, 1);
+	fp->fs_pid = 0;
+}
+
+static int
+fs3270_irq(struct fs3270 *fp, struct raw3270_request *rq, struct irb *irb)
+{
+	/* Handle ATTN. Set indication and wake waiters for attention. */
+	if (irb->scsw.dstat & DEV_STAT_ATTENTION) {
+		fp->attention = 1;
+		wake_up(&fp->attn_wait);
+	}
+
+	if (rq) {
+		if (irb->scsw.dstat & DEV_STAT_UNIT_CHECK)
+			rq->rc = -EIO;
+		else
+			/* Normal end. Copy residual count. */
+			rq->rescnt = irb->scsw.count;
+	}
+	return RAW3270_IO_DONE;
+}
+
+/*
+ * Process reads from fullscreen 3270.
+ */
+static ssize_t
+fs3270_read(struct file *filp, char *data, size_t count, loff_t *off)
+{
+	struct fs3270 *fp;
+	struct raw3270_request *rq;
+	struct idal_buffer *ib;
+	int rc;
+	
+	if (count == 0 || count > 65535)
+		return -EINVAL;
+	fp = filp->private_data;
+	if (!fp)
+		return -ENODEV;
+	ib = idal_buffer_alloc(count, 0);
+	if (!ib)
+		return -ENOMEM;
+	rq = raw3270_request_alloc(0);
+	if (!IS_ERR(rq)) {
+		if (fp->read_command == 0 && fp->write_command != 0)
+			fp->read_command = 6;
+		raw3270_request_set_cmd(rq, fp->read_command ? : 2);
+		raw3270_request_set_idal(rq, ib);
+		wait_event(fp->attn_wait, fp->attention);
+		rc = fs3270_do_io(&fp->view, rq);
+		if (rc == 0 && idal_buffer_to_user(ib, data, count))
+			rc = -EFAULT;
+		raw3270_request_free(rq);
+	} else
+		rc = PTR_ERR(rq);
+	idal_buffer_free(ib);
+	return rc;
+}
+
+/*
+ * Process writes to fullscreen 3270.
+ */
+static ssize_t
+fs3270_write(struct file *filp, const char *data, size_t count, loff_t *off)
+{
+	struct fs3270 *fp;
+	struct raw3270_request *rq;
+	struct idal_buffer *ib;
+	int write_command;
+	int rc;
+
+	fp = filp->private_data;
+	if (!fp)
+		return -ENODEV;
+	ib = idal_buffer_alloc(count, 0);
+	if (!ib)
+		return -ENOMEM;
+	rq = raw3270_request_alloc(0);
+	if (!IS_ERR(rq)) {
+		if (idal_buffer_from_user(ib, data, count) == 0) {
+			write_command = fp->write_command ? : 1;
+			if (write_command == 5)
+				write_command = 13;
+			raw3270_request_set_cmd(rq, write_command);
+			raw3270_request_set_idal(rq, ib);
+			rc = fs3270_do_io(&fp->view, rq);
+		} else
+			rc = -EFAULT;
+		raw3270_request_free(rq);
+	} else
+		rc = PTR_ERR(rq);
+	idal_buffer_free(ib);
+	return rc;
+}
+
+/*
+ * process ioctl commands for the tube driver
+ */
+static int
+fs3270_ioctl(struct inode *inode, struct file *filp,
+	     unsigned int cmd, unsigned long arg)
+{
+	struct fs3270 *fp;
+	struct raw3270_iocb iocb;
+	int rc;
+
+	fp = filp->private_data;
+	if (!fp)
+		return -ENODEV;
+	rc = 0;
+	switch (cmd) {
+	case TUBICMD:
+		fp->read_command = arg;
+		break;
+	case TUBOCMD:
+		fp->write_command = arg;
+		break;
+	case TUBGETI:
+		rc = put_user(fp->read_command, (char *) arg);
+		break;
+	case TUBGETO:
+		rc = put_user(fp->write_command,(char *) arg);
+		break;
+	case TUBGETMOD:
+		iocb.model = fp->view.model;
+		iocb.line_cnt = fp->view.rows;
+		iocb.col_cnt = fp->view.cols;
+		iocb.pf_cnt = 24;
+		iocb.re_cnt = 20;
+		iocb.map = 0;
+		if (copy_to_user((char *) arg, &iocb,
+				 sizeof(struct raw3270_iocb)))
+			rc = -EFAULT;
+		break;
+	}
+	return rc;
+}
+
+/*
+ * Allocate tty3270 structure.
+ */
+static struct fs3270 *
+fs3270_alloc_view(void)
+{
+	struct fs3270 *fp;
+
+	fp = (struct fs3270 *) kmalloc(sizeof(struct fs3270),GFP_KERNEL);
+	if (!fp)
+		return ERR_PTR(-ENOMEM);
+	memset(fp, 0, sizeof(struct fs3270));
+	fp->clear = raw3270_request_alloc(0);
+	if (!IS_ERR(fp->clear)) {
+		kfree(fp);
+		return ERR_PTR(-ENOMEM);
+	}
+	return fp;
+}
+
+/*
+ * Free tty3270 structure.
+ */
+static void
+fs3270_free_view(struct raw3270_view *view)
+{
+	raw3270_request_free(((struct fs3270 *) view)->clear);
+	kfree(view);
+}
+
+/*
+ * Unlink fs3270 data structure from filp.
+ */
+static void
+fs3270_release(struct raw3270_view *view)
+{
+}
+
+/* View to a 3270 device. Can be console, tty or fullscreen. */
+struct raw3270_fn fs3270_fn = {
+	.activate = fs3270_activate,
+	.deactivate = fs3270_deactivate,
+	.intv = (void *) fs3270_irq,
+	.release = fs3270_release,
+	.free = fs3270_free_view
+};
+
+/*
+ * This routine is called whenever a 3270 fullscreen device is opened.
+ */
+static int
+fs3270_open(struct inode *inode, struct file *filp)
+{
+	struct fs3270 *fp;
+	int minor, rc;
+
+	if (imajor(filp->f_dentry->d_inode) != IBM_FS3270_MAJOR)
+		return -ENODEV;
+	minor = iminor(filp->f_dentry->d_inode);
+	/* Check if some other program is already using fullscreen mode. */
+	fp = (struct fs3270 *) raw3270_find_view(&fs3270_fn, minor);
+	if (!IS_ERR(fp)) {
+		raw3270_put_view(&fp->view);
+		return -EBUSY;
+	}
+	/* Allocate fullscreen view structure. */
+	fp = fs3270_alloc_view();
+	if (IS_ERR(fp))
+		return PTR_ERR(fp);
+
+	init_waitqueue_head(&fp->attn_wait);
+	fp->fs_pid = current->pid;
+	rc = raw3270_add_view(&fp->view, &fs3270_fn, minor);
+	if (rc) {
+		fs3270_free_view(&fp->view);
+		return rc;
+	}
+
+	rc = raw3270_activate_view(&fp->view);
+	if (rc) {
+		raw3270_del_view(&fp->view);
+		return rc;
+	}
+	filp->private_data = fp;
+	return 0;
+}
+
+/*
+ * This routine is called when the 3270 tty is closed. We wait
+ * for the remaining request to be completed. Then we clean up.
+ */
+static int
+fs3270_close(struct inode *inode, struct file *filp)
+{
+	struct fs3270 *fp;
+
+	fp = filp->private_data;
+	filp->private_data = 0;
+	if (fp)
+		raw3270_del_view(&fp->view);
+	return 0;
+}
+
+static struct file_operations fs3270_fops = {
+	.owner	 = THIS_MODULE,		/* owner */
+	.read	 = fs3270_read,		/* read */
+	.write	 = fs3270_write,	/* write */
+	.ioctl	 = fs3270_ioctl,	/* ioctl */
+	.open	 = fs3270_open,		/* open */
+	.release = fs3270_close,	/* release */
+};
+
+/*
+ * 3270 fullscreen driver initialization.
+ */
+static int __init
+fs3270_init(void)
+{
+	int rc;
+
+	rc = register_chrdev(IBM_FS3270_MAJOR, "fs3270", &fs3270_fops);
+	if (rc) {
+		printk(KERN_ERR "fs3270 can't get major number %d: errno %d\n",
+		       IBM_FS3270_MAJOR, rc);
+		return rc;
+	}
+	return 0;
+}
+
+static void __exit
+fs3270_exit(void)
+{
+	unregister_chrdev(IBM_FS3270_MAJOR, "fs3270");
+}
+
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_CHARDEV_MAJOR(IBM_FS3270_MAJOR);
+
+module_init(fs3270_init);
+module_exit(fs3270_exit);
diff -Nru a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/s390/char/keyboard.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,516 @@
+/*
+ *  drivers/s390/char/keyboard.c
+ *    ebcdic keycode functions for s390 console drivers
+ *
+ *  S390 version
+ *    Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/sched.h>
+#include <linux/sysrq.h>
+
+#include <linux/kbd_kern.h>
+#include <linux/kbd_diacr.h>
+#include <asm/uaccess.h>
+
+#include "keyboard.h"
+
+/*
+ * Handler Tables.
+ */
+#define K_HANDLERS\
+	k_self,		k_fn,		k_spec,		k_ignore,\
+	k_dead,		k_ignore,	k_ignore,	k_ignore,\
+	k_ignore,	k_ignore,	k_ignore,	k_ignore,\
+	k_ignore,	k_ignore,	k_ignore,	k_ignore
+
+typedef void (k_handler_fn)(struct kbd_data *, unsigned char);
+static k_handler_fn K_HANDLERS;
+static k_handler_fn *k_handler[16] = { K_HANDLERS };
+
+/* maximum values each key_handler can handle */
+static const int max_vals[] = {
+	255, ARRAY_SIZE(func_table) - 1, NR_FN_HANDLER - 1, 0,
+	NR_DEAD - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+static const int NR_TYPES = ARRAY_SIZE(max_vals);
+
+static unsigned char ret_diacr[NR_DEAD] = {
+	'`', '\'', '^', '~', '"', ','
+};
+
+/*
+ * Alloc/free of kbd_data structures.
+ */
+struct kbd_data *
+kbd_alloc(void) {
+	struct kbd_data *kbd;
+	int i, len;
+
+	kbd = kmalloc(sizeof(struct kbd_data), GFP_KERNEL);
+	if (!kbd)
+		goto out;
+	memset(kbd, 0, sizeof(struct kbd_data));
+	kbd->key_maps = kmalloc(sizeof(key_maps), GFP_KERNEL);
+	if (!key_maps)
+		goto out_kbd;
+	memset(kbd->key_maps, 0, sizeof(key_maps));
+	for (i = 0; i < ARRAY_SIZE(key_maps); i++) {
+		if (key_maps[i]) {
+			kbd->key_maps[i] =
+				kmalloc(sizeof(u_short)*NR_KEYS, GFP_KERNEL);
+			if (!kbd->key_maps[i])
+				goto out_maps;
+			memcpy(kbd->key_maps[i], key_maps[i],
+			       sizeof(u_short)*NR_KEYS);
+		}
+	}
+	kbd->func_table = kmalloc(sizeof(func_table), GFP_KERNEL);
+	if (!kbd->func_table)
+		goto out_maps;
+	memset(kbd->func_table, 0, sizeof(func_table));
+	for (i = 0; i < ARRAY_SIZE(func_table); i++) {
+		if (func_table[i]) {
+			len = strlen(func_table[i]) + 1;
+			kbd->func_table[i] = kmalloc(len, GFP_KERNEL);
+			if (!kbd->func_table[i])
+				goto out_func;
+			memcpy(kbd->func_table[i], func_table[i], len);
+		}
+	}
+	kbd->fn_handler =
+		kmalloc(sizeof(fn_handler_fn *) * NR_FN_HANDLER, GFP_KERNEL);
+	if (!kbd->fn_handler)
+		goto out_func;
+	memset(kbd->fn_handler, 0, sizeof(fn_handler_fn *) * NR_FN_HANDLER);
+	kbd->accent_table =
+		kmalloc(sizeof(struct kbdiacr)*MAX_DIACR, GFP_KERNEL);
+	if (!kbd->accent_table)
+		goto out_fn_handler;
+	memcpy(kbd->accent_table, accent_table,
+	       sizeof(struct kbdiacr)*MAX_DIACR);
+	kbd->accent_table_size = accent_table_size;
+	return kbd;
+
+out_fn_handler:
+	kfree(kbd->fn_handler);
+out_func:
+	for (i = 0; i < ARRAY_SIZE(func_table); i++)
+		if (kbd->func_table[i])
+			kfree(kbd->func_table[i]);
+	kfree(kbd->func_table);
+out_maps:
+	for (i = 0; i < ARRAY_SIZE(key_maps); i++)
+		if (kbd->key_maps[i])
+			kfree(kbd->key_maps[i]);
+	kfree(kbd->key_maps);
+out_kbd:
+	kfree(kbd);
+out:
+	return 0;
+}
+
+void
+kbd_free(struct kbd_data *kbd)
+{
+	int i;
+
+	kfree(kbd->accent_table);
+	kfree(kbd->fn_handler);
+	for (i = 0; i < ARRAY_SIZE(func_table); i++)
+		if (kbd->func_table[i])
+			kfree(kbd->func_table[i]);
+	kfree(kbd->func_table);
+	for (i = 0; i < ARRAY_SIZE(key_maps); i++)
+		if (kbd->key_maps[i])
+			kfree(kbd->key_maps[i]);
+	kfree(kbd->key_maps);
+	kfree(kbd);
+}
+
+/*
+ * Generate ascii -> ebcdic translation table from kbd_data.
+ */
+void
+kbd_ascebc(struct kbd_data *kbd, unsigned char *ascebc)
+{
+	unsigned short *keymap, keysym;
+	int i, j, k;
+
+	memset(ascebc, 0x40, 256);
+	for (i = 0; i < ARRAY_SIZE(key_maps); i++) {
+		keymap = kbd->key_maps[i];
+		if (!keymap)
+			continue;
+		for (j = 0; j < NR_KEYS; j++) {
+			k = ((i & 1) << 7) + j;
+			keysym = keymap[j];
+			if (KTYP(keysym) == (KT_LATIN | 0xf0) ||
+			    KTYP(keysym) == (KT_LETTER | 0xf0))
+				ascebc[KVAL(keysym)] = k;
+			else if (KTYP(keysym) == (KT_DEAD | 0xf0))
+				ascebc[ret_diacr[KVAL(keysym)]] = k;
+		}
+	}
+}
+
+/*
+ * Generate ebcdic -> ascii translation table from kbd_data.
+ */
+void
+kbd_ebcasc(struct kbd_data *kbd, unsigned char *ebcasc)
+{
+	unsigned short *keymap, keysym;
+	int i, j, k;
+
+	memset(ebcasc, ' ', 256);
+	for (i = 0; i < ARRAY_SIZE(key_maps); i++) {
+		keymap = kbd->key_maps[i];
+		if (!keymap)
+			continue;
+		for (j = 0; j < NR_KEYS; j++) {
+			keysym = keymap[j];
+			k = ((i & 1) << 7) + j;
+			if (KTYP(keysym) == (KT_LATIN | 0xf0) ||
+			    KTYP(keysym) == (KT_LETTER | 0xf0))
+				ebcasc[k] = KVAL(keysym);
+			else if (KTYP(keysym) == (KT_DEAD | 0xf0))
+				ebcasc[k] = ret_diacr[KVAL(keysym)];
+		}
+	}
+}
+
+/*
+ * We have a combining character DIACR here, followed by the character CH.
+ * If the combination occurs in the table, return the corresponding value.
+ * Otherwise, if CH is a space or equals DIACR, return DIACR.
+ * Otherwise, conclude that DIACR was not combining after all,
+ * queue it and return CH.
+ */
+static unsigned char
+handle_diacr(struct kbd_data *kbd, unsigned char ch)
+{
+	int i, d;
+
+	d = kbd->diacr;
+	kbd->diacr = 0;
+
+	for (i = 0; i < kbd->accent_table_size; i++) {
+		if (kbd->accent_table[i].diacr == d &&
+		    kbd->accent_table[i].base == ch)
+			return kbd->accent_table[i].result;
+	}
+
+	if (ch == ' ' || ch == d)
+		return d;
+
+	kbd_put_queue(kbd->tty, d);
+	return ch;
+}
+
+/*
+ * Handle dead key.
+ */
+static void
+k_dead(struct kbd_data *kbd, unsigned char value)
+{
+	value = ret_diacr[value];
+	kbd->diacr = (kbd->diacr ? handle_diacr(kbd, value) : value);
+}
+
+/*
+ * Normal character handler.
+ */
+static void
+k_self(struct kbd_data *kbd, unsigned char value)
+{
+	if (kbd->diacr)
+		value = handle_diacr(kbd, value);
+	kbd_put_queue(kbd->tty, value);
+}
+
+/*
+ * Special key handlers
+ */
+static void
+k_ignore(struct kbd_data *kbd, unsigned char value)
+{
+}
+
+/*
+ * Function key handler.
+ */
+static void
+k_fn(struct kbd_data *kbd, unsigned char value)
+{
+	if (kbd->func_table[value])
+		kbd_puts_queue(kbd->tty, kbd->func_table[value]);
+}
+
+static void
+k_spec(struct kbd_data *kbd, unsigned char value)
+{
+	if (value >= NR_FN_HANDLER)
+		return;
+	if (kbd->fn_handler[value])
+		kbd->fn_handler[value](kbd);
+}
+
+/*
+ * Put utf8 character to tty flip buffer.
+ * UTF-8 is defined for words of up to 31 bits,
+ * but we need only 16 bits here
+ */
+static void
+to_utf8(struct tty_struct *tty, ushort c) 
+{
+	if (c < 0x80)
+		/*  0******* */
+		kbd_put_queue(tty, c);
+	else if (c < 0x800) {
+		/* 110***** 10****** */
+		kbd_put_queue(tty, 0xc0 | (c >> 6));
+		kbd_put_queue(tty, 0x80 | (c & 0x3f));
+	} else {
+		/* 1110**** 10****** 10****** */
+		kbd_put_queue(tty, 0xe0 | (c >> 12));
+		kbd_put_queue(tty, 0x80 | ((c >> 6) & 0x3f));
+		kbd_put_queue(tty, 0x80 | (c & 0x3f));
+	}
+}
+
+/*
+ * Process keycode.
+ */
+void
+kbd_keycode(struct kbd_data *kbd, unsigned int keycode)
+{
+	unsigned short keysym;
+	unsigned char type, value;
+
+	if (!kbd || !kbd->tty)
+		return;
+
+	if (keycode >= 384)
+		keysym = kbd->key_maps[5][keycode - 384];
+	else if (keycode >= 256)
+		keysym = kbd->key_maps[4][keycode - 256];
+	else if (keycode >= 128)
+		keysym = kbd->key_maps[1][keycode - 128];
+	else
+		keysym = kbd->key_maps[0][keycode];
+
+	type = KTYP(keysym);
+	if (type >= 0xf0) {
+		type -= 0xf0;
+		if (type == KT_LETTER)
+			type = KT_LATIN;
+		value = KVAL(keysym);
+#ifdef CONFIG_MAGIC_SYSRQ	       /* Handle the SysRq Hack */
+		if (kbd->sysrq) {
+			if (kbd->sysrq == K(KT_LATIN, '-')) {
+				kbd->sysrq = 0;
+				handle_sysrq(value, 0, kbd->tty);
+				return;
+			}
+			if (value == '-') {
+				kbd->sysrq = K(KT_LATIN, '-');
+				return;
+			}
+			/* Incomplete sysrq sequence. */
+			(*k_handler[KTYP(kbd->sysrq)])(kbd, KVAL(kbd->sysrq));
+			kbd->sysrq = 0;
+		} else if ((type == KT_LATIN && value == '^') ||
+			   (type == KT_DEAD && ret_diacr[value] == '^')) {
+			kbd->sysrq = K(type, value);
+			return;
+		}
+#endif
+		(*k_handler[type])(kbd, value);
+	} else
+		to_utf8(kbd->tty, keysym);
+}
+
+/*
+ * Ioctl stuff.
+ */
+static int
+do_kdsk_ioctl(struct kbd_data *kbd, struct kbentry *user_kbe,
+	      int cmd, int perm)
+{
+	struct kbentry tmp;
+	ushort *key_map, val, ov;
+
+	if (copy_from_user(&tmp, user_kbe, sizeof(struct kbentry)))
+		return -EFAULT;
+#if NR_KEYS < 256
+	if (tmp.kb_index >= NR_KEYS)
+		return -EINVAL;
+#endif
+#if MAX_NR_KEYMAPS < 256
+	if (tmp.kb_table >= MAX_NR_KEYMAPS)
+		return -EINVAL;	
+#endif
+
+	switch (cmd) {
+	case KDGKBENT:
+		key_map = kbd->key_maps[tmp.kb_table];
+		if (key_map) {
+		    val = U(key_map[tmp.kb_index]);
+		    if (KTYP(val) >= NR_TYPES)
+			val = K_HOLE;
+		} else
+		    val = (tmp.kb_index ? K_HOLE : K_NOSUCHMAP);
+		return put_user(val, &user_kbe->kb_value);
+	case KDSKBENT:
+		if (!perm)
+			return -EPERM;
+		if (!tmp.kb_index && tmp.kb_value == K_NOSUCHMAP) {
+			/* disallocate map */
+			key_map = kbd->key_maps[tmp.kb_table];
+			if (key_map) {
+			    kbd->key_maps[tmp.kb_table] = 0;
+			    kfree(key_map);
+			}
+			break;
+		}
+
+		if (KTYP(tmp.kb_value) >= NR_TYPES)
+			return -EINVAL;
+		if (KVAL(tmp.kb_value) > max_vals[KTYP(tmp.kb_value)])
+			return -EINVAL;
+
+		if (!(key_map = kbd->key_maps[tmp.kb_table])) {
+			int j;
+
+			key_map = (ushort *) kmalloc(sizeof(plain_map),
+						     GFP_KERNEL);
+			if (!key_map)
+				return -ENOMEM;
+			kbd->key_maps[tmp.kb_table] = key_map;
+			for (j = 0; j < NR_KEYS; j++)
+				key_map[j] = U(K_HOLE);
+		}
+		ov = U(key_map[tmp.kb_index]);
+		if (tmp.kb_value == ov)
+			break;	/* nothing to do */
+		/*
+		 * Attention Key.
+		 */
+		if (((ov == K_SAK) || (tmp.kb_value == K_SAK)) &&
+		    !capable(CAP_SYS_ADMIN))
+			return -EPERM;
+		key_map[tmp.kb_index] = U(tmp.kb_value);
+		break;
+	}
+	return 0;
+}
+
+static int
+do_kdgkb_ioctl(struct kbd_data *kbd, struct kbsentry *u_kbs,
+	       int cmd, int perm)
+{
+	unsigned char kb_func;
+	char *p;
+	int len;
+
+	/* Get u_kbs->kb_func. */
+	if (get_user(kb_func, &u_kbs->kb_func))
+		return -EFAULT;
+#if MAX_NR_FUNC < 256
+	if (kb_func >= MAX_NR_FUNC)
+		return -EINVAL;
+#endif
+
+	switch (cmd) {
+	case KDGKBSENT:
+		p = kbd->func_table[kb_func];
+		if (p) {
+			len = strlen(p);
+			if (len >= sizeof(u_kbs->kb_string))
+				len = sizeof(u_kbs->kb_string) - 1;
+			if (copy_to_user(u_kbs->kb_string, p, len))
+				return -EFAULT;
+		} else
+			len = 0;
+		if (put_user('\0', u_kbs->kb_string + len))
+			return -EFAULT;
+		break;
+	case KDSKBSENT:
+		if (!perm)
+			return -EPERM;
+		len = strnlen_user(u_kbs->kb_string,
+				   sizeof(u_kbs->kb_string) - 1);
+		p = kmalloc(len, GFP_KERNEL);
+		if (!p)
+			return -ENOMEM;
+		if (copy_from_user(p, u_kbs->kb_string, len)) {
+			kfree(p);
+			return -EFAULT;
+		}
+		p[len] = 0;
+		if (kbd->func_table[kb_func])
+			kfree(kbd->func_table[kb_func]);
+		kbd->func_table[kb_func] = p;
+		break;
+	}
+	return 0;
+}
+
+int
+kbd_ioctl(struct kbd_data *kbd, struct file *file,
+	  unsigned int cmd, unsigned long arg)
+{
+	struct kbdiacrs *a;
+	int ct, perm;
+
+	/*
+	 * To have permissions to do most of the vt ioctls, we either have
+	 * to be the owner of the tty, or have CAP_SYS_TTY_CONFIG.
+	 */
+	perm = current->tty == kbd->tty || capable(CAP_SYS_TTY_CONFIG);
+	switch (cmd) {
+	case KDGKBTYPE:
+		return put_user(KB_101, (char*) arg);
+	case KDGKBENT:
+	case KDSKBENT:
+		return do_kdsk_ioctl(kbd, (struct kbentry *)arg, cmd, perm);
+	case KDGKBSENT:
+	case KDSKBSENT:
+		return do_kdgkb_ioctl(kbd, (struct kbsentry *)arg, cmd, perm);
+	case KDGKBDIACR:
+		a = (struct kbdiacrs *) arg;
+
+		if (put_user(kbd->accent_table_size, &a->kb_cnt))
+			return -EFAULT;
+		ct = kbd->accent_table_size;
+		if (copy_to_user(a->kbdiacr, kbd->accent_table,
+				 ct * sizeof(struct kbdiacr)))
+			return -EFAULT;
+		return 0;
+	case KDSKBDIACR:
+		a = (struct kbdiacrs *) arg;
+		if (!perm)
+			return -EPERM;
+		if (get_user(ct, &a->kb_cnt))
+			return -EFAULT;
+		if (ct >= MAX_DIACR)
+			return -EINVAL;
+		kbd->accent_table_size = ct;
+		if (copy_from_user(kbd->accent_table, a->kbdiacr,
+				   ct * sizeof(struct kbdiacr)))
+			return -EFAULT;
+		return 0;
+	default:
+		return -ENOIOCTLCMD;
+	}
+}
+
+EXPORT_SYMBOL(kbd_ioctl);
+EXPORT_SYMBOL(kbd_ascebc);
+EXPORT_SYMBOL(kbd_free);
+EXPORT_SYMBOL(kbd_alloc);
+EXPORT_SYMBOL(kbd_keycode);
diff -Nru a/drivers/s390/char/keyboard.h b/drivers/s390/char/keyboard.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/s390/char/keyboard.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,57 @@
+/*
+ *  drivers/s390/char/keyboard.h
+ *    ebcdic keycode functions for s390 console drivers
+ *
+ *    Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
+ */
+
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
+#include <linux/keyboard.h>
+
+#define NR_FN_HANDLER	20
+
+struct kbd_data;
+
+typedef void (fn_handler_fn)(struct kbd_data *);
+
+/*
+ * FIXME: explain key_maps tricks.
+ */
+
+struct kbd_data {
+	struct tty_struct *tty;
+	unsigned short **key_maps;
+	char **func_table;
+	fn_handler_fn **fn_handler;
+	struct kbdiacr *accent_table;
+	unsigned int accent_table_size;
+	unsigned char diacr;
+	unsigned short sysrq;
+};
+
+struct kbd_data *kbd_alloc(void);
+void kbd_free(struct kbd_data *);
+void kbd_ascebc(struct kbd_data *, unsigned char *);
+
+void kbd_keycode(struct kbd_data *, unsigned int);
+int kbd_ioctl(struct kbd_data *, struct file *, unsigned int, unsigned long);
+
+/*
+ * Helper Functions.
+ */
+extern inline void
+kbd_put_queue(struct tty_struct *tty, int ch)
+{
+	tty_insert_flip_char(tty, ch, 0);
+	tty_schedule_flip(tty);
+}
+
+extern inline void
+kbd_puts_queue(struct tty_struct *tty, char *cp)
+{
+	while (*cp)
+		tty_insert_flip_char(tty, *cp++, 0);
+	tty_schedule_flip(tty);
+}
diff -Nru a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/s390/char/raw3270.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,1256 @@
+/*
+ *  drivers/s390/char/raw3270.c
+ *    IBM/3270 Driver - core functions.
+ *
+ *  Author(s):
+ *    Original 3270 Code for 2.4 written by Richard Hitt (UTS Global)
+ *    Rewritten for 2.5 by Martin Schwidefsky <schwidefsky@de.ibm.com>
+ *	-- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ */
+
+#include <linux/config.h>
+#include <linux/bootmem.h>
+#include <linux/module.h>
+#include <linux/err.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/list.h>
+#include <linux/slab.h>
+#include <linux/types.h>
+#include <linux/wait.h>
+
+#include <asm/ccwdev.h>
+#include <asm/cio.h>
+#include <asm/ebcdic.h>
+
+#include "raw3270.h"
+
+/* The main 3270 data structure. */
+struct raw3270 {
+	struct list_head list;
+	struct ccw_device *cdev;
+	int minor;
+
+	short model, rows, cols;
+	unsigned long flags;
+
+	struct list_head req_queue;	/* Request queue. */
+	struct list_head view_list;	/* List of available views. */
+	struct raw3270_view *view;	/* Active view. */
+
+	struct timer_list timer;	/* Device timer. */
+
+	unsigned char *ascebc;		/* ascii -> ebcdic table */
+};
+
+/* raw3270->flags */
+#define RAW3270_FLAGS_14BITADDR	0	/* 14-bit buffer addresses */
+#define RAW3270_FLAGS_BUSY	1	/* Device busy, leave it alone */
+#define RAW3270_FLAGS_ATTN	2	/* Device sent an ATTN interrupt */
+#define RAW3270_FLAGS_SHUTDOWN	4	/* Device is in offline processing */
+#define RAW3270_FLAGS_CONSOLE	8	/* Device is the console. */
+
+/* Lock to protect global data of raw3270 (devices, views, etc). */
+static spinlock_t raw3270_lock = SPIN_LOCK_UNLOCKED;
+
+/* List of 3270 devices. */
+static struct list_head raw3270_devices = LIST_HEAD_INIT(raw3270_devices);
+
+/*
+ * Flag to indicate if the driver has been registered. Some operations
+ * like waiting for the end of i/o need to be done differently as long
+ * as the kernel is still starting up (console support).
+ */
+static int raw3270_registered;
+
+/* Module parameters */
+static int tubxcorrect = 0;
+MODULE_PARM(tubxcorrect, "i");
+
+/*
+ * Wait queue for device init/delete, view delete.
+ */
+DECLARE_WAIT_QUEUE_HEAD(raw3270_wait_queue);
+
+/*
+ * Encode array for 12 bit 3270 addresses.
+ */
+unsigned char raw3270_ebcgraf[64] =	{
+	0x40, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+	0xc8, 0xc9, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
+	0x50, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+	0xd8, 0xd9, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+	0x60, 0x61, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
+	0xe8, 0xe9, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
+	0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
+	0xf8, 0xf9, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f
+};
+
+void
+raw3270_buffer_address(struct raw3270 *rp, char *cp, unsigned short addr)
+{
+	if (test_bit(RAW3270_FLAGS_14BITADDR, &rp->flags)) {
+		cp[0] = (addr >> 8) & 0x3f;
+		cp[1] = addr & 0xff;
+	} else {
+		cp[0] = raw3270_ebcgraf[(addr >> 6) & 0x3f];
+		cp[1] = raw3270_ebcgraf[addr & 0x3f];
+	}
+}
+
+/*
+ * Allocate a new 3270 ccw request
+ */
+struct raw3270_request *
+raw3270_request_alloc(size_t size)
+{
+	struct raw3270_request *rq;
+
+	/* Allocate request structure */
+	rq = kmalloc(sizeof(struct raw3270_request), GFP_KERNEL | GFP_DMA);
+	if (!rq)
+		return ERR_PTR(-ENOMEM);
+	memset(rq, 0, sizeof(struct raw3270_request));
+
+	/* alloc output buffer. */
+	if (size > 0) {
+		rq->buffer = kmalloc(size, GFP_KERNEL | GFP_DMA);
+		if (!rq->buffer) {
+			kfree(rq);
+			return ERR_PTR(-ENOMEM);
+		}
+	}
+	rq->size = size;
+	INIT_LIST_HEAD(&rq->list);
+
+	/*
+	 * Setup ccw.
+	 */
+	rq->ccw.cda = __pa(rq->buffer);
+	rq->ccw.flags = CCW_FLAG_SLI;
+
+	return rq;
+}
+
+#ifdef CONFIG_TN3270_CONSOLE
+/*
+ * Allocate a new 3270 ccw request from bootmem. Only works very
+ * early in the boot process. Only con3270.c should be using this.
+ */
+struct raw3270_request *
+raw3270_request_alloc_bootmem(size_t size)
+{
+	struct raw3270_request *rq;
+
+	rq = alloc_bootmem_low(sizeof(struct raw3270));
+	if (!rq)
+		return ERR_PTR(-ENOMEM);
+	memset(rq, 0, sizeof(struct raw3270_request));
+
+	/* alloc output buffer. */
+	if (size > 0) {
+		rq->buffer = alloc_bootmem_low(size);
+		if (!rq->buffer) {
+			free_bootmem((unsigned long) rq,
+				     sizeof(struct raw3270));
+			return ERR_PTR(-ENOMEM);
+		}
+	}
+	rq->size = size;
+	INIT_LIST_HEAD(&rq->list);
+
+	/*
+	 * Setup ccw.
+	 */
+	rq->ccw.cda = __pa(rq->buffer);
+	rq->ccw.flags = CCW_FLAG_SLI;
+
+	return rq;
+}
+#endif
+
+/*
+ * Free 3270 ccw request
+ */
+void
+raw3270_request_free (struct raw3270_request *rq)
+{
+	if (rq->buffer)
+		kfree(rq->buffer);
+	kfree(rq);
+}
+
+/*
+ * Reset request to initial state.
+ */
+void
+raw3270_request_reset(struct raw3270_request *rq)
+{
+	BUG_ON(!list_empty(&rq->list));
+	rq->ccw.cmd_code = 0;
+	rq->ccw.count = 0;
+	rq->ccw.cda = __pa(rq->buffer);
+	rq->ccw.flags = CCW_FLAG_SLI;
+	rq->rescnt = 0;
+	rq->rc = 0;
+}
+
+/*
+ * Set command code to ccw of a request.
+ */
+void
+raw3270_request_set_cmd(struct raw3270_request *rq, u8 cmd)
+{
+	rq->ccw.cmd_code = cmd;
+}
+
+/*
+ * Add data fragment to output buffer.
+ */
+int
+raw3270_request_add_data(struct raw3270_request *rq, void *data, size_t size)
+{
+	if (size + rq->ccw.count > rq->size)
+		return -E2BIG;
+	memcpy(rq->buffer + rq->ccw.count, data, size);
+	rq->ccw.count += size;
+	return 0;
+}
+
+/*
+ * Set address/length pair to ccw of a request.
+ */
+void
+raw3270_request_set_data(struct raw3270_request *rq, void *data, size_t size)
+{
+	rq->ccw.cda = __pa(data);
+	rq->ccw.count = size;
+}
+
+/*
+ * Set idal buffer to ccw of a request.
+ */
+void
+raw3270_request_set_idal(struct raw3270_request *rq, struct idal_buffer *ib)
+{
+	rq->ccw.cda = __pa(ib->data);
+	rq->ccw.count = ib->size;
+	rq->ccw.flags |= CCW_FLAG_IDA;
+}
+
+/*
+ * Stop running ccw.
+ */
+static int
+raw3270_halt_io_nolock(struct raw3270 *rp, struct raw3270_request *rq)
+{
+	int retries;
+	int rc;
+
+	if (raw3270_request_final(rq))
+		return 0;
+	/* Check if interrupt has already been processed */
+	for (retries = 0; retries < 5; retries++) {
+		if (retries < 2)
+			rc = ccw_device_halt(rp->cdev, (long) rq);
+		else
+			rc = ccw_device_clear(rp->cdev, (long) rq);
+		if (rc == 0)
+			break;		/* termination successful */
+	}
+	return rc;
+}
+
+static int
+raw3270_halt_io(struct raw3270 *rp, struct raw3270_request *rq)
+{
+	unsigned long flags;
+	int rc;
+
+	spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
+	rc = raw3270_halt_io_nolock(rp, rq);
+	spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);
+	return rc;
+}
+
+/*
+ * Add the request to the request queue, try to start it if the
+ * 3270 device is idle. Return without waiting for end of i/o.
+ */
+static int
+__raw3270_start(struct raw3270 *rp, struct raw3270_view *view,
+		struct raw3270_request *rq)
+{
+	rq->view = view;
+	raw3270_get_view(view);
+	if (list_empty(&rp->req_queue) &&
+	    !test_bit(RAW3270_FLAGS_BUSY, &rp->flags)) {
+		/* No other requests are on the queue. Start this one. */
+		rq->rc = ccw_device_start(rp->cdev, &rq->ccw,
+					       (unsigned long) rq, 0, 0);
+		if (rq->rc) {
+			raw3270_put_view(view);
+			return rq->rc;
+		}
+	}
+	list_add_tail(&rq->list, &rp->req_queue);
+	return 0;
+}
+
+int
+raw3270_start(struct raw3270_view *view, struct raw3270_request *rq)
+{
+	unsigned long flags;
+	struct raw3270 *rp;
+	int rc;
+
+	spin_lock_irqsave(get_ccwdev_lock(view->dev->cdev), flags);
+	rp = view->dev;
+	if (!rp || rp->view != view)
+		rc = -EACCES;
+	else if (test_bit(RAW3270_FLAGS_SHUTDOWN, &rp->flags))
+		rc = -ENODEV;
+	else
+		rc =  __raw3270_start(rp, view, rq);
+	spin_unlock_irqrestore(get_ccwdev_lock(view->dev->cdev), flags);
+	return rc;
+}
+
+int
+raw3270_start_irq(struct raw3270_view *view, struct raw3270_request *rq)
+{
+	struct raw3270 *rp;
+
+	rp = view->dev;
+	rq->view = view;
+	raw3270_get_view(view);
+	list_add_tail(&rq->list, &rp->req_queue);
+	return 0;
+}
+
+/*
+ * 3270 interrupt routine, called from the ccw_device layer
+ */
+static void
+raw3270_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
+{
+	struct raw3270 *rp;
+	struct raw3270_view *view;
+	struct raw3270_request *rq;
+	int rc;
+
+	rp = (struct raw3270 *) cdev->dev.driver_data;
+	if (!rp)
+		return;
+	rq = (struct raw3270_request *) intparm;
+	view = rq ? rq->view : rp->view;
+
+	if (irb->scsw.dstat == 
+	    (DEV_STAT_CHN_END | DEV_STAT_DEV_END | DEV_STAT_UNIT_EXCEP)) {
+		/* Handle CE-DE-UE and subsequent UDE */
+		set_bit(RAW3270_FLAGS_BUSY, &rp->flags);
+		rc = RAW3270_IO_BUSY;
+	} else if (test_bit(RAW3270_FLAGS_BUSY, &rp->flags)) {
+		/* Wait for UDE if busy flag is set. */
+		if (irb->scsw.dstat & DEV_STAT_DEV_END) {
+			clear_bit(RAW3270_FLAGS_BUSY, &rp->flags);
+			/* Got it, now retry. */
+			rc = RAW3270_IO_RETRY;
+		} else
+			rc = RAW3270_IO_BUSY;
+	} else if (view)
+		rc = view->fn->intv(view, rq, irb);
+	else
+		rc = RAW3270_IO_DONE;
+
+	switch (rc) {
+	case RAW3270_IO_DONE:
+		break;
+	case RAW3270_IO_BUSY:
+		/* 
+		 * Intervention required by the operator. We have to wait
+		 * for unsolicited device end.
+		 */
+		return;
+	case RAW3270_IO_RETRY:
+		if (!rq)
+			break;
+		rq->rc = ccw_device_start(rp->cdev, &rq->ccw,
+					  (unsigned long) rq, 0, 0);
+		if (rq->rc == 0)
+			return;	/* Sucessfully restarted. */
+		break;
+	case RAW3270_IO_STOP:
+		raw3270_halt_io_nolock(rp, rq);
+		rq->rc = -EIO;
+		break;
+	default:
+		BUG();
+	}
+	if (rq) {
+		BUG_ON(list_empty(&rq->list));
+		/* The request completed, remove from queue and do callback. */
+		list_del_init(&rq->list);
+		if (rq->callback)
+			rq->callback(rq, rq->callback_data);
+		/* Do put_device for get_device in raw3270_start. */
+		raw3270_put_view(view);
+	}
+	/*
+	 * Try to start each request on request queue until one is
+	 * started successful.
+	 */
+	while (!list_empty(&rp->req_queue)) {
+		rq = list_entry(rp->req_queue.next,struct raw3270_request,list);
+		rq->rc = ccw_device_start(rp->cdev, &rq->ccw,
+					  (unsigned long) rq, 0, 0);
+		if (rq->rc == 0)
+			break;
+		/* Start failed. Remove request and do callback. */
+		list_del_init(&rq->list);
+		if (rq->callback)
+			rq->callback(rq, rq->callback_data);
+		/* Do put_device for get_device in raw3270_start. */
+		raw3270_put_view(view);
+	}
+}
+
+/*
+ * Size sensing.
+ */
+
+struct raw3270_ua {	/* Query Reply structure for Usable Area */
+	struct {	/* Usable Area Query Reply Base */
+		short l;	/* Length of this structured field */
+		char  sfid;	/* 0x81 if Query Reply */
+		char  qcode;	/* 0x81 if Usable Area */
+		char  flags0;
+		char  flags1;
+		short w;	/* Width of usable area */
+		short h;	/* Heigth of usavle area */
+		char  units;	/* 0x00:in; 0x01:mm */
+		int   xr;
+		int   yr;
+		char  aw;
+		char  ah;
+		short buffsz;	/* Character buffer size, bytes */
+		char  xmin;
+		char  ymin;
+		char  xmax;
+		char  ymax;
+	} __attribute__ ((packed)) uab;
+	struct {	/* Alternate Usable Area Self-Defining Parameter */
+		char  l;	/* Length of this Self-Defining Parm */
+		char  sdpid;	/* 0x02 if Alternate Usable Area */
+		char  res;
+		char  auaid;	/* 0x01 is Id for the A U A */
+		short wauai;	/* Width of AUAi */
+		short hauai;	/* Height of AUAi */
+		char  auaunits;	/* 0x00:in, 0x01:mm */
+		int   auaxr;
+		int   auayr;
+		char  awauai;
+		char  ahauai;
+	} __attribute__ ((packed)) aua;
+} __attribute__ ((packed));
+
+static unsigned char raw3270_init_data[256];
+static struct raw3270_request raw3270_init_request;
+static struct diag210 raw3270_init_diag210;
+static DECLARE_MUTEX(raw3270_init_sem);
+
+static int
+raw3270_init_irq(struct raw3270_view *view, struct raw3270_request *rq,
+		 struct irb *irb)
+{
+	/*
+	 * Unit-Check Processing:
+	 * Expect Command Reject or Intervention Required.
+	 */
+	if (irb->scsw.dstat & DEV_STAT_UNIT_CHECK) {
+		/* Request finished abnormally. */
+		if (irb->ecw[0] & SNS0_INTERVENTION_REQ) {
+			set_bit(RAW3270_FLAGS_BUSY, &view->dev->flags);
+			return RAW3270_IO_BUSY;
+		}
+	}
+	if (rq) {
+		if (irb->scsw.dstat & DEV_STAT_UNIT_CHECK) {
+			if (irb->ecw[0] & SNS0_CMD_REJECT)
+				rq->rc = -EOPNOTSUPP;
+			else
+				rq->rc = -EIO;
+		} else
+			/* Request finished normally. Copy residual count. */
+			rq->rescnt = irb->scsw.count;
+	}
+	if (irb->scsw.dstat & DEV_STAT_ATTENTION) {
+		set_bit(RAW3270_FLAGS_ATTN, &view->dev->flags);
+		wake_up(&raw3270_wait_queue);
+	}
+	return RAW3270_IO_DONE;
+}
+
+static struct raw3270_fn raw3270_init_fn = {
+	.intv = raw3270_init_irq
+};
+
+static struct raw3270_view raw3270_init_view = {
+	.fn = &raw3270_init_fn
+};
+
+/*
+ * raw3270_wait/raw3270_wait_interruptible/__raw3270_wakeup
+ * Wait for end of request. The request must have been started
+ * with raw3270_start, rc = 0. The device lock may NOT have been
+ * released between calling raw3270_start and raw3270_wait.
+ */
+static void
+raw3270_wake_init(struct raw3270_request *rq, void *data)
+{
+	wake_up((wait_queue_head_t *) data);
+}
+
+/*
+ * Special wait function that can cope with console initialization.
+ */
+static int
+raw3270_start_init(struct raw3270 *rp, struct raw3270_view *view,
+		   struct raw3270_request *rq)
+{
+	unsigned long flags;
+	wait_queue_head_t wq;
+	int rc;
+
+#ifdef CONFIG_TN3270_CONSOLE
+	if (raw3270_registered == 0) {
+		spin_lock_irqsave(get_ccwdev_lock(view->dev->cdev), flags);
+		rq->callback = 0;
+		rc = __raw3270_start(rp, view, rq);
+		if (rc == 0)
+			while (!raw3270_request_final(rq)) {
+				wait_cons_dev();
+				barrier();
+			}
+		spin_unlock_irqrestore(get_ccwdev_lock(view->dev->cdev), flags);
+		return rq->rc;
+	}
+#endif
+	init_waitqueue_head(&wq);
+	rq->callback = raw3270_wake_init;
+	rq->callback_data = &wq;
+	spin_lock_irqsave(get_ccwdev_lock(view->dev->cdev), flags);
+	rc = __raw3270_start(rp, view, rq);
+	spin_unlock_irqrestore(get_ccwdev_lock(view->dev->cdev), flags);
+	if (rc)
+		return rc;
+	/* Now wait for the completion. */
+	rc = wait_event_interruptible(wq, raw3270_request_final(rq));
+	if (rc == -ERESTARTSYS) {	/* Interrupted by a signal. */
+		raw3270_halt_io(view->dev, rq);
+		return -ERESTARTSYS;
+	}
+	return rq->rc;
+}
+
+static int
+__raw3270_size_device_vm(struct raw3270 *rp)
+{
+	int rc, model;
+
+	raw3270_init_diag210.vrdcdvno = 
+		_ccw_device_get_device_number(rp->cdev);
+	raw3270_init_diag210.vrdclen = sizeof(struct diag210);
+	rc = diag210(&raw3270_init_diag210);
+	if (rc)
+		return rc;
+	model = raw3270_init_diag210.vrdccrmd;
+	switch (model) {
+	case 2:
+		rp->model = model;
+		rp->rows = 24;
+		rp->cols = 80;
+		break;
+	case 3:
+		rp->model = model;
+		rp->rows = 32;
+		rp->cols = 80;
+		break;
+	case 4:
+		rp->model = model;
+		rp->rows = 43;
+		rp->cols = 80;
+		break;
+	case 5:
+		rp->model = model;
+		rp->rows = 27;
+		rp->cols = 132;
+		break;
+	default:
+		printk(KERN_WARNING "vrdccrmd is 0x%.8x\n", model);
+		rc = -EOPNOTSUPP;
+		break;
+	}
+	return rc;
+}
+
+static int
+__raw3270_size_device(struct raw3270 *rp)
+{
+	static const unsigned char wbuf[] =
+		{ 0x00, 0x07, 0x01, 0xff, 0x03, 0x00, 0x81 };
+	unsigned long flags;
+	struct raw3270_ua *uap;
+	unsigned short count;
+	int rc;
+
+	/*
+	 * To determine the size of the 3270 device we need to do:
+	 * 1) send a 'read partition' data stream to the device
+	 * 2) wait for the attn interrupt that preceeds the query reply
+	 * 3) do a read modified to get the query reply
+	 * To make things worse we have to cope with intervention
+	 * required (3270 device switched to 'stand-by') and command
+	 * rejects (old devices that can't do 'read partition').
+	 */
+	memset(&raw3270_init_request, 0, sizeof(raw3270_init_request));
+	memset(raw3270_init_data, 0, sizeof(raw3270_init_data));
+	/* Store 'read partition' data stream to raw3270_init_data */
+	memcpy(raw3270_init_data, wbuf, sizeof(wbuf));
+	INIT_LIST_HEAD(&raw3270_init_request.list);
+	raw3270_init_request.ccw.cmd_code = TC_WRITESF;
+	raw3270_init_request.ccw.flags = CCW_FLAG_SLI;
+	raw3270_init_request.ccw.count = sizeof(wbuf);
+	raw3270_init_request.ccw.cda = (__u32) __pa(raw3270_init_data);
+
+	rc = raw3270_start_init(rp, &raw3270_init_view, &raw3270_init_request);
+	if (rc) {
+		/* Check error cases: -ERESTARTSYS, -EIO and -EOPNOTSUPP */
+		if (rc == -EOPNOTSUPP && MACHINE_IS_VM)
+			return __raw3270_size_device_vm(rp);
+		return rc;
+	}
+
+	/* Wait for attention interrupt. */
+#ifdef CONFIG_TN3270_CONSOLE
+	if (raw3270_registered == 0) {
+		spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
+		while (!test_and_clear_bit(RAW3270_FLAGS_ATTN, &rp->flags))
+			wait_cons_dev();
+		spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);
+	} else
+#endif
+		rc = wait_event_interruptible(raw3270_wait_queue,
+			test_and_clear_bit(RAW3270_FLAGS_ATTN, &rp->flags));
+	if (rc)
+		return rc;
+
+	/*
+	 * The device accepted the 'read partition' command. Now
+	 * set up a read ccw and issue it.
+	 */
+	raw3270_init_request.ccw.cmd_code = TC_READMOD;
+	raw3270_init_request.ccw.flags = CCW_FLAG_SLI;
+	raw3270_init_request.ccw.count = sizeof(raw3270_init_data);
+	raw3270_init_request.ccw.cda = (__u32) __pa(raw3270_init_data);
+	rc = raw3270_start_init(rp, &raw3270_init_view, &raw3270_init_request);
+	if (rc)
+		return rc;
+	/* Got a Query Reply */
+	count = sizeof(raw3270_init_data) - raw3270_init_request.rescnt;
+	uap = (struct raw3270_ua *) (raw3270_init_data + 1);
+	/* Paranoia check. */
+	if (raw3270_init_data[0] != 0x88 || uap->uab.qcode != 0x81)
+		return -EOPNOTSUPP;
+	/* Copy rows/columns of default Usable Area */
+	rp->rows = uap->uab.h;
+	rp->cols = uap->uab.w;
+	/* Check for 14 bit addressing */
+	if ((uap->uab.flags0 & 0x0d) == 0x01)
+		set_bit(RAW3270_FLAGS_14BITADDR, &rp->flags);
+	/* Check for Alternate Usable Area */
+	if (uap->uab.l == sizeof(struct raw3270_ua) &&
+	    uap->aua.sdpid == 0x02) {
+		rp->rows = uap->aua.hauai;
+		rp->cols = uap->aua.wauai;
+	}
+	return 0;
+}
+
+static int
+raw3270_size_device(struct raw3270 *rp)
+{
+	int rc;
+
+	down(&raw3270_init_sem);
+	rp->view = &raw3270_init_view;
+	raw3270_init_view.dev = rp;
+	rc = __raw3270_size_device(rp);
+	raw3270_init_view.dev = 0;
+	rp->view = 0;
+	up(&raw3270_init_sem);
+	if (rc == 0) {	/* Found something. */
+		/* Try to find a model. */
+		rp->model = 0;
+		if (rp->rows == 24 && rp->cols == 80)
+			rp->model = 2;
+		if (rp->rows == 32 && rp->cols == 80)
+			rp->model = 3;
+		if (rp->rows == 43 && rp->cols == 80)
+			rp->model = 4;
+		if (rp->rows == 27 && rp->cols == 132)
+			rp->model = 5;
+	}
+	return rc;
+}
+
+static int
+raw3270_reset_device(struct raw3270 *rp)
+{
+	int rc;
+
+	down(&raw3270_init_sem);
+	memset(&raw3270_init_request, 0, sizeof(raw3270_init_request));
+	memset(raw3270_init_data, 0, sizeof(raw3270_init_data));
+	/* Store reset data stream to raw3270_init_data/raw3270_init_request */
+	raw3270_init_data[0] = TW_KR;
+	INIT_LIST_HEAD(&raw3270_init_request.list);
+	raw3270_init_request.ccw.cmd_code = TC_EWRITEA;
+	raw3270_init_request.ccw.flags = CCW_FLAG_SLI;
+	raw3270_init_request.ccw.count = 1;
+	raw3270_init_request.ccw.cda = (__u32) __pa(raw3270_init_data);
+	rp->view = &raw3270_init_view;
+	raw3270_init_view.dev = rp;
+	rc = raw3270_start_init(rp, &raw3270_init_view, &raw3270_init_request);
+	raw3270_init_view.dev = 0;
+	rp->view = 0;
+	up(&raw3270_init_sem);
+	return rc;
+}
+
+/*
+ * Setup new 3270 device.
+ */
+static int
+raw3270_setup_device(struct ccw_device *cdev, struct raw3270 *rp, char *ascebc)
+{
+	struct list_head *l;
+	struct raw3270 *tmp;
+	int minor;
+
+	memset(rp, 0, sizeof(struct raw3270));
+	/* Copy ebcdic -> ascii translation table. */
+	memcpy(ascebc, _ascebc, 256);
+	if (tubxcorrect) {
+		/* correct brackets and circumflex */
+		ascebc['['] = 0xad;
+		ascebc[']'] = 0xbd;
+		ascebc['^'] = 0xb0;
+	}
+	rp->ascebc = ascebc;
+
+	/* Set defaults. */
+	rp->rows = 24;
+	rp->cols = 80;
+
+	INIT_LIST_HEAD(&rp->req_queue);
+	INIT_LIST_HEAD(&rp->view_list);
+
+	/*
+	 * Add device to list and find the smallest unused minor
+	 * number for it.
+	 */
+	spin_lock(&raw3270_lock);
+	/* Keep the list sorted. */
+	minor = 0;
+	rp->minor = -1;
+	list_for_each(l, &raw3270_devices) {
+		tmp = list_entry(l, struct raw3270, list);
+		if (tmp->minor > minor) {
+			rp->minor = minor;
+			__list_add(&rp->list, l->prev, l);
+			break;
+		}
+		minor++;
+	}
+	if (rp->minor == -1 && minor < RAW3270_MAXDEVS) {
+		rp->minor = minor;
+		list_add_tail(&rp->list, &raw3270_devices);
+	}
+	spin_unlock(&raw3270_lock);
+	/* No free minor number? Then give up. */
+	if (rp->minor == -1)
+		return -EUSERS;
+	rp->cdev = cdev;
+	cdev->dev.driver_data = rp;
+	cdev->handler = raw3270_irq;
+	return 0;
+}
+
+#ifdef CONFIG_TN3270_CONSOLE
+/*
+ * Setup 3270 device configured as console.
+ */
+struct raw3270 *
+raw3270_setup_console(struct ccw_device *cdev)
+{
+	struct raw3270 *rp;
+	char *ascebc;
+	int rc;
+
+	rp = (struct raw3270 *) alloc_bootmem(sizeof(struct raw3270));
+	ascebc = (char *) alloc_bootmem(256);
+	rc = raw3270_setup_device(cdev, rp, ascebc);
+	if (rc)
+		return ERR_PTR(rc);
+	set_bit(RAW3270_FLAGS_CONSOLE, &rp->flags);
+	raw3270_reset_device(rp);
+	raw3270_size_device(rp);
+	raw3270_reset_device(rp);
+	return rp;
+}
+
+void
+raw3270_wait_cons_dev(struct raw3270 *rp)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
+	wait_cons_dev();
+	spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);
+}
+
+#endif
+
+/*
+ * Create a 3270 device structure.
+ */
+static struct raw3270 *
+raw3270_create_device(struct ccw_device *cdev)
+{
+	struct raw3270 *rp;
+	char *ascebc;
+	int rc;
+
+	rp = kmalloc(sizeof(struct raw3270), GFP_KERNEL);
+	if (!rp)
+		return ERR_PTR(-ENOMEM);
+	ascebc = kmalloc(256, GFP_KERNEL);
+	if (!ascebc) {
+		kfree(rp);
+		return ERR_PTR(-ENOMEM);
+	}
+	rc = raw3270_setup_device(cdev, rp, ascebc);
+	if (rc) {
+		kfree(rp->ascebc);
+		kfree(rp);
+		rp = ERR_PTR(rc);
+	}
+	/* Get reference to ccw_device structure. */
+	get_device(&cdev->dev);
+	return rp;
+}
+
+/*
+ * Activate a view.
+ */
+int
+raw3270_activate_view(struct raw3270_view *view)
+{
+	struct raw3270 *rp;
+	struct raw3270_view *oldview, *nv;
+	unsigned long flags;
+	int rc;
+
+	rp = view->dev;
+	if (!rp)
+		return -ENODEV;
+	spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
+	if (rp->view == view)
+		rc = 0;
+	else if (test_bit(RAW3270_FLAGS_SHUTDOWN, &rp->flags))
+		rc = -ENODEV;
+	else {
+		oldview = 0;
+		if (rp->view) {
+			oldview = rp->view;
+			oldview->fn->deactivate(oldview);
+		}
+		rp->view = view;
+		rc = view->fn->activate(view);
+		if (rc) {
+			/* Didn't work. Try to reactivate the old view. */
+			rp->view = oldview;
+			if (oldview->fn->activate(oldview) != 0) {
+				/* Didn't work as well. Try any other view. */
+				list_for_each_entry(nv, &rp->view_list, list)
+					if (nv != view && nv != oldview) {
+						rp->view = nv;
+						if (nv->fn->activate(nv) == 0)
+							break;
+						rp->view = 0;
+					}
+			}
+		}
+	}
+	spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);
+	return rc;
+}
+
+/*
+ * Deactivate current view.
+ */
+void
+raw3270_deactivate_view(struct raw3270_view *view)
+{
+	unsigned long flags;
+	struct raw3270 *rp;
+
+	rp = view->dev;
+	if (!rp)
+		return;
+	spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
+	if (rp->view == view) {
+		view->fn->deactivate(view);
+		rp->view = 0;
+		/* Move deactivated view to end of list. */
+		list_del_init(&view->list);
+		list_add_tail(&view->list, &rp->view_list);
+		/* Try to activate another view. */
+		if (!test_bit(RAW3270_FLAGS_SHUTDOWN, &rp->flags)) {
+			list_for_each_entry(view, &rp->view_list, list)
+				if (view->fn->activate(view) == 0) {
+					rp->view = view;
+					break;
+				}
+		}
+	}
+	spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);
+}
+
+/*
+ * Add view to device with minor "minor".
+ */
+int
+raw3270_add_view(struct raw3270_view *view, struct raw3270_fn *fn, int minor)
+{
+	unsigned long flags;
+	struct raw3270 *rp;
+	int rc;
+
+	spin_lock(&raw3270_lock);
+	rc = -ENODEV;
+	list_for_each_entry(rp, &raw3270_devices, list) {
+		if (rp->minor != minor)
+			continue;
+		spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
+		if (!test_bit(RAW3270_FLAGS_SHUTDOWN, &rp->flags)) {
+			atomic_set(&view->ref_count, 2);
+			view->dev = rp;
+			view->fn = fn;
+			view->model = rp->model;
+			view->rows = rp->rows;
+			view->cols = rp->cols;
+			view->ascebc = rp->ascebc;
+			spin_lock_init(&view->lock);
+			list_add_tail(&view->list, &rp->view_list);
+			rc = 0;
+		}
+		spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);
+		break;
+	}
+	spin_unlock(&raw3270_lock);
+	return rc;
+}
+
+/*
+ * Find specific view of device with minor "minor".
+ */
+struct raw3270_view *
+raw3270_find_view(struct raw3270_fn *fn, int minor)
+{
+	struct raw3270 *rp;
+	struct raw3270_view *view, *tmp;
+	unsigned long flags;
+
+	spin_lock(&raw3270_lock);
+	view = ERR_PTR(-ENODEV);
+	list_for_each_entry(rp, &raw3270_devices, list) {
+		if (rp->minor != minor)
+			continue;
+		spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
+		if (!test_bit(RAW3270_FLAGS_SHUTDOWN, &rp->flags)) {
+			list_for_each_entry(tmp, &rp->view_list, list) {
+				if (tmp->fn == fn) {
+					raw3270_get_view(tmp);
+					view = tmp;
+				}
+			}
+		} else
+			view = ERR_PTR(-ENOENT);
+		spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);
+		break;
+	}
+	spin_unlock(&raw3270_lock);
+	return view;
+}
+
+/*
+ * Remove view from device and free view structure via call to view->fn->free.
+ */
+void
+raw3270_del_view(struct raw3270_view *view)
+{
+	unsigned long flags;
+	struct raw3270 *rp;
+
+	rp = view->dev;
+	spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
+	if (rp->view == view) {
+		view->fn->deactivate(view);
+		rp->view = 0;
+	}
+	list_del_init(&view->list);
+	if (!rp->view && !test_bit(RAW3270_FLAGS_SHUTDOWN, &rp->flags)) {
+		/* Try to activate another view. */
+		list_for_each_entry(view, &rp->view_list, list)
+			if (view->fn->activate(view) == 0) {
+				rp->view = view;
+				break;
+			}
+	}
+	spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);
+	/* Wait for reference counter to drop to zero. */
+	atomic_dec(&view->ref_count);
+	wait_event(raw3270_wait_queue, atomic_read(&view->ref_count) == 0);
+	if (view->fn->free)
+		view->fn->free(view);
+}
+
+/*
+ * Remove a 3270 device structure.
+ */
+static void
+raw3270_delete_device(struct raw3270 *rp)
+{
+	struct ccw_device *cdev;
+
+	/* Remove from device chain. */
+	spin_lock(&raw3270_lock);
+	list_del_init(&rp->list);
+	spin_unlock(&raw3270_lock);
+
+	/* Disconnect from ccw_device. */
+	cdev = rp->cdev;
+	rp->cdev = 0;
+	cdev->dev.driver_data = 0;
+	cdev->handler = 0;
+
+	/* Put ccw_device structure. */
+	put_device(&cdev->dev);
+
+	/* Now free raw3270 structure. */
+	kfree(rp->ascebc);
+	kfree(rp);
+}
+
+static int
+raw3270_probe (struct ccw_device *cdev)
+{
+	return 0;
+}
+
+/*
+ * Additional attributes for a 3270 device
+ */
+static ssize_t
+raw3270_model_show(struct device *dev, char *buf)
+{
+	return snprintf(buf, PAGE_SIZE, "%i\n",
+			((struct raw3270 *) dev->driver_data)->model);
+}
+static DEVICE_ATTR(model, 0444, raw3270_model_show, 0);
+
+static ssize_t
+raw3270_rows_show(struct device *dev, char *buf)
+{
+	return snprintf(buf, PAGE_SIZE, "%i\n",
+			((struct raw3270 *) dev->driver_data)->rows);
+}
+static DEVICE_ATTR(rows, 0444, raw3270_rows_show, 0);
+
+static ssize_t
+raw3270_columns_show(struct device *dev, char *buf)
+{
+	return snprintf(buf, PAGE_SIZE, "%i\n",
+			((struct raw3270 *) dev->driver_data)->cols);
+}
+static DEVICE_ATTR(columns, 0444, raw3270_columns_show, 0);
+
+static struct attribute * raw3270_attrs[] = {
+	&dev_attr_model.attr,
+	&dev_attr_rows.attr,
+	&dev_attr_columns.attr,
+	NULL,
+};
+
+static struct attribute_group raw3270_attr_group = {
+	.attrs = raw3270_attrs,
+};
+
+static void
+raw3270_create_attributes(struct raw3270 *rp)
+{
+	//FIXME: check return code
+	sysfs_create_group(&rp->cdev->dev.kobj, &raw3270_attr_group);
+}
+
+/* Hackish. A notifier chain would be cleaner. */
+extern void tty3270_notifier(int index, int active);
+
+/*
+ * Set 3270 device online.
+ */
+static int
+raw3270_set_online (struct ccw_device *cdev)
+{
+	struct raw3270 *rp;
+
+	rp = raw3270_create_device(cdev);
+	if (IS_ERR(rp))
+		return PTR_ERR(rp);
+	raw3270_reset_device(rp);
+	raw3270_size_device(rp);
+	raw3270_reset_device(rp);
+	raw3270_create_attributes(rp);
+	tty3270_notifier(rp->minor, 1);
+	return 0;
+}
+
+/*
+ * Remove 3270 device structure.
+ */
+static void
+raw3270_remove (struct ccw_device *cdev)
+{
+	unsigned long flags;
+	struct raw3270 *rp;
+	struct raw3270_view *v;
+
+	rp = cdev->dev.driver_data;
+	set_bit(RAW3270_FLAGS_SHUTDOWN, &rp->flags);
+
+	sysfs_remove_group(&cdev->dev.kobj, &raw3270_attr_group);
+
+	/* Deactivate current view and remove all views. */
+	spin_lock_irqsave(get_ccwdev_lock(cdev), flags);
+	if (rp->view) {
+		rp->view->fn->deactivate(rp->view);
+		rp->view = 0;
+	}
+	while (!list_empty(&rp->view_list)) {
+		v = list_entry(rp->view_list.next, struct raw3270_view, list);
+		if (v->fn->release)
+			v->fn->release(v);
+		spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags);
+		raw3270_del_view(v);
+		spin_lock_irqsave(get_ccwdev_lock(cdev), flags);
+	}
+	spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags);
+
+	tty3270_notifier(rp->minor, 0);
+
+	/* Reset 3270 device. */
+	raw3270_reset_device(rp);
+	/* And finally remove it. */
+	raw3270_delete_device(rp);
+}
+
+/*
+ * Set 3270 device offline.
+ */
+static int
+raw3270_set_offline (struct ccw_device *cdev)
+{
+	struct raw3270 *rp;
+
+	rp = cdev->dev.driver_data;
+	if (test_bit(RAW3270_FLAGS_CONSOLE, &rp->flags))
+		return -EBUSY;
+	raw3270_remove(cdev);
+	return 0;
+}
+
+static struct ccw_device_id raw3270_id[] = {
+	{ CCW_DEVICE(0x3270, 0) },
+	{ CCW_DEVICE(0x3271, 0) },
+	{ CCW_DEVICE(0x3272, 0) },
+	{ CCW_DEVICE(0x3273, 0) },
+	{ CCW_DEVICE(0x3274, 0) },
+	{ CCW_DEVICE(0x3275, 0) },
+	{ CCW_DEVICE(0x3276, 0) },
+	{ CCW_DEVICE(0x3277, 0) },
+	{ CCW_DEVICE(0x3278, 0) },
+	{ CCW_DEVICE(0x3279, 0) },
+	{ CCW_DEVICE(0x3174, 0) },
+	{ /* end of list */ },
+};
+
+static struct ccw_driver raw3270_ccw_driver = {
+	.name		= "3270",
+	.owner		= THIS_MODULE,
+	.ids		= raw3270_id,
+	.probe		= &raw3270_probe,
+	.remove		= &raw3270_remove,
+	.set_online	= &raw3270_set_online,
+	.set_offline	= &raw3270_set_offline,
+};
+
+int
+raw3270_init(void)
+{
+	struct raw3270 *rp;
+	int rc;
+
+	if (raw3270_registered)
+		return 0;
+	raw3270_registered = 1;
+	rc = ccw_driver_register(&raw3270_ccw_driver);
+	if (rc == 0) {
+		/* Create attributes for early (= console) device. */
+		spin_lock(&raw3270_lock);
+		list_for_each_entry(rp, &raw3270_devices, list) {
+			get_device(&rp->cdev->dev);
+			raw3270_create_attributes(rp);
+			tty3270_notifier(rp->minor, 1);
+		}
+		spin_unlock(&raw3270_lock);
+	}
+	return rc;
+}
+
+void
+raw3270_exit(void)
+{
+	ccw_driver_unregister(&raw3270_ccw_driver);
+}
+
+MODULE_LICENSE("GPL");
+
+EXPORT_SYMBOL(raw3270_init);
+EXPORT_SYMBOL(raw3270_exit);
+EXPORT_SYMBOL(raw3270_request_alloc);
+EXPORT_SYMBOL(raw3270_request_free);
+EXPORT_SYMBOL(raw3270_request_reset);
+EXPORT_SYMBOL(raw3270_request_set_cmd);
+EXPORT_SYMBOL(raw3270_request_add_data);
+EXPORT_SYMBOL(raw3270_request_set_data);
+EXPORT_SYMBOL(raw3270_request_set_idal);
+EXPORT_SYMBOL(raw3270_buffer_address);
+EXPORT_SYMBOL(raw3270_add_view);
+EXPORT_SYMBOL(raw3270_del_view);
+EXPORT_SYMBOL(raw3270_find_view);
+EXPORT_SYMBOL(raw3270_activate_view);
+EXPORT_SYMBOL(raw3270_deactivate_view);
+EXPORT_SYMBOL(raw3270_start);
+EXPORT_SYMBOL(raw3270_start_irq);
diff -Nru a/drivers/s390/char/raw3270.h b/drivers/s390/char/raw3270.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/s390/char/raw3270.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,273 @@
+/*
+ *  drivers/s390/char/raw3270.h
+ *    IBM/3270 Driver
+ *
+ *  Author(s):
+ *    Original 3270 Code for 2.4 written by Richard Hitt (UTS Global)
+ *    Rewritten for 2.5 by Martin Schwidefsky <schwidefsky@de.ibm.com>
+ *	-- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ */
+
+#include <asm/idals.h>
+#include <asm/ioctl.h>
+
+/* ioctls for fullscreen 3270 */
+#define TUBICMD		_IO('3', 3)	/* set ccw command for fs reads. */
+#define TUBOCMD		_IO('3', 4)	/* set ccw command for fs writes. */
+#define TUBGETI		_IO('3', 7)	/* get ccw command for fs reads. */
+#define TUBGETO		_IO('3', 8)	/* get ccw command for fs writes. */
+#define TUBSETMOD	_IO('3',12)	/* FIXME: what does it do ?*/
+#define TUBGETMOD	_IO('3',13)	/* FIXME: what does it do ?*/
+
+/* Local Channel Commands */
+#define TC_WRITE	0x01		/* Write */
+#define TC_EWRITE	0x05		/* Erase write */
+#define TC_READMOD	0x06		/* Read modified */
+#define TC_EWRITEA	0x0d		/* Erase write alternate */
+#define TC_WRITESF	0x11		/* Write structured field */
+
+/* Buffer Control Orders */
+#define TO_SF		0x1d		/* Start field */
+#define TO_SBA		0x11		/* Set buffer address */
+#define TO_IC		0x13		/* Insert cursor */
+#define TO_PT		0x05		/* Program tab */
+#define TO_RA		0x3c		/* Repeat to address */
+#define TO_SFE		0x29		/* Start field extended */
+#define TO_EUA		0x12		/* Erase unprotected to address */
+#define TO_MF		0x2c		/* Modify field */
+#define TO_SA		0x28		/* Set attribute */
+
+/* Field Attribute Bytes */
+#define TF_INPUT	0x40		/* Visible input */
+#define TF_INPUTN	0x4c		/* Invisible input */
+#define TF_INMDT	0xc1		/* Visible, Set-MDT */
+#define TF_LOG		0x60
+
+/* Character Attribute Bytes */
+#define TAT_RESET	0x00
+#define TAT_FIELD	0xc0
+#define TAT_EXTHI	0x41
+#define TAT_COLOR	0x42
+#define TAT_CHARS	0x43
+#define TAT_TRANS	0x46
+
+/* Extended-Highlighting Bytes */
+#define TAX_RESET	0x00
+#define TAX_BLINK	0xf1
+#define TAX_REVER	0xf2
+#define TAX_UNDER	0xf4
+
+/* Reset value */
+#define TAR_RESET	0x00
+
+/* Color values */
+#define TAC_RESET	0x00
+#define TAC_BLUE	0xf1
+#define TAC_RED		0xf2
+#define TAC_PINK	0xf3
+#define TAC_GREEN	0xf4
+#define TAC_TURQ	0xf5
+#define TAC_YELLOW	0xf6
+#define TAC_WHITE	0xf7
+#define TAC_DEFAULT	0x00
+
+/* Write Control Characters */
+#define TW_NONE		0x40		/* No particular action */
+#define TW_KR		0xc2		/* Keyboard restore */
+#define TW_PLUSALARM	0x04		/* Add this bit for alarm */
+
+#define RAW3270_MAXDEVS	256
+
+int raw3270_init(void);
+void raw3270_exit(void);
+
+/* For TUBGETMOD and TUBSETMOD. Should include. */
+struct raw3270_iocb {
+	short model;
+	short line_cnt;
+	short col_cnt;
+	short pf_cnt;
+	short re_cnt;
+	short map;
+};
+
+struct raw3270;
+struct raw3270_view;
+
+/* 3270 CCW request */
+struct raw3270_request {
+	struct list_head list;		/* list head for request queueing. */
+	struct raw3270_view *view;	/* view of this request */
+	struct ccw1 ccw;		/* single ccw. */
+	void *buffer;			/* output buffer. */
+	size_t size;			/* size of output buffer. */
+	int rescnt;			/* residual count from devstat. */
+	int rc;				/* return code for this request. */
+
+	/* Callback for delivering final status. */
+	void (*callback)(struct raw3270_request *, void *);
+	void *callback_data;
+};
+
+struct raw3270_request *raw3270_request_alloc(size_t size);
+struct raw3270_request *raw3270_request_alloc_bootmem(size_t size);
+void raw3270_request_free(struct raw3270_request *);
+void raw3270_request_reset(struct raw3270_request *);
+void raw3270_request_set_cmd(struct raw3270_request *, u8 cmd);
+int  raw3270_request_add_data(struct raw3270_request *, void *, size_t);
+void raw3270_request_set_data(struct raw3270_request *, void *, size_t);
+void raw3270_request_set_idal(struct raw3270_request *, struct idal_buffer *);
+
+static inline int
+raw3270_request_final(struct raw3270_request *rq)
+{
+	return list_empty(&rq->list);
+}
+
+void raw3270_buffer_address(struct raw3270 *, char *, unsigned short);
+
+/* Return value of *intv (see raw3270_fn below) can be one of the following: */
+#define RAW3270_IO_DONE		0	/* request finished */
+#define RAW3270_IO_BUSY		1	/* request still active */
+#define RAW3270_IO_RETRY	2	/* retry current request */
+#define RAW3270_IO_STOP		3	/* kill current request */
+
+/*
+ * Functions of a 3270 view.
+ */
+struct raw3270_fn {
+	int  (*activate)(struct raw3270_view *);
+	void (*deactivate)(struct raw3270_view *);
+	int  (*intv)(struct raw3270_view *,
+		     struct raw3270_request *, struct irb *);
+	void (*release)(struct raw3270_view *);
+	void (*free)(struct raw3270_view *);
+};
+
+/*
+ * View structure chaining. The raw3270_view structure is meant to
+ * be embedded at the start of the real view data structure, e.g.:
+ *   struct example {
+ *     struct raw3270_view view;
+ *     ...
+ *   };
+ */
+struct raw3270_view {
+	struct list_head list;
+	spinlock_t lock;
+	atomic_t ref_count;
+	struct raw3270 *dev;
+	struct raw3270_fn *fn;
+	unsigned int model;
+	unsigned int rows, cols;	/* # of rows & colums of the view */
+	unsigned char *ascebc;		/* ascii -> ebcdic table */
+};
+
+int raw3270_add_view(struct raw3270_view *, struct raw3270_fn *, int);
+int raw3270_activate_view(struct raw3270_view *);
+void raw3270_del_view(struct raw3270_view *);
+void raw3270_deactivate_view(struct raw3270_view *);
+struct raw3270_view *raw3270_find_view(struct raw3270_fn *, int);
+int raw3270_start(struct raw3270_view *, struct raw3270_request *);
+int raw3270_start_irq(struct raw3270_view *, struct raw3270_request *);
+
+/* Reference count inliner for view structures. */
+static inline void
+raw3270_get_view(struct raw3270_view *view)
+{
+	atomic_inc(&view->ref_count);
+}
+
+extern wait_queue_head_t raw3270_wait_queue;
+
+static inline void
+raw3270_put_view(struct raw3270_view *view)
+{
+	if (atomic_dec_return(&view->ref_count) == 0)
+		wake_up(&raw3270_wait_queue);
+}
+
+struct raw3270 *raw3270_setup_console(struct ccw_device *cdev);
+void raw3270_wait_cons_dev(struct raw3270 *);
+
+/*
+ * Little memory allocator for string objects. 
+ */
+struct string
+{
+	struct list_head list;
+	struct list_head update;
+	unsigned long size;
+	unsigned long len;
+	char string[0];
+} __attribute__ ((aligned(8)));
+
+static inline struct string *
+alloc_string(struct list_head *free_list, unsigned long len)
+{
+	struct string *cs, *tmp;
+	unsigned long size;
+
+	size = (len + 7L) & -8L;
+	list_for_each_entry(cs, free_list, list) {
+		if (cs->size < size)
+			continue;
+		if (cs->size > size + sizeof(struct string)) {
+			char *endaddr = (char *) (cs + 1) + cs->size;
+			tmp = (struct string *) (endaddr - size) - 1;
+			tmp->size = size;
+			cs->size -= size + sizeof(struct string);
+			cs = tmp;
+		} else
+			list_del(&cs->list);
+		cs->len = len;
+		INIT_LIST_HEAD(&cs->list);
+		INIT_LIST_HEAD(&cs->update);
+		return cs;
+	}
+	return 0;
+}
+
+static inline unsigned long
+free_string(struct list_head *free_list, struct string *cs)
+{
+	struct string *tmp;
+	struct list_head *p, *left;
+
+	/* Find out the left neighbour in free memory list. */
+	left = free_list;
+	list_for_each(p, free_list) {
+		if (list_entry(p, struct string, list) > cs)
+			break;
+		left = p;
+	}
+	/* Try to merge with right neighbour = next element from left. */
+	if (left->next != free_list) {
+		tmp = list_entry(left->next, struct string, list);
+		if ((char *) (cs + 1) + cs->size == (char *) tmp) {
+			list_del(&tmp->list);
+			cs->size += tmp->size + sizeof(struct string);
+		}
+	}
+	/* Try to merge with left neighbour. */
+	if (left != free_list) {
+		tmp = list_entry(left, struct string, list);
+		if ((char *) (tmp + 1) + tmp->size == (char *) cs) {
+			tmp->size += cs->size + sizeof(struct string);
+			return tmp->size;
+		}
+	}
+	__list_add(&cs->list, left, left->next);
+	return cs->size;
+}
+
+static inline void
+add_string_memory(struct list_head *free_list, void *mem, unsigned long size)
+{
+	struct string *cs;
+
+	cs = (struct string *) mem;
+	cs->size = size - sizeof(struct string);
+	free_string(free_list, cs);
+}
+
diff -Nru a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c
--- a/drivers/s390/char/sclp.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/s390/char/sclp.c	Tue Feb  3 19:45:30 2004
@@ -315,8 +315,9 @@
 	/* Head queue a read sccb if an event buffer is pending */
 	if (evbuf_pending)
 		__sclp_unconditional_read();
-	/* Now clear the running bit */
-	clear_bit(SCLP_RUNNING, &sclp_status);
+	/* Now clear the running bit if SCLP indicated a finished SCCB */
+	if (finished_sccb != 0U)
+		clear_bit(SCLP_RUNNING, &sclp_status);
 	spin_unlock(&sclp_lock);
 	/* and start next request on the queue */
 	sclp_start_request();
diff -Nru a/drivers/s390/char/sclp_con.c b/drivers/s390/char/sclp_con.c
--- a/drivers/s390/char/sclp_con.c	Tue Feb  3 19:45:26 2004
+++ b/drivers/s390/char/sclp_con.c	Tue Feb  3 19:45:26 2004
@@ -134,8 +134,8 @@
 		}
 		/* try to write the string to the current output buffer */
 		written = sclp_write(sclp_conbuf, (const unsigned char *)
-				     message, count, 0);
-		if (written == -EFAULT || written == count)
+				     message, count);
+		if (written == count)
 			break;
 		/*
 		 * Not all characters could be written to the current
@@ -149,7 +149,8 @@
 		count -= written;
 	} while (count > 0);
 	/* Setup timer to output current console buffer after 1/10 second */
-	if (sclp_conbuf != NULL && !timer_pending(&sclp_con_timer)) {
+	if (sclp_conbuf != NULL && sclp_chars_in_buffer(sclp_conbuf) != 0 &&
+	    !timer_pending(&sclp_con_timer)) {
 		init_timer(&sclp_con_timer);
 		sclp_con_timer.function = sclp_console_timeout;
 		sclp_con_timer.data = 0UL;
diff -Nru a/drivers/s390/char/sclp_rw.c b/drivers/s390/char/sclp_rw.c
--- a/drivers/s390/char/sclp_rw.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/char/sclp_rw.c	Tue Feb  3 19:45:17 2004
@@ -175,11 +175,9 @@
  *  is not busy)
  */
 int
-sclp_write(struct sclp_buffer *buffer,
-	   const unsigned char *msg, int count, int from_user)
+sclp_write(struct sclp_buffer *buffer, const unsigned char *msg, int count)
 {
 	int spaces, i_msg;
-	char ch;
 	int rc;
 
 	/*
@@ -206,13 +204,7 @@
 	 * This is in order to a slim and quick implementation.
 	 */
 	for (i_msg = 0; i_msg < count; i_msg++) {
-		if (from_user) {
-			if (get_user(ch, msg + i_msg) != 0)
-				return -EFAULT;
-		} else
-			ch = msg[i_msg];
-
-		switch (ch) {
+		switch (msg[i_msg]) {
 		case '\n':	/* new line, line feed (ASCII)	*/
 			/* check if new mto needs to be created */
 			if (buffer->current_line == NULL) {
@@ -282,11 +274,11 @@
 			if (buffer->current_line != NULL)
 				sclp_finalize_mto(buffer);
 			/* skip the rest of the message including the 0 byte */
-			i_msg = count;
+			i_msg = count - 1;
 			break;
 		default:	/* no escape character	*/
 			/* do not output unprintable characters */
-			if (!isprint(ch))
+			if (!isprint(msg[i_msg]))
 				break;
 			/* check if new mto needs to be created */
 			if (buffer->current_line == NULL) {
@@ -295,7 +287,7 @@
 				if (rc)
 					return i_msg;
 			}
-			*buffer->current_line++ = sclp_ascebc(ch);
+			*buffer->current_line++ = sclp_ascebc(msg[i_msg]);
 			buffer->current_length++;
 			break;
 		}
diff -Nru a/drivers/s390/char/sclp_rw.h b/drivers/s390/char/sclp_rw.h
--- a/drivers/s390/char/sclp_rw.h	Tue Feb  3 19:45:29 2004
+++ b/drivers/s390/char/sclp_rw.h	Tue Feb  3 19:45:29 2004
@@ -89,7 +89,7 @@
 struct sclp_buffer *sclp_make_buffer(void *, unsigned short, unsigned short);
 void *sclp_unmake_buffer(struct sclp_buffer *);
 int sclp_buffer_space(struct sclp_buffer *);
-int sclp_write(struct sclp_buffer *buffer, const unsigned char *, int, int);
+int sclp_write(struct sclp_buffer *buffer, const unsigned char *, int);
 void sclp_emit_buffer(struct sclp_buffer *,void (*)(struct sclp_buffer *,int));
 void sclp_set_columns(struct sclp_buffer *, unsigned short);
 void sclp_set_htab(struct sclp_buffer *, unsigned short);
diff -Nru a/drivers/s390/char/sclp_tty.c b/drivers/s390/char/sclp_tty.c
--- a/drivers/s390/char/sclp_tty.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/char/sclp_tty.c	Tue Feb  3 19:45:17 2004
@@ -18,6 +18,7 @@
 #include <linux/slab.h>
 #include <linux/err.h>
 #include <linux/init.h>
+#include <linux/interrupt.h>
 #include <asm/uaccess.h>
 
 #include "ctrlchar.h"
@@ -322,7 +323,7 @@
  * Write a string to the sclp tty.
  */
 static void
-sclp_tty_write_string(const unsigned char *str, int count, int from_user)
+sclp_tty_write_string(const unsigned char *str, int count)
 {
 	unsigned long flags;
 	void *page;
@@ -337,8 +338,11 @@
 		if (sclp_ttybuf == NULL) {
 			while (list_empty(&sclp_tty_pages)) {
 				spin_unlock_irqrestore(&sclp_tty_lock, flags);
-				wait_event(sclp_tty_waitq,
-					   !list_empty(&sclp_tty_pages));
+				if (in_interrupt())
+					sclp_sync_wait();
+				else
+					wait_event(sclp_tty_waitq,
+						!list_empty(&sclp_tty_pages));
 				spin_lock_irqsave(&sclp_tty_lock, flags);
 			}
 			page = sclp_tty_pages.next;
@@ -348,8 +352,8 @@
 						       sclp_ioctls.htab);
 		}
 		/* try to write the string to the current output buffer */
-		written = sclp_write(sclp_ttybuf, str, count, from_user);
-		if (written == -EFAULT || written == count)
+		written = sclp_write(sclp_ttybuf, str, count);
+		if (written == count)
 			break;
 		/*
 		 * Not all characters could be written to the current
@@ -366,7 +370,9 @@
 	} while (count > 0);
 	/* Setup timer to output current console buffer after 1/10 second */
 	if (sclp_ioctls.final_nl) {
-		if (sclp_ttybuf != NULL && !timer_pending(&sclp_tty_timer)) {
+		if (sclp_ttybuf != NULL &&
+		    sclp_chars_in_buffer(sclp_ttybuf) != 0 &&
+		    !timer_pending(&sclp_tty_timer)) {
 			init_timer(&sclp_tty_timer);
 			sclp_tty_timer.function = sclp_tty_timeout;
 			sclp_tty_timer.data = 0UL;
@@ -374,8 +380,14 @@
 			add_timer(&sclp_tty_timer);
 		}
 	} else {
-		__sclp_ttybuf_emit(sclp_ttybuf);
-		sclp_ttybuf = NULL;
+		if (sclp_ttybuf != NULL &&
+		    sclp_chars_in_buffer(sclp_ttybuf) != 0) {
+			buf = sclp_ttybuf;
+			sclp_ttybuf = NULL;
+			spin_unlock_irqrestore(&sclp_tty_lock, flags);
+			__sclp_ttybuf_emit(buf);
+			spin_lock_irqsave(&sclp_tty_lock, flags);
+		}
 	}
 	spin_unlock_irqrestore(&sclp_tty_lock, flags);
 }
@@ -389,12 +401,32 @@
 sclp_tty_write(struct tty_struct *tty, int from_user,
 	       const unsigned char *buf, int count)
 {
+	int length, ret;
+
 	if (sclp_tty_chars_count > 0) {
-		sclp_tty_write_string(sclp_tty_chars, sclp_tty_chars_count, 0);
+		sclp_tty_write_string(sclp_tty_chars, sclp_tty_chars_count);
 		sclp_tty_chars_count = 0;
 	}
-	sclp_tty_write_string(buf, count, from_user);
-	return count;
+	if (!from_user) {
+		sclp_tty_write_string(buf, count);
+		return count;
+	}
+	ret = 0;
+	while (count > 0) {
+		length = count < SCLP_TTY_BUF_SIZE ?
+			count : SCLP_TTY_BUF_SIZE;
+		length -= copy_from_user(sclp_tty_chars, buf, length);
+		if (length == 0) {
+			if (!ret)
+				ret = -EFAULT;
+			break;
+		}
+		sclp_tty_write_string(sclp_tty_chars, length);
+		buf += length;
+		count -= length;
+		ret += length;
+	}
+	return ret;
 }
 
 /*
@@ -412,7 +444,7 @@
 {
 	sclp_tty_chars[sclp_tty_chars_count++] = ch;
 	if (ch == '\n' || sclp_tty_chars_count >= SCLP_TTY_BUF_SIZE) {
-		sclp_tty_write_string(sclp_tty_chars, sclp_tty_chars_count, 0);
+		sclp_tty_write_string(sclp_tty_chars, sclp_tty_chars_count);
 		sclp_tty_chars_count = 0;
 	}
 }
@@ -425,7 +457,7 @@
 sclp_tty_flush_chars(struct tty_struct *tty)
 {
 	if (sclp_tty_chars_count > 0) {
-		sclp_tty_write_string(sclp_tty_chars, sclp_tty_chars_count, 0);
+		sclp_tty_write_string(sclp_tty_chars, sclp_tty_chars_count);
 		sclp_tty_chars_count = 0;
 	}
 }
@@ -451,7 +483,7 @@
 		count = sclp_chars_in_buffer(sclp_ttybuf);
 	list_for_each(l, &sclp_tty_outqueue) {
 		t = list_entry(l, struct sclp_buffer, list);
-		count += sclp_chars_in_buffer(sclp_ttybuf);
+		count += sclp_chars_in_buffer(t);
 	}
 	spin_unlock_irqrestore(&sclp_tty_lock, flags);
 	return count;
@@ -464,7 +496,7 @@
 sclp_tty_flush_buffer(struct tty_struct *tty)
 {
 	if (sclp_tty_chars_count > 0) {
-		sclp_tty_write_string(sclp_tty_chars, sclp_tty_chars_count, 0);
+		sclp_tty_write_string(sclp_tty_chars, sclp_tty_chars_count);
 		sclp_tty_chars_count = 0;
 	}
 }
diff -Nru a/drivers/s390/char/tape.h b/drivers/s390/char/tape.h
--- a/drivers/s390/char/tape.h	Tue Feb  3 19:45:34 2004
+++ b/drivers/s390/char/tape.h	Tue Feb  3 19:45:34 2004
@@ -12,19 +12,33 @@
 #ifndef _TAPE_H
 #define _TAPE_H
 
+#include <asm/ccwdev.h>
+#include <asm/debug.h>
+#include <asm/idals.h>
 #include <linux/config.h>
 #include <linux/blkdev.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/mtio.h>
 #include <linux/interrupt.h>
-#include <asm/ccwdev.h>
-#include <asm/debug.h>
-#include <asm/idals.h>
+#include <linux/workqueue.h>
 
 struct gendisk;
 
 /*
+ * Define DBF_LIKE_HELL for lots of messages in the debug feature.
+ */
+#define DBF_LIKE_HELL
+#ifdef  DBF_LIKE_HELL
+#define DBF_LH(level, str, ...) \
+do { \
+	debug_sprintf_event(tape_dbf_area, level, str, ## __VA_ARGS__); \
+} while (0)
+#else
+#define DBF_LH(level, str, ...) do {} while(0)
+#endif
+
+/*
  * macros s390 debug feature (dbf)
  */
 #define DBF_EVENT(d_level, d_str...) \
@@ -46,7 +60,11 @@
 #define TAPEBLOCK_HSEC_S2B	2
 #define TAPEBLOCK_RETRIES	5
 
-#define TAPE_BUSY(td) (td->treq != NULL)
+/* Event types for hotplug */
+#define TAPE_HOTPLUG_CHAR_ADD     1
+#define TAPE_HOTPLUG_BLOCK_ADD    2
+#define TAPE_HOTPLUG_CHAR_REMOVE  3
+#define TAPE_HOTPLUG_BLOCK_REMOVE 4
 
 enum tape_medium_state {
 	MS_UNKNOWN,
@@ -58,6 +76,7 @@
 enum tape_state {
 	TS_UNUSED=0,
 	TS_IN_USE,
+	TS_BLKUSE,
 	TS_INIT,
 	TS_NOT_OPER,
 	TS_SIZE
@@ -130,8 +149,6 @@
 	struct module *owner;
 	int  (*setup_device)(struct tape_device *);
 	void (*cleanup_device)(struct tape_device *);
-	int (*assign)(struct tape_device *);
-	int (*unassign)(struct tape_device *);
 	int (*irq)(struct tape_device *, struct tape_request *, struct irb *);
 	struct tape_request *(*read_block)(struct tape_device *, size_t);
 	struct tape_request *(*write_block)(struct tape_device *, size_t);
@@ -168,48 +185,60 @@
 struct tape_blk_data
 {
 	/* Block device request queue. */
-	request_queue_t *request_queue;
-	spinlock_t request_queue_lock;
-	/* Block frontend tasklet */
-	struct tasklet_struct tasklet;
+	request_queue_t *	request_queue;
+	spinlock_t		request_queue_lock;
+
+	/* Task to move entries from block request to CCS request queue. */
+	struct work_struct	requeue_task;
+	atomic_t		requeue_scheduled;
+
 	/* Current position on the tape. */
-	long block_position;
-	struct gendisk *disk;
+	long			block_position;
+	int			medium_changed;
+	struct gendisk *	disk;
 };
 #endif
 
 /* Tape Info */
 struct tape_device {
 	/* entry in tape_device_list */
-	struct list_head node;
+	struct list_head		node;
 
-	struct ccw_device *cdev;
+	struct ccw_device *		cdev;
 
 	/* Device discipline information. */
-	struct tape_discipline *discipline;
-	void *discdata;
+	struct tape_discipline *	discipline;
+	void *				discdata;
 
 	/* Generic status flags */
-	long                    tape_generic_status;
+	long				tape_generic_status;
 
 	/* Device state information. */
-	wait_queue_head_t       state_change_wq;
-	enum tape_state         tape_state;
-	enum tape_medium_state  medium_state;
-	unsigned char          *modeset_byte;
+	wait_queue_head_t		state_change_wq;
+	enum tape_state			tape_state;
+	enum tape_medium_state		medium_state;
+	unsigned char *			modeset_byte;
 
 	/* Reference count. */
-	atomic_t ref_count;
+	atomic_t			ref_count;
 
 	/* Request queue. */
-	struct list_head req_queue;
+	struct list_head		req_queue;
+
+	/* Each tape device has (currently) two minor numbers. */
+	int				first_minor;
+
+	/* Number of tapemarks required for correct termination. */
+	int				required_tapemarks;
+
+	/* Block ID of the BOF */
+	unsigned int			bof;
 
-	int first_minor;	       /* each tape device has two minors */
 	/* Character device frontend data */
-	struct tape_char_data char_data;
+	struct tape_char_data		char_data;
 #ifdef CONFIG_S390_TAPE_BLOCK
 	/* Block dev frontend data */
-	struct tape_blk_data blk_data;
+	struct tape_blk_data		blk_data;
 #endif
 };
 
@@ -219,6 +248,7 @@
 extern int tape_do_io(struct tape_device *, struct tape_request *);
 extern int tape_do_io_async(struct tape_device *, struct tape_request *);
 extern int tape_do_io_interruptible(struct tape_device *, struct tape_request *);
+void tape_hotplug_event(struct tape_device *, int major, int action);
 
 static inline int
 tape_do_io_free(struct tape_device *device, struct tape_request *request)
@@ -234,19 +264,19 @@
 extern void tape_noper_handler(int irq, int status);
 extern int tape_open(struct tape_device *);
 extern int tape_release(struct tape_device *);
-extern int tape_assign(struct tape_device *);
-extern int tape_unassign(struct tape_device *);
 extern int tape_mtop(struct tape_device *, int, int);
+extern void tape_state_set(struct tape_device *, enum tape_state);
 
 extern int tape_enable_device(struct tape_device *, struct tape_discipline *);
 extern void tape_disable_device(struct tape_device *device);
 
 /* Externals from tape_devmap.c */
 extern int tape_generic_probe(struct ccw_device *);
-extern int tape_generic_remove(struct ccw_device *);
+extern void tape_generic_remove(struct ccw_device *);
 
 extern struct tape_device *tape_get_device(int devindex);
-extern void tape_put_device(struct tape_device *);
+extern struct tape_device *tape_get_device_reference(struct tape_device *);
+extern struct tape_device *tape_put_device(struct tape_device *);
 
 /* Externals from tape_char.c */
 extern int tapechar_init(void);
diff -Nru a/drivers/s390/char/tape_34xx.c b/drivers/s390/char/tape_34xx.c
--- a/drivers/s390/char/tape_34xx.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/char/tape_34xx.c	Tue Feb  3 19:45:17 2004
@@ -14,31 +14,60 @@
 #include <linux/init.h>
 #include <linux/bio.h>
 #include <linux/workqueue.h>
-#include <asm/tape390.h>
 
 #include "tape.h"
 #include "tape_std.h"
 
-#define PRINTK_HEADER "T34xx:"
+#define PRINTK_HEADER "TAPE_34XX: "
 
-enum tape34xx_type {
+enum tape_34xx_type {
 	tape_3480,
 	tape_3490,
 };
 
+#define TAPE34XX_FMT_3480	0
+#define TAPE34XX_FMT_3480_2_XF	1
+#define TAPE34XX_FMT_3480_XF	2
+
+struct tape_34xx_block_id {
+	unsigned int	wrap		: 1;
+	unsigned int	segment		: 7;
+	unsigned int	format		: 2;
+	unsigned int	block		: 22;
+};
+
 /*
- * Medium sense (asynchronous with callback) for 34xx tapes. There is no 'real'
- * medium sense call. So we just do a normal sense.
+ * A list of block ID's is used to faster seek blocks.
  */
-static void
-__tape_34xx_medium_sense_callback(struct tape_request *request, void *data)
+struct tape_34xx_sbid {
+	struct list_head		list;
+	struct tape_34xx_block_id	bid;
+};
+
+static void tape_34xx_delete_sbid_from(struct tape_device *, int);
+
+/*
+ * Medium sense for 34xx tapes. There is no 'real' medium sense call.
+ * So we just do a normal sense.
+ */
+static int
+tape_34xx_medium_sense(struct tape_device *device)
 {
-	unsigned char      *sense;
-	struct tape_device *device;
+	struct tape_request *request;
+	unsigned char       *sense;
+	int                  rc;
 
-	request->callback = NULL;
+	request = tape_alloc_request(1, 32);
+	if (IS_ERR(request)) {
+		DBF_EXCEPTION(6, "MSEN fail\n");
+		return PTR_ERR(request);
+	}
 
-	if(request->rc == 0 && (device = request->device) != NULL) {
+	request->op = TO_MSEN;
+	tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata);
+
+	rc = tape_do_io_interruptible(device, request);
+	if (request->rc == 0) {
 		sense = request->cpdata;
 
 		/*
@@ -47,36 +76,20 @@
 		 * only slightly inaccurate to say there is no tape loaded if
 		 * the drive isn't online...
 		 */
-		if(sense[0] & SENSE_INTERVENTION_REQUIRED)
+		if (sense[0] & SENSE_INTERVENTION_REQUIRED)
 			tape_med_state_set(device, MS_UNLOADED);
 		else
 			tape_med_state_set(device, MS_LOADED);
 
-		if(sense[1] & SENSE_WRITE_PROTECT)
+		if (sense[1] & SENSE_WRITE_PROTECT)
 			device->tape_generic_status |= GMT_WR_PROT(~0);
 		else
 			device->tape_generic_status &= ~GMT_WR_PROT(~0);
+	} else {
+		DBF_EVENT(4, "tape_34xx: medium sense failed with rc=%d\n",
+			request->rc);
 	}
 	tape_free_request(request);
-}
-
-static int
-tape_34xx_medium_sense(struct tape_device *device)
-{
-	struct tape_request *request;
-	int                  rc;
-
-	request = tape_alloc_request(1, 32);
-	if(IS_ERR(request)) {
-		DBF_EXCEPTION(6, "MSEN fail\n");
-		return PTR_ERR(request);
-	}
-
-	request->op = TO_MSEN;
-	tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata);
-	request->callback = __tape_34xx_medium_sense_callback;
-
-	rc = tape_do_io_async(device, request);
 
 	return rc;
 }
@@ -104,7 +117,7 @@
 			DBF_EVENT(3, "T34XX: internal error: unknown work\n");
 	}
 
-	tape_put_device(p->device);
+	p->device = tape_put_device(p->device);
 	kfree(p);
 }
 
@@ -117,14 +130,13 @@
 		struct work_struct	 work;
 	} *p;
 
-	if((p = kmalloc(sizeof(*p), GFP_ATOMIC)) == NULL)
+	if ((p = kmalloc(sizeof(*p), GFP_ATOMIC)) == NULL)
 		return -ENOMEM;
 
 	memset(p, 0, sizeof(*p));
 	INIT_WORK(&p->work, tape_34xx_work_handler, p);
 
-	atomic_inc(&device->ref_count);
-	p->device = device;
+	p->device = tape_get_device_reference(device);
 	p->op     = op;
 
 	schedule_work(&p->work);
@@ -134,37 +146,46 @@
 /*
  * Done Handler is called when dev stat = DEVICE-END (successful operation)
  */
-static int
-tape_34xx_done(struct tape_device *device, struct tape_request *request)
+static inline int
+tape_34xx_done(struct tape_request *request)
 {
 	DBF_EVENT(6, "%s done\n", tape_op_verbose[request->op]);
 
+	switch (request->op) {
+		case TO_DSE:
+		case TO_RUN:
+		case TO_WRI:
+		case TO_WTM:
+		case TO_ASSIGN:
+		case TO_UNASSIGN:
+			tape_34xx_delete_sbid_from(request->device, 0);
+			break;
+		default:
+			;
+	}
 	return TAPE_IO_SUCCESS;
 }
 
 static inline int
-tape_34xx_erp_failed(struct tape_device *device,
-		     struct tape_request *request, int rc)
+tape_34xx_erp_failed(struct tape_request *request, int rc)
 {
-	DBF_EVENT(3, "Error recovery failed for %s\n",
-		  tape_op_verbose[request->op]);
+	DBF_EVENT(3, "Error recovery failed for %s (RC=%d)\n",
+		  tape_op_verbose[request->op], rc);
 	return rc;
 }
 
 static inline int
-tape_34xx_erp_succeeded(struct tape_device *device,
-		       struct tape_request *request)
+tape_34xx_erp_succeeded(struct tape_request *request)
 {
 	DBF_EVENT(3, "Error Recovery successful for %s\n",
 		  tape_op_verbose[request->op]);
-	return tape_34xx_done(device, request);
+	return tape_34xx_done(request);
 }
 
 static inline int
-tape_34xx_erp_retry(struct tape_device *device, struct tape_request *request)
+tape_34xx_erp_retry(struct tape_request *request)
 {
-	DBF_EVENT(3, "xerp retr %s\n",
-		  tape_op_verbose[request->op]);
+	DBF_EVENT(3, "xerp retr %s\n", tape_op_verbose[request->op]);
 	return TAPE_IO_RETRY;
 }
 
@@ -178,6 +199,7 @@
 	if (irb->scsw.dstat == 0x85 /* READY */) {
 		/* A medium was inserted in the drive. */
 		DBF_EVENT(6, "xuud med\n");
+		tape_34xx_delete_sbid_from(device, 0);
 		tape_34xx_schedule_work(device, TO_MSEN);
 	} else {
 		DBF_EVENT(3, "unsol.irq! dev end: %s\n",
@@ -203,7 +225,7 @@
 		 * and try again.
 		 */
 		tape_std_read_backward(device, request);
-		return tape_34xx_erp_retry(device, request);
+		return tape_34xx_erp_retry(request);
 	}
 	if (request->op != TO_RBA)
 		PRINT_ERR("read_opposite called with state:%s\n",
@@ -212,7 +234,7 @@
 	 * We tried to read forward and backward, but hat no
 	 * success -> failed.
 	 */
-	return tape_34xx_erp_failed(device, request, -EIO);
+	return tape_34xx_erp_failed(request, -EIO);
 }
 
 static int
@@ -228,7 +250,7 @@
 				   tape_op_verbose[request->op]);
 		tape_dump_sense(device, request, irb);
 	}
-	return tape_34xx_erp_failed(device, request, -EIO);
+	return tape_34xx_erp_failed(request, -EIO);
 }
 
 /*
@@ -243,7 +265,7 @@
 		PRINT_WARN ("Data overrun error between control-unit "
 			    "and drive. Use a faster channel connection, "
 			    "if possible! \n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		return tape_34xx_erp_failed(request, -EIO);
 	}
 	return tape_34xx_erp_bug(device, request, irb, -1);
 }
@@ -260,7 +282,7 @@
 		 * cu detected incorrect block-id sequence on tape.
 		 */
 		PRINT_WARN("Illegal block-id sequence found!\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		return tape_34xx_erp_failed(request, -EIO);
 	}
 	/*
 	 * Record sequence error bit is set, but erpa does not
@@ -281,6 +303,9 @@
 	int inhibit_cu_recovery;
 	__u8* sense;
 
+	inhibit_cu_recovery = (*device->modeset_byte & 0x80) ? 1 : 0;
+	sense = irb->ecw;
+
 #ifdef CONFIG_S390_TAPE_BLOCK
 	if (request->op == TO_BLOCK) {
 		/*
@@ -289,51 +314,95 @@
 		 */
 		device->blk_data.block_position = -1;
 		if (request->retries-- <= 0)
-			return tape_34xx_erp_failed(device, request, -EIO);
+			return tape_34xx_erp_failed(request, -EIO);
 		else
-			return tape_34xx_erp_retry(device, request);
+			return tape_34xx_erp_retry(request);
 	}
 #endif
 
-	inhibit_cu_recovery = (*device->modeset_byte & 0x80) ? 1 : 0;
-	sense = irb->ecw;
-
-	if (sense[0] & SENSE_COMMAND_REJECT) {
-		if ((sense[1] & SENSE_WRITE_PROTECT) &&
-		    (request->op == TO_DSE ||
-		     request->op == TO_WRI ||
-		     request->op == TO_WTM))
+	if (
+		sense[0] & SENSE_COMMAND_REJECT &&
+		sense[1] & SENSE_WRITE_PROTECT
+	) {
+		if (
+			request->op == TO_DSE ||
+			request->op == TO_WRI ||
+			request->op == TO_WTM
+		) {
 			/* medium is write protected */
-			return tape_34xx_erp_failed(device, request, -EACCES);
-		else
+			return tape_34xx_erp_failed(request, -EACCES);
+		} else {
 			return tape_34xx_erp_bug(device, request, irb, -3);
+		}
 	}
 
 	/*
-	 * special cases for various tape-states when reaching
+	 * Special cases for various tape-states when reaching
 	 * end of recorded area
+	 *
+	 * FIXME: Maybe a special case of the special case:
+	 *        sense[0] == SENSE_EQUIPMENT_CHECK &&
+	 *        sense[1] == SENSE_DRIVE_ONLINE    &&
+	 *        sense[3] == 0x47 (Volume Fenced)
+	 *
+	 *        This was caused by continued FSF or FSR after an
+	 *        'End Of Data'.
 	 */
-	if ((sense[0] == 0x08 || sense[0] == 0x10 || sense[0] == 0x12) &&
-	    (sense[1] == 0x40 || sense[1] == 0x0c))
+	if ((
+		sense[0] == SENSE_DATA_CHECK      ||
+		sense[0] == SENSE_EQUIPMENT_CHECK ||
+		sense[0] == SENSE_EQUIPMENT_CHECK + SENSE_DEFERRED_UNIT_CHECK
+	) && (
+		sense[1] == SENSE_DRIVE_ONLINE ||
+		sense[1] == SENSE_BEGINNING_OF_TAPE + SENSE_WRITE_MODE
+	)) {
 		switch (request->op) {
+		/*
+		 * sense[0] == SENSE_DATA_CHECK   &&
+		 * sense[1] == SENSE_DRIVE_ONLINE
+		 * sense[3] == 0x36 (End Of Data)
+		 *
+		 * Further seeks might return a 'Volume Fenced'.
+		 */
 		case TO_FSF:
+		case TO_FSB:
 			/* Trying to seek beyond end of recorded area */
-			return tape_34xx_erp_failed(device, request, -ENOSPC);
+			return tape_34xx_erp_failed(request, -ENOSPC);
+		case TO_BSB:
+			return tape_34xx_erp_retry(request);
+
+		/*
+		 * sense[0] == SENSE_DATA_CHECK   &&
+		 * sense[1] == SENSE_DRIVE_ONLINE &&
+		 * sense[3] == 0x36 (End Of Data)
+		 */
 		case TO_LBL:
 			/* Block could not be located. */
-			return tape_34xx_erp_failed(device, request, -EIO);
+			tape_34xx_delete_sbid_from(device, 0);
+			return tape_34xx_erp_failed(request, -EIO);
+
 		case TO_RFO:
 			/* Read beyond end of recorded area -> 0 bytes read */
-			return tape_34xx_erp_failed(device, request, 0);
+			return tape_34xx_erp_failed(request, 0);
+
+		/*
+		 * sense[0] == SENSE_EQUIPMENT_CHECK &&
+		 * sense[1] == SENSE_DRIVE_ONLINE    &&
+		 * sense[3] == 0x38 (Physical End Of Volume)
+		 */
+		case TO_WRI:
+			/* Writing at physical end of volume */
+			return tape_34xx_erp_failed(request, -ENOSPC);
 		default:
 			PRINT_ERR("Invalid op in %s:%i\n",
 				  __FUNCTION__, __LINE__);
-			return tape_34xx_erp_failed(device, request, 0);
+			return tape_34xx_erp_failed(request, 0);
 		}
+	}
 
 	/* Sensing special bits */
 	if (sense[0] & SENSE_BUS_OUT_CHECK)
-		return tape_34xx_erp_retry(device, request);
+		return tape_34xx_erp_retry(request);
 
 	if (sense[0] & SENSE_DATA_CHECK) {
 		/*
@@ -353,7 +422,7 @@
 
 			/* data check is permanent, CU recovery has failed */
 			PRINT_WARN("Permanent read error\n");
-			return tape_34xx_erp_failed(device, request, -EIO);
+			return tape_34xx_erp_failed(request, -EIO);
 		case 0x25:
 			// a write data check occurred
 			if ((sense[2] & SENSE_TAPE_SYNC_MODE) ||
@@ -366,22 +435,22 @@
 
 			// data check is permanent, cu-recovery has failed
 			PRINT_WARN("Permanent write error\n");
-			return tape_34xx_erp_failed(device, request, -EIO);
+			return tape_34xx_erp_failed(request, -EIO);
 		case 0x26:
 			/* Data Check (read opposite) occurred. */
 			return tape_34xx_erp_read_opposite(device, request);
 		case 0x28:
 			/* ID-Mark at tape start couldn't be written */
 			PRINT_WARN("ID-Mark could not be written.\n");
-			return tape_34xx_erp_failed(device, request, -EIO);
+			return tape_34xx_erp_failed(request, -EIO);
 		case 0x31:
 			/* Tape void. Tried to read beyond end of device. */
 			PRINT_WARN("Read beyond end of recorded area.\n");
-			return tape_34xx_erp_failed(device, request, -ENOSPC);
+			return tape_34xx_erp_failed(request, -ENOSPC);
 		case 0x41:
 			/* Record sequence error. */
 			PRINT_WARN("Invalid block-id sequence found.\n");
-			return tape_34xx_erp_failed(device, request, -EIO);
+			return tape_34xx_erp_failed(request, -EIO);
 		default:
 			/* all data checks for 3480 should result in one of
 			 * the above erpa-codes. For 3490, other data-check
@@ -412,7 +481,7 @@
 		 */
 		PRINT_WARN("Data streaming not operational. "
 			   "Switching to interlock-mode.\n");
-		return tape_34xx_erp_retry(device, request);
+		return tape_34xx_erp_retry(request);
 	case 0x22:
 		/*
 		 * Path equipment check. Might be drive adapter error, buffer
@@ -424,14 +493,14 @@
 		PRINT_WARN("drive adapter error, buffer error on the lower "
 			   "interface, internal path not usable, error "
 			   "during cartridge load.\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x24:
 		/*
 		 * Load display check. Load display was command was issued,
 		 * but the drive is displaying a drive check message. Can
 		 * be threated as "device end".
 		 */
-		return tape_34xx_erp_succeeded(device, request);
+		return tape_34xx_erp_succeeded(request);
 	case 0x27:
 		/*
 		 * Command reject. May indicate illegal channel program or
@@ -439,7 +508,7 @@
 		 * issued by this driver and ought be correct, we assume a
 		 * over/underrun situation and retry the channel program.
 		 */
-		return tape_34xx_erp_retry(device, request);
+		return tape_34xx_erp_retry(request);
 	case 0x29:
 		/*
 		 * Function incompatible. Either the tape is idrc compressed
@@ -447,13 +516,13 @@
 		 * subsystem func is issued and the CU is not on-line.
 		 */
 		PRINT_WARN ("Function incompatible. Try to switch off idrc\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x2a:
 		/*
 		 * Unsolicited environmental data. An internal counter
 		 * overflows, we can ignore this and reissue the cmd.
 		 */
-		return tape_34xx_erp_retry(device, request);
+		return tape_34xx_erp_retry(request);
 	case 0x2b:
 		/*
 		 * Environmental data present. Indicates either unload
@@ -462,7 +531,7 @@
 		if (request->op == TO_RUN) {
 			/* Rewind unload completed ok. */
 			tape_med_state_set(device, MS_UNLOADED);
-			return tape_34xx_erp_succeeded(device, request);
+			return tape_34xx_erp_succeeded(request);
 		}
 		/* tape_34xx doesn't use read buffered log commands. */
 		return tape_34xx_erp_bug(device, request, irb, sense[3]);
@@ -471,11 +540,11 @@
 		 * Permanent equipment check. CU has tried recovery, but
 		 * did not succeed.
 		 */
-		return tape_34xx_erp_failed(device, request, -EIO);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x2d:
 		/* Data security erase failure. */
 		if (request->op == TO_DSE)
-			return tape_34xx_erp_failed(device, request, -EIO);
+			return tape_34xx_erp_failed(request, -EIO);
 		/* Data security erase failure, but no such command issued. */
 		return tape_34xx_erp_bug(device, request, irb, sense[3]);
 	case 0x2e:
@@ -484,16 +553,16 @@
 		 * reading the format id mark or that that format specified
 		 * is not supported by the drive.
 		 */
-		PRINT_WARN("Drive not capable processing the tape format!");
-		return tape_34xx_erp_failed(device, request, -EMEDIUMTYPE);
+		PRINT_WARN("Drive not capable processing the tape format!\n");
+		return tape_34xx_erp_failed(request, -EMEDIUMTYPE);
 	case 0x30:
 		/* The medium is write protected. */
 		PRINT_WARN("Medium is write protected!\n");
-		return tape_34xx_erp_failed(device, request, -EACCES);
+		return tape_34xx_erp_failed(request, -EACCES);
 	case 0x32:
 		// Tension loss. We cannot recover this, it's an I/O error.
 		PRINT_WARN("The drive lost tape tension.\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x33:
 		/*
 		 * Load Failure. The cartridge was not inserted correctly or
@@ -501,7 +570,8 @@
 		 */
 		PRINT_WARN("Cartridge load failure. Reload the cartridge "
 			   "and try again.\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		tape_34xx_delete_sbid_from(device, 0);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x34:
 		/*
 		 * Unload failure. The drive cannot maintain tape tension
@@ -510,7 +580,7 @@
 		PRINT_WARN("Failure during cartridge unload. "
 			   "Please try manually.\n");
 		if (request->op == TO_RUN)
-			return tape_34xx_erp_failed(device, request, -EIO);
+			return tape_34xx_erp_failed(request, -EIO);
 		return tape_34xx_erp_bug(device, request, irb, sense[3]);
 	case 0x35:
 		/*
@@ -522,11 +592,11 @@
 		 */
 		PRINT_WARN("Equipment check! Please check the drive and "
 			   "the cartridge loader.\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x36:
 		if (device->cdev->id.driver_info == tape_3490)
 			/* End of data. */
-			return tape_34xx_erp_failed(device, request, -EIO);
+			return tape_34xx_erp_failed(request, -EIO);
 		/* This erpa is reserved for 3480 */
 		return tape_34xx_erp_bug(device, request, irb, sense[3]);
 	case 0x37:
@@ -535,7 +605,7 @@
 		 * the beginning-of-tape data.
 		 */
 		PRINT_WARN("Tape length error.\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x38:
 		/*
 		 * Physical end of tape. A read/write operation reached
@@ -544,55 +614,58 @@
 		if (request->op==TO_WRI ||
 		    request->op==TO_DSE ||
 		    request->op==TO_WTM)
-			return tape_34xx_erp_failed(device, request, -ENOSPC);
-		return tape_34xx_erp_failed(device, request, -EIO);
+			return tape_34xx_erp_failed(request, -ENOSPC);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x39:
 		/* Backward at Beginning of tape. */
-		return tape_34xx_erp_failed(device, request, -EIO);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x3a:
 		/* Drive switched to not ready. */
 		PRINT_WARN("Drive not ready. Turn the ready/not ready switch "
 			   "to ready position and try again.\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x3b:
 		/* Manual rewind or unload. This causes an I/O error. */
 		PRINT_WARN("Medium was rewound or unloaded manually.\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		tape_34xx_delete_sbid_from(device, 0);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x42:
 		/*
 		 * Degraded mode. A condition that can cause degraded
 		 * performance is detected.
 		 */
 		PRINT_WARN("Subsystem is running in degraded mode.\n");
-		return tape_34xx_erp_retry(device, request);
+		return tape_34xx_erp_retry(request);
 	case 0x43:
 		/* Drive not ready. */
+		tape_34xx_delete_sbid_from(device, 0);
 		tape_med_state_set(device, MS_UNLOADED);
 		/* Some commands commands are successful even in this case */
-		if(sense[1] & SENSE_DRIVE_ONLINE) {
+		if (sense[1] & SENSE_DRIVE_ONLINE) {
 			switch(request->op) {
 				case TO_ASSIGN:
 				case TO_UNASSIGN:
 				case TO_DIS:
-					return tape_34xx_done(device, request);
+				case TO_NOP:
+					return tape_34xx_done(request);
 					break;
 				default:
 					break;
 			}
 		}
 		PRINT_WARN("The drive is not ready.\n");
-		return tape_34xx_erp_failed(device, request, -ENOMEDIUM);
+		return tape_34xx_erp_failed(request, -ENOMEDIUM);
 	case 0x44:
 		/* Locate Block unsuccessful. */
 		if (request->op != TO_BLOCK && request->op != TO_LBL)
 			/* No locate block was issued. */
 			return tape_34xx_erp_bug(device, request,
 						 irb, sense[3]);
-		return tape_34xx_erp_failed(device, request, -EIO);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x45:
 		/* The drive is assigned to a different channel path. */
 		PRINT_WARN("The drive is assigned elsewhere.\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x46:
 		/*
 		 * Drive not on-line. Drive may be switched offline,
@@ -600,23 +673,24 @@
 		 * the drive address may not be set correctly.
 		 */
 		PRINT_WARN("The drive is not on-line.");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x47:
 		/* Volume fenced. CU reports volume integrity is lost. */
 		PRINT_WARN("Volume fenced. The volume integrity is lost.\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		tape_34xx_delete_sbid_from(device, 0);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x48:
 		/* Log sense data and retry request. */
-		return tape_34xx_erp_retry(device, request);
+		return tape_34xx_erp_retry(request);
 	case 0x49:
 		/* Bus out check. A parity check error on the bus was found. */
 		PRINT_WARN("Bus out check. A data transfer over the bus "
 			   "has been corrupted.\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x4a:
 		/* Control unit erp failed. */
 		PRINT_WARN("The control unit I/O error recovery failed.\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x4b:
 		/*
 		 * CU and drive incompatible. The drive requests micro-program
@@ -624,13 +698,13 @@
 		 */
 		PRINT_WARN("The drive needs microprogram patches from the "
 			   "control unit, which are not available.\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x4c:
 		/*
 		 * Recovered Check-One failure. Cu develops a hardware error,
 		 * but is able to recover.
 		 */
-		return tape_34xx_erp_retry(device, request);
+		return tape_34xx_erp_retry(request);
 	case 0x4d:
 		if (device->cdev->id.driver_info == tape_3490)
 			/*
@@ -638,7 +712,7 @@
 			 * not support resetting event recovery (which has to
 			 * be handled by the I/O Layer), retry our command.
 			 */
-			return tape_34xx_erp_retry(device, request);
+			return tape_34xx_erp_retry(request);
 		/* This erpa is reserved for 3480. */
 		return tape_34xx_erp_bug(device, request, irb, sense[3]);
 	case 0x4e:
@@ -650,7 +724,7 @@
 			 */
 			PRINT_WARN("Maximum block size for buffered "
 				   "mode exceeded.\n");
-			return tape_34xx_erp_failed(device, request, -ENOBUFS);
+			return tape_34xx_erp_failed(request, -ENOBUFS);
 		}
 		/* This erpa is reserved for 3480. */
 		return tape_34xx_erp_bug(device, request, irb, sense[3]);
@@ -661,7 +735,7 @@
 		 * never happen, since we're never running in extended
 		 * buffered log mode.
 		 */
-		return tape_34xx_erp_retry(device, request);
+		return tape_34xx_erp_retry(request);
 	case 0x51:
 		/*
 		 * Read buffered log (EOV). EOF processing occurs while the
@@ -669,73 +743,83 @@
 		 * happen, since we're never running in extended buffered
 		 * log mode.
 		 */
-		return tape_34xx_erp_retry(device, request);
+		return tape_34xx_erp_retry(request);
 	case 0x52:
 		/* End of Volume complete. Rewind unload completed ok. */
 		if (request->op == TO_RUN) {
 			tape_med_state_set(device, MS_UNLOADED);
-			return tape_34xx_erp_succeeded(device, request);
+			tape_34xx_delete_sbid_from(device, 0);
+			return tape_34xx_erp_succeeded(request);
 		}
 		return tape_34xx_erp_bug(device, request, irb, sense[3]);
 	case 0x53:
 		/* Global command intercept. */
-		return tape_34xx_erp_retry(device, request);
+		return tape_34xx_erp_retry(request);
 	case 0x54:
 		/* Channel interface recovery (temporary). */
-		return tape_34xx_erp_retry(device, request);
+		return tape_34xx_erp_retry(request);
 	case 0x55:
 		/* Channel interface recovery (permanent). */
 		PRINT_WARN("A permanent channel interface error occurred.\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x56:
 		/* Channel protocol error. */
 		PRINT_WARN("A channel protocol error occurred.\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x57:
 		if (device->cdev->id.driver_info == tape_3480) {
 			/* Attention intercept. */
 			PRINT_WARN("An attention intercept occurred, "
 				   "which will be recovered.\n");
-			return tape_34xx_erp_retry(device, request);
+			return tape_34xx_erp_retry(request);
 		} else {
 			/* Global status intercept. */
 			PRINT_WARN("An global status intercept was received, "
 				   "which will be recovered.\n");
-			return tape_34xx_erp_retry(device, request);
+			return tape_34xx_erp_retry(request);
 		}
 	case 0x5a:
 		/*
 		 * Tape length incompatible. The tape inserted is too long,
 		 * which could cause damage to the tape or the drive.
 		 */
-		PRINT_WARN("Tape length incompatible [should be IBM Cartridge "
-			   "System Tape]. May cause damage to drive or tape.\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		PRINT_WARN("Tape Length Incompatible\n");
+		PRINT_WARN("Tape length exceeds IBM enhanced capacity "
+			"cartdridge length or a medium\n");
+		PRINT_WARN("with EC-CST identification mark has been mounted "
+			"in a device that writes\n");
+		PRINT_WARN("3480 or 3480 XF format.\n");
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x5b:
 		/* Format 3480 XF incompatible */
 		if (sense[1] & SENSE_BEGINNING_OF_TAPE)
 			/* The tape will get overwritten. */
-			return tape_34xx_erp_retry(device, request);
-		PRINT_WARN("Tape format is incompatible to the drive, "
-			   "which writes 3480-2 XF.\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+			return tape_34xx_erp_retry(request);
+		PRINT_WARN("Format 3480 XF Incompatible\n");
+		PRINT_WARN("Medium has been created in 3480 format. "
+			"To change the format writes\n");
+		PRINT_WARN("must be issued at BOT.\n");
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x5c:
 		/* Format 3480-2 XF incompatible */
-		PRINT_WARN("Tape format is incompatible to the drive. "
-			   "The drive cannot access 3480-2 XF volumes.\n");
-		return tape_34xx_erp_failed(device, request, -EIO);
+		PRINT_WARN("Format 3480-2 XF Incompatible\n");
+		PRINT_WARN("Device can only read 3480 or 3480 XF format.\n");
+		return tape_34xx_erp_failed(request, -EIO);
 	case 0x5d:
 		/* Tape length violation. */
-		PRINT_WARN("Tape length violation [should be IBM Enhanced "
-			   "Capacity Cartridge System Tape]. May cause "
-			   "damage to drive or tape.\n");
-		return tape_34xx_erp_failed(device, request, -EMEDIUMTYPE);
+		PRINT_WARN("Tape Length Violation\n");
+		PRINT_WARN("The mounted tape exceeds IBM Enhanced Capacity "
+			"Cartdridge System Tape length.\n");
+		PRINT_WARN("This may cause damage to the drive or tape when "
+			"processing to the EOV\n");
+		return tape_34xx_erp_failed(request, -EMEDIUMTYPE);
 	case 0x5e:
 		/* Compaction algorithm incompatible. */
+		PRINT_WARN("Compaction Algorithm Incompatible\n");
 		PRINT_WARN("The volume is recorded using an incompatible "
-			   "compaction algorithm, which is not supported by "
-			   "the control unit.\n");
-		return tape_34xx_erp_failed(device, request, -EMEDIUMTYPE);
+			"compaction algorithm,\n");
+		PRINT_WARN("which is not supported by the device.\n");
+		return tape_34xx_erp_failed(request, -EMEDIUMTYPE);
 
 		/* The following erpas should have been covered earlier. */
 	case 0x23: /* Read data check. */
@@ -766,14 +850,24 @@
 	    (request->op == TO_WRI)) {
 		/* Write at end of volume */
 		PRINT_INFO("End of volume\n"); /* XXX */
-		return tape_34xx_erp_failed(device, request, -ENOSPC);
+		return tape_34xx_erp_failed(request, -ENOSPC);
 	}
 
 	if (irb->scsw.dstat & DEV_STAT_UNIT_CHECK)
 		return tape_34xx_unit_check(device, request, irb);
 
-	if (irb->scsw.dstat & DEV_STAT_DEV_END)
-		return tape_34xx_done(device, request);
+	if (irb->scsw.dstat & DEV_STAT_DEV_END) {
+		/*
+		 * A unit exception occurs on skipping over a tapemark block.
+		 */
+		if (irb->scsw.dstat & DEV_STAT_UNIT_EXCEP) {
+			if (request->op == TO_BSB || request->op == TO_FSB)
+				request->rescnt++;
+			else
+				DBF_EVENT(5, "Unit Exception!\n");
+		}
+		return tape_34xx_done(request);
+	}
 
 	DBF_EVENT(6, "xunknownirq\n");
 	PRINT_ERR("Unexpected interrupt.\n");
@@ -786,45 +880,217 @@
  * ioctl_overload
  */
 static int
-tape_34xx_ioctl(struct tape_device *device,
-		unsigned int cmd, unsigned long arg)
+tape_34xx_ioctl(struct tape_device *device, unsigned int cmd, unsigned long arg)
 {
-	if (cmd == TAPE390_DISPLAY)
-		return tape_std_display(device, cmd, arg);
-	else
+	if (cmd == TAPE390_DISPLAY) {
+		struct display_struct disp;
+
+		if (copy_from_user(&disp, (char *) arg, sizeof(disp)) != 0)
+			return -EFAULT;
+
+		return tape_std_display(device, &disp);
+	} else
 		return -EINVAL;
 }
 
+static inline void
+tape_34xx_append_new_sbid(struct tape_34xx_block_id bid, struct list_head *l)
+{
+	struct tape_34xx_sbid *	new_sbid;
+
+	new_sbid = kmalloc(sizeof(*new_sbid), GFP_ATOMIC);
+	if (!new_sbid)
+		return;
+
+	new_sbid->bid = bid;
+	list_add(&new_sbid->list, l);
+}
+
+/*
+ * Build up the search block ID list. The block ID consists of a logical
+ * block number and a hardware specific part. The hardware specific part
+ * helps the tape drive to speed up searching for a specific block.
+ */
+static void
+tape_34xx_add_sbid(struct tape_device *device, struct tape_34xx_block_id bid)
+{
+	struct list_head *	sbid_list;
+	struct tape_34xx_sbid *	sbid;
+	struct list_head *	l;
+
+	/*
+	 * immediately return if there is no list at all or the block to add
+	 * is located in segment 1 of wrap 0 because this position is used
+	 * if no hardware position data is supplied.
+	 */
+	sbid_list = (struct list_head *) device->discdata;
+	if (!sbid_list || (bid.segment < 2 && bid.wrap == 0))
+		return;
+
+	/*
+	 * Search the position where to insert the new entry. Hardware
+	 * acceleration uses only the segment and wrap number. So we
+	 * need only one entry for a specific wrap/segment combination.
+	 * If there is a block with a lower number but the same hard-
+	 * ware position data we just update the block number in the
+	 * existing entry.
+	 */
+	list_for_each(l, sbid_list) {
+		sbid = list_entry(l, struct tape_34xx_sbid, list);
+
+		if (
+			(sbid->bid.segment == bid.segment) &&
+			(sbid->bid.wrap    == bid.wrap)
+		) {
+			if (bid.block < sbid->bid.block)
+				sbid->bid = bid;
+			else return;
+			break;
+		}
+
+		/* Sort in according to logical block number. */
+		if (bid.block < sbid->bid.block) {
+			tape_34xx_append_new_sbid(bid, l->prev);
+			break;
+		}
+	}
+	/* List empty or new block bigger than last entry. */
+	if (l == sbid_list)
+		tape_34xx_append_new_sbid(bid, l->prev);
+
+	DBF_LH(4, "Current list is:\n");
+	list_for_each(l, sbid_list) {
+		sbid = list_entry(l, struct tape_34xx_sbid, list);
+		DBF_LH(4, "%d:%03d@%05d\n",
+			sbid->bid.wrap,
+			sbid->bid.segment,
+			sbid->bid.block
+		);
+	}
+}
+
+/*
+ * Delete all entries from the search block ID list that belong to tape blocks
+ * equal or higher than the given number.
+ */
+static void
+tape_34xx_delete_sbid_from(struct tape_device *device, int from)
+{
+	struct list_head *	sbid_list;
+	struct tape_34xx_sbid *	sbid;
+	struct list_head *	l;
+	struct list_head *	n;
+
+	sbid_list = (struct list_head *) device->discdata;
+	if (!sbid_list)
+		return;
+
+	list_for_each_safe(l, n, sbid_list) {
+		sbid = list_entry(l, struct tape_34xx_sbid, list);
+		if (sbid->bid.block >= from) {
+			DBF_LH(4, "Delete sbid %d:%03d@%05d\n",
+				sbid->bid.wrap,
+				sbid->bid.segment,
+				sbid->bid.block
+			);
+			list_del(l);
+			kfree(sbid);
+		}
+	}
+}
+
+/*
+ * Merge hardware position data into a block id.
+ */
+static void
+tape_34xx_merge_sbid(
+	struct tape_device *		device,
+	struct tape_34xx_block_id *	bid
+) {
+	struct tape_34xx_sbid *	sbid;
+	struct tape_34xx_sbid *	sbid_to_use;
+	struct list_head *	sbid_list;
+	struct list_head *	l;
+
+	sbid_list = (struct list_head *) device->discdata;
+	bid->wrap    = 0;
+	bid->segment = 1;
+
+	if (!sbid_list || list_empty(sbid_list))
+		return;
+
+	sbid_to_use = NULL;
+	list_for_each(l, sbid_list) {
+		sbid = list_entry(l, struct tape_34xx_sbid, list);
+
+		if (sbid->bid.block >= bid->block)
+			break;
+		sbid_to_use = sbid;
+	}
+	if (sbid_to_use) {
+		bid->wrap    = sbid_to_use->bid.wrap;
+		bid->segment = sbid_to_use->bid.segment;
+		DBF_LH(4, "Use %d:%03d@%05d for %05d\n",
+			sbid_to_use->bid.wrap,
+			sbid_to_use->bid.segment,
+			sbid_to_use->bid.block,
+			bid->block
+		);
+	}
+}
+
 static int
 tape_34xx_setup_device(struct tape_device * device)
 {
-	DBF_EVENT(6, "34xx minor1: %x\n", device->first_minor);
-	tape_34xx_medium_sense(device);
-	return 0;
+	int			rc;
+	struct list_head *	discdata;
+
+	DBF_EVENT(6, "34xx device setup\n");
+	if ((rc = tape_std_assign(device)) == 0) {
+		if ((rc = tape_34xx_medium_sense(device)) != 0) {
+			DBF_LH(3, "34xx medium sense returned %d\n", rc);
+		}
+	}
+	discdata = kmalloc(sizeof(struct list_head), GFP_KERNEL);
+	if (discdata) {
+			INIT_LIST_HEAD(discdata);
+			device->discdata = discdata;
+	}
+
+	return rc;
 }
 
 static void
-tape_34xx_cleanup_device(struct tape_device * device)
+tape_34xx_cleanup_device(struct tape_device *device)
 {
+	tape_std_unassign(device);
+	
 	if (device->discdata) {
+		tape_34xx_delete_sbid_from(device, 0);
 		kfree(device->discdata);
 		device->discdata = NULL;
 	}
 }
 
+
 /*
  * MTTELL: Tell block. Return the number of block relative to current file.
  */
 static int
 tape_34xx_mttell(struct tape_device *device, int mt_count)
 {
-	__u64 block_id;
+	struct {
+		struct tape_34xx_block_id	cbid;
+		struct tape_34xx_block_id	dbid;
+	} __attribute__ ((packed)) block_id;
 	int rc;
 
-	rc = tape_std_read_block_id(device, &block_id);
+	rc = tape_std_read_block_id(device, (__u64 *) &block_id);
 	if (rc)
 		return rc;
-	return (block_id >> 32) & 0x3fffff;
+
+	tape_34xx_add_sbid(device, block_id.cbid);
+	return block_id.cbid.block;
 }
 
 /*
@@ -834,21 +1100,28 @@
 tape_34xx_mtseek(struct tape_device *device, int mt_count)
 {
 	struct tape_request *request;
+	struct tape_34xx_block_id *	bid;
 
-	if (mt_count > 0x400000) {
+	if (mt_count > 0x3fffff) {
 		DBF_EXCEPTION(6, "xsee parm\n");
 		return -EINVAL;
 	}
 	request = tape_alloc_request(3, 4);
 	if (IS_ERR(request))
 		return PTR_ERR(request);
-	request->op = TO_LBL;
+
 	/* setup ccws */
+	request->op = TO_LBL;
+	bid         = (struct tape_34xx_block_id *) request->cpdata;
+	bid->format = (*device->modeset_byte & 0x08) ?
+			TAPE34XX_FMT_3480_XF : TAPE34XX_FMT_3480;
+	bid->block  = mt_count;
+	tape_34xx_merge_sbid(device, bid);
+
 	tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte);
-	*(__u32 *) request->cpdata = mt_count |
-		((*device->modeset_byte & 0x08) ? 0x01800000 : 0x01000000);
 	tape_ccw_cc(request->cpaddr + 1, LOCATE, 4, request->cpdata);
 	tape_ccw_end(request->cpaddr + 2, NOP, 0, NULL);
+
 	/* execute it */
 	return tape_do_io_free(device, request);
 }
@@ -862,15 +1135,14 @@
 {
 	struct tape_request *request;
 	struct ccw1 *ccw;
-	int count = 0,start_block,i;
+	int count = 0, i;
 	unsigned off;
 	char *dst;
 	struct bio_vec *bv;
 	struct bio *bio;
+	struct tape_34xx_block_id *	start_block;
 
 	DBF_EVENT(6, "xBREDid:");
-	start_block = req->sector >> TAPEBLOCK_HSEC_S2B;
-	DBF_EVENT(6, "start_block = %i\n", start_block);
 
 	/* Count the number of blocks for the request. */
 	rq_for_each_bio(bio, req) {
@@ -878,14 +1150,18 @@
 			count += bv->bv_len >> (TAPEBLOCK_HSEC_S2B + 9);
 		}
 	}
+
 	/* Allocate the ccw request. */
-	request = tape_alloc_request(2+count+1, 4);
+	request = tape_alloc_request(3+count+1, 8);
 	if (IS_ERR(request))
 		return request;
+
 	/* Setup ccws. */
 	request->op = TO_BLOCK;
-	*(__u32 *) request->cpdata = (start_block & 0x3fffff) |
-		((*device->modeset_byte & 0x08) ? 0x81000000 : 0x01000000);
+	start_block = (struct tape_34xx_block_id *) request->cpdata;
+	start_block->block = req->sector >> TAPEBLOCK_HSEC_S2B;
+	DBF_EVENT(6, "start_block = %i\n", start_block->block);
+
 	ccw = request->cpaddr;
 	ccw = tape_ccw_cc(ccw, MODE_SET_DB, 1, device->modeset_byte);
 
@@ -893,8 +1169,12 @@
 	 * We always setup a nop after the mode set ccw. This slot is
 	 * used in tape_std_check_locate to insert a locate ccw if the
 	 * current tape position doesn't match the start block to be read.
+	 * The second nop will be filled with a read block id which is in
+	 * turn used by tape_34xx_free_bread to populate the segment bid
+	 * table.
 	 */
 	ccw = tape_ccw_cc(ccw, NOP, 0, NULL);
+	ccw = tape_ccw_cc(ccw, NOP, 0, NULL);
 
 	rq_for_each_bio(bio, req) {
 		bio_for_each_segment(bv, bio, i) {
@@ -921,8 +1201,21 @@
 {
 	struct ccw1* ccw;
 
+	ccw = request->cpaddr;
+	if ((ccw + 2)->cmd_code == READ_BLOCK_ID) {
+		struct {
+			struct tape_34xx_block_id	cbid;
+			struct tape_34xx_block_id	dbid;
+		} __attribute__ ((packed)) *rbi_data;
+
+		rbi_data = request->cpdata;
+
+		if (request->device)
+			tape_34xx_add_sbid(request->device, rbi_data->cbid);
+	}
+
 	/* Last ccw is a nop and doesn't need clear_normalized_cda */
-	for (ccw = request->cpaddr; ccw->flags & CCW_FLAG_CC; ccw++)
+	for (; ccw->flags & CCW_FLAG_CC; ccw++)
 		if (ccw->cmd_code == READ_FORWARD)
 			clear_normalized_cda(ccw);
 	tape_free_request(request);
@@ -935,14 +1228,24 @@
  * start block for the request.
  */
 static void
-tape_34xx_check_locate (struct tape_device *device,
-			struct tape_request *request)
+tape_34xx_check_locate(struct tape_device *device, struct tape_request *request)
 {
-	int start_block;
+	struct tape_34xx_block_id *	start_block;
 
-	start_block = *(__u32 *) request->cpdata & 0x3fffff;
-	if (start_block != device->blk_data.block_position)
-		tape_ccw_cc(request->cpaddr + 1, LOCATE, 4, request->cpdata);
+	start_block = (struct tape_34xx_block_id *) request->cpdata;
+	if (start_block->block == device->blk_data.block_position)
+		return;
+
+	DBF_LH(4, "Block seek(%06d+%06d)\n", start_block->block, device->bof);
+	start_block->wrap    = 0;
+	start_block->segment = 1;
+	start_block->format  = (*device->modeset_byte & 0x08) ?
+				TAPE34XX_FMT_3480_XF :
+				TAPE34XX_FMT_3480;
+	start_block->block   = start_block->block + device->bof;
+	tape_34xx_merge_sbid(device, start_block);
+	tape_ccw_cc(request->cpaddr + 1, LOCATE, 4, request->cpdata);
+	tape_ccw_cc(request->cpaddr + 2, READ_BLOCK_ID, 8, request->cpdata);
 }
 #endif
 
@@ -995,8 +1298,6 @@
 	.irq = tape_34xx_irq,
 	.read_block = tape_std_read_block,
 	.write_block = tape_std_write_block,
-	.assign = tape_std_assign,
-	.unassign = tape_std_unassign,
 #ifdef CONFIG_S390_TAPE_BLOCK
 	.bread = tape_34xx_bread,
 	.free_bread = tape_34xx_free_bread,
@@ -1041,7 +1342,7 @@
 {
 	int rc;
 
-	DBF_EVENT(3, "34xx init: $Revision: 1.8 $\n");
+	DBF_EVENT(3, "34xx init: $Revision: 1.18 $\n");
 	/* Register driver for 3480/3490 tapes. */
 	rc = ccw_driver_register(&tape_34xx_driver);
 	if (rc)
@@ -1060,7 +1361,7 @@
 MODULE_DEVICE_TABLE(ccw, tape_34xx_ids);
 MODULE_AUTHOR("(C) 2001-2002 IBM Deutschland Entwicklung GmbH");
 MODULE_DESCRIPTION("Linux on zSeries channel attached 3480 tape "
-		   "device driver ($Revision: 1.8 $)");
+		   "device driver ($Revision: 1.18 $)");
 MODULE_LICENSE("GPL");
 
 module_init(tape_34xx_init);
diff -Nru a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c
--- a/drivers/s390/char/tape_block.c	Tue Feb  3 19:45:35 2004
+++ b/drivers/s390/char/tape_block.c	Tue Feb  3 19:45:35 2004
@@ -3,12 +3,14 @@
  *    block device frontend for tape device driver
  *
  *  S390 and zSeries version
- *    Copyright (C) 2001,2002 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ *    Copyright (C) 2001,2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
  *    Author(s): Carsten Otte <cotte@de.ibm.com>
  *		 Tuan Ngo-Anh <ngoanh@de.ibm.com>
  *		 Martin Schwidefsky <schwidefsky@de.ibm.com>
+ *		 Stefan Bader <shbader@de.ibm.com>
  */
 
+#include <linux/fs.h>
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/blkdev.h>
@@ -19,25 +21,53 @@
 
 #include "tape.h"
 
-#define PRINTK_HEADER "TBLOCK:"
+#define PRINTK_HEADER "TAPE_BLOCK: "
 
 #define TAPEBLOCK_MAX_SEC	100
 #define TAPEBLOCK_MIN_REQUEUE	3
 
 /*
+ * 2003/11/25  Stefan Bader <shbader@de.ibm.com>
+ *
+ * In 2.5/2.6 the block device request function is very likely to be called
+ * with disabled interrupts (e.g. generic_unplug_device). So the driver can't
+ * just call any function that tries to allocate CCW requests from that con-
+ * text since it might sleep. There are two choices to work around this:
+ *	a) do not allocate with kmalloc but use its own memory pool
+ *      b) take requests from the queue outside that context, knowing that
+ *         allocation might sleep
+ */
+
+/*
  * file operation structure for tape block frontend
  */
 static int tapeblock_open(struct inode *, struct file *);
 static int tapeblock_release(struct inode *, struct file *);
+static int tapeblock_ioctl(struct inode *, struct file *, unsigned int,
+				unsigned long);
+static int tapeblock_medium_changed(struct gendisk *);
+static int tapeblock_revalidate_disk(struct gendisk *);
 
 static struct block_device_operations tapeblock_fops = {
-	.owner		= THIS_MODULE,
-	.open		= tapeblock_open,
-	.release	= tapeblock_release,
+	.owner		 = THIS_MODULE,
+	.open		 = tapeblock_open,
+	.release	 = tapeblock_release,
+	.ioctl           = tapeblock_ioctl,
+	.media_changed   = tapeblock_medium_changed,
+	.revalidate_disk = tapeblock_revalidate_disk,
 };
 
 static int tapeblock_major = 0;
 
+static void
+tapeblock_trigger_requeue(struct tape_device *device)
+{
+	/* Protect against rescheduling. */
+	if (atomic_compare_and_swap(0, 1, &device->blk_data.requeue_scheduled))
+		return;
+	schedule_work(&device->blk_data.requeue_task);
+}
+
 /*
  * Post finished request.
  */
@@ -55,6 +85,8 @@
 	struct tape_device *device;
 	struct request *req;
 
+	DBF_LH(6, "__tapeblock_end_request()\n");
+
 	device = ccw_req->device;
 	req = (struct request *) data;
 	tapeblock_end_request(req, ccw_req->rc == 0);
@@ -68,33 +100,75 @@
 	device->discipline->free_bread(ccw_req);
 	if (!list_empty(&device->req_queue) ||
 	    elv_next_request(device->blk_data.request_queue))
-		tasklet_schedule(&device->blk_data.tasklet);
+		tapeblock_trigger_requeue(device);
 }
 
 /*
- * Fetch requests from block device queue.
+ * Feed the tape device CCW queue with requests supplied in a list.
  */
-static inline void
-__tape_process_blk_queue(struct tape_device *device, struct list_head *new_req)
+static inline int
+tapeblock_start_request(struct tape_device *device, struct request *req)
 {
-	request_queue_t *queue;
-	struct list_head *l;
-	struct request *req;
-	struct tape_request *ccw_req;
-	int nr_queued;
+	struct tape_request *	ccw_req;
+	int			rc;
+
+	DBF_LH(6, "tapeblock_start_request(%p, %p)\n", device, req);
+
+	ccw_req = device->discipline->bread(device, req);
+	if (IS_ERR(ccw_req)) {
+		DBF_EVENT(1, "TBLOCK: bread failed\n");
+		tapeblock_end_request(req, 0);
+		return PTR_ERR(ccw_req);
+	}
+	ccw_req->callback = __tapeblock_end_request;
+	ccw_req->callback_data = (void *) req;
+	ccw_req->retries = TAPEBLOCK_RETRIES;
+
+	rc = tape_do_io_async(device, ccw_req);
+	if (rc) {
+		/*
+		 * Start/enqueueing failed. No retries in
+		 * this case.
+		 */
+		tapeblock_end_request(req, 0);
+		device->discipline->free_bread(ccw_req);
+	}
+
+	return rc;
+}
+
+/*
+ * Move requests from the block device request queue to the tape device ccw
+ * queue.
+ */
+static void
+tapeblock_requeue(void *data) {
+	struct tape_device *	device;
+	request_queue_t *	queue;
+	int			nr_queued;
+	struct request *	req;
+	struct list_head *	l;
+	int			rc;
 
-	/* FIXME: we have to make sure that the tapeblock frontend
-	   owns the device. tape_state != TS_IN_USE is NOT enough. */
-	if (device->tape_state != TS_IN_USE)
+	device = (struct tape_device *) data;
+	if (!device)
 		return;
-	queue = device->blk_data.request_queue;
-	nr_queued = 0;
+
+	spin_lock_irq(get_ccwdev_lock(device->cdev));
+	queue  = device->blk_data.request_queue;
+
 	/* Count number of requests on ccw queue. */
+	nr_queued = 0;
 	list_for_each(l, &device->req_queue)
 		nr_queued++;
-	while (!blk_queue_plugged(queue) &&
-	       elv_next_request(queue) &&
-	       nr_queued < TAPEBLOCK_MIN_REQUEUE) {
+	spin_unlock(get_ccwdev_lock(device->cdev));
+
+	spin_lock(&device->blk_data.request_queue_lock);
+	while (
+		!blk_queue_plugged(queue) &&
+		elv_next_request(queue)   &&
+		nr_queued < TAPEBLOCK_MIN_REQUEUE
+	) {
 		req = elv_next_request(queue);
 		if (rq_data_dir(req) == WRITE) {
 			DBF_EVENT(1, "TBLOCK: Rejecting write request\n");
@@ -102,52 +176,14 @@
 			tapeblock_end_request(req, 0);
 			continue;
 		}
-		ccw_req = device->discipline->bread(device, req);
-		if (IS_ERR(ccw_req)) {
-			if (PTR_ERR(ccw_req) == -ENOMEM)
-				break; /* don't try again */
-			DBF_EVENT(1, "TBLOCK: bread failed\n");
-			blkdev_dequeue_request(req);
-			tapeblock_end_request(req, 0);
-			continue;
-		}
-		ccw_req->callback = __tapeblock_end_request;
-		ccw_req->callback_data = (void *) req;
-		ccw_req->retries = TAPEBLOCK_RETRIES;
+		spin_unlock_irq(&device->blk_data.request_queue_lock);
+		rc = tapeblock_start_request(device, req);
+		spin_lock_irq(&device->blk_data.request_queue_lock);
 		blkdev_dequeue_request(req);
-		list_add_tail(new_req, &ccw_req->list);
 		nr_queued++;
 	}
-}
-
-/*
- * Feed requests to the tape device.
- */
-static inline int
-tape_queue_requests(struct tape_device *device, struct list_head *new_req)
-{
-	struct list_head *l, *n;
-	struct tape_request *ccw_req;
-	struct request *req;
-	int rc, fail;
-
-	fail = 0;
-	list_for_each_safe(l, n, new_req) {
-		ccw_req = list_entry(l, struct tape_request, list);
-		list_del(&ccw_req->list);
-		rc = tape_do_io_async(device, ccw_req);
-		if (rc) {
-			/*
-			 * Start/enqueueing failed. No retries in
-			 * this case.
-			 */
-			req = (struct request *) ccw_req->callback_data;
-			tapeblock_end_request(req, 0);
-			device->discipline->free_bread(ccw_req);
-			fail = 1;
-		}
-	}
-	return fail;
+	spin_unlock_irq(&device->blk_data.request_queue_lock);
+	atomic_set(&device->blk_data.requeue_scheduled, 0);
 }
 
 /*
@@ -156,48 +192,14 @@
 static void
 tapeblock_request_fn(request_queue_t *queue)
 {
-	struct list_head new_req;
 	struct tape_device *device;
 
 	device = (struct tape_device *) queue->queuedata;
-	while (elv_next_request(queue)) {
-		INIT_LIST_HEAD(&new_req);
-		spin_lock(get_ccwdev_lock(device->cdev));
-		__tape_process_blk_queue(device, &new_req);
-		spin_unlock(get_ccwdev_lock(device->cdev));
-		/*
-		 * Now queue the new request to the tape. This needs to be
-		 * done without the device lock held.
-		 */
-		if (tape_queue_requests(device, &new_req) == 0)
-			/* All requests queued. Thats enough for now. */
-			break;
-	}
-}
-
-/*
- * Acquire the device lock and process queues for the device.
- */
-static void
-tapeblock_tasklet(unsigned long data)
-{
-	struct list_head new_req;
-	struct tape_device *device;
+	DBF_LH(6, "tapeblock_request_fn(device=%p)\n", device);
+	if (device == NULL)
+		BUG();
 
-	device = (struct tape_device *) data;
-	while (elv_next_request(device->blk_data.request_queue)) {
-		INIT_LIST_HEAD(&new_req);
-		spin_lock_irq(get_ccwdev_lock(device->cdev));
-		__tape_process_blk_queue(device, &new_req);
-		spin_unlock_irq(get_ccwdev_lock(device->cdev));
-		/*
-		 * Now queue the new request to the tape. This needs to be
-		 * done without the device lock held.
-		 */
-		if (tape_queue_requests(device, &new_req) == 0)
-			/* All requests queued. Thats enough for now. */
-			break;
-	}
+	tapeblock_trigger_requeue(device);
 }
 
 /*
@@ -206,126 +208,192 @@
 int
 tapeblock_setup_device(struct tape_device * device)
 {
-	struct tape_blk_data *d = &device->blk_data;
-	request_queue_t *q;
-	struct gendisk *disk = alloc_disk(1);
-	int rc;
-
-	if (!disk)
+	struct tape_blk_data *	blkdat;
+	struct gendisk *	disk;
+	int			rc;
+
+	blkdat = &device->blk_data;
+	spin_lock_init(&blkdat->request_queue_lock);
+	atomic_set(&blkdat->requeue_scheduled, 0);
+
+	blkdat->request_queue = blk_init_queue(
+		tapeblock_request_fn,
+		&blkdat->request_queue_lock
+	);
+	if (!blkdat->request_queue)
 		return -ENOMEM;
 
-	tasklet_init(&d->tasklet, tapeblock_tasklet, (unsigned long)device);
-
-	spin_lock_init(&d->request_queue_lock);
-	q = blk_init_queue(tapeblock_request_fn, &d->request_queue_lock);
-	if (!q) {
-		rc = -ENXIO;
-		goto put_disk;
-	}
-	d->request_queue = q;
-	elevator_exit(q);
-	rc = elevator_init(q, &elevator_noop);
+	elevator_exit(blkdat->request_queue);
+	rc = elevator_init(blkdat->request_queue, &elevator_noop);
 	if (rc)
 		goto cleanup_queue;
 
-	/* FIXME: We should be able to sense the sectore size */
-	blk_queue_hardsect_size(q, TAPEBLOCK_HSEC_SIZE);
-	blk_queue_max_sectors(q, TAPEBLOCK_MAX_SEC);
-	blk_queue_max_phys_segments(q, -1L);
-	blk_queue_max_hw_segments(q, -1L);
-	blk_queue_max_segment_size(q, -1L);
-	blk_queue_segment_boundary(q, -1L);
+	blk_queue_hardsect_size(blkdat->request_queue, TAPEBLOCK_HSEC_SIZE);
+	blk_queue_max_sectors(blkdat->request_queue, TAPEBLOCK_MAX_SEC);
+	blk_queue_max_phys_segments(blkdat->request_queue, -1L);
+	blk_queue_max_hw_segments(blkdat->request_queue, -1L);
+	blk_queue_max_segment_size(blkdat->request_queue, -1L);
+	blk_queue_segment_boundary(blkdat->request_queue, -1L);
+
+	disk = alloc_disk(1);
+	if (!disk) {
+		rc = -ENOMEM;
+		goto cleanup_queue;
+	}
 
 	disk->major = tapeblock_major;
 	disk->first_minor = device->first_minor;
 	disk->fops = &tapeblock_fops;
-	disk->private_data = device;
-	disk->queue = q;
-	//set_capacity(disk, size);
-
-	sprintf(disk->disk_name, "tBLK/%d", device->first_minor / TAPE_MINORS_PER_DEV);
+	disk->private_data = tape_get_device_reference(device);
+	disk->queue = blkdat->request_queue;
+	set_capacity(disk, 0);
+	sprintf(disk->disk_name, "btibm%d",
+		device->first_minor / TAPE_MINORS_PER_DEV);
+
+	blkdat->disk = disk;
+	blkdat->medium_changed = 1;
+	blkdat->request_queue->queuedata = tape_get_device_reference(device);
 
 	add_disk(disk);
-	d->disk = disk;
+
+	INIT_WORK(&blkdat->requeue_task, tapeblock_requeue,
+		tape_get_device_reference(device));
+
+	/* Will vanish */
+	tape_hotplug_event(device, tapeblock_major, TAPE_HOTPLUG_BLOCK_ADD);
+
 	return 0;
 
- cleanup_queue:
-	blk_cleanup_queue(q);
- put_disk:
-	put_disk(disk);
+cleanup_queue:
+	blk_cleanup_queue(blkdat->request_queue);
+	blkdat->request_queue = NULL;
+
 	return rc;
 }
 
 void
 tapeblock_cleanup_device(struct tape_device *device)
 {
-	struct tape_blk_data *d = &device->blk_data;
+	tape_hotplug_event(device, tapeblock_major, TAPE_HOTPLUG_BLOCK_REMOVE);
 
-	del_gendisk(d->disk);
-	put_disk(d->disk);
-	blk_cleanup_queue(d->request_queue);
+	flush_scheduled_work();
+	device->blk_data.requeue_task.data = tape_put_device(device);
 
-	tasklet_kill(&d->tasklet);
+	del_gendisk(device->blk_data.disk);
+	device->blk_data.disk->private_data =
+		tape_put_device(device->blk_data.disk->private_data);
+	put_disk(device->blk_data.disk);
+
+	device->blk_data.disk = NULL;
+	device->blk_data.request_queue->queuedata = tape_put_device(device);
+
+	blk_cleanup_queue(device->blk_data.request_queue);
+	device->blk_data.request_queue = NULL;
 }
 
 /*
  * Detect number of blocks of the tape.
  * FIXME: can we extent this to detect the blocks size as well ?
  */
-static int tapeblock_mediumdetect(struct tape_device *device)
+static int
+tapeblock_revalidate_disk(struct gendisk *disk)
 {
-	unsigned int nr_of_blks;
-	int rc;
+	struct tape_device *	device;
+	unsigned int		nr_of_blks;
+	int			rc;
+
+	device = (struct tape_device *) disk->private_data;
+	if (!device)
+		BUG();
+
+	if (!device->blk_data.medium_changed)
+		return 0;
 
 	PRINT_INFO("Detecting media size...\n");
-	rc = tape_mtop(device, MTREW, 1);
-	if (rc)
-		return rc;
-	rc = tape_mtop(device, MTFSF, 1);
+	rc = tape_mtop(device, MTFSFM, 1);
 	if (rc)
 		return rc;
+
 	rc = tape_mtop(device, MTTELL, 1);
-	if (rc)
+	if (rc < 0)
 		return rc;
-	nr_of_blks = rc - 1; /* don't count FM */
-	rc = tape_mtop(device, MTREW, 1);
-	if (rc)
+
+	DBF_LH(3, "Image file ends at %d\n", rc);
+	nr_of_blks = rc;
+
+	/* This will fail for the first file. Catch the error by checking the
+	 * position. */
+	tape_mtop(device, MTBSF, 1);
+
+	rc = tape_mtop(device, MTTELL, 1);
+	if (rc < 0)
 		return rc;
+
+	if (rc > nr_of_blks)
+		return -EINVAL;
+
+	DBF_LH(3, "Image file starts at %d\n", rc);
+	device->bof = rc;
+	nr_of_blks -= rc;
+
 	PRINT_INFO("Found %i blocks on media\n", nr_of_blks);
+	set_capacity(device->blk_data.disk,
+		nr_of_blks*(TAPEBLOCK_HSEC_SIZE/512));
+
+	device->blk_data.block_position = 0;
+	device->blk_data.medium_changed = 0;
 	return 0;
 }
 
+static int
+tapeblock_medium_changed(struct gendisk *disk)
+{
+	struct tape_device *device;
+
+	device = (struct tape_device *) disk->private_data;
+	DBF_LH(6, "tapeblock_medium_changed(%p) = %d\n",
+		device, device->blk_data.medium_changed);
+
+	return device->blk_data.medium_changed;
+}
+
 /*
  * Block frontend tape device open function.
  */
 static int
 tapeblock_open(struct inode *inode, struct file *filp)
 {
-	struct gendisk *disk = inode->i_bdev->bd_disk;
-	struct tape_device *device = disk->private_data;
-	int rc;
+	struct gendisk *	disk;
+	struct tape_device *	device;
+	int			rc;
+
+	disk   = inode->i_bdev->bd_disk;
+	device = tape_get_device_reference(disk->private_data);
+
+	if (device->required_tapemarks) {
+		DBF_EVENT(2, "TBLOCK: missing tapemarks\n");
+		PRINT_ERR("TBLOCK: Refusing to open tape with missing"
+			" end of file marks.\n");
+		rc = -EPERM;
+		goto put_device;
+	}
 
-	/*
-	 * FIXME: this new tapeblock_open function is from 2.5.69.
-	 * It doesn't do tape_get_device anymore but picks the device
-	 * pointer from disk->private_data. It is stored in 
-	 * tapeblock_setup_device but WITHOUT proper ref-counting.
-	 */
 	rc = tape_open(device);
 	if (rc)
 		goto put_device;
-	rc = tape_assign(device);
+
+	rc = tapeblock_revalidate_disk(disk);
 	if (rc)
 		goto release;
-	device->blk_data.block_position = -1;
-	rc = tapeblock_mediumdetect(device);
-	if (rc)
-		goto unassign;
+
+	/*
+	 * Note: The reference to <device> is hold until the release function
+	 *       is called.
+	 */
+	tape_state_set(device, TS_BLKUSE);
 	return 0;
 
- unassign:
-	tape_unassign(device);
- release:
+release:
 	tape_release(device);
  put_device:
 	tape_put_device(device);
@@ -334,6 +402,9 @@
 
 /*
  * Block frontend tape device release function.
+ *
+ * Note: One reference to the tape device was made by the open function. So
+ *       we just get the pointer here and release the reference.
  */
 static int
 tapeblock_release(struct inode *inode, struct file *filp)
@@ -341,11 +412,51 @@
 	struct gendisk *disk = inode->i_bdev->bd_disk;
 	struct tape_device *device = disk->private_data;
 
+	tape_state_set(device, TS_IN_USE);
 	tape_release(device);
-	tape_unassign(device);
 	tape_put_device(device);
 
 	return 0;
+}
+
+/*
+ * Support of some generic block device IOCTLs.
+ */
+static int
+tapeblock_ioctl(
+	struct inode *		inode,
+	struct file *		file,
+	unsigned int		command,
+	unsigned long		arg
+) {
+	int rc;
+	int minor;
+	struct gendisk *disk = inode->i_bdev->bd_disk;
+	struct tape_device *device = disk->private_data;
+
+	rc     = 0;
+	disk   = inode->i_bdev->bd_disk;
+	if (!disk)
+		BUG();
+	device = disk->private_data;
+	if (!device)
+		BUG();
+	minor  = iminor(inode);
+
+	DBF_LH(6, "tapeblock_ioctl(0x%0x)\n", command);
+	DBF_LH(6, "device = %d:%d\n", tapeblock_major, minor);
+
+	switch (command) {
+		/* Refuse some IOCTL calls without complaining (mount). */
+		case 0x5310:		/* CDROMMULTISESSION */
+			rc = -EINVAL;
+			break;
+		default:
+			PRINT_WARN("invalid ioctl 0x%x\n", command);
+			rc = -EINVAL;
+	}
+
+	return rc;
 }
 
 /*
diff -Nru a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c
--- a/drivers/s390/char/tape_char.c	Tue Feb  3 19:45:35 2004
+++ b/drivers/s390/char/tape_char.c	Tue Feb  3 19:45:35 2004
@@ -19,8 +19,9 @@
 #include <asm/uaccess.h>
 
 #include "tape.h"
+#include "tape_std.h"
 
-#define PRINTK_HEADER "TCHAR:"
+#define PRINTK_HEADER "TAPE_CHAR: "
 
 #define TAPECHAR_MAJOR		0	/* get dynamic major */
 
@@ -52,12 +53,14 @@
 int
 tapechar_setup_device(struct tape_device * device)
 {
+	tape_hotplug_event(device, tapechar_major, TAPE_HOTPLUG_CHAR_ADD);
 	return 0;
 }
 
 void
 tapechar_cleanup_device(struct tape_device *device)
 {
+	tape_hotplug_event(device, tapechar_major, TAPE_HOTPLUG_CHAR_REMOVE);
 }
 
 /*
@@ -81,15 +84,27 @@
 	struct idal_buffer *new;
 
 	if (device->char_data.idal_buf != NULL &&
-	    device->char_data.idal_buf->size >= block_size)
+	    device->char_data.idal_buf->size == block_size)
 		return 0;
-	/* The current idal buffer is not big enough. Allocate a new one. */
+
+	if (block_size > MAX_BLOCKSIZE) {
+		DBF_EVENT(3, "Invalid blocksize (%zd > %d)\n",
+			block_size, MAX_BLOCKSIZE);
+		PRINT_ERR("Invalid blocksize (%zd> %d)\n",
+			block_size, MAX_BLOCKSIZE);
+		return -EINVAL;
+	}
+
+	/* The current idal buffer is not correct. Allocate a new one. */
 	new = idal_buffer_alloc(block_size, 0);
 	if (new == NULL)
 		return -ENOMEM;
+
 	if (device->char_data.idal_buf != NULL)
 		idal_buffer_free(device->char_data.idal_buf);
+
 	device->char_data.idal_buf = new;
+
 	return 0;
 }
 
@@ -116,6 +131,16 @@
 		DBF_EVENT(6, "TCHAR:ppos wrong\n");
 		return -EOVERFLOW;
 	}
+
+	/*
+	 * If the tape isn't terminated yet, do it now. And since we then
+	 * are at the end of the tape there wouldn't be anything to read
+	 * anyways. So we return immediatly.
+	 */
+	if(device->required_tapemarks) {
+		return tape_std_terminate_write(device);
+	}
+
 	/* Find out block size to use */
 	if (device->char_data.block_size != 0) {
 		if (count < device->char_data.block_size) {
@@ -126,10 +151,17 @@
 		block_size = device->char_data.block_size;
 	} else {
 		block_size = count;
-		rc = tapechar_check_idalbuffer(device, block_size);
-		if (rc)
-			return rc;
 	}
+
+	rc = tapechar_check_idalbuffer(device, block_size);
+	if (rc)
+		return rc;
+
+#ifdef CONFIG_S390_TAPE_BLOCK
+	/* Changes position. */
+	device->blk_data.medium_changed = 1;
+#endif
+
 	DBF_EVENT(6, "TCHAR:nbytes: %lx\n", block_size);
 	/* Let the discipline build the ccw chain. */
 	request = device->discipline->read_block(device, block_size);
@@ -182,11 +214,18 @@
 		nblocks = count / block_size;
 	} else {
 		block_size = count;
-		rc = tapechar_check_idalbuffer(device, block_size);
-		if (rc)
-			return rc;
 		nblocks = 1;
 	}
+
+	rc = tapechar_check_idalbuffer(device, block_size);
+	if (rc)
+		return rc;
+
+#ifdef CONFIG_S390_TAPE_BLOCK
+	/* Changes position. */
+	device->blk_data.medium_changed = 1;
+#endif
+
 	DBF_EVENT(6,"TCHAR:nbytes: %lx\n", block_size);
 	DBF_EVENT(6, "TCHAR:nblocks: %x\n", nblocks);
 	/* Let the discipline build the ccw chain. */
@@ -225,6 +264,17 @@
 			rc = 0;
 
 	}
+
+	/*
+	 * After doing a write we always need two tapemarks to correctly
+	 * terminate the tape (one to terminate the file, the second to
+	 * flag the end of recorded data.
+	 * Since process_eov positions the tape in front of the written
+	 * tapemark it doesn't hurt to write two marks again.
+	 */
+	if (!rc)
+		device->required_tapemarks = 2;
+
 	return rc ? rc : written;
 }
 
@@ -237,24 +287,28 @@
 	struct tape_device *device;
 	int minor, rc;
 
+	DBF_EVENT(6, "TCHAR:open: %i:%i\n",
+		imajor(filp->f_dentry->d_inode),
+		iminor(filp->f_dentry->d_inode));
+
 	if (imajor(filp->f_dentry->d_inode) != tapechar_major)
 		return -ENODEV;
+
 	minor = iminor(filp->f_dentry->d_inode);
 	device = tape_get_device(minor / TAPE_MINORS_PER_DEV);
 	if (IS_ERR(device)) {
+		DBF_EVENT(3, "TCHAR:open: tape_get_device() failed\n");
 		return PTR_ERR(device);
 	}
-	DBF_EVENT(6, "TCHAR:open: %x\n", iminor(inode));
+
+
 	rc = tape_open(device);
 	if (rc == 0) {
-		rc = tape_assign(device);
-		if (rc == 0) {
-			filp->private_data = device;
-			return 0;
-		}
-		tape_release(device);
+		filp->private_data = device;
+		return 0;
 	}
 	tape_put_device(device);
+
 	return rc;
 }
 
@@ -267,29 +321,32 @@
 {
 	struct tape_device *device;
 
-	device = (struct tape_device *) filp->private_data;
 	DBF_EVENT(6, "TCHAR:release: %x\n", iminor(inode));
-#if 0
-	// FIXME: this is broken. Either MTWEOF/MTWEOF/MTBSR is done
-	// EVERYTIME the user switches from write to something different
-	// or it is not done at all. The second is IMHO better because
-	// we should NEVER do something the user didn't request.
-	if (device->last_op == TO_WRI)
-		tapechar_terminate_write(device);
-#endif
+	device = (struct tape_device *) filp->private_data;
+
 	/*
-	 * If this is the rewinding tape minor then rewind.
+	 * If this is the rewinding tape minor then rewind. In that case we
+	 * write all required tapemarks. Otherwise only one to terminate the
+	 * file.
 	 */
-	if ((iminor(inode) & 1) != 0)
+	if ((iminor(inode) & 1) != 0) {
+		if (device->required_tapemarks)
+			tape_std_terminate_write(device);
 		tape_mtop(device, MTREW, 1);
+	} else {
+		if (device->required_tapemarks > 1) {
+			if (tape_mtop(device, MTWEOF, 1) == 0)
+				device->required_tapemarks--;
+		}
+	}
+
 	if (device->char_data.idal_buf != NULL) {
 		idal_buffer_free(device->char_data.idal_buf);
 		device->char_data.idal_buf = NULL;
 	}
-	device->char_data.block_size = 0;
 	tape_release(device);
-	tape_unassign(device);
-	tape_put_device(device);
+	filp->private_data = tape_put_device(device);
+
 	return 0;
 }
 
@@ -314,7 +371,40 @@
 			return -EFAULT;
 		if (op.mt_count < 0)
 			return -EINVAL;
-		return tape_mtop(device, op.mt_op, op.mt_count);
+
+		/*
+		 * Operations that change tape position should write final
+		 * tapemarks.
+		 */
+		switch (op.mt_op) {
+			case MTFSF:
+			case MTBSF:
+			case MTFSR:
+			case MTBSR:
+			case MTREW:
+			case MTOFFL:
+			case MTEOM:
+			case MTRETEN:
+			case MTBSFM:
+			case MTFSFM:
+			case MTSEEK:
+#ifdef CONFIG_S390_TAPE_BLOCK
+				device->blk_data.medium_changed = 1;
+#endif
+				if (device->required_tapemarks)
+					tape_std_terminate_write(device);
+			default:
+				;
+		}
+		rc = tape_mtop(device, op.mt_op, op.mt_count);
+
+		if (op.mt_op == MTWEOF && rc == 0) {
+			if (op.mt_count > device->required_tapemarks)
+				device->required_tapemarks = 0;
+			else
+				device->required_tapemarks -= op.mt_count;
+		}
+		return rc;
 	}
 	if (no == MTIOCPOS) {
 		/* MTIOCPOS: query the tape position. */
@@ -333,19 +423,30 @@
 		struct mtget get;
 
 		memset(&get, 0, sizeof(get));
-		rc = tape_mtop(device, MTTELL, 1);
-		if (rc < 0)
-			return rc;
 		get.mt_type = MT_ISUNKNOWN;
+		get.mt_resid = 0 /* device->devstat.rescnt */;
 		get.mt_dsreg = device->tape_state;
 		/* FIXME: mt_gstat, mt_erreg, mt_fileno */
-		get.mt_resid = 0 /* device->devstat.rescnt */;
 		get.mt_gstat = 0;
 		get.mt_erreg = 0;
 		get.mt_fileno = 0;
-		get.mt_blkno = rc;
+		get.mt_gstat  = device->tape_generic_status;
+
+		if (device->medium_state == MS_LOADED) {
+			rc = tape_mtop(device, MTTELL, 1);
+
+			if (rc < 0)
+				return rc;
+
+			if (rc == 0)
+				get.mt_gstat |= GMT_BOT(~0);
+
+			get.mt_blkno = rc;
+		}
+
 		if (copy_to_user((char *) data, &get, sizeof(get)) != 0)
 			return -EFAULT;
+
 		return 0;
 	}
 	/* Try the discipline ioctl function. */
diff -Nru a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c
--- a/drivers/s390/char/tape_core.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/char/tape_core.c	Tue Feb  3 19:45:17 2004
@@ -23,9 +23,10 @@
 #include "tape.h"
 #include "tape_std.h"
 
-#define PRINTK_HEADER "T390:"
+#define PRINTK_HEADER "TAPE_CORE: "
 
-static void tape_do_irq (struct ccw_device *, unsigned long, struct irb *);
+static void __tape_do_irq (struct ccw_device *, unsigned long, struct irb *);
+static void __tape_remove_request(struct tape_device *, struct tape_request *);
 
 /*
  * One list to contain all tape devices of all disciplines, so
@@ -36,11 +37,6 @@
 static rwlock_t tape_device_lock = RW_LOCK_UNLOCKED;
 
 /*
- * Wait queue for tape_delete_device waits.
- */
-static DECLARE_WAIT_QUEUE_HEAD(tape_delete_wq);
-
-/*
  * Pointer to debug area.
  */
 debug_info_t *tape_dbf_area = NULL;
@@ -50,8 +46,11 @@
  */
 const char *tape_state_verbose[TS_SIZE] =
 {
-	[TS_UNUSED] = "UNUSED",	[TS_IN_USE] = "IN_USE",
-	[TS_INIT] = "INIT  ",	[TS_NOT_OPER] = "NOT_OP"
+	[TS_UNUSED]   = "UNUSED",
+	[TS_IN_USE]   = "IN_USE",
+	[TS_BLKUSE]   = "BLKUSE",
+	[TS_INIT]     = "INIT  ",
+	[TS_NOT_OPER] = "NOT_OP"
 };
 
 const char *tape_op_verbose[TO_SIZE] =
@@ -71,9 +70,105 @@
 };
 
 /*
+ * Some channel attached tape specific attributes.
+ *
+ * FIXME: In the future the first_minor and blocksize attribute should be
+ *        replaced by a link to the cdev tree.
+ */
+static ssize_t
+tape_medium_state_show(struct device *dev, char *buf)
+{
+	struct tape_device *tdev;
+
+	tdev = (struct tape_device *) dev->driver_data;
+	return snprintf(buf, PAGE_SIZE, "%i\n", tdev->medium_state);
+}
+
+static
+DEVICE_ATTR(medium_state, 0444, tape_medium_state_show, NULL);
+
+static ssize_t
+tape_first_minor_show(struct device *dev, char *buf)
+{
+	struct tape_device *tdev;
+
+	tdev = (struct tape_device *) dev->driver_data;
+	return snprintf(buf, PAGE_SIZE, "%i\n", tdev->first_minor);
+}
+
+static
+DEVICE_ATTR(first_minor, 0444, tape_first_minor_show, NULL);
+
+static ssize_t
+tape_state_show(struct device *dev, char *buf)
+{
+	struct tape_device *tdev;
+
+	tdev = (struct tape_device *) dev->driver_data;
+	return snprintf(buf, PAGE_SIZE, "%s\n", (tdev->first_minor < 0) ?
+		"OFFLINE" : tape_state_verbose[tdev->tape_state]);
+}
+
+static
+DEVICE_ATTR(state, 0444, tape_state_show, NULL);
+
+static ssize_t
+tape_operation_show(struct device *dev, char *buf)
+{
+	struct tape_device *tdev;
+	ssize_t rc;
+
+	tdev = (struct tape_device *) dev->driver_data;
+	if (tdev->first_minor < 0)
+		return snprintf(buf, PAGE_SIZE, "N/A\n");
+
+	spin_lock_irq(get_ccwdev_lock(tdev->cdev));
+	if (list_empty(&tdev->req_queue))
+		rc = snprintf(buf, PAGE_SIZE, "---\n");
+	else {
+		struct tape_request *req;
+
+		req = list_entry(tdev->req_queue.next, struct tape_request,
+			list);
+		rc = snprintf(buf, PAGE_SIZE, "%s\n", tape_op_verbose[req->op]);
+	}
+	spin_unlock_irq(get_ccwdev_lock(tdev->cdev));
+	return rc;
+}
+
+static
+DEVICE_ATTR(operation, 0444, tape_operation_show, NULL);
+
+static ssize_t
+tape_blocksize_show(struct device *dev, char *buf)
+{
+	struct tape_device *tdev;
+
+	tdev = (struct tape_device *) dev->driver_data;
+
+	return snprintf(buf, PAGE_SIZE, "%i\n", tdev->char_data.block_size);
+}
+
+static
+DEVICE_ATTR(blocksize, 0444, tape_blocksize_show, NULL);
+
+static struct attribute *tape_attrs[] = {
+	&dev_attr_medium_state.attr,
+	&dev_attr_first_minor.attr,
+	&dev_attr_state.attr,
+	&dev_attr_operation.attr,
+	&dev_attr_blocksize.attr,
+	NULL
+};
+
+static struct attribute_group tape_attr_group = {
+	.attrs = tape_attrs,
+};
+
+/*
  * Tape state functions
  */
-static void
+void
 tape_state_set(struct tape_device *device, enum tape_state newstate)
 {
 	const char *str;
@@ -139,14 +234,20 @@
 	/* Check if interrupt has already been processed */
 	if (request->callback == NULL)
 		return 0;
+
 	rc = 0;
 	for (retries = 0; retries < 5; retries++) {
 		if (retries < 2)
 			rc = ccw_device_halt(device->cdev, (long) request);
 		else
 			rc = ccw_device_clear(device->cdev, (long) request);
-		if (rc == 0)
-			break;		/* termination successful */
+
+		if (rc == 0) {                     /* Termination successful */
+			request->rc     = -EIO;
+			request->status = TAPE_REQUEST_DONE;
+			return 0;
+		}
+
 		if (rc == -ENODEV)
 			DBF_EXCEPTION(2, "device gone, retry\n");
 		else if (rc == -EIO)
@@ -156,8 +257,7 @@
 		else
 			BUG();
 	}
-	if (rc == 0)
-		request->status = TAPE_REQUEST_DONE;
+
 	return rc;
 }
 
@@ -207,8 +307,12 @@
 {
 	int rc;
 
-	if (device->tape_state != TS_INIT)
+	DBF_LH(6, "tape_enable_device(%p, %p)\n", device, discipline);
+
+	if (device->tape_state != TS_INIT) {
+		DBF_LH(3, "Tapestate not INIT (%d)\n", device->tape_state);
 		return -EINVAL;
+	}
 
 	/* Let the discipline have a go at the device. */
 	device->discipline = discipline;
@@ -218,6 +322,7 @@
 	rc = tape_assign_minor(device);
 	if (rc)
 		goto out_discipline;
+
 	rc = tapechar_setup_device(device);
 	if (rc)
 		goto out_minor;
@@ -250,7 +355,6 @@
 	struct tape_request *request;
 
 	spin_lock_irq(get_ccwdev_lock(device->cdev));
-	tape_state_set(device, TS_NOT_OPER);
 	/* Post remaining requests with -EIO */
 	list_for_each_safe(l, n, &device->req_queue) {
 		request = list_entry(l, struct tape_request, list);
@@ -258,7 +362,7 @@
 			__tape_halt_io(device, request);
 		list_del(&request->list);
 		/* Decrease ref_count for removed request. */
-		tape_put_device(device);
+		request->device = tape_put_device(device);
 		request->rc = -EIO;
 		if (request->callback != NULL)
 			request->callback(request, request->callback_data);
@@ -269,6 +373,9 @@
 	tapechar_cleanup_device(device);
 	device->discipline->cleanup_device(device);
 	tape_remove_minor(device);
+
+	tape_med_state_set(device, MS_UNKNOWN);
+	device->tape_state = TS_INIT;
 }
 
 /*
@@ -301,17 +408,51 @@
 	device->tape_state = TS_INIT;
 	device->medium_state = MS_UNKNOWN;
 	*device->modeset_byte = 0;
+	device->first_minor = -1;
+	atomic_set(&device->ref_count, 1);
+
 	return device;
 }
 
 /*
- * Free memory of a device structure.
+ * Get a reference to an existing device structure. This will automatically
+ * increment the reference count.
  */
-static void
-tape_free_device(struct tape_device *device)
+struct tape_device *
+tape_get_device_reference(struct tape_device *device)
 {
-	kfree(device->modeset_byte);
-	kfree(device);
+	DBF_EVENT(4, "tape_get_device_reference(%p) = %i\n", device,
+		atomic_inc_return(&device->ref_count));
+
+	return device;
+}
+
+/*
+ * Decrease the reference counter of a devices structure. If the
+ * reference counter reaches zero free the device structure.
+ * The function returns a NULL pointer to be used by the caller
+ * for clearing reference pointers.
+ */
+struct tape_device *
+tape_put_device(struct tape_device *device)
+{
+	int remain;
+
+	remain = atomic_dec_return(&device->ref_count);
+	if (remain > 0) {
+		DBF_EVENT(4, "tape_put_device(%p) -> %i\n", device, remain);
+	} else {
+		if (remain < 0) {
+			DBF_EVENT(4, "put device without reference\n");
+			PRINT_ERR("put device without reference\n");
+		} else {
+			DBF_EVENT(4, "tape_free_device(%p)\n", device);
+			kfree(device->modeset_byte);
+			kfree(device);
+		}
+	}
+
+	return NULL;			
 }
 
 /*
@@ -325,9 +466,8 @@
 	device = ERR_PTR(-ENODEV);
 	read_lock(&tape_device_lock);
 	list_for_each_entry(tmp, &tape_device_list, node) {
-		if (tmp->first_minor * TAPE_MINORS_PER_DEV == devindex) {
-			device = tmp;
-			atomic_inc(&device->ref_count);
+		if (tmp->first_minor / TAPE_MINORS_PER_DEV == devindex) {
+			device = tape_get_device_reference(tmp);
 			break;
 		}
 	}
@@ -336,25 +476,6 @@
 }
 
 /*
- * Decrease the reference counter of a devices structure. If the
- * reference counter reaches zero free the device structure and
- * wake up sleepers.
- */
-void
-tape_put_device(struct tape_device *device)
-{
-	if (atomic_dec_return(&device->ref_count) > 0)
-		return;
-	/*
-	 * Reference counter dropped to zero. This means
-	 * that the device is deleted and the last user
-	 * of the device structure is gone. That is what
-	 * tape_delete_device is waiting for. Do a wake up.
-	 */
-	wake_up(&tape_delete_wq);
-}
-
-/*
  * Driverfs tape probe function.
  */
 int
@@ -367,12 +488,12 @@
 	if (IS_ERR(device))
 		return -ENODEV;
 	PRINT_INFO("tape device %s found\n", bus_id);
-	atomic_inc(&device->ref_count);
 	cdev->dev.driver_data = device;
 	device->cdev = cdev;
-	cdev->handler = tape_do_irq;
+	cdev->handler = __tape_do_irq;
 
 	ccw_device_set_options(cdev, CCWDEV_DO_PATHGROUP);
+	sysfs_create_group(&cdev->dev.kobj, &tape_attr_group);
 
 	return 0;
 }
@@ -380,19 +501,14 @@
 /*
  * Driverfs tape remove function.
  */
-int
+void
 tape_generic_remove(struct ccw_device *cdev)
 {
-	struct tape_device *device;
-
-	device = cdev->dev.driver_data;
-	cdev->dev.driver_data = NULL;
-	if (device != NULL) {
-		tape_put_device(device);
-		wait_event(tape_delete_wq, atomic_read(&device->ref_count) == 0);
-		tape_free_device(device);
+	ccw_device_set_offline(cdev);
+	if (cdev->dev.driver_data != NULL) {
+		sysfs_remove_group(&cdev->dev.kobj, &tape_attr_group);
+		cdev->dev.driver_data = tape_put_device(cdev->dev.driver_data);
 	}
-	return 0;
 }
 
 /*
@@ -406,6 +522,8 @@
 	if (datasize > PAGE_SIZE || (cplength*sizeof(struct ccw1)) > PAGE_SIZE)
 		BUG();
 
+	DBF_LH(6, "tape_alloc_request(%d, %d)\n", cplength, datasize);
+
 	request = (struct tape_request *) kmalloc(sizeof(struct tape_request),
 						  GFP_KERNEL);
 	if (request == NULL) {
@@ -436,6 +554,9 @@
 		}
 		memset(request->cpdata, 0, datasize);
 	}
+	DBF_LH(6, "New request %p(%p/%p)\n", request, request->cpaddr,
+		request->cpdata);
+
 	return request;
 }
 
@@ -445,9 +566,10 @@
 void
 tape_free_request (struct tape_request * request)
 {
+	DBF_LH(6, "Free request %p\n", request);
+
 	if (request->device != NULL) {
-		tape_put_device(request->device);
-		request->device = NULL;
+		request->device = tape_put_device(request->device);
 	}
 	if (request->cpdata != NULL)
 		kfree(request->cpdata);
@@ -456,6 +578,56 @@
 	kfree(request);
 }
 
+static inline void
+__tape_do_io_list(struct tape_device *device)
+{
+	struct list_head *l, *n;
+	struct tape_request *request;
+	int rc;
+
+	DBF_LH(6, "__tape_do_io_list(%p)\n", device);
+	/*
+	 * Try to start each request on request queue until one is
+	 * started successful.
+	 */
+	list_for_each_safe(l, n, &device->req_queue) {
+		request = list_entry(l, struct tape_request, list);
+#ifdef CONFIG_S390_TAPE_BLOCK
+		if (request->op == TO_BLOCK)
+			device->discipline->check_locate(device, request);
+#endif
+		rc = ccw_device_start(device->cdev, request->cpaddr,
+				      (unsigned long) request, 0x00,
+				      request->options);
+		if (rc == 0) {
+			request->status = TAPE_REQUEST_IN_IO;
+			break;
+		}
+		/* Start failed. Remove request and indicate failure. */
+		DBF_EVENT(1, "tape: DOIO failed with er = %i\n", rc);
+
+		/* Set ending status and do callback. */
+		request->rc = rc;
+		request->status = TAPE_REQUEST_DONE;
+		__tape_remove_request(device, request);
+	}
+}
+
+static void
+__tape_remove_request(struct tape_device *device, struct tape_request *request)
+{
+	/* Remove from request queue. */
+	list_del(&request->list);
+
+	/* Do callback. */
+	if (request->callback != NULL)
+		request->callback(request, request->callback_data);
+
+	/* Start next request. */
+	if (!list_empty(&device->req_queue))
+		__tape_do_io_list(device);
+}
+
 /*
  * Write sense data to console/dbf
  */
@@ -514,12 +686,24 @@
 {
 	int rc;
 
-	if (device->tape_state != TS_IN_USE)
-		return -ENODEV;
+	switch (request->op) {
+		case TO_MSEN:
+		case TO_ASSIGN:
+		case TO_UNASSIGN:
+		case TO_READ_ATTMSG:
+			if (device->tape_state == TS_INIT)
+				break;
+			if (device->tape_state == TS_UNUSED)
+				break;
+		default:
+			if (device->tape_state == TS_BLKUSE)
+				break;
+			if (device->tape_state != TS_IN_USE)
+				return -ENODEV;
+	}
 
 	/* Increase use count of device for the added request. */
-	atomic_inc(&device->ref_count);
-	request->device = device;
+	request->device = tape_get_device_reference(device);
 
 	if (list_empty(&device->req_queue)) {
 		/* No other requests are on the queue. Start this one. */
@@ -534,9 +718,11 @@
 			DBF_EVENT(1, "tape: DOIO failed with rc = %i\n", rc);
 			return rc;
 		}
+		DBF_LH(5, "Request %p added for execution.\n", request);
 		list_add(&request->list, &device->req_queue);
 		request->status = TAPE_REQUEST_IN_IO;
 	} else {
+		DBF_LH(5, "Request %p add to queue.\n", request);
 		list_add_tail(&request->list, &device->req_queue);
 		request->status = TAPE_REQUEST_QUEUED;
 	}
@@ -552,6 +738,8 @@
 {
 	int rc;
 
+	DBF_LH(6, "tape_do_io_async(%p, %p)\n", device, request);
+
 	spin_lock_irq(get_ccwdev_lock(device->cdev));
 	/* Add request to request queue and try to start it. */
 	rc = __tape_do_io(device, request);
@@ -637,48 +825,11 @@
 	return rc;
 }
 
-static inline void
-__tape_do_io_list(struct tape_device *device)
-{
-	struct list_head *l, *n;
-	struct tape_request *request;
-	int rc;
-
-	if (device->tape_state != TS_IN_USE)
-		return;
-	/*
-	 * Try to start each request on request queue until one is
-	 * started successful.
-	 */
-	list_for_each_safe(l, n, &device->req_queue) {
-		request = list_entry(l, struct tape_request, list);
-#ifdef CONFIG_S390_TAPE_BLOCK
-		if (request->op == TO_BLOCK)
-			device->discipline->check_locate(device, request);
-#endif
-		rc = ccw_device_start(device->cdev, request->cpaddr,
-				      (unsigned long) request, 0x00,
-				      request->options);
-		if (rc == 0) {
-			request->status = TAPE_REQUEST_IN_IO;
-			break;
-		}
-		/* Start failed. Remove request and indicate failure. */
-		DBF_EVENT(1, "tape: DOIO failed with er = %i\n", rc);
-		list_del(&request->list);
-		/* Set ending status and do callback. */
-		request->rc = rc;
-		request->status = TAPE_REQUEST_DONE;
-		if (request->callback != NULL)
-			request->callback(request, request->callback_data);
-	}
-}
-
 /*
  * Tape interrupt routine, called from the ccw_device layer
  */
 static void
-tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
+__tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
 {
 	struct tape_device *device;
 	struct tape_request *request;
@@ -693,11 +844,13 @@
 	}
 	request = (struct tape_request *) intparm;
 
+	DBF_LH(6, "__tape_do_irq(device=%p, request=%p)\n", device, request);
+
 	/* May be an unsolicited irq */
 	if(request != NULL)
 		request->rescnt = irb->scsw.count;
 
-	if (irb->scsw.dstat != 0x0c){
+	if (irb->scsw.dstat != 0x0c) {
 		/* Set the 'ONLINE' flag depending on sense byte 1 */
 		if(*(((__u8 *) irb->ecw) + 1) & SENSE_DRIVE_ONLINE)
 			device->tape_generic_status |= GMT_ONLINE(~0);
@@ -718,6 +871,16 @@
 		DBF_EVENT(6, "tape:device is not operational\n");
 		return;
 	}
+
+	/*
+	 * Request that were canceled still come back with an interrupt.
+	 * To detect these request the state will be set to TAPE_REQUEST_DONE.
+	 */
+	if(request != NULL && request->status == TAPE_REQUEST_DONE) {
+		__tape_remove_request(device, request);
+		return;
+	}
+
 	rc = device->discipline->irq(device, request, irb);
 	/*
 	 * rc < 0 : request finished unsuccessfully.
@@ -729,6 +892,8 @@
 	final = 0;
 	switch (rc) {
 	case TAPE_IO_SUCCESS:
+		/* Upon normal completion the device _is_ online */
+		device->tape_generic_status |= GMT_ONLINE(~0);
 		final = 1;
 		break;
 	case TAPE_IO_PENDING:
@@ -748,8 +913,6 @@
 		break;
 	case TAPE_IO_STOP:
 		__tape_halt_io(device, request);
-		rc = -EIO;
-		final = 1;
 		break;
 	default:
 		if (rc > 0) {
@@ -767,59 +930,11 @@
 			/* Set ending status. */
 			request->rc = rc;
 			request->status = TAPE_REQUEST_DONE;
-			/* Remove from request queue. */
-			list_del(&request->list);
-			/* Do callback. */
-			if (request->callback != NULL)
-				request->callback(request, request->callback_data);
+			__tape_remove_request(device, request);
+		} else {
+			__tape_do_io_list(device);
 		}
-		/* Start next request. */
-		__tape_do_io_list(device);
-	}
-}
-
-/*
- * Lock a shared tape for our exclusive use.
- */
-int
-tape_assign(struct tape_device *device)
-{
-	int rc;
-
-	rc = device->discipline->assign(device);
-	if (rc) {
-		PRINT_WARN("(%s): assign failed - device might be busy\n",
-			   device->cdev->dev.bus_id);
-		DBF_EVENT(3, "(%s): assign failed - device might be busy\n",
-			  device->cdev->dev.bus_id);
-		return rc;
-	}
-	DBF_EVENT(3, "(%s): assign lpum = %02x\n",
-		  device->cdev->dev.bus_id, 
-		  0 /* FIXME: device->devstat.lpum */ );
-	return 0;
-}
-
-/*
- * Unlock a shared tape.
- */
-int
-tape_unassign(struct tape_device *device)
-{
-	int rc;
-
-	rc = device->discipline->unassign(device);
-	if (rc) {
-		PRINT_WARN("(%s): unassign failed\n",
-			   device->cdev->dev.bus_id);
-		DBF_EVENT(3, "(%s): unassign failed\n",
-			  device->cdev->dev.bus_id);
-		return rc;
 	}
-	DBF_EVENT(3, "(%s): unassign lpum = %02x\n",
-		  device->cdev->dev.bus_id,
-		  0 /* FIXME: device->devstat.lpum */ );
-	return 0;
 }
 
 /*
@@ -837,6 +952,9 @@
 	} else if (device->tape_state == TS_IN_USE) {
 		DBF_EVENT(6, "TAPE:dbusy\n");
 		rc = -EBUSY;
+	} else if (device->tape_state == TS_BLKUSE) {
+		DBF_EVENT(6, "TAPE:dbusy\n");
+		rc = -EBUSY;
 	} else if (device->discipline != NULL &&
 		   !try_module_get(device->discipline->owner)) {
 		DBF_EVENT(6, "TAPE:nodisc\n");
@@ -884,7 +1002,7 @@
 
 	/* We assume that the backends can handle count up to 500. */
 	if (mt_op == MTBSR  || mt_op == MTFSR  || mt_op == MTFSF  ||
-	    mt_op == MTBSR  || mt_op == MTFSFM || mt_op == MTBSFM) {
+	    mt_op == MTBSF  || mt_op == MTFSFM || mt_op == MTBSFM) {
 		rc = 0;
 		for (; mt_count > 500; mt_count -= 500)
 			if ((rc = fn(device, 500)) != 0)
@@ -898,14 +1016,74 @@
 }
 
 /*
+ * Hutplug event support.
+ */
+void
+tape_hotplug_event(struct tape_device *device, int devmaj, int action) {
+#ifdef CONFIG_HOTPLUG
+	char *argv[3];
+	char *envp[8];
+	char  busid[20];
+	char  major[20];
+	char  minor[20];
+
+	/* Call the busid DEVNO to be compatible with old tape.agent. */
+	sprintf(busid, "DEVNO=%s",   device->cdev->dev.bus_id);
+	sprintf(major, "MAJOR=%d",   devmaj);
+	sprintf(minor, "MINOR=%d",   device->first_minor);
+
+	argv[0] = hotplug_path;
+	argv[1] = "tape";
+	argv[2] = NULL;
+
+	envp[0] = "HOME=/";
+	envp[1] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
+
+	switch (action) {
+		case TAPE_HOTPLUG_CHAR_ADD:
+		case TAPE_HOTPLUG_BLOCK_ADD:
+			envp[2] = "ACTION=add";
+			break;
+		case TAPE_HOTPLUG_CHAR_REMOVE:
+		case TAPE_HOTPLUG_BLOCK_REMOVE:
+			envp[2] = "ACTION=remove";
+			break;
+		default:
+			BUG();
+	}
+	switch (action) {
+		case TAPE_HOTPLUG_CHAR_ADD:
+		case TAPE_HOTPLUG_CHAR_REMOVE:
+			envp[3] = "INTERFACE=char";
+			break;
+		case TAPE_HOTPLUG_BLOCK_ADD:
+		case TAPE_HOTPLUG_BLOCK_REMOVE:
+			envp[3] = "INTERFACE=block";
+			break;
+		default:
+			BUG();
+	}
+	envp[4] = busid;
+	envp[5] = major;
+	envp[6] = minor;
+	envp[7] = NULL;
+
+	call_usermodehelper(argv[0], argv, envp, 0);
+#endif
+}
+
+/*
  * Tape init function.
  */
 static int
 tape_init (void)
 {
-	tape_dbf_area = debug_register ( "tape", 1, 2, 3*sizeof(long));
+	tape_dbf_area = debug_register ( "tape", 1, 2, 4*sizeof(long));
 	debug_register_view(tape_dbf_area, &debug_sprintf_view);
-	DBF_EVENT(3, "tape init: ($Revision: 1.26 $)\n");
+#ifdef DBF_LIKE_HELL
+	debug_set_level(tape_dbf_area, 6);
+#endif
+	DBF_EVENT(3, "tape init: ($Revision: 1.41 $)\n");
 	tape_proc_init();
 	tapechar_init ();
 	tapeblock_init ();
@@ -930,7 +1108,8 @@
 MODULE_AUTHOR("(C) 2001 IBM Deutschland Entwicklung GmbH by Carsten Otte and "
 	      "Michael Holzheu (cotte@de.ibm.com,holzheu@de.ibm.com)");
 MODULE_DESCRIPTION("Linux on zSeries channel attached "
-		   "tape device driver ($Revision: 1.26 $)");
+		   "tape device driver ($Revision: 1.41 $)");
+MODULE_LICENSE("GPL");
 
 module_init(tape_init);
 module_exit(tape_exit);
@@ -941,6 +1120,7 @@
 EXPORT_SYMBOL(tape_generic_probe);
 EXPORT_SYMBOL(tape_enable_device);
 EXPORT_SYMBOL(tape_put_device);
+EXPORT_SYMBOL(tape_get_device_reference);
 EXPORT_SYMBOL(tape_state_verbose);
 EXPORT_SYMBOL(tape_op_verbose);
 EXPORT_SYMBOL(tape_state_set);
diff -Nru a/drivers/s390/char/tape_proc.c b/drivers/s390/char/tape_proc.c
--- a/drivers/s390/char/tape_proc.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/char/tape_proc.c	Tue Feb  3 19:45:17 2004
@@ -18,7 +18,7 @@
 
 #include "tape.h"
 
-#define PRINTK_HEADER "T390:"
+#define PRINTK_HEADER "TAPE_PROC: "
 
 static const char *tape_med_st_verbose[MS_SIZE] =
 {
@@ -42,19 +42,19 @@
 
 	n = (unsigned long) v - 1;
 	if (!n) {
-		seq_printf(m, "TapeNo\tDevNo\tCuType\tCuModel\tDevType\t"
-			   "DevMod\tBlkSize\tState\tOp\tMedState\n");
+		seq_printf(m, "TapeNo\tBusID      CuType/Model\t"
+			"DevType/Model\tBlkSize\tState\tOp\tMedState\n");
 	}
 	device = tape_get_device(n);
 	if (IS_ERR(device))
 		return 0;
 	spin_lock_irq(get_ccwdev_lock(device->cdev));
 	seq_printf(m, "%d\t", (int) n);
-	seq_printf(m, "%s\t", device->cdev->dev.bus_id);
-	seq_printf(m, "%04X\t", device->cdev->id.cu_type);
+	seq_printf(m, "%-10.10s ", device->cdev->dev.bus_id);
+	seq_printf(m, "%04X/", device->cdev->id.cu_type);
 	seq_printf(m, "%02X\t", device->cdev->id.cu_model);
-	seq_printf(m, "%04X\t", device->cdev->id.dev_type);
-	seq_printf(m, "%02X\t", device->cdev->id.dev_model);
+	seq_printf(m, "%04X/", device->cdev->id.dev_type);
+	seq_printf(m, "%02X\t\t", device->cdev->id.dev_model);
 	if (device->char_data.block_size == 0)
 		seq_printf(m, "auto\t");
 	else
diff -Nru a/drivers/s390/char/tape_std.c b/drivers/s390/char/tape_std.c
--- a/drivers/s390/char/tape_std.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/s390/char/tape_std.c	Tue Feb  3 19:45:16 2004
@@ -8,12 +8,14 @@
  *		 Michael Holzheu <holzheu@de.ibm.com>
  *		 Tuan Ngo-Anh <ngoanh@de.ibm.com>
  *		 Martin Schwidefsky <schwidefsky@de.ibm.com>
+ *		 Stefan Bader <shbader@de.ibm.com>
  */
 
 #include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/bio.h>
+#include <linux/timer.h>
 
 #include <asm/types.h>
 #include <asm/idals.h>
@@ -23,23 +25,72 @@
 #include "tape.h"
 #include "tape_std.h"
 
-#define PRINTK_HEADER "T3xxx:"
+#define PRINTK_HEADER "TAPE_STD: "
 
 /*
  * tape_std_assign
  */
+static void
+tape_std_assign_timeout(unsigned long data)
+{
+	struct tape_request *	request;
+	struct tape_device *	device;
+
+	request = (struct tape_request *) data;
+	if ((device = request->device) == NULL)
+		BUG();
+
+	spin_lock_irq(get_ccwdev_lock(device->cdev));
+	if (request->callback != NULL) {
+		DBF_EVENT(3, "%s: Assignment timeout. Device busy.\n",
+			device->cdev->dev.bus_id);
+		PRINT_ERR("%s: Assignment timeout. Device busy.\n",
+			device->cdev->dev.bus_id);
+		ccw_device_clear(device->cdev, (long) request);
+	}
+	spin_unlock_irq(get_ccwdev_lock(device->cdev));
+}
+
 int
 tape_std_assign(struct tape_device *device)
 {
+	int                  rc;
+	struct timer_list    timeout;
 	struct tape_request *request;
 
 	request = tape_alloc_request(2, 11);
 	if (IS_ERR(request))
 		return PTR_ERR(request);
+
 	request->op = TO_ASSIGN;
 	tape_ccw_cc(request->cpaddr, ASSIGN, 11, request->cpdata);
 	tape_ccw_end(request->cpaddr + 1, NOP, 0, NULL);
-	return tape_do_io_free(device, request);
+
+	/*
+	 * The assign command sometimes blocks if the device is assigned
+	 * to another host (actually this shouldn't happen but it does).
+	 * So we set up a timeout for this call.
+	 */
+	init_timer(&timeout);
+	timeout.function = tape_std_assign_timeout;
+	timeout.data     = (unsigned long) request;
+	timeout.expires  = jiffies + 2 * HZ;
+	add_timer(&timeout);
+
+	rc = tape_do_io_interruptible(device, request);
+
+	del_timer(&timeout);
+
+	if (rc != 0) {
+		PRINT_WARN("%s: assign failed - device might be busy\n",
+			device->cdev->dev.bus_id);
+		DBF_EVENT(3, "%s: assign failed - device might be busy\n",
+			device->cdev->dev.bus_id);
+	} else {
+		DBF_EVENT(3, "%s: Tape assigned\n", device->cdev->dev.bus_id);
+	}
+	tape_free_request(request);
+	return rc;
 }
 
 /*
@@ -48,30 +99,36 @@
 int
 tape_std_unassign (struct tape_device *device)
 {
+	int                  rc;
 	struct tape_request *request;
 
 	request = tape_alloc_request(2, 11);
 	if (IS_ERR(request))
 		return PTR_ERR(request);
+
 	request->op = TO_UNASSIGN;
 	tape_ccw_cc(request->cpaddr, UNASSIGN, 11, request->cpdata);
 	tape_ccw_end(request->cpaddr + 1, NOP, 0, NULL);
-	return tape_do_io_free(device, request);
+
+	if ((rc = tape_do_io(device, request)) != 0) {
+		DBF_EVENT(3, "%s: Unassign failed\n", device->cdev->dev.bus_id);
+		PRINT_WARN("%s: Unassign failed\n", device->cdev->dev.bus_id);
+	} else {
+		DBF_EVENT(3, "%s: Tape unassigned\n", device->cdev->dev.bus_id);
+	}
+	tape_free_request(request);
+	return rc;
 }
 
 /*
  * TAPE390_DISPLAY: Show a string on the tape display.
  */
 int
-tape_std_display(struct tape_device *device, int cmd, unsigned long arg)
+tape_std_display(struct tape_device *device, struct display_struct *disp)
 {
-	struct display_struct d_struct;
 	struct tape_request *request;
 	int rc;
 
-	if (copy_from_user(&d_struct, (char *) arg, sizeof(d_struct)) != 0)
-		return -EFAULT;
-
 	request = tape_alloc_request(2, 17);
 	if (IS_ERR(request)) {
 		DBF_EVENT(3, "TAPE: load display failed\n");
@@ -79,9 +136,10 @@
 	}
 	request->op = TO_DIS;
 
-	*(unsigned char *) request->cpdata = d_struct.cntrl;
-	memcpy(((unsigned char *) request->cpdata) + 1, d_struct.message1, 8);
-	memcpy(((unsigned char *) request->cpdata) + 9, d_struct.message2, 8);
+	*(unsigned char *) request->cpdata = disp->cntrl;
+	DBF_EVENT(5, "TAPE: display cntrl=%04x\n", disp->cntrl);
+	memcpy(((unsigned char *) request->cpdata) + 1, disp->message1, 8);
+	memcpy(((unsigned char *) request->cpdata) + 9, disp->message2, 8);
 	ASCEBC(((unsigned char*) request->cpdata) + 1, 16);
 
 	tape_ccw_cc(request->cpaddr, LOAD_DISPLAY, 17, request->cpdata);
@@ -118,6 +176,25 @@
 	return rc;
 }
 
+int
+tape_std_terminate_write(struct tape_device *device)
+{
+	int rc;
+
+	if(device->required_tapemarks == 0)
+		return 0;
+
+	DBF_LH(5, "tape%d: terminate write %dxEOF\n", device->first_minor,
+		device->required_tapemarks);
+
+	rc = tape_mtop(device, MTWEOF, device->required_tapemarks);
+	if (rc)
+		return rc;
+
+	device->required_tapemarks = 0;
+	return tape_mtop(device, MTBSR, 1);
+}
+
 /*
  * MTLOAD: Loads the tape.
  * The default implementation just wait until the tape medium state changes
@@ -138,6 +215,7 @@
 {
 	struct idal_buffer *new;
 
+	DBF_LH(6, "tape_std_mtsetblk(%d)\n", count);
 	if (count <= 0) {
 		/*
 		 * Just set block_size to 0. tapechar_read/tapechar_write
@@ -151,6 +229,15 @@
 	    device->char_data.idal_buf->size == count)
 		/* We already have a idal buffer of that size. */
 		return 0;
+
+	if (count > MAX_BLOCKSIZE) {
+		DBF_EVENT(3, "Invalid block size (%d > %d) given.\n",
+			count, MAX_BLOCKSIZE);
+		PRINT_ERR("Invalid block size (%d > %d) given.\n",
+			count, MAX_BLOCKSIZE);
+		return -EINVAL;
+	}
+
 	/* Allocate a new idal buffer. */
 	new = idal_buffer_alloc(count, 0);
 	if (new == NULL)
@@ -159,6 +246,9 @@
 		idal_buffer_free(device->char_data.idal_buf);
 	device->char_data.idal_buf = new;
 	device->char_data.block_size = count;
+
+	DBF_LH(6, "new blocksize is %d\n", device->char_data.block_size);
+
 	return 0;
 }
 
@@ -192,6 +282,7 @@
 			  device->modeset_byte);
 	ccw = tape_ccw_repeat(ccw, FORSPACEFILE, mt_count);
 	ccw = tape_ccw_end(ccw, NOP, 0, NULL);
+
 	/* execute it */
 	return tape_do_io_free(device, request);
 }
@@ -205,6 +296,7 @@
 {
 	struct tape_request *request;
 	struct ccw1 *ccw;
+	int rc;
 
 	request = tape_alloc_request(mt_count + 2, 0);
 	if (IS_ERR(request))
@@ -215,8 +307,16 @@
 			  device->modeset_byte);
 	ccw = tape_ccw_repeat(ccw, FORSPACEBLOCK, mt_count);
 	ccw = tape_ccw_end(ccw, NOP, 0, NULL);
+
 	/* execute it */
-	return tape_do_io_free(device, request);
+	rc = tape_do_io(device, request);
+	if (rc == 0 && request->rescnt > 0) {
+		DBF_LH(3, "FSR over tapemark\n");
+		rc = 1;
+	}
+	tape_free_request(request);
+
+	return rc;
 }
 
 /*
@@ -228,6 +328,7 @@
 {
 	struct tape_request *request;
 	struct ccw1 *ccw;
+	int rc;
 
 	request = tape_alloc_request(mt_count + 2, 0);
 	if (IS_ERR(request))
@@ -238,8 +339,16 @@
 			  device->modeset_byte);
 	ccw = tape_ccw_repeat(ccw, BACKSPACEBLOCK, mt_count);
 	ccw = tape_ccw_end(ccw, NOP, 0, NULL);
+
 	/* execute it */
-	return tape_do_io_free(device, request);
+	rc = tape_do_io(device, request);
+	if (rc == 0 && request->rescnt > 0) {
+		DBF_LH(3, "BSR over tapemark\n");
+		rc = 1;
+	}
+	tape_free_request(request);
+
+	return rc;
 }
 
 /*
@@ -260,6 +369,7 @@
 			  device->modeset_byte);
 	ccw = tape_ccw_repeat(ccw, WRITETAPEMARK, mt_count);
 	ccw = tape_ccw_end(ccw, NOP, 0, NULL);
+
 	/* execute it */
 	return tape_do_io_free(device, request);
 }
@@ -284,6 +394,7 @@
 			  device->modeset_byte);
 	ccw = tape_ccw_repeat(ccw, BACKSPACEFILE, mt_count);
 	ccw = tape_ccw_end(ccw, NOP, 0, NULL);
+
 	/* execute it */
 	return tape_do_io_free(device, request);
 }
@@ -309,18 +420,12 @@
 	ccw = tape_ccw_repeat(ccw, BACKSPACEFILE, mt_count);
 	ccw = tape_ccw_end(ccw, NOP, 0, NULL);
 	/* execute it */
-	rc = tape_do_io(device, request);
+	rc = tape_do_io_free(device, request);
 	if (rc == 0) {
-		request->op = TO_FSF;
-		/* need to skip forward over the filemark. */
-		tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1,
-			    device->modeset_byte);
-		tape_ccw_cc(request->cpaddr + 1, FORSPACEFILE, 0, NULL);
-		tape_ccw_end(request->cpaddr + 2, NOP, 0, NULL);
-		/* execute it */
-		rc = tape_do_io(device, request);
+		rc = tape_mtop(device, MTFSR, 1);
+		if (rc > 0)
+			rc = 0;
 	}
-	tape_free_request(request);
 	return rc;
 }
 
@@ -346,18 +451,13 @@
 	ccw = tape_ccw_repeat(ccw, FORSPACEFILE, mt_count);
 	ccw = tape_ccw_end(ccw, NOP, 0, NULL);
 	/* execute it */
-	rc = tape_do_io(device, request);
+	rc = tape_do_io_free(device, request);
 	if (rc == 0) {
-		request->op = TO_BSF;
-		/* need to skip forward over the filemark. */
-		tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1,
-			    device->modeset_byte);
-		tape_ccw_cc(request->cpaddr + 1, BACKSPACEFILE, 0, NULL);
-		tape_ccw_end(request->cpaddr + 2, NOP, 0, NULL);
-		/* execute it */
-		rc = tape_do_io(device, request);
+		rc = tape_mtop(device, MTBSR, 1);
+		if (rc > 0)
+			rc = 0;
 	}
-	tape_free_request(request);
+
 	return rc;
 }
 
@@ -378,6 +478,7 @@
 		    device->modeset_byte);
 	tape_ccw_cc(request->cpaddr + 1, REWIND, 0, NULL);
 	tape_ccw_end(request->cpaddr + 2, NOP, 0, NULL);
+
 	/* execute it */
 	return tape_do_io_free(device, request);
 }
@@ -399,6 +500,7 @@
 	tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte);
 	tape_ccw_cc(request->cpaddr + 1, REWIND_UNLOAD, 0, NULL);
 	tape_ccw_end(request->cpaddr + 2, NOP, 0, NULL);
+
 	/* execute it */
 	return tape_do_io_free(device, request);
 }
@@ -430,22 +532,28 @@
 int
 tape_std_mteom(struct tape_device *device, int mt_count)
 {
-	struct tape_request *request;
+	int rc;
 
-	request = tape_alloc_request(4, 0);
-	if (IS_ERR(request))
-		return PTR_ERR(request);
-	request->op = TO_FSF;
-	/* setup ccws */
-	tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte);
-	tape_ccw_cc(request->cpaddr + 1,FORSPACEFILE, 0, NULL);
-	tape_ccw_cc(request->cpaddr + 2, NOP, 0, NULL);
-	tape_ccw_end(request->cpaddr + 3, CCW_CMD_TIC, 0, request->cpaddr);
-	/* execute it */
-	tape_do_io_interruptible(device, request);
-	tape_free_request(request);
-	/* MTEOM/MTRETEN errors get ignored. */
-	return 0;
+	/*
+	 * Seek from the beginning of tape (rewind).
+	 */
+	if ((rc = tape_mtop(device, MTREW, 1)) < 0)
+		return rc;
+
+	/*
+	 * The logical end of volume is given by two sewuential tapemarks.
+	 * Look for this by skipping to the next file (over one tapemark)
+	 * and then test for another one (fsr returns 1 if a tapemark was
+	 * encountered).
+	 */
+	do {
+		if ((rc = tape_mtop(device, MTFSF, 1)) < 0)
+			return rc;
+		if ((rc = tape_mtop(device, MTFSR, 1)) < 0)
+			return rc;
+	} while (rc == 0);
+
+	return tape_mtop(device, MTBSR, 1);
 }
 
 /*
@@ -469,7 +577,7 @@
 	/* execute it, MTRETEN rc gets ignored */
 	rc = tape_do_io_interruptible(device, request);
 	tape_free_request(request);
-	return tape_std_mtrew(device, 1);
+	return tape_mtop(device, MTREW, 1);
 }
 
 /*
@@ -480,7 +588,7 @@
 {
 	struct tape_request *request;
 
-	request = tape_alloc_request(5, 0);
+	request = tape_alloc_request(6, 0);
 	if (IS_ERR(request))
 		return PTR_ERR(request);
 	request->op = TO_DSE;
@@ -489,7 +597,9 @@
 	tape_ccw_cc(request->cpaddr + 1, REWIND, 0, NULL);
 	tape_ccw_cc(request->cpaddr + 2, ERASE_GAP, 0, NULL);
 	tape_ccw_cc(request->cpaddr + 3, DATA_SEC_ERASE, 0, NULL);
-	tape_ccw_end(request->cpaddr + 4, NOP, 0, NULL);
+	tape_ccw_cc(request->cpaddr + 4, REWIND, 0, NULL);
+	tape_ccw_end(request->cpaddr + 5, NOP, 0, NULL);
+
 	/* execute it */
 	return tape_do_io_free(device, request);
 }
@@ -500,18 +610,7 @@
 int
 tape_std_mtunload(struct tape_device *device, int mt_count)
 {
-	struct tape_request *request;
-
-	request = tape_alloc_request(3, 32);
-	if (IS_ERR(request))
-		return PTR_ERR(request);
-	request->op = TO_RUN;
-	/* setup ccws */
-	tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte);
-	tape_ccw_cc(request->cpaddr + 1, REWIND_UNLOAD, 0, NULL);
-	tape_ccw_end(request->cpaddr + 2, SENSE, 32, request->cpdata);
-	/* execute it */
-	return tape_do_io_free(device, request);
+	return tape_mtop(device, MTOFFL, mt_count);
 }
 
 /*
diff -Nru a/drivers/s390/char/tape_std.h b/drivers/s390/char/tape_std.h
--- a/drivers/s390/char/tape_std.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/char/tape_std.h	Tue Feb  3 19:45:17 2004
@@ -10,9 +10,16 @@
  */
 
 #ifndef _TAPE_STD_H
-
 #define _TAPE_STD_H
 
+#include <asm/tape390.h>
+
+/*
+ * Biggest block size to handle. Currently 64K because we only build
+ * channel programs without data chaining.
+ */
+#define MAX_BLOCKSIZE   65535
+
 /*
  * The CCW commands for the Tape type of command.
  */
@@ -105,7 +112,8 @@
 int tape_std_assign(struct tape_device *);
 int tape_std_unassign(struct tape_device *);
 int tape_std_read_block_id(struct tape_device *device, __u64 *id);
-int tape_std_display(struct tape_device *, int, unsigned long);
+int tape_std_display(struct tape_device *, struct display_struct *disp);
+int tape_std_terminate_write(struct tape_device *);
 
 /* Standard magnetic tape commands. */
 int tape_std_mtbsf(struct tape_device *, int);
diff -Nru a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/s390/char/tty3270.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,1828 @@
+/*
+ *  drivers/s390/char/tty3270.c
+ *    IBM/3270 Driver - tty functions.
+ *
+ *  Author(s):
+ *    Original 3270 Code for 2.4 written by Richard Hitt (UTS Global)
+ *    Rewritten for 2.5 by Martin Schwidefsky <schwidefsky@de.ibm.com>
+ *	-- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kdev_t.h>
+#include <linux/tty.h>
+#include <linux/vt_kern.h>
+#include <linux/init.h>
+#include <linux/console.h>
+#include <linux/interrupt.h>
+
+#include <linux/slab.h>
+#include <linux/bootmem.h>
+
+#include <asm/ccwdev.h>
+#include <asm/cio.h>
+#include <asm/ebcdic.h>
+#include <asm/uaccess.h>
+
+
+#include "raw3270.h"
+#include "keyboard.h"
+
+#define TTY3270_CHAR_BUF_SIZE 256
+#define TTY3270_OUTPUT_BUFFER_SIZE 1024
+#define TTY3270_STRING_PAGES 5
+
+struct tty_driver *tty3270_driver;
+
+struct raw3270_fn tty3270_fn;
+
+struct tty3270_cell {
+	unsigned char character;
+	unsigned char highlight;
+	unsigned char f_color;
+};
+
+struct tty3270_line {
+	struct tty3270_cell *cells;
+	int len;
+};
+
+#define ESCAPE_NPAR 8
+
+/*
+ * The main tty view data structure.
+ * FIXME:
+ * 1) describe line orientation & lines list concept against screen
+ * 2) describe conversion of screen to lines
+ * 3) describe line format.
+ */
+struct tty3270 {
+	struct raw3270_view view;
+	struct tty_struct *tty;		/* Pointer to tty structure */
+	void **freemem_pages;		/* Array of pages used for freemem. */
+	struct list_head freemem;	/* List of free memory for strings. */
+
+	/* Output stuff. */
+	struct list_head lines;		/* List of lines. */
+	struct list_head update;	/* List of lines to update. */
+	unsigned char wcc;		/* Write control character. */
+	int nr_lines;			/* # lines in list. */
+	int nr_up;			/* # lines up in history. */
+	unsigned long update_flags;	/* Update indication bits. */
+	struct string *status;		/* Lower right of display. */
+	struct raw3270_request *write;	/* Single write request. */
+	struct timer_list timer;	/* Output delay timer. */
+
+	/* Current tty screen. */
+	unsigned int cx, cy;		/* Current output position. */
+	unsigned int highlight;		/* Blink/reverse/underscore */
+	unsigned int f_color;		/* Foreground color */
+	struct tty3270_line *screen;
+
+	/* Input stuff. */
+	struct string *prompt;		/* Output string for input area. */
+	struct string *input;		/* Input string for read request. */
+	struct raw3270_request *read;	/* Single read request. */
+	struct raw3270_request *kreset;	/* Single keyboard reset request. */
+	unsigned char inattr;		/* Visible/invisible input. */
+	int throttle, attn;		/* tty throttle/unthrottle. */
+	struct tasklet_struct readlet;	/* Tasklet to issue read request. */
+	struct kbd_data *kbd;		/* key_maps stuff. */
+
+	/* Escape sequence parsing. */
+	int esc_state, esc_ques, esc_npar;
+	int esc_par[ESCAPE_NPAR];
+	unsigned int saved_cx, saved_cy;
+	unsigned int saved_highlight, saved_f_color;
+
+	/* Command recalling. */
+	struct list_head rcl_lines;	/* List of recallable lines. */
+	struct list_head *rcl_walk;	/* Point in rcl_lines list. */
+	int rcl_nr, rcl_max;		/* Number/max number of rcl_lines. */
+
+	/* Character array for put_char/flush_chars. */
+	unsigned int char_count;
+	char char_buf[TTY3270_CHAR_BUF_SIZE];
+};
+
+/* tty3270->update_flags. See tty3270_update for details. */
+#define TTY_UPDATE_ERASE	1	/* Use EWRITEA instead of WRITE. */
+#define TTY_UPDATE_LIST		2	/* Update lines in tty3270->update. */
+#define TTY_UPDATE_INPUT	4	/* Update input line. */
+#define TTY_UPDATE_STATUS	8	/* Update status line. */
+#define TTY_UPDATE_ALL		15
+
+static void tty3270_update(struct tty3270 *);
+
+/*
+ * Setup timeout for a device. On timeout trigger an update.
+ */
+void
+tty3270_set_timer(struct tty3270 *tp, int expires)
+{
+	if (expires == 0) {
+		if (timer_pending(&tp->timer)) {
+			raw3270_put_view(&tp->view);
+			del_timer(&tp->timer);
+		}
+		return;
+	}
+	if (timer_pending(&tp->timer)) {
+		if (mod_timer(&tp->timer, jiffies + expires))
+			return;
+	}
+	raw3270_get_view(&tp->view);
+	tp->timer.function = (void (*)(unsigned long)) tty3270_update;
+	tp->timer.data = (unsigned long) tp;
+	tp->timer.expires = jiffies + expires;
+	add_timer(&tp->timer);
+}
+
+/*
+ * The input line are the two last lines of the screen.
+ */
+static void
+tty3270_update_prompt(struct tty3270 *tp, char *input, int count)
+{
+	struct string *line;
+	unsigned int off;
+
+	line = tp->prompt;
+	if (count != 0)
+		line->string[5] = TF_INMDT;
+	else
+		line->string[5] = tp->inattr;
+	if (count > tp->view.cols * 2 - 11)
+		count = tp->view.cols * 2 - 11;
+	memcpy(line->string + 6, input, count);
+	line->string[6 + count] = TO_IC;
+	/* Clear to end of input line. */
+	if (count < tp->view.cols * 2 - 11) {
+		line->string[7 + count] = TO_RA;
+		line->string[10 + count] = 0;
+		off = tp->view.cols * tp->view.rows - 9;
+		raw3270_buffer_address(tp->view.dev, line->string+count+8, off);
+		line->len = 11 + count;
+	} else
+		line->len = 7 + count;
+	tp->update_flags |= TTY_UPDATE_INPUT;
+}
+
+static void
+tty3270_create_prompt(struct tty3270 *tp)
+{
+	static const unsigned char blueprint[] =
+		{ TO_SBA, 0, 0, 0x6e, TO_SF, TF_INPUT,
+		  /* empty input string */
+		  TO_IC, TO_RA, 0, 0, 0 };
+	struct string *line;
+	unsigned int offset;
+
+	line = alloc_string(&tp->freemem,
+			    sizeof(blueprint) + tp->view.cols * 2 - 9);
+	tp->prompt = line;
+	tp->inattr = TF_INPUT;
+	/* Copy blueprint to status line */
+	memcpy(line->string, blueprint, sizeof(blueprint));
+	line->len = sizeof(blueprint);
+	/* Set output offsets. */
+	offset = tp->view.cols * (tp->view.rows - 2);
+	raw3270_buffer_address(tp->view.dev, line->string + 1, offset);
+	offset = tp->view.cols * tp->view.rows - 9;
+	raw3270_buffer_address(tp->view.dev, line->string + 8, offset);
+
+	/* Allocate input string for reading. */
+	tp->input = alloc_string(&tp->freemem, tp->view.cols * 2 - 9 + 6);
+}
+
+/*
+ * The status line is the last line of the screen. It shows the string
+ * "Running"/"Holding" in the lower right corner of the screen.
+ */
+static void
+tty3270_update_status(struct tty3270 * tp)
+{
+	char *str;
+
+	str = (tp->nr_up != 0) ? "History" : "Running";
+	memcpy(tp->status->string + 8, str, 7);
+	codepage_convert(tp->view.ascebc, tp->status->string + 8, 7);
+	tp->update_flags |= TTY_UPDATE_STATUS;
+}
+
+static void
+tty3270_create_status(struct tty3270 * tp)
+{
+	static const unsigned char blueprint[] =
+		{ TO_SBA, 0, 0, TO_SF, TF_LOG, TO_SA, TAT_COLOR, TAC_GREEN,
+		  0, 0, 0, 0, 0, 0, 0, TO_SF, TF_LOG, TO_SA, TAT_COLOR,
+		  TAC_RESET };
+	struct string *line;
+	unsigned int offset;
+
+	line = alloc_string(&tp->freemem,sizeof(blueprint));
+	tp->status = line;
+	/* Copy blueprint to status line */
+	memcpy(line->string, blueprint, sizeof(blueprint));
+	/* Set address to start of status string (= last 9 characters). */
+	offset = tp->view.cols * tp->view.rows - 9;
+	raw3270_buffer_address(tp->view.dev, line->string + 1, offset);
+}
+
+/*
+ * Set output offsets to 3270 datastream fragment of a tty string.
+ * (TO_SBA offset at the start and TO_RA offset at the end of the string)
+ */
+static void
+tty3270_update_string(struct tty3270 *tp, struct string *line, int nr)
+{
+	unsigned char *cp;
+
+	raw3270_buffer_address(tp->view.dev, line->string + 1,
+			       tp->view.cols * nr);
+	cp = line->string + line->len - 4;
+	if (*cp == TO_RA)
+		raw3270_buffer_address(tp->view.dev, cp + 1,
+				       tp->view.cols * (nr + 1));
+}
+
+/*
+ * Rebuild update list to print all lines.
+ */
+static void
+tty3270_rebuild_update(struct tty3270 *tp)
+{
+	struct string *s, *n;
+	int line, nr_up;
+
+	/* 
+	 * Throw away update list and create a new one,
+	 * containing all lines that will fit on the screen.
+	 */
+	list_for_each_entry_safe(s, n, &tp->update, update)
+		list_del_init(&s->update);
+	line = tp->view.rows - 3;
+	nr_up = tp->nr_up;
+	list_for_each_entry_reverse(s, &tp->lines, list) {
+		if (nr_up > 0) {
+			nr_up--;
+			continue;
+		}
+		tty3270_update_string(tp, s, line);
+		list_add(&s->update, &tp->update);
+		if (--line < 0)
+			break;
+	}
+	tp->update_flags |= TTY_UPDATE_LIST;
+}
+
+/*
+ * Alloc string for size bytes. If there is not enough room in
+ * freemem, free strings until there is room.
+ */
+static struct string *
+tty3270_alloc_string(struct tty3270 *tp, size_t size)
+{
+	struct string *s, *n;
+
+	s = alloc_string(&tp->freemem, size);
+	if (s)
+		return s;
+	list_for_each_entry_safe(s, n, &tp->lines, list) {
+		BUG_ON(tp->nr_lines <= tp->view.rows - 2);
+		list_del(&s->list);
+		if (!list_empty(&s->update))
+			list_del(&s->update);
+		tp->nr_lines--;
+		if (free_string(&tp->freemem, s) >= size)
+			break;
+	}
+	s = alloc_string(&tp->freemem, size);
+	BUG_ON(!s);
+	if (tp->nr_up != 0 &&
+	    tp->nr_up + tp->view.rows - 2 >= tp->nr_lines) {
+		tp->nr_up = tp->nr_lines - tp->view.rows + 2;
+		tty3270_rebuild_update(tp);
+		tty3270_update_status(tp);
+	}
+	return s;
+}
+
+/*
+ * Add an empty line to the list.
+ */
+static void
+tty3270_blank_line(struct tty3270 *tp)
+{
+	static const unsigned char blueprint[] =
+		{ TO_SBA, 0, 0, TO_SA, TAT_EXTHI, TAX_RESET,
+		  TO_SA, TAT_COLOR, TAC_RESET, TO_RA, 0, 0, 0 };
+	struct string *s;
+
+	s = tty3270_alloc_string(tp, sizeof(blueprint));
+	memcpy(s->string, blueprint, sizeof(blueprint));
+	s->len = sizeof(blueprint);
+	list_add_tail(&s->list, &tp->lines);
+	tp->nr_lines++;
+	if (tp->nr_up != 0)
+		tp->nr_up++;
+}
+
+/*
+ * Write request completion callback.
+ */
+static void
+tty3270_write_callback(struct raw3270_request *rq, void *data)
+{
+	struct tty3270 *tp;
+
+	tp = (struct tty3270 *) rq->view;
+	if (rq->rc != 0) {
+		/* Write wasn't successfull. Refresh all. */
+		tty3270_rebuild_update(tp);
+		tp->update_flags = TTY_UPDATE_ALL;
+		tty3270_set_timer(tp, 1);
+	}
+	raw3270_request_reset(rq);
+	xchg(&tp->write, rq);
+}
+
+/*
+ * Update 3270 display.
+ */
+static void
+tty3270_update(struct tty3270 *tp)
+{
+	static char invalid_sba[2] = { 0xff, 0xff };
+	struct raw3270_request *wrq;
+	unsigned long updated;
+	struct string *s, *n;
+	char *sba, *str;
+	int rc, len;
+
+	wrq = xchg(&tp->write, 0);
+	if (!wrq) {
+		tty3270_set_timer(tp, 1);
+		return;
+	}
+
+	spin_lock(&tp->view.lock);
+	updated = 0;
+	if (tp->update_flags & TTY_UPDATE_ERASE) {
+		/* Use erase write alternate to erase display. */
+		raw3270_request_set_cmd(wrq, TC_EWRITEA);
+		updated |= TTY_UPDATE_ERASE;
+	} else
+		raw3270_request_set_cmd(wrq, TC_WRITE);
+
+	raw3270_request_add_data(wrq, &tp->wcc, 1);
+	tp->wcc = TW_NONE;
+
+	/*
+	 * Update status line.
+	 */
+	if (tp->update_flags & TTY_UPDATE_STATUS)
+		if (raw3270_request_add_data(wrq, tp->status->string,
+					     tp->status->len) == 0)
+			updated |= TTY_UPDATE_STATUS;
+
+	/*
+	 * Write input line.
+	 */
+	if (tp->update_flags & TTY_UPDATE_INPUT)
+		if (raw3270_request_add_data(wrq, tp->prompt->string,
+					     tp->prompt->len) == 0)
+			updated |= TTY_UPDATE_INPUT;
+
+	sba = invalid_sba;
+	
+	if (tp->update_flags & TTY_UPDATE_LIST) {
+		/* Write strings in the update list to the screen. */
+		list_for_each_entry_safe(s, n, &tp->update, update) {
+			str = s->string;
+			len = s->len;
+			/*
+			 * Skip TO_SBA at the start of the string if the
+			 * last output position matches the start address
+			 * of this line.
+			 */
+			if (s->string[1] == sba[0] && s->string[2] == sba[1])
+				str += 3, len -= 3;
+			if (raw3270_request_add_data(wrq, str, len) != 0)
+				break;
+			list_del_init(&s->update);
+			sba = s->string + s->len - 3;
+		}
+		if (list_empty(&tp->update))
+			updated |= TTY_UPDATE_LIST;
+	}
+	wrq->callback = tty3270_write_callback;
+	rc = raw3270_start(&tp->view, wrq);
+	if (rc == 0) {
+		tp->update_flags &= ~updated;
+		if (tp->update_flags)
+			tty3270_set_timer(tp, 1);
+	} else {
+		raw3270_request_reset(wrq);
+		xchg(&tp->write, wrq);
+	}
+	spin_unlock(&tp->view.lock);
+	raw3270_put_view(&tp->view);
+}
+
+/*
+ * Command recalling.
+ */
+static void
+tty3270_rcl_add(struct tty3270 *tp, char *input, int len)
+{
+	struct string *s;
+
+	tp->rcl_walk = 0;
+	if (len <= 0)
+		return;
+	if (tp->rcl_nr >= tp->rcl_max) {
+		s = list_entry(tp->rcl_lines.next, struct string, list);
+		list_del(&s->list);
+		free_string(&tp->freemem, s);
+		tp->rcl_nr--;
+	}
+	s = tty3270_alloc_string(tp, len);
+	memcpy(s->string, input, len);
+	list_add_tail(&s->list, &tp->rcl_lines);
+	tp->rcl_nr++;
+}
+
+static void
+tty3270_rcl_backward(struct kbd_data *kbd)
+{
+	struct tty3270 *tp;
+	struct string *s;
+
+	tp = kbd->tty->driver_data;
+	spin_lock_bh(&tp->view.lock);
+	if (tp->inattr == TF_INPUT) {
+		if (tp->rcl_walk && tp->rcl_walk->prev != &tp->rcl_lines)
+			tp->rcl_walk = tp->rcl_walk->prev;
+		else if (!list_empty(&tp->rcl_lines))
+			tp->rcl_walk = tp->rcl_lines.prev;
+		s = tp->rcl_walk ? 
+			list_entry(tp->rcl_walk, struct string, list) : 0;
+		if (tp->rcl_walk) {
+			s = list_entry(tp->rcl_walk, struct string, list);
+			tty3270_update_prompt(tp, s->string, s->len);
+		} else
+			tty3270_update_prompt(tp, 0, 0);
+		tty3270_set_timer(tp, 1);
+	}
+	spin_unlock_bh(&tp->view.lock);
+}
+
+/*
+ * Deactivate tty view.
+ */
+static void
+tty3270_exit_tty(struct kbd_data *kbd)
+{
+	struct tty3270 *tp;
+
+	tp = kbd->tty->driver_data;
+	raw3270_deactivate_view(&tp->view);
+}
+
+/*
+ * Scroll forward in history.
+ */
+static void
+tty3270_scroll_forward(struct kbd_data *kbd)
+{
+	struct tty3270 *tp;
+	int nr_up;
+
+	tp = kbd->tty->driver_data;
+	spin_lock_bh(&tp->view.lock);
+	nr_up = tp->nr_up - tp->view.rows + 2;
+	if (nr_up < 0)
+		nr_up = 0;
+	if (nr_up != tp->nr_up) {
+		tp->nr_up = nr_up;
+		tty3270_rebuild_update(tp);
+		tty3270_update_status(tp);
+		tty3270_set_timer(tp, 1);
+	}
+	spin_unlock_bh(&tp->view.lock);
+}
+
+/*
+ * Scroll backward in history.
+ */
+static void
+tty3270_scroll_backward(struct kbd_data *kbd)
+{
+	struct tty3270 *tp;
+	int nr_up;
+
+	tp = kbd->tty->driver_data;
+	spin_lock_bh(&tp->view.lock);
+	nr_up = tp->nr_up + tp->view.rows - 2;
+	if (nr_up + tp->view.rows - 2 > tp->nr_lines)
+		nr_up = tp->nr_lines - tp->view.rows + 2;
+	if (nr_up != tp->nr_up) {
+		tp->nr_up = nr_up;
+		tty3270_rebuild_update(tp);
+		tty3270_update_status(tp);
+		tty3270_set_timer(tp, 1);
+	}
+	spin_unlock_bh(&tp->view.lock);
+}
+
+/*
+ * Pass input line to tty.
+ */
+static void
+tty3270_read_tasklet(struct raw3270_request *rrq)
+{
+	static char kreset_data = TW_KR;
+	struct tty3270 *tp;
+	char *input;
+	int len;
+
+	tp = (struct tty3270 *) rrq->view;
+	spin_lock_bh(&tp->view.lock);
+	/*
+	 * Two AID keys are special: For 0x7d (enter) the input line
+	 * has to be emitted to the tty and for 0x6d the screen
+	 * needs to be redrawn.
+	 */
+	input = 0;
+	len = 0;
+	if (tp->input->string[0] == 0x7d) {
+		/* Enter: write input to tty. */
+		input = tp->input->string + 6;
+		len = tp->input->len - 6 - rrq->rescnt;
+		if (tp->inattr != TF_INPUTN)
+			tty3270_rcl_add(tp, input, len);
+		if (tp->nr_up > 0) {
+			tp->nr_up = 0;
+			tty3270_rebuild_update(tp);
+			tty3270_update_status(tp);
+		}
+		/* Clear input area. */
+		tty3270_update_prompt(tp, 0, 0);
+		tty3270_set_timer(tp, 1);
+	} else if (tp->input->string[0] == 0x6d) {
+		/* Display has been cleared. Redraw. */
+		tty3270_rebuild_update(tp);
+		tp->update_flags = TTY_UPDATE_ALL;
+		tty3270_set_timer(tp, 1);
+	}
+	spin_unlock_bh(&tp->view.lock);
+
+	/* Start keyboard reset command. */
+	raw3270_request_reset(tp->kreset);
+	raw3270_request_set_cmd(tp->kreset, TC_WRITE);
+	raw3270_request_add_data(tp->kreset, &kreset_data, 1);
+	raw3270_start(&tp->view, tp->kreset);
+
+	/* Emit input string. */
+	if (tp->tty) {
+		while (len-- > 0)
+			kbd_keycode(tp->kbd, *input++);
+		/* Emit keycode for AID byte. */
+		kbd_keycode(tp->kbd, 256 + tp->input->string[0]);
+	}
+
+	raw3270_request_reset(rrq);
+	xchg(&tp->read, rrq);
+	raw3270_put_view(&tp->view);
+}
+
+/*
+ * Read request completion callback.
+ */
+static void
+tty3270_read_callback(struct raw3270_request *rq, void *data)
+{
+	raw3270_get_view(rq->view);
+	/* Schedule tasklet to pass input to tty. */
+	tasklet_schedule(&((struct tty3270 *) rq->view)->readlet);
+}
+
+/*
+ * Issue a read request. Call with device lock.
+ */
+static void
+tty3270_issue_read(struct tty3270 *tp, int lock)
+{
+	struct raw3270_request *rrq;
+	int rc;
+
+	rrq = xchg(&tp->read, 0);
+	if (!rrq)
+		/* Read already scheduled. */
+		return;
+	rrq->callback = tty3270_read_callback;
+	rrq->callback_data = tp;
+	raw3270_request_set_cmd(rrq, TC_READMOD);
+	raw3270_request_set_data(rrq, tp->input->string, tp->input->len);
+	/* Issue the read modified request. */
+	if (lock) {
+		rc = raw3270_start(&tp->view, rrq);
+	} else
+		rc = raw3270_start_irq(&tp->view, rrq);
+	if (rc) {
+		raw3270_request_reset(rrq);
+		xchg(&tp->read, rrq);
+	}
+}
+
+/*
+ * Switch to the tty view.
+ */
+static int
+tty3270_activate(struct raw3270_view *view)
+{
+	struct tty3270 *tp;
+	unsigned long flags;
+
+	tp = (struct tty3270 *) view;
+	spin_lock_irqsave(&tp->view.lock, flags);
+	tp->nr_up = 0;
+	tty3270_rebuild_update(tp);
+	tty3270_update_status(tp);
+	tp->update_flags = TTY_UPDATE_ALL;
+	tty3270_set_timer(tp, 1);
+	spin_unlock_irqrestore(&tp->view.lock, flags);
+	start_tty(tp->tty);
+	return 0;
+}
+
+static void
+tty3270_deactivate(struct raw3270_view *view)
+{
+	struct tty3270 *tp;
+
+	tp = (struct tty3270 *) view;
+	if (tp && tp->tty)
+		stop_tty(tp->tty);
+}
+
+static int
+tty3270_irq(struct tty3270 *tp, struct raw3270_request *rq, struct irb *irb)
+{
+	/* Handle ATTN. Schedule tasklet to read aid. */
+	if (irb->scsw.dstat & DEV_STAT_ATTENTION) {
+		if (!tp->throttle)
+			tty3270_issue_read(tp, 0);
+		else
+			tp->attn = 1;
+	}
+
+	if (rq) {
+		if (irb->scsw.dstat & DEV_STAT_UNIT_CHECK)
+			rq->rc = -EIO;
+		else
+			/* Normal end. Copy residual count. */
+			rq->rescnt = irb->scsw.count;
+	}
+	return RAW3270_IO_DONE;
+}
+
+/*
+ * Allocate tty3270 structure.
+ */
+static struct tty3270 *
+tty3270_alloc_view(void)
+{
+	struct tty3270 *tp;
+	int pages;
+
+	tp = kmalloc(sizeof(struct tty3270),GFP_KERNEL);
+	if (!tp)
+		goto out_err;
+	memset(tp, 0, sizeof(struct tty3270));
+	tp->freemem_pages =
+		kmalloc(sizeof(void *) * TTY3270_STRING_PAGES, GFP_KERNEL);
+	if (!tp->freemem_pages)
+		goto out_tp;
+	INIT_LIST_HEAD(&tp->freemem);
+	for (pages = 0; pages < TTY3270_STRING_PAGES; pages++) {
+		tp->freemem_pages[pages] = (void *)
+			__get_free_pages(GFP_KERNEL|GFP_DMA, 0);
+		if (!tp->freemem_pages[pages])
+			goto out_pages;
+		add_string_memory(&tp->freemem,
+				  tp->freemem_pages[pages], PAGE_SIZE);
+	}
+	tp->write = raw3270_request_alloc(TTY3270_OUTPUT_BUFFER_SIZE);
+	if (!tp->write)
+		goto out_pages;
+	tp->read = raw3270_request_alloc(0);
+	if (!tp->read)
+		goto out_write;
+	tp->kreset = raw3270_request_alloc(1);
+	if (!tp->kreset)
+		goto out_read;
+	tp->kbd = kbd_alloc();
+	if (!tp->kbd)
+		goto out_reset;
+	return tp;
+
+out_reset:
+	raw3270_request_free(tp->kreset);
+out_read:
+	raw3270_request_free(tp->read);
+out_write:
+	raw3270_request_free(tp->write);
+out_pages:
+	while (pages--)
+		free_pages((unsigned long) tp->freemem_pages[pages], 0);
+	kfree(tp->freemem_pages);
+out_tp:
+	kfree(tp);
+out_err:
+	return ERR_PTR(-ENOMEM);
+}
+
+/*
+ * Free tty3270 structure.
+ */
+static void
+tty3270_free_view(struct tty3270 *tp)
+{
+	int pages;
+
+	kbd_free(tp->kbd);
+	raw3270_request_free(tp->kreset);
+	raw3270_request_free(tp->read);
+	raw3270_request_free(tp->write);
+	for (pages = 0; pages < TTY3270_STRING_PAGES; pages++)
+		free_pages((unsigned long) tp->freemem_pages[pages], 0);
+	kfree(tp->freemem_pages);
+	kfree(tp);
+}
+
+/*
+ * Allocate tty3270 screen.
+ */
+static int
+tty3270_alloc_screen(struct tty3270 *tp)
+{
+	unsigned long size;
+	int lines;
+
+	size = sizeof(struct tty3270_line) * (tp->view.rows - 2);
+	tp->screen = kmalloc(size, GFP_KERNEL);
+	if (!tp->screen)
+		goto out_err;
+	memset(tp->screen, 0, size);
+	for (lines = 0; lines < tp->view.rows - 2; lines++) {
+		size = sizeof(struct tty3270_cell) * tp->view.cols;
+		tp->screen[lines].cells = kmalloc(size, GFP_KERNEL);
+		if (!tp->screen[lines].cells)
+			goto out_screen;
+		memset(tp->screen[lines].cells, 0, size);
+	}
+	return 0;
+out_screen:
+	while (lines--)
+		kfree(tp->screen[lines].cells);
+	kfree(tp->screen);
+out_err:
+	return -ENOMEM;
+}
+
+/*
+ * Free tty3270 screen.
+ */
+static void
+tty3270_free_screen(struct tty3270 *tp)
+{
+	int lines;
+
+	for (lines = 0; lines < tp->view.rows - 2; lines++)
+		kfree(tp->screen[lines].cells);
+	kfree(tp->screen);
+}
+
+/*
+ * Unlink tty3270 data structure from tty.
+ */
+static void
+tty3270_release(struct raw3270_view *view)
+{
+	struct tty3270 *tp;
+	struct tty_struct *tty;
+
+	tp = (struct tty3270 *) view;
+	tty = tp->tty;
+	if (tty) {
+		tty->driver_data = 0;
+		tp->tty = tp->kbd->tty = 0;
+		tty_hangup(tty);
+		raw3270_put_view(&tp->view);
+	}
+}
+
+/*
+ * Free tty3270 data structure
+ */
+static void
+tty3270_free(struct raw3270_view *view)
+{
+	tty3270_free_screen((struct tty3270 *) view);
+	tty3270_free_view((struct tty3270 *) view);
+}
+
+struct raw3270_fn tty3270_fn = {
+	.activate = tty3270_activate,
+	.deactivate = tty3270_deactivate,
+	.intv = (void *) tty3270_irq,
+	.release = tty3270_release,
+	.free = tty3270_free
+};
+
+/*
+ * This routine is called whenever a 3270 tty is opened.
+ */
+static int
+tty3270_open(struct tty_struct *tty, struct file * filp)
+{
+	struct tty3270 *tp;
+	int i, rc;
+
+	if (tty->count > 1)
+		return 0;
+	/* Check if the tty3270 is already there. */
+	tp = (struct tty3270 *) raw3270_find_view(&tty3270_fn, tty->index);
+	if (!IS_ERR(tp)) {
+		tty->driver_data = tp;
+		tty->winsize.ws_row = tp->view.rows - 2;
+		tty->winsize.ws_col = tp->view.cols;
+		tty->low_latency = 0;
+		tp->tty = tty;
+		tp->kbd->tty = tty;
+		tp->inattr = TF_INPUT;
+		return 0;
+	}
+
+	/* Allocate tty3270 structure on first open. */
+	tp = tty3270_alloc_view();
+	if (IS_ERR(tp))
+		return PTR_ERR(tp);
+
+	INIT_LIST_HEAD(&tp->lines);
+	INIT_LIST_HEAD(&tp->update);
+	INIT_LIST_HEAD(&tp->rcl_lines);
+	tp->rcl_max = 20;
+	init_timer(&tp->timer);
+	tasklet_init(&tp->readlet, 
+		     (void (*)(unsigned long)) tty3270_read_tasklet,
+		     (unsigned long) tp->read);
+
+	rc = raw3270_add_view(&tp->view, &tty3270_fn, tty->index);
+	if (rc) {
+		tty3270_free_view(tp);
+		return rc;
+	}
+
+	rc = tty3270_alloc_screen(tp);
+	if (rc) {
+		raw3270_del_view(&tp->view);
+		raw3270_put_view(&tp->view);
+		return rc;
+	}
+
+	tp->tty = tty;
+	tty->low_latency = 0;
+	tty->driver_data = tp;
+	tty->winsize.ws_row = tp->view.rows - 2;
+	tty->winsize.ws_col = tp->view.cols;
+
+	tty3270_create_prompt(tp);
+	tty3270_create_status(tp);
+	tty3270_update_status(tp);
+
+	/* Create blank line for every line in the tty output area. */
+	for (i = 0; i < tp->view.rows - 2; i++)
+		tty3270_blank_line(tp);
+
+	tp->kbd->tty = tty;
+	tp->kbd->fn_handler[KVAL(K_INCRCONSOLE)] = tty3270_exit_tty;
+	tp->kbd->fn_handler[KVAL(K_SCROLLBACK)] = tty3270_scroll_backward;
+	tp->kbd->fn_handler[KVAL(K_SCROLLFORW)] = tty3270_scroll_forward;
+	tp->kbd->fn_handler[KVAL(K_CONS)] = tty3270_rcl_backward;
+	kbd_ascebc(tp->kbd, tp->view.ascebc);
+
+	raw3270_activate_view(&tp->view);
+	return 0;
+}
+
+/*
+ * This routine is called when the 3270 tty is closed. We wait
+ * for the remaining request to be completed. Then we clean up.
+ */
+static void
+tty3270_close(struct tty_struct *tty, struct file * filp)
+{
+	struct tty3270 *tp;
+
+	if (tty->count > 1)
+		return;
+	tp = (struct tty3270 *) tty->driver_data;
+	if (tp) {
+		tty->driver_data = 0;
+		tp->tty = tp->kbd->tty = 0;
+		raw3270_put_view(&tp->view);
+	}
+}
+
+/*
+ * We always have room.
+ */
+static int
+tty3270_write_room(struct tty_struct *tty)
+{
+	return INT_MAX;
+}
+
+/*
+ * Insert character into the screen at the current position with the
+ * current color and highlight. This function does NOT do cursor movement.
+ */
+static void
+tty3270_put_character(struct tty3270 *tp, char ch)
+{
+	struct tty3270_line *line;
+	struct tty3270_cell *cell;
+
+	line = tp->screen + tp->cy;
+	if (line->len <= tp->cx) {
+		while (line->len < tp->cx) {
+			cell = line->cells + line->len;
+			cell->character = tp->view.ascebc[' '];
+			cell->highlight = tp->highlight;
+			cell->f_color = tp->f_color;
+			line->len++;
+		}
+		line->len++;
+	}
+	cell = line->cells + tp->cx;
+	cell->character = tp->view.ascebc[(unsigned int) ch];
+	cell->highlight = tp->highlight;
+	cell->f_color = tp->f_color;
+}
+
+/*
+ * Convert a tty3270_line to a 3270 data fragment usable for output.
+ */
+static void
+tty3270_convert_line(struct tty3270 *tp, int line_nr)
+{
+	struct tty3270_line *line;
+	struct tty3270_cell *cell;
+	struct string *s, *n;
+	unsigned char highlight;
+	unsigned char f_color;
+	char *cp;
+	int flen, i;
+
+	/* Determine how long the fragment will be. */
+	flen = 3;		/* Prefix (TO_SBA). */
+	line = tp->screen + line_nr;
+	flen += line->len;
+	highlight = TAX_RESET;
+	f_color = TAC_RESET;
+	for (i = 0, cell = line->cells; i < line->len; i++, cell++) {
+		if (cell->highlight != highlight) {
+			flen += 3;	/* TO_SA to switch highlight. */
+			highlight = cell->highlight;
+		}
+		if (cell->f_color != f_color) {
+			flen += 3;	/* TO_SA to switch color. */
+			f_color = cell->f_color;
+		}
+	}
+	if (highlight != TAX_RESET)
+		flen += 3;	/* TO_SA to reset hightlight. */
+	if (f_color != TAC_RESET)
+		flen += 3;	/* TO_SA to reset color. */
+	if (line->len < tp->view.cols)
+		flen += 4;	/* Postfix (TO_RA). */
+
+	/* Find the line in the list. */
+	i = tp->view.rows - 2 - line_nr;
+	list_for_each_entry_reverse(s, &tp->lines, list)
+		if (--i <= 0)
+			break;
+	/*
+	 * Check if the line needs to get reallocated.
+	 */
+	if (s->len != flen) {
+		/* Reallocate string. */
+		n = tty3270_alloc_string(tp, flen);
+		list_add(&n->list, &s->list);
+		list_del_init(&s->list);
+		if (!list_empty(&s->update))
+			list_del_init(&s->update);
+		free_string(&tp->freemem, s);
+		s = n;
+	}
+
+	/* Write 3270 data fragment. */
+	cp = s->string;
+	*cp++ = TO_SBA;
+	*cp++ = 0;
+	*cp++ = 0;
+
+	highlight = TAX_RESET;
+	f_color = TAC_RESET;
+	for (i = 0, cell = line->cells; i < line->len; i++, cell++) {
+		if (cell->highlight != highlight) {
+			*cp++ = TO_SA;
+			*cp++ = TAT_EXTHI;
+			*cp++ = cell->highlight;
+			highlight = cell->highlight;
+		}
+		if (cell->f_color != f_color) {
+			*cp++ = TO_SA;
+			*cp++ = TAT_COLOR;
+			*cp++ = cell->f_color;
+			f_color = cell->f_color;
+		}
+		*cp++ = cell->character;
+	}
+	if (highlight != TAX_RESET) {
+		*cp++ = TO_SA;
+		*cp++ = TAT_EXTHI;
+		*cp++ = TAX_RESET;
+	}
+	if (f_color != TAC_RESET) {
+		*cp++ = TO_SA;
+		*cp++ = TAT_COLOR;
+		*cp++ = TAC_RESET;
+	}
+	if (line->len < tp->view.cols) {
+		*cp++ = TO_RA;
+		*cp++ = 0;
+		*cp++ = 0;
+		*cp++ = 0;
+	}
+
+	if (tp->nr_up + line_nr < tp->view.rows - 2) {
+		/* Line is currently visible on screen. */
+		tty3270_update_string(tp, s, line_nr);
+		/* Add line to update list. */
+		if (list_empty(&s->update)) {
+			list_add_tail(&s->update, &tp->update);
+			tp->update_flags |= TTY_UPDATE_LIST;
+		}
+	}
+}
+
+/*
+ * Do carriage return.
+ */
+static void
+tty3270_cr(struct tty3270 *tp)
+{
+	tp->cx = 0;
+}
+
+/*
+ * Do line feed.
+ */
+static void
+tty3270_lf(struct tty3270 *tp)
+{
+	struct tty3270_line temp;
+	int i;
+
+	tty3270_convert_line(tp, tp->cy);
+	if (tp->cy < tp->view.rows - 3) {
+		tp->cy++;
+		return;
+	}
+	/* Last line just filled up. Add new, blank line. */
+	tty3270_blank_line(tp);
+	temp = tp->screen[0];
+	temp.len = 0;
+	for (i = 0; i < tp->view.rows - 3; i++)
+		tp->screen[i] = tp->screen[i+1];
+	tp->screen[tp->view.rows - 3] = temp;
+	tty3270_rebuild_update(tp);
+}
+
+static void
+tty3270_ri(struct tty3270 *tp)
+{
+	if (tp->cy > 0) {
+	    tty3270_convert_line(tp, tp->cy);
+	    tp->cy--;
+	}
+}
+
+/*
+ * Insert characters at current position.
+ */
+static void
+tty3270_insert_characters(struct tty3270 *tp, int n)
+{
+	struct tty3270_line *line;
+	int k;
+
+	line = tp->screen + tp->cy;
+	while (line->len < tp->cx) {
+		line->cells[line->len].character = tp->view.ascebc[' '];
+		line->cells[line->len].highlight = TAX_RESET;
+		line->cells[line->len].f_color = TAC_RESET;
+		line->len++;
+	}
+	if (n > tp->view.cols - tp->cx)
+		n = tp->view.cols - tp->cx;
+	k = min_t(int, line->len - tp->cx, tp->view.cols - tp->cx - n);
+	while (k--)
+		line->cells[tp->cx + n + k] = line->cells[tp->cx + k];
+	line->len += n;
+	if (line->len > tp->view.cols)
+		line->len = tp->view.cols;
+	while (n-- > 0) {
+		line->cells[tp->cx + n].character = tp->view.ascebc[' '];
+		line->cells[tp->cx + n].highlight = tp->highlight;
+		line->cells[tp->cx + n].f_color = tp->f_color;
+	}
+}
+
+/*
+ * Delete characters at current position.
+ */
+static void
+tty3270_delete_characters(struct tty3270 *tp, int n)
+{
+	struct tty3270_line *line;
+	int i;
+
+	line = tp->screen + tp->cy;
+	if (line->len <= tp->cx)
+		return;
+	if (line->len - tp->cx <= n) {
+		line->len = tp->cx;
+		return;
+	}
+	for (i = tp->cx; i + n < line->len; i++)
+		line->cells[i] = line->cells[i + n];
+	line->len -= n;
+}
+
+/*
+ * Erase characters at current position.
+ */
+static void
+tty3270_erase_characters(struct tty3270 *tp, int n)
+{
+	struct tty3270_line *line;
+	struct tty3270_cell *cell;
+
+	line = tp->screen + tp->cy;
+	while (line->len > tp->cx && n-- > 0) {
+		cell = line->cells + tp->cx++;
+		cell->character = ' ';
+		cell->highlight = TAX_RESET;
+		cell->f_color = TAC_RESET;
+	}
+	tp->cx += n;
+	tp->cx = min_t(int, tp->cx, tp->view.cols - 1);
+}
+
+/*
+ * Erase line, 3 different cases:
+ *  Esc [ 0 K	Erase from current position to end of line inclusive
+ *  Esc [ 1 K	Erase from beginning of line to current position inclusive
+ *  Esc [ 2 K	Erase entire line (without moving cursor)
+ */
+static void
+tty3270_erase_line(struct tty3270 *tp, int mode)
+{
+	struct tty3270_line *line;
+	struct tty3270_cell *cell;
+	int i;
+
+	line = tp->screen + tp->cy;
+	if (mode == 0)
+		line->len = tp->cx;
+	else if (mode == 1) {
+		for (i = 0; i < tp->cx; i++) {
+			cell = line->cells + i;
+			cell->character = ' ';
+			cell->highlight = TAX_RESET;
+			cell->f_color = TAC_RESET;
+		}
+		if (line->len <= tp->cx)
+			line->len = tp->cx + 1;
+	} else if (mode == 2)
+		line->len = 0;
+	tty3270_convert_line(tp, tp->cy);
+}
+
+/*
+ * Erase display, 3 different cases:
+ *  Esc [ 0 J	Erase from current position to bottom of screen inclusive
+ *  Esc [ 1 J	Erase from top of screen to current position inclusive
+ *  Esc [ 2 J	Erase entire screen (without moving the cursor)
+ */
+static void
+tty3270_erase_display(struct tty3270 *tp, int mode)
+{
+	int i;
+
+	if (mode == 0) {
+		tty3270_erase_line(tp, 0);
+		for (i = tp->cy + 1; i < tp->view.rows - 2; i++) {
+			tp->screen[i].len = 0;
+			tty3270_convert_line(tp, i);
+		}
+	} else if (mode == 1) {
+		for (i = 0; i < tp->cy; i++) {
+			tp->screen[i].len = 0;
+			tty3270_convert_line(tp, i);
+		}
+		tty3270_erase_line(tp, 1);
+	} else if (mode == 2) {
+		for (i = 0; i < tp->view.rows - 2; i++) {
+			tp->screen[i].len = 0;
+			tty3270_convert_line(tp, i);
+		}
+	}
+	tty3270_rebuild_update(tp);
+}
+
+/*
+ * Set attributes found in an escape sequence.
+ *  Esc [ <attr> ; <attr> ; ... m
+ */
+static void
+tty3270_set_attributes(struct tty3270 *tp)
+{
+	static unsigned char f_colors[] = {
+		TAC_DEFAULT, TAC_RED, TAC_GREEN, TAC_YELLOW, TAC_BLUE,
+		TAC_PINK, TAC_TURQ, TAC_WHITE, 0, TAC_DEFAULT
+	};
+	int i, attr;
+
+	for (i = 0; i <= tp->esc_npar; i++) {
+		attr = tp->esc_par[i];
+		switch (attr) {
+		case 0:		/* Reset */
+			tp->highlight = TAX_RESET;
+			tp->f_color = TAC_RESET;
+			break;
+		/* Highlight. */
+		case 4:		/* Start underlining. */
+			tp->highlight = TAX_UNDER;
+			break;
+		case 5:		/* Start blink. */
+			tp->highlight = TAX_BLINK;
+			break;
+		case 7:		/* Start reverse. */
+			tp->highlight = TAX_REVER;
+			break;
+		case 24:	/* End underlining */
+			if (tp->highlight == TAX_UNDER)
+				tp->highlight = TAX_RESET;
+			break;
+		case 25:	/* End blink. */
+			if (tp->highlight == TAX_BLINK)
+				tp->highlight = TAX_RESET;
+			break;
+		case 27:	/* End reverse. */
+			if (tp->highlight == TAX_REVER)
+				tp->highlight = TAX_RESET;
+			break;
+		/* Foreground color. */
+		case 30:	/* Black */
+		case 31:	/* Red */
+		case 32:	/* Green */
+		case 33:	/* Yellow */
+		case 34:	/* Blue */
+		case 35:	/* Magenta */
+		case 36:	/* Cyan */
+		case 37:	/* White */
+		case 39:	/* Black */
+			tp->f_color = f_colors[attr - 30];
+			break;
+		}
+	}
+}
+
+static inline int
+tty3270_getpar(struct tty3270 *tp, int ix)
+{
+	return (tp->esc_par[ix] > 0) ? tp->esc_par[ix] : 1;
+}
+
+static void
+tty3270_goto_xy(struct tty3270 *tp, int cx, int cy)
+{
+	tp->cx = min_t(int, tp->view.cols - 1, max_t(int, 0, cx));
+	cy = min_t(int, tp->view.rows - 3, max_t(int, 0, cy));
+	if (cy != tp->cy) {
+		tty3270_convert_line(tp, tp->cy);
+		tp->cy = cy;
+	}
+}
+
+/*
+ * Process escape sequences. Known sequences:
+ *  Esc 7			Save Cursor Position
+ *  Esc 8			Restore Cursor Position
+ *  Esc [ Pn ; Pn ; .. m	Set attributes
+ *  Esc [ Pn ; Pn H		Cursor Position
+ *  Esc [ Pn ; Pn f		Cursor Position
+ *  Esc [ Pn A			Cursor Up
+ *  Esc [ Pn B			Cursor Down
+ *  Esc [ Pn C			Cursor Forward
+ *  Esc [ Pn D			Cursor Backward
+ *  Esc [ Pn G			Cursor Horizontal Absolute
+ *  Esc [ Pn X			Erase Characters
+ *  Esc [ Ps J			Erase in Display
+ *  Esc [ Ps K			Erase in Line
+ * // FIXME: add all the new ones.
+ *
+ *  Pn is a numeric parameter, a string of zero or more decimal digits.
+ *  Ps is a selective parameter.
+ */
+static void
+tty3270_escape_sequence(struct tty3270 *tp, char ch)
+{
+	enum { ESnormal, ESesc, ESsquare, ESgetpars };
+
+	if (tp->esc_state == ESnormal) {
+		if (ch == 0x1b)
+			/* Starting new escape sequence. */
+			tp->esc_state = ESesc;
+		return;
+	}
+	if (tp->esc_state == ESesc) {
+		tp->esc_state = ESnormal;
+		switch (ch) {
+		case '[':
+			tp->esc_state = ESsquare;
+			break;
+		case 'E':
+			tty3270_cr(tp);
+			tty3270_lf(tp);
+			break;
+		case 'M':
+			tty3270_ri(tp);
+			break;
+		case 'D':
+			tty3270_lf(tp);
+			break;
+		case 'Z':		/* Respond ID. */
+			kbd_puts_queue(tp->tty, "\033[?6c");
+			break;
+		case '7':		/* Save cursor position. */
+			tp->saved_cx = tp->cx;
+			tp->saved_cy = tp->cy;
+			tp->saved_highlight = tp->highlight;
+			tp->saved_f_color = tp->f_color;
+			break;
+		case '8':		/* Restore cursor position. */
+			tty3270_convert_line(tp, tp->cy);
+			tty3270_goto_xy(tp, tp->saved_cx, tp->saved_cy);
+			tp->highlight = tp->saved_highlight;
+			tp->f_color = tp->saved_f_color;
+			break;
+		case 'c':		/* Reset terminal. */
+			tp->cx = tp->saved_cx = 0;
+			tp->cy = tp->saved_cy = 0;
+			tp->highlight = tp->saved_highlight = TAX_RESET;
+			tp->f_color = tp->saved_f_color = TAC_RESET;
+			tty3270_erase_display(tp, 2);
+			break;
+		}
+		return;
+	}
+	if (tp->esc_state == ESsquare) {
+		tp->esc_state = ESgetpars;
+		memset(tp->esc_par, 0, sizeof(tp->esc_par));
+		tp->esc_npar = 0;
+		tp->esc_ques = (ch == '?');
+		if (tp->esc_ques)
+			return;
+	}
+	if (tp->esc_state == ESgetpars) {
+		if (ch == ';' && tp->esc_npar < ESCAPE_NPAR - 1) {
+			tp->esc_npar++;
+			return;
+		}
+		if (ch >= '0' && ch <= '9') {
+			tp->esc_par[tp->esc_npar] *= 10;
+			tp->esc_par[tp->esc_npar] += ch - '0';
+			return;
+		}
+	}
+	tp->esc_state = ESnormal;
+	if (ch == 'n' && !tp->esc_ques) {
+		if (tp->esc_par[0] == 5)		/* Status report. */
+			kbd_puts_queue(tp->tty, "\033[0n");
+		else if (tp->esc_par[0] == 6) {	/* Cursor report. */
+			char buf[40];
+			sprintf(buf, "\033[%d;%dR", tp->cy + 1, tp->cx + 1);
+			kbd_puts_queue(tp->tty, buf);
+		}
+		return;
+	}
+	if (tp->esc_ques)
+		return;
+	switch (ch) {
+	case 'm':
+		tty3270_set_attributes(tp);
+		break;
+	case 'H':	/* Set cursor position. */
+	case 'f':
+		tty3270_goto_xy(tp, tty3270_getpar(tp, 1) - 1,
+				tty3270_getpar(tp, 0) - 1);
+		break;
+	case 'd':	/* Set y position. */
+		tty3270_goto_xy(tp, tp->cx, tty3270_getpar(tp, 0) - 1);
+		break;
+	case 'A':	/* Cursor up. */
+	case 'F':
+		tty3270_goto_xy(tp, tp->cx, tp->cy - tty3270_getpar(tp, 0));
+		break;
+	case 'B':	/* Cursor down. */
+	case 'e':
+	case 'E':
+		tty3270_goto_xy(tp, tp->cx, tp->cy + tty3270_getpar(tp, 0));
+		break;
+	case 'C':	/* Cursor forward. */
+	case 'a':
+		tty3270_goto_xy(tp, tp->cx + tty3270_getpar(tp, 0), tp->cy);
+		break;
+	case 'D':	/* Cursor backward. */
+		tty3270_goto_xy(tp, tp->cx - tty3270_getpar(tp, 0), tp->cy);
+		break;
+	case 'G':	/* Set x position. */
+	case '`':
+		tty3270_goto_xy(tp, tty3270_getpar(tp, 0), tp->cy);
+		break;
+	case 'X':	/* Erase Characters. */
+		tty3270_erase_characters(tp, tty3270_getpar(tp, 0));
+		break;
+	case 'J':	/* Erase display. */
+		tty3270_erase_display(tp, tp->esc_par[0]);
+		break;
+	case 'K':	/* Erase line. */
+		tty3270_erase_line(tp, tp->esc_par[0]);
+		break;
+	case 'P':	/* Delete characters. */
+		tty3270_delete_characters(tp, tty3270_getpar(tp, 0));
+		break;
+	case '@':	/* Insert characters. */
+		tty3270_insert_characters(tp, tty3270_getpar(tp, 0));
+		break;
+	case 's':	/* Save cursor position. */
+		tp->saved_cx = tp->cx;
+		tp->saved_cy = tp->cy;
+		tp->saved_highlight = tp->highlight;
+		tp->saved_f_color = tp->f_color;
+		break;
+	case 'u':	/* Restore cursor position. */
+		tty3270_convert_line(tp, tp->cy);
+		tty3270_goto_xy(tp, tp->saved_cx, tp->saved_cy);
+		tp->highlight = tp->saved_highlight;
+		tp->f_color = tp->saved_f_color;
+		break;
+	}
+}
+
+/*
+ * String write routine for 3270 ttys
+ */
+static void
+tty3270_do_write(struct tty3270 *tp, const unsigned char *buf, int count)
+{
+	int i_msg, i;
+
+	spin_lock_bh(&tp->view.lock);
+	for (i_msg = 0; !tp->tty->stopped && i_msg < count; i_msg++) {
+		if (tp->esc_state != 0) {
+			/* Continue escape sequence. */
+			tty3270_escape_sequence(tp, buf[i_msg]);
+			continue;
+		}
+
+		switch (buf[i_msg]) {
+		case 0x07:		/* '\a' -- Alarm */
+			tp->wcc |= TW_PLUSALARM;
+			break;
+		case 0x08:		/* Backspace. */
+			if (tp->cx > 0) {
+				tp->cx--;
+				tty3270_put_character(tp, ' ');
+			}
+			break;
+		case 0x09:		/* '\t' -- Tabulate */
+			for (i = tp->cx % 8; i < 8; i++) {
+				if (tp->cx >= tp->view.cols) {
+					tty3270_cr(tp);
+					tty3270_lf(tp);
+					break;
+				}
+				tty3270_put_character(tp, ' ');
+				tp->cx++;
+			}
+			break;
+		case 0x0a:		/* '\n' -- New Line */
+			tty3270_cr(tp);
+			tty3270_lf(tp);
+			break;
+		case 0x0c:		/* '\f' -- Form Feed */
+			tty3270_erase_display(tp, 2);
+			tp->cx = tp->cy = 0;
+			break;
+		case 0x0d:		/* '\r' -- Carriage Return */
+			tp->cx = 0;
+			break;
+		case 0x0f:		/* SuSE "exit alternate mode" */
+			break;
+		case 0x1b:		/* Start escape sequence. */
+			tty3270_escape_sequence(tp, buf[i_msg]);
+			break;
+		default:		/* Insert normal character. */
+			if (tp->cx >= tp->view.cols) {
+				tty3270_cr(tp);
+				tty3270_lf(tp);
+			}
+			tty3270_put_character(tp, buf[i_msg]);
+			tp->cx++;
+			break;
+		}
+	}
+	/* Convert current line to 3270 data fragment. */
+	tty3270_convert_line(tp, tp->cy);
+
+	/* Setup timer to update display after 1/10 second */
+	if (!timer_pending(&tp->timer))
+		tty3270_set_timer(tp, HZ/10);
+
+	spin_unlock_bh(&tp->view.lock);
+}
+
+/*
+ * String write routine for 3270 ttys
+ */
+static int
+tty3270_write(struct tty_struct * tty, int from_user,
+	      const unsigned char *buf, int count)
+{
+	struct tty3270 *tp;
+	int length, ret;
+
+	tp = tty->driver_data;
+	if (!tp)
+		return 0;
+	if (tp->char_count > 0) {
+		tty3270_do_write(tp, tp->char_buf, tp->char_count);
+		tp->char_count = 0;
+	}
+	if (!from_user) {
+		tty3270_do_write(tp, buf, count);
+		return count;
+	}
+	ret = 0;
+	while (count > 0) {
+		length = count < TTY3270_CHAR_BUF_SIZE ?
+			count : TTY3270_CHAR_BUF_SIZE;
+		length -= copy_from_user(tp->char_buf, buf, length);
+		if (length == 0) {
+			if (!ret)
+				ret = -EFAULT;
+			break;
+		}
+		tty3270_do_write(tp, tp->char_buf, count);
+		buf += length;
+		count -= length;
+		ret += length;
+	}
+	return ret;
+}
+
+/*
+ * Put single characters to the ttys character buffer
+ */
+static void
+tty3270_put_char(struct tty_struct *tty, unsigned char ch)
+{
+	struct tty3270 *tp;
+
+	tp = tty->driver_data;
+	if (!tp)
+		return;
+	if (tp->char_count < TTY3270_CHAR_BUF_SIZE)
+		tp->char_buf[tp->char_count++] = ch;
+}
+
+/*
+ * Flush all characters from the ttys characeter buffer put there
+ * by tty3270_put_char.
+ */
+static void
+tty3270_flush_chars(struct tty_struct *tty)
+{
+	struct tty3270 *tp;
+
+	tp = tty->driver_data;
+	if (!tp)
+		return;
+	if (tp->char_count > 0) {
+		tty3270_do_write(tp, tp->char_buf, tp->char_count);
+		tp->char_count = 0;
+	}
+}
+
+/*
+ * Returns the number of characters in the output buffer. This is
+ * used in tty_wait_until_sent to wait until all characters have
+ * appeared on the screen.
+ */
+static int
+tty3270_chars_in_buffer(struct tty_struct *tty)
+{
+	return 0;
+}
+
+static void
+tty3270_flush_buffer(struct tty_struct *tty)
+{
+}
+
+/*
+ * Check for visible/invisible input switches
+ */
+static void
+tty3270_set_termios(struct tty_struct *tty, struct termios *old)
+{
+	struct tty3270 *tp;
+	int new;
+
+	tp = tty->driver_data;
+	if (!tp)
+		return;
+	spin_lock_bh(&tp->view.lock);
+	if (L_ICANON(tty)) {
+		new = L_ECHO(tty) ? TF_INPUT: TF_INPUTN;
+		if (new != tp->inattr) {
+			tp->inattr = new;
+			tty3270_update_prompt(tp, 0, 0);
+			tty3270_set_timer(tp, 1);
+		}
+	}
+	spin_unlock_bh(&tp->view.lock);
+}
+
+/*
+ * Disable reading from a 3270 tty
+ */
+static void
+tty3270_throttle(struct tty_struct * tty)
+{
+	struct tty3270 *tp;
+
+	tp = tty->driver_data;
+	if (!tp)
+		return;
+	tp->throttle = 1;
+}
+
+/*
+ * Enable reading from a 3270 tty
+ */
+static void
+tty3270_unthrottle(struct tty_struct * tty)
+{
+	struct tty3270 *tp;
+
+	tp = tty->driver_data;
+	if (!tp)
+		return;
+	tp->throttle = 0;
+	if (tp->attn)
+		tty3270_issue_read(tp, 1);
+}
+
+/*
+ * Hang up the tty device.
+ */
+static void
+tty3270_hangup(struct tty_struct *tty)
+{
+	// FIXME: implement
+}
+
+static void
+tty3270_wait_until_sent(struct tty_struct *tty, int timeout)
+{
+}
+
+static int
+tty3270_ioctl(struct tty_struct *tty, struct file *file,
+	      unsigned int cmd, unsigned long arg)
+{
+	struct tty3270 *tp;
+
+	tp = tty->driver_data;
+	if (!tp)
+		return -ENODEV;
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return -EIO;
+	return kbd_ioctl(tp->kbd, file, cmd, arg);
+}
+
+static struct tty_operations tty3270_ops = {
+	.open = tty3270_open,
+	.close = tty3270_close,
+	.write = tty3270_write,
+	.put_char = tty3270_put_char,
+	.flush_chars = tty3270_flush_chars,
+	.write_room = tty3270_write_room,
+	.chars_in_buffer = tty3270_chars_in_buffer,
+	.flush_buffer = tty3270_flush_buffer,
+	.throttle = tty3270_throttle,
+	.unthrottle = tty3270_unthrottle,
+	.hangup = tty3270_hangup,
+	.wait_until_sent = tty3270_wait_until_sent,
+	.ioctl = tty3270_ioctl,
+	.set_termios = tty3270_set_termios
+};
+
+void
+tty3270_notifier(int index, int active)
+{
+	if (active)
+		tty_register_device(tty3270_driver, index, 0);
+	else
+		tty_unregister_device(tty3270_driver, index);
+}
+
+/*
+ * 3270 tty registration code called from tty_init().
+ * Most kernel services (incl. kmalloc) are available at this poimt.
+ */
+int __init
+tty3270_init(void)
+{
+	struct tty_driver *driver;
+	int ret;
+
+	ret = raw3270_init();
+	if (ret)
+		return ret;
+	driver = alloc_tty_driver(256);
+	if (!driver)
+		return -ENOMEM;
+
+	/*
+	 * Initialize the tty_driver structure
+	 * Entries in tty3270_driver that are NOT initialized:
+	 * proc_entry, set_termios, flush_buffer, set_ldisc, write_proc
+	 */
+	driver->owner = THIS_MODULE;
+	driver->devfs_name = "ttyTUB/";
+	driver->driver_name = "ttyTUB";
+	driver->name = "ttyTUB";
+	driver->major = IBM_TTY3270_MAJOR;
+	driver->type = TTY_DRIVER_TYPE_SYSTEM;
+	driver->subtype = SYSTEM_TYPE_TTY;
+	driver->init_termios = tty_std_termios;
+	driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_NO_DEVFS;
+	tty_set_operations(driver, &tty3270_ops);
+	ret = tty_register_driver(driver);
+	if (ret) {
+		printk(KERN_ERR "tty3270 registration failed with %d\n", ret);
+		put_tty_driver(driver);
+		return ret;
+	}
+	tty3270_driver = driver;
+	return 0;
+}
+
+static void __exit
+tty3270_exit(void)
+{
+	struct tty_driver *driver;
+
+	driver = tty3270_driver;
+	tty3270_driver = 0;
+	tty_unregister_driver(driver);
+	raw3270_exit();
+}
+
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_CHARDEV_MAJOR(IBM_TTY3270_MAJOR);
+
+module_init(tty3270_init);
+module_exit(tty3270_exit);
diff -Nru a/drivers/s390/char/tuball.c b/drivers/s390/char/tuball.c
--- a/drivers/s390/char/tuball.c	Tue Feb  3 19:45:41 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,621 +0,0 @@
-/*
- *  IBM/3270 Driver -- Copyright (C) 2000 UTS Global LLC
- *
- *  tuball.c -- Initialization, termination, irq lookup
- *
- *
- *
- *
- *
- *  Author:  Richard Hitt
- */
-#include <linux/config.h>
-#include "tubio.h"
-#ifndef MODULE
-#include <linux/init.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0))
-#include <asm/cpcmd.h>
-#include <linux/bootmem.h>
-#else
-#include "../../../../arch/s390/kernel/cpcmd.h"
-#endif
-#endif
-
-/* Module parameters */
-int tubdebug;
-int tubscrolltime = -1;
-static int tubxcorrect = 1;            /* Do correct ebc<->asc tables */
-#ifdef MODULE
-MODULE_PARM(tubdebug, "i");
-MODULE_PARM(tubscrolltime, "i");
-MODULE_PARM(tubxcorrect, "i");
-#endif
-/*
- * Values for tubdebug and their effects:
- * 1 - print in hex on console the first 16 bytes received
- * 2 - print address at which array tubminors is allocated
- * 4 - attempt to register tty3270_driver
- */
-int tubnummins;
-tub_t *(*tubminors)[TUBMAXMINS];
-static tub_t *(*(*tubirqs)[256])[256];
-unsigned char tub_ascebc[256];
-unsigned char tub_ebcasc[256];
-static int tubinitminors(void);
-static void tubfiniminors(void);
-static void tubint(int, void *, struct pt_regs *);
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
-static int tubmakemin(int, dev_info_t *);
-#else
-static int tubmakemin(int, s390_dev_info_t *);
-#endif
-
-
-/* Lookup-by-irq functions */
-static int tubaddbyirq(tub_t *, int);
-static tub_t *tubfindbyirq(int);
-static void tubdelbyirq(tub_t *, int);
-static void tubfiniirqs(void);
-
-/* FIXME: put extern declarations in a header */
-extern int fs3270_init(void);
-extern void fs3270_fini(void);
-extern int tty3270_init(void);
-extern void tty3270_fini(void);
-
-unsigned char tub_ebcgraf[64] =
-	{ 0x40, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
-	  0xc8, 0xc9, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
-	  0x50, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
-	  0xd8, 0xd9, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
-	  0x60, 0x61, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
-	  0xe8, 0xe9, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
-	  0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
-	  0xf8, 0xf9, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f };
-
-#ifndef MODULE
-
-/*
- * Can't have this driver a module & support console at the same time
- */
-#ifdef CONFIG_TN3270_CONSOLE
-static struct tty_driver *tub3270_con_device(struct console *, int *);
-static void tub3270_con_unblank(void);
-static void tub3270_con_write(struct console *, const char *,
-	unsigned int);
-
-static struct console tub3270_con = {
-	"tub3270",		/* name */
-	tub3270_con_write,	/* write */
-	NULL,			/* read */
-	tub3270_con_device,	/* device */
-	tub3270_con_unblank,	/* unblank */
-	NULL,			/* setup */
-	CON_PRINTBUFFER,	/* flags */
-	0,			/* index */
-	0,			/* cflag */
-	NULL			/* next */
-};
-
-static bcb_t tub3270_con_bcb;		/* Buffer that receives con writes */
-static spinlock_t tub3270_con_bcblock;	/* Lock for the buffer */
-static int tub3270_con_irq = -1;		/* set nonneg by _activate() */
-tub_t *tub3270_con_tubp;		/* set nonzero by _activate() */
-struct tty_driver tty3270_con_driver;	/* for /dev/console at 4, 64 */
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
-int tub3270_con_devno = -1;		/* set by tub3270_con_setup() */
-__initfunc(void tub3270_con_setup(char *str, int *ints))
-{
-	int vdev;
-
-	vdev = simple_strtoul(str, 0, 16);
-	if (vdev >= 0 && vdev < 65536)
-		tub3270_con_devno = vdev;
-	return;
-}
-
-__initfunc (long tub3270_con_init(long kmem_start, long kmem_end))
-{
-	tub3270_con_bcb.bc_len = 65536;
-	if (!MACHINE_IS_VM && !MACHINE_IS_P390)
-		return kmem_start;
-	tub3270_con_bcb.bc_buf = (void *)kmem_start;
-	kmem_start += tub3270_con_bcb.bc_len;
-	register_console(&tub3270_con);
-	return kmem_start;
-}
-#else
-#define tub3270_con_devno console_device
-
-static void __init tub3270_con_init(void)
-{
-	tub3270_con_bcb.bc_len = 65536;
-	if (!CONSOLE_IS_3270)
-		return;
-	tub3270_con_bcb.bc_buf = (void *)alloc_bootmem_low(
-		tub3270_con_bcb.bc_len);
-	register_console(&tub3270_con);
-}
-console_initcall(tub3270_con_init);
-
-#endif
-
-static struct tty_driver *tub3270_con_device(struct console *conp, int *index)
-{
-	*index = conp->index + 1;
-	extern struct tty_driver *tty3270_driver;
-	return tty3270_driver;
-}
-
-static void
-tub3270_con_unblank(void)
-{
-	/* flush everything:  panic has occurred */
-}
-
-static void
-tub3270_con_write(struct console *conp,
-	const char *buf, unsigned int count)
-{
-	long flags;
-	tub_t *tubp = tub3270_con_tubp;
-	void tty3270_sched_bh(tub_t *);
-	int rc;
-	bcb_t obcb;
-
-	obcb.bc_buf = (char *)buf;
-	obcb.bc_len = obcb.bc_cnt = obcb.bc_wr =
-		MIN(count, tub3270_con_bcb.bc_len);
-	obcb.bc_rd = 0;
-
-	spin_lock_irqsave(&tub3270_con_bcblock, flags);
-	rc = tub3270_movedata(&obcb, &tub3270_con_bcb, 0);
-	spin_unlock_irqrestore(&tub3270_con_bcblock, flags);
-
-	if (tubp && rc && TUBTRYLOCK(tubp->irq, flags)) {
-		tty3270_sched_bh(tubp);
-		TUBUNLOCK(tubp->irq, flags);
-	}
-}
-	
-int tub3270_con_copy(tub_t *tubp)
-{
-	long flags;
-	int rc;
-
-	spin_lock_irqsave(&tub3270_con_bcblock, flags);
-	rc = tub3270_movedata(&tub3270_con_bcb, &tubp->tty_bcb, 0);
-	spin_unlock_irqrestore(&tub3270_con_bcblock, flags);
-	return rc;
-}
-#endif /* CONFIG_TN3270_CONSOLE */
-#endif
-
-/*
- * remove driver:  unregister the major number
- */
-static void __exit
-tub3270_exit(void)
-{
-	fs3270_fini();
-	tty3270_fini();
-	tubfiniminors();
-}
-
-static int
-tub3270_is_ours(s390_dev_info_t *dp)
-{
-	if ((dp->sid_data.cu_type & 0xfff0) == 0x3270)
-		return 1;
-	if (dp->sid_data.cu_type == 0x3174)
-		return 1;
-	return 0;
-}
-
-/*
- * tub3270_init() called by kernel or module initialization
- */
-static int __init
-tub3270_init(void)
-{
-	s390_dev_info_t d;
-	int i, rc;
-
-#ifdef MODULE
-	if (tubnummins != 0) {
-		printk(KERN_ERR "EEEK!!  Tube driver cobbigling!!\n");
-		return -1;
-	}
-#endif
-
-	/*
-	 * Copy and correct ebcdic - ascii translate tables
-	 */
-	memcpy(tub_ascebc, _ascebc, sizeof tub_ascebc);
-	memcpy(tub_ebcasc, _ebcasc, sizeof tub_ebcasc);
-	if (tubxcorrect) {
-		/* correct brackets and circumflex */
-		tub_ascebc['['] = 0xad;
-		tub_ascebc[']'] = 0xbd;
-		tub_ebcasc[0xad] = '[';
-		tub_ebcasc[0xbd] = ']';
-		tub_ascebc['^'] = 0xb0;
-		tub_ebcasc[0x5f] = '^';
-	}
-
-	rc = tubinitminors();
-	if (rc != 0)
-		return rc;
-
-	if (fs3270_init() || tty3270_init()) {
-		printk(KERN_ERR "fs3270_init() or tty3270_init() failed\n");
-		fs3270_fini();
-		tty3270_fini();
-		tubfiniminors();
-		return -1;
-	}
-
-	for (i = get_irq_first(); i >= 0; i = get_irq_next(i)) {
-		if ((rc = get_dev_info_by_irq(i, &d)))
-			continue;
-		if (d.status)
-			continue;
-
-#ifdef CONFIG_TN3270_CONSOLE
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
-		if (d.sid_data.cu_type == 0x3215 && MACHINE_IS_VM) {
-			cpcmd("TERM CONMODE 3270", NULL, 0);
-			d.sid_data.cu_type = 0x3270;
-		}
-#else
-		if (d.sid_data.cu_type == 0x3215 && CONSOLE_IS_3270) {
-			cpcmd("TERM CONMODE 3270", NULL, 0);
-			d.sid_data.cu_type = 0x3270;
-		}
-#endif /* LINUX_VERSION_CODE */
-#endif /* CONFIG_TN3270_CONSOLE */
-		if (!tub3270_is_ours(&d))
-			continue;
-
-		rc = tubmakemin(i, &d);
-		if (rc < 0) {
-			printk(KERN_WARNING 
-			       "3270 tube registration ran out of memory"
-			       " after %d devices\n", tubnummins - 1);
-			break;
-		} else {
-			printk(KERN_INFO "3270: %.4x on sch %d, minor %d\n",
-				d.devno, d.irq, rc);
-		}
-	}
-
-	return 0;
-}
-
-/*
- * tub3270_movedata(bcb_t *, bcb_t *) -- Move data stream
- */
-int
-tub3270_movedata(bcb_t *ib, bcb_t *ob, int fromuser)
-{
-	int count;			/* Total move length */
-	int rc;
-
-	rc = count = MIN(ib->bc_cnt, ob->bc_len - ob->bc_cnt);
-	while (count > 0) {
-		int len1;		/* Contig bytes avail in ib */
-
-		if (ib->bc_wr > ib->bc_rd)
-			len1 = ib->bc_wr - ib->bc_rd;
-		else
-			len1 = ib->bc_len - ib->bc_rd;
-		if (len1 > count)
-			len1 = count;
-
-		while (len1 > 0) {
-			int len2;	/* Contig space avail in ob */
-
-			if (ob->bc_rd > ob->bc_wr)
-				len2 = ob->bc_rd - ob->bc_wr;
-			else
-				len2 = ob->bc_len - ob->bc_wr;
-			if (len2 > len1)
-				len2 = len1;
-			
-			if (fromuser) {
-				len2 -= copy_from_user(ob->bc_buf + ob->bc_wr,
-						       ib->bc_buf + ib->bc_rd,
-						       len2);
-				if (len2 == 0) {
-					if (!rc)
-						rc = -EFAULT;
-					break;
-				}
-			} else
-				memcpy(ob->bc_buf + ob->bc_wr,
-				       ib->bc_buf + ib->bc_rd,
-				       len2);
-			
-			ib->bc_rd += len2;
-			if (ib->bc_rd == ib->bc_len)
-				ib->bc_rd = 0;
-			ib->bc_cnt -= len2;
-
-			ob->bc_wr += len2;
-			if (ob->bc_wr == ob->bc_len)
-				ob->bc_wr = 0;
-			ob->bc_cnt += len2;
-
-			len1 -= len2;
-			count -= len2;
-		}
-	}
-	return rc;
-}
-
-/*
- * receive an interrupt
- */
-static void
-tubint(int irq, void *ipp, struct pt_regs *prp)
-{
-	devstat_t *dsp = ipp;
-	tub_t *tubp;
-
-	if ((tubp = IRQ2TUB(irq)) && (tubp->intv))
-		(tubp->intv)(tubp, dsp);
-}
-
-/*
- * Initialize array of pointers to minor structures tub_t.
- * Returns 0 or -ENOMEM.
- */
-static int
-tubinitminors(void)
-{
-	tubminors = (tub_t *(*)[TUBMAXMINS])kmalloc(sizeof *tubminors,
-		GFP_KERNEL);
-	if (tubminors == NULL)
-		return -ENOMEM;
-	memset(tubminors, 0, sizeof *tubminors);
-	return 0;
-}
-
-/*
- * Add a minor 327x device.  Argument is an irq value.
- *
- * Point elements of two arrays to the newly created tub_t:
- * 1. (*tubminors)[minor]
- * 2. (*(*tubirqs)[irqhi])[irqlo]
- * The first looks up from minor number at context time; the second
- * looks up from irq at interrupt time.
- */
-static int
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
-tubmakemin(int irq, dev_info_t *dp)
-#else
-tubmakemin(int irq, s390_dev_info_t *dp)
-#endif
-{
-	tub_t *tubp;
-	int minor;
-	long flags;
-
-	if ((minor = ++tubnummins) == TUBMAXMINS)
-		return -ENODEV;
-
-	tubp = kmalloc(sizeof(tub_t), GFP_KERNEL);
-	if (tubp == NULL) {
-		return -ENOMEM;
-	}
-	if (tubaddbyirq(tubp, irq) != 0) {
-		kfree(tubp);
-		return -ENOMEM;
-	}
-	memset(tubp, 0, sizeof(tub_t));
-	tubp->minor = minor;
-	tubp->irq = irq;
-	TUBLOCK(tubp->irq, flags);
-	tubp->devno = dp->devno;
-	tubp->geom_rows = _GEOM_ROWS;
-	tubp->geom_cols = _GEOM_COLS;
-	init_waitqueue_head(&tubp->waitq);
-
-	tubp->tty_bcb.bc_len = TTY_OUTPUT_SIZE;
-	tubp->tty_bcb.bc_buf = (void *)kmalloc(tubp->tty_bcb.bc_len,
-		GFP_KERNEL|GFP_DMA);
-	if (tubp->tty_bcb.bc_buf == NULL) {
-		TUBUNLOCK(tubp->irq, flags);
-		tubdelbyirq(tubp, irq);
-		kfree(tubp);
-		return -ENOMEM;
-	}
-	tubp->tty_bcb.bc_cnt = 0;
-	tubp->tty_bcb.bc_wr = 0;
-	tubp->tty_bcb.bc_rd = 0;
-	(*tubminors)[minor] = tubp;
-
-#ifdef CONFIG_TN3270_CONSOLE
-	if (CONSOLE_IS_3270) {
-		if (tub3270_con_tubp == NULL && 
-		    tub3270_con_bcb.bc_buf != NULL &&
-		    (tub3270_con_devno == -1 ||
-		     tub3270_con_devno == dp->devno)) {
-			extern void tty3270_int(tub_t *, devstat_t *);
-			
-			tub3270_con_devno = dp->devno;
-			tubp->cmd = TBC_CONOPEN;
-			tubp->flags |= TUB_OPEN_STET | TUB_INPUT_HACK;
-			tty3270_size(tubp, &flags);
-			tty3270_aid_init(tubp);
-			tty3270_scl_init(tubp);
-			tub3270_con_irq = tubp->irq;
-			tub3270_con_tubp = tubp;
-			tubp->intv = tty3270_int;
-			tubp->cmd = TBC_UPDSTAT;
-			tty3270_build(tubp);
-		}
-	}
-#endif /* CONFIG_TN3270_CONSOLE */
-
-	devfs_mk_cdev(MKDEV(IBM_FS3270_MAJOR, tubp->minor),
-			S_IFCHR|S_IRUSR|S_IWUSR, "3270/tub%.4x");
-
-	TUBUNLOCK(tubp->irq, flags);
-	return minor;
-}
-
-/*
- * Release array of pointers to minor structures tub_t, but first
- * release any storage pointed to by them.
- */
-static void
-tubfiniminors(void)
-{
-	int i;
-	tub_t **tubpp, *tubp;
-
-	if (tubminors == NULL)
-		return;
-
-	for (i = 0; i < TUBMAXMINS; i++) {
-		tubpp = &(*tubminors)[i];
-		if ((tubp = *tubpp)) {
-			devfs_remove("3270/tub%.4x", tubp->devno);
-			tubdelbyirq(tubp, tubp->irq);
-			tty3270_rcl_fini(tubp);
-			kfree(tubp->tty_bcb.bc_buf);
-			tubp->tty_bcb.bc_buf = NULL;
-			if (tubp->tty_input) {
-				kfree(tubp->tty_input);
-				tubp->tty_input = NULL;
-			}
-			tubp->ttyscreen = NULL;
-			kfree(tubp);
-			*tubpp = NULL;
-		}
-	}
-	kfree(tubminors);
-	tubminors = NULL;
-	tubfiniirqs();
-}
-
-/*
- * tubaddbyirq() -- Add tub_t for irq lookup in tubint()
- */
-static int
-tubaddbyirq(tub_t *tubp, int irq)
-{
-	int irqhi = (irq >> 8) & 255;
-	int irqlo = irq & 255;
-	tub_t *(*itubpp)[256];
-
-	/* Allocate array (*tubirqs)[] if first time */
-	if (tubirqs == NULL) {
-		tubirqs = (tub_t *(*(*)[256])[256])
-			kmalloc(sizeof *tubirqs, GFP_KERNEL);
-		if (tubirqs == NULL)
-			return -ENOMEM;
-		memset(tubirqs, 0, sizeof *tubirqs);
-	}
-
-	/* Allocate subarray (*(*tubirqs)[])[] if first use */
-	if ((itubpp = (*tubirqs)[irqhi]) == NULL) {
-		itubpp = (tub_t *(*)[256])
-			kmalloc(sizeof(*itubpp), GFP_KERNEL);
-		if (itubpp == NULL) {
-			if (tubnummins == 1) {  /* if first time */
-				kfree(tubirqs);
-				tubirqs = NULL;
-			}
-			return -ENOMEM;
-		} else {
-			memset(itubpp, 0, sizeof(*itubpp));
-			(*tubirqs)[irqhi] = itubpp;
-		}
-	}
-
-	/* Request interrupt service */
-	if ((tubp->irqrc = request_irq(irq, tubint, SA_INTERRUPT,
-	    "3270 tube driver", &tubp->devstat)) != 0)
-		return tubp->irqrc;
-
-	/* Fill in the proper subarray element */
-	(*itubpp)[irqlo] = tubp;
-	return 0;
-}
-
-/*
- * tubfindbyirq(irq)
- */
-static tub_t *
-tubfindbyirq(int irq)
-{
-	int irqhi = (irq >> 8) & 255;
-	int irqlo = irq & 255;
-	tub_t *tubp;
-
-	if (tubirqs == NULL)
-		return NULL;
-	if ((*tubirqs)[irqhi] == NULL)
-		return NULL;
-	tubp = (*(*tubirqs)[irqhi])[irqlo];
-	if (tubp->irq == irq)
-		return tubp;
-	return NULL;
-}
-
-/*
- * tubdelbyirq(tub_t*, irq)
- */
-static void
-tubdelbyirq(tub_t *tubp, int irq)
-{
-	int irqhi = (irq >> 8) & 255;
-	int irqlo = irq & 255;
-	tub_t *(*itubpp)[256], *itubp;
-
-	if (tubirqs == NULL) {
-		printk(KERN_ERR "tubirqs is NULL\n");
-		return;
-	}
-	itubpp = (*tubirqs)[irqhi];
-	if (itubpp == NULL) {
-		printk(KERN_ERR "tubirqs[%d] is NULL\n", irqhi);
-		return;
-	}
-	itubp = (*itubpp)[irqlo];
-	if (itubp == NULL) {
-		printk(KERN_ERR "tubirqs[%d][%d] is NULL\n", irqhi, irqlo);
-		return;
-	}
-	if (itubp->irqrc == 0)
-		free_irq(irq, &itubp->devstat);
-	(*itubpp)[irqlo] = NULL;
-}
-
-/*
- * tubfiniirqs() -- clean up storage in tub_t *(*(*tubirqs)[256])[256]
- */
-static void
-tubfiniirqs(void)
-{
-	int i;
-	tub_t *(*itubpp)[256];
-
-	if (tubirqs != NULL) {
-		for (i = 0; i < 256; i++) {
-			if ((itubpp = (*tubirqs)[i])) {
-				kfree(itubpp);
-				(*tubirqs)[i] = NULL;
-			}
-		}
-		kfree(tubirqs);
-		tubirqs = NULL;
-	}
-}
-
-module_init(tub3270_init);
-module_exit(tub3270_exit);
diff -Nru a/drivers/s390/char/tubfs.c b/drivers/s390/char/tubfs.c
--- a/drivers/s390/char/tubfs.c	Tue Feb  3 19:45:30 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,473 +0,0 @@
-/*
- *  IBM/3270 Driver -- Copyright (C) UTS Global LLC
- *
- *  tubfs.c -- Fullscreen driver
- *
- *
- *
- *
- *
- *  Author:  Richard Hitt
- */
-#include "tubio.h"
-
-int fs3270_major = -1;			/* init to impossible -1 */
-
-static int fs3270_open(struct inode *, struct file *);
-static int fs3270_close(struct inode *, struct file *);
-static int fs3270_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
-static ssize_t fs3270_read(struct file *, char *, size_t, loff_t *);
-static ssize_t fs3270_write(struct file *, const char *, size_t, loff_t *);
-static int fs3270_wait(tub_t *, long *);
-static void fs3270_int(tub_t *tubp, devstat_t *dsp);
-extern void tty3270_refresh(tub_t *);
-
-static struct file_operations fs3270_fops = {
-	.owner = THIS_MODULE,		/* owner */
-	.read 	= fs3270_read,	/* read */
-	.write	= fs3270_write,	/* write */
-	.ioctl	= fs3270_ioctl,	/* ioctl */
-	.open 	= fs3270_open,	/* open */
-	.release = fs3270_close,	/* release */
-};
-
-/*
- * fs3270_init() -- Initialize fullscreen tubes
- */
-int
-fs3270_init(void)
-{
-	int rc;
-
-	rc = register_chrdev(IBM_FS3270_MAJOR, "fs3270", &fs3270_fops);
-	if (rc) {
-		printk(KERN_ERR "tubmod can't get major nbr %d: error %d\n",
-			IBM_FS3270_MAJOR, rc);
-		return -1;
-	}
-	devfs_mk_dir("3270");
-	devfs_mk_cdev(MKDEV(IBM_FS3270_MAJOR, 0),
-			S_IFCHR|S_IRUGO|S_IWUGO, "3270/tub");
-	fs3270_major = IBM_FS3270_MAJOR;
-	return 0;
-}
-
-/*
- * fs3270_fini() -- Uninitialize fullscreen tubes
- */
-void
-fs3270_fini(void)
-{
-	if (fs3270_major != -1) {
-		devfs_remove("3270");
-		devfs_remove("3270/tub");
-		unregister_chrdev(fs3270_major, "fs3270");
-		fs3270_major = -1;
-	}
-}
-
-/*
- * fs3270_open
- */
-static int
-fs3270_open(struct inode *ip, struct file *fp)
-{
-	tub_t *tubp;
-	long flags;
-
-	/* See INODE2TUB(ip) for handling of "/dev/3270/tub" */
-	if ((tubp = INODE2TUB(ip)) == NULL)
-		return -ENOENT;
-
-	TUBLOCK(tubp->irq, flags);
-	if (tubp->mode == TBM_FS || tubp->mode == TBM_FSLN) {
-		TUBUNLOCK(tubp->irq, flags);
-		return -EBUSY;
-	}
-
-	fp->private_data = ip;
-	tubp->mode = TBM_FS;
-	tubp->intv = fs3270_int;
-	tubp->dstat = 0;
-	tubp->fs_pid = current->pid;
-	tubp->fsopen = 1;
-	TUBUNLOCK(tubp->irq, flags);
-	return 0;
-}
-
-/*
- * fs3270_close aka release:  free the irq
- */
-static int
-fs3270_close(struct inode *ip, struct file *fp)
-{
-	tub_t *tubp;
-	long flags;
-
-	if ((tubp = INODE2TUB(ip)) == NULL)
-		return -ENODEV;
-
-	fs3270_wait(tubp, &flags);
-	tubp->fsopen = 0;
-	tubp->fs_pid = 0;
-	tubp->intv = NULL;
-	tubp->mode = 0;
-	tty3270_refresh(tubp);
-	TUBUNLOCK(tubp->irq, flags);
-	return 0;
-}
-
-/*
- * fs3270_release() called from tty3270_hangup()
- */
-void
-fs3270_release(tub_t *tubp)
-{
-	long flags;
-
-	if (tubp->mode != TBM_FS)
-		return;
-	fs3270_wait(tubp, &flags);
-	tubp->fsopen = 0;
-	tubp->fs_pid = 0;
-	tubp->intv = NULL;
-	tubp->mode = 0;
-	/*tty3270_refresh(tubp);*/
-	TUBUNLOCK(tubp->irq, flags);
-}
-
-/*
- * fs3270_wait(tub_t *tubp, int *flags) -- Wait to use tube
- * Entered without irq lock
- * On return:
- *      * Lock is held
- *      * Value is 0 or -ERESTARTSYS
- */
-static int
-fs3270_wait(tub_t *tubp, long *flags)
-{
-	DECLARE_WAITQUEUE(wait, current);
-
-	TUBLOCK(tubp->irq, *flags);
-	add_wait_queue(&tubp->waitq, &wait);
-	while (!signal_pending(current) &&
-	    ((tubp->mode != TBM_FS) ||
-	     (tubp->flags & (TUB_WORKING | TUB_RDPENDING)) != 0)) {
-#warning FIXME: [kj] use set_current_state instead of current->state=
-		current->state = TASK_INTERRUPTIBLE;
-		TUBUNLOCK(tubp->irq, *flags);
-		schedule();
-#warning FIXME: [kj] use set_current_state instead of current->state=
-		current->state = TASK_RUNNING;
-		TUBLOCK(tubp->irq, *flags);
-	}
-	remove_wait_queue(&tubp->waitq, &wait);
-	return signal_pending(current)? -ERESTARTSYS: 0;
-}
-
-/*
- * fs3270_io(tubp, ccw1_t*) -- start I/O on the tube
- * Entered with irq lock held, WORKING off
- */
-static int
-fs3270_io(tub_t *tubp, ccw1_t *ccwp)
-{
-	int rc;
-
-	rc = do_IO(tubp->irq, ccwp, tubp->irq, 0, 0);
-	tubp->flags |= TUB_WORKING;
-	tubp->dstat = 0;
-	return rc;
-}
-
-/*
- * fs3270_tasklet(tubp) -- Perform back-half processing
- */
-static void
-fs3270_tasklet(unsigned long data)
-{
-	long flags;
-	tub_t *tubp;
-	addr_t *ip;
-
-	tubp = (tub_t *) data;
-	TUBLOCK(tubp->irq, flags);
-	tubp->flags &= ~TUB_BHPENDING;
-
-	if (tubp->wbuf) {       /* if we were writing */
-		for (ip = tubp->wbuf; ip < tubp->wbuf+33; ip++) {
-			if (*ip == 0)
-				break;
-			kfree(phys_to_virt(*ip));
-		}
-		kfree(tubp->wbuf);
-		tubp->wbuf = NULL;
-	}
-
-	if ((tubp->flags & (TUB_ATTN | TUB_RDPENDING)) ==
-	    (TUB_ATTN | TUB_RDPENDING)) {
-		fs3270_io(tubp, &tubp->rccw);
-		tubp->flags &= ~(TUB_ATTN | TUB_RDPENDING);
-	}
-
-	if ((tubp->flags & TUB_WORKING) == 0)
-		wake_up_interruptible(&tubp->waitq);
-
-	TUBUNLOCK(tubp->irq, flags);
-}
-
-/*
- * fs3270_sched_tasklet(tubp) -- Schedule the back half
- * Irq lock must be held on entry and remains held on exit.
- */
-static void
-fs3270_sched_tasklet(tub_t *tubp)
-{
-	if (tubp->flags & TUB_BHPENDING)
-		return;
-	tubp->flags |= TUB_BHPENDING;
-	tasklet_init(&tubp->tasklet, fs3270_tasklet,
-		     (unsigned long) tubp);
-	tasklet_schedule(&tubp->tasklet);
-}
-
-/*
- * fs3270_int(tubp, prp) -- Process interrupt from tube in FS mode
- * This routine is entered with irq lock held (see do_IRQ in s390io.c)
- */
-static void
-fs3270_int(tub_t *tubp, devstat_t *dsp)
-{
-#define	DEV_UE_BUSY \
-	(DEV_STAT_CHN_END | DEV_STAT_DEV_END | DEV_STAT_UNIT_EXCEP)
-
-#ifdef RBHNOTYET
-	/* XXX needs more work; must save 2d arg to fs370_io() */
-	/* Handle CE-DE-UE and subsequent UDE */
-	if (dsp->dstat == DEV_UE_BUSY) {
-		tubp->flags |= TUB_UE_BUSY;
-		return;
-	} else if (tubp->flags & TUB_UE_BUSY) {
-		tubp->flags &= ~TUB_UE_BUSY;
-		if (dsp->dstat == DEV_STAT_DEV_END &&
-		    (tubp->flags & TUB_WORKING) != 0) {
-			fs3270_io(tubp);
-			return;
-		}
-	}
-#endif
-
-	/* Handle ATTN */
-	if (dsp->dstat & DEV_STAT_ATTENTION)
-		tubp->flags |= TUB_ATTN;
-
-	if (dsp->dstat & DEV_STAT_CHN_END) {
-		tubp->cswl = dsp->rescnt;
-		if ((dsp->dstat & DEV_STAT_DEV_END) == 0)
-			tubp->flags |= TUB_EXPECT_DE;
-		else
-			tubp->flags &= ~TUB_EXPECT_DE;
-	} else if (dsp->dstat & DEV_STAT_DEV_END) {
-		if ((tubp->flags & TUB_EXPECT_DE) == 0)
-			tubp->flags |= TUB_UNSOL_DE;
-		tubp->flags &= ~TUB_EXPECT_DE;
-	}
-	if (dsp->dstat & DEV_STAT_DEV_END)
-		tubp->flags &= ~TUB_WORKING;
-
-	if ((tubp->flags & TUB_WORKING) == 0)
-		fs3270_sched_tasklet(tubp);
-}
-
-/*
- * process ioctl commands for the tube driver
- */
-static int
-fs3270_ioctl(struct inode *ip, struct file *fp,
-	unsigned int cmd, unsigned long arg)
-{
-	tub_t *tubp;
-	int rc = 0;
-	long flags;
-
-	if ((tubp = INODE2TUB(ip)) == NULL)
-		return -ENODEV;
-	if ((rc = fs3270_wait(tubp, &flags))) {
-		TUBUNLOCK(tubp->irq, flags);
-		return rc;
-	}
-
-	switch(cmd) {
-	case TUBICMD: tubp->icmd = arg; break;
-	case TUBOCMD: tubp->ocmd = arg; break;
-	case TUBGETI: put_user(tubp->icmd, (char *)arg); break;
-	case TUBGETO: put_user(tubp->ocmd, (char *)arg); break;
-	case TUBGETMOD:
-		if (copy_to_user((char *)arg, &tubp->tubiocb,
-		    sizeof tubp->tubiocb))
-			rc = -EFAULT;
-		break;
-	}
-	TUBUNLOCK(tubp->irq, flags);
-	return rc;
-}
-
-/*
- * process read commands for the tube driver
- */
-static ssize_t
-fs3270_read(struct file *fp, char *dp, size_t len, loff_t *off)
-{
-	tub_t *tubp;
-	char *kp;
-	ccw1_t *cp;
-	int rc;
-	long flags;
-	addr_t *idalp, *ip;
-	char *tp;
-	int count, piece;
-	int size;
-
-	if (len == 0 || len > 65535) {
-		return -EINVAL;
-	}
-
-	if ((tubp = INODE2TUB((struct inode *)fp->private_data)) == NULL)
-		return -ENODEV;
-
-	ip = idalp = kmalloc(33*sizeof(addr_t), GFP_ATOMIC|GFP_DMA);
-	if (idalp == NULL)
-		return -EFAULT;
-	memset(idalp, 0, 33 * sizeof *idalp);
-	count = len;
-	while (count) {
-		piece = MIN(count, 0x800);
-		size = count == len? piece: 0x800;
-		if ((kp = kmalloc(size, GFP_KERNEL|GFP_DMA)) == NULL) {
-			len = -ENOMEM;
-			goto do_cleanup;
-		}
-		*ip++ = virt_to_phys(kp);
-		count -= piece;
-	}
-
-	if ((rc = fs3270_wait(tubp, &flags)) != 0) {
-		TUBUNLOCK(tubp->irq, flags);
-		len = rc;
-		goto do_cleanup;
-	}
-	cp = &tubp->rccw;
-	if (tubp->icmd == 0 && tubp->ocmd != 0)  tubp->icmd = 6;
-	cp->cmd_code = tubp->icmd?:2;
-	cp->flags = CCW_FLAG_SLI | CCW_FLAG_IDA;
-	cp->count = len;
-	cp->cda = virt_to_phys(idalp);
-	tubp->flags |= TUB_RDPENDING;
-	TUBUNLOCK(tubp->irq, flags);
-
-	if ((rc = fs3270_wait(tubp, &flags)) != 0) {
-		tubp->flags &= ~TUB_RDPENDING;
-		len = rc;
-		TUBUNLOCK(tubp->irq, flags);
-		goto do_cleanup;
-	}
-	TUBUNLOCK(tubp->irq, flags);
-
-	len -= tubp->cswl;
-	count = len;
-	tp = dp;
-	ip = idalp;
-	while (count) {
-		piece = MIN(count, 0x800);
-		if (copy_to_user(tp, phys_to_virt(*ip), piece) != 0) {
-			len = -EFAULT;
-			goto do_cleanup;
-		}
-		count -= piece;
-		tp += piece;
-		ip++;
-	}
-
-do_cleanup:
-	for (ip = idalp; ip < idalp+33; ip++) {
-		if (*ip == 0)
-			break;
-		kfree(phys_to_virt(*ip));
-	}
-	kfree(idalp);
-	return len;
-}
-
-/*
- * process write commands for the tube driver
- */
-static ssize_t
-fs3270_write(struct file *fp, const char *dp, size_t len, loff_t *off)
-{
-	tub_t *tubp;
-	ccw1_t *cp;
-	int rc;
-	long flags;
-	void *kb;
-	addr_t *idalp, *ip;
-	int count, piece;
-	int index;
-	int size;
-
-	if (len > 65535 || len == 0)
-		return -EINVAL;
-
-	/* Locate the tube */
-	if ((tubp = INODE2TUB((struct inode *)fp->private_data)) == NULL)
-		return -ENODEV;
-
-	ip = idalp = kmalloc(33*sizeof(addr_t), GFP_ATOMIC|GFP_DMA);
-	if (idalp == NULL)
-		return -EFAULT;
-	memset(idalp, 0, 33 * sizeof *idalp);
-
-	count = len;
-	index = 0;
-	while (count) {
-		piece = MIN(count, 0x800);
-		size = count == len? piece: 0x800;
-		if ((kb = kmalloc(size, GFP_KERNEL|GFP_DMA)) == NULL) {
-			len = -ENOMEM;
-			goto do_cleanup;
-		}
-		*ip++ = virt_to_phys(kb);
-		if (copy_from_user(kb, &dp[index], piece) != 0) {
-			len = -EFAULT;
-			goto do_cleanup;
-		}
-		count -= piece;
-		index += piece;
-	}
-
-	/* Wait till tube's not working or signal is pending */
-	if ((rc = fs3270_wait(tubp, &flags))) {
-		len = rc;
-		TUBUNLOCK(tubp->irq, flags);
-		goto do_cleanup;
-	}
-
-	/* Make CCW and start I/O.  Back end will free buffers & idal. */
-	tubp->wbuf = idalp;
-	cp = &tubp->wccw;
-	cp->cmd_code = tubp->ocmd? tubp->ocmd == 5? 13: tubp->ocmd: 1;
-	cp->flags = CCW_FLAG_SLI | CCW_FLAG_IDA;
-	cp->count = len;
-	cp->cda = virt_to_phys(tubp->wbuf);
-	fs3270_io(tubp, cp);
-	TUBUNLOCK(tubp->irq, flags);
-	return len;
-
-do_cleanup:
-	for (ip = idalp; ip < idalp+33; ip++) {
-		if (*ip == 0)
-			break;
-		kfree(phys_to_virt(*ip));
-	}
-	kfree(idalp);
-	return len;
-}
diff -Nru a/drivers/s390/char/tubio.h b/drivers/s390/char/tubio.h
--- a/drivers/s390/char/tubio.h	Tue Feb  3 19:45:28 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,417 +0,0 @@
-/*
- *  IBM/3270 Driver -- Copyright (C) 2000 UTS Global LLC
- *
- *  tubio.h -- All-Purpose header file
- *
- *
- *
- *
- *
- *  Author:  Richard Hitt
- */
-#include <linux/config.h>
-
-#include <linux/module.h>
-#include <linux/version.h>
-#include <linux/tty.h>
-
-#include <linux/major.h>
-#ifndef IBM_TTY3270_MAJOR
-#  define IBM_TTY3270_MAJOR 212
-#endif /* IBM_TTY3270_MAJOR */
-#ifndef IBM_FS3270_MAJOR
-#  define IBM_FS3270_MAJOR 213
-#endif /* IBM_FS3270_MAJOR */
-
-
-#include <linux/slab.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-#include <asm/idals.h>
-#include <linux/console.h>
-#include <linux/interrupt.h>
-#include <asm/ebcdic.h>
-#include <asm/uaccess.h>
-#include <linux/proc_fs.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0))
-#include <linux/devfs_fs_kernel.h>
-#endif
-
-#define TUB(x) (('3'<<8)|(x))
-#define TUBICMD TUB(3)
-#define TUBOCMD TUB(4)
-#define TUBGETI TUB(7)
-#define TUBGETO TUB(8)
-#define TUBSETMOD TUB(12)
-#define TUBGETMOD TUB(13)
-#define TIOPOLL TUB(32)
-#define TIOPOKE TUB(33)
-#define TIONPOKE TUB(34)
-#define TIOTNORM TUB(35)
-
-/* Local Channel Commands */
-#define TC_WRITE   0x01
-#define TC_EWRITE  0x05
-#define TC_READMOD 0x06
-#define TC_EWRITEA 0x0d
-#define TC_WRITESF 0x11
-
-/* Buffer Control Orders */
-#define TO_SF 0x1d
-#define TO_SBA 0x11
-#define TO_IC 0x13
-#define TO_PT 0x05
-#define TO_RA 0x3c
-#define TO_SFE 0x29
-#define TO_EUA 0x12
-#define TO_MF 0x2c
-#define TO_SA 0x28
-
-/* Field Attribute Bytes */
-#define TF_INPUT 0x40           /* Visible input */
-#define TF_INPUTN 0x4c          /* Invisible input */
-#define TF_INMDT 0xc1           /* Visible, Set-MDT */
-#define TF_LOG 0x60
-#define TF_STAT 0x60
-
-/* Character Attribute Bytes */
-#define TAT_RESET 0x00
-#define TAT_FIELD 0xc0
-#define TAT_EXTHI 0x41
-#define TAT_COLOR 0x42
-#define TAT_CHARS 0x43
-#define TAT_TRANS 0x46
-
-/* Extended-Highlighting Bytes */
-#define TAX_RESET 0x00
-#define TAX_BLINK 0xf1
-#define TAX_REVER 0xf2
-#define TAX_UNDER 0xf4
-
-/* Reset value */
-#define TAR_RESET 0x00
-
-/* Color values */
-#define TAC_RESET 0x00
-#define TAC_BLUE 0xf1
-#define TAC_RED 0xf2
-#define TAC_PINK 0xf3
-#define TAC_GREEN 0xf4
-#define TAC_TURQ 0xf5
-#define TAC_YELLOW 0xf6
-#define TAC_WHITE 0xf7
-#define TAC_DEFAULT 0x00
-
-/* Write Control Characters */
-#define TW_NONE 0x40            /* No particular action */
-#define TW_KR 0xc2              /* Keyboard restore */
-#define TW_PLUSALARM 0x04       /* Add this bit for alarm */
-
-/* Attention-ID (AID) Characters */
-#define TA_CLEAR 0x6d
-#define TA_PA2 0x6e
-#define TA_ENTER 0x7d
-/* more to come */
-
-#define MIN(a, b) ((a) < (b)? (a): (b))
-
-#define TUB_BUFADR(adr, cpp) \
-	tty3270_tub_bufadr(tubp, adr, cpp)
-
-#define TUB_EBCASC(addr, nr) codepage_convert(tub_ebcasc, addr, nr)
-#define TUB_ASCEBC(addr, nr) codepage_convert(tub_ascebc, addr, nr)
-
-/*
- *
- * General global values for the tube driver
- *
- */
-enum tubmode {
-	TBM_LN,                 /* Line mode */
-	TBM_FS,                 /* Fullscreen mode */
-	TBM_FSLN                /* Line mode shelled out of fullscreen */
-};
-enum tubstat {              /* normal-mode status */
-	TBS_RUNNING,            /* none of the following */
-	TBS_MORE,               /* timed "MORE..." in status */
-	TBS_HOLD                /* untimed "HOLDING" in status */
-};
-enum tubcmd {           /* normal-mode actions to do */
-	TBC_CONOPEN,		/* Erase-write the console */
-	TBC_OPEN,               /* Open the tty screen */
-	TBC_UPDATE,             /* Add lines to the log, clear cmdline */
-	TBC_UPDLOG,             /* Add lines to log */
-	TBC_KRUPDLOG,           /* Add lines to log, reset kbd */
-	TBC_CLEAR,              /* Build screen from scratch */
-	TBC_CLRUPDLOG,          /* Do log & status, not cmdline */
-	TBC_UPDSTAT,            /* Do status update only */
-	TBC_CLRINPUT,           /* Clear input area only */
-	TBC_UPDINPUT            /* Update input area only */
-};
-enum tubwhat {          /* echo what= proc actions */
-	TW_BOGUS,               /* Nothing at all */
-	TW_CONFIG               /* Output configuration info */
-};
-
-
-
-
-
-#define TUBMAXMINS      256
-#define _GEOM_ROWS 24
-#define _GEOM_COLS 80
-#define GEOM_ROWS (tubp->geom_rows)
-#define GEOM_COLS (tubp->geom_cols)
-#define GEOM_MAXROWS 127
-#define GEOM_MAXCOLS 132
-#define GEOM_INPLEN (GEOM_COLS * 2 - 20)
-#define GEOM_MAXINPLEN (GEOM_MAXCOLS * 2 - 20)
-#define GEOM_INPUT (GEOM_COLS * (GEOM_ROWS - 2) - 1)  /* input atr posn */
-#define GEOM_STAT (GEOM_INPUT + 1 + GEOM_INPLEN)
-#define GEOM_LOG   (GEOM_COLS * GEOM_ROWS - 1)   /* log atr posn */
-#define TS_RUNNING "Linux Running     "
-#define TS_MORE    "Linux More...     "
-#define DEFAULT_SCROLLTIME 5
-#define TS_HOLD    "Linux Holding     "
-/* data length used by tty3270_set_status_area: SBA (3), SF (2), data */
-#define TS_LENGTH (sizeof TS_RUNNING + 3 + 2)
-
-typedef struct {
-	int aid;                        /* What-to-do flags */
-	char *string;                   /* Optional input string */
-} aid_t;
-#define AIDENTRY(ch, tubp)  (&((tubp)->tty_aid[(ch) & 0x3f]))
-
-/* For TUBGETMOD and TUBSETMOD.  Should include. */
-typedef struct tubiocb {
-	short model;
-	short line_cnt;
-	short col_cnt;
-	short pf_cnt;
-	short re_cnt;
-	short map;
-} tubiocb_t;
-
-/* Flags that go in int aid, above */
-#define TA_CLEARKEY     0x01            /* Key does hardware CLEAR */
-#define TA_SHORTREAD    0x02            /* Key does hardware shortread */
-/* If both are off, key does hardware Read Modified. */
-#define TA_DOENTER      0x04            /* Treat key like ENTER */
-#define TA_DOSTRING     0x08            /* Use string and ENTER */
-#define TA_DOSTRINGD    0x10            /* Display string & set MDT */
-#define TA_CLEARLOG     0x20            /* Make key cause clear of log */
-
-/*
- * Tube driver buffer control block
- */
-typedef struct bcb_s {
-	char	*bc_buf;		/* Pointer to buffer */
-	int	bc_len;			/* Length of buffer */
-	int	bc_cnt;			/* Count of bytes buffered */
-	int	bc_wr;			/* Posn to write next byte into */
-	int	bc_rd;			/* Posn to read next byte from */
-} bcb_t;
-
-typedef struct tub_s {
-	int             minor;
-	int             irq;
-	int             irqrc;
-	int             devno;
-	int             geom_rows;
-	int             geom_cols;
-	tubiocb_t       tubiocb;
-	int             lnopen;
-	int             fsopen;
-	int             icmd;
-	int             ocmd;
-	devstat_t       devstat;
-	ccw1_t          rccw;
-	ccw1_t          wccw;
-	addr_t		*wbuf;
-	int             cswl;
-	void            (*intv)(struct tub_s *, devstat_t *);
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
-	struct wait_queue	*waitq;
-#else
-	wait_queue_head_t waitq;
-#endif
-	int             dstat;
-	sense_t         sense;
-	enum tubmode    mode;
-	enum tubstat    stat;
-	enum tubcmd     cmd;
-	int             flags;		/* See below for values */
-	struct tasklet_struct tasklet;
-
-	/* Stuff for fs-driver support */
-	pid_t           fs_pid;         /* Pid if TBM_FS */
-
-
-	/* Stuff for tty-driver support */
-	struct tty_struct *tty;
-	char *tty_input;		/* tty input area */
-	int tty_inattr;         	/* input-area field attribute */
-#define TTY_OUTPUT_SIZE 1024
-	bcb_t tty_bcb;			/* Output buffer control info */
-	int tty_oucol;                  /* Kludge */
-	int tty_nextlogx;               /* next screen-log position */
-	int tty_savecursor;		/* saved cursor position */
-	int tty_scrolltime;             /* scrollforward wait time, sec */
-	struct timer_list tty_stimer;   /* timer for scrolltime */
-	aid_t tty_aid[64];              /* Aid descriptors */
-	int tty_aidinit;                /* Boolean */
-	int tty_showaidx;               /* Last aid x to set_aid */
-	int tty_14bitadr;               /* 14-bit bufadrs okay */
-#define MAX_TTY_ESCA 24			/* Set-Attribute-Order array */
-	char tty_esca[MAX_TTY_ESCA];	/* SA array */
-	int tty_escx;			/* Current index within it */
-
-	/* For command recall --- */
-	char *(*tty_rclbufs)[];         /* Array of ptrs to recall bufs */
-	int tty_rclk;                   /* Size of array tty_rclbufs */
-	int tty_rclp;                   /* Index for most-recent cmd */
-	int tty_rclb;                   /* Index for backscrolling */
-
-	/* Work area to contain the hardware write stream */
-	char (*ttyscreen)[];            /* ptr to data stream area */
-	int ttyscreenl;			/* its length */
-	ccw1_t ttyccw;
-} tub_t;
-
-/* values for flags: */
-#define	TUB_WORKING	0x0001
-#define	TUB_BHPENDING	0x0002
-#define	TUB_RDPENDING	0x0004
-#define	TUB_ALARM	0x0008
-#define	TUB_SCROLLTIMING  0x0010
-#define	TUB_ATTN	0x0020
-#define	TUB_IACTIVE	0x0040
-#define	TUB_SIZED	0x0080
-#define	TUB_EXPECT_DE	0x0100
-#define	TUB_UNSOL_DE	0x0200
-#define	TUB_OPEN_STET	0x0400		/* No screen clear on open */
-#define	TUB_UE_BUSY	0x0800
-#define	TUB_INPUT_HACK	0x1000		/* Early init of command line */
-
-/*
- * Extra stuff for 3270 console support
- */
-#ifdef CONFIG_TN3270_CONSOLE
-extern int tub3270_con_devno;
-extern char (*tub3270_con_output)[];
-extern int tub3270_con_outputl;
-extern int tub3270_con_ouwr;
-extern int tub3270_con_oucount;
-extern int tub3270_con_irq;
-extern tub_t *tub3270_con_tubp;
-extern struct tty_driver tty3270_con_driver;
-#endif /* CONFIG_TN3270_CONSOLE */
-
-extern int tubnummins;
-extern tub_t *(*tubminors)[TUBMAXMINS];
-extern tub_t *(*(*tubirqs)[256])[256];
-extern unsigned char tub_ascebc[256];
-extern unsigned char tub_ebcasc[256];
-extern unsigned char tub_ebcgraf[64];
-extern int tubdebug;
-extern int fs3270_major;
-extern int tty3270_major;
-extern int tty3270_proc_misc;
-extern enum tubwhat tty3270_proc_what;
-extern struct tty_driver *tty3270_driver;
-
-#ifndef spin_trylock_irqsave
-#define spin_trylock_irqsave(lock, flags) \
-({ \
-	int success; \
-	local_irq_save(flags); \
-	success = spin_trylock(lock); \
-	if (success == 0) \
-		local_irq_restore(flags); \
-	success; \
-})
-#endif /* if not spin_trylock_irqsave */
-
-#ifndef s390irq_spin_trylock_irqsave
-#define s390irq_spin_trylock_irqsave(irq, flags) \
-	spin_trylock_irqsave(&(ioinfo[irq]->irq_lock), flags)
-#endif /* if not s390irq_spin_trylock_irqsave */
-
-#define TUBLOCK(irq, flags) \
-	s390irq_spin_lock_irqsave(irq, flags)
-
-#define TUBTRYLOCK(irq, flags) \
-	s390irq_spin_trylock_irqsave(irq, flags)
-
-#define TUBUNLOCK(irq, flags) \
-	s390irq_spin_unlock_irqrestore(irq, flags)
-
-/*
- * Find tub_t * given fullscreen device's irq (subchannel number)
- */
-#if 0
-extern tub_t *tubfindbyirq(int);
-#endif
-#define IRQ2TUB(irq) tubfindbyirq(irq)
-/*
- * Find tub_t * given fullscreen device's inode pointer
- * This algorithm takes into account /dev/3270/tub.
- */
-extern inline tub_t *INODE2TUB(struct inode *ip)
-{
-	unsigned int minor = iminor(ip);
-	tub_t *tubp = NULL;
-	if (minor == 0 && current->tty) {
-		if (current->tty->driver == tty3270_driver)
-			minor = current->tty->index;
-	}
-	if (minor <= tubnummins && minor > 0)
-		tubp = (*tubminors)[minor];
-	return tubp;
-}
-
-/*
- * Find tub_t * given non-fullscreen (tty) device's tty_struct pointer
- */
-extern inline tub_t *TTY2TUB(struct tty_struct *tty)
-{
-	unsigned index = tty->index;
-	tub_t *tubp = NULL;
-
-	if (index <= tubnummins && index > 0)
-		tubp = (*tubminors)[index];
-	return tubp;
-}
-
-extern int tub3270_movedata(bcb_t *, bcb_t *, int);
-#if 0
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
-extern int tubmakemin(int, dev_info_t *);
-#else
-extern int tubmakemin(int, s390_dev_info_t *);
-#endif
-#endif
-extern int tub3270_con_copy(tub_t *);
-extern int tty3270_rcl_init(tub_t *);
-extern int tty3270_rcl_set(tub_t *, char *, int);
-extern void tty3270_rcl_fini(tub_t *);
-extern int tty3270_rcl_get(tub_t *, char *, int, int);
-extern void tty3270_rcl_put(tub_t *, char *, int);
-extern void tty3270_rcl_purge(tub_t *);
-#if 0
-/* these appear to be unused outside of tubttyrcl */
-extern void tty3270_rcl_sync(tub_t *);
-extern int tty3270_rcl_resize(tub_t *, int);
-#endif
-extern int tty3270_size(tub_t *, long *);
-extern int tty3270_aid_init(tub_t *);
-extern void tty3270_aid_fini(tub_t *);
-extern void tty3270_aid_reinit(tub_t *);
-extern int tty3270_aid_get(tub_t *, int, int *, char **);
-extern int tty3270_aid_set(tub_t *, char *, int);
-extern int tty3270_build(tub_t *);
-extern void tty3270_scl_settimer(tub_t *);
-extern void tty3270_scl_resettimer(tub_t *);
-extern int tty3270_scl_set(tub_t *, char *, int);
-extern int tty3270_scl_init(tub_t *tubp);
-extern void tty3270_scl_fini(tub_t *tubp);
diff -Nru a/drivers/s390/char/tubtty.c b/drivers/s390/char/tubtty.c
--- a/drivers/s390/char/tubtty.c	Tue Feb  3 19:45:41 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,955 +0,0 @@
-/*
- *  IBM/3270 Driver -- Copyright (C) 2000, 2001 UTS Global LLC
- *
- *  tubtty.c -- Linemode tty driver
- *
- *
- *
- *
- *
- *  Author:  Richard Hitt
- */
-#include <linux/config.h>
-#include "tubio.h"
-
-/* Initialization & uninitialization for tubtty */
-int tty3270_init(void);
-void tty3270_fini(void);
-
-/* Interface routines from the upper tty layer to the tty driver */
-static int tty3270_open(struct tty_struct *, struct file *);
-static void tty3270_close(struct tty_struct *, struct file *);
-static int tty3270_write(struct tty_struct *, int,
-        const unsigned char *, int);
-static void tty3270_put_char(struct tty_struct *, unsigned char);
-static void tty3270_flush_chars(struct tty_struct *);
-static int tty3270_write_room(struct tty_struct *);
-static int tty3270_chars_in_buffer(struct tty_struct *);
-static int tty3270_ioctl(struct tty_struct *, struct file *,
-	unsigned int cmd, unsigned long arg);
-static void tty3270_set_termios(struct tty_struct *, struct termios *);
-static void tty3270_hangup(struct tty_struct *);
-static void tty3270_flush_buffer(struct tty_struct *);
-static int tty3270_read_proc(char *, char **, off_t, int, int *, void *);
-static int tty3270_write_proc(struct file *, const char *,
-	unsigned long, void *);
-
-/* tty3270 utility functions */
-static void tty3270_tasklet(unsigned long);
-       void tty3270_sched_bh(tub_t *);
-static int tty3270_wait(tub_t *, long *);
-       void tty3270_int(tub_t *, devstat_t *);
-static int tty3270_try_logging(tub_t *);
-static void tty3270_start_input(tub_t *);
-static void tty3270_do_input(tub_t *);
-static void tty3270_do_enter(tub_t *, char *, int);
-static void tty3270_do_showi(tub_t *, char *, int);
-       int tty3270_io(tub_t *);
-static int tty3270_show_tube(int, char *, int);
-
-static int tty3270_major = -1;
-struct tty_driver *tty3270_driver;
-
-static int tty3270_proc_index;
-static int tty3270_proc_data;
-static int tty3270_proc_misc;
-static enum tubwhat tty3270_proc_what;
-
-static struct tty_operations tty3270_ops = {
-	.open = tty3270_open,
-	.close = tty3270_close,
-	.write = tty3270_write,
-	.put_char = tty3270_put_char,
-	.flush_chars = tty3270_flush_chars,
-	.write_room = tty3270_write_room,
-	.chars_in_buffer = tty3270_chars_in_buffer,
-#if 0
-	.ioctl = tty3270_ioctl,
-#endif
-	.set_termios = tty3270_set_termios,
-	.hangup = tty3270_hangup,
-	.flush_buffer = tty3270_flush_buffer,
-	.read_proc = tty3270_read_proc,
-	.write_proc = tty3270_write_proc,
-};
-
-/*
- * tty3270_init() -- Register the tty3270 driver
- */
-int
-tty3270_init(void)
-{
-	struct tty_driver *td = alloc_tty_driver(TUBMAXMINS);
-	int rc;
-
-	if (!td)
-		return -ENOMEM;
-
-	/* Initialize for tty driver */
-	td->owner = THIS_MODULE;
-	td->driver_name = "tty3270";
-	td->name = "tty3270";
-	td->major = IBM_TTY3270_MAJOR;
-	td->minor_start = 0;
-	td->type = TTY_DRIVER_TYPE_SYSTEM;
-	td->subtype = SYSTEM_TYPE_TTY;
-	td->init_termios = tty_std_termios;
-	td->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_NO_DEVFS;
-	tty_set_operations(td, &tty3270_ops);
-	rc = tty_register_driver(td);
-	if (rc) {
-		put_tty_driver(td);
-		printk(KERN_ERR "tty3270 registration failed with %d\n", rc);
-	} else {
-		tty3270_major = IBM_TTY3270_MAJOR;
-		if (td->proc_entry != NULL)
-			td->proc_entry->mode = S_IRUGO | S_IWUGO;
-		tty3270_driver = td;
-	}
-	return rc;
-}
-
-/*
- * tty3270_fini() -- Uninitialize linemode tubes
- */
-void
-tty3270_fini(void)
-{
-	if (tty3270_major != -1) {
-		tty_unregister_driver(tty3270_driver);
-		put_tty_driver(tty3270_driver);
-		tty3270_driver = NULL;
-		tty3270_major = -1;
-	}
-}
-
-static int 
-tty3270_open(struct tty_struct *tty, struct file *filp)
-{
-	tub_t *tubp;
-	long flags;
-	int rc;
-	int cmd;
-
-	if ((tubp = TTY2TUB(tty)) == NULL) {
-		return -ENODEV;
-	}
-
-	if ((rc = tty3270_wait(tubp, &flags)) != 0)
-		goto do_fail;
-	if (tubp->lnopen > 0) {
-		tubp->lnopen++;
-		TUBUNLOCK(tubp->irq, flags);
-		return 0;
-	}
-	if (tubp->flags & TUB_OPEN_STET) {
-		cmd = TBC_UPDLOG;
-	} else {
-		cmd = TBC_OPEN;
-		tubp->flags &= ~TUB_SIZED;
-	}
-	if ((rc = tty3270_size(tubp, &flags)) != 0)
-		goto do_fail;
-	if ((rc = tty3270_rcl_init(tubp)) != 0)
-		goto do_fail;
-	if ((rc = tty3270_aid_init(tubp)) != 0)
-		goto do_fail;
-	if ((rc = tty3270_scl_init(tubp)) != 0)
-		goto do_fail;
-	tubp->mode = TBM_LN;
-	tubp->intv = tty3270_int;
-	tubp->tty = tty;
-	tubp->lnopen = 1;
-	tty->driver_data = tubp;
-	tty->winsize.ws_row = tubp->geom_rows - 2;
-	tty->winsize.ws_col = tubp->geom_cols;
-	if (tubp->tty_input == NULL)
-		tubp->tty_input = kmalloc(GEOM_INPLEN, GFP_KERNEL|GFP_DMA);
-	tubp->tty_inattr = TF_INPUT;
-	tubp->cmd = cmd;
-	tty3270_build(tubp);
-	TUBUNLOCK(tubp->irq, flags);
-	return 0;
-
-do_fail:
-	tty3270_scl_fini(tubp);
-	tty3270_aid_fini(tubp);
-	tty3270_rcl_fini(tubp);
-	TUBUNLOCK(tubp->irq, flags);
-	return rc;
-}
-
-static void
-tty3270_close(struct tty_struct *tty, struct file *filp)
-{
-	tub_t *tubp;
-	long flags;
-
-	if ((tubp = tty->driver_data) == NULL)
-		return;
-
-	tty3270_wait(tubp, &flags);
-	if (--tubp->lnopen > 0)
-		goto do_return;
-	tubp->tty = NULL;
-	tty->driver_data = NULL;
-	tty3270_aid_fini(tubp);
-	tty3270_rcl_fini(tubp);
-	tty3270_scl_fini(tubp);
-do_return:
-	TUBUNLOCK(tubp->irq, flags);
-}
-
-static int 
-tty3270_write(struct tty_struct *tty, int fromuser,
-		const unsigned char *buf, int count)
-{
-	tub_t *tubp;
-	long flags;
-	bcb_t obcb;
-	int rc = 0;
-
-	if ((tubp = tty->driver_data) == NULL)
-		return -1;
-
-#ifdef CONFIG_TN3270_CONSOLE
-	if (CONSOLE_IS_3270 && tub3270_con_tubp == tubp)
-		tub3270_con_copy(tubp);
-#endif /* CONFIG_TN3270_CONSOLE */
-
-	obcb.bc_buf = (char *)buf;
-	obcb.bc_len = obcb.bc_cnt = obcb.bc_wr = count;
-	obcb.bc_rd = 0;
-
-	TUBLOCK(tubp->irq, flags);
-	rc = tub3270_movedata(&obcb, &tubp->tty_bcb, fromuser);
-	tty3270_try_logging(tubp);
-	TUBUNLOCK(tubp->irq, flags);
-	return rc;
-} 
-
-static void
-tty3270_put_char(struct tty_struct *tty, unsigned char ch)
-{
-	long flags;
-	tub_t *tubp;
-	bcb_t *ob;
-
-	if ((tubp = tty->driver_data) == NULL)
-		return;
-
-	TUBLOCK(tubp->irq, flags);
-	ob = &tubp->tty_bcb;
-	if (ob->bc_cnt < ob->bc_len) {
-		ob->bc_buf[ob->bc_wr++] = ch;
-		if (ob->bc_wr == ob->bc_len)
-			ob->bc_wr = 0;
-		ob->bc_cnt++;
-	}
-	tty3270_try_logging(tubp);
-	TUBUNLOCK(tubp->irq, flags);
-}
-
-static void
-tty3270_flush_chars(struct tty_struct *tty)
-{
-	tub_t *tubp;
-	long flags;
-
-	if ((tubp = tty->driver_data) == NULL)
-		return;
-
-	TUBLOCK(tubp->irq, flags);
-	tty3270_try_logging(tubp);
-	TUBUNLOCK(tubp->irq, flags);
-}
-
-static int 
-tty3270_write_room(struct tty_struct *tty)
-{
-	tub_t *tubp;
-	bcb_t *ob;
-
-	if ((tubp = tty->driver_data) == NULL)
-		return -1;
-
-	ob = &tubp->tty_bcb;
-	return ob->bc_len - ob->bc_cnt;
-}
-
-static int
-tty3270_chars_in_buffer(struct tty_struct *tty)
-{
-	tub_t *tubp;
-	bcb_t *ob;
-
-	if ((tubp = tty->driver_data) == NULL)
-		return -1;
-
-	ob = &tubp->tty_bcb;
-	return ob->bc_cnt;
-}
-
-static int
-tty3270_ioctl(struct tty_struct *tty, struct file *file,
-		unsigned int cmd, unsigned long arg)
-{
-	tub_t *tubp;
-	long flags;
-	int ret = 0;
-	struct termios termios;
-
-	if ((tubp = tty->driver_data) == NULL)
-		return -ENODEV;
-
-	TUBLOCK(tubp->irq, flags);
-	if (tty->flags * (1 << TTY_IO_ERROR)) {
-		ret = -EIO;
-		goto do_return;
-	}
-	switch(cmd) {
-	case TCGETS:
-		ret = -ENOIOCTLCMD;
-		goto do_return;
-	case TCFLSH:            /* arg:  2 or 0 */
-		ret = -ENOIOCTLCMD;
-		goto do_return;
-	case TCSETSF:
-		if (user_termios_to_kernel_termios(&termios,
-		    (struct termios *)arg)) {
-			ret = -EFAULT;
-			goto do_return;
-		}
-		ret = -ENOIOCTLCMD;
-		goto do_return;
-	case TCGETA:
-		ret = -ENOIOCTLCMD;
-		goto do_return;
-	case TCSETA:
-		if (user_termio_to_kernel_termios(&termios,
-		    (struct termio *)arg)) {
-			ret = -EFAULT;
-			goto do_return;
-		}
-		ret = -ENOIOCTLCMD;
-		goto do_return;
-	default:
-		ret = -ENOIOCTLCMD;
-		break;
-	}
-
-do_return:
-	TUBUNLOCK(tubp->irq, flags);
-	return ret;
-}
-
-static void
-tty3270_set_termios(struct tty_struct *tty, struct termios *old)
-{
-	tub_t *tubp;
-	long flags;
-	int new;
-
-	if ((tubp = tty->driver_data) == NULL)
-		return;
-
-	if (tty3270_wait(tubp, &flags) != 0) {
-		TUBUNLOCK(tubp->irq, flags);
-		return;
-	}
-	new = L_ICANON(tty)? L_ECHO(tty)? TF_INPUT: TF_INPUTN:
-		tubp->tty_inattr;
-	if (new != tubp->tty_inattr) {
-		tubp->tty_inattr = new;
-		tubp->cmd = TBC_CLRINPUT;
-		tty3270_build(tubp);
-	}
-
-	TUBUNLOCK(tubp->irq, flags);
-}
-
-static void
-tty3270_flush_buffer(struct tty_struct *tty)
-{
-	tub_t *tubp;
-	bcb_t *ob;
-	long flags;
-
-	if ((tubp = tty->driver_data) == NULL)
-		return;
-
-	if (tubp->mode == TBM_FS && tubp->fs_pid != 0) {
-		kill_proc(tubp->fs_pid, SIGHUP, 1);
-	}
-
-	if ((tubp->flags & TUB_OPEN_STET) == 0) {
-		ob = &tubp->tty_bcb;
-		TUBLOCK(tubp->irq, flags);
-		ob->bc_rd = 0;
-		ob->bc_wr = 0;
-		ob->bc_cnt = 0;
-		TUBUNLOCK(tubp->irq, flags);
-	}
-	wake_up_interruptible(&tty->write_wait);
-	if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
-	    tty->ldisc.write_wakeup)
-		(tty->ldisc.write_wakeup)(tty);
-}
-
-static int
-tty3270_read_proc(char *buf, char **start, off_t off, int count,
-		int *eof, void *data)
-{
-	tub_t *tubp;
-	int begin = 0;
-	int i;
-	int rc;
-	int len = 0;
-
-	if (tty3270_proc_what == TW_CONFIG) {
-		/*
-		 * Describe the 3270 configuration in ascii lines.
-		 * Line 1:		0 <fsmajor> 0
-		 * Console line:	<devnum> CONSOLE <minor>
-		 * Other lines:		<devnum> <ttymajor> <minor>
-		 */
-		len += sprintf(buf + len, "0 %d 0\n", fs3270_major);
-		for (i = 1; i <= tubnummins; i++) {
-			tubp = (*tubminors)[i];
-#ifdef CONFIG_TN3270_CONSOLE
-			if (CONSOLE_IS_3270 && tubp == tub3270_con_tubp)
-				len += sprintf(buf + len, "%.4x CONSOLE %d\n",
-					       tubp->devno, i);
-			else
-#endif
-				len += sprintf(buf + len, "%.4x %d %d\n",
-					       tubp->devno, tty3270_major, i);
-			if (begin + len > off + count)
-				break;
-			if (begin + len < off) {
-				begin += len;
-				len = 0;
-			}
-		}
-		if (i > tubnummins)
-			*eof = 1;
-		if (off >= begin + len) {
-			rc = 0;
-		} else {
-			*start = buf + off - begin;
-			rc = MIN(count, begin + len - off);
-		}
-		if (*eof && rc == 0)
-			tty3270_proc_what = TW_BOGUS;
-		return rc;
-	}
-
-	len += sprintf(buf, "There are %d devices.  fs major is %d, "
-		"tty major is %d.\n", tubnummins, fs3270_major,
-		tty3270_major);
-	len += sprintf(buf+len, "        index=%d data=%d misc=%d\n",
-		tty3270_proc_index,
-		tty3270_proc_data,
-		tty3270_proc_misc);
-
-	/*
-	 * Display info for the tube with minor nr in index
-	 */
-	len += tty3270_show_tube(tty3270_proc_index, buf+len, count-len);
-
-	*eof = 1;
-	if (off >= begin + len)
-		return 0;
-	*start = buf + off - begin;
-	return MIN(count, begin + len - off);
-}
-
-static int
-tty3270_write_proc(struct file *file, const char *buffer,
-		unsigned long count, void *data)
-{
-	char mybuf[GEOM_MAXINPLEN];
-	int mycount;
-	tub_t *tubp;
-	struct tty_struct *tty;
-	int rc;
-
-	mycount = MIN(count, sizeof mybuf - 1);
-	if (copy_from_user(mybuf, buffer, mycount) != 0)
-		return -EFAULT;
-	mybuf[mycount] = '\0';
-
-	/*
-	 * User-mode settings affect only the current tty ---
-	 */
-	tubp = NULL;
-	tty = current->tty;
-	if (tty && tty->driver == tty3270_driver)
-		tubp = (*tubminors)[tty->index];
-	if (tubp) {
-		if ((rc = tty3270_aid_set(tubp, mybuf, mycount + 1)))
-			return rc > 0? count: rc;
-		if ((rc = tty3270_rcl_set(tubp, mybuf, mycount + 1)))
-			return rc > 0? count: rc;
-		if ((rc = tty3270_scl_set(tubp, mybuf, mycount + 1)))
-			return rc > 0? count: rc;
-	}
-
-	/*
-	 * Superuser-mode settings affect the driver overall ---
-	 */
-	if (!capable(CAP_SYS_TTY_CONFIG)) {
-		return -EPERM;
-	} else if (strncmp(mybuf, "index=", 6) == 0) {
-		tty3270_proc_index = simple_strtoul(mybuf + 6, 0,0);
-		return count;
-	} else if (strncmp(mybuf, "data=", 5) == 0) {
-		tty3270_proc_data = simple_strtoul(mybuf + 5, 0, 0);
-		return count;
-	} else if (strncmp(mybuf, "misc=", 5) == 0) {
-		tty3270_proc_misc = simple_strtoul(mybuf + 5, 0, 0);
-		return count;
-	} else if (strncmp(mybuf, "what=", 5) == 0) {
-		if (strcmp(mybuf+5, "bogus") == 0)
-			tty3270_proc_what = 0;
-		else if (strncmp(mybuf+5, "config", 6) == 0)
-			tty3270_proc_what = TW_CONFIG;
-		return count;
-	} else {
-		return -EINVAL;
-	}
-}
-
-static void
-tty3270_hangup(struct tty_struct *tty)
-{
-	tub_t *tubp;
-	extern void fs3270_release(tub_t *);
-
-	if ((tubp = tty->driver_data) == NULL)
-		return;
-	tty3270_rcl_purge(tubp);
-	tty3270_aid_reinit(tubp);
-	fs3270_release(tubp);
-}
-
-
-/*
- * tty3270_tasklet(tubp) -- Perform back-half processing
- */
-static void
-tty3270_tasklet(unsigned long data)
-{
-	tub_t *tubp;
-	ioinfo_t *ioinfop;
-	long flags;
-	struct tty_struct *tty;
-
-	tubp = (tub_t *) data;
-	ioinfop = ioinfo[tubp->irq];
-	while (TUBTRYLOCK(tubp->irq, flags) == 0) {
-		if (ioinfop->ui.flags.unready == 1)
-			return;
-	}
-	if (ioinfop->ui.flags.unready == 1 ||
-	    ioinfop->ui.flags.ready == 0)
-		goto do_unlock;
-
-	tubp->flags &= ~TUB_BHPENDING;
-	tty = tubp->tty;
-
-	if (tubp->flags & TUB_UNSOL_DE) {
-		tubp->flags &= ~TUB_UNSOL_DE;
-		if (tty != NULL) {
-			tty_hangup(tty);
-			wake_up_interruptible(&tubp->waitq);
-			goto do_unlock;
-		}
-	}
-
-	if (tubp->flags & TUB_IACTIVE) {        /* If read ended, */
-		tty3270_do_input(tubp);
-		tubp->flags &= ~TUB_IACTIVE;
-	}
-
-	if ((tubp->flags & TUB_WORKING) == 0) {
-		if (tubp->flags & TUB_ATTN) {
-			tty3270_start_input(tubp);
-			tubp->flags &= ~TUB_ATTN;
-		} else if (tty3270_try_logging(tubp) == 0) {
-			wake_up_interruptible(&tubp->waitq);
-		}
-	}
-
-	if (tty != NULL) {
-		if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
-		    tty->ldisc.write_wakeup != NULL)
-			(tty->ldisc.write_wakeup)(tty);
-		wake_up_interruptible(&tty->write_wait);
-	}
-do_unlock:
-	TUBUNLOCK(tubp->irq, flags);
-}
-
-/*
- * tty3270_sched_bh(tubp) -- Schedule the back half
- * Irq lock must be held on entry and remains held on exit.
- */
-void
-tty3270_sched_bh(tub_t *tubp)
-{
-	if (tubp->flags & TUB_BHPENDING)
-		return;
-	tubp->flags |= TUB_BHPENDING;
-	tasklet_init(&tubp->tasklet, tty3270_tasklet,
-		     (unsigned long) tubp);
-	tasklet_schedule(&tubp->tasklet);
-}
-
-/*
- * tty3270_io() -- Perform line-mode reads and writes here
- */
-int 
-tty3270_io(tub_t *tubp)
-{
-	int rc;
-	ccw1_t *ccwp;
-
-	tubp->flags |= TUB_WORKING;
-	tubp->dstat = 0;
-	ccwp = &tubp->ttyccw;
-
-	rc = do_IO(tubp->irq, ccwp, tubp->irq, 0, 0);
-	return rc;
-}
-
-/*
- * tty3270_wait(tubp) -- Wait until TUB_WORKING is off
- * On entry the lock must not be held; on exit it is held.
- */
-static int
-tty3270_wait(tub_t *tubp, long *flags)
-{
-	DECLARE_WAITQUEUE(wait, current);
-
-	TUBLOCK(tubp->irq, *flags);
-	add_wait_queue(&tubp->waitq, &wait);
-	while (!signal_pending(current) &&
-	    (tubp->flags & TUB_WORKING) != 0) {
-#warning FIXME: [kj] use set_current_state instead of current->state=
-		current->state = TASK_INTERRUPTIBLE;
-		TUBUNLOCK(tubp->irq, *flags);
-		schedule();
-#warning FIXME: [kj] use set_current_state instead of current->state=
-		current->state = TASK_RUNNING;
-		TUBLOCK(tubp->irq, *flags);
-	}
-	remove_wait_queue(&tubp->waitq, &wait);
-	return signal_pending(current)? -ERESTARTSYS: 0;
-}
-
-void
-tty3270_int(tub_t *tubp, devstat_t *dsp)
-{
-#define	DEV_UE_BUSY \
-	(DEV_STAT_CHN_END | DEV_STAT_DEV_END | DEV_STAT_UNIT_EXCEP)
-#define DEV_NOT_WORKING \
-	(DEV_STAT_ATTENTION | DEV_STAT_DEV_END | DEV_STAT_UNIT_CHECK)
-
-	tubp->dstat = dsp->dstat;
-
-	/* Handle CE-DE-UE and subsequent UDE */
-	if (dsp->dstat == DEV_UE_BUSY) {
-		tubp->flags |= TUB_UE_BUSY;
-		return;
-	} else if (tubp->flags & TUB_UE_BUSY) {
-		tubp->flags &= ~TUB_UE_BUSY;
-		if (dsp->dstat == DEV_STAT_DEV_END &&
-		    (tubp->flags & TUB_WORKING) != 0) {
-			tty3270_io(tubp);
-			return;
-		}
-	}
-
-	/* Handle ATTN */
-	if (dsp->dstat & DEV_STAT_ATTENTION)
-		tubp->flags |= TUB_ATTN;
-
-	if (dsp->dstat & DEV_STAT_CHN_END) {
-		tubp->cswl = dsp->rescnt;
-		if ((dsp->dstat & DEV_STAT_DEV_END) == 0)
-			tubp->flags |= TUB_EXPECT_DE;
-		else
-			tubp->flags &= ~TUB_EXPECT_DE;
-	} else if (dsp->dstat & DEV_STAT_DEV_END) {
-		if ((tubp->flags & TUB_EXPECT_DE) == 0)
-			tubp->flags |= TUB_UNSOL_DE;
-		tubp->flags &= ~TUB_EXPECT_DE;
-	}
-	if (dsp->dstat & DEV_NOT_WORKING)
-		tubp->flags &= ~TUB_WORKING;
-	if (dsp->dstat & DEV_STAT_UNIT_CHECK)
-		tubp->sense = dsp->ii.sense;
-	if ((tubp->flags & TUB_WORKING) == 0)
-		tty3270_sched_bh(tubp);
-}
-
-/*
- * tty3270_refresh(), called by fs3270_close() when tubp->fsopen == 0.
- * On entry, lock is held.
- */
-void
-tty3270_refresh(tub_t *tubp)
-{
-	if (tubp->lnopen) {
-		tubp->mode = TBM_LN;
-		tubp->intv = tty3270_int;
-		tty3270_scl_resettimer(tubp);
-		tubp->cmd = TBC_UPDATE;
-		tty3270_build(tubp);
-	}
-}
-
-static int
-tty3270_try_logging(tub_t *tubp)
-{
-	if (tubp->flags & TUB_WORKING)
-		return 0;
-	if (tubp->mode == TBM_FS)
-		return 0;
-	if (tubp->stat == TBS_HOLD)
-		return 0;
-	if (tubp->stat == TBS_MORE)
-		return 0;
-#ifdef CONFIG_TN3270_CONSOLE
-	if (CONSOLE_IS_3270 && tub3270_con_tubp == tubp)
-		tub3270_con_copy(tubp);
-#endif /* CONFIG_TN3270_CONSOLE */
-	if (tubp->tty_bcb.bc_cnt == 0)
-		return 0;
-	if (tubp->intv != tty3270_int)
-		return 0;
-	tubp->cmd = TBC_UPDLOG;
-	return tty3270_build(tubp);
-}
-
-/* tty3270 utility functions */
-
-static void
-tty3270_start_input(tub_t *tubp)
-{
-	if (tubp->tty_input == NULL)
-		return;
-	tubp->ttyccw.cda = virt_to_phys(tubp->tty_input);
-	tubp->ttyccw.cmd_code = TC_READMOD;
-	tubp->ttyccw.count = GEOM_INPLEN;
-	tubp->ttyccw.flags = CCW_FLAG_SLI;
-	tty3270_io(tubp);
-	tubp->flags |= TUB_IACTIVE;
-}
-
-static void
-tty3270_do_input(tub_t *tubp)
-{
-	int count;
-	char *in;
-	int aidflags;
-	char *aidstring;
-
-	count = GEOM_INPLEN - tubp->cswl;
-	if ((in = tubp->tty_input) == NULL)
-		goto do_build;
-	tty3270_aid_get(tubp, in[0], &aidflags, &aidstring);
-
-	if (aidflags & TA_CLEARKEY) {
-		tubp->stat = TBS_RUNNING;
-		tty3270_scl_resettimer(tubp);
-		tubp->cmd = TBC_UPDATE;
-	} else if (aidflags & TA_CLEARLOG) {
-		tubp->stat = TBS_RUNNING;
-		tty3270_scl_resettimer(tubp);
-		tubp->cmd = TBC_CLRUPDLOG;
-	} else if (aidflags & TA_DOENTER) {
-		if (count <= 6) {
-			switch(tubp->stat) {
-			case TBS_MORE:
-				tubp->stat = TBS_HOLD;
-				tty3270_scl_resettimer(tubp);
-				break;
-			case TBS_HOLD:
-				tubp->stat = TBS_MORE;
-				tty3270_scl_settimer(tubp);
-				break;
-			case TBS_RUNNING:
-                                tty3270_do_enter(tubp, in + 6, 0);
-				break;
-			}
-			tubp->cmd = TBC_UPDSTAT;
-			goto do_build;
-		}
-		in += 6;
-		count -= 6;
-		TUB_EBCASC(in, count);
-		tubp->cmd = TBC_CLRINPUT;
-		tty3270_do_enter(tubp, in, count);
-	} else if ((aidflags & TA_DOSTRING) != 0 && aidstring != NULL) {
-		tubp->cmd = TBC_KRUPDLOG;
-		tty3270_do_enter(tubp, aidstring, strlen(aidstring));
-	} else if ((aidflags & TA_DOSTRINGD) != 0 && aidstring != NULL) {
-		tty3270_do_showi(tubp, aidstring, strlen(aidstring));
-		tubp->cmd = TBC_UPDINPUT;
-	} else {
-		if (in[0] != 0x60)
-			tubp->flags |= TUB_ALARM;
-		tubp->cmd = TBC_KRUPDLOG;
-	}
-do_build:
-	tty3270_build(tubp);
-}
-
-static void
-tty3270_do_enter(tub_t *tubp, char *cp, int count)
-{
-	struct tty_struct *tty;
-	int func = -1;
-
-	if ((tty = tubp->tty) == NULL)
-		return;
-	if (count < 0)
-		return;
-	if (count == 2 && (cp[0] == '^' || cp[0] == '\252')) {
-		switch(cp[1]) {
-		case 'c':  case 'C':
-			func = INTR_CHAR(tty);
-			break;
-		case 'd':  case 'D':
-			func = EOF_CHAR(tty);
-			break;
-		case 'z':  case 'Z':
-			func = SUSP_CHAR(tty);
-			break;
-		}
-	} else if (count == 2 && cp[0] == 0x1b) {        /* if ESC */
-		int inc = 0;
-		char buf[GEOM_INPLEN + 1];
-		int len;
-
-		switch(cp[1]) {
-		case 'k':  case 'K':
-			inc = -1;
-			break;
-		case 'j':  case 'J':
-			inc = 1;
-			break;
-		}
-		if (inc == 0)
-			goto not_rcl;
-		len = tty3270_rcl_get(tubp, buf, sizeof buf, inc);
-		if (len == 0) {
-			tubp->flags |= TUB_ALARM;
-			return;
-		}
-		tty3270_do_showi(tubp, buf, len);
-		tubp->cmd = TBC_UPDINPUT;
-		return;
-	}
-not_rcl:
-	if (func != -1) {
-		*tty->flip.flag_buf_ptr++ = TTY_NORMAL;
-		*tty->flip.char_buf_ptr++ = func;
-		tty->flip.count++;
-	} else {
-		tty3270_rcl_put(tubp, cp, count);
-		memcpy(tty->flip.char_buf_ptr, cp, count);
-		/* Add newline unless line ends with "^n" */
-		if (count < 2 || cp[count - 1] != 'n' ||
-		    (cp[count - 2] != '^' && cp[count - 2] != '\252')) {
-			tty->flip.char_buf_ptr[count] = '\n';
-			count++;
-		} else {
-			count -= 2;     /* Lop trailing "^n" from text */
-		}
-		memset(tty->flip.flag_buf_ptr, TTY_NORMAL, count);
-		tty->flip.char_buf_ptr += count;
-		tty->flip.flag_buf_ptr += count;
-		tty->flip.count += count;
-	}
-	tty_flip_buffer_push(tty);
-}
-
-static void
-tty3270_do_showi(tub_t *tubp, char *cp, int cl)
-{
-	if (cl > GEOM_INPLEN)
-		cl = GEOM_INPLEN;
-	memset(tubp->tty_input, 0, GEOM_INPLEN);
-	memcpy(tubp->tty_input, cp, cl);
-	TUB_ASCEBC(tubp->tty_input, cl);
-}
-
-
-
-/* Debugging routine */
-static int
-tty3270_show_tube(int minor, char *buf, int count)
-{
-	tub_t *tubp;
-	struct tty_struct *tty;
-	struct termios *mp;
-	int len;
-
-/*012345678901234567890123456789012345678901234567890123456789       */
-/*Info for tub_t[dd] at xxxxxxxx:                                    */
-/*    geom:  rows=dd cols=dd model=d                                 */
-/*    lnopen=dd     fsopen=dd   waitq=xxxxxxxx                       */
-/*    dstat=xx      mode=dd     stat=dd     flags=xxxx               */
-/*    oucount=dddd  ourd=ddddd  ouwr=ddddd  nextlogx=ddddd           */
-/*    tty=xxxxxxxx                                                   */
-/*    write_wait=xxxxxxxx read_wait=xxxxxxxx                         */
-/*    iflag=xxxxxxxx oflag=xxxxxxxx cflag=xxxxxxxx lflag=xxxxxxxx    */
-
-	if (minor < 0 || minor > tubnummins ||
-	    (tubp = (*tubminors)[minor]) == NULL)
-		return sprintf(buf, "No tube at index=%d\n", minor);
-	
-	tty = tubp->tty;
-	len = 0;
-
-	len += sprintf(buf+len, "Info for tub_t[%d] at %p:\n", minor, tubp);
-
-	len += sprintf(buf+len, "inattr is at %p\n", &tubp->tty_inattr);
-
-
-	len += sprintf(buf+len, "    geom:  rows=%.2d cols=%.2d model=%.1d\n",
-		       tubp->geom_rows, tubp->geom_cols, tubp->tubiocb.model);
-
-	len += sprintf(buf+len,
-		       "    lnopen=%-2d     fsopen=%-2d   waitq=%p\n",
-		       tubp->lnopen, tubp->fsopen, &tubp->waitq);
-
-	len += sprintf(buf+len, "    dstat=%.2x      mode=%-2d     "
-		       "stat=%-2d     flags=%-4x\n", tubp->dstat,
-		       tubp->mode, tubp->stat, tubp->flags);
-
-#ifdef RBH_FIXTHIS
-	len += sprintf(buf+len,
-		       "    oucount=%-4d  ourd=%-5d  ouwr=%-5d"
-		       "  nextlogx=%-5d\n", tubp->tty_oucount,
-		       tubp->tty_ourd, tubp->tty_ouwr, tubp->tty_nextlogx);
-#endif
-
-	len += sprintf(buf+len, "    tty=%p\n",tubp->tty);
-
-	if (tty)
-		len += sprintf(buf+len,
-				"    write_wait=%p read_wait=%p\n",
-				&tty->write_wait, &tty->read_wait);
-
-	if (tty && ((mp = tty->termios)))
-		len += sprintf(buf+len,"    iflag=%.8x oflag=%.8x "
-			       "cflag=%.8x lflag=%.8x\n", mp->c_iflag,
-			       mp->c_oflag, mp->c_cflag, mp->c_lflag);
-
-
-	return len;
-}
diff -Nru a/drivers/s390/char/tubttyaid.c b/drivers/s390/char/tubttyaid.c
--- a/drivers/s390/char/tubttyaid.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,205 +0,0 @@
-/*
- *  IBM/3270 Driver -- Copyright (C) 2000 UTS Global LLC
- *
- *  tubttyaid.c -- Linemode Attention-ID functionality
- *
- *
- *
- *
- *
- *  Author:  Richard Hitt
- */
-#include "tubio.h"
-
-#define PA1_STR "^C"
-#define PF3_STR "^D"
-#define PF9_STR "\033j"
-#define PF10_STR "\033k"
-#define PF11_STR "\033j"
-/* other AID-key default strings */
-
-static aid_t aidtab[64] = {
-/* 00         */	{ 0, 0 },
-/* C1 = PF13  */	{ TA_DOSTRING, 0 },
-/* C2 = PF14  */	{ TA_DOSTRING, 0 },
-/* C3 = PF15  */	{ TA_DOSTRING, 0 },
-/* C4 = PF16  */	{ TA_DOSTRING, 0 },
-/* C5 = PF17  */	{ TA_DOSTRING, 0 },
-/* C6 = PF18  */	{ TA_DOSTRING, 0 },
-/* C7 = PF19  */	{ TA_DOSTRING, 0 },
-/* C8 = PF20  */	{ TA_DOSTRING, 0 },
-/* C9 = PF21  */	{ TA_DOSTRING, 0 },
-/* 4A = PF22  */	{ TA_DOSTRING, 0 },
-/* 4B = PF23  */	{ TA_DOSTRING, 0 },
-/* 4C = PF24  */	{ TA_DOSTRING, 0 },
-/* 0D         */	{ 0, 0 },
-/* 0E         */	{ 0, 0 },
-/* 0F         */	{ 0, 0 },
-/* 10         */	{ 0, 0 },
-/* 11         */	{ 0, 0 },
-/* 12         */	{ 0, 0 },
-/* 13         */	{ 0, 0 },
-/* 14         */	{ 0, 0 },
-/* 15         */	{ 0, 0 },
-/* 16         */	{ 0, 0 },
-/* 17         */	{ 0, 0 },
-/* 18         */	{ 0, 0 },
-/* 19         */	{ 0, 0 },
-/* 1A         */	{ 0, 0 },
-/* 1B         */	{ 0, 0 },
-/* 1C         */	{ 0, 0 },
-/* 1D         */	{ 0, 0 },
-/* 1E         */	{ 0, 0 },
-/* 1F         */	{ 0, 0 },
-/* 60 = NoAID */	{ 0, 0 },
-/* 21         */	{ 0, 0 },
-/* 22         */	{ 0, 0 },
-/* 23         */	{ 0, 0 },
-/* 24         */	{ 0, 0 },
-/* 25         */	{ 0, 0 },
-/* E6 = OpRdr */	{ 0, 0 },
-/* E7 = MSRdr */	{ 0, 0 },
-/* E8 = NoAID */	{ 0, 0 },
-/* 29         */	{ 0, 0 },
-/* 2A         */	{ 0, 0 },
-/* 6B =  PA3  */        { TA_SHORTREAD, 0 },
-/* 6C =  PA1  */        { TA_SHORTREAD | TA_DOSTRING, PA1_STR },
-/* 6D = CLEAR */        { TA_SHORTREAD | TA_CLEARKEY, 0 },
-/* 6E =  PA2  */        { TA_SHORTREAD | TA_CLEARLOG, 0 },
-/* 2F         */	{ 0, 0 },
-/* F0 = TstRq */        { 0, 0 },
-/* F1 =  PF1  */	{ TA_DOSTRING, 0 },
-/* F2 =  PF2  */	{ TA_DOSTRING, 0 },
-/* F3 =  PF3  */        { TA_DOSTRING, PF3_STR },
-/* F4 =  PF4  */	{ TA_DOSTRING, 0 },
-/* F5 =  PF5  */	{ TA_DOSTRING, 0 },
-/* F6 =  PF6  */	{ TA_DOSTRING, 0 },
-/* F7 =  PF7  */	{ TA_DOSTRING, 0 },
-/* F8 =  PF8  */	{ TA_DOSTRING, 0 },
-/* F9 =  PF9  */        { TA_DOSTRING, PF9_STR },
-/* 7A = PF10  */        { TA_DOSTRING, PF10_STR },
-/* 7B = PF11  */        { TA_DOSTRING, PF11_STR },
-/* 7C = PF12  */	{ TA_DOSTRING, 0 },
-/* 7D = ENTER */        { TA_DOENTER, 0 },
-/* 7E = Pen   */        { 0, 0 },
-/* 3F         */	{ 0, 0 },
-};
-
-int
-tty3270_aid_init(tub_t *tubp)
-{
-	memcpy(tubp->tty_aid, aidtab, sizeof aidtab);
-	tubp->tty_aidinit = 1;
-	return 0;
-}
-
-void
-tty3270_aid_fini(tub_t *tubp)
-{
-	int i;
-	char *sp;
-
-	if (tubp->tty_aidinit == 0)
-		return;
-	for (i = 0; i < 64; i++) {
-		if ((sp = tubp->tty_aid[i].string) == NULL)
-			continue;
-		if (sp == aidtab[i].string)
-			continue;
-		kfree(sp);
-	}
-	tubp->tty_aidinit = 0;
-}
-
-void
-tty3270_aid_reinit(tub_t *tubp)
-{
-	tty3270_aid_fini(tubp);
-	tty3270_aid_init(tubp);
-}
-
-int
-tty3270_aid_get(tub_t *tubp, int aid, int *aidflags, char **aidstring)
-{
-	aid_t *ap;
-
-	ap = AIDENTRY(aid, tubp);
-	*aidflags = ap->aid;
-	*aidstring = ap->string;
-	return 0;
-}
-
-/*
- * tty3270_aid_set() -- write_proc extension
- * Parse written string as an AID name.  Return 0 if it's not.
- * Otherwise absorb the string and return count or -error.
- */
-int
-tty3270_aid_set(tub_t *tubp, char *buf, int count)
-{
-	char name[8];
-	char *sp;
-	int aidn, aidx;
-	aid_t *ap;
-	int len;
-	char *pfp;
-
-	if (tubp->tty_aidinit == 0)
-		return 0;
-	if (count < 3)          /* If AID-key name too short */
-		return 0;
-	name[0] = buf[0] < 0x60? buf[0]: (buf[0] & 0x5f);
-	name[1] = buf[1] < 0x60? buf[1]: (buf[1] & 0x5f);
-	if (name[0] == 'P' && name[1] == 'F') {
-		aidn = simple_strtoul(buf+2, &sp, 10);
-		if (aidn < 1 || aidn > 24)
-			return 0;
-		aidx = aidn > 12? aidn - 12: aidn + 0x30;
-		ap = &tubp->tty_aid[aidx];
-	} else if (name[0] == 'P' && name[1] == 'A') {
-		aidn = simple_strtoul(buf+2, &sp, 10);
-		if (aidn < 1 || aidn > 3)
-			return 0;
-		switch(aidn) {
-		case 1:  aidx = 0x2c; break;
-		case 2:  aidx = 0x2e; break;
-		case 3:  aidx = 0x2b; break;
-		default:  aidx = 0; break;
-		}
-		ap = &tubp->tty_aid[aidx];
-	} else {
-		return 0;
-	}
-
-	if (*sp == '\0') {
-		tubp->tty_showaidx = ap - tubp->tty_aid;
-		return count;
-	} else if (*sp == '=') {
-		len = strlen(++sp);
-		if (len == 0) {
-			if (ap->string != NULL &&
-			    ap->string != aidtab[aidx].string)
-				kfree(ap->string);
-			ap->string = aidtab[aidx].string;
-			ap->aid = aidtab[aidx].aid;
-			return count;
-		}
-		if ((pfp = kmalloc(len + 1, GFP_KERNEL)) == NULL)
-			return -ENOMEM;
-		if (ap->string != NULL &&
-		    ap->string != aidtab[aidx].string)
-			kfree(ap->string);
-		if (sp[len - 1] == '\n') {
-			ap->aid = TA_DOSTRING;
-			sp[len - 1] = '\0';
-			len--;
-		} else {
-			ap->aid = TA_DOSTRINGD;
-		}
-		memcpy(pfp, sp, len + 1);
-		ap->string = pfp;
-		return count;
-	} else {
-		return -EINVAL;
-	}
-}
diff -Nru a/drivers/s390/char/tubttybld.c b/drivers/s390/char/tubttybld.c
--- a/drivers/s390/char/tubttybld.c	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,587 +0,0 @@
-/*
- *  IBM/3270 Driver -- Copyright (C) 2000 UTS Global LLC
- *
- *  tubttybld.c -- Linemode tty driver screen-building functions
- *
- *
- *
- *
- *
- *  Author:  Richard Hitt
- */
-
-#include "tubio.h"
-
-extern int tty3270_io(tub_t *);
-static void tty3270_set_status_area(tub_t *, char **);
-static int tty3270_next_char(tub_t *);
-static void tty3270_unnext_char(tub_t *, char);
-static void tty3270_update_log_area(tub_t *, char **);
-static int tty3270_update_log_area_esc(tub_t *, char **, int *);
-static void tty3270_clear_log_area(tub_t *, char **);
-static void tty3270_tub_bufadr(tub_t *, int, char **);
-static void tty3270_set_bufadr(tub_t *, char **, int *);
-
-/*
- * tty3270_clear_log_area(tub_t *tubp, char **cpp)
- */
-static void
-tty3270_clear_log_area(tub_t *tubp, char **cpp)
-{
-	*(*cpp)++ = TO_SBA;
-	TUB_BUFADR(GEOM_LOG, cpp);
-	*(*cpp)++ = TO_SF;
-	*(*cpp)++ = TF_LOG;
-	*(*cpp)++ = TO_RA;
-	TUB_BUFADR(GEOM_INPUT, cpp);
-	*(*cpp)++ = '\0';
-	tubp->tty_oucol = tubp->tty_nextlogx = 0;
-	*(*cpp)++ = TO_SBA;
-	TUB_BUFADR(tubp->tty_nextlogx, cpp);
-}
-
-static void
-tty3270_update_log_area(tub_t *tubp, char **cpp)
-{
-	int lastx = GEOM_INPUT;
-	int c;
-	int next, fill, i;
-	int sba_needed = 1;
-	char *overrun = &(*tubp->ttyscreen)[tubp->ttyscreenl - TS_LENGTH];
-
-	/* Check for possible ESC sequence work to do */
-	if (tubp->tty_escx != 0) {
-		/* If compiling new escape sequence */
-		if (tubp->tty_esca[0] == 0x1b) {
-			if (tty3270_update_log_area_esc(tubp, cpp, &sba_needed))
-				return;
-		/* If esc seq needs refreshing after a write */
-		} else if (tubp->tty_esca[0] == TO_SA) {
-			tty3270_set_bufadr(tubp, cpp, &sba_needed);
-			for (i = 0; i < tubp->tty_escx; i++)
-				*(*cpp)++ = tubp->tty_esca[i];
-		} else {
-			printk(KERN_WARNING "tty3270_update_log_area esca "
-			"character surprising:  %.2x\n", tubp->tty_esca[0]);
-		}
-	}
-
-	/* Place characters */
-	while (tubp->tty_bcb.bc_cnt != 0) {
-		/* Check for room.  TAB could take up to 4 chars. */
-		if (&(*cpp)[4] >= overrun)
-			break;
-
-		/* Fetch a character */
-		if ((c = tty3270_next_char(tubp)) == -1)
-			break;
-
-		switch(c) {
-		default:
-			if (tubp->tty_nextlogx >= lastx) {
-				if (sba_needed == 0 ||
-				    tubp->stat == TBS_RUNNING) {
-					tty3270_unnext_char(tubp, c);
-					tubp->stat = TBS_MORE;
-					tty3270_set_status_area(tubp, cpp);
-					tty3270_scl_settimer(tubp);
-				}
-				goto do_return;
-			}
-			tty3270_set_bufadr(tubp, cpp, &sba_needed);
-			/* Use blank if we don't know the character */
-			*(*cpp)++ = tub_ascebc[(int)(c < ' '? ' ': c)];
-			tubp->tty_nextlogx++;
-			tubp->tty_oucol++;
-			break;
-		case 0x1b:              /* ESC */
-			tubp->tty_escx = 0;
-			if (tty3270_update_log_area_esc(tubp, cpp, &sba_needed))
-				return;
-			break;
-		case '\r':		/* 0x0d -- Carriage Return */
-			tubp->tty_nextlogx -=
-				tubp->tty_nextlogx % GEOM_COLS;
-			sba_needed = 1;
-			break;
-		case '\n':		/* 0x0a -- New Line */
-			if (tubp->tty_oucol == GEOM_COLS) {
-				tubp->tty_oucol = 0;
-				break;
-			}
-			next = (tubp->tty_nextlogx + GEOM_COLS) /
-				GEOM_COLS * GEOM_COLS;
-			tubp->tty_nextlogx = next;
-			tubp->tty_oucol = 0;
-			sba_needed = 1;
-			break;
-		case '\t':		/* 0x09 -- Tabulate */
-			fill = (tubp->tty_nextlogx % GEOM_COLS) % 8;
-			for (; fill < 8; fill++) {
-				if (tubp->tty_nextlogx >= lastx)
-					break;
-				*(*cpp)++ = tub_ascebc[' '];
-				tubp->tty_nextlogx++;
-				tubp->tty_oucol++;
-			}
-			break;
-		case '\a':		/* 0x07 -- Alarm */
-			tubp->flags |= TUB_ALARM;
-			break;
-		case '\f':		/* 0x0c -- Form Feed */
-			tty3270_clear_log_area(tubp, cpp);
-			break;
-		case 0xf:	/* SuSE "exit alternate mode" */
-			break;
-		}
-	}
-do_return:
-}
-
-#define NUMQUANT 8
-static int
-tty3270_update_log_area_esc(tub_t *tubp, char **cpp, int *sba_needed)
-{
-	int c;
-	int i, j;
-	int start, end, next;
-	int quant[NUMQUANT];
-	char *overrun = &(*tubp->ttyscreen)[tubp->ttyscreenl - TS_LENGTH];
-	char sabuf[NUMQUANT*3], *sap = sabuf, *cp;
-
-	/* If starting a sequence, stuff ESC at [0] */
-	if (tubp->tty_escx == 0)
-		tubp->tty_esca[tubp->tty_escx++] = 0x1b;
-
-	/* Now that sequence is started, see if room in buffer */
-	if (&(*cpp)[NUMQUANT * 3] >= overrun)
-		return tubp->tty_escx;
-
-	/* Gather the rest of the sequence's characters */
-	while (tubp->tty_escx < sizeof tubp->tty_esca) {
-		if ((c = tty3270_next_char(tubp)) == -1)
-			return tubp->tty_escx;
-		if (tubp->tty_escx == 1) {
-			switch(c) {
-			case '[':
-				tubp->tty_esca[tubp->tty_escx++] = c;
-				continue;
-			case '7':
-				tubp->tty_savecursor = tubp->tty_nextlogx;
-				goto done_return;
-			case '8':
-				next = tubp->tty_savecursor;
-				goto do_setcur;
-			default:
-				goto error_return;
-			}
-		}
-		tubp->tty_esca[tubp->tty_escx++] = c;
-		if (c != ';' && (c < '0' || c > '9'))
-			break;
-	}
-
-	/* Check for overrun */
-	if (tubp->tty_escx == sizeof tubp->tty_esca)
-		goto error_return;
-
-	/* Parse potentially empty string "nn;nn;nn..." */
-	i = -1;
-	j = 2;		/* skip ESC, [ */
-	c = ';';
-	do {
-		if (c == ';') {
-			if (++i == NUMQUANT)
-				goto error_return;
-			quant[i] = 0;
-		} else if (c < '0' || c > '9') {
-			break;
-		} else {
-			quant[i] = quant[i] * 10 + c - '0';
-		}
-		c = tubp->tty_esca[j];
-	} while (j++ < tubp->tty_escx);
-
-	/* Add 3270 data stream output to execute the sequence */
-	switch(c) {
-	case 'm':		/* Set Attribute */
-		for (next = 0; next <= i; next++) {
-			int type = -1, value = 0;
-
-			switch(quant[next]) {
-			case 0:		/* Reset */
-				next = tubp->tty_nextlogx;
-				tty3270_set_bufadr(tubp, cpp, sba_needed);
-				*(*cpp)++ = TO_SA;
-				*(*cpp)++ = TAT_EXTHI;
-				*(*cpp)++ = TAX_RESET;
-				*(*cpp)++ = TO_SA;
-				*(*cpp)++ = TAT_COLOR;
-				*(*cpp)++ = TAC_RESET;
-				tubp->tty_nextlogx = next;
-				*sba_needed = 1;
-				sap = sabuf;
-				break;
-			case 1:		/* Bright */
-				break;
-			case 2:		/* Dim */
-				break;
-			case 4:		/* Underscore */
-				type = TAT_EXTHI; value = TAX_UNDER;
-				break;
-			case 5:		/* Blink */
-				type = TAT_EXTHI; value = TAX_BLINK;
-				break;
-			case 7:		/* Reverse */
-				type = TAT_EXTHI; value = TAX_REVER;
-				break;
-			case 8:		/* Hidden */
-				break;		/* For now ... */
-			/* Foreground Colors */
-			case 30:	/* Black */
-				type = TAT_COLOR; value = TAC_DEFAULT;
-				break;
-			case 31:	/* Red */
-				type = TAT_COLOR; value = TAC_RED;
-				break;
-			case 32:	/* Green */
-				type = TAT_COLOR; value = TAC_GREEN;
-				break;
-			case 33:	/* Yellow */
-				type = TAT_COLOR; value = TAC_YELLOW;
-				break;
-			case 34:	/* Blue */
-				type = TAT_COLOR; value = TAC_BLUE;
-				break;
-			case 35:	/* Magenta */
-				type = TAT_COLOR; value = TAC_PINK;
-				break;
-			case 36:	/* Cyan */
-				type = TAT_COLOR; value = TAC_TURQ;
-				break;
-			case 37:	/* White */
-				type = TAT_COLOR; value = TAC_WHITE;
-				break;
-			case 39:	/* Black */
-				type = TAT_COLOR; value = TAC_DEFAULT;
-				break;
-			/* Background Colors */
-			case 40:	/* Black */
-			case 41:	/* Red */
-			case 42:	/* Green */
-			case 43:	/* Yellow */
-			case 44:	/* Blue */
-			case 45:	/* Magenta */
-			case 46:	/* Cyan */
-			case 47:	/* White */
-				break;		/* For now ... */
-			/* Oops */
-			default:
-				break;
-			}
-			if (type != -1) {
-				tty3270_set_bufadr(tubp, cpp, sba_needed);
-				*(*cpp)++ = TO_SA;
-				*(*cpp)++ = type;
-				*(*cpp)++ = value;
-				*sap++ = TO_SA;
-				*sap++ = type;
-				*sap++ = value;
-			}
-		}
-		break;
-
-	case 'H':		/* Cursor Home */
-	case 'f':		/* Force Cursor Position */
-		if (quant[0]) quant[0]--;
-		if (quant[1]) quant[1]--;
-		next = quant[0] * GEOM_COLS + quant[1];
-		goto do_setcur;
-	case 'A':		/* Cursor Up */
-		if (quant[i] == 0) quant[i] = 1;
-		next = tubp->tty_nextlogx - GEOM_COLS * quant[i];
-		goto do_setcur;
-	case 'B':		/* Cursor Down */
-		if (quant[i] == 0) quant[i] = 1;
-		next = tubp->tty_nextlogx + GEOM_COLS * quant[i];
-		goto do_setcur;
-	case 'C':		/* Cursor Forward */
-		if (quant[i] == 0) quant[i] = 1;
-		next = tubp->tty_nextlogx % GEOM_COLS;
-		start = tubp->tty_nextlogx - next;
-		next = start + MIN(next + quant[i], GEOM_COLS - 1);
-		goto do_setcur;
-	case 'D':		/* Cursor Backward */
-		if (quant[i] == 0) quant[i] = 1;
-		next = MIN(quant[i], tubp->tty_nextlogx % GEOM_COLS);
-		next = tubp->tty_nextlogx - next;
-		goto do_setcur;
-	case 'G':
-		if (quant[0]) quant[0]--;
-		next = tubp->tty_nextlogx / GEOM_COLS * GEOM_COLS + quant[0];
-do_setcur:
-		if (next < 0)
-			break;
-		tubp->tty_nextlogx = next;
-		tubp->tty_oucol = tubp->tty_nextlogx % GEOM_COLS;
-		*sba_needed = 1;
-		break;
-
-	case 'r':		/* Define scroll area */
-		start = quant[0];
-		if (start <= 0) start = 1;
-		if (start > GEOM_ROWS - 2) start = GEOM_ROWS - 2;
-		tubp->tty_nextlogx = (start - 1) * GEOM_COLS;
-		tubp->tty_oucol = 0;
-		*sba_needed = 1;
-		break;
-
-	case 'X':		/* Erase for n chars from cursor */
-		start = tubp->tty_nextlogx;
-		end = start + (quant[0]?: 1);
-		goto do_fill;
-	case 'J':		/* Erase to screen end from cursor */
-		*(*cpp)++ = TO_SBA;
-		TUB_BUFADR(tubp->tty_nextlogx, cpp);
-		*(*cpp)++ = TO_RA;
-		TUB_BUFADR(GEOM_INPUT, cpp);
-		*(*cpp)++ = tub_ascebc[' '];
-		*(*cpp)++ = TO_SBA;
-		TUB_BUFADR(tubp->tty_nextlogx, cpp);
-		break;
-	case 'K':
-		start = tubp->tty_nextlogx;
-		end = (start + GEOM_COLS) / GEOM_COLS * GEOM_COLS;
-do_fill:
-		if (start >= GEOM_INPUT)
-			break;
-		if (end > GEOM_INPUT)
-			end = GEOM_INPUT;
-		if (end <= start)
-			break;
-		*(*cpp)++ = TO_SBA;
-		TUB_BUFADR(start, cpp);
-		if (end - start > 4) {
-			*(*cpp)++ = TO_RA;
-			TUB_BUFADR(end, cpp);
-			*(*cpp)++ = tub_ascebc[' '];
-		} else while (start++ < end) {
-			*(*cpp)++ = tub_ascebc[' '];
-		}
-		tubp->tty_nextlogx = end;
-		tubp->tty_oucol = tubp->tty_nextlogx % GEOM_COLS;
-		*sba_needed = 1;
-		break;
-	}
-done_return:
-	tubp->tty_escx = 0;
-	cp = sabuf;
-	while (cp != sap)
-		tubp->tty_esca[tubp->tty_escx++] = *cp++;
-	return 0;
-error_return:
-	tubp->tty_escx = 0;
-	return 0;
-}
-
-static int
-tty3270_next_char(tub_t *tubp)
-{
-	int c;
-	bcb_t *ib;
-
-	ib = &tubp->tty_bcb;
-	if (ib->bc_cnt == 0)
-		return -1;
-	c = ib->bc_buf[ib->bc_rd++];
-	if (ib->bc_rd == ib->bc_len)
-		ib->bc_rd = 0;
-	ib->bc_cnt--;
-	return c;
-}
-
-static void
-tty3270_unnext_char(tub_t *tubp, char c)
-{
-	bcb_t *ib;
-
-	ib = &tubp->tty_bcb;
-	if (ib->bc_rd == 0)
-		ib->bc_rd = ib->bc_len;
-	ib->bc_buf[--ib->bc_rd] = c;
-	ib->bc_cnt++;
-}
-
-
-static void
-tty3270_clear_input_area(tub_t *tubp, char **cpp)
-{
-	*(*cpp)++ = TO_SBA;
-	TUB_BUFADR(GEOM_INPUT, cpp);
-	*(*cpp)++ = TO_SF;
-	*(*cpp)++ = tubp->tty_inattr;
-	*(*cpp)++ = TO_IC;
-	*(*cpp)++ = TO_RA;
-	TUB_BUFADR(GEOM_STAT, cpp);
-	*(*cpp)++ = '\0';
-}
-
-static void
-tty3270_update_input_area(tub_t *tubp, char **cpp)
-{
-	int len;
-
-	*(*cpp)++ = TO_SBA;
-	TUB_BUFADR(GEOM_INPUT, cpp);
-	*(*cpp)++ = TO_SF;
-	*(*cpp)++ = TF_INMDT;
-	len = strlen(tubp->tty_input);
-	memcpy(*cpp, tubp->tty_input, len);
-	*cpp += len;
-	*(*cpp)++ = TO_IC;
-	len = GEOM_INPLEN - len;
-	if (len > 4) {
-		*(*cpp)++ = TO_RA;
-		TUB_BUFADR(GEOM_STAT, cpp);
-		*(*cpp)++ = '\0';
-	} else {
-		for (; len > 0; len--)
-			*(*cpp)++ = '\0';
-	}
-}
-
-/*
- * tty3270_set_status_area(tub_t *tubp, char **cpp)
- */
-static void
-tty3270_set_status_area(tub_t *tubp, char **cpp)
-{
-	char *sp;
-
-	if (tubp->stat == TBS_RUNNING)
-		sp = TS_RUNNING;
-	else if (tubp->stat == TBS_MORE)
-		sp = TS_MORE;
-	else if (tubp->stat == TBS_HOLD)
-		sp = TS_HOLD;
-	else
-		sp = "Linux Whatstat";
-
-	*(*cpp)++ = TO_SBA;
-	TUB_BUFADR(GEOM_STAT, cpp);
-	*(*cpp)++ = TO_SF;
-	*(*cpp)++ = TF_STAT;
-	memcpy(*cpp, sp, sizeof TS_RUNNING);
-	TUB_ASCEBC(*cpp, sizeof TS_RUNNING);
-	*cpp += sizeof TS_RUNNING;
-}
-
-/*
- * tty3270_build() -- build an output stream
- */
-int
-tty3270_build(tub_t *tubp)
-{
-	char *cp, *startcp;
-	int chancmd;
-	int writecc = TW_KR;
-	int force = 0;
-
-	if (tubp->mode == TBM_FS)
-		return 0;
-
-	cp = startcp = *tubp->ttyscreen + 1;
-
-	switch(tubp->cmd) {
-	default:
-		printk(KERN_WARNING "tty3270_build unknown command %d\n", tubp->cmd);
-		return 0;
-	case TBC_OPEN:
-tbc_open:
-		tubp->flags &= ~TUB_INPUT_HACK;
-		chancmd = TC_EWRITEA;
-		tty3270_clear_input_area(tubp, &cp);
-		tty3270_set_status_area(tubp, &cp);
-		tty3270_clear_log_area(tubp, &cp);
-		break;
-	case TBC_UPDLOG:
-		if (tubp->flags & TUB_INPUT_HACK)
-			goto tbc_open;
-		chancmd = TC_WRITE;
-		writecc = TW_NONE;
-		tty3270_update_log_area(tubp, &cp);
-		break;
-	case TBC_KRUPDLOG:
-		chancmd = TC_WRITE;
-		force = 1;
-		tty3270_update_log_area(tubp, &cp);
-		break;
-	case TBC_CLRUPDLOG:
-		chancmd = TC_WRITE;
-		tty3270_set_status_area(tubp, &cp);
-		tty3270_clear_log_area(tubp, &cp);
-		tty3270_update_log_area(tubp, &cp);
-		break;
-	case TBC_UPDATE:
-		chancmd = TC_EWRITEA;
-		tubp->tty_oucol = tubp->tty_nextlogx = 0;
-		tty3270_clear_input_area(tubp, &cp);
-		tty3270_set_status_area(tubp, &cp);
-		tty3270_update_log_area(tubp, &cp);
-		break;
-	case TBC_UPDSTAT:
-		chancmd = TC_WRITE;
-		tty3270_set_status_area(tubp, &cp);
-		break;
-	case TBC_CLRINPUT:
-		chancmd = TC_WRITE;
-		tty3270_clear_input_area(tubp, &cp);
-		break;
-	case TBC_UPDINPUT:
-		chancmd = TC_WRITE;
-		tty3270_update_input_area(tubp, &cp);
-		break;
-	}
-
-	/* Set Write Control Character and start I/O */
-	if (force == 0 && cp == startcp &&
-	    (tubp->flags & TUB_ALARM) == 0)
-		return 0;
-	if (tubp->flags & TUB_ALARM) {
-		tubp->flags &= ~TUB_ALARM;
-		writecc |= TW_PLUSALARM;
-	}
-	**tubp->ttyscreen = writecc;
-	tubp->ttyccw.cmd_code = chancmd;
-	tubp->ttyccw.flags = CCW_FLAG_SLI;
-	tubp->ttyccw.cda = virt_to_phys(*tubp->ttyscreen);
-	tubp->ttyccw.count = cp - *tubp->ttyscreen;
-	tty3270_io(tubp);
-	return 1;
-}
-
-static void
-tty3270_tub_bufadr(tub_t *tubp, int adr, char **cpp)
-{
-	if (tubp->tty_14bitadr) {
-		*(*cpp)++ = (adr >> 8) & 0x3f;
-		*(*cpp)++ = adr & 0xff;
-	} else {
-		*(*cpp)++ = tub_ebcgraf[(adr >> 6) & 0x3f];
-		*(*cpp)++ = tub_ebcgraf[adr & 0x3f];
-	}
-}
-
-static void
-tty3270_set_bufadr(tub_t *tubp, char **cpp, int *sba_needed)
-{
-	if (!*sba_needed)
-		return;
-	if (tubp->tty_nextlogx >= GEOM_INPUT) {
-		tubp->tty_nextlogx = GEOM_INPUT - 1;
-		tubp->tty_oucol = tubp->tty_nextlogx % GEOM_COLS;
-	}
-	*(*cpp)++ = TO_SBA;
-	TUB_BUFADR(tubp->tty_nextlogx, cpp);
-	*sba_needed = 0;
-}
diff -Nru a/drivers/s390/char/tubttyrcl.c b/drivers/s390/char/tubttyrcl.c
--- a/drivers/s390/char/tubttyrcl.c	Tue Feb  3 19:45:41 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,202 +0,0 @@
-/*
- *  IBM/3270 Driver -- Copyright (C) 2000 UTS Global LLC
- *
- *  tubttyrcl.c -- Linemode Command-recall functionality
- *
- *
- *
- *
- *
- *  Author:  Richard Hitt
- */
-#include "tubio.h"
-
-static void tty3270_rcl_sync(tub_t *);
-static int tty3270_rcl_resize(tub_t *, int);
-
-int
-tty3270_rcl_init(tub_t *tubp)
-{
-	return tty3270_rcl_resize(tubp, 20);
-}
-
-static int
-tty3270_rcl_resize(tub_t *tubp, int newrclk)
-{
-	char *(*newrclb)[];
-
-	if (newrclk > 1000)
-		return -EINVAL;
-	if (newrclk <= 0) {
-		tty3270_rcl_purge(tubp),
-		kfree(tubp->tty_rclbufs);
-		tubp->tty_rclbufs = NULL;
-		return 0;
-	}
-	if ((newrclb = (char *(*)[])kmalloc(
-	    newrclk * sizeof (char *), GFP_KERNEL)) == NULL)
-		return -ENOMEM;
-	memset(newrclb, 0, newrclk * sizeof (char *));
-	if (tubp->tty_rclbufs != NULL) {
-		int i, j, k;
-		char *data;
-
-		i = tubp->tty_rclp;
-		j = newrclk;
-		k = tubp->tty_rclk;
-		while (j-- && k--) {
-			if ((data = (*tubp->tty_rclbufs)[i]) == NULL)
-				break;
-			(*newrclb)[j] = data;
-			(*tubp->tty_rclbufs)[i] = NULL;
-			if (--i < 0)
-				i = tubp->tty_rclk - 1;
-		}
-		tty3270_rcl_purge(tubp);
-		kfree(tubp->tty_rclbufs);
-	}
-	tubp->tty_rclbufs = newrclb;
-	tubp->tty_rclk = newrclk;
-	tubp->tty_rclp = newrclk - 1;
-	tty3270_rcl_sync(tubp);
-	return 0;
-}
-
-int
-tty3270_rcl_set(tub_t *tubp, char *buf, int count)
-{
-#define RCL_SIZ "recallsize="
-#define L_RCL_SIZ (strlen(RCL_SIZ))
-	int newsize;
-	int len;
-	int rc;
-	char *rcl_siz = RCL_SIZ;
-	int l_rcl_siz = L_RCL_SIZ;
-
-	if (count < l_rcl_siz || strncmp(buf, rcl_siz, l_rcl_siz) != 0)
-		return 0;
-	if ((len = count - l_rcl_siz) == 0)
-		return count;
-	newsize = simple_strtoul(buf + l_rcl_siz, 0, 0);
-	rc = tty3270_rcl_resize(tubp, newsize);
-	return rc < 0? rc: count;
-}
-
-void
-tty3270_rcl_fini(tub_t *tubp)
-{
-	if (tubp->tty_rclbufs != NULL) {
-		tty3270_rcl_purge(tubp);
-		kfree(tubp->tty_rclbufs);
-		tubp->tty_rclbufs = NULL;
-	}
-}
-
-void
-tty3270_rcl_purge(tub_t *tubp)
-{
-	int i;
-	char *buf;
-
-	if (tubp->tty_rclbufs == NULL)
-		return;
-	for (i = 0; i < tubp->tty_rclk; i++) {
-		if ((buf = (*tubp->tty_rclbufs)[i]) == NULL)
-			continue;
-		kfree(buf);
-		(*tubp->tty_rclbufs)[i] = NULL;
-	}
-}
-
-int
-tty3270_rcl_get(tub_t *tubp, char *buf, int len, int inc)
-{
-	int iter;
-	int i;
-	char *data;
-
-	if (tubp->tty_rclbufs == NULL)
-		return 0;
-	if (tubp->tty_rclk <= 0)	/* overcautious */
-		return 0;
-	if (inc != 1 && inc != -1)	/* overcautious */
-		return 0;
-
-	if ((i = tubp->tty_rclb) == -1) {
-		i = tubp->tty_rclp;
-		if (inc == 1)
-			i++;
-	} else {
-		i += inc;
-	}
-	for (iter = tubp->tty_rclk; iter; iter--, i += inc) {
-		if (i < 0)
-			i = tubp->tty_rclk - 1;
-		else if (i >= tubp->tty_rclk)
-			i = 0;
-		if ((*tubp->tty_rclbufs)[i] != NULL)
-			break;
-	}
-	if (iter < 0 || (data = (*tubp->tty_rclbufs)[i]) == NULL)
-		return 0;
-	tubp->tty_rclb = i;
-	if ((len = MIN(len - 1, strlen(data))) <= 0)
-		return 0;
-	memcpy(buf, data, len);
-	buf[len] = '\0';
-	return len;
-}
-
-void
-tty3270_rcl_put(tub_t *tubp, char *data, int len)
-{
-	char *buf, **bufp;
-	int i;
-
-	if (tubp->tty_rclbufs == NULL)
-		return;
-
-	if (tubp->tty_rclk <= 0)        /* overcautious */
-		return;
-
-	/* If input area is invisible, don't log */
-	if (tubp->tty_inattr == TF_INPUTN)
-		return;
-
-	/* If this & most recent cmd text match, don't log */
-	if ((buf = (*tubp->tty_rclbufs)[tubp->tty_rclp]) != NULL &&
-	    strlen(buf) == len && memcmp(buf, data, len) == 0) {
-		tty3270_rcl_sync(tubp);
-		return;
-	}
-
-	/* Don't stack zero-length commands */
-	if (len == 0) {
-		tty3270_rcl_sync(tubp);
-		return;
-	}
-
-	i = tubp->tty_rclp;
-	if (++i == tubp->tty_rclk)
-		i = 0;
-	bufp = &(*tubp->tty_rclbufs)[i];
-	if (*bufp == NULL || strlen(*bufp) < len + 1) {
-		if (*bufp) {
-			kfree(*bufp);
-			*bufp = NULL;
-		}
-		if ((*bufp = kmalloc(len + 1, GFP_ATOMIC)) == NULL)
-			return;
-	}
-	memcpy(*bufp, data, len);
-	(*bufp)[len] = '\0';
-	tubp->tty_rclp = i;
-	tty3270_rcl_sync(tubp);
-}
-
-static void
-tty3270_rcl_sync(tub_t *tubp)
-{
-	tubp->tty_rclb = -1;
-}
-
diff -Nru a/drivers/s390/char/tubttyscl.c b/drivers/s390/char/tubttyscl.c
--- a/drivers/s390/char/tubttyscl.c	Tue Feb  3 19:45:43 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,88 +0,0 @@
-/*
- *  IBM/3270 Driver -- Copyright (C) 2000, 2001 UTS Global LLC
- *
- *  tubttyscl.c -- Linemode tty driver scroll-timing functions
- *
- *
- *
- *
- *
- *  Author:  Richard Hitt
- */
-#include "tubio.h"
-       void tty3270_scl_settimer(tub_t *);
-       void tty3270_scl_resettimer(tub_t *);
-static void tty3270_scl_timeout(unsigned long);
-
-void
-tty3270_scl_settimer(tub_t *tubp)
-{
-	struct timer_list *tp = &tubp->tty_stimer;
-
-	if (tubp->flags & TUB_SCROLLTIMING)
-		return;
-	if (tubp->tty_scrolltime == 0)
-		return;
-
-	init_timer(tp);
-	tp->expires = jiffies + HZ * tubp->tty_scrolltime;
-	tp->data = (unsigned long)tubp;
-	tp->function = tty3270_scl_timeout;
-	add_timer(tp);
-	tubp->flags |= TUB_SCROLLTIMING;
-}
-
-void
-tty3270_scl_resettimer(tub_t *tubp)
-{
-	struct timer_list *tp = &tubp->tty_stimer;
-
-	if ((tubp->flags & TUB_SCROLLTIMING) == 0)
-		return;
-
-	del_timer(tp);
-	tubp->flags &= ~TUB_SCROLLTIMING;
-}
-
-static void
-tty3270_scl_timeout(unsigned long data)
-{
-	tub_t *tubp = (void *)data;
-	long flags;
-
-	TUBLOCK(tubp->irq, flags);
-	tubp->stat = TBS_RUNNING;
-	tty3270_scl_resettimer(tubp);
-	tubp->cmd = TBC_CLRUPDLOG;
-	tty3270_build(tubp);
-	TUBUNLOCK(tubp->irq, flags);
-}
-
-int
-tty3270_scl_set(tub_t *tubp, char *buf, int count)
-{
-	if (strncmp(buf, "scrolltime=", 11) == 0) {
-		tubp->tty_scrolltime =
-			simple_strtoul(buf + 11, 0, 0);
-		return count;
-	}
-	return 0;
-}
-
-int
-tty3270_scl_init(tub_t *tubp)
-{
-	extern int tubscrolltime;
-
-	tubp->tty_scrolltime = tubscrolltime;
-	if (tubp->tty_scrolltime < 0)
-		tubp->tty_scrolltime = DEFAULT_SCROLLTIME;
-	return 0;
-}
-
-void
-tty3270_scl_fini(tub_t *tubp)
-{
-	if ((tubp->flags & TUB_OPEN_STET) == 0)
-		tty3270_scl_resettimer(tubp);
-}
diff -Nru a/drivers/s390/char/tubttysiz.c b/drivers/s390/char/tubttysiz.c
--- a/drivers/s390/char/tubttysiz.c	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,306 +0,0 @@
-/*
- *  IBM/3270 Driver -- Copyright (C) 2000 UTS Global LLC
- *
- *  tubttysiz.c -- Linemode screen-size determiner
- *
- *
- *
- *
- *
- *  Author:  Richard Hitt
- */
-#include "tubio.h"
-static int tty3270_size_io(tub_t *tubp);
-static void tty3270_size_int(tub_t *tubp, devstat_t *dsp);
-static int tty3270_size_wait(tub_t *tubp, long *flags, int stat);
-
-/*
- * Structure representing Usable Area Query Reply Base
- */
-typedef struct {
-	short l;                /* Length of this structured field */
-	char sfid;              /* 0x81 if Query Reply */
-	char qcode;             /* 0x81 if Usable Area */
-#define QCODE_UA 0x81
-	char flags0;
-#define FLAGS0_ADDR 0x0f
-#define FLAGS0_ADDR_12_14       1       /* 12/14-bit adrs ok */
-#define FLAGS0_ADDR_12_14_16    3       /* 12/14/16-bit adrs ok */
-	char flags1;
-	short w;                /* Width of usable area */
-	short h;                /* Heigth of usavle area */
-	char units;             /* 0x00:in; 0x01:mm */
-	int xr;
-	int yr;
-	char aw;
-	char ah;
-	short buffsz;           /* Character buffer size, bytes */
-	char xmin;
-	char ymin;
-	char xmax;
-	char ymax;
-} __attribute__ ((packed)) uab_t;
-
-/*
- * Structure representing Alternate Usable Area Self-Defining Parameter
- */
-typedef struct {
-	char l;                 /* Length of this Self-Defining Parm */
-	char sdpid;             /* 0x02 if Alternate Usable Area */
-#define SDPID_AUA 0x02
-	char res;
-	char auaid;             /* 0x01 is Id for the A U A */
-	short wauai;            /* Width of AUAi */
-	short hauai;            /* Height of AUAi */
-	char auaunits;          /* 0x00:in, 0x01:mm */
-	int auaxr;
-	int auayr;
-	char awauai;
-	char ahauai;
-} __attribute__ ((packed)) aua_t;
-
-/*
- * Structure representing one followed by the other
- */
-typedef struct {
-	uab_t uab;
-	aua_t aua;
-} __attribute__ ((packed)) ua_t;
-
-/*
- * Try to determine screen size using Read Partition (Query)
- */
-int
-tty3270_size(tub_t *tubp, long *flags)
-{
-	char wbuf[7] = { 0x00, 0x07, 0x01, 0xff, 0x03, 0x00, 0x81 };
-	int     rc = 0;
-	int     count;
-	unsigned char *cp;
-	ua_t *uap;
-	char miniscreen[256];
-	char (*screen)[];
-	int screenl;
-	int geom_rows, geom_cols, fourteenbitadr;
-	void (*oldint)(struct tub_s *, devstat_t *);
-
-	if (tubp->flags & TUB_SIZED)
-		return 0;
-	fourteenbitadr = 0;
-	geom_rows = tubp->geom_rows;
-	geom_cols = tubp->geom_cols;
-
-	oldint = tubp->intv;
-	tubp->intv = tty3270_size_int;
-
-	if (tubp->cmd == TBC_CONOPEN) {
-		tubp->ttyccw.cmd_code = TC_EWRITEA;
-		cp = miniscreen;
-		*cp++ = TW_KR;
-		/* more? */
-		tubp->ttyccw.flags = CCW_FLAG_SLI;
-		tubp->ttyccw.cda = virt_to_phys(miniscreen);
-		tubp->ttyccw.count = (char *)cp - miniscreen;
-		rc = tty3270_size_io(tubp);
-		rc = tty3270_size_wait(tubp, flags, 0);
-	}
-
-	tubp->ttyccw.cmd_code = TC_WRITESF;
-	tubp->ttyccw.flags = CCW_FLAG_SLI;
-	tubp->ttyccw.cda = virt_to_phys(wbuf);
-	tubp->ttyccw.count = sizeof wbuf;
-
-try_again:
-	rc = tty3270_size_io(tubp);
-	if (rc)
-		printk("tty3270_size_io returned %d\n", rc);
-
-	rc = tty3270_size_wait(tubp, flags, 0);
-	if (rc != 0) {
-		goto do_return;
-	}
-
-	/*
-	 * Unit-Check Processing:
-	 * Expect Command Reject or Intervention Required.
-	 * For Command Reject assume old hdwe/software and
-	 * set a default size of 80x24.
-	 * For Intervention Required, wait for signal pending
-	 * or Unsolicited Device End; if the latter, retry.
-	 */
-	if (tubp->dstat & DEV_STAT_UNIT_CHECK) {
-		if (tubp->sense.data[0] & SNS0_CMD_REJECT) {
-			goto use_diag210; /* perhaps it's tn3270 */
-		} else if (tubp->sense.data[0] & SNS0_INTERVENTION_REQ) {
-			if ((rc = tty3270_size_wait(tubp, flags,
-			    DEV_STAT_DEV_END)))
-				goto do_return;
-			goto try_again;
-		} else {
-			printk("tty3270_size(): unkn sense %.2x\n",
-				tubp->sense.data[0]);
-			goto do_return;
-		}
-	}
-	if ((rc = tty3270_size_wait(tubp, flags, DEV_STAT_ATTENTION)))
-		goto do_return;
-
-	/* Set up a read ccw and issue it */
-	tubp->ttyccw.cmd_code = TC_READMOD;
-	tubp->ttyccw.flags = CCW_FLAG_SLI;
-	tubp->ttyccw.cda = virt_to_phys(miniscreen);
-	tubp->ttyccw.count = sizeof miniscreen;
-	tty3270_size_io(tubp);
-	rc = tty3270_size_wait(tubp, flags, 0);
-	if (rc != 0)
-		goto do_return;
-
-	count = sizeof miniscreen - tubp->cswl;
-	cp = miniscreen;
-	if (*cp++ != 0x88)
-		goto do_return;
-	uap = (void *)cp;
-	if (uap->uab.qcode != QCODE_UA)
-		goto do_return;
-	geom_rows = uap->uab.h;
-	geom_cols = uap->uab.w;
-	if ((uap->uab.flags0 & FLAGS0_ADDR) == FLAGS0_ADDR_12_14 ||
-	    (uap->uab.flags0 & FLAGS0_ADDR) == FLAGS0_ADDR_12_14_16)
-		fourteenbitadr = 1;
-	if (uap->uab.l <= sizeof uap->uab)
-		goto do_return;
-	if (uap->aua.sdpid != SDPID_AUA) {
-		printk("AUA sdpid was 0x%.2x, expecting 0x%.2x\n",
-			uap->aua.sdpid, SDPID_AUA);
-		goto do_return;
-	}
-	geom_rows = uap->aua.hauai;
-	geom_cols = uap->aua.wauai;
-	goto do_return;
-
-use_diag210:
-	if (MACHINE_IS_VM) {
-		diag210_t d210;
-
-		d210.vrdcdvno = tubp->devno;
-		d210.vrdclen = sizeof d210;
-		rc = diag210(&d210);
-		if (rc) {
-			printk("tty3270_size: diag210 for 0x%.4x "
-				"returned %d\n", tubp->devno, rc);
-			goto do_return;
-		}
-		switch(d210.vrdccrmd) {
-		case 2:
-			geom_rows = 24;
-			geom_cols = 80;
-			goto do_return;
-		case 3:
-			geom_rows = 32;
-			geom_cols = 80;
-			goto do_return;
-		case 4:
-			geom_rows = 43;
-			geom_cols = 80;
-			goto do_return;
-		case 5:
-			geom_rows = 27;
-			geom_cols = 132;
-			goto do_return;
-		default:
-			printk("vrdccrmd is 0x%.8x\n", d210.vrdccrmd);
-		}
-	}
-
-do_return:
-	if (geom_rows == 0) {
-		geom_rows = _GEOM_ROWS;
-		geom_cols = _GEOM_COLS;
-	}
-	tubp->tubiocb.pf_cnt = 24;
-	tubp->tubiocb.re_cnt = 20;
-	tubp->tubiocb.map = 0;
-
-	screenl = geom_rows * geom_cols + 100;
-	screen = (char (*)[])kmalloc(screenl, GFP_KERNEL);
-	if (screen == NULL) {
-		printk("ttyscreen size %d unavailable\n", screenl);
-	} else {
-		if (tubp->ttyscreen)
-			kfree(tubp->ttyscreen);
-		tubp->tubiocb.line_cnt = tubp->geom_rows = geom_rows;
-		tubp->tubiocb.col_cnt = tubp->geom_cols = geom_cols;
-		tubp->tty_14bitadr = fourteenbitadr;
-		tubp->ttyscreen = screen;
-		tubp->ttyscreenl = screenl;
-		if (geom_rows == 24 && geom_cols == 80)
-			tubp->tubiocb.model = 2;
-		else if (geom_rows == 32 && geom_cols == 80)
-			tubp->tubiocb.model = 3;
-		else if (geom_rows == 43 && geom_cols == 80)
-			tubp->tubiocb.model = 4;
-		else if (geom_rows == 27 && geom_cols == 132)
-			tubp->tubiocb.model = 5;
-		else
-			tubp->tubiocb.model = 0;
-		tubp->flags |= TUB_SIZED;
-	}
-	if (rc == 0 && tubp->ttyscreen == NULL)
-		rc = -ENOMEM;
-	tubp->intv = oldint;
-	return rc;
-}
-
-static int
-tty3270_size_io(tub_t *tubp)
-{
-	tubp->flags |= TUB_WORKING;
-	tubp->dstat = 0;
-
-	return do_IO(tubp->irq, &tubp->ttyccw, tubp->irq, 0, 0);
-}
-
-static void
-tty3270_size_int(tub_t *tubp, devstat_t *dsp)
-{
-#define DEV_NOT_WORKING \
-  (DEV_STAT_ATTENTION | DEV_STAT_DEV_END | DEV_STAT_UNIT_CHECK)
-
-	tubp->dstat = dsp->dstat;
-	if (dsp->dstat & DEV_STAT_CHN_END)
-		tubp->cswl = dsp->rescnt;
-	if (dsp->dstat & DEV_NOT_WORKING)
-		tubp->flags &= ~TUB_WORKING;
-	if (dsp->dstat & DEV_STAT_UNIT_CHECK)
-		tubp->sense = dsp->ii.sense;
-
-	wake_up_interruptible(&tubp->waitq);
-}
-
-/*
- * Wait for something.  If the third arg is zero, wait until
- * tty3270_size_int() turns off TUB_WORKING.  If the third arg
- * is not zero, it is a device-status bit; wait until dstat
- * has the bit turned on.  Never wait if signal is pending.
- * Return 0 unless signal pending, in which case -ERESTARTSYS.
- */
-static int
-tty3270_size_wait(tub_t *tubp, long *flags, int stat)
-{
-	DECLARE_WAITQUEUE(wait, current);
-
-	add_wait_queue(&tubp->waitq, &wait);
-	while (!signal_pending(current) &&
-	    (stat? (tubp->dstat & stat) == 0:
-	     (tubp->flags & TUB_WORKING) != 0)) {
-#warning FIXME: [kj] use set_current_state instead of current->state=
-		current->state = TASK_INTERRUPTIBLE;
-		TUBUNLOCK(tubp->irq, *flags);
-		schedule();
-#warning FIXME: [kj] use set_current_state instead of current->state=
-		current->state = TASK_RUNNING;
-		TUBLOCK(tubp->irq, *flags);
-	}
-	remove_wait_queue(&tubp->waitq, &wait);
-	return signal_pending(current)? -ERESTARTSYS: 0;
-}
diff -Nru a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c
--- a/drivers/s390/cio/blacklist.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/cio/blacklist.c	Tue Feb  3 19:45:17 2004
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/blacklist.c
  *   S/390 common I/O routines -- blacklisting of specific devices
- *   $Revision: 1.24 $
+ *   $Revision: 1.27 $
  *
  *    Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
  *			      IBM Corporation
@@ -62,51 +62,117 @@
 }
 
 /*
- * function: blacklist_strtoul
- * Strip leading '0x' and interpret the values as Hex
+ * Function: blacklist_busid
+ * Get devno/busid from given string.
+ * Shamelessly grabbed from dasd_devmap.c.
  */
 static inline int
-blacklist_strtoul (const char *str, char **stra)
+blacklist_busid(char **str, int *id0, int *id1, int *devno)
 {
-	if (*str == '0') {
-		if (*(++str) == 'x')  /* strip leading zero */
-			str++;	      /* strip leading x */
+	int val, old_style;
+ 
+	/* check for leading '0x' */
+	old_style = 0;
+	if ((*str)[0] == '0' && (*str)[1] == 'x') {
+		*str += 2;
+		old_style = 1;
 	}
-	return simple_strtoul (str, stra, 16); /* interpret anything as hex */
+	if (!isxdigit((*str)[0]))	/* We require at least one hex digit */
+		return -EINVAL;
+	val = simple_strtoul(*str, str, 16);
+	if (old_style || (*str)[0] != '.') {
+		*id0 = *id1 = 0;
+		if (val < 0 || val > 0xffff)
+			return -EINVAL;
+		*devno = val;
+		return 0;
+	}
+	/* New style x.y.z busid */
+	if (val < 0 || val > 0xff)
+		return -EINVAL;
+	*id0 = val;
+	(*str)++;
+	if (!isxdigit((*str)[0]))	/* We require at least one hex digit */
+		return -EINVAL;
+	val = simple_strtoul(*str, str, 16);
+	if (val < 0 || val > 0xff || (*str)++[0] != '.')
+		return -EINVAL;
+	*id1 = val;
+	if (!isxdigit((*str)[0]))	/* We require at least one hex digit */
+		return -EINVAL;
+	val = simple_strtoul(*str, str, 16);
+	if (val < 0 || val > 0xffff)
+		return -EINVAL;
+	*devno = val;
+	return 0;
 }
 
 static inline int
 blacklist_parse_parameters (char *str, range_action action)
 {
-	unsigned int from, to;
+	unsigned int from, to, from_id0, to_id0, from_id1, to_id1;
+	char *sav;
 
+	sav = str;
 	while (*str != 0 && *str != '\n') {
-		if (!isxdigit(*str)) {
-			printk(KERN_WARNING "blacklist_setup: error parsing "
-			       "\"%s\"\n", str);
-			return 0;
+		range_action ra = action;
+		if (*str == '!') {
+			ra = !action;
+			++str;
 		}
 
-		from = blacklist_strtoul (str, &str);
-		to = (*str == '-') ? blacklist_strtoul (str+1, &str) : from;
-
+		/*
+		 * Since we have to parse the proc commands and the
+		 * kernel arguments we have to check four cases
+		 */
+		if (strncmp(str,"all,",4) == 0 || strcmp(str,"all") == 0 ||
+		    strncmp(str,"all\n",4) == 0 || strncmp(str,"all ",4) == 0) {
+			from = 0;
+			to = __MAX_SUBCHANNELS;
+			str += 3;
+		} else {
+			int rc;
+
+			rc = blacklist_busid(&str, &from_id0,
+					     &from_id1, &from);
+			if (rc)
+				goto out_err;
+			to = from;
+			to_id0 = from_id0;
+			to_id1 = from_id1;
+			if (*str == '-') {
+				str++;
+				rc = blacklist_busid(&str, &to_id0, &to_id1,
+						     &to);
+				if (rc)
+					goto out_err;
+			}
+			if ((from_id0 != to_id0) || (from_id1 != to_id1))
+				goto out_err;
+		}
+		/* FIXME: ignoring id0 and id1 here. */
 		pr_debug("blacklist_setup: adding range "
-			 "from 0x%04x to 0x%04x\n", from, to);
-		blacklist_range (action, from, to);
+			 "from 0.0.%04x to 0.0.%04x\n", from, to);
+		blacklist_range (ra, from, to);
 
 		if (*str == ',')
 			str++;
 	}
 	return 1;
+out_err:
+	printk(KERN_WARNING "blacklist_setup: error parsing \"%s\"\n", sav);
+	return 0;
 }
 
 /* Parsing the commandline for blacklist parameters, e.g. to blacklist
- * device IDs 0x1234, 0x1235 and 0x1236, you could use any of:
+ * bus ids 0.0.1234, 0.0.1235 and 0.0.1236, you could use any of:
  * - cio_ignore=1234-1236
  * - cio_ignore=0x1234-0x1235,1236
  * - cio_ignore=0x1234,1235-1236
  * - cio_ignore=1236 cio_ignore=1234-0x1236
  * - cio_ignore=1234 cio_ignore=1236 cio_ignore=0x1235
+ * - cio_ignore=0.0.1234-0.0.1236
+ * - cio_ignore=0.0.1234,0x1235,1236
  * - ...
  */
 static int __init
@@ -134,6 +200,7 @@
 
 #ifdef CONFIG_PROC_FS
 
+extern void css_reiterate_subchannels(void);
 /*
  * Function: s390_redo_validation
  * Look for no longer blacklisted devices
@@ -141,12 +208,9 @@
 static inline void
 s390_redo_validation (void)
 {
-	int irq;
-
 	CIO_TRACE_EVENT (0, "redoval");
 
-	for (irq = 0; irq <= highest_subchannel; irq++)
-		css_probe_device(irq);
+	css_reiterate_subchannels();
 }
 
 /*
@@ -157,10 +221,7 @@
 blacklist_parse_proc_parameters (char *buf)
 {
 	if (strncmp (buf, "free ", 5) == 0) {
-		if (strstr (buf + 5, "all"))
-			blacklist_range (free, 0, __MAX_SUBCHANNELS);
-		else
-			blacklist_parse_parameters (buf + 5, free);
+		blacklist_parse_parameters (buf + 5, free);
 	} else if (strncmp (buf, "add ", 4) == 0) {
 		/* 
 		 * We don't need to check for known devices since
@@ -179,10 +240,11 @@
 	s390_redo_validation ();
 }
 
+/* FIXME: These should be real bus ids and not home-grown ones! */
 static int cio_ignore_read (char *page, char **start, off_t off,
 			    int count, int *eof, void *data)
 {
-	const unsigned int entry_size = 14; /* "0xABCD-0xEFGH\n" */
+	const unsigned int entry_size = 18; /* "0.0.ABCD-0.0.EFGH\n" */
 	long devno;
 	int len;
 
@@ -192,12 +254,12 @@
 	     devno <= __MAX_SUBCHANNELS && len + entry_size < count; devno++) {
 		if (!test_bit(devno, bl_dev))
 			continue;
-		len += sprintf(page + len, "0x%04lx", devno);
+		len += sprintf(page + len, "0.0.%04lx", devno);
 		if (test_bit(devno + 1, bl_dev)) { /* print range */
 			while (++devno < __MAX_SUBCHANNELS)
 				if (!test_bit(devno, bl_dev))
 					break;
-			len += sprintf(page + len, "-0x%04lx", --devno);
+			len += sprintf(page + len, "-0.0.%04lx", --devno);
 		}
 		len += sprintf(page + len, "\n");
 	}
diff -Nru a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c
--- a/drivers/s390/cio/ccwgroup.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/s390/cio/ccwgroup.c	Tue Feb  3 19:45:29 2004
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/ccwgroup.c
  *  bus driver for ccwgroup
- *   $Revision: 1.17 $
+ *   $Revision: 1.19 $
  *
  *    Copyright (C) 2002 IBM Deutschland Entwicklung GmbH,
  *                       IBM Corporation
@@ -337,7 +337,6 @@
 {
 	struct ccwgroup_device *gdev;
 	struct ccwgroup_driver *gdrv;
-	int ret;
 
 	gdev = to_ccwgroupdev(dev);
 	gdrv = to_ccwgroupdrv(dev->driver);
@@ -345,11 +344,10 @@
 	pr_debug("%s: device %s\n", __func__, gdev->dev.name);
 
 	device_remove_file(dev, &dev_attr_online);
-	ccwgroup_set_offline(gdev);
-
-	ret = (gdrv && gdrv->remove) ? gdrv->remove(gdev) : 0;
 
-	return ret;
+	if (gdrv && gdrv->remove)
+		gdrv->remove(gdev);
+	return 0;
 }
 
 int
@@ -418,20 +416,20 @@
 	return gdev;
 }
 
-int
+void
 ccwgroup_remove_ccwdev(struct ccw_device *cdev)
 {
 	struct ccwgroup_device *gdev;
 
+	/* Ignore offlining errors, device is gone anyway. */
+	ccw_device_set_offline(cdev);
 	/* If one of its devices is gone, the whole group is done for. */
 	gdev = __ccwgroup_get_gdev_by_cdev(cdev);
 	if (gdev) {
-		ccwgroup_set_offline(gdev);
 		__ccwgroup_remove_symlinks(gdev);
 		device_unregister(&gdev->dev);
 		put_device(&gdev->dev);
 	}
-	return 0;
 }
 
 MODULE_LICENSE("GPL");
diff -Nru a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
--- a/drivers/s390/cio/chsc.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/s390/cio/chsc.c	Tue Feb  3 19:45:28 2004
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/chsc.c
  *   S/390 common I/O routines -- channel subsystem call
- *   $Revision: 1.78 $
+ *   $Revision: 1.92 $
  *
  *    Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
  *			      IBM Corporation
@@ -17,40 +17,40 @@
 #include <linux/device.h>
 
 #include <asm/cio.h>
-#include <asm/ccwdev.h> // FIXME: layering violation, remove this
 
 #include "css.h"
 #include "cio.h"
 #include "cio_debug.h"
-#include "device.h" // FIXME: layering violation, remove this
 #include "ioasm.h"
 #include "chsc.h"
 
 #define CHPID_LONGS (256 / (8 * sizeof(long))) /* 256 chpids */
-static unsigned long chpids[CHPID_LONGS];
-static unsigned long chpids_logical[CHPID_LONGS] = {[0 ... CHPID_LONGS-1] -1};
-static unsigned long chpids_known[CHPID_LONGS];
-
 static struct channel_path *chps[NR_CHPIDS];
 
-static int cio_chsc_desc_avail;
-
 static int new_channel_path(int chpid, int status);
 
-static int
-set_chp_status(int chp, int status)
+static inline void
+set_chp_online(int chp, int onoff)
 {
-	if (chps[chp] == NULL)
-		return -EINVAL;
+	chps[chp]->state.online = onoff;
+}
 
-	chps[chp]->state = status;
-	return 0;
+static inline void
+set_chp_logically_online(int chp, int onoff)
+{
+	chps[chp]->state.logically_online = onoff;
 }
 
-static inline int
-chsc_chpid_logical (struct subchannel *sch, int chp)
+static int
+get_chp_status(int chp)
 {
-	return test_bit (sch->schib.pmcw.chpid[chp], chpids_logical);
+	int ret;
+
+	if (!chps[chp])
+		return 0;
+	ret = chps[chp]->state.online ? CHP_ONLINE : CHP_STANDBY;
+	return (chps[chp]->state.logically_online ?
+		ret : ret | CHP_LOGICALLY_OFFLINE);
 }
 
 void
@@ -58,24 +58,21 @@
 {
 	int mask, chp;
 
-	if (sch->lpm == 0)
-		return;
-
 	for (chp = 0; chp <= 7; chp++) {
 		mask = 0x80 >> chp;
-		if (sch->lpm & mask)
-			if (!chsc_chpid_logical(sch, chp))
-				/* disable using this path */
-				sch->lpm &= ~mask;
+		if (get_chp_status(sch->schib.pmcw.chpid[chp])
+		    &  CHP_LOGICALLY_OFFLINE)
+			/* disable using this path */
+			sch->opm &= ~mask;
 	}
 }
 
 /* FIXME: this is _always_ called for every subchannel. shouldn't we
  *	  process more than one at a time? */
 static int
-chsc_get_sch_desc_irq(int irq, void *page)
+chsc_get_sch_desc_irq(struct subchannel *sch, void *page)
 {
-	int ccode, chpid, j;
+	int ccode, j;
 
 	struct {
 		struct chsc_header request;
@@ -106,8 +103,8 @@
 		.code   = 0x0004,
 	};
 
-	ssd_area->f_sch = irq;
-	ssd_area->l_sch = irq;
+	ssd_area->f_sch = sch->irq;
+	ssd_area->l_sch = sch->irq;
 
 	ccode = chsc(ssd_area);
 	if (ccode > 0) {
@@ -120,19 +117,17 @@
 		break;
 	case 0x0002:
 		CIO_CRW_EVENT(2, "Invalid command!\n");
+		return -EINVAL;
 	case 0x0003:
 		CIO_CRW_EVENT(2, "Error in chsc request block!\n");
 		return -EINVAL;
-		break;
 	case 0x0004:
 		CIO_CRW_EVENT(2, "Model does not provide ssd\n");
 		return -EOPNOTSUPP;
-		break;
 	default:
 		CIO_CRW_EVENT(2, "Unknown CHSC response %d\n",
 			      ssd_area->response.code);
 		return -EIO;
-		break;
 	}
 
 	/*
@@ -151,7 +146,7 @@
 	 */
 	if (ssd_area->st > 3) { /* uhm, that looks strange... */
 		CIO_CRW_EVENT(0, "Strange subchannel type %d"
-			      " for sch %x\n", ssd_area->st, irq);
+			      " for sch %s\n", ssd_area->st, sch->dev.bus_id);
 		/*
 		 * There may have been a new subchannel type defined in the
 		 * time since this code was written; since we don't know which
@@ -160,14 +155,11 @@
 		return 0;
 	} else {
 		const char *type[4] = {"I/O", "chsc", "message", "ADM"};
-		CIO_CRW_EVENT(6, "ssd: sch %x is %s subchannel\n",
-			      irq, type[ssd_area->st]);
-		if (ioinfo[irq] == NULL)
-			/* FIXME: we should do device rec. here... */
-			return 0;
+		CIO_CRW_EVENT(6, "ssd: sch %s is %s subchannel\n",
+			      sch->dev.bus_id, type[ssd_area->st]);
 
-		ioinfo[irq]->ssd_info.valid = 1;
-		ioinfo[irq]->ssd_info.type = ssd_area->st;
+		sch->ssd_info.valid = 1;
+		sch->ssd_info.type = ssd_area->st;
 	}
 
 	if (ssd_area->st == 0 || ssd_area->st == 2) {
@@ -175,89 +167,73 @@
 			if (!((0x80 >> j) & ssd_area->path_mask &
 			      ssd_area->fla_valid_mask))
 				continue;
-			chpid = ssd_area->chpid[j];
-			if (chpid
-			    && (!test_and_set_bit (chpid, chpids_known))
-			    && (test_bit (chpid, chpids_logical)))
-				set_bit	 (chpid, chpids);
-
-			ioinfo[irq]->ssd_info.chpid[j] = chpid;
-			ioinfo[irq]->ssd_info.fla[j]   = ssd_area->fla[j];
+			sch->ssd_info.chpid[j] = ssd_area->chpid[j];
+			sch->ssd_info.fla[j]   = ssd_area->fla[j];
 		}
 	}
-
 	return 0;
 }
 
-static int
-chsc_get_sch_descriptions(void)
+int
+css_get_ssd_info(struct subchannel *sch)
 {
-	int irq;
-	int err;
+	int ret;
 	void *page;
 
-	CIO_TRACE_EVENT( 4, "gsdesc");
-
-	/*
-	 * get information about chpids and link addresses
-	 * by executing the chsc command 'store subchannel description'
-	 */
 	page = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
 	if (!page)
 		return -ENOMEM;
-
-	err = 0;
-	for (irq = 0; irq <= highest_subchannel; irq++) {
-		/*
-		 * retrieve information for each sch
-		 */
-		err = chsc_get_sch_desc_irq(irq, page);
-		if (err) {
-			static int cio_chsc_err_msg;
-
-			if (!cio_chsc_err_msg) {
-				printk(KERN_ERR
-				       "chsc_get_sch_descriptions:"
-				       " Error %d while doing chsc; "
-				       "processing some machine checks may "
-				       "not work\n", err);
-				cio_chsc_err_msg = 1;
-			}
-			goto out;
+	spin_lock_irq(&sch->lock);
+	ret = chsc_get_sch_desc_irq(sch, page);
+	if (ret) {
+		static int cio_chsc_err_msg;
+		
+		if (!cio_chsc_err_msg) {
+			printk(KERN_ERR
+			       "chsc_get_sch_descriptions:"
+			       " Error %d while doing chsc; "
+			       "processing some machine checks may "
+			       "not work\n", ret);
+			cio_chsc_err_msg = 1;
 		}
-		clear_page(page);
 	}
-	cio_chsc_desc_avail = 1;
-out:
+	spin_unlock_irq(&sch->lock);
 	free_page((unsigned long)page);
-	return err;
+	if (!ret) {
+		int j, chpid;
+		/* Allocate channel path structures, if needed. */
+		for (j = 0; j < 8; j++) {
+			chpid = sch->ssd_info.chpid[j];
+			if (chpid && !get_chp_status(chpid))
+			    new_channel_path(chpid, CHP_ONLINE);
+		}
+	}
+	return ret;
 }
 
-__initcall(chsc_get_sch_descriptions);
-
-
-static inline void
-s390_subchannel_remove_chpid(struct subchannel *sch, __u8 chpid)
+static int
+s390_subchannel_remove_chpid(struct device *dev, void *data)
 {
 	int j;
 	int mask;
+	struct subchannel *sch;
+	__u8 *chpid;
 
+	sch = to_subchannel(dev);
+	chpid = data;
 	for (j = 0; j < 8; j++)
-		if (sch->schib.pmcw.chpid[j] == chpid)
+		if (sch->schib.pmcw.chpid[j] == *chpid)
 			break;
 	if (j >= 8)
-		return;
+		return 0;
 
 	mask = 0x80 >> j;
 	spin_lock(&sch->lock);
 
-	chsc_validate_chpids(sch);
-
 	stsch(sch->irq, &sch->schib);
-	if (sch->vpm == mask) {
-		dev_fsm_event(sch->dev.driver_data, DEV_EVENT_NOTOPER);
-		goto out_unlock;
-	}
+	if (sch->vpm == mask)
+		goto out_unreg;
+
 	if ((sch->schib.scsw.actl & (SCSW_ACTL_CLEAR_PEND |
 				     SCSW_ACTL_HALT_PEND |
 				     SCSW_ACTL_START_PEND |
@@ -265,83 +241,64 @@
 	    (sch->schib.pmcw.lpum == mask)) {
 		int cc = cio_cancel(sch);
 		
-		if (cc == -ENODEV) {
-			dev_fsm_event(sch->dev.driver_data, DEV_EVENT_NOTOPER);
-			goto out_unlock;
-		}
+		if (cc == -ENODEV)
+			goto out_unreg;
 
 		if (cc == -EINVAL) {
-			struct ccw_device *cdev;
-
 			cc = cio_clear(sch);
-			if (cc == -ENODEV) {
-				dev_fsm_event(sch->dev.driver_data,
-					      DEV_EVENT_NOTOPER);
-				goto out_unlock;
-			}
+			if (cc == -ENODEV)
+				goto out_unreg;
 			/* Call handler. */
-			cdev = sch->dev.driver_data;
-			cdev->private->state = DEV_STATE_CLEAR_VERIFY;
-			if (cdev->handler)
-				cdev->handler(cdev, cdev->private->intparm,
-					      ERR_PTR(-EIO));
+			if (sch->driver && sch->driver->termination)
+				sch->driver->termination(&sch->dev);
 			goto out_unlock;
 		}
 	} else if ((sch->schib.scsw.actl & SCSW_ACTL_DEVACT) &&
 		   (sch->schib.scsw.actl & SCSW_ACTL_SCHACT) &&
 		   (sch->schib.pmcw.lpum == mask)) {
-		struct ccw_device *cdev;
 		int cc;
 
 		cc = cio_clear(sch);
-		if (cc == -ENODEV) {
-			dev_fsm_event(sch->dev.driver_data, DEV_EVENT_NOTOPER);
-			goto out_unlock;
-		}
+		if (cc == -ENODEV)
+			goto out_unreg;
 		/* Call handler. */
-		cdev = sch->dev.driver_data;
-		cdev->private->state = DEV_STATE_CLEAR_VERIFY;
-		if (cdev->handler)
-			cdev->handler(cdev, cdev->private->intparm,
-				      ERR_PTR(-EIO));
+		if (sch->driver && sch->driver->termination)
+			sch->driver->termination(&sch->dev);
 		goto out_unlock;
 	}
 
 	/* trigger path verification. */
-	dev_fsm_event(sch->dev.driver_data, DEV_EVENT_VERIFY);
+	if (sch->driver && sch->driver->verify)
+		sch->driver->verify(&sch->dev);
 out_unlock:
 	spin_unlock(&sch->lock);
+	return 0;
+out_unreg:
+	spin_unlock(&sch->lock);
+	if (sch->driver && sch->driver->notify &&
+	    sch->driver->notify(&sch->dev, CIO_NO_PATH))
+		return 0;
+	device_unregister(&sch->dev);
+	sch->schib.pmcw.intparm = 0;
+	cio_modify(sch);
+	return 0;
 }
 
-/* FIXME: don't iterate all subchannels but use driver_for_each_dev */
 static inline void
 s390_set_chpid_offline( __u8 chpid)
 {
 	char dbf_txt[15];
-	struct subchannel *sch;
-	int irq;
 
 	sprintf(dbf_txt, "chpr%x", chpid);
 	CIO_TRACE_EVENT(2, dbf_txt);
 
-	clear_bit(chpid, chpids);
-	if (!test_and_clear_bit(chpid, chpids_known))
+	if (!get_chp_status(chpid))
 		return;	 /* we didn't know the chpid anyway */
 
-	set_chp_status(chpid, CHP_OFFLINE);
-
-#if 0
-	driver_for_each_dev(io_subchannel_driver, chpid, s390_subchannel_remove_chpid);
-#else
-
-	for (irq = 0; irq <= highest_subchannel; irq++) {
-		sch = ioinfo[irq];
-		if (sch == NULL)
-			continue;  /* we don't know the device anyway */
+	set_chp_online(chpid, 0);
 
-		s390_subchannel_remove_chpid(sch, chpid);
-	}
-#endif
+	bus_for_each_dev(&css_bus_type, NULL, &chpid,
+			 s390_subchannel_remove_chpid);
 }
 
 static int
@@ -353,7 +310,7 @@
 	int ccode;
 	
 	/* Update our ssd_info */
-	if (chsc_get_sch_desc_irq(sch->irq, page))
+	if (chsc_get_sch_desc_irq(sch, page))
 		return 0;
 	
 	found = 0;
@@ -407,7 +364,7 @@
 	 * will we have to do.
 	 */
 
-	if (!test_bit(chpid, chpids_logical))
+	if (get_chp_status(chpid) & CHP_LOGICALLY_OFFLINE)
 		return; /* no need to do the rest */
 
 	page = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
@@ -417,7 +374,7 @@
 	for (irq = 0; irq < __MAX_SUBCHANNELS; irq++) {
 		int chp_mask;
 
-		sch = ioinfo[irq];
+		sch = get_subchannel_by_schid(irq);
 		if (!sch) {
 			/*
 			 * We don't know the device yet, but since a path
@@ -450,17 +407,16 @@
 				continue;
 		}
 
-		sch->lpm = (sch->schib.pmcw.pim &
-			    sch->schib.pmcw.pam &
-			    sch->schib.pmcw.pom)
-			| chp_mask;
-
-		chsc_validate_chpids(sch);
+		sch->lpm = ((sch->schib.pmcw.pim &
+			     sch->schib.pmcw.pam &
+			     sch->schib.pmcw.pom)
+			    | chp_mask) & sch->opm;
 
-		dev_fsm_event(sch->dev.driver_data, DEV_EVENT_VERIFY);
+		if (sch->driver && sch->driver->verify)
+			sch->driver->verify(&sch->dev);
 
 		spin_unlock_irq(&sch->lock);
-
+		put_device(&sch->dev);
 		if (fla_mask != 0)
 			break;
 	}
@@ -497,8 +453,8 @@
 	return (u16) (lir->indesc[0]&0x000000ff);
 }
 
-static void
-do_process_crw(void *ignore)
+void
+chsc_process_crw(void)
 {
 	int chpid;
 	struct {
@@ -608,7 +564,7 @@
 			if (chps[sei_area->rsid] == NULL)
 				new_channel_path(sei_area->rsid, CHP_ONLINE);
 			else
-				set_chp_status(sei_area->rsid, CHP_ONLINE);
+				set_chp_online(sei_area->rsid, 1);
 			
 			if ((sei_area->vf & 0x80) == 0) {
 				pr_debug("chpid: %x\n", sei_area->rsid);
@@ -639,14 +595,6 @@
 	free_page((unsigned long)sei_area);
 }
 
-void
-chsc_process_crw(void)
-{
-	static DECLARE_WORK(work, do_process_crw, 0);
-
-	queue_work(ccw_device_work, &work);
-}
-
 static void
 chp_add(int chpid)
 {
@@ -654,7 +602,7 @@
 	int irq, ret;
 	char dbf_txt[15];
 
-	if (!test_bit(chpid, chpids_logical))
+	if (get_chp_status(chpid) & CHP_LOGICALLY_OFFLINE)
 		return; /* no need to do the rest */
 	
 	sprintf(dbf_txt, "cadd%x", chpid);
@@ -663,7 +611,7 @@
 	for (irq = 0; irq < __MAX_SUBCHANNELS; irq++) {
 		int i;
 
-		sch = ioinfo[irq];
+		sch = get_subchannel_by_schid(irq);
 		if (!sch) {
 			ret = css_probe_device(irq);
 			if (ret == -ENXIO)
@@ -686,16 +634,16 @@
 			spin_unlock(&sch->lock);
 			return;
 		}
-		sch->lpm = (sch->schib.pmcw.pim &
-			    sch->schib.pmcw.pam &
-			    sch->schib.pmcw.pom)
-			| 0x80 >> i;
-
-		chsc_validate_chpids(sch);
+		sch->lpm = ((sch->schib.pmcw.pim &
+			     sch->schib.pmcw.pam &
+			     sch->schib.pmcw.pom)
+			    | 0x80 >> i) & sch->opm;
 
-		dev_fsm_event(sch->dev.driver_data, DEV_EVENT_VERIFY);
+		if (sch->driver && sch->driver->verify)
+			sch->driver->verify(&sch->dev);
 
 		spin_unlock(&sch->lock);
+		put_device(&sch->dev);
 	}
 }
 
@@ -716,12 +664,80 @@
 		if (chps[chpid] == NULL)
 			new_channel_path(chpid, CHP_ONLINE);
 		else
-			set_chp_status(chpid, CHP_ONLINE);
+			set_chp_online(chpid, 1);
 		/* Avoid the extra overhead in process_rec_acc. */
 		chp_add(chpid);
 	}
 }
 
+static inline void
+__check_for_io_and_kill(struct subchannel *sch, int index)
+{
+	int cc;
+
+	cc = stsch(sch->irq, &sch->schib);
+	if (cc)
+		return;
+	if (sch->schib.scsw.actl && sch->schib.pmcw.lpum == (0x80 >> index))
+		device_set_waiting(sch);
+}
+
+static inline void
+__s390_subchannel_vary_chpid(struct subchannel *sch, __u8 chpid, int on)
+{
+	int chp;
+
+	if (!sch->ssd_info.valid)
+		return;
+	
+	for (chp = 0; chp < 8; chp++) {
+		if (sch->ssd_info.chpid[chp] == chpid) {
+			if (on) {
+				sch->opm |= (0x80 >> chp);
+				sch->lpm |= (0x80 >> chp);
+			} else {
+				sch->opm &= ~(0x80 >> chp);
+				sch->lpm &= ~(0x80 >> chp);
+				/*
+				 * Give running I/O a grace period in which it
+				 * can successfully terminate, even using the
+				 * just varied off path. Then kill it.
+				 */
+				__check_for_io_and_kill(sch, chp);
+			}
+			if (sch->driver && sch->driver->verify)
+				sch->driver->verify(&sch->dev);
+			break;
+		}
+	}
+}
+
+static int
+s390_subchannel_vary_chpid_off(struct device *dev, void *data)
+{
+	struct subchannel *sch;
+	__u8 *chpid;
+
+	sch = to_subchannel(dev);
+	chpid = data;
+
+	__s390_subchannel_vary_chpid(sch, *chpid, 0);
+	return 0;
+}
+
+static int
+s390_subchannel_vary_chpid_on(struct device *dev, void *data)
+{
+	struct subchannel *sch;
+	__u8 *chpid;
+
+	sch = to_subchannel(dev);
+	chpid = data;
+
+	__s390_subchannel_vary_chpid(sch, *chpid, 1);
+	return 0;
+}
+
 /*
  * Function: s390_vary_chpid
  * Varies the specified chpid online or offline
@@ -730,66 +746,33 @@
 s390_vary_chpid( __u8 chpid, int on)
 {
 	char dbf_text[15];
-	struct subchannel *sch;
-	int irq;
+	int status;
 
 	sprintf(dbf_text, on?"varyon%x":"varyoff%x", chpid);
 	CIO_TRACE_EVENT( 2, dbf_text);
 
-	chsc_get_sch_descriptions();
-	if (!cio_chsc_desc_avail) {
-		printk(KERN_ERR "Could not get chpid status, "
-		       "vary on/off not available\n");
-		return -EPERM;
-	}
-
-	if (!test_bit(chpid, chpids_known)) {
+	status = get_chp_status(chpid);
+	if (!status) {
 		printk(KERN_ERR "Can't vary unknown chpid %02X\n", chpid);
 		return -EINVAL;
 	}
 
-	if (test_bit(chpid, chpids) == on) {
+	if ((on && !(status & CHP_LOGICALLY_OFFLINE)) ||
+	    (!on && (status & CHP_LOGICALLY_OFFLINE))) {
 		printk(KERN_ERR "chpid %x is "
 		       "already %sline\n", chpid, on ? "on" : "off");
 		return -EINVAL;
 	}
 
-	if (on) {
-		set_bit(chpid, chpids_logical);
-		set_bit(chpid, chpids);
-		set_chp_status(chpid, CHP_ONLINE);
-	} else {
-		clear_bit(chpid, chpids_logical);
-		clear_bit(chpid, chpids);
-		set_chp_status(chpid, CHP_LOGICALLY_OFFLINE);
-	}
+	set_chp_logically_online(chpid, on);
 
 	/*
 	 * Redo PathVerification on the devices the chpid connects to
 	 */
 
-	for (irq = 0; irq <= highest_subchannel; irq++) {
-		int chp;
-		/*
-		 * We don't need to adjust the lpm, as this will be done in
-		 * DevicePathVerification...
-		 */
-		sch = ioinfo[irq];
-		if (sch == NULL || sch->st || !sch->ssd_info.valid)
-			continue;
-
-		for (chp = 0; chp < 8; chp++) {
-			if (sch->ssd_info.chpid[chp] == chpid) {
-				if (on)
-					sch->lpm |= (0x80 >> chp);
-				else
-					sch->lpm &= ~(0x80 >> chp);
-				dev_fsm_event(sch->dev.driver_data,
-					      DEV_EVENT_VERIFY);
-				break;
-			}
-		}
-	}
+	bus_for_each_dev(&css_bus_type, NULL, &chpid, on ?
+			 s390_subchannel_vary_chpid_on :
+			 s390_subchannel_vary_chpid_off);
 	return 0;
 }
 
@@ -800,22 +783,16 @@
 chp_status_show(struct device *dev, char *buf)
 {
 	struct channel_path *chp = container_of(dev, struct channel_path, dev);
+	int state;
 
 	if (!chp)
 		return 0;
-
-	switch(chp->state) {
-	case CHP_OFFLINE:
+	state = get_chp_status(chp->id);
+	if (state & CHP_STANDBY)
 		return sprintf(buf, "n/a\n");
-	case CHP_LOGICALLY_OFFLINE:
-		return sprintf(buf, "logically offline\n");
-	case CHP_STANDBY:
-		return sprintf(buf, "n/a\n");
-	case CHP_ONLINE:
-		return sprintf(buf, "online\n");
-	default:
-		return 0;
-	}
+	return (state & CHP_LOGICALLY_OFFLINE) ?
+		sprintf(buf, "logically offline\n") :
+		sprintf(buf, "online\n");
 }
 
 static ssize_t
@@ -847,6 +824,10 @@
 static void
 chp_release(struct device *dev)
 {
+	struct channel_path *cp;
+	
+	cp = container_of(dev, struct channel_path, dev);
+	kfree(cp);
 }
 
 /*
@@ -868,7 +849,19 @@
 
 	/* fill in status, etc. */
 	chp->id = chpid;
-	chp->state = status;
+	switch (status) {
+	case CHP_STANDBY:
+		chp->state.online = 0;
+		chp->state.logically_online = 1;
+		break;
+	case CHP_LOGICALLY_OFFLINE:
+		chp->state.logically_online = 0;
+		chp->state.online = 1;
+		break;
+	case CHP_ONLINE:
+		chp->state.online = 1;
+		chp->state.logically_online = 1;
+	}
 	chp->dev = (struct device) {
 		.parent  = &css_bus_device,
 		.release = chp_release,
@@ -889,32 +882,3 @@
 	return ret;
 }
 
-static int __init
-register_channel_paths(void)
-{
-	int i;
-	int ret;
-
-	/* walk through the chpids arrays */
-	for (i = 0; i < NR_CHPIDS; i++) {
-		/* we are only interested in known chpids */
-		if (!test_bit(i, chpids_known))
-			continue;
-		if (!test_bit(i, chpids))
-			/* standby */
-			ret = new_channel_path(i, CHP_STANDBY);
-
-		else if (test_bit(i, chpids_logical))
-			/* online */
-			ret = new_channel_path(i, CHP_ONLINE);
-		else
-			/* logically offline */
-			ret = new_channel_path(i, CHP_LOGICALLY_OFFLINE);
-
-		if (ret)
-			return ret;
-	}
-	return 0;
-}
-
-module_init(register_channel_paths);
diff -Nru a/drivers/s390/cio/chsc.h b/drivers/s390/cio/chsc.h
--- a/drivers/s390/cio/chsc.h	Tue Feb  3 19:45:41 2004
+++ b/drivers/s390/cio/chsc.h	Tue Feb  3 19:45:41 2004
@@ -3,10 +3,9 @@
 
 #define NR_CHPIDS 256
 
-#define CHP_OFFLINE 0
-#define CHP_LOGICALLY_OFFLINE 1
-#define CHP_STANDBY 2
-#define CHP_ONLINE 3
+#define CHP_STANDBY 1
+#define CHP_LOGICALLY_OFFLINE 2
+#define CHP_ONLINE 4
 
 #define CHSC_SEI_ACC_CHPID        1
 #define CHSC_SEI_ACC_LINKADDR     2
@@ -19,7 +18,10 @@
 
 struct channel_path {
 	int id;
-	int state;
+	struct {
+		unsigned int online:1;
+		unsigned int logically_online:1;
+	}__attribute__((packed)) state;
 	struct device dev;
 };
 
diff -Nru a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
--- a/drivers/s390/cio/cio.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/s390/cio/cio.c	Tue Feb  3 19:45:42 2004
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/cio.c
  *   S/390 common I/O routines -- low level i/o calls
- *   $Revision: 1.105 $
+ *   $Revision: 1.114 $
  *
  *    Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
  *			      IBM Corporation
@@ -147,7 +147,7 @@
 	if (tsch (tpi_info->irq, irb) != 0)
 		/* Not status pending or not operational. */
 		return 1;
-	sch = ioinfo[tpi_info->irq];
+	sch = (struct subchannel *)(unsigned long)tpi_info->intparm;
 	if (!sch)
 		return 1;
 	irq_enter ();
@@ -184,22 +184,22 @@
 int
 cio_start (struct subchannel *sch,	/* subchannel structure */
 	   struct ccw1 * cpa,		/* logical channel prog addr */
-	   unsigned int intparm,	/* interruption parameter */
 	   __u8 lpm)			/* logical path mask */
 {
 	char dbf_txt[15];
 	int ccode;
 
-	sprintf (dbf_txt, "stIO%x", sch->irq);
-	CIO_TRACE_EVENT (4, dbf_txt);
+	CIO_TRACE_EVENT (4, "stIO");
+	CIO_TRACE_EVENT (4, sch->dev.bus_id);
 
-	sch->orb.intparm = intparm;
+	/* sch is always under 2G. */
+	sch->orb.intparm = (__u32)(unsigned long)sch;
 	sch->orb.fmt = 1;
 
 	sch->orb.pfch = sch->options.prefetch == 0;
 	sch->orb.spnd = sch->options.suspend;
 	sch->orb.ssic = sch->options.suspend && sch->options.inter;
-	sch->orb.lpm = (lpm != 0) ? lpm : sch->lpm;
+	sch->orb.lpm = (lpm != 0) ? (lpm & sch->opm) : sch->lpm;
 #ifdef CONFIG_ARCH_S390X
 	/*
 	 * for 64 bit we always support 64 bit IDAWs with 4k page size only
@@ -240,8 +240,8 @@
 	char dbf_txt[15];
 	int ccode;
 
-	sprintf (dbf_txt, "resIO%x", sch->irq);
-	CIO_TRACE_EVENT (4, dbf_txt);
+	CIO_TRACE_EVENT (4, "resIO");
+	CIO_TRACE_EVENT (4, sch->dev.bus_id);
 
 	ccode = rsch (sch->irq);
 
@@ -277,8 +277,8 @@
 	if (!sch)
 		return -ENODEV;
 
-	sprintf (dbf_txt, "haltIO%x", sch->irq);
-	CIO_TRACE_EVENT (2, dbf_txt);
+	CIO_TRACE_EVENT (2, "haltIO");
+	CIO_TRACE_EVENT (2, sch->dev.bus_id);
 
 	/*
 	 * Issue "Halt subchannel" and process condition code
@@ -312,8 +312,8 @@
 	if (!sch)
 		return -ENODEV;
 
-	sprintf (dbf_txt, "clearIO%x", sch->irq);
-	CIO_TRACE_EVENT (2, dbf_txt);
+	CIO_TRACE_EVENT (2, "clearIO");
+	CIO_TRACE_EVENT (2, sch->dev.bus_id);
 
 	/*
 	 * Issue "Clear subchannel" and process condition code
@@ -348,8 +348,8 @@
 	if (!sch)
 		return -ENODEV;
 
-	sprintf (dbf_txt, "cancelIO%x", sch->irq);
-	CIO_TRACE_EVENT (2, dbf_txt);
+	CIO_TRACE_EVENT (2, "cancelIO");
+	CIO_TRACE_EVENT (2, sch->dev.bus_id);
 
 	ccode = xsch (sch->irq);
 
@@ -374,7 +374,7 @@
  * Function: cio_modify
  * Issues a "Modify Subchannel" on the specified subchannel
  */
-static int
+int
 cio_modify (struct subchannel *sch)
 {
 	int ccode, retry, ret;
@@ -411,8 +411,8 @@
 	int retry;
 	int ret;
 
-	sprintf (dbf_txt, "ensch%x", sch->irq);
-	CIO_TRACE_EVENT (2, dbf_txt);
+	CIO_TRACE_EVENT (2, "ensch");
+	CIO_TRACE_EVENT (2, sch->dev.bus_id);
 
 	ccode = stsch (sch->irq, &sch->schib);
 	if (ccode)
@@ -420,6 +420,7 @@
 
 	sch->schib.pmcw.ena = 1;
 	sch->schib.pmcw.isc = isc;
+	sch->schib.pmcw.intparm = (__u32)(unsigned long)sch;
 	for (retry = 5, ret = 0; retry > 0; retry--) {
 		ret = cio_modify(sch);
 		if (ret == -ENODEV)
@@ -457,8 +458,8 @@
 	int retry;
 	int ret;
 
-	sprintf (dbf_txt, "dissch%x", sch->irq);
-	CIO_TRACE_EVENT (2, dbf_txt);
+	CIO_TRACE_EVENT (2, "dissch");
+	CIO_TRACE_EVENT (2, sch->dev.bus_id);
 
 	ccode = stsch (sch->irq, &sch->schib);
 	if (ccode == 3)		/* Not operational. */
@@ -477,6 +478,13 @@
 		ret = cio_modify(sch);
 		if (ret == -ENODEV)
 			break;
+		if (ret == -EBUSY)
+			/*
+			 * The subchannel is busy or status pending.
+			 * We'll disable when the next interrupt was delivered
+			 * via the state machine.
+			 */
+			break;
 		if (ret == 0) {
 			stsch (sch->irq, &sch->schib);
 			if (!sch->schib.pmcw.ena)
@@ -512,6 +520,11 @@
 	/* Nuke all fields. */
 	memset(sch, 0, sizeof(struct subchannel));
 
+	spin_lock_init(&sch->lock);
+
+	/* Set a name for the subchannel */
+	snprintf (sch->dev.bus_id, BUS_ID_SIZE, "0.0.%04x", irq);
+
 	/*
 	 * The first subchannel that is not-operational (ccode==3)
 	 *  indicates that there aren't any more devices available.
@@ -551,12 +564,12 @@
 			      "at devno %04X\n", sch->schib.pmcw.dev);
 		return -ENODEV;
 	}
-
+	sch->opm = 0xff;
+	chsc_validate_chpids(sch);
 	sch->lpm = sch->schib.pmcw.pim &
 		sch->schib.pmcw.pam &
-		sch->schib.pmcw.pom;
-
-	chsc_validate_chpids(sch);
+		sch->schib.pmcw.pom &
+		sch->opm;
 
 	CIO_DEBUG(KERN_INFO, 0,
 		  "Detected device %04X on subchannel %s"
@@ -575,7 +588,6 @@
 	sch->schib.pmcw.isc = 3;	/* could be smth. else */
 	sch->schib.pmcw.csense = 1;	/* concurrent sense */
 	sch->schib.pmcw.ena = 0;
-	sch->schib.pmcw.intparm = sch->schib.pmcw.dev;
 	if ((sch->lpm & (sch->lpm - 1)) != 0)
 		sch->schib.pmcw.mp = 1;	/* multipath mode */
 	return 0;
@@ -612,7 +624,7 @@
 			do_adapter_IO();
 			continue;
 		}
-		sch = ioinfo[tpi_info->irq];
+		sch = (struct subchannel *)(unsigned long)tpi_info->intparm;
 		if (sch)
 			spin_lock(&sch->lock);
 		/* Store interrupt response block to lowcore. */
@@ -733,16 +745,40 @@
 	 */
 	ctl_set_bit(6, 24);
 	console_subchannel.schib.pmcw.isc = 7;
-	ioinfo[irq] = &console_subchannel;
+	console_subchannel.schib.pmcw.intparm =
+		(__u32)(unsigned long)&console_subchannel;
+	ret = cio_modify(&console_subchannel);
+	if (ret) {
+		console_subchannel_in_use = 0;
+		return ERR_PTR(ret);
+	}
 	return &console_subchannel;
 }
 
 void
 cio_release_console(void)
 {
-	ioinfo[console_subchannel.irq] = NULL;
+	console_subchannel.schib.pmcw.intparm = 0;
+	cio_modify(&console_subchannel);
 	ctl_clear_bit(6, 24);
 	console_subchannel_in_use = 0;
+}
+
+/* Bah... hack to catch console special sausages. */
+int
+cio_is_console(int irq)
+{
+	if (!console_subchannel_in_use)
+		return 0;
+	return (irq == console_subchannel.irq);
+}
+
+struct subchannel *
+cio_get_console_subchannel(void)
+{
+	if (!console_subchannel_in_use)
+		return 0;
+	return &console_subchannel;
 }
 
 #endif
diff -Nru a/drivers/s390/cio/cio.h b/drivers/s390/cio/cio.h
--- a/drivers/s390/cio/cio.h	Tue Feb  3 19:45:16 2004
+++ b/drivers/s390/cio/cio.h	Tue Feb  3 19:45:16 2004
@@ -98,6 +98,7 @@
 
 	__u8 vpm;		/* verified path mask */
 	__u8 lpm;		/* logical path mask */
+	__u8 opm;               /* operational path mask */
 	struct schib schib;	/* subchannel information block */
 	struct orb orb;		/* operation request block */
 	struct ccw1 sense_ccw;	/* static ccw for sense command */
@@ -117,14 +118,16 @@
 extern int cio_clear (struct subchannel *);
 extern int cio_resume (struct subchannel *);
 extern int cio_halt (struct subchannel *);
-extern int cio_start (struct subchannel *, struct ccw1 *, unsigned int, __u8);
+extern int cio_start (struct subchannel *, struct ccw1 *, __u8);
 extern int cio_cancel (struct subchannel *);
 extern int cio_set_options (struct subchannel *, int);
 extern int cio_get_options (struct subchannel *);
-
+extern int cio_modify (struct subchannel *);
 /* Use with care. */
 extern struct subchannel *cio_probe_console(void);
 extern void cio_release_console(void);
+extern int cio_is_console(int irq);
+extern struct subchannel *cio_get_console_subchannel(void);
 
 extern int cio_show_msg;
 
diff -Nru a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
--- a/drivers/s390/cio/css.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/cio/css.c	Tue Feb  3 19:45:17 2004
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/css.c
  *  driver for channel subsystem
- *   $Revision: 1.49 $
+ *   $Revision: 1.65 $
  *
  *    Copyright (C) 2002 IBM Deutschland Entwicklung GmbH,
  *			 IBM Corporation
@@ -14,15 +14,11 @@
 #include <linux/slab.h>
 #include <linux/errno.h>
 
-#include <asm/ccwdev.h> // FIXME: layering violation, remove this
-
 #include "css.h"
 #include "cio.h"
 #include "cio_debug.h"
-#include "device.h" // FIXME: dito
 #include "ioasm.h"
 
-struct subchannel *ioinfo[__MAX_SUBCHANNELS];
 unsigned int highest_subchannel;
 int css_init_done = 0;
 
@@ -30,23 +26,19 @@
 	.bus_id = "css0",
 };
 
-static int
+static struct subchannel *
 css_alloc_subchannel(int irq)
 {
 	struct subchannel *sch;
 	int ret;
 
-	if (ioinfo[irq])
-		/* There already is a struct subchannel for this irq. */
-		return -EBUSY;
-
 	sch = kmalloc (sizeof (*sch), GFP_KERNEL | GFP_DMA);
 	if (sch == NULL)
-		return -ENOMEM;
+		return ERR_PTR(-ENOMEM);
 	ret = cio_validate_subchannel (sch, irq);
 	if (ret < 0) {
 		kfree(sch);
-		return ret;
+		return ERR_PTR(ret);
 	}
 	if (irq > highest_subchannel)
 		highest_subchannel = irq;
@@ -54,27 +46,47 @@
 	if (sch->st != SUBCHANNEL_TYPE_IO) {
 		/* For now we ignore all non-io subchannels. */
 		kfree(sch);
-		return -EINVAL;
+		return ERR_PTR(-EINVAL);
 	}
 
-	ioinfo[irq] = sch;
-
-	return 0;
+	/* 
+	 * Set intparm to subchannel address.
+	 * This is fine even on 64bit since the subchannel is always located
+	 * under 2G.
+	 */
+	sch->schib.pmcw.intparm = (__u32)(unsigned long)sch;
+	ret = cio_modify(sch);
+	if (ret) {
+		kfree(sch);
+		return ERR_PTR(ret);
+	}
+	return sch;
 }
 
 static void
-css_free_subchannel(int irq)
+css_free_subchannel(struct subchannel *sch)
 {
-	struct subchannel *sch;
-
-	sch = ioinfo[irq];
 	if (sch) {
-		ioinfo[irq] = NULL;
+		/* Reset intparm to zeroes. */
+		sch->schib.pmcw.intparm = 0;
+		cio_modify(sch);
 		kfree(sch);
 	}
 	
 }
 
+static void
+css_subchannel_release(struct device *dev)
+{
+	struct subchannel *sch;
+
+	sch = to_subchannel(dev);
+	if (!cio_is_console(sch->irq))
+		kfree(sch);
+}
+
+extern int css_get_ssd_info(struct subchannel *sch);
+
 static int
 css_register_subchannel(struct subchannel *sch)
 {
@@ -83,15 +95,15 @@
 	/* Initialize the subchannel structure */
 	sch->dev.parent = &css_bus_device;
 	sch->dev.bus = &css_bus_type;
-
-	/* Set a name for the subchannel */
-	snprintf (sch->dev.bus_id, BUS_ID_SIZE, "0.0.%04x", sch->irq);
-
+	sch->dev.release = &css_subchannel_release;
+	
 	/* make it known to the system */
 	ret = device_register(&sch->dev);
 	if (ret)
 		printk (KERN_WARNING "%s: could not register %s\n",
 			__func__, sch->dev.bus_id);
+	else
+		css_get_ssd_info(sch);
 	return ret;
 }
 
@@ -99,28 +111,159 @@
 css_probe_device(int irq)
 {
 	int ret;
+	struct subchannel *sch;
 
-	ret = css_alloc_subchannel(irq);
-	if (ret)
-		return ret;
-	ret = css_register_subchannel(ioinfo[irq]);
+	sch = css_alloc_subchannel(irq);
+	if (IS_ERR(sch))
+		return PTR_ERR(sch);
+	ret = css_register_subchannel(sch);
 	if (ret)
-		css_free_subchannel(irq);
+		css_free_subchannel(sch);
+	return ret;
+}
+
+static struct subchannel *
+__get_subchannel_by_stsch(int irq)
+{
+	struct subchannel *sch;
+	int cc;
+	struct schib schib;
+
+	cc = stsch(irq, &schib);
+	if (cc)
+		return NULL;
+	sch = (struct subchannel *)(unsigned long)schib.pmcw.intparm;
+	if (!sch)
+		return NULL;
+	if (get_device(&sch->dev))
+		return sch;
+	return NULL;
+}
+
+struct subchannel *
+get_subchannel_by_schid(int irq)
+{
+	struct subchannel *sch;
+	struct list_head *entry;
+	struct device *dev;
+
+	if (!get_bus(&css_bus_type))
+		return NULL;
+
+	/* Try to get subchannel from pmcw first. */ 
+	sch = __get_subchannel_by_stsch(irq);
+	if (sch)
+		goto out;
+	if (!get_driver(&io_subchannel_driver.drv))
+		goto out;
+	down_read(&css_bus_type.subsys.rwsem);
+
+	list_for_each(entry, &io_subchannel_driver.drv.devices) {
+		dev = get_device(container_of(entry,
+					      struct device, driver_list));
+		if (!dev)
+			continue;
+		sch = to_subchannel(dev);
+		if (sch->irq == irq)
+			break;
+		put_device(dev);
+		sch = NULL;
+	}
+	up_read(&css_bus_type.subsys.rwsem);
+	put_driver(&io_subchannel_driver.drv);
+out:
+	put_bus(&css_bus_type);
+
+	return sch;
+}
+
+static inline int
+css_get_subchannel_status(struct subchannel *sch, int schid)
+{
+	struct schib schib;
+	int cc;
+
+	cc = stsch(schid, &schib);
+	if (cc)
+		return CIO_GONE;
+	if (!schib.pmcw.dnv)
+		return CIO_GONE;
+	if (sch && (schib.pmcw.dev != sch->schib.pmcw.dev))
+		return CIO_REVALIDATE;
+	return CIO_OPER;
+}
+	
+static inline int
+css_evaluate_subchannel(int irq)
+{
+	int event, ret, disc;
+	struct subchannel *sch;
+
+	sch = get_subchannel_by_schid(irq);
+	disc = sch ? device_is_disconnected(sch) : 0;
+	event = css_get_subchannel_status(sch, irq);
+	switch (event) {
+	case CIO_GONE:
+		if (!sch) {
+			/* Never used this subchannel. Ignore. */
+			ret = 0;
+			break;
+		}
+		if (sch->driver && sch->driver->notify &&
+		    sch->driver->notify(&sch->dev, CIO_GONE)) {
+			device_set_disconnected(sch);
+			ret = 0;
+			break;
+		}
+		/*
+		 * Unregister subchannel.
+		 * The device will be killed automatically.
+		 */
+		device_unregister(&sch->dev);
+		/* Reset intparm to zeroes. */
+		sch->schib.pmcw.intparm = 0;
+		cio_modify(sch);
+		put_device(&sch->dev);
+		ret = 0;
+		break;
+	case CIO_REVALIDATE:
+		/* 
+		 * Revalidation machine check. Sick.
+		 * We don't notify the driver since we have to throw the device
+		 * away in any case.
+		 */
+		device_unregister(&sch->dev);
+		/* Reset intparm to zeroes. */
+		sch->schib.pmcw.intparm = 0;
+		cio_modify(sch);
+		put_device(&sch->dev);
+		ret = css_probe_device(irq);
+		break;
+	case CIO_OPER:
+		if (disc)
+			/* Get device operational again. */
+			device_trigger_reprobe(sch);
+		ret = sch ? 0 : css_probe_device(irq);
+		break;
+	default:
+		BUG();
+		ret = 0;
+	}
 	return ret;
 }
 
 /*
  * Rescan for new devices. FIXME: This is slow.
+ * This function is called when we have lost CRWs due to overflows and we have
+ * to do subchannel housekeeping.
  */
-static void
-do_process_crw(void *ignore)
+void
+css_reiterate_subchannels(void)
 {
 	int irq, ret;
 
-	for (irq = 0; irq < __MAX_SUBCHANNELS; irq++) {
-		if (ioinfo[irq])
-			continue;
-		ret = css_probe_device(irq);
+	for (irq = 0; irq <= __MAX_SUBCHANNELS; irq++) {
+		ret = css_evaluate_subchannel(irq);
 		/* No more memory. It doesn't make sense to continue. No
 		 * panic because this can happen in midflight and just
 		 * because we can't use a new device is no reason to crash
@@ -135,39 +278,25 @@
 
 /*
  * Called from the machine check handler for subchannel report words.
- * Note: this is called disabled from the machine check handler itself.
  */
 void
 css_process_crw(int irq)
 {
-	static DECLARE_WORK(work, do_process_crw, 0);
-	struct subchannel *sch;
-	int ccode, devno;
-
 	CIO_CRW_EVENT(2, "source is subchannel %04X\n", irq);
 
-	sch = ioinfo[irq];
-	if (sch == NULL) {
-		queue_work(ccw_device_work, &work);
-		return;
-	}
-	if (!sch->dev.driver_data)
-		return;
-	devno = sch->schib.pmcw.dev;
-	/* FIXME: css_process_crw must not know about ccw_device */
-	dev_fsm_event(sch->dev.driver_data, DEV_EVENT_NOTOPER);
-	ccode = stsch(irq, &sch->schib);
-	if (!ccode)
-		if (devno != sch->schib.pmcw.dev)
-			queue_work(ccw_device_work, &work);
+	/* 
+	 * Since we are always presented with IPI in the CRW, we have to
+	 * use stsch() to find out if the subchannel in question has come
+	 * or gone.
+	 */
+	css_evaluate_subchannel(irq);
 }
 
 /*
  * some of the initialization has already been done from init_IRQ(),
  * here we do the rest now that the driver core is running.
- * Currently, this functions scans all the subchannel structures for
- * devices. The long term plan is to remove ioinfo[] and then the
- * struct subchannel's will be created during probing. 
+ * The struct subchannel's are created during probing (except for the
+ * static console subchannel).
  */
 static int __init
 init_channel_subsystem (void)
@@ -184,8 +313,16 @@
 	ctl_set_bit(6, 28);
 
 	for (irq = 0; irq < __MAX_SUBCHANNELS; irq++) {
-		if (!ioinfo[irq]) {
-			ret = css_alloc_subchannel(irq);
+		struct subchannel *sch;
+
+		if (cio_is_console(irq))
+			sch = cio_get_console_subchannel();
+		else {
+			sch = css_alloc_subchannel(irq);
+			if (IS_ERR(sch))
+				ret = PTR_ERR(sch);
+			else
+				ret = 0;
 			if (ret == -ENOMEM)
 				panic("Out of memory in "
 				      "init_channel_subsystem\n");
@@ -202,7 +339,7 @@
 		 * not working) so we do it now. This is true e.g. for the
 		 * console subchannel.
 		 */
-		css_register_subchannel(ioinfo[irq]);
+		css_register_subchannel(sch);
 	}
 	return 0;
 
@@ -236,6 +373,46 @@
 
 subsys_initcall(init_channel_subsystem);
 
+/*
+ * Register root devices for some drivers. The release function must not be
+ * in the device drivers, so we do it here.
+ */
+static void
+s390_root_dev_release(struct device *dev)
+{
+	kfree(dev);
+}
+
+struct device *
+s390_root_dev_register(const char *name)
+{
+	struct device *dev;
+	int ret;
+
+	if (!strlen(name))
+		return ERR_PTR(-EINVAL);
+	dev = kmalloc(sizeof(struct device), GFP_KERNEL);
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+	memset(dev, 0, sizeof(struct device));
+	strncpy(dev->bus_id, name, min(strlen(name), (size_t)BUS_ID_SIZE));
+	dev->release = s390_root_dev_release;
+	ret = device_register(dev);
+	if (ret) {
+		kfree(dev);
+		return ERR_PTR(ret);
+	}
+	return dev;
+}
+
+void
+s390_root_dev_unregister(struct device *dev)
+{
+	if (dev)
+		device_unregister(dev);
+}
+
 MODULE_LICENSE("GPL");
 EXPORT_SYMBOL(css_bus_type);
-
+EXPORT_SYMBOL(s390_root_dev_register);
+EXPORT_SYMBOL(s390_root_dev_unregister);
diff -Nru a/drivers/s390/cio/css.h b/drivers/s390/cio/css.h
--- a/drivers/s390/cio/css.h	Tue Feb  3 19:45:43 2004
+++ b/drivers/s390/cio/css.h	Tue Feb  3 19:45:43 2004
@@ -79,6 +79,7 @@
 		unsigned int esid:1;        /* Ext. SenseID supported by HW */
 		unsigned int dosense:1;	    /* delayed SENSE required */
 		unsigned int doverify:1;    /* delayed path verification */
+		unsigned int donotify:1;    /* call notify function */
 	} __attribute__((packed)) flags;
 	unsigned long intparm;	/* user interruption parameter */
 	struct qdio_irq *qdio_data;
@@ -100,22 +101,32 @@
 	unsigned int subchannel_type;
 	struct device_driver drv;
 	void (*irq)(struct device *);
+	int (*notify)(struct device *, int);
+	void (*verify)(struct device *);
+	void (*termination)(struct device *);
 };
 
 /*
  * all css_drivers have the css_bus_type
  */
 extern struct bus_type css_bus_type;
+extern struct css_driver io_subchannel_driver;
 
 int css_probe_device(int irq);
-
+extern struct subchannel * get_subchannel_by_schid(int irq);
 extern unsigned int highest_subchannel;
 extern int css_init_done;
 
 #define __MAX_SUBCHANNELS 65536
-extern struct subchannel *ioinfo[__MAX_SUBCHANNELS];
 
 extern struct bus_type css_bus_type;
 extern struct device css_bus_device;
 
+/* Some helper functions for disconnected state. */
+int device_is_disconnected(struct subchannel *);
+void device_set_disconnected(struct subchannel *);
+void device_trigger_reprobe(struct subchannel *);
+
+/* Helper function for vary on/off. */
+void device_set_waiting(struct subchannel *);
 #endif
diff -Nru a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
--- a/drivers/s390/cio/device.c	Tue Feb  3 19:45:35 2004
+++ b/drivers/s390/cio/device.c	Tue Feb  3 19:45:35 2004
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/device.c
  *  bus driver for ccw devices
- *   $Revision: 1.70 $
+ *   $Revision: 1.85 $
  *
  *    Copyright (C) 2002 IBM Deutschland Entwicklung GmbH,
  *			 IBM Corporation
@@ -115,16 +115,24 @@
 };
 
 static int io_subchannel_probe (struct device *);
+static int io_subchannel_remove (struct device *);
 void io_subchannel_irq (struct device *);
+static int io_subchannel_notify(struct device *, int);
+static void io_subchannel_verify(struct device *);
+static void io_subchannel_ioterm(struct device *);
 
-static struct css_driver io_subchannel_driver = {
+struct css_driver io_subchannel_driver = {
 	.subchannel_type = SUBCHANNEL_TYPE_IO,
 	.drv = {
 		.name = "io_subchannel",
 		.bus  = &css_bus_type,
 		.probe = &io_subchannel_probe,
+		.remove = &io_subchannel_remove,
 	},
 	.irq = io_subchannel_irq,
+	.notify = io_subchannel_notify,
+	.verify = io_subchannel_verify,
+	.termination = io_subchannel_ioterm,
 };
 
 struct workqueue_struct *ccw_device_work;
@@ -232,41 +240,58 @@
 	return sprintf(buf, cdev->online ? "1\n" : "0\n");
 }
 
-void
+int
 ccw_device_set_offline(struct ccw_device *cdev)
 {
 	int ret;
 
 	if (!cdev)
-		return;
+		return -ENODEV;
 	if (!cdev->online || !cdev->drv)
-		return;
-
-	if (cdev->drv->set_offline)
-		if (cdev->drv->set_offline(cdev) != 0)
-			return;
+		return -EINVAL;
 
+	if (cdev->private->state == DEV_STATE_DISCONNECTED) {
+		struct subchannel *sch;
+		/* 
+		 * Forced offline in disconnected state means 
+		 * 'throw away device'.
+		 */
+		sch = to_subchannel(cdev->dev.parent);
+		device_unregister(&sch->dev);
+		/* Reset intparm to zeroes. */
+		sch->schib.pmcw.intparm = 0;
+		cio_modify(sch);
+		put_device(&sch->dev);
+		return 0;
+	}
+	if (cdev->drv->set_offline) {
+		ret = cdev->drv->set_offline(cdev);
+		if (ret != 0)
+			return ret;
+	}
 	cdev->online = 0;
 	spin_lock_irq(cdev->ccwlock);
 	ret = ccw_device_offline(cdev);
 	spin_unlock_irq(cdev->ccwlock);
 	if (ret == 0)
 		wait_event(cdev->private->wait_q, dev_fsm_final_state(cdev));
-	else
-		//FIXME: we can't fail!
+	else {
 		pr_debug("ccw_device_offline returned %d, device %s\n",
 			 ret, cdev->dev.bus_id);
+		cdev->online = 1;
+	}
+	return ret;
 }
 
-void
+int
 ccw_device_set_online(struct ccw_device *cdev)
 {
 	int ret;
 
 	if (!cdev)
-		return;
+		return -ENODEV;
 	if (cdev->online || !cdev->drv)
-		return;
+		return -EINVAL;
 
 	spin_lock_irq(cdev->ccwlock);
 	ret = ccw_device_online(cdev);
@@ -276,13 +301,13 @@
 	else {
 		pr_debug("ccw_device_online returned %d, device %s\n",
 			 ret, cdev->dev.bus_id);
-		return;
+		return ret;
 	}
 	if (cdev->private->state != DEV_STATE_ONLINE)
-		return;
+		return -ENODEV;
 	if (!cdev->drv->set_online || cdev->drv->set_online(cdev) == 0) {
 		cdev->online = 1;
-		return;
+		return 0;
 	}
 	spin_lock_irq(cdev->ccwlock);
 	ret = ccw_device_offline(cdev);
@@ -292,6 +317,7 @@
 	else 
 		pr_debug("ccw_device_offline returned %d, device %s\n",
 			 ret, cdev->dev.bus_id);
+	return (ret = 0) ? -ENODEV : ret;
 }
 
 static ssize_t
@@ -340,7 +366,7 @@
 		  ccw_device_unbox_recog, (void *) cdev);
 	queue_work(ccw_device_work, &cdev->private->kick_work);
 	
-	return 0;
+	return count;
 }
 
 static DEVICE_ATTR(chpids, 0444, chpids_show, NULL);
@@ -430,7 +456,7 @@
 
 /* this is a simple abstraction for device_register that sets the
  * correct bus type and adds the bus specific files */
-static int
+int
 ccw_device_register(struct ccw_device *cdev)
 {
 	struct device *dev = &cdev->dev;
@@ -448,16 +474,20 @@
 }
 
 void
-ccw_device_unregister(void *data)
+ccw_device_do_unreg_rereg(void *data)
 {
 	struct device *dev;
 
 	dev = (struct device *)data;
-
 	device_remove_files(dev);
-	device_unregister(dev);
+	device_del(dev);
+	if (device_add(dev)) {
+		put_device(dev);
+		return;
+	}
+	if (device_add_files(dev))
+		device_unregister(dev);
 }
-	
 
 static void
 ccw_device_release(struct device *dev)
@@ -482,6 +512,10 @@
 	cdev = (struct ccw_device *) data;
 	sch = to_subchannel(cdev->dev.parent);
 
+	if (!list_empty(&sch->dev.children)) {
+		bus_rescan_devices(&ccw_bus_type);
+		goto out;
+	}
 	/* make it known to the system */
 	ret = ccw_device_register(cdev);
 	if (ret) {
@@ -495,8 +529,8 @@
 
 	ret = subchannel_add_files(cdev->dev.parent);
 	if (ret)
-		printk(KERN_WARNING "%s: could not add attributes to %04x\n",
-		       __func__, sch->irq);
+		printk(KERN_WARNING "%s: could not add attributes to %s\n",
+		       __func__, sch->dev.bus_id);
 	if (cdev->private->state == DEV_STATE_BOXED)
 		device_create_file(&cdev->dev, &dev_attr_steal_lock);
 out:
@@ -562,9 +596,9 @@
 	atomic_inc(&ccw_device_init_count);
 
 	/* Start async. device sensing. */
-	spin_lock_irq(cdev->ccwlock);
+	spin_lock_irq(&sch->lock);
 	rc = ccw_device_recognition(cdev);
-	spin_unlock_irq(cdev->ccwlock);
+	spin_unlock_irq(&sch->lock);
 	if (rc) {
 		if (atomic_dec_and_test(&ccw_device_init_count))
 			wake_up(&ccw_device_init_wq);
@@ -637,6 +671,60 @@
 	return 0;
 }
 
+static int
+io_subchannel_remove (struct device *dev)
+{
+	struct ccw_device *cdev;
+
+	if (!dev->driver_data)
+		return 0;
+	cdev = dev->driver_data;
+	/* Set ccw device to not operational and drop reference. */
+	dev_fsm_event(cdev, DEV_EVENT_NOTOPER);
+	put_device(&cdev->dev);
+	dev->driver_data = NULL;
+	return 0;
+}
+
+static int
+io_subchannel_notify(struct device *dev, int event)
+{
+	struct ccw_device *cdev;
+
+	cdev = dev->driver_data;
+	if (!cdev)
+		return 0;
+	if (!cdev->drv)
+		return 0;
+	if (!cdev->online)
+		return 0;
+	return cdev->drv->notify ? cdev->drv->notify(cdev, event) : 0;
+}
+
+static void
+io_subchannel_verify(struct device *dev)
+{
+	struct ccw_device *cdev;
+
+	cdev = dev->driver_data;
+	if (cdev)
+		dev_fsm_event(cdev, DEV_EVENT_VERIFY);
+}
+
+static void
+io_subchannel_ioterm(struct device *dev)
+{
+	struct ccw_device *cdev;
+
+	cdev = dev->driver_data;
+	if (!cdev)
+		return;
+	cdev->private->state = DEV_STATE_CLEAR_VERIFY;
+	if (cdev->handler)
+		cdev->handler(cdev, cdev->private->intparm,
+			      ERR_PTR(-EIO));
+}
+
 #ifdef CONFIG_CCW_CONSOLE
 static struct ccw_device console_cdev;
 static struct ccw_device_private console_private;
@@ -652,25 +740,28 @@
 		.parent = &sch->dev,
 	};
 	/* Initialize the subchannel structure */
-	sch->dev = (struct device) {
-		.parent = &css_bus_device,
-		.bus	= &css_bus_type,
-	};
+	sch->dev.parent = &css_bus_device;
+	sch->dev.bus = &css_bus_type;
 
 	rc = io_subchannel_recog(cdev, sch);
 	if (rc)
 		return rc;
 
 	/* Now wait for the async. recognition to come to an end. */
+	spin_lock_irq(cdev->ccwlock);
 	while (!dev_fsm_final_state(cdev))
 		wait_cons_dev();
+	rc = -EIO;
 	if (cdev->private->state != DEV_STATE_OFFLINE)
-		return -EIO;
+		goto out_unlock;
 	ccw_device_online(cdev);
 	while (!dev_fsm_final_state(cdev))
 		wait_cons_dev();
 	if (cdev->private->state != DEV_STATE_ONLINE)
-		return -EIO;
+		goto out_unlock;
+	rc = 0;
+out_unlock:
+	spin_unlock_irq(cdev->ccwlock);
 	return 0;
 }
 
@@ -767,18 +858,28 @@
 {
 	struct ccw_device *cdev = to_ccwdev(dev);
 	struct ccw_driver *cdrv = cdev->drv;
+	int ret;
 
-	/*
-	 * Set device offline, so device drivers don't end up with
-	 * doubled code.
-	 * This is safe because of the checks in ccw_device_set_offline.
-	 */
 	pr_debug("removing device %s, sch %d, devno %x\n",
-		 cdev->dev.name,
+		 cdev->dev.bus_id,
 		 cdev->private->irq,
 		 cdev->private->devno);
-	ccw_device_set_offline(cdev);
-	return cdrv->remove ? cdrv->remove(cdev) : 0;
+	if (cdrv->remove)
+		cdrv->remove(cdev);
+	if (cdev->online) {
+		cdev->online = 0;
+		spin_lock_irq(cdev->ccwlock);
+		ret = ccw_device_offline(cdev);
+		spin_unlock_irq(cdev->ccwlock);
+		if (ret == 0)
+			wait_event(cdev->private->wait_q,
+				   dev_fsm_final_state(cdev));
+		else
+			//FIXME: we can't fail!
+			pr_debug("ccw_device_offline returned %d, device %s\n",
+				 ret, cdev->dev.bus_id);
+	}
+	return 0;
 }
 
 int
@@ -807,3 +908,4 @@
 EXPORT_SYMBOL(ccw_driver_unregister);
 EXPORT_SYMBOL(get_ccwdev_by_busid);
 EXPORT_SYMBOL(ccw_bus_type);
+EXPORT_SYMBOL(ccw_device_work);
diff -Nru a/drivers/s390/cio/device.h b/drivers/s390/cio/device.h
--- a/drivers/s390/cio/device.h	Tue Feb  3 19:45:37 2004
+++ b/drivers/s390/cio/device.h	Tue Feb  3 19:45:37 2004
@@ -17,6 +17,10 @@
 	/* states to wait for i/o completion before doing something */
 	DEV_STATE_CLEAR_VERIFY,
 	DEV_STATE_TIMEOUT_KILL,
+	DEV_STATE_WAIT4IO,
+	/* special states for devices gone not operational */
+	DEV_STATE_DISCONNECTED,
+	DEV_STATE_DISCONNECTED_SENSE_ID,
 	/* last element! */
 	NR_DEV_STATES
 };
@@ -63,7 +67,9 @@
 
 void io_subchannel_recog_done(struct ccw_device *cdev);
 
-void ccw_device_unregister(void *);
+int ccw_device_register(struct ccw_device *);
+void ccw_device_do_unreg_rereg(void *);
+
 
 int ccw_device_recognition(struct ccw_device *);
 int ccw_device_online(struct ccw_device *);
diff -Nru a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
--- a/drivers/s390/cio/device_fsm.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/s390/cio/device_fsm.c	Tue Feb  3 19:45:28 2004
@@ -19,8 +19,44 @@
 #include "cio_debug.h"
 #include "css.h"
 #include "device.h"
+#include "ioasm.h"
 #include "qdio.h"
 
+int
+device_is_disconnected(struct subchannel *sch)
+{
+	struct ccw_device *cdev;
+
+	if (!sch->dev.driver_data)
+		return 0;
+	cdev = sch->dev.driver_data;
+	return (cdev->private->state == DEV_STATE_DISCONNECTED ||
+		cdev->private->state == DEV_STATE_DISCONNECTED_SENSE_ID);
+}
+
+void
+device_set_disconnected(struct subchannel *sch)
+{
+	struct ccw_device *cdev;
+
+	if (!sch->dev.driver_data)
+		return;
+	cdev = sch->dev.driver_data;
+	cdev->private->state = DEV_STATE_DISCONNECTED;
+}
+
+void
+device_set_waiting(struct subchannel *sch)
+{
+	struct ccw_device *cdev;
+
+	if (!sch->dev.driver_data)
+		return;
+	cdev = sch->dev.driver_data;
+	ccw_device_set_timeout(cdev, 10*HZ);
+	cdev->private->state = DEV_STATE_WAIT4IO;
+}
+
 /*
  * Timeout function. It just triggers a DEV_EVENT_TIMEOUT.
  */
@@ -60,39 +96,76 @@
  * Cancel running i/o. This is called repeatedly since halt/clear are
  * asynchronous operations. We do one try with cio_cancel, two tries
  * with cio_halt, 255 tries with cio_clear. If everythings fails panic.
+ * Returns 0 if device now idle, -ENODEV for device not operational and
+ * -EBUSY if an interrupt is expected (either from halt/clear or from a
+ * status pending).
  */
 static int
 ccw_device_cancel_halt_clear(struct ccw_device *cdev)
 {
 	struct subchannel *sch;
+	int ret;
 
 	sch = to_subchannel(cdev->dev.parent);
-	if (sch->schib.scsw.actl == 0)
+	ret = stsch(sch->irq, &sch->schib);
+	if (ret || !sch->schib.pmcw.dnv)
+		return -ENODEV; 
+	if (!sch->schib.pmcw.ena || sch->schib.scsw.actl == 0)
 		/* Not operational or no activity -> done. */
 		return 0;
 	/* Stage 1: cancel io. */
 	if (!(sch->schib.scsw.actl & SCSW_ACTL_HALT_PEND) &&
 	    !(sch->schib.scsw.actl & SCSW_ACTL_CLEAR_PEND)) {
-		if (cio_cancel (sch) == 0)
-			return 0;
+		ret = cio_cancel(sch);
+		if (ret != -EINVAL)
+			return ret;
 		/* cancel io unsuccessful. From now on it is asynchronous. */
 		cdev->private->iretry = 3;	/* 3 halt retries. */
 	}
 	if (!(sch->schib.scsw.actl & SCSW_ACTL_CLEAR_PEND)) {
 		/* Stage 2: halt io. */
-		while (cdev->private->iretry-- > 0)
-			if (cio_halt (sch) == 0)
-				return -EBUSY;
+		if (cdev->private->iretry) {
+			cdev->private->iretry--;
+			ret = cio_halt(sch);
+			return (ret == 0) ? -EBUSY : ret;
+		}
 		/* halt io unsuccessful. */
 		cdev->private->iretry = 255;	/* 255 clear retries. */
 	}
 	/* Stage 3: clear io. */
-	while (cdev->private->iretry-- > 0)
-		if (cio_clear (sch) == 0)
-			return -EBUSY;
+	if (cdev->private->iretry) {
+		cdev->private->iretry--;
+		ret = cio_clear (sch);
+		return (ret == 0) ? -EBUSY : ret;
+	}
 	panic("Can't stop i/o on subchannel.\n");
 }
 
+static void
+ccw_device_handle_oper(struct ccw_device *cdev)
+{
+	struct subchannel *sch;
+
+	sch = to_subchannel(cdev->dev.parent);
+	/*
+	 * Check if cu type and device type still match. If
+	 * not, it is certainly another device and we have to
+	 * de- and re-register.
+	 */
+	if (cdev->id.cu_type != cdev->private->senseid.cu_type ||
+	    cdev->id.cu_model != cdev->private->senseid.cu_model ||
+	    cdev->id.dev_type != cdev->private->senseid.dev_type ||
+	    cdev->id.dev_model != cdev->private->senseid.dev_model) {
+		PREPARE_WORK(&cdev->private->kick_work,
+			     ccw_device_do_unreg_rereg, (void *)&cdev->dev);
+		queue_work(ccw_device_work, &cdev->private->kick_work);
+		return;
+	}
+	cdev->private->flags.donotify = 1;
+	/* Get device online again. */
+	ccw_device_online(cdev);
+}
+
 /*
  * Stop device recognition.
  */
@@ -100,41 +173,54 @@
 ccw_device_recog_done(struct ccw_device *cdev, int state)
 {
 	struct subchannel *sch;
+	int notify;
 
 	sch = to_subchannel(cdev->dev.parent);
 
 	ccw_device_set_timeout(cdev, 0);
 	cio_disable_subchannel(sch);
-	cdev->private->state = state;
-
+	if (cdev->private->state == DEV_STATE_DISCONNECTED_SENSE_ID) {
+		if (state == DEV_STATE_NOT_OPER) {
+			cdev->private->state = DEV_STATE_DISCONNECTED;
+			return;
+		}
+		/* Boxed devices don't need extra treatment. */
+	}
+	notify = 0;
 	switch (state) {
 	case DEV_STATE_NOT_OPER:
 		CIO_DEBUG(KERN_WARNING, 2,
-			  "SenseID : unknown device %04X on subchannel %04X\n",
-			  sch->schib.pmcw.dev, sch->irq);
+			  "SenseID : unknown device %s on subchannel %s\n",
+			  cdev->dev.bus_id, sch->dev.bus_id);
 		break;
 	case DEV_STATE_OFFLINE:
-		/* fill out sense information */
-		cdev->id = (struct ccw_device_id) {
-			.cu_type   = cdev->private->senseid.cu_type,
-			.cu_model  = cdev->private->senseid.cu_model,
-			.dev_type  = cdev->private->senseid.dev_type,
-			.dev_model = cdev->private->senseid.dev_model,
-		};
+		if (cdev->private->state == DEV_STATE_DISCONNECTED_SENSE_ID)
+			notify = 1;
+		else  /* fill out sense information */
+			cdev->id = (struct ccw_device_id) {
+				.cu_type   = cdev->private->senseid.cu_type,
+				.cu_model  = cdev->private->senseid.cu_model,
+				.dev_type  = cdev->private->senseid.dev_type,
+				.dev_model = cdev->private->senseid.dev_model,
+			};
 		/* Issue device info message. */
-		CIO_DEBUG(KERN_INFO, 2, "SenseID : device %04X reports: "
+		CIO_DEBUG(KERN_INFO, 2, "SenseID : device %s reports: "
 			  "CU  Type/Mod = %04X/%02X, Dev Type/Mod = "
-			  "%04X/%02X\n", sch->schib.pmcw.dev,
+			  "%04X/%02X\n", cdev->dev.bus_id,
 			  cdev->id.cu_type, cdev->id.cu_model,
 			  cdev->id.dev_type, cdev->id.dev_model);
 		break;
 	case DEV_STATE_BOXED:
 		CIO_DEBUG(KERN_WARNING, 2,
-			  "SenseID : boxed device %04X on subchannel %04X\n",
-			  sch->schib.pmcw.dev, sch->irq);
+			  "SenseID : boxed device %s on subchannel %s\n",
+			  cdev->dev.bus_id, sch->dev.bus_id);
 		break;
 	}
-	io_subchannel_recog_done(cdev);
+	cdev->private->state = state;
+	if (notify && state == DEV_STATE_OFFLINE)
+		ccw_device_handle_oper(cdev);
+	else
+		io_subchannel_recog_done(cdev);
 	if (state != DEV_STATE_NOT_OPER)
 		wake_up(&cdev->private->wait_q);
 }
@@ -158,6 +244,24 @@
 	}
 }
 
+static void
+ccw_device_oper_notify(void *data)
+{
+	struct ccw_device *cdev;
+	struct subchannel *sch;
+	int ret;
+
+	cdev = (struct ccw_device *)data;
+	sch = to_subchannel(cdev->dev.parent);
+	ret = (sch->driver && sch->driver->notify) ?
+		sch->driver->notify(&sch->dev, CIO_OPER) : 0;
+	if (!ret)
+		/* Driver doesn't want device back. */
+		ccw_device_do_unreg_rereg((void *)&cdev->dev);
+	else
+		wake_up(&cdev->private->wait_q);
+}
+
 /*
  * Finished with online/offline processing.
  */
@@ -179,13 +283,19 @@
 
 	if (state == DEV_STATE_BOXED) {
 		CIO_DEBUG(KERN_WARNING, 2,
-			  "Boxed device %04X on subchannel %04X\n",
-			  sch->schib.pmcw.dev, sch->irq);
+			  "Boxed device %s on subchannel %s\n",
+			  cdev->dev.bus_id, sch->dev.bus_id);
 		INIT_WORK(&cdev->private->kick_work,
 			  ccw_device_add_stlck, (void *) cdev);
 		queue_work(ccw_device_work, &cdev->private->kick_work);
 	}
 
+	if (cdev->private->flags.donotify) {
+		cdev->private->flags.donotify = 0;
+		PREPARE_WORK(&cdev->private->kick_work, ccw_device_oper_notify,
+			     (void *)cdev);
+		queue_work(ccw_device_work, &cdev->private->kick_work);
+	}
 	wake_up(&cdev->private->wait_q);
 
 	if (css_init_done && state != DEV_STATE_ONLINE)
@@ -229,13 +339,15 @@
 ccw_device_recognition(struct ccw_device *cdev)
 {
 	struct subchannel *sch;
+	int ret;
 
 	if (cdev->private->state != DEV_STATE_NOT_OPER)
 		return -EINVAL;
 	sch = to_subchannel(cdev->dev.parent);
-	if (cio_enable_subchannel(sch, sch->schib.pmcw.isc) != 0)
+	ret = cio_enable_subchannel(sch, sch->schib.pmcw.isc);
+	if (ret != 0)
 		/* Couldn't enable the subchannel for i/o. Sick device. */
-		return -ENODEV;
+		return ret;
 
 	/* After 60s the device recognition is considered to have failed. */
 	ccw_device_set_timeout(cdev, 60*HZ);
@@ -259,10 +371,19 @@
 static void
 ccw_device_recog_timeout(struct ccw_device *cdev, enum dev_event dev_event)
 {
-	if (ccw_device_cancel_halt_clear(cdev) == 0)
+	int ret;
+
+	ret = ccw_device_cancel_halt_clear(cdev);
+	switch (ret) {
+	case 0:
 		ccw_device_recog_done(cdev, DEV_STATE_BOXED);
-	else
+		break;
+	case -ENODEV:
+		ccw_device_recog_done(cdev, DEV_STATE_NOT_OPER);
+		break;
+	default:
 		ccw_device_set_timeout(cdev, 3*HZ);
+	}
 }
 
 
@@ -290,16 +411,19 @@
 ccw_device_online(struct ccw_device *cdev)
 {
 	struct subchannel *sch;
+	int ret;
 
 	if (cdev->private->state != DEV_STATE_OFFLINE)
 		return -EINVAL;
 	sch = to_subchannel(cdev->dev.parent);
 	if (css_init_done && !get_device(&cdev->dev))
 		return -ENODEV;
-	if (cio_enable_subchannel(sch, sch->schib.pmcw.isc) != 0) {
+	ret = cio_enable_subchannel(sch, sch->schib.pmcw.isc);
+	if (ret != 0) {
 		/* Couldn't enable the subchannel for i/o. Sick device. */
-		dev_fsm_event(cdev, DEV_EVENT_NOTOPER);
-		return -ENODEV;
+		if (ret == -ENODEV)
+			dev_fsm_event(cdev, DEV_EVENT_NOTOPER);
+		return ret;
 	}
 	/* Do we want to do path grouping? */
 	if (!cdev->private->options.pgroup) {
@@ -363,10 +487,19 @@
 static void
 ccw_device_onoff_timeout(struct ccw_device *cdev, enum dev_event dev_event)
 {
-	if (ccw_device_cancel_halt_clear(cdev) == 0)
+	int ret;
+
+	ret = ccw_device_cancel_halt_clear(cdev);
+	switch (ret) {
+	case 0:
 		ccw_device_done(cdev, DEV_STATE_BOXED);
-	else
+		break;
+	case -ENODEV:
+		ccw_device_done(cdev, DEV_STATE_NOT_OPER);
+		break;
+	default:
 		ccw_device_set_timeout(cdev, 3*HZ);
+	}
 }
 
 /*
@@ -375,7 +508,10 @@
 static void
 ccw_device_recog_notoper(struct ccw_device *cdev, enum dev_event dev_event)
 {
-	ccw_device_recog_done(cdev, DEV_STATE_NOT_OPER);
+	if (cdev->private->state == DEV_STATE_DISCONNECTED_SENSE_ID)
+		cdev->private->state = DEV_STATE_DISCONNECTED;
+	else
+		ccw_device_recog_done(cdev, DEV_STATE_NOT_OPER);
 }
 
 /*
@@ -385,9 +521,7 @@
 ccw_device_offline_notoper(struct ccw_device *cdev, enum dev_event dev_event)
 {
 	cdev->private->state = DEV_STATE_NOT_OPER;
-	INIT_WORK(&cdev->private->kick_work,
-		  ccw_device_unregister, (void *) &cdev->dev);
-	queue_work(ccw_device_work, &cdev->private->kick_work);
+	device_unregister(&cdev->dev);
 	wake_up(&cdev->private->wait_q);
 }
 
@@ -406,9 +540,20 @@
 		// FIXME: not-oper indication to device driver ?
 		ccw_device_call_handler(cdev);
 	}
-	INIT_WORK(&cdev->private->kick_work,
-		  ccw_device_unregister, (void *) &cdev->dev);
-	queue_work(ccw_device_work, &cdev->private->kick_work);
+	device_unregister(&cdev->dev);
+	wake_up(&cdev->private->wait_q);
+}
+
+static void
+ccw_device_disconnected_notoper(struct ccw_device *cdev,
+				enum dev_event dev_event)
+{
+	struct subchannel *sch;
+
+	sch = to_subchannel(cdev->dev.parent);
+	cdev->private->state = DEV_STATE_NOT_OPER;
+	cio_disable_subchannel(sch);
+	device_unregister(&cdev->dev);
 	wake_up(&cdev->private->wait_q);
 }
 
@@ -478,13 +623,18 @@
 static void
 ccw_device_online_timeout(struct ccw_device *cdev, enum dev_event dev_event)
 {
+	int ret;
+
 	ccw_device_set_timeout(cdev, 0);
-	if (ccw_device_cancel_halt_clear(cdev) != 0) {
+	ret = ccw_device_cancel_halt_clear(cdev);
+	if (ret == -EBUSY) {
 		ccw_device_set_timeout(cdev, 3*HZ);
 		cdev->private->state = DEV_STATE_TIMEOUT_KILL;
 		return;
 	}
-	if (cdev->handler)
+	if (ret == -ENODEV)
+		dev_fsm_event(cdev, DEV_EVENT_NOTOPER);
+	else if (cdev->handler)
 		cdev->handler(cdev, cdev->private->intparm,
 			      ERR_PTR(-ETIMEDOUT));
 }
@@ -552,10 +702,17 @@
 static void
 ccw_device_killing_timeout(struct ccw_device *cdev, enum dev_event dev_event)
 {
-	if (ccw_device_cancel_halt_clear(cdev) != 0) {
+	int ret;
+
+	ret = ccw_device_cancel_halt_clear(cdev);
+	if (ret == -EBUSY) {
 		ccw_device_set_timeout(cdev, 3*HZ);
 		return;
 	}
+	if (ret == -ENODEV) {
+		dev_fsm_event(cdev, DEV_EVENT_NOTOPER);
+		return;
+	}
 	//FIXME: Can we get here?
 	cdev->private->state = DEV_STATE_ONLINE;
 	if (cdev->handler)
@@ -564,6 +721,68 @@
 }
 
 static void
+ccw_device_wait4io_irq(struct ccw_device *cdev, enum dev_event dev_event)
+{
+	struct irb *irb;
+	struct subchannel *sch;
+
+	irb = (struct irb *) __LC_IRB;
+	/* Check for unsolicited interrupt. */
+	if (irb->scsw.stctl ==
+	    		(SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
+		if (cdev->handler)
+			cdev->handler (cdev, 0, irb);
+		return;
+	}
+	/*
+	 * Accumulate status and find out if a basic sense is needed.
+	 * This is fine since we have already adapted the lpm.
+	 */
+	ccw_device_accumulate_irb(cdev, irb);
+	if (cdev->private->flags.dosense) {
+		if (ccw_device_do_sense(cdev, irb) == 0) {
+			cdev->private->state = DEV_STATE_W4SENSE;
+		}
+		return;
+	}
+	/* Iff device is idle, reset timeout. */
+	sch = to_subchannel(cdev->dev.parent);
+	if (!stsch(sch->irq, &sch->schib))
+		if (sch->schib.scsw.actl == 0)
+			ccw_device_set_timeout(cdev, 0);
+	/* Call the handler. */
+	if (ccw_device_call_handler(cdev) && cdev->private->flags.doverify)
+		ccw_device_online_verify(cdev, 0);
+}
+
+static void
+ccw_device_wait4io_timeout(struct ccw_device *cdev, enum dev_event dev_event)
+{
+	int ret;
+
+	ccw_device_set_timeout(cdev, 0);
+	ret = ccw_device_cancel_halt_clear(cdev);
+	if (ret == -EBUSY) {
+		ccw_device_set_timeout(cdev, 3*HZ);
+		cdev->private->state = DEV_STATE_TIMEOUT_KILL;
+		return;
+	}
+	if (ret == -ENODEV)
+		dev_fsm_event(cdev, DEV_EVENT_NOTOPER);
+	else if (cdev->handler)
+		cdev->handler(cdev, cdev->private->intparm,
+			      ERR_PTR(-ETIMEDOUT));
+}
+
+static void
+ccw_device_wait4io_verify(struct ccw_device *cdev, enum dev_event dev_event)
+{
+	/* When the I/O has terminated, we have to start verification. */
+	if (cdev->private->options.pgroup)
+		cdev->private->flags.doverify = 1;
+}
+
+static void
 ccw_device_stlck_done(struct ccw_device *cdev, enum dev_event dev_event)
 {
 	struct irb *irb;
@@ -586,6 +805,59 @@
 	wake_up(&cdev->private->wait_q);
 }
 
+static void
+ccw_device_start_id(struct ccw_device *cdev, enum dev_event dev_event)
+{
+	struct subchannel *sch;
+
+	sch = to_subchannel(cdev->dev.parent);
+	if (cio_enable_subchannel(sch, sch->schib.pmcw.isc) != 0)
+		/* Couldn't enable the subchannel for i/o. Sick device. */
+		return;
+
+	/* After 60s the device recognition is considered to have failed. */
+	ccw_device_set_timeout(cdev, 60*HZ);
+
+	cdev->private->state = DEV_STATE_DISCONNECTED_SENSE_ID;
+	ccw_device_sense_id_start(cdev);
+}
+
+void
+device_trigger_reprobe(struct subchannel *sch)
+{
+	struct ccw_device *cdev;
+	unsigned long flags;
+
+	if (!sch->dev.driver_data)
+		return;
+	cdev = sch->dev.driver_data;
+	if (cdev->private->state != DEV_STATE_DISCONNECTED)
+		return;
+	spin_lock_irqsave(&sch->lock, flags);
+	/* Re-set some bits in the pmcw that were lost. */
+	sch->schib.pmcw.isc = 3;
+	sch->schib.pmcw.csense = 1;
+	sch->schib.pmcw.ena = 0;
+	if ((sch->lpm & (sch->lpm - 1)) != 0)
+		sch->schib.pmcw.mp = 1;
+	sch->schib.pmcw.intparm = (__u32)(unsigned long)sch;
+	ccw_device_start_id(cdev, 0);
+	spin_unlock_irqrestore(&sch->lock, flags);
+}
+
+static void
+ccw_device_offline_irq(struct ccw_device *cdev, enum dev_event dev_event)
+{
+	struct subchannel *sch;
+
+	sch = to_subchannel(cdev->dev.parent);
+	/*
+	 * An interrupt in state offline means a previous disable was not
+	 * successful. Try again.
+	 */
+	cio_disable_subchannel(sch);
+}
+
 /*
  * No operation action. This is used e.g. to ignore a timeout event in
  * state offline.
@@ -630,7 +902,7 @@
 	},
 	[DEV_STATE_OFFLINE] {
 		[DEV_EVENT_NOTOPER]	ccw_device_offline_notoper,
-		[DEV_EVENT_INTERRUPT]	ccw_device_bug,
+		[DEV_EVENT_INTERRUPT]	ccw_device_offline_irq,
 		[DEV_EVENT_TIMEOUT]	ccw_device_nop,
 		[DEV_EVENT_VERIFY]	ccw_device_nop,
 	},
@@ -677,6 +949,25 @@
 		[DEV_EVENT_TIMEOUT]	ccw_device_killing_timeout,
 		[DEV_EVENT_VERIFY]	ccw_device_nop, //FIXME
 	},
+	[DEV_STATE_WAIT4IO] {
+		[DEV_EVENT_NOTOPER]	ccw_device_online_notoper,
+		[DEV_EVENT_INTERRUPT]	ccw_device_wait4io_irq,
+		[DEV_EVENT_TIMEOUT]	ccw_device_wait4io_timeout,
+		[DEV_EVENT_VERIFY]	ccw_device_wait4io_verify,
+	},
+	/* special states for devices gone not operational */
+	[DEV_STATE_DISCONNECTED] {
+		[DEV_EVENT_NOTOPER]	ccw_device_disconnected_notoper,
+		[DEV_EVENT_INTERRUPT]	ccw_device_start_id,
+		[DEV_EVENT_TIMEOUT]	ccw_device_bug,
+		[DEV_EVENT_VERIFY]	ccw_device_nop,
+	},
+	[DEV_STATE_DISCONNECTED_SENSE_ID] {
+		[DEV_EVENT_NOTOPER]	ccw_device_recog_notoper,
+		[DEV_EVENT_INTERRUPT]	ccw_device_sense_id_irq,
+		[DEV_EVENT_TIMEOUT]	ccw_device_recog_timeout,
+		[DEV_EVENT_VERIFY]	ccw_device_nop,
+	},
 };
 
 /*
@@ -686,13 +977,12 @@
 void
 io_subchannel_irq (struct device *pdev)
 {
-	char dbf_txt[15];
 	struct ccw_device *cdev;
 
 	cdev = to_subchannel(pdev)->dev.driver_data;
 
-	sprintf (dbf_txt, "IRQ%04x", cdev->private->irq);
-	CIO_TRACE_EVENT (3, dbf_txt);
+	CIO_TRACE_EVENT (3, "IRQ");
+	CIO_TRACE_EVENT (3, pdev->bus_id);
 
 	dev_fsm_event(cdev, DEV_EVENT_INTERRUPT);
 }
diff -Nru a/drivers/s390/cio/device_id.c b/drivers/s390/cio/device_id.c
--- a/drivers/s390/cio/device_id.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/s390/cio/device_id.c	Tue Feb  3 19:45:16 2004
@@ -22,6 +22,7 @@
 #include "cio_debug.h"
 #include "css.h"
 #include "device.h"
+#include "ioasm.h"
 
 /*
  * diag210 is used under VM to get information about a virtual device
@@ -195,15 +196,11 @@
 	ret = -ENODEV;
 	while (cdev->private->imask != 0) {
 		if ((sch->lpm & cdev->private->imask) != 0 &&
-		    cdev->private->iretry-- > 0) {
-			/* 0x00E2C9C4 == ebcdic "SID" */
+		    cdev->private->iretry > 0) {
+			cdev->private->iretry--;
 			ret = cio_start (sch, cdev->private->iccws,
-					 0x00E2C9C4, cdev->private->imask);
+					 cdev->private->imask);
 			/* ret is 0, -EBUSY, -EACCES or -ENODEV */
-			if (ret == -EBUSY) {
-				udelay(100);
-				continue;
-			}
 			if (ret != -EACCES)
 				return ret;
 		}
@@ -223,7 +220,7 @@
 	cdev->private->imask = 0x80;
 	cdev->private->iretry = 5;
 	ret = __ccw_device_sense_id_start(cdev);
-	if (ret)
+	if (ret && ret != -EBUSY)
 		ccw_device_sense_id_done(cdev, ret);
 }
 
@@ -255,16 +252,16 @@
 		 * if the device doesn't support the SenseID
 		 *  command further retries wouldn't help ...
 		 */
-		CIO_MSG_EVENT(2, "SenseID : device %04X on Subchannel %04X "
+		CIO_MSG_EVENT(2, "SenseID : device %s on Subchannel %s "
 			      "reports cmd reject or intervention required\n",
-			      sch->schib.pmcw.dev, sch->irq);
+			      cdev->dev.bus_id, sch->dev.bus_id);
 		return -EOPNOTSUPP;
 	}
 	if (irb->esw.esw0.erw.cons) {
-		CIO_MSG_EVENT(2, "SenseID : UC on dev %04X, "
+		CIO_MSG_EVENT(2, "SenseID : UC on dev %s, "
 			      "lpum %02X, cnt %02d, sns :"
 			      " %02X%02X%02X%02X %02X%02X%02X%02X ...\n",
-			      sch->schib.pmcw.dev,
+			      cdev->dev.bus_id,
 			      irb->esw.esw0.sublog.lpum,
 			      irb->esw.esw0.erw.scnt,
 			      irb->ecw[0], irb->ecw[1],
@@ -274,15 +271,15 @@
 		return -EAGAIN;
 	}
 	if (irb->scsw.cc == 3) {
-		CIO_MSG_EVENT(2, "SenseID : path %02X for device %04X on "
-			      "subchannel %04X is 'not operational'\n",
-			      sch->orb.lpm, sch->schib.pmcw.dev, sch->irq);
+		CIO_MSG_EVENT(2, "SenseID : path %02X for device %s on "
+			      "subchannel %s is 'not operational'\n",
+			      sch->orb.lpm, cdev->dev.bus_id, sch->dev.bus_id);
 		return -EACCES;
 	}
 	/* Hmm, whatever happened, try again. */
-	CIO_MSG_EVENT(2, "SenseID : start_IO() for device %04X on "
-		      "subchannel %04X returns status %02X%02X\n",
-		      sch->schib.pmcw.dev, sch->irq,
+	CIO_MSG_EVENT(2, "SenseID : start_IO() for device %s on "
+		      "subchannel %s returns status %02X%02X\n",
+		      cdev->dev.bus_id, sch->dev.bus_id,
 		      irb->scsw.dstat, irb->scsw.cstat);
 	return -EAGAIN;
 }
@@ -299,11 +296,17 @@
 
 	sch = to_subchannel(cdev->dev.parent);
 	irb = (struct irb *) __LC_IRB;
-	/* Ignore unsolicited interrupts. */
+	/*
+	 * Unsolicited interrupts may pertain to an earlier status pending or
+	 * busy condition on the subchannel. Retry sense id.
+	 */
 	if (irb->scsw.stctl ==
-	    		(SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS))
+	    (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
+		ret = __ccw_device_sense_id_start(cdev);
+		if (ret && ret != -EBUSY)
+			ccw_device_sense_id_done(cdev, ret);
 		return;
-
+	}
 	if (ccw_device_accumulate_and_sense(cdev, irb) != 0)
 		return;
 	ret = ccw_device_check_sense_id(cdev);
diff -Nru a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c
--- a/drivers/s390/cio/device_ops.c	Tue Feb  3 19:45:35 2004
+++ b/drivers/s390/cio/device_ops.c	Tue Feb  3 19:45:35 2004
@@ -49,6 +49,8 @@
 
 	if (!cdev)
 		return -ENODEV;
+	if (cdev->private->state == DEV_STATE_NOT_OPER)
+		return -ENODEV;
 	if (cdev->private->state != DEV_STATE_ONLINE &&
 	    cdev->private->state != DEV_STATE_W4SENSE)
 		return -EINVAL;
@@ -73,6 +75,8 @@
 	sch = to_subchannel(cdev->dev.parent);
 	if (!sch)
 		return -ENODEV;
+	if (cdev->private->state == DEV_STATE_NOT_OPER)
+		return -ENODEV;
 	if (cdev->private->state != DEV_STATE_ONLINE ||
 	    sch->schib.scsw.actl != 0 ||
 	    cdev->private->flags.doverify)
@@ -80,8 +84,7 @@
 	ret = cio_set_options (sch, flags);
 	if (ret)
 		return ret;
-	/* 0xe4e2c5d9 == ebcdic "USER" */
-	ret = cio_start (sch, cpa, 0xe4e2c5d9, lpm);
+	ret = cio_start (sch, cpa, lpm);
 	if (ret == 0)
 		cdev->private->intparm = intparm;
 	return ret;
@@ -111,6 +114,8 @@
 
 	if (!cdev)
 		return -ENODEV;
+	if (cdev->private->state == DEV_STATE_NOT_OPER)
+		return -ENODEV;
 	if (cdev->private->state != DEV_STATE_ONLINE &&
 	    cdev->private->state != DEV_STATE_W4SENSE)
 		return -EINVAL;
@@ -133,6 +138,8 @@
 	sch = to_subchannel(cdev->dev.parent);
 	if (!sch)
 		return -ENODEV;
+	if (cdev->private->state == DEV_STATE_NOT_OPER)
+		return -ENODEV;
 	if (cdev->private->state != DEV_STATE_ONLINE ||
 	    !(sch->schib.scsw.actl & SCSW_ACTL_SUSPENDED))
 		return -EINVAL;
@@ -251,7 +258,7 @@
 
 	sch = to_subchannel(cdev->dev.parent);
 	do {
-		ret = cio_start (sch, ccw, magic, 0);
+		ret = cio_start (sch, ccw, 0);
 		if ((ret == -EBUSY) || (ret == -EACCES)) {
 			/* Try again later. */
 			spin_unlock_irq(&sch->lock);
@@ -302,7 +309,6 @@
 read_dev_chars (struct ccw_device *cdev, void **buffer, int length)
 {
 	void (*handler)(struct ccw_device *, unsigned long, struct irb *);
-	char dbf_txt[15];
 	struct subchannel *sch;
 	int ret;
 	struct ccw1 *rdc_ccw;
@@ -313,8 +319,8 @@
 		return -EINVAL;
 	sch = to_subchannel(cdev->dev.parent);
 
-	sprintf (dbf_txt, "rddevch%x", sch->irq);
-	CIO_TRACE_EVENT (4, dbf_txt);
+	CIO_TRACE_EVENT (4, "rddevch");
+	CIO_TRACE_EVENT (4, sch->dev.bus_id);
 
 	rdc_ccw = kmalloc(sizeof(struct ccw1), GFP_KERNEL | GFP_DMA);
 	if (!rdc_ccw)
@@ -359,7 +365,6 @@
 read_conf_data (struct ccw_device *cdev, void **buffer, int *length)
 {
 	void (*handler)(struct ccw_device *, unsigned long, struct irb *);
-	char dbf_txt[15];
 	struct subchannel *sch;
 	struct ciw *ciw;
 	char *rcd_buf;
@@ -372,8 +377,8 @@
 		return -EINVAL;
 	sch = to_subchannel(cdev->dev.parent);
 
-	sprintf (dbf_txt, "rdconf%x", sch->irq);
-	CIO_TRACE_EVENT (4, dbf_txt);
+	CIO_TRACE_EVENT (4, "rdconf");
+	CIO_TRACE_EVENT (4, sch->dev.bus_id);
 
 	/*
 	 * scan for RCD command in extended SenseID data
@@ -449,21 +454,25 @@
 	CIO_TRACE_EVENT(2, "stl lock");
 	CIO_TRACE_EVENT(2, cdev->dev.bus_id);
 
+	spin_lock_irqsave(&sch->lock, flags);
+	ret = cio_enable_subchannel(sch, 3);
+	if (ret)
+		goto out_unlock;
 	/* Setup ccw. This cmd code seems not to be in use elsewhere. */
 	cdev->private->iccws[0].cmd_code = CCW_CMD_STLCK;
 	cdev->private->iccws[0].cda = (__u32) __pa(buf);
 	cdev->private->iccws[0].count = 32;
 	cdev->private->iccws[0].flags = CCW_FLAG_SLI;
 
-	spin_lock_irqsave(&sch->lock, flags);
-	ret = cio_start(sch, cdev->private->iccws, 0xE2D3C3D2, 0);
+	ret = cio_start(sch, cdev->private->iccws, 0);
+	if (ret) {
+		cio_disable_subchannel(sch); //FIXME: return code?
+		goto out_unlock;
+	}
 	spin_unlock_irqrestore(&sch->lock, flags);
-	if (ret)
-		return ret;
-
-	wait_event(cdev->private->wait_q, sch->schib.scsw.actl == 0);
+	wait_event(cdev->private->wait_q, cdev->private->irb.scsw.actl == 0);
 	spin_lock_irqsave(&sch->lock, flags);
-
+	cio_disable_subchannel(sch); //FIXME: return code?
 	if ((cdev->private->irb.scsw.dstat !=
 	     (DEV_STAT_CHN_END|DEV_STAT_DEV_END)) ||
 	    (cdev->private->irb.scsw.cstat != 0))
@@ -471,8 +480,8 @@
 
 	/* Clear irb. */
 	memset(&cdev->private->irb, 0, sizeof(struct irb));
+out_unlock:
 	spin_unlock_irqrestore(&sch->lock, flags);
-
 	return ret;
 }
 
diff -Nru a/drivers/s390/cio/device_pgid.c b/drivers/s390/cio/device_pgid.c
--- a/drivers/s390/cio/device_pgid.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/s390/cio/device_pgid.c	Tue Feb  3 19:45:28 2004
@@ -48,25 +48,17 @@
 	ret = -ENODEV;
 	while (cdev->private->imask != 0) {
 		/* Try every path multiple times. */
-		if (cdev->private->iretry-- > 0) {
-			/* 0xe2d5c9c4 == ebcdic "SNID" */
+		if (cdev->private->iretry > 0) {
+			cdev->private->iretry--;
 			ret = cio_start (sch, cdev->private->iccws, 
-					 0xE2D5C9C4, cdev->private->imask);
+					 cdev->private->imask);
 			/* ret is 0, -EBUSY, -EACCES or -ENODEV */
-			if (ret == -EBUSY) {
-				CIO_MSG_EVENT(2, 
-					      "SNID - device %04X, start_io() "
-					      "reports rc : %d, retrying ...\n",
-					      sch->schib.pmcw.dev, ret);
-				udelay(100);
-				continue;
-			}
 			if (ret != -EACCES)
 				return ret;
-			CIO_MSG_EVENT(2, "SNID - Device %04X on Subchannel "
-				      "%04X, lpm %02X, became 'not "
+			CIO_MSG_EVENT(2, "SNID - Device %s on Subchannel "
+				      "%s, lpm %02X, became 'not "
 				      "operational'\n",
-				      sch->schib.pmcw.dev, sch->irq,
+				      cdev->dev.bus_id, sch->dev.bus_id,
 				      cdev->private->imask);
 
 		}
@@ -86,7 +78,7 @@
 	cdev->private->iretry = 5;
 	memset (&cdev->private->pgid, 0, sizeof (struct pgid));
 	ret = __ccw_device_sense_pgid_start(cdev);
-	if (ret)
+	if (ret && ret != -EBUSY)
 		ccw_device_sense_pgid_done(cdev, ret);
 }
 
@@ -113,10 +105,10 @@
 		return -EOPNOTSUPP;
 	}
 	if (irb->esw.esw0.erw.cons) {
-		CIO_MSG_EVENT(2, "SNID - device %04X, unit check, "
+		CIO_MSG_EVENT(2, "SNID - device %s, unit check, "
 			      "lpum %02X, cnt %02d, sns : "
 			      "%02X%02X%02X%02X %02X%02X%02X%02X ...\n",
-			      sch->schib.pmcw.dev,
+			      cdev->dev.bus_id,
 			      irb->esw.esw0.sublog.lpum,
 			      irb->esw.esw0.erw.scnt,
 			      irb->ecw[0], irb->ecw[1],
@@ -126,16 +118,15 @@
 		return -EAGAIN;
 	}
 	if (irb->scsw.cc == 3) {
-		CIO_MSG_EVENT(2, "SNID - Device %04X on Subchannel "
-			      "%04X, lpm %02X, became 'not "
-			      "operational'\n",
-			      sch->schib.pmcw.dev, sch->irq, sch->orb.lpm);
+		CIO_MSG_EVENT(2, "SNID - Device %s on Subchannel "
+			      "%s, lpm %02X, became 'not operational'\n",
+			      cdev->dev.bus_id, sch->dev.bus_id, sch->orb.lpm);
 		return -EACCES;
 	}
 	if (cdev->private->pgid.inf.ps.state2 == SNID_STATE2_RESVD_ELSE) {
-		CIO_MSG_EVENT(2, "SNID - Device %04X on Subchannel %04X "
+		CIO_MSG_EVENT(2, "SNID - Device %s on Subchannel %s "
 			      "is reserved by someone else\n",
-			      sch->schib.pmcw.dev, sch->irq);
+			      cdev->dev.bus_id, sch->dev.bus_id);
 		return -EUSERS;
 	}
 	return 0;
@@ -150,34 +141,30 @@
 	struct subchannel *sch;
 	struct irb *irb;
 	int ret;
-	int opm;
-	int i;
 
 	irb = (struct irb *) __LC_IRB;
-	/* Ignore unsolicited interrupts. */
+	/*
+	 * Unsolicited interrupts may pertain to an earlier status pending or
+	 * busy condition on the subchannel. Retry sense pgid.
+	 */
 	if (irb->scsw.stctl ==
-	    		(SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS))
+	    (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
+		ret = __ccw_device_sense_pgid_start(cdev);
+		if (ret && ret != -EBUSY)
+			ccw_device_sense_pgid_done(cdev, ret);
 		return;
+	}
 	if (ccw_device_accumulate_and_sense(cdev, irb) != 0)
 		return;
 	sch = to_subchannel(cdev->dev.parent);
 	switch (__ccw_device_check_sense_pgid(cdev)) {
 	/* 0, -ETIME, -EOPNOTSUPP, -EAGAIN, -EACCES or -EUSERS */
 	case 0:			/* Sense Path Group ID successful. */
-		opm = sch->schib.pmcw.pim &
-			sch->schib.pmcw.pam &
-			sch->schib.pmcw.pom;
-		for (i=0;i<8;i++) {
-			if (opm == (0x80 << i)) {
-				/* Don't group single path devices. */
-				cdev->private->options.pgroup = 0;
-				break;
-			}
-		}
 		if (cdev->private->pgid.inf.ps.state1 == SNID_STATE1_RESET)
 			memcpy(&cdev->private->pgid, &global_pgid,
 			       sizeof(struct pgid));
-		/* fall through. */
+		ccw_device_sense_pgid_done(cdev, 0);
+		break;
 	case -EOPNOTSUPP:	/* Sense Path Group ID not supported */
 		ccw_device_sense_pgid_done(cdev, -EOPNOTSUPP);
 		break;
@@ -235,26 +222,20 @@
 
 	/* Try multiple times. */
 	ret = -ENODEV;
-	while (cdev->private->iretry-- > 0) {
-		/* 0xE2D7C9C4 == ebcdic "SPID" */
+	if (cdev->private->iretry > 0) {
+		cdev->private->iretry--;
 		ret = cio_start (sch, cdev->private->iccws,
-				 0xE2D7C9C4, cdev->private->imask);
+				 cdev->private->imask);
 		/* ret is 0, -EBUSY, -EACCES or -ENODEV */
-		if (ret == -EACCES)
-			break;
-		if (ret != -EBUSY)
+		if (ret != -EACCES)
 			return ret;
-		udelay(100);
-		continue;
 	}
 	/* PGID command failed on this path. Switch it off. */
 	sch->lpm &= ~cdev->private->imask;
 	sch->vpm &= ~cdev->private->imask;
-	CIO_MSG_EVENT(2, "SPID - Device %04X on Subchannel "
-		      "%04X, lpm %02X, became 'not "
-		      "operational'\n",
-		      sch->schib.pmcw.dev, sch->irq,
-		      cdev->private->imask);
+	CIO_MSG_EVENT(2, "SPID - Device %s on Subchannel "
+		      "%s, lpm %02X, became 'not operational'\n",
+		      cdev->dev.bus_id, sch->dev.bus_id, cdev->private->imask);
 	return ret;
 }
 
@@ -276,9 +257,9 @@
 		if (irb->ecw[0] & SNS0_CMD_REJECT)
 			return -EOPNOTSUPP;
 		/* Hmm, whatever happened, try again. */
-		CIO_MSG_EVENT(2, "SPID - device %04X, unit check, cnt %02d, "
+		CIO_MSG_EVENT(2, "SPID - device %s, unit check, cnt %02d, "
 			      "sns : %02X%02X%02X%02X %02X%02X%02X%02X ...\n",
-			      sch->schib.pmcw.dev, irb->esw.esw0.erw.scnt,
+			      cdev->dev.bus_id, irb->esw.esw0.erw.scnt,
 			      irb->ecw[0], irb->ecw[1],
 			      irb->ecw[2], irb->ecw[3],
 			      irb->ecw[4], irb->ecw[5],
@@ -286,10 +267,9 @@
 		return -EAGAIN;
 	}
 	if (irb->scsw.cc == 3) {
-		CIO_MSG_EVENT(2, "SPID - Device %04X on Subchannel "
-			      "%04X, lpm %02X, became 'not "
-			      "operational'\n",
-			      sch->schib.pmcw.dev, sch->irq,
+		CIO_MSG_EVENT(2, "SPID - Device %s on Subchannel "
+			      "%s, lpm %02X, became 'not operational'\n",
+			      cdev->dev.bus_id, sch->dev.bus_id,
 			      cdev->private->imask);
 		return -EACCES;
 	}
@@ -313,7 +293,7 @@
 		func = (sch->vpm & imask) ?
 			SPID_FUNC_RESIGN : SPID_FUNC_ESTABLISH;
 		ret = __ccw_device_do_pgid(cdev, func);
-		if (ret == 0)
+		if (ret == 0 || ret == -EBUSY)
 			return;
 		cdev->private->iretry = 5;
 	}
@@ -330,10 +310,15 @@
 	struct irb *irb;
 
 	irb = (struct irb *) __LC_IRB;
-	/* Ignore unsolicited interrupts. */
+	/*
+	 * Unsolicited interrupts may pertain to an earlier status pending or
+	 * busy condition on the subchannel. Restart path verification.
+	 */
 	if (irb->scsw.stctl ==
-	    		(SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS))
+	    (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
+		__ccw_device_verify_start(cdev);
 		return;
+	}
 	if (ccw_device_accumulate_and_sense(cdev, irb) != 0)
 		return;
 	sch = to_subchannel(cdev->dev.parent);
diff -Nru a/drivers/s390/cio/device_status.c b/drivers/s390/cio/device_status.c
--- a/drivers/s390/cio/device_status.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/cio/device_status.c	Tue Feb  3 19:45:17 2004
@@ -62,8 +62,8 @@
 	sch = to_subchannel(cdev->dev.parent);
 	stsch (sch->irq, &sch->schib);
 
-	CIO_MSG_EVENT(0, "%s(%04X) - path(s) %02x are "
-		      "not operational \n", __FUNCTION__, sch->irq,
+	CIO_MSG_EVENT(0, "%s(%s) - path(s) %02x are "
+		      "not operational \n", __FUNCTION__, sch->dev.bus_id,
 		      sch->schib.pmcw.pnom);
 
 	sch->lpm &= ~sch->schib.pmcw.pnom;
@@ -321,8 +321,7 @@
 	sch->sense_ccw.count = SENSE_MAX_COUNT;
 	sch->sense_ccw.flags = CCW_FLAG_SLI;
 
-	/* 0xe2C5D5E2 == "SENS" in ebcdic */
-	return cio_start (sch, &sch->sense_ccw, 0xE2C5D5E2, 0xff);
+	return cio_start (sch, &sch->sense_ccw, 0xff);
 }
 
 /*
diff -Nru a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c
--- a/drivers/s390/cio/qdio.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/s390/cio/qdio.c	Tue Feb  3 19:45:30 2004
@@ -56,7 +56,7 @@
 #include "ioasm.h"
 #include "chsc.h"
 
-#define VERSION_QDIO_C "$Revision: 1.62 $"
+#define VERSION_QDIO_C "$Revision: 1.67 $"
 
 /****************** MODULE PARAMETER VARIABLES ********************/
 MODULE_AUTHOR("Utz Bacher <utz.bacher@de.ibm.com>");
@@ -80,6 +80,7 @@
 static int indicator_used[INDICATORS_PER_CACHELINE];
 static __u32 * volatile indicators;
 static __u32 volatile spare_indicator;
+static atomic_t spare_indicator_usecount;
 
 static debug_info_t *qdio_dbf_setup;
 static debug_info_t *qdio_dbf_sbal;
@@ -238,7 +239,7 @@
 			indicator_used[i]=1;
 			return indicators+i;
 		}
-
+	atomic_inc(&spare_indicator_usecount);
 	return (__u32 * volatile) &spare_indicator;
 }
 
@@ -252,6 +253,8 @@
 		i=addr-indicators;
 		indicator_used[i]=0;
 	}
+	if (addr == &spare_indicator)
+		atomic_dec(&spare_indicator_usecount);
 }
 
 static inline volatile void 
@@ -622,7 +625,8 @@
 	if (q->is_iqdio_q) {
 		/* 
 		 * for asynchronous queues, we better check, if the fill
-		 * level is too high 
+		 * level is too high. for synchronous queues, the fill
+		 * level will never be that high. 
 		 */
 		if (atomic_read(&q->number_of_buffers_used)>
 		    IQDIO_FILL_LEVEL_TO_POLL)
@@ -920,7 +924,7 @@
 }
 
 static inline void
-tiqdio_inbound_processing(struct qdio_q *q)
+__tiqdio_inbound_processing(struct qdio_q *q, int spare_ind_was_set)
 {
 	struct qdio_irq *irq_ptr;
 	struct qdio_q *oq;
@@ -954,10 +958,21 @@
 		goto out;
 	}
 
-	if (!(*(q->dev_st_chg_ind)))
-		goto out;
+	/* 
+	 * we reset spare_ind_was_set, when the queue does not use the
+	 * spare indicator
+	 */
+	if (spare_ind_was_set)
+		spare_ind_was_set = (q->dev_st_chg_ind == &spare_indicator);
 
-	tiqdio_clear_summary_bit((__u32*)q->dev_st_chg_ind);
+	if (!(*(q->dev_st_chg_ind)) && !spare_ind_was_set)
+		goto out;
+	/*
+	 * q->dev_st_chg_ind is the indicator, be it shared or not.
+	 * only clear it, if indicator is non-shared
+	 */
+	if (!spare_ind_was_set)
+		tiqdio_clear_summary_bit((__u32*)q->dev_st_chg_ind);
 
 	if (q->hydra_gives_outbound_pcis) {
 		if (!q->siga_sync_done_on_thinints) {
@@ -1004,6 +1019,12 @@
 }
 
 static void
+tiqdio_inbound_processing(struct qdio_q *q)
+{
+	__tiqdio_inbound_processing(q, atomic_read(&spare_indicator_usecount));
+}
+
+static void
 qdio_inbound_processing(struct qdio_q *q)
 {
 	int q_laps=0;
@@ -1106,6 +1127,7 @@
 tiqdio_inbound_checks(void)
 {
 	struct qdio_q *q;
+	int spare_ind_was_set=0;
 #ifdef QDIO_USE_PROCESSING_STATE
 	int q_laps=0;
 #endif /* QDIO_USE_PROCESSING_STATE */
@@ -1117,11 +1139,17 @@
 again:
 #endif /* QDIO_USE_PROCESSING_STATE */
 
+	/* when the spare indicator is used and set, save that and clear it */
+	if ((atomic_read(&spare_indicator_usecount)) && spare_indicator) {
+		spare_ind_was_set = 1;
+		tiqdio_clear_summary_bit((__u32*)&spare_indicator);
+	}
+
 	q=(struct qdio_q*)tiq_list;
 	do {
 		if (!q)
 			break;
-		tiqdio_inbound_processing(q);
+		__tiqdio_inbound_processing(q, spare_ind_was_set);
 		q=(struct qdio_q*)q->list_next;
 	} while (q!=(struct qdio_q*)tiq_list);
 
@@ -1583,6 +1611,16 @@
 }
 
 static void
+qdio_call_shutdown(void *data)
+{
+	struct ccw_device *cdev;
+
+	cdev = (struct ccw_device *)data;
+	qdio_shutdown(cdev, QDIO_FLAG_CLEANUP_USING_CLEAR);
+	put_device(&cdev->dev);
+}
+
+static void
 qdio_timeout_handler(struct ccw_device *cdev)
 {
 	struct qdio_irq *irq_ptr;
@@ -1608,6 +1646,20 @@
 				irq_ptr->irq);
 		qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ERR);
 		break;
+	case QDIO_IRQ_STATE_ESTABLISHED:
+	case QDIO_IRQ_STATE_ACTIVE:
+		/* I/O has been terminated by common I/O layer. */
+		QDIO_PRINT_INFO("Queues on irq %04x killed by cio.\n",
+				irq_ptr->irq);
+		QDIO_DBF_TEXT2(1, trace, "cio:term");
+		qdio_set_state(irq_ptr, QDIO_IRQ_STATE_STOPPED);
+		if (get_device(&cdev->dev)) {
+			/* Can't call shutdown from interrupt context. */
+			PREPARE_WORK(&cdev->private->kick_work,
+				     qdio_call_shutdown, (void *)cdev);
+			queue_work(ccw_device_work, &cdev->private->kick_work);
+		}
+		break;
 	default:
 		BUG();
 	}
@@ -2098,7 +2150,7 @@
 						 !atomic_read(&irq_ptr->
 							      input_qs[i]->
 							      use_count),
-						 QDIO_NO_USE_COUNT_TIMEOUT*HZ);
+						 QDIO_NO_USE_COUNT_TIMEOUT);
 		if (atomic_read(&irq_ptr->input_qs[i]->use_count))
 			/*
 			 * FIXME:
@@ -2116,7 +2168,7 @@
 						 !atomic_read(&irq_ptr->
 							      output_qs[i]->
 							      use_count),
-						 QDIO_NO_USE_COUNT_TIMEOUT*HZ);
+						 QDIO_NO_USE_COUNT_TIMEOUT);
 		if (atomic_read(&irq_ptr->output_qs[i]->use_count))
 			/*
 			 * FIXME:
@@ -2134,23 +2186,34 @@
 	/* cleanup subchannel */
 	spin_lock_irqsave(get_ccwdev_lock(cdev),flags);
 	if (how&QDIO_FLAG_CLEANUP_USING_CLEAR) {
-		ccw_device_clear(cdev, QDIO_DOING_CLEANUP);
+		result = ccw_device_clear(cdev, QDIO_DOING_CLEANUP);
 		timeout=QDIO_CLEANUP_CLEAR_TIMEOUT;
 	} else if (how&QDIO_FLAG_CLEANUP_USING_HALT) {
-		ccw_device_halt(cdev, QDIO_DOING_CLEANUP);
+		result = ccw_device_halt(cdev, QDIO_DOING_CLEANUP);
 		timeout=QDIO_CLEANUP_HALT_TIMEOUT;
 	} else { /* default behaviour */
-		ccw_device_halt(cdev, QDIO_DOING_CLEANUP);
+		result = ccw_device_halt(cdev, QDIO_DOING_CLEANUP);
 		timeout=QDIO_CLEANUP_HALT_TIMEOUT;
 	}
-	qdio_set_state(irq_ptr, QDIO_IRQ_STATE_CLEANUP);
-	ccw_device_set_timeout(cdev, timeout);
-	spin_unlock_irqrestore(get_ccwdev_lock(cdev),flags);
-
-	wait_event(cdev->private->wait_q,
-		   irq_ptr->state == QDIO_IRQ_STATE_INACTIVE ||
-		   irq_ptr->state == QDIO_IRQ_STATE_ERR);
-
+	if (result == -ENODEV) {
+		/* No need to wait for device no longer present. */
+		qdio_set_state(irq_ptr, QDIO_IRQ_STATE_INACTIVE);
+		result = 0; /* No error. */
+		spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags);
+	} else if (result == 0) {
+		qdio_set_state(irq_ptr, QDIO_IRQ_STATE_CLEANUP);
+		ccw_device_set_timeout(cdev, timeout);
+		spin_unlock_irqrestore(get_ccwdev_lock(cdev),flags);
+
+		wait_event(cdev->private->wait_q,
+			   irq_ptr->state == QDIO_IRQ_STATE_INACTIVE ||
+			   irq_ptr->state == QDIO_IRQ_STATE_ERR);
+	} else {
+		QDIO_PRINT_INFO("ccw_device_{halt,clear} returned %d for "
+				"device %s\n", result, cdev->dev.bus_id);
+		spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags);
+		goto out;
+	}
 	if (irq_ptr->is_thinint_irq) {
 		qdio_put_indicator((__u32*)irq_ptr->dev_st_chg_ind);
 		tiqdio_set_subchannel_ind(irq_ptr,1); 
@@ -2796,7 +2859,7 @@
 					  QDIO_IRQ_STATE_STOPPED) ||
 					  (irq_ptr->state ==
 					   QDIO_IRQ_STATE_ERR)),
-					 (QDIO_ACTIVATE_TIMEOUT>>10)*HZ);
+					 QDIO_ACTIVATE_TIMEOUT);
 
 	switch (irq_ptr->state) {
 	case QDIO_IRQ_STATE_STOPPED:
diff -Nru a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h
--- a/drivers/s390/cio/qdio.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/cio/qdio.h	Tue Feb  3 19:45:17 2004
@@ -1,7 +1,7 @@
 #ifndef _CIO_QDIO_H
 #define _CIO_QDIO_H
 
-#define VERSION_CIO_QDIO_H "$Revision: 1.20 $"
+#define VERSION_CIO_QDIO_H "$Revision: 1.22 $"
 
 //#define QDIO_DBF_LIKE_HELL
 
@@ -56,14 +56,14 @@
 #define QDIO_STATS_CLASSES 2
 #define QDIO_STATS_COUNT_NEEDED 2*/
 
-#define QDIO_NO_USE_COUNT_TIMEOUT 1000 /* wait for 1 sec on each q before
-					  exiting without having use_count
-					  of the queue to 0 */
-
-#define QDIO_ESTABLISH_TIMEOUT 1000
-#define QDIO_ACTIVATE_TIMEOUT 5
-#define QDIO_CLEANUP_CLEAR_TIMEOUT 20000
-#define QDIO_CLEANUP_HALT_TIMEOUT 10000
+#define QDIO_NO_USE_COUNT_TIMEOUT (1*HZ) /* wait for 1 sec on each q before
+					    exiting without having use_count
+					    of the queue to 0 */
+
+#define QDIO_ESTABLISH_TIMEOUT (1*HZ)
+#define QDIO_ACTIVATE_TIMEOUT ((5*HZ)>>10)
+#define QDIO_CLEANUP_CLEAR_TIMEOUT (20*HZ)
+#define QDIO_CLEANUP_HALT_TIMEOUT (10*HZ)
 
 enum qdio_irq_states {
 	QDIO_IRQ_STATE_INACTIVE,
diff -Nru a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c
--- a/drivers/s390/net/ctcmain.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/net/ctcmain.c	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,5 @@
 /*
- * $Id: ctcmain.c,v 1.47 2003/09/22 13:40:51 cohuck Exp $
+ * $Id: ctcmain.c,v 1.50 2003/12/02 15:18:50 cohuck Exp $
  *
  * CTC / ESCON network driver
  *
@@ -36,7 +36,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * RELEASE-TAG: CTC/ESCON network driver $Revision: 1.47 $
+ * RELEASE-TAG: CTC/ESCON network driver $Revision: 1.50 $
  *
  */
 
@@ -272,7 +272,7 @@
 print_banner(void)
 {
 	static int printed = 0;
-	char vbuf[] = "$Revision: 1.47 $";
+	char vbuf[] = "$Revision: 1.50 $";
 	char *version = vbuf;
 
 	if (printed)
@@ -2441,14 +2441,12 @@
 
 	/**
 	 * If channels are not running, try to restart them
-	 * notify anybody about a link failure and throw
-	 * away packet. 
+	 * and throw away packet. 
 	 */
 	if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) {
 		fsm_event(privptr->fsm, DEV_EVENT_START, dev);
 		if (privptr->protocol == CTC_PROTO_LINUX_TTY)
 			return -EBUSY;
-		dst_link_failure(skb);
 		dev_kfree_skb(skb);
 		privptr->stats.tx_dropped++;
 		privptr->stats.tx_errors++;
@@ -2994,20 +2992,20 @@
 
 }
 
-static int
+static void
 ctc_remove_device(struct ccwgroup_device *cgdev)
 {
 	struct ctc_priv *priv;
 
 	priv = cgdev->dev.driver_data;
 	if (!priv)
-		return 0;
-
+		return;
+	if (cgdev->state == CCWGROUP_ONLINE)
+		ctc_shutdown_device(cgdev);
 	ctc_remove_files(&cgdev->dev);
 	cgdev->dev.driver_data = NULL;
 	kfree(priv);
 	put_device(&cgdev->dev);
-	return 0;
 }
 
 static struct ccwgroup_driver ctc_group_driver = {
diff -Nru a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c
--- a/drivers/s390/net/ctctty.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/s390/net/ctctty.c	Tue Feb  3 19:45:29 2004
@@ -1,5 +1,5 @@
 /*
- * $Id: ctctty.c,v 1.13 2003/09/26 14:48:36 mschwide Exp $
+ * $Id: ctctty.c,v 1.15 2004/01/26 10:21:01 mschwide Exp $
  *
  * CTC / ESCON network driver, tty interface.
  *
@@ -759,10 +759,7 @@
 			       info->line);
 #endif
 			error = put_user(C_CLOCAL(tty) ? 1 : 0, (ulong *) arg);
-			if (error)
-				return error;
-			put_user(C_CLOCAL(tty) ? 1 : 0, (ulong *) arg);
-			return 0;
+			return error;
 		case TIOCSSOFTCAR:
 #ifdef CTC_DEBUG_MODEM_IOCTL
 			printk(KERN_DEBUG "%s%d ioctl TIOCSSOFTCAR\n", CTC_TTY_NAME,
diff -Nru a/drivers/s390/net/cu3088.c b/drivers/s390/net/cu3088.c
--- a/drivers/s390/net/cu3088.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/net/cu3088.c	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,5 @@
 /*
- * $Id: cu3088.c,v 1.31 2003/09/29 15:24:27 cohuck Exp $
+ * $Id: cu3088.c,v 1.33 2003/10/14 12:10:19 cohuck Exp $
  *
  * CTC / LCS ccw_device driver
  *
@@ -25,6 +25,7 @@
 
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/err.h>
 
 #include <asm/ccwdev.h>
 #include <asm/ccwgroup.h>
@@ -55,15 +56,7 @@
 
 static struct ccw_driver cu3088_driver;
 
-static void
-cu3088_root_dev_release (struct device *dev)
-{
-}
-
-struct device cu3088_root_dev = {
-	.bus_id = "cu3088",
-	.release = cu3088_root_dev_release,
-};
+struct device *cu3088_root_dev;
 
 static ssize_t
 group_write(struct device_driver *drv, const char *buf, size_t count)
@@ -90,7 +83,7 @@
 		start = end + 1;
 	}
 
-	ret = ccwgroup_create(&cu3088_root_dev, cdrv->driver_id,
+	ret = ccwgroup_create(cu3088_root_dev, cdrv->driver_id,
 			      &cu3088_driver, 2, argv);
 
 	return (ret == 0) ? count : ret;
@@ -144,12 +137,12 @@
 {
 	int rc;
 	
-	rc = device_register(&cu3088_root_dev);
-	if (rc)
-		return rc;
+	cu3088_root_dev = s390_root_dev_register("cu3088");
+	if (IS_ERR(cu3088_root_dev))
+		return PTR_ERR(cu3088_root_dev);
 	rc = ccw_driver_register(&cu3088_driver);
 	if (rc)
-		device_unregister(&cu3088_root_dev);
+		s390_root_dev_unregister(cu3088_root_dev);
 
 	return rc;
 }
@@ -158,7 +151,7 @@
 cu3088_exit (void)
 {
 	ccw_driver_unregister(&cu3088_driver);
-	device_unregister(&cu3088_root_dev);
+	s390_root_dev_unregister(cu3088_root_dev);
 }
 
 MODULE_DEVICE_TABLE(ccw,cu3088_ids);
diff -Nru a/drivers/s390/net/fsm.c b/drivers/s390/net/fsm.c
--- a/drivers/s390/net/fsm.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/s390/net/fsm.c	Tue Feb  3 19:45:18 2004
@@ -1,5 +1,5 @@
 /**
- * $Id: fsm.c,v 1.4 2003/03/28 08:54:40 mschwide Exp $
+ * $Id: fsm.c,v 1.6 2003/10/15 11:37:29 mschwide Exp $
  *
  * A generic FSM based on fsm used in isdn4linux
  *
@@ -9,6 +9,10 @@
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/timer.h>
+
+MODULE_AUTHOR("(C) 2000 IBM Corp. by Fritz Elfert (felfert@millenux.com)");
+MODULE_DESCRIPTION("Finite state machine helper functions");
+MODULE_LICENSE("GPL");
 
 fsm_instance *
 init_fsm(char *name, const char **state_names, const char **event_names, int nr_states,
diff -Nru a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c
--- a/drivers/s390/net/iucv.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/s390/net/iucv.c	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,5 @@
 /* 
- * $Id: iucv.c,v 1.15 2003/10/01 09:25:15 mschwide Exp $
+ * $Id: iucv.c,v 1.19 2003/12/18 15:28:49 braunu Exp $
  *
  * IUCV network driver
  *
@@ -29,7 +29,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * RELEASE-TAG: IUCV lowlevel driver $Revision: 1.15 $
+ * RELEASE-TAG: IUCV lowlevel driver $Revision: 1.19 $
  *
  */
 
@@ -44,12 +44,14 @@
 #include <linux/interrupt.h>
 #include <linux/list.h>
 #include <linux/errno.h>
+#include <linux/err.h>
 #include <linux/device.h>
 #include <asm/atomic.h>
 #include "iucv.h"
 #include <asm/io.h>
 #include <asm/s390_ext.h>
 #include <asm/ebcdic.h>
+#include <asm/ccwdev.h> //for root device stuff
 
 #define DEBUG
 
@@ -79,20 +81,12 @@
 	return 0;
 }
 
-static void
-iucv_root_release (struct device *dev)
-{
-}
-
 struct bus_type iucv_bus = {
 	.name = "iucv",
 	.match = iucv_bus_match,
 };	
 
-struct device iucv_root = {
-	.bus_id = "iucv",
-	.release = iucv_root_release,
-};
+struct device *iucv_root;
 
 /* General IUCV interrupt structure */
 typedef struct {
@@ -355,7 +349,7 @@
 static void
 iucv_banner(void)
 {
-	char vbuf[] = "$Revision: 1.15 $";
+	char vbuf[] = "$Revision: 1.19 $";
 	char *version = vbuf;
 
 	if ((version = strchr(version, ':'))) {
@@ -378,6 +372,11 @@
 {
 	int ret;
 
+	if (!MACHINE_IS_VM) {
+		printk(KERN_ERR "IUCV: IUCV connection needs VM as base\n");
+		return -EPROTONOSUPPORT;
+	}
+
 	if (iucv_external_int_buffer)
 		return 0;
 
@@ -387,11 +386,11 @@
 		return ret;
 	}
 
-	ret = device_register(&iucv_root);
-	if (ret != 0) {
+	iucv_root = s390_root_dev_register("iucv");
+	if (IS_ERR(iucv_root)) {
 		printk(KERN_ERR "IUCV: failed to register iucv root.\n");
 		bus_unregister(&iucv_bus);
-		return ret;
+		return PTR_ERR(iucv_root);
 	}
 
 	/* Note: GFP_DMA used used to get memory below 2G */
@@ -401,6 +400,7 @@
 		printk(KERN_WARNING
 		       "%s: Could not allocate external interrupt buffer\n",
 		       __FUNCTION__);
+		s390_root_dev_unregister(iucv_root);
 		return -ENOMEM;
 	}
 	memset(iucv_external_int_buffer, 0, sizeof(iucv_GeneralInterrupt));
@@ -413,6 +413,7 @@
 		       __FUNCTION__);
 		kfree(iucv_external_int_buffer);
 		iucv_external_int_buffer = NULL;
+		s390_root_dev_unregister(iucv_root);
 		return -ENOMEM;
 	}
 	memset(iucv_param_pool, 0, sizeof(iucv_param) * PARAM_POOL_SIZE);
@@ -439,7 +440,7 @@
 		kfree(iucv_external_int_buffer);
 	if (iucv_param_pool)
 		kfree(iucv_param_pool);
-	device_unregister(&iucv_root);
+	s390_root_dev_unregister(iucv_root);
 	bus_unregister(&iucv_bus);
 	printk(KERN_INFO "IUCV lowlevel driver unloaded\n");
 }
@@ -772,7 +773,7 @@
 	}
 
 	/* Allocate handler entry */
-	new_handler = (handler *)kmalloc(sizeof(handler), GFP_KERNEL);
+	new_handler = (handler *)kmalloc(sizeof(handler), GFP_ATOMIC);
 	if (new_handler == NULL) {
 		printk(KERN_WARNING "%s: storage allocation for new handler "
 		       "failed.\n", __FUNCTION__);
@@ -787,7 +788,7 @@
 
 		max_connections = iucv_query_maxconn();
 		iucv_pathid_table = kmalloc(max_connections * sizeof(handler *),
-				       GFP_KERNEL);
+				       GFP_ATOMIC);
 		if (iucv_pathid_table == NULL) {
 			printk(KERN_WARNING "%s: iucv_pathid_table storage "
 			       "allocation failed\n", __FUNCTION__);
diff -Nru a/drivers/s390/net/iucv.h b/drivers/s390/net/iucv.h
--- a/drivers/s390/net/iucv.h	Tue Feb  3 19:45:43 2004
+++ b/drivers/s390/net/iucv.h	Tue Feb  3 19:45:43 2004
@@ -203,7 +203,7 @@
 } iucv_array_t __attribute__ ((aligned (8)));
 
 extern struct bus_type iucv_bus;
-extern struct device iucv_root;
+extern struct device *iucv_root;
 
 /*   -prototypes-    */
 /*                                                                
diff -Nru a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
--- a/drivers/s390/net/lcs.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/net/lcs.c	Tue Feb  3 19:45:17 2004
@@ -11,7 +11,7 @@
  *			  Frank Pavlic (pavlic@de.ibm.com) and
  *		 	  Martin Schwidefsky <schwidefsky@de.ibm.com>
  *
- *    $Revision: 1.58 $	 $Date: 2003/09/22 13:33:56 $
+ *    $Revision: 1.61 $	 $Date: 2003/12/02 15:18:50 $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -58,7 +58,7 @@
 /**
  * initialization string for output
  */
-#define VERSION_LCS_C  "$Revision: 1.58 $"
+#define VERSION_LCS_C  "$Revision: 1.61 $"
 
 static char version[] __initdata = "LCS driver ("VERSION_LCS_C "/" VERSION_LCS_H ")";
 
@@ -1168,7 +1168,6 @@
 		return -EIO;
 	}
 	if (card->state != DEV_STATE_UP) {
-		dst_link_failure(skb);
 		dev_kfree_skb(skb);
 		card->stats.tx_dropped++;
 		card->stats.tx_errors++;
@@ -1891,7 +1890,7 @@
 /**
  * lcs_remove_device, free buffers and card
  */
-static int
+static void
 lcs_remove_device(struct ccwgroup_device *ccwgdev)
 {
 	struct lcs_card *card;
@@ -1899,12 +1898,18 @@
 	LCS_DBF_TEXT(3, setup, "remdev");
 	card = (struct lcs_card *)ccwgdev->dev.driver_data;
 	if (!card)
-		return 0;
+		return;
+	if (ccwgdev->state == CCWGROUP_ONLINE) {
+		lcs_stop_device(card->dev); /* Ignore rc. */
+		sysfs_remove_link(&card->dev->class_dev.kobj,
+				  ccwgdev->dev.bus_id);
+		sysfs_remove_link(&ccwgdev->dev.kobj, card->dev->name);
+		unregister_netdev(card->dev);
+	}
 	sysfs_remove_group(&ccwgdev->dev.kobj, &lcs_attr_group);
 	lcs_cleanup_card(card);
 	lcs_free_card(card);
 	put_device(&ccwgdev->dev);
-	return 0;
 }
 
 /**
diff -Nru a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
--- a/drivers/s390/net/netiucv.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/s390/net/netiucv.c	Tue Feb  3 19:45:29 2004
@@ -1,5 +1,5 @@
 /*
- * $Id: netiucv.c,v 1.26 2003/09/23 16:48:17 mschwide Exp $
+ * $Id: netiucv.c,v 1.30 2003/12/02 12:29:32 braunu Exp $
  *
  * IUCV network driver
  *
@@ -30,7 +30,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * RELEASE-TAG: IUCV network driver $Revision: 1.26 $
+ * RELEASE-TAG: IUCV network driver $Revision: 1.30 $
  *
  */
 
@@ -1177,12 +1177,10 @@
 
 	/**
 	 * If connection is not running, try to restart it
-	 * notify anybody about a link failure and throw
-	 * away packet. 
+	 * and throw away packet. 
 	 */
 	if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) {
 		fsm_event(privptr->fsm, DEV_EVENT_START, dev);
-		dst_link_failure(skb);
 		dev_kfree_skb(skb);
 		privptr->stats.tx_dropped++;
 		privptr->stats.tx_errors++;
@@ -1464,7 +1462,7 @@
 		return ret;
 	ret = sysfs_create_group(&dev->kobj, &netiucv_stat_attr_group);
 	if (ret)
-		sysfs_remove_group(&dev->kobj, &netiucv_stat_attr_group);
+		sysfs_remove_group(&dev->kobj, &netiucv_attr_group);
 	return ret;
 }
 
@@ -1472,7 +1470,7 @@
 netiucv_remove_files(struct device *dev)
 {
 	sysfs_remove_group(&dev->kobj, &netiucv_stat_attr_group);
-	sysfs_remove_group(&dev->kobj, &netiucv_stat_attr_group);
+	sysfs_remove_group(&dev->kobj, &netiucv_attr_group);
 }
 
 static int
@@ -1485,7 +1483,7 @@
 
 	snprintf(dev->bus_id, BUS_ID_SIZE, "%s%x", str, ifno);
 	dev->bus = &iucv_bus;
-	dev->parent = &iucv_root;
+	dev->parent = iucv_root;
 
 	ret = device_register(dev);
 
@@ -1731,7 +1729,7 @@
 static void
 netiucv_banner(void)
 {
-	char vbuf[] = "$Revision: 1.26 $";
+	char vbuf[] = "$Revision: 1.30 $";
 	char *version = vbuf;
 
 	if ((version = strchr(version, ':'))) {
diff -Nru a/drivers/s390/net/qeth.c b/drivers/s390/net/qeth.c
--- a/drivers/s390/net/qeth.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/s390/net/qeth.c	Tue Feb  3 19:45:43 2004
@@ -1,6 +1,6 @@
 /*
  *
- * linux/drivers/s390/net/qeth.c ($Revision: 1.160 $)
+ * linux/drivers/s390/net/qeth.c ($Revision: 1.177 $)
  *
  * Linux on zSeries OSA Express and HiperSockets support
  *
@@ -11,6 +11,7 @@
  *                                               numerous bugfixes)
  *            Frank Pavlic <pavlic@de.ibm.com>  (query/purge ARP, SNMP, fixes)
  *            Andreas Herrmann <aherrman@de.ibm.com> (bugfixes)
+ *            Thomas Spatzier <tspat@de.ibm.com> (bugfixes)
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -165,7 +166,7 @@
 		 "reserved for low memory situations");
 
 /****************** MODULE STUFF **********************************/
-#define VERSION_QETH_C "$Revision: 1.160 $"
+#define VERSION_QETH_C "$Revision: 1.177 $"
 static const char *version = "qeth S/390 OSA-Express driver ("
     VERSION_QETH_C "/" VERSION_QETH_H "/" VERSION_QETH_MPC_H
     QETH_VERSION_IPV6 QETH_VERSION_VLAN ")";
@@ -314,6 +315,21 @@
 	}
 }
 
+static int inline
+my_down_trylock_nonbusy(struct qeth_card *card, struct semaphore  *sema)
+{
+	for (;;) {
+		if (card) {
+			if (atomic_read(&card->shutdown_phase))
+				return -1;
+		}
+		if (down_trylock(sema))
+			return 0;
+		qeth_wait_nonbusy(QETH_IDLE_WAIT_TIME);
+	}
+}
+
+
 #ifdef CONFIG_ARCH_S390X
 #define QETH_GET_ADDR(x) ((__u32)(unsigned long)x)
 #else /* CONFIG_ARCH_S390X */
@@ -612,6 +628,10 @@
 qeth_is_multicast_skb_at_all(struct sk_buff *skb, int version)
 {
 	int i;
+	struct qeth_card *card;
+
+	i = RTN_UNSPEC;
+	card = (struct qeth_card *)skb->dev->priv;
 	if (skb->dst && skb->dst->neighbour) {
 		i = skb->dst->neighbour->type;
 		return ((i == RTN_BROADCAST) ||
@@ -622,20 +642,38 @@
 		return ((skb->nh.raw[16] & 0xf0) == 0xe0) ? RTN_MULTICAST : 0;
 	} else if (version == 6) {
 		return (skb->nh.raw[24] == 0xff) ? RTN_MULTICAST : 0;
-	} else {
-		PRINT_STUPID("QETH_IP_VERSION is %x\n", version);
-		PRINT_STUPID("skb->protocol=x%x=%i\n",
-			     skb->protocol, skb->protocol);
-		HEXDUMP16(STUPID, "skb:", skb->data);
 	}
-	return 0;
+	if (!memcmp(skb->nh.raw, skb->dev->broadcast, 6)) {
+		i = RTN_BROADCAST;
+	} else {
+		__u16 hdr_mac;
+
+	        hdr_mac = *((__u16*)skb->nh.raw);
+	        /* tr multicast? */
+	        switch (card->link_type) {
+	        case QETH_MPC_LINK_TYPE_HSTR:
+	        case QETH_MPC_LINK_TYPE_LANE_TR:
+	        	if ((hdr_mac == QETH_TR_MAC_NC) ||
+			    (hdr_mac == QETH_TR_MAC_C))
+				i = RTN_MULTICAST;
+			break;
+	        /* eth or so multicast? */
+                default:
+                      	if ((hdr_mac == QETH_ETH_MAC_V4) ||
+			    (hdr_mac == QETH_ETH_MAC_V6))
+			        i = RTN_MULTICAST;
+	        }
+        }
+	return ((i == RTN_BROADCAST)||
+	        (i == RTN_MULTICAST)||
+	        (i == RTN_ANYCAST)) ? i : 0;
 }
 
 static int
 qeth_get_prioqueue(struct qeth_card *card, struct sk_buff *skb,
 		   int multicast, int version)
 {
-	if (!version)
+	if (!version && (card->type == QETH_CARD_TYPE_OSAE))
 		return QETH_DEFAULT_QUEUE;
 	switch (card->no_queues) {
 	case 1:
@@ -1327,7 +1365,7 @@
 		       QETH_FAKE_LL_ADDR_LEN);
 	} else {
 		/* clear source MAC for security reasons */
-		memset(skb->mac.raw + QETH_FAKE_LL_DEST_MAC_POS,
+		memset(skb->mac.raw + QETH_FAKE_LL_SRC_MAC_POS,
 		       0, QETH_FAKE_LL_ADDR_LEN);
 	}
 	memcpy(skb->mac.raw + QETH_FAKE_LL_PROT_POS,
@@ -1947,7 +1985,6 @@
 			case ERROR_LINK_FAILURE:
 			case ERROR_KICK_THAT_PUPPY:
 				QETH_DBF_TEXT4(0, trace, "endeglnd");
-				dst_link_failure(skb);
 				atomic_dec(&skb->users);
 				dev_kfree_skb_irq(skb);
 				break;
@@ -2425,7 +2462,6 @@
 
 	if (!card) {
 		QETH_DBF_TEXT2(0, trace, "XMNSNOCD");
-		dst_link_failure(skb);
 		dev_kfree_skb_irq(skb);
 		return 0;
 	}
@@ -2436,7 +2472,6 @@
 	if (!atomic_read(&card->is_startlaned)) {
 		card->stats->tx_carrier_errors++;
 		QETH_DBF_CARD2(0, trace, "XMNS", card);
-		dst_link_failure(skb);
 		dev_kfree_skb_irq(skb);
 		return 0;
 	}
@@ -2548,7 +2583,8 @@
 qeth_wakeup_procfile(void)
 {
 	QETH_DBF_TEXT5(0, trace, "procwkup");
-	if (atomic_read(&qeth_procfile_ioctl_sem.count) <
+	/* is this if statement correct? */
+	if (atomic_read(&qeth_procfile_ioctl_sem.count) <=
 	    PROCFILE_SLEEP_SEM_MAX_VALUE)
 		up(&qeth_procfile_ioctl_sem);
 }
@@ -2558,7 +2594,6 @@
 {
 	QETH_DBF_TEXT5(0, trace, "procslp");
 	if (down_interruptible(&qeth_procfile_ioctl_sem)) {
-		up(&qeth_procfile_ioctl_sem);
 		return -ERESTARTSYS;
 	}
 	return 0;
@@ -2634,6 +2669,8 @@
 		QETH_DBF_TEXT2(0, trace, "scd:doio");
 		sprintf(dbf_text, "%4x", (__s16) result);
 		QETH_DBF_TEXT2(0, trace, dbf_text);
+		/* re-enable qeth_send_control_data again */
+		atomic_set(&card->write_busy,0);
 		return NULL;
 	}
 
@@ -2644,7 +2681,7 @@
 			atomic_set(&card->write_busy, 0);
 			return NULL;
 		}
-		rec_buf = card->ipa_buf;
+		rec_buf = card->dma_stuff->recbuf;
 		QETH_DBF_CARD2(0, trace, "scro", card);
 	} else {
 		if (qeth_sleepon(card, (setip) ? QETH_IPA_TIMEOUT :
@@ -3350,6 +3387,11 @@
 			  (result==0xe00e)?"unsupported arp assist cmd": \
 			  (result==0xe00f)?"arp assist not enabled": \
 			  (result==0xe080)?"startlan disabled": \
+			  (result==0xf012)?"unicast IP address invalid": \
+			  (result==0xf013)?"multicast router limit reached": \
+			  (result==0xf014)?"stop assist not supported": \
+			  (result==0xf015)?"multicast assist not set": \
+			  (result==0xf080)?"VM: startlan disabled": \
 			  (result==-1)?"IPA communication timeout": \
 			  "unknown return code")
 
@@ -3392,7 +3434,8 @@
 		QETH_DBF_TEXT2(0, trace, dbf_text);
 	}
 
-	if (((result == -1) || (result == 0xe080)) && (retries--)) {
+	if (((result == -1) || (result == 0xe080) ||(result==0xf080)) &&
+	    (retries--)) {
 		QETH_DBF_CARD2(0, trace, "sipr", card);
 		if (ip_vers == 4) {
 			*((__u32 *) (&dbf_text[0])) = *((__u32 *) ip);
@@ -3557,8 +3600,8 @@
 							   le is last entry */
 	char dbf_text[15];
 	int result;
-	__u8 netmask[16] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-		0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+	__u8 netmask[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 	};
 	struct qeth_vipa_entry *priv_add_list = NULL;
 	struct qeth_vipa_entry *priv_del_list = NULL;
@@ -3576,9 +3619,10 @@
 			 * so we clone the entry */
 			ne = (struct qeth_vipa_entry *)
 			    kmalloc(sizeof (struct qeth_vipa_entry),
-				    GFP_KERNEL);
+				    GFP_ATOMIC);
 			if (ne) {
 				ne->version = e->version;
+				ne->flag = e->flag;
 				memcpy(ne->ip, e->ip, 16);
 				ne->next = priv_add_list;
 				priv_add_list = ne;
@@ -3613,6 +3657,7 @@
 				    GFP_KERNEL);
 			if (ne) {
 				ne->version = e->version;
+				ne->flag = e->flag;
 				memcpy(ne->ip, e->ip, 16);
 				ne->next = priv_del_list;
 				priv_del_list = ne;
@@ -3645,7 +3690,7 @@
 			sprintf(dbf_text, "%4x", result);
 			QETH_DBF_TEXT2(0, trace, dbf_text);
 			if (priv_add_list->version == 4) {
-				PRINT_ERR("going to leave vipa/rxip %08x"
+				PRINT_ERR("going to leave vipa/rxip x%08x"
 					  "unset...\n",
 					  *((__u32 *) & priv_add_list->ip[0]));
 				sprintf(dbf_text, "%08x",
@@ -4085,6 +4130,9 @@
 	while (addr) {
 		if (qeth_is_ipma_in_list(addr,
 					 card->ip_mc_current_state.ipm6_ifa)) {
+			qeth_remove_mc_ifa_from_list(
+					&card->ip_mc_new_state.ipm6_ifa,
+					addr);
 			addr = addr->next;
 			continue;
 		}
@@ -4118,8 +4166,13 @@
 				  CARD_BUS_ID(card), result);
  			sprintf(dbf_text, "sms6%4x", result);
  			QETH_DBF_TEXT3(0, trace, dbf_text);
-			qeth_remove_mc_ifa_from_list
-				(&card->ip_mc_current_state.ipm6_ifa, addr);
+		} else {
+			qeth_remove_mc_ifa_from_list(
+					&card->ip_mc_new_state.ipm6_ifa,
+					addr);
+			qeth_add_mc_ifa_to_list(
+					&card->ip_mc_current_state.ipm6_ifa,
+					addr);
 		}
 		addr = addr->next;
 	}
@@ -4555,7 +4608,7 @@
 			ndisc_mc_map(&im6->mca_addr, buf, card->dev, 0);
 			ipmanew =
 			    (struct qeth_ipm_mac *)
-			    kmalloc(sizeof (struct qeth_ipm_mac), GFP_KERNEL);
+			    kmalloc(sizeof (struct qeth_ipm_mac), GFP_ATOMIC);
 			if (!ipmanew) {
 				PRINT_WARN("No memory for IPM address "
 					   "handling. Multicast IP "
@@ -4630,7 +4683,7 @@
 
 		while (ifa) {
 			ifanew =
-			    kmalloc(sizeof (struct inet6_ifaddr), GFP_KERNEL);
+			    kmalloc(sizeof (struct inet6_ifaddr), GFP_ATOMIC);
 			if (!ifanew) {
 				PRINT_WARN("No memory for IP address "
 					   "handling. Some of the IPs "
@@ -4864,7 +4917,7 @@
 			qeth_get_mac_for_ipm(im4->multiaddr, buf, in4_dev->dev);
 			ipmanew =
 			    (struct qeth_ipm_mac *)
-			    kmalloc(sizeof (struct qeth_ipm_mac), GFP_KERNEL);
+			    kmalloc(sizeof (struct qeth_ipm_mac), GFP_ATOMIC);
 			if (!ipmanew) {
 				PRINT_WARN("No memory for IPM address "
 					   "handling. Multicast IP %08x"
@@ -4930,7 +4983,7 @@
 		ifa = ((struct in_device *) card->dev->ip_ptr)->ifa_list;
 
 		while (ifa) {
-			ifanew = kmalloc(sizeof (struct in_ifaddr), GFP_KERNEL);
+			ifanew = kmalloc(sizeof (struct in_ifaddr), GFP_ATOMIC);
 			if (!ifanew) {
 				PRINT_WARN("No memory for IP address "
 					   "handling. Some of the IPs "
@@ -5212,7 +5265,7 @@
 			QETH_DBF_TEXT2(0, trace, dbf_text);
 			atomic_set(&card->is_softsetup, 0);
 			/* do not return an error */
-			if (result == 0xe080)
+			if ((result == 0xe080) || (result == 0xf080))
 				result = 0;
 			return result;
 		}
@@ -5300,13 +5353,17 @@
 				   "failure -- please check the "
 				   "network, plug in the cable or "
 				   "enable the OSA port" :
+				   (result==0xf080) ?
+				   "startlan disabled (VM: LAN " \
+				   "is offline for functions " \
+				   "requiring LAN access.":
 				   "unknown return code");
 			sprintf(dbf_text, "stln%4x", result);
 			QETH_DBF_TEXT2(0, trace, dbf_text);
 			atomic_set(&card->is_softsetup, 0);
 			atomic_set(&card->is_startlaned, 0);
 			/* do not return an error */
-			if (result == 0xe080) {
+			if ((result == 0xe080) || (result == 0xf080)) {
 				result = 0;
 			}
 			return result;
@@ -5527,7 +5584,10 @@
 	if (!atomic_read(&card->enable_routing_attempts6))
 		return;
 
-	if (!card->options.routing_type6) {
+	if (!card->options.routing_type6 ||
+	    ((card->type == QETH_CARD_TYPE_OSAE) &&
+	    ((card->options.routing_type6&ROUTER_MASK) == MULTICAST_ROUTER) &&
+	    !qeth_is_supported6(IPA_OSA_MC_ROUTER_AVAIL))) {
 		atomic_set(&card->enable_routing_attempts6, 0);
 		atomic_set(&card->rt6fld, 0);
 		return;
@@ -5580,9 +5640,9 @@
 	int use_setip_retries = 1;
 
 	if (wait_for_lock == QETH_WAIT_FOR_LOCK) {
-		spin_lock(&card->softsetup_lock);
+		down(&card->softsetup_sema);
 	} else if (wait_for_lock == QETH_DONT_WAIT_FOR_LOCK) {
-		if (!spin_trylock(&card->softsetup_lock)) {
+		if (!down_trylock(&card->softsetup_sema)) {
 			return -EAGAIN;
 		}
 	} else if (wait_for_lock == QETH_LOCK_ALREADY_HELD) {
@@ -5634,7 +5694,7 @@
 		netif_wake_queue(card->dev);
 	}
 	if (wait_for_lock != QETH_LOCK_ALREADY_HELD)
-		spin_unlock(&card->softsetup_lock);
+		up(&card->softsetup_sema);
 	return result;
 }
 
@@ -7835,7 +7895,7 @@
 	cleanup_qdio = in_recovery;	/* if we are in recovery, we clean
 					   the qdio stuff up */
 
-	spin_lock(&card->hardsetup_lock);
+	down(&card->hardsetup_sema);
 	atomic_set(&card->write_busy, 0);
 
 	do {
@@ -8146,7 +8206,7 @@
 	}
 
 exit:
-	spin_unlock(&card->hardsetup_lock);
+	up(&card->hardsetup_sema);
 	return result;
 }
 
@@ -8198,13 +8258,13 @@
 
 		atomic_set(&card->escape_softsetup, 1);
 
-		if (-1 == my_spin_lock_nonbusy(card, &card->softsetup_lock)) {
+		if (-1 == my_down_trylock_nonbusy(card, &card->softsetup_sema)) {
 			atomic_set(&card->escape_softsetup, 0);
 			goto out;
 		}
 		atomic_set(&card->escape_softsetup, 0);
 		if (atomic_read(&card->shutdown_phase)) {
-			spin_unlock(&card->softsetup_lock);
+			up(&card->softsetup_sema);
 			goto out_wakeup;
 		}
 		if (!qeth_verify_card(card))
@@ -8248,7 +8308,7 @@
 		} else {
 			QETH_DBF_TEXT1(0, trace, "ri-sftst");
 			qeth_softsetup_card(card, QETH_LOCK_ALREADY_HELD);
-			spin_unlock(&card->softsetup_lock);
+			up(&card->softsetup_sema);
 
 			if (!already_registered) {
 				QETH_DBF_TEXT1(0, trace, "ri-regcd");
@@ -8374,8 +8434,8 @@
 
 	qeth_fill_qeth_card_options(card);
 
-	spin_lock_init(&card->softsetup_lock);
-	spin_lock_init(&card->hardsetup_lock);
+	init_MUTEX(&card->softsetup_sema);
+	init_MUTEX(&card->hardsetup_sema);
 	spin_lock_init(&card->ioctl_lock);
 #ifdef QETH_VLAN
 	spin_lock_init(&card->vlan_lock);
@@ -8571,7 +8631,8 @@
 		card->options.do_prio_queueing = NO_PRIO_QUEUEING;
 	} else {
 		/* if it's a mc router, it's no router */
-		if ((card->options.routing_type4 == MULTICAST_ROUTER) ||
+		if ((!qeth_is_supported(IPA_OSA_MC_ROUTER_AVAIL) &&
+		     (card->options.routing_type4 == MULTICAST_ROUTER)) ||
 		    (card->options.routing_type4 == PRIMARY_CONNECTOR) ||
 		    (card->options.routing_type4 == SECONDARY_CONNECTOR)) {
 			PRINT_WARN("routing not applicable, reset "
@@ -8599,7 +8660,8 @@
 		card->options.do_prio_queueing = NO_PRIO_QUEUEING;
 	} else {
 		/* if it's a mc router, it's no router */
-		if ((card->options.routing_type6 == MULTICAST_ROUTER) ||
+		if ((!qeth_is_supported(IPA_OSA_MC_ROUTER_AVAIL) &&
+		     (card->options.routing_type6 == MULTICAST_ROUTER)) ||
 		    (card->options.routing_type6 == PRIMARY_CONNECTOR) ||
 		    (card->options.routing_type6 == SECONDARY_CONNECTOR)) {
 			PRINT_WARN("routing not applicable, reset "
@@ -8851,11 +8913,11 @@
 
 	QETH_DBF_TEXT2(0, trace, "procread");
 	length += sprintf(buffer + length,
-			  "devices            CHPID     "
+			  "devices                  CHPID     "
 			  "device     cardtype port chksum prio-q'ing "
 			  "rtr fsz cnt\n");
 	length += sprintf(buffer + length,
-			  "-------------------- --- ----"
+			  "-------------------------- --- ----"
 			  "------ -------------- --     -- ---------- "
 			  "--- --- ---\n");
 	card = firstcard;
@@ -9509,19 +9571,20 @@
 {
 
 	int result;
-	down_interruptible(&qeth_procfile_ioctl_lock);
-	switch (cmd) {
-
-	case QETH_IOCPROC_OSAEINTERFACES:
-		result = qeth_procfile_getinterfaces(arg);
-		break;
-	case QETH_IOCPROC_INTERFACECHANGES:
-		result = qeth_procfile_interfacechanges(arg);
-		break;
-	default:
-		result = -EOPNOTSUPP;
-	}
-	up(&qeth_procfile_ioctl_lock);
+	if (!down_interruptible(&qeth_procfile_ioctl_lock)) {
+		switch (cmd) {
+			case QETH_IOCPROC_OSAEINTERFACES:
+				result = qeth_procfile_getinterfaces(arg);
+				break;
+			case QETH_IOCPROC_INTERFACECHANGES:
+				result = qeth_procfile_interfacechanges(arg);
+				break;
+			default:
+				result = -EOPNOTSUPP;
+		}
+		up(&qeth_procfile_ioctl_lock);
+	} else
+		result = -ERESTARTSYS;
 	return result;
 };
 
@@ -9779,15 +9842,7 @@
 	.remove = ccwgroup_remove_ccwdev,
 };
 
-static void
-qeth_root_dev_release (struct device *dev)
-{
-}
-
-static struct device qeth_root_dev = {
-	.bus_id = "qeth",
-	.release = qeth_root_dev_release,
-};
+static struct device *qeth_root_dev;
 
 static struct ccwgroup_driver qeth_ccwgroup_driver;
 static ssize_t
@@ -9813,7 +9868,7 @@
 	}
 	pr_debug("creating qeth group device from '%s', '%s' and '%s'\n",
 		 bus_ids[0], bus_ids[1], bus_ids[2]);
-	ccwgroup_create(&qeth_root_dev, qeth_ccwgroup_driver.driver_id,
+	ccwgroup_create(qeth_root_dev, qeth_ccwgroup_driver.driver_id,
 			&qeth_ccw_driver, 3, argv);
 	return count;
 }
@@ -10675,19 +10730,6 @@
 }
 
 static int
-qeth_remove_device(struct ccwgroup_device *gdev)
-{
-	struct qeth_card *card = gdev->dev.driver_data;
-
-	__qeth_remove_attributes(&gdev->dev);
-	gdev->dev.driver_data = NULL;
-	if (card)
-		qeth_free_card(card);
-	put_device(&gdev->dev);
-	return 0;
-}
-
-static int
 qeth_set_online(struct ccwgroup_device *gdev)
 {
 	int rc;
@@ -10723,6 +10765,21 @@
 	return 0;
 }
 
+static void
+qeth_remove_device(struct ccwgroup_device *gdev)
+{
+	struct qeth_card *card = gdev->dev.driver_data;
+
+	if (card && qeth_does_card_exist(card))
+		/* Means that card is already in list. */
+		qeth_set_offline(gdev);
+	__qeth_remove_attributes(&gdev->dev);
+	gdev->dev.driver_data = NULL;
+	if (card)
+		qeth_free_card(card);
+	put_device(&gdev->dev);
+}
+
 static struct ccwgroup_driver qeth_ccwgroup_driver = {
 	.name = "qeth",
 	.driver_id = 0xD8C5E3C8,
@@ -10773,10 +10830,11 @@
 	if (result)
 		goto out_cdrv;
 
-	result = device_register(&qeth_root_dev);
-	if (result)
+	qeth_root_dev = s390_root_dev_register("qeth");
+	if (IS_ERR(qeth_root_dev)) {
+		result = PTR_ERR(qeth_root_dev);
 		goto out_file;
-
+	}
 	qeth_register_notifiers();
 	qeth_add_procfs_entries();
 
@@ -10815,7 +10873,7 @@
 	driver_remove_file(&qeth_ccwgroup_driver.driver, &driver_attr_group);
 	ccw_driver_unregister(&qeth_ccw_driver);
 	ccwgroup_driver_unregister(&qeth_ccwgroup_driver);
-	device_unregister(&qeth_root_dev);
+	s390_root_dev_unregister(qeth_root_dev);
 
 	while (firstcard) {
 		struct qeth_card *card = firstcard;
diff -Nru a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h
--- a/drivers/s390/net/qeth.h	Tue Feb  3 19:45:16 2004
+++ b/drivers/s390/net/qeth.h	Tue Feb  3 19:45:16 2004
@@ -14,7 +14,7 @@
 
 #define QETH_NAME " qeth"
 
-#define VERSION_QETH_H "$Revision: 1.58 $"
+#define VERSION_QETH_H "$Revision: 1.60 $"
 
 /******************** CONFIG STUFF ***********************/
 //#define QETH_DBF_LIKE_HELL
@@ -288,6 +288,12 @@
 #define QETH_HEADER_PASSTHRU	0x10
 #define QETH_HEADER_IPV6	0x80
 
+#define QETH_ETH_MAC_V4      0x0100 /* like v4 */
+#define QETH_ETH_MAC_V6      0x3333 /* like v6 */
+/* tr mc mac is longer, but that will be enough to detect mc frames */
+#define QETH_TR_MAC_NC       0xc000 /* non-canonical */
+#define QETH_TR_MAC_C        0x0300 /* canonical */
+
 #define QETH_CAST_FLAGS		0x07
 #define QETH_CAST_UNICAST	6
 #define QETH_CAST_MULTICAST	4
@@ -888,8 +894,8 @@
 	atomic_t is_open;	/* card is in use */
 
 	/* prevents deadlocks :-O */
-	spinlock_t softsetup_lock;
-	spinlock_t hardsetup_lock;
+	struct semaphore softsetup_sema;
+	struct semaphore hardsetup_sema;
 	spinlock_t ioctl_lock;
 	atomic_t softsetup_thread_is_running;
 	struct semaphore softsetup_thread_sem;
diff -Nru a/drivers/s390/net/qeth_mpc.h b/drivers/s390/net/qeth_mpc.h
--- a/drivers/s390/net/qeth_mpc.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/net/qeth_mpc.h	Tue Feb  3 19:45:17 2004
@@ -10,7 +10,7 @@
 #ifndef __QETH_MPC_H__
 #define __QETH_MPC_H__
 
-#define VERSION_QETH_MPC_H "$Revision: 1.16 $"
+#define VERSION_QETH_MPC_H "$Revision: 1.18 $"
 
 #define QETH_IPA_TIMEOUT (card->ipa_timeout)
 #define QETH_MPC_TIMEOUT 2000
@@ -143,6 +143,7 @@
 #define IPA_PASSTHRU 0x00001000L
 #define IPA_FULL_VLAN 0x00004000L
 #define IPA_SOURCE_MAC_AVAIL 0x00010000L
+#define IPA_OSA_MC_ROUTER_AVAIL 0x00020000L
 
 #define IPA_SETADP_QUERY_COMMANDS_SUPPORTED 0x01
 #define IPA_SETADP_ALTER_MAC_ADDRESS 0x02
@@ -319,8 +320,9 @@
 }__attribute__ ((packed));
 
 #define QETH_IOC_MAGIC 0x22
-#define QETH_IOCPROC_OSAEINTERFACES _IOWR(QETH_IOC_MAGIC, 1, arg)
-#define QETH_IOCPROC_INTERFACECHANGES _IOWR(QETH_IOC_MAGIC, 2, arg)
+/* these don't really have 'unsigned long' arguments but were defined that way */
+#define QETH_IOCPROC_OSAEINTERFACES _IOWR(QETH_IOC_MAGIC, 1, unsigned long)
+#define QETH_IOCPROC_INTERFACECHANGES _IOWR(QETH_IOC_MAGIC, 2, unsigned long)
 
 #define SNMP_QUERY_CARD_INFO 0x00000002L
 #define SNMP_REGISETER_MIB   0x00000004L
diff -Nru a/drivers/s390/s390mach.c b/drivers/s390/s390mach.c
--- a/drivers/s390/s390mach.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/s390/s390mach.c	Tue Feb  3 19:45:43 2004
@@ -19,9 +19,12 @@
 #define DBG printk
 // #define DBG(args,...) do {} while (0);
 
+static struct semaphore s_sem;
+
 extern void css_process_crw(int);
 extern void chsc_process_crw(void);
 extern void chp_process_crw(int, int);
+extern void css_reiterate_subchannels(void);
 
 static void
 s390_handle_damage(char *msg)
@@ -38,12 +41,19 @@
  *
  * Note : we currently process CRWs for io and chsc subchannels only
  */
-static void
-s390_collect_crw_info(void)
+static int
+s390_collect_crw_info(void *param)
 {
 	struct crw crw;
 	int ccode;
+	struct semaphore *sem;
 
+	sem = (struct semaphore *)param;
+	/* Set a nice name. */
+	daemonize("kmcheck");
+
+repeat:
+	down_interruptible(sem);
 	while (1) {
 		ccode = stcrw(&crw);
 		if (ccode != 0)
@@ -52,6 +62,12 @@
 		    "chn=%d, rsc=%X, anc=%d, erc=%X, rsid=%X\n",
 		    crw.slct, crw.oflw, crw.chn, crw.rsc, crw.anc,
 		    crw.erc, crw.rsid);
+		/* Check for overflows. */
+		if (crw.oflw) {
+			pr_debug("%s: crw overflow detected!\n", __FUNCTION__);
+			css_reiterate_subchannels();
+			continue;
+		}
 		switch (crw.rsc) {
 		case CRW_RSC_SCH:
 			pr_debug("source is subchannel %04X\n", crw.rsid);
@@ -86,6 +102,8 @@
 			break;
 		}
 	}
+	goto repeat;
+	return 0;
 }
 
 /*
@@ -122,7 +140,7 @@
 				   "check\n");
 
 	if (mci->cp)		/* channel report word pending */
-		s390_collect_crw_info();
+		up(&s_sem);
 
 #ifdef CONFIG_MACHCHK_WARNING
 /*
@@ -154,6 +172,7 @@
 static int
 machine_check_init(void)
 {
+	init_MUTEX_LOCKED( &s_sem );
 	ctl_clear_bit(14, 25);	/* disable damage MCH */
 	ctl_set_bit(14, 26);	/* enable degradation MCH */
 	ctl_set_bit(14, 27);	/* enable system recovery MCH */
@@ -176,6 +195,7 @@
 static int __init
 machine_check_crw_init (void)
 {
+	kernel_thread(s390_collect_crw_info, &s_sem, CLONE_FS|CLONE_FILES);
 	ctl_set_bit(14, 28);	/* enable channel report MCH */
 	return 0;
 }
diff -Nru a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
--- a/drivers/s390/scsi/zfcp_aux.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/s390/scsi/zfcp_aux.c	Tue Feb  3 19:45:43 2004
@@ -28,7 +28,7 @@
  */
 
 /* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_AUX_REVISION "$Revision: 1.65 $"
+#define ZFCP_AUX_REVISION "$Revision: 1.79 $"
 
 /********************** INCLUDES *********************************************/
 
@@ -63,6 +63,7 @@
 
 /* accumulated log level (module parameter) */
 static u32 loglevel = ZFCP_LOG_LEVEL_DEFAULTS;
+static char *device;
 /*********************** FUNCTION PROTOTYPES *********************************/
 
 /* written against the module interface */
@@ -94,13 +95,14 @@
 	      "Wolfgang Taphorn <taphorn@de.ibm.com>, "
 	      "Aron Zeh <arzeh@de.ibm.com>, "
 	      "IBM Deutschland Entwicklung GmbH");
-/* what this driver module is about */
 MODULE_DESCRIPTION
     ("FCP (SCSI over Fibre Channel) HBA driver for IBM eServer zSeries");
 MODULE_LICENSE("GPL");
-/* log level may be provided as a module parameter */
+
+module_param(device, charp, 0);
+MODULE_PARM_DESC(device, "specify initial device");
+
 module_param(loglevel, uint, 0);
-/* short explaination of the previous module parameter */
 MODULE_PARM_DESC(loglevel,
 		 "log levels, 8 nibbles: "
 		 "(unassigned) ERP QDIO DIO Config FSF SCSI Other, "
@@ -285,7 +287,7 @@
 	debug_event(adapter->cmd_dbf, level, &scsi_cmnd->result, sizeof (u32));
 	debug_event(adapter->cmd_dbf, level, &scsi_cmnd,
 		    sizeof (unsigned long));
-	if (fsf_req) {
+	if (likely(fsf_req)) {
 		debug_event(adapter->cmd_dbf, level, &fsf_req,
 			    sizeof (unsigned long));
 		debug_event(adapter->cmd_dbf, level, &fsf_req->seq_no,
@@ -316,6 +318,84 @@
 #endif
 }
 
+/**
+ * zfcp_device_setup - setup function
+ * @str: pointer to parameter string
+ *
+ * Parse "device=..." parameter string.
+ */
+static int __init
+zfcp_device_setup(char *str)
+{
+	char *tmp;
+
+	if (!str)
+		return 0;
+
+	tmp = strchr(str, ',');
+	if (!tmp)
+		goto err_out;
+	*tmp++ = '\0';
+	strncpy(zfcp_data.init_busid, str, BUS_ID_SIZE);
+	zfcp_data.init_busid[BUS_ID_SIZE-1] = '\0';
+
+	zfcp_data.init_wwpn = simple_strtoull(tmp, &tmp, 0);
+	if (*tmp++ != ',')
+		goto err_out;
+	if (*tmp == '\0')
+		goto err_out;
+
+	zfcp_data.init_fcp_lun = simple_strtoull(tmp, &tmp, 0);
+	if (*tmp != '\0')
+		goto err_out;
+	return 1;
+
+ err_out:
+	ZFCP_LOG_NORMAL("Parse error for device parameter string %s\n", str);
+	return 0;
+}
+
+static void __init
+zfcp_init_device_configure(void)
+{
+	int found = 0;
+	unsigned long flags;
+	struct zfcp_adapter *adapter;
+	struct zfcp_port *port;
+	struct zfcp_unit *unit;
+
+	down(&zfcp_data.config_sema);
+	read_lock_irqsave(&zfcp_data.config_lock, flags);
+	list_for_each_entry(adapter, &zfcp_data.adapter_list_head, list)
+		if (strcmp(zfcp_data.init_busid,
+			   zfcp_get_busid_by_adapter(adapter)) == 0) {
+			zfcp_adapter_get(adapter);
+			found = 1;
+			break;
+		}
+	read_unlock_irqrestore(&zfcp_data.config_lock, flags);
+	if (!found)
+		goto out_adapter;
+	port = zfcp_port_enqueue(adapter, zfcp_data.init_wwpn, 0);
+	if (!port)
+		goto out_port;
+	unit = zfcp_unit_enqueue(port, zfcp_data.init_fcp_lun);
+	if (!unit)
+		goto out_unit;
+	up(&zfcp_data.config_sema);
+	ccw_device_set_online(adapter->ccw_device);
+	down(&zfcp_data.config_sema);
+	wait_event(unit->scsi_add_wq, atomic_read(&unit->scsi_add_work) == 0);
+	zfcp_unit_put(unit);
+ out_unit:
+	zfcp_port_put(port);
+ out_port:
+	zfcp_adapter_put(adapter);
+ out_adapter:
+	up(&zfcp_data.config_sema);
+	return;
+}
+
 static int __init
 zfcp_module_init(void)
 {
@@ -357,9 +437,14 @@
 		ZFCP_LOG_NORMAL("Registering with common I/O layer failed.\n");
 		goto out_ccw_register;
 	}
+
+	if (zfcp_device_setup(device))
+		zfcp_init_device_configure();
+
 	goto out;
 
  out_ccw_register:
+	unregister_reboot_notifier(&zfcp_data.reboot_notifier);
 #ifdef ZFCP_STAT_REQSIZES
 	zfcp_statistics_clear_all();
 #endif
@@ -391,13 +476,8 @@
 zfcp_reboot_handler(struct notifier_block *notifier, unsigned long code,
 		    void *ptr)
 {
-	int retval = NOTIFY_DONE;
-
-	/* block access to config (for rest of lifetime of this Linux) */
-	down(&zfcp_data.config_sema);
-	zfcp_erp_adapter_shutdown_all();
-
-	return retval;
+	zfcp_ccw_unregister();
+	return NOTIFY_DONE;
 }
 
 #undef ZFCP_LOG_AREA
@@ -410,19 +490,6 @@
 #define ZFCP_LOG_AREA			ZFCP_LOG_AREA_CONFIG
 #define ZFCP_LOG_AREA_PREFIX		ZFCP_LOG_AREA_PREFIX_CONFIG
 
-#ifndef MODULE
-/* zfcp_loglevel boot_parameter */
-static int __init
-zfcp_loglevel_setup(char *str)
-{
-	loglevel = simple_strtoul(str, NULL, 0);
-	ZFCP_LOG_TRACE("loglevel is 0x%x\n", loglevel);
-	return 1;		/* why just 1? */
-}
-
-__setup("zfcp_loglevel=", zfcp_loglevel_setup);
-#endif				/* not MODULE */
-
 /**
  * zfcp_get_unit_by_lun - find unit in unit list of port by fcp lun
  * @port: pointer to port to search for unit
@@ -503,6 +570,7 @@
 		return NULL;
 	memset(unit, 0, sizeof (struct zfcp_unit));
 
+	init_waitqueue_head(&unit->scsi_add_wq);
 	/* initialise reference count stuff */
 	atomic_set(&unit->refcount, 0);
 	init_waitqueue_head(&unit->remove_wq);
@@ -571,6 +639,7 @@
 	write_unlock_irq(&zfcp_data.config_lock);
 
 	port->units++;
+	zfcp_port_get(port);
 
 	return unit;
 }
@@ -763,17 +832,10 @@
 	/* initialize abort lock */
 	rwlock_init(&adapter->abort_lock);
 
-	/* initialise scsi faking structures */
-	rwlock_init(&adapter->fake_list_lock);
-	init_timer(&adapter->fake_scsi_timer);
-
 	/* initialise some erp stuff */
 	init_waitqueue_head(&adapter->erp_thread_wqh);
 	init_waitqueue_head(&adapter->erp_done_wqh);
 
-	/* notification when there are no outstanding SCSI commands */
-	init_waitqueue_head(&adapter->scsi_reqs_active_wq);
-
 	/* initialize lock of associated request queue */
 	rwlock_init(&adapter->request_queue.queue_lock);
 
@@ -904,7 +966,6 @@
 	/* put allocated adapter at list tail */
 	write_lock_irq(&zfcp_data.config_lock);
 	atomic_clear_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status);
-	atomic_set_mask(ZFCP_STATUS_COMMON_RUNNING, &adapter->status);
 	list_add_tail(&adapter->list, &zfcp_data.adapter_list_head);
 	write_unlock_irq(&zfcp_data.config_lock);
 
@@ -1149,6 +1210,7 @@
 	write_unlock_irq(&zfcp_data.config_lock);
 
 	adapter->ports++;
+	zfcp_adapter_get(adapter);
 
 	return port;
 }
@@ -1193,7 +1255,6 @@
 	/* set special D_ID */
 	port->d_id = ZFCP_DID_NAMESERVER;
 	adapter->nameserver_port = port;
-	zfcp_adapter_get(adapter);
 	zfcp_port_put(port);
 
 	return 0;
@@ -1216,9 +1277,9 @@
 	struct fcp_rscn_head *fcp_rscn_head;
 	struct fcp_rscn_element *fcp_rscn_element;
 	struct zfcp_port *port;
-	int i;
-	int reopen_unknown = 0;
-	int no_entries;
+	u16 i;
+	u16 no_entries;
+	u32 range_mask;
 	unsigned long flags;
 
 	fcp_rscn_head = (struct fcp_rscn_head *) status_buffer->payload;
@@ -1232,56 +1293,57 @@
 
 	debug_text_event(adapter->erp_dbf, 1, "unsol_els_rscn:");
 	for (i = 1; i < no_entries; i++) {
-		int known;
-		int range_mask;
-		int no_notifications;
-
-		range_mask = 0;
-		no_notifications = 0;
-		known = 0;
 		/* skip head and start with 1st element */
 		fcp_rscn_element++;
 		switch (fcp_rscn_element->addr_format) {
 		case ZFCP_PORT_ADDRESS:
 			ZFCP_LOG_FLAGS(1, "ZFCP_PORT_ADDRESS\n");
 			range_mask = ZFCP_PORTS_RANGE_PORT;
-			no_notifications = 1;
 			break;
 		case ZFCP_AREA_ADDRESS:
 			ZFCP_LOG_FLAGS(1, "ZFCP_AREA_ADDRESS\n");
-			/* skip head and start with 1st element */
 			range_mask = ZFCP_PORTS_RANGE_AREA;
-			no_notifications = ZFCP_NO_PORTS_PER_AREA;
 			break;
 		case ZFCP_DOMAIN_ADDRESS:
 			ZFCP_LOG_FLAGS(1, "ZFCP_DOMAIN_ADDRESS\n");
 			range_mask = ZFCP_PORTS_RANGE_DOMAIN;
-			no_notifications = ZFCP_NO_PORTS_PER_DOMAIN;
 			break;
 		case ZFCP_FABRIC_ADDRESS:
 			ZFCP_LOG_FLAGS(1, "ZFCP_FABRIC_ADDRESS\n");
 			range_mask = ZFCP_PORTS_RANGE_FABRIC;
-			no_notifications = ZFCP_NO_PORTS_PER_FABRIC;
 			break;
 		default:
-			/* cannot happen */
-			break;
+			ZFCP_LOG_INFO("Received RSCN with unknown "
+				      "address format.\n");
+			continue;
 		}
 		read_lock_irqsave(&zfcp_data.config_lock, flags);
 		list_for_each_entry(port, &adapter->port_list_head, list) {
+			if (atomic_test_mask
+			    (ZFCP_STATUS_PORT_NAMESERVER, &port->status))
+				continue;
 			/* Do we know this port? If not skip it. */
 			if (!atomic_test_mask
-			    (ZFCP_STATUS_PORT_DID_DID, &port->status))
+			    (ZFCP_STATUS_PORT_DID_DID, &port->status)) {
+				ZFCP_LOG_INFO
+					("Received state change notification."
+					 "Trying to open the port with wwpn "
+					 "0x%Lx. Hope it's there now.\n",
+					 port->wwpn);
+				debug_text_event(adapter->erp_dbf, 1,
+						 "unsol_els_rscnu:");
+				zfcp_erp_port_reopen(port,
+						     ZFCP_STATUS_COMMON_ERP_FAILED);
 				continue;
+			}
+
 			/*
 			 * FIXME: race: d_id might being invalidated
 			 * (...DID_DID reset)
 			 */
 			if ((port->d_id & range_mask)
 			    == (fcp_rscn_element->nport_did & range_mask)) {
-				known++;
-				ZFCP_LOG_TRACE("known=%d, reopen did 0x%x\n",
-					       known,
+				ZFCP_LOG_TRACE("reopen did 0x%x\n",
 					       fcp_rscn_element->nport_did);
 				/*
 				 * Unfortunately, an RSCN does not specify the
@@ -1303,36 +1365,6 @@
 			}
 		}
 		read_unlock_irqrestore(&zfcp_data.config_lock, flags);
-		ZFCP_LOG_TRACE("known %d, no_notifications %d\n",
-			       known, no_notifications);
-		if (known < no_notifications) {
-			ZFCP_LOG_DEBUG
-			    ("At least one unknown port changed state. "
-			     "Unknown ports need to be reopened.\n");
-			reopen_unknown = 1;
-		}
-	}			// for (i=1; i < no_entries; i++)
-
-	if (reopen_unknown) {
-		ZFCP_LOG_DEBUG("At least one unknown did "
-			       "underwent a state change.\n");
-		read_lock_irqsave(&zfcp_data.config_lock, flags);
-		list_for_each_entry(port, &adapter->port_list_head, list) {
-			if (!atomic_test_mask((ZFCP_STATUS_PORT_DID_DID
-					       | ZFCP_STATUS_PORT_NAMESERVER),
-					      &port->status)) {
-				ZFCP_LOG_INFO
-				    ("Received state change notification."
-				     "Trying to open the port with wwpn "
-				     "0x%Lx. Hope it's there now.\n",
-				     port->wwpn);
-				debug_text_event(adapter->erp_dbf, 1,
-						 "unsol_els_rscnu:");
-				zfcp_erp_port_reopen(port,
-						     ZFCP_STATUS_COMMON_ERP_FAILED);
-			}
-		}
-		read_unlock_irqrestore(&zfcp_data.config_lock, flags);
 	}
 }
 
@@ -1469,7 +1501,7 @@
 	struct zfcp_adapter *adapter = fsf_req->adapter;
 	int retval = 0;
 
-	data->outbuf = kmalloc(2 * sizeof (struct fc_ct_iu), GFP_KERNEL);
+	data->outbuf = kmalloc(2 * sizeof (struct fc_ct_iu), GFP_ATOMIC);
 	if (data->outbuf) {
 		memset(data->outbuf, 0, 2 * sizeof (struct fc_ct_iu));
 	} else {
@@ -1479,7 +1511,7 @@
 			       "adapter %s directly.. trying emergency pool\n",
 			       zfcp_get_busid_by_adapter(adapter));
 		data->outbuf =
-		    mempool_alloc(adapter->pool.nameserver, GFP_KERNEL);
+		    mempool_alloc(adapter->pool.nameserver, GFP_ATOMIC);
 		if (!data->outbuf) {
 			ZFCP_LOG_DEBUG
 				("Out of memory. Could not get emergency "
diff -Nru a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c
--- a/drivers/s390/scsi/zfcp_ccw.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/scsi/zfcp_ccw.c	Tue Feb  3 19:45:17 2004
@@ -25,7 +25,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#define ZFCP_CCW_C_REVISION "$Revision: 1.33 $"
+#define ZFCP_CCW_C_REVISION "$Revision: 1.36 $"
 
 #include <linux/init.h>
 #include <linux/module.h>
@@ -37,7 +37,7 @@
 #define ZFCP_LOG_AREA_PREFIX            ZFCP_LOG_AREA_PREFIX_CONFIG
 
 static int zfcp_ccw_probe(struct ccw_device *);
-static int zfcp_ccw_remove(struct ccw_device *);
+static void zfcp_ccw_remove(struct ccw_device *);
 static int zfcp_ccw_set_online(struct ccw_device *);
 static int zfcp_ccw_set_offline(struct ccw_device *);
 
@@ -90,16 +90,17 @@
  *
  * This function gets called by the common i/o layer and removes an adapter
  * from the system. Task of this function is to get rid of all units and
- * ports that belong to this adapter. And addition all resources of this
+ * ports that belong to this adapter. And in addition all resources of this
  * adapter will be freed too.
  */
-static int
+static void
 zfcp_ccw_remove(struct ccw_device *ccw_device)
 {
 	struct zfcp_adapter *adapter;
 	struct zfcp_port *port, *p;
 	struct zfcp_unit *unit, *u;
 
+	ccw_device_set_offline(ccw_device);
 	down(&zfcp_data.config_sema);
 	adapter = dev_get_drvdata(&ccw_device->dev);
 
@@ -119,16 +120,18 @@
 	list_for_each_entry_safe(port, p, &adapter->port_remove_lh, list) {
 		list_for_each_entry_safe(unit, u, &port->unit_remove_lh, list) {
 			zfcp_unit_wait(unit);
+			zfcp_sysfs_unit_remove_files(&unit->sysfs_device);
 			device_unregister(&unit->sysfs_device);
 		}
 		zfcp_port_wait(port);
+		zfcp_sysfs_port_remove_files(&port->sysfs_device,
+					     atomic_read(&port->status));
 		device_unregister(&port->sysfs_device);
 	}
 	zfcp_adapter_wait(adapter);
 	zfcp_adapter_dequeue(adapter);
 
 	up(&zfcp_data.config_sema);
-	return 0;
 }
 
 /**
@@ -155,6 +158,7 @@
 	zfcp_erp_modify_adapter_status(adapter, ZFCP_STATUS_COMMON_RUNNING,
 				       ZFCP_SET);
 	zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED);
+	zfcp_erp_wait(adapter);
  out:
 	up(&zfcp_data.config_sema);
 	return retval;
diff -Nru a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
--- a/drivers/s390/scsi/zfcp_def.h	Tue Feb  3 19:45:29 2004
+++ b/drivers/s390/scsi/zfcp_def.h	Tue Feb  3 19:45:29 2004
@@ -31,10 +31,8 @@
 #ifndef ZFCP_DEF_H
 #define ZFCP_DEF_H
 
-#ifdef __KERNEL__
-
 /* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_DEF_REVISION "$Revision: 1.41 $"
+#define ZFCP_DEF_REVISION "$Revision: 1.48 $"
 
 /*************************** INCLUDES *****************************************/
 
@@ -64,7 +62,6 @@
 typedef u32 scsi_id_t;
 typedef u32 scsi_lun_t;
 
-#define ZFCP_FAKE_SCSI_COMPLETION_TIME	        (HZ / 3)
 #define ZFCP_ERP_SCSI_LOW_MEM_TIMEOUT           (100*HZ)
 #define ZFCP_SCSI_ER_TIMEOUT                    (100*HZ)
 #define ZFCP_SCSI_HOST_FLUSH_TIMEOUT            (1*HZ)
@@ -470,7 +467,6 @@
 #define ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL	0x00000080
 #define ZFCP_STATUS_ADAPTER_ERP_PENDING		0x00000100
 #define ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED	0x00000200
-#define ZFCP_STATUS_ADAPTER_QUEUECOMMAND_BLOCK	0x00000400 
 
 #define ZFCP_STATUS_ADAPTER_SCSI_UP			\
 		(ZFCP_STATUS_COMMON_UNBLOCKED |	\
@@ -676,10 +672,7 @@
 	u32			hydra_version;	   /* Hydra version */
 	u32			fsf_lic_version;
 	struct Scsi_Host	*scsi_host;	   /* Pointer to mid-layer */
-        Scsi_Cmnd               *first_fake_cmnd;  /* Packets in flight list */
-	rwlock_t		fake_list_lock;    /* Lock for the above */
-	struct timer_list       fake_scsi_timer;   /* Starts processing of
-						      faked commands */
+
 	unsigned char		name[9];
 	struct list_head	port_list_head;	   /* remote port list */
 	struct list_head        port_remove_lh;    /* head of ports to be
@@ -692,9 +685,6 @@
 	rwlock_t		fsf_req_list_lock; /* lock for ops on list of
 						      FSF requests */
         atomic_t       		fsf_reqs_active;   /* # active FSF reqs */
-        atomic_t       		scsi_reqs_active;  /* # active SCSI reqs */
-	wait_queue_head_t	scsi_reqs_active_wq; /* can be used to wait for
-							fsf_reqs_active chngs */
 	struct zfcp_qdio_queue	request_queue;	   /* request queue */
 	u32			fsf_req_seq_no;	   /* FSF cmnd seq number */
 	wait_queue_head_t	request_wq;	   /* can be used to wait for
@@ -765,6 +755,8 @@
 	struct zfcp_erp_action erp_action;     /* pending error recovery */
         atomic_t               erp_counter;
 	struct device          sysfs_device;   /* sysfs device */
+	atomic_t               scsi_add_work;  /* used to synchronize */
+	wait_queue_head_t      scsi_add_wq;    /* wait for scsi_add_device */
 };
 
 /* FSF request */
@@ -809,6 +801,9 @@
 	struct notifier_block	reboot_notifier;     /* used to register cleanup
 							functions */
 	atomic_t		loglevel;            /* current loglevel */
+	char                    init_busid[BUS_ID_SIZE];
+	wwn_t                   init_wwpn;
+	fcp_lun_t               init_fcp_lun;
 #ifdef ZFCP_STAT_REQSIZES                            /* Statistical accounting
 							of processed data */
 	struct list_head	read_req_head;
@@ -857,7 +852,7 @@
 
 #ifndef atomic_test_mask
 #define atomic_test_mask(mask, target) \
-           (atomic_read(target) & mask)
+           ((atomic_read(target) & mask) == mask)
 #endif
 
 extern void _zfcp_hex_dump(char *, int);
@@ -957,5 +952,4 @@
 	wait_event(adapter->remove_wq, atomic_read(&adapter->refcount) == 0);
 }
 
-#endif /* __KERNEL_- */
 #endif /* ZFCP_DEF_H */
diff -Nru a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
--- a/drivers/s390/scsi/zfcp_erp.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/scsi/zfcp_erp.c	Tue Feb  3 19:45:17 2004
@@ -30,7 +30,7 @@
 #define ZFCP_LOG_AREA			ZFCP_LOG_AREA_ERP
 #define ZFCP_LOG_AREA_PREFIX		ZFCP_LOG_AREA_PREFIX_ERP
 /* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_ERP_REVISION "$Revision: 1.33 $"
+#define ZFCP_ERP_REVISION "$Revision: 1.39 $"
 
 #include "zfcp_ext.h"
 
@@ -108,6 +108,9 @@
 static int zfcp_erp_action_enqueue(int, struct zfcp_adapter *,
 				   struct zfcp_port *, struct zfcp_unit *);
 static int zfcp_erp_action_dequeue(struct zfcp_erp_action *);
+static void zfcp_erp_action_cleanup(int, struct zfcp_adapter *,
+				    struct zfcp_port *, struct zfcp_unit *,
+				    int);
 
 static void zfcp_erp_action_ready(struct zfcp_erp_action *);
 static int  zfcp_erp_action_exists(struct zfcp_erp_action *);
@@ -1160,6 +1163,9 @@
 	write_unlock(&adapter->erp_lock);
 	read_unlock_irqrestore(&zfcp_data.config_lock, flags);
 	
+	if (retval != ZFCP_ERP_CONTINUES)
+		zfcp_erp_action_cleanup(action, adapter, port, unit, retval);
+
 	/*
 	 * a few tasks remain when the erp queues are empty
 	 * (don't do that if the last action evaluated was dismissed
@@ -1451,6 +1457,66 @@
 	     !(ZFCP_STATUS_ERP_CLOSE_ONLY & erp_status));
 }
 
+/**
+ * zfcp_erp_scsi_add_device
+ * @data: pointer to a struct zfcp_unit
+ *
+ * Registers a logical unit with the SCSI stack.
+ */
+static void
+zfcp_erp_scsi_add_device(void *data)
+{
+	struct {
+		struct zfcp_unit  *unit;
+		struct work_struct work;
+	} *p;
+
+	p = data;
+	scsi_add_device(p->unit->port->adapter->scsi_host,
+			0, p->unit->port->scsi_id, p->unit->scsi_lun);
+	atomic_set(&p->unit->scsi_add_work, 0);
+	wake_up(&p->unit->scsi_add_wq);
+	zfcp_unit_put(p->unit);
+	kfree(p);
+}
+
+/**
+ * zfcp_erp_schedule_work
+ * @unit: pointer to unit which should be registered with SCSI stack
+ *
+ * Schedules work which registers a unit with the SCSI stack
+ */
+static int
+zfcp_erp_schedule_work(struct zfcp_unit *unit)
+{
+	struct {
+		struct zfcp_unit * unit;
+		struct work_struct work;
+	} *p;
+
+	if (atomic_compare_and_swap(0, 1, &unit->scsi_add_work))
+		return 0;
+
+	if ((p = kmalloc(sizeof(*p), GFP_KERNEL)) == NULL) {
+		ZFCP_LOG_NORMAL("error: Out of resources. Could not register "
+			      "the FCP-LUN 0x%Lx connected to "
+			      "the port with WWPN 0x%Lx connected to "
+			      "the adapter %s with the SCSI stack.\n",
+			      unit->fcp_lun,
+			      unit->port->wwpn,
+			      zfcp_get_busid_by_unit(unit));
+		atomic_set(&p->unit->scsi_add_work, 0);
+		return -ENOMEM;
+	}
+
+	zfcp_unit_get(unit);
+	memset(p, 0, sizeof(*p));
+	INIT_WORK(&p->work, zfcp_erp_scsi_add_device, p);
+	p->unit = unit;
+	schedule_work(&p->work);
+	return 0;
+}
+
 /*
  * function:	
  *
@@ -1468,10 +1534,6 @@
 	if (result == ZFCP_ERP_SUCCEEDED) {
 		atomic_set(&unit->erp_counter, 0);
 		zfcp_erp_unit_unblock(unit);
-		/* register unit with scsi stack */
-		if (!unit->device)
-			scsi_add_device(unit->port->adapter->scsi_host,
-					0, unit->port->scsi_id, unit->scsi_lun);
 	} else {
 		/* ZFCP_ERP_FAILED or ZFCP_ERP_EXIT */
 		atomic_inc(&unit->erp_counter);
@@ -1773,9 +1835,8 @@
 	struct zfcp_port *port;
 
 	list_for_each_entry(port, &adapter->port_list_head, list)
-	    if (atomic_test_mask(ZFCP_STATUS_PORT_NAMESERVER, &port->status)
-		!= ZFCP_STATUS_PORT_NAMESERVER)
-		zfcp_erp_port_reopen_internal(port, clear_mask);
+		if (!atomic_test_mask(ZFCP_STATUS_PORT_NAMESERVER, &port->status))
+			zfcp_erp_port_reopen_internal(port, clear_mask);
 
 	return retval;
 }
@@ -2333,8 +2394,8 @@
 		 * open flag is unset - however, this is for readabilty ...
 		 */
 		if (atomic_test_mask((ZFCP_STATUS_PORT_PHYS_OPEN |
-				      ZFCP_STATUS_COMMON_OPEN), &port->status)
-		    == (ZFCP_STATUS_PORT_PHYS_OPEN | ZFCP_STATUS_COMMON_OPEN)) {
+				      ZFCP_STATUS_COMMON_OPEN),
+			             &port->status)) {
 			ZFCP_LOG_DEBUG("Port wwpn=0x%Lx is open -> trying "
 				       " close physical\n",
 				       port->wwpn);
@@ -2433,8 +2494,7 @@
 	int retval;
 
 	if (atomic_test_mask(ZFCP_STATUS_PORT_NAMESERVER,
-			     &erp_action->port->status)
-	    == ZFCP_STATUS_PORT_NAMESERVER)
+			     &erp_action->port->status))
 		retval = zfcp_erp_port_strategy_open_nameserver(erp_action);
 	else
 		retval = zfcp_erp_port_strategy_open_common(erp_action);
@@ -3041,6 +3101,12 @@
 			goto out;
 		}
 		if (!atomic_test_mask
+		    (ZFCP_STATUS_COMMON_RUNNING, &port->status) ||
+		    atomic_test_mask
+		    (ZFCP_STATUS_COMMON_ERP_FAILED, &port->status)) {
+			goto out;
+		}
+		if (!atomic_test_mask
 		    (ZFCP_STATUS_COMMON_UNBLOCKED, &port->status)) {
 			stronger_action = ZFCP_ERP_ACTION_REOPEN_PORT;
 			unit = NULL;
@@ -3068,6 +3134,12 @@
 			goto out;
 		}
 		if (!atomic_test_mask
+		    (ZFCP_STATUS_COMMON_RUNNING, &adapter->status) ||
+		    atomic_test_mask
+		    (ZFCP_STATUS_COMMON_ERP_FAILED, &adapter->status)) {
+			goto out;
+		}
+		if (!atomic_test_mask
 		    (ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status)) {
 			stronger_action = ZFCP_ERP_ACTION_REOPEN_ADAPTER;
 			port = NULL;
@@ -3178,18 +3250,15 @@
 	case ZFCP_ERP_ACTION_REOPEN_UNIT:
 		atomic_clear_mask(ZFCP_STATUS_COMMON_ERP_INUSE,
 				  &erp_action->unit->status);
-		zfcp_unit_put(erp_action->unit);
 		break;
 	case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
 	case ZFCP_ERP_ACTION_REOPEN_PORT:
 		atomic_clear_mask(ZFCP_STATUS_COMMON_ERP_INUSE,
 				  &erp_action->port->status);
-		zfcp_port_put(erp_action->port);
 		break;
 	case ZFCP_ERP_ACTION_REOPEN_ADAPTER:
 		atomic_clear_mask(ZFCP_STATUS_COMMON_ERP_INUSE,
 				  &erp_action->adapter->status);
-		zfcp_adapter_put(adapter);
 		break;
 	default:
 		/* bug */
@@ -3197,6 +3266,39 @@
 	}
 	return retval;
 }
+
+/**
+ * zfcp_erp_action_cleanup
+ *
+ * registers unit with scsi stack if appropiate and fixes reference counts
+ */
+
+static void
+zfcp_erp_action_cleanup(int action, struct zfcp_adapter *adapter,
+			struct zfcp_port *port, struct zfcp_unit *unit,
+			int result)
+{
+	if ((action == ZFCP_ERP_ACTION_REOPEN_UNIT)
+	    && (result == ZFCP_ERP_SUCCEEDED)
+	    && (!unit->device)) {
+		zfcp_erp_schedule_work(unit);
+	}
+	switch (action) {
+	case ZFCP_ERP_ACTION_REOPEN_UNIT:
+		zfcp_unit_put(unit);
+		break;
+	case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
+	case ZFCP_ERP_ACTION_REOPEN_PORT:
+		zfcp_port_put(port);
+		break;
+	case ZFCP_ERP_ACTION_REOPEN_ADAPTER:
+		zfcp_adapter_put(adapter);
+		break;
+	default:
+		break;
+	}
+}
+
 
 /*
  * function:	
diff -Nru a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
--- a/drivers/s390/scsi/zfcp_ext.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/scsi/zfcp_ext.h	Tue Feb  3 19:45:17 2004
@@ -30,9 +30,7 @@
 #ifndef ZFCP_EXT_H
 #define ZFCP_EXT_H
 /* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_EXT_REVISION "$Revision: 1.33 $"
-
-#ifdef __KERNEL__
+#define ZFCP_EXT_REVISION "$Revision: 1.38 $"
 
 #include "zfcp_def.h"
 
@@ -44,7 +42,9 @@
 extern int  zfcp_sysfs_adapter_create_files(struct device *);
 extern void zfcp_sysfs_adapter_remove_files(struct device *);
 extern int  zfcp_sysfs_port_create_files(struct device *, u32);
+extern void zfcp_sysfs_port_remove_files(struct device *, u32);
 extern int  zfcp_sysfs_unit_create_files(struct device *);
+extern void zfcp_sysfs_unit_remove_files(struct device *);
 extern void zfcp_sysfs_port_release(struct device *);
 extern int  zfcp_sysfs_port_shutdown(struct zfcp_port *);
 extern void zfcp_sysfs_unit_release(struct device *);
@@ -112,9 +112,6 @@
 extern int  zfcp_adapter_scsi_register(struct zfcp_adapter *);
 extern void zfcp_adapter_scsi_unregister(struct zfcp_adapter *);
 extern void zfcp_scsi_block_requests(struct Scsi_Host *);
-extern void zfcp_scsi_insert_into_fake_queue(struct zfcp_adapter *,
-					     Scsi_Cmnd *);
-extern void zfcp_scsi_process_and_clear_fake_queue(unsigned long);
 extern int  zfcp_create_sbals_from_sg(struct zfcp_fsf_req *,
 				     Scsi_Cmnd *, char, int, int);
 extern void zfcp_set_fcp_dl(struct fcp_cmnd_iu *, fcp_dl_t);
@@ -159,5 +156,4 @@
 #ifdef ZFCP_STAT_REQSIZES
 extern int  zfcp_statistics_inc(struct list_head *, u32);
 #endif
-#endif	/* __KERNEL__ */
 #endif	/* ZFCP_EXT_H */
diff -Nru a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
--- a/drivers/s390/scsi/zfcp_fsf.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/s390/scsi/zfcp_fsf.c	Tue Feb  3 19:45:34 2004
@@ -28,7 +28,7 @@
  */
 
 /* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_FSF_C_REVISION "$Revision: 1.12 $"
+#define ZFCP_FSF_C_REVISION "$Revision: 1.16 $"
 
 #include "zfcp_ext.h"
 
@@ -101,7 +101,8 @@
 	case FSF_QTCB_ABORT_FCP_CMND:
 		fsf_req = zfcp_fsf_req_get(kmalloc_flags,
 					   adapter->pool.fcp_command_fsf);
-		if (fsf_req && (fsf_req->status & ZFCP_STATUS_FSFREQ_POOL)) {
+		if (unlikely(fsf_req &&
+		             (fsf_req->status & ZFCP_STATUS_FSFREQ_POOL))) {
 			/*
 			 * watch low mem buffer
 			 * Note: If the command is reset or aborted, two
@@ -116,7 +117,8 @@
 		}
 #ifdef ZFCP_DEBUG_REQUESTS
 		debug_text_event(adapter->req_dbf, 5, "fsfa_fcp");
-		if (fsf_req && (fsf_req->status & ZFCP_STATUS_FSFREQ_POOL))
+		if (unlikely(fsf_req &&
+		             (fsf_req->status & ZFCP_STATUS_FSFREQ_POOL)))
 			debug_text_event(adapter->req_dbf, 5, "fsfa_pl");
 #endif /* ZFCP_DEBUG_REQUESTS */
 		break;
@@ -158,7 +160,7 @@
 				"(debug info 0x%x)\n", fsf_cmd);
 	}			//switch(fsf_cmd)
 
-	if (!fsf_req) {
+	if (unlikely(!fsf_req)) {
 		ZFCP_LOG_DEBUG("error: Out of memory. Allocation of FSF "
 			       "request structure failed\n");
 	} else {
@@ -171,7 +173,7 @@
 
 #ifdef ZFCP_DEBUG_REQUESTS
 	debug_event(adapter->req_dbf, 5, &fsf_req, sizeof (unsigned long));
-	if (fsf_req->qtcb)
+	if (likely(fsf_req->qtcb))
 		debug_event(adapter->req_dbf, 5, &fsf_req->qtcb,
 			    sizeof (unsigned long));
 #endif				/* ZFCP_DEBUG_REQUESTS */
@@ -198,7 +200,7 @@
 
 	case FSF_QTCB_FCP_CMND:
 	case FSF_QTCB_ABORT_FCP_CMND:
-		if (fsf_req->status & ZFCP_STATUS_FSFREQ_POOL) {
+		if (unlikely(fsf_req->status & ZFCP_STATUS_FSFREQ_POOL)) {
 			del_timer(&adapter->pool.fcp_command_fsf_timer);
 			mempool_free(fsf_req, adapter->pool.fcp_command_fsf);
 		} else
@@ -299,7 +301,7 @@
 	/* do some statistics */
 	atomic_dec(&adapter->fsf_reqs_active);
 
-	if (fsf_req->fsf_command == FSF_QTCB_UNSOLICITED_STATUS) {
+	if (unlikely(fsf_req->fsf_command == FSF_QTCB_UNSOLICITED_STATUS)) {
 		ZFCP_LOG_DEBUG("Status read response received\n");
 		/*
 		 * Note: all cleanup handling is done in the callchain of
@@ -314,7 +316,7 @@
 	 * fsf_req may be deleted due to waking up functions, so 
 	 * cleanup is saved here and used later 
 	 */
-	if (fsf_req->status & ZFCP_STATUS_FSFREQ_CLEANUP)
+	if (likely(fsf_req->status & ZFCP_STATUS_FSFREQ_CLEANUP))
 		cleanup = 1;
 	else
 		cleanup = 0;
@@ -322,7 +324,7 @@
 	fsf_req->status |= ZFCP_STATUS_FSFREQ_COMPLETED;
 
 	/* cleanup request if requested by initiator */
-	if (cleanup) {
+	if (likely(cleanup)) {
 		ZFCP_LOG_TRACE("removing FSF request 0x%lx\n",
 			       (unsigned long) fsf_req);
 		/*
@@ -334,6 +336,16 @@
 		/* notify initiator waiting for the requests completion */
 		ZFCP_LOG_TRACE("waking initiator of FSF request 0x%lx\n",
 			       (unsigned long) fsf_req);
+		/*
+		 * FIXME: Race! We must not access fsf_req here as it might have been
+		 * cleaned up already due to the set ZFCP_STATUS_FSFREQ_COMPLETED
+		 * flag. It's an improbable case. But, we have the same paranoia for
+		 * the cleanup flag already.
+		 * Might better be handled using complete()?
+		 * (setting the flag and doing wakeup ought to be atomic
+		 *  with regard to checking the flag as long as waitqueue is
+		 *  part of the to be released structure)
+		 */
 		wake_up(&fsf_req->completion_wq);
 	}
 
@@ -372,7 +384,7 @@
 	}
 
 	/* log additional information provided by FSF (if any) */
-	if (fsf_req->qtcb->header.log_length) {
+	if (unlikely(fsf_req->qtcb->header.log_length)) {
 		/* do not trust them ;-) */
 		if (fsf_req->qtcb->header.log_start > ZFCP_QTCB_SIZE) {
 			ZFCP_LOG_NORMAL
@@ -686,7 +698,7 @@
 {
 	int retval = 0;
 
-	if (fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR) {
+	if (unlikely(fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR)) {
 		goto skip_fsfstatus;
 	}
 
@@ -835,7 +847,7 @@
 {
 	int retval = 0;
 
-	if (fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR) {
+	if (unlikely(fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR)) {
 		ZFCP_LOG_TRACE("fsf_req=0x%lx, QTCB=0x%lx\n",
 			       (unsigned long) fsf_req,
 			       (unsigned long) (fsf_req->qtcb));
@@ -1996,6 +2008,20 @@
 				ZFCP_STATUS_PORT_PHYS_OPEN, &port->status);
 		retval = 0;
 		/* check whether D_ID has changed during open */
+		/*
+		 * FIXME: This check is not airtight, as the FCP channel does
+		 * not monitor closures of target port connections caused on
+		 * the remote side. Thus, they might miss out on invalidating
+		 * locally cached WWPNs (and other N_Port parameters) of gone
+		 * target ports. So, our heroic attempt to make things safe
+		 * could be undermined by 'open port' response data tagged with
+		 * obsolete WWPNs. Another reason to monitor potential
+		 * connection closures ourself at least (by interpreting
+		 * incoming ELS' and unsolicited status). It just crosses my
+		 * mind that one should be able to cross-check by means of
+		 * another GID_PN straight after a port has been opened.
+		 * Alternately, an ADISC/PDISC ELS should suffice, as well.
+		 */
 		plogi = (struct fsf_plogi *) fsf_req->qtcb->bottom.support.els;
 		if (!atomic_test_mask(ZFCP_STATUS_PORT_NO_WWPN, &port->status))
 		{
@@ -2398,9 +2424,9 @@
 	}
 
 	erp_action->fsf_req->qtcb->header.port_handle =
-	    erp_action->port->handle;
-	*(fcp_lun_t *) & (erp_action->fsf_req->qtcb->bottom.support.fcp_lun)
-	    = erp_action->unit->fcp_lun;
+		erp_action->port->handle;
+	erp_action->fsf_req->qtcb->bottom.support.fcp_lun =
+		erp_action->unit->fcp_lun;
 	atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &erp_action->unit->status);
 	erp_action->fsf_req->data.open_unit.unit = erp_action->unit;
 	erp_action->fsf_req->erp_action = erp_action;
@@ -2835,7 +2861,7 @@
 	retval = zfcp_fsf_req_create(adapter,
 				     FSF_QTCB_FCP_CMND,
 				     &lock_flags, req_flags, &(fsf_req));
-	if (retval < 0) {
+	if (unlikely(retval < 0)) {
 		ZFCP_LOG_DEBUG("error: Out of resources. Could not create an "
 			       "FCP command request for FCP-LUN 0x%Lx "
 			       "connected to the port with WWPN 0x%Lx "
@@ -2928,7 +2954,7 @@
 	fcp_cmnd_iu->fcp_lun = unit->fcp_lun;
 
 	/* set task attributes in FCP_CMND IU in QTCB */
-	if (scsi_cmnd->device->simple_tags) {
+	if (likely(scsi_cmnd->device->simple_tags)) {
 		fcp_cmnd_iu->task_attribute = SIMPLE_Q;
 		ZFCP_LOG_TRACE("setting SIMPLE_Q task attribute\n");
 	} else {
@@ -2937,7 +2963,7 @@
 	}
 
 	/* set additional length of FCP_CDB in FCP_CMND IU in QTCB, if needed */
-	if (scsi_cmnd->cmd_len > FCP_CDB_LENGTH) {
+	if (unlikely(scsi_cmnd->cmd_len > FCP_CDB_LENGTH)) {
 		fcp_cmnd_iu->add_fcp_cdb_length
 		    = (scsi_cmnd->cmd_len - FCP_CDB_LENGTH) >> 2;
 		ZFCP_LOG_TRACE("SCSI CDB length is 0x%x, "
@@ -2965,9 +2991,9 @@
 	/* Note: >= and not = because the combined scatter-gather entries
 	 * may be larger than request_bufflen according to the mailing list
 	 */
-	if (real_bytes >= scsi_cmnd->request_bufflen) {
+	if (likely(real_bytes >= scsi_cmnd->request_bufflen)) {
 		ZFCP_LOG_TRACE("Data fits\n");
-	} else if (real_bytes == 0) {
+	} else if (likely(real_bytes == 0)) {
 		ZFCP_LOG_DEBUG("Data did not fit into available buffer(s), "
 			       "waiting for more...\n");
 		retval = -EIO;
@@ -2996,7 +3022,7 @@
 	 *  covered by an SBALE)
 	 */
 	retval = zfcp_fsf_req_send(fsf_req, NULL);
-	if (retval < 0) {
+	if (unlikely(retval < 0)) {
 		ZFCP_LOG_INFO("error: Could not send an FCP command request "
 			      "for a command on the adapter %s, "
 			      "port WWPN 0x%Lx and unit LUN 0x%Lx\n",
@@ -3139,12 +3165,12 @@
 	int retval = -EINVAL;
 	struct zfcp_unit *unit;
 
-	if (fsf_req->status & ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT)
+	if (unlikely(fsf_req->status & ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT))
 		unit = fsf_req->data.send_fcp_command_task_management.unit;
 	else
 		unit = fsf_req->data.send_fcp_command_task.unit;
 
-	if (fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR) {
+	if (unlikely(fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR)) {
 		/* go directly to calls of special handlers */
 		goto skip_fsfstatus;
 	}
@@ -3445,7 +3471,6 @@
 zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
 {
 	int retval = 0;
-	struct zfcp_adapter *adapter = fsf_req->adapter;
 
 	Scsi_Cmnd *scpnt;
 	struct fcp_rsp_iu *fcp_rsp_iu = (struct fcp_rsp_iu *)
@@ -3459,14 +3484,14 @@
 
 	read_lock_irqsave(&fsf_req->adapter->abort_lock, flags);
 	scpnt = fsf_req->data.send_fcp_command_task.scsi_cmnd;
-	if (!scpnt) {
+	if (unlikely(!scpnt)) {
 		ZFCP_LOG_DEBUG
 		    ("Command with fsf_req 0x%lx is not associated to "
 		     "a scsi command anymore. Aborted?\n",
 		     (unsigned long) fsf_req);
 		goto out;
 	}
-	if (fsf_req->status & ZFCP_STATUS_FSFREQ_ABORTED) {
+	if (unlikely(fsf_req->status & ZFCP_STATUS_FSFREQ_ABORTED)) {
 		/* FIXME: (design) mid-layer should handle DID_ABORT like
 		 *        DID_SOFT_ERROR by retrying the request for devices
 		 *        that allow retries.
@@ -3477,7 +3502,7 @@
 		goto skip_fsfstatus;
 	}
 
-	if (fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR) {
+	if (unlikely(fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR)) {
 		ZFCP_LOG_DEBUG("Setting DID_ERROR\n");
 		set_host_byte(&scpnt->result, DID_ERROR);
 		goto skip_fsfstatus;
@@ -3491,7 +3516,7 @@
 	 * of result in SCSI command
 	 */
 	scpnt->result |= fcp_rsp_iu->scsi_status;
-	if (fcp_rsp_iu->scsi_status) {
+	if (unlikely(fcp_rsp_iu->scsi_status)) {
 		/* DEBUG */
 		ZFCP_LOG_NORMAL("status for SCSI Command:\n");
 		ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL,
@@ -3507,7 +3532,7 @@
 	}
 
 	/* check FCP_RSP_INFO */
-	if (fcp_rsp_iu->validity.bits.fcp_rsp_len_valid) {
+	if (unlikely(fcp_rsp_iu->validity.bits.fcp_rsp_len_valid)) {
 		ZFCP_LOG_DEBUG("rsp_len is valid\n");
 		switch (fcp_rsp_info[3]) {
 		case RSP_CODE_GOOD:
@@ -3600,7 +3625,7 @@
 	}
 
 	/* check for sense data */
-	if (fcp_rsp_iu->validity.bits.fcp_sns_len_valid) {
+	if (unlikely(fcp_rsp_iu->validity.bits.fcp_sns_len_valid)) {
 		sns_len = FSF_FCP_RSP_SIZE -
 		    sizeof (struct fcp_rsp_iu) + fcp_rsp_iu->fcp_rsp_len;
 		ZFCP_LOG_TRACE("room for %i bytes sense data in QTCB\n",
@@ -3623,7 +3648,7 @@
 	}
 
 	/* check for overrun */
-	if (fcp_rsp_iu->validity.bits.fcp_resid_over) {
+	if (unlikely(fcp_rsp_iu->validity.bits.fcp_resid_over)) {
 		ZFCP_LOG_INFO("A data overrun was detected for a command. "
 			      "This happened for a command to the unit "
 			      "with FCP LUN 0x%Lx connected to the "
@@ -3638,7 +3663,7 @@
 	}
 
 	/* check for underrun */
-	if (fcp_rsp_iu->validity.bits.fcp_resid_under) {
+	if (unlikely(fcp_rsp_iu->validity.bits.fcp_resid_under)) {
 		ZFCP_LOG_DEBUG("A data underrun was detected for a command. "
 			       "This happened for a command to the unit "
 			       "with FCP LUN 0x%Lx connected to the "
@@ -3755,9 +3780,6 @@
 	 * the new eh
 	 */
 	/* always call back */
-	(scpnt->scsi_done) (scpnt);
-	atomic_dec(&adapter->scsi_reqs_active);
-	wake_up(&adapter->scsi_reqs_active_wq);
 #ifdef ZFCP_DEBUG_REQUESTS
 	debug_text_event(fsf_req->adapter->req_dbf, 2, "ok_done:");
 	debug_event(fsf_req->adapter->req_dbf, 2, &scpnt,
@@ -3768,8 +3790,6 @@
 		    sizeof (unsigned long));
 #endif /* ZFCP_DEBUG_REQUESTS */
 	(scpnt->scsi_done) (scpnt);
-	atomic_dec(&adapter->scsi_reqs_active);
-	wake_up(&adapter->scsi_reqs_active_wq);
 	/*
 	 * We must hold this lock until scsi_done has been called.
 	 * Otherwise we may call scsi_done after abort regarding this
@@ -3904,7 +3924,7 @@
 			       struct zfcp_qdio_queue *queue, int needed)
 {
 	write_lock_irqsave(&queue->queue_lock, *flags);
-	if (atomic_read(&queue->free_count) >= needed)
+	if (likely(atomic_read(&queue->free_count) >= needed))
 		return 1;
 	write_unlock_irqrestore(&queue->queue_lock, *flags);
 	return 0;
@@ -3942,7 +3962,7 @@
 
 	/* allocate new FSF request */
 	fsf_req = zfcp_fsf_req_alloc(adapter, fsf_cmd, GFP_ATOMIC);
-	if (!fsf_req) {
+	if (unlikely(!fsf_req)) {
 		ZFCP_LOG_DEBUG("error: Could not put an FSF request into"
 			       "the outbound (send) queue.\n");
 		retval = -ENOMEM;
@@ -3960,11 +3980,11 @@
 	fsf_req->specific_magic = ZFCP_MAGIC_FSFREQ;
 
 	fsf_req->fsf_command = fsf_cmd;
-	if (req_flags & ZFCP_REQ_AUTO_CLEANUP)
+	if (likely(req_flags & ZFCP_REQ_AUTO_CLEANUP))
 		fsf_req->status |= ZFCP_STATUS_FSFREQ_CLEANUP;
 
 	/* initialize QTCB */
-	if (fsf_cmd != FSF_QTCB_UNSOLICITED_STATUS) {
+	if (likely(fsf_cmd != FSF_QTCB_UNSOLICITED_STATUS)) {
 		ZFCP_LOG_TRACE("fsf_req->qtcb=0x%lx\n",
 			       (unsigned long) fsf_req->qtcb);
 		fsf_req->qtcb->prefix.req_id = (unsigned long) fsf_req;
@@ -3983,7 +4003,7 @@
 	 * try to get needed SBALs in request queue (get queue lock on success)
 	 */
 	ZFCP_LOG_TRACE("try to get free BUFFER in request queue\n");
-	if (req_flags & ZFCP_WAIT_FOR_SBAL) {
+	if (unlikely(req_flags & ZFCP_WAIT_FOR_SBAL)) {
 		timeout = ZFCP_SBAL_TIMEOUT;
 		ZFCP_WAIT_EVENT_TIMEOUT(adapter->request_wq,
 					timeout,
@@ -4009,7 +4029,7 @@
 	/* setup common SBALE fields */
 	buffere[0].addr = fsf_req;
 	buffere[0].flags |= SBAL_FLAGS0_COMMAND;
-	if (fsf_cmd != FSF_QTCB_UNSOLICITED_STATUS) {
+	if (likely(fsf_cmd != FSF_QTCB_UNSOLICITED_STATUS)) {
 		buffere[1].addr = (void *) fsf_req->qtcb;
 		buffere[1].length = ZFCP_QTCB_SIZE;
 	}
@@ -4116,7 +4136,7 @@
 		      buffere->length);
 
 	/* set sequence counter in QTCB */
-	if (fsf_req->qtcb) {
+	if (likely(fsf_req->qtcb)) {
 		fsf_req->qtcb->prefix.req_seq_no = adapter->fsf_req_seq_no;
 		fsf_req->seq_no = adapter->fsf_req_seq_no;
 		ZFCP_LOG_TRACE("FSF request 0x%lx of adapter 0x%lx gets "
@@ -4133,7 +4153,7 @@
 	write_unlock_irqrestore(&adapter->fsf_req_list_lock, flags);
 
 	/* figure out expiration time of timeout and start timeout */
-	if (timer) {
+	if (unlikely(timer)) {
 		timer->expires += jiffies;
 		add_timer(timer);
 	}
@@ -4167,7 +4187,7 @@
 			 QDIO_FLAG_SYNC_OUTPUT,
 			 0, fsf_req->sbal_index, fsf_req->sbal_count, NULL);
 
-	if (retval) {
+	if (unlikely(retval)) {
 		/* Queues are down..... */
 		retval = -EIO;
 		/*
@@ -4198,7 +4218,7 @@
 		debug_text_event(adapter->req_dbf, 1, "o:a/seq");
 		debug_event(adapter->req_dbf, 1, &fsf_req,
 			    sizeof (unsigned long));
-		if (inc_seq_no) {
+		if (likely(inc_seq_no)) {
 			debug_event(adapter->req_dbf, 1,
 				    &adapter->fsf_req_seq_no, sizeof (u32));
 		} else {
@@ -4213,7 +4233,7 @@
 		 * otherwise,
 		 */
 		/* Don't increase for unsolicited status */
-		if (inc_seq_no) {
+		if (likely(inc_seq_no)) {
 			adapter->fsf_req_seq_no++;
 			ZFCP_LOG_TRACE
 			    ("FSF sequence counter value of adapter 0x%lx "
@@ -4263,16 +4283,16 @@
 	struct zfcp_fsf_req *fsf_req;
 
 	fsf_req = kmalloc(ZFCP_QTCB_AND_REQ_SIZE, kmalloc_flags);
-	if (fsf_req) {
+	if (likely(fsf_req)) {
 		memset(fsf_req, 0, ZFCP_QTCB_AND_REQ_SIZE);
 	} else {
 		fsf_req = mempool_alloc(pool, kmalloc_flags);
-		if (fsf_req) {
+		if (likely(fsf_req)) {
 			memset(fsf_req, 0, ZFCP_QTCB_AND_REQ_SIZE);
 			fsf_req->status |= ZFCP_STATUS_FSFREQ_POOL;
 		}
 	}
-	if (fsf_req)
+	if (likely(fsf_req))
 		fsf_req->qtcb =
 		    (struct fsf_qtcb *) ((unsigned long) fsf_req +
 					 sizeof (struct zfcp_fsf_req));
diff -Nru a/drivers/s390/scsi/zfcp_fsf.h b/drivers/s390/scsi/zfcp_fsf.h
--- a/drivers/s390/scsi/zfcp_fsf.h	Tue Feb  3 19:45:41 2004
+++ b/drivers/s390/scsi/zfcp_fsf.h	Tue Feb  3 19:45:41 2004
@@ -30,8 +30,6 @@
 #ifndef FSF_H
 #define FSF_H
 
-#ifdef __KERNEL__
-
 #define FSF_QTCB_VERSION1			0x00000001
 #define FSF_QTCB_CURRENT_VERSION		FSF_QTCB_VERSION1
 
@@ -354,5 +352,4 @@
 	union  fsf_qtcb_bottom bottom;
 } __attribute__ ((packed));
 
-#endif				/* __KERNEL__ */
 #endif				/* FSF_H */
diff -Nru a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c
--- a/drivers/s390/scsi/zfcp_qdio.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/s390/scsi/zfcp_qdio.c	Tue Feb  3 19:45:16 2004
@@ -27,7 +27,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#define ZFCP_QDIO_C_REVISION "$Revision: 1.7 $"
+#define ZFCP_QDIO_C_REVISION "$Revision: 1.10 $"
 
 #include "zfcp_ext.h"
 
@@ -214,7 +214,7 @@
 				       " QDIO_STATUS_OUTBOUND_INT \n");
 		}
 	}			// if (ZFCP_LOG_CHECK(ZFCP_LOG_LEVEL_TRACE))
-	if (status & QDIO_STATUS_LOOK_FOR_ERROR) {
+	if (unlikely(status & QDIO_STATUS_LOOK_FOR_ERROR)) {
 		retval = -EIO;
 
 		ZFCP_LOG_FLAGS(1, "QDIO_STATUS_LOOK_FOR_ERROR \n");
@@ -261,7 +261,17 @@
 		}
 		/* Restarting IO on the failed adapter from scratch */
 		debug_text_event(adapter->erp_dbf, 1, "qdio_err");
-		zfcp_erp_adapter_reopen(adapter, 0);
+               /*
+                * Since we have been using this adapter, it is save to assume
+                * that it is not failed but recoverable. The card seems to
+                * report link-up events by self-initiated queue shutdown.
+                * That is why we need to clear the the link-down flag
+                * which is set again in case we have missed by a mile.
+                */
+               zfcp_erp_adapter_reopen(
+                       adapter, 
+                       ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED |
+                       ZFCP_STATUS_COMMON_ERP_FAILED);
 	}
 	return retval;
 }
@@ -293,8 +303,8 @@
 		       zfcp_get_busid_by_adapter(adapter),
 		       first_element, elements_processed);
 
-	if (zfcp_qdio_handler_error_check(adapter, status, qdio_error,
-					  siga_error))
+	if (unlikely(zfcp_qdio_handler_error_check(adapter, status, qdio_error,
+					           siga_error)))
 		goto out;
 	/*
 	 * we stored address of struct zfcp_adapter  data structure
@@ -345,8 +355,8 @@
 	adapter = (struct zfcp_adapter *) int_parm;
 	queue = &adapter->response_queue;
 
-	if (zfcp_qdio_handler_error_check(adapter, status, qdio_error,
-					  siga_error))
+	if (unlikely(zfcp_qdio_handler_error_check(adapter, status, qdio_error,
+					           siga_error)))
 		goto out;
 
 	/*
@@ -394,11 +404,17 @@
 				ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL,
 					      (char *) buffer, SBAL_SIZE);
 			}
-			if (buffere->flags & SBAL_FLAGS_LAST_ENTRY)
+			/*
+			 * A single used SBALE per inbound SBALE has been
+			 * implemented by QDIO so far. Hope they will
+			 * do some optimisation. Will need to change to
+			 * unlikely() then.
+			 */
+			if (likely(buffere->flags & SBAL_FLAGS_LAST_ENTRY))
 				break;
 		};
 
-		if (!buffere->flags & SBAL_FLAGS_LAST_ENTRY) {
+		if (unlikely(!(buffere->flags & SBAL_FLAGS_LAST_ENTRY))) {
 			ZFCP_LOG_NORMAL("bug: End of inbound data "
 					"not marked!\n");
 		}
@@ -421,7 +437,7 @@
 			 QDIO_FLAG_SYNC_INPUT | QDIO_FLAG_UNDER_INTERRUPT,
 			 0, start, count, NULL);
 
-	if (retval) {
+	if (unlikely(retval)) {
 		atomic_set(&queue->free_count, count);
 		ZFCP_LOG_DEBUG("Inbound data regions could not be cleared "
 			       "Transfer queues may be down. "
@@ -458,7 +474,7 @@
 #endif				/* ZFCP_DEBUG_REQUESTS */
 
 	/* invalid (per convention used in this driver) */
-	if (!sbale_addr) {
+	if (unlikely(!sbale_addr)) {
 		ZFCP_LOG_NORMAL
 		    ("bug: Inbound data faulty, contains null-pointer!\n");
 		retval = -EINVAL;
@@ -468,8 +484,8 @@
 	/* valid request id and thus (hopefully :) valid fsf_req address */
 	fsf_req = (struct zfcp_fsf_req *) sbale_addr;
 
-	if ((fsf_req->common_magic != ZFCP_MAGIC) ||
-	    (fsf_req->specific_magic != ZFCP_MAGIC_FSFREQ)) {
+	if (unlikely((fsf_req->common_magic != ZFCP_MAGIC) ||
+	             (fsf_req->specific_magic != ZFCP_MAGIC_FSFREQ))) {
 		ZFCP_LOG_NORMAL("bug: An inbound FSF acknowledgement was "
 				"faulty (debug info 0x%x, 0x%x, 0x%lx)\n",
 				fsf_req->common_magic,
@@ -479,7 +495,7 @@
 		goto out;
 	}
 
-	if (adapter != fsf_req->adapter) {
+	if (unlikely(adapter != fsf_req->adapter)) {
 		ZFCP_LOG_NORMAL("bug: An inbound FSF acknowledgement was not "
 				"correct (debug info 0x%lx, 0x%lx, 0%lx) \n",
 				(unsigned long) fsf_req,
@@ -490,7 +506,7 @@
 	}
 #ifdef ZFCP_DEBUG_REQUESTS
 	/* debug feature stuff (test for QTCB: remember new unsol. status!) */
-	if (fsf_req->qtcb) {
+	if (likely(fsf_req->qtcb)) {
 		debug_event(adapter->req_dbf, 1,
 			    &fsf_req->qtcb->prefix.req_seq_no, sizeof (u32));
 	}
@@ -498,7 +514,7 @@
 
 	ZFCP_LOG_TRACE("fsf_req at 0x%lx, QTCB at 0x%lx\n",
 		       (unsigned long) fsf_req, (unsigned long) fsf_req->qtcb);
-	if (fsf_req->qtcb) {
+	if (likely(fsf_req->qtcb)) {
 		ZFCP_LOG_TRACE("HEX DUMP OF 1ST BUFFERE PAYLOAD (QTCB):\n");
 		ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_TRACE,
 			      (char *) fsf_req->qtcb, ZFCP_QTCB_SIZE);
@@ -518,8 +534,8 @@
 	int pci_pos;
 
 	new_distance_from_int = req_queue->distance_from_int +
-	    fsf_req->sbal_count;
-	if (new_distance_from_int >= ZFCP_QDIO_PCI_INTERVAL) {
+				fsf_req->sbal_count;
+	if (unlikely(new_distance_from_int >= ZFCP_QDIO_PCI_INTERVAL)) {
 		new_distance_from_int %= ZFCP_QDIO_PCI_INTERVAL;
 		pci_pos = fsf_req->sbal_index;
 		pci_pos += fsf_req->sbal_count;
diff -Nru a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
--- a/drivers/s390/scsi/zfcp_scsi.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/scsi/zfcp_scsi.c	Tue Feb  3 19:45:17 2004
@@ -30,7 +30,7 @@
 #define ZFCP_LOG_AREA			ZFCP_LOG_AREA_SCSI
 #define ZFCP_LOG_AREA_PREFIX		ZFCP_LOG_AREA_PREFIX_SCSI
 /* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_SCSI_REVISION "$Revision: 1.38 $"
+#define ZFCP_SCSI_REVISION "$Revision: 1.42 $"
 
 #include <linux/blkdev.h>
 
@@ -225,99 +225,6 @@
 	}
 }
 
-/*
- * function:    zfcp_scsi_insert_into_fake_queue
- *
- * purpose:
- *		
- *
- * returns:
- *
- * FIXME:	Is the following scenario possible and - even more interesting -
- *		a problem? It reminds me of the famous 'no retry for tape' fix
- *		(no problem for disks, but what is about tapes...)
- *
- *		device is unaccessable,
- *		command A is put into the fake queue,
- *		device becomes accessable again,
- *		command B is queued to the device,
- *		fake queue timer expires
- *		command A is returned to the mid-layer
- *		command A is queued to the device
- */
-void
-zfcp_scsi_insert_into_fake_queue(struct zfcp_adapter *adapter,
-				 Scsi_Cmnd * new_cmnd)
-{
-	unsigned long flags;
-	Scsi_Cmnd *current_cmnd;
-
-	ZFCP_LOG_DEBUG("Faking SCSI command:\n");
-	ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
-		      (char *) new_cmnd->cmnd, new_cmnd->cmd_len);
-
-	new_cmnd->host_scribble = NULL;
-
-	write_lock_irqsave(&adapter->fake_list_lock, flags);
-	if (adapter->first_fake_cmnd == NULL) {
-		adapter->first_fake_cmnd = new_cmnd;
-		adapter->fake_scsi_timer.function =
-		    zfcp_scsi_process_and_clear_fake_queue;
-		adapter->fake_scsi_timer.data = (unsigned long) adapter;
-		adapter->fake_scsi_timer.expires =
-		    jiffies + ZFCP_FAKE_SCSI_COMPLETION_TIME;
-		add_timer(&adapter->fake_scsi_timer);
-	} else {
-		for (current_cmnd = adapter->first_fake_cmnd;
-		     current_cmnd->host_scribble != NULL;
-		     current_cmnd =
-		     (Scsi_Cmnd *) (current_cmnd->host_scribble)) ;
-		current_cmnd->host_scribble = (char *) new_cmnd;
-	}
-	write_unlock_irqrestore(&adapter->fake_list_lock, flags);
-}
-
-/*
- * function:    zfcp_scsi_process_and_clear_fake_queue
- *
- * purpose:
- *		
- *
- * returns:
- */
-void
-zfcp_scsi_process_and_clear_fake_queue(unsigned long data)
-{
-	unsigned long flags;
-	struct zfcp_adapter *adapter = (struct zfcp_adapter *) data;
-	Scsi_Cmnd *cur = adapter->first_fake_cmnd;
-	Scsi_Cmnd *next;
-
-	/*
-	 * We need a common lock for scsi_req on command completion
-	 * as well as on command abort to avoid race conditions
-	 * during completions and aborts taking place at the same time.
-	 * It needs to be the outer lock as in the eh_abort_handler.
-	 */
-	read_lock_irqsave(&adapter->abort_lock, flags);
-	write_lock(&adapter->fake_list_lock);
-	while (cur) {
-		next = (Scsi_Cmnd *) cur->host_scribble;
-		cur->host_scribble = NULL;
-		zfcp_cmd_dbf_event_scsi("clrfake", cur);
-		cur->scsi_done(cur);
-		cur = next;
-#ifdef ZFCP_DEBUG_REQUESTS
-		debug_text_event(adapter->req_dbf, 2, "fk_done:");
-		debug_event(adapter->req_dbf, 2, &cur, sizeof (unsigned long));
-#endif
-	}
-	adapter->first_fake_cmnd = NULL;
-	write_unlock(&adapter->fake_list_lock);
-	read_unlock_irqrestore(&adapter->abort_lock, flags);
-	return;
-}
-
 void
 zfcp_scsi_block_requests(struct Scsi_Host *shpnt)
 {
@@ -383,25 +290,6 @@
 	return 0;
 }
 
-/* Sends command on a round-trip using SCSI stack */
-static void
-zfcp_scsi_queuecommand_fake(Scsi_Cmnd * scpnt, struct zfcp_adapter *adapter)
-{
-	ZFCP_LOG_DEBUG("Looping SCSI IO on the adapter %s.\n",
-		       zfcp_get_busid_by_adapter(adapter));
-	/* 
-	 * Reset everything for devices with retries, allow at least one retry
-	 * for others, e.g. tape.
-	 */
-	scpnt->retries = 0;
-	if (scpnt->allowed == 1) {
-		scpnt->allowed = 2;
-	}
-	set_host_byte(&scpnt->result, DID_SOFT_ERROR);
-	set_driver_byte(&scpnt->result, SUGGEST_RETRY);
-	zfcp_scsi_insert_into_fake_queue(adapter, scpnt);
-}
-
 /* Complete a command immediately handing back DID_ERROR */
 static void
 zfcp_scsi_queuecommand_stop(Scsi_Cmnd * scpnt,
@@ -460,10 +348,12 @@
 int
 zfcp_scsi_queuecommand(Scsi_Cmnd * scpnt, void (*done) (Scsi_Cmnd *))
 {
+	int retval;
 	int temp_ret;
 	struct zfcp_unit *unit;
 	struct zfcp_adapter *adapter;
 
+	retval = 0;
 	/* reset the status for this request */
 	scpnt->result = 0;
 	/* save address of mid layer call back function */
@@ -475,47 +365,38 @@
 	 */
 	adapter = (struct zfcp_adapter *) scpnt->device->host->hostdata[0];
 	/* NULL when the adapter was removed from the zfcp list */
-	if (adapter == NULL) {
+	if (unlikely(adapter == NULL)) {
 		zfcp_scsi_queuecommand_stop(scpnt, NULL, NULL);
 		goto out;
 	}
 
-	/* set when we have a unit/port list modification */
-	if (atomic_test_mask(ZFCP_STATUS_ADAPTER_QUEUECOMMAND_BLOCK,
-			     &adapter->status)) {
-		zfcp_scsi_queuecommand_fake(scpnt, adapter);
-		goto out;
-	}
-
 	unit = zfcp_scsi_determine_unit(adapter, scpnt);
-	if (unit == NULL)
+	if (unlikely(unit == NULL))
 		goto out;
 
-	if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &unit->status)
-	    || !atomic_test_mask(ZFCP_STATUS_COMMON_RUNNING, &unit->status)) {
+	if (unlikely(
+	      atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &unit->status) ||
+	     !atomic_test_mask(ZFCP_STATUS_COMMON_RUNNING, &unit->status))) {
 		zfcp_scsi_queuecommand_stop(scpnt, adapter, unit);
 		goto out;
 	}
-	if (!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status)) {
+	if (unlikely(
+	     !atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status))) {
 		ZFCP_LOG_DEBUG("adapter %s not ready or unit with LUN 0x%Lx "
 			       "on the port with WWPN 0x%Lx in recovery.\n",
 			       zfcp_get_busid_by_adapter(adapter),
 			       unit->fcp_lun, unit->port->wwpn);
-		zfcp_scsi_queuecommand_fake(scpnt, adapter);
+		retval = SCSI_MLQUEUE_DEVICE_BUSY;
 		goto out;
 	}
 
-	atomic_inc(&adapter->scsi_reqs_active);
-
 	temp_ret = zfcp_fsf_send_fcp_command_task(adapter,
 						  unit,
 						  scpnt, ZFCP_REQ_AUTO_CLEANUP);
 
-	if (temp_ret < 0) {
+	if (unlikely(temp_ret < 0)) {
 		ZFCP_LOG_DEBUG("error: Could not send a Send FCP Command\n");
-		atomic_dec(&adapter->scsi_reqs_active);
-		wake_up(&adapter->scsi_reqs_active_wq);
-		zfcp_scsi_queuecommand_fake(scpnt, adapter);
+		retval = SCSI_MLQUEUE_HOST_BUSY;
 	} else {
 #ifdef ZFCP_DEBUG_REQUESTS
 		debug_text_event(adapter->req_dbf, 3, "q_scpnt");
@@ -524,7 +405,7 @@
 #endif				/* ZFCP_DEBUG_REQUESTS */
 	}
  out:
-	return 0;
+	return retval;
 }
 
 /*
@@ -557,45 +438,6 @@
 }
 
 /*
- * function:    zfcp_scsi_potential_abort_on_fake
- *
- * purpose:
- *
- * returns:     0 - no fake request aborted
- *              1 - fake request was aborted
- *
- * context:	both the adapter->abort_lock and the 
- *              adapter->fake_list_lock are assumed to be held write lock
- *              irqsave
- */
-int
-zfcp_scsi_potential_abort_on_fake(struct zfcp_adapter *adapter,
-				  Scsi_Cmnd * cmnd)
-{
-	Scsi_Cmnd *cur = adapter->first_fake_cmnd;
-	Scsi_Cmnd *pre = NULL;
-	int retval = 0;
-
-	while (cur) {
-		if (cur == cmnd) {
-			if (pre)
-				pre->host_scribble = cur->host_scribble;
-			else
-				adapter->first_fake_cmnd =
-				    (Scsi_Cmnd *) cur->host_scribble;
-			cur->host_scribble = NULL;
-			if (!adapter->first_fake_cmnd)
-				del_timer(&adapter->fake_scsi_timer);
-			retval = 1;
-			break;
-		}
-		pre = cur;
-		cur = (Scsi_Cmnd *) cur->host_scribble;
-	}
-	return retval;
-}
-
-/*
  * function:	zfcp_scsi_eh_abort_handler
  *
  * purpose:	tries to abort the specified (timed out) SCSI command
@@ -663,34 +505,12 @@
 	 * Race condition between normal (late) completion and abort has
 	 * to be avoided.
 	 * The entirity of all accesses to scsi_req have to be atomic.
-	 * scsi_req is usually part of the fsf_req (for requests which
-	 * are not faked) and thus we block the release of fsf_req
-	 * as long as we need to access scsi_req.
-	 * For faked commands we use the same lock even if they are not
-	 * put into the fsf_req queue. This makes implementation
-	 * easier. 
+	 * scsi_req is usually part of the fsf_req and thus we block the
+	 * release of fsf_req as long as we need to access scsi_req.
 	 */
 	write_lock_irqsave(&adapter->abort_lock, flags);
 
 	/*
-	 * Check if we deal with a faked command, which we may just forget
-	 * about from now on
-	 */
-	write_lock(&adapter->fake_list_lock);
-	/* only need to go through list if there are faked requests */
-	if (adapter->first_fake_cmnd != NULL) {
-		if (zfcp_scsi_potential_abort_on_fake(adapter, scpnt)) {
-			write_unlock(&adapter->fake_list_lock);
-			write_unlock_irqrestore(&adapter->abort_lock, flags);
-			ZFCP_LOG_INFO("A faked command was aborted\n");
-			retval = SUCCESS;
-			strncpy(dbf_result, "##faked", ZFCP_ABORT_DBF_LENGTH);
-			goto out;
-		}
-	}
-	write_unlock(&adapter->fake_list_lock);
-
-	/*
 	 * Check whether command has just completed and can not be aborted.
 	 * Even if the command has just been completed late, we can access
 	 * scpnt since the SCSI stack does not release it at least until
@@ -845,11 +665,6 @@
 
 	spin_unlock_irq(scsi_host->host_lock);
 
-	/*
-	 * We should not be called to reset a target which we 'sent' faked SCSI
-	 * commands since the abort of faked SCSI commands should always
-	 * succeed (simply delete timer). 
-	 */
 	if (!unit) {
 		ZFCP_LOG_NORMAL("bug: Tried to reset a non existant unit.\n");
 		retval = SUCCESS;
@@ -1023,7 +838,6 @@
 		retval = -EIO;
 		goto out;
 	}
-	atomic_set_mask(ZFCP_STATUS_ADAPTER_REGISTERED, &adapter->status);
 	ZFCP_LOG_DEBUG("host registered, scsi_host at 0x%lx\n",
 		       (unsigned long) adapter->scsi_host);
 
@@ -1039,7 +853,12 @@
 	 */
 	adapter->scsi_host->hostdata[0] = (unsigned long) adapter;
 
-	scsi_add_host(adapter->scsi_host, &adapter->ccw_device->dev);
+	if (scsi_add_host(adapter->scsi_host, &adapter->ccw_device->dev)) {
+		scsi_host_put(adapter->scsi_host);
+		retval = -EIO;
+		goto out;
+	}
+	atomic_set_mask(ZFCP_STATUS_ADAPTER_REGISTERED, &adapter->status);
  out:
 	return retval;
 }
@@ -1061,8 +880,9 @@
 		return;
 	scsi_remove_host(shost);
 	scsi_host_put(shost);
-
 	adapter->scsi_host = NULL;
+	atomic_clear_mask(ZFCP_STATUS_ADAPTER_REGISTERED, &adapter->status);
+
 	return;
 }
 
diff -Nru a/drivers/s390/scsi/zfcp_sysfs_adapter.c b/drivers/s390/scsi/zfcp_sysfs_adapter.c
--- a/drivers/s390/scsi/zfcp_sysfs_adapter.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/s390/scsi/zfcp_sysfs_adapter.c	Tue Feb  3 19:45:16 2004
@@ -25,7 +25,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#define ZFCP_SYSFS_ADAPTER_C_REVISION "$Revision: 1.21 $"
+#define ZFCP_SYSFS_ADAPTER_C_REVISION "$Revision: 1.26 $"
 
 #include <asm/ccwdev.h>
 #include "zfcp_ext.h"
@@ -155,11 +155,8 @@
 
 	retval = 0;
 
-	zfcp_adapter_get(adapter);
-
-	/* try to open port only if adapter is online */
-	if (adapter->ccw_device->online == 1)
-		zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED);
+	zfcp_erp_port_reopen(port, 0);
+	zfcp_erp_wait(port->adapter);
 	zfcp_port_put(port);
  out:
 	up(&zfcp_data.config_sema);
@@ -219,6 +216,8 @@
 	zfcp_erp_port_shutdown(port, 0);
 	zfcp_erp_wait(adapter);
 	zfcp_port_put(port);
+	zfcp_sysfs_port_remove_files(&port->sysfs_device,
+				     atomic_read(&port->status));
 	device_unregister(&port->sysfs_device);
  out:
 	up(&zfcp_data.config_sema);
@@ -268,6 +267,7 @@
 	zfcp_erp_modify_adapter_status(adapter, ZFCP_STATUS_COMMON_RUNNING,
 				       ZFCP_SET);
 	zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED);
+	zfcp_erp_wait(adapter);
  out:
 	up(&zfcp_data.config_sema);
 	return retval ? retval : count;
diff -Nru a/drivers/s390/scsi/zfcp_sysfs_port.c b/drivers/s390/scsi/zfcp_sysfs_port.c
--- a/drivers/s390/scsi/zfcp_sysfs_port.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/s390/scsi/zfcp_sysfs_port.c	Tue Feb  3 19:45:42 2004
@@ -25,7 +25,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#define ZFCP_SYSFS_PORT_C_REVISION "$Revision: 1.26 $"
+#define ZFCP_SYSFS_PORT_C_REVISION "$Revision: 1.32 $"
 
 #include <linux/init.h>
 #include <linux/module.h>
@@ -110,11 +110,9 @@
 
 	retval = 0;
 
-	zfcp_port_get(port);
-
-	/* try to open unit only if adapter is online */
-	if (port->adapter->ccw_device->online == 1)
-		zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED);
+	zfcp_erp_unit_reopen(unit, 0);
+	zfcp_erp_wait(unit->port->adapter);
+	wait_event(unit->scsi_add_wq, atomic_read(&unit->scsi_add_work) == 0);
 	zfcp_unit_put(unit);
  out:
 	up(&zfcp_data.config_sema);
@@ -170,6 +168,7 @@
 	zfcp_erp_unit_shutdown(unit, 0);
 	zfcp_erp_wait(unit->port->adapter);
 	zfcp_unit_put(unit);
+	zfcp_sysfs_unit_remove_files(&unit->sysfs_device);
 	device_unregister(&unit->sysfs_device);
  out:
 	up(&zfcp_data.config_sema);
@@ -217,6 +216,7 @@
 	}
 	zfcp_erp_modify_port_status(port, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET);
 	zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED);
+	zfcp_erp_wait(port->adapter);
  out:
 	up(&zfcp_data.config_sema);
 	return retval ? retval : count;
@@ -293,7 +293,7 @@
 };
 
 /**
- * zfcp_sysfs_create_port_files - create sysfs port files
+ * zfcp_sysfs_port_create_files - create sysfs port files
  * @dev: pointer to belonging device
  *
  * Create all attributes of the sysfs representation of a port.
@@ -313,6 +313,20 @@
 		sysfs_remove_group(&dev->kobj, &zfcp_port_common_attr_group);
 
 	return retval;
+}
+
+/**
+ * zfcp_sysfs_port_remove_files - remove sysfs port files
+ * @dev: pointer to belonging device
+ *
+ * Remove all attributes of the sysfs representation of a port.
+ */
+void
+zfcp_sysfs_port_remove_files(struct device *dev, u32 flags)
+{
+	sysfs_remove_group(&dev->kobj, &zfcp_port_common_attr_group);
+	if (!(flags & ZFCP_STATUS_PORT_NAMESERVER))
+		sysfs_remove_group(&dev->kobj, &zfcp_port_no_ns_attr_group);
 }
 
 #undef ZFCP_LOG_AREA
diff -Nru a/drivers/s390/scsi/zfcp_sysfs_unit.c b/drivers/s390/scsi/zfcp_sysfs_unit.c
--- a/drivers/s390/scsi/zfcp_sysfs_unit.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/s390/scsi/zfcp_sysfs_unit.c	Tue Feb  3 19:45:17 2004
@@ -25,7 +25,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#define ZFCP_SYSFS_UNIT_C_REVISION "$Revision: 1.17 $"
+#define ZFCP_SYSFS_UNIT_C_REVISION "$Revision: 1.19 $"
 
 #include <linux/init.h>
 #include <linux/module.h>
@@ -184,6 +184,18 @@
 zfcp_sysfs_unit_create_files(struct device *dev)
 {
 	return sysfs_create_group(&dev->kobj, &zfcp_unit_attr_group);
+}
+
+/** 
+ * zfcp_sysfs_remove_unit_files - remove sysfs unit files
+ * @dev: pointer to belonging device
+ *
+ * Remove all attributes of the sysfs representation of a unit.
+ */
+void
+zfcp_sysfs_unit_remove_files(struct device *dev)
+{
+	sysfs_remove_group(&dev->kobj, &zfcp_unit_attr_group);
 }
 
 #undef ZFCP_LOG_AREA
diff -Nru a/drivers/sbus/char/rtc.c b/drivers/sbus/char/rtc.c
--- a/drivers/sbus/char/rtc.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/sbus/char/rtc.c	Tue Feb  3 19:45:17 2004
@@ -89,6 +89,7 @@
 	switch (cmd)
 	{
 	case RTCGET:
+		memset(&rtc_tm, 0, sizeof(struct rtc_time));
 		get_rtc_time(&rtc_tm);
 
 		if (copy_to_user((struct rtc_time*)arg, &rtc_tm, sizeof(struct rtc_time)))
diff -Nru a/drivers/scsi/53c7xx.c b/drivers/scsi/53c7xx.c
--- a/drivers/scsi/53c7xx.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/scsi/53c7xx.c	Tue Feb  3 19:45:43 2004
@@ -1102,8 +1102,8 @@
 }
 
 /* 
- * Function : static int ncr53c7xx_init(Scsi_Host_Template *tpnt, int board, 
- *	int chip, u32 base, int io_port, int irq, int dma, long long options,
+ * Function : int ncr53c7xx_init(Scsi_Host_Template *tpnt, int board, int chip,
+ *	unsigned long base, int io_port, int irq, int dma, long long options,
  *	int clock);
  *
  * Purpose : initializes a NCR53c7,8x0 based on base addresses,
diff -Nru a/drivers/scsi/53c7xx.h b/drivers/scsi/53c7xx.h
--- a/drivers/scsi/53c7xx.h	Tue Feb  3 19:45:16 2004
+++ b/drivers/scsi/53c7xx.h	Tue Feb  3 19:45:16 2004
@@ -1600,5 +1600,9 @@
 /* Paranoid people could use panic() here. */
 #define FATAL(host) shutdown((host));
 
+extern int ncr53c7xx_init(Scsi_Host_Template *tpnt, int board, int chip,
+			  unsigned long base, int io_port, int irq, int dma,
+			  long long options, int clock);
+
 #endif /* NCR53c710_C */
 #endif /* NCR53c710_H */
diff -Nru a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
--- a/drivers/scsi/Kconfig	Tue Feb  3 19:45:42 2004
+++ b/drivers/scsi/Kconfig	Tue Feb  3 19:45:42 2004
@@ -1210,6 +1210,8 @@
 	  To compile this driver as a module, choose M here: the
 	  module will be called qlogicpti.
 
+source "drivers/scsi/qla2xxx/Kconfig"
+
 config SCSI_SEAGATE
 	tristate "Seagate ST-02 and Future Domain TMC-8xx SCSI support"
 	depends on X86 && ISA && SCSI && BROKEN
@@ -1388,7 +1390,7 @@
 
 config SCSI_NSP32
 	tristate "Workbit NinjaSCSI-32Bi/UDE support"
-	depends on PCI && SCSI
+	depends on PCI && SCSI && !64BIT
 	help
 	  This is support for the Workbit NinjaSCSI-32Bi/UDE PCI/Cardbus
 	  SCSI host adapter. Please read the SCSI-HOWTO, available from
@@ -1473,12 +1475,6 @@
 	  To compile this driver as a module, choose M here: the
 	  module will be called wd33c93.
 
-config A4000T_SCSI
-	bool "A4000T SCSI support (EXPERIMENTAL)"
-	depends on AMIGA && SCSI && EXPERIMENTAL && BROKEN
-	help
-	  Support for the NCR53C710 SCSI controller on the Amiga 4000T.
-
 config A2091_SCSI
 	tristate "A2091/A590 WD33C93A support"
 	depends on ZORRO && SCSI
@@ -1541,28 +1537,24 @@
 	  If you have the Phase5 Fastlane Z3 SCSI controller, or plan to use
 	  one in the near future, say Y to this question. Otherwise, say N.
 
-config A4091_SCSI
-	bool "A4091 SCSI support (EXPERIMENTAL)"
-	depends on ZORRO && SCSI && EXPERIMENTAL && BROKEN
-	help
-	  Support for the NCR53C710 chip on the Amiga 4091 Z3 SCSI2 controller
-	  (1993).  Very obscure -- the 4091 was part of an Amiga 4000 upgrade
-	  plan at the time the Amiga business was sold to DKB.
-
-config WARPENGINE_SCSI
-	bool "WarpEngine SCSI support (EXPERIMENTAL)"
-	depends on ZORRO && SCSI && EXPERIMENTAL && BROKEN
-	help
-	  Support for MacroSystem Development's WarpEngine Amiga SCSI-2
-	  controller. Info at
-	  <http://www.lysator.liu.se/amiga/ar/guide/ar310.guide?FEATURE5>.
-
-config BLZ603EPLUS_SCSI
-	bool "Blizzard PowerUP 603e+ SCSI (EXPERIMENTAL)"
-	depends on ZORRO && SCSI && EXPERIMENTAL && BROKEN
+config SCSI_AMIGA7XX
+	bool "Amiga NCR53c710 SCSI support (EXPERIMENTAL)"
+	depends on AMIGA && SCSI && EXPERIMENTAL && BROKEN
 	help
-	  If you have an Amiga 1200 with a Phase5 Blizzard PowerUP 603e+
-	  accelerator, say Y. Otherwise, say N.
+	  Support for various NCR53c710-based SCSI controllers on the Amiga.
+	  This includes:
+	    - the builtin SCSI controller on the Amiga 4000T,
+	    - the Amiga 4091 Zorro III SCSI-2 controller,
+	    - the MacroSystem Development's WarpEngine Amiga SCSI-2 controller
+	      (info at
+	      <http://www.lysator.liu.se/amiga/ar/guide/ar310.guide?FEATURE5>),
+	    - the SCSI controller on the Phase5 Blizzard PowerUP 603e+
+	      accelerator card for the Amiga 1200,
+	    - the SCSI controller on the GVP Turbo 040/060 accelerator.
+	  Note that all of the above SCSI controllers, except for the builtin
+	  SCSI controller on the Amiga 4000T, reside on the Zorro expansion
+	  bus, so you also have to enable Zorro bus support if you want to use
+	  them.
 
 config OKTAGON_SCSI
 	tristate "BSC Oktagon SCSI support (EXPERIMENTAL)"
@@ -1571,7 +1563,7 @@
 	  If you have the BSC Oktagon SCSI disk controller for the Amiga, say
 	  Y to this question.  If you're in doubt about whether you have one,
 	  see the picture at
-	  <http://amiga.multigraph.com/photos/oktagon.html>.
+	  <http://amiga.resource.cx/exp/search.pl?product=oktagon>.
 
 config ATARI_SCSI
 	tristate "Atari native SCSI support"
@@ -1660,7 +1652,7 @@
 
 config SCSI_NCR53C7xx_FAST
 	bool "allow FAST-SCSI [10MHz]"
-	depends on A4000T_SCSI || A4091_SCSI || BLZ603EPLUS_SCSI || WARPENGINE_SCSI || MVME16x_SCSI || BVME6000_SCSI
+	depends on SCSI_AMIGA7XX || MVME16x_SCSI || BVME6000_SCSI
 	help
 	  This will enable 10MHz FAST-SCSI transfers with your host
 	  adapter. Some systems have problems with that speed, so it's safest
@@ -1706,7 +1698,6 @@
 	default y
 
 #      bool 'Cyberstorm Mk III SCSI support (EXPERIMENTAL)' CONFIG_CYBERSTORMIII_SCSI
-#      bool 'GVP Turbo 040/060 SCSI support (EXPERIMENTAL)' CONFIG_GVP_TURBO_SCSI
 
 config ZFCP
 	tristate "IBM z900 OpenFCP/SCSI support"
diff -Nru a/drivers/scsi/Makefile b/drivers/scsi/Makefile
--- a/drivers/scsi/Makefile	Tue Feb  3 19:45:40 2004
+++ b/drivers/scsi/Makefile	Tue Feb  3 19:45:40 2004
@@ -22,10 +22,7 @@
 
 obj-$(CONFIG_SCSI)		+= scsi_mod.o
 
-obj-$(CONFIG_A4000T_SCSI)	+= amiga7xx.o	53c7xx.o
-obj-$(CONFIG_A4091_SCSI)	+= amiga7xx.o	53c7xx.o
-obj-$(CONFIG_BLZ603EPLUS_SCSI)	+= amiga7xx.o	53c7xx.o
-obj-$(CONFIG_WARPENGINE_SCSI)	+= amiga7xx.o	53c7xx.o
+obj-$(CONFIG_SCSI_AMIGA7XX)	+= amiga7xx.o	53c7xx.o
 obj-$(CONFIG_A3000_SCSI)	+= a3000.o	wd33c93.o
 obj-$(CONFIG_A2091_SCSI)	+= a2091.o	wd33c93.o
 obj-$(CONFIG_GVP11_SCSI)	+= gvp11.o	wd33c93.o
@@ -74,6 +71,7 @@
 obj-$(CONFIG_SCSI_QLOGIC_ISP)	+= qlogicisp.o 
 obj-$(CONFIG_SCSI_QLOGIC_FC)	+= qlogicfc.o 
 obj-$(CONFIG_SCSI_QLOGIC_1280)	+= qla1280.o 
+obj-$(CONFIG_SCSI_QLA2XXX)	+= qla2xxx/
 obj-$(CONFIG_SCSI_PAS16)	+= pas16.o
 obj-$(CONFIG_SCSI_SEAGATE)	+= seagate.o
 obj-$(CONFIG_SCSI_FD_8xx)	+= seagate.o
diff -Nru a/drivers/scsi/NCR53C9x.h b/drivers/scsi/NCR53C9x.h
--- a/drivers/scsi/NCR53C9x.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/scsi/NCR53C9x.h	Tue Feb  3 19:45:17 2004
@@ -652,8 +652,7 @@
 
 
 /* External functions */
-extern inline void esp_cmd(struct NCR_ESP *esp, struct ESP_regs *eregs,
-			   unchar cmd);
+extern void esp_cmd(struct NCR_ESP *esp, struct ESP_regs *eregs, unchar cmd);
 extern struct NCR_ESP *esp_allocate(Scsi_Host_Template *, void *);
 extern void esp_deallocate(struct NCR_ESP *);
 extern void esp_release(void);
diff -Nru a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
--- a/drivers/scsi/aacraid/aachba.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/scsi/aacraid/aachba.c	Tue Feb  3 19:45:17 2004
@@ -1427,6 +1427,7 @@
 		flag = SRB_DataIn;
 		break;
 	case DMA_NONE:
+	default:	/* shuts up some versions of gcc */
 		flag = SRB_NoDataXfer;
 		break;
 	}
diff -Nru a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
--- a/drivers/scsi/aacraid/aacraid.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/scsi/aacraid/aacraid.h	Tue Feb  3 19:45:17 2004
@@ -525,7 +525,15 @@
 	char *	vname;
 	char *	model;
 	u16	channels;
+	int	quirks;
 };
+/*
+ * Some adapter firmware needs communication memory 
+ * below 2gig. This tells the init function to set the
+ * dma mask such that fib memory will be allocated where the
+ * adapter firmware can get to it.
+ */
+#define AAC_QUIRK_31BIT	1
 
 /*
  *	The adapter interface specs all queues to be located in the same
diff -Nru a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
--- a/drivers/scsi/aacraid/linit.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/scsi/aacraid/linit.c	Tue Feb  3 19:45:17 2004
@@ -119,22 +119,22 @@
  * for the card.  At that time we can remove the channels from here
  */
 static struct aac_driver_ident aac_drivers[] = {
-	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2 }, /* PERC 2/Si */
-	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2 }, /* PERC 3/Di */
-	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2 }, /* PERC 3/Si */
-	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2 }, /* PERC 3/Si */
-	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2 }, /* PERC 3/Di */
-	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2 }, /* PERC 3/Di */
-	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2 }, /* PERC 3/Di */
-	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2 }, /* PERC 3/Di */
-	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2 }, /* PERC 3/Di */
-	{ aac_rx_init, "aacraid",  "ADAPTEC ", "catapult        ", 2 }, /* catapult*/
-	{ aac_rx_init, "aacraid",  "ADAPTEC ", "tomcat          ", 2 }, /* tomcat*/
-	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 2120S   ", 1 }, /* Adaptec 2120S (Crusader)*/
-	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 2200S   ", 2 }, /* Adaptec 2200S (Vulcan)*/
-	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 2200S   ", 2 }, /* Adaptec 2200S (Vulcan-2m)*/
-	{ aac_rx_init, "aacraid",  "Legend  ", "Legend S220     ", 1 }, /* Legend S220*/
-	{ aac_rx_init, "aacraid",  "Legend  ", "Legend S230     ", 2 }, /* Legend S230*/
+	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT }, /* PERC 2/Si */
+	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT }, /* PERC 3/Di */
+	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT }, /* PERC 3/Si */
+	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT }, /* PERC 3/Si */
+	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT }, /* PERC 3/Di */
+	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT }, /* PERC 3/Di */
+	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT }, /* PERC 3/Di */
+	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT }, /* PERC 3/Di */
+	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT }, /* PERC 3/Di */
+	{ aac_rx_init, "aacraid",  "ADAPTEC ", "catapult        ", 2, AAC_QUIRK_31BIT }, /* catapult*/
+	{ aac_rx_init, "aacraid",  "ADAPTEC ", "tomcat          ", 2, AAC_QUIRK_31BIT }, /* tomcat*/
+	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 2120S   ", 1, AAC_QUIRK_31BIT }, /* Adaptec 2120S (Crusader)*/
+	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 2200S   ", 2, AAC_QUIRK_31BIT }, /* Adaptec 2200S (Vulcan)*/
+	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 2200S   ", 2, AAC_QUIRK_31BIT }, /* Adaptec 2200S (Vulcan-2m)*/
+	{ aac_rx_init, "aacraid",  "Legend  ", "Legend S220     ", 1, AAC_QUIRK_31BIT }, /* Legend S220*/
+	{ aac_rx_init, "aacraid",  "Legend  ", "Legend S230     ", 2, AAC_QUIRK_31BIT }, /* Legend S230*/
 
 	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 3230S   ", 2 }, /* Adaptec 3230S (Harrier)*/
 	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 3240S   ", 2 }, /* Adaptec 3240S (Tornado)*/
@@ -144,10 +144,10 @@
 	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec         ", 2 }, /* (Marco)*/
 	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec         ", 2 }, /* (Sebring)*/
 
-	{ aac_rx_init, "percraid", "DELL    ", "PERC 320/DC     ", 2 }, /* Perc 320/DC*/
+	{ aac_rx_init, "percraid", "DELL    ", "PERC 320/DC     ", 2, AAC_QUIRK_31BIT }, /* Perc 320/DC*/
 	{ aac_sa_init, "aacraid",  "ADAPTEC ", "Adaptec 5400S   ", 4 }, /* Adaptec 5400S (Mustang)*/
 	{ aac_sa_init, "aacraid",  "ADAPTEC ", "AAC-364         ", 4 }, /* Adaptec 5400S (Mustang)*/
-	{ aac_sa_init, "percraid", "DELL    ", "PERCRAID        ", 4 }, /* Dell PERC2 "Quad Channel" */
+	{ aac_sa_init, "percraid", "DELL    ", "PERCRAID        ", 4, AAC_QUIRK_31BIT }, /* Dell PERC2 "Quad Channel" */
 	{ aac_sa_init, "hpnraid",  "HP      ", "NetRAID         ", 4 }  /* HP NetRAID-4M */
 };
 
@@ -407,8 +407,17 @@
 	if (pci_enable_device(pdev))
 		goto out;
 
-	if (pci_set_dma_mask(pdev, 0xFFFFFFFFULL))
+	if (pci_set_dma_mask(pdev, 0xFFFFFFFFULL) || 
+			pci_set_consistent_dma_mask(pdev, 0xFFFFFFFFULL))
 		goto out;
+	/*
+	 * If the quirk31 bit is set, the adapter needs adapter
+	 * to driver communication memory to be allocated below 2gig
+	 */
+	if (aac_drivers[index].quirks & AAC_QUIRK_31BIT) 
+		if (pci_set_dma_mask(pdev, 0x7FFFFFFFULL) ||
+				pci_set_consistent_dma_mask(pdev, 0x7FFFFFFFULL))
+			goto out;
 	
 	pci_set_master(pdev);
 
@@ -442,6 +451,15 @@
 
 	if ((*aac_drivers[index].init)(aac , shost->unique_id))
 		goto out_free_fibs;
+
+	/*
+	 * If we had set a smaller DMA mask earlier, set it to 4gig
+	 * now since the adapter can dma data to at least a 4gig
+	 * address space.
+	 */
+	if (aac_drivers[index].quirks & AAC_QUIRK_31BIT)
+		if (pci_set_dma_mask(pdev, 0xFFFFFFFFULL))
+			goto out_free_fibs;
 
 	aac_get_adapter_info(aac);
 
diff -Nru a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
--- a/drivers/scsi/aha152x.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/scsi/aha152x.c	Tue Feb  3 19:45:16 2004
@@ -860,9 +860,6 @@
 {
 	int i;
 
-	if (check_region(io_port, IO_RANGE))
-		return 0;
-
 	SETPORT(io_port + O_DMACNTRL1, 0);	/* reset stack pointer */
 	for (i = 0; i < 16; i++)
 		SETPORT(io_port + O_STACK, i);
@@ -878,9 +875,6 @@
 {
 	int i;
 
-	if (check_region(io_port, IO_RANGE))
-		return 0;
-
 	SETPORT(io_port + O_TC_DMACNTRL1, 0);	/* reset stack pointer */
 	for (i = 0; i < 16; i++)
 		SETPORT(io_port + O_STACK, i);
@@ -903,13 +897,20 @@
 	if (i == ARRAY_SIZE(ports))
 		return 0;
 #endif
+	if (!request_region(setup->io_port, IO_RANGE, "aha152x"))
+		return 0;
 
 	if(aha152x_porttest(setup->io_port)) {
-          setup->tc1550=0;
+		setup->tc1550=0;
         } else if(tc1550_porttest(setup->io_port)) {
-          setup->tc1550=1;
-        } else
-          return 0;
+		setup->tc1550=1;
+	} else {
+		release_region(setup->io_port, IO_RANGE);
+		return 0;
+	}
+
+	release_region(setup->io_port, IO_RANGE);
+
 
 	if ((setup->irq < IRQ_MIN) || (setup->irq > IRQ_MAX))
 		return 0;
@@ -965,7 +966,7 @@
 {
 	struct Scsi_Host *shpnt;
 
-	shpnt = scsi_register(&aha152x_driver_template, sizeof(struct aha152x_hostdata));
+	shpnt = scsi_host_alloc(&aha152x_driver_template, sizeof(struct aha152x_hostdata));
 	if (!shpnt) {
 		printk(KERN_ERR "aha152x: scsi_register failed\n");
 		return NULL;
@@ -1080,6 +1081,9 @@
 		printk(KERN_ERR "aha152x%d: failed to reassign interrupt.\n", shpnt->host_no);
 		goto out_unregister_host;
 	}
+
+	scsi_add_host(shpnt, 0);
+	scsi_scan_host(shpnt);
 	return shpnt;	/* the pcmcia stub needs the return value; */
 
 out_unregister_host:
@@ -1087,11 +1091,11 @@
 out_release_region:
 	release_region(shpnt->io_port, IO_RANGE);
 out_unregister:
-	scsi_unregister(shpnt);
+	scsi_host_put(shpnt);
 	return NULL;
 }
 
-static int aha152x_detect(Scsi_Host_Template * tpnt)
+static int __init aha152x_init(void)
 {
 	int i, j, ok;
 #if defined(AUTOCONF)
@@ -1360,7 +1364,6 @@
 	return registered_count>0;
 }
 
-
 static int aha152x_release(struct Scsi_Host *shpnt)
 {
 	if (shpnt->irq)
@@ -1374,11 +1377,25 @@
 		pnp_device_detach(HOSTDATA(shpnt)->pnpdev);
 #endif
 
-	scsi_unregister(shpnt);
+	scsi_host_put(shpnt);
 
 	return 0;
 }
 
+static void __exit aha152x_exit(void)
+{
+	int i;
+
+	for(i=0; i<ARRAY_SIZE(setup); i++) {
+		if(aha152x_host[i]) {
+			scsi_remove_host(aha152x_host[i]);
+			aha152x_release(aha152x_host[i]);
+			aha152x_host[i]=0;
+		}
+	}
+}
+
+
 /*
  * setup controller to generate interrupts depending
  * on current state (lock has to be acquired)
@@ -3880,26 +3897,24 @@
 }
 
 static Scsi_Host_Template aha152x_driver_template = {
-	.module			= THIS_MODULE,
-	.name			= AHA152X_REVID,
-	.proc_name		= "aha152x",
-	.proc_info		= aha152x_proc_info,
-	.detect			= aha152x_detect,
-	.queuecommand		= aha152x_queue,
-	.eh_abort_handler	= aha152x_abort,
-	.eh_device_reset_handler = aha152x_device_reset,
-	.eh_bus_reset_handler	= aha152x_bus_reset,
-	.eh_host_reset_handler	= aha152x_host_reset,
-	.release		= aha152x_release,
-	.bios_param		= aha152x_biosparam,
-	.can_queue		= 1,
-	.this_id		= 7,
-	.sg_tablesize		= SG_ALL,
-	.cmd_per_lun		= 1,
-	.use_clustering		= DISABLE_CLUSTERING,
+	.module				= THIS_MODULE,
+	.name				= AHA152X_REVID,
+	.proc_name			= "aha152x",
+	.proc_info			= aha152x_proc_info,
+	.queuecommand			= aha152x_queue,
+	.eh_abort_handler		= aha152x_abort,
+	.eh_device_reset_handler	= aha152x_device_reset,
+	.eh_bus_reset_handler		= aha152x_bus_reset,
+	.eh_host_reset_handler		= aha152x_host_reset,
+	.bios_param			= aha152x_biosparam,
+	.can_queue			= 1,
+	.this_id			= 7,
+	.sg_tablesize			= SG_ALL,
+	.cmd_per_lun			= 1,
+	.use_clustering			= DISABLE_CLUSTERING,
 };
 
 #ifndef PCMCIA
-#define driver_template aha152x_driver_template
-#include "scsi_module.c"
+module_init(aha152x_init);
+module_exit(aha152x_exit);
 #endif
diff -Nru a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
--- a/drivers/scsi/aha1542.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/scsi/aha1542.c	Tue Feb  3 19:45:28 2004
@@ -67,10 +67,10 @@
 		       int nseg,
 		       int badseg)
 {
-	printk(KERN_CRIT "sgpnt[%d:%d] page %p/0x%x length %u\n",
+	printk(KERN_CRIT "sgpnt[%d:%d] page %p/0x%llx length %u\n",
 	       badseg, nseg,
 	       page_address(sgpnt[badseg].page) + sgpnt[badseg].offset,
-	       SCSI_SG_PA(&sgpnt[badseg]),
+	       (unsigned long long)SCSI_SG_PA(&sgpnt[badseg]),
 	       sgpnt[badseg].length);
 
 	/*
diff -Nru a/drivers/scsi/aic7xxx/Makefile b/drivers/scsi/aic7xxx/Makefile
--- a/drivers/scsi/aic7xxx/Makefile	Tue Feb  3 19:45:42 2004
+++ b/drivers/scsi/aic7xxx/Makefile	Tue Feb  3 19:45:42 2004
@@ -1,7 +1,7 @@
 #
 # Makefile for the Linux aic7xxx SCSI driver.
 #
-# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Makefile#7 $
+# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Makefile#8 $
 #
 
 # Let kbuild descend into aicasm when cleaning
@@ -61,6 +61,13 @@
 	-p $(obj)/aic7xxx_reg_print.c -i aic7xxx_osm.h
 
 ifeq ($(CONFIG_AIC7XXX_BUILD_FIRMWARE),y)
+# Create a dependency chain in generated files
+# to avoid concurrent invocations of the single
+# rule that builds them all.
+aic7xxx_seq.h: aic7xxx_reg.h
+ifeq ($(CONFIG_AIC7XXX_REG_PRETTY_PRINT),y)
+aic7xxx_reg.h: aic7xxx_reg_print.c
+endif
 $(aic7xxx-gen-y): $(src)/aic7xxx.seq $(src)/aic7xxx.reg $(obj)/aicasm/aicasm
 	$(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic7xxx_reg.h \
 			      $(aicasm-7xxx-opts-y) -o $(obj)/aic7xxx_seq.h \
@@ -75,6 +82,13 @@
 	-p $(obj)/aic79xx_reg_print.c -i aic79xx_osm.h
 
 ifeq ($(CONFIG_AIC79XX_BUILD_FIRMWARE),y)
+# Create a dependency chain in generated files
+# to avoid concurrent invocations of the single
+# rule that builds them all.
+aic79xx_seq.h: aic79xx_reg.h
+ifeq ($(CONFIG_AIC79XX_REG_PRETTY_PRINT),y)
+aic79xx_reg.h: aic79xx_reg_print.c
+endif
 $(aic79xx-gen-y): $(src)/aic79xx.seq $(src)/aic79xx.reg $(obj)/aicasm/aicasm
 	$(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic79xx_reg.h \
 			      $(aicasm-79xx-opts-y) -o $(obj)/aic79xx_seq.h \
diff -Nru a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c	Tue Feb  3 19:45:29 2004
@@ -1776,12 +1776,18 @@
 	 * our dma mask when doing allocations.
 	 */
 	if (ahd->dev_softc != NULL)
-		ahd_pci_set_dma_mask(ahd->dev_softc, 0xFFFFFFFF);
+		if (ahd_pci_set_dma_mask(ahd->dev_softc, 0xFFFFFFFF)) {
+			printk(KERN_WARNING "aic79xx: No suitable DMA available.\n");
+			return (ENODEV);
+		}
 	*vaddr = pci_alloc_consistent(ahd->dev_softc,
 				      dmat->maxsize, &map->bus_addr);
 	if (ahd->dev_softc != NULL)
-		ahd_pci_set_dma_mask(ahd->dev_softc,
-				     ahd->platform_data->hw_dma_mask);
+		if (ahd_pci_set_dma_mask(ahd->dev_softc,
+				     ahd->platform_data->hw_dma_mask)) {
+			printk(KERN_WARNING "aic79xx: No suitable DMA available.\n");
+			return (ENODEV);
+		}
 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) */
 	/*
 	 * At least in 2.2.14, malloc is a slab allocator so all
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c	Tue Feb  3 19:45:16 2004
@@ -1411,12 +1411,18 @@
 	 * our dma mask when doing allocations.
 	 */
 	if (ahc->dev_softc != NULL)
-		ahc_pci_set_dma_mask(ahc->dev_softc, 0xFFFFFFFF);
+		if (ahc_pci_set_dma_mask(ahc->dev_softc, 0xFFFFFFFF)) {
+			printk(KERN_WARNING "aic7xxx: No suitable DMA available.\n");
+			return (ENODEV);
+		}
 	*vaddr = pci_alloc_consistent(ahc->dev_softc,
 				      dmat->maxsize, &map->bus_addr);
 	if (ahc->dev_softc != NULL)
-		ahc_pci_set_dma_mask(ahc->dev_softc,
-				     ahc->platform_data->hw_dma_mask);
+		if (ahc_pci_set_dma_mask(ahc->dev_softc,
+				     ahc->platform_data->hw_dma_mask)) {
+			printk(KERN_WARNING "aic7xxx: No suitable DMA available.\n");
+			return (ENODEV);
+		}
 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) */
 	/*
 	 * At least in 2.2.14, malloc is a slab allocator so all
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
--- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c	Tue Feb  3 19:45:17 2004
@@ -166,7 +166,10 @@
 		ahc->flags |= AHC_39BIT_ADDRESSING;
 		ahc->platform_data->hw_dma_mask = mask_39bit;
 	} else {
-		ahc_pci_set_dma_mask(pdev, 0xFFFFFFFF);
+		if (ahc_pci_set_dma_mask(pdev, 0xFFFFFFFF)) {
+			printk(KERN_WARNING "aic7xxx: No suitable DMA available.\n");
+                	return (-ENODEV);
+		}
 		ahc->platform_data->hw_dma_mask = 0xFFFFFFFF;
 	}
 #endif
diff -Nru a/drivers/scsi/aic7xxx/aicasm/Makefile b/drivers/scsi/aic7xxx/aicasm/Makefile
--- a/drivers/scsi/aic7xxx/aicasm/Makefile	Tue Feb  3 19:45:41 2004
+++ b/drivers/scsi/aic7xxx/aicasm/Makefile	Tue Feb  3 19:45:41 2004
@@ -49,11 +49,19 @@
 clean:
 	rm -f $(clean-files)
 
+# Create a dependency chain in generated files
+# to avoid concurrent invocations of the single
+# rule that builds them all.
+aicasm_gram.c: aicasm_gram.h
 aicasm_gram.c aicasm_gram.h: aicasm_gram.y
 	$(YACC) $(YFLAGS) -b $(<:.y=) $<
 	mv $(<:.y=).tab.c $(<:.y=.c)
 	mv $(<:.y=).tab.h $(<:.y=.h)
 
+# Create a dependency chain in generated files
+# to avoid concurrent invocations of the single
+# rule that builds them all.
+aicasm_macro_gram.c: aicasm_macro_gram.h
 aicasm_macro_gram.c aicasm_macro_gram.h: aicasm_macro_gram.y
 	$(YACC) $(YFLAGS) -b $(<:.y=) -p mm $<
 	mv $(<:.y=).tab.c $(<:.y=.c)
diff -Nru a/drivers/scsi/aic7xxx_old/aic7xxx_proc.c b/drivers/scsi/aic7xxx_old/aic7xxx_proc.c
--- a/drivers/scsi/aic7xxx_old/aic7xxx_proc.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/scsi/aic7xxx_old/aic7xxx_proc.c	Tue Feb  3 19:45:42 2004
@@ -90,9 +90,7 @@
   unsigned char i;
   unsigned char tindex;
 
-  HBAptr = NULL;
-
-  for(p=first_aic7xxx; p->host != HBAptr; p=p->next)
+  for(p=first_aic7xxx; p && p->host != HBAptr; p=p->next)
     ;
 
   if (!p)
diff -Nru a/drivers/scsi/amiga7xx.c b/drivers/scsi/amiga7xx.c
--- a/drivers/scsi/amiga7xx.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/scsi/amiga7xx.c	Tue Feb  3 19:45:17 2004
@@ -1,6 +1,6 @@
 /*
  * Detection routine for the NCR53c710 based Amiga SCSI Controllers for Linux.
- *  		Amiga MacroSystemUS WarpEngine SCSI controller.
+ *		Amiga MacroSystemUS WarpEngine SCSI controller.
  *		Amiga Technologies A4000T SCSI controller.
  *		Amiga Technologies/DKB A4091 SCSI controller.
  *
@@ -14,13 +14,14 @@
 #include <linux/version.h>
 #include <linux/config.h>
 #include <linux/zorro.h>
+#include <linux/stat.h>
 
 #include <asm/setup.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
 #include <asm/amigaints.h>
 #include <asm/amigahw.h>
-
+#include <asm/dma.h>
 #include <asm/irq.h>
 
 #include "scsi.h"
@@ -28,107 +29,83 @@
 #include "53c7xx.h"
 #include "amiga7xx.h"
 
-#include<linux/stat.h>
-
-extern int ncr53c7xx_init (Scsi_Host_Template *tpnt, int board, int chip, 
-			   unsigned long base, int io_port, int irq, int dma,
-			   long long options, int clock);
 
-int __init amiga7xx_detect(Scsi_Host_Template *tpnt)
+static int amiga7xx_register_one(Scsi_Host_Template *tpnt,
+				 unsigned long address)
 {
-    static unsigned char called = 0;
-    int num = 0, clock;
     long long options;
-    struct zorro_dev *z = NULL;
-    unsigned long address;
+    int clock;
 
-    if (called || !MACH_IS_AMIGA)
+    if (!request_mem_region(address, 0x1000, "ncr53c710"))
 	return 0;
 
-    tpnt->proc_name = "Amiga7xx";
+    address = (unsigned long)z_ioremap(address, 0x1000);
+    options = OPTION_MEMORY_MAPPED | OPTION_DEBUG_TEST1 | OPTION_INTFLY |
+	      OPTION_SYNCHRONOUS | OPTION_ALWAYS_SYNCHRONOUS |
+	      OPTION_DISCONNECT;
+    clock = 50000000;	/* 50 MHz SCSI Clock */
+    ncr53c7xx_init(tpnt, 0, 710, address, 0, IRQ_AMIGA_PORTS, DMA_NONE,
+		   options, clock);
+    return 1;
+}
+
+
+#ifdef CONFIG_ZORRO
+
+static struct {
+    zorro_id id;
+    unsigned long offset;
+    int absolute;	/* offset is absolute address */
+} amiga7xx_table[] = {
+    { .id = ZORRO_PROD_PHASE5_BLIZZARD_603E_PLUS, .offset = 0xf40000,
+      .absolute = 1 },
+    { .id = ZORRO_PROD_MACROSYSTEMS_WARP_ENGINE_40xx, .offset = 0x40000 },
+    { .id = ZORRO_PROD_CBM_A4091_1, .offset = 0x800000 },
+    { .id = ZORRO_PROD_CBM_A4091_2, .offset = 0x800000 },
+    { .id = ZORRO_PROD_GVP_GFORCE_040_060, .offset = 0x40000 },
+    { 0 }
+};
 
-#ifdef CONFIG_A4000T_SCSI
-    if (AMIGAHW_PRESENT(A4000_SCSI)) {
-	address = 0xdd0040;
-	if (request_mem_region(address, 0x1000, "ncr53c710")) { 
-	    address = ZTWO_VADDR(address);
-	    options = OPTION_MEMORY_MAPPED | OPTION_DEBUG_TEST1 |
-		      OPTION_INTFLY | OPTION_SYNCHRONOUS |
-		      OPTION_ALWAYS_SYNCHRONOUS | OPTION_DISCONNECT;
-	    clock = 50000000;	/* 50MHz SCSI Clock */
-	    ncr53c7xx_init(tpnt, 0, 710, address, 0, IRQ_AMIGA_PORTS, DMA_NONE,
-			   options, clock);
-	    num++;
-	}
-    }
-#endif
+static int __init amiga7xx_zorro_detect(Scsi_Host_Template *tpnt)
+{
+    int num = 0, i;
+    struct zorro_dev *z = NULL;
+    unsigned long address;
 
     while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
-	unsigned long address = z->resource.start;
-	unsigned long size = z->resource.end-z->resource.start+1;
-	switch (z->id) {
-#ifdef CONFIG_BLZ603EPLUS_SCSI
-	    case ZORRO_PROD_PHASE5_BLIZZARD_603E_PLUS:
-		address = 0xf40000;
-		if (request_mem_region(address, 0x1000, "ncr53c710")) {
-		    address = ZTWO_VADDR(address);
-		    options = OPTION_MEMORY_MAPPED | OPTION_DEBUG_TEST1 |
-			      OPTION_INTFLY | OPTION_SYNCHRONOUS | 
-			      OPTION_ALWAYS_SYNCHRONOUS | OPTION_DISCONNECT;
-		    clock = 50000000;	/* 50MHz SCSI Clock */
-		    ncr53c7xx_init(tpnt, 0, 710, address, 0, IRQ_AMIGA_PORTS,
-				   DMA_NONE, options, clock);
-		    num++;
-		}
+	for (i = 0; amiga7xx_table[i].id; i++)
+	    if (z->id == amiga7xx_table[i].id)
 		break;
-#endif
+	if (!amiga7xx_table[i].id)
+	    continue;
+	if (amiga7xx_table[i].absolute)
+	    address = amiga7xx_table[i].offset;
+	else
+	    address = z->resource.start + amiga7xx_table[i].offset;
+	num += amiga7xx_register_one(tpnt, address);
+    }
+    return num;
+}
 
-#ifdef CONFIG_WARPENGINE_SCSI
-    	    case ZORRO_PROD_MACROSYSTEMS_WARP_ENGINE_40xx:
-		if (request_mem_region(address+0x40000, 0x1000, "ncr53c710")) {
-		    address = (unsigned long)z_ioremap(address, size);
-		    options = OPTION_MEMORY_MAPPED | OPTION_DEBUG_TEST1 |
-			      OPTION_INTFLY | OPTION_SYNCHRONOUS |
-			      OPTION_ALWAYS_SYNCHRONOUS | OPTION_DISCONNECT;
-		    clock = 50000000;	/* 50MHz SCSI Clock */
-		    ncr53c7xx_init(tpnt, 0, 710, address+0x40000, 0,
-				   IRQ_AMIGA_PORTS, DMA_NONE, options, clock);
-		    num++;
-		}
-		break;
-#endif
+#endif /* CONFIG_ZORRO */
 
-#ifdef CONFIG_A4091_SCSI
-	    case ZORRO_PROD_CBM_A4091_1:
-	    case ZORRO_PROD_CBM_A4091_2:
-		if (request_mem_region(address+0x800000, 0x1000, "ncr53c710")) {
-		    address = (unsigned long)z_ioremap(address, size);
-		    options = OPTION_MEMORY_MAPPED | OPTION_DEBUG_TEST1 |
-			      OPTION_INTFLY | OPTION_SYNCHRONOUS |
-			      OPTION_ALWAYS_SYNCHRONOUS | OPTION_DISCONNECT;
-		    clock = 50000000;	/* 50MHz SCSI Clock */
-		    ncr53c7xx_init(tpnt, 0, 710, address+0x800000, 0,
-				   IRQ_AMIGA_PORTS, DMA_NONE, options, clock);
-		    num++;
-		}
-		break;
-#endif
 
-#ifdef CONFIG_GVP_TURBO_SCSI
-    	    case ZORRO_PROD_GVP_GFORCE_040_060:
-		if (request_mem_region(address+0x40000, 0x1000, "ncr53c710")) {
-		    address = ZTWO_VADDR(address);
-		    options = OPTION_MEMORY_MAPPED | OPTION_DEBUG_TEST1 |
-			      OPTION_INTFLY | OPTION_SYNCHRONOUS |
-			      OPTION_ALWAYS_SYNCHRONOUS | OPTION_DISCONNECT;
-		    clock = 50000000;	/* 50MHz SCSI Clock */
-		    ncr53c7xx_init(tpnt, 0, 710, address+0x40000, 0,
-				   IRQ_AMIGA_PORTS, DMA_NONE, options, clock);
-		    num++;
-		}
+int __init amiga7xx_detect(Scsi_Host_Template *tpnt)
+{
+    static unsigned char called = 0;
+    int num = 0;
+
+    if (called || !MACH_IS_AMIGA)
+	return 0;
+
+    tpnt->proc_name = "Amiga7xx";
+
+    if (AMIGAHW_PRESENT(A4000_SCSI))
+	num += amiga7xx_register_one(tpnt, 0xdd0040);
+
+#ifdef CONFIG_ZORRO
+    num += amiga7xx_zorro_detect(tpnt);
 #endif
-	}
-    }
 
     called = 1;
     return num;
diff -Nru a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c
--- a/drivers/scsi/atp870u.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/scsi/atp870u.c	Tue Feb  3 19:45:17 2004
@@ -17,6 +17,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -42,50 +43,6 @@
 
 static unsigned short int sync_idu;
 
-#define MAX_ATP		16
-
-struct atp_unit {
-	unsigned long ioport;
-	unsigned long irq;
-	unsigned long pciport;
-	unsigned char last_cmd;
-	unsigned char in_snd;
-	unsigned char in_int;
-	unsigned char quhdu;
-	unsigned char quendu;
-	unsigned char scam_on;
-	unsigned char global_map;
-	unsigned char chip_veru;
-	unsigned char host_idu;
-	int working;
-	unsigned short wide_idu;
-	unsigned short active_idu;
-	unsigned short ultra_map;
-	unsigned short async;
-	unsigned short deviceid;
-	unsigned char ata_cdbu[16];
-	unsigned char sp[16];
-	Scsi_Cmnd *querequ[qcnt];
-	struct atp_id {
-		unsigned char dirctu;
-		unsigned char devspu;
-		unsigned char devtypeu;
-		unsigned long prdaddru;
-		unsigned long tran_lenu;
-		unsigned long last_lenu;
-		unsigned char *prd_posu;
-		unsigned char *prd_tableu;
-		dma_addr_t prd_phys;
-		Scsi_Cmnd *curr_req;
-	} id[16];
-	struct Scsi_Host *host;
-	struct pci_dev *pdev;
-};
-
-static struct Scsi_Host *atp_host[MAX_ATP];
-
-static void send_s870(struct Scsi_Host *);
-
 static irqreturn_t atp870u_intr_handle(int irq, void *dev_id,
 					struct pt_regs *regs)
 {
@@ -878,7 +835,7 @@
 	unsigned long n;
 	unsigned short int m, assignid_map, val;
 	unsigned char mbuf[33], quintet[2];
-	struct atp_unit *dev = (struct atp_unit *)host->hostdata;
+	struct atp_unit *dev = (struct atp_unit *)&host->hostdata;
 	static unsigned char g2q_tab[8] = {
 		0x38, 0x31, 0x32, 0x2b, 0x34, 0x2d, 0x2e, 0x27
 	};
@@ -2253,15 +2210,31 @@
 	}
 }
 
-
-static void atp870u_init_tables(struct Scsi_Host *host)
+static void atp870u_free_tables(struct Scsi_Host *host)
 {
-	struct atp_unit *dev = (struct atp_unit *)&host->hostdata;
+	struct atp_unit *atp_dev = (struct atp_unit *)&host->hostdata;
 	int k;
 
 	for (k = 0; k < 16; k++) {
-		/* FIXME */
+		if (!atp_dev->id[k].prd_tableu)
+			continue;
+		pci_free_consistent(atp_dev->pdev, 1024, atp_dev->id[k].prd_tableu,
+					atp_dev->id[k].prd_phys);
+		atp_dev->id[k].prd_tableu = NULL;
+	}
+}
+
+static int atp870u_init_tables(struct Scsi_Host *host)
+{
+	struct atp_unit *dev = (struct atp_unit *)&host->hostdata;
+	int k, i;
+
+	for (i = k = 0; k < 16; k++) {
 		dev->id[k].prd_tableu = pci_alloc_consistent(dev->pdev, 1024, &dev->id[k].prd_phys);
+		if (!dev->id[k].prd_tableu) {
+			atp870u_free_tables(host);
+			return -ENOMEM;
+		}
 		dev->id[k].devspu = 0x20;
 		dev->id[k].devtypeu = 0;
 		dev->id[k].curr_req = NULL;
@@ -2282,293 +2255,294 @@
 		dev->id[k].curr_req = 0;
 		dev->sp[k] = 0x04;
 	}
+	return 0;
 }			
 
 /* return non-zero on detection */
-static int atp870u_detect(Scsi_Host_Template * tpnt)
+static int atp870u_probe(struct pci_dev *dev, const struct pci_device_id *ent)
 {
-	unsigned char irq, h, k, m;
+	unsigned char k, m;
 	unsigned long flags;
 	unsigned int base_io, error, tmport;
-	struct pci_dev *pdev[MAX_ATP];
-	unsigned char chip_ver[MAX_ATP], host_id;
-	unsigned short dev_id[MAX_ATP], n;
-	struct Scsi_Host *shpnt = NULL;
-	int card = 0;
-	int count = 0;
-
-	static unsigned short devid[9] = {
-		0x8081, 0x8002, 0x8010, 0x8020, 0x8030, 0x8040, 0x8050, 0x8060, 0
-	};
-
-	printk(KERN_INFO "aec671x_detect: \n");
-	tpnt->proc_name = "atp870u";
+	unsigned char host_id;
+	unsigned short n;
+	struct Scsi_Host *shpnt;
+	struct atp_unit atp_dev, *p;
+	static int count;
+
+	if (pci_enable_device(dev))
+		return -EIO;
+
+	if (pci_set_dma_mask(dev, 0xFFFFFFFFUL)) {
+		printk(KERN_ERR "atp870u: 32bit DMA mask required but not available.\n");
+		return -EIO;
+	}
+	
+	memset(&atp_dev, 0, sizeof atp_dev);
+ 
+	/*
+	 * It's probably easier to weed out some revisions like
+	 * this than via the PCI device table
+	 */
+	if (ent->device == PCI_DEVICE_ID_ARTOP_AEC7610) {
+		error = pci_read_config_byte(dev, PCI_CLASS_REVISION, &atp_dev.chip_veru);
+		if (atp_dev.chip_veru < 2)
+			return -EIO;
+	}
+
+	switch (ent->device) {
+	case 0x8081:
+	case PCI_DEVICE_ID_ARTOP_AEC7612UW:
+	case PCI_DEVICE_ID_ARTOP_AEC7612SUW:
+		atp_dev.chip_veru = 0x04;
+	default:
+		break;
+	}
+
+	base_io = pci_resource_start(dev, 0);
+
+	if (ent->device != 0x8081) {
+		error = pci_read_config_byte(dev, 0x49, &host_id);
+		base_io &= 0xfffffff8;
+
+		printk(KERN_INFO "   ACARD AEC-671X PCI Ultra/W SCSI-3 Host Adapter: %d "
+			"IO:%x, IRQ:%d.\n", count, base_io, dev->irq);
+
+		atp_dev.unit = count;	
+		atp_dev.ioport = base_io;
+		atp_dev.pciport = base_io + 0x20;
+		atp_dev.deviceid = ent->device;
+		host_id &= 0x07;
+		atp_dev.host_idu = host_id;
+		tmport = base_io + 0x22;
+		atp_dev.scam_on = inb(tmport);
+		tmport += 0x0b;
+		atp_dev.global_map = inb(tmport++);
+		atp_dev.ultra_map = inw(tmport);
+
+		if (atp_dev.ultra_map == 0) {
+			atp_dev.scam_on = 0x00;
+			atp_dev.global_map = 0x20;
+			atp_dev.ultra_map = 0xffff;
+		}
+
+		shpnt = scsi_host_alloc(&atp870u_template, sizeof(struct atp_unit));
+		if (!shpnt)
+			return -ENOMEM;
 
-	for (h = 0; devid[h]; h++) {
-		struct pci_dev *dev = NULL;
+		p = (struct atp_unit *)&shpnt->hostdata;
 		
-		while((dev = pci_find_device(0x1191, devid[h], dev))!=NULL)
-		{
-			if(pci_enable_device(dev))
-				continue;
-
-			if(pci_set_dma_mask(dev, 0xFFFFFFFFUL))
-			{
-				printk(KERN_ERR "atp870u: 32bit DMA mask required but not available.\n");
-				continue;
-			}
-			chip_ver[card] = 0;
-			dev_id[card] = devid[h];
-
-			if (devid[h] == 0x8002) {
-				error = pci_read_config_byte(dev, 0x08, &chip_ver[card]);
-				if (chip_ver[card] < 2) {
-					continue;
-				}
-			}
-			if (devid[h] == 0x8010 || devid[h] == 0x8081 || devid[h] == 0x8050) {
-				chip_ver[card] = 0x04;
-			}
-			pdev[card] = dev;
-			card++;
-			if (card == MAX_ATP)
-				break;
-		}
-	}
-	for (h = 0; h < card; h++) {
-		struct atp_unit tmp, *dev;
-
-		/* Found an atp870u/w. */
-		base_io = pci_resource_start(pdev[h], 0);
-		irq = pdev[h]->irq;
-
-		if (dev_id[h] != 0x8081) {
-			error = pci_read_config_byte(pdev[h], 0x49, &host_id);
-
-			base_io &= 0xfffffff8;
-
-			if (check_region(base_io, 0x40) != 0) {
-				return 0;
-			}
-			printk(KERN_INFO "   ACARD AEC-671X PCI Ultra/W SCSI-3 Host Adapter: %d    IO:%x, IRQ:%d.\n", h, base_io, irq);
-			
-			tmp.ioport = base_io;
-			tmp.pciport = base_io + 0x20;
-			tmp.deviceid = dev_id[h];
-			host_id &= 0x07;
-			tmp.host_idu = host_id;
-			tmp.chip_veru = chip_ver[h];
-
-			tmport = base_io + 0x22;
-			tmp.scam_on = inb(tmport);
-			tmport += 0x0b;
-			tmp.global_map = inb(tmport++);
-			tmp.ultra_map = inw(tmport);
-			if (tmp.ultra_map == 0) {
-				tmp.scam_on = 0x00;
-				tmp.global_map = 0x20;
-				tmp.ultra_map = 0xffff;
-			}
-			shpnt = scsi_register(tpnt, sizeof(struct atp_unit));
-			if (shpnt == NULL)
-				return count;
-			tmp.host = shpnt;
-			tmp.pdev = pdev[h];
-			/* Save the atp_unit data */
-			memcpy(&shpnt->hostdata, &tmp, sizeof(tmp));
-
-			atp870u_init_tables(shpnt);
-			spin_lock_irqsave(shpnt->host_lock, flags);
-			if (request_irq(irq, atp870u_intr_handle, SA_SHIRQ, "atp870u", shpnt)) {
-				printk(KERN_ERR "Unable to allocate IRQ for Acard controller.\n");
-				goto unregister;
-			}
-
-			if (chip_ver[h] > 0x07) {	/* check if atp876 chip   *//* then enable terminator */
-				tmport = base_io + 0x3e;
-				outb(0x00, tmport);
-			}
+		atp_dev.host = shpnt;
+		atp_dev.pdev = dev;
+		pci_set_drvdata(dev, p);
+		memcpy(p, &atp_dev, sizeof atp_dev);
+		if (atp870u_init_tables(shpnt) < 0)
+			goto unregister;
+
+		if (request_irq(dev->irq, atp870u_intr_handle, SA_SHIRQ, "atp870u", shpnt)) {
+			printk(KERN_ERR "Unable to allocate IRQ%d for Acard controller.\n", dev->irq);
+			goto free_tables;
+		}
 
-			tmport = base_io + 0x3a;
-			k = (inb(tmport) & 0xf3) | 0x10;
-			outb(k, tmport);
-			outb((k & 0xdf), tmport);
-			mdelay(32);
-			outb(k, tmport);
-			mdelay(32);
-			tmport = base_io;
-			outb((host_id | 0x08), tmport);
-			tmport += 0x18;
-			outb(0, tmport);
-			tmport += 0x07;
-			while ((inb(tmport) & 0x80) == 0);
-			tmport -= 0x08;
-			inb(tmport);
-			tmport = base_io + 1;
-			outb(8, tmport++);
-			outb(0x7f, tmport);
-			tmport = base_io + 0x11;
-			outb(0x20, tmport);
-
-			tscam(shpnt);
-			is870(shpnt, base_io);
-			tmport = base_io + 0x3a;
-			outb((inb(tmport) & 0xef), tmport);
-			tmport++;
-			outb((inb(tmport) | 0x20), tmport);
-		} else {
-			base_io &= 0xfffffff8;
+		spin_lock_irqsave(shpnt->host_lock, flags);
+		if (atp_dev.chip_veru > 0x07) {	/* check if atp876 chip then enable terminator */
+			tmport = base_io + 0x3e;
+			outb(0x00, tmport);
+		}
+ 
+		tmport = base_io + 0x3a;
+		k = (inb(tmport) & 0xf3) | 0x10;
+		outb(k, tmport);
+		outb((k & 0xdf), tmport);
+		mdelay(32);
+		outb(k, tmport);
+		mdelay(32);
+		tmport = base_io;
+		outb((host_id | 0x08), tmport);
+		tmport += 0x18;
+		outb(0, tmport);
+		tmport += 0x07;
+		while ((inb(tmport) & 0x80) == 0)
+			mdelay(1);
 
-			if (check_region(base_io, 0x60) != 0) {
-				return 0;
-			}
-			host_id = inb(base_io + 0x39);
-			host_id >>= 0x04;
+		tmport -= 0x08;
+		inb(tmport);
+		tmport = base_io + 1;
+		outb(8, tmport++);
+		outb(0x7f, tmport);
+		tmport = base_io + 0x11;
+		outb(0x20, tmport);
 
-			printk(KERN_INFO "   ACARD AEC-67160 PCI Ultra3 LVD Host Adapter: %d    IO:%x, IRQ:%d.\n", h, base_io, irq);
-			tmp.ioport = base_io + 0x40;
-			tmp.pciport = base_io + 0x28;
-			tmp.deviceid = dev_id[h];
-			tmp.host_idu = host_id;
-			tmp.chip_veru = chip_ver[h];
-
-			tmport = base_io + 0x22;
-			tmp.scam_on = inb(tmport);
-			tmport += 0x13;
-			tmp.global_map = inb(tmport);
-			tmport += 0x07;
-			tmp.ultra_map = inw(tmport);
+		tscam(shpnt);
+		is870(shpnt, base_io);
+		tmport = base_io + 0x3a;
+		outb((inb(tmport) & 0xef), tmport);
+		tmport++;
+		outb((inb(tmport) | 0x20), tmport);
+	} else {
+		base_io &= 0xfffffff8;
+		host_id = inb(base_io + 0x39);
+		host_id >>= 0x04;
+
+		printk(KERN_INFO "   ACARD AEC-67160 PCI Ultra3 LVD Host Adapter: %d"
+			"    IO:%x, IRQ:%d.\n", count, base_io, dev->irq);
+		atp_dev.ioport = base_io + 0x40;
+		atp_dev.pciport = base_io + 0x28;
+		atp_dev.deviceid = ent->device;
+		atp_dev.host_idu = host_id;
+
+		tmport = base_io + 0x22;
+		atp_dev.scam_on = inb(tmport);
+		tmport += 0x13;
+		atp_dev.global_map = inb(tmport);
+		tmport += 0x07;
+		atp_dev.ultra_map = inw(tmport);
 
-			n = 0x3f09;
+		n = 0x3f09;
 next_fblk:
-			if (n >= 0x4000) {
-				goto flash_ok;
-			}
-			m = 0;
-			outw(n, base_io + 0x34);
-			n += 0x0002;
-			if (inb(base_io + 0x30) == 0xff) {
-				goto flash_ok;
-			}
-			tmp.sp[m++] = inb(base_io + 0x30);
-			tmp.sp[m++] = inb(base_io + 0x31);
-			tmp.sp[m++] = inb(base_io + 0x32);
-			tmp.sp[m++] = inb(base_io + 0x33);
-			outw(n, base_io + 0x34);
-			n += 0x0002;
-			tmp.sp[m++] = inb(base_io + 0x30);
-			tmp.sp[m++] = inb(base_io + 0x31);
-			tmp.sp[m++] = inb(base_io + 0x32);
-			tmp.sp[m++] = inb(base_io + 0x33);
-			outw(n, base_io + 0x34);
-			n += 0x0002;
-			tmp.sp[m++] = inb(base_io + 0x30);
-			tmp.sp[m++] = inb(base_io + 0x31);
-			tmp.sp[m++] = inb(base_io + 0x32);
-			tmp.sp[m++] = inb(base_io + 0x33);
-			outw(n, base_io + 0x34);
-			n += 0x0002;
-			tmp.sp[m++] = inb(base_io + 0x30);
-			tmp.sp[m++] = inb(base_io + 0x31);
-			tmp.sp[m++] = inb(base_io + 0x32);
-			tmp.sp[m++] = inb(base_io + 0x33);
-			n += 0x0018;
-			goto next_fblk;
+		if (n >= 0x4000)
+			goto flash_ok;
+
+		m = 0;
+		outw(n, base_io + 0x34);
+		n += 0x0002;
+		if (inb(base_io + 0x30) == 0xff)
+			goto flash_ok;
+
+		atp_dev.sp[m++] = inb(base_io + 0x30);
+		atp_dev.sp[m++] = inb(base_io + 0x31);
+		atp_dev.sp[m++] = inb(base_io + 0x32);
+		atp_dev.sp[m++] = inb(base_io + 0x33);
+		outw(n, base_io + 0x34);
+		n += 0x0002;
+		atp_dev.sp[m++] = inb(base_io + 0x30);
+		atp_dev.sp[m++] = inb(base_io + 0x31);
+		atp_dev.sp[m++] = inb(base_io + 0x32);
+		atp_dev.sp[m++] = inb(base_io + 0x33);
+		outw(n, base_io + 0x34);
+		n += 0x0002;
+		atp_dev.sp[m++] = inb(base_io + 0x30);
+		atp_dev.sp[m++] = inb(base_io + 0x31);
+		atp_dev.sp[m++] = inb(base_io + 0x32);
+		atp_dev.sp[m++] = inb(base_io + 0x33);
+		outw(n, base_io + 0x34);
+		n += 0x0002;
+		atp_dev.sp[m++] = inb(base_io + 0x30);
+		atp_dev.sp[m++] = inb(base_io + 0x31);
+		atp_dev.sp[m++] = inb(base_io + 0x32);
+		atp_dev.sp[m++] = inb(base_io + 0x33);
+		n += 0x0018;
+		goto next_fblk;
 flash_ok:
-			outw(0, base_io + 0x34);
-			tmp.ultra_map = 0;
-			tmp.async = 0;
-			for (k = 0; k < 16; k++) {
-				n = 1;
-				n = n << k;
-				if (tmp.sp[k] > 1) {
-					tmp.ultra_map |= n;
-				} else {
-					if (tmp.sp[k] == 0) {
-						tmp.async |= n;
-					}
-				}
-			}
-			tmp.async = ~(tmp.async);
-			outb(tmp.global_map, base_io + 0x35);
+		outw(0, base_io + 0x34);
+		atp_dev.ultra_map = 0;
+		atp_dev.async = 0;
+		for (k = 0; k < 16; k++) {
+			n = 1;
+			n = n << k;
+			if (atp_dev.sp[k] > 1) {
+				atp_dev.ultra_map |= n;
+			} else {
+				if (atp_dev.sp[k] == 0)
+					atp_dev.async |= n;
+ 			}
+	 	}
+		atp_dev.async = ~(atp_dev.async);
+		outb(atp_dev.global_map, base_io + 0x35);
+ 
+		shpnt = scsi_host_alloc(&atp870u_template, sizeof(struct atp_unit));
+		if (!shpnt)
+			return -ENOMEM;
+
+		p = (struct atp_unit *)&shpnt->hostdata;
+
+		atp_dev.host = shpnt;
+		atp_dev.pdev = dev;
+		pci_set_drvdata(dev, p);
+		memcpy(p, &atp_dev, sizeof atp_dev);
+		if (atp870u_init_tables(shpnt) < 0) {
+			printk(KERN_ERR "Unable to allocate tables for Acard controller\n");
+			goto unregister;
+		}
+
+		if (request_irq(dev->irq, atp870u_intr_handle, SA_SHIRQ, "atp870u", shpnt)) {
+ 			printk(KERN_ERR "Unable to allocate IRQ%d for Acard controller.\n", dev->irq);
+			goto free_tables;
+		}
+
+		spin_lock_irqsave(shpnt->host_lock, flags);
+		tmport = base_io + 0x38;
+		k = inb(tmport) & 0x80;
+		outb(k, tmport);
+		tmport += 0x03;
+		outb(0x20, tmport);
+		mdelay(32);
+		outb(0, tmport);
+		mdelay(32);
+		tmport = base_io + 0x5b;
+		inb(tmport);
+		tmport -= 0x04;
+		inb(tmport);
+		tmport = base_io + 0x40;
+		outb((host_id | 0x08), tmport);
+		tmport += 0x18;
+		outb(0, tmport);
+		tmport += 0x07;
+		while ((inb(tmport) & 0x80) == 0)
+			mdelay(1);
+		tmport -= 0x08;
+		inb(tmport);
+		tmport = base_io + 0x41;
+		outb(8, tmport++);
+		outb(0x7f, tmport);
+		tmport = base_io + 0x51;
+		outb(0x20, tmport);
 
-			shpnt = scsi_register(tpnt, sizeof(struct atp_unit));
-			if (shpnt == NULL)
-				return count;
-				
-			tmp.pdev = pdev[h];
-			memcpy(&shpnt->hostdata, &tmp, sizeof(tmp));
-			
-			atp870u_init_tables(shpnt);
-
-			spin_lock_irqsave(shpnt->host_lock, flags);
-			if (request_irq(irq, atp870u_intr_handle, SA_SHIRQ, "atp870u", shpnt)) {
-				printk(KERN_ERR "Unable to allocate IRQ for Acard controller.\n");
-				goto unregister;
-			}
-
-			tmport = base_io + 0x38;
-			k = inb(tmport) & 0x80;
-			outb(k, tmport);
-			tmport += 0x03;
-			outb(0x20, tmport);
-			mdelay(32);
-			outb(0, tmport);
-			mdelay(32);
-			tmport = base_io + 0x5b;
-			inb(tmport);
-			tmport -= 0x04;
-			inb(tmport);
-			tmport = base_io + 0x40;
-			outb((host_id | 0x08), tmport);
-			tmport += 0x18;
-			outb(0, tmport);
-			tmport += 0x07;
-			while ((inb(tmport) & 0x80) == 0);
-			tmport -= 0x08;
-			inb(tmport);
-			tmport = base_io + 0x41;
-			outb(8, tmport++);
-			outb(0x7f, tmport);
-			tmport = base_io + 0x51;
-			outb(0x20, tmport);
-
-			tscam(shpnt);
-			is880(shpnt, base_io);
-			tmport = base_io + 0x38;
-			outb(0xb0, tmport);
-		}
+		tscam(shpnt);
+		is880(shpnt, base_io);
+		tmport = base_io + 0x38;
+		outb(0xb0, tmport);
+	}
 
-		dev = (struct atp_unit *)&shpnt->hostdata;
-		
-		atp_host[h] = shpnt;
-		if (dev->chip_veru == 4) {
-			shpnt->max_id = 16;
-		}
-		shpnt->this_id = host_id;
-		shpnt->unique_id = base_io;
-		shpnt->io_port = base_io;
-		if (dev_id[h] == 0x8081) {
-			shpnt->n_io_port = 0x60;	/* Number of bytes of I/O space used */
-		} else {
-			shpnt->n_io_port = 0x40;	/* Number of bytes of I/O space used */
-		}
-		shpnt->irq = irq;
-		spin_unlock_irqrestore(shpnt->host_lock, flags);
-		if (dev_id[h] == 0x8081) {
-			request_region(base_io, 0x60, "atp870u");	/* Register the IO ports that we use */
-		} else {
-			request_region(base_io, 0x40, "atp870u");	/* Register the IO ports that we use */
-		}
-		count++;
-		continue;
-unregister:
-		scsi_unregister(shpnt);
-		spin_unlock_irqrestore(shpnt->host_lock, flags);
-		continue;
+	if (p->chip_veru == 4)
+		shpnt->max_id = 16;
+
+	shpnt->this_id = host_id;
+	shpnt->unique_id = base_io;
+	shpnt->io_port = base_io;
+	if (ent->device == 0x8081) {
+		shpnt->n_io_port = 0x60;	/* Number of bytes of I/O space used */
+	} else {
+		shpnt->n_io_port = 0x40;	/* Number of bytes of I/O space used */
+	}
+	shpnt->irq = dev->irq;
+	spin_unlock_irqrestore(shpnt->host_lock, flags);
+	if (ent->device == 0x8081) {
+		if (!request_region(base_io, 0x60, "atp870u"))
+			goto request_io_fail;
+	} else {
+		if (!request_region(base_io, 0x40, "atp870u"))
+			goto request_io_fail;
 	}
 
-	return count;
+	count++;
+	if (scsi_add_host(shpnt, &dev->dev))
+		goto scsi_add_fail;
+	scsi_scan_host(shpnt);
+	return 0;
+  
+scsi_add_fail:
+	if (ent->device == 0x8081)
+		release_region(base_io, 0x60);
+	else
+		release_region(base_io, 0x40);
+request_io_fail:
+	free_irq(dev->irq, shpnt);
+free_tables:
+	atp870u_free_tables(shpnt);
+unregister:
+	scsi_host_put(shpnt);
+	return -1;
 }
 
 /* The abort command does not leave the device in a clean state where
@@ -2684,25 +2658,26 @@
 	return 0;
 }
 
-
-static int atp870u_release(struct Scsi_Host *pshost)
+static void atp870u_remove(struct pci_dev *pdev)
 {
-	struct atp_unit *dev = (struct atp_unit *)&pshost->hostdata;
-	int k;
+	struct atp_unit *atp_dev = pci_get_drvdata(pdev);
+	struct Scsi_Host *pshost = atp_dev->host;
+
+	scsi_remove_host(pshost);
 	free_irq(pshost->irq, pshost);
 	release_region(pshost->io_port, pshost->n_io_port);
-	scsi_unregister(pshost);
-	for (k = 0; k < 16; k++)
-		pci_free_consistent(dev->pdev, 1024, dev->id[k].prd_tableu, dev->id[k].prd_phys);
-	return 0;
+	atp870u_free_tables(pshost);
+	scsi_host_put(pshost);
+	pci_set_drvdata(pdev, NULL);
 }
 
 MODULE_LICENSE("GPL");
 
-static Scsi_Host_Template driver_template = {
+static Scsi_Host_Template atp870u_template = {
+	.module			= THIS_MODULE,
+	.name			= "atp870u",
+	.proc_name		= "atp870u",
 	.proc_info		= atp870u_proc_info,
-	.detect			= atp870u_detect,
-	.release		= atp870u_release,
 	.info			= atp870u_info,
 	.queuecommand		= atp870u_queuecommand,
 	.eh_abort_handler	= atp870u_abort,
@@ -2713,4 +2688,39 @@
 	.cmd_per_lun		= ATP870U_CMDLUN,
 	.use_clustering		= ENABLE_CLUSTERING,
 };
-#include "scsi_module.c"
+
+static struct pci_device_id atp870u_id_table[] = {
+	{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, 0x8081)			  },
+	{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_AEC7610)    },
+	{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_AEC7612UW)  },
+	{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_AEC7612U)   },
+	{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_AEC7612S)   },
+	{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_AEC7612D)	  },
+	{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_AEC7612SUW) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_8060)	  },
+	{ 0, },
+};
+
+MODULE_DEVICE_TABLE(pci, atp870u_id_table);
+
+static struct pci_driver atp870u_driver = {	
+	.id_table	= atp870u_id_table,
+	.name		= "atp870u",
+	.probe		= atp870u_probe,
+	.remove		= __devexit_p(atp870u_remove),
+};
+
+static int __init atp870u_init(void)
+{
+	pci_register_driver(&atp870u_driver);
+	return 0;
+}
+
+static void __exit atp870u_exit(void)
+{
+	pci_unregister_driver(&atp870u_driver);
+}
+
+module_init(atp870u_init);
+module_exit(atp870u_exit);
+
diff -Nru a/drivers/scsi/atp870u.h b/drivers/scsi/atp870u.h
--- a/drivers/scsi/atp870u.h	Tue Feb  3 19:45:16 2004
+++ b/drivers/scsi/atp870u.h	Tue Feb  3 19:45:16 2004
@@ -1,4 +1,5 @@
 #ifndef _ATP870U_H
+#define _ATP870U_H
 
 /* $Id: atp870u.h,v 1.0 1997/05/07 15:09:00 root Exp root $
 
@@ -14,20 +15,57 @@
 
 /* I/O Port */
 
-#define MAX_CDB 12
-#define MAX_SENSE 14
+#define MAX_CDB		12
+#define MAX_SENSE	14
+#define qcnt		32
+#define ATP870U_SCATTER 128
+#define ATP870U_CMDLUN 	1
+
+struct atp_unit {
+	unsigned long ioport;
+	unsigned long pciport;
+	unsigned char last_cmd;
+	unsigned char in_snd;
+	unsigned char in_int;
+	unsigned char quhdu;
+	unsigned char quendu;
+	unsigned char scam_on;
+	unsigned char global_map;
+	unsigned char chip_veru;
+	unsigned char host_idu;
+	volatile int working;
+	unsigned short wide_idu;
+	unsigned short active_idu;
+	unsigned short ultra_map;
+	unsigned short async;
+	unsigned short deviceid;
+	unsigned char ata_cdbu[16];
+	unsigned char sp[16];
+	Scsi_Cmnd *querequ[qcnt];
+	struct atp_id {
+		unsigned char dirctu;
+		unsigned char devspu;
+		unsigned char devtypeu;
+		unsigned long prdaddru;
+		unsigned long tran_lenu;
+		unsigned long last_lenu;
+		unsigned char *prd_posu;
+		unsigned char *prd_tableu;
+		dma_addr_t prd_phys;
+		Scsi_Cmnd *curr_req;
+	} id[16];
+	struct Scsi_Host *host;
+	struct pci_dev *pdev;
+	unsigned int unit;
+};
 
-static int atp870u_detect(Scsi_Host_Template *);
 static int atp870u_queuecommand(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
 static int atp870u_abort(Scsi_Cmnd *);
 static int atp870u_biosparam(struct scsi_device *, struct block_device *,
 		sector_t, int *);
-static int atp870u_release(struct Scsi_Host *);
-
-#define qcnt		32
-#define ATP870U_SCATTER 128
-#define ATP870U_CMDLUN 1
+static void send_s870(struct Scsi_Host *);
 
 extern const char *atp870u_info(struct Scsi_Host *);
+static Scsi_Host_Template atp870u_template;
 
 #endif
diff -Nru a/drivers/scsi/bvme6000.c b/drivers/scsi/bvme6000.c
--- a/drivers/scsi/bvme6000.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/scsi/bvme6000.c	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,5 @@
 /*
- * Detection routine for the NCR53c710 based MVME16x SCSI Controllers for Linux.
+ * Detection routine for the NCR53c710 based BVME6000 SCSI Controllers for Linux.
  *
  * Based on work by Alan Hourihane
  */
@@ -23,9 +23,6 @@
 
 #include<linux/stat.h>
 
-extern int ncr53c7xx_init(Scsi_Host_Template *tpnt, int board, int chip,
-			  unsigned long base, int io_port, int irq, int dma,
-			  long long options, int clock);
 
 int bvme6000_scsi_detect(Scsi_Host_Template *tpnt)
 {
@@ -51,7 +48,7 @@
     return 1;
 }
 
-static int mvme6000_scsi_release(struct Scsi_Host *shost)
+static int bvme6000_scsi_release(struct Scsi_Host *shost)
 {
 	if (shost->irq)
 		free_irq(shost->irq, NULL);
diff -Nru a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
--- a/drivers/scsi/g_NCR5380.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/scsi/g_NCR5380.c	Tue Feb  3 19:45:17 2004
@@ -290,6 +290,7 @@
 	static int current_override = 0;
 	int count, i;
 	unsigned int *ports;
+	unsigned long region_size = 16;
 	static unsigned int __initdata ncr_53c400a_ports[] = {
 		0x280, 0x290, 0x300, 0x310, 0x330, 0x340, 0x348, 0x350, 0
 	};
@@ -420,6 +421,7 @@
 			/* Not a 53C400A style setup - just grab */
 			if(!(request_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size, "ncr5380")))
 				continue;
+			region_size = NCR5380_region_size;
 		}
 #else
 		if(!request_mem_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size, "ncr5380"))
@@ -428,7 +430,7 @@
 		instance = scsi_register(tpnt, sizeof(struct NCR5380_hostdata));
 		if (instance == NULL) {
 #ifndef CONFIG_SCSI_G_NCR5380_MEM
-			release_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size);
+			release_region(overrides[current_override].NCR5380_map_name, region_size);
 #else
 			release_mem_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size);
 #endif
@@ -436,6 +438,9 @@
 		}
 
 		instance->NCR5380_instance_name = overrides[current_override].NCR5380_map_name;
+#ifndef CONFIG_SCSI_G_NCR5380_MEM
+		instance->n_io_port = region_size;
+#endif
 
 		NCR5380_init(instance, flags);
 
@@ -498,7 +503,7 @@
 	NCR5380_setup(instance);
 
 #ifndef CONFIG_SCSI_G_NCR5380_MEM
-	release_region(instance->NCR5380_instance_name, NCR5380_region_size);
+	release_region(instance->NCR5380_instance_name, instance->n_io_port);
 #else
 	release_mem_region(instance->NCR5380_instance_name, NCR5380_region_size);
 #endif
diff -Nru a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
--- a/drivers/scsi/ide-scsi.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/scsi/ide-scsi.c	Tue Feb  3 19:45:30 2004
@@ -788,7 +788,8 @@
 
 static int idescsi_queue (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
 {
-	idescsi_scsi_t *scsi = scsihost_to_idescsi(cmd->device->host);
+	struct Scsi_Host *host = cmd->device->host;
+	idescsi_scsi_t *scsi = scsihost_to_idescsi(host);
 	ide_drive_t *drive = scsi->drive;
 	struct request *rq = NULL;
 	idescsi_pc_t *pc = NULL;
@@ -839,9 +840,9 @@
 	rq->special = (char *) pc;
 	rq->bio = idescsi_dma_bio (drive, pc);
 	rq->flags = REQ_SPECIAL;
-	spin_unlock_irq(cmd->device->host->host_lock);
+	spin_unlock_irq(host->host_lock);
 	(void) ide_do_drive_cmd (drive, rq, ide_end);
-	spin_lock_irq(cmd->device->host->host_lock);
+	spin_lock_irq(host->host_lock);
 	return 0;
 abort:
 	if (pc) kfree (pc);
diff -Nru a/drivers/scsi/ini9100u.c b/drivers/scsi/ini9100u.c
--- a/drivers/scsi/ini9100u.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/scsi/ini9100u.c	Tue Feb  3 19:45:17 2004
@@ -484,7 +484,7 @@
 	dma_addr = dma_map_single(&pHCB->pci_dev->dev, SCpnt->sense_buffer,
 				  SENSE_SIZE, DMA_FROM_DEVICE);
 	pSCB->SCB_SensePtr = cpu_to_le32((u32)dma_addr);
-	pSCB->SCB_SenseLen = SENSE_SIZE;
+	pSCB->SCB_SenseLen = cpu_to_le32(SENSE_SIZE);
 	SCpnt->SCp.ptr = (char *)(unsigned long)dma_addr;
 
 	pSCB->SCB_CDBLen = SCpnt->cmd_len;
@@ -502,7 +502,7 @@
 		dma_addr = dma_map_single(&pHCB->pci_dev->dev, &pSCB->SCB_SGList[0],
 					  sizeof(struct SG_Struc) * TOTAL_SG_ENTRY,
 					  DMA_BIDIRECTIONAL);
-		pSCB->SCB_BufPtr = dma_addr;
+		pSCB->SCB_BufPtr = cpu_to_le32((u32)dma_addr);
 		SCpnt->SCp.dma_handle = dma_addr;
 
 		pSrbSG = (struct scatterlist *) SCpnt->request_buffer;
@@ -512,8 +512,8 @@
 		pSCB->SCB_Flags |= SCF_SG;	/* Turn on SG list flag       */
 		for (i = 0, TotalLen = 0, pSG = &pSCB->SCB_SGList[0];	/* 1.01g */
 		     i < pSCB->SCB_SGLen; i++, pSG++, pSrbSG++) {
-			pSG->SG_Ptr = (u32)sg_dma_address(pSrbSG);
-			TotalLen += pSG->SG_Len = (u32)sg_dma_len(pSrbSG);
+			pSG->SG_Ptr = cpu_to_le32((u32)sg_dma_address(pSrbSG));
+			TotalLen += pSG->SG_Len = cpu_to_le32((u32)sg_dma_len(pSrbSG));
 		}
 
 		pSCB->SCB_BufLen = (SCpnt->request_bufflen > TotalLen) ?
@@ -523,8 +523,8 @@
 					  SCpnt->request_bufflen,
 					  SCpnt->sc_data_direction);
 		SCpnt->SCp.dma_handle = dma_addr;
-		pSCB->SCB_BufPtr = (u32)dma_addr;
-		pSCB->SCB_BufLen = (u32)SCpnt->request_bufflen;
+		pSCB->SCB_BufPtr = cpu_to_le32((u32)dma_addr);
+		pSCB->SCB_BufLen = cpu_to_le32((u32)SCpnt->request_bufflen);
 		pSCB->SCB_SGLen = 0;
 	} else {
 		pSCB->SCB_BufLen = 0;
diff -Nru a/drivers/scsi/inia100.c b/drivers/scsi/inia100.c
--- a/drivers/scsi/inia100.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/scsi/inia100.c	Tue Feb  3 19:45:17 2004
@@ -420,7 +420,7 @@
 	struct Scsi_Host *shost;
 	ORC_HCS *pHCB;
 	unsigned long port, bios;
-	int ok = -ENODEV;
+	int error = -ENODEV;
 	u32 sz;
 	unsigned long dBiosAdr;
 	char *pbBiosAdr;
@@ -433,17 +433,17 @@
 		goto out_disable_device;
 	}
 
+	pci_set_master(pdev);
+
 	port = pci_resource_start(pdev, 0);
-	if (!request_region(pHCB->HCS_Base, 256, "inia100")) {
-		printk(KERN_WARNING "inia100: io port 0x%x, is busy.\n", 
-		       pHCB->HCS_Base);
-		goto out_disable_device; /* XXX: undo init_orchid() ?? */
+	if (!request_region(port, 256, "inia100")) {
+		printk(KERN_WARNING "inia100: io port 0x%lx, is busy.\n", port);
+		goto out_disable_device;
 	}
 
 	/* <02> read from base address + 0x50 offset to get the bios balue. */
 	bios = ORC_RDWORD(port, 0x50);
 
-	pci_set_master(pdev);
 
 	shost = scsi_host_alloc(&inia100_template, sizeof(ORC_HCS));
 	if (!shost)
@@ -460,7 +460,8 @@
 
 	/* Get total memory needed for SCB */
 	sz = ORC_MAXQUEUE * sizeof(ORC_SCB);
-	pHCB->HCS_virScbArray = pci_alloc_consistent(pdev, sz, &pHCB->HCS_physScbArray);
+	pHCB->HCS_virScbArray = pci_alloc_consistent(pdev, sz,
+			&pHCB->HCS_physScbArray);
 	if (!pHCB->HCS_virScbArray) {
 		printk("inia100: SCB memory allocation error\n");
 		goto out_host_put;
@@ -469,7 +470,8 @@
 
 	/* Get total memory needed for ESCB */
 	sz = ORC_MAXQUEUE * sizeof(ESCB);
-	pHCB->HCS_virEscbArray = pci_alloc_consistent(pdev, sz, &pHCB->HCS_physEscbArray);
+	pHCB->HCS_virEscbArray = pci_alloc_consistent(pdev, sz,
+			&pHCB->HCS_physEscbArray);
 	if (!pHCB->HCS_virEscbArray) {
 		printk("inia100: ESCB memory allocation error\n");
 		goto out_free_scb_array;
@@ -490,21 +492,23 @@
 	shost->unique_id = shost->io_port;
 	shost->max_id = pHCB->HCS_MaxTar;
 	shost->max_lun = 16;
-	shost->irq = pHCB->HCS_Intr;
+	shost->irq = pHCB->HCS_Intr = pdev->irq;
 	shost->this_id = pHCB->HCS_SCSI_ID;	/* Assign HCS index */
 	shost->sg_tablesize = TOTAL_SG_ENTRY;
 
 	/* Initial orc chip           */
-	ok = request_irq(pHCB->HCS_Intr, inia100_intr, SA_SHIRQ, "inia100", shost);
-	if (ok < 0) {
-		printk(KERN_WARNING "inia100: unable to get irq %d\n", pHCB->HCS_Intr);
+	error = request_irq(pdev->irq, inia100_intr, SA_SHIRQ,
+			"inia100", shost);
+	if (error < 0) {
+		printk(KERN_WARNING "inia100: unable to get irq %d\n",
+				pdev->irq);
 		goto out_free_escb_array;
 	}
 
 	pci_set_drvdata(pdev, shost);
 
-	ok = scsi_add_host(shost, &pdev->dev);
-	if (!ok)
+	error = scsi_add_host(shost, &pdev->dev);
+	if (error)
 		goto out_free_irq;
 
 	scsi_scan_host(shost);
@@ -521,11 +525,11 @@
  out_host_put:
 	scsi_host_put(shost);
  out_release_region:
-        release_region(pHCB->HCS_Base, 256);
+        release_region(port, 256);
  out_disable_device:
 	pci_disable_device(pdev);
  out:
-	return ok;
+	return error;
 }
 
 static void __devexit inia100_remove_one(struct pci_dev *pdev)
diff -Nru a/drivers/scsi/ips.c b/drivers/scsi/ips.c
--- a/drivers/scsi/ips.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/scsi/ips.c	Tue Feb  3 19:45:16 2004
@@ -131,6 +131,8 @@
 /* 5.30.00  - use __devexit_p()                                              */
 /* 6.00.00  - Add 6x Adapters and Battery Flash                              */
 /* 6.10.00  - Remove 1G Addressing Limitations                               */
+/* 6.11.xx  - Get VersionInfo buffer off the stack !              DDTS 60401 */
+/* 6.11.xx  - Make Logical Drive Info structure safe for DMA      DDTS 60639 */
 /*****************************************************************************/
 
 /*
@@ -195,8 +197,8 @@
 /*
  * DRIVER_VER
  */
-#define IPS_VERSION_HIGH        "6.10"
-#define IPS_VERSION_LOW         ".90-BETA"
+#define IPS_VERSION_HIGH        "7.00"
+#define IPS_VERSION_LOW         ".00 "
 
 #if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__)
 #warning "This driver has only been tested on the x86/ia64/x86_64 platforms"
@@ -497,8 +499,7 @@
 static int ips_host_info(ips_ha_t *, char *, off_t, int);
 static void copy_mem_info(IPS_INFOSTR *, char *, int);
 static int copy_info(IPS_INFOSTR *, char *, ...);
-static int ips_get_version_info(ips_ha_t * ha, IPS_VERSION_DATA * Buffer,
-				int intr);
+static int ips_get_version_info(ips_ha_t * ha, dma_addr_t, int intr);
 static void ips_version_check(ips_ha_t * ha, int intr);
 static int ips_abort_init(ips_ha_t * ha, int index);
 static int ips_init_phase2(int index);
@@ -2159,27 +2160,60 @@
 
 	copy_info(&info, "\tIRQ number                        : %d\n", ha->irq);
 
-	if (le32_to_cpu(ha->nvram->signature) == IPS_NVRAM_P5_SIG)
-		copy_info(&info,
-			  "\tBIOS Version                      : %c%c%c%c%c%c%c%c\n",
-			  ha->nvram->bios_high[0], ha->nvram->bios_high[1],
-			  ha->nvram->bios_high[2], ha->nvram->bios_high[3],
-			  ha->nvram->bios_low[0], ha->nvram->bios_low[1],
-			  ha->nvram->bios_low[2], ha->nvram->bios_low[3]);
-
-	copy_info(&info,
-		  "\tFirmware Version                  : %c%c%c%c%c%c%c%c\n",
-		  ha->enq->CodeBlkVersion[0], ha->enq->CodeBlkVersion[1],
-		  ha->enq->CodeBlkVersion[2], ha->enq->CodeBlkVersion[3],
-		  ha->enq->CodeBlkVersion[4], ha->enq->CodeBlkVersion[5],
-		  ha->enq->CodeBlkVersion[6], ha->enq->CodeBlkVersion[7]);
-
-	copy_info(&info,
-		  "\tBoot Block Version                : %c%c%c%c%c%c%c%c\n",
-		  ha->enq->BootBlkVersion[0], ha->enq->BootBlkVersion[1],
-		  ha->enq->BootBlkVersion[2], ha->enq->BootBlkVersion[3],
-		  ha->enq->BootBlkVersion[4], ha->enq->BootBlkVersion[5],
-		  ha->enq->BootBlkVersion[6], ha->enq->BootBlkVersion[7]);
+    /* For the Next 3 lines Check for Binary 0 at the end and don't include it if it's there. */
+    /* That keeps everything happy for "text" operations on the proc file.                    */
+
+	if (le32_to_cpu(ha->nvram->signature) == IPS_NVRAM_P5_SIG) {
+        if (ha->nvram->bios_low[3] == 0) { 
+            copy_info(&info,
+			          "\tBIOS Version                      : %c%c%c%c%c%c%c\n",
+			          ha->nvram->bios_high[0], ha->nvram->bios_high[1],
+			          ha->nvram->bios_high[2], ha->nvram->bios_high[3],
+			          ha->nvram->bios_low[0], ha->nvram->bios_low[1],
+			          ha->nvram->bios_low[2]);
+
+        } else {
+		    copy_info(&info,
+			          "\tBIOS Version                      : %c%c%c%c%c%c%c%c\n",
+			          ha->nvram->bios_high[0], ha->nvram->bios_high[1],
+			          ha->nvram->bios_high[2], ha->nvram->bios_high[3],
+			          ha->nvram->bios_low[0], ha->nvram->bios_low[1],
+			          ha->nvram->bios_low[2], ha->nvram->bios_low[3]);
+        }
+
+    }
+
+    if (ha->enq->CodeBlkVersion[7] == 0) {
+        copy_info(&info,
+		          "\tFirmware Version                  : %c%c%c%c%c%c%c\n",
+		          ha->enq->CodeBlkVersion[0], ha->enq->CodeBlkVersion[1],
+		          ha->enq->CodeBlkVersion[2], ha->enq->CodeBlkVersion[3],
+		          ha->enq->CodeBlkVersion[4], ha->enq->CodeBlkVersion[5],
+		          ha->enq->CodeBlkVersion[6]);
+    } else {
+        copy_info(&info,
+		          "\tFirmware Version                  : %c%c%c%c%c%c%c%c\n",
+		          ha->enq->CodeBlkVersion[0], ha->enq->CodeBlkVersion[1],
+		          ha->enq->CodeBlkVersion[2], ha->enq->CodeBlkVersion[3],
+		          ha->enq->CodeBlkVersion[4], ha->enq->CodeBlkVersion[5],
+		          ha->enq->CodeBlkVersion[6], ha->enq->CodeBlkVersion[7]);
+    }
+
+    if (ha->enq->BootBlkVersion[7] == 0) {
+        copy_info(&info,
+		          "\tBoot Block Version                : %c%c%c%c%c%c%c\n",
+		          ha->enq->BootBlkVersion[0], ha->enq->BootBlkVersion[1],
+		          ha->enq->BootBlkVersion[2], ha->enq->BootBlkVersion[3],
+		          ha->enq->BootBlkVersion[4], ha->enq->BootBlkVersion[5],
+		          ha->enq->BootBlkVersion[6]);
+    } else {
+        copy_info(&info,
+		          "\tBoot Block Version                : %c%c%c%c%c%c%c%c\n",
+		          ha->enq->BootBlkVersion[0], ha->enq->BootBlkVersion[1],
+		          ha->enq->BootBlkVersion[2], ha->enq->BootBlkVersion[3],
+		          ha->enq->BootBlkVersion[4], ha->enq->BootBlkVersion[5],
+		          ha->enq->BootBlkVersion[6], ha->enq->BootBlkVersion[7]);
+    }
 
 	copy_info(&info, "\tDriver Version                    : %s%s\n",
 		  IPS_VERSION_HIGH, IPS_VERSION_LOW);
@@ -2841,6 +2875,11 @@
 		scb->dcdb.cmd_attribute =
 		    ips_command_direction[scb->scsi_cmd->cmnd[0]];
 
+        /* Allow a WRITE BUFFER Command to Have no Data */
+        /* This is Used by Tape Flash Utilites          */
+        if ((scb->scsi_cmd->cmnd[0] == WRITE_BUFFER) && (scb->data_len == 0)) 
+            scb->dcdb.cmd_attribute = 0;                  
+
 		if (!(scb->dcdb.cmd_attribute & 0x3))
 			scb->dcdb.transfer_length = 0;
 
@@ -3820,23 +3859,14 @@
 					scb->scsi_cmd->result = DID_OK << 16;
 				}
 			} else {
-				scb->cmd.logical_info.op_code =
-				    IPS_CMD_GET_LD_INFO;
-				scb->cmd.logical_info.command_id =
-				    IPS_COMMAND_ID(ha, scb);
+				scb->cmd.logical_info.op_code = IPS_CMD_GET_LD_INFO;
+				scb->cmd.logical_info.command_id = IPS_COMMAND_ID(ha, scb);
 				scb->cmd.logical_info.reserved = 0;
 				scb->cmd.logical_info.reserved2 = 0;
-				scb->data_len =
-				    sizeof (ha->adapt->logical_drive_info);
-				scb->data_busaddr =
-				    pci_map_single(ha->pcidev,
-						   &ha->adapt->
-						   logical_drive_info,
-						   scb->data_len,
-						   IPS_DMA_DIR(scb));
-				scb->flags |= IPS_SCB_MAP_SINGLE;
-				scb->cmd.logical_info.buffer_addr =
-				    scb->data_busaddr;
+				scb->data_len = sizeof (IPS_LD_INFO);
+				scb->data_busaddr = ha->logical_drive_info_dma_addr;
+				scb->flags = 0;
+				scb->cmd.logical_info.buffer_addr = scb->data_busaddr;
 				ret = IPS_SUCCESS;
 			}
 
@@ -3967,18 +3997,13 @@
 
 		case READ_CAPACITY:
 			scb->cmd.logical_info.op_code = IPS_CMD_GET_LD_INFO;
-			scb->cmd.logical_info.command_id =
-			    IPS_COMMAND_ID(ha, scb);
+			scb->cmd.logical_info.command_id = IPS_COMMAND_ID(ha, scb);
 			scb->cmd.logical_info.reserved = 0;
 			scb->cmd.logical_info.reserved2 = 0;
 			scb->cmd.logical_info.reserved3 = 0;
-			scb->data_len = sizeof (ha->adapt->logical_drive_info);
-			scb->data_busaddr = pci_map_single(ha->pcidev,
-							   &ha->adapt->
-							   logical_drive_info,
-							   scb->data_len,
-							   IPS_DMA_DIR(scb));
-			scb->flags |= IPS_SCB_MAP_SINGLE;
+			scb->data_len = sizeof (IPS_LD_INFO);
+			scb->data_busaddr = ha->logical_drive_info_dma_addr;
+			scb->flags = 0;
 			scb->cmd.logical_info.buffer_addr = scb->data_busaddr;
 			ret = IPS_SUCCESS;
 			break;
@@ -4302,19 +4327,17 @@
 		return (0);
 
 	if ((scb->basic_status & IPS_GSC_STATUS_MASK) > 1) {
-		memset(&ha->adapt->logical_drive_info, 0,
-		       sizeof (ha->adapt->logical_drive_info));
-
+		memset(ha->logical_drive_info, 0, sizeof (IPS_LD_INFO));
 		return (0);
 	}
 
-	if (ha->adapt->logical_drive_info.drive_info[scb->target_id].state !=
+	if (ha->logical_drive_info->drive_info[scb->target_id].state !=
 	    IPS_LD_OFFLINE
-	    && ha->adapt->logical_drive_info.drive_info[scb->target_id].state !=
+	    && ha->logical_drive_info->drive_info[scb->target_id].state !=
 	    IPS_LD_FREE
-	    && ha->adapt->logical_drive_info.drive_info[scb->target_id].state !=
+	    && ha->logical_drive_info->drive_info[scb->target_id].state !=
 	    IPS_LD_CRS
-	    && ha->adapt->logical_drive_info.drive_info[scb->target_id].state !=
+	    && ha->logical_drive_info->drive_info[scb->target_id].state !=
 	    IPS_LD_SYS)
 		return (1);
 	else
@@ -4377,7 +4400,7 @@
 
 	cap.lba =
 	    cpu_to_be32(le32_to_cpu
-			(ha->adapt->logical_drive_info.
+			(ha->logical_drive_info->
 			 drive_info[scb->target_id].sector_count) - 1);
 	cap.len = cpu_to_be32((uint32_t) IPS_BLKSIZE);
 
@@ -4541,6 +4564,14 @@
 			ha->adapt = NULL;
 		}
 
+		if (ha->logical_drive_info) {
+			pci_free_consistent(ha->pcidev,
+					    sizeof (IPS_LD_INFO),
+					    ha->logical_drive_info,
+					    ha->logical_drive_info_dma_addr);
+			ha->logical_drive_info = NULL;
+		}
+
 		if (ha->nvram) {
 			kfree(ha->nvram);
 			ha->nvram = NULL;
@@ -4730,6 +4761,7 @@
 	}
 
 	ha->scb_freelist = scb->q_next;
+	scb->flags = 0;
 	scb->q_next = NULL;
 
 	ips_init_scb(ha, scb);
@@ -6777,7 +6809,7 @@
 static void
 ips_version_check(ips_ha_t * ha, int intr)
 {
-	IPS_VERSION_DATA VersionInfo;
+	IPS_VERSION_DATA *VersionInfo;
 	uint8_t FirmwareVersion[IPS_COMPAT_ID_LENGTH + 1];
 	uint8_t BiosVersion[IPS_COMPAT_ID_LENGTH + 1];
 	int MatchError;
@@ -6787,6 +6819,8 @@
 
 	METHOD_TRACE("ips_version_check", 1);
 
+	VersionInfo = ( IPS_VERSION_DATA * ) ha->ioctl_data;
+
 	memset(FirmwareVersion, 0, IPS_COMPAT_ID_LENGTH + 1);
 	memset(BiosVersion, 0, IPS_COMPAT_ID_LENGTH + 1);
 
@@ -6797,9 +6831,10 @@
 	rc = IPS_FAILURE;
 	if (ha->subsys->param[4] & IPS_GET_VERSION_SUPPORT) {	/* If Versioning is Supported */
 		/* Get the Version Info with a Get Version Command */
-		rc = ips_get_version_info(ha, &VersionInfo, intr);
+		memset( VersionInfo, 0, sizeof (IPS_VERSION_DATA));
+		rc = ips_get_version_info(ha, ha->ioctl_busaddr, intr);
 		if (rc == IPS_SUCCESS)
-			memcpy(FirmwareVersion, VersionInfo.compatibilityId,
+			memcpy(FirmwareVersion, VersionInfo->compatibilityId,
 			       IPS_COMPAT_ID_LENGTH);
 	}
 
@@ -6862,14 +6897,13 @@
 /*     0 if Successful, else non-zero                                        */
 /*---------------------------------------------------------------------------*/
 static int
-ips_get_version_info(ips_ha_t * ha, IPS_VERSION_DATA * Buffer, int intr)
+ips_get_version_info(ips_ha_t * ha, dma_addr_t Buffer, int intr)
 {
 	ips_scb_t *scb;
 	int rc;
 
 	METHOD_TRACE("ips_get_version_info", 1);
 
-	memset(Buffer, 0, sizeof (IPS_VERSION_DATA));
 	scb = &ha->scbs[ha->max_cmds - 1];
 
 	ips_init_scb(ha, scb);
@@ -6881,11 +6915,10 @@
 	scb->cmd.version_info.reserved = 0;
 	scb->cmd.version_info.count = sizeof (IPS_VERSION_DATA);
 	scb->cmd.version_info.reserved2 = 0;
-	scb->data_len = sizeof (*Buffer);
-	scb->data_busaddr = pci_map_single(ha->pcidev, Buffer,
-					   scb->data_len, IPS_DMA_DIR(scb));
-	scb->cmd.version_info.buffer_addr = scb->data_busaddr;
-	scb->flags |= IPS_SCB_MAP_SINGLE;
+	scb->data_len = sizeof (IPS_VERSION_DATA);
+	scb->data_busaddr = Buffer;
+	scb->cmd.version_info.buffer_addr = Buffer;
+	scb->flags = 0;
 
 	/* issue command */
 	rc = ips_send_wait(ha, scb, ips_cmd_timeout, intr);
@@ -7355,6 +7388,17 @@
 	}
 	ha->adapt->hw_status_start = dma_address;
 	ha->dummy = (void *) (ha->adapt + 1);
+
+
+
+	ha->logical_drive_info = pci_alloc_consistent(pci_dev, sizeof (IPS_LD_INFO), &dma_address);
+	if (!ha->logical_drive_info) {
+		IPS_PRINTK(KERN_WARNING, pci_dev,
+			   "Unable to allocate logical drive info structure\n");
+		return ips_abort_init(ha, index);
+	}
+	ha->logical_drive_info_dma_addr = dma_address;
+
 
 	ha->conf = kmalloc(sizeof (IPS_CONF), GFP_KERNEL);
 
diff -Nru a/drivers/scsi/ips.h b/drivers/scsi/ips.h
--- a/drivers/scsi/ips.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/scsi/ips.h	Tue Feb  3 19:45:17 2004
@@ -711,7 +711,6 @@
    volatile PIPS_STATUS p_status_tail;
    volatile uint32_t    hw_status_start;
    volatile uint32_t    hw_status_tail;
-   IPS_LD_INFO          logical_drive_info;
 } IPS_ADAPTER, *PIPS_ADAPTER;
 
 typedef struct {
@@ -1084,6 +1083,8 @@
    ips_scb_queue_t    scb_activelist;     /* Active SCB list            */
    IPS_IO_CMD        *dummy;              /* dummy command              */
    IPS_ADAPTER       *adapt;              /* Adapter status area        */
+   IPS_LD_INFO       *logical_drive_info; /* Adapter Logical Drive Info */
+   dma_addr_t         logical_drive_info_dma_addr; /* Logical Drive Info DMA Address */
    IPS_ENQ           *enq;                /* Adapter Enquiry data       */
    IPS_CONF          *conf;               /* Adapter config data        */
    IPS_NVRAM_P5      *nvram;              /* NVRAM page 5 data          */
@@ -1132,7 +1133,7 @@
    uint8_t           lun;
    uint8_t           cdb[12];
    uint32_t          scb_busaddr;
-   uint32_t          data_busaddr;
+   uint32_t          old_data_busaddr;  // Obsolete, but kept for old utility compatibility
    uint32_t          timeout;
    uint8_t           basic_status;
    uint8_t           extended_status;
@@ -1148,6 +1149,7 @@
    ips_scb_callback  callback;
    uint32_t          sg_busaddr;
    int               sg_count;
+   dma_addr_t        data_busaddr;
 } ips_scb_t;
 
 typedef struct ips_scb_pt {
@@ -1201,15 +1203,15 @@
 *
 *************************************************************************/
 
-#define IPS_VER_MAJOR 6
-#define IPS_VER_MAJOR_STRING "6"
-#define IPS_VER_MINOR 10
-#define IPS_VER_MINOR_STRING "10"
-#define IPS_VER_BUILD 90
-#define IPS_VER_BUILD_STRING "90"
-#define IPS_VER_STRING "6.10.90"
-#define IPS_RELEASE_ID 0x00010000
-#define IPS_BUILD_IDENT 364
+#define IPS_VER_MAJOR 7
+#define IPS_VER_MAJOR_STRING "7"
+#define IPS_VER_MINOR 00
+#define IPS_VER_MINOR_STRING "00"
+#define IPS_VER_BUILD 00
+#define IPS_VER_BUILD_STRING "00"
+#define IPS_VER_STRING "7.00.00"
+#define IPS_RELEASE_ID 0x00010001
+#define IPS_BUILD_IDENT 475
 #define IPS_LEGALCOPYRIGHT_STRING "(C) Copyright IBM Corp. 1994, 2003. All Rights Reserved."
 #define IPS_ADAPTECCOPYRIGHT_STRING "(c) Copyright Adaptec, Inc. 2002 to present. All Rights Reserved."
 #define IPS_NT_LEGALCOPYRIGHT_STRING "(C) Copyright IBM Corp. 1994, 2003."
@@ -1219,11 +1221,11 @@
 #define IPS_VER_SERVERAID2 "2.88.13"
 #define IPS_VER_NAVAJO "2.88.13"
 #define IPS_VER_SERVERAID3 "6.10.24"
-#define IPS_VER_SERVERAID4H "6.10.24"
-#define IPS_VER_SERVERAID4MLx "6.10.24"
-#define IPS_VER_SARASOTA "6.10.24"
-#define IPS_VER_MARCO "6.10.24"
-#define IPS_VER_SEBRING "6.10.24"
+#define IPS_VER_SERVERAID4H "6.11.07"
+#define IPS_VER_SERVERAID4MLx "6.11.07"
+#define IPS_VER_SARASOTA "6.11.07"
+#define IPS_VER_MARCO "6.11.07"
+#define IPS_VER_SEBRING "6.11.07"
 
 /* Compatability IDs for various adapters */
 #define IPS_COMPAT_UNKNOWN ""
diff -Nru a/drivers/scsi/mac_esp.c b/drivers/scsi/mac_esp.c
--- a/drivers/scsi/mac_esp.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/scsi/mac_esp.c	Tue Feb  3 19:45:18 2004
@@ -46,7 +46,7 @@
 #define mac_turnon_irq(x)	mac_enable_irq(x)
 #define mac_turnoff_irq(x)	mac_disable_irq(x)
 
-extern inline void esp_handle(struct NCR_ESP *esp);
+extern void esp_handle(struct NCR_ESP *esp);
 extern void mac_esp_intr(int irq, void *dev_id, struct pt_regs *pregs);
 
 static int  dma_bytes_sent(struct NCR_ESP * esp, int fifo_count);
@@ -151,92 +151,98 @@
 #define DRIVER_SETUP
 
 /*
- * Function : mac_esp_setup(char *str, int *ints)
+ * Function : mac_esp_setup(char *str)
  *
  * Purpose : booter command line initialization of the overrides array,
  *
- * Inputs : str - unused, ints - array of integer parameters with ints[0]
- *	equal to the number of ints.
+ * Inputs : str - parameters, separated by commas.
  *
  * Currently unused in the new driver; need to add settable parameters to the 
  * detect function.
  *
  */
 
-static int __init mac_esp_setup(char *str, int *ints) {
+static int __init mac_esp_setup(char *str) {
 #ifdef DRIVER_SETUP
 	/* Format of mac53c9x parameter is:
 	 *   mac53c9x=<num_esps>,<disconnect>,<nosync>,<can_queue>,<cmd_per_lun>,<sg_tablesize>,<hostid>,<use_tags>
 	 * Negative values mean don't change.
 	 */
 	
-	/* Grmbl... the standard parameter parsing can't handle negative numbers
-	 * :-( So let's do it ourselves!
-	 */
+	char *this_opt;
+	long opt;
 
-	int i = ints[0]+1, fact;
+	this_opt = strsep (&str, ",");
+	if(this_opt) {
+		opt = simple_strtol( this_opt, NULL, 0 );
+
+		if (opt >= 0 && opt <= 2)
+			setup_num_esps = opt;
+		else if (opt > 2)
+			printk( "mac_esp_setup: invalid number of hosts %ld !\n", opt );
 
-	while( str && (isdigit(*str) || *str == '-') && i <= 10) {
-		if (*str == '-')
-			fact = -1, ++str;
-		else
-			fact = 1;
-		ints[i++] = simple_strtoul( str, NULL, 0 ) * fact;
-		if ((str = strchr( str, ',' )) != NULL)
-			++str;
+		this_opt = strsep (&str, ",");
 	}
-	ints[0] = i-1;
+	if(this_opt) {
+		opt = simple_strtol( this_opt, NULL, 0 );
 	
-	if (ints[0] < 1) {
-		printk( "mac_esp_setup: no arguments!\n" );
-		return 0;
-	}
-
-	if (ints[0] >= 1) {
-		if (ints[1] > 0)
-			/* no limits on this, just > 0 */
-		if (ints[1] >= 0 && ints[1] <= 2)
-			setup_num_esps = ints[1];
-		else if (ints[1] > 2)
-			printk( "mac_esp_setup: invalid number of hosts %d !\n", ints[1] );
-	}
-	if (ints[0] >= 2) {
-		if (ints[2] > 0)
-			setup_disconnect = ints[2];
-	}
-	if (ints[0] >= 3) {
-		if (ints[3] >= 0) {
-			setup_nosync = ints[3];
-		}
+		if (opt > 0)
+			setup_disconnect = opt;
+
+		this_opt = strsep (&str, ",");
+	}
+	if(this_opt) {
+		opt = simple_strtol( this_opt, NULL, 0 );
+
+		if (opt >= 0)
+			setup_nosync = opt;
+
+		this_opt = strsep (&str, ",");
+	}
+	if(this_opt) {
+		opt = simple_strtol( this_opt, NULL, 0 );
+
+		if (opt > 0)
+			setup_can_queue = opt;
+
+		this_opt = strsep (&str, ",");
 	}
-	if (ints[0] >= 4) {
-		if (ints[4] > 0)
-			/* no limits on this, just > 0 */
-			setup_can_queue = ints[4];
-	}
-	if (ints[0] >= 5) {
-		if (ints[5] > 0)
-			setup_cmd_per_lun = ints[5];
-	}
-	if (ints[0] >= 6) {
-		if (ints[6] >= 0) {
-			setup_sg_tablesize = ints[6];
+	if(this_opt) {
+		opt = simple_strtol( this_opt, NULL, 0 );
+
+		if (opt > 0)
+			setup_cmd_per_lun = opt;
+
+		this_opt = strsep (&str, ",");
+	}
+	if(this_opt) {
+		opt = simple_strtol( this_opt, NULL, 0 );
+
+		if (opt >= 0) {
+			setup_sg_tablesize = opt;
 			/* Must be <= SG_ALL (255) */
 			if (setup_sg_tablesize > SG_ALL)
 				setup_sg_tablesize = SG_ALL;
 		}
+
+		this_opt = strsep (&str, ",");
 	}
-	if (ints[0] >= 7) {
+	if(this_opt) {
+		opt = simple_strtol( this_opt, NULL, 0 );
+
 		/* Must be between 0 and 7 */
-		if (ints[7] >= 0 && ints[7] <= 7)
-			setup_hostid = ints[7];
-		else if (ints[7] > 7)
-			printk( "mac_esp_setup: invalid host ID %d !\n", ints[7] );
+		if (opt >= 0 && opt <= 7)
+			setup_hostid = opt;
+		else if (opt > 7)
+			printk( "mac_esp_setup: invalid host ID %ld !\n", opt);
+
+		this_opt = strsep (&str, ",");
 	}
 #ifdef SUPPORT_TAGS
-	if (ints[0] >= 8) {
-		if (ints[8] >= 0)
-			setup_use_tagged_queuing = !!ints[8];
+	if(this_opt) {
+		opt = simple_strtol( this_opt, NULL, 0 );
+		if (opt >= 0)
+			setup_use_tagged_queuing = !!opt;
 	}
 #endif
 #endif
@@ -244,6 +250,7 @@
 }
 
 __setup("mac53c9x=", mac_esp_setup);
+
 
 /*
  * ESP address 'detection'
diff -Nru a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c
--- a/drivers/scsi/mac_scsi.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/scsi/mac_scsi.c	Tue Feb  3 19:45:16 2004
@@ -74,9 +74,6 @@
 static void mac_scsi_reset_boot(struct Scsi_Host *instance);
 #endif
 
-static __inline__ char macscsi_read(struct Scsi_Host *instance, int reg);
-static __inline__ void macscsi_write(struct Scsi_Host *instance, int reg, int value);
-
 static int setup_called = 0;
 static int setup_can_queue = -1;
 static int setup_cmd_per_lun = -1;
@@ -102,6 +99,52 @@
 static volatile unsigned char *mac_scsi_drq  = NULL;
 static volatile unsigned char *mac_scsi_nodrq = NULL;
 
+
+/*
+ * NCR 5380 register access functions
+ */
+
+#if 0
+/* Debug versions */
+#define CTRL(p,v) (*ctrl = (v))
+
+static char macscsi_read(struct Scsi_Host *instance, int reg)
+{
+  int iobase = instance->io_port;
+  int i;
+  int *ctrl = &((struct NCR5380_hostdata *)instance->hostdata)->ctrl;
+
+  CTRL(iobase, 0);
+  i = in_8(iobase + (reg<<4));
+  CTRL(iobase, 0x40);
+
+  return i;
+}
+
+static void macscsi_write(struct Scsi_Host *instance, int reg, int value)
+{
+  int iobase = instance->io_port;
+  int *ctrl = &((struct NCR5380_hostdata *)instance->hostdata)->ctrl;
+
+  CTRL(iobase, 0);
+  out_8(iobase + (reg<<4), value);
+  CTRL(iobase, 0x40);
+}
+#else
+
+/* Fast versions */
+static __inline__ char macscsi_read(struct Scsi_Host *instance, int reg)
+{
+  return in_8(instance->io_port + (reg<<4));
+}
+
+static __inline__ void macscsi_write(struct Scsi_Host *instance, int reg, int value)
+{
+  out_8(instance->io_port + (reg<<4), value);
+}
+#endif
+
+
 /*
  * Function : mac_scsi_setup(char *str)
  *
@@ -163,18 +206,20 @@
 	    if (ints[5] >= 0)
 		setup_use_pdma = ints[5];
 	}
-#endif
+#endif /* SUPPORT_TAGS */
 	
-#endif
+#endif /* DRIVER_SETUP */
 	return 1;
 }
 
 __setup("mac5380=", mac_scsi_setup);
 
 /*
- * XXX: status debug
+ * If you want to find the instance with (k)gdb ...
  */
+#if NDEBUG
 static struct Scsi_Host *default_instance;
+#endif
 
 /*
  * Function : int macscsi_detect(Scsi_Host_Template * tpnt)
@@ -223,7 +268,9 @@
     /* Once we support multiple 5380s (e.g. DuoDock) we'll do
        something different here */
     instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
+#if NDEBUG
     default_instance = instance;
+#endif
     
     if (macintosh_config->ident == MAC_MODEL_IIFX) {
 	mac_scsi_regp  = via1+0x8000;
@@ -330,49 +377,6 @@
 const char * macscsi_info (struct Scsi_Host *spnt) {
 	return "";
 }
-
-/*
- * NCR 5380 register access functions
- */
-
-/* Debug versions
-#define CTRL(p,v) (*ctrl = (v))
-
-static char macscsi_read(struct Scsi_Host *instance, int reg)
-{
-  int iobase = instance->io_port;
-  int i;
-  int *ctrl = &((struct NCR5380_hostdata *)instance->hostdata)->ctrl;
-
-  CTRL(iobase, 0);
-  i = in_8(iobase + (reg<<4));
-  CTRL(iobase, 0x40);
-
-  return i;
-}
-
-static void macscsi_write(struct Scsi_Host *instance, int reg, int value)
-{
-  int iobase = instance->io_port;
-  int *ctrl = &((struct NCR5380_hostdata *)instance->hostdata)->ctrl;
-
-  CTRL(iobase, 0);
-  out_8(value, iobase + (reg<<4));
-  CTRL(iobase, 0x40);
-}
-*/
-
-/* Fast versions */
-static __inline__ char macscsi_read(struct Scsi_Host *instance, int reg)
-{
-  return in_8(instance->io_port + (reg<<4));
-}
-
-static __inline__ void macscsi_write(struct Scsi_Host *instance, int reg, int value)
-{
-  out_8(value, instance->io_port + (reg<<4));
-}
-
 
 /* 
    Pseudo-DMA: (Ove Edlund)
diff -Nru a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
--- a/drivers/scsi/megaraid.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/scsi/megaraid.c	Tue Feb  3 19:45:16 2004
@@ -5093,7 +5093,7 @@
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_AMI_MEGARAID3,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-	{PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_AMI_MEGARAID,
+	{PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_AMI_MEGARAID3,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{0,}
 };
diff -Nru a/drivers/scsi/mvme16x.c b/drivers/scsi/mvme16x.c
--- a/drivers/scsi/mvme16x.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/scsi/mvme16x.c	Tue Feb  3 19:45:41 2004
@@ -21,9 +21,6 @@
 
 #include<linux/stat.h>
 
-extern int ncr53c7xx_init(Scsi_Host_Template *tpnt, int board, int chip,
-			  unsigned long base, int io_port, int irq, int dma,
-			  long long options, int clock);
 
 int mvme16x_scsi_detect(Scsi_Host_Template *tpnt)
 {
diff -Nru a/drivers/scsi/nsp32.h b/drivers/scsi/nsp32.h
--- a/drivers/scsi/nsp32.h	Tue Feb  3 19:45:16 2004
+++ b/drivers/scsi/nsp32.h	Tue Feb  3 19:45:16 2004
@@ -667,10 +667,5 @@
 }
 #endif
 
-/* for Kernel 2.6 */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
-# define __devinitdata /* */
-#endif
-
 #endif /* _NSP32_H */
 /* end */
diff -Nru a/drivers/scsi/nsp32_io.h b/drivers/scsi/nsp32_io.h
--- a/drivers/scsi/nsp32_io.h	Tue Feb  3 19:45:42 2004
+++ b/drivers/scsi/nsp32_io.h	Tue Feb  3 19:45:42 2004
@@ -173,7 +173,7 @@
 
 /*==============================================*/
 
-static inline unsigned char nsp32_mmio_index_read1(unsigned int base,
+static inline unsigned char nsp32_mmio_index_read1(unsigned long base,
 						   unsigned int reg)
 {
 	volatile unsigned short *index_ptr, *data_ptr;
@@ -185,7 +185,7 @@
 	return readb(data_ptr);
 }
 
-static inline void nsp32_mmio_index_write1(unsigned int  base,
+static inline void nsp32_mmio_index_write1(unsigned long base,
 					   unsigned int  reg,
 					   unsigned char val)
 {
@@ -198,8 +198,8 @@
 	writeb(val, data_ptr );
 }
 
-static inline unsigned short nsp32_mmio_index_read2(unsigned int base,
-						    unsigned int reg)
+static inline unsigned short nsp32_mmio_index_read2(unsigned long base,
+						    unsigned int  reg)
 {
 	volatile unsigned short *index_ptr, *data_ptr;
 
@@ -210,7 +210,7 @@
 	return le16_to_cpu(readw(data_ptr));
 }
 
-static inline void nsp32_mmio_index_write2(unsigned int   base,
+static inline void nsp32_mmio_index_write2(unsigned long  base,
 					   unsigned int   reg,
 					   unsigned short val)
 {
diff -Nru a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
--- a/drivers/scsi/pcmcia/aha152x_stub.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/scsi/pcmcia/aha152x_stub.c	Tue Feb  3 19:45:42 2004
@@ -153,7 +153,7 @@
 	CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != 0) {
 	cs_error(link->handle, RegisterClient, ret);
 	aha152x_detach(link);
@@ -181,7 +181,7 @@
 	aha152x_release_cs(link);
 
     if (link->handle)
-	CardServices(DeregisterClient, link->handle);
+	pcmcia_deregister_client(link->handle);
     
     /* Unlink device structure, free bits */
     *linkp = link->next;
@@ -191,11 +191,8 @@
 
 /*====================================================================*/
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
-
-#define CFG_CHECK(fn, args...) \
-if (CardServices(fn, args) != 0) goto next_entry
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static void aha152x_config_cs(dev_link_t *link)
 {
@@ -214,19 +211,20 @@
     tuple.TupleData = tuple_data;
     tuple.TupleDataMax = 64;
     tuple.TupleOffset = 0;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
-    CS_CHECK(GetTupleData, handle, &tuple);
-    CS_CHECK(ParseTuple, handle, &tuple, &parse);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+    CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
     link->conf.ConfigBase = parse.config.base;
 
     /* Configure card */
     link->state |= DEV_CONFIG;
 
     tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
     while (1) {
-	CFG_CHECK(GetTupleData, handle, &tuple);
-	CFG_CHECK(ParseTuple, handle, &tuple, &parse);
+	if (pcmcia_get_tuple_data(handle, &tuple) != 0 ||
+		pcmcia_parse_tuple(handle, &tuple, &parse) != 0)
+	    goto next_entry;
 	/* For New Media T&J, look for a SCSI window */
 	if (parse.cftable_entry.io.win[0].len >= 0x20)
 	    link->io.BasePort1 = parse.cftable_entry.io.win[0].base;
@@ -236,15 +234,15 @@
 	if ((parse.cftable_entry.io.nwin > 0) &&
 	    (link->io.BasePort1 < 0xffff)) {
 	    link->conf.ConfigIndex = parse.cftable_entry.index;
-	    i = CardServices(RequestIO, handle, &link->io);
+	    i = pcmcia_request_io(handle, &link->io);
 	    if (i == CS_SUCCESS) break;
 	}
     next_entry:
-	CS_CHECK(GetNextTuple, handle, &tuple);
+	CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));
     }
     
-    CS_CHECK(RequestIRQ, handle, &link->irq);
-    CS_CHECK(RequestConfiguration, handle, &link->conf);
+    CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq));
+    CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf));
     
     /* A bad hack... */
     release_region(link->io.BasePort1, link->io.NumPorts1);
@@ -291,9 +289,9 @@
 	scsi_remove_host(info->host);
 	link->dev = NULL;
     
-	CardServices(ReleaseConfiguration, link->handle);
-	CardServices(ReleaseIO, link->handle, &link->io);
-	CardServices(ReleaseIRQ, link->handle, &link->irq);
+	pcmcia_release_configuration(link->handle);
+	pcmcia_release_io(link->handle, &link->io);
+	pcmcia_release_irq(link->handle, &link->irq);
     
 	link->state &= ~DEV_CONFIG;
 	scsi_unregister(info->host);
@@ -322,7 +320,7 @@
 	/* Fall through... */
     case CS_EVENT_RESET_PHYSICAL:
 	if (link->state & DEV_CONFIG)
-	    CardServices(ReleaseConfiguration, link->handle);
+	    pcmcia_release_configuration(link->handle);
 	break;
     case CS_EVENT_PM_RESUME:
 	link->state &= ~DEV_SUSPEND;
@@ -330,7 +328,7 @@
     case CS_EVENT_CARD_RESET:
 	if (link->state & DEV_CONFIG) {
 	    Scsi_Cmnd tmp;
-	    CardServices(RequestConfiguration, link->handle, &link->conf);
+	    pcmcia_request_configuration(link->handle, &link->conf);
 	    tmp.device->host = info->host;
 	    aha152x_host_reset(&tmp);
 	}
diff -Nru a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
--- a/drivers/scsi/pcmcia/fdomain_stub.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/scsi/pcmcia/fdomain_stub.c	Tue Feb  3 19:45:29 2004
@@ -142,7 +142,7 @@
 	CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != 0) {
 	cs_error(link->handle, RegisterClient, ret);
 	fdomain_detach(link);
@@ -170,7 +170,7 @@
 	fdomain_release(link);
 
     if (link->handle)
-	CardServices(DeregisterClient, link->handle);
+	pcmcia_deregister_client(link->handle);
     
     /* Unlink device structure, free bits */
     *linkp = link->next;
@@ -180,11 +180,8 @@
 
 /*====================================================================*/
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
-
-#define CFG_CHECK(fn, args...) \
-if (CardServices(fn, args) != 0) goto next_entry
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static void fdomain_config(dev_link_t *link)
 {
@@ -203,29 +200,30 @@
     tuple.TupleData = tuple_data;
     tuple.TupleDataMax = 64;
     tuple.TupleOffset = 0;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
-    CS_CHECK(GetTupleData, handle, &tuple);
-    CS_CHECK(ParseTuple, handle, &tuple, &parse);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+    CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
     link->conf.ConfigBase = parse.config.base;
 
     /* Configure card */
     link->state |= DEV_CONFIG;
     
     tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
     while (1) {
-	CFG_CHECK(GetTupleData, handle, &tuple);
-	CFG_CHECK(ParseTuple, handle, &tuple, &parse);
+	if (pcmcia_get_tuple_data(handle, &tuple) != 0 ||
+		pcmcia_parse_tuple(handle, &tuple, &parse) != 0)
+	    goto next_entry;
 	link->conf.ConfigIndex = parse.cftable_entry.index;
 	link->io.BasePort1 = parse.cftable_entry.io.win[0].base;
-	i = CardServices(RequestIO, handle, &link->io);
+	i = pcmcia_request_io(handle, &link->io);
 	if (i == CS_SUCCESS) break;
     next_entry:
-	CS_CHECK(GetNextTuple, handle, &tuple);
+	CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));
     }
 
-    CS_CHECK(RequestIRQ, handle, &link->irq);
-    CS_CHECK(RequestConfiguration, handle, &link->conf);
+    CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq));
+    CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf));
     
     /* A bad hack... */
     release_region(link->io.BasePort1, link->io.NumPorts1);
@@ -271,9 +269,9 @@
     scsi_remove_host(info->host);
     link->dev = NULL;
     
-    CardServices(ReleaseConfiguration, link->handle);
-    CardServices(ReleaseIO, link->handle, &link->io);
-    CardServices(ReleaseIRQ, link->handle, &link->irq);
+    pcmcia_release_configuration(link->handle);
+    pcmcia_release_io(link->handle, &link->io);
+    pcmcia_release_irq(link->handle, &link->irq);
 
     scsi_unregister(info->host);
 
@@ -304,14 +302,14 @@
 	/* Fall through... */
     case CS_EVENT_RESET_PHYSICAL:
 	if (link->state & DEV_CONFIG)
-	    CardServices(ReleaseConfiguration, link->handle);
+	    pcmcia_release_configuration(link->handle);
 	break;
     case CS_EVENT_PM_RESUME:
 	link->state &= ~DEV_SUSPEND;
 	/* Fall through... */
     case CS_EVENT_CARD_RESET:
 	if (link->state & DEV_CONFIG) {
-	    CardServices(RequestConfiguration, link->handle, &link->conf);
+	    pcmcia_request_configuration(link->handle, &link->conf);
 	    fdomain_16x0_bus_reset(NULL);
 	}
 	break;
diff -Nru a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
--- a/drivers/scsi/pcmcia/nsp_cs.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/scsi/pcmcia/nsp_cs.c	Tue Feb  3 19:45:42 2004
@@ -1681,7 +1681,7 @@
 	client_reg.event_handler = &nsp_cs_event;
 	client_reg.Version	 = 0x0210;
 	client_reg.event_callback_args.client_data = link;
-	ret = CardServices(RegisterClient, &link->handle, &client_reg);
+	ret = pcmcia_register_client(&link->handle, &client_reg);
 	if (ret != CS_SUCCESS) {
 		cs_error(link->handle, RegisterClient, ret);
 		nsp_cs_detach(link);
@@ -1721,7 +1721,7 @@
 
 	/* Break the link with Card Services */
 	if (link->handle) {
-		CardServices(DeregisterClient, link->handle);
+		pcmcia_deregister_client(link->handle);
 	}
 
 	/* Unlink device structure, free bits */
@@ -1737,10 +1737,8 @@
     is received, to configure the PCMCIA socket, and to make the
     ethernet device available to the system.
 ======================================================================*/
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn),args))!=0) goto cs_failed
-#define CFG_CHECK(fn, args...) \
-if (CardServices(fn, args) != 0) goto next_entry
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 /*====================================================================*/
 static void nsp_cs_config(dev_link_t *link)
 {
@@ -1768,9 +1766,9 @@
 	tuple.TupleData	      = tuple_data;
 	tuple.TupleDataMax    = sizeof(tuple_data);
 	tuple.TupleOffset     = 0;
-	CS_CHECK(GetFirstTuple, handle, &tuple);
-	CS_CHECK(GetTupleData,	handle, &tuple);
-	CS_CHECK(ParseTuple,	handle, &tuple, &parse);
+	CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+	CS_CHECK(GetTupleData,	pcmcia_get_tuple_data(handle, &tuple));
+	CS_CHECK(ParseTuple,	pcmcia_parse_tuple(handle, &tuple, &parse));
 	link->conf.ConfigBase = parse.config.base;
 	link->conf.Present    = parse.config.rmask[0];
 
@@ -1778,16 +1776,17 @@
 	link->state	      |= DEV_CONFIG;
 
 	/* Look up the current Vcc */
-	CS_CHECK(GetConfigurationInfo, handle, &conf);
+	CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf));
 	link->conf.Vcc = conf.Vcc;
 
 	tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
-	CS_CHECK(GetFirstTuple, handle, &tuple);
+	CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
 	while (1) {
 		cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
 
-		CFG_CHECK(GetTupleData, handle, &tuple);
-		CFG_CHECK(ParseTuple,	handle, &tuple, &parse);
+		if (pcmcia_get_tuple_data(handle, &tuple) != 0 ||
+				pcmcia_parse_tuple(handle, &tuple, &parse) != 0)
+			goto next_entry;
 
 		if (cfg->flags & CISTPL_CFTABLE_DEFAULT) { dflt = *cfg; }
 		if (cfg->index == 0) { goto next_entry; }
@@ -1842,7 +1841,8 @@
 				link->io.NumPorts2 = io->win[1].len;
 			}
 			/* This reserves IO space but doesn't actually enable it */
-			CFG_CHECK(RequestIO, link->handle, &link->io);
+			if (pcmcia_request_io(link->handle, &link->io) != 0)
+				goto next_entry;
 		}
 
 		if ((cfg->mem.nwin > 0) || (dflt.mem.nwin > 0)) {
@@ -1856,10 +1856,11 @@
 				req.Size = 0x1000;
 			}
 			req.AccessSpeed = 0;
-			link->win = (window_handle_t)link->handle;
-			CFG_CHECK(RequestWindow, &link->win, &req);
+			if (pcmcia_request_window(&link->handle, &req, &link->win) != 0)
+				goto next_entry;
 			map.Page = 0; map.CardOffset = mem->win[0].card_addr;
-			CFG_CHECK(MapMemPage, link->win, &map);
+			if (pcmcia_map_mem_page(link->win, &map) != 0)
+				goto next_entry;
 
 			data->MmioAddress = (unsigned long)ioremap_nocache(req.Base, req.Size);
 			data->MmioLength  = req.Size;
@@ -1871,15 +1872,15 @@
 		nsp_dbg(NSP_DEBUG_INIT, "next");
 
 		if (link->io.NumPorts1) {
-			CardServices(ReleaseIO, link->handle, &link->io);
+			pcmcia_release_io(link->handle, &link->io);
 		}
-		CS_CHECK(GetNextTuple, handle, &tuple);
+		CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));
 	}
 
 	if (link->conf.Attributes & CONF_ENABLE_IRQ) {
-		CS_CHECK(RequestIRQ, link->handle, &link->irq);
+		CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));
 	}
-	CS_CHECK(RequestConfiguration, handle, &link->conf);
+	CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf));
 
 	if (free_ports) {
 		if (link->io.BasePort1) {
@@ -2007,7 +2008,6 @@
 	return;
 } /* nsp_cs_config */
 #undef CS_CHECK
-#undef CFG_CHECK
 
 
 /*======================================================================
@@ -2042,14 +2042,14 @@
 		if (data != NULL) {
 			iounmap((void *)(data->MmioAddress));
 		}
-		CardServices(ReleaseWindow, link->win);
+		pcmcia_release_window(link->win);
 	}
-	CardServices(ReleaseConfiguration,  link->handle);
+	pcmcia_release_configuration(link->handle);
 	if (link->io.NumPorts1) {
-		CardServices(ReleaseIO,     link->handle, &link->io);
+		pcmcia_release_io(link->handle, &link->io);
 	}
 	if (link->irq.AssignedIRQ) {
-		CardServices(ReleaseIRQ,    link->handle, &link->irq);
+		pcmcia_release_irq(link->handle, &link->irq);
 	}
 	link->state &= ~DEV_CONFIG;
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,2))
@@ -2119,7 +2119,7 @@
 
 		info->stop = 1;
 		if (link->state & DEV_CONFIG) {
-			CardServices(ReleaseConfiguration, link->handle);
+			pcmcia_release_configuration(link->handle);
 		}
 		break;
 
@@ -2130,7 +2130,7 @@
 	case CS_EVENT_CARD_RESET:
 		nsp_dbg(NSP_DEBUG_INIT, "event: reset");
 		if (link->state & DEV_CONFIG) {
-			CardServices(RequestConfiguration, link->handle, &link->conf);
+			pcmcia_request_configuration(link->handle, &link->conf);
 		}
 		info->stop = 0;
 
@@ -2177,7 +2177,7 @@
 	servinfo_t serv;
 
 	nsp_msg(KERN_INFO, "loading...");
-	CardServices(GetCardServicesInfo, &serv);
+	pcmcia_get_card_services_info(&serv);
 	if (serv.Revision != CS_RELEASE_CODE) {
 		nsp_msg(KERN_DEBUG, "Card Services release does not match!");
 		return -EINVAL;
diff -Nru a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h
--- a/drivers/scsi/pcmcia/nsp_cs.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/scsi/pcmcia/nsp_cs.h	Tue Feb  3 19:45:17 2004
@@ -457,7 +457,7 @@
 static void cs_error(client_handle_t handle, int func, int ret)
 {
 	error_info_t err = { func, ret };
-	CardServices(ReportError, handle, &err);
+	pcmcia_report_error(handle, &err);
 }
 
 /* scatter-gather table */
diff -Nru a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
--- a/drivers/scsi/pcmcia/qlogic_stub.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/scsi/pcmcia/qlogic_stub.c	Tue Feb  3 19:45:28 2004
@@ -140,7 +140,7 @@
 	client_reg.EventMask = CS_EVENT_RESET_REQUEST | CS_EVENT_CARD_RESET | CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL | CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
 	client_reg.Version = 0x0210;
 	client_reg.event_callback_args.client_data = link;
-	ret = CardServices(RegisterClient, &link->handle, &client_reg);
+	ret = pcmcia_register_client(&link->handle, &client_reg);
 	if (ret != 0) {
 		cs_error(link->handle, RegisterClient, ret);
 		qlogic_detach(link);
@@ -169,7 +169,7 @@
 		qlogic_release(link);
 
 	if (link->handle)
-		CardServices(DeregisterClient, link->handle);
+		pcmcia_deregister_client(link->handle);
 
 	/* Unlink device structure, free bits */
 	*linkp = link->next;
@@ -179,11 +179,8 @@
 
 /*====================================================================*/
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
-
-#define CFG_CHECK(fn, args...) \
-if (CardServices(fn, args) != 0) goto next_entry
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static void qlogic_config(dev_link_t * link)
 {
@@ -201,37 +198,38 @@
 	tuple.TupleDataMax = 64;
 	tuple.TupleOffset = 0;
 	tuple.DesiredTuple = CISTPL_CONFIG;
-	CS_CHECK(GetFirstTuple, handle, &tuple);
-	CS_CHECK(GetTupleData, handle, &tuple);
-	CS_CHECK(ParseTuple, handle, &tuple, &parse);
+	CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+	CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+	CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
 	link->conf.ConfigBase = parse.config.base;
 
 	tuple.DesiredTuple = CISTPL_MANFID;
-	if ((CardServices(GetFirstTuple, handle, &tuple) == CS_SUCCESS) && (CardServices(GetTupleData, handle, &tuple) == CS_SUCCESS))
+	if ((pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) && (pcmcia_get_tuple_data(handle, &tuple) == CS_SUCCESS))
 		info->manf_id = le16_to_cpu(tuple.TupleData[0]);
 
 	/* Configure card */
 	link->state |= DEV_CONFIG;
 
 	tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
-	CS_CHECK(GetFirstTuple, handle, &tuple);
+	CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
 	while (1) {
-		CFG_CHECK(GetTupleData, handle, &tuple);
-		CFG_CHECK(ParseTuple, handle, &tuple, &parse);
+		if (pcmcia_get_tuple_data(handle, &tuple) != 0 ||
+				pcmcia_parse_tuple(handle, &tuple, &parse) != 0)
+			goto next_entry;
 		link->conf.ConfigIndex = parse.cftable_entry.index;
 		link->io.BasePort1 = parse.cftable_entry.io.win[0].base;
 		link->io.NumPorts1 = parse.cftable_entry.io.win[0].len;
 		if (link->io.BasePort1 != 0) {
-			i = CardServices(RequestIO, handle, &link->io);
+			i = pcmcia_request_io(handle, &link->io);
 			if (i == CS_SUCCESS)
 				break;
 		}
 	      next_entry:
-		CS_CHECK(GetNextTuple, handle, &tuple);
+		CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));
 	}
 
-	CS_CHECK(RequestIRQ, handle, &link->irq);
-	CS_CHECK(RequestConfiguration, handle, &link->conf);
+	CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq));
+	CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf));
 
 	if ((info->manf_id == MANFID_MACNICA) || (info->manf_id == MANFID_PIONEER) || (info->manf_id == 0x0098)) {
 		/* set ATAcmd */
@@ -284,9 +282,9 @@
 	scsi_remove_host(info->host);
 	link->dev = NULL;
 
-	CardServices(ReleaseConfiguration, link->handle);
-	CardServices(ReleaseIO, link->handle, &link->io);
-	CardServices(ReleaseIRQ, link->handle, &link->irq);
+	pcmcia_release_configuration(link->handle);
+	pcmcia_release_io(link->handle, &link->io);
+	pcmcia_release_irq(link->handle, &link->irq);
 
 	scsi_unregister(info->host);
 
@@ -316,7 +314,7 @@
 		/* Fall through... */
 	case CS_EVENT_RESET_PHYSICAL:
 		if (link->state & DEV_CONFIG)
-			CardServices(ReleaseConfiguration, link->handle);
+			pcmcia_release_configuration(link->handle);
 		break;
 	case CS_EVENT_PM_RESUME:
 		link->state &= ~DEV_SUSPEND;
@@ -324,7 +322,7 @@
 	case CS_EVENT_CARD_RESET:
 		if (link->state & DEV_CONFIG) {
 			scsi_info_t *info = link->priv;
-			CardServices(RequestConfiguration, link->handle, &link->conf);
+			pcmcia_request_configuration(link->handle, &link->conf);
 			if ((info->manf_id == MANFID_MACNICA) || (info->manf_id == MANFID_PIONEER) || (info->manf_id == 0x0098)) {
 				outb(0x80, link->io.BasePort1 + 0xd);
 				outb(0x24, link->io.BasePort1 + 0x9);
diff -Nru a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
--- a/drivers/scsi/qla1280.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/scsi/qla1280.c	Tue Feb  3 19:45:43 2004
@@ -3,7 +3,8 @@
 *
 * QLogic  QLA1280 (Ultra2)  and  QLA12160 (Ultra3) SCSI driver
 * Copyright (C) 2000 Qlogic Corporation (www.qlogic.com)
-* Copyright (C) 2001-2003 Jes Sorensen, Wild Open Source Inc.
+* Copyright (C) 2001-2004 Jes Sorensen, Wild Open Source Inc.
+* Copyright (C) 2003 Christoph Hellwig
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
@@ -16,13 +17,37 @@
 * General Public License for more details.
 *
 ******************************************************************************/
-#define QLA1280_VERSION      "3.23.37.1"
+#define QLA1280_VERSION      "3.24.3"
 /*****************************************************************************
     Revision History:
-    Rev  3.23.37.1 December 17, 2003, Jes Sorensen
+    Rev  3.24.3 January 19, 2004, Jes Sorensen
+	- Handle PCI DMA mask settings correctly
+	- Correct order of error handling in probe_one, free_irq should not
+	  be called if request_irq failed
+    Rev  3.24.2 January 19, 2004, James Bottomley & Andrew Vasquez
+	- Big endian fixes (James)
+	- Remove bogus IOCB content on zero data transfer commands (Andrew)
+    Rev  3.24.1 January 5, 2004, Jes Sorensen
+	- Initialize completion queue to avoid OOPS on probe
+	- Handle interrupts during mailbox testing
+    Rev  3.24 November 17, 2003, Christoph Hellwig
+    	- use struct list_head for completion queue
+	- avoid old Scsi_FOO typedefs
+	- cleanup 2.4 compat glue a bit
+	- use <scsi/scsi_*.h> headers on 2.6 instead of "scsi.h"
+	- make initialization for memory mapped vs port I/O more similar
+	- remove broken pci config space manipulation
+	- kill more cruft
+	- this is an almost perfect 2.6 scsi driver now! ;)
+    Rev  3.23.39 December 17, 2003, Jes Sorensen
 	- Delete completion queue from srb if mailbox command failed to
 	  to avoid qla1280_done completeting qla1280_error_action's
 	  obsolete context
+	- Reduce arguments for qla1280_done
+    Rev  3.23.38 October 18, 2003, Christoph Hellwig
+	- Convert to new-style hotplugable driver for 2.6
+	- Fix missing scsi_unregister/scsi_host_put on HBA removal
+	- Kill some more cruft
     Rev  3.23.37 October 1, 2003, Jes Sorensen
 	- Make MMIO depend on CONFIG_X86_VISWS instead of yet another
 	  random CONFIG option
@@ -323,7 +348,12 @@
 #include <asm/system.h>
 
 #if LINUX_VERSION_CODE >= 0x020545
+#include <asm/cacheflush.h>	/* for flush_cache_all() */
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
 #include <scsi/scsi_host.h>
+#include <scsi/scsi_tcq.h>
 #include "scsi.h"
 #else
 #include <linux/blk.h>
@@ -341,9 +371,6 @@
  * Compile time Options:
  *            0 - Disable and 1 - Enable
  */
-#define  QL1280_LUN_SUPPORT	0
-#define  WATCHDOGTIMER		0
-
 #define  DEBUG_QLA1280_INTR	0
 #define  DEBUG_PRINT_NVRAM	0
 #define  DEBUG_QLA1280		0
@@ -414,8 +441,18 @@
 #define irqreturn_t			void
 #define IRQ_RETVAL(foo)
 #define MSG_ORDERED_TAG			1
+
+#define DMA_BIDIRECTIONAL	SCSI_DATA_UNKNOWN
+#define DMA_TO_DEVICE		SCSI_DATA_WRITE
+#define DMA_FROM_DEVICE		SCSI_DATA_READ
+#define DMA_NONE		SCSI_DATA_NONE
+
+#ifndef HAVE_SECTOR_T
+typedef unsigned int sector_t;
+#endif
+
 static inline void
-scsi_adjust_queue_depth(Scsi_Device *device, int tag, int depth)
+scsi_adjust_queue_depth(struct scsi_device *device, int tag, int depth)
 {
 	if (tag) {
 		device->tagged_queue = tag;
@@ -423,11 +460,25 @@
 	}
 	device->queue_depth = depth;
 }
+static inline struct Scsi_Host *scsi_host_alloc(Scsi_Host_Template *t, size_t s)
+{
+	return scsi_register(t, s);
+}
+static inline void scsi_host_put(struct Scsi_Host *h)
+{
+	scsi_unregister(h);
+}
 #else
 #define HOST_LOCK			ha->host->host_lock
 #endif
 #if LINUX_VERSION_CODE < 0x020600
 #define DEV_SIMPLE_TAGS(device)		device->tagged_queue
+/*
+ * Hack around that qla1280_remove_one is called from
+ * qla1280_release in 2.4
+ */
+#undef __devexit
+#define __devexit
 #else
 #define DEV_SIMPLE_TAGS(device)		device->simple_tags
 #endif
@@ -435,30 +486,23 @@
 #define ia64_platform_is(foo)		(!strcmp(x, platform_name))
 #endif
 
+static int qla1280_probe_one(struct pci_dev *, const struct pci_device_id *);
+static void qla1280_remove_one(struct pci_dev *);
+
 /*
  *  QLogic Driver Support Function Prototypes.
  */
-static void qla1280_done(struct scsi_qla_host *, struct srb **, struct srb **);
-static void qla1280_done_q_put(struct srb *, struct srb **, struct srb **);
-static int qla1280_slave_configure(Scsi_Device *);
+static void qla1280_done(struct scsi_qla_host *);
 #if LINUX_VERSION_CODE < 0x020545
-static void qla1280_select_queue_depth(struct Scsi_Host *, Scsi_Device *);
 static void qla1280_get_target_options(struct scsi_cmnd *, struct scsi_qla_host *);
 #endif
-
-static int qla1280_return_status(struct response * sts, Scsi_Cmnd * cp);
-static void qla1280_mem_free(struct scsi_qla_host *ha);
 static int qla1280_get_token(char *);
 static int qla1280_setup(char *s) __init;
-static inline void qla1280_enable_intrs(struct scsi_qla_host *);
-static inline void qla1280_disable_intrs(struct scsi_qla_host *);
 
 /*
  *  QLogic ISP1280 Hardware Support Function Prototypes.
  */
-static int qla1280_initialize_adapter(struct scsi_qla_host *ha);
 static int qla1280_isp_firmware(struct scsi_qla_host *);
-static int qla1280_pci_config(struct scsi_qla_host *);
 static int qla1280_chip_diag(struct scsi_qla_host *);
 static int qla1280_setup_chip(struct scsi_qla_host *);
 static int qla1280_init_rings(struct scsi_qla_host *);
@@ -470,31 +514,31 @@
 static int qla1280_abort_device(struct scsi_qla_host *, int, int, int);
 static int qla1280_abort_command(struct scsi_qla_host *, struct srb *, int);
 static int qla1280_abort_isp(struct scsi_qla_host *);
+#ifdef QLA_64BIT_PTR
 static int qla1280_64bit_start_scsi(struct scsi_qla_host *, struct srb *);
+#else
 static int qla1280_32bit_start_scsi(struct scsi_qla_host *, struct srb *);
+#endif
 static void qla1280_nv_write(struct scsi_qla_host *, uint16_t);
 static void qla1280_poll(struct scsi_qla_host *);
 static void qla1280_reset_adapter(struct scsi_qla_host *);
 static void qla1280_marker(struct scsi_qla_host *, int, int, int, u8);
 static void qla1280_isp_cmd(struct scsi_qla_host *);
-irqreturn_t qla1280_intr_handler(int, void *, struct pt_regs *);
-static void qla1280_isr(struct scsi_qla_host *, struct srb **, struct srb **);
+static void qla1280_isr(struct scsi_qla_host *, struct list_head *);
 static void qla1280_rst_aen(struct scsi_qla_host *);
 static void qla1280_status_entry(struct scsi_qla_host *, struct response *,
-				 struct srb **, struct srb **);
+				 struct list_head *);
 static void qla1280_error_entry(struct scsi_qla_host *, struct response *,
-				struct srb **, struct srb **);
+				struct list_head *);
 static uint16_t qla1280_get_nvram_word(struct scsi_qla_host *, uint32_t);
 static uint16_t qla1280_nvram_request(struct scsi_qla_host *, uint32_t);
 static uint16_t qla1280_debounce_register(volatile uint16_t *);
 static request_t *qla1280_req_pkt(struct scsi_qla_host *);
 static int qla1280_check_for_dead_scsi_bus(struct scsi_qla_host *,
 					   unsigned int);
-static int qla1280_mem_alloc(struct scsi_qla_host *ha);
-
-static void qla12160_get_target_parameters(struct scsi_qla_host *,
-					   Scsi_Device *);
-static int qla12160_set_target_parameters(struct scsi_qla_host *, int, int);
+static void qla1280_get_target_parameters(struct scsi_qla_host *,
+					   struct scsi_device *);
+static int qla1280_set_target_parameters(struct scsi_qla_host *, int, int);
 
 
 static struct qla_driver_setup driver_setup __initdata;
@@ -505,36 +549,26 @@
 static inline uint16_t
 qla1280_data_direction(struct scsi_cmnd *cmnd)
 {
-	uint16_t flags = 0;
-
 	switch(cmnd->sc_data_direction) {
-
-	case SCSI_DATA_NONE:
-		flags = 0;
-		break;
-
-	case SCSI_DATA_READ:
-		flags = BIT_5;
-		break;
-
-	case SCSI_DATA_WRITE:
-		flags = BIT_6;
-		break;
-
-	case SCSI_DATA_UNKNOWN:
+	case DMA_FROM_DEVICE:
+		return BIT_5;
+	case DMA_TO_DEVICE:
+		return BIT_6;
+	case DMA_BIDIRECTIONAL:
+		return BIT_5 | BIT_6;
+	/*
+	 * We could BUG() on default here if one of the four cases aren't
+	 * met, but then again if we receive something like that from the
+	 * SCSI layer we have more serious problems. This shuts up GCC.
+	 */
+	case DMA_NONE:
 	default:
-		flags = BIT_5 | BIT_6;
-		break;
+		return 0;
 	}
-	return flags;
 }
 		
-#if QL1280_LUN_SUPPORT
-static void qla1280_enable_lun(struct scsi_qla_host *, int, int);
-#endif
-
 #if DEBUG_QLA1280
-static void __qla1280_print_scsi_cmd(Scsi_Cmnd * cmd);
+static void __qla1280_print_scsi_cmd(struct scsi_cmnd * cmd);
 static void __qla1280_dump_buffer(char *, int);
 #endif
 
@@ -551,21 +585,11 @@
 __setup("qla1280=", qla1280_setup);
 #endif
 
-MODULE_LICENSE("GPL");
-
 
-/* We use the Scsi_Pointer structure that's included with each command
- * SCSI_Cmnd as a scratchpad for our SRB.
- *
- * SCp will always point to the SRB structure (defined in qla1280.h).
- * It is define as follows:
- *  - SCp.ptr  -- > pointer back to the cmd
- *  - SCp.this_residual --> used as forward pointer to next srb
- *  - SCp.buffer --> used as backward pointer to next srb
- *  - SCp.buffers_residual --> used as flags field
- *  - SCp.have_data_in --> not used
- *  - SCp.sent_command --> not used
- *  - SCp.phase --> not used
+/*
+ * We use the scsi_pointer structure that's included with each scsi_command
+ * to overlay our struct srb over it. qla1280_init() checks that a srb is not
+ * bigger than a scsi_pointer.
  */
 
 #define	CMD_SP(Cmnd)		&Cmnd->SCp
@@ -576,28 +600,23 @@
 #define	CMD_RESULT(Cmnd)	Cmnd->result
 #define	CMD_HANDLE(Cmnd)	Cmnd->host_scribble
 #if LINUX_VERSION_CODE < 0x020545
-#define	CMD_HOST(Cmnd)		Cmnd->host
 #define CMD_REQUEST(Cmnd)	Cmnd->request.cmd
-#define SCSI_BUS_32(Cmnd)	Cmnd->channel
-#define SCSI_TCN_32(Cmnd)	Cmnd->target
-#define SCSI_LUN_32(Cmnd)	Cmnd->lun
 #else
-#define	CMD_HOST(Cmnd)		Cmnd->device->host
 #define CMD_REQUEST(Cmnd)	Cmnd->request->cmd
+#endif
+
+#define CMD_HOST(Cmnd)		Cmnd->device->host
 #define SCSI_BUS_32(Cmnd)	Cmnd->device->channel
 #define SCSI_TCN_32(Cmnd)	Cmnd->device->id
 #define SCSI_LUN_32(Cmnd)	Cmnd->device->lun
-#endif
+
 
 /*****************************************/
 /*   ISP Boards supported by this driver */
 /*****************************************/
 
-#define NUM_OF_ISP_DEVICES	6
-
 struct qla_boards {
 	unsigned char name[9];	/* Board ID String */
-	unsigned long device_id;	/* Device PCI ID   */
 	int numPorts;		/* Number of SCSI ports */
 	unsigned short *fwcode;	/* pointer to FW array         */
 	unsigned short *fwlen;	/* number of words in array    */
@@ -605,28 +624,38 @@
 	unsigned char *fwver;	/* Ptr to F/W version array    */
 };
 
-struct qla_boards ql1280_board_tbl[NUM_OF_ISP_DEVICES] = {
-	/* Name ,  Board PCI Device ID,         Number of ports */
-	{"QLA12160", PCI_DEVICE_ID_QLOGIC_ISP12160, 2,
-	 &fw12160i_code01[0], &fw12160i_length01,
+/* NOTE: qla1280_pci_tbl and ql1280_board_tbl must be in the same order */
+static struct pci_device_id qla1280_pci_tbl[] = {
+	{PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP12160,
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+	{PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1080,
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
+	{PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1240,
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
+	{PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1280,
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
+	{PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP10160,
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
+	{0,}
+};
+MODULE_DEVICE_TABLE(pci, qla1280_pci_tbl);
+
+static struct qla_boards ql1280_board_tbl[] = {
+	/* Name ,  Number of ports, FW details */
+	{"QLA12160", 2, &fw12160i_code01[0], &fw12160i_length01,
 	 &fw12160i_addr01, &fw12160i_version_str[0]},
-	{"QLA1080", PCI_DEVICE_ID_QLOGIC_ISP1080, 1,
-	 &fw1280ei_code01[0], &fw1280ei_length01,
+	{"QLA1080", 1, &fw1280ei_code01[0], &fw1280ei_length01,
 	 &fw1280ei_addr01, &fw1280ei_version_str[0]},
-	{"QLA1240", PCI_DEVICE_ID_QLOGIC_ISP1240, 2,
-	 &fw1280ei_code01[0], &fw1280ei_length01,
+	{"QLA1240", 2, &fw1280ei_code01[0], &fw1280ei_length01,
 	 &fw1280ei_addr01, &fw1280ei_version_str[0]},
-	{"QLA1280", PCI_DEVICE_ID_QLOGIC_ISP1280, 2,
-	 &fw1280ei_code01[0], &fw1280ei_length01,
+	{"QLA1280", 2, &fw1280ei_code01[0], &fw1280ei_length01,
 	 &fw1280ei_addr01, &fw1280ei_version_str[0]},
-	{"QLA10160", PCI_DEVICE_ID_QLOGIC_ISP10160, 1,
-	 &fw12160i_code01[0], &fw12160i_length01,
+	{"QLA10160", 1, &fw12160i_code01[0], &fw12160i_length01,
 	 &fw12160i_addr01, &fw12160i_version_str[0]},
-	{"        ", 0, 0}
+	{"        ", 0}
 };
 
 static int qla1280_verbose = 1;
-static struct scsi_qla_host *qla1280_hostlist;
 static int qla1280_buffer_size;
 static char *qla1280_buffer;
 
@@ -663,43 +692,13 @@
  *************************************************************************/
 #define	PROC_BUF	&qla1280_buffer[len]
 
-#if LINUX_VERSION_CODE < 0x020600
-static int qla1280_proc_info(char *buffer, char **start, off_t offset,
-			     int length, int hostno, int inout)
-#else
 static int qla1280_proc_info(struct Scsi_Host *host, char *buffer,
 			     char **start, off_t offset, int length, int inout)
-#endif
 {
-	struct scsi_qla_host *ha;
+	struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata;
+	struct qla_boards *bdp = &ql1280_board_tbl[ha->devnum];
 	int size = 0;
 	int len = 0;
-	struct qla_boards *bdp;
-#ifdef BOGUS_QUEUE
-	struct scsi_lu *up;
-	uint32_t b, t, l;
-#endif
-#if LINUX_VERSION_CODE >= 0x020600
-	ha = (struct scsi_qla_host *)host->hostdata;
-#else
-	struct Scsi_Host *host;
-	/* Find the host that was specified */
-	for (ha = qla1280_hostlist; (ha != NULL)
-		     && ha->host->host_no != hostno; ha = ha->next) ;
-
-	/* if host wasn't found then exit */
-	if (!ha) {
-		size =  sprintf(buffer, "Can't find adapter for host "
-				"number %d\n", hostno);
-		if (size > length) {
-			return size;
-		} else {
-			return 0;
-		}
-	}
-
-	host = ha->host;
-#endif
 
 	if (inout)
 		return -ENOSYS;
@@ -728,7 +727,6 @@
 	memset(qla1280_buffer, 0, PAGE_SIZE);
 
 	/* start building the print buffer */
-	bdp = &ql1280_board_tbl[ha->devnum];
 	size = sprintf(PROC_BUF,
 		       "QLogic PCI to SCSI Adapter for ISP 1280/12160:\n"
 		       "        Firmware version: %2d.%02d.%02d, Driver version %s\n",
@@ -753,51 +751,6 @@
 	size = sprintf(PROC_BUF, "\n");	/* 1       */
 	len += size;
 
-	size = sprintf(PROC_BUF, "SCSI device Information:\n");
-	len += size;
-#ifdef BOGUS_QUEUE
-	/* scan for all equipment stats */
-	for (b = 0; b < MAX_BUSES; b++)
-		for (t = 0; t < MAX_TARGETS; t++) {
-			for (l = 0; l < MAX_LUNS; l++) {
-				up = LU_Q(ha, b, t, l);
-				if (up == NULL)
-					continue;
-				/* unused device/lun */
-				if (up->io_cnt == 0 || up->io_cnt < 2)
-					continue;
-				/* total reads since boot */
-				/* total writes since boot */
-				/* total requests since boot  */
-				size = sprintf (PROC_BUF,
-						"(%2d:%2d:%2d): Total reqs %ld,",
-						b, t, l, up->io_cnt);
-				len += size;
-				/* current number of pending requests */
-				size =	sprintf(PROC_BUF, " Pend reqs %d,",
-						up->q_outcnt);
-				len += size;
-#if 0
-				/* avg response time */
-				size = sprintf(PROC_BUF, " Avg resp time %ld%%,",
-					       (up->resp_time / up->io_cnt) *
-					       100);
-				len += size;
-
-				/* avg active time */
-				size = sprintf(PROC_BUF,
-					       " Avg active time %ld%%\n",
-					       (up->act_time / up->io_cnt) * 100);
-#else
-				size = sprintf(PROC_BUF, "\n");
-#endif
-				len += size;
-			}
-			if (len >= qla1280_buffer_size)
-				break;
-		}
-#endif
-
 	if (len >= qla1280_buffer_size) {
 		printk(KERN_WARNING
 		       "qla1280: Overflow buffer in qla1280_proc.c\n");
@@ -822,7 +775,7 @@
 {
 	uint16_t *wptr;
 	uint8_t chksum;
-	int cnt;
+	int cnt, i;
 	struct nvram *nv;
 
 	ENTER("qla1280_read_nvram");
@@ -869,318 +822,34 @@
 	} else
 		ha->nvram_valid = 1;
 
+	/* The firmware interface is, um, interesting, in that the
+	 * actual firmware image on the chip is little endian, thus,
+	 * the process of taking that image to the CPU would end up
+	 * little endian.  However, the firmare interface requires it
+	 * to be read a word (two bytes) at a time.
+	 *
+	 * The net result of this would be that the word (and
+	 * doubleword) quantites in the firmware would be correct, but
+	 * the bytes would be pairwise reversed.  Since most of the
+	 * firmware quantites are, in fact, bytes, we do an extra
+	 * le16_to_cpu() in the firmware read routine.
+	 *
+	 * The upshot of all this is that the bytes in the firmware
+	 * are in the correct places, but the 16 and 32 bit quantites
+	 * are still in little endian format.  We fix that up below by
+	 * doing extra reverses on them */
+	nv->isp_parameter = cpu_to_le16(nv->isp_parameter);
+	nv->firmware_feature.w = cpu_to_le16(nv->firmware_feature.w);
+	for(i = 0; i < MAX_BUSES; i++) {
+		nv->bus[i].selection_timeout = cpu_to_le16(nv->bus[i].selection_timeout);
+		nv->bus[i].max_queue_depth = cpu_to_le16(nv->bus[i].max_queue_depth);
+	}
 	dprintk(1, "qla1280_read_nvram: Completed Reading NVRAM\n");
 	LEAVE("qla1280_read_nvram");
 
 	return chksum;
 }
 
-
-/**************************************************************************
- * qla1280_do_device_init
- *    This routine will register the device with the SCSI subsystem,
- *    initialize the host adapter structure and call the device init
- *    routines.
- *
- * Input:
- *     pdev      - pointer to struct pci_dev for adapter
- *     template  - pointer to SCSI template
- *     devnum    - the device number
- *     bdp       - pointer to struct _qlaboards
- *     num_hosts - the host number
- *
- * Returns:
- *  host - pointer to SCSI host structure
- **************************************************************************/
-struct Scsi_Host *
-qla1280_do_device_init(struct pci_dev *pdev, Scsi_Host_Template * template,
-		       int devnum, struct qla_boards *bdp, int num_hosts)
-{
-	struct Scsi_Host *host;
-	struct scsi_qla_host *ha;
-
-	printk(KERN_INFO "qla1280: %s found on PCI bus %i, dev %i\n",
-	       bdp->name, pdev->bus->number, PCI_SLOT(pdev->devfn));
-
-	host = scsi_register(template, sizeof(struct scsi_qla_host));
-	if (!host) {
-		printk(KERN_WARNING
-		       "qla1280: Failed to register host, aborting.\n");
-		goto error;
-	}
-
-#if LINUX_VERSION_CODE < 0x020545
-	scsi_set_pci_device(host, pdev);
-#else
-	scsi_set_device(host, &pdev->dev);
-#endif
-	ha = (struct scsi_qla_host *)host->hostdata;
-	/* Clear our data area */
-	memset(ha, 0, sizeof(struct scsi_qla_host));
-	/* Sanitize the information from PCI BIOS.  */
-	host->irq = pdev->irq;
-	ha->pci_bus = pdev->bus->number;
-	ha->pci_device_fn = pdev->devfn;
-	ha->pdev = pdev;
-	ha->device_id = bdp->device_id;
-	ha->devnum = devnum;	/* specifies microcode load address */
-
-	if (qla1280_mem_alloc(ha)) {
-		printk(KERN_INFO "qla1x160: Failed to get memory\n");
-		goto error_scsi_unregister;
-	}
-
-	ha->ports = bdp->numPorts;
-	/* following needed for all cases of OS versions */
-	ha->host = host;
-	ha->host_no = host->host_no;
-
-	host->can_queue = 0xfffff;	/* unlimited  */
-	host->cmd_per_lun = 1;
-	host->base = (unsigned long)ha->mmpbase;
-	host->max_channel = bdp->numPorts - 1;
-	host->max_lun = MAX_LUNS - 1;
-	host->max_id = MAX_TARGETS;
-	host->max_sectors = 1024;
-#if LINUX_VERSION_CODE < 0x020545
-	host->select_queue_depths = qla1280_select_queue_depth;
-#endif
-
-	ha->instance = num_hosts;
-	host->unique_id = ha->instance;
-
-	if (qla1280_pci_config(ha)) {
-		printk(KERN_INFO "qla1x160: Unable to configure PCI\n");
-		goto error_mem_alloced;
-	}
-
-	/* Disable ISP interrupts. */
-	qla1280_disable_intrs(ha);
-
-	/* Register the IRQ with Linux (sharable) */
-	if (request_irq(host->irq, qla1280_intr_handler, SA_SHIRQ,
-			"qla1280", ha)) {
-		printk("qla1280 : Failed to reserve interrupt %d already "
-		       "in use\n", host->irq);
-		goto error_iounmap;
-	}
-#if !MEMORY_MAPPED_IO
-	/* Register the I/O space with Linux */
-	if (!request_region(host->io_port, 0xff, "qla1280")) {
-		printk("qla1280: Failed to reserve i/o region 0x%04lx-0x%04lx"
-		       " already in use\n",
-		       host->io_port, host->io_port + 0xff);
-		goto error_free_irq;
-	}
-#endif
-
-	/* load the F/W, read paramaters, and init the H/W */
-	if (qla1280_initialize_adapter(ha)) {
-		printk(KERN_INFO "qla1x160: Failed to initialize adapter\n");
-		goto error_release_region;
-	}
-
-	/* set our host ID  (need to do something about our two IDs) */
-	host->this_id = ha->bus_settings[0].id;
-
-	return host;
-
- error_release_region:
-#if !MEMORY_MAPPED_IO
-	release_region(host->io_port, 0xff);
- error_free_irq:
-#endif
-	free_irq(host->irq, ha);
- error_iounmap:
-#if MEMORY_MAPPED_IO
-	if (ha->mmpbase)
-		iounmap((void *)(((unsigned long) ha->mmpbase) & PAGE_MASK));
-#endif
- error_mem_alloced:
-	qla1280_mem_free(ha);
- error_scsi_unregister:
-	scsi_unregister(host);
- error:
-	return NULL;
-}
-
-/**************************************************************************
- * qla1280_detect
- *    This routine will probe for Qlogic 1280 SCSI host adapters.
- *    It returns the number of host adapters of a particular
- *    type that were found.	 It also initialize all data necessary for
- *    the driver.  It is passed-in the host number, so that it
- *    knows where its first entry is in the scsi_hosts[] array.
- *
- * Input:
- *     template - pointer to SCSI template
- *
- * Returns:
- *  num - number of host adapters found.
- **************************************************************************/
-static int
-qla1280_detect(Scsi_Host_Template * template)
-{
-	struct pci_dev *pdev = NULL;
-	struct Scsi_Host *host;
-	struct scsi_qla_host *ha, *cur_ha;
-	struct qla_boards *bdp;
-	uint16_t subsys_vendor, subsys_device;
-	int num_hosts = 0;
-	int devnum = 0;
-
-	ENTER("qla1280_detect");
-
-	if (sizeof(struct srb) > sizeof(Scsi_Pointer)) {
-		printk(KERN_WARNING
-		       "qla1280_detect: [WARNING] struct srb too big\n");
-		return 0;
-	}
-#ifdef MODULE
-	/*
-	 * If we are called as a module, the qla1280 pointer may not be null
-	 * and it would point to our bootup string, just like on the lilo
-	 * command line.  IF not NULL, then process this config string with
-	 * qla1280_setup
-	 *
-	 * Boot time Options
-	 * To add options at boot time add a line to your lilo.conf file like:
-	 * append="qla1280=verbose,max_tags:{{255,255,255,255},{255,255,255,255}}"
-	 * which will result in the first four devices on the first two
-	 * controllers being set to a tagged queue depth of 32.
-	 */
-	if (qla1280)
-		qla1280_setup(qla1280);
-#endif
-
-	bdp = &ql1280_board_tbl[0];
-	qla1280_hostlist = NULL;
-	template->proc_name = "qla1280";
-
-	/* First Initialize QLA12160 on PCI Bus 1 Dev 2 */
-	while ((pdev = pci_find_subsys(PCI_VENDOR_ID_QLOGIC, bdp->device_id,
-				       PCI_ANY_ID, PCI_ANY_ID, pdev))) {
-
-		/* find QLA12160 device on PCI bus=1 slot=2 */
-		if ((pdev->bus->number != 1) || (PCI_SLOT(pdev->devfn) != 2))
-			continue;
-
-		/* Bypass all AMI SUBSYS VENDOR IDs */
-		if (pdev->subsystem_vendor == PCI_VENDOR_ID_AMI) {
-			printk(KERN_INFO
-			       "qla1x160: Skip AMI SubSys Vendor ID Chip\n");
-			continue;
-		}
-
-		if (pci_enable_device(pdev))
-			goto find_devices;
-
-		host = qla1280_do_device_init(pdev, template, devnum,
-					      bdp, num_hosts);
-		if (!host)
-			continue;
-		ha = (struct scsi_qla_host *)host->hostdata;
-
-		/* this preferred device will always be the first one found */
-		cur_ha = qla1280_hostlist = ha;
-		num_hosts++;
-	}
-
- find_devices:
-
-	pdev = NULL;
-	/* Try and find each different type of adapter we support */
-	for (devnum = 0; bdp->device_id != 0 && devnum < NUM_OF_ISP_DEVICES;
-	     devnum++, bdp++) {
-		/* PCI_SUBSYSTEM_IDS supported */
-		while ((pdev = pci_find_subsys(PCI_VENDOR_ID_QLOGIC,
-					       bdp->device_id, PCI_ANY_ID,
-					       PCI_ANY_ID, pdev))) {
-			if (pci_enable_device(pdev))
-				continue;
-			/* found an adapter */
-			subsys_vendor = pdev->subsystem_vendor;
-			subsys_device = pdev->subsystem_device;
-
-			/*
-			 * skip QLA12160 already initialized on
-			 * PCI Bus 1 Dev 2 since we already initialized
-			 * and presented it
-			 */
-			if ((bdp->device_id == PCI_DEVICE_ID_QLOGIC_ISP12160)&&
-			    (pdev->bus->number == 1) &&
-			    (PCI_SLOT(pdev->devfn) == 2))
-				continue;
-
-			/* Bypass all AMI SUBSYS VENDOR IDs */
-			if (subsys_vendor == PCI_VENDOR_ID_AMI) {
-				printk(KERN_INFO
-				       "qla1x160: Skip AMI SubSys Vendor ID Chip\n");
-				continue;
-			}
-			dprintk(1, "qla1x160: Supported Device Found VID=%x "
-			       "DID=%x SSVID=%x SSDID=%x\n", pdev->vendor,
-			       pdev->device, subsys_vendor, subsys_device);
-
-			host = qla1280_do_device_init(pdev, template,
-						      devnum, bdp, num_hosts);
-			if (!host)
-				continue;
-			ha = (struct scsi_qla_host *)host->hostdata;
-
-			if (qla1280_hostlist == NULL) {
-				cur_ha = qla1280_hostlist = ha;
-			} else {
-				cur_ha = qla1280_hostlist;
-				while (cur_ha->next != NULL)
-					cur_ha = cur_ha->next;
-				cur_ha->next = ha;
-			}
-			num_hosts++;
-		}		/* end of WHILE */
-	}			/* end of FOR */
-
-	LEAVE("qla1280_detect");
-	return num_hosts;
-}
-
-/**************************************************************************
- *   qla1280_release
- *   Free the passed in Scsi_Host memory structures prior to unloading the
- *   module.
- **************************************************************************/
-static int
-qla1280_release(struct Scsi_Host *host)
-{
-	struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata;
-
-	ENTER("qla1280_release");
-
-	if (!ha->flags.online)
-		return 0;
-
-	/* turn-off interrupts on the card */
-	WRT_REG_WORD(&ha->iobase->ictrl, 0);
-
-	/* Detach interrupts */
-	if (host->irq)
-		free_irq(host->irq, ha);
-
-#if MEMORY_MAPPED_IO
-	if (ha->mmpbase)
-		iounmap(ha->mmpbase);
-#else
-	/* release io space registers  */
-	if (host->io_port)
-		release_region(host->io_port, 0xff);
-#endif				/* MEMORY_MAPPED_IO */
-
-	qla1280_mem_free(ha);
-
-	ENTER("qla1280_release");
-	return 0;
-}
-
 /**************************************************************************
  *   qla1280_info
  *     Return a string describing the driver.
@@ -1197,11 +866,11 @@
 	ha = (struct scsi_qla_host *)host->hostdata;
 	bdp = &ql1280_board_tbl[ha->devnum];
 	memset(bp, 0, sizeof(qla1280_scsi_name_buffer));
+
 	sprintf (bp,
-		 "QLogic %s PCI to SCSI Host Adapter: bus %d device %d irq %d\n"
+		 "QLogic %s PCI to SCSI Host Adapter\n"
 		 "       Firmware version: %2d.%02d.%02d, Driver version %s",
-		 &bdp->name[0], ha->pci_bus, (ha->pci_device_fn & 0xf8) >> 3,
-		 host->irq, bdp->fwver[0], bdp->fwver[1], bdp->fwver[2],
+		 &bdp->name[0], bdp->fwver[0], bdp->fwver[1], bdp->fwver[2],
 		 QLA1280_VERSION);
 	return bp;
 }
@@ -1218,39 +887,30 @@
  * context which is a big NO! NO!.
  **************************************************************************/
 static int
-qla1280_queuecommand(Scsi_Cmnd * cmd, void (*fn) (Scsi_Cmnd *))
+qla1280_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
 {
-	struct scsi_qla_host *ha;
-	struct srb *sp;
-	struct Scsi_Host *host;
-	int bus, target, lun;
+	struct Scsi_Host *host = cmd->device->host;
+	struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata;
+	struct srb *sp = (struct srb *)&cmd->SCp;
 	int status;
 
-	/*ENTER("qla1280_queuecommand");
-	 */
-	dprintk(2, "qla1280_queuecommand(): jiffies %li\n", jiffies);
-
-	host = CMD_HOST(cmd);
-	ha = (struct scsi_qla_host *)host->hostdata;
-
-	/* send command to adapter */
-	sp = (struct srb *)CMD_SP(cmd);
-	sp->cmd = cmd;
 	cmd->scsi_done = fn;
+	sp->cmd = cmd;
 	sp->flags = 0;
 
 	qla1280_print_scsi_cmd(5, cmd);
 
-	/* Generate LU queue on bus, target, LUN */
-	bus = SCSI_BUS_32(cmd);
-	target = SCSI_TCN_32(cmd);
-	lun = SCSI_LUN_32(cmd);
-	if (ha->flags.enable_64bit_addressing)
-		status = qla1280_64bit_start_scsi(ha, sp);
-	else
-		status = qla1280_32bit_start_scsi(ha, sp);
-
-	/*LEAVE("qla1280_queuecommand"); */
+#ifdef QLA_64BIT_PTR
+	/*
+	 * Using 64 bit commands if the PCI bridge doesn't support it is a
+	 * bit wasteful, however this should really only happen if one's
+	 * PCI controller is completely broken, like the BCM1250. For
+	 * sane hardware this is not an issue.
+	 */
+	status = qla1280_64bit_start_scsi(ha, sp);
+#else
+	status = qla1280_32bit_start_scsi(ha, sp);
+#endif
 	return status;
 }
 
@@ -1305,7 +965,7 @@
  *      the SCSI bus reset line.
  **************************************************************************/
 static int
-qla1280_error_action(Scsi_Cmnd * cmd, enum action action)
+qla1280_error_action(struct scsi_cmnd *cmd, enum action action)
 {
 	struct scsi_qla_host *ha;
 	int bus, target, lun;
@@ -1350,7 +1010,7 @@
 	 * grabs the lock. /Jes
 	 */
 	if (data & RISC_INT)
-		qla1280_isr(ha, &ha->done_q_first, &ha->done_q_last);
+		qla1280_isr(ha, &ha->done_q);
 
 	/*
 	 * Determine the suggested action that the mid-level driver wants
@@ -1461,8 +1121,8 @@
 		ha->flags.reset_active = 0;
 	}
 
-	if (ha->done_q_first)
-		qla1280_done(ha, &ha->done_q_first, &ha->done_q_last);
+	if (!list_empty(&ha->done_q))
+		qla1280_done(ha);
 	ha->flags.in_reset = 0;
 
 	/* If we didn't manage to issue the action, or we have no
@@ -1547,22 +1207,11 @@
 	return qla1280_error_action(cmd, ADAPTER_RESET);
 }
 
-/**************************************************************************
- * qla1280_biosparam
- *   Return the disk geometry for the given SCSI device.
- **************************************************************************/
 static int
-#if LINUX_VERSION_CODE < 0x020545
-qla1280_biosparam(Disk * disk, kdev_t dev, int geom[])
-#else
 qla1280_biosparam(struct scsi_device *sdev, struct block_device *bdev,
 		  sector_t capacity, int geom[])
-#endif
 {
 	int heads, sectors, cylinders;
-#if LINUX_VERSION_CODE < 0x020545
-	unsigned long capacity = disk->capacity;
-#endif
 
 	heads = 64;
 	sectors = 32;
@@ -1582,11 +1231,118 @@
 	return 0;
 }
 
+#if LINUX_VERSION_CODE < 0x020600
+static int
+qla1280_detect(Scsi_Host_Template *template)
+{
+	struct pci_device_id *id = &qla1280_pci_tbl[0];
+	struct pci_dev *pdev = NULL;
+	int num_hosts = 0;
+
+	if (sizeof(struct srb) > sizeof(Scsi_Pointer)) {
+		printk(KERN_WARNING
+		       "qla1280: struct srb too big, aborting\n");
+		return 0;
+	}
+
+	if ((DMA_BIDIRECTIONAL != PCI_DMA_BIDIRECTIONAL) ||
+	    (DMA_TO_DEVICE != PCI_DMA_TODEVICE) ||
+	    (DMA_FROM_DEVICE != PCI_DMA_FROMDEVICE) ||
+	    (DMA_NONE != PCI_DMA_NONE)) {
+		printk(KERN_WARNING
+		       "qla1280: dma direction bits don't match\n");
+		return 0;
+	}
+
+#ifdef MODULE
+	/*
+	 * If we are called as a module, the qla1280 pointer may not be null
+	 * and it would point to our bootup string, just like on the lilo
+	 * command line.  IF not NULL, then process this config string with
+	 * qla1280_setup
+	 *
+	 * Boot time Options
+	 * To add options at boot time add a line to your lilo.conf file like:
+	 * append="qla1280=verbose,max_tags:{{255,255,255,255},{255,255,255,255}}"
+	 * which will result in the first four devices on the first two
+	 * controllers being set to a tagged queue depth of 32.
+	 */
+	if (qla1280)
+		qla1280_setup(qla1280);
+#endif
+
+	/* First Initialize QLA12160 on PCI Bus 1 Dev 2 */
+	while ((pdev = pci_find_device(id->vendor, id->device, pdev))) {
+		if (pdev->bus->number == 1 && PCI_SLOT(pdev->devfn) == 2) {
+			if (!qla1280_probe_one(pdev, id))
+				num_hosts++;
+		}
+	}
+
+	pdev = NULL;
+	/* Try and find each different type of adapter we support */
+	for (id = &qla1280_pci_tbl[0]; id->device; id++) {
+		while ((pdev = pci_find_device(id->vendor, id->device, pdev))) {
+			/*
+			 * skip QLA12160 already initialized on
+			 * PCI Bus 1 Dev 2 since we already initialized
+			 * and presented it
+			 */
+			if (id->device == PCI_DEVICE_ID_QLOGIC_ISP12160 &&
+			    pdev->bus->number == 1 &&
+			    PCI_SLOT(pdev->devfn) == 2)
+				continue;
+
+			if (!qla1280_probe_one(pdev, id))
+				num_hosts++;
+		}
+	}
+
+	return num_hosts;
+}
+
+/*
+ * This looks a bit ugly as we could just pass down host to
+ * qla1280_remove_one, but I want to keep qla1280_release purely a wrapper
+ * around pci_driver::remove as used from 2.6 onwards.
+ */
+static int
+qla1280_release(struct Scsi_Host *host)
+{
+	struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata;
+
+	qla1280_remove_one(ha->pdev);
+	return 0;
+}
+
+static int
+qla1280_biosparam_old(Disk * disk, kdev_t dev, int geom[])
+{
+	return qla1280_biosparam(disk->device, NULL, disk->capacity, geom);
+}
+
+static int
+qla1280_proc_info_old(char *buffer, char **start, off_t offset, int length,
+		      int hostno, int inout)
+{
+	struct Scsi_Host *host;
+
+	for (host = scsi_hostlist; host; host = host->next) {
+		if (host->host_no == hostno) {
+			return qla1280_proc_info(host, buffer, start,
+						 offset, length, inout);
+		}
+	}
+
+	return -ESRCH;
+}
+#endif
+
 /**************************************************************************
  * qla1280_intr_handler
  *   Handles the H/W interrupt
  **************************************************************************/
-irqreturn_t
+static irqreturn_t
 qla1280_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct scsi_qla_host *ha;
@@ -1606,12 +1362,12 @@
 
 	data = qla1280_debounce_register(&reg->istatus);
 	/* Check for pending interrupts. */
-	if (data & RISC_INT) {
-		qla1280_isr(ha, &ha->done_q_first, &ha->done_q_last);
+	if (data & RISC_INT) {	
+		qla1280_isr(ha, &ha->done_q);
 		handled = 1;
 	}
-	if (ha->done_q_first)
-		qla1280_done(ha, &ha->done_q_first, &ha->done_q_last);
+	if (!list_empty(&ha->done_q))
+		qla1280_done(ha);
 
 	spin_unlock(HOST_LOCK);
 
@@ -1624,7 +1380,7 @@
 
 
 static int
-qla12160_set_target_parameters(struct scsi_qla_host *ha, int bus, int target)
+qla1280_set_target_parameters(struct scsi_qla_host *ha, int bus, int target)
 {
 	uint8_t mr;
 	uint16_t mb[MAILBOX_REGISTER_COUNT];
@@ -1633,8 +1389,8 @@
 
 	nv = &ha->nvram;
 
-	if (ha->device_id == PCI_DEVICE_ID_QLOGIC_ISP12160 ||
-	    ha->device_id == PCI_DEVICE_ID_QLOGIC_ISP10160)
+	if (ha->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP12160 ||
+	    ha->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP10160)
 		is1x160 = 1;
 	else
 		is1x160 = 0;
@@ -1683,7 +1439,7 @@
  *   default queue depth (dependent on the number of hardware SCBs).
  **************************************************************************/
 static int
-qla1280_slave_configure(Scsi_Device *device)
+qla1280_slave_configure(struct scsi_device *device)
 {
 	struct scsi_qla_host *ha;
 	int default_depth = 3;
@@ -1721,8 +1477,8 @@
 	    (driver_setup.wide_mask &&
 	     (~driver_setup.wide_mask & (1 << target))))
 		nv->bus[bus].target[target].parameter.f.enable_wide = 0;
-	if (ha->device_id == PCI_DEVICE_ID_QLOGIC_ISP12160 ||
-	    ha->device_id == PCI_DEVICE_ID_QLOGIC_ISP10160) {
+	if (ha->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP12160 ||
+	    ha->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP10160) {
 		if (driver_setup.no_ppr ||
 		    (driver_setup.ppr_mask &&
 		     (~driver_setup.ppr_mask & (1 << target))))
@@ -1730,11 +1486,9 @@
 	}
 
 	spin_lock_irqsave(HOST_LOCK, flags);
-	if (nv->bus[bus].target[target].parameter.f.enable_sync) {
-		status = qla12160_set_target_parameters(ha, bus, target);
-	}
-
-	qla12160_get_target_parameters(ha, device);
+	if (nv->bus[bus].target[target].parameter.f.enable_sync)
+		status = qla1280_set_target_parameters(ha, bus, target);
+	qla1280_get_target_parameters(ha, device);
 	spin_unlock_irqrestore(HOST_LOCK, flags);
 	return status;
 }
@@ -1748,55 +1502,47 @@
  *   support tagged queueing.
  **************************************************************************/
 static void
-qla1280_select_queue_depth(struct Scsi_Host *host, Scsi_Device *scsi_devs)
+qla1280_select_queue_depth(struct Scsi_Host *host, struct scsi_device *sdev_q)
 {
-	Scsi_Device *device;
 	struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata;
+	struct scsi_device *sdev;
 
 	ENTER("qla1280_select_queue_depth");
-	for (device = scsi_devs; device != NULL; device = device->next) {
-		if (device->host == host)
-			qla1280_slave_configure(device);
-	}
-
-	if (scsi_devs)
-		qla1280_check_for_dead_scsi_bus(ha, scsi_devs->channel);
+	for (sdev = sdev_q; sdev; sdev = sdev->next)
+		if (sdev->host == host)
+			qla1280_slave_configure(sdev);
 
+	if (sdev_q)
+		qla1280_check_for_dead_scsi_bus(ha, sdev_q->channel);
 	LEAVE("qla1280_select_queue_depth");
 }
 #endif
 
 /*
- * Driver Support Routines
- */
-
-/*
  * qla1280_done
  *      Process completed commands.
  *
  * Input:
  *      ha           = adapter block pointer.
- *      done_q_first = done queue first pointer.
- *      done_q_last  = done queue last pointer.
+ *      done_q       = done queue.
  */
 static void
-qla1280_done(struct scsi_qla_host *ha, struct srb ** done_q_first,
-	     struct srb ** done_q_last)
+qla1280_done(struct scsi_qla_host *ha)
 {
 	struct srb *sp;
+	struct list_head *done_q;
 	int bus, target, lun;
-	Scsi_Cmnd *cmd;
+	struct scsi_cmnd *cmd;
 
 	ENTER("qla1280_done");
 
-	while (*done_q_first != NULL) {
-		/* remove command from done list */
-		sp = *done_q_first;
-		if (!(*done_q_first = sp->s_next))
-			*done_q_last = NULL;
-		else
-			(*done_q_first)->s_prev = NULL;
+	done_q = &ha->done_q;
+
+	while (!list_empty(done_q)) {
+		sp = list_entry(done_q->next, struct srb, list);
 
+		list_del(&sp->list);
+	
 		cmd = sp->cmd;
 		bus = SCSI_BUS_32(cmd);
 		target = SCSI_TCN_32(cmd);
@@ -1822,15 +1568,13 @@
 			dprintk(3, "S/G unmap_sg cmd=%p\n", cmd);
 
 			pci_unmap_sg(ha->pdev, cmd->request_buffer,
-				     cmd->use_sg,
-				     scsi_to_pci_dma_dir(cmd->sc_data_direction));
+				     cmd->use_sg, cmd->sc_data_direction);
 		} else if (cmd->request_bufflen) {
 			/*dprintk(1, "No S/G unmap_single cmd=%x saved_dma_handle=%lx\n",
 			  cmd, sp->saved_dma_handle); */
 
 			pci_unmap_page(ha->pdev, sp->saved_dma_handle,
-				       cmd->request_bufflen,
-				       scsi_to_pci_dma_dir(cmd->sc_data_direction));
+				       cmd->request_bufflen, cmd->sc_data_direction);
 		}
 
 		/* Call the mid-level driver interrupt handler */
@@ -1845,7 +1589,6 @@
 
 		if(sp->wait != NULL)
 			complete(sp->wait);
-
 	}
 	LEAVE("qla1280_done");
 }
@@ -1854,9 +1597,13 @@
  * Translates a ISP error to a Linux SCSI error
  */
 static int
-qla1280_return_status(struct response * sts, Scsi_Cmnd * cp)
+qla1280_return_status(struct response * sts, struct scsi_cmnd *cp)
 {
 	int host_status = DID_ERROR;
+	uint16_t comp_status = le16_to_cpu(sts->comp_status);
+	uint16_t state_flags = le16_to_cpu(sts->state_flags);
+	uint16_t residual_length = le16_to_cpu(sts->residual_length);
+	uint16_t scsi_status = le16_to_cpu(sts->scsi_status);
 #if DEBUG_QLA1280_INTR
 	static char *reason[] = {
 		"DID_OK",
@@ -1877,26 +1624,27 @@
 #if DEBUG_QLA1280_INTR
 	/*
 	  dprintk(1, "qla1280_return_status: compl status = 0x%04x\n",
-	  sts->comp_status);
+	  comp_status);
 	*/
 #endif
-	switch (sts->comp_status) {
+
+	switch (comp_status) {
 	case CS_COMPLETE:
 		host_status = DID_OK;
 		break;
 
 	case CS_INCOMPLETE:
-		if (!(sts->state_flags & SF_GOT_BUS))
+		if (!(state_flags & SF_GOT_BUS))
 			host_status = DID_NO_CONNECT;
-		else if (!(sts->state_flags & SF_GOT_TARGET))
+		else if (!(state_flags & SF_GOT_TARGET))
 			host_status = DID_BAD_TARGET;
-		else if (!(sts->state_flags & SF_SENT_CDB))
+		else if (!(state_flags & SF_SENT_CDB))
 			host_status = DID_ERROR;
-		else if (!(sts->state_flags & SF_TRANSFERRED_DATA))
+		else if (!(state_flags & SF_TRANSFERRED_DATA))
 			host_status = DID_ERROR;
-		else if (!(sts->state_flags & SF_GOT_STATUS))
+		else if (!(state_flags & SF_GOT_STATUS))
 			host_status = DID_ERROR;
-		else if (!(sts->state_flags & SF_GOT_SENSE))
+		else if (!(state_flags & SF_GOT_SENSE))
 			host_status = DID_ERROR;
 		break;
 
@@ -1913,14 +1661,14 @@
 		break;
 
 	case CS_DATA_OVERRUN:
-		dprintk(2, "Data overrun 0x%x\n", sts->residual_length);
+		dprintk(2, "Data overrun 0x%x\n", residual_length);
 		dprintk(2, "qla1280_isr: response packet data\n");
 		qla1280_dump_buffer(2, (char *)sts, RESPONSE_ENTRY_SIZE);
 		host_status = DID_ERROR;
 		break;
 
 	case CS_DATA_UNDERRUN:
-		if ((cp->request_bufflen - sts->residual_length) <
+		if ((cp->request_bufflen - residual_length) <
 		    cp->underflow) {
 			printk(KERN_WARNING
 			       "scsi: Underflow detected - retrying "
@@ -1937,120 +1685,12 @@
 
 #if DEBUG_QLA1280_INTR
 	dprintk(1, "qla1280 ISP status: host status (%s) scsi status %x\n",
-		reason[host_status], sts->scsi_status);
+		reason[host_status], scsi_status);
 #endif
 
 	LEAVE("qla1280_return_status");
 
-	return (sts->scsi_status & 0xff) | (host_status << 16);
-}
-
-/*
- * qla1280_done_q_put
- *      Place SRB command on done queue.
- *
- * Input:
- *      sp           = srb pointer.
- *      done_q_first = done queue first pointer.
- *      done_q_last  = done queue last pointer.
- */
-static void
-qla1280_done_q_put(struct srb * sp, struct srb ** done_q_first,
-		   struct srb ** done_q_last)
-{
-	ENTER("qla1280_put_done_q");
-
-	/* Place block on done queue */
-	sp->s_next = NULL;
-	sp->s_prev = *done_q_last;
-	if (!*done_q_first)
-		*done_q_first = sp;
-	else
-		(*done_q_last)->s_next = sp;
-	*done_q_last = sp;
-
-	LEAVE("qla1280_put_done_q");
-}
-
-
-/*
-* qla1280_mem_alloc
-*      Allocates adapter memory.
-*
-* Returns:
-*      0  = success.
-*      1  = failure.
-*/
-static int
-qla1280_mem_alloc(struct scsi_qla_host *ha)
-{
-	int status = 1;
-	dma_addr_t dma_handle;
-
-	ENTER("qla1280_mem_alloc");
-
-	/* get consistent memory allocated for request and response rings */
-	ha->request_ring = pci_alloc_consistent(ha->pdev,
-						((REQUEST_ENTRY_CNT + 1) *
-						 (sizeof(request_t))),
-						&dma_handle);
-	if (!ha->request_ring)
-		goto error;
-	ha->request_dma = dma_handle;
-	ha->response_ring = pci_alloc_consistent(ha->pdev,
-						 ((RESPONSE_ENTRY_CNT + 1) *
-						  (sizeof(struct response))),
-						 &dma_handle);
-	if (!ha->response_ring)
-		goto error;
-	ha->response_dma = dma_handle;
-	status = 0;
-	goto finish;
-
- error:
-	if (status)
-		dprintk(2, "qla1280_mem_alloc: **** FAILED ****\n");
-
-	if (ha->request_ring)
-		pci_free_consistent(ha->pdev,
-                                    ((REQUEST_ENTRY_CNT + 1) *
-				     (sizeof(request_t))),
-                                    ha->request_ring, ha->request_dma);
- finish:
-	LEAVE("qla1280_mem_alloc");
-	return status;
-}
-
-/*
- * qla1280_mem_free
- *      Frees adapter allocated memory.
- *
- * Input:
- *      ha = adapter block pointer.
- */
-static void
-qla1280_mem_free(struct scsi_qla_host *ha)
-{
-	ENTER("qlc1280_mem_free");
-	/* free consistent memory allocated for request and response rings */
-	if (ha->request_ring)
-		pci_free_consistent(ha->pdev,
-				    ((REQUEST_ENTRY_CNT + 1) *
-				     (sizeof(request_t))),
-				    ha->request_ring, ha->request_dma);
-
-	if (ha->response_ring)
-		pci_free_consistent(ha->pdev,
-				    ((RESPONSE_ENTRY_CNT + 1) *
-				     (sizeof(struct response))),
-				    ha->response_ring, ha->response_dma);
-
-	if (qla1280_buffer) {
-		free_page((unsigned long) qla1280_buffer);
-		qla1280_buffer = NULL;
-	}
-
-	LEAVE("qlc1280_mem_free");
+	return (scsi_status & 0xff) | (host_status << 16);
 }
 
 /****************************************************************************/
@@ -2058,14 +1698,14 @@
 /****************************************************************************/
 
  /*
-    * qla2100_enable_intrs
-    * qla2100_disable_intrs
-    *
-    * Input:
-    *      ha = adapter block pointer.
-    *
-    * Returns:
-    *      None
+  * qla2100_enable_intrs
+  * qla2100_disable_intrs
+  *
+  * Input:
+  *      ha = adapter block pointer.
+  *
+  * Returns:
+  *      None
   */
 static inline void
 qla1280_enable_intrs(struct scsi_qla_host *ha)
@@ -2101,7 +1741,7 @@
  * Returns:
  *      0 = success
  */
-static int
+static int __devinit
 qla1280_initialize_adapter(struct scsi_qla_host *ha)
 {
 	struct device_reg *reg;
@@ -2132,7 +1772,8 @@
 		if ((c = snia_pcibr_rrb_alloc(ha->pdev, &count1, &count2)) < 0)
 			printk(KERN_ERR "scsi(%li): Unable to allocate SN2 "
 			       "virtual DMA channels\n", ha->host_no);
-		ha->flags.use_pci_vchannel = 1;
+		else
+			ha->flags.use_pci_vchannel = 1;
 
 		driver_setup.no_nvram = 1;
 	}
@@ -2164,7 +1805,7 @@
 #endif
 	/* If firmware needs to be loaded */
 	if (qla1280_isp_firmware(ha)) {
-		if (!(status = qla1280_chip_diag (ha))) {
+		if (!(status = qla1280_chip_diag(ha))) {
 			status = qla1280_setup_chip(ha);
 		}
 	} else {
@@ -2288,72 +1929,6 @@
 }
 
 /*
- * PCI configuration
- *      Setup device PCI configuration registers.
- *
- * Input:
- *      ha = adapter block pointer.
- *
- * Returns:
- *      0 = success.
- */
-static int
-qla1280_pci_config(struct scsi_qla_host *ha)
-{
-#if MEMORY_MAPPED_IO
-	unsigned long base;
-	int size;
-#endif
-	uint16_t buf_wd;
-	int status = 1;
-
-	ENTER("qla1280_pci_config");
-
-	pci_set_master(ha->pdev);
-	/*
-	 * Set Bus Master Enable, Memory Address Space Enable and
-	 * reset any error bits, in the command register.
-	 */
-	pci_read_config_word (ha->pdev, PCI_COMMAND, &buf_wd);
-#if MEMORY_MAPPED_IO
-	buf_wd |= PCI_COMMAND_MEMORY;
-#endif
-	buf_wd |= PCI_COMMAND_IO;
-	pci_write_config_word (ha->pdev, PCI_COMMAND, buf_wd);
-	/*
-	 * Reset expansion ROM address decode enable.
-	 */
-	pci_read_config_word(ha->pdev, PCI_ROM_ADDRESS, &buf_wd);
-	buf_wd &= ~PCI_ROM_ADDRESS_ENABLE;
-	pci_write_config_word (ha->pdev, PCI_ROM_ADDRESS, buf_wd);
-
-	ha->host->io_port = pci_resource_start(ha->pdev, 0);
-	ha->host->io_port &= PCI_BASE_ADDRESS_IO_MASK;
-	ha->iobase = (struct device_reg *) ha->host->io_port;
-
-#if MEMORY_MAPPED_IO
-	/*
-	 * Find proper memory chunk for memory map I/O reg.
-	 */
-	base = pci_resource_start(ha->pdev, 1);
-	size = pci_resource_len(ha->pdev, 1);
-	/*
-	 * Get virtual address for I/O registers.
-	 */
-	ha->mmpbase = ioremap(base, size);
-	if (ha->mmpbase) {
-		ha->iobase = (struct device_reg *)ha->mmpbase;
-		status = 0;
-	}
-#else				/* MEMORY_MAPPED_IO */
-	status = 0;
-#endif				/* MEMORY_MAPPED_IO */
-
-	LEAVE("qla1280_pci_config");
-	return status;
-}
-
-/*
  * Chip diagnostics
  *      Test chip for proper operation.
  *
@@ -2724,8 +2299,8 @@
 
 	ENTER("qla1280_nvram_config");
 
-	if (ha->device_id == PCI_DEVICE_ID_QLOGIC_ISP12160 ||
-	    ha->device_id == PCI_DEVICE_ID_QLOGIC_ISP10160)
+	if (ha->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP12160 ||
+	    ha->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP10160)
 		is1x160 = 1;
 	else
 		is1x160 = 0;
@@ -2866,23 +2441,6 @@
 	ha->flags.disable_risc_code_load =
 		nv->cntr_flags_1.disable_loading_risc_code;
 
-#ifdef QLA_64BIT_PTR
-	/* Enable 64bit addressing for OS/System combination supporting it   */
-	/* actual NVRAM bit is: nv->cntr_flags_1.enable_64bit_addressing     */
-	/* but we will ignore it and use BITS_PER_LONG macro to setup for    */
-	/* 64 or 32 bit access of host memory in all x86/ia-64/Alpha systems */
-	ha->flags.enable_64bit_addressing = 1;
-#else
-	ha->flags.enable_64bit_addressing = 0;
-#endif
-
-	if (ha->flags.enable_64bit_addressing) {
-		dprintk(2, "scsi(%li): 64 Bit PCI Addressing Enabled\n",
-			ha->host_no);
-
-		pci_set_dma_mask(ha->pdev, (dma_addr_t) ~ 0ULL);
-	}
-
 	/* Set ISP hardware DMA burst */
 	mb[0] = nv->isp_config.c;
 	/* Enable DMA arbitration on dual channel controllers */
@@ -3196,8 +2754,7 @@
 {
 	struct device_reg *reg = ha->iobase;
 #if 0
-	struct srb *done_q_first = 0;
-	struct srb *done_q_last = 0;
+	LIST_HEAD(done_q);
 #endif
 	int status = 0;
 	int cnt;
@@ -3208,8 +2765,6 @@
 
 	ENTER("qla1280_mailbox_command");
 
-	ha->flags.mbox_busy = 1;
-
 	if (ha->mailbox_wait) {
 		printk(KERN_ERR "Warning mailbox wait already in use!\n");
 	}
@@ -3233,7 +2788,6 @@
 	}
 
 	/* Issue set host interrupt command. */
-	ha->flags.mbox_busy = 0;
 
 	/* set up a timer just in case we're really jammed */
 	init_timer(&timer);
@@ -3276,15 +2830,15 @@
 
 #if 0
 	/* Go check for any response interrupts pending. */
-	qla1280_isr(ha, &done_q_first, &done_q_last);
+	qla1280_isr(ha, &done_q);
 #endif
 
 	if (ha->flags.reset_marker)
 		qla1280_rst_aen(ha);
 
 #if 0
-	if (done_q_first)
-		qla1280_done (ha, &done_q_first, &done_q_last);
+	if (!list_empty(&done_q))
+		qla1280_done(ha, &done_q);
 #endif
 
 	if (status)
@@ -3307,23 +2861,22 @@
 {
 	struct device_reg *reg = ha->iobase;
 	uint16_t data;
-	struct srb *done_q_first = 0;
-	struct srb *done_q_last = 0;
+	LIST_HEAD(done_q);
 
 	/* ENTER("qla1280_poll"); */
 
 	/* Check for pending interrupts. */
 	data = RD_REG_WORD(&reg->istatus);
 	if (data & RISC_INT)
-		qla1280_isr(ha, &done_q_first, &done_q_last);
+		qla1280_isr(ha, &done_q);
 
-	if (!ha->flags.mbox_busy) {
+	if (!ha->mailbox_wait) {
 		if (ha->flags.reset_marker)
 			qla1280_rst_aen(ha);
 	}
 
-	if (done_q_first)
-		qla1280_done(ha, &done_q_first, &done_q_last);
+	if (!list_empty(&done_q))
+		qla1280_done(ha);
 
 	/* LEAVE("qla1280_poll"); */
 }
@@ -3573,7 +3126,7 @@
 qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
 {
 	struct device_reg *reg = ha->iobase;
-	Scsi_Cmnd *cmd = sp->cmd;
+	struct scsi_cmnd *cmd = sp->cmd;
 	cmd_a64_entry_t *pkt;
 	struct scatterlist *sg = NULL;
 	u32 *dword_ptr;
@@ -3582,6 +3135,7 @@
 	int cnt;
 	int req_cnt;
 	u16 seg_cnt;
+	u8 dir;
 
 	ENTER("qla1280_64bit_start_scsi:");
 
@@ -3590,7 +3144,7 @@
 	if (cmd->use_sg) {
 		sg = (struct scatterlist *) cmd->request_buffer;
 		seg_cnt = pci_map_sg(ha->pdev, sg, cmd->use_sg,
-				     scsi_to_pci_dma_dir(cmd->sc_data_direction));
+				     cmd->sc_data_direction);
 
 		if (seg_cnt > 2) {
 			req_cnt += (seg_cnt - 2) / 5;
@@ -3675,8 +3229,8 @@
 	/* dprintk(1, "Build packet for command[0]=0x%x\n",pkt->scsi_cdb[0]); */
 
 	/* Set transfer direction. */
-	sp->dir = qla1280_data_direction(cmd);
-	pkt->control_flags |= cpu_to_le16(sp->dir);
+	dir = qla1280_data_direction(cmd);
+	pkt->control_flags |= cpu_to_le16(dir);
 
 	/* Set total data segment count. */
 	pkt->dseg_count = cpu_to_le16(seg_cnt);
@@ -3780,7 +3334,7 @@
 
 			dma_handle = pci_map_page(ha->pdev, page, off,
 						  cmd->request_bufflen,
-						  scsi_to_pci_dma_dir(cmd->sc_data_direction));
+						  cmd->sc_data_direction);
 
 			/* save dma_handle for pci_unmap_page */
 			sp->saved_dma_handle = dma_handle;
@@ -3791,7 +3345,7 @@
 #endif
 			*dword_ptr++ = cpu_to_le32(pci_dma_lo32(dma_handle));
 			*dword_ptr++ = cpu_to_le32(pci_dma_hi32(dma_handle));
-			*dword_ptr = (uint32_t)cmd->request_bufflen;
+			*dword_ptr = cpu_to_le32(cmd->request_bufflen);
 
 			dprintk(5, "qla1280_64bit_start_scsi: No scatter/"
 				"gather command packet data - b %i, t %i, "
@@ -3801,10 +3355,6 @@
 					    REQUEST_ENTRY_SIZE);
 		}
 	} else {	/* No data transfer */
-		dword_ptr = (uint32_t *)(pkt + 1);
-		*dword_ptr++ = 0;
-		*dword_ptr++ = 0;
-		*dword_ptr = 0;
 		dprintk(5, "qla1280_64bit_start_scsi: No data, command "
 			"packet data - b %i, t %i, l %i \n",
 			SCSI_BUS_32(cmd), SCSI_TCN_32(cmd), SCSI_LUN_32(cmd));
@@ -3835,6 +3385,7 @@
 }
 
 
+#ifndef QLA_64BIT_PTR
 /*
  * qla1280_32bit_start_scsi
  *      The start SCSI is responsible for building request packets on
@@ -3858,7 +3409,7 @@
 qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
 {
 	struct device_reg *reg = ha->iobase;
-	Scsi_Cmnd *cmd = sp->cmd;
+	struct scsi_cmnd *cmd = sp->cmd;
 	struct cmd_entry *pkt;
 	struct scatterlist *sg = NULL;
 	uint32_t *dword_ptr;
@@ -3867,6 +3418,7 @@
 	int req_cnt;
 	uint16_t seg_cnt;
 	dma_addr_t dma_handle;
+	u8 dir;
 
 	ENTER("qla1280_32bit_start_scsi");
 
@@ -3884,7 +3436,7 @@
 		 */
 		sg = (struct scatterlist *) cmd->request_buffer;
 		seg_cnt = pci_map_sg(ha->pdev, sg, cmd->use_sg,
-				     scsi_to_pci_dma_dir(cmd->sc_data_direction));
+				     cmd->sc_data_direction);
 
 		/*
 		 * if greater than four sg entries then we need to allocate
@@ -3975,8 +3527,8 @@
 
 	/*dprintk(1, "Build packet for command[0]=0x%x\n",pkt->scsi_cdb[0]); */
 	/* Set transfer direction. */
-	sp->dir = qla1280_data_direction(cmd);
-	pkt->control_flags |= cpu_to_le16(sp->dir);
+	dir = qla1280_data_direction(cmd);
+	pkt->control_flags |= cpu_to_le16(dir);
 
 	/* Set total data segment count. */
 	pkt->dseg_count = cpu_to_le16(seg_cnt);
@@ -4061,16 +3613,13 @@
 			unsigned long off = (unsigned long)cmd->request_buffer & ~PAGE_MASK;
 			dma_handle = pci_map_page(ha->pdev, page, off,
 						  cmd->request_bufflen,
-						  scsi_to_pci_dma_dir(cmd->sc_data_direction));
+						  cmd->sc_data_direction);
 			sp->saved_dma_handle = dma_handle;
 
 			*dword_ptr++ = cpu_to_le32(pci_dma_lo32(dma_handle));
 			*dword_ptr = cpu_to_le32(cmd->request_bufflen);
 		}
 	} else {	/* No data transfer at all */
-		dword_ptr = (uint32_t *)(pkt + 1);
-		*dword_ptr++ = 0;
-		*dword_ptr = 0;
 		dprintk(5, "qla1280_32bit_start_scsi: No data, command "
 			"packet data - \n");
 		qla1280_dump_buffer(5, (char *)pkt, REQUEST_ENTRY_SIZE);
@@ -4102,6 +3651,7 @@
 
 	return status;
 }
+#endif
 
 /*
  * qla1280_req_pkt
@@ -4207,48 +3757,6 @@
 	LEAVE("qla1280_isp_cmd");
 }
 
-#if QL1280_LUN_SUPPORT
-/*
- * qla1280_enable_lun
- *      Issue enable LUN entry IOCB.
- *
- * Input:
- *      ha  = adapter block pointer.
- *      bus = SCSI BUS number.
- *      lun  = LUN number.
- */
-static void
-qla1280_enable_lun(struct scsi_qla_host *ha, int bus, int lun)
-{
-	struct elun_entry *pkt;
-
-	ENTER("qla1280_enable_lun");
-
-	/* Get request packet. */
-	/*
-	  if (pkt = (struct elun_entry *)qla1280_req_pkt(ha))
-	  {
-	  pkt->entry_type = ENABLE_LUN_TYPE;
-	  pkt->lun = cpu_to_le16(bus ? lun | BIT_15 : lun);
-	  pkt->command_count = 32;
-	  pkt->immed_notify_count = 1;
-	  pkt->group_6_length = MAX_CMDSZ;
-	  pkt->group_7_length = MAX_CMDSZ;
-	  pkt->timeout = cpu_to_le16(0x30);
-
-	  qla1280_isp_cmd(ha);
-	  }
-	*/
-	pkt = (struct elun_entry *) 1;
-
-	if (!pkt)
-		dprintk(2, "qla1280_enable_lun: **** FAILED ****\n");
-	else
-		dprintk(3, "qla1280_enable_lun: exiting normally\n");
-}
-#endif
-
-
 /****************************************************************************/
 /*                        Interrupt Service Routine.                        */
 /****************************************************************************/
@@ -4259,12 +3767,10 @@
  *
  * Input:
  *      ha           = adapter block pointer.
- *      done_q_first = done queue first pointer.
- *      done_q_last  = done queue last pointer.
+ *      done_q       = done queue.
  ****************************************************************************/
 static void
-qla1280_isr(struct scsi_qla_host *ha, struct srb ** done_q_first,
-	    struct srb ** done_q_last)
+qla1280_isr(struct scsi_qla_host *ha, struct list_head *done_q)
 {
 	struct device_reg *reg = ha->iobase;
 	struct response *pkt;
@@ -4336,13 +3842,7 @@
 					CMD_RESULT(sp->cmd) = 0;
 
 					/* Place block on done queue */
-					sp->s_next = NULL;
-					sp->s_prev = *done_q_last;
-					if (!*done_q_first)
-						*done_q_first = sp;
-					else
-						(*done_q_last)->s_next = sp;
-					*done_q_last = sp;
+					list_add_tail(&sp->list, done_q);
 				} else {
 					/*
 					 * If we get here we have a real problem!
@@ -4420,15 +3920,10 @@
 	}
 
 	/*
-	 * Response ring - waiting for the mbox_busy flag here seems
-	 * unnecessary as the mailbox data has been copied to ha->mailbox_out
-	 * by the time we actually get here!
+	 * We will receive interrupts during mailbox testing prior to
+	 * the card being marked online, hence the double check.
 	 */
-	if (!(ha->flags.online
-#if 0
-	    && !ha->flags.mbox_busy
-#endif
-		)) {
+	if (!(ha->flags.online && !ha->mailbox_wait)) {
 		dprintk(2, "qla1280_isr: Response pointer Error\n");
 		goto out;
 	}
@@ -4468,12 +3963,9 @@
 				ha->outstanding_cmds[pkt->handle]->cmd,
 				pkt->handle);
 			if (pkt->entry_type == STATUS_TYPE)
-				qla1280_status_entry(ha, pkt, done_q_first,
-						     done_q_last);
+				qla1280_status_entry(ha, pkt, done_q);
 			else
-				qla1280_error_entry(ha, pkt, done_q_first,
-						    done_q_last);
-
+				qla1280_error_entry(ha, pkt, done_q);
 			/* Adjust ring index. */
 			ha->rsp_ring_index++;
 			if (ha->rsp_ring_index == RESPONSE_ENTRY_CNT) {
@@ -4575,17 +4067,16 @@
  * Input:
  *      ha           = adapter block pointer.
  *      pkt          = entry pointer.
- *      done_q_first = done queue first pointer.
- *      done_q_last  = done queue last pointer.
+ *      done_q       = done queue.
  */
 static void
 qla1280_status_entry(struct scsi_qla_host *ha, struct response *pkt,
-		     struct srb **done_q_first, struct srb **done_q_last)
+		     struct list_head *done_q)
 {
 	unsigned int bus, target, lun;
 	int sense_sz;
 	struct srb *sp;
-	Scsi_Cmnd *cmd;
+	struct scsi_cmnd *cmd;
 	uint32_t handle = le32_to_cpu(pkt->handle);
 	uint16_t scsi_status = le16_to_cpu(pkt->scsi_status);
 	uint16_t comp_status = le16_to_cpu(pkt->comp_status);
@@ -4637,7 +4128,7 @@
 					sense_sz = req_sense_length;
 				else
 					/*
-					 * Scsi_Cmnd->sense_buffer is
+					 * scsi_cmnd->sense_buffer is
 					 * 64 bytes, why only copy 63?
 					 * This looks wrong! /Jes
 					 */
@@ -4659,9 +4150,9 @@
 						    sense_sz);
 		}
 	}
-	/* Place command on done queue. */
-	qla1280_done_q_put(sp, done_q_first, done_q_last);
 
+	/* Place command on done queue. */
+	list_add_tail(&sp->list, done_q);
  out:
 	LEAVE("qla1280_status_entry");
 }
@@ -4673,12 +4164,11 @@
  * Input:
  *      ha           = adapter block pointer.
  *      pkt          = entry pointer.
- *      done_q_first = done queue first pointer.
- *      done_q_last  = done queue last pointer.
+ *      done_q       = done queue.
  */
 static void
-qla1280_error_entry(struct scsi_qla_host *ha, struct response * pkt,
-		    struct srb ** done_q_first, struct srb ** done_q_last)
+qla1280_error_entry(struct scsi_qla_host *ha, struct response *pkt,
+		    struct list_head *done_q)
 {
 	struct srb *sp;
 	uint32_t handle = le32_to_cpu(pkt->handle);
@@ -4715,8 +4205,9 @@
 			/* Set error status. */
 			CMD_RESULT(sp->cmd) = DID_ERROR << 16;
 		}
+
 		/* Place command on done queue. */
-		qla1280_done_q_put(sp, done_q_first, done_q_last);
+		list_add_tail(&sp->list, done_q);
 	}
 #ifdef QLA_64BIT_PTR
 	else if (pkt->entry_type == COMMAND_A64_TYPE) {
@@ -4760,7 +4251,7 @@
 		       ha->host_no);
 		/* Dequeue all commands in outstanding command list. */
 		for (cnt = 0; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
-			Scsi_Cmnd *cmd;
+			struct scsi_cmnd *cmd;
 			sp = ha->outstanding_cmds[cnt];
 			if (sp) {
 
@@ -4894,7 +4385,8 @@
 }
 
 static void
-qla12160_get_target_parameters(struct scsi_qla_host *ha, Scsi_Device *device)
+qla1280_get_target_parameters(struct scsi_qla_host *ha,
+			      struct scsi_device *device)
 {
 	uint16_t mb[MAILBOX_REGISTER_COUNT];
 	int bus, target, lun;
@@ -4959,7 +4451,7 @@
  *
  **************************************************************************/
 static void
-__qla1280_print_scsi_cmd(Scsi_Cmnd * cmd)
+__qla1280_print_scsi_cmd(struct scsi_cmnd *cmd)
 {
 	struct scsi_qla_host *ha;
 	struct Scsi_Host *host = CMD_HOST(cmd);
@@ -4987,11 +4479,11 @@
 	   printk("  SG buffer: \n");
 	   qla1280_dump_buffer(1, (char *)sg, (cmd->use_sg*sizeof(struct scatterlist)));
 	   } */
-	printk("  tag=%d, flags=0x%x, transfersize=0x%x \n",
-	       cmd->tag, cmd->flags, cmd->transfersize);
+	printk("  tag=%d, transfersize=0x%x \n",
+	       cmd->tag, cmd->transfersize);
 	printk("  Pid=%li, SP=0x%p\n", cmd->pid, CMD_SP(cmd));
 	printk(" underflow size = 0x%x, direction=0x%x\n",
-	       cmd->underflow, sp->dir);
+	       cmd->underflow, cmd->sc_data_direction);
 }
 
 /**************************************************************************
@@ -5002,7 +4494,7 @@
 ql1280_dump_device(struct scsi_qla_host *ha)
 {
 
-	Scsi_Cmnd *cp;
+	struct scsi_cmnd *cp;
 	struct srb *sp;
 	int i;
 
@@ -5136,34 +4628,314 @@
 	return ret;
 }
 
-
-static Scsi_Host_Template driver_template = {
+#if LINUX_VERSION_CODE >= 0x020600
+static struct scsi_host_template qla1280_driver_template = {
+	.proc_name		= "qla1280",
+	.name			= "Qlogic ISP 1280/12160",
+	.info			= qla1280_info,
+	.slave_configure	= qla1280_slave_configure,
+	.queuecommand		= qla1280_queuecommand,
+	.eh_abort_handler	= qla1280_eh_abort,
+	.eh_device_reset_handler= qla1280_eh_device_reset,
+	.eh_bus_reset_handler	= qla1280_eh_bus_reset,
+	.eh_host_reset_handler	= qla1280_eh_adapter_reset,
+	.bios_param		= qla1280_biosparam,
 	.proc_info		= qla1280_proc_info,
+	.can_queue		= 0xfffff,
+	.this_id		= -1,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= ENABLE_CLUSTERING,
+};
+#else
+static Scsi_Host_Template qla1280_driver_template = {
+	.proc_name		= "qla1280",
 	.name			= "Qlogic ISP 1280/12160",
 	.detect			= qla1280_detect,
 	.release		= qla1280_release,
 	.info			= qla1280_info,
 	.queuecommand		= qla1280_queuecommand,
-#if LINUX_VERSION_CODE >= 0x020545
-	.slave_configure	= qla1280_slave_configure,
-#endif
 	.eh_abort_handler	= qla1280_eh_abort,
 	.eh_device_reset_handler= qla1280_eh_device_reset,
 	.eh_bus_reset_handler	= qla1280_eh_bus_reset,
 	.eh_host_reset_handler	= qla1280_eh_adapter_reset,
-	.bios_param		= qla1280_biosparam,
-	.can_queue		= 255,
+	.bios_param		= qla1280_biosparam_old,
+	.proc_info		= qla1280_proc_info_old,
+	.can_queue		= 0xfffff,
 	.this_id		= -1,
 	.sg_tablesize		= SG_ALL,
-	.cmd_per_lun		= 3,
+	.cmd_per_lun		= 1,
 	.use_clustering		= ENABLE_CLUSTERING,
-#if LINUX_VERSION_CODE < 0x020545
 	.use_new_eh_code	= 1,
+};
+#endif
+
+static int __devinit
+qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
+{
+	int devnum = id->driver_data;
+	struct qla_boards *bdp = &ql1280_board_tbl[devnum];
+	struct Scsi_Host *host;
+	struct scsi_qla_host *ha;
+	int error = -ENODEV;
+
+	/* Bypass all AMI SUBSYS VENDOR IDs */
+	if (pdev->subsystem_vendor == PCI_VENDOR_ID_AMI) {
+		printk(KERN_INFO
+		       "qla1280: Skipping AMI SubSys Vendor ID Chip\n");
+		goto error;
+	}
+
+	printk(KERN_INFO "qla1280: %s found on PCI bus %i, dev %i\n",
+	       bdp->name, pdev->bus->number, PCI_SLOT(pdev->devfn));
+	
+	if (pci_enable_device(pdev)) {
+		printk(KERN_WARNING
+		       "qla1280: Failed to enabled pci device, aborting.\n");
+		goto error;
+	}
+
+	pci_set_master(pdev);
+
+	error = -ENOMEM;
+	host = scsi_host_alloc(&qla1280_driver_template, sizeof(*ha));
+	if (!host) {
+		printk(KERN_WARNING
+		       "qla1280: Failed to register host, aborting.\n");
+		goto error_disable_device;
+	}
+
+	ha = (struct scsi_qla_host *)host->hostdata;
+	memset(ha, 0, sizeof(struct scsi_qla_host));
+
+	ha->pdev = pdev;
+	ha->devnum = devnum;	/* specifies microcode load address */
+
+#ifdef QLA_64BIT_PTR
+	if (pci_set_dma_mask(ha->pdev, (dma_addr_t) ~ 0ULL)) {
+		if (pci_set_dma_mask(ha->pdev, 0xffffffff)) {
+			printk(KERN_WARNING "scsi(%li): Unable to set a "
+			       " suitable DMA mask - aboring\n", ha->host_no);
+			error = -ENODEV;
+			goto error_free_irq;
+		}
+	} else
+		dprintk(2, "scsi(%li): 64 Bit PCI Addressing Enabled\n",
+			ha->host_no);
+#else
+	if (pci_set_dma_mask(ha->pdev, 0xffffffff)) {
+		printk(KERN_WARNING "scsi(%li): Unable to set a "
+		       " suitable DMA mask - aboring\n", ha->host_no);
+		error = -ENODEV;
+		goto error_free_irq;
+	}
 #endif
+
+	ha->request_ring = pci_alloc_consistent(ha->pdev,
+			((REQUEST_ENTRY_CNT + 1) * (sizeof(request_t))),
+			&ha->request_dma);
+	if (!ha->request_ring) {
+		printk(KERN_INFO "qla1280: Failed to get request memory\n");
+		goto error_put_host;
+	}
+
+	ha->response_ring = pci_alloc_consistent(ha->pdev,
+			((RESPONSE_ENTRY_CNT + 1) * (sizeof(struct response))),
+			&ha->response_dma);
+	if (!ha->response_ring) {
+		printk(KERN_INFO "qla1280: Failed to get response memory\n");
+		goto error_free_request_ring;
+	}
+
+	ha->ports = bdp->numPorts;
+
+	ha->host = host;
+	ha->host_no = host->host_no;
+
+	host->irq = pdev->irq;
+	host->max_channel = bdp->numPorts - 1;
+	host->max_lun = MAX_LUNS - 1;
+	host->max_id = MAX_TARGETS;
+	host->max_sectors = 1024;
+	host->unique_id = host->host_no;
+
+#if LINUX_VERSION_CODE < 0x020545
+	host->select_queue_depths = qla1280_select_queue_depth;
+#endif
+
+	error = -ENODEV;
+
+#if MEMORY_MAPPED_IO
+	ha->mmpbase = ioremap(pci_resource_start(ha->pdev, 1),
+			      pci_resource_len(ha->pdev, 1));
+	if (!ha->mmpbase) {
+		printk(KERN_INFO "qla1280: Unable to map I/O memory\n");
+		goto error_free_response_ring;
+	}
+
+	host->base = (unsigned long)ha->mmpbase;
+	ha->iobase = (struct device_reg *)ha->mmpbase;
+#else
+	host->io_port = pci_resource_start(ha->pdev, 0);
+	if (!request_region(host->io_port, 0xff, "qla1280")) {
+		printk(KERN_INFO "qla1280: Failed to reserve i/o region "
+				 "0x%04lx-0x%04lx - already in use\n",
+		       host->io_port, host->io_port + 0xff);
+		goto error_free_response_ring;
+	}
+
+	ha->iobase = (struct device_reg *)host->io_port;
+#endif
+
+	INIT_LIST_HEAD(&ha->done_q);
+
+	/* Disable ISP interrupts. */
+	qla1280_disable_intrs(ha);
+
+	if (request_irq(pdev->irq, qla1280_intr_handler, SA_SHIRQ,
+				"qla1280", ha)) {
+		printk("qla1280 : Failed to reserve interrupt %d already "
+		       "in use\n", pdev->irq);
+		goto error_release_region;
+	}
+
+	/* load the F/W, read paramaters, and init the H/W */
+	if (qla1280_initialize_adapter(ha)) {
+		printk(KERN_INFO "qla1x160: Failed to initialize adapter\n");
+		goto error_free_irq;
+	}
+
+	/* set our host ID  (need to do something about our two IDs) */
+	host->this_id = ha->bus_settings[0].id;
+
+	pci_set_drvdata(pdev, host);
+
+#if LINUX_VERSION_CODE >= 0x020600
+	error = scsi_add_host(host, &pdev->dev);
+	if (error)
+		goto error_disable_adapter;
+	scsi_scan_host(host);
+#else
+	scsi_set_pci_device(host, pdev);
+#endif
+
+	return 0;
+
+#if LINUX_VERSION_CODE >= 0x020600
+ error_disable_adapter:
+	WRT_REG_WORD(&ha->iobase->ictrl, 0);
+#endif
+ error_free_irq:
+	free_irq(pdev->irq, ha);
+ error_release_region:
+#if MEMORY_MAPPED_IO
+	iounmap(ha->mmpbase);
+#else
+	release_region(host->io_port, 0xff);
+#endif
+ error_free_response_ring:
+	pci_free_consistent(ha->pdev,
+			((RESPONSE_ENTRY_CNT + 1) * (sizeof(struct response))),
+			ha->response_ring, ha->response_dma);
+ error_free_request_ring:
+	pci_free_consistent(ha->pdev,
+			((REQUEST_ENTRY_CNT + 1) * (sizeof(request_t))),
+			ha->request_ring, ha->request_dma);
+ error_put_host:
+	scsi_host_put(host);
+ error_disable_device:
+	pci_disable_device(pdev);
+ error:
+	return error;
+}
+
+
+static void __devexit
+qla1280_remove_one(struct pci_dev *pdev)
+{
+	struct Scsi_Host *host = pci_get_drvdata(pdev);
+	struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata;
+
+#if LINUX_VERSION_CODE >= 0x020600
+	scsi_remove_host(host);
+#endif
+
+	WRT_REG_WORD(&ha->iobase->ictrl, 0);
+
+	free_irq(pdev->irq, ha);
+
+#if MEMORY_MAPPED_IO
+	iounmap(ha->mmpbase);
+#else
+	release_region(host->io_port, 0xff);
+#endif
+
+	pci_free_consistent(ha->pdev,
+			((REQUEST_ENTRY_CNT + 1) * (sizeof(request_t))),
+			ha->request_ring, ha->request_dma);
+	pci_free_consistent(ha->pdev,
+			((RESPONSE_ENTRY_CNT + 1) * (sizeof(struct response))),
+			ha->response_ring, ha->response_dma);
+
+	pci_disable_device(pdev);
+
+	scsi_host_put(host);
+}
+
+#if LINUX_VERSION_CODE >= 0x020600
+static struct pci_driver qla1280_pci_driver = {
+	.name		= "qla1280",
+	.id_table	= qla1280_pci_tbl,
+	.probe		= qla1280_probe_one,
+	.remove		= __devexit_p(qla1280_remove_one),
 };
 
-#include "scsi_module.c"
+static int __init
+qla1280_init(void)
+{
+	if (sizeof(struct srb) > sizeof(struct scsi_pointer)) {
+		printk(KERN_WARNING
+		       "qla1280: struct srb too big, aborting\n");
+		return -EINVAL;
+	}
+
+#ifdef MODULE
+	/*
+	 * If we are called as a module, the qla1280 pointer may not be null
+	 * and it would point to our bootup string, just like on the lilo
+	 * command line.  IF not NULL, then process this config string with
+	 * qla1280_setup
+	 *
+	 * Boot time Options
+	 * To add options at boot time add a line to your lilo.conf file like:
+	 * append="qla1280=verbose,max_tags:{{255,255,255,255},{255,255,255,255}}"
+	 * which will result in the first four devices on the first two
+	 * controllers being set to a tagged queue depth of 32.
+	 */
+	if (qla1280)
+		qla1280_setup(qla1280);
+#endif
+
+	return pci_module_init(&qla1280_pci_driver);
+}
+
+static void __exit
+qla1280_exit(void)
+{
+	pci_unregister_driver(&qla1280_pci_driver);
+}
+
+module_init(qla1280_init);
+module_exit(qla1280_exit);
 
+#else
+# define driver_template qla1280_driver_template
+# include "scsi_module.c"
+#endif
+
+MODULE_AUTHOR("Qlogic & Jes Sorensen");
+MODULE_DESCRIPTION("Qlogic ISP SCSI (qla1x80/qla1x160) driver");
+MODULE_LICENSE("GPL");
 
 /*
  * Overrides for Emacs so that we almost follow Linus's tabbing style.
diff -Nru a/drivers/scsi/qla1280.h b/drivers/scsi/qla1280.h
--- a/drivers/scsi/qla1280.h	Tue Feb  3 19:45:43 2004
+++ b/drivers/scsi/qla1280.h	Tue Feb  3 19:45:43 2004
@@ -17,8 +17,8 @@
 *
 ******************************************************************************/
 
-#ifndef	_IO_HBA_QLA1280_H	/* wrapper symbol for kernel use */
-#define	_IO_HBA_QLA1280_H	/* subject to change without notice */
+#ifndef	_QLA1280_H
+#define	_QLA1280_H
 
 /*
  * Data bit definitions.
@@ -100,55 +100,23 @@
  * on cmd->SCp location of every I/O
  */
 struct srb {
-	Scsi_Cmnd *cmd;		/* (4/8) SCSI command block */
-	struct srb *s_next;	/* (4/8) Next block on LU queue */
-	struct srb *s_prev;	/* (4/8) Previous block on LU queue */
-	uint8_t flags;		/* (1) Status flags. */
-	uint8_t dir;		/* direction of transfer */
-	/*
-	 * This should be moved around to save space.
-	 */
-	dma_addr_t saved_dma_handle;	/* for unmap of single transfers */
+	struct list_head list;		/* (8/16) LU queue */
+	struct scsi_cmnd *cmd;	/* (4/8) SCSI command block */
 	/* NOTE: the sp->cmd will be NULL when this completion is
 	 * called, so you should know the scsi_cmnd when using this */
 	struct completion *wait;
+	dma_addr_t saved_dma_handle;	/* for unmap of single transfers */
+	uint8_t flags;		/* (1) Status flags. */
+	uint8_t dir;		/* direction of transfer */
 };
 
 /*
  * SRB flag definitions
  */
-#define SRB_TIMEOUT		BIT_0	/* Command timed out */
-#define SRB_SENT		BIT_1	/* Command sent to ISP */
-#define SRB_ABORT_PENDING	BIT_2	/* Command abort sent to device */
-#define SRB_ABORTED		BIT_3	/* Command aborted command already */
-
-/*
- * Logical Unit Queue structure
- */
-struct scsi_lu {
-	struct srb *q_first;	/* First block on LU queue */
-	struct srb *q_last;	/* Last block on LU queue */
-	uint8_t q_flag;		/* LU queue state flags */
-	uint8_t q_sense[16];	/* sense data */
-	unsigned long io_cnt;	/* total xfer count */
-	unsigned long resp_time;/* total response time (start - finish) */
-	unsigned long act_time;	/* total actived time (minus queuing time) */
-	unsigned long w_cnt;	/* total writes */
-	unsigned long r_cnt;	/* total reads */
-	uint16_t q_outcnt;	/* Pending jobs for this LU */
-};
-
-/*
- * Logical Unit flags
- */
-#define QLA1280_QBUSY	BIT_0
-#define QLA1280_QWAIT	BIT_1
-#define QLA1280_QSUSP	BIT_2
-#define QLA1280_QSENSE	BIT_3	/* Sense data cache valid */
-#define QLA1280_QRESET	BIT_4
-#define QLA1280_QHBA	BIT_5
-#define QLA1280_BSUSP	BIT_6	/* controller is suspended */
-#define QLA1280_BREM	BIT_7	/* controller is removed */
+#define SRB_TIMEOUT		(1 << 0)	/* Command timed out */
+#define SRB_SENT		(1 << 1)	/* Command sent to ISP */
+#define SRB_ABORT_PENDING	(1 << 2)	/* Command abort sent to device */
+#define SRB_ABORTED		(1 << 3)	/* Command aborted command already */
 
 /*
  *  ISP I/O Register Set structure definitions.
@@ -341,16 +309,19 @@
 	} cntr_flags_1;		/* 5 */
 
 	struct {
-		uint16_t boot_lun_number:5;
-		uint16_t scsi_bus_number:1;
-		uint16_t unused_6:1;
-		uint16_t unused_7:1;
-		uint16_t boot_target_number:4;
-		uint16_t unused_12:1;
-		uint16_t unused_13:1;
-		uint16_t unused_14:1;
-		uint16_t unused_15:1;
-	} cntr_flags_2;		/* 6, 7 */
+		uint8_t boot_lun_number:5;
+		uint8_t scsi_bus_number:1;
+		uint8_t unused_6:1;
+		uint8_t unused_7:1;
+	} cntr_flags_2l;	/* 7 */
+
+	struct {
+		uint8_t boot_target_number:4;
+		uint8_t unused_12:1;
+		uint8_t unused_13:1;
+		uint8_t unused_14:1;
+		uint8_t unused_15:1;
+	} cntr_flags_2h;	/* 8 */
 
 	uint16_t unused_8;	/* 8, 9 */
 	uint16_t unused_10;	/* 10, 11 */
@@ -1021,11 +992,7 @@
 
 	unsigned char *mmpbase;	/* memory mapped address */
 	unsigned long host_no;
-	unsigned long instance;
 	struct pci_dev *pdev;
-	uint32_t device_id;
-	uint8_t pci_bus;
-	uint8_t pci_device_fn;
 	uint8_t devnum;
 	uint8_t revision;
 	uint8_t ports;
@@ -1040,18 +1007,9 @@
 	/* BUS configuration data */
 	struct bus_param bus_settings[MAX_BUSES];
 
-#if 0
-	/* bottom half run queue */
-	struct tq_struct run_qla_bh;
-#endif
-
 	/* Received ISP mailbox data. */
 	volatile uint16_t mailbox_out[MAILBOX_REGISTER_COUNT];
 
-#ifdef UNUSED
-	struct timer_list dev_timer[MAX_TARGETS];
-#endif
-
 	dma_addr_t request_dma;		/* Physical Address */
 	request_t *request_ring;	/* Base virtual address */
 	request_t *request_ring_ptr;	/* Current address. */
@@ -1063,30 +1021,19 @@
 	struct response *response_ring_ptr;	/* Current address. */
 	uint16_t rsp_ring_index;	/* Current index. */
 
-#if WATCHDOGTIMER
-	/* Watchdog queue, lock and total timer */
-	uint8_t watchdog_q_lock;	/* Lock for watchdog queue */
-	struct srb *wdg_q_first;	/* First job on watchdog queue */
-	struct srb *wdg_q_last;	/* Last job on watchdog queue */
-	uint32_t total_timeout;	/* Total timeout (quantum count) */
-	uint32_t watchdogactive;
-#endif
-
-	struct srb *done_q_first;	/* First job on done queue */
-	struct srb *done_q_last;	/* Last job on done queue */
+	struct list_head done_q;	/* Done queue */
 
 	struct completion *mailbox_wait;
 
 	volatile struct {
-		uint32_t mbox_busy:1;			/* 0 */
-		uint32_t online:1;			/* 1 */
-		uint32_t reset_marker:1;		/* 2 */
-		uint32_t disable_host_adapter:1;	/* 4 */
-		uint32_t reset_active:1;		/* 5 */
-		uint32_t abort_isp_active:1;		/* 6 */
-		uint32_t disable_risc_code_load:1;	/* 7 */
-		uint32_t enable_64bit_addressing:1;	/* 8 */
-		uint32_t in_reset:1;			/* 9 */
+		uint32_t online:1;			/* 0 */
+		uint32_t reset_marker:1;		/* 1 */
+		uint32_t disable_host_adapter:1;	/* 2 */
+		uint32_t reset_active:1;		/* 3 */
+		uint32_t abort_isp_active:1;		/* 4 */
+		uint32_t disable_risc_code_load:1;	/* 5 */
+		uint32_t enable_64bit_addressing:1;	/* 6 */
+		uint32_t in_reset:1;			/* 7 */
 		uint32_t ints_enabled:1;
 		uint32_t ignore_nvram:1;
 #ifdef __ia64__
@@ -1098,10 +1045,4 @@
 	int nvram_valid;
 };
 
-/*
- * Macros to help code, maintain, etc.
- */
-#define SUBDEV(b, t, l)		((b << (MAX_T_BITS + MAX_L_BITS)) | (t << MAX_L_BITS) | l)
-#define LU_Q(ha, b, t, l)	(ha->dev[SUBDEV(b, t, l)])
-
-#endif				/* _IO_HBA_QLA1280_H */
+#endif /* _QLA1280_H */
diff -Nru a/drivers/scsi/qla2xxx/Kconfig b/drivers/scsi/qla2xxx/Kconfig
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/Kconfig	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,29 @@
+config SCSI_QLA2XXX_CONFIG
+	tristate
+	default (SCSI && PCI)
+	depends on SCSI && PCI
+
+config SCSI_QLA2XXX
+	tristate
+
+config SCSI_QLA21XX
+	tristate "Qlogic ISP2100 host adapter family support"
+	select SCSI_QLA2XXX
+	depends on SCSI_QLA2XXX_CONFIG
+	---help---
+	This driver supports the QLogic 21xx (ISP2100) host adapter family.
+
+config SCSI_QLA22XX
+	tristate "Qlogic ISP2200 host adapter family support"
+	select SCSI_QLA2XXX
+	depends on SCSI_QLA2XXX_CONFIG
+	---help---
+	This driver supports the QLogic 22xx (ISP2200) host adapter family.
+
+config SCSI_QLA23XX
+	tristate "Qlogic ISP23xx host adapter family support"
+	select SCSI_QLA2XXX
+	depends on SCSI_QLA2XXX_CONFIG
+	---help---
+	This driver supports the QLogic 23xx (ISP2300, ISP2312, and ISP2322)
+	host adapter family.
diff -Nru a/drivers/scsi/qla2xxx/Makefile b/drivers/scsi/qla2xxx/Makefile
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/Makefile	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,12 @@
+EXTRA_CFLAGS += -g -Idrivers/scsi -DUNIQUE_FW_NAME
+
+qla2xxx-y := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \
+		qla_dbg.o qla_sup.o qla_rscn.o
+
+qla2100-y := ql2100.o ql2100_fw.o
+qla2200-y := ql2200.o ql2200_fw.o
+qla2300-y := ql2300.o ql2300_fw.o #ql2322_fw.o
+
+obj-$(CONFIG_SCSI_QLA21XX) += qla2xxx.o qla2100.o
+obj-$(CONFIG_SCSI_QLA22XX) += qla2xxx.o qla2200.o
+obj-$(CONFIG_SCSI_QLA23XX) += qla2xxx.o qla2300.o
diff -Nru a/drivers/scsi/qla2xxx/ql2100.c b/drivers/scsi/qla2xxx/ql2100.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/ql2100.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,92 @@
+/*
+ * QLogic ISP2100 device driver for Linux 2.6.x
+ * Copyright (C) 2003 Christoph Hellwig.
+ * Copyright (C) 2003 QLogic Corporation (www.qlogic.com)
+ *
+ * Released under GPL v2.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+
+#include "qla_os.h"
+#include "qla_def.h"
+
+static char qla_driver_name[] = "qla2100";
+
+extern unsigned char  fw2100tp_version[];
+extern unsigned char  fw2100tp_version_str[];
+extern unsigned short fw2100tp_addr01;
+extern unsigned short fw2100tp_code01[];
+extern unsigned short fw2100tp_length01;
+
+static struct qla_fw_info qla_fw_tbl[] = {
+	{
+		.addressing	= FW_INFO_ADDR_NORMAL,
+		.fwcode		= &fw2100tp_code01[0],
+		.fwlen		= &fw2100tp_length01,
+		.fwstart	= &fw2100tp_addr01,
+	},
+
+	{ FW_INFO_ADDR_NOMORE, },
+};
+
+static struct qla_board_info qla_board_tbl = {
+	.drv_name	= qla_driver_name,
+
+	.isp_name	= "ISP2100",
+	.fw_info	= qla_fw_tbl,
+};
+
+static struct pci_device_id qla2100_pci_tbl[] = {
+	{
+		.vendor		= PCI_VENDOR_ID_QLOGIC,
+		.device		= PCI_DEVICE_ID_QLOGIC_ISP2100,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= (unsigned long)&qla_board_tbl,
+	},
+
+	{0, 0},
+};
+MODULE_DEVICE_TABLE(pci, qla2100_pci_tbl);
+
+static int __devinit
+qla2100_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
+{
+	return qla2x00_probe_one(pdev,
+	    (struct qla_board_info *)id->driver_data);
+}
+
+static void __devexit
+qla2100_remove_one(struct pci_dev *pdev)
+{
+	qla2x00_remove_one(pdev);
+}
+
+static struct pci_driver qla2100_pci_driver = {
+	.name		= "qla2100",
+	.id_table	= qla2100_pci_tbl,
+	.probe		= qla2100_probe_one,
+	.remove		= __devexit_p(qla2100_remove_one),
+};
+
+static int __init
+qla2100_init(void)
+{
+	return pci_module_init(&qla2100_pci_driver);
+}
+
+static void __exit
+qla2100_exit(void)
+{
+	pci_unregister_driver(&qla2100_pci_driver);
+}
+
+module_init(qla2100_init);
+module_exit(qla2100_exit);
+
+MODULE_AUTHOR("QLogic Corporation");
+MODULE_DESCRIPTION("QLogic ISP21xx FC-SCSI Host Bus Adapter driver");
+MODULE_LICENSE("GPL");
diff -Nru a/drivers/scsi/qla2xxx/ql2100_fw.c b/drivers/scsi/qla2xxx/ql2100_fw.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/ql2100_fw.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,4858 @@
+/******************************************************************************
+ *                  QLOGIC LINUX SOFTWARE
+ *
+ * QLogic ISP2x00 device driver for Linux 2.6.x
+ * Copyright (C) 2003 QLogic Corporation
+ * (www.qlogic.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ *************************************************************************/
+
+/*
+ *	Firmware Version 1.19.24 (14:02 Jul 16, 2002)
+ */
+
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2100tp_version = 1*1024+19;
+#else
+unsigned short risc_code_version = 1*1024+19;
+#endif
+
+#ifdef UNIQUE_FW_NAME
+unsigned char fw2100tp_version_str[] = {1,19,24};
+#else
+unsigned char firmware_version[] = {1,19,24};
+#endif
+
+#ifdef UNIQUE_FW_NAME
+#define fw2100tp_VERSION_STRING "1.19.24"
+#else
+#define FW_VERSION_STRING "1.19.24"
+#endif
+
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2100tp_addr01 = 0x1000 ;
+#else
+unsigned short risc_code_addr01 = 0x1000 ;
+#endif
+
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2100tp_code01[] = { 
+#else
+unsigned short risc_code01[] = { 
+#endif
+	0x0078, 0x102d, 0x0000, 0x95f1, 0x0000, 0x0001, 0x0013, 0x0018,
+	0x0017, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030,
+	0x3120, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241,
+	0x5449, 0x4f4e, 0x2049, 0x5350, 0x3231, 0x3030, 0x2046, 0x6972,
+	0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030,
+	0x312e, 0x3139, 0x2020, 0x2020, 0x2400, 0x2091, 0x2000, 0x20c1,
+	0x0021, 0x2039, 0xffff, 0x2019, 0xaaaa, 0x2760, 0x2069, 0x7fff,
+	0x20c1, 0x0020, 0x2c2c, 0x2d34, 0x2762, 0x236a, 0x2c24, 0x2d04,
+	0x266a, 0x2562, 0xa406, 0x00c0, 0x1052, 0x20c1, 0x0021, 0x2c2c,
+	0x2362, 0x2c04, 0x2562, 0xa306, 0x0040, 0x1052, 0x20c1, 0x0020,
+	0x2039, 0x8fff, 0x20a1, 0xad00, 0x2708, 0x810d, 0x810d, 0x810d,
+	0x810d, 0xa18c, 0x000f, 0x2001, 0x000a, 0xa112, 0xa00e, 0x21a8,
+	0x41a4, 0x3400, 0x8211, 0x00c0, 0x105f, 0x2708, 0x3400, 0xa102,
+	0x0040, 0x106f, 0x0048, 0x106f, 0x20a8, 0xa00e, 0x41a4, 0x20a1,
+	0xa5f1, 0x2009, 0x0000, 0x20a9, 0x070f, 0x41a4, 0x3400, 0x20c9,
+	0xaaff, 0x2059, 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x25c7,
+	0x2051, 0xa600, 0x2a70, 0x7762, 0xa786, 0x8fff, 0x0040, 0x1092,
+	0x705f, 0xcd00, 0x705b, 0xccf1, 0x7067, 0x0200, 0x706b, 0x0200,
+	0x0078, 0x109a, 0x705b, 0xbd01, 0x7067, 0x0100, 0x706b, 0x0100,
+	0x705f, 0xbd00, 0x1078, 0x12df, 0x1078, 0x13ca, 0x1078, 0x1577,
+	0x1078, 0x1ce9, 0x1078, 0x42ec, 0x1078, 0x76bf, 0x1078, 0x1355,
+	0x1078, 0x2ac0, 0x1078, 0x4e93, 0x1078, 0x49a3, 0x1078, 0x594a,
+	0x1078, 0x2263, 0x1078, 0x5c43, 0x1078, 0x5485, 0x1078, 0x2162,
+	0x1078, 0x2240, 0x2091, 0x3009, 0x7823, 0x0000, 0x0090, 0x10cf,
+	0x7820, 0xa086, 0x0002, 0x00c0, 0x10cf, 0x7823, 0x4000, 0x0068,
+	0x10c7, 0x781b, 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2a70,
+	0x7003, 0x0000, 0x2001, 0x017f, 0x2003, 0x0000, 0x2a70, 0x7000,
+	0xa08e, 0x0003, 0x00c0, 0x10ef, 0x1078, 0x365e, 0x1078, 0x2ae8,
+	0x1078, 0x4ee3, 0x1078, 0x4b66, 0x2009, 0x0100, 0x2104, 0xa082,
+	0x0002, 0x0048, 0x10f3, 0x1078, 0x5966, 0x0078, 0x10d6, 0x1079,
+	0x10f7, 0x0078, 0x10dc, 0x1078, 0x7197, 0x0078, 0x10eb, 0x1101,
+	0x1102, 0x11be, 0x10ff, 0x1246, 0x12dc, 0x12dd, 0x12de, 0x1078,
+	0x1332, 0x007c, 0x127e, 0x0f7e, 0x2091, 0x8000, 0x7000, 0xa086,
+	0x0001, 0x00c0, 0x1198, 0x1078, 0x3aec, 0x2079, 0x0100, 0x7844,
+	0xa005, 0x00c0, 0x1198, 0x2011, 0x41dc, 0x1078, 0x5a45, 0x1078,
+	0x1adf, 0x780f, 0x00ff, 0x7840, 0xa084, 0xfffb, 0x7842, 0x2011,
+	0x8010, 0x73c4, 0x1078, 0x361b, 0x2001, 0xffff, 0x1078, 0x5ae6,
+	0x723c, 0xc284, 0x723e, 0x2001, 0xa60c, 0x2014, 0xc2ac, 0x2202,
+	0x1078, 0x6f9f, 0x2011, 0x0004, 0x1078, 0x8d1b, 0x1078, 0x489e,
+	0x1078, 0x42d4, 0x0040, 0x1144, 0x7087, 0x0001, 0x70bf, 0x0000,
+	0x1078, 0x3c9e, 0x0078, 0x1198, 0x1078, 0x4967, 0x0040, 0x114d,
+	0x7a0c, 0xc2b4, 0x7a0e, 0x0078, 0x1159, 0x1078, 0x90a6, 0x70cc,
+	0xd09c, 0x00c0, 0x1159, 0x7098, 0xa005, 0x0040, 0x1159, 0x1078,
+	0x42b8, 0x70d7, 0x0000, 0x70d3, 0x0000, 0x72cc, 0x2079, 0xa652,
+	0x7804, 0xd0ac, 0x0040, 0x1165, 0xc295, 0x72ce, 0xa296, 0x0004,
+	0x0040, 0x1186, 0x2011, 0x0001, 0x1078, 0x8d1b, 0x7093, 0x0000,
+	0x7097, 0xffff, 0x7003, 0x0002, 0x0f7f, 0x1078, 0x2677, 0x2011,
+	0x0005, 0x1078, 0x70e0, 0x1078, 0x62d1, 0x0c7e, 0x2061, 0x0100,
+	0x60e3, 0x0008, 0x0c7f, 0x127f, 0x0078, 0x119a, 0x7093, 0x0000,
+	0x7097, 0xffff, 0x7003, 0x0002, 0x2011, 0x0005, 0x1078, 0x70e0,
+	0x1078, 0x62d1, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f,
+	0x0f7f, 0x127f, 0x007c, 0x0c7e, 0x20a9, 0x0082, 0x2009, 0x007e,
+	0x017e, 0x027e, 0x037e, 0x2110, 0x027e, 0x2019, 0x0029, 0x1078,
+	0x73d0, 0x027f, 0x1078, 0xa4f1, 0x037f, 0x027f, 0x017f, 0x1078,
+	0x298e, 0x8108, 0x00f0, 0x11a0, 0x0c7f, 0x706f, 0x0000, 0x7070,
+	0xa084, 0x00ff, 0x7072, 0x709b, 0x0000, 0x007c, 0x127e, 0x2091,
+	0x8000, 0x7000, 0xa086, 0x0002, 0x00c0, 0x1244, 0x7094, 0xa086,
+	0xffff, 0x0040, 0x11d1, 0x1078, 0x2677, 0x1078, 0x62d1, 0x0078,
+	0x1244, 0x70cc, 0xd09c, 0x0040, 0x11fd, 0xd084, 0x0040, 0x11fd,
+	0x0f7e, 0x2079, 0x0100, 0x790c, 0xc1b5, 0x790e, 0x0f7f, 0xd08c,
+	0x0040, 0x11fd, 0x70d0, 0xa086, 0xffff, 0x0040, 0x11f9, 0x1078,
+	0x27f7, 0x1078, 0x62d1, 0x70cc, 0xd094, 0x00c0, 0x1244, 0x2011,
+	0x0001, 0x2019, 0x0000, 0x1078, 0x282f, 0x1078, 0x62d1, 0x0078,
+	0x1244, 0x70d4, 0xa005, 0x00c0, 0x1244, 0x7090, 0xa005, 0x00c0,
+	0x1244, 0x1078, 0x4967, 0x00c0, 0x1244, 0x2001, 0xa653, 0x2004,
+	0xd0ac, 0x0040, 0x1227, 0x157e, 0x0c7e, 0x20a9, 0x007f, 0x2009,
+	0x0000, 0x017e, 0x1078, 0x45c4, 0x00c0, 0x121a, 0x6000, 0xd0ec,
+	0x00c0, 0x1222, 0x017f, 0x8108, 0x00f0, 0x1211, 0x0c7f, 0x157f,
+	0x0078, 0x1227, 0x017f, 0x0c7f, 0x157f, 0x0078, 0x1244, 0x7003,
+	0x0003, 0x7097, 0xffff, 0x2001, 0x0000, 0x1078, 0x24e8, 0x1078,
+	0x3699, 0x2001, 0xa8b2, 0x2004, 0xa086, 0x0005, 0x00c0, 0x123c,
+	0x2011, 0x0000, 0x1078, 0x70e0, 0x2011, 0x0000, 0x1078, 0x70ea,
+	0x1078, 0x62d1, 0x1078, 0x639b, 0x127f, 0x007c, 0x017e, 0x0f7e,
+	0x127e, 0x2091, 0x8000, 0x2079, 0x0100, 0x2009, 0x00f7, 0x1078,
+	0x42a1, 0x7940, 0xa18c, 0x0010, 0x7942, 0x7924, 0xd1b4, 0x0040,
+	0x125b, 0x7827, 0x0040, 0xd19c, 0x0040, 0x1260, 0x7827, 0x0008,
+	0x007e, 0x037e, 0x157e, 0xa006, 0x1078, 0x5ae6, 0x7900, 0xa18a,
+	0x0003, 0x0050, 0x1289, 0x7954, 0xd1ac, 0x00c0, 0x1289, 0x2009,
+	0x00f8, 0x1078, 0x42a1, 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9,
+	0x09c4, 0x7820, 0xd09c, 0x00c0, 0x1281, 0x7824, 0xd0ac, 0x00c0,
+	0x12ca, 0x00f0, 0x1279, 0x2001, 0x0001, 0x1078, 0x24e8, 0x0078,
+	0x12d5, 0x7853, 0x0000, 0x782f, 0x0020, 0x20a9, 0x0050, 0x00e0,
+	0x128f, 0x2091, 0x6000, 0x00f0, 0x128f, 0x7853, 0x0400, 0x782f,
+	0x0000, 0x2009, 0x00f8, 0x1078, 0x42a1, 0x20a9, 0x000e, 0x0005,
+	0x00f0, 0x129f, 0x7853, 0x1400, 0x7843, 0x0090, 0x7843, 0x0010,
+	0x2019, 0x61a8, 0x7854, 0x0005, 0x0005, 0xd08c, 0x0040, 0x12b4,
+	0x7824, 0xd0ac, 0x00c0, 0x12ca, 0x8319, 0x00c0, 0x12aa, 0x2009,
+	0xa632, 0x2104, 0x8000, 0x200a, 0xa084, 0xfff0, 0x0040, 0x12c4,
+	0x200b, 0x0000, 0x1078, 0x2588, 0x2001, 0x0001, 0x1078, 0x24e8,
+	0x0078, 0x12d3, 0x2001, 0xa632, 0x2003, 0x0000, 0x7828, 0xc09d,
+	0x782a, 0x7827, 0x0048, 0x7853, 0x0400, 0x157f, 0x037f, 0x007f,
+	0x127f, 0x0f7f, 0x017f, 0x007c, 0x007c, 0x007c, 0x007c, 0x2a70,
+	0x2061, 0xa8ad, 0x2063, 0x0001, 0x6007, 0x0013, 0x600b, 0x0018,
+	0x600f, 0x0017, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
+	0x12f5, 0x7053, 0xffff, 0x0078, 0x12f7, 0x7053, 0x0000, 0x7057,
+	0xffff, 0x706f, 0x0000, 0x7073, 0x0000, 0x1078, 0x90a6, 0x2061,
+	0xa88d, 0x6003, 0x0909, 0x6007, 0x0000, 0x600b, 0x8800, 0x600f,
+	0x0200, 0x6013, 0x00ff, 0x6017, 0x0003, 0x601b, 0x0000, 0x601f,
+	0x07d0, 0x2061, 0xa895, 0x6003, 0x8000, 0x6007, 0x0000, 0x600b,
+	0x0000, 0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0000, 0x601b,
+	0x0001, 0x601f, 0x0000, 0x2061, 0xa8a5, 0x6003, 0x514c, 0x6007,
+	0x4f47, 0x600b, 0x4943, 0x600f, 0x2020, 0x2001, 0xa626, 0x2003,
+	0x0000, 0x007c, 0x2091, 0x8000, 0x0068, 0x1334, 0x007e, 0x017e,
+	0x2079, 0x0000, 0x7818, 0xd084, 0x00c0, 0x133a, 0x017f, 0x792e,
+	0x007f, 0x782a, 0x007f, 0x7826, 0x3900, 0x783a, 0x7823, 0x8002,
+	0x781b, 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2079, 0xa600,
+	0x7803, 0x0005, 0x0078, 0x1352, 0x007c, 0x2071, 0xa600, 0x715c,
+	0x712e, 0x2021, 0x0001, 0xa190, 0x002d, 0xa298, 0x002d, 0x0048,
+	0x136b, 0x7060, 0xa302, 0x00c8, 0x136b, 0x220a, 0x2208, 0x2310,
+	0x8420, 0x0078, 0x135d, 0x200b, 0x0000, 0x74aa, 0x74ae, 0x007c,
+	0x0e7e, 0x127e, 0x2091, 0x8000, 0x2071, 0xa600, 0x70ac, 0xa0ea,
+	0x0010, 0x00c8, 0x137e, 0xa06e, 0x0078, 0x1388, 0x8001, 0x70ae,
+	0x702c, 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000,
+	0x127f, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0xa600, 0x127e, 0x2091,
+	0x8000, 0x70ac, 0x8001, 0x00c8, 0x1398, 0xa06e, 0x0078, 0x13a1,
+	0x70ae, 0x702c, 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807,
+	0x0000, 0x127f, 0x0e7f, 0x007c, 0x0e7e, 0x127e, 0x2091, 0x8000,
+	0x2071, 0xa600, 0x702c, 0x206a, 0x2d00, 0x702e, 0x70ac, 0x8000,
+	0x70ae, 0x127f, 0x0e7f, 0x007c, 0x8dff, 0x0040, 0x13c0, 0x6804,
+	0x6807, 0x0000, 0x007e, 0x1078, 0x13a4, 0x0d7f, 0x0078, 0x13b4,
+	0x007c, 0x0e7e, 0x2071, 0xa600, 0x70ac, 0xa08a, 0x0010, 0xa00d,
+	0x0e7f, 0x007c, 0x0e7e, 0x2071, 0xa8d6, 0x7007, 0x0000, 0x701b,
+	0x0000, 0x701f, 0x0000, 0x2071, 0x0000, 0x7010, 0xa085, 0x8004,
+	0x7012, 0x0e7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x0e7e, 0x2270,
+	0x700b, 0x0000, 0x2071, 0xa8d6, 0x7018, 0xa088, 0xa8df, 0x220a,
+	0x8000, 0xa084, 0x0007, 0x701a, 0x7004, 0xa005, 0x00c0, 0x13f6,
+	0x0f7e, 0x2079, 0x0010, 0x1078, 0x1408, 0x0f7f, 0x0e7f, 0x127f,
+	0x007c, 0x0e7e, 0x2071, 0xa8d6, 0x7004, 0xa005, 0x00c0, 0x1406,
+	0x0f7e, 0x2079, 0x0010, 0x1078, 0x1408, 0x0f7f, 0x0e7f, 0x007c,
+	0x7000, 0x0079, 0x140b, 0x140f, 0x1479, 0x1496, 0x1496, 0x7018,
+	0x711c, 0xa106, 0x00c0, 0x1417, 0x7007, 0x0000, 0x007c, 0x0d7e,
+	0xa180, 0xa8df, 0x2004, 0x700a, 0x2068, 0x8108, 0xa18c, 0x0007,
+	0x711e, 0x7803, 0x0026, 0x6824, 0x7832, 0x6828, 0x7836, 0x682c,
+	0x783a, 0x6830, 0x783e, 0x6810, 0x700e, 0x680c, 0x7016, 0x6804,
+	0x0d7f, 0xd084, 0x0040, 0x1439, 0x7007, 0x0001, 0x1078, 0x143e,
+	0x007c, 0x7007, 0x0002, 0x1078, 0x1454, 0x007c, 0x017e, 0x027e,
+	0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x1449, 0x2110,
+	0xa006, 0x700e, 0x7212, 0x8203, 0x7822, 0x7803, 0x0020, 0x7803,
+	0x0041, 0x027f, 0x017f, 0x007c, 0x017e, 0x027e, 0x137e, 0x147e,
+	0x157e, 0x7014, 0x2098, 0x20a1, 0x0014, 0x7803, 0x0026, 0x710c,
+	0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x1468, 0x2110, 0xa006,
+	0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822, 0x7803, 0x0020, 0x3300,
+	0x7016, 0x7803, 0x0001, 0x157f, 0x147f, 0x137f, 0x027f, 0x017f,
+	0x007c, 0x137e, 0x147e, 0x157e, 0x2099, 0xa6fa, 0x20a1, 0x0018,
+	0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091, 0x8000,
+	0x7803, 0x0041, 0x7007, 0x0003, 0x7000, 0xc084, 0x7002, 0x700b,
+	0xa6f5, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x137e, 0x147e,
+	0x157e, 0x2001, 0xa729, 0x209c, 0x20a1, 0x0014, 0x7803, 0x0026,
+	0x2001, 0xa72a, 0x20ac, 0x53a6, 0x2099, 0xa72b, 0x20a1, 0x0018,
+	0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091, 0x8000,
+	0x7803, 0x0001, 0x7007, 0x0004, 0x7000, 0xc08c, 0x7002, 0x700b,
+	0xa726, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x017e, 0x0e7e,
+	0x2071, 0xa8d6, 0x0f7e, 0x2079, 0x0010, 0x7904, 0x7803, 0x0002,
+	0xd1fc, 0x0040, 0x14d0, 0xa18c, 0x0700, 0x7004, 0x1079, 0x14d4,
+	0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x1408, 0x14dc, 0x1509, 0x1531,
+	0x1564, 0x14da, 0x0078, 0x14da, 0xa18c, 0x0700, 0x00c0, 0x1502,
+	0x137e, 0x147e, 0x157e, 0x7014, 0x20a0, 0x2099, 0x0014, 0x7803,
+	0x0040, 0x7010, 0x20a8, 0x53a5, 0x3400, 0x7016, 0x157f, 0x147f,
+	0x137f, 0x700c, 0xa005, 0x0040, 0x151e, 0x1078, 0x143e, 0x007c,
+	0x7008, 0xa080, 0x0002, 0x2003, 0x0100, 0x7007, 0x0000, 0x1078,
+	0x1408, 0x007c, 0x7008, 0xa080, 0x0002, 0x2003, 0x0200, 0x0078,
+	0x14fd, 0xa18c, 0x0700, 0x00c0, 0x1514, 0x700c, 0xa005, 0x0040,
+	0x151e, 0x1078, 0x1454, 0x007c, 0x7008, 0xa080, 0x0002, 0x2003,
+	0x0200, 0x7007, 0x0000, 0x1078, 0x1408, 0x007c, 0x0d7e, 0x7008,
+	0x2068, 0x7830, 0x6826, 0x7834, 0x682a, 0x7838, 0x682e, 0x783c,
+	0x6832, 0x680b, 0x0100, 0x0d7f, 0x7007, 0x0000, 0x1078, 0x1408,
+	0x007c, 0xa18c, 0x0700, 0x00c0, 0x155e, 0x137e, 0x147e, 0x157e,
+	0x2001, 0xa6f8, 0x2004, 0xa080, 0x000d, 0x20a0, 0x2099, 0x0014,
+	0x7803, 0x0040, 0x20a9, 0x0020, 0x53a5, 0x2001, 0xa6fa, 0x2004,
+	0xd0bc, 0x0040, 0x1554, 0x2001, 0xa703, 0x2004, 0xa080, 0x000d,
+	0x20a0, 0x20a9, 0x0020, 0x53a5, 0x157f, 0x147f, 0x137f, 0x7007,
+	0x0000, 0x1078, 0x4f8c, 0x1078, 0x1408, 0x007c, 0x2011, 0x8003,
+	0x1078, 0x361b, 0x0078, 0x1562, 0xa18c, 0x0700, 0x00c0, 0x1571,
+	0x2001, 0xa728, 0x2003, 0x0100, 0x7007, 0x0000, 0x1078, 0x1408,
+	0x007c, 0x2011, 0x8004, 0x1078, 0x361b, 0x0078, 0x1575, 0x127e,
+	0x2091, 0x2100, 0x2079, 0x0030, 0x2071, 0xa8e7, 0x7803, 0x0004,
+	0x7003, 0x0000, 0x700f, 0xa8ed, 0x7013, 0xa8ed, 0x780f, 0x0076,
+	0x7803, 0x0004, 0x127f, 0x007c, 0x6934, 0xa184, 0x0007, 0x0079,
+	0x1591, 0x1599, 0x15df, 0x1599, 0x1599, 0x1599, 0x15c4, 0x15a8,
+	0x159d, 0xa085, 0x0001, 0x0078, 0x15f9, 0x684c, 0xd0bc, 0x0040,
+	0x1599, 0x6860, 0x682e, 0x685c, 0x682a, 0x6858, 0x0078, 0x15e7,
+	0xa18c, 0x00ff, 0xa186, 0x001e, 0x00c0, 0x1599, 0x684c, 0xd0bc,
+	0x0040, 0x1599, 0x6860, 0x682e, 0x685c, 0x682a, 0x6804, 0x681a,
+	0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x206a, 0x2004,
+	0x6832, 0x6858, 0x0078, 0x15ef, 0xa18c, 0x00ff, 0xa186, 0x0015,
+	0x00c0, 0x1599, 0x684c, 0xd0ac, 0x0040, 0x1599, 0x6804, 0x681a,
+	0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x206a, 0x2004,
+	0x6832, 0xa006, 0x682e, 0x682a, 0x6858, 0x0078, 0x15ef, 0x684c,
+	0xd0ac, 0x0040, 0x1599, 0xa006, 0x682e, 0x682a, 0x6858, 0xa18c,
+	0x000f, 0xa188, 0x206a, 0x210c, 0x6932, 0x2d08, 0x691a, 0x6826,
+	0x684c, 0xc0dd, 0x684e, 0xa006, 0x680a, 0x697c, 0x6912, 0x6980,
+	0x6916, 0x007c, 0x20e1, 0x0007, 0x20e1, 0x2000, 0x2001, 0x020a,
+	0x2004, 0x82ff, 0x0040, 0x161c, 0xa280, 0x0004, 0x0d7e, 0x206c,
+	0x684c, 0xd0dc, 0x00c0, 0x1618, 0x1078, 0x158c, 0x0040, 0x1618,
+	0x0d7f, 0xa280, 0x0000, 0x2003, 0x0002, 0xa016, 0x0078, 0x161c,
+	0x6808, 0x8000, 0x680a, 0x0d7f, 0x127e, 0x047e, 0x037e, 0x027e,
+	0x2091, 0x2100, 0x027f, 0x037f, 0x047f, 0x7000, 0xa005, 0x00c0,
+	0x1630, 0x7206, 0x2001, 0x1651, 0x007e, 0x2260, 0x0078, 0x17e0,
+	0x710c, 0x220a, 0x8108, 0x230a, 0x8108, 0x240a, 0x8108, 0xa182,
+	0xa908, 0x0048, 0x163d, 0x2009, 0xa8ed, 0x710e, 0x7010, 0xa102,
+	0xa082, 0x0009, 0x0040, 0x1648, 0xa080, 0x001b, 0x00c0, 0x164b,
+	0x2009, 0x0138, 0x200a, 0x7000, 0xa005, 0x00c0, 0x1651, 0x1078,
+	0x17c1, 0x127f, 0x007c, 0x127e, 0x027e, 0x037e, 0x0c7e, 0x007e,
+	0x2091, 0x2100, 0x007f, 0x047f, 0x037f, 0x027f, 0x0d7e, 0x0c7e,
+	0x2460, 0x6110, 0x2168, 0x6a62, 0x6b5e, 0xa005, 0x0040, 0x16dd,
+	0x6808, 0xa005, 0x0040, 0x174a, 0x7000, 0xa005, 0x00c0, 0x1672,
+	0x0078, 0x16d2, 0x700c, 0x7110, 0xa106, 0x00c0, 0x1753, 0x7004,
+	0xa406, 0x00c0, 0x16d2, 0x2001, 0x0005, 0x2004, 0xd08c, 0x0040,
+	0x168f, 0x047e, 0x1078, 0x1913, 0x047f, 0x2460, 0x6010, 0xa080,
+	0x0002, 0x2004, 0xa005, 0x0040, 0x174a, 0x0078, 0x166c, 0x2001,
+	0x0207, 0x2004, 0xd09c, 0x00c0, 0x167b, 0x7804, 0xa084, 0x6000,
+	0x0040, 0x16a0, 0xa086, 0x6000, 0x0040, 0x16a0, 0x0078, 0x167b,
+	0x7100, 0xa186, 0x0002, 0x00c0, 0x16c0, 0x0e7e, 0x2b68, 0x6818,
+	0x2060, 0x1078, 0x203f, 0x2804, 0xac70, 0x6034, 0xd09c, 0x00c0,
+	0x16b5, 0x7108, 0x720c, 0x0078, 0x16b7, 0x7110, 0x7214, 0x6810,
+	0xa100, 0x6812, 0x6814, 0xa201, 0x6816, 0x0e7f, 0x0078, 0x16c4,
+	0xa186, 0x0001, 0x00c0, 0x16cc, 0x7820, 0x6910, 0xa100, 0x6812,
+	0x7824, 0x6914, 0xa101, 0x6816, 0x7803, 0x0004, 0x7003, 0x0000,
+	0x7004, 0x2060, 0x6100, 0xa18e, 0x0004, 0x00c0, 0x1753, 0x2009,
+	0x0048, 0x1078, 0x775c, 0x0078, 0x1753, 0x6808, 0xa005, 0x0040,
+	0x174a, 0x7000, 0xa005, 0x00c0, 0x16e7, 0x0078, 0x174a, 0x700c,
+	0x7110, 0xa106, 0x00c0, 0x16f0, 0x7004, 0xa406, 0x00c0, 0x174a,
+	0x2001, 0x0005, 0x2004, 0xd08c, 0x0040, 0x1704, 0x047e, 0x1078,
+	0x1913, 0x047f, 0x2460, 0x6010, 0xa080, 0x0002, 0x2004, 0xa005,
+	0x0040, 0x174a, 0x0078, 0x16e1, 0x2001, 0x0207, 0x2004, 0xd09c,
+	0x00c0, 0x16f0, 0x2001, 0x0005, 0x2004, 0xd08c, 0x00c0, 0x16f6,
+	0x7804, 0xa084, 0x6000, 0x0040, 0x171b, 0xa086, 0x6000, 0x0040,
+	0x171b, 0x0078, 0x16f0, 0x7007, 0x0000, 0xa016, 0x2218, 0x7000,
+	0xa08e, 0x0001, 0x0040, 0x173c, 0xa08e, 0x0002, 0x00c0, 0x174a,
+	0x0c7e, 0x0e7e, 0x6818, 0x2060, 0x1078, 0x203f, 0x2804, 0xac70,
+	0x6034, 0xd09c, 0x00c0, 0x1738, 0x7308, 0x720c, 0x0078, 0x173a,
+	0x7310, 0x7214, 0x0e7f, 0x0c7f, 0x7820, 0xa318, 0x7824, 0xa211,
+	0x6810, 0xa300, 0x6812, 0x6814, 0xa201, 0x6816, 0x7803, 0x0004,
+	0x7003, 0x0000, 0x6100, 0xa18e, 0x0004, 0x00c0, 0x1753, 0x2009,
+	0x0048, 0x1078, 0x775c, 0x0c7f, 0x0d7f, 0x127f, 0x007c, 0x0f7e,
+	0x0e7e, 0x027e, 0x037e, 0x047e, 0x057e, 0x2071, 0xa8e7, 0x7000,
+	0xa086, 0x0000, 0x0040, 0x17ba, 0x7004, 0xac06, 0x00c0, 0x17ab,
+	0x2079, 0x0030, 0x7000, 0xa086, 0x0003, 0x0040, 0x17ab, 0x7804,
+	0xd0fc, 0x00c0, 0x17a7, 0x20e1, 0x6000, 0x2011, 0x0032, 0x2001,
+	0x0208, 0x200c, 0x2001, 0x0209, 0x2004, 0xa106, 0x00c0, 0x176f,
+	0x8211, 0x00c0, 0x1777, 0x7804, 0xd0fc, 0x00c0, 0x17a7, 0x1078,
+	0x1b22, 0x027e, 0x057e, 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0,
+	0x178d, 0x7803, 0x0002, 0x7803, 0x0009, 0x7003, 0x0003, 0x7007,
+	0x0000, 0x057f, 0x027f, 0x2001, 0x015d, 0x2003, 0x0000, 0x2001,
+	0x0160, 0x2502, 0x2001, 0x0138, 0x2202, 0x0078, 0x17ab, 0x1078,
+	0x1913, 0x0078, 0x175f, 0x157e, 0x20a9, 0x0009, 0x2009, 0xa8ed,
+	0x2104, 0xac06, 0x00c0, 0x17b5, 0x200a, 0xa188, 0x0003, 0x00f0,
+	0x17b0, 0x157f, 0x057f, 0x047f, 0x037f, 0x027f, 0x0e7f, 0x0f7f,
+	0x007c, 0x700c, 0x7110, 0xa106, 0x00c0, 0x17c9, 0x7003, 0x0000,
+	0x007c, 0x2104, 0x7006, 0x2060, 0x8108, 0x211c, 0x8108, 0x2124,
+	0x8108, 0xa182, 0xa908, 0x0048, 0x17d7, 0x2009, 0xa8ed, 0x7112,
+	0x700c, 0xa106, 0x00c0, 0x17e0, 0x2001, 0x0138, 0x2003, 0x0008,
+	0x8cff, 0x00c0, 0x17e7, 0x1078, 0x1b4d, 0x0078, 0x1854, 0x6010,
+	0x2068, 0x2d58, 0x6828, 0xa406, 0x00c0, 0x17f2, 0x682c, 0xa306,
+	0x0040, 0x182f, 0x601c, 0xa086, 0x0008, 0x0040, 0x182f, 0x6024,
+	0xd0f4, 0x00c0, 0x181c, 0xd0d4, 0x0040, 0x1818, 0x6038, 0xa402,
+	0x6034, 0xa303, 0x0040, 0x1806, 0x00c8, 0x1818, 0x643a, 0x6336,
+	0x6c2a, 0x6b2e, 0x047e, 0x037e, 0x2400, 0x6c7c, 0xa402, 0x6812,
+	0x2300, 0x6b80, 0xa303, 0x6816, 0x037f, 0x047f, 0x0078, 0x181c,
+	0x1078, 0x9053, 0x0040, 0x17e3, 0x2001, 0xa674, 0x2004, 0xd0b4,
+	0x00c0, 0x182b, 0x6018, 0x2004, 0xd0bc, 0x00c0, 0x182b, 0x6817,
+	0x7fff, 0x6813, 0xffff, 0x1078, 0x208a, 0x00c0, 0x17e3, 0x0c7e,
+	0x7004, 0x2060, 0x6024, 0xc0d4, 0x6026, 0x0c7f, 0x684c, 0xd0f4,
+	0x0040, 0x1840, 0x6817, 0xffff, 0x6813, 0xffff, 0x0078, 0x17e3,
+	0x6824, 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc,
+	0x000f, 0x2009, 0x0011, 0x1078, 0x1855, 0x0040, 0x1853, 0x2009,
+	0x0001, 0x1078, 0x1855, 0x2d58, 0x007c, 0x8aff, 0x0040, 0x18ec,
+	0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x1877, 0xd0f4, 0x00c0,
+	0x1887, 0x0d7e, 0x2804, 0xac68, 0x2900, 0x0079, 0x1867, 0x18ce,
+	0x188e, 0x188e, 0x18ce, 0x18ce, 0x18c6, 0x18ce, 0x188e, 0x18ce,
+	0x1894, 0x1894, 0x18ce, 0x18ce, 0x18ce, 0x18bd, 0x1894, 0xc0fc,
+	0x6852, 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0x0d7e, 0xd99c, 0x0040,
+	0x18d1, 0x2804, 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x18d1, 0xc0f4,
+	0x6852, 0x6b6c, 0x6a70, 0x0d7e, 0x0078, 0x18d8, 0x6b08, 0x6a0c,
+	0x6d00, 0x6c04, 0x0078, 0x18d1, 0x7b0c, 0xd3bc, 0x0040, 0x18b5,
+	0x7004, 0x0e7e, 0x2070, 0x701c, 0x0e7f, 0xa086, 0x0008, 0x00c0,
+	0x18b5, 0x7b08, 0xa39c, 0x0fff, 0x2d20, 0x0d7f, 0x0d7e, 0x6a14,
+	0x82ff, 0x00c0, 0x18b0, 0x6810, 0xa302, 0x0048, 0x18b0, 0x6b10,
+	0x2011, 0x0000, 0x2468, 0x0078, 0x18b7, 0x6b10, 0x6a14, 0x6d00,
+	0x6c04, 0x6f08, 0x6e0c, 0x0078, 0x18d1, 0x0d7f, 0x0d7e, 0x6834,
+	0xa084, 0x00ff, 0xa086, 0x001e, 0x00c0, 0x18ce, 0x0d7f, 0x1078,
+	0x2026, 0x00c0, 0x1855, 0xa00e, 0x0078, 0x18ec, 0x0d7f, 0x1078,
+	0x1332, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902,
+	0x7000, 0x8000, 0x7002, 0x0d7f, 0x6828, 0xa300, 0x682a, 0x682c,
+	0xa201, 0x682e, 0x2300, 0x6b10, 0xa302, 0x6812, 0x2200, 0x6a14,
+	0xa203, 0x6816, 0x1078, 0x2026, 0x007c, 0x1078, 0x1332, 0x1078,
+	0x1c97, 0x7004, 0x2060, 0x0d7e, 0x6010, 0x2068, 0x7003, 0x0000,
+	0x1078, 0x1af4, 0x1078, 0x8d06, 0x0040, 0x190c, 0x6808, 0x8001,
+	0x680a, 0x697c, 0x6912, 0x6980, 0x6916, 0x682b, 0xffff, 0x682f,
+	0xffff, 0x6850, 0xc0bd, 0x6852, 0x0d7f, 0x1078, 0x8a01, 0x0078,
+	0x1adb, 0x1078, 0x1332, 0x127e, 0x2091, 0x2100, 0x007e, 0x017e,
+	0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, 0x0002, 0xa184, 0x0700,
+	0x00c0, 0x18ef, 0xa184, 0x0003, 0xa086, 0x0003, 0x0040, 0x1911,
+	0x7000, 0x0079, 0x192b, 0x1933, 0x1935, 0x1a34, 0x1ab2, 0x1ac9,
+	0x1933, 0x1933, 0x1933, 0x1078, 0x1332, 0x8001, 0x7002, 0xa184,
+	0x0880, 0x00c0, 0x194a, 0x8aff, 0x0040, 0x19d4, 0x2009, 0x0001,
+	0x1078, 0x1855, 0x0040, 0x1adb, 0x2009, 0x0001, 0x1078, 0x1855,
+	0x0078, 0x1adb, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1bc, 0x00c0,
+	0x19b2, 0x027e, 0x037e, 0x017e, 0x7808, 0xd0ec, 0x00c0, 0x1962,
+	0x7c20, 0x7d24, 0x7e30, 0x7f34, 0x7803, 0x0009, 0x7003, 0x0004,
+	0x0078, 0x1964, 0x1078, 0x1bd7, 0x017f, 0xd194, 0x0040, 0x196b,
+	0x8aff, 0x0040, 0x19a1, 0x6b28, 0x6a2c, 0x2400, 0x686e, 0xa31a,
+	0x2500, 0x6872, 0xa213, 0x6b2a, 0x6a2e, 0x0c7e, 0x7004, 0x2060,
+	0x6024, 0xd0f4, 0x00c0, 0x197e, 0x633a, 0x6236, 0x0c7f, 0x2400,
+	0x6910, 0xa100, 0x6812, 0x2500, 0x6914, 0xa101, 0x6816, 0x037f,
+	0x027f, 0x2600, 0x681e, 0x2700, 0x6822, 0x1078, 0x203f, 0x2a00,
+	0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x6850, 0xc0fd, 0x6852,
+	0x6808, 0x8001, 0x680a, 0x00c0, 0x19a7, 0x684c, 0xd0e4, 0x0040,
+	0x19a7, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x775c, 0x7000,
+	0xa086, 0x0004, 0x0040, 0x1adb, 0x7003, 0x0000, 0x1078, 0x17c1,
+	0x0078, 0x1adb, 0x057e, 0x7d0c, 0xd5bc, 0x00c0, 0x19b9, 0x1078,
+	0xa57e, 0x057f, 0x1078, 0x1af4, 0x0f7e, 0x7004, 0x2078, 0x1078,
+	0x4963, 0x0040, 0x19c6, 0x7824, 0xc0f5, 0x7826, 0x0f7f, 0x682b,
+	0xffff, 0x682f, 0xffff, 0x6808, 0x8001, 0x680a, 0x697c, 0x6912,
+	0x6980, 0x6916, 0x0078, 0x1adb, 0x7004, 0x0c7e, 0x2060, 0x6024,
+	0x0c7f, 0xd0f4, 0x0040, 0x19e1, 0x6808, 0x8001, 0x680a, 0x0078,
+	0x19f5, 0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005, 0x00c0, 0x19f9,
+	0x7003, 0x0000, 0x6808, 0x8001, 0x680a, 0x00c0, 0x19f5, 0x7004,
+	0x2060, 0x2009, 0x0048, 0x1078, 0x775c, 0x1078, 0x17c1, 0x0078,
+	0x1adb, 0x7814, 0x6910, 0xa102, 0x6812, 0x6914, 0xa183, 0x0000,
+	0x6816, 0x7814, 0x7908, 0xa18c, 0x0fff, 0xa192, 0x0841, 0x00c8,
+	0x18ef, 0xa188, 0x0007, 0x8114, 0x8214, 0x8214, 0xa10a, 0x8104,
+	0x8004, 0x8004, 0xa20a, 0x810b, 0x810b, 0x810b, 0x1078, 0x1b5e,
+	0x7803, 0x0004, 0x780f, 0xffff, 0x7803, 0x0001, 0x7804, 0xd0fc,
+	0x0040, 0x1a1e, 0x7803, 0x0002, 0x7803, 0x0004, 0x780f, 0x0076,
+	0x7004, 0x7007, 0x0000, 0x2060, 0x2009, 0x0048, 0x1078, 0x775c,
+	0x1078, 0x1b92, 0x0040, 0x19f5, 0x8001, 0x7002, 0xd194, 0x0040,
+	0x1a46, 0x7804, 0xd0fc, 0x00c0, 0x191b, 0x8aff, 0x0040, 0x1adb,
+	0x2009, 0x0001, 0x1078, 0x1855, 0x0078, 0x1adb, 0xa184, 0x0880,
+	0x00c0, 0x1a53, 0x8aff, 0x0040, 0x1adb, 0x2009, 0x0001, 0x1078,
+	0x1855, 0x0078, 0x1adb, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1bc,
+	0x00c0, 0x1a93, 0x027e, 0x037e, 0x7808, 0xd0ec, 0x00c0, 0x1a66,
+	0x7803, 0x0009, 0x7003, 0x0004, 0x0078, 0x1a68, 0x1078, 0x1bd7,
+	0x6b28, 0x6a2c, 0x1078, 0x203f, 0x0d7e, 0x0f7e, 0x2d78, 0x2804,
+	0xac68, 0x6034, 0xd09c, 0x00c0, 0x1a83, 0x6808, 0x2008, 0xa31a,
+	0x680c, 0xa213, 0x7810, 0xa100, 0x7812, 0x690c, 0x7814, 0xa101,
+	0x7816, 0x0078, 0x1a8f, 0x6810, 0x2008, 0xa31a, 0x6814, 0xa213,
+	0x7810, 0xa100, 0x7812, 0x6914, 0x7814, 0xa101, 0x7816, 0x0f7f,
+	0x0d7f, 0x0078, 0x196d, 0x057e, 0x7d0c, 0x1078, 0xa57e, 0x057f,
+	0x1078, 0x1af4, 0x0f7e, 0x7004, 0x2078, 0x1078, 0x4963, 0x0040,
+	0x1aa4, 0x7824, 0xc0f5, 0x7826, 0x0f7f, 0x682b, 0xffff, 0x682f,
+	0xffff, 0x6808, 0x8001, 0x680a, 0x697c, 0x6912, 0x6980, 0x6916,
+	0x0078, 0x1adb, 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, 0xa00d,
+	0x0040, 0x1ac5, 0x6808, 0x8001, 0x680a, 0x00c0, 0x1ac5, 0x7004,
+	0x2060, 0x2009, 0x0048, 0x1078, 0x775c, 0x1078, 0x17c1, 0x0078,
+	0x1adb, 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, 0x2060, 0x6010,
+	0xa005, 0x0040, 0x1ac5, 0x2068, 0x6808, 0x8000, 0x680a, 0x6c28,
+	0x6b2c, 0x1078, 0x17e0, 0x017f, 0x007f, 0x127f, 0x007c, 0x127e,
+	0x2091, 0x2100, 0x7000, 0xa086, 0x0003, 0x00c0, 0x1af2, 0x700c,
+	0x7110, 0xa106, 0x0040, 0x1af2, 0x20e1, 0x9028, 0x700f, 0xa8ed,
+	0x7013, 0xa8ed, 0x127f, 0x007c, 0x0c7e, 0x1078, 0x1b22, 0x20e1,
+	0x9028, 0x700c, 0x7110, 0xa106, 0x0040, 0x1b19, 0x2104, 0xa005,
+	0x0040, 0x1b08, 0x2060, 0x6010, 0x2060, 0x6008, 0x8001, 0x600a,
+	0xa188, 0x0003, 0xa182, 0xa908, 0x0048, 0x1b10, 0x2009, 0xa8ed,
+	0x7112, 0x700c, 0xa106, 0x00c0, 0x1af9, 0x2011, 0x0008, 0x0078,
+	0x1af9, 0x2001, 0x015d, 0x2003, 0x0000, 0x2001, 0x0138, 0x2202,
+	0x0c7f, 0x007c, 0x2001, 0x0138, 0x2014, 0x2003, 0x0000, 0x2021,
+	0xb015, 0x2001, 0x0141, 0x201c, 0xd3dc, 0x00c0, 0x1b3f, 0x2001,
+	0x0109, 0x201c, 0xa39c, 0x0048, 0x00c0, 0x1b3f, 0x2001, 0x0111,
+	0x201c, 0x83ff, 0x00c0, 0x1b3f, 0x8421, 0x00c0, 0x1b29, 0x007c,
+	0x2011, 0x0201, 0x2009, 0x003c, 0x2204, 0xa005, 0x00c0, 0x1b4c,
+	0x8109, 0x00c0, 0x1b44, 0x007c, 0x007c, 0x1078, 0x1b40, 0x0040,
+	0x1b55, 0x780c, 0xd0a4, 0x0040, 0x1b5b, 0x1078, 0x1af4, 0xa085,
+	0x0001, 0x0078, 0x1b5d, 0x1078, 0x1b92, 0x007c, 0x0e7e, 0x2071,
+	0x0200, 0x7808, 0xa084, 0xf000, 0xa10d, 0x1078, 0x1b22, 0x2019,
+	0x5000, 0x8319, 0x0040, 0x1b7c, 0x2001, 0xa908, 0x2004, 0xa086,
+	0x0000, 0x0040, 0x1b7c, 0x2001, 0x0021, 0xd0fc, 0x0040, 0x1b69,
+	0x1078, 0x1eaa, 0x0078, 0x1b67, 0x20e1, 0x7000, 0x7324, 0x7420,
+	0x7028, 0x7028, 0x7426, 0x7037, 0x0001, 0x810f, 0x712e, 0x702f,
+	0x0100, 0x7037, 0x0008, 0x7326, 0x7422, 0x2001, 0x0138, 0x2202,
+	0x0e7f, 0x007c, 0x027e, 0x2001, 0x015d, 0x2001, 0x0000, 0x7908,
+	0xa18c, 0x0fff, 0xa182, 0x0ffd, 0x0048, 0x1ba0, 0x2009, 0x0000,
+	0xa190, 0x0007, 0xa294, 0x1ff8, 0x8214, 0x8214, 0x8214, 0x2001,
+	0x020a, 0x82ff, 0x0040, 0x1bb5, 0x20e1, 0x6000, 0x200c, 0x200c,
+	0x200c, 0x200c, 0x8211, 0x00c0, 0x1bae, 0x20e1, 0x7000, 0x200c,
+	0x200c, 0x7003, 0x0000, 0x20e1, 0x6000, 0x2001, 0x0208, 0x200c,
+	0x2001, 0x0209, 0x2004, 0xa106, 0x0040, 0x1bd4, 0x1078, 0x1b40,
+	0x0040, 0x1bd2, 0x7908, 0xd1ec, 0x00c0, 0x1bd4, 0x790c, 0xd1a4,
+	0x0040, 0x1b97, 0x1078, 0x1af4, 0xa006, 0x027f, 0x007c, 0x7c20,
+	0x7d24, 0x7e30, 0x7f34, 0x700c, 0x7110, 0xa106, 0x0040, 0x1c69,
+	0x7004, 0x017e, 0x210c, 0xa106, 0x017f, 0x0040, 0x1c69, 0x0d7e,
+	0x0c7e, 0x216c, 0x2d00, 0xa005, 0x0040, 0x1c67, 0x681c, 0xa086,
+	0x0008, 0x0040, 0x1c67, 0x6824, 0xd0d4, 0x00c0, 0x1c67, 0x6810,
+	0x2068, 0x6850, 0xd0fc, 0x0040, 0x1c29, 0x8108, 0x2104, 0x6b2c,
+	0xa306, 0x00c0, 0x1c67, 0x8108, 0x2104, 0x6a28, 0xa206, 0x00c0,
+	0x1c67, 0x6850, 0xc0fc, 0xc0f5, 0x6852, 0x686c, 0x7822, 0x6870,
+	0x7826, 0x681c, 0x7832, 0x6820, 0x7836, 0x6818, 0x2060, 0x6034,
+	0xd09c, 0x0040, 0x1c24, 0x6830, 0x2004, 0xac68, 0x6808, 0x783a,
+	0x680c, 0x783e, 0x0078, 0x1c65, 0xa006, 0x783a, 0x783e, 0x0078,
+	0x1c65, 0x8108, 0x2104, 0xa005, 0x00c0, 0x1c67, 0x6b2c, 0xa306,
+	0x00c0, 0x1c67, 0x8108, 0x2104, 0xa005, 0x00c0, 0x1c67, 0x6a28,
+	0xa206, 0x00c0, 0x1c67, 0x6850, 0xc0f5, 0x6852, 0x6830, 0x2004,
+	0x6918, 0xa160, 0xa180, 0x000d, 0x2004, 0xd09c, 0x00c0, 0x1c57,
+	0x6008, 0x7822, 0x686e, 0x600c, 0x7826, 0x6872, 0x6000, 0x7832,
+	0x6004, 0x7836, 0xa006, 0x783a, 0x783e, 0x0078, 0x1c65, 0x6010,
+	0x7822, 0x686e, 0x6014, 0x7826, 0x6872, 0x6000, 0x7832, 0x6004,
+	0x7836, 0x6008, 0x783a, 0x600c, 0x783e, 0x7803, 0x0011, 0x0c7f,
+	0x0d7f, 0x007c, 0x0f7e, 0x0e7e, 0x017e, 0x027e, 0x2071, 0xa8e7,
+	0x2079, 0x0030, 0x2011, 0x0050, 0x7000, 0xa086, 0x0000, 0x0040,
+	0x1c92, 0x8211, 0x0040, 0x1c90, 0x2001, 0x0005, 0x2004, 0xd08c,
+	0x0040, 0x1c79, 0x7904, 0xa18c, 0x0780, 0x017e, 0x1078, 0x1913,
+	0x017f, 0x81ff, 0x00c0, 0x1c90, 0x2011, 0x0050, 0x0078, 0x1c74,
+	0xa085, 0x0001, 0x027f, 0x017f, 0x0e7f, 0x0f7f, 0x007c, 0x7803,
+	0x0004, 0x2009, 0x0064, 0x7804, 0xd0ac, 0x0040, 0x1ce8, 0x8109,
+	0x00c0, 0x1c9b, 0x2009, 0x0100, 0x210c, 0xa18a, 0x0003, 0x1048,
+	0x1332, 0x1078, 0x1fca, 0x0e7e, 0x0f7e, 0x2071, 0xa8d6, 0x2079,
+	0x0010, 0x7004, 0xa086, 0x0000, 0x0040, 0x1ce0, 0x7800, 0x007e,
+	0x7820, 0x007e, 0x7830, 0x007e, 0x7834, 0x007e, 0x7838, 0x007e,
+	0x783c, 0x007e, 0x7803, 0x0004, 0x7823, 0x0000, 0x0005, 0x0005,
+	0x2079, 0x0030, 0x7804, 0xd0ac, 0x10c0, 0x1332, 0x2079, 0x0010,
+	0x007f, 0x783e, 0x007f, 0x783a, 0x007f, 0x7836, 0x007f, 0x7832,
+	0x007f, 0x7822, 0x007f, 0x7802, 0x0f7f, 0x0e7f, 0x0078, 0x1ce6,
+	0x0f7f, 0x0e7f, 0x7804, 0xd0ac, 0x10c0, 0x1332, 0x1078, 0x639b,
+	0x007c, 0x0e7e, 0x2071, 0xa908, 0x7003, 0x0000, 0x0e7f, 0x007c,
+	0x0d7e, 0xa280, 0x0004, 0x206c, 0x694c, 0xd1dc, 0x00c0, 0x1d6b,
+	0x6934, 0xa184, 0x0007, 0x0079, 0x1cfd, 0x1d05, 0x1d56, 0x1d05,
+	0x1d05, 0x1d05, 0x1d3b, 0x1d18, 0x1d07, 0x1078, 0x1332, 0x684c,
+	0xd0b4, 0x0040, 0x1e79, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a,
+	0x6812, 0x687c, 0x680a, 0x6880, 0x680e, 0x6958, 0x0078, 0x1d5e,
+	0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, 0x00c0, 0x1d05, 0x684c,
+	0xd0b4, 0x0040, 0x1e79, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a,
+	0x6812, 0x687c, 0x680a, 0x6880, 0x680e, 0x6804, 0x681a, 0xa080,
+	0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x206a, 0x2004, 0x6832,
+	0x6958, 0x0078, 0x1d67, 0xa18c, 0x00ff, 0xa186, 0x0015, 0x00c0,
+	0x1d6b, 0x684c, 0xd0b4, 0x0040, 0x1e79, 0x6804, 0x681a, 0xa080,
+	0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x206a, 0x2004, 0x6832,
+	0x6958, 0xa006, 0x682e, 0x682a, 0x0078, 0x1d67, 0x684c, 0xd0b4,
+	0x0040, 0x18ed, 0x6958, 0xa006, 0x682e, 0x682a, 0x2d00, 0x681a,
+	0x6834, 0xa084, 0x000f, 0xa080, 0x206a, 0x2004, 0x6832, 0x6926,
+	0x684c, 0xc0dd, 0x684e, 0x0d7f, 0x007c, 0x0f7e, 0x2079, 0x0020,
+	0x7804, 0xd0fc, 0x10c0, 0x1eaa, 0x0e7e, 0x0d7e, 0x2071, 0xa908,
+	0x7000, 0xa005, 0x00c0, 0x1df0, 0x0c7e, 0x7206, 0xa280, 0x0004,
+	0x205c, 0x7004, 0x2068, 0x7803, 0x0004, 0x6818, 0x0d7e, 0x2068,
+	0x686c, 0x7812, 0x6890, 0x0f7e, 0x20e1, 0x9040, 0x2079, 0x0200,
+	0x781a, 0x2079, 0x0100, 0x8004, 0x78d6, 0x0f7f, 0x0d7f, 0x2b68,
+	0x6824, 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc,
+	0x000f, 0x6908, 0x2001, 0x04fd, 0x2004, 0xa086, 0x0007, 0x0040,
+	0x1db2, 0xa184, 0x0007, 0x0040, 0x1db2, 0x017e, 0x2009, 0x0008,
+	0xa102, 0x017f, 0xa108, 0x791a, 0x7116, 0x701e, 0x680c, 0xa081,
+	0x0000, 0x781e, 0x701a, 0xa006, 0x700e, 0x7012, 0x7004, 0x692c,
+	0x6814, 0xa106, 0x00c0, 0x1dc9, 0x6928, 0x6810, 0xa106, 0x0040,
+	0x1dd6, 0x037e, 0x047e, 0x6b14, 0x6c10, 0x1078, 0x208a, 0x047f,
+	0x037f, 0x0040, 0x1dd6, 0x0c7f, 0x0078, 0x1df0, 0x8aff, 0x00c0,
+	0x1dde, 0x0c7f, 0xa085, 0x0001, 0x0078, 0x1df0, 0x127e, 0x2091,
+	0x8000, 0x2079, 0x0020, 0x2009, 0x0001, 0x1078, 0x1df4, 0x0040,
+	0x1ded, 0x2009, 0x0001, 0x1078, 0x1df4, 0x127f, 0x0c7f, 0xa006,
+	0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x077e, 0x067e, 0x057e, 0x047e,
+	0x037e, 0x027e, 0x8aff, 0x0040, 0x1e72, 0x700c, 0x7214, 0xa23a,
+	0x7010, 0x7218, 0xa203, 0x0048, 0x1e71, 0xa705, 0x0040, 0x1e71,
+	0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x1e24, 0x0d7e, 0x2804,
+	0xac68, 0x2900, 0x0079, 0x1e14, 0x1e53, 0x1e34, 0x1e34, 0x1e53,
+	0x1e53, 0x1e4b, 0x1e53, 0x1e34, 0x1e53, 0x1e3a, 0x1e3a, 0x1e53,
+	0x1e53, 0x1e53, 0x1e42, 0x1e3a, 0xc0fc, 0x6852, 0x6b6c, 0x6a70,
+	0x6d1c, 0x6c20, 0xd99c, 0x0040, 0x1e57, 0x0d7e, 0x2804, 0xac68,
+	0x6f08, 0x6e0c, 0x0078, 0x1e56, 0x6b08, 0x6a0c, 0x6d00, 0x6c04,
+	0x0078, 0x1e56, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c,
+	0x0078, 0x1e56, 0x0d7f, 0x0d7e, 0x6834, 0xa084, 0x00ff, 0xa086,
+	0x001e, 0x00c0, 0x1e53, 0x0d7f, 0x1078, 0x2026, 0x00c0, 0x1dfa,
+	0xa00e, 0x0078, 0x1e72, 0x0d7f, 0x1078, 0x1332, 0x0d7f, 0x7b22,
+	0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000,
+	0x7002, 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e, 0x700c,
+	0xa300, 0x700e, 0x7010, 0xa201, 0x7012, 0x1078, 0x2026, 0x0078,
+	0x1e72, 0xa006, 0x027f, 0x037f, 0x047f, 0x057f, 0x067f, 0x077f,
+	0x007c, 0x1078, 0x1332, 0x027e, 0x2001, 0x0105, 0x2003, 0x0010,
+	0x20e1, 0x9040, 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, 0x2060,
+	0x0d7e, 0x6010, 0x2068, 0x1078, 0x8d06, 0x0040, 0x1e92, 0x6850,
+	0xc0bd, 0x6852, 0x0d7f, 0x0c7e, 0x1078, 0x8a01, 0x0c7f, 0x2001,
+	0xa8c0, 0x2004, 0xac06, 0x00c0, 0x1ea7, 0x20e1, 0x9040, 0x1078,
+	0x738a, 0x2011, 0x0000, 0x1078, 0x70ea, 0x1078, 0x639b, 0x027f,
+	0x0078, 0x1f76, 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x0f7e,
+	0x0e7e, 0x0d7e, 0x0c7e, 0x2079, 0x0020, 0x2071, 0xa908, 0x2b68,
+	0x6818, 0x2060, 0x7904, 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0,
+	0x1e7b, 0x7000, 0x0079, 0x1ec4, 0x1f76, 0x1ec8, 0x1f43, 0x1f74,
+	0x8001, 0x7002, 0xd19c, 0x00c0, 0x1edc, 0x8aff, 0x0040, 0x1efb,
+	0x2009, 0x0001, 0x1078, 0x1df4, 0x0040, 0x1f76, 0x2009, 0x0001,
+	0x1078, 0x1df4, 0x0078, 0x1f76, 0x7803, 0x0004, 0xd194, 0x0040,
+	0x1eec, 0x6850, 0xc0fc, 0x6852, 0x8aff, 0x00c0, 0x1ef1, 0x684c,
+	0xc0f5, 0x684e, 0x0078, 0x1ef1, 0x1078, 0x203f, 0x6850, 0xc0fd,
+	0x6852, 0x2a00, 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003,
+	0x0000, 0x0078, 0x1f76, 0x711c, 0x81ff, 0x0040, 0x1f11, 0x7918,
+	0x7922, 0x7827, 0x0000, 0x7803, 0x0001, 0x7000, 0x8000, 0x7002,
+	0x700c, 0xa100, 0x700e, 0x7010, 0xa081, 0x0000, 0x7012, 0x0078,
+	0x1f76, 0x0f7e, 0x027e, 0x781c, 0x007e, 0x7818, 0x007e, 0x2079,
+	0x0100, 0x7a14, 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x037e,
+	0x2019, 0x1000, 0x8319, 0x1040, 0x1332, 0x7820, 0xd0bc, 0x00c0,
+	0x1f22, 0x037f, 0x79c8, 0x007f, 0xa102, 0x017f, 0x007e, 0x017e,
+	0x79c4, 0x007f, 0xa103, 0x78c6, 0x007f, 0x78ca, 0xa284, 0x0004,
+	0xa085, 0x0012, 0x7816, 0x027f, 0x0f7f, 0x7803, 0x0008, 0x7003,
+	0x0000, 0x0078, 0x1f76, 0x8001, 0x7002, 0xd194, 0x0040, 0x1f58,
+	0x7804, 0xd0fc, 0x00c0, 0x1eba, 0xd19c, 0x00c0, 0x1f72, 0x8aff,
+	0x0040, 0x1f76, 0x2009, 0x0001, 0x1078, 0x1df4, 0x0078, 0x1f76,
+	0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x203f, 0x0d7e, 0x2804,
+	0xac68, 0x6034, 0xd09c, 0x00c0, 0x1f6b, 0x6808, 0xa31a, 0x680c,
+	0xa213, 0x0078, 0x1f6f, 0x6810, 0xa31a, 0x6814, 0xa213, 0x0d7f,
+	0x0078, 0x1eec, 0x0078, 0x1eec, 0x1078, 0x1332, 0x0c7f, 0x0d7f,
+	0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f, 0x007c, 0x0f7e, 0x0e7e,
+	0x2071, 0xa908, 0x7000, 0xa086, 0x0000, 0x0040, 0x1fc7, 0x2079,
+	0x0020, 0x017e, 0x2009, 0x0207, 0x210c, 0xd194, 0x0040, 0x1fa4,
+	0x2009, 0x020c, 0x210c, 0xa184, 0x0003, 0x0040, 0x1fa4, 0x1078,
+	0xa5d2, 0x2001, 0x0133, 0x2004, 0xa005, 0x1040, 0x1332, 0x20e1,
+	0x9040, 0x2001, 0x020c, 0x2102, 0x2009, 0x0206, 0x2104, 0x2009,
+	0x0203, 0x210c, 0xa106, 0x00c0, 0x1faf, 0x20e1, 0x9040, 0x7804,
+	0xd0fc, 0x0040, 0x1f8a, 0x1078, 0x1eaa, 0x7000, 0xa086, 0x0000,
+	0x00c0, 0x1f8a, 0x017f, 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0,
+	0x1fbd, 0x20e1, 0x9040, 0x7803, 0x0002, 0x7003, 0x0000, 0x0e7f,
+	0x0f7f, 0x007c, 0x027e, 0x0c7e, 0x0d7e, 0x0e7e, 0x0f7e, 0x2071,
+	0xa908, 0x2079, 0x0020, 0x7000, 0xa086, 0x0000, 0x0040, 0x2003,
+	0x7004, 0x2060, 0x6010, 0x2068, 0x1078, 0x8d06, 0x0040, 0x1fed,
+	0x6850, 0xc0b5, 0x6852, 0x680c, 0x7a1c, 0xa206, 0x00c0, 0x1fed,
+	0x6808, 0x7a18, 0xa206, 0x0040, 0x2009, 0x2001, 0x0105, 0x2003,
+	0x0010, 0x20e1, 0x9040, 0x7803, 0x0004, 0x7003, 0x0000, 0x7004,
+	0x2060, 0x1078, 0x8a01, 0x20e1, 0x9040, 0x1078, 0x738a, 0x2011,
+	0x0000, 0x1078, 0x70ea, 0x0f7f, 0x0e7f, 0x0d7f, 0x0c7f, 0x027f,
+	0x007c, 0x6810, 0x6a14, 0xa205, 0x00c0, 0x1fed, 0x684c, 0xc0dc,
+	0x684e, 0x2c10, 0x1078, 0x1cf0, 0x2001, 0x0105, 0x2003, 0x0010,
+	0x20e1, 0x9040, 0x7803, 0x0004, 0x7003, 0x0000, 0x2069, 0xa8b1,
+	0x6833, 0x0000, 0x683f, 0x0000, 0x0078, 0x2003, 0x8840, 0x2804,
+	0xa005, 0x00c0, 0x203a, 0x6004, 0xa005, 0x0040, 0x203c, 0x681a,
+	0x2060, 0x6034, 0xa084, 0x000f, 0xa080, 0x206a, 0x2044, 0x88ff,
+	0x1040, 0x1332, 0x8a51, 0x007c, 0x2051, 0x0000, 0x007c, 0x8a50,
+	0x8841, 0x2804, 0xa005, 0x00c0, 0x2059, 0x2c00, 0xad06, 0x0040,
+	0x204e, 0x6000, 0xa005, 0x00c0, 0x204e, 0x2d00, 0x2060, 0x681a,
+	0x6034, 0xa084, 0x000f, 0xa080, 0x207a, 0x2044, 0x88ff, 0x1040,
+	0x1332, 0x007c, 0x0000, 0x0011, 0x0015, 0x0019, 0x001d, 0x0021,
+	0x0025, 0x0029, 0x0000, 0x000f, 0x0015, 0x001b, 0x0021, 0x0027,
+	0x0000, 0x0000, 0x0000, 0x205f, 0x205b, 0x0000, 0x0000, 0x2069,
+	0x0000, 0x205f, 0x0000, 0x2066, 0x2063, 0x0000, 0x0000, 0x0000,
+	0x2069, 0x2066, 0x0000, 0x2061, 0x2061, 0x0000, 0x0000, 0x2069,
+	0x0000, 0x2061, 0x0000, 0x2067, 0x2067, 0x0000, 0x0000, 0x0000,
+	0x2069, 0x2067, 0x0a7e, 0x097e, 0x087e, 0x6b2e, 0x6c2a, 0x6858,
+	0xa055, 0x0040, 0x212d, 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0,
+	0x206a, 0xa986, 0x0007, 0x0040, 0x20a5, 0xa986, 0x000e, 0x0040,
+	0x20a5, 0xa986, 0x000f, 0x00c0, 0x20a9, 0x605c, 0xa422, 0x6060,
+	0xa31a, 0x2804, 0xa045, 0x00c0, 0x20b7, 0x0050, 0x20b1, 0x0078,
+	0x212d, 0x6004, 0xa065, 0x0040, 0x212d, 0x0078, 0x2094, 0x2804,
+	0xa005, 0x0040, 0x20d5, 0xac68, 0xd99c, 0x00c0, 0x20c5, 0x6808,
+	0xa422, 0x680c, 0xa31b, 0x0078, 0x20c9, 0x6810, 0xa422, 0x6814,
+	0xa31b, 0x0048, 0x20f4, 0x2300, 0xa405, 0x0040, 0x20db, 0x8a51,
+	0x0040, 0x212d, 0x8840, 0x0078, 0x20b7, 0x6004, 0xa065, 0x0040,
+	0x212d, 0x0078, 0x2094, 0x8a51, 0x0040, 0x212d, 0x8840, 0x2804,
+	0xa005, 0x00c0, 0x20ee, 0x6004, 0xa065, 0x0040, 0x212d, 0x6034,
+	0xa0cc, 0x000f, 0xa9c0, 0x206a, 0x2804, 0x2040, 0x2b68, 0x6850,
+	0xc0fc, 0x6852, 0x0078, 0x2121, 0x8422, 0x8420, 0x831a, 0xa399,
+	0x0000, 0x0d7e, 0x2b68, 0x6c6e, 0x6b72, 0x0d7f, 0xd99c, 0x00c0,
+	0x210f, 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, 0x1048,
+	0x1332, 0x6800, 0xa420, 0x6804, 0xa319, 0x0078, 0x211b, 0x6910,
+	0x2400, 0xa122, 0x6914, 0x2300, 0xa11b, 0x1048, 0x1332, 0x6800,
+	0xa420, 0x6804, 0xa319, 0x2b68, 0x6c1e, 0x6b22, 0x6850, 0xc0fd,
+	0x6852, 0x2c00, 0x681a, 0x2800, 0x6832, 0x2a00, 0x6826, 0x007f,
+	0x007f, 0x007f, 0xa006, 0x0078, 0x2132, 0x087f, 0x097f, 0x0a7f,
+	0xa085, 0x0001, 0x007c, 0x2001, 0x0005, 0x2004, 0xa084, 0x0007,
+	0x0079, 0x213a, 0x2142, 0x2143, 0x2146, 0x2149, 0x214e, 0x2151,
+	0x2156, 0x215b, 0x007c, 0x1078, 0x1eaa, 0x007c, 0x1078, 0x1913,
+	0x007c, 0x1078, 0x1913, 0x1078, 0x1eaa, 0x007c, 0x1078, 0x14be,
+	0x007c, 0x1078, 0x1eaa, 0x1078, 0x14be, 0x007c, 0x1078, 0x1913,
+	0x1078, 0x14be, 0x007c, 0x1078, 0x1913, 0x1078, 0x1eaa, 0x1078,
+	0x14be, 0x007c, 0x127e, 0x2091, 0x2300, 0x2079, 0x0200, 0x2071,
+	0xab80, 0x2069, 0xa600, 0x2009, 0x0004, 0x7912, 0x7817, 0x0004,
+	0x1078, 0x251f, 0x781b, 0x0002, 0x20e1, 0x8700, 0x127f, 0x007c,
+	0x127e, 0x2091, 0x2300, 0x781c, 0xa084, 0x0007, 0x0079, 0x2180,
+	0x21a4, 0x2188, 0x218c, 0x2190, 0x2196, 0x219a, 0x219e, 0x21a2,
+	0x1078, 0x548e, 0x0078, 0x21a4, 0x1078, 0x54da, 0x0078, 0x21a4,
+	0x1078, 0x548e, 0x1078, 0x54da, 0x0078, 0x21a4, 0x1078, 0x21a6,
+	0x0078, 0x21a4, 0x1078, 0x21a6, 0x0078, 0x21a4, 0x1078, 0x21a6,
+	0x0078, 0x21a4, 0x1078, 0x21a6, 0x127f, 0x007c, 0x007e, 0x017e,
+	0x027e, 0x1078, 0xa5d2, 0x7930, 0xa184, 0x0003, 0x0040, 0x21c9,
+	0x2001, 0xa8c0, 0x2004, 0xa005, 0x0040, 0x21c5, 0x2001, 0x0133,
+	0x2004, 0xa005, 0x1040, 0x1332, 0x0c7e, 0x2001, 0xa8c0, 0x2064,
+	0x1078, 0x8a01, 0x0c7f, 0x0078, 0x21f2, 0x20e1, 0x9040, 0x0078,
+	0x21f2, 0xa184, 0x0030, 0x0040, 0x21da, 0x6a00, 0xa286, 0x0003,
+	0x00c0, 0x21d4, 0x0078, 0x21d6, 0x1078, 0x4224, 0x20e1, 0x9010,
+	0x0078, 0x21f2, 0xa184, 0x00c0, 0x0040, 0x21ec, 0x0e7e, 0x037e,
+	0x047e, 0x057e, 0x2071, 0xa8e7, 0x1078, 0x1af4, 0x057f, 0x047f,
+	0x037f, 0x0e7f, 0x0078, 0x21f2, 0xa184, 0x0300, 0x0040, 0x21f2,
+	0x20e1, 0x9020, 0x7932, 0x027f, 0x017f, 0x007f, 0x007c, 0x017e,
+	0x0e7e, 0x0f7e, 0x2071, 0xa600, 0x7128, 0x2001, 0xa890, 0x2102,
+	0x2001, 0xa898, 0x2102, 0xa182, 0x0211, 0x00c8, 0x220b, 0x2009,
+	0x0008, 0x0078, 0x2235, 0xa182, 0x0259, 0x00c8, 0x2213, 0x2009,
+	0x0007, 0x0078, 0x2235, 0xa182, 0x02c1, 0x00c8, 0x221b, 0x2009,
+	0x0006, 0x0078, 0x2235, 0xa182, 0x0349, 0x00c8, 0x2223, 0x2009,
+	0x0005, 0x0078, 0x2235, 0xa182, 0x0421, 0x00c8, 0x222b, 0x2009,
+	0x0004, 0x0078, 0x2235, 0xa182, 0x0581, 0x00c8, 0x2233, 0x2009,
+	0x0003, 0x0078, 0x2235, 0x2009, 0x0002, 0x2079, 0x0200, 0x7912,
+	0x7817, 0x0004, 0x1078, 0x251f, 0x0f7f, 0x0e7f, 0x017f, 0x007c,
+	0x127e, 0x2091, 0x2200, 0x2061, 0x0100, 0x2071, 0xa600, 0x6024,
+	0x6026, 0x6053, 0x0030, 0x6033, 0x00ef, 0x60e7, 0x0000, 0x60eb,
+	0x00ef, 0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043, 0x0000, 0x602f,
+	0x0080, 0x602f, 0x0000, 0x6007, 0x0eaf, 0x600f, 0x00ff, 0x602b,
+	0x002f, 0x127f, 0x007c, 0x2001, 0xa630, 0x2003, 0x0000, 0x2001,
+	0xa62f, 0x2003, 0x0001, 0x007c, 0x127e, 0x2091, 0x2200, 0x007e,
+	0x017e, 0x027e, 0x6124, 0xa184, 0x002c, 0x00c0, 0x227b, 0xa184,
+	0x0007, 0x0079, 0x2281, 0xa195, 0x0004, 0xa284, 0x0007, 0x0079,
+	0x2281, 0x22ad, 0x2289, 0x228d, 0x2291, 0x2297, 0x229b, 0x22a1,
+	0x22a7, 0x1078, 0x5c56, 0x0078, 0x22ad, 0x1078, 0x5d45, 0x0078,
+	0x22ad, 0x1078, 0x5d45, 0x1078, 0x5c56, 0x0078, 0x22ad, 0x1078,
+	0x22b2, 0x0078, 0x22ad, 0x1078, 0x5c56, 0x1078, 0x22b2, 0x0078,
+	0x22ad, 0x1078, 0x5d45, 0x1078, 0x22b2, 0x0078, 0x22ad, 0x1078,
+	0x5d45, 0x1078, 0x5c56, 0x1078, 0x22b2, 0x027f, 0x017f, 0x007f,
+	0x127f, 0x007c, 0x6124, 0xd1ac, 0x0040, 0x23ac, 0x017e, 0x047e,
+	0x0c7e, 0x644c, 0xa486, 0xf0f0, 0x00c0, 0x22c5, 0x2061, 0x0100,
+	0x644a, 0x6043, 0x0090, 0x6043, 0x0010, 0x74c6, 0xa48c, 0xff00,
+	0x7034, 0xd084, 0x0040, 0x22dd, 0xa186, 0xf800, 0x00c0, 0x22dd,
+	0x703c, 0xd084, 0x00c0, 0x22dd, 0xc085, 0x703e, 0x037e, 0x2418,
+	0x2011, 0x8016, 0x1078, 0x361b, 0x037f, 0xa196, 0xff00, 0x0040,
+	0x231f, 0x6030, 0xa084, 0x00ff, 0x810f, 0xa116, 0x0040, 0x231f,
+	0x7130, 0xd184, 0x00c0, 0x231f, 0x2011, 0xa653, 0x2214, 0xd2ec,
+	0x0040, 0x22fa, 0xc18d, 0x7132, 0x2011, 0xa653, 0x2214, 0xd2ac,
+	0x00c0, 0x231f, 0x6240, 0xa294, 0x0010, 0x0040, 0x2306, 0x6248,
+	0xa294, 0xff00, 0xa296, 0xff00, 0x0040, 0x231f, 0x7030, 0xd08c,
+	0x0040, 0x2371, 0x7034, 0xd08c, 0x00c0, 0x2316, 0x2001, 0xa60c,
+	0x200c, 0xd1ac, 0x00c0, 0x2371, 0xc1ad, 0x2102, 0x037e, 0x73c4,
+	0x2011, 0x8013, 0x1078, 0x361b, 0x037f, 0x0078, 0x2371, 0x7034,
+	0xd08c, 0x00c0, 0x232b, 0x2001, 0xa60c, 0x200c, 0xd1ac, 0x00c0,
+	0x2371, 0xc1ad, 0x2102, 0x037e, 0x73c4, 0x2011, 0x8013, 0x1078,
+	0x361b, 0x037f, 0x7130, 0xc185, 0x7132, 0x2011, 0xa653, 0x220c,
+	0xd1a4, 0x0040, 0x2355, 0x017e, 0x2009, 0x0001, 0x2011, 0x0100,
+	0x1078, 0x5bf1, 0x2019, 0x000e, 0x1078, 0xa195, 0xa484, 0x00ff,
+	0xa080, 0x29c0, 0x200c, 0xa18c, 0xff00, 0x810f, 0x8127, 0xa006,
+	0x2009, 0x000e, 0x1078, 0xa21d, 0x017f, 0xd1ac, 0x00c0, 0x2362,
+	0x017e, 0x2009, 0x0000, 0x2019, 0x0004, 0x1078, 0x284f, 0x017f,
+	0x0078, 0x2371, 0x157e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x1078,
+	0x45c4, 0x00c0, 0x236d, 0x1078, 0x42f8, 0x8108, 0x00f0, 0x2367,
+	0x157f, 0x0c7f, 0x047f, 0x0f7e, 0x2079, 0xa8c4, 0x783c, 0xa086,
+	0x0000, 0x0040, 0x2383, 0x6027, 0x0004, 0x783f, 0x0000, 0x2079,
+	0x0140, 0x7803, 0x0000, 0x0f7f, 0x2011, 0x0003, 0x1078, 0x70e0,
+	0x2011, 0x0002, 0x1078, 0x70ea, 0x1078, 0x6fc4, 0x037e, 0x2019,
+	0x0000, 0x1078, 0x7058, 0x037f, 0x60e3, 0x0000, 0x017f, 0x2001,
+	0xa600, 0x2014, 0xa296, 0x0004, 0x00c0, 0x23a4, 0xd19c, 0x00c0,
+	0x23ac, 0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0xa622,
+	0x2003, 0x0000, 0x6027, 0x0020, 0xd194, 0x0040, 0x2490, 0x0f7e,
+	0x2079, 0xa8c4, 0x783c, 0xa086, 0x0001, 0x00c0, 0x23d0, 0x017e,
+	0x6027, 0x0004, 0x783f, 0x0000, 0x2079, 0x0140, 0x7803, 0x1000,
+	0x7803, 0x0000, 0x2079, 0xa8b1, 0x7807, 0x0000, 0x7833, 0x0000,
+	0x1078, 0x62d1, 0x1078, 0x639b, 0x017f, 0x0f7f, 0x0078, 0x2490,
+	0x0f7f, 0x017e, 0x3900, 0xa082, 0xa9e3, 0x00c8, 0x23db, 0x017e,
+	0x1078, 0x747a, 0x017f, 0x6220, 0xd2b4, 0x0040, 0x2446, 0x1078,
+	0x5acb, 0x1078, 0x6e0f, 0x6027, 0x0004, 0x0f7e, 0x2019, 0xa8ba,
+	0x2304, 0xa07d, 0x0040, 0x241c, 0x7804, 0xa086, 0x0032, 0x00c0,
+	0x241c, 0x0d7e, 0x0c7e, 0x0e7e, 0x2069, 0x0140, 0x618c, 0x6288,
+	0x7818, 0x608e, 0x7808, 0x608a, 0x6043, 0x0002, 0x2001, 0x0003,
+	0x8001, 0x00c0, 0x2400, 0x6043, 0x0000, 0x6803, 0x1000, 0x6803,
+	0x0000, 0x618e, 0x628a, 0x1078, 0x61cd, 0x1078, 0x62d1, 0x7810,
+	0x2070, 0x7037, 0x0103, 0x2f60, 0x1078, 0x772d, 0x0e7f, 0x0c7f,
+	0x0d7f, 0x0f7f, 0x017f, 0x007c, 0x0f7f, 0x0d7e, 0x2069, 0x0140,
+	0x6804, 0xa084, 0x4000, 0x0040, 0x2429, 0x6803, 0x1000, 0x6803,
+	0x0000, 0x0d7f, 0x0c7e, 0x2061, 0xa8b1, 0x6028, 0xa09a, 0x00c8,
+	0x00c8, 0x2439, 0x8000, 0x602a, 0x0c7f, 0x1078, 0x6e01, 0x0078,
+	0x248f, 0x2019, 0xa8ba, 0x2304, 0xa065, 0x0040, 0x2443, 0x2009,
+	0x0027, 0x1078, 0x775c, 0x0c7f, 0x0078, 0x248f, 0xd2bc, 0x0040,
+	0x248f, 0x1078, 0x5ad8, 0x6017, 0x0010, 0x6027, 0x0004, 0x0d7e,
+	0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, 0x245b, 0x6803,
+	0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e, 0x2061, 0xa8b1, 0x6044,
+	0xa09a, 0x00c8, 0x00c8, 0x247e, 0x8000, 0x6046, 0x603c, 0x0c7f,
+	0xa005, 0x0040, 0x248f, 0x2009, 0x07d0, 0x1078, 0x5ad0, 0xa080,
+	0x0007, 0x2004, 0xa086, 0x0006, 0x00c0, 0x247a, 0x6017, 0x0012,
+	0x0078, 0x248f, 0x6017, 0x0016, 0x0078, 0x248f, 0x037e, 0x2019,
+	0x0001, 0x1078, 0x7058, 0x037f, 0x2019, 0xa8c0, 0x2304, 0xa065,
+	0x0040, 0x248e, 0x2009, 0x004f, 0x1078, 0x775c, 0x0c7f, 0x017f,
+	0xd19c, 0x0040, 0x24e4, 0x7034, 0xd0ac, 0x00c0, 0x24c1, 0x017e,
+	0x157e, 0x6027, 0x0008, 0x602f, 0x0020, 0x20a9, 0x000a, 0x00f0,
+	0x249f, 0x602f, 0x0000, 0x6150, 0xa185, 0x1400, 0x6052, 0x20a9,
+	0x0320, 0x00e0, 0x24a9, 0x2091, 0x6000, 0x6020, 0xd09c, 0x00c0,
+	0x24b8, 0x157f, 0x6152, 0x017f, 0x6027, 0x0008, 0x0078, 0x24e4,
+	0x1078, 0x2577, 0x00f0, 0x24a9, 0x157f, 0x6152, 0x017f, 0x6027,
+	0x0008, 0x017e, 0x6028, 0xc09c, 0x602a, 0x2011, 0x0003, 0x1078,
+	0x70e0, 0x2011, 0x0002, 0x1078, 0x70ea, 0x1078, 0x6fc4, 0x037e,
+	0x2019, 0x0000, 0x1078, 0x7058, 0x037f, 0x60e3, 0x0000, 0x1078,
+	0xa5ad, 0x1078, 0xa5cb, 0x2001, 0xa600, 0x2003, 0x0004, 0x6027,
+	0x0008, 0x1078, 0x1246, 0x017f, 0xa18c, 0xffd0, 0x6126, 0x007c,
+	0x007e, 0x017e, 0x027e, 0x0e7e, 0x0f7e, 0x127e, 0x2091, 0x8000,
+	0x2071, 0xa600, 0x71bc, 0x70be, 0xa116, 0x0040, 0x2518, 0x81ff,
+	0x0040, 0x2500, 0x2011, 0x8011, 0x1078, 0x361b, 0x0078, 0x2518,
+	0x2011, 0x8012, 0x1078, 0x361b, 0x2001, 0xa672, 0x2004, 0xd0fc,
+	0x00c0, 0x2518, 0x037e, 0x0c7e, 0x1078, 0x6f9f, 0x2061, 0x0100,
+	0x2019, 0x0028, 0x2009, 0x0000, 0x1078, 0x284f, 0x0c7f, 0x037f,
+	0x127f, 0x0f7f, 0x0e7f, 0x027f, 0x017f, 0x007f, 0x007c, 0x0c7e,
+	0x0f7e, 0x007e, 0x027e, 0x2061, 0x0100, 0xa190, 0x253b, 0x2204,
+	0x60f2, 0x2011, 0x2548, 0x6000, 0xa082, 0x0003, 0x00c8, 0x2534,
+	0x2001, 0x00ff, 0x0078, 0x2535, 0x2204, 0x60ee, 0x027f, 0x007f,
+	0x0f7f, 0x0c7f, 0x007c, 0x0840, 0x0840, 0x0840, 0x0580, 0x0420,
+	0x0348, 0x02c0, 0x0258, 0x0210, 0x01a8, 0x01a8, 0x01a8, 0x01a8,
+	0x0140, 0x00f8, 0x00d0, 0x00b0, 0x00a0, 0x2028, 0xa18c, 0x00ff,
+	0x2130, 0xa094, 0xff00, 0x00c0, 0x2558, 0x81ff, 0x0040, 0x255c,
+	0x1078, 0x5761, 0x0078, 0x2563, 0xa080, 0x29c0, 0x200c, 0xa18c,
+	0xff00, 0x810f, 0xa006, 0x007c, 0xa080, 0x29c0, 0x200c, 0xa18c,
+	0x00ff, 0x007c, 0x0c7e, 0x2061, 0xa600, 0x6030, 0x0040, 0x2573,
+	0xc09d, 0x0078, 0x2574, 0xc09c, 0x6032, 0x0c7f, 0x007c, 0x007e,
+	0x157e, 0x0f7e, 0x2079, 0x0100, 0x20a9, 0x000a, 0x7854, 0xd08c,
+	0x00c0, 0x2584, 0x00f0, 0x257e, 0x0f7f, 0x157f, 0x007f, 0x007c,
+	0x0c7e, 0x007e, 0x2061, 0x0100, 0x6030, 0x007e, 0x6048, 0x007e,
+	0x60e4, 0x007e, 0x60e8, 0x007e, 0x6050, 0x007e, 0x60f0, 0x007e,
+	0x60ec, 0x007e, 0x600c, 0x007e, 0x6004, 0x007e, 0x6028, 0x007e,
+	0x60e0, 0x007e, 0x602f, 0x0100, 0x602f, 0x0000, 0x0005, 0x0005,
+	0x0005, 0x0005, 0x602f, 0x0040, 0x602f, 0x0000, 0x007f, 0x60e2,
+	0x007f, 0x602a, 0x007f, 0x6006, 0x007f, 0x600e, 0x007f, 0x60ee,
+	0x007f, 0x60f2, 0x007f, 0x6052, 0x007f, 0x60ea, 0x007f, 0x60e6,
+	0x007f, 0x604a, 0x007f, 0x6032, 0x007f, 0x0c7f, 0x007c, 0x25e7,
+	0x25eb, 0x25ef, 0x25f5, 0x25fb, 0x2601, 0x2607, 0x260f, 0x2617,
+	0x261d, 0x2623, 0x262b, 0x2633, 0x263b, 0x2643, 0x264d, 0x2657,
+	0x2657, 0x2657, 0x2657, 0x2657, 0x2657, 0x2657, 0x2657, 0x2657,
+	0x2657, 0x2657, 0x2657, 0x2657, 0x2657, 0x2657, 0x2657, 0x107e,
+	0x007e, 0x0078, 0x2670, 0x107e, 0x007e, 0x0078, 0x2670, 0x107e,
+	0x007e, 0x1078, 0x226c, 0x0078, 0x2670, 0x107e, 0x007e, 0x1078,
+	0x226c, 0x0078, 0x2670, 0x107e, 0x007e, 0x1078, 0x2133, 0x0078,
+	0x2670, 0x107e, 0x007e, 0x1078, 0x2133, 0x0078, 0x2670, 0x107e,
+	0x007e, 0x1078, 0x226c, 0x1078, 0x2133, 0x0078, 0x2670, 0x107e,
+	0x007e, 0x1078, 0x226c, 0x1078, 0x2133, 0x0078, 0x2670, 0x107e,
+	0x007e, 0x1078, 0x2178, 0x0078, 0x2670, 0x107e, 0x007e, 0x1078,
+	0x2178, 0x0078, 0x2670, 0x107e, 0x007e, 0x1078, 0x226c, 0x1078,
+	0x2178, 0x0078, 0x2670, 0x107e, 0x007e, 0x1078, 0x226c, 0x1078,
+	0x2178, 0x0078, 0x2670, 0x107e, 0x007e, 0x1078, 0x2133, 0x1078,
+	0x2178, 0x0078, 0x2670, 0x107e, 0x007e, 0x1078, 0x2133, 0x1078,
+	0x2178, 0x0078, 0x2670, 0x107e, 0x007e, 0x1078, 0x226c, 0x1078,
+	0x2133, 0x1078, 0x2178, 0x0078, 0x2670, 0x107e, 0x007e, 0x1078,
+	0x226c, 0x1078, 0x2133, 0x1078, 0x2178, 0x0078, 0x2670, 0x0005,
+	0x0078, 0x2657, 0xb084, 0x003c, 0x8004, 0x8004, 0x0079, 0x2660,
+	0x2670, 0x25ed, 0x25f1, 0x25f7, 0x25fd, 0x2603, 0x2609, 0x2611,
+	0x2619, 0x261f, 0x2625, 0x262d, 0x2635, 0x263d, 0x2645, 0x264f,
+	0x0008, 0x265a, 0x007f, 0x107f, 0x2091, 0x8001, 0x007c, 0x0c7e,
+	0x027e, 0x047e, 0x2021, 0x0000, 0x1078, 0x4967, 0x00c0, 0x2772,
+	0x70cc, 0xd09c, 0x0040, 0x268e, 0xd084, 0x00c0, 0x268e, 0xd0bc,
+	0x00c0, 0x2772, 0x1078, 0x2776, 0x0078, 0x2772, 0xd0cc, 0x00c0,
+	0x2772, 0xd094, 0x0040, 0x2698, 0x7097, 0xffff, 0x0078, 0x2772,
+	0x2001, 0x010c, 0x203c, 0x7284, 0xd284, 0x0040, 0x2701, 0xd28c,
+	0x00c0, 0x2701, 0x037e, 0x7394, 0xa38e, 0xffff, 0x0040, 0x26ab,
+	0x83ff, 0x00c0, 0x26ad, 0x2019, 0x0001, 0x8314, 0xa2e0, 0xacc0,
+	0x2c04, 0xa38c, 0x0001, 0x0040, 0x26ba, 0xa084, 0xff00, 0x8007,
+	0x0078, 0x26bc, 0xa084, 0x00ff, 0xa70e, 0x0040, 0x26f6, 0xa08e,
+	0x0000, 0x0040, 0x26f6, 0xa08e, 0x00ff, 0x00c0, 0x26d3, 0x7230,
+	0xd284, 0x00c0, 0x26fc, 0x7284, 0xc28d, 0x7286, 0x7097, 0xffff,
+	0x037f, 0x0078, 0x2701, 0x2009, 0x0000, 0x1078, 0x254d, 0x1078,
+	0x455c, 0x00c0, 0x26f9, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
+	0x00c0, 0x26f0, 0x7030, 0xd08c, 0x0040, 0x26ea, 0x6000, 0xd0bc,
+	0x0040, 0x26f0, 0x1078, 0x278c, 0x0040, 0x26f9, 0x0078, 0x26f6,
+	0x1078, 0x28c4, 0x1078, 0x27b9, 0x0040, 0x26f9, 0x8318, 0x0078,
+	0x26ad, 0x7396, 0x0078, 0x26fe, 0x7097, 0xffff, 0x037f, 0x0078,
+	0x2772, 0xa780, 0x29c0, 0x203c, 0xa7bc, 0xff00, 0x873f, 0x2041,
+	0x007e, 0x7094, 0xa096, 0xffff, 0x00c0, 0x2713, 0x2009, 0x0000,
+	0x28a8, 0x0078, 0x271f, 0xa812, 0x0048, 0x271b, 0x2008, 0xa802,
+	0x20a8, 0x0078, 0x271f, 0x7097, 0xffff, 0x0078, 0x2772, 0x2700,
+	0x157e, 0x017e, 0xa106, 0x0040, 0x2766, 0xc484, 0x1078, 0x45c4,
+	0x0040, 0x2730, 0x1078, 0x455c, 0x00c0, 0x276f, 0x0078, 0x2731,
+	0xc485, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2740,
+	0x7030, 0xd08c, 0x0040, 0x275e, 0x6000, 0xd0bc, 0x00c0, 0x275e,
+	0x7284, 0xd28c, 0x0040, 0x2756, 0x6004, 0xa084, 0x00ff, 0xa082,
+	0x0006, 0x0048, 0x2766, 0xd484, 0x00c0, 0x2752, 0x1078, 0x457f,
+	0x0078, 0x2754, 0x1078, 0x298e, 0x0078, 0x2766, 0x1078, 0x28c4,
+	0x1078, 0x27b9, 0x0040, 0x276f, 0x0078, 0x2766, 0x1078, 0x2959,
+	0x0040, 0x2766, 0x1078, 0x278c, 0x0040, 0x276f, 0x017f, 0x8108,
+	0x157f, 0x00f0, 0x271f, 0x7097, 0xffff, 0x0078, 0x2772, 0x017f,
+	0x157f, 0x7196, 0x047f, 0x027f, 0x0c7f, 0x007c, 0x0c7e, 0x017e,
+	0x7097, 0x0001, 0x2009, 0x007e, 0x1078, 0x455c, 0x00c0, 0x2789,
+	0x1078, 0x28c4, 0x1078, 0x27b9, 0x0040, 0x2789, 0x70cc, 0xc0bd,
+	0x70ce, 0x017f, 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e,
+	0x2c68, 0x2001, 0xa657, 0x2004, 0xa084, 0x00ff, 0x6842, 0x1078,
+	0x76c7, 0x0040, 0x27b4, 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001,
+	0x0000, 0x1078, 0x44ee, 0x2001, 0x0000, 0x1078, 0x4502, 0x127e,
+	0x2091, 0x8000, 0x7090, 0x8000, 0x7092, 0x127f, 0x2009, 0x0004,
+	0x1078, 0x775c, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f,
+	0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x2001, 0xa657,
+	0x2004, 0xa084, 0x00ff, 0x6842, 0x1078, 0x9187, 0x0040, 0x27f2,
+	0x2d00, 0x601a, 0x6800, 0xc0c4, 0x6802, 0x68a0, 0xa086, 0x007e,
+	0x0040, 0x27db, 0x6804, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
+	0x27db, 0x1078, 0x2880, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078,
+	0x44ee, 0x2001, 0x0002, 0x1078, 0x4502, 0x127e, 0x2091, 0x8000,
+	0x7090, 0x8000, 0x7092, 0x127f, 0x2009, 0x0002, 0x1078, 0x775c,
+	0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f, 0x007c, 0x0c7e,
+	0x027e, 0x2009, 0x0080, 0x1078, 0x455c, 0x00c0, 0x2805, 0x1078,
+	0x2808, 0x0040, 0x2805, 0x70d3, 0xffff, 0x027f, 0x0c7f, 0x007c,
+	0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x1078, 0x76c7, 0x0040,
+	0x282a, 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078,
+	0x44ee, 0x2001, 0x0002, 0x1078, 0x4502, 0x127e, 0x2091, 0x8000,
+	0x70d4, 0x8000, 0x70d6, 0x127f, 0x2009, 0x0002, 0x1078, 0x775c,
+	0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f, 0x007c, 0x0c7e,
+	0x0d7e, 0x127e, 0x2091, 0x8000, 0x2009, 0x007f, 0x1078, 0x455c,
+	0x00c0, 0x284b, 0x2c68, 0x1078, 0x76c7, 0x0040, 0x284b, 0x2d00,
+	0x601a, 0x6312, 0x601f, 0x0001, 0x620a, 0x2009, 0x0022, 0x1078,
+	0x775c, 0xa085, 0x0001, 0x127f, 0x0d7f, 0x0c7f, 0x007c, 0x0e7e,
+	0x0c7e, 0x067e, 0x037e, 0x027e, 0x1078, 0x5f0e, 0x1078, 0x5eae,
+	0x1078, 0x8068, 0x2130, 0x81ff, 0x0040, 0x2864, 0x20a9, 0x007e,
+	0x2009, 0x0000, 0x0078, 0x2868, 0x20a9, 0x007f, 0x2009, 0x0000,
+	0x017e, 0x1078, 0x45c4, 0x00c0, 0x2871, 0x1078, 0x47e9, 0x1078,
+	0x42f8, 0x017f, 0x8108, 0x00f0, 0x2868, 0x86ff, 0x00c0, 0x287a,
+	0x1078, 0x119b, 0x027f, 0x037f, 0x067f, 0x0c7f, 0x0e7f, 0x007c,
+	0x0e7e, 0x0c7e, 0x037e, 0x027e, 0x017e, 0x6218, 0x2270, 0x72a0,
+	0x027e, 0x2019, 0x0029, 0x1078, 0x5f01, 0x077e, 0x2039, 0x0000,
+	0x1078, 0x5e0a, 0x2c08, 0x1078, 0x9f8b, 0x077f, 0x017f, 0x2e60,
+	0x1078, 0x47e9, 0x6210, 0x6314, 0x1078, 0x42f8, 0x6212, 0x6316,
+	0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x007e,
+	0x6018, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x00c0, 0x28ba, 0x2071,
+	0xa600, 0x7090, 0xa005, 0x0040, 0x28b7, 0x8001, 0x7092, 0x007f,
+	0x0e7f, 0x007c, 0x2071, 0xa600, 0x70d4, 0xa005, 0x0040, 0x28b7,
+	0x8001, 0x70d6, 0x0078, 0x28b7, 0x6000, 0xc08c, 0x6002, 0x007c,
+	0x0f7e, 0x0e7e, 0x0c7e, 0x037e, 0x027e, 0x017e, 0x157e, 0x2178,
+	0x81ff, 0x00c0, 0x28d7, 0x20a9, 0x0001, 0x0078, 0x28f2, 0x2001,
+	0xa653, 0x2004, 0xd0c4, 0x0040, 0x28ee, 0xd0a4, 0x0040, 0x28ee,
+	0x047e, 0x6018, 0xa080, 0x0028, 0x2024, 0xa4a4, 0x00ff, 0x8427,
+	0xa006, 0x2009, 0x002d, 0x1078, 0xa21d, 0x047f, 0x20a9, 0x00ff,
+	0x2011, 0x0000, 0x027e, 0xa28e, 0x007e, 0x0040, 0x2936, 0xa28e,
+	0x007f, 0x0040, 0x2936, 0xa28e, 0x0080, 0x0040, 0x2936, 0xa288,
+	0xa735, 0x210c, 0x81ff, 0x0040, 0x2936, 0x8fff, 0x1040, 0x2942,
+	0x0c7e, 0x2160, 0x2001, 0x0001, 0x1078, 0x4972, 0x0c7f, 0x2019,
+	0x0029, 0x1078, 0x5f01, 0x077e, 0x2039, 0x0000, 0x1078, 0x5e0a,
+	0x0c7e, 0x027e, 0x2160, 0x6204, 0xa294, 0x00ff, 0xa286, 0x0006,
+	0x00c0, 0x2926, 0x6007, 0x0404, 0x0078, 0x292b, 0x2001, 0x0004,
+	0x8007, 0xa215, 0x6206, 0x027f, 0x0c7f, 0x017e, 0x2c08, 0x1078,
+	0x9f8b, 0x017f, 0x077f, 0x2160, 0x1078, 0x47e9, 0x027f, 0x8210,
+	0x00f0, 0x28f2, 0x157f, 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f,
+	0x0f7f, 0x007c, 0x047e, 0x027e, 0x017e, 0x2001, 0xa653, 0x2004,
+	0xd0c4, 0x0040, 0x2955, 0xd0a4, 0x0040, 0x2955, 0xa006, 0x2220,
+	0x8427, 0x2009, 0x0029, 0x1078, 0xa21d, 0x017f, 0x027f, 0x047f,
+	0x007c, 0x017e, 0x027e, 0x037e, 0x0c7e, 0x7284, 0x82ff, 0x0040,
+	0x2987, 0xa290, 0xa653, 0x2214, 0xd2ac, 0x00c0, 0x2987, 0x2100,
+	0x1078, 0x2564, 0x81ff, 0x0040, 0x2989, 0x2019, 0x0001, 0x8314,
+	0xa2e0, 0xacc0, 0x2c04, 0xd384, 0x0040, 0x297b, 0xa084, 0xff00,
+	0x8007, 0x0078, 0x297d, 0xa084, 0x00ff, 0xa116, 0x0040, 0x2989,
+	0xa096, 0x00ff, 0x0040, 0x2987, 0x8318, 0x0078, 0x296f, 0xa085,
+	0x0001, 0x0c7f, 0x037f, 0x027f, 0x017f, 0x007c, 0x017e, 0x0c7e,
+	0x127e, 0x2091, 0x8000, 0x017e, 0x027e, 0x037e, 0x2110, 0x027e,
+	0x2019, 0x0029, 0x1078, 0x73d0, 0x027f, 0x1078, 0xa4f1, 0x037f,
+	0x027f, 0x017f, 0xa180, 0xa735, 0x2004, 0xa065, 0x0040, 0x29b7,
+	0x017e, 0x0c7e, 0x1078, 0x9187, 0x017f, 0x1040, 0x1332, 0x611a,
+	0x1078, 0x2880, 0x1078, 0x772d, 0x017f, 0x1078, 0x457f, 0x127f,
+	0x0c7f, 0x017f, 0x007c, 0x2001, 0xa633, 0x2004, 0xd0cc, 0x007c,
+	0x7eef, 0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0, 0x80dc, 0x80da,
+	0x7ad9, 0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2, 0x80d1, 0x79ce,
+	0x78cd, 0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7, 0x80c6, 0x77c5,
+	0x76c3, 0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5, 0x73b4, 0x72b3,
+	0x80b2, 0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab, 0x6faa, 0x6ea9,
+	0x80a7, 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e, 0x689d, 0x809b,
+	0x8098, 0x6797, 0x6690, 0x658f, 0x6488, 0x6384, 0x6282, 0x8081,
+	0x8080, 0x617c, 0x607a, 0x8079, 0x5f76, 0x8075, 0x8074, 0x8073,
+	0x8072, 0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b, 0x5c6a, 0x5b69,
+	0x8067, 0x5a66, 0x5965, 0x5863, 0x575c, 0x565a, 0x5559, 0x8056,
+	0x8055, 0x5454, 0x5353, 0x5252, 0x5151, 0x504e, 0x4f4d, 0x804c,
+	0x804b, 0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045, 0x8043, 0x803c,
+	0x803a, 0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33, 0x4932, 0x4831,
+	0x802e, 0x472d, 0x462c, 0x452b, 0x442a, 0x4329, 0x4227, 0x8026,
+	0x8025, 0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b, 0x3c18, 0x8017,
+	0x8010, 0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001, 0x8000, 0x8000,
+	0x3800, 0x3700, 0x3600, 0x8000, 0x3500, 0x8000, 0x8000, 0x8000,
+	0x3400, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3300,
+	0x3200, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3100,
+	0x3000, 0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00, 0x2d00, 0x2c00,
+	0x8000, 0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00, 0x2900, 0x2800,
+	0x8000, 0x2700, 0x2600, 0x2500, 0x2400, 0x2300, 0x2200, 0x8000,
+	0x8000, 0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x8000,
+	0x8000, 0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x8000, 0x1800, 0x8000, 0x1700, 0x1600, 0x1500,
+	0x8000, 0x1400, 0x1300, 0x1200, 0x1100, 0x1000, 0x0f00, 0x8000,
+	0x8000, 0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00, 0x0900, 0x8000,
+	0x8000, 0x0800, 0x0700, 0x8000, 0x0600, 0x8000, 0x8000, 0x8000,
+	0x0500, 0x0400, 0x0300, 0x8000, 0x0200, 0x8000, 0x8000, 0x8000,
+	0x0100, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x2071, 0xa682, 0x7003, 0x0002, 0xa006, 0x7012, 0x7016, 0x703a,
+	0x703e, 0x7033, 0xa692, 0x7037, 0xa692, 0x7007, 0x0001, 0x2061,
+	0xa6d2, 0x6003, 0x0002, 0x007c, 0x0090, 0x2ae7, 0x0068, 0x2ae7,
+	0x2071, 0xa682, 0x2b78, 0x7818, 0xd084, 0x00c0, 0x2ae7, 0x2a60,
+	0x7820, 0xa08e, 0x0069, 0x00c0, 0x2bd7, 0x0079, 0x2b6b, 0x007c,
+	0x2071, 0xa682, 0x7004, 0x0079, 0x2aed, 0x2af1, 0x2af2, 0x2afc,
+	0x2b0e, 0x007c, 0x0090, 0x2afb, 0x0068, 0x2afb, 0x2b78, 0x7818,
+	0xd084, 0x0040, 0x2b1a, 0x007c, 0x2b78, 0x2061, 0xa6d2, 0x6008,
+	0xa08e, 0x0100, 0x0040, 0x2b09, 0xa086, 0x0200, 0x0040, 0x2bcf,
+	0x007c, 0x7014, 0x2068, 0x2a60, 0x7018, 0x007a, 0x7010, 0x2068,
+	0x6834, 0xa086, 0x0103, 0x0040, 0x2b16, 0x007c, 0x2a60, 0x2b78,
+	0x7018, 0x007a, 0x2a60, 0x7820, 0xa08a, 0x0040, 0x00c8, 0x2b23,
+	0x61bc, 0x0079, 0x2b2b, 0x2100, 0xa08a, 0x003f, 0x00c8, 0x2bcb,
+	0x61bc, 0x0079, 0x2b6b, 0x2bad, 0x2bdf, 0x2be7, 0x2beb, 0x2bf3,
+	0x2bf9, 0x2bfd, 0x2c09, 0x2c0d, 0x2c17, 0x2c1b, 0x2bcb, 0x2bcb,
+	0x2bcb, 0x2c1f, 0x2bcb, 0x2c2f, 0x2c46, 0x2c5d, 0x2cdd, 0x2ce2,
+	0x2d0f, 0x2d69, 0x2d7a, 0x2d98, 0x2dd9, 0x2de3, 0x2df0, 0x2e03,
+	0x2e22, 0x2e2b, 0x2e68, 0x2e6e, 0x2bcb, 0x2e8a, 0x2bcb, 0x2bcb,
+	0x2bcb, 0x2bcb, 0x2bcb, 0x2e91, 0x2e9b, 0x2bcb, 0x2bcb, 0x2bcb,
+	0x2bcb, 0x2bcb, 0x2bcb, 0x2bcb, 0x2bcb, 0x2ea3, 0x2bcb, 0x2bcb,
+	0x2bcb, 0x2bcb, 0x2bcb, 0x2eb5, 0x2ece, 0x2bcb, 0x2bcb, 0x2bcb,
+	0x2bcb, 0x2bcb, 0x2bcb, 0x2ee0, 0x2f37, 0x2f95, 0x2fa9, 0x2bcb,
+	0x2bcb, 0x2bcb, 0x398e, 0x2bcb, 0x2bcb, 0x2bcb, 0x2bcb, 0x2bcb,
+	0x2bcb, 0x2bcb, 0x2bcb, 0x2c17, 0x2c1b, 0x2fc0, 0x2bcb, 0x2fcd,
+	0x3a26, 0x3a83, 0x2bcb, 0x2bcb, 0x2bcb, 0x2bcb, 0x2bcb, 0x2bcb,
+	0x2bcb, 0x2bcb, 0x2bcb, 0x301a, 0x314f, 0x316b, 0x3177, 0x31da,
+	0x3233, 0x323e, 0x327d, 0x328c, 0x329b, 0x329e, 0x2fd1, 0x32c2,
+	0x331e, 0x332b, 0x343c, 0x356f, 0x3599, 0x36a6, 0x2bcb, 0x36b6,
+	0x36f0, 0x37bf, 0x2bcb, 0x2bcb, 0x2bcb, 0x2bcb, 0x3827, 0x3843,
+	0x38bd, 0x3977, 0x713c, 0x0078, 0x2bad, 0x2021, 0x4000, 0x1078,
+	0x35f5, 0x127e, 0x2091, 0x8000, 0x0068, 0x2bba, 0x7818, 0xd084,
+	0x0040, 0x2bbd, 0x127f, 0x0078, 0x2bb1, 0x7c22, 0x7926, 0x7a2a,
+	0x7b2e, 0x781b, 0x0001, 0x2091, 0x4080, 0x7007, 0x0001, 0x2091,
+	0x5000, 0x127f, 0x007c, 0x2021, 0x4001, 0x0078, 0x2baf, 0x2021,
+	0x4002, 0x0078, 0x2baf, 0x2021, 0x4003, 0x0078, 0x2baf, 0x2021,
+	0x4005, 0x0078, 0x2baf, 0x2021, 0x4006, 0x0078, 0x2baf, 0xa02e,
+	0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078, 0x3604, 0x7823,
+	0x0004, 0x7824, 0x007a, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824,
+	0x7930, 0x0078, 0x3608, 0x7924, 0x7828, 0x2114, 0x200a, 0x0078,
+	0x2bad, 0x7924, 0x2114, 0x0078, 0x2bad, 0x2099, 0x0009, 0x20a1,
+	0x0009, 0x20a9, 0x0007, 0x53a3, 0x7924, 0x7a28, 0x7b2c, 0x0078,
+	0x2bad, 0x7824, 0x2060, 0x0078, 0x2c21, 0x2009, 0x0001, 0x2011,
+	0x0013, 0x2019, 0x0018, 0x783b, 0x0017, 0x0078, 0x2bad, 0x7d38,
+	0x7c3c, 0x0078, 0x2be1, 0x7d38, 0x7c3c, 0x0078, 0x2bed, 0x2061,
+	0x1000, 0x610c, 0xa006, 0x2c14, 0xa200, 0x8c60, 0x8109, 0x00c0,
+	0x2c23, 0x2010, 0xa005, 0x0040, 0x2bad, 0x0078, 0x2bd3, 0x2069,
+	0xa652, 0x7824, 0x7930, 0xa11a, 0x00c8, 0x2bdb, 0x8019, 0x0040,
+	0x2bdb, 0x684a, 0x6942, 0x782c, 0x6852, 0x7828, 0x6856, 0xa006,
+	0x685a, 0x685e, 0x1078, 0x4eae, 0x0078, 0x2bad, 0x2069, 0xa652,
+	0x7824, 0x7934, 0xa11a, 0x00c8, 0x2bdb, 0x8019, 0x0040, 0x2bdb,
+	0x684e, 0x6946, 0x782c, 0x6862, 0x7828, 0x6866, 0xa006, 0x686a,
+	0x686e, 0x1078, 0x4a3e, 0x0078, 0x2bad, 0xa02e, 0x2520, 0x81ff,
+	0x00c0, 0x2bd7, 0x7924, 0x7b28, 0x7a2c, 0x20a9, 0x0005, 0x20a1,
+	0xa689, 0x41a1, 0x1078, 0x35ba, 0x0040, 0x2bd7, 0x2009, 0x0020,
+	0x1078, 0x3604, 0x701b, 0x2c75, 0x007c, 0x6834, 0x2008, 0xa084,
+	0x00ff, 0xa096, 0x0011, 0x0040, 0x2c85, 0xa096, 0x0019, 0x0040,
+	0x2c85, 0xa096, 0x0015, 0x00c0, 0x2bd7, 0x810f, 0xa18c, 0x00ff,
+	0x0040, 0x2bd7, 0x710e, 0x700c, 0x8001, 0x0040, 0x2cb6, 0x700e,
+	0x1078, 0x35ba, 0x0040, 0x2bd7, 0x2009, 0x0020, 0x2061, 0xa6d2,
+	0x6224, 0x6328, 0x642c, 0x6530, 0xa290, 0x0040, 0xa399, 0x0000,
+	0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x1078, 0x3604, 0x701b, 0x2ca9,
+	0x007c, 0x6834, 0xa084, 0x00ff, 0xa096, 0x0002, 0x0040, 0x2cb4,
+	0xa096, 0x000a, 0x00c0, 0x2bd7, 0x0078, 0x2c8b, 0x7010, 0x2068,
+	0x6838, 0xc0fd, 0x683a, 0x1078, 0x4431, 0x00c0, 0x2cc4, 0x7007,
+	0x0003, 0x701b, 0x2cc6, 0x007c, 0x1078, 0x4b51, 0x127e, 0x2091,
+	0x8000, 0x20a9, 0x0005, 0x2099, 0xa689, 0x530a, 0x2100, 0xa210,
+	0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0xad80, 0x000d,
+	0x2009, 0x0020, 0x127f, 0x0078, 0x3608, 0x61a4, 0x7824, 0x60a6,
+	0x0078, 0x2bad, 0x2091, 0x8000, 0x7823, 0x4000, 0x7827, 0x4953,
+	0x782b, 0x5020, 0x782f, 0x2020, 0x2009, 0x017f, 0x2104, 0x7832,
+	0x3f00, 0x7836, 0x2061, 0x0100, 0x6200, 0x2061, 0x0200, 0x603c,
+	0x8007, 0xa205, 0x783a, 0x2009, 0x04fd, 0x2104, 0x783e, 0x781b,
+	0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2071, 0x0010, 0x20c1,
+	0x00f0, 0xa08a, 0x0003, 0x00c8, 0x0427, 0x0078, 0x0423, 0x81ff,
+	0x00c0, 0x2bd7, 0x7924, 0x810f, 0xa18c, 0x00ff, 0x1078, 0x45c4,
+	0x00c0, 0x2bdb, 0x7e38, 0xa684, 0x3fff, 0xa082, 0x4000, 0x0048,
+	0x2d23, 0x0078, 0x2bdb, 0x7c28, 0x7d2c, 0x1078, 0x47a4, 0xd28c,
+	0x00c0, 0x2d2e, 0x1078, 0x4736, 0x0078, 0x2d30, 0x1078, 0x4772,
+	0x00c0, 0x2d5a, 0x2061, 0xad00, 0x127e, 0x2091, 0x8000, 0x6000,
+	0xa086, 0x0000, 0x0040, 0x2d48, 0x6010, 0xa06d, 0x0040, 0x2d48,
+	0x683c, 0xa406, 0x00c0, 0x2d48, 0x6840, 0xa506, 0x0040, 0x2d53,
+	0x127f, 0xace0, 0x0010, 0x2001, 0xa616, 0x2004, 0xac02, 0x00c8,
+	0x2bd7, 0x0078, 0x2d34, 0x1078, 0x8a01, 0x127f, 0x0040, 0x2bd7,
+	0x0078, 0x2bad, 0xa00e, 0x2001, 0x0005, 0x1078, 0x4b51, 0x127e,
+	0x2091, 0x8000, 0x1078, 0x8f85, 0x1078, 0x4a73, 0x127f, 0x0078,
+	0x2bad, 0x81ff, 0x00c0, 0x2bd7, 0x1078, 0x35d2, 0x0040, 0x2bdb,
+	0x1078, 0x4673, 0x0040, 0x2bd7, 0x1078, 0x47b2, 0x0040, 0x2bd7,
+	0x0078, 0x2bad, 0x81ff, 0x00c0, 0x2bd7, 0x1078, 0x35e4, 0x0040,
+	0x2bdb, 0x1078, 0x482f, 0x0040, 0x2bd7, 0x2019, 0x0005, 0x1078,
+	0x47d3, 0x0040, 0x2bd7, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2bdb,
+	0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x5a52, 0x0078, 0x2bad,
+	0x127e, 0x2091, 0x8000, 0x81ff, 0x0040, 0x2da2, 0x2009, 0x0001,
+	0x0078, 0x2dd3, 0x2029, 0x00ff, 0x6450, 0x2400, 0xa506, 0x0040,
+	0x2dcd, 0x2508, 0x1078, 0x45c4, 0x00c0, 0x2dcd, 0x1078, 0x482f,
+	0x00c0, 0x2db8, 0x2009, 0x0002, 0x62ac, 0x2518, 0x0078, 0x2dd3,
+	0x2019, 0x0004, 0x1078, 0x47d3, 0x00c0, 0x2dc2, 0x2009, 0x0006,
+	0x0078, 0x2dd3, 0x7824, 0xa08a, 0x1000, 0x00c8, 0x2dd6, 0x8003,
+	0x800b, 0x810b, 0xa108, 0x1078, 0x5a52, 0x8529, 0x00c8, 0x2da5,
+	0x127f, 0x0078, 0x2bad, 0x127f, 0x0078, 0x2bd7, 0x127f, 0x0078,
+	0x2bdb, 0x1078, 0x35d2, 0x0040, 0x2bdb, 0x1078, 0x46e7, 0x1078,
+	0x47a4, 0x0078, 0x2bad, 0x81ff, 0x00c0, 0x2bd7, 0x1078, 0x35d2,
+	0x0040, 0x2bdb, 0x1078, 0x46d6, 0x1078, 0x47a4, 0x0078, 0x2bad,
+	0x81ff, 0x00c0, 0x2bd7, 0x1078, 0x35d2, 0x0040, 0x2bdb, 0x1078,
+	0x4775, 0x0040, 0x2bd7, 0x1078, 0x4484, 0x1078, 0x472f, 0x1078,
+	0x47a4, 0x0078, 0x2bad, 0x1078, 0x35d2, 0x0040, 0x2bdb, 0x1078,
+	0x4673, 0x0040, 0x2bd7, 0x62a0, 0x2019, 0x0005, 0x0c7e, 0x1078,
+	0x47e9, 0x0c7f, 0x1078, 0x5f01, 0x077e, 0x2039, 0x0000, 0x1078,
+	0x5e0a, 0x2009, 0x0000, 0x1078, 0x9f8b, 0x077f, 0x1078, 0x47a4,
+	0x0078, 0x2bad, 0x1078, 0x35d2, 0x0040, 0x2bdb, 0x1078, 0x47a4,
+	0x2208, 0x0078, 0x2bad, 0x157e, 0x0d7e, 0x0e7e, 0x2069, 0xa714,
+	0x6810, 0x6914, 0xa10a, 0x00c8, 0x2e37, 0x2009, 0x0000, 0x6816,
+	0x2011, 0x0000, 0x2019, 0x0000, 0x20a9, 0x00ff, 0x2069, 0xa735,
+	0x2d04, 0xa075, 0x0040, 0x2e4c, 0x704c, 0x1078, 0x2e56, 0xa210,
+	0x7080, 0x1078, 0x2e56, 0xa318, 0x8d68, 0x00f0, 0x2e40, 0x2300,
+	0xa218, 0x0e7f, 0x0d7f, 0x157f, 0x0078, 0x2bad, 0x0f7e, 0x017e,
+	0xa07d, 0x0040, 0x2e65, 0x2001, 0x0000, 0x8000, 0x2f0c, 0x81ff,
+	0x0040, 0x2e65, 0x2178, 0x0078, 0x2e5d, 0x017f, 0x0f7f, 0x007c,
+	0x2069, 0xa714, 0x6910, 0x62a8, 0x0078, 0x2bad, 0x81ff, 0x00c0,
+	0x2bd7, 0x6150, 0xa190, 0x29c0, 0x2214, 0xa294, 0x00ff, 0x6070,
+	0xa084, 0xff00, 0xa215, 0x636c, 0x67cc, 0xd79c, 0x0040, 0x2e84,
+	0x2031, 0x0001, 0x0078, 0x2e86, 0x2031, 0x0000, 0x7e3a, 0x7f3e,
+	0x0078, 0x2bad, 0x6140, 0x6244, 0x2019, 0xa8a2, 0x231c, 0x0078,
+	0x2bad, 0x127e, 0x2091, 0x8000, 0x6134, 0x6338, 0xa006, 0x2010,
+	0x127f, 0x0078, 0x2bad, 0x1078, 0x35e4, 0x0040, 0x2bdb, 0x6244,
+	0x6338, 0x0078, 0x2bad, 0x6140, 0x6244, 0x7824, 0x6042, 0x7b28,
+	0x6346, 0x2069, 0xa652, 0x831f, 0xa305, 0x6816, 0x782c, 0x2069,
+	0xa8a2, 0x2d1c, 0x206a, 0x0078, 0x2bad, 0x017e, 0x127e, 0x2091,
+	0x8000, 0x7824, 0x6036, 0xd094, 0x0040, 0x2ec8, 0x7828, 0xa085,
+	0x0001, 0x2009, 0xa8ab, 0x200a, 0x2001, 0xffff, 0x1078, 0x5ae6,
+	0x782c, 0x603a, 0x127f, 0x017f, 0x0078, 0x2bad, 0x1078, 0x35e4,
+	0x0040, 0x2bdb, 0x7828, 0xa00d, 0x0040, 0x2bdb, 0x782c, 0xa005,
+	0x0040, 0x2bdb, 0x6244, 0x6146, 0x6338, 0x603a, 0x0078, 0x2bad,
+	0x2001, 0xa600, 0x2004, 0xa086, 0x0003, 0x00c0, 0x2bd7, 0x0c7e,
+	0x2061, 0x0100, 0x7924, 0x810f, 0xa18c, 0x00ff, 0xa196, 0x00ff,
+	0x00c0, 0x2ef7, 0x6030, 0xa085, 0xff00, 0x0078, 0x2f06, 0xa182,
+	0x007f, 0x00c8, 0x2f30, 0xa188, 0x29c0, 0x210c, 0xa18c, 0x00ff,
+	0x6030, 0xa116, 0x0040, 0x2f30, 0x810f, 0xa105, 0x127e, 0x2091,
+	0x8000, 0x007e, 0x1078, 0x76c7, 0x007f, 0x0040, 0x2f2c, 0x601a,
+	0x600b, 0xbc09, 0x601f, 0x0001, 0x1078, 0x35ba, 0x0040, 0x2f33,
+	0x6837, 0x0000, 0x7007, 0x0003, 0x6833, 0x0000, 0x6838, 0xc0fd,
+	0x683a, 0x701b, 0x2f8e, 0x2d00, 0x6012, 0x2009, 0x0032, 0x1078,
+	0x775c, 0x127f, 0x0c7f, 0x007c, 0x127f, 0x0c7f, 0x0078, 0x2bd7,
+	0x0c7f, 0x0078, 0x2bdb, 0x1078, 0x772d, 0x0078, 0x2f2c, 0x2001,
+	0xa600, 0x2004, 0xa086, 0x0003, 0x00c0, 0x2bd7, 0x0c7e, 0x2061,
+	0x0100, 0x7924, 0x810f, 0xa18c, 0x00ff, 0xa196, 0x00ff, 0x00c0,
+	0x2f4e, 0x6030, 0xa085, 0xff00, 0x0078, 0x2f5d, 0xa182, 0x007f,
+	0x00c8, 0x2f87, 0xa188, 0x29c0, 0x210c, 0xa18c, 0x00ff, 0x6030,
+	0xa116, 0x0040, 0x2f87, 0x810f, 0xa105, 0x127e, 0x2091, 0x8000,
+	0x007e, 0x1078, 0x76c7, 0x007f, 0x0040, 0x2f83, 0x601a, 0x600b,
+	0xbc05, 0x601f, 0x0001, 0x1078, 0x35ba, 0x0040, 0x2f8a, 0x6837,
+	0x0000, 0x7007, 0x0003, 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a,
+	0x701b, 0x2f8e, 0x2d00, 0x6012, 0x2009, 0x0032, 0x1078, 0x775c,
+	0x127f, 0x0c7f, 0x007c, 0x127f, 0x0c7f, 0x0078, 0x2bd7, 0x0c7f,
+	0x0078, 0x2bdb, 0x1078, 0x772d, 0x0078, 0x2f83, 0x6830, 0xa086,
+	0x0100, 0x0040, 0x2bd7, 0x0078, 0x2bad, 0x2061, 0xa933, 0x127e,
+	0x2091, 0x8000, 0x6000, 0xd084, 0x0040, 0x2fa6, 0x6104, 0x6208,
+	0x2019, 0xa612, 0x231c, 0x127f, 0x0078, 0x2bad, 0x127f, 0x0078,
+	0x2bdb, 0x81ff, 0x00c0, 0x2bd7, 0x127e, 0x2091, 0x8000, 0x6248,
+	0x6064, 0xa202, 0x0048, 0x2fbd, 0xa085, 0x0001, 0x1078, 0x256a,
+	0x1078, 0x3c9e, 0x127f, 0x0078, 0x2bad, 0x127f, 0x0078, 0x2bdb,
+	0x127e, 0x2091, 0x8000, 0x20a9, 0x0012, 0x2001, 0xa640, 0x20a0,
+	0xa006, 0x40a4, 0x127f, 0x0078, 0x2bad, 0x7d38, 0x7c3c, 0x0078,
+	0x2c5f, 0x7824, 0xa09c, 0x00ff, 0xa39a, 0x0003, 0x00c8, 0x2bd7,
+	0x6250, 0xa084, 0xff00, 0x8007, 0xa206, 0x00c0, 0x2fe9, 0x2001,
+	0xa640, 0x2009, 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078,
+	0x3608, 0x81ff, 0x00c0, 0x2bd7, 0x1078, 0x35e4, 0x0040, 0x2bdb,
+	0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2bd7, 0x0c7e,
+	0x1078, 0x35ba, 0x0c7f, 0x0040, 0x2bd7, 0x6837, 0x0000, 0x6838,
+	0xc0fd, 0x683a, 0x1078, 0x8e4a, 0x0040, 0x2bd7, 0x7007, 0x0003,
+	0x701b, 0x300b, 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x2bd7,
+	0xad80, 0x000e, 0x2009, 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38,
+	0x0078, 0x3608, 0x1078, 0x35ba, 0x0040, 0x2bd7, 0x1078, 0x42dd,
+	0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x3604,
+	0x701b, 0x302b, 0x007c, 0xade8, 0x000d, 0x6800, 0xa005, 0x0040,
+	0x2bdb, 0x6804, 0xd0ac, 0x0040, 0x3038, 0xd0a4, 0x0040, 0x2bdb,
+	0xd094, 0x0040, 0x3043, 0x0c7e, 0x2061, 0x0100, 0x6104, 0xa18c,
+	0xffdf, 0x6106, 0x0c7f, 0xd08c, 0x0040, 0x304e, 0x0c7e, 0x2061,
+	0x0100, 0x6104, 0xa18d, 0x0010, 0x6106, 0x0c7f, 0x2009, 0x0100,
+	0x210c, 0xa18a, 0x0002, 0x0048, 0x3063, 0xd084, 0x0040, 0x3063,
+	0x6a28, 0xa28a, 0x007f, 0x00c8, 0x2bdb, 0xa288, 0x29c0, 0x210c,
+	0xa18c, 0x00ff, 0x6156, 0xd0dc, 0x0040, 0x306c, 0x6828, 0xa08a,
+	0x007f, 0x00c8, 0x2bdb, 0x6052, 0x6808, 0xa08a, 0x0100, 0x0048,
+	0x2bdb, 0xa08a, 0x0841, 0x00c8, 0x2bdb, 0xa084, 0x0007, 0x00c0,
+	0x2bdb, 0x680c, 0xa005, 0x0040, 0x2bdb, 0x6810, 0xa005, 0x0040,
+	0x2bdb, 0x6848, 0x6940, 0xa10a, 0x00c8, 0x2bdb, 0x8001, 0x0040,
+	0x2bdb, 0x684c, 0x6944, 0xa10a, 0x00c8, 0x2bdb, 0x8001, 0x0040,
+	0x2bdb, 0x6804, 0xd0fc, 0x0040, 0x30c2, 0x1078, 0x35ba, 0x0040,
+	0x2bd7, 0x2009, 0x0014, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0xa290,
+	0x0038, 0xa399, 0x0000, 0x1078, 0x3604, 0x701b, 0x30a8, 0x007c,
+	0xade8, 0x000d, 0x20a9, 0x0014, 0x2d98, 0x2069, 0xa66e, 0x2da0,
+	0x53a3, 0x7010, 0xa0e8, 0x000d, 0x2001, 0xa672, 0x200c, 0xd1e4,
+	0x0040, 0x30c2, 0x0c7e, 0x2061, 0x0100, 0x6004, 0xa085, 0x0b00,
+	0x6006, 0x0c7f, 0x20a9, 0x001c, 0x2d98, 0x2069, 0xa652, 0x2da0,
+	0x53a3, 0x6814, 0xa08c, 0x00ff, 0x6142, 0x8007, 0xa084, 0x00ff,
+	0x6046, 0x1078, 0x4eae, 0x1078, 0x49ce, 0x1078, 0x4a3e, 0x6000,
+	0xa086, 0x0000, 0x00c0, 0x314d, 0x6808, 0x602a, 0x1078, 0x21f7,
+	0x6818, 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f,
+	0x6016, 0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0040, 0x30fa,
+	0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217, 0x831f,
+	0x0078, 0x30fc, 0xa084, 0xf0ff, 0x6006, 0x610a, 0x620e, 0x6312,
+	0x1078, 0x5b19, 0x6904, 0xd1fc, 0x0040, 0x312f, 0x0c7e, 0x2009,
+	0x0000, 0x20a9, 0x0001, 0x6b70, 0xd384, 0x0040, 0x312c, 0x0078,
+	0x3116, 0x839d, 0x00c8, 0x312c, 0x3508, 0x8109, 0x1078, 0x5480,
+	0x6878, 0x6016, 0x6874, 0x2008, 0xa084, 0xff00, 0x8007, 0x600a,
+	0xa184, 0x00ff, 0x6006, 0x8108, 0x00c0, 0x312a, 0x6003, 0x0003,
+	0x0078, 0x312c, 0x6003, 0x0001, 0x00f0, 0x3111, 0x0c7f, 0x0c7e,
+	0x2061, 0x0100, 0x602f, 0x0040, 0x602f, 0x0000, 0x0c7f, 0x1078,
+	0x3819, 0x0040, 0x313d, 0x1078, 0x256a, 0x60c0, 0xa005, 0x0040,
+	0x3149, 0x6003, 0x0001, 0x2091, 0x301d, 0x1078, 0x4224, 0x0078,
+	0x314d, 0x6003, 0x0004, 0x2091, 0x301d, 0x0078, 0x2bad, 0x6000,
+	0xa086, 0x0000, 0x0040, 0x2bd7, 0x2069, 0xa652, 0x7830, 0x6842,
+	0x7834, 0x6846, 0x6804, 0xd0fc, 0x0040, 0x3162, 0x2009, 0x0030,
+	0x0078, 0x3164, 0x2009, 0x001c, 0x2d00, 0x7a2c, 0x7b28, 0x7c3c,
+	0x7d38, 0x0078, 0x3608, 0xa006, 0x1078, 0x256a, 0x81ff, 0x00c0,
+	0x2bd7, 0x1078, 0x42dd, 0x1078, 0x4224, 0x0078, 0x2bad, 0x81ff,
+	0x00c0, 0x2bd7, 0x6184, 0x81ff, 0x0040, 0x3191, 0x703f, 0x0000,
+	0x2001, 0xacc0, 0x2009, 0x0040, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38,
+	0x127e, 0x2091, 0x8000, 0x1078, 0x3608, 0x701b, 0x2baa, 0x127f,
+	0x007c, 0x703f, 0x0001, 0x0d7e, 0x2069, 0xacc0, 0x20a9, 0x0040,
+	0x20a1, 0xacc0, 0x2019, 0xffff, 0x43a4, 0x6550, 0xa588, 0x29c0,
+	0x210c, 0xa18c, 0x00ff, 0x216a, 0xa00e, 0x2011, 0x0002, 0x2100,
+	0xa506, 0x0040, 0x31c3, 0x1078, 0x45c4, 0x00c0, 0x31c3, 0x6014,
+	0x821c, 0x0048, 0x31bb, 0xa398, 0xacc0, 0xa085, 0xff00, 0x8007,
+	0x201a, 0x0078, 0x31c2, 0xa398, 0xacc0, 0x2324, 0xa4a4, 0xff00,
+	0xa405, 0x201a, 0x8210, 0x8108, 0xa182, 0x0080, 0x00c8, 0x31ca,
+	0x0078, 0x31a7, 0x8201, 0x8007, 0x2d0c, 0xa105, 0x206a, 0x0d7f,
+	0x20a9, 0x0040, 0x20a1, 0xacc0, 0x2099, 0xacc0, 0x1078, 0x4281,
+	0x0078, 0x3180, 0x1078, 0x35e4, 0x0040, 0x2bdb, 0x0c7e, 0x1078,
+	0x35ba, 0x0c7f, 0x00c0, 0x31e8, 0x2009, 0x0002, 0x0078, 0x2bd7,
+	0x2001, 0xa653, 0x2004, 0xd0b4, 0x0040, 0x320f, 0x6000, 0xd08c,
+	0x00c0, 0x320f, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
+	0x320f, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x8e9e,
+	0x00c0, 0x3206, 0x2009, 0x0003, 0x0078, 0x2bd7, 0x7007, 0x0003,
+	0x701b, 0x320b, 0x007c, 0x1078, 0x35e4, 0x0040, 0x2bdb, 0x20a9,
+	0x002b, 0x2c98, 0xade8, 0x0002, 0x2da0, 0x53a3, 0x20a9, 0x0004,
+	0xac80, 0x0006, 0x2098, 0xad80, 0x0006, 0x20a0, 0x1078, 0x4281,
+	0x20a9, 0x0004, 0xac80, 0x000a, 0x2098, 0xad80, 0x000a, 0x20a0,
+	0x1078, 0x4281, 0x2d00, 0x2009, 0x002b, 0x7a2c, 0x7b28, 0x7c3c,
+	0x7d38, 0x0078, 0x3608, 0x81ff, 0x00c0, 0x2bd7, 0x1078, 0x35d2,
+	0x0040, 0x2bdb, 0x1078, 0x47bd, 0x0078, 0x2bad, 0x81ff, 0x00c0,
+	0x2bd7, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2bdb, 0x1078, 0x35e4,
+	0x0040, 0x2bdb, 0x1078, 0x482f, 0x0040, 0x2bd7, 0x2019, 0x0004,
+	0x1078, 0x47d3, 0x7924, 0x810f, 0x7a28, 0x1078, 0x3259, 0x0078,
+	0x2bad, 0xa186, 0x00ff, 0x0040, 0x3261, 0x1078, 0x3271, 0x0078,
+	0x3270, 0x2029, 0x007e, 0x2061, 0xa600, 0x6450, 0x2400, 0xa506,
+	0x0040, 0x326d, 0x2508, 0x1078, 0x3271, 0x8529, 0x00c8, 0x3266,
+	0x007c, 0x1078, 0x45c4, 0x00c0, 0x327c, 0x2200, 0x8003, 0x800b,
+	0x810b, 0xa108, 0x1078, 0x5a52, 0x007c, 0x81ff, 0x00c0, 0x2bd7,
+	0x1078, 0x35d2, 0x0040, 0x2bdb, 0x1078, 0x4673, 0x0040, 0x2bd7,
+	0x1078, 0x47c8, 0x0078, 0x2bad, 0x81ff, 0x00c0, 0x2bd7, 0x1078,
+	0x35d2, 0x0040, 0x2bdb, 0x1078, 0x4673, 0x0040, 0x2bd7, 0x1078,
+	0x47b2, 0x0078, 0x2bad, 0x6100, 0x0078, 0x2bad, 0x1078, 0x35e4,
+	0x0040, 0x2bdb, 0x2001, 0xa600, 0x2004, 0xa086, 0x0003, 0x00c0,
+	0x2bd7, 0x0d7e, 0xace8, 0x000a, 0x7924, 0xd184, 0x0040, 0x32b2,
+	0xace8, 0x0006, 0x680c, 0x8007, 0x783e, 0x6808, 0x8007, 0x783a,
+	0x6b04, 0x831f, 0x6a00, 0x8217, 0x0d7f, 0x6100, 0xa18c, 0x0200,
+	0x0078, 0x2bad, 0xa006, 0x1078, 0x256a, 0x7824, 0xa084, 0x00ff,
+	0xa086, 0x00ff, 0x0040, 0x32cf, 0x81ff, 0x00c0, 0x2bd7, 0x1078,
+	0x42dd, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2bdb, 0x7924, 0xa18c,
+	0xff00, 0x810f, 0xa186, 0x00ff, 0x0040, 0x32e5, 0xa182, 0x007f,
+	0x00c8, 0x2bdb, 0x2100, 0x1078, 0x2564, 0x027e, 0x0c7e, 0x127e,
+	0x2091, 0x8000, 0x2061, 0xa8c4, 0x601b, 0x0000, 0x601f, 0x0000,
+	0x2011, 0x0003, 0x1078, 0x70e0, 0x2011, 0x0002, 0x1078, 0x70ea,
+	0x1078, 0x6fc4, 0x037e, 0x2019, 0x0000, 0x1078, 0x7058, 0x037f,
+	0x2061, 0x0100, 0x6030, 0xa084, 0x00ff, 0x810f, 0xa105, 0x604a,
+	0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x002d, 0x2011, 0x4259,
+	0x1078, 0x5add, 0x7924, 0xa18c, 0xff00, 0x810f, 0x7a28, 0x1078,
+	0x3259, 0x127f, 0x0c7f, 0x027f, 0x0078, 0x2bad, 0x7924, 0xa18c,
+	0xff00, 0x810f, 0x0c7e, 0x1078, 0x455c, 0x2c08, 0x0c7f, 0x00c0,
+	0x2bdb, 0x0078, 0x2bad, 0x81ff, 0x0040, 0x3332, 0x2009, 0x0001,
+	0x0078, 0x2bd7, 0x60cc, 0xd09c, 0x00c0, 0x333a, 0x2009, 0x0005,
+	0x0078, 0x2bd7, 0x1078, 0x35ba, 0x00c0, 0x3342, 0x2009, 0x0002,
+	0x0078, 0x2bd7, 0x7924, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078,
+	0x3604, 0x701b, 0x334c, 0x007c, 0x2009, 0x0080, 0x1078, 0x45c4,
+	0x00c0, 0x3359, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x0040,
+	0x335d, 0x2021, 0x400a, 0x0078, 0x2baf, 0x0d7e, 0xade8, 0x000d,
+	0x6900, 0x6a08, 0x6b0c, 0x6c10, 0x6d14, 0x6e18, 0x6820, 0xa0be,
+	0x0100, 0x0040, 0x33d0, 0xa0be, 0x0112, 0x0040, 0x33d0, 0xa0be,
+	0x0113, 0x0040, 0x33d0, 0xa0be, 0x0114, 0x0040, 0x33d0, 0xa0be,
+	0x0117, 0x0040, 0x33d0, 0xa0be, 0x011a, 0x0040, 0x33d0, 0xa0be,
+	0x0121, 0x0040, 0x33c6, 0xa0be, 0x0131, 0x0040, 0x33c6, 0xa0be,
+	0x0171, 0x0040, 0x33d0, 0xa0be, 0x0173, 0x0040, 0x33d0, 0xa0be,
+	0x01a1, 0x00c0, 0x3398, 0x6830, 0x8007, 0x6832, 0x0078, 0x33d6,
+	0xa0be, 0x0212, 0x0040, 0x33cc, 0xa0be, 0x0213, 0x0040, 0x33cc,
+	0xa0be, 0x0214, 0x0040, 0x33be, 0xa0be, 0x0217, 0x0040, 0x33b8,
+	0xa0be, 0x021a, 0x00c0, 0x33b1, 0x6838, 0x8007, 0x683a, 0x0078,
+	0x33d0, 0xa0be, 0x0300, 0x0040, 0x33d0, 0x0d7f, 0x0078, 0x2bdb,
+	0xad80, 0x0010, 0x20a9, 0x0007, 0x1078, 0x3418, 0xad80, 0x000e,
+	0x20a9, 0x0001, 0x1078, 0x3418, 0x0078, 0x33d0, 0xad80, 0x000c,
+	0x1078, 0x3426, 0x0078, 0x33d6, 0xad80, 0x000e, 0x1078, 0x3426,
+	0xad80, 0x000c, 0x20a9, 0x0001, 0x1078, 0x3418, 0x0c7e, 0x1078,
+	0x35ba, 0x0040, 0x3409, 0x6838, 0xc0fd, 0x683a, 0x6837, 0x0119,
+	0x6853, 0x0000, 0x684f, 0x0020, 0x685b, 0x0001, 0x810b, 0x697e,
+	0x6883, 0x0000, 0x6a86, 0x6b8a, 0x6c8e, 0x6d92, 0x6996, 0x689b,
+	0x0000, 0x0c7f, 0x0d7f, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a,
+	0x6823, 0x0000, 0x6804, 0x2068, 0x1078, 0x8e66, 0x00c0, 0x3404,
+	0x2009, 0x0003, 0x0078, 0x2bd7, 0x7007, 0x0003, 0x701b, 0x340f,
+	0x007c, 0x0c7f, 0x0d7f, 0x2009, 0x0002, 0x0078, 0x2bd7, 0x6820,
+	0xa086, 0x8001, 0x00c0, 0x2bad, 0x2009, 0x0004, 0x0078, 0x2bd7,
+	0x017e, 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x290a, 0x8108,
+	0x280a, 0x8108, 0x00f0, 0x341a, 0x017f, 0x007c, 0x017e, 0x0a7e,
+	0x0b7e, 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x2054, 0x8000,
+	0x205c, 0x2b0a, 0x8108, 0x2a0a, 0x8108, 0x290a, 0x8108, 0x280a,
+	0x0b7f, 0x0a7f, 0x017f, 0x007c, 0x81ff, 0x0040, 0x3443, 0x2009,
+	0x0001, 0x0078, 0x2bd7, 0x60cc, 0xd09c, 0x00c0, 0x344b, 0x2009,
+	0x0005, 0x0078, 0x2bd7, 0x7924, 0x2140, 0xa18c, 0xff00, 0x810f,
+	0xa182, 0x0080, 0x0048, 0x2bdb, 0xa182, 0x00ff, 0x00c8, 0x2bdb,
+	0x7a2c, 0x7b28, 0x606c, 0xa306, 0x00c0, 0x3466, 0x6070, 0xa24e,
+	0x0040, 0x2bdb, 0xa9cc, 0xff00, 0x0040, 0x2bdb, 0x0c7e, 0x1078,
+	0x350f, 0x2c68, 0x0c7f, 0x0040, 0x349e, 0xa0c6, 0x4000, 0x00c0,
+	0x3484, 0x0c7e, 0x007e, 0x2d60, 0x2009, 0x0000, 0x1078, 0x489b,
+	0x00c0, 0x347b, 0xc185, 0x6000, 0xd0bc, 0x0040, 0x3480, 0xc18d,
+	0x007f, 0x0c7f, 0x0078, 0x349b, 0xa0c6, 0x4007, 0x00c0, 0x348b,
+	0x2408, 0x0078, 0x349b, 0xa0c6, 0x4008, 0x00c0, 0x3493, 0x2708,
+	0x2610, 0x0078, 0x349b, 0xa0c6, 0x4009, 0x00c0, 0x3499, 0x0078,
+	0x349b, 0x2001, 0x4006, 0x2020, 0x0078, 0x2baf, 0x2d00, 0x7022,
+	0x017e, 0x0b7e, 0x0c7e, 0x0e7e, 0x2c70, 0x1078, 0x76c7, 0x0040,
+	0x34e4, 0x2d00, 0x601a, 0x2001, 0xa657, 0x2004, 0xa084, 0x00ff,
+	0x6842, 0x2e58, 0x0e7f, 0x0e7e, 0x0c7e, 0x1078, 0x35ba, 0x0c7f,
+	0x2b70, 0x00c0, 0x34c5, 0x1078, 0x772d, 0x0e7f, 0x0c7f, 0x0b7f,
+	0x017f, 0x2009, 0x0002, 0x0078, 0x2bd7, 0x6837, 0x0000, 0x2d00,
+	0x6012, 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x127e, 0x2091,
+	0x8000, 0x1078, 0x2880, 0x127f, 0x601f, 0x0001, 0x2001, 0x0000,
+	0x1078, 0x44ee, 0x2001, 0x0002, 0x1078, 0x4502, 0x2009, 0x0002,
+	0x1078, 0x775c, 0xa085, 0x0001, 0x0e7f, 0x0c7f, 0x0b7f, 0x017f,
+	0x00c0, 0x34ee, 0x2009, 0x0003, 0x0078, 0x2bd7, 0x7007, 0x0003,
+	0x701b, 0x34f3, 0x007c, 0x6830, 0xa086, 0x0100, 0x7020, 0x2060,
+	0x00c0, 0x3501, 0x2009, 0x0004, 0x6204, 0xa294, 0x00ff, 0x0078,
+	0x2bd7, 0x2009, 0x0000, 0x1078, 0x489b, 0x00c0, 0x3508, 0xc185,
+	0x6000, 0xd0bc, 0x0040, 0x350d, 0xc18d, 0x0078, 0x2bad, 0x0e7e,
+	0x0d7e, 0x2029, 0x0000, 0x2021, 0x0080, 0x20a9, 0x007f, 0x2071,
+	0xa7b5, 0x2e04, 0xa005, 0x00c0, 0x3524, 0x2100, 0xa406, 0x00c0,
+	0x3555, 0x2428, 0x0078, 0x3555, 0x2068, 0x6f10, 0x2700, 0xa306,
+	0x00c0, 0x3546, 0x6e14, 0x2600, 0xa206, 0x00c0, 0x3546, 0x2400,
+	0xa106, 0x00c0, 0x3542, 0x2d60, 0xd884, 0x0040, 0x356a, 0x6004,
+	0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x356a, 0x2001, 0x4000,
+	0x0078, 0x356b, 0x2001, 0x4007, 0x0078, 0x356b, 0x2400, 0xa106,
+	0x00c0, 0x3555, 0x6e14, 0x87ff, 0x00c0, 0x3551, 0x86ff, 0x0040,
+	0x3521, 0x2001, 0x4008, 0x0078, 0x356b, 0x8420, 0x8e70, 0x00f0,
+	0x3519, 0x85ff, 0x00c0, 0x3564, 0x2001, 0x4009, 0x0078, 0x356b,
+	0x2001, 0x0001, 0x0078, 0x356b, 0x1078, 0x455c, 0x00c0, 0x3560,
+	0x6312, 0x6216, 0xa006, 0xa005, 0x0d7f, 0x0e7f, 0x007c, 0x81ff,
+	0x00c0, 0x2bd7, 0x1078, 0x35ba, 0x0040, 0x2bd7, 0x6837, 0x0000,
+	0x6838, 0xc0fd, 0x683a, 0x7824, 0xa005, 0x0040, 0x2bdb, 0xa096,
+	0x00ff, 0x0040, 0x3587, 0xa092, 0x0004, 0x00c8, 0x2bdb, 0x2010,
+	0x2d18, 0x1078, 0x282f, 0x0040, 0x2bd7, 0x7007, 0x0003, 0x701b,
+	0x3592, 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x2bd7, 0x0078,
+	0x2bad, 0x7924, 0xa18c, 0xff00, 0x810f, 0xa182, 0x0080, 0x0048,
+	0x2bdb, 0xa182, 0x00ff, 0x00c8, 0x2bdb, 0x127e, 0x2091, 0x8000,
+	0x1078, 0x8d4b, 0x00c0, 0x35b7, 0xa190, 0xa735, 0x2204, 0xa065,
+	0x0040, 0x35b7, 0x1078, 0x42f8, 0x127f, 0x0078, 0x2bad, 0x127f,
+	0x0078, 0x2bd7, 0x1078, 0x138b, 0x0040, 0x35d1, 0xa006, 0x6802,
+	0x7010, 0xa005, 0x00c0, 0x35c9, 0x2d00, 0x7012, 0x7016, 0x0078,
+	0x35cf, 0x7014, 0x6802, 0x2060, 0x2d00, 0x6006, 0x7016, 0xad80,
+	0x000d, 0x007c, 0x7924, 0x810f, 0xa18c, 0x00ff, 0x1078, 0x45c4,
+	0x00c0, 0x35e1, 0x7e28, 0xa684, 0x3fff, 0xa082, 0x4000, 0x0048,
+	0x35e2, 0xa066, 0x8cff, 0x007c, 0x7e24, 0x860f, 0xa18c, 0x00ff,
+	0x1078, 0x45c4, 0x00c0, 0x35f2, 0xa6b4, 0x00ff, 0xa682, 0x4000,
+	0x0048, 0x35f3, 0xa066, 0x8cff, 0x007c, 0x017e, 0x7110, 0x81ff,
+	0x0040, 0x3600, 0x2168, 0x6904, 0x1078, 0x13a4, 0x0078, 0x35f7,
+	0x7112, 0x7116, 0x017f, 0x007c, 0x2031, 0x0001, 0x0078, 0x360a,
+	0x2031, 0x0000, 0x2061, 0xa6d2, 0x6606, 0x6112, 0x600e, 0x6226,
+	0x632a, 0x642e, 0x6532, 0x2c10, 0x1078, 0x13db, 0x7007, 0x0002,
+	0x701b, 0x2bad, 0x007c, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079,
+	0x0000, 0x2001, 0xa690, 0x2004, 0xa005, 0x00c0, 0x3636, 0x0068,
+	0x3636, 0x7818, 0xd084, 0x00c0, 0x3636, 0x7a22, 0x7b26, 0x7c2a,
+	0x781b, 0x0001, 0x2091, 0x4080, 0x0078, 0x365b, 0x017e, 0x0c7e,
+	0x0e7e, 0x2071, 0xa682, 0x7138, 0xa182, 0x0008, 0x0048, 0x3644,
+	0x7030, 0x2060, 0x0078, 0x3655, 0x7030, 0xa0e0, 0x0008, 0xac82,
+	0xa6d2, 0x0048, 0x364d, 0x2061, 0xa692, 0x2c00, 0x7032, 0x81ff,
+	0x00c0, 0x3653, 0x7036, 0x8108, 0x713a, 0x2262, 0x6306, 0x640a,
+	0x0e7f, 0x0c7f, 0x017f, 0x127f, 0x0f7f, 0x007c, 0x0e7e, 0x2071,
+	0xa682, 0x7038, 0xa005, 0x0040, 0x3697, 0x127e, 0x2091, 0x8000,
+	0x0068, 0x3696, 0x0f7e, 0x2079, 0x0000, 0x7818, 0xd084, 0x00c0,
+	0x3695, 0x0c7e, 0x7034, 0x2060, 0x2c04, 0x7822, 0x6004, 0x7826,
+	0x6008, 0x782a, 0x781b, 0x0001, 0x2091, 0x4080, 0x7038, 0x8001,
+	0x703a, 0xa005, 0x00c0, 0x368b, 0x7033, 0xa692, 0x7037, 0xa692,
+	0x0c7f, 0x0078, 0x3695, 0xac80, 0x0008, 0xa0fa, 0xa6d2, 0x0048,
+	0x3693, 0x2001, 0xa692, 0x7036, 0x0c7f, 0x0f7f, 0x127f, 0x0e7f,
+	0x007c, 0x027e, 0x2001, 0xa653, 0x2004, 0xd0c4, 0x0040, 0x36a4,
+	0x2011, 0x8014, 0x1078, 0x361b, 0x027f, 0x007c, 0x81ff, 0x00c0,
+	0x2bd7, 0x127e, 0x2091, 0x8000, 0x6030, 0xc08d, 0xc085, 0xc0ac,
+	0x6032, 0x1078, 0x4224, 0x127f, 0x0078, 0x2bad, 0x81ff, 0x00c0,
+	0x2bd7, 0x6000, 0xa086, 0x0003, 0x00c0, 0x2bd7, 0x2001, 0xa653,
+	0x2004, 0xd0ac, 0x00c0, 0x2bd7, 0x1078, 0x35e4, 0x0040, 0x2bdb,
+	0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x36d3, 0x7828,
+	0xa005, 0x0040, 0x2bad, 0x0c7e, 0x1078, 0x35ba, 0x0c7f, 0x0040,
+	0x2bd7, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a,
+	0x1078, 0x8f12, 0x0040, 0x2bd7, 0x7007, 0x0003, 0x701b, 0x36e9,
+	0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x2bd7, 0x0078, 0x2bad,
+	0x2001, 0xa600, 0x2004, 0xa086, 0x0003, 0x00c0, 0x2bd7, 0x7f24,
+	0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x35ba, 0x0040, 0x2bd7,
+	0x2009, 0x0000, 0x2031, 0x0000, 0x7023, 0x0000, 0x702f, 0x0000,
+	0xad80, 0x0005, 0x7026, 0x20a0, 0x1078, 0x45c4, 0x00c0, 0x376d,
+	0x6004, 0xa0c4, 0x00ff, 0xa8c6, 0x0006, 0x0040, 0x371d, 0xa0c4,
+	0xff00, 0xa8c6, 0x0600, 0x00c0, 0x376d, 0x2001, 0xa653, 0x2004,
+	0xd0ac, 0x00c0, 0x372a, 0x1078, 0x489b, 0x00c0, 0x372a, 0xd79c,
+	0x0040, 0x376d, 0xd794, 0x00c0, 0x3730, 0xd784, 0x0040, 0x373c,
+	0xac80, 0x0006, 0x2098, 0x3400, 0x20a9, 0x0004, 0x53a3, 0x1078,
+	0x3426, 0xd794, 0x0040, 0x3745, 0xac80, 0x000a, 0x2098, 0x3400,
+	0x20a9, 0x0004, 0x53a3, 0x1078, 0x3426, 0x21a2, 0xd794, 0x0040,
+	0x3765, 0xac80, 0x0000, 0x2098, 0x94a0, 0x20a9, 0x0002, 0x53a3,
+	0xac80, 0x0003, 0x20a6, 0x94a0, 0xac80, 0x0004, 0x2098, 0x3400,
+	0x20a9, 0x0002, 0x53a3, 0x1078, 0x3418, 0xac80, 0x0026, 0x2098,
+	0x20a9, 0x0002, 0x53a3, 0x0078, 0x3766, 0x94a0, 0xd794, 0x0040,
+	0x376b, 0xa6b0, 0x000b, 0xa6b0, 0x0005, 0x8108, 0xd78c, 0x0040,
+	0x3777, 0xa186, 0x0100, 0x0040, 0x3788, 0x0078, 0x377b, 0xa186,
+	0x007e, 0x0040, 0x3788, 0xd794, 0x0040, 0x3782, 0xa686, 0x0020,
+	0x0078, 0x3784, 0xa686, 0x0028, 0x0040, 0x3791, 0x0078, 0x370c,
+	0x86ff, 0x00c0, 0x378f, 0x7120, 0x810b, 0x0078, 0x2bad, 0x702f,
+	0x0001, 0x711e, 0x7020, 0xa600, 0x7022, 0x772a, 0x2061, 0xa6d2,
+	0x6007, 0x0000, 0x6612, 0x7024, 0x600e, 0x6226, 0x632a, 0x642e,
+	0x6532, 0x2c10, 0x1078, 0x13db, 0x7007, 0x0002, 0x701b, 0x37a9,
+	0x007c, 0x702c, 0xa005, 0x00c0, 0x37bb, 0x711c, 0x7024, 0x20a0,
+	0x7728, 0x2031, 0x0000, 0x2061, 0xa6d2, 0x6224, 0x6328, 0x642c,
+	0x6530, 0x0078, 0x370c, 0x7120, 0x810b, 0x0078, 0x2bad, 0x2029,
+	0x007e, 0x7924, 0x7a28, 0x7b2c, 0x7c38, 0xa184, 0xff00, 0x8007,
+	0xa0e2, 0x0020, 0x0048, 0x2bdb, 0xa502, 0x0048, 0x2bdb, 0xa184,
+	0x00ff, 0xa0e2, 0x0020, 0x0048, 0x2bdb, 0xa502, 0x0048, 0x2bdb,
+	0xa284, 0xff00, 0x8007, 0xa0e2, 0x0020, 0x0048, 0x2bdb, 0xa502,
+	0x0048, 0x2bdb, 0xa284, 0x00ff, 0xa0e2, 0x0020, 0x0048, 0x2bdb,
+	0xa502, 0x0048, 0x2bdb, 0xa384, 0xff00, 0x8007, 0xa0e2, 0x0020,
+	0x0048, 0x2bdb, 0xa502, 0x0048, 0x2bdb, 0xa384, 0x00ff, 0xa0e2,
+	0x0020, 0x0048, 0x2bdb, 0xa502, 0x0048, 0x2bdb, 0xa484, 0xff00,
+	0x8007, 0xa0e2, 0x0020, 0x0048, 0x2bdb, 0xa502, 0x0048, 0x2bdb,
+	0xa484, 0x00ff, 0xa0e2, 0x0020, 0x0048, 0x2bdb, 0xa502, 0x0048,
+	0x2bdb, 0x2061, 0xa8a5, 0x6102, 0x6206, 0x630a, 0x640e, 0x0078,
+	0x2bad, 0x007e, 0x2001, 0xa653, 0x2004, 0xd0cc, 0x007f, 0x007c,
+	0x007e, 0x2001, 0xa672, 0x2004, 0xd0bc, 0x007f, 0x007c, 0x6164,
+	0x7a24, 0x6300, 0x82ff, 0x00c0, 0x3830, 0x7926, 0x0078, 0x2bad,
+	0x83ff, 0x00c0, 0x2bdb, 0x2001, 0xfff0, 0xa200, 0x00c8, 0x2bdb,
+	0x2019, 0xffff, 0x6068, 0xa302, 0xa200, 0x0048, 0x2bdb, 0x7926,
+	0x6266, 0x0078, 0x2bad, 0x2001, 0xa600, 0x2004, 0xa086, 0x0003,
+	0x00c0, 0x2bd7, 0x7c28, 0x7d24, 0x7e38, 0x7f2c, 0x1078, 0x35ba,
+	0x0040, 0x2bd7, 0x2009, 0x0000, 0x2019, 0x0000, 0x7023, 0x0000,
+	0x702f, 0x0000, 0xad80, 0x0003, 0x7026, 0x20a0, 0xa1e0, 0xa735,
+	0x2c64, 0x8cff, 0x0040, 0x387d, 0x6004, 0xa084, 0x00ff, 0xa086,
+	0x0006, 0x0040, 0x3872, 0x6004, 0xa084, 0xff00, 0xa086, 0x0600,
+	0x00c0, 0x387d, 0x6014, 0x20a2, 0x94a0, 0x6010, 0x8007, 0xa105,
+	0x8007, 0x20a2, 0x94a0, 0xa398, 0x0002, 0x8108, 0xa182, 0x00ff,
+	0x0040, 0x3888, 0xa386, 0x002a, 0x0040, 0x3891, 0x0078, 0x385e,
+	0x83ff, 0x00c0, 0x388f, 0x7120, 0x810c, 0x0078, 0x2bad, 0x702f,
+	0x0001, 0x711e, 0x7020, 0xa300, 0x7022, 0x2061, 0xa6d2, 0x6007,
+	0x0000, 0x6312, 0x7024, 0x600e, 0x6426, 0x652a, 0x662e, 0x6732,
+	0x2c10, 0x1078, 0x13db, 0x7007, 0x0002, 0x701b, 0x38a8, 0x007c,
+	0x702c, 0xa005, 0x00c0, 0x38b9, 0x711c, 0x7024, 0x20a0, 0x2019,
+	0x0000, 0x2061, 0xa6d2, 0x6424, 0x6528, 0x662c, 0x6730, 0x0078,
+	0x385e, 0x7120, 0x810c, 0x0078, 0x2bad, 0x81ff, 0x00c0, 0x2bd7,
+	0x60cc, 0xd09c, 0x0040, 0x2bd7, 0x1078, 0x35ba, 0x0040, 0x2bd7,
+	0x7924, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x3604, 0x701b,
+	0x38d2, 0x007c, 0x0d7e, 0xade8, 0x000d, 0x6828, 0xa0be, 0x7000,
+	0x0040, 0x38e5, 0xa0be, 0x7100, 0x0040, 0x38e5, 0xa0be, 0x7200,
+	0x0040, 0x38e5, 0x0d7f, 0x0078, 0x2bdb, 0x6820, 0x6924, 0x1078,
+	0x254d, 0x00c0, 0x3910, 0x1078, 0x455c, 0x00c0, 0x3910, 0x7122,
+	0x6612, 0x6516, 0x6e18, 0x0c7e, 0x1078, 0x35ba, 0x0040, 0x3910,
+	0x1078, 0x35ba, 0x0040, 0x3910, 0x0c7f, 0x0d7f, 0x6837, 0x0000,
+	0x6838, 0xc0fd, 0x683a, 0x6823, 0x0000, 0x6804, 0x2068, 0x1078,
+	0x8e82, 0x0040, 0x2bd7, 0x7007, 0x0003, 0x701b, 0x3913, 0x007c,
+	0x0d7f, 0x0078, 0x2bd7, 0x7120, 0x1078, 0x298e, 0x6820, 0xa086,
+	0x8001, 0x0040, 0x2bd7, 0x2d00, 0x701e, 0x6804, 0xa080, 0x0002,
+	0x007e, 0x20a9, 0x002a, 0x2098, 0x20a0, 0x1078, 0x4281, 0x007f,
+	0xade8, 0x000d, 0x6a08, 0x6b0c, 0x6c10, 0x6d14, 0x2061, 0xa6d2,
+	0x6007, 0x0000, 0x6e00, 0x6f28, 0xa7c6, 0x7000, 0x00c0, 0x393a,
+	0x0078, 0x393e, 0xa7c6, 0x7100, 0x00c0, 0x3946, 0xa6c2, 0x0004,
+	0x0048, 0x2bdb, 0x2009, 0x0004, 0x0078, 0x3608, 0xa7c6, 0x7200,
+	0x00c0, 0x2bdb, 0xa6c2, 0x0054, 0x0048, 0x2bdb, 0x600e, 0x6013,
+	0x002a, 0x6226, 0x632a, 0x642e, 0x6532, 0x2c10, 0x1078, 0x13db,
+	0x7007, 0x0002, 0x701b, 0x395d, 0x007c, 0x701c, 0x2068, 0x6804,
+	0xa080, 0x0001, 0x2004, 0xa080, 0x0002, 0x007e, 0x20a9, 0x002a,
+	0x2098, 0x20a0, 0x1078, 0x4281, 0x007f, 0x2009, 0x002a, 0x2061,
+	0xa6d2, 0x6224, 0x6328, 0x642c, 0x6530, 0x0078, 0x3608, 0x81ff,
+	0x00c0, 0x2bd7, 0x792c, 0x2001, 0xa89d, 0x2102, 0x1078, 0x35d2,
+	0x0040, 0x2bdb, 0x1078, 0x4673, 0x0040, 0x2bd7, 0x127e, 0x2091,
+	0x8000, 0x1078, 0x47de, 0x127f, 0x0078, 0x2bad, 0x7824, 0xd08c,
+	0x00c0, 0x3995, 0xd084, 0x0040, 0x31da, 0x1078, 0x35e4, 0x0040,
+	0x2bdb, 0x0c7e, 0x1078, 0x35ba, 0x0c7f, 0x00c0, 0x39a3, 0x2009,
+	0x0002, 0x0078, 0x2bd7, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
+	0x0040, 0x39b0, 0xa08e, 0x0004, 0x0040, 0x39b0, 0xa08e, 0x0005,
+	0x00c0, 0x39dd, 0x7824, 0xd08c, 0x0040, 0x39bb, 0x6000, 0xc08c,
+	0x6002, 0x0078, 0x39c5, 0x2001, 0xa653, 0x2004, 0xd0b4, 0x0040,
+	0x320f, 0x6000, 0xd08c, 0x00c0, 0x320f, 0x6837, 0x0000, 0x6838,
+	0xc0fd, 0x683a, 0x1078, 0x8e9e, 0x00c0, 0x39d2, 0x2009, 0x0003,
+	0x0078, 0x2bd7, 0x7007, 0x0003, 0x701b, 0x39d7, 0x007c, 0x1078,
+	0x35e4, 0x0040, 0x2bdb, 0x0078, 0x320f, 0x2009, 0xa62f, 0x210c,
+	0x81ff, 0x0040, 0x39e7, 0x2009, 0x0001, 0x0078, 0x2bd7, 0x2001,
+	0xa600, 0x2004, 0xa086, 0x0003, 0x0040, 0x39f2, 0x2009, 0x0007,
+	0x0078, 0x2bd7, 0x2001, 0xa653, 0x2004, 0xd0ac, 0x0040, 0x39fc,
+	0x2009, 0x0008, 0x0078, 0x2bd7, 0x609c, 0xd0a4, 0x00c0, 0x3a03,
+	0xd0ac, 0x00c0, 0x320f, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838,
+	0xc0fd, 0x683a, 0x1078, 0x8f12, 0x00c0, 0x3a12, 0x2009, 0x0003,
+	0x0078, 0x2bd7, 0x7007, 0x0003, 0x701b, 0x3a17, 0x007c, 0x6830,
+	0xa086, 0x0100, 0x00c0, 0x3a20, 0x2009, 0x0004, 0x0078, 0x2bd7,
+	0x1078, 0x35e4, 0x0040, 0x2bdb, 0x0078, 0x39b2, 0x81ff, 0x2009,
+	0x0001, 0x00c0, 0x2bd7, 0x6000, 0xa086, 0x0003, 0x2009, 0x0007,
+	0x00c0, 0x2bd7, 0x2001, 0xa653, 0x2004, 0xd0ac, 0x2009, 0x0008,
+	0x00c0, 0x2bd7, 0x1078, 0x35e4, 0x0040, 0x2bdb, 0x6004, 0xa084,
+	0x00ff, 0xa086, 0x0006, 0x2009, 0x0009, 0x00c0, 0x2bd7, 0x0c7e,
+	0x1078, 0x35ba, 0x0c7f, 0x2009, 0x0002, 0x0040, 0x2bd7, 0x6837,
+	0x0000, 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x7928, 0xa194,
+	0xff00, 0xa18c, 0x00ff, 0xa006, 0x82ff, 0x00c0, 0x3a65, 0xc0ed,
+	0x6952, 0x792c, 0x6956, 0x0078, 0x3a6e, 0xa28e, 0x0100, 0x00c0,
+	0x2bdb, 0xc0e5, 0x6853, 0x0000, 0x6857, 0x0000, 0x683e, 0x1078,
+	0x90bd, 0x2009, 0x0003, 0x0040, 0x2bd7, 0x7007, 0x0003, 0x701b,
+	0x3a7a, 0x007c, 0x6830, 0xa086, 0x0100, 0x2009, 0x0004, 0x0040,
+	0x2bd7, 0x0078, 0x2bad, 0x81ff, 0x2009, 0x0001, 0x00c0, 0x2bd7,
+	0x6000, 0xa086, 0x0003, 0x2009, 0x0007, 0x00c0, 0x2bd7, 0x1078,
+	0x35e4, 0x0040, 0x2bdb, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
+	0x2009, 0x0009, 0x00c0, 0x2bd7, 0x0c7e, 0x1078, 0x35ba, 0x0c7f,
+	0x2009, 0x0002, 0x0040, 0x2bd7, 0xad80, 0x000f, 0x2009, 0x0008,
+	0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x3604, 0x701b, 0x3ab1,
+	0x007c, 0x0d7e, 0xade8, 0x000f, 0x6800, 0xa086, 0x0500, 0x00c0,
+	0x3ac4, 0x6804, 0xa005, 0x00c0, 0x3ac4, 0x6808, 0xa084, 0xff00,
+	0x00c0, 0x3ac4, 0x0078, 0x3ac7, 0x0d7f, 0x00c0, 0x2bdb, 0x0d7f,
+	0x6837, 0x0000, 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x0c7e,
+	0x1078, 0x35e4, 0x00c0, 0x3ad7, 0x0c7f, 0x0078, 0x2bdb, 0x1078,
+	0x9119, 0x2009, 0x0003, 0x0c7f, 0x0040, 0x2bd7, 0x7007, 0x0003,
+	0x701b, 0x3ae3, 0x007c, 0x6830, 0xa086, 0x0100, 0x2009, 0x0004,
+	0x0040, 0x2bd7, 0x0078, 0x2bad, 0x127e, 0x0c7e, 0x0e7e, 0x2061,
+	0x0100, 0x2071, 0xa600, 0x6044, 0xd0a4, 0x00c0, 0x3b15, 0xd084,
+	0x0040, 0x3afe, 0x1078, 0x3c75, 0x0078, 0x3b11, 0xd08c, 0x0040,
+	0x3b05, 0x1078, 0x3b8c, 0x0078, 0x3b11, 0xd094, 0x0040, 0x3b0c,
+	0x1078, 0x3b60, 0x0078, 0x3b11, 0xd09c, 0x0040, 0x3b11, 0x1078,
+	0x3b1f, 0x0e7f, 0x0c7f, 0x127f, 0x007c, 0x017e, 0x6128, 0xd19c,
+	0x00c0, 0x3b1c, 0xc19d, 0x612a, 0x017f, 0x0078, 0x3b11, 0x624c,
+	0xa286, 0xf0f0, 0x00c0, 0x3b30, 0x6048, 0xa086, 0xf0f0, 0x0040,
+	0x3b30, 0x624a, 0x6043, 0x0090, 0x6043, 0x0010, 0x0078, 0x3b5f,
+	0xa294, 0xff00, 0xa296, 0xf700, 0x0040, 0x3b45, 0x7134, 0xd1a4,
+	0x00c0, 0x3b45, 0x6240, 0xa294, 0x0010, 0x0040, 0x3b45, 0x2009,
+	0x00f7, 0x1078, 0x42a1, 0x0078, 0x3b5f, 0x6043, 0x0040, 0x6043,
+	0x0000, 0x7077, 0x0000, 0x708f, 0x0001, 0x70b3, 0x0000, 0x70cf,
+	0x0000, 0x2009, 0xacc0, 0x200b, 0x0000, 0x7087, 0x0000, 0x707b,
+	0x000f, 0x2009, 0x000f, 0x2011, 0x41d5, 0x1078, 0x5add, 0x007c,
+	0x157e, 0x7078, 0xa005, 0x00c0, 0x3b8a, 0x2011, 0x41d5, 0x1078,
+	0x5a45, 0x6040, 0xa094, 0x0010, 0xa285, 0x0020, 0x6042, 0x20a9,
+	0x00c8, 0x6044, 0xd08c, 0x00c0, 0x3b83, 0x00f0, 0x3b71, 0x6242,
+	0x708b, 0x0000, 0x6040, 0xa094, 0x0010, 0xa285, 0x0080, 0x6042,
+	0x6242, 0x0078, 0x3b8a, 0x6242, 0x708b, 0x0000, 0x707f, 0x0000,
+	0x0078, 0x3b8a, 0x157f, 0x007c, 0x707c, 0xa08a, 0x0003, 0x00c8,
+	0x3b95, 0x1079, 0x3b98, 0x0078, 0x3b97, 0x1078, 0x1332, 0x007c,
+	0x3b9b, 0x3bea, 0x3c74, 0x0f7e, 0x707f, 0x0001, 0x20e1, 0xa000,
+	0x20e1, 0x8700, 0x1078, 0x21f7, 0x20e1, 0x9080, 0x20e1, 0x4000,
+	0x2079, 0xab00, 0x207b, 0x2200, 0x7807, 0x00ef, 0x780b, 0x0000,
+	0x780f, 0x00ef, 0x7813, 0x0138, 0x7817, 0x0000, 0x781b, 0x0000,
+	0x781f, 0x0000, 0x7823, 0xffff, 0x7827, 0xffff, 0x782b, 0x0000,
+	0x782f, 0x0000, 0x2079, 0xab0c, 0x207b, 0x1101, 0x7807, 0x0000,
+	0x2099, 0xa605, 0x20a1, 0xab0e, 0x20a9, 0x0004, 0x53a3, 0x2079,
+	0xab12, 0x207b, 0x0000, 0x7807, 0x0000, 0x2099, 0xab00, 0x20a1,
+	0x020b, 0x20a9, 0x0014, 0x53a6, 0x60c3, 0x000c, 0x600f, 0x0000,
+	0x1078, 0x420b, 0x0f7f, 0x7083, 0x0000, 0x6043, 0x0008, 0x6043,
+	0x0000, 0x007c, 0x0d7e, 0x7080, 0x7083, 0x0000, 0xa025, 0x0040,
+	0x3c5e, 0x6020, 0xd0b4, 0x00c0, 0x3c5c, 0x718c, 0x81ff, 0x0040,
+	0x3c4b, 0xa486, 0x000c, 0x00c0, 0x3c56, 0xa480, 0x0018, 0x8004,
+	0x20a8, 0x2011, 0xab80, 0x2019, 0xab00, 0x220c, 0x2304, 0xa106,
+	0x00c0, 0x3c22, 0x8210, 0x8318, 0x00f0, 0x3c05, 0x6043, 0x0004,
+	0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0006, 0x707f, 0x0002,
+	0x708b, 0x0002, 0x2009, 0x07d0, 0x2011, 0x41dc, 0x1078, 0x5add,
+	0x0078, 0x3c5c, 0x2069, 0xab80, 0x6930, 0xa18e, 0x1101, 0x00c0,
+	0x3c56, 0x6834, 0xa005, 0x00c0, 0x3c56, 0x6900, 0xa18c, 0x00ff,
+	0x00c0, 0x3c36, 0x6804, 0xa005, 0x0040, 0x3c4b, 0x2011, 0xab8e,
+	0x2019, 0xa605, 0x20a9, 0x0004, 0x220c, 0x2304, 0xa102, 0x0048,
+	0x3c49, 0x00c0, 0x3c56, 0x8210, 0x8318, 0x00f0, 0x3c3c, 0x0078,
+	0x3c56, 0x708f, 0x0000, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099,
+	0xab80, 0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x6043, 0x0008,
+	0x6043, 0x0000, 0x0078, 0x3c5e, 0x0d7f, 0x007c, 0x6020, 0xd0b4,
+	0x00c0, 0x3c5c, 0x60c3, 0x000c, 0x2011, 0xa8bb, 0x2013, 0x0000,
+	0x7083, 0x0000, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575,
+	0x1078, 0x6e06, 0x0078, 0x3c5c, 0x007c, 0x7088, 0xa08a, 0x001d,
+	0x00c8, 0x3c7e, 0x1079, 0x3c81, 0x0078, 0x3c80, 0x1078, 0x1332,
+	0x007c, 0x3cab, 0x3cba, 0x3ce9, 0x3d02, 0x3d2e, 0x3d5a, 0x3d86,
+	0x3dbc, 0x3de8, 0x3e10, 0x3e53, 0x3e7d, 0x3e9f, 0x3eb5, 0x3edb,
+	0x3eee, 0x3ef7, 0x3f2b, 0x3f57, 0x3f83, 0x3faf, 0x3fe5, 0x4030,
+	0x405f, 0x4081, 0x40c3, 0x40e9, 0x4102, 0x4103, 0x0c7e, 0x2061,
+	0xa600, 0x6003, 0x0007, 0x2061, 0x0100, 0x6004, 0xa084, 0xfff9,
+	0x6006, 0x0c7f, 0x007c, 0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043,
+	0x0002, 0x708b, 0x0001, 0x2009, 0x07d0, 0x2011, 0x41dc, 0x1078,
+	0x5add, 0x007c, 0x0f7e, 0x7080, 0xa086, 0x0014, 0x00c0, 0x3ce7,
+	0x6043, 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x3ce7, 0x2079, 0xab80,
+	0x7a30, 0xa296, 0x1102, 0x00c0, 0x3ce5, 0x7834, 0xa005, 0x00c0,
+	0x3ce5, 0x7a38, 0xd2fc, 0x0040, 0x3cdb, 0x70b0, 0xa005, 0x00c0,
+	0x3cdb, 0x70b3, 0x0001, 0x2011, 0x41dc, 0x1078, 0x5a45, 0x708b,
+	0x0010, 0x1078, 0x3ef7, 0x0078, 0x3ce7, 0x1078, 0x4224, 0x0f7f,
+	0x007c, 0x708b, 0x0003, 0x6043, 0x0004, 0x2011, 0x41dc, 0x1078,
+	0x5a45, 0x1078, 0x4289, 0x20a3, 0x1102, 0x20a3, 0x0000, 0x20a9,
+	0x000a, 0x20a3, 0x0000, 0x00f0, 0x3cf9, 0x60c3, 0x0014, 0x1078,
+	0x420b, 0x007c, 0x0f7e, 0x7080, 0xa005, 0x0040, 0x3d2c, 0x2011,
+	0x41dc, 0x1078, 0x5a45, 0xa086, 0x0014, 0x00c0, 0x3d2a, 0x2079,
+	0xab80, 0x7a30, 0xa296, 0x1102, 0x00c0, 0x3d2a, 0x7834, 0xa005,
+	0x00c0, 0x3d2a, 0x7a38, 0xd2fc, 0x0040, 0x3d24, 0x70b0, 0xa005,
+	0x00c0, 0x3d24, 0x70b3, 0x0001, 0x708b, 0x0004, 0x1078, 0x3d2e,
+	0x0078, 0x3d2c, 0x1078, 0x4224, 0x0f7f, 0x007c, 0x708b, 0x0005,
+	0x1078, 0x4289, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430, 0x2011,
+	0xab8e, 0x1078, 0x42d4, 0x00c0, 0x3d4c, 0x7074, 0xa005, 0x00c0,
+	0x3d4c, 0x7150, 0xa186, 0xffff, 0x0040, 0x3d4c, 0x1078, 0x419d,
+	0x0040, 0x3d4c, 0x1078, 0x42b8, 0x20a9, 0x0008, 0x2298, 0x26a0,
+	0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078,
+	0x420b, 0x007c, 0x0f7e, 0x7080, 0xa005, 0x0040, 0x3d84, 0x2011,
+	0x41dc, 0x1078, 0x5a45, 0xa086, 0x0014, 0x00c0, 0x3d82, 0x2079,
+	0xab80, 0x7a30, 0xa296, 0x1103, 0x00c0, 0x3d82, 0x7834, 0xa005,
+	0x00c0, 0x3d82, 0x7a38, 0xd2fc, 0x0040, 0x3d7c, 0x70b0, 0xa005,
+	0x00c0, 0x3d7c, 0x70b3, 0x0001, 0x708b, 0x0006, 0x1078, 0x3d86,
+	0x0078, 0x3d84, 0x1078, 0x4224, 0x0f7f, 0x007c, 0x708b, 0x0007,
+	0x1078, 0x4289, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011,
+	0xab8e, 0x1078, 0x42d4, 0x00c0, 0x3dae, 0x7074, 0xa005, 0x00c0,
+	0x3dae, 0x7154, 0xa186, 0xffff, 0x0040, 0x3dae, 0xa180, 0x29c0,
+	0x200c, 0xa18c, 0xff00, 0x810f, 0x1078, 0x419d, 0x0040, 0x3dae,
+	0x1078, 0x3820, 0x0040, 0x3dae, 0x1078, 0x256a, 0x20a9, 0x0008,
+	0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
+	0x0014, 0x1078, 0x420b, 0x007c, 0x0f7e, 0x7080, 0xa005, 0x0040,
+	0x3de6, 0x2011, 0x41dc, 0x1078, 0x5a45, 0xa086, 0x0014, 0x00c0,
+	0x3de4, 0x2079, 0xab80, 0x7a30, 0xa296, 0x1104, 0x00c0, 0x3de4,
+	0x7834, 0xa005, 0x00c0, 0x3de4, 0x7a38, 0xd2fc, 0x0040, 0x3dde,
+	0x70b0, 0xa005, 0x00c0, 0x3dde, 0x70b3, 0x0001, 0x708b, 0x0008,
+	0x1078, 0x3de8, 0x0078, 0x3de6, 0x1078, 0x4224, 0x0f7f, 0x007c,
+	0x708b, 0x0009, 0x1078, 0x4289, 0x20a3, 0x1105, 0x20a3, 0x0100,
+	0x3430, 0x1078, 0x42d4, 0x00c0, 0x3e01, 0x7074, 0xa005, 0x00c0,
+	0x3e01, 0x1078, 0x4104, 0x00c0, 0x3e0b, 0xa085, 0x0001, 0x1078,
+	0x256a, 0x20a9, 0x0008, 0x2099, 0xab8e, 0x26a0, 0x53a6, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x420b, 0x007c,
+	0x0f7e, 0x7080, 0xa005, 0x0040, 0x3e51, 0x2011, 0x41dc, 0x1078,
+	0x5a45, 0xa086, 0x0014, 0x00c0, 0x3e4f, 0x2079, 0xab80, 0x7a30,
+	0xa296, 0x1105, 0x00c0, 0x3e4f, 0x7834, 0x2011, 0x0100, 0xa21e,
+	0x00c0, 0x3e3a, 0x7a38, 0xd2fc, 0x0040, 0x3e34, 0x70b0, 0xa005,
+	0x00c0, 0x3e34, 0x70b3, 0x0001, 0x708b, 0x000a, 0x1078, 0x3e53,
+	0x0078, 0x3e51, 0xa005, 0x00c0, 0x3e4f, 0x7a38, 0xd2fc, 0x0040,
+	0x3e47, 0x70b0, 0xa005, 0x00c0, 0x3e47, 0x70b3, 0x0001, 0x7087,
+	0x0000, 0x708b, 0x000e, 0x1078, 0x3edb, 0x0078, 0x3e51, 0x1078,
+	0x4224, 0x0f7f, 0x007c, 0x708b, 0x000b, 0x2011, 0xab0e, 0x22a0,
+	0x20a9, 0x0040, 0x2019, 0xffff, 0x43a4, 0x20a9, 0x0002, 0x2009,
+	0x0000, 0x41a4, 0x1078, 0x4289, 0x20a3, 0x1106, 0x20a3, 0x0000,
+	0x1078, 0x42d4, 0x0040, 0x3e70, 0x2013, 0x0000, 0x0078, 0x3e74,
+	0x6030, 0xa085, 0x0100, 0x2012, 0x2298, 0x20a9, 0x0042, 0x53a6,
+	0x60c3, 0x0084, 0x1078, 0x420b, 0x007c, 0x0f7e, 0x7080, 0xa005,
+	0x0040, 0x3e9d, 0x2011, 0x41dc, 0x1078, 0x5a45, 0xa086, 0x0084,
+	0x00c0, 0x3e9b, 0x2079, 0xab80, 0x7a30, 0xa296, 0x1106, 0x00c0,
+	0x3e9b, 0x7834, 0xa005, 0x00c0, 0x3e9b, 0x708b, 0x000c, 0x1078,
+	0x3e9f, 0x0078, 0x3e9d, 0x1078, 0x4224, 0x0f7f, 0x007c, 0x708b,
+	0x000d, 0x1078, 0x4289, 0x20a3, 0x1107, 0x20a3, 0x0000, 0x2099,
+	0xab8e, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
+	0x60c3, 0x0084, 0x1078, 0x420b, 0x007c, 0x0f7e, 0x7080, 0xa005,
+	0x0040, 0x3ed9, 0x2011, 0x41dc, 0x1078, 0x5a45, 0xa086, 0x0084,
+	0x00c0, 0x3ed7, 0x2079, 0xab80, 0x7a30, 0xa296, 0x1107, 0x00c0,
+	0x3ed7, 0x7834, 0xa005, 0x00c0, 0x3ed7, 0x7087, 0x0001, 0x1078,
+	0x427b, 0x708b, 0x000e, 0x1078, 0x3edb, 0x0078, 0x3ed9, 0x1078,
+	0x4224, 0x0f7f, 0x007c, 0x708b, 0x000f, 0x7083, 0x0000, 0x608b,
+	0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0005, 0x6043, 0x0004, 0x2009,
+	0x07d0, 0x2011, 0x41dc, 0x1078, 0x5a38, 0x007c, 0x7080, 0xa005,
+	0x0040, 0x3ef6, 0x2011, 0x41dc, 0x1078, 0x5a45, 0x007c, 0x708b,
+	0x0011, 0x1078, 0x42d4, 0x00c0, 0x3f14, 0x716c, 0x81ff, 0x0040,
+	0x3f14, 0x2009, 0x0000, 0x7070, 0xa084, 0x00ff, 0x1078, 0x254d,
+	0xa186, 0x007e, 0x0040, 0x3f14, 0xa186, 0x0080, 0x0040, 0x3f14,
+	0x2011, 0xab8e, 0x1078, 0x419d, 0x20e1, 0x9080, 0x20e1, 0x4000,
+	0x2099, 0xab80, 0x20a1, 0x020b, 0x7480, 0xa480, 0x0018, 0xa080,
+	0x0007, 0xa084, 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0014,
+	0x1078, 0x420b, 0x007c, 0x0f7e, 0x7080, 0xa005, 0x0040, 0x3f55,
+	0x2011, 0x41dc, 0x1078, 0x5a45, 0xa086, 0x0014, 0x00c0, 0x3f53,
+	0x2079, 0xab80, 0x7a30, 0xa296, 0x1103, 0x00c0, 0x3f53, 0x7834,
+	0xa005, 0x00c0, 0x3f53, 0x7a38, 0xd2fc, 0x0040, 0x3f4d, 0x70b0,
+	0xa005, 0x00c0, 0x3f4d, 0x70b3, 0x0001, 0x708b, 0x0012, 0x1078,
+	0x3f57, 0x0078, 0x3f55, 0x1078, 0x4224, 0x0f7f, 0x007c, 0x708b,
+	0x0013, 0x1078, 0x4295, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430,
+	0x2011, 0xab8e, 0x1078, 0x42d4, 0x00c0, 0x3f75, 0x7074, 0xa005,
+	0x00c0, 0x3f75, 0x7150, 0xa186, 0xffff, 0x0040, 0x3f75, 0x1078,
+	0x419d, 0x0040, 0x3f75, 0x1078, 0x42b8, 0x20a9, 0x0008, 0x2298,
+	0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
+	0x1078, 0x420b, 0x007c, 0x0f7e, 0x7080, 0xa005, 0x0040, 0x3fad,
+	0x2011, 0x41dc, 0x1078, 0x5a45, 0xa086, 0x0014, 0x00c0, 0x3fab,
+	0x2079, 0xab80, 0x7a30, 0xa296, 0x1104, 0x00c0, 0x3fab, 0x7834,
+	0xa005, 0x00c0, 0x3fab, 0x7a38, 0xd2fc, 0x0040, 0x3fa5, 0x70b0,
+	0xa005, 0x00c0, 0x3fa5, 0x70b3, 0x0001, 0x708b, 0x0014, 0x1078,
+	0x3faf, 0x0078, 0x3fad, 0x1078, 0x4224, 0x0f7f, 0x007c, 0x708b,
+	0x0015, 0x1078, 0x4295, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430,
+	0x2011, 0xab8e, 0x1078, 0x42d4, 0x00c0, 0x3fd7, 0x7074, 0xa005,
+	0x00c0, 0x3fd7, 0x7154, 0xa186, 0xffff, 0x0040, 0x3fd7, 0xa180,
+	0x29c0, 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078, 0x419d, 0x0040,
+	0x3fd7, 0x1078, 0x3820, 0x0040, 0x3fd7, 0x1078, 0x256a, 0x20a9,
+	0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
+	0x60c3, 0x0014, 0x1078, 0x420b, 0x007c, 0x0f7e, 0x7080, 0xa005,
+	0x0040, 0x402e, 0x2011, 0x41dc, 0x1078, 0x5a45, 0xa086, 0x0014,
+	0x00c0, 0x402c, 0x2079, 0xab80, 0x7a30, 0xa296, 0x1105, 0x00c0,
+	0x402c, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0, 0x400b, 0x7a38,
+	0xd2fc, 0x0040, 0x4009, 0x70b0, 0xa005, 0x00c0, 0x4009, 0x70b3,
+	0x0001, 0x0078, 0x401a, 0xa005, 0x00c0, 0x402c, 0x7a38, 0xd2fc,
+	0x0040, 0x4018, 0x70b0, 0xa005, 0x00c0, 0x4018, 0x70b3, 0x0001,
+	0x7087, 0x0000, 0x7a38, 0xd2f4, 0x0040, 0x4026, 0x2001, 0xa674,
+	0x2004, 0xd0a4, 0x00c0, 0x4026, 0x70cf, 0x0008, 0x708b, 0x0016,
+	0x1078, 0x4030, 0x0078, 0x402e, 0x1078, 0x4224, 0x0f7f, 0x007c,
+	0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0xab80, 0x20a1, 0x020b,
+	0x20a9, 0x000e, 0x53a6, 0x3430, 0x2011, 0xab8e, 0x708b, 0x0017,
+	0x1078, 0x42d4, 0x00c0, 0x4050, 0x7074, 0xa005, 0x00c0, 0x4050,
+	0x1078, 0x4104, 0x00c0, 0x405a, 0xa085, 0x0001, 0x1078, 0x256a,
+	0x20a9, 0x0008, 0x2099, 0xab8e, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+	0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x420b, 0x007c, 0x0f7e,
+	0x7080, 0xa005, 0x0040, 0x407f, 0x2011, 0x41dc, 0x1078, 0x5a45,
+	0xa086, 0x0084, 0x00c0, 0x407d, 0x2079, 0xab80, 0x7a30, 0xa296,
+	0x1106, 0x00c0, 0x407d, 0x7834, 0xa005, 0x00c0, 0x407d, 0x708b,
+	0x0018, 0x1078, 0x4081, 0x0078, 0x407f, 0x1078, 0x4224, 0x0f7f,
+	0x007c, 0x708b, 0x0019, 0x1078, 0x4295, 0x20a3, 0x1106, 0x20a3,
+	0x0000, 0x3430, 0x2099, 0xab8e, 0x2039, 0xab0e, 0x27a0, 0x20a9,
+	0x0040, 0x53a3, 0x1078, 0x42d4, 0x00c0, 0x40b5, 0x2728, 0x2514,
+	0x8207, 0xa084, 0x00ff, 0x8000, 0x2018, 0xa294, 0x00ff, 0x8007,
+	0xa205, 0x202a, 0x6030, 0x2310, 0x8214, 0xa2a0, 0xab0e, 0x2414,
+	0xa38c, 0x0001, 0x0040, 0x40b0, 0xa294, 0xff00, 0x0078, 0x40b3,
+	0xa294, 0x00ff, 0x8007, 0xa215, 0x2222, 0x2798, 0x26a0, 0x20a9,
+	0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084,
+	0x1078, 0x420b, 0x007c, 0x0f7e, 0x7080, 0xa005, 0x0040, 0x40e7,
+	0x2011, 0x41dc, 0x1078, 0x5a45, 0xa086, 0x0084, 0x00c0, 0x40e5,
+	0x2079, 0xab80, 0x7a30, 0xa296, 0x1107, 0x00c0, 0x40e5, 0x7834,
+	0xa005, 0x00c0, 0x40e5, 0x7087, 0x0001, 0x1078, 0x427b, 0x708b,
+	0x001a, 0x1078, 0x40e9, 0x0078, 0x40e7, 0x1078, 0x4224, 0x0f7f,
+	0x007c, 0x708b, 0x001b, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099,
+	0xab80, 0x20a1, 0x020b, 0x7480, 0xa480, 0x0018, 0xa080, 0x0007,
+	0xa084, 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0084, 0x1078,
+	0x420b, 0x007c, 0x007c, 0x007c, 0x087e, 0x097e, 0x2029, 0xa653,
+	0x252c, 0x20a9, 0x0008, 0x2041, 0xab0e, 0x28a0, 0x2099, 0xab8e,
+	0x53a3, 0x20a9, 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0040, 0x411a,
+	0x2011, 0x0000, 0x2800, 0xa200, 0x200c, 0xa1a6, 0xffff, 0x00c0,
+	0x412c, 0xd5d4, 0x0040, 0x4127, 0x8210, 0x0078, 0x4128, 0x8211,
+	0x00f0, 0x411a, 0x0078, 0x4194, 0x82ff, 0x00c0, 0x413e, 0xd5d4,
+	0x0040, 0x4138, 0xa1a6, 0x3fff, 0x0040, 0x4124, 0x0078, 0x413c,
+	0xa1a6, 0x3fff, 0x0040, 0x4194, 0xa18d, 0xc000, 0x20a9, 0x0010,
+	0x2019, 0x0001, 0xd5d4, 0x0040, 0x4147, 0x2019, 0x0010, 0x2120,
+	0xd5d4, 0x0040, 0x414e, 0x8423, 0x0078, 0x414f, 0x8424, 0x00c8,
+	0x415c, 0xd5d4, 0x0040, 0x4157, 0x8319, 0x0078, 0x4158, 0x8318,
+	0x00f0, 0x4148, 0x0078, 0x4194, 0x23a8, 0x2021, 0x0001, 0x8426,
+	0x8425, 0x00f0, 0x4160, 0x2328, 0x8529, 0xa2be, 0x0007, 0x0040,
+	0x4174, 0x007e, 0x2039, 0x0007, 0x2200, 0xa73a, 0x007f, 0x27a8,
+	0xa5a8, 0x0010, 0x00f0, 0x4170, 0x7552, 0xa5c8, 0x29c0, 0x292c,
+	0xa5ac, 0x00ff, 0x6532, 0x60e7, 0x0000, 0x65ea, 0x706f, 0x0000,
+	0x7572, 0x2018, 0x2304, 0xa405, 0x201a, 0x7077, 0x0001, 0x26a0,
+	0x2898, 0x20a9, 0x0008, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
+	0xa085, 0x0001, 0x0078, 0x419a, 0xa006, 0x0078, 0x419a, 0xa006,
+	0x1078, 0x1332, 0x097f, 0x087f, 0x007c, 0x2118, 0x2021, 0x0000,
+	0x2001, 0x0007, 0xa39a, 0x0010, 0x0048, 0x41aa, 0x8420, 0x8001,
+	0x0078, 0x41a2, 0x2118, 0x84ff, 0x0040, 0x41b3, 0xa39a, 0x0010,
+	0x8421, 0x00c0, 0x41ae, 0x2021, 0x0001, 0x83ff, 0x0040, 0x41bc,
+	0x8423, 0x8319, 0x00c0, 0x41b8, 0xa238, 0x2704, 0xa42c, 0x00c0,
+	0x41d4, 0xa405, 0x203a, 0x7152, 0xa1a0, 0x29c0, 0x242c, 0xa5ac,
+	0x00ff, 0x6532, 0x60e7, 0x0000, 0x65ea, 0x706f, 0x0000, 0x7572,
+	0x7077, 0x0001, 0xa084, 0x0000, 0x007c, 0x0e7e, 0x2071, 0xa600,
+	0x707b, 0x0000, 0x0e7f, 0x007c, 0x0e7e, 0x0f7e, 0x2001, 0x0002,
+	0x1078, 0x5ae6, 0x2079, 0x0100, 0x2071, 0x0140, 0x1078, 0x6e0f,
+	0x7004, 0xa084, 0x4000, 0x0040, 0x41f1, 0x7003, 0x1000, 0x7003,
+	0x0000, 0x127e, 0x2091, 0x8000, 0x2071, 0xa622, 0x2073, 0x0000,
+	0x7840, 0x027e, 0x017e, 0x2009, 0x00f7, 0x1078, 0x42a1, 0x017f,
+	0xa094, 0x0010, 0xa285, 0x0080, 0x7842, 0x7a42, 0x027f, 0x127f,
+	0x0f7f, 0x0e7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x2011, 0xa8bb,
+	0x2013, 0x0000, 0x7083, 0x0000, 0x127f, 0x20e1, 0x9080, 0x60a3,
+	0x0056, 0x60a7, 0x9575, 0x1078, 0x6e06, 0x2009, 0x07d0, 0x2011,
+	0x41dc, 0x1078, 0x5add, 0x007c, 0x017e, 0x027e, 0x0c7e, 0x127e,
+	0x2091, 0x8000, 0x2011, 0x0003, 0x1078, 0x70e0, 0x2011, 0x0002,
+	0x1078, 0x70ea, 0x1078, 0x6fc4, 0x037e, 0x2019, 0x0000, 0x1078,
+	0x7058, 0x037f, 0x2009, 0x00f7, 0x1078, 0x42a1, 0x2061, 0xa8c4,
+	0x601b, 0x0000, 0x601f, 0x0000, 0x2061, 0xa600, 0x6003, 0x0001,
+	0x2061, 0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x002d,
+	0x2011, 0x4259, 0x1078, 0x5a38, 0x127f, 0x0c7f, 0x027f, 0x017f,
+	0x007c, 0x0e7e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2001, 0x0001,
+	0x1078, 0x5ae6, 0x2071, 0x0100, 0x1078, 0x6e0f, 0x2071, 0x0140,
+	0x7004, 0xa084, 0x4000, 0x0040, 0x4271, 0x7003, 0x1000, 0x7003,
+	0x0000, 0x2001, 0x0001, 0x1078, 0x24e8, 0x1078, 0x4224, 0x127f,
+	0x007f, 0x0e7f, 0x007c, 0x20a9, 0x0040, 0x20a1, 0xacc0, 0x2099,
+	0xab8e, 0x3304, 0x8007, 0x20a2, 0x9398, 0x94a0, 0x00f0, 0x4281,
+	0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0xab00, 0x20a1,
+	0x020b, 0x20a9, 0x000c, 0x53a6, 0x007c, 0x20e1, 0x9080, 0x20e1,
+	0x4000, 0x2099, 0xab80, 0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6,
+	0x007c, 0x0c7e, 0x007e, 0x2061, 0x0100, 0x810f, 0x2001, 0xa62f,
+	0x2004, 0xa005, 0x00c0, 0x42b2, 0x6030, 0xa084, 0x00ff, 0xa105,
+	0x0078, 0x42b4, 0xa185, 0x00f7, 0x604a, 0x007f, 0x0c7f, 0x007c,
+	0x017e, 0x047e, 0x2001, 0xa653, 0x2004, 0xd0a4, 0x0040, 0x42cb,
+	0xa006, 0x2020, 0x2009, 0x002a, 0x1078, 0xa21d, 0x2001, 0xa60c,
+	0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x2009, 0x0000, 0x1078,
+	0x284f, 0x047f, 0x017f, 0x007c, 0x007e, 0x2001, 0xa60c, 0x2004,
+	0xd09c, 0x0040, 0x42db, 0x007f, 0x007c, 0x007e, 0x017e, 0x127e,
+	0x2091, 0x8000, 0x2001, 0x0101, 0x200c, 0xa18d, 0x0006, 0x2102,
+	0x127f, 0x017f, 0x007f, 0x007c, 0x157e, 0x20a9, 0x00ff, 0x2009,
+	0xa735, 0xa006, 0x200a, 0x8108, 0x00f0, 0x42f2, 0x157f, 0x007c,
+	0x0d7e, 0x037e, 0x157e, 0x137e, 0x147e, 0x2069, 0xa652, 0xa006,
+	0x6002, 0x6007, 0x0707, 0x600a, 0x600e, 0x6012, 0xa198, 0x29c0,
+	0x231c, 0xa39c, 0x00ff, 0x6316, 0x20a9, 0x0004, 0xac98, 0x0006,
+	0x23a0, 0x40a4, 0x20a9, 0x0004, 0xac98, 0x000a, 0x23a0, 0x40a4,
+	0x603e, 0x6042, 0x604e, 0x6052, 0x6056, 0x605a, 0x605e, 0x6062,
+	0x6066, 0x606a, 0x606e, 0x6072, 0x6076, 0x607a, 0x607e, 0x6082,
+	0x6086, 0x608a, 0x608e, 0x6092, 0x6096, 0x609a, 0x609e, 0x60ae,
+	0x61a2, 0x0d7e, 0x60a4, 0xa06d, 0x0040, 0x4338, 0x1078, 0x13a4,
+	0x60a7, 0x0000, 0x60a8, 0xa06d, 0x0040, 0x4340, 0x1078, 0x13a4,
+	0x60ab, 0x0000, 0x0d7f, 0xa006, 0x604a, 0x6810, 0x603a, 0x680c,
+	0x6046, 0x6814, 0xa084, 0x00ff, 0x6042, 0x147f, 0x137f, 0x157f,
+	0x037f, 0x0d7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x6944, 0x6e48,
+	0xa684, 0x3fff, 0xa082, 0x4000, 0x00c8, 0x4424, 0xa18c, 0xff00,
+	0x810f, 0xa182, 0x00ff, 0x00c8, 0x442a, 0x2001, 0xa60c, 0x2004,
+	0xa084, 0x0003, 0x0040, 0x4385, 0x2001, 0xa60c, 0x2004, 0xd084,
+	0x00c0, 0x4405, 0xa188, 0xa735, 0x2104, 0xa065, 0x0040, 0x4405,
+	0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x4405, 0x6000,
+	0xd0c4, 0x0040, 0x4405, 0x0078, 0x4392, 0xa188, 0xa735, 0x2104,
+	0xa065, 0x0040, 0x43e9, 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006,
+	0x00c0, 0x43ef, 0x60a4, 0xa00d, 0x0040, 0x439a, 0x1078, 0x4817,
+	0x0040, 0x43e3, 0x60a8, 0xa00d, 0x0040, 0x43b4, 0x1078, 0x486a,
+	0x00c0, 0x43b4, 0x694c, 0xd1fc, 0x00c0, 0x43aa, 0x1078, 0x44df,
+	0x0078, 0x43de, 0x1078, 0x4484, 0x694c, 0xd1ec, 0x00c0, 0x43de,
+	0x1078, 0x46d6, 0x0078, 0x43de, 0x694c, 0xa184, 0xa000, 0x0040,
+	0x43ce, 0xd1ec, 0x0040, 0x43c7, 0xd1fc, 0x0040, 0x43c3, 0x1078,
+	0x46e7, 0x0078, 0x43ca, 0x1078, 0x46e7, 0x0078, 0x43ce, 0xd1fc,
+	0x0040, 0x43ce, 0x1078, 0x4484, 0x0078, 0x43de, 0x6050, 0xa00d,
+	0x0040, 0x43d9, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052, 0x0078,
+	0x43de, 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x1078, 0x5da9,
+	0xa006, 0x127f, 0x007c, 0x2001, 0x0005, 0x2009, 0x0000, 0x0078,
+	0x442e, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078, 0x442e, 0xa082,
+	0x0006, 0x00c8, 0x4405, 0x60a0, 0xd0bc, 0x00c0, 0x4401, 0x6100,
+	0xd1fc, 0x0040, 0x4392, 0x2001, 0x0029, 0x2009, 0x1000, 0x0078,
+	0x442e, 0x2001, 0x0028, 0x0078, 0x4420, 0x2009, 0xa60c, 0x210c,
+	0xd18c, 0x0040, 0x440f, 0x2001, 0x0004, 0x0078, 0x4420, 0xd184,
+	0x0040, 0x4416, 0x2001, 0x0004, 0x0078, 0x4420, 0x2001, 0x0029,
+	0x6100, 0xd1fc, 0x0040, 0x4420, 0x2009, 0x1000, 0x0078, 0x442e,
+	0x2009, 0x0000, 0x0078, 0x442e, 0x2001, 0x0029, 0x2009, 0x0000,
+	0x0078, 0x442e, 0x2001, 0x0029, 0x2009, 0x0000, 0xa005, 0x127f,
+	0x007c, 0x6944, 0x6e48, 0xa684, 0x3fff, 0xa082, 0x4000, 0x00c8,
+	0x447e, 0xa18c, 0xff00, 0x810f, 0xa182, 0x00ff, 0x00c8, 0x4464,
+	0xa188, 0xa735, 0x2104, 0xa065, 0x0040, 0x4464, 0x6004, 0xa084,
+	0x00ff, 0xa08e, 0x0006, 0x00c0, 0x446a, 0x684c, 0xd0ec, 0x0040,
+	0x4457, 0x1078, 0x46e7, 0x1078, 0x4484, 0x0078, 0x445f, 0x1078,
+	0x4484, 0x684c, 0xd0fc, 0x0040, 0x445f, 0x1078, 0x46d6, 0x1078,
+	0x472f, 0xa006, 0x0078, 0x4482, 0x2001, 0x0028, 0x2009, 0x0000,
+	0x0078, 0x4482, 0xa082, 0x0006, 0x00c8, 0x4478, 0x6100, 0xd1fc,
+	0x0040, 0x444d, 0x2001, 0x0029, 0x2009, 0x1000, 0x0078, 0x4482,
+	0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x4482, 0x2001, 0x0029,
+	0x2009, 0x0000, 0xa005, 0x007c, 0x127e, 0x2091, 0x8000, 0x6050,
+	0xa00d, 0x0040, 0x4492, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052,
+	0x127f, 0x007c, 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x0078,
+	0x4490, 0x127e, 0x2091, 0x8000, 0x604c, 0xa005, 0x0040, 0x44af,
+	0x0e7e, 0x2071, 0xa8b1, 0x7004, 0xa086, 0x0002, 0x0040, 0x44b6,
+	0x0e7f, 0x604c, 0x6802, 0x2d00, 0x604e, 0x127f, 0x007c, 0x2d00,
+	0x6052, 0x604e, 0x6803, 0x0000, 0x0078, 0x44ad, 0x701c, 0xac06,
+	0x00c0, 0x44a8, 0x604c, 0x2070, 0x7000, 0x6802, 0x2d00, 0x7002,
+	0x0e7f, 0x127f, 0x007c, 0x127e, 0x2091, 0x8000, 0x604c, 0xa06d,
+	0x0040, 0x44d1, 0x6800, 0xa005, 0x00c0, 0x44cf, 0x6052, 0x604e,
+	0xad05, 0x127f, 0x007c, 0x604c, 0xa06d, 0x0040, 0x44de, 0x6800,
+	0xa005, 0x00c0, 0x44dc, 0x6052, 0x604e, 0xad05, 0x007c, 0x6803,
+	0x0000, 0x6084, 0xa00d, 0x0040, 0x44e9, 0x2d00, 0x200a, 0x6086,
+	0x007c, 0x2d00, 0x6086, 0x6082, 0x0078, 0x44e8, 0x127e, 0x0c7e,
+	0x027e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6200, 0xa005, 0x0040,
+	0x44fc, 0xc285, 0x0078, 0x44fd, 0xc284, 0x6202, 0x027f, 0x0c7f,
+	0x127f, 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x6218, 0x2260,
+	0x6204, 0x007e, 0xa086, 0x0006, 0x00c0, 0x4521, 0x609c, 0xd0ac,
+	0x0040, 0x4521, 0x2001, 0xa653, 0x2004, 0xd0a4, 0x0040, 0x4521,
+	0xa284, 0xff00, 0x8007, 0xa086, 0x0007, 0x00c0, 0x4521, 0x2011,
+	0x0600, 0x007f, 0xa294, 0xff00, 0xa215, 0x6206, 0x007e, 0xa086,
+	0x0006, 0x00c0, 0x4531, 0x6290, 0x82ff, 0x00c0, 0x4531, 0x1078,
+	0x1332, 0x007f, 0x0c7f, 0x127f, 0x007c, 0x127e, 0x0c7e, 0x2091,
+	0x8000, 0x6218, 0x2260, 0x6204, 0x007e, 0xa086, 0x0006, 0x00c0,
+	0x4553, 0x609c, 0xd0a4, 0x0040, 0x4553, 0x2001, 0xa653, 0x2004,
+	0xd0ac, 0x00c0, 0x4553, 0xa284, 0x00ff, 0xa086, 0x0007, 0x00c0,
+	0x4553, 0x2011, 0x0006, 0x007f, 0xa294, 0x00ff, 0x8007, 0xa215,
+	0x6206, 0x0c7f, 0x127f, 0x007c, 0x027e, 0xa182, 0x00ff, 0x0048,
+	0x4565, 0xa085, 0x0001, 0x0078, 0x457d, 0xa190, 0xa735, 0x2204,
+	0xa065, 0x00c0, 0x457c, 0x017e, 0x0d7e, 0x1078, 0x1370, 0x2d60,
+	0x0d7f, 0x017f, 0x0040, 0x4561, 0x2c00, 0x2012, 0x60a7, 0x0000,
+	0x60ab, 0x0000, 0x1078, 0x42f8, 0xa006, 0x027f, 0x007c, 0x127e,
+	0x2091, 0x8000, 0x027e, 0xa182, 0x00ff, 0x0048, 0x458b, 0xa085,
+	0x0001, 0x0078, 0x45c1, 0x0d7e, 0xa190, 0xa735, 0x2204, 0xa06d,
+	0x0040, 0x45bf, 0x2013, 0x0000, 0x0d7e, 0x0c7e, 0x2d60, 0x60a4,
+	0xa06d, 0x0040, 0x459d, 0x1078, 0x13a4, 0x60a8, 0xa06d, 0x0040,
+	0x45a3, 0x1078, 0x13a4, 0x0c7f, 0x0d7f, 0x0d7e, 0x0c7e, 0x68ac,
+	0x2060, 0x8cff, 0x0040, 0x45bb, 0x600c, 0x007e, 0x6010, 0x2068,
+	0x1078, 0x8d06, 0x0040, 0x45b6, 0x1078, 0x13b4, 0x1078, 0x772d,
+	0x0c7f, 0x0078, 0x45a9, 0x0c7f, 0x0d7f, 0x1078, 0x13a4, 0x0d7f,
+	0xa006, 0x027f, 0x127f, 0x007c, 0x017e, 0xa182, 0x00ff, 0x0048,
+	0x45cd, 0xa085, 0x0001, 0x0078, 0x45d4, 0xa188, 0xa735, 0x2104,
+	0xa065, 0x0040, 0x45c9, 0xa006, 0x017f, 0x007c, 0x0d7e, 0x157e,
+	0x137e, 0x147e, 0x600b, 0x0000, 0x600f, 0x0000, 0x6000, 0xc08c,
+	0x6002, 0x2069, 0xab8e, 0x6808, 0x605e, 0x6810, 0x6062, 0x6138,
+	0xa10a, 0x0048, 0x45ec, 0x603a, 0x6814, 0x6066, 0x2099, 0xab96,
+	0xac88, 0x000a, 0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2099, 0xab9a,
+	0xac88, 0x0006, 0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2069, 0xabae,
+	0x6808, 0x606a, 0x690c, 0x616e, 0x6810, 0x6072, 0x6818, 0x6076,
+	0x60a0, 0xa086, 0x007e, 0x00c0, 0x4611, 0x2069, 0xab8e, 0x690c,
+	0x616e, 0xa182, 0x0211, 0x00c8, 0x4619, 0x2009, 0x0008, 0x0078,
+	0x4643, 0xa182, 0x0259, 0x00c8, 0x4621, 0x2009, 0x0007, 0x0078,
+	0x4643, 0xa182, 0x02c1, 0x00c8, 0x4629, 0x2009, 0x0006, 0x0078,
+	0x4643, 0xa182, 0x0349, 0x00c8, 0x4631, 0x2009, 0x0005, 0x0078,
+	0x4643, 0xa182, 0x0421, 0x00c8, 0x4639, 0x2009, 0x0004, 0x0078,
+	0x4643, 0xa182, 0x0581, 0x00c8, 0x4641, 0x2009, 0x0003, 0x0078,
+	0x4643, 0x2009, 0x0002, 0x6192, 0x147f, 0x137f, 0x157f, 0x0d7f,
+	0x007c, 0x017e, 0x027e, 0x0e7e, 0x2071, 0xab8d, 0x2e04, 0x6896,
+	0x2071, 0xab8e, 0x7004, 0x689a, 0x701c, 0x689e, 0x6a00, 0x2009,
+	0xa672, 0x210c, 0xd0bc, 0x0040, 0x4663, 0xd1ec, 0x0040, 0x4663,
+	0xc2ad, 0x0078, 0x4664, 0xc2ac, 0xd0c4, 0x0040, 0x466d, 0xd1e4,
+	0x0040, 0x466d, 0xc2bd, 0x0078, 0x466e, 0xc2bc, 0x6a02, 0x0e7f,
+	0x027f, 0x017f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x60a4,
+	0xa06d, 0x0040, 0x4697, 0x6900, 0x81ff, 0x00c0, 0x46ab, 0x6a04,
+	0xa282, 0x0010, 0x00c8, 0x46b0, 0xad88, 0x0004, 0x20a9, 0x0010,
+	0x2104, 0xa086, 0xffff, 0x0040, 0x4692, 0x8108, 0x00f0, 0x4688,
+	0x1078, 0x1332, 0x260a, 0x8210, 0x6a06, 0x0078, 0x46ab, 0x1078,
+	0x138b, 0x0040, 0x46b0, 0x2d00, 0x60a6, 0x6803, 0x0000, 0xad88,
+	0x0004, 0x20a9, 0x0010, 0x200b, 0xffff, 0x8108, 0x00f0, 0x46a3,
+	0x6807, 0x0001, 0x6e12, 0xa085, 0x0001, 0x127f, 0x0d7f, 0x007c,
+	0xa006, 0x0078, 0x46ad, 0x127e, 0x2091, 0x8000, 0x0d7e, 0x60a4,
+	0xa00d, 0x0040, 0x46d3, 0x2168, 0x6800, 0xa005, 0x00c0, 0x46cf,
+	0x1078, 0x4817, 0x00c0, 0x46d3, 0x200b, 0xffff, 0x6804, 0xa08a,
+	0x0002, 0x0048, 0x46cf, 0x8001, 0x6806, 0x0078, 0x46d3, 0x1078,
+	0x13a4, 0x60a7, 0x0000, 0x0d7f, 0x127f, 0x007c, 0x127e, 0x2091,
+	0x8000, 0x1078, 0x487f, 0x0078, 0x46df, 0x1078, 0x4484, 0x1078,
+	0x4775, 0x00c0, 0x46dd, 0x1078, 0x472f, 0x127f, 0x007c, 0x0d7e,
+	0x127e, 0x2091, 0x8000, 0x60a8, 0xa06d, 0x0040, 0x470b, 0x6950,
+	0x81ff, 0x00c0, 0x471f, 0x6a54, 0xa282, 0x0010, 0x00c8, 0x472c,
+	0xad88, 0x0018, 0x20a9, 0x0010, 0x2104, 0xa086, 0xffff, 0x0040,
+	0x4706, 0x8108, 0x00f0, 0x46fc, 0x1078, 0x1332, 0x260a, 0x8210,
+	0x6a56, 0x0078, 0x471f, 0x1078, 0x138b, 0x0040, 0x472c, 0x2d00,
+	0x60aa, 0x6853, 0x0000, 0xad88, 0x0018, 0x20a9, 0x0010, 0x200b,
+	0xffff, 0x8108, 0x00f0, 0x4717, 0x6857, 0x0001, 0x6e62, 0x0078,
+	0x4723, 0x1078, 0x44df, 0x1078, 0x4739, 0x00c0, 0x4721, 0xa085,
+	0x0001, 0x127f, 0x0d7f, 0x007c, 0xa006, 0x0078, 0x4729, 0x127e,
+	0x2091, 0x8000, 0x1078, 0x5da9, 0x127f, 0x007c, 0xa01e, 0x0078,
+	0x473b, 0x2019, 0x0001, 0xa00e, 0x127e, 0x2091, 0x8000, 0x604c,
+	0x2068, 0x6000, 0xd0dc, 0x00c0, 0x4759, 0x8dff, 0x0040, 0x4770,
+	0x83ff, 0x0040, 0x4751, 0x6848, 0xa606, 0x0040, 0x475e, 0x0078,
+	0x4759, 0x683c, 0xa406, 0x00c0, 0x4759, 0x6840, 0xa506, 0x0040,
+	0x475e, 0x2d08, 0x6800, 0x2068, 0x0078, 0x4745, 0x1078, 0x7233,
+	0x6a00, 0x604c, 0xad06, 0x00c0, 0x4768, 0x624e, 0x0078, 0x476b,
+	0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0, 0x4770, 0x6152, 0x8dff,
+	0x127f, 0x007c, 0xa01e, 0x0078, 0x4777, 0x2019, 0x0001, 0xa00e,
+	0x6080, 0x2068, 0x8dff, 0x0040, 0x47a3, 0x83ff, 0x0040, 0x4786,
+	0x6848, 0xa606, 0x0040, 0x4793, 0x0078, 0x478e, 0x683c, 0xa406,
+	0x00c0, 0x478e, 0x6840, 0xa506, 0x0040, 0x4793, 0x2d08, 0x6800,
+	0x2068, 0x0078, 0x477a, 0x6a00, 0x6080, 0xad06, 0x00c0, 0x479b,
+	0x6282, 0x0078, 0x479e, 0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0,
+	0x47a3, 0x6186, 0x8dff, 0x007c, 0xa016, 0x1078, 0x4810, 0x00c0,
+	0x47ab, 0x2011, 0x0001, 0x1078, 0x4863, 0x00c0, 0x47b1, 0xa295,
+	0x0002, 0x007c, 0x1078, 0x489b, 0x0040, 0x47ba, 0x1078, 0x8dca,
+	0x0078, 0x47bc, 0xa085, 0x0001, 0x007c, 0x1078, 0x489b, 0x0040,
+	0x47c5, 0x1078, 0x8d62, 0x0078, 0x47c7, 0xa085, 0x0001, 0x007c,
+	0x1078, 0x489b, 0x0040, 0x47d0, 0x1078, 0x8dac, 0x0078, 0x47d2,
+	0xa085, 0x0001, 0x007c, 0x1078, 0x489b, 0x0040, 0x47db, 0x1078,
+	0x8d7e, 0x0078, 0x47dd, 0xa085, 0x0001, 0x007c, 0x1078, 0x489b,
+	0x0040, 0x47e6, 0x1078, 0x8de8, 0x0078, 0x47e8, 0xa085, 0x0001,
+	0x007c, 0x127e, 0x007e, 0x0d7e, 0x2091, 0x8000, 0x6080, 0xa06d,
+	0x0040, 0x4808, 0x6800, 0x007e, 0x6837, 0x0103, 0x6b4a, 0x6847,
+	0x0000, 0x1078, 0x8f7d, 0x007e, 0x6000, 0xd0fc, 0x0040, 0x4802,
+	0x1078, 0xa4ed, 0x007f, 0x1078, 0x4a73, 0x007f, 0x0078, 0x47ef,
+	0x6083, 0x0000, 0x6087, 0x0000, 0x0d7f, 0x007f, 0x127f, 0x007c,
+	0x60a4, 0xa00d, 0x00c0, 0x4817, 0xa085, 0x0001, 0x007c, 0x0e7e,
+	0x2170, 0x7000, 0xa005, 0x00c0, 0x482c, 0x20a9, 0x0010, 0xae88,
+	0x0004, 0x2104, 0xa606, 0x0040, 0x482c, 0x8108, 0x00f0, 0x4821,
+	0xa085, 0x0001, 0x0078, 0x482d, 0xa006, 0x0e7f, 0x007c, 0x0d7e,
+	0x127e, 0x2091, 0x8000, 0x60a4, 0xa06d, 0x00c0, 0x483d, 0x1078,
+	0x138b, 0x0040, 0x484f, 0x2d00, 0x60a6, 0x6803, 0x0001, 0x6807,
+	0x0000, 0xad88, 0x0004, 0x20a9, 0x0010, 0x200b, 0xffff, 0x8108,
+	0x00f0, 0x4845, 0xa085, 0x0001, 0x127f, 0x0d7f, 0x007c, 0xa006,
+	0x0078, 0x484c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x60a4, 0xa06d,
+	0x0040, 0x4860, 0x60a7, 0x0000, 0x1078, 0x13a4, 0xa085, 0x0001,
+	0x127f, 0x0d7f, 0x007c, 0x60a8, 0xa00d, 0x00c0, 0x486a, 0xa085,
+	0x0001, 0x007c, 0x0e7e, 0x2170, 0x7050, 0xa005, 0x00c0, 0x487d,
+	0x20a9, 0x0010, 0xae88, 0x0018, 0x2104, 0xa606, 0x0040, 0x487d,
+	0x8108, 0x00f0, 0x4874, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x127e,
+	0x2091, 0x8000, 0x1078, 0x4863, 0x00c0, 0x4899, 0x200b, 0xffff,
+	0x0d7e, 0x60a8, 0x2068, 0x6854, 0xa08a, 0x0002, 0x0048, 0x4894,
+	0x8001, 0x6856, 0x0078, 0x4898, 0x1078, 0x13a4, 0x60ab, 0x0000,
+	0x0d7f, 0x127f, 0x007c, 0x609c, 0xd0a4, 0x007c, 0x0f7e, 0x71b0,
+	0x81ff, 0x00c0, 0x48b9, 0x71cc, 0xd19c, 0x0040, 0x48b9, 0x2001,
+	0x007e, 0xa080, 0xa735, 0x2004, 0xa07d, 0x0040, 0x48b9, 0x7804,
+	0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x48b9, 0x7800, 0xc0ed,
+	0x7802, 0x2079, 0xa652, 0x7804, 0xd0a4, 0x0040, 0x48df, 0x157e,
+	0x0c7e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x45c4,
+	0x00c0, 0x48d9, 0x6004, 0xa084, 0xff00, 0x8007, 0xa096, 0x0004,
+	0x0040, 0x48d6, 0xa086, 0x0006, 0x00c0, 0x48d9, 0x6000, 0xc0ed,
+	0x6002, 0x017f, 0x8108, 0x00f0, 0x48c5, 0x0c7f, 0x157f, 0x1078,
+	0x4967, 0x0040, 0x48e8, 0x2001, 0xa8a1, 0x200c, 0x0078, 0x48f0,
+	0x2079, 0xa652, 0x7804, 0xd0a4, 0x0040, 0x48f4, 0x2009, 0x07d0,
+	0x2011, 0x48f6, 0x1078, 0x5add, 0x0f7f, 0x007c, 0x2011, 0x48f6,
+	0x1078, 0x5a45, 0x1078, 0x4967, 0x0040, 0x491e, 0x2001, 0xa7b3,
+	0x2004, 0xa080, 0x0000, 0x200c, 0xc1ec, 0x2102, 0x2001, 0xa653,
+	0x2004, 0xd0a4, 0x0040, 0x4912, 0x2009, 0x07d0, 0x2011, 0x48f6,
+	0x1078, 0x5add, 0x0e7e, 0x2071, 0xa600, 0x706f, 0x0000, 0x7073,
+	0x0000, 0x1078, 0x2677, 0x0e7f, 0x0078, 0x4956, 0x157e, 0x0c7e,
+	0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x45c4, 0x00c0,
+	0x4950, 0x6000, 0xd0ec, 0x0040, 0x4950, 0x047e, 0x62a0, 0xa294,
+	0x00ff, 0x8227, 0xa006, 0x2009, 0x0029, 0x1078, 0xa21d, 0x6000,
+	0xc0e5, 0xc0ec, 0x6002, 0x6004, 0xa084, 0x00ff, 0xa085, 0x0700,
+	0x6006, 0x2019, 0x0029, 0x1078, 0x5f01, 0x077e, 0x2039, 0x0000,
+	0x1078, 0x5e0a, 0x2009, 0x0000, 0x1078, 0x9f8b, 0x077f, 0x047f,
+	0x017f, 0x8108, 0x00f0, 0x4924, 0x0c7f, 0x157f, 0x007c, 0x0c7e,
+	0x6018, 0x2060, 0x6000, 0xc0ec, 0x6002, 0x0c7f, 0x007c, 0x7818,
+	0x2004, 0xd0ac, 0x007c, 0x7818, 0x2004, 0xd0bc, 0x007c, 0x0f7e,
+	0x2001, 0xa7b3, 0x2004, 0xa07d, 0x0040, 0x4970, 0x7800, 0xd0ec,
+	0x0f7f, 0x007c, 0x127e, 0x027e, 0x2091, 0x8000, 0x007e, 0x62a0,
+	0xa290, 0xa735, 0x2204, 0xac06, 0x10c0, 0x1332, 0x007f, 0x6200,
+	0xa005, 0x0040, 0x4986, 0xc2fd, 0x0078, 0x4987, 0xc2fc, 0x6202,
+	0x027f, 0x127f, 0x007c, 0x2011, 0xa633, 0x2204, 0xd0cc, 0x0040,
+	0x4998, 0x2001, 0xa89f, 0x200c, 0x2011, 0x4999, 0x1078, 0x5add,
+	0x007c, 0x2011, 0x4999, 0x1078, 0x5a45, 0x2011, 0xa633, 0x2204,
+	0xc0cc, 0x2012, 0x007c, 0x2071, 0xa714, 0x7003, 0x0001, 0x7007,
+	0x0000, 0x7013, 0x0000, 0x7017, 0x0000, 0x701b, 0x0000, 0x701f,
+	0x0000, 0x700b, 0x0000, 0x704b, 0x0001, 0x704f, 0x0000, 0x705b,
+	0x0020, 0x705f, 0x0040, 0x707f, 0x0000, 0x2071, 0xa87d, 0x7003,
+	0xa714, 0x7007, 0x0000, 0x700b, 0x0000, 0x700f, 0xa85d, 0x7013,
+	0x0020, 0x7017, 0x0040, 0x7037, 0x0000, 0x007c, 0x017e, 0x0e7e,
+	0x2071, 0xa835, 0xa00e, 0x7186, 0x718a, 0x7097, 0x0001, 0x2001,
+	0xa653, 0x2004, 0xd0fc, 0x00c0, 0x49e8, 0x2001, 0xa653, 0x2004,
+	0xa00e, 0xd09c, 0x0040, 0x49e5, 0x8108, 0x7102, 0x0078, 0x4a3b,
+	0x2001, 0xa672, 0x200c, 0xa184, 0x000f, 0x2009, 0xa673, 0x210c,
+	0x0079, 0x49f2, 0x49dd, 0x4a13, 0x4a1b, 0x4a26, 0x4a2c, 0x49dd,
+	0x49dd, 0x49dd, 0x4a02, 0x49dd, 0x49dd, 0x49dd, 0x49dd, 0x49dd,
+	0x49dd, 0x49dd, 0x7003, 0x0004, 0x137e, 0x147e, 0x157e, 0x2099,
+	0xa676, 0x20a1, 0xa886, 0x20a9, 0x0004, 0x53a3, 0x157f, 0x147f,
+	0x137f, 0x0078, 0x4a3b, 0x708f, 0x0005, 0x7007, 0x0122, 0x2001,
+	0x0002, 0x0078, 0x4a21, 0x708f, 0x0002, 0x7007, 0x0121, 0x2001,
+	0x0003, 0x7002, 0x7097, 0x0001, 0x0078, 0x4a38, 0x7007, 0x0122,
+	0x2001, 0x0002, 0x0078, 0x4a30, 0x7007, 0x0121, 0x2001, 0x0003,
+	0x7002, 0xa006, 0x7096, 0x708e, 0xa184, 0xff00, 0x8007, 0x709a,
+	0xa184, 0x00ff, 0x7092, 0x0e7f, 0x017f, 0x007c, 0x0e7e, 0x2071,
+	0xa714, 0x684c, 0xa005, 0x00c0, 0x4a4c, 0x7028, 0xc085, 0x702a,
+	0xa085, 0x0001, 0x0078, 0x4a71, 0x6a60, 0x7236, 0x6b64, 0x733a,
+	0x6868, 0x703e, 0x7076, 0x686c, 0x7042, 0x707a, 0x684c, 0x702e,
+	0x6844, 0x7032, 0x2009, 0x000d, 0x200a, 0x700b, 0x0000, 0x8007,
+	0x8006, 0x8006, 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100,
+	0xa319, 0x726e, 0x7372, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001,
+	0xa006, 0x0e7f, 0x007c, 0x0e7e, 0x027e, 0x6838, 0xd0fc, 0x00c0,
+	0x4ac9, 0x6804, 0xa00d, 0x0040, 0x4a8f, 0x0d7e, 0x2071, 0xa600,
+	0xa016, 0x702c, 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff,
+	0x00c0, 0x4a82, 0x702e, 0x70ac, 0xa200, 0x70ae, 0x0d7f, 0x2071,
+	0xa714, 0x701c, 0xa005, 0x00c0, 0x4adb, 0x0068, 0x4ad9, 0x2071,
+	0xa835, 0x7200, 0x82ff, 0x0040, 0x4ad9, 0x6934, 0xa186, 0x0103,
+	0x00c0, 0x4aec, 0x6948, 0x6844, 0xa105, 0x00c0, 0x4acc, 0x2009,
+	0x8020, 0x2200, 0x0079, 0x4aac, 0x4ad9, 0x4ab1, 0x4b09, 0x4b17,
+	0x4ad9, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0, 0x4ad9, 0x7122,
+	0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001, 0x2091, 0x4080,
+	0x2071, 0xa600, 0x702c, 0x206a, 0x2d00, 0x702e, 0x70ac, 0x8000,
+	0x70ae, 0x027f, 0x0e7f, 0x007c, 0x6844, 0xa086, 0x0100, 0x00c0,
+	0x4ad9, 0x6868, 0xa005, 0x00c0, 0x4ad9, 0x2009, 0x8020, 0x0078,
+	0x4aa9, 0x2071, 0xa714, 0x2d08, 0x206b, 0x0000, 0x7010, 0x8000,
+	0x7012, 0x7018, 0xa06d, 0x711a, 0x0040, 0x4ae9, 0x6902, 0x0078,
+	0x4aea, 0x711e, 0x0078, 0x4ac9, 0xa18c, 0x00ff, 0xa186, 0x0017,
+	0x0040, 0x4afa, 0xa186, 0x001e, 0x0040, 0x4afa, 0xa18e, 0x001f,
+	0x00c0, 0x4ad9, 0x684c, 0xd0cc, 0x0040, 0x4ad9, 0x6850, 0xa084,
+	0x00ff, 0xa086, 0x0001, 0x00c0, 0x4ad9, 0x2009, 0x8021, 0x0078,
+	0x4aa9, 0x7084, 0x8008, 0xa092, 0x001e, 0x00c8, 0x4ad9, 0x7186,
+	0xae90, 0x0003, 0xa210, 0x683c, 0x2012, 0x0078, 0x4b27, 0x7084,
+	0x8008, 0xa092, 0x000f, 0x00c8, 0x4ad9, 0x7186, 0xae90, 0x0003,
+	0x8003, 0xa210, 0x683c, 0x2012, 0x8210, 0x6840, 0x2012, 0x7088,
+	0xa10a, 0x0048, 0x4ac0, 0x718c, 0x7084, 0xa10a, 0x0048, 0x4ac0,
+	0x2071, 0x0000, 0x7018, 0xd084, 0x00c0, 0x4ac0, 0x2071, 0xa835,
+	0x7000, 0xa086, 0x0002, 0x00c0, 0x4b47, 0x1078, 0x4dc3, 0x2071,
+	0x0000, 0x701b, 0x0001, 0x2091, 0x4080, 0x0078, 0x4ac0, 0x1078,
+	0x4dee, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091, 0x4080, 0x0078,
+	0x4ac0, 0x007e, 0x684c, 0x007e, 0x6837, 0x0103, 0x20a9, 0x001c,
+	0xad80, 0x0011, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x007f, 0xa084,
+	0x00ff, 0x684e, 0x007f, 0x684a, 0x6952, 0x007c, 0x2071, 0xa714,
+	0x7004, 0x0079, 0x4b6b, 0x4b75, 0x4b86, 0x4d94, 0x4d95, 0x4dbc,
+	0x4dc2, 0x4b76, 0x4d82, 0x4d23, 0x4da5, 0x007c, 0x127e, 0x2091,
+	0x8000, 0x0068, 0x4b85, 0x2009, 0x000d, 0x7030, 0x200a, 0x2091,
+	0x4080, 0x7007, 0x0001, 0x700b, 0x0000, 0x127f, 0x2069, 0xa8c4,
+	0x6844, 0xa005, 0x0050, 0x4bae, 0x00c0, 0x4bae, 0x127e, 0x2091,
+	0x8000, 0x2069, 0x0000, 0x6934, 0x2001, 0xa720, 0x2004, 0xa10a,
+	0x0040, 0x4ba9, 0x0068, 0x4bad, 0x2069, 0x0000, 0x6818, 0xd084,
+	0x00c0, 0x4bad, 0x2009, 0x8040, 0x6922, 0x681b, 0x0001, 0x2091,
+	0x4080, 0x2069, 0xa8c4, 0x6847, 0xffff, 0x127f, 0x2069, 0xa600,
+	0x6848, 0x6964, 0xa102, 0x2069, 0xa835, 0x688a, 0x6984, 0x701c,
+	0xa06d, 0x0040, 0x4bc0, 0x81ff, 0x0040, 0x4c08, 0x0078, 0x4bd6,
+	0x81ff, 0x0040, 0x4cda, 0x2071, 0xa835, 0x7184, 0x7088, 0xa10a,
+	0x00c8, 0x4bd6, 0x7190, 0x2071, 0xa8c4, 0x7040, 0xa005, 0x0040,
+	0x4bd6, 0x00d0, 0x4cda, 0x7142, 0x0078, 0x4cda, 0x2071, 0xa835,
+	0x718c, 0x127e, 0x2091, 0x8000, 0x7084, 0xa10a, 0x0048, 0x4cf7,
+	0x0068, 0x4c8c, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0, 0x4c8c,
+	0x2001, 0xffff, 0x2071, 0xa8c4, 0x7042, 0x2071, 0xa835, 0x7000,
+	0xa086, 0x0002, 0x00c0, 0x4bfe, 0x1078, 0x4dc3, 0x2071, 0x0000,
+	0x701b, 0x0001, 0x2091, 0x4080, 0x0078, 0x4c8c, 0x1078, 0x4dee,
+	0x2071, 0x0000, 0x701b, 0x0001, 0x2091, 0x4080, 0x0078, 0x4c8c,
+	0x2071, 0xa835, 0x7000, 0xa005, 0x0040, 0x4cb9, 0x6934, 0xa186,
+	0x0103, 0x00c0, 0x4c8f, 0x684c, 0xd0bc, 0x00c0, 0x4cb9, 0x6948,
+	0x6844, 0xa105, 0x00c0, 0x4cac, 0x2009, 0x8020, 0x2071, 0xa835,
+	0x7000, 0x0079, 0x4c23, 0x4cb9, 0x4c71, 0x4c49, 0x4c5b, 0x4c28,
+	0x137e, 0x147e, 0x157e, 0x2099, 0xa676, 0x20a1, 0xa886, 0x20a9,
+	0x0004, 0x53a3, 0x157f, 0x147f, 0x137f, 0x2071, 0xa87d, 0xad80,
+	0x000f, 0x700e, 0x7013, 0x0002, 0x7007, 0x0002, 0x700b, 0x0000,
+	0x2e10, 0x1078, 0x13db, 0x2071, 0xa714, 0x7007, 0x0009, 0x0078,
+	0x4cda, 0x7084, 0x8008, 0xa092, 0x001e, 0x00c8, 0x4cda, 0xae90,
+	0x0003, 0xa210, 0x683c, 0x2012, 0x7186, 0x2071, 0xa714, 0x1078,
+	0x4e4c, 0x0078, 0x4cda, 0x7084, 0x8008, 0xa092, 0x000f, 0x00c8,
+	0x4cda, 0xae90, 0x0003, 0x8003, 0xa210, 0x683c, 0x2012, 0x8210,
+	0x6840, 0x2012, 0x7186, 0x2071, 0xa714, 0x1078, 0x4e4c, 0x0078,
+	0x4cda, 0x127e, 0x2091, 0x8000, 0x0068, 0x4c8c, 0x2071, 0x0000,
+	0x7018, 0xd084, 0x00c0, 0x4c8c, 0x7122, 0x683c, 0x7026, 0x6840,
+	0x702a, 0x701b, 0x0001, 0x2091, 0x4080, 0x127f, 0x2071, 0xa714,
+	0x1078, 0x4e4c, 0x0078, 0x4cda, 0x127f, 0x0078, 0x4cda, 0xa18c,
+	0x00ff, 0xa186, 0x0017, 0x0040, 0x4c9d, 0xa186, 0x001e, 0x0040,
+	0x4c9d, 0xa18e, 0x001f, 0x00c0, 0x4cb9, 0x684c, 0xd0cc, 0x0040,
+	0x4cb9, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0, 0x4cb9,
+	0x2009, 0x8021, 0x0078, 0x4c1e, 0x6844, 0xa086, 0x0100, 0x00c0,
+	0x4cb9, 0x6868, 0xa005, 0x00c0, 0x4cb9, 0x2009, 0x8020, 0x0078,
+	0x4c1e, 0x2071, 0xa714, 0x1078, 0x4e60, 0x0040, 0x4cda, 0x2071,
+	0xa714, 0x700f, 0x0001, 0x6934, 0xa184, 0x00ff, 0xa086, 0x0003,
+	0x00c0, 0x4cd1, 0x810f, 0xa18c, 0x00ff, 0x8101, 0x0040, 0x4cd1,
+	0x710e, 0x7007, 0x0003, 0x1078, 0x4e80, 0x7050, 0xa086, 0x0100,
+	0x0040, 0x4d95, 0x127e, 0x2091, 0x8000, 0x2071, 0xa714, 0x7008,
+	0xa086, 0x0001, 0x00c0, 0x4cf5, 0x0068, 0x4cf5, 0x2009, 0x000d,
+	0x7030, 0x200a, 0x2091, 0x4080, 0x700b, 0x0000, 0x7004, 0xa086,
+	0x0006, 0x00c0, 0x4cf5, 0x7007, 0x0001, 0x127f, 0x007c, 0x2071,
+	0xa714, 0x1078, 0x4e60, 0x0040, 0x4d20, 0x2071, 0xa835, 0x7084,
+	0x700a, 0x20a9, 0x0020, 0x2099, 0xa836, 0x20a1, 0xa85d, 0x53a3,
+	0x7087, 0x0000, 0x2071, 0xa714, 0x2069, 0xa87d, 0x706c, 0x6826,
+	0x7070, 0x682a, 0x7074, 0x682e, 0x7078, 0x6832, 0x2d10, 0x1078,
+	0x13db, 0x7007, 0x0008, 0x2001, 0xffff, 0x2071, 0xa8c4, 0x7042,
+	0x127f, 0x0078, 0x4cda, 0x2069, 0xa87d, 0x6808, 0xa08e, 0x0000,
+	0x0040, 0x4d81, 0xa08e, 0x0200, 0x0040, 0x4d7f, 0xa08e, 0x0100,
+	0x00c0, 0x4d81, 0x127e, 0x2091, 0x8000, 0x0068, 0x4d7c, 0x2069,
+	0x0000, 0x6818, 0xd084, 0x00c0, 0x4d7c, 0x702c, 0x7130, 0x8108,
+	0xa102, 0x0048, 0x4d4a, 0xa00e, 0x7034, 0x706e, 0x7038, 0x7072,
+	0x0078, 0x4d54, 0x706c, 0xa080, 0x0040, 0x706e, 0x00c8, 0x4d54,
+	0x7070, 0xa081, 0x0000, 0x7072, 0x7132, 0x6936, 0x700b, 0x0000,
+	0x2001, 0xa85a, 0x2004, 0xa005, 0x00c0, 0x4d73, 0x6934, 0x2069,
+	0xa835, 0x689c, 0x699e, 0x2069, 0xa8c4, 0xa102, 0x00c0, 0x4d6c,
+	0x6844, 0xa005, 0x00d0, 0x4d7a, 0x2001, 0xa85b, 0x200c, 0x810d,
+	0x6946, 0x0078, 0x4d7a, 0x2009, 0x8040, 0x6922, 0x681b, 0x0001,
+	0x2091, 0x4080, 0x7007, 0x0001, 0x127f, 0x0078, 0x4d81, 0x7007,
+	0x0005, 0x007c, 0x701c, 0xa06d, 0x0040, 0x4d93, 0x1078, 0x4e60,
+	0x0040, 0x4d93, 0x7007, 0x0003, 0x1078, 0x4e80, 0x7050, 0xa086,
+	0x0100, 0x0040, 0x4d95, 0x007c, 0x007c, 0x7050, 0xa09e, 0x0100,
+	0x00c0, 0x4d9e, 0x7007, 0x0004, 0x0078, 0x4dbc, 0xa086, 0x0200,
+	0x00c0, 0x4da4, 0x7007, 0x0005, 0x007c, 0x2001, 0xa87f, 0x2004,
+	0xa08e, 0x0100, 0x00c0, 0x4db1, 0x7007, 0x0001, 0x1078, 0x4e4c,
+	0x007c, 0xa08e, 0x0000, 0x0040, 0x4db0, 0xa08e, 0x0200, 0x00c0,
+	0x4db0, 0x7007, 0x0005, 0x007c, 0x1078, 0x4e16, 0x7006, 0x1078,
+	0x4e4c, 0x007c, 0x007c, 0x0e7e, 0x157e, 0x2071, 0xa835, 0x7184,
+	0x81ff, 0x0040, 0x4deb, 0xa006, 0x7086, 0xae80, 0x0003, 0x2071,
+	0x0000, 0x21a8, 0x2014, 0x7226, 0x8000, 0x0070, 0x4de8, 0x2014,
+	0x722a, 0x8000, 0x0070, 0x4de8, 0x2014, 0x722e, 0x8000, 0x0070,
+	0x4de8, 0x2014, 0x723a, 0x8000, 0x0070, 0x4de8, 0x2014, 0x723e,
+	0xa180, 0x8030, 0x7022, 0x157f, 0x0e7f, 0x007c, 0x0e7e, 0x157e,
+	0x2071, 0xa835, 0x7184, 0x81ff, 0x0040, 0x4e13, 0xa006, 0x7086,
+	0xae80, 0x0003, 0x2071, 0x0000, 0x21a8, 0x2014, 0x7226, 0x8000,
+	0x2014, 0x722a, 0x8000, 0x0070, 0x4e0c, 0x2014, 0x723a, 0x8000,
+	0x2014, 0x723e, 0x0078, 0x4e10, 0x2001, 0x8020, 0x0078, 0x4e12,
+	0x2001, 0x8042, 0x7022, 0x157f, 0x0e7f, 0x007c, 0x702c, 0x7130,
+	0x8108, 0xa102, 0x0048, 0x4e23, 0xa00e, 0x7034, 0x706e, 0x7038,
+	0x7072, 0x0078, 0x4e2d, 0x706c, 0xa080, 0x0040, 0x706e, 0x00c8,
+	0x4e2d, 0x7070, 0xa081, 0x0000, 0x7072, 0x7132, 0x700c, 0x8001,
+	0x700e, 0x00c0, 0x4e43, 0x127e, 0x2091, 0x8000, 0x0068, 0x4e46,
+	0x2001, 0x000d, 0x2102, 0x2091, 0x4080, 0x2001, 0x0001, 0x700b,
+	0x0000, 0x127f, 0x007c, 0x2001, 0x0007, 0x007c, 0x2001, 0x0006,
+	0x700b, 0x0001, 0x127f, 0x007c, 0x701c, 0xa06d, 0x0040, 0x4e5f,
+	0x127e, 0x2091, 0x8000, 0x7010, 0x8001, 0x7012, 0x2d04, 0x701e,
+	0xa005, 0x00c0, 0x4e5c, 0x701a, 0x127f, 0x1078, 0x13a4, 0x007c,
+	0x2019, 0x000d, 0x2304, 0x230c, 0xa10e, 0x0040, 0x4e6f, 0x2304,
+	0x230c, 0xa10e, 0x0040, 0x4e6f, 0xa006, 0x0078, 0x4e7f, 0x732c,
+	0x8319, 0x7130, 0xa102, 0x00c0, 0x4e79, 0x2300, 0xa005, 0x0078,
+	0x4e7f, 0x0048, 0x4e7e, 0xa302, 0x0078, 0x4e7f, 0x8002, 0x007c,
+	0x2d00, 0x7026, 0xa080, 0x000d, 0x7056, 0x7053, 0x0000, 0x127e,
+	0x2091, 0x8000, 0x2009, 0xa8d6, 0x2104, 0xc08d, 0x200a, 0x127f,
+	0x1078, 0x13f9, 0x007c, 0x2071, 0xa6e2, 0x7003, 0x0000, 0x7007,
+	0x0000, 0x700f, 0x0000, 0x702b, 0x0001, 0x704f, 0x0000, 0x7053,
+	0x0001, 0x705f, 0x0020, 0x7063, 0x0040, 0x7083, 0x0000, 0x708b,
+	0x0000, 0x708f, 0x0001, 0x70bf, 0x0000, 0x007c, 0x0e7e, 0x2071,
+	0xa6e2, 0x6848, 0xa005, 0x00c0, 0x4ebc, 0x7028, 0xc085, 0x702a,
+	0xa085, 0x0001, 0x0078, 0x4ee1, 0x6a50, 0x7236, 0x6b54, 0x733a,
+	0x6858, 0x703e, 0x707a, 0x685c, 0x7042, 0x707e, 0x6848, 0x702e,
+	0x6840, 0x7032, 0x2009, 0x000c, 0x200a, 0x8007, 0x8006, 0x8006,
+	0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100, 0xa319, 0x7272,
+	0x7376, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0x700f, 0x0000,
+	0xa006, 0x0e7f, 0x007c, 0x2b78, 0x2071, 0xa6e2, 0x7004, 0x1079,
+	0x4f41, 0x700c, 0x0079, 0x4eec, 0x4ef1, 0x4ee6, 0x4ee6, 0x4ee6,
+	0x4ee6, 0x007c, 0x700c, 0x0079, 0x4ef5, 0x4efa, 0x4f3f, 0x4f3f,
+	0x4f40, 0x4f40, 0x7830, 0x7930, 0xa106, 0x0040, 0x4f04, 0x7830,
+	0x7930, 0xa106, 0x00c0, 0x4f2a, 0x7030, 0xa10a, 0x0040, 0x4f2a,
+	0x00c8, 0x4f0c, 0x712c, 0xa10a, 0xa18a, 0x0002, 0x00c8, 0x4f2b,
+	0x1078, 0x1370, 0x0040, 0x4f2a, 0x2d00, 0x705a, 0x7063, 0x0040,
+	0x2001, 0x0003, 0x7057, 0x0000, 0x127e, 0x007e, 0x2091, 0x8000,
+	0x2009, 0xa8d6, 0x2104, 0xc085, 0x200a, 0x007f, 0x700e, 0x127f,
+	0x1078, 0x13f9, 0x007c, 0x1078, 0x1370, 0x0040, 0x4f2a, 0x2d00,
+	0x705a, 0x1078, 0x1370, 0x00c0, 0x4f37, 0x0078, 0x4f16, 0x2d00,
+	0x7086, 0x7063, 0x0080, 0x2001, 0x0004, 0x0078, 0x4f1a, 0x007c,
+	0x007c, 0x4f52, 0x4f53, 0x4f8a, 0x4f8b, 0x4f3f, 0x4fc1, 0x4fc6,
+	0x4ffd, 0x4ffe, 0x5019, 0x501a, 0x501b, 0x501c, 0x501d, 0x501e,
+	0x509e, 0x50c8, 0x007c, 0x700c, 0x0079, 0x4f56, 0x4f5b, 0x4f5e,
+	0x4f6e, 0x4f89, 0x4f89, 0x1078, 0x4ef2, 0x007c, 0x127e, 0x8001,
+	0x700e, 0x7058, 0x007e, 0x1078, 0x5464, 0x0040, 0x4f6b, 0x2091,
+	0x8000, 0x1078, 0x4ef2, 0x0d7f, 0x0078, 0x4f77, 0x127e, 0x8001,
+	0x700e, 0x1078, 0x5464, 0x7058, 0x2068, 0x7084, 0x705a, 0x6803,
+	0x0000, 0x6807, 0x0000, 0x6834, 0xa084, 0x00ff, 0xa08a, 0x0020,
+	0x00c8, 0x4f86, 0x1079, 0x4fa1, 0x127f, 0x007c, 0x127f, 0x1078,
+	0x501f, 0x007c, 0x007c, 0x007c, 0x0e7e, 0x2071, 0xa6e2, 0x700c,
+	0x0079, 0x4f92, 0x4f97, 0x4f97, 0x4f97, 0x4f99, 0x4f9d, 0x0e7f,
+	0x007c, 0x700f, 0x0001, 0x0078, 0x4f9f, 0x700f, 0x0002, 0x0e7f,
+	0x007c, 0x501f, 0x501f, 0x503b, 0x501f, 0x5171, 0x501f, 0x501f,
+	0x501f, 0x501f, 0x501f, 0x503b, 0x51bb, 0x5208, 0x5261, 0x5277,
+	0x501f, 0x501f, 0x5057, 0x503b, 0x501f, 0x501f, 0x5078, 0x5338,
+	0x5356, 0x501f, 0x5057, 0x501f, 0x501f, 0x501f, 0x501f, 0x506d,
+	0x5356, 0x7020, 0x2068, 0x1078, 0x13a4, 0x007c, 0x700c, 0x0079,
+	0x4fc9, 0x4fce, 0x4fd1, 0x4fe1, 0x4ffc, 0x4ffc, 0x1078, 0x4ef2,
+	0x007c, 0x127e, 0x8001, 0x700e, 0x7058, 0x007e, 0x1078, 0x5464,
+	0x0040, 0x4fde, 0x2091, 0x8000, 0x1078, 0x4ef2, 0x0d7f, 0x0078,
+	0x4fea, 0x127e, 0x8001, 0x700e, 0x1078, 0x5464, 0x7058, 0x2068,
+	0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000, 0x6834, 0xa084,
+	0x00ff, 0xa08a, 0x001a, 0x00c8, 0x4ff9, 0x1079, 0x4fff, 0x127f,
+	0x007c, 0x127f, 0x1078, 0x501f, 0x007c, 0x007c, 0x007c, 0x501f,
+	0x503b, 0x515b, 0x501f, 0x503b, 0x501f, 0x503b, 0x503b, 0x501f,
+	0x503b, 0x515b, 0x503b, 0x503b, 0x503b, 0x503b, 0x503b, 0x501f,
+	0x503b, 0x515b, 0x501f, 0x501f, 0x503b, 0x501f, 0x501f, 0x501f,
+	0x503b, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x7007,
+	0x0001, 0x6838, 0xa084, 0x00ff, 0xc0d5, 0x683a, 0x127e, 0x2091,
+	0x8000, 0x1078, 0x4a73, 0x127f, 0x007c, 0x7007, 0x0001, 0x6838,
+	0xa084, 0x00ff, 0xc0e5, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078,
+	0x4a73, 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff,
+	0xc0ed, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x4a73, 0x127f,
+	0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0dd, 0x683a,
+	0x127e, 0x2091, 0x8000, 0x1078, 0x4a73, 0x127f, 0x007c, 0x6834,
+	0x8007, 0xa084, 0x00ff, 0x0040, 0x502d, 0x8001, 0x00c0, 0x5064,
+	0x7007, 0x0001, 0x0078, 0x513a, 0x7007, 0x0006, 0x7012, 0x2d00,
+	0x7016, 0x701a, 0x704b, 0x513a, 0x007c, 0x684c, 0xa084, 0x00c0,
+	0xa086, 0x00c0, 0x00c0, 0x5078, 0x7007, 0x0001, 0x0078, 0x5373,
+	0x2d00, 0x7016, 0x701a, 0x20a9, 0x0004, 0xa080, 0x0024, 0x2098,
+	0x20a1, 0xa70d, 0x53a3, 0x6858, 0x7012, 0xa082, 0x0401, 0x00c8,
+	0x5049, 0x6884, 0xa08a, 0x0002, 0x00c8, 0x5049, 0x82ff, 0x00c0,
+	0x509a, 0x6888, 0x698c, 0xa105, 0x0040, 0x509a, 0x2001, 0x510a,
+	0x0078, 0x509d, 0xa280, 0x5100, 0x2004, 0x70c6, 0x7010, 0xa015,
+	0x0040, 0x50e8, 0x1078, 0x1370, 0x00c0, 0x50a9, 0x7007, 0x000f,
+	0x007c, 0x2d00, 0x7022, 0x70c4, 0x2060, 0x6000, 0x6836, 0x6004,
+	0xad00, 0x7096, 0x6008, 0xa20a, 0x00c8, 0x50b8, 0xa00e, 0x2200,
+	0x7112, 0x620c, 0x8003, 0x800b, 0xa296, 0x0004, 0x0040, 0x50c1,
+	0xa108, 0x719a, 0x810b, 0x719e, 0xae90, 0x0022, 0x1078, 0x13db,
+	0x7090, 0xa08e, 0x0100, 0x0040, 0x50dc, 0xa086, 0x0200, 0x0040,
+	0x50d4, 0x7007, 0x0010, 0x007c, 0x7020, 0x2068, 0x1078, 0x13a4,
+	0x7014, 0x2068, 0x0078, 0x5049, 0x7020, 0x2068, 0x7018, 0x6802,
+	0x6807, 0x0000, 0x2d08, 0x2068, 0x6906, 0x711a, 0x0078, 0x509e,
+	0x7014, 0x2068, 0x7007, 0x0001, 0x6884, 0xa005, 0x00c0, 0x50f7,
+	0x6888, 0x698c, 0xa105, 0x0040, 0x50f7, 0x1078, 0x510e, 0x6834,
+	0xa084, 0x00ff, 0xa086, 0x001e, 0x0040, 0x5373, 0x0078, 0x513a,
+	0x5102, 0x5106, 0x0002, 0x0011, 0x0007, 0x0004, 0x000a, 0x000f,
+	0x0005, 0x0006, 0x000a, 0x0011, 0x0005, 0x0004, 0x0f7e, 0x0e7e,
+	0x0c7e, 0x077e, 0x067e, 0x6f88, 0x6e8c, 0x6804, 0x2060, 0xacf0,
+	0x0021, 0xacf8, 0x0027, 0x2009, 0x0005, 0x700c, 0x7816, 0x7008,
+	0x7812, 0x7004, 0x7806, 0x7000, 0x7802, 0x7e0e, 0x7f0a, 0x8109,
+	0x0040, 0x5130, 0xaef2, 0x0004, 0xaffa, 0x0006, 0x0078, 0x511d,
+	0x6004, 0xa065, 0x00c0, 0x5117, 0x067f, 0x077f, 0x0c7f, 0x0e7f,
+	0x0f7f, 0x007c, 0x2009, 0xa62f, 0x210c, 0x81ff, 0x00c0, 0x5155,
+	0x6838, 0xa084, 0x00ff, 0x683a, 0x1078, 0x4353, 0x00c0, 0x5149,
+	0x007c, 0x1078, 0x4b51, 0x127e, 0x2091, 0x8000, 0x1078, 0x8f7d,
+	0x1078, 0x4a73, 0x127f, 0x0078, 0x5148, 0x2001, 0x0028, 0x2009,
+	0x0000, 0x0078, 0x5149, 0x7018, 0x6802, 0x2d08, 0x2068, 0x6906,
+	0x711a, 0x7010, 0x8001, 0x7012, 0x0040, 0x516a, 0x7007, 0x0006,
+	0x0078, 0x5170, 0x7014, 0x2068, 0x7007, 0x0001, 0x7048, 0x107a,
+	0x007c, 0x7007, 0x0001, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x6848,
+	0xa084, 0x00ff, 0x20a9, 0x0001, 0xa096, 0x0001, 0x0040, 0x519a,
+	0x2009, 0x0000, 0x20a9, 0x00ff, 0xa096, 0x0002, 0x0040, 0x519a,
+	0xa005, 0x00c0, 0x51ad, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x1078,
+	0x45c4, 0x00c0, 0x51ad, 0x067e, 0x6e50, 0x1078, 0x46b3, 0x067f,
+	0x0078, 0x51ad, 0x047e, 0x2011, 0xa60c, 0x2224, 0xc484, 0xc48c,
+	0x2412, 0x047f, 0x0c7e, 0x1078, 0x45c4, 0x00c0, 0x51a9, 0x1078,
+	0x4852, 0x8108, 0x00f0, 0x51a3, 0x0c7f, 0x684c, 0xd084, 0x00c0,
+	0x51b4, 0x1078, 0x13a4, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078,
+	0x4a73, 0x127f, 0x007c, 0x127e, 0x2091, 0x8000, 0x7007, 0x0001,
+	0x2001, 0xa653, 0x2004, 0xd0a4, 0x0040, 0x51ff, 0x2061, 0xa933,
+	0x6100, 0xd184, 0x0040, 0x51df, 0x6858, 0xa084, 0x00ff, 0x00c0,
+	0x5202, 0x6000, 0xd084, 0x0040, 0x51ff, 0x6004, 0xa005, 0x00c0,
+	0x5205, 0x6003, 0x0000, 0x600b, 0x0000, 0x0078, 0x51fc, 0x2011,
+	0x0001, 0x6860, 0xa005, 0x00c0, 0x51e7, 0x2001, 0x001e, 0x8000,
+	0x6016, 0x6858, 0xa084, 0x00ff, 0x0040, 0x51ff, 0x6006, 0x6858,
+	0x8007, 0xa084, 0x00ff, 0x0040, 0x51ff, 0x600a, 0x6858, 0x8000,
+	0x00c0, 0x51fb, 0xc28d, 0x6202, 0x127f, 0x0078, 0x5453, 0x127f,
+	0x0078, 0x544b, 0x127f, 0x0078, 0x5443, 0x127f, 0x0078, 0x5447,
+	0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0xa653, 0x2004,
+	0xd0a4, 0x0040, 0x525e, 0x2061, 0xa933, 0x6000, 0xd084, 0x0040,
+	0x525e, 0x6204, 0x6308, 0xd08c, 0x00c0, 0x5250, 0x6c48, 0xa484,
+	0x0003, 0x0040, 0x5236, 0x6958, 0xa18c, 0x00ff, 0x8001, 0x00c0,
+	0x522f, 0x2100, 0xa210, 0x0048, 0x525b, 0x0078, 0x5236, 0x8001,
+	0x00c0, 0x525b, 0x2100, 0xa212, 0x0048, 0x525b, 0xa484, 0x000c,
+	0x0040, 0x5250, 0x6958, 0x810f, 0xa18c, 0x00ff, 0xa082, 0x0004,
+	0x00c0, 0x5248, 0x2100, 0xa318, 0x0048, 0x525b, 0x0078, 0x5250,
+	0xa082, 0x0004, 0x00c0, 0x525b, 0x2100, 0xa31a, 0x0048, 0x525b,
+	0x6860, 0xa005, 0x0040, 0x5256, 0x8000, 0x6016, 0x6206, 0x630a,
+	0x127f, 0x0078, 0x5453, 0x127f, 0x0078, 0x544f, 0x127f, 0x0078,
+	0x544b, 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2061, 0xa933,
+	0x6300, 0xd38c, 0x00c0, 0x5271, 0x6308, 0x8318, 0x0048, 0x5274,
+	0x630a, 0x127f, 0x0078, 0x5461, 0x127f, 0x0078, 0x544f, 0x127e,
+	0x0c7e, 0x2091, 0x8000, 0x7007, 0x0001, 0x684c, 0xd0ac, 0x0040,
+	0x528b, 0x0c7e, 0x2061, 0xa933, 0x6000, 0xa084, 0xfcff, 0x6002,
+	0x0c7f, 0x0078, 0x52ba, 0x6858, 0xa005, 0x0040, 0x52d1, 0x685c,
+	0xa065, 0x0040, 0x52cd, 0x2001, 0xa62f, 0x2004, 0xa005, 0x0040,
+	0x529d, 0x1078, 0x8ec6, 0x0078, 0x52ab, 0x6013, 0x0400, 0x6037,
+	0x0000, 0x694c, 0xd1a4, 0x0040, 0x52a7, 0x6950, 0x6136, 0x2009,
+	0x0041, 0x1078, 0x775c, 0x6958, 0xa18c, 0xff00, 0xa186, 0x2000,
+	0x00c0, 0x52ba, 0x027e, 0x2009, 0x0000, 0x2011, 0xfdff, 0x1078,
+	0x5bf1, 0x027f, 0x684c, 0xd0c4, 0x0040, 0x52c9, 0x2061, 0xa933,
+	0x6000, 0xd08c, 0x00c0, 0x52c9, 0x6008, 0x8000, 0x0048, 0x52cd,
+	0x600a, 0x0c7f, 0x127f, 0x0078, 0x5453, 0x0c7f, 0x127f, 0x0078,
+	0x544b, 0x6954, 0xa186, 0x0045, 0x0040, 0x5306, 0xa186, 0x002a,
+	0x00c0, 0x52e1, 0x2001, 0xa60c, 0x200c, 0xc194, 0x2102, 0x0078,
+	0x52ba, 0xa186, 0x0020, 0x0040, 0x52fa, 0xa186, 0x0029, 0x0040,
+	0x52ed, 0xa186, 0x002d, 0x00c0, 0x52cd, 0x6944, 0xa18c, 0xff00,
+	0x810f, 0x1078, 0x45c4, 0x00c0, 0x52ba, 0x6000, 0xc0e4, 0x6002,
+	0x0078, 0x52ba, 0x685c, 0xa065, 0x0040, 0x52cd, 0x6007, 0x0024,
+	0x2001, 0xa8a3, 0x2004, 0x6016, 0x0078, 0x52ba, 0x685c, 0xa065,
+	0x0040, 0x52cd, 0x0e7e, 0x6860, 0xa075, 0x2001, 0xa62f, 0x2004,
+	0xa005, 0x0040, 0x531e, 0x1078, 0x8ec6, 0x8eff, 0x0040, 0x531b,
+	0x2e60, 0x1078, 0x8ec6, 0x0e7f, 0x0078, 0x52ba, 0x6024, 0xc0dc,
+	0xc0d5, 0x6026, 0x2e60, 0x6007, 0x003a, 0x6870, 0xa005, 0x0040,
+	0x532f, 0x6007, 0x003b, 0x6874, 0x602a, 0x6878, 0x6012, 0x6003,
+	0x0001, 0x1078, 0x5d8a, 0x1078, 0x62d1, 0x0e7f, 0x0078, 0x52ba,
+	0x2061, 0xa933, 0x6000, 0xd084, 0x0040, 0x5352, 0xd08c, 0x00c0,
+	0x5461, 0x2091, 0x8000, 0x6204, 0x8210, 0x0048, 0x534c, 0x6206,
+	0x2091, 0x8001, 0x0078, 0x5461, 0x2091, 0x8001, 0x6853, 0x0016,
+	0x0078, 0x545a, 0x6853, 0x0007, 0x0078, 0x545a, 0x6834, 0x8007,
+	0xa084, 0x00ff, 0x00c0, 0x5360, 0x1078, 0x502d, 0x0078, 0x5372,
+	0x2030, 0x8001, 0x00c0, 0x536a, 0x7007, 0x0001, 0x1078, 0x5373,
+	0x0078, 0x5372, 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a,
+	0x704b, 0x5373, 0x007c, 0x0e7e, 0x127e, 0x2091, 0x8000, 0xa03e,
+	0x2009, 0xa62f, 0x210c, 0x81ff, 0x00c0, 0x53ff, 0x2009, 0xa60c,
+	0x210c, 0xd194, 0x00c0, 0x5431, 0x6848, 0x2070, 0xae82, 0xad00,
+	0x0048, 0x53ef, 0x2001, 0xa616, 0x2004, 0xae02, 0x00c8, 0x53ef,
+	0x2061, 0xa933, 0x6100, 0xa184, 0x0301, 0xa086, 0x0001, 0x00c0,
+	0x53d2, 0x711c, 0xa186, 0x0006, 0x00c0, 0x53da, 0x7018, 0xa005,
+	0x0040, 0x53ff, 0x2004, 0xd0e4, 0x00c0, 0x542b, 0x7024, 0xd0dc,
+	0x00c0, 0x5435, 0x6853, 0x0000, 0x6803, 0x0000, 0x2d08, 0x7010,
+	0xa005, 0x00c0, 0x53be, 0x7112, 0x684c, 0xd0f4, 0x00c0, 0x5439,
+	0x2e60, 0x1078, 0x5b27, 0x127f, 0x0e7f, 0x007c, 0x2068, 0x6800,
+	0xa005, 0x00c0, 0x53be, 0x6902, 0x2168, 0x684c, 0xd0f4, 0x00c0,
+	0x5439, 0x127f, 0x0e7f, 0x007c, 0x127f, 0x0e7f, 0x6853, 0x0006,
+	0x0078, 0x545a, 0xd184, 0x0040, 0x53cc, 0xd1c4, 0x00c0, 0x53f3,
+	0x0078, 0x53f7, 0x6944, 0xa18c, 0xff00, 0x810f, 0x1078, 0x45c4,
+	0x00c0, 0x542b, 0x6000, 0xd0e4, 0x00c0, 0x542b, 0x711c, 0xa186,
+	0x0007, 0x00c0, 0x53ef, 0x6853, 0x0002, 0x0078, 0x542d, 0x6853,
+	0x0008, 0x0078, 0x542d, 0x6853, 0x000e, 0x0078, 0x542d, 0x6853,
+	0x0017, 0x0078, 0x542d, 0x6853, 0x0035, 0x0078, 0x542d, 0x2001,
+	0xa672, 0x2004, 0xd0fc, 0x0040, 0x5427, 0x6848, 0x2070, 0xae82,
+	0xad00, 0x0048, 0x5427, 0x6058, 0xae02, 0x00c8, 0x5427, 0x711c,
+	0xa186, 0x0006, 0x00c0, 0x5427, 0x7018, 0xa005, 0x0040, 0x5427,
+	0x2004, 0xd0bc, 0x0040, 0x5427, 0x2039, 0x0001, 0x7000, 0xa086,
+	0x0007, 0x00c0, 0x537e, 0x7003, 0x0002, 0x0078, 0x537e, 0x6853,
+	0x0028, 0x0078, 0x542d, 0x6853, 0x0029, 0x127f, 0x0e7f, 0x0078,
+	0x545a, 0x6853, 0x002a, 0x0078, 0x542d, 0x6853, 0x0045, 0x0078,
+	0x542d, 0x2e60, 0x2019, 0x0002, 0x6017, 0x0014, 0x1078, 0x9dc7,
+	0x127f, 0x0e7f, 0x007c, 0x2009, 0x003e, 0x0078, 0x5455, 0x2009,
+	0x0004, 0x0078, 0x5455, 0x2009, 0x0006, 0x0078, 0x5455, 0x2009,
+	0x0016, 0x0078, 0x5455, 0x2009, 0x0001, 0x6854, 0xa084, 0xff00,
+	0xa105, 0x6856, 0x2091, 0x8000, 0x1078, 0x4a73, 0x2091, 0x8001,
+	0x007c, 0x1078, 0x13a4, 0x007c, 0x702c, 0x7130, 0x8108, 0xa102,
+	0x0048, 0x5471, 0xa00e, 0x7034, 0x7072, 0x7038, 0x7076, 0x0078,
+	0x547d, 0x7070, 0xa080, 0x0040, 0x7072, 0x00c8, 0x547d, 0x7074,
+	0xa081, 0x0000, 0x7076, 0xa085, 0x0001, 0x7932, 0x7132, 0x007c,
+	0x0d7e, 0x1078, 0x5b1e, 0x0d7f, 0x007c, 0x0d7e, 0x2011, 0x0004,
+	0x2204, 0xa085, 0x8002, 0x2012, 0x0d7f, 0x007c, 0x20e1, 0x0002,
+	0x3d08, 0x20e1, 0x2000, 0x3d00, 0xa084, 0x7000, 0x0040, 0x549c,
+	0xa086, 0x1000, 0x00c0, 0x54d3, 0x20e1, 0x0000, 0x3d00, 0xa094,
+	0xff00, 0x8217, 0xa084, 0xf000, 0xa086, 0x3000, 0x00c0, 0x54b7,
+	0xa184, 0xff00, 0x8007, 0xa086, 0x0008, 0x00c0, 0x54d3, 0x1078,
+	0x29bb, 0x00c0, 0x54d3, 0x1078, 0x56b2, 0x0078, 0x54ce, 0x20e1,
+	0x0004, 0x3d60, 0xd1bc, 0x00c0, 0x54be, 0x3e60, 0xac84, 0x000f,
+	0x00c0, 0x54d3, 0xac82, 0xad00, 0x0048, 0x54d3, 0x6858, 0xac02,
+	0x00c8, 0x54d3, 0x2009, 0x0047, 0x1078, 0x775c, 0x7a1c, 0xd284,
+	0x00c0, 0x548e, 0x007c, 0xa016, 0x1078, 0x15fa, 0x0078, 0x54ce,
+	0x0078, 0x54d3, 0x781c, 0xd08c, 0x0040, 0x5502, 0x157e, 0x137e,
+	0x147e, 0x20e1, 0x3000, 0x3d20, 0x3e28, 0xa584, 0x0076, 0x00c0,
+	0x5518, 0xa484, 0x7000, 0xa086, 0x1000, 0x00c0, 0x5507, 0x1078,
+	0x554e, 0x0040, 0x5518, 0x20e1, 0x3000, 0x7828, 0x7828, 0x1078,
+	0x556c, 0x147f, 0x137f, 0x157f, 0x2009, 0xa8b9, 0x2104, 0xa005,
+	0x00c0, 0x5503, 0x007c, 0x1078, 0x62d1, 0x0078, 0x5502, 0xa484,
+	0x7000, 0x00c0, 0x5518, 0x1078, 0x554e, 0x0040, 0x552c, 0x7000,
+	0xa084, 0xff00, 0xa086, 0x8100, 0x0040, 0x54f3, 0x0078, 0x552c,
+	0x1078, 0xa54f, 0xd5a4, 0x0040, 0x5528, 0x047e, 0x1078, 0x1b22,
+	0x047f, 0x20e1, 0x9010, 0x2001, 0x0138, 0x2202, 0x0078, 0x5530,
+	0x1078, 0x554e, 0x6883, 0x0000, 0x20e1, 0x3000, 0x7828, 0x7828,
+	0x1078, 0x5537, 0x147f, 0x137f, 0x157f, 0x0078, 0x5502, 0x2001,
+	0xa60e, 0x2004, 0xd08c, 0x0040, 0x554d, 0x2001, 0xa600, 0x2004,
+	0xa086, 0x0003, 0x00c0, 0x554d, 0x027e, 0x037e, 0x2011, 0x8048,
+	0x2518, 0x1078, 0x361b, 0x037f, 0x027f, 0x007c, 0xa484, 0x01ff,
+	0x6882, 0xa005, 0x0040, 0x5560, 0xa080, 0x001f, 0xa084, 0x03f8,
+	0x80ac, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5, 0x007c,
+	0x20a9, 0x000c, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5,
+	0xa085, 0x0001, 0x0078, 0x555f, 0x7000, 0xa084, 0xff00, 0xa08c,
+	0xf000, 0x8007, 0xa196, 0x0000, 0x00c0, 0x5579, 0x0078, 0x57ba,
+	0x007c, 0xa196, 0x2000, 0x00c0, 0x558a, 0x6900, 0xa18e, 0x0001,
+	0x00c0, 0x5586, 0x1078, 0x3aec, 0x0078, 0x5578, 0x1078, 0x5592,
+	0x0078, 0x5578, 0xa196, 0x8000, 0x00c0, 0x5578, 0x1078, 0x5871,
+	0x0078, 0x5578, 0x0c7e, 0x7110, 0xa18c, 0xff00, 0x810f, 0xa196,
+	0x0001, 0x0040, 0x559f, 0xa196, 0x0023, 0x00c0, 0x56aa, 0xa08e,
+	0x0023, 0x00c0, 0x55d4, 0x1078, 0x591d, 0x0040, 0x56aa, 0x7124,
+	0x610a, 0x7030, 0xa08e, 0x0200, 0x00c0, 0x55b8, 0x7034, 0xa005,
+	0x00c0, 0x56aa, 0x2009, 0x0015, 0x1078, 0x775c, 0x0078, 0x56aa,
+	0xa08e, 0x0214, 0x0040, 0x55c0, 0xa08e, 0x0210, 0x00c0, 0x55c6,
+	0x2009, 0x0015, 0x1078, 0x775c, 0x0078, 0x56aa, 0xa08e, 0x0100,
+	0x00c0, 0x56aa, 0x7034, 0xa005, 0x00c0, 0x56aa, 0x2009, 0x0016,
+	0x1078, 0x775c, 0x0078, 0x56aa, 0xa08e, 0x0022, 0x00c0, 0x56aa,
+	0x7030, 0xa08e, 0x0300, 0x00c0, 0x55e5, 0x7034, 0xa005, 0x00c0,
+	0x56aa, 0x2009, 0x0017, 0x0078, 0x5676, 0xa08e, 0x0500, 0x00c0,
+	0x55f1, 0x7034, 0xa005, 0x00c0, 0x56aa, 0x2009, 0x0018, 0x0078,
+	0x5676, 0xa08e, 0x2010, 0x00c0, 0x55f9, 0x2009, 0x0019, 0x0078,
+	0x5676, 0xa08e, 0x2110, 0x00c0, 0x5601, 0x2009, 0x001a, 0x0078,
+	0x5676, 0xa08e, 0x5200, 0x00c0, 0x560d, 0x7034, 0xa005, 0x00c0,
+	0x56aa, 0x2009, 0x001b, 0x0078, 0x5676, 0xa08e, 0x5000, 0x00c0,
+	0x5619, 0x7034, 0xa005, 0x00c0, 0x56aa, 0x2009, 0x001c, 0x0078,
+	0x5676, 0xa08e, 0x1300, 0x00c0, 0x5621, 0x2009, 0x0034, 0x0078,
+	0x5676, 0xa08e, 0x1200, 0x00c0, 0x562d, 0x7034, 0xa005, 0x00c0,
+	0x56aa, 0x2009, 0x0024, 0x0078, 0x5676, 0xa08c, 0xff00, 0xa18e,
+	0x2400, 0x00c0, 0x5637, 0x2009, 0x002d, 0x0078, 0x5676, 0xa08c,
+	0xff00, 0xa18e, 0x5300, 0x00c0, 0x5641, 0x2009, 0x002a, 0x0078,
+	0x5676, 0xa08e, 0x0f00, 0x00c0, 0x5649, 0x2009, 0x0020, 0x0078,
+	0x5676, 0xa08e, 0x5300, 0x00c0, 0x564f, 0x0078, 0x566c, 0xa08e,
+	0x6104, 0x00c0, 0x566c, 0x2011, 0xab8d, 0x8208, 0x2204, 0xa082,
+	0x0004, 0x20a8, 0x95ac, 0x95ac, 0x2011, 0x8015, 0x211c, 0x8108,
+	0x047e, 0x2124, 0x1078, 0x361b, 0x047f, 0x8108, 0x00f0, 0x565c,
+	0x2009, 0x0023, 0x0078, 0x5676, 0xa08e, 0x6000, 0x00c0, 0x5674,
+	0x2009, 0x003f, 0x0078, 0x5676, 0x2009, 0x001d, 0x017e, 0x2011,
+	0xab83, 0x2204, 0x8211, 0x220c, 0x1078, 0x254d, 0x00c0, 0x56ac,
+	0x1078, 0x455c, 0x00c0, 0x56ac, 0x6612, 0x6516, 0x86ff, 0x0040,
+	0x569c, 0x017f, 0x017e, 0xa186, 0x0017, 0x00c0, 0x569c, 0x686c,
+	0xa606, 0x00c0, 0x569c, 0x6870, 0xa506, 0xa084, 0xff00, 0x00c0,
+	0x569c, 0x6000, 0xc0f5, 0x6002, 0x0c7e, 0x1078, 0x76c7, 0x0040,
+	0x56af, 0x017f, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0x017f,
+	0x1078, 0x775c, 0x0c7f, 0x007c, 0x017f, 0x0078, 0x56aa, 0x0c7f,
+	0x0078, 0x56ac, 0x0c7e, 0x1078, 0x570f, 0x00c0, 0x570d, 0xa28e,
+	0x0033, 0x00c0, 0x56de, 0x1078, 0x591d, 0x0040, 0x570d, 0x7124,
+	0x610a, 0x7030, 0xa08e, 0x0200, 0x00c0, 0x56d0, 0x7034, 0xa005,
+	0x00c0, 0x570d, 0x2009, 0x0015, 0x1078, 0x775c, 0x0078, 0x570d,
+	0xa08e, 0x0100, 0x00c0, 0x570d, 0x7034, 0xa005, 0x00c0, 0x570d,
+	0x2009, 0x0016, 0x1078, 0x775c, 0x0078, 0x570d, 0xa28e, 0x0032,
+	0x00c0, 0x570d, 0x7030, 0xa08e, 0x1400, 0x00c0, 0x570d, 0x2009,
+	0x0038, 0x017e, 0x2011, 0xab83, 0x2204, 0x8211, 0x220c, 0x1078,
+	0x254d, 0x00c0, 0x570c, 0x1078, 0x455c, 0x00c0, 0x570c, 0x6612,
+	0x6516, 0x0c7e, 0x1078, 0x76c7, 0x0040, 0x570b, 0x017f, 0x611a,
+	0x601f, 0x0004, 0x7120, 0x610a, 0x017f, 0x1078, 0x775c, 0x1078,
+	0x62d1, 0x0078, 0x570d, 0x0c7f, 0x017f, 0x0c7f, 0x007c, 0x0f7e,
+	0x0d7e, 0x027e, 0x017e, 0x137e, 0x147e, 0x157e, 0x3c00, 0x007e,
+	0x2079, 0x0030, 0x2069, 0x0200, 0x1078, 0x1c6a, 0x00c0, 0x5750,
+	0x1078, 0x1b40, 0x0040, 0x575d, 0x7908, 0xa18c, 0x1fff, 0xa182,
+	0x0011, 0x00c8, 0x575a, 0x20a9, 0x000c, 0x20e1, 0x0000, 0x2ea0,
+	0x2099, 0x020a, 0x53a5, 0x20e1, 0x2000, 0x2001, 0x020a, 0x2004,
+	0x7a0c, 0x7808, 0xa080, 0x0007, 0xa084, 0x1ff8, 0xa08a, 0x0140,
+	0x10c8, 0x1332, 0x80ac, 0x20e1, 0x6000, 0x2099, 0x020a, 0x53a5,
+	0x20e1, 0x7000, 0x6828, 0x6828, 0x7803, 0x0004, 0xa294, 0x0070,
+	0x007f, 0x20e0, 0x157f, 0x147f, 0x137f, 0x017f, 0x027f, 0x0d7f,
+	0x0f7f, 0x007c, 0xa016, 0x1078, 0x15fa, 0xa085, 0x0001, 0x0078,
+	0x5750, 0x047e, 0x0e7e, 0x0d7e, 0x2028, 0x2130, 0xa696, 0x00ff,
+	0x00c0, 0x5782, 0xa596, 0xfffd, 0x00c0, 0x5772, 0x2009, 0x007f,
+	0x0078, 0x57b5, 0xa596, 0xfffe, 0x00c0, 0x577a, 0x2009, 0x007e,
+	0x0078, 0x57b5, 0xa596, 0xfffc, 0x00c0, 0x5782, 0x2009, 0x0080,
+	0x0078, 0x57b5, 0x2011, 0x0000, 0x2021, 0x0081, 0x20a9, 0x007e,
+	0x2071, 0xa7b6, 0x2e1c, 0x83ff, 0x00c0, 0x5794, 0x82ff, 0x00c0,
+	0x57a9, 0x2410, 0x0078, 0x57a9, 0x2368, 0x6f10, 0x007e, 0x2100,
+	0xa706, 0x007f, 0x6b14, 0x00c0, 0x57a3, 0xa346, 0x00c0, 0x57a3,
+	0x2408, 0x0078, 0x57b5, 0x87ff, 0x00c0, 0x57a9, 0x83ff, 0x0040,
+	0x578e, 0x8420, 0x8e70, 0x00f0, 0x578a, 0x82ff, 0x00c0, 0x57b4,
+	0xa085, 0x0001, 0x0078, 0x57b6, 0x2208, 0xa006, 0x0d7f, 0x0e7f,
+	0x047f, 0x007c, 0xa084, 0x0007, 0x0079, 0x57bf, 0x007c, 0x57c7,
+	0x57c7, 0x57c7, 0x5933, 0x57c7, 0x57c8, 0x57e1, 0x5858, 0x007c,
+	0x7110, 0xd1bc, 0x0040, 0x57e0, 0x7120, 0x2160, 0xac8c, 0x000f,
+	0x00c0, 0x57e0, 0xac8a, 0xad00, 0x0048, 0x57e0, 0x6858, 0xac02,
+	0x00c8, 0x57e0, 0x7124, 0x610a, 0x2009, 0x0046, 0x1078, 0x775c,
+	0x007c, 0x0c7e, 0xa484, 0x01ff, 0x0040, 0x5833, 0x7110, 0xd1bc,
+	0x00c0, 0x5833, 0x2011, 0xab83, 0x2204, 0x8211, 0x220c, 0x1078,
+	0x254d, 0x00c0, 0x5833, 0x1078, 0x455c, 0x00c0, 0x5833, 0x6612,
+	0x6516, 0x6000, 0xd0ec, 0x00c0, 0x5833, 0x6204, 0xa294, 0xff00,
+	0x8217, 0xa286, 0x0006, 0x00c0, 0x5818, 0x0c7e, 0x1078, 0x76c7,
+	0x017f, 0x0040, 0x5835, 0x611a, 0x601f, 0x0006, 0x7120, 0x610a,
+	0x7130, 0x6122, 0x2009, 0x0044, 0x1078, 0x775c, 0x0078, 0x5833,
+	0x0c7e, 0x1078, 0x76c7, 0x017f, 0x0040, 0x5833, 0x611a, 0x601f,
+	0x0004, 0x7120, 0x610a, 0xa286, 0x0004, 0x00c0, 0x582b, 0x6007,
+	0x0005, 0x0078, 0x582d, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078,
+	0x5dd7, 0x1078, 0x62d1, 0x0c7f, 0x007c, 0x2001, 0xa60d, 0x2004,
+	0xd0ec, 0x0040, 0x583f, 0x2011, 0x8049, 0x1078, 0x361b, 0x0c7e,
+	0x1078, 0x9187, 0x017f, 0x0040, 0x5833, 0x611a, 0x601f, 0x0006,
+	0x7120, 0x610a, 0x7130, 0x6122, 0x6013, 0x0300, 0x6003, 0x0001,
+	0x6007, 0x0041, 0x1078, 0x5d8a, 0x1078, 0x62d1, 0x0078, 0x5833,
+	0x7110, 0xd1bc, 0x0040, 0x5870, 0x7020, 0x2060, 0xac84, 0x000f,
+	0x00c0, 0x5870, 0xac82, 0xad00, 0x0048, 0x5870, 0x6858, 0xac02,
+	0x00c8, 0x5870, 0x7124, 0x610a, 0x2009, 0x0045, 0x1078, 0x775c,
+	0x007c, 0x007e, 0x1078, 0x29bb, 0x007f, 0x00c0, 0x5887, 0x7110,
+	0xa18c, 0xff00, 0x810f, 0xa18e, 0x0000, 0x00c0, 0x5887, 0xa084,
+	0x000f, 0xa08a, 0x0006, 0x00c8, 0x5887, 0x1079, 0x5888, 0x007c,
+	0x588e, 0x588f, 0x588e, 0x588e, 0x58ff, 0x590e, 0x007c, 0x7110,
+	0xd1bc, 0x0040, 0x5897, 0x702c, 0xd084, 0x0040, 0x58fe, 0x700c,
+	0x7108, 0x1078, 0x254d, 0x00c0, 0x58fe, 0x1078, 0x455c, 0x00c0,
+	0x58fe, 0x6612, 0x6516, 0x6204, 0x7110, 0xd1bc, 0x0040, 0x58c9,
+	0xa28c, 0x00ff, 0xa186, 0x0004, 0x0040, 0x58b2, 0xa186, 0x0006,
+	0x00c0, 0x58ef, 0x0c7e, 0x1078, 0x591d, 0x0c7f, 0x0040, 0x58fe,
+	0x0c7e, 0x1078, 0x76c7, 0x017f, 0x0040, 0x58fe, 0x611a, 0x601f,
+	0x0002, 0x7120, 0x610a, 0x2009, 0x0088, 0x1078, 0x775c, 0x0078,
+	0x58fe, 0xa28c, 0x00ff, 0xa186, 0x0006, 0x0040, 0x58de, 0xa186,
+	0x0004, 0x0040, 0x58de, 0xa294, 0xff00, 0x8217, 0xa286, 0x0004,
+	0x0040, 0x58de, 0xa286, 0x0006, 0x00c0, 0x58ef, 0x0c7e, 0x1078,
+	0x76c7, 0x017f, 0x0040, 0x58fe, 0x611a, 0x601f, 0x0005, 0x7120,
+	0x610a, 0x2009, 0x0088, 0x1078, 0x775c, 0x0078, 0x58fe, 0x0c7e,
+	0x1078, 0x76c7, 0x017f, 0x0040, 0x58fe, 0x611a, 0x601f, 0x0004,
+	0x7120, 0x610a, 0x2009, 0x0001, 0x1078, 0x775c, 0x007c, 0x7110,
+	0xd1bc, 0x0040, 0x590d, 0x1078, 0x591d, 0x0040, 0x590d, 0x7124,
+	0x610a, 0x2009, 0x0089, 0x1078, 0x775c, 0x007c, 0x7110, 0xd1bc,
+	0x0040, 0x591c, 0x1078, 0x591d, 0x0040, 0x591c, 0x7124, 0x610a,
+	0x2009, 0x008a, 0x1078, 0x775c, 0x007c, 0x7020, 0x2060, 0xac84,
+	0x000f, 0x00c0, 0x5930, 0xac82, 0xad00, 0x0048, 0x5930, 0x2001,
+	0xa616, 0x2004, 0xac02, 0x00c8, 0x5930, 0xa085, 0x0001, 0x007c,
+	0xa006, 0x0078, 0x592f, 0x7110, 0xd1bc, 0x00c0, 0x5949, 0x7024,
+	0x2060, 0xac84, 0x000f, 0x00c0, 0x5949, 0xac82, 0xad00, 0x0048,
+	0x5949, 0x6858, 0xac02, 0x00c8, 0x5949, 0x2009, 0x0051, 0x1078,
+	0x775c, 0x007c, 0x2071, 0xa8c4, 0x7003, 0x0003, 0x700f, 0x0361,
+	0xa006, 0x701a, 0x7012, 0x7017, 0xad00, 0x7007, 0x0000, 0x7026,
+	0x702b, 0x6e1c, 0x7032, 0x7037, 0x6e70, 0x703b, 0x0002, 0x703f,
+	0x0000, 0x7043, 0xffff, 0x7047, 0xffff, 0x007c, 0x2071, 0xa8c4,
+	0x00e0, 0x5a32, 0x2091, 0x6000, 0x700c, 0x8001, 0x700e, 0x00c0,
+	0x59de, 0x700f, 0x0361, 0x7007, 0x0001, 0x127e, 0x2091, 0x8000,
+	0x7138, 0x8109, 0x713a, 0x00c0, 0x59dc, 0x703b, 0x0002, 0x2009,
+	0x0100, 0x2104, 0xa082, 0x0003, 0x00c8, 0x59dc, 0x703c, 0xa086,
+	0x0001, 0x00c0, 0x59b9, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084,
+	0x4000, 0x0040, 0x5997, 0x6803, 0x1000, 0x0078, 0x599e, 0x6804,
+	0xa084, 0x1000, 0x0040, 0x599e, 0x6803, 0x0100, 0x6803, 0x0000,
+	0x703f, 0x0000, 0x2069, 0xa8b1, 0x6804, 0xa082, 0x0006, 0x00c0,
+	0x59ab, 0x6807, 0x0000, 0x6830, 0xa082, 0x0003, 0x00c0, 0x59b2,
+	0x6833, 0x0000, 0x1078, 0x62d1, 0x1078, 0x639b, 0x0d7f, 0x0078,
+	0x59dc, 0x0d7e, 0x2069, 0xa600, 0x6948, 0x6864, 0xa102, 0x00c8,
+	0x59db, 0x2069, 0xa8b1, 0x6804, 0xa086, 0x0000, 0x00c0, 0x59db,
+	0x6830, 0xa086, 0x0000, 0x00c0, 0x59db, 0x703f, 0x0001, 0x6807,
+	0x0006, 0x6833, 0x0003, 0x2069, 0x0100, 0x6830, 0x689e, 0x2069,
+	0x0140, 0x6803, 0x0600, 0x0d7f, 0x0078, 0x59e1, 0x127e, 0x2091,
+	0x8000, 0x7024, 0xa00d, 0x0040, 0x59f9, 0x7020, 0x8001, 0x7022,
+	0x00c0, 0x59f9, 0x7023, 0x0009, 0x8109, 0x7126, 0xa186, 0x03e8,
+	0x00c0, 0x59f4, 0x7028, 0x107a, 0x81ff, 0x00c0, 0x59f9, 0x7028,
+	0x107a, 0x7030, 0xa00d, 0x0040, 0x5a10, 0x702c, 0x8001, 0x702e,
+	0x00c0, 0x5a10, 0x702f, 0x0009, 0x8109, 0x7132, 0x0040, 0x5a0e,
+	0xa184, 0x007f, 0x1040, 0x6ea2, 0x0078, 0x5a10, 0x7034, 0x107a,
+	0x7040, 0xa005, 0x0040, 0x5a18, 0x0050, 0x5a18, 0x8001, 0x7042,
+	0x7044, 0xa005, 0x0040, 0x5a20, 0x0050, 0x5a20, 0x8001, 0x7046,
+	0x7018, 0xa00d, 0x0040, 0x5a31, 0x7008, 0x8001, 0x700a, 0x00c0,
+	0x5a31, 0x700b, 0x0009, 0x8109, 0x711a, 0x00c0, 0x5a31, 0x701c,
+	0x107a, 0x127f, 0x7004, 0x0079, 0x5a35, 0x5a5c, 0x5a5d, 0x5a79,
+	0x0e7e, 0x2071, 0xa8c4, 0x7018, 0xa005, 0x00c0, 0x5a43, 0x711a,
+	0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c, 0x0e7e, 0x007e, 0x2071,
+	0xa8c4, 0x701c, 0xa206, 0x00c0, 0x5a4f, 0x701a, 0x701e, 0x007f,
+	0x0e7f, 0x007c, 0x0e7e, 0x2071, 0xa8c4, 0x6088, 0xa102, 0x0048,
+	0x5a5a, 0x618a, 0x0e7f, 0x007c, 0x007c, 0x7110, 0x1078, 0x45c4,
+	0x00c0, 0x5a6f, 0x6088, 0x8001, 0x0048, 0x5a6f, 0x608a, 0x00c0,
+	0x5a6f, 0x127e, 0x2091, 0x8000, 0x1078, 0x62d1, 0x127f, 0x8108,
+	0xa182, 0x00ff, 0x0048, 0x5a77, 0xa00e, 0x7007, 0x0002, 0x7112,
+	0x007c, 0x7014, 0x2060, 0x127e, 0x2091, 0x8000, 0x603c, 0xa005,
+	0x0040, 0x5a88, 0x8001, 0x603e, 0x00c0, 0x5a88, 0x1078, 0x8f9c,
+	0x6014, 0xa005, 0x0040, 0x5ab2, 0x8001, 0x6016, 0x00c0, 0x5ab2,
+	0x611c, 0xa186, 0x0003, 0x0040, 0x5a99, 0xa186, 0x0006, 0x00c0,
+	0x5ab0, 0x6010, 0x2068, 0x6854, 0xa08a, 0x199a, 0x0048, 0x5ab0,
+	0xa082, 0x1999, 0x6856, 0xa08a, 0x199a, 0x0048, 0x5aa9, 0x2001,
+	0x1999, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x0078, 0x5ab2,
+	0x1078, 0x8abe, 0x127f, 0xac88, 0x0010, 0x7116, 0x2001, 0xcd00,
+	0xa102, 0x0048, 0x5abf, 0x7017, 0xad00, 0x7007, 0x0000, 0x007c,
+	0x0e7e, 0x2071, 0xa8c4, 0x7027, 0x07d0, 0x7023, 0x0009, 0x703b,
+	0x0002, 0x0e7f, 0x007c, 0x2001, 0xa8cd, 0x2003, 0x0000, 0x007c,
+	0x0e7e, 0x2071, 0xa8c4, 0x7132, 0x702f, 0x0009, 0x0e7f, 0x007c,
+	0x2011, 0xa8d0, 0x2013, 0x0000, 0x007c, 0x0e7e, 0x2071, 0xa8c4,
+	0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c, 0x027e, 0x0e7e,
+	0x0f7e, 0x2079, 0xa600, 0x7a34, 0xd294, 0x0040, 0x5b15, 0x2071,
+	0xa8ac, 0x2e14, 0xa0fe, 0x0000, 0x0040, 0x5b02, 0xa0fe, 0x0001,
+	0x0040, 0x5b06, 0xa0fe, 0x0002, 0x00c0, 0x5b11, 0xa292, 0x0085,
+	0x0078, 0x5b08, 0xa292, 0x0005, 0x0078, 0x5b08, 0xa292, 0x0002,
+	0x2272, 0x0040, 0x5b0d, 0x00c8, 0x5b15, 0x2011, 0x8037, 0x1078,
+	0x361b, 0x2011, 0xa8ab, 0x2204, 0x2072, 0x0f7f, 0x0e7f, 0x027f,
+	0x007c, 0x0c7e, 0x2061, 0xa933, 0x0c7f, 0x007c, 0xa184, 0x000f,
+	0x8003, 0x8003, 0x8003, 0xa080, 0xa933, 0x2060, 0x007c, 0x6854,
+	0xa08a, 0x199a, 0x0048, 0x5b2e, 0x2001, 0x1999, 0xa005, 0x00c0,
+	0x5b3d, 0x0c7e, 0x2061, 0xa933, 0x6014, 0x0c7f, 0xa005, 0x00c0,
+	0x5b42, 0x2001, 0x001e, 0x0078, 0x5b42, 0xa08e, 0xffff, 0x00c0,
+	0x5b42, 0xa006, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x684c,
+	0xa08c, 0x00c0, 0xa18e, 0x00c0, 0x0040, 0x5b9e, 0xd0b4, 0x00c0,
+	0x5b59, 0xd0bc, 0x00c0, 0x5b8b, 0x2009, 0x0006, 0x1078, 0x5bc3,
+	0x007c, 0xd0fc, 0x0040, 0x5b64, 0xa084, 0x0003, 0x0040, 0x5b64,
+	0xa086, 0x0003, 0x00c0, 0x5bbc, 0x6024, 0xd0d4, 0x0040, 0x5b6e,
+	0xc0d4, 0x6026, 0x6860, 0x602a, 0x685c, 0x602e, 0x2009, 0xa674,
+	0x2104, 0xd084, 0x0040, 0x5b83, 0x6118, 0xa188, 0x0027, 0x2104,
+	0xd08c, 0x00c0, 0x5b83, 0x87ff, 0x00c0, 0x5b82, 0x2009, 0x0042,
+	0x1078, 0x775c, 0x007c, 0x87ff, 0x00c0, 0x5b8a, 0x2009, 0x0043,
+	0x1078, 0x775c, 0x007c, 0xd0fc, 0x0040, 0x5b96, 0xa084, 0x0003,
+	0x0040, 0x5b96, 0xa086, 0x0003, 0x00c0, 0x5bbc, 0x87ff, 0x00c0,
+	0x5b9d, 0x2009, 0x0042, 0x1078, 0x775c, 0x007c, 0xd0fc, 0x0040,
+	0x5baf, 0xa084, 0x0003, 0xa08e, 0x0002, 0x0040, 0x5bb3, 0x87ff,
+	0x00c0, 0x5bae, 0x2009, 0x0041, 0x1078, 0x775c, 0x007c, 0x1078,
+	0x5bc1, 0x0078, 0x5bae, 0x87ff, 0x00c0, 0x5bae, 0x2009, 0x0043,
+	0x1078, 0x775c, 0x0078, 0x5bae, 0x2009, 0x0004, 0x1078, 0x5bc3,
+	0x007c, 0x2009, 0x0001, 0x0d7e, 0x6010, 0xa0ec, 0xf000, 0x0040,
+	0x5bef, 0x2068, 0x6952, 0x6800, 0x6012, 0xa186, 0x0001, 0x00c0,
+	0x5be5, 0x694c, 0xa18c, 0x8100, 0xa18e, 0x8100, 0x00c0, 0x5be5,
+	0x0c7e, 0x2061, 0xa933, 0x6200, 0xd28c, 0x00c0, 0x5be4, 0x6204,
+	0x8210, 0x0048, 0x5be4, 0x6206, 0x0c7f, 0x1078, 0x4a73, 0x6010,
+	0xa06d, 0x077e, 0x2039, 0x0000, 0x10c0, 0x5b27, 0x077f, 0x0d7f,
+	0x007c, 0x157e, 0x0c7e, 0x2061, 0xa933, 0x6000, 0x81ff, 0x0040,
+	0x5bfc, 0xa205, 0x0078, 0x5bfd, 0xa204, 0x6002, 0x0c7f, 0x157f,
+	0x007c, 0x6800, 0xd08c, 0x00c0, 0x5c0d, 0x6808, 0xa005, 0x0040,
+	0x5c0d, 0x8001, 0x680a, 0xa085, 0x0001, 0x007c, 0x20a9, 0x0010,
+	0xa006, 0x8004, 0x8086, 0x818e, 0x00c8, 0x5c17, 0xa200, 0x00f0,
+	0x5c12, 0x8086, 0x818e, 0x007c, 0x157e, 0x20a9, 0x0010, 0xa005,
+	0x0040, 0x5c3d, 0xa11a, 0x00c8, 0x5c3d, 0x8213, 0x818d, 0x0048,
+	0x5c30, 0xa11a, 0x00c8, 0x5c31, 0x00f0, 0x5c25, 0x0078, 0x5c35,
+	0xa11a, 0x2308, 0x8210, 0x00f0, 0x5c25, 0x007e, 0x3200, 0xa084,
+	0xf7ff, 0x2080, 0x007f, 0x157f, 0x007c, 0x007e, 0x3200, 0xa085,
+	0x0800, 0x0078, 0x5c39, 0x127e, 0x2091, 0x2200, 0x2079, 0xa8b1,
+	0x127f, 0x0d7e, 0x2069, 0xa8b1, 0x6803, 0x0005, 0x2069, 0x0004,
+	0x2d04, 0xa085, 0x8001, 0x206a, 0x0d7f, 0x007c, 0x0c7e, 0x6027,
+	0x0001, 0x7804, 0xa084, 0x0007, 0x0079, 0x5c5e, 0x5c68, 0x5c8d,
+	0x5ce8, 0x5c6e, 0x5c8d, 0x5c68, 0x5c66, 0x5c66, 0x1078, 0x1332,
+	0x1078, 0x5acb, 0x1078, 0x62d1, 0x0c7f, 0x007c, 0x62c0, 0x82ff,
+	0x00c0, 0x5c74, 0x0c7f, 0x007c, 0x2011, 0x41dc, 0x1078, 0x5a45,
+	0x7828, 0xa092, 0x00c8, 0x00c8, 0x5c83, 0x8000, 0x782a, 0x1078,
+	0x421b, 0x0078, 0x5c72, 0x1078, 0x41dc, 0x7807, 0x0003, 0x7827,
+	0x0000, 0x782b, 0x0000, 0x0078, 0x5c72, 0x1078, 0x5acb, 0x3c00,
+	0x007e, 0x2011, 0x0209, 0x20e1, 0x4000, 0x2214, 0x007f, 0x20e0,
+	0x82ff, 0x0040, 0x5cab, 0x62c0, 0x82ff, 0x00c0, 0x5cab, 0x782b,
+	0x0000, 0x7824, 0xa065, 0x1040, 0x1332, 0x2009, 0x0013, 0x1078,
+	0x775c, 0x0c7f, 0x007c, 0x3900, 0xa082, 0xa9e3, 0x00c8, 0x5cb2,
+	0x1078, 0x747a, 0x0c7e, 0x7824, 0xa065, 0x1040, 0x1332, 0x7804,
+	0xa086, 0x0004, 0x0040, 0x5d2d, 0x7828, 0xa092, 0x2710, 0x00c8,
+	0x5cc8, 0x8000, 0x782a, 0x0c7f, 0x1078, 0x6e01, 0x0078, 0x5ca9,
+	0x6104, 0xa186, 0x0003, 0x00c0, 0x5cdf, 0x0e7e, 0x2071, 0xa600,
+	0x70d8, 0x0e7f, 0xd08c, 0x0040, 0x5cdf, 0x0c7e, 0x0e7e, 0x2061,
+	0x0100, 0x2071, 0xa600, 0x1078, 0x4224, 0x0e7f, 0x0c7f, 0x1078,
+	0xa5c4, 0x2009, 0x0014, 0x1078, 0x775c, 0x0c7f, 0x0078, 0x5ca9,
+	0x2001, 0xa8cd, 0x2003, 0x0000, 0x62c0, 0x82ff, 0x00c0, 0x5cfc,
+	0x782b, 0x0000, 0x7824, 0xa065, 0x1040, 0x1332, 0x2009, 0x0013,
+	0x1078, 0x77b3, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x3900, 0xa082,
+	0xa9e3, 0x00c8, 0x5d05, 0x1078, 0x747a, 0x7824, 0xa005, 0x1040,
+	0x1332, 0x781c, 0xa06d, 0x1040, 0x1332, 0x6800, 0xc0dc, 0x6802,
+	0x7924, 0x2160, 0x1078, 0x772d, 0x693c, 0x81ff, 0x1040, 0x1332,
+	0x8109, 0x693e, 0x6854, 0xa015, 0x0040, 0x5d21, 0x7a1e, 0x0078,
+	0x5d23, 0x7918, 0x791e, 0x7807, 0x0000, 0x7827, 0x0000, 0x0d7f,
+	0x0c7f, 0x1078, 0x62d1, 0x0078, 0x5cfa, 0x6104, 0xa186, 0x0002,
+	0x0040, 0x5d38, 0xa186, 0x0004, 0x0040, 0x5d38, 0x0078, 0x5cbc,
+	0x7808, 0xac06, 0x0040, 0x5cbc, 0x1078, 0x61cd, 0x1078, 0x5dd7,
+	0x0c7f, 0x1078, 0x62d1, 0x0078, 0x5ca9, 0x0c7e, 0x6027, 0x0002,
+	0x62c8, 0x82ff, 0x00c0, 0x5d61, 0x62c4, 0x82ff, 0x00c0, 0x5d61,
+	0x793c, 0xa1e5, 0x0000, 0x0040, 0x5d5b, 0x2009, 0x0049, 0x1078,
+	0x775c, 0x0c7f, 0x007c, 0x2011, 0xa8d0, 0x2013, 0x0000, 0x0078,
+	0x5d59, 0x3908, 0xa192, 0xa9e3, 0x00c8, 0x5d68, 0x1078, 0x747a,
+	0x6017, 0x0010, 0x793c, 0x81ff, 0x0040, 0x5d5b, 0x7944, 0xa192,
+	0x7530, 0x00c8, 0x5d85, 0x8108, 0x7946, 0x793c, 0xa188, 0x0007,
+	0x210c, 0xa18e, 0x0006, 0x00c0, 0x5d81, 0x6017, 0x0012, 0x0078,
+	0x5d59, 0x6017, 0x0016, 0x0078, 0x5d59, 0x7848, 0xc085, 0x784a,
+	0x0078, 0x5d59, 0x007e, 0x017e, 0x0c7e, 0x127e, 0x2091, 0x8000,
+	0x600f, 0x0000, 0x2c08, 0x2061, 0xa8b1, 0x6020, 0x8000, 0x6022,
+	0x6010, 0xa005, 0x0040, 0x5da5, 0xa080, 0x0003, 0x2102, 0x6112,
+	0x127f, 0x0c7f, 0x017f, 0x007f, 0x007c, 0x6116, 0x6112, 0x0078,
+	0x5da0, 0x0d7e, 0x2069, 0xa8b1, 0x6000, 0xd0d4, 0x0040, 0x5dbe,
+	0x6820, 0x8000, 0x6822, 0xa086, 0x0001, 0x00c0, 0x5db9, 0x2c00,
+	0x681e, 0x6804, 0xa084, 0x0007, 0x0079, 0x62d9, 0xc0d5, 0x6002,
+	0x6818, 0xa005, 0x0040, 0x5dd0, 0x6056, 0x605b, 0x0000, 0x007e,
+	0x2c00, 0x681a, 0x0d7f, 0x685a, 0x2069, 0xa8b1, 0x0078, 0x5db0,
+	0x6056, 0x605a, 0x2c00, 0x681a, 0x681e, 0x0078, 0x5db0, 0x007e,
+	0x017e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08,
+	0x2061, 0xa8b1, 0x6020, 0x8000, 0x6022, 0x6008, 0xa005, 0x0040,
+	0x5df2, 0xa080, 0x0003, 0x2102, 0x610a, 0x127f, 0x0c7f, 0x017f,
+	0x007f, 0x007c, 0x610e, 0x610a, 0x0078, 0x5ded, 0x0c7e, 0x600f,
+	0x0000, 0x2c08, 0x2061, 0xa8b1, 0x6034, 0xa005, 0x0040, 0x5e06,
+	0xa080, 0x0003, 0x2102, 0x6136, 0x0c7f, 0x007c, 0x613a, 0x6136,
+	0x0078, 0x5e04, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x057e,
+	0x037e, 0x027e, 0x017e, 0x007e, 0x127e, 0xa02e, 0x2071, 0xa8b1,
+	0x7638, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x5e8c,
+	0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x5e87, 0x87ff,
+	0x0040, 0x5e2e, 0x6020, 0xa106, 0x00c0, 0x5e87, 0x703c, 0xac06,
+	0x00c0, 0x5e44, 0x037e, 0x2019, 0x0001, 0x1078, 0x7058, 0x7033,
+	0x0000, 0x703f, 0x0000, 0x7043, 0x0000, 0x7047, 0x0000, 0x704b,
+	0x0000, 0x037f, 0x2029, 0x0001, 0x7038, 0xac36, 0x00c0, 0x5e4a,
+	0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x5e58, 0x2c00, 0xaf36,
+	0x0040, 0x5e56, 0x2f00, 0x7036, 0x0078, 0x5e58, 0x7037, 0x0000,
+	0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x5e61, 0x7e0e, 0x0078,
+	0x5e62, 0x2678, 0x600f, 0x0000, 0x1078, 0x8d06, 0x0040, 0x5e82,
+	0x6010, 0x2068, 0x601c, 0xa086, 0x0003, 0x00c0, 0x5e9d, 0x6837,
+	0x0103, 0x6b4a, 0x6847, 0x0000, 0x017e, 0x037e, 0x077e, 0x1078,
+	0x8f7d, 0x1078, 0xa4e2, 0x1078, 0x4a73, 0x077f, 0x037f, 0x017f,
+	0x1078, 0x8eb9, 0x1078, 0x8ec6, 0x0c7f, 0x0078, 0x5e1d, 0x2c78,
+	0x600c, 0x2060, 0x0078, 0x5e1d, 0x85ff, 0x0040, 0x5e91, 0x1078,
+	0x639b, 0x127f, 0x007f, 0x017f, 0x027f, 0x037f, 0x057f, 0x067f,
+	0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006,
+	0x00c0, 0x5e6f, 0x017e, 0x037e, 0x077e, 0x1078, 0xa4e2, 0x1078,
+	0xa1ca, 0x077f, 0x037f, 0x017f, 0x0078, 0x5e82, 0x007e, 0x067e,
+	0x0c7e, 0x0d7e, 0x0f7e, 0x2031, 0x0000, 0x127e, 0x2091, 0x8000,
+	0x2079, 0xa8b1, 0x7838, 0xa065, 0x0040, 0x5eef, 0x600c, 0x007e,
+	0x600f, 0x0000, 0x783c, 0xac06, 0x00c0, 0x5ed6, 0x037e, 0x2019,
+	0x0001, 0x1078, 0x7058, 0x7833, 0x0000, 0x783f, 0x0000, 0x7843,
+	0x0000, 0x7847, 0x0000, 0x784b, 0x0000, 0x037f, 0x1078, 0x8d06,
+	0x0040, 0x5eea, 0x6010, 0x2068, 0x601c, 0xa086, 0x0003, 0x00c0,
+	0x5ef8, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x4a73,
+	0x1078, 0x8eb9, 0x1078, 0x8ec6, 0x007f, 0x0078, 0x5ebb, 0x7e3a,
+	0x7e36, 0x127f, 0x0f7f, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c,
+	0x601c, 0xa086, 0x0006, 0x00c0, 0x5ee1, 0x1078, 0xa1ca, 0x0078,
+	0x5eea, 0x017e, 0x027e, 0x087e, 0x2041, 0x0000, 0x1078, 0x5f1b,
+	0x1078, 0x5fdb, 0x087f, 0x027f, 0x017f, 0x007c, 0x0f7e, 0x127e,
+	0x2079, 0xa8b1, 0x2091, 0x8000, 0x1078, 0x6076, 0x1078, 0x60ec,
+	0x127f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e,
+	0x017e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0xa8b1, 0x7614,
+	0x2660, 0x2678, 0x8cff, 0x0040, 0x5fb5, 0x6018, 0xa080, 0x0028,
+	0x2004, 0xa206, 0x00c0, 0x5fb0, 0x88ff, 0x0040, 0x5f3b, 0x6020,
+	0xa106, 0x00c0, 0x5fb0, 0x7024, 0xac06, 0x00c0, 0x5f6b, 0x2069,
+	0x0100, 0x68c0, 0xa005, 0x0040, 0x5f66, 0x1078, 0x5acb, 0x1078,
+	0x6e0f, 0x68c3, 0x0000, 0x1078, 0x7378, 0x7027, 0x0000, 0x037e,
+	0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x5f5b, 0x6803,
+	0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040,
+	0x5f63, 0x6827, 0x0001, 0x037f, 0x0078, 0x5f6b, 0x6003, 0x0009,
+	0x630a, 0x0078, 0x5fb0, 0x7014, 0xac36, 0x00c0, 0x5f71, 0x660c,
+	0x7616, 0x7010, 0xac36, 0x00c0, 0x5f7f, 0x2c00, 0xaf36, 0x0040,
+	0x5f7d, 0x2f00, 0x7012, 0x0078, 0x5f7f, 0x7013, 0x0000, 0x660c,
+	0x067e, 0x2c00, 0xaf06, 0x0040, 0x5f88, 0x7e0e, 0x0078, 0x5f89,
+	0x2678, 0x600f, 0x0000, 0x6010, 0x2068, 0x1078, 0x8d06, 0x0040,
+	0x5fa9, 0x601c, 0xa086, 0x0003, 0x00c0, 0x5fbe, 0x6837, 0x0103,
+	0x6b4a, 0x6847, 0x0000, 0x017e, 0x037e, 0x087e, 0x1078, 0x8f7d,
+	0x1078, 0xa4e2, 0x1078, 0x4a73, 0x087f, 0x037f, 0x017f, 0x1078,
+	0x8eb9, 0x1078, 0x8ec6, 0x1078, 0x7233, 0x0c7f, 0x0078, 0x5f2a,
+	0x2c78, 0x600c, 0x2060, 0x0078, 0x5f2a, 0x127f, 0x007f, 0x017f,
+	0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086,
+	0x0006, 0x00c0, 0x5fcf, 0x017e, 0x037e, 0x087e, 0x1078, 0xa4e2,
+	0x1078, 0xa1ca, 0x087f, 0x037f, 0x017f, 0x0078, 0x5fa9, 0x601c,
+	0xa086, 0x0002, 0x00c0, 0x5fa9, 0x6004, 0xa086, 0x0085, 0x0040,
+	0x5f96, 0x0078, 0x5fa9, 0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000,
+	0xa280, 0xa735, 0x2004, 0xa065, 0x0040, 0x6072, 0x0f7e, 0x0e7e,
+	0x0d7e, 0x067e, 0x2071, 0xa8b1, 0x6654, 0x7018, 0xac06, 0x00c0,
+	0x5ff2, 0x761a, 0x701c, 0xac06, 0x00c0, 0x5ffe, 0x86ff, 0x00c0,
+	0x5ffd, 0x7018, 0x701e, 0x0078, 0x5ffe, 0x761e, 0x6058, 0xa07d,
+	0x0040, 0x6003, 0x7e56, 0xa6ed, 0x0000, 0x0040, 0x6009, 0x2f00,
+	0x685a, 0x6057, 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc,
+	0x6002, 0x1078, 0x44d3, 0x0040, 0x606e, 0x7624, 0x86ff, 0x0040,
+	0x605c, 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0, 0x605c, 0x0d7e,
+	0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x6053, 0x1078, 0x5acb,
+	0x1078, 0x6e0f, 0x68c3, 0x0000, 0x1078, 0x7378, 0x7027, 0x0000,
+	0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x603c,
+	0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084,
+	0x0040, 0x6044, 0x6827, 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c,
+	0xa005, 0x0040, 0x604d, 0x8001, 0x603e, 0x2660, 0x1078, 0x8ec6,
+	0x0c7f, 0x0078, 0x605c, 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009,
+	0x630a, 0x0c7f, 0x0078, 0x6011, 0x8dff, 0x0040, 0x606a, 0x6837,
+	0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x8f7d, 0x1078, 0xa4e2,
+	0x1078, 0x4a73, 0x1078, 0x7233, 0x0078, 0x6011, 0x067f, 0x0d7f,
+	0x0e7f, 0x0f7f, 0x127f, 0x007f, 0x0c7f, 0x007c, 0x007e, 0x067e,
+	0x0c7e, 0x0d7e, 0x2031, 0x0000, 0x7814, 0xa065, 0x0040, 0x60d0,
+	0x600c, 0x007e, 0x600f, 0x0000, 0x7824, 0xac06, 0x00c0, 0x60b5,
+	0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x60af, 0x1078, 0x5acb,
+	0x1078, 0x6e0f, 0x68c3, 0x0000, 0x1078, 0x7378, 0x7827, 0x0000,
+	0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x60a4,
+	0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084,
+	0x0040, 0x60ac, 0x6827, 0x0001, 0x037f, 0x0078, 0x60b5, 0x6003,
+	0x0009, 0x630a, 0x2c30, 0x0078, 0x60cd, 0x6010, 0x2068, 0x1078,
+	0x8d06, 0x0040, 0x60c9, 0x601c, 0xa086, 0x0003, 0x00c0, 0x60d7,
+	0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x4a73, 0x1078,
+	0x8eb9, 0x1078, 0x8ec6, 0x1078, 0x7233, 0x007f, 0x0078, 0x607d,
+	0x7e16, 0x7e12, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x601c,
+	0xa086, 0x0006, 0x00c0, 0x60e0, 0x1078, 0xa1ca, 0x0078, 0x60c9,
+	0x601c, 0xa086, 0x0002, 0x00c0, 0x60c9, 0x6004, 0xa086, 0x0085,
+	0x0040, 0x60c0, 0x0078, 0x60c9, 0x007e, 0x067e, 0x0c7e, 0x0d7e,
+	0x7818, 0xa065, 0x0040, 0x615a, 0x6054, 0x007e, 0x6057, 0x0000,
+	0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x44d3,
+	0x0040, 0x6157, 0x7e24, 0x86ff, 0x0040, 0x6149, 0xa680, 0x0004,
+	0x2004, 0xad06, 0x00c0, 0x6149, 0x0d7e, 0x2069, 0x0100, 0x68c0,
+	0xa005, 0x0040, 0x6140, 0x1078, 0x5acb, 0x1078, 0x6e0f, 0x68c3,
+	0x0000, 0x1078, 0x7378, 0x7827, 0x0000, 0x037e, 0x2069, 0x0140,
+	0x6b04, 0xa384, 0x1000, 0x0040, 0x6129, 0x6803, 0x0100, 0x6803,
+	0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x6131, 0x6827,
+	0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040, 0x613a,
+	0x8001, 0x603e, 0x2660, 0x1078, 0x8ec6, 0x0c7f, 0x0078, 0x6149,
+	0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078,
+	0x60fe, 0x8dff, 0x0040, 0x6153, 0x6837, 0x0103, 0x6b4a, 0x6847,
+	0x0000, 0x1078, 0x4a73, 0x1078, 0x7233, 0x0078, 0x60fe, 0x007f,
+	0x0078, 0x60f1, 0x781e, 0x781a, 0x0d7f, 0x0c7f, 0x067f, 0x007f,
+	0x007c, 0x0e7e, 0x0d7e, 0x067e, 0x6000, 0xd0dc, 0x0040, 0x6181,
+	0x604c, 0xa06d, 0x0040, 0x6181, 0x6848, 0xa606, 0x00c0, 0x6181,
+	0x2071, 0xa8b1, 0x7024, 0xa035, 0x0040, 0x6181, 0xa080, 0x0004,
+	0x2004, 0xad06, 0x00c0, 0x6181, 0x6000, 0xc0dc, 0x6002, 0x1078,
+	0x6185, 0x067f, 0x0d7f, 0x0e7f, 0x007c, 0x0f7e, 0x2079, 0x0100,
+	0x78c0, 0xa005, 0x00c0, 0x6194, 0x0c7e, 0x2660, 0x6003, 0x0009,
+	0x630a, 0x0c7f, 0x0078, 0x61cb, 0x1078, 0x6e0f, 0x78c3, 0x0000,
+	0x1078, 0x7378, 0x7027, 0x0000, 0x037e, 0x2079, 0x0140, 0x7b04,
+	0xa384, 0x1000, 0x0040, 0x61a8, 0x7803, 0x0100, 0x7803, 0x0000,
+	0x2079, 0x0100, 0x7824, 0xd084, 0x0040, 0x61b0, 0x7827, 0x0001,
+	0x1078, 0x7378, 0x037f, 0x1078, 0x44d3, 0x0c7e, 0x603c, 0xa005,
+	0x0040, 0x61bc, 0x8001, 0x603e, 0x2660, 0x1078, 0x772d, 0x0c7f,
+	0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x8f7d, 0x1078,
+	0x4a73, 0x1078, 0x7233, 0x0f7f, 0x007c, 0x0e7e, 0x0c7e, 0x2071,
+	0xa8b1, 0x7004, 0xa084, 0x0007, 0x0079, 0x61d6, 0x61e0, 0x61e3,
+	0x61fc, 0x6218, 0x6262, 0x61e0, 0x61e0, 0x61de, 0x1078, 0x1332,
+	0x0c7f, 0x0e7f, 0x007c, 0x7024, 0xa065, 0x0040, 0x61f1, 0x7020,
+	0x8001, 0x7022, 0x600c, 0xa015, 0x0040, 0x61f8, 0x7216, 0x600f,
+	0x0000, 0x7007, 0x0000, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c,
+	0x7216, 0x7212, 0x0078, 0x61f1, 0x6018, 0x2060, 0x1078, 0x44d3,
+	0x6000, 0xc0dc, 0x6002, 0x7020, 0x8001, 0x7022, 0x0040, 0x620d,
+	0x6054, 0xa015, 0x0040, 0x6214, 0x721e, 0x7007, 0x0000, 0x7027,
+	0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7218, 0x721e, 0x0078, 0x620d,
+	0x7024, 0xa065, 0x0040, 0x625f, 0x700c, 0xac06, 0x00c0, 0x622f,
+	0x1078, 0x7233, 0x600c, 0xa015, 0x0040, 0x622b, 0x720e, 0x600f,
+	0x0000, 0x0078, 0x625d, 0x720e, 0x720a, 0x0078, 0x625d, 0x7014,
+	0xac06, 0x00c0, 0x6242, 0x1078, 0x7233, 0x600c, 0xa015, 0x0040,
+	0x623e, 0x7216, 0x600f, 0x0000, 0x0078, 0x625d, 0x7216, 0x7212,
+	0x0078, 0x625d, 0x601c, 0xa086, 0x0003, 0x00c0, 0x625d, 0x6018,
+	0x2060, 0x1078, 0x44d3, 0x6000, 0xc0dc, 0x6002, 0x1078, 0x7233,
+	0x701c, 0xa065, 0x0040, 0x625d, 0x6054, 0xa015, 0x0040, 0x625b,
+	0x721e, 0x0078, 0x625d, 0x7218, 0x721e, 0x7027, 0x0000, 0x0c7f,
+	0x0e7f, 0x007c, 0x7024, 0xa065, 0x0040, 0x626f, 0x1078, 0x7233,
+	0x600c, 0xa015, 0x0040, 0x6276, 0x720e, 0x600f, 0x0000, 0x1078,
+	0x7378, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x720e, 0x720a,
+	0x0078, 0x626f, 0x0d7e, 0x2069, 0xa8b1, 0x6830, 0xa084, 0x0003,
+	0x0079, 0x6282, 0x6288, 0x628a, 0x62b4, 0x6288, 0x1078, 0x1332,
+	0x0d7f, 0x007c, 0x0c7e, 0x6840, 0xa086, 0x0001, 0x0040, 0x62aa,
+	0x683c, 0xa065, 0x0040, 0x629b, 0x600c, 0xa015, 0x0040, 0x62a6,
+	0x6a3a, 0x600f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x2011,
+	0xa8d0, 0x2013, 0x0000, 0x0c7f, 0x0d7f, 0x007c, 0x683a, 0x6836,
+	0x0078, 0x629b, 0x6843, 0x0000, 0x6838, 0xa065, 0x0040, 0x629b,
+	0x6003, 0x0003, 0x0078, 0x629b, 0x0c7e, 0x6843, 0x0000, 0x6847,
+	0x0000, 0x684b, 0x0000, 0x683c, 0xa065, 0x0040, 0x62ce, 0x600c,
+	0xa015, 0x0040, 0x62ca, 0x6a3a, 0x600f, 0x0000, 0x683f, 0x0000,
+	0x0078, 0x62ce, 0x683f, 0x0000, 0x683a, 0x6836, 0x0c7f, 0x0d7f,
+	0x007c, 0x0d7e, 0x2069, 0xa8b1, 0x6804, 0xa084, 0x0007, 0x0079,
+	0x62d9, 0x62e3, 0x638a, 0x638a, 0x638a, 0x638a, 0x638c, 0x638a,
+	0x62e1, 0x1078, 0x1332, 0x6820, 0xa005, 0x00c0, 0x62e9, 0x0d7f,
+	0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040, 0x62f8, 0x6807, 0x0004,
+	0x6826, 0x682b, 0x0000, 0x1078, 0x63d4, 0x0c7f, 0x0d7f, 0x007c,
+	0x6814, 0xa065, 0x0040, 0x6306, 0x6807, 0x0001, 0x6826, 0x682b,
+	0x0000, 0x1078, 0x63d4, 0x0c7f, 0x0d7f, 0x007c, 0x0e7e, 0x037e,
+	0x6a1c, 0xa2f5, 0x0000, 0x0040, 0x6385, 0x704c, 0xa00d, 0x0040,
+	0x6315, 0x7088, 0xa005, 0x0040, 0x632d, 0x7054, 0xa075, 0x0040,
+	0x631e, 0xa20e, 0x0040, 0x6385, 0x0078, 0x6323, 0x6818, 0xa20e,
+	0x0040, 0x6385, 0x2070, 0x704c, 0xa00d, 0x0040, 0x6315, 0x7088,
+	0xa005, 0x00c0, 0x6315, 0x2e00, 0x681e, 0x733c, 0x7038, 0xa302,
+	0x00c8, 0x6315, 0x1078, 0x76fc, 0x0040, 0x6385, 0x8318, 0x733e,
+	0x6112, 0x2e10, 0x621a, 0xa180, 0x0014, 0x2004, 0xa084, 0x00ff,
+	0x6032, 0xa180, 0x0014, 0x2003, 0x0000, 0xa180, 0x0015, 0x2004,
+	0xa08a, 0x199a, 0x0048, 0x634e, 0x2001, 0x1999, 0x8003, 0x801b,
+	0x831b, 0xa318, 0x6316, 0x037f, 0x0f7e, 0x2c78, 0x71a0, 0xd1bc,
+	0x0040, 0x6367, 0x7100, 0xd1f4, 0x0040, 0x6363, 0x7114, 0xa18c,
+	0x00ff, 0x0078, 0x636c, 0x2009, 0x0000, 0x0078, 0x636c, 0xa1e0,
+	0x29c0, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0x1078,
+	0x6965, 0x7300, 0xc3dd, 0x7302, 0x6807, 0x0002, 0x2f18, 0x6b26,
+	0x682b, 0x0000, 0x781f, 0x0003, 0x7803, 0x0001, 0x7807, 0x0040,
+	0x0f7f, 0x0e7f, 0x0c7f, 0x0d7f, 0x007c, 0x037f, 0x0e7f, 0x0c7f,
+	0x0078, 0x6383, 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040,
+	0x6398, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x63d4,
+	0x0c7f, 0x0d7f, 0x007c, 0x0f7e, 0x0d7e, 0x2069, 0xa8b1, 0x6830,
+	0xa086, 0x0000, 0x00c0, 0x63bb, 0x6838, 0xa07d, 0x0040, 0x63bb,
+	0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x684b, 0x0000, 0x127e,
+	0x0f7e, 0x2091, 0x2200, 0x027f, 0x1078, 0x1d6d, 0x00c0, 0x63be,
+	0x127f, 0x1078, 0x6cb3, 0x0d7f, 0x0f7f, 0x007c, 0x127f, 0x6843,
+	0x0000, 0x7803, 0x0002, 0x780c, 0xa015, 0x0040, 0x63d0, 0x6a3a,
+	0x780f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0078, 0x63bb,
+	0x683a, 0x6836, 0x0078, 0x63ca, 0x601c, 0xa084, 0x000f, 0x1079,
+	0x63da, 0x007c, 0x63e3, 0x63e8, 0x6809, 0x6922, 0x63e8, 0x6809,
+	0x6922, 0x63e3, 0x63e8, 0x1078, 0x61cd, 0x1078, 0x62d1, 0x007c,
+	0x157e, 0x137e, 0x147e, 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0044,
+	0x10c8, 0x1332, 0x6118, 0x2178, 0x79a0, 0xd1bc, 0x0040, 0x6405,
+	0x7900, 0xd1f4, 0x0040, 0x6401, 0x7914, 0xa18c, 0x00ff, 0x0078,
+	0x640a, 0x2009, 0x0000, 0x0078, 0x640a, 0xa1f8, 0x29c0, 0x2f0c,
+	0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a, 0xa08a, 0x0040,
+	0x00c8, 0x645c, 0x1079, 0x641a, 0x0f7f, 0x0c7f, 0x147f, 0x137f,
+	0x157f, 0x007c, 0x64c2, 0x650a, 0x6532, 0x65cd, 0x65fd, 0x6605,
+	0x662c, 0x663d, 0x664e, 0x6656, 0x666e, 0x6656, 0x66d9, 0x663d,
+	0x66fa, 0x6702, 0x664e, 0x6702, 0x6713, 0x645a, 0x645a, 0x645a,
+	0x645a, 0x645a, 0x645a, 0x645a, 0x645a, 0x645a, 0x645a, 0x645a,
+	0x6eef, 0x6f14, 0x6f29, 0x6f4c, 0x6f6d, 0x662c, 0x645a, 0x662c,
+	0x6656, 0x645a, 0x6532, 0x65cd, 0x645a, 0x749c, 0x6656, 0x645a,
+	0x74bc, 0x6656, 0x645a, 0x645a, 0x64bd, 0x646b, 0x645a, 0x74e1,
+	0x7558, 0x7640, 0x645a, 0x7651, 0x6626, 0x766d, 0x645a, 0x6f82,
+	0x645a, 0x645a, 0x1078, 0x1332, 0x2100, 0x1079, 0x6465, 0x0f7f,
+	0x0c7f, 0x147f, 0x137f, 0x157f, 0x007c, 0x6469, 0x6469, 0x6469,
+	0x649f, 0x1078, 0x1332, 0x0d7e, 0x20a1, 0x020b, 0x1078, 0x6731,
+	0x7810, 0x2068, 0x20a3, 0x2414, 0x20a3, 0x0018, 0x20a3, 0x0800,
+	0x683c, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+	0x20a3, 0x0000, 0x6850, 0x20a2, 0x6854, 0x20a2, 0x20a3, 0x0000,
+	0x20a3, 0x0000, 0x60c3, 0x0018, 0x1078, 0x6dfb, 0x0d7f, 0x007c,
+	0x0d7e, 0x7818, 0x2068, 0x68a0, 0xa082, 0x007e, 0x0048, 0x649c,
+	0xa085, 0x0001, 0x0d7f, 0x007c, 0xa006, 0x0078, 0x649a, 0x0d7e,
+	0x20a1, 0x020b, 0x1078, 0x6731, 0x20a3, 0x0500, 0x20a3, 0x0000,
+	0x7810, 0xa0e8, 0x000f, 0x6808, 0x20a2, 0x680c, 0x20a2, 0x6810,
+	0x20a2, 0x6814, 0x20a2, 0x6818, 0x20a2, 0x681c, 0x20a2, 0x60c3,
+	0x0010, 0x1078, 0x6dfb, 0x0d7f, 0x007c, 0x6030, 0x609a, 0x1078,
+	0x6dfb, 0x007c, 0x20a1, 0x020b, 0x1078, 0x6731, 0x20a3, 0x5200,
+	0x20a3, 0x0000, 0x0d7e, 0x2069, 0xa652, 0x6804, 0xd084, 0x0040,
+	0x64dc, 0x6828, 0x20a3, 0x0000, 0x017e, 0x1078, 0x2564, 0x21a2,
+	0x017f, 0x0d7f, 0x0078, 0x64e1, 0x0d7f, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x20a9, 0x0004, 0x2099, 0xa605, 0x53a6, 0x20a9, 0x0004,
+	0x2099, 0xa601, 0x53a6, 0x7818, 0xa080, 0x0028, 0x2004, 0xa082,
+	0x007f, 0x0048, 0x64fb, 0x2001, 0xa61b, 0x20a6, 0x2001, 0xa61c,
+	0x20a6, 0x0078, 0x6501, 0x20a3, 0x0000, 0x6030, 0xa084, 0x00ff,
+	0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078,
+	0x6dfb, 0x007c, 0x20a1, 0x020b, 0x1078, 0x6731, 0x20a3, 0x0500,
+	0x20a3, 0x0000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa082, 0x007f,
+	0x0048, 0x6522, 0x2001, 0xa61b, 0x20a6, 0x2001, 0xa61c, 0x20a6,
+	0x0078, 0x6528, 0x20a3, 0x0000, 0x6030, 0xa084, 0x00ff, 0x20a2,
+	0x20a9, 0x0004, 0x2099, 0xa605, 0x53a6, 0x60c3, 0x0010, 0x1078,
+	0x6dfb, 0x007c, 0x20a1, 0x020b, 0x1078, 0x6731, 0x0c7e, 0x7818,
+	0x2060, 0x2001, 0x0000, 0x1078, 0x4972, 0x0c7f, 0x7818, 0xa080,
+	0x0028, 0x2004, 0xa086, 0x007e, 0x00c0, 0x654d, 0x20a3, 0x0400,
+	0x620c, 0xc2b4, 0x620e, 0x0078, 0x654f, 0x20a3, 0x0300, 0x20a3,
+	0x0000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa086, 0x007e, 0x00c0,
+	0x659c, 0x2099, 0xa88d, 0x33a6, 0x9398, 0x33a6, 0x9398, 0x3304,
+	0xa084, 0x3fff, 0x20a2, 0x9398, 0x33a6, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099,
+	0xa605, 0x53a6, 0x20a9, 0x0004, 0x2099, 0xa601, 0x53a6, 0x20a9,
+	0x0010, 0x20a3, 0x0000, 0x00f0, 0x6579, 0x2099, 0xa895, 0x3304,
+	0xc0dd, 0x20a2, 0x2001, 0xa672, 0x2004, 0xd0e4, 0x0040, 0x6594,
+	0x20a3, 0x0000, 0x20a3, 0x0000, 0x9398, 0x9398, 0x9398, 0x33a6,
+	0x20a9, 0x0004, 0x0078, 0x6596, 0x20a9, 0x0007, 0x20a3, 0x0000,
+	0x00f0, 0x6596, 0x0078, 0x65bc, 0x2099, 0xa88d, 0x20a9, 0x0008,
+	0x53a6, 0x20a9, 0x0004, 0x2099, 0xa605, 0x53a6, 0x20a9, 0x0004,
+	0x2099, 0xa601, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0,
+	0x65ad, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x65b3, 0x2099,
+	0xa895, 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000,
+	0x00f0, 0x65be, 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0, 0x65c4,
+	0x60c3, 0x0074, 0x1078, 0x6dfb, 0x007c, 0x20a1, 0x020b, 0x1078,
+	0x6731, 0x20a3, 0x2010, 0x20a3, 0x0014, 0x20a3, 0x0800, 0x20a3,
+	0x2000, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e,
+	0x2079, 0xa652, 0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x65e9, 0xa085,
+	0x0020, 0xd1a4, 0x0040, 0x65ee, 0xa085, 0x0010, 0xa085, 0x0002,
+	0x0d7e, 0x0078, 0x66b7, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000,
+	0x60c3, 0x0014, 0x1078, 0x6dfb, 0x007c, 0x20a1, 0x020b, 0x1078,
+	0x6731, 0x20a3, 0x5000, 0x0078, 0x654f, 0x20a1, 0x020b, 0x1078,
+	0x6731, 0x20a3, 0x2110, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x60c3, 0x0014, 0x1078, 0x6dfb, 0x007c, 0x20a1, 0x020b,
+	0x1078, 0x67b9, 0x0078, 0x6630, 0x20a1, 0x020b, 0x1078, 0x67c2,
+	0x20a3, 0x0200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+	0x60c3, 0x0004, 0x1078, 0x6dfb, 0x007c, 0x20a1, 0x020b, 0x1078,
+	0x67c2, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3,
+	0x2a00, 0x60c3, 0x0008, 0x1078, 0x6dfb, 0x007c, 0x20a1, 0x020b,
+	0x1078, 0x67c2, 0x20a3, 0x0200, 0x0078, 0x654f, 0x20a1, 0x020b,
+	0x1078, 0x67c2, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x7828, 0xa005,
+	0x0040, 0x6665, 0x20a2, 0x0078, 0x6667, 0x20a3, 0x0003, 0x7810,
+	0x20a2, 0x60c3, 0x0008, 0x1078, 0x6dfb, 0x007c, 0x0d7e, 0x20a1,
+	0x020b, 0x1078, 0x67c2, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3,
+	0x0800, 0x7818, 0x2068, 0x6894, 0xa086, 0x0014, 0x00c0, 0x6694,
+	0x6998, 0xa184, 0xc000, 0x00c0, 0x6690, 0xd1ec, 0x0040, 0x668c,
+	0x20a3, 0x2100, 0x0078, 0x6696, 0x20a3, 0x0100, 0x0078, 0x6696,
+	0x20a3, 0x0400, 0x0078, 0x6696, 0x20a3, 0x0700, 0xa006, 0x20a2,
+	0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0xa652, 0x7904,
+	0x0f7f, 0xd1ac, 0x00c0, 0x66a6, 0xa085, 0x0020, 0xd1a4, 0x0040,
+	0x66ab, 0xa085, 0x0010, 0x2009, 0xa674, 0x210c, 0xd184, 0x0040,
+	0x66b5, 0x699c, 0xd18c, 0x0040, 0x66b7, 0xa085, 0x0002, 0x027e,
+	0x2009, 0xa672, 0x210c, 0xd1e4, 0x0040, 0x66c5, 0xc0c5, 0xa094,
+	0x0030, 0xa296, 0x0010, 0x0040, 0x66cf, 0xd1ec, 0x0040, 0x66cf,
+	0xa094, 0x0030, 0xa296, 0x0010, 0x0040, 0x66cf, 0xc0bd, 0x027f,
+	0x20a2, 0x20a2, 0x20a2, 0x60c3, 0x0014, 0x1078, 0x6dfb, 0x0d7f,
+	0x007c, 0x20a1, 0x020b, 0x1078, 0x67c2, 0x20a3, 0x0210, 0x20a3,
+	0x0014, 0x20a3, 0x0000, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078,
+	0x6dfb, 0x007c, 0x20a1, 0x020b, 0x1078, 0x67c2, 0x20a3, 0x0200,
+	0x0078, 0x64c8, 0x20a1, 0x020b, 0x1078, 0x67c2, 0x20a3, 0x0100,
+	0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3, 0x0008,
+	0x1078, 0x6dfb, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a1,
+	0x020b, 0x1078, 0x67c2, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3,
+	0x000b, 0x20a3, 0x0000, 0x60c3, 0x0008, 0x1078, 0x6dfb, 0x007c,
+	0x027e, 0x037e, 0x047e, 0x2019, 0x3200, 0x2021, 0x0800, 0x0078,
+	0x6738, 0x027e, 0x037e, 0x047e, 0x2019, 0x2200, 0x2021, 0x0100,
+	0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2014,
+	0xa286, 0x007e, 0x00c0, 0x674b, 0xa385, 0x00ff, 0x20a2, 0x20a3,
+	0xfffe, 0x0078, 0x6780, 0xa286, 0x007f, 0x00c0, 0x6757, 0x0d7e,
+	0xa385, 0x00ff, 0x20a2, 0x20a3, 0xfffd, 0x0078, 0x676e, 0xd2bc,
+	0x0040, 0x6776, 0xa286, 0x0080, 0x0d7e, 0x00c0, 0x6766, 0xa385,
+	0x00ff, 0x20a2, 0x20a3, 0xfffc, 0x0078, 0x676e, 0xa2e8, 0xa735,
+	0x2d6c, 0x6810, 0xa305, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa61b,
+	0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x6784, 0x0d7e, 0xa2e8,
+	0xa735, 0x2d6c, 0x6810, 0xa305, 0x20a2, 0x6814, 0x20a2, 0x0d7f,
+	0x20a3, 0x0000, 0x6230, 0x22a2, 0xa485, 0x0029, 0x20a2, 0x047f,
+	0x037f, 0x20a3, 0x0000, 0x1078, 0x6dea, 0x22a2, 0x20a3, 0x0000,
+	0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f,
+	0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x02ff,
+	0x2011, 0xfffc, 0x22a2, 0x0d7e, 0x2069, 0xa61b, 0x2da6, 0x8d68,
+	0x2da6, 0x0d7f, 0x20a3, 0x2029, 0x20a3, 0x0000, 0x0078, 0x678b,
+	0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0xfc02, 0x20a3, 0x0000,
+	0x007c, 0x027e, 0x037e, 0x047e, 0x2019, 0x3300, 0x2021, 0x0800,
+	0x0078, 0x67c9, 0x027e, 0x037e, 0x047e, 0x2019, 0x2300, 0x2021,
+	0x0100, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028,
+	0x2004, 0xa092, 0x007e, 0x0048, 0x67e6, 0x0d7e, 0xa0e8, 0xa735,
+	0x2d6c, 0x6810, 0xa305, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa61b,
+	0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x67f4, 0x0d7e, 0xa0e8,
+	0xa735, 0x2d6c, 0x6810, 0xa305, 0x20a2, 0x6814, 0x20a2, 0x0d7f,
+	0x20a3, 0x0000, 0x6230, 0x22a2, 0xa485, 0x0098, 0x20a2, 0x20a3,
+	0x0000, 0x047f, 0x037f, 0x1078, 0x6dea, 0x22a2, 0x20a3, 0x0000,
+	0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f,
+	0x007c, 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0085, 0x1048, 0x1332,
+	0xa08a, 0x008c, 0x10c8, 0x1332, 0x6118, 0x2178, 0x79a0, 0xd1bc,
+	0x0040, 0x6827, 0x7900, 0xd1f4, 0x0040, 0x6823, 0x7914, 0xa18c,
+	0x00ff, 0x0078, 0x682c, 0x2009, 0x0000, 0x0078, 0x682c, 0xa1f8,
+	0x29c0, 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a,
+	0xa082, 0x0085, 0x1079, 0x6837, 0x0f7f, 0x0c7f, 0x007c, 0x6840,
+	0x684b, 0x6866, 0x683e, 0x683e, 0x683e, 0x6840, 0x1078, 0x1332,
+	0x147e, 0x20a1, 0x020b, 0x1078, 0x6879, 0x60c3, 0x0000, 0x1078,
+	0x6dfb, 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b, 0x1078, 0x68ad,
+	0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2, 0x7810, 0x20a2,
+	0x20a3, 0x0000, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000,
+	0x60c3, 0x000c, 0x1078, 0x6dfb, 0x147f, 0x007c, 0x147e, 0x20a1,
+	0x020b, 0x1078, 0x68ee, 0x20a3, 0x0003, 0x20a3, 0x0300, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004, 0x1078, 0x6dfb, 0x147f,
+	0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080,
+	0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x6898, 0x0d7e, 0xa0e8,
+	0xa735, 0x2d6c, 0x6810, 0xa085, 0x8100, 0x20a2, 0x6814, 0x20a2,
+	0x2069, 0xa61b, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x68a7,
+	0x0d7e, 0xa0e8, 0xa735, 0x2d6c, 0x6810, 0xa085, 0x8100, 0x20a2,
+	0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
+	0x0009, 0x20a3, 0x0000, 0x0078, 0x678b, 0x027e, 0x20e1, 0x9080,
+	0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa092, 0x007e,
+	0x0048, 0x68cc, 0x0d7e, 0xa0e8, 0xa735, 0x2d6c, 0x6810, 0xa085,
+	0x8400, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa61b, 0x2da6, 0x8d68,
+	0x2da6, 0x0d7f, 0x0078, 0x68db, 0x0d7e, 0xa0e8, 0xa735, 0x2d6c,
+	0x6810, 0xa085, 0x8400, 0x20a2, 0x6814, 0x20a2, 0x0d7f, 0x20a3,
+	0x0000, 0x6230, 0x22a2, 0x20a3, 0x0099, 0x20a3, 0x0000, 0x1078,
+	0x6dea, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x7a10, 0x22a2,
+	0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x027e, 0x20e1,
+	0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa092,
+	0x007e, 0x0048, 0x690d, 0x0d7e, 0xa0e8, 0xa735, 0x2d6c, 0x6810,
+	0xa085, 0x8500, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa61b, 0x2da6,
+	0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x691c, 0x0d7e, 0xa0e8, 0xa735,
+	0x2d6c, 0x6810, 0xa085, 0x8500, 0x20a2, 0x6814, 0x20a2, 0x0d7f,
+	0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0099, 0x20a3, 0x0000,
+	0x0078, 0x68df, 0x0c7e, 0x0f7e, 0x2c78, 0x7804, 0xa08a, 0x0040,
+	0x1048, 0x1332, 0xa08a, 0x0053, 0x10c8, 0x1332, 0x7918, 0x2160,
+	0x61a0, 0xd1bc, 0x0040, 0x6941, 0x6100, 0xd1f4, 0x0040, 0x693d,
+	0x6114, 0xa18c, 0x00ff, 0x0078, 0x6946, 0x2009, 0x0000, 0x0078,
+	0x6946, 0xa1e0, 0x29c0, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100,
+	0x619a, 0xa082, 0x0040, 0x1079, 0x6950, 0x0f7f, 0x0c7f, 0x007c,
+	0x6965, 0x6a73, 0x6a14, 0x6c27, 0x6963, 0x6963, 0x6963, 0x6963,
+	0x6963, 0x6963, 0x6963, 0x714c, 0x715d, 0x716e, 0x717f, 0x6963,
+	0x767e, 0x6963, 0x713b, 0x1078, 0x1332, 0x0d7e, 0x157e, 0x147e,
+	0x780b, 0xffff, 0x20a1, 0x020b, 0x1078, 0x69d0, 0x7910, 0x2168,
+	0x6948, 0x7922, 0x21a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x694c,
+	0xa184, 0x000f, 0x00c0, 0x6980, 0x2001, 0x0005, 0x0078, 0x698a,
+	0xd184, 0x0040, 0x6987, 0x2001, 0x0004, 0x0078, 0x698a, 0xa084,
+	0x0006, 0x8004, 0x017e, 0x2008, 0x7830, 0xa084, 0x00ff, 0x8007,
+	0xa105, 0x017f, 0x20a2, 0xd1ac, 0x0040, 0x699a, 0x20a3, 0x0002,
+	0x0078, 0x69a6, 0xd1b4, 0x0040, 0x69a1, 0x20a3, 0x0001, 0x0078,
+	0x69a6, 0x20a3, 0x0000, 0x2230, 0x0078, 0x69a8, 0x6a80, 0x6e7c,
+	0x20a9, 0x0008, 0xad80, 0x0017, 0x200c, 0x810f, 0x21a2, 0x8000,
+	0x00f0, 0x69ac, 0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1, 0x9080,
+	0x6014, 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x2001, 0xa8cd,
+	0x2003, 0x07d0, 0x2001, 0xa8cc, 0x2003, 0x0009, 0x2001, 0xa8d2,
+	0x2003, 0x0002, 0x1078, 0x158c, 0x147f, 0x157f, 0x0d7f, 0x007c,
+	0x20e1, 0x9080, 0x20e1, 0x4000, 0x7a18, 0xa280, 0x0023, 0x2014,
+	0x8210, 0xa294, 0x00ff, 0x2202, 0x8217, 0x7818, 0xa080, 0x0028,
+	0x2004, 0xd0bc, 0x0040, 0x69f6, 0x0d7e, 0xa0e8, 0xa735, 0x2d6c,
+	0x6810, 0xa085, 0x0600, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa61b,
+	0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x6a05, 0x0d7e, 0xa0e8,
+	0xa735, 0x2d6c, 0x6810, 0xa085, 0x0600, 0x20a2, 0x6814, 0x20a2,
+	0x0d7f, 0x20a3, 0x0000, 0x6130, 0x21a2, 0x20a3, 0x0829, 0x20a3,
+	0x0000, 0x22a2, 0x20a3, 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e,
+	0x20a1, 0x020b, 0x1078, 0x6a34, 0x7810, 0x2068, 0x6860, 0x20a2,
+	0x685c, 0x20a2, 0x6880, 0x20a2, 0x687c, 0x20a2, 0xa006, 0x20a2,
+	0x20a2, 0x20a2, 0x20a2, 0x60c3, 0x000c, 0x1078, 0x6dfb, 0x147f,
+	0x137f, 0x157f, 0x0d7f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1,
+	0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x6a52,
+	0x0d7e, 0xa0e8, 0xa735, 0x2d6c, 0x6810, 0xa085, 0x0500, 0x20a2,
+	0x6814, 0x20a2, 0x2069, 0xa61b, 0x2da6, 0x8d68, 0x2da6, 0x0d7f,
+	0x0078, 0x6a61, 0x0d7e, 0xa0e8, 0xa735, 0x2d6c, 0x6810, 0xa085,
+	0x0500, 0x20a2, 0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000, 0x6230,
+	0x22a2, 0x20a3, 0x0889, 0x20a3, 0x0000, 0x1078, 0x6dea, 0x22a2,
+	0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x027f, 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e, 0x7810,
+	0xa0ec, 0xf000, 0x0040, 0x6a8b, 0xa06d, 0x1078, 0x495f, 0x0040,
+	0x6a8b, 0x684c, 0xa084, 0x2020, 0xa086, 0x2020, 0x00c0, 0x6a8b,
+	0x7824, 0xc0cd, 0x7826, 0x20a1, 0x020b, 0x1078, 0x6be0, 0xa016,
+	0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x7810, 0xa084, 0xf000,
+	0x00c0, 0x6aa2, 0x7810, 0xa084, 0x0700, 0x8007, 0x1079, 0x6aaa,
+	0x0078, 0x6aa5, 0xa006, 0x1079, 0x6aaa, 0x147f, 0x137f, 0x157f,
+	0x0d7f, 0x007c, 0x6ab4, 0x6b4c, 0x6b57, 0x6b81, 0x6b95, 0x6bb1,
+	0x6bbc, 0x6ab2, 0x1078, 0x1332, 0x017e, 0x037e, 0x694c, 0xa18c,
+	0x0003, 0x0040, 0x6abf, 0xa186, 0x0003, 0x00c0, 0x6ace, 0x6b78,
+	0x7824, 0xd0cc, 0x0040, 0x6ac5, 0xc3e5, 0x23a2, 0x6868, 0x20a2,
+	0x6864, 0x20a2, 0x037f, 0x017f, 0x0078, 0x6b8c, 0xa186, 0x0001,
+	0x10c0, 0x1332, 0x6b78, 0x7824, 0xd0cc, 0x0040, 0x6ad8, 0xc3e5,
+	0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2, 0x22a2, 0x6874, 0x20a2,
+	0x22a2, 0x687c, 0x20a2, 0x2009, 0x0018, 0xa384, 0x0300, 0x0040,
+	0x6b46, 0xd3c4, 0x0040, 0x6aee, 0x687c, 0xa108, 0xd3cc, 0x0040,
+	0x6af3, 0x6874, 0xa108, 0x157e, 0x20a9, 0x000d, 0xad80, 0x0020,
+	0x201c, 0x831f, 0x23a2, 0x8000, 0x00f0, 0x6af8, 0x157f, 0x22a2,
+	0x22a2, 0x22a2, 0xa184, 0x0003, 0x0040, 0x6b46, 0x20a1, 0x020b,
+	0x20e1, 0x9080, 0x20e1, 0x4000, 0x007e, 0x7818, 0xa080, 0x0028,
+	0x2004, 0xd0bc, 0x0040, 0x6b26, 0x0d7e, 0xa0e8, 0xa735, 0x2d6c,
+	0x6810, 0xa085, 0x0700, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa61b,
+	0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x6b35, 0x0d7e, 0xa0e8,
+	0xa735, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2, 0x6814, 0x20a2,
+	0x0d7f, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x007f, 0x7b24, 0xd3cc,
+	0x0040, 0x6b3e, 0x20a3, 0x0889, 0x0078, 0x6b40, 0x20a3, 0x0898,
+	0x20a2, 0x1078, 0x6dea, 0x22a2, 0x20a3, 0x0000, 0x61c2, 0x037f,
+	0x017f, 0x1078, 0x6dfb, 0x007c, 0x2011, 0x0008, 0x7824, 0xd0cc,
+	0x0040, 0x6b53, 0xc2e5, 0x22a2, 0xa016, 0x0078, 0x6b8a, 0x2011,
+	0x0302, 0x7824, 0xd0cc, 0x0040, 0x6b5e, 0xc2e5, 0x22a2, 0xa016,
+	0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x0012, 0x22a2, 0x20a3, 0x0008,
+	0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x7000, 0x20a3, 0x0500,
+	0x22a2, 0x20a3, 0x000a, 0x22a2, 0x22a2, 0x20a3, 0x2500, 0x22a2,
+	0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0032, 0x1078, 0x6dfb,
+	0x007c, 0x2011, 0x0028, 0x7824, 0xd0cc, 0x0040, 0x6b88, 0xc2e5,
+	0x22a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
+	0x60c3, 0x0018, 0x1078, 0x6dfb, 0x007c, 0x2011, 0x0100, 0x7824,
+	0xd0cc, 0x0040, 0x6b9c, 0xc2e5, 0x22a2, 0xa016, 0x22a2, 0x22a2,
+	0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x7834, 0xa084,
+	0x00ff, 0x20a2, 0x22a2, 0x22a2, 0x60c3, 0x0020, 0x1078, 0x6dfb,
+	0x007c, 0x2011, 0x0008, 0x7824, 0xd0cc, 0x0040, 0x6bb8, 0xc2e5,
+	0x22a2, 0xa016, 0x0078, 0x6b8a, 0x037e, 0x7b10, 0xa384, 0xff00,
+	0x7812, 0xa384, 0x00ff, 0x8001, 0x00c0, 0x6bcf, 0x7824, 0xd0cc,
+	0x0040, 0x6bcb, 0xc2e5, 0x22a2, 0x037f, 0x0078, 0x6b8a, 0x047e,
+	0x2021, 0x0800, 0x007e, 0x7824, 0xd0cc, 0x007f, 0x0040, 0x6bd9,
+	0xc4e5, 0x24a2, 0x047f, 0x22a2, 0x20a2, 0x037f, 0x0078, 0x6b8c,
+	0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028,
+	0x2004, 0xd0bc, 0x0040, 0x6bfe, 0x0d7e, 0xa0e8, 0xa735, 0x2d6c,
+	0x6810, 0xa085, 0x0700, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa61b,
+	0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x6c0d, 0x0d7e, 0xa0e8,
+	0xa735, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2, 0x6814, 0x20a2,
+	0x0d7f, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x7824, 0xd0cc, 0x0040,
+	0x6c15, 0x20a3, 0x0889, 0x0078, 0x6c17, 0x20a3, 0x0898, 0x20a3,
+	0x0000, 0x1078, 0x6dea, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2,
+	0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e,
+	0x157e, 0x137e, 0x147e, 0x017e, 0x037e, 0x7810, 0xa084, 0x0700,
+	0x8007, 0x1079, 0x6c3a, 0x037f, 0x017f, 0x147f, 0x137f, 0x157f,
+	0x0d7f, 0x007c, 0x6c42, 0x6c42, 0x6c44, 0x6c42, 0x6c42, 0x6c42,
+	0x6c69, 0x6c42, 0x1078, 0x1332, 0x7910, 0xa18c, 0xf8ff, 0xa18d,
+	0x0600, 0x7912, 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x6c73,
+	0x0d7e, 0x2069, 0xa652, 0x6804, 0xd0bc, 0x0040, 0x6c5e, 0x682c,
+	0xa084, 0x00ff, 0x8007, 0x20a2, 0x0078, 0x6c60, 0x20a3, 0x3f00,
+	0x0d7f, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0001, 0x1078, 0x6dfb,
+	0x007c, 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x6c73, 0x20a3,
+	0x7f00, 0x0078, 0x6c61, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000,
+	0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x6c91, 0x0d7e,
+	0xa0e8, 0xa735, 0x2d6c, 0x6810, 0xa085, 0x0100, 0x20a2, 0x6814,
+	0x20a2, 0x2069, 0xa61b, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078,
+	0x6ca0, 0x0d7e, 0xa0e8, 0xa735, 0x2d6c, 0x6810, 0xa085, 0x0100,
+	0x20a2, 0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000, 0x6230, 0x22a2,
+	0x20a3, 0x0888, 0xa18d, 0x0008, 0x21a2, 0x1078, 0x6dea, 0x22a2,
+	0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x027f, 0x007c, 0x0e7e, 0x0d7e, 0x0c7e, 0x057e, 0x047e,
+	0x037e, 0x2061, 0x0100, 0x2071, 0xa600, 0x6130, 0x7818, 0x2068,
+	0x68a0, 0x2028, 0xd0bc, 0x00c0, 0x6cca, 0x6910, 0x6a14, 0x6430,
+	0x0078, 0x6cce, 0x6910, 0x6a14, 0x736c, 0x7470, 0x781c, 0xa086,
+	0x0006, 0x0040, 0x6d2d, 0xd5bc, 0x0040, 0x6cde, 0xa185, 0x0100,
+	0x6062, 0x6266, 0x636a, 0x646e, 0x0078, 0x6ce5, 0xa185, 0x0100,
+	0x6062, 0x6266, 0x606b, 0x0000, 0x646e, 0x6073, 0x0809, 0x6077,
+	0x0008, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a,
+	0x607f, 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086, 0x7810, 0x2070,
+	0x7014, 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca,
+	0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000,
+	0xa582, 0x0080, 0x0048, 0x6d17, 0x6a00, 0xd2f4, 0x0040, 0x6d15,
+	0x6a14, 0xa294, 0x00ff, 0x0078, 0x6d17, 0x2011, 0x0000, 0x629e,
+	0x6017, 0x0016, 0x2009, 0x07d0, 0x60c4, 0xa084, 0xfff0, 0xa005,
+	0x0040, 0x6d24, 0x2009, 0x1b58, 0x1078, 0x5ad0, 0x037f, 0x047f,
+	0x057f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x7810, 0x2070, 0x704c,
+	0xa084, 0x0003, 0xa086, 0x0002, 0x0040, 0x6d85, 0xd5bc, 0x0040,
+	0x6d41, 0xa185, 0x0100, 0x6062, 0x6266, 0x636a, 0x646e, 0x0078,
+	0x6d48, 0xa185, 0x0100, 0x6062, 0x6266, 0x606b, 0x0000, 0x646e,
+	0x6073, 0x0880, 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff,
+	0x688e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086, 0x7808,
+	0x6082, 0x7060, 0x608a, 0x705c, 0x608e, 0x7080, 0x60c6, 0x707c,
+	0x60ca, 0x707c, 0x792c, 0xa108, 0x792e, 0x7080, 0x7928, 0xa109,
+	0x792a, 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7,
+	0x0000, 0xa582, 0x0080, 0x0048, 0x6d80, 0x6a00, 0xd2f4, 0x0040,
+	0x6d7e, 0x6a14, 0xa294, 0x00ff, 0x0078, 0x6d80, 0x2011, 0x0000,
+	0x629e, 0x6017, 0x0012, 0x0078, 0x6d1a, 0xd5bc, 0x0040, 0x6d90,
+	0xa185, 0x0700, 0x6062, 0x6266, 0x636a, 0x646e, 0x0078, 0x6d97,
+	0xa185, 0x0700, 0x6062, 0x6266, 0x606b, 0x0000, 0x646e, 0x1078,
+	0x495f, 0x0040, 0x6dad, 0x0d7e, 0x7810, 0xa06d, 0x684c, 0x0d7f,
+	0xa084, 0x2020, 0xa086, 0x2020, 0x00c0, 0x6dad, 0x7824, 0xc0cd,
+	0x7826, 0x6073, 0x0889, 0x0078, 0x6daf, 0x6073, 0x0898, 0x6077,
+	0x0000, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a,
+	0x607f, 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, 0x7014, 0x608a,
+	0x7010, 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce,
+	0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xa582, 0x0080,
+	0x0048, 0x6ddd, 0x6a00, 0xd2f4, 0x0040, 0x6ddb, 0x6a14, 0xa294,
+	0x00ff, 0x0078, 0x6ddd, 0x2011, 0x0000, 0x629e, 0x7824, 0xd0cc,
+	0x0040, 0x6de6, 0x6017, 0x0016, 0x0078, 0x6d1a, 0x6017, 0x0012,
+	0x0078, 0x6d1a, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294,
+	0x00ff, 0x2202, 0x8217, 0x007c, 0x0d7e, 0x2069, 0xa8b1, 0x6843,
+	0x0001, 0x0d7f, 0x007c, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7,
+	0x9575, 0x1078, 0x6e06, 0x1078, 0x5ac0, 0x007c, 0x007e, 0x6014,
+	0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x007f, 0x007c, 0x007e,
+	0x0c7e, 0x2061, 0x0100, 0x6014, 0xa084, 0x0004, 0xa085, 0x0008,
+	0x6016, 0x0c7f, 0x007f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x027e,
+	0x2061, 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, 0x4000, 0x0040,
+	0x6e59, 0x1078, 0x6e0f, 0x6803, 0x1000, 0x6803, 0x0000, 0x0c7e,
+	0x2061, 0xa8b1, 0x6128, 0xa192, 0x00c8, 0x00c8, 0x6e44, 0x8108,
+	0x612a, 0x6124, 0x0c7f, 0x81ff, 0x0040, 0x6e54, 0x1078, 0x5ac0,
+	0x1078, 0x6e06, 0x0078, 0x6e54, 0x6124, 0xa1e5, 0x0000, 0x0040,
+	0x6e51, 0x1078, 0xa5c4, 0x1078, 0x5acb, 0x2009, 0x0014, 0x1078,
+	0x775c, 0x0c7f, 0x0078, 0x6e54, 0x027f, 0x017f, 0x0d7f, 0x0c7f,
+	0x007c, 0x2001, 0xa8cd, 0x2004, 0xa005, 0x00c0, 0x6e54, 0x0c7e,
+	0x2061, 0xa8b1, 0x6128, 0xa192, 0x0003, 0x00c8, 0x6e44, 0x8108,
+	0x612a, 0x0c7f, 0x1078, 0x5ac0, 0x1078, 0x4224, 0x0078, 0x6e54,
+	0x0c7e, 0x0d7e, 0x0e7e, 0x017e, 0x027e, 0x1078, 0x5ad8, 0x2071,
+	0xa8b1, 0x713c, 0x81ff, 0x0040, 0x6e9a, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x6904, 0xa194, 0x4000, 0x0040, 0x6ea0, 0x6803, 0x1000,
+	0x6803, 0x0000, 0x037e, 0x2019, 0x0001, 0x1078, 0x7058, 0x037f,
+	0x713c, 0x2160, 0x1078, 0xa5c4, 0x2009, 0x004a, 0x1078, 0x775c,
+	0x0078, 0x6e9a, 0x027f, 0x017f, 0x0e7f, 0x0d7f, 0x0c7f, 0x007c,
+	0x0078, 0x6e8a, 0x0e7e, 0x2071, 0xa8b1, 0x7048, 0xd084, 0x0040,
+	0x6ebc, 0x713c, 0x81ff, 0x0040, 0x6ebc, 0x2071, 0x0100, 0xa188,
+	0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0, 0x6eba, 0x7017, 0x0012,
+	0x0078, 0x6ebc, 0x7017, 0x0016, 0x0e7f, 0x007c, 0x0e7e, 0x0d7e,
+	0x0c7e, 0x067e, 0x057e, 0x047e, 0x007e, 0x127e, 0x2091, 0x8000,
+	0x6018, 0x2068, 0x6ca0, 0x2071, 0xa8b1, 0x7018, 0x2068, 0x8dff,
+	0x0040, 0x6ee6, 0x68a0, 0xa406, 0x0040, 0x6eda, 0x6854, 0x2068,
+	0x0078, 0x6ecf, 0x6010, 0x2060, 0x643c, 0x6540, 0x6648, 0x2d60,
+	0x1078, 0x4736, 0x0040, 0x6ee6, 0xa085, 0x0001, 0x127f, 0x007f,
+	0x047f, 0x057f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x20a1,
+	0x020b, 0x1078, 0x6731, 0x20a3, 0x1200, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x781c, 0xa086, 0x0004, 0x00c0, 0x6f01, 0x6098, 0x0078,
+	0x6f02, 0x6030, 0x20a2, 0x7834, 0x20a2, 0x7838, 0x20a2, 0x20a9,
+	0x0010, 0xa006, 0x20a2, 0x00f0, 0x6f0a, 0x20a2, 0x20a2, 0x60c3,
+	0x002c, 0x1078, 0x6dfb, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b,
+	0x1078, 0x6731, 0x20a3, 0x0f00, 0x20a3, 0x0000, 0x20a3, 0x0000,
+	0x7808, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x6dfb, 0x147f, 0x157f,
+	0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x67c2, 0x20a3,
+	0x0200, 0x20a3, 0x0000, 0x20a9, 0x0006, 0x2011, 0xa640, 0x2019,
+	0xa641, 0x23a6, 0x22a6, 0xa398, 0x0002, 0xa290, 0x0002, 0x00f0,
+	0x6f39, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078,
+	0x6dfb, 0x147f, 0x157f, 0x007c, 0x157e, 0x147e, 0x017e, 0x027e,
+	0x20a1, 0x020b, 0x1078, 0x6799, 0x1078, 0x67b0, 0x7810, 0xa080,
+	0x0000, 0x2004, 0xa080, 0x0015, 0x2098, 0x7808, 0xa088, 0x0002,
+	0x21a8, 0x53a6, 0xa080, 0x0004, 0x8003, 0x60c2, 0x1078, 0x6dfb,
+	0x027f, 0x017f, 0x147f, 0x157f, 0x007c, 0x157e, 0x147e, 0x20a1,
+	0x020b, 0x1078, 0x6731, 0x20a3, 0x6200, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x7808, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x6dfb, 0x147f,
+	0x157f, 0x007c, 0x157e, 0x147e, 0x017e, 0x027e, 0x20a1, 0x020b,
+	0x1078, 0x6731, 0x7810, 0xa080, 0x0000, 0x2004, 0xa080, 0x0017,
+	0x2098, 0x7808, 0xa088, 0x0002, 0x21a8, 0x53a6, 0x8003, 0x60c2,
+	0x1078, 0x6dfb, 0x027f, 0x017f, 0x147f, 0x157f, 0x007c, 0x0e7e,
+	0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0xa8b1, 0x700c,
+	0x2060, 0x8cff, 0x0040, 0x6fbb, 0x1078, 0x8f00, 0x00c0, 0x6fb2,
+	0x1078, 0x7c83, 0x600c, 0x007e, 0x1078, 0x772d, 0x1078, 0x7233,
+	0x0c7f, 0x0078, 0x6fa9, 0x700f, 0x0000, 0x700b, 0x0000, 0x127f,
+	0x007f, 0x0c7f, 0x0e7f, 0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e,
+	0x0d7e, 0x0c7e, 0x027e, 0x017e, 0x007e, 0x2091, 0x8000, 0x2069,
+	0x0100, 0x2079, 0x0140, 0x2071, 0xa8b1, 0x7024, 0x2060, 0x8cff,
+	0x0040, 0x7014, 0x1078, 0x6e0f, 0x68c3, 0x0000, 0x1078, 0x5acb,
+	0x2009, 0x0013, 0x1078, 0x775c, 0x20a9, 0x01f4, 0x6824, 0xd094,
+	0x0040, 0x6ff7, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040,
+	0x7009, 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x7009, 0xd084,
+	0x0040, 0x6ffe, 0x6827, 0x0001, 0x0078, 0x7000, 0x00f0, 0x6fe6,
+	0x7804, 0xa084, 0x1000, 0x0040, 0x7009, 0x7803, 0x0100, 0x7803,
+	0x0000, 0x6824, 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f,
+	0x0f7f, 0x157f, 0x127f, 0x007c, 0x2001, 0xa600, 0x2004, 0xa096,
+	0x0001, 0x0040, 0x704e, 0xa096, 0x0004, 0x0040, 0x704e, 0x1078,
+	0x5acb, 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011, 0x41dc, 0x1078,
+	0x5a45, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x703c, 0x6827,
+	0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x704e, 0x7803, 0x1000,
+	0x7803, 0x0000, 0x0078, 0x704e, 0xd084, 0x0040, 0x7043, 0x6827,
+	0x0001, 0x0078, 0x7045, 0x00f0, 0x702b, 0x7804, 0xa084, 0x1000,
+	0x0040, 0x704e, 0x7803, 0x0100, 0x7803, 0x0000, 0x007f, 0x017f,
+	0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f, 0x007c,
+	0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x027e, 0x017e,
+	0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071,
+	0xa8b1, 0x703c, 0x2060, 0x8cff, 0x0040, 0x70d6, 0x68af, 0x95f5,
+	0x6817, 0x0010, 0x2009, 0x00fa, 0x8109, 0x00c0, 0x7074, 0x68c7,
+	0x0000, 0x68cb, 0x0008, 0x1078, 0x5ad8, 0x1078, 0x1f7e, 0x047e,
+	0x057e, 0x2009, 0x017f, 0x212c, 0x200b, 0x00a5, 0x2021, 0x0169,
+	0x2404, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x70a5, 0x68c7,
+	0x0000, 0x68cb, 0x0008, 0x0e7e, 0x0f7e, 0x2079, 0x0020, 0x2071,
+	0xa908, 0x6814, 0xa084, 0x0004, 0xa085, 0x0012, 0x6816, 0x7803,
+	0x0008, 0x7003, 0x0000, 0x0f7f, 0x0e7f, 0x250a, 0x057f, 0x047f,
+	0xa39d, 0x0000, 0x00c0, 0x70b0, 0x2009, 0x0049, 0x1078, 0x775c,
+	0x20a9, 0x03e8, 0x6824, 0xd094, 0x0040, 0x70c3, 0x6827, 0x0004,
+	0x7804, 0xa084, 0x4000, 0x0040, 0x70d5, 0x7803, 0x1000, 0x7803,
+	0x0000, 0x0078, 0x70d5, 0xd08c, 0x0040, 0x70ca, 0x6827, 0x0002,
+	0x0078, 0x70cc, 0x00f0, 0x70b2, 0x7804, 0xa084, 0x1000, 0x0040,
+	0x70d5, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, 0x007f, 0x017f,
+	0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f, 0x007c,
+	0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069, 0xa8b1, 0x6a06, 0x127f,
+	0x0d7f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069, 0xa8b1,
+	0x6a32, 0x127f, 0x0d7f, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x067e,
+	0x007e, 0x127e, 0x2071, 0xa8b1, 0x7614, 0x2660, 0x2678, 0x2091,
+	0x8000, 0x8cff, 0x0040, 0x7134, 0x601c, 0xa206, 0x00c0, 0x712f,
+	0x7014, 0xac36, 0x00c0, 0x710e, 0x660c, 0x7616, 0x7010, 0xac36,
+	0x00c0, 0x711c, 0x2c00, 0xaf36, 0x0040, 0x711a, 0x2f00, 0x7012,
+	0x0078, 0x711c, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06,
+	0x0040, 0x7125, 0x7e0e, 0x0078, 0x7126, 0x2678, 0x600f, 0x0000,
+	0x1078, 0x8ec6, 0x1078, 0x7233, 0x0c7f, 0x0078, 0x7101, 0x2c78,
+	0x600c, 0x2060, 0x0078, 0x7101, 0x127f, 0x007f, 0x067f, 0x0c7f,
+	0x0e7f, 0x0f7f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078,
+	0x69d0, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2,
+	0x20a3, 0x1000, 0x0078, 0x718e, 0x157e, 0x147e, 0x20a1, 0x020b,
+	0x1078, 0x69d0, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2,
+	0x20a2, 0x20a3, 0x4000, 0x0078, 0x718e, 0x157e, 0x147e, 0x20a1,
+	0x020b, 0x1078, 0x69d0, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2,
+	0x20a2, 0x20a2, 0x20a3, 0x2000, 0x0078, 0x718e, 0x157e, 0x147e,
+	0x20a1, 0x020b, 0x1078, 0x69d0, 0x7810, 0x20a2, 0xa006, 0x20a2,
+	0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0400, 0x0078, 0x718e, 0x157e,
+	0x147e, 0x20a1, 0x020b, 0x1078, 0x69d0, 0x7810, 0x20a2, 0xa006,
+	0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0200, 0x1078, 0x723e,
+	0x60c3, 0x0020, 0x1078, 0x6dfb, 0x147f, 0x157f, 0x007c, 0x127e,
+	0x0c7e, 0x2091, 0x8000, 0x2061, 0x0100, 0x6120, 0xd1b4, 0x00c0,
+	0x71a6, 0xd1bc, 0x00c0, 0x71f0, 0x0078, 0x7230, 0x2009, 0x017f,
+	0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e, 0x2069, 0x0140, 0x20a9,
+	0x001e, 0x2009, 0x0169, 0x6804, 0xa084, 0x4000, 0x0040, 0x71e7,
+	0x6020, 0xd0b4, 0x0040, 0x71e7, 0x6024, 0xd094, 0x00c0, 0x71e7,
+	0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x71e7, 0x00f0,
+	0x71b3, 0x027e, 0x6198, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c,
+	0x00ff, 0xa10d, 0x6088, 0x628c, 0x618e, 0x608b, 0xbc91, 0x6043,
+	0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6024, 0xd094, 0x00c0,
+	0x71e6, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x71dd, 0x027f, 0x0d7f,
+	0x007f, 0x157f, 0x2009, 0x017f, 0x200b, 0x0000, 0x0078, 0x7230,
+	0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e, 0x2069,
+	0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084, 0x4000,
+	0x0040, 0x7229, 0x6020, 0xd0bc, 0x0040, 0x7229, 0x2104, 0xa084,
+	0x000f, 0xa086, 0x0004, 0x00c0, 0x7229, 0x00f0, 0x71fd, 0x027e,
+	0x6164, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c, 0x00ff, 0xa10d,
+	0x6088, 0x628c, 0x608b, 0xbc91, 0x618e, 0x6043, 0x0001, 0x6043,
+	0x0000, 0x608a, 0x628e, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x7223,
+	0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b, 0x0000,
+	0x0c7f, 0x127f, 0x007c, 0x0e7e, 0x2071, 0xa8b1, 0x7020, 0xa005,
+	0x0040, 0x723c, 0x8001, 0x7022, 0x0e7f, 0x007c, 0x20a9, 0x0008,
+	0x20a2, 0x00f0, 0x7240, 0x20a2, 0x20a2, 0x007c, 0x0f7e, 0x0e7e,
+	0x0d7e, 0x0c7e, 0x077e, 0x067e, 0x007e, 0x127e, 0x2091, 0x8000,
+	0x2071, 0xa8b1, 0x7614, 0x2660, 0x2678, 0x2039, 0x0001, 0x87ff,
+	0x0040, 0x72e2, 0x8cff, 0x0040, 0x72e2, 0x601c, 0xa086, 0x0006,
+	0x00c0, 0x72dd, 0x88ff, 0x0040, 0x726d, 0x2800, 0xac06, 0x00c0,
+	0x72dd, 0x2039, 0x0000, 0x0078, 0x7278, 0x6018, 0xa206, 0x00c0,
+	0x72dd, 0x85ff, 0x0040, 0x7278, 0x6020, 0xa106, 0x00c0, 0x72dd,
+	0x7024, 0xac06, 0x00c0, 0x72a8, 0x2069, 0x0100, 0x68c0, 0xa005,
+	0x0040, 0x72a3, 0x1078, 0x5acb, 0x6817, 0x0008, 0x68c3, 0x0000,
+	0x1078, 0x7378, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04,
+	0xa384, 0x1000, 0x0040, 0x7298, 0x6803, 0x0100, 0x6803, 0x0000,
+	0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x72a0, 0x6827, 0x0001,
+	0x037f, 0x0078, 0x72a8, 0x6003, 0x0009, 0x630a, 0x0078, 0x72dd,
+	0x7014, 0xac36, 0x00c0, 0x72ae, 0x660c, 0x7616, 0x7010, 0xac36,
+	0x00c0, 0x72bc, 0x2c00, 0xaf36, 0x0040, 0x72ba, 0x2f00, 0x7012,
+	0x0078, 0x72bc, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06,
+	0x0040, 0x72c5, 0x7e0e, 0x0078, 0x72c6, 0x2678, 0x89ff, 0x00c0,
+	0x72d5, 0x600f, 0x0000, 0x6010, 0x2068, 0x1078, 0x8d06, 0x0040,
+	0x72d3, 0x1078, 0xa1ca, 0x1078, 0x8ec6, 0x1078, 0x7233, 0x88ff,
+	0x00c0, 0x72ec, 0x0c7f, 0x0078, 0x7257, 0x2c78, 0x600c, 0x2060,
+	0x0078, 0x7257, 0xa006, 0x127f, 0x007f, 0x067f, 0x077f, 0x0c7f,
+	0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x6017, 0x0000, 0x0c7f, 0xa8c5,
+	0x0001, 0x0078, 0x72e3, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e,
+	0x027e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0xa8b1, 0x7638,
+	0x2660, 0x2678, 0x8cff, 0x0040, 0x7367, 0x601c, 0xa086, 0x0006,
+	0x00c0, 0x7362, 0x87ff, 0x0040, 0x7313, 0x2700, 0xac06, 0x00c0,
+	0x7362, 0x0078, 0x731e, 0x6018, 0xa206, 0x00c0, 0x7362, 0x85ff,
+	0x0040, 0x731e, 0x6020, 0xa106, 0x00c0, 0x7362, 0x703c, 0xac06,
+	0x00c0, 0x7332, 0x037e, 0x2019, 0x0001, 0x1078, 0x7058, 0x7033,
+	0x0000, 0x703f, 0x0000, 0x7043, 0x0000, 0x7047, 0x0000, 0x704b,
+	0x0000, 0x037f, 0x7038, 0xac36, 0x00c0, 0x7338, 0x660c, 0x763a,
+	0x7034, 0xac36, 0x00c0, 0x7346, 0x2c00, 0xaf36, 0x0040, 0x7344,
+	0x2f00, 0x7036, 0x0078, 0x7346, 0x7037, 0x0000, 0x660c, 0x067e,
+	0x2c00, 0xaf06, 0x0040, 0x734f, 0x7e0e, 0x0078, 0x7350, 0x2678,
+	0x600f, 0x0000, 0x6010, 0x2068, 0x1078, 0x8d06, 0x0040, 0x735a,
+	0x1078, 0xa1ca, 0x1078, 0x8ec6, 0x87ff, 0x00c0, 0x7371, 0x0c7f,
+	0x0078, 0x7302, 0x2c78, 0x600c, 0x2060, 0x0078, 0x7302, 0xa006,
+	0x127f, 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
+	0x007c, 0x6017, 0x0000, 0x0c7f, 0xa7bd, 0x0001, 0x0078, 0x7368,
+	0x0e7e, 0x2071, 0xa8b1, 0x2001, 0xa600, 0x2004, 0xa086, 0x0002,
+	0x00c0, 0x7386, 0x7007, 0x0005, 0x0078, 0x7388, 0x7007, 0x0000,
+	0x0e7f, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x067e, 0x027e, 0x007e,
+	0x127e, 0x2091, 0x8000, 0x2071, 0xa8b1, 0x2c10, 0x7638, 0x2660,
+	0x2678, 0x8cff, 0x0040, 0x73c8, 0x2200, 0xac06, 0x00c0, 0x73c3,
+	0x7038, 0xac36, 0x00c0, 0x73a6, 0x660c, 0x763a, 0x7034, 0xac36,
+	0x00c0, 0x73b4, 0x2c00, 0xaf36, 0x0040, 0x73b2, 0x2f00, 0x7036,
+	0x0078, 0x73b4, 0x7037, 0x0000, 0x660c, 0x2c00, 0xaf06, 0x0040,
+	0x73bc, 0x7e0e, 0x0078, 0x73bd, 0x2678, 0x600f, 0x0000, 0xa085,
+	0x0001, 0x0078, 0x73c8, 0x2c78, 0x600c, 0x2060, 0x0078, 0x7399,
+	0x127f, 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c,
+	0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2091,
+	0x8000, 0x2071, 0xa8b1, 0x760c, 0x2660, 0x2678, 0x8cff, 0x0040,
+	0x7469, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x7464,
+	0x7024, 0xac06, 0x00c0, 0x740f, 0x2069, 0x0100, 0x68c0, 0xa005,
+	0x0040, 0x743d, 0x1078, 0x6e0f, 0x68c3, 0x0000, 0x1078, 0x7378,
+	0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000,
+	0x0040, 0x7406, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100,
+	0x6824, 0xd084, 0x0040, 0x740e, 0x6827, 0x0001, 0x037f, 0x700c,
+	0xac36, 0x00c0, 0x7415, 0x660c, 0x760e, 0x7008, 0xac36, 0x00c0,
+	0x7423, 0x2c00, 0xaf36, 0x0040, 0x7421, 0x2f00, 0x700a, 0x0078,
+	0x7423, 0x700b, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040,
+	0x742c, 0x7e0e, 0x0078, 0x742d, 0x2678, 0x600f, 0x0000, 0x1078,
+	0x8eec, 0x00c0, 0x7441, 0x1078, 0x28a6, 0x1078, 0x8f00, 0x00c0,
+	0x745d, 0x1078, 0x7c83, 0x0078, 0x745d, 0x1078, 0x7378, 0x0078,
+	0x740f, 0x1078, 0x8f00, 0x00c0, 0x7449, 0x1078, 0x7c83, 0x0078,
+	0x745d, 0x6010, 0x2068, 0x1078, 0x8d06, 0x0040, 0x745d, 0x601c,
+	0xa086, 0x0003, 0x00c0, 0x7471, 0x6837, 0x0103, 0x6b4a, 0x6847,
+	0x0000, 0x1078, 0x4a73, 0x1078, 0x8eb9, 0x1078, 0x8ec6, 0x1078,
+	0x7233, 0x0c7f, 0x0078, 0x73de, 0x2c78, 0x600c, 0x2060, 0x0078,
+	0x73de, 0x127f, 0x007f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
+	0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x745d, 0x1078, 0xa1ca,
+	0x0078, 0x745d, 0x037e, 0x157e, 0x137e, 0x147e, 0x3908, 0xa006,
+	0xa190, 0x0020, 0x221c, 0xa39e, 0x2676, 0x00c0, 0x748b, 0x8210,
+	0x8000, 0x0078, 0x7482, 0xa005, 0x0040, 0x7497, 0x20a9, 0x0020,
+	0x2198, 0x8211, 0xa282, 0x0020, 0x20c8, 0x20a0, 0x53a3, 0x147f,
+	0x137f, 0x157f, 0x037f, 0x007c, 0x0d7e, 0x20a1, 0x020b, 0x1078,
+	0x67c2, 0x20a3, 0x0200, 0x20a3, 0x0014, 0x60c3, 0x0014, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x2099, 0xa8a5, 0x20a9, 0x0004, 0x53a6,
+	0x20a3, 0x0004, 0x20a3, 0x7878, 0x20a3, 0x0000, 0x20a3, 0x0000,
+	0x1078, 0x6dfb, 0x0d7f, 0x007c, 0x20a1, 0x020b, 0x1078, 0x67c2,
+	0x20a3, 0x0214, 0x20a3, 0x0018, 0x20a3, 0x0800, 0x7810, 0xa084,
+	0xff00, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+	0x20a3, 0x0000, 0x7810, 0xa084, 0x00ff, 0x20a2, 0x7828, 0x20a2,
+	0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0018, 0x1078, 0x6dfb,
+	0x007c, 0x0d7e, 0x017e, 0x2f68, 0x2009, 0x0035, 0x1078, 0x91bc,
+	0x00c0, 0x7551, 0x20a1, 0x020b, 0x1078, 0x6731, 0x20a3, 0x1300,
+	0x20a3, 0x0000, 0x7828, 0x2068, 0x681c, 0xa086, 0x0003, 0x0040,
+	0x752d, 0x7818, 0xa080, 0x0028, 0x2014, 0xa286, 0x007e, 0x00c0,
+	0x7507, 0x20a3, 0x00ff, 0x20a3, 0xfffe, 0x0078, 0x7542, 0xa286,
+	0x007f, 0x00c0, 0x7511, 0x20a3, 0x00ff, 0x20a3, 0xfffd, 0x0078,
+	0x7542, 0xd2bc, 0x0040, 0x7527, 0xa286, 0x0080, 0x00c0, 0x751e,
+	0x20a3, 0x00ff, 0x20a3, 0xfffc, 0x0078, 0x7542, 0xa2e8, 0xa735,
+	0x2d6c, 0x6810, 0x20a2, 0x6814, 0x20a2, 0x0078, 0x7542, 0x20a3,
+	0x0000, 0x6098, 0x20a2, 0x0078, 0x7542, 0x7818, 0xa080, 0x0028,
+	0x2004, 0xa082, 0x007e, 0x0048, 0x753e, 0x0d7e, 0x2069, 0xa61b,
+	0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x7542, 0x20a3, 0x0000,
+	0x6030, 0x20a2, 0x7834, 0x20a2, 0x7838, 0x20a2, 0x20a3, 0x0000,
+	0x20a3, 0x0000, 0x60c3, 0x000c, 0x1078, 0x6dfb, 0x017f, 0x0d7f,
+	0x007c, 0x7817, 0x0001, 0x7803, 0x0006, 0x017f, 0x0d7f, 0x007c,
+	0x0d7e, 0x027e, 0x7928, 0x2168, 0x691c, 0xa186, 0x0006, 0x0040,
+	0x757a, 0xa186, 0x0003, 0x0040, 0x75d5, 0xa186, 0x0005, 0x0040,
+	0x75b8, 0xa186, 0x0004, 0x0040, 0x75a8, 0xa186, 0x0008, 0x0040,
+	0x75c2, 0x7807, 0x0037, 0x7813, 0x1700, 0x1078, 0x7640, 0x027f,
+	0x0d7f, 0x007c, 0x1078, 0x75fd, 0x2009, 0x4000, 0x6800, 0x0079,
+	0x7581, 0x7594, 0x75a2, 0x7596, 0x75a2, 0x759d, 0x7594, 0x7594,
+	0x75a2, 0x75a2, 0x75a2, 0x75a2, 0x7594, 0x7594, 0x7594, 0x7594,
+	0x7594, 0x75a2, 0x7594, 0x75a2, 0x1078, 0x1332, 0x6824, 0xd0e4,
+	0x0040, 0x759d, 0xd0cc, 0x0040, 0x75a0, 0xa00e, 0x0078, 0x75a2,
+	0x2009, 0x2000, 0x6828, 0x20a2, 0x682c, 0x20a2, 0x0078, 0x75f3,
+	0x1078, 0x75fd, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x2009, 0x4000,
+	0x6a00, 0xa286, 0x0002, 0x00c0, 0x75b6, 0xa00e, 0x0078, 0x75f3,
+	0x1078, 0x75fd, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x2009, 0x4000,
+	0x0078, 0x75f3, 0x1078, 0x75fd, 0x20a3, 0x0000, 0x20a3, 0x0000,
+	0x2009, 0x4000, 0xa286, 0x0005, 0x0040, 0x75d2, 0xa286, 0x0002,
+	0x00c0, 0x75d3, 0xa00e, 0x0078, 0x75f3, 0x1078, 0x75fd, 0x6810,
+	0x2068, 0x697c, 0x6810, 0xa112, 0x6980, 0x6814, 0xa103, 0x20a2,
+	0x22a2, 0x7928, 0xa180, 0x0000, 0x2004, 0xa08e, 0x0002, 0x0040,
+	0x75f1, 0xa08e, 0x0004, 0x0040, 0x75f1, 0x2009, 0x4000, 0x0078,
+	0x75f3, 0x2009, 0x0000, 0x21a2, 0x20a3, 0x0000, 0x60c3, 0x0018,
+	0x1078, 0x6dfb, 0x027f, 0x0d7f, 0x007c, 0x037e, 0x047e, 0x057e,
+	0x067e, 0x20a1, 0x020b, 0x1078, 0x67c2, 0xa006, 0x20a3, 0x0200,
+	0x20a2, 0x7934, 0x21a2, 0x7938, 0x21a2, 0x7818, 0xa080, 0x0028,
+	0x2004, 0xa092, 0x007e, 0x0048, 0x7623, 0x0d7e, 0x2069, 0xa61b,
+	0x2d2c, 0x8d68, 0x2d34, 0xa0e8, 0xa735, 0x2d6c, 0x6b10, 0x6c14,
+	0x0d7f, 0x0078, 0x7629, 0x2019, 0x0000, 0x6498, 0x2029, 0x0000,
+	0x6630, 0x7828, 0xa080, 0x0007, 0x2004, 0xa086, 0x0003, 0x00c0,
+	0x7637, 0x25a2, 0x26a2, 0x23a2, 0x24a2, 0x0078, 0x763b, 0x23a2,
+	0x24a2, 0x25a2, 0x26a2, 0x067f, 0x057f, 0x047f, 0x037f, 0x007c,
+	0x20a1, 0x020b, 0x1078, 0x67c2, 0x20a3, 0x0100, 0x20a3, 0x0000,
+	0x20a3, 0x0009, 0x7810, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x6dfb,
+	0x007c, 0x20a1, 0x020b, 0x1078, 0x6728, 0x20a3, 0x1400, 0x20a3,
+	0x0000, 0x7834, 0x20a2, 0x7838, 0x20a2, 0x7828, 0x20a2, 0x782c,
+	0x20a2, 0x7830, 0xa084, 0x00ff, 0x8007, 0x20a2, 0x20a3, 0x0000,
+	0x60c3, 0x0010, 0x1078, 0x6dfb, 0x007c, 0x20a1, 0x020b, 0x1078,
+	0x67b9, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x7828, 0x20a2, 0x7810,
+	0x20a2, 0x60c3, 0x0008, 0x1078, 0x6dfb, 0x007c, 0x147e, 0x20a1,
+	0x020b, 0x1078, 0x7689, 0x60c3, 0x0000, 0x1078, 0x6dfb, 0x147f,
+	0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028,
+	0x2004, 0xd0bc, 0x0040, 0x76a6, 0x0d7e, 0xa0e8, 0xa735, 0x2d6c,
+	0x6810, 0xa085, 0x0300, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa61b,
+	0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x76ae, 0x20a3, 0x0300,
+	0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0819,
+	0x20a3, 0x0000, 0x1078, 0x6dea, 0x22a2, 0x20a3, 0x0000, 0x2fa2,
+	0x7a08, 0x22a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x007c, 0x2061,
+	0xad00, 0x2a70, 0x7064, 0x704a, 0x704f, 0xad00, 0x007c, 0x0e7e,
+	0x127e, 0x2071, 0xa600, 0x2091, 0x8000, 0x7548, 0xa582, 0x0010,
+	0x0048, 0x76f9, 0x704c, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040,
+	0x76e5, 0xace0, 0x0010, 0x7058, 0xac02, 0x00c8, 0x76e1, 0x0078,
+	0x76d4, 0x2061, 0xad00, 0x0078, 0x76d4, 0x6003, 0x0008, 0x8529,
+	0x754a, 0xaca8, 0x0010, 0x7058, 0xa502, 0x00c8, 0x76f5, 0x754e,
+	0xa085, 0x0001, 0x127f, 0x0e7f, 0x007c, 0x704f, 0xad00, 0x0078,
+	0x76f0, 0xa006, 0x0078, 0x76f2, 0x0e7e, 0x2071, 0xa600, 0x7548,
+	0xa582, 0x0010, 0x0048, 0x772a, 0x704c, 0x2060, 0x6000, 0xa086,
+	0x0000, 0x0040, 0x7717, 0xace0, 0x0010, 0x7058, 0xac02, 0x00c8,
+	0x7713, 0x0078, 0x7706, 0x2061, 0xad00, 0x0078, 0x7706, 0x6003,
+	0x0008, 0x8529, 0x754a, 0xaca8, 0x0010, 0x7058, 0xa502, 0x00c8,
+	0x7726, 0x754e, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x704f, 0xad00,
+	0x0078, 0x7722, 0xa006, 0x0078, 0x7724, 0xac82, 0xad00, 0x1048,
+	0x1332, 0x2001, 0xa616, 0x2004, 0xac02, 0x10c8, 0x1332, 0xa006,
+	0x6006, 0x600a, 0x600e, 0x6012, 0x6016, 0x601a, 0x601f, 0x0000,
+	0x6003, 0x0000, 0x6022, 0x6026, 0x602a, 0x602e, 0x6032, 0x6036,
+	0x603a, 0x603e, 0x2061, 0xa600, 0x6048, 0x8000, 0x604a, 0xa086,
+	0x0001, 0x0040, 0x7754, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078,
+	0x62d1, 0x127f, 0x0078, 0x7753, 0x601c, 0xa084, 0x000f, 0x0079,
+	0x7761, 0x776a, 0x777b, 0x7797, 0x77b3, 0x920e, 0x922a, 0x9246,
+	0x776a, 0x777b, 0xa186, 0x0013, 0x00c0, 0x7773, 0x1078, 0x61cd,
+	0x1078, 0x62d1, 0x007c, 0xa18e, 0x0047, 0x00c0, 0x777a, 0xa016,
+	0x1078, 0x15fa, 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8,
+	0x1332, 0x1079, 0x7785, 0x067f, 0x007c, 0x7795, 0x7b00, 0x7cb2,
+	0x7795, 0x7d36, 0x77cf, 0x7795, 0x7795, 0x7a92, 0x80f6, 0x7795,
+	0x7795, 0x7795, 0x7795, 0x7795, 0x7795, 0x1078, 0x1332, 0x067e,
+	0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1332, 0x1079, 0x77a1, 0x067f,
+	0x007c, 0x77b1, 0x87c3, 0x77b1, 0x77b1, 0x77b1, 0x77b1, 0x77b1,
+	0x77b1, 0x8766, 0x8951, 0x77b1, 0x87f3, 0x8879, 0x87f3, 0x8879,
+	0x77b1, 0x1078, 0x1332, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8,
+	0x1332, 0x1079, 0x77bd, 0x067f, 0x007c, 0x77cd, 0x813d, 0x820e,
+	0x8368, 0x84e4, 0x77cd, 0x77cd, 0x77cd, 0x8116, 0x870e, 0x8712,
+	0x77cd, 0x77cd, 0x77cd, 0x77cd, 0x8742, 0x1078, 0x1332, 0xa1b6,
+	0x0015, 0x00c0, 0x77d7, 0x1078, 0x772d, 0x0078, 0x77dd, 0xa1b6,
+	0x0016, 0x10c0, 0x1332, 0x1078, 0x772d, 0x007c, 0x20a9, 0x000e,
+	0x2e98, 0x6010, 0x20a0, 0x53a3, 0x20a9, 0x0006, 0x3310, 0x3420,
+	0x9398, 0x94a0, 0x3318, 0x3428, 0x222e, 0x2326, 0xa290, 0x0002,
+	0xa5a8, 0x0002, 0xa398, 0x0002, 0xa4a0, 0x0002, 0x00f0, 0x77ec,
+	0x0e7e, 0x1078, 0x8d06, 0x0040, 0x7803, 0x6010, 0x2070, 0x7007,
+	0x0000, 0x7037, 0x0103, 0x0e7f, 0x1078, 0x772d, 0x007c, 0x0d7e,
+	0x037e, 0x7330, 0xa386, 0x0200, 0x00c0, 0x7814, 0x6018, 0x2068,
+	0x6813, 0x00ff, 0x6817, 0xfffd, 0x6010, 0xa005, 0x0040, 0x781e,
+	0x2068, 0x6807, 0x0000, 0x6837, 0x0103, 0x6b32, 0x1078, 0x772d,
+	0x037f, 0x0d7f, 0x007c, 0x017e, 0x20a9, 0x002a, 0xae80, 0x000c,
+	0x2098, 0x6010, 0xa080, 0x0002, 0x20a0, 0x53a3, 0x20a9, 0x002a,
+	0x6010, 0xa080, 0x0001, 0x2004, 0xa080, 0x0002, 0x20a0, 0x53a3,
+	0x0e7e, 0x6010, 0x2004, 0x2070, 0x7037, 0x0103, 0x0e7f, 0x1078,
+	0x772d, 0x017f, 0x007c, 0x0e7e, 0x0d7e, 0x603f, 0x0000, 0x2c68,
+	0x017e, 0x2009, 0x0035, 0x1078, 0x91bc, 0x017f, 0x00c0, 0x785f,
+	0x027e, 0x6228, 0x2268, 0x027f, 0x2071, 0xab8c, 0x6b1c, 0xa386,
+	0x0003, 0x0040, 0x7863, 0xa386, 0x0006, 0x0040, 0x7867, 0x1078,
+	0x772d, 0x0078, 0x7869, 0x1078, 0x786c, 0x0078, 0x7869, 0x1078,
+	0x7938, 0x0d7f, 0x0e7f, 0x007c, 0x0f7e, 0x6810, 0x2078, 0xa186,
+	0x0015, 0x0040, 0x791d, 0xa18e, 0x0016, 0x00c0, 0x7936, 0x700c,
+	0xa08c, 0xff00, 0xa186, 0x1700, 0x0040, 0x7882, 0xa186, 0x0300,
+	0x00c0, 0x78f8, 0x8fff, 0x00c0, 0x788c, 0x6800, 0xa086, 0x000f,
+	0x0040, 0x78db, 0x0078, 0x7934, 0x6808, 0xa086, 0xffff, 0x00c0,
+	0x7921, 0x784c, 0xa084, 0x0060, 0xa086, 0x0020, 0x00c0, 0x78a2,
+	0x797c, 0x7810, 0xa106, 0x00c0, 0x7921, 0x7980, 0x7814, 0xa106,
+	0x00c0, 0x7921, 0x1078, 0x8eb9, 0x6830, 0x7852, 0x784c, 0xc0dc,
+	0xc0f4, 0xc0d4, 0x784e, 0x027e, 0xa00e, 0x6a14, 0x2001, 0x000a,
+	0x1078, 0x5c1c, 0x7854, 0xa20a, 0x0048, 0x78b7, 0x8011, 0x7a56,
+	0x82ff, 0x027f, 0x00c0, 0x78c3, 0x0c7e, 0x2d60, 0x1078, 0x8ae0,
+	0x0c7f, 0x0078, 0x7934, 0x0c7e, 0x0d7e, 0x2f68, 0x6838, 0xd0fc,
+	0x00c0, 0x78ce, 0x1078, 0x4353, 0x0078, 0x78d0, 0x1078, 0x4431,
+	0x0d7f, 0x0c7f, 0x00c0, 0x7921, 0x0c7e, 0x2d60, 0x1078, 0x772d,
+	0x0c7f, 0x0078, 0x7934, 0x0c7e, 0x1078, 0x9187, 0x0040, 0x78f1,
+	0x6013, 0x0000, 0x6818, 0x601a, 0x601f, 0x0003, 0x6904, 0x0c7e,
+	0x2d60, 0x1078, 0x772d, 0x0c7f, 0x1078, 0x775c, 0x0c7f, 0x0078,
+	0x7934, 0x2001, 0xa8a4, 0x2004, 0x683e, 0x0c7f, 0x0078, 0x7934,
+	0x7008, 0xa086, 0x000b, 0x00c0, 0x7912, 0x6018, 0x200c, 0xc1bc,
+	0x2102, 0x0c7e, 0x2d60, 0x7853, 0x0003, 0x6007, 0x0085, 0x6003,
+	0x000b, 0x601f, 0x0002, 0x1078, 0x5d8a, 0x1078, 0x62d1, 0x0c7f,
+	0x0078, 0x7934, 0x700c, 0xa086, 0x2a00, 0x00c0, 0x7921, 0x2001,
+	0xa8a4, 0x2004, 0x683e, 0x0078, 0x7934, 0x1078, 0x7953, 0x0078,
+	0x7936, 0x8fff, 0x1040, 0x1332, 0x0c7e, 0x0d7e, 0x2d60, 0x2f68,
+	0x6837, 0x0103, 0x684b, 0x0003, 0x1078, 0x89cf, 0x1078, 0x8eb9,
+	0x1078, 0x8ec6, 0x0d7f, 0x0c7f, 0x1078, 0x772d, 0x0f7f, 0x007c,
+	0xa186, 0x0015, 0x00c0, 0x7942, 0x2001, 0xa8a4, 0x2004, 0x683e,
+	0x0078, 0x7950, 0xa18e, 0x0016, 0x00c0, 0x7952, 0x0c7e, 0x2d00,
+	0x2060, 0x1078, 0xa495, 0x1078, 0x5bc1, 0x1078, 0x772d, 0x0c7f,
+	0x1078, 0x772d, 0x007c, 0x027e, 0x037e, 0x047e, 0x7228, 0x7c80,
+	0x7b7c, 0xd2f4, 0x0040, 0x7962, 0x2001, 0xa8a4, 0x2004, 0x683e,
+	0x0078, 0x79c6, 0x0c7e, 0x2d60, 0x1078, 0x89f3, 0x0c7f, 0x6804,
+	0xa086, 0x0050, 0x00c0, 0x797a, 0x0c7e, 0x2d00, 0x2060, 0x6003,
+	0x0001, 0x6007, 0x0050, 0x1078, 0x5d8a, 0x1078, 0x62d1, 0x0c7f,
+	0x0078, 0x79c6, 0x6800, 0xa086, 0x000f, 0x0040, 0x799c, 0x8fff,
+	0x1040, 0x1332, 0x6824, 0xd0dc, 0x00c0, 0x799c, 0x6800, 0xa086,
+	0x0004, 0x00c0, 0x79a1, 0x784c, 0xd0ac, 0x0040, 0x79a1, 0x784c,
+	0xc0dc, 0xc0f4, 0x784e, 0x7850, 0xc0f4, 0xc0fc, 0x7852, 0x2001,
+	0x0001, 0x682e, 0x0078, 0x79c0, 0x2001, 0x0007, 0x682e, 0x0078,
+	0x79c0, 0x784c, 0xd0b4, 0x00c0, 0x79ae, 0xd0ac, 0x0040, 0x799c,
+	0x784c, 0xd0f4, 0x00c0, 0x799c, 0x0078, 0x798f, 0xd2ec, 0x00c0,
+	0x799c, 0x7024, 0xa306, 0x00c0, 0x79b9, 0x7020, 0xa406, 0x0040,
+	0x799c, 0x7020, 0x6836, 0x7024, 0x683a, 0x2001, 0x0005, 0x682e,
+	0x1078, 0x8ff0, 0x1078, 0x62d1, 0x0078, 0x79c8, 0x1078, 0x772d,
+	0x047f, 0x037f, 0x027f, 0x007c, 0x0e7e, 0x0d7e, 0x027e, 0x6034,
+	0x2068, 0x6a1c, 0xa286, 0x0007, 0x0040, 0x7a35, 0xa286, 0x0002,
+	0x0040, 0x7a35, 0xa286, 0x0000, 0x0040, 0x7a35, 0x6808, 0x6338,
+	0xa306, 0x00c0, 0x7a35, 0x2071, 0xab8c, 0xa186, 0x0015, 0x0040,
+	0x7a2f, 0xa18e, 0x0016, 0x00c0, 0x7a02, 0x6030, 0xa084, 0x00ff,
+	0xa086, 0x0001, 0x00c0, 0x7a02, 0x700c, 0xa086, 0x2a00, 0x00c0,
+	0x7a02, 0x6034, 0xa080, 0x0009, 0x200c, 0xc1dd, 0xc1f5, 0x2102,
+	0x0078, 0x7a2f, 0x0c7e, 0x6034, 0x2060, 0x6104, 0xa186, 0x004b,
+	0x0040, 0x7a22, 0xa186, 0x004c, 0x0040, 0x7a22, 0xa186, 0x004d,
+	0x0040, 0x7a22, 0xa186, 0x004e, 0x0040, 0x7a22, 0xa186, 0x0052,
+	0x0040, 0x7a22, 0x6010, 0x2068, 0x1078, 0x8d06, 0x1040, 0x1332,
+	0x6853, 0x0003, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002,
+	0x1078, 0x5d8a, 0x1078, 0x62d1, 0x0c7f, 0x0078, 0x7a35, 0x6034,
+	0x2068, 0x2001, 0xa8a4, 0x2004, 0x683e, 0x1078, 0x772d, 0x027f,
+	0x0d7f, 0x0e7f, 0x007c, 0x0d7e, 0x20a9, 0x000e, 0x2e98, 0x6010,
+	0x20a0, 0x53a3, 0xa1b6, 0x0015, 0x00c0, 0x7a73, 0x6018, 0x2068,
+	0x157e, 0x037e, 0x027e, 0xae90, 0x000c, 0xa290, 0x0004, 0x20a9,
+	0x0004, 0xad98, 0x000a, 0x1078, 0x80de, 0x027f, 0x037f, 0x157f,
+	0x00c0, 0x7a76, 0x157e, 0x037e, 0x027e, 0xae90, 0x000c, 0xa290,
+	0x0008, 0x20a9, 0x0004, 0xad98, 0x0006, 0x1078, 0x80de, 0x027f,
+	0x037f, 0x157f, 0x00c0, 0x7a76, 0x7038, 0x680a, 0x703c, 0x680e,
+	0x6800, 0xc08d, 0x6802, 0x0d7f, 0x0078, 0x77f8, 0x1078, 0x2880,
+	0x0c7e, 0x1078, 0x76c7, 0x2f00, 0x601a, 0x6013, 0x0000, 0x601f,
+	0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x2001, 0x0007, 0x1078,
+	0x4502, 0x1078, 0x4535, 0x1078, 0x5dd7, 0x1078, 0x62d1, 0x0c7f,
+	0x0078, 0x7a73, 0x2100, 0xa1b2, 0x0044, 0x10c8, 0x1332, 0xa1b2,
+	0x0040, 0x00c8, 0x7af7, 0x0079, 0x7a9d, 0x7aeb, 0x7adf, 0x7aeb,
+	0x7aeb, 0x7aeb, 0x7aeb, 0x7add, 0x7add, 0x7add, 0x7add, 0x7add,
+	0x7add, 0x7add, 0x7add, 0x7add, 0x7add, 0x7add, 0x7add, 0x7add,
+	0x7add, 0x7add, 0x7add, 0x7add, 0x7add, 0x7add, 0x7add, 0x7add,
+	0x7add, 0x7add, 0x7add, 0x7add, 0x7aeb, 0x7add, 0x7aeb, 0x7aeb,
+	0x7add, 0x7add, 0x7add, 0x7add, 0x7add, 0x7aeb, 0x7add, 0x7add,
+	0x7add, 0x7add, 0x7add, 0x7add, 0x7add, 0x7add, 0x7add, 0x7aeb,
+	0x7aeb, 0x7add, 0x7add, 0x7add, 0x7add, 0x7add, 0x7add, 0x7add,
+	0x7add, 0x7add, 0x7aeb, 0x7add, 0x7add, 0x1078, 0x1332, 0x6003,
+	0x0001, 0x6106, 0x1078, 0x5dd7, 0x127e, 0x2091, 0x8000, 0x1078,
+	0x62d1, 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078, 0x5dd7,
+	0x127e, 0x2091, 0x8000, 0x1078, 0x62d1, 0x127f, 0x007c, 0x2600,
+	0x0079, 0x7afa, 0x7afe, 0x7afe, 0x7afe, 0x7aeb, 0x1078, 0x1332,
+	0x6004, 0xa0b2, 0x0044, 0x10c8, 0x1332, 0xa1b6, 0x0013, 0x00c0,
+	0x7b10, 0xa0b2, 0x0040, 0x00c8, 0x7c79, 0x2008, 0x0079, 0x7bbf,
+	0xa1b6, 0x0027, 0x00c0, 0x7b7c, 0x1078, 0x61cd, 0x6004, 0x1078,
+	0x8eec, 0x0040, 0x7b2d, 0x1078, 0x8f00, 0x0040, 0x7b74, 0xa08e,
+	0x0021, 0x0040, 0x7b78, 0xa08e, 0x0022, 0x0040, 0x7b74, 0xa08e,
+	0x003d, 0x0040, 0x7b78, 0x0078, 0x7b6f, 0x1078, 0x28a6, 0x2001,
+	0x0007, 0x1078, 0x4502, 0x6018, 0xa080, 0x0028, 0x200c, 0x1078,
+	0x7c83, 0xa186, 0x007e, 0x00c0, 0x7b42, 0x2001, 0xa633, 0x2014,
+	0xc285, 0x2202, 0x017e, 0x027e, 0x037e, 0x2110, 0x027e, 0x2019,
+	0x0028, 0x1078, 0x73d0, 0x027f, 0x1078, 0xa4f1, 0x037f, 0x027f,
+	0x017f, 0x017e, 0x027e, 0x037e, 0x2110, 0x2019, 0x0028, 0x1078,
+	0x5f01, 0x077e, 0x2039, 0x0000, 0x1078, 0x5e0a, 0x0c7e, 0x6018,
+	0xa065, 0x0040, 0x7b65, 0x1078, 0x47e9, 0x0c7f, 0x2c08, 0x1078,
+	0x9f8b, 0x077f, 0x037f, 0x027f, 0x017f, 0x1078, 0x457f, 0x1078,
+	0x772d, 0x1078, 0x62d1, 0x007c, 0x1078, 0x7c83, 0x0078, 0x7b6f,
+	0x1078, 0x7ca6, 0x0078, 0x7b6f, 0xa186, 0x0014, 0x00c0, 0x7b73,
+	0x1078, 0x61cd, 0x1078, 0x2880, 0x1078, 0x8eec, 0x00c0, 0x7b9b,
+	0x1078, 0x28a6, 0x6018, 0xa080, 0x0028, 0x200c, 0x1078, 0x7c83,
+	0xa186, 0x007e, 0x00c0, 0x7b99, 0x2001, 0xa633, 0x200c, 0xc185,
+	0x2102, 0x0078, 0x7b6f, 0x1078, 0x8f00, 0x00c0, 0x7ba3, 0x1078,
+	0x7c83, 0x0078, 0x7b6f, 0x6004, 0xa08e, 0x0032, 0x00c0, 0x7bb4,
+	0x0e7e, 0x0f7e, 0x2071, 0xa682, 0x2079, 0x0000, 0x1078, 0x2bd7,
+	0x0f7f, 0x0e7f, 0x0078, 0x7b6f, 0x6004, 0xa08e, 0x0021, 0x0040,
+	0x7b9f, 0xa08e, 0x0022, 0x1040, 0x7c83, 0x0078, 0x7b6f, 0x7c01,
+	0x7c03, 0x7c07, 0x7c0b, 0x7c0f, 0x7c13, 0x7bff, 0x7bff, 0x7bff,
+	0x7bff, 0x7bff, 0x7bff, 0x7bff, 0x7bff, 0x7bff, 0x7bff, 0x7bff,
+	0x7bff, 0x7bff, 0x7bff, 0x7bff, 0x7bff, 0x7bff, 0x7bff, 0x7bff,
+	0x7bff, 0x7bff, 0x7bff, 0x7bff, 0x7bff, 0x7c17, 0x7c29, 0x7bff,
+	0x7c2b, 0x7c29, 0x7bff, 0x7bff, 0x7bff, 0x7bff, 0x7bff, 0x7c29,
+	0x7c29, 0x7bff, 0x7bff, 0x7bff, 0x7bff, 0x7bff, 0x7bff, 0x7bff,
+	0x7bff, 0x7c5c, 0x7c29, 0x7bff, 0x7c23, 0x7bff, 0x7bff, 0x7bff,
+	0x7c25, 0x7bff, 0x7bff, 0x7bff, 0x7c29, 0x7bff, 0x7bff, 0x1078,
+	0x1332, 0x0078, 0x7c29, 0x2001, 0x000b, 0x0078, 0x7c36, 0x2001,
+	0x0003, 0x0078, 0x7c36, 0x2001, 0x0005, 0x0078, 0x7c36, 0x2001,
+	0x0001, 0x0078, 0x7c36, 0x2001, 0x0009, 0x0078, 0x7c36, 0x1078,
+	0x61cd, 0x6003, 0x0005, 0x2001, 0xa8a4, 0x2004, 0x603e, 0x1078,
+	0x62d1, 0x0078, 0x7c35, 0x0078, 0x7c29, 0x0078, 0x7c29, 0x1078,
+	0x4502, 0x0078, 0x7c6e, 0x1078, 0x61cd, 0x6003, 0x0004, 0x2001,
+	0xa8a2, 0x2004, 0x6016, 0x1078, 0x62d1, 0x007c, 0x1078, 0x4502,
+	0x1078, 0x61cd, 0x2001, 0xa8a4, 0x2004, 0x603e, 0x6003, 0x0002,
+	0x037e, 0x2019, 0xa65d, 0x2304, 0xa084, 0xff00, 0x00c0, 0x7c4d,
+	0x2019, 0xa8a2, 0x231c, 0x0078, 0x7c56, 0x8007, 0xa09a, 0x0004,
+	0x0048, 0x7c48, 0x8003, 0x801b, 0x831b, 0xa318, 0x6316, 0x037f,
+	0x1078, 0x62d1, 0x0078, 0x7c35, 0x0e7e, 0x0f7e, 0x2071, 0xa682,
+	0x2079, 0x0000, 0x1078, 0x2bd7, 0x0f7f, 0x0e7f, 0x1078, 0x61cd,
+	0x1078, 0x772d, 0x1078, 0x62d1, 0x0078, 0x7c35, 0x1078, 0x61cd,
+	0x6003, 0x0002, 0x2001, 0xa8a2, 0x2004, 0x6016, 0x1078, 0x62d1,
+	0x007c, 0x2600, 0x2008, 0x0079, 0x7c7d, 0x7c81, 0x7c81, 0x7c81,
+	0x7c6e, 0x1078, 0x1332, 0x0e7e, 0x1078, 0x8d06, 0x0040, 0x7c9f,
+	0x6010, 0x2070, 0x7038, 0xd0fc, 0x0040, 0x7c9f, 0x7007, 0x0000,
+	0x017e, 0x6004, 0xa08e, 0x0021, 0x0040, 0x7ca1, 0xa08e, 0x003d,
+	0x0040, 0x7ca1, 0x017f, 0x7037, 0x0103, 0x7033, 0x0100, 0x0e7f,
+	0x007c, 0x017f, 0x1078, 0x7ca6, 0x0078, 0x7c9f, 0x0e7e, 0xacf0,
+	0x0004, 0x2e74, 0x7000, 0x2070, 0x7037, 0x0103, 0x7023, 0x8001,
+	0x0e7f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084, 0x00ff,
+	0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x1332, 0x6604, 0xa6b6, 0x0043,
+	0x00c0, 0x7cc6, 0x1078, 0x9134, 0x0078, 0x7d25, 0x6604, 0xa6b6,
+	0x0033, 0x00c0, 0x7ccf, 0x1078, 0x90d8, 0x0078, 0x7d25, 0x6604,
+	0xa6b6, 0x0028, 0x00c0, 0x7cd8, 0x1078, 0x8f2f, 0x0078, 0x7d25,
+	0x6604, 0xa6b6, 0x0029, 0x00c0, 0x7ce1, 0x1078, 0x8f49, 0x0078,
+	0x7d25, 0x6604, 0xa6b6, 0x001f, 0x00c0, 0x7cea, 0x1078, 0x77de,
+	0x0078, 0x7d25, 0x6604, 0xa6b6, 0x0000, 0x00c0, 0x7cf3, 0x1078,
+	0x7a3b, 0x0078, 0x7d25, 0x6604, 0xa6b6, 0x0022, 0x00c0, 0x7cfc,
+	0x1078, 0x7807, 0x0078, 0x7d25, 0x6604, 0xa6b6, 0x0035, 0x00c0,
+	0x7d05, 0x1078, 0x7843, 0x0078, 0x7d25, 0x6604, 0xa6b6, 0x0039,
+	0x00c0, 0x7d0e, 0x1078, 0x79cc, 0x0078, 0x7d25, 0x6604, 0xa6b6,
+	0x003d, 0x00c0, 0x7d17, 0x1078, 0x7823, 0x0078, 0x7d25, 0xa1b6,
+	0x0015, 0x00c0, 0x7d1f, 0x1079, 0x7d2a, 0x0078, 0x7d25, 0xa1b6,
+	0x0016, 0x00c0, 0x7d26, 0x1079, 0x7e7f, 0x007c, 0x1078, 0x7773,
+	0x0078, 0x7d25, 0x7d4e, 0x7d51, 0x7d4e, 0x7d9c, 0x7d4e, 0x7e13,
+	0x7e8b, 0x7d4e, 0x7d4e, 0x7e57, 0x7d4e, 0x7e6d, 0xa1b6, 0x0048,
+	0x0040, 0x7d42, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078,
+	0x15fa, 0x007c, 0x0e7e, 0xacf0, 0x0004, 0x2e74, 0x7000, 0x2070,
+	0x7037, 0x0103, 0x0e7f, 0x1078, 0x772d, 0x007c, 0x0005, 0x0005,
+	0x007c, 0x0e7e, 0x2071, 0xa600, 0x7080, 0xa086, 0x0074, 0x00c0,
+	0x7d85, 0x1078, 0x9f5f, 0x00c0, 0x7d77, 0x0d7e, 0x6018, 0x2068,
+	0x7030, 0xd08c, 0x0040, 0x7d6a, 0x6800, 0xd0bc, 0x0040, 0x7d6a,
+	0xc0c5, 0x6802, 0x1078, 0x7d89, 0x0d7f, 0x2001, 0x0006, 0x1078,
+	0x4502, 0x1078, 0x28a6, 0x1078, 0x772d, 0x0078, 0x7d87, 0x2001,
+	0x000a, 0x1078, 0x4502, 0x1078, 0x28a6, 0x6003, 0x0001, 0x6007,
+	0x0001, 0x1078, 0x5dd7, 0x0078, 0x7d87, 0x1078, 0x7dff, 0x0e7f,
+	0x007c, 0x6800, 0xd084, 0x0040, 0x7d9b, 0x2001, 0x0000, 0x1078,
+	0x44ee, 0x2069, 0xa652, 0x6804, 0xd0a4, 0x0040, 0x7d9b, 0x2001,
+	0x0006, 0x1078, 0x4535, 0x007c, 0x0d7e, 0x2011, 0xa620, 0x2204,
+	0xa086, 0x0074, 0x00c0, 0x7dfb, 0x6018, 0x2068, 0x6aa0, 0xa286,
+	0x007e, 0x00c0, 0x7daf, 0x1078, 0x7f9b, 0x0078, 0x7dfd, 0x1078,
+	0x7f91, 0x6018, 0x2068, 0xa080, 0x0028, 0x2014, 0xa286, 0x0080,
+	0x00c0, 0x7dd3, 0x6813, 0x00ff, 0x6817, 0xfffc, 0x6010, 0xa005,
+	0x0040, 0x7dc9, 0x2068, 0x6807, 0x0000, 0x6837, 0x0103, 0x6833,
+	0x0200, 0x2001, 0x0006, 0x1078, 0x4502, 0x1078, 0x28a6, 0x1078,
+	0x772d, 0x0078, 0x7dfd, 0x0e7e, 0x2071, 0xa633, 0x2e04, 0xd09c,
+	0x0040, 0x7dee, 0x2071, 0xab80, 0x7108, 0x720c, 0xa18c, 0x00ff,
+	0x00c0, 0x7de6, 0xa284, 0xff00, 0x0040, 0x7dee, 0x6018, 0x2070,
+	0x70a0, 0xd0bc, 0x00c0, 0x7dee, 0x7112, 0x7216, 0x0e7f, 0x2001,
+	0x0004, 0x1078, 0x4502, 0x6003, 0x0001, 0x6007, 0x0003, 0x1078,
+	0x5dd7, 0x0078, 0x7dfd, 0x1078, 0x7dff, 0x0d7f, 0x007c, 0x2001,
+	0x0007, 0x1078, 0x4502, 0x2001, 0xa600, 0x2004, 0xa086, 0x0003,
+	0x00c0, 0x7e0e, 0x2001, 0x0007, 0x1078, 0x4535, 0x1078, 0x28a6,
+	0x1078, 0x772d, 0x007c, 0x0e7e, 0x2071, 0xa600, 0x7080, 0xa086,
+	0x0014, 0x00c0, 0x7e51, 0x7000, 0xa086, 0x0003, 0x00c0, 0x7e26,
+	0x6010, 0xa005, 0x00c0, 0x7e26, 0x1078, 0x3699, 0x0d7e, 0x6018,
+	0x2068, 0x1078, 0x4649, 0x1078, 0x7d89, 0x0d7f, 0x1078, 0x8043,
+	0x00c0, 0x7e51, 0x0d7e, 0x6018, 0x2068, 0x6890, 0x0d7f, 0xa005,
+	0x0040, 0x7e51, 0x2001, 0x0006, 0x1078, 0x4502, 0x0e7e, 0x6010,
+	0xa005, 0x0040, 0x7e4a, 0x2070, 0x7007, 0x0000, 0x7037, 0x0103,
+	0x7033, 0x0200, 0x0e7f, 0x1078, 0x28a6, 0x1078, 0x772d, 0x0078,
+	0x7e55, 0x1078, 0x7c83, 0x1078, 0x7dff, 0x0e7f, 0x007c, 0x2011,
+	0xa620, 0x2204, 0xa086, 0x0014, 0x00c0, 0x7e6a, 0x2001, 0x0002,
+	0x1078, 0x4502, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x5dd7,
+	0x0078, 0x7e6c, 0x1078, 0x7dff, 0x007c, 0x2011, 0xa620, 0x2204,
+	0xa086, 0x0004, 0x00c0, 0x7e7c, 0x2001, 0x0007, 0x1078, 0x4502,
+	0x1078, 0x772d, 0x0078, 0x7e7e, 0x1078, 0x7dff, 0x007c, 0x7d4e,
+	0x7e97, 0x7d4e, 0x7ed2, 0x7d4e, 0x7f44, 0x7e8b, 0x7d4e, 0x7d4e,
+	0x7f59, 0x7d4e, 0x7f6c, 0x6604, 0xa686, 0x0003, 0x0040, 0x7e13,
+	0xa6b6, 0x001e, 0x00c0, 0x7e96, 0x1078, 0x772d, 0x007c, 0x0d7e,
+	0x0c7e, 0x1078, 0x7f7f, 0x00c0, 0x7ead, 0x2001, 0x0000, 0x1078,
+	0x44ee, 0x2001, 0x0002, 0x1078, 0x4502, 0x6003, 0x0001, 0x6007,
+	0x0002, 0x1078, 0x5dd7, 0x0078, 0x7ecf, 0x2009, 0xab8e, 0x2104,
+	0xa086, 0x0009, 0x00c0, 0x7ec2, 0x6018, 0x2068, 0x6840, 0xa084,
+	0x00ff, 0xa005, 0x0040, 0x7ecd, 0x8001, 0x6842, 0x6017, 0x000a,
+	0x0078, 0x7ecf, 0x2009, 0xab8f, 0x2104, 0xa084, 0xff00, 0xa086,
+	0x1900, 0x00c0, 0x7ecd, 0x0078, 0x7ea1, 0x1078, 0x7dff, 0x0c7f,
+	0x0d7f, 0x007c, 0x1078, 0x7f8e, 0x00c0, 0x7ee6, 0x2001, 0x0000,
+	0x1078, 0x44ee, 0x2001, 0x0002, 0x1078, 0x4502, 0x6003, 0x0001,
+	0x6007, 0x0002, 0x1078, 0x5dd7, 0x0078, 0x7f12, 0x1078, 0x7c83,
+	0x2009, 0xab8e, 0x2134, 0xa6b4, 0x00ff, 0xa686, 0x0005, 0x0040,
+	0x7f13, 0xa686, 0x000b, 0x0040, 0x7f10, 0x2009, 0xab8f, 0x2104,
+	0xa084, 0xff00, 0x00c0, 0x7f00, 0xa686, 0x0009, 0x0040, 0x7f13,
+	0xa086, 0x1900, 0x00c0, 0x7f10, 0xa686, 0x0009, 0x0040, 0x7f13,
+	0x2001, 0x0004, 0x1078, 0x4502, 0x1078, 0x772d, 0x0078, 0x7f12,
+	0x1078, 0x7dff, 0x007c, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x8d06,
+	0x0040, 0x7f21, 0x6838, 0xd0fc, 0x0040, 0x7f21, 0x0d7f, 0x0078,
+	0x7f10, 0x6018, 0x2068, 0x6840, 0xa084, 0x00ff, 0xa005, 0x0040,
+	0x7f32, 0x8001, 0x6842, 0x6017, 0x000a, 0x6007, 0x0016, 0x0d7f,
+	0x0078, 0x7f12, 0x68a0, 0xa086, 0x007e, 0x00c0, 0x7f3f, 0x0e7e,
+	0x2071, 0xa600, 0x1078, 0x42b8, 0x0e7f, 0x0078, 0x7f41, 0x1078,
+	0x2880, 0x0d7f, 0x0078, 0x7f10, 0x1078, 0x7f8e, 0x00c0, 0x7f54,
+	0x2001, 0x0004, 0x1078, 0x4502, 0x6003, 0x0001, 0x6007, 0x0003,
+	0x1078, 0x5dd7, 0x0078, 0x7f58, 0x1078, 0x7c83, 0x1078, 0x7dff,
+	0x007c, 0x1078, 0x7f8e, 0x00c0, 0x7f69, 0x2001, 0x0008, 0x1078,
+	0x4502, 0x6003, 0x0001, 0x6007, 0x0005, 0x1078, 0x5dd7, 0x0078,
+	0x7f6b, 0x1078, 0x7dff, 0x007c, 0x1078, 0x7f8e, 0x00c0, 0x7f7c,
+	0x2001, 0x000a, 0x1078, 0x4502, 0x6003, 0x0001, 0x6007, 0x0001,
+	0x1078, 0x5dd7, 0x0078, 0x7f7e, 0x1078, 0x7dff, 0x007c, 0x2009,
+	0xab8e, 0x2104, 0xa086, 0x0003, 0x00c0, 0x7f8d, 0x2009, 0xab8f,
+	0x2104, 0xa084, 0xff00, 0xa086, 0x2a00, 0x007c, 0xa085, 0x0001,
+	0x007c, 0x0c7e, 0x017e, 0xac88, 0x0006, 0x2164, 0x1078, 0x45d6,
+	0x017f, 0x0c7f, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, 0x037e, 0x017e,
+	0x6018, 0x2068, 0x2071, 0xa633, 0x2e04, 0xa085, 0x0003, 0x2072,
+	0x1078, 0x8014, 0x0040, 0x7fd9, 0x2009, 0xa633, 0x2104, 0xc0cd,
+	0x200a, 0x2001, 0xa653, 0x2004, 0xd0a4, 0x0040, 0x7fc2, 0xa006,
+	0x2020, 0x2009, 0x002a, 0x1078, 0xa21d, 0x2001, 0xa60c, 0x200c,
+	0xc195, 0x2102, 0x2019, 0x002a, 0x2009, 0x0001, 0x1078, 0x284f,
+	0x2071, 0xa600, 0x1078, 0x2677, 0x0c7e, 0x157e, 0x20a9, 0x0081,
+	0x2009, 0x007f, 0x1078, 0x298e, 0x8108, 0x00f0, 0x7fd2, 0x157f,
+	0x0c7f, 0x1078, 0x7f91, 0x6813, 0x00ff, 0x6817, 0xfffe, 0x2071,
+	0xab80, 0x2079, 0x0100, 0x2e04, 0xa084, 0x00ff, 0x2069, 0xa61b,
+	0x206a, 0x78e6, 0x007e, 0x8e70, 0x2e04, 0x2069, 0xa61c, 0x206a,
+	0x78ea, 0xa084, 0xff00, 0x017f, 0xa105, 0x2009, 0xa626, 0x200a,
+	0x2069, 0xab8e, 0x2071, 0xa89e, 0x6810, 0x2072, 0x6814, 0x7006,
+	0x6818, 0x700a, 0x681c, 0x700e, 0x1078, 0x906e, 0x2001, 0x0006,
+	0x1078, 0x4502, 0x1078, 0x28a6, 0x1078, 0x772d, 0x017f, 0x037f,
+	0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x027e, 0x037e, 0x0e7e, 0x157e,
+	0x2019, 0xa626, 0x231c, 0x83ff, 0x0040, 0x803e, 0x2071, 0xab80,
+	0x2e14, 0xa294, 0x00ff, 0x7004, 0xa084, 0xff00, 0xa205, 0xa306,
+	0x00c0, 0x803e, 0x2011, 0xab96, 0xad98, 0x000a, 0x20a9, 0x0004,
+	0x1078, 0x80de, 0x00c0, 0x803e, 0x2011, 0xab9a, 0xad98, 0x0006,
+	0x20a9, 0x0004, 0x1078, 0x80de, 0x00c0, 0x803e, 0x157f, 0x0e7f,
+	0x037f, 0x027f, 0x007c, 0x0e7e, 0x2071, 0xab8c, 0x7004, 0xa086,
+	0x0014, 0x00c0, 0x8066, 0x7008, 0xa086, 0x0800, 0x00c0, 0x8066,
+	0x700c, 0xd0ec, 0x0040, 0x8064, 0xa084, 0x0f00, 0xa086, 0x0100,
+	0x00c0, 0x8064, 0x7024, 0xd0a4, 0x00c0, 0x8061, 0xd0ac, 0x0040,
+	0x8064, 0xa006, 0x0078, 0x8066, 0xa085, 0x0001, 0x0e7f, 0x007c,
+	0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x057e, 0x047e, 0x027e, 0x007e,
+	0x127e, 0x2091, 0x8000, 0x2029, 0xa8ba, 0x252c, 0x2021, 0xa8c0,
+	0x2424, 0x2061, 0xad00, 0x2071, 0xa600, 0x7248, 0x7064, 0xa202,
+	0x00c8, 0x80cc, 0x1078, 0xa242, 0x0040, 0x80c4, 0x671c, 0xa786,
+	0x0001, 0x0040, 0x80c4, 0xa786, 0x0007, 0x0040, 0x80c4, 0x2500,
+	0xac06, 0x0040, 0x80c4, 0x2400, 0xac06, 0x0040, 0x80c4, 0x0c7e,
+	0x6000, 0xa086, 0x0004, 0x00c0, 0x809f, 0x1078, 0x1757, 0xa786,
+	0x0008, 0x00c0, 0x80ae, 0x1078, 0x8f00, 0x00c0, 0x80ae, 0x0c7f,
+	0x1078, 0x7c83, 0x1078, 0x8ec6, 0x0078, 0x80c4, 0x6010, 0x2068,
+	0x1078, 0x8d06, 0x0040, 0x80c1, 0xa786, 0x0003, 0x00c0, 0x80d6,
+	0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x4a73, 0x1078,
+	0x8eb9, 0x1078, 0x8ec6, 0x0c7f, 0xace0, 0x0010, 0x7058, 0xac02,
+	0x00c8, 0x80cc, 0x0078, 0x807d, 0x127f, 0x007f, 0x027f, 0x047f,
+	0x057f, 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0xa786, 0x0006,
+	0x00c0, 0x80b8, 0x1078, 0xa1ca, 0x0078, 0x80c1, 0x220c, 0x2304,
+	0xa106, 0x00c0, 0x80e9, 0x8210, 0x8318, 0x00f0, 0x80de, 0xa006,
+	0x007c, 0x2304, 0xa102, 0x0048, 0x80f1, 0x2001, 0x0001, 0x0078,
+	0x80f3, 0x2001, 0x0000, 0xa18d, 0x0001, 0x007c, 0x6004, 0xa08a,
+	0x0044, 0x10c8, 0x1332, 0x1078, 0x8eec, 0x0040, 0x8105, 0x1078,
+	0x8f00, 0x0040, 0x8112, 0x0078, 0x810b, 0x1078, 0x28a6, 0x1078,
+	0x8f00, 0x0040, 0x8112, 0x1078, 0x61cd, 0x1078, 0x772d, 0x1078,
+	0x62d1, 0x007c, 0x1078, 0x7c83, 0x0078, 0x810b, 0xa182, 0x0040,
+	0x0079, 0x811a, 0x812d, 0x812d, 0x812d, 0x812d, 0x812d, 0x812d,
+	0x812d, 0x812d, 0x812d, 0x812d, 0x812d, 0x812f, 0x812f, 0x812f,
+	0x812f, 0x812d, 0x812d, 0x812d, 0x812f, 0x1078, 0x1332, 0x600b,
+	0xffff, 0x6003, 0x0001, 0x6106, 0x1078, 0x5d8a, 0x127e, 0x2091,
+	0x8000, 0x1078, 0x62d1, 0x127f, 0x007c, 0xa186, 0x0013, 0x00c0,
+	0x8146, 0x6004, 0xa082, 0x0040, 0x0079, 0x81d1, 0xa186, 0x0027,
+	0x00c0, 0x8168, 0x1078, 0x61cd, 0x1078, 0x2880, 0x0d7e, 0x6110,
+	0x2168, 0x1078, 0x8d06, 0x0040, 0x8162, 0x6837, 0x0103, 0x684b,
+	0x0029, 0x6847, 0x0000, 0x694c, 0xc1c5, 0x694e, 0x1078, 0x4a73,
+	0x1078, 0x8eb9, 0x0d7f, 0x1078, 0x772d, 0x1078, 0x62d1, 0x007c,
+	0xa186, 0x0014, 0x00c0, 0x8171, 0x6004, 0xa082, 0x0040, 0x0079,
+	0x8199, 0xa186, 0x0046, 0x0040, 0x817d, 0xa186, 0x0045, 0x0040,
+	0x817d, 0xa186, 0x0047, 0x10c0, 0x1332, 0x2001, 0x0109, 0x2004,
+	0xd084, 0x0040, 0x8196, 0x127e, 0x2091, 0x2200, 0x007e, 0x017e,
+	0x027e, 0x1078, 0x5c56, 0x027f, 0x017f, 0x007f, 0x127f, 0x6000,
+	0xa086, 0x0002, 0x00c0, 0x8196, 0x0078, 0x820e, 0x1078, 0x7773,
+	0x007c, 0x81ae, 0x81ac, 0x81ac, 0x81ac, 0x81ac, 0x81ac, 0x81ac,
+	0x81ac, 0x81ac, 0x81ac, 0x81ac, 0x81ca, 0x81ca, 0x81ca, 0x81ca,
+	0x81ac, 0x81ca, 0x81ac, 0x81ca, 0x1078, 0x1332, 0x1078, 0x61cd,
+	0x0d7e, 0x6110, 0x2168, 0x1078, 0x8d06, 0x0040, 0x81c4, 0x6837,
+	0x0103, 0x684b, 0x0006, 0x6847, 0x0000, 0x6850, 0xc0ec, 0x6852,
+	0x1078, 0x4a73, 0x1078, 0x8eb9, 0x0d7f, 0x1078, 0x772d, 0x1078,
+	0x62d1, 0x007c, 0x1078, 0x61cd, 0x1078, 0x772d, 0x1078, 0x62d1,
+	0x007c, 0x81e6, 0x81e4, 0x81e4, 0x81e4, 0x81e4, 0x81e4, 0x81e4,
+	0x81e4, 0x81e4, 0x81e4, 0x81e4, 0x81f8, 0x81f8, 0x81f8, 0x81f8,
+	0x81e4, 0x8207, 0x81e4, 0x81f8, 0x1078, 0x1332, 0x1078, 0x61cd,
+	0x2001, 0xa8a4, 0x2004, 0x603e, 0x6003, 0x0002, 0x1078, 0x62d1,
+	0x6010, 0xa088, 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x007c,
+	0x1078, 0x61cd, 0x2001, 0xa8a2, 0x2004, 0x6016, 0x2001, 0xa8a4,
+	0x2004, 0x603e, 0x6003, 0x000f, 0x1078, 0x62d1, 0x007c, 0x1078,
+	0x61cd, 0x1078, 0x772d, 0x1078, 0x62d1, 0x007c, 0xa182, 0x0040,
+	0x0079, 0x8212, 0x8225, 0x8225, 0x8225, 0x8225, 0x8225, 0x8227,
+	0x8327, 0x8359, 0x8225, 0x8225, 0x8225, 0x8225, 0x8225, 0x8225,
+	0x8225, 0x8225, 0x8225, 0x8225, 0x8225, 0x1078, 0x1332, 0x0e7e,
+	0x0d7e, 0x603f, 0x0000, 0x2071, 0xab80, 0x7124, 0x610a, 0x2071,
+	0xab8c, 0x6110, 0x2168, 0x7614, 0xa6b4, 0x0fff, 0x86ff, 0x0040,
+	0x82e9, 0xa68c, 0x0c00, 0x0040, 0x825e, 0x0f7e, 0x2c78, 0x1078,
+	0x4963, 0x0f7f, 0x0040, 0x825a, 0x684c, 0xd0ac, 0x0040, 0x825a,
+	0x6024, 0xd0dc, 0x00c0, 0x825a, 0x6850, 0xd0bc, 0x00c0, 0x825a,
+	0x7318, 0x6814, 0xa306, 0x00c0, 0x8301, 0x731c, 0x6810, 0xa306,
+	0x00c0, 0x8301, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0xa68c, 0x00ff,
+	0xa186, 0x0002, 0x0040, 0x8291, 0xa186, 0x0028, 0x00c0, 0x826e,
+	0x1078, 0x8eda, 0x684b, 0x001c, 0x0078, 0x8293, 0xd6dc, 0x0040,
+	0x828a, 0x684b, 0x0015, 0x684c, 0xd0ac, 0x0040, 0x8288, 0x6914,
+	0x6a10, 0x2100, 0xa205, 0x0040, 0x8288, 0x7018, 0xa106, 0x00c0,
+	0x8285, 0x701c, 0xa206, 0x0040, 0x8288, 0x6962, 0x6a5e, 0xc6dc,
+	0x0078, 0x8293, 0xd6d4, 0x0040, 0x8291, 0x684b, 0x0007, 0x0078,
+	0x8293, 0x684b, 0x0000, 0x6837, 0x0103, 0x6e46, 0xa01e, 0xd6c4,
+	0x0040, 0x82bc, 0xa686, 0x0100, 0x00c0, 0x82a7, 0x2001, 0xab99,
+	0x2004, 0xa005, 0x00c0, 0x82a7, 0xc6c4, 0x0078, 0x8236, 0x7328,
+	0x732c, 0x6b56, 0x83ff, 0x0040, 0x82bc, 0xa38a, 0x0009, 0x0048,
+	0x82b3, 0x2019, 0x0008, 0x037e, 0x2308, 0x2019, 0xab98, 0xad90,
+	0x0019, 0x1078, 0x89e2, 0x037f, 0xd6cc, 0x0040, 0x8317, 0x7124,
+	0x695a, 0x81ff, 0x0040, 0x8317, 0xa192, 0x0021, 0x00c8, 0x82d5,
+	0x2071, 0xab98, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078,
+	0x89e2, 0x1078, 0x91f4, 0x0078, 0x8317, 0x6838, 0xd0fc, 0x0040,
+	0x82de, 0x2009, 0x0020, 0x695a, 0x0078, 0x82c8, 0x0f7e, 0x2d78,
+	0x1078, 0x897a, 0x0f7f, 0x1078, 0x91f4, 0x1078, 0x89cf, 0x0078,
+	0x8319, 0x0f7e, 0x2c78, 0x1078, 0x4963, 0x0f7f, 0x0040, 0x8307,
+	0x684c, 0xd0ac, 0x0040, 0x8307, 0x6024, 0xd0dc, 0x00c0, 0x8307,
+	0x6850, 0xd0bc, 0x00c0, 0x8307, 0x6810, 0x6914, 0xa105, 0x0040,
+	0x8307, 0x1078, 0x8fbf, 0x0d7f, 0x0e7f, 0x0078, 0x8326, 0x684b,
+	0x0000, 0x6837, 0x0103, 0x6e46, 0x684c, 0xd0ac, 0x0040, 0x8317,
+	0x6810, 0x6914, 0xa115, 0x0040, 0x8317, 0x1078, 0x84d5, 0x1078,
+	0x4a73, 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x1078, 0x8f89,
+	0x0d7f, 0x0e7f, 0x00c0, 0x8326, 0x1078, 0x772d, 0x007c, 0x0f7e,
+	0x6003, 0x0003, 0x2079, 0xab8c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08,
+	0x6010, 0x2078, 0x784c, 0xd0ac, 0x0040, 0x833e, 0x6003, 0x0002,
+	0x0f7f, 0x007c, 0x2130, 0x2228, 0x0078, 0x834a, 0x2400, 0x797c,
+	0xa10a, 0x2300, 0x7a80, 0xa213, 0x2600, 0xa102, 0x2500, 0xa203,
+	0x0048, 0x833a, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f, 0x603f,
+	0x0000, 0x2c10, 0x1078, 0x1cf0, 0x1078, 0x5df6, 0x1078, 0x639b,
+	0x007c, 0x2001, 0xa8a4, 0x2004, 0x603e, 0x6003, 0x0004, 0x6110,
+	0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x15fa, 0x007c,
+	0xa182, 0x0040, 0x0079, 0x836c, 0x837f, 0x837f, 0x837f, 0x837f,
+	0x837f, 0x8381, 0x8424, 0x837f, 0x837f, 0x843a, 0x84ab, 0x837f,
+	0x837f, 0x837f, 0x837f, 0x84ba, 0x837f, 0x837f, 0x837f, 0x1078,
+	0x1332, 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0xab8c, 0x6110,
+	0x2178, 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e,
+	0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x841f,
+	0xa694, 0xff00, 0xa284, 0x0c00, 0x0040, 0x83a2, 0x7018, 0x7862,
+	0x701c, 0x785e, 0xa284, 0x0300, 0x0040, 0x841f, 0x1078, 0x138b,
+	0x1040, 0x1332, 0x2d00, 0x784a, 0x7f4c, 0xc7cd, 0x7f4e, 0x6837,
+	0x0103, 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46,
+	0xa68c, 0x0c00, 0x0040, 0x83c0, 0x7318, 0x6b62, 0x731c, 0x6b5e,
+	0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x83dc, 0xa186, 0x0028,
+	0x00c0, 0x83ce, 0x684b, 0x001c, 0x0078, 0x83de, 0xd6dc, 0x0040,
+	0x83d5, 0x684b, 0x0015, 0x0078, 0x83de, 0xd6d4, 0x0040, 0x83dc,
+	0x684b, 0x0007, 0x0078, 0x83de, 0x684b, 0x0000, 0x6f4e, 0x7850,
+	0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x83fc, 0x7328,
+	0x732c, 0x6b56, 0x83ff, 0x0040, 0x83fc, 0xa38a, 0x0009, 0x0048,
+	0x83f3, 0x2019, 0x0008, 0x037e, 0x2308, 0x2019, 0xab98, 0xad90,
+	0x0019, 0x1078, 0x89e2, 0x037f, 0xd6cc, 0x0040, 0x841f, 0x7124,
+	0x695a, 0x81ff, 0x0040, 0x841f, 0xa192, 0x0021, 0x00c8, 0x8413,
+	0x2071, 0xab98, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078,
+	0x89e2, 0x0078, 0x841f, 0x7838, 0xd0fc, 0x0040, 0x841c, 0x2009,
+	0x0020, 0x695a, 0x0078, 0x8408, 0x2d78, 0x1078, 0x897a, 0x0d7f,
+	0x0e7f, 0x0f7f, 0x077f, 0x007c, 0x0f7e, 0x6003, 0x0003, 0x2079,
+	0xab8c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6010, 0x2078, 0x7c12,
+	0x7b16, 0x7e0a, 0x7d0e, 0x0f7f, 0x2c10, 0x1078, 0x1cf0, 0x1078,
+	0x6df4, 0x007c, 0x0d7e, 0x0f7e, 0x2c78, 0x1078, 0x4963, 0x0f7f,
+	0x0040, 0x8446, 0x2001, 0xa8a4, 0x2004, 0x603e, 0x6003, 0x0002,
+	0x1078, 0x627a, 0x1078, 0x639b, 0x6110, 0x2168, 0x694c, 0xd1e4,
+	0x0040, 0x84a9, 0xd1cc, 0x0040, 0x8480, 0x6948, 0x6838, 0xd0fc,
+	0x0040, 0x8478, 0x017e, 0x684c, 0x007e, 0x6850, 0x007e, 0xad90,
+	0x000d, 0xa198, 0x000d, 0x2009, 0x0020, 0x157e, 0x21a8, 0x2304,
+	0x2012, 0x8318, 0x8210, 0x00f0, 0x8467, 0x157f, 0x007f, 0x6852,
+	0x007f, 0x684e, 0x017f, 0x2168, 0x1078, 0x13b4, 0x0078, 0x84a3,
+	0x017e, 0x1078, 0x13b4, 0x0d7f, 0x1078, 0x89cf, 0x0078, 0x84a3,
+	0x6837, 0x0103, 0x6944, 0xa184, 0x00ff, 0xa0b6, 0x0002, 0x0040,
+	0x849f, 0xa086, 0x0028, 0x00c0, 0x8491, 0x684b, 0x001c, 0x0078,
+	0x84a1, 0xd1dc, 0x0040, 0x8498, 0x684b, 0x0015, 0x0078, 0x84a1,
+	0xd1d4, 0x0040, 0x849f, 0x684b, 0x0007, 0x0078, 0x84a1, 0x684b,
+	0x0000, 0x1078, 0x4a73, 0x1078, 0x8f89, 0x00c0, 0x84a9, 0x1078,
+	0x772d, 0x0d7f, 0x007c, 0x2019, 0x0001, 0x1078, 0x7058, 0x6003,
+	0x0002, 0x2001, 0xa8a4, 0x2004, 0x603e, 0x1078, 0x627a, 0x1078,
+	0x639b, 0x007c, 0x1078, 0x627a, 0x1078, 0x2880, 0x0d7e, 0x6110,
+	0x2168, 0x1078, 0x8d06, 0x0040, 0x84cf, 0x6837, 0x0103, 0x684b,
+	0x0029, 0x6847, 0x0000, 0x1078, 0x4a73, 0x1078, 0x8eb9, 0x0d7f,
+	0x1078, 0x772d, 0x1078, 0x639b, 0x007c, 0x684b, 0x0015, 0xd1fc,
+	0x0040, 0x84e1, 0x684b, 0x0007, 0x8002, 0x8000, 0x810a, 0xa189,
+	0x0000, 0x6962, 0x685e, 0x007c, 0xa182, 0x0040, 0x0079, 0x84e8,
+	0x84fb, 0x84fb, 0x84fb, 0x84fb, 0x84fb, 0x84fd, 0x84fb, 0x85d0,
+	0x85dc, 0x84fb, 0x84fb, 0x84fb, 0x84fb, 0x84fb, 0x84fb, 0x84fb,
+	0x84fb, 0x84fb, 0x84fb, 0x1078, 0x1332, 0x077e, 0x0f7e, 0x0e7e,
+	0x0d7e, 0x2071, 0xab8c, 0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff,
+	0x0f7e, 0x2c78, 0x1078, 0x4963, 0x0f7f, 0x0040, 0x851b, 0xa684,
+	0x00ff, 0x00c0, 0x851b, 0x6024, 0xd0f4, 0x0040, 0x851b, 0x1078,
+	0x8fbf, 0x0078, 0x85cb, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218,
+	0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x85c0, 0xa694,
+	0xff00, 0xa284, 0x0c00, 0x0040, 0x8531, 0x7018, 0x7862, 0x701c,
+	0x785e, 0xa284, 0x0300, 0x0040, 0x85bd, 0xa686, 0x0100, 0x00c0,
+	0x8543, 0x2001, 0xab99, 0x2004, 0xa005, 0x00c0, 0x8543, 0xc6c4,
+	0x7e46, 0x0078, 0x8524, 0x1078, 0x138b, 0x1040, 0x1332, 0x2d00,
+	0x784a, 0x7f4c, 0xa7bd, 0x0200, 0x7f4e, 0x6837, 0x0103, 0x7838,
+	0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c, 0x0c00,
+	0x0040, 0x855e, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0xa68c, 0x00ff,
+	0xa186, 0x0002, 0x0040, 0x857a, 0xa186, 0x0028, 0x00c0, 0x856c,
+	0x684b, 0x001c, 0x0078, 0x857c, 0xd6dc, 0x0040, 0x8573, 0x684b,
+	0x0015, 0x0078, 0x857c, 0xd6d4, 0x0040, 0x857a, 0x684b, 0x0007,
+	0x0078, 0x857c, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852, 0x7854,
+	0x6856, 0xa01e, 0xd6c4, 0x0040, 0x859a, 0x7328, 0x732c, 0x6b56,
+	0x83ff, 0x0040, 0x859a, 0xa38a, 0x0009, 0x0048, 0x8591, 0x2019,
+	0x0008, 0x037e, 0x2308, 0x2019, 0xab98, 0xad90, 0x0019, 0x1078,
+	0x89e2, 0x037f, 0xd6cc, 0x0040, 0x85bd, 0x7124, 0x695a, 0x81ff,
+	0x0040, 0x85bd, 0xa192, 0x0021, 0x00c8, 0x85b1, 0x2071, 0xab98,
+	0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x89e2, 0x0078,
+	0x85bd, 0x7838, 0xd0fc, 0x0040, 0x85ba, 0x2009, 0x0020, 0x695a,
+	0x0078, 0x85a6, 0x2d78, 0x1078, 0x897a, 0xd6dc, 0x00c0, 0x85c3,
+	0xa006, 0x0078, 0x85c9, 0x2001, 0x0001, 0x2071, 0xab8c, 0x7218,
+	0x731c, 0x1078, 0x1653, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c,
+	0x2001, 0xa8a4, 0x2004, 0x603e, 0x20e1, 0x0005, 0x3d18, 0x3e20,
+	0x2c10, 0x1078, 0x15fa, 0x007c, 0x2001, 0xa8a4, 0x2004, 0x603e,
+	0x0d7e, 0x6003, 0x0002, 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0040,
+	0x870c, 0x603f, 0x0000, 0x0f7e, 0x2c78, 0x1078, 0x4963, 0x0f7f,
+	0x0040, 0x8622, 0x6814, 0x6910, 0xa115, 0x0040, 0x8622, 0x6a60,
+	0xa206, 0x00c0, 0x85ff, 0x685c, 0xa106, 0x0040, 0x8622, 0x684c,
+	0xc0e4, 0x684e, 0x6847, 0x0000, 0x6863, 0x0000, 0x685f, 0x0000,
+	0x6024, 0xd0f4, 0x00c0, 0x8617, 0x697c, 0x6810, 0xa102, 0x603a,
+	0x6980, 0x6814, 0xa103, 0x6036, 0x6024, 0xc0f5, 0x6026, 0x0d7e,
+	0x6018, 0x2068, 0x683c, 0x8000, 0x683e, 0x0d7f, 0x1078, 0x8fbf,
+	0x0078, 0x870c, 0x694c, 0xd1cc, 0x0040, 0x86d1, 0x6948, 0x6838,
+	0xd0fc, 0x0040, 0x8689, 0x017e, 0x684c, 0x007e, 0x6850, 0x007e,
+	0x0f7e, 0x2178, 0x7944, 0xa184, 0x00ff, 0xa0b6, 0x0002, 0x0040,
+	0x865c, 0xa086, 0x0028, 0x00c0, 0x8643, 0x684b, 0x001c, 0x784b,
+	0x001c, 0x0078, 0x8667, 0xd1dc, 0x0040, 0x8653, 0x684b, 0x0015,
+	0x784b, 0x0015, 0x1078, 0x916c, 0x0040, 0x8651, 0x7944, 0xc1dc,
+	0x7946, 0x0078, 0x8667, 0xd1d4, 0x0040, 0x865c, 0x684b, 0x0007,
+	0x784b, 0x0007, 0x0078, 0x8667, 0x684c, 0xd0ac, 0x0040, 0x8667,
+	0x6810, 0x6914, 0xa115, 0x0040, 0x8667, 0x1078, 0x84d5, 0x6848,
+	0x784a, 0x6860, 0x7862, 0x685c, 0x785e, 0xad90, 0x000d, 0xaf98,
+	0x000d, 0x2009, 0x0020, 0x157e, 0x21a8, 0x2304, 0x2012, 0x8318,
+	0x8210, 0x00f0, 0x8675, 0x157f, 0x0f7f, 0x007f, 0x6852, 0x007f,
+	0x684e, 0x1078, 0x91f4, 0x017f, 0x2168, 0x1078, 0x13b4, 0x0078,
+	0x8706, 0x017e, 0x0f7e, 0x2178, 0x7944, 0xa184, 0x00ff, 0xa0b6,
+	0x0002, 0x0040, 0x86b6, 0xa086, 0x0028, 0x00c0, 0x869d, 0x684b,
+	0x001c, 0x784b, 0x001c, 0x0078, 0x86c1, 0xd1dc, 0x0040, 0x86ad,
+	0x684b, 0x0015, 0x784b, 0x0015, 0x1078, 0x916c, 0x0040, 0x86ab,
+	0x7944, 0xc1dc, 0x7946, 0x0078, 0x86c1, 0xd1d4, 0x0040, 0x86b6,
+	0x684b, 0x0007, 0x784b, 0x0007, 0x0078, 0x86c1, 0x684c, 0xd0ac,
+	0x0040, 0x86c1, 0x6810, 0x6914, 0xa115, 0x0040, 0x86c1, 0x1078,
+	0x84d5, 0x6860, 0x7862, 0x685c, 0x785e, 0x684c, 0x784e, 0x0f7f,
+	0x1078, 0x13b4, 0x0d7f, 0x1078, 0x91f4, 0x1078, 0x89cf, 0x0078,
+	0x8706, 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff, 0xa0b6, 0x0002,
+	0x0040, 0x86f7, 0xa086, 0x0028, 0x00c0, 0x86e2, 0x684b, 0x001c,
+	0x0078, 0x8704, 0xd1dc, 0x0040, 0x86f0, 0x684b, 0x0015, 0x1078,
+	0x916c, 0x0040, 0x86ee, 0x6944, 0xc1dc, 0x6946, 0x0078, 0x8704,
+	0xd1d4, 0x0040, 0x86f7, 0x684b, 0x0007, 0x0078, 0x8704, 0x684b,
+	0x0000, 0x684c, 0xd0ac, 0x0040, 0x8704, 0x6810, 0x6914, 0xa115,
+	0x0040, 0x8704, 0x1078, 0x84d5, 0x1078, 0x4a73, 0x1078, 0x8f89,
+	0x00c0, 0x870c, 0x1078, 0x772d, 0x0d7f, 0x007c, 0x1078, 0x61cd,
+	0x0078, 0x8714, 0x1078, 0x627a, 0x1078, 0x8d06, 0x0040, 0x8733,
+	0x0d7e, 0x6110, 0x2168, 0x6837, 0x0103, 0x2009, 0xa60c, 0x210c,
+	0xd18c, 0x00c0, 0x873e, 0xd184, 0x00c0, 0x873a, 0x6108, 0x694a,
+	0xa18e, 0x0029, 0x00c0, 0x872e, 0x1078, 0xa4e2, 0x6847, 0x0000,
+	0x1078, 0x4a73, 0x0d7f, 0x1078, 0x772d, 0x1078, 0x62d1, 0x1078,
+	0x639b, 0x007c, 0x684b, 0x0004, 0x0078, 0x872e, 0x684b, 0x0004,
+	0x0078, 0x872e, 0xa182, 0x0040, 0x0079, 0x8746, 0x8759, 0x8759,
+	0x8759, 0x8759, 0x8759, 0x875b, 0x8759, 0x875e, 0x8759, 0x8759,
+	0x8759, 0x8759, 0x8759, 0x8759, 0x8759, 0x8759, 0x8759, 0x8759,
+	0x8759, 0x1078, 0x1332, 0x1078, 0x772d, 0x007c, 0x007e, 0x027e,
+	0xa016, 0x1078, 0x15fa, 0x027f, 0x007f, 0x007c, 0xa182, 0x0085,
+	0x0079, 0x876a, 0x8773, 0x8771, 0x8771, 0x877f, 0x8771, 0x8771,
+	0x8771, 0x1078, 0x1332, 0x6003, 0x0001, 0x6106, 0x1078, 0x5d8a,
+	0x127e, 0x2091, 0x8000, 0x1078, 0x62d1, 0x127f, 0x007c, 0x027e,
+	0x057e, 0x0d7e, 0x0e7e, 0x2071, 0xab80, 0x7224, 0x6212, 0x7220,
+	0x1078, 0x8cf2, 0x0040, 0x87a4, 0x2268, 0x6800, 0xa086, 0x0000,
+	0x0040, 0x87a4, 0x6018, 0x6d18, 0xa52e, 0x00c0, 0x87a4, 0x0c7e,
+	0x2d60, 0x1078, 0x89f3, 0x0c7f, 0x0040, 0x87a4, 0x6803, 0x0002,
+	0x6007, 0x0086, 0x0078, 0x87a6, 0x6007, 0x0087, 0x6003, 0x0001,
+	0x1078, 0x5d8a, 0x1078, 0x62d1, 0x0f7e, 0x2278, 0x1078, 0x4963,
+	0x0f7f, 0x0040, 0x87be, 0x6824, 0xd0ec, 0x0040, 0x87be, 0x0c7e,
+	0x2260, 0x603f, 0x0000, 0x1078, 0x8fbf, 0x0c7f, 0x0e7f, 0x0d7f,
+	0x057f, 0x027f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x87d4, 0x6004,
+	0xa08a, 0x0085, 0x1048, 0x1332, 0xa08a, 0x008c, 0x10c8, 0x1332,
+	0xa082, 0x0085, 0x0079, 0x87e3, 0xa186, 0x0027, 0x0040, 0x87dc,
+	0xa186, 0x0014, 0x10c0, 0x1332, 0x1078, 0x61cd, 0x1078, 0x8ec6,
+	0x1078, 0x62d1, 0x007c, 0x87ea, 0x87ec, 0x87ec, 0x87ea, 0x87ea,
+	0x87ea, 0x87ea, 0x1078, 0x1332, 0x1078, 0x61cd, 0x1078, 0x8ec6,
+	0x1078, 0x62d1, 0x007c, 0xa186, 0x0013, 0x00c0, 0x87fd, 0x6004,
+	0xa082, 0x0085, 0x2008, 0x0078, 0x8838, 0xa186, 0x0027, 0x00c0,
+	0x8820, 0x1078, 0x61cd, 0x1078, 0x2880, 0x0d7e, 0x6010, 0x2068,
+	0x1078, 0x8d06, 0x0040, 0x8816, 0x6837, 0x0103, 0x6847, 0x0000,
+	0x684b, 0x0029, 0x1078, 0x4a73, 0x1078, 0x8eb9, 0x0d7f, 0x1078,
+	0x772d, 0x1078, 0x62d1, 0x007c, 0x1078, 0x7773, 0x0078, 0x881b,
+	0xa186, 0x0014, 0x00c0, 0x881c, 0x1078, 0x61cd, 0x0d7e, 0x6010,
+	0x2068, 0x1078, 0x8d06, 0x0040, 0x8816, 0x6837, 0x0103, 0x6847,
+	0x0000, 0x684b, 0x0006, 0x6850, 0xc0ec, 0x6852, 0x0078, 0x8812,
+	0x0079, 0x883a, 0x8843, 0x8841, 0x8841, 0x8841, 0x8841, 0x8841,
+	0x885e, 0x1078, 0x1332, 0x1078, 0x61cd, 0x6030, 0xa08c, 0xff00,
+	0x810f, 0xa186, 0x0039, 0x0040, 0x8851, 0xa186, 0x0035, 0x00c0,
+	0x8855, 0x2001, 0xa8a2, 0x0078, 0x8857, 0x2001, 0xa8a3, 0x2004,
+	0x6016, 0x6003, 0x000c, 0x1078, 0x62d1, 0x007c, 0x1078, 0x61cd,
+	0x6030, 0xa08c, 0xff00, 0x810f, 0xa186, 0x0039, 0x0040, 0x886c,
+	0xa186, 0x0035, 0x00c0, 0x8870, 0x2001, 0xa8a2, 0x0078, 0x8872,
+	0x2001, 0xa8a3, 0x2004, 0x6016, 0x6003, 0x000e, 0x1078, 0x62d1,
+	0x007c, 0xa182, 0x008c, 0x00c8, 0x8883, 0xa182, 0x0085, 0x0048,
+	0x8883, 0x0079, 0x8886, 0x1078, 0x7773, 0x007c, 0x888d, 0x888d,
+	0x888d, 0x888d, 0x888f, 0x88ec, 0x888d, 0x1078, 0x1332, 0x0f7e,
+	0x2c78, 0x1078, 0x4963, 0x0f7f, 0x0040, 0x88a2, 0x6030, 0xa08c,
+	0xff00, 0x810f, 0xa186, 0x0039, 0x0040, 0x8903, 0xa186, 0x0035,
+	0x0040, 0x8903, 0x0d7e, 0x1078, 0x8d06, 0x00c0, 0x88ab, 0x1078,
+	0x8eb9, 0x0078, 0x88ce, 0x6010, 0x2068, 0x684c, 0xd0e4, 0x00c0,
+	0x88b3, 0x1078, 0x8eb9, 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0040,
+	0x88bf, 0x684b, 0x0006, 0xc0ec, 0x6852, 0x0078, 0x88ca, 0xd0bc,
+	0x0040, 0x88c6, 0x684b, 0x0002, 0x0078, 0x88ca, 0x684b, 0x0005,
+	0x1078, 0x8f85, 0x6847, 0x0000, 0x1078, 0x4a73, 0x2c68, 0x1078,
+	0x76c7, 0x0040, 0x88e7, 0x6003, 0x0001, 0x6007, 0x001e, 0x2009,
+	0xab8e, 0x210c, 0x6136, 0x2009, 0xab8f, 0x210c, 0x613a, 0x6918,
+	0x611a, 0x6920, 0x6122, 0x601f, 0x0001, 0x1078, 0x5d8a, 0x2d60,
+	0x1078, 0x772d, 0x0d7f, 0x007c, 0x0f7e, 0x2c78, 0x1078, 0x4963,
+	0x0f7f, 0x0040, 0x8929, 0x6030, 0xa08c, 0xff00, 0x810f, 0xa186,
+	0x0035, 0x0040, 0x8903, 0xa186, 0x001e, 0x0040, 0x8903, 0xa186,
+	0x0039, 0x00c0, 0x8929, 0x0d7e, 0x2c68, 0x1078, 0x91bc, 0x00c0,
+	0x894d, 0x1078, 0x76c7, 0x0040, 0x8926, 0x6106, 0x6003, 0x0001,
+	0x601f, 0x0001, 0x6918, 0x611a, 0x6928, 0x612a, 0x692c, 0x612e,
+	0x6930, 0xa18c, 0x00ff, 0x6132, 0x6934, 0x6136, 0x6938, 0x613a,
+	0x6920, 0x6122, 0x1078, 0x5d8a, 0x1078, 0x62d1, 0x2d60, 0x0078,
+	0x894d, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x8d06, 0x0040, 0x894d,
+	0x6837, 0x0103, 0x6850, 0xd0b4, 0x0040, 0x893c, 0xc0ec, 0x6852,
+	0x684b, 0x0006, 0x0078, 0x8947, 0xd0bc, 0x0040, 0x8943, 0x684b,
+	0x0002, 0x0078, 0x8947, 0x684b, 0x0005, 0x1078, 0x8f85, 0x6847,
+	0x0000, 0x1078, 0x4a73, 0x1078, 0x8eb9, 0x0d7f, 0x1078, 0x772d,
+	0x007c, 0x017e, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x8d06, 0x0040,
+	0x8961, 0x6837, 0x0103, 0x684b, 0x0028, 0x6847, 0x0000, 0x1078,
+	0x4a73, 0x0d7f, 0x017f, 0xa186, 0x0013, 0x0040, 0x8973, 0xa186,
+	0x0014, 0x0040, 0x8973, 0xa186, 0x0027, 0x0040, 0x8973, 0x1078,
+	0x7773, 0x0078, 0x8979, 0x1078, 0x61cd, 0x1078, 0x8ec6, 0x1078,
+	0x62d1, 0x007c, 0x057e, 0x067e, 0x0d7e, 0x0f7e, 0x2029, 0x0001,
+	0xa182, 0x0101, 0x00c8, 0x8986, 0x0078, 0x8988, 0x2009, 0x0100,
+	0x2130, 0x2069, 0xab98, 0x831c, 0x2300, 0xad18, 0x2009, 0x0020,
+	0xaf90, 0x001d, 0x1078, 0x89e2, 0xa6b2, 0x0020, 0x7804, 0xa06d,
+	0x0040, 0x899c, 0x1078, 0x13b4, 0x1078, 0x138b, 0x0040, 0x89c6,
+	0x8528, 0x6837, 0x0110, 0x683b, 0x0000, 0x2d20, 0x7c06, 0xa68a,
+	0x003d, 0x00c8, 0x89b2, 0x2608, 0xad90, 0x000f, 0x1078, 0x89e2,
+	0x0078, 0x89c6, 0xa6b2, 0x003c, 0x2009, 0x003c, 0x2d78, 0xad90,
+	0x000f, 0x1078, 0x89e2, 0x0078, 0x899c, 0x0f7f, 0x852f, 0xa5ad,
+	0x0003, 0x7d36, 0xa5ac, 0x0000, 0x0078, 0x89cb, 0x0f7f, 0x852f,
+	0xa5ad, 0x0003, 0x7d36, 0x0d7f, 0x067f, 0x057f, 0x007c, 0x0f7e,
+	0x8dff, 0x0040, 0x89e0, 0x6804, 0xa07d, 0x0040, 0x89de, 0x6807,
+	0x0000, 0x1078, 0x4a73, 0x2f68, 0x0078, 0x89d3, 0x1078, 0x4a73,
+	0x0f7f, 0x007c, 0x157e, 0xa184, 0x0001, 0x0040, 0x89e8, 0x8108,
+	0x810c, 0x21a8, 0x2304, 0x8007, 0x2012, 0x8318, 0x8210, 0x00f0,
+	0x89ea, 0x157f, 0x007c, 0x067e, 0x127e, 0x2091, 0x8000, 0x2031,
+	0x0001, 0x601c, 0xa084, 0x000f, 0x1079, 0x8a0f, 0x127f, 0x067f,
+	0x007c, 0x127e, 0x2091, 0x8000, 0x067e, 0x2031, 0x0000, 0x601c,
+	0xa084, 0x000f, 0x1079, 0x8a0f, 0x067f, 0x127f, 0x007c, 0x8a29,
+	0x8a17, 0x8a24, 0x8a45, 0x8a17, 0x8a24, 0x8a45, 0x8a24, 0x1078,
+	0x1332, 0x037e, 0x2019, 0x0010, 0x1078, 0x9dc7, 0x601f, 0x0006,
+	0x6003, 0x0007, 0x037f, 0x007c, 0xa006, 0x007c, 0xa085, 0x0001,
+	0x007c, 0x0d7e, 0x86ff, 0x00c0, 0x8a40, 0x6010, 0x2068, 0x1078,
+	0x8d06, 0x0040, 0x8a42, 0xa00e, 0x2001, 0x0005, 0x1078, 0x4b51,
+	0x1078, 0x8f85, 0x1078, 0x4a73, 0x1078, 0x772d, 0xa085, 0x0001,
+	0x0d7f, 0x007c, 0xa006, 0x0078, 0x8a40, 0x6000, 0xa08a, 0x0010,
+	0x10c8, 0x1332, 0x1079, 0x8a4d, 0x007c, 0x8a5d, 0x8a82, 0x8a5f,
+	0x8aa5, 0x8a7e, 0x8a5d, 0x8a24, 0x8a29, 0x8a29, 0x8a24, 0x8a24,
+	0x8a24, 0x8a24, 0x8a24, 0x8a24, 0x8a24, 0x1078, 0x1332, 0x86ff,
+	0x00c0, 0x8a7b, 0x601c, 0xa086, 0x0006, 0x0040, 0x8a7b, 0x0d7e,
+	0x6010, 0x2068, 0x1078, 0x8d06, 0x0040, 0x8a70, 0x1078, 0x8f85,
+	0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x1078,
+	0x5d8a, 0x1078, 0x62d1, 0xa085, 0x0001, 0x007c, 0x1078, 0x1757,
+	0x0078, 0x8a5f, 0x0e7e, 0x2071, 0xa8b1, 0x7024, 0xac06, 0x00c0,
+	0x8a8b, 0x1078, 0x6fc4, 0x601c, 0xa084, 0x000f, 0xa086, 0x0006,
+	0x00c0, 0x8a9d, 0x087e, 0x097e, 0x2049, 0x0001, 0x2c40, 0x1078,
+	0x7246, 0x097f, 0x087f, 0x0078, 0x8a9f, 0x1078, 0x6ebe, 0x0e7f,
+	0x00c0, 0x8a5f, 0x1078, 0x8a24, 0x007c, 0x037e, 0x0e7e, 0x2071,
+	0xa8b1, 0x703c, 0xac06, 0x00c0, 0x8ab5, 0x2019, 0x0000, 0x1078,
+	0x7058, 0x0e7f, 0x037f, 0x0078, 0x8a5f, 0x1078, 0x738a, 0x0e7f,
+	0x037f, 0x00c0, 0x8a5f, 0x1078, 0x8a24, 0x007c, 0x0c7e, 0x601c,
+	0xa084, 0x000f, 0x1079, 0x8ac6, 0x0c7f, 0x007c, 0x8ad5, 0x8b47,
+	0x8c7f, 0x8ae0, 0x8ec6, 0x8ad5, 0x9db8, 0x772d, 0x8b47, 0x1078,
+	0x8f00, 0x00c0, 0x8ad5, 0x1078, 0x7c83, 0x007c, 0x1078, 0x61cd,
+	0x1078, 0x62d1, 0x1078, 0x772d, 0x007c, 0x6017, 0x0001, 0x007c,
+	0x1078, 0x8d06, 0x0040, 0x8ae8, 0x6010, 0xa080, 0x0019, 0x2c02,
+	0x6000, 0xa08a, 0x0010, 0x10c8, 0x1332, 0x1079, 0x8af0, 0x007c,
+	0x8b00, 0x8b02, 0x8b24, 0x8b36, 0x8b43, 0x8b00, 0x8ad5, 0x8ad5,
+	0x8ad5, 0x8b36, 0x8b36, 0x8b00, 0x8b00, 0x8b00, 0x8b00, 0x8b40,
+	0x1078, 0x1332, 0x0e7e, 0x6010, 0x2070, 0x7050, 0xc0b5, 0x7052,
+	0x2071, 0xa8b1, 0x7024, 0xac06, 0x0040, 0x8b20, 0x1078, 0x6ebe,
+	0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x2001, 0xa8a3,
+	0x2004, 0x6016, 0x1078, 0x5d8a, 0x1078, 0x62d1, 0x0e7f, 0x007c,
+	0x6017, 0x0001, 0x0078, 0x8b1e, 0x0d7e, 0x6010, 0x2068, 0x6850,
+	0xc0b5, 0x6852, 0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f,
+	0x0002, 0x1078, 0x5d8a, 0x1078, 0x62d1, 0x007c, 0x0d7e, 0x6017,
+	0x0001, 0x6010, 0x2068, 0x6850, 0xc0b5, 0x6852, 0x0d7f, 0x007c,
+	0x1078, 0x772d, 0x007c, 0x1078, 0x1757, 0x0078, 0x8b24, 0x6000,
+	0xa08a, 0x0010, 0x10c8, 0x1332, 0x1079, 0x8b4f, 0x007c, 0x8b5f,
+	0x8add, 0x8b61, 0x8b5f, 0x8b61, 0x8b61, 0x8ad6, 0x8b5f, 0x8acf,
+	0x8acf, 0x8b5f, 0x8b5f, 0x8b5f, 0x8b5f, 0x8b5f, 0x8b5f, 0x1078,
+	0x1332, 0x0d7e, 0x6018, 0x2068, 0x6804, 0xa084, 0x00ff, 0x0d7f,
+	0xa08a, 0x000c, 0x10c8, 0x1332, 0x1079, 0x8b6f, 0x007c, 0x8b7b,
+	0x8c23, 0x8b7d, 0x8bbd, 0x8b7d, 0x8bbd, 0x8b7d, 0x8b8a, 0x8b7b,
+	0x8bbd, 0x8b7b, 0x8ba7, 0x1078, 0x1332, 0x6004, 0xa08e, 0x0016,
+	0x0040, 0x8bb8, 0xa08e, 0x0004, 0x0040, 0x8bb8, 0xa08e, 0x0002,
+	0x0040, 0x8bb8, 0x6004, 0x1078, 0x8f00, 0x0040, 0x8c3e, 0xa08e,
+	0x0021, 0x0040, 0x8c42, 0xa08e, 0x0022, 0x0040, 0x8c3e, 0xa08e,
+	0x003d, 0x0040, 0x8c42, 0xa08e, 0x0039, 0x0040, 0x8c46, 0xa08e,
+	0x0035, 0x0040, 0x8c46, 0xa08e, 0x001e, 0x0040, 0x8bba, 0xa08e,
+	0x0001, 0x00c0, 0x8bb6, 0x0d7e, 0x6018, 0x2068, 0x6804, 0xa084,
+	0x00ff, 0x0d7f, 0xa086, 0x0006, 0x0040, 0x8bb8, 0x1078, 0x2880,
+	0x1078, 0x7c83, 0x1078, 0x8ec6, 0x007c, 0x0c7e, 0x0d7e, 0x6104,
+	0xa186, 0x0016, 0x0040, 0x8c13, 0xa186, 0x0002, 0x00c0, 0x8be6,
+	0x6018, 0x2068, 0x68a0, 0xd0bc, 0x00c0, 0x8c6a, 0x6840, 0xa084,
+	0x00ff, 0xa005, 0x0040, 0x8be6, 0x8001, 0x6842, 0x6013, 0x0000,
+	0x601f, 0x0007, 0x6017, 0x0398, 0x1078, 0x76c7, 0x0040, 0x8be6,
+	0x2d00, 0x601a, 0x601f, 0x0001, 0x0078, 0x8c13, 0x0d7f, 0x0c7f,
+	0x6004, 0xa08e, 0x0002, 0x00c0, 0x8c04, 0x6018, 0xa080, 0x0028,
+	0x2004, 0xa086, 0x007e, 0x00c0, 0x8c04, 0x2009, 0xa633, 0x2104,
+	0xc085, 0x200a, 0x0e7e, 0x2071, 0xa600, 0x1078, 0x42b8, 0x0e7f,
+	0x1078, 0x7c83, 0x0078, 0x8c08, 0x1078, 0x7c83, 0x1078, 0x2880,
+	0x0e7e, 0x127e, 0x2091, 0x8000, 0x1078, 0x28a6, 0x127f, 0x0e7f,
+	0x1078, 0x8ec6, 0x007c, 0x2001, 0x0002, 0x1078, 0x4502, 0x6003,
+	0x0001, 0x6007, 0x0002, 0x1078, 0x5dd7, 0x1078, 0x62d1, 0x0d7f,
+	0x0c7f, 0x0078, 0x8c12, 0x0c7e, 0x0d7e, 0x6104, 0xa186, 0x0016,
+	0x0040, 0x8c13, 0x6018, 0x2068, 0x6840, 0xa084, 0x00ff, 0xa005,
+	0x0040, 0x8be6, 0x8001, 0x6842, 0x6003, 0x0001, 0x1078, 0x5dd7,
+	0x1078, 0x62d1, 0x0d7f, 0x0c7f, 0x0078, 0x8c12, 0x1078, 0x7c83,
+	0x0078, 0x8bba, 0x1078, 0x7ca6, 0x0078, 0x8bba, 0x0d7e, 0x2c68,
+	0x6104, 0x1078, 0x91bc, 0x0d7f, 0x0040, 0x8c52, 0x1078, 0x772d,
+	0x0078, 0x8c69, 0x6004, 0x8007, 0x6130, 0xa18c, 0x00ff, 0xa105,
+	0x6032, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x6038,
+	0x600a, 0x2001, 0xa8a3, 0x2004, 0x6016, 0x1078, 0x5d8a, 0x1078,
+	0x62d1, 0x007c, 0x0d7f, 0x0c7f, 0x1078, 0x7c83, 0x1078, 0x2880,
+	0x0e7e, 0x127e, 0x2091, 0x8000, 0x1078, 0x28a6, 0x6013, 0x0000,
+	0x601f, 0x0007, 0x6017, 0x0398, 0x127f, 0x0e7f, 0x007c, 0x6000,
+	0xa08a, 0x0010, 0x10c8, 0x1332, 0x1079, 0x8c87, 0x007c, 0x8c97,
+	0x8c97, 0x8c97, 0x8c97, 0x8c97, 0x8c97, 0x8c97, 0x8c97, 0x8c97,
+	0x8ad5, 0x8c97, 0x8add, 0x8c99, 0x8add, 0x8ca7, 0x8c97, 0x1078,
+	0x1332, 0x6004, 0xa086, 0x008b, 0x0040, 0x8ca7, 0x6007, 0x008b,
+	0x6003, 0x000d, 0x1078, 0x5d8a, 0x1078, 0x62d1, 0x007c, 0x1078,
+	0x8eb9, 0x1078, 0x8d06, 0x0040, 0x8cdf, 0x1078, 0x2880, 0x0d7e,
+	0x1078, 0x8d06, 0x0040, 0x8cc1, 0x6010, 0x2068, 0x6837, 0x0103,
+	0x684b, 0x0006, 0x6847, 0x0000, 0x6850, 0xc0ed, 0x6852, 0x1078,
+	0x4a73, 0x2c68, 0x1078, 0x76c7, 0x0040, 0x8ccf, 0x6818, 0x601a,
+	0x0c7e, 0x2d60, 0x1078, 0x8ec6, 0x0c7f, 0x0078, 0x8cd0, 0x2d60,
+	0x0d7f, 0x6013, 0x0000, 0x601f, 0x0001, 0x6007, 0x0001, 0x6003,
+	0x0001, 0x1078, 0x5dd7, 0x1078, 0x62d1, 0x0078, 0x8cf1, 0x6030,
+	0xa08c, 0xff00, 0x810f, 0xa186, 0x0039, 0x0040, 0x8ceb, 0xa186,
+	0x0035, 0x00c0, 0x8cef, 0x1078, 0x2880, 0x0078, 0x8cc1, 0x1078,
+	0x8ec6, 0x007c, 0xa284, 0x000f, 0x00c0, 0x8d03, 0xa282, 0xad00,
+	0x0048, 0x8d03, 0x2001, 0xa616, 0x2004, 0xa202, 0x00c8, 0x8d03,
+	0xa085, 0x0001, 0x007c, 0xa006, 0x0078, 0x8d02, 0x027e, 0x0e7e,
+	0x2071, 0xa600, 0x6210, 0x705c, 0xa202, 0x0048, 0x8d18, 0x7060,
+	0xa202, 0x00c8, 0x8d18, 0xa085, 0x0001, 0x0e7f, 0x027f, 0x007c,
+	0xa006, 0x0078, 0x8d15, 0x0e7e, 0x0c7e, 0x037e, 0x007e, 0x127e,
+	0x2091, 0x8000, 0x2061, 0xad00, 0x2071, 0xa600, 0x7348, 0x7064,
+	0xa302, 0x00c8, 0x8d45, 0x601c, 0xa206, 0x00c0, 0x8d3d, 0x1078,
+	0x902b, 0x0040, 0x8d3d, 0x1078, 0x8f00, 0x00c0, 0x8d39, 0x1078,
+	0x7c83, 0x0c7e, 0x1078, 0x772d, 0x0c7f, 0xace0, 0x0010, 0x7058,
+	0xac02, 0x00c8, 0x8d45, 0x0078, 0x8d26, 0x127f, 0x007f, 0x037f,
+	0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x0c7e, 0x017e, 0xa188, 0xa735,
+	0x210c, 0x81ff, 0x0040, 0x8d59, 0x2061, 0xa9b3, 0x611a, 0x1078,
+	0x2880, 0xa006, 0x0078, 0x8d5e, 0xa085, 0x0001, 0x017f, 0x0c7f,
+	0x0e7f, 0x007c, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x0c7e,
+	0x1078, 0x76c7, 0x057f, 0x0040, 0x8d7b, 0x6612, 0x651a, 0x601f,
+	0x0003, 0x2009, 0x004b, 0x1078, 0x775c, 0xa085, 0x0001, 0x127f,
+	0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x8d77, 0x0c7e, 0x057e,
+	0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x76c7, 0x057f,
+	0x0040, 0x8da9, 0x6013, 0x0000, 0x651a, 0x601f, 0x0003, 0x0c7e,
+	0x2560, 0x1078, 0x47e9, 0x0c7f, 0x1078, 0x5f01, 0x077e, 0x2039,
+	0x0000, 0x1078, 0x5e0a, 0x2c08, 0x1078, 0x9f8b, 0x077f, 0x2009,
+	0x004c, 0x1078, 0x775c, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f,
+	0x007c, 0xa006, 0x0078, 0x8da5, 0x0f7e, 0x0c7e, 0x047e, 0x0c7e,
+	0x1078, 0x76c7, 0x2c78, 0x0c7f, 0x0040, 0x8dc6, 0x7e12, 0x2c00,
+	0x781a, 0x781f, 0x0003, 0x2021, 0x0005, 0x1078, 0x8e11, 0x2f60,
+	0x2009, 0x004d, 0x1078, 0x775c, 0xa085, 0x0001, 0x047f, 0x0c7f,
+	0x0f7f, 0x007c, 0x0f7e, 0x0c7e, 0x047e, 0x0c7e, 0x1078, 0x76c7,
+	0x2c78, 0x0c7f, 0x0040, 0x8de4, 0x7e12, 0x2c00, 0x781a, 0x781f,
+	0x0003, 0x2021, 0x0005, 0x1078, 0x8e11, 0x2f60, 0x2009, 0x004e,
+	0x1078, 0x775c, 0xa085, 0x0001, 0x047f, 0x0c7f, 0x0f7f, 0x007c,
+	0x0f7e, 0x0c7e, 0x047e, 0x0c7e, 0x1078, 0x76c7, 0x2c78, 0x0c7f,
+	0x0040, 0x8e0d, 0x7e12, 0x2c00, 0x781a, 0x781f, 0x0003, 0x2021,
+	0x0004, 0x1078, 0x8e11, 0x2001, 0xa89d, 0x2004, 0xd0fc, 0x0040,
+	0x8e06, 0x2f60, 0x1078, 0x772d, 0x0078, 0x8e0b, 0x2f60, 0x2009,
+	0x0052, 0x1078, 0x775c, 0xa085, 0x0001, 0x047f, 0x0c7f, 0x0f7f,
+	0x007c, 0x097e, 0x077e, 0x127e, 0x2091, 0x8000, 0x1078, 0x4775,
+	0x0040, 0x8e1e, 0x2001, 0x8e16, 0x0078, 0x8e24, 0x1078, 0x4739,
+	0x0040, 0x8e2d, 0x2001, 0x8e1e, 0x007e, 0xa00e, 0x2400, 0x1078,
+	0x4b51, 0x1078, 0x4a73, 0x007f, 0x007a, 0x2418, 0x1078, 0x6161,
+	0x62a0, 0x087e, 0x2041, 0x0001, 0x2039, 0x0001, 0x2608, 0x1078,
+	0x5f1b, 0x087f, 0x1078, 0x5e0a, 0x2f08, 0x2648, 0x1078, 0x9f8b,
+	0x613c, 0x81ff, 0x1040, 0x5fdb, 0x1078, 0x62d1, 0x127f, 0x077f,
+	0x097f, 0x007c, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078,
+	0x76c7, 0x017f, 0x0040, 0x8e63, 0x660a, 0x611a, 0x601f, 0x0001,
+	0x2d00, 0x6012, 0x2009, 0x001f, 0x1078, 0x775c, 0xa085, 0x0001,
+	0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x8e60, 0x0c7e, 0x127e,
+	0x2091, 0x8000, 0x0c7e, 0x1078, 0x76c7, 0x017f, 0x0040, 0x8e7f,
+	0x660a, 0x611a, 0x601f, 0x0008, 0x2d00, 0x6012, 0x2009, 0x0021,
+	0x1078, 0x775c, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006,
+	0x0078, 0x8e7c, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078,
+	0x76c7, 0x017f, 0x0040, 0x8e9b, 0x660a, 0x611a, 0x601f, 0x0001,
+	0x2d00, 0x6012, 0x2009, 0x003d, 0x1078, 0x775c, 0xa085, 0x0001,
+	0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x8e98, 0x0c7e, 0x127e,
+	0x2091, 0x8000, 0x0c7e, 0x1078, 0x76c7, 0x017f, 0x0040, 0x8eb6,
+	0x611a, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x0000, 0x1078,
+	0x775c, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078,
+	0x8eb3, 0x027e, 0x0d7e, 0x6218, 0x2268, 0x6a3c, 0x82ff, 0x0040,
+	0x8ec3, 0x8211, 0x6a3e, 0x0d7f, 0x027f, 0x007c, 0x007e, 0x6000,
+	0xa086, 0x0000, 0x0040, 0x8ed8, 0x6013, 0x0000, 0x601f, 0x0007,
+	0x2001, 0xa8a3, 0x2004, 0x6016, 0x1078, 0xa495, 0x603f, 0x0000,
+	0x007f, 0x007c, 0x067e, 0x0c7e, 0x0d7e, 0x2031, 0xa653, 0x2634,
+	0xd6e4, 0x0040, 0x8ee8, 0x6618, 0x2660, 0x6e48, 0x1078, 0x46e7,
+	0x0d7f, 0x0c7f, 0x067f, 0x007c, 0x007e, 0x017e, 0x6004, 0xa08e,
+	0x0002, 0x0040, 0x8efd, 0xa08e, 0x0003, 0x0040, 0x8efd, 0xa08e,
+	0x0004, 0x0040, 0x8efd, 0xa085, 0x0001, 0x017f, 0x007f, 0x007c,
+	0x007e, 0x0d7e, 0x6010, 0xa06d, 0x0040, 0x8f0d, 0x6838, 0xd0fc,
+	0x0040, 0x8f0d, 0xa006, 0x0078, 0x8f0f, 0xa085, 0x0001, 0x0d7f,
+	0x007f, 0x007c, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078,
+	0x76c7, 0x017f, 0x0040, 0x8f2c, 0x611a, 0x601f, 0x0001, 0x2d00,
+	0x6012, 0x1078, 0x2880, 0x2009, 0x0028, 0x1078, 0x775c, 0xa085,
+	0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x8f29, 0xa186,
+	0x0015, 0x00c0, 0x8f44, 0x2011, 0xa620, 0x2204, 0xa086, 0x0074,
+	0x00c0, 0x8f44, 0x1078, 0x7f91, 0x6003, 0x0001, 0x6007, 0x0029,
+	0x1078, 0x5dd7, 0x0078, 0x8f48, 0x1078, 0x7c83, 0x1078, 0x772d,
+	0x007c, 0xa186, 0x0016, 0x00c0, 0x8f53, 0x2001, 0x0004, 0x1078,
+	0x4502, 0x0078, 0x8f74, 0xa186, 0x0015, 0x00c0, 0x8f78, 0x2011,
+	0xa620, 0x2204, 0xa086, 0x0014, 0x00c0, 0x8f78, 0x0d7e, 0x6018,
+	0x2068, 0x1078, 0x4649, 0x0d7f, 0x1078, 0x8043, 0x00c0, 0x8f78,
+	0x0d7e, 0x6018, 0x2068, 0x6890, 0x0d7f, 0xa005, 0x0040, 0x8f78,
+	0x2001, 0x0006, 0x1078, 0x4502, 0x1078, 0x77f8, 0x0078, 0x8f7c,
+	0x1078, 0x7c83, 0x1078, 0x772d, 0x007c, 0x6848, 0xa086, 0x0005,
+	0x00c0, 0x8f84, 0x1078, 0x8f85, 0x007c, 0x6850, 0xc0ad, 0x6852,
+	0x007c, 0x0e7e, 0x2071, 0xab8c, 0x7014, 0xd0e4, 0x0040, 0x8f9a,
+	0x6013, 0x0000, 0x6003, 0x0001, 0x6007, 0x0050, 0x1078, 0x5d8a,
+	0x1078, 0x62d1, 0x0e7f, 0x007c, 0x0c7e, 0x0f7e, 0x2c78, 0x1078,
+	0x4963, 0x0f7f, 0x0040, 0x8fa9, 0x601c, 0xa084, 0x000f, 0x1079,
+	0x8fab, 0x0c7f, 0x007c, 0x8ad5, 0x8fb6, 0x8fb9, 0x8fbc, 0xa25d,
+	0xa279, 0xa27c, 0x8ad5, 0x8ad5, 0x1078, 0x1332, 0x0005, 0x0005,
+	0x007c, 0x0005, 0x0005, 0x007c, 0x1078, 0x8fbf, 0x007c, 0x0f7e,
+	0x2c78, 0x1078, 0x4963, 0x0040, 0x8fee, 0x1078, 0x76c7, 0x00c0,
+	0x8fcf, 0x2001, 0xa8a4, 0x2004, 0x783e, 0x0078, 0x8fee, 0x7818,
+	0x601a, 0x781c, 0xa086, 0x0003, 0x0040, 0x8fdc, 0x7808, 0x6036,
+	0x2f00, 0x603a, 0x0078, 0x8fe0, 0x7808, 0x603a, 0x2f00, 0x6036,
+	0x602a, 0x601f, 0x0001, 0x6007, 0x0035, 0x6003, 0x0001, 0x7920,
+	0x6122, 0x1078, 0x5d8a, 0x1078, 0x62d1, 0x2f60, 0x0f7f, 0x007c,
+	0x017e, 0x0f7e, 0x682c, 0x6032, 0xa08e, 0x0001, 0x0040, 0x9001,
+	0xa086, 0x0005, 0x0040, 0x9005, 0xa006, 0x602a, 0x602e, 0x0078,
+	0x9016, 0x6824, 0xc0f4, 0xc0d5, 0x6826, 0x6810, 0x2078, 0x787c,
+	0x6938, 0xa102, 0x7880, 0x6934, 0xa103, 0x00c8, 0x8ffc, 0x6834,
+	0x602a, 0x6838, 0xa084, 0xfffc, 0x683a, 0x602e, 0x2d00, 0x6036,
+	0x6808, 0x603a, 0x6918, 0x611a, 0x6920, 0x6122, 0x601f, 0x0001,
+	0x6007, 0x0039, 0x6003, 0x0001, 0x1078, 0x5d8a, 0x6803, 0x0002,
+	0x0f7f, 0x017f, 0x007c, 0x007e, 0x017e, 0x6004, 0xa08e, 0x0034,
+	0x0040, 0x9050, 0xa08e, 0x0035, 0x0040, 0x9050, 0xa08e, 0x0036,
+	0x0040, 0x9050, 0xa08e, 0x0037, 0x0040, 0x9050, 0xa08e, 0x0038,
+	0x0040, 0x9050, 0xa08e, 0x0039, 0x0040, 0x9050, 0xa08e, 0x003a,
+	0x0040, 0x9050, 0xa08e, 0x003b, 0x0040, 0x9050, 0xa085, 0x0001,
+	0x017f, 0x007f, 0x007c, 0x0f7e, 0x2c78, 0x1078, 0x4963, 0x00c0,
+	0x905d, 0xa085, 0x0001, 0x0078, 0x906c, 0x6024, 0xd0f4, 0x00c0,
+	0x906b, 0xc0f5, 0x6026, 0x6010, 0x2078, 0x7828, 0x603a, 0x782c,
+	0x6036, 0x1078, 0x1757, 0xa006, 0x0f7f, 0x007c, 0x007e, 0x017e,
+	0x027e, 0x037e, 0x0e7e, 0x2001, 0xa89e, 0x200c, 0x8000, 0x2014,
+	0x2001, 0x0032, 0x1078, 0x5c1c, 0x2001, 0xa8a2, 0x82ff, 0x00c0,
+	0x9083, 0x2011, 0x0014, 0x2202, 0x2001, 0xa8a0, 0x200c, 0x8000,
+	0x2014, 0x2071, 0xa88d, 0x711a, 0x721e, 0x2001, 0x0064, 0x1078,
+	0x5c1c, 0x2001, 0xa8a3, 0x82ff, 0x00c0, 0x9098, 0x2011, 0x0014,
+	0x2202, 0x2009, 0xa8a4, 0xa280, 0x000a, 0x200a, 0x1078, 0x498b,
+	0x0e7f, 0x037f, 0x027f, 0x017f, 0x007f, 0x007c, 0x007e, 0x0e7e,
+	0x2001, 0xa8a2, 0x2003, 0x0028, 0x2001, 0xa8a3, 0x2003, 0x0014,
+	0x2071, 0xa88d, 0x701b, 0x0000, 0x701f, 0x07d0, 0x2001, 0xa8a4,
+	0x2003, 0x001e, 0x0e7f, 0x007f, 0x007c, 0x0c7e, 0x127e, 0x2091,
+	0x8000, 0x0c7e, 0x1078, 0x76c7, 0x017f, 0x0040, 0x90d5, 0x611a,
+	0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x0033, 0x1078, 0x775c,
+	0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x90d2,
+	0x0d7e, 0x0e7e, 0x0f7e, 0x2071, 0xa600, 0xa186, 0x0015, 0x00c0,
+	0x9107, 0x7080, 0xa086, 0x0018, 0x00c0, 0x9107, 0x6010, 0x2068,
+	0x6a3c, 0xd2e4, 0x00c0, 0x90fb, 0x2c78, 0x1078, 0x6490, 0x0040,
+	0x910f, 0x706c, 0x6a50, 0xa206, 0x00c0, 0x9103, 0x7070, 0x6a54,
+	0xa206, 0x00c0, 0x9103, 0x6218, 0xa290, 0x0028, 0x2214, 0x2009,
+	0x0000, 0x1078, 0x28c8, 0x1078, 0x77f8, 0x0078, 0x910b, 0x1078,
+	0x7c83, 0x1078, 0x772d, 0x0f7f, 0x0e7f, 0x0d7f, 0x007c, 0x7050,
+	0xa080, 0x29c0, 0x2004, 0x6a54, 0xa206, 0x0040, 0x90fb, 0x0078,
+	0x9103, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x76c7,
+	0x017f, 0x0040, 0x9131, 0x611a, 0x601f, 0x0001, 0x2d00, 0x6012,
+	0x2009, 0x0043, 0x1078, 0x775c, 0xa085, 0x0001, 0x127f, 0x0c7f,
+	0x007c, 0xa006, 0x0078, 0x912e, 0x0d7e, 0x0e7e, 0x0f7e, 0x2071,
+	0xa600, 0xa186, 0x0015, 0x00c0, 0x915a, 0x7080, 0xa086, 0x0004,
+	0x00c0, 0x915a, 0x6010, 0xa0e8, 0x000f, 0x2c78, 0x1078, 0x6490,
+	0x0040, 0x9162, 0x706c, 0x6a08, 0xa206, 0x00c0, 0x9156, 0x7070,
+	0x6a0c, 0xa206, 0x00c0, 0x9156, 0x1078, 0x2880, 0x1078, 0x77f8,
+	0x0078, 0x915e, 0x1078, 0x7c83, 0x1078, 0x772d, 0x0f7f, 0x0e7f,
+	0x0d7f, 0x007c, 0x7050, 0xa080, 0x29c0, 0x2004, 0x6a0c, 0xa206,
+	0x0040, 0x9154, 0x0078, 0x9156, 0x017e, 0x027e, 0x684c, 0xd0ac,
+	0x0040, 0x9184, 0x6914, 0x6a10, 0x2100, 0xa205, 0x0040, 0x9184,
+	0x6860, 0xa106, 0x00c0, 0x9180, 0x685c, 0xa206, 0x0040, 0x9184,
+	0x6962, 0x6a5e, 0xa085, 0x0001, 0x027f, 0x017f, 0x007c, 0x0e7e,
+	0x127e, 0x2071, 0xa600, 0x2091, 0x8000, 0x7548, 0xa582, 0x0001,
+	0x0048, 0x91b9, 0x704c, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040,
+	0x91a5, 0xace0, 0x0010, 0x7058, 0xac02, 0x00c8, 0x91a1, 0x0078,
+	0x9194, 0x2061, 0xad00, 0x0078, 0x9194, 0x6003, 0x0008, 0x8529,
+	0x754a, 0xaca8, 0x0010, 0x7058, 0xa502, 0x00c8, 0x91b5, 0x754e,
+	0xa085, 0x0001, 0x127f, 0x0e7f, 0x007c, 0x704f, 0xad00, 0x0078,
+	0x91b0, 0xa006, 0x0078, 0x91b2, 0x0c7e, 0x027e, 0x017e, 0xa186,
+	0x0035, 0x0040, 0x91c6, 0x6a34, 0x0078, 0x91c7, 0x6a28, 0x1078,
+	0x8cf2, 0x0040, 0x91f0, 0x2260, 0x611c, 0xa186, 0x0003, 0x0040,
+	0x91d5, 0xa186, 0x0006, 0x00c0, 0x91ec, 0x6834, 0xa206, 0x0040,
+	0x91e4, 0x6838, 0xa206, 0x00c0, 0x91ec, 0x6108, 0x6834, 0xa106,
+	0x00c0, 0x91ec, 0x0078, 0x91e9, 0x6008, 0x6938, 0xa106, 0x00c0,
+	0x91ec, 0x6018, 0x6918, 0xa106, 0x017f, 0x027f, 0x0c7f, 0x007c,
+	0xa085, 0x0001, 0x0078, 0x91ec, 0x6944, 0xd1cc, 0x0040, 0x920d,
+	0xa18c, 0x00ff, 0xa18e, 0x0002, 0x00c0, 0x920d, 0xad88, 0x001e,
+	0x210c, 0xa18c, 0x0f00, 0x810f, 0xa18e, 0x0001, 0x00c0, 0x920d,
+	0x6810, 0x6914, 0xa115, 0x10c0, 0x84d5, 0x007c, 0x067e, 0x6000,
+	0xa0b2, 0x0010, 0x10c8, 0x1332, 0x1079, 0x9218, 0x067f, 0x007c,
+	0x9228, 0x96df, 0x97fb, 0x9228, 0x9228, 0x9228, 0x9228, 0x9228,
+	0x9262, 0x988e, 0x9228, 0x9228, 0x9228, 0x9228, 0x9228, 0x9228,
+	0x1078, 0x1332, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1332,
+	0x1079, 0x9234, 0x067f, 0x007c, 0x9244, 0x9d53, 0x9244, 0x9244,
+	0x9244, 0x9244, 0x9244, 0x9244, 0x9d11, 0x9da1, 0x9244, 0xa3b0,
+	0xa3e4, 0xa3b0, 0xa3e4, 0x9244, 0x1078, 0x1332, 0x067e, 0x6000,
+	0xa0b2, 0x0010, 0x10c8, 0x1332, 0x1079, 0x9250, 0x067f, 0x007c,
+	0x9260, 0x99eb, 0x9ac7, 0x9af5, 0x9b70, 0x9260, 0x9c76, 0x9c1e,
+	0x989a, 0x9ce5, 0x9cfb, 0x9260, 0x9260, 0x9260, 0x9260, 0x9260,
+	0x1078, 0x1332, 0xa1b2, 0x0044, 0x10c8, 0x1332, 0x2100, 0x0079,
+	0x9269, 0x92a9, 0x9498, 0x92a9, 0x92a9, 0x92a9, 0x94a0, 0x92a9,
+	0x92a9, 0x92a9, 0x92a9, 0x92a9, 0x92a9, 0x92a9, 0x92a9, 0x92a9,
+	0x92a9, 0x92a9, 0x92a9, 0x92a9, 0x92a9, 0x92a9, 0x92a9, 0x92a9,
+	0x92ab, 0x9311, 0x9320, 0x9377, 0x9396, 0x9415, 0x9485, 0x92a9,
+	0x92a9, 0x94a4, 0x92a9, 0x92a9, 0x94b7, 0x94c2, 0x92a9, 0x92a9,
+	0x92a9, 0x92a9, 0x92a9, 0x94fa, 0x92a9, 0x92a9, 0x9509, 0x92a9,
+	0x92a9, 0x92a9, 0x92a9, 0x92a9, 0x92a9, 0x9522, 0x92a9, 0x92a9,
+	0x92a9, 0x95af, 0x92a9, 0x92a9, 0x92a9, 0x92a9, 0x92a9, 0x92a9,
+	0x9629, 0x1078, 0x1332, 0x1078, 0x4967, 0x00c0, 0x92bb, 0x2001,
+	0xa633, 0x2004, 0xd0cc, 0x00c0, 0x92bb, 0xa084, 0x0009, 0xa086,
+	0x0008, 0x00c0, 0x92c3, 0x6007, 0x0009, 0x602b, 0x0009, 0x6013,
+	0x0000, 0x0078, 0x9493, 0x1078, 0x4957, 0x0e7e, 0x0c7e, 0x037e,
+	0x027e, 0x017e, 0x6218, 0x2270, 0x72a0, 0x027e, 0x2019, 0x0029,
+	0x1078, 0x5f01, 0x077e, 0x2039, 0x0000, 0x1078, 0x5e0a, 0x2c08,
+	0x1078, 0x9f8b, 0x077f, 0x017f, 0x2e60, 0x1078, 0x47e9, 0x017f,
+	0x027f, 0x037f, 0x0c7f, 0x0e7f, 0x6618, 0x0c7e, 0x2660, 0x1078,
+	0x45d6, 0x0c7f, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082,
+	0x0006, 0x0048, 0x9303, 0x1078, 0x9ebf, 0x00c0, 0x9371, 0x1078,
+	0x9e50, 0x00c0, 0x92ff, 0x6007, 0x0008, 0x0078, 0x9493, 0x6007,
+	0x0009, 0x0078, 0x9493, 0x1078, 0xa09f, 0x0040, 0x930d, 0x1078,
+	0x9ebf, 0x0040, 0x92f7, 0x0078, 0x9371, 0x6013, 0x1900, 0x0078,
+	0x92ff, 0x1078, 0x29bb, 0x00c0, 0x9664, 0x6106, 0x1078, 0x9e05,
+	0x6007, 0x0006, 0x0078, 0x9493, 0x6007, 0x0007, 0x0078, 0x9493,
+	0x1078, 0xa41c, 0x00c0, 0x9664, 0x1078, 0x29bb, 0x00c0, 0x9664,
+	0x0d7e, 0x6618, 0x2668, 0x6e04, 0xa684, 0x00ff, 0xa082, 0x0006,
+	0x00c8, 0x9336, 0x2001, 0x0001, 0x1078, 0x44ee, 0xa6b4, 0xff00,
+	0x8637, 0xa686, 0x0006, 0x0040, 0x9353, 0xa686, 0x0004, 0x0040,
+	0x9353, 0x6e04, 0xa6b4, 0x00ff, 0xa686, 0x0006, 0x0040, 0x9353,
+	0xa686, 0x0004, 0x0040, 0x9353, 0xa686, 0x0005, 0x0040, 0x9353,
+	0x0d7f, 0x0078, 0x9371, 0x1078, 0x9f25, 0x00c0, 0x936c, 0xa686,
+	0x0006, 0x00c0, 0x9365, 0x027e, 0x6218, 0xa290, 0x0028, 0x2214,
+	0x2009, 0x0000, 0x1078, 0x28c8, 0x027f, 0x1078, 0x4649, 0x6007,
+	0x000a, 0x0d7f, 0x0078, 0x9493, 0x6007, 0x000b, 0x0d7f, 0x0078,
+	0x9493, 0x1078, 0x2880, 0x6007, 0x0001, 0x0078, 0x9493, 0x1078,
+	0xa41c, 0x00c0, 0x9664, 0x1078, 0x29bb, 0x00c0, 0x9664, 0x6618,
+	0x0d7e, 0x2668, 0x6e04, 0x0d7f, 0xa686, 0x0707, 0x0040, 0x9371,
+	0x027e, 0x6218, 0xa290, 0x0028, 0x2214, 0x2009, 0x0000, 0x1078,
+	0x28c8, 0x027f, 0x6007, 0x000c, 0x0078, 0x9493, 0x1078, 0x4967,
+	0x00c0, 0x93a3, 0x2001, 0xa633, 0x2004, 0xa084, 0x0009, 0xa086,
+	0x0008, 0x00c0, 0x93ab, 0x6007, 0x0009, 0x602b, 0x0009, 0x6013,
+	0x0000, 0x0078, 0x9493, 0x1078, 0x4957, 0x6618, 0xa6b0, 0x0001,
+	0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x93ef, 0xa6b4,
+	0xff00, 0x8637, 0xa686, 0x0004, 0x0040, 0x93c2, 0xa686, 0x0006,
+	0x00c0, 0x9371, 0x1078, 0x9f34, 0x00c0, 0x93ca, 0x6007, 0x000e,
+	0x0078, 0x9493, 0x047e, 0x6418, 0xa4a0, 0x0028, 0x2424, 0xa4a4,
+	0x00ff, 0x8427, 0x047e, 0x1078, 0x2880, 0x047f, 0x017e, 0xa006,
+	0x2009, 0xa653, 0x210c, 0xd1a4, 0x0040, 0x93e9, 0x2009, 0x0029,
+	0x1078, 0xa21d, 0x6018, 0x0d7e, 0x2068, 0x6800, 0xc0e5, 0x6802,
+	0x0d7f, 0x017f, 0x047f, 0x6007, 0x0001, 0x0078, 0x9493, 0x2001,
+	0x0001, 0x1078, 0x44ee, 0x157e, 0x017e, 0x027e, 0x037e, 0x20a9,
+	0x0004, 0x2019, 0xa605, 0x2011, 0xab90, 0x1078, 0x80de, 0x037f,
+	0x027f, 0x017f, 0x157f, 0xa005, 0x0040, 0x940f, 0xa6b4, 0xff00,
+	0x8637, 0xa686, 0x0006, 0x0040, 0x93c2, 0x0078, 0x9371, 0x6013,
+	0x1900, 0x6007, 0x0009, 0x0078, 0x9493, 0x1078, 0x4967, 0x00c0,
+	0x9422, 0x2001, 0xa633, 0x2004, 0xa084, 0x0009, 0xa086, 0x0008,
+	0x00c0, 0x942a, 0x6007, 0x0009, 0x602b, 0x0009, 0x6013, 0x0000,
+	0x0078, 0x9493, 0x1078, 0x4957, 0x6618, 0xa6b0, 0x0001, 0x2634,
+	0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x9472, 0xa6b4, 0xff00,
+	0x8637, 0xa686, 0x0004, 0x0040, 0x9441, 0xa686, 0x0006, 0x00c0,
+	0x9371, 0x1078, 0x9f5f, 0x00c0, 0x944d, 0x1078, 0x9e50, 0x00c0,
+	0x944d, 0x6007, 0x0010, 0x0078, 0x9493, 0x047e, 0x6418, 0xa4a0,
+	0x0028, 0x2424, 0xa4a4, 0x00ff, 0x8427, 0x047e, 0x1078, 0x2880,
+	0x047f, 0x017e, 0xa006, 0x2009, 0xa653, 0x210c, 0xd1a4, 0x0040,
+	0x946c, 0x2009, 0x0029, 0x1078, 0xa21d, 0x6018, 0x0d7e, 0x2068,
+	0x6800, 0xc0e5, 0x6802, 0x0d7f, 0x017f, 0x047f, 0x6007, 0x0001,
+	0x0078, 0x9493, 0x1078, 0xa09f, 0x0040, 0x947f, 0xa6b4, 0xff00,
+	0x8637, 0xa686, 0x0006, 0x0040, 0x9441, 0x0078, 0x9371, 0x6013,
+	0x1900, 0x6007, 0x0009, 0x0078, 0x9493, 0x1078, 0x29bb, 0x00c0,
+	0x9664, 0x1078, 0xa41c, 0x00c0, 0x9664, 0x1078, 0x9667, 0x00c0,
+	0x9371, 0x6007, 0x0012, 0x6003, 0x0001, 0x1078, 0x5dd7, 0x007c,
+	0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x5dd7, 0x0078, 0x9497,
+	0x6007, 0x0005, 0x0078, 0x949a, 0x1078, 0xa41c, 0x00c0, 0x9664,
+	0x1078, 0x29bb, 0x00c0, 0x9664, 0x1078, 0x9667, 0x00c0, 0x9371,
+	0x6007, 0x0020, 0x6003, 0x0001, 0x1078, 0x5dd7, 0x007c, 0x1078,
+	0x29bb, 0x00c0, 0x9664, 0x6007, 0x0023, 0x6003, 0x0001, 0x1078,
+	0x5dd7, 0x007c, 0x1078, 0xa41c, 0x00c0, 0x9664, 0x1078, 0x29bb,
+	0x00c0, 0x9664, 0x1078, 0x9667, 0x00c0, 0x9371, 0x017e, 0x027e,
+	0x2011, 0xab90, 0x2214, 0x2c08, 0xa006, 0x1078, 0xa1e6, 0x00c0,
+	0x94e9, 0x2160, 0x6007, 0x0026, 0x6013, 0x1700, 0x2011, 0xab89,
+	0x2214, 0xa296, 0xffff, 0x00c0, 0x94f3, 0x6007, 0x0025, 0x0078,
+	0x94f3, 0x6004, 0xa086, 0x0024, 0x00c0, 0x94f0, 0x1078, 0x772d,
+	0x2160, 0x6007, 0x0025, 0x6003, 0x0001, 0x1078, 0x5dd7, 0x027f,
+	0x017f, 0x007c, 0x1078, 0x29bb, 0x00c0, 0x9664, 0x6106, 0x1078,
+	0x9687, 0x6007, 0x002b, 0x0078, 0x9493, 0x6007, 0x002c, 0x0078,
+	0x9493, 0x1078, 0xa41c, 0x00c0, 0x9664, 0x1078, 0x29bb, 0x00c0,
+	0x9664, 0x1078, 0x9667, 0x00c0, 0x9371, 0x6106, 0x1078, 0x968c,
+	0x00c0, 0x951e, 0x6007, 0x002e, 0x0078, 0x9493, 0x6007, 0x002f,
+	0x0078, 0x9493, 0x1078, 0x29bb, 0x00c0, 0x9664, 0x0e7e, 0x0d7e,
+	0x0c7e, 0x6018, 0xa080, 0x0001, 0x200c, 0xa184, 0x00ff, 0xa086,
+	0x0006, 0x0040, 0x953f, 0xa184, 0xff00, 0x8007, 0xa086, 0x0006,
+	0x0040, 0x953f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0078, 0x9498, 0x2001,
+	0xa672, 0x2004, 0xd0e4, 0x0040, 0x95ab, 0x2071, 0xab8c, 0x7010,
+	0x6036, 0x7014, 0x603a, 0x7108, 0x720c, 0x2001, 0xa653, 0x2004,
+	0xd0a4, 0x0040, 0x955d, 0x6018, 0x2068, 0x6810, 0xa106, 0x00c0,
+	0x955d, 0x6814, 0xa206, 0x0040, 0x9581, 0x2001, 0xa653, 0x2004,
+	0xd0ac, 0x00c0, 0x959f, 0x2069, 0xa600, 0x6870, 0xa206, 0x00c0,
+	0x959f, 0x686c, 0xa106, 0x00c0, 0x959f, 0x7210, 0x1078, 0x8cf2,
+	0x0040, 0x95a5, 0x1078, 0xa28e, 0x0040, 0x95a5, 0x622a, 0x6007,
+	0x0036, 0x6003, 0x0001, 0x1078, 0x5d8a, 0x0c7f, 0x0d7f, 0x0e7f,
+	0x007c, 0x7214, 0xa286, 0xffff, 0x0040, 0x9593, 0x1078, 0x8cf2,
+	0x0040, 0x95a5, 0xa280, 0x0002, 0x2004, 0x7110, 0xa106, 0x00c0,
+	0x95a5, 0x0078, 0x956e, 0x7210, 0x2c08, 0xa085, 0x0001, 0x1078,
+	0xa1e6, 0x2c10, 0x2160, 0x0040, 0x95a5, 0x0078, 0x956e, 0x6007,
+	0x0037, 0x6013, 0x1500, 0x0078, 0x9579, 0x6007, 0x0037, 0x6013,
+	0x1700, 0x0078, 0x9579, 0x6007, 0x0012, 0x0078, 0x9579, 0x1078,
+	0x29bb, 0x00c0, 0x9664, 0x6018, 0xa080, 0x0001, 0x2004, 0xa084,
+	0xff00, 0x8007, 0xa086, 0x0006, 0x00c0, 0x9498, 0x0e7e, 0x0d7e,
+	0x0c7e, 0x2001, 0xa672, 0x2004, 0xd0e4, 0x0040, 0x9621, 0x2069,
+	0xa600, 0x2071, 0xab8c, 0x7008, 0x6036, 0x720c, 0x623a, 0xa286,
+	0xffff, 0x00c0, 0x95de, 0x7208, 0x0c7e, 0x2c08, 0xa085, 0x0001,
+	0x1078, 0xa1e6, 0x2c10, 0x0c7f, 0x0040, 0x9615, 0x1078, 0x8cf2,
+	0x0040, 0x9615, 0x0c7e, 0x027e, 0x2260, 0x1078, 0x89f3, 0x027f,
+	0x0c7f, 0x7118, 0xa18c, 0xff00, 0x810f, 0xa186, 0x0001, 0x0040,
+	0x95ff, 0xa186, 0x0005, 0x0040, 0x95f9, 0xa186, 0x0007, 0x00c0,
+	0x9609, 0xa280, 0x0004, 0x2004, 0xa005, 0x0040, 0x9609, 0x057e,
+	0x7510, 0x7614, 0x1078, 0xa2a3, 0x057f, 0x0c7f, 0x0d7f, 0x0e7f,
+	0x007c, 0x6007, 0x003b, 0x602b, 0x0009, 0x6013, 0x2a00, 0x6003,
+	0x0001, 0x1078, 0x5d8a, 0x0078, 0x9605, 0x6007, 0x003b, 0x602b,
+	0x0009, 0x6013, 0x1700, 0x6003, 0x0001, 0x1078, 0x5d8a, 0x0078,
+	0x9605, 0x6007, 0x003b, 0x602b, 0x000b, 0x6013, 0x0000, 0x0078,
+	0x9579, 0x0e7e, 0x027e, 0x1078, 0x4967, 0x0040, 0x965e, 0x1078,
+	0x4957, 0x1078, 0xa4a9, 0x00c0, 0x965c, 0x2071, 0xa600, 0x70cc,
+	0xc085, 0x70ce, 0x0f7e, 0x2079, 0x0100, 0x7298, 0xa284, 0x00ff,
+	0x706e, 0x78e6, 0xa284, 0xff00, 0x7270, 0xa205, 0x7072, 0x78ea,
+	0x0f7f, 0x70d7, 0x0000, 0x2001, 0xa653, 0x2004, 0xd0a4, 0x0040,
+	0x9655, 0x2011, 0xa8ca, 0x2013, 0x07d0, 0xd0ac, 0x00c0, 0x965e,
+	0x1078, 0x2677, 0x0078, 0x965e, 0x1078, 0xa4d9, 0x027f, 0x0e7f,
+	0x1078, 0x772d, 0x0078, 0x9497, 0x1078, 0x772d, 0x007c, 0x0d7e,
+	0x067e, 0x6618, 0x2668, 0x6e04, 0xa6b4, 0xff00, 0x8637, 0xa686,
+	0x0006, 0x0040, 0x9684, 0xa686, 0x0004, 0x0040, 0x9684, 0x6e04,
+	0xa6b4, 0x00ff, 0xa686, 0x0006, 0x0040, 0x9684, 0xa686, 0x0004,
+	0x0040, 0x9684, 0xa085, 0x0001, 0x067f, 0x0d7f, 0x007c, 0x0d7e,
+	0x1078, 0x96bb, 0x0d7f, 0x007c, 0x0d7e, 0x1078, 0x96ca, 0x00c0,
+	0x96b4, 0x680c, 0xa08c, 0xff00, 0x6820, 0xa084, 0x00ff, 0xa115,
+	0x6212, 0x6824, 0x602a, 0xd1e4, 0x0040, 0x96a2, 0x2009, 0x0001,
+	0x0078, 0x96b0, 0xd1ec, 0x0040, 0x96b4, 0x6920, 0xa18c, 0x00ff,
+	0x6824, 0x1078, 0x254d, 0x00c0, 0x96b4, 0x2110, 0x2009, 0x0000,
+	0x1078, 0x28c8, 0x0078, 0x96b8, 0xa085, 0x0001, 0x0078, 0x96b9,
+	0xa006, 0x0d7f, 0x007c, 0x2069, 0xab8d, 0x6800, 0xa082, 0x0010,
+	0x00c8, 0x96c8, 0x6013, 0x0000, 0xa085, 0x0001, 0x0078, 0x96c9,
+	0xa006, 0x007c, 0x6013, 0x0000, 0x2069, 0xab8c, 0x6808, 0xa084,
+	0xff00, 0xa086, 0x0800, 0x00c0, 0x96de, 0x6800, 0xa084, 0x00ff,
+	0xa08e, 0x0014, 0x0040, 0x96de, 0xa08e, 0x0010, 0x007c, 0x6004,
+	0xa0b2, 0x0044, 0x10c8, 0x1332, 0xa1b6, 0x0013, 0x00c0, 0x96eb,
+	0x2008, 0x0079, 0x96fe, 0xa1b6, 0x0027, 0x0040, 0x96f3, 0xa1b6,
+	0x0014, 0x10c0, 0x1332, 0x2001, 0x0007, 0x1078, 0x4535, 0x1078,
+	0x61cd, 0x1078, 0x8ec6, 0x1078, 0x62d1, 0x007c, 0x973e, 0x9740,
+	0x973e, 0x973e, 0x973e, 0x9740, 0x974c, 0x97d6, 0x9799, 0x97d6,
+	0x97ad, 0x97d6, 0x974c, 0x97d6, 0x97ce, 0x97d6, 0x97ce, 0x97d6,
+	0x97d6, 0x973e, 0x973e, 0x973e, 0x973e, 0x973e, 0x973e, 0x973e,
+	0x973e, 0x973e, 0x973e, 0x973e, 0x9740, 0x973e, 0x97d6, 0x973e,
+	0x973e, 0x97d6, 0x973e, 0x97d6, 0x97d6, 0x973e, 0x973e, 0x973e,
+	0x973e, 0x97d6, 0x97d6, 0x973e, 0x97d6, 0x97d6, 0x973e, 0x973e,
+	0x973e, 0x973e, 0x973e, 0x9740, 0x97d6, 0x97d6, 0x973e, 0x973e,
+	0x97d6, 0x97d6, 0x973e, 0x973e, 0x973e, 0x973e, 0x1078, 0x1332,
+	0x1078, 0x61cd, 0x2001, 0xa8a2, 0x2004, 0x6016, 0x6003, 0x0002,
+	0x1078, 0x62d1, 0x0078, 0x97dc, 0x0f7e, 0x2079, 0xa652, 0x7804,
+	0x0f7f, 0xd0ac, 0x00c0, 0x97d6, 0x2001, 0x0000, 0x1078, 0x44ee,
+	0x6018, 0xa080, 0x0004, 0x2004, 0xa086, 0x00ff, 0x0040, 0x97d6,
+	0x0c7e, 0x6018, 0x2060, 0x6000, 0xd0f4, 0x00c0, 0x9770, 0x6010,
+	0xa005, 0x0040, 0x9770, 0x0c7f, 0x1078, 0x3699, 0x0078, 0x97d6,
+	0x0c7f, 0x2001, 0xa600, 0x2004, 0xa086, 0x0002, 0x00c0, 0x977f,
+	0x0f7e, 0x2079, 0xa600, 0x7890, 0x8000, 0x7892, 0x0f7f, 0x2001,
+	0x0002, 0x1078, 0x4502, 0x1078, 0x61cd, 0x601f, 0x0001, 0x6003,
+	0x0001, 0x6007, 0x0002, 0x1078, 0x5dd7, 0x1078, 0x62d1, 0x0c7e,
+	0x6118, 0x2160, 0x2009, 0x0001, 0x1078, 0x5a52, 0x0c7f, 0x0078,
+	0x97dc, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f, 0xa6b4, 0xff00,
+	0x8637, 0xa686, 0x0006, 0x0040, 0x97d6, 0xa686, 0x0004, 0x0040,
+	0x97d6, 0x2001, 0x0004, 0x0078, 0x97d4, 0x2001, 0xa600, 0x2004,
+	0xa086, 0x0003, 0x00c0, 0x97b6, 0x1078, 0x3699, 0x2001, 0x0006,
+	0x1078, 0x97dd, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f, 0xa6b4,
+	0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x97d6, 0x2001, 0x0006,
+	0x0078, 0x97d4, 0x2001, 0x0004, 0x0078, 0x97d4, 0x2001, 0x0006,
+	0x1078, 0x97dd, 0x0078, 0x97d6, 0x1078, 0x4535, 0x1078, 0x61cd,
+	0x1078, 0x772d, 0x1078, 0x62d1, 0x007c, 0x017e, 0x0d7e, 0x6118,
+	0x2168, 0x6900, 0xd184, 0x0040, 0x97f8, 0x6104, 0xa18e, 0x000a,
+	0x00c0, 0x97f0, 0x699c, 0xd1a4, 0x00c0, 0x97f0, 0x2001, 0x0007,
+	0x1078, 0x4502, 0x2001, 0x0000, 0x1078, 0x44ee, 0x1078, 0x28a6,
+	0x0d7f, 0x017f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084,
+	0xff00, 0x8007, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x1332, 0xa1b6,
+	0x0015, 0x00c0, 0x980f, 0x1079, 0x9816, 0x0078, 0x9815, 0xa1b6,
+	0x0016, 0x10c0, 0x1332, 0x1079, 0x9822, 0x007c, 0x7d4e, 0x7d4e,
+	0x7d4e, 0x7d4e, 0x7d4e, 0x7d4e, 0x9877, 0x982e, 0x7d4e, 0x7d4e,
+	0x7d4e, 0x7d4e, 0x7d4e, 0x7d4e, 0x7d4e, 0x7d4e, 0x7d4e, 0x7d4e,
+	0x9877, 0x987f, 0x7d4e, 0x7d4e, 0x7d4e, 0x7d4e, 0x0f7e, 0x2079,
+	0xa652, 0x7804, 0xd0ac, 0x00c0, 0x9855, 0x6018, 0xa07d, 0x0040,
+	0x9855, 0x7800, 0xd0f4, 0x00c0, 0x9841, 0x7810, 0xa005, 0x00c0,
+	0x9855, 0x2001, 0x0000, 0x1078, 0x44ee, 0x2001, 0x0002, 0x1078,
+	0x4502, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078,
+	0x5dd7, 0x1078, 0x62d1, 0x0078, 0x9875, 0x2011, 0xab83, 0x2204,
+	0x8211, 0x220c, 0x1078, 0x254d, 0x00c0, 0x9875, 0x0c7e, 0x1078,
+	0x45c4, 0x0040, 0x9868, 0x0c7f, 0x1078, 0x772d, 0x0078, 0x9875,
+	0x6010, 0x007e, 0x6014, 0x007e, 0x1078, 0x42f8, 0x007f, 0x6016,
+	0x007f, 0x6012, 0x0c7f, 0x1078, 0x772d, 0x0f7f, 0x007c, 0x6604,
+	0xa6b6, 0x001e, 0x00c0, 0x987e, 0x1078, 0x772d, 0x007c, 0x1078,
+	0x7f8e, 0x00c0, 0x988b, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078,
+	0x5dd7, 0x0078, 0x988d, 0x1078, 0x772d, 0x007c, 0x6004, 0xa08a,
+	0x0044, 0x10c8, 0x1332, 0x1078, 0x61cd, 0x1078, 0x8ec6, 0x1078,
+	0x62d1, 0x007c, 0xa182, 0x0040, 0x0079, 0x989e, 0x98b1, 0x98b1,
+	0x98b1, 0x98b1, 0x98b3, 0x98b1, 0x98b1, 0x98b1, 0x98b1, 0x98b1,
+	0x98b1, 0x98b1, 0x98b1, 0x98b1, 0x98b1, 0x98b1, 0x98b1, 0x98b1,
+	0x98b1, 0x1078, 0x1332, 0x0d7e, 0x0e7e, 0x0f7e, 0x157e, 0x047e,
+	0x027e, 0x6218, 0xa280, 0x002b, 0x2004, 0xa005, 0x0040, 0x98c4,
+	0x2021, 0x0000, 0x1078, 0xa472, 0x6106, 0x2071, 0xab80, 0x7444,
+	0xa4a4, 0xff00, 0x0040, 0x991b, 0xa486, 0x2000, 0x00c0, 0x98d6,
+	0x2009, 0x0001, 0x2011, 0x0200, 0x1078, 0x5bf1, 0x1078, 0x138b,
+	0x1040, 0x1332, 0x6003, 0x0007, 0x2d00, 0x6837, 0x010d, 0x6803,
+	0x0000, 0x683b, 0x0000, 0x6c5a, 0x2c00, 0x685e, 0x6008, 0x68b2,
+	0x6018, 0x2078, 0x78a0, 0x8007, 0x7130, 0x694a, 0x017e, 0xa084,
+	0xff00, 0x6846, 0x684f, 0x0000, 0x6857, 0x0036, 0x1078, 0x4a73,
+	0x017f, 0xa486, 0x2000, 0x00c0, 0x9903, 0x2019, 0x0017, 0x1078,
+	0xa195, 0x0078, 0x997d, 0xa486, 0x0400, 0x00c0, 0x990d, 0x2019,
+	0x0002, 0x1078, 0xa146, 0x0078, 0x997d, 0xa486, 0x0200, 0x00c0,
+	0x9913, 0x1078, 0xa12b, 0xa486, 0x1000, 0x00c0, 0x9919, 0x1078,
+	0xa17a, 0x0078, 0x997d, 0x2069, 0xa933, 0x6a00, 0xd284, 0x0040,
+	0x99e7, 0xa284, 0x0300, 0x00c0, 0x99df, 0x6804, 0xa005, 0x0040,
+	0x99c5, 0x2d78, 0x6003, 0x0007, 0x1078, 0x1370, 0x0040, 0x9984,
+	0x7800, 0xd08c, 0x00c0, 0x9937, 0x7804, 0x8001, 0x7806, 0x6013,
+	0x0000, 0x6803, 0x0000, 0x6837, 0x0116, 0x683b, 0x0000, 0x6008,
+	0x68b2, 0x2c00, 0x684a, 0x6018, 0x2078, 0x78a0, 0x8007, 0x7130,
+	0x6986, 0x6846, 0x7928, 0x698a, 0x792c, 0x698e, 0x7930, 0x6992,
+	0x7934, 0x6996, 0x6853, 0x003d, 0x7244, 0xa294, 0x0003, 0xa286,
+	0x0002, 0x00c0, 0x995f, 0x684f, 0x0040, 0x0078, 0x9969, 0xa286,
+	0x0001, 0x00c0, 0x9967, 0x684f, 0x0080, 0x0078, 0x9969, 0x684f,
+	0x0000, 0x20a9, 0x000a, 0x2001, 0xab90, 0xad90, 0x0015, 0x200c,
+	0x810f, 0x2112, 0x8000, 0x8210, 0x00f0, 0x996f, 0x200c, 0x6982,
+	0x8000, 0x200c, 0x697e, 0x1078, 0x4a73, 0x027f, 0x047f, 0x157f,
+	0x0f7f, 0x0e7f, 0x0d7f, 0x007c, 0x2001, 0xa60e, 0x2004, 0xd084,
+	0x0040, 0x998e, 0x1078, 0x138b, 0x00c0, 0x9930, 0x6013, 0x0100,
+	0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x5d8a, 0x1078, 0x62d1,
+	0x0078, 0x997d, 0x2069, 0xab92, 0x2d04, 0xa084, 0xff00, 0xa086,
+	0x1200, 0x00c0, 0x99b9, 0x2069, 0xab80, 0x686c, 0xa084, 0x00ff,
+	0x017e, 0x6110, 0xa18c, 0x0700, 0xa10d, 0x6112, 0x017f, 0x6003,
+	0x0001, 0x6007, 0x0043, 0x1078, 0x5d8a, 0x1078, 0x62d1, 0x0078,
+	0x997d, 0x6013, 0x0200, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078,
+	0x5d8a, 0x1078, 0x62d1, 0x0078, 0x997d, 0x2001, 0xa60d, 0x2004,
+	0xd0ec, 0x0040, 0x99cf, 0x2011, 0x8049, 0x1078, 0x361b, 0x6013,
+	0x0300, 0x0078, 0x99d5, 0x6013, 0x0100, 0x6003, 0x0001, 0x6007,
+	0x0041, 0x1078, 0x5d8a, 0x1078, 0x62d1, 0x0078, 0x997d, 0x6013,
+	0x0500, 0x0078, 0x99d5, 0x6013, 0x0600, 0x0078, 0x999a, 0x6013,
+	0x0200, 0x0078, 0x999a, 0xa186, 0x0013, 0x00c0, 0x99fd, 0x6004,
+	0xa08a, 0x0040, 0x1048, 0x1332, 0xa08a, 0x0053, 0x10c8, 0x1332,
+	0xa082, 0x0040, 0x2008, 0x0079, 0x9a82, 0xa186, 0x0051, 0x0040,
+	0x9a0a, 0xa186, 0x0047, 0x00c0, 0x9a23, 0x6004, 0xa086, 0x0041,
+	0x0040, 0x9a31, 0x2001, 0x0109, 0x2004, 0xd084, 0x0040, 0x9a31,
+	0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x027e, 0x1078, 0x5c56,
+	0x027f, 0x017f, 0x007f, 0x127f, 0x6000, 0xa086, 0x0002, 0x00c0,
+	0x9a31, 0x0078, 0x9ac7, 0xa186, 0x0027, 0x0040, 0x9a2b, 0xa186,
+	0x0014, 0x10c0, 0x1332, 0x6004, 0xa082, 0x0040, 0x2008, 0x0079,
+	0x9a34, 0x1078, 0x7773, 0x007c, 0x9a47, 0x9a49, 0x9a49, 0x9a71,
+	0x9a47, 0x9a47, 0x9a47, 0x9a47, 0x9a47, 0x9a47, 0x9a47, 0x9a47,
+	0x9a47, 0x9a47, 0x9a47, 0x9a47, 0x9a47, 0x9a47, 0x9a47, 0x1078,
+	0x1332, 0x1078, 0x61cd, 0x1078, 0x62d1, 0x037e, 0x0d7e, 0x6010,
+	0xa06d, 0x0040, 0x9a6e, 0xad84, 0xf000, 0x0040, 0x9a6e, 0x6003,
+	0x0002, 0x6018, 0x2004, 0xd0bc, 0x00c0, 0x9a6e, 0x2019, 0x0004,
+	0x1078, 0xa1ca, 0x6013, 0x0000, 0x6014, 0xa005, 0x00c0, 0x9a6c,
+	0x2001, 0xa8a3, 0x2004, 0x6016, 0x6003, 0x0007, 0x0d7f, 0x037f,
+	0x007c, 0x0d7e, 0x1078, 0x61cd, 0x1078, 0x62d1, 0x1078, 0x8d06,
+	0x0040, 0x9a7e, 0x6010, 0x2068, 0x1078, 0x13a4, 0x1078, 0x8ec6,
+	0x0d7f, 0x007c, 0x9a95, 0x9ab4, 0x9a9e, 0x9ac1, 0x9a95, 0x9a95,
+	0x9a95, 0x9a95, 0x9a95, 0x9a95, 0x9a95, 0x9a95, 0x9a95, 0x9a95,
+	0x9a95, 0x9a95, 0x9a95, 0x9a95, 0x9a95, 0x1078, 0x1332, 0x6010,
+	0xa088, 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x1078, 0x61cd,
+	0x6010, 0xa080, 0x0013, 0x2004, 0xd0b4, 0x0040, 0x9aaf, 0x6003,
+	0x0007, 0x2009, 0x0043, 0x1078, 0x775c, 0x0078, 0x9ab1, 0x6003,
+	0x0002, 0x1078, 0x62d1, 0x007c, 0x1078, 0x61cd, 0x1078, 0xa423,
+	0x00c0, 0x9abe, 0x1078, 0x5bc1, 0x1078, 0x772d, 0x1078, 0x62d1,
+	0x007c, 0x1078, 0x61cd, 0x2009, 0x0041, 0x0078, 0x9c1e, 0xa182,
+	0x0040, 0x0079, 0x9acb, 0x9ade, 0x9ae0, 0x9ade, 0x9ade, 0x9ade,
+	0x9ade, 0x9ade, 0x9ae1, 0x9ade, 0x9ade, 0x9ade, 0x9ade, 0x9ade,
+	0x9ade, 0x9ade, 0x9ade, 0x9ade, 0x9aec, 0x9ade, 0x1078, 0x1332,
+	0x007c, 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20,
+	0x2c10, 0x1078, 0x15fa, 0x007c, 0x0d7e, 0x1078, 0x5bc1, 0x0d7f,
+	0x1078, 0xa495, 0x1078, 0x772d, 0x007c, 0xa182, 0x0040, 0x0079,
+	0x9af9, 0x9b0c, 0x9b0c, 0x9b0c, 0x9b0c, 0x9b0c, 0x9b0c, 0x9b0c,
+	0x9b0e, 0x9b0c, 0x9b11, 0x9b3c, 0x9b0c, 0x9b0c, 0x9b0c, 0x9b0c,
+	0x9b3c, 0x9b0c, 0x9b0c, 0x9b0c, 0x1078, 0x1332, 0x1078, 0x7773,
+	0x007c, 0x1078, 0x627a, 0x1078, 0x639b, 0x6010, 0x0d7e, 0x2068,
+	0x684c, 0xd0fc, 0x0040, 0x9b27, 0xa08c, 0x0003, 0xa18e, 0x0002,
+	0x0040, 0x9b2f, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x9c1e, 0x6003,
+	0x0007, 0x6017, 0x0000, 0x1078, 0x5bc1, 0x0d7f, 0x007c, 0x1078,
+	0xa423, 0x0040, 0x9b35, 0x0d7f, 0x007c, 0x1078, 0x5bc1, 0x1078,
+	0x772d, 0x0d7f, 0x0078, 0x9b2e, 0x037e, 0x1078, 0x627a, 0x1078,
+	0x639b, 0x6010, 0x0d7e, 0x2068, 0x6018, 0x2004, 0xd0bc, 0x0040,
+	0x9b5c, 0x684c, 0xa084, 0x0003, 0xa086, 0x0002, 0x0040, 0x9b58,
+	0x687c, 0x632c, 0xa31a, 0x632e, 0x6880, 0x6328, 0xa31b, 0x632a,
+	0x6003, 0x0002, 0x0078, 0x9b6d, 0x2019, 0x0004, 0x1078, 0xa1ca,
+	0x6014, 0xa005, 0x00c0, 0x9b69, 0x2001, 0xa8a3, 0x2004, 0x8003,
+	0x6016, 0x6013, 0x0000, 0x6003, 0x0007, 0x0d7f, 0x037f, 0x007c,
+	0xa186, 0x0013, 0x00c0, 0x9b7e, 0x6004, 0xa086, 0x0042, 0x10c0,
+	0x1332, 0x1078, 0x61cd, 0x1078, 0x62d1, 0x007c, 0xa186, 0x0027,
+	0x0040, 0x9b86, 0xa186, 0x0014, 0x00c0, 0x9b96, 0x6004, 0xa086,
+	0x0042, 0x10c0, 0x1332, 0x2001, 0x0007, 0x1078, 0x4535, 0x1078,
+	0x61cd, 0x1078, 0x8ec6, 0x1078, 0x62d1, 0x007c, 0xa182, 0x0040,
+	0x0079, 0x9b9a, 0x9bad, 0x9bad, 0x9bad, 0x9bad, 0x9bad, 0x9bad,
+	0x9bad, 0x9baf, 0x9bbb, 0x9bad, 0x9bad, 0x9bad, 0x9bad, 0x9bad,
+	0x9bad, 0x9bad, 0x9bad, 0x9bad, 0x9bad, 0x1078, 0x1332, 0x037e,
+	0x047e, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x15fa,
+	0x047f, 0x037f, 0x007c, 0x6010, 0x0d7e, 0x2068, 0x6810, 0x6a14,
+	0x6118, 0x210c, 0xd1bc, 0x0040, 0x9bda, 0x6124, 0xd1f4, 0x00c0,
+	0x9bda, 0x007e, 0x047e, 0x057e, 0x6c7c, 0xa422, 0x6d80, 0x2200,
+	0xa52b, 0x602c, 0xa420, 0x642e, 0x6028, 0xa529, 0x652a, 0x057f,
+	0x047f, 0x007f, 0xa20d, 0x00c0, 0x9bee, 0x684c, 0xd0fc, 0x0040,
+	0x9be6, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x9c1e, 0x6003, 0x0007,
+	0x6017, 0x0000, 0x1078, 0x5bc1, 0x0d7f, 0x007c, 0x007e, 0x0f7e,
+	0x2c78, 0x1078, 0x4963, 0x0f7f, 0x007f, 0x0040, 0x9bfb, 0x6003,
+	0x0002, 0x0d7f, 0x007c, 0x2009, 0xa60d, 0x210c, 0xd19c, 0x0040,
+	0x9c05, 0x6003, 0x0007, 0x0078, 0x9c07, 0x6003, 0x0006, 0x1078,
+	0x9c0d, 0x1078, 0x5bc3, 0x0d7f, 0x007c, 0xd2fc, 0x0040, 0x9c19,
+	0x8002, 0x8000, 0x8212, 0xa291, 0x0000, 0x2009, 0x0009, 0x0078,
+	0x9c1b, 0x2009, 0x0015, 0x6a6a, 0x6866, 0x007c, 0xa182, 0x0040,
+	0x0048, 0x9c24, 0x0079, 0x9c31, 0xa186, 0x0013, 0x0040, 0x9c2c,
+	0xa186, 0x0014, 0x10c0, 0x1332, 0x6024, 0xd0dc, 0x1040, 0x1332,
+	0x007c, 0x9c44, 0x9c4b, 0x9c57, 0x9c63, 0x9c44, 0x9c44, 0x9c44,
+	0x9c72, 0x9c44, 0x9c46, 0x9c46, 0x9c44, 0x9c44, 0x9c44, 0x9c44,
+	0x9c44, 0x9c44, 0x9c44, 0x9c44, 0x1078, 0x1332, 0x6024, 0xd0dc,
+	0x1040, 0x1332, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078, 0x5d8a,
+	0x127e, 0x2091, 0x8000, 0x1078, 0x62d1, 0x127f, 0x007c, 0x6003,
+	0x0001, 0x6106, 0x1078, 0x5d8a, 0x127e, 0x2091, 0x8000, 0x1078,
+	0x62d1, 0x127f, 0x007c, 0x6003, 0x0003, 0x6106, 0x2c10, 0x1078,
+	0x1cf0, 0x127e, 0x2091, 0x8000, 0x1078, 0x5df6, 0x1078, 0x639b,
+	0x127f, 0x007c, 0xa016, 0x1078, 0x15fa, 0x007c, 0x127e, 0x2091,
+	0x8000, 0x037e, 0x0d7e, 0xa182, 0x0040, 0x1079, 0x9c83, 0x0d7f,
+	0x037f, 0x127f, 0x007c, 0x9c93, 0x9c95, 0x9caa, 0x9cc9, 0x9c93,
+	0x9c93, 0x9c93, 0x9ce1, 0x9c93, 0x9c93, 0x9c93, 0x9c93, 0x9c93,
+	0x9c93, 0x9c93, 0x9c93, 0x1078, 0x1332, 0x6010, 0x2068, 0x684c,
+	0xd0fc, 0x0040, 0x9cbf, 0xa09c, 0x0003, 0xa39e, 0x0003, 0x0040,
+	0x9cbf, 0x6003, 0x0001, 0x6106, 0x1078, 0x5d8a, 0x1078, 0x62d1,
+	0x0078, 0x9ce4, 0x6010, 0x2068, 0x684c, 0xd0fc, 0x0040, 0x9cbf,
+	0xa09c, 0x0003, 0xa39e, 0x0003, 0x0040, 0x9cbf, 0x6003, 0x0001,
+	0x6106, 0x1078, 0x5d8a, 0x1078, 0x62d1, 0x0078, 0x9ce4, 0x6013,
+	0x0000, 0x6017, 0x0000, 0x2019, 0x0004, 0x1078, 0xa1ca, 0x0078,
+	0x9ce4, 0x6010, 0x2068, 0x684c, 0xd0fc, 0x0040, 0x9cbf, 0xa09c,
+	0x0003, 0xa39e, 0x0003, 0x0040, 0x9cbf, 0x6003, 0x0003, 0x6106,
+	0x2c10, 0x1078, 0x1cf0, 0x1078, 0x5df6, 0x1078, 0x639b, 0x0078,
+	0x9ce4, 0xa016, 0x1078, 0x15fa, 0x007c, 0x1078, 0x61cd, 0x6110,
+	0x81ff, 0x0040, 0x9cf6, 0x0d7e, 0x2168, 0x1078, 0xa4e2, 0x037e,
+	0x2019, 0x0029, 0x1078, 0xa1ca, 0x037f, 0x0d7f, 0x1078, 0x8ec6,
+	0x1078, 0x62d1, 0x007c, 0x1078, 0x627a, 0x6110, 0x81ff, 0x0040,
+	0x9d0c, 0x0d7e, 0x2168, 0x1078, 0xa4e2, 0x037e, 0x2019, 0x0029,
+	0x1078, 0xa1ca, 0x037f, 0x0d7f, 0x1078, 0x8ec6, 0x1078, 0x639b,
+	0x007c, 0xa182, 0x0085, 0x0079, 0x9d15, 0x9d1e, 0x9d1c, 0x9d1c,
+	0x9d2a, 0x9d1c, 0x9d1c, 0x9d1c, 0x1078, 0x1332, 0x6003, 0x000b,
+	0x6106, 0x1078, 0x5d8a, 0x127e, 0x2091, 0x8000, 0x1078, 0x62d1,
+	0x127f, 0x007c, 0x027e, 0x0e7e, 0x1078, 0xa41c, 0x0040, 0x9d34,
+	0x1078, 0x772d, 0x0078, 0x9d50, 0x2071, 0xab80, 0x7224, 0x6212,
+	0x7220, 0x1078, 0xa069, 0x0040, 0x9d41, 0x6007, 0x0086, 0x0078,
+	0x9d4a, 0x6007, 0x0087, 0x7224, 0xa296, 0xffff, 0x00c0, 0x9d4a,
+	0x6007, 0x0086, 0x6003, 0x0001, 0x1078, 0x5d8a, 0x1078, 0x62d1,
+	0x0e7f, 0x027f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x9d64, 0x6004,
+	0xa08a, 0x0085, 0x1048, 0x1332, 0xa08a, 0x008c, 0x10c8, 0x1332,
+	0xa082, 0x0085, 0x0079, 0x9d7b, 0xa186, 0x0027, 0x0040, 0x9d70,
+	0xa186, 0x0014, 0x0040, 0x9d70, 0x1078, 0x7773, 0x0078, 0x9d7a,
+	0x2001, 0x0007, 0x1078, 0x4535, 0x1078, 0x61cd, 0x1078, 0x8ec6,
+	0x1078, 0x62d1, 0x007c, 0x9d82, 0x9d84, 0x9d84, 0x9d82, 0x9d82,
+	0x9d82, 0x9d82, 0x1078, 0x1332, 0x1078, 0x61cd, 0x1078, 0x8ec6,
+	0x1078, 0x62d1, 0x007c, 0xa182, 0x0085, 0x1048, 0x1332, 0xa182,
+	0x008c, 0x10c8, 0x1332, 0xa182, 0x0085, 0x0079, 0x9d97, 0x9d9e,
+	0x9d9e, 0x9d9e, 0x9da0, 0x9d9e, 0x9d9e, 0x9d9e, 0x1078, 0x1332,
+	0x007c, 0xa186, 0x0013, 0x0040, 0x9db1, 0xa186, 0x0014, 0x0040,
+	0x9db1, 0xa186, 0x0027, 0x0040, 0x9db1, 0x1078, 0x7773, 0x0078,
+	0x9db7, 0x1078, 0x61cd, 0x1078, 0x8ec6, 0x1078, 0x62d1, 0x007c,
+	0x037e, 0x1078, 0xa495, 0x603f, 0x0000, 0x2019, 0x000b, 0x1078,
+	0x9dc7, 0x601f, 0x0006, 0x6003, 0x0007, 0x037f, 0x007c, 0x127e,
+	0x037e, 0x2091, 0x8000, 0x087e, 0x2c40, 0x097e, 0x2049, 0x0000,
+	0x1078, 0x7246, 0x097f, 0x087f, 0x00c0, 0x9e02, 0x077e, 0x2c38,
+	0x1078, 0x72f3, 0x077f, 0x00c0, 0x9e02, 0x6000, 0xa086, 0x0000,
+	0x0040, 0x9e02, 0x601c, 0xa086, 0x0007, 0x0040, 0x9e02, 0x0d7e,
+	0x6000, 0xa086, 0x0004, 0x00c0, 0x9df3, 0x1078, 0xa495, 0x601f,
+	0x0007, 0x1078, 0x1757, 0x6010, 0x2068, 0x1078, 0x8d06, 0x0040,
+	0x9dfb, 0x1078, 0xa1ca, 0x0d7f, 0x6013, 0x0000, 0x1078, 0xa495,
+	0x601f, 0x0007, 0x037f, 0x127f, 0x007c, 0x0f7e, 0x0c7e, 0x037e,
+	0x157e, 0x2079, 0xab80, 0x7938, 0x783c, 0x1078, 0x254d, 0x00c0,
+	0x9e49, 0x017e, 0x0c7e, 0x1078, 0x45c4, 0x00c0, 0x9e49, 0x017f,
+	0x027f, 0x027e, 0x017e, 0x2019, 0x0029, 0x1078, 0x73d0, 0x1078,
+	0x5f01, 0x077e, 0x2039, 0x0000, 0x1078, 0x5e0a, 0x077f, 0x017f,
+	0x077e, 0x2039, 0x0000, 0x1078, 0x9f8b, 0x077f, 0x1078, 0x47e9,
+	0x027e, 0x6204, 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x0040,
+	0x9e3d, 0xa286, 0x0004, 0x00c0, 0x9e40, 0x62a0, 0x1078, 0x2942,
+	0x027f, 0x017f, 0x1078, 0x42f8, 0x6612, 0x6516, 0xa006, 0x0078,
+	0x9e4b, 0x0c7f, 0x017f, 0x157f, 0x037f, 0x0c7f, 0x0f7f, 0x007c,
+	0x0c7e, 0x0d7e, 0x0e7e, 0x017e, 0x2009, 0xa620, 0x2104, 0xa086,
+	0x0074, 0x00c0, 0x9eb3, 0x2069, 0xab8e, 0x690c, 0xa182, 0x0100,
+	0x0048, 0x9ea3, 0x6908, 0xa184, 0x8000, 0x0040, 0x9eaf, 0x6018,
+	0x2070, 0x7010, 0xa084, 0x00ff, 0x0040, 0x9e72, 0x7000, 0xd0f4,
+	0x0040, 0x9e76, 0xa184, 0x0800, 0x0040, 0x9eaf, 0x6910, 0xa18a,
+	0x0001, 0x0048, 0x9ea7, 0x6914, 0x2069, 0xabae, 0x6904, 0x81ff,
+	0x00c0, 0x9e9b, 0x690c, 0xa182, 0x0100, 0x0048, 0x9ea3, 0x6908,
+	0x81ff, 0x00c0, 0x9e9f, 0x6910, 0xa18a, 0x0001, 0x0048, 0x9ea7,
+	0x6918, 0xa18a, 0x0001, 0x0048, 0x9eaf, 0x0078, 0x9eb9, 0x6013,
+	0x0100, 0x0078, 0x9eb5, 0x6013, 0x0300, 0x0078, 0x9eb5, 0x6013,
+	0x0500, 0x0078, 0x9eb5, 0x6013, 0x0700, 0x0078, 0x9eb5, 0x6013,
+	0x0900, 0x0078, 0x9eb5, 0x6013, 0x0b00, 0x0078, 0x9eb5, 0x6013,
+	0x0f00, 0x0078, 0x9eb5, 0x6013, 0x2d00, 0xa085, 0x0001, 0x0078,
+	0x9eba, 0xa006, 0x017f, 0x0e7f, 0x0d7f, 0x0c7f, 0x007c, 0x0c7e,
+	0x0d7e, 0x027e, 0x037e, 0x157e, 0x6218, 0x2268, 0x6b04, 0xa394,
+	0x00ff, 0xa286, 0x0006, 0x0040, 0x9ee3, 0xa286, 0x0004, 0x0040,
+	0x9ee3, 0xa394, 0xff00, 0x8217, 0xa286, 0x0006, 0x0040, 0x9ee3,
+	0xa286, 0x0004, 0x0040, 0x9ee3, 0x0c7e, 0x2d60, 0x1078, 0x45d6,
+	0x0c7f, 0x0078, 0x9f1e, 0x2011, 0xab96, 0xad98, 0x000a, 0x20a9,
+	0x0004, 0x1078, 0x80de, 0x00c0, 0x9f1f, 0x2011, 0xab9a, 0xad98,
+	0x0006, 0x20a9, 0x0004, 0x1078, 0x80de, 0x00c0, 0x9f1f, 0x047e,
+	0x017e, 0x6aa0, 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0xa653,
+	0x210c, 0xd1a4, 0x0040, 0x9f0b, 0x2009, 0x0029, 0x1078, 0xa21d,
+	0x6800, 0xc0e5, 0x6802, 0x2019, 0x0029, 0x1078, 0x5f01, 0x077e,
+	0x2039, 0x0000, 0x1078, 0x5e0a, 0x2c08, 0x1078, 0x9f8b, 0x077f,
+	0x2001, 0x0007, 0x1078, 0x4535, 0x017f, 0x047f, 0xa006, 0x157f,
+	0x037f, 0x027f, 0x0d7f, 0x0c7f, 0x007c, 0x0d7e, 0x2069, 0xab8e,
+	0x6800, 0xa086, 0x0800, 0x0040, 0x9f31, 0x6013, 0x0000, 0x0078,
+	0x9f32, 0xa006, 0x0d7f, 0x007c, 0x0c7e, 0x0f7e, 0x017e, 0x027e,
+	0x037e, 0x157e, 0x2079, 0xab8c, 0x7930, 0x7834, 0x1078, 0x254d,
+	0x00c0, 0x9f58, 0x1078, 0x45c4, 0x00c0, 0x9f58, 0x2011, 0xab90,
+	0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x80de, 0x00c0, 0x9f58,
+	0x2011, 0xab94, 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x80de,
+	0x157f, 0x037f, 0x027f, 0x017f, 0x0f7f, 0x0c7f, 0x007c, 0x0c7e,
+	0x007e, 0x017e, 0x027e, 0x037e, 0x157e, 0x2011, 0xab83, 0x2204,
+	0x8211, 0x220c, 0x1078, 0x254d, 0x00c0, 0x9f84, 0x1078, 0x45c4,
+	0x00c0, 0x9f84, 0x2011, 0xab96, 0xac98, 0x000a, 0x20a9, 0x0004,
+	0x1078, 0x80de, 0x00c0, 0x9f84, 0x2011, 0xab9a, 0xac98, 0x0006,
+	0x20a9, 0x0004, 0x1078, 0x80de, 0x157f, 0x037f, 0x027f, 0x017f,
+	0x007f, 0x0c7f, 0x007c, 0x0e7e, 0x0c7e, 0x087e, 0x077e, 0x067e,
+	0x057e, 0x047e, 0x027e, 0x127e, 0x2091, 0x8000, 0x2740, 0x2029,
+	0xa8ba, 0x252c, 0x2021, 0xa8c0, 0x2424, 0x2061, 0xad00, 0x2071,
+	0xa600, 0x7648, 0x7064, 0x81ff, 0x0040, 0x9fb2, 0x007e, 0xa186,
+	0xa9b3, 0x007f, 0x0040, 0x9fb2, 0x8001, 0xa602, 0x00c8, 0xa01c,
+	0x0078, 0x9fb5, 0xa606, 0x0040, 0xa01c, 0x2100, 0xac06, 0x0040,
+	0xa012, 0x1078, 0xa242, 0x0040, 0xa012, 0x671c, 0xa786, 0x0001,
+	0x0040, 0xa037, 0xa786, 0x0004, 0x0040, 0xa037, 0xa786, 0x0007,
+	0x0040, 0xa012, 0x2500, 0xac06, 0x0040, 0xa012, 0x2400, 0xac06,
+	0x0040, 0xa012, 0x1078, 0xa256, 0x00c0, 0xa012, 0x88ff, 0x0040,
+	0x9fdd, 0x6020, 0xa906, 0x00c0, 0xa012, 0x0d7e, 0x6000, 0xa086,
+	0x0004, 0x00c0, 0x9fe7, 0x017e, 0x1078, 0x1757, 0x017f, 0xa786,
+	0x0008, 0x00c0, 0x9ff6, 0x1078, 0x8f00, 0x00c0, 0x9ff6, 0x1078,
+	0x7c83, 0x0d7f, 0x1078, 0x8ec6, 0x0078, 0xa012, 0x6010, 0x2068,
+	0x1078, 0x8d06, 0x0040, 0xa00f, 0xa786, 0x0003, 0x00c0, 0xa026,
+	0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0xa4e2, 0x017e,
+	0x1078, 0x8f7d, 0x1078, 0x4a73, 0x017f, 0x1078, 0x8eb9, 0x0d7f,
+	0x1078, 0x8ec6, 0xace0, 0x0010, 0x2001, 0xa616, 0x2004, 0xac02,
+	0x00c8, 0xa01c, 0x0078, 0x9f9f, 0x127f, 0x027f, 0x047f, 0x057f,
+	0x067f, 0x077f, 0x087f, 0x0c7f, 0x0e7f, 0x007c, 0xa786, 0x0006,
+	0x00c0, 0xa000, 0xa386, 0x0005, 0x0040, 0xa034, 0x1078, 0xa4e2,
+	0x1078, 0xa1ca, 0x0078, 0xa00f, 0x0d7f, 0x0078, 0xa012, 0x1078,
+	0xa256, 0x00c0, 0xa012, 0x81ff, 0x0040, 0xa012, 0xa180, 0x0001,
+	0x2004, 0xa086, 0x0018, 0x0040, 0xa04c, 0xa180, 0x0001, 0x2004,
+	0xa086, 0x002d, 0x00c0, 0xa012, 0x6000, 0xa086, 0x0002, 0x00c0,
+	0xa012, 0x1078, 0x8eec, 0x0040, 0xa05d, 0x1078, 0x8f00, 0x00c0,
+	0xa012, 0x1078, 0x7c83, 0x0078, 0xa065, 0x1078, 0x28a6, 0x1078,
+	0x8f00, 0x00c0, 0xa065, 0x1078, 0x7c83, 0x1078, 0x8ec6, 0x0078,
+	0xa012, 0x0c7e, 0x0e7e, 0x017e, 0x2c08, 0x2170, 0xa006, 0x1078,
+	0xa1e6, 0x017f, 0x0040, 0xa079, 0x601c, 0xa084, 0x000f, 0x1079,
+	0xa07c, 0x0e7f, 0x0c7f, 0x007c, 0xa084, 0xa084, 0xa084, 0xa084,
+	0xa084, 0xa084, 0xa086, 0xa084, 0xa006, 0x007c, 0x047e, 0x017e,
+	0x7018, 0xa080, 0x0028, 0x2024, 0xa4a4, 0x00ff, 0x8427, 0x2c00,
+	0x2009, 0x0020, 0x1078, 0xa21d, 0x017f, 0x047f, 0x037e, 0x2019,
+	0x0002, 0x1078, 0x9dc7, 0x037f, 0xa085, 0x0001, 0x007c, 0x2001,
+	0x0001, 0x1078, 0x44ee, 0x157e, 0x017e, 0x027e, 0x037e, 0x20a9,
+	0x0004, 0x2019, 0xa605, 0x2011, 0xab96, 0x1078, 0x80de, 0x037f,
+	0x027f, 0x017f, 0x157f, 0xa005, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e,
+	0x087e, 0x077e, 0x067e, 0x027e, 0x127e, 0x2091, 0x8000, 0x2740,
+	0x2061, 0xad00, 0x2079, 0x0001, 0x8fff, 0x0040, 0xa11d, 0x2071,
+	0xa600, 0x7648, 0x7064, 0x8001, 0xa602, 0x00c8, 0xa11d, 0x88ff,
+	0x0040, 0xa0d8, 0x2800, 0xac06, 0x00c0, 0xa113, 0x2079, 0x0000,
+	0x1078, 0xa242, 0x0040, 0xa113, 0x2400, 0xac06, 0x0040, 0xa113,
+	0x671c, 0xa786, 0x0006, 0x00c0, 0xa113, 0xa786, 0x0007, 0x0040,
+	0xa113, 0x88ff, 0x00c0, 0xa0f7, 0x6018, 0xa206, 0x00c0, 0xa113,
+	0x85ff, 0x0040, 0xa0f7, 0x6020, 0xa106, 0x00c0, 0xa113, 0x0d7e,
+	0x6000, 0xa086, 0x0004, 0x00c0, 0xa103, 0x1078, 0xa495, 0x601f,
+	0x0007, 0x1078, 0x1757, 0x6010, 0x2068, 0x1078, 0x8d06, 0x0040,
+	0xa10d, 0x047e, 0x1078, 0xa1ca, 0x047f, 0x0d7f, 0x1078, 0x8ec6,
+	0x88ff, 0x00c0, 0xa127, 0xace0, 0x0010, 0x2001, 0xa616, 0x2004,
+	0xac02, 0x00c8, 0xa11d, 0x0078, 0xa0c4, 0xa006, 0x127f, 0x027f,
+	0x067f, 0x077f, 0x087f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0xa8c5,
+	0x0001, 0x0078, 0xa11e, 0x077e, 0x057e, 0x087e, 0x2041, 0x0000,
+	0x2029, 0x0001, 0x2c20, 0x2019, 0x0002, 0x6218, 0x097e, 0x2049,
+	0x0000, 0x1078, 0x7246, 0x097f, 0x087f, 0x2039, 0x0000, 0x1078,
+	0x72f3, 0x1078, 0xa0b5, 0x057f, 0x077f, 0x007c, 0x027e, 0x047e,
+	0x057e, 0x077e, 0x0c7e, 0x157e, 0x2c20, 0x2128, 0x20a9, 0x007f,
+	0x2009, 0x0000, 0x017e, 0x037e, 0x1078, 0x45c4, 0x00c0, 0xa16e,
+	0x2c10, 0x057e, 0x087e, 0x2041, 0x0000, 0x2508, 0x2029, 0x0001,
+	0x097e, 0x2049, 0x0000, 0x1078, 0x7246, 0x097f, 0x087f, 0x2039,
+	0x0000, 0x1078, 0x72f3, 0x1078, 0xa0b5, 0x057f, 0x037f, 0x017f,
+	0x8108, 0x00f0, 0xa152, 0x157f, 0x0c7f, 0x077f, 0x057f, 0x047f,
+	0x027f, 0x007c, 0x077e, 0x057e, 0x6218, 0x087e, 0x2041, 0x0000,
+	0x2029, 0x0001, 0x2019, 0x0048, 0x097e, 0x2049, 0x0000, 0x1078,
+	0x7246, 0x097f, 0x087f, 0x2039, 0x0000, 0x1078, 0x72f3, 0x2c20,
+	0x1078, 0xa0b5, 0x057f, 0x077f, 0x007c, 0x027e, 0x047e, 0x057e,
+	0x077e, 0x0c7e, 0x157e, 0x2c20, 0x20a9, 0x007f, 0x2009, 0x0000,
+	0x017e, 0x037e, 0x1078, 0x45c4, 0x00c0, 0xa1be, 0x2c10, 0x087e,
+	0x2041, 0x0000, 0x2828, 0x047e, 0x2021, 0x0001, 0x1078, 0xa472,
+	0x047f, 0x097e, 0x2049, 0x0000, 0x1078, 0x7246, 0x097f, 0x087f,
+	0x2039, 0x0000, 0x1078, 0x72f3, 0x1078, 0xa0b5, 0x037f, 0x017f,
+	0x8108, 0x00f0, 0xa1a0, 0x157f, 0x0c7f, 0x077f, 0x057f, 0x047f,
+	0x027f, 0x007c, 0x017e, 0x0f7e, 0xad82, 0xcd00, 0x0048, 0xa1e3,
+	0xad82, 0xffff, 0x00c8, 0xa1e3, 0x6800, 0xa07d, 0x0040, 0xa1e0,
+	0x6803, 0x0000, 0x6b52, 0x1078, 0x4a73, 0x2f68, 0x0078, 0xa1d4,
+	0x6b52, 0x1078, 0x4a73, 0x0f7f, 0x017f, 0x007c, 0x0e7e, 0x047e,
+	0x037e, 0x2061, 0xad00, 0xa005, 0x00c0, 0xa1f6, 0x2071, 0xa600,
+	0x7448, 0x7064, 0x8001, 0xa402, 0x00c8, 0xa218, 0x2100, 0xac06,
+	0x0040, 0xa20a, 0x6000, 0xa086, 0x0000, 0x0040, 0xa20a, 0x6008,
+	0xa206, 0x00c0, 0xa20a, 0x6018, 0xa1a0, 0x0006, 0x2424, 0xa406,
+	0x0040, 0xa214, 0xace0, 0x0010, 0x2001, 0xa616, 0x2004, 0xac02,
+	0x00c8, 0xa218, 0x0078, 0xa1f6, 0xa085, 0x0001, 0x0078, 0xa219,
+	0xa006, 0x037f, 0x047f, 0x0e7f, 0x007c, 0x0d7e, 0x007e, 0x1078,
+	0x138b, 0x007f, 0x1040, 0x1332, 0x6837, 0x010d, 0x685e, 0x027e,
+	0x2010, 0x1078, 0x8cf2, 0x2001, 0x0000, 0x0040, 0xa233, 0x2200,
+	0xa080, 0x0008, 0x2004, 0x027f, 0x684a, 0x6956, 0x6c46, 0x684f,
+	0x0000, 0xa006, 0x68b2, 0x6802, 0x683a, 0x685a, 0x1078, 0x4a73,
+	0x0d7f, 0x007c, 0x6700, 0xa786, 0x0000, 0x0040, 0xa255, 0xa786,
+	0x0001, 0x0040, 0xa255, 0xa786, 0x000a, 0x0040, 0xa255, 0xa786,
+	0x0009, 0x0040, 0xa255, 0xa085, 0x0001, 0x007c, 0x0e7e, 0x6018,
+	0x2070, 0x70a0, 0xa206, 0x0e7f, 0x007c, 0x017e, 0x6004, 0xa08e,
+	0x001e, 0x00c0, 0xa277, 0x8007, 0x6130, 0xa18c, 0x00ff, 0xa105,
+	0x6032, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0005, 0x2001,
+	0xa8a3, 0x2004, 0x6016, 0x1078, 0x5d8a, 0x1078, 0x62d1, 0x017f,
+	0x007c, 0x0005, 0x0005, 0x007c, 0x6024, 0xd0e4, 0x0040, 0xa28d,
+	0xd0cc, 0x0040, 0xa287, 0x1078, 0x8fbf, 0x0078, 0xa28d, 0x1078,
+	0xa495, 0x1078, 0x5bc1, 0x1078, 0x772d, 0x007c, 0xa280, 0x0007,
+	0x2004, 0xa084, 0x000f, 0x0079, 0xa295, 0xa29e, 0xa29e, 0xa29e,
+	0xa2a0, 0xa29e, 0xa2a0, 0xa2a0, 0xa29e, 0xa2a0, 0xa006, 0x007c,
+	0xa085, 0x0001, 0x007c, 0xa280, 0x0007, 0x2004, 0xa084, 0x000f,
+	0x0079, 0xa2aa, 0xa2b3, 0xa2b3, 0xa2b3, 0xa2b3, 0xa2b3, 0xa2b3,
+	0xa2be, 0xa2b3, 0xa2b3, 0x6007, 0x003b, 0x602b, 0x0009, 0x6013,
+	0x2a00, 0x6003, 0x0001, 0x1078, 0x5d8a, 0x007c, 0x0c7e, 0x2260,
+	0x1078, 0xa495, 0x603f, 0x0000, 0x6024, 0xc0f4, 0xc0cc, 0x6026,
+	0x0c7f, 0x0d7e, 0x2268, 0xa186, 0x0007, 0x00c0, 0xa31f, 0x6810,
+	0xa005, 0x0040, 0xa2dc, 0xa080, 0x0013, 0x2004, 0xd0fc, 0x00c0,
+	0xa2dc, 0x0d7f, 0x0078, 0xa2b3, 0x6007, 0x003a, 0x6003, 0x0001,
+	0x1078, 0x5d8a, 0x1078, 0x62d1, 0x0c7e, 0x2d60, 0x6100, 0xa186,
+	0x0002, 0x00c0, 0xa3ad, 0x6010, 0xa005, 0x00c0, 0xa2f6, 0x6000,
+	0xa086, 0x0007, 0x10c0, 0x1332, 0x0078, 0xa3ad, 0xa08c, 0xf000,
+	0x00c0, 0xa302, 0x0078, 0xa302, 0x2068, 0x6800, 0xa005, 0x00c0,
+	0xa2fc, 0x2d00, 0xa080, 0x0013, 0x2004, 0xa084, 0x0003, 0xa086,
+	0x0002, 0x00c0, 0xa31b, 0x6010, 0x2068, 0x684c, 0xc0dc, 0xc0f4,
+	0x684e, 0x6850, 0xc0f4, 0xc0fc, 0x6852, 0x2009, 0x0043, 0x1078,
+	0x9c1e, 0x0078, 0xa3ad, 0x2009, 0x0041, 0x0078, 0xa3a7, 0xa186,
+	0x0005, 0x00c0, 0xa366, 0x6810, 0xa080, 0x0013, 0x2004, 0xd0bc,
+	0x00c0, 0xa32d, 0x0d7f, 0x0078, 0xa2b3, 0xd0b4, 0x0040, 0xa335,
+	0xd0fc, 0x1040, 0x1332, 0x0078, 0xa2cf, 0x6007, 0x003a, 0x6003,
+	0x0001, 0x1078, 0x5d8a, 0x1078, 0x62d1, 0x0c7e, 0x2d60, 0x6100,
+	0xa186, 0x0002, 0x0040, 0xa348, 0xa186, 0x0004, 0x00c0, 0xa3ad,
+	0x2071, 0xa8e7, 0x7000, 0xa086, 0x0003, 0x00c0, 0xa355, 0x7004,
+	0xac06, 0x00c0, 0xa355, 0x7003, 0x0000, 0x6810, 0xa080, 0x0013,
+	0x200c, 0xc1f4, 0xc1dc, 0x2102, 0x8000, 0x200c, 0xc1f4, 0xc1fc,
+	0xc1bc, 0x2102, 0x2009, 0x0042, 0x0078, 0xa3a7, 0x037e, 0x0d7e,
+	0x0d7e, 0x1078, 0x138b, 0x037f, 0x1040, 0x1332, 0x6837, 0x010d,
+	0x6803, 0x0000, 0x683b, 0x0000, 0x685b, 0x0000, 0x6b5e, 0x6857,
+	0x0045, 0x2c00, 0x6862, 0x6034, 0x6872, 0x2360, 0x6024, 0xc0dd,
+	0x6026, 0x6018, 0xa080, 0x0028, 0x2004, 0xa084, 0x00ff, 0x8007,
+	0x6320, 0x6b4a, 0x6846, 0x684f, 0x0000, 0x6d6a, 0x6e66, 0x686f,
+	0x0001, 0x1078, 0x4a73, 0x2019, 0x0045, 0x6008, 0x2068, 0x1078,
+	0x9dc7, 0x2d00, 0x600a, 0x601f, 0x0006, 0x6003, 0x0007, 0x6017,
+	0x0000, 0x603f, 0x0000, 0x0d7f, 0x037f, 0x0078, 0xa3ae, 0x603f,
+	0x0000, 0x6003, 0x0007, 0x1078, 0x9c1e, 0x0c7f, 0x0d7f, 0x007c,
+	0xa186, 0x0013, 0x00c0, 0xa3ba, 0x6004, 0xa082, 0x0085, 0x2008,
+	0x0079, 0xa3d4, 0xa186, 0x0027, 0x00c0, 0xa3cd, 0x1078, 0x61cd,
+	0x037e, 0x0d7e, 0x6010, 0x2068, 0x2019, 0x0004, 0x1078, 0xa1ca,
+	0x0d7f, 0x037f, 0x1078, 0x62d1, 0x007c, 0xa186, 0x0014, 0x0040,
+	0xa3be, 0x1078, 0x7773, 0x007c, 0xa3dd, 0xa3db, 0xa3db, 0xa3db,
+	0xa3db, 0xa3db, 0xa3dd, 0x1078, 0x1332, 0x1078, 0x61cd, 0x6003,
+	0x000c, 0x1078, 0x62d1, 0x007c, 0xa182, 0x008c, 0x00c8, 0xa3ee,
+	0xa182, 0x0085, 0x0048, 0xa3ee, 0x0079, 0xa3f1, 0x1078, 0x7773,
+	0x007c, 0xa3f8, 0xa3f8, 0xa3f8, 0xa3f8, 0xa3fa, 0xa419, 0xa3f8,
+	0x1078, 0x1332, 0x0d7e, 0x2c68, 0x1078, 0x76c7, 0x0040, 0xa414,
+	0x6003, 0x0001, 0x6007, 0x001e, 0x2009, 0xab8e, 0x210c, 0x6136,
+	0x2009, 0xab8f, 0x210c, 0x613a, 0x600b, 0xffff, 0x6918, 0x611a,
+	0x601f, 0x0004, 0x1078, 0x5d8a, 0x2d60, 0x1078, 0x772d, 0x0d7f,
+	0x007c, 0x1078, 0x772d, 0x007c, 0x0e7e, 0x6018, 0x2070, 0x7000,
+	0xd0ec, 0x0e7f, 0x007c, 0x6010, 0xa08c, 0xf000, 0x0040, 0xa471,
+	0xa080, 0x0013, 0x200c, 0xd1ec, 0x0040, 0xa471, 0x2001, 0xa672,
+	0x2004, 0xd0ec, 0x0040, 0xa471, 0x6003, 0x0002, 0x6024, 0xc0e5,
+	0x6026, 0xd1ac, 0x0040, 0xa44f, 0x0f7e, 0x2c78, 0x1078, 0x495f,
+	0x0f7f, 0x0040, 0xa44f, 0x2001, 0xa8a4, 0x2004, 0x603e, 0x2009,
+	0xa672, 0x210c, 0xd1f4, 0x00c0, 0xa46f, 0x0078, 0xa461, 0x2009,
+	0xa672, 0x210c, 0xd1f4, 0x0040, 0xa45b, 0x6024, 0xc0e4, 0x6026,
+	0xa006, 0x0078, 0xa471, 0x2001, 0xa8a4, 0x200c, 0x8103, 0xa100,
+	0x603e, 0x6018, 0xa088, 0x002b, 0x2104, 0xa005, 0x0040, 0xa46c,
+	0xa088, 0x0003, 0x0078, 0xa464, 0x2c0a, 0x600f, 0x0000, 0xa085,
+	0x0001, 0x007c, 0x017e, 0x0c7e, 0x0e7e, 0x6120, 0xa2f0, 0x002b,
+	0x2e04, 0x2060, 0x8cff, 0x0040, 0xa491, 0x84ff, 0x00c0, 0xa484,
+	0x6020, 0xa106, 0x00c0, 0xa48c, 0x600c, 0x2072, 0x1078, 0x5bc1,
+	0x1078, 0x772d, 0x0078, 0xa48e, 0xacf0, 0x0003, 0x2e64, 0x0078,
+	0xa47a, 0x0e7f, 0x0c7f, 0x017f, 0x007c, 0x0d7e, 0x6018, 0xa0e8,
+	0x002b, 0x2d04, 0xa005, 0x0040, 0xa4a7, 0xac06, 0x0040, 0xa4a5,
+	0x2d04, 0xa0e8, 0x0003, 0x0078, 0xa499, 0x600c, 0x206a, 0x0d7f,
+	0x007c, 0x027e, 0x037e, 0x157e, 0x2011, 0xa626, 0x2204, 0xa084,
+	0x00ff, 0x2019, 0xab8e, 0x2334, 0xa636, 0x00c0, 0xa4d5, 0x8318,
+	0x2334, 0x2204, 0xa084, 0xff00, 0xa636, 0x00c0, 0xa4d5, 0x2011,
+	0xab90, 0x6018, 0xa098, 0x000a, 0x20a9, 0x0004, 0x1078, 0x80de,
+	0x00c0, 0xa4d5, 0x2011, 0xab94, 0x6018, 0xa098, 0x0006, 0x20a9,
+	0x0004, 0x1078, 0x80de, 0x00c0, 0xa4d5, 0x157f, 0x037f, 0x027f,
+	0x007c, 0x0e7e, 0x2071, 0xa600, 0x1078, 0x42b8, 0x1078, 0x2677,
+	0x0e7f, 0x007c, 0x0e7e, 0x6018, 0x2070, 0x7000, 0xd0fc, 0x0040,
+	0xa4eb, 0x1078, 0xa4ed, 0x0e7f, 0x007c, 0x6850, 0xc0e5, 0x6852,
+	0x007c, 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x057e, 0x047e, 0x027e,
+	0x017e, 0x127e, 0x2091, 0x8000, 0x2029, 0xa8ba, 0x252c, 0x2021,
+	0xa8c0, 0x2424, 0x2061, 0xad00, 0x2071, 0xa600, 0x7648, 0x7064,
+	0xa606, 0x0040, 0xa545, 0x671c, 0xa786, 0x0001, 0x0040, 0xa514,
+	0xa786, 0x0008, 0x00c0, 0xa53b, 0x2500, 0xac06, 0x0040, 0xa53b,
+	0x2400, 0xac06, 0x0040, 0xa53b, 0x1078, 0xa242, 0x0040, 0xa53b,
+	0x1078, 0xa256, 0x00c0, 0xa53b, 0x6000, 0xa086, 0x0004, 0x00c0,
+	0xa52d, 0x017e, 0x1078, 0x1757, 0x017f, 0x1078, 0x8eec, 0x00c0,
+	0xa533, 0x1078, 0x28a6, 0x1078, 0x8f00, 0x00c0, 0xa539, 0x1078,
+	0x7c83, 0x1078, 0x8ec6, 0xace0, 0x0010, 0x2001, 0xa616, 0x2004,
+	0xac02, 0x00c8, 0xa545, 0x0078, 0xa504, 0x127f, 0x017f, 0x027f,
+	0x047f, 0x057f, 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x007c, 0x127e,
+	0x007e, 0x0e7e, 0x017e, 0x2091, 0x8000, 0x2071, 0xa640, 0xd5a4,
+	0x0040, 0xa55d, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0040, 0xa563,
+	0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040, 0xa579, 0x2500, 0xa084,
+	0x0007, 0xa08e, 0x0003, 0x0040, 0xa579, 0xa08e, 0x0004, 0x0040,
+	0xa579, 0xa08e, 0x0005, 0x0040, 0xa579, 0x2071, 0xa64a, 0x1078,
+	0xa5ba, 0x017f, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x127e, 0x007e,
+	0x0e7e, 0x017e, 0x2091, 0x8000, 0x2071, 0xa640, 0xd5a4, 0x0040,
+	0xa58c, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0040, 0xa592, 0x7030,
+	0x8000, 0x7032, 0xd5ac, 0x0040, 0xa5a8, 0x2500, 0xa084, 0x0007,
+	0xa08e, 0x0003, 0x0040, 0xa5a8, 0xa08e, 0x0004, 0x0040, 0xa5a8,
+	0xa08e, 0x0005, 0x0040, 0xa5a8, 0x2071, 0xa64a, 0x1078, 0xa5ba,
+	0x017f, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x127e, 0x007e, 0x0e7e,
+	0x2091, 0x8000, 0x2071, 0xa642, 0x1078, 0xa5ba, 0x0e7f, 0x007f,
+	0x127f, 0x007c, 0x2e04, 0x8000, 0x2072, 0x00c8, 0xa5c3, 0x8e70,
+	0x2e04, 0x8000, 0x2072, 0x007c, 0x0e7e, 0x2071, 0xa640, 0x1078,
+	0xa5ba, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0xa644, 0x1078, 0xa5ba,
+	0x0e7f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071,
+	0xa640, 0x7044, 0x8000, 0x7046, 0x0e7f, 0x007f, 0x127f, 0x007c,
+	0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
+	0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000,
+	0xa50c
+};
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2100tp_length01 = 0x95f1;
+#else
+unsigned short risc_code_length01 = 0x95f1;
+#endif
+
diff -Nru a/drivers/scsi/qla2xxx/ql2200.c b/drivers/scsi/qla2xxx/ql2200.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/ql2200.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,92 @@
+/*
+ * QLogic ISP2200 device driver for Linux 2.6.x
+ * Copyright (C) 2003 Christoph Hellwig.
+ * Copyright (C) 2003 QLogic Corporation (www.qlogic.com)
+ *
+ * Released under GPL v2.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+
+#include "qla_os.h"
+#include "qla_def.h"
+
+static char qla_driver_name[] = "qla2200";
+
+extern unsigned char  fw2200tp_version[];
+extern unsigned char  fw2200tp_version_str[];
+extern unsigned short fw2200tp_addr01;
+extern unsigned short fw2200tp_code01[];
+extern unsigned short fw2200tp_length01;
+
+static struct qla_fw_info qla_fw_tbl[] = {
+	{
+		.addressing	= FW_INFO_ADDR_NORMAL,
+		.fwcode		= &fw2200tp_code01[0],
+		.fwlen		= &fw2200tp_length01,
+		.fwstart	= &fw2200tp_addr01,
+	},
+
+	{ FW_INFO_ADDR_NOMORE, },
+};
+
+static struct qla_board_info qla_board_tbl = {
+	.drv_name	= qla_driver_name,
+
+	.isp_name	= "ISP2200",
+	.fw_info	= qla_fw_tbl,
+};
+
+static struct pci_device_id qla2200_pci_tbl[] = {
+	{
+		.vendor		= PCI_VENDOR_ID_QLOGIC,
+		.device		= PCI_DEVICE_ID_QLOGIC_ISP2200,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= (unsigned long)&qla_board_tbl,
+	},
+
+	{0, 0},
+};
+MODULE_DEVICE_TABLE(pci, qla2200_pci_tbl);
+
+static int __devinit
+qla2200_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
+{
+	return qla2x00_probe_one(pdev,
+	    (struct qla_board_info *)id->driver_data);
+}
+
+static void __devexit
+qla2200_remove_one(struct pci_dev *pdev)
+{
+	qla2x00_remove_one(pdev);
+}
+
+static struct pci_driver qla2200_pci_driver = {
+	.name		= "qla2200",
+	.id_table	= qla2200_pci_tbl,
+	.probe		= qla2200_probe_one,
+	.remove		= __devexit_p(qla2200_remove_one),
+};
+
+static int __init
+qla2200_init(void)
+{
+	return pci_module_init(&qla2200_pci_driver);
+}
+
+static void __exit
+qla2200_exit(void)
+{
+	pci_unregister_driver(&qla2200_pci_driver);
+}
+
+module_init(qla2200_init);
+module_exit(qla2200_exit);
+
+MODULE_AUTHOR("QLogic Corporation");
+MODULE_DESCRIPTION("QLogic ISP22xx FC-SCSI Host Bus Adapter driver");
+MODULE_LICENSE("GPL");
diff -Nru a/drivers/scsi/qla2xxx/ql2200_fw.c b/drivers/scsi/qla2xxx/ql2200_fw.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/ql2200_fw.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,5321 @@
+/******************************************************************************
+ *                  QLOGIC LINUX SOFTWARE
+ *
+ * QLogic ISP2x00 device driver for Linux 2.6.x
+ * Copyright (C) 2003 QLogic Corporation
+ * (www.qlogic.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ *************************************************************************/
+
+/*
+ *	Firmware Version 2.02.06 (08:46 Jun 26, 2003)
+ */
+
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2200tp_version = 2*1024+2;
+#else
+unsigned short risc_code_version = 2*1024+2;
+#endif
+
+#ifdef UNIQUE_FW_NAME
+unsigned char fw2200tp_version_str[] = {2,2,6};
+#else
+unsigned char firmware_version[] = {2,2,6};
+#endif
+
+#ifdef UNIQUE_FW_NAME
+#define fw2200tp_VERSION_STRING "2.02.06"
+#else
+#define FW_VERSION_STRING "2.02.06"
+#endif
+
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2200tp_addr01 = 0x1000 ;
+#else
+unsigned short risc_code_addr01 = 0x1000 ;
+#endif
+
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2200tp_code01[] = { 
+#else
+unsigned short risc_code01[] = { 
+#endif
+	0x0470, 0x0000, 0x0000, 0xa46f, 0x0000, 0x0002, 0x0002, 0x0006,
+	0x0017, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030,
+	0x3120, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241,
+	0x5449, 0x4f4e, 0x2049, 0x5350, 0x3232, 0x3030, 0x2046, 0x6972,
+	0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030,
+	0x322e, 0x3032, 0x2e30, 0x3620, 0x2020, 0x2020, 0x2400, 0x20c1,
+	0x0005, 0x2001, 0x017f, 0x2003, 0x0000, 0x20c9, 0xbaff, 0x2091,
+	0x2000, 0x2059, 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x296a,
+	0x2051, 0xb500, 0x2a70, 0x2029, 0xed00, 0x2031, 0xffff, 0x2039,
+	0xece9, 0x2021, 0x0200, 0x0804, 0x1468, 0x20a1, 0xb46f, 0xa00e,
+	0x20a9, 0x0891, 0x41a4, 0x3400, 0x7562, 0x7666, 0x775e, 0x746a,
+	0x746e, 0x20a1, 0xbd00, 0x7164, 0x810d, 0x810d, 0x810d, 0x810d,
+	0xa18c, 0x000f, 0x2001, 0x000b, 0xa112, 0xa00e, 0x21a8, 0x41a4,
+	0x3400, 0x8211, 0x1dd8, 0x7164, 0x3400, 0xa102, 0x0120, 0x0218,
+	0x20a8, 0xa00e, 0x41a4, 0x3800, 0xd08c, 0x01d8, 0x2009, 0xb500,
+	0x810d, 0x810d, 0x810d, 0x810d, 0xa18c, 0x000f, 0x2001, 0x0001,
+	0xa112, 0x20a1, 0x1000, 0xa00e, 0x21a8, 0x41a4, 0x8211, 0x1de0,
+	0x2009, 0xb500, 0x3400, 0xa102, 0x0120, 0x0218, 0x20a8, 0xa00e,
+	0x41a4, 0x080c, 0x1411, 0x080c, 0x1632, 0x080c, 0x17cf, 0x080c,
+	0x1fa2, 0x080c, 0x4bff, 0x080c, 0x85bf, 0x080c, 0x15bb, 0x080c,
+	0x2ec4, 0x080c, 0x5d8a, 0x080c, 0x5341, 0x080c, 0x68ce, 0x080c,
+	0x2510, 0x080c, 0x6b61, 0x080c, 0x63bb, 0x080c, 0x23ca, 0x080c,
+	0x24de, 0x2091, 0x3009, 0x7823, 0x0000, 0x1004, 0x10c5, 0x7820,
+	0xa086, 0x0002, 0x1150, 0x7823, 0x4000, 0x0e04, 0x10bd, 0x781b,
+	0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2a70, 0x7003, 0x0000,
+	0x2a70, 0x7000, 0xa08e, 0x0003, 0x1158, 0x080c, 0x3f08, 0x080c,
+	0x2eeb, 0x080c, 0x5dd8, 0x080c, 0x54f0, 0x080c, 0x68f9, 0x0c80,
+	0x000b, 0x0c98, 0x10e4, 0x10e5, 0x1210, 0x10e2, 0x12dd, 0x140e,
+	0x140f, 0x1410, 0x080c, 0x1515, 0x0005, 0x0126, 0x00f6, 0x2091,
+	0x8000, 0x7000, 0xa086, 0x0001, 0x1904, 0x11ed, 0x080c, 0x1588,
+	0x080c, 0x5acf, 0x0150, 0x080c, 0x5af5, 0x15c0, 0x2079, 0x0100,
+	0x7828, 0xa085, 0x1800, 0x782a, 0x0488, 0x080c, 0x5a07, 0x7000,
+	0xa086, 0x0001, 0x1904, 0x11ed, 0x708c, 0xa086, 0x0028, 0x1904,
+	0x11ed, 0x2001, 0x0161, 0x2003, 0x0001, 0x2079, 0x0100, 0x7827,
+	0xffff, 0x7a28, 0xa295, 0x1e2f, 0x7a2a, 0x2011, 0x59a2, 0x080c,
+	0x699c, 0x2011, 0x5995, 0x080c, 0x6a5c, 0x2011, 0x59e4, 0x080c,
+	0x699c, 0x2011, 0x4adc, 0x080c, 0x699c, 0x2011, 0x8030, 0x2019,
+	0x0000, 0x708b, 0x0000, 0x080c, 0x1de9, 0x00e8, 0x080c, 0x448f,
+	0x2079, 0x0100, 0x7844, 0xa005, 0x1904, 0x11ed, 0x2011, 0x4adc,
+	0x080c, 0x699c, 0x2011, 0x59e4, 0x080c, 0x699c, 0x080c, 0x1de9,
+	0x2001, 0xb78d, 0x2004, 0x780e, 0x7840, 0xa084, 0xfffb, 0x7842,
+	0x2011, 0x8010, 0x73cc, 0x080c, 0x3ecc, 0x723c, 0xc284, 0x723e,
+	0x2001, 0xb50c, 0x200c, 0xc1ac, 0x2102, 0x080c, 0x7f35, 0x2011,
+	0x0004, 0x080c, 0x9c60, 0x080c, 0x524d, 0x080c, 0x5acf, 0x0158,
+	0x080c, 0x4be8, 0x0140, 0x708b, 0x0001, 0x70c7, 0x0000, 0x080c,
+	0x462c, 0x0804, 0x11ed, 0x080c, 0x5309, 0x0120, 0x7a0c, 0xc2b4,
+	0x7a0e, 0x0060, 0x7073, 0x0000, 0x080c, 0xa008, 0x70d4, 0xd09c,
+	0x1128, 0x70a0, 0xa005, 0x0110, 0x080c, 0x4bc6, 0x70df, 0x0000,
+	0x70db, 0x0000, 0x72d4, 0x080c, 0x5acf, 0x1178, 0x2011, 0x0000,
+	0x0016, 0x080c, 0x28eb, 0x2019, 0xb78f, 0x211a, 0x001e, 0x7053,
+	0xffff, 0x7057, 0x00ef, 0x7077, 0x0000, 0x2079, 0xb552, 0x7804,
+	0xd0ac, 0x0108, 0xc295, 0x72d6, 0x080c, 0x5acf, 0x0118, 0xa296,
+	0x0004, 0x0548, 0x2011, 0x0001, 0x080c, 0x9c60, 0x709b, 0x0000,
+	0x709f, 0xffff, 0x7003, 0x0002, 0x2079, 0x0100, 0x7827, 0x0003,
+	0x7828, 0xa085, 0x0003, 0x782a, 0x00fe, 0x080c, 0x2ab8, 0x2011,
+	0x0005, 0x080c, 0x8075, 0x080c, 0x7173, 0x080c, 0x5acf, 0x0148,
+	0x00c6, 0x2061, 0x0100, 0x0016, 0x080c, 0x28eb, 0x61e2, 0x001e,
+	0x00ce, 0x012e, 0x0420, 0x709b, 0x0000, 0x709f, 0xffff, 0x7003,
+	0x0002, 0x00f6, 0x2079, 0x0100, 0x7827, 0x0003, 0x7828, 0xa085,
+	0x0003, 0x782a, 0x00fe, 0x2011, 0x0005, 0x080c, 0x8075, 0x080c,
+	0x7173, 0x080c, 0x5acf, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016,
+	0x080c, 0x28eb, 0x61e2, 0x001e, 0x00ce, 0x00fe, 0x012e, 0x0005,
+	0x00c6, 0x080c, 0x5acf, 0x1118, 0x20a9, 0x0100, 0x0010, 0x20a9,
+	0x0082, 0x080c, 0x5acf, 0x1118, 0x2009, 0x0000, 0x0010, 0x2009,
+	0x007e, 0x080c, 0x2d97, 0x8108, 0x1f04, 0x1201, 0x00ce, 0x7073,
+	0x0000, 0x7074, 0xa084, 0x00ff, 0x7076, 0x70a3, 0x0000, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x7000, 0xa086, 0x0002, 0x1904, 0x12db,
+	0x709c, 0xa086, 0xffff, 0x0130, 0x080c, 0x2ab8, 0x080c, 0x7173,
+	0x0804, 0x12db, 0x70d4, 0xd0ac, 0x1110, 0xd09c, 0x0540, 0xd084,
+	0x0530, 0x0006, 0x0016, 0x2001, 0x0103, 0x2009, 0xb78d, 0x210c,
+	0x2102, 0x001e, 0x000e, 0xd08c, 0x01d0, 0x70d8, 0xa086, 0xffff,
+	0x0190, 0x080c, 0x2c17, 0x080c, 0x7173, 0x70d4, 0xd094, 0x1904,
+	0x12db, 0x2011, 0x0001, 0x2019, 0x0000, 0x080c, 0x2c4f, 0x080c,
+	0x7173, 0x0804, 0x12db, 0x70dc, 0xa005, 0x1904, 0x12db, 0x7098,
+	0xa005, 0x1904, 0x12db, 0x70d4, 0xd0a4, 0x0118, 0xd0b4, 0x0904,
+	0x12db, 0x080c, 0x5309, 0x1904, 0x12db, 0x2001, 0xb553, 0x2004,
+	0xd0ac, 0x01c8, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x2009, 0x0000,
+	0x0016, 0x080c, 0x4fa9, 0x1118, 0x6000, 0xd0ec, 0x1138, 0x001e,
+	0x8108, 0x1f04, 0x1268, 0x00ce, 0x015e, 0x0028, 0x001e, 0x00ce,
+	0x015e, 0x0804, 0x12db, 0x0006, 0x0016, 0x2001, 0x0103, 0x2009,
+	0xb78d, 0x210c, 0x2102, 0x001e, 0x000e, 0x71a8, 0x81ff, 0x11b0,
+	0xa006, 0x2009, 0x0200, 0x20a9, 0x0002, 0x20a1, 0xb7de, 0x40a1,
+	0x2009, 0x0700, 0x20a9, 0x0002, 0x20a1, 0xb7ce, 0x40a1, 0x7070,
+	0x8007, 0x7174, 0x810f, 0x20a9, 0x0002, 0x40a1, 0x20a1, 0xb7d2,
+	0x2009, 0x0000, 0x080c, 0x14fb, 0x2001, 0x0000, 0x810f, 0x20a9,
+	0x0002, 0x40a1, 0x7030, 0xc08c, 0x7032, 0x7003, 0x0003, 0x709f,
+	0xffff, 0x080c, 0x1581, 0xa006, 0x080c, 0x27c3, 0x080c, 0x3f3e,
+	0x00f6, 0x2079, 0x0100, 0x080c, 0x5af5, 0x0150, 0x080c, 0x5acf,
+	0x7828, 0x0118, 0xa084, 0xe1ff, 0x0010, 0xa084, 0xffdf, 0x782a,
+	0x00fe, 0x2001, 0xb7e1, 0x2004, 0xa086, 0x0005, 0x1120, 0x2011,
+	0x0000, 0x080c, 0x8075, 0x2011, 0x0000, 0x080c, 0x807f, 0x080c,
+	0x7173, 0x080c, 0x7230, 0x012e, 0x0005, 0x0016, 0x0046, 0x00f6,
+	0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x2009, 0xb534, 0x2104,
+	0xa005, 0x1110, 0x080c, 0x2917, 0x2009, 0x00f7, 0x080c, 0x4baf,
+	0x7940, 0xa18c, 0x0010, 0x7942, 0x7924, 0xd1b4, 0x0110, 0x7827,
+	0x0040, 0xd19c, 0x0110, 0x7827, 0x0008, 0x0006, 0x0036, 0x0156,
+	0x7954, 0xd1ac, 0x1904, 0x134b, 0x080c, 0x5ae1, 0x0158, 0x080c,
+	0x5af5, 0x1128, 0x2001, 0xb79e, 0x2003, 0x0000, 0x0070, 0x080c,
+	0x5ad7, 0x0dc0, 0x2001, 0xb79e, 0x2003, 0xaaaa, 0x2001, 0xb79f,
+	0x2003, 0x0001, 0x080c, 0x5a07, 0x0058, 0x080c, 0x5acf, 0x0140,
+	0x2009, 0x00f8, 0x080c, 0x4baf, 0x7843, 0x0090, 0x7843, 0x0010,
+	0x20a9, 0x09c4, 0x7820, 0xd09c, 0x1138, 0x080c, 0x5acf, 0x0138,
+	0x7824, 0xd0ac, 0x1904, 0x13f5, 0x1f04, 0x132a, 0x0070, 0x7824,
+	0x080c, 0x5aeb, 0x0118, 0xd0ac, 0x1904, 0x13f5, 0xa084, 0x1800,
+	0x0d98, 0x7003, 0x0001, 0x0804, 0x13f5, 0x2001, 0x0001, 0x080c,
+	0x27c3, 0x0804, 0x1404, 0x7850, 0xa084, 0x0180, 0x7852, 0x782f,
+	0x0020, 0x20a9, 0x0046, 0x1d04, 0x1353, 0x080c, 0x6a44, 0x1f04,
+	0x1353, 0x7850, 0xa084, 0x0180, 0xa085, 0x0400, 0x7852, 0x782f,
+	0x0000, 0x080c, 0x5ae1, 0x0158, 0x080c, 0x5af5, 0x1128, 0x2001,
+	0xb79e, 0x2003, 0x0000, 0x0070, 0x080c, 0x5ad7, 0x0dc0, 0x2001,
+	0xb79e, 0x2003, 0xaaaa, 0x2001, 0xb79f, 0x2003, 0x0001, 0x080c,
+	0x5a07, 0x0020, 0x2009, 0x00f8, 0x080c, 0x4baf, 0x20a9, 0x000e,
+	0xe000, 0x1f04, 0x1380, 0x7850, 0xa084, 0x0180, 0xa085, 0x1400,
+	0x7852, 0x080c, 0x5acf, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010,
+	0x2021, 0xe678, 0x2019, 0xea60, 0x7820, 0xd09c, 0x1558, 0x080c,
+	0x5acf, 0x05d8, 0x7824, 0xd0ac, 0x1904, 0x13f5, 0x080c, 0x5af5,
+	0x1508, 0x0046, 0x2021, 0x0190, 0x8421, 0x1df0, 0x004e, 0x8421,
+	0x11c8, 0x7827, 0x0048, 0x20a9, 0x01f4, 0x1d04, 0x13ad, 0x080c,
+	0x6a44, 0x1f04, 0x13ad, 0x7824, 0xa084, 0x0068, 0x15c8, 0x2001,
+	0xb79e, 0x2003, 0xaaaa, 0x2001, 0xb79f, 0x2003, 0x0001, 0x7003,
+	0x0001, 0x0498, 0x1d04, 0x13c6, 0x080c, 0x6a44, 0x8319, 0x1960,
+	0x2009, 0xb534, 0x2104, 0x8000, 0x200a, 0xa084, 0xfff0, 0x0120,
+	0x200b, 0x0000, 0x080c, 0x2917, 0x00d8, 0x080c, 0x5ae1, 0x1140,
+	0xa4a2, 0x0064, 0x1128, 0x080c, 0x5aa6, 0x7003, 0x0001, 0x00a8,
+	0x7827, 0x1800, 0xe000, 0xe000, 0x7824, 0x080c, 0x5aeb, 0x0110,
+	0xd0ac, 0x1158, 0xa084, 0x1800, 0x09a8, 0x7003, 0x0001, 0x0028,
+	0x2001, 0x0001, 0x080c, 0x27c3, 0x0048, 0x2001, 0xb534, 0x2003,
+	0x0000, 0x7827, 0x0048, 0x7828, 0xc09d, 0x782a, 0x7850, 0xa084,
+	0x0180, 0xa085, 0x0400, 0x7852, 0x015e, 0x003e, 0x000e, 0x080c,
+	0x1558, 0x012e, 0x00fe, 0x004e, 0x001e, 0x0005, 0x0005, 0x0005,
+	0x0005, 0x2a70, 0x2061, 0xb7c1, 0x2063, 0x0002, 0x6007, 0x0002,
+	0x600b, 0x0006, 0x600f, 0x0017, 0x2001, 0xb79e, 0x2003, 0x0000,
+	0x708b, 0x0000, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0218,
+	0x7053, 0xffff, 0x0010, 0x7053, 0x0000, 0x705b, 0xffff, 0x7073,
+	0x0000, 0x7077, 0x0000, 0x080c, 0xa008, 0x2061, 0xb78e, 0x6003,
+	0x0909, 0x6007, 0x0000, 0x600b, 0x8800, 0x600f, 0x0200, 0x6013,
+	0x00ff, 0x6017, 0x000f, 0x601b, 0x0000, 0x601f, 0x07d0, 0x2061,
+	0xb796, 0x6003, 0x8000, 0x6007, 0x0000, 0x600b, 0x0000, 0x600f,
+	0x0200, 0x6013, 0x00ff, 0x6017, 0x0000, 0x601b, 0x0001, 0x601f,
+	0x0000, 0x2061, 0xb7b9, 0x6003, 0x514c, 0x6007, 0x4f47, 0x600b,
+	0x4943, 0x600f, 0x2020, 0x2001, 0xb528, 0x2003, 0x0000, 0x0005,
+	0x04a0, 0x2011, 0x0000, 0x81ff, 0x0570, 0xa186, 0x0001, 0x1148,
+	0x2031, 0x8fff, 0x2039, 0xd501, 0x2021, 0x0100, 0x2029, 0xd500,
+	0x00e8, 0xa186, 0x0002, 0x1118, 0x2011, 0x0000, 0x00b8, 0xa186,
+	0x0005, 0x1118, 0x2011, 0x0001, 0x0088, 0xa186, 0x0009, 0x1118,
+	0x2011, 0x0002, 0x0058, 0xa186, 0x000a, 0x1118, 0x2011, 0x0002,
+	0x0028, 0xa186, 0x0055, 0x1110, 0x2011, 0x0003, 0x3800, 0xa084,
+	0xfffc, 0xa205, 0x20c0, 0x0804, 0x104d, 0xa00e, 0x2011, 0x0003,
+	0x2019, 0x14a4, 0x0804, 0x14f5, 0x2019, 0xaaaa, 0x2061, 0xffff,
+	0x2c14, 0x2362, 0xe000, 0xe000, 0x2c04, 0xa306, 0x2262, 0x1110,
+	0xc1b5, 0xc1a5, 0x2011, 0x0000, 0x2019, 0x14b7, 0x04f0, 0x2019,
+	0xaaaa, 0x2061, 0xffff, 0x2c14, 0x2362, 0xe000, 0xe000, 0x2c1c,
+	0x2061, 0x7fff, 0xe000, 0xe000, 0x2c04, 0x2061, 0xffff, 0x2262,
+	0xa306, 0x0110, 0xc18d, 0x0008, 0xc185, 0x2011, 0x0002, 0x2019,
+	0x14d2, 0x0418, 0x2061, 0xffff, 0x2019, 0xaaaa, 0x2c14, 0x2362,
+	0xe000, 0xe000, 0x2c04, 0x2262, 0xa306, 0x1180, 0x2c14, 0x2362,
+	0xe000, 0xe000, 0x2c1c, 0x2061, 0x7fff, 0x2c04, 0x2061, 0xffff,
+	0x2262, 0xa306, 0x1110, 0xc195, 0x0008, 0xc19d, 0x2011, 0x0001,
+	0x2019, 0x14f3, 0x0010, 0x0804, 0x1469, 0x3800, 0xa084, 0xfffc,
+	0xa205, 0x20c0, 0x0837, 0x2011, 0x0000, 0x080c, 0x4fa9, 0x1178,
+	0x6004, 0xa0c4, 0x00ff, 0xa8c6, 0x0006, 0x0128, 0xa0c4, 0xff00,
+	0xa8c6, 0x0600, 0x1120, 0xa186, 0x0080, 0x0108, 0x8210, 0x8108,
+	0xa186, 0x0100, 0x1d50, 0x2208, 0x0005, 0x2091, 0x8000, 0x0e04,
+	0x1517, 0x0006, 0x0016, 0x2079, 0x0000, 0x7818, 0xd084, 0x1de8,
+	0x001e, 0x792e, 0x000e, 0x782a, 0x000e, 0x7826, 0x3900, 0x783a,
+	0x7823, 0x8002, 0x781b, 0x0001, 0x2091, 0x5000, 0x0126, 0x0156,
+	0x0146, 0x20a9, 0x0010, 0x20a1, 0xb90c, 0x2091, 0x2000, 0x40a1,
+	0x20a9, 0x0010, 0x2091, 0x2200, 0x40a1, 0x20a9, 0x0010, 0x2091,
+	0x2400, 0x40a1, 0x20a9, 0x0010, 0x2091, 0x2600, 0x40a1, 0x20a9,
+	0x0010, 0x2091, 0x2800, 0x40a1, 0x014e, 0x015e, 0x012e, 0x2079,
+	0xb500, 0x7803, 0x0005, 0x2091, 0x4080, 0x04c9, 0x0cf8, 0x0005,
+	0x0006, 0x080c, 0x15a3, 0x1518, 0x00f6, 0x2079, 0xb524, 0x2f04,
+	0x8000, 0x207a, 0xa082, 0x000f, 0x0258, 0xa006, 0x207a, 0x2079,
+	0xb526, 0x2f04, 0xa084, 0x0001, 0xa086, 0x0001, 0x207a, 0x0070,
+	0x2079, 0xb526, 0x2f7c, 0x8fff, 0x1128, 0x2001, 0x0c03, 0x2003,
+	0x0040, 0x0020, 0x2001, 0x0c03, 0x2003, 0x00c0, 0x00fe, 0x000e,
+	0x0005, 0x0409, 0x1120, 0x2001, 0x0c03, 0x2003, 0x0080, 0x0005,
+	0x00d1, 0x1120, 0x2001, 0x0c03, 0x2003, 0x0040, 0x0005, 0x0006,
+	0x0091, 0x1178, 0x2001, 0x0c03, 0x2003, 0x0040, 0x2009, 0x0fff,
+	0x00a1, 0x2001, 0x0c03, 0x2003, 0x0080, 0x2009, 0x0fff, 0x0069,
+	0x0c88, 0x000e, 0x0005, 0x00c6, 0x2061, 0x0c00, 0x2c04, 0xa084,
+	0x00ff, 0xa086, 0x00aa, 0x00ce, 0x0005, 0x0156, 0x0126, 0xa18c,
+	0x0fff, 0x21a8, 0x1d04, 0x15b2, 0x2091, 0x6000, 0x1f04, 0x15b2,
+	0x012e, 0x015e, 0x0005, 0x2071, 0xb500, 0x7160, 0x712e, 0x2021,
+	0x0001, 0xa190, 0x0030, 0xa298, 0x0030, 0x0240, 0x7064, 0xa302,
+	0x1228, 0x220a, 0x2208, 0x2310, 0x8420, 0x0ca8, 0x3800, 0xd08c,
+	0x0148, 0x7064, 0xa086, 0xb500, 0x0128, 0x7067, 0xb500, 0x2011,
+	0x1000, 0x0c48, 0x200b, 0x0000, 0x74b2, 0x74b6, 0x0005, 0x00e6,
+	0x0126, 0x2091, 0x8000, 0x2071, 0xb500, 0x70b4, 0xa0ea, 0x0010,
+	0x0268, 0x8001, 0x70b6, 0x702c, 0x2068, 0x2d04, 0x702e, 0x206b,
+	0x0000, 0x6807, 0x0000, 0x012e, 0x00ee, 0x0005, 0xa06e, 0x0cd8,
+	0x00e6, 0x2071, 0xb500, 0x0126, 0x2091, 0x8000, 0x70b4, 0x8001,
+	0x0260, 0x70b6, 0x702c, 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000,
+	0x6807, 0x0000, 0x012e, 0x00ee, 0x0005, 0xa06e, 0x0cd8, 0x00e6,
+	0x0126, 0x2091, 0x8000, 0x2071, 0xb500, 0x702c, 0x206a, 0x2d00,
+	0x702e, 0x70b4, 0x8000, 0x70b6, 0x012e, 0x00ee, 0x0005, 0x8dff,
+	0x0138, 0x6804, 0x6807, 0x0000, 0x0006, 0x0c49, 0x00de, 0x0cb8,
+	0x0005, 0x00e6, 0x2071, 0xb500, 0x70b4, 0xa08a, 0x0010, 0xa00d,
+	0x00ee, 0x0005, 0x00e6, 0x2071, 0xb812, 0x7007, 0x0000, 0x701b,
+	0x0000, 0x701f, 0x0000, 0x2071, 0x0000, 0x7010, 0xa085, 0x8004,
+	0x7012, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x00e6, 0x2270,
+	0x700b, 0x0000, 0x2071, 0xb812, 0x7018, 0xa088, 0xb81b, 0x220a,
+	0x8000, 0xa084, 0x0007, 0x701a, 0x7004, 0xa005, 0x1128, 0x00f6,
+	0x2079, 0x0010, 0x0089, 0x00fe, 0x00ee, 0x012e, 0x0005, 0x00e6,
+	0x2071, 0xb812, 0x7004, 0xa005, 0x1128, 0x00f6, 0x2079, 0x0010,
+	0x0019, 0x00fe, 0x00ee, 0x0005, 0x7000, 0x0002, 0x1672, 0x16d6,
+	0x16f3, 0x16f3, 0x7018, 0x711c, 0xa106, 0x1118, 0x7007, 0x0000,
+	0x0005, 0x00d6, 0xa180, 0xb81b, 0x2004, 0x700a, 0x2068, 0x8108,
+	0xa18c, 0x0007, 0x711e, 0x7803, 0x0026, 0x6824, 0x7832, 0x6828,
+	0x7836, 0x682c, 0x783a, 0x6830, 0x783e, 0x6810, 0x700e, 0x680c,
+	0x7016, 0x6804, 0x00de, 0xd084, 0x0120, 0x7007, 0x0001, 0x0029,
+	0x0005, 0x7007, 0x0002, 0x00b1, 0x0005, 0x0016, 0x0026, 0x710c,
+	0x2011, 0x0040, 0xa182, 0x0040, 0x1210, 0x2110, 0xa006, 0x700e,
+	0x7212, 0x8203, 0x7822, 0x7803, 0x0020, 0x7803, 0x0041, 0x002e,
+	0x001e, 0x0005, 0x0016, 0x0026, 0x0136, 0x0146, 0x0156, 0x7014,
+	0x2098, 0x20a1, 0x0014, 0x7803, 0x0026, 0x710c, 0x2011, 0x0040,
+	0xa182, 0x0040, 0x1210, 0x2110, 0xa006, 0x700e, 0x22a8, 0x53a6,
+	0x8203, 0x7822, 0x7803, 0x0020, 0x3300, 0x7016, 0x7803, 0x0001,
+	0x015e, 0x014e, 0x013e, 0x002e, 0x001e, 0x0005, 0x0136, 0x0146,
+	0x0156, 0x2099, 0xb5fa, 0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3,
+	0x7803, 0x0020, 0x0126, 0x2091, 0x8000, 0x7803, 0x0041, 0x7007,
+	0x0003, 0x7000, 0xc084, 0x7002, 0x700b, 0xb5f5, 0x012e, 0x015e,
+	0x014e, 0x013e, 0x0005, 0x0136, 0x0146, 0x0156, 0x2001, 0xb629,
+	0x209c, 0x20a1, 0x0014, 0x7803, 0x0026, 0x2001, 0xb62a, 0x20ac,
+	0x53a6, 0x2099, 0xb62b, 0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3,
+	0x7803, 0x0020, 0x0126, 0x2091, 0x8000, 0x7803, 0x0001, 0x7007,
+	0x0004, 0x7000, 0xc08c, 0x7002, 0x700b, 0xb626, 0x012e, 0x015e,
+	0x014e, 0x013e, 0x0005, 0x0016, 0x00e6, 0x2071, 0xb812, 0x00f6,
+	0x2079, 0x0010, 0x7904, 0x7803, 0x0002, 0xd1fc, 0x0120, 0xa18c,
+	0x0700, 0x7004, 0x0023, 0x00fe, 0x00ee, 0x001e, 0x0005, 0x166c,
+	0x1736, 0x1764, 0x178e, 0x17be, 0x1735, 0x0cf8, 0xa18c, 0x0700,
+	0x1528, 0x0136, 0x0146, 0x0156, 0x7014, 0x20a0, 0x2099, 0x0014,
+	0x7803, 0x0040, 0x7010, 0x20a8, 0x53a5, 0x3400, 0x7016, 0x015e,
+	0x014e, 0x013e, 0x700c, 0xa005, 0x0570, 0x7830, 0x7832, 0x7834,
+	0x7836, 0x080c, 0x169d, 0x0005, 0x7008, 0xa080, 0x0002, 0x2003,
+	0x0100, 0x7007, 0x0000, 0x080c, 0x166c, 0x0005, 0x7008, 0xa080,
+	0x0002, 0x2003, 0x0200, 0x0ca8, 0xa18c, 0x0700, 0x1150, 0x700c,
+	0xa005, 0x0188, 0x7830, 0x7832, 0x7834, 0x7836, 0x080c, 0x16b2,
+	0x0005, 0x7008, 0xa080, 0x0002, 0x2003, 0x0200, 0x7007, 0x0000,
+	0x080c, 0x166c, 0x0005, 0x00d6, 0x7008, 0x2068, 0x7830, 0x6826,
+	0x7834, 0x682a, 0x7838, 0x682e, 0x783c, 0x6832, 0x680b, 0x0100,
+	0x00de, 0x7007, 0x0000, 0x080c, 0x166c, 0x0005, 0xa18c, 0x0700,
+	0x1540, 0x0136, 0x0146, 0x0156, 0x2001, 0xb5f8, 0x2004, 0xa080,
+	0x000d, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x20a9, 0x0020,
+	0x53a5, 0x2001, 0xb5fa, 0x2004, 0xd0bc, 0x0148, 0x2001, 0xb603,
+	0x2004, 0xa080, 0x000d, 0x20a0, 0x20a9, 0x0020, 0x53a5, 0x015e,
+	0x014e, 0x013e, 0x7007, 0x0000, 0x080c, 0x5e6f, 0x080c, 0x166c,
+	0x0005, 0x2011, 0x8003, 0x080c, 0x3ecc, 0x0cf8, 0xa18c, 0x0700,
+	0x1148, 0x2001, 0xb628, 0x2003, 0x0100, 0x7007, 0x0000, 0x080c,
+	0x166c, 0x0005, 0x2011, 0x8004, 0x080c, 0x3ecc, 0x0cf8, 0x0126,
+	0x2091, 0x2200, 0x2079, 0x0030, 0x2071, 0xb823, 0x7003, 0x0000,
+	0x700f, 0xb82f, 0x7013, 0xb82f, 0x780f, 0x00f6, 0x7803, 0x0004,
+	0x012e, 0x0005, 0x6934, 0xa184, 0x0007, 0x0002, 0x17ee, 0x182c,
+	0x17ee, 0x17ee, 0x17ee, 0x1814, 0x17fb, 0x17f2, 0xa085, 0x0001,
+	0x0804, 0x1846, 0x684c, 0xd0bc, 0x0dc8, 0x6860, 0x682e, 0x685c,
+	0x682a, 0x6858, 0x04c8, 0xa18c, 0x00ff, 0xa186, 0x001e, 0x1d70,
+	0x684c, 0xd0bc, 0x0d58, 0x6860, 0x682e, 0x685c, 0x682a, 0x6804,
+	0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x22e5,
+	0x2005, 0x6832, 0x6858, 0x0440, 0xa18c, 0x00ff, 0xa186, 0x0015,
+	0x19a8, 0x684c, 0xd0ac, 0x0990, 0x6804, 0x681a, 0xa080, 0x000d,
+	0x2004, 0xa084, 0x000f, 0xa080, 0x22e5, 0x2005, 0x6832, 0xa006,
+	0x682e, 0x682a, 0x6858, 0x0080, 0x684c, 0xd0ac, 0x0904, 0x17ee,
+	0xa006, 0x682e, 0x682a, 0x6858, 0xa18c, 0x000f, 0xa188, 0x22e5,
+	0x210d, 0x6932, 0x2d08, 0x691a, 0x6826, 0x684c, 0xc0dd, 0x684e,
+	0xa006, 0x680a, 0x697c, 0x6912, 0x6980, 0x6916, 0x0005, 0x684c,
+	0xd0ac, 0x090c, 0x1515, 0x6833, 0x22e2, 0x2d08, 0x691a, 0x6858,
+	0x8001, 0x6826, 0x684c, 0xc0dd, 0x684e, 0xa006, 0x680a, 0x682e,
+	0x682a, 0x697c, 0x6912, 0x6980, 0x6916, 0x0005, 0x20e1, 0x0007,
+	0x20e1, 0x2000, 0x2001, 0x020a, 0x2004, 0x82ff, 0x01e8, 0xa280,
+	0x0004, 0x00d6, 0x206c, 0x684c, 0xd0dc, 0x1190, 0xa280, 0x0007,
+	0x2004, 0xa086, 0x000a, 0x1110, 0x0891, 0x0010, 0x080c, 0x17e2,
+	0x0138, 0x00de, 0xa280, 0x0000, 0x2003, 0x0002, 0xa016, 0x0020,
+	0x6808, 0x8000, 0x680a, 0x00de, 0x0126, 0x0046, 0x0036, 0x0026,
+	0x2091, 0x2200, 0x002e, 0x003e, 0x004e, 0x7000, 0xa005, 0x01d0,
+	0x710c, 0x220a, 0x8108, 0x230a, 0x8108, 0x240a, 0x8108, 0xa182,
+	0xb84a, 0x0210, 0x2009, 0xb82f, 0x710e, 0x7010, 0xa102, 0xa082,
+	0x0009, 0x0118, 0xa080, 0x001b, 0x1118, 0x2009, 0x0138, 0x200a,
+	0x012e, 0x0005, 0x7206, 0x2001, 0x18a8, 0x0006, 0x2260, 0x0804,
+	0x19d5, 0x0126, 0x0026, 0x0036, 0x00c6, 0x0006, 0x2091, 0x2200,
+	0x000e, 0x004e, 0x003e, 0x002e, 0x00d6, 0x00c6, 0x2460, 0x6110,
+	0x2168, 0x6a62, 0x6b5e, 0xa005, 0x0904, 0x190a, 0x6808, 0xa005,
+	0x0904, 0x1941, 0x7000, 0xa005, 0x1108, 0x0488, 0x700c, 0x7110,
+	0xa106, 0x1904, 0x1949, 0x7004, 0xa406, 0x1548, 0x2001, 0x0005,
+	0x2004, 0xd08c, 0x0168, 0x0046, 0x080c, 0x1b06, 0x004e, 0x2460,
+	0x6010, 0xa080, 0x0002, 0x2004, 0xa005, 0x0904, 0x1941, 0x0c10,
+	0x2001, 0x0207, 0x2004, 0xd09c, 0x1d48, 0x7804, 0xa084, 0x6000,
+	0x0120, 0xa086, 0x6000, 0x0108, 0x0c08, 0x7818, 0x6812, 0x781c,
+	0x6816, 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, 0x2060, 0x6100,
+	0xa18e, 0x0004, 0x1904, 0x1949, 0x2009, 0x0048, 0x080c, 0x864c,
+	0x0804, 0x1949, 0x6808, 0xa005, 0x05a0, 0x7000, 0xa005, 0x0588,
+	0x700c, 0x7110, 0xa106, 0x1118, 0x7004, 0xa406, 0x1550, 0x2001,
+	0x0005, 0x2004, 0xd08c, 0x0160, 0x0046, 0x080c, 0x1b06, 0x004e,
+	0x2460, 0x6010, 0xa080, 0x0002, 0x2004, 0xa005, 0x01d0, 0x0c28,
+	0x2001, 0x0207, 0x2004, 0xd09c, 0x1d50, 0x2001, 0x0005, 0x2004,
+	0xd08c, 0x1d50, 0x7804, 0xa084, 0x6000, 0x0118, 0xa086, 0x6000,
+	0x19f0, 0x7818, 0x6812, 0x781c, 0x6816, 0x7803, 0x0004, 0x7003,
+	0x0000, 0x6100, 0xa18e, 0x0004, 0x1120, 0x2009, 0x0048, 0x080c,
+	0x864c, 0x00ce, 0x00de, 0x012e, 0x0005, 0x00f6, 0x00e6, 0x0026,
+	0x0036, 0x0046, 0x0056, 0x2071, 0xb823, 0x7000, 0xa086, 0x0000,
+	0x0904, 0x19b3, 0x7004, 0xac06, 0x1904, 0x19a5, 0x2079, 0x0030,
+	0x7000, 0xa086, 0x0003, 0x0904, 0x19a5, 0x7804, 0xd0fc, 0x15c8,
+	0x20e1, 0x6000, 0x2011, 0x0032, 0x2001, 0x0208, 0x200c, 0x2001,
+	0x0209, 0x2004, 0xa106, 0x1d88, 0x8211, 0x1db0, 0x7804, 0xd0fc,
+	0x1540, 0x080c, 0x1e6e, 0x0026, 0x0056, 0x7803, 0x0004, 0x7804,
+	0xd0ac, 0x1de8, 0x7803, 0x0002, 0x7803, 0x0009, 0x7003, 0x0003,
+	0x7007, 0x0000, 0x005e, 0x002e, 0x2001, 0x015d, 0x2003, 0x0000,
+	0x080c, 0x5acf, 0x1138, 0x0066, 0x2031, 0x0001, 0x080c, 0x5b51,
+	0x006e, 0x0058, 0x2001, 0x0160, 0x2502, 0x2001, 0x0138, 0x2202,
+	0x0020, 0x080c, 0x1b06, 0x0804, 0x1955, 0x0156, 0x20a9, 0x0009,
+	0x2009, 0xb82f, 0x2104, 0xac06, 0x1108, 0x200a, 0xa188, 0x0003,
+	0x1f04, 0x19aa, 0x015e, 0x005e, 0x004e, 0x003e, 0x002e, 0x00ee,
+	0x00fe, 0x0005, 0x700c, 0x7110, 0xa106, 0x0904, 0x1a49, 0x2104,
+	0x7006, 0x2060, 0x8108, 0x211c, 0x8108, 0x2124, 0x8108, 0xa182,
+	0xb84a, 0x0210, 0x2009, 0xb82f, 0x7112, 0x700c, 0xa106, 0x1128,
+	0x080c, 0x28eb, 0x2001, 0x0138, 0x2102, 0x8cff, 0x0598, 0x6010,
+	0x2068, 0x2d58, 0x6828, 0xa406, 0x1590, 0x682c, 0xa306, 0x1578,
+	0x7004, 0x2060, 0x6020, 0xc0d4, 0x6022, 0x684c, 0xd0f4, 0x0128,
+	0x6817, 0xffff, 0x6813, 0xffff, 0x00e8, 0x6850, 0xd0f4, 0x1130,
+	0x7803, 0x0004, 0x6810, 0x781a, 0x6814, 0x781e, 0x6824, 0x2050,
+	0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, 0x2009,
+	0x0011, 0x080c, 0x1a4c, 0x0120, 0x2009, 0x0001, 0x080c, 0x1a4c,
+	0x2d58, 0x0005, 0x080c, 0x1ddd, 0x0904, 0x19ba, 0x0cd0, 0x6020,
+	0xd0f4, 0x11e0, 0xd0d4, 0x01b8, 0x6038, 0xa402, 0x6034, 0xa303,
+	0x0108, 0x1288, 0x643a, 0x6336, 0x6c2a, 0x6b2e, 0x0046, 0x0036,
+	0x2400, 0x6c7c, 0xa402, 0x6812, 0x2300, 0x6b80, 0xa303, 0x6816,
+	0x003e, 0x004e, 0x0018, 0x080c, 0x9f9a, 0x09e0, 0x601c, 0xa08e,
+	0x0008, 0x0904, 0x19e0, 0xa08e, 0x000a, 0x0904, 0x19e0, 0x2001,
+	0xb574, 0x2004, 0xd0b4, 0x1140, 0x6018, 0x2004, 0xd0bc, 0x1120,
+	0x6817, 0x7fff, 0x6813, 0xffff, 0x080c, 0x2305, 0x1918, 0x0804,
+	0x19e0, 0x7003, 0x0000, 0x0005, 0x8aff, 0x0904, 0x1ae0, 0xa03e,
+	0x2730, 0xc9fc, 0x6850, 0xd0fc, 0x11b8, 0xd0f4, 0x1528, 0x00d6,
+	0x2805, 0xac68, 0x2900, 0x0002, 0x1a9e, 0x1a82, 0x1a82, 0x1a9e,
+	0x1a9e, 0x1a96, 0x1a9e, 0x1a82, 0x1a9e, 0x1a87, 0x1a87, 0x1a9e,
+	0x1a9e, 0x1a9e, 0x1a8e, 0x1a87, 0x7803, 0x0004, 0xc0fc, 0x6852,
+	0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0x00d6, 0xd99c, 0x0550, 0x2805,
+	0xac68, 0x6f08, 0x6e0c, 0x0430, 0xc0f4, 0x6852, 0x6b6c, 0x6a70,
+	0x00d6, 0x0468, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x00d0, 0x6b10,
+	0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x00a0, 0x00de, 0x00d6,
+	0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, 0x1140, 0x00de, 0x080c,
+	0x22a7, 0x1904, 0x1a4c, 0xa00e, 0x0804, 0x1ae0, 0x00de, 0x080c,
+	0x1515, 0xc9fd, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e,
+	0x7316, 0x721a, 0x751e, 0x7422, 0x7726, 0x762a, 0x7902, 0x7100,
+	0x8108, 0x7102, 0x00de, 0x6828, 0xa300, 0x682a, 0x682c, 0xa201,
+	0x682e, 0x8109, 0x2d08, 0x1500, 0xd9fc, 0x0160, 0xc9fc, 0x080c,
+	0x22a7, 0x01e8, 0x2805, 0xac68, 0x6800, 0xa506, 0x11c0, 0x6804,
+	0xa406, 0x00a8, 0xc9fc, 0x080c, 0x22a7, 0x0188, 0x2805, 0xac68,
+	0x6800, 0xa506, 0x1160, 0x6804, 0xa406, 0x1148, 0x6808, 0xa706,
+	0x1130, 0x680c, 0xa606, 0x0018, 0xc9fc, 0x080c, 0x22a7, 0x2168,
+	0x0005, 0x080c, 0x1515, 0x080c, 0x1f55, 0x7004, 0x2060, 0x00d6,
+	0x6010, 0x2068, 0x7003, 0x0000, 0x080c, 0x1dfe, 0x080c, 0x9c5a,
+	0x0170, 0x6808, 0x8001, 0x680a, 0x697c, 0x6912, 0x6980, 0x6916,
+	0x682b, 0xffff, 0x682f, 0xffff, 0x6850, 0xc0bd, 0x6852, 0x00de,
+	0x080c, 0x992a, 0x0804, 0x1d2b, 0x080c, 0x1515, 0x0126, 0x2091,
+	0x2200, 0x0006, 0x0016, 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803,
+	0x0002, 0xa184, 0x0700, 0x1978, 0xa184, 0x0003, 0xa086, 0x0003,
+	0x0d58, 0x7000, 0x0002, 0x1b23, 0x1b29, 0x1c3a, 0x1d06, 0x1d1a,
+	0x1b23, 0x1b23, 0x1b23, 0x7804, 0xd09c, 0x1904, 0x1d2b, 0x080c,
+	0x1515, 0x8001, 0x7002, 0xd1bc, 0x11a0, 0xd19c, 0x1904, 0x1bbe,
+	0xd1dc, 0x1178, 0x8aff, 0x0904, 0x1bbe, 0x2009, 0x0001, 0x080c,
+	0x1a4c, 0x0904, 0x1d2b, 0x2009, 0x0001, 0x080c, 0x1a4c, 0x0804,
+	0x1d2b, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1bc, 0x1904, 0x1b9e,
+	0x0026, 0x0036, 0x7c20, 0x7d24, 0x7e30, 0x7f34, 0x7818, 0x6812,
+	0x781c, 0x6816, 0x2001, 0x0201, 0x2004, 0xa005, 0x0140, 0x7808,
+	0xd0ec, 0x1128, 0x7803, 0x0009, 0x7003, 0x0004, 0x0010, 0x080c,
+	0x1d2f, 0x6b28, 0x6a2c, 0x2400, 0x686e, 0xa31a, 0x2500, 0x6872,
+	0xa213, 0x6b2a, 0x6a2e, 0x00c6, 0x7004, 0x2060, 0x6020, 0xd0f4,
+	0x1110, 0x633a, 0x6236, 0x00ce, 0x003e, 0x002e, 0x6e1e, 0x6f22,
+	0x2500, 0xa405, 0x0128, 0x080c, 0x22bd, 0x6850, 0xc0fd, 0x6852,
+	0x2a00, 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x6808, 0x8001,
+	0x680a, 0x1148, 0x684c, 0xd0e4, 0x0130, 0x7004, 0x2060, 0x2009,
+	0x0048, 0x080c, 0x864c, 0x7000, 0xa086, 0x0004, 0x0904, 0x1d2b,
+	0x7003, 0x0000, 0x080c, 0x19ba, 0x0804, 0x1d2b, 0x0056, 0x7d0c,
+	0xd5bc, 0x1110, 0x080c, 0xb407, 0x005e, 0x080c, 0x1dfe, 0x00f6,
+	0x7004, 0x2078, 0x080c, 0x5305, 0x0118, 0x7820, 0xc0f5, 0x7822,
+	0x00fe, 0x682b, 0xffff, 0x682f, 0xffff, 0x6808, 0x8001, 0x680a,
+	0x697c, 0x791a, 0x6980, 0x791e, 0x0804, 0x1d2b, 0x7004, 0x00c6,
+	0x2060, 0x6020, 0x00ce, 0xd0f4, 0x0120, 0x6808, 0x8001, 0x680a,
+	0x04c0, 0x7818, 0x6812, 0x7a1c, 0x6a16, 0xd19c, 0x0160, 0xa205,
+	0x0150, 0x7004, 0xa080, 0x0007, 0x2004, 0xa084, 0xfffd, 0xa086,
+	0x0008, 0x1904, 0x1b41, 0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005,
+	0x1520, 0x7003, 0x0000, 0x6808, 0x8001, 0x680a, 0x01a0, 0x7004,
+	0x2060, 0x601c, 0xa086, 0x000a, 0x11a0, 0x0156, 0x20a9, 0x0009,
+	0x2009, 0xb82f, 0x2104, 0xac06, 0x1108, 0x200a, 0xa188, 0x0003,
+	0x1f04, 0x1bf2, 0x015e, 0x7004, 0x2060, 0x2009, 0x0048, 0x080c,
+	0x864c, 0x080c, 0x19ba, 0x0804, 0x1d2b, 0x7818, 0x6812, 0x781c,
+	0x6816, 0x7814, 0x7908, 0xa18c, 0x0fff, 0xa192, 0x0841, 0x1a04,
+	0x1ae3, 0xa188, 0x0007, 0x8114, 0x8214, 0x8214, 0xa10a, 0x8104,
+	0x8004, 0x8004, 0xa20a, 0x810b, 0x810b, 0x810b, 0x080c, 0x1e99,
+	0x7803, 0x0004, 0x780f, 0xffff, 0x7803, 0x0001, 0x7804, 0xd0fc,
+	0x0de8, 0x7803, 0x0002, 0x7803, 0x0004, 0x780f, 0x00f6, 0x7004,
+	0x7007, 0x0000, 0x2060, 0x2009, 0x0048, 0x080c, 0x864c, 0x080c,
+	0x1eef, 0x0838, 0x8001, 0x7002, 0xd194, 0x01b0, 0x7804, 0xd0fc,
+	0x1904, 0x1cd6, 0xd09c, 0x0138, 0x7804, 0xd0fc, 0x1904, 0x1cd6,
+	0xd09c, 0x1904, 0x1cda, 0x8aff, 0x0904, 0x1d2b, 0x2009, 0x0001,
+	0x080c, 0x1a4c, 0x0804, 0x1d2b, 0xa184, 0x0888, 0x1148, 0x8aff,
+	0x0904, 0x1d2b, 0x2009, 0x0001, 0x080c, 0x1a4c, 0x0804, 0x1d2b,
+	0x7818, 0x6812, 0x7a1c, 0x6a16, 0xa205, 0x0904, 0x1bdb, 0x7803,
+	0x0004, 0x7003, 0x0000, 0xd1bc, 0x1904, 0x1cb8, 0x6834, 0xa084,
+	0x00ff, 0xa086, 0x0029, 0x1118, 0xd19c, 0x1904, 0x1bdb, 0x0026,
+	0x0036, 0x7c20, 0x7d24, 0x7e30, 0x7f34, 0x7818, 0x6812, 0x781c,
+	0x6816, 0x2001, 0x0201, 0x2004, 0xa005, 0x0140, 0x7808, 0xd0ec,
+	0x1128, 0x7803, 0x0009, 0x7003, 0x0004, 0x0020, 0x0016, 0x080c,
+	0x1d2f, 0x001e, 0x6b28, 0x6a2c, 0x080c, 0x22bd, 0x00d6, 0x2805,
+	0xac68, 0x6034, 0xd09c, 0x1128, 0x6808, 0xa31a, 0x680c, 0xa213,
+	0x0020, 0x6810, 0xa31a, 0x6814, 0xa213, 0x00de, 0xd194, 0x0904,
+	0x1b63, 0x2a00, 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x6808,
+	0x8001, 0x680a, 0x6b2a, 0x6a2e, 0x003e, 0x002e, 0x0804, 0x1c01,
+	0x0056, 0x7d0c, 0x080c, 0xb407, 0x005e, 0x080c, 0x1dfe, 0x00f6,
+	0x7004, 0x2078, 0x080c, 0x5305, 0x0118, 0x7820, 0xc0f5, 0x7822,
+	0x00fe, 0x682b, 0xffff, 0x682f, 0xffff, 0x6808, 0x8001, 0x680a,
+	0x697c, 0x791a, 0x6980, 0x791e, 0x0804, 0x1d2b, 0x7804, 0xd09c,
+	0x0904, 0x1b0e, 0x7c20, 0x7824, 0xa405, 0x1904, 0x1b0e, 0x7818,
+	0x6812, 0x7c1c, 0x6c16, 0xa405, 0x1120, 0x7803, 0x0002, 0x0804,
+	0x1bdb, 0x751c, 0x7420, 0x7724, 0x7628, 0x7014, 0xa528, 0x7018,
+	0xa421, 0xa7b9, 0x0000, 0xa6b1, 0x0000, 0x7830, 0xa506, 0x1150,
+	0x7834, 0xa406, 0x1138, 0x7838, 0xa706, 0x1120, 0x783c, 0xa606,
+	0x0904, 0x1b0e, 0x7803, 0x0002, 0x0804, 0x1c67, 0x7803, 0x0004,
+	0x7003, 0x0000, 0x7004, 0xa00d, 0x0150, 0x6808, 0x8001, 0x680a,
+	0x1130, 0x7004, 0x2060, 0x2009, 0x0048, 0x080c, 0x864c, 0x080c,
+	0x19ba, 0x0088, 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, 0x2060,
+	0x6010, 0xa005, 0x0da0, 0x2068, 0x6808, 0x8000, 0x680a, 0x6c28,
+	0x6b2c, 0x080c, 0x19d5, 0x001e, 0x000e, 0x012e, 0x0005, 0x700c,
+	0x7110, 0xa106, 0x0904, 0x1dd1, 0x7004, 0x0016, 0x210c, 0xa106,
+	0x001e, 0x0904, 0x1dd1, 0x00d6, 0x00c6, 0x216c, 0x2d00, 0xa005,
+	0x0904, 0x1dcf, 0x681c, 0xa086, 0x0008, 0x0904, 0x1dcf, 0x6820,
+	0xd0d4, 0x1904, 0x1dcf, 0x6810, 0x2068, 0x6850, 0xd0fc, 0x05a8,
+	0x8108, 0x2104, 0x6b2c, 0xa306, 0x1904, 0x1dcf, 0x8108, 0x2104,
+	0x6a28, 0xa206, 0x1904, 0x1dcf, 0x6850, 0xc0fc, 0xc0f5, 0x6852,
+	0x686c, 0x7822, 0x7016, 0x6870, 0x7826, 0x701a, 0x681c, 0x7832,
+	0x701e, 0x6820, 0x7836, 0x7022, 0x6818, 0x2060, 0x6034, 0xd09c,
+	0x0168, 0x6830, 0x2005, 0x00d6, 0xac68, 0x6808, 0x783a, 0x7026,
+	0x680c, 0x783e, 0x702a, 0x00de, 0x0804, 0x1dc9, 0xa006, 0x783a,
+	0x783e, 0x7026, 0x702a, 0x0804, 0x1dc9, 0x8108, 0x2104, 0xa005,
+	0x1904, 0x1dcf, 0x6b2c, 0xa306, 0x1904, 0x1dcf, 0x8108, 0x2104,
+	0xa005, 0x15e8, 0x6a28, 0xa206, 0x15d0, 0x6850, 0xc0f5, 0x6852,
+	0x6830, 0x2005, 0x6918, 0xa160, 0xa180, 0x000d, 0x2004, 0xd09c,
+	0x11a0, 0x6008, 0x7822, 0x7016, 0x686e, 0x600c, 0x7826, 0x701a,
+	0x6872, 0x6000, 0x7832, 0x701e, 0x6004, 0x7836, 0x7022, 0xa006,
+	0x783a, 0x783e, 0x7026, 0x702a, 0x00a0, 0x6010, 0x7822, 0x7016,
+	0x686e, 0x6014, 0x7826, 0x701a, 0x6872, 0x6000, 0x7832, 0x701e,
+	0x6004, 0x7836, 0x7022, 0x6008, 0x783a, 0x7026, 0x600c, 0x783e,
+	0x702a, 0x6810, 0x781a, 0x6814, 0x781e, 0x7803, 0x0011, 0x00ce,
+	0x00de, 0x0005, 0x2011, 0x0201, 0x2009, 0x003c, 0x2204, 0xa005,
+	0x1118, 0x8109, 0x1dd8, 0x0005, 0x0005, 0x0ca1, 0x0118, 0x780c,
+	0xd0a4, 0x0120, 0x00d9, 0xa085, 0x0001, 0x0010, 0x080c, 0x1eef,
+	0x0005, 0x0126, 0x2091, 0x2200, 0x7000, 0xa086, 0x0003, 0x1160,
+	0x700c, 0x7110, 0xa106, 0x0140, 0x080c, 0x295c, 0x20e1, 0x9028,
+	0x700f, 0xb82f, 0x7013, 0xb82f, 0x012e, 0x0005, 0x00c6, 0x080c,
+	0x5acf, 0x11b8, 0x2001, 0x0160, 0x2003, 0x0000, 0x2001, 0x0138,
+	0x2003, 0x0000, 0x2011, 0x00c8, 0xe000, 0xe000, 0x8211, 0x1de0,
+	0x04b1, 0x0066, 0x2031, 0x0000, 0x080c, 0x5b51, 0x006e, 0x00ce,
+	0x0005, 0x080c, 0x1e6e, 0x080c, 0x295c, 0x20e1, 0x9028, 0x700c,
+	0x7110, 0xa106, 0x01c0, 0x2104, 0xa005, 0x0130, 0x2060, 0x6010,
+	0x2060, 0x6008, 0x8001, 0x600a, 0xa188, 0x0003, 0xa182, 0xb84a,
+	0x0210, 0x2009, 0xb82f, 0x7112, 0x700c, 0xa106, 0x1d40, 0x080c,
+	0x28eb, 0x2110, 0x0c20, 0x2001, 0x015d, 0x2003, 0x0000, 0x2001,
+	0x0160, 0x2502, 0x2001, 0x0138, 0x2202, 0x00ce, 0x0005, 0x080c,
+	0x295c, 0x20e1, 0x9028, 0x2001, 0x015d, 0x2003, 0x0000, 0x00e6,
+	0x00c6, 0x0016, 0x2071, 0xb823, 0x700c, 0x7110, 0xa106, 0x0190,
+	0x2104, 0xa005, 0x0130, 0x2060, 0x6010, 0x2060, 0x6008, 0x8001,
+	0x600a, 0xa188, 0x0003, 0xa182, 0xb84a, 0x0210, 0x2009, 0xb82f,
+	0x7112, 0x0c50, 0x001e, 0x00ce, 0x00ee, 0x0005, 0x2001, 0x0138,
+	0x2014, 0x2003, 0x0000, 0x2001, 0x0160, 0x202c, 0x2003, 0x0000,
+	0x080c, 0x5acf, 0x1148, 0x2021, 0x0002, 0x1d04, 0x1e7d, 0x2091,
+	0x6000, 0x8421, 0x1dd0, 0x0005, 0x2021, 0xb015, 0x2001, 0x0141,
+	0x201c, 0xd3dc, 0x1168, 0x2001, 0x0109, 0x201c, 0xa39c, 0x0048,
+	0x1138, 0x2001, 0x0111, 0x201c, 0x83ff, 0x1110, 0x8421, 0x1d70,
+	0x0005, 0x00e6, 0x2071, 0x0200, 0x7808, 0xa084, 0xf000, 0xa10d,
+	0x0869, 0x2001, 0x0105, 0x2004, 0xa084, 0x0003, 0x1130, 0x2001,
+	0xb84a, 0x2004, 0xa086, 0x0000, 0x0548, 0xa026, 0x2019, 0xf000,
+	0x8319, 0x1148, 0x2001, 0x012b, 0x2003, 0x95f5, 0x2001, 0x0129,
+	0x2003, 0x95f5, 0x00d8, 0x2001, 0x0105, 0x2004, 0xa084, 0x0003,
+	0x1130, 0x2001, 0xb84a, 0x2004, 0xa086, 0x0000, 0x0178, 0x2001,
+	0x0132, 0x2004, 0xa436, 0x0110, 0x2020, 0x0c00, 0x2001, 0x0021,
+	0x2004, 0xd0fc, 0x09e8, 0x080c, 0x214a, 0x08c0, 0x20e1, 0x7000,
+	0x7324, 0x7420, 0x7028, 0x7028, 0x7426, 0x7037, 0x0001, 0x810f,
+	0x712e, 0x702f, 0x0100, 0x7037, 0x0008, 0x7326, 0x7422, 0x2001,
+	0x0160, 0x2502, 0x2001, 0x0138, 0x2202, 0x00ee, 0x0005, 0x0026,
+	0x2001, 0x015d, 0x2003, 0x0000, 0x7908, 0xa18c, 0x0fff, 0xa182,
+	0x0ffd, 0x0210, 0x2009, 0x0000, 0xa190, 0x0007, 0xa294, 0x1ff8,
+	0x8214, 0x8214, 0x8214, 0x2001, 0x020a, 0x82ff, 0x0140, 0x20e1,
+	0x6000, 0x200c, 0x200c, 0x200c, 0x200c, 0x8211, 0x1dd0, 0x20e1,
+	0x7000, 0x200c, 0x200c, 0x7003, 0x0000, 0x20e1, 0x6000, 0x2001,
+	0x0208, 0x200c, 0x2001, 0x0209, 0x2004, 0xa106, 0x0158, 0x080c,
+	0x1dd2, 0x0130, 0x7908, 0xd1ec, 0x1128, 0x790c, 0xd1a4, 0x0960,
+	0x080c, 0x1dfe, 0xa006, 0x002e, 0x0005, 0x00f6, 0x00e6, 0x0016,
+	0x0026, 0x2071, 0xb823, 0x2079, 0x0030, 0x2011, 0x0050, 0x7000,
+	0xa086, 0x0000, 0x01a8, 0x8211, 0x0188, 0x2001, 0x0005, 0x2004,
+	0xd08c, 0x0dc8, 0x7904, 0xa18c, 0x0780, 0x0016, 0x080c, 0x1b06,
+	0x001e, 0x81ff, 0x1118, 0x2011, 0x0050, 0x0c48, 0xa085, 0x0001,
+	0x002e, 0x001e, 0x00ee, 0x00fe, 0x0005, 0x7803, 0x0004, 0x2009,
+	0x0064, 0x7804, 0xd0ac, 0x0904, 0x1fa1, 0x8109, 0x1dd0, 0x2009,
+	0x0100, 0x210c, 0xa18a, 0x0003, 0x0a0c, 0x1515, 0x080c, 0x2251,
+	0x00e6, 0x00f6, 0x2071, 0xb812, 0x2079, 0x0010, 0x7004, 0xa086,
+	0x0000, 0x0538, 0x7800, 0x0006, 0x7820, 0x0006, 0x7830, 0x0006,
+	0x7834, 0x0006, 0x7838, 0x0006, 0x783c, 0x0006, 0x7803, 0x0004,
+	0xe000, 0xe000, 0x2079, 0x0030, 0x7804, 0xd0ac, 0x190c, 0x1515,
+	0x2079, 0x0010, 0x000e, 0x783e, 0x000e, 0x783a, 0x000e, 0x7836,
+	0x000e, 0x7832, 0x000e, 0x7822, 0x000e, 0x7802, 0x00fe, 0x00ee,
+	0x0030, 0x00fe, 0x00ee, 0x7804, 0xd0ac, 0x190c, 0x1515, 0x080c,
+	0x7230, 0x0005, 0x00e6, 0x2071, 0xb84a, 0x7003, 0x0000, 0x00ee,
+	0x0005, 0x00d6, 0xa280, 0x0004, 0x206c, 0x694c, 0xd1dc, 0x1904,
+	0x201f, 0x6934, 0xa184, 0x0007, 0x0002, 0x1fbd, 0x200a, 0x1fbd,
+	0x1fbd, 0x1fbd, 0x1ff1, 0x1fd0, 0x1fbf, 0x080c, 0x1515, 0x684c,
+	0xd0b4, 0x0904, 0x2107, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a,
+	0x6812, 0x687c, 0x680a, 0x6880, 0x680e, 0x6958, 0x0804, 0x2012,
+	0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, 0x1d38, 0x684c, 0xd0b4,
+	0x0904, 0x2107, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812,
+	0x687c, 0x680a, 0x6880, 0x680e, 0x6804, 0x681a, 0xa080, 0x000d,
+	0x2004, 0xa084, 0x000f, 0xa080, 0x22e5, 0x2005, 0x6832, 0x6958,
+	0x0450, 0xa18c, 0x00ff, 0xa186, 0x0015, 0x1548, 0x684c, 0xd0b4,
+	0x0904, 0x2107, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084,
+	0x000f, 0xa080, 0x22e5, 0x2005, 0x6832, 0x6958, 0xa006, 0x682e,
+	0x682a, 0x0088, 0x684c, 0xd0b4, 0x0904, 0x1ae1, 0x6958, 0xa006,
+	0x682e, 0x682a, 0x2d00, 0x681a, 0x6834, 0xa084, 0x000f, 0xa080,
+	0x22e5, 0x2005, 0x6832, 0x6926, 0x684c, 0xc0dd, 0x684e, 0x00de,
+	0x0005, 0x00f6, 0x2079, 0x0020, 0x7804, 0xd0fc, 0x190c, 0x214a,
+	0x00e6, 0x00d6, 0x2071, 0xb84a, 0x7000, 0xa005, 0x1904, 0x2087,
+	0x00c6, 0x7206, 0xa280, 0x0004, 0x205c, 0x7004, 0x2068, 0x7803,
+	0x0004, 0x6818, 0x00d6, 0x2068, 0x686c, 0x7812, 0x6890, 0x00f6,
+	0x20e1, 0x9040, 0x2079, 0x0200, 0x781a, 0x2079, 0x0100, 0x8004,
+	0x78d6, 0x00fe, 0x00de, 0x2b68, 0x6824, 0x2050, 0x6818, 0x2060,
+	0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, 0x6908, 0x791a, 0x7116,
+	0x680c, 0x781e, 0x701a, 0xa006, 0x700e, 0x7012, 0x7004, 0x692c,
+	0x6814, 0xa106, 0x1120, 0x6928, 0x6810, 0xa106, 0x0158, 0x0036,
+	0x0046, 0x6b14, 0x6c10, 0x080c, 0x2305, 0x004e, 0x003e, 0x0110,
+	0x00ce, 0x00a8, 0x8aff, 0x1120, 0x00ce, 0xa085, 0x0001, 0x0078,
+	0x0126, 0x2091, 0x8000, 0x2079, 0x0020, 0x2009, 0x0001, 0x0059,
+	0x0118, 0x2009, 0x0001, 0x0039, 0x012e, 0x00ce, 0xa006, 0x00de,
+	0x00ee, 0x00fe, 0x0005, 0x0076, 0x0066, 0x0056, 0x0046, 0x0036,
+	0x0026, 0x8aff, 0x0904, 0x2100, 0x700c, 0x7214, 0xa23a, 0x7010,
+	0x7218, 0xa203, 0x0a04, 0x20ff, 0xa705, 0x0904, 0x20ff, 0xa03e,
+	0x2730, 0x6850, 0xd0fc, 0x11a8, 0x00d6, 0x2805, 0xac68, 0x2900,
+	0x0002, 0x20e2, 0x20c7, 0x20c7, 0x20e2, 0x20e2, 0x20db, 0x20e2,
+	0x20c7, 0x20e2, 0x20cc, 0x20cc, 0x20e2, 0x20e2, 0x20e2, 0x20d3,
+	0x20cc, 0xc0fc, 0x6852, 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0xd99c,
+	0x0528, 0x00d6, 0x2805, 0xac68, 0x6f08, 0x6e0c, 0x00f0, 0x6b08,
+	0x6a0c, 0x6d00, 0x6c04, 0x00c8, 0x6b10, 0x6a14, 0x6d00, 0x6c04,
+	0x6f08, 0x6e0c, 0x0090, 0x00de, 0x00d6, 0x6834, 0xa084, 0x00ff,
+	0xa086, 0x001e, 0x1138, 0x00de, 0x080c, 0x22a7, 0x1904, 0x2091,
+	0xa00e, 0x00f0, 0x00de, 0x080c, 0x1515, 0x00de, 0x7b22, 0x7a26,
+	0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000, 0x7002,
+	0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e, 0x700c, 0xa300,
+	0x700e, 0x7010, 0xa201, 0x7012, 0x080c, 0x22a7, 0x0008, 0xa006,
+	0x002e, 0x003e, 0x004e, 0x005e, 0x006e, 0x007e, 0x0005, 0x080c,
+	0x1515, 0x0026, 0x2001, 0x0105, 0x2003, 0x0010, 0x20e1, 0x9040,
+	0x7803, 0x0004, 0x7003, 0x0000, 0x7004, 0x2060, 0x00d6, 0x6010,
+	0x2068, 0x080c, 0x9c5a, 0x0118, 0x6850, 0xc0bd, 0x6852, 0x601c,
+	0xa086, 0x0006, 0x1180, 0x2061, 0x0100, 0x62c8, 0x2001, 0x00fa,
+	0x8001, 0x1df0, 0x60c8, 0xa206, 0x1dc0, 0x60c4, 0x686a, 0x60c8,
+	0x6866, 0x7004, 0x2060, 0x00de, 0x00c6, 0x080c, 0x992a, 0x00ce,
+	0x2001, 0xb7ef, 0x2004, 0xac06, 0x1150, 0x20e1, 0x9040, 0x080c,
+	0x825d, 0x2011, 0x0000, 0x080c, 0x807f, 0x080c, 0x7230, 0x002e,
+	0x0804, 0x2204, 0x0126, 0x2091, 0x2400, 0x0006, 0x0016, 0x00f6,
+	0x00e6, 0x00d6, 0x00c6, 0x2079, 0x0020, 0x2071, 0xb84a, 0x2b68,
+	0x6818, 0x2060, 0x7904, 0x7803, 0x0002, 0xa184, 0x0700, 0x1904,
+	0x2109, 0x7000, 0x0002, 0x2204, 0x2167, 0x21d7, 0x2202, 0x8001,
+	0x7002, 0xd19c, 0x1170, 0x8aff, 0x05d0, 0x2009, 0x0001, 0x080c,
+	0x208b, 0x0904, 0x2204, 0x2009, 0x0001, 0x080c, 0x208b, 0x0804,
+	0x2204, 0x7803, 0x0004, 0xd194, 0x0148, 0x6850, 0xc0fc, 0x6852,
+	0x8aff, 0x11d8, 0x684c, 0xc0f5, 0x684e, 0x00b8, 0x0026, 0x0036,
+	0x6b28, 0x6a2c, 0x7820, 0x686e, 0xa31a, 0x7824, 0x6872, 0xa213,
+	0x7830, 0x681e, 0x7834, 0x6822, 0x6b2a, 0x6a2e, 0x003e, 0x002e,
+	0x080c, 0x22bd, 0x6850, 0xc0fd, 0x6852, 0x2a00, 0x6826, 0x2c00,
+	0x681a, 0x2800, 0x6832, 0x7003, 0x0000, 0x0804, 0x2204, 0x00f6,
+	0x0026, 0x781c, 0x0006, 0x7818, 0x0006, 0x2079, 0x0100, 0x7a14,
+	0xa284, 0x0184, 0xa085, 0x0012, 0x7816, 0x0036, 0x2019, 0x1000,
+	0x8319, 0x090c, 0x1515, 0x7820, 0xd0bc, 0x1dd0, 0x003e, 0x79c8,
+	0x000e, 0xa102, 0x001e, 0x0006, 0x0016, 0x79c4, 0x000e, 0xa103,
+	0x78c6, 0x000e, 0x78ca, 0xa284, 0x0184, 0xa085, 0x0012, 0x7816,
+	0x002e, 0x00fe, 0x7803, 0x0008, 0x7003, 0x0000, 0x0468, 0x8001,
+	0x7002, 0xd194, 0x0168, 0x7804, 0xd0fc, 0x1904, 0x215a, 0xd19c,
+	0x11f8, 0x8aff, 0x0508, 0x2009, 0x0001, 0x080c, 0x208b, 0x00e0,
+	0x0026, 0x0036, 0x6b28, 0x6a2c, 0x080c, 0x22bd, 0x00d6, 0x2805,
+	0xac68, 0x6034, 0xd09c, 0x1128, 0x6808, 0xa31a, 0x680c, 0xa213,
+	0x0020, 0x6810, 0xa31a, 0x6814, 0xa213, 0x00de, 0x0804, 0x218a,
+	0x0804, 0x2186, 0x080c, 0x1515, 0x00ce, 0x00de, 0x00ee, 0x00fe,
+	0x001e, 0x000e, 0x012e, 0x0005, 0x00f6, 0x00e6, 0x2071, 0xb84a,
+	0x7000, 0xa086, 0x0000, 0x05d0, 0x2079, 0x0020, 0x0016, 0x2009,
+	0x0207, 0x210c, 0xd194, 0x0198, 0x2009, 0x020c, 0x210c, 0xa184,
+	0x0003, 0x0168, 0x080c, 0xb450, 0x2001, 0x0133, 0x2004, 0xa005,
+	0x090c, 0x1515, 0x20e1, 0x9040, 0x2001, 0x020c, 0x2102, 0x2009,
+	0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0xa106, 0x1110, 0x20e1,
+	0x9040, 0x7804, 0xd0fc, 0x09d8, 0x080c, 0x214a, 0x7000, 0xa086,
+	0x0000, 0x19a8, 0x001e, 0x7803, 0x0004, 0x7804, 0xd0ac, 0x1de8,
+	0x20e1, 0x9040, 0x7803, 0x0002, 0x7003, 0x0000, 0x00ee, 0x00fe,
+	0x0005, 0x0026, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2071, 0xb84a,
+	0x2079, 0x0020, 0x7000, 0xa086, 0x0000, 0x0540, 0x7004, 0x2060,
+	0x6010, 0x2068, 0x080c, 0x9c5a, 0x0158, 0x6850, 0xc0b5, 0x6852,
+	0x680c, 0x7a1c, 0xa206, 0x1120, 0x6808, 0x7a18, 0xa206, 0x01e0,
+	0x2001, 0x0105, 0x2003, 0x0010, 0x20e1, 0x9040, 0x7803, 0x0004,
+	0x7003, 0x0000, 0x7004, 0x2060, 0x080c, 0x992a, 0x20e1, 0x9040,
+	0x080c, 0x825d, 0x2011, 0x0000, 0x080c, 0x807f, 0x00fe, 0x00ee,
+	0x00de, 0x00ce, 0x002e, 0x0005, 0x6810, 0x6a14, 0xa205, 0x1d00,
+	0x684c, 0xc0dc, 0x684e, 0x2c10, 0x080c, 0x1fa9, 0x2001, 0x0105,
+	0x2003, 0x0010, 0x20e1, 0x9040, 0x7803, 0x0004, 0x7003, 0x0000,
+	0x2069, 0xb7e0, 0x6833, 0x0000, 0x683f, 0x0000, 0x08f8, 0x8840,
+	0x2805, 0xa005, 0x1170, 0x6004, 0xa005, 0x0168, 0x681a, 0x2060,
+	0x6034, 0xa084, 0x000f, 0xa080, 0x22e5, 0x2045, 0x88ff, 0x090c,
+	0x1515, 0x8a51, 0x0005, 0x2050, 0x0005, 0x8a50, 0x8841, 0x2805,
+	0xa005, 0x1190, 0x2c00, 0xad06, 0x0120, 0x6000, 0xa005, 0x1108,
+	0x2d00, 0x2060, 0x681a, 0x6034, 0xa084, 0x000f, 0xa080, 0x22f5,
+	0x2045, 0x88ff, 0x090c, 0x1515, 0x0005, 0x0000, 0x0011, 0x0015,
+	0x0019, 0x001d, 0x0021, 0x0025, 0x0029, 0x0000, 0x000f, 0x0015,
+	0x001b, 0x0021, 0x0027, 0x0000, 0x0000, 0x0000, 0x22da, 0x22d6,
+	0x0000, 0x0000, 0x22e4, 0x0000, 0x22da, 0x0000, 0x22e1, 0x22de,
+	0x0000, 0x0000, 0x0000, 0x22e4, 0x22e1, 0x0000, 0x22dc, 0x22dc,
+	0x0000, 0x0000, 0x22e4, 0x0000, 0x22dc, 0x0000, 0x22e2, 0x22e2,
+	0x0000, 0x0000, 0x0000, 0x22e4, 0x22e2, 0x00a6, 0x0096, 0x0086,
+	0x6b2e, 0x6c2a, 0x6858, 0xa055, 0x0904, 0x2396, 0x2d60, 0x6034,
+	0xa0cc, 0x000f, 0xa9c0, 0x22e5, 0xa986, 0x0007, 0x0130, 0xa986,
+	0x000e, 0x0118, 0xa986, 0x000f, 0x1120, 0x605c, 0xa422, 0x6060,
+	0xa31b, 0x2805, 0xa045, 0x1140, 0x0310, 0x0804, 0x2396, 0x6004,
+	0xa065, 0x0904, 0x2396, 0x0c18, 0x2805, 0xa005, 0x01a8, 0xac68,
+	0xd99c, 0x1128, 0x6808, 0xa422, 0x680c, 0xa31b, 0x0020, 0x6810,
+	0xa422, 0x6814, 0xa31b, 0x0620, 0x2300, 0xa405, 0x0150, 0x8a51,
+	0x0904, 0x2396, 0x8840, 0x0c40, 0x6004, 0xa065, 0x0904, 0x2396,
+	0x0830, 0x8a51, 0x0904, 0x2396, 0x8840, 0x2805, 0xa005, 0x1158,
+	0x6004, 0xa065, 0x0904, 0x2396, 0x6034, 0xa0cc, 0x000f, 0xa9c0,
+	0x22e5, 0x2805, 0x2040, 0x2b68, 0x6850, 0xc0fc, 0x6852, 0x0458,
+	0x8422, 0x8420, 0x831a, 0xa399, 0x0000, 0x00d6, 0x2b68, 0x6c6e,
+	0x6b72, 0x00de, 0xd99c, 0x1168, 0x6908, 0x2400, 0xa122, 0x690c,
+	0x2300, 0xa11b, 0x0a0c, 0x1515, 0x6800, 0xa420, 0x6804, 0xa319,
+	0x0060, 0x6910, 0x2400, 0xa122, 0x6914, 0x2300, 0xa11b, 0x0a0c,
+	0x1515, 0x6800, 0xa420, 0x6804, 0xa319, 0x2b68, 0x6c1e, 0x6b22,
+	0x6850, 0xc0fd, 0x6852, 0x2c00, 0x681a, 0x2800, 0x6832, 0x2a00,
+	0x6826, 0x000e, 0x000e, 0x000e, 0xa006, 0x0028, 0x008e, 0x009e,
+	0x00ae, 0xa085, 0x0001, 0x0005, 0x2001, 0x0005, 0x2004, 0xa084,
+	0x0007, 0x0002, 0x23aa, 0x23ab, 0x23ae, 0x23b1, 0x23b6, 0x23b9,
+	0x23be, 0x23c3, 0x0005, 0x080c, 0x214a, 0x0005, 0x080c, 0x1b06,
+	0x0005, 0x080c, 0x1b06, 0x080c, 0x214a, 0x0005, 0x080c, 0x171b,
+	0x0005, 0x080c, 0x214a, 0x080c, 0x171b, 0x0005, 0x080c, 0x1b06,
+	0x080c, 0x171b, 0x0005, 0x080c, 0x1b06, 0x080c, 0x214a, 0x080c,
+	0x171b, 0x0005, 0x0126, 0x2091, 0x2600, 0x2079, 0x0200, 0x2071,
+	0xbb80, 0x2069, 0xb500, 0x080c, 0x24c0, 0x080c, 0x24b0, 0x2009,
+	0x0004, 0x7912, 0x7817, 0x0004, 0x080c, 0x27f8, 0x781b, 0x0002,
+	0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a9, 0x0080, 0x782f, 0x0000,
+	0x1f04, 0x23e6, 0x20e1, 0x9080, 0x783b, 0x001f, 0x20e1, 0x8700,
+	0x012e, 0x0005, 0x0126, 0x2091, 0x2600, 0x781c, 0xd0a4, 0x190c,
+	0x24ad, 0xa084, 0x0007, 0x0002, 0x2416, 0x2404, 0x2407, 0x240a,
+	0x240f, 0x2411, 0x2413, 0x2415, 0x080c, 0x63c4, 0x0078, 0x080c,
+	0x6403, 0x0060, 0x080c, 0x63c4, 0x080c, 0x6403, 0x0038, 0x0041,
+	0x0028, 0x0031, 0x0018, 0x0021, 0x0008, 0x0011, 0x012e, 0x0005,
+	0x0006, 0x0016, 0x0026, 0x080c, 0xb450, 0x7930, 0xa184, 0x0003,
+	0x01b0, 0x2001, 0xb7ef, 0x2004, 0xa005, 0x0170, 0x2001, 0x0133,
+	0x2004, 0xa005, 0x090c, 0x1515, 0x00c6, 0x2001, 0xb7ef, 0x2064,
+	0x080c, 0x992a, 0x00ce, 0x04b8, 0x20e1, 0x9040, 0x04a0, 0xa184,
+	0x0030, 0x01e0, 0x6a00, 0xa286, 0x0003, 0x1108, 0x00a0, 0x080c,
+	0x5acf, 0x1178, 0x2001, 0xb79f, 0x2003, 0x0001, 0x2001, 0xb500,
+	0x2003, 0x0001, 0xa085, 0x0001, 0x080c, 0x5b13, 0x080c, 0x5a07,
+	0x0010, 0x080c, 0x4b1f, 0x080c, 0x24b0, 0x00a8, 0xa184, 0x00c0,
+	0x0168, 0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0xb823, 0x080c,
+	0x1dfe, 0x005e, 0x004e, 0x003e, 0x00ee, 0x0028, 0xa184, 0x0300,
+	0x0110, 0x20e1, 0x9020, 0x7932, 0x002e, 0x001e, 0x000e, 0x0005,
+	0x0016, 0x00e6, 0x00f6, 0x2071, 0xb500, 0x7128, 0x2001, 0xb791,
+	0x2102, 0x2001, 0xb799, 0x2102, 0xa182, 0x0211, 0x1218, 0x2009,
+	0x0008, 0x0400, 0xa182, 0x0259, 0x1218, 0x2009, 0x0007, 0x00d0,
+	0xa182, 0x02c1, 0x1218, 0x2009, 0x0006, 0x00a0, 0xa182, 0x0349,
+	0x1218, 0x2009, 0x0005, 0x0070, 0xa182, 0x0421, 0x1218, 0x2009,
+	0x0004, 0x0040, 0xa182, 0x0581, 0x1218, 0x2009, 0x0003, 0x0010,
+	0x2009, 0x0002, 0x2079, 0x0200, 0x7912, 0x7817, 0x0004, 0x080c,
+	0x27f8, 0x00fe, 0x00ee, 0x001e, 0x0005, 0x7938, 0x080c, 0x1515,
+	0x00e6, 0x0026, 0x2071, 0x0200, 0x20e1, 0x1000, 0x7220, 0x7028,
+	0x7020, 0xa206, 0x0de0, 0x20e1, 0x9010, 0x002e, 0x00ee, 0x0005,
+	0x20e1, 0xa000, 0x7837, 0x0001, 0x782f, 0x0000, 0x782f, 0x0000,
+	0x782f, 0x0000, 0x782f, 0x0000, 0x7837, 0x0005, 0x20a9, 0x0210,
+	0x7830, 0xd0bc, 0x1110, 0x1f04, 0x24d0, 0x7837, 0x0001, 0x7837,
+	0x0000, 0xe000, 0xe000, 0x20e1, 0xa000, 0x0005, 0x0126, 0x2091,
+	0x2800, 0x2061, 0x0100, 0x2071, 0xb500, 0x6024, 0x6026, 0x6053,
+	0x0030, 0x080c, 0x2837, 0x6050, 0xa084, 0xfe7f, 0x6052, 0x2009,
+	0x00ef, 0x6132, 0x6136, 0x080c, 0x2847, 0x60e7, 0x0000, 0x61ea,
+	0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043, 0x0000, 0x602f, 0x0080,
+	0x602f, 0x0000, 0x6007, 0x0e9f, 0x601b, 0x001e, 0x600f, 0x00ff,
+	0x2001, 0xb78d, 0x2003, 0x00ff, 0x602b, 0x002f, 0x012e, 0x0005,
+	0x2001, 0xb532, 0x2003, 0x0000, 0x2001, 0xb531, 0x2003, 0x0001,
+	0x0005, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x6124,
+	0xa184, 0x1e2c, 0x1118, 0xa184, 0x0007, 0x002a, 0xa195, 0x0004,
+	0xa284, 0x0007, 0x0002, 0x254d, 0x2533, 0x2536, 0x2539, 0x253e,
+	0x2540, 0x2544, 0x2548, 0x080c, 0x6b74, 0x00b8, 0x080c, 0x6c4f,
+	0x00a0, 0x080c, 0x6c4f, 0x080c, 0x6b74, 0x0078, 0x0099, 0x0068,
+	0x080c, 0x6b74, 0x0079, 0x0048, 0x080c, 0x6c4f, 0x0059, 0x0028,
+	0x080c, 0x6c4f, 0x080c, 0x6b74, 0x0029, 0x002e, 0x001e, 0x000e,
+	0x012e, 0x0005, 0x6124, 0x6028, 0xd09c, 0x0118, 0xd19c, 0x1904,
+	0x2766, 0x080c, 0x5acf, 0x0578, 0x7000, 0xa086, 0x0003, 0x0198,
+	0x6024, 0xa084, 0x1800, 0x0178, 0x080c, 0x5af5, 0x0118, 0x080c,
+	0x5ae1, 0x1148, 0x6027, 0x0020, 0x6043, 0x0000, 0x2001, 0xb79e,
+	0x2003, 0xaaaa, 0x0458, 0x080c, 0x5af5, 0x15d0, 0x6024, 0xa084,
+	0x1800, 0x1108, 0x04a8, 0x2001, 0xb79e, 0x2003, 0xaaaa, 0x2001,
+	0xb79f, 0x2003, 0x0001, 0x2001, 0xb500, 0x2003, 0x0001, 0x080c,
+	0x5a07, 0x0804, 0x2766, 0xd1ac, 0x1518, 0x6024, 0xd0dc, 0x1170,
+	0xd0e4, 0x1188, 0xd0d4, 0x11a0, 0xd0cc, 0x0130, 0x708c, 0xa086,
+	0x0028, 0x1110, 0x080c, 0x5c5e, 0x0804, 0x2766, 0x2001, 0xb79f,
+	0x2003, 0x0000, 0x0048, 0x2001, 0xb79f, 0x2003, 0x0002, 0x0020,
+	0x080c, 0x5bd1, 0x0804, 0x2766, 0x080c, 0x5d03, 0x0804, 0x2766,
+	0xd1ac, 0x0904, 0x26ae, 0x080c, 0x5acf, 0x11d8, 0x6027, 0x0020,
+	0x0006, 0x0026, 0x0036, 0x080c, 0x5aeb, 0x1170, 0x2001, 0xb79f,
+	0x2003, 0x0001, 0x2001, 0xb500, 0x2003, 0x0001, 0x080c, 0x5a07,
+	0x003e, 0x002e, 0x000e, 0x0005, 0x003e, 0x002e, 0x000e, 0x080c,
+	0x5aa6, 0x0016, 0x0046, 0x00c6, 0x644c, 0xa486, 0xf0f0, 0x1138,
+	0x2061, 0x0100, 0x644a, 0x6043, 0x0090, 0x6043, 0x0010, 0x74ce,
+	0xa48c, 0xff00, 0x7034, 0xd084, 0x0178, 0xa186, 0xf800, 0x1160,
+	0x703c, 0xd084, 0x1148, 0xc085, 0x703e, 0x0036, 0x2418, 0x2011,
+	0x8016, 0x080c, 0x3ecc, 0x003e, 0xa196, 0xff00, 0x05b8, 0x7054,
+	0xa084, 0x00ff, 0x810f, 0xa116, 0x0588, 0x7130, 0xd184, 0x1570,
+	0x2011, 0xb553, 0x2214, 0xd2ec, 0x0138, 0xc18d, 0x7132, 0x2011,
+	0xb553, 0x2214, 0xd2ac, 0x1510, 0x6240, 0xa294, 0x0010, 0x0130,
+	0x6248, 0xa294, 0xff00, 0xa296, 0xff00, 0x01c0, 0x7030, 0xd08c,
+	0x0904, 0x267b, 0x7034, 0xd08c, 0x1140, 0x2001, 0xb50c, 0x200c,
+	0xd1ac, 0x1904, 0x267b, 0xc1ad, 0x2102, 0x0036, 0x73cc, 0x2011,
+	0x8013, 0x080c, 0x3ecc, 0x003e, 0x0804, 0x267b, 0x7034, 0xd08c,
+	0x1140, 0x2001, 0xb50c, 0x200c, 0xd1ac, 0x1904, 0x267b, 0xc1ad,
+	0x2102, 0x0036, 0x73cc, 0x2011, 0x8013, 0x080c, 0x3ecc, 0x003e,
+	0x7130, 0xc185, 0x7132, 0x2011, 0xb553, 0x220c, 0xd1a4, 0x01d0,
+	0x0016, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c, 0x6b1a, 0x2019,
+	0x000e, 0x080c, 0xb065, 0xa484, 0x00ff, 0xa080, 0x2dc4, 0x200d,
+	0xa18c, 0xff00, 0x810f, 0x8127, 0xa006, 0x2009, 0x000e, 0x080c,
+	0xb0e8, 0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009, 0x0000, 0x2019,
+	0x0004, 0x080c, 0x2c6f, 0x001e, 0x0070, 0x0156, 0x20a9, 0x007f,
+	0x2009, 0x0000, 0x080c, 0x4fa9, 0x1110, 0x080c, 0x4c0b, 0x8108,
+	0x1f04, 0x2672, 0x015e, 0x00ce, 0x004e, 0x2011, 0x0003, 0x080c,
+	0x8075, 0x2011, 0x0002, 0x080c, 0x807f, 0x080c, 0x7f59, 0x0036,
+	0x2019, 0x0000, 0x080c, 0x7fe4, 0x003e, 0x60e3, 0x0000, 0x001e,
+	0x2001, 0xb500, 0x2014, 0xa296, 0x0004, 0x1128, 0xd19c, 0x11b0,
+	0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0xb523, 0x2003,
+	0x0000, 0x6027, 0x0020, 0x080c, 0x5af5, 0x1140, 0x0016, 0x2009,
+	0x07d0, 0x2011, 0x59e4, 0x080c, 0x6a22, 0x001e, 0xd194, 0x0904,
+	0x2766, 0x0016, 0x6220, 0xd2b4, 0x0904, 0x2717, 0x080c, 0x6a10,
+	0x080c, 0x7d7a, 0x6027, 0x0004, 0x00f6, 0x2019, 0xb7e9, 0x2304,
+	0xa07d, 0x0570, 0x7804, 0xa086, 0x0032, 0x1550, 0x00d6, 0x00c6,
+	0x00e6, 0x2069, 0x0140, 0x618c, 0x6288, 0x7818, 0x608e, 0x7808,
+	0x608a, 0x6043, 0x0002, 0x2001, 0x0003, 0x8001, 0x1df0, 0x6043,
+	0x0000, 0x6803, 0x1000, 0x6803, 0x0000, 0x618e, 0x628a, 0x080c,
+	0x7090, 0x080c, 0x7173, 0x7810, 0x2070, 0x7037, 0x0103, 0x2f60,
+	0x080c, 0x861d, 0x00ee, 0x00ce, 0x00de, 0x00fe, 0x001e, 0x0005,
+	0x00fe, 0x00d6, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0120,
+	0x6803, 0x1000, 0x6803, 0x0000, 0x00de, 0x00c6, 0x2061, 0xb7e0,
+	0x6028, 0xa09a, 0x00c8, 0x1238, 0x8000, 0x602a, 0x00ce, 0x080c,
+	0x7d6d, 0x0804, 0x2765, 0x2019, 0xb7e9, 0x2304, 0xa065, 0x0120,
+	0x2009, 0x0027, 0x080c, 0x864c, 0x00ce, 0x0804, 0x2765, 0xd2bc,
+	0x0904, 0x2765, 0x080c, 0x6a1d, 0x6014, 0xa084, 0x0184, 0xa085,
+	0x0010, 0x6016, 0x6027, 0x0004, 0x00d6, 0x2069, 0x0140, 0x6804,
+	0xa084, 0x4000, 0x0120, 0x6803, 0x1000, 0x6803, 0x0000, 0x00de,
+	0x00c6, 0x2061, 0xb7e0, 0x6044, 0xa09a, 0x00c8, 0x12f0, 0x8000,
+	0x6046, 0x603c, 0x00ce, 0xa005, 0x0540, 0x2009, 0x07d0, 0x080c,
+	0x6a15, 0xa080, 0x0007, 0x2004, 0xa086, 0x0006, 0x1138, 0x6114,
+	0xa18c, 0x0184, 0xa18d, 0x0012, 0x6116, 0x00b8, 0x6114, 0xa18c,
+	0x0184, 0xa18d, 0x0016, 0x6116, 0x0080, 0x0036, 0x2019, 0x0001,
+	0x080c, 0x7fe4, 0x003e, 0x2019, 0xb7ef, 0x2304, 0xa065, 0x0120,
+	0x2009, 0x004f, 0x080c, 0x864c, 0x00ce, 0x001e, 0xd19c, 0x0904,
+	0x27bf, 0x7034, 0xd0ac, 0x1560, 0x0016, 0x0156, 0x6027, 0x0008,
+	0x602f, 0x0020, 0x20a9, 0x0006, 0x1d04, 0x2774, 0x2091, 0x6000,
+	0x1f04, 0x2774, 0x602f, 0x0000, 0x6150, 0xa185, 0x1400, 0x6052,
+	0x20a9, 0x0366, 0x1d04, 0x2782, 0x2091, 0x6000, 0x6020, 0xd09c,
+	0x1130, 0x015e, 0x6152, 0x001e, 0x6027, 0x0008, 0x0480, 0x080c,
+	0x2907, 0x1f04, 0x2782, 0x015e, 0x6152, 0x001e, 0x6027, 0x0008,
+	0x0016, 0x6028, 0xc09c, 0x602a, 0x2011, 0x0003, 0x080c, 0x8075,
+	0x2011, 0x0002, 0x080c, 0x807f, 0x080c, 0x7f59, 0x0036, 0x2019,
+	0x0000, 0x080c, 0x7fe4, 0x003e, 0x60e3, 0x0000, 0x080c, 0xb42f,
+	0x080c, 0xb44a, 0xa085, 0x0001, 0x080c, 0x5b13, 0x2001, 0xb500,
+	0x2003, 0x0004, 0x6027, 0x0008, 0x080c, 0x12dd, 0x001e, 0xa18c,
+	0xffd0, 0x6126, 0x0005, 0x0006, 0x0016, 0x0026, 0x00e6, 0x00f6,
+	0x0126, 0x2091, 0x8000, 0x2071, 0xb500, 0x71c4, 0x70c6, 0xa116,
+	0x0500, 0x81ff, 0x0128, 0x2011, 0x8011, 0x080c, 0x3ecc, 0x00c8,
+	0x2011, 0x8012, 0x080c, 0x3ecc, 0x2001, 0xb572, 0x2004, 0xd0fc,
+	0x1180, 0x0036, 0x00c6, 0x080c, 0x2892, 0x080c, 0x7f35, 0x2061,
+	0x0100, 0x2019, 0x0028, 0x2009, 0x0000, 0x080c, 0x2c6f, 0x00ce,
+	0x003e, 0x012e, 0x00fe, 0x00ee, 0x002e, 0x001e, 0x000e, 0x0005,
+	0x00c6, 0x00f6, 0x0006, 0x0026, 0x2061, 0x0100, 0xa190, 0x280b,
+	0x2205, 0x60f2, 0x2011, 0x2818, 0x2205, 0x60ee, 0x002e, 0x000e,
+	0x00fe, 0x00ce, 0x0005, 0x0840, 0x0840, 0x0840, 0x0580, 0x0420,
+	0x0348, 0x02c0, 0x0258, 0x0210, 0x01a8, 0x01a8, 0x01a8, 0x01a8,
+	0x0140, 0x00f8, 0x00d0, 0x00b0, 0x00a0, 0x2028, 0xa18c, 0x00ff,
+	0x2130, 0xa094, 0xff00, 0x1110, 0x81ff, 0x0118, 0x080c, 0x66b1,
+	0x0038, 0xa080, 0x2dc4, 0x200d, 0xa18c, 0xff00, 0x810f, 0xa006,
+	0x0005, 0xa080, 0x2dc4, 0x200d, 0xa18c, 0x00ff, 0x0005, 0x00d6,
+	0x2069, 0x0140, 0x2001, 0xb515, 0x2003, 0x00ef, 0x20a9, 0x0010,
+	0xa006, 0x6852, 0x6856, 0x1f04, 0x2842, 0x00de, 0x0005, 0x0006,
+	0x00d6, 0x0026, 0x2069, 0x0140, 0x2001, 0xb515, 0x2102, 0x8114,
+	0x8214, 0x8214, 0x8214, 0x20a9, 0x0010, 0x6853, 0x0000, 0xa006,
+	0x82ff, 0x1128, 0xa184, 0x000f, 0xa080, 0xb45e, 0x2005, 0x6856,
+	0x8211, 0x1f04, 0x2857, 0x002e, 0x00de, 0x000e, 0x0005, 0x00c6,
+	0x2061, 0xb500, 0x6030, 0x0110, 0xc09d, 0x0008, 0xc09c, 0x6032,
+	0x00ce, 0x0005, 0x0156, 0x00d6, 0x0026, 0x0016, 0x0006, 0x2069,
+	0x0140, 0x6980, 0xa116, 0x0180, 0xa112, 0x1230, 0x8212, 0x8210,
+	0x22a8, 0x2001, 0x0402, 0x0018, 0x22a8, 0x2001, 0x0404, 0x680e,
+	0x1f04, 0x2887, 0x680f, 0x0000, 0x000e, 0x001e, 0x002e, 0x00de,
+	0x015e, 0x0005, 0x2001, 0xb553, 0x2004, 0xd0c4, 0x0150, 0xd0a4,
+	0x0140, 0xa006, 0x0046, 0x2020, 0x2009, 0x002e, 0x080c, 0xb0e8,
+	0x004e, 0x0005, 0x00f6, 0x0016, 0x0026, 0x2079, 0x0140, 0x78c4,
+	0xd0dc, 0x0548, 0xa084, 0x0700, 0xa08e, 0x0300, 0x1520, 0x2011,
+	0x0000, 0x2009, 0x0002, 0x2300, 0xa080, 0x0020, 0x2018, 0x2300,
+	0x080c, 0x6b40, 0x2011, 0x0030, 0x2200, 0x8007, 0xa085, 0x004c,
+	0x78c2, 0x2009, 0x0204, 0x210c, 0x2200, 0xa100, 0x2009, 0x0138,
+	0x200a, 0x080c, 0x5acf, 0x1118, 0x2009, 0xb78f, 0x200a, 0x002e,
+	0x001e, 0x00fe, 0x0005, 0x78c3, 0x0000, 0x0cc8, 0x0126, 0x2091,
+	0x2800, 0x0006, 0x0016, 0x0026, 0x2001, 0x0170, 0x200c, 0x8000,
+	0x2014, 0xa184, 0x0003, 0x0110, 0x0804, 0x1b04, 0x002e, 0x001e,
+	0x000e, 0x012e, 0x0005, 0x0006, 0x2001, 0x0100, 0x2004, 0xa082,
+	0x0005, 0x000e, 0x0268, 0x2001, 0x0170, 0x200c, 0xa18c, 0x00ff,
+	0xa18e, 0x004c, 0x1128, 0x200c, 0xa18c, 0xff00, 0x810f, 0x0010,
+	0x2009, 0x0000, 0x2001, 0x0204, 0x2004, 0xa108, 0x0005, 0x0006,
+	0x0156, 0x00f6, 0x2079, 0x0100, 0x20a9, 0x000a, 0x7854, 0xd08c,
+	0x1110, 0x1f04, 0x290e, 0x00fe, 0x015e, 0x000e, 0x0005, 0x0016,
+	0x00c6, 0x0006, 0x2061, 0x0100, 0x6030, 0x0006, 0x6048, 0x0006,
+	0x60e4, 0x0006, 0x60e8, 0x0006, 0x6050, 0x0006, 0x60f0, 0x0006,
+	0x60ec, 0x0006, 0x600c, 0x0006, 0x6004, 0x0006, 0x6028, 0x0006,
+	0x60e0, 0x0006, 0x602f, 0x0100, 0x602f, 0x0000, 0xe000, 0xe000,
+	0xe000, 0xe000, 0x602f, 0x0040, 0x602f, 0x0000, 0x000e, 0x60e2,
+	0x000e, 0x602a, 0x000e, 0x6006, 0x000e, 0x600e, 0x000e, 0x60ee,
+	0x000e, 0x60f2, 0x000e, 0x6052, 0x000e, 0x60ea, 0x000e, 0x60e6,
+	0x000e, 0x604a, 0x000e, 0x6032, 0x6036, 0x2008, 0x080c, 0x2847,
+	0x000e, 0x00ce, 0x001e, 0x0005, 0x2009, 0x0171, 0x2104, 0xd0dc,
+	0x0140, 0x2009, 0x0170, 0x2104, 0x200b, 0x0080, 0xe000, 0xe000,
+	0x200a, 0x0005, 0x29fa, 0x29fe, 0x2a02, 0x2a08, 0x2a0e, 0x2a14,
+	0x2a1a, 0x2a22, 0x2a2a, 0x2a30, 0x2a36, 0x2a3e, 0x2a46, 0x2a4e,
+	0x2a56, 0x2a60, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad,
+	0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad,
+	0x2aad, 0x2aad, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a,
+	0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a,
+	0x2a6a, 0x2a6a, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad,
+	0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad,
+	0x2aad, 0x2aad, 0x2a6c, 0x2a6c, 0x2a72, 0x2a72, 0x2a79, 0x2a79,
+	0x2a80, 0x2a80, 0x2a89, 0x2a89, 0x2a90, 0x2a90, 0x2a99, 0x2a99,
+	0x2aa2, 0x2aa2, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad,
+	0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad,
+	0x2aad, 0x2aad, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a,
+	0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a,
+	0x2a6a, 0x2a6a, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad,
+	0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad, 0x2aad,
+	0x2aad, 0x2aad, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a,
+	0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a, 0x2a6a,
+	0x2a6a, 0x2a6a, 0x0106, 0x0006, 0x0804, 0x2ab5, 0x0106, 0x0006,
+	0x0804, 0x2ab5, 0x0106, 0x0006, 0x080c, 0x2519, 0x0804, 0x2ab5,
+	0x0106, 0x0006, 0x080c, 0x2519, 0x0804, 0x2ab5, 0x0106, 0x0006,
+	0x080c, 0x239c, 0x0804, 0x2ab5, 0x0106, 0x0006, 0x080c, 0x239c,
+	0x0804, 0x2ab5, 0x0106, 0x0006, 0x080c, 0x2519, 0x080c, 0x239c,
+	0x0804, 0x2ab5, 0x0106, 0x0006, 0x080c, 0x2519, 0x080c, 0x239c,
+	0x0804, 0x2ab5, 0x0106, 0x0006, 0x080c, 0x23f2, 0x0804, 0x2ab5,
+	0x0106, 0x0006, 0x080c, 0x23f2, 0x0804, 0x2ab5, 0x0106, 0x0006,
+	0x080c, 0x2519, 0x080c, 0x23f2, 0x0804, 0x2ab5, 0x0106, 0x0006,
+	0x080c, 0x2519, 0x080c, 0x23f2, 0x0804, 0x2ab5, 0x0106, 0x0006,
+	0x080c, 0x239c, 0x080c, 0x23f2, 0x0804, 0x2ab5, 0x0106, 0x0006,
+	0x080c, 0x239c, 0x080c, 0x23f2, 0x0804, 0x2ab5, 0x0106, 0x0006,
+	0x080c, 0x2519, 0x080c, 0x239c, 0x080c, 0x23f2, 0x0804, 0x2ab5,
+	0x0106, 0x0006, 0x080c, 0x2519, 0x080c, 0x239c, 0x080c, 0x23f2,
+	0x0804, 0x2ab5, 0xe000, 0x0cf0, 0x0106, 0x0006, 0x080c, 0x28d6,
+	0x0804, 0x2ab5, 0x0106, 0x0006, 0x080c, 0x28d6, 0x080c, 0x2519,
+	0x04e0, 0x0106, 0x0006, 0x080c, 0x28d6, 0x080c, 0x239c, 0x04a8,
+	0x0106, 0x0006, 0x080c, 0x28d6, 0x080c, 0x2519, 0x080c, 0x239c,
+	0x0460, 0x0106, 0x0006, 0x080c, 0x28d6, 0x080c, 0x23f2, 0x0428,
+	0x0106, 0x0006, 0x080c, 0x28d6, 0x080c, 0x2519, 0x080c, 0x23f2,
+	0x00e0, 0x0106, 0x0006, 0x080c, 0x28d6, 0x080c, 0x239c, 0x080c,
+	0x23f2, 0x0098, 0x0106, 0x0006, 0x080c, 0x28d6, 0x080c, 0x2519,
+	0x080c, 0x239c, 0x080c, 0x23f2, 0x0040, 0x20d1, 0x0000, 0x20d1,
+	0x0001, 0x20d1, 0x0000, 0x080c, 0x1515, 0x000e, 0x010e, 0x000d,
+	0x00c6, 0x0026, 0x0046, 0x2021, 0x0000, 0x080c, 0x5309, 0x1904,
+	0x2b95, 0x72d4, 0x2001, 0xb79e, 0x2004, 0xa005, 0x1110, 0xd29c,
+	0x0148, 0xd284, 0x1138, 0xd2bc, 0x1904, 0x2b95, 0x080c, 0x2b99,
+	0x0804, 0x2b95, 0xd2cc, 0x1904, 0x2b95, 0x080c, 0x5acf, 0x1120,
+	0x709f, 0xffff, 0x0804, 0x2b95, 0xd294, 0x0120, 0x709f, 0xffff,
+	0x0804, 0x2b95, 0x2001, 0xb515, 0x203c, 0x7288, 0xd284, 0x0904,
+	0x2b37, 0xd28c, 0x1904, 0x2b37, 0x0036, 0x739c, 0xa38e, 0xffff,
+	0x1110, 0x2019, 0x0001, 0x8314, 0xa2e0, 0xbcc0, 0x2c04, 0xa38c,
+	0x0001, 0x0120, 0xa084, 0xff00, 0x8007, 0x0010, 0xa084, 0x00ff,
+	0xa70e, 0x0560, 0xa08e, 0x0000, 0x0548, 0xa08e, 0x00ff, 0x1150,
+	0x7230, 0xd284, 0x1538, 0x7288, 0xc28d, 0x728a, 0x709f, 0xffff,
+	0x003e, 0x0428, 0x2009, 0x0000, 0x080c, 0x281d, 0x080c, 0x4f4d,
+	0x11b8, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x1150, 0x7030,
+	0xd08c, 0x0118, 0x6000, 0xd0bc, 0x0120, 0x080c, 0x2bac, 0x0140,
+	0x0028, 0x080c, 0x2cdd, 0x080c, 0x2bda, 0x0110, 0x8318, 0x0818,
+	0x739e, 0x0010, 0x709f, 0xffff, 0x003e, 0x0804, 0x2b95, 0xa780,
+	0x2dc4, 0x203d, 0xa7bc, 0xff00, 0x873f, 0x2041, 0x007e, 0x709c,
+	0xa096, 0xffff, 0x1120, 0x2009, 0x0000, 0x28a8, 0x0050, 0xa812,
+	0x0220, 0x2008, 0xa802, 0x20a8, 0x0020, 0x709f, 0xffff, 0x0804,
+	0x2b95, 0x2700, 0x0156, 0x0016, 0xa106, 0x05a0, 0xc484, 0x080c,
+	0x4fa9, 0x0120, 0x080c, 0x4f4d, 0x15a8, 0x0008, 0xc485, 0x6004,
+	0xa084, 0x00ff, 0xa086, 0x0006, 0x1130, 0x7030, 0xd08c, 0x01e8,
+	0x6000, 0xd0bc, 0x11d0, 0x7288, 0xd28c, 0x0188, 0x6004, 0xa084,
+	0x00ff, 0xa082, 0x0006, 0x02b0, 0xd484, 0x1118, 0x080c, 0x4f6c,
+	0x0028, 0x080c, 0x2d6a, 0x0170, 0x080c, 0x2d97, 0x0058, 0x080c,
+	0x2cdd, 0x080c, 0x2bda, 0x0170, 0x0028, 0x080c, 0x2d6a, 0x0110,
+	0x0419, 0x0140, 0x001e, 0x8108, 0x015e, 0x1f04, 0x2b51, 0x709f,
+	0xffff, 0x0018, 0x001e, 0x015e, 0x719e, 0x004e, 0x002e, 0x00ce,
+	0x0005, 0x00c6, 0x0016, 0x709f, 0x0001, 0x2009, 0x007e, 0x080c,
+	0x4f4d, 0x1138, 0x080c, 0x2cdd, 0x04a9, 0x0118, 0x70d4, 0xc0bd,
+	0x70d6, 0x001e, 0x00ce, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6,
+	0x2c68, 0x2001, 0xb557, 0x2004, 0xa084, 0x00ff, 0x6842, 0x080c,
+	0x9ed6, 0x01d8, 0x2d00, 0x601a, 0x080c, 0xa027, 0x601f, 0x0001,
+	0x2001, 0x0000, 0x080c, 0x4eeb, 0x2001, 0x0000, 0x080c, 0x4efd,
+	0x0126, 0x2091, 0x8000, 0x7098, 0x8000, 0x709a, 0x012e, 0x2009,
+	0x0004, 0x080c, 0x864c, 0xa085, 0x0001, 0x00ce, 0x00de, 0x007e,
+	0x001e, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2c68, 0x2001,
+	0xb557, 0x2004, 0xa084, 0x00ff, 0x6842, 0x080c, 0x9ed6, 0x0550,
+	0x2d00, 0x601a, 0x6800, 0xc0c4, 0x6802, 0x68a0, 0xa086, 0x007e,
+	0x0140, 0x6804, 0xa084, 0x00ff, 0xa086, 0x0006, 0x1110, 0x080c,
+	0x2c9c, 0x080c, 0xa027, 0x601f, 0x0001, 0x2001, 0x0000, 0x080c,
+	0x4eeb, 0x2001, 0x0002, 0x080c, 0x4efd, 0x0126, 0x2091, 0x8000,
+	0x7098, 0x8000, 0x709a, 0x012e, 0x2009, 0x0002, 0x080c, 0x864c,
+	0xa085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00c6,
+	0x0026, 0x2009, 0x0080, 0x080c, 0x4f4d, 0x1120, 0x0031, 0x0110,
+	0x70db, 0xffff, 0x002e, 0x00ce, 0x0005, 0x0016, 0x0076, 0x00d6,
+	0x00c6, 0x2c68, 0x080c, 0x85c7, 0x01e8, 0x2d00, 0x601a, 0x080c,
+	0xa027, 0x601f, 0x0001, 0x2001, 0x0000, 0x080c, 0x4eeb, 0x2001,
+	0x0002, 0x080c, 0x4efd, 0x0126, 0x2091, 0x8000, 0x080c, 0x2c9c,
+	0x70dc, 0x8000, 0x70de, 0x012e, 0x2009, 0x0002, 0x080c, 0x864c,
+	0xa085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00c6,
+	0x00d6, 0x0126, 0x2091, 0x8000, 0x2009, 0x007f, 0x080c, 0x4f4d,
+	0x1190, 0x2c68, 0x080c, 0x85c7, 0x0170, 0x2d00, 0x601a, 0x6312,
+	0x601f, 0x0001, 0x620a, 0x080c, 0xa027, 0x2009, 0x0022, 0x080c,
+	0x864c, 0xa085, 0x0001, 0x012e, 0x00de, 0x00ce, 0x0005, 0x00e6,
+	0x00c6, 0x0066, 0x0036, 0x0026, 0x080c, 0x6e01, 0x080c, 0x6da4,
+	0x080c, 0x906f, 0x2130, 0x81ff, 0x0128, 0x20a9, 0x007e, 0x2009,
+	0x0000, 0x0020, 0x20a9, 0x007f, 0x2009, 0x0000, 0x0016, 0x080c,
+	0x4fa9, 0x1120, 0x080c, 0x51aa, 0x080c, 0x4c0b, 0x001e, 0x8108,
+	0x1f04, 0x2c86, 0x86ff, 0x1110, 0x080c, 0x11f0, 0x002e, 0x003e,
+	0x006e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0036, 0x0026,
+	0x0016, 0x6218, 0x2270, 0x72a0, 0x0026, 0x2019, 0x0029, 0x080c,
+	0x6df5, 0x0076, 0x2039, 0x0000, 0x080c, 0x6d02, 0x2c08, 0x080c,
+	0xae82, 0x007e, 0x001e, 0x2e60, 0x080c, 0x51aa, 0x6210, 0x6314,
+	0x080c, 0x4c0b, 0x6212, 0x6316, 0x001e, 0x002e, 0x003e, 0x00ce,
+	0x00ee, 0x0005, 0x00e6, 0x0006, 0x6018, 0xa080, 0x0028, 0x2004,
+	0xa086, 0x0080, 0x0150, 0x2071, 0xb500, 0x7098, 0xa005, 0x0110,
+	0x8001, 0x709a, 0x000e, 0x00ee, 0x0005, 0x2071, 0xb500, 0x70dc,
+	0xa005, 0x0dc0, 0x8001, 0x70de, 0x0ca8, 0x6000, 0xc08c, 0x6002,
+	0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x0156,
+	0x2178, 0x81ff, 0x1118, 0x20a9, 0x0001, 0x0098, 0x2001, 0xb553,
+	0x2004, 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0xa006, 0x0046, 0x2020,
+	0x2009, 0x002d, 0x080c, 0xb0e8, 0x004e, 0x20a9, 0x00ff, 0x2011,
+	0x0000, 0x0026, 0xa28e, 0x007e, 0x0904, 0x2d49, 0xa28e, 0x007f,
+	0x0904, 0x2d49, 0xa28e, 0x0080, 0x05e0, 0xa288, 0xb635, 0x210c,
+	0x81ff, 0x05b8, 0x8fff, 0x1148, 0x2001, 0xb7be, 0x0006, 0x2003,
+	0x0001, 0x04d9, 0x000e, 0x2003, 0x0000, 0x00c6, 0x2160, 0x2001,
+	0x0001, 0x080c, 0x5313, 0x00ce, 0x2019, 0x0029, 0x080c, 0x6df5,
+	0x0076, 0x2039, 0x0000, 0x080c, 0x6d02, 0x00c6, 0x0026, 0x2160,
+	0x6204, 0xa294, 0x00ff, 0xa286, 0x0006, 0x1118, 0x6007, 0x0404,
+	0x0028, 0x2001, 0x0004, 0x8007, 0xa215, 0x6206, 0x002e, 0x00ce,
+	0x0016, 0x2c08, 0x080c, 0xae82, 0x001e, 0x007e, 0x2160, 0x080c,
+	0x51aa, 0x002e, 0x8210, 0x1f04, 0x2d01, 0x015e, 0x001e, 0x002e,
+	0x003e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0046, 0x0026, 0x0016,
+	0x2001, 0xb553, 0x2004, 0xd0c4, 0x0148, 0xd0a4, 0x0138, 0xa006,
+	0x2220, 0x8427, 0x2009, 0x0029, 0x080c, 0xb0e8, 0x001e, 0x002e,
+	0x004e, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x7288, 0x82ff,
+	0x01f8, 0x2011, 0xb553, 0x2214, 0xd2ac, 0x11d0, 0x2100, 0x080c,
+	0x2831, 0x81ff, 0x01b8, 0x2019, 0x0001, 0x8314, 0xa2e0, 0xbcc0,
+	0x2c04, 0xd384, 0x0120, 0xa084, 0xff00, 0x8007, 0x0010, 0xa084,
+	0x00ff, 0xa116, 0x0138, 0xa096, 0x00ff, 0x0110, 0x8318, 0x0c68,
+	0xa085, 0x0001, 0x00ce, 0x003e, 0x002e, 0x001e, 0x0005, 0x0016,
+	0x00c6, 0x0126, 0x2091, 0x8000, 0x0016, 0x0026, 0x0036, 0x2110,
+	0x0026, 0x2019, 0x0029, 0x080c, 0x8299, 0x002e, 0x080c, 0xb38d,
+	0x003e, 0x002e, 0x001e, 0xa180, 0xb635, 0x2004, 0xa065, 0x0158,
+	0x0016, 0x00c6, 0x2061, 0xb8f4, 0x001e, 0x611a, 0x080c, 0x2c9c,
+	0x001e, 0x080c, 0x4f6c, 0x012e, 0x00ce, 0x001e, 0x0005, 0x2001,
+	0xb535, 0x2004, 0xd0cc, 0x0005, 0x7eef, 0x7de8, 0x7ce4, 0x80e2,
+	0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4,
+	0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca,
+	0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3, 0x80bc, 0x80ba, 0x75b9,
+	0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2, 0x80b1, 0x80ae, 0x71ad,
+	0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7, 0x6da6, 0x6ca5, 0x6ba3,
+	0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098, 0x6797, 0x6690, 0x658f,
+	0x6488, 0x6384, 0x6282, 0x8081, 0x8080, 0x617c, 0x607a, 0x8079,
+	0x5f76, 0x8075, 0x8074, 0x8073, 0x8072, 0x8071, 0x806e, 0x5e6d,
+	0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067, 0x5a66, 0x5965, 0x5863,
+	0x575c, 0x565a, 0x5559, 0x8056, 0x8055, 0x5454, 0x5353, 0x5252,
+	0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b, 0x4e4a, 0x4d49, 0x8047,
+	0x4c46, 0x8045, 0x8043, 0x803c, 0x803a, 0x8039, 0x8036, 0x4b35,
+	0x8034, 0x4a33, 0x4932, 0x4831, 0x802e, 0x472d, 0x462c, 0x452b,
+	0x442a, 0x4329, 0x4227, 0x8026, 0x8025, 0x4123, 0x401f, 0x3f1e,
+	0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010, 0x3b0f, 0x3a08, 0x8004,
+	0x3902, 0x8001, 0x8000, 0x8000, 0x3800, 0x3700, 0x3600, 0x8000,
+	0x3500, 0x8000, 0x8000, 0x8000, 0x3400, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x8000, 0x3300, 0x3200, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x8000, 0x3100, 0x3000, 0x8000, 0x8000, 0x2f00,
+	0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000, 0x8000, 0x8000, 0x2b00,
+	0x8000, 0x2a00, 0x2900, 0x2800, 0x8000, 0x2700, 0x2600, 0x2500,
+	0x2400, 0x2300, 0x2200, 0x8000, 0x8000, 0x2100, 0x2000, 0x1f00,
+	0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000, 0x1b00, 0x1a00, 0x8000,
+	0x1900, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x1800,
+	0x8000, 0x1700, 0x1600, 0x1500, 0x8000, 0x1400, 0x1300, 0x1200,
+	0x1100, 0x1000, 0x0f00, 0x8000, 0x8000, 0x0e00, 0x0d00, 0x0c00,
+	0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000, 0x0800, 0x0700, 0x8000,
+	0x0600, 0x8000, 0x8000, 0x8000, 0x0500, 0x0400, 0x0300, 0x8000,
+	0x0200, 0x8000, 0x8000, 0x8000, 0x0100, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x8000, 0x0000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x2071, 0xb582, 0x7003, 0x0002,
+	0xa006, 0x7012, 0x7016, 0x703a, 0x703e, 0x7033, 0xb592, 0x7037,
+	0xb592, 0x7007, 0x0001, 0x2061, 0xb5d2, 0x6003, 0x0002, 0x0005,
+	0x1004, 0x2eea, 0x0e04, 0x2eea, 0x2071, 0xb582, 0x2b78, 0x7818,
+	0xd084, 0x1140, 0x2a60, 0x7820, 0xa08e, 0x0069, 0x1904, 0x2fcf,
+	0x0804, 0x2f68, 0x0005, 0x2071, 0xb582, 0x7004, 0x0002, 0x2ef3,
+	0x2ef4, 0x2efd, 0x2f0e, 0x0005, 0x1004, 0x2efc, 0x0e04, 0x2efc,
+	0x2b78, 0x7818, 0xd084, 0x01e8, 0x0005, 0x2b78, 0x2061, 0xb5d2,
+	0x6008, 0xa08e, 0x0100, 0x0128, 0xa086, 0x0200, 0x0904, 0x2fc9,
+	0x0005, 0x7014, 0x2068, 0x2a60, 0x7018, 0x0807, 0x7010, 0x2068,
+	0x6834, 0xa086, 0x0103, 0x0108, 0x0005, 0x2a60, 0x2b78, 0x7018,
+	0x0807, 0x2a60, 0x7820, 0xa08a, 0x0040, 0x1210, 0x61c4, 0x0042,
+	0x2100, 0xa08a, 0x003f, 0x1a04, 0x2fc6, 0x61c4, 0x0804, 0x2f68,
+	0x2faa, 0x2fd5, 0x2fdd, 0x2fe1, 0x2fe9, 0x2fef, 0x2ff3, 0x2fff,
+	0x3002, 0x300c, 0x300f, 0x2fc6, 0x2fc6, 0x2fc6, 0x3012, 0x2fc6,
+	0x3021, 0x3038, 0x304f, 0x30c9, 0x30ce, 0x30f7, 0x3148, 0x3159,
+	0x3178, 0x31b0, 0x31ba, 0x31c7, 0x31da, 0x31fb, 0x3204, 0x323a,
+	0x3240, 0x2fc6, 0x3269, 0x2fc6, 0x2fc6, 0x2fc6, 0x2fc6, 0x2fc6,
+	0x3270, 0x327a, 0x2fc6, 0x2fc6, 0x2fc6, 0x2fc6, 0x2fc6, 0x2fc6,
+	0x2fc6, 0x2fc6, 0x3282, 0x2fc6, 0x2fc6, 0x2fc6, 0x2fc6, 0x2fc6,
+	0x3294, 0x329e, 0x2fc6, 0x2fc6, 0x2fc6, 0x2fc6, 0x2fc6, 0x2fc6,
+	0x0002, 0x32c8, 0x331c, 0x3377, 0x3391, 0x2fc6, 0x33c2, 0x37f5,
+	0x4233, 0x2fc6, 0x2fc6, 0x2fc6, 0x2fc6, 0x2fc6, 0x2fc6, 0x2fc6,
+	0x2fc6, 0x300c, 0x300f, 0x37f7, 0x2fc6, 0x3804, 0x42cc, 0x4327,
+	0x438b, 0x2fc6, 0x43ee, 0x4418, 0x4437, 0x4469, 0x2fc6, 0x2fc6,
+	0x2fc6, 0x3808, 0x39ad, 0x39c7, 0x39e5, 0x3a46, 0x3aa6, 0x3ab1,
+	0x3ae9, 0x3af8, 0x3b07, 0x3b0a, 0x3b2d, 0x3b79, 0x3bef, 0x3bfc,
+	0x3cfd, 0x3e23, 0x3e4c, 0x3f4a, 0x3f6c, 0x3f78, 0x3fb1, 0x4075,
+	0x2fc6, 0x2fc6, 0x2fc6, 0x2fc6, 0x40dd, 0x40f8, 0x416a, 0x421c,
+	0x713c, 0x0000, 0x2021, 0x4000, 0x080c, 0x3ea9, 0x0126, 0x2091,
+	0x8000, 0x0e04, 0x2fb6, 0x7818, 0xd084, 0x0110, 0x012e, 0x0cb0,
+	0x7c22, 0x7926, 0x7a2a, 0x7b2e, 0x781b, 0x0001, 0x2091, 0x4080,
+	0x7007, 0x0001, 0x2091, 0x5000, 0x012e, 0x0005, 0x2021, 0x4001,
+	0x0c18, 0x2021, 0x4002, 0x0c00, 0x2021, 0x4003, 0x08e8, 0x2021,
+	0x4005, 0x08d0, 0x2021, 0x4006, 0x08b8, 0xa02e, 0x2520, 0x7b28,
+	0x7a2c, 0x7824, 0x7930, 0x0804, 0x3eb6, 0x7823, 0x0004, 0x7824,
+	0x0807, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0804,
+	0x3eb9, 0x7924, 0x7828, 0x2114, 0x200a, 0x0804, 0x2faa, 0x7924,
+	0x2114, 0x0804, 0x2faa, 0x2099, 0x0009, 0x20a1, 0x0009, 0x20a9,
+	0x0007, 0x53a3, 0x7924, 0x7a28, 0x7b2c, 0x0804, 0x2faa, 0x7824,
+	0x2060, 0x0090, 0x2009, 0x0002, 0x2011, 0x0002, 0x2019, 0x0006,
+	0x783b, 0x0017, 0x0804, 0x2faa, 0x7d38, 0x7c3c, 0x0840, 0x7d38,
+	0x7c3c, 0x0888, 0x2061, 0x1000, 0xe10c, 0xa006, 0x2c15, 0xa200,
+	0x8c60, 0x8109, 0x1dd8, 0x2010, 0xa005, 0x0904, 0x2faa, 0x0804,
+	0x2fcc, 0x2069, 0xb552, 0x7824, 0x7930, 0xa11a, 0x1a04, 0x2fd2,
+	0x8019, 0x0904, 0x2fd2, 0x684a, 0x6942, 0x782c, 0x6852, 0x7828,
+	0x6856, 0xa006, 0x685a, 0x685e, 0x080c, 0x5da5, 0x0804, 0x2faa,
+	0x2069, 0xb552, 0x7824, 0x7934, 0xa11a, 0x1a04, 0x2fd2, 0x8019,
+	0x0904, 0x2fd2, 0x684e, 0x6946, 0x782c, 0x6862, 0x7828, 0x6866,
+	0xa006, 0x686a, 0x686e, 0x080c, 0x53d5, 0x0804, 0x2faa, 0xa02e,
+	0x2520, 0x81ff, 0x1904, 0x2fcf, 0x7924, 0x7b28, 0x7a2c, 0x20a9,
+	0x0005, 0x20a1, 0xb589, 0x41a1, 0x080c, 0x3e75, 0x0904, 0x2fcf,
+	0x2009, 0x0020, 0x080c, 0x3eb6, 0x701b, 0x3067, 0x0005, 0x6834,
+	0x2008, 0xa084, 0x00ff, 0xa096, 0x0011, 0x0138, 0xa096, 0x0019,
+	0x0120, 0xa096, 0x0015, 0x1904, 0x2fcf, 0x810f, 0xa18c, 0x00ff,
+	0x0904, 0x2fcf, 0x710e, 0x700c, 0x8001, 0x0528, 0x700e, 0x080c,
+	0x3e75, 0x0904, 0x2fcf, 0x2009, 0x0020, 0x2061, 0xb5d2, 0x6224,
+	0x6328, 0x642c, 0x6530, 0xa290, 0x0040, 0xa399, 0x0000, 0xa4a1,
+	0x0000, 0xa5a9, 0x0000, 0x080c, 0x3eb6, 0x701b, 0x3098, 0x0005,
+	0x6834, 0xa084, 0x00ff, 0xa096, 0x0002, 0x0120, 0xa096, 0x000a,
+	0x1904, 0x2fcf, 0x08c0, 0x7010, 0x2068, 0x6838, 0xc0fd, 0x683a,
+	0x080c, 0x4e49, 0x1128, 0x7007, 0x0003, 0x701b, 0x30b2, 0x0005,
+	0x080c, 0x54db, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0005, 0x2099,
+	0xb589, 0x530a, 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000,
+	0xa5a9, 0x0000, 0xad80, 0x000d, 0x2009, 0x0020, 0x012e, 0x0804,
+	0x3eb9, 0x61ac, 0x7824, 0x60ae, 0x0804, 0x2faa, 0x2091, 0x8000,
+	0x7823, 0x4000, 0x7827, 0x4953, 0x782b, 0x5020, 0x782f, 0x2020,
+	0x2009, 0x017f, 0x2104, 0x7832, 0x3f00, 0x7836, 0x2061, 0x0100,
+	0x6200, 0x2061, 0x0200, 0x603c, 0x8007, 0xa205, 0x783a, 0x2009,
+	0x04fd, 0x2104, 0x783e, 0x781b, 0x0001, 0x2091, 0x5000, 0x2091,
+	0x4080, 0x2071, 0x0010, 0x20c1, 0x00f0, 0x0804, 0x0427, 0x81ff,
+	0x1904, 0x2fcf, 0x7924, 0x810f, 0xa18c, 0x00ff, 0x080c, 0x4fa9,
+	0x1904, 0x2fd2, 0x7e38, 0xa684, 0x3fff, 0xa082, 0x4000, 0x0210,
+	0x0804, 0x2fd2, 0x7c28, 0x7d2c, 0x080c, 0x5171, 0xd28c, 0x1118,
+	0x080c, 0x511a, 0x0010, 0x080c, 0x514a, 0x1518, 0x2061, 0xbd00,
+	0x0126, 0x2091, 0x8000, 0x6000, 0xa086, 0x0000, 0x0148, 0x6010,
+	0xa06d, 0x0130, 0x683c, 0xa406, 0x1118, 0x6840, 0xa506, 0x0150,
+	0x012e, 0xace0, 0x0018, 0x2001, 0xb517, 0x2004, 0xac02, 0x1a04,
+	0x2fcf, 0x0c30, 0x080c, 0x992a, 0x012e, 0x0904, 0x2fcf, 0x0804,
+	0x2faa, 0xa00e, 0x2001, 0x0005, 0x080c, 0x54db, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x9ed2, 0x080c, 0x5408, 0x012e, 0x0804, 0x2faa,
+	0x81ff, 0x1904, 0x2fcf, 0x080c, 0x3e8a, 0x0904, 0x2fd2, 0x080c,
+	0x506f, 0x0904, 0x2fcf, 0x080c, 0x517d, 0x0904, 0x2fcf, 0x0804,
+	0x2faa, 0x81ff, 0x1904, 0x2fcf, 0x080c, 0x3e9a, 0x0904, 0x2fd2,
+	0x080c, 0x51e9, 0x0904, 0x2fcf, 0x2019, 0x0005, 0x7924, 0x080c,
+	0x5198, 0x0904, 0x2fcf, 0x7828, 0xa08a, 0x1000, 0x1a04, 0x2fd2,
+	0x8003, 0x800b, 0x810b, 0xa108, 0x080c, 0x69a8, 0x0804, 0x2faa,
+	0x0126, 0x2091, 0x8000, 0x81ff, 0x0118, 0x2009, 0x0001, 0x0450,
+	0x2029, 0x00ff, 0x6450, 0x2400, 0xa506, 0x01f8, 0x2508, 0x080c,
+	0x4fa9, 0x11d8, 0x080c, 0x51e9, 0x1128, 0x2009, 0x0002, 0x62b4,
+	0x2518, 0x00c0, 0x2019, 0x0004, 0xa00e, 0x080c, 0x5198, 0x1118,
+	0x2009, 0x0006, 0x0078, 0x7824, 0xa08a, 0x1000, 0x1270, 0x8003,
+	0x800b, 0x810b, 0xa108, 0x080c, 0x69a8, 0x8529, 0x1ae0, 0x012e,
+	0x0804, 0x2faa, 0x012e, 0x0804, 0x2fcf, 0x012e, 0x0804, 0x2fd2,
+	0x080c, 0x3e8a, 0x0904, 0x2fd2, 0x080c, 0x50d5, 0x080c, 0x5171,
+	0x0804, 0x2faa, 0x81ff, 0x1904, 0x2fcf, 0x080c, 0x3e8a, 0x0904,
+	0x2fd2, 0x080c, 0x50c6, 0x080c, 0x5171, 0x0804, 0x2faa, 0x81ff,
+	0x1904, 0x2fcf, 0x080c, 0x3e8a, 0x0904, 0x2fd2, 0x080c, 0x514c,
+	0x0904, 0x2fcf, 0x080c, 0x4e8d, 0x080c, 0x5113, 0x080c, 0x5171,
+	0x0804, 0x2faa, 0x080c, 0x3e8a, 0x0904, 0x2fd2, 0x080c, 0x506f,
+	0x0904, 0x2fcf, 0x62a0, 0x2019, 0x0005, 0x00c6, 0x080c, 0x51aa,
+	0x2061, 0x0000, 0x080c, 0x6df5, 0x0076, 0x2039, 0x0000, 0x080c,
+	0x6d02, 0x2009, 0x0000, 0x080c, 0xae82, 0x007e, 0x00ce, 0x080c,
+	0x5171, 0x0804, 0x2faa, 0x080c, 0x3e8a, 0x0904, 0x2fd2, 0x080c,
+	0x5171, 0x2208, 0x0804, 0x2faa, 0x0156, 0x00d6, 0x00e6, 0x2069,
+	0xb614, 0x6810, 0x6914, 0xa10a, 0x1210, 0x2009, 0x0000, 0x6816,
+	0x2011, 0x0000, 0x2019, 0x0000, 0x20a9, 0x007e, 0x2069, 0xb635,
+	0x2d04, 0xa075, 0x0130, 0x704c, 0x0071, 0xa210, 0x7080, 0x0059,
+	0xa318, 0x8d68, 0x1f04, 0x3218, 0x2300, 0xa218, 0x00ee, 0x00de,
+	0x015e, 0x0804, 0x2faa, 0x00f6, 0x0016, 0xa07d, 0x0140, 0x2001,
+	0x0000, 0x8000, 0x2f0c, 0x81ff, 0x0110, 0x2178, 0x0cd0, 0x001e,
+	0x00fe, 0x0005, 0x2069, 0xb614, 0x6910, 0x62b0, 0x0804, 0x2faa,
+	0x81ff, 0x1904, 0x2fcf, 0x6150, 0xa190, 0x2dc4, 0x2215, 0xa294,
+	0x00ff, 0x6370, 0x83ff, 0x0108, 0x6274, 0x67d4, 0xd79c, 0x0118,
+	0x2031, 0x0001, 0x0090, 0xd7ac, 0x0118, 0x2031, 0x0003, 0x0068,
+	0xd7a4, 0x0118, 0x2031, 0x0002, 0x0040, 0x080c, 0x5acf, 0x1118,
+	0x2031, 0x0004, 0x0010, 0x2031, 0x0000, 0x7e3a, 0x7f3e, 0x0804,
+	0x2faa, 0x6140, 0x6244, 0x2019, 0xb7b6, 0x231c, 0x0804, 0x2faa,
+	0x0126, 0x2091, 0x8000, 0x6134, 0xa006, 0x2010, 0x6338, 0x012e,
+	0x0804, 0x2faa, 0x080c, 0x3e9a, 0x0904, 0x2fd2, 0x6244, 0x6338,
+	0x0804, 0x2faa, 0x6140, 0x6244, 0x7824, 0x6042, 0x7b28, 0x6346,
+	0x2069, 0xb552, 0x831f, 0xa305, 0x6816, 0x782c, 0x2069, 0xb7b6,
+	0x2d1c, 0x206a, 0x0804, 0x2faa, 0x0126, 0x2091, 0x8000, 0x7824,
+	0x6036, 0x782c, 0x603a, 0x012e, 0x0804, 0x2faa, 0x7838, 0xa005,
+	0x01a8, 0x7828, 0xa025, 0x0904, 0x2fd2, 0x782c, 0xa02d, 0x0904,
+	0x2fd2, 0xa00e, 0x080c, 0x4fa9, 0x1120, 0x6244, 0x6338, 0x6446,
+	0x653a, 0xa186, 0x00ff, 0x0190, 0x8108, 0x0ca0, 0x080c, 0x3e9a,
+	0x0904, 0x2fd2, 0x7828, 0xa00d, 0x0904, 0x2fd2, 0x782c, 0xa005,
+	0x0904, 0x2fd2, 0x6244, 0x6146, 0x6338, 0x603a, 0x0804, 0x2faa,
+	0x2001, 0xb500, 0x2004, 0xa086, 0x0003, 0x1904, 0x2fcf, 0x00c6,
+	0x2061, 0x0100, 0x7924, 0x810f, 0xa18c, 0x00ff, 0xa196, 0x00ff,
+	0x1130, 0x2001, 0xb515, 0x2004, 0xa085, 0xff00, 0x0078, 0xa182,
+	0x007f, 0x16a0, 0xa188, 0x2dc4, 0x210d, 0xa18c, 0x00ff, 0x2001,
+	0xb515, 0x2004, 0xa116, 0x0550, 0x810f, 0xa105, 0x0126, 0x2091,
+	0x8000, 0x0006, 0x080c, 0x85c7, 0x000e, 0x01e0, 0x601a, 0x600b,
+	0xbc09, 0x601f, 0x0001, 0x080c, 0x3e75, 0x01d8, 0x6837, 0x0000,
+	0x7007, 0x0003, 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x701b,
+	0x3370, 0x2d00, 0x6012, 0x2009, 0x0032, 0x080c, 0x864c, 0x012e,
+	0x00ce, 0x0005, 0x012e, 0x00ce, 0x0804, 0x2fcf, 0x00ce, 0x0804,
+	0x2fd2, 0x080c, 0x861d, 0x0cb0, 0x2001, 0xb500, 0x2004, 0xa086,
+	0x0003, 0x1904, 0x2fcf, 0x00c6, 0x2061, 0x0100, 0x7924, 0x810f,
+	0xa18c, 0x00ff, 0xa196, 0x00ff, 0x1130, 0x2001, 0xb515, 0x2004,
+	0xa085, 0xff00, 0x0078, 0xa182, 0x007f, 0x16a0, 0xa188, 0x2dc4,
+	0x210d, 0xa18c, 0x00ff, 0x2001, 0xb515, 0x2004, 0xa116, 0x0550,
+	0x810f, 0xa105, 0x0126, 0x2091, 0x8000, 0x0006, 0x080c, 0x85c7,
+	0x000e, 0x01e0, 0x601a, 0x600b, 0xbc05, 0x601f, 0x0001, 0x080c,
+	0x3e75, 0x01d8, 0x6837, 0x0000, 0x7007, 0x0003, 0x6833, 0x0000,
+	0x6838, 0xc0fd, 0x683a, 0x701b, 0x3370, 0x2d00, 0x6012, 0x2009,
+	0x0032, 0x080c, 0x864c, 0x012e, 0x00ce, 0x0005, 0x012e, 0x00ce,
+	0x0804, 0x2fcf, 0x00ce, 0x0804, 0x2fd2, 0x080c, 0x861d, 0x0cb0,
+	0x6830, 0xa086, 0x0100, 0x0904, 0x2fcf, 0x0804, 0x2faa, 0x2061,
+	0xb874, 0x0126, 0x2091, 0x8000, 0x6000, 0xd084, 0x0178, 0x6104,
+	0x6208, 0x2a60, 0x6068, 0x783a, 0x60b4, 0x783e, 0x60b0, 0x2019,
+	0x0072, 0x201a, 0x6348, 0x012e, 0x0804, 0x2faa, 0xa00e, 0x2110,
+	0x0c80, 0x81ff, 0x1904, 0x2fcf, 0x080c, 0x5acf, 0x0904, 0x2fcf,
+	0x0126, 0x2091, 0x8000, 0x6248, 0x6068, 0xa202, 0x0248, 0xa085,
+	0x0001, 0x080c, 0x2867, 0x080c, 0x462c, 0x012e, 0x0804, 0x2faa,
+	0x012e, 0x0804, 0x2fd2, 0x0006, 0x0016, 0x00c6, 0x00e6, 0x2001,
+	0xb7bf, 0x2070, 0x2061, 0xb552, 0x6008, 0x2072, 0x2009, 0x0000,
+	0x2011, 0x1000, 0x080c, 0x6b40, 0x7206, 0x00ee, 0x00ce, 0x001e,
+	0x000e, 0x0005, 0x0126, 0x2091, 0x8000, 0x7824, 0xa084, 0x0007,
+	0x0002, 0x33d4, 0x33dd, 0x33e4, 0x33d1, 0x33d1, 0x33d1, 0x33d1,
+	0x33d1, 0x012e, 0x0804, 0x2fd2, 0x2009, 0x0114, 0x2104, 0xa085,
+	0x0800, 0x200a, 0x080c, 0x354f, 0x0070, 0x2009, 0x010b, 0x200b,
+	0x0010, 0x080c, 0x354f, 0x0038, 0x81ff, 0x0128, 0x012e, 0x2021,
+	0x400b, 0x0804, 0x2fac, 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6,
+	0x00d6, 0x00e6, 0x00f6, 0x080c, 0x33ab, 0x2009, 0x0101, 0x210c,
+	0x0016, 0x2001, 0x0138, 0x200c, 0x2003, 0x0001, 0x0016, 0x2001,
+	0x007a, 0x2034, 0x2001, 0x007b, 0x202c, 0xa006, 0x2048, 0x2050,
+	0x2058, 0x080c, 0x379a, 0x080c, 0x36fe, 0xa03e, 0x2720, 0x00f6,
+	0x00e6, 0x00c6, 0x2d60, 0x2071, 0xb84a, 0x2079, 0x0020, 0x00d6,
+	0x2069, 0x0000, 0x6824, 0xd0b4, 0x0140, 0x2001, 0x007d, 0x2004,
+	0x783e, 0x2001, 0x007c, 0x2004, 0x783a, 0x00de, 0x2011, 0x0001,
+	0x080c, 0x36aa, 0x080c, 0x36aa, 0x00ce, 0x00ee, 0x00fe, 0x080c,
+	0x35f5, 0x080c, 0x36d2, 0x080c, 0x364f, 0x080c, 0x35b4, 0x080c,
+	0x35e5, 0x00f6, 0x2079, 0x0100, 0x7824, 0xd094, 0x0530, 0x7814,
+	0xa084, 0x0184, 0xa085, 0x0010, 0x7816, 0x2079, 0x0140, 0x080c,
+	0x352d, 0x1110, 0x00fe, 0x0430, 0x7804, 0xd0dc, 0x0dc0, 0x2079,
+	0x0100, 0x7827, 0x0086, 0x7814, 0xa084, 0x0184, 0xa085, 0x0032,
+	0x7816, 0x080c, 0x352d, 0x1110, 0x00fe, 0x00a0, 0x7824, 0xd0bc,
+	0x0dc0, 0x7827, 0x0080, 0xa026, 0x7c16, 0x7824, 0xd0ac, 0x0130,
+	0x8b58, 0x080c, 0x3537, 0x00fe, 0x0804, 0x34f7, 0x00fe, 0x080c,
+	0x352d, 0x1150, 0x8948, 0x2001, 0x007a, 0x2602, 0x2001, 0x007b,
+	0x2502, 0x080c, 0x3537, 0x0088, 0x87ff, 0x0140, 0x2001, 0x0201,
+	0x2004, 0xa005, 0x1904, 0x3431, 0x8739, 0x0038, 0x2001, 0xb823,
+	0x2004, 0xa086, 0x0000, 0x1904, 0x3431, 0x2001, 0x0033, 0x2003,
+	0x00f6, 0x8631, 0x1208, 0x8529, 0x2500, 0xa605, 0x0904, 0x34f7,
+	0x7824, 0xd0bc, 0x0128, 0x2900, 0xaa05, 0xab05, 0x1904, 0x34f7,
+	0x6033, 0x000d, 0x2001, 0x0030, 0x2003, 0x0004, 0x7824, 0xd0ac,
+	0x1148, 0x2001, 0xb823, 0x2003, 0x0003, 0x2001, 0x0030, 0x2003,
+	0x0009, 0x0040, 0x6027, 0x0001, 0x2001, 0x0075, 0x2004, 0xa005,
+	0x0108, 0x6026, 0x2c00, 0x601a, 0x20e1, 0x9040, 0x2d00, 0x681a,
+	0x6833, 0x000d, 0x7824, 0xd0a4, 0x1180, 0x6827, 0x0000, 0x00c6,
+	0x20a9, 0x0004, 0x2061, 0x0020, 0x6003, 0x0008, 0x2001, 0x0203,
+	0x2004, 0x1f04, 0x34cc, 0x00ce, 0x0040, 0x6827, 0x0001, 0x2001,
+	0x0074, 0x2004, 0xa005, 0x0108, 0x6826, 0x00f6, 0x00c6, 0x2079,
+	0x0100, 0x2061, 0x0020, 0x7827, 0x0002, 0x2001, 0x0072, 0x2004,
+	0xa084, 0xfff8, 0x601a, 0x0006, 0x2001, 0x0073, 0x2004, 0x601e,
+	0x78c6, 0x000e, 0x78ca, 0x00ce, 0x00fe, 0x0804, 0x340f, 0x2061,
+	0x0100, 0x6027, 0x0002, 0x001e, 0x61e2, 0x001e, 0x6106, 0x7824,
+	0xa084, 0x0003, 0xa086, 0x0002, 0x0188, 0x20e1, 0x9028, 0x6050,
+	0xa084, 0xf7ef, 0x6052, 0x602f, 0x0000, 0x602c, 0xc0ac, 0x602e,
+	0x604b, 0xf7f7, 0x6043, 0x0090, 0x6043, 0x0010, 0x2908, 0x2a10,
+	0x2b18, 0x2b00, 0xaa05, 0xa905, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x00be, 0x00ae, 0x009e, 0x008e, 0x1118, 0x012e, 0x0804, 0x2faa,
+	0x012e, 0x2021, 0x400c, 0x0804, 0x2fac, 0xa085, 0x0001, 0x1d04,
+	0x3536, 0x2091, 0x6000, 0x8420, 0xa486, 0x0064, 0x0005, 0x2001,
+	0x0105, 0x2003, 0x0010, 0x2001, 0x0030, 0x2003, 0x0004, 0x2001,
+	0x0020, 0x2003, 0x0004, 0x2001, 0xb823, 0x2003, 0x0000, 0x2001,
+	0xb84a, 0x2003, 0x0000, 0x20e1, 0xf000, 0xa026, 0x0005, 0x00f6,
+	0x2079, 0x0100, 0x2001, 0xb515, 0x200c, 0x7932, 0x7936, 0x080c,
+	0x2847, 0x7850, 0xa084, 0x0980, 0xa085, 0x0030, 0x7852, 0x2019,
+	0x01f4, 0x8319, 0x1df0, 0xa084, 0x0980, 0x7852, 0x782c, 0xc0ad,
+	0x782e, 0x20a9, 0x0046, 0x1d04, 0x356b, 0x2091, 0x6000, 0x1f04,
+	0x356b, 0x7850, 0xa085, 0x0400, 0x7852, 0x2001, 0x0009, 0x2004,
+	0xa084, 0x0003, 0xa086, 0x0001, 0x1118, 0x782c, 0xc0ac, 0x782e,
+	0x784b, 0xf7f7, 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9, 0x000e,
+	0xe000, 0x1f04, 0x3588, 0x7850, 0xa085, 0x1400, 0x7852, 0x2019,
+	0x61a8, 0x7854, 0xe000, 0xe000, 0xd08c, 0x1110, 0x8319, 0x1dc8,
+	0x7827, 0x0048, 0x7850, 0xa085, 0x0400, 0x7852, 0x7843, 0x0040,
+	0x2019, 0x01f4, 0xe000, 0xe000, 0x8319, 0x1de0, 0x2001, 0x0140,
+	0x2003, 0x0100, 0x7827, 0x0020, 0x7843, 0x0000, 0x2003, 0x0000,
+	0x7827, 0x0048, 0x00fe, 0x0005, 0x7824, 0xd0ac, 0x11c8, 0x00f6,
+	0x00e6, 0x2071, 0xb823, 0x2079, 0x0030, 0x2001, 0x0201, 0x2004,
+	0xa005, 0x0160, 0x7000, 0xa086, 0x0000, 0x1140, 0x0051, 0xd0bc,
+	0x0108, 0x8738, 0x7003, 0x0003, 0x7803, 0x0019, 0x00ee, 0x00fe,
+	0x0005, 0x780c, 0xa08c, 0x0070, 0x0178, 0x2009, 0x007a, 0x260a,
+	0x2009, 0x007b, 0x250a, 0xd0b4, 0x0108, 0x8a50, 0xd0ac, 0x0108,
+	0x8948, 0xd0a4, 0x0108, 0x8b58, 0x0005, 0x00f6, 0x2079, 0x0200,
+	0x781c, 0xd084, 0x0140, 0x20e1, 0x0007, 0x20e1, 0x2000, 0x2001,
+	0x020a, 0x2004, 0x0ca8, 0x00fe, 0x0005, 0x00e6, 0x2071, 0x0100,
+	0x2001, 0xb7c0, 0x2004, 0x70e2, 0x2009, 0xb515, 0x210c, 0x716e,
+	0x7063, 0x0100, 0x7166, 0x719e, 0x706b, 0x0000, 0x7073, 0x0809,
+	0x7077, 0x0008, 0x7078, 0xa080, 0x0100, 0x707a, 0x7080, 0x8000,
+	0x7082, 0x7087, 0xaaaa, 0xa006, 0x708a, 0x708e, 0x707e, 0x70d6,
+	0x70ab, 0x0036, 0x70af, 0x95d5, 0x7027, 0x0080, 0x7014, 0xa084,
+	0x0184, 0xa085, 0x0032, 0x7016, 0x080c, 0x36d2, 0x080c, 0x352d,
+	0x1110, 0x8421, 0x0028, 0x7024, 0xd0bc, 0x0db0, 0x7027, 0x0080,
+	0x00f6, 0x00e6, 0x2071, 0xb823, 0x2079, 0x0030, 0x00d6, 0x2069,
+	0x0000, 0x6824, 0xd0b4, 0x0120, 0x683c, 0x783e, 0x6838, 0x783a,
+	0x00de, 0x2011, 0x0011, 0x080c, 0x36aa, 0x2011, 0x0001, 0x080c,
+	0x36aa, 0x00ee, 0x00fe, 0x7017, 0x0000, 0x00ee, 0x0005, 0x00f6,
+	0x00e6, 0x2071, 0xb823, 0x2079, 0x0030, 0x7904, 0xd1fc, 0x0904,
+	0x36a7, 0x7803, 0x0002, 0xa026, 0xd19c, 0x1904, 0x36a3, 0x7000,
+	0x0002, 0x36a7, 0x3665, 0x3689, 0x36a3, 0xd1bc, 0x1150, 0xd1dc,
+	0x1150, 0x8001, 0x7002, 0x2011, 0x0001, 0x04e1, 0x05c0, 0x04d1,
+	0x04b0, 0x780f, 0x0000, 0x7820, 0x7924, 0x7803, 0x0004, 0x7822,
+	0x7926, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0de8, 0x080c, 0x35d1,
+	0x2009, 0x0001, 0x7808, 0xd0ec, 0x0110, 0x2009, 0x0011, 0x7902,
+	0x00f0, 0x8001, 0x7002, 0xa184, 0x0880, 0x1138, 0x7804, 0xd0fc,
+	0x1940, 0x2011, 0x0001, 0x00b1, 0x0090, 0x6030, 0xa092, 0x0004,
+	0xa086, 0x0009, 0x1120, 0x6000, 0x601a, 0x2011, 0x0025, 0x6232,
+	0xd1dc, 0x1988, 0x0870, 0x7803, 0x0004, 0x7003, 0x0000, 0x00ee,
+	0x00fe, 0x0005, 0x6024, 0xa005, 0x0520, 0x8001, 0x6026, 0x6018,
+	0x6130, 0xa140, 0x2804, 0x7832, 0x8840, 0x2804, 0x7836, 0x8840,
+	0x2804, 0x7822, 0x8840, 0x2804, 0x7826, 0x8840, 0x7a02, 0x7000,
+	0x8000, 0x7002, 0x6018, 0xa802, 0xa08a, 0x0029, 0x1138, 0x6018,
+	0xa080, 0x0001, 0x2004, 0x601a, 0x2001, 0x000d, 0x6032, 0xa085,
+	0x0001, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x2071, 0xb84a, 0x2079,
+	0x0020, 0x7904, 0xd1fc, 0x01f0, 0x7803, 0x0002, 0x2d60, 0xa026,
+	0x7000, 0x0002, 0x36fa, 0x36e5, 0x36f1, 0x8001, 0x7002, 0xd19c,
+	0x1188, 0x2011, 0x0001, 0x080c, 0x36aa, 0x0160, 0x080c, 0x36aa,
+	0x0048, 0x8001, 0x7002, 0x7804, 0xd0fc, 0x1d30, 0x2011, 0x0001,
+	0x080c, 0x36aa, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x00e6,
+	0x00c6, 0x2061, 0x0200, 0x2001, 0xb7c0, 0x2004, 0x601a, 0x2061,
+	0x0100, 0x2001, 0xb7bf, 0x2004, 0x60ce, 0x6004, 0xc0ac, 0xa085,
+	0x0200, 0x6006, 0x2001, 0x0074, 0x2004, 0xa005, 0x01f8, 0x2038,
+	0x2001, 0x0076, 0x2024, 0x2001, 0x0077, 0x201c, 0x080c, 0x3e75,
+	0x6833, 0x000d, 0x6f26, 0x2d00, 0x681a, 0xa78a, 0x0007, 0x0220,
+	0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0xa03e, 0x6818, 0xa080,
+	0x000d, 0x04b1, 0x1d90, 0x2d00, 0x681a, 0x0088, 0x080c, 0x3e75,
+	0x6833, 0x000d, 0x2070, 0x6827, 0x0001, 0x2d00, 0x681a, 0x2001,
+	0x0076, 0x2004, 0x2072, 0x2001, 0x0077, 0x2004, 0x7006, 0x2061,
+	0x0020, 0x2079, 0x0100, 0x2001, 0xb7bf, 0x2004, 0x6012, 0x20e1,
+	0x9040, 0x2001, 0x0072, 0x2004, 0xa084, 0xfff8, 0x700a, 0x601a,
+	0x0006, 0x2001, 0x0073, 0x2004, 0x700e, 0x601e, 0x78c6, 0x000e,
+	0x78ca, 0xa006, 0x603a, 0x603e, 0x00ce, 0x00ee, 0x00fe, 0x0005,
+	0x00e6, 0x2071, 0x0010, 0x20a0, 0x2099, 0x0014, 0x7003, 0x0026,
+	0x7432, 0x7336, 0xa006, 0x703a, 0x703e, 0x810b, 0x810b, 0x21a8,
+	0x810b, 0x7122, 0x7003, 0x0041, 0x7004, 0xd0fc, 0x0de8, 0x7003,
+	0x0002, 0x7003, 0x0040, 0x53a5, 0x7430, 0x7334, 0x87ff, 0x0180,
+	0x00c6, 0x00d6, 0x2d60, 0x00c6, 0x080c, 0x3e75, 0x00ce, 0x6018,
+	0x2070, 0x2d00, 0x7006, 0x601a, 0x00de, 0x00ce, 0xa085, 0x0001,
+	0x00ee, 0x0005, 0x00e6, 0x2001, 0x0075, 0x2004, 0xa005, 0x0508,
+	0x2038, 0x2001, 0x0078, 0x2024, 0x2001, 0x0079, 0x201c, 0x080c,
+	0x3e75, 0x2d60, 0x6833, 0x000d, 0x6f26, 0x2d00, 0x681a, 0xa78a,
+	0x0007, 0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0xa03e,
+	0x6818, 0xa080, 0x000d, 0x080c, 0x3768, 0x1d88, 0x2d00, 0x681a,
+	0x00e0, 0x080c, 0x3e75, 0x2d60, 0x6033, 0x000d, 0x2070, 0x6027,
+	0x0001, 0x2c00, 0x601a, 0x2001, 0x0078, 0x2004, 0x2072, 0x2001,
+	0x0079, 0x2004, 0x7006, 0x2001, 0x0072, 0x2004, 0xa084, 0xfff8,
+	0x700a, 0x2001, 0x0073, 0x2004, 0x700e, 0x2001, 0x0030, 0x2003,
+	0x0004, 0x7824, 0xd0ac, 0x1178, 0x2001, 0x0101, 0x200c, 0xc1ed,
+	0x2102, 0x6027, 0x0000, 0x2001, 0xb823, 0x2003, 0x0003, 0x2001,
+	0x0030, 0x2003, 0x0009, 0x00ee, 0x0005, 0x0804, 0x2faa, 0x0126,
+	0x2091, 0x8000, 0x20a9, 0x0012, 0x2001, 0xb540, 0x20a0, 0xa006,
+	0x40a4, 0x012e, 0x0804, 0x2faa, 0x7d38, 0x7c3c, 0x0804, 0x3051,
+	0x080c, 0x3e75, 0x0904, 0x2fcf, 0x080c, 0x5acf, 0x0110, 0x080c,
+	0x4bf0, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x080c,
+	0x3eb6, 0x701b, 0x381c, 0x0005, 0xade8, 0x000d, 0x6800, 0xa005,
+	0x0904, 0x2fd2, 0x6804, 0xd0ac, 0x0118, 0xd0a4, 0x0904, 0x2fd2,
+	0xd094, 0x00c6, 0x2061, 0x0100, 0x6104, 0x0138, 0x6200, 0xa292,
+	0x0005, 0x0218, 0xa18c, 0xffdf, 0x0010, 0xa18d, 0x0020, 0x6106,
+	0x00ce, 0xd08c, 0x00c6, 0x2061, 0x0100, 0x6104, 0x0118, 0xa18d,
+	0x0010, 0x0010, 0xa18c, 0xffef, 0x6106, 0x00ce, 0x2009, 0x0100,
+	0x210c, 0xa18a, 0x0002, 0x0268, 0xd084, 0x0158, 0x6a28, 0xa28a,
+	0x007f, 0x1a04, 0x2fd2, 0xa288, 0x2dc4, 0x210d, 0xa18c, 0x00ff,
+	0x615a, 0xd0dc, 0x0130, 0x6828, 0xa08a, 0x007f, 0x1a04, 0x2fd2,
+	0x6052, 0x6808, 0xa08a, 0x0100, 0x0a04, 0x2fd2, 0xa08a, 0x0841,
+	0x1a04, 0x2fd2, 0xa084, 0x0007, 0x1904, 0x2fd2, 0x680c, 0xa005,
+	0x0904, 0x2fd2, 0x6810, 0xa005, 0x0904, 0x2fd2, 0x6848, 0x6940,
+	0xa10a, 0x1a04, 0x2fd2, 0x8001, 0x0904, 0x2fd2, 0x684c, 0x6944,
+	0xa10a, 0x1a04, 0x2fd2, 0x8001, 0x0904, 0x2fd2, 0x6804, 0xd0fc,
+	0x0560, 0x080c, 0x3e75, 0x0904, 0x2fcf, 0x2009, 0x0014, 0x7a2c,
+	0x7b28, 0x7c3c, 0x7d38, 0xa290, 0x0038, 0xa399, 0x0000, 0x080c,
+	0x3eb6, 0x701b, 0x389c, 0x0005, 0xade8, 0x000d, 0x20a9, 0x0014,
+	0x2d98, 0x2069, 0xb56e, 0x2da0, 0x53a3, 0x7010, 0xa0e8, 0x000d,
+	0x2001, 0xb572, 0x200c, 0xd1e4, 0x0140, 0x00c6, 0x2061, 0x0100,
+	0x6004, 0xa085, 0x0b00, 0x6006, 0x00ce, 0x2009, 0xb7b1, 0x200b,
+	0x0000, 0x2001, 0xb574, 0x2004, 0xd0ac, 0x0158, 0x7824, 0x200a,
+	0x2009, 0x017f, 0x200a, 0x3200, 0xa084, 0x003f, 0xa085, 0x3020,
+	0x2090, 0x20a9, 0x001c, 0x2d98, 0x2069, 0xb552, 0x2da0, 0x53a3,
+	0x6814, 0xa08c, 0x00ff, 0x6142, 0x8007, 0xa084, 0x00ff, 0x6046,
+	0x080c, 0x5da5, 0x080c, 0x536c, 0x080c, 0x53d5, 0x6000, 0xa086,
+	0x0000, 0x1904, 0x3997, 0x6808, 0x602a, 0x080c, 0x2470, 0x0006,
+	0x2001, 0x0100, 0x2004, 0xa082, 0x0005, 0x000e, 0x0268, 0x2009,
+	0x0170, 0x200b, 0x0080, 0xe000, 0xe000, 0x200b, 0x0000, 0x0036,
+	0x6b08, 0x080c, 0x28a2, 0x003e, 0x6818, 0x691c, 0x6a20, 0x6b24,
+	0x8007, 0x810f, 0x8217, 0x831f, 0x6016, 0x611a, 0x621e, 0x6322,
+	0x6c04, 0xd4f4, 0x0148, 0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007,
+	0x810f, 0x8217, 0x831f, 0x0010, 0xa084, 0xf0ff, 0x6006, 0x610a,
+	0x620e, 0x6312, 0x8007, 0x810f, 0x8217, 0x831f, 0x20a9, 0x0004,
+	0x20a1, 0xb7c6, 0x40a1, 0x080c, 0x6a68, 0x6904, 0xd1fc, 0x0520,
+	0x00c6, 0x2009, 0x0000, 0x20a9, 0x0001, 0x6b70, 0xd384, 0x01c8,
+	0x0020, 0x839d, 0x12b0, 0x3508, 0x8109, 0x080c, 0x635c, 0x6878,
+	0x6016, 0x6874, 0x2008, 0xa084, 0xff00, 0x8007, 0x600a, 0xa184,
+	0x00ff, 0x6006, 0x8108, 0x1118, 0x6003, 0x0003, 0x0010, 0x6003,
+	0x0001, 0x1f04, 0x3931, 0x00ce, 0x2069, 0xb552, 0x2001, 0xb79e,
+	0x6a80, 0xa294, 0x0030, 0xa28e, 0x0000, 0x0170, 0xa28e, 0x0010,
+	0x0118, 0xa28e, 0x0020, 0x0140, 0x2003, 0xaaaa, 0x080c, 0x28eb,
+	0x2001, 0xb78f, 0x2102, 0x0008, 0x2102, 0x00c6, 0x2061, 0x0100,
+	0x602f, 0x0040, 0x602f, 0x0000, 0x00ce, 0x080c, 0x5acf, 0x0128,
+	0x080c, 0x40cf, 0x0110, 0x080c, 0x2867, 0x60c8, 0xa005, 0x01d0,
+	0x6003, 0x0001, 0x2009, 0x397d, 0x00e0, 0x080c, 0x5acf, 0x1178,
+	0x2011, 0x59a2, 0x080c, 0x699c, 0x2011, 0x5995, 0x080c, 0x6a5c,
+	0x2001, 0xb79f, 0x2003, 0x0000, 0x080c, 0x5a07, 0x0040, 0x080c,
+	0x4b1f, 0x0028, 0x6003, 0x0004, 0x2009, 0x3997, 0x0010, 0x0804,
+	0x2faa, 0x2001, 0x0100, 0x2004, 0xa082, 0x0005, 0x0258, 0x2001,
+	0x0170, 0x2004, 0xa084, 0x00ff, 0xa086, 0x004c, 0x1118, 0x2091,
+	0x309d, 0x0817, 0x2091, 0x301d, 0x0817, 0x6000, 0xa086, 0x0000,
+	0x0904, 0x2fcf, 0x2069, 0xb552, 0x7830, 0x6842, 0x7834, 0x6846,
+	0x6804, 0xd0fc, 0x0118, 0x2009, 0x0030, 0x0010, 0x2009, 0x001c,
+	0x2d00, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0804, 0x3eb9, 0xa006,
+	0x080c, 0x2867, 0x81ff, 0x1904, 0x2fcf, 0x080c, 0x5acf, 0x1178,
+	0x2001, 0xb79f, 0x2003, 0x0001, 0x2001, 0xb500, 0x2003, 0x0001,
+	0xa085, 0x0001, 0x080c, 0x5b13, 0x080c, 0x5a07, 0x0020, 0x080c,
+	0x4bf0, 0x080c, 0x4b1f, 0x0804, 0x2faa, 0x81ff, 0x1904, 0x2fcf,
+	0x080c, 0x5acf, 0x1110, 0x0804, 0x2fcf, 0x6188, 0x81ff, 0x0198,
+	0x703f, 0x0000, 0x2001, 0xbcc0, 0x2009, 0x0040, 0x7a2c, 0x7b28,
+	0x7c3c, 0x7d38, 0x0126, 0x2091, 0x8000, 0x080c, 0x3eb9, 0x701b,
+	0x2fa8, 0x012e, 0x0005, 0x703f, 0x0001, 0x00d6, 0x2069, 0xbcc0,
+	0x20a9, 0x0040, 0x20a1, 0xbcc0, 0x2019, 0xffff, 0x43a4, 0x6550,
+	0xa588, 0x2dc4, 0x210d, 0xa18c, 0x00ff, 0x216a, 0xa00e, 0x2011,
+	0x0002, 0x2100, 0xa506, 0x01a8, 0x080c, 0x4fa9, 0x1190, 0x6014,
+	0x821c, 0x0238, 0xa398, 0xbcc0, 0xa085, 0xff00, 0x8007, 0x201a,
+	0x0038, 0xa398, 0xbcc0, 0x2324, 0xa4a4, 0xff00, 0xa405, 0x201a,
+	0x8210, 0x8108, 0xa182, 0x0080, 0x1208, 0x0c18, 0x8201, 0x8007,
+	0x2d0c, 0xa105, 0x206a, 0x00de, 0x20a9, 0x0040, 0x20a1, 0xbcc0,
+	0x2099, 0xbcc0, 0x080c, 0x4b8f, 0x0804, 0x39f2, 0x080c, 0x3e9a,
+	0x0904, 0x2fd2, 0x00c6, 0x080c, 0x3e75, 0x00ce, 0x1120, 0x2009,
+	0x0002, 0x0804, 0x2fcf, 0x2001, 0xb553, 0x2004, 0xd0b4, 0x0550,
+	0x7824, 0xa084, 0xff00, 0xa08e, 0x7e00, 0x0520, 0xa08e, 0x7f00,
+	0x0508, 0xa08e, 0x8000, 0x01f0, 0x6000, 0xd08c, 0x11d8, 0x6004,
+	0xa084, 0x00ff, 0xa086, 0x0006, 0x11a8, 0x6837, 0x0000, 0x6838,
+	0xc0fd, 0x683a, 0x080c, 0x9dda, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x2fcf, 0x7007, 0x0003, 0x701b, 0x3a7e, 0x0005, 0x080c, 0x3e9a,
+	0x0904, 0x2fd2, 0x20a9, 0x002b, 0x2c98, 0xade8, 0x0002, 0x2da0,
+	0x53a3, 0x20a9, 0x0004, 0xac80, 0x0006, 0x2098, 0xad80, 0x0006,
+	0x20a0, 0x080c, 0x4b8f, 0x20a9, 0x0004, 0xac80, 0x000a, 0x2098,
+	0xad80, 0x000a, 0x20a0, 0x080c, 0x4b8f, 0x2d00, 0x2009, 0x002b,
+	0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0804, 0x3eb9, 0x81ff, 0x1904,
+	0x2fcf, 0x080c, 0x3e8a, 0x0904, 0x2fd2, 0x080c, 0x5186, 0x0804,
+	0x2faa, 0x81ff, 0x1904, 0x2fcf, 0x7828, 0xa08a, 0x1000, 0x1a04,
+	0x2fd2, 0x080c, 0x3e9a, 0x0904, 0x2fd2, 0x080c, 0x51e9, 0x0904,
+	0x2fcf, 0x2019, 0x0004, 0xa00e, 0x080c, 0x5198, 0x7924, 0x810f,
+	0x7a28, 0x0011, 0x0804, 0x2faa, 0xa186, 0x00ff, 0x0110, 0x0071,
+	0x0060, 0x2029, 0x007e, 0x2061, 0xb500, 0x6450, 0x2400, 0xa506,
+	0x0110, 0x2508, 0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c, 0x4fa9,
+	0x1138, 0x2200, 0x8003, 0x800b, 0x810b, 0xa108, 0x080c, 0x69a8,
+	0x0005, 0x81ff, 0x1904, 0x2fcf, 0x080c, 0x3e8a, 0x0904, 0x2fd2,
+	0x080c, 0x506f, 0x0904, 0x2fcf, 0x080c, 0x518f, 0x0804, 0x2faa,
+	0x81ff, 0x1904, 0x2fcf, 0x080c, 0x3e8a, 0x0904, 0x2fd2, 0x080c,
+	0x506f, 0x0904, 0x2fcf, 0x080c, 0x517d, 0x0804, 0x2faa, 0x6100,
+	0x0804, 0x2faa, 0x080c, 0x3e9a, 0x0904, 0x2fd2, 0x2001, 0xb500,
+	0x2004, 0xa086, 0x0003, 0x1904, 0x2fcf, 0x00d6, 0xace8, 0x000a,
+	0x7924, 0xd184, 0x0110, 0xace8, 0x0006, 0x680c, 0x8007, 0x783e,
+	0x6808, 0x8007, 0x783a, 0x6b04, 0x831f, 0x6a00, 0x8217, 0x00de,
+	0x6100, 0xa18c, 0x0200, 0x0804, 0x2faa, 0x7824, 0xa09c, 0x0003,
+	0xd0b4, 0x1160, 0xa39a, 0x0003, 0x1a04, 0x2fcf, 0x6250, 0xa294,
+	0x00ff, 0xa084, 0xff00, 0x8007, 0xa206, 0x1150, 0x2001, 0xb540,
+	0x2009, 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0804, 0x3eb9,
+	0x81ff, 0x1904, 0x2fcf, 0x080c, 0x3e9a, 0x0904, 0x2fd2, 0x6004,
+	0xa084, 0x00ff, 0xa086, 0x0006, 0x1904, 0x2fcf, 0x00c6, 0x080c,
+	0x3e75, 0x00ce, 0x0904, 0x2fcf, 0x6837, 0x0000, 0x6838, 0xc0fd,
+	0x683a, 0x080c, 0x9d86, 0x0904, 0x2fcf, 0x7007, 0x0003, 0x701b,
+	0x3b6a, 0x0005, 0x6830, 0xa086, 0x0100, 0x0904, 0x2fcf, 0xad80,
+	0x000e, 0x2009, 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0804,
+	0x3eb9, 0xa006, 0x080c, 0x2867, 0x7824, 0xa084, 0x00ff, 0xa086,
+	0x00ff, 0x0118, 0x81ff, 0x1904, 0x2fcf, 0x080c, 0x5acf, 0x0110,
+	0x080c, 0x4bf0, 0x7828, 0xa08a, 0x1000, 0x1a04, 0x2fd2, 0x7924,
+	0xa18c, 0xff00, 0x810f, 0xa186, 0x00ff, 0x0138, 0xa182, 0x007f,
+	0x1a04, 0x2fd2, 0x2100, 0x080c, 0x2831, 0x0026, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0x2061, 0xb7f3, 0x601b, 0x0000, 0x601f, 0x0000,
+	0x080c, 0x5acf, 0x1178, 0x2001, 0xb79f, 0x2003, 0x0001, 0x2001,
+	0xb500, 0x2003, 0x0001, 0xa085, 0x0001, 0x080c, 0x5b13, 0x080c,
+	0x5a07, 0x0420, 0x2011, 0x0003, 0x080c, 0x8075, 0x2011, 0x0002,
+	0x080c, 0x807f, 0x080c, 0x7f59, 0x0036, 0x2019, 0x0000, 0x080c,
+	0x7fe4, 0x003e, 0x2061, 0x0100, 0x2001, 0xb515, 0x2004, 0xa084,
+	0x00ff, 0x810f, 0xa105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010,
+	0x2009, 0x002d, 0x2011, 0x4b54, 0x080c, 0x6a22, 0x7924, 0xa18c,
+	0xff00, 0x810f, 0x080c, 0x5acf, 0x1110, 0x2009, 0x00ff, 0x7a28,
+	0x080c, 0x3acc, 0x012e, 0x00ce, 0x002e, 0x0804, 0x2faa, 0x7924,
+	0xa18c, 0xff00, 0x810f, 0x00c6, 0x080c, 0x4f4d, 0x2c08, 0x00ce,
+	0x1904, 0x2fd2, 0x0804, 0x2faa, 0x81ff, 0x0120, 0x2009, 0x0001,
+	0x0804, 0x2fcf, 0x60d4, 0xd0ac, 0x1130, 0xd09c, 0x1120, 0x2009,
+	0x0005, 0x0804, 0x2fcf, 0x080c, 0x3e75, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x2fcf, 0x7924, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x080c,
+	0x3eb6, 0x701b, 0x3c1c, 0x0005, 0x2009, 0x0080, 0x080c, 0x4fa9,
+	0x1130, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x0120, 0x2021,
+	0x400a, 0x0804, 0x2fac, 0x00d6, 0xade8, 0x000d, 0x6900, 0x6a08,
+	0x6b0c, 0x6c10, 0x6d14, 0x6e18, 0x6820, 0xa0be, 0x0100, 0x0904,
+	0x3c93, 0xa0be, 0x0112, 0x0904, 0x3c93, 0xa0be, 0x0113, 0x0904,
+	0x3c93, 0xa0be, 0x0114, 0x0904, 0x3c93, 0xa0be, 0x0117, 0x0904,
+	0x3c93, 0xa0be, 0x011a, 0x0904, 0x3c93, 0xa0be, 0x011c, 0x0904,
+	0x3c93, 0xa0be, 0x0121, 0x05b0, 0xa0be, 0x0131, 0x0598, 0xa0be,
+	0x0171, 0x05c8, 0xa0be, 0x0173, 0x05b0, 0xa0be, 0x01a1, 0x1120,
+	0x6830, 0x8007, 0x6832, 0x04a8, 0xa0be, 0x0212, 0x0540, 0xa0be,
+	0x0213, 0x0528, 0xa0be, 0x0214, 0x01b0, 0xa0be, 0x0217, 0x0168,
+	0xa0be, 0x021a, 0x1120, 0x6838, 0x8007, 0x683a, 0x00e0, 0xa0be,
+	0x0300, 0x01c8, 0x00de, 0x0804, 0x2fd2, 0xad80, 0x0010, 0x20a9,
+	0x0007, 0x080c, 0x3cd9, 0xad80, 0x000e, 0x20a9, 0x0001, 0x080c,
+	0x3cd9, 0x0048, 0xad80, 0x000c, 0x080c, 0x3ce7, 0x0050, 0xad80,
+	0x000e, 0x080c, 0x3ce7, 0xad80, 0x000c, 0x20a9, 0x0001, 0x080c,
+	0x3cd9, 0x00c6, 0x080c, 0x3e75, 0x0568, 0x6838, 0xc0fd, 0x683a,
+	0x6837, 0x0119, 0x6853, 0x0000, 0x684f, 0x0020, 0x685b, 0x0001,
+	0x810b, 0x697e, 0x6883, 0x0000, 0x6a86, 0x6b8a, 0x6c8e, 0x6d92,
+	0x6996, 0x689b, 0x0000, 0x00ce, 0x00de, 0x6837, 0x0000, 0x6838,
+	0xc0fd, 0x683a, 0x6823, 0x0000, 0x6804, 0x2068, 0x080c, 0x9da2,
+	0x1120, 0x2009, 0x0003, 0x0804, 0x2fcf, 0x7007, 0x0003, 0x701b,
+	0x3cd0, 0x0005, 0x00ce, 0x00de, 0x2009, 0x0002, 0x0804, 0x2fcf,
+	0x6820, 0xa086, 0x8001, 0x1904, 0x2faa, 0x2009, 0x0004, 0x0804,
+	0x2fcf, 0x0016, 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x290a,
+	0x8108, 0x280a, 0x8108, 0x1f04, 0x3cdb, 0x001e, 0x0005, 0x0016,
+	0x00a6, 0x00b6, 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x2054,
+	0x8000, 0x205c, 0x2b0a, 0x8108, 0x2a0a, 0x8108, 0x290a, 0x8108,
+	0x280a, 0x00be, 0x00ae, 0x001e, 0x0005, 0x81ff, 0x0120, 0x2009,
+	0x0001, 0x0804, 0x2fcf, 0x60d4, 0xd0ac, 0x1130, 0xd09c, 0x1120,
+	0x2009, 0x0005, 0x0804, 0x2fcf, 0x7924, 0x2140, 0xa18c, 0xff00,
+	0x810f, 0x60d4, 0xd0ac, 0x1120, 0xa182, 0x0080, 0x0a04, 0x2fd2,
+	0xa182, 0x00ff, 0x1a04, 0x2fd2, 0x7a2c, 0x7b28, 0x6070, 0xa306,
+	0x1140, 0x6074, 0xa24e, 0x0904, 0x2fd2, 0xa9cc, 0xff00, 0x0904,
+	0x2fd2, 0x00c6, 0x080c, 0x3dc5, 0x2c68, 0x00ce, 0x0530, 0xa0c6,
+	0x4000, 0x1178, 0x00c6, 0x0006, 0x2d60, 0xa00e, 0x080c, 0x524a,
+	0x1108, 0xc185, 0x6000, 0xd0bc, 0x0108, 0xc18d, 0x000e, 0x00ce,
+	0x0088, 0xa0c6, 0x4007, 0x1110, 0x2408, 0x0060, 0xa0c6, 0x4008,
+	0x1118, 0x2708, 0x2610, 0x0030, 0xa0c6, 0x4009, 0x1108, 0x0010,
+	0x2001, 0x4006, 0x2020, 0x0804, 0x2fac, 0x2d00, 0x7022, 0x0016,
+	0x00b6, 0x00c6, 0x00e6, 0x2c70, 0x080c, 0x85c7, 0x05d8, 0x2d00,
+	0x601a, 0x080c, 0xa027, 0x2e58, 0x00ee, 0x00e6, 0x00c6, 0x080c,
+	0x3e75, 0x00ce, 0x2b70, 0x1150, 0x080c, 0x861d, 0x00ee, 0x00ce,
+	0x00be, 0x001e, 0x2009, 0x0002, 0x0804, 0x2fcf, 0x6837, 0x0000,
+	0x683b, 0x0000, 0x2d00, 0x6012, 0x6833, 0x0000, 0x6838, 0xc0fd,
+	0xd88c, 0x0108, 0xc0f5, 0x683a, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x2c9c, 0x012e, 0x601f, 0x0001, 0x2001, 0x0000, 0x080c, 0x4eeb,
+	0x2001, 0x0002, 0x080c, 0x4efd, 0x2009, 0x0002, 0x080c, 0x864c,
+	0xa085, 0x0001, 0x00ee, 0x00ce, 0x00be, 0x001e, 0x1120, 0x2009,
+	0x0003, 0x0804, 0x2fcf, 0x7007, 0x0003, 0x701b, 0x3da8, 0x0005,
+	0x6830, 0xa086, 0x0100, 0x7020, 0x2060, 0x1138, 0x2009, 0x0004,
+	0x6204, 0xa294, 0x00ff, 0x0804, 0x2fcf, 0x2009, 0x0000, 0x6838,
+	0xd0f4, 0x1904, 0x2faa, 0x080c, 0x524a, 0x1108, 0xc185, 0x6000,
+	0xd0bc, 0x0108, 0xc18d, 0x0804, 0x2faa, 0x00e6, 0x00d6, 0xa02e,
+	0x2001, 0xb535, 0x2004, 0xd0ac, 0x0130, 0xa026, 0x20a9, 0x00ff,
+	0x2071, 0xb635, 0x0030, 0x2021, 0x0080, 0x20a9, 0x007f, 0x2071,
+	0xb6b5, 0x2e04, 0xa005, 0x1130, 0x2100, 0xa406, 0x1570, 0x2428,
+	0xc5fd, 0x0458, 0x2068, 0x6f10, 0x2700, 0xa306, 0x11b0, 0x6e14,
+	0x2600, 0xa206, 0x1190, 0x2400, 0xa106, 0x1160, 0x2d60, 0xd884,
+	0x0568, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x1538, 0x2001,
+	0x4000, 0x0428, 0x2001, 0x4007, 0x0410, 0x2400, 0xa106, 0x1168,
+	0x6e14, 0x87ff, 0x1138, 0x86ff, 0x09d0, 0x2001, 0xb535, 0x2004,
+	0xd0ac, 0x19a8, 0x2001, 0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04,
+	0x3dd9, 0x85ff, 0x1130, 0x2001, 0x4009, 0x0048, 0x2001, 0x0001,
+	0x0030, 0x080c, 0x4f4d, 0x1dd0, 0x6312, 0x6216, 0xa006, 0xa005,
+	0x00de, 0x00ee, 0x0005, 0x81ff, 0x1904, 0x2fcf, 0x080c, 0x3e75,
+	0x0904, 0x2fcf, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x7824,
+	0xa005, 0x0904, 0x2fd2, 0xa096, 0x00ff, 0x0120, 0xa092, 0x0004,
+	0x1a04, 0x2fd2, 0x2010, 0x2d18, 0x080c, 0x2c4f, 0x0904, 0x2fcf,
+	0x7007, 0x0003, 0x701b, 0x3e45, 0x0005, 0x6830, 0xa086, 0x0100,
+	0x0904, 0x2fcf, 0x0804, 0x2faa, 0x7924, 0xa18c, 0xff00, 0x810f,
+	0x60d4, 0xd0ac, 0x1120, 0xa182, 0x0080, 0x0a04, 0x2fd2, 0xa182,
+	0x00ff, 0x1a04, 0x2fd2, 0x0126, 0x2091, 0x8000, 0x080c, 0x9c8a,
+	0x1188, 0xa190, 0xb635, 0x2204, 0xa065, 0x0160, 0x080c, 0x4c0b,
+	0x2001, 0xb535, 0x2004, 0xd0ac, 0x0110, 0x6017, 0x0000, 0x012e,
+	0x0804, 0x2faa, 0x012e, 0x0804, 0x2fcf, 0x080c, 0x15f8, 0x0188,
+	0xa006, 0x6802, 0x7010, 0xa005, 0x1120, 0x2d00, 0x7012, 0x7016,
+	0x0030, 0x7014, 0x6802, 0x2060, 0x2d00, 0x6006, 0x7016, 0xad80,
+	0x000d, 0x0005, 0x7924, 0x810f, 0xa18c, 0x00ff, 0x080c, 0x4fa9,
+	0x1130, 0x7e28, 0xa684, 0x3fff, 0xa082, 0x4000, 0x0208, 0xa066,
+	0x8cff, 0x0005, 0x7e24, 0x860f, 0xa18c, 0x00ff, 0x080c, 0x4fa9,
+	0x1128, 0xa6b4, 0x00ff, 0xa682, 0x4000, 0x0208, 0xa066, 0x8cff,
+	0x0005, 0x0016, 0x7110, 0x81ff, 0x0128, 0x2168, 0x6904, 0x080c,
+	0x160f, 0x0cc8, 0x7112, 0x7116, 0x001e, 0x0005, 0x2031, 0x0001,
+	0x0010, 0x2031, 0x0000, 0x2061, 0xb5d2, 0x6606, 0x6112, 0x600e,
+	0x6226, 0x632a, 0x642e, 0x6532, 0x2c10, 0x080c, 0x1643, 0x7007,
+	0x0002, 0x701b, 0x2faa, 0x0005, 0x00f6, 0x0126, 0x2091, 0x8000,
+	0x2079, 0x0000, 0x2001, 0xb590, 0x2004, 0xa005, 0x1168, 0x0e04,
+	0x3ee4, 0x7818, 0xd084, 0x1140, 0x7a22, 0x7b26, 0x7c2a, 0x781b,
+	0x0001, 0x2091, 0x4080, 0x0408, 0x0016, 0x00c6, 0x00e6, 0x2071,
+	0xb582, 0x7138, 0xa182, 0x0010, 0x0218, 0x7030, 0x2060, 0x0078,
+	0x7030, 0xa0e0, 0x0004, 0xac82, 0xb5d2, 0x0210, 0x2061, 0xb592,
+	0x2c00, 0x7032, 0x81ff, 0x1108, 0x7036, 0x8108, 0x713a, 0x2262,
+	0x6306, 0x640a, 0x00ee, 0x00ce, 0x001e, 0x012e, 0x00fe, 0x0005,
+	0x00e6, 0x2071, 0xb582, 0x7038, 0xa005, 0x0570, 0x0126, 0x2091,
+	0x8000, 0x0e04, 0x3f3b, 0x00f6, 0x2079, 0x0000, 0x7818, 0xd084,
+	0x1508, 0x00c6, 0x7034, 0x2060, 0x2c04, 0x7822, 0x6004, 0x7826,
+	0x6008, 0x782a, 0x781b, 0x0001, 0x2091, 0x4080, 0x7038, 0x8001,
+	0x703a, 0xa005, 0x1130, 0x7033, 0xb592, 0x7037, 0xb592, 0x00ce,
+	0x0048, 0xac80, 0x0004, 0xa0fa, 0xb5d2, 0x0210, 0x2001, 0xb592,
+	0x7036, 0x00ce, 0x00fe, 0x012e, 0x00ee, 0x0005, 0x0026, 0x2001,
+	0xb553, 0x2004, 0xd0c4, 0x0120, 0x2011, 0x8014, 0x080c, 0x3ecc,
+	0x002e, 0x0005, 0x81ff, 0x1904, 0x2fcf, 0x0126, 0x2091, 0x8000,
+	0x6030, 0xc08d, 0xc085, 0xc0ac, 0x6032, 0x080c, 0x5acf, 0x1178,
+	0x2001, 0xb79f, 0x2003, 0x0001, 0x2001, 0xb500, 0x2003, 0x0001,
+	0xa085, 0x0001, 0x080c, 0x5b13, 0x080c, 0x5a07, 0x0010, 0x080c,
+	0x4b1f, 0x012e, 0x0804, 0x2faa, 0x7824, 0x2008, 0xa18c, 0xfffd,
+	0x1128, 0x61e0, 0xa10d, 0x61e2, 0x0804, 0x2faa, 0x0804, 0x2fd2,
+	0x81ff, 0x1904, 0x2fcf, 0x6000, 0xa086, 0x0003, 0x1904, 0x2fcf,
+	0x2001, 0xb553, 0x2004, 0xd0ac, 0x1904, 0x2fcf, 0x080c, 0x3e9a,
+	0x0904, 0x2fd2, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x1120,
+	0x7828, 0xa005, 0x0904, 0x2faa, 0x00c6, 0x080c, 0x3e75, 0x00ce,
+	0x0904, 0x2fcf, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838, 0xc0fd,
+	0x683a, 0x080c, 0x9e6b, 0x0904, 0x2fcf, 0x7007, 0x0003, 0x701b,
+	0x3faa, 0x0005, 0x6830, 0xa086, 0x0100, 0x0904, 0x2fcf, 0x0804,
+	0x2faa, 0x2001, 0xb500, 0x2004, 0xa086, 0x0003, 0x1904, 0x2fcf,
+	0x7f24, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x080c, 0x3e75, 0x0904,
+	0x2fcf, 0x2009, 0x0000, 0x2031, 0x0000, 0x7023, 0x0000, 0x702f,
+	0x0000, 0xad80, 0x0005, 0x7026, 0x20a0, 0x080c, 0x4fa9, 0x1904,
+	0x4024, 0x6004, 0xa0c4, 0x00ff, 0xa8c6, 0x0006, 0x0130, 0xa0c4,
+	0xff00, 0xa8c6, 0x0600, 0x1904, 0x4024, 0x2001, 0xb553, 0x2004,
+	0xd0ac, 0x1128, 0x080c, 0x524a, 0x1110, 0xd79c, 0x05e8, 0xd794,
+	0x1110, 0xd784, 0x0158, 0xac80, 0x0006, 0x2098, 0x3400, 0x20a9,
+	0x0004, 0x53a3, 0x080c, 0x3ce7, 0xd794, 0x0148, 0xac80, 0x000a,
+	0x2098, 0x3400, 0x20a9, 0x0004, 0x53a3, 0x080c, 0x3ce7, 0x21a2,
+	0xd794, 0x01d8, 0xac80, 0x0000, 0x2098, 0x94a0, 0x20a9, 0x0002,
+	0x53a3, 0xac80, 0x0003, 0x20a6, 0x94a0, 0xac80, 0x0004, 0x2098,
+	0x3400, 0x20a9, 0x0002, 0x53a3, 0x080c, 0x3cd9, 0xac80, 0x0026,
+	0x2098, 0x20a9, 0x0002, 0x53a3, 0x0008, 0x94a0, 0xd794, 0x0110,
+	0xa6b0, 0x000b, 0xa6b0, 0x0005, 0x8108, 0x2001, 0xb535, 0x2004,
+	0xd0ac, 0x0118, 0xa186, 0x0100, 0x0040, 0xd78c, 0x0120, 0xa186,
+	0x0100, 0x0170, 0x0018, 0xa186, 0x007e, 0x0150, 0xd794, 0x0118,
+	0xa686, 0x0020, 0x0010, 0xa686, 0x0028, 0x0150, 0x0804, 0x3fcd,
+	0x86ff, 0x1120, 0x7120, 0x810b, 0x0804, 0x2faa, 0x702f, 0x0001,
+	0x711e, 0x7020, 0xa600, 0x7022, 0x772a, 0x2061, 0xb5d2, 0x6007,
+	0x0000, 0x6612, 0x7024, 0x600e, 0x6226, 0x632a, 0x642e, 0x6532,
+	0x2c10, 0x080c, 0x1643, 0x7007, 0x0002, 0x701b, 0x4060, 0x0005,
+	0x702c, 0xa005, 0x1170, 0x711c, 0x7024, 0x20a0, 0x7728, 0x2031,
+	0x0000, 0x2061, 0xb5d2, 0x6224, 0x6328, 0x642c, 0x6530, 0x0804,
+	0x3fcd, 0x7120, 0x810b, 0x0804, 0x2faa, 0x2029, 0x007e, 0x7924,
+	0x7a28, 0x7b2c, 0x7c38, 0xa184, 0xff00, 0x8007, 0xa0e2, 0x0020,
+	0x0a04, 0x2fd2, 0xa502, 0x0a04, 0x2fd2, 0xa184, 0x00ff, 0xa0e2,
+	0x0020, 0x0a04, 0x2fd2, 0xa502, 0x0a04, 0x2fd2, 0xa284, 0xff00,
+	0x8007, 0xa0e2, 0x0020, 0x0a04, 0x2fd2, 0xa502, 0x0a04, 0x2fd2,
+	0xa284, 0x00ff, 0xa0e2, 0x0020, 0x0a04, 0x2fd2, 0xa502, 0x0a04,
+	0x2fd2, 0xa384, 0xff00, 0x8007, 0xa0e2, 0x0020, 0x0a04, 0x2fd2,
+	0xa502, 0x0a04, 0x2fd2, 0xa384, 0x00ff, 0xa0e2, 0x0020, 0x0a04,
+	0x2fd2, 0xa502, 0x0a04, 0x2fd2, 0xa484, 0xff00, 0x8007, 0xa0e2,
+	0x0020, 0x0a04, 0x2fd2, 0xa502, 0x0a04, 0x2fd2, 0xa484, 0x00ff,
+	0xa0e2, 0x0020, 0x0a04, 0x2fd2, 0xa502, 0x0a04, 0x2fd2, 0x2061,
+	0xb7b9, 0x6102, 0x6206, 0x630a, 0x640e, 0x0804, 0x2faa, 0x0006,
+	0x2001, 0xb553, 0x2004, 0xd0cc, 0x000e, 0x0005, 0x0006, 0x2001,
+	0xb572, 0x2004, 0xd0bc, 0x000e, 0x0005, 0x6168, 0x7a24, 0x6300,
+	0x82ff, 0x1118, 0x7926, 0x0804, 0x2faa, 0x83ff, 0x1904, 0x2fd2,
+	0x2001, 0xfff0, 0xa200, 0x1a04, 0x2fd2, 0x2019, 0xffff, 0x606c,
+	0xa302, 0xa200, 0x0a04, 0x2fd2, 0x7926, 0x626a, 0x0804, 0x2faa,
+	0x2001, 0xb500, 0x2004, 0xa086, 0x0003, 0x1904, 0x2fcf, 0x7c28,
+	0x7d24, 0x7e38, 0x7f2c, 0x080c, 0x3e75, 0x0904, 0x2fcf, 0x2009,
+	0x0000, 0x2019, 0x0000, 0x7023, 0x0000, 0x702f, 0x0000, 0xad80,
+	0x0003, 0x7026, 0x20a0, 0xa1e0, 0xb635, 0x2c64, 0x8cff, 0x01b8,
+	0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x0130, 0x6004, 0xa084,
+	0xff00, 0xa086, 0x0600, 0x1158, 0x6014, 0x20a2, 0x94a0, 0x6010,
+	0x8007, 0xa105, 0x8007, 0x20a2, 0x94a0, 0xa398, 0x0002, 0x8108,
+	0xa182, 0x00ff, 0x0120, 0xa386, 0x002a, 0x0148, 0x08e0, 0x83ff,
+	0x1120, 0x7120, 0x810c, 0x0804, 0x2faa, 0x702f, 0x0001, 0x711e,
+	0x7020, 0xa300, 0x7022, 0x2061, 0xb5d2, 0x6007, 0x0000, 0x6312,
+	0x7024, 0x600e, 0x6426, 0x652a, 0x662e, 0x6732, 0x2c10, 0x080c,
+	0x1643, 0x7007, 0x0002, 0x701b, 0x4156, 0x0005, 0x702c, 0xa005,
+	0x1168, 0x711c, 0x7024, 0x20a0, 0x2019, 0x0000, 0x2061, 0xb5d2,
+	0x6424, 0x6528, 0x662c, 0x6730, 0x0804, 0x4113, 0x7120, 0x810c,
+	0x0804, 0x2faa, 0x81ff, 0x1904, 0x2fcf, 0x60d4, 0xd0ac, 0x1118,
+	0xd09c, 0x0904, 0x2fcf, 0x080c, 0x3e75, 0x0904, 0x2fcf, 0x7924,
+	0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x080c, 0x3eb6, 0x701b, 0x4181,
+	0x0005, 0x00d6, 0xade8, 0x000d, 0x6828, 0xa0be, 0x7000, 0x0148,
+	0xa0be, 0x7100, 0x0130, 0xa0be, 0x7200, 0x0118, 0x00de, 0x0804,
+	0x2fd2, 0x6820, 0x6924, 0x080c, 0x281d, 0x1510, 0x080c, 0x4f4d,
+	0x11f8, 0x7122, 0x6612, 0x6516, 0x6e18, 0x00c6, 0x080c, 0x3e75,
+	0x01b8, 0x080c, 0x3e75, 0x01a0, 0x00ce, 0x00de, 0x6837, 0x0000,
+	0x6838, 0xc0fd, 0x683a, 0x6823, 0x0000, 0x6804, 0x2068, 0x080c,
+	0x9dbe, 0x0904, 0x2fcf, 0x7007, 0x0003, 0x701b, 0x41bb, 0x0005,
+	0x00de, 0x0804, 0x2fcf, 0x7120, 0x080c, 0x2d97, 0x6820, 0xa086,
+	0x8001, 0x0904, 0x2fcf, 0x2d00, 0x701e, 0x6804, 0xa080, 0x0002,
+	0x0006, 0x20a9, 0x002a, 0x2098, 0x20a0, 0x080c, 0x4b8f, 0x000e,
+	0xade8, 0x000d, 0x6a08, 0x6b0c, 0x6c10, 0x6d14, 0x2061, 0xb5d2,
+	0x6007, 0x0000, 0x6e00, 0x6f28, 0xa7c6, 0x7000, 0x1108, 0x0018,
+	0xa7c6, 0x7100, 0x1140, 0xa6c2, 0x0004, 0x0a04, 0x2fd2, 0x2009,
+	0x0004, 0x0804, 0x3eb9, 0xa7c6, 0x7200, 0x1904, 0x2fd2, 0xa6c2,
+	0x0054, 0x0a04, 0x2fd2, 0x600e, 0x6013, 0x002a, 0x6226, 0x632a,
+	0x642e, 0x6532, 0x2c10, 0x080c, 0x1643, 0x7007, 0x0002, 0x701b,
+	0x4202, 0x0005, 0x701c, 0x2068, 0x6804, 0xa080, 0x0001, 0x2004,
+	0xa080, 0x0002, 0x0006, 0x20a9, 0x002a, 0x2098, 0x20a0, 0x080c,
+	0x4b8f, 0x000e, 0x2009, 0x002a, 0x2061, 0xb5d2, 0x6224, 0x6328,
+	0x642c, 0x6530, 0x0804, 0x3eb9, 0x81ff, 0x1904, 0x2fcf, 0x792c,
+	0x2001, 0xb7a0, 0x2102, 0x080c, 0x3e8a, 0x0904, 0x2fd2, 0x080c,
+	0x506f, 0x0904, 0x2fcf, 0x0126, 0x2091, 0x8000, 0x080c, 0x51a1,
+	0x012e, 0x0804, 0x2faa, 0x7824, 0xd08c, 0x1118, 0xd084, 0x0904,
+	0x3a46, 0x080c, 0x3e9a, 0x0904, 0x2fd2, 0x00c6, 0x080c, 0x3e75,
+	0x00ce, 0x1120, 0x2009, 0x0002, 0x0804, 0x2fcf, 0x6004, 0xa084,
+	0x00ff, 0xa086, 0x0006, 0x0128, 0xa08e, 0x0004, 0x0110, 0xa08e,
+	0x0005, 0x15b8, 0x7824, 0xd08c, 0x0120, 0x6000, 0xc08c, 0x6002,
+	0x0030, 0x2001, 0xb553, 0x2004, 0xd0b4, 0x0904, 0x3a82, 0x7824,
+	0xa084, 0xff00, 0xa08e, 0x7e00, 0x0904, 0x3a82, 0xa08e, 0x7f00,
+	0x0904, 0x3a82, 0xa08e, 0x8000, 0x0904, 0x3a82, 0x6000, 0xd08c,
+	0x1904, 0x3a82, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x080c,
+	0x9dda, 0x1120, 0x2009, 0x0003, 0x0804, 0x2fcf, 0x7007, 0x0003,
+	0x701b, 0x4283, 0x0005, 0x080c, 0x3e9a, 0x0904, 0x2fd2, 0x0804,
+	0x3a82, 0x2009, 0xb531, 0x210c, 0x81ff, 0x0120, 0x2009, 0x0001,
+	0x0804, 0x2fcf, 0x2001, 0xb500, 0x2004, 0xa086, 0x0003, 0x0120,
+	0x2009, 0x0007, 0x0804, 0x2fcf, 0x2001, 0xb553, 0x2004, 0xd0ac,
+	0x0120, 0x2009, 0x0008, 0x0804, 0x2fcf, 0x609c, 0xd0a4, 0x1118,
+	0xd0ac, 0x1904, 0x3a82, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838,
+	0xc0fd, 0x683a, 0x080c, 0x9e6b, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x2fcf, 0x7007, 0x0003, 0x701b, 0x42be, 0x0005, 0x6830, 0xa086,
+	0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x2fcf, 0x080c, 0x3e9a,
+	0x0904, 0x2fd2, 0x0804, 0x4252, 0x81ff, 0x2009, 0x0001, 0x1904,
+	0x2fcf, 0x6000, 0xa086, 0x0003, 0x2009, 0x0007, 0x1904, 0x2fcf,
+	0x2001, 0xb553, 0x2004, 0xd0ac, 0x2009, 0x0008, 0x1904, 0x2fcf,
+	0x080c, 0x3e9a, 0x0904, 0x2fd2, 0x6004, 0xa084, 0x00ff, 0xa086,
+	0x0006, 0x2009, 0x0009, 0x1904, 0x2fcf, 0x00c6, 0x080c, 0x3e75,
+	0x00ce, 0x2009, 0x0002, 0x0904, 0x2fcf, 0x6837, 0x0000, 0x6833,
+	0x0000, 0x6838, 0xc0fd, 0x683a, 0x7928, 0xa194, 0xff00, 0xa18c,
+	0x00ff, 0xa006, 0x82ff, 0x1128, 0xc0ed, 0x6952, 0x792c, 0x6956,
+	0x0048, 0xa28e, 0x0100, 0x1904, 0x2fd2, 0xc0e5, 0x6853, 0x0000,
+	0x6857, 0x0000, 0x683e, 0x080c, 0xa028, 0x2009, 0x0003, 0x0904,
+	0x2fcf, 0x7007, 0x0003, 0x701b, 0x431e, 0x0005, 0x6830, 0xa086,
+	0x0100, 0x2009, 0x0004, 0x0904, 0x2fcf, 0x0804, 0x2faa, 0x81ff,
+	0x2009, 0x0001, 0x1904, 0x2fcf, 0x6000, 0xa086, 0x0003, 0x2009,
+	0x0007, 0x1904, 0x2fcf, 0x080c, 0x3e9a, 0x0904, 0x2fd2, 0x6004,
+	0xa084, 0x00ff, 0xa086, 0x0006, 0x2009, 0x0009, 0x1904, 0x2fcf,
+	0x00c6, 0x080c, 0x3e75, 0x00ce, 0x2009, 0x0002, 0x0904, 0x2fcf,
+	0xad80, 0x000f, 0x2009, 0x0008, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38,
+	0x080c, 0x3eb6, 0x701b, 0x4355, 0x0005, 0x00d6, 0xade8, 0x000f,
+	0x6800, 0xa086, 0x0500, 0x1140, 0x6804, 0xa005, 0x1128, 0x6808,
+	0xa084, 0xff00, 0x1108, 0x0018, 0x00de, 0x1904, 0x2fd2, 0x00de,
+	0x6837, 0x0000, 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x00c6,
+	0x080c, 0x3e9a, 0x1118, 0x00ce, 0x0804, 0x2fd2, 0x080c, 0xa077,
+	0x2009, 0x0003, 0x00ce, 0x0904, 0x2fcf, 0x7007, 0x0003, 0x701b,
+	0x4382, 0x0005, 0x6830, 0xa086, 0x0100, 0x2009, 0x0004, 0x0904,
+	0x2fcf, 0x0804, 0x2faa, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
+	0x2fcf, 0x6000, 0xa086, 0x0003, 0x0120, 0x2009, 0x0007, 0x0804,
+	0x2fcf, 0x7e24, 0x860f, 0xa18c, 0x00ff, 0xa6b4, 0x00ff, 0x080c,
+	0x4fa9, 0x1904, 0x2fd2, 0xa186, 0x007f, 0x0150, 0x6004, 0xa084,
+	0x00ff, 0xa086, 0x0006, 0x0120, 0x2009, 0x0009, 0x0804, 0x2fcf,
+	0x00c6, 0x080c, 0x3e75, 0x00ce, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x2fcf, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x2001, 0x0100,
+	0x8007, 0x680a, 0x080c, 0x9df5, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x2fcf, 0x7007, 0x0003, 0x701b, 0x43ce, 0x0005, 0x6808, 0x8007,
+	0xa086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x2fcf, 0x68b0,
+	0x6836, 0x6810, 0x8007, 0xa084, 0x00ff, 0x800c, 0x6814, 0x8007,
+	0xa084, 0x00ff, 0x8004, 0xa080, 0x0002, 0xa108, 0xad80, 0x0004,
+	0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0804, 0x3eb9, 0x080c, 0x3e75,
+	0x1120, 0x2009, 0x0002, 0x0804, 0x2fcf, 0x7924, 0xa194, 0xff00,
+	0xa18c, 0x00ff, 0x8217, 0x82ff, 0x0110, 0x0804, 0x2fd2, 0x2009,
+	0x001a, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x080c, 0x3eb6, 0x701b,
+	0x440a, 0x0005, 0x2001, 0xb52a, 0x2003, 0x0001, 0xad80, 0x000d,
+	0x2098, 0x20a9, 0x001a, 0x20a1, 0xb7c6, 0x53a3, 0x0804, 0x2faa,
+	0x080c, 0x3e75, 0x1120, 0x2009, 0x0002, 0x0804, 0x2fcf, 0x7924,
+	0xa194, 0xff00, 0xa18c, 0x00ff, 0x8217, 0x82ff, 0x0110, 0x0804,
+	0x2fd2, 0x2099, 0xb7c6, 0x20a0, 0x20a9, 0x001a, 0x53a3, 0x2009,
+	0x001a, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0804, 0x3eb9, 0x7824,
+	0xa08a, 0x1000, 0x1a04, 0x2fd2, 0x0126, 0x2091, 0x8000, 0x8003,
+	0x800b, 0x810b, 0xa108, 0x00c6, 0x2061, 0xb7f3, 0x6142, 0x00ce,
+	0x012e, 0x0804, 0x2faa, 0x00c6, 0x080c, 0x5acf, 0x1188, 0x2001,
+	0xb79f, 0x2003, 0x0001, 0x2001, 0xb500, 0x2003, 0x0001, 0xa085,
+	0x0001, 0x080c, 0x5b13, 0x080c, 0x5a07, 0x080c, 0x1515, 0x0038,
+	0x2061, 0xb500, 0x6030, 0xc09d, 0x6032, 0x080c, 0x4b1f, 0x00ce,
+	0x0005, 0x0126, 0x2091, 0x8000, 0x00c6, 0x2061, 0xb7f3, 0x7924,
+	0x6152, 0x614e, 0x6057, 0x0000, 0x604b, 0x0009, 0x7838, 0x606a,
+	0x783c, 0x6066, 0x7828, 0x6062, 0x782c, 0x605e, 0x2061, 0xb7a1,
+	0x2001, 0xb808, 0x600e, 0x6013, 0x0001, 0x6017, 0x0002, 0x6007,
+	0x0000, 0x6037, 0x0000, 0x00ce, 0x012e, 0x0804, 0x2faa, 0x0126,
+	0x00c6, 0x00e6, 0x2061, 0x0100, 0x2071, 0xb500, 0x6044, 0xd0a4,
+	0x11b0, 0xd084, 0x0118, 0x080c, 0x4606, 0x0068, 0xd08c, 0x0118,
+	0x080c, 0x4527, 0x0040, 0xd094, 0x0118, 0x080c, 0x44f8, 0x0018,
+	0xd09c, 0x0108, 0x0061, 0x00ee, 0x00ce, 0x012e, 0x0005, 0x0016,
+	0x6128, 0xd19c, 0x1110, 0xc19d, 0x612a, 0x001e, 0x0ca0, 0x624c,
+	0xa286, 0xf0f0, 0x1150, 0x6048, 0xa086, 0xf0f0, 0x0130, 0x624a,
+	0x6043, 0x0090, 0x6043, 0x0010, 0x0490, 0xa294, 0xff00, 0xa296,
+	0xf700, 0x0178, 0x7134, 0xd1a4, 0x1160, 0x6240, 0xa295, 0x0100,
+	0x6242, 0xa294, 0x0010, 0x0128, 0x2009, 0x00f7, 0x080c, 0x4baf,
+	0x00f0, 0x6040, 0xa084, 0x0010, 0xa085, 0x0140, 0x6042, 0x6043,
+	0x0000, 0x707b, 0x0000, 0x7097, 0x0001, 0x70bb, 0x0000, 0x70d7,
+	0x0000, 0x2009, 0xbcc0, 0x200b, 0x0000, 0x708b, 0x0000, 0x707f,
+	0x000a, 0x2009, 0x000a, 0x2011, 0x4ad5, 0x080c, 0x6a22, 0x0005,
+	0x0156, 0x2001, 0xb574, 0x2004, 0xd08c, 0x0110, 0x7053, 0xffff,
+	0x707c, 0xa005, 0x1510, 0x2011, 0x4ad5, 0x080c, 0x699c, 0x6040,
+	0xa094, 0x0010, 0xa285, 0x0020, 0x6042, 0x20a9, 0x00c8, 0x6044,
+	0xd08c, 0x1168, 0x1f04, 0x450f, 0x6242, 0x708f, 0x0000, 0x6040,
+	0xa094, 0x0010, 0xa285, 0x0080, 0x6042, 0x6242, 0x0030, 0x6242,
+	0x708f, 0x0000, 0x7083, 0x0000, 0x0000, 0x015e, 0x0005, 0x7080,
+	0xa08a, 0x0003, 0x1210, 0x0023, 0x0010, 0x080c, 0x1515, 0x0005,
+	0x4533, 0x4583, 0x4605, 0x00f6, 0x7083, 0x0001, 0x20e1, 0xa000,
+	0xe000, 0x20e1, 0x8700, 0x080c, 0x2470, 0x20e1, 0x9080, 0x20e1,
+	0x4000, 0x2079, 0xbb00, 0x207b, 0x2200, 0x7807, 0x00ef, 0x780b,
+	0x0000, 0x780f, 0x00ef, 0x7813, 0x0138, 0x7817, 0x0000, 0x781b,
+	0x0000, 0x781f, 0x0000, 0x7823, 0xffff, 0x7827, 0xffff, 0x782b,
+	0x0000, 0x782f, 0x0000, 0x2079, 0xbb0c, 0x207b, 0x1101, 0x7807,
+	0x0000, 0x2099, 0xb505, 0x20a1, 0xbb0e, 0x20a9, 0x0004, 0x53a3,
+	0x2079, 0xbb12, 0x207b, 0x0000, 0x7807, 0x0000, 0x2099, 0xbb00,
+	0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x60c3, 0x000c, 0x600f,
+	0x0000, 0x080c, 0x4b06, 0x00fe, 0x7087, 0x0000, 0x6043, 0x0008,
+	0x6043, 0x0000, 0x0005, 0x00d6, 0x7084, 0x7087, 0x0000, 0xa025,
+	0x0904, 0x45ed, 0x6020, 0xd0b4, 0x1904, 0x45eb, 0x7194, 0x81ff,
+	0x0904, 0x45db, 0xa486, 0x000c, 0x1904, 0x45e6, 0xa480, 0x0018,
+	0x8004, 0x20a8, 0x2011, 0xbb80, 0x2019, 0xbb00, 0x220c, 0x2304,
+	0xa106, 0x11b8, 0x8210, 0x8318, 0x1f04, 0x459e, 0x6043, 0x0004,
+	0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0006, 0x7083, 0x0002,
+	0x708f, 0x0002, 0x2009, 0x07d0, 0x2011, 0x4adc, 0x080c, 0x6a22,
+	0x0490, 0x2069, 0xbb80, 0x6930, 0xa18e, 0x1101, 0x1538, 0x6834,
+	0xa005, 0x1520, 0x6900, 0xa18c, 0x00ff, 0x1118, 0x6804, 0xa005,
+	0x0190, 0x2011, 0xbb8e, 0x2019, 0xb505, 0x20a9, 0x0004, 0x220c,
+	0x2304, 0xa102, 0x0230, 0x1190, 0x8210, 0x8318, 0x1f04, 0x45cf,
+	0x0068, 0x7097, 0x0000, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099,
+	0xbb80, 0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x6043, 0x0008,
+	0x6043, 0x0000, 0x0010, 0x00de, 0x0005, 0x6040, 0xa085, 0x0100,
+	0x6042, 0x6020, 0xd0b4, 0x1db8, 0x60c3, 0x000c, 0x2011, 0xb7ea,
+	0x2013, 0x0000, 0x7087, 0x0000, 0x20e1, 0x9080, 0x60a3, 0x0056,
+	0x60a7, 0x9575, 0x080c, 0x7d71, 0x0c30, 0x0005, 0x708c, 0xa08a,
+	0x001d, 0x1210, 0x0023, 0x0010, 0x080c, 0x1515, 0x0005, 0x4639,
+	0x4648, 0x4670, 0x4689, 0x46ad, 0x46d5, 0x46f9, 0x472a, 0x474e,
+	0x4776, 0x47ad, 0x47d5, 0x47f1, 0x4807, 0x4827, 0x483a, 0x4842,
+	0x4872, 0x4896, 0x48be, 0x48e2, 0x4913, 0x4950, 0x497f, 0x499b,
+	0x49da, 0x49fa, 0x4a13, 0x4a14, 0x00c6, 0x2061, 0xb500, 0x6003,
+	0x0007, 0x2061, 0x0100, 0x6004, 0xa084, 0xfff9, 0x6006, 0x00ce,
+	0x0005, 0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0002, 0x708f,
+	0x0001, 0x2009, 0x07d0, 0x2011, 0x4adc, 0x080c, 0x6a22, 0x0005,
+	0x00f6, 0x7084, 0xa086, 0x0014, 0x1508, 0x6043, 0x0000, 0x6020,
+	0xd0b4, 0x11e0, 0x2079, 0xbb80, 0x7a30, 0xa296, 0x1102, 0x11a0,
+	0x7834, 0xa005, 0x1188, 0x7a38, 0xd2fc, 0x0128, 0x70b8, 0xa005,
+	0x1110, 0x70bb, 0x0001, 0x2011, 0x4adc, 0x080c, 0x699c, 0x708f,
+	0x0010, 0x080c, 0x4842, 0x0010, 0x080c, 0x4b1f, 0x00fe, 0x0005,
+	0x708f, 0x0003, 0x6043, 0x0004, 0x2011, 0x4adc, 0x080c, 0x699c,
+	0x080c, 0x4b97, 0x20a3, 0x1102, 0x20a3, 0x0000, 0x20a9, 0x000a,
+	0x20a3, 0x0000, 0x1f04, 0x4680, 0x60c3, 0x0014, 0x080c, 0x4b06,
+	0x0005, 0x00f6, 0x7084, 0xa005, 0x01f0, 0x2011, 0x4adc, 0x080c,
+	0x699c, 0xa086, 0x0014, 0x11a8, 0x2079, 0xbb80, 0x7a30, 0xa296,
+	0x1102, 0x1178, 0x7834, 0xa005, 0x1160, 0x7a38, 0xd2fc, 0x0128,
+	0x70b8, 0xa005, 0x1110, 0x70bb, 0x0001, 0x708f, 0x0004, 0x0029,
+	0x0010, 0x080c, 0x4b1f, 0x00fe, 0x0005, 0x708f, 0x0005, 0x080c,
+	0x4b97, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430, 0x2011, 0xbb8e,
+	0x080c, 0x4be8, 0x1160, 0x7078, 0xa005, 0x1148, 0x7150, 0xa186,
+	0xffff, 0x0128, 0x080c, 0x4aa0, 0x0110, 0x080c, 0x4bc6, 0x20a9,
+	0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
+	0x60c3, 0x0014, 0x080c, 0x4b06, 0x0005, 0x00f6, 0x7084, 0xa005,
+	0x01f0, 0x2011, 0x4adc, 0x080c, 0x699c, 0xa086, 0x0014, 0x11a8,
+	0x2079, 0xbb80, 0x7a30, 0xa296, 0x1103, 0x1178, 0x7834, 0xa005,
+	0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70b8, 0xa005, 0x1110, 0x70bb,
+	0x0001, 0x708f, 0x0006, 0x0029, 0x0010, 0x080c, 0x4b1f, 0x00fe,
+	0x0005, 0x708f, 0x0007, 0x080c, 0x4b97, 0x20a3, 0x1104, 0x20a3,
+	0x0000, 0x3430, 0x2011, 0xbb8e, 0x080c, 0x4be8, 0x11a8, 0x7078,
+	0xa005, 0x1190, 0x7158, 0xa186, 0xffff, 0x0170, 0xa180, 0x2dc4,
+	0x200d, 0xa18c, 0xff00, 0x810f, 0x080c, 0x4aa0, 0x0128, 0x080c,
+	0x40d6, 0x0110, 0x080c, 0x2867, 0x20a9, 0x0008, 0x2298, 0x26a0,
+	0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x080c,
+	0x4b06, 0x0005, 0x00f6, 0x7084, 0xa005, 0x01f0, 0x2011, 0x4adc,
+	0x080c, 0x699c, 0xa086, 0x0014, 0x11a8, 0x2079, 0xbb80, 0x7a30,
+	0xa296, 0x1104, 0x1178, 0x7834, 0xa005, 0x1160, 0x7a38, 0xd2fc,
+	0x0128, 0x70b8, 0xa005, 0x1110, 0x70bb, 0x0001, 0x708f, 0x0008,
+	0x0029, 0x0010, 0x080c, 0x4b1f, 0x00fe, 0x0005, 0x708f, 0x0009,
+	0x080c, 0x4b97, 0x20a3, 0x1105, 0x20a3, 0x0100, 0x3430, 0x080c,
+	0x4be8, 0x1150, 0x7078, 0xa005, 0x1138, 0x080c, 0x4a15, 0x1170,
+	0xa085, 0x0001, 0x080c, 0x2867, 0x20a9, 0x0008, 0x2099, 0xbb8e,
+	0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
+	0x080c, 0x4b06, 0x0010, 0x080c, 0x462c, 0x0005, 0x00f6, 0x7084,
+	0xa005, 0x0588, 0x2011, 0x4adc, 0x080c, 0x699c, 0xa086, 0x0014,
+	0x1540, 0x2079, 0xbb80, 0x7a30, 0xa296, 0x1105, 0x1510, 0x7834,
+	0x2011, 0x0100, 0xa21e, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70b8,
+	0xa005, 0x1110, 0x70bb, 0x0001, 0x708f, 0x000a, 0x00b1, 0x0098,
+	0xa005, 0x1178, 0x7a38, 0xd2fc, 0x0128, 0x70b8, 0xa005, 0x1110,
+	0x70bb, 0x0001, 0x708b, 0x0000, 0x708f, 0x000e, 0x080c, 0x4827,
+	0x0010, 0x080c, 0x4b1f, 0x00fe, 0x0005, 0x708f, 0x000b, 0x2011,
+	0xbb0e, 0x22a0, 0x20a9, 0x0040, 0x2019, 0xffff, 0x43a4, 0x20a9,
+	0x0002, 0x2009, 0x0000, 0x41a4, 0x080c, 0x4b97, 0x20a3, 0x1106,
+	0x20a3, 0x0000, 0x080c, 0x4be8, 0x0118, 0x2013, 0x0000, 0x0020,
+	0x7054, 0xa085, 0x0100, 0x2012, 0x2298, 0x20a9, 0x0042, 0x53a6,
+	0x60c3, 0x0084, 0x080c, 0x4b06, 0x0005, 0x00f6, 0x7084, 0xa005,
+	0x01b0, 0x2011, 0x4adc, 0x080c, 0x699c, 0xa086, 0x0084, 0x1168,
+	0x2079, 0xbb80, 0x7a30, 0xa296, 0x1106, 0x1138, 0x7834, 0xa005,
+	0x1120, 0x708f, 0x000c, 0x0029, 0x0010, 0x080c, 0x4b1f, 0x00fe,
+	0x0005, 0x708f, 0x000d, 0x080c, 0x4b97, 0x20a3, 0x1107, 0x20a3,
+	0x0000, 0x2099, 0xbb8e, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000,
+	0x20a3, 0x0000, 0x60c3, 0x0084, 0x080c, 0x4b06, 0x0005, 0x00f6,
+	0x7084, 0xa005, 0x01d0, 0x2011, 0x4adc, 0x080c, 0x699c, 0xa086,
+	0x0084, 0x1188, 0x2079, 0xbb80, 0x7a30, 0xa296, 0x1107, 0x1158,
+	0x7834, 0xa005, 0x1140, 0x708b, 0x0001, 0x080c, 0x4b89, 0x708f,
+	0x000e, 0x0029, 0x0010, 0x080c, 0x4b1f, 0x00fe, 0x0005, 0x708f,
+	0x000f, 0x7087, 0x0000, 0x608b, 0xbc85, 0x608f, 0xb5b5, 0x6043,
+	0x0005, 0x6043, 0x0004, 0x2009, 0x07d0, 0x2011, 0x4adc, 0x080c,
+	0x6990, 0x0005, 0x7084, 0xa005, 0x0120, 0x2011, 0x4adc, 0x080c,
+	0x699c, 0x0005, 0x708f, 0x0011, 0x080c, 0x4be8, 0x11a0, 0x7170,
+	0x81ff, 0x0188, 0x2009, 0x0000, 0x7074, 0xa084, 0x00ff, 0x080c,
+	0x281d, 0xa186, 0x007e, 0x0138, 0xa186, 0x0080, 0x0120, 0x2011,
+	0xbb8e, 0x080c, 0x4aa0, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099,
+	0xbb80, 0x20a1, 0x020b, 0x7484, 0xa480, 0x0018, 0xa080, 0x0007,
+	0xa084, 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0014, 0x080c,
+	0x4b06, 0x0005, 0x00f6, 0x7084, 0xa005, 0x01f0, 0x2011, 0x4adc,
+	0x080c, 0x699c, 0xa086, 0x0014, 0x11a8, 0x2079, 0xbb80, 0x7a30,
+	0xa296, 0x1103, 0x1178, 0x7834, 0xa005, 0x1160, 0x7a38, 0xd2fc,
+	0x0128, 0x70b8, 0xa005, 0x1110, 0x70bb, 0x0001, 0x708f, 0x0012,
+	0x0029, 0x0010, 0x080c, 0x4b1f, 0x00fe, 0x0005, 0x708f, 0x0013,
+	0x080c, 0x4ba3, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430, 0x2011,
+	0xbb8e, 0x080c, 0x4be8, 0x1160, 0x7078, 0xa005, 0x1148, 0x7150,
+	0xa186, 0xffff, 0x0128, 0x080c, 0x4aa0, 0x0110, 0x080c, 0x4bc6,
+	0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x60c3, 0x0014, 0x080c, 0x4b06, 0x0005, 0x00f6, 0x7084,
+	0xa005, 0x01f0, 0x2011, 0x4adc, 0x080c, 0x699c, 0xa086, 0x0014,
+	0x11a8, 0x2079, 0xbb80, 0x7a30, 0xa296, 0x1104, 0x1178, 0x7834,
+	0xa005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70b8, 0xa005, 0x1110,
+	0x70bb, 0x0001, 0x708f, 0x0014, 0x0029, 0x0010, 0x080c, 0x4b1f,
+	0x00fe, 0x0005, 0x708f, 0x0015, 0x080c, 0x4ba3, 0x20a3, 0x1104,
+	0x20a3, 0x0000, 0x3430, 0x2011, 0xbb8e, 0x080c, 0x4be8, 0x11a8,
+	0x7078, 0xa005, 0x1190, 0x7158, 0xa186, 0xffff, 0x0170, 0xa180,
+	0x2dc4, 0x200d, 0xa18c, 0xff00, 0x810f, 0x080c, 0x4aa0, 0x0128,
+	0x080c, 0x40d6, 0x0110, 0x080c, 0x2867, 0x20a9, 0x0008, 0x2298,
+	0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
+	0x080c, 0x4b06, 0x0005, 0x00f6, 0x7084, 0xa005, 0x05b8, 0x2011,
+	0x4adc, 0x080c, 0x699c, 0xa086, 0x0014, 0x1570, 0x2079, 0xbb80,
+	0x7a30, 0xa296, 0x1105, 0x1540, 0x7834, 0x2011, 0x0100, 0xa21e,
+	0x1148, 0x7a38, 0xd2fc, 0x0128, 0x70b8, 0xa005, 0x1110, 0x70bb,
+	0x0001, 0x0060, 0xa005, 0x11c0, 0x7a38, 0xd2fc, 0x0128, 0x70b8,
+	0xa005, 0x1110, 0x70bb, 0x0001, 0x708b, 0x0000, 0x7a38, 0xd2f4,
+	0x0138, 0x2001, 0xb574, 0x2004, 0xd0a4, 0x1110, 0x70d7, 0x0008,
+	0x708f, 0x0016, 0x0029, 0x0010, 0x080c, 0x4b1f, 0x00fe, 0x0005,
+	0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0xbb80, 0x20a1, 0x020b,
+	0x20a9, 0x000e, 0x53a6, 0x3430, 0x2011, 0xbb8e, 0x708f, 0x0017,
+	0x080c, 0x4be8, 0x1150, 0x7078, 0xa005, 0x1138, 0x080c, 0x4a15,
+	0x1170, 0xa085, 0x0001, 0x080c, 0x2867, 0x20a9, 0x0008, 0x2099,
+	0xbb8e, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
+	0x0014, 0x080c, 0x4b06, 0x0010, 0x080c, 0x462c, 0x0005, 0x00f6,
+	0x7084, 0xa005, 0x01b0, 0x2011, 0x4adc, 0x080c, 0x699c, 0xa086,
+	0x0084, 0x1168, 0x2079, 0xbb80, 0x7a30, 0xa296, 0x1106, 0x1138,
+	0x7834, 0xa005, 0x1120, 0x708f, 0x0018, 0x0029, 0x0010, 0x080c,
+	0x4b1f, 0x00fe, 0x0005, 0x708f, 0x0019, 0x080c, 0x4ba3, 0x20a3,
+	0x1106, 0x20a3, 0x0000, 0x3430, 0x2099, 0xbb8e, 0x2039, 0xbb0e,
+	0x27a0, 0x20a9, 0x0040, 0x53a3, 0x080c, 0x4be8, 0x11e8, 0x2728,
+	0x2514, 0x8207, 0xa084, 0x00ff, 0x8000, 0x2018, 0xa294, 0x00ff,
+	0x8007, 0xa205, 0x202a, 0x7054, 0x2310, 0x8214, 0xa2a0, 0xbb0e,
+	0x2414, 0xa38c, 0x0001, 0x0118, 0xa294, 0xff00, 0x0018, 0xa294,
+	0x00ff, 0x8007, 0xa215, 0x2222, 0x2798, 0x26a0, 0x20a9, 0x0040,
+	0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084, 0x080c,
+	0x4b06, 0x0005, 0x00f6, 0x7084, 0xa005, 0x01d0, 0x2011, 0x4adc,
+	0x080c, 0x699c, 0xa086, 0x0084, 0x1188, 0x2079, 0xbb80, 0x7a30,
+	0xa296, 0x1107, 0x1158, 0x7834, 0xa005, 0x1140, 0x708b, 0x0001,
+	0x080c, 0x4b89, 0x708f, 0x001a, 0x0029, 0x0010, 0x080c, 0x4b1f,
+	0x00fe, 0x0005, 0x708f, 0x001b, 0x20e1, 0x9080, 0x20e1, 0x4000,
+	0x2099, 0xbb80, 0x20a1, 0x020b, 0x7484, 0xa480, 0x0018, 0xa080,
+	0x0007, 0xa084, 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0084,
+	0x080c, 0x4b06, 0x0005, 0x0005, 0x0005, 0x0086, 0x0096, 0x2029,
+	0xb553, 0x252c, 0x20a9, 0x0008, 0x2041, 0xbb0e, 0x28a0, 0x2099,
+	0xbb8e, 0x53a3, 0x20a9, 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0110,
+	0x2011, 0x0000, 0x2800, 0xa200, 0x200c, 0xa1a6, 0xffff, 0x1148,
+	0xd5d4, 0x0110, 0x8210, 0x0008, 0x8211, 0x1f04, 0x4a2a, 0x0804,
+	0x4a98, 0x82ff, 0x1160, 0xd5d4, 0x0120, 0xa1a6, 0x3fff, 0x0d90,
+	0x0020, 0xa1a6, 0x3fff, 0x0904, 0x4a98, 0xa18d, 0xc000, 0x20a9,
+	0x0010, 0x2019, 0x0001, 0xd5d4, 0x0110, 0x2019, 0x0010, 0x2120,
+	0xd5d4, 0x0110, 0x8423, 0x0008, 0x8424, 0x1240, 0xd5d4, 0x0110,
+	0x8319, 0x0008, 0x8318, 0x1f04, 0x4a50, 0x04d0, 0x23a8, 0x2021,
+	0x0001, 0x8426, 0x8425, 0x1f04, 0x4a62, 0x2328, 0x8529, 0xa2be,
+	0x0007, 0x0158, 0x0006, 0x2039, 0x0007, 0x2200, 0xa73a, 0x000e,
+	0x27a8, 0xa5a8, 0x0010, 0x1f04, 0x4a71, 0x7552, 0xa5c8, 0x2dc4,
+	0x292d, 0xa5ac, 0x00ff, 0x7576, 0x6532, 0x6536, 0x0016, 0x2508,
+	0x080c, 0x2847, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x2018, 0x2304,
+	0xa405, 0x201a, 0x707b, 0x0001, 0x26a0, 0x2898, 0x20a9, 0x0008,
+	0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0xa085, 0x0001, 0x0028,
+	0xa006, 0x0018, 0xa006, 0x080c, 0x1515, 0x009e, 0x008e, 0x0005,
+	0x2118, 0x2021, 0x0000, 0x2001, 0x0007, 0xa39a, 0x0010, 0x0218,
+	0x8420, 0x8001, 0x0cd0, 0x2118, 0x84ff, 0x0120, 0xa39a, 0x0010,
+	0x8421, 0x1de0, 0x2021, 0x0001, 0x83ff, 0x0118, 0x8423, 0x8319,
+	0x1de8, 0xa238, 0x2704, 0xa42c, 0x11b8, 0xa405, 0x203a, 0x7152,
+	0xa1a0, 0x2dc4, 0x242d, 0xa5ac, 0x00ff, 0x7576, 0x6532, 0x6536,
+	0x0016, 0x2508, 0x080c, 0x2847, 0x001e, 0x60e7, 0x0000, 0x65ea,
+	0x707b, 0x0001, 0xa084, 0x0000, 0x0005, 0x00e6, 0x2071, 0xb500,
+	0x707f, 0x0000, 0x00ee, 0x0005, 0x00e6, 0x00f6, 0x2079, 0x0100,
+	0x2071, 0x0140, 0x080c, 0x7d7a, 0x7004, 0xa084, 0x4000, 0x0120,
+	0x7003, 0x1000, 0x7003, 0x0000, 0x0126, 0x2091, 0x8000, 0x2071,
+	0xb523, 0x2073, 0x0000, 0x7840, 0x0026, 0x0016, 0x2009, 0x00f7,
+	0x080c, 0x4baf, 0x001e, 0xa094, 0x0010, 0xa285, 0x0080, 0x7842,
+	0x7a42, 0x002e, 0x012e, 0x00fe, 0x00ee, 0x0005, 0x0126, 0x2091,
+	0x8000, 0x2011, 0xb7ea, 0x2013, 0x0000, 0x7087, 0x0000, 0x012e,
+	0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0x7d71,
+	0x2009, 0x07d0, 0x2011, 0x4adc, 0x080c, 0x6a22, 0x0005, 0x0016,
+	0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x2011, 0x0003, 0x080c,
+	0x8075, 0x2011, 0x0002, 0x080c, 0x807f, 0x080c, 0x7f59, 0x0036,
+	0x2019, 0x0000, 0x080c, 0x7fe4, 0x003e, 0x2009, 0x00f7, 0x080c,
+	0x4baf, 0x2061, 0xb7f3, 0x601b, 0x0000, 0x601f, 0x0000, 0x2061,
+	0xb500, 0x6003, 0x0001, 0x2061, 0x0100, 0x6043, 0x0090, 0x6043,
+	0x0010, 0x2009, 0x002d, 0x2011, 0x4b54, 0x080c, 0x6990, 0x012e,
+	0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x0100, 0x080c, 0x7d7a, 0x2071, 0x0140, 0x7004,
+	0xa084, 0x4000, 0x0120, 0x7003, 0x1000, 0x7003, 0x0000, 0x080c,
+	0x5ad7, 0x01a8, 0x080c, 0x5af5, 0x1190, 0x2001, 0xb79e, 0x2003,
+	0xaaaa, 0x0016, 0x080c, 0x28eb, 0x2001, 0xb78f, 0x2102, 0x001e,
+	0x2001, 0xb79f, 0x2003, 0x0000, 0x080c, 0x5a07, 0x0030, 0x2001,
+	0x0001, 0x080c, 0x27c3, 0x080c, 0x4b1f, 0x012e, 0x000e, 0x00ee,
+	0x0005, 0x20a9, 0x0040, 0x20a1, 0xbcc0, 0x2099, 0xbb8e, 0x3304,
+	0x8007, 0x20a2, 0x9398, 0x94a0, 0x1f04, 0x4b8f, 0x0005, 0x20e1,
+	0x9080, 0x20e1, 0x4000, 0x2099, 0xbb00, 0x20a1, 0x020b, 0x20a9,
+	0x000c, 0x53a6, 0x0005, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099,
+	0xbb80, 0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6, 0x0005, 0x00c6,
+	0x0006, 0x2061, 0x0100, 0x810f, 0x2001, 0xb531, 0x2004, 0xa005,
+	0x1138, 0x2001, 0xb515, 0x2004, 0xa084, 0x00ff, 0xa105, 0x0010,
+	0xa185, 0x00f7, 0x604a, 0x000e, 0x00ce, 0x0005, 0x0016, 0x0046,
+	0x2001, 0xb553, 0x2004, 0xd0a4, 0x0158, 0xa006, 0x2020, 0x2009,
+	0x002a, 0x080c, 0xb0e8, 0x2001, 0xb50c, 0x200c, 0xc195, 0x2102,
+	0x2019, 0x002a, 0x2009, 0x0000, 0x080c, 0x2c6f, 0x004e, 0x001e,
+	0x0005, 0x080c, 0x4b1f, 0x708f, 0x0000, 0x7087, 0x0000, 0x0005,
+	0x0006, 0x2001, 0xb50c, 0x2004, 0xd09c, 0x0100, 0x000e, 0x0005,
+	0x0006, 0x0016, 0x0126, 0x2091, 0x8000, 0x2001, 0x0101, 0x200c,
+	0xa18d, 0x0006, 0x2102, 0x012e, 0x001e, 0x000e, 0x0005, 0x0156,
+	0x20a9, 0x00ff, 0x2009, 0xb635, 0xa006, 0x200a, 0x8108, 0x1f04,
+	0x4c05, 0x015e, 0x0005, 0x00d6, 0x0036, 0x0156, 0x0136, 0x0146,
+	0x2069, 0xb552, 0xa006, 0x6002, 0x6007, 0x0707, 0x600a, 0x600e,
+	0x6012, 0xa198, 0x2dc4, 0x231d, 0xa39c, 0x00ff, 0x6316, 0x20a9,
+	0x0004, 0xac98, 0x0006, 0x23a0, 0x40a4, 0x20a9, 0x0004, 0xac98,
+	0x000a, 0x23a0, 0x40a4, 0x603e, 0x6042, 0x604e, 0x6052, 0x6056,
+	0x605a, 0x605e, 0x6062, 0x6066, 0x606a, 0x606e, 0x6072, 0x6076,
+	0x607a, 0x607e, 0x6082, 0x6086, 0x608a, 0x608e, 0x6092, 0x6096,
+	0x609a, 0x609e, 0x60ae, 0x61a2, 0x00d6, 0x60a4, 0xa06d, 0x0110,
+	0x080c, 0x160f, 0x60a7, 0x0000, 0x60a8, 0xa06d, 0x0110, 0x080c,
+	0x160f, 0x60ab, 0x0000, 0x00de, 0xa006, 0x604a, 0x6810, 0x603a,
+	0x680c, 0x6046, 0x6814, 0xa084, 0x00ff, 0x6042, 0x014e, 0x013e,
+	0x015e, 0x003e, 0x00de, 0x0005, 0x0126, 0x2091, 0x8000, 0x6944,
+	0x6e48, 0xa684, 0x3fff, 0xa082, 0x4000, 0x1a04, 0x4d1a, 0xa18c,
+	0xff00, 0x810f, 0xa182, 0x00ff, 0x1a04, 0x4d1f, 0x2001, 0xb50c,
+	0x2004, 0xa084, 0x0003, 0x01c0, 0x2001, 0xb50c, 0x2004, 0xd084,
+	0x1904, 0x4d02, 0xa188, 0xb635, 0x2104, 0xa065, 0x0904, 0x4d02,
+	0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x1904, 0x4d02, 0x6000,
+	0xd0c4, 0x0904, 0x4d02, 0x0068, 0xa188, 0xb635, 0x2104, 0xa065,
+	0x0904, 0x4ce6, 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x1904,
+	0x4ceb, 0x60a4, 0xa00d, 0x0118, 0x080c, 0x51d4, 0x05d0, 0x60a8,
+	0xa00d, 0x0188, 0x080c, 0x521f, 0x1170, 0x694c, 0xd1fc, 0x1118,
+	0x080c, 0x4ede, 0x0448, 0x080c, 0x4e8d, 0x694c, 0xd1ec, 0x1520,
+	0x080c, 0x50c6, 0x0408, 0x694c, 0xa184, 0xa000, 0x0178, 0xd1ec,
+	0x0140, 0xd1fc, 0x0118, 0x080c, 0x50d5, 0x0028, 0x080c, 0x50d5,
+	0x0028, 0xd1fc, 0x0118, 0x080c, 0x4e8d, 0x0070, 0x6050, 0xa00d,
+	0x0130, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052, 0x0028, 0x2d00,
+	0x6052, 0x604e, 0x6803, 0x0000, 0x080c, 0x6caa, 0xa006, 0x012e,
+	0x0005, 0x2001, 0x0005, 0x2009, 0x0000, 0x04e8, 0x2001, 0x0028,
+	0x2009, 0x0000, 0x04c0, 0xa082, 0x0006, 0x12a0, 0x2001, 0xb535,
+	0x2004, 0xd0ac, 0x1160, 0x60a0, 0xd0bc, 0x1148, 0x6100, 0xd1fc,
+	0x0904, 0x4ca1, 0x2001, 0x0029, 0x2009, 0x1000, 0x0420, 0x2001,
+	0x0028, 0x00a8, 0x2009, 0xb50c, 0x210c, 0xd18c, 0x0118, 0x2001,
+	0x0004, 0x0068, 0xd184, 0x0118, 0x2001, 0x0004, 0x0040, 0x2001,
+	0x0029, 0x6100, 0xd1fc, 0x0118, 0x2009, 0x1000, 0x0060, 0x2009,
+	0x0000, 0x0048, 0x2001, 0x0029, 0x2009, 0x0000, 0x0020, 0x2001,
+	0x0029, 0x2009, 0x0000, 0xa005, 0x012e, 0x0005, 0x00e6, 0x0126,
+	0x2091, 0x8000, 0x6844, 0x8007, 0xa084, 0x00ff, 0x2008, 0xa182,
+	0x00ff, 0x1a04, 0x4d79, 0xa188, 0xb635, 0x2104, 0xa065, 0x01c0,
+	0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x11a8, 0x2c70, 0x080c,
+	0x85c7, 0x05e8, 0x2e00, 0x601a, 0x2d00, 0x6012, 0x600b, 0xffff,
+	0x601f, 0x000a, 0x2009, 0x0003, 0x080c, 0x864c, 0xa006, 0x0460,
+	0x2001, 0x0028, 0x0440, 0xa082, 0x0006, 0x1298, 0x2001, 0xb535,
+	0x2004, 0xd0ac, 0x1158, 0x60a0, 0xd0bc, 0x1140, 0x6100, 0xd1fc,
+	0x09e8, 0x2001, 0x0029, 0x2009, 0x1000, 0x00a8, 0x2001, 0x0028,
+	0x0090, 0x2009, 0xb50c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004,
+	0x0050, 0xd184, 0x0118, 0x2001, 0x0004, 0x0028, 0x2001, 0x0029,
+	0x0010, 0x2001, 0x0029, 0xa005, 0x012e, 0x00ee, 0x0005, 0x2001,
+	0x002c, 0x0cc8, 0x00f6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2011,
+	0x0000, 0x2079, 0xb500, 0x6944, 0xa18c, 0xff00, 0x810f, 0xa182,
+	0x00ff, 0x1a04, 0x4e44, 0x080c, 0x4fa9, 0x11a0, 0x6004, 0xa084,
+	0x00ff, 0xa082, 0x0006, 0x1270, 0x6864, 0xa0c6, 0x006f, 0x0150,
+	0x2001, 0xb535, 0x2004, 0xd0ac, 0x1904, 0x4e2d, 0x60a0, 0xd0bc,
+	0x1904, 0x4e2d, 0x6864, 0xa0c6, 0x006f, 0x0118, 0x2008, 0x0804,
+	0x4df6, 0x6968, 0x2140, 0xa18c, 0xff00, 0x810f, 0x78d4, 0xd0ac,
+	0x1118, 0xa182, 0x0080, 0x06d0, 0xa182, 0x00ff, 0x16b8, 0x6a70,
+	0x6b6c, 0x7870, 0xa306, 0x1160, 0x7874, 0xa24e, 0x1118, 0x2208,
+	0x2310, 0x0460, 0xa9cc, 0xff00, 0x1118, 0x2208, 0x2310, 0x0430,
+	0x080c, 0x3dc5, 0x2c70, 0x0550, 0x2009, 0x0000, 0x2011, 0x0000,
+	0xa0c6, 0x4000, 0x1160, 0x0006, 0x2e60, 0x080c, 0x524a, 0x1108,
+	0xc185, 0x7000, 0xd0bc, 0x0108, 0xc18d, 0x000e, 0x0088, 0xa0c6,
+	0x4007, 0x1110, 0x2408, 0x0060, 0xa0c6, 0x4008, 0x1118, 0x2708,
+	0x2610, 0x0030, 0xa0c6, 0x4009, 0x1108, 0x0010, 0x2001, 0x4006,
+	0x6866, 0x696a, 0x6a6e, 0x2001, 0x0030, 0x0450, 0x080c, 0x85c7,
+	0x1138, 0x2001, 0x4005, 0x2009, 0x0003, 0x2011, 0x0000, 0x0c80,
+	0x2e00, 0x601a, 0x080c, 0xa027, 0x2d00, 0x6012, 0x601f, 0x0001,
+	0x6838, 0xd88c, 0x0108, 0xc0f5, 0x683a, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x2c9c, 0x012e, 0x2001, 0x0000, 0x080c, 0x4eeb, 0x2001,
+	0x0002, 0x080c, 0x4efd, 0x2009, 0x0002, 0x080c, 0x864c, 0xa006,
+	0xa005, 0x012e, 0x00ee, 0x00fe, 0x0005, 0x2001, 0x0028, 0x2009,
+	0x0000, 0x0cb0, 0x2009, 0xb50c, 0x210c, 0xd18c, 0x0118, 0x2001,
+	0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010, 0x2001,
+	0x0029, 0x2009, 0x0000, 0x0c20, 0x2001, 0x0029, 0x2009, 0x0000,
+	0x08f8, 0x6944, 0x6e48, 0xa684, 0x3fff, 0xa082, 0x4000, 0x16b8,
+	0xa18c, 0xff00, 0x810f, 0xa182, 0x00ff, 0x12e0, 0xa188, 0xb635,
+	0x2104, 0xa065, 0x01b8, 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006,
+	0x11b0, 0x684c, 0xd0ec, 0x0120, 0x080c, 0x50d5, 0x0431, 0x0030,
+	0x0421, 0x684c, 0xd0fc, 0x0110, 0x080c, 0x50c6, 0x080c, 0x5113,
+	0xa006, 0x00c8, 0x2001, 0x0028, 0x2009, 0x0000, 0x00a0, 0xa082,
+	0x0006, 0x1240, 0x6100, 0xd1fc, 0x0d20, 0x2001, 0x0029, 0x2009,
+	0x1000, 0x0048, 0x2001, 0x0029, 0x2009, 0x0000, 0x0020, 0x2001,
+	0x0029, 0x2009, 0x0000, 0xa005, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x6050, 0xa00d, 0x0138, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052,
+	0x012e, 0x0005, 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x0cc0,
+	0x0126, 0x2091, 0x8000, 0x604c, 0xa005, 0x0170, 0x00e6, 0x2071,
+	0xb7e0, 0x7004, 0xa086, 0x0002, 0x0168, 0x00ee, 0x604c, 0x6802,
+	0x2d00, 0x604e, 0x012e, 0x0005, 0x2d00, 0x6052, 0x604e, 0x6803,
+	0x0000, 0x0cc0, 0x701c, 0xac06, 0x1d80, 0x604c, 0x2070, 0x7000,
+	0x6802, 0x2d00, 0x7002, 0x00ee, 0x012e, 0x0005, 0x0126, 0x2091,
+	0x8000, 0x604c, 0xa06d, 0x0130, 0x6800, 0xa005, 0x1108, 0x6052,
+	0x604e, 0xad05, 0x012e, 0x0005, 0x604c, 0xa06d, 0x0130, 0x6800,
+	0xa005, 0x1108, 0x6052, 0x604e, 0xad05, 0x0005, 0x6803, 0x0000,
+	0x6084, 0xa00d, 0x0120, 0x2d00, 0x200a, 0x6086, 0x0005, 0x2d00,
+	0x6086, 0x6082, 0x0cd8, 0x0126, 0x00c6, 0x0026, 0x2091, 0x8000,
+	0x6218, 0x2260, 0x6200, 0xa005, 0x0110, 0xc285, 0x0008, 0xc284,
+	0x6202, 0x002e, 0x00ce, 0x012e, 0x0005, 0x0126, 0x00c6, 0x2091,
+	0x8000, 0x6218, 0x2260, 0x6204, 0x0006, 0xa086, 0x0006, 0x1180,
+	0x609c, 0xd0ac, 0x0168, 0x2001, 0xb553, 0x2004, 0xd0a4, 0x0140,
+	0xa284, 0xff00, 0x8007, 0xa086, 0x0007, 0x1110, 0x2011, 0x0600,
+	0x000e, 0xa294, 0xff00, 0xa215, 0x6206, 0x0006, 0xa086, 0x0006,
+	0x1128, 0x6290, 0x82ff, 0x1110, 0x080c, 0x1515, 0x000e, 0x00ce,
+	0x012e, 0x0005, 0x0126, 0x00c6, 0x2091, 0x8000, 0x6218, 0x2260,
+	0x6204, 0x0006, 0xa086, 0x0006, 0x1178, 0x609c, 0xd0a4, 0x0160,
+	0x2001, 0xb553, 0x2004, 0xd0ac, 0x1138, 0xa284, 0x00ff, 0xa086,
+	0x0007, 0x1110, 0x2011, 0x0006, 0x000e, 0xa294, 0x00ff, 0x8007,
+	0xa215, 0x6206, 0x00ce, 0x012e, 0x0005, 0x0026, 0xa182, 0x00ff,
+	0x0218, 0xa085, 0x0001, 0x00b0, 0xa190, 0xb635, 0x2204, 0xa065,
+	0x1180, 0x0016, 0x00d6, 0x080c, 0x15df, 0x2d60, 0x00de, 0x001e,
+	0x0d80, 0x2c00, 0x2012, 0x60a7, 0x0000, 0x60ab, 0x0000, 0x080c,
+	0x4c0b, 0xa006, 0x002e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0026,
+	0xa182, 0x00ff, 0x0218, 0xa085, 0x0001, 0x0480, 0x00d6, 0xa190,
+	0xb635, 0x2204, 0xa06d, 0x0540, 0x2013, 0x0000, 0x00d6, 0x00c6,
+	0x2d60, 0x60a4, 0xa06d, 0x0110, 0x080c, 0x160f, 0x60a8, 0xa06d,
+	0x0110, 0x080c, 0x160f, 0x00ce, 0x00de, 0x00d6, 0x00c6, 0x68ac,
+	0x2060, 0x8cff, 0x0168, 0x600c, 0x0006, 0x6010, 0x2068, 0x080c,
+	0x9c5a, 0x0110, 0x080c, 0x161f, 0x080c, 0x861d, 0x00ce, 0x0c88,
+	0x00ce, 0x00de, 0x080c, 0x160f, 0x00de, 0xa006, 0x002e, 0x012e,
+	0x0005, 0x0016, 0xa182, 0x00ff, 0x0218, 0xa085, 0x0001, 0x0030,
+	0xa188, 0xb635, 0x2104, 0xa065, 0x0dc0, 0xa006, 0x001e, 0x0005,
+	0x00d6, 0x0156, 0x0136, 0x0146, 0x600b, 0x0000, 0x600f, 0x0000,
+	0x6000, 0xc08c, 0x6002, 0x080c, 0x5acf, 0x1558, 0x60a0, 0xa086,
+	0x007e, 0x2069, 0xbb90, 0x0130, 0x2001, 0xb535, 0x2004, 0xd0ac,
+	0x1500, 0x0098, 0x2d04, 0xd0e4, 0x01e0, 0x00d6, 0x2069, 0xbb8e,
+	0x00c6, 0x2061, 0xb7b2, 0x6810, 0x2062, 0x6814, 0x6006, 0x6818,
+	0x600a, 0x681c, 0x600e, 0x00ce, 0x00de, 0x8d69, 0x2d04, 0x2069,
+	0x0140, 0xa005, 0x1110, 0x2001, 0x0001, 0x6886, 0x2069, 0xb500,
+	0x68a6, 0x2069, 0xbb8e, 0x6808, 0x605e, 0x6810, 0x6062, 0x6138,
+	0xa10a, 0x0208, 0x603a, 0x6814, 0x6066, 0x2099, 0xbb96, 0xac88,
+	0x000a, 0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2099, 0xbb9a, 0xac88,
+	0x0006, 0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2069, 0xbbae, 0x6808,
+	0x606a, 0x690c, 0x616e, 0x6810, 0x6072, 0x6818, 0x6076, 0x60a0,
+	0xa086, 0x007e, 0x1120, 0x2069, 0xbb8e, 0x690c, 0x616e, 0xa182,
+	0x0211, 0x1218, 0x2009, 0x0008, 0x0400, 0xa182, 0x0259, 0x1218,
+	0x2009, 0x0007, 0x00d0, 0xa182, 0x02c1, 0x1218, 0x2009, 0x0006,
+	0x00a0, 0xa182, 0x0349, 0x1218, 0x2009, 0x0005, 0x0070, 0xa182,
+	0x0421, 0x1218, 0x2009, 0x0004, 0x0040, 0xa182, 0x0581, 0x1218,
+	0x2009, 0x0003, 0x0010, 0x2009, 0x0002, 0x6192, 0x014e, 0x013e,
+	0x015e, 0x00de, 0x0005, 0x0016, 0x0026, 0x00e6, 0x2071, 0xbb8d,
+	0x2e04, 0x6896, 0x2071, 0xbb8e, 0x7004, 0x689a, 0x701c, 0x689e,
+	0x6a00, 0x2009, 0xb572, 0x210c, 0xd0bc, 0x0120, 0xd1ec, 0x0110,
+	0xc2ad, 0x0008, 0xc2ac, 0xd0c4, 0x0120, 0xd1e4, 0x0110, 0xc2bd,
+	0x0008, 0xc2bc, 0x6a02, 0x00ee, 0x002e, 0x001e, 0x0005, 0x00d6,
+	0x0126, 0x2091, 0x8000, 0x60a4, 0xa06d, 0x01c0, 0x6900, 0x81ff,
+	0x1540, 0x6a04, 0xa282, 0x0010, 0x1648, 0xad88, 0x0004, 0x20a9,
+	0x0010, 0x2104, 0xa086, 0xffff, 0x0128, 0x8108, 0x1f04, 0x5081,
+	0x080c, 0x1515, 0x260a, 0x8210, 0x6a06, 0x0098, 0x080c, 0x15f8,
+	0x01a8, 0x2d00, 0x60a6, 0x6803, 0x0000, 0xad88, 0x0004, 0x20a9,
+	0x0010, 0x200b, 0xffff, 0x8108, 0x1f04, 0x5099, 0x6807, 0x0001,
+	0x6e12, 0xa085, 0x0001, 0x012e, 0x00de, 0x0005, 0xa006, 0x0cd8,
+	0x0126, 0x2091, 0x8000, 0x00d6, 0x60a4, 0xa00d, 0x01a0, 0x2168,
+	0x6800, 0xa005, 0x1160, 0x080c, 0x51d4, 0x1168, 0x200b, 0xffff,
+	0x6804, 0xa08a, 0x0002, 0x0218, 0x8001, 0x6806, 0x0020, 0x080c,
+	0x160f, 0x60a7, 0x0000, 0x00de, 0x012e, 0x0005, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x5232, 0x0010, 0x080c, 0x4e8d, 0x080c, 0x514c,
+	0x1dd8, 0x080c, 0x5113, 0x012e, 0x0005, 0x00d6, 0x0126, 0x2091,
+	0x8000, 0x60a8, 0xa06d, 0x01c0, 0x6950, 0x81ff, 0x1540, 0x6a54,
+	0xa282, 0x0010, 0x1670, 0xad88, 0x0018, 0x20a9, 0x0010, 0x2104,
+	0xa086, 0xffff, 0x0128, 0x8108, 0x1f04, 0x50e7, 0x080c, 0x1515,
+	0x260a, 0x8210, 0x6a56, 0x0098, 0x080c, 0x15f8, 0x01d0, 0x2d00,
+	0x60aa, 0x6853, 0x0000, 0xad88, 0x0018, 0x20a9, 0x0010, 0x200b,
+	0xffff, 0x8108, 0x1f04, 0x50ff, 0x6857, 0x0001, 0x6e62, 0x0010,
+	0x080c, 0x4ede, 0x0089, 0x1de0, 0xa085, 0x0001, 0x012e, 0x00de,
+	0x0005, 0xa006, 0x0cd8, 0x0126, 0x2091, 0x8000, 0x080c, 0x6caa,
+	0x012e, 0x0005, 0xa01e, 0x0010, 0x2019, 0x0001, 0xa00e, 0x0126,
+	0x2091, 0x8000, 0x604c, 0x2068, 0x6000, 0xd0dc, 0x1170, 0x8dff,
+	0x01f8, 0x83ff, 0x0120, 0x6848, 0xa606, 0x0158, 0x0030, 0x683c,
+	0xa406, 0x1118, 0x6840, 0xa506, 0x0120, 0x2d08, 0x6800, 0x2068,
+	0x0c70, 0x080c, 0x811e, 0x6a00, 0x604c, 0xad06, 0x1110, 0x624e,
+	0x0018, 0xa180, 0x0000, 0x2202, 0x82ff, 0x1110, 0x6152, 0x8dff,
+	0x012e, 0x0005, 0xa01e, 0x0010, 0x2019, 0x0001, 0xa00e, 0x6080,
+	0x2068, 0x8dff, 0x01e8, 0x83ff, 0x0120, 0x6848, 0xa606, 0x0158,
+	0x0030, 0x683c, 0xa406, 0x1118, 0x6840, 0xa506, 0x0120, 0x2d08,
+	0x6800, 0x2068, 0x0c70, 0x6a00, 0x6080, 0xad06, 0x1110, 0x6282,
+	0x0018, 0xa180, 0x0000, 0x2202, 0x82ff, 0x1110, 0x6186, 0x8dff,
+	0x0005, 0xa016, 0x080c, 0x51ce, 0x1110, 0x2011, 0x0001, 0x080c,
+	0x5219, 0x1110, 0xa295, 0x0002, 0x0005, 0x080c, 0x524a, 0x0118,
+	0x080c, 0x9d0f, 0x0010, 0xa085, 0x0001, 0x0005, 0x080c, 0x524a,
+	0x0118, 0x080c, 0x9c9f, 0x0010, 0xa085, 0x0001, 0x0005, 0x080c,
+	0x524a, 0x0118, 0x080c, 0x9cf2, 0x0010, 0xa085, 0x0001, 0x0005,
+	0x080c, 0x524a, 0x0118, 0x080c, 0x9cbb, 0x0010, 0xa085, 0x0001,
+	0x0005, 0x080c, 0x524a, 0x0118, 0x080c, 0x9d2b, 0x0010, 0xa085,
+	0x0001, 0x0005, 0x0126, 0x0006, 0x00d6, 0x2091, 0x8000, 0x6080,
+	0xa06d, 0x01a0, 0x6800, 0x0006, 0x6837, 0x0103, 0x6b4a, 0x6847,
+	0x0000, 0x080c, 0x9ecc, 0x0006, 0x6000, 0xd0fc, 0x0110, 0x080c,
+	0xb389, 0x000e, 0x080c, 0x5408, 0x000e, 0x0c50, 0x6083, 0x0000,
+	0x6087, 0x0000, 0x00de, 0x000e, 0x012e, 0x0005, 0x60a4, 0xa00d,
+	0x1118, 0xa085, 0x0001, 0x0005, 0x00e6, 0x2170, 0x7000, 0xa005,
+	0x1168, 0x20a9, 0x0010, 0xae88, 0x0004, 0x2104, 0xa606, 0x0130,
+	0x8108, 0x1f04, 0x51dd, 0xa085, 0x0001, 0x0008, 0xa006, 0x00ee,
+	0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x60a4, 0xa06d, 0x1128,
+	0x080c, 0x15f8, 0x01a0, 0x2d00, 0x60a6, 0x6803, 0x0001, 0x6807,
+	0x0000, 0xad88, 0x0004, 0x20a9, 0x0010, 0x200b, 0xffff, 0x8108,
+	0x1f04, 0x51fd, 0xa085, 0x0001, 0x012e, 0x00de, 0x0005, 0xa006,
+	0x0cd8, 0x00d6, 0x0126, 0x2091, 0x8000, 0x60a4, 0xa06d, 0x0130,
+	0x60a7, 0x0000, 0x080c, 0x160f, 0xa085, 0x0001, 0x012e, 0x00de,
+	0x0005, 0x60a8, 0xa00d, 0x1118, 0xa085, 0x0001, 0x0005, 0x00e6,
+	0x2170, 0x7050, 0xa005, 0x1160, 0x20a9, 0x0010, 0xae88, 0x0018,
+	0x2104, 0xa606, 0x0128, 0x8108, 0x1f04, 0x5228, 0xa085, 0x0001,
+	0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x0c19, 0x1188, 0x200b,
+	0xffff, 0x00d6, 0x60a8, 0x2068, 0x6854, 0xa08a, 0x0002, 0x0218,
+	0x8001, 0x6856, 0x0020, 0x080c, 0x160f, 0x60ab, 0x0000, 0x00de,
+	0x012e, 0x0005, 0x609c, 0xd0a4, 0x0005, 0x00f6, 0x080c, 0x5acf,
+	0x01b0, 0x71b8, 0x81ff, 0x1198, 0x71d4, 0xd19c, 0x0180, 0x2001,
+	0x007e, 0xa080, 0xb635, 0x2004, 0xa07d, 0x0148, 0x7804, 0xa084,
+	0x00ff, 0xa086, 0x0006, 0x1118, 0x7800, 0xc0ed, 0x7802, 0x2079,
+	0xb552, 0x7804, 0xd0a4, 0x01e8, 0x0156, 0x00c6, 0x20a9, 0x007f,
+	0x2009, 0x0000, 0x0016, 0x080c, 0x4fa9, 0x1168, 0x6004, 0xa084,
+	0xff00, 0x8007, 0xa096, 0x0004, 0x0118, 0xa086, 0x0006, 0x1118,
+	0x6000, 0xc0ed, 0x6002, 0x001e, 0x8108, 0x1f04, 0x5272, 0x00ce,
+	0x015e, 0x080c, 0x5309, 0x0120, 0x2001, 0xb7b5, 0x200c, 0x0038,
+	0x2079, 0xb552, 0x7804, 0xd0a4, 0x0130, 0x2009, 0x07d0, 0x2011,
+	0x529d, 0x080c, 0x6a22, 0x00fe, 0x0005, 0x2011, 0x529d, 0x080c,
+	0x699c, 0x080c, 0x5309, 0x01f0, 0x2001, 0xb6b3, 0x2004, 0xa080,
+	0x0000, 0x200c, 0xc1ec, 0x2102, 0x2001, 0xb553, 0x2004, 0xd0a4,
+	0x0130, 0x2009, 0x07d0, 0x2011, 0x529d, 0x080c, 0x6a22, 0x00e6,
+	0x2071, 0xb500, 0x7073, 0x0000, 0x7077, 0x0000, 0x080c, 0x2ab8,
+	0x00ee, 0x04b0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x2009, 0x0000,
+	0x0016, 0x080c, 0x4fa9, 0x1530, 0x6000, 0xd0ec, 0x0518, 0x0046,
+	0x62a0, 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0x0029, 0x080c,
+	0xb0e8, 0x6000, 0xc0e5, 0xc0ec, 0x6002, 0x6004, 0xa084, 0x00ff,
+	0xa085, 0x0700, 0x6006, 0x2019, 0x0029, 0x080c, 0x6df5, 0x0076,
+	0x2039, 0x0000, 0x080c, 0x6d02, 0x2009, 0x0000, 0x080c, 0xae82,
+	0x007e, 0x004e, 0x001e, 0x8108, 0x1f04, 0x52c8, 0x00ce, 0x015e,
+	0x0005, 0x00c6, 0x6018, 0x2060, 0x6000, 0xc0ec, 0x6002, 0x00ce,
+	0x0005, 0x7818, 0x2004, 0xd0ac, 0x0005, 0x7818, 0x2004, 0xd0bc,
+	0x0005, 0x00f6, 0x2001, 0xb6b3, 0x2004, 0xa07d, 0x0110, 0x7800,
+	0xd0ec, 0x00fe, 0x0005, 0x0126, 0x0026, 0x2091, 0x8000, 0x0006,
+	0x62a0, 0xa290, 0xb635, 0x2204, 0xac06, 0x190c, 0x1515, 0x000e,
+	0x6200, 0xa005, 0x0110, 0xc2fd, 0x0008, 0xc2fc, 0x6202, 0x002e,
+	0x012e, 0x0005, 0x2011, 0xb535, 0x2204, 0xd0cc, 0x0138, 0x2001,
+	0xb7b3, 0x200c, 0x2011, 0x5337, 0x080c, 0x6a22, 0x0005, 0x2011,
+	0x5337, 0x080c, 0x699c, 0x2011, 0xb535, 0x2204, 0xc0cc, 0x2012,
+	0x0005, 0x2071, 0xb614, 0x7003, 0x0001, 0x7007, 0x0000, 0x7013,
+	0x0000, 0x7017, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, 0x700b,
+	0x0000, 0x704b, 0x0001, 0x704f, 0x0000, 0x705b, 0x0020, 0x705f,
+	0x0040, 0x707f, 0x0000, 0x2071, 0xb77d, 0x7003, 0xb614, 0x7007,
+	0x0000, 0x700b, 0x0000, 0x700f, 0xb75d, 0x7013, 0x0020, 0x7017,
+	0x0040, 0x7037, 0x0000, 0x0005, 0x0016, 0x00e6, 0x2071, 0xb735,
+	0xa00e, 0x7186, 0x718a, 0x7097, 0x0001, 0x2001, 0xb553, 0x2004,
+	0xd0fc, 0x1150, 0x2001, 0xb553, 0x2004, 0xa00e, 0xd09c, 0x0108,
+	0x8108, 0x7102, 0x0804, 0x53d2, 0x2001, 0xb572, 0x200c, 0xa184,
+	0x000f, 0x2009, 0xb573, 0x210c, 0x0002, 0x537a, 0x53ad, 0x53b4,
+	0x53be, 0x53c3, 0x537a, 0x537a, 0x537a, 0x539d, 0x537a, 0x537a,
+	0x537a, 0x537a, 0x537a, 0x537a, 0x537a, 0x7003, 0x0004, 0x0136,
+	0x0146, 0x0156, 0x2099, 0xb576, 0x20a1, 0xb786, 0x20a9, 0x0004,
+	0x53a3, 0x015e, 0x014e, 0x013e, 0x0428, 0x708f, 0x0005, 0x7007,
+	0x0122, 0x2001, 0x0002, 0x0030, 0x708f, 0x0002, 0x7007, 0x0121,
+	0x2001, 0x0003, 0x7002, 0x7097, 0x0001, 0x0088, 0x7007, 0x0122,
+	0x2001, 0x0002, 0x0020, 0x7007, 0x0121, 0x2001, 0x0003, 0x7002,
+	0xa006, 0x7096, 0x708e, 0xa184, 0xff00, 0x8007, 0x709a, 0xa184,
+	0x00ff, 0x7092, 0x00ee, 0x001e, 0x0005, 0x00e6, 0x2071, 0xb614,
+	0x684c, 0xa005, 0x1130, 0x7028, 0xc085, 0x702a, 0xa085, 0x0001,
+	0x0428, 0x6a60, 0x7236, 0x6b64, 0x733a, 0x6868, 0x703e, 0x7076,
+	0x686c, 0x7042, 0x707a, 0x684c, 0x702e, 0x6844, 0x7032, 0x2009,
+	0x000d, 0x200a, 0x700b, 0x0000, 0x8007, 0x8006, 0x8006, 0xa08c,
+	0x003f, 0xa084, 0xffc0, 0xa210, 0x2100, 0xa319, 0x726e, 0x7372,
+	0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0xa006, 0x00ee, 0x0005,
+	0x0156, 0x00e6, 0x0026, 0x6838, 0xd0fc, 0x1904, 0x5461, 0x6804,
+	0xa00d, 0x0188, 0x00d6, 0x2071, 0xb500, 0xa016, 0x702c, 0x2168,
+	0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, 0x1dc8, 0x702e, 0x70b4,
+	0xa200, 0x70b6, 0x00de, 0x2071, 0xb614, 0x701c, 0xa005, 0x1904,
+	0x5471, 0x20a9, 0x0032, 0x0f04, 0x546f, 0x0e04, 0x542b, 0x2071,
+	0xb735, 0x7200, 0x82ff, 0x05d8, 0x6934, 0xa186, 0x0103, 0x1904,
+	0x547f, 0x6948, 0x6844, 0xa105, 0x1540, 0x2009, 0x8020, 0x2200,
+	0x0002, 0x546f, 0x5446, 0x5497, 0x54a3, 0x546f, 0x2071, 0x0000,
+	0x20a9, 0x0032, 0x0f04, 0x546f, 0x7018, 0xd084, 0x1dd8, 0x7122,
+	0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001, 0x2091, 0x4080,
+	0x2071, 0xb500, 0x702c, 0x206a, 0x2d00, 0x702e, 0x70b4, 0x8000,
+	0x70b6, 0x002e, 0x00ee, 0x015e, 0x0005, 0x6844, 0xa086, 0x0100,
+	0x1130, 0x6868, 0xa005, 0x1118, 0x2009, 0x8020, 0x0880, 0x2071,
+	0xb614, 0x2d08, 0x206b, 0x0000, 0x7010, 0x8000, 0x7012, 0x7018,
+	0xa06d, 0x711a, 0x0110, 0x6902, 0x0008, 0x711e, 0x0c10, 0xa18c,
+	0x00ff, 0xa186, 0x0017, 0x0130, 0xa186, 0x001e, 0x0118, 0xa18e,
+	0x001f, 0x1d28, 0x684c, 0xd0cc, 0x0d10, 0x6850, 0xa084, 0x00ff,
+	0xa086, 0x0001, 0x19e0, 0x2009, 0x8021, 0x0804, 0x543f, 0x7084,
+	0x8008, 0xa092, 0x001e, 0x1a98, 0x7186, 0xae90, 0x0003, 0xa210,
+	0x683c, 0x2012, 0x0078, 0x7084, 0x8008, 0xa092, 0x000f, 0x1a38,
+	0x7186, 0xae90, 0x0003, 0x8003, 0xa210, 0x683c, 0x2012, 0x8210,
+	0x6840, 0x2012, 0x7088, 0xa10a, 0x0a04, 0x5458, 0x718c, 0x7084,
+	0xa10a, 0x0a04, 0x5458, 0x2071, 0x0000, 0x7018, 0xd084, 0x1904,
+	0x5458, 0x2071, 0xb735, 0x7000, 0xa086, 0x0002, 0x1150, 0x080c,
+	0x5722, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091, 0x4080, 0x0804,
+	0x5458, 0x080c, 0x574c, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091,
+	0x4080, 0x0804, 0x5458, 0x0006, 0x684c, 0x0006, 0x6837, 0x0103,
+	0x20a9, 0x001c, 0xad80, 0x0011, 0x20a0, 0x2001, 0x0000, 0x40a4,
+	0x000e, 0xa084, 0x00ff, 0x684e, 0x000e, 0x684a, 0x6952, 0x0005,
+	0x2071, 0xb614, 0x7004, 0x0002, 0x54fe, 0x550f, 0x570d, 0x570e,
+	0x571b, 0x5721, 0x54ff, 0x56fe, 0x5694, 0x56ea, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x0e04, 0x550e, 0x2009, 0x000d, 0x7030, 0x200a,
+	0x2091, 0x4080, 0x7007, 0x0001, 0x700b, 0x0000, 0x012e, 0x2069,
+	0xb7f3, 0x683c, 0xa005, 0x03f8, 0x11f0, 0x0126, 0x2091, 0x8000,
+	0x2069, 0x0000, 0x6934, 0x2001, 0xb620, 0x2004, 0xa10a, 0x0170,
+	0x0e04, 0x5532, 0x2069, 0x0000, 0x6818, 0xd084, 0x1158, 0x2009,
+	0x8040, 0x6922, 0x681b, 0x0001, 0x2091, 0x4080, 0x2069, 0xb7f3,
+	0x683f, 0xffff, 0x012e, 0x2069, 0xb500, 0x6848, 0x6968, 0xa102,
+	0x2069, 0xb735, 0x688a, 0x6984, 0x701c, 0xa06d, 0x0120, 0x81ff,
+	0x0904, 0x5588, 0x00a0, 0x81ff, 0x0904, 0x564e, 0x2071, 0xb735,
+	0x7184, 0x7088, 0xa10a, 0x1258, 0x7190, 0x2071, 0xb7f3, 0x7038,
+	0xa005, 0x0128, 0x1b04, 0x564e, 0x713a, 0x0804, 0x564e, 0x2071,
+	0xb735, 0x718c, 0x0126, 0x2091, 0x8000, 0x7084, 0xa10a, 0x0a04,
+	0x5669, 0x0e04, 0x560a, 0x2071, 0x0000, 0x7018, 0xd084, 0x1904,
+	0x560a, 0x2001, 0xffff, 0x2071, 0xb7f3, 0x703a, 0x2071, 0xb735,
+	0x7000, 0xa086, 0x0002, 0x1150, 0x080c, 0x5722, 0x2071, 0x0000,
+	0x701b, 0x0001, 0x2091, 0x4080, 0x0804, 0x560a, 0x080c, 0x574c,
+	0x2071, 0x0000, 0x701b, 0x0001, 0x2091, 0x4080, 0x0804, 0x560a,
+	0x2071, 0xb735, 0x7000, 0xa005, 0x0904, 0x5630, 0x6934, 0xa186,
+	0x0103, 0x1904, 0x560d, 0x684c, 0xd0bc, 0x1904, 0x5630, 0x6948,
+	0x6844, 0xa105, 0x1904, 0x5625, 0x2009, 0x8020, 0x2071, 0xb735,
+	0x7000, 0x0002, 0x5630, 0x55f0, 0x55c8, 0x55da, 0x55a7, 0x0136,
+	0x0146, 0x0156, 0x2099, 0xb576, 0x20a1, 0xb786, 0x20a9, 0x0004,
+	0x53a3, 0x015e, 0x014e, 0x013e, 0x2071, 0xb77d, 0xad80, 0x000f,
+	0x700e, 0x7013, 0x0002, 0x7007, 0x0002, 0x700b, 0x0000, 0x2e10,
+	0x080c, 0x1643, 0x2071, 0xb614, 0x7007, 0x0009, 0x0804, 0x564e,
+	0x7084, 0x8008, 0xa092, 0x001e, 0x1a04, 0x564e, 0xae90, 0x0003,
+	0xa210, 0x683c, 0x2012, 0x7186, 0x2071, 0xb614, 0x080c, 0x57a3,
+	0x0804, 0x564e, 0x7084, 0x8008, 0xa092, 0x000f, 0x1a04, 0x564e,
+	0xae90, 0x0003, 0x8003, 0xa210, 0x683c, 0x2012, 0x8210, 0x6840,
+	0x2012, 0x7186, 0x2071, 0xb614, 0x080c, 0x57a3, 0x0804, 0x564e,
+	0x0126, 0x2091, 0x8000, 0x0e04, 0x560a, 0x2071, 0x0000, 0x7018,
+	0xd084, 0x1180, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, 0x701b,
+	0x0001, 0x2091, 0x4080, 0x012e, 0x2071, 0xb614, 0x080c, 0x57a3,
+	0x0804, 0x564e, 0x012e, 0x0804, 0x564e, 0xa18c, 0x00ff, 0xa186,
+	0x0017, 0x0130, 0xa186, 0x001e, 0x0118, 0xa18e, 0x001f, 0x11c0,
+	0x684c, 0xd0cc, 0x01a8, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001,
+	0x1178, 0x2009, 0x8021, 0x0804, 0x559e, 0x6844, 0xa086, 0x0100,
+	0x1138, 0x6868, 0xa005, 0x1120, 0x2009, 0x8020, 0x0804, 0x559e,
+	0x2071, 0xb614, 0x080c, 0x57b5, 0x01c8, 0x2071, 0xb614, 0x700f,
+	0x0001, 0x6934, 0xa184, 0x00ff, 0xa086, 0x0003, 0x1130, 0x810f,
+	0xa18c, 0x00ff, 0x8101, 0x0108, 0x710e, 0x7007, 0x0003, 0x080c,
+	0x57ce, 0x7050, 0xa086, 0x0100, 0x0904, 0x570e, 0x0126, 0x2091,
+	0x8000, 0x2071, 0xb614, 0x7008, 0xa086, 0x0001, 0x1180, 0x0e04,
+	0x5667, 0x2009, 0x000d, 0x7030, 0x200a, 0x2091, 0x4080, 0x700b,
+	0x0000, 0x7004, 0xa086, 0x0006, 0x1110, 0x7007, 0x0001, 0x012e,
+	0x0005, 0x2071, 0xb614, 0x080c, 0x57b5, 0x0518, 0x2071, 0xb735,
+	0x7084, 0x700a, 0x20a9, 0x0020, 0x2099, 0xb736, 0x20a1, 0xb75d,
+	0x53a3, 0x7087, 0x0000, 0x2071, 0xb614, 0x2069, 0xb77d, 0x706c,
+	0x6826, 0x7070, 0x682a, 0x7074, 0x682e, 0x7078, 0x6832, 0x2d10,
+	0x080c, 0x1643, 0x7007, 0x0008, 0x2001, 0xffff, 0x2071, 0xb7f3,
+	0x703a, 0x012e, 0x0804, 0x564e, 0x2069, 0xb77d, 0x6808, 0xa08e,
+	0x0000, 0x0904, 0x56e9, 0xa08e, 0x0200, 0x0904, 0x56e7, 0xa08e,
+	0x0100, 0x1904, 0x56e9, 0x0126, 0x2091, 0x8000, 0x0e04, 0x56e5,
+	0x2069, 0x0000, 0x6818, 0xd084, 0x15c0, 0x702c, 0x7130, 0x8108,
+	0xa102, 0x0230, 0xa00e, 0x7034, 0x706e, 0x7038, 0x7072, 0x0048,
+	0x706c, 0xa080, 0x0040, 0x706e, 0x1220, 0x7070, 0xa081, 0x0000,
+	0x7072, 0x7132, 0x6936, 0x700b, 0x0000, 0x2001, 0xb75a, 0x2004,
+	0xa005, 0x1190, 0x6934, 0x2069, 0xb735, 0x689c, 0x699e, 0x2069,
+	0xb7f3, 0xa102, 0x1118, 0x683c, 0xa005, 0x1368, 0x2001, 0xb75b,
+	0x200c, 0x810d, 0x693e, 0x0038, 0x2009, 0x8040, 0x6922, 0x681b,
+	0x0001, 0x2091, 0x4080, 0x7007, 0x0001, 0x012e, 0x0010, 0x7007,
+	0x0005, 0x0005, 0x2001, 0xb77f, 0x2004, 0xa08e, 0x0100, 0x1128,
+	0x7007, 0x0001, 0x080c, 0x57a3, 0x0005, 0xa08e, 0x0000, 0x0de0,
+	0xa08e, 0x0200, 0x1dc8, 0x7007, 0x0005, 0x0005, 0x701c, 0xa06d,
+	0x0158, 0x080c, 0x57b5, 0x0140, 0x7007, 0x0003, 0x080c, 0x57ce,
+	0x7050, 0xa086, 0x0100, 0x0110, 0x0005, 0x0005, 0x7050, 0xa09e,
+	0x0100, 0x1118, 0x7007, 0x0004, 0x0030, 0xa086, 0x0200, 0x1110,
+	0x7007, 0x0005, 0x0005, 0x080c, 0x5771, 0x7006, 0x080c, 0x57a3,
+	0x0005, 0x0005, 0x00e6, 0x0156, 0x2071, 0xb735, 0x7184, 0x81ff,
+	0x0500, 0xa006, 0x7086, 0xae80, 0x0003, 0x2071, 0x0000, 0x21a8,
+	0x2014, 0x7226, 0x8000, 0x0f04, 0x5746, 0x2014, 0x722a, 0x8000,
+	0x0f04, 0x5746, 0x2014, 0x722e, 0x8000, 0x0f04, 0x5746, 0x2014,
+	0x723a, 0x8000, 0x0f04, 0x5746, 0x2014, 0x723e, 0xa180, 0x8030,
+	0x7022, 0x015e, 0x00ee, 0x0005, 0x00e6, 0x0156, 0x2071, 0xb735,
+	0x7184, 0x81ff, 0x01d8, 0xa006, 0x7086, 0xae80, 0x0003, 0x2071,
+	0x0000, 0x21a8, 0x2014, 0x7226, 0x8000, 0x2014, 0x722a, 0x8000,
+	0x0f04, 0x5768, 0x2014, 0x723a, 0x8000, 0x2014, 0x723e, 0x0018,
+	0x2001, 0x8020, 0x0010, 0x2001, 0x8042, 0x7022, 0x015e, 0x00ee,
+	0x0005, 0x702c, 0x7130, 0x8108, 0xa102, 0x0230, 0xa00e, 0x7034,
+	0x706e, 0x7038, 0x7072, 0x0048, 0x706c, 0xa080, 0x0040, 0x706e,
+	0x1220, 0x7070, 0xa081, 0x0000, 0x7072, 0x7132, 0x700c, 0x8001,
+	0x700e, 0x1180, 0x0126, 0x2091, 0x8000, 0x0e04, 0x579d, 0x2001,
+	0x000d, 0x2102, 0x2091, 0x4080, 0x2001, 0x0001, 0x700b, 0x0000,
+	0x012e, 0x0005, 0x2001, 0x0007, 0x0005, 0x2001, 0x0006, 0x700b,
+	0x0001, 0x012e, 0x0005, 0x701c, 0xa06d, 0x0170, 0x0126, 0x2091,
+	0x8000, 0x7010, 0x8001, 0x7012, 0x2d04, 0x701e, 0xa005, 0x1108,
+	0x701a, 0x012e, 0x080c, 0x160f, 0x0005, 0x2019, 0x000d, 0x2304,
+	0x230c, 0xa10e, 0x0130, 0x2304, 0x230c, 0xa10e, 0x0110, 0xa006,
+	0x0060, 0x732c, 0x8319, 0x7130, 0xa102, 0x1118, 0x2300, 0xa005,
+	0x0020, 0x0210, 0xa302, 0x0008, 0x8002, 0x0005, 0x2d00, 0x7026,
+	0xa080, 0x000d, 0x7056, 0x7053, 0x0000, 0x0126, 0x2091, 0x8000,
+	0x2009, 0xb812, 0x2104, 0xc08d, 0x200a, 0x012e, 0x080c, 0x165f,
+	0x0005, 0x708c, 0xa08a, 0x0029, 0x1220, 0xa082, 0x001d, 0x0033,
+	0x0010, 0x080c, 0x1515, 0x6027, 0x1e00, 0x0005, 0x58dc, 0x5857,
+	0x586f, 0x58ac, 0x58cd, 0x5907, 0x5919, 0x586f, 0x58f3, 0x57fb,
+	0x5829, 0x57fa, 0x0005, 0x00d6, 0x2069, 0x0200, 0x6804, 0xa005,
+	0x1180, 0x6808, 0xa005, 0x1518, 0x708f, 0x0028, 0x2069, 0xb7c5,
+	0x2d04, 0x7002, 0x080c, 0x5bd1, 0x6028, 0xa085, 0x0600, 0x602a,
+	0x00b0, 0x708f, 0x0028, 0x2069, 0xb7c5, 0x2d04, 0x7002, 0x6028,
+	0xa085, 0x0600, 0x602a, 0x00e6, 0x0036, 0x0046, 0x0056, 0x2071,
+	0xb823, 0x080c, 0x1dfe, 0x005e, 0x004e, 0x003e, 0x00ee, 0x00de,
+	0x0005, 0x00d6, 0x2069, 0x0200, 0x6804, 0xa005, 0x1180, 0x6808,
+	0xa005, 0x1518, 0x708f, 0x0028, 0x2069, 0xb7c5, 0x2d04, 0x7002,
+	0x080c, 0x5c5e, 0x6028, 0xa085, 0x0600, 0x602a, 0x00b0, 0x708f,
+	0x0028, 0x2069, 0xb7c5, 0x2d04, 0x7002, 0x6028, 0xa085, 0x0600,
+	0x602a, 0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0xb823, 0x080c,
+	0x1dfe, 0x005e, 0x004e, 0x003e, 0x00ee, 0x00de, 0x0005, 0x6803,
+	0x0090, 0x6124, 0xd1e4, 0x1190, 0x080c, 0x5984, 0xd1d4, 0x1160,
+	0xd1dc, 0x1138, 0xd1cc, 0x0150, 0x708f, 0x0020, 0x080c, 0x5984,
+	0x0028, 0x708f, 0x001d, 0x0010, 0x708f, 0x001f, 0x0005, 0x6803,
+	0x0088, 0x6124, 0xd1cc, 0x1590, 0xd1dc, 0x1568, 0xd1e4, 0x1540,
+	0xa184, 0x1e00, 0x1580, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e,
+	0x080c, 0x5aff, 0x080c, 0x24b0, 0x0156, 0x6803, 0x0100, 0x20a9,
+	0x0014, 0x6804, 0xd0dc, 0x1118, 0x1f04, 0x5889, 0x0048, 0x20a9,
+	0x0014, 0x6803, 0x0080, 0x6804, 0xd0d4, 0x1130, 0x1f04, 0x5893,
+	0x080c, 0x5b20, 0x015e, 0x0078, 0x015e, 0x708f, 0x0028, 0x0058,
+	0x708f, 0x001e, 0x0040, 0x708f, 0x001d, 0x0028, 0x708f, 0x0020,
+	0x0010, 0x708f, 0x001f, 0x0005, 0x60e3, 0x0001, 0x600c, 0xc0b4,
+	0x600e, 0x080c, 0x5aff, 0x080c, 0x24b0, 0x6803, 0x0080, 0x6124,
+	0xd1d4, 0x1180, 0xd1dc, 0x1158, 0xd1e4, 0x1130, 0xa184, 0x1e00,
+	0x1158, 0x708f, 0x0028, 0x0040, 0x708f, 0x001e, 0x0028, 0x708f,
+	0x001d, 0x0010, 0x708f, 0x001f, 0x0005, 0x6803, 0x00a0, 0x6124,
+	0xd1dc, 0x1138, 0xd1e4, 0x0138, 0x080c, 0x1e47, 0x708f, 0x001e,
+	0x0010, 0x708f, 0x001d, 0x0005, 0x080c, 0x59f6, 0x6124, 0xd1dc,
+	0x1188, 0x080c, 0x5984, 0x0016, 0x080c, 0x1e47, 0x001e, 0xd1d4,
+	0x1128, 0xd1e4, 0x0138, 0x708f, 0x001e, 0x0020, 0x708f, 0x001f,
+	0x080c, 0x5984, 0x0005, 0x6803, 0x00a0, 0x6124, 0xd1d4, 0x1160,
+	0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x708f, 0x001e,
+	0x0028, 0x708f, 0x001d, 0x0010, 0x708f, 0x0021, 0x0005, 0x080c,
+	0x59f6, 0x6124, 0xd1d4, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140,
+	0x708f, 0x001e, 0x0028, 0x708f, 0x001d, 0x0010, 0x708f, 0x001f,
+	0x0005, 0x6803, 0x0090, 0x6124, 0xd1d4, 0x1178, 0xd1cc, 0x1150,
+	0xd1dc, 0x1128, 0xd1e4, 0x0158, 0x708f, 0x001e, 0x0040, 0x708f,
+	0x001d, 0x0028, 0x708f, 0x0020, 0x0010, 0x708f, 0x001f, 0x0005,
+	0x0016, 0x00c6, 0x00d6, 0x00e6, 0x0126, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x2071, 0xb500, 0x2091, 0x8000, 0x080c, 0x5acf, 0x11e8,
+	0x2001, 0xb50c, 0x200c, 0xd1b4, 0x01c0, 0xc1b4, 0x2102, 0x6027,
+	0x0200, 0xe000, 0xe000, 0x6024, 0xd0cc, 0x0158, 0x6803, 0x00a0,
+	0x2001, 0xb79f, 0x2003, 0x0001, 0x2001, 0xb500, 0x2003, 0x0001,
+	0x0428, 0x6028, 0xc0cd, 0x602a, 0x0408, 0x080c, 0x5aeb, 0x0150,
+	0x080c, 0x5ae1, 0x1138, 0x2001, 0x0001, 0x080c, 0x27c3, 0x080c,
+	0x5aa6, 0x00a0, 0x080c, 0x59f3, 0x0178, 0x2001, 0x0001, 0x080c,
+	0x27c3, 0x708c, 0xa086, 0x001e, 0x0120, 0x708c, 0xa086, 0x0022,
+	0x1118, 0x708f, 0x0025, 0x0010, 0x708f, 0x0021, 0x012e, 0x00ee,
+	0x00de, 0x00ce, 0x001e, 0x0005, 0x0026, 0x2011, 0x5995, 0x080c,
+	0x6a5c, 0x002e, 0x0016, 0x0026, 0x2009, 0x0064, 0x2011, 0x5995,
+	0x080c, 0x6a53, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00f6, 0x0016,
+	0x080c, 0x7d7a, 0x2071, 0xb500, 0x080c, 0x5930, 0x001e, 0x00fe,
+	0x00ee, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6,
+	0x00f6, 0x0126, 0x080c, 0x7d7a, 0x2061, 0x0100, 0x2069, 0x0140,
+	0x2071, 0xb500, 0x2091, 0x8000, 0x6028, 0xc09c, 0x602a, 0x2011,
+	0x0003, 0x080c, 0x8075, 0x2011, 0x0002, 0x080c, 0x807f, 0x080c,
+	0x7f59, 0x080c, 0x6a10, 0x0036, 0x2019, 0x0000, 0x080c, 0x7fe4,
+	0x003e, 0x60e3, 0x0000, 0x080c, 0xb42f, 0x080c, 0xb44a, 0x2001,
+	0xb500, 0x2003, 0x0004, 0x6027, 0x0008, 0x080c, 0x12dd, 0x2001,
+	0x0001, 0x080c, 0x27c3, 0x012e, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x003e, 0x002e, 0x001e, 0x0005, 0x2001, 0xb500, 0x2004, 0xa086,
+	0x0004, 0x0140, 0x2001, 0xb79e, 0x2003, 0xaaaa, 0x2001, 0xb79f,
+	0x2003, 0x0000, 0x0005, 0x6020, 0xd09c, 0x0005, 0x6800, 0xa086,
+	0x00c0, 0x0160, 0x6803, 0x00c0, 0x0156, 0x20a9, 0x002d, 0x1d04,
+	0x59ff, 0x2091, 0x6000, 0x1f04, 0x59ff, 0x015e, 0x0005, 0x00c6,
+	0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0xb500,
+	0x2001, 0xb79f, 0x200c, 0xa186, 0x0000, 0x0158, 0xa186, 0x0001,
+	0x0158, 0xa186, 0x0002, 0x0158, 0xa186, 0x0003, 0x0158, 0x0804,
+	0x5a94, 0x708f, 0x0022, 0x0040, 0x708f, 0x0021, 0x0028, 0x708f,
+	0x0023, 0x0020, 0x708f, 0x0024, 0x6043, 0x0000, 0x60e3, 0x0000,
+	0x6887, 0x0001, 0x2001, 0x0001, 0x080c, 0x2872, 0x0026, 0x2011,
+	0x0003, 0x080c, 0x8075, 0x2011, 0x0002, 0x080c, 0x807f, 0x080c,
+	0x7f59, 0x0036, 0x2019, 0x0000, 0x080c, 0x7fe4, 0x003e, 0x002e,
+	0x7000, 0xa08e, 0x0004, 0x0118, 0x602b, 0x0028, 0x0010, 0x602b,
+	0x0020, 0x0156, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0005, 0x6024,
+	0xd0ac, 0x0120, 0x012e, 0x015e, 0x0804, 0x5aa2, 0x6800, 0xa084,
+	0x00a0, 0xc0bd, 0x6802, 0x6904, 0xd1d4, 0x1130, 0x6803, 0x0100,
+	0x1f04, 0x5a57, 0x080c, 0x5b20, 0x012e, 0x015e, 0x080c, 0x5ae1,
+	0x01a8, 0x6044, 0xa005, 0x0168, 0x6050, 0x0006, 0xa085, 0x0020,
+	0x6052, 0x080c, 0x5b20, 0xa006, 0x8001, 0x1df0, 0x000e, 0x6052,
+	0x0028, 0x6804, 0xd0d4, 0x1110, 0x080c, 0x5b20, 0x0016, 0x0026,
+	0x2009, 0x00c8, 0x2011, 0x59a2, 0x080c, 0x6a22, 0x002e, 0x001e,
+	0x2001, 0xb79f, 0x2003, 0x0004, 0x080c, 0x57e1, 0x080c, 0x5ae1,
+	0x0148, 0x6804, 0xd0d4, 0x1130, 0xd0dc, 0x1100, 0x2001, 0xb79f,
+	0x2003, 0x0000, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6,
+	0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0xb500, 0x2001,
+	0xb79e, 0x2003, 0x0000, 0x2001, 0xb78f, 0x2003, 0x0000, 0x708f,
+	0x0000, 0x60e3, 0x0000, 0x6887, 0x0000, 0x2001, 0x0000, 0x080c,
+	0x2872, 0x6803, 0x0000, 0x6043, 0x0090, 0x6043, 0x0010, 0x6027,
+	0xffff, 0x602b, 0x182f, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x0006,
+	0x2001, 0xb79e, 0x2004, 0xa086, 0xaaaa, 0x000e, 0x0005, 0x0006,
+	0x2001, 0xb572, 0x2004, 0xa084, 0x0030, 0xa086, 0x0000, 0x000e,
+	0x0005, 0x0006, 0x2001, 0xb572, 0x2004, 0xa084, 0x0030, 0xa086,
+	0x0030, 0x000e, 0x0005, 0x0006, 0x2001, 0xb572, 0x2004, 0xa084,
+	0x0030, 0xa086, 0x0010, 0x000e, 0x0005, 0x0006, 0x2001, 0xb572,
+	0x2004, 0xa084, 0x0030, 0xa086, 0x0020, 0x000e, 0x0005, 0x2001,
+	0xb50c, 0x2004, 0xd0a4, 0x0170, 0x080c, 0x2892, 0x0036, 0x0016,
+	0x2009, 0x0000, 0x2019, 0x0028, 0x080c, 0x2c6f, 0x001e, 0x003e,
+	0xa006, 0x0009, 0x0005, 0x00e6, 0x2071, 0xb50c, 0x2e04, 0x0118,
+	0xa085, 0x0010, 0x0010, 0xa084, 0xffef, 0x2072, 0x00ee, 0x0005,
+	0x6050, 0x0006, 0x60f0, 0x0006, 0x60ec, 0x0006, 0x600c, 0x0006,
+	0x6004, 0x0006, 0x6028, 0x0006, 0x602f, 0x0100, 0x602f, 0x0000,
+	0x602f, 0x0040, 0x602f, 0x0000, 0x000e, 0x602a, 0x000e, 0x6006,
+	0x000e, 0x600e, 0x000e, 0x60ee, 0x000e, 0x60f2, 0x60e3, 0x0000,
+	0x6887, 0x0001, 0x2001, 0x0001, 0x080c, 0x2872, 0x6800, 0xa084,
+	0x00a0, 0xc0bd, 0x6802, 0x6803, 0x00a0, 0x000e, 0x6052, 0x6050,
+	0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6,
+	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0xb500, 0x6020, 0xa084,
+	0x0080, 0x0138, 0x2001, 0xb50c, 0x200c, 0xc1bd, 0x2102, 0x0804,
+	0x5bc9, 0x2001, 0xb50c, 0x200c, 0xc1bc, 0x2102, 0x6028, 0xa084,
+	0xe1ff, 0x602a, 0x6027, 0x0200, 0x6803, 0x0090, 0x20a9, 0x0384,
+	0x6024, 0xd0cc, 0x1508, 0x1d04, 0x5b78, 0x2091, 0x6000, 0x1f04,
+	0x5b78, 0x2011, 0x0003, 0x080c, 0x8075, 0x2011, 0x0002, 0x080c,
+	0x807f, 0x080c, 0x7f59, 0x2019, 0x0000, 0x080c, 0x7fe4, 0x6803,
+	0x00a0, 0x2001, 0xb79f, 0x2003, 0x0001, 0x2001, 0xb500, 0x2003,
+	0x0001, 0xa085, 0x0001, 0x0468, 0x86ff, 0x1120, 0x080c, 0x1e47,
+	0x080c, 0x24b0, 0x60e3, 0x0000, 0x2001, 0xb78f, 0x2004, 0x080c,
+	0x2872, 0x60e2, 0x6803, 0x0080, 0x20a9, 0x0384, 0x6027, 0x1e00,
+	0x2009, 0x1e00, 0xe000, 0x6024, 0xa10c, 0x0138, 0x1d04, 0x5bae,
+	0x2091, 0x6000, 0x1f04, 0x5bae, 0x0820, 0x6028, 0xa085, 0x1e00,
+	0x602a, 0x70a4, 0xa005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886,
+	0xa006, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e,
+	0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6,
+	0x2061, 0x0100, 0x2071, 0xb500, 0x2069, 0x0140, 0x6020, 0xa084,
+	0x00c0, 0x0120, 0x6884, 0xa005, 0x1904, 0x5c25, 0x6803, 0x0088,
+	0x60e3, 0x0000, 0x6887, 0x0000, 0x2001, 0x0000, 0x080c, 0x2872,
+	0x2069, 0x0200, 0x6804, 0xa005, 0x1118, 0x6808, 0xa005, 0x01c0,
+	0x6028, 0xa084, 0xfbff, 0x602a, 0x6027, 0x0400, 0x2069, 0xb7c5,
+	0x7000, 0x206a, 0x708f, 0x0026, 0x7003, 0x0001, 0x20a9, 0x0002,
+	0x1d04, 0x5c08, 0x2091, 0x6000, 0x1f04, 0x5c08, 0x0804, 0x5c56,
+	0x2069, 0x0140, 0x20a9, 0x0384, 0x6027, 0x1e00, 0x2009, 0x1e00,
+	0xe000, 0x6024, 0xa10c, 0x0520, 0xa084, 0x1a00, 0x1508, 0x1d04,
+	0x5c14, 0x2091, 0x6000, 0x1f04, 0x5c14, 0x2011, 0x0003, 0x080c,
+	0x8075, 0x2011, 0x0002, 0x080c, 0x807f, 0x080c, 0x7f59, 0x2019,
+	0x0000, 0x080c, 0x7fe4, 0x6803, 0x00a0, 0x2001, 0xb79f, 0x2003,
+	0x0001, 0x2001, 0xb500, 0x2003, 0x0001, 0xa085, 0x0001, 0x00b0,
+	0x080c, 0x24b0, 0x6803, 0x0080, 0x2069, 0x0140, 0x60e3, 0x0000,
+	0x70a4, 0xa005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001,
+	0xb78f, 0x2004, 0x080c, 0x2872, 0x60e2, 0xa006, 0x00ee, 0x00de,
+	0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016,
+	0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071,
+	0xb500, 0x6020, 0xa084, 0x00c0, 0x01e0, 0x2011, 0x0003, 0x080c,
+	0x8075, 0x2011, 0x0002, 0x080c, 0x807f, 0x080c, 0x7f59, 0x2019,
+	0x0000, 0x080c, 0x7fe4, 0x2069, 0x0140, 0x6803, 0x00a0, 0x2001,
+	0xb79f, 0x2003, 0x0001, 0x2001, 0xb500, 0x2003, 0x0001, 0x0804,
+	0x5cfb, 0x2001, 0xb50c, 0x200c, 0xd1b4, 0x1160, 0xc1b5, 0x2102,
+	0x080c, 0x598a, 0x2069, 0x0140, 0x080c, 0x24b0, 0x6803, 0x0080,
+	0x60e3, 0x0000, 0x2069, 0x0200, 0x6804, 0xa005, 0x1118, 0x6808,
+	0xa005, 0x01c0, 0x6028, 0xa084, 0xfdff, 0x602a, 0x6027, 0x0200,
+	0x2069, 0xb7c5, 0x7000, 0x206a, 0x708f, 0x0027, 0x7003, 0x0001,
+	0x20a9, 0x0002, 0x1d04, 0x5cb2, 0x2091, 0x6000, 0x1f04, 0x5cb2,
+	0x0804, 0x5cfb, 0x6027, 0x1e00, 0x2009, 0x1e00, 0xe000, 0x6024,
+	0xa10c, 0x01c8, 0xa084, 0x1c00, 0x11b0, 0x1d04, 0x5cba, 0x0006,
+	0x0016, 0x00c6, 0x00d6, 0x00e6, 0x080c, 0x68f9, 0x00ee, 0x00de,
+	0x00ce, 0x001e, 0x000e, 0x00e6, 0x2071, 0xb7f3, 0x7018, 0x00ee,
+	0xa005, 0x1d00, 0x0500, 0x0026, 0x2011, 0x59a2, 0x080c, 0x699c,
+	0x2011, 0x5995, 0x080c, 0x6a5c, 0x002e, 0x2069, 0x0140, 0x60e3,
+	0x0000, 0x70a4, 0xa005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886,
+	0x2001, 0xb78f, 0x2004, 0x080c, 0x2872, 0x60e2, 0x2001, 0xb50c,
+	0x200c, 0xc1b4, 0x2102, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e,
+	0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x0046,
+	0x00c6, 0x00e6, 0x2061, 0x0100, 0x2071, 0xb500, 0x7130, 0xd184,
+	0x1180, 0x2011, 0xb553, 0x2214, 0xd2ec, 0x0138, 0xc18d, 0x7132,
+	0x2011, 0xb553, 0x2214, 0xd2ac, 0x1120, 0x7030, 0xd08c, 0x0904,
+	0x5d68, 0x7130, 0xc185, 0x7132, 0x2011, 0xb553, 0x220c, 0xd1a4,
+	0x0530, 0x0016, 0x2019, 0x000e, 0x080c, 0xb065, 0x0156, 0x20a9,
+	0x007f, 0x2009, 0x0000, 0xa186, 0x007e, 0x01a0, 0xa186, 0x0080,
+	0x0188, 0x080c, 0x4fa9, 0x1170, 0x8127, 0xa006, 0x0016, 0x2009,
+	0x000e, 0x080c, 0xb0e8, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c,
+	0x6b1a, 0x001e, 0x8108, 0x1f04, 0x5d33, 0x015e, 0x001e, 0xd1ac,
+	0x1148, 0x0016, 0x2009, 0x0000, 0x2019, 0x0004, 0x080c, 0x2c6f,
+	0x001e, 0x0070, 0x0156, 0x20a9, 0x007f, 0x2009, 0x0000, 0x080c,
+	0x4fa9, 0x1110, 0x080c, 0x4c0b, 0x8108, 0x1f04, 0x5d5f, 0x015e,
+	0x080c, 0x1e47, 0x2011, 0x0003, 0x080c, 0x8075, 0x2011, 0x0002,
+	0x080c, 0x807f, 0x080c, 0x7f59, 0x0036, 0x2019, 0x0000, 0x080c,
+	0x7fe4, 0x003e, 0x60e3, 0x0000, 0x2001, 0xb500, 0x2003, 0x0001,
+	0x080c, 0x5a07, 0x00ee, 0x00ce, 0x004e, 0x003e, 0x002e, 0x001e,
+	0x015e, 0x0005, 0x2071, 0xb5e2, 0x7003, 0x0000, 0x7007, 0x0000,
+	0x700f, 0x0000, 0x702b, 0x0001, 0x704f, 0x0000, 0x7053, 0x0001,
+	0x705f, 0x0020, 0x7063, 0x0040, 0x7083, 0x0000, 0x708b, 0x0000,
+	0x708f, 0x0001, 0x70bf, 0x0000, 0x0005, 0x00e6, 0x2071, 0xb5e2,
+	0x6848, 0xa005, 0x1130, 0x7028, 0xc085, 0x702a, 0xa085, 0x0001,
+	0x0428, 0x6a50, 0x7236, 0x6b54, 0x733a, 0x6858, 0x703e, 0x707a,
+	0x685c, 0x7042, 0x707e, 0x6848, 0x702e, 0x6840, 0x7032, 0x2009,
+	0x000c, 0x200a, 0x8007, 0x8006, 0x8006, 0xa08c, 0x003f, 0xa084,
+	0xffc0, 0xa210, 0x2100, 0xa319, 0x7272, 0x7376, 0x7028, 0xc084,
+	0x702a, 0x7007, 0x0001, 0x700f, 0x0000, 0xa006, 0x00ee, 0x0005,
+	0x2b78, 0x2071, 0xb5e2, 0x7004, 0x0043, 0x700c, 0x0002, 0x5de4,
+	0x5ddb, 0x5ddb, 0x5ddb, 0x5ddb, 0x0005, 0x5e3a, 0x5e3b, 0x5e6d,
+	0x5e6e, 0x5e38, 0x5ebc, 0x5ec1, 0x5ef2, 0x5ef3, 0x5f0e, 0x5f0f,
+	0x5f10, 0x5f11, 0x5f12, 0x5f13, 0x5fc9, 0x5ff0, 0x700c, 0x0002,
+	0x5dfd, 0x5e38, 0x5e38, 0x5e39, 0x5e39, 0x7830, 0x7930, 0xa106,
+	0x0120, 0x7830, 0x7930, 0xa106, 0x1510, 0x7030, 0xa10a, 0x01f8,
+	0x1210, 0x712c, 0xa10a, 0xa18a, 0x0002, 0x12d0, 0x080c, 0x15df,
+	0x01b0, 0x2d00, 0x705a, 0x7063, 0x0040, 0x2001, 0x0003, 0x7057,
+	0x0000, 0x0126, 0x0006, 0x2091, 0x8000, 0x2009, 0xb812, 0x2104,
+	0xc085, 0x200a, 0x000e, 0x700e, 0x012e, 0x080c, 0x165f, 0x0005,
+	0x080c, 0x15df, 0x0de0, 0x2d00, 0x705a, 0x080c, 0x15df, 0x1108,
+	0x0c10, 0x2d00, 0x7086, 0x7063, 0x0080, 0x2001, 0x0004, 0x08f8,
+	0x0005, 0x0005, 0x0005, 0x700c, 0x0002, 0x5e42, 0x5e45, 0x5e53,
+	0x5e6c, 0x5e6c, 0x080c, 0x5df6, 0x0005, 0x0126, 0x8001, 0x700e,
+	0x7058, 0x0006, 0x080c, 0x6343, 0x0120, 0x2091, 0x8000, 0x080c,
+	0x5df6, 0x00de, 0x0048, 0x0126, 0x8001, 0x700e, 0x080c, 0x6343,
+	0x7058, 0x2068, 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000,
+	0x6834, 0xa084, 0x00ff, 0xa08a, 0x003a, 0x1218, 0x00db, 0x012e,
+	0x0005, 0x012e, 0x080c, 0x5f14, 0x0005, 0x0005, 0x0005, 0x00e6,
+	0x2071, 0xb5e2, 0x700c, 0x0002, 0x5e79, 0x5e79, 0x5e79, 0x5e7b,
+	0x5e7e, 0x00ee, 0x0005, 0x700f, 0x0001, 0x0010, 0x700f, 0x0002,
+	0x00ee, 0x0005, 0x5f14, 0x5f14, 0x5f30, 0x5f14, 0x60ad, 0x5f14,
+	0x5f14, 0x5f14, 0x5f14, 0x5f14, 0x5f30, 0x60ef, 0x6132, 0x617b,
+	0x618f, 0x5f14, 0x5f14, 0x5f4c, 0x5f30, 0x5f14, 0x5f14, 0x5fa6,
+	0x623b, 0x6256, 0x5f14, 0x5f4c, 0x5f14, 0x5f14, 0x5f14, 0x5f14,
+	0x5f9c, 0x6256, 0x5f14, 0x5f14, 0x5f14, 0x5f14, 0x5f14, 0x5f14,
+	0x5f14, 0x5f14, 0x5f14, 0x5f60, 0x5f14, 0x5f14, 0x5f14, 0x5f14,
+	0x5f14, 0x5f14, 0x5f14, 0x5f14, 0x5f14, 0x6361, 0x5f14, 0x5f14,
+	0x5f14, 0x5f14, 0x5f14, 0x5f75, 0x7020, 0x2068, 0x080c, 0x160f,
+	0x0005, 0x700c, 0x0002, 0x5ec8, 0x5ecb, 0x5ed9, 0x5ef1, 0x5ef1,
+	0x080c, 0x5df6, 0x0005, 0x0126, 0x8001, 0x700e, 0x7058, 0x0006,
+	0x080c, 0x6343, 0x0120, 0x2091, 0x8000, 0x080c, 0x5df6, 0x00de,
+	0x0048, 0x0126, 0x8001, 0x700e, 0x080c, 0x6343, 0x7058, 0x2068,
+	0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000, 0x6834, 0xa084,
+	0x00ff, 0xa08a, 0x001a, 0x1218, 0x003b, 0x012e, 0x0005, 0x012e,
+	0x0419, 0x0005, 0x0005, 0x0005, 0x5f14, 0x5f30, 0x6099, 0x5f14,
+	0x5f30, 0x5f14, 0x5f30, 0x5f30, 0x5f14, 0x5f30, 0x6099, 0x5f30,
+	0x5f30, 0x5f30, 0x5f30, 0x5f30, 0x5f14, 0x5f30, 0x6099, 0x5f14,
+	0x5f14, 0x5f30, 0x5f14, 0x5f14, 0x5f14, 0x5f30, 0x0005, 0x0005,
+	0x0005, 0x0005, 0x0005, 0x0005, 0x7007, 0x0001, 0x6838, 0xa084,
+	0x00ff, 0xc0d5, 0x683a, 0x0126, 0x2091, 0x8000, 0x080c, 0x5408,
+	0x012e, 0x0005, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0e5,
+	0x683a, 0x0126, 0x2091, 0x8000, 0x080c, 0x5408, 0x012e, 0x0005,
+	0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0ed, 0x683a, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x5408, 0x012e, 0x0005, 0x7007, 0x0001,
+	0x6838, 0xa084, 0x00ff, 0xc0dd, 0x683a, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x5408, 0x012e, 0x0005, 0x6834, 0x8007, 0xa084, 0x00ff,
+	0x0988, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x6059, 0x7007,
+	0x0006, 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b, 0x6059, 0x0005,
+	0x6834, 0x8007, 0xa084, 0x00ff, 0x0904, 0x5f22, 0x8001, 0x1120,
+	0x7007, 0x0001, 0x0804, 0x6076, 0x7007, 0x0006, 0x7012, 0x2d00,
+	0x7016, 0x701a, 0x704b, 0x6076, 0x0005, 0x6834, 0x8007, 0xa084,
+	0x00ff, 0xa086, 0x0001, 0x1904, 0x5f22, 0x7007, 0x0001, 0x2009,
+	0xb531, 0x210c, 0x81ff, 0x11a8, 0x6838, 0xa084, 0x00ff, 0x683a,
+	0x6853, 0x0000, 0x080c, 0x4d82, 0x1108, 0x0005, 0x0126, 0x2091,
+	0x8000, 0x6837, 0x0139, 0x684a, 0x6952, 0x080c, 0x5408, 0x012e,
+	0x0ca0, 0x2001, 0x0028, 0x0c90, 0x684c, 0xa084, 0x00c0, 0xa086,
+	0x00c0, 0x1120, 0x7007, 0x0001, 0x0804, 0x626e, 0x2d00, 0x7016,
+	0x701a, 0x20a9, 0x0004, 0xa080, 0x0024, 0x2098, 0x20a1, 0xb60d,
+	0x53a3, 0x6858, 0x7012, 0xa082, 0x0401, 0x1a04, 0x5f3e, 0x6a84,
+	0xa28a, 0x0002, 0x1a04, 0x5f3e, 0x82ff, 0x1138, 0x6888, 0x698c,
+	0xa105, 0x0118, 0x2001, 0x602c, 0x0018, 0xa280, 0x6022, 0x2005,
+	0x70c6, 0x7010, 0xa015, 0x0904, 0x600e, 0x080c, 0x15df, 0x1118,
+	0x7007, 0x000f, 0x0005, 0x2d00, 0x7022, 0x70c4, 0x2060, 0x2c05,
+	0x6836, 0xe004, 0xad00, 0x7096, 0xe008, 0xa20a, 0x1210, 0xa00e,
+	0x2200, 0x7112, 0xe20c, 0x8003, 0x800b, 0xa296, 0x0004, 0x0108,
+	0xa108, 0x719a, 0x810b, 0x719e, 0xae90, 0x0022, 0x080c, 0x1643,
+	0x7090, 0xa08e, 0x0100, 0x0170, 0xa086, 0x0200, 0x0118, 0x7007,
+	0x0010, 0x0005, 0x7020, 0x2068, 0x080c, 0x160f, 0x7014, 0x2068,
+	0x0804, 0x5f3e, 0x7020, 0x2068, 0x7018, 0x6802, 0x6807, 0x0000,
+	0x2d08, 0x2068, 0x6906, 0x711a, 0x0804, 0x5fc9, 0x7014, 0x2068,
+	0x7007, 0x0001, 0x6884, 0xa005, 0x1128, 0x6888, 0x698c, 0xa105,
+	0x0108, 0x00b1, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, 0x0904,
+	0x626e, 0x04b8, 0x6024, 0x6028, 0x0002, 0x0011, 0x0007, 0x0004,
+	0x000a, 0x000f, 0x0005, 0x0006, 0x000a, 0x0011, 0x0005, 0x0004,
+	0x00f6, 0x00e6, 0x00c6, 0x0076, 0x0066, 0x6f88, 0x6e8c, 0x6804,
+	0x2060, 0xacf0, 0x0021, 0xacf8, 0x0027, 0x2009, 0x0005, 0x700c,
+	0x7816, 0x7008, 0x7812, 0x7004, 0x7806, 0x7000, 0x7802, 0x7e0e,
+	0x7f0a, 0x8109, 0x0128, 0xaef2, 0x0004, 0xaffa, 0x0006, 0x0c78,
+	0x6004, 0xa065, 0x1d30, 0x006e, 0x007e, 0x00ce, 0x00ee, 0x00fe,
+	0x0005, 0x2009, 0xb531, 0x210c, 0x81ff, 0x1198, 0x6838, 0xa084,
+	0x00ff, 0x683a, 0x080c, 0x4c64, 0x1108, 0x0005, 0x080c, 0x54db,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x9ecc, 0x080c, 0x5408, 0x012e,
+	0x0ca0, 0x2001, 0x0028, 0x2009, 0x0000, 0x0c80, 0x2009, 0xb531,
+	0x210c, 0x81ff, 0x11b0, 0x6858, 0xa005, 0x01c0, 0x6838, 0xa084,
+	0x00ff, 0x683a, 0x6853, 0x0000, 0x080c, 0x4d26, 0x1108, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x684a, 0x6952, 0x080c, 0x5408, 0x012e,
+	0x0cb0, 0x2001, 0x0028, 0x2009, 0x0000, 0x0c90, 0x2001, 0x0000,
+	0x0c78, 0x7018, 0x6802, 0x2d08, 0x2068, 0x6906, 0x711a, 0x7010,
+	0x8001, 0x7012, 0x0118, 0x7007, 0x0006, 0x0030, 0x7014, 0x2068,
+	0x7007, 0x0001, 0x7048, 0x080f, 0x0005, 0x7007, 0x0001, 0x6944,
+	0x810f, 0xa18c, 0x00ff, 0x6848, 0xa084, 0x00ff, 0x20a9, 0x0001,
+	0xa096, 0x0001, 0x01b0, 0x2009, 0x0000, 0x20a9, 0x00ff, 0xa096,
+	0x0002, 0x0178, 0xa005, 0x11f0, 0x6944, 0x810f, 0xa18c, 0x00ff,
+	0x080c, 0x4fa9, 0x11b8, 0x0066, 0x6e50, 0x080c, 0x50a8, 0x006e,
+	0x0088, 0x0046, 0x2011, 0xb50c, 0x2224, 0xc484, 0x2412, 0x004e,
+	0x00c6, 0x080c, 0x4fa9, 0x1110, 0x080c, 0x5209, 0x8108, 0x1f04,
+	0x60d9, 0x00ce, 0x684c, 0xd084, 0x1118, 0x080c, 0x160f, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x5408, 0x012e, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0xb553, 0x2004, 0xd0a4,
+	0x0580, 0x2061, 0xb874, 0x6100, 0xd184, 0x0178, 0x6858, 0xa084,
+	0x00ff, 0x1550, 0x6000, 0xd084, 0x0520, 0x6004, 0xa005, 0x1538,
+	0x6003, 0x0000, 0x600b, 0x0000, 0x00c8, 0x2011, 0x0001, 0x6860,
+	0xa005, 0x1110, 0x2001, 0x001e, 0x8000, 0x6016, 0x6858, 0xa084,
+	0x00ff, 0x0178, 0x6006, 0x6858, 0x8007, 0xa084, 0x00ff, 0x0148,
+	0x600a, 0x6858, 0x8000, 0x1108, 0xc28d, 0x6202, 0x012e, 0x0804,
+	0x6332, 0x012e, 0x0804, 0x632c, 0x012e, 0x0804, 0x6326, 0x012e,
+	0x0804, 0x6329, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x2001,
+	0xb553, 0x2004, 0xd0a4, 0x05e0, 0x2061, 0xb874, 0x6000, 0xd084,
+	0x05b8, 0x6204, 0x6308, 0xd08c, 0x1530, 0x6c48, 0xa484, 0x0003,
+	0x0170, 0x6958, 0xa18c, 0x00ff, 0x8001, 0x1120, 0x2100, 0xa210,
+	0x0620, 0x0028, 0x8001, 0x1508, 0x2100, 0xa212, 0x02f0, 0xa484,
+	0x000c, 0x0188, 0x6958, 0x810f, 0xa18c, 0x00ff, 0xa082, 0x0004,
+	0x1120, 0x2100, 0xa318, 0x0288, 0x0030, 0xa082, 0x0004, 0x1168,
+	0x2100, 0xa31a, 0x0250, 0x6860, 0xa005, 0x0110, 0x8000, 0x6016,
+	0x6206, 0x630a, 0x012e, 0x0804, 0x6332, 0x012e, 0x0804, 0x632f,
+	0x012e, 0x0804, 0x632c, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001,
+	0x2061, 0xb874, 0x6300, 0xd38c, 0x1120, 0x6308, 0x8318, 0x0220,
+	0x630a, 0x012e, 0x0804, 0x6340, 0x012e, 0x0804, 0x632f, 0x0126,
+	0x00c6, 0x2091, 0x8000, 0x7007, 0x0001, 0x684c, 0xd0ac, 0x0148,
+	0x00c6, 0x2061, 0xb874, 0x6000, 0xa084, 0xfcff, 0x6002, 0x00ce,
+	0x0448, 0x6858, 0xa005, 0x05d0, 0x685c, 0xa065, 0x0598, 0x2001,
+	0xb531, 0x2004, 0xa005, 0x0118, 0x080c, 0x9e1d, 0x0068, 0x6013,
+	0x0400, 0x6057, 0x0000, 0x694c, 0xd1a4, 0x0110, 0x6950, 0x6156,
+	0x2009, 0x0041, 0x080c, 0x864c, 0x6958, 0xa18c, 0xff00, 0xa186,
+	0x2000, 0x1140, 0x0026, 0x2009, 0x0000, 0x2011, 0xfdff, 0x080c,
+	0x6b1a, 0x002e, 0x684c, 0xd0c4, 0x0148, 0x2061, 0xb874, 0x6000,
+	0xd08c, 0x1120, 0x6008, 0x8000, 0x0208, 0x600a, 0x00ce, 0x012e,
+	0x0804, 0x6332, 0x00ce, 0x012e, 0x0804, 0x632c, 0x6954, 0xa186,
+	0x002e, 0x0d40, 0xa186, 0x002d, 0x0d28, 0xa186, 0x0045, 0x0528,
+	0xa186, 0x002a, 0x1130, 0x2001, 0xb50c, 0x200c, 0xc194, 0x2102,
+	0x08c8, 0xa186, 0x0020, 0x0170, 0xa186, 0x0029, 0x1d18, 0x6944,
+	0xa18c, 0xff00, 0x810f, 0x080c, 0x4fa9, 0x1960, 0x6000, 0xc0e4,
+	0x6002, 0x0840, 0x685c, 0xa065, 0x09a8, 0x6007, 0x0024, 0x2001,
+	0xb7b6, 0x2004, 0x6016, 0x0804, 0x61ca, 0x685c, 0xa065, 0x0950,
+	0x00e6, 0x6860, 0xa075, 0x2001, 0xb531, 0x2004, 0xa005, 0x0150,
+	0x080c, 0x9e1d, 0x8eff, 0x0118, 0x2e60, 0x080c, 0x9e1d, 0x00ee,
+	0x0804, 0x61ca, 0x6020, 0xc0dc, 0xc0d5, 0x6022, 0x2e60, 0x6007,
+	0x003a, 0x6870, 0xa005, 0x0130, 0x6007, 0x003b, 0x6874, 0x602a,
+	0x6878, 0x6012, 0x6003, 0x0001, 0x080c, 0x6c8d, 0x080c, 0x7173,
+	0x00ee, 0x0804, 0x61ca, 0x2061, 0xb874, 0x6000, 0xd084, 0x0190,
+	0xd08c, 0x1904, 0x6340, 0x0126, 0x2091, 0x8000, 0x6204, 0x8210,
+	0x0220, 0x6206, 0x012e, 0x0804, 0x6340, 0x012e, 0x6853, 0x0016,
+	0x0804, 0x6339, 0x6853, 0x0007, 0x0804, 0x6339, 0x6834, 0x8007,
+	0xa084, 0x00ff, 0x1118, 0x080c, 0x5f22, 0x0078, 0x2030, 0x8001,
+	0x1120, 0x7007, 0x0001, 0x0051, 0x0040, 0x7007, 0x0006, 0x7012,
+	0x2d00, 0x7016, 0x701a, 0x704b, 0x626e, 0x0005, 0x00e6, 0x0126,
+	0x2091, 0x8000, 0xa03e, 0x2009, 0xb531, 0x210c, 0x81ff, 0x1904,
+	0x62ec, 0x2009, 0xb50c, 0x210c, 0xd194, 0x1904, 0x6316, 0x6848,
+	0x2070, 0xae82, 0xbd00, 0x0a04, 0x62e0, 0x2001, 0xb517, 0x2004,
+	0xae02, 0x1a04, 0x62e0, 0x711c, 0xa186, 0x0006, 0x1904, 0x62cf,
+	0x7018, 0xa005, 0x0904, 0x62ec, 0x2004, 0xd0e4, 0x1904, 0x6311,
+	0x2061, 0xb874, 0x6100, 0xa184, 0x0301, 0xa086, 0x0001, 0x1550,
+	0x7020, 0xd0dc, 0x1904, 0x6319, 0x6853, 0x0000, 0x6803, 0x0000,
+	0x2d08, 0x7010, 0xa005, 0x1158, 0x7112, 0x684c, 0xd0f4, 0x1904,
+	0x631c, 0x2e60, 0x080c, 0x6a76, 0x012e, 0x00ee, 0x0005, 0x2068,
+	0x6800, 0xa005, 0x1de0, 0x6902, 0x2168, 0x684c, 0xd0f4, 0x1904,
+	0x631c, 0x012e, 0x00ee, 0x0005, 0x012e, 0x00ee, 0x6853, 0x0006,
+	0x0804, 0x6339, 0xd184, 0x0dc0, 0xd1c4, 0x11a8, 0x00b8, 0x6944,
+	0xa18c, 0xff00, 0x810f, 0x080c, 0x4fa9, 0x15d8, 0x6000, 0xd0e4,
+	0x15c0, 0x711c, 0xa186, 0x0007, 0x1118, 0x6853, 0x0002, 0x0498,
+	0x6853, 0x0008, 0x0480, 0x6853, 0x000e, 0x0468, 0x6853, 0x0017,
+	0x0450, 0x6853, 0x0035, 0x0438, 0x2001, 0xb572, 0x2004, 0xd0fc,
+	0x01e8, 0x6848, 0x2070, 0xae82, 0xbd00, 0x02c0, 0x605c, 0xae02,
+	0x12a8, 0x711c, 0xa186, 0x0006, 0x1188, 0x7018, 0xa005, 0x0170,
+	0x2004, 0xd0bc, 0x0158, 0x2039, 0x0001, 0x7000, 0xa086, 0x0007,
+	0x1904, 0x6279, 0x7003, 0x0002, 0x0804, 0x6279, 0x6853, 0x0028,
+	0x0010, 0x6853, 0x0029, 0x012e, 0x00ee, 0x0418, 0x6853, 0x002a,
+	0x0cd0, 0x6853, 0x0045, 0x0cb8, 0x2e60, 0x2019, 0x0002, 0x6017,
+	0x0014, 0x080c, 0xace0, 0x012e, 0x00ee, 0x0005, 0x2009, 0x003e,
+	0x0058, 0x2009, 0x0004, 0x0040, 0x2009, 0x0006, 0x0028, 0x2009,
+	0x0016, 0x0010, 0x2009, 0x0001, 0x6854, 0xa084, 0xff00, 0xa105,
+	0x6856, 0x0126, 0x2091, 0x8000, 0x080c, 0x5408, 0x012e, 0x0005,
+	0x080c, 0x160f, 0x0005, 0x702c, 0x7130, 0x8108, 0xa102, 0x0230,
+	0xa00e, 0x7034, 0x7072, 0x7038, 0x7076, 0x0058, 0x7070, 0xa080,
+	0x0040, 0x7072, 0x1230, 0x7074, 0xa081, 0x0000, 0x7076, 0xa085,
+	0x0001, 0x7932, 0x7132, 0x0005, 0x00d6, 0x080c, 0x6a6d, 0x00de,
+	0x0005, 0x00d6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x7007, 0x0001,
+	0x6a44, 0xa282, 0x0004, 0x1a04, 0x63ac, 0xd284, 0x0170, 0x6a4c,
+	0xa290, 0xb635, 0x2204, 0xa065, 0x6004, 0x05e0, 0x8007, 0xa084,
+	0x00ff, 0xa084, 0x0006, 0x1108, 0x04a8, 0x2c10, 0x080c, 0x85c7,
+	0x1118, 0x080c, 0x9ed6, 0x05a0, 0x621a, 0x6844, 0x0002, 0x638b,
+	0x6390, 0x6393, 0x6399, 0x2019, 0x0002, 0x080c, 0xb065, 0x0060,
+	0x080c, 0xaffc, 0x0048, 0x2019, 0x0002, 0x6950, 0x080c, 0xb017,
+	0x0018, 0x6950, 0x080c, 0xaffc, 0x080c, 0x861d, 0x6857, 0x0000,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x5408, 0x012e, 0x001e, 0x002e,
+	0x003e, 0x00ce, 0x00de, 0x0005, 0x6857, 0x0006, 0x0c88, 0x6857,
+	0x0002, 0x0c70, 0x6857, 0x0005, 0x0c58, 0x6857, 0x0004, 0x0c40,
+	0x6857, 0x0007, 0x0c28, 0x00d6, 0x2011, 0x0004, 0x2204, 0xa085,
+	0x8002, 0x2012, 0x00de, 0x0005, 0x20e1, 0x0002, 0x3d08, 0x20e1,
+	0x2000, 0x3d00, 0xa084, 0x7000, 0x0118, 0xa086, 0x1000, 0x1570,
+	0x20e1, 0x0000, 0x3d00, 0xa094, 0xff00, 0x8217, 0xa084, 0xf000,
+	0xa086, 0x3000, 0x1160, 0xa184, 0xff00, 0x8007, 0xa086, 0x0008,
+	0x11e8, 0x080c, 0x2dbf, 0x11d0, 0x080c, 0x6603, 0x0098, 0x20e1,
+	0x0004, 0x3d60, 0xd1bc, 0x1108, 0x3e60, 0xac84, 0x0007, 0x1170,
+	0xac82, 0xbd00, 0x0258, 0x685c, 0xac02, 0x1240, 0x2009, 0x0047,
+	0x080c, 0x864c, 0x7a1c, 0xd284, 0x1938, 0x0005, 0xa016, 0x080c,
+	0x185e, 0x0cc0, 0x0cd8, 0x781c, 0xd08c, 0x0500, 0x0156, 0x0136,
+	0x0146, 0x20e1, 0x3000, 0x3d20, 0x3e28, 0xa584, 0x0076, 0x1538,
+	0xa484, 0x7000, 0xa086, 0x1000, 0x11a8, 0x080c, 0x647e, 0x01f8,
+	0x20e1, 0x3000, 0x7828, 0x7828, 0x080c, 0x649a, 0x014e, 0x013e,
+	0x015e, 0x2009, 0xb7e8, 0x2104, 0xa005, 0x1108, 0x0005, 0x080c,
+	0x7173, 0x0ce0, 0xa484, 0x7000, 0x1548, 0x080c, 0x647e, 0x01d8,
+	0x7000, 0xa084, 0xff00, 0xa086, 0x8100, 0x0d10, 0x00a0, 0xd5a4,
+	0x0178, 0x0056, 0x0046, 0x080c, 0x1e6e, 0x080c, 0x24b0, 0x2001,
+	0x0160, 0x2502, 0x2001, 0x0138, 0x2202, 0x004e, 0x005e, 0x0048,
+	0x04a9, 0x6887, 0x0000, 0x080c, 0xb3df, 0x20e1, 0x3000, 0x7828,
+	0x7828, 0x00b9, 0x014e, 0x013e, 0x015e, 0x0880, 0x0439, 0x1130,
+	0x7000, 0xa084, 0xff00, 0xa086, 0x8100, 0x1d68, 0x080c, 0xb3df,
+	0x20e1, 0x3000, 0x7828, 0x7828, 0x0056, 0x080c, 0x6874, 0x005e,
+	0x0c40, 0x2001, 0xb50e, 0x2004, 0xd08c, 0x0178, 0x2001, 0xb500,
+	0x2004, 0xa086, 0x0003, 0x1148, 0x0026, 0x0036, 0x2011, 0x8048,
+	0x2518, 0x080c, 0x3ecc, 0x003e, 0x002e, 0x0005, 0xa484, 0x01ff,
+	0x6886, 0xa005, 0x0160, 0xa080, 0x001f, 0xa084, 0x03f8, 0x80ac,
+	0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5, 0x0005, 0x20a9,
+	0x000c, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5, 0xa085,
+	0x0001, 0x0ca0, 0x7000, 0xa084, 0xff00, 0xa08c, 0xf000, 0x8007,
+	0xa196, 0x0000, 0x1118, 0x0804, 0x6708, 0x0005, 0xa196, 0x2000,
+	0x1148, 0x6900, 0xa18e, 0x0001, 0x1118, 0x080c, 0x448f, 0x0ca8,
+	0x0039, 0x0c98, 0xa196, 0x8000, 0x1d80, 0x080c, 0x67b4, 0x0c68,
+	0x00c6, 0x6a84, 0x82ff, 0x0904, 0x65fd, 0x7110, 0xa18c, 0xff00,
+	0x810f, 0xa196, 0x0001, 0x0120, 0xa196, 0x0023, 0x1904, 0x65fd,
+	0xa08e, 0x0023, 0x1570, 0x080c, 0x684f, 0x0904, 0x65fd, 0x7124,
+	0x610a, 0x7030, 0xa08e, 0x0200, 0x1150, 0x7034, 0xa005, 0x1904,
+	0x65fd, 0x2009, 0x0015, 0x080c, 0x864c, 0x0804, 0x65fd, 0xa08e,
+	0x0214, 0x0118, 0xa08e, 0x0210, 0x1130, 0x2009, 0x0015, 0x080c,
+	0x864c, 0x0804, 0x65fd, 0xa08e, 0x0100, 0x1904, 0x65fd, 0x7034,
+	0xa005, 0x1904, 0x65fd, 0x2009, 0x0016, 0x080c, 0x864c, 0x0804,
+	0x65fd, 0xa08e, 0x0022, 0x1904, 0x65fd, 0x7030, 0xa08e, 0x0300,
+	0x1580, 0x68d4, 0xd0a4, 0x0528, 0xc0b5, 0x68d6, 0x7100, 0xa18c,
+	0x00ff, 0x6972, 0x7004, 0x6876, 0x00f6, 0x2079, 0x0100, 0x79e6,
+	0x78ea, 0x0006, 0xa084, 0x00ff, 0x0016, 0x2008, 0x080c, 0x2847,
+	0x7932, 0x7936, 0x001e, 0x000e, 0x00fe, 0x080c, 0x281d, 0x6952,
+	0x703c, 0x00e6, 0x2071, 0x0140, 0x7086, 0x2071, 0xb500, 0x70a6,
+	0x00ee, 0x7034, 0xa005, 0x1904, 0x65fd, 0x2009, 0x0017, 0x0804,
+	0x65c3, 0xa08e, 0x0400, 0x1158, 0x7034, 0xa005, 0x1904, 0x65fd,
+	0x68d4, 0xc0a5, 0x68d6, 0x2009, 0x0030, 0x0804, 0x65c3, 0xa08e,
+	0x0500, 0x1140, 0x7034, 0xa005, 0x1904, 0x65fd, 0x2009, 0x0018,
+	0x0804, 0x65c3, 0xa08e, 0x2010, 0x1120, 0x2009, 0x0019, 0x0804,
+	0x65c3, 0xa08e, 0x2110, 0x1120, 0x2009, 0x001a, 0x0804, 0x65c3,
+	0xa08e, 0x5200, 0x1140, 0x7034, 0xa005, 0x1904, 0x65fd, 0x2009,
+	0x001b, 0x0804, 0x65c3, 0xa08e, 0x5000, 0x1140, 0x7034, 0xa005,
+	0x1904, 0x65fd, 0x2009, 0x001c, 0x0804, 0x65c3, 0xa08e, 0x1300,
+	0x1120, 0x2009, 0x0034, 0x0804, 0x65c3, 0xa08e, 0x1200, 0x1140,
+	0x7034, 0xa005, 0x1904, 0x65fd, 0x2009, 0x0024, 0x0804, 0x65c3,
+	0xa08c, 0xff00, 0xa18e, 0x2400, 0x1118, 0x2009, 0x002d, 0x04d8,
+	0xa08c, 0xff00, 0xa18e, 0x5300, 0x1118, 0x2009, 0x002a, 0x0498,
+	0xa08e, 0x0f00, 0x1118, 0x2009, 0x0020, 0x0468, 0xa08e, 0x5300,
+	0x1108, 0x00d8, 0xa08e, 0x6104, 0x11c0, 0x2011, 0xbb8d, 0x8208,
+	0x2204, 0xa082, 0x0004, 0x20a8, 0x95ac, 0x95ac, 0x2011, 0x8015,
+	0x211c, 0x8108, 0x0046, 0x2124, 0x080c, 0x3ecc, 0x004e, 0x8108,
+	0x1f04, 0x65a6, 0x2009, 0x0023, 0x0070, 0xa08e, 0x6000, 0x1118,
+	0x2009, 0x003f, 0x0040, 0xa08e, 0x7800, 0x1118, 0x2009, 0x0045,
+	0x0010, 0x2009, 0x001d, 0x0016, 0x2011, 0xbb83, 0x2204, 0x8211,
+	0x220c, 0x080c, 0x281d, 0x1598, 0x080c, 0x4f4d, 0x1580, 0x6612,
+	0x6516, 0x86ff, 0x01e8, 0x001e, 0x0016, 0xa186, 0x0017, 0x1158,
+	0x6870, 0xa606, 0x11a8, 0x6874, 0xa506, 0xa084, 0xff00, 0x1180,
+	0x6000, 0xc0f5, 0x6002, 0xa186, 0x0046, 0x1150, 0x6870, 0xa606,
+	0x1138, 0x6874, 0xa506, 0xa084, 0xff00, 0x1110, 0x001e, 0x0068,
+	0x00c6, 0x080c, 0x85c7, 0x0168, 0x001e, 0x611a, 0x601f, 0x0004,
+	0x7120, 0x610a, 0x001e, 0x080c, 0x864c, 0x00ce, 0x0005, 0x001e,
+	0x0ce0, 0x00ce, 0x0ce0, 0x00c6, 0x0046, 0x080c, 0x6657, 0x1904,
+	0x6654, 0xa28e, 0x0033, 0x11e8, 0x080c, 0x684f, 0x0904, 0x6654,
+	0x7124, 0x610a, 0x7030, 0xa08e, 0x0200, 0x1140, 0x7034, 0xa005,
+	0x15d8, 0x2009, 0x0015, 0x080c, 0x864c, 0x04b0, 0xa08e, 0x0100,
+	0x1598, 0x7034, 0xa005, 0x1580, 0x2009, 0x0016, 0x080c, 0x864c,
+	0x0458, 0xa28e, 0x0032, 0x1540, 0x7030, 0xa08e, 0x1400, 0x1520,
+	0x2009, 0x0038, 0x0016, 0x2011, 0xbb83, 0x2204, 0x8211, 0x220c,
+	0x080c, 0x281d, 0x11c0, 0x080c, 0x4f4d, 0x11a8, 0x6612, 0x6516,
+	0x00c6, 0x080c, 0x85c7, 0x0170, 0x001e, 0x611a, 0x080c, 0xa027,
+	0x601f, 0x0004, 0x7120, 0x610a, 0x001e, 0x080c, 0x864c, 0x080c,
+	0x7173, 0x0010, 0x00ce, 0x001e, 0x004e, 0x00ce, 0x0005, 0x00f6,
+	0x00d6, 0x0026, 0x0016, 0x0136, 0x0146, 0x0156, 0x3c00, 0x0006,
+	0x2079, 0x0030, 0x2069, 0x0200, 0x080c, 0x1f2d, 0x1590, 0x080c,
+	0x1dd2, 0x05e0, 0x04f1, 0x1130, 0x7908, 0xa18c, 0x1fff, 0xa182,
+	0x0011, 0x1688, 0x20a9, 0x000c, 0x20e1, 0x0000, 0x2ea0, 0x2099,
+	0x020a, 0x53a5, 0x20e1, 0x2000, 0x2001, 0x020a, 0x2004, 0x7a0c,
+	0x7808, 0xa080, 0x0007, 0xa084, 0x1ff8, 0x0419, 0x1120, 0xa08a,
+	0x0140, 0x1a0c, 0x1515, 0x80ac, 0x20e1, 0x6000, 0x2099, 0x020a,
+	0x53a5, 0x20e1, 0x7000, 0x6828, 0x6828, 0x7803, 0x0004, 0xa294,
+	0x0070, 0x000e, 0x20e0, 0x015e, 0x014e, 0x013e, 0x001e, 0x002e,
+	0x00de, 0x00fe, 0x0005, 0xa016, 0x080c, 0x185e, 0xa085, 0x0001,
+	0x0c80, 0x0006, 0x2001, 0x0111, 0x2004, 0xa084, 0x0003, 0x000e,
+	0x0005, 0x0046, 0x00e6, 0x00d6, 0x2028, 0x2130, 0xa696, 0x00ff,
+	0x1198, 0xa596, 0xfffd, 0x1120, 0x2009, 0x007f, 0x0804, 0x6703,
+	0xa596, 0xfffe, 0x1118, 0x2009, 0x007e, 0x04e8, 0xa596, 0xfffc,
+	0x1118, 0x2009, 0x0080, 0x04b8, 0x2011, 0x0000, 0x2019, 0xb535,
+	0x231c, 0xd3ac, 0x0138, 0x2021, 0x0000, 0x20a9, 0x00ff, 0x2071,
+	0xb635, 0x0030, 0x2021, 0x0081, 0x20a9, 0x007e, 0x2071, 0xb6b6,
+	0x2e1c, 0x83ff, 0x1128, 0x82ff, 0x1198, 0x2410, 0xc2fd, 0x0080,
+	0x2368, 0x6f10, 0x0006, 0x2100, 0xa706, 0x000e, 0x6b14, 0x1120,
+	0xa346, 0x1110, 0x2408, 0x0078, 0x87ff, 0x1110, 0x83ff, 0x0d58,
+	0x8420, 0x8e70, 0x1f04, 0x66e0, 0x82ff, 0x1118, 0xa085, 0x0001,
+	0x0018, 0xc2fc, 0x2208, 0xa006, 0x00de, 0x00ee, 0x004e, 0x0005,
+	0xa084, 0x0007, 0x000a, 0x0005, 0x6714, 0x6714, 0x6714, 0x6861,
+	0x6714, 0x6715, 0x672a, 0x679f, 0x0005, 0x7110, 0xd1bc, 0x0188,
+	0x7120, 0x2160, 0xac8c, 0x0007, 0x1160, 0xac8a, 0xbd00, 0x0248,
+	0x685c, 0xac02, 0x1230, 0x7124, 0x610a, 0x2009, 0x0046, 0x080c,
+	0x864c, 0x0005, 0x00c6, 0xa484, 0x01ff, 0x0904, 0x677d, 0x7110,
+	0xd1bc, 0x1904, 0x677d, 0x2011, 0xbb83, 0x2204, 0x8211, 0x220c,
+	0x080c, 0x281d, 0x1904, 0x677d, 0x080c, 0x4f4d, 0x15f0, 0x6612,
+	0x6516, 0x6000, 0xd0ec, 0x15c8, 0x6204, 0xa294, 0xff00, 0x8217,
+	0xa286, 0x0006, 0x0148, 0x6204, 0xa294, 0x00ff, 0xa286, 0x0006,
+	0x11a0, 0xa295, 0x0600, 0x6206, 0x00c6, 0x080c, 0x85c7, 0x001e,
+	0x0530, 0x611a, 0x601f, 0x0006, 0x7120, 0x610a, 0x7130, 0x6152,
+	0x2009, 0x0044, 0x080c, 0x864c, 0x00c0, 0x00c6, 0x080c, 0x85c7,
+	0x001e, 0x0198, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0xa286,
+	0x0004, 0x1118, 0x6007, 0x0005, 0x0010, 0x6007, 0x0001, 0x6003,
+	0x0001, 0x080c, 0x6cd3, 0x080c, 0x7173, 0x00ce, 0x0005, 0x2001,
+	0xb50d, 0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x3ecc,
+	0x00c6, 0x080c, 0x9ed6, 0x001e, 0x0d80, 0x611a, 0x601f, 0x0006,
+	0x7120, 0x610a, 0x7130, 0x6152, 0x6013, 0x0300, 0x6003, 0x0001,
+	0x6007, 0x0041, 0x080c, 0x6c8d, 0x080c, 0x7173, 0x08f0, 0x7110,
+	0xd1bc, 0x0188, 0x7020, 0x2060, 0xac84, 0x0007, 0x1160, 0xac82,
+	0xbd00, 0x0248, 0x685c, 0xac02, 0x1230, 0x7124, 0x610a, 0x2009,
+	0x0045, 0x080c, 0x864c, 0x0005, 0x0006, 0x080c, 0x2dbf, 0x000e,
+	0x1168, 0x7110, 0xa18c, 0xff00, 0x810f, 0xa18e, 0x0000, 0x1130,
+	0xa084, 0x000f, 0xa08a, 0x0006, 0x1208, 0x000b, 0x0005, 0x67cd,
+	0x67ce, 0x67cd, 0x67cd, 0x6837, 0x6843, 0x0005, 0x7110, 0xd1bc,
+	0x0120, 0x702c, 0xd084, 0x0904, 0x6836, 0x700c, 0x7108, 0x080c,
+	0x281d, 0x1904, 0x6836, 0x080c, 0x4f4d, 0x1904, 0x6836, 0x6612,
+	0x6516, 0x6204, 0x7110, 0xd1bc, 0x01f8, 0xa28c, 0x00ff, 0xa186,
+	0x0004, 0x0118, 0xa186, 0x0006, 0x15c8, 0x00c6, 0x080c, 0x684f,
+	0x00ce, 0x0904, 0x6836, 0x00c6, 0x080c, 0x85c7, 0x001e, 0x05f0,
+	0x611a, 0x080c, 0xa027, 0x601f, 0x0002, 0x7120, 0x610a, 0x2009,
+	0x0088, 0x080c, 0x864c, 0x0490, 0xa28c, 0x00ff, 0xa186, 0x0006,
+	0x0160, 0xa186, 0x0004, 0x0148, 0xa294, 0xff00, 0x8217, 0xa286,
+	0x0004, 0x0118, 0xa286, 0x0006, 0x1188, 0x00c6, 0x080c, 0x85c7,
+	0x001e, 0x01e0, 0x611a, 0x080c, 0xa027, 0x601f, 0x0005, 0x7120,
+	0x610a, 0x2009, 0x0088, 0x080c, 0x864c, 0x0080, 0x00c6, 0x080c,
+	0x85c7, 0x001e, 0x0158, 0x611a, 0x080c, 0xa027, 0x601f, 0x0004,
+	0x7120, 0x610a, 0x2009, 0x0001, 0x080c, 0x864c, 0x0005, 0x7110,
+	0xd1bc, 0x0140, 0x00a1, 0x0130, 0x7124, 0x610a, 0x2009, 0x0089,
+	0x080c, 0x864c, 0x0005, 0x7110, 0xd1bc, 0x0140, 0x0041, 0x0130,
+	0x7124, 0x610a, 0x2009, 0x008a, 0x080c, 0x864c, 0x0005, 0x7020,
+	0x2060, 0xac84, 0x0007, 0x1158, 0xac82, 0xbd00, 0x0240, 0x2001,
+	0xb517, 0x2004, 0xac02, 0x1218, 0xa085, 0x0001, 0x0005, 0xa006,
+	0x0ce8, 0x7110, 0xd1bc, 0x1178, 0x7024, 0x2060, 0xac84, 0x0007,
+	0x1150, 0xac82, 0xbd00, 0x0238, 0x685c, 0xac02, 0x1220, 0x2009,
+	0x0051, 0x080c, 0x864c, 0x0005, 0x2031, 0x0105, 0x0069, 0x0005,
+	0x2031, 0x0206, 0x0049, 0x0005, 0x2031, 0x0207, 0x0029, 0x0005,
+	0x2031, 0x0213, 0x0009, 0x0005, 0x00c6, 0x00d6, 0x00f6, 0x7000,
+	0xa084, 0xf000, 0xa086, 0xc000, 0x05b0, 0x080c, 0x85c7, 0x0598,
+	0x0066, 0x00c6, 0x0046, 0x2011, 0xbb83, 0x2204, 0x8211, 0x220c,
+	0x080c, 0x281d, 0x1580, 0x080c, 0x4f4d, 0x1568, 0x6612, 0x6516,
+	0x2c00, 0x004e, 0x00ce, 0x601a, 0x080c, 0xa027, 0x080c, 0x15f8,
+	0x01f0, 0x2d00, 0x6056, 0x6803, 0x0000, 0x6837, 0x0000, 0x6c3a,
+	0xadf8, 0x000f, 0x20a9, 0x000e, 0x2fa0, 0x2e98, 0x53a3, 0x006e,
+	0x6612, 0x6007, 0x003e, 0x601f, 0x0001, 0x6003, 0x0001, 0x080c,
+	0x6cd3, 0x080c, 0x7173, 0x00fe, 0x00de, 0x00ce, 0x0005, 0x080c,
+	0x861d, 0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x2071, 0xb7f3,
+	0x7003, 0x0003, 0x700f, 0x0361, 0xa006, 0x701a, 0x7076, 0x7012,
+	0x7017, 0xbd00, 0x7007, 0x0000, 0x7026, 0x702b, 0x7d91, 0x7032,
+	0x7037, 0x7df1, 0x703b, 0xffff, 0x703f, 0xffff, 0x7042, 0x7047,
+	0x444b, 0x704a, 0x705b, 0x6a2b, 0x2001, 0xb7a1, 0x2003, 0x0003,
+	0x2001, 0xb7a3, 0x2003, 0x0100, 0x3a00, 0xa084, 0x0005, 0x706e,
+	0x0005, 0x2071, 0xb7f3, 0x1d04, 0x698b, 0x2091, 0x6000, 0x700c,
+	0x8001, 0x700e, 0x1518, 0x700f, 0x0361, 0x7007, 0x0001, 0x0126,
+	0x2091, 0x8000, 0x7040, 0xa00d, 0x0128, 0x8109, 0x7142, 0x1110,
+	0x7044, 0x080f, 0x00c6, 0x2061, 0xb500, 0x6034, 0x00ce, 0xd0cc,
+	0x0180, 0x3a00, 0xa084, 0x0005, 0x726c, 0xa216, 0x0150, 0x706e,
+	0x2011, 0x8043, 0x2018, 0x080c, 0x3ecc, 0x0018, 0x0126, 0x2091,
+	0x8000, 0x7024, 0xa00d, 0x0188, 0x7020, 0x8001, 0x7022, 0x1168,
+	0x7023, 0x0009, 0x8109, 0x7126, 0xa186, 0x03e8, 0x1110, 0x7028,
+	0x080f, 0x81ff, 0x1110, 0x7028, 0x080f, 0x7030, 0xa00d, 0x0180,
+	0x702c, 0x8001, 0x702e, 0x1160, 0x702f, 0x0009, 0x8109, 0x7132,
+	0x0128, 0xa184, 0x007f, 0x090c, 0x7e36, 0x0010, 0x7034, 0x080f,
+	0x7038, 0xa005, 0x0118, 0x0310, 0x8001, 0x703a, 0x703c, 0xa005,
+	0x0118, 0x0310, 0x8001, 0x703e, 0x704c, 0xa00d, 0x0168, 0x7048,
+	0x8001, 0x704a, 0x1148, 0x704b, 0x0009, 0x8109, 0x714e, 0x1120,
+	0x7150, 0x714e, 0x7058, 0x080f, 0x7018, 0xa00d, 0x01d8, 0x0016,
+	0x7074, 0xa00d, 0x0158, 0x7070, 0x8001, 0x7072, 0x1138, 0x7073,
+	0x0009, 0x8109, 0x7176, 0x1110, 0x7078, 0x080f, 0x001e, 0x7008,
+	0x8001, 0x700a, 0x1138, 0x700b, 0x0009, 0x8109, 0x711a, 0x1110,
+	0x701c, 0x080f, 0x012e, 0x7004, 0x0002, 0x69b1, 0x69b2, 0x69ca,
+	0x00e6, 0x2071, 0xb7f3, 0x7018, 0xa005, 0x1120, 0x711a, 0x721e,
+	0x700b, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0xb7f3,
+	0x701c, 0xa206, 0x1110, 0x701a, 0x701e, 0x000e, 0x00ee, 0x0005,
+	0x00e6, 0x2071, 0xb7f3, 0x6088, 0xa102, 0x0208, 0x618a, 0x00ee,
+	0x0005, 0x0005, 0x7110, 0x080c, 0x4fa9, 0x1158, 0x6088, 0x8001,
+	0x0240, 0x608a, 0x1130, 0x0126, 0x2091, 0x8000, 0x080c, 0x7173,
+	0x012e, 0x8108, 0xa182, 0x00ff, 0x0218, 0xa00e, 0x7007, 0x0002,
+	0x7112, 0x0005, 0x7014, 0x2060, 0x0126, 0x2091, 0x8000, 0x603c,
+	0xa005, 0x0128, 0x8001, 0x603e, 0x1110, 0x080c, 0x9f15, 0x6014,
+	0xa005, 0x0500, 0x8001, 0x6016, 0x11e8, 0x611c, 0xa186, 0x0003,
+	0x0118, 0xa186, 0x0006, 0x11a0, 0x6010, 0x2068, 0x6854, 0xa08a,
+	0x199a, 0x0270, 0xa082, 0x1999, 0x6856, 0xa08a, 0x199a, 0x0210,
+	0x2001, 0x1999, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x0010,
+	0x080c, 0x99e5, 0x012e, 0xac88, 0x0018, 0x7116, 0x2001, 0xed00,
+	0xa102, 0x0220, 0x7017, 0xbd00, 0x7007, 0x0000, 0x0005, 0x00e6,
+	0x2071, 0xb7f3, 0x7027, 0x07d0, 0x7023, 0x0009, 0x00ee, 0x0005,
+	0x2001, 0xb7fc, 0x2003, 0x0000, 0x0005, 0x00e6, 0x2071, 0xb7f3,
+	0x7132, 0x702f, 0x0009, 0x00ee, 0x0005, 0x2011, 0xb7ff, 0x2013,
+	0x0000, 0x0005, 0x00e6, 0x2071, 0xb7f3, 0x711a, 0x721e, 0x700b,
+	0x0009, 0x00ee, 0x0005, 0x00c6, 0x0026, 0x7054, 0x8000, 0x7056,
+	0x2061, 0xb7a1, 0x6008, 0xa086, 0x0000, 0x0158, 0x7068, 0x6032,
+	0x7064, 0x602e, 0x7060, 0x602a, 0x705c, 0x6026, 0x2c10, 0x080c,
+	0x1643, 0x002e, 0x00ce, 0x0005, 0x0006, 0x0016, 0x00c6, 0x00d6,
+	0x00e6, 0x00f6, 0x080c, 0x68f9, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0xb7f3, 0x7176, 0x727a,
+	0x7073, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0xb7f3,
+	0x7078, 0xa206, 0x1110, 0x7076, 0x707a, 0x000e, 0x00ee, 0x0005,
+	0x00c6, 0x2061, 0xb874, 0x00ce, 0x0005, 0xa184, 0x000f, 0x8003,
+	0x8003, 0x8003, 0xa080, 0xb874, 0x2060, 0x0005, 0x6854, 0xa08a,
+	0x199a, 0x0210, 0x2001, 0x1999, 0xa005, 0x1150, 0x00c6, 0x2061,
+	0xb874, 0x6014, 0x00ce, 0xa005, 0x1138, 0x2001, 0x001e, 0x0020,
+	0xa08e, 0xffff, 0x1108, 0xa006, 0x8003, 0x800b, 0x810b, 0xa108,
+	0x6116, 0x684c, 0xa08c, 0x00c0, 0xa18e, 0x00c0, 0x05e8, 0xd0b4,
+	0x1138, 0xd0bc, 0x1550, 0x2009, 0x0006, 0x080c, 0x6af1, 0x0005,
+	0xd0fc, 0x0138, 0xa084, 0x0003, 0x0120, 0xa086, 0x0003, 0x1904,
+	0x6aeb, 0x6020, 0xd0d4, 0x0130, 0xc0d4, 0x6022, 0x6860, 0x602a,
+	0x685c, 0x602e, 0x2009, 0xb574, 0x2104, 0xd084, 0x0138, 0x87ff,
+	0x1120, 0x2009, 0x0042, 0x080c, 0x864c, 0x0005, 0x87ff, 0x1120,
+	0x2009, 0x0043, 0x080c, 0x864c, 0x0005, 0xd0fc, 0x0130, 0xa084,
+	0x0003, 0x0118, 0xa086, 0x0003, 0x11f0, 0x87ff, 0x1120, 0x2009,
+	0x0042, 0x080c, 0x864c, 0x0005, 0xd0fc, 0x0160, 0xa084, 0x0003,
+	0xa08e, 0x0002, 0x0148, 0x87ff, 0x1120, 0x2009, 0x0041, 0x080c,
+	0x864c, 0x0005, 0x0061, 0x0ce8, 0x87ff, 0x1dd8, 0x2009, 0x0043,
+	0x080c, 0x864c, 0x0cb0, 0x2009, 0x0004, 0x0019, 0x0005, 0x2009,
+	0x0001, 0x00d6, 0x6010, 0xa0ec, 0xf000, 0x0510, 0x2068, 0x6952,
+	0x6800, 0x6012, 0xa186, 0x0001, 0x1188, 0x694c, 0xa18c, 0x8100,
+	0xa18e, 0x8100, 0x1158, 0x00c6, 0x2061, 0xb874, 0x6200, 0xd28c,
+	0x1120, 0x6204, 0x8210, 0x0208, 0x6206, 0x00ce, 0x080c, 0x5408,
+	0x6010, 0xa06d, 0x0076, 0x2039, 0x0000, 0x190c, 0x6a76, 0x007e,
+	0x00de, 0x0005, 0x0156, 0x00c6, 0x2061, 0xb874, 0x6000, 0x81ff,
+	0x0110, 0xa205, 0x0008, 0xa204, 0x6002, 0x00ce, 0x015e, 0x0005,
+	0x6800, 0xd08c, 0x1138, 0x6808, 0xa005, 0x0120, 0x8001, 0x680a,
+	0xa085, 0x0001, 0x0005, 0x20a9, 0x0010, 0xa006, 0x8004, 0x8086,
+	0x818e, 0x1208, 0xa200, 0x1f04, 0x6b37, 0x8086, 0x818e, 0x0005,
+	0x0156, 0x20a9, 0x0010, 0xa005, 0x01b8, 0xa11a, 0x12a8, 0x8213,
+	0x818d, 0x0228, 0xa11a, 0x1220, 0x1f04, 0x6b47, 0x0028, 0xa11a,
+	0x2308, 0x8210, 0x1f04, 0x6b47, 0x0006, 0x3200, 0xa084, 0xefff,
+	0x2080, 0x000e, 0x015e, 0x0005, 0x0006, 0x3200, 0xa085, 0x1000,
+	0x0cb8, 0x0126, 0x2091, 0x2800, 0x2079, 0xb7e0, 0x012e, 0x00d6,
+	0x2069, 0xb7e0, 0x6803, 0x0005, 0x2069, 0x0004, 0x2d04, 0xa085,
+	0x8001, 0x206a, 0x00de, 0x0005, 0x00c6, 0x6027, 0x0001, 0x7804,
+	0xa084, 0x0007, 0x0002, 0x6b85, 0x6ba6, 0x6bf9, 0x6b8b, 0x6ba6,
+	0x6b85, 0x6b83, 0x6b83, 0x080c, 0x1515, 0x080c, 0x6a10, 0x080c,
+	0x7173, 0x00ce, 0x0005, 0x62c0, 0x82ff, 0x1110, 0x00ce, 0x0005,
+	0x2011, 0x4adc, 0x080c, 0x699c, 0x7828, 0xa092, 0x00c8, 0x1228,
+	0x8000, 0x782a, 0x080c, 0x4b16, 0x0c88, 0x080c, 0x4adc, 0x7807,
+	0x0003, 0x7827, 0x0000, 0x782b, 0x0000, 0x0c40, 0x080c, 0x6a10,
+	0x3c00, 0x0006, 0x2011, 0x0209, 0x20e1, 0x4000, 0x2214, 0x000e,
+	0x20e0, 0x82ff, 0x0178, 0x62c0, 0x82ff, 0x1160, 0x782b, 0x0000,
+	0x7824, 0xa065, 0x090c, 0x1515, 0x2009, 0x0013, 0x080c, 0x864c,
+	0x00ce, 0x0005, 0x3900, 0xa082, 0xb92c, 0x1210, 0x080c, 0x8332,
+	0x00c6, 0x7824, 0xa065, 0x090c, 0x1515, 0x7804, 0xa086, 0x0004,
+	0x0904, 0x6c39, 0x7828, 0xa092, 0x2710, 0x1230, 0x8000, 0x782a,
+	0x00ce, 0x080c, 0x7d6d, 0x0c20, 0x6104, 0xa186, 0x0003, 0x1188,
+	0x00e6, 0x2071, 0xb500, 0x70e0, 0x00ee, 0xd08c, 0x0150, 0x00c6,
+	0x00e6, 0x2061, 0x0100, 0x2071, 0xb500, 0x080c, 0x4b1f, 0x00ee,
+	0x00ce, 0x080c, 0xb444, 0x2009, 0x0014, 0x080c, 0x864c, 0x00ce,
+	0x0838, 0x2001, 0xb7fc, 0x2003, 0x0000, 0x62c0, 0x82ff, 0x1160,
+	0x782b, 0x0000, 0x7824, 0xa065, 0x090c, 0x1515, 0x2009, 0x0013,
+	0x080c, 0x86a0, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x3900, 0xa082,
+	0xb92c, 0x1210, 0x080c, 0x8332, 0x7824, 0xa005, 0x090c, 0x1515,
+	0x781c, 0xa06d, 0x090c, 0x1515, 0x6800, 0xc0dc, 0x6802, 0x7924,
+	0x2160, 0x080c, 0x861d, 0x693c, 0x81ff, 0x090c, 0x1515, 0x8109,
+	0x693e, 0x6854, 0xa015, 0x0110, 0x7a1e, 0x0010, 0x7918, 0x791e,
+	0x7807, 0x0000, 0x7827, 0x0000, 0x00de, 0x00ce, 0x080c, 0x7173,
+	0x0888, 0x6104, 0xa186, 0x0002, 0x0128, 0xa186, 0x0004, 0x0110,
+	0x0804, 0x6bd2, 0x7808, 0xac06, 0x0904, 0x6bd2, 0x080c, 0x7090,
+	0x080c, 0x6cd3, 0x00ce, 0x080c, 0x7173, 0x0804, 0x6bc0, 0x00c6,
+	0x6027, 0x0002, 0x62c8, 0x60c4, 0xa205, 0x1178, 0x793c, 0xa1e5,
+	0x0000, 0x0130, 0x2009, 0x0049, 0x080c, 0x864c, 0x00ce, 0x0005,
+	0x2011, 0xb7ff, 0x2013, 0x0000, 0x0cc8, 0x3908, 0xa192, 0xb92c,
+	0x1210, 0x080c, 0x8332, 0x793c, 0x81ff, 0x0d90, 0x7944, 0xa192,
+	0x7530, 0x12b8, 0x8108, 0x7946, 0x793c, 0xa188, 0x0007, 0x210c,
+	0xa18e, 0x0006, 0x1138, 0x6014, 0xa084, 0x0184, 0xa085, 0x0012,
+	0x6016, 0x08e0, 0x6014, 0xa084, 0x0184, 0xa085, 0x0016, 0x6016,
+	0x08a8, 0x7848, 0xc085, 0x784a, 0x0888, 0x0006, 0x0016, 0x00c6,
+	0x0126, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061, 0xb7e0,
+	0x6020, 0x8000, 0x6022, 0x6010, 0xa005, 0x0148, 0xa080, 0x0003,
+	0x2102, 0x6112, 0x012e, 0x00ce, 0x001e, 0x000e, 0x0005, 0x6116,
+	0x6112, 0x0cc0, 0x00d6, 0x2069, 0xb7e0, 0x6000, 0xd0d4, 0x0168,
+	0x6820, 0x8000, 0x6822, 0xa086, 0x0001, 0x1110, 0x2c00, 0x681e,
+	0x6804, 0xa084, 0x0007, 0x0804, 0x7179, 0xc0d5, 0x6002, 0x6818,
+	0xa005, 0x0158, 0x6056, 0x605b, 0x0000, 0x0006, 0x2c00, 0x681a,
+	0x00de, 0x685a, 0x2069, 0xb7e0, 0x0c18, 0x6056, 0x605a, 0x2c00,
+	0x681a, 0x681e, 0x08e8, 0x0006, 0x0016, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x600f, 0x0000, 0x2c08, 0x2061, 0xb7e0, 0x6020, 0x8000,
+	0x6022, 0x6008, 0xa005, 0x0148, 0xa080, 0x0003, 0x2102, 0x610a,
+	0x012e, 0x00ce, 0x001e, 0x000e, 0x0005, 0x610e, 0x610a, 0x0cc0,
+	0x00c6, 0x600f, 0x0000, 0x2c08, 0x2061, 0xb7e0, 0x6034, 0xa005,
+	0x0130, 0xa080, 0x0003, 0x2102, 0x6136, 0x00ce, 0x0005, 0x613a,
+	0x6136, 0x0cd8, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066,
+	0x0056, 0x0036, 0x0026, 0x0016, 0x0006, 0x0126, 0xa02e, 0x2071,
+	0xb7e0, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0904,
+	0x6d7b, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x1904, 0x6d76,
+	0x87ff, 0x0120, 0x6050, 0xa106, 0x1904, 0x6d76, 0x703c, 0xac06,
+	0x1190, 0x0036, 0x2019, 0x0001, 0x080c, 0x7fe4, 0x7033, 0x0000,
+	0x703f, 0x0000, 0x7043, 0x0000, 0x7047, 0x0000, 0x704b, 0x0000,
+	0x003e, 0x2029, 0x0001, 0x7038, 0xac36, 0x1110, 0x660c, 0x763a,
+	0x7034, 0xac36, 0x1140, 0x2c00, 0xaf36, 0x0118, 0x2f00, 0x7036,
+	0x0010, 0x7037, 0x0000, 0x660c, 0x0066, 0x2c00, 0xaf06, 0x0110,
+	0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0x9c5a, 0x01c8,
+	0x6010, 0x2068, 0x601c, 0xa086, 0x0003, 0x1580, 0x6837, 0x0103,
+	0x6b4a, 0x6847, 0x0000, 0x0016, 0x0036, 0x0076, 0x080c, 0x9ecc,
+	0x080c, 0xb380, 0x080c, 0x5408, 0x007e, 0x003e, 0x001e, 0x080c,
+	0x9e11, 0x080c, 0x9e1d, 0x00ce, 0x0804, 0x6d16, 0x2c78, 0x600c,
+	0x2060, 0x0804, 0x6d16, 0x85ff, 0x0120, 0x0036, 0x080c, 0x7230,
+	0x003e, 0x012e, 0x000e, 0x001e, 0x002e, 0x003e, 0x005e, 0x006e,
+	0x007e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601c, 0xa086,
+	0x0006, 0x1158, 0x0016, 0x0036, 0x0076, 0x080c, 0xb380, 0x080c,
+	0xb099, 0x007e, 0x003e, 0x001e, 0x08a0, 0x601c, 0xa086, 0x000a,
+	0x0904, 0x6d60, 0x0804, 0x6d5e, 0x0006, 0x0066, 0x00c6, 0x00d6,
+	0x00f6, 0x2031, 0x0000, 0x0126, 0x2091, 0x8000, 0x2079, 0xb7e0,
+	0x7838, 0xa065, 0x0568, 0x600c, 0x0006, 0x600f, 0x0000, 0x783c,
+	0xac06, 0x1180, 0x0036, 0x2019, 0x0001, 0x080c, 0x7fe4, 0x7833,
+	0x0000, 0x783f, 0x0000, 0x7843, 0x0000, 0x7847, 0x0000, 0x784b,
+	0x0000, 0x003e, 0x080c, 0x9c5a, 0x0178, 0x6010, 0x2068, 0x601c,
+	0xa086, 0x0003, 0x11b0, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
+	0x080c, 0x5408, 0x080c, 0x9e11, 0x080c, 0x9e1d, 0x000e, 0x0888,
+	0x7e3a, 0x7e36, 0x012e, 0x00fe, 0x00de, 0x00ce, 0x006e, 0x000e,
+	0x0005, 0x601c, 0xa086, 0x0006, 0x1118, 0x080c, 0xb099, 0x0c60,
+	0x601c, 0xa086, 0x000a, 0x0d08, 0x08f0, 0x0016, 0x0026, 0x0086,
+	0x2041, 0x0000, 0x0099, 0x080c, 0x6ec3, 0x008e, 0x002e, 0x001e,
+	0x0005, 0x00f6, 0x0126, 0x2079, 0xb7e0, 0x2091, 0x8000, 0x080c,
+	0x6f50, 0x080c, 0x6fc2, 0x012e, 0x00fe, 0x0005, 0x00f6, 0x00e6,
+	0x00d6, 0x00c6, 0x0066, 0x0016, 0x0006, 0x0126, 0x2091, 0x8000,
+	0x2071, 0xb7e0, 0x7614, 0x2660, 0x2678, 0x8cff, 0x0904, 0x6e99,
+	0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x1904, 0x6e94, 0x88ff,
+	0x0120, 0x6050, 0xa106, 0x1904, 0x6e94, 0x7024, 0xac06, 0x1538,
+	0x2069, 0x0100, 0x68c0, 0xa005, 0x01f0, 0x080c, 0x6a10, 0x080c,
+	0x7d7a, 0x68c3, 0x0000, 0x080c, 0x824d, 0x7027, 0x0000, 0x0036,
+	0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0120, 0x6803, 0x0100,
+	0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
+	0x0001, 0x003e, 0x0020, 0x6003, 0x0009, 0x630a, 0x04e8, 0x7014,
+	0xac36, 0x1110, 0x660c, 0x7616, 0x7010, 0xac36, 0x1140, 0x2c00,
+	0xaf36, 0x0118, 0x2f00, 0x7012, 0x0010, 0x7013, 0x0000, 0x660c,
+	0x0066, 0x2c00, 0xaf06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
+	0x0000, 0x6010, 0x2068, 0x080c, 0x9c5a, 0x01b8, 0x601c, 0xa086,
+	0x0003, 0x1540, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x0016,
+	0x0036, 0x0086, 0x080c, 0x9ecc, 0x080c, 0xb380, 0x080c, 0x5408,
+	0x008e, 0x003e, 0x001e, 0x080c, 0x9e11, 0x080c, 0x9e1d, 0x080c,
+	0x811e, 0x00ce, 0x0804, 0x6e1d, 0x2c78, 0x600c, 0x2060, 0x0804,
+	0x6e1d, 0x012e, 0x000e, 0x001e, 0x006e, 0x00ce, 0x00de, 0x00ee,
+	0x00fe, 0x0005, 0x601c, 0xa086, 0x0006, 0x1158, 0x0016, 0x0036,
+	0x0086, 0x080c, 0xb380, 0x080c, 0xb099, 0x008e, 0x003e, 0x001e,
+	0x08e0, 0x601c, 0xa086, 0x0002, 0x1128, 0x6004, 0xa086, 0x0085,
+	0x0908, 0x0898, 0x601c, 0xa086, 0x0005, 0x1978, 0x6004, 0xa086,
+	0x0085, 0x0d20, 0x0850, 0x00c6, 0x0006, 0x0126, 0x2091, 0x8000,
+	0xa280, 0xb635, 0x2004, 0xa065, 0x0904, 0x6f4c, 0x00f6, 0x00e6,
+	0x00d6, 0x0066, 0x2071, 0xb7e0, 0x6654, 0x7018, 0xac06, 0x1108,
+	0x761a, 0x701c, 0xac06, 0x1130, 0x86ff, 0x1118, 0x7018, 0x701e,
+	0x0008, 0x761e, 0x6058, 0xa07d, 0x0108, 0x7e56, 0xa6ed, 0x0000,
+	0x0110, 0x2f00, 0x685a, 0x6057, 0x0000, 0x605b, 0x0000, 0x6000,
+	0xc0d4, 0xc0dc, 0x6002, 0x080c, 0x4ed4, 0x0904, 0x6f48, 0x7624,
+	0x86ff, 0x05e8, 0xa680, 0x0004, 0x2004, 0xad06, 0x15c0, 0x00d6,
+	0x2069, 0x0100, 0x68c0, 0xa005, 0x0548, 0x080c, 0x6a10, 0x080c,
+	0x7d7a, 0x68c3, 0x0000, 0x080c, 0x824d, 0x7027, 0x0000, 0x0036,
+	0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0120, 0x6803, 0x0100,
+	0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
+	0x0001, 0x003e, 0x00de, 0x00c6, 0x603c, 0xa005, 0x0110, 0x8001,
+	0x603e, 0x2660, 0x080c, 0x9e1d, 0x00ce, 0x0048, 0x00de, 0x00c6,
+	0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x0804, 0x6ef3, 0x8dff,
+	0x0158, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x080c, 0x9ecc,
+	0x080c, 0xb380, 0x080c, 0x5408, 0x080c, 0x811e, 0x0804, 0x6ef3,
+	0x006e, 0x00de, 0x00ee, 0x00fe, 0x012e, 0x000e, 0x00ce, 0x0005,
+	0x0006, 0x0066, 0x00c6, 0x00d6, 0x2031, 0x0000, 0x7814, 0xa065,
+	0x0904, 0x6fa2, 0x600c, 0x0006, 0x600f, 0x0000, 0x7824, 0xac06,
+	0x1540, 0x2069, 0x0100, 0x68c0, 0xa005, 0x01f0, 0x080c, 0x6a10,
+	0x080c, 0x7d7a, 0x68c3, 0x0000, 0x080c, 0x824d, 0x7827, 0x0000,
+	0x0036, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0120, 0x6803,
+	0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110,
+	0x6827, 0x0001, 0x003e, 0x0028, 0x6003, 0x0009, 0x630a, 0x2c30,
+	0x00b0, 0x6010, 0x2068, 0x080c, 0x9c5a, 0x0168, 0x601c, 0xa086,
+	0x0003, 0x11b8, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x080c,
+	0x5408, 0x080c, 0x9e11, 0x080c, 0x9e1d, 0x080c, 0x811e, 0x000e,
+	0x0804, 0x6f57, 0x7e16, 0x7e12, 0x00de, 0x00ce, 0x006e, 0x000e,
+	0x0005, 0x601c, 0xa086, 0x0006, 0x1118, 0x080c, 0xb099, 0x0c58,
+	0x601c, 0xa086, 0x0002, 0x1128, 0x6004, 0xa086, 0x0085, 0x09d0,
+	0x0c10, 0x601c, 0xa086, 0x0005, 0x19f0, 0x6004, 0xa086, 0x0085,
+	0x0d60, 0x08c8, 0x0006, 0x0066, 0x00c6, 0x00d6, 0x7818, 0xa065,
+	0x0904, 0x7028, 0x6054, 0x0006, 0x6057, 0x0000, 0x605b, 0x0000,
+	0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x080c, 0x4ed4, 0x0904, 0x7025,
+	0x7e24, 0x86ff, 0x05e8, 0xa680, 0x0004, 0x2004, 0xad06, 0x15c0,
+	0x00d6, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0548, 0x080c, 0x6a10,
+	0x080c, 0x7d7a, 0x68c3, 0x0000, 0x080c, 0x824d, 0x7827, 0x0000,
+	0x0036, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0120, 0x6803,
+	0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110,
+	0x6827, 0x0001, 0x003e, 0x00de, 0x00c6, 0x603c, 0xa005, 0x0110,
+	0x8001, 0x603e, 0x2660, 0x080c, 0x9e1d, 0x00ce, 0x0048, 0x00de,
+	0x00c6, 0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x0804, 0x6fd4,
+	0x8dff, 0x0138, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x080c,
+	0x5408, 0x080c, 0x811e, 0x0804, 0x6fd4, 0x000e, 0x0804, 0x6fc7,
+	0x781e, 0x781a, 0x00de, 0x00ce, 0x006e, 0x000e, 0x0005, 0x00e6,
+	0x00d6, 0x0066, 0x6000, 0xd0dc, 0x01a0, 0x604c, 0xa06d, 0x0188,
+	0x6848, 0xa606, 0x1170, 0x2071, 0xb7e0, 0x7024, 0xa035, 0x0148,
+	0xa080, 0x0004, 0x2004, 0xad06, 0x1120, 0x6000, 0xc0dc, 0x6002,
+	0x0021, 0x006e, 0x00de, 0x00ee, 0x0005, 0x00f6, 0x2079, 0x0100,
+	0x78c0, 0xa005, 0x1138, 0x00c6, 0x2660, 0x6003, 0x0009, 0x630a,
+	0x00ce, 0x04a0, 0x080c, 0x7d7a, 0x78c3, 0x0000, 0x080c, 0x824d,
+	0x7027, 0x0000, 0x0036, 0x2079, 0x0140, 0x7b04, 0xa384, 0x1000,
+	0x0120, 0x7803, 0x0100, 0x7803, 0x0000, 0x2079, 0x0100, 0x7824,
+	0xd084, 0x0110, 0x7827, 0x0001, 0x080c, 0x824d, 0x003e, 0x080c,
+	0x4ed4, 0x00c6, 0x603c, 0xa005, 0x0110, 0x8001, 0x603e, 0x2660,
+	0x080c, 0x861d, 0x00ce, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
+	0x080c, 0x9ecc, 0x080c, 0x5408, 0x080c, 0x811e, 0x00fe, 0x0005,
+	0x00e6, 0x00c6, 0x2071, 0xb7e0, 0x7004, 0xa084, 0x0007, 0x0002,
+	0x70a2, 0x70a5, 0x70bb, 0x70d4, 0x7111, 0x70a2, 0x70a0, 0x70a0,
+	0x080c, 0x1515, 0x00ce, 0x00ee, 0x0005, 0x7024, 0xa065, 0x0148,
+	0x7020, 0x8001, 0x7022, 0x600c, 0xa015, 0x0150, 0x7216, 0x600f,
+	0x0000, 0x7007, 0x0000, 0x7027, 0x0000, 0x00ce, 0x00ee, 0x0005,
+	0x7216, 0x7212, 0x0cb0, 0x6018, 0x2060, 0x080c, 0x4ed4, 0x6000,
+	0xc0dc, 0x6002, 0x7020, 0x8001, 0x7022, 0x0120, 0x6054, 0xa015,
+	0x0140, 0x721e, 0x7007, 0x0000, 0x7027, 0x0000, 0x00ce, 0x00ee,
+	0x0005, 0x7218, 0x721e, 0x0cb0, 0x7024, 0xa065, 0x05b8, 0x700c,
+	0xac06, 0x1160, 0x080c, 0x811e, 0x600c, 0xa015, 0x0120, 0x720e,
+	0x600f, 0x0000, 0x0448, 0x720e, 0x720a, 0x0430, 0x7014, 0xac06,
+	0x1160, 0x080c, 0x811e, 0x600c, 0xa015, 0x0120, 0x7216, 0x600f,
+	0x0000, 0x00d0, 0x7216, 0x7212, 0x00b8, 0x601c, 0xa086, 0x0003,
+	0x1198, 0x6018, 0x2060, 0x080c, 0x4ed4, 0x6000, 0xc0dc, 0x6002,
+	0x080c, 0x811e, 0x701c, 0xa065, 0x0138, 0x6054, 0xa015, 0x0110,
+	0x721e, 0x0010, 0x7218, 0x721e, 0x7027, 0x0000, 0x00ce, 0x00ee,
+	0x0005, 0x7024, 0xa065, 0x0140, 0x080c, 0x811e, 0x600c, 0xa015,
+	0x0150, 0x720e, 0x600f, 0x0000, 0x080c, 0x824d, 0x7027, 0x0000,
+	0x00ce, 0x00ee, 0x0005, 0x720e, 0x720a, 0x0cb0, 0x00d6, 0x2069,
+	0xb7e0, 0x6830, 0xa084, 0x0003, 0x0002, 0x7133, 0x7135, 0x7159,
+	0x7131, 0x080c, 0x1515, 0x00de, 0x0005, 0x00c6, 0x6840, 0xa086,
+	0x0001, 0x01b8, 0x683c, 0xa065, 0x0130, 0x600c, 0xa015, 0x0170,
+	0x6a3a, 0x600f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x2011,
+	0xb7ff, 0x2013, 0x0000, 0x00ce, 0x00de, 0x0005, 0x683a, 0x6836,
+	0x0c90, 0x6843, 0x0000, 0x6838, 0xa065, 0x0d68, 0x6003, 0x0003,
+	0x0c50, 0x00c6, 0x6843, 0x0000, 0x6847, 0x0000, 0x684b, 0x0000,
+	0x683c, 0xa065, 0x0168, 0x600c, 0xa015, 0x0130, 0x6a3a, 0x600f,
+	0x0000, 0x683f, 0x0000, 0x0020, 0x683f, 0x0000, 0x683a, 0x6836,
+	0x00ce, 0x00de, 0x0005, 0x00d6, 0x2069, 0xb7e0, 0x6804, 0xa084,
+	0x0007, 0x0002, 0x7184, 0x7220, 0x7220, 0x7220, 0x7220, 0x7222,
+	0x7182, 0x7182, 0x080c, 0x1515, 0x6820, 0xa005, 0x1110, 0x00de,
+	0x0005, 0x00c6, 0x680c, 0xa065, 0x0150, 0x6807, 0x0004, 0x6826,
+	0x682b, 0x0000, 0x080c, 0x7272, 0x00ce, 0x00de, 0x0005, 0x6814,
+	0xa065, 0x0150, 0x6807, 0x0001, 0x6826, 0x682b, 0x0000, 0x080c,
+	0x7272, 0x00ce, 0x00de, 0x0005, 0x00e6, 0x0036, 0x6a1c, 0xa2f5,
+	0x0000, 0x0904, 0x721c, 0x704c, 0xa00d, 0x0118, 0x7088, 0xa005,
+	0x01a0, 0x7054, 0xa075, 0x0120, 0xa20e, 0x0904, 0x721c, 0x0028,
+	0x6818, 0xa20e, 0x0904, 0x721c, 0x2070, 0x704c, 0xa00d, 0x0d88,
+	0x7088, 0xa005, 0x1d70, 0x2e00, 0x681e, 0x733c, 0x7038, 0xa302,
+	0x1e40, 0x080c, 0x85f4, 0x0904, 0x721c, 0x8318, 0x733e, 0x6112,
+	0x2e10, 0x621a, 0xa180, 0x0014, 0x2004, 0xa084, 0x00ff, 0x605a,
+	0xa180, 0x0014, 0x2003, 0x0000, 0xa180, 0x0015, 0x2004, 0xa08a,
+	0x199a, 0x0210, 0x2001, 0x1999, 0x8003, 0x801b, 0x831b, 0xa318,
+	0x6316, 0x003e, 0x00f6, 0x2c78, 0x71a0, 0x2001, 0xb535, 0x2004,
+	0xd0ac, 0x1110, 0xd1bc, 0x0150, 0x7100, 0xd1f4, 0x0120, 0x7114,
+	0xa18c, 0x00ff, 0x0040, 0x2009, 0x0000, 0x0028, 0xa1e0, 0x2dc4,
+	0x2c0d, 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0x080c, 0x78a2,
+	0x7300, 0xc3dd, 0x7302, 0x6807, 0x0002, 0x2f18, 0x6b26, 0x682b,
+	0x0000, 0x781f, 0x0003, 0x7803, 0x0001, 0x7807, 0x0040, 0x00fe,
+	0x00ee, 0x00ce, 0x00de, 0x0005, 0x003e, 0x00ee, 0x00ce, 0x0cd0,
+	0x00de, 0x0005, 0x00c6, 0x680c, 0xa065, 0x0138, 0x6807, 0x0004,
+	0x6826, 0x682b, 0x0000, 0x080c, 0x7272, 0x00ce, 0x00de, 0x0005,
+	0x00f6, 0x00d6, 0x2069, 0xb7e0, 0x6830, 0xa086, 0x0000, 0x11d0,
+	0x2001, 0xb50c, 0x200c, 0xd1bc, 0x1560, 0x6838, 0xa07d, 0x0190,
+	0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x684b, 0x0000, 0x0126,
+	0x00f6, 0x2091, 0x2400, 0x002e, 0x080c, 0x2021, 0x1130, 0x012e,
+	0x080c, 0x7beb, 0x00de, 0x00fe, 0x0005, 0x012e, 0xe000, 0x6843,
+	0x0000, 0x7803, 0x0002, 0x780c, 0xa015, 0x0140, 0x6a3a, 0x780f,
+	0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0c60, 0x683a, 0x6836,
+	0x0cc0, 0xc1bc, 0x2102, 0x0066, 0x2031, 0x0001, 0x080c, 0x5b51,
+	0x006e, 0x0858, 0x601c, 0xa084, 0x000f, 0x000b, 0x0005, 0x7280,
+	0x7285, 0x7743, 0x785f, 0x7285, 0x7743, 0x785f, 0x7280, 0x7285,
+	0x080c, 0x7090, 0x080c, 0x7173, 0x0005, 0x0156, 0x0136, 0x0146,
+	0x00c6, 0x00f6, 0x6004, 0xa08a, 0x0080, 0x1a0c, 0x1515, 0x6118,
+	0x2178, 0x79a0, 0x2011, 0xb535, 0x2214, 0xd2ac, 0x1110, 0xd1bc,
+	0x0150, 0x7900, 0xd1f4, 0x0120, 0x7914, 0xa18c, 0x00ff, 0x0040,
+	0x2009, 0x0000, 0x0028, 0xa1f8, 0x2dc4, 0x2f0d, 0xa18c, 0x00ff,
+	0x2c78, 0x2061, 0x0100, 0x619a, 0xa08a, 0x0040, 0x1a04, 0x72f9,
+	0x0033, 0x00fe, 0x00ce, 0x014e, 0x013e, 0x015e, 0x0005, 0x73a8,
+	0x73f3, 0x7420, 0x74ed, 0x751b, 0x7523, 0x7549, 0x755a, 0x756b,
+	0x7573, 0x7589, 0x7573, 0x75ea, 0x755a, 0x760b, 0x7613, 0x756b,
+	0x7613, 0x7624, 0x72f7, 0x72f7, 0x72f7, 0x72f7, 0x72f7, 0x72f7,
+	0x72f7, 0x72f7, 0x72f7, 0x72f7, 0x72f7, 0x7e85, 0x7eaa, 0x7ebf,
+	0x7ee2, 0x7f03, 0x7549, 0x72f7, 0x7549, 0x7573, 0x72f7, 0x7420,
+	0x74ed, 0x72f7, 0x834f, 0x7573, 0x72f7, 0x836f, 0x7573, 0x72f7,
+	0x756b, 0x73a1, 0x730c, 0x72f7, 0x8394, 0x8409, 0x84e0, 0x72f7,
+	0x84f1, 0x7544, 0x850d, 0x72f7, 0x7f18, 0x8568, 0x72f7, 0x080c,
+	0x1515, 0x2100, 0x0033, 0x00fe, 0x00ce, 0x014e, 0x013e, 0x015e,
+	0x0005, 0x730a, 0x730a, 0x730a, 0x7340, 0x735e, 0x7374, 0x730a,
+	0x730a, 0x730a, 0x080c, 0x1515, 0x00d6, 0x20a1, 0x020b, 0x080c,
+	0x7641, 0x7810, 0x2068, 0x20a3, 0x2414, 0x20a3, 0x0018, 0x20a3,
+	0x0800, 0x683c, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x6850, 0x20a2, 0x6854, 0x20a2, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x60c3, 0x0018, 0x080c, 0x7d67, 0x00de,
+	0x0005, 0x00d6, 0x7818, 0x2068, 0x68a0, 0x2069, 0xb500, 0x6ad4,
+	0xd2ac, 0x1110, 0xd0bc, 0x0110, 0xa085, 0x0001, 0x00de, 0x0005,
+	0x00d6, 0x20a1, 0x020b, 0x080c, 0x7641, 0x20a3, 0x0500, 0x20a3,
+	0x0000, 0x7810, 0xa0e8, 0x000f, 0x6808, 0x20a2, 0x680c, 0x20a2,
+	0x6810, 0x20a2, 0x6814, 0x20a2, 0x6818, 0x20a2, 0x681c, 0x20a2,
+	0x60c3, 0x0010, 0x080c, 0x7d67, 0x00de, 0x0005, 0x0156, 0x0146,
+	0x20a1, 0x020b, 0x080c, 0x7641, 0x20a3, 0x7800, 0x20a3, 0x0000,
+	0x7808, 0x8007, 0x20a2, 0x20a3, 0x0000, 0x60c3, 0x0008, 0x080c,
+	0x7d67, 0x014e, 0x015e, 0x0005, 0x0156, 0x0146, 0x20a1, 0x020b,
+	0x080c, 0x76dd, 0x20a3, 0x0200, 0x20a3, 0x0000, 0x20a3, 0xdf10,
+	0x20a3, 0x0034, 0x2099, 0xb505, 0x20a9, 0x0004, 0x53a6, 0x2099,
+	0xb501, 0x20a9, 0x0004, 0x53a6, 0x2099, 0xb7c6, 0x20a9, 0x001a,
+	0x3304, 0x8007, 0x20a2, 0x9398, 0x1f04, 0x7390, 0x20a3, 0x0000,
+	0x20a3, 0x0000, 0x60c3, 0x004c, 0x080c, 0x7d67, 0x014e, 0x015e,
+	0x0005, 0x2001, 0xb515, 0x2004, 0x609a, 0x080c, 0x7d67, 0x0005,
+	0x20a1, 0x020b, 0x080c, 0x7641, 0x20a3, 0x5200, 0x20a3, 0x0000,
+	0x00d6, 0x2069, 0xb552, 0x6804, 0xd084, 0x0150, 0x6828, 0x20a3,
+	0x0000, 0x0016, 0x080c, 0x2831, 0x21a2, 0x001e, 0x00de, 0x0028,
+	0x00de, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099,
+	0xb505, 0x53a6, 0x20a9, 0x0004, 0x2099, 0xb501, 0x53a6, 0x2001,
+	0xb535, 0x2004, 0xd0ac, 0x1138, 0x7818, 0xa080, 0x0028, 0x2004,
+	0xa082, 0x007f, 0x0238, 0x2001, 0xb51c, 0x20a6, 0x2001, 0xb51d,
+	0x20a6, 0x0040, 0x20a3, 0x0000, 0x2001, 0xb515, 0x2004, 0xa084,
+	0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c,
+	0x080c, 0x7d67, 0x0005, 0x20a1, 0x020b, 0x080c, 0x7641, 0x20a3,
+	0x0500, 0x20a3, 0x0000, 0x2001, 0xb535, 0x2004, 0xd0ac, 0x1138,
+	0x7818, 0xa080, 0x0028, 0x2004, 0xa082, 0x007f, 0x0238, 0x2001,
+	0xb51c, 0x20a6, 0x2001, 0xb51d, 0x20a6, 0x0040, 0x20a3, 0x0000,
+	0x2001, 0xb515, 0x2004, 0xa084, 0x00ff, 0x20a2, 0x20a9, 0x0004,
+	0x2099, 0xb505, 0x53a6, 0x60c3, 0x0010, 0x080c, 0x7d67, 0x0005,
+	0x20a1, 0x020b, 0x080c, 0x7641, 0x00c6, 0x7818, 0x2060, 0x2001,
+	0x0000, 0x080c, 0x5313, 0x00ce, 0x7818, 0xa080, 0x0028, 0x2004,
+	0xa086, 0x007e, 0x1130, 0x20a3, 0x0400, 0x620c, 0xc2b4, 0x620e,
+	0x0010, 0x20a3, 0x0300, 0x20a3, 0x0000, 0x7818, 0xa080, 0x0028,
+	0x2004, 0xa086, 0x007e, 0x1904, 0x74af, 0x2001, 0xb535, 0x2004,
+	0xd0a4, 0x01c8, 0x2099, 0xb78e, 0x33a6, 0x9398, 0x20a3, 0x0000,
+	0x9398, 0x3304, 0xa084, 0x2000, 0x20a2, 0x9398, 0x33a6, 0x9398,
+	0x20a3, 0x0000, 0x9398, 0x2001, 0x2710, 0x20a2, 0x9398, 0x33a6,
+	0x9398, 0x33a6, 0x00d0, 0x2099, 0xb78e, 0x33a6, 0x9398, 0x33a6,
+	0x9398, 0x3304, 0x080c, 0x5acf, 0x1118, 0xa084, 0x37ff, 0x0010,
+	0xa084, 0x3fff, 0x20a2, 0x9398, 0x33a6, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099,
+	0xb505, 0x53a6, 0x20a9, 0x0004, 0x2099, 0xb501, 0x53a6, 0x20a9,
+	0x0008, 0x20a3, 0x0000, 0x1f04, 0x7489, 0x20a9, 0x0008, 0x20a3,
+	0x0000, 0x1f04, 0x748f, 0x2099, 0xb796, 0x3304, 0xc0dd, 0x20a2,
+	0x2001, 0xb572, 0x2004, 0xd0e4, 0x0158, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x9398, 0x9398, 0x9398, 0x33a6, 0x20a9, 0x0004, 0x0010,
+	0x20a9, 0x0007, 0x20a3, 0x0000, 0x1f04, 0x74aa, 0x0468, 0x2001,
+	0xb535, 0x2004, 0xd0a4, 0x0140, 0x2001, 0xb78f, 0x2004, 0x60e3,
+	0x0000, 0x080c, 0x2872, 0x60e2, 0x2099, 0xb78e, 0x20a9, 0x0008,
+	0x53a6, 0x20a9, 0x0004, 0x2099, 0xb505, 0x53a6, 0x20a9, 0x0004,
+	0x2099, 0xb501, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x1f04,
+	0x74cd, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x1f04, 0x74d3, 0x2099,
+	0xb796, 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000,
+	0x1f04, 0x74de, 0x20a9, 0x000a, 0x20a3, 0x0000, 0x1f04, 0x74e4,
+	0x60c3, 0x0074, 0x080c, 0x7d67, 0x0005, 0x20a1, 0x020b, 0x080c,
+	0x7641, 0x20a3, 0x2010, 0x20a3, 0x0014, 0x20a3, 0x0800, 0x20a3,
+	0x2000, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x00f6,
+	0x2079, 0xb552, 0x7904, 0x00fe, 0xd1ac, 0x1110, 0xa085, 0x0020,
+	0xd1a4, 0x0110, 0xa085, 0x0010, 0xa085, 0x0002, 0x00d6, 0x0804,
+	0x75cc, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
+	0x080c, 0x7d67, 0x0005, 0x20a1, 0x020b, 0x080c, 0x7641, 0x20a3,
+	0x5000, 0x0804, 0x743b, 0x20a1, 0x020b, 0x080c, 0x7641, 0x20a3,
+	0x2110, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
+	0x0014, 0x080c, 0x7d67, 0x0005, 0x20a1, 0x020b, 0x080c, 0x76d5,
+	0x0020, 0x20a1, 0x020b, 0x080c, 0x76dd, 0x20a3, 0x0200, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004, 0x080c,
+	0x7d67, 0x0005, 0x20a1, 0x020b, 0x080c, 0x76dd, 0x20a3, 0x0100,
+	0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3, 0x0008,
+	0x080c, 0x7d67, 0x0005, 0x20a1, 0x020b, 0x080c, 0x76dd, 0x20a3,
+	0x0200, 0x0804, 0x743b, 0x20a1, 0x020b, 0x080c, 0x76dd, 0x20a3,
+	0x0100, 0x20a3, 0x0000, 0x7828, 0xa005, 0x0110, 0x20a2, 0x0010,
+	0x20a3, 0x0003, 0x7810, 0x20a2, 0x60c3, 0x0008, 0x080c, 0x7d67,
+	0x0005, 0x00d6, 0x20a1, 0x020b, 0x080c, 0x76dd, 0x20a3, 0x0210,
+	0x20a3, 0x0014, 0x20a3, 0x0800, 0x7818, 0x2068, 0x6894, 0xa086,
+	0x0014, 0x1198, 0x699c, 0xa184, 0x0030, 0x0190, 0x6998, 0xa184,
+	0xc000, 0x1140, 0xd1ec, 0x0118, 0x20a3, 0x2100, 0x0058, 0x20a3,
+	0x0100, 0x0040, 0x20a3, 0x0400, 0x0028, 0x20a3, 0x0700, 0x0010,
+	0x700f, 0x0800, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2,
+	0x00f6, 0x2079, 0xb552, 0x7904, 0x00fe, 0xd1ac, 0x1110, 0xa085,
+	0x0020, 0xd1a4, 0x0110, 0xa085, 0x0010, 0x2009, 0xb574, 0x210c,
+	0xd184, 0x1110, 0xa085, 0x0002, 0x0026, 0x2009, 0xb572, 0x210c,
+	0xd1e4, 0x0130, 0xc0c5, 0xa094, 0x0030, 0xa296, 0x0010, 0x0140,
+	0xd1ec, 0x0130, 0xa094, 0x0030, 0xa296, 0x0010, 0x0108, 0xc0bd,
+	0x002e, 0x20a2, 0x20a2, 0x20a2, 0x60c3, 0x0014, 0x080c, 0x7d67,
+	0x00de, 0x0005, 0x20a1, 0x020b, 0x080c, 0x76dd, 0x20a3, 0x0210,
+	0x20a3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0100, 0x20a3, 0x0000,
+	0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+	0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
+	0x080c, 0x7d67, 0x0005, 0x20a1, 0x020b, 0x080c, 0x76dd, 0x20a3,
+	0x0200, 0x0804, 0x73ae, 0x20a1, 0x020b, 0x080c, 0x76dd, 0x20a3,
+	0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3,
+	0x0008, 0x080c, 0x7d67, 0x0005, 0x20e1, 0x9080, 0x20e1, 0x4000,
+	0x20a1, 0x020b, 0x080c, 0x76dd, 0x20a3, 0x0100, 0x20a3, 0x0000,
+	0x20a3, 0x000b, 0x20a3, 0x0000, 0x60c3, 0x0008, 0x080c, 0x7d67,
+	0x0005, 0x0026, 0x0036, 0x0046, 0x2019, 0x3200, 0x2021, 0x0800,
+	0x0038, 0x0026, 0x0036, 0x0046, 0x2019, 0x2200, 0x2021, 0x0100,
+	0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2014,
+	0xa286, 0x007e, 0x11a0, 0xa385, 0x00ff, 0x20a2, 0x20a3, 0xfffe,
+	0x20a3, 0x0000, 0x2011, 0xb515, 0x2214, 0x2001, 0xb79e, 0x2004,
+	0xa005, 0x0118, 0x2011, 0xb51d, 0x2214, 0x22a2, 0x04d0, 0xa286,
+	0x007f, 0x1138, 0x00d6, 0xa385, 0x00ff, 0x20a2, 0x20a3, 0xfffd,
+	0x00c8, 0x2001, 0xb535, 0x2004, 0xd0ac, 0x1110, 0xd2bc, 0x01c8,
+	0xa286, 0x0080, 0x00d6, 0x1130, 0xa385, 0x00ff, 0x20a2, 0x20a3,
+	0xfffc, 0x0040, 0xa2e8, 0xb635, 0x2d6c, 0x6810, 0xa305, 0x20a2,
+	0x6814, 0x20a2, 0x2069, 0xb51c, 0x2da6, 0x8d68, 0x2da6, 0x00de,
+	0x0080, 0x00d6, 0xa2e8, 0xb635, 0x2d6c, 0x6810, 0xa305, 0x20a2,
+	0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000, 0x2011, 0xb515, 0x2214,
+	0x22a2, 0xa485, 0x0029, 0x20a2, 0x004e, 0x003e, 0x20a3, 0x0000,
+	0x080c, 0x7d56, 0x22a2, 0x20a3, 0x0000, 0x2fa2, 0x20a3, 0xffff,
+	0x20a3, 0x0000, 0x20a3, 0x0000, 0x002e, 0x0005, 0x0026, 0x20e1,
+	0x9080, 0x20e1, 0x4000, 0x20a3, 0x02ff, 0x2011, 0xfffc, 0x22a2,
+	0x00d6, 0x2069, 0xb51c, 0x2da6, 0x8d68, 0x2da6, 0x00de, 0x20a3,
+	0x2029, 0x20a3, 0x0000, 0x08e0, 0x20a3, 0x0100, 0x20a3, 0x0000,
+	0x20a3, 0xfc02, 0x20a3, 0x0000, 0x0005, 0x0026, 0x0036, 0x0046,
+	0x2019, 0x3300, 0x2021, 0x0800, 0x0038, 0x0026, 0x0036, 0x0046,
+	0x2019, 0x2300, 0x2021, 0x0100, 0x20e1, 0x9080, 0x20e1, 0x4000,
+	0x7818, 0xa080, 0x0028, 0x2004, 0x2011, 0xb535, 0x2214, 0xd2ac,
+	0x1118, 0xa092, 0x007e, 0x02d8, 0x00d6, 0xa0e8, 0xb635, 0x2d6c,
+	0x6810, 0xa305, 0x20a2, 0x6814, 0x20a2, 0x6810, 0xa005, 0x1140,
+	0x6814, 0xa005, 0x1128, 0x20a3, 0x00ff, 0x20a3, 0xfffe, 0x0028,
+	0x2069, 0xb51c, 0x2da6, 0x8d68, 0x2da6, 0x00de, 0x0080, 0x00d6,
+	0xa0e8, 0xb635, 0x2d6c, 0x6810, 0xa305, 0x20a2, 0x6814, 0x20a2,
+	0x00de, 0x20a3, 0x0000, 0x2011, 0xb515, 0x2214, 0x22a2, 0xa485,
+	0x0098, 0x20a2, 0x20a3, 0x0000, 0x004e, 0x003e, 0x080c, 0x7d56,
+	0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000,
+	0x20a3, 0x0000, 0x002e, 0x0005, 0x080c, 0x7d56, 0x22a2, 0x20a3,
+	0x0000, 0x7a08, 0x22a2, 0x7810, 0x20a2, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x002e, 0x0005, 0x00c6, 0x00f6, 0x6004, 0xa08a, 0x0085,
+	0x0a0c, 0x1515, 0xa08a, 0x008c, 0x1a0c, 0x1515, 0x6118, 0x2178,
+	0x79a0, 0x2011, 0xb535, 0x2214, 0xd2ac, 0x1110, 0xd1bc, 0x0150,
+	0x7900, 0xd1f4, 0x0120, 0x7914, 0xa18c, 0x00ff, 0x0040, 0x2009,
+	0x0000, 0x0028, 0xa1f8, 0x2dc4, 0x2f0d, 0xa18c, 0x00ff, 0x2c78,
+	0x2061, 0x0100, 0x619a, 0xa082, 0x0085, 0x001b, 0x00fe, 0x00ce,
+	0x0005, 0x777a, 0x7784, 0x779f, 0x7778, 0x7778, 0x7778, 0x777a,
+	0x080c, 0x1515, 0x0146, 0x20a1, 0x020b, 0x04a1, 0x60c3, 0x0000,
+	0x080c, 0x7d67, 0x014e, 0x0005, 0x0146, 0x20a1, 0x020b, 0x080c,
+	0x77eb, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2, 0x7810,
+	0x20a2, 0x20a3, 0x0000, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x60c3, 0x000c, 0x080c, 0x7d67, 0x014e, 0x0005, 0x0146,
+	0x20a1, 0x020b, 0x080c, 0x7825, 0x20a3, 0x0003, 0x20a3, 0x0300,
+	0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004, 0x080c, 0x7d67,
+	0x014e, 0x0005, 0x0026, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818,
+	0xa080, 0x0028, 0x2004, 0x2011, 0xb535, 0x2214, 0xd2ac, 0x1118,
+	0xa092, 0x007e, 0x0288, 0x00d6, 0xa0e8, 0xb635, 0x2d6c, 0x6810,
+	0xa085, 0x8100, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xb51c, 0x2da6,
+	0x8d68, 0x2da6, 0x00de, 0x0088, 0x00d6, 0xa0e8, 0xb635, 0x2d6c,
+	0x6810, 0xa085, 0x8100, 0x20a2, 0x6814, 0x20a2, 0x00de, 0x20a3,
+	0x0000, 0x2011, 0xb515, 0x2214, 0x22a2, 0x20a3, 0x0009, 0x20a3,
+	0x0000, 0x0804, 0x76a8, 0x0026, 0x20e1, 0x9080, 0x20e1, 0x4000,
+	0x7818, 0xa080, 0x0028, 0x2004, 0x2011, 0xb535, 0x2214, 0xd2ac,
+	0x1118, 0xa092, 0x007e, 0x0288, 0x00d6, 0xa0e8, 0xb635, 0x2d6c,
+	0x6810, 0xa085, 0x8400, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xb51c,
+	0x2da6, 0x8d68, 0x2da6, 0x00de, 0x0088, 0x00d6, 0xa0e8, 0xb635,
+	0x2d6c, 0x6810, 0xa085, 0x8400, 0x20a2, 0x6814, 0x20a2, 0x00de,
+	0x20a3, 0x0000, 0x2011, 0xb515, 0x2214, 0x22a2, 0x2001, 0x0099,
+	0x20a2, 0x20a3, 0x0000, 0x0804, 0x7734, 0x0026, 0x20e1, 0x9080,
+	0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0x2011, 0xb535,
+	0x2214, 0xd2ac, 0x1118, 0xa092, 0x007e, 0x0288, 0x00d6, 0xa0e8,
+	0xb635, 0x2d6c, 0x6810, 0xa085, 0x8500, 0x20a2, 0x6814, 0x20a2,
+	0x2069, 0xb51c, 0x2da6, 0x8d68, 0x2da6, 0x00de, 0x0088, 0x00d6,
+	0xa0e8, 0xb635, 0x2d6c, 0x6810, 0xa085, 0x8500, 0x20a2, 0x6814,
+	0x20a2, 0x00de, 0x20a3, 0x0000, 0x2011, 0xb515, 0x2214, 0x22a2,
+	0x2001, 0x0099, 0x20a2, 0x20a3, 0x0000, 0x0804, 0x7734, 0x00c6,
+	0x00f6, 0x2c78, 0x7804, 0xa08a, 0x0040, 0x0a0c, 0x1515, 0xa08a,
+	0x0053, 0x1a0c, 0x1515, 0x7918, 0x2160, 0x61a0, 0x2011, 0xb535,
+	0x2214, 0xd2ac, 0x1110, 0xd1bc, 0x0150, 0x6100, 0xd1f4, 0x0120,
+	0x6114, 0xa18c, 0x00ff, 0x0040, 0x2009, 0x0000, 0x0028, 0xa1e0,
+	0x2dc4, 0x2c0d, 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0xa082,
+	0x0040, 0x001b, 0x00fe, 0x00ce, 0x0005, 0x78a2, 0x79ae, 0x794b,
+	0x7b60, 0x78a0, 0x78a0, 0x78a0, 0x78a0, 0x78a0, 0x78a0, 0x78a0,
+	0x80d7, 0x80e7, 0x80f7, 0x8107, 0x78a0, 0x851e, 0x78a0, 0x80c6,
+	0x080c, 0x1515, 0x00d6, 0x0156, 0x0146, 0x780b, 0xffff, 0x20a1,
+	0x020b, 0x080c, 0x7902, 0x7910, 0x2168, 0x6948, 0x7952, 0x21a2,
+	0xa016, 0x22a2, 0x22a2, 0x22a2, 0x694c, 0xa184, 0x000f, 0x1118,
+	0x2001, 0x0005, 0x0040, 0xd184, 0x0118, 0x2001, 0x0004, 0x0018,
+	0xa084, 0x0006, 0x8004, 0x0016, 0x2008, 0x7858, 0xa084, 0x00ff,
+	0x8007, 0xa105, 0x001e, 0x20a2, 0xd1ac, 0x0118, 0x20a3, 0x0002,
+	0x0048, 0xd1b4, 0x0118, 0x20a3, 0x0001, 0x0020, 0x20a3, 0x0000,
+	0x2230, 0x0010, 0x6a80, 0x6e7c, 0x20a9, 0x0008, 0x0136, 0xad88,
+	0x0017, 0x2198, 0x20a1, 0x021b, 0x53a6, 0x013e, 0x20a1, 0x020b,
+	0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1, 0x9080, 0x6014, 0xa084,
+	0x0004, 0xa085, 0x0009, 0x6016, 0x2001, 0xb7fc, 0x2003, 0x07d0,
+	0x2001, 0xb7fb, 0x2003, 0x0009, 0x080c, 0x17e2, 0x014e, 0x015e,
+	0x00de, 0x0005, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7a18, 0xa280,
+	0x0023, 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202, 0x8217, 0x7818,
+	0xa080, 0x0028, 0x2004, 0x2019, 0xb535, 0x231c, 0xd3ac, 0x1110,
+	0xd0bc, 0x0188, 0x00d6, 0xa0e8, 0xb635, 0x2d6c, 0x6810, 0xa085,
+	0x0600, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xb51c, 0x2da6, 0x8d68,
+	0x2da6, 0x00de, 0x0088, 0x00d6, 0xa0e8, 0xb635, 0x2d6c, 0x6810,
+	0xa085, 0x0600, 0x20a2, 0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000,
+	0x2009, 0xb515, 0x210c, 0x21a2, 0x20a3, 0x0829, 0x20a3, 0x0000,
+	0x22a2, 0x20a3, 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000,
+	0x20a3, 0x0000, 0x0005, 0x00d6, 0x0156, 0x0136, 0x0146, 0x20a1,
+	0x020b, 0x00c1, 0x7810, 0x2068, 0x6860, 0x20a2, 0x685c, 0x20a2,
+	0x6880, 0x20a2, 0x687c, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2,
+	0x20a2, 0x60c3, 0x000c, 0x080c, 0x7d67, 0x014e, 0x013e, 0x015e,
+	0x00de, 0x0005, 0x0026, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818,
+	0xa080, 0x0028, 0x2004, 0x2011, 0xb535, 0x2214, 0xd2ac, 0x1110,
+	0xd0bc, 0x0188, 0x00d6, 0xa0e8, 0xb635, 0x2d6c, 0x6810, 0xa085,
+	0x0500, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xb51c, 0x2da6, 0x8d68,
+	0x2da6, 0x00de, 0x0088, 0x00d6, 0xa0e8, 0xb635, 0x2d6c, 0x6810,
+	0xa085, 0x0500, 0x20a2, 0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000,
+	0x2011, 0xb515, 0x2214, 0x22a2, 0x20a3, 0x0889, 0x20a3, 0x0000,
+	0x080c, 0x7d56, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2,
+	0x20a3, 0x0000, 0x20a3, 0x0000, 0x002e, 0x0005, 0x00d6, 0x0156,
+	0x0136, 0x0146, 0x7810, 0xa0ec, 0xf000, 0x0168, 0xa06d, 0x080c,
+	0x5301, 0x0148, 0x684c, 0xa084, 0x2020, 0xa086, 0x2020, 0x1118,
+	0x7820, 0xc0cd, 0x7822, 0x20a1, 0x020b, 0x080c, 0x7b16, 0xa016,
+	0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x7810, 0xa084, 0xf000,
+	0x1130, 0x7810, 0xa084, 0x0700, 0x8007, 0x0043, 0x0010, 0xa006,
+	0x002b, 0x014e, 0x013e, 0x015e, 0x00de, 0x0005, 0x79e8, 0x7a7d,
+	0x7a8d, 0x7abf, 0x7ad2, 0x7aed, 0x7af6, 0x79e6, 0x080c, 0x1515,
+	0x0016, 0x0036, 0x694c, 0xa18c, 0x0003, 0x0118, 0xa186, 0x0003,
+	0x1170, 0x6b78, 0x7820, 0xd0cc, 0x0108, 0xc3e5, 0x23a2, 0x6868,
+	0x20a2, 0x6864, 0x20a2, 0x003e, 0x001e, 0x0804, 0x7ac9, 0xa186,
+	0x0001, 0x190c, 0x1515, 0x6b78, 0x7820, 0xd0cc, 0x0108, 0xc3e5,
+	0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2, 0x22a2, 0x6874, 0x20a2,
+	0x22a2, 0x687c, 0x20a2, 0x2009, 0x0018, 0xa384, 0x0300, 0x0904,
+	0x7a77, 0xd3c4, 0x0110, 0x687c, 0xa108, 0xd3cc, 0x0110, 0x6874,
+	0xa108, 0x0156, 0x20a9, 0x000d, 0xad80, 0x0020, 0x201c, 0x831f,
+	0x23a2, 0x8000, 0x1f04, 0x7a26, 0x015e, 0x22a2, 0x22a2, 0x22a2,
+	0xa184, 0x0003, 0x0904, 0x7a77, 0x20a1, 0x020b, 0x20e1, 0x9080,
+	0x20e1, 0x4000, 0x0006, 0x7818, 0xa080, 0x0028, 0x2004, 0x2011,
+	0xb535, 0x2214, 0xd2ac, 0x1110, 0xd0bc, 0x0188, 0x00d6, 0xa0e8,
+	0xb635, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2, 0x6814, 0x20a2,
+	0x2069, 0xb51c, 0x2da6, 0x8d68, 0x2da6, 0x00de, 0x0088, 0x00d6,
+	0xa0e8, 0xb635, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2, 0x6814,
+	0x20a2, 0x00de, 0x20a3, 0x0000, 0x2011, 0xb515, 0x2214, 0x22a2,
+	0x000e, 0x7b20, 0xd3cc, 0x0118, 0x20a3, 0x0889, 0x0010, 0x20a3,
+	0x0898, 0x20a2, 0x080c, 0x7d56, 0x22a2, 0x20a3, 0x0000, 0x61c2,
+	0x003e, 0x001e, 0x080c, 0x7d67, 0x0005, 0x2011, 0x0008, 0x2001,
+	0xb50d, 0x2004, 0xd0f4, 0x0110, 0x2011, 0x0028, 0x7820, 0xd0cc,
+	0x0108, 0xc2e5, 0x22a2, 0xa016, 0x04d0, 0x2011, 0x0302, 0x0016,
+	0x0036, 0x7828, 0x792c, 0xa11d, 0x0108, 0xc2dd, 0x7b20, 0xd3cc,
+	0x0108, 0xc2e5, 0x22a2, 0x20a2, 0x21a2, 0x003e, 0x001e, 0xa016,
+	0x22a2, 0x20a3, 0x0012, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2,
+	0x22a2, 0x22a2, 0x20a3, 0x7000, 0x20a3, 0x0500, 0x22a2, 0x20a3,
+	0x000a, 0x22a2, 0x22a2, 0x20a3, 0x2500, 0x22a2, 0x22a2, 0x22a2,
+	0x22a2, 0x22a2, 0x60c3, 0x0032, 0x080c, 0x7d67, 0x0005, 0x2011,
+	0x0028, 0x7820, 0xd0cc, 0x0108, 0xc2e5, 0x22a2, 0xa016, 0x22a2,
+	0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0018, 0x080c,
+	0x7d67, 0x0005, 0x2011, 0x0100, 0x7820, 0xd0cc, 0x0108, 0xc2e5,
+	0x22a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x20a3,
+	0x0008, 0x22a2, 0x7854, 0xa084, 0x00ff, 0x20a2, 0x22a2, 0x22a2,
+	0x60c3, 0x0020, 0x080c, 0x7d67, 0x0005, 0x2011, 0x0008, 0x7820,
+	0xd0cc, 0x0108, 0xc2e5, 0x22a2, 0xa016, 0x0888, 0x0036, 0x7b10,
+	0xa384, 0xff00, 0x7812, 0xa384, 0x00ff, 0x8001, 0x1138, 0x7820,
+	0xd0cc, 0x0108, 0xc2e5, 0x22a2, 0x003e, 0x0808, 0x0046, 0x2021,
+	0x0800, 0x0006, 0x7820, 0xd0cc, 0x000e, 0x0108, 0xc4e5, 0x24a2,
+	0x004e, 0x22a2, 0x20a2, 0x003e, 0x0804, 0x7ac9, 0x0026, 0x20e1,
+	0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0x2011,
+	0xb535, 0x2214, 0xd2ac, 0x1110, 0xd0bc, 0x0188, 0x00d6, 0xa0e8,
+	0xb635, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2, 0x6814, 0x20a2,
+	0x2069, 0xb51c, 0x2da6, 0x8d68, 0x2da6, 0x00de, 0x0088, 0x00d6,
+	0xa0e8, 0xb635, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2, 0x6814,
+	0x20a2, 0x00de, 0x20a3, 0x0000, 0x2011, 0xb515, 0x2214, 0x22a2,
+	0x7820, 0xd0cc, 0x0118, 0x20a3, 0x0889, 0x0010, 0x20a3, 0x0898,
+	0x20a3, 0x0000, 0x080c, 0x7d56, 0x22a2, 0x20a3, 0x0000, 0x7a08,
+	0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x002e, 0x0005,
+	0x00d6, 0x0156, 0x0136, 0x0146, 0x0016, 0x0036, 0x7810, 0xa084,
+	0x0700, 0x8007, 0x003b, 0x003e, 0x001e, 0x014e, 0x013e, 0x015e,
+	0x00de, 0x0005, 0x7b7a, 0x7b7a, 0x7b7c, 0x7b7a, 0x7b7a, 0x7b7a,
+	0x7b9e, 0x7b7a, 0x080c, 0x1515, 0x7910, 0xa18c, 0xf8ff, 0xa18d,
+	0x0600, 0x7912, 0x20a1, 0x020b, 0x2009, 0x0003, 0x00f9, 0x00d6,
+	0x2069, 0xb552, 0x6804, 0xd0bc, 0x0130, 0x682c, 0xa084, 0x00ff,
+	0x8007, 0x20a2, 0x0010, 0x20a3, 0x3f00, 0x00de, 0x22a2, 0x22a2,
+	0x22a2, 0x60c3, 0x0001, 0x080c, 0x7d67, 0x0005, 0x20a1, 0x020b,
+	0x2009, 0x0003, 0x0019, 0x20a3, 0x7f00, 0x0c80, 0x0026, 0x20e1,
+	0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0x2011,
+	0xb535, 0x2214, 0xd2ac, 0x1110, 0xd0bc, 0x0188, 0x00d6, 0xa0e8,
+	0xb635, 0x2d6c, 0x6810, 0xa085, 0x0100, 0x20a2, 0x6814, 0x20a2,
+	0x2069, 0xb51c, 0x2da6, 0x8d68, 0x2da6, 0x00de, 0x0088, 0x00d6,
+	0xa0e8, 0xb635, 0x2d6c, 0x6810, 0xa085, 0x0100, 0x20a2, 0x6814,
+	0x20a2, 0x00de, 0x20a3, 0x0000, 0x2011, 0xb515, 0x2214, 0x22a2,
+	0x20a3, 0x0888, 0xa18d, 0x0008, 0x21a2, 0x080c, 0x7d56, 0x22a2,
+	0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x002e, 0x0005, 0x00e6, 0x00d6, 0x00c6, 0x0056, 0x0046,
+	0x0036, 0x2061, 0x0100, 0x2071, 0xb500, 0x7154, 0x7818, 0x2068,
+	0x68a0, 0x2028, 0x76d4, 0xd6ac, 0x1130, 0xd0bc, 0x1120, 0x6910,
+	0x6a14, 0x7454, 0x0020, 0x6910, 0x6a14, 0x7370, 0x7474, 0x781c,
+	0xa0be, 0x0006, 0x0904, 0x7ca1, 0xa0be, 0x000a, 0x15e8, 0xa185,
+	0x0200, 0x6062, 0x6266, 0x636a, 0x646e, 0x6073, 0x2029, 0x6077,
+	0x0000, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a,
+	0x607f, 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086, 0x7810, 0x2070,
+	0x7014, 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca,
+	0x686c, 0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x609f, 0x0000,
+	0x080c, 0x85b9, 0x2009, 0x07d0, 0x60c4, 0xa084, 0xfff0, 0xa005,
+	0x0110, 0x2009, 0x1b58, 0x080c, 0x6a15, 0x003e, 0x004e, 0x005e,
+	0x00ce, 0x00de, 0x00ee, 0x0005, 0x70d4, 0xd0ac, 0x1110, 0xd5bc,
+	0x0138, 0xa185, 0x0100, 0x6062, 0x6266, 0x636a, 0x646e, 0x0038,
+	0xa185, 0x0100, 0x6062, 0x6266, 0x606b, 0x0000, 0x646e, 0x6073,
+	0x0809, 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e,
+	0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086,
+	0x7810, 0x2070, 0x7014, 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6,
+	0x7008, 0x60ca, 0x686c, 0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000,
+	0xa582, 0x0080, 0x0248, 0x6a00, 0xd2f4, 0x0120, 0x6a14, 0xa294,
+	0x00ff, 0x0010, 0x2011, 0x0000, 0x629e, 0x080c, 0x85b9, 0x2009,
+	0x07d0, 0x60c4, 0xa084, 0xfff0, 0xa005, 0x0110, 0x2009, 0x1b58,
+	0x080c, 0x6a15, 0x003e, 0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee,
+	0x0005, 0x7810, 0x2070, 0x704c, 0xa084, 0x0003, 0xa086, 0x0002,
+	0x0904, 0x7cf7, 0x2001, 0xb535, 0x2004, 0xd0ac, 0x1110, 0xd5bc,
+	0x0138, 0xa185, 0x0100, 0x6062, 0x6266, 0x636a, 0x646e, 0x0038,
+	0xa185, 0x0100, 0x6062, 0x6266, 0x606b, 0x0000, 0x646e, 0x6073,
+	0x0880, 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e,
+	0x8007, 0x607a, 0x7834, 0x607e, 0x2f00, 0x6086, 0x7808, 0x6082,
+	0x7060, 0x608a, 0x705c, 0x608e, 0x7080, 0x60c6, 0x707c, 0x60ca,
+	0x707c, 0x792c, 0xa108, 0x792e, 0x7080, 0x7928, 0xa109, 0x792a,
+	0x686c, 0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xa582, 0x0080,
+	0x0248, 0x6a00, 0xd2f4, 0x0120, 0x6a14, 0xa294, 0x00ff, 0x0010,
+	0x2011, 0x0000, 0x629e, 0x080c, 0x85b6, 0x0804, 0x7c8f, 0x2001,
+	0xb535, 0x2004, 0xd0ac, 0x1110, 0xd5bc, 0x0138, 0xa185, 0x0700,
+	0x6062, 0x6266, 0x636a, 0x646e, 0x0038, 0xa185, 0x0700, 0x6062,
+	0x6266, 0x606b, 0x0000, 0x646e, 0x080c, 0x5301, 0x0180, 0x00d6,
+	0x7810, 0xa06d, 0x684c, 0x00de, 0xa084, 0x2020, 0xa086, 0x2020,
+	0x1130, 0x7820, 0xc0cd, 0x7822, 0x6073, 0x0889, 0x0010, 0x6073,
+	0x0898, 0x6077, 0x0000, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e,
+	0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082,
+	0x7014, 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca,
+	0x686c, 0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xa582, 0x0080,
+	0x0248, 0x6a00, 0xd2f4, 0x0120, 0x6a14, 0xa294, 0x00ff, 0x0010,
+	0x2011, 0x0000, 0x629e, 0x7820, 0xd0cc, 0x0120, 0x080c, 0x85b9,
+	0x0804, 0x7c8f, 0x080c, 0x85b6, 0x0804, 0x7c8f, 0x7a18, 0xa280,
+	0x0023, 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202, 0x8217, 0x0005,
+	0x00d6, 0x2069, 0xb7e0, 0x6843, 0x0001, 0x00de, 0x0005, 0x20e1,
+	0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x0019, 0x080c, 0x6a07,
+	0x0005, 0x0006, 0x6014, 0xa084, 0x0004, 0xa085, 0x0009, 0x6016,
+	0x000e, 0x0005, 0x0016, 0x00c6, 0x0006, 0x2061, 0x0100, 0x61a4,
+	0x60a7, 0x95f5, 0x6014, 0xa084, 0x0004, 0xa085, 0x0008, 0x6016,
+	0x000e, 0xe000, 0xe000, 0xe000, 0xe000, 0x61a6, 0x00ce, 0x001e,
+	0x0005, 0x00c6, 0x00d6, 0x0016, 0x0026, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x080c, 0x5acf, 0x1198, 0x2001, 0xb7fc, 0x2004, 0xa005,
+	0x15b8, 0x0066, 0x2031, 0x0001, 0x080c, 0x5b51, 0x006e, 0x1118,
+	0x080c, 0x6a07, 0x0468, 0x00c6, 0x2061, 0xb7e0, 0x00d8, 0x6904,
+	0xa194, 0x4000, 0x0550, 0x0831, 0x6803, 0x1000, 0x6803, 0x0000,
+	0x00c6, 0x2061, 0xb7e0, 0x6128, 0xa192, 0x00c8, 0x1258, 0x8108,
+	0x612a, 0x6124, 0x00ce, 0x81ff, 0x0198, 0x080c, 0x6a07, 0x080c,
+	0x7d71, 0x0070, 0x6124, 0xa1e5, 0x0000, 0x0140, 0x080c, 0xb444,
+	0x080c, 0x6a10, 0x2009, 0x0014, 0x080c, 0x864c, 0x00ce, 0x0000,
+	0x002e, 0x001e, 0x00de, 0x00ce, 0x0005, 0x2001, 0xb7fc, 0x2004,
+	0xa005, 0x1db0, 0x00c6, 0x2061, 0xb7e0, 0x6128, 0xa192, 0x0003,
+	0x1e08, 0x8108, 0x612a, 0x00ce, 0x080c, 0x6a07, 0x080c, 0x4b1f,
+	0x0c38, 0x00c6, 0x00d6, 0x00e6, 0x0016, 0x0026, 0x080c, 0x6a1d,
+	0x2071, 0xb7e0, 0x713c, 0x81ff, 0x0590, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x080c, 0x5acf, 0x11a8, 0x0036, 0x2019, 0x0002, 0x080c,
+	0x7fe4, 0x003e, 0x713c, 0x2160, 0x080c, 0xb444, 0x2009, 0x004a,
+	0x080c, 0x864c, 0x0066, 0x2031, 0x0001, 0x080c, 0x5b51, 0x006e,
+	0x00b0, 0x6904, 0xa194, 0x4000, 0x01c0, 0x6803, 0x1000, 0x6803,
+	0x0000, 0x0036, 0x2019, 0x0001, 0x080c, 0x7fe4, 0x003e, 0x713c,
+	0x2160, 0x080c, 0xb444, 0x2009, 0x004a, 0x080c, 0x864c, 0x002e,
+	0x001e, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x0c58, 0x0026, 0x00e6,
+	0x2071, 0xb7e0, 0x7048, 0xd084, 0x01c0, 0x713c, 0x81ff, 0x01a8,
+	0x2071, 0x0100, 0xa188, 0x0007, 0x2114, 0xa28e, 0x0006, 0x1138,
+	0x7014, 0xa084, 0x0184, 0xa085, 0x0012, 0x7016, 0x0030, 0x7014,
+	0xa084, 0x0184, 0xa085, 0x0016, 0x7016, 0x00ee, 0x002e, 0x0005,
+	0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0056, 0x0046, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x6018, 0x2068, 0x6ca0, 0x2071, 0xb7e0, 0x7018,
+	0x2068, 0x8dff, 0x0188, 0x68a0, 0xa406, 0x0118, 0x6854, 0x2068,
+	0x0cc0, 0x6010, 0x2060, 0x643c, 0x6540, 0x6648, 0x2d60, 0x080c,
+	0x511a, 0x0110, 0xa085, 0x0001, 0x012e, 0x000e, 0x004e, 0x005e,
+	0x006e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x20a1, 0x020b, 0x080c,
+	0x7641, 0x20a3, 0x1200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x781c,
+	0xa086, 0x0004, 0x1110, 0x6098, 0x0018, 0x2001, 0xb515, 0x2004,
+	0x20a2, 0x7834, 0x20a2, 0x7838, 0x20a2, 0x20a9, 0x0010, 0xa006,
+	0x20a2, 0x1f04, 0x7ea0, 0x20a2, 0x20a2, 0x60c3, 0x002c, 0x080c,
+	0x7d67, 0x0005, 0x0156, 0x0146, 0x20a1, 0x020b, 0x080c, 0x7641,
+	0x20a3, 0x0f00, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2,
+	0x60c3, 0x0008, 0x080c, 0x7d67, 0x014e, 0x015e, 0x0005, 0x0156,
+	0x0146, 0x20a1, 0x020b, 0x080c, 0x76dd, 0x20a3, 0x0200, 0x20a3,
+	0x0000, 0x20a9, 0x0006, 0x2011, 0xb540, 0x2019, 0xb541, 0x23a6,
+	0x22a6, 0xa398, 0x0002, 0xa290, 0x0002, 0x1f04, 0x7ecf, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x080c, 0x7d67, 0x014e,
+	0x015e, 0x0005, 0x0156, 0x0146, 0x0016, 0x0026, 0x20a1, 0x020b,
+	0x080c, 0x76b6, 0x080c, 0x76cc, 0x7810, 0xa080, 0x0000, 0x2004,
+	0xa080, 0x0015, 0x2098, 0x7808, 0xa088, 0x0002, 0x21a8, 0x53a6,
+	0xa080, 0x0004, 0x8003, 0x60c2, 0x080c, 0x7d67, 0x002e, 0x001e,
+	0x014e, 0x015e, 0x0005, 0x0156, 0x0146, 0x20a1, 0x020b, 0x080c,
+	0x7641, 0x20a3, 0x6200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808,
+	0x20a2, 0x60c3, 0x0008, 0x080c, 0x7d67, 0x014e, 0x015e, 0x0005,
+	0x0156, 0x0146, 0x0016, 0x0026, 0x20a1, 0x020b, 0x080c, 0x7641,
+	0x7810, 0xa080, 0x0000, 0x2004, 0xa080, 0x0017, 0x2098, 0x7808,
+	0xa088, 0x0002, 0x21a8, 0x53a6, 0x8003, 0x60c2, 0x080c, 0x7d67,
+	0x002e, 0x001e, 0x014e, 0x015e, 0x0005, 0x00e6, 0x00c6, 0x0006,
+	0x0126, 0x2091, 0x8000, 0x2071, 0xb7e0, 0x700c, 0x2060, 0x8cff,
+	0x0178, 0x080c, 0x9e58, 0x1110, 0x080c, 0x8c19, 0x600c, 0x0006,
+	0x080c, 0xa01f, 0x080c, 0x861d, 0x080c, 0x811e, 0x00ce, 0x0c78,
+	0x700f, 0x0000, 0x700b, 0x0000, 0x012e, 0x000e, 0x00ce, 0x00ee,
+	0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0026,
+	0x0016, 0x0006, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079, 0x0140,
+	0x2071, 0xb7e0, 0x7024, 0x2060, 0x8cff, 0x05a0, 0x080c, 0x7d7a,
+	0x68c3, 0x0000, 0x080c, 0x6a10, 0x2009, 0x0013, 0x080c, 0x864c,
+	0x20a9, 0x01f4, 0x6824, 0xd094, 0x0158, 0x6827, 0x0004, 0x7804,
+	0xa084, 0x4000, 0x01a0, 0x7803, 0x1000, 0x7803, 0x0000, 0x0078,
+	0xd084, 0x0118, 0x6827, 0x0001, 0x0010, 0x1f04, 0x7f7a, 0x7804,
+	0xa084, 0x1000, 0x0120, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824,
+	0x000e, 0x001e, 0x002e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e,
+	0x012e, 0x0005, 0x2001, 0xb500, 0x2004, 0xa096, 0x0001, 0x0590,
+	0xa096, 0x0004, 0x0578, 0x080c, 0x6a10, 0x6814, 0xa084, 0x0001,
+	0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011,
+	0x4adc, 0x080c, 0x699c, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0158,
+	0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x01a0, 0x7803, 0x1000,
+	0x7803, 0x0000, 0x0078, 0xd084, 0x0118, 0x6827, 0x0001, 0x0010,
+	0x1f04, 0x7fbd, 0x7804, 0xa084, 0x1000, 0x0120, 0x7803, 0x0100,
+	0x7803, 0x0000, 0x000e, 0x001e, 0x002e, 0x00ce, 0x00de, 0x00ee,
+	0x00fe, 0x015e, 0x012e, 0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6,
+	0x00d6, 0x00c6, 0x0026, 0x0016, 0x0006, 0x2091, 0x8000, 0x2069,
+	0x0100, 0x2079, 0x0140, 0x2071, 0xb7e0, 0x703c, 0x2060, 0x8cff,
+	0x0904, 0x806b, 0xa386, 0x0002, 0x1128, 0x6814, 0xa084, 0x0002,
+	0x0904, 0x806b, 0x68af, 0x95f5, 0x6817, 0x0010, 0x2009, 0x00fa,
+	0x8109, 0x1df0, 0x68c7, 0x0000, 0x68cb, 0x0008, 0x080c, 0x6a1d,
+	0x080c, 0x220c, 0x0046, 0x2009, 0x017f, 0x200b, 0x00a5, 0x2021,
+	0x0169, 0x2404, 0xa084, 0x000f, 0xa086, 0x0004, 0x1500, 0x68af,
+	0x95f5, 0x68c7, 0x0000, 0x68cb, 0x0008, 0x00e6, 0x00f6, 0x2079,
+	0x0020, 0x2071, 0xb84a, 0x6814, 0xa084, 0x0184, 0xa085, 0x0012,
+	0x6816, 0x7803, 0x0008, 0x7003, 0x0000, 0x00fe, 0x00ee, 0xa386,
+	0x0002, 0x1128, 0x7884, 0xa005, 0x1110, 0x7887, 0x0001, 0x2001,
+	0xb7b1, 0x2004, 0x200a, 0x004e, 0xa39d, 0x0000, 0x1120, 0x2009,
+	0x0049, 0x080c, 0x864c, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0158,
+	0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x01a0, 0x7803, 0x1000,
+	0x7803, 0x0000, 0x0078, 0xd08c, 0x0118, 0x6827, 0x0002, 0x0010,
+	0x1f04, 0x804d, 0x7804, 0xa084, 0x1000, 0x0120, 0x7803, 0x0100,
+	0x7803, 0x0000, 0x6824, 0x000e, 0x001e, 0x002e, 0x00ce, 0x00de,
+	0x00ee, 0x00fe, 0x015e, 0x012e, 0x0005, 0x00d6, 0x0126, 0x2091,
+	0x8000, 0x2069, 0xb7e0, 0x6a06, 0x012e, 0x00de, 0x0005, 0x00d6,
+	0x0126, 0x2091, 0x8000, 0x2069, 0xb7e0, 0x6a32, 0x012e, 0x00de,
+	0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0066, 0x0006, 0x0126, 0x2071,
+	0xb7e0, 0x7614, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0538,
+	0x601c, 0xa206, 0x1500, 0x7014, 0xac36, 0x1110, 0x660c, 0x7616,
+	0x7010, 0xac36, 0x1140, 0x2c00, 0xaf36, 0x0118, 0x2f00, 0x7012,
+	0x0010, 0x7013, 0x0000, 0x660c, 0x0066, 0x2c00, 0xaf06, 0x0110,
+	0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0x9e1d, 0x080c,
+	0x811e, 0x00ce, 0x08d8, 0x2c78, 0x600c, 0x2060, 0x08b8, 0x012e,
+	0x000e, 0x006e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0156, 0x0146,
+	0x20a1, 0x020b, 0x080c, 0x7902, 0x7810, 0x20a2, 0xa006, 0x20a2,
+	0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x1000, 0x0804, 0x8116, 0x0156,
+	0x0146, 0x20a1, 0x020b, 0x080c, 0x7902, 0x7810, 0x20a2, 0xa006,
+	0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x4000, 0x0478, 0x0156,
+	0x0146, 0x20a1, 0x020b, 0x080c, 0x7902, 0x7810, 0x20a2, 0xa006,
+	0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x2000, 0x00f8, 0x0156,
+	0x0146, 0x20a1, 0x020b, 0x080c, 0x7902, 0x7810, 0x20a2, 0xa006,
+	0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0400, 0x0078, 0x0156,
+	0x0146, 0x20a1, 0x020b, 0x080c, 0x7902, 0x7810, 0x20a2, 0xa006,
+	0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0200, 0x0089, 0x60c3,
+	0x0020, 0x080c, 0x7d67, 0x014e, 0x015e, 0x0005, 0x00e6, 0x2071,
+	0xb7e0, 0x7020, 0xa005, 0x0110, 0x8001, 0x7022, 0x00ee, 0x0005,
+	0x20a9, 0x0008, 0x20a2, 0x1f04, 0x812a, 0x20a2, 0x20a2, 0x0005,
+	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x2071, 0xb7e0, 0x7614, 0x2660, 0x2678, 0x2039,
+	0x0001, 0x87ff, 0x0904, 0x81c6, 0x8cff, 0x0904, 0x81c6, 0x601c,
+	0xa086, 0x0006, 0x1904, 0x81c1, 0x88ff, 0x0138, 0x2800, 0xac06,
+	0x1904, 0x81c1, 0x2039, 0x0000, 0x0050, 0x6018, 0xa206, 0x1904,
+	0x81c1, 0x85ff, 0x0120, 0x6050, 0xa106, 0x1904, 0x81c1, 0x7024,
+	0xac06, 0x1598, 0x2069, 0x0100, 0x68c0, 0xa005, 0x1160, 0x6824,
+	0xd084, 0x0148, 0x6827, 0x0001, 0x080c, 0x6a10, 0x080c, 0x824d,
+	0x7027, 0x0000, 0x0410, 0x080c, 0x6a10, 0x6820, 0xd0b4, 0x0110,
+	0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000, 0x080c, 0x824d,
+	0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000,
+	0x0120, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824,
+	0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x7014, 0xac36, 0x1110,
+	0x660c, 0x7616, 0x7010, 0xac36, 0x1140, 0x2c00, 0xaf36, 0x0118,
+	0x2f00, 0x7012, 0x0010, 0x7013, 0x0000, 0x660c, 0x0066, 0x2c00,
+	0xaf06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x89ff, 0x1158, 0x600f,
+	0x0000, 0x6010, 0x2068, 0x080c, 0x9c5a, 0x0110, 0x080c, 0xb099,
+	0x080c, 0x9e1d, 0x080c, 0x811e, 0x88ff, 0x1190, 0x00ce, 0x0804,
+	0x8141, 0x2c78, 0x600c, 0x2060, 0x0804, 0x8141, 0xa006, 0x012e,
+	0x000e, 0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005,
+	0x6017, 0x0000, 0x00ce, 0xa8c5, 0x0001, 0x0c88, 0x00f6, 0x00e6,
+	0x00d6, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000,
+	0x2071, 0xb7e0, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0904, 0x823d,
+	0x601c, 0xa086, 0x0006, 0x1904, 0x8238, 0x87ff, 0x0128, 0x2700,
+	0xac06, 0x1904, 0x8238, 0x0048, 0x6018, 0xa206, 0x1904, 0x8238,
+	0x85ff, 0x0118, 0x6050, 0xa106, 0x15d8, 0x703c, 0xac06, 0x1180,
+	0x0036, 0x2019, 0x0001, 0x080c, 0x7fe4, 0x7033, 0x0000, 0x703f,
+	0x0000, 0x7043, 0x0000, 0x7047, 0x0000, 0x704b, 0x0000, 0x003e,
+	0x7038, 0xac36, 0x1110, 0x660c, 0x763a, 0x7034, 0xac36, 0x1140,
+	0x2c00, 0xaf36, 0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000,
+	0x660c, 0x0066, 0x2c00, 0xaf06, 0x0110, 0x7e0e, 0x0008, 0x2678,
+	0x600f, 0x0000, 0x6010, 0x2068, 0x080c, 0x9c5a, 0x0110, 0x080c,
+	0xb099, 0x080c, 0x9e1d, 0x87ff, 0x1190, 0x00ce, 0x0804, 0x81e5,
+	0x2c78, 0x600c, 0x2060, 0x0804, 0x81e5, 0xa006, 0x012e, 0x000e,
+	0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x6017,
+	0x0000, 0x00ce, 0xa7bd, 0x0001, 0x0c88, 0x00e6, 0x2071, 0xb7e0,
+	0x2001, 0xb500, 0x2004, 0xa086, 0x0002, 0x1118, 0x7007, 0x0005,
+	0x0010, 0x7007, 0x0000, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00c6,
+	0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0xb7e0,
+	0x2c10, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0518, 0x2200, 0xac06,
+	0x11e0, 0x7038, 0xac36, 0x1110, 0x660c, 0x763a, 0x7034, 0xac36,
+	0x1140, 0x2c00, 0xaf36, 0x0118, 0x2f00, 0x7036, 0x0010, 0x7037,
+	0x0000, 0x660c, 0x2c00, 0xaf06, 0x0110, 0x7e0e, 0x0008, 0x2678,
+	0x600f, 0x0000, 0xa085, 0x0001, 0x0020, 0x2c78, 0x600c, 0x2060,
+	0x08d8, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x00ee, 0x00fe,
+	0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x2071, 0xb7e0, 0x760c, 0x2660, 0x2678, 0x8cff,
+	0x0904, 0x8323, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x1904,
+	0x831e, 0x7024, 0xac06, 0x1508, 0x2069, 0x0100, 0x68c0, 0xa005,
+	0x0904, 0x82fa, 0x080c, 0x7d7a, 0x68c3, 0x0000, 0x080c, 0x824d,
+	0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000,
+	0x0120, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824,
+	0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x700c, 0xac36, 0x1110,
+	0x660c, 0x760e, 0x7008, 0xac36, 0x1140, 0x2c00, 0xaf36, 0x0118,
+	0x2f00, 0x700a, 0x0010, 0x700b, 0x0000, 0x660c, 0x0066, 0x2c00,
+	0xaf06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c,
+	0x9e47, 0x1158, 0x080c, 0x2cc2, 0x080c, 0x9e58, 0x11f0, 0x080c,
+	0x8c19, 0x00d8, 0x080c, 0x824d, 0x08c0, 0x080c, 0x9e58, 0x1118,
+	0x080c, 0x8c19, 0x0090, 0x6010, 0x2068, 0x080c, 0x9c5a, 0x0168,
+	0x601c, 0xa086, 0x0003, 0x11f8, 0x6837, 0x0103, 0x6b4a, 0x6847,
+	0x0000, 0x080c, 0x5408, 0x080c, 0x9e11, 0x080c, 0xa01f, 0x080c,
+	0x9e1d, 0x080c, 0x811e, 0x00ce, 0x0804, 0x82a7, 0x2c78, 0x600c,
+	0x2060, 0x0804, 0x82a7, 0x012e, 0x000e, 0x006e, 0x00ce, 0x00de,
+	0x00ee, 0x00fe, 0x0005, 0x601c, 0xa086, 0x0006, 0x1d30, 0x080c,
+	0xb099, 0x0c18, 0x0036, 0x0156, 0x0136, 0x0146, 0x3908, 0xa006,
+	0xa190, 0x0020, 0x221c, 0xa39e, 0x2ab7, 0x1118, 0x8210, 0x8000,
+	0x0cc8, 0xa005, 0x0138, 0x20a9, 0x0020, 0x2198, 0xa110, 0x22a0,
+	0x22c8, 0x53a3, 0x014e, 0x013e, 0x015e, 0x003e, 0x0005, 0x00d6,
+	0x20a1, 0x020b, 0x080c, 0x76dd, 0x20a3, 0x0200, 0x20a3, 0x0014,
+	0x60c3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x2099, 0xb7b9,
+	0x20a9, 0x0004, 0x53a6, 0x20a3, 0x0004, 0x20a3, 0x7878, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x080c, 0x7d67, 0x00de, 0x0005, 0x20a1,
+	0x020b, 0x080c, 0x76dd, 0x20a3, 0x0214, 0x20a3, 0x0018, 0x20a3,
+	0x0800, 0x7810, 0xa084, 0xff00, 0x20a2, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7810, 0xa084, 0x00ff,
+	0x20a2, 0x7828, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
+	0x0018, 0x080c, 0x7d67, 0x0005, 0x00d6, 0x0016, 0x2f68, 0x2009,
+	0x0035, 0x080c, 0xa10a, 0x1904, 0x8402, 0x20a1, 0x020b, 0x080c,
+	0x7641, 0x20a3, 0x1300, 0x20a3, 0x0000, 0x7828, 0x2068, 0x681c,
+	0xa086, 0x0003, 0x0580, 0x7818, 0xa080, 0x0028, 0x2014, 0x2001,
+	0xb535, 0x2004, 0xd0ac, 0x11d0, 0xa286, 0x007e, 0x1128, 0x20a3,
+	0x00ff, 0x20a3, 0xfffe, 0x04b8, 0xa286, 0x007f, 0x1128, 0x20a3,
+	0x00ff, 0x20a3, 0xfffd, 0x0478, 0xd2bc, 0x0180, 0xa286, 0x0080,
+	0x1128, 0x20a3, 0x00ff, 0x20a3, 0xfffc, 0x0428, 0xa2e8, 0xb635,
+	0x2d6c, 0x6810, 0x20a2, 0x6814, 0x20a2, 0x00e8, 0x20a3, 0x0000,
+	0x6098, 0x20a2, 0x00c0, 0x2001, 0xb535, 0x2004, 0xd0ac, 0x1138,
+	0x7818, 0xa080, 0x0028, 0x2004, 0xa082, 0x007e, 0x0240, 0x00d6,
+	0x2069, 0xb51c, 0x2da6, 0x8d68, 0x2da6, 0x00de, 0x0020, 0x20a3,
+	0x0000, 0x6034, 0x20a2, 0x7834, 0x20a2, 0x7838, 0x20a2, 0x20a3,
+	0x0000, 0x20a3, 0x0000, 0x60c3, 0x000c, 0x080c, 0x7d67, 0x001e,
+	0x00de, 0x0005, 0x7817, 0x0001, 0x7803, 0x0006, 0x001e, 0x00de,
+	0x0005, 0x00d6, 0x0026, 0x7928, 0x2168, 0x691c, 0xa186, 0x0006,
+	0x01c0, 0xa186, 0x0003, 0x0904, 0x8478, 0xa186, 0x0005, 0x0904,
+	0x8461, 0xa186, 0x0004, 0x05b8, 0xa186, 0x0008, 0x0904, 0x8469,
+	0x7807, 0x0037, 0x7813, 0x1700, 0x080c, 0x84e0, 0x002e, 0x00de,
+	0x0005, 0x080c, 0x849c, 0x2009, 0x4000, 0x6800, 0x0002, 0x8442,
+	0x844d, 0x8444, 0x844d, 0x8449, 0x8442, 0x8442, 0x844d, 0x844d,
+	0x844d, 0x844d, 0x8442, 0x8442, 0x8442, 0x8442, 0x8442, 0x844d,
+	0x8442, 0x844d, 0x080c, 0x1515, 0x6820, 0xd0e4, 0x0110, 0xd0cc,
+	0x0110, 0xa00e, 0x0010, 0x2009, 0x2000, 0x6828, 0x20a2, 0x682c,
+	0x20a2, 0x0804, 0x8492, 0x080c, 0x849c, 0x20a3, 0x0000, 0x20a3,
+	0x0000, 0x2009, 0x4000, 0x6a00, 0xa286, 0x0002, 0x1108, 0xa00e,
+	0x0488, 0x04d1, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x2009, 0x4000,
+	0x0448, 0x0491, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x2009, 0x4000,
+	0xa286, 0x0005, 0x0118, 0xa286, 0x0002, 0x1108, 0xa00e, 0x00d0,
+	0x0419, 0x6810, 0x2068, 0x697c, 0x6810, 0xa112, 0x6980, 0x6814,
+	0xa103, 0x20a2, 0x22a2, 0x7928, 0xa180, 0x0000, 0x2004, 0xa08e,
+	0x0002, 0x0130, 0xa08e, 0x0004, 0x0118, 0x2009, 0x4000, 0x0010,
+	0x2009, 0x0000, 0x21a2, 0x20a3, 0x0000, 0x60c3, 0x0018, 0x080c,
+	0x7d67, 0x002e, 0x00de, 0x0005, 0x0036, 0x0046, 0x0056, 0x0066,
+	0x20a1, 0x020b, 0x080c, 0x76dd, 0xa006, 0x20a3, 0x0200, 0x20a2,
+	0x7934, 0x21a2, 0x7938, 0x21a2, 0x7818, 0xa080, 0x0028, 0x2004,
+	0x2011, 0xb535, 0x2214, 0xd2ac, 0x1118, 0xa092, 0x007e, 0x0268,
+	0x00d6, 0x2069, 0xb51c, 0x2d2c, 0x8d68, 0x2d34, 0xa0e8, 0xb635,
+	0x2d6c, 0x6b10, 0x6c14, 0x00de, 0x0030, 0x2019, 0x0000, 0x6498,
+	0x2029, 0x0000, 0x6634, 0x7828, 0xa080, 0x0007, 0x2004, 0xa086,
+	0x0003, 0x1128, 0x25a2, 0x26a2, 0x23a2, 0x24a2, 0x0020, 0x23a2,
+	0x24a2, 0x25a2, 0x26a2, 0x006e, 0x005e, 0x004e, 0x003e, 0x0005,
+	0x20a1, 0x020b, 0x080c, 0x76dd, 0x20a3, 0x0100, 0x20a3, 0x0000,
+	0x20a3, 0x0009, 0x7810, 0x20a2, 0x60c3, 0x0008, 0x080c, 0x7d67,
+	0x0005, 0x20a1, 0x020b, 0x080c, 0x7639, 0x20a3, 0x1400, 0x20a3,
+	0x0000, 0x7834, 0x20a2, 0x7838, 0x20a2, 0x7828, 0x20a2, 0x782c,
+	0x20a2, 0x7830, 0xa084, 0x00ff, 0x8007, 0x20a2, 0x20a3, 0x0000,
+	0x60c3, 0x0010, 0x080c, 0x7d67, 0x0005, 0x20a1, 0x020b, 0x080c,
+	0x76d5, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x7828, 0x20a2, 0x7810,
+	0x20a2, 0x60c3, 0x0008, 0x080c, 0x7d67, 0x0005, 0x0146, 0x20a1,
+	0x020b, 0x0031, 0x60c3, 0x0000, 0x080c, 0x7d67, 0x014e, 0x0005,
+	0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004,
+	0x2011, 0xb535, 0x2214, 0xd2ac, 0x1110, 0xd0bc, 0x0188, 0x00d6,
+	0xa0e8, 0xb635, 0x2d6c, 0x6810, 0xa085, 0x0300, 0x20a2, 0x6814,
+	0x20a2, 0x2069, 0xb51c, 0x2da6, 0x8d68, 0x2da6, 0x00de, 0x0078,
+	0x00d6, 0xa0e8, 0xb635, 0x2d6c, 0x6810, 0xa085, 0x0300, 0x20a2,
+	0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000, 0x6234, 0x22a2, 0x20a3,
+	0x0819, 0x20a3, 0x0000, 0x080c, 0x7d56, 0x22a2, 0x20a3, 0x0000,
+	0x2fa2, 0x7a08, 0x22a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x0005,
+	0x20a1, 0x020b, 0x0079, 0x7910, 0x21a2, 0x20a3, 0x0000, 0x60c3,
+	0x0000, 0x20e1, 0x9080, 0x60a7, 0x9575, 0x080c, 0x7d71, 0x080c,
+	0x6a07, 0x0005, 0x0156, 0x0136, 0x0036, 0x00d6, 0x00e6, 0x20e1,
+	0x9080, 0x20e1, 0x4000, 0x7854, 0x2068, 0xadf0, 0x000f, 0x7210,
+	0xa296, 0x00c0, 0xa294, 0xfffd, 0x7212, 0x7214, 0xa294, 0x0300,
+	0x7216, 0x7100, 0xa194, 0x00ff, 0x7308, 0xa384, 0x00ff, 0xa08d,
+	0xc200, 0x7102, 0xa384, 0xff00, 0xa215, 0x720a, 0x7004, 0x720c,
+	0x700e, 0x7206, 0x20a9, 0x000a, 0x2e98, 0x53a6, 0x60a3, 0x0035,
+	0x6a38, 0xa294, 0x7000, 0xa286, 0x3000, 0x0110, 0x60a3, 0x0037,
+	0x00ee, 0x00de, 0x003e, 0x013e, 0x015e, 0x0005, 0x2009, 0x0092,
+	0x0010, 0x2009, 0x0096, 0x60ab, 0x0036, 0x6116, 0x0005, 0x2061,
+	0xbd00, 0x2a70, 0x7068, 0x704a, 0x704f, 0xbd00, 0x0005, 0x00e6,
+	0x0126, 0x2071, 0xb500, 0x2091, 0x8000, 0x7548, 0xa582, 0x0010,
+	0x0608, 0x704c, 0x2060, 0x6000, 0xa086, 0x0000, 0x0148, 0xace0,
+	0x0018, 0x705c, 0xac02, 0x1208, 0x0cb0, 0x2061, 0xbd00, 0x0c98,
+	0x6003, 0x0008, 0x8529, 0x754a, 0xaca8, 0x0018, 0x705c, 0xa502,
+	0x1230, 0x754e, 0xa085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x704f,
+	0xbd00, 0x0cc0, 0xa006, 0x0cc0, 0x00e6, 0x2071, 0xb500, 0x7548,
+	0xa582, 0x0010, 0x0600, 0x704c, 0x2060, 0x6000, 0xa086, 0x0000,
+	0x0148, 0xace0, 0x0018, 0x705c, 0xac02, 0x1208, 0x0cb0, 0x2061,
+	0xbd00, 0x0c98, 0x6003, 0x0008, 0x8529, 0x754a, 0xaca8, 0x0018,
+	0x705c, 0xa502, 0x1228, 0x754e, 0xa085, 0x0001, 0x00ee, 0x0005,
+	0x704f, 0xbd00, 0x0cc8, 0xa006, 0x0cc8, 0xac82, 0xbd00, 0x0a0c,
+	0x1515, 0x2001, 0xb517, 0x2004, 0xac02, 0x1a0c, 0x1515, 0xa006,
+	0x6006, 0x600a, 0x600e, 0x6012, 0x6016, 0x601a, 0x601f, 0x0000,
+	0x6003, 0x0000, 0x6052, 0x6056, 0x6022, 0x6026, 0x602a, 0x602e,
+	0x6032, 0x6036, 0x603a, 0x603e, 0x2061, 0xb500, 0x6048, 0x8000,
+	0x604a, 0xa086, 0x0001, 0x0108, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x7173, 0x012e, 0x0cc0, 0x601c, 0xa084, 0x000f, 0x0002,
+	0x865b, 0x866a, 0x8685, 0x86a0, 0xa152, 0xa16d, 0xa188, 0x865b,
+	0x866a, 0x865b, 0x86bb, 0xa186, 0x0013, 0x1128, 0x080c, 0x7090,
+	0x080c, 0x7173, 0x0005, 0xa18e, 0x0047, 0x1118, 0xa016, 0x080c,
+	0x185e, 0x0005, 0x0066, 0x6000, 0xa0b2, 0x0010, 0x1a0c, 0x1515,
+	0x0013, 0x006e, 0x0005, 0x8683, 0x8a9b, 0x8c53, 0x8683, 0x8cc8,
+	0x8779, 0x8683, 0x8683, 0x8a2d, 0x90ef, 0x8683, 0x8683, 0x8683,
+	0x8683, 0x8683, 0x8683, 0x080c, 0x1515, 0x0066, 0x6000, 0xa0b2,
+	0x0010, 0x1a0c, 0x1515, 0x0013, 0x006e, 0x0005, 0x869e, 0x9722,
+	0x869e, 0x869e, 0x869e, 0x869e, 0x869e, 0x869e, 0x96cd, 0x988e,
+	0x869e, 0x974f, 0x97c6, 0x974f, 0x97c6, 0x869e, 0x080c, 0x1515,
+	0x0066, 0x6000, 0xa0b2, 0x0010, 0x1a0c, 0x1515, 0x0013, 0x006e,
+	0x0005, 0x86b9, 0x9130, 0x91fa, 0x9335, 0x9491, 0x86b9, 0x86b9,
+	0x86b9, 0x910a, 0x967d, 0x9680, 0x86b9, 0x86b9, 0x86b9, 0x86b9,
+	0x96aa, 0x080c, 0x1515, 0x0066, 0x6000, 0xa0b2, 0x0010, 0x1a0c,
+	0x1515, 0x0013, 0x006e, 0x0005, 0x86d4, 0x86d4, 0x86d4, 0x8702,
+	0x874f, 0x86d4, 0x86d4, 0x86d4, 0x86d6, 0x86d4, 0x86d4, 0x86d4,
+	0x86d4, 0x86d4, 0x86d4, 0x86d4, 0x080c, 0x1515, 0xa186, 0x0003,
+	0x190c, 0x1515, 0x00d6, 0x6003, 0x0003, 0x6106, 0x6010, 0x2068,
+	0x684f, 0x0040, 0x687c, 0x680a, 0x6880, 0x680e, 0x6813, 0x0000,
+	0x6817, 0x0000, 0x6854, 0xa092, 0x199a, 0x0210, 0x2001, 0x1999,
+	0x8003, 0x8013, 0x8213, 0xa210, 0x6216, 0x00de, 0x2c10, 0x080c,
+	0x1fa9, 0x080c, 0x6cf0, 0x0126, 0x2091, 0x8000, 0x080c, 0x7230,
+	0x012e, 0x0005, 0xa182, 0x0047, 0x0002, 0x870e, 0x870e, 0x8710,
+	0x8729, 0x870e, 0x870e, 0x870e, 0x870e, 0x873b, 0x080c, 0x1515,
+	0x00d6, 0x0016, 0x080c, 0x7126, 0x080c, 0x7230, 0x6003, 0x0004,
+	0x6110, 0x2168, 0x684f, 0x0020, 0x685c, 0x685a, 0x6874, 0x687e,
+	0x6878, 0x6882, 0x6897, 0x0000, 0x689b, 0x0000, 0x001e, 0x00de,
+	0x0005, 0x080c, 0x7126, 0x00d6, 0x6110, 0x2168, 0x080c, 0x9c5a,
+	0x0120, 0x684b, 0x0006, 0x080c, 0x5408, 0x00de, 0x080c, 0x861d,
+	0x080c, 0x7230, 0x0005, 0x080c, 0x7126, 0x080c, 0x2c9c, 0x00d6,
+	0x6110, 0x2168, 0x080c, 0x9c5a, 0x0120, 0x684b, 0x0029, 0x080c,
+	0x5408, 0x00de, 0x080c, 0x861d, 0x080c, 0x7230, 0x0005, 0xa182,
+	0x0047, 0x0002, 0x875d, 0x876c, 0x875b, 0x875b, 0x875b, 0x875b,
+	0x875b, 0x875b, 0x875b, 0x080c, 0x1515, 0x00d6, 0x6010, 0x2068,
+	0x684c, 0xc0f4, 0x684e, 0x00de, 0x20e1, 0x0005, 0x3d18, 0x3e20,
+	0x2c10, 0x080c, 0x185e, 0x0005, 0x00d6, 0x6110, 0x2168, 0x684b,
+	0x0000, 0x6853, 0x0000, 0x080c, 0x5408, 0x00de, 0x080c, 0x861d,
+	0x0005, 0xa1b6, 0x0015, 0x1118, 0x080c, 0x861d, 0x0030, 0xa1b6,
+	0x0016, 0x190c, 0x1515, 0x080c, 0x861d, 0x0005, 0x20a9, 0x000e,
+	0x2e98, 0x6010, 0x20a0, 0x53a3, 0x20a9, 0x0006, 0x3310, 0x3420,
+	0x9398, 0x94a0, 0x3318, 0x3428, 0x222e, 0x2326, 0xa290, 0x0002,
+	0xa5a8, 0x0002, 0xa398, 0x0002, 0xa4a0, 0x0002, 0x1f04, 0x8794,
+	0x00e6, 0x080c, 0x9c5a, 0x0130, 0x6010, 0x2070, 0x7007, 0x0000,
+	0x7037, 0x0103, 0x00ee, 0x080c, 0x861d, 0x0005, 0x00d6, 0x0036,
+	0x7330, 0xa386, 0x0200, 0x1130, 0x6018, 0x2068, 0x6813, 0x00ff,
+	0x6817, 0xfffd, 0x6010, 0xa005, 0x0130, 0x2068, 0x6807, 0x0000,
+	0x6837, 0x0103, 0x6b32, 0x080c, 0x861d, 0x003e, 0x00de, 0x0005,
+	0x0016, 0x20a9, 0x002a, 0xae80, 0x000c, 0x2098, 0x6010, 0xa080,
+	0x0002, 0x20a0, 0x53a3, 0x20a9, 0x002a, 0x6010, 0xa080, 0x0001,
+	0x2004, 0xa080, 0x0002, 0x20a0, 0x53a3, 0x00e6, 0x6010, 0x2004,
+	0x2070, 0x7037, 0x0103, 0x00ee, 0x080c, 0x861d, 0x001e, 0x0005,
+	0x0016, 0x2009, 0x0000, 0x7030, 0xa086, 0x0100, 0x0140, 0x7038,
+	0xa084, 0x00ff, 0x800c, 0x703c, 0xa084, 0x00ff, 0x8004, 0xa080,
+	0x0004, 0xa108, 0x21a8, 0xae80, 0x000c, 0x2098, 0x6010, 0xa080,
+	0x0002, 0x20a0, 0x080c, 0x4b8f, 0x00e6, 0x080c, 0x9c5a, 0x0140,
+	0x6010, 0x2070, 0x7007, 0x0000, 0x7034, 0x70b2, 0x7037, 0x0103,
+	0x00ee, 0x080c, 0x861d, 0x001e, 0x0005, 0x00e6, 0x00d6, 0x603f,
+	0x0000, 0x2c68, 0x0016, 0x2009, 0x0035, 0x080c, 0xa10a, 0x001e,
+	0x1168, 0x0026, 0x6228, 0x2268, 0x002e, 0x2071, 0xbb8c, 0x6b1c,
+	0xa386, 0x0003, 0x0130, 0xa386, 0x0006, 0x0128, 0x080c, 0x861d,
+	0x0020, 0x0031, 0x0010, 0x080c, 0x88f6, 0x00de, 0x00ee, 0x0005,
+	0x00f6, 0x6810, 0x2078, 0xa186, 0x0015, 0x0904, 0x88dd, 0xa18e,
+	0x0016, 0x1904, 0x88f4, 0x700c, 0xa08c, 0xff00, 0xa186, 0x1700,
+	0x0120, 0xa186, 0x0300, 0x1904, 0x88bc, 0x8fff, 0x1138, 0x6800,
+	0xa086, 0x000f, 0x0904, 0x88a0, 0x0804, 0x88f2, 0x6808, 0xa086,
+	0xffff, 0x1904, 0x88df, 0x784c, 0xa084, 0x0060, 0xa086, 0x0020,
+	0x1150, 0x797c, 0x7810, 0xa106, 0x1904, 0x88df, 0x7980, 0x7814,
+	0xa106, 0x1904, 0x88df, 0x080c, 0x9e11, 0x6858, 0x7852, 0x784c,
+	0xc0dc, 0xc0f4, 0xc0d4, 0x784e, 0x0026, 0xa00e, 0x6a14, 0x2001,
+	0x000a, 0x080c, 0x6b40, 0x7854, 0xa20a, 0x0208, 0x8011, 0x7a56,
+	0x82ff, 0x002e, 0x1138, 0x00c6, 0x2d60, 0x080c, 0x9a09, 0x00ce,
+	0x0804, 0x88f2, 0x00c6, 0x00d6, 0x2f68, 0x6838, 0xd0fc, 0x1118,
+	0x080c, 0x4c64, 0x0010, 0x080c, 0x4e49, 0x00de, 0x00ce, 0x1904,
+	0x88df, 0x00c6, 0x2d60, 0x080c, 0x861d, 0x00ce, 0x0804, 0x88f2,
+	0x00c6, 0x080c, 0x9ed6, 0x0190, 0x6013, 0x0000, 0x6818, 0x601a,
+	0x080c, 0xa027, 0x601f, 0x0003, 0x6904, 0x00c6, 0x2d60, 0x080c,
+	0x861d, 0x00ce, 0x080c, 0x864c, 0x00ce, 0x04e0, 0x2001, 0xb7b8,
+	0x2004, 0x683e, 0x00ce, 0x04b0, 0x7008, 0xa086, 0x000b, 0x11a0,
+	0x6018, 0x200c, 0xc1bc, 0x2102, 0x00c6, 0x2d60, 0x7853, 0x0003,
+	0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x080c, 0x6c8d,
+	0x080c, 0x7173, 0x00ce, 0x00f0, 0x700c, 0xa086, 0x2a00, 0x1138,
+	0x2001, 0xb7b8, 0x2004, 0x683e, 0x00a8, 0x0481, 0x00a8, 0x8fff,
+	0x090c, 0x1515, 0x00c6, 0x00d6, 0x2d60, 0x2f68, 0x6837, 0x0103,
+	0x684b, 0x0003, 0x080c, 0x98fd, 0x080c, 0x9e11, 0x080c, 0x9e1d,
+	0x00de, 0x00ce, 0x080c, 0x861d, 0x00fe, 0x0005, 0xa186, 0x0015,
+	0x1128, 0x2001, 0xb7b8, 0x2004, 0x683e, 0x0068, 0xa18e, 0x0016,
+	0x1160, 0x00c6, 0x2d00, 0x2060, 0x080c, 0xb33a, 0x080c, 0x6aef,
+	0x080c, 0x861d, 0x00ce, 0x080c, 0x861d, 0x0005, 0x0026, 0x0036,
+	0x0046, 0x7228, 0x7c80, 0x7b7c, 0xd2f4, 0x0130, 0x2001, 0xb7b8,
+	0x2004, 0x683e, 0x0804, 0x8970, 0x00c6, 0x2d60, 0x080c, 0x991d,
+	0x00ce, 0x6804, 0xa086, 0x0050, 0x1168, 0x00c6, 0x2d00, 0x2060,
+	0x6003, 0x0001, 0x6007, 0x0050, 0x080c, 0x6c8d, 0x080c, 0x7173,
+	0x00ce, 0x04f0, 0x6800, 0xa086, 0x000f, 0x01c8, 0x8fff, 0x090c,
+	0x1515, 0x6820, 0xd0dc, 0x1198, 0x6800, 0xa086, 0x0004, 0x1198,
+	0x784c, 0xd0ac, 0x0180, 0x784c, 0xc0dc, 0xc0f4, 0x784e, 0x7850,
+	0xc0f4, 0xc0fc, 0x7852, 0x2001, 0x0001, 0x682e, 0x00e0, 0x2001,
+	0x0007, 0x682e, 0x00c0, 0x784c, 0xd0b4, 0x1130, 0xd0ac, 0x0db8,
+	0x784c, 0xd0f4, 0x1da0, 0x0c38, 0xd2ec, 0x1d88, 0x7024, 0xa306,
+	0x1118, 0x7020, 0xa406, 0x0d58, 0x7020, 0x6836, 0x7024, 0x683a,
+	0x2001, 0x0005, 0x682e, 0x080c, 0x9f63, 0x080c, 0x7173, 0x0010,
+	0x080c, 0x861d, 0x004e, 0x003e, 0x002e, 0x0005, 0x00e6, 0x00d6,
+	0x0026, 0x6034, 0x2068, 0x6a1c, 0xa286, 0x0007, 0x0904, 0x89d4,
+	0xa286, 0x0002, 0x0904, 0x89d4, 0xa286, 0x0000, 0x0904, 0x89d4,
+	0x6808, 0x6338, 0xa306, 0x1904, 0x89d4, 0x2071, 0xbb8c, 0xa186,
+	0x0015, 0x05e0, 0xa18e, 0x0016, 0x1190, 0x6030, 0xa084, 0x00ff,
+	0xa086, 0x0001, 0x1160, 0x700c, 0xa086, 0x2a00, 0x1140, 0x6034,
+	0xa080, 0x0008, 0x200c, 0xc1dd, 0xc1f5, 0x2102, 0x0438, 0x00c6,
+	0x6034, 0x2060, 0x6104, 0xa186, 0x004b, 0x01a0, 0xa186, 0x004c,
+	0x0188, 0xa186, 0x004d, 0x0170, 0xa186, 0x004e, 0x0158, 0xa186,
+	0x0052, 0x0140, 0x6010, 0x2068, 0x080c, 0x9c5a, 0x090c, 0x1515,
+	0x6853, 0x0003, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002,
+	0x080c, 0x6c8d, 0x080c, 0x7173, 0x00ce, 0x0030, 0x6034, 0x2070,
+	0x2001, 0xb7b8, 0x2004, 0x703e, 0x080c, 0x861d, 0x002e, 0x00de,
+	0x00ee, 0x0005, 0x00d6, 0x20a9, 0x000e, 0x2e98, 0x6010, 0x20a0,
+	0x53a3, 0xa1b6, 0x0015, 0x1558, 0x6018, 0x2068, 0x0156, 0x0036,
+	0x0026, 0xae90, 0x000c, 0xa290, 0x0004, 0x20a9, 0x0004, 0xad98,
+	0x000a, 0x080c, 0x90da, 0x002e, 0x003e, 0x015e, 0x11d8, 0x0156,
+	0x0036, 0x0026, 0xae90, 0x000c, 0xa290, 0x0008, 0x20a9, 0x0004,
+	0xad98, 0x0006, 0x080c, 0x90da, 0x002e, 0x003e, 0x015e, 0x1150,
+	0x7038, 0x680a, 0x703c, 0x680e, 0x6800, 0xc08d, 0x6802, 0x00de,
+	0x0804, 0x87a0, 0x080c, 0x2c9c, 0x00c6, 0x080c, 0x85c7, 0x2f00,
+	0x601a, 0x6013, 0x0000, 0x601f, 0x0001, 0x6007, 0x0001, 0x6003,
+	0x0001, 0x2001, 0x0007, 0x080c, 0x4efd, 0x080c, 0x4f2a, 0x080c,
+	0x6cd3, 0x080c, 0x7173, 0x00ce, 0x0c10, 0x2100, 0xa1b2, 0x0080,
+	0x1a0c, 0x1515, 0xa1b2, 0x0040, 0x1a04, 0x8a91, 0x0002, 0x8a85,
+	0x8a79, 0x8a85, 0x8a85, 0x8a85, 0x8a85, 0x8a77, 0x8a77, 0x8a77,
+	0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a77,
+	0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a77,
+	0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a85, 0x8a77,
+	0x8a85, 0x8a85, 0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a85,
+	0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a77,
+	0x8a77, 0x8a85, 0x8a85, 0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a77,
+	0x8a77, 0x8a77, 0x8a77, 0x8a77, 0x8a85, 0x8a77, 0x8a77, 0x080c,
+	0x1515, 0x6003, 0x0001, 0x6106, 0x080c, 0x6cd3, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x7173, 0x012e, 0x0005, 0x6003, 0x0001, 0x6106,
+	0x080c, 0x6cd3, 0x0126, 0x2091, 0x8000, 0x080c, 0x7173, 0x012e,
+	0x0005, 0x2600, 0x0002, 0x8a85, 0x8a85, 0x8a99, 0x8a85, 0x8a85,
+	0x8a99, 0x080c, 0x1515, 0x6004, 0xa0b2, 0x0080, 0x1a0c, 0x1515,
+	0xa1b6, 0x0013, 0x0904, 0x8b4b, 0xa1b6, 0x0027, 0x1904, 0x8b11,
+	0x080c, 0x7090, 0x6004, 0x080c, 0x9e47, 0x0190, 0x080c, 0x9e58,
+	0x0904, 0x8b0b, 0xa08e, 0x0021, 0x0904, 0x8b0e, 0xa08e, 0x0022,
+	0x0904, 0x8b0b, 0xa08e, 0x003d, 0x0904, 0x8b0e, 0x0804, 0x8b04,
+	0x080c, 0x2cc2, 0x2001, 0x0007, 0x080c, 0x4efd, 0x6018, 0xa080,
+	0x0028, 0x200c, 0x080c, 0x8c19, 0xa186, 0x007e, 0x1148, 0x2001,
+	0xb535, 0x2014, 0xc285, 0x080c, 0x5acf, 0x1108, 0xc2ad, 0x2202,
+	0x0016, 0x0026, 0x0036, 0x2110, 0x0026, 0x2019, 0x0028, 0x080c,
+	0x8299, 0x002e, 0x080c, 0xb38d, 0x003e, 0x002e, 0x001e, 0x0016,
+	0x0026, 0x0036, 0x2110, 0x2019, 0x0028, 0x080c, 0x6df5, 0x0076,
+	0x2039, 0x0000, 0x080c, 0x6d02, 0x00c6, 0x6018, 0xa065, 0x0110,
+	0x080c, 0x51aa, 0x00ce, 0x2c08, 0x080c, 0xae82, 0x007e, 0x003e,
+	0x002e, 0x001e, 0x080c, 0x4f6c, 0x080c, 0xa01f, 0x080c, 0x861d,
+	0x080c, 0x7173, 0x0005, 0x080c, 0x8c19, 0x0cb0, 0x080c, 0x8c47,
+	0x0c98, 0xa186, 0x0014, 0x1db0, 0x080c, 0x7090, 0x080c, 0x2c9c,
+	0x080c, 0x9e47, 0x1188, 0x080c, 0x2cc2, 0x6018, 0xa080, 0x0028,
+	0x200c, 0x080c, 0x8c19, 0xa186, 0x007e, 0x1128, 0x2001, 0xb535,
+	0x200c, 0xc185, 0x2102, 0x08c0, 0x080c, 0x9e58, 0x1118, 0x080c,
+	0x8c19, 0x0890, 0x6004, 0xa08e, 0x0032, 0x1158, 0x00e6, 0x00f6,
+	0x2071, 0xb582, 0x2079, 0x0000, 0x080c, 0x2fcf, 0x00fe, 0x00ee,
+	0x0818, 0x6004, 0xa08e, 0x0021, 0x0d50, 0xa08e, 0x0022, 0x090c,
+	0x8c19, 0x0804, 0x8b04, 0xa0b2, 0x0040, 0x1a04, 0x8c0e, 0x2008,
+	0x0002, 0x8b93, 0x8b94, 0x8b97, 0x8b9a, 0x8b9d, 0x8ba0, 0x8b91,
+	0x8b91, 0x8b91, 0x8b91, 0x8b91, 0x8b91, 0x8b91, 0x8b91, 0x8b91,
+	0x8b91, 0x8b91, 0x8b91, 0x8b91, 0x8b91, 0x8b91, 0x8b91, 0x8b91,
+	0x8b91, 0x8b91, 0x8b91, 0x8b91, 0x8b91, 0x8b91, 0x8b91, 0x8ba3,
+	0x8bb2, 0x8b91, 0x8bb4, 0x8bb2, 0x8b91, 0x8b91, 0x8b91, 0x8b91,
+	0x8b91, 0x8bb2, 0x8bb2, 0x8b91, 0x8b91, 0x8b91, 0x8b91, 0x8b91,
+	0x8b91, 0x8b91, 0x8b91, 0x8bee, 0x8bb2, 0x8b91, 0x8bae, 0x8b91,
+	0x8b91, 0x8b91, 0x8baf, 0x8b91, 0x8b91, 0x8b91, 0x8bb2, 0x8be5,
+	0x8b91, 0x080c, 0x1515, 0x00f0, 0x2001, 0x000b, 0x0460, 0x2001,
+	0x0003, 0x0448, 0x2001, 0x0005, 0x0430, 0x2001, 0x0001, 0x0418,
+	0x2001, 0x0009, 0x0400, 0x080c, 0x7090, 0x6003, 0x0005, 0x2001,
+	0xb7b8, 0x2004, 0x603e, 0x080c, 0x7173, 0x00a0, 0x0018, 0x0010,
+	0x080c, 0x4efd, 0x0804, 0x8bff, 0x080c, 0x7090, 0x2001, 0xb7b6,
+	0x2004, 0x6016, 0x2001, 0xb7b8, 0x2004, 0x603e, 0x6003, 0x0004,
+	0x080c, 0x7173, 0x0005, 0x080c, 0x4efd, 0x080c, 0x7090, 0x6003,
+	0x0002, 0x2001, 0xb7b8, 0x2004, 0x603e, 0x0036, 0x2019, 0xb55d,
+	0x2304, 0xa084, 0xff00, 0x1120, 0x2001, 0xb7b6, 0x201c, 0x0040,
+	0x8007, 0xa09a, 0x0004, 0x0ec0, 0x8003, 0x801b, 0x831b, 0xa318,
+	0x6316, 0x003e, 0x080c, 0x7173, 0x08e8, 0x080c, 0x7090, 0x080c,
+	0xa01f, 0x080c, 0x861d, 0x080c, 0x7173, 0x08a0, 0x00e6, 0x00f6,
+	0x2071, 0xb582, 0x2079, 0x0000, 0x080c, 0x2fcf, 0x00fe, 0x00ee,
+	0x080c, 0x7090, 0x080c, 0x861d, 0x080c, 0x7173, 0x0818, 0x080c,
+	0x7090, 0x2001, 0xb7b8, 0x2004, 0x603e, 0x6003, 0x0002, 0x2001,
+	0xb7b6, 0x2004, 0x6016, 0x080c, 0x7173, 0x0005, 0x2600, 0x2008,
+	0x0002, 0x8c17, 0x8c17, 0x8c17, 0x8bff, 0x8bff, 0x8c17, 0x080c,
+	0x1515, 0x00e6, 0x0026, 0x0016, 0x080c, 0x9c5a, 0x0508, 0x6010,
+	0x2070, 0x7034, 0xa086, 0x0139, 0x1148, 0x2001, 0x0030, 0x2009,
+	0x0000, 0x2011, 0x4005, 0x080c, 0xa0d6, 0x0090, 0x7038, 0xd0fc,
+	0x0178, 0x7007, 0x0000, 0x0016, 0x6004, 0xa08e, 0x0021, 0x0160,
+	0xa08e, 0x003d, 0x0148, 0x001e, 0x7037, 0x0103, 0x7033, 0x0100,
+	0x001e, 0x002e, 0x00ee, 0x0005, 0x001e, 0x0009, 0x0cc8, 0x00e6,
+	0xacf0, 0x0004, 0x2e74, 0x7000, 0x2070, 0x7037, 0x0103, 0x7023,
+	0x8001, 0x00ee, 0x0005, 0x00d6, 0x6618, 0x2668, 0x6804, 0xa084,
+	0x00ff, 0x00de, 0xa0b2, 0x000c, 0x1a0c, 0x1515, 0x6604, 0xa6b6,
+	0x0043, 0x1120, 0x080c, 0xa092, 0x0804, 0x8cb8, 0x6604, 0xa6b6,
+	0x0033, 0x1120, 0x080c, 0xa042, 0x0804, 0x8cb8, 0x6604, 0xa6b6,
+	0x0028, 0x1120, 0x080c, 0x9e88, 0x0804, 0x8cb8, 0x6604, 0xa6b6,
+	0x0029, 0x1118, 0x080c, 0x9e9f, 0x04d8, 0x6604, 0xa6b6, 0x001f,
+	0x1118, 0x080c, 0x8786, 0x04a0, 0x6604, 0xa6b6, 0x0000, 0x1118,
+	0x080c, 0x89da, 0x0468, 0x6604, 0xa6b6, 0x0022, 0x1118, 0x080c,
+	0x87ae, 0x0430, 0x6604, 0xa6b6, 0x0035, 0x1118, 0x080c, 0x8815,
+	0x00f8, 0x6604, 0xa6b6, 0x0039, 0x1118, 0x080c, 0x8976, 0x00c0,
+	0x6604, 0xa6b6, 0x003d, 0x1118, 0x080c, 0x87c8, 0x0088, 0x6604,
+	0xa6b6, 0x0044, 0x1118, 0x080c, 0x87e8, 0x0050, 0xa1b6, 0x0015,
+	0x1110, 0x0053, 0x0028, 0xa1b6, 0x0016, 0x1118, 0x0804, 0x8e7c,
+	0x0005, 0x080c, 0x8663, 0x0ce0, 0x8cdf, 0x8ce2, 0x8cdf, 0x8d24,
+	0x8cdf, 0x8e09, 0x8e8a, 0x8cdf, 0x8cdf, 0x8e58, 0x8cdf, 0x8e6c,
+	0xa1b6, 0x0048, 0x0140, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
+	0x080c, 0x185e, 0x0005, 0x00e6, 0xacf0, 0x0004, 0x2e74, 0x7000,
+	0x2070, 0x7037, 0x0103, 0x00ee, 0x080c, 0x861d, 0x0005, 0xe000,
+	0xe000, 0x0005, 0x00e6, 0x2071, 0xb500, 0x7084, 0xa086, 0x0074,
+	0x1530, 0x080c, 0xae59, 0x11b0, 0x00d6, 0x6018, 0x2068, 0x7030,
+	0xd08c, 0x0128, 0x6800, 0xd0bc, 0x0110, 0xc0c5, 0x6802, 0x00d9,
+	0x00de, 0x2001, 0x0006, 0x080c, 0x4efd, 0x080c, 0x2cc2, 0x080c,
+	0x861d, 0x0078, 0x2001, 0x000a, 0x080c, 0x4efd, 0x080c, 0x2cc2,
+	0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x6cd3, 0x0010, 0x080c,
+	0x8df6, 0x00ee, 0x0005, 0x6800, 0xd084, 0x0168, 0x2001, 0x0000,
+	0x080c, 0x4eeb, 0x2069, 0xb552, 0x6804, 0xd0a4, 0x0120, 0x2001,
+	0x0006, 0x080c, 0x4f2a, 0x0005, 0x00d6, 0x2011, 0xb521, 0x2204,
+	0xa086, 0x0074, 0x1904, 0x8df3, 0x6018, 0x2068, 0x6aa0, 0xa286,
+	0x007e, 0x1120, 0x080c, 0x8fa2, 0x0804, 0x8d92, 0x080c, 0x8f98,
+	0x6018, 0x2068, 0xa080, 0x0028, 0x2014, 0xa286, 0x0080, 0x11c0,
+	0x6813, 0x00ff, 0x6817, 0xfffc, 0x6010, 0xa005, 0x0138, 0x2068,
+	0x6807, 0x0000, 0x6837, 0x0103, 0x6833, 0x0200, 0x2001, 0x0006,
+	0x080c, 0x4efd, 0x080c, 0x2cc2, 0x080c, 0x861d, 0x0804, 0x8df4,
+	0x00e6, 0x2071, 0xb535, 0x2e04, 0xd09c, 0x0188, 0x2071, 0xbb80,
+	0x7108, 0x720c, 0xa18c, 0x00ff, 0x1118, 0xa284, 0xff00, 0x0138,
+	0x6018, 0x2070, 0x70a0, 0xd0bc, 0x1110, 0x7112, 0x7216, 0x00ee,
+	0x6010, 0xa005, 0x0198, 0x2068, 0x6838, 0xd0f4, 0x0178, 0x6834,
+	0xa084, 0x00ff, 0xa086, 0x0039, 0x1958, 0x2001, 0x0000, 0x2009,
+	0x0000, 0x2011, 0x4000, 0x080c, 0xa0d6, 0x0840, 0x2001, 0x0004,
+	0x080c, 0x4efd, 0x6003, 0x0001, 0x6007, 0x0003, 0x080c, 0x6cd3,
+	0x0804, 0x8df4, 0x685c, 0xd0e4, 0x01d8, 0x080c, 0x9fd2, 0x080c,
+	0x5acf, 0x0118, 0xd0dc, 0x1904, 0x8d4e, 0x2011, 0xb535, 0x2204,
+	0xc0ad, 0x2012, 0x2001, 0xb78f, 0x2004, 0x00f6, 0x2079, 0x0100,
+	0x78e3, 0x0000, 0x080c, 0x2872, 0x78e2, 0x00fe, 0x0804, 0x8d4e,
+	0x080c, 0xa008, 0x2011, 0xb535, 0x2204, 0xc0a5, 0x2012, 0x0006,
+	0x080c, 0xaf7b, 0x000e, 0x1904, 0x8d4e, 0xc0b5, 0x2012, 0x2001,
+	0x0006, 0x080c, 0x4efd, 0x2001, 0x0000, 0x080c, 0x4eeb, 0x00c6,
+	0x2009, 0x00ef, 0x00f6, 0x2079, 0x0100, 0x79ea, 0x7932, 0x7936,
+	0x00fe, 0x080c, 0x2847, 0x00f6, 0x2079, 0xb500, 0x7976, 0x2100,
+	0x2009, 0x0000, 0x080c, 0x281d, 0x7952, 0x00fe, 0x8108, 0x080c,
+	0x4f4d, 0x2c00, 0x00ce, 0x1904, 0x8d4e, 0x601a, 0x2001, 0x0002,
+	0x080c, 0x4efd, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002,
+	0x080c, 0x6cd3, 0x0008, 0x0011, 0x00de, 0x0005, 0x2001, 0x0007,
+	0x080c, 0x4efd, 0x2001, 0xb500, 0x2004, 0xa086, 0x0003, 0x1120,
+	0x2001, 0x0007, 0x080c, 0x4f2a, 0x080c, 0x2cc2, 0x080c, 0x861d,
+	0x0005, 0x00e6, 0x0026, 0x0016, 0x2071, 0xb500, 0x7084, 0xa086,
+	0x0014, 0x15f0, 0x7000, 0xa086, 0x0003, 0x1128, 0x6010, 0xa005,
+	0x1110, 0x080c, 0x3f3e, 0x00d6, 0x6018, 0x2068, 0x080c, 0x504b,
+	0x080c, 0x8d13, 0x00de, 0x080c, 0x9051, 0x1550, 0x00d6, 0x6018,
+	0x2068, 0x6890, 0x00de, 0xa005, 0x0518, 0x2001, 0x0006, 0x080c,
+	0x4efd, 0x00e6, 0x6010, 0xa075, 0x01a8, 0x7034, 0xa084, 0x00ff,
+	0xa086, 0x0039, 0x1148, 0x2001, 0x0000, 0x2009, 0x0000, 0x2011,
+	0x4000, 0x080c, 0xa0d6, 0x0030, 0x7007, 0x0000, 0x7037, 0x0103,
+	0x7033, 0x0200, 0x00ee, 0x080c, 0x2cc2, 0x080c, 0x861d, 0x0020,
+	0x080c, 0x8c19, 0x080c, 0x8df6, 0x001e, 0x002e, 0x00ee, 0x0005,
+	0x2011, 0xb521, 0x2204, 0xa086, 0x0014, 0x1158, 0x2001, 0x0002,
+	0x080c, 0x4efd, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x6cd3,
+	0x0010, 0x080c, 0x8df6, 0x0005, 0x2011, 0xb521, 0x2204, 0xa086,
+	0x0004, 0x1138, 0x2001, 0x0007, 0x080c, 0x4efd, 0x080c, 0x861d,
+	0x0010, 0x080c, 0x8df6, 0x0005, 0x000b, 0x0005, 0x8cdf, 0x8e95,
+	0x8cdf, 0x8ec9, 0x8cdf, 0x8f54, 0x8e8a, 0x8cdf, 0x8cdf, 0x8f67,
+	0x8cdf, 0x8f77, 0x6604, 0xa686, 0x0003, 0x0904, 0x8e09, 0xa6b6,
+	0x001e, 0x1110, 0x080c, 0x861d, 0x0005, 0x00d6, 0x00c6, 0x080c,
+	0x8f87, 0x1178, 0x2001, 0x0000, 0x080c, 0x4eeb, 0x2001, 0x0002,
+	0x080c, 0x4efd, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x6cd3,
+	0x00e8, 0x2009, 0xbb8e, 0x2104, 0xa086, 0x0009, 0x1160, 0x6018,
+	0x2068, 0x6840, 0xa084, 0x00ff, 0xa005, 0x0170, 0x8001, 0x6842,
+	0x6017, 0x000a, 0x0058, 0x2009, 0xbb8f, 0x2104, 0xa084, 0xff00,
+	0xa086, 0x1900, 0x1108, 0x08d0, 0x080c, 0x8df6, 0x00ce, 0x00de,
+	0x0005, 0x0026, 0x2011, 0x0000, 0x080c, 0x8f95, 0x00d6, 0x2069,
+	0xb79e, 0x2d04, 0xa005, 0x0168, 0x6018, 0x2068, 0x68a0, 0xa086,
+	0x007e, 0x1138, 0x2069, 0xb51d, 0x2d04, 0x8000, 0x206a, 0x00de,
+	0x0010, 0x00de, 0x0078, 0x2001, 0x0000, 0x080c, 0x4eeb, 0x2001,
+	0x0002, 0x080c, 0x4efd, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c,
+	0x6cd3, 0x0480, 0x00d6, 0x6010, 0x2068, 0x080c, 0x9c5a, 0x00de,
+	0x0108, 0x6a34, 0x080c, 0x8c19, 0x2009, 0xbb8e, 0x2134, 0xa6b4,
+	0x00ff, 0xa686, 0x0005, 0x0500, 0xa686, 0x000b, 0x01c8, 0x2009,
+	0xbb8f, 0x2104, 0xa084, 0xff00, 0x1118, 0xa686, 0x0009, 0x01a0,
+	0xa086, 0x1900, 0x1168, 0xa686, 0x0009, 0x0170, 0x2001, 0x0004,
+	0x080c, 0x4efd, 0x2001, 0x0028, 0x6016, 0x6007, 0x004b, 0x0010,
+	0x080c, 0x8df6, 0x002e, 0x0005, 0x00d6, 0xa286, 0x0139, 0x0160,
+	0x6010, 0x2068, 0x080c, 0x9c5a, 0x0148, 0x6834, 0xa086, 0x0139,
+	0x0118, 0x6838, 0xd0fc, 0x0110, 0x00de, 0x0c50, 0x6018, 0x2068,
+	0x6840, 0xa084, 0x00ff, 0xa005, 0x0140, 0x8001, 0x6842, 0x6017,
+	0x000a, 0x6007, 0x0016, 0x00de, 0x08e8, 0x68a0, 0xa086, 0x007e,
+	0x1138, 0x00e6, 0x2071, 0xb500, 0x080c, 0x4bc6, 0x00ee, 0x0010,
+	0x080c, 0x2c9c, 0x00de, 0x0860, 0x080c, 0x8f95, 0x1158, 0x2001,
+	0x0004, 0x080c, 0x4efd, 0x6003, 0x0001, 0x6007, 0x0003, 0x080c,
+	0x6cd3, 0x0020, 0x080c, 0x8c19, 0x080c, 0x8df6, 0x0005, 0x0469,
+	0x1158, 0x2001, 0x0008, 0x080c, 0x4efd, 0x6003, 0x0001, 0x6007,
+	0x0005, 0x080c, 0x6cd3, 0x0010, 0x080c, 0x8df6, 0x0005, 0x00e9,
+	0x1158, 0x2001, 0x000a, 0x080c, 0x4efd, 0x6003, 0x0001, 0x6007,
+	0x0001, 0x080c, 0x6cd3, 0x0010, 0x080c, 0x8df6, 0x0005, 0x2009,
+	0xbb8e, 0x2104, 0xa086, 0x0003, 0x1138, 0x2009, 0xbb8f, 0x2104,
+	0xa084, 0xff00, 0xa086, 0x2a00, 0x0005, 0xa085, 0x0001, 0x0005,
+	0x00c6, 0x0016, 0xac88, 0x0006, 0x2164, 0x080c, 0x4fb8, 0x001e,
+	0x00ce, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x0036, 0x0016, 0x6018,
+	0x2068, 0x2071, 0xb535, 0x2e04, 0xa085, 0x0003, 0x2072, 0x080c,
+	0x9026, 0x0560, 0x2009, 0xb535, 0x2104, 0xc0cd, 0x200a, 0x2001,
+	0xb553, 0x2004, 0xd0a4, 0x0158, 0xa006, 0x2020, 0x2009, 0x002a,
+	0x080c, 0xb0e8, 0x2001, 0xb50c, 0x200c, 0xc195, 0x2102, 0x2019,
+	0x002a, 0x2009, 0x0001, 0x080c, 0x2c6f, 0x2071, 0xb500, 0x080c,
+	0x2ab8, 0x00c6, 0x0156, 0x20a9, 0x0081, 0x2009, 0x007f, 0x080c,
+	0x2d97, 0x8108, 0x1f04, 0x8fd7, 0x015e, 0x00ce, 0x080c, 0x8f98,
+	0x6813, 0x00ff, 0x6817, 0xfffe, 0x2071, 0xbb80, 0x2079, 0x0100,
+	0x2e04, 0xa084, 0x00ff, 0x2069, 0xb51c, 0x206a, 0x78e6, 0x0006,
+	0x8e70, 0x2e04, 0x2069, 0xb51d, 0x206a, 0x78ea, 0x7832, 0x7836,
+	0x2010, 0xa084, 0xff00, 0x001e, 0xa105, 0x2009, 0xb528, 0x200a,
+	0x2200, 0xa084, 0x00ff, 0x2008, 0x080c, 0x2847, 0x080c, 0x5acf,
+	0x0170, 0x2069, 0xbb8e, 0x2071, 0xb7b2, 0x6810, 0x2072, 0x6814,
+	0x7006, 0x6818, 0x700a, 0x681c, 0x700e, 0x080c, 0x9fd2, 0x0040,
+	0x2001, 0x0006, 0x080c, 0x4efd, 0x080c, 0x2cc2, 0x080c, 0x861d,
+	0x001e, 0x003e, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x0026, 0x0036,
+	0x00e6, 0x0156, 0x2019, 0xb528, 0x231c, 0x83ff, 0x01e8, 0x2071,
+	0xbb80, 0x2e14, 0xa294, 0x00ff, 0x7004, 0xa084, 0xff00, 0xa205,
+	0xa306, 0x1190, 0x2011, 0xbb96, 0xad98, 0x000a, 0x20a9, 0x0004,
+	0x080c, 0x90da, 0x1148, 0x2011, 0xbb9a, 0xad98, 0x0006, 0x20a9,
+	0x0004, 0x080c, 0x90da, 0x1100, 0x015e, 0x00ee, 0x003e, 0x002e,
+	0x0005, 0x00e6, 0x2071, 0xbb8c, 0x7004, 0xa086, 0x0014, 0x11a8,
+	0x7008, 0xa086, 0x0800, 0x1188, 0x700c, 0xd0ec, 0x0160, 0xa084,
+	0x0f00, 0xa086, 0x0100, 0x1138, 0x7024, 0xd0a4, 0x1110, 0xd0ac,
+	0x0110, 0xa006, 0x0010, 0xa085, 0x0001, 0x00ee, 0x0005, 0x00e6,
+	0x00d6, 0x00c6, 0x0076, 0x0056, 0x0046, 0x0026, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x2029, 0xb7e9, 0x252c, 0x2021, 0xb7ef, 0x2424,
+	0x2061, 0xbd00, 0x2071, 0xb500, 0x7248, 0x7068, 0xa202, 0x16f0,
+	0x080c, 0xb110, 0x05a0, 0x671c, 0xa786, 0x0001, 0x0580, 0xa786,
+	0x0007, 0x0568, 0x2500, 0xac06, 0x0550, 0x2400, 0xac06, 0x0538,
+	0x00c6, 0x6000, 0xa086, 0x0004, 0x1110, 0x080c, 0x194d, 0xa786,
+	0x0008, 0x1148, 0x080c, 0x9e58, 0x1130, 0x00ce, 0x080c, 0x8c19,
+	0x080c, 0x9e1d, 0x00a0, 0x6010, 0x2068, 0x080c, 0x9c5a, 0x0160,
+	0xa786, 0x0003, 0x11e8, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
+	0x080c, 0x5408, 0x080c, 0x9e11, 0x080c, 0x9e1d, 0x00ce, 0xace0,
+	0x0018, 0x705c, 0xac02, 0x1210, 0x0804, 0x9084, 0x012e, 0x000e,
+	0x002e, 0x004e, 0x005e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x0005,
+	0xa786, 0x0006, 0x1118, 0x080c, 0xb099, 0x0c30, 0xa786, 0x000a,
+	0x09e0, 0x08c8, 0x220c, 0x2304, 0xa106, 0x1130, 0x8210, 0x8318,
+	0x1f04, 0x90da, 0xa006, 0x0005, 0x2304, 0xa102, 0x0218, 0x2001,
+	0x0001, 0x0010, 0x2001, 0x0000, 0xa18d, 0x0001, 0x0005, 0x6004,
+	0xa08a, 0x0080, 0x1a0c, 0x1515, 0x080c, 0x9e47, 0x0120, 0x080c,
+	0x9e58, 0x0168, 0x0028, 0x080c, 0x2cc2, 0x080c, 0x9e58, 0x0138,
+	0x080c, 0x7090, 0x080c, 0x861d, 0x080c, 0x7173, 0x0005, 0x080c,
+	0x8c19, 0x0cb0, 0xa182, 0x0040, 0x0002, 0x9120, 0x9120, 0x9120,
+	0x9120, 0x9120, 0x9120, 0x9120, 0x9120, 0x9120, 0x9120, 0x9120,
+	0x9122, 0x9122, 0x9122, 0x9122, 0x9120, 0x9120, 0x9120, 0x9122,
+	0x080c, 0x1515, 0x600b, 0xffff, 0x6003, 0x0001, 0x6106, 0x080c,
+	0x6c8d, 0x0126, 0x2091, 0x8000, 0x080c, 0x7173, 0x012e, 0x0005,
+	0xa186, 0x0013, 0x1128, 0x6004, 0xa082, 0x0040, 0x0804, 0x91bc,
+	0xa186, 0x0027, 0x11e8, 0x080c, 0x7090, 0x080c, 0x2c9c, 0x00d6,
+	0x6110, 0x2168, 0x080c, 0x9c5a, 0x0168, 0x6837, 0x0103, 0x684b,
+	0x0029, 0x6847, 0x0000, 0x694c, 0xc1c5, 0x694e, 0x080c, 0x5408,
+	0x080c, 0x9e11, 0x00de, 0x080c, 0x861d, 0x080c, 0x7173, 0x0005,
+	0xa186, 0x0014, 0x1120, 0x6004, 0xa082, 0x0040, 0x0428, 0xa186,
+	0x0046, 0x0138, 0xa186, 0x0045, 0x0120, 0xa186, 0x0047, 0x190c,
+	0x1515, 0x2001, 0x0109, 0x2004, 0xd084, 0x0198, 0x0126, 0x2091,
+	0x2800, 0x0006, 0x0016, 0x0026, 0x080c, 0x6b74, 0x002e, 0x001e,
+	0x000e, 0x012e, 0xe000, 0x6000, 0xa086, 0x0002, 0x1110, 0x0804,
+	0x91fa, 0x080c, 0x8663, 0x0005, 0x0002, 0x919a, 0x9198, 0x9198,
+	0x9198, 0x9198, 0x9198, 0x9198, 0x9198, 0x9198, 0x9198, 0x9198,
+	0x91b5, 0x91b5, 0x91b5, 0x91b5, 0x9198, 0x91b5, 0x9198, 0x91b5,
+	0x080c, 0x1515, 0x080c, 0x7090, 0x00d6, 0x6110, 0x2168, 0x080c,
+	0x9c5a, 0x0168, 0x6837, 0x0103, 0x684b, 0x0006, 0x6847, 0x0000,
+	0x6850, 0xc0ec, 0x6852, 0x080c, 0x5408, 0x080c, 0x9e11, 0x00de,
+	0x080c, 0x861d, 0x080c, 0x7173, 0x0005, 0x080c, 0x7090, 0x080c,
+	0x861d, 0x080c, 0x7173, 0x0005, 0x0002, 0x91d2, 0x91d0, 0x91d0,
+	0x91d0, 0x91d0, 0x91d0, 0x91d0, 0x91d0, 0x91d0, 0x91d0, 0x91d0,
+	0x91e4, 0x91e4, 0x91e4, 0x91e4, 0x91d0, 0x91f3, 0x91d0, 0x91e4,
+	0x080c, 0x1515, 0x080c, 0x7090, 0x2001, 0xb7b8, 0x2004, 0x603e,
+	0x6003, 0x0002, 0x080c, 0x7173, 0x6010, 0xa088, 0x0013, 0x2104,
+	0xa085, 0x0400, 0x200a, 0x0005, 0x080c, 0x7090, 0x2001, 0xb7b6,
+	0x2004, 0x6016, 0x2001, 0xb7b8, 0x2004, 0x603e, 0x6003, 0x000f,
+	0x080c, 0x7173, 0x0005, 0x080c, 0x7090, 0x080c, 0x861d, 0x080c,
+	0x7173, 0x0005, 0xa182, 0x0040, 0x0002, 0x9210, 0x9210, 0x9210,
+	0x9210, 0x9210, 0x9212, 0x92f7, 0x9326, 0x9210, 0x9210, 0x9210,
+	0x9210, 0x9210, 0x9210, 0x9210, 0x9210, 0x9210, 0x9210, 0x9210,
+	0x080c, 0x1515, 0x00e6, 0x00d6, 0x603f, 0x0000, 0x2071, 0xbb80,
+	0x7124, 0x610a, 0x2071, 0xbb8c, 0x6110, 0x2168, 0x7614, 0xa6b4,
+	0x0fff, 0x86ff, 0x0904, 0x92c0, 0xa68c, 0x0c00, 0x0518, 0x00f6,
+	0x2c78, 0x080c, 0x5305, 0x00fe, 0x01c8, 0x684c, 0xd0ac, 0x01b0,
+	0x6020, 0xd0dc, 0x1198, 0x6850, 0xd0bc, 0x1180, 0x7318, 0x6814,
+	0xa306, 0x1904, 0x92d3, 0x731c, 0x6810, 0xa31e, 0x0138, 0xd6d4,
+	0x0904, 0x92d3, 0x6b14, 0xa305, 0x1904, 0x92d3, 0x7318, 0x6b62,
+	0x731c, 0x6b5e, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0518, 0xa186,
+	0x0028, 0x1128, 0x080c, 0x9e36, 0x684b, 0x001c, 0x00e8, 0xd6dc,
+	0x01a0, 0x684b, 0x0015, 0x684c, 0xd0ac, 0x0170, 0x6914, 0x6a10,
+	0x2100, 0xa205, 0x0148, 0x7018, 0xa106, 0x1118, 0x701c, 0xa206,
+	0x0118, 0x6962, 0x6a5e, 0xc6dc, 0x0038, 0xd6d4, 0x0118, 0x684b,
+	0x0007, 0x0010, 0x684b, 0x0000, 0x6837, 0x0103, 0x6e46, 0xa01e,
+	0xd6c4, 0x01f0, 0xa686, 0x0100, 0x1140, 0x2001, 0xbb99, 0x2004,
+	0xa005, 0x1118, 0xc6c4, 0x0804, 0x9221, 0x7328, 0x732c, 0x6b56,
+	0x83ff, 0x0170, 0xa38a, 0x0009, 0x0210, 0x2019, 0x0008, 0x0036,
+	0x2308, 0x2019, 0xbb98, 0xad90, 0x0019, 0x080c, 0x990d, 0x003e,
+	0xd6cc, 0x0904, 0x92e6, 0x7124, 0x695a, 0x81ff, 0x0904, 0x92e6,
+	0xa192, 0x0021, 0x1260, 0x2071, 0xbb98, 0x831c, 0x2300, 0xae18,
+	0xad90, 0x001d, 0x080c, 0x990d, 0x080c, 0xa137, 0x04b8, 0x6838,
+	0xd0fc, 0x0120, 0x2009, 0x0020, 0x695a, 0x0c68, 0x00f6, 0x2d78,
+	0x080c, 0x98b2, 0x00fe, 0x080c, 0xa137, 0x080c, 0x98fd, 0x0440,
+	0x00f6, 0x2c78, 0x080c, 0x5305, 0x00fe, 0x0190, 0x684c, 0xd0ac,
+	0x0178, 0x6020, 0xd0dc, 0x1160, 0x6850, 0xd0bc, 0x1148, 0x6810,
+	0x6914, 0xa105, 0x0128, 0x080c, 0x9f35, 0x00de, 0x00ee, 0x00f0,
+	0x684b, 0x0000, 0x6837, 0x0103, 0x6e46, 0x684c, 0xd0ac, 0x0130,
+	0x6810, 0x6914, 0xa115, 0x0110, 0x080c, 0x9483, 0x080c, 0x5408,
+	0x6218, 0x2268, 0x6a3c, 0x82ff, 0x0110, 0x8211, 0x6a3e, 0x080c,
+	0x9f03, 0x00de, 0x00ee, 0x1110, 0x080c, 0x861d, 0x0005, 0x00f6,
+	0x6003, 0x0003, 0x2079, 0xbb8c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08,
+	0x6010, 0x2078, 0x784c, 0xd0ac, 0x0138, 0x6003, 0x0002, 0x00fe,
+	0x0005, 0x2130, 0x2228, 0x0058, 0x2400, 0x797c, 0xa10a, 0x2300,
+	0x7a80, 0xa213, 0x2600, 0xa102, 0x2500, 0xa203, 0x0e90, 0x7c12,
+	0x7b16, 0x7e0a, 0x7d0e, 0x00fe, 0x603f, 0x0000, 0x2c10, 0x080c,
+	0x1fa9, 0x080c, 0x6cf0, 0x080c, 0x7230, 0x0005, 0x2001, 0xb7b8,
+	0x2004, 0x603e, 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18,
+	0x3e20, 0x2c10, 0x080c, 0x185e, 0x0005, 0xa182, 0x0040, 0x0002,
+	0x934b, 0x934b, 0x934b, 0x934b, 0x934b, 0x934d, 0x93e0, 0x934b,
+	0x934b, 0x93f6, 0x945a, 0x934b, 0x934b, 0x934b, 0x934b, 0x9469,
+	0x934b, 0x934b, 0x934b, 0x080c, 0x1515, 0x0076, 0x00f6, 0x00e6,
+	0x00d6, 0x2071, 0xbb8c, 0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff,
+	0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218, 0x2268, 0x6a3c, 0x82ff,
+	0x0110, 0x8211, 0x6a3e, 0x86ff, 0x0904, 0x93db, 0xa694, 0xff00,
+	0xa284, 0x0c00, 0x0120, 0x7018, 0x7862, 0x701c, 0x785e, 0xa284,
+	0x0300, 0x0904, 0x93db, 0x080c, 0x15f8, 0x090c, 0x1515, 0x2d00,
+	0x784a, 0x7f4c, 0xc7cd, 0x7f4e, 0x6837, 0x0103, 0x7838, 0x683a,
+	0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c, 0x0c00, 0x0120,
+	0x7318, 0x6b62, 0x731c, 0x6b5e, 0xa68c, 0x00ff, 0xa186, 0x0002,
+	0x0180, 0xa186, 0x0028, 0x1118, 0x684b, 0x001c, 0x0060, 0xd6dc,
+	0x0118, 0x684b, 0x0015, 0x0038, 0xd6d4, 0x0118, 0x684b, 0x0007,
+	0x0010, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852, 0x7854, 0x6856,
+	0xa01e, 0xd6c4, 0x0198, 0x7328, 0x732c, 0x6b56, 0x83ff, 0x0170,
+	0xa38a, 0x0009, 0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019,
+	0xbb98, 0xad90, 0x0019, 0x080c, 0x990d, 0x003e, 0xd6cc, 0x01d8,
+	0x7124, 0x695a, 0x81ff, 0x01b8, 0xa192, 0x0021, 0x1250, 0x2071,
+	0xbb98, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x080c, 0x990d,
+	0x0050, 0x7838, 0xd0fc, 0x0120, 0x2009, 0x0020, 0x695a, 0x0c78,
+	0x2d78, 0x080c, 0x98b2, 0x00de, 0x00ee, 0x00fe, 0x007e, 0x0005,
+	0x00f6, 0x6003, 0x0003, 0x2079, 0xbb8c, 0x7c04, 0x7b00, 0x7e0c,
+	0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x00fe,
+	0x2c10, 0x080c, 0x1fa9, 0x080c, 0x7d60, 0x0005, 0x00d6, 0x00f6,
+	0x2c78, 0x080c, 0x5305, 0x00fe, 0x0120, 0x2001, 0xb7b8, 0x2004,
+	0x603e, 0x6003, 0x0002, 0x080c, 0x7126, 0x080c, 0x7230, 0x6110,
+	0x2168, 0x694c, 0xd1e4, 0x0904, 0x9458, 0xd1cc, 0x0540, 0x6948,
+	0x6838, 0xd0fc, 0x01e8, 0x0016, 0x684c, 0x0006, 0x6850, 0x0006,
+	0xad90, 0x000d, 0xa198, 0x000d, 0x2009, 0x0020, 0x0156, 0x21a8,
+	0x2304, 0x2012, 0x8318, 0x8210, 0x1f04, 0x9420, 0x015e, 0x000e,
+	0x6852, 0x000e, 0x684e, 0x001e, 0x2168, 0x080c, 0x161f, 0x0418,
+	0x0016, 0x080c, 0x161f, 0x00de, 0x080c, 0x98fd, 0x00e0, 0x6837,
+	0x0103, 0x6944, 0xa184, 0x00ff, 0xa0b6, 0x0002, 0x0180, 0xa086,
+	0x0028, 0x1118, 0x684b, 0x001c, 0x0060, 0xd1dc, 0x0118, 0x684b,
+	0x0015, 0x0038, 0xd1d4, 0x0118, 0x684b, 0x0007, 0x0010, 0x684b,
+	0x0000, 0x080c, 0x5408, 0x080c, 0x9f03, 0x1110, 0x080c, 0x861d,
+	0x00de, 0x0005, 0x2019, 0x0001, 0x080c, 0x7fe4, 0x6003, 0x0002,
+	0x2001, 0xb7b8, 0x2004, 0x603e, 0x080c, 0x7126, 0x080c, 0x7230,
+	0x0005, 0x080c, 0x7126, 0x080c, 0x2c9c, 0x00d6, 0x6110, 0x2168,
+	0x080c, 0x9c5a, 0x0150, 0x6837, 0x0103, 0x684b, 0x0029, 0x6847,
+	0x0000, 0x080c, 0x5408, 0x080c, 0x9e11, 0x00de, 0x080c, 0x861d,
+	0x080c, 0x7230, 0x0005, 0x684b, 0x0015, 0xd1fc, 0x0138, 0x684b,
+	0x0007, 0x8002, 0x8000, 0x810a, 0xa189, 0x0000, 0x6962, 0x685e,
+	0x0005, 0xa182, 0x0040, 0x0002, 0x94a7, 0x94a7, 0x94a7, 0x94a7,
+	0x94a7, 0x94a9, 0x94a7, 0x9564, 0x9570, 0x94a7, 0x94a7, 0x94a7,
+	0x94a7, 0x94a7, 0x94a7, 0x94a7, 0x94a7, 0x94a7, 0x94a7, 0x080c,
+	0x1515, 0x0076, 0x00f6, 0x00e6, 0x00d6, 0x2071, 0xbb8c, 0x6110,
+	0x2178, 0x7614, 0xa6b4, 0x0fff, 0x00f6, 0x2c78, 0x080c, 0x5305,
+	0x00fe, 0x0150, 0xa684, 0x00ff, 0x1138, 0x6020, 0xd0f4, 0x0120,
+	0x080c, 0x9f35, 0x0804, 0x955f, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e,
+	0x6218, 0x2268, 0x6a3c, 0x82ff, 0x0110, 0x8211, 0x6a3e, 0x86ff,
+	0x0904, 0x9555, 0xa694, 0xff00, 0xa284, 0x0c00, 0x0120, 0x7018,
+	0x7862, 0x701c, 0x785e, 0xa284, 0x0300, 0x0904, 0x9553, 0xa686,
+	0x0100, 0x1140, 0x2001, 0xbb99, 0x2004, 0xa005, 0x1118, 0xc6c4,
+	0x7e46, 0x0c28, 0x080c, 0x15f8, 0x090c, 0x1515, 0x2d00, 0x784a,
+	0x7f4c, 0xa7bd, 0x0200, 0x7f4e, 0x6837, 0x0103, 0x7838, 0x683a,
+	0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c, 0x0c00, 0x0120,
+	0x7318, 0x6b62, 0x731c, 0x6b5e, 0xa68c, 0x00ff, 0xa186, 0x0002,
+	0x0180, 0xa186, 0x0028, 0x1118, 0x684b, 0x001c, 0x0060, 0xd6dc,
+	0x0118, 0x684b, 0x0015, 0x0038, 0xd6d4, 0x0118, 0x684b, 0x0007,
+	0x0010, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852, 0x7854, 0x6856,
+	0xa01e, 0xd6c4, 0x0198, 0x7328, 0x732c, 0x6b56, 0x83ff, 0x0170,
+	0xa38a, 0x0009, 0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019,
+	0xbb98, 0xad90, 0x0019, 0x080c, 0x990d, 0x003e, 0xd6cc, 0x01d8,
+	0x7124, 0x695a, 0x81ff, 0x01b8, 0xa192, 0x0021, 0x1250, 0x2071,
+	0xbb98, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x080c, 0x990d,
+	0x0050, 0x7838, 0xd0fc, 0x0120, 0x2009, 0x0020, 0x695a, 0x0c78,
+	0x2d78, 0x080c, 0x98b2, 0xd6dc, 0x1110, 0xa006, 0x0030, 0x2001,
+	0x0001, 0x2071, 0xbb8c, 0x7218, 0x731c, 0x080c, 0x18b1, 0x00de,
+	0x00ee, 0x00fe, 0x007e, 0x0005, 0x2001, 0xb7b8, 0x2004, 0x603e,
+	0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x080c, 0x185e, 0x0005,
+	0x2001, 0xb7b8, 0x2004, 0x603e, 0x00d6, 0x6003, 0x0002, 0x6110,
+	0x2168, 0x694c, 0xd1e4, 0x0904, 0x967b, 0x603f, 0x0000, 0x00f6,
+	0x2c78, 0x080c, 0x5305, 0x00fe, 0x0560, 0x6814, 0x6910, 0xa115,
+	0x0540, 0x6a60, 0xa206, 0x1118, 0x685c, 0xa106, 0x0510, 0x684c,
+	0xc0e4, 0x684e, 0x6847, 0x0000, 0x6863, 0x0000, 0x685f, 0x0000,
+	0x6020, 0xd0f4, 0x1158, 0x697c, 0x6810, 0xa102, 0x603a, 0x6980,
+	0x6814, 0xa103, 0x6036, 0x6020, 0xc0f5, 0x6022, 0x00d6, 0x6018,
+	0x2068, 0x683c, 0x8000, 0x683e, 0x00de, 0x080c, 0x9f35, 0x0804,
+	0x967b, 0x694c, 0xd1cc, 0x0904, 0x964b, 0x6948, 0x6838, 0xd0fc,
+	0x0904, 0x960e, 0x0016, 0x684c, 0x0006, 0x6850, 0x0006, 0x00f6,
+	0x2178, 0x7944, 0xa184, 0x00ff, 0xa0b6, 0x0002, 0x01e0, 0xa086,
+	0x0028, 0x1128, 0x684b, 0x001c, 0x784b, 0x001c, 0x00e8, 0xd1dc,
+	0x0158, 0x684b, 0x0015, 0x784b, 0x0015, 0x080c, 0xa0bf, 0x0118,
+	0x7944, 0xc1dc, 0x7946, 0x0080, 0xd1d4, 0x0128, 0x684b, 0x0007,
+	0x784b, 0x0007, 0x0048, 0x684c, 0xd0ac, 0x0130, 0x6810, 0x6914,
+	0xa115, 0x0110, 0x080c, 0x9483, 0x6848, 0x784a, 0x6860, 0x7862,
+	0x685c, 0x785e, 0xad90, 0x000d, 0xaf98, 0x000d, 0x2009, 0x0020,
+	0x0156, 0x21a8, 0x2304, 0x2012, 0x8318, 0x8210, 0x1f04, 0x95fa,
+	0x015e, 0x00fe, 0x000e, 0x6852, 0x000e, 0x684e, 0x080c, 0xa137,
+	0x001e, 0x2168, 0x080c, 0x161f, 0x0804, 0x9676, 0x0016, 0x00f6,
+	0x2178, 0x7944, 0xa184, 0x00ff, 0xa0b6, 0x0002, 0x01e0, 0xa086,
+	0x0028, 0x1128, 0x684b, 0x001c, 0x784b, 0x001c, 0x00e8, 0xd1dc,
+	0x0158, 0x684b, 0x0015, 0x784b, 0x0015, 0x080c, 0xa0bf, 0x0118,
+	0x7944, 0xc1dc, 0x7946, 0x0080, 0xd1d4, 0x0128, 0x684b, 0x0007,
+	0x784b, 0x0007, 0x0048, 0x684c, 0xd0ac, 0x0130, 0x6810, 0x6914,
+	0xa115, 0x0110, 0x080c, 0x9483, 0x6860, 0x7862, 0x685c, 0x785e,
+	0x684c, 0x784e, 0x00fe, 0x080c, 0x161f, 0x00de, 0x080c, 0xa137,
+	0x080c, 0x98fd, 0x0458, 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff,
+	0xa0b6, 0x0002, 0x01b0, 0xa086, 0x0028, 0x1118, 0x684b, 0x001c,
+	0x00d8, 0xd1dc, 0x0148, 0x684b, 0x0015, 0x080c, 0xa0bf, 0x0118,
+	0x6944, 0xc1dc, 0x6946, 0x0080, 0xd1d4, 0x0118, 0x684b, 0x0007,
+	0x0058, 0x684b, 0x0000, 0x684c, 0xd0ac, 0x0130, 0x6810, 0x6914,
+	0xa115, 0x0110, 0x080c, 0x9483, 0x080c, 0x5408, 0x080c, 0x9f03,
+	0x1110, 0x080c, 0x861d, 0x00de, 0x0005, 0x080c, 0x7090, 0x0010,
+	0x080c, 0x7126, 0x080c, 0x9c5a, 0x01c0, 0x00d6, 0x6110, 0x2168,
+	0x6837, 0x0103, 0x2009, 0xb50c, 0x210c, 0xd18c, 0x11c0, 0xd184,
+	0x1198, 0x6108, 0x694a, 0xa18e, 0x0029, 0x1110, 0x080c, 0xb380,
+	0x6847, 0x0000, 0x080c, 0x5408, 0x00de, 0x080c, 0x861d, 0x080c,
+	0x7173, 0x080c, 0x7230, 0x0005, 0x684b, 0x0004, 0x0c88, 0x684b,
+	0x0004, 0x0c70, 0xa182, 0x0040, 0x0002, 0x96c0, 0x96c0, 0x96c0,
+	0x96c0, 0x96c0, 0x96c2, 0x96c0, 0x96c5, 0x96c0, 0x96c0, 0x96c0,
+	0x96c0, 0x96c0, 0x96c0, 0x96c0, 0x96c0, 0x96c0, 0x96c0, 0x96c0,
+	0x080c, 0x1515, 0x080c, 0x861d, 0x0005, 0x0006, 0x0026, 0xa016,
+	0x080c, 0x185e, 0x002e, 0x000e, 0x0005, 0xa182, 0x0085, 0x0002,
+	0x96d9, 0x96d7, 0x96d7, 0x96e5, 0x96d7, 0x96d7, 0x96d7, 0x080c,
+	0x1515, 0x6003, 0x0001, 0x6106, 0x080c, 0x6c8d, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x7173, 0x012e, 0x0005, 0x0026, 0x0056, 0x00d6,
+	0x00e6, 0x2071, 0xbb80, 0x7224, 0x6212, 0x7220, 0x080c, 0x9c4a,
+	0x01a0, 0x2268, 0x6800, 0xa086, 0x0000, 0x0178, 0x6018, 0x6d18,
+	0xa52e, 0x1158, 0x00c6, 0x2d60, 0x080c, 0x991d, 0x00ce, 0x0128,
+	0x6803, 0x0002, 0x6007, 0x0086, 0x0010, 0x6007, 0x0087, 0x6003,
+	0x0001, 0x080c, 0x6c8d, 0x080c, 0x7173, 0x00f6, 0x2278, 0x080c,
+	0x5305, 0x00fe, 0x0150, 0x6820, 0xd0ec, 0x0138, 0x00c6, 0x2260,
+	0x603f, 0x0000, 0x080c, 0x9f35, 0x00ce, 0x00ee, 0x00de, 0x005e,
+	0x002e, 0x0005, 0xa186, 0x0013, 0x1160, 0x6004, 0xa08a, 0x0085,
+	0x0a0c, 0x1515, 0xa08a, 0x008c, 0x1a0c, 0x1515, 0xa082, 0x0085,
+	0x0072, 0xa186, 0x0027, 0x0120, 0xa186, 0x0014, 0x190c, 0x1515,
+	0x080c, 0x7090, 0x080c, 0x9e1d, 0x080c, 0x7173, 0x0005, 0x9746,
+	0x9748, 0x9748, 0x9746, 0x9746, 0x9746, 0x9746, 0x080c, 0x1515,
+	0x080c, 0x7090, 0x080c, 0x9e1d, 0x080c, 0x7173, 0x0005, 0xa186,
+	0x0013, 0x1128, 0x6004, 0xa082, 0x0085, 0x2008, 0x04a8, 0xa186,
+	0x0027, 0x11e8, 0x080c, 0x7090, 0x080c, 0x2c9c, 0x00d6, 0x6010,
+	0x2068, 0x080c, 0x9c5a, 0x0150, 0x6837, 0x0103, 0x6847, 0x0000,
+	0x684b, 0x0029, 0x080c, 0x5408, 0x080c, 0x9e11, 0x00de, 0x080c,
+	0x861d, 0x080c, 0x7173, 0x0005, 0x080c, 0x8663, 0x0ce0, 0xa186,
+	0x0014, 0x1dd0, 0x080c, 0x7090, 0x00d6, 0x6010, 0x2068, 0x080c,
+	0x9c5a, 0x0d60, 0x6837, 0x0103, 0x6847, 0x0000, 0x684b, 0x0006,
+	0x6850, 0xc0ec, 0x6852, 0x08f0, 0x0002, 0x9796, 0x9794, 0x9794,
+	0x9794, 0x9794, 0x9794, 0x97ae, 0x080c, 0x1515, 0x080c, 0x7090,
+	0x6030, 0xa08c, 0xff00, 0x810f, 0xa186, 0x0039, 0x0118, 0xa186,
+	0x0035, 0x1118, 0x2001, 0xb7b6, 0x0010, 0x2001, 0xb7b7, 0x2004,
+	0x6016, 0x6003, 0x000c, 0x080c, 0x7173, 0x0005, 0x080c, 0x7090,
+	0x6030, 0xa08c, 0xff00, 0x810f, 0xa186, 0x0039, 0x0118, 0xa186,
+	0x0035, 0x1118, 0x2001, 0xb7b6, 0x0010, 0x2001, 0xb7b7, 0x2004,
+	0x6016, 0x6003, 0x000e, 0x080c, 0x7173, 0x0005, 0xa182, 0x008c,
+	0x1220, 0xa182, 0x0085, 0x0208, 0x001a, 0x080c, 0x8663, 0x0005,
+	0x97d7, 0x97d7, 0x97d7, 0x97d7, 0x97d9, 0x9832, 0x97d7, 0x080c,
+	0x1515, 0x00d6, 0x00f6, 0x2c78, 0x080c, 0x5305, 0x00fe, 0x0168,
+	0x6030, 0xa08c, 0xff00, 0x810f, 0xa186, 0x0039, 0x0118, 0xa186,
+	0x0035, 0x1118, 0x00de, 0x0804, 0x9845, 0x080c, 0x9c5a, 0x1118,
+	0x080c, 0x9e11, 0x00f0, 0x6010, 0x2068, 0x684c, 0xd0e4, 0x1110,
+	0x080c, 0x9e11, 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0128, 0x684b,
+	0x0006, 0xc0ec, 0x6852, 0x0048, 0xd0bc, 0x0118, 0x684b, 0x0002,
+	0x0020, 0x684b, 0x0005, 0x080c, 0x9ed2, 0x6847, 0x0000, 0x080c,
+	0x5408, 0x2c68, 0x080c, 0x85c7, 0x01c0, 0x6003, 0x0001, 0x6007,
+	0x001e, 0x600b, 0xffff, 0x2009, 0xbb8e, 0x210c, 0x6136, 0x2009,
+	0xbb8f, 0x210c, 0x613a, 0x6918, 0x611a, 0x080c, 0xa027, 0x6950,
+	0x6152, 0x601f, 0x0001, 0x080c, 0x6c8d, 0x2d60, 0x080c, 0x861d,
+	0x00de, 0x0005, 0x00f6, 0x2c78, 0x080c, 0x5305, 0x00fe, 0x0598,
+	0x6030, 0xa08c, 0xff00, 0x810f, 0xa186, 0x0035, 0x0130, 0xa186,
+	0x001e, 0x0118, 0xa186, 0x0039, 0x1530, 0x00d6, 0x2c68, 0x080c,
+	0xa10a, 0x1904, 0x988a, 0x080c, 0x85c7, 0x01d8, 0x6106, 0x6003,
+	0x0001, 0x601f, 0x0001, 0x6918, 0x611a, 0x6928, 0x612a, 0x692c,
+	0x612e, 0x6930, 0xa18c, 0x00ff, 0x6132, 0x6934, 0x6136, 0x6938,
+	0x613a, 0x6950, 0x6152, 0x080c, 0xa027, 0x080c, 0x6c8d, 0x080c,
+	0x7173, 0x2d60, 0x00f8, 0x00d6, 0x6010, 0x2068, 0x080c, 0x9c5a,
+	0x01c8, 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0128, 0xc0ec, 0x6852,
+	0x684b, 0x0006, 0x0048, 0xd0bc, 0x0118, 0x684b, 0x0002, 0x0020,
+	0x684b, 0x0005, 0x080c, 0x9ed2, 0x6847, 0x0000, 0x080c, 0x5408,
+	0x080c, 0x9e11, 0x00de, 0x080c, 0x861d, 0x0005, 0x0016, 0x00d6,
+	0x6010, 0x2068, 0x080c, 0x9c5a, 0x0140, 0x6837, 0x0103, 0x684b,
+	0x0028, 0x6847, 0x0000, 0x080c, 0x5408, 0x00de, 0x001e, 0xa186,
+	0x0013, 0x0148, 0xa186, 0x0014, 0x0130, 0xa186, 0x0027, 0x0118,
+	0x080c, 0x8663, 0x0030, 0x080c, 0x7090, 0x080c, 0x9e1d, 0x080c,
+	0x7173, 0x0005, 0x0056, 0x0066, 0x00d6, 0x00f6, 0x2029, 0x0001,
+	0xa182, 0x0101, 0x1208, 0x0010, 0x2009, 0x0100, 0x2130, 0x2069,
+	0xbb98, 0x831c, 0x2300, 0xad18, 0x2009, 0x0020, 0xaf90, 0x001d,
+	0x080c, 0x990d, 0xa6b2, 0x0020, 0x7804, 0xa06d, 0x0110, 0x080c,
+	0x161f, 0x080c, 0x15f8, 0x0500, 0x8528, 0x6837, 0x0110, 0x683b,
+	0x0000, 0x2d20, 0x7c06, 0xa68a, 0x003d, 0x1228, 0x2608, 0xad90,
+	0x000f, 0x0459, 0x0088, 0xa6b2, 0x003c, 0x2009, 0x003c, 0x2d78,
+	0xad90, 0x000f, 0x0411, 0x0c28, 0x00fe, 0x852f, 0xa5ad, 0x0003,
+	0x7d36, 0xa5ac, 0x0000, 0x0028, 0x00fe, 0x852f, 0xa5ad, 0x0003,
+	0x7d36, 0x00de, 0x006e, 0x005e, 0x0005, 0x00f6, 0x8dff, 0x0158,
+	0x6804, 0xa07d, 0x0130, 0x6807, 0x0000, 0x080c, 0x5408, 0x2f68,
+	0x0cb8, 0x080c, 0x5408, 0x00fe, 0x0005, 0x0156, 0xa184, 0x0001,
+	0x0108, 0x8108, 0x810c, 0x21a8, 0x2304, 0x8007, 0x2012, 0x8318,
+	0x8210, 0x1f04, 0x9914, 0x015e, 0x0005, 0x0066, 0x0126, 0x2091,
+	0x8000, 0x2031, 0x0001, 0x601c, 0xa084, 0x000f, 0x0083, 0x012e,
+	0x006e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0066, 0x2031, 0x0000,
+	0x601c, 0xa084, 0x000f, 0x001b, 0x006e, 0x012e, 0x0005, 0x9954,
+	0x9954, 0x994f, 0x9976, 0x9942, 0x994f, 0x9976, 0x994f, 0x994f,
+	0x9942, 0x994f, 0x080c, 0x1515, 0x0036, 0x2019, 0x0010, 0x080c,
+	0xace0, 0x601f, 0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0xa006,
+	0x0005, 0xa085, 0x0001, 0x0005, 0x00d6, 0x86ff, 0x11d8, 0x6010,
+	0x2068, 0x080c, 0x9c5a, 0x01c0, 0x6834, 0xa086, 0x0139, 0x1128,
+	0x684b, 0x0005, 0x6853, 0x0000, 0x0028, 0xa00e, 0x2001, 0x0005,
+	0x080c, 0x54db, 0x080c, 0x9ed2, 0x080c, 0x5408, 0x080c, 0x861d,
+	0xa085, 0x0001, 0x00de, 0x0005, 0xa006, 0x0ce0, 0x6000, 0xa08a,
+	0x0010, 0x1a0c, 0x1515, 0x000b, 0x0005, 0x998d, 0x99ae, 0x998f,
+	0x99cd, 0x99ab, 0x998d, 0x994f, 0x9954, 0x9954, 0x994f, 0x994f,
+	0x994f, 0x994f, 0x994f, 0x994f, 0x994f, 0x080c, 0x1515, 0x86ff,
+	0x11b8, 0x601c, 0xa086, 0x0006, 0x0198, 0x00d6, 0x6010, 0x2068,
+	0x080c, 0x9c5a, 0x0110, 0x080c, 0x9ed2, 0x00de, 0x6007, 0x0085,
+	0x6003, 0x000b, 0x601f, 0x0002, 0x080c, 0x6c8d, 0x080c, 0x7173,
+	0xa085, 0x0001, 0x0005, 0x080c, 0x194d, 0x0c08, 0x00e6, 0x2071,
+	0xb7e0, 0x7024, 0xac06, 0x1110, 0x080c, 0x7f59, 0x601c, 0xa084,
+	0x000f, 0xa086, 0x0006, 0x1150, 0x0086, 0x0096, 0x2049, 0x0001,
+	0x2c40, 0x080c, 0x8130, 0x009e, 0x008e, 0x0010, 0x080c, 0x7e58,
+	0x00ee, 0x1928, 0x080c, 0x994f, 0x0005, 0x0036, 0x00e6, 0x2071,
+	0xb7e0, 0x703c, 0xac06, 0x1140, 0x2019, 0x0000, 0x080c, 0x7fe4,
+	0x00ee, 0x003e, 0x0804, 0x998f, 0x080c, 0x825d, 0x00ee, 0x003e,
+	0x1904, 0x998f, 0x080c, 0x994f, 0x0005, 0x00c6, 0x601c, 0xa084,
+	0x000f, 0x0013, 0x00ce, 0x0005, 0x99fe, 0x9a6b, 0x9bb9, 0x9a09,
+	0x9e1d, 0x99fe, 0xacd2, 0xa14e, 0x9a6b, 0x99f7, 0x9c24, 0x080c,
+	0x1515, 0x080c, 0x9e58, 0x1110, 0x080c, 0x8c19, 0x0005, 0x080c,
+	0x7090, 0x080c, 0x7173, 0x080c, 0x861d, 0x0005, 0x6017, 0x0001,
+	0x0005, 0x080c, 0x9c5a, 0x0120, 0x6010, 0xa080, 0x0019, 0x2c02,
+	0x6000, 0xa08a, 0x0010, 0x1a0c, 0x1515, 0x000b, 0x0005, 0x9a27,
+	0x9a29, 0x9a49, 0x9a5b, 0x9a68, 0x9a27, 0x99fe, 0x99fe, 0x99fe,
+	0x9a5b, 0x9a5b, 0x9a27, 0x9a27, 0x9a27, 0x9a27, 0x9a65, 0x080c,
+	0x1515, 0x00e6, 0x6010, 0x2070, 0x7050, 0xc0b5, 0x7052, 0x2071,
+	0xb7e0, 0x7024, 0xac06, 0x0190, 0x080c, 0x7e58, 0x6007, 0x0085,
+	0x6003, 0x000b, 0x601f, 0x0002, 0x2001, 0xb7b7, 0x2004, 0x6016,
+	0x080c, 0x6c8d, 0x080c, 0x7173, 0x00ee, 0x0005, 0x6017, 0x0001,
+	0x0cd8, 0x00d6, 0x6010, 0x2068, 0x6850, 0xc0b5, 0x6852, 0x00de,
+	0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x080c, 0x6c8d,
+	0x080c, 0x7173, 0x0005, 0x00d6, 0x6017, 0x0001, 0x6010, 0x2068,
+	0x6850, 0xc0b5, 0x6852, 0x00de, 0x0005, 0x080c, 0x861d, 0x0005,
+	0x080c, 0x194d, 0x08f0, 0x6000, 0xa08a, 0x0010, 0x1a0c, 0x1515,
+	0x000b, 0x0005, 0x9a82, 0x9a06, 0x9a84, 0x9a82, 0x9a84, 0x9a84,
+	0x99ff, 0x9a82, 0x99f9, 0x99f9, 0x9a82, 0x9a82, 0x9a82, 0x9a82,
+	0x9a82, 0x9a82, 0x080c, 0x1515, 0x00d6, 0x6018, 0x2068, 0x6804,
+	0xa084, 0x00ff, 0x00de, 0xa08a, 0x000c, 0x1a0c, 0x1515, 0x000b,
+	0x0005, 0x9a9d, 0x9b5f, 0x9a9f, 0x9add, 0x9a9f, 0x9add, 0x9a9f,
+	0x9aad, 0x9a9d, 0x9add, 0x9a9d, 0x9ac9, 0x080c, 0x1515, 0x6004,
+	0xa08e, 0x0016, 0x05a8, 0xa08e, 0x0004, 0x0590, 0xa08e, 0x0002,
+	0x0578, 0xa08e, 0x004b, 0x0904, 0x9b5b, 0x6004, 0x080c, 0x9e58,
+	0x0904, 0x9b78, 0xa08e, 0x0021, 0x0904, 0x9b7c, 0xa08e, 0x0022,
+	0x0904, 0x9b78, 0xa08e, 0x003d, 0x0904, 0x9b7c, 0xa08e, 0x0039,
+	0x0904, 0x9b80, 0xa08e, 0x0035, 0x0904, 0x9b80, 0xa08e, 0x001e,
+	0x0188, 0xa08e, 0x0001, 0x1150, 0x00d6, 0x6018, 0x2068, 0x6804,
+	0xa084, 0x00ff, 0x00de, 0xa086, 0x0006, 0x0110, 0x080c, 0x2c9c,
+	0x080c, 0x8c19, 0x080c, 0x9e1d, 0x0005, 0x00c6, 0x00d6, 0x6104,
+	0xa186, 0x0016, 0x0904, 0x9b4c, 0xa186, 0x0002, 0x15d8, 0x2001,
+	0xb535, 0x2004, 0xd08c, 0x1198, 0x080c, 0x5acf, 0x1180, 0x2001,
+	0xb79f, 0x2003, 0x0001, 0x2001, 0xb500, 0x2003, 0x0001, 0xa085,
+	0x0001, 0x080c, 0x5b13, 0x080c, 0x5a07, 0x0804, 0x9ba2, 0x6018,
+	0x2068, 0x2001, 0xb535, 0x2004, 0xd0ac, 0x1904, 0x9ba2, 0x68a0,
+	0xd0bc, 0x1904, 0x9ba2, 0x6840, 0xa084, 0x00ff, 0xa005, 0x0190,
+	0x8001, 0x6842, 0x6013, 0x0000, 0x601f, 0x0007, 0x6017, 0x0398,
+	0x603f, 0x0000, 0x080c, 0x85c7, 0x0128, 0x2d00, 0x601a, 0x601f,
+	0x0001, 0x0450, 0x00de, 0x00ce, 0x6004, 0xa08e, 0x0002, 0x11a8,
+	0x6018, 0xa080, 0x0028, 0x2004, 0xa086, 0x007e, 0x1170, 0x2009,
+	0xb535, 0x2104, 0xc085, 0x200a, 0x00e6, 0x2071, 0xb500, 0x080c,
+	0x4bc6, 0x00ee, 0x080c, 0x8c19, 0x0020, 0x080c, 0x8c19, 0x080c,
+	0x2c9c, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x2cc2, 0x012e,
+	0x00ee, 0x080c, 0x9e1d, 0x0005, 0x2001, 0x0002, 0x080c, 0x4efd,
+	0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x6cd3, 0x080c, 0x7173,
+	0x00de, 0x00ce, 0x0c80, 0x080c, 0x2cc2, 0x0804, 0x9ad8, 0x00c6,
+	0x00d6, 0x6104, 0xa186, 0x0016, 0x0d38, 0x6018, 0x2068, 0x6840,
+	0xa084, 0x00ff, 0xa005, 0x0904, 0x9b22, 0x8001, 0x6842, 0x6003,
+	0x0001, 0x080c, 0x6cd3, 0x080c, 0x7173, 0x00de, 0x00ce, 0x0898,
+	0x080c, 0x8c19, 0x0804, 0x9ada, 0x080c, 0x8c47, 0x0804, 0x9ada,
+	0x00d6, 0x2c68, 0x6104, 0x080c, 0xa10a, 0x00de, 0x0118, 0x080c,
+	0x861d, 0x00b8, 0x6004, 0x8007, 0x6130, 0xa18c, 0x00ff, 0xa105,
+	0x6032, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x6038,
+	0x600a, 0x2001, 0xb7b7, 0x2004, 0x6016, 0x080c, 0x6c8d, 0x080c,
+	0x7173, 0x0005, 0x00de, 0x00ce, 0x080c, 0x8c19, 0x080c, 0x2c9c,
+	0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x2cc2, 0x6013, 0x0000,
+	0x601f, 0x0007, 0x6017, 0x0398, 0x603f, 0x0000, 0x012e, 0x00ee,
+	0x0005, 0x6000, 0xa08a, 0x0010, 0x1a0c, 0x1515, 0x000b, 0x0005,
+	0x9bd0, 0x9bd0, 0x9bd0, 0x9bd0, 0x9bd0, 0x9bd0, 0x9bd0, 0x9bd0,
+	0x9bd0, 0x99fe, 0x9bd0, 0x9a06, 0x9bd2, 0x9a06, 0x9bdf, 0x9bd0,
+	0x080c, 0x1515, 0x6004, 0xa086, 0x008b, 0x0148, 0x6007, 0x008b,
+	0x6003, 0x000d, 0x080c, 0x6c8d, 0x080c, 0x7173, 0x0005, 0x080c,
+	0x9e11, 0x080c, 0x9c5a, 0x0580, 0x080c, 0x2c9c, 0x00d6, 0x080c,
+	0x9c5a, 0x0168, 0x6010, 0x2068, 0x6837, 0x0103, 0x684b, 0x0006,
+	0x6847, 0x0000, 0x6850, 0xc0ed, 0x6852, 0x080c, 0x5408, 0x2c68,
+	0x080c, 0x85c7, 0x0150, 0x6818, 0x601a, 0x080c, 0xa027, 0x00c6,
+	0x2d60, 0x080c, 0x9e1d, 0x00ce, 0x0008, 0x2d60, 0x00de, 0x6013,
+	0x0000, 0x601f, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c,
+	0x6cd3, 0x080c, 0x7173, 0x0078, 0x6030, 0xa08c, 0xff00, 0x810f,
+	0xa186, 0x0039, 0x0118, 0xa186, 0x0035, 0x1118, 0x080c, 0x2c9c,
+	0x08b0, 0x080c, 0x9e1d, 0x0005, 0x6000, 0xa08a, 0x0010, 0x1a0c,
+	0x1515, 0x000b, 0x0005, 0x9c3b, 0x9c3b, 0x9c3b, 0x9c3d, 0x9c3d,
+	0x9c3b, 0x9c3b, 0x9c3b, 0x9c3b, 0x9c3b, 0x9c3b, 0x9c3b, 0x9c3b,
+	0x9c3b, 0x9c3b, 0x9c3b, 0x080c, 0x1515, 0x080c, 0x825d, 0x190c,
+	0x1515, 0x6110, 0x2168, 0x684b, 0x0006, 0x080c, 0x5408, 0x080c,
+	0x861d, 0x0005, 0xa284, 0x0007, 0x1158, 0xa282, 0xbd00, 0x0240,
+	0x2001, 0xb517, 0x2004, 0xa202, 0x1218, 0xa085, 0x0001, 0x0005,
+	0xa006, 0x0ce8, 0x0026, 0x6210, 0xa294, 0xf000, 0x002e, 0x0005,
+	0x00e6, 0x00c6, 0x0036, 0x0006, 0x0126, 0x2091, 0x8000, 0x2061,
+	0xbd00, 0x2071, 0xb500, 0x7348, 0x7068, 0xa302, 0x12a8, 0x601c,
+	0xa206, 0x1160, 0x080c, 0x9fb2, 0x0148, 0x080c, 0x9e58, 0x1110,
+	0x080c, 0x8c19, 0x00c6, 0x080c, 0x861d, 0x00ce, 0xace0, 0x0018,
+	0x705c, 0xac02, 0x1208, 0x0c38, 0x012e, 0x000e, 0x003e, 0x00ce,
+	0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0016, 0xa188, 0xb635, 0x210c,
+	0x81ff, 0x0128, 0x2061, 0xb8f4, 0x611a, 0x080c, 0x2c9c, 0xa006,
+	0x0010, 0xa085, 0x0001, 0x001e, 0x00ce, 0x00ee, 0x0005, 0x00c6,
+	0x0056, 0x0126, 0x2091, 0x8000, 0x00c6, 0x080c, 0x85c7, 0x005e,
+	0x0180, 0x6612, 0x651a, 0x080c, 0xa027, 0x601f, 0x0003, 0x2009,
+	0x004b, 0x080c, 0x864c, 0xa085, 0x0001, 0x012e, 0x005e, 0x00ce,
+	0x0005, 0xa006, 0x0cd0, 0x00c6, 0x0056, 0x0126, 0x2091, 0x8000,
+	0x62a0, 0x00c6, 0x080c, 0x9ed6, 0x005e, 0x0550, 0x6013, 0x0000,
+	0x651a, 0x080c, 0xa027, 0x601f, 0x0003, 0x0016, 0x00c6, 0x2560,
+	0x080c, 0x51aa, 0x00ce, 0x080c, 0x6df5, 0x0076, 0x2039, 0x0000,
+	0x080c, 0x6d02, 0x2c08, 0x080c, 0xae82, 0x007e, 0x001e, 0xd184,
+	0x0128, 0x080c, 0x861d, 0xa085, 0x0001, 0x0030, 0x2009, 0x004c,
+	0x080c, 0x864c, 0xa085, 0x0001, 0x012e, 0x005e, 0x00ce, 0x0005,
+	0xa006, 0x0cd0, 0x00f6, 0x00c6, 0x0046, 0x00c6, 0x080c, 0x85c7,
+	0x2c78, 0x00ce, 0x0180, 0x7e12, 0x2c00, 0x781a, 0x781f, 0x0003,
+	0x2021, 0x0005, 0x080c, 0x9d50, 0x2f60, 0x2009, 0x004d, 0x080c,
+	0x864c, 0xa085, 0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x00f6,
+	0x00c6, 0x0046, 0x00c6, 0x080c, 0x85c7, 0x2c78, 0x00ce, 0x0178,
+	0x7e12, 0x2c00, 0x781a, 0x781f, 0x0003, 0x2021, 0x0005, 0x0481,
+	0x2f60, 0x2009, 0x004e, 0x080c, 0x864c, 0xa085, 0x0001, 0x004e,
+	0x00ce, 0x00fe, 0x0005, 0x00f6, 0x00c6, 0x0046, 0x00c6, 0x080c,
+	0x85c7, 0x2c78, 0x00ce, 0x01c0, 0x7e12, 0x2c00, 0x781a, 0x781f,
+	0x0003, 0x2021, 0x0004, 0x00a1, 0x2001, 0xb7a0, 0x2004, 0xd0fc,
+	0x0120, 0x2f60, 0x080c, 0x861d, 0x0028, 0x2f60, 0x2009, 0x0052,
+	0x080c, 0x864c, 0xa085, 0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005,
+	0x0096, 0x0076, 0x0126, 0x2091, 0x8000, 0x080c, 0x514c, 0x0118,
+	0x2001, 0x9d55, 0x0028, 0x080c, 0x511c, 0x0158, 0x2001, 0x9d5b,
+	0x0006, 0xa00e, 0x2400, 0x080c, 0x54db, 0x080c, 0x5408, 0x000e,
+	0x0807, 0x2418, 0x080c, 0x702f, 0x62a0, 0x0086, 0x2041, 0x0001,
+	0x2039, 0x0001, 0x2608, 0x080c, 0x6e0e, 0x008e, 0x080c, 0x6d02,
+	0x2f08, 0x2648, 0x080c, 0xae82, 0x613c, 0x81ff, 0x090c, 0x6ec3,
+	0x080c, 0x7173, 0x012e, 0x007e, 0x009e, 0x0005, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0x00c6, 0x080c, 0x85c7, 0x001e, 0x0188, 0x660a,
+	0x611a, 0x080c, 0xa027, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009,
+	0x001f, 0x080c, 0x864c, 0xa085, 0x0001, 0x012e, 0x00ce, 0x0005,
+	0xa006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x00c6, 0x080c,
+	0x85c7, 0x001e, 0x0188, 0x660a, 0x611a, 0x080c, 0xa027, 0x601f,
+	0x0008, 0x2d00, 0x6012, 0x2009, 0x0021, 0x080c, 0x864c, 0xa085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0xa006, 0x0cd8, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0x00c6, 0x080c, 0x85c7, 0x001e, 0x0188, 0x660a,
+	0x611a, 0x080c, 0xa027, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009,
+	0x003d, 0x080c, 0x864c, 0xa085, 0x0001, 0x012e, 0x00ce, 0x0005,
+	0xa006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x00c6, 0x080c,
+	0x9ed6, 0x001e, 0x0180, 0x611a, 0x080c, 0xa027, 0x601f, 0x0001,
+	0x2d00, 0x6012, 0x2009, 0x0000, 0x080c, 0x864c, 0xa085, 0x0001,
+	0x012e, 0x00ce, 0x0005, 0xa006, 0x0cd8, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x00c6, 0x080c, 0x85c7, 0x001e, 0x0188, 0x660a, 0x611a,
+	0x080c, 0xa027, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x0044,
+	0x080c, 0x864c, 0xa085, 0x0001, 0x012e, 0x00ce, 0x0005, 0xa006,
+	0x0cd8, 0x0026, 0x00d6, 0x6218, 0x2268, 0x6a3c, 0x82ff, 0x0110,
+	0x8211, 0x6a3e, 0x00de, 0x002e, 0x0005, 0x0006, 0x6000, 0xa086,
+	0x0000, 0x0190, 0x6013, 0x0000, 0x601f, 0x0007, 0x2001, 0xb7b6,
+	0x2004, 0x0006, 0xa082, 0x0051, 0x000e, 0x0208, 0x8004, 0x6016,
+	0x080c, 0xb33a, 0x603f, 0x0000, 0x000e, 0x0005, 0x0066, 0x00c6,
+	0x00d6, 0x2031, 0xb553, 0x2634, 0xd6e4, 0x0128, 0x6618, 0x2660,
+	0x6e48, 0x080c, 0x50d5, 0x00de, 0x00ce, 0x006e, 0x0005, 0x0006,
+	0x0016, 0x6004, 0xa08e, 0x0002, 0x0140, 0xa08e, 0x0003, 0x0128,
+	0xa08e, 0x0004, 0x0110, 0xa085, 0x0001, 0x001e, 0x000e, 0x0005,
+	0x0006, 0x00d6, 0x6010, 0xa06d, 0x0148, 0x6834, 0xa086, 0x0139,
+	0x0138, 0x6838, 0xd0fc, 0x0110, 0xa006, 0x0010, 0xa085, 0x0001,
+	0x00de, 0x000e, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x00c6,
+	0x080c, 0x85c7, 0x001e, 0x0190, 0x611a, 0x080c, 0xa027, 0x601f,
+	0x0001, 0x2d00, 0x6012, 0x080c, 0x2c9c, 0x2009, 0x0028, 0x080c,
+	0x864c, 0xa085, 0x0001, 0x012e, 0x00ce, 0x0005, 0xa006, 0x0cd8,
+	0xa186, 0x0015, 0x1178, 0x2011, 0xb521, 0x2204, 0xa086, 0x0074,
+	0x1148, 0x080c, 0x8f98, 0x6003, 0x0001, 0x6007, 0x0029, 0x080c,
+	0x6cd3, 0x0020, 0x080c, 0x8c19, 0x080c, 0x861d, 0x0005, 0xa186,
+	0x0016, 0x1128, 0x2001, 0x0004, 0x080c, 0x4efd, 0x00e8, 0xa186,
+	0x0015, 0x11e8, 0x2011, 0xb521, 0x2204, 0xa086, 0x0014, 0x11b8,
+	0x00d6, 0x6018, 0x2068, 0x080c, 0x504b, 0x00de, 0x080c, 0x9051,
+	0x1170, 0x00d6, 0x6018, 0x2068, 0x6890, 0x00de, 0xa005, 0x0138,
+	0x2001, 0x0006, 0x080c, 0x4efd, 0x080c, 0x87a0, 0x0020, 0x080c,
+	0x8c19, 0x080c, 0x861d, 0x0005, 0x6848, 0xa086, 0x0005, 0x1108,
+	0x0009, 0x0005, 0x6850, 0xc0ad, 0x6852, 0x0005, 0x00e6, 0x0126,
+	0x2071, 0xb500, 0x2091, 0x8000, 0x7548, 0xa582, 0x0001, 0x0608,
+	0x704c, 0x2060, 0x6000, 0xa086, 0x0000, 0x0148, 0xace0, 0x0018,
+	0x705c, 0xac02, 0x1208, 0x0cb0, 0x2061, 0xbd00, 0x0c98, 0x6003,
+	0x0008, 0x8529, 0x754a, 0xaca8, 0x0018, 0x705c, 0xa502, 0x1230,
+	0x754e, 0xa085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x704f, 0xbd00,
+	0x0cc0, 0xa006, 0x0cc0, 0x00e6, 0x2071, 0xbb8c, 0x7014, 0xd0e4,
+	0x0150, 0x6013, 0x0000, 0x6003, 0x0001, 0x6007, 0x0050, 0x080c,
+	0x6c8d, 0x080c, 0x7173, 0x00ee, 0x0005, 0x00c6, 0x00f6, 0x2c78,
+	0x080c, 0x5305, 0x00fe, 0x0120, 0x601c, 0xa084, 0x000f, 0x0013,
+	0x00ce, 0x0005, 0x99fe, 0x9f2d, 0x9f30, 0x9f33, 0xb127, 0xb142,
+	0xb145, 0x99fe, 0x99fe, 0x080c, 0x1515, 0xe000, 0xe000, 0x0005,
+	0xe000, 0xe000, 0x0005, 0x0009, 0x0005, 0x00f6, 0x2c78, 0x080c,
+	0x5305, 0x0538, 0x080c, 0x85c7, 0x1128, 0x2001, 0xb7b8, 0x2004,
+	0x783e, 0x00f8, 0x7818, 0x601a, 0x080c, 0xa027, 0x781c, 0xa086,
+	0x0003, 0x0128, 0x7808, 0x6036, 0x2f00, 0x603a, 0x0020, 0x7808,
+	0x603a, 0x2f00, 0x6036, 0x602a, 0x601f, 0x0001, 0x6007, 0x0035,
+	0x6003, 0x0001, 0x7950, 0x6152, 0x080c, 0x6c8d, 0x080c, 0x7173,
+	0x2f60, 0x00fe, 0x0005, 0x0016, 0x00f6, 0x682c, 0x6032, 0xa08e,
+	0x0001, 0x0138, 0xa086, 0x0005, 0x0140, 0xa006, 0x602a, 0x602e,
+	0x00a0, 0x6820, 0xc0f4, 0xc0d5, 0x6822, 0x6810, 0x2078, 0x787c,
+	0x6938, 0xa102, 0x7880, 0x6934, 0xa103, 0x1e78, 0x6834, 0x602a,
+	0x6838, 0xa084, 0xfffc, 0x683a, 0x602e, 0x2d00, 0x6036, 0x6808,
+	0x603a, 0x6918, 0x611a, 0x6950, 0x6152, 0x601f, 0x0001, 0x6007,
+	0x0039, 0x6003, 0x0001, 0x080c, 0x6c8d, 0x6803, 0x0002, 0x00fe,
+	0x001e, 0x0005, 0x00f6, 0x2c78, 0x080c, 0x5305, 0x1118, 0xa085,
+	0x0001, 0x0070, 0x6020, 0xd0f4, 0x1150, 0xc0f5, 0x6022, 0x6010,
+	0x2078, 0x7828, 0x603a, 0x782c, 0x6036, 0x080c, 0x194d, 0xa006,
+	0x00fe, 0x0005, 0x0006, 0x0016, 0x6004, 0xa08e, 0x0034, 0x01b8,
+	0xa08e, 0x0035, 0x01a0, 0xa08e, 0x0036, 0x0188, 0xa08e, 0x0037,
+	0x0170, 0xa08e, 0x0038, 0x0158, 0xa08e, 0x0039, 0x0140, 0xa08e,
+	0x003a, 0x0128, 0xa08e, 0x003b, 0x0110, 0xa085, 0x0001, 0x001e,
+	0x000e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00e6, 0x2001,
+	0xb7b2, 0x200c, 0x8000, 0x2014, 0x2001, 0x0032, 0x080c, 0x6b40,
+	0x2001, 0xb7b6, 0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001,
+	0xb7b4, 0x200c, 0x8000, 0x2014, 0x2071, 0xb78e, 0x711a, 0x721e,
+	0x2001, 0x0064, 0x080c, 0x6b40, 0x2001, 0xb7b7, 0x82ff, 0x1110,
+	0x2011, 0x0014, 0x2202, 0x2009, 0xb7b8, 0xa280, 0x000a, 0x200a,
+	0x080c, 0x532a, 0x00ee, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005,
+	0x0006, 0x00e6, 0x2001, 0xb7b6, 0x2003, 0x0028, 0x2001, 0xb7b7,
+	0x2003, 0x0014, 0x2071, 0xb78e, 0x701b, 0x0000, 0x701f, 0x07d0,
+	0x2001, 0xb7b8, 0x2003, 0x001e, 0x00ee, 0x000e, 0x0005, 0x00d6,
+	0x6054, 0xa06d, 0x0110, 0x080c, 0x160f, 0x00de, 0x0005, 0x0005,
+	0x00c6, 0x0126, 0x2091, 0x8000, 0x00c6, 0x080c, 0x85c7, 0x001e,
+	0x0178, 0x611a, 0x0ca1, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009,
+	0x0033, 0x080c, 0x864c, 0xa085, 0x0001, 0x012e, 0x00ce, 0x0005,
+	0xa006, 0x0cd8, 0x00d6, 0x00e6, 0x00f6, 0x2071, 0xb500, 0xa186,
+	0x0015, 0x1500, 0x7084, 0xa086, 0x0018, 0x11e0, 0x6010, 0x2068,
+	0x6a3c, 0xd2e4, 0x1160, 0x2c78, 0x080c, 0x7331, 0x01d8, 0x7070,
+	0x6a50, 0xa206, 0x1160, 0x7074, 0x6a54, 0xa206, 0x1140, 0x6218,
+	0xa290, 0x0028, 0x2214, 0x2009, 0x0000, 0x080c, 0x2ce1, 0x080c,
+	0x87a0, 0x0020, 0x080c, 0x8c19, 0x080c, 0x861d, 0x00fe, 0x00ee,
+	0x00de, 0x0005, 0x7054, 0x6a54, 0xa206, 0x0d48, 0x0c80, 0x00c6,
+	0x0126, 0x2091, 0x8000, 0x00c6, 0x080c, 0x85c7, 0x001e, 0x0180,
+	0x611a, 0x080c, 0xa027, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009,
+	0x0043, 0x080c, 0x864c, 0xa085, 0x0001, 0x012e, 0x00ce, 0x0005,
+	0xa006, 0x0cd8, 0x00d6, 0x00e6, 0x00f6, 0x2071, 0xb500, 0xa186,
+	0x0015, 0x11c0, 0x7084, 0xa086, 0x0004, 0x11a0, 0x6010, 0xa0e8,
+	0x000f, 0x2c78, 0x080c, 0x7331, 0x01a8, 0x7070, 0x6a08, 0xa206,
+	0x1130, 0x7074, 0x6a0c, 0xa206, 0x1110, 0x080c, 0x2c9c, 0x080c,
+	0x87a0, 0x0020, 0x080c, 0x8c19, 0x080c, 0x861d, 0x00fe, 0x00ee,
+	0x00de, 0x0005, 0x7054, 0x6a0c, 0xa206, 0x0d78, 0x0c80, 0x0016,
+	0x0026, 0x684c, 0xd0ac, 0x0178, 0x6914, 0x6a10, 0x2100, 0xa205,
+	0x0150, 0x6860, 0xa106, 0x1118, 0x685c, 0xa206, 0x0120, 0x6962,
+	0x6a5e, 0xa085, 0x0001, 0x002e, 0x001e, 0x0005, 0x00d6, 0x0036,
+	0x6310, 0x2368, 0x684a, 0x6952, 0xa29e, 0x4000, 0x11a0, 0x00c6,
+	0x6318, 0x2360, 0x2009, 0x0000, 0x6838, 0xd0f4, 0x1140, 0x080c,
+	0x524a, 0x1108, 0xc185, 0x6000, 0xd0bc, 0x0108, 0xc18d, 0x6a66,
+	0x696a, 0x00ce, 0x0080, 0x6a66, 0x3918, 0xa398, 0x0006, 0x231c,
+	0x686b, 0x0004, 0x6b72, 0x00c6, 0x6318, 0x2360, 0x6004, 0xa084,
+	0x00ff, 0x686e, 0x00ce, 0x080c, 0x5408, 0x6013, 0x0000, 0x003e,
+	0x00de, 0x0005, 0x00c6, 0x0026, 0x0016, 0xa186, 0x0035, 0x0110,
+	0x6a34, 0x0008, 0x6a28, 0x080c, 0x9c4a, 0x01f0, 0x2260, 0x611c,
+	0xa186, 0x0003, 0x0118, 0xa186, 0x0006, 0x1190, 0x6834, 0xa206,
+	0x0140, 0x6838, 0xa206, 0x1160, 0x6108, 0x6834, 0xa106, 0x1140,
+	0x0020, 0x6008, 0x6938, 0xa106, 0x1118, 0x6018, 0x6918, 0xa106,
+	0x001e, 0x002e, 0x00ce, 0x0005, 0xa085, 0x0001, 0x0cc8, 0x6944,
+	0xd1cc, 0x0198, 0xa18c, 0x00ff, 0xa18e, 0x0002, 0x1170, 0xad88,
+	0x001e, 0x210c, 0xa18c, 0x0f00, 0x810f, 0xa18e, 0x0001, 0x1128,
+	0x6810, 0x6914, 0xa115, 0x190c, 0x9483, 0x0005, 0x080c, 0x861d,
+	0x0804, 0x7173, 0x0066, 0x6000, 0xa0b2, 0x0010, 0x1a0c, 0x1515,
+	0x0013, 0x006e, 0x0005, 0xa16b, 0xa646, 0xa76c, 0xa16b, 0xa16b,
+	0xa16b, 0xa16b, 0xa16b, 0xa1a3, 0xa7f0, 0xa16b, 0xa16b, 0xa16b,
+	0xa16b, 0xa16b, 0xa16b, 0x080c, 0x1515, 0x0066, 0x6000, 0xa0b2,
+	0x0010, 0x1a0c, 0x1515, 0x0013, 0x006e, 0x0005, 0xa186, 0xac77,
+	0xa186, 0xa186, 0xa186, 0xa186, 0xa186, 0xa186, 0xac39, 0xacbf,
+	0xa186, 0xb26c, 0xb29c, 0xb26c, 0xb29c, 0xa186, 0x080c, 0x1515,
+	0x0066, 0x6000, 0xa0b2, 0x0010, 0x1a0c, 0x1515, 0x0013, 0x006e,
+	0x0005, 0xa1a1, 0xa940, 0xaa0d, 0xaa3a, 0xaabe, 0xa1a1, 0xabab,
+	0xab56, 0xa7fc, 0xac0f, 0xac24, 0xa1a1, 0xa1a1, 0xa1a1, 0xa1a1,
+	0xa1a1, 0x080c, 0x1515, 0xa1b2, 0x0080, 0x1a0c, 0x1515, 0x2100,
+	0xa1b2, 0x0040, 0x1a04, 0xa5ba, 0x0002, 0xa1ed, 0xa3b8, 0xa1ed,
+	0xa1ed, 0xa1ed, 0xa3bf, 0xa1ed, 0xa1ed, 0xa1ed, 0xa1ed, 0xa1ed,
+	0xa1ed, 0xa1ed, 0xa1ed, 0xa1ed, 0xa1ed, 0xa1ed, 0xa1ed, 0xa1ed,
+	0xa1ed, 0xa1ed, 0xa1ed, 0xa1ed, 0xa1ef, 0xa24d, 0xa25c, 0xa2aa,
+	0xa2c8, 0xa346, 0xa3a5, 0xa1ed, 0xa1ed, 0xa3c2, 0xa1ed, 0xa1ed,
+	0xa3d5, 0xa3e0, 0xa1ed, 0xa1ed, 0xa1ed, 0xa1ed, 0xa1ed, 0xa46b,
+	0xa1ed, 0xa1ed, 0xa47e, 0xa1ed, 0xa1ed, 0xa436, 0xa1ed, 0xa1ed,
+	0xa1ed, 0xa496, 0xa1ed, 0xa1ed, 0xa1ed, 0xa510, 0xa1ed, 0xa1ed,
+	0xa1ed, 0xa1ed, 0xa1ed, 0xa1ed, 0xa581, 0x080c, 0x1515, 0x080c,
+	0x5309, 0x1150, 0x2001, 0xb535, 0x2004, 0xd0cc, 0x1128, 0xa084,
+	0x0009, 0xa086, 0x0008, 0x1140, 0x6007, 0x0009, 0x602b, 0x0009,
+	0x6013, 0x0000, 0x0804, 0xa3b3, 0x080c, 0x52f9, 0x00e6, 0x00c6,
+	0x0036, 0x0026, 0x0016, 0x6218, 0x2270, 0x72a0, 0x0026, 0x2019,
+	0x0029, 0x080c, 0x6df5, 0x0076, 0x2039, 0x0000, 0x080c, 0x6d02,
+	0x2c08, 0x080c, 0xae82, 0x007e, 0x001e, 0x2e60, 0x080c, 0x51aa,
+	0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee, 0x6618, 0x00c6, 0x2660,
+	0x080c, 0x4fb8, 0x00ce, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff,
+	0xa082, 0x0006, 0x0278, 0x080c, 0xadc6, 0x1904, 0xa2a4, 0x080c,
+	0xad66, 0x1120, 0x6007, 0x0008, 0x0804, 0xa3b3, 0x6007, 0x0009,
+	0x0804, 0xa3b3, 0x080c, 0xaf7b, 0x0128, 0x080c, 0xadc6, 0x0d78,
+	0x0804, 0xa2a4, 0x6013, 0x1900, 0x0c88, 0x080c, 0x2dbf, 0x1904,
+	0xa5b7, 0x6106, 0x080c, 0xad20, 0x6007, 0x0006, 0x0804, 0xa3b3,
+	0x6007, 0x0007, 0x0804, 0xa3b3, 0x080c, 0xb2d0, 0x1904, 0xa5b7,
+	0x080c, 0x2dbf, 0x1904, 0xa5b7, 0x00d6, 0x6618, 0x2668, 0x6e04,
+	0xa684, 0x00ff, 0xa082, 0x0006, 0x1220, 0x2001, 0x0001, 0x080c,
+	0x4eeb, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0188, 0xa686,
+	0x0004, 0x0170, 0x6e04, 0xa6b4, 0x00ff, 0xa686, 0x0006, 0x0140,
+	0xa686, 0x0004, 0x0128, 0xa686, 0x0005, 0x0110, 0x00de, 0x00e0,
+	0x080c, 0xae24, 0x11a0, 0xa686, 0x0006, 0x1150, 0x0026, 0x6218,
+	0xa290, 0x0028, 0x2214, 0x2009, 0x0000, 0x080c, 0x2ce1, 0x002e,
+	0x080c, 0x504b, 0x6007, 0x000a, 0x00de, 0x0804, 0xa3b3, 0x6007,
+	0x000b, 0x00de, 0x0804, 0xa3b3, 0x080c, 0x2c9c, 0x6007, 0x0001,
+	0x0804, 0xa3b3, 0x080c, 0xb2d0, 0x1904, 0xa5b7, 0x080c, 0x2dbf,
+	0x1904, 0xa5b7, 0x6618, 0x00d6, 0x2668, 0x6e04, 0x00de, 0xa686,
+	0x0707, 0x0d50, 0x0026, 0x6218, 0xa290, 0x0028, 0x2214, 0x2009,
+	0x0000, 0x080c, 0x2ce1, 0x002e, 0x6007, 0x000c, 0x0804, 0xa3b3,
+	0x080c, 0x5309, 0x1140, 0x2001, 0xb535, 0x2004, 0xa084, 0x0009,
+	0xa086, 0x0008, 0x1110, 0x0804, 0xa1fc, 0x080c, 0x52f9, 0x6618,
+	0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x06e8,
+	0x1138, 0x0026, 0x2001, 0x0006, 0x080c, 0x4f2a, 0x002e, 0x0050,
+	0xa6b4, 0xff00, 0x8637, 0xa686, 0x0004, 0x0120, 0xa686, 0x0006,
+	0x1904, 0xa2a4, 0x080c, 0xae31, 0x1120, 0x6007, 0x000e, 0x0804,
+	0xa3b3, 0x0046, 0x6418, 0xa4a0, 0x0028, 0x2424, 0xa4a4, 0x00ff,
+	0x8427, 0x0046, 0x080c, 0x2c9c, 0x004e, 0x0016, 0xa006, 0x2009,
+	0xb553, 0x210c, 0xd1a4, 0x0158, 0x2009, 0x0029, 0x080c, 0xb0e8,
+	0x6018, 0x00d6, 0x2068, 0x6800, 0xc0e5, 0x6802, 0x00de, 0x001e,
+	0x004e, 0x6007, 0x0001, 0x0804, 0xa3b3, 0x2001, 0x0001, 0x080c,
+	0x4eeb, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019,
+	0xb505, 0x2011, 0xbb90, 0x080c, 0x90da, 0x003e, 0x002e, 0x001e,
+	0x015e, 0xa005, 0x0168, 0xa6b4, 0xff00, 0x8637, 0xa682, 0x0004,
+	0x0a04, 0xa2a4, 0xa682, 0x0007, 0x0a04, 0xa2f2, 0x0804, 0xa2a4,
+	0x6013, 0x1900, 0x6007, 0x0009, 0x0804, 0xa3b3, 0x080c, 0x5309,
+	0x1140, 0x2001, 0xb535, 0x2004, 0xa084, 0x0009, 0xa086, 0x0008,
+	0x1110, 0x0804, 0xa1fc, 0x080c, 0x52f9, 0x6618, 0xa6b0, 0x0001,
+	0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x06b8, 0xa6b4, 0xff00,
+	0x8637, 0xa686, 0x0004, 0x0120, 0xa686, 0x0006, 0x1904, 0xa2a4,
+	0x080c, 0xae59, 0x1138, 0x080c, 0xad66, 0x1120, 0x6007, 0x0010,
+	0x0804, 0xa3b3, 0x0046, 0x6418, 0xa4a0, 0x0028, 0x2424, 0xa4a4,
+	0x00ff, 0x8427, 0x0046, 0x080c, 0x2c9c, 0x004e, 0x0016, 0xa006,
+	0x2009, 0xb553, 0x210c, 0xd1a4, 0x0158, 0x2009, 0x0029, 0x080c,
+	0xb0e8, 0x6018, 0x00d6, 0x2068, 0x6800, 0xc0e5, 0x6802, 0x00de,
+	0x001e, 0x004e, 0x6007, 0x0001, 0x00f0, 0x080c, 0xaf7b, 0x0140,
+	0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0950, 0x0804, 0xa2a4,
+	0x6013, 0x1900, 0x6007, 0x0009, 0x0070, 0x080c, 0x2dbf, 0x1904,
+	0xa5b7, 0x080c, 0xb2d0, 0x1904, 0xa5b7, 0x080c, 0xa5df, 0x1904,
+	0xa2a4, 0x6007, 0x0012, 0x6003, 0x0001, 0x080c, 0x6cd3, 0x0005,
+	0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x6cd3, 0x0cc0, 0x6007,
+	0x0005, 0x0cc0, 0x080c, 0xb2d0, 0x1904, 0xa5b7, 0x080c, 0x2dbf,
+	0x1904, 0xa5b7, 0x080c, 0xa5df, 0x1904, 0xa2a4, 0x6007, 0x0020,
+	0x6003, 0x0001, 0x080c, 0x6cd3, 0x0005, 0x080c, 0x2dbf, 0x1904,
+	0xa5b7, 0x6007, 0x0023, 0x6003, 0x0001, 0x080c, 0x6cd3, 0x0005,
+	0x080c, 0xb2d0, 0x1904, 0xa5b7, 0x080c, 0x2dbf, 0x1904, 0xa5b7,
+	0x080c, 0xa5df, 0x1904, 0xa2a4, 0x0016, 0x0026, 0x2011, 0xbb91,
+	0x2214, 0xa286, 0xffff, 0x0190, 0x2c08, 0x080c, 0x9c4a, 0x01e0,
+	0x2260, 0x2011, 0xbb90, 0x2214, 0x6008, 0xa206, 0x11a8, 0x6018,
+	0xa190, 0x0006, 0x2214, 0xa206, 0x01e8, 0x0070, 0x2011, 0xbb90,
+	0x2214, 0x2c08, 0xa006, 0x080c, 0xb0ba, 0x11a0, 0x2011, 0xbb91,
+	0x2214, 0xa286, 0xffff, 0x01c0, 0x2160, 0x6007, 0x0026, 0x6013,
+	0x1700, 0x2011, 0xbb89, 0x2214, 0xa296, 0xffff, 0x1180, 0x6007,
+	0x0025, 0x0068, 0x601c, 0xa086, 0x0007, 0x1d70, 0x6004, 0xa086,
+	0x0024, 0x1110, 0x080c, 0x861d, 0x2160, 0x6007, 0x0025, 0x6003,
+	0x0001, 0x080c, 0x6cd3, 0x002e, 0x001e, 0x0005, 0x2001, 0x0001,
+	0x080c, 0x4eeb, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004,
+	0x2019, 0xb505, 0x2011, 0xbb96, 0x080c, 0x90da, 0x003e, 0x002e,
+	0x001e, 0x015e, 0x0120, 0x6007, 0x0031, 0x0804, 0xa3b3, 0x080c,
+	0x8df6, 0x080c, 0x5acf, 0x11b0, 0x0006, 0x0026, 0x0036, 0x080c,
+	0x5aeb, 0x1158, 0x2001, 0xb79f, 0x2003, 0x0001, 0x2001, 0xb500,
+	0x2003, 0x0001, 0x080c, 0x5a07, 0x0010, 0x080c, 0x5aa6, 0x003e,
+	0x002e, 0x000e, 0x0005, 0x080c, 0x2dbf, 0x1904, 0xa5b7, 0x080c,
+	0xa5df, 0x1904, 0xa2a4, 0x6106, 0x080c, 0xa5fb, 0x6007, 0x002b,
+	0x0804, 0xa3b3, 0x6007, 0x002c, 0x0804, 0xa3b3, 0x080c, 0xb2d0,
+	0x1904, 0xa5b7, 0x080c, 0x2dbf, 0x1904, 0xa5b7, 0x080c, 0xa5df,
+	0x1904, 0xa2a4, 0x6106, 0x080c, 0xa5ff, 0x1120, 0x6007, 0x002e,
+	0x0804, 0xa3b3, 0x6007, 0x002f, 0x0804, 0xa3b3, 0x080c, 0x2dbf,
+	0x1904, 0xa5b7, 0x00e6, 0x00d6, 0x00c6, 0x6018, 0xa080, 0x0001,
+	0x200c, 0xa184, 0x00ff, 0xa086, 0x0006, 0x0158, 0xa184, 0xff00,
+	0x8007, 0xa086, 0x0006, 0x0128, 0x00ce, 0x00de, 0x00ee, 0x0804,
+	0xa3b8, 0x2001, 0xb572, 0x2004, 0xd0e4, 0x0904, 0xa50d, 0x2071,
+	0xbb8c, 0x7010, 0x6036, 0x7014, 0x603a, 0x7108, 0x720c, 0x2001,
+	0xb553, 0x2004, 0xd0a4, 0x0140, 0x6018, 0x2068, 0x6810, 0xa106,
+	0x1118, 0x6814, 0xa206, 0x01f8, 0x2001, 0xb553, 0x2004, 0xd0ac,
+	0x1590, 0x2069, 0xb500, 0x6874, 0xa206, 0x1568, 0x6870, 0xa106,
+	0x1550, 0x7210, 0x080c, 0x9c4a, 0x0558, 0x080c, 0xb154, 0x0540,
+	0x622a, 0x6007, 0x0036, 0x6003, 0x0001, 0x080c, 0x6c8d, 0x00ce,
+	0x00de, 0x00ee, 0x0005, 0x7214, 0xa286, 0xffff, 0x0150, 0x080c,
+	0x9c4a, 0x01b0, 0xa280, 0x0002, 0x2004, 0x7110, 0xa106, 0x1180,
+	0x0c08, 0x7210, 0x2c08, 0xa085, 0x0001, 0x080c, 0xb0ba, 0x2c10,
+	0x2160, 0x0130, 0x08b8, 0x6007, 0x0037, 0x6013, 0x1500, 0x08d8,
+	0x6007, 0x0037, 0x6013, 0x1700, 0x08b0, 0x6007, 0x0012, 0x0898,
+	0x080c, 0x2dbf, 0x1904, 0xa5b7, 0x6018, 0xa080, 0x0001, 0x2004,
+	0xa084, 0xff00, 0x8007, 0xa086, 0x0006, 0x1904, 0xa3b8, 0x00e6,
+	0x00d6, 0x00c6, 0x2001, 0xb572, 0x2004, 0xd0e4, 0x0904, 0xa579,
+	0x2069, 0xb500, 0x2071, 0xbb8c, 0x7008, 0x6036, 0x720c, 0x623a,
+	0xa286, 0xffff, 0x1150, 0x7208, 0x00c6, 0x2c08, 0xa085, 0x0001,
+	0x080c, 0xb0ba, 0x2c10, 0x00ce, 0x0588, 0x080c, 0x9c4a, 0x0570,
+	0x00c6, 0x0026, 0x2260, 0x080c, 0x991d, 0x002e, 0x00ce, 0x7118,
+	0xa18c, 0xff00, 0x810f, 0xa186, 0x0001, 0x0158, 0xa186, 0x0005,
+	0x0118, 0xa186, 0x0007, 0x1178, 0xa280, 0x0004, 0x2004, 0xa005,
+	0x0150, 0x0056, 0x7510, 0x7614, 0x080c, 0xb16b, 0x005e, 0x00ce,
+	0x00de, 0x00ee, 0x0005, 0x6007, 0x003b, 0x602b, 0x0009, 0x6013,
+	0x2a00, 0x6003, 0x0001, 0x080c, 0x6c8d, 0x0c88, 0x6007, 0x003b,
+	0x602b, 0x0009, 0x6013, 0x1700, 0x6003, 0x0001, 0x080c, 0x6c8d,
+	0x0c30, 0x6007, 0x003b, 0x602b, 0x000b, 0x6013, 0x0000, 0x0804,
+	0xa4e3, 0x00e6, 0x0026, 0x080c, 0x5309, 0x0558, 0x080c, 0x52f9,
+	0x080c, 0xb34b, 0x1520, 0x2071, 0xb500, 0x70d4, 0xc085, 0x70d6,
+	0x00f6, 0x2079, 0x0100, 0x72a0, 0xa284, 0x00ff, 0x7072, 0x78e6,
+	0xa284, 0xff00, 0x7274, 0xa205, 0x7076, 0x78ea, 0x00fe, 0x70df,
+	0x0000, 0x2001, 0xb553, 0x2004, 0xd0a4, 0x0120, 0x2011, 0xb7f9,
+	0x2013, 0x07d0, 0xd0ac, 0x1128, 0x080c, 0x2ab8, 0x0010, 0x080c,
+	0xb377, 0x002e, 0x00ee, 0x080c, 0x861d, 0x0804, 0xa3b7, 0x080c,
+	0x861d, 0x0005, 0x2600, 0x0002, 0xa5c5, 0xa5c5, 0xa5c5, 0xa5c5,
+	0xa5c5, 0xa5c7, 0xa5c5, 0xa5c5, 0xa5c5, 0x080c, 0x1515, 0x080c,
+	0xb2d0, 0x1d68, 0x080c, 0x2dbf, 0x1d50, 0x0089, 0x1138, 0x6007,
+	0x0045, 0x6003, 0x0001, 0x080c, 0x6cd3, 0x0005, 0x080c, 0x2c9c,
+	0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x6cd3, 0x0005, 0x00d6,
+	0x0066, 0x6618, 0x2668, 0x6e04, 0xa6b4, 0xff00, 0x8637, 0xa686,
+	0x0006, 0x0170, 0xa686, 0x0004, 0x0158, 0x6e04, 0xa6b4, 0x00ff,
+	0xa686, 0x0006, 0x0128, 0xa686, 0x0004, 0x0110, 0xa085, 0x0001,
+	0x006e, 0x00de, 0x0005, 0x00d6, 0x0449, 0x00de, 0x0005, 0x00d6,
+	0x0491, 0x11f0, 0x680c, 0xa08c, 0xff00, 0x6820, 0xa084, 0x00ff,
+	0xa115, 0x6212, 0x6824, 0x602a, 0xd1e4, 0x0118, 0x2009, 0x0001,
+	0x0060, 0xd1ec, 0x0168, 0x6920, 0xa18c, 0x00ff, 0x6824, 0x080c,
+	0x281d, 0x1130, 0x2110, 0x2009, 0x0000, 0x080c, 0x2ce1, 0x0018,
+	0xa085, 0x0001, 0x0008, 0xa006, 0x00de, 0x0005, 0x2069, 0xbb8d,
+	0x6800, 0xa082, 0x0010, 0x1228, 0x6013, 0x0000, 0xa085, 0x0001,
+	0x0008, 0xa006, 0x0005, 0x6013, 0x0000, 0x2069, 0xbb8c, 0x6808,
+	0xa084, 0xff00, 0xa086, 0x0800, 0x1140, 0x6800, 0xa084, 0x00ff,
+	0xa08e, 0x0014, 0x0110, 0xa08e, 0x0010, 0x0005, 0x6004, 0xa0b2,
+	0x0080, 0x1a0c, 0x1515, 0xa1b6, 0x0013, 0x1130, 0x2008, 0xa1b2,
+	0x0040, 0x1a04, 0xa746, 0x0092, 0xa1b6, 0x0027, 0x0120, 0xa1b6,
+	0x0014, 0x190c, 0x1515, 0x2001, 0x0007, 0x080c, 0x4f2a, 0x080c,
+	0x7090, 0x080c, 0x9e1d, 0x080c, 0x7173, 0x0005, 0xa6a6, 0xa6a8,
+	0xa6a6, 0xa6a6, 0xa6a6, 0xa6a8, 0xa6ba, 0xa73f, 0xa70a, 0xa73f,
+	0xa71b, 0xa73f, 0xa6ba, 0xa73f, 0xa737, 0xa73f, 0xa737, 0xa73f,
+	0xa73f, 0xa6a6, 0xa6a6, 0xa6a6, 0xa6a6, 0xa6a6, 0xa6a6, 0xa6a6,
+	0xa6a6, 0xa6a6, 0xa6a6, 0xa6a6, 0xa6a8, 0xa6a6, 0xa73f, 0xa6a6,
+	0xa6a6, 0xa73f, 0xa6a6, 0xa73c, 0xa73f, 0xa6a6, 0xa6a6, 0xa6a6,
+	0xa6a6, 0xa73f, 0xa73f, 0xa6a6, 0xa73f, 0xa73f, 0xa6a6, 0xa6b4,
+	0xa6a6, 0xa6a6, 0xa6a6, 0xa6a6, 0xa73b, 0xa73f, 0xa6a6, 0xa6a6,
+	0xa73f, 0xa73f, 0xa6a6, 0xa6a6, 0xa6a6, 0xa6a6, 0x080c, 0x1515,
+	0x080c, 0x7090, 0x2001, 0xb7b6, 0x2004, 0x6016, 0x6003, 0x0002,
+	0x080c, 0x7173, 0x0804, 0xa745, 0x2001, 0x0000, 0x080c, 0x4eeb,
+	0x0804, 0xa73f, 0x00f6, 0x2079, 0xb552, 0x7804, 0x00fe, 0xd0ac,
+	0x1904, 0xa73f, 0x2001, 0x0000, 0x080c, 0x4eeb, 0x6018, 0xa080,
+	0x0004, 0x2004, 0xa086, 0x00ff, 0x1140, 0x00f6, 0x2079, 0xb500,
+	0x7898, 0x8000, 0x789a, 0x00fe, 0x00e0, 0x00c6, 0x6018, 0x2060,
+	0x6000, 0xd0f4, 0x1140, 0x6010, 0xa005, 0x0128, 0x00ce, 0x080c,
+	0x3f3e, 0x0804, 0xa73f, 0x00ce, 0x2001, 0xb500, 0x2004, 0xa086,
+	0x0002, 0x1138, 0x00f6, 0x2079, 0xb500, 0x7898, 0x8000, 0x789a,
+	0x00fe, 0x2001, 0x0002, 0x080c, 0x4efd, 0x080c, 0x7090, 0x601f,
+	0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x6cd3, 0x080c,
+	0x7173, 0x00c6, 0x6118, 0x2160, 0x2009, 0x0001, 0x080c, 0x69a8,
+	0x00ce, 0x04d8, 0x6618, 0x00d6, 0x2668, 0x6e04, 0x00de, 0xa6b4,
+	0xff00, 0x8637, 0xa686, 0x0006, 0x0550, 0xa686, 0x0004, 0x0538,
+	0x2001, 0x0004, 0x0410, 0x2001, 0xb500, 0x2004, 0xa086, 0x0003,
+	0x1110, 0x080c, 0x3f3e, 0x2001, 0x0006, 0x04a1, 0x6618, 0x00d6,
+	0x2668, 0x6e04, 0x00de, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
+	0x0170, 0x2001, 0x0006, 0x0048, 0x2001, 0x0004, 0x0030, 0x2001,
+	0x0006, 0x0401, 0x0020, 0x0018, 0x0010, 0x080c, 0x4f2a, 0x080c,
+	0x7090, 0x080c, 0x861d, 0x080c, 0x7173, 0x0005, 0x2600, 0x0002,
+	0xa751, 0xa751, 0xa751, 0xa751, 0xa751, 0xa753, 0xa751, 0xa751,
+	0xa751, 0x080c, 0x1515, 0x080c, 0x7090, 0x080c, 0x861d, 0x080c,
+	0x7173, 0x0005, 0x0016, 0x00d6, 0x6118, 0x2168, 0x6900, 0xd184,
+	0x0140, 0x080c, 0x4efd, 0x2001, 0x0000, 0x080c, 0x4eeb, 0x080c,
+	0x2cc2, 0x00de, 0x001e, 0x0005, 0x00d6, 0x6618, 0x2668, 0x6804,
+	0xa084, 0xff00, 0x8007, 0x00de, 0xa0b2, 0x000c, 0x1a0c, 0x1515,
+	0xa1b6, 0x0015, 0x1110, 0x003b, 0x0028, 0xa1b6, 0x0016, 0x190c,
+	0x1515, 0x006b, 0x0005, 0x8cdf, 0x8cdf, 0x8cdf, 0x8cdf, 0x8cdf,
+	0x8cdf, 0xa7dc, 0xa79b, 0x8cdf, 0x8cdf, 0x8cdf, 0x8cdf, 0x8cdf,
+	0x8cdf, 0x8cdf, 0x8cdf, 0x8cdf, 0x8cdf, 0xa7dc, 0xa7e3, 0x8cdf,
+	0x8cdf, 0x8cdf, 0x8cdf, 0x00f6, 0x2079, 0xb552, 0x7804, 0xd0ac,
+	0x11e0, 0x6018, 0xa07d, 0x01c8, 0x7800, 0xd0f4, 0x1118, 0x7810,
+	0xa005, 0x1198, 0x2001, 0x0000, 0x080c, 0x4eeb, 0x2001, 0x0002,
+	0x080c, 0x4efd, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002,
+	0x080c, 0x6cd3, 0x080c, 0x7173, 0x00e8, 0x2011, 0xbb83, 0x2204,
+	0x8211, 0x220c, 0x080c, 0x281d, 0x11a8, 0x00c6, 0x080c, 0x4fa9,
+	0x0120, 0x00ce, 0x080c, 0x861d, 0x0068, 0x6010, 0x0006, 0x6014,
+	0x0006, 0x080c, 0x4c0b, 0x000e, 0x6016, 0x000e, 0x6012, 0x00ce,
+	0x080c, 0x861d, 0x00fe, 0x0005, 0x6604, 0xa6b6, 0x001e, 0x1110,
+	0x080c, 0x861d, 0x0005, 0x080c, 0x8f95, 0x1138, 0x6003, 0x0001,
+	0x6007, 0x0001, 0x080c, 0x6cd3, 0x0010, 0x080c, 0x861d, 0x0005,
+	0x6004, 0xa08a, 0x0080, 0x1a0c, 0x1515, 0x080c, 0x7090, 0x080c,
+	0x9e1d, 0x080c, 0x7173, 0x0005, 0xa182, 0x0040, 0x0002, 0xa812,
+	0xa812, 0xa812, 0xa812, 0xa814, 0xa812, 0xa812, 0xa812, 0xa812,
+	0xa812, 0xa812, 0xa812, 0xa812, 0xa812, 0xa812, 0xa812, 0xa812,
+	0xa812, 0xa812, 0x080c, 0x1515, 0x00d6, 0x00e6, 0x00f6, 0x0156,
+	0x0046, 0x0026, 0x6218, 0xa280, 0x002b, 0x2004, 0xa005, 0x0120,
+	0x2021, 0x0000, 0x080c, 0xb31c, 0x6106, 0x2071, 0xbb80, 0x7444,
+	0xa4a4, 0xff00, 0x0904, 0xa878, 0xa486, 0x2000, 0x1130, 0x2009,
+	0x0001, 0x2011, 0x0200, 0x080c, 0x6b1a, 0x080c, 0x15f8, 0x090c,
+	0x1515, 0x6003, 0x0007, 0x2d00, 0x6837, 0x010d, 0x6803, 0x0000,
+	0x683b, 0x0000, 0x6c5a, 0x2c00, 0x685e, 0x6008, 0x68b2, 0x6018,
+	0x2078, 0x78a0, 0x8007, 0x7130, 0x694a, 0x0016, 0xa084, 0xff00,
+	0x6846, 0x684f, 0x0000, 0x6853, 0x0000, 0x6857, 0x0036, 0x080c,
+	0x5408, 0x001e, 0xa486, 0x2000, 0x1130, 0x2019, 0x0017, 0x080c,
+	0xb065, 0x0804, 0xa8d5, 0xa486, 0x0400, 0x1130, 0x2019, 0x0002,
+	0x080c, 0xb017, 0x0804, 0xa8d5, 0xa486, 0x0200, 0x1110, 0x080c,
+	0xaffc, 0xa486, 0x1000, 0x1110, 0x080c, 0xb04a, 0x0804, 0xa8d5,
+	0x2069, 0xb874, 0x6a00, 0xd284, 0x0904, 0xa93c, 0xa284, 0x0300,
+	0x1904, 0xa935, 0x6804, 0xa005, 0x0904, 0xa91d, 0x2d78, 0x6003,
+	0x0007, 0x080c, 0x15df, 0x0904, 0xa8dc, 0x7800, 0xd08c, 0x1118,
+	0x7804, 0x8001, 0x7806, 0x6013, 0x0000, 0x6803, 0x0000, 0x6837,
+	0x0116, 0x683b, 0x0000, 0x6008, 0x68b2, 0x2c00, 0x684a, 0x6018,
+	0x2078, 0x78a0, 0x8007, 0x7130, 0x6986, 0x6846, 0x7928, 0x698a,
+	0x792c, 0x698e, 0x7930, 0x6992, 0x7934, 0x6996, 0x6853, 0x003d,
+	0x7244, 0xa294, 0x0003, 0xa286, 0x0002, 0x1118, 0x684f, 0x0040,
+	0x0040, 0xa286, 0x0001, 0x1118, 0x684f, 0x0080, 0x0010, 0x684f,
+	0x0000, 0x20a9, 0x000a, 0x2001, 0xbb90, 0xad90, 0x0015, 0x200c,
+	0x810f, 0x2112, 0x8000, 0x8210, 0x1f04, 0xa8c7, 0x200c, 0x6982,
+	0x8000, 0x200c, 0x697e, 0x080c, 0x5408, 0x002e, 0x004e, 0x015e,
+	0x00fe, 0x00ee, 0x00de, 0x0005, 0x2001, 0xb50e, 0x2004, 0xd084,
+	0x0120, 0x080c, 0x15f8, 0x1904, 0xa88d, 0x6013, 0x0100, 0x6003,
+	0x0001, 0x6007, 0x0041, 0x080c, 0x6c8d, 0x080c, 0x7173, 0x0c28,
+	0x2069, 0xbb92, 0x2d04, 0xa084, 0xff00, 0xa086, 0x1200, 0x11a8,
+	0x2069, 0xbb80, 0x686c, 0xa084, 0x00ff, 0x0016, 0x6110, 0xa18c,
+	0x0700, 0xa10d, 0x6112, 0x001e, 0x6003, 0x0001, 0x6007, 0x0043,
+	0x080c, 0x6c8d, 0x080c, 0x7173, 0x0840, 0x6868, 0x602a, 0x686c,
+	0x602e, 0x6013, 0x0200, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c,
+	0x6c8d, 0x080c, 0x7173, 0x0804, 0xa8d5, 0x2001, 0xb50d, 0x2004,
+	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x3ecc, 0x6013, 0x0300,
+	0x0010, 0x6013, 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c,
+	0x6c8d, 0x080c, 0x7173, 0x0804, 0xa8d5, 0x6013, 0x0500, 0x0c98,
+	0x6013, 0x0600, 0x0804, 0xa8f0, 0x6013, 0x0200, 0x0804, 0xa8f0,
+	0xa186, 0x0013, 0x1170, 0x6004, 0xa08a, 0x0040, 0x0a0c, 0x1515,
+	0xa08a, 0x0053, 0x1a0c, 0x1515, 0xa082, 0x0040, 0x2008, 0x0804,
+	0xa9ca, 0xa186, 0x0051, 0x0138, 0xa186, 0x0047, 0x11d8, 0x6004,
+	0xa086, 0x0041, 0x0518, 0x2001, 0x0109, 0x2004, 0xd084, 0x01f0,
+	0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x080c, 0x6b74,
+	0x002e, 0x001e, 0x000e, 0x012e, 0x6000, 0xa086, 0x0002, 0x1170,
+	0x0804, 0xaa0d, 0xa186, 0x0027, 0x0120, 0xa186, 0x0014, 0x190c,
+	0x1515, 0x6004, 0xa082, 0x0040, 0x2008, 0x001a, 0x080c, 0x8663,
+	0x0005, 0xa994, 0xa996, 0xa996, 0xa9ba, 0xa994, 0xa994, 0xa994,
+	0xa994, 0xa994, 0xa994, 0xa994, 0xa994, 0xa994, 0xa994, 0xa994,
+	0xa994, 0xa994, 0xa994, 0xa994, 0x080c, 0x1515, 0x080c, 0x7090,
+	0x080c, 0x7173, 0x0036, 0x00d6, 0x6010, 0xa06d, 0x01c0, 0xad84,
+	0xf000, 0x01a8, 0x6003, 0x0002, 0x6018, 0x2004, 0xd0bc, 0x1178,
+	0x2019, 0x0004, 0x080c, 0xb099, 0x6013, 0x0000, 0x6014, 0xa005,
+	0x1120, 0x2001, 0xb7b7, 0x2004, 0x6016, 0x6003, 0x0007, 0x00de,
+	0x003e, 0x0005, 0x00d6, 0x080c, 0x7090, 0x080c, 0x7173, 0x080c,
+	0x9c5a, 0x0120, 0x6010, 0x2068, 0x080c, 0x160f, 0x080c, 0x9e1d,
+	0x00de, 0x0005, 0x0002, 0xa9de, 0xa9fb, 0xa9e7, 0xaa07, 0xa9de,
+	0xa9de, 0xa9de, 0xa9de, 0xa9de, 0xa9de, 0xa9de, 0xa9de, 0xa9de,
+	0xa9de, 0xa9de, 0xa9de, 0xa9de, 0xa9de, 0xa9de, 0x080c, 0x1515,
+	0x6010, 0xa088, 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x080c,
+	0x7090, 0x6010, 0xa080, 0x0013, 0x2004, 0xd0b4, 0x0138, 0x6003,
+	0x0007, 0x2009, 0x0043, 0x080c, 0x864c, 0x0010, 0x6003, 0x0002,
+	0x080c, 0x7173, 0x0005, 0x080c, 0x7090, 0x080c, 0xb2d7, 0x1120,
+	0x080c, 0x6aef, 0x080c, 0x861d, 0x080c, 0x7173, 0x0005, 0x080c,
+	0x7090, 0x2009, 0x0041, 0x0804, 0xab56, 0xa182, 0x0040, 0x0002,
+	0xaa23, 0xaa25, 0xaa23, 0xaa23, 0xaa23, 0xaa23, 0xaa23, 0xaa26,
+	0xaa23, 0xaa23, 0xaa23, 0xaa23, 0xaa23, 0xaa23, 0xaa23, 0xaa23,
+	0xaa23, 0xaa31, 0xaa23, 0x080c, 0x1515, 0x0005, 0x6003, 0x0004,
+	0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x080c, 0x185e,
+	0x0005, 0x00d6, 0x080c, 0x6aef, 0x00de, 0x080c, 0xb33a, 0x080c,
+	0x861d, 0x0005, 0xa182, 0x0040, 0x0002, 0xaa50, 0xaa50, 0xaa50,
+	0xaa50, 0xaa50, 0xaa50, 0xaa50, 0xaa52, 0xaa50, 0xaa55, 0xaa8e,
+	0xaa50, 0xaa50, 0xaa50, 0xaa50, 0xaa8e, 0xaa50, 0xaa50, 0xaa50,
+	0x080c, 0x1515, 0x080c, 0x8663, 0x0005, 0x2001, 0xb572, 0x2004,
+	0xd0e4, 0x0158, 0x2001, 0x0100, 0x2004, 0xa082, 0x0005, 0x0228,
+	0x2001, 0x011f, 0x2004, 0x6036, 0x0010, 0x6037, 0x0000, 0x080c,
+	0x7126, 0x080c, 0x7230, 0x6010, 0x00d6, 0x2068, 0x684c, 0xd0fc,
+	0x0150, 0xa08c, 0x0003, 0xa18e, 0x0002, 0x0168, 0x2009, 0x0041,
+	0x00de, 0x0804, 0xab56, 0x6003, 0x0007, 0x6017, 0x0000, 0x080c,
+	0x6aef, 0x00de, 0x0005, 0x080c, 0xb2d7, 0x0110, 0x00de, 0x0005,
+	0x080c, 0x6aef, 0x080c, 0x861d, 0x00de, 0x0ca0, 0x0036, 0x080c,
+	0x7126, 0x080c, 0x7230, 0x6010, 0x00d6, 0x2068, 0x6018, 0x2004,
+	0xd0bc, 0x0188, 0x684c, 0xa084, 0x0003, 0xa086, 0x0002, 0x0140,
+	0x687c, 0x632c, 0xa31a, 0x632e, 0x6880, 0x6328, 0xa31b, 0x632a,
+	0x6003, 0x0002, 0x0080, 0x2019, 0x0004, 0x080c, 0xb099, 0x6014,
+	0xa005, 0x1128, 0x2001, 0xb7b7, 0x2004, 0x8003, 0x6016, 0x6013,
+	0x0000, 0x6003, 0x0007, 0x00de, 0x003e, 0x0005, 0xa186, 0x0013,
+	0x1150, 0x6004, 0xa086, 0x0042, 0x190c, 0x1515, 0x080c, 0x7090,
+	0x080c, 0x7173, 0x0005, 0xa186, 0x0027, 0x0118, 0xa186, 0x0014,
+	0x1180, 0x6004, 0xa086, 0x0042, 0x190c, 0x1515, 0x2001, 0x0007,
+	0x080c, 0x4f2a, 0x080c, 0x7090, 0x080c, 0x9e1d, 0x080c, 0x7173,
+	0x0005, 0xa182, 0x0040, 0x0002, 0xaaf7, 0xaaf7, 0xaaf7, 0xaaf7,
+	0xaaf7, 0xaaf7, 0xaaf7, 0xaaf9, 0xab05, 0xaaf7, 0xaaf7, 0xaaf7,
+	0xaaf7, 0xaaf7, 0xaaf7, 0xaaf7, 0xaaf7, 0xaaf7, 0xaaf7, 0x080c,
+	0x1515, 0x0036, 0x0046, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
+	0x080c, 0x185e, 0x004e, 0x003e, 0x0005, 0x6010, 0x00d6, 0x2068,
+	0x6810, 0x6a14, 0x0006, 0x0046, 0x0056, 0x6c7c, 0xa422, 0x6d80,
+	0x2200, 0xa52b, 0x602c, 0xa420, 0x642e, 0x6028, 0xa529, 0x652a,
+	0x005e, 0x004e, 0x000e, 0xa20d, 0x1178, 0x684c, 0xd0fc, 0x0120,
+	0x2009, 0x0041, 0x00de, 0x0490, 0x6003, 0x0007, 0x6017, 0x0000,
+	0x080c, 0x6aef, 0x00de, 0x0005, 0x0006, 0x00f6, 0x2c78, 0x080c,
+	0x5305, 0x00fe, 0x000e, 0x0120, 0x6003, 0x0002, 0x00de, 0x0005,
+	0x2009, 0xb50d, 0x210c, 0xd19c, 0x0118, 0x6003, 0x0007, 0x0010,
+	0x6003, 0x0006, 0x0021, 0x080c, 0x6af1, 0x00de, 0x0005, 0xd2fc,
+	0x0140, 0x8002, 0x8000, 0x8212, 0xa291, 0x0000, 0x2009, 0x0009,
+	0x0010, 0x2009, 0x0015, 0x6a6a, 0x6866, 0x0005, 0xa182, 0x0040,
+	0x0208, 0x0062, 0xa186, 0x0013, 0x0120, 0xa186, 0x0014, 0x190c,
+	0x1515, 0x6020, 0xd0dc, 0x090c, 0x1515, 0x0005, 0xab79, 0xab80,
+	0xab8c, 0xab98, 0xab79, 0xab79, 0xab79, 0xaba7, 0xab79, 0xab7b,
+	0xab7b, 0xab79, 0xab79, 0xab79, 0xab79, 0xab7b, 0xab79, 0xab7b,
+	0xab79, 0x080c, 0x1515, 0x6020, 0xd0dc, 0x090c, 0x1515, 0x0005,
+	0x6003, 0x0001, 0x6106, 0x080c, 0x6c8d, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x7173, 0x012e, 0x0005, 0x6003, 0x0001, 0x6106, 0x080c,
+	0x6c8d, 0x0126, 0x2091, 0x8000, 0x080c, 0x7173, 0x012e, 0x0005,
+	0x6003, 0x0003, 0x6106, 0x2c10, 0x080c, 0x1fa9, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x6cf0, 0x080c, 0x7230, 0x012e, 0x0005, 0xa016,
+	0x080c, 0x185e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0036, 0x00d6,
+	0xa182, 0x0040, 0x0023, 0x00de, 0x003e, 0x012e, 0x0005, 0xabc7,
+	0xabc9, 0xabdb, 0xabf6, 0xabc7, 0xabc7, 0xabc7, 0xac0b, 0xabc7,
+	0xabc7, 0xabc7, 0xabc7, 0xabc7, 0xabc7, 0xabc7, 0xabc7, 0x080c,
+	0x1515, 0x6010, 0x2068, 0x684c, 0xd0fc, 0x01f8, 0xa09c, 0x0003,
+	0xa39e, 0x0003, 0x01d0, 0x6003, 0x0001, 0x6106, 0x080c, 0x6c8d,
+	0x080c, 0x7173, 0x0498, 0x6010, 0x2068, 0x684c, 0xd0fc, 0x0168,
+	0xa09c, 0x0003, 0xa39e, 0x0003, 0x0140, 0x6003, 0x0001, 0x6106,
+	0x080c, 0x6c8d, 0x080c, 0x7173, 0x0408, 0x6013, 0x0000, 0x6017,
+	0x0000, 0x2019, 0x0004, 0x080c, 0xb099, 0x00c0, 0x6010, 0x2068,
+	0x684c, 0xd0fc, 0x0d90, 0xa09c, 0x0003, 0xa39e, 0x0003, 0x0d68,
+	0x6003, 0x0003, 0x6106, 0x2c10, 0x080c, 0x1fa9, 0x080c, 0x6cf0,
+	0x080c, 0x7230, 0x0018, 0xa016, 0x080c, 0x185e, 0x0005, 0x080c,
+	0x7090, 0x6110, 0x81ff, 0x0158, 0x00d6, 0x2168, 0x080c, 0xb380,
+	0x0036, 0x2019, 0x0029, 0x080c, 0xb099, 0x003e, 0x00de, 0x080c,
+	0x9e1d, 0x080c, 0x7173, 0x0005, 0x080c, 0x7126, 0x6110, 0x81ff,
+	0x0158, 0x00d6, 0x2168, 0x080c, 0xb380, 0x0036, 0x2019, 0x0029,
+	0x080c, 0xb099, 0x003e, 0x00de, 0x080c, 0x9e1d, 0x080c, 0x7230,
+	0x0005, 0xa182, 0x0085, 0x0002, 0xac45, 0xac43, 0xac43, 0xac51,
+	0xac43, 0xac43, 0xac43, 0x080c, 0x1515, 0x6003, 0x000b, 0x6106,
+	0x080c, 0x6c8d, 0x0126, 0x2091, 0x8000, 0x080c, 0x7173, 0x012e,
+	0x0005, 0x0026, 0x00e6, 0x080c, 0xb2d0, 0x0118, 0x080c, 0x861d,
+	0x00d8, 0x2071, 0xbb80, 0x7224, 0x6212, 0x7220, 0x080c, 0xaf47,
+	0x0118, 0x6007, 0x0086, 0x0040, 0x6007, 0x0087, 0x7224, 0xa296,
+	0xffff, 0x1110, 0x6007, 0x0086, 0x6003, 0x0001, 0x080c, 0x6c8d,
+	0x080c, 0x7173, 0x080c, 0x7230, 0x00ee, 0x002e, 0x0005, 0xa186,
+	0x0013, 0x1160, 0x6004, 0xa08a, 0x0085, 0x0a0c, 0x1515, 0xa08a,
+	0x008c, 0x1a0c, 0x1515, 0xa082, 0x0085, 0x00a2, 0xa186, 0x0027,
+	0x0130, 0xa186, 0x0014, 0x0118, 0x080c, 0x8663, 0x0050, 0x2001,
+	0x0007, 0x080c, 0x4f2a, 0x080c, 0x7090, 0x080c, 0x9e1d, 0x080c,
+	0x7173, 0x0005, 0xaca1, 0xaca3, 0xaca3, 0xaca1, 0xaca1, 0xaca1,
+	0xaca1, 0x080c, 0x1515, 0x080c, 0x7090, 0x080c, 0x9e1d, 0x080c,
+	0x7173, 0x0005, 0xa182, 0x0085, 0x0a0c, 0x1515, 0xa182, 0x008c,
+	0x1a0c, 0x1515, 0xa182, 0x0085, 0x0002, 0xacbc, 0xacbc, 0xacbc,
+	0xacbe, 0xacbc, 0xacbc, 0xacbc, 0x080c, 0x1515, 0x0005, 0xa186,
+	0x0013, 0x0148, 0xa186, 0x0014, 0x0130, 0xa186, 0x0027, 0x0118,
+	0x080c, 0x8663, 0x0030, 0x080c, 0x7090, 0x080c, 0x9e1d, 0x080c,
+	0x7173, 0x0005, 0x0036, 0x080c, 0xb33a, 0x603f, 0x0000, 0x2019,
+	0x000b, 0x0031, 0x601f, 0x0006, 0x6003, 0x0007, 0x003e, 0x0005,
+	0x0126, 0x0036, 0x2091, 0x8000, 0x0086, 0x2c40, 0x0096, 0x2049,
+	0x0000, 0x080c, 0x8130, 0x009e, 0x008e, 0x1578, 0x0076, 0x2c38,
+	0x080c, 0x81d6, 0x007e, 0x1548, 0x6000, 0xa086, 0x0000, 0x0528,
+	0x601c, 0xa086, 0x0007, 0x0508, 0x00d6, 0x6000, 0xa086, 0x0004,
+	0x1150, 0x080c, 0xb33a, 0x601f, 0x0007, 0x2001, 0xb7b6, 0x2004,
+	0x6016, 0x080c, 0x194d, 0x6010, 0x2068, 0x080c, 0x9c5a, 0x0110,
+	0x080c, 0xb099, 0x00de, 0x6013, 0x0000, 0x080c, 0xb33a, 0x601f,
+	0x0007, 0x2001, 0xb7b6, 0x2004, 0x6016, 0x003e, 0x012e, 0x0005,
+	0x00f6, 0x00c6, 0x0036, 0x0156, 0x2079, 0xbb80, 0x7938, 0x783c,
+	0x080c, 0x281d, 0x15b0, 0x0016, 0x00c6, 0x080c, 0x4fa9, 0x1578,
+	0x001e, 0x002e, 0x0026, 0x0016, 0x2019, 0x0029, 0x080c, 0x8299,
+	0x080c, 0x6df5, 0x0076, 0x2039, 0x0000, 0x080c, 0x6d02, 0x007e,
+	0x001e, 0x0076, 0x2039, 0x0000, 0x080c, 0xae82, 0x007e, 0x080c,
+	0x51aa, 0x0026, 0x6204, 0xa294, 0xff00, 0x8217, 0xa286, 0x0006,
+	0x0118, 0xa286, 0x0004, 0x1118, 0x62a0, 0x080c, 0x2d55, 0x002e,
+	0x001e, 0x080c, 0x4c0b, 0x6612, 0x6516, 0xa006, 0x0010, 0x00ce,
+	0x001e, 0x015e, 0x003e, 0x00ce, 0x00fe, 0x0005, 0x00c6, 0x00d6,
+	0x00e6, 0x0016, 0x2009, 0xb521, 0x2104, 0xa086, 0x0074, 0x1904,
+	0xadbb, 0x2069, 0xbb8e, 0x690c, 0xa182, 0x0100, 0x06c0, 0x6908,
+	0xa184, 0x8000, 0x05e8, 0x2001, 0xb79e, 0x2004, 0xa005, 0x1160,
+	0x6018, 0x2070, 0x7010, 0xa084, 0x00ff, 0x0118, 0x7000, 0xd0f4,
+	0x0118, 0xa184, 0x0800, 0x0560, 0x6910, 0xa18a, 0x0001, 0x0610,
+	0x6914, 0x2069, 0xbbae, 0x6904, 0x81ff, 0x1198, 0x690c, 0xa182,
+	0x0100, 0x02a8, 0x6908, 0x81ff, 0x1178, 0x6910, 0xa18a, 0x0001,
+	0x0288, 0x6918, 0xa18a, 0x0001, 0x0298, 0x00d0, 0x6013, 0x0100,
+	0x00a0, 0x6013, 0x0300, 0x0088, 0x6013, 0x0500, 0x0070, 0x6013,
+	0x0700, 0x0058, 0x6013, 0x0900, 0x0040, 0x6013, 0x0b00, 0x0028,
+	0x6013, 0x0f00, 0x0010, 0x6013, 0x2d00, 0xa085, 0x0001, 0x0008,
+	0xa006, 0x001e, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6,
+	0x0026, 0x0036, 0x0156, 0x6218, 0x2268, 0x6b04, 0xa394, 0x00ff,
+	0xa286, 0x0006, 0x0190, 0xa286, 0x0004, 0x0178, 0xa394, 0xff00,
+	0x8217, 0xa286, 0x0006, 0x0148, 0xa286, 0x0004, 0x0130, 0x00c6,
+	0x2d60, 0x080c, 0x4fb8, 0x00ce, 0x04c0, 0x2011, 0xbb96, 0xad98,
+	0x000a, 0x20a9, 0x0004, 0x080c, 0x90da, 0x1580, 0x2011, 0xbb9a,
+	0xad98, 0x0006, 0x20a9, 0x0004, 0x080c, 0x90da, 0x1538, 0x0046,
+	0x0016, 0x6aa0, 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0xb553,
+	0x210c, 0xd1a4, 0x0138, 0x2009, 0x0029, 0x080c, 0xb0e8, 0x6800,
+	0xc0e5, 0x6802, 0x2019, 0x0029, 0x080c, 0x6df5, 0x0076, 0x2039,
+	0x0000, 0x080c, 0x6d02, 0x2c08, 0x080c, 0xae82, 0x007e, 0x2001,
+	0x0007, 0x080c, 0x4f2a, 0x001e, 0x004e, 0xa006, 0x015e, 0x003e,
+	0x002e, 0x00de, 0x00ce, 0x0005, 0x00d6, 0x2069, 0xbb8e, 0x6800,
+	0xa086, 0x0800, 0x0118, 0x6013, 0x0000, 0x0008, 0xa006, 0x00de,
+	0x0005, 0x00c6, 0x00f6, 0x0016, 0x0026, 0x0036, 0x0156, 0x2079,
+	0xbb8c, 0x7930, 0x7834, 0x080c, 0x281d, 0x11a0, 0x080c, 0x4fa9,
+	0x1188, 0x2011, 0xbb90, 0xac98, 0x000a, 0x20a9, 0x0004, 0x080c,
+	0x90da, 0x1140, 0x2011, 0xbb94, 0xac98, 0x0006, 0x20a9, 0x0004,
+	0x080c, 0x90da, 0x015e, 0x003e, 0x002e, 0x001e, 0x00fe, 0x00ce,
+	0x0005, 0x00c6, 0x0006, 0x0016, 0x0026, 0x0036, 0x0156, 0x2011,
+	0xbb83, 0x2204, 0x8211, 0x220c, 0x080c, 0x281d, 0x11a0, 0x080c,
+	0x4fa9, 0x1188, 0x2011, 0xbb96, 0xac98, 0x000a, 0x20a9, 0x0004,
+	0x080c, 0x90da, 0x1140, 0x2011, 0xbb9a, 0xac98, 0x0006, 0x20a9,
+	0x0004, 0x080c, 0x90da, 0x015e, 0x003e, 0x002e, 0x001e, 0x000e,
+	0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x0056,
+	0x0046, 0x0026, 0x0126, 0x2091, 0x8000, 0x2740, 0x2029, 0xb7e9,
+	0x252c, 0x2021, 0xb7ef, 0x2424, 0x2061, 0xbd00, 0x2071, 0xb500,
+	0x7648, 0x7068, 0x81ff, 0x0150, 0x0006, 0xa186, 0xb8f4, 0x000e,
+	0x0128, 0x8001, 0xa602, 0x1a04, 0xaf03, 0x0018, 0xa606, 0x0904,
+	0xaf03, 0x2100, 0xac06, 0x0904, 0xaefa, 0x080c, 0xb110, 0x0904,
+	0xaefa, 0x671c, 0xa786, 0x0001, 0x0904, 0xaf1e, 0xa786, 0x0004,
+	0x0904, 0xaf1e, 0xa786, 0x0007, 0x05e8, 0x2500, 0xac06, 0x05d0,
+	0x2400, 0xac06, 0x05b8, 0x080c, 0xb120, 0x15a0, 0x88ff, 0x0118,
+	0x6050, 0xa906, 0x1578, 0x00d6, 0x6000, 0xa086, 0x0004, 0x1120,
+	0x0016, 0x080c, 0x194d, 0x001e, 0xa786, 0x0008, 0x1148, 0x080c,
+	0x9e58, 0x1130, 0x080c, 0x8c19, 0x00de, 0x080c, 0x9e1d, 0x00d0,
+	0x6010, 0x2068, 0x080c, 0x9c5a, 0x0190, 0xa786, 0x0003, 0x1528,
+	0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x080c, 0xb380, 0x0016,
+	0x080c, 0x9ecc, 0x080c, 0x5408, 0x001e, 0x080c, 0x9e11, 0x00de,
+	0x080c, 0x9e1d, 0xace0, 0x0018, 0x2001, 0xb517, 0x2004, 0xac02,
+	0x1210, 0x0804, 0xae96, 0x012e, 0x002e, 0x004e, 0x005e, 0x006e,
+	0x007e, 0x008e, 0x00ce, 0x00ee, 0x0005, 0xa786, 0x0006, 0x1150,
+	0xa386, 0x0005, 0x0128, 0x080c, 0xb380, 0x080c, 0xb099, 0x08f8,
+	0x00de, 0x0c00, 0xa786, 0x000a, 0x0968, 0x0850, 0x080c, 0xb120,
+	0x19c8, 0x81ff, 0x09b8, 0xa180, 0x0001, 0x2004, 0xa086, 0x0018,
+	0x0130, 0xa180, 0x0001, 0x2004, 0xa086, 0x002d, 0x1958, 0x6000,
+	0xa086, 0x0002, 0x1938, 0x080c, 0x9e47, 0x0130, 0x080c, 0x9e58,
+	0x1908, 0x080c, 0x8c19, 0x0038, 0x080c, 0x2cc2, 0x080c, 0x9e58,
+	0x1110, 0x080c, 0x8c19, 0x080c, 0x9e1d, 0x0804, 0xaefa, 0x00c6,
+	0x00e6, 0x0016, 0x2c08, 0x2170, 0xa006, 0x080c, 0xb0ba, 0x001e,
+	0x0120, 0x601c, 0xa084, 0x000f, 0x001b, 0x00ee, 0x00ce, 0x0005,
+	0xaf60, 0xaf60, 0xaf60, 0xaf60, 0xaf60, 0xaf60, 0xaf62, 0xaf60,
+	0xa006, 0x0005, 0x0046, 0x0016, 0x7018, 0xa080, 0x0028, 0x2024,
+	0xa4a4, 0x00ff, 0x8427, 0x2c00, 0x2009, 0x0020, 0x080c, 0xb0e8,
+	0x001e, 0x004e, 0x0036, 0x2019, 0x0002, 0x080c, 0xace0, 0x003e,
+	0xa085, 0x0001, 0x0005, 0x2001, 0x0001, 0x080c, 0x4eeb, 0x0156,
+	0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0xb505, 0x2011,
+	0xbb96, 0x080c, 0x90da, 0x003e, 0x002e, 0x001e, 0x015e, 0xa005,
+	0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x0026,
+	0x0126, 0x2091, 0x8000, 0x2740, 0x2061, 0xbd00, 0x2079, 0x0001,
+	0x8fff, 0x0904, 0xafef, 0x2071, 0xb500, 0x7648, 0x7068, 0x8001,
+	0xa602, 0x1a04, 0xafef, 0x88ff, 0x0128, 0x2800, 0xac06, 0x15b0,
+	0x2079, 0x0000, 0x080c, 0xb110, 0x0588, 0x2400, 0xac06, 0x0570,
+	0x671c, 0xa786, 0x0006, 0x1550, 0xa786, 0x0007, 0x0538, 0x88ff,
+	0x1140, 0x6018, 0xa206, 0x1510, 0x85ff, 0x0118, 0x6050, 0xa106,
+	0x11e8, 0x00d6, 0x6000, 0xa086, 0x0004, 0x1150, 0x080c, 0xb33a,
+	0x601f, 0x0007, 0x2001, 0xb7b6, 0x2004, 0x6016, 0x080c, 0x194d,
+	0x6010, 0x2068, 0x080c, 0x9c5a, 0x0120, 0x0046, 0x080c, 0xb099,
+	0x004e, 0x00de, 0x080c, 0x9e1d, 0x88ff, 0x1198, 0xace0, 0x0018,
+	0x2001, 0xb517, 0x2004, 0xac02, 0x1210, 0x0804, 0xafa0, 0xa006,
+	0x012e, 0x002e, 0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee, 0x00fe,
+	0x0005, 0xa8c5, 0x0001, 0x0ca0, 0x0076, 0x0056, 0x0086, 0x2041,
+	0x0000, 0x2029, 0x0001, 0x2c20, 0x2019, 0x0002, 0x6218, 0x0096,
+	0x2049, 0x0000, 0x080c, 0x8130, 0x009e, 0x008e, 0x2039, 0x0000,
+	0x080c, 0x81d6, 0x080c, 0xaf91, 0x005e, 0x007e, 0x0005, 0x0026,
+	0x0046, 0x0056, 0x0076, 0x00c6, 0x0156, 0x2c20, 0x2128, 0x20a9,
+	0x007f, 0x2009, 0x0000, 0x0016, 0x0036, 0x080c, 0x4fa9, 0x11b0,
+	0x2c10, 0x0056, 0x0086, 0x2041, 0x0000, 0x2508, 0x2029, 0x0001,
+	0x0096, 0x2049, 0x0000, 0x080c, 0x8130, 0x009e, 0x008e, 0x2039,
+	0x0000, 0x080c, 0x81d6, 0x080c, 0xaf91, 0x005e, 0x003e, 0x001e,
+	0x8108, 0x1f04, 0xb023, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e,
+	0x002e, 0x0005, 0x0076, 0x0056, 0x6218, 0x0086, 0x2041, 0x0000,
+	0x2029, 0x0001, 0x2019, 0x0048, 0x0096, 0x2049, 0x0000, 0x080c,
+	0x8130, 0x009e, 0x008e, 0x2039, 0x0000, 0x080c, 0x81d6, 0x2c20,
+	0x080c, 0xaf91, 0x005e, 0x007e, 0x0005, 0x0026, 0x0046, 0x0056,
+	0x0076, 0x00c6, 0x0156, 0x2c20, 0x20a9, 0x007f, 0x2009, 0x0000,
+	0x0016, 0x0036, 0x080c, 0x4fa9, 0x11c0, 0x2c10, 0x0086, 0x2041,
+	0x0000, 0x2828, 0x0046, 0x2021, 0x0001, 0x080c, 0xb31c, 0x004e,
+	0x0096, 0x2049, 0x0000, 0x080c, 0x8130, 0x009e, 0x008e, 0x2039,
+	0x0000, 0x080c, 0x81d6, 0x080c, 0xaf91, 0x003e, 0x001e, 0x8108,
+	0x1f04, 0xb070, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x002e,
+	0x0005, 0x0016, 0x00f6, 0x3800, 0xd08c, 0x0130, 0xad82, 0x1000,
+	0x02b0, 0xad82, 0xb500, 0x0230, 0xad82, 0xed00, 0x0280, 0xad82,
+	0xffff, 0x1268, 0x6800, 0xa07d, 0x0138, 0x6803, 0x0000, 0x6b52,
+	0x080c, 0x5408, 0x2f68, 0x0cb0, 0x6b52, 0x080c, 0x5408, 0x00fe,
+	0x001e, 0x0005, 0x00e6, 0x0046, 0x0036, 0x2061, 0xbd00, 0xa005,
+	0x1138, 0x2071, 0xb500, 0x7448, 0x7068, 0x8001, 0xa402, 0x12d8,
+	0x2100, 0xac06, 0x0168, 0x6000, 0xa086, 0x0000, 0x0148, 0x6008,
+	0xa206, 0x1130, 0x6018, 0xa1a0, 0x0006, 0x2424, 0xa406, 0x0140,
+	0xace0, 0x0018, 0x2001, 0xb517, 0x2004, 0xac02, 0x1220, 0x0c40,
+	0xa085, 0x0001, 0x0008, 0xa006, 0x003e, 0x004e, 0x00ee, 0x0005,
+	0x00d6, 0x0006, 0x080c, 0x15f8, 0x000e, 0x090c, 0x1515, 0x6837,
+	0x010d, 0x685e, 0x0026, 0x2010, 0x080c, 0x9c4a, 0x2001, 0x0000,
+	0x0120, 0x2200, 0xa080, 0x0014, 0x2004, 0x002e, 0x684a, 0x6956,
+	0x6c46, 0x684f, 0x0000, 0x2001, 0xb7be, 0x2004, 0x6852, 0xa006,
+	0x68b2, 0x6802, 0x683a, 0x685a, 0x080c, 0x5408, 0x00de, 0x0005,
+	0x6700, 0xa786, 0x0000, 0x0158, 0xa786, 0x0001, 0x0140, 0xa786,
+	0x000a, 0x0128, 0xa786, 0x0009, 0x0110, 0xa085, 0x0001, 0x0005,
+	0x00e6, 0x6018, 0x2070, 0x70a0, 0xa206, 0x00ee, 0x0005, 0x0016,
+	0x6004, 0xa08e, 0x001e, 0x11a0, 0x8007, 0x6130, 0xa18c, 0x00ff,
+	0xa105, 0x6032, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0005,
+	0x2001, 0xb7b7, 0x2004, 0x6016, 0x080c, 0x6c8d, 0x080c, 0x7173,
+	0x001e, 0x0005, 0xe000, 0xe000, 0x0005, 0x6020, 0xd0e4, 0x0158,
+	0xd0cc, 0x0118, 0x080c, 0x9f35, 0x0030, 0x080c, 0xb33a, 0x080c,
+	0x6aef, 0x080c, 0x861d, 0x0005, 0xa280, 0x0007, 0x2004, 0xa084,
+	0x000f, 0x0002, 0xb163, 0xb163, 0xb163, 0xb168, 0xb163, 0xb165,
+	0xb165, 0xb163, 0xb165, 0xa006, 0x0005, 0x00c6, 0x2260, 0x00ce,
+	0xa085, 0x0001, 0x0005, 0xa280, 0x0007, 0x2004, 0xa084, 0x000f,
+	0x0002, 0xb17a, 0xb17a, 0xb17a, 0xb17a, 0xb17a, 0xb17a, 0xb185,
+	0xb17a, 0xb17a, 0x6007, 0x003b, 0x602b, 0x0009, 0x6013, 0x2a00,
+	0x6003, 0x0001, 0x080c, 0x6c8d, 0x0005, 0x00c6, 0x2260, 0x080c,
+	0xb33a, 0x603f, 0x0000, 0x6020, 0xc0f4, 0xc0cc, 0x6022, 0x6037,
+	0x0000, 0x00ce, 0x00d6, 0x2268, 0xa186, 0x0007, 0x1904, 0xb1e0,
+	0x6810, 0xa005, 0x0138, 0xa080, 0x0013, 0x2004, 0xd0fc, 0x1110,
+	0x00de, 0x08c0, 0x6007, 0x003a, 0x6003, 0x0001, 0x080c, 0x6c8d,
+	0x080c, 0x7173, 0x00c6, 0x2d60, 0x6100, 0xa186, 0x0002, 0x1904,
+	0xb269, 0x6010, 0xa005, 0x1138, 0x6000, 0xa086, 0x0007, 0x190c,
+	0x1515, 0x0804, 0xb269, 0xa08c, 0xf000, 0x1130, 0x0028, 0x2068,
+	0x6800, 0xa005, 0x1de0, 0x2d00, 0xa080, 0x0013, 0x2004, 0xa084,
+	0x0003, 0xa086, 0x0002, 0x1180, 0x6010, 0x2068, 0x684c, 0xc0dc,
+	0xc0f4, 0x684e, 0x6850, 0xc0f4, 0xc0fc, 0x6852, 0x2009, 0x0043,
+	0x080c, 0xab56, 0x0804, 0xb269, 0x2009, 0x0041, 0x0804, 0xb263,
+	0xa186, 0x0005, 0x15f0, 0x6810, 0xa080, 0x0013, 0x2004, 0xd0bc,
+	0x1118, 0x00de, 0x0804, 0xb17a, 0xd0b4, 0x0128, 0xd0fc, 0x090c,
+	0x1515, 0x0804, 0xb198, 0x6007, 0x003a, 0x6003, 0x0001, 0x080c,
+	0x6c8d, 0x080c, 0x7173, 0x00c6, 0x2d60, 0x6100, 0xa186, 0x0002,
+	0x0120, 0xa186, 0x0004, 0x1904, 0xb269, 0x2071, 0xb823, 0x7000,
+	0xa086, 0x0003, 0x1128, 0x7004, 0xac06, 0x1110, 0x7003, 0x0000,
+	0x6810, 0xa080, 0x0013, 0x200c, 0xc1f4, 0xc1dc, 0x2102, 0x8000,
+	0x200c, 0xc1f4, 0xc1fc, 0xc1bc, 0x2102, 0x2009, 0x0042, 0x0804,
+	0xb263, 0x0036, 0x00d6, 0x00d6, 0x080c, 0x15f8, 0x003e, 0x090c,
+	0x1515, 0x6837, 0x010d, 0x6803, 0x0000, 0x683b, 0x0000, 0x685b,
+	0x0000, 0x6b5e, 0x6857, 0x0045, 0x2c00, 0x6862, 0x6034, 0x6872,
+	0x2360, 0x6020, 0xc0dd, 0x6022, 0x6018, 0xa080, 0x0028, 0x2004,
+	0xa084, 0x00ff, 0x8007, 0x6350, 0x6b4a, 0x6846, 0x684f, 0x0000,
+	0x6853, 0x0000, 0x6d6a, 0x6e66, 0x686f, 0x0001, 0x080c, 0x5408,
+	0x2019, 0x0045, 0x6008, 0x2068, 0x080c, 0xace0, 0x2d00, 0x600a,
+	0x601f, 0x0006, 0x6003, 0x0007, 0x6017, 0x0000, 0x603f, 0x0000,
+	0x00de, 0x003e, 0x0038, 0x603f, 0x0000, 0x6003, 0x0007, 0x080c,
+	0xab56, 0x00ce, 0x00de, 0x0005, 0xa186, 0x0013, 0x1128, 0x6004,
+	0xa082, 0x0085, 0x2008, 0x00c2, 0xa186, 0x0027, 0x1178, 0x080c,
+	0x7090, 0x0036, 0x00d6, 0x6010, 0x2068, 0x2019, 0x0004, 0x080c,
+	0xb099, 0x00de, 0x003e, 0x080c, 0x7173, 0x0005, 0xa186, 0x0014,
+	0x0d70, 0x080c, 0x8663, 0x0005, 0xb295, 0xb293, 0xb293, 0xb293,
+	0xb293, 0xb293, 0xb295, 0x080c, 0x1515, 0x080c, 0x7090, 0x6003,
+	0x000c, 0x080c, 0x7173, 0x0005, 0xa182, 0x008c, 0x1220, 0xa182,
+	0x0085, 0x0208, 0x001a, 0x080c, 0x8663, 0x0005, 0xb2ad, 0xb2ad,
+	0xb2ad, 0xb2ad, 0xb2af, 0xb2cd, 0xb2ad, 0x080c, 0x1515, 0x00d6,
+	0x2c68, 0x080c, 0x85c7, 0x01a0, 0x6003, 0x0001, 0x6007, 0x001e,
+	0x2009, 0xbb8e, 0x210c, 0x6136, 0x2009, 0xbb8f, 0x210c, 0x613a,
+	0x600b, 0xffff, 0x6918, 0x611a, 0x601f, 0x0004, 0x080c, 0x6c8d,
+	0x2d60, 0x080c, 0x861d, 0x00de, 0x0005, 0x080c, 0x861d, 0x0005,
+	0x00e6, 0x6018, 0x2070, 0x7000, 0xd0ec, 0x00ee, 0x0005, 0x6010,
+	0xa08c, 0xf000, 0x0904, 0xb31b, 0xa080, 0x0013, 0x200c, 0xd1ec,
+	0x05d0, 0x2001, 0xb572, 0x2004, 0xd0ec, 0x05a8, 0x6003, 0x0002,
+	0x6020, 0xc0e5, 0x6022, 0xd1ac, 0x0180, 0x00f6, 0x2c78, 0x080c,
+	0x5301, 0x00fe, 0x0150, 0x2001, 0xb7b8, 0x2004, 0x603e, 0x2009,
+	0xb572, 0x210c, 0xd1f4, 0x11e8, 0x0080, 0x2009, 0xb572, 0x210c,
+	0xd1f4, 0x0128, 0x6020, 0xc0e4, 0x6022, 0xa006, 0x00a0, 0x2001,
+	0xb7b8, 0x200c, 0x8103, 0xa100, 0x603e, 0x6018, 0xa088, 0x002b,
+	0x2104, 0xa005, 0x0118, 0xa088, 0x0003, 0x0cd0, 0x2c0a, 0x600f,
+	0x0000, 0xa085, 0x0001, 0x0005, 0x0016, 0x00c6, 0x00e6, 0x6150,
+	0xa2f0, 0x002b, 0x2e04, 0x2060, 0x8cff, 0x0180, 0x84ff, 0x1118,
+	0x6050, 0xa106, 0x1138, 0x600c, 0x2072, 0x080c, 0x6aef, 0x080c,
+	0x861d, 0x0010, 0xacf0, 0x0003, 0x2e64, 0x0c70, 0x00ee, 0x00ce,
+	0x001e, 0x0005, 0x00d6, 0x6018, 0xa0e8, 0x002b, 0x2d04, 0xa005,
+	0x0140, 0xac06, 0x0120, 0x2d04, 0xa0e8, 0x0003, 0x0cb8, 0x600c,
+	0x206a, 0x00de, 0x0005, 0x0026, 0x0036, 0x0156, 0x2011, 0xb528,
+	0x2204, 0xa084, 0x00ff, 0x2019, 0xbb8e, 0x2334, 0xa636, 0x11d8,
+	0x8318, 0x2334, 0x2204, 0xa084, 0xff00, 0xa636, 0x11a0, 0x2011,
+	0xbb90, 0x6018, 0xa098, 0x000a, 0x20a9, 0x0004, 0x080c, 0x90da,
+	0x1150, 0x2011, 0xbb94, 0x6018, 0xa098, 0x0006, 0x20a9, 0x0004,
+	0x080c, 0x90da, 0x1100, 0x015e, 0x003e, 0x002e, 0x0005, 0x00e6,
+	0x2071, 0xb500, 0x080c, 0x4bc6, 0x080c, 0x2ab8, 0x00ee, 0x0005,
+	0x00e6, 0x6018, 0x2070, 0x7000, 0xd0fc, 0x0108, 0x0011, 0x00ee,
+	0x0005, 0x6850, 0xc0e5, 0x6852, 0x0005, 0x00e6, 0x00c6, 0x0076,
+	0x0066, 0x0056, 0x0046, 0x0026, 0x0016, 0x0126, 0x2091, 0x8000,
+	0x2029, 0xb7e9, 0x252c, 0x2021, 0xb7ef, 0x2424, 0x2061, 0xbd00,
+	0x2071, 0xb500, 0x7648, 0x7068, 0xa606, 0x0578, 0x671c, 0xa786,
+	0x0001, 0x0118, 0xa786, 0x0008, 0x1500, 0x2500, 0xac06, 0x01e8,
+	0x2400, 0xac06, 0x01d0, 0x080c, 0xb110, 0x01b8, 0x080c, 0xb120,
+	0x11a0, 0x6000, 0xa086, 0x0004, 0x1120, 0x0016, 0x080c, 0x194d,
+	0x001e, 0x080c, 0x9e47, 0x1110, 0x080c, 0x2cc2, 0x080c, 0x9e58,
+	0x1110, 0x080c, 0x8c19, 0x080c, 0x9e1d, 0xace0, 0x0018, 0x2001,
+	0xb517, 0x2004, 0xac02, 0x1208, 0x0858, 0x012e, 0x001e, 0x002e,
+	0x004e, 0x005e, 0x006e, 0x007e, 0x00ce, 0x00ee, 0x0005, 0x0126,
+	0x0006, 0x00e6, 0x0016, 0x2091, 0x8000, 0x2071, 0xb540, 0xd5a4,
+	0x0118, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0118, 0x7030, 0x8000,
+	0x7032, 0xd5ac, 0x0178, 0x2500, 0xa084, 0x0007, 0xa08e, 0x0003,
+	0x0148, 0xa08e, 0x0004, 0x0130, 0xa08e, 0x0005, 0x0118, 0x2071,
+	0xb54a, 0x04c9, 0x001e, 0x00ee, 0x000e, 0x012e, 0x0005, 0x0126,
+	0x0006, 0x00e6, 0x0016, 0x2091, 0x8000, 0x2071, 0xb540, 0xd5a4,
+	0x0118, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0118, 0x7030, 0x8000,
+	0x7032, 0xd5ac, 0x0178, 0x2500, 0xa084, 0x0007, 0xa08e, 0x0003,
+	0x0148, 0xa08e, 0x0004, 0x0130, 0xa08e, 0x0005, 0x0118, 0x2071,
+	0xb54a, 0x0089, 0x001e, 0x00ee, 0x000e, 0x012e, 0x0005, 0x0126,
+	0x0006, 0x00e6, 0x2091, 0x8000, 0x2071, 0xb542, 0x0021, 0x00ee,
+	0x000e, 0x012e, 0x0005, 0x2e04, 0x8000, 0x2072, 0x1220, 0x8e70,
+	0x2e04, 0x8000, 0x2072, 0x0005, 0x00e6, 0x2071, 0xb540, 0x0c99,
+	0x00ee, 0x0005, 0x00e6, 0x2071, 0xb544, 0x0c69, 0x00ee, 0x0005,
+	0x0126, 0x0006, 0x00e6, 0x2091, 0x8000, 0x2071, 0xb540, 0x7044,
+	0x8000, 0x7046, 0x00ee, 0x000e, 0x012e, 0x0005, 0x0001, 0x0002,
+	0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200,
+	0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000, 0x2440
+};
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2200tp_length01 = 0xa46f;
+#else
+unsigned short risc_code_length01 = 0xa46f;
+#endif
+
diff -Nru a/drivers/scsi/qla2xxx/ql2300.c b/drivers/scsi/qla2xxx/ql2300.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/ql2300.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,161 @@
+/*
+ * QLogic ISP23XX device driver for Linux 2.6.x
+ * Copyright (C) 2003 Christoph Hellwig.
+ * Copyright (C) 2003 QLogic Corporation (www.qlogic.com)
+ *
+ * Released under GPL v2.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+
+#include "qla_os.h"
+#include "qla_def.h"
+
+static char qla_driver_name[] = "qla2300";
+
+extern unsigned char  fw2300tpx_version[];
+extern unsigned char  fw2300tpx_version_str[];
+extern unsigned short fw2300tpx_addr01;
+extern unsigned short fw2300tpx_code01[];
+extern unsigned short fw2300tpx_length01;
+
+extern unsigned char  fw2322tpx_version[];
+extern unsigned char  fw2322tpx_version_str[];
+extern unsigned short fw2322tpx_addr01;
+extern unsigned short fw2322tpx_code01[];
+extern unsigned short fw2322tpx_length01;
+extern unsigned long rseqtpx_code_addr01;
+extern unsigned short rseqtpx_code01[];
+extern unsigned short rseqtpx_code_length01;
+extern unsigned long xseqtpx_code_addr01;
+extern unsigned short xseqtpx_code01[];
+extern unsigned short xseqtpx_code_length01;
+
+static struct qla_fw_info qla_fw_tbl[] = {
+	{
+		.addressing	= FW_INFO_ADDR_NORMAL,
+		.fwcode		= &fw2300tpx_code01[0],
+		.fwlen		= &fw2300tpx_length01,
+		.fwstart	= &fw2300tpx_addr01,
+	},
+#if defined(ISP2322)
+	/* End of 23xx firmware list */
+	{ FW_INFO_ADDR_NOMORE, },
+
+	/* Start of 232x firmware list */
+	{
+		.addressing	= FW_INFO_ADDR_NORMAL,
+		.fwcode		= &fw2322tpx_code01[0],
+		.fwlen		= &fw2322tpx_length01,
+		.fwstart	= &fw2322tpx_addr01,
+	},
+	{
+		.addressing	= FW_INFO_ADDR_EXTENDED,
+		.fwcode		= &rseqtpx_code01[0],
+		.fwlen		= &rseqtpx_code_length01,
+		.lfwstart	= &rseqtpx_code_addr01,
+	},
+	{
+		.addressing	= FW_INFO_ADDR_EXTENDED,
+		.fwcode		= &xseqtpx_code01[0],
+		.fwlen		= &xseqtpx_code_length01,
+		.lfwstart	= &xseqtpx_code_addr01,
+	},
+#endif
+	{ FW_INFO_ADDR_NOMORE, },
+};
+
+static struct qla_board_info qla_board_tbl[] = {
+	{
+		.drv_name	= qla_driver_name,
+
+		.isp_name	= "ISP2300",
+		.fw_info	= qla_fw_tbl,
+	},
+
+	{
+		.drv_name	= qla_driver_name,
+
+		.isp_name	= "ISP2312",
+		.fw_info	= qla_fw_tbl,
+	},
+#if defined(ISP2322)
+	{
+		.drv_name	= qla_driver_name,
+
+		.isp_name	= "ISP2322",
+		.fw_info	= &qla_fw_tbl[2],
+	},
+#endif
+};
+
+static struct pci_device_id qla2300_pci_tbl[] = {
+	{
+		.vendor		= PCI_VENDOR_ID_QLOGIC,
+		.device		= PCI_DEVICE_ID_QLOGIC_ISP2300,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= (unsigned long)&qla_board_tbl[0],
+	},
+
+	{
+		.vendor		= PCI_VENDOR_ID_QLOGIC,
+		.device		= PCI_DEVICE_ID_QLOGIC_ISP2312,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= (unsigned long)&qla_board_tbl[1],
+	},
+
+#if defined(ISP2322)
+	{
+		.vendor		= PCI_VENDOR_ID_QLOGIC,
+		.device		= PCI_DEVICE_ID_QLOGIC_ISP2322,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= (unsigned long)&qla_board_tbl[2],
+	},
+#endif
+	{0, 0},
+};
+MODULE_DEVICE_TABLE(pci, qla2300_pci_tbl);
+
+static int __devinit
+qla2300_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
+{
+	return qla2x00_probe_one(pdev,
+	    (struct qla_board_info *)id->driver_data);
+}
+
+static void __devexit
+qla2300_remove_one(struct pci_dev *pdev)
+{
+	qla2x00_remove_one(pdev);
+}
+
+static struct pci_driver qla2300_pci_driver = {
+	.name		= "qla2300",
+	.id_table	= qla2300_pci_tbl,
+	.probe		= qla2300_probe_one,
+	.remove		= __devexit_p(qla2300_remove_one),
+};
+
+static int __init
+qla2300_init(void)
+{
+	return pci_module_init(&qla2300_pci_driver);
+}
+
+static void __exit
+qla2300_exit(void)
+{
+	pci_unregister_driver(&qla2300_pci_driver);
+}
+
+module_init(qla2300_init);
+module_exit(qla2300_exit);
+
+MODULE_AUTHOR("QLogic Corporation");
+MODULE_DESCRIPTION("QLogic ISP23xx FC-SCSI Host Bus Adapter driver");
+MODULE_LICENSE("GPL");
diff -Nru a/drivers/scsi/qla2xxx/ql2300_fw.c b/drivers/scsi/qla2xxx/ql2300_fw.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/ql2300_fw.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,6695 @@
+/**************************************************************************
+ *                  QLOGIC LINUX SOFTWARE
+ *
+ * QLogic ISP2x00 device driver for Linux 2.6.x
+ * Copyright (C) 2003 QLogic Corporation
+ * (www.qlogic.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ *************************************************************************/
+
+/*
+ *	Firmware Version 3.02.18 (10:33 Nov 03, 2003)
+ */
+
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2300tpx_version = 3*1024+2;
+#else
+unsigned short risc_code_version = 3*1024+2;
+#endif
+
+#ifdef UNIQUE_FW_NAME
+unsigned char fw2300tpx_version_str[] = {3, 2,18};
+#else
+unsigned char firmware_version[] = {3, 2,18};
+#endif
+
+#ifdef UNIQUE_FW_NAME
+#define fw2300tpx_VERSION_STRING "3.02.18"
+#else
+#define FW_VERSION_STRING "3.02.18"
+#endif
+
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2300tpx_addr01 = 0x0800 ;
+#else
+unsigned short risc_code_addr01 = 0x0800 ;
+#endif
+
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2300tpx_code01[] = { 
+#else
+unsigned short risc_code01[] = { 
+#endif
+	0x0470, 0x0000, 0x0000, 0xcf5b, 0x0000, 0x0003, 0x0002, 0x0012,
+	0x0117, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030,
+	0x3120, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241,
+	0x5449, 0x4f4e, 0x2049, 0x5350, 0x3233, 0x3030, 0x2046, 0x6972,
+	0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030,
+	0x332e, 0x3032, 0x2e31, 0x3820, 0x2020, 0x2020, 0x2400, 0x20a9,
+	0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2200, 0x20a9, 0x000f,
+	0x2001, 0x0000, 0x400f, 0x2091, 0x2400, 0x20a9, 0x000f, 0x2001,
+	0x0000, 0x400f, 0x2091, 0x2600, 0x20a9, 0x000f, 0x2001, 0x0000,
+	0x400f, 0x2091, 0x2800, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f,
+	0x2091, 0x2a00, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091,
+	0x2c00, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2e00,
+	0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2000, 0x2001,
+	0x0000, 0x20c1, 0x0004, 0x2001, 0x017f, 0x2003, 0x0000, 0x20c9,
+	0x1bff, 0x2059, 0x0000, 0x2b78, 0x7883, 0x0004, 0x2089, 0x29be,
+	0x2051, 0x1800, 0x2a70, 0x20e1, 0x0001, 0x20e9, 0x0001, 0x2029,
+	0x4d00, 0x2031, 0xffff, 0x2039, 0x4cd0, 0x2021, 0x0200, 0x20e9,
+	0x0001, 0x20a1, 0x0000, 0x20a9, 0x0800, 0x900e, 0x4104, 0x20e9,
+	0x0001, 0x20a1, 0x1000, 0x900e, 0x2001, 0x0cc0, 0x9084, 0x0fff,
+	0x20a8, 0x4104, 0x2001, 0x0000, 0x9086, 0x0000, 0x0120, 0x21a8,
+	0x4104, 0x8001, 0x1de0, 0x7566, 0x766a, 0x7762, 0x746e, 0x7472,
+	0x00e6, 0x2071, 0x1a8b, 0x2472, 0x00ee, 0x20a1, 0x1cd0, 0x7168,
+	0x810d, 0x810d, 0x810d, 0x810d, 0x918c, 0x000f, 0x2001, 0x0001,
+	0x9112, 0x900e, 0x21a8, 0x4104, 0x8211, 0x1de0, 0x7168, 0x3400,
+	0x8001, 0x9102, 0x0120, 0x0218, 0x20a8, 0x900e, 0x4104, 0x2009,
+	0x1800, 0x810d, 0x810d, 0x810d, 0x810d, 0x810d, 0x918c, 0x001f,
+	0x2001, 0x0001, 0x9112, 0x20e9, 0x0001, 0x20a1, 0x0800, 0x900e,
+	0x20a9, 0x0800, 0x4104, 0x8211, 0x1dd8, 0x080c, 0x0eed, 0x080c,
+	0x5a2f, 0x080c, 0x996c, 0x080c, 0x10a4, 0x080c, 0x127c, 0x080c,
+	0x196d, 0x080c, 0x0d4b, 0x080c, 0x1029, 0x080c, 0x3092, 0x080c,
+	0x6f3e, 0x080c, 0x62c8, 0x080c, 0x7b85, 0x080c, 0x217b, 0x080c,
+	0x7eaf, 0x080c, 0x757c, 0x080c, 0x1fb8, 0x080c, 0x20ec, 0x080c,
+	0x2170, 0x2091, 0x3009, 0x7883, 0x0000, 0x1004, 0x091d, 0x7880,
+	0x9086, 0x0002, 0x1190, 0x7883, 0x4000, 0x7837, 0x4000, 0x7833,
+	0x0010, 0x0e04, 0x0911, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x190c, 0x1167, 0x2071, 0x1800, 0x7003,
+	0x0000, 0x2071, 0x1800, 0x7000, 0x908e, 0x0003, 0x1168, 0x080c,
+	0x4737, 0x080c, 0x30b9, 0x080c, 0x6faf, 0x080c, 0x6787, 0x080c,
+	0x7bae, 0x080c, 0x292b, 0x0c68, 0x000b, 0x0c88, 0x0940, 0x0941,
+	0x0ad4, 0x093e, 0x0b94, 0x0d4a, 0x0d4a, 0x0d4a, 0x080c, 0x0db2,
+	0x0005, 0x0126, 0x00f6, 0x2091, 0x8000, 0x7000, 0x9086, 0x0001,
+	0x1904, 0x0aa7, 0x080c, 0x0e5a, 0x080c, 0x6c53, 0x0150, 0x080c,
+	0x6c76, 0x1590, 0x2079, 0x0100, 0x7828, 0x9085, 0x1800, 0x782a,
+	0x0458, 0x080c, 0x6b8a, 0x7000, 0x9086, 0x0001, 0x1904, 0x0aa7,
+	0x7090, 0x9086, 0x0028, 0x1904, 0x0aa7, 0x080c, 0x7b7c, 0x2001,
+	0x0161, 0x2003, 0x0001, 0x2079, 0x0100, 0x7827, 0xffff, 0x7a28,
+	0x9295, 0x5e2f, 0x7a2a, 0x2011, 0x6ad9, 0x080c, 0x7c4a, 0x2011,
+	0x6acc, 0x080c, 0x7d1b, 0x2011, 0x588a, 0x080c, 0x7c4a, 0x2011,
+	0x8030, 0x901e, 0x738e, 0x04a0, 0x080c, 0x5137, 0x2079, 0x0100,
+	0x7844, 0x9005, 0x1904, 0x0aa7, 0x2011, 0x588a, 0x080c, 0x7c4a,
+	0x2011, 0x6ad9, 0x080c, 0x7c4a, 0x2011, 0x6acc, 0x080c, 0x7d1b,
+	0x2001, 0x0265, 0x2001, 0x0205, 0x2003, 0x0000, 0x7840, 0x9084,
+	0xfffb, 0x7842, 0x2001, 0x1975, 0x2004, 0x9005, 0x1140, 0x00c6,
+	0x2061, 0x0100, 0x080c, 0x59d7, 0x00ce, 0x0804, 0x0aa7, 0x780f,
+	0x006b, 0x7a28, 0x9295, 0x5e2f, 0x7a2a, 0x2011, 0x8010, 0x73d0,
+	0x2001, 0x1976, 0x2003, 0x0001, 0x080c, 0x27f1, 0x080c, 0x4672,
+	0x7240, 0xc284, 0x7242, 0x2001, 0x180c, 0x200c, 0xc1ac, 0xc1cc,
+	0x2102, 0x080c, 0x91bb, 0x2011, 0x0004, 0x080c, 0xb60b, 0x080c,
+	0x61a1, 0x080c, 0x6c53, 0x1120, 0x080c, 0x2835, 0x02e0, 0x0400,
+	0x080c, 0x59de, 0x0140, 0x708f, 0x0001, 0x70cb, 0x0000, 0x080c,
+	0x5304, 0x0804, 0x0aa7, 0x080c, 0x5113, 0xd094, 0x0188, 0x2011,
+	0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c, 0x5117, 0xd0d4, 0x1118,
+	0x080c, 0x2835, 0x1270, 0x2011, 0x180c, 0x2204, 0xc0bc, 0x00a8,
+	0x080c, 0x5117, 0xd0d4, 0x1db8, 0x2011, 0x180c, 0x2204, 0xc0bd,
+	0x0060, 0x2011, 0x180c, 0x2204, 0xc0bd, 0x2012, 0x080c, 0x629c,
+	0x1128, 0xd0a4, 0x0118, 0x2204, 0xc0fd, 0x2012, 0x080c, 0x6262,
+	0x0120, 0x7a0c, 0xc2b4, 0x7a0e, 0x00a8, 0x7077, 0x0000, 0x080c,
+	0x6c53, 0x1130, 0x70a8, 0x9005, 0x1168, 0x080c, 0xba40, 0x0050,
+	0x080c, 0xba40, 0x70d4, 0xd09c, 0x1128, 0x70a8, 0x9005, 0x0110,
+	0x080c, 0x59b4, 0x70df, 0x0000, 0x70db, 0x0000, 0x709f, 0x0000,
+	0x080c, 0x283d, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c4, 0x2012,
+	0x72d4, 0x080c, 0x6c53, 0x1178, 0x9016, 0x0016, 0x080c, 0x25ee,
+	0x2019, 0x193e, 0x211a, 0x001e, 0x7057, 0xffff, 0x705b, 0x00ef,
+	0x707b, 0x0000, 0x0020, 0x2019, 0x193e, 0x201b, 0x0000, 0x2079,
+	0x1853, 0x7804, 0xd0ac, 0x0108, 0xc295, 0x72d6, 0x080c, 0x6c53,
+	0x0118, 0x9296, 0x0004, 0x0548, 0x2011, 0x0001, 0x080c, 0xb60b,
+	0x70a3, 0x0000, 0x70a7, 0xffff, 0x7003, 0x0002, 0x2079, 0x0100,
+	0x7827, 0x0003, 0x7828, 0x9085, 0x0003, 0x782a, 0x00fe, 0x080c,
+	0x2c2b, 0x2011, 0x0005, 0x080c, 0x92ec, 0x080c, 0x8582, 0x080c,
+	0x6c53, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x080c, 0x25ee,
+	0x61e2, 0x001e, 0x00ce, 0x012e, 0x0420, 0x70a3, 0x0000, 0x70a7,
+	0xffff, 0x7003, 0x0002, 0x00f6, 0x2079, 0x0100, 0x7827, 0x0003,
+	0x7828, 0x9085, 0x0003, 0x782a, 0x00fe, 0x2011, 0x0005, 0x080c,
+	0x92ec, 0x080c, 0x8582, 0x080c, 0x6c53, 0x0148, 0x00c6, 0x2061,
+	0x0100, 0x0016, 0x080c, 0x25ee, 0x61e2, 0x001e, 0x00ce, 0x00fe,
+	0x012e, 0x0005, 0x00c6, 0x00b6, 0x080c, 0x6c53, 0x1118, 0x20a9,
+	0x0800, 0x0010, 0x20a9, 0x0782, 0x080c, 0x6c53, 0x1110, 0x900e,
+	0x0010, 0x2009, 0x007e, 0x86ff, 0x0138, 0x9180, 0x1000, 0x2004,
+	0x905d, 0x0110, 0xb800, 0xd0bc, 0x090c, 0x2f28, 0x8108, 0x1f04,
+	0x0abb, 0x7077, 0x0000, 0x7078, 0x9084, 0x00ff, 0x707a, 0x70ab,
+	0x0000, 0x00be, 0x00ce, 0x0005, 0x00b6, 0x0126, 0x2091, 0x8000,
+	0x7000, 0x9086, 0x0002, 0x1904, 0x0b91, 0x70a4, 0x9086, 0xffff,
+	0x0130, 0x080c, 0x2c2b, 0x080c, 0x8582, 0x0804, 0x0b91, 0x70d4,
+	0xd0ac, 0x1110, 0xd09c, 0x0558, 0xd084, 0x0548, 0x0006, 0x2001,
+	0x0103, 0x2003, 0x002b, 0x000e, 0xd08c, 0x0508, 0x080c, 0x2f8b,
+	0x11d0, 0x70d8, 0x9086, 0xffff, 0x01b0, 0x080c, 0x2d9c, 0x080c,
+	0x8582, 0x70d4, 0xd094, 0x1904, 0x0b91, 0x2011, 0x0001, 0x080c,
+	0xbcec, 0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x2dd6, 0x080c,
+	0x8582, 0x0804, 0x0b91, 0x70dc, 0x9005, 0x1904, 0x0b91, 0x70a0,
+	0x9005, 0x1904, 0x0b91, 0x70d4, 0xd0a4, 0x0118, 0xd0b4, 0x0904,
+	0x0b91, 0x080c, 0x6262, 0x1904, 0x0b91, 0x080c, 0x62b5, 0x1904,
+	0x0b91, 0x080c, 0x629c, 0x01c0, 0x0156, 0x00c6, 0x20a9, 0x007f,
+	0x900e, 0x0016, 0x080c, 0x5f7e, 0x1118, 0xb800, 0xd0ec, 0x1138,
+	0x001e, 0x8108, 0x1f04, 0x0b31, 0x00ce, 0x015e, 0x0028, 0x001e,
+	0x00ce, 0x015e, 0x0804, 0x0b91, 0x0006, 0x2001, 0x0103, 0x2003,
+	0x006b, 0x000e, 0x2011, 0x1982, 0x080c, 0x0f5d, 0x2011, 0x199c,
+	0x080c, 0x0f5d, 0x7030, 0xc08c, 0x7032, 0x7003, 0x0003, 0x70a7,
+	0xffff, 0x080c, 0x0e3c, 0x9006, 0x080c, 0x247f, 0x080c, 0x2f8b,
+	0x0118, 0x080c, 0x480f, 0x0050, 0x0036, 0x0046, 0x2019, 0xffff,
+	0x2021, 0x0006, 0x080c, 0x4829, 0x004e, 0x003e, 0x00f6, 0x2079,
+	0x0100, 0x080c, 0x6c76, 0x0150, 0x080c, 0x6c53, 0x7828, 0x0118,
+	0x9084, 0xe1ff, 0x0010, 0x9084, 0xffdf, 0x782a, 0x00fe, 0x2001,
+	0x19b7, 0x2004, 0x9086, 0x0005, 0x1120, 0x2011, 0x0000, 0x080c,
+	0x92ec, 0x2011, 0x0000, 0x080c, 0x92f6, 0x080c, 0x8582, 0x080c,
+	0x865d, 0x012e, 0x00be, 0x0005, 0x0016, 0x0046, 0x00f6, 0x0126,
+	0x2091, 0x8000, 0x2079, 0x0100, 0x7904, 0x918c, 0xfffd, 0x7906,
+	0x2009, 0x00f7, 0x080c, 0x599d, 0x7940, 0x918c, 0x0010, 0x7942,
+	0x7924, 0xd1b4, 0x0110, 0x7827, 0x0040, 0xd19c, 0x0110, 0x7827,
+	0x0008, 0x0006, 0x0036, 0x0156, 0x7954, 0xd1ac, 0x1904, 0x0c21,
+	0x2001, 0x1976, 0x2004, 0x9005, 0x1518, 0x080c, 0x28b8, 0x1148,
+	0x2001, 0x0001, 0x080c, 0x2820, 0x2001, 0x0001, 0x080c, 0x2803,
+	0x00b8, 0x080c, 0x28c0, 0x1138, 0x9006, 0x080c, 0x2820, 0x9006,
+	0x080c, 0x2803, 0x0068, 0x080c, 0x28c8, 0x1d50, 0x2001, 0x1967,
+	0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, 0x261a, 0x0804, 0x0d01,
+	0x080c, 0x6c64, 0x0148, 0x080c, 0x6c76, 0x1118, 0x080c, 0x6f39,
+	0x0050, 0x080c, 0x6c5b, 0x0dd0, 0x080c, 0x6f34, 0x080c, 0x6f2a,
+	0x080c, 0x6b8a, 0x0058, 0x080c, 0x6c53, 0x0140, 0x2009, 0x00f8,
+	0x080c, 0x599d, 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9, 0x09c4,
+	0x7820, 0xd09c, 0x1138, 0x080c, 0x6c53, 0x0138, 0x7824, 0xd0ac,
+	0x1904, 0x0d06, 0x1f04, 0x0c00, 0x0070, 0x7824, 0x080c, 0x6c6d,
+	0x0118, 0xd0ac, 0x1904, 0x0d06, 0x9084, 0x1800, 0x0d98, 0x7003,
+	0x0001, 0x0804, 0x0d06, 0x2001, 0x0001, 0x080c, 0x247f, 0x0804,
+	0x0d19, 0x2001, 0x1976, 0x2004, 0x9005, 0x1518, 0x080c, 0x28b8,
+	0x1148, 0x2001, 0x0001, 0x080c, 0x2820, 0x2001, 0x0001, 0x080c,
+	0x2803, 0x00b8, 0x080c, 0x28c0, 0x1138, 0x9006, 0x080c, 0x2820,
+	0x9006, 0x080c, 0x2803, 0x0068, 0x080c, 0x28c8, 0x1d50, 0x2001,
+	0x1967, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, 0x261a, 0x0804,
+	0x0d01, 0x7850, 0x9085, 0x0040, 0x7852, 0x7938, 0x7850, 0x9084,
+	0xfbcf, 0x7852, 0x080c, 0x28d0, 0x9085, 0x2000, 0x7852, 0x793a,
+	0x20a9, 0x0046, 0x1d04, 0x0c5a, 0x080c, 0x7cfb, 0x1f04, 0x0c5a,
+	0x7850, 0x9085, 0x0400, 0x9084, 0xdfbf, 0x7852, 0x793a, 0x080c,
+	0x6c64, 0x0148, 0x080c, 0x6c76, 0x1118, 0x080c, 0x6f39, 0x0050,
+	0x080c, 0x6c5b, 0x0dd0, 0x080c, 0x6f34, 0x080c, 0x6f2a, 0x080c,
+	0x6b8a, 0x0020, 0x2009, 0x00f8, 0x080c, 0x599d, 0x20a9, 0x0028,
+	0xa001, 0x1f04, 0x0c80, 0x7850, 0x9085, 0x1400, 0x7852, 0x080c,
+	0x6c53, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010, 0x2021, 0xe678,
+	0x2019, 0xea60, 0x0d0c, 0x7cfb, 0x7820, 0xd09c, 0x1588, 0x080c,
+	0x6c53, 0x0904, 0x0ce6, 0x7824, 0xd0ac, 0x1904, 0x0d06, 0x080c,
+	0x6c76, 0x1530, 0x0046, 0x2021, 0x0320, 0x8421, 0x1df0, 0x004e,
+	0x7827, 0x1800, 0x080c, 0x28d0, 0x7824, 0x9084, 0x1800, 0x1168,
+	0x9484, 0x0fff, 0x1140, 0x2001, 0x180f, 0x2004, 0x9084, 0x9000,
+	0x0110, 0x080c, 0x0d27, 0x8421, 0x1158, 0x1d04, 0x0cc1, 0x080c,
+	0x7cfb, 0x080c, 0x6f34, 0x080c, 0x6f2a, 0x7003, 0x0001, 0x04f0,
+	0x8319, 0x1940, 0x1d04, 0x0cce, 0x080c, 0x7cfb, 0x2009, 0x196a,
+	0x2104, 0x9005, 0x0118, 0x8001, 0x200a, 0x1178, 0x200b, 0x000a,
+	0x7827, 0x0048, 0x20a9, 0x0002, 0x080c, 0x28b1, 0x7924, 0x080c,
+	0x28d0, 0xd19c, 0x0110, 0x080c, 0x27f1, 0x00d8, 0x080c, 0x6c64,
+	0x1140, 0x94a2, 0x03e8, 0x1128, 0x080c, 0x6c2d, 0x7003, 0x0001,
+	0x00a8, 0x7827, 0x1800, 0x080c, 0x28d0, 0x7824, 0x080c, 0x6c6d,
+	0x0110, 0xd0ac, 0x1158, 0x9084, 0x1800, 0x0950, 0x7003, 0x0001,
+	0x0028, 0x2001, 0x0001, 0x080c, 0x247f, 0x0078, 0x2009, 0x180c,
+	0x210c, 0xd19c, 0x1120, 0x7904, 0x918d, 0x0002, 0x7906, 0x7827,
+	0x0048, 0x7828, 0x9085, 0x0028, 0x782a, 0x7850, 0x9085, 0x0400,
+	0x7852, 0x2001, 0x1976, 0x2003, 0x0000, 0x9006, 0x78f2, 0x015e,
+	0x003e, 0x000e, 0x012e, 0x00fe, 0x004e, 0x001e, 0x0005, 0x0006,
+	0x0016, 0x0036, 0x0046, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
+	0x0156, 0x0069, 0x0d0c, 0x7cfb, 0x015e, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x00be, 0x004e, 0x003e, 0x001e, 0x000e, 0x0005, 0x00e6,
+	0x2071, 0x1894, 0x7004, 0x9086, 0x0001, 0x1110, 0x080c, 0x30b9,
+	0x00ee, 0x0005, 0x0005, 0x2a70, 0x2061, 0x197a, 0x2063, 0x0003,
+	0x6007, 0x0002, 0x600b, 0x0012, 0x600f, 0x0117, 0x2001, 0x194d,
+	0x900e, 0x2102, 0x718e, 0x2001, 0x0100, 0x2004, 0x9082, 0x0002,
+	0x0218, 0x7057, 0xffff, 0x0008, 0x7156, 0x705f, 0xffff, 0x7176,
+	0x717a, 0x080c, 0xba40, 0x70e3, 0x00c0, 0x2061, 0x193d, 0x6003,
+	0x0909, 0x6106, 0x600b, 0x8800, 0x600f, 0x0200, 0x6013, 0x00ff,
+	0x6017, 0x000f, 0x611a, 0x601f, 0x07d0, 0x2061, 0x1945, 0x6003,
+	0x8000, 0x6106, 0x610a, 0x600f, 0x0200, 0x6013, 0x00ff, 0x6116,
+	0x601b, 0x0001, 0x611e, 0x2061, 0x1958, 0x6003, 0x514c, 0x6007,
+	0x4f47, 0x600b, 0x4943, 0x600f, 0x2020, 0x2001, 0x182a, 0x2102,
+	0x0005, 0x9016, 0x080c, 0x5f7e, 0x1178, 0xb804, 0x90c4, 0x00ff,
+	0x98c6, 0x0006, 0x0128, 0x90c4, 0xff00, 0x98c6, 0x0600, 0x1120,
+	0x9186, 0x0080, 0x0108, 0x8210, 0x8108, 0x9186, 0x0800, 0x1d50,
+	0x2208, 0x0005, 0x2091, 0x8000, 0x0e04, 0x0db4, 0x0006, 0x0016,
+	0x2001, 0x8002, 0x0006, 0x2079, 0x0000, 0x000e, 0x7882, 0x7836,
+	0x001e, 0x798e, 0x000e, 0x788a, 0x000e, 0x7886, 0x3900, 0x789a,
+	0x7833, 0x0012, 0x2091, 0x5000, 0x0156, 0x00d6, 0x0036, 0x0026,
+	0x2079, 0x0300, 0x2069, 0x1a66, 0x7a18, 0x226a, 0x8d68, 0x7a1c,
+	0x226a, 0x782c, 0x2019, 0x1a73, 0x201a, 0x2019, 0x1a76, 0x9016,
+	0x7808, 0xd09c, 0x0168, 0x7820, 0x201a, 0x8210, 0x8318, 0x9386,
+	0x1a8b, 0x0108, 0x0ca8, 0x7808, 0xd09c, 0x0110, 0x2011, 0xdead,
+	0x2019, 0x1a74, 0x782c, 0x201a, 0x8318, 0x221a, 0x7803, 0x0000,
+	0x2069, 0x1a46, 0x901e, 0x20a9, 0x0020, 0x7b26, 0x7a28, 0x226a,
+	0x8d68, 0x8318, 0x1f04, 0x0dfd, 0x002e, 0x003e, 0x00de, 0x015e,
+	0x2079, 0x1800, 0x7803, 0x0005, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x0180, 0x2001, 0x19e8, 0x2004, 0x9005, 0x0128,
+	0x2001, 0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003,
+	0x0002, 0x2003, 0x1001, 0x080c, 0x5122, 0x1108, 0x0011, 0x0cd8,
+	0x0005, 0x0026, 0x0126, 0x2011, 0x0080, 0x080c, 0x0eb4, 0x20a9,
+	0x0900, 0x080c, 0x0ed5, 0x2011, 0x0040, 0x080c, 0x0eb4, 0x20a9,
+	0x0900, 0x080c, 0x0ed5, 0x0c78, 0x0026, 0x080c, 0x0ec1, 0x1118,
+	0x2011, 0x0040, 0x0098, 0x2011, 0x010e, 0x2214, 0x9294, 0x0007,
+	0x9296, 0x0007, 0x0118, 0x2011, 0xa880, 0x0010, 0x2011, 0x6840,
+	0xd0e4, 0x70e7, 0x0000, 0x1128, 0x70e7, 0x0fa0, 0x080c, 0x0ec6,
+	0x002e, 0x0005, 0x0026, 0x080c, 0x0ec1, 0x0128, 0xd0a4, 0x1138,
+	0x2011, 0xcdd5, 0x0010, 0x2011, 0x0080, 0x080c, 0x0ec6, 0x002e,
+	0x0005, 0x0026, 0x70e7, 0x0000, 0x080c, 0x0ec1, 0x1148, 0x080c,
+	0x28c8, 0x1118, 0x2011, 0x8484, 0x0058, 0x2011, 0x8282, 0x0040,
+	0x080c, 0x28c8, 0x1118, 0x2011, 0xcdc5, 0x0010, 0x2011, 0xcac2,
+	0x080c, 0x0ec6, 0x002e, 0x0005, 0x00e6, 0x0006, 0x2071, 0x1800,
+	0xd0b4, 0x70e0, 0x1110, 0xc0e4, 0x0048, 0x0006, 0x3b00, 0x9084,
+	0xff3f, 0x20d8, 0x000e, 0x70e7, 0x0000, 0xc0e5, 0x0079, 0x000e,
+	0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800, 0xd0e4, 0x70e0, 0x1110,
+	0xc0dc, 0x0008, 0xc0dd, 0x0011, 0x00ee, 0x0005, 0x70e2, 0x7000,
+	0x9084, 0x0007, 0x000b, 0x0005, 0x0e83, 0x0e5a, 0x0e5a, 0x0e3c,
+	0x0e69, 0x0e5a, 0x0e5a, 0x0e69, 0x0016, 0x3b08, 0x3a00, 0x9104,
+	0x918d, 0x00c0, 0x21d8, 0x9084, 0xff3f, 0x9205, 0x20d0, 0x001e,
+	0x0005, 0x2001, 0x1838, 0x2004, 0xd0dc, 0x0005, 0x9e86, 0x1800,
+	0x190c, 0x0db2, 0x70e0, 0xd0e4, 0x0108, 0xc2e5, 0x72e2, 0xd0e4,
+	0x1118, 0x9294, 0x00c0, 0x0c01, 0x0005, 0x1d04, 0x0ed5, 0x2091,
+	0x6000, 0x1f04, 0x0ed5, 0x0005, 0x890e, 0x810e, 0x810f, 0x9194,
+	0x003f, 0x918c, 0xffc0, 0x0005, 0x0006, 0x2200, 0x914d, 0x894f,
+	0x894d, 0x894d, 0x000e, 0x000e, 0x0005, 0x01d6, 0x0146, 0x0036,
+	0x0096, 0x2061, 0x1883, 0x600b, 0x0000, 0x600f, 0x0000, 0x6003,
+	0x0000, 0x6007, 0x0000, 0x2009, 0xffc0, 0x2105, 0x0006, 0x2001,
+	0xaaaa, 0x200f, 0x2019, 0x5555, 0x9016, 0x2049, 0x0bff, 0xab02,
+	0xa001, 0xa001, 0xa800, 0x9306, 0x1138, 0x2105, 0x9306, 0x0120,
+	0x8210, 0x99c8, 0x0400, 0x0c98, 0x000e, 0x200f, 0x2001, 0x1893,
+	0x928a, 0x000e, 0x1638, 0x928a, 0x0006, 0x2011, 0x0006, 0x1210,
+	0x2011, 0x0000, 0x2202, 0x9006, 0x2008, 0x82ff, 0x01b0, 0x8200,
+	0x600a, 0x600f, 0xffff, 0x6003, 0x0002, 0x6007, 0x0000, 0x0026,
+	0x2019, 0x0010, 0x9280, 0x0001, 0x20e8, 0x21a0, 0x21a8, 0x4104,
+	0x8319, 0x1de0, 0x8211, 0x1da0, 0x002e, 0x009e, 0x003e, 0x014e,
+	0x01de, 0x0005, 0x2011, 0x000e, 0x08e8, 0x0016, 0x0026, 0x0096,
+	0x3348, 0x080c, 0x0edc, 0x2100, 0x9300, 0x2098, 0x22e0, 0x009e,
+	0x002e, 0x001e, 0x0036, 0x3518, 0x20a9, 0x0001, 0x4002, 0x8007,
+	0x4004, 0x8319, 0x1dd8, 0x003e, 0x0005, 0x20e9, 0x0001, 0x71b0,
+	0x81ff, 0x11c0, 0x9006, 0x2009, 0x0200, 0x20a9, 0x0002, 0x9298,
+	0x0018, 0x23a0, 0x4001, 0x2009, 0x0700, 0x20a9, 0x0002, 0x9298,
+	0x0008, 0x23a0, 0x4001, 0x7074, 0x8007, 0x7178, 0x810f, 0x20a9,
+	0x0002, 0x4001, 0x9298, 0x000c, 0x23a0, 0x900e, 0x080c, 0x0d99,
+	0x2001, 0x0000, 0x810f, 0x20a9, 0x0002, 0x4001, 0x0005, 0x89ff,
+	0x0140, 0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x1007, 0x009e,
+	0x0cb0, 0x0005, 0x00e6, 0x2071, 0x1800, 0x080c, 0x1080, 0x090c,
+	0x0db2, 0x00ee, 0x0005, 0x0086, 0x00e6, 0x0006, 0x0026, 0x0036,
+	0x0126, 0x2091, 0x8000, 0x00c9, 0x2071, 0x1800, 0x73b8, 0x702c,
+	0x9016, 0x9045, 0x0158, 0x8210, 0x9906, 0x090c, 0x0db2, 0x2300,
+	0x9202, 0x0120, 0x1a0c, 0x0db2, 0xa000, 0x0c98, 0x012e, 0x003e,
+	0x002e, 0x000e, 0x00ee, 0x008e, 0x0005, 0x0086, 0x00e6, 0x0006,
+	0x0126, 0x2091, 0x8000, 0x2071, 0x1906, 0x7010, 0x9005, 0x0140,
+	0x7018, 0x9045, 0x0128, 0x9906, 0x090c, 0x0db2, 0xa000, 0x0cc8,
+	0x012e, 0x000e, 0x00ee, 0x008e, 0x0005, 0x00e6, 0x2071, 0x1800,
+	0x0126, 0x2091, 0x8000, 0x70b8, 0x8001, 0x0270, 0x70ba, 0x702c,
+	0x2048, 0x9085, 0x0001, 0xa800, 0x702e, 0xa803, 0x0000, 0xa807,
+	0x0000, 0x012e, 0x00ee, 0x0005, 0x904e, 0x0cd8, 0x00e6, 0x0126,
+	0x2091, 0x8000, 0x2071, 0x1800, 0x70b8, 0x90ca, 0x0040, 0x0268,
+	0x8001, 0x70ba, 0x702c, 0x2048, 0xa800, 0x702e, 0xa803, 0x0000,
+	0xa807, 0x0000, 0x012e, 0x00ee, 0x0005, 0x904e, 0x0cd8, 0x00e6,
+	0x0126, 0x2091, 0x8000, 0x0016, 0x890e, 0x810e, 0x810f, 0x9184,
+	0x003f, 0xa862, 0x9184, 0xffc0, 0xa85e, 0x001e, 0x0020, 0x00e6,
+	0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900,
+	0x702e, 0x70b8, 0x8000, 0x70ba, 0x080c, 0x7b7c, 0x012e, 0x00ee,
+	0x0005, 0x2071, 0x1800, 0x9026, 0x2009, 0x0000, 0x2049, 0x0400,
+	0x2900, 0x702e, 0x8940, 0x2800, 0xa802, 0xa95e, 0xa863, 0x0001,
+	0x8420, 0x9886, 0x0440, 0x0120, 0x2848, 0x9188, 0x0040, 0x0c90,
+	0x2071, 0x1883, 0x7000, 0x9005, 0x11a0, 0x2001, 0x0534, 0xa802,
+	0x2048, 0x2009, 0x4d00, 0x8940, 0x2800, 0xa802, 0xa95e, 0xa863,
+	0x0001, 0x8420, 0x9886, 0x0800, 0x0120, 0x2848, 0x9188, 0x0040,
+	0x0c90, 0x2071, 0x1883, 0x7104, 0x7200, 0x82ff, 0x01d0, 0x7308,
+	0x8318, 0x831f, 0x831b, 0x831b, 0x7312, 0x8319, 0x2001, 0x0800,
+	0xa802, 0x2048, 0x8900, 0xa802, 0x2040, 0xa95e, 0xaa62, 0x8420,
+	0x2300, 0x9906, 0x0130, 0x2848, 0x9188, 0x0040, 0x9291, 0x0000,
+	0x0c88, 0xa803, 0x0000, 0x2071, 0x1800, 0x74b6, 0x74ba, 0x0005,
+	0x00e6, 0x0016, 0x9984, 0xfc00, 0x01e8, 0x908c, 0xf800, 0x1168,
+	0x9982, 0x0400, 0x02b8, 0x9982, 0x0440, 0x0278, 0x9982, 0x0534,
+	0x0288, 0x9982, 0x0800, 0x1270, 0x0040, 0x9982, 0x0800, 0x0250,
+	0x2071, 0x1883, 0x7010, 0x9902, 0x1228, 0x9085, 0x0001, 0x001e,
+	0x00ee, 0x0005, 0x9006, 0x0cd8, 0x00e6, 0x2071, 0x19e7, 0x7007,
+	0x0000, 0x9006, 0x701e, 0x7022, 0x7002, 0x2071, 0x0000, 0x7010,
+	0x9085, 0x8004, 0x7012, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x00e6, 0xa06f, 0x0000, 0x2071, 0x19e7, 0x701c, 0x9088, 0x19f1,
+	0x280a, 0x8000, 0x9084, 0x003f, 0x701e, 0x7120, 0x9106, 0x090c,
+	0x0db2, 0x7004, 0x9005, 0x1128, 0x00f6, 0x2079, 0x0080, 0x00a9,
+	0x00fe, 0x00ee, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x00e6,
+	0x2071, 0x19e7, 0x7004, 0x9005, 0x1128, 0x00f6, 0x2079, 0x0080,
+	0x0021, 0x00fe, 0x00ee, 0x012e, 0x0005, 0x7004, 0x9086, 0x0000,
+	0x1110, 0x7007, 0x0006, 0x7000, 0x0002, 0x10f7, 0x10f5, 0x10f5,
+	0x10f5, 0x126b, 0x126b, 0x126b, 0x126b, 0x080c, 0x0db2, 0x701c,
+	0x7120, 0x9106, 0x1148, 0x792c, 0x9184, 0x0001, 0x1120, 0xd1fc,
+	0x1110, 0x7007, 0x0000, 0x0005, 0x0096, 0x9180, 0x19f1, 0x2004,
+	0x700a, 0x2048, 0x8108, 0x918c, 0x003f, 0x7122, 0x782b, 0x0026,
+	0xa88c, 0x7802, 0xa890, 0x7806, 0xa894, 0x780a, 0xa898, 0x780e,
+	0xa878, 0x700e, 0xa870, 0x7016, 0xa874, 0x701a, 0xa868, 0x009e,
+	0xd084, 0x0120, 0x7007, 0x0001, 0x0029, 0x0005, 0x7007, 0x0002,
+	0x00b1, 0x0005, 0x0016, 0x0026, 0x710c, 0x2011, 0x0040, 0x9182,
+	0x0040, 0x1210, 0x2110, 0x9006, 0x700e, 0x7212, 0x8203, 0x7812,
+	0x782b, 0x0020, 0x782b, 0x0041, 0x002e, 0x001e, 0x0005, 0x0016,
+	0x0026, 0x0136, 0x0146, 0x0156, 0x7014, 0x20e0, 0x7018, 0x2098,
+	0x20e9, 0x0000, 0x20a1, 0x0088, 0x782b, 0x0026, 0x710c, 0x2011,
+	0x0040, 0x9182, 0x0040, 0x1210, 0x2110, 0x9006, 0x700e, 0x22a8,
+	0x4006, 0x8203, 0x7812, 0x782b, 0x0020, 0x3300, 0x701a, 0x782b,
+	0x0001, 0x015e, 0x014e, 0x013e, 0x002e, 0x001e, 0x0005, 0x2009,
+	0x19e7, 0x2104, 0xc095, 0x200a, 0x080c, 0x10d4, 0x0005, 0x0016,
+	0x00e6, 0x2071, 0x19e7, 0x00f6, 0x2079, 0x0080, 0x792c, 0x782b,
+	0x0002, 0xd1fc, 0x0120, 0x918c, 0x0700, 0x7004, 0x0023, 0x00fe,
+	0x00ee, 0x001e, 0x0005, 0x10e5, 0x118a, 0x11be, 0x0db2, 0x0db2,
+	0x1277, 0x0db2, 0x918c, 0x0700, 0x1550, 0x0136, 0x0146, 0x0156,
+	0x7014, 0x20e8, 0x7018, 0x20a0, 0x20e1, 0x0000, 0x2099, 0x0088,
+	0x782b, 0x0040, 0x7010, 0x20a8, 0x4005, 0x3400, 0x701a, 0x015e,
+	0x014e, 0x013e, 0x700c, 0x9005, 0x0578, 0x7800, 0x7802, 0x7804,
+	0x7806, 0x080c, 0x112a, 0x0005, 0x7008, 0x0096, 0x2048, 0xa86f,
+	0x0100, 0x009e, 0x7007, 0x0000, 0x080c, 0x10e5, 0x0005, 0x7008,
+	0x0096, 0x2048, 0xa86f, 0x0200, 0x009e, 0x0ca0, 0x918c, 0x0700,
+	0x1150, 0x700c, 0x9005, 0x0180, 0x7800, 0x7802, 0x7804, 0x7806,
+	0x080c, 0x113f, 0x0005, 0x7008, 0x0096, 0x2048, 0xa86f, 0x0200,
+	0x009e, 0x7007, 0x0000, 0x0080, 0x0096, 0x7008, 0x2048, 0x7800,
+	0xa88e, 0x7804, 0xa892, 0x7808, 0xa896, 0x780c, 0xa89a, 0xa86f,
+	0x0100, 0x009e, 0x7007, 0x0000, 0x0096, 0x00d6, 0x7008, 0x2048,
+	0x2001, 0x18af, 0x2004, 0x9906, 0x1128, 0xa89c, 0x080f, 0x00de,
+	0x009e, 0x00a0, 0x00de, 0x009e, 0x0096, 0x00d6, 0x7008, 0x2048,
+	0x0081, 0x0150, 0xa89c, 0x0086, 0x2940, 0x080f, 0x008e, 0x00de,
+	0x009e, 0x080c, 0x10d4, 0x0005, 0x00de, 0x009e, 0x080c, 0x10d4,
+	0x0005, 0xa8a8, 0xd08c, 0x0005, 0x0096, 0xa0a0, 0x904d, 0x090c,
+	0x0db2, 0xa06c, 0x908e, 0x0100, 0x0130, 0xa87b, 0x0030, 0xa883,
+	0x0000, 0xa897, 0x4002, 0x080c, 0x6529, 0xa09f, 0x0000, 0xa0a3,
+	0x0000, 0x2848, 0x080c, 0x1007, 0x009e, 0x0005, 0x00a6, 0xa0a0,
+	0x904d, 0x090c, 0x0db2, 0xa06c, 0x908e, 0x0100, 0x0128, 0xa87b,
+	0x0001, 0xa883, 0x0000, 0x00c0, 0xa80c, 0x2050, 0xb004, 0x9005,
+	0x0198, 0xa80e, 0x2050, 0x8006, 0x8006, 0x8007, 0x908c, 0x003f,
+	0x9084, 0xffc0, 0x9080, 0x0002, 0xa076, 0xa172, 0xb000, 0xa07a,
+	0x2810, 0x080c, 0x10b5, 0x00e8, 0xa97c, 0xa894, 0x0016, 0x0006,
+	0x080c, 0x6529, 0x000e, 0x001e, 0xd1fc, 0x1138, 0xd1f4, 0x0128,
+	0x00c6, 0x2060, 0x080c, 0x99d6, 0x00ce, 0x7008, 0x2048, 0xa89f,
+	0x0000, 0xa8a3, 0x0000, 0x080c, 0x1007, 0x7007, 0x0000, 0x080c,
+	0x10d4, 0x00ae, 0x0005, 0x0126, 0x2091, 0x8000, 0x782b, 0x1001,
+	0x7007, 0x0005, 0x7000, 0xc094, 0x7002, 0x012e, 0x0005, 0x7007,
+	0x0000, 0x080c, 0x10e5, 0x0005, 0x0126, 0x2091, 0x2200, 0x2079,
+	0x0300, 0x2071, 0x1a31, 0x7003, 0x0000, 0x78bf, 0x00f6, 0x00c1,
+	0x7803, 0x0003, 0x780f, 0x0000, 0x20a9, 0x01ed, 0x2061, 0xd372,
+	0x2c0d, 0x7912, 0xe104, 0x9ce0, 0x0002, 0x7916, 0x1f04, 0x1290,
+	0x7807, 0x0001, 0x7803, 0x0000, 0x7803, 0x0001, 0x012e, 0x0005,
+	0x00c6, 0x7803, 0x0000, 0x7808, 0xd09c, 0x0110, 0x7820, 0x0cd8,
+	0x2001, 0x1a32, 0x2003, 0x0000, 0x78ab, 0x0004, 0x78ac, 0xd0ac,
+	0x1de8, 0x78ab, 0x0002, 0x7807, 0x0001, 0x7827, 0x0030, 0x782b,
+	0x0400, 0x7827, 0x0031, 0x782b, 0x1a46, 0x781f, 0xff00, 0x781b,
+	0xff00, 0x2001, 0x0200, 0x2004, 0xd0dc, 0x0110, 0x781f, 0x0303,
+	0x2061, 0x1a46, 0x602f, 0x1cd0, 0x2001, 0x1818, 0x2004, 0x9082,
+	0x1cd0, 0x6032, 0x603b, 0x1da2, 0x00ce, 0x0005, 0x0126, 0x2091,
+	0x2200, 0x7808, 0xd09c, 0x0158, 0x7820, 0x908c, 0xf000, 0x1588,
+	0x908a, 0x0021, 0x1a0c, 0x0db2, 0x0043, 0x012e, 0x0005, 0x9084,
+	0x0070, 0x190c, 0x0db2, 0x012e, 0x0005, 0x130f, 0x130f, 0x1318,
+	0x131d, 0x1321, 0x1326, 0x134e, 0x1352, 0x1360, 0x1364, 0x130f,
+	0x13ee, 0x13f2, 0x1455, 0x130f, 0x130f, 0x130f, 0x130f, 0x130f,
+	0x130f, 0x130f, 0x130f, 0x130f, 0x130f, 0x130f, 0x130f, 0x130f,
+	0x1328, 0x130f, 0x130f, 0x130f, 0x130f, 0x130f, 0x130f, 0x080c,
+	0x0db2, 0x2009, 0x0048, 0x2060, 0x080c, 0x9a50, 0x012e, 0x0005,
+	0x7004, 0xc085, 0xc0b5, 0x7006, 0x0005, 0x7004, 0xc085, 0x7006,
+	0x0005, 0x080c, 0x145c, 0x080c, 0x1518, 0x0005, 0x080c, 0x0db2,
+	0x080c, 0x145c, 0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff,
+	0x009e, 0x2009, 0x0048, 0x080c, 0x9a50, 0x2001, 0x015d, 0x2003,
+	0x0000, 0x2009, 0x03e8, 0x8109, 0x0160, 0x2001, 0x0201, 0x2004,
+	0x9005, 0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec, 0x1110, 0x080c,
+	0x1461, 0x2001, 0x0307, 0x2003, 0x8000, 0x0005, 0x7004, 0xc095,
+	0x7006, 0x0005, 0x080c, 0x145c, 0x2060, 0x6014, 0x0096, 0x2048,
+	0xa83b, 0xffff, 0x009e, 0x2009, 0x0048, 0x080c, 0x9a50, 0x0005,
+	0x080c, 0x145c, 0x080c, 0x0db2, 0x080c, 0x145c, 0x080c, 0x13d9,
+	0x7827, 0x0018, 0x79ac, 0xd1dc, 0x0540, 0x7827, 0x0015, 0x7828,
+	0x782b, 0x0000, 0x9065, 0x0138, 0x2001, 0x020d, 0x2003, 0x0050,
+	0x2003, 0x0020, 0x0400, 0x7004, 0x9005, 0x1180, 0x78ab, 0x0004,
+	0x7827, 0x0018, 0x782b, 0x0000, 0xd1bc, 0x090c, 0x0db2, 0x2001,
+	0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x0480, 0x78ab, 0x0004,
+	0x7803, 0x0001, 0x080c, 0x13f2, 0x0005, 0x7828, 0x782b, 0x0000,
+	0x9065, 0x090c, 0x0db2, 0x6014, 0x2048, 0x78ab, 0x0004, 0x918c,
+	0x0700, 0x0198, 0x080c, 0x763f, 0x080c, 0x1872, 0x080c, 0xb5fb,
+	0x0158, 0xa9ac, 0xa936, 0xa9b0, 0xa93a, 0xa83f, 0xffff, 0xa843,
+	0xffff, 0xa880, 0xc0bd, 0xa882, 0x0005, 0x6010, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x6024, 0x190c, 0xb9d9, 0x2029, 0x00c8,
+	0x8529, 0x0128, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x7dbc,
+	0x080c, 0xd31b, 0xd5a4, 0x1118, 0x080c, 0x1461, 0x0005, 0x080c,
+	0x763f, 0x080c, 0x1872, 0x0005, 0x781f, 0x0300, 0x7803, 0x0001,
+	0x0005, 0x0016, 0x0066, 0x0076, 0x00f6, 0x2079, 0x0300, 0x7908,
+	0x918c, 0x0007, 0x9186, 0x0003, 0x0120, 0x2001, 0x0016, 0x080c,
+	0x14d2, 0x00fe, 0x007e, 0x006e, 0x001e, 0x0005, 0x7004, 0xc09d,
+	0x7006, 0x0005, 0x7104, 0x9184, 0x0004, 0x190c, 0x0db2, 0xd184,
+	0x1189, 0xd19c, 0x0158, 0xc19c, 0x7106, 0x2001, 0x020d, 0x2003,
+	0x0050, 0x2003, 0x0020, 0x080c, 0x1461, 0x0005, 0x81ff, 0x190c,
+	0x0db2, 0x0005, 0xc184, 0xd1b4, 0xc1b4, 0x7106, 0x0016, 0x00e6,
+	0x15e0, 0x2071, 0x0200, 0x080c, 0x150c, 0x6014, 0x9005, 0x05a8,
+	0x0096, 0x2048, 0xa864, 0x009e, 0x9084, 0x00ff, 0x908e, 0x0029,
+	0x0160, 0x908e, 0x0048, 0x1548, 0x601c, 0xd084, 0x11d8, 0x00f6,
+	0x2c78, 0x080c, 0x1582, 0x00fe, 0x00a8, 0x00f6, 0x2c78, 0x080c,
+	0x16b6, 0x00fe, 0x2009, 0x01f4, 0x8109, 0x0160, 0x2001, 0x0201,
+	0x2004, 0x9005, 0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec, 0x1110,
+	0x0401, 0x0040, 0x2001, 0x020d, 0x2003, 0x0020, 0x080c, 0x12a0,
+	0x7803, 0x0001, 0x00ee, 0x001e, 0x0005, 0x2001, 0x020d, 0x2003,
+	0x0050, 0x2003, 0x0020, 0x0069, 0x0ca8, 0x0031, 0x2060, 0x2009,
+	0x0053, 0x080c, 0x9a50, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820,
+	0x0005, 0x080c, 0x13d9, 0x00d6, 0x2069, 0x0200, 0x2009, 0x01f4,
+	0x8109, 0x0510, 0x6804, 0x9005, 0x0dd8, 0x2001, 0x015d, 0x2003,
+	0x0000, 0x79bc, 0xd1a4, 0x1528, 0x79b8, 0x918c, 0x0fff, 0x0180,
+	0x9182, 0x0841, 0x1268, 0x9188, 0x0007, 0x918c, 0x0ff8, 0x810c,
+	0x810c, 0x810c, 0x080c, 0x14c4, 0x6827, 0x0001, 0x8109, 0x1dd0,
+	0x04d9, 0x6827, 0x0002, 0x04c1, 0x6804, 0x9005, 0x1130, 0x682c,
+	0xd0e4, 0x1500, 0x6804, 0x9005, 0x0de8, 0x79b8, 0xd1ec, 0x1130,
+	0x08c0, 0x080c, 0x763f, 0x080c, 0x1872, 0x0090, 0x7827, 0x0015,
+	0x782b, 0x0000, 0x7827, 0x0018, 0x782b, 0x0000, 0x2001, 0x020d,
+	0x2003, 0x0020, 0x2001, 0x0307, 0x2003, 0x0300, 0x7803, 0x0001,
+	0x00de, 0x0005, 0x682c, 0x9084, 0x5400, 0x9086, 0x5400, 0x0d30,
+	0x7827, 0x0015, 0x782b, 0x0000, 0x7803, 0x0001, 0x6800, 0x9085,
+	0x1800, 0x6802, 0x00de, 0x0005, 0x6824, 0x9084, 0x0003, 0x1de0,
+	0x0005, 0x2001, 0x0030, 0x2c08, 0x621c, 0x0021, 0x7830, 0x9086,
+	0x0041, 0x0005, 0x00f6, 0x2079, 0x0300, 0x0006, 0x7808, 0xd09c,
+	0x0140, 0x0016, 0x0026, 0x00c6, 0x080c, 0x12d6, 0x00ce, 0x002e,
+	0x001e, 0x000e, 0x0006, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080,
+	0x2009, 0xff00, 0x8109, 0x0130, 0x7818, 0xd0bc, 0x1dd8, 0x000e,
+	0x00fe, 0x0005, 0x000e, 0x792c, 0x3900, 0x8000, 0x2004, 0x080c,
+	0x0db2, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x2009, 0xff00,
+	0x8109, 0x0120, 0x7818, 0xd0bc, 0x1dd8, 0x0005, 0x792c, 0x3900,
+	0x8000, 0x2004, 0x080c, 0x0db2, 0x7037, 0x0001, 0x7150, 0x7037,
+	0x0002, 0x7050, 0x2060, 0xd1bc, 0x1110, 0x7054, 0x2060, 0x0005,
+	0x00e6, 0x0016, 0x2071, 0x0200, 0x0c79, 0x6124, 0xd1dc, 0x01f8,
+	0x701c, 0xd08c, 0x0904, 0x1577, 0x7017, 0x0000, 0x2001, 0x0264,
+	0x2004, 0xd0bc, 0x0904, 0x1577, 0x2001, 0x0268, 0x00c6, 0x2064,
+	0x6104, 0x6038, 0x00ce, 0x918e, 0x0039, 0x1904, 0x1577, 0x9c06,
+	0x15f0, 0x0126, 0x2091, 0x2600, 0x080c, 0x7597, 0x012e, 0x7358,
+	0x745c, 0x6014, 0x905d, 0x0598, 0x2b48, 0x6010, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x190c, 0xb9b4, 0xab42, 0xac3e, 0x2001,
+	0x1875, 0x2004, 0xd0b4, 0x1170, 0x601c, 0xd0e4, 0x1158, 0x6010,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1120, 0xa83b, 0x7fff,
+	0xa837, 0xffff, 0x080c, 0x1dc2, 0x1190, 0x080c, 0x1705, 0x2a00,
+	0xa816, 0x0130, 0x2800, 0xa80e, 0x2c05, 0xa80a, 0x2c00, 0xa812,
+	0x7037, 0x0020, 0x781f, 0x0300, 0x001e, 0x00ee, 0x0005, 0x7037,
+	0x0050, 0x7037, 0x0020, 0x001e, 0x00ee, 0x080c, 0x1461, 0x0005,
+	0x080c, 0x0db2, 0x2ff0, 0x0126, 0x2091, 0x2200, 0x3e60, 0x6014,
+	0x2048, 0x2940, 0x903e, 0x2730, 0xa864, 0x2068, 0xa81a, 0x9d84,
+	0x000f, 0x9088, 0x1da2, 0x2165, 0x0002, 0x15ac, 0x15f9, 0x15ac,
+	0x15ac, 0x15ac, 0x15db, 0x15ac, 0x15b0, 0x15a5, 0x15f0, 0x15ac,
+	0x15ac, 0x15ac, 0x16b4, 0x15c4, 0x15ba, 0xa964, 0x918c, 0x00ff,
+	0x918e, 0x0048, 0x0904, 0x15f0, 0x9085, 0x0001, 0x0804, 0x16ac,
+	0xa87c, 0xd0bc, 0x0dc8, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa888,
+	0x0804, 0x1600, 0xa87c, 0xd0bc, 0x0d78, 0xa890, 0xa842, 0xa88c,
+	0xa83e, 0xa888, 0x0804, 0x164f, 0xa87c, 0xd0bc, 0x0d28, 0xa890,
+	0xa842, 0xa88c, 0xa83e, 0xa804, 0x9045, 0x090c, 0x0db2, 0xa164,
+	0xa91a, 0x91ec, 0x000f, 0x9d80, 0x1da2, 0x2065, 0xa888, 0xd19c,
+	0x1904, 0x164f, 0x0428, 0xa87c, 0xd0ac, 0x0970, 0xa804, 0x9045,
+	0x090c, 0x0db2, 0xa164, 0xa91a, 0x91ec, 0x000f, 0x9d80, 0x1da2,
+	0x2065, 0x9006, 0xa842, 0xa83e, 0xd19c, 0x1904, 0x164f, 0x0080,
+	0xa87c, 0xd0ac, 0x0904, 0x15ac, 0x9006, 0xa842, 0xa83e, 0x0804,
+	0x164f, 0xa87c, 0xd0ac, 0x0904, 0x15ac, 0x9006, 0xa842, 0xa83e,
+	0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0db2, 0x9082, 0x001b, 0x0002,
+	0x1623, 0x1623, 0x1625, 0x1623, 0x1623, 0x1623, 0x162b, 0x1623,
+	0x1623, 0x1623, 0x1631, 0x1623, 0x1623, 0x1623, 0x1637, 0x1623,
+	0x1623, 0x1623, 0x163d, 0x1623, 0x1623, 0x1623, 0x1643, 0x1623,
+	0x1623, 0x1623, 0x1649, 0x080c, 0x0db2, 0xa574, 0xa478, 0xa37c,
+	0xa280, 0x0804, 0x1694, 0xa584, 0xa488, 0xa38c, 0xa290, 0x0804,
+	0x1694, 0xa594, 0xa498, 0xa39c, 0xa2a0, 0x0804, 0x1694, 0xa5a4,
+	0xa4a8, 0xa3ac, 0xa2b0, 0x0804, 0x1694, 0xa5b4, 0xa4b8, 0xa3bc,
+	0xa2c0, 0x0804, 0x1694, 0xa5c4, 0xa4c8, 0xa3cc, 0xa2d0, 0x0804,
+	0x1694, 0xa5d4, 0xa4d8, 0xa3dc, 0xa2e0, 0x0804, 0x1694, 0x2c05,
+	0x908a, 0x0034, 0x1a0c, 0x0db2, 0x9082, 0x001b, 0x0002, 0x1672,
+	0x1670, 0x1670, 0x1670, 0x1670, 0x1670, 0x1679, 0x1670, 0x1670,
+	0x1670, 0x1670, 0x1670, 0x1680, 0x1670, 0x1670, 0x1670, 0x1670,
+	0x1670, 0x1687, 0x1670, 0x1670, 0x1670, 0x1670, 0x1670, 0x168e,
+	0x080c, 0x0db2, 0xa56c, 0xa470, 0xa774, 0xa678, 0xa37c, 0xa280,
+	0x00d8, 0xa584, 0xa488, 0xa78c, 0xa690, 0xa394, 0xa298, 0x00a0,
+	0xa59c, 0xa4a0, 0xa7a4, 0xa6a8, 0xa3ac, 0xa2b0, 0x0068, 0xa5b4,
+	0xa4b8, 0xa7bc, 0xa6c0, 0xa3c4, 0xa2c8, 0x0030, 0xa5cc, 0xa4d0,
+	0xa7d4, 0xa6d8, 0xa3dc, 0xa2e0, 0xab2e, 0xaa32, 0xad1e, 0xac22,
+	0xaf26, 0xae2a, 0xa988, 0x8c60, 0x2c1d, 0xa8ac, 0xaab0, 0xa836,
+	0xaa3a, 0x8109, 0xa916, 0x1150, 0x3e60, 0x601c, 0xc085, 0x601e,
+	0xa87c, 0xc0dd, 0xa87e, 0x9006, 0x012e, 0x0005, 0x2800, 0xa80e,
+	0xab0a, 0x2c00, 0xa812, 0x0c80, 0x0804, 0x15ac, 0x2ff0, 0x0126,
+	0x2091, 0x2200, 0x3e60, 0x6014, 0x2048, 0x2940, 0xa80e, 0x2061,
+	0x1d9d, 0xa80b, 0x1d9d, 0x2c05, 0xa812, 0xa964, 0xa91a, 0xa87c,
+	0xd0ac, 0x090c, 0x0db2, 0x9006, 0xa842, 0xa83e, 0x2c05, 0x908a,
+	0x0034, 0x1a0c, 0x0db2, 0xadcc, 0xacd0, 0xafd4, 0xaed8, 0xabdc,
+	0xaae0, 0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a, 0xa8ac,
+	0xaab0, 0xa836, 0xaa3a, 0xa988, 0x918a, 0x0002, 0xa916, 0x1150,
+	0x3e60, 0x601c, 0xc085, 0x601e, 0xa87c, 0xc0dd, 0xa87e, 0x9006,
+	0x012e, 0x0005, 0xa804, 0x9045, 0x090c, 0x0db2, 0xa80e, 0xa064,
+	0xa81a, 0x9084, 0x000f, 0x9080, 0x1da2, 0x2015, 0x82ff, 0x090c,
+	0x0db2, 0xaa0a, 0x2205, 0xa812, 0x0c18, 0x903e, 0x2730, 0xa880,
+	0xd0fc, 0x1190, 0x2d00, 0x0002, 0x17fa, 0x175c, 0x175c, 0x17fa,
+	0x17fa, 0x17f4, 0x17fa, 0x175c, 0x17fa, 0x17ab, 0x17ab, 0x17fa,
+	0x17fa, 0x17fa, 0x17f1, 0x17ab, 0xc0fc, 0xa882, 0xab2c, 0xaa30,
+	0xad1c, 0xac20, 0xdd9c, 0x0904, 0x17fc, 0x2c05, 0x908a, 0x0034,
+	0x1a0c, 0x0db2, 0x9082, 0x001b, 0x0002, 0x1748, 0x1746, 0x1746,
+	0x1746, 0x1746, 0x1746, 0x174c, 0x1746, 0x1746, 0x1746, 0x1746,
+	0x1746, 0x1750, 0x1746, 0x1746, 0x1746, 0x1746, 0x1746, 0x1754,
+	0x1746, 0x1746, 0x1746, 0x1746, 0x1746, 0x1758, 0x080c, 0x0db2,
+	0xa774, 0xa678, 0x0804, 0x17fc, 0xa78c, 0xa690, 0x0804, 0x17fc,
+	0xa7a4, 0xa6a8, 0x0804, 0x17fc, 0xa7bc, 0xa6c0, 0x0804, 0x17fc,
+	0xa7d4, 0xa6d8, 0x0804, 0x17fc, 0x2c05, 0x908a, 0x0036, 0x1a0c,
+	0x0db2, 0x9082, 0x001b, 0x0002, 0x177f, 0x177f, 0x1781, 0x177f,
+	0x177f, 0x177f, 0x1787, 0x177f, 0x177f, 0x177f, 0x178d, 0x177f,
+	0x177f, 0x177f, 0x1793, 0x177f, 0x177f, 0x177f, 0x1799, 0x177f,
+	0x177f, 0x177f, 0x179f, 0x177f, 0x177f, 0x177f, 0x17a5, 0x080c,
+	0x0db2, 0xa574, 0xa478, 0xa37c, 0xa280, 0x0804, 0x17fc, 0xa584,
+	0xa488, 0xa38c, 0xa290, 0x0804, 0x17fc, 0xa594, 0xa498, 0xa39c,
+	0xa2a0, 0x0804, 0x17fc, 0xa5a4, 0xa4a8, 0xa3ac, 0xa2b0, 0x0804,
+	0x17fc, 0xa5b4, 0xa4b8, 0xa3bc, 0xa2c0, 0x0804, 0x17fc, 0xa5c4,
+	0xa4c8, 0xa3cc, 0xa2d0, 0x0804, 0x17fc, 0xa5d4, 0xa4d8, 0xa3dc,
+	0xa2e0, 0x0804, 0x17fc, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0db2,
+	0x9082, 0x001b, 0x0002, 0x17ce, 0x17cc, 0x17cc, 0x17cc, 0x17cc,
+	0x17cc, 0x17d5, 0x17cc, 0x17cc, 0x17cc, 0x17cc, 0x17cc, 0x17dc,
+	0x17cc, 0x17cc, 0x17cc, 0x17cc, 0x17cc, 0x17e3, 0x17cc, 0x17cc,
+	0x17cc, 0x17cc, 0x17cc, 0x17ea, 0x080c, 0x0db2, 0xa56c, 0xa470,
+	0xa774, 0xa678, 0xa37c, 0xa280, 0x0438, 0xa584, 0xa488, 0xa78c,
+	0xa690, 0xa394, 0xa298, 0x0400, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8,
+	0xa3ac, 0xa2b0, 0x00c8, 0xa5b4, 0xa4b8, 0xa7bc, 0xa6c0, 0xa3c4,
+	0xa2c8, 0x0090, 0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0xa3dc, 0xa2e0,
+	0x0058, 0x9d86, 0x000e, 0x1130, 0x080c, 0x1d60, 0x1904, 0x1705,
+	0x900e, 0x0050, 0x080c, 0x0db2, 0xab2e, 0xaa32, 0xad1e, 0xac22,
+	0xaf26, 0xae2a, 0x080c, 0x1d60, 0x0005, 0x6014, 0x2048, 0x6118,
+	0x810c, 0x810c, 0x810c, 0x81ff, 0x1118, 0xa887, 0x0001, 0x0008,
+	0xa986, 0x601b, 0x0002, 0xa974, 0xd1dc, 0x1108, 0x0005, 0xa934,
+	0xa88c, 0x9106, 0x1158, 0xa938, 0xa890, 0x9106, 0x1138, 0x601c,
+	0xc084, 0x601e, 0x2009, 0x0048, 0x0804, 0x9a50, 0x0005, 0x0126,
+	0x00c6, 0x2091, 0x2200, 0x00ce, 0x7908, 0x918c, 0x0007, 0x9186,
+	0x0000, 0x05b0, 0x9186, 0x0003, 0x0598, 0x6020, 0x6023, 0x0000,
+	0x0006, 0x2031, 0x0008, 0x00c6, 0x781f, 0x0808, 0x7808, 0xd09c,
+	0x0120, 0x080c, 0x12d6, 0x8631, 0x1db8, 0x00ce, 0x781f, 0x0800,
+	0x2031, 0x0168, 0x00c6, 0x7808, 0xd09c, 0x190c, 0x12d6, 0x00ce,
+	0x2001, 0x0038, 0x080c, 0x18ff, 0x7930, 0x9186, 0x0040, 0x0160,
+	0x9186, 0x0042, 0x190c, 0x0db2, 0x2001, 0x001e, 0x8001, 0x1df0,
+	0x8631, 0x1d40, 0x080c, 0x190e, 0x000e, 0x6022, 0x012e, 0x0005,
+	0x080c, 0x18fb, 0x7827, 0x0015, 0x7828, 0x9c06, 0x1db8, 0x782b,
+	0x0000, 0x0ca0, 0x00f6, 0x2079, 0x0300, 0x7803, 0x0000, 0x78ab,
+	0x0004, 0x00fe, 0x080c, 0x6c53, 0x11b0, 0x2001, 0x0138, 0x2003,
+	0x0000, 0x2001, 0x0160, 0x2003, 0x0000, 0x2011, 0x012c, 0xa001,
+	0xa001, 0x8211, 0x1de0, 0x0081, 0x0066, 0x2031, 0x0000, 0x080c,
+	0x6d03, 0x006e, 0x0005, 0x0479, 0x0039, 0x2001, 0x0160, 0x2502,
+	0x2001, 0x0138, 0x2202, 0x0005, 0x00e6, 0x2071, 0x0200, 0x080c,
+	0x28dc, 0x2009, 0x003c, 0x080c, 0x20d9, 0x2001, 0x015d, 0x2003,
+	0x0000, 0x7000, 0x9084, 0x003c, 0x1de0, 0x080c, 0x7b7c, 0x70a0,
+	0x70a2, 0x7098, 0x709a, 0x709c, 0x709e, 0x2001, 0x020d, 0x2003,
+	0x0020, 0x00f6, 0x2079, 0x0300, 0x080c, 0x12a0, 0x7803, 0x0001,
+	0x00fe, 0x00ee, 0x0005, 0x2001, 0x0138, 0x2014, 0x2003, 0x0000,
+	0x2001, 0x0160, 0x202c, 0x2003, 0x0000, 0x080c, 0x6c53, 0x1108,
+	0x0005, 0x2021, 0x0260, 0x2001, 0x0141, 0x201c, 0xd3dc, 0x1168,
+	0x2001, 0x0109, 0x201c, 0x939c, 0x0048, 0x1160, 0x2001, 0x0111,
+	0x201c, 0x83ff, 0x1110, 0x8421, 0x1d70, 0x2001, 0x015d, 0x2003,
+	0x0000, 0x0005, 0x0046, 0x2021, 0x0019, 0x2003, 0x0048, 0xa001,
+	0xa001, 0x201c, 0x939c, 0x0048, 0x0120, 0x8421, 0x1db0, 0x004e,
+	0x0c60, 0x004e, 0x0c40, 0x601c, 0xc084, 0x601e, 0x0005, 0x2c08,
+	0x621c, 0x080c, 0x14d2, 0x7930, 0x0005, 0x2c08, 0x621c, 0x080c,
+	0x14f9, 0x7930, 0x0005, 0x8001, 0x1df0, 0x0005, 0x2031, 0x0005,
+	0x781c, 0x9084, 0x0007, 0x0170, 0x2001, 0x0038, 0x0c41, 0x9186,
+	0x0040, 0x0904, 0x196c, 0x2001, 0x001e, 0x0c69, 0x8631, 0x1d80,
+	0x080c, 0x0db2, 0x781f, 0x0202, 0x2001, 0x015d, 0x2003, 0x0000,
+	0x2001, 0x0b10, 0x0c01, 0x781c, 0xd084, 0x0110, 0x0861, 0x04e0,
+	0x2001, 0x0030, 0x0891, 0x9186, 0x0040, 0x0568, 0x781c, 0xd084,
+	0x1da8, 0x781f, 0x0101, 0x2001, 0x0014, 0x0869, 0x2001, 0x0037,
+	0x0821, 0x9186, 0x0040, 0x0140, 0x2001, 0x0030, 0x080c, 0x1905,
+	0x9186, 0x0040, 0x190c, 0x0db2, 0x00d6, 0x2069, 0x0200, 0x692c,
+	0xd1f4, 0x1170, 0xd1c4, 0x0160, 0xd19c, 0x0130, 0x6800, 0x9085,
+	0x1800, 0x6802, 0x00de, 0x0080, 0x6908, 0x9184, 0x0007, 0x1db0,
+	0x00de, 0x781f, 0x0100, 0x791c, 0x9184, 0x0007, 0x090c, 0x0db2,
+	0xa001, 0xa001, 0x781f, 0x0200, 0x0005, 0x0126, 0x2091, 0x2400,
+	0x2071, 0x1a34, 0x2079, 0x0090, 0x012e, 0x0005, 0x9280, 0x0005,
+	0x2004, 0x2048, 0xa97c, 0xd1dc, 0x1904, 0x19f1, 0xa964, 0x9184,
+	0x0007, 0x0002, 0x198a, 0x19dc, 0x1991, 0x1991, 0x1991, 0x19c4,
+	0x19a4, 0x1993, 0x2100, 0x9084, 0x00ff, 0x9086, 0x0048, 0x0904,
+	0x19dc, 0x080c, 0x0db2, 0xa87c, 0xd0b4, 0x0904, 0x1ba3, 0xa890,
+	0xa842, 0xa83a, 0xa88c, 0xa83e, 0xa836, 0xa8ac, 0xa846, 0xa8b0,
+	0xa84a, 0xa988, 0x0804, 0x19e4, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x001e, 0x1d38, 0xa87c, 0xd0b4, 0x0904, 0x1ba3, 0xa890, 0xa842,
+	0xa83a, 0xa88c, 0xa83e, 0xa836, 0xa8ac, 0xa846, 0xa8b0, 0xa84a,
+	0xa804, 0xa85a, 0x2040, 0xa064, 0x9084, 0x000f, 0x9080, 0x1da2,
+	0x2005, 0xa812, 0xa988, 0x0448, 0x918c, 0x00ff, 0x9186, 0x0015,
+	0x1540, 0xa87c, 0xd0b4, 0x0904, 0x1ba3, 0xa804, 0xa85a, 0x2040,
+	0xa064, 0x9084, 0x000f, 0x9080, 0x1da2, 0x2005, 0xa812, 0xa988,
+	0x9006, 0xa842, 0xa83e, 0x0088, 0xa87c, 0xd0b4, 0x0904, 0x1ba3,
+	0xa988, 0x9006, 0xa842, 0xa83e, 0x2900, 0xa85a, 0xa864, 0x9084,
+	0x000f, 0x9080, 0x1da2, 0x2005, 0xa812, 0xa916, 0xa87c, 0xc0dd,
+	0xa87e, 0x0005, 0x00f6, 0x2079, 0x0090, 0x782c, 0xd0fc, 0x190c,
+	0x1be4, 0x00e6, 0x2071, 0x1a34, 0x7000, 0x9005, 0x1904, 0x1a4b,
+	0x7206, 0x9280, 0x0005, 0x204c, 0x9280, 0x0004, 0x2004, 0x782b,
+	0x0004, 0x00f6, 0x2079, 0x0200, 0x7803, 0x0040, 0x00fe, 0x00b6,
+	0x2058, 0xb86c, 0x7836, 0xb890, 0x00be, 0x00f6, 0x2079, 0x0200,
+	0x7803, 0x0040, 0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0xa001,
+	0x781a, 0x2079, 0x0100, 0x8004, 0x78d6, 0x00fe, 0xa814, 0x2050,
+	0xa858, 0x2040, 0xa810, 0x2060, 0xa064, 0x90ec, 0x000f, 0xa944,
+	0x791a, 0x7116, 0xa848, 0x781e, 0x701a, 0x9006, 0x700e, 0x7012,
+	0x7004, 0xa940, 0xa838, 0x9106, 0x1188, 0xa93c, 0xa834, 0x9106,
+	0x1168, 0x8aff, 0x01a8, 0x0126, 0x2091, 0x8000, 0x00a1, 0x0108,
+	0x0091, 0x012e, 0x9006, 0x00ee, 0x00fe, 0x0005, 0x0036, 0x0046,
+	0xab38, 0xac34, 0x080c, 0x1dc2, 0x004e, 0x003e, 0x0d50, 0x0c98,
+	0x9085, 0x0001, 0x0c80, 0x0076, 0x0066, 0x0056, 0x0046, 0x0036,
+	0x0026, 0x8aff, 0x0904, 0x1b9c, 0x700c, 0x7214, 0x923a, 0x7010,
+	0x7218, 0x9203, 0x0a04, 0x1b9b, 0x9705, 0x0904, 0x1b9b, 0x903e,
+	0x2730, 0xa880, 0xd0fc, 0x1190, 0x2d00, 0x0002, 0x1b7f, 0x1ac6,
+	0x1ac6, 0x1b7f, 0x1b7f, 0x1b62, 0x1b7f, 0x1ac6, 0x1b68, 0x1b15,
+	0x1b15, 0x1b7f, 0x1b7f, 0x1b7f, 0x1b5c, 0x1b15, 0xc0fc, 0xa882,
+	0xab2c, 0xaa30, 0xad1c, 0xac20, 0xdd9c, 0x0904, 0x1b81, 0x2c05,
+	0x908a, 0x0034, 0x1a0c, 0x0db2, 0x9082, 0x001b, 0x0002, 0x1ab2,
+	0x1ab0, 0x1ab0, 0x1ab0, 0x1ab0, 0x1ab0, 0x1ab6, 0x1ab0, 0x1ab0,
+	0x1ab0, 0x1ab0, 0x1ab0, 0x1aba, 0x1ab0, 0x1ab0, 0x1ab0, 0x1ab0,
+	0x1ab0, 0x1abe, 0x1ab0, 0x1ab0, 0x1ab0, 0x1ab0, 0x1ab0, 0x1ac2,
+	0x080c, 0x0db2, 0xa774, 0xa678, 0x0804, 0x1b81, 0xa78c, 0xa690,
+	0x0804, 0x1b81, 0xa7a4, 0xa6a8, 0x0804, 0x1b81, 0xa7bc, 0xa6c0,
+	0x0804, 0x1b81, 0xa7d4, 0xa6d8, 0x0804, 0x1b81, 0x2c05, 0x908a,
+	0x0036, 0x1a0c, 0x0db2, 0x9082, 0x001b, 0x0002, 0x1ae9, 0x1ae9,
+	0x1aeb, 0x1ae9, 0x1ae9, 0x1ae9, 0x1af1, 0x1ae9, 0x1ae9, 0x1ae9,
+	0x1af7, 0x1ae9, 0x1ae9, 0x1ae9, 0x1afd, 0x1ae9, 0x1ae9, 0x1ae9,
+	0x1b03, 0x1ae9, 0x1ae9, 0x1ae9, 0x1b09, 0x1ae9, 0x1ae9, 0x1ae9,
+	0x1b0f, 0x080c, 0x0db2, 0xa574, 0xa478, 0xa37c, 0xa280, 0x0804,
+	0x1b81, 0xa584, 0xa488, 0xa38c, 0xa290, 0x0804, 0x1b81, 0xa594,
+	0xa498, 0xa39c, 0xa2a0, 0x0804, 0x1b81, 0xa5a4, 0xa4a8, 0xa3ac,
+	0xa2b0, 0x0804, 0x1b81, 0xa5b4, 0xa4b8, 0xa3bc, 0xa2c0, 0x0804,
+	0x1b81, 0xa5c4, 0xa4c8, 0xa3cc, 0xa2d0, 0x0804, 0x1b81, 0xa5d4,
+	0xa4d8, 0xa3dc, 0xa2e0, 0x0804, 0x1b81, 0x2c05, 0x908a, 0x0034,
+	0x1a0c, 0x0db2, 0x9082, 0x001b, 0x0002, 0x1b38, 0x1b36, 0x1b36,
+	0x1b36, 0x1b36, 0x1b36, 0x1b40, 0x1b36, 0x1b36, 0x1b36, 0x1b36,
+	0x1b36, 0x1b47, 0x1b36, 0x1b36, 0x1b36, 0x1b36, 0x1b36, 0x1b4e,
+	0x1b36, 0x1b36, 0x1b36, 0x1b36, 0x1b36, 0x1b55, 0x080c, 0x0db2,
+	0xa56c, 0xa470, 0xa774, 0xa678, 0xa37c, 0xa280, 0x0804, 0x1b81,
+	0xa584, 0xa488, 0xa78c, 0xa690, 0xa394, 0xa298, 0x04d0, 0xa59c,
+	0xa4a0, 0xa7a4, 0xa6a8, 0xa3ac, 0xa2b0, 0x0498, 0xa5b4, 0xa4b8,
+	0xa7bc, 0xa6c0, 0xa3c4, 0xa2c8, 0x0460, 0xa5cc, 0xa4d0, 0xa7d4,
+	0xa6d8, 0xa3dc, 0xa2e0, 0x0428, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x001e, 0x11e8, 0x080c, 0x1d60, 0x1904, 0x1a61, 0x900e, 0x04a0,
+	0xa864, 0x9084, 0x00ff, 0x9086, 0x0048, 0x190c, 0x0db2, 0x00c6,
+	0x7004, 0x2060, 0x6004, 0x9086, 0x0043, 0x00ce, 0x0904, 0x1b15,
+	0xab9c, 0x9016, 0xad8c, 0xac90, 0xaf94, 0xae98, 0x0010, 0x080c,
+	0x0db2, 0x7b12, 0x7a16, 0x7d02, 0x7c06, 0x7f0a, 0x7e0e, 0x782b,
+	0x0001, 0x7000, 0x8000, 0x7002, 0xa83c, 0x9300, 0xa83e, 0xa840,
+	0x9201, 0xa842, 0x700c, 0x9300, 0x700e, 0x7010, 0x9201, 0x7012,
+	0x080c, 0x1d60, 0x0008, 0x9006, 0x002e, 0x003e, 0x004e, 0x005e,
+	0x006e, 0x007e, 0x0005, 0x080c, 0x0db2, 0x0026, 0x2001, 0x0105,
+	0x2003, 0x0010, 0x782b, 0x0004, 0x7003, 0x0000, 0x7004, 0x2060,
+	0x6014, 0x2048, 0x080c, 0xb5fb, 0x0118, 0xa880, 0xc0bd, 0xa882,
+	0x6020, 0x9086, 0x0006, 0x1180, 0x2061, 0x0100, 0x62c8, 0x2001,
+	0x00fa, 0x8001, 0x1df0, 0x60c8, 0x9206, 0x1dc0, 0x60c4, 0xa89a,
+	0x60c8, 0xa896, 0x7004, 0x2060, 0x00c6, 0x080c, 0xb251, 0x00ce,
+	0x2001, 0x19c5, 0x2004, 0x9c06, 0x1160, 0x2009, 0x0040, 0x080c,
+	0x20d9, 0x080c, 0x9479, 0x2011, 0x0000, 0x080c, 0x92f6, 0x080c,
+	0x865d, 0x002e, 0x0804, 0x1d12, 0x0126, 0x2091, 0x2400, 0xa858,
+	0x2040, 0x792c, 0x782b, 0x0002, 0x9184, 0x0700, 0x1904, 0x1ba5,
+	0x7000, 0x0002, 0x1d12, 0x1bf6, 0x1c63, 0x1d10, 0x8001, 0x7002,
+	0xd19c, 0x1150, 0x8aff, 0x05b0, 0x080c, 0x1a5b, 0x0904, 0x1d12,
+	0x080c, 0x1a5b, 0x0804, 0x1d12, 0x782b, 0x0004, 0xd194, 0x0148,
+	0xa880, 0xc0fc, 0xa882, 0x8aff, 0x11d8, 0xa87c, 0xc0f5, 0xa87e,
+	0x00b8, 0x0026, 0x0036, 0xab3c, 0xaa40, 0x7810, 0xa82e, 0x931a,
+	0x7814, 0xa832, 0x9213, 0x7800, 0xa81e, 0x7804, 0xa822, 0xab3e,
+	0xaa42, 0x003e, 0x002e, 0x080c, 0x1d78, 0xa880, 0xc0fd, 0xa882,
+	0x2a00, 0xa816, 0x2800, 0xa85a, 0x2c00, 0xa812, 0x7003, 0x0000,
+	0x0804, 0x1d12, 0x00f6, 0x0026, 0x781c, 0x0006, 0x7818, 0x0006,
+	0x2079, 0x0100, 0x7a14, 0x9284, 0x1984, 0x9085, 0x0012, 0x7816,
+	0x0036, 0x2019, 0x1000, 0x8319, 0x090c, 0x0db2, 0x7820, 0xd0bc,
+	0x1dd0, 0x003e, 0x79c8, 0x000e, 0x9102, 0x001e, 0x0006, 0x0016,
+	0x79c4, 0x000e, 0x9103, 0x78c6, 0x000e, 0x78ca, 0x9284, 0x1984,
+	0x9085, 0x0012, 0x7816, 0x002e, 0x00fe, 0x782b, 0x0008, 0x7003,
+	0x0000, 0x0804, 0x1d12, 0x8001, 0x7002, 0xd194, 0x0170, 0x782c,
+	0xd0fc, 0x1904, 0x1be9, 0xd19c, 0x1904, 0x1d0e, 0x8aff, 0x0904,
+	0x1d12, 0x080c, 0x1a5b, 0x0804, 0x1d12, 0x0026, 0x0036, 0xab3c,
+	0xaa40, 0x080c, 0x1d78, 0xdd9c, 0x1904, 0x1ccd, 0x2c05, 0x908a,
+	0x0036, 0x1a0c, 0x0db2, 0x9082, 0x001b, 0x0002, 0x1ca1, 0x1ca1,
+	0x1ca3, 0x1ca1, 0x1ca1, 0x1ca1, 0x1ca9, 0x1ca1, 0x1ca1, 0x1ca1,
+	0x1caf, 0x1ca1, 0x1ca1, 0x1ca1, 0x1cb5, 0x1ca1, 0x1ca1, 0x1ca1,
+	0x1cbb, 0x1ca1, 0x1ca1, 0x1ca1, 0x1cc1, 0x1ca1, 0x1ca1, 0x1ca1,
+	0x1cc7, 0x080c, 0x0db2, 0xa07c, 0x931a, 0xa080, 0x9213, 0x0804,
+	0x1c15, 0xa08c, 0x931a, 0xa090, 0x9213, 0x0804, 0x1c15, 0xa09c,
+	0x931a, 0xa0a0, 0x9213, 0x0804, 0x1c15, 0xa0ac, 0x931a, 0xa0b0,
+	0x9213, 0x0804, 0x1c15, 0xa0bc, 0x931a, 0xa0c0, 0x9213, 0x0804,
+	0x1c15, 0xa0cc, 0x931a, 0xa0d0, 0x9213, 0x0804, 0x1c15, 0xa0dc,
+	0x931a, 0xa0e0, 0x9213, 0x0804, 0x1c15, 0x2c05, 0x908a, 0x0034,
+	0x1a0c, 0x0db2, 0x9082, 0x001b, 0x0002, 0x1cf0, 0x1cee, 0x1cee,
+	0x1cee, 0x1cee, 0x1cee, 0x1cf6, 0x1cee, 0x1cee, 0x1cee, 0x1cee,
+	0x1cee, 0x1cfc, 0x1cee, 0x1cee, 0x1cee, 0x1cee, 0x1cee, 0x1d02,
+	0x1cee, 0x1cee, 0x1cee, 0x1cee, 0x1cee, 0x1d08, 0x080c, 0x0db2,
+	0xa07c, 0x931a, 0xa080, 0x9213, 0x0804, 0x1c15, 0xa094, 0x931a,
+	0xa098, 0x9213, 0x0804, 0x1c15, 0xa0ac, 0x931a, 0xa0b0, 0x9213,
+	0x0804, 0x1c15, 0xa0c4, 0x931a, 0xa0c8, 0x9213, 0x0804, 0x1c15,
+	0xa0dc, 0x931a, 0xa0e0, 0x9213, 0x0804, 0x1c15, 0x0804, 0x1c11,
+	0x080c, 0x0db2, 0x012e, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a34,
+	0x7000, 0x9086, 0x0000, 0x0904, 0x1d5d, 0x2079, 0x0090, 0x2009,
+	0x0207, 0x210c, 0xd194, 0x01b8, 0x2009, 0x020c, 0x210c, 0x9184,
+	0x0003, 0x0188, 0x080c, 0xd364, 0x2001, 0x0133, 0x2004, 0x9005,
+	0x090c, 0x0db2, 0x0016, 0x2009, 0x0040, 0x080c, 0x20d9, 0x001e,
+	0x2001, 0x020c, 0x2102, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203,
+	0x210c, 0x9106, 0x1120, 0x2009, 0x0040, 0x080c, 0x20d9, 0x782c,
+	0xd0fc, 0x09a8, 0x080c, 0x1be4, 0x7000, 0x9086, 0x0000, 0x1978,
+	0x782b, 0x0004, 0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c,
+	0x20d9, 0x782b, 0x0002, 0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005,
+	0x8c60, 0x2c05, 0x9005, 0x0110, 0x8a51, 0x0005, 0xa004, 0x9005,
+	0x0168, 0xa85a, 0x2040, 0xa064, 0x9084, 0x000f, 0x9080, 0x1da2,
+	0x2065, 0x8cff, 0x090c, 0x0db2, 0x8a51, 0x0005, 0x2050, 0x0005,
+	0x8a50, 0x8c61, 0x2c05, 0x9005, 0x1190, 0x2800, 0x9906, 0x0120,
+	0xa000, 0x9005, 0x1108, 0x2900, 0x2040, 0xa85a, 0xa064, 0x9084,
+	0x000f, 0x9080, 0x1db2, 0x2065, 0x8cff, 0x090c, 0x0db2, 0x0005,
+	0x0000, 0x001d, 0x0021, 0x0025, 0x0029, 0x002d, 0x0031, 0x0035,
+	0x0000, 0x001b, 0x0021, 0x0027, 0x002d, 0x0033, 0x0000, 0x0000,
+	0x0023, 0x0000, 0x0000, 0x1d95, 0x1d91, 0x0000, 0x0000, 0x1d9f,
+	0x0000, 0x1d95, 0x1d9c, 0x1d9c, 0x1d99, 0x0000, 0x0000, 0x0000,
+	0x1d9f, 0x1d9c, 0x0000, 0x1d97, 0x1d97, 0x0000, 0x0000, 0x1d9f,
+	0x0000, 0x1d97, 0x1d9d, 0x1d9d, 0x1d9d, 0x0000, 0x0000, 0x0000,
+	0x1d9f, 0x1d9d, 0x00c6, 0x00d6, 0x0086, 0xab42, 0xac3e, 0xa888,
+	0x9055, 0x0904, 0x1f99, 0x2940, 0xa064, 0x90ec, 0x000f, 0x9de0,
+	0x1da2, 0x9d86, 0x0007, 0x0130, 0x9d86, 0x000e, 0x0118, 0x9d86,
+	0x000f, 0x1120, 0xa08c, 0x9422, 0xa090, 0x931b, 0x2c05, 0x9065,
+	0x1140, 0x0310, 0x0804, 0x1f99, 0xa004, 0x9045, 0x0904, 0x1f99,
+	0x0c18, 0x2c05, 0x9005, 0x0904, 0x1e81, 0xdd9c, 0x1904, 0x1e3d,
+	0x908a, 0x0036, 0x1a0c, 0x0db2, 0x9082, 0x001b, 0x0002, 0x1e12,
+	0x1e12, 0x1e14, 0x1e12, 0x1e12, 0x1e12, 0x1e1a, 0x1e12, 0x1e12,
+	0x1e12, 0x1e20, 0x1e12, 0x1e12, 0x1e12, 0x1e26, 0x1e12, 0x1e12,
+	0x1e12, 0x1e2c, 0x1e12, 0x1e12, 0x1e12, 0x1e32, 0x1e12, 0x1e12,
+	0x1e12, 0x1e38, 0x080c, 0x0db2, 0xa07c, 0x9422, 0xa080, 0x931b,
+	0x0804, 0x1e77, 0xa08c, 0x9422, 0xa090, 0x931b, 0x0804, 0x1e77,
+	0xa09c, 0x9422, 0xa0a0, 0x931b, 0x0804, 0x1e77, 0xa0ac, 0x9422,
+	0xa0b0, 0x931b, 0x0804, 0x1e77, 0xa0bc, 0x9422, 0xa0c0, 0x931b,
+	0x0804, 0x1e77, 0xa0cc, 0x9422, 0xa0d0, 0x931b, 0x0804, 0x1e77,
+	0xa0dc, 0x9422, 0xa0e0, 0x931b, 0x04d0, 0x908a, 0x0034, 0x1a0c,
+	0x0db2, 0x9082, 0x001b, 0x0002, 0x1e5f, 0x1e5d, 0x1e5d, 0x1e5d,
+	0x1e5d, 0x1e5d, 0x1e64, 0x1e5d, 0x1e5d, 0x1e5d, 0x1e5d, 0x1e5d,
+	0x1e69, 0x1e5d, 0x1e5d, 0x1e5d, 0x1e5d, 0x1e5d, 0x1e6e, 0x1e5d,
+	0x1e5d, 0x1e5d, 0x1e5d, 0x1e5d, 0x1e73, 0x080c, 0x0db2, 0xa07c,
+	0x9422, 0xa080, 0x931b, 0x0098, 0xa094, 0x9422, 0xa098, 0x931b,
+	0x0070, 0xa0ac, 0x9422, 0xa0b0, 0x931b, 0x0048, 0xa0c4, 0x9422,
+	0xa0c8, 0x931b, 0x0020, 0xa0dc, 0x9422, 0xa0e0, 0x931b, 0x0630,
+	0x2300, 0x9405, 0x0160, 0x8a51, 0x0904, 0x1f99, 0x8c60, 0x0804,
+	0x1de9, 0xa004, 0x9045, 0x0904, 0x1f99, 0x0804, 0x1dcc, 0x8a51,
+	0x0904, 0x1f99, 0x8c60, 0x2c05, 0x9005, 0x1158, 0xa004, 0x9045,
+	0x0904, 0x1f99, 0xa064, 0x90ec, 0x000f, 0x9de0, 0x1da2, 0x2c05,
+	0x2060, 0xa880, 0xc0fc, 0xa882, 0x0804, 0x1f8e, 0x2c05, 0x8422,
+	0x8420, 0x831a, 0x9399, 0x0000, 0xac2e, 0xab32, 0xdd9c, 0x1904,
+	0x1f2b, 0x9082, 0x001b, 0x0002, 0x1ec7, 0x1ec7, 0x1ec9, 0x1ec7,
+	0x1ec7, 0x1ec7, 0x1ed7, 0x1ec7, 0x1ec7, 0x1ec7, 0x1ee5, 0x1ec7,
+	0x1ec7, 0x1ec7, 0x1ef3, 0x1ec7, 0x1ec7, 0x1ec7, 0x1f01, 0x1ec7,
+	0x1ec7, 0x1ec7, 0x1f0f, 0x1ec7, 0x1ec7, 0x1ec7, 0x1f1d, 0x080c,
+	0x0db2, 0xa17c, 0x2400, 0x9122, 0xa180, 0x2300, 0x911b, 0x0a0c,
+	0x0db2, 0xa074, 0x9420, 0xa078, 0x9319, 0x0804, 0x1f89, 0xa18c,
+	0x2400, 0x9122, 0xa190, 0x2300, 0x911b, 0x0a0c, 0x0db2, 0xa084,
+	0x9420, 0xa088, 0x9319, 0x0804, 0x1f89, 0xa19c, 0x2400, 0x9122,
+	0xa1a0, 0x2300, 0x911b, 0x0a0c, 0x0db2, 0xa094, 0x9420, 0xa098,
+	0x9319, 0x0804, 0x1f89, 0xa1ac, 0x2400, 0x9122, 0xa1b0, 0x2300,
+	0x911b, 0x0a0c, 0x0db2, 0xa0a4, 0x9420, 0xa0a8, 0x9319, 0x0804,
+	0x1f89, 0xa1bc, 0x2400, 0x9122, 0xa1c0, 0x2300, 0x911b, 0x0a0c,
+	0x0db2, 0xa0b4, 0x9420, 0xa0b8, 0x9319, 0x0804, 0x1f89, 0xa1cc,
+	0x2400, 0x9122, 0xa1d0, 0x2300, 0x911b, 0x0a0c, 0x0db2, 0xa0c4,
+	0x9420, 0xa0c8, 0x9319, 0x0804, 0x1f89, 0xa1dc, 0x2400, 0x9122,
+	0xa1e0, 0x2300, 0x911b, 0x0a0c, 0x0db2, 0xa0d4, 0x9420, 0xa0d8,
+	0x9319, 0x0804, 0x1f89, 0x9082, 0x001b, 0x0002, 0x1f49, 0x1f47,
+	0x1f47, 0x1f47, 0x1f47, 0x1f47, 0x1f56, 0x1f47, 0x1f47, 0x1f47,
+	0x1f47, 0x1f47, 0x1f63, 0x1f47, 0x1f47, 0x1f47, 0x1f47, 0x1f47,
+	0x1f70, 0x1f47, 0x1f47, 0x1f47, 0x1f47, 0x1f47, 0x1f7d, 0x080c,
+	0x0db2, 0xa17c, 0x2400, 0x9122, 0xa180, 0x2300, 0x911b, 0x0a0c,
+	0x0db2, 0xa06c, 0x9420, 0xa070, 0x9319, 0x0498, 0xa194, 0x2400,
+	0x9122, 0xa198, 0x2300, 0x911b, 0x0a0c, 0x0db2, 0xa084, 0x9420,
+	0xa088, 0x9319, 0x0430, 0xa1ac, 0x2400, 0x9122, 0xa1b0, 0x2300,
+	0x911b, 0x0a0c, 0x0db2, 0xa09c, 0x9420, 0xa0a0, 0x9319, 0x00c8,
+	0xa1c4, 0x2400, 0x9122, 0xa1c8, 0x2300, 0x911b, 0x0a0c, 0x0db2,
+	0xa0b4, 0x9420, 0xa0b8, 0x9319, 0x0060, 0xa1dc, 0x2400, 0x9122,
+	0xa1e0, 0x2300, 0x911b, 0x0a0c, 0x0db2, 0xa0cc, 0x9420, 0xa0d0,
+	0x9319, 0xac1e, 0xab22, 0xa880, 0xc0fd, 0xa882, 0x2800, 0xa85a,
+	0x2c00, 0xa812, 0x2a00, 0xa816, 0x000e, 0x000e, 0x000e, 0x9006,
+	0x0028, 0x008e, 0x00de, 0x00ce, 0x9085, 0x0001, 0x0005, 0x2001,
+	0x0005, 0x2004, 0x9084, 0x0007, 0x0002, 0x1fb7, 0x1be4, 0x1fb7,
+	0x1fad, 0x1fb0, 0x1fb3, 0x1fb0, 0x1fb3, 0x080c, 0x1be4, 0x0005,
+	0x080c, 0x116f, 0x0005, 0x080c, 0x1be4, 0x080c, 0x116f, 0x0005,
+	0x0126, 0x2091, 0x2600, 0x2079, 0x0200, 0x2071, 0x0260, 0x2069,
+	0x1800, 0x7817, 0x0000, 0x789b, 0x0814, 0x78a3, 0x0406, 0x789f,
+	0x0410, 0x2009, 0x013b, 0x200b, 0x0400, 0x781b, 0x0002, 0x783b,
+	0x001f, 0x7837, 0x0020, 0x7803, 0x1600, 0x012e, 0x0005, 0x2091,
+	0x2600, 0x781c, 0xd0a4, 0x190c, 0x20d6, 0x7900, 0xd1dc, 0x1118,
+	0x9084, 0x0006, 0x001a, 0x9084, 0x000e, 0x0002, 0x1ffe, 0x1ff6,
+	0x7597, 0x1ff6, 0x1ff8, 0x1ff8, 0x1ff8, 0x1ff8, 0x757d, 0x1ff6,
+	0x1ffa, 0x1ff6, 0x1ff8, 0x1ff6, 0x1ff8, 0x1ff6, 0x080c, 0x0db2,
+	0x0031, 0x0020, 0x080c, 0x757d, 0x080c, 0x7597, 0x0005, 0x0006,
+	0x0016, 0x0026, 0x080c, 0xd364, 0x7930, 0x9184, 0x0003, 0x01c0,
+	0x2001, 0x19c5, 0x2004, 0x9005, 0x0170, 0x2001, 0x0133, 0x2004,
+	0x9005, 0x090c, 0x0db2, 0x00c6, 0x2001, 0x19c5, 0x2064, 0x080c,
+	0xb251, 0x00ce, 0x00f8, 0x2009, 0x0040, 0x080c, 0x20d9, 0x00d0,
+	0x9184, 0x0014, 0x01a0, 0x6a00, 0x9286, 0x0003, 0x0160, 0x080c,
+	0x6c53, 0x1138, 0x080c, 0x6f2a, 0x080c, 0x5a21, 0x080c, 0x6b8a,
+	0x0010, 0x080c, 0x58e0, 0x080c, 0x7635, 0x0041, 0x0018, 0x9184,
+	0x9540, 0x1dc8, 0x002e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x0036,
+	0x0046, 0x0056, 0x2071, 0x1a31, 0x080c, 0x1872, 0x005e, 0x004e,
+	0x003e, 0x00ee, 0x0005, 0x0126, 0x2091, 0x2e00, 0x2071, 0x1800,
+	0x7128, 0x2001, 0x1940, 0x2102, 0x2001, 0x1948, 0x2102, 0x2001,
+	0x013b, 0x2102, 0x2079, 0x0200, 0x2001, 0x0201, 0x789e, 0x78a3,
+	0x0200, 0x9198, 0x0007, 0x831c, 0x831c, 0x831c, 0x9398, 0x0005,
+	0x2320, 0x9182, 0x0204, 0x1230, 0x2011, 0x0008, 0x8423, 0x8423,
+	0x8423, 0x0488, 0x9182, 0x024c, 0x1240, 0x2011, 0x0007, 0x8403,
+	0x8003, 0x9400, 0x9400, 0x9420, 0x0430, 0x9182, 0x02bc, 0x1238,
+	0x2011, 0x0006, 0x8403, 0x8003, 0x9400, 0x9420, 0x00e0, 0x9182,
+	0x034c, 0x1230, 0x2011, 0x0005, 0x8403, 0x8003, 0x9420, 0x0098,
+	0x9182, 0x042c, 0x1228, 0x2011, 0x0004, 0x8423, 0x8423, 0x0058,
+	0x9182, 0x059c, 0x1228, 0x2011, 0x0003, 0x8403, 0x9420, 0x0018,
+	0x2011, 0x0002, 0x8423, 0x9482, 0x0228, 0x8002, 0x8020, 0x8301,
+	0x9402, 0x0110, 0x0208, 0x8321, 0x8217, 0x8203, 0x9405, 0x789a,
+	0x012e, 0x0005, 0x0006, 0x00d6, 0x2069, 0x0200, 0x6814, 0x9084,
+	0xffc0, 0x910d, 0x6916, 0x00de, 0x000e, 0x0005, 0x00d6, 0x2069,
+	0x0200, 0x9005, 0x6810, 0x0110, 0xc0a5, 0x0008, 0xc0a4, 0x6812,
+	0x00de, 0x0005, 0x0006, 0x00d6, 0x2069, 0x0200, 0x6810, 0x9084,
+	0xfff8, 0x910d, 0x6912, 0x00de, 0x000e, 0x0005, 0x7938, 0x080c,
+	0x0db2, 0x00f6, 0x2079, 0x0200, 0x7902, 0xa001, 0xa001, 0xa001,
+	0xa001, 0xa001, 0xa001, 0x7902, 0xa001, 0xa001, 0xa001, 0xa001,
+	0xa001, 0xa001, 0x00fe, 0x0005, 0x0126, 0x2091, 0x2800, 0x2061,
+	0x0100, 0x2071, 0x1800, 0x2009, 0x0000, 0x080c, 0x28d6, 0x080c,
+	0x27f1, 0x6054, 0x8004, 0x8004, 0x8004, 0x8004, 0x9084, 0x000c,
+	0x6150, 0x918c, 0xfff3, 0x9105, 0x6052, 0x6050, 0x9084, 0xb17f,
+	0x9085, 0x2000, 0x6052, 0x2009, 0x196c, 0x2011, 0x196d, 0x6358,
+	0x939c, 0x38f0, 0x2320, 0x080c, 0x2835, 0x1238, 0x939d, 0x4003,
+	0x94a5, 0x8603, 0x230a, 0x2412, 0x0030, 0x939d, 0x0203, 0x94a5,
+	0x8603, 0x230a, 0x2412, 0x9006, 0x080c, 0x2820, 0x9006, 0x080c,
+	0x2803, 0x20a9, 0x0012, 0x1d04, 0x212b, 0x2091, 0x6000, 0x1f04,
+	0x212b, 0x602f, 0x0100, 0x602f, 0x0000, 0x6050, 0x9085, 0x0400,
+	0x9084, 0xdfff, 0x6052, 0x6024, 0x6026, 0x080c, 0x250f, 0x2009,
+	0x00ef, 0x6132, 0x6136, 0x080c, 0x251f, 0x60e7, 0x0000, 0x61ea,
+	0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043, 0x0000, 0x602f, 0x0080,
+	0x602f, 0x0000, 0x6007, 0x049f, 0x60bb, 0x0000, 0x20a9, 0x0018,
+	0x60bf, 0x0000, 0x1f04, 0x2158, 0x60bb, 0x0000, 0x60bf, 0x0108,
+	0x60bf, 0x0012, 0x60bf, 0x0320, 0x60bf, 0x0018, 0x601b, 0x00f0,
+	0x601f, 0x001e, 0x600f, 0x006b, 0x602b, 0x402f, 0x012e, 0x0005,
+	0x00f6, 0x2079, 0x0140, 0x78c3, 0x0080, 0x78c3, 0x0083, 0x78c3,
+	0x0000, 0x00fe, 0x0005, 0x2001, 0x1833, 0x2003, 0x0000, 0x2001,
+	0x1832, 0x2003, 0x0001, 0x0005, 0x0126, 0x2091, 0x2800, 0x0006,
+	0x0016, 0x0026, 0x6124, 0x9184, 0x5e2c, 0x1118, 0x9184, 0x0007,
+	0x002a, 0x9195, 0x0004, 0x9284, 0x0007, 0x0002, 0x21b8, 0x219e,
+	0x21a1, 0x21a4, 0x21a9, 0x21ab, 0x21af, 0x21b3, 0x080c, 0x7eec,
+	0x00b8, 0x080c, 0x7fb9, 0x00a0, 0x080c, 0x7fb9, 0x080c, 0x7eec,
+	0x0078, 0x0099, 0x0068, 0x080c, 0x7eec, 0x0079, 0x0048, 0x080c,
+	0x7fb9, 0x0059, 0x0028, 0x080c, 0x7fb9, 0x080c, 0x7eec, 0x0029,
+	0x002e, 0x001e, 0x000e, 0x012e, 0x0005, 0x00a6, 0x6124, 0x6028,
+	0xd09c, 0x0118, 0xd19c, 0x1904, 0x2408, 0xd1f4, 0x0110, 0x080c,
+	0x0db2, 0x080c, 0x6c53, 0x0904, 0x2214, 0x080c, 0xbcec, 0x1120,
+	0x7000, 0x9086, 0x0003, 0x0570, 0x6024, 0x9084, 0x1800, 0x0550,
+	0x080c, 0x6c76, 0x0118, 0x080c, 0x6c64, 0x1520, 0x6027, 0x0020,
+	0x6043, 0x0000, 0x080c, 0xbcec, 0x0168, 0x080c, 0x6c76, 0x1150,
+	0x2001, 0x1976, 0x2003, 0x0001, 0x6027, 0x1800, 0x080c, 0x6ad9,
+	0x0804, 0x240b, 0x709c, 0x9005, 0x1150, 0x709f, 0x0001, 0x00d6,
+	0x2069, 0x0140, 0x080c, 0x6caa, 0x00de, 0x1904, 0x240b, 0x080c,
+	0x6f34, 0x0428, 0x080c, 0x6c76, 0x1590, 0x6024, 0x9084, 0x1800,
+	0x1108, 0x0468, 0x080c, 0x6f34, 0x080c, 0x6f2a, 0x080c, 0x5a21,
+	0x080c, 0x6b8a, 0x0804, 0x2408, 0xd1ac, 0x1508, 0x6024, 0xd0dc,
+	0x1170, 0xd0e4, 0x1178, 0xd0d4, 0x1190, 0xd0cc, 0x0130, 0x7090,
+	0x9086, 0x0028, 0x1110, 0x080c, 0x6e17, 0x0804, 0x2408, 0x080c,
+	0x6f2f, 0x0048, 0x2001, 0x194e, 0x2003, 0x0002, 0x0020, 0x080c,
+	0x6d8d, 0x0804, 0x2408, 0x080c, 0x6eb2, 0x0804, 0x2408, 0xd1ac,
+	0x0904, 0x2329, 0x080c, 0x6c53, 0x11c0, 0x6027, 0x0020, 0x0006,
+	0x0026, 0x0036, 0x080c, 0x6c6d, 0x1158, 0x080c, 0x6f2a, 0x080c,
+	0x5a21, 0x080c, 0x6b8a, 0x003e, 0x002e, 0x000e, 0x00ae, 0x0005,
+	0x003e, 0x002e, 0x000e, 0x080c, 0x6c2d, 0x0016, 0x0046, 0x00c6,
+	0x644c, 0x9486, 0xf0f0, 0x1138, 0x2061, 0x0100, 0x644a, 0x6043,
+	0x0090, 0x6043, 0x0010, 0x74d2, 0x948c, 0xff00, 0x7034, 0xd084,
+	0x0178, 0x9186, 0xf800, 0x1160, 0x7040, 0xd084, 0x1148, 0xc085,
+	0x7042, 0x0036, 0x2418, 0x2011, 0x8016, 0x080c, 0x4672, 0x003e,
+	0x080c, 0xbce5, 0x1904, 0x2306, 0x9196, 0xff00, 0x05a8, 0x7058,
+	0x9084, 0x00ff, 0x810f, 0x81ff, 0x0110, 0x9116, 0x0568, 0x7130,
+	0xd184, 0x1550, 0x080c, 0x2f86, 0x0128, 0xc18d, 0x7132, 0x080c,
+	0x629c, 0x1510, 0x6240, 0x9294, 0x0010, 0x0130, 0x6248, 0x9294,
+	0xff00, 0x9296, 0xff00, 0x01c0, 0x7030, 0xd08c, 0x0904, 0x2306,
+	0x7034, 0xd08c, 0x1140, 0x2001, 0x180c, 0x200c, 0xd1ac, 0x1904,
+	0x2306, 0xc1ad, 0x2102, 0x0036, 0x73d0, 0x2011, 0x8013, 0x080c,
+	0x4672, 0x003e, 0x0804, 0x2306, 0x7034, 0xd08c, 0x1140, 0x2001,
+	0x180c, 0x200c, 0xd1ac, 0x1904, 0x2306, 0xc1ad, 0x2102, 0x0036,
+	0x73d0, 0x2011, 0x8013, 0x080c, 0x4672, 0x003e, 0x7130, 0xc185,
+	0x7132, 0x2011, 0x1854, 0x220c, 0xd1a4, 0x01f0, 0x0016, 0x2009,
+	0x0001, 0x2011, 0x0100, 0x080c, 0x7e3e, 0x2019, 0x000e, 0x00c6,
+	0x2061, 0x0000, 0x080c, 0xcf62, 0x00ce, 0x9484, 0x00ff, 0x9080,
+	0x2f92, 0x200d, 0x918c, 0xff00, 0x810f, 0x2120, 0x9006, 0x2009,
+	0x000e, 0x080c, 0xcfe6, 0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009,
+	0x0002, 0x2019, 0x0004, 0x080c, 0x2dfb, 0x001e, 0x0078, 0x0156,
+	0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c, 0x5f7e, 0x1110, 0x080c,
+	0x5a3b, 0x8108, 0x1f04, 0x22fc, 0x00be, 0x015e, 0x00ce, 0x004e,
+	0x080c, 0x9947, 0x60e3, 0x0000, 0x001e, 0x2001, 0x1800, 0x2014,
+	0x9296, 0x0004, 0x1170, 0xd19c, 0x11a0, 0x2011, 0x180c, 0x2214,
+	0xd29c, 0x1120, 0x6204, 0x9295, 0x0002, 0x6206, 0x6228, 0xc29d,
+	0x622a, 0x2003, 0x0001, 0x2001, 0x1824, 0x2003, 0x0000, 0x6027,
+	0x0020, 0xd194, 0x0904, 0x2408, 0x0016, 0x6220, 0xd2b4, 0x0904,
+	0x23b1, 0x080c, 0x7cc7, 0x080c, 0x8fbb, 0x6027, 0x0004, 0x00f6,
+	0x2019, 0x19bf, 0x2304, 0x907d, 0x0904, 0x2380, 0x7804, 0x9086,
+	0x0032, 0x15f0, 0x00d6, 0x00c6, 0x00e6, 0x0096, 0x2069, 0x0140,
+	0x782c, 0x685e, 0x7808, 0x685a, 0x6043, 0x0002, 0x2001, 0x0003,
+	0x8001, 0x1df0, 0x6043, 0x0000, 0x2001, 0x003c, 0x8001, 0x1df0,
+	0x080c, 0x2997, 0x2001, 0x001e, 0x8001, 0x0240, 0x20a9, 0x0009,
+	0x080c, 0x28b1, 0x6904, 0xd1dc, 0x1140, 0x0cb0, 0x2001, 0x0100,
+	0x080c, 0x2987, 0x9006, 0x080c, 0x2987, 0x080c, 0x847d, 0x080c,
+	0x8582, 0x7814, 0x2048, 0xa867, 0x0103, 0x2f60, 0x080c, 0x99d6,
+	0x009e, 0x00ee, 0x00ce, 0x00de, 0x00fe, 0x001e, 0x00ae, 0x0005,
+	0x00fe, 0x00d6, 0x2069, 0x0140, 0x6804, 0x9084, 0x4000, 0x0110,
+	0x080c, 0x2997, 0x00de, 0x00c6, 0x2061, 0x19b6, 0x6028, 0x080c,
+	0xbcec, 0x0120, 0x909a, 0x0003, 0x1258, 0x0018, 0x909a, 0x00c8,
+	0x1238, 0x8000, 0x602a, 0x00ce, 0x080c, 0x8f97, 0x0804, 0x2407,
+	0x2061, 0x0100, 0x62c0, 0x080c, 0x97d2, 0x2019, 0x19bf, 0x2304,
+	0x9065, 0x0120, 0x2009, 0x0027, 0x080c, 0x9a50, 0x00ce, 0x0804,
+	0x2407, 0xd2bc, 0x0904, 0x23f4, 0x080c, 0x7cd4, 0x6014, 0x9084,
+	0x1984, 0x9085, 0x0010, 0x6016, 0x6027, 0x0004, 0x00d6, 0x2069,
+	0x0140, 0x6804, 0x9084, 0x4000, 0x0110, 0x080c, 0x2997, 0x00de,
+	0x00c6, 0x2061, 0x19b6, 0x6044, 0x080c, 0xbcec, 0x0120, 0x909a,
+	0x0003, 0x1628, 0x0018, 0x909a, 0x00c8, 0x1608, 0x8000, 0x6046,
+	0x603c, 0x00ce, 0x9005, 0x0558, 0x2009, 0x07d0, 0x080c, 0x7ccc,
+	0x9080, 0x0008, 0x2004, 0x9086, 0x0006, 0x1138, 0x6114, 0x918c,
+	0x1984, 0x918d, 0x0012, 0x6116, 0x00d0, 0x6114, 0x918c, 0x1984,
+	0x918d, 0x0016, 0x6116, 0x0098, 0x6027, 0x0004, 0x0080, 0x0036,
+	0x2019, 0x0001, 0x080c, 0x9254, 0x003e, 0x2019, 0x19c5, 0x2304,
+	0x9065, 0x0120, 0x2009, 0x004f, 0x080c, 0x9a50, 0x00ce, 0x001e,
+	0xd19c, 0x0904, 0x247a, 0x7034, 0xd0ac, 0x1904, 0x244f, 0x0016,
+	0x0156, 0x6027, 0x0008, 0x6050, 0x9085, 0x0040, 0x6052, 0x6050,
+	0x9084, 0xfbcf, 0x6052, 0x080c, 0x28d0, 0x9085, 0x2000, 0x6052,
+	0x20a9, 0x0012, 0x1d04, 0x2422, 0x080c, 0x7cfb, 0x1f04, 0x2422,
+	0x6050, 0x9085, 0x0400, 0x9084, 0xdfbf, 0x6052, 0x20a9, 0x0028,
+	0xa001, 0x1f04, 0x2430, 0x6150, 0x9185, 0x1400, 0x6052, 0x20a9,
+	0x0366, 0x1d04, 0x2439, 0x080c, 0x7cfb, 0x6020, 0xd09c, 0x1130,
+	0x015e, 0x6152, 0x001e, 0x6027, 0x0008, 0x04a0, 0x080c, 0x2898,
+	0x1f04, 0x2439, 0x015e, 0x6152, 0x001e, 0x6027, 0x0008, 0x0016,
+	0x6028, 0xc09c, 0x602a, 0x080c, 0x9947, 0x60e3, 0x0000, 0x080c,
+	0xd343, 0x080c, 0xd35e, 0x080c, 0x5117, 0xd0fc, 0x1138, 0x080c,
+	0xbce5, 0x1120, 0x9085, 0x0001, 0x080c, 0x6c9a, 0x9006, 0x080c,
+	0x2987, 0x2009, 0x0002, 0x080c, 0x28d6, 0x00e6, 0x2071, 0x1800,
+	0x7003, 0x0004, 0x080c, 0x0e69, 0x00ee, 0x6027, 0x0008, 0x080c,
+	0x0b94, 0x001e, 0x918c, 0xffd0, 0x6126, 0x00ae, 0x0005, 0x0006,
+	0x0016, 0x0026, 0x0036, 0x00e6, 0x00f6, 0x0126, 0x2091, 0x8000,
+	0x2071, 0x1800, 0x71c8, 0x70ca, 0x9116, 0x0904, 0x24ce, 0x81ff,
+	0x01a0, 0x2009, 0x0000, 0x080c, 0x28d6, 0x2011, 0x8011, 0x2019,
+	0x010e, 0x231c, 0x939e, 0x0007, 0x1118, 0x2019, 0x0001, 0x0010,
+	0x2019, 0x0000, 0x080c, 0x4672, 0x0448, 0x2001, 0x1977, 0x200c,
+	0x81ff, 0x1140, 0x2001, 0x0109, 0x2004, 0xd0b4, 0x0118, 0x2019,
+	0x0003, 0x0008, 0x2118, 0x2011, 0x8012, 0x080c, 0x4672, 0x080c,
+	0x0e69, 0x080c, 0x5117, 0xd0fc, 0x1188, 0x080c, 0xbce5, 0x1170,
+	0x00c6, 0x080c, 0x256a, 0x080c, 0x91bb, 0x2061, 0x0100, 0x2019,
+	0x0028, 0x2009, 0x0002, 0x080c, 0x2dfb, 0x00ce, 0x012e, 0x00fe,
+	0x00ee, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x2028, 0x918c,
+	0x00ff, 0x2130, 0x9094, 0xff00, 0x11f0, 0x2011, 0x1835, 0x2214,
+	0xd2ac, 0x11c8, 0x81ff, 0x01e8, 0x2011, 0x181d, 0x2204, 0x9106,
+	0x1190, 0x2011, 0x181e, 0x2214, 0x9294, 0xff00, 0x9584, 0xff00,
+	0x9206, 0x1148, 0x2011, 0x181e, 0x2214, 0x9294, 0x00ff, 0x9584,
+	0x00ff, 0x9206, 0x1120, 0x2500, 0x080c, 0x7876, 0x0048, 0x9584,
+	0x00ff, 0x9080, 0x2f92, 0x200d, 0x918c, 0xff00, 0x810f, 0x9006,
+	0x0005, 0x9080, 0x2f92, 0x200d, 0x918c, 0x00ff, 0x0005, 0x00d6,
+	0x2069, 0x0140, 0x2001, 0x1816, 0x2003, 0x00ef, 0x20a9, 0x0010,
+	0x9006, 0x6852, 0x6856, 0x1f04, 0x251a, 0x00de, 0x0005, 0x0006,
+	0x00d6, 0x0026, 0x2069, 0x0140, 0x2001, 0x1816, 0x2102, 0x8114,
+	0x8214, 0x8214, 0x8214, 0x20a9, 0x0010, 0x6853, 0x0000, 0x9006,
+	0x82ff, 0x1128, 0x9184, 0x000f, 0x9080, 0xd74a, 0x2005, 0x6856,
+	0x8211, 0x1f04, 0x252f, 0x002e, 0x00de, 0x000e, 0x0005, 0x00c6,
+	0x2061, 0x1800, 0x6030, 0x0110, 0xc09d, 0x0008, 0xc09c, 0x6032,
+	0x00ce, 0x0005, 0x0156, 0x00d6, 0x0026, 0x0016, 0x0006, 0x2069,
+	0x0140, 0x6980, 0x9116, 0x0180, 0x9112, 0x1230, 0x8212, 0x8210,
+	0x22a8, 0x2001, 0x0402, 0x0018, 0x22a8, 0x2001, 0x0404, 0x680e,
+	0x1f04, 0x255f, 0x680f, 0x0000, 0x000e, 0x001e, 0x002e, 0x00de,
+	0x015e, 0x0005, 0x080c, 0x5113, 0xd0c4, 0x0150, 0xd0a4, 0x0140,
+	0x9006, 0x0046, 0x2020, 0x2009, 0x002e, 0x080c, 0xcfe6, 0x004e,
+	0x0005, 0x00f6, 0x0016, 0x0026, 0x2079, 0x0140, 0x78c4, 0xd0dc,
+	0x0904, 0x25d6, 0x080c, 0x2835, 0x0660, 0x9084, 0x0700, 0x908e,
+	0x0600, 0x1120, 0x2011, 0x4000, 0x900e, 0x0458, 0x908e, 0x0500,
+	0x1120, 0x2011, 0x8000, 0x900e, 0x0420, 0x908e, 0x0400, 0x1120,
+	0x9016, 0x2009, 0x0001, 0x00e8, 0x908e, 0x0300, 0x1120, 0x9016,
+	0x2009, 0x0002, 0x00b0, 0x908e, 0x0200, 0x1120, 0x9016, 0x2009,
+	0x0004, 0x0078, 0x908e, 0x0100, 0x1548, 0x9016, 0x2009, 0x0008,
+	0x0040, 0x9084, 0x0700, 0x908e, 0x0300, 0x1500, 0x2011, 0x0030,
+	0x0058, 0x2300, 0x9080, 0x0020, 0x2018, 0x080c, 0x7e7f, 0x928c,
+	0xff00, 0x0110, 0x2011, 0x00ff, 0x2200, 0x8007, 0x9085, 0x004c,
+	0x78c2, 0x2009, 0x0138, 0x220a, 0x080c, 0x6c53, 0x1118, 0x2009,
+	0x193e, 0x220a, 0x002e, 0x001e, 0x00fe, 0x0005, 0x78c3, 0x0000,
+	0x0cc8, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x2001,
+	0x0170, 0x200c, 0x8000, 0x2014, 0x9184, 0x0003, 0x0110, 0x080c,
+	0x0db2, 0x002e, 0x001e, 0x000e, 0x012e, 0x0005, 0x2001, 0x0171,
+	0x2004, 0xd0dc, 0x0168, 0x2001, 0x0170, 0x200c, 0x918c, 0x00ff,
+	0x918e, 0x004c, 0x1128, 0x200c, 0x918c, 0xff00, 0x810f, 0x0005,
+	0x900e, 0x2001, 0x0227, 0x2004, 0x8007, 0x9084, 0x00ff, 0x8004,
+	0x9108, 0x2001, 0x0226, 0x2004, 0x8007, 0x9084, 0x00ff, 0x8004,
+	0x9108, 0x0005, 0x0018, 0x000c, 0x0018, 0x0020, 0x1000, 0x0800,
+	0x1000, 0x1800, 0x0156, 0x0006, 0x0016, 0x0026, 0x00e6, 0x2001,
+	0x195f, 0x2004, 0x908a, 0x0007, 0x1a0c, 0x0db2, 0x0033, 0x00ee,
+	0x002e, 0x001e, 0x000e, 0x015e, 0x0005, 0x2634, 0x2652, 0x2676,
+	0x2678, 0x26a1, 0x26a3, 0x26a5, 0x2001, 0x0001, 0x080c, 0x247f,
+	0x080c, 0x2893, 0x2001, 0x1961, 0x2003, 0x0000, 0x7828, 0x9084,
+	0xe1d7, 0x782a, 0x9006, 0x20a9, 0x0009, 0x080c, 0x2851, 0x2001,
+	0x195f, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x26a6, 0x080c,
+	0x7cd9, 0x0005, 0x2009, 0x1964, 0x200b, 0x0000, 0x2001, 0x1969,
+	0x2003, 0x0036, 0x2001, 0x1968, 0x2003, 0x002a, 0x2001, 0x1961,
+	0x2003, 0x0001, 0x9006, 0x080c, 0x2803, 0x2001, 0xffff, 0x20a9,
+	0x0009, 0x080c, 0x2851, 0x2001, 0x195f, 0x2003, 0x0006, 0x2009,
+	0x001e, 0x2011, 0x26a6, 0x080c, 0x7cd9, 0x0005, 0x080c, 0x0db2,
+	0x2001, 0x1969, 0x2003, 0x0036, 0x2001, 0x1961, 0x2003, 0x0003,
+	0x7a38, 0x9294, 0x0005, 0x9296, 0x0004, 0x0110, 0x9006, 0x0010,
+	0x2001, 0x0001, 0x080c, 0x2803, 0x2001, 0x1965, 0x2003, 0x0000,
+	0x2001, 0xffff, 0x20a9, 0x0009, 0x080c, 0x2851, 0x2001, 0x195f,
+	0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x26a6, 0x080c, 0x7cd9,
+	0x0005, 0x080c, 0x0db2, 0x080c, 0x0db2, 0x0005, 0x0006, 0x0016,
+	0x0026, 0x00e6, 0x00f6, 0x0156, 0x0126, 0x2091, 0x8000, 0x2079,
+	0x0100, 0x2001, 0x1961, 0x2004, 0x908a, 0x0007, 0x1a0c, 0x0db2,
+	0x0043, 0x012e, 0x015e, 0x00fe, 0x00ee, 0x002e, 0x001e, 0x000e,
+	0x0005, 0x26c8, 0x26e8, 0x2728, 0x2758, 0x277c, 0x278c, 0x278e,
+	0x080c, 0x2845, 0x11b0, 0x7850, 0x9084, 0xefff, 0x7852, 0x2009,
+	0x1967, 0x2104, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0004, 0x0110,
+	0xc08d, 0x0008, 0xc085, 0x200a, 0x2001, 0x195f, 0x2003, 0x0001,
+	0x0030, 0x080c, 0x27b2, 0x2001, 0xffff, 0x080c, 0x2643, 0x0005,
+	0x080c, 0x2790, 0x05e0, 0x2009, 0x1968, 0x2104, 0x8001, 0x200a,
+	0x080c, 0x2845, 0x1178, 0x7850, 0x9084, 0xefff, 0x7852, 0x7a38,
+	0x9294, 0x0005, 0x9296, 0x0005, 0x0518, 0x2009, 0x1967, 0x2104,
+	0xc085, 0x200a, 0x2009, 0x1964, 0x2104, 0x8000, 0x200a, 0x9086,
+	0x0005, 0x0118, 0x080c, 0x2798, 0x00c0, 0x200b, 0x0000, 0x7a38,
+	0x9294, 0x0006, 0x9296, 0x0004, 0x0110, 0x9006, 0x0010, 0x2001,
+	0x0001, 0x080c, 0x2820, 0x2001, 0x1961, 0x2003, 0x0002, 0x0028,
+	0x2001, 0x195f, 0x2003, 0x0003, 0x0010, 0x080c, 0x2665, 0x0005,
+	0x080c, 0x2790, 0x0560, 0x2009, 0x1968, 0x2104, 0x8001, 0x200a,
+	0x080c, 0x2845, 0x1168, 0x7850, 0x9084, 0xefff, 0x7852, 0x2001,
+	0x195f, 0x2003, 0x0003, 0x2001, 0x1960, 0x2003, 0x0000, 0x00b8,
+	0x2009, 0x1968, 0x2104, 0x9005, 0x1118, 0x080c, 0x27d5, 0x0010,
+	0x080c, 0x27a5, 0x080c, 0x2798, 0x2009, 0x1964, 0x200b, 0x0000,
+	0x2001, 0x1961, 0x2003, 0x0001, 0x080c, 0x2665, 0x0000, 0x0005,
+	0x04b9, 0x0508, 0x080c, 0x2845, 0x11b8, 0x7850, 0x9084, 0xefff,
+	0x7852, 0x2009, 0x1965, 0x2104, 0x8000, 0x200a, 0x9086, 0x0007,
+	0x0108, 0x0078, 0x2001, 0x196a, 0x2003, 0x000a, 0x2009, 0x1967,
+	0x2104, 0xc0fd, 0x200a, 0x0038, 0x0419, 0x2001, 0x1961, 0x2003,
+	0x0004, 0x080c, 0x2690, 0x0005, 0x0099, 0x0168, 0x080c, 0x2845,
+	0x1138, 0x7850, 0x9084, 0xefff, 0x7852, 0x080c, 0x267c, 0x0018,
+	0x0079, 0x080c, 0x2690, 0x0005, 0x080c, 0x0db2, 0x080c, 0x0db2,
+	0x2009, 0x1969, 0x2104, 0x8001, 0x200a, 0x090c, 0x27f1, 0x0005,
+	0x7a38, 0x9294, 0x0005, 0x9296, 0x0005, 0x0110, 0x9006, 0x0010,
+	0x2001, 0x0001, 0x080c, 0x2820, 0x0005, 0x7a38, 0x9294, 0x0006,
+	0x9296, 0x0006, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c,
+	0x2803, 0x0005, 0x2009, 0x1964, 0x2104, 0x8000, 0x200a, 0x9086,
+	0x0005, 0x0108, 0x0068, 0x200b, 0x0000, 0x7a38, 0x9294, 0x0006,
+	0x9296, 0x0006, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x04d9,
+	0x7a38, 0x9294, 0x0005, 0x9296, 0x0005, 0x0110, 0x9006, 0x0010,
+	0x2001, 0x0001, 0x080c, 0x2820, 0x0005, 0x0086, 0x2001, 0x1967,
+	0x2004, 0x9084, 0x7fff, 0x090c, 0x0db2, 0x2009, 0x1966, 0x2144,
+	0x8846, 0x280a, 0x9844, 0x0dd8, 0xd08c, 0x1120, 0xd084, 0x1120,
+	0x080c, 0x0db2, 0x9006, 0x0010, 0x2001, 0x0001, 0x00a1, 0x008e,
+	0x0005, 0x0006, 0x0156, 0x2001, 0x195f, 0x20a9, 0x0009, 0x2003,
+	0x0000, 0x8000, 0x1f04, 0x27f7, 0x2001, 0x1966, 0x2003, 0x8000,
+	0x015e, 0x000e, 0x0005, 0x00f6, 0x2079, 0x0100, 0x9085, 0x0000,
+	0x0158, 0x7838, 0x9084, 0xfff9, 0x9085, 0x0004, 0x783a, 0x2009,
+	0x196c, 0x210c, 0x795a, 0x0050, 0x7838, 0x9084, 0xfffb, 0x9085,
+	0x0006, 0x783a, 0x2009, 0x196d, 0x210c, 0x795a, 0x00fe, 0x0005,
+	0x00f6, 0x2079, 0x0100, 0x9085, 0x0000, 0x0138, 0x7838, 0x9084,
+	0xfffa, 0x9085, 0x0004, 0x783a, 0x0030, 0x7838, 0x9084, 0xfffb,
+	0x9085, 0x0005, 0x783a, 0x00fe, 0x0005, 0x0006, 0x2001, 0x0100,
+	0x2004, 0x9082, 0x0007, 0x000e, 0x0005, 0x0006, 0x2001, 0x0100,
+	0x2004, 0x9082, 0x0009, 0x000e, 0x0005, 0x0156, 0x20a9, 0x0064,
+	0x7820, 0x080c, 0x28d0, 0xd09c, 0x1110, 0x1f04, 0x2848, 0x015e,
+	0x0005, 0x0126, 0x0016, 0x0006, 0x2091, 0x8000, 0x7850, 0x9085,
+	0x0040, 0x7852, 0x7850, 0x9084, 0xfbcf, 0x7852, 0x080c, 0x28d0,
+	0x9085, 0x2000, 0x7852, 0x000e, 0x2008, 0x9186, 0x0000, 0x1118,
+	0x783b, 0x0007, 0x0090, 0x9186, 0x0001, 0x1118, 0x783b, 0x0006,
+	0x0060, 0x9186, 0x0002, 0x1118, 0x783b, 0x0005, 0x0030, 0x9186,
+	0x0003, 0x1118, 0x783b, 0x0004, 0x0000, 0x0006, 0x1d04, 0x287e,
+	0x080c, 0x7cfb, 0x1f04, 0x287e, 0x7850, 0x9085, 0x0400, 0x9084,
+	0xdfbf, 0x7852, 0x080c, 0x28d0, 0x9085, 0x1000, 0x7852, 0x000e,
+	0x001e, 0x012e, 0x0005, 0x7850, 0x9084, 0xffcf, 0x7852, 0x0005,
+	0x0006, 0x0156, 0x00f6, 0x2079, 0x0100, 0x20a9, 0x000a, 0x7854,
+	0xd0ac, 0x1130, 0x7820, 0xd0e4, 0x1140, 0x1f04, 0x28a2, 0x0028,
+	0x7854, 0xd08c, 0x1110, 0x1f04, 0x28a8, 0x00fe, 0x015e, 0x000e,
+	0x0005, 0x1d04, 0x28b1, 0x080c, 0x7cfb, 0x1f04, 0x28b1, 0x0005,
+	0x0006, 0x2001, 0x196b, 0x2004, 0x9086, 0x0000, 0x000e, 0x0005,
+	0x0006, 0x2001, 0x196b, 0x2004, 0x9086, 0x0001, 0x000e, 0x0005,
+	0x0006, 0x2001, 0x196b, 0x2004, 0x9086, 0x0002, 0x000e, 0x0005,
+	0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0x0005, 0x0006, 0x2001,
+	0x1977, 0x2102, 0x000e, 0x0005, 0x2009, 0x0171, 0x2104, 0xd0dc,
+	0x0140, 0x2009, 0x0170, 0x2104, 0x200b, 0x0080, 0xa001, 0xa001,
+	0x200a, 0x0005, 0x0036, 0x0046, 0x2001, 0x0141, 0x200c, 0x918c,
+	0xff00, 0x9186, 0x2000, 0x0118, 0x9186, 0x0100, 0x1588, 0x2009,
+	0x017f, 0x200b, 0x00a2, 0x2019, 0x0160, 0x2324, 0x2011, 0x0003,
+	0x2009, 0x0169, 0x2104, 0x9084, 0x0007, 0x210c, 0x918c, 0x0007,
+	0x910e, 0x1db0, 0x9086, 0x0003, 0x11b8, 0x2304, 0x9402, 0x02a0,
+	0x1d60, 0x8211, 0x1d68, 0x84ff, 0x0170, 0x2001, 0x0141, 0x200c,
+	0x918c, 0xff00, 0x9186, 0x0100, 0x0130, 0x2009, 0x180c, 0x2104,
+	0xc0dd, 0x200a, 0x0008, 0x0419, 0x2001, 0x017f, 0x2003, 0x0000,
+	0x004e, 0x003e, 0x0005, 0x2001, 0x180c, 0x2004, 0xd0dc, 0x01b0,
+	0x2001, 0x0160, 0x2004, 0x9005, 0x0140, 0x2001, 0x0141, 0x2004,
+	0x9084, 0xff00, 0x9086, 0x0100, 0x1148, 0x0126, 0x2091, 0x8000,
+	0x0016, 0x0026, 0x0021, 0x002e, 0x001e, 0x012e, 0x0005, 0x00c6,
+	0x2061, 0x0100, 0x6014, 0x0006, 0x2001, 0x0161, 0x2003, 0x0000,
+	0x6017, 0x0018, 0xa001, 0xa001, 0x602f, 0x0008, 0x6104, 0x918e,
+	0x0010, 0x6106, 0x918e, 0x0010, 0x6106, 0x6017, 0x0040, 0x04b9,
+	0x001e, 0x9184, 0x0003, 0x01e0, 0x0036, 0x0016, 0x2019, 0x0141,
+	0x6124, 0x918c, 0x0028, 0x1120, 0x2304, 0x9084, 0x2800, 0x0dc0,
+	0x001e, 0x919c, 0xffe4, 0x9184, 0x0001, 0x0118, 0x9385, 0x0009,
+	0x6016, 0x9184, 0x0002, 0x0118, 0x9385, 0x0012, 0x6016, 0x003e,
+	0x2001, 0x180c, 0x200c, 0xc1dc, 0x2102, 0x00ce, 0x0005, 0x0016,
+	0x0026, 0x080c, 0x6c6d, 0x0108, 0xc0bc, 0x2009, 0x0140, 0x2114,
+	0x9294, 0x0001, 0x9215, 0x220a, 0x002e, 0x001e, 0x0005, 0x0016,
+	0x0026, 0x2009, 0x0140, 0x2114, 0x9294, 0x0001, 0x9285, 0x1000,
+	0x200a, 0x220a, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026, 0x2009,
+	0x0140, 0x2114, 0x9294, 0x0001, 0x9215, 0x220a, 0x002e, 0x001e,
+	0x0005, 0x0006, 0x0016, 0x2009, 0x0140, 0x2104, 0x1110, 0xc0bc,
+	0x0008, 0xc0bd, 0x200a, 0x001e, 0x000e, 0x0005, 0x2c2a, 0x2c2a,
+	0x2a4e, 0x2a4e, 0x2a5a, 0x2a5a, 0x2a66, 0x2a66, 0x2a74, 0x2a74,
+	0x2a80, 0x2a80, 0x2a8e, 0x2a8e, 0x2a9c, 0x2a9c, 0x2aae, 0x2aae,
+	0x2aba, 0x2aba, 0x2ac8, 0x2ac8, 0x2ae6, 0x2ae6, 0x2b06, 0x2b06,
+	0x2ad6, 0x2ad6, 0x2af6, 0x2af6, 0x2b14, 0x2b14, 0x2aac, 0x2aac,
+	0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac,
+	0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac,
+	0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac,
+	0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2b26, 0x2b26,
+	0x2b32, 0x2b32, 0x2b40, 0x2b40, 0x2b4e, 0x2b4e, 0x2b5e, 0x2b5e,
+	0x2b6c, 0x2b6c, 0x2b7c, 0x2b7c, 0x2b8c, 0x2b8c, 0x2b9e, 0x2b9e,
+	0x2bac, 0x2bac, 0x2bbc, 0x2bbc, 0x2bde, 0x2bde, 0x2c00, 0x2c00,
+	0x2bcc, 0x2bcc, 0x2bef, 0x2bef, 0x2c0f, 0x2c0f, 0x2aac, 0x2aac,
+	0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac,
+	0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac,
+	0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac,
+	0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac,
+	0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac,
+	0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x2aac, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2184,
+	0x0804, 0x2c22, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x1f9f, 0x0804, 0x2c22, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f9f,
+	0x080c, 0x2184, 0x0804, 0x2c22, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1fd7, 0x0804, 0x2c22,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x2184, 0x080c, 0x1fd7, 0x0804, 0x2c22, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f9f,
+	0x080c, 0x1fd7, 0x0804, 0x2c22, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f9f, 0x080c, 0x2184,
+	0x080c, 0x1fd7, 0x0804, 0x2c22, 0xa001, 0x0cf0, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x12d6,
+	0x0804, 0x2c22, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2184, 0x080c, 0x12d6, 0x0804, 0x2c22,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x1f9f, 0x080c, 0x12d6, 0x0804, 0x2c22, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2184,
+	0x080c, 0x12d6, 0x080c, 0x1fd7, 0x0804, 0x2c22, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f9f,
+	0x080c, 0x2184, 0x080c, 0x12d6, 0x0804, 0x2c22, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f9f,
+	0x080c, 0x12d6, 0x080c, 0x1fd7, 0x0804, 0x2c22, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x12d6,
+	0x080c, 0x1fd7, 0x0804, 0x2c22, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f9f, 0x080c, 0x2184,
+	0x080c, 0x12d6, 0x080c, 0x1fd7, 0x0804, 0x2c22, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x25d9,
+	0x0804, 0x2c22, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x25d9, 0x080c, 0x2184, 0x0804, 0x2c22,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x25d9, 0x080c, 0x1f9f, 0x0804, 0x2c22, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x25d9,
+	0x080c, 0x1f9f, 0x080c, 0x2184, 0x0804, 0x2c22, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x25d9,
+	0x080c, 0x1fd7, 0x0804, 0x2c22, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x25d9, 0x080c, 0x2184,
+	0x080c, 0x1fd7, 0x0804, 0x2c22, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x25d9, 0x080c, 0x1f9f,
+	0x080c, 0x1fd7, 0x0804, 0x2c22, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x25d9, 0x080c, 0x1f9f,
+	0x080c, 0x2184, 0x080c, 0x1fd7, 0x0804, 0x2c22, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x25d9,
+	0x080c, 0x12d6, 0x0804, 0x2c22, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x25d9, 0x080c, 0x2184,
+	0x080c, 0x12d6, 0x0804, 0x2c22, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x25d9, 0x080c, 0x1f9f,
+	0x080c, 0x12d6, 0x0804, 0x2c22, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x25d9, 0x080c, 0x2184,
+	0x080c, 0x12d6, 0x080c, 0x1fd7, 0x0804, 0x2c22, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x25d9,
+	0x080c, 0x1f9f, 0x080c, 0x2184, 0x080c, 0x12d6, 0x0498, 0x0106,
+	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
+	0x25d9, 0x080c, 0x1f9f, 0x080c, 0x12d6, 0x080c, 0x1fd7, 0x0410,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x25d9, 0x080c, 0x12d6, 0x080c, 0x1fd7, 0x0098, 0x0106,
+	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
+	0x25d9, 0x080c, 0x1f9f, 0x080c, 0x2184, 0x080c, 0x12d6, 0x080c,
+	0x1fd7, 0x0000, 0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x012e,
+	0x000e, 0x010e, 0x000d, 0x00b6, 0x00c6, 0x0026, 0x0046, 0x9026,
+	0x080c, 0x6262, 0x1904, 0x2d17, 0x72d4, 0x2001, 0x194d, 0x2004,
+	0x9005, 0x1110, 0xd29c, 0x0148, 0xd284, 0x1138, 0xd2bc, 0x1904,
+	0x2d17, 0x080c, 0x2d1c, 0x0804, 0x2d17, 0xd2cc, 0x1904, 0x2d17,
+	0x080c, 0x6c53, 0x1120, 0x70a7, 0xffff, 0x0804, 0x2d17, 0xd294,
+	0x0120, 0x70a7, 0xffff, 0x0804, 0x2d17, 0x080c, 0x2f81, 0x0160,
+	0x080c, 0xbcec, 0x0128, 0x2001, 0x1816, 0x203c, 0x0804, 0x2cb5,
+	0x70a7, 0xffff, 0x0804, 0x2d17, 0x2001, 0x1816, 0x203c, 0x728c,
+	0xd284, 0x0904, 0x2cb5, 0xd28c, 0x1904, 0x2cb5, 0x0036, 0x73a4,
+	0x938e, 0xffff, 0x1110, 0x2019, 0x0001, 0x8314, 0x92e0, 0x1c80,
+	0x2c04, 0x938c, 0x0001, 0x0120, 0x9084, 0xff00, 0x8007, 0x0010,
+	0x9084, 0x00ff, 0x970e, 0x0540, 0x908e, 0x0000, 0x0528, 0x908e,
+	0x00ff, 0x1150, 0x7230, 0xd284, 0x1518, 0x728c, 0xc28d, 0x728e,
+	0x70a7, 0xffff, 0x003e, 0x0408, 0x900e, 0x080c, 0x24d6, 0x080c,
+	0x5f1e, 0x11a0, 0x080c, 0x62a4, 0x1150, 0x7030, 0xd08c, 0x0118,
+	0xb800, 0xd0bc, 0x0120, 0x080c, 0x2d35, 0x0140, 0x0028, 0x080c,
+	0x2e71, 0x080c, 0x2d61, 0x0110, 0x8318, 0x0838, 0x73a6, 0x0010,
+	0x70a7, 0xffff, 0x003e, 0x0804, 0x2d17, 0x9780, 0x2f92, 0x203d,
+	0x97bc, 0xff00, 0x873f, 0x2041, 0x007e, 0x70a4, 0x9096, 0xffff,
+	0x1118, 0x900e, 0x28a8, 0x0050, 0x9812, 0x0220, 0x2008, 0x9802,
+	0x20a8, 0x0020, 0x70a7, 0xffff, 0x0804, 0x2d17, 0x2700, 0x0156,
+	0x0016, 0x9106, 0x05c8, 0xc484, 0x080c, 0x5f7e, 0x0138, 0x080c,
+	0xbcec, 0x1590, 0x080c, 0x5f1e, 0x15b8, 0x0008, 0xc485, 0x080c,
+	0x62a4, 0x1130, 0x7030, 0xd08c, 0x01f8, 0xb800, 0xd0bc, 0x11e0,
+	0x728c, 0xd28c, 0x0180, 0x080c, 0x62a4, 0x9082, 0x0006, 0x02e0,
+	0xd484, 0x1118, 0x080c, 0x5f42, 0x0028, 0x080c, 0x2efd, 0x01a0,
+	0x080c, 0x2f28, 0x0088, 0x080c, 0x2e71, 0x080c, 0xbcec, 0x1160,
+	0x080c, 0x2d61, 0x0188, 0x0040, 0x080c, 0xbcec, 0x1118, 0x080c,
+	0x2efd, 0x0110, 0x0451, 0x0140, 0x001e, 0x8108, 0x015e, 0x1f04,
+	0x2cce, 0x70a7, 0xffff, 0x0018, 0x001e, 0x015e, 0x71a6, 0x004e,
+	0x002e, 0x00ce, 0x00be, 0x0005, 0x00c6, 0x0016, 0x70a7, 0x0001,
+	0x2009, 0x007e, 0x080c, 0x5f1e, 0x1168, 0xb813, 0x00ff, 0xb817,
+	0xfffe, 0x080c, 0x2e71, 0x04a9, 0x0128, 0x70d4, 0xc0bd, 0x70d6,
+	0x080c, 0xba40, 0x001e, 0x00ce, 0x0005, 0x0016, 0x0076, 0x00d6,
+	0x00c6, 0x2001, 0x1858, 0x2004, 0x9084, 0x00ff, 0xb842, 0x080c,
+	0x9a23, 0x01d0, 0x2b00, 0x6012, 0x080c, 0xba69, 0x6023, 0x0001,
+	0x9006, 0x080c, 0x5ebb, 0x2001, 0x0000, 0x080c, 0x5ecf, 0x0126,
+	0x2091, 0x8000, 0x70a0, 0x8000, 0x70a2, 0x012e, 0x2009, 0x0004,
+	0x080c, 0x9a50, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e,
+	0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001, 0x1858, 0x2004,
+	0x9084, 0x00ff, 0xb842, 0x080c, 0x9a23, 0x0548, 0x2b00, 0x6012,
+	0xb800, 0xc0c4, 0xb802, 0xb8a0, 0x9086, 0x007e, 0x0140, 0xb804,
+	0x9084, 0x00ff, 0x9086, 0x0006, 0x1110, 0x080c, 0x2e30, 0x080c,
+	0xba69, 0x6023, 0x0001, 0x9006, 0x080c, 0x5ebb, 0x2001, 0x0002,
+	0x080c, 0x5ecf, 0x0126, 0x2091, 0x8000, 0x70a0, 0x8000, 0x70a2,
+	0x012e, 0x2009, 0x0002, 0x080c, 0x9a50, 0x9085, 0x0001, 0x00ce,
+	0x00de, 0x007e, 0x001e, 0x0005, 0x00b6, 0x00c6, 0x0026, 0x2009,
+	0x0080, 0x080c, 0x5f1e, 0x1140, 0xb813, 0x00ff, 0xb817, 0xfffc,
+	0x0039, 0x0110, 0x70db, 0xffff, 0x002e, 0x00ce, 0x00be, 0x0005,
+	0x0016, 0x0076, 0x00d6, 0x00c6, 0x080c, 0x9980, 0x01d0, 0x2b00,
+	0x6012, 0x080c, 0xba69, 0x6023, 0x0001, 0x9006, 0x080c, 0x5ebb,
+	0x2001, 0x0002, 0x080c, 0x5ecf, 0x0126, 0x2091, 0x8000, 0x70dc,
+	0x8000, 0x70de, 0x012e, 0x2009, 0x0002, 0x080c, 0x9a50, 0x9085,
+	0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00c6, 0x00d6,
+	0x0126, 0x2091, 0x8000, 0x2009, 0x007f, 0x080c, 0x5f1e, 0x11b8,
+	0xb813, 0x00ff, 0xb817, 0xfffd, 0xb8bf, 0x0004, 0x080c, 0x9980,
+	0x0170, 0x2b00, 0x6012, 0x6316, 0x6023, 0x0001, 0x620a, 0x080c,
+	0xba69, 0x2009, 0x0022, 0x080c, 0x9a50, 0x9085, 0x0001, 0x012e,
+	0x00de, 0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0066, 0x0036, 0x0026,
+	0x00b6, 0x21f0, 0x080c, 0x818b, 0x080c, 0x811a, 0x080c, 0x9819,
+	0x080c, 0xa893, 0x3e08, 0x2130, 0x81ff, 0x0120, 0x20a9, 0x007e,
+	0x900e, 0x0018, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x5f7e,
+	0x1140, 0x9686, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x1110, 0x080c,
+	0x5a3b, 0x001e, 0x8108, 0x1f04, 0x2e15, 0x9686, 0x0001, 0x190c,
+	0x2f55, 0x00be, 0x002e, 0x003e, 0x006e, 0x00ce, 0x00ee, 0x0005,
+	0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x00b6, 0x6210, 0x2258,
+	0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c, 0x8180, 0x0076, 0x2039,
+	0x0000, 0x080c, 0x8078, 0x2c08, 0x080c, 0xcd62, 0x007e, 0x001e,
+	0xba10, 0xbb14, 0x080c, 0x5a3b, 0xba12, 0xbb16, 0x00be, 0x001e,
+	0x002e, 0x003e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x00b6,
+	0x6010, 0x2058, 0xb8a0, 0x00be, 0x9086, 0x0080, 0x0150, 0x2071,
+	0x1800, 0x70a0, 0x9005, 0x0110, 0x8001, 0x70a2, 0x000e, 0x00ee,
+	0x0005, 0x2071, 0x1800, 0x70dc, 0x9005, 0x0dc0, 0x8001, 0x70de,
+	0x0ca8, 0xb800, 0xc08c, 0xb802, 0x0005, 0x00f6, 0x00e6, 0x00c6,
+	0x00b6, 0x0036, 0x0026, 0x0016, 0x0156, 0x2178, 0x81ff, 0x1118,
+	0x20a9, 0x0001, 0x0088, 0x080c, 0x5113, 0xd0c4, 0x0150, 0xd0a4,
+	0x0140, 0x9006, 0x0046, 0x2020, 0x2009, 0x002d, 0x080c, 0xcfe6,
+	0x004e, 0x20a9, 0x0800, 0x9016, 0x0026, 0x928e, 0x007e, 0x0904,
+	0x2edd, 0x928e, 0x007f, 0x0904, 0x2edd, 0x928e, 0x0080, 0x05e8,
+	0x9288, 0x1000, 0x210c, 0x81ff, 0x05c0, 0x8fff, 0x1148, 0x2001,
+	0x195d, 0x0006, 0x2003, 0x0001, 0x04e9, 0x000e, 0x2003, 0x0000,
+	0x00b6, 0x00c6, 0x2158, 0x2001, 0x0001, 0x080c, 0x626e, 0x00ce,
+	0x00be, 0x2019, 0x0029, 0x080c, 0x8180, 0x0076, 0x2039, 0x0000,
+	0x080c, 0x8078, 0x00b6, 0x00c6, 0x0026, 0x2158, 0xba04, 0x9294,
+	0x00ff, 0x9286, 0x0006, 0x1118, 0xb807, 0x0404, 0x0028, 0x2001,
+	0x0004, 0x8007, 0x9215, 0xba06, 0x002e, 0x00ce, 0x00be, 0x0016,
+	0x2c08, 0x080c, 0xcd62, 0x001e, 0x007e, 0x002e, 0x8210, 0x1f04,
+	0x2e94, 0x015e, 0x001e, 0x002e, 0x003e, 0x00be, 0x00ce, 0x00ee,
+	0x00fe, 0x0005, 0x0046, 0x0026, 0x0016, 0x080c, 0x5113, 0xd0c4,
+	0x0140, 0xd0a4, 0x0130, 0x9006, 0x2220, 0x2009, 0x0029, 0x080c,
+	0xcfe6, 0x001e, 0x002e, 0x004e, 0x0005, 0x0016, 0x0026, 0x0036,
+	0x00c6, 0x728c, 0x82ff, 0x01e8, 0x080c, 0x629c, 0x11d0, 0x2100,
+	0x080c, 0x2509, 0x81ff, 0x01b8, 0x2019, 0x0001, 0x8314, 0x92e0,
+	0x1c80, 0x2c04, 0xd384, 0x0120, 0x9084, 0xff00, 0x8007, 0x0010,
+	0x9084, 0x00ff, 0x9116, 0x0138, 0x9096, 0x00ff, 0x0110, 0x8318,
+	0x0c68, 0x9085, 0x0001, 0x00ce, 0x003e, 0x002e, 0x001e, 0x0005,
+	0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x0036, 0x2019, 0x0029,
+	0x00a9, 0x003e, 0x9180, 0x1000, 0x2004, 0x9065, 0x0158, 0x0016,
+	0x00c6, 0x2061, 0x1a73, 0x001e, 0x6112, 0x080c, 0x2e30, 0x001e,
+	0x080c, 0x5f42, 0x012e, 0x00ce, 0x001e, 0x0005, 0x0016, 0x0026,
+	0x2110, 0x080c, 0x94b5, 0x080c, 0xd29b, 0x002e, 0x001e, 0x0005,
+	0x2001, 0x1835, 0x2004, 0xd0cc, 0x0005, 0x00c6, 0x00b6, 0x080c,
+	0x6c53, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782, 0x080c,
+	0x6c53, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x9180, 0x1000,
+	0x2004, 0x905d, 0x0130, 0x86ff, 0x0110, 0xb800, 0xd0bc, 0x090c,
+	0x5f42, 0x8108, 0x1f04, 0x2f66, 0x2061, 0x1800, 0x6077, 0x0000,
+	0x6078, 0x9084, 0x00ff, 0x607a, 0x60ab, 0x0000, 0x00be, 0x00ce,
+	0x0005, 0x2001, 0x1875, 0x2004, 0xd0bc, 0x0005, 0x2011, 0x1854,
+	0x2214, 0xd2ec, 0x0005, 0x0026, 0x2011, 0x1873, 0x2214, 0xd2dc,
+	0x002e, 0x0005, 0x7eef, 0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0,
+	0x80dc, 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2,
+	0x80d1, 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7,
+	0x80c6, 0x77c5, 0x76c3, 0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5,
+	0x73b4, 0x72b3, 0x80b2, 0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab,
+	0x6faa, 0x6ea9, 0x80a7, 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e,
+	0x689d, 0x809b, 0x8098, 0x6797, 0x6690, 0x658f, 0x6488, 0x6384,
+	0x6282, 0x8081, 0x8080, 0x617c, 0x607a, 0x8079, 0x5f76, 0x8075,
+	0x8074, 0x8073, 0x8072, 0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b,
+	0x5c6a, 0x5b69, 0x8067, 0x5a66, 0x5965, 0x5863, 0x575c, 0x565a,
+	0x5559, 0x8056, 0x8055, 0x5454, 0x5353, 0x5252, 0x5151, 0x504e,
+	0x4f4d, 0x804c, 0x804b, 0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045,
+	0x8043, 0x803c, 0x803a, 0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33,
+	0x4932, 0x4831, 0x802e, 0x472d, 0x462c, 0x452b, 0x442a, 0x4329,
+	0x4227, 0x8026, 0x8025, 0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b,
+	0x3c18, 0x8017, 0x8010, 0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001,
+	0x8000, 0x8000, 0x3800, 0x3700, 0x3600, 0x8000, 0x3500, 0x8000,
+	0x8000, 0x8000, 0x3400, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x3300, 0x3200, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x3100, 0x3000, 0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00,
+	0x2d00, 0x2c00, 0x8000, 0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00,
+	0x2900, 0x2800, 0x8000, 0x2700, 0x2600, 0x2500, 0x2400, 0x2300,
+	0x2200, 0x8000, 0x8000, 0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00,
+	0x1c00, 0x8000, 0x8000, 0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x1800, 0x8000, 0x1700,
+	0x1600, 0x1500, 0x8000, 0x1400, 0x1300, 0x1200, 0x1100, 0x1000,
+	0x0f00, 0x8000, 0x8000, 0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00,
+	0x0900, 0x8000, 0x8000, 0x0800, 0x0700, 0x8000, 0x0600, 0x8000,
+	0x8000, 0x8000, 0x0500, 0x0400, 0x0300, 0x8000, 0x0200, 0x8000,
+	0x8000, 0x8000, 0x0100, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x0000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x2071, 0x1894, 0x7003, 0x0002, 0x9006, 0x7016,
+	0x701a, 0x704a, 0x704e, 0x700e, 0x7042, 0x7046, 0x703b, 0x18b0,
+	0x703f, 0x18b0, 0x7007, 0x0001, 0x080c, 0x0fee, 0x090c, 0x0db2,
+	0x2900, 0x706a, 0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x080c, 0x0fee,
+	0x090c, 0x0db2, 0x2900, 0x706e, 0xa867, 0x0002, 0xa8ab, 0xdcb0,
+	0x0005, 0x2071, 0x1894, 0x7004, 0x0002, 0x30c1, 0x30c2, 0x30d5,
+	0x30e9, 0x0005, 0x1004, 0x30d2, 0x0e04, 0x30d2, 0x2079, 0x0000,
+	0x0126, 0x2091, 0x8000, 0x700c, 0x9005, 0x1128, 0x700f, 0x0001,
+	0x012e, 0x0468, 0x0005, 0x012e, 0x0ce8, 0x2079, 0x0000, 0x2061,
+	0x18ae, 0x2c4c, 0xa86c, 0x908e, 0x0100, 0x0128, 0x9086, 0x0200,
+	0x0904, 0x31bd, 0x0005, 0x7018, 0x2048, 0x2061, 0x1800, 0x701c,
+	0x0807, 0x7014, 0x2048, 0xa864, 0x9094, 0x00ff, 0x9296, 0x0029,
+	0x1120, 0xaa78, 0xd2fc, 0x0128, 0x0005, 0x9086, 0x0103, 0x0108,
+	0x0005, 0x2079, 0x0000, 0x2061, 0x1800, 0x701c, 0x0807, 0x2061,
+	0x1800, 0x7880, 0x908a, 0x0040, 0x1210, 0x61c8, 0x0042, 0x2100,
+	0x908a, 0x003f, 0x1a04, 0x31ba, 0x61c8, 0x0804, 0x314f, 0x3191,
+	0x31c9, 0x31d3, 0x31d7, 0x31e1, 0x31e7, 0x31eb, 0x31fb, 0x31fe,
+	0x3208, 0x320d, 0x3212, 0x321d, 0x3228, 0x3237, 0x3246, 0x3254,
+	0x326b, 0x3286, 0x31ba, 0x332f, 0x336d, 0x3413, 0x3424, 0x3447,
+	0x31ba, 0x31ba, 0x31ba, 0x347f, 0x349b, 0x34a4, 0x34d3, 0x34d9,
+	0x31ba, 0x351f, 0x31ba, 0x31ba, 0x31ba, 0x31ba, 0x31ba, 0x352a,
+	0x3533, 0x353b, 0x353d, 0x31ba, 0x31ba, 0x31ba, 0x31ba, 0x31ba,
+	0x31ba, 0x3569, 0x31ba, 0x31ba, 0x31ba, 0x31ba, 0x31ba, 0x3586,
+	0x35e1, 0x31ba, 0x31ba, 0x31ba, 0x31ba, 0x31ba, 0x31ba, 0x0002,
+	0x360b, 0x360e, 0x366d, 0x3686, 0x36b6, 0x3954, 0x31ba, 0x4cec,
+	0x31ba, 0x31ba, 0x31ba, 0x31ba, 0x31ba, 0x31ba, 0x31ba, 0x31ba,
+	0x3208, 0x320d, 0x3e75, 0x31ba, 0x3e8b, 0x4d7b, 0x4dcc, 0x4ecf,
+	0x31ba, 0x4f31, 0x4f6d, 0x4f9e, 0x50a2, 0x4fcb, 0x5022, 0x31ba,
+	0x3e8f, 0x404f, 0x4065, 0x408a, 0x40ef, 0x4163, 0x4183, 0x41fa,
+	0x420b, 0x421c, 0x421f, 0x4244, 0x42b7, 0x431d, 0x4325, 0x4457,
+	0x459c, 0x45d0, 0x4834, 0x31ba, 0x4852, 0x48fe, 0x49d4, 0x31ba,
+	0x31ba, 0x31ba, 0x31ba, 0x4a3a, 0x4a55, 0x4325, 0x4c9b, 0x714c,
+	0x0000, 0x2021, 0x4000, 0x080c, 0x464e, 0x0126, 0x2091, 0x8000,
+	0x0e04, 0x319b, 0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000,
+	0x0118, 0x7833, 0x0011, 0x0010, 0x7833, 0x0010, 0x7c82, 0x7986,
+	0x7a8a, 0x7b8e, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x1167, 0x7007, 0x0001, 0x2091, 0x5000, 0x700f, 0x0000,
+	0x012e, 0x0005, 0x2021, 0x4001, 0x08b0, 0x2021, 0x4002, 0x0898,
+	0x2021, 0x4003, 0x0880, 0x2021, 0x4005, 0x0868, 0x2021, 0x4006,
+	0x0850, 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884,
+	0x7990, 0x0804, 0x465b, 0x7883, 0x0004, 0x7884, 0x0807, 0x2039,
+	0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884, 0x7990, 0x0804,
+	0x465e, 0x7984, 0x7888, 0x2114, 0x200a, 0x0804, 0x3191, 0x7984,
+	0x2114, 0x0804, 0x3191, 0x20e1, 0x0000, 0x2099, 0x0021, 0x20e9,
+	0x0000, 0x20a1, 0x0021, 0x20a9, 0x001f, 0x4003, 0x7984, 0x7a88,
+	0x7b8c, 0x0804, 0x3191, 0x7884, 0x2060, 0x04d8, 0x2009, 0x0003,
+	0x2011, 0x0002, 0x2019, 0x0012, 0x789b, 0x0117, 0x0804, 0x3191,
+	0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0800, 0x2039, 0x0001, 0x7d98,
+	0x7c9c, 0x0848, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x31c6,
+	0x2138, 0x7d98, 0x7c9c, 0x0804, 0x31cd, 0x79a0, 0x9182, 0x0040,
+	0x0210, 0x0804, 0x31c6, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x31db,
+	0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x31c6, 0x21e8, 0x7984,
+	0x7888, 0x20a9, 0x0001, 0x21a0, 0x4004, 0x0804, 0x3191, 0x2061,
+	0x0800, 0xe10c, 0x9006, 0x2c15, 0x9200, 0x8c60, 0x8109, 0x1dd8,
+	0x2010, 0x9005, 0x0904, 0x3191, 0x0804, 0x31c0, 0x79a0, 0x9182,
+	0x0040, 0x0210, 0x0804, 0x31c6, 0x21e0, 0x20a9, 0x0001, 0x7984,
+	0x2198, 0x4012, 0x0804, 0x3191, 0x2069, 0x1853, 0x7884, 0x7990,
+	0x911a, 0x1a04, 0x31c6, 0x8019, 0x0904, 0x31c6, 0x684a, 0x6942,
+	0x788c, 0x6852, 0x7888, 0x6856, 0x9006, 0x685a, 0x685e, 0x080c,
+	0x6f5b, 0x0804, 0x3191, 0x2069, 0x1853, 0x7884, 0x7994, 0x911a,
+	0x1a04, 0x31c6, 0x8019, 0x0904, 0x31c6, 0x684e, 0x6946, 0x788c,
+	0x6862, 0x7888, 0x6866, 0x9006, 0x686a, 0x686e, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x630e, 0x012e, 0x0804, 0x3191, 0x902e, 0x2520,
+	0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x31c3, 0x7984, 0x7b88,
+	0x7a8c, 0x20a9, 0x0005, 0x20e9, 0x0001, 0x20a1, 0x189c, 0x4101,
+	0x080c, 0x4612, 0x1120, 0x2009, 0x0002, 0x0804, 0x31c3, 0x2009,
+	0x0020, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x465b, 0x701f,
+	0x32aa, 0x0005, 0xa864, 0x2008, 0x9084, 0x00ff, 0x9096, 0x0011,
+	0x0168, 0x9096, 0x0019, 0x0150, 0x9096, 0x0015, 0x0138, 0x9096,
+	0x0048, 0x0120, 0x9096, 0x0029, 0x1904, 0x31c3, 0x810f, 0x918c,
+	0x00ff, 0x0904, 0x31c3, 0x7112, 0x7010, 0x8001, 0x0560, 0x7012,
+	0x080c, 0x4612, 0x1120, 0x2009, 0x0002, 0x0804, 0x31c3, 0x2009,
+	0x0020, 0x7068, 0x2040, 0xa28c, 0xa390, 0xa494, 0xa598, 0x9290,
+	0x0040, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000, 0xa85c,
+	0x9080, 0x0019, 0xaf60, 0x080c, 0x465b, 0x701f, 0x32e8, 0x0005,
+	0xa864, 0x9084, 0x00ff, 0x9096, 0x0002, 0x0120, 0x9096, 0x000a,
+	0x1904, 0x31c3, 0x0888, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a,
+	0xa864, 0x9084, 0x00ff, 0x9096, 0x0029, 0x1160, 0xc2fd, 0xaa7a,
+	0x080c, 0x5b2d, 0x0150, 0x0126, 0x2091, 0x8000, 0xa87a, 0xa982,
+	0x012e, 0x0050, 0x080c, 0x5e34, 0x1128, 0x7007, 0x0003, 0x701f,
+	0x3314, 0x0005, 0x080c, 0x6770, 0x0126, 0x2091, 0x8000, 0x20a9,
+	0x0005, 0x20e1, 0x0001, 0x2099, 0x189c, 0x400a, 0x2100, 0x9210,
+	0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000, 0xa85c, 0x9080,
+	0x0019, 0x2009, 0x0020, 0x012e, 0xaf60, 0x0804, 0x465e, 0x2091,
+	0x8000, 0x7837, 0x4000, 0x7833, 0x0010, 0x7883, 0x4000, 0x7887,
+	0x4953, 0x788b, 0x5020, 0x788f, 0x2020, 0x2009, 0x017f, 0x2104,
+	0x7892, 0x3f00, 0x7896, 0x2061, 0x0100, 0x6200, 0x2061, 0x0200,
+	0x603c, 0x8007, 0x9205, 0x789a, 0x2009, 0x04fd, 0x2104, 0x789e,
+	0x2091, 0x5000, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x0180, 0x2001, 0x19e8, 0x2004, 0x9005, 0x0128, 0x2001, 0x008b,
+	0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003, 0x0002, 0x2003,
+	0x1001, 0x2071, 0x0080, 0x0804, 0x0427, 0x81ff, 0x1904, 0x31c3,
+	0x7984, 0x080c, 0x5f7e, 0x1904, 0x31c6, 0x7e98, 0x9684, 0x3fff,
+	0x9082, 0x4000, 0x1a04, 0x31c6, 0x7c88, 0x7d8c, 0x080c, 0x60e1,
+	0x080c, 0x60b0, 0x0000, 0x1518, 0x2061, 0x1cd0, 0x0126, 0x2091,
+	0x8000, 0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130,
+	0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0150, 0x012e, 0x9ce0,
+	0x0018, 0x2001, 0x1818, 0x2004, 0x9c02, 0x1a04, 0x31c3, 0x0c30,
+	0x080c, 0xb251, 0x012e, 0x0904, 0x31c3, 0x0804, 0x3191, 0x900e,
+	0x2001, 0x0005, 0x080c, 0x6770, 0x0126, 0x2091, 0x8000, 0x080c,
+	0xb8e9, 0x080c, 0x6536, 0x012e, 0x0804, 0x3191, 0x00a6, 0x2950,
+	0xb198, 0x080c, 0x5f7e, 0x1904, 0x3400, 0xb6a4, 0x9684, 0x3fff,
+	0x9082, 0x4000, 0x16e8, 0xb49c, 0xb5a0, 0x080c, 0x60e1, 0x080c,
+	0x60b0, 0x1520, 0x2061, 0x1cd0, 0x0126, 0x2091, 0x8000, 0x6000,
+	0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c, 0x9406,
+	0x1118, 0xa870, 0x9506, 0x0158, 0x012e, 0x9ce0, 0x0018, 0x2001,
+	0x1818, 0x2004, 0x9c02, 0x2009, 0x000d, 0x12b0, 0x0c28, 0x080c,
+	0xb251, 0x012e, 0x2009, 0x0003, 0x0178, 0x00e0, 0x900e, 0x2001,
+	0x0005, 0x080c, 0x6770, 0x0126, 0x2091, 0x8000, 0x080c, 0xb8e9,
+	0x080c, 0x6529, 0x012e, 0x0070, 0xb097, 0x4005, 0xb19a, 0x0010,
+	0xb097, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x2a48,
+	0x00ae, 0x0005, 0xb097, 0x4000, 0x9006, 0x918d, 0x0001, 0x2008,
+	0x2a48, 0x00ae, 0x0005, 0x81ff, 0x1904, 0x31c3, 0x080c, 0x4629,
+	0x0904, 0x31c6, 0x080c, 0x6045, 0x0904, 0x31c3, 0x080c, 0x60e7,
+	0x0904, 0x31c3, 0x0804, 0x417a, 0x81ff, 0x1904, 0x31c3, 0x080c,
+	0x4645, 0x0904, 0x31c6, 0x080c, 0x6175, 0x0904, 0x31c3, 0x2019,
+	0x0005, 0x79a8, 0x080c, 0x6102, 0x0904, 0x31c3, 0x7888, 0x908a,
+	0x1000, 0x1a04, 0x31c6, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c,
+	0x7c58, 0x7984, 0xd184, 0x1904, 0x3191, 0x0804, 0x417a, 0x0126,
+	0x2091, 0x8000, 0x81ff, 0x0118, 0x2009, 0x0001, 0x0450, 0x2029,
+	0x07ff, 0x6454, 0x2400, 0x9506, 0x01f8, 0x2508, 0x080c, 0x5f7e,
+	0x11d8, 0x080c, 0x6175, 0x1128, 0x2009, 0x0002, 0x62b8, 0x2518,
+	0x00c0, 0x2019, 0x0004, 0x900e, 0x080c, 0x6102, 0x1118, 0x2009,
+	0x0006, 0x0078, 0x7884, 0x908a, 0x1000, 0x1270, 0x8003, 0x800b,
+	0x810b, 0x9108, 0x080c, 0x7c58, 0x8529, 0x1ae0, 0x012e, 0x0804,
+	0x3191, 0x012e, 0x0804, 0x31c3, 0x012e, 0x0804, 0x31c6, 0x080c,
+	0x4629, 0x0904, 0x31c6, 0x080c, 0x6045, 0x0904, 0x31c3, 0xbaa0,
+	0x2019, 0x0005, 0x00c6, 0x9066, 0x080c, 0x8180, 0x0076, 0x903e,
+	0x080c, 0x8078, 0x900e, 0x080c, 0xcd62, 0x007e, 0x00ce, 0x080c,
+	0x60e1, 0x0804, 0x3191, 0x080c, 0x4629, 0x0904, 0x31c6, 0x080c,
+	0x60e1, 0x2208, 0x0804, 0x3191, 0x0156, 0x00d6, 0x00e6, 0x2069,
+	0x1906, 0x6810, 0x6914, 0x910a, 0x1208, 0x900e, 0x6816, 0x9016,
+	0x901e, 0x20a9, 0x007e, 0x2069, 0x1000, 0x2d04, 0x905d, 0x0118,
+	0xb84c, 0x0059, 0x9210, 0x8d68, 0x1f04, 0x34b5, 0x2300, 0x9218,
+	0x00ee, 0x00de, 0x015e, 0x0804, 0x3191, 0x00f6, 0x0016, 0x907d,
+	0x0138, 0x9006, 0x8000, 0x2f0c, 0x81ff, 0x0110, 0x2178, 0x0cd0,
+	0x001e, 0x00fe, 0x0005, 0x2069, 0x1906, 0x6910, 0x62b4, 0x0804,
+	0x3191, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x31c3, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x5127, 0x0128, 0x2009, 0x0007, 0x012e,
+	0x0804, 0x31c3, 0x012e, 0x6154, 0x9190, 0x2f92, 0x2215, 0x9294,
+	0x00ff, 0x6374, 0x83ff, 0x0108, 0x6278, 0x67d4, 0x97c4, 0x000a,
+	0x98c6, 0x000a, 0x1118, 0x2031, 0x0001, 0x00e8, 0x97c4, 0x0022,
+	0x98c6, 0x0022, 0x1118, 0x2031, 0x0003, 0x00a8, 0x97c4, 0x0012,
+	0x98c6, 0x0012, 0x1118, 0x2031, 0x0002, 0x0068, 0x080c, 0x6c53,
+	0x1118, 0x2031, 0x0004, 0x0038, 0xd79c, 0x0120, 0x2009, 0x0005,
+	0x0804, 0x31c3, 0x9036, 0x7e9a, 0x7f9e, 0x0804, 0x3191, 0x6144,
+	0x6248, 0x2019, 0x1955, 0x231c, 0x2001, 0x1956, 0x2004, 0x789a,
+	0x0804, 0x3191, 0x0126, 0x2091, 0x8000, 0x6134, 0x6238, 0x633c,
+	0x012e, 0x0804, 0x3191, 0x080c, 0x4645, 0x0904, 0x31c6, 0xba44,
+	0xbb38, 0x0804, 0x3191, 0x080c, 0x0db2, 0x080c, 0x4645, 0x2110,
+	0x0904, 0x31c6, 0xb804, 0x908c, 0x00ff, 0x918e, 0x0006, 0x0140,
+	0x9084, 0xff00, 0x9086, 0x0600, 0x2009, 0x0009, 0x1904, 0x31c3,
+	0x0126, 0x2091, 0x8000, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c,
+	0x94b5, 0x080c, 0x8180, 0x0076, 0x903e, 0x080c, 0x8078, 0x900e,
+	0x080c, 0xcd62, 0x007e, 0x00ce, 0xb807, 0x0407, 0x012e, 0x0804,
+	0x3191, 0x6144, 0x6248, 0x7884, 0x6046, 0x7b88, 0x634a, 0x2069,
+	0x1853, 0x831f, 0x9305, 0x6816, 0x788c, 0x2069, 0x1955, 0x2d1c,
+	0x206a, 0x7e98, 0x9682, 0x0014, 0x1210, 0x2031, 0x07d0, 0x2069,
+	0x1956, 0x2d04, 0x266a, 0x789a, 0x0804, 0x3191, 0x0126, 0x2091,
+	0x8000, 0x6134, 0x7884, 0x6036, 0x910e, 0xd1b4, 0x190c, 0x0e84,
+	0xd0c4, 0x01a8, 0x00d6, 0x78a8, 0x2009, 0x196c, 0x200a, 0x78ac,
+	0x2011, 0x196d, 0x2012, 0x2069, 0x0100, 0x6838, 0x9086, 0x0007,
+	0x1118, 0x2214, 0x6a5a, 0x0010, 0x210c, 0x695a, 0x00de, 0x7888,
+	0x603a, 0x2011, 0x0114, 0x220c, 0x7888, 0xd08c, 0x0118, 0x918d,
+	0x0080, 0x0010, 0x918c, 0xff7f, 0x2112, 0x613c, 0x788c, 0x603e,
+	0x910e, 0xd1e4, 0x190c, 0x0e9a, 0x603c, 0xd0cc, 0x0120, 0x78b0,
+	0x2011, 0x0114, 0x2012, 0x012e, 0x0804, 0x3191, 0x00f6, 0x2079,
+	0x1800, 0x7a34, 0xa898, 0x9084, 0xfebf, 0x9215, 0xa89c, 0x9084,
+	0xfebf, 0x8002, 0x9214, 0x7834, 0x9084, 0x0140, 0x9215, 0x7a36,
+	0xa897, 0x4000, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x00fe,
+	0x0005, 0x7898, 0x9005, 0x01a8, 0x7888, 0x9025, 0x0904, 0x31c6,
+	0x788c, 0x902d, 0x0904, 0x31c6, 0x900e, 0x080c, 0x5f7e, 0x1120,
+	0xba44, 0xbb38, 0xbc46, 0xbd3a, 0x9186, 0x07ff, 0x0190, 0x8108,
+	0x0ca0, 0x080c, 0x4645, 0x0904, 0x31c6, 0x7888, 0x900d, 0x0904,
+	0x31c6, 0x788c, 0x9005, 0x0904, 0x31c6, 0xba44, 0xb946, 0xbb38,
+	0xb83a, 0x0804, 0x3191, 0x2011, 0xbc09, 0x0010, 0x2011, 0xbc05,
+	0x080c, 0x5127, 0x1904, 0x31c3, 0x00c6, 0x2061, 0x0100, 0x7984,
+	0x9186, 0x00ff, 0x1130, 0x2001, 0x1816, 0x2004, 0x9085, 0xff00,
+	0x0088, 0x9182, 0x007f, 0x16e0, 0x9188, 0x2f92, 0x210d, 0x918c,
+	0x00ff, 0x2001, 0x1816, 0x2004, 0x0026, 0x9116, 0x002e, 0x0580,
+	0x810f, 0x9105, 0x0126, 0x2091, 0x8000, 0x0006, 0x080c, 0x9980,
+	0x000e, 0x0510, 0x602e, 0x620a, 0x7984, 0x00b6, 0x080c, 0x5f24,
+	0x2b08, 0x00be, 0x1500, 0x6112, 0x6023, 0x0001, 0x080c, 0x4612,
+	0x01d0, 0x9006, 0xa866, 0x7007, 0x0003, 0xa832, 0xa868, 0xc0fd,
+	0xa86a, 0x701f, 0x3666, 0x2900, 0x6016, 0x2009, 0x0032, 0x080c,
+	0x9a50, 0x012e, 0x00ce, 0x0005, 0x012e, 0x00ce, 0x0804, 0x31c3,
+	0x00ce, 0x0804, 0x31c6, 0x080c, 0x99d6, 0x0cb0, 0xa830, 0x9086,
+	0x0100, 0x0904, 0x31c3, 0x0804, 0x3191, 0x2061, 0x1a3e, 0x0126,
+	0x2091, 0x8000, 0x6000, 0xd084, 0x0170, 0x6104, 0x6208, 0x2061,
+	0x1800, 0x634c, 0x606c, 0x789a, 0x60b8, 0x789e, 0x60b4, 0x78aa,
+	0x012e, 0x0804, 0x3191, 0x900e, 0x2110, 0x0c88, 0x81ff, 0x1904,
+	0x31c3, 0x080c, 0x6c53, 0x0904, 0x31c3, 0x0126, 0x2091, 0x8000,
+	0x624c, 0x606c, 0x9202, 0x0248, 0x9085, 0x0001, 0x080c, 0x253f,
+	0x080c, 0x5304, 0x012e, 0x0804, 0x3191, 0x012e, 0x0804, 0x31c6,
+	0x0006, 0x0016, 0x00c6, 0x00e6, 0x2001, 0x1978, 0x2070, 0x2061,
+	0x1853, 0x6008, 0x2072, 0x900e, 0x2011, 0x1400, 0x080c, 0x7e7f,
+	0x7206, 0x00ee, 0x00ce, 0x001e, 0x000e, 0x0005, 0x0126, 0x2091,
+	0x8000, 0x81ff, 0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x3193,
+	0x7884, 0xd0fc, 0x0148, 0x2001, 0x002a, 0x2004, 0x9082, 0x00e1,
+	0x0288, 0x012e, 0x0804, 0x31c6, 0x2001, 0x002a, 0x2004, 0x2069,
+	0x1853, 0x6908, 0x9102, 0x1230, 0x012e, 0x0804, 0x31c6, 0x012e,
+	0x0804, 0x31c3, 0x080c, 0x9940, 0x0dd0, 0x7884, 0xd0fc, 0x0904,
+	0x3731, 0x00c6, 0x080c, 0x4612, 0x00ce, 0x0d88, 0xa867, 0x0000,
+	0x7884, 0xa80a, 0x7898, 0xa80e, 0x789c, 0xa812, 0x2001, 0x002e,
+	0x2004, 0xa81a, 0x2001, 0x002f, 0x2004, 0xa81e, 0x2001, 0x0030,
+	0x2004, 0xa822, 0x2001, 0x0031, 0x2004, 0xa826, 0x2001, 0x0034,
+	0x2004, 0xa82a, 0x2001, 0x0035, 0x2004, 0xa82e, 0x2001, 0x002a,
+	0x2004, 0x9080, 0x0003, 0x9084, 0x00fc, 0x8004, 0xa816, 0x080c,
+	0x38b7, 0x0928, 0x7014, 0x2048, 0xad2c, 0xac28, 0xab1c, 0xaa18,
+	0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021, 0x0000,
+	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
+	0x001b, 0x080c, 0x465b, 0x701f, 0x37f4, 0x7023, 0x0001, 0x012e,
+	0x0005, 0x0046, 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6,
+	0x00e6, 0x00f6, 0x080c, 0x36a0, 0x2001, 0x196e, 0x2003, 0x0000,
+	0x2021, 0x000a, 0x2061, 0x0100, 0x6104, 0x0016, 0x60bb, 0x0000,
+	0x60bf, 0x32e1, 0x60bf, 0x0012, 0x080c, 0x3926, 0x080c, 0x38e5,
+	0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x1a34, 0x2079, 0x0090,
+	0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0140, 0x2001, 0x0035,
+	0x2004, 0x780e, 0x2001, 0x0034, 0x2004, 0x780a, 0x00de, 0x2011,
+	0x0001, 0x080c, 0x3cb9, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3be6,
+	0x080c, 0x3aeb, 0x05b8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140,
+	0x1db8, 0x080c, 0x3d2d, 0x00f6, 0x2079, 0x0300, 0x78bc, 0x00fe,
+	0x908c, 0x0070, 0x1560, 0x2071, 0x0200, 0x7037, 0x0000, 0x7050,
+	0x9084, 0xff00, 0x9086, 0x3200, 0x1510, 0x7037, 0x0001, 0x7050,
+	0x9084, 0xff00, 0x9086, 0xe100, 0x11d0, 0x7037, 0x0000, 0x7054,
+	0x7037, 0x0000, 0x715c, 0x9106, 0x1190, 0x2001, 0x181e, 0x2004,
+	0x9106, 0x1168, 0x00c6, 0x2061, 0x0100, 0x6024, 0x9084, 0x1e00,
+	0x00ce, 0x0138, 0x080c, 0x3af5, 0x080c, 0x38e0, 0x0058, 0x080c,
+	0x38e0, 0x080c, 0x3c51, 0x080c, 0x3bdc, 0x2001, 0x020b, 0x2004,
+	0xd0e4, 0x0dd8, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100,
+	0x6027, 0x0002, 0x001e, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020,
+	0x60bb, 0x0000, 0x60bf, 0x0108, 0x60bf, 0x0012, 0x2001, 0x0004,
+	0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x127c, 0x2009, 0x0028,
+	0x080c, 0x20d9, 0x2001, 0x0227, 0x200c, 0x2102, 0x00fe, 0x00ee,
+	0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, 0x004e, 0x2001,
+	0x196e, 0x2004, 0x9005, 0x1118, 0x012e, 0x0804, 0x3191, 0x012e,
+	0x2021, 0x400c, 0x0804, 0x3193, 0x0016, 0x0026, 0x0036, 0x0046,
+	0x0056, 0x0076, 0x0086, 0x0096, 0x00d6, 0x0156, 0x7014, 0x2048,
+	0x7020, 0x20a8, 0x8000, 0x7022, 0xa804, 0x9005, 0x0904, 0x3850,
+	0x2048, 0x1f04, 0x3804, 0x7068, 0x2040, 0xa28c, 0xa390, 0xa494,
+	0xa598, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021,
+	0x0000, 0x0096, 0x7014, 0x2048, 0xa864, 0x009e, 0x9086, 0x0103,
+	0x0170, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x9080, 0x001b, 0x080c, 0x465b, 0x701f, 0x37f4, 0x00b0, 0x8906,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b,
+	0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c, 0x0f52,
+	0x000e, 0x080c, 0x465e, 0x701f, 0x37f4, 0x015e, 0x00de, 0x009e,
+	0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005,
+	0x7014, 0x2048, 0xa864, 0x9086, 0x0103, 0x1118, 0x701f, 0x38b5,
+	0x0450, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a, 0x2009, 0x007f,
+	0x080c, 0x5f1e, 0x0110, 0x9006, 0x0030, 0xb813, 0x00ff, 0xb817,
+	0xfffd, 0x080c, 0xbab8, 0x015e, 0x00de, 0x009e, 0x008e, 0x007e,
+	0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0904, 0x31c3, 0x0016,
+	0x0026, 0x0036, 0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6,
+	0x0156, 0x701f, 0x3887, 0x7007, 0x0003, 0x0804, 0x3845, 0x0076,
+	0xa830, 0x9086, 0x0100, 0x2021, 0x400c, 0x0904, 0x3193, 0xad10,
+	0xac0c, 0xab24, 0xaa20, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029,
+	0x0000, 0x2021, 0x0000, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f,
+	0x9084, 0xffc0, 0x9080, 0x001b, 0x21a8, 0x27e0, 0x2098, 0x27e8,
+	0x20a0, 0x0006, 0x080c, 0x0f52, 0x000e, 0x080c, 0x465e, 0x007e,
+	0x701f, 0x37f4, 0x7023, 0x0001, 0x0005, 0x0804, 0x3191, 0x0156,
+	0x00c6, 0xa814, 0x908a, 0x001e, 0x0218, 0xa833, 0x001e, 0x0010,
+	0xa832, 0x0078, 0x81ff, 0x0168, 0x0016, 0x080c, 0x4612, 0x001e,
+	0x0130, 0xa800, 0x2040, 0xa008, 0xa80a, 0x2100, 0x0c58, 0x9006,
+	0x0010, 0x9085, 0x0001, 0x00ce, 0x015e, 0x0005, 0x0006, 0x00f6,
+	0x2079, 0x0000, 0x7880, 0x9086, 0x0044, 0x00fe, 0x000e, 0x0005,
+	0x2001, 0x196e, 0x2003, 0x0001, 0x0005, 0x00f6, 0x00e6, 0x00c6,
+	0x2061, 0x0200, 0x2001, 0x1979, 0x2004, 0x601a, 0x2061, 0x0100,
+	0x2001, 0x1978, 0x2004, 0x60ce, 0x6104, 0xc1ac, 0x6106, 0x080c,
+	0x4612, 0xa813, 0x0019, 0xa817, 0x0001, 0x2900, 0xa85a, 0x2001,
+	0x002e, 0x2004, 0xa866, 0x2001, 0x002f, 0x2004, 0xa86a, 0x2061,
+	0x0090, 0x2079, 0x0100, 0x2001, 0x1978, 0x2004, 0x6036, 0x2009,
+	0x0040, 0x080c, 0x20d9, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
+	0xa86e, 0x601a, 0xa873, 0x0000, 0x601f, 0x0000, 0x78ca, 0x9006,
+	0x600a, 0x600e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6, 0x080c,
+	0x4612, 0x2940, 0xa013, 0x0019, 0xa017, 0x0001, 0x2800, 0xa05a,
+	0x2001, 0x0030, 0x2004, 0xa866, 0x2001, 0x0031, 0x2004, 0xa86a,
+	0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e, 0xa873, 0x0000,
+	0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x0300, 0x2003, 0x0000,
+	0x2001, 0x020d, 0x2003, 0x0000, 0x2001, 0x0004, 0x200c, 0x918d,
+	0x0002, 0x2102, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x81ff,
+	0x0148, 0x080c, 0x28c8, 0x1130, 0x9006, 0x080c, 0x2820, 0x9006,
+	0x080c, 0x2803, 0x7884, 0x9084, 0x0007, 0x0002, 0x3971, 0x397a,
+	0x3983, 0x396e, 0x396e, 0x396e, 0x396e, 0x396e, 0x012e, 0x0804,
+	0x31c6, 0x2009, 0x0114, 0x2104, 0x9085, 0x0800, 0x200a, 0x080c,
+	0x3b3f, 0x00c0, 0x2009, 0x0114, 0x2104, 0x9085, 0x4000, 0x200a,
+	0x080c, 0x3b3f, 0x0078, 0x080c, 0x6c53, 0x1128, 0x012e, 0x2009,
+	0x0016, 0x0804, 0x31c3, 0x81ff, 0x0128, 0x012e, 0x2021, 0x400b,
+	0x0804, 0x3193, 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6,
+	0x00e6, 0x00f6, 0x080c, 0x36a0, 0x2009, 0x0101, 0x210c, 0x0016,
+	0x7ec8, 0x7dcc, 0x9006, 0x2068, 0x2060, 0x2058, 0x080c, 0x3e08,
+	0x080c, 0x3d58, 0x903e, 0x2720, 0x00f6, 0x00e6, 0x0086, 0x2940,
+	0x2071, 0x1a34, 0x2079, 0x0090, 0x00d6, 0x2069, 0x0000, 0x6884,
+	0xd0b4, 0x0120, 0x68d4, 0x780e, 0x68d0, 0x780a, 0x00de, 0x2011,
+	0x0001, 0x080c, 0x3cb9, 0x080c, 0x28d0, 0x080c, 0x28d0, 0x080c,
+	0x28d0, 0x080c, 0x28d0, 0x080c, 0x3cb9, 0x008e, 0x00ee, 0x00fe,
+	0x080c, 0x3be6, 0x2009, 0x0190, 0x8109, 0x11b0, 0x080c, 0x3af5,
+	0x2001, 0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x001e, 0x00fe,
+	0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, 0x2009,
+	0x0017, 0x080c, 0x31c3, 0x0cf8, 0x2001, 0x020b, 0x2004, 0x9084,
+	0x0140, 0x1d10, 0x00f6, 0x2079, 0x0000, 0x7884, 0x00fe, 0xd0bc,
+	0x0178, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0150, 0x080c, 0x3bc4,
+	0x2d00, 0x9c05, 0x9b05, 0x0120, 0x080c, 0x3af5, 0x0804, 0x3aa2,
+	0x080c, 0x3d2d, 0x080c, 0x3c51, 0x080c, 0x3ba7, 0x080c, 0x3bdc,
+	0x00f6, 0x2079, 0x0100, 0x7824, 0xd0ac, 0x0130, 0x8b58, 0x080c,
+	0x3af5, 0x00fe, 0x0804, 0x3aa2, 0x00fe, 0x080c, 0x3aeb, 0x1150,
+	0x8d68, 0x2001, 0x0032, 0x2602, 0x2001, 0x0033, 0x2502, 0x080c,
+	0x3af5, 0x0080, 0x87ff, 0x0138, 0x2001, 0x0201, 0x2004, 0x9005,
+	0x1908, 0x8739, 0x0038, 0x2001, 0x1a31, 0x2004, 0x9086, 0x0000,
+	0x1904, 0x39f2, 0x2001, 0x032f, 0x2003, 0x00f6, 0x8631, 0x1208,
+	0x8529, 0x2500, 0x9605, 0x0904, 0x3aa2, 0x7884, 0xd0bc, 0x0128,
+	0x2d00, 0x9c05, 0x9b05, 0x1904, 0x3aa2, 0xa013, 0x0019, 0x2001,
+	0x032a, 0x2003, 0x0004, 0x7884, 0xd0ac, 0x1148, 0x2001, 0x1a31,
+	0x2003, 0x0003, 0x2001, 0x032a, 0x2003, 0x0009, 0x0030, 0xa017,
+	0x0001, 0x78b4, 0x9005, 0x0108, 0xa016, 0x2800, 0xa05a, 0x2009,
+	0x0040, 0x080c, 0x20d9, 0x2900, 0xa85a, 0xa813, 0x0019, 0x7884,
+	0xd0a4, 0x1180, 0xa817, 0x0000, 0x00c6, 0x20a9, 0x0004, 0x2061,
+	0x0090, 0x602b, 0x0008, 0x2001, 0x0203, 0x2004, 0x1f04, 0x3a79,
+	0x00ce, 0x0030, 0xa817, 0x0001, 0x78b0, 0x9005, 0x0108, 0xa816,
+	0x00f6, 0x00c6, 0x2079, 0x0100, 0x2061, 0x0090, 0x7827, 0x0002,
+	0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0x601a, 0x0006, 0x2001,
+	0x002b, 0x2004, 0x601e, 0x78c6, 0x000e, 0x78ca, 0x00ce, 0x00fe,
+	0x0804, 0x39ac, 0x001e, 0x00c6, 0x2001, 0x032a, 0x2003, 0x0004,
+	0x2061, 0x0100, 0x6027, 0x0002, 0x6106, 0x2011, 0x020d, 0x2013,
+	0x0020, 0x2001, 0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x080c,
+	0x127c, 0x7884, 0x9084, 0x0003, 0x9086, 0x0002, 0x01a0, 0x2009,
+	0x0028, 0x080c, 0x20d9, 0x2001, 0x0227, 0x200c, 0x2102, 0x6050,
+	0x9084, 0xb7ef, 0x6052, 0x602f, 0x0000, 0x604b, 0xf7f7, 0x6043,
+	0x0090, 0x6043, 0x0010, 0x00ce, 0x2d08, 0x2c10, 0x2b18, 0x2b00,
+	0x9c05, 0x9d05, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae,
+	0x009e, 0x008e, 0x1118, 0x012e, 0x0804, 0x3191, 0x012e, 0x2021,
+	0x400c, 0x0804, 0x3193, 0x9085, 0x0001, 0x1d04, 0x3af4, 0x2091,
+	0x6000, 0x8420, 0x9486, 0x0064, 0x0005, 0x2001, 0x0105, 0x2003,
+	0x0010, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x1a31, 0x2003,
+	0x0000, 0x0071, 0x2009, 0x0048, 0x080c, 0x20d9, 0x2001, 0x0227,
+	0x2024, 0x2402, 0x2001, 0x0109, 0x2003, 0x4000, 0x9026, 0x0005,
+	0x00f6, 0x00e6, 0x2071, 0x1a34, 0x7000, 0x9086, 0x0000, 0x0520,
+	0x2079, 0x0090, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203, 0x210c,
+	0x9106, 0x1120, 0x2009, 0x0040, 0x080c, 0x20d9, 0x782c, 0xd0fc,
+	0x0d88, 0x080c, 0x3d2d, 0x7000, 0x9086, 0x0000, 0x1d58, 0x782b,
+	0x0004, 0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c, 0x20d9,
+	0x782b, 0x0002, 0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x00f6,
+	0x2079, 0x0100, 0x2001, 0x1816, 0x200c, 0x7932, 0x7936, 0x080c,
+	0x251f, 0x7850, 0x9084, 0xfbff, 0x9085, 0x0030, 0x7852, 0x2019,
+	0x01f4, 0x8319, 0x1df0, 0x9084, 0xffcf, 0x9085, 0x2000, 0x7852,
+	0x20a9, 0x0046, 0x1d04, 0x3b5a, 0x2091, 0x6000, 0x1f04, 0x3b5a,
+	0x7850, 0x9085, 0x0400, 0x9084, 0xdfff, 0x7852, 0x2001, 0x0021,
+	0x2004, 0x9084, 0x0003, 0x9086, 0x0001, 0x1120, 0x7850, 0x9084,
+	0xdfff, 0x7852, 0x784b, 0xf7f7, 0x7843, 0x0090, 0x7843, 0x0010,
+	0x20a9, 0x0028, 0xa001, 0x1f04, 0x3b7a, 0x7850, 0x9085, 0x1400,
+	0x7852, 0x2019, 0x61a8, 0x7854, 0xa001, 0xa001, 0xd08c, 0x1110,
+	0x8319, 0x1dc8, 0x7827, 0x0048, 0x7850, 0x9085, 0x0400, 0x7852,
+	0x7843, 0x0040, 0x2019, 0x01f4, 0xa001, 0xa001, 0x8319, 0x1de0,
+	0x2001, 0x0100, 0x080c, 0x2987, 0x7827, 0x0020, 0x7843, 0x0000,
+	0x9006, 0x080c, 0x2987, 0x7827, 0x0048, 0x00fe, 0x0005, 0x7884,
+	0xd0ac, 0x11c8, 0x00f6, 0x00e6, 0x2071, 0x1a31, 0x2079, 0x0320,
+	0x2001, 0x0201, 0x2004, 0x9005, 0x0160, 0x7000, 0x9086, 0x0000,
+	0x1140, 0x0051, 0xd0bc, 0x0108, 0x8738, 0x7003, 0x0003, 0x782b,
+	0x0019, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0300, 0x78bc,
+	0x00fe, 0x908c, 0x0070, 0x0178, 0x2009, 0x0032, 0x260a, 0x2009,
+	0x0033, 0x250a, 0xd0b4, 0x0108, 0x8c60, 0xd0ac, 0x0108, 0x8d68,
+	0xd0a4, 0x0108, 0x8b58, 0x0005, 0x00f6, 0x2079, 0x0200, 0x781c,
+	0xd084, 0x0110, 0x7837, 0x0050, 0x00fe, 0x0005, 0x00e6, 0x2071,
+	0x0100, 0x2001, 0x1979, 0x2004, 0x70e2, 0x080c, 0x38d6, 0x1188,
+	0x2001, 0x181e, 0x2004, 0x2009, 0x181d, 0x210c, 0x918c, 0x00ff,
+	0x706e, 0x716a, 0x7066, 0x918d, 0x3200, 0x7162, 0x7073, 0xe109,
+	0x0080, 0x702c, 0x9085, 0x0002, 0x702e, 0x2009, 0x1816, 0x210c,
+	0x716e, 0x7063, 0x0100, 0x7166, 0x719e, 0x706b, 0x0000, 0x7073,
+	0x0809, 0x7077, 0x0008, 0x7078, 0x9080, 0x0100, 0x707a, 0x7080,
+	0x8000, 0x7082, 0x7087, 0xaaaa, 0x9006, 0x708a, 0x708e, 0x707e,
+	0x70d6, 0x70ab, 0x0036, 0x70af, 0x95d5, 0x7014, 0x9084, 0x1984,
+	0x9085, 0x0092, 0x7016, 0x080c, 0x3d2d, 0x00f6, 0x2071, 0x1a31,
+	0x2079, 0x0320, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120,
+	0x689c, 0x780e, 0x6898, 0x780a, 0x00de, 0x2009, 0x03e8, 0x8109,
+	0x1df0, 0x792c, 0xd1fc, 0x0110, 0x782b, 0x0004, 0x2011, 0x0011,
+	0x080c, 0x3cb9, 0x2011, 0x0001, 0x080c, 0x3cb9, 0x00fe, 0x00ee,
+	0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a31, 0x2079, 0x0320, 0x792c,
+	0xd1fc, 0x0904, 0x3cb6, 0x782b, 0x0002, 0x9026, 0xd19c, 0x1904,
+	0x3cb2, 0x7000, 0x0002, 0x3cb6, 0x3c67, 0x3c97, 0x3cb2, 0xd1bc,
+	0x1170, 0xd1dc, 0x1190, 0x8001, 0x7002, 0x2011, 0x0001, 0x080c,
+	0x3cb9, 0x0904, 0x3cb6, 0x080c, 0x3cb9, 0x0804, 0x3cb6, 0x00f6,
+	0x2079, 0x0300, 0x78bf, 0x0000, 0x00fe, 0x7810, 0x7914, 0x782b,
+	0x0004, 0x7812, 0x7916, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0de8,
+	0x080c, 0x3bc4, 0x2009, 0x0001, 0x00f6, 0x2079, 0x0300, 0x78b8,
+	0x00fe, 0xd0ec, 0x0110, 0x2009, 0x0011, 0x792a, 0x00f8, 0x8001,
+	0x7002, 0x9184, 0x0880, 0x1140, 0x782c, 0xd0fc, 0x1904, 0x3c5b,
+	0x2011, 0x0001, 0x00b1, 0x0090, 0xa010, 0x9092, 0x0004, 0x9086,
+	0x0015, 0x1120, 0xa000, 0xa05a, 0x2011, 0x0031, 0xa212, 0xd1dc,
+	0x1960, 0x0828, 0x782b, 0x0004, 0x7003, 0x0000, 0x00ee, 0x00fe,
+	0x0005, 0xa014, 0x9005, 0x0550, 0x8001, 0x0036, 0x0096, 0xa016,
+	0xa058, 0x2048, 0xa010, 0x2009, 0x0031, 0x911a, 0x831c, 0x831c,
+	0x938a, 0x0007, 0x1a0c, 0x0db2, 0x9398, 0x3ce7, 0x231d, 0x083f,
+	0x9080, 0x0004, 0x7a2a, 0x7100, 0x8108, 0x7102, 0x009e, 0x003e,
+	0x908a, 0x0035, 0x1140, 0x0096, 0xa058, 0x2048, 0xa804, 0xa05a,
+	0x2001, 0x0019, 0x009e, 0xa012, 0x9085, 0x0001, 0x0005, 0x3d24,
+	0x3d1b, 0x3d12, 0x3d09, 0x3d00, 0x3cf7, 0x3cee, 0xa964, 0x7902,
+	0xa968, 0x7906, 0xa96c, 0x7912, 0xa970, 0x7916, 0x0005, 0xa974,
+	0x7902, 0xa978, 0x7906, 0xa97c, 0x7912, 0xa980, 0x7916, 0x0005,
+	0xa984, 0x7902, 0xa988, 0x7906, 0xa98c, 0x7912, 0xa990, 0x7916,
+	0x0005, 0xa994, 0x7902, 0xa998, 0x7906, 0xa99c, 0x7912, 0xa9a0,
+	0x7916, 0x0005, 0xa9a4, 0x7902, 0xa9a8, 0x7906, 0xa9ac, 0x7912,
+	0xa9b0, 0x7916, 0x0005, 0xa9b4, 0x7902, 0xa9b8, 0x7906, 0xa9bc,
+	0x7912, 0xa9c0, 0x7916, 0x0005, 0xa9c4, 0x7902, 0xa9c8, 0x7906,
+	0xa9cc, 0x7912, 0xa9d0, 0x7916, 0x0005, 0x00f6, 0x00e6, 0x0086,
+	0x2071, 0x1a34, 0x2079, 0x0090, 0x792c, 0xd1fc, 0x01e8, 0x782b,
+	0x0002, 0x2940, 0x9026, 0x7000, 0x0002, 0x3d54, 0x3d40, 0x3d4b,
+	0x8001, 0x7002, 0xd19c, 0x1180, 0x2011, 0x0001, 0x080c, 0x3cb9,
+	0x190c, 0x3cb9, 0x0048, 0x8001, 0x7002, 0x782c, 0xd0fc, 0x1d38,
+	0x2011, 0x0001, 0x080c, 0x3cb9, 0x008e, 0x00ee, 0x00fe, 0x0005,
+	0x00f6, 0x00e6, 0x00c6, 0x0086, 0x2061, 0x0200, 0x2001, 0x1979,
+	0x2004, 0x601a, 0x2061, 0x0100, 0x2001, 0x1978, 0x2004, 0x60ce,
+	0x6104, 0xc1ac, 0x6106, 0x2001, 0x002c, 0x2004, 0x9005, 0x0520,
+	0x2038, 0x2001, 0x002e, 0x2024, 0x2001, 0x002f, 0x201c, 0x080c,
+	0x4612, 0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007,
+	0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096,
+	0xa858, 0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x3dd0,
+	0x1d68, 0x2900, 0xa85a, 0x00d0, 0x080c, 0x4612, 0xa813, 0x0019,
+	0xa817, 0x0001, 0x2900, 0xa85a, 0x2001, 0x002e, 0x2004, 0xa866,
+	0x2001, 0x002f, 0x2004, 0xa86a, 0x2001, 0x002a, 0x2004, 0x9084,
+	0xfff8, 0xa86e, 0x2001, 0x002b, 0x2004, 0xa872, 0x2061, 0x0090,
+	0x2079, 0x0100, 0x2001, 0x1978, 0x2004, 0x6036, 0x2009, 0x0040,
+	0x080c, 0x20d9, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0x601a,
+	0x0006, 0x2001, 0x002b, 0x2004, 0x601e, 0x78c6, 0x000e, 0x78ca,
+	0x9006, 0x600a, 0x600e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005,
+	0x00e6, 0x2071, 0x0080, 0xaa60, 0x22e8, 0x20a0, 0x20e1, 0x0000,
+	0x2099, 0x0088, 0x702b, 0x0026, 0x7402, 0x7306, 0x9006, 0x700a,
+	0x700e, 0x810b, 0x810b, 0x21a8, 0x810b, 0x7112, 0x702b, 0x0041,
+	0x702c, 0xd0fc, 0x0de8, 0x702b, 0x0002, 0x702b, 0x0040, 0x4005,
+	0x7400, 0x7304, 0x87ff, 0x0190, 0x0086, 0x0096, 0x2940, 0x0086,
+	0x080c, 0x4612, 0x008e, 0xa058, 0x00a6, 0x2050, 0x2900, 0xb006,
+	0xa05a, 0x00ae, 0x009e, 0x008e, 0x9085, 0x0001, 0x00ee, 0x0005,
+	0x00e6, 0x2001, 0x002d, 0x2004, 0x9005, 0x0528, 0x2038, 0x2001,
+	0x0030, 0x2024, 0x2001, 0x0031, 0x201c, 0x080c, 0x4612, 0x2940,
+	0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220,
+	0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858,
+	0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x3dd0, 0x1d68,
+	0x2900, 0xa85a, 0x00d8, 0x080c, 0x4612, 0x2940, 0xa013, 0x0019,
+	0xa017, 0x0001, 0x2800, 0xa05a, 0x2001, 0x0030, 0x2004, 0xa066,
+	0x2001, 0x0031, 0x2004, 0xa06a, 0x2001, 0x002a, 0x2004, 0x9084,
+	0xfff8, 0xa06e, 0x2001, 0x002b, 0x2004, 0xa072, 0x2001, 0x032a,
+	0x2003, 0x0004, 0x7884, 0xd0ac, 0x1180, 0x2001, 0x0101, 0x200c,
+	0x918d, 0x0200, 0x2102, 0xa017, 0x0000, 0x2001, 0x1a31, 0x2003,
+	0x0003, 0x2001, 0x032a, 0x2003, 0x0009, 0x2001, 0x0300, 0x2003,
+	0x0000, 0x2001, 0x020d, 0x2003, 0x0000, 0x2001, 0x0004, 0x200c,
+	0x918d, 0x0002, 0x2102, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x20a9, 0x0013, 0x20a1, 0x1840, 0x20e9, 0x0001, 0x9006, 0x4004,
+	0x2009, 0x013c, 0x200a, 0x012e, 0x7880, 0x9086, 0x0052, 0x0108,
+	0x0005, 0x0804, 0x3191, 0x7d98, 0x7c9c, 0x0804, 0x3288, 0x080c,
+	0x6c53, 0x190c, 0x59e6, 0x2069, 0x1853, 0x2d00, 0x2009, 0x0030,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x080c, 0x465b,
+	0x701f, 0x3ea3, 0x0005, 0x080c, 0x5122, 0x1130, 0x3b00, 0x3a08,
+	0xc194, 0xc095, 0x20d8, 0x21d0, 0x2069, 0x1853, 0x6800, 0x9005,
+	0x0904, 0x31c6, 0x6804, 0xd0ac, 0x0118, 0xd0a4, 0x0904, 0x31c6,
+	0xd094, 0x00c6, 0x2061, 0x0100, 0x6104, 0x0138, 0x6200, 0x9292,
+	0x0005, 0x0218, 0x918c, 0xffdf, 0x0010, 0x918d, 0x0020, 0x6106,
+	0x00ce, 0xd08c, 0x00c6, 0x2061, 0x0100, 0x6104, 0x0118, 0x918d,
+	0x0010, 0x0010, 0x918c, 0xffef, 0x6106, 0x00ce, 0xd084, 0x0158,
+	0x6a28, 0x928a, 0x007f, 0x1a04, 0x31c6, 0x9288, 0x2f92, 0x210d,
+	0x918c, 0x00ff, 0x615e, 0xd0dc, 0x0130, 0x6828, 0x908a, 0x007f,
+	0x1a04, 0x31c6, 0x6056, 0x6888, 0x9084, 0x0030, 0x8004, 0x8004,
+	0x8004, 0x8004, 0x0006, 0x2009, 0x1980, 0x9080, 0x2612, 0x2005,
+	0x200a, 0x000e, 0x2009, 0x1981, 0x9080, 0x2616, 0x2005, 0x200a,
+	0x6808, 0x908a, 0x0100, 0x0a04, 0x31c6, 0x908a, 0x0841, 0x1a04,
+	0x31c6, 0x9084, 0x0007, 0x1904, 0x31c6, 0x680c, 0x9005, 0x0904,
+	0x31c6, 0x6810, 0x9005, 0x0904, 0x31c6, 0x6848, 0x6940, 0x910a,
+	0x1a04, 0x31c6, 0x8001, 0x0904, 0x31c6, 0x684c, 0x6944, 0x910a,
+	0x1a04, 0x31c6, 0x8001, 0x0904, 0x31c6, 0x2009, 0x1950, 0x200b,
+	0x0000, 0x2001, 0x1875, 0x2004, 0xd0c4, 0x0140, 0x7884, 0x200a,
+	0x2009, 0x017f, 0x200a, 0x3b00, 0xc085, 0x20d8, 0x6814, 0x908c,
+	0x00ff, 0x6146, 0x8007, 0x9084, 0x00ff, 0x604a, 0x080c, 0x6f5b,
+	0x080c, 0x62da, 0x080c, 0x630e, 0x6808, 0x602a, 0x080c, 0x204b,
+	0x2009, 0x0170, 0x200b, 0x0080, 0xa001, 0xa001, 0x200b, 0x0000,
+	0x0036, 0x6b08, 0x080c, 0x2579, 0x003e, 0x6000, 0x9086, 0x0000,
+	0x1904, 0x403f, 0x6818, 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f,
+	0x8217, 0x831f, 0x6016, 0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4,
+	0x0148, 0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217,
+	0x831f, 0x0010, 0x9084, 0xf0ff, 0x6006, 0x610a, 0x620e, 0x6312,
+	0x8007, 0x810f, 0x8217, 0x831f, 0x20a9, 0x0004, 0x20a1, 0x1982,
+	0x20e9, 0x0001, 0x4001, 0x20a9, 0x0004, 0x20a1, 0x199c, 0x20e9,
+	0x0001, 0x4001, 0x080c, 0x7d50, 0x00c6, 0x900e, 0x20a9, 0x0001,
+	0x6b70, 0xd384, 0x0510, 0x0068, 0x2009, 0x0100, 0x210c, 0x918e,
+	0x0008, 0x1110, 0x839d, 0x0010, 0x83f5, 0x3e18, 0x12b0, 0x3508,
+	0x8109, 0x080c, 0x74e0, 0x6878, 0x6016, 0x6874, 0x2008, 0x9084,
+	0xff00, 0x8007, 0x600a, 0x9184, 0x00ff, 0x6006, 0x8108, 0x1118,
+	0x6003, 0x0003, 0x0010, 0x6003, 0x0001, 0x1f04, 0x3f94, 0x00ce,
+	0x00c6, 0x2061, 0x196b, 0x6a88, 0x9284, 0xc000, 0x2010, 0x9286,
+	0x0000, 0x1158, 0x2063, 0x0000, 0x2001, 0x0001, 0x080c, 0x2820,
+	0x2001, 0x0001, 0x080c, 0x2803, 0x0088, 0x9286, 0x4000, 0x1148,
+	0x2063, 0x0001, 0x9006, 0x080c, 0x2820, 0x9006, 0x080c, 0x2803,
+	0x0028, 0x9286, 0x8000, 0x1d30, 0x2063, 0x0002, 0x00ce, 0x00e6,
+	0x2c70, 0x080c, 0x0e69, 0x00ee, 0x6888, 0xd0ec, 0x0130, 0x2011,
+	0x0114, 0x2204, 0x9085, 0x0100, 0x2012, 0x6a80, 0x9284, 0x0030,
+	0x9086, 0x0030, 0x1128, 0x9294, 0xffcf, 0x9295, 0x0020, 0x6a82,
+	0x2001, 0x194d, 0x6a80, 0x9294, 0x0030, 0x928e, 0x0000, 0x0170,
+	0x928e, 0x0010, 0x0118, 0x928e, 0x0020, 0x0140, 0x2003, 0xaaaa,
+	0x080c, 0x25ee, 0x2001, 0x193e, 0x2102, 0x0008, 0x2102, 0x00c6,
+	0x2061, 0x0100, 0x602f, 0x0040, 0x602f, 0x0000, 0x00ce, 0x080c,
+	0x6c53, 0x0128, 0x080c, 0x4a2e, 0x0110, 0x080c, 0x253f, 0x60cc,
+	0x9005, 0x01c0, 0x6003, 0x0001, 0x2009, 0x4027, 0x00d0, 0x080c,
+	0x6c53, 0x1168, 0x2011, 0x6ad9, 0x080c, 0x7c4a, 0x2011, 0x6acc,
+	0x080c, 0x7d1b, 0x080c, 0x6f2f, 0x080c, 0x6b8a, 0x0040, 0x080c,
+	0x58e0, 0x0028, 0x6003, 0x0004, 0x2009, 0x403f, 0x0010, 0x0804,
+	0x3191, 0x2001, 0x0170, 0x2004, 0x9084, 0x00ff, 0x9086, 0x004c,
+	0x1118, 0x2091, 0x30bd, 0x0817, 0x2091, 0x303d, 0x0817, 0x6000,
+	0x9086, 0x0000, 0x0904, 0x31c3, 0x2069, 0x1853, 0x7890, 0x6842,
+	0x7894, 0x6846, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0x2039, 0x0001, 0x0804, 0x465e, 0x9006, 0x080c, 0x253f,
+	0x81ff, 0x1904, 0x31c3, 0x080c, 0x6c53, 0x11b0, 0x080c, 0x6f2a,
+	0x080c, 0x5a21, 0x080c, 0x2f86, 0x0118, 0x6130, 0xc18d, 0x6132,
+	0x080c, 0xbcec, 0x0130, 0x080c, 0x6c76, 0x1118, 0x080c, 0x6c2d,
+	0x0038, 0x080c, 0x6b8a, 0x0020, 0x080c, 0x59e6, 0x080c, 0x58e0,
+	0x0804, 0x3191, 0x81ff, 0x1904, 0x31c3, 0x080c, 0x6c53, 0x1110,
+	0x0804, 0x31c3, 0x618c, 0x81ff, 0x01a8, 0x704f, 0x0000, 0x2001,
+	0x1c80, 0x2009, 0x0040, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0126,
+	0x2091, 0x8000, 0x2039, 0x0001, 0x080c, 0x465e, 0x701f, 0x318f,
+	0x012e, 0x0005, 0x704f, 0x0001, 0x00d6, 0x2069, 0x1c80, 0x20a9,
+	0x0040, 0x20e9, 0x0001, 0x20a1, 0x1c80, 0x2019, 0xffff, 0x4304,
+	0x6554, 0x9588, 0x2f92, 0x210d, 0x918c, 0x00ff, 0x216a, 0x900e,
+	0x2011, 0x0002, 0x2100, 0x9506, 0x01a8, 0x080c, 0x5f7e, 0x1190,
+	0xb814, 0x821c, 0x0238, 0x9398, 0x1c80, 0x9085, 0xff00, 0x8007,
+	0x201a, 0x0038, 0x9398, 0x1c80, 0x2324, 0x94a4, 0xff00, 0x9405,
+	0x201a, 0x8210, 0x8108, 0x9182, 0x0080, 0x1208, 0x0c18, 0x8201,
+	0x8007, 0x2d0c, 0x9105, 0x206a, 0x00de, 0x20a9, 0x0040, 0x20a1,
+	0x1c80, 0x2099, 0x1c80, 0x080c, 0x5971, 0x0804, 0x4097, 0x080c,
+	0x4645, 0x0904, 0x31c6, 0x080c, 0x4612, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x31c3, 0x080c, 0x5113, 0xd0b4, 0x0558, 0x7884, 0x908e,
+	0x007e, 0x0538, 0x908e, 0x007f, 0x0520, 0x908e, 0x0080, 0x0508,
+	0x080c, 0x2f81, 0x1148, 0xb800, 0xd08c, 0x11d8, 0xb804, 0x9084,
+	0x00ff, 0x9086, 0x0006, 0x11a8, 0xa867, 0x0000, 0xa868, 0xc0fd,
+	0xa86a, 0x080c, 0xb7bd, 0x1120, 0x2009, 0x0003, 0x0804, 0x31c3,
+	0x7007, 0x0003, 0x701f, 0x4125, 0x0005, 0x080c, 0x4645, 0x0904,
+	0x31c6, 0x20a9, 0x002b, 0xb8b4, 0x20e0, 0xb8b8, 0x2098, 0xa860,
+	0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008,
+	0x9080, 0x0006, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006,
+	0x2098, 0x080c, 0x0f52, 0x0070, 0x20a9, 0x0004, 0xa85c, 0x9080,
+	0x000a, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x000a, 0x2098,
+	0x080c, 0x0f52, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
+	0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0x0804, 0x465e, 0x81ff, 0x1904, 0x31c3, 0x080c, 0x4629,
+	0x0904, 0x31c6, 0x080c, 0x60f0, 0x0904, 0x31c3, 0x0058, 0xa878,
+	0x9005, 0x0120, 0x2009, 0x0004, 0x0804, 0x31c3, 0xa974, 0xaa94,
+	0x0804, 0x3191, 0x080c, 0x511b, 0x0904, 0x3191, 0x701f, 0x416f,
+	0x7007, 0x0003, 0x0005, 0x81ff, 0x1904, 0x31c3, 0x7888, 0x908a,
+	0x1000, 0x1a04, 0x31c6, 0x080c, 0x4645, 0x0904, 0x31c6, 0x080c,
+	0x62a4, 0x0120, 0x080c, 0x62ac, 0x1904, 0x31c6, 0x080c, 0x6175,
+	0x0904, 0x31c3, 0x2019, 0x0004, 0x900e, 0x080c, 0x6102, 0x0904,
+	0x31c3, 0x7984, 0x7a88, 0x04c9, 0x08a8, 0xa89c, 0x908a, 0x1000,
+	0x12f8, 0x080c, 0x4643, 0x01e0, 0x080c, 0x62a4, 0x0118, 0x080c,
+	0x62ac, 0x11b0, 0x080c, 0x6175, 0x2009, 0x0002, 0x0168, 0x2009,
+	0x0002, 0x2019, 0x0004, 0x080c, 0x6102, 0x2009, 0x0003, 0x0120,
+	0xa998, 0xaa9c, 0x00d1, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010,
+	0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005,
+	0xa897, 0x4000, 0x080c, 0x511b, 0x0110, 0x9006, 0x0018, 0x900e,
+	0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x9186, 0x00ff, 0x0110,
+	0x0071, 0x0060, 0x2029, 0x007e, 0x2061, 0x1800, 0x6454, 0x2400,
+	0x9506, 0x0110, 0x2508, 0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c,
+	0x5f7e, 0x1138, 0x2200, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c,
+	0x7c58, 0x0005, 0x81ff, 0x1904, 0x31c3, 0x080c, 0x4629, 0x0904,
+	0x31c6, 0x080c, 0x6045, 0x0904, 0x31c3, 0x080c, 0x60f9, 0x0904,
+	0x31c3, 0x0804, 0x417a, 0x81ff, 0x1904, 0x31c3, 0x080c, 0x4629,
+	0x0904, 0x31c6, 0x080c, 0x6045, 0x0904, 0x31c3, 0x080c, 0x60e7,
+	0x0904, 0x31c3, 0x0804, 0x417a, 0x6100, 0x0804, 0x3191, 0x080c,
+	0x4645, 0x0904, 0x31c6, 0x080c, 0x5127, 0x1904, 0x31c3, 0x79a8,
+	0xd184, 0x1158, 0xb834, 0x8007, 0x789e, 0xb830, 0x8007, 0x789a,
+	0xbb2c, 0x831f, 0xba28, 0x8217, 0x0050, 0xb824, 0x8007, 0x789e,
+	0xb820, 0x8007, 0x789a, 0xbb1c, 0x831f, 0xba18, 0x8217, 0xb900,
+	0x918c, 0x0200, 0x0804, 0x3191, 0x78a8, 0x909c, 0x0003, 0xd0b4,
+	0x1140, 0x939a, 0x0003, 0x1a04, 0x31c3, 0x6254, 0x7884, 0x9206,
+	0x1560, 0x2031, 0x1848, 0x2009, 0x013c, 0x2136, 0x2001, 0x1840,
+	0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001,
+	0x0006, 0x78a8, 0x9084, 0x0080, 0x1118, 0x000e, 0x0804, 0x465e,
+	0x000e, 0x2031, 0x0000, 0x2061, 0x18ae, 0x2c44, 0xa66a, 0xa17a,
+	0xa772, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x10b5,
+	0x7007, 0x0002, 0x701f, 0x429d, 0x0005, 0x81ff, 0x1904, 0x31c3,
+	0x080c, 0x4645, 0x0904, 0x31c6, 0x080c, 0x62a4, 0x1904, 0x31c3,
+	0x00c6, 0x080c, 0x4612, 0x00ce, 0x0904, 0x31c3, 0xa867, 0x0000,
+	0xa868, 0xc0fd, 0xa86a, 0x7ea8, 0x080c, 0xb763, 0x0904, 0x31c3,
+	0x7007, 0x0003, 0x701f, 0x42a1, 0x0005, 0x080c, 0x3e75, 0x0804,
+	0x3191, 0xa830, 0x9086, 0x0100, 0x0904, 0x31c3, 0x8906, 0x8006,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x2009,
+	0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x465e, 0x9006,
+	0x080c, 0x253f, 0x78a8, 0x9084, 0x00ff, 0x9086, 0x00ff, 0x0118,
+	0x81ff, 0x1904, 0x31c3, 0x080c, 0x6c53, 0x0110, 0x080c, 0x59e6,
+	0x7888, 0x908a, 0x1000, 0x1a04, 0x31c6, 0x7984, 0x9186, 0x00ff,
+	0x0138, 0x9182, 0x007f, 0x1a04, 0x31c6, 0x2100, 0x080c, 0x2509,
+	0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x2061, 0x19c9, 0x601b,
+	0x0000, 0x601f, 0x0000, 0x6073, 0x0000, 0x6077, 0x0000, 0x080c,
+	0x6c53, 0x1158, 0x080c, 0x6f2a, 0x080c, 0x5a21, 0x9085, 0x0001,
+	0x080c, 0x6c9a, 0x080c, 0x6b8a, 0x00d0, 0x080c, 0x9947, 0x2061,
+	0x0100, 0x2001, 0x1816, 0x2004, 0x9084, 0x00ff, 0x810f, 0x9105,
+	0x604a, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x1968, 0x200b,
+	0x0000, 0x2009, 0x002d, 0x2011, 0x590c, 0x080c, 0x7cd9, 0x7984,
+	0x080c, 0x6c53, 0x1110, 0x2009, 0x00ff, 0x7a88, 0x080c, 0x41dd,
+	0x012e, 0x00ce, 0x002e, 0x0804, 0x3191, 0x7984, 0x080c, 0x5f1e,
+	0x2b08, 0x1904, 0x31c6, 0x0804, 0x3191, 0x81ff, 0x0120, 0x2009,
+	0x0001, 0x0804, 0x31c3, 0x60d4, 0xd0ac, 0x1130, 0xd09c, 0x1120,
+	0x2009, 0x0005, 0x0804, 0x31c3, 0x080c, 0x4612, 0x1120, 0x2009,
+	0x0002, 0x0804, 0x31c3, 0x7984, 0x9192, 0x0021, 0x1a04, 0x31c6,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0x702a,
+	0xaf60, 0x7736, 0x080c, 0x465b, 0x701f, 0x4355, 0x7880, 0x9086,
+	0x006e, 0x0110, 0x701f, 0x4be0, 0x0005, 0x2009, 0x0080, 0x080c,
+	0x5f7e, 0x1118, 0x080c, 0x62a4, 0x0120, 0x2021, 0x400a, 0x0804,
+	0x3193, 0x00d6, 0x0096, 0xa964, 0xaa6c, 0xab70, 0xac74, 0xad78,
+	0xae7c, 0xa884, 0x90be, 0x0100, 0x0904, 0x43ee, 0x90be, 0x0112,
+	0x0904, 0x43ee, 0x90be, 0x0113, 0x0904, 0x43ee, 0x90be, 0x0114,
+	0x0904, 0x43ee, 0x90be, 0x0117, 0x0904, 0x43ee, 0x90be, 0x011a,
+	0x0904, 0x43ee, 0x90be, 0x011c, 0x0904, 0x43ee, 0x90be, 0x0121,
+	0x0904, 0x43d5, 0x90be, 0x0131, 0x0904, 0x43d5, 0x90be, 0x0171,
+	0x0904, 0x43ee, 0x90be, 0x0173, 0x0904, 0x43ee, 0x90be, 0x01a1,
+	0x1128, 0xa894, 0x8007, 0xa896, 0x0804, 0x43f9, 0x90be, 0x0212,
+	0x0904, 0x43e2, 0x90be, 0x0213, 0x05e8, 0x90be, 0x0214, 0x0500,
+	0x90be, 0x0217, 0x0188, 0x90be, 0x021a, 0x1120, 0xa89c, 0x8007,
+	0xa89e, 0x04e0, 0x90be, 0x021f, 0x05c8, 0x90be, 0x0300, 0x05b0,
+	0x009e, 0x00de, 0x0804, 0x31c6, 0x7028, 0x9080, 0x0010, 0x2098,
+	0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0007, 0x080c, 0x4437,
+	0x7028, 0x9080, 0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8,
+	0x20a9, 0x0001, 0x080c, 0x4437, 0x00c8, 0x7028, 0x9080, 0x000c,
+	0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c,
+	0x4444, 0x00b8, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0, 0x7034,
+	0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x4444, 0x7028, 0x9080,
+	0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001,
+	0x04f1, 0x00c6, 0x080c, 0x4612, 0x0550, 0xa868, 0xc0fd, 0xa86a,
+	0xa867, 0x0119, 0x9006, 0xa882, 0xa87f, 0x0020, 0xa88b, 0x0001,
+	0x810b, 0xa9ae, 0xa8b2, 0xaab6, 0xabba, 0xacbe, 0xadc2, 0xa9c6,
+	0xa8ca, 0x00ce, 0x009e, 0x00de, 0xa866, 0xa822, 0xa868, 0xc0fd,
+	0xa86a, 0xa804, 0x2048, 0x080c, 0xb77e, 0x1120, 0x2009, 0x0003,
+	0x0804, 0x31c3, 0x7007, 0x0003, 0x701f, 0x442e, 0x0005, 0x00ce,
+	0x009e, 0x00de, 0x2009, 0x0002, 0x0804, 0x31c3, 0xa820, 0x9086,
+	0x8001, 0x1904, 0x3191, 0x2009, 0x0004, 0x0804, 0x31c3, 0x0016,
+	0x0026, 0x3510, 0x20a9, 0x0002, 0x4002, 0x4104, 0x4004, 0x8211,
+	0x1dc8, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026, 0x0036, 0x0046,
+	0x3520, 0x20a9, 0x0004, 0x4002, 0x4304, 0x4204, 0x4104, 0x4004,
+	0x8421, 0x1db8, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x81ff,
+	0x0120, 0x2009, 0x0001, 0x0804, 0x31c3, 0x60d4, 0xd0ac, 0x1130,
+	0xd09c, 0x1120, 0x2009, 0x0005, 0x0804, 0x31c3, 0x7984, 0x78a8,
+	0x2040, 0x080c, 0x9940, 0x1120, 0x9182, 0x007f, 0x0a04, 0x31c6,
+	0x9186, 0x00ff, 0x0904, 0x31c6, 0x9182, 0x0800, 0x1a04, 0x31c6,
+	0x7a8c, 0x7b88, 0x6074, 0x9306, 0x1140, 0x6078, 0x924e, 0x0904,
+	0x31c6, 0x99cc, 0xff00, 0x0904, 0x31c6, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x452c, 0x0560, 0x90c6, 0x4000, 0x1170, 0x00c6, 0x0006,
+	0x900e, 0x080c, 0x619e, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
+	0xc18d, 0x000e, 0x00ce, 0x00b8, 0x90c6, 0x4007, 0x1110, 0x2408,
+	0x0090, 0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0060, 0x90c6,
+	0x4009, 0x1108, 0x0040, 0x90c6, 0x4006, 0x1108, 0x0020, 0x2001,
+	0x4005, 0x2009, 0x000a, 0x2020, 0x012e, 0x0804, 0x3193, 0x2b00,
+	0x7026, 0x0016, 0x00b6, 0x00c6, 0x00e6, 0x2c70, 0x080c, 0x9a23,
+	0x0904, 0x4501, 0x2b00, 0x6012, 0x080c, 0xba69, 0x2e58, 0x00ee,
+	0x00e6, 0x00c6, 0x080c, 0x4612, 0x00ce, 0x2b70, 0x1158, 0x080c,
+	0x99d6, 0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x2009, 0x0002,
+	0x0804, 0x31c3, 0x900e, 0xa966, 0xa96a, 0x2900, 0x6016, 0xa932,
+	0xa868, 0xc0fd, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0x080c, 0x2e30,
+	0x6023, 0x0001, 0x9006, 0x080c, 0x5ebb, 0x2001, 0x0002, 0x080c,
+	0x5ecf, 0x2009, 0x0002, 0x080c, 0x9a50, 0x78a8, 0xd094, 0x0138,
+	0x00ee, 0x7024, 0x00e6, 0x2058, 0xb8bc, 0xc08d, 0xb8be, 0x9085,
+	0x0001, 0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x1120, 0x2009,
+	0x0003, 0x0804, 0x31c3, 0x7007, 0x0003, 0x701f, 0x4510, 0x0005,
+	0xa830, 0x9086, 0x0100, 0x7024, 0x2058, 0x1138, 0x2009, 0x0004,
+	0xba04, 0x9294, 0x00ff, 0x0804, 0x5070, 0x900e, 0xa868, 0xd0f4,
+	0x1904, 0x3191, 0x080c, 0x619e, 0x1108, 0xc185, 0xb800, 0xd0bc,
+	0x0108, 0xc18d, 0x0804, 0x3191, 0x00e6, 0x00d6, 0x0096, 0x83ff,
+	0x0904, 0x4574, 0x902e, 0x080c, 0x9940, 0x0130, 0x9026, 0x20a9,
+	0x0800, 0x2071, 0x1000, 0x0030, 0x2021, 0x007f, 0x20a9, 0x0781,
+	0x2071, 0x107f, 0x2e04, 0x9005, 0x11b0, 0x2100, 0x9406, 0x15e8,
+	0x2428, 0x94ce, 0x007f, 0x1120, 0x92ce, 0xfffd, 0x1528, 0x0030,
+	0x94ce, 0x0080, 0x1130, 0x92ce, 0xfffc, 0x11f0, 0x93ce, 0x00ff,
+	0x11d8, 0xc5fd, 0x0450, 0x2058, 0xbf10, 0x2700, 0x9306, 0x11b8,
+	0xbe14, 0x2600, 0x9206, 0x1198, 0x2400, 0x9106, 0x1150, 0xd884,
+	0x0568, 0xd894, 0x1558, 0x080c, 0x62a4, 0x1540, 0x2001, 0x4000,
+	0x0430, 0x2001, 0x4007, 0x0418, 0x2001, 0x4006, 0x0400, 0x2400,
+	0x9106, 0x1158, 0xbe14, 0x87ff, 0x1128, 0x86ff, 0x0948, 0x080c,
+	0x9940, 0x1930, 0x2001, 0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04,
+	0x4542, 0x85ff, 0x1130, 0x2001, 0x4009, 0x0048, 0x2001, 0x0001,
+	0x0030, 0x080c, 0x5f1e, 0x1dd0, 0xbb12, 0xba16, 0x9006, 0x9005,
+	0x009e, 0x00de, 0x00ee, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001,
+	0x0804, 0x31c3, 0x080c, 0x4612, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x31c3, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7884, 0x9005,
+	0x0904, 0x31c6, 0x9096, 0x00ff, 0x0120, 0x9092, 0x0004, 0x1a04,
+	0x31c6, 0x2010, 0x2918, 0x080c, 0x2dd6, 0x1120, 0x2009, 0x0003,
+	0x0804, 0x31c3, 0x7007, 0x0003, 0x701f, 0x45c7, 0x0005, 0xa830,
+	0x9086, 0x0100, 0x1904, 0x3191, 0x2009, 0x0004, 0x0804, 0x31c3,
+	0x7984, 0x080c, 0x9940, 0x1120, 0x9182, 0x007f, 0x0a04, 0x31c6,
+	0x9186, 0x00ff, 0x0904, 0x31c6, 0x9182, 0x0800, 0x1a04, 0x31c6,
+	0x2001, 0x9000, 0x080c, 0x50cb, 0x1904, 0x31c3, 0x0804, 0x3191,
+	0xa998, 0x080c, 0x9940, 0x1118, 0x9182, 0x007f, 0x0280, 0x9186,
+	0x00ff, 0x0168, 0x9182, 0x0800, 0x1250, 0x2001, 0x9000, 0x080c,
+	0x50cb, 0x11a8, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
+	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
+	0x4000, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x2009,
+	0x000a, 0x0c48, 0x080c, 0x0fd5, 0x0198, 0x9006, 0xa802, 0x7014,
+	0x9005, 0x1120, 0x2900, 0x7016, 0x701a, 0x0040, 0x7018, 0xa802,
+	0x0086, 0x2040, 0x2900, 0xa006, 0x701a, 0x008e, 0x9085, 0x0001,
+	0x0005, 0x7984, 0x080c, 0x5f7e, 0x1130, 0x7e88, 0x9684, 0x3fff,
+	0x9082, 0x4000, 0x0208, 0x905e, 0x8bff, 0x0005, 0xa998, 0x080c,
+	0x5f7e, 0x1130, 0xae9c, 0x9684, 0x3fff, 0x9082, 0x4000, 0x0208,
+	0x905e, 0x8bff, 0x0005, 0xae98, 0x0008, 0x7e84, 0x2608, 0x080c,
+	0x5f7e, 0x1108, 0x0008, 0x905e, 0x8bff, 0x0005, 0x0016, 0x7114,
+	0x81ff, 0x0128, 0x2148, 0xa904, 0x080c, 0x1007, 0x0cc8, 0x7116,
+	0x711a, 0x001e, 0x0005, 0x2031, 0x0001, 0x0010, 0x2031, 0x0000,
+	0x2061, 0x18ae, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e,
+	0xa392, 0xa496, 0xa59a, 0x080c, 0x10b5, 0x7007, 0x0002, 0x701f,
+	0x3191, 0x0005, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0000,
+	0x2001, 0x18a6, 0x2004, 0x9005, 0x1190, 0x0e04, 0x468f, 0x7a36,
+	0x7833, 0x0012, 0x7a82, 0x7b86, 0x7c8a, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x190c, 0x1167, 0x0804, 0x46f5, 0x0016,
+	0x0086, 0x0096, 0x00c6, 0x00e6, 0x2071, 0x1894, 0x7044, 0x9005,
+	0x1540, 0x7148, 0x9182, 0x0010, 0x0288, 0x7038, 0x2060, 0x080c,
+	0x0fd5, 0x0904, 0x46ed, 0xa84b, 0x0000, 0x2900, 0x7046, 0x2001,
+	0x0002, 0x9080, 0x1da2, 0x2005, 0xa846, 0x0098, 0x7038, 0x90e0,
+	0x0004, 0x2001, 0x18b0, 0x9c82, 0x18f0, 0x0210, 0x2061, 0x18b0,
+	0x2c00, 0x703a, 0x7148, 0x81ff, 0x1108, 0x703e, 0x8108, 0x714a,
+	0x0460, 0x7148, 0x8108, 0x714a, 0x7044, 0x2040, 0xa144, 0x2105,
+	0x0016, 0x908a, 0x0036, 0x1a0c, 0x0db2, 0x2060, 0x001e, 0x8108,
+	0x2105, 0x9005, 0xa146, 0x1520, 0x080c, 0x0fd5, 0x1130, 0x8109,
+	0xa946, 0x7148, 0x8109, 0x714a, 0x00d8, 0x9006, 0xa806, 0xa84a,
+	0xa046, 0x2800, 0xa802, 0x2900, 0xa006, 0x7046, 0x2001, 0x0002,
+	0x9080, 0x1da2, 0x2005, 0xa846, 0x0058, 0x2262, 0x6306, 0x640a,
+	0x00ee, 0x00ce, 0x009e, 0x008e, 0x001e, 0x012e, 0x00fe, 0x0005,
+	0x2c00, 0x9082, 0x001b, 0x0002, 0x4717, 0x4717, 0x4719, 0x4717,
+	0x4717, 0x4717, 0x471d, 0x4717, 0x4717, 0x4717, 0x4721, 0x4717,
+	0x4717, 0x4717, 0x4725, 0x4717, 0x4717, 0x4717, 0x4729, 0x4717,
+	0x4717, 0x4717, 0x472d, 0x4717, 0x4717, 0x4717, 0x4732, 0x080c,
+	0x0db2, 0xa276, 0xa37a, 0xa47e, 0x0898, 0xa286, 0xa38a, 0xa48e,
+	0x0878, 0xa296, 0xa39a, 0xa49e, 0x0858, 0xa2a6, 0xa3aa, 0xa4ae,
+	0x0838, 0xa2b6, 0xa3ba, 0xa4be, 0x0818, 0xa2c6, 0xa3ca, 0xa4ce,
+	0x0804, 0x46f0, 0xa2d6, 0xa3da, 0xa4de, 0x0804, 0x46f0, 0x00e6,
+	0x2071, 0x1894, 0x7048, 0x9005, 0x0904, 0x47c9, 0x0126, 0x2091,
+	0x8000, 0x0e04, 0x47c8, 0x00f6, 0x2079, 0x0000, 0x00c6, 0x0096,
+	0x0086, 0x0076, 0x9006, 0x2038, 0x7040, 0x2048, 0x9005, 0x0500,
+	0xa948, 0x2105, 0x0016, 0x908a, 0x0036, 0x1a0c, 0x0db2, 0x2060,
+	0x001e, 0x8108, 0x2105, 0x9005, 0xa94a, 0x1904, 0x47cb, 0xa804,
+	0x9005, 0x090c, 0x0db2, 0x7042, 0x2938, 0x2040, 0xa003, 0x0000,
+	0x2001, 0x0002, 0x9080, 0x1da2, 0x2005, 0xa04a, 0x0804, 0x47cb,
+	0x703c, 0x2060, 0x2c14, 0x6304, 0x6408, 0x650c, 0x2200, 0x7836,
+	0x7833, 0x0012, 0x7882, 0x2300, 0x7886, 0x2400, 0x788a, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1167, 0x87ff,
+	0x0118, 0x2748, 0x080c, 0x1007, 0x7048, 0x8001, 0x704a, 0x9005,
+	0x1170, 0x7040, 0x2048, 0x9005, 0x0128, 0x080c, 0x1007, 0x9006,
+	0x7042, 0x7046, 0x703b, 0x18b0, 0x703f, 0x18b0, 0x0420, 0x7040,
+	0x9005, 0x1508, 0x7238, 0x2c00, 0x9206, 0x0148, 0x9c80, 0x0004,
+	0x90fa, 0x18f0, 0x0210, 0x2001, 0x18b0, 0x703e, 0x00a0, 0x9006,
+	0x703e, 0x703a, 0x7044, 0x9005, 0x090c, 0x0db2, 0x2048, 0xa800,
+	0x9005, 0x1de0, 0x2900, 0x7042, 0x2001, 0x0002, 0x9080, 0x1da2,
+	0x2005, 0xa84a, 0x0000, 0x007e, 0x008e, 0x009e, 0x00ce, 0x00fe,
+	0x012e, 0x00ee, 0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x47ea,
+	0x47ea, 0x47ec, 0x47ea, 0x47ea, 0x47ea, 0x47f1, 0x47ea, 0x47ea,
+	0x47ea, 0x47f6, 0x47ea, 0x47ea, 0x47ea, 0x47fb, 0x47ea, 0x47ea,
+	0x47ea, 0x4800, 0x47ea, 0x47ea, 0x47ea, 0x4805, 0x47ea, 0x47ea,
+	0x47ea, 0x480a, 0x080c, 0x0db2, 0xaa74, 0xab78, 0xac7c, 0x0804,
+	0x4776, 0xaa84, 0xab88, 0xac8c, 0x0804, 0x4776, 0xaa94, 0xab98,
+	0xac9c, 0x0804, 0x4776, 0xaaa4, 0xaba8, 0xacac, 0x0804, 0x4776,
+	0xaab4, 0xabb8, 0xacbc, 0x0804, 0x4776, 0xaac4, 0xabc8, 0xaccc,
+	0x0804, 0x4776, 0xaad4, 0xabd8, 0xacdc, 0x0804, 0x4776, 0x0016,
+	0x0026, 0x0036, 0x00b6, 0x00c6, 0x2009, 0x007e, 0x080c, 0x5f7e,
+	0x2019, 0x0001, 0xb85c, 0xd0ac, 0x0110, 0x2019, 0x0000, 0x2011,
+	0x801b, 0x080c, 0x4672, 0x00ce, 0x00be, 0x003e, 0x002e, 0x001e,
+	0x0005, 0x0026, 0x080c, 0x5113, 0xd0c4, 0x0120, 0x2011, 0x8014,
+	0x080c, 0x4672, 0x002e, 0x0005, 0x81ff, 0x1904, 0x31c3, 0x0126,
+	0x2091, 0x8000, 0x6030, 0xc08d, 0xc085, 0xc0ac, 0x6032, 0x080c,
+	0x6c53, 0x1158, 0x080c, 0x6f2a, 0x080c, 0x5a21, 0x9085, 0x0001,
+	0x080c, 0x6c9a, 0x080c, 0x6b8a, 0x0010, 0x080c, 0x58e0, 0x012e,
+	0x0804, 0x3191, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x31c3,
+	0x080c, 0x5127, 0x0120, 0x2009, 0x0007, 0x0804, 0x31c3, 0x080c,
+	0x629c, 0x0120, 0x2009, 0x0008, 0x0804, 0x31c3, 0x080c, 0x2f81,
+	0x0128, 0x7984, 0x080c, 0x5f1e, 0x1904, 0x31c6, 0x080c, 0x4645,
+	0x0904, 0x31c6, 0x2b00, 0x7026, 0x080c, 0x62a4, 0x7888, 0x1170,
+	0x9084, 0x0005, 0x1158, 0x900e, 0x080c, 0x619e, 0x1108, 0xc185,
+	0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x3191, 0x080c, 0x4612,
+	0x0904, 0x31c3, 0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a,
+	0x080c, 0xb817, 0x0904, 0x31c3, 0x7888, 0xd094, 0x0118, 0xb8bc,
+	0xc08d, 0xb8be, 0x7007, 0x0003, 0x701f, 0x48eb, 0x0005, 0x2061,
+	0x1800, 0x080c, 0x5127, 0x2009, 0x0007, 0x1578, 0x080c, 0x629c,
+	0x0118, 0x2009, 0x0008, 0x0448, 0x080c, 0x2f81, 0x0120, 0xa998,
+	0x080c, 0x5f1e, 0x1530, 0x080c, 0x4643, 0x0518, 0x080c, 0x62a4,
+	0xa89c, 0x1168, 0x9084, 0x0005, 0x1150, 0x900e, 0x080c, 0x619e,
+	0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x00d0, 0xa868,
+	0xc0fc, 0xa86a, 0x080c, 0xb817, 0x11e0, 0xa89c, 0xd094, 0x0118,
+	0xb8bc, 0xc08d, 0xb8be, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a,
+	0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030,
+	0x0005, 0xa897, 0x4000, 0xa99a, 0x9006, 0x918d, 0x0001, 0x2008,
+	0x0005, 0x9006, 0x0005, 0xa830, 0x9086, 0x0100, 0x7024, 0x2058,
+	0x1110, 0x0804, 0x5070, 0x900e, 0x080c, 0x619e, 0x1108, 0xc185,
+	0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x3191, 0x080c, 0x5127,
+	0x0120, 0x2009, 0x0007, 0x0804, 0x31c3, 0x7f84, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0x080c, 0x4612, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x31c3, 0x900e, 0x2130, 0x7126, 0x7132, 0xa860, 0x20e8, 0x7036,
+	0xa85c, 0x9080, 0x0005, 0x702a, 0x20a0, 0x080c, 0x5f7e, 0x1904,
+	0x4981, 0x080c, 0x62a4, 0x0120, 0x080c, 0x62ac, 0x1904, 0x4981,
+	0x080c, 0x629c, 0x1130, 0x080c, 0x619e, 0x1118, 0xd79c, 0x0904,
+	0x4981, 0xd794, 0x1110, 0xd784, 0x01a8, 0xb8b4, 0x20e0, 0xb8b8,
+	0x9080, 0x0006, 0x2098, 0x3400, 0xd794, 0x0160, 0x20a9, 0x0008,
+	0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x20a9, 0x0002, 0x080c,
+	0x4444, 0x0048, 0x20a9, 0x0004, 0x4003, 0x2098, 0x20a0, 0x3d00,
+	0x20e0, 0x080c, 0x4444, 0x4104, 0xd794, 0x0528, 0xb8b4, 0x20e0,
+	0xb8b8, 0x2060, 0x9c80, 0x0000, 0x2098, 0x20a9, 0x0002, 0x4003,
+	0x9c80, 0x0003, 0x2098, 0x20a9, 0x0001, 0x4005, 0x9c80, 0x0004,
+	0x2098, 0x3400, 0x20a9, 0x0002, 0x4003, 0x2098, 0x20a0, 0x3d00,
+	0x20e0, 0x080c, 0x4437, 0x9c80, 0x0026, 0x2098, 0xb8b4, 0x20e0,
+	0x20a9, 0x0002, 0x4003, 0xd794, 0x0110, 0x96b0, 0x000b, 0x96b0,
+	0x0005, 0x8108, 0x080c, 0x9940, 0x0118, 0x9186, 0x0800, 0x0040,
+	0xd78c, 0x0120, 0x9186, 0x0800, 0x0170, 0x0018, 0x9186, 0x007e,
+	0x0150, 0xd794, 0x0118, 0x9686, 0x0020, 0x0010, 0x9686, 0x0028,
+	0x0150, 0x0804, 0x491d, 0x86ff, 0x1120, 0x7124, 0x810b, 0x0804,
+	0x3191, 0x7033, 0x0001, 0x7122, 0x7024, 0x9600, 0x7026, 0x772e,
+	0x2061, 0x18ae, 0x2c44, 0xa06b, 0x0000, 0xa67a, 0x7034, 0xa072,
+	0x7028, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x10b5,
+	0x7007, 0x0002, 0x701f, 0x49bd, 0x0005, 0x7030, 0x9005, 0x1180,
+	0x7120, 0x7028, 0x20a0, 0x772c, 0x9036, 0x7034, 0x20e8, 0x2061,
+	0x18ae, 0x2c44, 0xa28c, 0xa390, 0xa494, 0xa598, 0x0804, 0x491d,
+	0x7124, 0x810b, 0x0804, 0x3191, 0x2029, 0x007e, 0x7984, 0x7a88,
+	0x7b8c, 0x7c98, 0x9184, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04,
+	0x31c6, 0x9502, 0x0a04, 0x31c6, 0x9184, 0x00ff, 0x90e2, 0x0020,
+	0x0a04, 0x31c6, 0x9502, 0x0a04, 0x31c6, 0x9284, 0xff00, 0x8007,
+	0x90e2, 0x0020, 0x0a04, 0x31c6, 0x9502, 0x0a04, 0x31c6, 0x9284,
+	0x00ff, 0x90e2, 0x0020, 0x0a04, 0x31c6, 0x9502, 0x0a04, 0x31c6,
+	0x9384, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x31c6, 0x9502,
+	0x0a04, 0x31c6, 0x9384, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x31c6,
+	0x9502, 0x0a04, 0x31c6, 0x9484, 0xff00, 0x8007, 0x90e2, 0x0020,
+	0x0a04, 0x31c6, 0x9502, 0x0a04, 0x31c6, 0x9484, 0x00ff, 0x90e2,
+	0x0020, 0x0a04, 0x31c6, 0x9502, 0x0a04, 0x31c6, 0x2061, 0x1958,
+	0x6102, 0x6206, 0x630a, 0x640e, 0x0804, 0x3191, 0x0006, 0x080c,
+	0x5113, 0xd0cc, 0x000e, 0x0005, 0x0006, 0x080c, 0x5117, 0xd0bc,
+	0x000e, 0x0005, 0x616c, 0x7a84, 0x6300, 0x82ff, 0x1118, 0x7986,
+	0x0804, 0x3191, 0x83ff, 0x1904, 0x31c6, 0x2001, 0xfff0, 0x9200,
+	0x1a04, 0x31c6, 0x2019, 0xffff, 0x6070, 0x9302, 0x9200, 0x0a04,
+	0x31c6, 0x7986, 0x626e, 0x0804, 0x3191, 0x080c, 0x5127, 0x1904,
+	0x31c3, 0x7c88, 0x7d84, 0x7e98, 0x7f8c, 0x080c, 0x4612, 0x0904,
+	0x31c3, 0x900e, 0x901e, 0x7326, 0x7332, 0xa860, 0x20e8, 0x7036,
+	0xa85c, 0x9080, 0x0003, 0x702a, 0x20a0, 0x91d8, 0x1000, 0x2b5c,
+	0x8bff, 0x0178, 0x080c, 0x62a4, 0x0118, 0x080c, 0x62ac, 0x1148,
+	0x20a9, 0x0001, 0xb814, 0x4004, 0xb810, 0x4004, 0x4104, 0x9398,
+	0x0003, 0x8108, 0x9182, 0x0800, 0x0120, 0x9386, 0x003c, 0x0170,
+	0x0c20, 0x83ff, 0x1148, 0x7224, 0x900e, 0x2001, 0x0003, 0x080c,
+	0x7e7f, 0x2208, 0x0804, 0x3191, 0x7033, 0x0001, 0x7122, 0x7024,
+	0x9300, 0x7026, 0x2061, 0x18ae, 0x2c44, 0xa06b, 0x0000, 0xa37a,
+	0x7028, 0xa076, 0x7034, 0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a,
+	0x080c, 0x10b5, 0x7007, 0x0002, 0x701f, 0x4aaf, 0x0005, 0x7030,
+	0x9005, 0x1178, 0x7120, 0x7028, 0x20a0, 0x901e, 0x7034, 0x20e8,
+	0x2061, 0x18ae, 0x2c44, 0xa48c, 0xa590, 0xa694, 0xa798, 0x0804,
+	0x4a6d, 0x7224, 0x900e, 0x2001, 0x0003, 0x080c, 0x7e7f, 0x2208,
+	0x0804, 0x3191, 0x00f6, 0x00e6, 0x080c, 0x5127, 0x2009, 0x0007,
+	0x1904, 0x4b42, 0x2071, 0x1894, 0x745c, 0x84ff, 0x2009, 0x000e,
+	0x1904, 0x4b42, 0xac9c, 0xad98, 0xaea4, 0xafa0, 0x0096, 0x080c,
+	0x0fee, 0x2009, 0x0002, 0x0904, 0x4b42, 0x2900, 0x705e, 0x900e,
+	0x901e, 0x7356, 0x7362, 0xa860, 0x7066, 0xa85c, 0x9080, 0x0003,
+	0x705a, 0x20a0, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c,
+	0x62a4, 0x0118, 0x080c, 0x62ac, 0x1148, 0xb814, 0x20a9, 0x0001,
+	0x4004, 0xb810, 0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182,
+	0x0800, 0x0120, 0x9386, 0x003c, 0x01e8, 0x0c20, 0x83ff, 0x11c0,
+	0x7254, 0x900e, 0x2001, 0x0003, 0x080c, 0x7e7f, 0x2208, 0x009e,
+	0xa897, 0x4000, 0xa99a, 0x715c, 0x81ff, 0x090c, 0x0db2, 0x2148,
+	0x080c, 0x1007, 0x9006, 0x705e, 0x918d, 0x0001, 0x2008, 0x0418,
+	0x7063, 0x0001, 0x7152, 0x7054, 0x9300, 0x7056, 0x2061, 0x18af,
+	0x2c44, 0xa37a, 0x7058, 0xa076, 0x7064, 0xa072, 0xa48e, 0xa592,
+	0xa696, 0xa79a, 0xa09f, 0x4b4e, 0x000e, 0xa0a2, 0x080c, 0x10b5,
+	0x9006, 0x0048, 0x009e, 0xa897, 0x4005, 0xa99a, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0030, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0xa0a0,
+	0x904d, 0x090c, 0x0db2, 0x00e6, 0x2071, 0x1894, 0xa06c, 0x908e,
+	0x0100, 0x0138, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4002,
+	0x00d8, 0x7060, 0x9005, 0x1158, 0x7150, 0x7058, 0x20a0, 0x901e,
+	0x7064, 0x20e8, 0xa48c, 0xa590, 0xa694, 0xa798, 0x0428, 0xa87b,
+	0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x7254, 0x900e, 0x2001,
+	0x0003, 0x080c, 0x7e7f, 0xaa9a, 0x715c, 0x81ff, 0x090c, 0x0db2,
+	0x2148, 0x080c, 0x1007, 0x705f, 0x0000, 0xa0a0, 0x2048, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x6536, 0x012e, 0xa09f, 0x0000, 0xa0a3,
+	0x0000, 0x00ee, 0x00fe, 0x0005, 0x91d8, 0x1000, 0x2b5c, 0x8bff,
+	0x0178, 0x080c, 0x62a4, 0x0118, 0x080c, 0x62ac, 0x1148, 0xb814,
+	0x20a9, 0x0001, 0x4004, 0xb810, 0x4004, 0x4104, 0x9398, 0x0003,
+	0x8108, 0x9182, 0x0800, 0x0120, 0x9386, 0x003c, 0x0518, 0x0c20,
+	0x83ff, 0x11f0, 0x7154, 0x810c, 0xa99a, 0xa897, 0x4000, 0x715c,
+	0x81ff, 0x090c, 0x0db2, 0x2148, 0x080c, 0x1007, 0x9006, 0x705e,
+	0x918d, 0x0001, 0x2008, 0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6536, 0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x0070,
+	0x7063, 0x0001, 0x7152, 0x7054, 0x9300, 0x7056, 0xa37a, 0xa48e,
+	0xa592, 0xa696, 0xa79a, 0x080c, 0x10b5, 0x9006, 0x00ee, 0x0005,
+	0x0096, 0xa88c, 0x90be, 0x7000, 0x0148, 0x90be, 0x7100, 0x0130,
+	0x90be, 0x7200, 0x0118, 0x009e, 0x0804, 0x31c6, 0xa884, 0xa988,
+	0x080c, 0x24d6, 0x1518, 0x080c, 0x5f1e, 0x1500, 0x7126, 0xbe12,
+	0xbd16, 0xae7c, 0x080c, 0x4612, 0x01c8, 0x080c, 0x4612, 0x01b0,
+	0x009e, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0xa823, 0x0000,
+	0xa804, 0x2048, 0x080c, 0xb79e, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x31c3, 0x7007, 0x0003, 0x701f, 0x4c1b, 0x0005, 0x009e, 0x2009,
+	0x0002, 0x0804, 0x31c3, 0x7124, 0x080c, 0x2f28, 0xa820, 0x9086,
+	0x8001, 0x1120, 0x2009, 0x0004, 0x0804, 0x31c3, 0x2900, 0x7022,
+	0xa804, 0x0096, 0x2048, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f,
+	0x9084, 0xffc0, 0x009e, 0x9080, 0x0002, 0x0076, 0x0006, 0x2098,
+	0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a, 0x080c, 0x0f52, 0xaa6c,
+	0xab70, 0xac74, 0xad78, 0x2061, 0x18ae, 0x2c44, 0xa06b, 0x0000,
+	0xae64, 0xaf8c, 0x97c6, 0x7000, 0x0118, 0x97c6, 0x7100, 0x1148,
+	0x96c2, 0x0004, 0x0600, 0x2009, 0x0004, 0x000e, 0x007e, 0x0804,
+	0x465e, 0x97c6, 0x7200, 0x11b8, 0x96c2, 0x0054, 0x02a0, 0x000e,
+	0x007e, 0x2061, 0x18ae, 0x2c44, 0xa076, 0xa772, 0xa07b, 0x002a,
+	0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x10b5, 0x7007, 0x0002,
+	0x701f, 0x4c77, 0x0005, 0x000e, 0x007e, 0x0804, 0x31c6, 0x7020,
+	0x2048, 0xa804, 0x2048, 0xa804, 0x2048, 0x8906, 0x8006, 0x8007,
+	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2098, 0x20a0,
+	0x27e0, 0x27e8, 0x20a9, 0x002a, 0x080c, 0x0f52, 0x2100, 0x2238,
+	0x2061, 0x18ae, 0x2c44, 0xa28c, 0xa390, 0xa494, 0xa598, 0x2009,
+	0x002a, 0x0804, 0x465e, 0x81ff, 0x1904, 0x31c3, 0x798c, 0x2001,
+	0x194f, 0x2102, 0x080c, 0x4629, 0x0904, 0x31c6, 0x080c, 0x62a4,
+	0x0120, 0x080c, 0x62ac, 0x1904, 0x31c6, 0x080c, 0x6045, 0x0904,
+	0x31c3, 0x0126, 0x2091, 0x8000, 0x080c, 0x610b, 0x012e, 0x0904,
+	0x31c3, 0x0804, 0x417a, 0xa9a0, 0x2001, 0x194f, 0xc18d, 0x2102,
+	0x080c, 0x4636, 0x01a0, 0x080c, 0x62a4, 0x0118, 0x080c, 0x62ac,
+	0x1170, 0x080c, 0x6045, 0x2009, 0x0002, 0x0128, 0x080c, 0x610b,
+	0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
+	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
+	0x4000, 0x080c, 0x511b, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0000, 0x0005, 0x78a8, 0xd08c, 0x1118, 0xd084,
+	0x0904, 0x40ef, 0x080c, 0x4645, 0x0904, 0x31c6, 0x080c, 0x4612,
+	0x1120, 0x2009, 0x0002, 0x0804, 0x31c3, 0x080c, 0x62a4, 0x0130,
+	0x908e, 0x0004, 0x0118, 0x908e, 0x0005, 0x15a0, 0x78a8, 0xd08c,
+	0x0120, 0xb800, 0xc08c, 0xb802, 0x0028, 0x080c, 0x5113, 0xd0b4,
+	0x0904, 0x4129, 0x7884, 0x908e, 0x007e, 0x0904, 0x4129, 0x908e,
+	0x007f, 0x0904, 0x4129, 0x908e, 0x0080, 0x0904, 0x4129, 0xb800,
+	0xd08c, 0x1904, 0x4129, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
+	0x080c, 0xb7bd, 0x1120, 0x2009, 0x0003, 0x0804, 0x31c3, 0x7007,
+	0x0003, 0x701f, 0x4d34, 0x0005, 0x080c, 0x4645, 0x0904, 0x31c6,
+	0x0804, 0x4129, 0x080c, 0x2f81, 0x0108, 0x0005, 0x2009, 0x1832,
+	0x210c, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x31c3, 0x080c,
+	0x5127, 0x0120, 0x2009, 0x0007, 0x0804, 0x31c3, 0x080c, 0x629c,
+	0x0120, 0x2009, 0x0008, 0x0804, 0x31c3, 0xb89c, 0xd0a4, 0x1118,
+	0xd0ac, 0x1904, 0x4129, 0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd,
+	0xa86a, 0x080c, 0xb817, 0x1120, 0x2009, 0x0003, 0x0804, 0x31c3,
+	0x7007, 0x0003, 0x701f, 0x4d6d, 0x0005, 0xa830, 0x9086, 0x0100,
+	0x1120, 0x2009, 0x0004, 0x0804, 0x5070, 0x080c, 0x4645, 0x0904,
+	0x31c6, 0x0804, 0x4d06, 0x81ff, 0x2009, 0x0001, 0x1904, 0x31c3,
+	0x080c, 0x5127, 0x2009, 0x0007, 0x1904, 0x31c3, 0x080c, 0x629c,
+	0x0120, 0x2009, 0x0008, 0x0804, 0x31c3, 0x080c, 0x4645, 0x0904,
+	0x31c6, 0x080c, 0x62a4, 0x2009, 0x0009, 0x1904, 0x31c3, 0x080c,
+	0x4612, 0x2009, 0x0002, 0x0904, 0x31c3, 0x9006, 0xa866, 0xa832,
+	0xa868, 0xc0fd, 0xa86a, 0x7988, 0x9194, 0xff00, 0x918c, 0x00ff,
+	0x9006, 0x82ff, 0x1128, 0xc0ed, 0xa952, 0x798c, 0xa956, 0x0038,
+	0x928e, 0x0100, 0x1904, 0x31c6, 0xc0e5, 0xa952, 0xa956, 0xa83e,
+	0x080c, 0xba6a, 0x2009, 0x0003, 0x0904, 0x31c3, 0x7007, 0x0003,
+	0x701f, 0x4dc3, 0x0005, 0xa830, 0x9086, 0x0100, 0x2009, 0x0004,
+	0x0904, 0x31c3, 0x0804, 0x3191, 0x7aa8, 0x9284, 0xc000, 0x0148,
+	0xd2ec, 0x01a0, 0x080c, 0x5127, 0x1188, 0x2009, 0x0014, 0x0804,
+	0x31c3, 0xd2dc, 0x1568, 0x81ff, 0x2009, 0x0001, 0x1904, 0x31c3,
+	0x080c, 0x5127, 0x2009, 0x0007, 0x1904, 0x31c3, 0xd2f4, 0x0130,
+	0x9284, 0x5000, 0x080c, 0x50ee, 0x0804, 0x3191, 0xd2fc, 0x0158,
+	0x080c, 0x4645, 0x0904, 0x31c6, 0x7984, 0x9284, 0x9000, 0x080c,
+	0x50cb, 0x0804, 0x3191, 0x080c, 0x4645, 0x0904, 0x31c6, 0xb804,
+	0x9084, 0x00ff, 0x9086, 0x0006, 0x2009, 0x0009, 0x1904, 0x4eac,
+	0x080c, 0x4612, 0x2009, 0x0002, 0x0904, 0x4eac, 0xa85c, 0x9080,
+	0x001b, 0xaf60, 0x2009, 0x0008, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
+	0x080c, 0x465b, 0x701f, 0x4e1d, 0x0005, 0xa86c, 0x9086, 0x0500,
+	0x1138, 0xa870, 0x9005, 0x1120, 0xa874, 0x9084, 0xff00, 0x0110,
+	0x1904, 0x31c6, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c,
+	0x4645, 0x1110, 0x0804, 0x31c6, 0x2009, 0x0043, 0x080c, 0xbad2,
+	0x2009, 0x0003, 0x0904, 0x4eac, 0x7007, 0x0003, 0x701f, 0x4e41,
+	0x0005, 0xa830, 0x9086, 0x0100, 0x2009, 0x0004, 0x0904, 0x4eac,
+	0x7984, 0x7aa8, 0x9284, 0x1000, 0x080c, 0x50cb, 0x0804, 0x3191,
+	0x00c6, 0xaab0, 0x9284, 0xc000, 0x0140, 0xd2ec, 0x0168, 0x080c,
+	0x5127, 0x1150, 0x2009, 0x0014, 0x04f0, 0x2061, 0x1800, 0x080c,
+	0x5127, 0x2009, 0x0007, 0x15b8, 0xd2f4, 0x0128, 0x9284, 0x5000,
+	0x080c, 0x50ee, 0x0050, 0xd2fc, 0x0178, 0x080c, 0x4643, 0x0588,
+	0xa998, 0x9284, 0x9000, 0x080c, 0x50cb, 0xa87b, 0x0000, 0xa883,
+	0x0000, 0xa897, 0x4000, 0x0438, 0x080c, 0x4643, 0x0510, 0x080c,
+	0x62a4, 0x2009, 0x0009, 0x11b8, 0xa8c4, 0x9086, 0x0500, 0x11c8,
+	0xa8c8, 0x9005, 0x11b0, 0xa8cc, 0x9084, 0xff00, 0x1190, 0x080c,
+	0x4643, 0x1108, 0x0070, 0x2009, 0x004b, 0x080c, 0xbad2, 0x2009,
+	0x0003, 0x0108, 0x0078, 0x0429, 0x19c0, 0xa897, 0x4005, 0xa99a,
+	0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030,
+	0x00ce, 0x0005, 0x9006, 0x0ce0, 0x7aa8, 0xd2dc, 0x0904, 0x31c3,
+	0x0016, 0x7984, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x50cb, 0x001e,
+	0x1904, 0x31c3, 0x0804, 0x3191, 0x00f6, 0x2d78, 0x0011, 0x00fe,
+	0x0005, 0xaab0, 0xd2dc, 0x0150, 0x0016, 0xa998, 0x9284, 0x1000,
+	0xc0fd, 0x080c, 0x50cb, 0x001e, 0x9085, 0x0001, 0x0005, 0x81ff,
+	0x0120, 0x2009, 0x0001, 0x0804, 0x31c3, 0x080c, 0x5127, 0x0120,
+	0x2009, 0x0007, 0x0804, 0x31c3, 0x7984, 0x7ea8, 0x96b4, 0x00ff,
+	0x080c, 0x5f7e, 0x1904, 0x31c6, 0x9186, 0x007f, 0x0138, 0x080c,
+	0x62a4, 0x0120, 0x2009, 0x0009, 0x0804, 0x31c3, 0x080c, 0x4612,
+	0x1120, 0x2009, 0x0002, 0x0804, 0x31c3, 0xa867, 0x0000, 0xa868,
+	0xc0fd, 0xa86a, 0x2001, 0x0100, 0x8007, 0xa80a, 0x080c, 0xb7d7,
+	0x1120, 0x2009, 0x0003, 0x0804, 0x31c3, 0x7007, 0x0003, 0x701f,
+	0x4f0a, 0x0005, 0xa808, 0x8007, 0x9086, 0x0100, 0x1120, 0x2009,
+	0x0004, 0x0804, 0x31c3, 0xa8e0, 0xa866, 0xa810, 0x8007, 0x9084,
+	0x00ff, 0x800c, 0xa814, 0x8007, 0x9084, 0x00ff, 0x8004, 0x9080,
+	0x0002, 0x9108, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
+	0xffc0, 0x9080, 0x0004, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804,
+	0x465e, 0x080c, 0x4612, 0x1120, 0x2009, 0x0002, 0x0804, 0x31c3,
+	0x7984, 0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118,
+	0x7023, 0x1982, 0x0040, 0x92c6, 0x0001, 0x1118, 0x7023, 0x199c,
+	0x0010, 0x0804, 0x31c6, 0x2009, 0x001a, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x465b, 0x701f,
+	0x4f5a, 0x0005, 0x2001, 0x182c, 0x2003, 0x0001, 0xa85c, 0x9080,
+	0x0019, 0x2098, 0xa860, 0x20e0, 0x20a9, 0x001a, 0x7020, 0x20a0,
+	0x20e9, 0x0001, 0x4003, 0x0804, 0x3191, 0x080c, 0x4612, 0x1120,
+	0x2009, 0x0002, 0x0804, 0x31c3, 0x7984, 0x9194, 0xff00, 0x918c,
+	0x00ff, 0x8217, 0x82ff, 0x1118, 0x2099, 0x1982, 0x0040, 0x92c6,
+	0x0001, 0x1118, 0x2099, 0x199c, 0x0010, 0x0804, 0x31c6, 0xa85c,
+	0x9080, 0x0019, 0x20a0, 0xa860, 0x20e8, 0x20a9, 0x001a, 0x20e1,
+	0x0001, 0x4003, 0x2009, 0x001a, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
+	0xa85c, 0x9080, 0x0019, 0xaf60, 0x0804, 0x465e, 0x7884, 0x908a,
+	0x1000, 0x1a04, 0x31c6, 0x0126, 0x2091, 0x8000, 0x8003, 0x800b,
+	0x810b, 0x9108, 0x00c6, 0x2061, 0x19c9, 0x6142, 0x00ce, 0x012e,
+	0x0804, 0x3191, 0x00c6, 0x080c, 0x6c53, 0x1160, 0x080c, 0x6f2a,
+	0x080c, 0x5a21, 0x9085, 0x0001, 0x080c, 0x6c9a, 0x080c, 0x6b8a,
+	0x080c, 0x0db2, 0x2061, 0x1800, 0x6030, 0xc09d, 0x6032, 0x080c,
+	0x58e0, 0x00ce, 0x0005, 0x00c6, 0x2001, 0x1800, 0x2004, 0x908e,
+	0x0000, 0x0904, 0x31c3, 0x7884, 0x9005, 0x0188, 0x7888, 0x2061,
+	0x196b, 0x2c0c, 0x2062, 0x080c, 0x28b8, 0x01a0, 0x080c, 0x28c0,
+	0x0188, 0x080c, 0x28c8, 0x0170, 0x2162, 0x0804, 0x31c6, 0x2061,
+	0x0100, 0x6038, 0x9086, 0x0007, 0x1118, 0x2009, 0x0001, 0x0010,
+	0x2009, 0x0000, 0x7884, 0x9086, 0x0002, 0x1548, 0x2061, 0x0100,
+	0x6028, 0xc09c, 0x602a, 0x0026, 0x2011, 0x0003, 0x080c, 0x92ec,
+	0x2011, 0x0002, 0x080c, 0x92f6, 0x002e, 0x080c, 0x91de, 0x0036,
+	0x901e, 0x080c, 0x9254, 0x003e, 0x60e3, 0x0000, 0x080c, 0xd343,
+	0x080c, 0xd35e, 0x9085, 0x0001, 0x080c, 0x6c9a, 0x9006, 0x080c,
+	0x2987, 0x2001, 0x1800, 0x2003, 0x0004, 0x6027, 0x0008, 0x00ce,
+	0x0804, 0x3191, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x31c3,
+	0x080c, 0x5127, 0x0120, 0x2009, 0x0007, 0x0804, 0x31c3, 0x7984,
+	0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x5f7e, 0x1904, 0x31c6, 0x9186,
+	0x007f, 0x0138, 0x080c, 0x62a4, 0x0120, 0x2009, 0x0009, 0x0804,
+	0x31c3, 0x080c, 0x4612, 0x1120, 0x2009, 0x0002, 0x0804, 0x31c3,
+	0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xb7da, 0x1120,
+	0x2009, 0x0003, 0x0804, 0x31c3, 0x7007, 0x0003, 0x701f, 0x5059,
+	0x0005, 0xa830, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804,
+	0x31c3, 0xa8e0, 0xa866, 0xa834, 0x8007, 0x800c, 0xa85c, 0x9080,
+	0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xaf60, 0x0804, 0x465e,
+	0xa898, 0x9086, 0x000d, 0x1904, 0x31c3, 0x2021, 0x4005, 0x0126,
+	0x2091, 0x8000, 0x0e04, 0x507d, 0x0010, 0x012e, 0x0cc0, 0x7c36,
+	0x9486, 0x4000, 0x0118, 0x7833, 0x0011, 0x0010, 0x7833, 0x0010,
+	0x7883, 0x4005, 0xa998, 0x7986, 0xa9a4, 0x799a, 0xa9a8, 0x799e,
+	0x080c, 0x464e, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x1167, 0x7007, 0x0001, 0x2091, 0x5000, 0x700f, 0x0000,
+	0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x00c6, 0x2061, 0x19c9,
+	0x7984, 0x6152, 0x614e, 0x6057, 0x0000, 0x604b, 0x0009, 0x7898,
+	0x606a, 0x789c, 0x6066, 0x7888, 0x6062, 0x788c, 0x605e, 0x2001,
+	0x19d7, 0x2044, 0x2001, 0x19de, 0xa076, 0xa060, 0xa072, 0xa07b,
+	0x0001, 0xa07f, 0x0002, 0xa06b, 0x0000, 0xa09f, 0x0000, 0x00ce,
+	0x012e, 0x0804, 0x3191, 0x0126, 0x2091, 0x8000, 0x00b6, 0x00c6,
+	0x90e4, 0xc000, 0x0128, 0x0006, 0x080c, 0xb648, 0x000e, 0x1198,
+	0xd0e4, 0x0160, 0x9180, 0x1000, 0x2004, 0x905d, 0x0160, 0x080c,
+	0x5a3b, 0x080c, 0x9940, 0x0110, 0xb817, 0x0000, 0x9006, 0x00ce,
+	0x00be, 0x012e, 0x0005, 0x9085, 0x0001, 0x0cc8, 0x0126, 0x2091,
+	0x8000, 0x0156, 0x2010, 0x900e, 0x20a9, 0x0800, 0x0016, 0x9180,
+	0x1000, 0x2004, 0x9005, 0x0180, 0x9186, 0x007e, 0x0168, 0x9186,
+	0x007f, 0x0150, 0x9186, 0x0080, 0x0138, 0x9186, 0x00ff, 0x0120,
+	0x0026, 0x2200, 0x0801, 0x002e, 0x001e, 0x8108, 0x1f04, 0x50f6,
+	0x015e, 0x012e, 0x0005, 0x2001, 0x1854, 0x2004, 0x0005, 0x2001,
+	0x1873, 0x2004, 0x0005, 0x0006, 0x2001, 0x180f, 0x2004, 0xd0d4,
+	0x000e, 0x0005, 0x2001, 0x180d, 0x2004, 0xd0b4, 0x0005, 0x2001,
+	0x1800, 0x2004, 0x9086, 0x0003, 0x0005, 0x0016, 0x00e6, 0x2071,
+	0x1894, 0x7108, 0x910d, 0x710a, 0x00ee, 0x001e, 0x0005, 0x0126,
+	0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6,
+	0x00f6, 0x2061, 0x0100, 0x2069, 0x0200, 0x2071, 0x1800, 0x6044,
+	0xd0a4, 0x11e8, 0xd084, 0x0118, 0x080c, 0x52e0, 0x0068, 0xd08c,
+	0x0118, 0x080c, 0x51e9, 0x0040, 0xd094, 0x0118, 0x080c, 0x51b9,
+	0x0018, 0xd09c, 0x0108, 0x0099, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x012e, 0x0005, 0x0016,
+	0x6128, 0xd19c, 0x1110, 0xc19d, 0x612a, 0x001e, 0x0c68, 0x0006,
+	0x7090, 0x9005, 0x000e, 0x0120, 0x7093, 0x0000, 0x708b, 0x0000,
+	0x624c, 0x9286, 0xf0f0, 0x1150, 0x6048, 0x9086, 0xf0f0, 0x0130,
+	0x624a, 0x6043, 0x0090, 0x6043, 0x0010, 0x0490, 0x9294, 0xff00,
+	0x9296, 0xf700, 0x0178, 0x7134, 0xd1a4, 0x1160, 0x6240, 0x9295,
+	0x0100, 0x6242, 0x9294, 0x0010, 0x0128, 0x2009, 0x00f7, 0x080c,
+	0x599d, 0x00f0, 0x6040, 0x9084, 0x0010, 0x9085, 0x0140, 0x6042,
+	0x6043, 0x0000, 0x707f, 0x0000, 0x709b, 0x0001, 0x70bf, 0x0000,
+	0x70d7, 0x0000, 0x2009, 0x1c80, 0x200b, 0x0000, 0x708f, 0x0000,
+	0x7083, 0x000f, 0x2009, 0x000f, 0x2011, 0x5883, 0x080c, 0x7cd9,
+	0x0005, 0x2001, 0x1875, 0x2004, 0xd08c, 0x0110, 0x7057, 0xffff,
+	0x7080, 0x9005, 0x1528, 0x2011, 0x5883, 0x080c, 0x7c4a, 0x6040,
+	0x9094, 0x0010, 0x9285, 0x0020, 0x6042, 0x20a9, 0x00c8, 0x6044,
+	0xd08c, 0x1168, 0x1f04, 0x51cf, 0x6242, 0x7093, 0x0000, 0x6040,
+	0x9094, 0x0010, 0x9285, 0x0080, 0x6042, 0x6242, 0x0048, 0x6242,
+	0x7093, 0x0000, 0x7087, 0x0000, 0x9006, 0x080c, 0x5a26, 0x0000,
+	0x0005, 0x7084, 0x908a, 0x0003, 0x1a0c, 0x0db2, 0x000b, 0x0005,
+	0x51f3, 0x5244, 0x52df, 0x00f6, 0x0016, 0x6900, 0x918c, 0x0800,
+	0x7087, 0x0001, 0x2001, 0x015d, 0x2003, 0x0000, 0x6803, 0x00fc,
+	0x20a9, 0x0004, 0x6800, 0x9084, 0x00fc, 0x0120, 0x1f04, 0x5202,
+	0x080c, 0x0db2, 0x68a0, 0x68a2, 0x689c, 0x689e, 0x6898, 0x689a,
+	0xa001, 0x918d, 0x1600, 0x6902, 0x001e, 0x6837, 0x0020, 0x080c,
+	0x5a02, 0x2079, 0x1c00, 0x7833, 0x1101, 0x7837, 0x0000, 0x20e1,
+	0x0001, 0x2099, 0x1805, 0x20e9, 0x0001, 0x20a1, 0x1c0e, 0x20a9,
+	0x0004, 0x4003, 0x080c, 0x97ce, 0x20e1, 0x0001, 0x2099, 0x1c00,
+	0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003, 0x60c3,
+	0x000c, 0x600f, 0x0000, 0x080c, 0x58b4, 0x00fe, 0x9006, 0x708a,
+	0x6043, 0x0008, 0x6042, 0x0005, 0x00f6, 0x7088, 0x708b, 0x0000,
+	0x9025, 0x0904, 0x52bc, 0x6020, 0xd0b4, 0x1904, 0x52ba, 0x7198,
+	0x81ff, 0x0904, 0x52a8, 0x9486, 0x000c, 0x1904, 0x52b5, 0x9480,
+	0x0018, 0x8004, 0x20a8, 0x080c, 0x59fb, 0x2011, 0x0260, 0x2019,
+	0x1c00, 0x220c, 0x2304, 0x9106, 0x11e8, 0x8210, 0x8318, 0x1f04,
+	0x5261, 0x6043, 0x0004, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f,
+	0xf0f0, 0x2061, 0x0100, 0x6043, 0x0006, 0x7087, 0x0002, 0x7093,
+	0x0002, 0x2009, 0x07d0, 0x2011, 0x588a, 0x080c, 0x7cd9, 0x080c,
+	0x5a02, 0x04c0, 0x080c, 0x59fb, 0x2079, 0x0260, 0x7930, 0x918e,
+	0x1101, 0x1558, 0x7834, 0x9005, 0x1540, 0x7900, 0x918c, 0x00ff,
+	0x1118, 0x7804, 0x9005, 0x0190, 0x080c, 0x59fb, 0x2011, 0x026e,
+	0x2019, 0x1805, 0x20a9, 0x0004, 0x220c, 0x2304, 0x9102, 0x0230,
+	0x11a0, 0x8210, 0x8318, 0x1f04, 0x529c, 0x0078, 0x709b, 0x0000,
+	0x080c, 0x59fb, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0001,
+	0x20a1, 0x1c00, 0x20a9, 0x0014, 0x4003, 0x6043, 0x0008, 0x6043,
+	0x0000, 0x0010, 0x00fe, 0x0005, 0x6040, 0x9085, 0x0100, 0x6042,
+	0x6020, 0xd0b4, 0x1db8, 0x080c, 0x97ce, 0x20e1, 0x0001, 0x2099,
+	0x1c00, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003,
+	0x60c3, 0x000c, 0x2011, 0x19c0, 0x2013, 0x0000, 0x708b, 0x0000,
+	0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0x8fb2, 0x08d8, 0x0005,
+	0x7090, 0x908a, 0x001d, 0x1a0c, 0x0db2, 0x000b, 0x0005, 0x5311,
+	0x5324, 0x534d, 0x536d, 0x5393, 0x53c2, 0x53e8, 0x5420, 0x5446,
+	0x5474, 0x54af, 0x54e7, 0x5505, 0x5530, 0x5552, 0x556d, 0x5577,
+	0x55ab, 0x55d1, 0x5600, 0x5626, 0x565e, 0x56a2, 0x56df, 0x5700,
+	0x5759, 0x577b, 0x57a9, 0x57a9, 0x00c6, 0x2061, 0x1800, 0x6003,
+	0x0007, 0x2061, 0x0100, 0x6004, 0x9084, 0xfff9, 0x6006, 0x00ce,
+	0x0005, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0, 0x2061,
+	0x0100, 0x6043, 0x0002, 0x7093, 0x0001, 0x2009, 0x07d0, 0x2011,
+	0x588a, 0x080c, 0x7cd9, 0x0005, 0x00f6, 0x7088, 0x9086, 0x0014,
+	0x1510, 0x6042, 0x6020, 0xd0b4, 0x11f0, 0x080c, 0x59fb, 0x2079,
+	0x0260, 0x7a30, 0x9296, 0x1102, 0x11a0, 0x7834, 0x9005, 0x1188,
+	0x7a38, 0xd2fc, 0x0128, 0x70bc, 0x9005, 0x1110, 0x70bf, 0x0001,
+	0x2011, 0x588a, 0x080c, 0x7c4a, 0x7093, 0x0010, 0x080c, 0x5577,
+	0x0010, 0x708b, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x7093, 0x0003,
+	0x6043, 0x0004, 0x2011, 0x588a, 0x080c, 0x7c4a, 0x080c, 0x597f,
+	0x2079, 0x0240, 0x7833, 0x1102, 0x7837, 0x0000, 0x20a9, 0x0008,
+	0x9f88, 0x000e, 0x200b, 0x0000, 0x8108, 0x1f04, 0x5362, 0x60c3,
+	0x0014, 0x080c, 0x58b4, 0x00fe, 0x0005, 0x00f6, 0x7088, 0x9005,
+	0x0500, 0x2011, 0x588a, 0x080c, 0x7c4a, 0x9086, 0x0014, 0x11b8,
+	0x080c, 0x59fb, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102, 0x1178,
+	0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70bc, 0x9005,
+	0x1110, 0x70bf, 0x0001, 0x7093, 0x0004, 0x0029, 0x0010, 0x080c,
+	0x59d7, 0x00fe, 0x0005, 0x00f6, 0x7093, 0x0005, 0x080c, 0x597f,
+	0x2079, 0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x59fb,
+	0x080c, 0x59de, 0x1170, 0x707c, 0x9005, 0x1158, 0x7154, 0x9186,
+	0xffff, 0x0138, 0x2011, 0x0008, 0x080c, 0x5837, 0x0168, 0x080c,
+	0x59b4, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
+	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x58b4,
+	0x00fe, 0x0005, 0x00f6, 0x7088, 0x9005, 0x0500, 0x2011, 0x588a,
+	0x080c, 0x7c4a, 0x9086, 0x0014, 0x11b8, 0x080c, 0x59fb, 0x2079,
+	0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834, 0x9005, 0x1160,
+	0x7a38, 0xd2fc, 0x0128, 0x70bc, 0x9005, 0x1110, 0x70bf, 0x0001,
+	0x7093, 0x0006, 0x0029, 0x0010, 0x080c, 0x59d7, 0x00fe, 0x0005,
+	0x00f6, 0x7093, 0x0007, 0x080c, 0x597f, 0x2079, 0x0240, 0x7833,
+	0x1104, 0x7837, 0x0000, 0x080c, 0x59fb, 0x080c, 0x59de, 0x11b8,
+	0x707c, 0x9005, 0x11a0, 0x715c, 0x9186, 0xffff, 0x0180, 0x9180,
+	0x2f92, 0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c,
+	0x5837, 0x0180, 0x080c, 0x4a34, 0x0110, 0x080c, 0x253f, 0x20a9,
+	0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1,
+	0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x58b4, 0x00fe, 0x0005,
+	0x00f6, 0x7088, 0x9005, 0x0500, 0x2011, 0x588a, 0x080c, 0x7c4a,
+	0x9086, 0x0014, 0x11b8, 0x080c, 0x59fb, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc,
+	0x0128, 0x70bc, 0x9005, 0x1110, 0x70bf, 0x0001, 0x7093, 0x0008,
+	0x0029, 0x0010, 0x080c, 0x59d7, 0x00fe, 0x0005, 0x00f6, 0x7093,
+	0x0009, 0x080c, 0x597f, 0x2079, 0x0240, 0x7833, 0x1105, 0x7837,
+	0x0100, 0x080c, 0x59de, 0x1150, 0x707c, 0x9005, 0x1138, 0x080c,
+	0x57aa, 0x1188, 0x9085, 0x0001, 0x080c, 0x253f, 0x20a9, 0x0008,
+	0x080c, 0x59fb, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
+	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x58b4, 0x0010,
+	0x080c, 0x5304, 0x00fe, 0x0005, 0x00f6, 0x7088, 0x9005, 0x05a8,
+	0x2011, 0x588a, 0x080c, 0x7c4a, 0x9086, 0x0014, 0x1560, 0x080c,
+	0x59fb, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105, 0x1520, 0x7834,
+	0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1160, 0x7a38, 0xd2fc,
+	0x0128, 0x70bc, 0x9005, 0x1110, 0x70bf, 0x0001, 0x7093, 0x000a,
+	0x00b1, 0x0098, 0x9005, 0x1178, 0x7a38, 0xd2fc, 0x0128, 0x70bc,
+	0x9005, 0x1110, 0x70bf, 0x0001, 0x708f, 0x0000, 0x7093, 0x000e,
+	0x080c, 0x5552, 0x0010, 0x080c, 0x59d7, 0x00fe, 0x0005, 0x00f6,
+	0x7093, 0x000b, 0x2011, 0x1c0e, 0x20e9, 0x0001, 0x22a0, 0x20a9,
+	0x0040, 0x2019, 0xffff, 0x4304, 0x080c, 0x597f, 0x2079, 0x0240,
+	0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x59de, 0x0118, 0x2013,
+	0x0000, 0x0020, 0x7058, 0x9085, 0x0100, 0x2012, 0x20a9, 0x0040,
+	0x2009, 0x024e, 0x2011, 0x1c0e, 0x220e, 0x8210, 0x8108, 0x9186,
+	0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x1f04,
+	0x54d4, 0x60c3, 0x0084, 0x080c, 0x58b4, 0x00fe, 0x0005, 0x00f6,
+	0x7088, 0x9005, 0x01c0, 0x2011, 0x588a, 0x080c, 0x7c4a, 0x9086,
+	0x0084, 0x1178, 0x080c, 0x59fb, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1106, 0x1138, 0x7834, 0x9005, 0x1120, 0x7093, 0x000c, 0x0029,
+	0x0010, 0x080c, 0x59d7, 0x00fe, 0x0005, 0x00f6, 0x7093, 0x000d,
+	0x080c, 0x597f, 0x2079, 0x0240, 0x7833, 0x1107, 0x7837, 0x0000,
+	0x080c, 0x59fb, 0x20a9, 0x0040, 0x2011, 0x026e, 0x2009, 0x024e,
+	0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150, 0x6810, 0x8000,
+	0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816, 0x2011, 0x0260,
+	0x1f04, 0x5518, 0x60c3, 0x0084, 0x080c, 0x58b4, 0x00fe, 0x0005,
+	0x00f6, 0x7088, 0x9005, 0x01e0, 0x2011, 0x588a, 0x080c, 0x7c4a,
+	0x9086, 0x0084, 0x1198, 0x080c, 0x59fb, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x708f, 0x0001,
+	0x080c, 0x5951, 0x7093, 0x000e, 0x0029, 0x0010, 0x080c, 0x59d7,
+	0x00fe, 0x0005, 0x918d, 0x0001, 0x080c, 0x5a26, 0x7093, 0x000f,
+	0x708b, 0x0000, 0x2061, 0x0140, 0x605b, 0xbc85, 0x605f, 0xb5b5,
+	0x2061, 0x0100, 0x6043, 0x0005, 0x6043, 0x0004, 0x2009, 0x07d0,
+	0x2011, 0x588a, 0x080c, 0x7c3e, 0x0005, 0x7088, 0x9005, 0x0130,
+	0x2011, 0x588a, 0x080c, 0x7c4a, 0x7093, 0x0000, 0x0005, 0x7093,
+	0x0011, 0x080c, 0x97ce, 0x080c, 0x59fb, 0x20e1, 0x0000, 0x2099,
+	0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x7488, 0x9480, 0x0018,
+	0x9080, 0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8, 0x4003, 0x080c,
+	0x59de, 0x11a0, 0x7174, 0x81ff, 0x0188, 0x900e, 0x7078, 0x9084,
+	0x00ff, 0x0160, 0x080c, 0x24d6, 0x9186, 0x007e, 0x0138, 0x9186,
+	0x0080, 0x0120, 0x2011, 0x0008, 0x080c, 0x5837, 0x60c3, 0x0014,
+	0x080c, 0x58b4, 0x0005, 0x00f6, 0x7088, 0x9005, 0x0500, 0x2011,
+	0x588a, 0x080c, 0x7c4a, 0x9086, 0x0014, 0x11b8, 0x080c, 0x59fb,
+	0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834, 0x9005,
+	0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70bc, 0x9005, 0x1110, 0x70bf,
+	0x0001, 0x7093, 0x0012, 0x0029, 0x0010, 0x708b, 0x0000, 0x00fe,
+	0x0005, 0x00f6, 0x7093, 0x0013, 0x080c, 0x598d, 0x2079, 0x0240,
+	0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x59fb, 0x080c, 0x59de,
+	0x1170, 0x707c, 0x9005, 0x1158, 0x7154, 0x9186, 0xffff, 0x0138,
+	0x2011, 0x0008, 0x080c, 0x5837, 0x0168, 0x080c, 0x59b4, 0x20a9,
+	0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1,
+	0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x58b4, 0x00fe, 0x0005,
+	0x00f6, 0x7088, 0x9005, 0x0500, 0x2011, 0x588a, 0x080c, 0x7c4a,
+	0x9086, 0x0014, 0x11b8, 0x080c, 0x59fb, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc,
+	0x0128, 0x70bc, 0x9005, 0x1110, 0x70bf, 0x0001, 0x7093, 0x0014,
+	0x0029, 0x0010, 0x708b, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x7093,
+	0x0015, 0x080c, 0x598d, 0x2079, 0x0240, 0x7833, 0x1104, 0x7837,
+	0x0000, 0x080c, 0x59fb, 0x080c, 0x59de, 0x11b8, 0x707c, 0x9005,
+	0x11a0, 0x715c, 0x9186, 0xffff, 0x0180, 0x9180, 0x2f92, 0x200d,
+	0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x5837, 0x0180,
+	0x080c, 0x4a34, 0x0110, 0x080c, 0x253f, 0x20a9, 0x0008, 0x20e1,
+	0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003,
+	0x60c3, 0x0014, 0x080c, 0x58b4, 0x00fe, 0x0005, 0x00f6, 0x7088,
+	0x9005, 0x05f0, 0x2011, 0x588a, 0x080c, 0x7c4a, 0x9086, 0x0014,
+	0x15a8, 0x080c, 0x59fb, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105,
+	0x1568, 0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1168,
+	0x9085, 0x0001, 0x080c, 0x5a26, 0x7a38, 0xd2fc, 0x0128, 0x70bc,
+	0x9005, 0x1110, 0x70bf, 0x0001, 0x0080, 0x9005, 0x11b8, 0x7a38,
+	0xd2fc, 0x0128, 0x70bc, 0x9005, 0x1110, 0x70bf, 0x0001, 0x9085,
+	0x0001, 0x080c, 0x5a26, 0x708f, 0x0000, 0x7a38, 0xd2f4, 0x0110,
+	0x70d7, 0x0008, 0x7093, 0x0016, 0x0029, 0x0010, 0x708b, 0x0000,
+	0x00fe, 0x0005, 0x080c, 0x97ce, 0x080c, 0x59fb, 0x20e1, 0x0000,
+	0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000e,
+	0x4003, 0x2011, 0x026d, 0x2204, 0x9084, 0x0100, 0x2011, 0x024d,
+	0x2012, 0x2011, 0x026e, 0x7093, 0x0017, 0x080c, 0x59de, 0x1150,
+	0x707c, 0x9005, 0x1138, 0x080c, 0x57aa, 0x1188, 0x9085, 0x0001,
+	0x080c, 0x253f, 0x20a9, 0x0008, 0x080c, 0x59fb, 0x20e1, 0x0000,
+	0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3,
+	0x0014, 0x080c, 0x58b4, 0x0010, 0x080c, 0x5304, 0x0005, 0x00f6,
+	0x7088, 0x9005, 0x01d8, 0x2011, 0x588a, 0x080c, 0x7c4a, 0x9086,
+	0x0084, 0x1190, 0x080c, 0x59fb, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1106, 0x1150, 0x7834, 0x9005, 0x1138, 0x9006, 0x080c, 0x5a26,
+	0x7093, 0x0018, 0x0029, 0x0010, 0x708b, 0x0000, 0x00fe, 0x0005,
+	0x00f6, 0x7093, 0x0019, 0x080c, 0x598d, 0x2079, 0x0240, 0x7833,
+	0x1106, 0x7837, 0x0000, 0x080c, 0x59fb, 0x2009, 0x026e, 0x2039,
+	0x1c0e, 0x20a9, 0x0040, 0x213e, 0x8738, 0x8108, 0x9186, 0x0280,
+	0x1128, 0x6814, 0x8000, 0x6816, 0x2009, 0x0260, 0x1f04, 0x5713,
+	0x2039, 0x1c0e, 0x080c, 0x59de, 0x11e8, 0x2728, 0x2514, 0x8207,
+	0x9084, 0x00ff, 0x8000, 0x2018, 0x9294, 0x00ff, 0x8007, 0x9205,
+	0x202a, 0x7058, 0x2310, 0x8214, 0x92a0, 0x1c0e, 0x2414, 0x938c,
+	0x0001, 0x0118, 0x9294, 0xff00, 0x0018, 0x9294, 0x00ff, 0x8007,
+	0x9215, 0x2222, 0x20a9, 0x0040, 0x2009, 0x024e, 0x270e, 0x8738,
+	0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009,
+	0x0240, 0x1f04, 0x5746, 0x60c3, 0x0084, 0x080c, 0x58b4, 0x00fe,
+	0x0005, 0x00f6, 0x7088, 0x9005, 0x01e0, 0x2011, 0x588a, 0x080c,
+	0x7c4a, 0x9086, 0x0084, 0x1198, 0x080c, 0x59fb, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x708f,
+	0x0001, 0x080c, 0x5951, 0x7093, 0x001a, 0x0029, 0x0010, 0x708b,
+	0x0000, 0x00fe, 0x0005, 0x9085, 0x0001, 0x080c, 0x5a26, 0x7093,
+	0x001b, 0x080c, 0x97ce, 0x080c, 0x59fb, 0x2011, 0x0260, 0x2009,
+	0x0240, 0x7488, 0x9480, 0x0018, 0x9080, 0x0007, 0x9084, 0x03f8,
+	0x8004, 0x20a8, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150,
+	0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816,
+	0x2011, 0x0260, 0x1f04, 0x5792, 0x60c3, 0x0084, 0x080c, 0x58b4,
+	0x0005, 0x0005, 0x0086, 0x0096, 0x2029, 0x1854, 0x252c, 0x20a9,
+	0x0008, 0x2041, 0x1c0e, 0x20e9, 0x0001, 0x28a0, 0x080c, 0x59fb,
+	0x20e1, 0x0000, 0x2099, 0x026e, 0x4003, 0x20a9, 0x0008, 0x2011,
+	0x0007, 0xd5d4, 0x0108, 0x9016, 0x2800, 0x9200, 0x200c, 0x91a6,
+	0xffff, 0x1148, 0xd5d4, 0x0110, 0x8210, 0x0008, 0x8211, 0x1f04,
+	0x57c4, 0x0804, 0x5833, 0x82ff, 0x1160, 0xd5d4, 0x0120, 0x91a6,
+	0x3fff, 0x0d90, 0x0020, 0x91a6, 0x3fff, 0x0904, 0x5833, 0x918d,
+	0xc000, 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0110, 0x2019,
+	0x0010, 0x2120, 0xd5d4, 0x0110, 0x8423, 0x0008, 0x8424, 0x1240,
+	0xd5d4, 0x0110, 0x8319, 0x0008, 0x8318, 0x1f04, 0x57ea, 0x04d8,
+	0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x1f04, 0x57fc, 0x2328,
+	0x8529, 0x92be, 0x0007, 0x0158, 0x0006, 0x2039, 0x0007, 0x2200,
+	0x973a, 0x000e, 0x27a8, 0x95a8, 0x0010, 0x1f04, 0x580b, 0x7556,
+	0x95c8, 0x2f92, 0x292d, 0x95ac, 0x00ff, 0x757a, 0x6532, 0x6536,
+	0x0016, 0x2508, 0x080c, 0x251f, 0x001e, 0x60e7, 0x0000, 0x65ea,
+	0x2018, 0x2304, 0x9405, 0x201a, 0x707f, 0x0001, 0x20e9, 0x0000,
+	0x20a1, 0x024e, 0x20e1, 0x0001, 0x2898, 0x20a9, 0x0008, 0x4003,
+	0x9085, 0x0001, 0x0008, 0x9006, 0x009e, 0x008e, 0x0005, 0x0156,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x22a8, 0x20e1, 0x0000, 0x2099,
+	0x026e, 0x20e9, 0x0000, 0x2011, 0x024e, 0x22a0, 0x4003, 0x014e,
+	0x013e, 0x01de, 0x01ce, 0x015e, 0x2118, 0x9026, 0x2001, 0x0007,
+	0x939a, 0x0010, 0x0218, 0x8420, 0x8001, 0x0cd0, 0x2118, 0x84ff,
+	0x0120, 0x939a, 0x0010, 0x8421, 0x1de0, 0x2021, 0x0001, 0x83ff,
+	0x0118, 0x8423, 0x8319, 0x1de8, 0x9238, 0x2029, 0x026e, 0x9528,
+	0x2504, 0x942c, 0x11b8, 0x9405, 0x203a, 0x7156, 0x91a0, 0x2f92,
+	0x242d, 0x95ac, 0x00ff, 0x757a, 0x6532, 0x6536, 0x0016, 0x2508,
+	0x080c, 0x251f, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x707f, 0x0001,
+	0x9084, 0x0000, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7083, 0x0000,
+	0x00ee, 0x0005, 0x00e6, 0x00f6, 0x2079, 0x0100, 0x2071, 0x0140,
+	0x080c, 0x5940, 0x080c, 0x8fbb, 0x7004, 0x9084, 0x4000, 0x0110,
+	0x080c, 0x2997, 0x0126, 0x2091, 0x8000, 0x2071, 0x1824, 0x2073,
+	0x0000, 0x7840, 0x0026, 0x0016, 0x2009, 0x00f7, 0x080c, 0x599d,
+	0x001e, 0x9094, 0x0010, 0x9285, 0x0080, 0x7842, 0x7a42, 0x002e,
+	0x012e, 0x00fe, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x283d, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x2011,
+	0x19c0, 0x2013, 0x0000, 0x708b, 0x0000, 0x012e, 0x60a3, 0x0056,
+	0x60a7, 0x9575, 0x080c, 0x8fb2, 0x6144, 0xd184, 0x0120, 0x7190,
+	0x918d, 0x2000, 0x0018, 0x7184, 0x918d, 0x1000, 0x2011, 0x1968,
+	0x2112, 0x2009, 0x07d0, 0x2011, 0x588a, 0x080c, 0x7cd9, 0x0005,
+	0x0016, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9947,
+	0x2009, 0x00f7, 0x080c, 0x599d, 0x2061, 0x19c9, 0x900e, 0x611a,
+	0x611e, 0x6172, 0x6176, 0x2061, 0x1800, 0x6003, 0x0001, 0x2061,
+	0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x1968, 0x200b,
+	0x0000, 0x2009, 0x002d, 0x2011, 0x590c, 0x080c, 0x7c3e, 0x012e,
+	0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x0471, 0x2071, 0x0100, 0x080c, 0x8fbb, 0x2071, 0x0140,
+	0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x2997, 0x080c, 0x6c5b,
+	0x0188, 0x080c, 0x6c76, 0x1170, 0x080c, 0x6f34, 0x0016, 0x080c,
+	0x25ee, 0x2001, 0x193e, 0x2102, 0x001e, 0x080c, 0x6f2f, 0x080c,
+	0x6b8a, 0x0050, 0x2009, 0x0001, 0x080c, 0x28d6, 0x2001, 0x0001,
+	0x080c, 0x247f, 0x080c, 0x58e0, 0x012e, 0x000e, 0x00ee, 0x0005,
+	0x2001, 0x180d, 0x2004, 0xd0bc, 0x0158, 0x0026, 0x0036, 0x2011,
+	0x8017, 0x2001, 0x1968, 0x201c, 0x080c, 0x4672, 0x003e, 0x002e,
+	0x0005, 0x20a9, 0x0012, 0x20e9, 0x0001, 0x20a1, 0x1c80, 0x080c,
+	0x59fb, 0x20e9, 0x0000, 0x2099, 0x026e, 0x0099, 0x20a9, 0x0020,
+	0x080c, 0x59f5, 0x2099, 0x0260, 0x20a1, 0x1c92, 0x0051, 0x20a9,
+	0x000e, 0x080c, 0x59f8, 0x2099, 0x0260, 0x20a1, 0x1cb2, 0x0009,
+	0x0005, 0x0016, 0x0026, 0x3410, 0x3308, 0x2104, 0x8007, 0x2012,
+	0x8108, 0x8210, 0x1f04, 0x5975, 0x002e, 0x001e, 0x0005, 0x080c,
+	0x97ce, 0x20e1, 0x0001, 0x2099, 0x1c00, 0x20e9, 0x0000, 0x20a1,
+	0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x080c, 0x97ce, 0x080c,
+	0x59fb, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1,
+	0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x00c6, 0x0006, 0x2061,
+	0x0100, 0x810f, 0x2001, 0x1832, 0x2004, 0x9005, 0x1138, 0x2001,
+	0x1816, 0x2004, 0x9084, 0x00ff, 0x9105, 0x0010, 0x9185, 0x00f7,
+	0x604a, 0x000e, 0x00ce, 0x0005, 0x0016, 0x0046, 0x080c, 0x62a0,
+	0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xcfe6, 0x2001,
+	0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x900e, 0x080c,
+	0x2dfb, 0x080c, 0xbcec, 0x0140, 0x0036, 0x2019, 0xffff, 0x2021,
+	0x0007, 0x080c, 0x4829, 0x003e, 0x004e, 0x001e, 0x0005, 0x080c,
+	0x58e0, 0x7093, 0x0000, 0x708b, 0x0000, 0x0005, 0x0006, 0x2001,
+	0x180c, 0x2004, 0xd09c, 0x0100, 0x000e, 0x0005, 0x0006, 0x0016,
+	0x0126, 0x2091, 0x8000, 0x2001, 0x0101, 0x200c, 0x918d, 0x0006,
+	0x2102, 0x012e, 0x001e, 0x000e, 0x0005, 0x2009, 0x0001, 0x0020,
+	0x2009, 0x0002, 0x0008, 0x900e, 0x6814, 0x9084, 0xffc0, 0x910d,
+	0x6916, 0x0005, 0x00f6, 0x0156, 0x0146, 0x01d6, 0x9006, 0x20a9,
+	0x0080, 0x20e9, 0x0001, 0x20a1, 0x1c00, 0x4004, 0x2079, 0x1c00,
+	0x7803, 0x2200, 0x7807, 0x00ef, 0x780f, 0x00ef, 0x7813, 0x0138,
+	0x7823, 0xffff, 0x7827, 0xffff, 0x01de, 0x014e, 0x015e, 0x00fe,
+	0x0005, 0x2001, 0x1800, 0x2003, 0x0001, 0x0005, 0x2001, 0x1975,
+	0x0118, 0x2003, 0x0001, 0x0010, 0x2003, 0x0000, 0x0005, 0x0156,
+	0x20a9, 0x0800, 0x2009, 0x1000, 0x9006, 0x200a, 0x8108, 0x1f04,
+	0x5a35, 0x015e, 0x0005, 0x00d6, 0x0036, 0x0156, 0x0136, 0x0146,
+	0x2069, 0x1853, 0x9006, 0xb802, 0xb8be, 0xb807, 0x0707, 0xb80a,
+	0xb80e, 0xb812, 0x9198, 0x2f92, 0x231d, 0x939c, 0x00ff, 0xbb16,
+	0x0016, 0x0026, 0xb8b2, 0x080c, 0x9940, 0x1120, 0x9192, 0x007e,
+	0x1208, 0xbbb2, 0x20a9, 0x0004, 0xb8b4, 0x20e8, 0xb9b8, 0x9198,
+	0x0006, 0x9006, 0x23a0, 0x4004, 0x20a9, 0x0004, 0x9198, 0x000a,
+	0x23a0, 0x4004, 0x002e, 0x001e, 0xb83e, 0xb842, 0xb84e, 0xb852,
+	0xb856, 0xb85a, 0xb85e, 0xb862, 0xb866, 0xb86a, 0xb86f, 0x0100,
+	0xb872, 0xb876, 0xb87a, 0xb88a, 0xb88e, 0xb893, 0x0008, 0xb896,
+	0xb89a, 0xb89e, 0xb8ae, 0xb9a2, 0x0096, 0xb8a4, 0x904d, 0x0110,
+	0x080c, 0x1007, 0xb8a7, 0x0000, 0x009e, 0x9006, 0xb84a, 0x6810,
+	0xb83a, 0x680c, 0xb846, 0x6814, 0x9084, 0x00ff, 0xb842, 0x014e,
+	0x013e, 0x015e, 0x003e, 0x00de, 0x0005, 0x0126, 0x2091, 0x8000,
+	0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04, 0x5b0b,
+	0x9182, 0x0800, 0x1a04, 0x5b0f, 0x2001, 0x180c, 0x2004, 0x9084,
+	0x0003, 0x1904, 0x5b15, 0x9188, 0x1000, 0x2104, 0x905d, 0x0518,
+	0xb804, 0x9084, 0x00ff, 0x908e, 0x0006, 0x1508, 0xb8a4, 0x900d,
+	0x1904, 0x5b27, 0xb850, 0x900d, 0x1148, 0xa802, 0x2900, 0xb852,
+	0xb84e, 0x080c, 0x801d, 0x9006, 0x012e, 0x0005, 0x00a6, 0x2150,
+	0x2900, 0xb002, 0xa803, 0x0000, 0x00ae, 0xb852, 0x0c90, 0x2001,
+	0x0005, 0x900e, 0x04b8, 0x2001, 0x0028, 0x900e, 0x0498, 0x9082,
+	0x0006, 0x1290, 0x080c, 0x9940, 0x1160, 0xb8a0, 0x9084, 0xff80,
+	0x1140, 0xb900, 0xd1fc, 0x0990, 0x2001, 0x0029, 0x2009, 0x1000,
+	0x0408, 0x2001, 0x0028, 0x00a8, 0x2009, 0x180c, 0x210c, 0xd18c,
+	0x0118, 0x2001, 0x0004, 0x0068, 0xd184, 0x0118, 0x2001, 0x0004,
+	0x0040, 0x2001, 0x0029, 0xb900, 0xd1fc, 0x0118, 0x2009, 0x1000,
+	0x0048, 0x900e, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018, 0x2001,
+	0x0029, 0x900e, 0x9005, 0x012e, 0x0005, 0x2001, 0x180c, 0x2004,
+	0xd084, 0x19d0, 0x9188, 0x1000, 0x2104, 0x905d, 0x09a8, 0x080c,
+	0x62a4, 0x1990, 0xb800, 0xd0bc, 0x0978, 0x0804, 0x5abe, 0x080c,
+	0x611a, 0x0904, 0x5ad7, 0x0804, 0x5ac2, 0x00b6, 0x00e6, 0x0126,
+	0x2091, 0x8000, 0xa974, 0x9182, 0x0800, 0x1a04, 0x5ba8, 0x9188,
+	0x1000, 0x2104, 0x905d, 0x0904, 0x5b80, 0xb8a0, 0x9086, 0x007f,
+	0x0178, 0x080c, 0x62ac, 0x0160, 0xa994, 0x81ff, 0x0130, 0x908e,
+	0x0004, 0x0130, 0x908e, 0x0005, 0x0118, 0x080c, 0x62a4, 0x1598,
+	0xa87c, 0xd0fc, 0x01e0, 0xa894, 0x9005, 0x01c8, 0x2060, 0x0026,
+	0x2010, 0x080c, 0xb5e9, 0x002e, 0x1120, 0x2001, 0x0008, 0x0804,
+	0x5baa, 0x6020, 0x9086, 0x000a, 0x0120, 0x2001, 0x0008, 0x0804,
+	0x5baa, 0x601a, 0x6003, 0x0008, 0x2900, 0x6016, 0x0058, 0x080c,
+	0x9980, 0x05e8, 0x2b00, 0x6012, 0x2900, 0x6016, 0x600b, 0xffff,
+	0x6023, 0x000a, 0x2009, 0x0003, 0x080c, 0x9a50, 0x9006, 0x0458,
+	0x2001, 0x0028, 0x0438, 0x9082, 0x0006, 0x1290, 0x080c, 0x9940,
+	0x1160, 0xb8a0, 0x9084, 0xff80, 0x1140, 0xb900, 0xd1fc, 0x0900,
+	0x2001, 0x0029, 0x2009, 0x1000, 0x00a8, 0x2001, 0x0028, 0x0090,
+	0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0050,
+	0xd184, 0x0118, 0x2001, 0x0004, 0x0028, 0x2001, 0x0029, 0x0010,
+	0x2001, 0x0029, 0x9005, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2001,
+	0x002c, 0x0cc0, 0x00f6, 0x00b6, 0x0126, 0x2091, 0x8000, 0xa8e0,
+	0x9005, 0x1550, 0xa8dc, 0x9082, 0x0101, 0x1630, 0xa8c8, 0x9005,
+	0x1518, 0xa8c4, 0x9082, 0x0101, 0x12f8, 0xa974, 0x2079, 0x1800,
+	0x9182, 0x0800, 0x12e8, 0x7830, 0x9084, 0x0003, 0x1130, 0xaa98,
+	0xab94, 0xa878, 0x9084, 0x0007, 0x00ea, 0x7930, 0xd18c, 0x0118,
+	0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010,
+	0x2001, 0x0029, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018,
+	0x2001, 0x0029, 0x900e, 0x9006, 0x0008, 0x9005, 0x012e, 0x00be,
+	0x00fe, 0x0005, 0x5c3f, 0x5bfa, 0x5c11, 0x5c3f, 0x5c3f, 0x5c3f,
+	0x5c3f, 0x5c3f, 0x2100, 0x9082, 0x007e, 0x1278, 0x080c, 0x5f1e,
+	0x0148, 0x9046, 0xb810, 0x9306, 0x1904, 0x5c47, 0xb814, 0x9206,
+	0x15f0, 0x0028, 0xbb12, 0xba16, 0x0010, 0x080c, 0x452c, 0x0150,
+	0x04b0, 0x080c, 0x5f7e, 0x1598, 0xb810, 0x9306, 0x1580, 0xb814,
+	0x9206, 0x1568, 0x080c, 0x9980, 0x0530, 0x2b00, 0x6012, 0x080c,
+	0xba69, 0x2900, 0x6016, 0x600b, 0xffff, 0x6023, 0x000a, 0xa878,
+	0x9086, 0x0001, 0x1170, 0x080c, 0x2e30, 0x9006, 0x080c, 0x5ebb,
+	0x2001, 0x0002, 0x080c, 0x5ecf, 0x2001, 0x0200, 0xb86e, 0xb893,
+	0x0002, 0x2009, 0x0003, 0x080c, 0x9a50, 0x9006, 0x0068, 0x2001,
+	0x0001, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018, 0x2001,
+	0x0028, 0x900e, 0x9005, 0x0000, 0x012e, 0x00be, 0x00fe, 0x0005,
+	0x00b6, 0x00f6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa894, 0x90c6,
+	0x0015, 0x0904, 0x5e14, 0x90c6, 0x0056, 0x0904, 0x5e18, 0x90c6,
+	0x0066, 0x0904, 0x5e1c, 0x90c6, 0x0071, 0x0904, 0x5e20, 0x90c6,
+	0x0074, 0x0904, 0x5e24, 0x90c6, 0x007c, 0x0904, 0x5e28, 0x90c6,
+	0x007e, 0x0904, 0x5e2c, 0x90c6, 0x0037, 0x0904, 0x5e30, 0x9016,
+	0x2079, 0x1800, 0xa974, 0x9186, 0x00ff, 0x0904, 0x5e0f, 0x9182,
+	0x0800, 0x1a04, 0x5e0f, 0x080c, 0x5f7e, 0x1198, 0xb804, 0x9084,
+	0x00ff, 0x9082, 0x0006, 0x1268, 0xa894, 0x90c6, 0x006f, 0x0148,
+	0x080c, 0x9940, 0x1904, 0x5df8, 0xb8a0, 0x9084, 0xff80, 0x1904,
+	0x5df8, 0xa894, 0x90c6, 0x006f, 0x0158, 0x90c6, 0x005e, 0x0904,
+	0x5d58, 0x90c6, 0x0064, 0x0904, 0x5d81, 0x2008, 0x0804, 0x5d1b,
+	0xa998, 0xa8b0, 0x2040, 0x080c, 0x9940, 0x1120, 0x9182, 0x007f,
+	0x0a04, 0x5d1b, 0x9186, 0x00ff, 0x0904, 0x5d1b, 0x9182, 0x0800,
+	0x1a04, 0x5d1b, 0xaaa0, 0xab9c, 0x7874, 0x9306, 0x1188, 0x7878,
+	0x0096, 0x924e, 0x1128, 0x2208, 0x2310, 0x009e, 0x0804, 0x5d1b,
+	0x99cc, 0xff00, 0x009e, 0x1120, 0x2208, 0x2310, 0x0804, 0x5d1b,
+	0x080c, 0x452c, 0x0904, 0x5d24, 0x900e, 0x9016, 0x90c6, 0x4000,
+	0x1558, 0x0006, 0x080c, 0x619e, 0x1108, 0xc185, 0xb800, 0xd0bc,
+	0x0108, 0xc18d, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x0031, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098,
+	0x080c, 0x0f52, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x0035, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x000a, 0x2098,
+	0x080c, 0x0f52, 0x000e, 0x00c8, 0x90c6, 0x4007, 0x1110, 0x2408,
+	0x00a0, 0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0070, 0x90c6,
+	0x4009, 0x1108, 0x0050, 0x90c6, 0x4006, 0x0138, 0x2001, 0x4005,
+	0x2009, 0x000a, 0x0010, 0x2001, 0x4006, 0xa896, 0xa99a, 0xaa9e,
+	0x2001, 0x0030, 0x900e, 0x0470, 0x080c, 0x9980, 0x1130, 0x2001,
+	0x4005, 0x2009, 0x0003, 0x9016, 0x0c80, 0x2b00, 0x6012, 0x080c,
+	0xba69, 0x2900, 0x6016, 0x6023, 0x0001, 0xa868, 0xd88c, 0x0108,
+	0xc0f5, 0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x2e30, 0x012e,
+	0x9006, 0x080c, 0x5ebb, 0x2001, 0x0002, 0x080c, 0x5ecf, 0x2009,
+	0x0002, 0x080c, 0x9a50, 0xa8b0, 0xd094, 0x0118, 0xb8bc, 0xc08d,
+	0xb8be, 0x9006, 0x9005, 0x012e, 0x00ee, 0x00fe, 0x00be, 0x0005,
+	0x080c, 0x5127, 0x0118, 0x2009, 0x0007, 0x00f8, 0xa998, 0xaeb0,
+	0x080c, 0x5f7e, 0x1904, 0x5d16, 0x9186, 0x007f, 0x0130, 0x080c,
+	0x62a4, 0x0118, 0x2009, 0x0009, 0x0080, 0x0096, 0x080c, 0x0fd5,
+	0x1120, 0x009e, 0x2009, 0x0002, 0x0040, 0x2900, 0x009e, 0xa806,
+	0x080c, 0xb7da, 0x19b0, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804,
+	0x5d1d, 0xa998, 0xaeb0, 0x080c, 0x5f7e, 0x1904, 0x5d16, 0x0096,
+	0x080c, 0x0fd5, 0x1128, 0x009e, 0x2009, 0x0002, 0x0804, 0x5dd5,
+	0x2900, 0x009e, 0xa806, 0x0096, 0x2048, 0x20a9, 0x002b, 0xb8b4,
+	0x20e0, 0xb8b8, 0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002,
+	0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0, 0xbbb8,
+	0x9398, 0x0006, 0x2398, 0x080c, 0x0f52, 0x009e, 0xa87b, 0x0000,
+	0xa883, 0x0000, 0xa897, 0x4000, 0xd684, 0x1168, 0x080c, 0x5113,
+	0xd0b4, 0x1118, 0xa89b, 0x000b, 0x00e0, 0xb800, 0xd08c, 0x0118,
+	0xa89b, 0x000c, 0x00b0, 0x080c, 0x62a4, 0x0118, 0xa89b, 0x0009,
+	0x0080, 0x080c, 0x5127, 0x0118, 0xa89b, 0x0007, 0x0050, 0x080c,
+	0xb7bd, 0x1904, 0x5d51, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804,
+	0x5d1d, 0xa87b, 0x0030, 0xa897, 0x4005, 0xa804, 0x8006, 0x8006,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009,
+	0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041,
+	0x120c, 0x080c, 0x9ed6, 0x1904, 0x5d51, 0x2009, 0x0002, 0x08e8,
+	0x2001, 0x0028, 0x900e, 0x0804, 0x5d52, 0x2009, 0x180c, 0x210c,
+	0xd18c, 0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001,
+	0x0004, 0x0010, 0x2001, 0x0029, 0x900e, 0x0804, 0x5d52, 0x2001,
+	0x0029, 0x900e, 0x0804, 0x5d52, 0x080c, 0x33b6, 0x0804, 0x5d53,
+	0x080c, 0x4e50, 0x0804, 0x5d53, 0x080c, 0x41a5, 0x0804, 0x5d53,
+	0x080c, 0x45e8, 0x0804, 0x5d53, 0x080c, 0x489f, 0x0804, 0x5d53,
+	0x080c, 0x4aca, 0x0804, 0x5d53, 0x080c, 0x4cbb, 0x0804, 0x5d53,
+	0x080c, 0x35c6, 0x0804, 0x5d53, 0x00b6, 0xa974, 0xae78, 0x9684,
+	0x3fff, 0x9082, 0x4000, 0x1618, 0x9182, 0x0800, 0x1268, 0x9188,
+	0x1000, 0x2104, 0x905d, 0x0140, 0x080c, 0x62a4, 0x1148, 0x00e9,
+	0x080c, 0x60a9, 0x9006, 0x00b0, 0x2001, 0x0028, 0x900e, 0x0090,
+	0x9082, 0x0006, 0x1240, 0xb900, 0xd1fc, 0x0d88, 0x2001, 0x0029,
+	0x2009, 0x1000, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018, 0x2001,
+	0x0029, 0x900e, 0x9005, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000,
+	0xb850, 0x900d, 0x0150, 0x2900, 0x0096, 0x2148, 0xa802, 0x009e,
+	0xa803, 0x0000, 0xb852, 0x012e, 0x0005, 0x2900, 0xb852, 0xb84e,
+	0xa803, 0x0000, 0x0cc0, 0x0126, 0x2091, 0x8000, 0xb84c, 0x9005,
+	0x0170, 0x00e6, 0x2071, 0x19b6, 0x7004, 0x9086, 0x0002, 0x0168,
+	0x00ee, 0xb84c, 0xa802, 0x2900, 0xb84e, 0x012e, 0x0005, 0x2900,
+	0xb852, 0xb84e, 0xa803, 0x0000, 0x0cc0, 0x701c, 0x9b06, 0x1d80,
+	0xb84c, 0x00a6, 0x2050, 0xb000, 0xa802, 0x2900, 0xb002, 0x00ae,
+	0x00ee, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0xb84c, 0x904d,
+	0x0130, 0xa800, 0x9005, 0x1108, 0xb852, 0xb84e, 0x9905, 0x012e,
+	0x0005, 0xb84c, 0x904d, 0x0130, 0xa800, 0x9005, 0x1108, 0xb852,
+	0xb84e, 0x9905, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x0026, 0x2091,
+	0x8000, 0x6210, 0x2258, 0xba00, 0x9005, 0x0110, 0xc285, 0x0008,
+	0xc284, 0xba02, 0x002e, 0x00ce, 0x012e, 0x00be, 0x0005, 0x00b6,
+	0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, 0x2258, 0xba04, 0x0006,
+	0x9086, 0x0006, 0x1170, 0xb89c, 0xd0ac, 0x0158, 0x080c, 0x62a0,
+	0x0140, 0x9284, 0xff00, 0x8007, 0x9086, 0x0007, 0x1110, 0x2011,
+	0x0600, 0x000e, 0x9294, 0xff00, 0x9215, 0xba06, 0x0006, 0x9086,
+	0x0006, 0x1120, 0xba90, 0x82ff, 0x090c, 0x0db2, 0x000e, 0x00ce,
+	0x012e, 0x00be, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000,
+	0x6210, 0x2258, 0xba04, 0x0006, 0x9086, 0x0006, 0x1168, 0xb89c,
+	0xd0a4, 0x0150, 0x080c, 0x629c, 0x1138, 0x9284, 0x00ff, 0x9086,
+	0x0007, 0x1110, 0x2011, 0x0006, 0x000e, 0x9294, 0x00ff, 0x8007,
+	0x9215, 0xba06, 0x00ce, 0x012e, 0x00be, 0x0005, 0x9182, 0x0800,
+	0x0218, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0026, 0x9190, 0x1000,
+	0x2204, 0x905d, 0x1180, 0x0096, 0x080c, 0x0fd5, 0x2958, 0x009e,
+	0x0160, 0x2b00, 0x2012, 0xb85c, 0xb8ba, 0xb860, 0xb8b6, 0x9006,
+	0xb8a6, 0x080c, 0x5a3b, 0x9006, 0x0010, 0x9085, 0x0001, 0x002e,
+	0x00de, 0x0005, 0x00b6, 0x0096, 0x0126, 0x2091, 0x8000, 0x0026,
+	0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0458, 0x00d6, 0x9190,
+	0x1000, 0x2204, 0x905d, 0x0518, 0x2013, 0x0000, 0xb8a4, 0x904d,
+	0x0110, 0x080c, 0x1007, 0x00d6, 0x00c6, 0xb8ac, 0x2060, 0x8cff,
+	0x0168, 0x600c, 0x0006, 0x6014, 0x2048, 0x080c, 0xb5fb, 0x0110,
+	0x080c, 0x0f87, 0x080c, 0x99d6, 0x00ce, 0x0c88, 0x00ce, 0x00de,
+	0x2b48, 0xb8b8, 0xb85e, 0xb8b4, 0xb862, 0x080c, 0x1017, 0x00de,
+	0x9006, 0x002e, 0x012e, 0x009e, 0x00be, 0x0005, 0x0016, 0x9182,
+	0x0800, 0x0218, 0x9085, 0x0001, 0x0030, 0x9188, 0x1000, 0x2104,
+	0x905d, 0x0dc0, 0x9006, 0x001e, 0x0005, 0x00d6, 0x0156, 0x0136,
+	0x0146, 0x9006, 0xb80a, 0xb80e, 0xb800, 0xc08c, 0xb802, 0x080c,
+	0x6c53, 0x1510, 0xb8a0, 0x9086, 0x007e, 0x0120, 0x080c, 0x9940,
+	0x11d8, 0x0078, 0x7040, 0xd0e4, 0x01b8, 0x00c6, 0x2061, 0x1951,
+	0x7048, 0x2062, 0x704c, 0x6006, 0x7050, 0x600a, 0x7054, 0x600e,
+	0x00ce, 0x703c, 0x2069, 0x0140, 0x9005, 0x1110, 0x2001, 0x0001,
+	0x6886, 0x2069, 0x1800, 0x68ae, 0x7040, 0xb85e, 0x7048, 0xb862,
+	0x704c, 0xb866, 0x20e1, 0x0000, 0x2099, 0x0276, 0xb8b4, 0x20e8,
+	0xb8b8, 0x9088, 0x000a, 0x21a0, 0x20a9, 0x0004, 0x4003, 0x2099,
+	0x027a, 0x9088, 0x0006, 0x21a0, 0x20a9, 0x0004, 0x4003, 0x2069,
+	0x0200, 0x6817, 0x0001, 0x7040, 0xb86a, 0x7144, 0xb96e, 0x7048,
+	0xb872, 0x7050, 0xb876, 0x2069, 0x0200, 0x6817, 0x0000, 0xb8a0,
+	0x9086, 0x007e, 0x1110, 0x7144, 0xb96e, 0x9182, 0x0211, 0x1218,
+	0x2009, 0x0008, 0x0400, 0x9182, 0x0259, 0x1218, 0x2009, 0x0007,
+	0x00d0, 0x9182, 0x02c1, 0x1218, 0x2009, 0x0006, 0x00a0, 0x9182,
+	0x0349, 0x1218, 0x2009, 0x0005, 0x0070, 0x9182, 0x0421, 0x1218,
+	0x2009, 0x0004, 0x0040, 0x9182, 0x0581, 0x1218, 0x2009, 0x0003,
+	0x0010, 0x2009, 0x0002, 0xb992, 0x014e, 0x013e, 0x015e, 0x00de,
+	0x0005, 0x0016, 0x0026, 0x00e6, 0x2071, 0x0260, 0x7034, 0xb896,
+	0x703c, 0xb89a, 0x7054, 0xb89e, 0x0036, 0xbbbc, 0xc384, 0xba00,
+	0x2009, 0x1873, 0x210c, 0xd0bc, 0x0120, 0xd1ec, 0x0110, 0xc2ad,
+	0x0008, 0xc2ac, 0xd0c4, 0x0148, 0xd1e4, 0x0138, 0xc2bd, 0xd0cc,
+	0x0128, 0xd38c, 0x1108, 0xc385, 0x0008, 0xc2bc, 0xba02, 0xbbbe,
+	0x003e, 0x00ee, 0x002e, 0x001e, 0x0005, 0x0096, 0x0126, 0x2091,
+	0x8000, 0xb8a4, 0x904d, 0x0578, 0xa900, 0x81ff, 0x15c0, 0xaa04,
+	0x9282, 0x0010, 0x16c8, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x8906,
+	0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0, 0x9080,
+	0x0004, 0x2098, 0x2009, 0x0010, 0x20a9, 0x0001, 0x4002, 0x9086,
+	0xffff, 0x0120, 0x8109, 0x1dd0, 0x080c, 0x0db2, 0x3c00, 0x20e8,
+	0x3300, 0x8001, 0x20a0, 0x4604, 0x8210, 0xaa06, 0x01de, 0x01ce,
+	0x014e, 0x013e, 0x0060, 0x080c, 0x0fd5, 0x0170, 0x2900, 0xb8a6,
+	0xa803, 0x0000, 0x080c, 0x613a, 0xa807, 0x0001, 0xae12, 0x9085,
+	0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0126, 0x2091,
+	0x8000, 0x0096, 0xb8a4, 0x904d, 0x0188, 0xa800, 0x9005, 0x1150,
+	0x080c, 0x6149, 0x1158, 0xa804, 0x908a, 0x0002, 0x0218, 0x8001,
+	0xa806, 0x0020, 0x080c, 0x1007, 0xb8a7, 0x0000, 0x009e, 0x012e,
+	0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x801d, 0x012e, 0x0005,
+	0x901e, 0x0010, 0x2019, 0x0001, 0x900e, 0x0126, 0x2091, 0x8000,
+	0xb84c, 0x2048, 0xb800, 0xd0dc, 0x1170, 0x89ff, 0x0500, 0x83ff,
+	0x0120, 0xa878, 0x9606, 0x0158, 0x0030, 0xa86c, 0x9406, 0x1118,
+	0xa870, 0x9506, 0x0120, 0x2908, 0xa800, 0x2048, 0x0c70, 0x080c,
+	0x933f, 0xaa00, 0xb84c, 0x9906, 0x1110, 0xba4e, 0x0020, 0x00a6,
+	0x2150, 0xb202, 0x00ae, 0x82ff, 0x1110, 0xb952, 0x89ff, 0x012e,
+	0x0005, 0x9016, 0x0489, 0x1110, 0x2011, 0x0001, 0x0005, 0x080c,
+	0x619e, 0x0128, 0x080c, 0xb6c3, 0x0010, 0x9085, 0x0001, 0x0005,
+	0x080c, 0x619e, 0x0128, 0x080c, 0xb65d, 0x0010, 0x9085, 0x0001,
+	0x0005, 0x080c, 0x619e, 0x0128, 0x080c, 0xb6c0, 0x0010, 0x9085,
+	0x0001, 0x0005, 0x080c, 0x619e, 0x0128, 0x080c, 0xb681, 0x0010,
+	0x9085, 0x0001, 0x0005, 0x080c, 0x619e, 0x0128, 0x080c, 0xb6ed,
+	0x0010, 0x9085, 0x0001, 0x0005, 0xb8a4, 0x900d, 0x1118, 0x9085,
+	0x0001, 0x0005, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e,
+	0x810e, 0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080,
+	0x0004, 0x2098, 0x20a9, 0x0001, 0x2009, 0x0010, 0x4002, 0x9606,
+	0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0008, 0x9006, 0x01ce,
+	0x013e, 0x0005, 0x0146, 0x01d6, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x0004, 0x20a0, 0x20a9, 0x0010, 0x2009, 0xffff, 0x4104, 0x01de,
+	0x014e, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e, 0x810e,
+	0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080, 0x0004,
+	0x2098, 0x20a9, 0x0001, 0x2009, 0x0010, 0x4002, 0x9606, 0x0128,
+	0x8109, 0x1dd8, 0x9085, 0x0001, 0x0068, 0x0146, 0x01d6, 0x3300,
+	0x8001, 0x20a0, 0x3c00, 0x20e8, 0x2001, 0xffff, 0x4004, 0x01de,
+	0x014e, 0x9006, 0x01ce, 0x013e, 0x0005, 0x0096, 0x0126, 0x2091,
+	0x8000, 0xb8a4, 0x904d, 0x1128, 0x080c, 0x0fd5, 0x0168, 0x2900,
+	0xb8a6, 0x080c, 0x613a, 0xa803, 0x0001, 0xa807, 0x0000, 0x9085,
+	0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x0126,
+	0x2091, 0x8000, 0xb8a4, 0x904d, 0x0130, 0xb8a7, 0x0000, 0x080c,
+	0x1007, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0xb89c, 0xd0a4,
+	0x0005, 0x00b6, 0x00f6, 0x080c, 0x6c53, 0x01b0, 0x71bc, 0x81ff,
+	0x1198, 0x71d4, 0xd19c, 0x0180, 0x2001, 0x007e, 0x9080, 0x1000,
+	0x2004, 0x905d, 0x0148, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006,
+	0x1118, 0xb800, 0xc0ed, 0xb802, 0x2079, 0x1853, 0x7804, 0xd0a4,
+	0x01d0, 0x0156, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x5f7e,
+	0x1168, 0xb804, 0x9084, 0xff00, 0x8007, 0x9096, 0x0004, 0x0118,
+	0x9086, 0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x001e, 0x8108,
+	0x1f04, 0x61c5, 0x015e, 0x080c, 0x6262, 0x0120, 0x2001, 0x1954,
+	0x200c, 0x0038, 0x2079, 0x1853, 0x7804, 0xd0a4, 0x0130, 0x2009,
+	0x07d0, 0x2011, 0x61f0, 0x080c, 0x7cd9, 0x00fe, 0x00be, 0x0005,
+	0x00b6, 0x2011, 0x61f0, 0x080c, 0x7c4a, 0x080c, 0x6262, 0x01d8,
+	0x2001, 0x107e, 0x2004, 0x2058, 0xb900, 0xc1ec, 0xb902, 0x080c,
+	0x62a0, 0x0130, 0x2009, 0x07d0, 0x2011, 0x61f0, 0x080c, 0x7cd9,
+	0x00e6, 0x2071, 0x1800, 0x9006, 0x7076, 0x7058, 0x707a, 0x080c,
+	0x2c2b, 0x00ee, 0x04b0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e,
+	0x0016, 0x080c, 0x5f7e, 0x1538, 0xb800, 0xd0ec, 0x0520, 0x0046,
+	0xbaa0, 0x2220, 0x9006, 0x2009, 0x0029, 0x080c, 0xcfe6, 0xb800,
+	0xc0e5, 0xc0ec, 0xb802, 0x080c, 0x629c, 0x2001, 0x0707, 0x1128,
+	0xb804, 0x9084, 0x00ff, 0x9085, 0x0700, 0xb806, 0x2019, 0x0029,
+	0x080c, 0x8180, 0x0076, 0x903e, 0x080c, 0x8078, 0x900e, 0x080c,
+	0xcd62, 0x007e, 0x004e, 0x001e, 0x8108, 0x1f04, 0x6218, 0x00ce,
+	0x015e, 0x00be, 0x0005, 0x00b6, 0x6010, 0x2058, 0xb800, 0xc0ec,
+	0xb802, 0x00be, 0x0005, 0x7810, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0ac, 0x0005, 0x6010, 0x00b6, 0x905d, 0x0108, 0xb800, 0x00be,
+	0xd0bc, 0x0005, 0x00b6, 0x00f6, 0x2001, 0x107e, 0x2004, 0x905d,
+	0x0110, 0xb800, 0xd0ec, 0x00fe, 0x00be, 0x0005, 0x0126, 0x0026,
+	0x2091, 0x8000, 0x0006, 0xbaa0, 0x9290, 0x1000, 0x2204, 0x9b06,
+	0x190c, 0x0db2, 0x000e, 0xba00, 0x9005, 0x0110, 0xc2fd, 0x0008,
+	0xc2fc, 0xba02, 0x002e, 0x012e, 0x0005, 0x2011, 0x1835, 0x2204,
+	0xd0cc, 0x0138, 0x2001, 0x1952, 0x200c, 0x2011, 0x6292, 0x080c,
+	0x7cd9, 0x0005, 0x2011, 0x6292, 0x080c, 0x7c4a, 0x2011, 0x1835,
+	0x2204, 0xc0cc, 0x2012, 0x0005, 0x080c, 0x5113, 0xd0ac, 0x0005,
+	0x080c, 0x5113, 0xd0a4, 0x0005, 0x0016, 0xb904, 0x9184, 0x00ff,
+	0x908e, 0x0006, 0x001e, 0x0005, 0x0016, 0xb904, 0x9184, 0xff00,
+	0x8007, 0x908e, 0x0006, 0x001e, 0x0005, 0x00b6, 0x00f6, 0x080c,
+	0xbcec, 0x0158, 0x70d4, 0x9084, 0x0028, 0x0138, 0x2001, 0x107f,
+	0x2004, 0x905d, 0x0110, 0xb8bc, 0xd094, 0x00fe, 0x00be, 0x0005,
+	0x2071, 0x1906, 0x7003, 0x0001, 0x7007, 0x0000, 0x9006, 0x7012,
+	0x7016, 0x701a, 0x701e, 0x700a, 0x7046, 0x2001, 0x1919, 0x2003,
+	0x0000, 0x0005, 0x0016, 0x00e6, 0x2071, 0x191a, 0x900e, 0x710a,
+	0x080c, 0x5113, 0xd0fc, 0x1140, 0x080c, 0x5113, 0x900e, 0xd09c,
+	0x0108, 0x8108, 0x7102, 0x00f8, 0x2001, 0x1873, 0x200c, 0x9184,
+	0x0007, 0x0002, 0x62e4, 0x62e4, 0x62e4, 0x62e4, 0x62e4, 0x62fa,
+	0x6308, 0x62e4, 0x7003, 0x0003, 0x2009, 0x1874, 0x210c, 0x9184,
+	0xff00, 0x8007, 0x9005, 0x1110, 0x2001, 0x0002, 0x7006, 0x0018,
+	0x7003, 0x0005, 0x0c88, 0x00ee, 0x001e, 0x0005, 0x00e6, 0x2071,
+	0x0050, 0x684c, 0x9005, 0x1150, 0x00e6, 0x2071, 0x1906, 0x7028,
+	0xc085, 0x702a, 0x00ee, 0x9085, 0x0001, 0x0488, 0x6844, 0x9005,
+	0x0158, 0x080c, 0x6f9c, 0x6a60, 0x9200, 0x7002, 0x6864, 0x9101,
+	0x7006, 0x9006, 0x7012, 0x7016, 0x6860, 0x7002, 0x6864, 0x7006,
+	0x6868, 0x700a, 0x686c, 0x700e, 0x6844, 0x9005, 0x1110, 0x7012,
+	0x7016, 0x684c, 0x701a, 0x701c, 0x9085, 0x0040, 0x701e, 0x7037,
+	0x0019, 0x702b, 0x0001, 0x00e6, 0x2071, 0x1906, 0x7028, 0xc084,
+	0x702a, 0x7007, 0x0001, 0x700b, 0x0000, 0x00ee, 0x9006, 0x00ee,
+	0x0005, 0xa868, 0xd0fc, 0x11d8, 0x00e6, 0x0026, 0x2001, 0x191a,
+	0x2004, 0x9005, 0x0904, 0x653b, 0xa87c, 0xd0bc, 0x1904, 0x653b,
+	0xa978, 0xa874, 0x9105, 0x1904, 0x653b, 0x2001, 0x191a, 0x2004,
+	0x0002, 0x653b, 0x6394, 0x63d0, 0x63d0, 0x653b, 0x63d0, 0x0005,
+	0xa868, 0xd0fc, 0x1500, 0x00e6, 0x0026, 0x2009, 0x191a, 0x210c,
+	0x81ff, 0x0904, 0x653b, 0xa87c, 0xd0cc, 0x0904, 0x653b, 0xa880,
+	0x9084, 0x00ff, 0x9086, 0x0001, 0x1904, 0x653b, 0x9186, 0x0003,
+	0x0904, 0x63d0, 0x9186, 0x0005, 0x0904, 0x63d0, 0xa84f, 0x8021,
+	0xa853, 0x0017, 0x0028, 0x0005, 0xa84f, 0x8020, 0xa853, 0x0016,
+	0x2071, 0x1906, 0x701c, 0x9005, 0x1904, 0x66fb, 0x0e04, 0x6746,
+	0x2071, 0x0000, 0xa84c, 0x7082, 0xa850, 0x7032, 0xa86c, 0x7086,
+	0x7036, 0xa870, 0x708a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x1167, 0x2071, 0x1800, 0x2011, 0x0001, 0xa804,
+	0x900d, 0x702c, 0x1158, 0xa802, 0x2900, 0x702e, 0x70b8, 0x9200,
+	0x70ba, 0x080c, 0x7b7c, 0x002e, 0x00ee, 0x0005, 0x0096, 0x2148,
+	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x009e, 0x0c58,
+	0xa84f, 0x0000, 0x00f6, 0x2079, 0x0050, 0x2071, 0x1906, 0xa803,
+	0x0000, 0x7010, 0x9005, 0x1904, 0x64bf, 0x782c, 0x908c, 0x0780,
+	0x190c, 0x686d, 0x8004, 0x8004, 0x8004, 0x9084, 0x0003, 0x0002,
+	0x63ee, 0x64bf, 0x6413, 0x645a, 0x080c, 0x0db2, 0x2071, 0x1800,
+	0x2900, 0x7822, 0xa804, 0x900d, 0x1170, 0x2071, 0x19c9, 0x703c,
+	0x9005, 0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802,
+	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70b8, 0x9200, 0x70ba,
+	0x080c, 0x7b7c, 0x0c10, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804,
+	0x900d, 0x1580, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c,
+	0x1148, 0x2009, 0x182e, 0x210c, 0x918a, 0x0040, 0x0218, 0x7022,
+	0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e,
+	0x70b8, 0x8000, 0x70ba, 0x080c, 0x7b7c, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x686d, 0xd0a4, 0x19f0, 0x2071, 0x19c9, 0x703c, 0x9005,
+	0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e,
+	0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210,
+	0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70b8, 0x9200, 0x70ba, 0x080c,
+	0x7b7c, 0x0800, 0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800,
+	0x702c, 0xa802, 0x2900, 0x702e, 0x70b8, 0x8000, 0x70ba, 0x080c,
+	0x7b7c, 0x782c, 0x9094, 0x0780, 0x190c, 0x686d, 0xd0a4, 0x1d60,
+	0x00ee, 0x782c, 0x9094, 0x0780, 0x190c, 0x686d, 0xd09c, 0x11a0,
+	0x009e, 0x2900, 0x7822, 0xa804, 0x900d, 0x1560, 0x2071, 0x19c9,
+	0x703c, 0x9005, 0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e,
+	0x00fe, 0x002e, 0x00ee, 0x0005, 0x009e, 0x2908, 0x7010, 0x8000,
+	0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e,
+	0x2148, 0xa804, 0x900d, 0x1170, 0x2071, 0x19c9, 0x703c, 0x9005,
+	0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e,
+	0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904,
+	0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70b8, 0x9200,
+	0x70ba, 0x080c, 0x7b7c, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2908,
+	0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902,
+	0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1904, 0x6514, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x686d, 0xd09c, 0x1198, 0x701c, 0x904d,
+	0x0180, 0x7010, 0x8001, 0x7012, 0x1108, 0x701a, 0xa800, 0x701e,
+	0x2900, 0x7822, 0x782c, 0x9094, 0x0780, 0x190c, 0x686d, 0xd09c,
+	0x0d68, 0x782c, 0x9094, 0x0780, 0x190c, 0x686d, 0xd0a4, 0x01b0,
+	0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900,
+	0x702e, 0x70b8, 0x8000, 0x70ba, 0x080c, 0x7b7c, 0x782c, 0x9094,
+	0x0780, 0x190c, 0x686d, 0xd0a4, 0x1d60, 0x00ee, 0x2071, 0x19c9,
+	0x703c, 0x9005, 0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e,
+	0x00fe, 0x002e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800, 0x9016,
+	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
+	0x702e, 0x70b8, 0x9200, 0x70ba, 0x080c, 0x7b7c, 0x00ee, 0x0804,
+	0x64cf, 0xa868, 0xd0fc, 0x1904, 0x6577, 0x0096, 0xa804, 0xa807,
+	0x0000, 0x904d, 0x190c, 0x0f87, 0x009e, 0x0018, 0xa868, 0xd0fc,
+	0x15f0, 0x00e6, 0x0026, 0xa84f, 0x0000, 0x00f6, 0x2079, 0x0050,
+	0x2071, 0x1800, 0x70e4, 0x8001, 0x01d0, 0x1678, 0x2071, 0x1906,
+	0xa803, 0x0000, 0x7010, 0x9005, 0x1904, 0x6675, 0x782c, 0x908c,
+	0x0780, 0x190c, 0x686d, 0x8004, 0x8004, 0x8004, 0x9084, 0x0003,
+	0x0002, 0x6578, 0x6675, 0x6593, 0x6604, 0x080c, 0x0db2, 0x70e7,
+	0x0fa0, 0x71e0, 0x8107, 0x9106, 0x9094, 0x00c0, 0x9184, 0xff3f,
+	0x9205, 0x70e2, 0x3b08, 0x3a00, 0x9104, 0x918d, 0x00c0, 0x21d8,
+	0x9084, 0xff3f, 0x9205, 0x20d0, 0x0888, 0x70e6, 0x0878, 0x0005,
+	0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1120, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802,
+	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70b8, 0x9200, 0x70ba,
+	0x080c, 0x7b7c, 0x0c60, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804,
+	0x900d, 0x1904, 0x65f3, 0x7830, 0x8007, 0x9084, 0x001f, 0x9082,
+	0x0005, 0x1220, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7824, 0x00e6,
+	0x2071, 0x0040, 0x712c, 0xd19c, 0x1148, 0x2009, 0x182e, 0x210c,
+	0x918a, 0x0040, 0x0218, 0x7022, 0x00ee, 0x0058, 0x00ee, 0x2048,
+	0x702c, 0xa802, 0x2900, 0x702e, 0x70b8, 0x8000, 0x70ba, 0x080c,
+	0x7b7c, 0x782c, 0x9094, 0x0780, 0x190c, 0x686d, 0xd0a4, 0x19f0,
+	0x0e04, 0x65ea, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069,
+	0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x2001, 0x1917, 0x200c,
+	0xc184, 0x2102, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x1167, 0x2009, 0x1919, 0x200b, 0x0000, 0x00fe, 0x002e,
+	0x00ee, 0x0005, 0x2001, 0x1917, 0x200c, 0xc185, 0x2102, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802,
+	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70b8, 0x9200, 0x70ba,
+	0x080c, 0x7b7c, 0x0804, 0x65a6, 0x0096, 0x00e6, 0x7824, 0x2048,
+	0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70b8, 0x8000,
+	0x70ba, 0x080c, 0x7b7c, 0x782c, 0x9094, 0x0780, 0x190c, 0x686d,
+	0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x6648, 0x7838, 0x7938, 0x910e,
+	0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de,
+	0x7044, 0xc084, 0x7046, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x1167, 0x2009, 0x1919, 0x200b, 0x0000, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x686d, 0xd09c, 0x1170, 0x009e, 0x2900,
+	0x7822, 0xa804, 0x900d, 0x11e0, 0x00fe, 0x002e, 0x00ee, 0x0005,
+	0x7044, 0xc085, 0x7046, 0x0c58, 0x009e, 0x2908, 0x7010, 0x8000,
+	0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e,
+	0x2148, 0xa804, 0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005,
+	0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210,
+	0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70b8, 0x9200, 0x70ba, 0x080c,
+	0x7b7c, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2908, 0x7010, 0x8000,
+	0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e,
+	0x2148, 0xa804, 0x900d, 0x1904, 0x66e6, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x686d, 0xd09c, 0x11b0, 0x701c, 0x904d, 0x0198, 0xa84c,
+	0x9005, 0x1180, 0x7010, 0x8001, 0x7012, 0x1108, 0x701a, 0xa800,
+	0x701e, 0x2900, 0x7822, 0x782c, 0x9094, 0x0780, 0x190c, 0x686d,
+	0xd09c, 0x0d50, 0x782c, 0x9094, 0x0780, 0x190c, 0x686d, 0xd0a4,
+	0x05c8, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802,
+	0x2900, 0x702e, 0x70b8, 0x8000, 0x70ba, 0x080c, 0x7b7c, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x686d, 0xd0a4, 0x1d60, 0x00ee, 0x0e04,
+	0x66df, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000,
+	0x6836, 0x6833, 0x0013, 0x00de, 0x7044, 0xc084, 0x7046, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1167, 0x2009,
+	0x1919, 0x200b, 0x0000, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044,
+	0xc085, 0x7046, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x00e6, 0x2071,
+	0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
+	0x81ff, 0x1dc8, 0x702e, 0x70b8, 0x9200, 0x70ba, 0x080c, 0x7b7c,
+	0x00ee, 0x0804, 0x6685, 0x2071, 0x1906, 0xa803, 0x0000, 0x2908,
+	0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902,
+	0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1128, 0x1e04, 0x6726,
+	0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148,
+	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70b8,
+	0x9200, 0x70ba, 0x080c, 0x7b7c, 0x0e04, 0x6710, 0x2071, 0x1906,
+	0x701c, 0x2048, 0xa84c, 0x900d, 0x0d18, 0x2071, 0x0000, 0x7182,
+	0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1167, 0x2071,
+	0x1906, 0x080c, 0x6859, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1906,
+	0xa803, 0x0000, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d,
+	0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d,
+	0x1118, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c,
+	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
+	0x70b8, 0x9200, 0x70ba, 0x080c, 0x7b7c, 0x002e, 0x00ee, 0x0005,
+	0x0006, 0xa87c, 0x0006, 0xa867, 0x0103, 0x20a9, 0x001c, 0xa860,
+	0x20e8, 0xa85c, 0x9080, 0x001d, 0x20a0, 0x9006, 0x4004, 0x000e,
+	0x9084, 0x00ff, 0xa87e, 0x000e, 0xa87a, 0xa982, 0x0005, 0x2071,
+	0x1906, 0x7004, 0x0002, 0x6791, 0x6792, 0x6858, 0x6792, 0x0db2,
+	0x6858, 0x0005, 0x2001, 0x191a, 0x2004, 0x0002, 0x679c, 0x679c,
+	0x67f1, 0x67f2, 0x679c, 0x67f2, 0x0126, 0x2091, 0x8000, 0x1e0c,
+	0x6878, 0x701c, 0x904d, 0x01e0, 0xa84c, 0x9005, 0x01d8, 0x0e04,
+	0x67c0, 0xa94c, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c,
+	0x7086, 0x7036, 0xa870, 0x708a, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x1167, 0x2071, 0x1906, 0x080c, 0x6859,
+	0x012e, 0x0470, 0x2001, 0x005b, 0x2004, 0x9094, 0x0780, 0x190c,
+	0x686d, 0xd09c, 0x2071, 0x1906, 0x1510, 0x2071, 0x1906, 0x700f,
+	0x0001, 0xa964, 0x9184, 0x00ff, 0x9086, 0x0003, 0x1130, 0x810f,
+	0x918c, 0x00ff, 0x8101, 0x0108, 0x710e, 0x2900, 0x00d6, 0x2069,
+	0x0050, 0x6822, 0x00de, 0x2071, 0x1906, 0x701c, 0x2048, 0x7010,
+	0x8001, 0x7012, 0xa800, 0x701e, 0x9005, 0x1108, 0x701a, 0x012e,
+	0x0005, 0x0005, 0x00d6, 0x2008, 0x2069, 0x19c9, 0x683c, 0x9005,
+	0x0760, 0x0158, 0x9186, 0x0003, 0x0540, 0x2001, 0x1813, 0x2004,
+	0x2009, 0x1a8b, 0x210c, 0x9102, 0x1500, 0x0126, 0x2091, 0x8000,
+	0x2069, 0x0050, 0x693c, 0x6838, 0x9106, 0x0190, 0x0e04, 0x6824,
+	0x2069, 0x0000, 0x6837, 0x8040, 0x6833, 0x0012, 0x6883, 0x8040,
+	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1167,
+	0x2069, 0x19c9, 0x683f, 0xffff, 0x012e, 0x00de, 0x0126, 0x2091,
+	0x8000, 0x1e0c, 0x68e9, 0x701c, 0x904d, 0x0540, 0x2001, 0x005b,
+	0x2004, 0x9094, 0x0780, 0x15c9, 0xd09c, 0x1500, 0x2071, 0x1906,
+	0x700f, 0x0001, 0xa964, 0x9184, 0x00ff, 0x9086, 0x0003, 0x1130,
+	0x810f, 0x918c, 0x00ff, 0x8101, 0x0108, 0x710e, 0x2900, 0x00d6,
+	0x2069, 0x0050, 0x6822, 0x00de, 0x701c, 0x2048, 0x7010, 0x8001,
+	0x7012, 0xa800, 0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x0005,
+	0x0005, 0x0126, 0x2091, 0x8000, 0x701c, 0x904d, 0x0160, 0x7010,
+	0x8001, 0x7012, 0xa800, 0x701e, 0x9005, 0x1108, 0x701a, 0x012e,
+	0x080c, 0x1007, 0x0005, 0x012e, 0x0005, 0x2091, 0x8000, 0x0e04,
+	0x686f, 0x0006, 0x0016, 0x2001, 0x8004, 0x0006, 0x0804, 0x0dbb,
+	0x0096, 0x00f6, 0x2079, 0x0050, 0x7044, 0xd084, 0x01e0, 0xc084,
+	0x7046, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000,
+	0x6836, 0x6833, 0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x1167, 0x2009, 0x1919, 0x200b, 0x0000,
+	0x00fe, 0x009e, 0x0005, 0x782c, 0x9094, 0x0780, 0x1971, 0xd0a4,
+	0x0db8, 0x2009, 0x1919, 0x2104, 0x8000, 0x200a, 0x9082, 0x000f,
+	0x0e78, 0x00e6, 0x2071, 0x1800, 0x7824, 0x00e6, 0x2071, 0x0040,
+	0x712c, 0xd19c, 0x1148, 0x2009, 0x182e, 0x210c, 0x918a, 0x0040,
+	0x0218, 0x7022, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802,
+	0x2900, 0x702e, 0x70b8, 0x8000, 0x70ba, 0x080c, 0x7b7c, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x686d, 0xd0a4, 0x19f0, 0x7838, 0x7938,
+	0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013,
+	0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
+	0x1167, 0x2009, 0x1919, 0x200b, 0x0000, 0x00ee, 0x00fe, 0x009e,
+	0x0005, 0x00f6, 0x2079, 0x0050, 0x7044, 0xd084, 0x01b8, 0xc084,
+	0x7046, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000,
+	0x6836, 0x6833, 0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x1167, 0x00fe, 0x0005, 0x782c, 0x9094,
+	0x0780, 0x190c, 0x686d, 0xd0a4, 0x0db8, 0x00e6, 0x2071, 0x1800,
+	0x7824, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70b8, 0x8000,
+	0x70ba, 0x080c, 0x7b7c, 0x782c, 0x9094, 0x0780, 0x190c, 0x686d,
+	0xd0a4, 0x1d70, 0x00d6, 0x2069, 0x0050, 0x693c, 0x2069, 0x191a,
+	0x6808, 0x690a, 0x2069, 0x19c9, 0x9102, 0x1118, 0x683c, 0x9005,
+	0x1328, 0x2001, 0x191b, 0x200c, 0x810d, 0x693e, 0x00de, 0x00ee,
+	0x00fe, 0x0005, 0x7090, 0x908a, 0x0029, 0x1a0c, 0x0db2, 0x9082,
+	0x001d, 0x001b, 0x6027, 0x1e00, 0x0005, 0x6a0d, 0x6997, 0x69b3,
+	0x69db, 0x69fc, 0x6a3c, 0x6a4e, 0x69b3, 0x6a24, 0x6952, 0x6980,
+	0x6951, 0x0005, 0x00d6, 0x2069, 0x0200, 0x6804, 0x9005, 0x1180,
+	0x6808, 0x9005, 0x1518, 0x7093, 0x0028, 0x2069, 0x195e, 0x2d04,
+	0x7002, 0x080c, 0x6d8d, 0x6028, 0x9085, 0x0600, 0x602a, 0x00b0,
+	0x7093, 0x0028, 0x2069, 0x195e, 0x2d04, 0x7002, 0x6028, 0x9085,
+	0x0600, 0x602a, 0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0x1a31,
+	0x080c, 0x1872, 0x005e, 0x004e, 0x003e, 0x00ee, 0x00de, 0x0005,
+	0x00d6, 0x2069, 0x0200, 0x6804, 0x9005, 0x1178, 0x6808, 0x9005,
+	0x1160, 0x7093, 0x0028, 0x2069, 0x195e, 0x2d04, 0x7002, 0x080c,
+	0x6e17, 0x6028, 0x9085, 0x0600, 0x602a, 0x00de, 0x0005, 0x0006,
+	0x2001, 0x0090, 0x080c, 0x2987, 0x000e, 0x6124, 0xd1e4, 0x1190,
+	0x080c, 0x6abb, 0xd1d4, 0x1160, 0xd1dc, 0x1138, 0xd1cc, 0x0150,
+	0x7093, 0x0020, 0x080c, 0x6abb, 0x0028, 0x7093, 0x001d, 0x0010,
+	0x7093, 0x001f, 0x0005, 0x2001, 0x0088, 0x080c, 0x2987, 0x6124,
+	0xd1cc, 0x11d8, 0xd1dc, 0x11b0, 0xd1e4, 0x1188, 0x9184, 0x1e00,
+	0x11c8, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x6c7f,
+	0x2001, 0x0080, 0x080c, 0x2987, 0x7093, 0x0028, 0x0058, 0x7093,
+	0x001e, 0x0040, 0x7093, 0x001d, 0x0028, 0x7093, 0x0020, 0x0010,
+	0x7093, 0x001f, 0x0005, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e,
+	0x080c, 0x6c7f, 0x2001, 0x0080, 0x080c, 0x2987, 0x6124, 0xd1d4,
+	0x1180, 0xd1dc, 0x1158, 0xd1e4, 0x1130, 0x9184, 0x1e00, 0x1158,
+	0x7093, 0x0028, 0x0040, 0x7093, 0x001e, 0x0028, 0x7093, 0x001d,
+	0x0010, 0x7093, 0x001f, 0x0005, 0x2001, 0x00a0, 0x080c, 0x2987,
+	0x6124, 0xd1dc, 0x1138, 0xd1e4, 0x0138, 0x080c, 0x189c, 0x7093,
+	0x001e, 0x0010, 0x7093, 0x001d, 0x0005, 0x080c, 0x6b3e, 0x6124,
+	0xd1dc, 0x1188, 0x080c, 0x6abb, 0x0016, 0x080c, 0x189c, 0x001e,
+	0xd1d4, 0x1128, 0xd1e4, 0x0138, 0x7093, 0x001e, 0x0020, 0x7093,
+	0x001f, 0x080c, 0x6abb, 0x0005, 0x0006, 0x2001, 0x00a0, 0x080c,
+	0x2987, 0x000e, 0x6124, 0xd1d4, 0x1160, 0xd1cc, 0x1150, 0xd1dc,
+	0x1128, 0xd1e4, 0x0140, 0x7093, 0x001e, 0x0028, 0x7093, 0x001d,
+	0x0010, 0x7093, 0x0021, 0x0005, 0x080c, 0x6b3e, 0x6124, 0xd1d4,
+	0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x7093, 0x001e, 0x0028,
+	0x7093, 0x001d, 0x0010, 0x7093, 0x001f, 0x0005, 0x0006, 0x2001,
+	0x0090, 0x080c, 0x2987, 0x000e, 0x6124, 0xd1d4, 0x1178, 0xd1cc,
+	0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0158, 0x7093, 0x001e, 0x0040,
+	0x7093, 0x001d, 0x0028, 0x7093, 0x0020, 0x0010, 0x7093, 0x001f,
+	0x0005, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x0126, 0x2061, 0x0100,
+	0x2069, 0x0140, 0x2071, 0x1800, 0x2091, 0x8000, 0x080c, 0x6c53,
+	0x11d8, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x01b0, 0xc1b4, 0x2102,
+	0x6027, 0x0200, 0x080c, 0x28d0, 0x6024, 0xd0cc, 0x0148, 0x2001,
+	0x00a0, 0x080c, 0x2987, 0x080c, 0x6f2a, 0x080c, 0x5a21, 0x0428,
+	0x6028, 0xc0cd, 0x602a, 0x0408, 0x080c, 0x6c6d, 0x0150, 0x080c,
+	0x6c64, 0x1138, 0x2001, 0x0001, 0x080c, 0x247f, 0x080c, 0x6c2d,
+	0x00a0, 0x080c, 0x6b3b, 0x0178, 0x2001, 0x0001, 0x080c, 0x247f,
+	0x7090, 0x9086, 0x001e, 0x0120, 0x7090, 0x9086, 0x0022, 0x1118,
+	0x7093, 0x0025, 0x0010, 0x7093, 0x0021, 0x012e, 0x00ee, 0x00de,
+	0x00ce, 0x001e, 0x0005, 0x0026, 0x2011, 0x6acc, 0x080c, 0x7d1b,
+	0x002e, 0x0016, 0x0026, 0x2009, 0x0064, 0x2011, 0x6acc, 0x080c,
+	0x7d12, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00f6, 0x0016, 0x080c,
+	0x8fbb, 0x2071, 0x1800, 0x080c, 0x6a69, 0x001e, 0x00fe, 0x00ee,
+	0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
+	0x0126, 0x080c, 0x8fbb, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071,
+	0x1800, 0x2091, 0x8000, 0x6028, 0xc09c, 0x602a, 0x2011, 0x0003,
+	0x080c, 0x92ec, 0x2011, 0x0002, 0x080c, 0x92f6, 0x080c, 0x91de,
+	0x080c, 0x7cc7, 0x0036, 0x901e, 0x080c, 0x9254, 0x003e, 0x60e3,
+	0x0000, 0x080c, 0xd343, 0x080c, 0xd35e, 0x2009, 0x0004, 0x080c,
+	0x28d6, 0x080c, 0x27f1, 0x2001, 0x1800, 0x2003, 0x0004, 0x6027,
+	0x0008, 0x2011, 0x6acc, 0x080c, 0x7d1b, 0x080c, 0x6c6d, 0x0118,
+	0x9006, 0x080c, 0x2987, 0x080c, 0x0b94, 0x2001, 0x0001, 0x080c,
+	0x247f, 0x012e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e,
+	0x001e, 0x0005, 0x0026, 0x00e6, 0x2011, 0x6ad9, 0x2071, 0x19c9,
+	0x701c, 0x9206, 0x1118, 0x7018, 0x9005, 0x0110, 0x9085, 0x0001,
+	0x00ee, 0x002e, 0x0005, 0x6020, 0xd09c, 0x0005, 0x6800, 0x9084,
+	0xfffe, 0x9086, 0x00c0, 0x01b8, 0x2001, 0x00c0, 0x080c, 0x2987,
+	0x0156, 0x20a9, 0x002d, 0x1d04, 0x6b4b, 0x2091, 0x6000, 0x1f04,
+	0x6b4b, 0x015e, 0x00d6, 0x2069, 0x1800, 0x6894, 0x8001, 0x0220,
+	0x0118, 0x6896, 0x00de, 0x0005, 0x6897, 0x0014, 0x68e0, 0xd0dc,
+	0x0dc8, 0x6800, 0x9086, 0x0001, 0x1da8, 0x080c, 0x7d27, 0x0c90,
+	0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071,
+	0x1800, 0x080c, 0x6f39, 0x2001, 0x193e, 0x2003, 0x0000, 0x9006,
+	0x7092, 0x60e2, 0x6886, 0x080c, 0x254a, 0x9006, 0x080c, 0x2987,
+	0x080c, 0x58e0, 0x6027, 0xffff, 0x602b, 0x182f, 0x00ee, 0x00de,
+	0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x2071, 0x1800, 0x2001, 0x194e, 0x200c, 0x9186, 0x0000,
+	0x0158, 0x9186, 0x0001, 0x0158, 0x9186, 0x0002, 0x0158, 0x9186,
+	0x0003, 0x0158, 0x0804, 0x6c1d, 0x7093, 0x0022, 0x0040, 0x7093,
+	0x0021, 0x0028, 0x7093, 0x0023, 0x0010, 0x7093, 0x0024, 0x60e3,
+	0x0000, 0x6887, 0x0001, 0x2001, 0x0001, 0x080c, 0x254a, 0x0026,
+	0x080c, 0x9947, 0x002e, 0x7000, 0x908e, 0x0004, 0x0118, 0x602b,
+	0x0028, 0x0010, 0x602b, 0x0020, 0x0156, 0x0126, 0x2091, 0x8000,
+	0x20a9, 0x0005, 0x6024, 0xd0ac, 0x0150, 0x012e, 0x015e, 0x080c,
+	0xbcec, 0x0118, 0x9006, 0x080c, 0x29b1, 0x0804, 0x6c29, 0x6800,
+	0x9084, 0x00a1, 0xc0bd, 0x6802, 0x080c, 0x28d0, 0x6904, 0xd1d4,
+	0x1140, 0x2001, 0x0100, 0x080c, 0x2987, 0x1f04, 0x6bca, 0x080c,
+	0x6caa, 0x012e, 0x015e, 0x080c, 0x6c64, 0x01a8, 0x6044, 0x9005,
+	0x0168, 0x6050, 0x0006, 0x9085, 0x0020, 0x6052, 0x080c, 0x6caa,
+	0x9006, 0x8001, 0x1df0, 0x000e, 0x6052, 0x0028, 0x6804, 0xd0d4,
+	0x1110, 0x080c, 0x6caa, 0x080c, 0xbcec, 0x0118, 0x9006, 0x080c,
+	0x29b1, 0x0016, 0x0026, 0x7000, 0x908e, 0x0004, 0x0130, 0x2009,
+	0x00c8, 0x2011, 0x6ad9, 0x080c, 0x7cd9, 0x002e, 0x001e, 0x080c,
+	0x7b73, 0x2001, 0x194e, 0x2003, 0x0004, 0x080c, 0x693a, 0x080c,
+	0x6c64, 0x0138, 0x6804, 0xd0d4, 0x1120, 0xd0dc, 0x1100, 0x080c,
+	0x6f2f, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6,
+	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x7b7c,
+	0x080c, 0x6f39, 0x2001, 0x193e, 0x2003, 0x0000, 0x9006, 0x7092,
+	0x60e2, 0x6886, 0x080c, 0x254a, 0x9006, 0x080c, 0x2987, 0x6043,
+	0x0090, 0x6043, 0x0010, 0x6027, 0xffff, 0x602b, 0x182f, 0x00ee,
+	0x00de, 0x00ce, 0x0005, 0x0006, 0x2001, 0x194d, 0x2004, 0x9086,
+	0xaaaa, 0x000e, 0x0005, 0x0006, 0x080c, 0x5117, 0x9084, 0x0030,
+	0x9086, 0x0000, 0x000e, 0x0005, 0x0006, 0x080c, 0x5117, 0x9084,
+	0x0030, 0x9086, 0x0030, 0x000e, 0x0005, 0x0006, 0x080c, 0x5117,
+	0x9084, 0x0030, 0x9086, 0x0010, 0x000e, 0x0005, 0x0006, 0x080c,
+	0x5117, 0x9084, 0x0030, 0x9086, 0x0020, 0x000e, 0x0005, 0x0036,
+	0x0016, 0x2001, 0x180c, 0x2004, 0x908c, 0x0013, 0x0180, 0x0020,
+	0x080c, 0x256a, 0x900e, 0x0028, 0x080c, 0x629c, 0x1dc8, 0x2009,
+	0x0002, 0x2019, 0x0028, 0x080c, 0x2dfb, 0x9006, 0x0019, 0x001e,
+	0x003e, 0x0005, 0x00e6, 0x2071, 0x180c, 0x2e04, 0x0130, 0x080c,
+	0xbce5, 0x1128, 0x9085, 0x0010, 0x0010, 0x9084, 0xffef, 0x2072,
+	0x00ee, 0x0005, 0x6050, 0x0006, 0x60ec, 0x0006, 0x600c, 0x0006,
+	0x6004, 0x0006, 0x6028, 0x0006, 0x0016, 0x6138, 0x6050, 0x9084,
+	0xfbff, 0x9085, 0x2000, 0x6052, 0x613a, 0x20a9, 0x0012, 0x1d04,
+	0x6cbf, 0x2091, 0x6000, 0x1f04, 0x6cbf, 0x602f, 0x0100, 0x602f,
+	0x0000, 0x6050, 0x9085, 0x0400, 0x9084, 0xdfff, 0x6052, 0x613a,
+	0x001e, 0x602f, 0x0040, 0x602f, 0x0000, 0x000e, 0x602a, 0x000e,
+	0x6006, 0x000e, 0x600e, 0x000e, 0x60ee, 0x60e3, 0x0000, 0x6887,
+	0x0001, 0x2001, 0x0001, 0x080c, 0x254a, 0x2001, 0x00a0, 0x0006,
+	0x080c, 0xbcec, 0x000e, 0x0130, 0x080c, 0x29a5, 0x9006, 0x080c,
+	0x29b1, 0x0010, 0x080c, 0x2987, 0x000e, 0x6052, 0x6050, 0x0006,
+	0xc0e5, 0x6052, 0x00f6, 0x2079, 0x0100, 0x080c, 0x2845, 0x00fe,
+	0x000e, 0x6052, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6,
+	0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800,
+	0x6020, 0x9084, 0x0080, 0x0138, 0x2001, 0x180c, 0x200c, 0xc1c5,
+	0x2102, 0x0804, 0x6d7f, 0x2001, 0x180c, 0x200c, 0xc1c4, 0x2102,
+	0x6028, 0x9084, 0xe1ff, 0x602a, 0x6027, 0x0200, 0x2001, 0x0090,
+	0x080c, 0x2987, 0x20a9, 0x0366, 0x6024, 0xd0cc, 0x1518, 0x1d04,
+	0x6d2c, 0x2091, 0x6000, 0x1f04, 0x6d2c, 0x2011, 0x0003, 0x080c,
+	0x92ec, 0x2011, 0x0002, 0x080c, 0x92f6, 0x080c, 0x91de, 0x901e,
+	0x080c, 0x9254, 0x2001, 0x00a0, 0x080c, 0x2987, 0x080c, 0x6f2a,
+	0x080c, 0x5a21, 0x080c, 0xbcec, 0x0110, 0x080c, 0x0d27, 0x9085,
+	0x0001, 0x0498, 0x86ff, 0x1110, 0x080c, 0x189c, 0x60e3, 0x0000,
+	0x2001, 0x193e, 0x2004, 0x080c, 0x254a, 0x60e2, 0x2001, 0x0080,
+	0x080c, 0x2987, 0x20a9, 0x0366, 0x6027, 0x1e00, 0x2009, 0x1e00,
+	0x080c, 0x28d0, 0x6024, 0x910c, 0x0138, 0x1d04, 0x6d64, 0x2091,
+	0x6000, 0x1f04, 0x6d64, 0x0808, 0x6028, 0x9085, 0x1e00, 0x602a,
+	0x70ac, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x080c,
+	0xbcec, 0x0110, 0x080c, 0x0d27, 0x9006, 0x00ee, 0x00de, 0x00ce,
+	0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026,
+	0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800,
+	0x2069, 0x0140, 0x6020, 0x9084, 0x00c0, 0x0120, 0x6884, 0x9005,
+	0x1904, 0x6de1, 0x2001, 0x0088, 0x080c, 0x2987, 0x9006, 0x60e2,
+	0x6886, 0x080c, 0x254a, 0x2069, 0x0200, 0x6804, 0x9005, 0x1118,
+	0x6808, 0x9005, 0x01c0, 0x6028, 0x9084, 0xfbff, 0x602a, 0x6027,
+	0x0400, 0x2069, 0x195e, 0x7000, 0x206a, 0x7093, 0x0026, 0x7003,
+	0x0001, 0x20a9, 0x0002, 0x1d04, 0x6dc3, 0x2091, 0x6000, 0x1f04,
+	0x6dc3, 0x0804, 0x6e0f, 0x2069, 0x0140, 0x20a9, 0x0384, 0x6027,
+	0x1e00, 0x2009, 0x1e00, 0x080c, 0x28d0, 0x6024, 0x910c, 0x0508,
+	0x9084, 0x1a00, 0x11f0, 0x1d04, 0x6dcf, 0x2091, 0x6000, 0x1f04,
+	0x6dcf, 0x2011, 0x0003, 0x080c, 0x92ec, 0x2011, 0x0002, 0x080c,
+	0x92f6, 0x080c, 0x91de, 0x901e, 0x080c, 0x9254, 0x2001, 0x00a0,
+	0x080c, 0x2987, 0x080c, 0x6f2a, 0x080c, 0x5a21, 0x9085, 0x0001,
+	0x00b0, 0x2001, 0x0080, 0x080c, 0x2987, 0x2069, 0x0140, 0x60e3,
+	0x0000, 0x70ac, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886,
+	0x2001, 0x193e, 0x2004, 0x080c, 0x254a, 0x60e2, 0x9006, 0x00ee,
+	0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156,
+	0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100,
+	0x2071, 0x1800, 0x6020, 0x9084, 0x00c0, 0x01c8, 0x2011, 0x0003,
+	0x080c, 0x92ec, 0x2011, 0x0002, 0x080c, 0x92f6, 0x080c, 0x91de,
+	0x901e, 0x080c, 0x9254, 0x2069, 0x0140, 0x2001, 0x00a0, 0x080c,
+	0x2987, 0x080c, 0x6f2a, 0x080c, 0x5a21, 0x0804, 0x6eaa, 0x2001,
+	0x180c, 0x200c, 0xd1b4, 0x1160, 0xc1b5, 0x2102, 0x080c, 0x6ac1,
+	0x2069, 0x0140, 0x2001, 0x0080, 0x080c, 0x2987, 0x60e3, 0x0000,
+	0x2069, 0x0200, 0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x0180,
+	0x6028, 0x9084, 0xfdff, 0x602a, 0x6027, 0x0200, 0x2069, 0x195e,
+	0x7000, 0x206a, 0x7093, 0x0027, 0x7003, 0x0001, 0x0804, 0x6eaa,
+	0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c, 0x28d0, 0x6024, 0x910c,
+	0x01c8, 0x9084, 0x1c00, 0x11b0, 0x1d04, 0x6e68, 0x0006, 0x0016,
+	0x00c6, 0x00d6, 0x00e6, 0x080c, 0x7bae, 0x00ee, 0x00de, 0x00ce,
+	0x001e, 0x000e, 0x00e6, 0x2071, 0x19c9, 0x7018, 0x00ee, 0x9005,
+	0x19f8, 0x0500, 0x0026, 0x2011, 0x6ad9, 0x080c, 0x7c4a, 0x2011,
+	0x6acc, 0x080c, 0x7d1b, 0x002e, 0x2069, 0x0140, 0x60e3, 0x0000,
+	0x70ac, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001,
+	0x193e, 0x2004, 0x080c, 0x254a, 0x60e2, 0x2001, 0x180c, 0x200c,
+	0xc1b4, 0x2102, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e,
+	0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x0046, 0x00c6,
+	0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x080c, 0xbce5, 0x1904,
+	0x6f18, 0x7130, 0xd184, 0x1170, 0x080c, 0x2f86, 0x0138, 0xc18d,
+	0x7132, 0x2011, 0x1854, 0x2214, 0xd2ac, 0x1120, 0x7030, 0xd08c,
+	0x0904, 0x6f18, 0x2011, 0x1854, 0x220c, 0xd1a4, 0x0538, 0x0016,
+	0x2019, 0x000e, 0x080c, 0xcf62, 0x0156, 0x00b6, 0x20a9, 0x007f,
+	0x900e, 0x9186, 0x007e, 0x01a0, 0x9186, 0x0080, 0x0188, 0x080c,
+	0x5f7e, 0x1170, 0x2120, 0x9006, 0x0016, 0x2009, 0x000e, 0x080c,
+	0xcfe6, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c, 0x7e3e, 0x001e,
+	0x8108, 0x1f04, 0x6ee1, 0x00be, 0x015e, 0x001e, 0xd1ac, 0x1148,
+	0x0016, 0x2009, 0x0002, 0x2019, 0x0004, 0x080c, 0x2dfb, 0x001e,
+	0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c, 0x5f7e,
+	0x1110, 0x080c, 0x5a3b, 0x8108, 0x1f04, 0x6f0e, 0x00be, 0x015e,
+	0x080c, 0x189c, 0x080c, 0x9947, 0x60e3, 0x0000, 0x080c, 0x5a21,
+	0x080c, 0x6b8a, 0x00ee, 0x00ce, 0x004e, 0x003e, 0x002e, 0x001e,
+	0x015e, 0x0005, 0x2001, 0x194e, 0x2003, 0x0001, 0x0005, 0x2001,
+	0x194e, 0x2003, 0x0000, 0x0005, 0x2001, 0x194d, 0x2003, 0xaaaa,
+	0x0005, 0x2001, 0x194d, 0x2003, 0x0000, 0x0005, 0x2071, 0x18f0,
+	0x7003, 0x0000, 0x7007, 0x0000, 0x080c, 0x0fee, 0x090c, 0x0db2,
+	0xa8ab, 0xdcb0, 0x2900, 0x704e, 0x080c, 0x0fee, 0x090c, 0x0db2,
+	0xa8ab, 0xdcb0, 0x2900, 0x7052, 0xa867, 0x0000, 0xa86b, 0x0001,
+	0xa89f, 0x0000, 0x0005, 0x00e6, 0x2071, 0x0040, 0x6848, 0x9005,
+	0x1118, 0x9085, 0x0001, 0x04b0, 0x6840, 0x9005, 0x0150, 0x04a1,
+	0x6a50, 0x9200, 0x7002, 0x6854, 0x9101, 0x7006, 0x9006, 0x7012,
+	0x7016, 0x6850, 0x7002, 0x6854, 0x7006, 0x6858, 0x700a, 0x685c,
+	0x700e, 0x6840, 0x9005, 0x1110, 0x7012, 0x7016, 0x6848, 0x701a,
+	0x701c, 0x9085, 0x0040, 0x701e, 0x2001, 0x0019, 0x7036, 0x702b,
+	0x0001, 0x2001, 0x0004, 0x200c, 0x918c, 0xfff7, 0x918d, 0x8000,
+	0x2102, 0x00d6, 0x2069, 0x18f0, 0x6807, 0x0001, 0x00de, 0x080c,
+	0x74e5, 0x9006, 0x00ee, 0x0005, 0x900e, 0x0156, 0x20a9, 0x0006,
+	0x8003, 0x2011, 0x0100, 0x2214, 0x9296, 0x0008, 0x1110, 0x818d,
+	0x0010, 0x81f5, 0x3e08, 0x1f04, 0x6fa0, 0x015e, 0x0005, 0x2079,
+	0x0040, 0x2071, 0x18f0, 0x7004, 0x0002, 0x6fbf, 0x6fc0, 0x6ff7,
+	0x7052, 0x714d, 0x6fbd, 0x6fbd, 0x7177, 0x080c, 0x0db2, 0x0005,
+	0x2079, 0x0040, 0x782c, 0x908c, 0x0780, 0x190c, 0x7571, 0xd0a4,
+	0x01f0, 0x7824, 0x2048, 0x9006, 0xa802, 0xa806, 0xa864, 0x9084,
+	0x00ff, 0x908a, 0x0040, 0x0608, 0x00b8, 0x2001, 0x1800, 0x200c,
+	0x9186, 0x0003, 0x1160, 0x7104, 0x9186, 0x0004, 0x0140, 0x9186,
+	0x0007, 0x0128, 0x9186, 0x0003, 0x19e8, 0x080c, 0x7052, 0x782c,
+	0xd09c, 0x090c, 0x74e5, 0x0005, 0x9082, 0x005a, 0x1218, 0x2100,
+	0x003b, 0x0c18, 0x080c, 0x7088, 0x0c90, 0x00e3, 0x08f0, 0x0005,
+	0x7088, 0x7088, 0x7088, 0x7088, 0x7088, 0x7088, 0x7088, 0x7088,
+	0x70aa, 0x7088, 0x7088, 0x7088, 0x7088, 0x7088, 0x7088, 0x7088,
+	0x7088, 0x7088, 0x7088, 0x7088, 0x7088, 0x7088, 0x7088, 0x7088,
+	0x7088, 0x7088, 0x7088, 0x7088, 0x7094, 0x7088, 0x724c, 0x7088,
+	0x7088, 0x7088, 0x7088, 0x7088, 0x7094, 0x728d, 0x72ce, 0x7315,
+	0x7329, 0x7088, 0x7088, 0x70aa, 0x7094, 0x7088, 0x7088, 0x7121,
+	0x73d4, 0x73ef, 0x7088, 0x70aa, 0x7088, 0x7088, 0x7088, 0x7088,
+	0x7117, 0x73ef, 0x7088, 0x7088, 0x7088, 0x7088, 0x7088, 0x7088,
+	0x7088, 0x7088, 0x7088, 0x70be, 0x7088, 0x7088, 0x7088, 0x7088,
+	0x7088, 0x7088, 0x7088, 0x7088, 0x7088, 0x7515, 0x7088, 0x7088,
+	0x7088, 0x7088, 0x7088, 0x70d2, 0x7088, 0x7088, 0x7088, 0x7088,
+	0x7088, 0x7088, 0x2079, 0x0040, 0x7004, 0x9086, 0x0003, 0x1198,
+	0x782c, 0x080c, 0x750e, 0xd0a4, 0x0170, 0x7824, 0x2048, 0x9006,
+	0xa802, 0xa806, 0xa864, 0x9084, 0x00ff, 0x908a, 0x001a, 0x1210,
+	0x002b, 0x0c50, 0x00e9, 0x080c, 0x74e5, 0x0005, 0x7088, 0x7094,
+	0x7238, 0x7088, 0x7094, 0x7088, 0x7094, 0x7094, 0x7088, 0x7094,
+	0x7238, 0x7094, 0x7094, 0x7094, 0x7094, 0x7094, 0x7088, 0x7094,
+	0x7238, 0x7088, 0x7088, 0x7094, 0x7088, 0x7088, 0x7088, 0x7094,
+	0x00e6, 0x2071, 0x18f0, 0x2009, 0x0400, 0x0071, 0x00ee, 0x0005,
+	0x2009, 0x1000, 0x0049, 0x0005, 0x2009, 0x2000, 0x0029, 0x0005,
+	0x2009, 0x0800, 0x0009, 0x0005, 0x7007, 0x0001, 0xa868, 0x9084,
+	0x00ff, 0x9105, 0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6536,
+	0x012e, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0d08, 0x8001,
+	0x1120, 0x7007, 0x0001, 0x0804, 0x71f6, 0x7007, 0x0003, 0x7012,
+	0x2900, 0x7016, 0x701a, 0x704b, 0x71f6, 0x0005, 0xa864, 0x8007,
+	0x9084, 0x00ff, 0x0968, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804,
+	0x7211, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b,
+	0x7211, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x9086, 0x0001,
+	0x1904, 0x7090, 0x7007, 0x0001, 0x2009, 0x1832, 0x210c, 0x81ff,
+	0x11a8, 0xa868, 0x9084, 0x00ff, 0xa86a, 0xa883, 0x0000, 0x080c,
+	0x5c50, 0x1108, 0x0005, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139,
+	0xa87a, 0xa982, 0x080c, 0x6536, 0x012e, 0x0ca0, 0xa994, 0x9186,
+	0x0071, 0x0d38, 0x9186, 0x0064, 0x0d20, 0x9186, 0x007c, 0x0d08,
+	0x9186, 0x0028, 0x09f0, 0x9186, 0x0038, 0x09d8, 0x9186, 0x0078,
+	0x09c0, 0x9186, 0x005f, 0x09a8, 0x9186, 0x0056, 0x0990, 0xa897,
+	0x4005, 0xa89b, 0x0001, 0x2001, 0x0030, 0x900e, 0x08a0, 0xa87c,
+	0x9084, 0x00c0, 0x9086, 0x00c0, 0x1120, 0x7007, 0x0001, 0x0804,
+	0x7406, 0x2900, 0x7016, 0x701a, 0x20a9, 0x0004, 0xa860, 0x20e0,
+	0xa85c, 0x9080, 0x0030, 0x2098, 0x7050, 0x2040, 0xa060, 0x20e8,
+	0xa05c, 0x9080, 0x0023, 0x20a0, 0x4003, 0xa888, 0x7012, 0x9082,
+	0x0401, 0x1a04, 0x7098, 0xaab4, 0x928a, 0x0002, 0x1a04, 0x7098,
+	0x82ff, 0x1138, 0xa8b8, 0xa9bc, 0x9105, 0x0118, 0x2001, 0x71b4,
+	0x0018, 0x9280, 0x71aa, 0x2005, 0x7056, 0x7010, 0x9015, 0x0904,
+	0x7195, 0x080c, 0x0fee, 0x1118, 0x7007, 0x0004, 0x0005, 0x2900,
+	0x7022, 0x7054, 0x2060, 0xe000, 0xa866, 0x7050, 0x2040, 0xa95c,
+	0xe004, 0x9100, 0xa076, 0xa860, 0xa072, 0xe008, 0x920a, 0x1210,
+	0x900e, 0x2200, 0x7112, 0xe20c, 0x8003, 0x800b, 0x9296, 0x0004,
+	0x0108, 0x9108, 0xa17a, 0x810b, 0xa17e, 0x080c, 0x10b5, 0xa06c,
+	0x908e, 0x0100, 0x0170, 0x9086, 0x0200, 0x0118, 0x7007, 0x0007,
+	0x0005, 0x7020, 0x2048, 0x080c, 0x1007, 0x7014, 0x2048, 0x0804,
+	0x7098, 0x7020, 0x2048, 0x7018, 0xa802, 0xa807, 0x0000, 0x2908,
+	0x2048, 0xa906, 0x711a, 0x0804, 0x714d, 0x7014, 0x2048, 0x7007,
+	0x0001, 0xa8b4, 0x9005, 0x1128, 0xa8b8, 0xa9bc, 0x9105, 0x0108,
+	0x00b9, 0xa864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x0904, 0x7406,
+	0x0804, 0x71f6, 0x71ac, 0x71b0, 0x0002, 0x001d, 0x0007, 0x0004,
+	0x000a, 0x001b, 0x0005, 0x0006, 0x000a, 0x001d, 0x0005, 0x0004,
+	0x0076, 0x0066, 0xafb8, 0xaebc, 0xa804, 0x2050, 0xb0c0, 0xb0e2,
+	0xb0bc, 0xb0de, 0xb0b8, 0xb0d2, 0xb0b4, 0xb0ce, 0xb6da, 0xb7d6,
+	0xb0b0, 0xb0ca, 0xb0ac, 0xb0c6, 0xb0a8, 0xb0ba, 0xb0a4, 0xb0b6,
+	0xb6c2, 0xb7be, 0xb0a0, 0xb0b2, 0xb09c, 0xb0ae, 0xb098, 0xb0a2,
+	0xb094, 0xb09e, 0xb6aa, 0xb7a6, 0xb090, 0xb09a, 0xb08c, 0xb096,
+	0xb088, 0xb08a, 0xb084, 0xb086, 0xb692, 0xb78e, 0xb080, 0xb082,
+	0xb07c, 0xb07e, 0xb078, 0xb072, 0xb074, 0xb06e, 0xb67a, 0xb776,
+	0xb004, 0x9055, 0x1958, 0x006e, 0x007e, 0x0005, 0x2009, 0x1832,
+	0x210c, 0x81ff, 0x1178, 0x080c, 0x5a9d, 0x1108, 0x0005, 0x080c,
+	0x6770, 0x0126, 0x2091, 0x8000, 0x080c, 0xb8e3, 0x080c, 0x6536,
+	0x012e, 0x0ca0, 0x080c, 0xbce5, 0x1d70, 0x2001, 0x0028, 0x900e,
+	0x0c70, 0x2009, 0x1832, 0x210c, 0x81ff, 0x11d8, 0xa888, 0x9005,
+	0x01e0, 0xa883, 0x0000, 0xa87c, 0xd0f4, 0x0120, 0x080c, 0x5bb2,
+	0x1138, 0x0005, 0x9006, 0xa87a, 0x080c, 0x5b2d, 0x1108, 0x0005,
+	0x0126, 0x2091, 0x8000, 0xa87a, 0xa982, 0x080c, 0x6536, 0x012e,
+	0x0cb0, 0x2001, 0x0028, 0x900e, 0x0c98, 0x2001, 0x0000, 0x0c80,
+	0x7018, 0xa802, 0x2908, 0x2048, 0xa906, 0x711a, 0x7010, 0x8001,
+	0x7012, 0x0118, 0x7007, 0x0003, 0x0030, 0x7014, 0x2048, 0x7007,
+	0x0001, 0x7048, 0x080f, 0x0005, 0x00b6, 0x7007, 0x0001, 0xa974,
+	0xa878, 0x9084, 0x00ff, 0x9096, 0x0004, 0x0540, 0x20a9, 0x0001,
+	0x9096, 0x0001, 0x0190, 0x900e, 0x20a9, 0x0800, 0x9096, 0x0002,
+	0x0160, 0x9005, 0x11d8, 0xa974, 0x080c, 0x5f7e, 0x11b8, 0x0066,
+	0xae80, 0x080c, 0x608e, 0x006e, 0x0088, 0x0046, 0x2011, 0x180c,
+	0x2224, 0xc484, 0x2412, 0x004e, 0x00c6, 0x080c, 0x5f7e, 0x1110,
+	0x080c, 0x618e, 0x8108, 0x1f04, 0x7275, 0x00ce, 0xa87c, 0xd084,
+	0x1120, 0x080c, 0x1007, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6536, 0x012e, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x7007, 0x0001, 0x080c, 0x62a0, 0x0580, 0x2061, 0x1a3e, 0x6100,
+	0xd184, 0x0178, 0xa888, 0x9084, 0x00ff, 0x1550, 0x6000, 0xd084,
+	0x0520, 0x6004, 0x9005, 0x1538, 0x6003, 0x0000, 0x600b, 0x0000,
+	0x00c8, 0x2011, 0x0001, 0xa890, 0x9005, 0x1110, 0x2001, 0x001e,
+	0x8000, 0x6016, 0xa888, 0x9084, 0x00ff, 0x0178, 0x6006, 0xa888,
+	0x8007, 0x9084, 0x00ff, 0x0148, 0x600a, 0xa888, 0x8000, 0x1108,
+	0xc28d, 0x6202, 0x012e, 0x0804, 0x74cf, 0x012e, 0x0804, 0x74c9,
+	0x012e, 0x0804, 0x74c3, 0x012e, 0x0804, 0x74c6, 0x0126, 0x2091,
+	0x8000, 0x7007, 0x0001, 0x080c, 0x62a0, 0x05e0, 0x2061, 0x1a3e,
+	0x6000, 0xd084, 0x05b8, 0x6204, 0x6308, 0xd08c, 0x1530, 0xac78,
+	0x9484, 0x0003, 0x0170, 0xa988, 0x918c, 0x00ff, 0x8001, 0x1120,
+	0x2100, 0x9210, 0x0620, 0x0028, 0x8001, 0x1508, 0x2100, 0x9212,
+	0x02f0, 0x9484, 0x000c, 0x0188, 0xa988, 0x810f, 0x918c, 0x00ff,
+	0x9082, 0x0004, 0x1120, 0x2100, 0x9318, 0x0288, 0x0030, 0x9082,
+	0x0004, 0x1168, 0x2100, 0x931a, 0x0250, 0xa890, 0x9005, 0x0110,
+	0x8000, 0x6016, 0x6206, 0x630a, 0x012e, 0x0804, 0x74cf, 0x012e,
+	0x0804, 0x74cc, 0x012e, 0x0804, 0x74c9, 0x0126, 0x2091, 0x8000,
+	0x7007, 0x0001, 0x2061, 0x1a3e, 0x6300, 0xd38c, 0x1120, 0x6308,
+	0x8318, 0x0220, 0x630a, 0x012e, 0x0804, 0x74dd, 0x012e, 0x0804,
+	0x74cc, 0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x7007, 0x0001,
+	0xa87c, 0xd0ac, 0x0148, 0x00c6, 0x2061, 0x1a3e, 0x6000, 0x9084,
+	0xfcff, 0x6002, 0x00ce, 0x0440, 0xa888, 0x9005, 0x05d8, 0xa88c,
+	0x9065, 0x0598, 0x2001, 0x1832, 0x2004, 0x9005, 0x0118, 0x080c,
+	0x9a06, 0x0068, 0x6017, 0xf400, 0x605b, 0x0000, 0xa97c, 0xd1a4,
+	0x0110, 0xa980, 0x615a, 0x2009, 0x0041, 0x080c, 0x9a50, 0xa988,
+	0x918c, 0xff00, 0x9186, 0x2000, 0x1138, 0x0026, 0x900e, 0x2011,
+	0xfdff, 0x080c, 0x7e3e, 0x002e, 0xa87c, 0xd0c4, 0x0148, 0x2061,
+	0x1a3e, 0x6000, 0xd08c, 0x1120, 0x6008, 0x8000, 0x0208, 0x600a,
+	0x00ce, 0x012e, 0x00be, 0x0804, 0x74cf, 0x00ce, 0x012e, 0x00be,
+	0x0804, 0x74c9, 0xa984, 0x9186, 0x002e, 0x0d30, 0x9186, 0x002d,
+	0x0d18, 0x9186, 0x0045, 0x0510, 0x9186, 0x002a, 0x1130, 0x2001,
+	0x180c, 0x200c, 0xc194, 0x2102, 0x08b8, 0x9186, 0x0020, 0x0158,
+	0x9186, 0x0029, 0x1d10, 0xa974, 0x080c, 0x5f7e, 0x1968, 0xb800,
+	0xc0e4, 0xb802, 0x0848, 0xa88c, 0x9065, 0x09b8, 0x6007, 0x0024,
+	0x2001, 0x1955, 0x2004, 0x601a, 0x0804, 0x7364, 0xa88c, 0x9065,
+	0x0960, 0x00e6, 0xa890, 0x9075, 0x2001, 0x1832, 0x2004, 0x9005,
+	0x0150, 0x080c, 0x9a06, 0x8eff, 0x0118, 0x2e60, 0x080c, 0x9a06,
+	0x00ee, 0x0804, 0x7364, 0x6024, 0xc0dc, 0xc0d5, 0x6026, 0x2e60,
+	0x6007, 0x003a, 0xa8a0, 0x9005, 0x0130, 0x6007, 0x003b, 0xa8a4,
+	0x602e, 0xa8a8, 0x6016, 0x6003, 0x0001, 0x080c, 0x8000, 0x080c,
+	0x8582, 0x00ee, 0x0804, 0x7364, 0x2061, 0x1a3e, 0x6000, 0xd084,
+	0x0190, 0xd08c, 0x1904, 0x74dd, 0x0126, 0x2091, 0x8000, 0x6204,
+	0x8210, 0x0220, 0x6206, 0x012e, 0x0804, 0x74dd, 0x012e, 0xa883,
+	0x0016, 0x0804, 0x74d6, 0xa883, 0x0007, 0x0804, 0x74d6, 0xa864,
+	0x8007, 0x9084, 0x00ff, 0x0130, 0x8001, 0x1138, 0x7007, 0x0001,
+	0x0069, 0x0005, 0x080c, 0x7090, 0x0040, 0x7007, 0x0003, 0x7012,
+	0x2900, 0x7016, 0x701a, 0x704b, 0x7406, 0x0005, 0x00b6, 0x00e6,
+	0x0126, 0x2091, 0x8000, 0x903e, 0x2061, 0x1800, 0x61c8, 0x81ff,
+	0x1904, 0x7488, 0x6130, 0xd194, 0x1904, 0x74b2, 0xa878, 0x2070,
+	0x9e82, 0x1cd0, 0x0a04, 0x747c, 0x6060, 0x9e02, 0x1a04, 0x747c,
+	0x7120, 0x9186, 0x0006, 0x1904, 0x746e, 0x7010, 0x905d, 0x0904,
+	0x7488, 0xb800, 0xd0e4, 0x1904, 0x74ac, 0x2061, 0x1a3e, 0x6100,
+	0x9184, 0x0301, 0x9086, 0x0001, 0x15a0, 0x7024, 0xd0dc, 0x1904,
+	0x74b5, 0xa883, 0x0000, 0xa803, 0x0000, 0x2908, 0x7014, 0x9005,
+	0x1198, 0x7116, 0xa87c, 0xd0f4, 0x1904, 0x74b8, 0x080c, 0x5113,
+	0xd09c, 0x1118, 0xa87c, 0xc0cc, 0xa87e, 0x2e60, 0x080c, 0x7d5e,
+	0x012e, 0x00ee, 0x00be, 0x0005, 0x2048, 0xa800, 0x9005, 0x1de0,
+	0xa902, 0x2148, 0xa87c, 0xd0f4, 0x1904, 0x74b8, 0x012e, 0x00ee,
+	0x00be, 0x0005, 0x012e, 0x00ee, 0xa883, 0x0006, 0x00be, 0x0804,
+	0x74d6, 0xd184, 0x0db8, 0xd1c4, 0x1190, 0x00a0, 0xa974, 0x080c,
+	0x5f7e, 0x15d0, 0xb800, 0xd0e4, 0x15b8, 0x7120, 0x9186, 0x0007,
+	0x1118, 0xa883, 0x0002, 0x0490, 0xa883, 0x0008, 0x0478, 0xa883,
+	0x000e, 0x0460, 0xa883, 0x0017, 0x0448, 0xa883, 0x0035, 0x0430,
+	0x080c, 0x5117, 0xd0fc, 0x01e8, 0xa878, 0x2070, 0x9e82, 0x1cd0,
+	0x02c0, 0x6060, 0x9e02, 0x12a8, 0x7120, 0x9186, 0x0006, 0x1188,
+	0x7010, 0x905d, 0x0170, 0xb800, 0xd0bc, 0x0158, 0x2039, 0x0001,
+	0x7000, 0x9086, 0x0007, 0x1904, 0x7412, 0x7003, 0x0002, 0x0804,
+	0x7412, 0xa883, 0x0028, 0x0010, 0xa883, 0x0029, 0x012e, 0x00ee,
+	0x00be, 0x0420, 0xa883, 0x002a, 0x0cc8, 0xa883, 0x0045, 0x0cb0,
+	0x2e60, 0x2019, 0x0002, 0x601b, 0x0014, 0x080c, 0xcbad, 0x012e,
+	0x00ee, 0x00be, 0x0005, 0x2009, 0x003e, 0x0058, 0x2009, 0x0004,
+	0x0040, 0x2009, 0x0006, 0x0028, 0x2009, 0x0016, 0x0010, 0x2009,
+	0x0001, 0xa884, 0x9084, 0xff00, 0x9105, 0xa886, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x6536, 0x012e, 0x0005, 0x080c, 0x1007, 0x0005,
+	0x00d6, 0x080c, 0x7d55, 0x00de, 0x0005, 0x00d6, 0x00e6, 0x0126,
+	0x2091, 0x8000, 0x2071, 0x0040, 0x702c, 0xd084, 0x01d8, 0x908c,
+	0x0780, 0x190c, 0x7571, 0xd09c, 0x11a8, 0x2071, 0x1800, 0x70b8,
+	0x90ea, 0x0040, 0x0278, 0x8001, 0x70ba, 0x702c, 0x2048, 0xa800,
+	0x702e, 0x9006, 0xa802, 0xa806, 0x2071, 0x0040, 0x2900, 0x7022,
+	0x702c, 0x0c28, 0x012e, 0x00ee, 0x00de, 0x0005, 0x0006, 0x9084,
+	0x0780, 0x190c, 0x7571, 0x000e, 0x0005, 0x00d6, 0x00c6, 0x0036,
+	0x0026, 0x0016, 0x00b6, 0x7007, 0x0001, 0xaa74, 0x9282, 0x0004,
+	0x1a04, 0x7562, 0xa97c, 0x9188, 0x1000, 0x2104, 0x905d, 0xb804,
+	0xd284, 0x0140, 0x05e8, 0x8007, 0x9084, 0x00ff, 0x9084, 0x0006,
+	0x1108, 0x04b0, 0x2b10, 0x080c, 0x9980, 0x1118, 0x080c, 0x9a23,
+	0x05a8, 0x6212, 0xa874, 0x0002, 0x7540, 0x7545, 0x7548, 0x754e,
+	0x2019, 0x0002, 0x080c, 0xcf62, 0x0060, 0x080c, 0xcefe, 0x0048,
+	0x2019, 0x0002, 0xa980, 0x080c, 0xcf19, 0x0018, 0xa980, 0x080c,
+	0xcefe, 0x080c, 0x99d6, 0xa887, 0x0000, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6536, 0x012e, 0x00be, 0x001e, 0x002e, 0x003e, 0x00ce,
+	0x00de, 0x0005, 0xa887, 0x0006, 0x0c80, 0xa887, 0x0002, 0x0c68,
+	0xa887, 0x0005, 0x0c50, 0xa887, 0x0004, 0x0c38, 0xa887, 0x0007,
+	0x0c20, 0x2091, 0x8000, 0x0e04, 0x7573, 0x0006, 0x0016, 0x2001,
+	0x8003, 0x0006, 0x0804, 0x0dbb, 0x0005, 0x00f6, 0x2079, 0x0300,
+	0x2001, 0x0200, 0x200c, 0xc1e5, 0xc1dc, 0x2102, 0x2009, 0x0218,
+	0x210c, 0xd1ec, 0x1120, 0x080c, 0x1461, 0x00fe, 0x0005, 0x2001,
+	0x020d, 0x2003, 0x0020, 0x781f, 0x0300, 0x00fe, 0x0005, 0x781c,
+	0xd08c, 0x0904, 0x75dd, 0x68b8, 0x90aa, 0x0005, 0x0a04, 0x7b73,
+	0x7d44, 0x7c40, 0x9584, 0x00f6, 0x1508, 0x9484, 0x7000, 0x0138,
+	0x908a, 0x2000, 0x1258, 0x9584, 0x0700, 0x8007, 0x04a8, 0x7000,
+	0x9084, 0xff00, 0x9086, 0x8100, 0x0db0, 0x00b0, 0x9484, 0x0fff,
+	0x1130, 0x7000, 0x9084, 0xff00, 0x9086, 0x8100, 0x11c0, 0x080c,
+	0xd31b, 0x080c, 0x7ab8, 0x7817, 0x0140, 0x00a8, 0x9584, 0x0076,
+	0x1118, 0x080c, 0x7b16, 0x19c8, 0xd5a4, 0x0148, 0x0046, 0x0056,
+	0x080c, 0x763f, 0x080c, 0x203e, 0x005e, 0x004e, 0x0020, 0x080c,
+	0xd31b, 0x7817, 0x0140, 0x080c, 0x7620, 0x2001, 0x19bf, 0x2004,
+	0x9005, 0x090c, 0x8582, 0x0005, 0x0002, 0x75f6, 0x78da, 0x75ed,
+	0x75ed, 0x75ed, 0x75ed, 0x75ed, 0x75ed, 0x7817, 0x0140, 0x2001,
+	0x19bf, 0x2004, 0x9005, 0x090c, 0x8582, 0x0005, 0x7000, 0x908c,
+	0xff00, 0x9194, 0xf000, 0x810f, 0x9484, 0x0fff, 0x688a, 0x9286,
+	0x2000, 0x1150, 0x6800, 0x9086, 0x0001, 0x1118, 0x080c, 0x5137,
+	0x0070, 0x080c, 0x765f, 0x0058, 0x9286, 0x3000, 0x1118, 0x080c,
+	0x7815, 0x0028, 0x9286, 0x8000, 0x1110, 0x080c, 0x79e8, 0x7817,
+	0x0140, 0x2001, 0x19bf, 0x2004, 0x9005, 0x090c, 0x8582, 0x0005,
+	0x2001, 0x180f, 0x2004, 0xd08c, 0x0178, 0x2001, 0x1800, 0x2004,
+	0x9086, 0x0003, 0x1148, 0x0026, 0x0036, 0x2011, 0x8048, 0x2518,
+	0x080c, 0x4672, 0x003e, 0x002e, 0x0005, 0x0036, 0x0046, 0x0056,
+	0x00f6, 0x2079, 0x0200, 0x2019, 0xfffe, 0x7c30, 0x0050, 0x0036,
+	0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x7d44, 0x7c40, 0x2019,
+	0xffff, 0x2001, 0x180f, 0x2004, 0xd08c, 0x0160, 0x2001, 0x1800,
+	0x2004, 0x9086, 0x0003, 0x1130, 0x0026, 0x2011, 0x8048, 0x080c,
+	0x4672, 0x002e, 0x00fe, 0x005e, 0x004e, 0x003e, 0x0005, 0x00b6,
+	0x00c6, 0x7010, 0x9084, 0xff00, 0x8007, 0x9096, 0x0001, 0x0120,
+	0x9096, 0x0023, 0x1904, 0x77e6, 0x9186, 0x0023, 0x15c0, 0x080c,
+	0x7a7d, 0x0904, 0x77e6, 0x6120, 0x9186, 0x0001, 0x0150, 0x9186,
+	0x0004, 0x0138, 0x9186, 0x0008, 0x0120, 0x9186, 0x000a, 0x1904,
+	0x77e6, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1130, 0x2009,
+	0x0015, 0x080c, 0x9a50, 0x0804, 0x77e6, 0x908e, 0x0214, 0x0118,
+	0x908e, 0x0210, 0x1130, 0x2009, 0x0015, 0x080c, 0x9a50, 0x0804,
+	0x77e6, 0x908e, 0x0100, 0x1904, 0x77e6, 0x7034, 0x9005, 0x1904,
+	0x77e6, 0x2009, 0x0016, 0x080c, 0x9a50, 0x0804, 0x77e6, 0x9186,
+	0x0022, 0x1904, 0x77e6, 0x7030, 0x908e, 0x0300, 0x1580, 0x68d4,
+	0xd0a4, 0x0528, 0xc0b5, 0x68d6, 0x7100, 0x918c, 0x00ff, 0x6976,
+	0x7004, 0x687a, 0x00f6, 0x2079, 0x0100, 0x79e6, 0x78ea, 0x0006,
+	0x9084, 0x00ff, 0x0016, 0x2008, 0x080c, 0x251f, 0x7932, 0x7936,
+	0x001e, 0x000e, 0x00fe, 0x080c, 0x24d6, 0x6956, 0x703c, 0x00e6,
+	0x2071, 0x0140, 0x7086, 0x2071, 0x1800, 0x70ae, 0x00ee, 0x7034,
+	0x9005, 0x1904, 0x77e6, 0x2009, 0x0017, 0x0804, 0x77b3, 0x908e,
+	0x0400, 0x1190, 0x7034, 0x9005, 0x1904, 0x77e6, 0x080c, 0x6c53,
+	0x0120, 0x2009, 0x001d, 0x0804, 0x77b3, 0x68d4, 0xc0a5, 0x68d6,
+	0x2009, 0x0030, 0x0804, 0x77b3, 0x908e, 0x0500, 0x1140, 0x7034,
+	0x9005, 0x1904, 0x77e6, 0x2009, 0x0018, 0x0804, 0x77b3, 0x908e,
+	0x2010, 0x1120, 0x2009, 0x0019, 0x0804, 0x77b3, 0x908e, 0x2110,
+	0x1120, 0x2009, 0x001a, 0x0804, 0x77b3, 0x908e, 0x5200, 0x1140,
+	0x7034, 0x9005, 0x1904, 0x77e6, 0x2009, 0x001b, 0x0804, 0x77b3,
+	0x908e, 0x5000, 0x1140, 0x7034, 0x9005, 0x1904, 0x77e6, 0x2009,
+	0x001c, 0x0804, 0x77b3, 0x908e, 0x1300, 0x1120, 0x2009, 0x0034,
+	0x0804, 0x77b3, 0x908e, 0x1200, 0x1140, 0x7034, 0x9005, 0x1904,
+	0x77e6, 0x2009, 0x0024, 0x0804, 0x77b3, 0x908c, 0xff00, 0x918e,
+	0x2400, 0x1170, 0x2009, 0x002d, 0x2001, 0x180f, 0x2004, 0xd09c,
+	0x0904, 0x77b3, 0x080c, 0xc384, 0x1904, 0x77e6, 0x0804, 0x77b1,
+	0x908c, 0xff00, 0x918e, 0x5300, 0x1120, 0x2009, 0x002a, 0x0804,
+	0x77b3, 0x908e, 0x0f00, 0x1120, 0x2009, 0x0020, 0x0804, 0x77b3,
+	0x908e, 0x5300, 0x1108, 0x0440, 0x908e, 0x6104, 0x1528, 0x2029,
+	0x0205, 0x2011, 0x026d, 0x8208, 0x2204, 0x9082, 0x0004, 0x8004,
+	0x8004, 0x20a8, 0x2011, 0x8015, 0x211c, 0x8108, 0x0046, 0x2124,
+	0x080c, 0x4672, 0x004e, 0x8108, 0x0f04, 0x777f, 0x9186, 0x0280,
+	0x1d88, 0x2504, 0x8000, 0x202a, 0x2009, 0x0260, 0x0c58, 0x202b,
+	0x0000, 0x2009, 0x0023, 0x0478, 0x908e, 0x6000, 0x1118, 0x2009,
+	0x003f, 0x0448, 0x908e, 0x7800, 0x1118, 0x2009, 0x0045, 0x0418,
+	0x908e, 0x1000, 0x1118, 0x2009, 0x004e, 0x00e8, 0x908e, 0x6300,
+	0x1118, 0x2009, 0x004a, 0x00b8, 0x908c, 0xff00, 0x918e, 0x5600,
+	0x1118, 0x2009, 0x004f, 0x0078, 0x908c, 0xff00, 0x918e, 0x5700,
+	0x1118, 0x2009, 0x0050, 0x0038, 0x2009, 0x001d, 0x6834, 0xd0d4,
+	0x0110, 0x2009, 0x004c, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211,
+	0x220c, 0x080c, 0x24d6, 0x1568, 0x080c, 0x5f1e, 0x1550, 0xbe12,
+	0xbd16, 0x001e, 0x0016, 0xb8b0, 0x9005, 0x1168, 0x9186, 0x0046,
+	0x1150, 0x6874, 0x9606, 0x1138, 0x6878, 0x9506, 0x9084, 0xff00,
+	0x1110, 0x001e, 0x0098, 0x080c, 0x9980, 0x01a8, 0x2b08, 0x6112,
+	0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x9186, 0x004c, 0x1110,
+	0x6023, 0x000a, 0x0016, 0x001e, 0x080c, 0x9a50, 0x00ce, 0x00be,
+	0x0005, 0x001e, 0x0cd8, 0x2001, 0x180d, 0x2004, 0xd0ec, 0x0120,
+	0x2011, 0x8049, 0x080c, 0x4672, 0x080c, 0x9a23, 0x0d90, 0x2b08,
+	0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x0016, 0x9186,
+	0x0017, 0x0118, 0x9186, 0x0030, 0x1128, 0x6007, 0x0009, 0x6017,
+	0x2900, 0x0020, 0x6007, 0x0051, 0x6017, 0x0000, 0x602f, 0x0009,
+	0x6003, 0x0001, 0x080c, 0x8048, 0x08a0, 0x080c, 0x2f50, 0x1140,
+	0x7010, 0x9084, 0xff00, 0x8007, 0x908e, 0x0008, 0x1108, 0x0009,
+	0x0005, 0x00b6, 0x00c6, 0x0046, 0x7000, 0x908c, 0xff00, 0x810f,
+	0x9186, 0x0033, 0x11e8, 0x080c, 0x7a7d, 0x0904, 0x7872, 0x7124,
+	0x610a, 0x7030, 0x908e, 0x0200, 0x1140, 0x7034, 0x9005, 0x15d0,
+	0x2009, 0x0015, 0x080c, 0x9a50, 0x04a8, 0x908e, 0x0100, 0x1590,
+	0x7034, 0x9005, 0x1578, 0x2009, 0x0016, 0x080c, 0x9a50, 0x0450,
+	0x9186, 0x0032, 0x1538, 0x7030, 0x908e, 0x1400, 0x1518, 0x2009,
+	0x0038, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
+	0x24d6, 0x11b8, 0x080c, 0x5f1e, 0x11a0, 0xbe12, 0xbd16, 0x080c,
+	0x9980, 0x0178, 0x2b08, 0x6112, 0x080c, 0xba69, 0x6023, 0x0004,
+	0x7120, 0x610a, 0x001e, 0x080c, 0x9a50, 0x080c, 0x8582, 0x0010,
+	0x00ce, 0x001e, 0x004e, 0x00ce, 0x00be, 0x0005, 0x00b6, 0x0046,
+	0x00e6, 0x00d6, 0x2028, 0x2130, 0x9696, 0x00ff, 0x11b8, 0x9592,
+	0xfffc, 0x02a0, 0x9596, 0xfffd, 0x1120, 0x2009, 0x007f, 0x0804,
+	0x78d4, 0x9596, 0xfffe, 0x1120, 0x2009, 0x007e, 0x0804, 0x78d4,
+	0x9596, 0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0, 0x2011, 0x0000,
+	0x2019, 0x1835, 0x231c, 0xd3ac, 0x0130, 0x9026, 0x20a9, 0x0800,
+	0x2071, 0x1000, 0x0030, 0x2021, 0x0081, 0x20a9, 0x077f, 0x2071,
+	0x1081, 0x2e1c, 0x93dd, 0x0000, 0x1140, 0x82ff, 0x11d0, 0x9496,
+	0x00ff, 0x01b8, 0x2410, 0xc2fd, 0x00a0, 0xbf10, 0x2600, 0x9706,
+	0xb814, 0x1120, 0x9546, 0x1110, 0x2408, 0x00b0, 0x9745, 0x1148,
+	0x94c6, 0x007e, 0x0130, 0x94c6, 0x007f, 0x0118, 0x94c6, 0x0080,
+	0x1d20, 0x8420, 0x8e70, 0x1f04, 0x78a9, 0x82ff, 0x1118, 0x9085,
+	0x0001, 0x0018, 0xc2fc, 0x2208, 0x9006, 0x00de, 0x00ee, 0x004e,
+	0x00be, 0x0005, 0x7000, 0x908c, 0xff00, 0x810f, 0x9184, 0x000f,
+	0x0002, 0x78f1, 0x78f1, 0x78f1, 0x7a8f, 0x78f1, 0x78fa, 0x7925,
+	0x79b3, 0x78f1, 0x78f1, 0x78f1, 0x78f1, 0x78f1, 0x78f1, 0x78f1,
+	0x78f1, 0x7817, 0x0140, 0x2001, 0x19bf, 0x2004, 0x9005, 0x090c,
+	0x8582, 0x0005, 0x00b6, 0x7110, 0xd1bc, 0x01e8, 0x7120, 0x2160,
+	0x9c8c, 0x0007, 0x11c0, 0x9c8a, 0x1cd0, 0x02a8, 0x6860, 0x9c02,
+	0x1290, 0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106,
+	0x1150, 0x700c, 0xb914, 0x9106, 0x1130, 0x7124, 0x610a, 0x2009,
+	0x0046, 0x080c, 0x9a50, 0x7817, 0x0140, 0x2001, 0x19bf, 0x2004,
+	0x9005, 0x090c, 0x8582, 0x00be, 0x0005, 0x00b6, 0x00c6, 0x9484,
+	0x0fff, 0x0904, 0x7989, 0x7110, 0xd1bc, 0x1904, 0x7989, 0x7108,
+	0x700c, 0x2028, 0x918c, 0x00ff, 0x2130, 0x9094, 0xff00, 0x15b0,
+	0x81ff, 0x15a0, 0x9080, 0x2f92, 0x200d, 0x918c, 0xff00, 0x810f,
+	0x2001, 0x0080, 0x9106, 0x0904, 0x7989, 0x080c, 0x5f1e, 0x1904,
+	0x7989, 0xbe12, 0xbd16, 0xb800, 0xd0ec, 0x15d8, 0xba04, 0x9294,
+	0xff00, 0x9286, 0x0600, 0x11a0, 0x080c, 0x9980, 0x05e8, 0x2b08,
+	0x7028, 0x604a, 0x702c, 0x6046, 0x6112, 0x6023, 0x0006, 0x7120,
+	0x610a, 0x7130, 0x6156, 0x2009, 0x0044, 0x080c, 0xc5dc, 0x0408,
+	0x080c, 0x62a4, 0x1138, 0xb807, 0x0606, 0x0c30, 0x190c, 0x7876,
+	0x11c0, 0x0898, 0x080c, 0x9980, 0x2b08, 0x0198, 0x6112, 0x6023,
+	0x0004, 0x7120, 0x610a, 0x9286, 0x0400, 0x1118, 0x6007, 0x0005,
+	0x0010, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x8048, 0x080c,
+	0x8582, 0x7817, 0x0140, 0x2001, 0x19bf, 0x2004, 0x9005, 0x090c,
+	0x8582, 0x00ce, 0x00be, 0x0005, 0x2001, 0x180d, 0x2004, 0xd0ec,
+	0x0120, 0x2011, 0x8049, 0x080c, 0x4672, 0x080c, 0x9a23, 0x0d48,
+	0x2b08, 0x6112, 0x6023, 0x0006, 0x7120, 0x610a, 0x7130, 0x6156,
+	0x6017, 0xf300, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x8000,
+	0x080c, 0x8582, 0x08b0, 0x00b6, 0x7110, 0xd1bc, 0x01e8, 0x7020,
+	0x2060, 0x9c84, 0x0007, 0x11c0, 0x9c82, 0x1cd0, 0x02a8, 0x6860,
+	0x9c02, 0x1290, 0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910,
+	0x9106, 0x1150, 0x700c, 0xb914, 0x9106, 0x1130, 0x7124, 0x610a,
+	0x2009, 0x0045, 0x080c, 0x9a50, 0x7817, 0x0140, 0x2001, 0x19bf,
+	0x2004, 0x9005, 0x090c, 0x8582, 0x00be, 0x0005, 0x6120, 0x9186,
+	0x0002, 0x0128, 0x9186, 0x0005, 0x0110, 0x9085, 0x0001, 0x0005,
+	0x080c, 0x2f50, 0x1168, 0x7010, 0x9084, 0xff00, 0x8007, 0x9086,
+	0x0000, 0x1130, 0x9184, 0x000f, 0x908a, 0x0006, 0x1208, 0x000b,
+	0x0005, 0x79ff, 0x7a00, 0x79ff, 0x79ff, 0x7a5f, 0x7a6e, 0x0005,
+	0x00b6, 0x7110, 0xd1bc, 0x0120, 0x702c, 0xd084, 0x0904, 0x7a5d,
+	0x700c, 0x7108, 0x080c, 0x24d6, 0x1904, 0x7a5d, 0x080c, 0x5f1e,
+	0x1904, 0x7a5d, 0xbe12, 0xbd16, 0x7110, 0xd1bc, 0x01d8, 0x080c,
+	0x62a4, 0x0118, 0x9086, 0x0004, 0x1588, 0x00c6, 0x080c, 0x7a7d,
+	0x00ce, 0x05d8, 0x080c, 0x9980, 0x2b08, 0x05b8, 0x6112, 0x080c,
+	0xba69, 0x6023, 0x0002, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c,
+	0x9a50, 0x0458, 0x080c, 0x62a4, 0x0148, 0x9086, 0x0004, 0x0130,
+	0x080c, 0x62ac, 0x0118, 0x9086, 0x0004, 0x1180, 0x080c, 0x9980,
+	0x2b08, 0x01d8, 0x6112, 0x080c, 0xba69, 0x6023, 0x0005, 0x7120,
+	0x610a, 0x2009, 0x0088, 0x080c, 0x9a50, 0x0078, 0x080c, 0x9980,
+	0x2b08, 0x0158, 0x6112, 0x080c, 0xba69, 0x6023, 0x0004, 0x7120,
+	0x610a, 0x2009, 0x0001, 0x080c, 0x9a50, 0x00be, 0x0005, 0x7110,
+	0xd1bc, 0x0158, 0x00d1, 0x0148, 0x080c, 0x79de, 0x1130, 0x7124,
+	0x610a, 0x2009, 0x0089, 0x080c, 0x9a50, 0x0005, 0x7110, 0xd1bc,
+	0x0158, 0x0059, 0x0148, 0x080c, 0x79de, 0x1130, 0x7124, 0x610a,
+	0x2009, 0x008a, 0x080c, 0x9a50, 0x0005, 0x7020, 0x2060, 0x9c84,
+	0x0007, 0x1158, 0x9c82, 0x1cd0, 0x0240, 0x2001, 0x1818, 0x2004,
+	0x9c02, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, 0x00b6,
+	0x7110, 0xd1bc, 0x11d8, 0x7024, 0x2060, 0x9c84, 0x0007, 0x11b0,
+	0x9c82, 0x1cd0, 0x0298, 0x6860, 0x9c02, 0x1280, 0x7008, 0x9084,
+	0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1140, 0x700c, 0xb914,
+	0x9106, 0x1120, 0x2009, 0x0051, 0x080c, 0x9a50, 0x7817, 0x0140,
+	0x2001, 0x19bf, 0x2004, 0x9005, 0x090c, 0x8582, 0x00be, 0x0005,
+	0x2031, 0x0105, 0x0069, 0x0005, 0x2031, 0x0206, 0x0049, 0x0005,
+	0x2031, 0x0207, 0x0029, 0x0005, 0x2031, 0x0213, 0x0009, 0x0005,
+	0x00c6, 0x0096, 0x00f6, 0x7000, 0x9084, 0xf000, 0x9086, 0xc000,
+	0x05d0, 0x080c, 0x9980, 0x05b8, 0x0066, 0x00c6, 0x0046, 0x2011,
+	0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x24d6, 0x15a0, 0x080c,
+	0x5f1e, 0x1588, 0xbe12, 0xbd16, 0x2b00, 0x004e, 0x00ce, 0x6012,
+	0x080c, 0xba69, 0x080c, 0x0fd5, 0x0510, 0x2900, 0x605a, 0x9006,
+	0xa802, 0xa866, 0xac6a, 0xa85c, 0x90f8, 0x001b, 0x20a9, 0x000e,
+	0xa860, 0x20e8, 0x20e1, 0x0000, 0x2fa0, 0x2e98, 0x4003, 0x006e,
+	0x6616, 0x6007, 0x003e, 0x6023, 0x0001, 0x6003, 0x0001, 0x080c,
+	0x8048, 0x080c, 0x8582, 0x00fe, 0x009e, 0x00ce, 0x0005, 0x080c,
+	0x99d6, 0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x00c6, 0x7000,
+	0x908c, 0xff00, 0x9184, 0xf000, 0x810f, 0x9086, 0x2000, 0x1904,
+	0x7b6d, 0x9186, 0x0022, 0x15f0, 0x2001, 0x0111, 0x2004, 0x9005,
+	0x1904, 0x7b6f, 0x7030, 0x908e, 0x0400, 0x0904, 0x7b6f, 0x908e,
+	0x6000, 0x05e8, 0x908e, 0x5400, 0x05d0, 0x908e, 0x0300, 0x11d8,
+	0x2009, 0x1835, 0x210c, 0xd18c, 0x1590, 0xd1a4, 0x1580, 0x080c,
+	0x6262, 0x0558, 0x68a8, 0x9084, 0x00ff, 0x7100, 0x918c, 0x00ff,
+	0x9106, 0x1518, 0x6878, 0x69a8, 0x918c, 0xff00, 0x9105, 0x7104,
+	0x9106, 0x11d8, 0x00e0, 0x2009, 0x0103, 0x210c, 0xd1b4, 0x11a8,
+	0x908e, 0x5200, 0x09e8, 0x908e, 0x0500, 0x09d0, 0x908e, 0x5000,
+	0x09b8, 0x0058, 0x9186, 0x0023, 0x1140, 0x080c, 0x7a7d, 0x0128,
+	0x6004, 0x9086, 0x0002, 0x0118, 0x0000, 0x9006, 0x0010, 0x9085,
+	0x0001, 0x00ce, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7800, 0xc0e5,
+	0xc0cc, 0x7802, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7800,
+	0x9085, 0x1200, 0x7802, 0x00fe, 0x0005, 0x2071, 0x19c9, 0x7003,
+	0x0003, 0x700f, 0x0361, 0x9006, 0x701a, 0x7072, 0x7012, 0x7017,
+	0x1cd0, 0x7007, 0x0000, 0x7026, 0x702b, 0x8fd1, 0x7032, 0x7037,
+	0x903f, 0x703f, 0xffff, 0x7042, 0x7047, 0x4fb2, 0x704a, 0x705b,
+	0x7ce2, 0x080c, 0x0fee, 0x090c, 0x0db2, 0x2900, 0x703a, 0xa867,
+	0x0003, 0xa86f, 0x0100, 0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x19c9,
+	0x1d04, 0x7c39, 0x2091, 0x6000, 0x700c, 0x8001, 0x700e, 0x1510,
+	0x2001, 0x1875, 0x2004, 0xd0c4, 0x0158, 0x3a00, 0xd08c, 0x1140,
+	0x20d1, 0x0000, 0x20d1, 0x0001, 0x20d1, 0x0000, 0x080c, 0x0db2,
+	0x700f, 0x0361, 0x7007, 0x0001, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x7d27, 0x7040, 0x900d, 0x0148, 0x8109, 0x7142, 0x1130, 0x7044,
+	0x080f, 0x0018, 0x0126, 0x2091, 0x8000, 0x7024, 0x900d, 0x0188,
+	0x7020, 0x8001, 0x7022, 0x1168, 0x7023, 0x0009, 0x8109, 0x7126,
+	0x9186, 0x03e8, 0x1110, 0x7028, 0x080f, 0x81ff, 0x1110, 0x7028,
+	0x080f, 0x7030, 0x900d, 0x0180, 0x702c, 0x8001, 0x702e, 0x1160,
+	0x702f, 0x0009, 0x8109, 0x7132, 0x0128, 0x9184, 0x007f, 0x090c,
+	0x90b9, 0x0010, 0x7034, 0x080f, 0x703c, 0x9005, 0x0118, 0x0310,
+	0x8001, 0x703e, 0x704c, 0x900d, 0x0168, 0x7048, 0x8001, 0x704a,
+	0x1148, 0x704b, 0x0009, 0x8109, 0x714e, 0x1120, 0x7150, 0x714e,
+	0x7058, 0x080f, 0x7018, 0x900d, 0x01d8, 0x0016, 0x7070, 0x900d,
+	0x0158, 0x706c, 0x8001, 0x706e, 0x1138, 0x706f, 0x0009, 0x8109,
+	0x7172, 0x1110, 0x7074, 0x080f, 0x001e, 0x7008, 0x8001, 0x700a,
+	0x1138, 0x700b, 0x0009, 0x8109, 0x711a, 0x1110, 0x701c, 0x080f,
+	0x012e, 0x7004, 0x0002, 0x7c61, 0x7c62, 0x7c7e, 0x00e6, 0x2071,
+	0x19c9, 0x7018, 0x9005, 0x1120, 0x711a, 0x721e, 0x700b, 0x0009,
+	0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0x19c9, 0x701c, 0x9206,
+	0x1120, 0x701a, 0x701e, 0x7072, 0x7076, 0x000e, 0x00ee, 0x0005,
+	0x00e6, 0x2071, 0x19c9, 0xb888, 0x9102, 0x0208, 0xb98a, 0x00ee,
+	0x0005, 0x0005, 0x00b6, 0x7110, 0x080c, 0x5f7e, 0x1168, 0xb888,
+	0x8001, 0x0250, 0xb88a, 0x1140, 0x0126, 0x2091, 0x8000, 0x0016,
+	0x080c, 0x8582, 0x001e, 0x012e, 0x8108, 0x9182, 0x0800, 0x0218,
+	0x900e, 0x7007, 0x0002, 0x7112, 0x00be, 0x0005, 0x7014, 0x2060,
+	0x0126, 0x2091, 0x8000, 0x6040, 0x9005, 0x0128, 0x8001, 0x6042,
+	0x1110, 0x080c, 0xb8fa, 0x6018, 0x9005, 0x0510, 0x8001, 0x601a,
+	0x11f8, 0x6120, 0x9186, 0x0003, 0x0118, 0x9186, 0x0006, 0x11b0,
+	0x6014, 0x2048, 0xa884, 0x908a, 0x199a, 0x0280, 0x9082, 0x1999,
+	0xa886, 0x908a, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003, 0x800b,
+	0x810b, 0x9108, 0x611a, 0xa87c, 0xd0e4, 0x0110, 0x080c, 0xb313,
+	0x012e, 0x9c88, 0x0018, 0x7116, 0x2001, 0x1818, 0x2004, 0x9102,
+	0x0220, 0x7017, 0x1cd0, 0x7007, 0x0000, 0x0005, 0x00e6, 0x2071,
+	0x19c9, 0x7027, 0x07d0, 0x7023, 0x0009, 0x00ee, 0x0005, 0x2001,
+	0x19d2, 0x2003, 0x0000, 0x0005, 0x00e6, 0x2071, 0x19c9, 0x7132,
+	0x702f, 0x0009, 0x00ee, 0x0005, 0x2011, 0x19d5, 0x2013, 0x0000,
+	0x0005, 0x00e6, 0x2071, 0x19c9, 0x711a, 0x721e, 0x700b, 0x0009,
+	0x00ee, 0x0005, 0x0086, 0x0026, 0x7054, 0x8000, 0x7056, 0x2001,
+	0x19d7, 0x2044, 0xa06c, 0x9086, 0x0000, 0x0150, 0x7068, 0xa09a,
+	0x7064, 0xa096, 0x7060, 0xa092, 0x705c, 0xa08e, 0x080c, 0x10b5,
+	0x002e, 0x008e, 0x0005, 0x0006, 0x0016, 0x0096, 0x00a6, 0x00b6,
+	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0156, 0x080c, 0x7bae, 0x015e,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x001e,
+	0x000e, 0x0005, 0x00e6, 0x2071, 0x19c9, 0x7172, 0x7276, 0x706f,
+	0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0x19c9, 0x7074,
+	0x9206, 0x1110, 0x7072, 0x7076, 0x000e, 0x00ee, 0x0005, 0x2069,
+	0x1800, 0x69e0, 0xd1e4, 0x1518, 0x0026, 0xd1ec, 0x0140, 0x6a4c,
+	0x686c, 0x9202, 0x0288, 0x8117, 0x9294, 0x00c0, 0x0088, 0x9184,
+	0x0007, 0x01a0, 0x8109, 0x9184, 0x0007, 0x0110, 0x69e2, 0x0070,
+	0x8107, 0x9084, 0x0007, 0x910d, 0x8107, 0x9106, 0x9094, 0x00c0,
+	0x9184, 0xff3f, 0x9205, 0x68e2, 0x080c, 0x0eb4, 0x002e, 0x0005,
+	0x00c6, 0x2061, 0x1a3e, 0x00ce, 0x0005, 0x9184, 0x000f, 0x8003,
+	0x8003, 0x8003, 0x9080, 0x1a3e, 0x2060, 0x0005, 0xa884, 0x908a,
+	0x199a, 0x1638, 0x9005, 0x1150, 0x00c6, 0x2061, 0x1a3e, 0x6014,
+	0x00ce, 0x9005, 0x1130, 0x2001, 0x001e, 0x0018, 0x908e, 0xffff,
+	0x01b0, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0x908c,
+	0x00c0, 0x918e, 0x00c0, 0x0904, 0x7de8, 0xd0b4, 0x1168, 0xd0bc,
+	0x1904, 0x7dc1, 0x2009, 0x0006, 0x080c, 0x7e15, 0x0005, 0x900e,
+	0x0c60, 0x2001, 0x1999, 0x08b0, 0xd0fc, 0x0160, 0x908c, 0x0003,
+	0x0120, 0x918e, 0x0003, 0x1904, 0x7e0f, 0x908c, 0x2020, 0x918e,
+	0x2020, 0x01a8, 0x6024, 0xd0d4, 0x11e8, 0x2009, 0x1875, 0x2104,
+	0xd084, 0x1138, 0x87ff, 0x1120, 0x2009, 0x0043, 0x0804, 0x9a50,
+	0x0005, 0x87ff, 0x1de8, 0x2009, 0x0042, 0x0804, 0x9a50, 0x6110,
+	0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac, 0x0d20, 0x6024, 0xc0cd,
+	0x6026, 0x0c00, 0xc0d4, 0x6026, 0xa890, 0x602e, 0xa88c, 0x6032,
+	0x08e0, 0xd0fc, 0x0160, 0x908c, 0x0003, 0x0120, 0x918e, 0x0003,
+	0x1904, 0x7e0f, 0x908c, 0x2020, 0x918e, 0x2020, 0x0170, 0x0076,
+	0x00f6, 0x2c78, 0x080c, 0x1582, 0x00fe, 0x007e, 0x87ff, 0x1120,
+	0x2009, 0x0042, 0x080c, 0x9a50, 0x0005, 0x6110, 0x00b6, 0x2158,
+	0xb900, 0x00be, 0xd1ac, 0x0d58, 0x6124, 0xc1cd, 0x6126, 0x0c38,
+	0xd0fc, 0x0188, 0x908c, 0x2020, 0x918e, 0x2020, 0x01a8, 0x9084,
+	0x0003, 0x908e, 0x0002, 0x0148, 0x87ff, 0x1120, 0x2009, 0x0041,
+	0x080c, 0x9a50, 0x0005, 0x00b9, 0x0ce8, 0x87ff, 0x1dd8, 0x2009,
+	0x0043, 0x080c, 0x9a50, 0x0cb0, 0x6110, 0x00b6, 0x2158, 0xb900,
+	0x00be, 0xd1ac, 0x0d20, 0x6124, 0xc1cd, 0x6126, 0x0c00, 0x2009,
+	0x0004, 0x0019, 0x0005, 0x2009, 0x0001, 0x0096, 0x080c, 0xb5fb,
+	0x0518, 0x6014, 0x2048, 0xa982, 0xa800, 0x6016, 0x9186, 0x0001,
+	0x1188, 0xa97c, 0x918c, 0x8100, 0x918e, 0x8100, 0x1158, 0x00c6,
+	0x2061, 0x1a3e, 0x6200, 0xd28c, 0x1120, 0x6204, 0x8210, 0x0208,
+	0x6206, 0x00ce, 0x080c, 0x6370, 0x6014, 0x904d, 0x0076, 0x2039,
+	0x0000, 0x190c, 0x7d5e, 0x007e, 0x009e, 0x0005, 0x0156, 0x00c6,
+	0x2061, 0x1a3e, 0x6000, 0x81ff, 0x0110, 0x9205, 0x0008, 0x9204,
+	0x6002, 0x00ce, 0x015e, 0x0005, 0x6800, 0xd08c, 0x1138, 0x6808,
+	0x9005, 0x0120, 0x8001, 0x680a, 0x9085, 0x0001, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x0036, 0x0046, 0x20a9, 0x0010, 0x9006, 0x8004,
+	0x2019, 0x0100, 0x231c, 0x93a6, 0x0008, 0x1118, 0x8086, 0x818e,
+	0x0020, 0x80f6, 0x3e00, 0x81f6, 0x3e08, 0x1208, 0x9200, 0x1f04,
+	0x7e60, 0x93a6, 0x0008, 0x1118, 0x8086, 0x818e, 0x0020, 0x80f6,
+	0x3e00, 0x81f6, 0x3e08, 0x004e, 0x003e, 0x012e, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x0076, 0x0156, 0x20a9, 0x0010, 0x9005, 0x0510,
+	0x911a, 0x1600, 0x8213, 0x2039, 0x0100, 0x273c, 0x97be, 0x0008,
+	0x1110, 0x818d, 0x0010, 0x81f5, 0x3e08, 0x0228, 0x911a, 0x1220,
+	0x1f04, 0x7e8a, 0x0028, 0x911a, 0x2308, 0x8210, 0x1f04, 0x7e8a,
+	0x0006, 0x3200, 0x9084, 0xefff, 0x2080, 0x000e, 0x015e, 0x007e,
+	0x012e, 0x0005, 0x0006, 0x3200, 0x9085, 0x1000, 0x0ca8, 0x0126,
+	0x2091, 0x2800, 0x2079, 0x19b6, 0x012e, 0x00d6, 0x2069, 0x19b6,
+	0x6803, 0x0005, 0x0156, 0x0146, 0x01d6, 0x20e9, 0x0000, 0x2069,
+	0x0200, 0x080c, 0x97ce, 0x0401, 0x080c, 0x97b9, 0x00e9, 0x080c,
+	0x97bc, 0x00d1, 0x080c, 0x97bf, 0x00b9, 0x080c, 0x97c2, 0x00a1,
+	0x080c, 0x97c5, 0x0089, 0x080c, 0x97c8, 0x0071, 0x080c, 0x97cb,
+	0x0059, 0x01de, 0x014e, 0x015e, 0x2069, 0x0004, 0x2d04, 0x9085,
+	0x8001, 0x206a, 0x00de, 0x0005, 0x20a9, 0x0020, 0x20a1, 0x0240,
+	0x2001, 0x0000, 0x4004, 0x0005, 0x00c6, 0x6027, 0x0001, 0x7804,
+	0x9084, 0x0007, 0x0002, 0x7efd, 0x7f21, 0x7f60, 0x7f03, 0x7f21,
+	0x7efd, 0x7efb, 0x7efb, 0x080c, 0x0db2, 0x080c, 0x7cc7, 0x080c,
+	0x8582, 0x00ce, 0x0005, 0x62c0, 0x82ff, 0x1110, 0x00ce, 0x0005,
+	0x2011, 0x588a, 0x080c, 0x7c4a, 0x7828, 0x9092, 0x00c8, 0x1228,
+	0x8000, 0x782a, 0x080c, 0x58ca, 0x0c88, 0x62c0, 0x080c, 0x97d2,
+	0x080c, 0x588a, 0x7807, 0x0003, 0x7827, 0x0000, 0x782b, 0x0000,
+	0x0c28, 0x080c, 0x7cc7, 0x6220, 0xd2a4, 0x0160, 0x782b, 0x0000,
+	0x7824, 0x9065, 0x090c, 0x0db2, 0x2009, 0x0013, 0x080c, 0x9a50,
+	0x00ce, 0x0005, 0x00c6, 0x7824, 0x9065, 0x090c, 0x0db2, 0x7828,
+	0x9092, 0xc350, 0x12c0, 0x8000, 0x782a, 0x00ce, 0x080c, 0x283d,
+	0x0278, 0x00c6, 0x7924, 0x2160, 0x6010, 0x906d, 0x090c, 0x0db2,
+	0x7807, 0x0000, 0x7827, 0x0000, 0x00ce, 0x080c, 0x8582, 0x0c00,
+	0x080c, 0x8f97, 0x08e8, 0x2011, 0x0130, 0x2214, 0x080c, 0x97d2,
+	0x080c, 0xd358, 0x2009, 0x0014, 0x080c, 0x9a50, 0x00ce, 0x0880,
+	0x2001, 0x19d2, 0x2003, 0x0000, 0x62c0, 0x82ff, 0x1160, 0x782b,
+	0x0000, 0x7824, 0x9065, 0x090c, 0x0db2, 0x2009, 0x0013, 0x080c,
+	0x9aa2, 0x00ce, 0x0005, 0x00b6, 0x00c6, 0x00d6, 0x7824, 0x9005,
+	0x090c, 0x0db2, 0x7828, 0x9092, 0xc350, 0x1648, 0x8000, 0x782a,
+	0x00de, 0x00ce, 0x00be, 0x080c, 0x283d, 0x02f0, 0x00b6, 0x00c6,
+	0x00d6, 0x781c, 0x905d, 0x090c, 0x0db2, 0xb800, 0xc0dc, 0xb802,
+	0x7924, 0x2160, 0x080c, 0x99d6, 0xb93c, 0x81ff, 0x090c, 0x0db2,
+	0x8109, 0xb93e, 0x7807, 0x0000, 0x7827, 0x0000, 0x00de, 0x00ce,
+	0x00be, 0x080c, 0x8582, 0x0868, 0x080c, 0x8f97, 0x0850, 0x2011,
+	0x0130, 0x2214, 0x080c, 0x97d2, 0x080c, 0xd358, 0x7824, 0x9065,
+	0x2009, 0x0014, 0x080c, 0x9a50, 0x00de, 0x00ce, 0x00be, 0x0804,
+	0x7f71, 0x00c6, 0x2001, 0x009b, 0x2004, 0xd0fc, 0x190c, 0x1be4,
+	0x6024, 0x6027, 0x0002, 0xd0f4, 0x1580, 0x62c8, 0x60c4, 0x9205,
+	0x1170, 0x783c, 0x9065, 0x0130, 0x2009, 0x0049, 0x080c, 0x9a50,
+	0x00ce, 0x0005, 0x2011, 0x19d5, 0x2013, 0x0000, 0x0cc8, 0x793c,
+	0x81ff, 0x0dc0, 0x7944, 0x9192, 0x7530, 0x12f0, 0x8108, 0x7946,
+	0x793c, 0x9188, 0x0008, 0x210c, 0x918e, 0x0006, 0x1138, 0x6014,
+	0x9084, 0x1984, 0x9085, 0x0012, 0x6016, 0x0c10, 0x6014, 0x9084,
+	0x1984, 0x9085, 0x0016, 0x6016, 0x08d8, 0x793c, 0x2160, 0x2009,
+	0x004a, 0x080c, 0x9a50, 0x08a0, 0x7848, 0xc085, 0x784a, 0x0880,
+	0x0006, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f, 0x0000,
+	0x2c08, 0x2061, 0x19b6, 0x6020, 0x8000, 0x6022, 0x6010, 0x9005,
+	0x0148, 0x9080, 0x0003, 0x2102, 0x6112, 0x012e, 0x00ce, 0x001e,
+	0x000e, 0x0005, 0x6116, 0x6112, 0x0cc0, 0x00d6, 0x2069, 0x19b6,
+	0xb800, 0xd0d4, 0x0168, 0x6820, 0x8000, 0x6822, 0x9086, 0x0001,
+	0x1110, 0x2b00, 0x681e, 0x00de, 0x0804, 0x8582, 0x00de, 0x0005,
+	0xc0d5, 0xb802, 0x6818, 0x9005, 0x0168, 0xb856, 0xb85b, 0x0000,
+	0x0086, 0x0006, 0x2b00, 0x681a, 0x008e, 0xa05a, 0x008e, 0x2069,
+	0x19b6, 0x0c08, 0xb856, 0xb85a, 0x2b00, 0x681a, 0x681e, 0x08d8,
+	0x0006, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f, 0x0000,
+	0x2c08, 0x2061, 0x19b6, 0x6020, 0x8000, 0x6022, 0x6008, 0x9005,
+	0x0148, 0x9080, 0x0003, 0x2102, 0x610a, 0x012e, 0x00ce, 0x001e,
+	0x000e, 0x0005, 0x610e, 0x610a, 0x0cc0, 0x00c6, 0x600f, 0x0000,
+	0x2c08, 0x2061, 0x19b6, 0x6034, 0x9005, 0x0130, 0x9080, 0x0003,
+	0x2102, 0x6136, 0x00ce, 0x0005, 0x613a, 0x6136, 0x00ce, 0x0005,
+	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00b6, 0x0096, 0x0076, 0x0066,
+	0x0056, 0x0036, 0x0026, 0x0016, 0x0006, 0x0126, 0x902e, 0x2071,
+	0x19b6, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0904,
+	0x80ef, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x80ea, 0x87ff,
+	0x0120, 0x6054, 0x9106, 0x1904, 0x80ea, 0x703c, 0x9c06, 0x1178,
+	0x0036, 0x2019, 0x0001, 0x080c, 0x9254, 0x7033, 0x0000, 0x9006,
+	0x703e, 0x7042, 0x7046, 0x704a, 0x003e, 0x2029, 0x0001, 0x7038,
+	0x9c36, 0x1110, 0x660c, 0x763a, 0x7034, 0x9c36, 0x1140, 0x2c00,
+	0x9f36, 0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000, 0x660c,
+	0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
+	0x0000, 0x080c, 0xb5fb, 0x01c8, 0x6014, 0x2048, 0x6020, 0x9086,
+	0x0003, 0x1590, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016,
+	0x0036, 0x0076, 0x080c, 0xb8e3, 0x080c, 0xd28c, 0x080c, 0x6536,
+	0x007e, 0x003e, 0x001e, 0x080c, 0xb7dd, 0x080c, 0x9a06, 0x00ce,
+	0x0804, 0x808e, 0x2c78, 0x600c, 0x2060, 0x0804, 0x808e, 0x85ff,
+	0x0120, 0x0036, 0x080c, 0x865d, 0x003e, 0x012e, 0x000e, 0x001e,
+	0x002e, 0x003e, 0x005e, 0x006e, 0x007e, 0x009e, 0x00be, 0x00ce,
+	0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, 0x1158,
+	0x0016, 0x0036, 0x0076, 0x080c, 0xd28c, 0x080c, 0xcf91, 0x007e,
+	0x003e, 0x001e, 0x0890, 0x6020, 0x9086, 0x000a, 0x0904, 0x80d4,
+	0x0804, 0x80d2, 0x0006, 0x0066, 0x0096, 0x00c6, 0x00d6, 0x00f6,
+	0x9036, 0x0126, 0x2091, 0x8000, 0x2079, 0x19b6, 0x7838, 0x9065,
+	0x0904, 0x816a, 0x600c, 0x0006, 0x600f, 0x0000, 0x783c, 0x9c06,
+	0x1168, 0x0036, 0x2019, 0x0001, 0x080c, 0x9254, 0x7833, 0x0000,
+	0x901e, 0x7b3e, 0x7b42, 0x7b46, 0x7b4a, 0x003e, 0x080c, 0xb5fb,
+	0x0520, 0x6014, 0x2048, 0x6020, 0x9086, 0x0003, 0x1568, 0x3e08,
+	0x918e, 0x0002, 0x1188, 0x6010, 0x9005, 0x0170, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x0140, 0x6040, 0x9005, 0x1180, 0x2001,
+	0x1957, 0x2004, 0x6042, 0x0058, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0x6529, 0x080c, 0xb7dd, 0x080c, 0x9a06, 0x000e,
+	0x0804, 0x8127, 0x7e3a, 0x7e36, 0x012e, 0x00fe, 0x00de, 0x00ce,
+	0x009e, 0x006e, 0x000e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1118,
+	0x080c, 0xcf91, 0x0c50, 0x6020, 0x9086, 0x000a, 0x09f8, 0x08e0,
+	0x0016, 0x0026, 0x0086, 0x9046, 0x0099, 0x080c, 0x8269, 0x008e,
+	0x002e, 0x001e, 0x0005, 0x00f6, 0x0126, 0x2079, 0x19b6, 0x2091,
+	0x8000, 0x080c, 0x8300, 0x080c, 0x838e, 0x012e, 0x00fe, 0x0005,
+	0x00b6, 0x0096, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0016,
+	0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b6, 0x7614, 0x2660,
+	0x2678, 0x8cff, 0x0904, 0x822e, 0x6010, 0x2058, 0xb8a0, 0x9206,
+	0x1904, 0x8229, 0x88ff, 0x0120, 0x6054, 0x9106, 0x1904, 0x8229,
+	0x7024, 0x9c06, 0x1558, 0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508,
+	0x080c, 0x7cc7, 0x080c, 0x8fbb, 0x68c3, 0x0000, 0x080c, 0x9469,
+	0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
+	0x0138, 0x2001, 0x0100, 0x080c, 0x2987, 0x9006, 0x080c, 0x2987,
+	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e,
+	0x0028, 0x6003, 0x0009, 0x630a, 0x0804, 0x8229, 0x7014, 0x9c36,
+	0x1110, 0x660c, 0x7616, 0x7010, 0x9c36, 0x1140, 0x2c00, 0x9f36,
+	0x0118, 0x2f00, 0x7012, 0x0010, 0x7013, 0x0000, 0x660c, 0x0066,
+	0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000,
+	0x6014, 0x2048, 0x080c, 0xb5fb, 0x01e8, 0x6020, 0x9086, 0x0003,
+	0x1580, 0x080c, 0xb7fa, 0x1118, 0x080c, 0xa364, 0x0098, 0xa867,
+	0x0103, 0xab7a, 0xa877, 0x0000, 0x0016, 0x0036, 0x0086, 0x080c,
+	0xb8e3, 0x080c, 0xd28c, 0x080c, 0x6536, 0x008e, 0x003e, 0x001e,
+	0x080c, 0xb7dd, 0x080c, 0x9a06, 0x080c, 0x933f, 0x00ce, 0x0804,
+	0x81a9, 0x2c78, 0x600c, 0x2060, 0x0804, 0x81a9, 0x012e, 0x000e,
+	0x001e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x009e, 0x00be,
+	0x0005, 0x6020, 0x9086, 0x0006, 0x1158, 0x0016, 0x0036, 0x0086,
+	0x080c, 0xd28c, 0x080c, 0xcf91, 0x008e, 0x003e, 0x001e, 0x08d0,
+	0x080c, 0xa364, 0x6020, 0x9086, 0x0002, 0x1160, 0x6004, 0x0006,
+	0x9086, 0x0085, 0x000e, 0x0904, 0x820f, 0x9086, 0x008b, 0x0904,
+	0x820f, 0x0840, 0x6020, 0x9086, 0x0005, 0x1920, 0x6004, 0x0006,
+	0x9086, 0x0085, 0x000e, 0x09c8, 0x9086, 0x008b, 0x09b0, 0x0804,
+	0x8222, 0x00b6, 0x00a6, 0x0096, 0x00c6, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x9280, 0x1000, 0x2004, 0x905d, 0x0904, 0x82f9, 0x00f6,
+	0x00e6, 0x00d6, 0x0066, 0x2071, 0x19b6, 0xbe54, 0x7018, 0x9b06,
+	0x1108, 0x761a, 0x701c, 0x9b06, 0x1130, 0x86ff, 0x1118, 0x7018,
+	0x701e, 0x0008, 0x761e, 0xb858, 0x904d, 0x0108, 0xae56, 0x96d5,
+	0x0000, 0x0110, 0x2900, 0xb05a, 0xb857, 0x0000, 0xb85b, 0x0000,
+	0xb800, 0xc0d4, 0xc0dc, 0xb802, 0x080c, 0x5eb1, 0x0904, 0x82f5,
+	0x7624, 0x86ff, 0x0904, 0x82e4, 0x9680, 0x0005, 0x2004, 0x9906,
+	0x15d8, 0x00d6, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0560, 0x080c,
+	0x7cc7, 0x080c, 0x8fbb, 0x68c3, 0x0000, 0x080c, 0x9469, 0x7027,
+	0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138,
+	0x2001, 0x0100, 0x080c, 0x2987, 0x9006, 0x080c, 0x2987, 0x2069,
+	0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x00de,
+	0x00c6, 0xb83c, 0x9005, 0x0110, 0x8001, 0xb83e, 0x2660, 0x080c,
+	0x9a06, 0x00ce, 0x0048, 0x00de, 0x00c6, 0x2660, 0x6003, 0x0009,
+	0x630a, 0x00ce, 0x0804, 0x829c, 0x89ff, 0x0158, 0xa867, 0x0103,
+	0xab7a, 0xa877, 0x0000, 0x080c, 0xb8e3, 0x080c, 0xd28c, 0x080c,
+	0x6536, 0x080c, 0x933f, 0x0804, 0x829c, 0x006e, 0x00de, 0x00ee,
+	0x00fe, 0x012e, 0x000e, 0x00ce, 0x009e, 0x00ae, 0x00be, 0x0005,
+	0x0096, 0x0006, 0x0066, 0x00c6, 0x00d6, 0x9036, 0x7814, 0x9065,
+	0x0904, 0x8361, 0x600c, 0x0006, 0x600f, 0x0000, 0x7824, 0x9c06,
+	0x1570, 0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c, 0x7cc7,
+	0x080c, 0x8fbb, 0x68c3, 0x0000, 0x080c, 0x9469, 0x7827, 0x0000,
+	0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001,
+	0x0100, 0x080c, 0x2987, 0x9006, 0x080c, 0x2987, 0x2069, 0x0100,
+	0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x0040, 0x080c,
+	0x625a, 0x1520, 0x6003, 0x0009, 0x630a, 0x2c30, 0x00f8, 0x6014,
+	0x2048, 0x080c, 0xb5f9, 0x01b0, 0x6020, 0x9086, 0x0003, 0x1508,
+	0x080c, 0xb7fa, 0x1118, 0x080c, 0xa364, 0x0060, 0x080c, 0x625a,
+	0x1168, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6536,
+	0x080c, 0xb7dd, 0x080c, 0x9a06, 0x080c, 0x933f, 0x000e, 0x0804,
+	0x8307, 0x7e16, 0x7e12, 0x00de, 0x00ce, 0x006e, 0x000e, 0x009e,
+	0x0005, 0x6020, 0x9086, 0x0006, 0x1118, 0x080c, 0xcf91, 0x0c50,
+	0x080c, 0xa364, 0x6020, 0x9086, 0x0002, 0x1150, 0x6004, 0x0006,
+	0x9086, 0x0085, 0x000e, 0x0990, 0x9086, 0x008b, 0x0978, 0x08d0,
+	0x6020, 0x9086, 0x0005, 0x19b0, 0x6004, 0x0006, 0x9086, 0x0085,
+	0x000e, 0x0d18, 0x9086, 0x008b, 0x0d00, 0x0860, 0x0006, 0x0066,
+	0x0096, 0x00b6, 0x00c6, 0x00d6, 0x7818, 0x905d, 0x0904, 0x840e,
+	0xb854, 0x0006, 0x9006, 0xb856, 0xb85a, 0xb800, 0xc0d4, 0xc0dc,
+	0xb802, 0x080c, 0x5eb1, 0x0904, 0x840b, 0x7e24, 0x86ff, 0x0904,
+	0x83fe, 0x9680, 0x0005, 0x2004, 0x9906, 0x1904, 0x83fe, 0x00d6,
+	0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0x83f5, 0x080c, 0x7cc7,
+	0x080c, 0x8fbb, 0x68c3, 0x0000, 0x080c, 0x9469, 0x7827, 0x0000,
+	0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001,
+	0x0100, 0x080c, 0x2987, 0x9006, 0x080c, 0x2987, 0x2069, 0x0100,
+	0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x00de, 0x00c6,
+	0x3e08, 0x918e, 0x0002, 0x1168, 0xb800, 0xd0bc, 0x0150, 0x9680,
+	0x0010, 0x200c, 0x81ff, 0x1518, 0x2009, 0x1957, 0x210c, 0x2102,
+	0x00f0, 0xb83c, 0x9005, 0x0110, 0x8001, 0xb83e, 0x2660, 0x600f,
+	0x0000, 0x080c, 0x9a06, 0x00ce, 0x0048, 0x00de, 0x00c6, 0x2660,
+	0x6003, 0x0009, 0x630a, 0x00ce, 0x0804, 0x83a1, 0x89ff, 0x0138,
+	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6536, 0x080c,
+	0x933f, 0x0804, 0x83a1, 0x000e, 0x0804, 0x8395, 0x781e, 0x781a,
+	0x00de, 0x00ce, 0x00be, 0x009e, 0x006e, 0x000e, 0x0005, 0x00e6,
+	0x00d6, 0x0096, 0x0066, 0xb800, 0xd0dc, 0x01a0, 0xb84c, 0x904d,
+	0x0188, 0xa878, 0x9606, 0x1170, 0x2071, 0x19b6, 0x7024, 0x9035,
+	0x0148, 0x9080, 0x0005, 0x2004, 0x9906, 0x1120, 0xb800, 0xc0dc,
+	0xb802, 0x0029, 0x006e, 0x009e, 0x00de, 0x00ee, 0x0005, 0x00f6,
+	0x2079, 0x0100, 0x78c0, 0x9005, 0x1138, 0x00c6, 0x2660, 0x6003,
+	0x0009, 0x630a, 0x00ce, 0x04b8, 0x080c, 0x8fbb, 0x78c3, 0x0000,
+	0x080c, 0x9469, 0x7027, 0x0000, 0x0036, 0x2079, 0x0140, 0x7b04,
+	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2987, 0x9006,
+	0x080c, 0x2987, 0x2079, 0x0100, 0x7824, 0xd084, 0x0110, 0x7827,
+	0x0001, 0x080c, 0x9469, 0x003e, 0x080c, 0x5eb1, 0x00c6, 0xb83c,
+	0x9005, 0x0110, 0x8001, 0xb83e, 0x2660, 0x080c, 0x99d6, 0x00ce,
+	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xb8e3, 0x080c,
+	0x6536, 0x080c, 0x933f, 0x00fe, 0x0005, 0x00b6, 0x00e6, 0x00c6,
+	0x2011, 0x0101, 0x2204, 0xc0c4, 0x2012, 0x2001, 0x180c, 0x2014,
+	0xc2e4, 0x2202, 0x2071, 0x19b6, 0x7004, 0x9084, 0x0007, 0x0002,
+	0x849a, 0x849e, 0x84b5, 0x84de, 0x851c, 0x849a, 0x84b5, 0x8498,
+	0x080c, 0x0db2, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x7024, 0x9065,
+	0x0148, 0x7020, 0x8001, 0x7022, 0x600c, 0x9015, 0x0158, 0x7216,
+	0x600f, 0x0000, 0x7007, 0x0000, 0x7027, 0x0000, 0x00ce, 0x00ee,
+	0x00be, 0x0005, 0x7216, 0x7212, 0x0ca8, 0x6010, 0x2058, 0x080c,
+	0x5eb1, 0xb800, 0xc0dc, 0xb802, 0x7007, 0x0000, 0x7027, 0x0000,
+	0x7020, 0x8001, 0x7022, 0x1148, 0x2001, 0x180c, 0x2014, 0xd2ec,
+	0x1180, 0x00ce, 0x00ee, 0x00be, 0x0005, 0xb854, 0x9015, 0x0120,
+	0x721e, 0x080c, 0x8582, 0x0ca8, 0x7218, 0x721e, 0x080c, 0x8582,
+	0x0c80, 0xc2ec, 0x2202, 0x080c, 0x865d, 0x0c58, 0x7024, 0x9065,
+	0x05b8, 0x700c, 0x9c06, 0x1160, 0x080c, 0x933f, 0x600c, 0x9015,
+	0x0120, 0x720e, 0x600f, 0x0000, 0x0448, 0x720e, 0x720a, 0x0430,
+	0x7014, 0x9c06, 0x1160, 0x080c, 0x933f, 0x600c, 0x9015, 0x0120,
+	0x7216, 0x600f, 0x0000, 0x00d0, 0x7216, 0x7212, 0x00b8, 0x6020,
+	0x9086, 0x0003, 0x1198, 0x6010, 0x2058, 0x080c, 0x5eb1, 0xb800,
+	0xc0dc, 0xb802, 0x080c, 0x933f, 0x701c, 0x9065, 0x0138, 0xb854,
+	0x9015, 0x0110, 0x721e, 0x0010, 0x7218, 0x721e, 0x7027, 0x0000,
+	0x00ce, 0x00ee, 0x00be, 0x0005, 0x7024, 0x9065, 0x0140, 0x080c,
+	0x933f, 0x600c, 0x9015, 0x0158, 0x720e, 0x600f, 0x0000, 0x080c,
+	0x9469, 0x7027, 0x0000, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x720e,
+	0x720a, 0x0ca8, 0x00d6, 0x2069, 0x19b6, 0x6830, 0x9084, 0x0003,
+	0x0002, 0x853f, 0x8541, 0x8565, 0x853d, 0x080c, 0x0db2, 0x00de,
+	0x0005, 0x00c6, 0x6840, 0x9086, 0x0001, 0x01b8, 0x683c, 0x9065,
+	0x0130, 0x600c, 0x9015, 0x0170, 0x6a3a, 0x600f, 0x0000, 0x6833,
+	0x0000, 0x683f, 0x0000, 0x2011, 0x19d5, 0x2013, 0x0000, 0x00ce,
+	0x00de, 0x0005, 0x683a, 0x6836, 0x0c90, 0x6843, 0x0000, 0x6838,
+	0x9065, 0x0d68, 0x6003, 0x0003, 0x0c50, 0x00c6, 0x9006, 0x6842,
+	0x6846, 0x684a, 0x683c, 0x9065, 0x0160, 0x600c, 0x9015, 0x0130,
+	0x6a3a, 0x600f, 0x0000, 0x683f, 0x0000, 0x0018, 0x683e, 0x683a,
+	0x6836, 0x00ce, 0x00de, 0x0005, 0x2001, 0x180c, 0x200c, 0xc1e5,
+	0x2102, 0x0005, 0x2001, 0x180c, 0x200c, 0xd1ec, 0x0120, 0xc1ec,
+	0x2102, 0x080c, 0x865d, 0x2001, 0x19c2, 0x2004, 0x9086, 0x0001,
+	0x0d58, 0x00d6, 0x2069, 0x19b6, 0x6804, 0x9084, 0x0007, 0x0002,
+	0x85a2, 0x8645, 0x8645, 0x8645, 0x8645, 0x8647, 0x8645, 0x85a0,
+	0x080c, 0x0db2, 0x6820, 0x9005, 0x1110, 0x00de, 0x0005, 0x00c6,
+	0x680c, 0x9065, 0x0150, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000,
+	0x080c, 0x86b3, 0x00ce, 0x00de, 0x0005, 0x6814, 0x9065, 0x0150,
+	0x6807, 0x0001, 0x6826, 0x682b, 0x0000, 0x080c, 0x86b3, 0x00ce,
+	0x00de, 0x0005, 0x00b6, 0x00e6, 0x6a1c, 0x92dd, 0x0000, 0x0904,
+	0x8631, 0xb84c, 0x900d, 0x0118, 0xb888, 0x9005, 0x01a0, 0xb854,
+	0x905d, 0x0120, 0x920e, 0x0904, 0x8631, 0x0028, 0x6818, 0x920e,
+	0x0904, 0x8631, 0x2058, 0xb84c, 0x900d, 0x0d88, 0xb888, 0x9005,
+	0x1d70, 0x2b00, 0x681e, 0xbb3c, 0xb838, 0x9302, 0x1e40, 0x080c,
+	0x99ad, 0x0904, 0x8631, 0x8318, 0xbb3e, 0x6116, 0x2b10, 0x6212,
+	0x0096, 0x2148, 0xa880, 0x9084, 0x00ff, 0x605e, 0xa883, 0x0000,
+	0xa884, 0x009e, 0x908a, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003,
+	0x801b, 0x831b, 0x9318, 0x631a, 0x6114, 0x0096, 0x2148, 0xa964,
+	0x009e, 0x918c, 0x00ff, 0x918e, 0x0048, 0x0538, 0x00f6, 0x2c78,
+	0x2061, 0x0100, 0xbab0, 0x629a, 0x2069, 0x0200, 0x2071, 0x0240,
+	0x080c, 0x8bf2, 0x2069, 0x19b6, 0xbb00, 0xc3dd, 0xbb02, 0x6807,
+	0x0002, 0x2f18, 0x6b26, 0x682b, 0x0000, 0x7823, 0x0003, 0x7803,
+	0x0001, 0x7807, 0x0040, 0x00fe, 0x00ee, 0x00be, 0x00ce, 0x00de,
+	0x0005, 0x00ee, 0x00be, 0x00ce, 0x0cd0, 0xbb00, 0xc3dd, 0xbb02,
+	0x6807, 0x0006, 0x2f18, 0x6b26, 0x682b, 0x0000, 0x080c, 0x97f2,
+	0x00ee, 0x00be, 0x00ce, 0x00de, 0x0005, 0x00de, 0x0005, 0x00c6,
+	0x680c, 0x9065, 0x0138, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000,
+	0x080c, 0x86b3, 0x00ce, 0x00de, 0x0005, 0x2001, 0x180c, 0x2014,
+	0xc2ed, 0x2202, 0x00de, 0x00fe, 0x0005, 0x00f6, 0x00d6, 0x2069,
+	0x19b6, 0x6830, 0x9086, 0x0000, 0x1548, 0x2001, 0x180c, 0x2014,
+	0xd2e4, 0x0130, 0xc2e4, 0x2202, 0x080c, 0x8591, 0x2069, 0x19b6,
+	0x2001, 0x180c, 0x200c, 0xd1c4, 0x11e0, 0x6838, 0x907d, 0x01b0,
+	0x6a04, 0x9296, 0x0000, 0x1588, 0x6833, 0x0001, 0x683e, 0x6847,
+	0x0000, 0x684b, 0x0000, 0x0126, 0x00f6, 0x2091, 0x2400, 0x002e,
+	0x080c, 0x19f2, 0x1178, 0x012e, 0x080c, 0x8e0a, 0x00de, 0x00fe,
+	0x0005, 0xc1c4, 0x2102, 0x0066, 0x2031, 0x0001, 0x080c, 0x6d03,
+	0x006e, 0x08d8, 0x012e, 0x6843, 0x0000, 0x7803, 0x0002, 0x780c,
+	0x9015, 0x0140, 0x6a3a, 0x780f, 0x0000, 0x6833, 0x0000, 0x683f,
+	0x0000, 0x0c20, 0x683a, 0x6836, 0x0cc0, 0x6a04, 0x9296, 0x0006,
+	0x0958, 0x0804, 0x8655, 0x6020, 0x9084, 0x000f, 0x000b, 0x0005,
+	0x86c7, 0x86cc, 0x8b2c, 0x8bbb, 0x86cc, 0x8b2c, 0x8bbb, 0x86c7,
+	0x86cc, 0x86c7, 0x86c7, 0x86c7, 0x86c7, 0x86c7, 0x86c7, 0x080c,
+	0x847d, 0x080c, 0x8582, 0x0005, 0x00b6, 0x0156, 0x0136, 0x0146,
+	0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200,
+	0x2071, 0x0240, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0db2, 0x6110,
+	0x2158, 0xb9b0, 0x2c78, 0x2061, 0x0100, 0x619a, 0x908a, 0x0040,
+	0x1a04, 0x8738, 0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de,
+	0x01ce, 0x014e, 0x013e, 0x015e, 0x00be, 0x0005, 0x88af, 0x88ea,
+	0x8913, 0x89bb, 0x89dd, 0x89e3, 0x89f0, 0x89f8, 0x8a04, 0x8a0a,
+	0x8a1b, 0x8a0a, 0x8a73, 0x89f8, 0x8a7f, 0x8a85, 0x8a04, 0x8a85,
+	0x8a91, 0x8736, 0x8736, 0x8736, 0x8736, 0x8736, 0x8736, 0x8736,
+	0x8736, 0x8736, 0x8736, 0x8736, 0x910b, 0x912e, 0x913f, 0x915f,
+	0x9191, 0x89f0, 0x8736, 0x89f0, 0x8a0a, 0x8736, 0x8913, 0x89bb,
+	0x8736, 0x9556, 0x8a0a, 0x8736, 0x9572, 0x8a0a, 0x8736, 0x8a04,
+	0x88a9, 0x8759, 0x8736, 0x958e, 0x95fb, 0x96d2, 0x8736, 0x96df,
+	0x89ed, 0x970a, 0x8736, 0x919b, 0x9737, 0x8736, 0x080c, 0x0db2,
+	0x2100, 0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce,
+	0x014e, 0x013e, 0x015e, 0x00be, 0x0005, 0x8757, 0x8757, 0x8757,
+	0x8780, 0x882c, 0x8837, 0x8757, 0x8757, 0x8757, 0x887e, 0x888a,
+	0x879b, 0x8757, 0x87b6, 0x87ea, 0x98b4, 0x98f9, 0x8a0a, 0x080c,
+	0x0db2, 0x00d6, 0x0096, 0x080c, 0x8aa4, 0x7003, 0x2414, 0x7007,
+	0x0018, 0x700b, 0x0800, 0x7814, 0x2048, 0xa83c, 0x700e, 0xa850,
+	0x7022, 0xa854, 0x7026, 0x60c3, 0x0018, 0x080c, 0x8f8f, 0x009e,
+	0x00de, 0x0005, 0x7810, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x080c,
+	0x9940, 0x1118, 0x9084, 0xff80, 0x0110, 0x9085, 0x0001, 0x0005,
+	0x00d6, 0x0096, 0x080c, 0x8aa4, 0x7003, 0x0500, 0x7814, 0x2048,
+	0xa874, 0x700a, 0xa878, 0x700e, 0xa87c, 0x7012, 0xa880, 0x7016,
+	0xa884, 0x701a, 0xa888, 0x701e, 0x60c3, 0x0010, 0x080c, 0x8f8f,
+	0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x080c, 0x8aa4, 0x7003,
+	0x0500, 0x7814, 0x2048, 0xa8cc, 0x700a, 0xa8d0, 0x700e, 0xa8d4,
+	0x7012, 0xa8d8, 0x7016, 0xa8dc, 0x701a, 0xa8e0, 0x701e, 0x60c3,
+	0x0010, 0x080c, 0x8f8f, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x8aa4, 0x20e9, 0x0000, 0x2001,
+	0x1972, 0x2003, 0x0000, 0x7814, 0x2048, 0xa814, 0x8003, 0x60c2,
+	0xa830, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098,
+	0x2001, 0x1972, 0x0016, 0x200c, 0x2001, 0x0001, 0x080c, 0x20be,
+	0x080c, 0xc2e6, 0x9006, 0x080c, 0x20be, 0x001e, 0xa804, 0x9005,
+	0x0110, 0x2048, 0x0c28, 0x04d9, 0x080c, 0x8f8f, 0x012e, 0x009e,
+	0x00de, 0x0005, 0x00d6, 0x0096, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x8aef, 0x20e9, 0x0000, 0x2001, 0x1972, 0x2003, 0x0000, 0x7814,
+	0x2048, 0xa86f, 0x0200, 0xa873, 0x0000, 0xa814, 0x8003, 0x60c2,
+	0xa830, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098,
+	0x2001, 0x1972, 0x0016, 0x200c, 0x080c, 0xc2e6, 0x001e, 0xa804,
+	0x9005, 0x0110, 0x2048, 0x0c60, 0x0051, 0x7814, 0x2048, 0x080c,
+	0x0f87, 0x080c, 0x8f8f, 0x012e, 0x009e, 0x00de, 0x0005, 0x60c0,
+	0x8004, 0x9084, 0x0003, 0x9005, 0x0130, 0x9082, 0x0004, 0x20a3,
+	0x0000, 0x8000, 0x1de0, 0x0005, 0x080c, 0x8aa4, 0x7003, 0x7800,
+	0x7808, 0x8007, 0x700a, 0x60c3, 0x0008, 0x0804, 0x8f8f, 0x00d6,
+	0x00e6, 0x080c, 0x8aef, 0x7814, 0x9084, 0xff00, 0x2073, 0x0200,
+	0x8e70, 0x8e70, 0x9095, 0x0010, 0x2272, 0x8e70, 0x2073, 0x0034,
+	0x8e70, 0x2069, 0x1805, 0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70,
+	0x1f04, 0x884d, 0x2069, 0x1801, 0x20a9, 0x0004, 0x2d76, 0x8d68,
+	0x8e70, 0x1f04, 0x8856, 0x2069, 0x1982, 0x9086, 0xdf00, 0x0110,
+	0x2069, 0x199c, 0x20a9, 0x001a, 0x9e86, 0x0260, 0x1148, 0x00c6,
+	0x2061, 0x0200, 0x6010, 0x8000, 0x6012, 0x00ce, 0x2071, 0x0240,
+	0x2d04, 0x8007, 0x2072, 0x8d68, 0x8e70, 0x1f04, 0x8864, 0x60c3,
+	0x004c, 0x080c, 0x8f8f, 0x00ee, 0x00de, 0x0005, 0x080c, 0x8aa4,
+	0x7003, 0x6300, 0x7007, 0x0028, 0x7808, 0x700e, 0x60c3, 0x0008,
+	0x0804, 0x8f8f, 0x00d6, 0x0026, 0x0016, 0x080c, 0x8aef, 0x7003,
+	0x0200, 0x7814, 0x700e, 0x00e6, 0x9ef0, 0x0004, 0x2009, 0x0001,
+	0x2011, 0x000c, 0x2073, 0x0800, 0x8e70, 0x2073, 0x0000, 0x00ee,
+	0x7206, 0x710a, 0x62c2, 0x080c, 0x8f8f, 0x001e, 0x002e, 0x00de,
+	0x0005, 0x2001, 0x1816, 0x2004, 0x609a, 0x0804, 0x8f8f, 0x080c,
+	0x8aa4, 0x7003, 0x5200, 0x2069, 0x1853, 0x6804, 0xd084, 0x0130,
+	0x6828, 0x0016, 0x080c, 0x2509, 0x710e, 0x001e, 0x20a9, 0x0004,
+	0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0250,
+	0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1, 0x0254, 0x4003,
+	0x080c, 0x9940, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001,
+	0x181d, 0x2004, 0x7032, 0x2001, 0x181e, 0x2004, 0x7036, 0x0030,
+	0x2001, 0x1816, 0x2004, 0x9084, 0x00ff, 0x7036, 0x60c3, 0x001c,
+	0x0804, 0x8f8f, 0x080c, 0x8aa4, 0x7003, 0x0500, 0x080c, 0x9940,
+	0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001, 0x181d, 0x2004,
+	0x700a, 0x2001, 0x181e, 0x2004, 0x700e, 0x0030, 0x2001, 0x1816,
+	0x2004, 0x9084, 0x00ff, 0x700e, 0x20a9, 0x0004, 0x20e1, 0x0001,
+	0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0250, 0x4003, 0x60c3,
+	0x0010, 0x0804, 0x8f8f, 0x080c, 0x8aa4, 0x9006, 0x080c, 0x626e,
+	0xb8a0, 0x9086, 0x007e, 0x1130, 0x7003, 0x0400, 0x620c, 0xc2b4,
+	0x620e, 0x0058, 0x7814, 0x0096, 0x904d, 0x0120, 0x9006, 0xa89a,
+	0xa8a6, 0xa8aa, 0x009e, 0x7003, 0x0300, 0xb8a0, 0x9086, 0x007e,
+	0x1904, 0x8982, 0x00d6, 0x2069, 0x193d, 0x2001, 0x1835, 0x2004,
+	0xd0a4, 0x0188, 0x6800, 0x700a, 0x6808, 0x9084, 0x2000, 0x7012,
+	0x080c, 0x9957, 0x680c, 0x7016, 0x701f, 0x2710, 0x6818, 0x7022,
+	0x681c, 0x7026, 0x0090, 0x6800, 0x700a, 0x6804, 0x700e, 0x6808,
+	0x080c, 0x6c53, 0x1118, 0x9084, 0x37ff, 0x0010, 0x9084, 0x3fff,
+	0x7012, 0x080c, 0x9957, 0x680c, 0x7016, 0x00de, 0x20a9, 0x0004,
+	0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0256,
+	0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1, 0x025a, 0x4003,
+	0x00d6, 0x080c, 0x97b9, 0x2069, 0x1945, 0x2071, 0x024e, 0x6800,
+	0xc0dd, 0x7002, 0x080c, 0x5117, 0xd0e4, 0x0110, 0x680c, 0x700e,
+	0x00de, 0x04a8, 0x2001, 0x1835, 0x2004, 0xd0a4, 0x0170, 0x0016,
+	0x2001, 0x193e, 0x200c, 0x60e0, 0x9106, 0x0130, 0x2100, 0x60e3,
+	0x0000, 0x080c, 0x254a, 0x61e2, 0x001e, 0x20e1, 0x0001, 0x2099,
+	0x193d, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x20a9, 0x0008, 0x4003,
+	0x20a9, 0x0004, 0x2099, 0x1805, 0x20a1, 0x0256, 0x4003, 0x20a9,
+	0x0004, 0x2099, 0x1801, 0x20a1, 0x025a, 0x4003, 0x080c, 0x97b9,
+	0x20a1, 0x024e, 0x20a9, 0x0008, 0x2099, 0x1945, 0x4003, 0x60c3,
+	0x0074, 0x0804, 0x8f8f, 0x080c, 0x8aa4, 0x7003, 0x2010, 0x7007,
+	0x0014, 0x700b, 0x0800, 0x700f, 0x2000, 0x9006, 0x00f6, 0x2079,
+	0x1853, 0x7904, 0x00fe, 0xd1ac, 0x1110, 0x9085, 0x0020, 0xd1a4,
+	0x0110, 0x9085, 0x0010, 0x9085, 0x0002, 0x00d6, 0x0804, 0x8a54,
+	0x7026, 0x60c3, 0x0014, 0x0804, 0x8f8f, 0x080c, 0x8aa4, 0x7003,
+	0x5000, 0x0804, 0x892d, 0x080c, 0x8aa4, 0x7003, 0x2110, 0x7007,
+	0x0014, 0x60c3, 0x0014, 0x0804, 0x8f8f, 0x080c, 0x8ae6, 0x0010,
+	0x080c, 0x8aef, 0x7003, 0x0200, 0x60c3, 0x0004, 0x0804, 0x8f8f,
+	0x080c, 0x8aef, 0x7003, 0x0100, 0x700b, 0x0003, 0x700f, 0x2a00,
+	0x60c3, 0x0008, 0x0804, 0x8f8f, 0x080c, 0x8aef, 0x7003, 0x0200,
+	0x0804, 0x892d, 0x080c, 0x8aef, 0x7003, 0x0100, 0x782c, 0x9005,
+	0x0110, 0x700a, 0x0010, 0x700b, 0x0003, 0x7814, 0x700e, 0x60c3,
+	0x0008, 0x0804, 0x8f8f, 0x00d6, 0x080c, 0x8aef, 0x7003, 0x0210,
+	0x7007, 0x0014, 0x700b, 0x0800, 0xb894, 0x9086, 0x0014, 0x1198,
+	0xb99c, 0x9184, 0x0030, 0x0190, 0xb998, 0x9184, 0xc000, 0x1140,
+	0xd1ec, 0x0118, 0x700f, 0x2100, 0x0058, 0x700f, 0x0100, 0x0040,
+	0x700f, 0x0400, 0x0028, 0x700f, 0x0700, 0x0010, 0x700f, 0x0800,
+	0x00f6, 0x2079, 0x1853, 0x7904, 0x00fe, 0xd1ac, 0x1110, 0x9085,
+	0x0020, 0xd1a4, 0x0110, 0x9085, 0x0010, 0x2009, 0x1875, 0x210c,
+	0xd184, 0x1110, 0x9085, 0x0002, 0x0026, 0x2009, 0x1873, 0x210c,
+	0xd1e4, 0x0150, 0xc0c5, 0xbabc, 0xd28c, 0x1108, 0xc0cd, 0x9094,
+	0x0030, 0x9296, 0x0010, 0x0140, 0xd1ec, 0x0130, 0x9094, 0x0030,
+	0x9296, 0x0010, 0x0108, 0xc0bd, 0x002e, 0x7026, 0x60c3, 0x0014,
+	0x00de, 0x0804, 0x8f8f, 0x080c, 0x8aef, 0x7003, 0x0210, 0x7007,
+	0x0014, 0x700f, 0x0100, 0x60c3, 0x0014, 0x0804, 0x8f8f, 0x080c,
+	0x8aef, 0x7003, 0x0200, 0x0804, 0x88b3, 0x080c, 0x8aef, 0x7003,
+	0x0100, 0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804,
+	0x8f8f, 0x080c, 0x8aef, 0x7003, 0x0100, 0x700b, 0x000b, 0x60c3,
+	0x0008, 0x0804, 0x8f8f, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019,
+	0x3200, 0x2021, 0x0800, 0x0040, 0x0026, 0x00d6, 0x0036, 0x0046,
+	0x2019, 0x2200, 0x2021, 0x0100, 0x080c, 0x97ce, 0xb810, 0x9305,
+	0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6874, 0x700a, 0x6878,
+	0x700e, 0x9485, 0x0029, 0x7012, 0x004e, 0x003e, 0x00de, 0x080c,
+	0x8f7d, 0x721a, 0x9f95, 0x0000, 0x7222, 0x7027, 0xffff, 0x2071,
+	0x024c, 0x002e, 0x0005, 0x0026, 0x080c, 0x97ce, 0x7003, 0x02ff,
+	0x7007, 0xfffc, 0x00d6, 0x2069, 0x1800, 0x6874, 0x700a, 0x6878,
+	0x700e, 0x00de, 0x7013, 0x2029, 0x0c10, 0x7003, 0x0100, 0x7007,
+	0x0000, 0x700b, 0xfc02, 0x700f, 0x0000, 0x0005, 0x0026, 0x00d6,
+	0x0036, 0x0046, 0x2019, 0x3300, 0x2021, 0x0800, 0x0040, 0x0026,
+	0x00d6, 0x0036, 0x0046, 0x2019, 0x2300, 0x2021, 0x0100, 0x080c,
+	0x97ce, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800,
+	0xb810, 0x9005, 0x1140, 0xb814, 0x9005, 0x1128, 0x700b, 0x00ff,
+	0x700f, 0xfffe, 0x0020, 0x6874, 0x700a, 0x6878, 0x700e, 0x0000,
+	0x9485, 0x0098, 0x7012, 0x004e, 0x003e, 0x00de, 0x080c, 0x8f7d,
+	0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071, 0x024c, 0x002e,
+	0x0005, 0x080c, 0x8f7d, 0x721a, 0x7a08, 0x7222, 0x7814, 0x7026,
+	0x2071, 0x024c, 0x002e, 0x0005, 0x00b6, 0x00c6, 0x00d6, 0x00e6,
+	0x00f6, 0x2069, 0x0200, 0x2071, 0x0240, 0x6004, 0x908a, 0x0085,
+	0x0a0c, 0x0db2, 0x908a, 0x0092, 0x1a0c, 0x0db2, 0x6110, 0x2158,
+	0xb9b0, 0x2c78, 0x2061, 0x0100, 0x619a, 0x9082, 0x0085, 0x0033,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005, 0x8b5d, 0x8b6c,
+	0x8b77, 0x8b5b, 0x8b5b, 0x8b5b, 0x8b5d, 0x8b5b, 0x8b5b, 0x8b5b,
+	0x8b5b, 0x8b5b, 0x8b5b, 0x080c, 0x0db2, 0x0411, 0x60c3, 0x0000,
+	0x0026, 0x080c, 0x283d, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5,
+	0x2012, 0x002e, 0x0804, 0x8f8f, 0x0431, 0x7808, 0x700a, 0x7814,
+	0x700e, 0x7017, 0xffff, 0x60c3, 0x000c, 0x0804, 0x8f8f, 0x0479,
+	0x7003, 0x0003, 0x7007, 0x0300, 0x60c3, 0x0004, 0x0804, 0x8f8f,
+	0x0026, 0x080c, 0x97ce, 0xb810, 0x9085, 0x8100, 0x7002, 0xb814,
+	0x7006, 0x2069, 0x1800, 0x6874, 0x700a, 0x6878, 0x700e, 0x7013,
+	0x0009, 0x0804, 0x8abf, 0x0026, 0x080c, 0x97ce, 0xb810, 0x9085,
+	0x8400, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6874, 0x700a,
+	0x6878, 0x700e, 0x2001, 0x0099, 0x7012, 0x0804, 0x8b21, 0x0026,
+	0x080c, 0x97ce, 0xb810, 0x9085, 0x8500, 0x7002, 0xb814, 0x7006,
+	0x2069, 0x1800, 0x6874, 0x700a, 0x6878, 0x700e, 0x2001, 0x0099,
+	0x7012, 0x0804, 0x8b21, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
+	0x2c78, 0x2069, 0x0200, 0x2071, 0x0240, 0x7804, 0x908a, 0x0040,
+	0x0a0c, 0x0db2, 0x908a, 0x0054, 0x1a0c, 0x0db2, 0x7910, 0x2158,
+	0xb9b0, 0x2061, 0x0100, 0x619a, 0x9082, 0x0040, 0x0033, 0x00fe,
+	0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005, 0x8bf2, 0x8c99, 0x8c6c,
+	0x8dbb, 0x8bf0, 0x8bf0, 0x8bf0, 0x8bf0, 0x8bf0, 0x8bf0, 0x8bf0,
+	0x930c, 0x9318, 0x9324, 0x9330, 0x8bf0, 0x9716, 0x8bf0, 0x9300,
+	0x080c, 0x0db2, 0x0096, 0x780b, 0xffff, 0x080c, 0x8c48, 0x7914,
+	0x2148, 0xa978, 0x7956, 0x7132, 0xa97c, 0x9184, 0x000f, 0x1118,
+	0x2001, 0x0005, 0x0040, 0xd184, 0x0118, 0x2001, 0x0004, 0x0018,
+	0x9084, 0x0006, 0x8004, 0x2010, 0x785c, 0x9084, 0x00ff, 0x8007,
+	0x9205, 0x7042, 0xd1ac, 0x0128, 0x7047, 0x0002, 0x080c, 0x1582,
+	0x0050, 0xd1b4, 0x0118, 0x7047, 0x0001, 0x0028, 0x7047, 0x0000,
+	0x9016, 0x2230, 0x0010, 0xaab0, 0xaeac, 0x726a, 0x766e, 0x20a9,
+	0x0008, 0x20e9, 0x0000, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0023,
+	0x2098, 0x20a1, 0x0252, 0x2069, 0x0200, 0x6813, 0x0018, 0x4003,
+	0x6813, 0x0008, 0x60c3, 0x0020, 0x6017, 0x0009, 0x2001, 0x19d2,
+	0x2003, 0x07d0, 0x2001, 0x19d1, 0x2003, 0x0009, 0x009e, 0x0005,
+	0x6813, 0x0008, 0xba8c, 0x8210, 0xb8bc, 0xd084, 0x0128, 0x7a46,
+	0x7b14, 0x7b4a, 0x722e, 0x732a, 0x9294, 0x00ff, 0xba8e, 0x8217,
+	0x721a, 0xba10, 0x9295, 0x0600, 0x7202, 0xba14, 0x7206, 0x2069,
+	0x1800, 0x6a74, 0x720a, 0x6a78, 0x720e, 0x7013, 0x0829, 0x2f10,
+	0x7222, 0x7027, 0xffff, 0x0005, 0x00d6, 0x0096, 0x0081, 0x7814,
+	0x2048, 0xa890, 0x7002, 0xa88c, 0x7006, 0xa8b0, 0x700a, 0xa8ac,
+	0x700e, 0x60c3, 0x000c, 0x009e, 0x00de, 0x0804, 0x8f8f, 0x6813,
+	0x0008, 0xb810, 0x9085, 0x0500, 0x7002, 0xb814, 0x7006, 0x2069,
+	0x1800, 0x6874, 0x700a, 0x6878, 0x700e, 0x7013, 0x0889, 0x080c,
+	0x8f7d, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071, 0x024c,
+	0x0005, 0x00d6, 0x0096, 0x080c, 0x8d99, 0x7814, 0x2048, 0x080c,
+	0xb5f9, 0x1130, 0x7814, 0x9084, 0x0700, 0x8007, 0x0033, 0x0010,
+	0x9006, 0x001b, 0x009e, 0x00de, 0x0005, 0x8cb7, 0x8d20, 0x8d30,
+	0x8d56, 0x8d62, 0x8d73, 0x8d7b, 0x8cb5, 0x080c, 0x0db2, 0x0016,
+	0x0036, 0xa97c, 0x918c, 0x0003, 0x0118, 0x9186, 0x0003, 0x1198,
+	0xaba8, 0x7824, 0xd0cc, 0x1168, 0x7316, 0xa898, 0x701a, 0xa894,
+	0x701e, 0x003e, 0x001e, 0x2001, 0x1980, 0x2004, 0x60c2, 0x0804,
+	0x8f8f, 0xc3e5, 0x0c88, 0x9186, 0x0001, 0x190c, 0x0db2, 0xaba8,
+	0x7824, 0xd0cc, 0x1904, 0x8d1d, 0x7316, 0xa898, 0x701a, 0xa894,
+	0x701e, 0xa8a4, 0x7026, 0xa8ac, 0x702e, 0x2009, 0x0018, 0x9384,
+	0x0300, 0x0570, 0xd3c4, 0x0110, 0xa8ac, 0x9108, 0xd3cc, 0x0110,
+	0xa8a4, 0x9108, 0x6810, 0x9085, 0x0010, 0x6812, 0x2011, 0x0258,
+	0x20e9, 0x0000, 0x22a0, 0x0156, 0x20a9, 0x0008, 0xa860, 0x20e0,
+	0xa85c, 0x9080, 0x002c, 0x2098, 0x4003, 0x6810, 0x8000, 0x6812,
+	0x2011, 0x0240, 0x22a0, 0x20a9, 0x0005, 0x4003, 0x6810, 0xc084,
+	0x6812, 0x015e, 0x9184, 0x0003, 0x0118, 0x2019, 0x0245, 0x201a,
+	0x61c2, 0x003e, 0x001e, 0x0804, 0x8f8f, 0xc3e5, 0x0804, 0x8cdc,
+	0x2011, 0x0008, 0x2001, 0x180e, 0x2004, 0xd0a4, 0x0110, 0x2011,
+	0x0028, 0x7824, 0xd0cc, 0x1110, 0x7216, 0x0470, 0x0ce8, 0xc2e5,
+	0x2011, 0x0302, 0x0016, 0x782c, 0x701a, 0x7930, 0x711e, 0x9105,
+	0x0108, 0xc2dd, 0x001e, 0x7824, 0xd0cc, 0x0108, 0xc2e5, 0x7216,
+	0x7027, 0x0012, 0x702f, 0x0008, 0x7043, 0x7000, 0x7047, 0x0500,
+	0x704f, 0x000a, 0x2069, 0x0200, 0x6813, 0x0009, 0x2071, 0x0240,
+	0x700b, 0x2500, 0x60c3, 0x0032, 0x0804, 0x8f8f, 0x2011, 0x0028,
+	0x7824, 0xd0cc, 0x1128, 0x7216, 0x60c3, 0x0018, 0x0804, 0x8f8f,
+	0x0cd0, 0xc2e5, 0x2011, 0x0100, 0x7824, 0xd0cc, 0x0108, 0xc2e5,
+	0x7216, 0x702f, 0x0008, 0x7858, 0x9084, 0x00ff, 0x7036, 0x60c3,
+	0x0020, 0x0804, 0x8f8f, 0x2011, 0x0008, 0x7824, 0xd0cc, 0x0108,
+	0xc2e5, 0x7216, 0x0c08, 0x0036, 0x7b14, 0x9384, 0xff00, 0x7816,
+	0x9384, 0x00ff, 0x8001, 0x1138, 0x7824, 0xd0cc, 0x0108, 0xc2e5,
+	0x7216, 0x003e, 0x0888, 0x0046, 0x2021, 0x0800, 0x0006, 0x7824,
+	0xd0cc, 0x000e, 0x0108, 0xc4e5, 0x7416, 0x004e, 0x701e, 0x003e,
+	0x0818, 0x00d6, 0x6813, 0x0008, 0xb810, 0x9085, 0x0700, 0x7002,
+	0xb814, 0x7006, 0x2069, 0x1800, 0x6874, 0x700a, 0x6878, 0x700e,
+	0x7824, 0xd0cc, 0x1168, 0x7013, 0x0898, 0x080c, 0x8f7d, 0x721a,
+	0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071, 0x024c, 0x00de, 0x0005,
+	0x7013, 0x0889, 0x0c90, 0x0016, 0x7814, 0x9084, 0x0700, 0x8007,
+	0x0013, 0x001e, 0x0005, 0x8dcb, 0x8dcb, 0x8dcd, 0x8dcb, 0x8dcb,
+	0x8dcb, 0x8de7, 0x8dcb, 0x080c, 0x0db2, 0x7914, 0x918c, 0x08ff,
+	0x918d, 0xf600, 0x7916, 0x2009, 0x0003, 0x00b9, 0x2069, 0x1853,
+	0x6804, 0xd0bc, 0x0130, 0x682c, 0x9084, 0x00ff, 0x8007, 0x7032,
+	0x0010, 0x7033, 0x3f00, 0x60c3, 0x0001, 0x0804, 0x8f8f, 0x2009,
+	0x0003, 0x0019, 0x7033, 0x7f00, 0x0cb0, 0x0016, 0x080c, 0x97ce,
+	0x001e, 0xb810, 0x9085, 0x0100, 0x7002, 0xb814, 0x7006, 0x2069,
+	0x1800, 0x6a74, 0x720a, 0x6a78, 0x720e, 0x7013, 0x0888, 0x918d,
+	0x0008, 0x7116, 0x080c, 0x8f7d, 0x721a, 0x7a08, 0x7222, 0x2f10,
+	0x7226, 0x0005, 0x00b6, 0x0096, 0x00e6, 0x00d6, 0x00c6, 0x0056,
+	0x0046, 0x0036, 0x2061, 0x0100, 0x2071, 0x1800, 0x7810, 0x2058,
+	0xb8a0, 0x2028, 0xb910, 0xba14, 0x7374, 0x7478, 0x7820, 0x90be,
+	0x0006, 0x0904, 0x8eec, 0x90be, 0x000a, 0x1904, 0x8ea8, 0x609f,
+	0x0000, 0x7814, 0x2048, 0xa87c, 0xd0fc, 0x05c8, 0xaf90, 0x9784,
+	0xff00, 0x9105, 0x6062, 0x873f, 0x9784, 0xff00, 0x0006, 0x7814,
+	0x2048, 0xa878, 0x9005, 0x000e, 0x1160, 0xaf94, 0x87ff, 0x0510,
+	0x2039, 0x0098, 0x9705, 0x6072, 0x7808, 0x6082, 0x2f00, 0x6086,
+	0x0038, 0x9185, 0x2200, 0x6062, 0x6073, 0x0129, 0x6077, 0x0000,
+	0x609f, 0x0000, 0x2001, 0x1835, 0x2004, 0xd0ac, 0x11a8, 0xd09c,
+	0x0130, 0x7814, 0x2048, 0xa874, 0x9082, 0x0080, 0x1268, 0xb814,
+	0x609e, 0x0050, 0x2039, 0x0029, 0x9705, 0x6072, 0x0c48, 0x9185,
+	0x0200, 0x6062, 0x6073, 0x2029, 0xa87c, 0xd0fc, 0x0118, 0xaf94,
+	0x87ff, 0x1120, 0x2f00, 0x6082, 0x7808, 0x6086, 0x6266, 0x636a,
+	0x646e, 0x6077, 0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e,
+	0x8007, 0x607a, 0x607f, 0x0000, 0xa838, 0x608a, 0xa834, 0x608e,
+	0xa848, 0x60c6, 0xa844, 0x60ca, 0xb86c, 0x60ce, 0x60af, 0x95d5,
+	0x60d7, 0x0000, 0x080c, 0x97b3, 0x2009, 0x07d0, 0x60c4, 0x9084,
+	0xfff0, 0x9005, 0x0110, 0x2009, 0x1b58, 0x080c, 0x7ccc, 0x003e,
+	0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x009e, 0x00be, 0x0005,
+	0x7804, 0x9086, 0x0040, 0x0904, 0x8f28, 0x9185, 0x0100, 0x6062,
+	0x6266, 0x636a, 0x646e, 0x6073, 0x0809, 0x6077, 0x0008, 0x60af,
+	0x95d5, 0x60d7, 0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e,
+	0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086,
+	0x7814, 0x2048, 0xa838, 0x608a, 0xa834, 0x608e, 0xa848, 0x60c6,
+	0xa844, 0x60ca, 0xb86c, 0x60ce, 0xbab0, 0x629e, 0x080c, 0x97b3,
+	0x2009, 0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110, 0x2009,
+	0x1b58, 0x080c, 0x7ccc, 0x003e, 0x004e, 0x005e, 0x00ce, 0x00de,
+	0x00ee, 0x009e, 0x00be, 0x0005, 0x7814, 0x2048, 0xa87c, 0x9084,
+	0x0003, 0x9086, 0x0002, 0x0904, 0x8f44, 0x9185, 0x0100, 0x6062,
+	0x6266, 0x636a, 0x646e, 0x6073, 0x0880, 0x6077, 0x0008, 0xb88c,
+	0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x607a, 0x7838, 0x607e,
+	0x2f00, 0x6086, 0x7808, 0x6082, 0xa890, 0x608a, 0xa88c, 0x608e,
+	0xa8b0, 0x60c6, 0xa8ac, 0x60ca, 0xa8ac, 0x7930, 0x9108, 0x7932,
+	0xa8b0, 0x792c, 0x9109, 0x792e, 0xb86c, 0x60ce, 0x60af, 0x95d5,
+	0x60d7, 0x0000, 0xbab0, 0x629e, 0x080c, 0x9790, 0x0804, 0x8ed8,
+	0xb8bc, 0xd084, 0x0148, 0xb88c, 0x7814, 0x2048, 0xb88c, 0x7846,
+	0xa836, 0x2900, 0xa83a, 0xb04a, 0x9185, 0x0600, 0x6062, 0x6266,
+	0x636a, 0x646e, 0x6073, 0x0829, 0x6077, 0x0000, 0x60af, 0x9575,
+	0x60d7, 0x0000, 0x0804, 0x8ebb, 0x9185, 0x0700, 0x6062, 0x6266,
+	0x636a, 0x646e, 0x7824, 0xd0cc, 0x7826, 0x0118, 0x6073, 0x0889,
+	0x0010, 0x6073, 0x0898, 0x6077, 0x0000, 0xb88c, 0x8000, 0x9084,
+	0x00ff, 0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086,
+	0x7808, 0x6082, 0xa838, 0x608a, 0xa834, 0x608e, 0xa848, 0x60c6,
+	0xa844, 0x60ca, 0xb86c, 0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000,
+	0xbab0, 0x629e, 0x7824, 0xd0cc, 0x0120, 0x080c, 0x97b3, 0x0804,
+	0x8ed8, 0x080c, 0x9790, 0x0804, 0x8ed8, 0x7a10, 0x00b6, 0x2258,
+	0xba8c, 0x8210, 0x9294, 0x00ff, 0xba8e, 0x00be, 0x8217, 0x0005,
+	0x00d6, 0x2069, 0x19b6, 0x6843, 0x0001, 0x00de, 0x0005, 0x60a3,
+	0x0056, 0x60a7, 0x9575, 0x00f1, 0x080c, 0x7cbe, 0x0005, 0x0016,
+	0x2001, 0x180c, 0x200c, 0x9184, 0x0600, 0x9086, 0x0600, 0x0128,
+	0x0089, 0x080c, 0x7cbe, 0x001e, 0x0005, 0xc1e5, 0x2001, 0x180c,
+	0x2102, 0x2001, 0x19b7, 0x2003, 0x0000, 0x2001, 0x19bf, 0x2003,
+	0x0000, 0x0c88, 0x0006, 0x6014, 0x9084, 0x1804, 0x9085, 0x0009,
+	0x6016, 0x000e, 0x0005, 0x0016, 0x00c6, 0x0006, 0x2061, 0x0100,
+	0x61a4, 0x60a7, 0x95f5, 0x6014, 0x9084, 0x1804, 0x9085, 0x0008,
+	0x6016, 0x000e, 0xa001, 0xa001, 0xa001, 0x61a6, 0x00ce, 0x001e,
+	0x0005, 0x00c6, 0x00d6, 0x0016, 0x0026, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x080c, 0x6c53, 0x11e8, 0x2001, 0x19d2, 0x2004, 0x9005,
+	0x1904, 0x9021, 0x0066, 0x2031, 0x0001, 0x080c, 0x6d03, 0x006e,
+	0x1160, 0x2061, 0x0100, 0x6020, 0xd0b4, 0x1120, 0x6024, 0xd084,
+	0x090c, 0x0db2, 0x080c, 0x7cbe, 0x0460, 0x00c6, 0x2061, 0x19b6,
+	0x00d0, 0x6904, 0x9194, 0x4000, 0x0548, 0x080c, 0x8fbb, 0x080c,
+	0x2997, 0x00c6, 0x2061, 0x19b6, 0x6128, 0x9192, 0x0008, 0x1258,
+	0x8108, 0x612a, 0x6124, 0x00ce, 0x81ff, 0x0198, 0x080c, 0x7cbe,
+	0x080c, 0x8fb2, 0x0070, 0x6124, 0x91e5, 0x0000, 0x0140, 0x080c,
+	0xd358, 0x080c, 0x7cc7, 0x2009, 0x0014, 0x080c, 0x9a50, 0x00ce,
+	0x0000, 0x002e, 0x001e, 0x00de, 0x00ce, 0x0005, 0x2001, 0x19d2,
+	0x2004, 0x9005, 0x1db0, 0x00c6, 0x2061, 0x19b6, 0x6128, 0x9192,
+	0x0003, 0x1e08, 0x8108, 0x612a, 0x00ce, 0x080c, 0x7cbe, 0x080c,
+	0x58e0, 0x2009, 0x1852, 0x2114, 0x8210, 0x220a, 0x0c10, 0x0096,
+	0x00c6, 0x00d6, 0x00e6, 0x0016, 0x0026, 0x080c, 0x7cd4, 0x2071,
+	0x19b6, 0x713c, 0x81ff, 0x0904, 0x90ad, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x080c, 0x6c53, 0x11b0, 0x0036, 0x2019, 0x0002, 0x080c,
+	0x9254, 0x003e, 0x713c, 0x2160, 0x080c, 0xd358, 0x2009, 0x004a,
+	0x080c, 0x9a50, 0x0066, 0x2031, 0x0001, 0x080c, 0x6d03, 0x006e,
+	0x0804, 0x90ad, 0x6904, 0xd1f4, 0x0904, 0x90b4, 0x080c, 0x2997,
+	0x00c6, 0x703c, 0x9065, 0x090c, 0x0db2, 0x6020, 0x00ce, 0x9086,
+	0x0006, 0x1528, 0x61c8, 0x60c4, 0x9105, 0x1508, 0x2009, 0x180c,
+	0x2104, 0xd0d4, 0x01e0, 0x6214, 0x9294, 0x1800, 0x1128, 0x6224,
+	0x9294, 0x0002, 0x1510, 0x0030, 0xc0d4, 0x200a, 0xd0cc, 0x0110,
+	0x080c, 0x28ea, 0x6014, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x6016,
+	0x703c, 0x2060, 0x2009, 0x0049, 0x080c, 0x9a50, 0x0070, 0x0036,
+	0x2019, 0x0001, 0x080c, 0x9254, 0x003e, 0x713c, 0x2160, 0x080c,
+	0xd358, 0x2009, 0x004a, 0x080c, 0x9a50, 0x002e, 0x001e, 0x00ee,
+	0x00de, 0x00ce, 0x009e, 0x0005, 0xd1ec, 0x1904, 0x906e, 0x0804,
+	0x9070, 0x0026, 0x00e6, 0x2071, 0x19b6, 0x7048, 0xd084, 0x01c0,
+	0x713c, 0x81ff, 0x01a8, 0x2071, 0x0100, 0x9188, 0x0008, 0x2114,
+	0x928e, 0x0006, 0x1138, 0x7014, 0x9084, 0x1984, 0x9085, 0x0012,
+	0x7016, 0x0030, 0x7014, 0x9084, 0x1984, 0x9085, 0x0016, 0x7016,
+	0x00ee, 0x002e, 0x0005, 0x00b6, 0x00e6, 0x00d6, 0x00c6, 0x0066,
+	0x0056, 0x0046, 0x0006, 0x0126, 0x2091, 0x8000, 0x6010, 0x2058,
+	0xbca0, 0x2071, 0x19b6, 0x7018, 0x2058, 0x8bff, 0x0190, 0xb8a0,
+	0x9406, 0x0118, 0xb854, 0x2058, 0x0cc0, 0x6014, 0x0096, 0x2048,
+	0xac6c, 0xad70, 0xae78, 0x009e, 0x080c, 0x60b0, 0x0110, 0x9085,
+	0x0001, 0x012e, 0x000e, 0x004e, 0x005e, 0x006e, 0x00ce, 0x00de,
+	0x00ee, 0x00be, 0x0005, 0x080c, 0x8aa4, 0x7003, 0x1200, 0x7838,
+	0x7012, 0x783c, 0x7016, 0x00c6, 0x7820, 0x9086, 0x0004, 0x1148,
+	0x7810, 0x9005, 0x0130, 0x00b6, 0x2058, 0xb810, 0xb914, 0x00be,
+	0x0020, 0x2061, 0x1800, 0x6074, 0x6178, 0x9084, 0x00ff, 0x700a,
+	0x710e, 0x00ce, 0x60c3, 0x002c, 0x0804, 0x8f8f, 0x080c, 0x8aa4,
+	0x7003, 0x0f00, 0x7808, 0xd09c, 0x0128, 0xb810, 0x9084, 0x00ff,
+	0x700a, 0xb814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x8f8f, 0x0156,
+	0x080c, 0x8aef, 0x7003, 0x0200, 0x2011, 0x1848, 0x63f0, 0x2312,
+	0x20a9, 0x0006, 0x2011, 0x1840, 0x2019, 0x1841, 0x9ef0, 0x0002,
+	0x2376, 0x8e70, 0x2276, 0x8e70, 0x9398, 0x0002, 0x9290, 0x0002,
+	0x1f04, 0x9150, 0x60c3, 0x001c, 0x015e, 0x0804, 0x8f8f, 0x0016,
+	0x0026, 0x080c, 0x8acb, 0x080c, 0x8add, 0x9e80, 0x0004, 0x20e9,
+	0x0000, 0x20a0, 0x7814, 0x0096, 0x2048, 0xa800, 0x2048, 0xa860,
+	0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098, 0x009e, 0x7808, 0x9088,
+	0x0002, 0x21a8, 0x9192, 0x0010, 0x1250, 0x4003, 0x9080, 0x0004,
+	0x8003, 0x60c2, 0x080c, 0x8f8f, 0x002e, 0x001e, 0x0005, 0x20a9,
+	0x0010, 0x4003, 0x080c, 0x97b9, 0x20a1, 0x0240, 0x22a8, 0x4003,
+	0x0c68, 0x080c, 0x8aa4, 0x7003, 0x6200, 0x7808, 0x700e, 0x60c3,
+	0x0008, 0x0804, 0x8f8f, 0x0016, 0x0026, 0x080c, 0x8aa4, 0x20e9,
+	0x0000, 0x20a1, 0x024c, 0x7814, 0x0096, 0x2048, 0xa800, 0x2048,
+	0xa860, 0x20e0, 0xa85c, 0x9080, 0x0023, 0x2098, 0x009e, 0x7808,
+	0x9088, 0x0002, 0x21a8, 0x4003, 0x8003, 0x60c2, 0x080c, 0x8f8f,
+	0x002e, 0x001e, 0x0005, 0x00e6, 0x00c6, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x19b6, 0x700c, 0x2060, 0x8cff, 0x0178, 0x080c,
+	0xb7fa, 0x1110, 0x080c, 0xa364, 0x600c, 0x0006, 0x080c, 0xba61,
+	0x080c, 0x99d6, 0x080c, 0x933f, 0x00ce, 0x0c78, 0x2c00, 0x700e,
+	0x700a, 0x012e, 0x000e, 0x00ce, 0x00ee, 0x0005, 0x0126, 0x0156,
+	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, 0x0016, 0x0006,
+	0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c, 0xe7ff, 0x2102,
+	0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x19b6, 0x7024, 0x2060,
+	0x8cff, 0x01f8, 0x080c, 0x8fbb, 0x6ac0, 0x68c3, 0x0000, 0x080c,
+	0x7cc7, 0x00c6, 0x2061, 0x0100, 0x080c, 0x97d2, 0x00ce, 0x20a9,
+	0x01f4, 0x0461, 0x2009, 0x0013, 0x080c, 0x9a50, 0x000e, 0x001e,
+	0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e,
+	0x0005, 0x2001, 0x1800, 0x2004, 0x9096, 0x0001, 0x0d78, 0x9096,
+	0x0004, 0x0d60, 0x080c, 0x7cc7, 0x6814, 0x9084, 0x0001, 0x0110,
+	0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011, 0x588a,
+	0x080c, 0x7c4a, 0x20a9, 0x01f4, 0x0009, 0x08c0, 0x6824, 0xd094,
+	0x0140, 0x6827, 0x0004, 0x7804, 0x9084, 0x4000, 0x190c, 0x2997,
+	0x0090, 0xd084, 0x0118, 0x6827, 0x0001, 0x0010, 0x1f04, 0x9236,
+	0x7804, 0x9084, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2987,
+	0x9006, 0x080c, 0x2987, 0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6,
+	0x00d6, 0x00c6, 0x0066, 0x0026, 0x0016, 0x0006, 0x2091, 0x8000,
+	0x2001, 0x180c, 0x200c, 0x918c, 0xdbff, 0x2102, 0x2069, 0x0100,
+	0x2079, 0x0140, 0x2071, 0x19b6, 0x703c, 0x2060, 0x8cff, 0x0904,
+	0x92e1, 0x9386, 0x0002, 0x1128, 0x6814, 0x9084, 0x0002, 0x0904,
+	0x92e1, 0x68af, 0x95f5, 0x6817, 0x0010, 0x2009, 0x00fa, 0x8109,
+	0x1df0, 0x69c6, 0x68cb, 0x0008, 0x080c, 0x7cd4, 0x080c, 0x1d14,
+	0x0046, 0x2009, 0x017f, 0x200b, 0x00a5, 0x2021, 0x0169, 0x2404,
+	0x9084, 0x000f, 0x9086, 0x0004, 0x11f8, 0x68af, 0x95f5, 0x68c6,
+	0x68cb, 0x0008, 0x00e6, 0x00f6, 0x2079, 0x0090, 0x2071, 0x1a34,
+	0x6814, 0x9084, 0x1984, 0x9085, 0x0012, 0x6816, 0x782b, 0x0008,
+	0x7003, 0x0000, 0x00fe, 0x00ee, 0x9386, 0x0002, 0x1128, 0x7884,
+	0x9005, 0x1110, 0x7887, 0x0001, 0x2001, 0x1950, 0x2004, 0x200a,
+	0x004e, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004,
+	0x7804, 0x9084, 0x4000, 0x190c, 0x2997, 0x0090, 0xd08c, 0x0118,
+	0x6827, 0x0002, 0x0010, 0x1f04, 0x92bb, 0x7804, 0x9084, 0x1000,
+	0x0138, 0x2001, 0x0100, 0x080c, 0x2987, 0x9006, 0x080c, 0x2987,
+	0x6827, 0x4000, 0x6824, 0x83ff, 0x1120, 0x2009, 0x0049, 0x080c,
+	0x9a50, 0x000e, 0x001e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee,
+	0x00fe, 0x015e, 0x012e, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000,
+	0x2069, 0x19b6, 0x6a06, 0x012e, 0x00de, 0x0005, 0x00d6, 0x0126,
+	0x2091, 0x8000, 0x2069, 0x19b6, 0x6a32, 0x012e, 0x00de, 0x0005,
+	0x080c, 0x8c48, 0x7814, 0x080c, 0x511b, 0x0108, 0x782c, 0x7032,
+	0x7042, 0x7047, 0x1000, 0x0478, 0x080c, 0x8c48, 0x7814, 0x080c,
+	0x511b, 0x0108, 0x782c, 0x7032, 0x7042, 0x7047, 0x4000, 0x0418,
+	0x080c, 0x8c48, 0x7814, 0x080c, 0x511b, 0x0108, 0x782c, 0x7032,
+	0x7042, 0x7047, 0x2000, 0x00b8, 0x080c, 0x8c48, 0x7814, 0x080c,
+	0x511b, 0x0108, 0x782c, 0x7032, 0x7042, 0x7047, 0x0400, 0x0058,
+	0x080c, 0x8c48, 0x7814, 0x080c, 0x511b, 0x0108, 0x782c, 0x7032,
+	0x7042, 0x7047, 0x0200, 0x60c3, 0x0020, 0x0804, 0x8f8f, 0x00e6,
+	0x2071, 0x19b6, 0x7020, 0x9005, 0x0110, 0x8001, 0x7022, 0x00ee,
+	0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066, 0x0006,
+	0x0126, 0x2091, 0x8000, 0x2071, 0x19b6, 0x7614, 0x2660, 0x2678,
+	0x2039, 0x0001, 0x87ff, 0x0904, 0x93e4, 0x8cff, 0x0904, 0x93e4,
+	0x6020, 0x9086, 0x0006, 0x1904, 0x93df, 0x88ff, 0x0138, 0x2800,
+	0x9c06, 0x1904, 0x93df, 0x2039, 0x0000, 0x0050, 0x6010, 0x9b06,
+	0x1904, 0x93df, 0x85ff, 0x0120, 0x6054, 0x9106, 0x1904, 0x93df,
+	0x7024, 0x9c06, 0x15b0, 0x2069, 0x0100, 0x68c0, 0x9005, 0x1160,
+	0x6824, 0xd084, 0x0148, 0x6827, 0x0001, 0x080c, 0x7cc7, 0x080c,
+	0x9469, 0x7027, 0x0000, 0x0428, 0x080c, 0x7cc7, 0x6820, 0xd0b4,
+	0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000, 0x080c,
+	0x9469, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384,
+	0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2987, 0x9006, 0x080c,
+	0x2987, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001,
+	0x003e, 0x7014, 0x9c36, 0x1110, 0x660c, 0x7616, 0x7010, 0x9c36,
+	0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7012, 0x0010, 0x7013,
+	0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008,
+	0x2678, 0x89ff, 0x1168, 0x600f, 0x0000, 0x6014, 0x0096, 0x2048,
+	0x080c, 0xb5f9, 0x0110, 0x080c, 0xcf91, 0x009e, 0x080c, 0x9a06,
+	0x080c, 0x933f, 0x88ff, 0x1190, 0x00ce, 0x0804, 0x935a, 0x2c78,
+	0x600c, 0x2060, 0x0804, 0x935a, 0x9006, 0x012e, 0x000e, 0x006e,
+	0x007e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000,
+	0x00ce, 0x98c5, 0x0001, 0x0c88, 0x00f6, 0x00e6, 0x00d6, 0x0096,
+	0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071,
+	0x19b6, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0904, 0x9458, 0x6020,
+	0x9086, 0x0006, 0x1904, 0x9453, 0x87ff, 0x0128, 0x2700, 0x9c06,
+	0x1904, 0x9453, 0x0040, 0x6010, 0x9b06, 0x15e8, 0x85ff, 0x0118,
+	0x6054, 0x9106, 0x15c0, 0x703c, 0x9c06, 0x1168, 0x0036, 0x2019,
+	0x0001, 0x080c, 0x9254, 0x7033, 0x0000, 0x9006, 0x703e, 0x7042,
+	0x7046, 0x704a, 0x003e, 0x7038, 0x9c36, 0x1110, 0x660c, 0x763a,
+	0x7034, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7036,
+	0x0010, 0x7037, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110,
+	0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x6014, 0x2048, 0x080c,
+	0xb5f9, 0x0110, 0x080c, 0xcf91, 0x080c, 0x9a06, 0x87ff, 0x1198,
+	0x00ce, 0x0804, 0x9404, 0x2c78, 0x600c, 0x2060, 0x0804, 0x9404,
+	0x9006, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x009e, 0x00de,
+	0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce, 0x97bd, 0x0001,
+	0x0c80, 0x00e6, 0x2071, 0x19b6, 0x2001, 0x1800, 0x2004, 0x9086,
+	0x0002, 0x1118, 0x7007, 0x0005, 0x0010, 0x7007, 0x0000, 0x00ee,
+	0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x2071, 0x19b6, 0x2c10, 0x7638, 0x2660, 0x2678,
+	0x8cff, 0x0518, 0x2200, 0x9c06, 0x11e0, 0x7038, 0x9c36, 0x1110,
+	0x660c, 0x763a, 0x7034, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118,
+	0x2f00, 0x7036, 0x0010, 0x7037, 0x0000, 0x660c, 0x2c00, 0x9f06,
+	0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x9085, 0x0001,
+	0x0020, 0x2c78, 0x600c, 0x2060, 0x08d8, 0x012e, 0x000e, 0x002e,
+	0x006e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0096, 0x00f6, 0x00e6,
+	0x00d6, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000,
+	0x2071, 0x19b6, 0x760c, 0x2660, 0x2678, 0x8cff, 0x0904, 0x9545,
+	0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206, 0x1904, 0x9540,
+	0x7024, 0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904,
+	0x951c, 0x080c, 0x8fbb, 0x68c3, 0x0000, 0x080c, 0x9469, 0x7027,
+	0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138,
+	0x2001, 0x0100, 0x080c, 0x2987, 0x9006, 0x080c, 0x2987, 0x2069,
+	0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x700c,
+	0x9c36, 0x1110, 0x660c, 0x760e, 0x7008, 0x9c36, 0x1140, 0x2c00,
+	0x9f36, 0x0118, 0x2f00, 0x700a, 0x0010, 0x700b, 0x0000, 0x660c,
+	0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
+	0x0000, 0x080c, 0xb7e9, 0x1158, 0x080c, 0x2e55, 0x080c, 0xb7fa,
+	0x11f0, 0x080c, 0xa364, 0x00d8, 0x080c, 0x9469, 0x08c0, 0x080c,
+	0xb7fa, 0x1118, 0x080c, 0xa364, 0x0090, 0x6014, 0x2048, 0x080c,
+	0xb5f9, 0x0168, 0x6020, 0x9086, 0x0003, 0x1508, 0xa867, 0x0103,
+	0xab7a, 0xa877, 0x0000, 0x080c, 0x6529, 0x080c, 0xb7dd, 0x080c,
+	0xba61, 0x080c, 0x9a06, 0x080c, 0x933f, 0x00ce, 0x0804, 0x94c5,
+	0x2c78, 0x600c, 0x2060, 0x0804, 0x94c5, 0x012e, 0x000e, 0x002e,
+	0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x009e, 0x0005, 0x6020,
+	0x9086, 0x0006, 0x1d20, 0x080c, 0xcf91, 0x0c08, 0x00d6, 0x080c,
+	0x8aef, 0x7003, 0x0200, 0x7007, 0x0014, 0x60c3, 0x0014, 0x20e1,
+	0x0001, 0x2099, 0x1958, 0x20e9, 0x0000, 0x20a1, 0x0250, 0x20a9,
+	0x0004, 0x4003, 0x7023, 0x0004, 0x7027, 0x7878, 0x080c, 0x8f8f,
+	0x00de, 0x0005, 0x080c, 0x8aef, 0x700b, 0x0800, 0x7814, 0x9084,
+	0xff00, 0x700e, 0x7814, 0x9084, 0x00ff, 0x7022, 0x782c, 0x7026,
+	0x7858, 0x9084, 0x00ff, 0x9085, 0x0200, 0x7002, 0x7858, 0x9084,
+	0xff00, 0x8007, 0x7006, 0x60c2, 0x0804, 0x8f8f, 0x00b6, 0x00d6,
+	0x0016, 0x00d6, 0x2f68, 0x2009, 0x0035, 0x080c, 0xbc66, 0x00de,
+	0x1904, 0x95f3, 0x080c, 0x8aa4, 0x7003, 0x1300, 0x782c, 0x080c,
+	0x96f5, 0x2068, 0x6820, 0x9086, 0x0003, 0x0560, 0x7810, 0x2058,
+	0xbaa0, 0x080c, 0x9940, 0x11d8, 0x9286, 0x007e, 0x1128, 0x700b,
+	0x00ff, 0x700f, 0xfffe, 0x0498, 0x9286, 0x007f, 0x1128, 0x700b,
+	0x00ff, 0x700f, 0xfffd, 0x0458, 0x9284, 0xff80, 0x0180, 0x9286,
+	0x0080, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffc, 0x0400, 0x92d8,
+	0x1000, 0x2b5c, 0xb810, 0x700a, 0xb814, 0x700e, 0x00c0, 0x6098,
+	0x700e, 0x00a8, 0x080c, 0x9940, 0x1130, 0x7810, 0x2058, 0xb8a0,
+	0x9082, 0x007e, 0x0250, 0x00d6, 0x2069, 0x181d, 0x2d04, 0x700a,
+	0x8d68, 0x2d04, 0x700e, 0x00de, 0x0010, 0x6034, 0x700e, 0x7838,
+	0x7012, 0x783c, 0x7016, 0x60c3, 0x000c, 0x001e, 0x00de, 0x080c,
+	0x8f8f, 0x00be, 0x0005, 0x781b, 0x0001, 0x7803, 0x0006, 0x001e,
+	0x00de, 0x00be, 0x0005, 0x792c, 0x9180, 0x0008, 0x200c, 0x9186,
+	0x0006, 0x01c0, 0x9186, 0x0003, 0x0904, 0x966d, 0x9186, 0x0005,
+	0x0904, 0x9656, 0x9186, 0x0004, 0x05d8, 0x9186, 0x0008, 0x0904,
+	0x965e, 0x7807, 0x0037, 0x782f, 0x0003, 0x7817, 0x1700, 0x080c,
+	0x96d2, 0x0005, 0x080c, 0x9693, 0x00d6, 0x0026, 0x792c, 0x2168,
+	0x2009, 0x4000, 0x6800, 0x0002, 0x9637, 0x9642, 0x9639, 0x9642,
+	0x963e, 0x9637, 0x9637, 0x9642, 0x9642, 0x9642, 0x9642, 0x9637,
+	0x9637, 0x9637, 0x9637, 0x9637, 0x9642, 0x9637, 0x9642, 0x080c,
+	0x0db2, 0x6824, 0xd0e4, 0x0110, 0xd0cc, 0x0110, 0x900e, 0x0010,
+	0x2009, 0x2000, 0x682c, 0x7022, 0x6830, 0x7026, 0x0804, 0x968c,
+	0x080c, 0x9693, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000,
+	0x6a00, 0x9286, 0x0002, 0x1108, 0x900e, 0x04b0, 0x04e1, 0x00d6,
+	0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x0470, 0x04a1, 0x00d6,
+	0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x9286, 0x0005, 0x0118,
+	0x9286, 0x0002, 0x1108, 0x900e, 0x00f8, 0x0429, 0x00d6, 0x0026,
+	0x792c, 0x2168, 0x6814, 0x0096, 0x2048, 0xa9ac, 0xa834, 0x9112,
+	0xa9b0, 0xa838, 0x009e, 0x9103, 0x7022, 0x7226, 0x792c, 0x9180,
+	0x0000, 0x2004, 0x908e, 0x0002, 0x0130, 0x908e, 0x0004, 0x0118,
+	0x2009, 0x4000, 0x0008, 0x900e, 0x712a, 0x60c3, 0x0018, 0x002e,
+	0x00de, 0x0804, 0x8f8f, 0x00b6, 0x0036, 0x0046, 0x0056, 0x0066,
+	0x080c, 0x8aef, 0x9006, 0x7003, 0x0200, 0x7938, 0x710a, 0x793c,
+	0x710e, 0x7810, 0x2058, 0xb8a0, 0x080c, 0x9940, 0x1118, 0x9092,
+	0x007e, 0x0268, 0x00d6, 0x2069, 0x181d, 0x2d2c, 0x8d68, 0x2d34,
+	0x90d8, 0x1000, 0x2b5c, 0xbb10, 0xbc14, 0x00de, 0x0028, 0x901e,
+	0x6498, 0x2029, 0x0000, 0x6634, 0x782c, 0x9080, 0x0008, 0x2004,
+	0x9086, 0x0003, 0x1128, 0x7512, 0x7616, 0x731a, 0x741e, 0x0020,
+	0x7312, 0x7416, 0x751a, 0x761e, 0x006e, 0x005e, 0x004e, 0x003e,
+	0x00be, 0x0005, 0x080c, 0x8aef, 0x7003, 0x0100, 0x782c, 0x700a,
+	0x7814, 0x700e, 0x700e, 0x60c3, 0x0008, 0x0804, 0x8f8f, 0x080c,
+	0x8a9b, 0x7003, 0x1400, 0x7838, 0x700a, 0x0079, 0x783c, 0x700e,
+	0x782c, 0x7012, 0x7830, 0x7016, 0x7834, 0x9084, 0x00ff, 0x8007,
+	0x701a, 0x60c3, 0x0010, 0x0804, 0x8f8f, 0x00e6, 0x2071, 0x0240,
+	0x0006, 0x00f6, 0x2078, 0x7810, 0x00b6, 0x2058, 0xb8bc, 0xd084,
+	0x0120, 0x7848, 0x702a, 0x7844, 0x702e, 0x00be, 0x00fe, 0x000e,
+	0x00ee, 0x0005, 0x080c, 0x8ae6, 0x7003, 0x0100, 0x782c, 0x700a,
+	0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x8f8f, 0x0021, 0x60c3,
+	0x0000, 0x0804, 0x8f8f, 0x00d6, 0x080c, 0x97ce, 0xb810, 0x9085,
+	0x0300, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6874, 0x700a,
+	0x6878, 0x700e, 0x7013, 0x0819, 0x080c, 0x8f7d, 0x721a, 0x2f10,
+	0x7222, 0x7a08, 0x7226, 0x2071, 0x024c, 0x00de, 0x0005, 0x00a9,
+	0x7914, 0x712a, 0x60c3, 0x0000, 0x60a7, 0x9575, 0x0026, 0x080c,
+	0x283d, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e,
+	0x080c, 0x8fb2, 0x080c, 0x7cbe, 0x0005, 0x0036, 0x0096, 0x00d6,
+	0x00e6, 0x7858, 0x2048, 0xaa7c, 0x9296, 0x00c0, 0x9294, 0xfffd,
+	0xaa7e, 0xaa80, 0x9294, 0x0300, 0xaa82, 0xa96c, 0x9194, 0x00ff,
+	0xab74, 0x9384, 0x00ff, 0x908d, 0xc200, 0xa96e, 0x9384, 0xff00,
+	0x9215, 0xaa76, 0xa870, 0xaa78, 0xa87a, 0xaa72, 0x00d6, 0x2069,
+	0x0200, 0x080c, 0x97ce, 0x00de, 0x20e9, 0x0000, 0x20a1, 0x0240,
+	0x20a9, 0x000a, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098,
+	0x4003, 0x60a3, 0x0035, 0xaa68, 0x9294, 0x7000, 0x9286, 0x3000,
+	0x0110, 0x60a3, 0x0037, 0x00ee, 0x00de, 0x009e, 0x003e, 0x0005,
+	0x900e, 0x7814, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x01c0, 0x9084,
+	0x0003, 0x11a8, 0x2001, 0x180c, 0x2004, 0xd0bc, 0x0180, 0x7824,
+	0xd0cc, 0x1168, 0xd0c4, 0x1158, 0xa8a8, 0x9005, 0x1140, 0x2001,
+	0x180c, 0x200c, 0xc1d5, 0x2102, 0x2009, 0x1981, 0x210c, 0x009e,
+	0x918d, 0x0092, 0x0010, 0x2009, 0x0096, 0x60ab, 0x0036, 0x6116,
+	0x0005, 0x2009, 0x0009, 0x00a0, 0x2009, 0x000a, 0x0088, 0x2009,
+	0x000b, 0x0070, 0x2009, 0x000c, 0x0058, 0x2009, 0x000d, 0x0040,
+	0x2009, 0x000e, 0x0028, 0x2009, 0x000f, 0x0010, 0x2009, 0x0008,
+	0x6912, 0x0005, 0x00d6, 0x9290, 0x0018, 0x8214, 0x20e9, 0x0000,
+	0x2069, 0x0200, 0x6813, 0x0000, 0x22a8, 0x9284, 0x00e0, 0x0128,
+	0x20a9, 0x0020, 0x9292, 0x0020, 0x0008, 0x9016, 0x20a1, 0x0240,
+	0x9006, 0x4004, 0x82ff, 0x0120, 0x6810, 0x8000, 0x6812, 0x0c60,
+	0x00de, 0x0005, 0x00d6, 0x0096, 0x6014, 0x2048, 0xa878, 0x6056,
+	0x9006, 0xa836, 0xa83a, 0xa99c, 0xa946, 0xa84a, 0x6023, 0x0003,
+	0x6007, 0x0040, 0x6003, 0x0003, 0x600b, 0xffff, 0xa817, 0x0001,
+	0xa842, 0xa83e, 0x2900, 0xa85a, 0xa813, 0x1da0, 0x080c, 0x8065,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x865d, 0x012e, 0x009e, 0x00de,
+	0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00a6, 0x0096, 0x0066,
+	0x0126, 0x2091, 0x8000, 0x2071, 0x19b6, 0x760c, 0x2660, 0x2678,
+	0x8cff, 0x0904, 0x98a0, 0x7024, 0x9c06, 0x1520, 0x2069, 0x0100,
+	0x68c0, 0x9005, 0x0904, 0x9877, 0x080c, 0x8fbb, 0x68c3, 0x0000,
+	0x080c, 0x9469, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
+	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2987, 0x9006,
+	0x080c, 0x2987, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
+	0x0001, 0x003e, 0x700c, 0x9c36, 0x1110, 0x660c, 0x760e, 0x7008,
+	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x700a, 0x0010,
+	0x700b, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e,
+	0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0xb7e9, 0x1158, 0x080c,
+	0x2e55, 0x080c, 0xb7fa, 0x11f0, 0x080c, 0xa364, 0x00d8, 0x080c,
+	0x9469, 0x08c0, 0x080c, 0xb7fa, 0x1118, 0x080c, 0xa364, 0x0090,
+	0x6014, 0x2048, 0x080c, 0xb5f9, 0x0168, 0x6020, 0x9086, 0x0003,
+	0x1520, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6536,
+	0x080c, 0xb7dd, 0x080c, 0xba61, 0x080c, 0x9a06, 0x080c, 0x933f,
+	0x00ce, 0x0804, 0x9828, 0x2c78, 0x600c, 0x2060, 0x0804, 0x9828,
+	0x700f, 0x0000, 0x700b, 0x0000, 0x012e, 0x006e, 0x009e, 0x00ae,
+	0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086, 0x0006,
+	0x1d08, 0x080c, 0xcf91, 0x08f0, 0x00d6, 0x0156, 0x080c, 0x8aef,
+	0x7a14, 0x82ff, 0x0138, 0x7003, 0x0100, 0x700b, 0x0003, 0x60c3,
+	0x0008, 0x0490, 0x7003, 0x0200, 0x7007, 0x0000, 0x2069, 0x1800,
+	0x901e, 0x6800, 0x9086, 0x0004, 0x1110, 0xc38d, 0x0060, 0x080c,
+	0x6c53, 0x1110, 0xc3ad, 0x0008, 0xc3a5, 0x6ad4, 0xd29c, 0x1110,
+	0xd2ac, 0x0108, 0xc39d, 0x730e, 0x2011, 0x1848, 0x63f0, 0x2312,
+	0x20a9, 0x0006, 0x2011, 0x1840, 0x2019, 0x1841, 0x2071, 0x0250,
+	0x2376, 0x8e70, 0x2276, 0x8e70, 0x9398, 0x0002, 0x9290, 0x0002,
+	0x1f04, 0x98e8, 0x60c3, 0x0020, 0x080c, 0x8f8f, 0x015e, 0x00de,
+	0x0005, 0x0156, 0x080c, 0x8aef, 0x7a14, 0x82ff, 0x0168, 0x9286,
+	0xffff, 0x0118, 0x9282, 0x000e, 0x1238, 0x7003, 0x0100, 0x700b,
+	0x0003, 0x60c3, 0x0008, 0x0488, 0x7003, 0x0200, 0x7007, 0x001c,
+	0x700f, 0x0001, 0x2011, 0x198c, 0x2204, 0x8007, 0x701a, 0x8210,
+	0x2204, 0x8007, 0x701e, 0x0421, 0x1120, 0xb8a0, 0x9082, 0x007f,
+	0x0248, 0x2001, 0x181d, 0x2004, 0x7022, 0x2001, 0x181e, 0x2004,
+	0x7026, 0x0030, 0x2001, 0x1816, 0x2004, 0x9084, 0x00ff, 0x7026,
+	0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000,
+	0x20a1, 0x0256, 0x4003, 0x60c3, 0x001c, 0x015e, 0x0804, 0x8f8f,
+	0x0006, 0x2001, 0x1835, 0x2004, 0xd0ac, 0x000e, 0x0005, 0x2011,
+	0x0003, 0x080c, 0x92ec, 0x2011, 0x0002, 0x080c, 0x92f6, 0x080c,
+	0x91de, 0x0036, 0x901e, 0x080c, 0x9254, 0x003e, 0x0005, 0x080c,
+	0x2f8b, 0x0188, 0x0016, 0x00b6, 0x00c6, 0x7010, 0x9085, 0x0020,
+	0x7012, 0x2009, 0x007e, 0x080c, 0x5f7e, 0xb85c, 0xc0ac, 0xb85e,
+	0x00ce, 0x00be, 0x001e, 0x0005, 0x2071, 0x1883, 0x7000, 0x9005,
+	0x0140, 0x2001, 0x0976, 0x2071, 0x1800, 0x706e, 0x7072, 0x7063,
+	0xffe0, 0x2071, 0x1800, 0x706c, 0x704e, 0x7053, 0x1cd0, 0x0005,
+	0x00e6, 0x0126, 0x2071, 0x1800, 0x2091, 0x8000, 0x754c, 0x9582,
+	0x0010, 0x0608, 0x7050, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148,
+	0x9ce0, 0x0018, 0x7060, 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1cd0,
+	0x0c98, 0x6003, 0x0008, 0x8529, 0x754e, 0x9ca8, 0x0018, 0x7060,
+	0x9502, 0x1230, 0x7552, 0x9085, 0x0001, 0x012e, 0x00ee, 0x0005,
+	0x7053, 0x1cd0, 0x0cc0, 0x9006, 0x0cc0, 0x00e6, 0x2071, 0x1800,
+	0x754c, 0x9582, 0x0010, 0x0600, 0x7050, 0x2060, 0x6000, 0x9086,
+	0x0000, 0x0148, 0x9ce0, 0x0018, 0x7060, 0x9c02, 0x1208, 0x0cb0,
+	0x2061, 0x1cd0, 0x0c98, 0x6003, 0x0008, 0x8529, 0x754e, 0x9ca8,
+	0x0018, 0x7060, 0x9502, 0x1228, 0x7552, 0x9085, 0x0001, 0x00ee,
+	0x0005, 0x7053, 0x1cd0, 0x0cc8, 0x9006, 0x0cc8, 0x9c82, 0x1cd0,
+	0x0a0c, 0x0db2, 0x2001, 0x1818, 0x2004, 0x9c02, 0x1a0c, 0x0db2,
+	0x9006, 0x6006, 0x600a, 0x600e, 0x6016, 0x601a, 0x6012, 0x6023,
+	0x0000, 0x6003, 0x0000, 0x601e, 0x6056, 0x605a, 0x6026, 0x602a,
+	0x602e, 0x6032, 0x6036, 0x603a, 0x603e, 0x6042, 0x2061, 0x1800,
+	0x604c, 0x8000, 0x604e, 0x9086, 0x0001, 0x0108, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x8582, 0x012e, 0x0cc0, 0x0006, 0x6000,
+	0x9086, 0x0000, 0x01b0, 0x601c, 0xd084, 0x190c, 0x1827, 0x6017,
+	0x0000, 0x6023, 0x0007, 0x2001, 0x1955, 0x2004, 0x0006, 0x9082,
+	0x0051, 0x000e, 0x0208, 0x8004, 0x601a, 0x080c, 0xd240, 0x6043,
+	0x0000, 0x000e, 0x0005, 0x00e6, 0x0126, 0x2071, 0x1800, 0x2091,
+	0x8000, 0x754c, 0x9582, 0x0001, 0x0608, 0x7050, 0x2060, 0x6000,
+	0x9086, 0x0000, 0x0148, 0x9ce0, 0x0018, 0x7060, 0x9c02, 0x1208,
+	0x0cb0, 0x2061, 0x1cd0, 0x0c98, 0x6003, 0x0008, 0x8529, 0x754e,
+	0x9ca8, 0x0018, 0x7060, 0x9502, 0x1230, 0x7552, 0x9085, 0x0001,
+	0x012e, 0x00ee, 0x0005, 0x7053, 0x1cd0, 0x0cc0, 0x9006, 0x0cc0,
+	0x6020, 0x9084, 0x000f, 0x0002, 0x9a63, 0x9a6c, 0x9a87, 0x9aa2,
+	0xbd12, 0xbd2f, 0xbd4a, 0x9a63, 0x9a6c, 0x9a63, 0x9abe, 0x9a63,
+	0x9a63, 0x9a63, 0x9a63, 0x9186, 0x0013, 0x1128, 0x080c, 0x847d,
+	0x080c, 0x8582, 0x0005, 0x0005, 0x0066, 0x6000, 0x90b2, 0x0016,
+	0x1a0c, 0x0db2, 0x0013, 0x006e, 0x0005, 0x9a85, 0xa1dd, 0xa3ab,
+	0x9a85, 0xa439, 0x9d9f, 0x9a85, 0x9a85, 0xa15f, 0xa947, 0x9a85,
+	0x9a85, 0x9a85, 0x9a85, 0x9a85, 0x9a85, 0x080c, 0x0db2, 0x0066,
+	0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0db2, 0x0013, 0x006e, 0x0005,
+	0x9aa0, 0xb012, 0x9aa0, 0x9aa0, 0x9aa0, 0x9aa0, 0x9aa0, 0x9aa0,
+	0xafb7, 0xb194, 0x9aa0, 0xb053, 0xb0d2, 0xb053, 0xb0d2, 0x9aa0,
+	0x080c, 0x0db2, 0x6000, 0x9082, 0x0016, 0x1a0c, 0x0db2, 0x6000,
+	0x0002, 0x9abc, 0xa98e, 0xaa73, 0xaba3, 0xad45, 0x9abc, 0x9abc,
+	0x9abc, 0xa962, 0xaf43, 0xaf46, 0x9abc, 0x9abc, 0x9abc, 0x9abc,
+	0xaf75, 0x9abc, 0x9abc, 0x9abc, 0x080c, 0x0db2, 0x0066, 0x6000,
+	0x90b2, 0x0016, 0x1a0c, 0x0db2, 0x0013, 0x006e, 0x0005, 0x9ad7,
+	0x9ad7, 0x9b1a, 0x9bb8, 0x9c4c, 0x9ad7, 0x9ad7, 0x9ad7, 0x9ad9,
+	0x9ad7, 0x9ad7, 0x9ad7, 0x9ad7, 0x9ad7, 0x9ad7, 0x9ad7, 0x080c,
+	0x0db2, 0x9186, 0x004c, 0x0588, 0x9186, 0x0003, 0x190c, 0x0db2,
+	0x0096, 0x601c, 0xc0ed, 0x601e, 0x6003, 0x0003, 0x6106, 0x6014,
+	0x2048, 0xa87c, 0x9084, 0xa000, 0xc0b5, 0xa87e, 0xa8ac, 0xa846,
+	0xa8b0, 0xa84a, 0x9006, 0xa836, 0xa83a, 0xa884, 0x9092, 0x199a,
+	0x0210, 0x2001, 0x1999, 0x8003, 0x8013, 0x8213, 0x9210, 0x621a,
+	0x009e, 0x2c10, 0x080c, 0x1976, 0x080c, 0x8065, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x865d, 0x012e, 0x0005, 0x6010, 0x00b6, 0x2058,
+	0xbca0, 0x00be, 0x2c00, 0x080c, 0x9c6e, 0x080c, 0xbd04, 0x6003,
+	0x0007, 0x0005, 0x00d6, 0x0096, 0x00f6, 0x2079, 0x1800, 0x7a88,
+	0x6014, 0x2048, 0xa87c, 0xd0ec, 0x1110, 0x9290, 0x0018, 0xac78,
+	0x0046, 0xa8e0, 0x9005, 0x1140, 0xa8dc, 0x921a, 0x0140, 0x0220,
+	0xa87b, 0x0007, 0x2010, 0x0028, 0xa87b, 0x0015, 0x0010, 0xa87b,
+	0x0000, 0x8214, 0xa883, 0x0000, 0xaa02, 0x0006, 0x0016, 0x0026,
+	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2400, 0x9005, 0x1108, 0x009a,
+	0x2100, 0x9086, 0x0015, 0x1118, 0x2001, 0x0001, 0x0038, 0x2100,
+	0x9086, 0x0016, 0x0118, 0x2001, 0x0001, 0x002a, 0x94a4, 0x0007,
+	0x8423, 0x9405, 0x0002, 0x9b80, 0x9b80, 0x9b7b, 0x9b7e, 0x9b80,
+	0x9b78, 0x9b6b, 0x9b6b, 0x9b6b, 0x9b6b, 0x9b6b, 0x9b6b, 0x9b6b,
+	0x9b6b, 0x9b6b, 0x9b6b, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e,
+	0x001e, 0x000e, 0x004e, 0x00fe, 0x009e, 0x00de, 0x080c, 0x0db2,
+	0x080c, 0xa5d7, 0x0028, 0x080c, 0xa6b5, 0x0010, 0x080c, 0xa7a4,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e, 0x001e, 0x2c00, 0xa896,
+	0x000e, 0x080c, 0x9d2c, 0x0530, 0xa804, 0xa80e, 0x00a6, 0x2050,
+	0xb100, 0x00ae, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
+	0xffc0, 0x9080, 0x0002, 0xaacc, 0xabd0, 0xacd4, 0xadd8, 0x2031,
+	0x0000, 0x2041, 0x1226, 0x080c, 0x9ed6, 0x0160, 0x000e, 0x9005,
+	0x0120, 0x00fe, 0x009e, 0x00de, 0x0005, 0x00fe, 0x009e, 0x00de,
+	0x0804, 0x99d6, 0x2001, 0x002c, 0x900e, 0x080c, 0x9d92, 0x0c70,
+	0x91b6, 0x0015, 0x0170, 0x91b6, 0x0016, 0x0158, 0x91b2, 0x0047,
+	0x0a0c, 0x0db2, 0x91b2, 0x0050, 0x1a0c, 0x0db2, 0x9182, 0x0047,
+	0x00ca, 0x2001, 0x0109, 0x2004, 0xd08c, 0x0198, 0x0126, 0x2091,
+	0x2800, 0x0006, 0x0016, 0x0026, 0x080c, 0x7fb9, 0x002e, 0x001e,
+	0x000e, 0x012e, 0xa001, 0x6000, 0x9086, 0x0002, 0x1110, 0x0804,
+	0x9b1a, 0x0005, 0x9beb, 0x9beb, 0x9bed, 0x9c22, 0x9beb, 0x9beb,
+	0x9beb, 0x9beb, 0x9c35, 0x080c, 0x0db2, 0x00d6, 0x0016, 0x0096,
+	0x080c, 0x8532, 0x080c, 0x865d, 0x6003, 0x0004, 0x6114, 0x2148,
+	0xa87c, 0xd0fc, 0x01b8, 0xa878, 0x9005, 0x1158, 0xa894, 0x9005,
+	0x0140, 0x2001, 0x0000, 0x900e, 0x080c, 0x9d92, 0x080c, 0x99d6,
+	0x00a8, 0x6003, 0x0002, 0xa8a4, 0xa9a8, 0x9105, 0x1178, 0xa8ae,
+	0xa8b2, 0x0c78, 0xa87f, 0x0020, 0xa88c, 0xa88a, 0xa8a4, 0xa8ae,
+	0xa8a8, 0xa8b2, 0xa8c7, 0x0000, 0xa8cb, 0x0000, 0x009e, 0x001e,
+	0x00de, 0x0005, 0x080c, 0x8532, 0x00d6, 0x0096, 0x6114, 0x2148,
+	0x080c, 0xb5fb, 0x0120, 0xa87b, 0x0006, 0x080c, 0x6536, 0x009e,
+	0x00de, 0x080c, 0x99d6, 0x0804, 0x865d, 0x080c, 0x8532, 0x080c,
+	0x2e30, 0x080c, 0xbd01, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c,
+	0xb5fb, 0x0120, 0xa87b, 0x0029, 0x080c, 0x6536, 0x009e, 0x00de,
+	0x080c, 0x99d6, 0x0804, 0x865d, 0x9182, 0x0047, 0x0002, 0x9c5c,
+	0x9c5e, 0x9c5c, 0x9c5c, 0x9c5c, 0x9c5c, 0x9c5c, 0x9c5c, 0x9c5c,
+	0x9c5c, 0x9c5c, 0x9c5c, 0x9c5e, 0x080c, 0x0db2, 0x00d6, 0x0096,
+	0x080c, 0x14c9, 0x6114, 0x2148, 0xa87b, 0x0000, 0xa883, 0x0000,
+	0x080c, 0x6536, 0x009e, 0x00de, 0x0804, 0x99d6, 0x0026, 0x0036,
+	0x0056, 0x0066, 0x0096, 0x00a6, 0x00f6, 0x0006, 0x080c, 0x0fd5,
+	0x000e, 0x090c, 0x0db2, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019,
+	0x21a0, 0x900e, 0x20a9, 0x0020, 0x4104, 0xa87a, 0x2079, 0x1800,
+	0x7988, 0x9188, 0x0018, 0x918c, 0x0fff, 0xa972, 0xac76, 0x2950,
+	0x00a6, 0x2001, 0x0205, 0x2003, 0x0000, 0x901e, 0x2029, 0x0001,
+	0x9182, 0x0034, 0x1228, 0x2011, 0x001f, 0x080c, 0xb219, 0x04c0,
+	0x2130, 0x2009, 0x0034, 0x2011, 0x001f, 0x080c, 0xb219, 0x96b2,
+	0x0034, 0xb004, 0x904d, 0x0110, 0x080c, 0x0f87, 0x080c, 0x0fd5,
+	0x01d0, 0x8528, 0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406,
+	0x968a, 0x003d, 0x1230, 0x2608, 0x2011, 0x001b, 0x080c, 0xb219,
+	0x00b8, 0x96b2, 0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b,
+	0x080c, 0xb219, 0x0c18, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae,
+	0x852f, 0x95ad, 0x0050, 0xb566, 0xb070, 0xc0fd, 0xb072, 0x0048,
+	0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0050,
+	0xb566, 0x2a48, 0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x6536,
+	0x000e, 0x2048, 0x9005, 0x1db0, 0x00fe, 0x00ae, 0x009e, 0x006e,
+	0x005e, 0x003e, 0x002e, 0x0005, 0x00d6, 0x00f6, 0x0096, 0x0006,
+	0x080c, 0x0fd5, 0x000e, 0x090c, 0x0db2, 0xa960, 0x21e8, 0xa95c,
+	0x9188, 0x0019, 0x21a0, 0x900e, 0x20a9, 0x0020, 0x4104, 0xaa66,
+	0xa87a, 0x2079, 0x1800, 0x7988, 0x810c, 0x9188, 0x000c, 0x9182,
+	0x001a, 0x0210, 0x2009, 0x001a, 0x21a8, 0x810b, 0xa972, 0xac76,
+	0x2e98, 0xa85c, 0x9080, 0x001f, 0x20a0, 0x2001, 0x0205, 0x200c,
+	0x918d, 0x0080, 0x2102, 0x4003, 0x2003, 0x0000, 0x080c, 0x6536,
+	0x009e, 0x00fe, 0x00de, 0x0005, 0x0016, 0x00d6, 0x00f6, 0x0096,
+	0x0016, 0x2001, 0x0205, 0x200c, 0x918d, 0x0080, 0x2102, 0x001e,
+	0x2079, 0x0200, 0x2e98, 0xa87c, 0xd0ec, 0x0118, 0x9e80, 0x000c,
+	0x2098, 0x2021, 0x003e, 0x901e, 0x9282, 0x0020, 0x0218, 0x2011,
+	0x0020, 0x2018, 0x9486, 0x003e, 0x1170, 0x0096, 0x080c, 0x0fd5,
+	0x2900, 0x009e, 0x05c0, 0xa806, 0x2048, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0002, 0x20a0, 0x3300, 0x908e, 0x0260, 0x0140, 0x2009,
+	0x0280, 0x9102, 0x920a, 0x0218, 0x2010, 0x2100, 0x9318, 0x2200,
+	0x9402, 0x1228, 0x2400, 0x9202, 0x2410, 0x9318, 0x9006, 0x2020,
+	0x22a8, 0xa800, 0x9200, 0xa802, 0x20e1, 0x0000, 0x4003, 0x83ff,
+	0x0180, 0x3300, 0x9086, 0x0280, 0x1130, 0x7814, 0x8000, 0x9085,
+	0x0080, 0x7816, 0x2e98, 0x2310, 0x84ff, 0x0904, 0x9d41, 0x0804,
+	0x9d43, 0x9085, 0x0001, 0x7817, 0x0000, 0x009e, 0x00fe, 0x00de,
+	0x001e, 0x0005, 0x00d6, 0x0036, 0x0096, 0x6314, 0x2348, 0xa87a,
+	0xa982, 0x080c, 0x6529, 0x009e, 0x003e, 0x00de, 0x0005, 0x91b6,
+	0x0015, 0x1118, 0x080c, 0x99d6, 0x0030, 0x91b6, 0x0016, 0x190c,
+	0x0db2, 0x080c, 0x99d6, 0x0005, 0x20a9, 0x000e, 0x20e1, 0x0000,
+	0x2e98, 0x6014, 0x0096, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x20a0,
+	0x009e, 0x4003, 0x0136, 0x9080, 0x001b, 0x2011, 0x0006, 0x20a9,
+	0x0001, 0x3418, 0x8318, 0x23a0, 0x4003, 0x3318, 0x8318, 0x2398,
+	0x8211, 0x1db8, 0x2011, 0x0006, 0x013e, 0x20a0, 0x3318, 0x8318,
+	0x2398, 0x4003, 0x3418, 0x8318, 0x23a0, 0x8211, 0x1db8, 0x0096,
+	0x080c, 0xb5fb, 0x0130, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867,
+	0x0103, 0x009e, 0x0804, 0x99d6, 0x0096, 0x00d6, 0x0036, 0x7330,
+	0x9386, 0x0200, 0x11a8, 0x6010, 0x00b6, 0x2058, 0xb8bf, 0x0000,
+	0x00be, 0x6014, 0x9005, 0x0130, 0x2048, 0xa807, 0x0000, 0xa867,
+	0x0103, 0xab32, 0x080c, 0x99d6, 0x003e, 0x00de, 0x009e, 0x0005,
+	0x0011, 0x1d48, 0x0cc8, 0x0006, 0x0016, 0x080c, 0xbcec, 0x0188,
+	0x6014, 0x9005, 0x1170, 0x600b, 0x0003, 0x601b, 0x0000, 0x6043,
+	0x0000, 0x2009, 0x0022, 0x080c, 0xa1b5, 0x9006, 0x001e, 0x000e,
+	0x0005, 0x9085, 0x0001, 0x0cd0, 0x0096, 0x0016, 0x20a9, 0x0014,
+	0x9e80, 0x000c, 0x20e1, 0x0000, 0x2098, 0x6014, 0x2048, 0xa860,
+	0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x2001, 0x0205,
+	0x2003, 0x0001, 0x2099, 0x0260, 0x20a9, 0x0016, 0x4003, 0x20a9,
+	0x000a, 0xa804, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002,
+	0x20a0, 0x4003, 0x2001, 0x0205, 0x2003, 0x0002, 0x2099, 0x0260,
+	0x20a9, 0x0020, 0x4003, 0x2003, 0x0000, 0x6014, 0x2048, 0xa800,
+	0x2048, 0xa867, 0x0103, 0x080c, 0x99d6, 0x001e, 0x009e, 0x0005,
+	0x0096, 0x0016, 0x900e, 0x7030, 0x9086, 0x0100, 0x0140, 0x7038,
+	0x9084, 0x00ff, 0x800c, 0x703c, 0x9084, 0x00ff, 0x8004, 0x9080,
+	0x0004, 0x9108, 0x810b, 0x2011, 0x0002, 0x2019, 0x000c, 0x6014,
+	0x2048, 0x080c, 0xb219, 0x080c, 0xb5fb, 0x0140, 0x6014, 0x2048,
+	0xa807, 0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0x99d6,
+	0x001e, 0x009e, 0x0005, 0x0016, 0x0096, 0x7030, 0x9086, 0x0100,
+	0x1118, 0x2009, 0x0004, 0x0010, 0x7034, 0x800c, 0x810b, 0x2011,
+	0x000c, 0x2019, 0x000c, 0x6014, 0x2048, 0xa804, 0x0096, 0x9005,
+	0x0108, 0x2048, 0x080c, 0xb219, 0x009e, 0x080c, 0xb5fb, 0x0148,
+	0xa804, 0x9005, 0x1158, 0xa807, 0x0000, 0xa864, 0xa8e2, 0xa867,
+	0x0103, 0x080c, 0x99d6, 0x009e, 0x001e, 0x0005, 0x0086, 0x2040,
+	0xa030, 0x8007, 0x9086, 0x0100, 0x1118, 0x080c, 0xa364, 0x00e0,
+	0xa034, 0x8007, 0x800c, 0x8806, 0x8006, 0x8007, 0x90bc, 0x003f,
+	0x9084, 0xffc0, 0x9080, 0x000c, 0xa87b, 0x0000, 0xa883, 0x0000,
+	0xa897, 0x4000, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000,
+	0x2041, 0x120c, 0x0019, 0x0d08, 0x008e, 0x0898, 0x0096, 0x0006,
+	0x080c, 0x0fd5, 0x000e, 0x01b0, 0xa8ab, 0x0dcb, 0xa876, 0x000e,
+	0xa8a2, 0x0006, 0xae6a, 0x2800, 0xa89e, 0xa97a, 0xaf72, 0xaa8e,
+	0xab92, 0xac96, 0xad9a, 0x0086, 0x2940, 0x080c, 0x10b5, 0x008e,
+	0x9085, 0x0001, 0x009e, 0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008,
+	0x9084, 0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10, 0x00be, 0x9206,
+	0x1520, 0x700c, 0x6210, 0x00b6, 0x2258, 0xba14, 0x00be, 0x9206,
+	0x11e0, 0x6043, 0x0000, 0x2c68, 0x0016, 0x2009, 0x0035, 0x080c,
+	0xbc66, 0x001e, 0x1158, 0x622c, 0x2268, 0x2071, 0x026c, 0x6b20,
+	0x9386, 0x0003, 0x0130, 0x9386, 0x0006, 0x0128, 0x080c, 0x99d6,
+	0x0020, 0x0039, 0x0010, 0x080c, 0x9fe8, 0x002e, 0x00de, 0x00ee,
+	0x0005, 0x0096, 0x6814, 0x2048, 0x9186, 0x0015, 0x0904, 0x9fd0,
+	0x918e, 0x0016, 0x1904, 0x9fe6, 0x700c, 0x908c, 0xff00, 0x9186,
+	0x1700, 0x0120, 0x9186, 0x0300, 0x1904, 0x9faa, 0x89ff, 0x1138,
+	0x6800, 0x9086, 0x000f, 0x0904, 0x9f8d, 0x0804, 0x9fe4, 0x6808,
+	0x9086, 0xffff, 0x1904, 0x9fd2, 0xa87c, 0x9084, 0x0060, 0x9086,
+	0x0020, 0x1128, 0xa83c, 0xa940, 0x9105, 0x1904, 0x9fd2, 0x6824,
+	0xd0b4, 0x1904, 0x9fd2, 0x080c, 0xb7dd, 0x685c, 0xa882, 0xa87c,
+	0xc0dc, 0xc0f4, 0xc0d4, 0xa87e, 0x0026, 0x900e, 0x6a18, 0x2001,
+	0x000a, 0x080c, 0x7e7f, 0xa884, 0x920a, 0x0208, 0x8011, 0xaa86,
+	0x82ff, 0x002e, 0x1138, 0x00c6, 0x2d60, 0x080c, 0xb33a, 0x00ce,
+	0x0804, 0x9fe4, 0x00c6, 0xa868, 0xd0fc, 0x1118, 0x080c, 0x5a9d,
+	0x0010, 0x080c, 0x5e34, 0x00ce, 0x1904, 0x9fd2, 0x00c6, 0x2d60,
+	0x080c, 0x99d6, 0x00ce, 0x0804, 0x9fe4, 0x00c6, 0x080c, 0x9a23,
+	0x0198, 0x6017, 0x0000, 0x6810, 0x6012, 0x080c, 0xba69, 0x6023,
+	0x0003, 0x6904, 0x00c6, 0x2d60, 0x080c, 0x99d6, 0x00ce, 0x080c,
+	0x9a50, 0x00ce, 0x0804, 0x9fe4, 0x2001, 0x1957, 0x2004, 0x6842,
+	0x00ce, 0x04d0, 0x7008, 0x9086, 0x000b, 0x11c8, 0x6010, 0x00b6,
+	0x2058, 0xb900, 0xc1bc, 0xb902, 0x00be, 0x00c6, 0x2d60, 0xa883,
+	0x0003, 0x080c, 0xbca8, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023,
+	0x0002, 0x080c, 0x8000, 0x080c, 0x8582, 0x00ce, 0x00e8, 0x700c,
+	0x9086, 0x2a00, 0x1138, 0x2001, 0x1957, 0x2004, 0x6842, 0x00a0,
+	0x0479, 0x00a0, 0x89ff, 0x090c, 0x0db2, 0x00c6, 0x00d6, 0x2d60,
+	0xa867, 0x0103, 0xa87b, 0x0003, 0x080c, 0x6351, 0x080c, 0xb7dd,
+	0x080c, 0x9a06, 0x00de, 0x00ce, 0x080c, 0x99d6, 0x009e, 0x0005,
+	0x9186, 0x0015, 0x1128, 0x2001, 0x1957, 0x2004, 0x6842, 0x0068,
+	0x918e, 0x0016, 0x1160, 0x00c6, 0x2d00, 0x2060, 0x080c, 0xd240,
+	0x080c, 0x7e13, 0x080c, 0x99d6, 0x00ce, 0x080c, 0x99d6, 0x0005,
+	0x0026, 0x0036, 0x0046, 0x7228, 0xacb0, 0xabac, 0xd2f4, 0x0130,
+	0x2001, 0x1957, 0x2004, 0x6842, 0x0804, 0xa064, 0x00c6, 0x2d60,
+	0x080c, 0xb244, 0x00ce, 0x6804, 0x9086, 0x0050, 0x1170, 0x00c6,
+	0x2d00, 0x2060, 0x6003, 0x0001, 0x6007, 0x0050, 0x080c, 0x8000,
+	0x080c, 0x8582, 0x00ce, 0x0804, 0xa064, 0x6800, 0x9086, 0x000f,
+	0x01b0, 0x89ff, 0x090c, 0x0db2, 0x6800, 0x9086, 0x0004, 0x1198,
+	0xa87c, 0xd0ac, 0x0180, 0xa843, 0x0fff, 0xa83f, 0x0fff, 0xa880,
+	0xc0f4, 0xc0fc, 0xa882, 0x2001, 0x0001, 0x6832, 0x0400, 0x2001,
+	0x0007, 0x6832, 0x00e0, 0xa87c, 0xd0b4, 0x1150, 0xd0ac, 0x0db8,
+	0x6824, 0xd0f4, 0x1d40, 0xa838, 0xa934, 0x9105, 0x0d80, 0x0c18,
+	0xd2ec, 0x1d68, 0x7024, 0x9306, 0x1118, 0x7020, 0x9406, 0x0d38,
+	0x7020, 0x683e, 0x7024, 0x683a, 0x2001, 0x0005, 0x6832, 0x080c,
+	0xb960, 0x080c, 0x8582, 0x0010, 0x080c, 0x99d6, 0x004e, 0x003e,
+	0x002e, 0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff,
+	0x6210, 0x00b6, 0x2258, 0xba10, 0x00be, 0x9206, 0x1904, 0xa0cf,
+	0x700c, 0x6210, 0x00b6, 0x2258, 0xba14, 0x00be, 0x9206, 0x1904,
+	0xa0cf, 0x6038, 0x2068, 0x6824, 0xc0dc, 0x6826, 0x6a20, 0x9286,
+	0x0007, 0x0904, 0xa0cf, 0x9286, 0x0002, 0x0904, 0xa0cf, 0x9286,
+	0x0000, 0x05e8, 0x6808, 0x633c, 0x9306, 0x15c8, 0x2071, 0x026c,
+	0x9186, 0x0015, 0x0570, 0x918e, 0x0016, 0x1100, 0x00c6, 0x6038,
+	0x2060, 0x6104, 0x9186, 0x004b, 0x01c0, 0x9186, 0x004c, 0x01a8,
+	0x9186, 0x004d, 0x0190, 0x9186, 0x004e, 0x0178, 0x9186, 0x0052,
+	0x0160, 0x6014, 0x0096, 0x2048, 0x080c, 0xb5fb, 0x090c, 0x0db2,
+	0xa883, 0x0003, 0x009e, 0x080c, 0xbca8, 0x6007, 0x0085, 0x6003,
+	0x000b, 0x6023, 0x0002, 0x080c, 0x8000, 0x080c, 0x8582, 0x00ce,
+	0x0030, 0x6038, 0x2070, 0x2001, 0x1957, 0x2004, 0x7042, 0x080c,
+	0x99d6, 0x002e, 0x00de, 0x00ee, 0x0005, 0x00b6, 0x0096, 0x00f6,
+	0x6014, 0x2048, 0x6010, 0x2058, 0x91b6, 0x0015, 0x0130, 0xba08,
+	0xbb0c, 0xbc00, 0xc48c, 0xbc02, 0x0460, 0x0096, 0x0156, 0x0036,
+	0x0026, 0x2b48, 0x9e90, 0x0010, 0x2019, 0x000a, 0x20a9, 0x0004,
+	0x080c, 0xa91d, 0x002e, 0x003e, 0x015e, 0x009e, 0x1904, 0xa13e,
+	0x0096, 0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90, 0x0014, 0x2019,
+	0x0006, 0x20a9, 0x0004, 0x080c, 0xa91d, 0x002e, 0x003e, 0x015e,
+	0x009e, 0x15a0, 0x7238, 0xba0a, 0x733c, 0xbb0e, 0xbc00, 0xc48d,
+	0xbc02, 0xa804, 0x9005, 0x1128, 0x00fe, 0x009e, 0x00be, 0x0804,
+	0x9dd7, 0x0096, 0x2048, 0xaa12, 0xab16, 0xac0a, 0x009e, 0x8006,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002,
+	0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000,
+	0x2041, 0x120c, 0x080c, 0x9ed6, 0x0130, 0x00fe, 0x009e, 0x080c,
+	0x99d6, 0x00be, 0x0005, 0x080c, 0xa364, 0x0cb8, 0x2b78, 0x00f6,
+	0x080c, 0x2e30, 0x080c, 0xbd01, 0x00fe, 0x00c6, 0x080c, 0x9980,
+	0x2f00, 0x6012, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001,
+	0x6003, 0x0001, 0x2001, 0x0007, 0x080c, 0x5ecf, 0x080c, 0x5efb,
+	0x080c, 0x8048, 0x080c, 0x8582, 0x00ce, 0x0804, 0xa111, 0x2100,
+	0x91b2, 0x0053, 0x1a0c, 0x0db2, 0x91b2, 0x0040, 0x1a04, 0xa1c7,
+	0x0002, 0xa1b5, 0xa1b5, 0xa1ab, 0xa1b5, 0xa1b5, 0xa1b5, 0xa1a9,
+	0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9,
+	0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9,
+	0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9,
+	0xa1b5, 0xa1a9, 0xa1b5, 0xa1b5, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9,
+	0xa1a9, 0xa1ab, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9,
+	0xa1a9, 0xa1a9, 0xa1a9, 0xa1b5, 0xa1b5, 0xa1a9, 0xa1a9, 0xa1a9,
+	0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1a9, 0xa1b5, 0xa1a9,
+	0xa1a9, 0x080c, 0x0db2, 0x0066, 0x00b6, 0x6610, 0x2658, 0xb8bc,
+	0xc08c, 0xb8be, 0x00be, 0x006e, 0x0000, 0x6003, 0x0001, 0x6106,
+	0x9186, 0x0032, 0x0118, 0x080c, 0x8048, 0x0010, 0x080c, 0x8000,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x8582, 0x012e, 0x0005, 0x2600,
+	0x0002, 0xa1db, 0xa1db, 0xa1db, 0xa1b5, 0xa1b5, 0xa1db, 0xa1db,
+	0xa1db, 0xa1db, 0xa1b5, 0xa1db, 0xa1b5, 0xa1db, 0xa1b5, 0xa1db,
+	0xa1db, 0xa1db, 0xa1db, 0x080c, 0x0db2, 0x6004, 0x90b2, 0x0053,
+	0x1a0c, 0x0db2, 0x91b6, 0x0013, 0x0904, 0xa29f, 0x91b6, 0x0027,
+	0x1904, 0xa25a, 0x080c, 0x847d, 0x6004, 0x080c, 0xb7e9, 0x01b0,
+	0x080c, 0xb7fa, 0x01a8, 0x908e, 0x0021, 0x0904, 0xa257, 0x908e,
+	0x0022, 0x1130, 0x080c, 0x9e03, 0x0904, 0xa253, 0x0804, 0xa254,
+	0x908e, 0x003d, 0x0904, 0xa257, 0x0804, 0xa24d, 0x080c, 0x2e55,
+	0x2001, 0x0007, 0x080c, 0x5ecf, 0x6010, 0x00b6, 0x2058, 0xb9a0,
+	0x00be, 0x080c, 0xa364, 0x9186, 0x007e, 0x1148, 0x2001, 0x1835,
+	0x2014, 0xc285, 0x080c, 0x6c53, 0x1108, 0xc2ad, 0x2202, 0x0036,
+	0x0026, 0x2019, 0x0028, 0x2110, 0x080c, 0xd29b, 0x002e, 0x003e,
+	0x0016, 0x0026, 0x0036, 0x2110, 0x2019, 0x0028, 0x080c, 0x8180,
+	0x0076, 0x903e, 0x080c, 0x8078, 0x6010, 0x00b6, 0x905d, 0x0100,
+	0x00be, 0x2c08, 0x080c, 0xcd62, 0x007e, 0x003e, 0x002e, 0x001e,
+	0x080c, 0xbd01, 0x0016, 0x080c, 0xba61, 0x080c, 0x99d6, 0x001e,
+	0x080c, 0x2f28, 0x080c, 0x8582, 0x0030, 0x080c, 0xba61, 0x080c,
+	0x99d6, 0x080c, 0x8582, 0x0005, 0x080c, 0xa364, 0x0cb0, 0x080c,
+	0xa3a0, 0x0c98, 0x9186, 0x0014, 0x1db0, 0x080c, 0x847d, 0x6004,
+	0x908e, 0x0022, 0x1118, 0x080c, 0x9e03, 0x0d68, 0x080c, 0x2e30,
+	0x080c, 0xbd01, 0x080c, 0xb7e9, 0x1190, 0x080c, 0x2e55, 0x6010,
+	0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xa364, 0x9186, 0x007e,
+	0x1128, 0x2001, 0x1835, 0x200c, 0xc185, 0x2102, 0x0870, 0x080c,
+	0xb7fa, 0x1118, 0x080c, 0xa364, 0x0840, 0x6004, 0x908e, 0x0032,
+	0x1160, 0x00e6, 0x00f6, 0x2071, 0x1894, 0x2079, 0x0000, 0x080c,
+	0x31c3, 0x00fe, 0x00ee, 0x0804, 0xa24d, 0x6004, 0x908e, 0x0021,
+	0x0d48, 0x908e, 0x0022, 0x090c, 0xa364, 0x0804, 0xa24d, 0x90b2,
+	0x0040, 0x1a04, 0xa34d, 0x2008, 0x0002, 0xa2e7, 0xa2e8, 0xa2eb,
+	0xa2ee, 0xa2f1, 0xa2f4, 0xa2e5, 0xa2e5, 0xa2e5, 0xa2e5, 0xa2e5,
+	0xa2e5, 0xa2e5, 0xa2e5, 0xa2e5, 0xa2e5, 0xa2e5, 0xa2e5, 0xa2e5,
+	0xa2e5, 0xa2e5, 0xa2e5, 0xa2e5, 0xa2e5, 0xa2e5, 0xa2e5, 0xa2e5,
+	0xa2e5, 0xa2e5, 0xa2e5, 0xa2f7, 0xa302, 0xa2e5, 0xa304, 0xa302,
+	0xa2e5, 0xa2e5, 0xa2e5, 0xa2e5, 0xa2e5, 0xa302, 0xa302, 0xa2e5,
+	0xa2e5, 0xa2e5, 0xa2e5, 0xa2e5, 0xa2e5, 0xa2e5, 0xa2e5, 0xa334,
+	0xa302, 0xa2e5, 0xa2fe, 0xa2e5, 0xa2e5, 0xa2e5, 0xa2ff, 0xa2e5,
+	0xa2e5, 0xa2e5, 0xa302, 0xa32b, 0xa2e5, 0x080c, 0x0db2, 0x00d0,
+	0x2001, 0x000b, 0x0410, 0x2001, 0x0003, 0x00f8, 0x2001, 0x0005,
+	0x00e0, 0x2001, 0x0001, 0x00c8, 0x2001, 0x0009, 0x00b0, 0x080c,
+	0x847d, 0x6003, 0x0005, 0x080c, 0x8582, 0x0070, 0x0018, 0x0010,
+	0x080c, 0x5ecf, 0x0804, 0xa345, 0x080c, 0x847d, 0x080c, 0xbd04,
+	0x6003, 0x0004, 0x080c, 0x8582, 0x0005, 0x080c, 0x5ecf, 0x080c,
+	0x847d, 0x6003, 0x0002, 0x0036, 0x2019, 0x185e, 0x2304, 0x9084,
+	0xff00, 0x1120, 0x2001, 0x1955, 0x201c, 0x0040, 0x8007, 0x909a,
+	0x0004, 0x0ec0, 0x8003, 0x801b, 0x831b, 0x9318, 0x631a, 0x003e,
+	0x080c, 0x8582, 0x0c08, 0x080c, 0x847d, 0x080c, 0xba61, 0x080c,
+	0x99d6, 0x080c, 0x8582, 0x08c0, 0x00e6, 0x00f6, 0x2071, 0x1894,
+	0x2079, 0x0000, 0x080c, 0x31c3, 0x00fe, 0x00ee, 0x080c, 0x847d,
+	0x080c, 0x99d6, 0x080c, 0x8582, 0x0838, 0x080c, 0x847d, 0x6003,
+	0x0002, 0x080c, 0xbd04, 0x0804, 0x8582, 0x2600, 0x2008, 0x0002,
+	0xa362, 0xa362, 0xa362, 0xa345, 0xa345, 0xa362, 0xa362, 0xa362,
+	0xa362, 0xa345, 0xa362, 0xa345, 0xa362, 0xa345, 0xa362, 0xa362,
+	0xa362, 0xa362, 0x080c, 0x0db2, 0x00e6, 0x0096, 0x0026, 0x0016,
+	0x080c, 0xb5fb, 0x0568, 0x6014, 0x2048, 0xa864, 0x9086, 0x0139,
+	0x11a8, 0xa894, 0x9086, 0x0056, 0x1148, 0x080c, 0x4ebc, 0x0130,
+	0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x0028, 0x2001, 0x0030,
+	0x900e, 0x2011, 0x4005, 0x080c, 0xbbcd, 0x0090, 0xa868, 0xd0fc,
+	0x0178, 0xa807, 0x0000, 0x0016, 0x6004, 0x908e, 0x0021, 0x0168,
+	0x908e, 0x003d, 0x0150, 0x001e, 0xa867, 0x0103, 0xa833, 0x0100,
+	0x001e, 0x002e, 0x009e, 0x00ee, 0x0005, 0x001e, 0x0009, 0x0cc0,
+	0x0096, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867, 0x0103, 0xa823,
+	0x8001, 0x009e, 0x0005, 0x00b6, 0x6610, 0x2658, 0xb804, 0x9084,
+	0x00ff, 0x90b2, 0x000c, 0x1a0c, 0x0db2, 0x6604, 0x96b6, 0x004d,
+	0x1120, 0x080c, 0xbaed, 0x0804, 0xa428, 0x6604, 0x96b6, 0x0043,
+	0x1120, 0x080c, 0xbb36, 0x0804, 0xa428, 0x6604, 0x96b6, 0x004b,
+	0x1120, 0x080c, 0xbb62, 0x0804, 0xa428, 0x6604, 0x96b6, 0x0033,
+	0x1120, 0x080c, 0xba83, 0x0804, 0xa428, 0x6604, 0x96b6, 0x0028,
+	0x1120, 0x080c, 0xb833, 0x0804, 0xa428, 0x6604, 0x96b6, 0x0029,
+	0x1120, 0x080c, 0xb874, 0x0804, 0xa428, 0x6604, 0x96b6, 0x001f,
+	0x1118, 0x080c, 0x9dac, 0x04e0, 0x6604, 0x96b6, 0x0000, 0x1118,
+	0x080c, 0xa0d5, 0x04a8, 0x6604, 0x96b6, 0x0022, 0x1118, 0x080c,
+	0x9de4, 0x0470, 0x6604, 0x96b6, 0x0035, 0x1118, 0x080c, 0x9ef4,
+	0x0438, 0x6604, 0x96b6, 0x0039, 0x1118, 0x080c, 0xa06a, 0x0400,
+	0x6604, 0x96b6, 0x003d, 0x1118, 0x080c, 0x9e1c, 0x00c8, 0x6604,
+	0x96b6, 0x0044, 0x1118, 0x080c, 0x9e58, 0x0090, 0x6604, 0x96b6,
+	0x0049, 0x1118, 0x080c, 0x9e83, 0x0058, 0x91b6, 0x0015, 0x1110,
+	0x0063, 0x0030, 0x91b6, 0x0016, 0x1128, 0x00be, 0x0804, 0xa65e,
+	0x00be, 0x0005, 0x080c, 0x9a6b, 0x0cd8, 0xa445, 0xa448, 0xa445,
+	0xa48d, 0xa445, 0xa5d7, 0xa66b, 0xa445, 0xa445, 0xa638, 0xa445,
+	0xa64c, 0x0096, 0x080c, 0x14c9, 0x6014, 0x2048, 0xa800, 0x2048,
+	0xa867, 0x0103, 0x009e, 0x0804, 0x99d6, 0xa001, 0xa001, 0x0005,
+	0x00e6, 0x2071, 0x1800, 0x7088, 0x9086, 0x0074, 0x1540, 0x080c,
+	0xcd33, 0x11b0, 0x6010, 0x00b6, 0x2058, 0x7030, 0xd08c, 0x0128,
+	0xb800, 0xd0bc, 0x0110, 0xc0c5, 0xb802, 0x00e9, 0x00be, 0x2001,
+	0x0006, 0x080c, 0x5ecf, 0x080c, 0x2e55, 0x080c, 0x99d6, 0x0088,
+	0x2001, 0x000a, 0x080c, 0x5ecf, 0x080c, 0x2e55, 0x6003, 0x0001,
+	0x6007, 0x0001, 0x080c, 0x8048, 0x080c, 0x8582, 0x0010, 0x080c,
+	0xa5c2, 0x00ee, 0x0005, 0x00d6, 0xb800, 0xd084, 0x0160, 0x9006,
+	0x080c, 0x5ebb, 0x2069, 0x1853, 0x6804, 0xd0a4, 0x0120, 0x2001,
+	0x0006, 0x080c, 0x5efb, 0x00de, 0x0005, 0x00b6, 0x0096, 0x00d6,
+	0x2011, 0x1822, 0x2204, 0x9086, 0x0074, 0x1904, 0xa59b, 0x6010,
+	0x2058, 0xbaa0, 0x9286, 0x007e, 0x1120, 0x080c, 0xa7af, 0x0804,
+	0xa4ff, 0x080c, 0xa7a4, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x0080,
+	0x1510, 0x6014, 0x9005, 0x01a8, 0x2048, 0xa864, 0x9084, 0x00ff,
+	0x9086, 0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000,
+	0x080c, 0xbbcd, 0x0030, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833,
+	0x0200, 0x2001, 0x0006, 0x080c, 0x5ecf, 0x080c, 0x2e55, 0x080c,
+	0x99d6, 0x0804, 0xa59c, 0x080c, 0xa5aa, 0x6014, 0x9005, 0x0190,
+	0x2048, 0xa868, 0xd0f4, 0x01e8, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x0039, 0x1d08, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c,
+	0xbbcd, 0x08f8, 0x080c, 0xa5a0, 0x0160, 0x9006, 0x080c, 0x5ebb,
+	0x2001, 0x0004, 0x080c, 0x5efb, 0x2001, 0x0007, 0x080c, 0x5ecf,
+	0x08a0, 0x2001, 0x0004, 0x080c, 0x5ecf, 0x6003, 0x0001, 0x6007,
+	0x0003, 0x080c, 0x8048, 0x080c, 0x8582, 0x0804, 0xa59c, 0xb85c,
+	0xd0e4, 0x01d8, 0x080c, 0xba03, 0x080c, 0x6c53, 0x0118, 0xd0dc,
+	0x1904, 0xa4c1, 0x2011, 0x1835, 0x2204, 0xc0ad, 0x2012, 0x2001,
+	0x193e, 0x2004, 0x00f6, 0x2079, 0x0100, 0x78e3, 0x0000, 0x080c,
+	0x254a, 0x78e2, 0x00fe, 0x0804, 0xa4c1, 0x080c, 0xba40, 0x2011,
+	0x1835, 0x2204, 0xc0a5, 0x2012, 0x0006, 0x080c, 0xce81, 0x000e,
+	0x1904, 0xa4c1, 0xc0b5, 0x2012, 0x2001, 0x0006, 0x080c, 0x5ecf,
+	0x9006, 0x080c, 0x5ebb, 0x00c6, 0x2001, 0x180e, 0x2004, 0xd09c,
+	0x0520, 0x00f6, 0x2079, 0x0100, 0x00e6, 0x2071, 0x1800, 0x700c,
+	0x9084, 0x00ff, 0x78e6, 0x7076, 0x7010, 0x78ea, 0x707a, 0x908c,
+	0x00ff, 0x00ee, 0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c, 0x251f,
+	0x00f6, 0x2100, 0x900e, 0x080c, 0x24d6, 0x7956, 0x00fe, 0x9186,
+	0x0081, 0x01d8, 0x2009, 0x0081, 0x00c8, 0x2009, 0x00ef, 0x00f6,
+	0x2079, 0x0100, 0x79ea, 0x7932, 0x7936, 0x780c, 0xc0b5, 0x780e,
+	0x00fe, 0x080c, 0x251f, 0x00f6, 0x2079, 0x1800, 0x797a, 0x2100,
+	0x900e, 0x080c, 0x24d6, 0x7956, 0x00fe, 0x8108, 0x080c, 0x5f1e,
+	0x2b00, 0x00ce, 0x1904, 0xa4c1, 0x6012, 0x2009, 0x180e, 0x210c,
+	0xd19c, 0x0150, 0x2009, 0x027c, 0x210c, 0x918c, 0x00ff, 0xb912,
+	0x2009, 0x027d, 0x210c, 0xb916, 0x2001, 0x0002, 0x080c, 0x5ecf,
+	0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8048,
+	0x080c, 0x8582, 0x0008, 0x0431, 0x00de, 0x009e, 0x00be, 0x0005,
+	0x2001, 0x180f, 0x2004, 0xd0a4, 0x0120, 0x2001, 0x1854, 0x2004,
+	0xd0ac, 0x0005, 0x00e6, 0x080c, 0xd2f4, 0x0190, 0x2071, 0x0260,
+	0x7108, 0x720c, 0x918c, 0x00ff, 0x1118, 0x9284, 0xff00, 0x0140,
+	0x6010, 0x2058, 0xb8a0, 0x9084, 0xff80, 0x1110, 0xb912, 0xba16,
+	0x00ee, 0x0005, 0x2030, 0x2001, 0x0007, 0x080c, 0x5ecf, 0x080c,
+	0x5127, 0x1120, 0x2001, 0x0007, 0x080c, 0x5efb, 0x080c, 0x2e55,
+	0x6020, 0x9086, 0x000a, 0x1108, 0x0005, 0x0804, 0x99d6, 0x00b6,
+	0x00e6, 0x0026, 0x0016, 0x2071, 0x1800, 0x7088, 0x9086, 0x0014,
+	0x1904, 0xa62f, 0x080c, 0x5127, 0x1170, 0x6014, 0x9005, 0x1158,
+	0x0036, 0x0046, 0x6010, 0x2058, 0xbba0, 0x2021, 0x0006, 0x080c,
+	0x4829, 0x004e, 0x003e, 0x00d6, 0x6010, 0x2058, 0x080c, 0x6019,
+	0x080c, 0xa47b, 0x00de, 0x080c, 0xa875, 0x1588, 0x6010, 0x2058,
+	0xb890, 0x9005, 0x0560, 0x2001, 0x0006, 0x080c, 0x5ecf, 0x0096,
+	0x6014, 0x904d, 0x01d0, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039,
+	0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xbbcd,
+	0x0060, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0029, 0x0130, 0xa807,
+	0x0000, 0xa867, 0x0103, 0xa833, 0x0200, 0x009e, 0x080c, 0x2e55,
+	0x6020, 0x9086, 0x000a, 0x0138, 0x080c, 0x99d6, 0x0020, 0x080c,
+	0xa364, 0x080c, 0xa5c2, 0x001e, 0x002e, 0x00ee, 0x00be, 0x0005,
+	0x2011, 0x1822, 0x2204, 0x9086, 0x0014, 0x1160, 0x2001, 0x0002,
+	0x080c, 0x5ecf, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x8048,
+	0x0804, 0x8582, 0x0804, 0xa5c2, 0x2030, 0x2011, 0x1822, 0x2204,
+	0x9086, 0x0004, 0x1148, 0x96b6, 0x000b, 0x1120, 0x2001, 0x0007,
+	0x080c, 0x5ecf, 0x0804, 0x99d6, 0x0804, 0xa5c2, 0x0002, 0xa445,
+	0xa676, 0xa445, 0xa6b5, 0xa445, 0xa760, 0xa66b, 0xa445, 0xa445,
+	0xa773, 0xa445, 0xa783, 0x6604, 0x9686, 0x0003, 0x0904, 0xa5d7,
+	0x96b6, 0x001e, 0x1110, 0x080c, 0x99d6, 0x0005, 0x00b6, 0x00d6,
+	0x00c6, 0x080c, 0xa793, 0x11a0, 0x9006, 0x080c, 0x5ebb, 0x080c,
+	0x2e30, 0x080c, 0xbd01, 0x2001, 0x0002, 0x080c, 0x5ecf, 0x6003,
+	0x0001, 0x6007, 0x0002, 0x080c, 0x8048, 0x080c, 0x8582, 0x0408,
+	0x2009, 0x026e, 0x2104, 0x9086, 0x0009, 0x1160, 0x6010, 0x2058,
+	0xb840, 0x9084, 0x00ff, 0x9005, 0x0170, 0x8001, 0xb842, 0x601b,
+	0x000a, 0x0078, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x9086,
+	0x1900, 0x1108, 0x08a0, 0x080c, 0x2e30, 0x080c, 0xbd01, 0x080c,
+	0xa5c2, 0x00ce, 0x00de, 0x00be, 0x0005, 0x0096, 0x00b6, 0x0026,
+	0x9016, 0x080c, 0xa7a1, 0x00d6, 0x2069, 0x194d, 0x2d04, 0x9005,
+	0x0168, 0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1138, 0x2069,
+	0x181e, 0x2d04, 0x8000, 0x206a, 0x00de, 0x0010, 0x00de, 0x0088,
+	0x9006, 0x080c, 0x5ebb, 0x2001, 0x0002, 0x080c, 0x5ecf, 0x6003,
+	0x0001, 0x6007, 0x0002, 0x080c, 0x8048, 0x080c, 0x8582, 0x0804,
+	0xa730, 0x080c, 0xb5fb, 0x01b0, 0x6014, 0x2048, 0xa864, 0x2010,
+	0x9086, 0x0139, 0x1138, 0x6007, 0x0016, 0x2001, 0x0002, 0x080c,
+	0xbc27, 0x00b0, 0x6014, 0x2048, 0xa864, 0xd0fc, 0x0118, 0x2001,
+	0x0001, 0x0ca8, 0x2001, 0x180d, 0x2004, 0xd0dc, 0x0148, 0x6010,
+	0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x1110, 0x9006, 0x0c38,
+	0x080c, 0xa364, 0x2009, 0x026e, 0x2134, 0x96b4, 0x00ff, 0x9686,
+	0x0005, 0x0510, 0x9686, 0x000b, 0x01c8, 0x2009, 0x026f, 0x2104,
+	0x9084, 0xff00, 0x1118, 0x9686, 0x0009, 0x01b0, 0x9086, 0x1900,
+	0x1168, 0x9686, 0x0009, 0x0180, 0x2001, 0x0004, 0x080c, 0x5ecf,
+	0x2001, 0x0028, 0x601a, 0x6007, 0x0052, 0x0010, 0x080c, 0xa5c2,
+	0x002e, 0x00be, 0x009e, 0x0005, 0x9286, 0x0139, 0x0160, 0x6014,
+	0x2048, 0x080c, 0xb5fb, 0x0140, 0xa864, 0x9086, 0x0139, 0x0118,
+	0xa868, 0xd0fc, 0x0108, 0x0c50, 0x6010, 0x2058, 0xb840, 0x9084,
+	0x00ff, 0x9005, 0x0138, 0x8001, 0xb842, 0x601b, 0x000a, 0x6007,
+	0x0016, 0x08f0, 0xb8a0, 0x9086, 0x007e, 0x1138, 0x00e6, 0x2071,
+	0x1800, 0x080c, 0x59b4, 0x00ee, 0x0010, 0x080c, 0x2e30, 0x0870,
+	0x080c, 0xa7a1, 0x1160, 0x2001, 0x0004, 0x080c, 0x5ecf, 0x6003,
+	0x0001, 0x6007, 0x0003, 0x080c, 0x8048, 0x0804, 0x8582, 0x080c,
+	0xa364, 0x0804, 0xa5c2, 0x0469, 0x1160, 0x2001, 0x0008, 0x080c,
+	0x5ecf, 0x6003, 0x0001, 0x6007, 0x0005, 0x080c, 0x8048, 0x0804,
+	0x8582, 0x0804, 0xa5c2, 0x00e9, 0x1160, 0x2001, 0x000a, 0x080c,
+	0x5ecf, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x8048, 0x0804,
+	0x8582, 0x0804, 0xa5c2, 0x2009, 0x026e, 0x2104, 0x9086, 0x0003,
+	0x1138, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x9086, 0x2a00,
+	0x0005, 0x9085, 0x0001, 0x0005, 0x00b6, 0x00c6, 0x0016, 0x6110,
+	0x2158, 0x080c, 0x5f8d, 0x001e, 0x00ce, 0x00be, 0x0005, 0x00b6,
+	0x00f6, 0x00e6, 0x00d6, 0x0036, 0x0016, 0x6010, 0x2058, 0x2009,
+	0x1835, 0x2104, 0x9085, 0x0003, 0x200a, 0x080c, 0xa847, 0x0560,
+	0x2009, 0x1835, 0x2104, 0xc0cd, 0x200a, 0x080c, 0x62a0, 0x0158,
+	0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xcfe6, 0x2001, 0x180c,
+	0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x2009, 0x0001, 0x080c,
+	0x2dfb, 0x00e6, 0x2071, 0x1800, 0x080c, 0x2c2b, 0x00ee, 0x00c6,
+	0x0156, 0x20a9, 0x0781, 0x2009, 0x007f, 0x080c, 0x2f28, 0x8108,
+	0x1f04, 0xa7e5, 0x015e, 0x00ce, 0x080c, 0xa7a4, 0x2071, 0x0260,
+	0x2079, 0x0200, 0x7817, 0x0001, 0x2001, 0x1835, 0x200c, 0xc1c5,
+	0x7018, 0xd0fc, 0x0110, 0xd0dc, 0x0118, 0x7038, 0xd0dc, 0x1108,
+	0xc1c4, 0x7817, 0x0000, 0x2001, 0x1835, 0x2102, 0x2079, 0x0100,
+	0x2e04, 0x9084, 0x00ff, 0x2069, 0x181d, 0x206a, 0x78e6, 0x0006,
+	0x8e70, 0x2e04, 0x2069, 0x181e, 0x206a, 0x78ea, 0x7832, 0x7836,
+	0x2010, 0x9084, 0xff00, 0x001e, 0x9105, 0x2009, 0x182a, 0x200a,
+	0x2200, 0x9084, 0x00ff, 0x2008, 0x080c, 0x251f, 0x080c, 0x6c53,
+	0x0170, 0x2071, 0x0260, 0x2069, 0x1951, 0x7048, 0x206a, 0x704c,
+	0x6806, 0x7050, 0x680a, 0x7054, 0x680e, 0x080c, 0xba03, 0x0040,
+	0x2001, 0x0006, 0x080c, 0x5ecf, 0x080c, 0x2e55, 0x080c, 0x99d6,
+	0x001e, 0x003e, 0x00de, 0x00ee, 0x00fe, 0x00be, 0x0005, 0x0096,
+	0x0026, 0x0036, 0x00e6, 0x0156, 0x2019, 0x182a, 0x231c, 0x83ff,
+	0x01f0, 0x2071, 0x0260, 0x7200, 0x9294, 0x00ff, 0x7004, 0x9084,
+	0xff00, 0x9205, 0x9306, 0x1198, 0x2011, 0x0276, 0x20a9, 0x0004,
+	0x2b48, 0x2019, 0x000a, 0x080c, 0xa91d, 0x1148, 0x2011, 0x027a,
+	0x20a9, 0x0004, 0x2019, 0x0006, 0x080c, 0xa91d, 0x1100, 0x015e,
+	0x00ee, 0x003e, 0x002e, 0x009e, 0x0005, 0x00e6, 0x2071, 0x0260,
+	0x7034, 0x9086, 0x0014, 0x11a8, 0x7038, 0x9086, 0x0800, 0x1188,
+	0x703c, 0xd0ec, 0x0160, 0x9084, 0x0f00, 0x9086, 0x0100, 0x1138,
+	0x7054, 0xd0a4, 0x1110, 0xd0ac, 0x0110, 0x9006, 0x0010, 0x9085,
+	0x0001, 0x00ee, 0x0005, 0x00e6, 0x0096, 0x00c6, 0x0076, 0x0056,
+	0x0046, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2029, 0x19bf,
+	0x252c, 0x2021, 0x19c5, 0x2424, 0x2061, 0x1cd0, 0x2071, 0x1800,
+	0x724c, 0x706c, 0x9202, 0x1a04, 0xa8f5, 0x080c, 0xd012, 0x05f0,
+	0x6720, 0x9786, 0x0007, 0x05d0, 0x2500, 0x9c06, 0x05b8, 0x2400,
+	0x9c06, 0x05a0, 0x3e08, 0x9186, 0x0002, 0x1148, 0x6010, 0x9005,
+	0x0130, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1538, 0x00c6,
+	0x6000, 0x9086, 0x0004, 0x1110, 0x080c, 0x1827, 0x9786, 0x000a,
+	0x0148, 0x080c, 0xb7fa, 0x1130, 0x00ce, 0x080c, 0xa364, 0x080c,
+	0x9a06, 0x00a0, 0x6014, 0x2048, 0x080c, 0xb5fb, 0x0160, 0x9786,
+	0x0003, 0x11e8, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c,
+	0x6529, 0x080c, 0xb7dd, 0x080c, 0x9a06, 0x00ce, 0x9ce0, 0x0018,
+	0x7060, 0x9c02, 0x1210, 0x0804, 0xa8a8, 0x012e, 0x000e, 0x002e,
+	0x004e, 0x005e, 0x007e, 0x00ce, 0x009e, 0x00ee, 0x0005, 0x9786,
+	0x0006, 0x1118, 0x080c, 0xcf91, 0x0c30, 0x9786, 0x000a, 0x09e0,
+	0x08c8, 0x220c, 0x2304, 0x9106, 0x1130, 0x8210, 0x8318, 0x1f04,
+	0xa909, 0x9006, 0x0005, 0x2304, 0x9102, 0x0218, 0x2001, 0x0001,
+	0x0008, 0x9006, 0x918d, 0x0001, 0x0005, 0x0136, 0x01c6, 0x0016,
+	0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0,
+	0x9300, 0x2098, 0x3518, 0x20a9, 0x0001, 0x220c, 0x4002, 0x910e,
+	0x1140, 0x8210, 0x8319, 0x1dc8, 0x9006, 0x001e, 0x01ce, 0x013e,
+	0x0005, 0x220c, 0x9102, 0x0218, 0x2001, 0x0001, 0x0010, 0x2001,
+	0x0000, 0x918d, 0x0001, 0x001e, 0x01ce, 0x013e, 0x0005, 0x6004,
+	0x908a, 0x0053, 0x1a0c, 0x0db2, 0x080c, 0xb7e9, 0x0120, 0x080c,
+	0xb7fa, 0x0168, 0x0028, 0x080c, 0x2e55, 0x080c, 0xb7fa, 0x0138,
+	0x080c, 0x847d, 0x080c, 0x99d6, 0x080c, 0x8582, 0x0005, 0x080c,
+	0xa364, 0x0cb0, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208,
+	0x000a, 0x0005, 0xa97e, 0xa97e, 0xa97e, 0xa97e, 0xa97e, 0xa97e,
+	0xa97e, 0xa97e, 0xa97e, 0xa97e, 0xa97e, 0xa980, 0xa980, 0xa980,
+	0xa980, 0xa97e, 0xa97e, 0xa97e, 0xa980, 0xa97e, 0x080c, 0x0db2,
+	0x600b, 0xffff, 0x6003, 0x0001, 0x6106, 0x080c, 0x8000, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x8582, 0x012e, 0x0005, 0x9186, 0x0013,
+	0x1128, 0x6004, 0x9082, 0x0040, 0x0804, 0xaa35, 0x9186, 0x0027,
+	0x1520, 0x080c, 0x847d, 0x080c, 0x2e30, 0x080c, 0xbd01, 0x0096,
+	0x6114, 0x2148, 0x080c, 0xb5fb, 0x0198, 0x080c, 0xb7fa, 0x1118,
+	0x080c, 0xa364, 0x0068, 0xa867, 0x0103, 0xa87b, 0x0029, 0xa877,
+	0x0000, 0xa97c, 0xc1c5, 0xa97e, 0x080c, 0x6536, 0x080c, 0xb7dd,
+	0x009e, 0x080c, 0x99d6, 0x0804, 0x8582, 0x9186, 0x0014, 0x1120,
+	0x6004, 0x9082, 0x0040, 0x04a0, 0x9186, 0x0046, 0x0150, 0x9186,
+	0x0045, 0x0138, 0x9186, 0x0053, 0x0120, 0x9186, 0x0048, 0x190c,
+	0x0db2, 0x2001, 0x0109, 0x2004, 0xd084, 0x0508, 0x0126, 0x2091,
+	0x2800, 0x0006, 0x0016, 0x0026, 0x0036, 0x00f6, 0x00e6, 0x00c6,
+	0x2079, 0x19b6, 0x2071, 0x1800, 0x2061, 0x0100, 0x080c, 0x7eec,
+	0x00ce, 0x00ee, 0x00fe, 0x003e, 0x002e, 0x001e, 0x000e, 0x012e,
+	0xa001, 0x6000, 0x9086, 0x0002, 0x1110, 0x0804, 0xaa73, 0x0005,
+	0x0002, 0xaa0f, 0xaa0d, 0xaa0d, 0xaa0d, 0xaa0d, 0xaa0d, 0xaa0d,
+	0xaa0d, 0xaa0d, 0xaa0d, 0xaa0d, 0xaa2a, 0xaa2a, 0xaa2a, 0xaa2a,
+	0xaa0d, 0xaa2a, 0xaa0d, 0xaa2a, 0xaa0d, 0x080c, 0x0db2, 0x080c,
+	0x847d, 0x0096, 0x6114, 0x2148, 0x080c, 0xb5fb, 0x0168, 0xa867,
+	0x0103, 0xa87b, 0x0006, 0xa877, 0x0000, 0xa880, 0xc0ec, 0xa882,
+	0x080c, 0x6536, 0x080c, 0xb7dd, 0x009e, 0x080c, 0x99d6, 0x080c,
+	0x8582, 0x0005, 0x080c, 0x847d, 0x080c, 0xb7fa, 0x090c, 0xa364,
+	0x080c, 0x99d6, 0x080c, 0x8582, 0x0005, 0x0002, 0xaa4c, 0xaa4a,
+	0xaa4a, 0xaa4a, 0xaa4a, 0xaa4a, 0xaa4a, 0xaa4a, 0xaa4a, 0xaa4a,
+	0xaa4a, 0xaa63, 0xaa63, 0xaa63, 0xaa63, 0xaa4a, 0xaa6d, 0xaa4a,
+	0xaa63, 0xaa4a, 0x080c, 0x0db2, 0x0096, 0x080c, 0x847d, 0x6014,
+	0x2048, 0x2001, 0x1957, 0x2004, 0x6042, 0xa97c, 0xd1ac, 0x0140,
+	0x6003, 0x0004, 0xa87c, 0x9085, 0x0400, 0xa87e, 0x009e, 0x0005,
+	0x6003, 0x0002, 0x0cb8, 0x080c, 0x847d, 0x080c, 0xbd04, 0x080c,
+	0xbd09, 0x6003, 0x000f, 0x0804, 0x8582, 0x080c, 0x847d, 0x080c,
+	0x99d6, 0x0804, 0x8582, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040,
+	0x0208, 0x000a, 0x0005, 0xaa8f, 0xaa8f, 0xaa8f, 0xaa8f, 0xaa8f,
+	0xaa91, 0xab6e, 0xaa8f, 0xaba2, 0xaa8f, 0xaa8f, 0xaa8f, 0xaa8f,
+	0xaa8f, 0xaa8f, 0xaa8f, 0xaa8f, 0xaa8f, 0xaa8f, 0xaba2, 0x080c,
+	0x0db2, 0x00b6, 0x0096, 0x6114, 0x2148, 0x7644, 0x96b4, 0x0fff,
+	0x86ff, 0x1528, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xab5d,
+	0xa87b, 0x0000, 0xa867, 0x0103, 0xae76, 0xa87c, 0xd0ac, 0x0128,
+	0xa834, 0xa938, 0x9115, 0x190c, 0xad37, 0x080c, 0x6351, 0x6210,
+	0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0x7044, 0xd0e4,
+	0x1904, 0xab41, 0x080c, 0x99d6, 0x009e, 0x00be, 0x0005, 0x968c,
+	0x0c00, 0x0150, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xab45,
+	0x7348, 0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002,
+	0x0508, 0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x00e8, 0xd6dc,
+	0x01a0, 0xa87b, 0x0015, 0xa87c, 0xd0ac, 0x0170, 0xa938, 0xaa34,
+	0x2100, 0x9205, 0x0148, 0x7048, 0x9106, 0x1118, 0x704c, 0x9206,
+	0x0118, 0xa992, 0xaa8e, 0xc6dc, 0x0038, 0xd6d4, 0x0118, 0xa87b,
+	0x0007, 0x0010, 0xa87b, 0x0000, 0xa867, 0x0103, 0xae76, 0x901e,
+	0xd6c4, 0x01d8, 0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118,
+	0xc6c4, 0x0804, 0xaa98, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a,
+	0x0009, 0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018,
+	0x2011, 0x0025, 0x080c, 0xb219, 0x003e, 0xd6cc, 0x0904, 0xaaad,
+	0x7154, 0xa98a, 0x81ff, 0x0904, 0xaaad, 0x9192, 0x0021, 0x1278,
+	0x8304, 0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xb219, 0x2011,
+	0x0205, 0x2013, 0x0000, 0x080c, 0xbc93, 0x0804, 0xaaad, 0xa868,
+	0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c50, 0x00a6, 0x2950,
+	0x080c, 0xb1b8, 0x00ae, 0x080c, 0xbc93, 0x080c, 0xb209, 0x0804,
+	0xaaaf, 0x080c, 0xb8ed, 0x0804, 0xaabc, 0xa87c, 0xd0ac, 0x0904,
+	0xaac8, 0xa880, 0xd0bc, 0x1904, 0xaac8, 0x7348, 0xa838, 0x9306,
+	0x11c8, 0x734c, 0xa834, 0x931e, 0x0904, 0xaac8, 0xd6d4, 0x0190,
+	0xab38, 0x9305, 0x0904, 0xaac8, 0x0068, 0xa87c, 0xd0ac, 0x0904,
+	0xaaa0, 0xa838, 0xa934, 0x9105, 0x0904, 0xaaa0, 0xa880, 0xd0bc,
+	0x1904, 0xaaa0, 0x080c, 0xb927, 0x0804, 0xaabc, 0x0096, 0x00f6,
+	0x6003, 0x0003, 0x6007, 0x0043, 0x2079, 0x026c, 0x7c04, 0x7b00,
+	0x7e0c, 0x7d08, 0x6014, 0x2048, 0xa87c, 0xd0ac, 0x0140, 0x6003,
+	0x0002, 0x00fe, 0x009e, 0x0005, 0x2130, 0x2228, 0x0058, 0x2400,
+	0xa9ac, 0x910a, 0x2300, 0xaab0, 0x9213, 0x2600, 0x9102, 0x2500,
+	0x9203, 0x0e90, 0xac36, 0xab3a, 0xae46, 0xad4a, 0x00fe, 0x6043,
+	0x0000, 0x2c10, 0x080c, 0x1976, 0x080c, 0x8065, 0x080c, 0x865d,
+	0x009e, 0x0005, 0x0005, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040,
+	0x0208, 0x000a, 0x0005, 0xabbf, 0xabbf, 0xabbf, 0xabbf, 0xabbf,
+	0xabc1, 0xac57, 0xabbf, 0xabbf, 0xac6e, 0xacfa, 0xabbf, 0xabbf,
+	0xabbf, 0xabbf, 0xad0f, 0xabbf, 0xabbf, 0xabbf, 0xabbf, 0x080c,
+	0x0db2, 0x0076, 0x00a6, 0x00e6, 0x0096, 0x2071, 0x0260, 0x6114,
+	0x2150, 0x7644, 0xb676, 0x96b4, 0x0fff, 0xb77c, 0xc7e5, 0xb77e,
+	0x6210, 0x00b6, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e,
+	0x00be, 0x86ff, 0x0904, 0xac52, 0x9694, 0xff00, 0x9284, 0x0c00,
+	0x0120, 0x7048, 0xb092, 0x704c, 0xb08e, 0x9284, 0x0300, 0x0904,
+	0xac52, 0x080c, 0x0fd5, 0x090c, 0x0db2, 0x2900, 0xb07a, 0xb77c,
+	0xc7cd, 0xb77e, 0xa867, 0x0103, 0xb068, 0xa86a, 0xb06c, 0xa86e,
+	0xb070, 0xa872, 0xae76, 0x968c, 0x0c00, 0x0120, 0x7348, 0xab92,
+	0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0180, 0x9186,
+	0x0028, 0x1118, 0xa87b, 0x001c, 0x0060, 0xd6dc, 0x0118, 0xa87b,
+	0x0015, 0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b,
+	0x0000, 0xaf7e, 0xb080, 0xa882, 0xb084, 0xa886, 0x901e, 0xd6c4,
+	0x0190, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210,
+	0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025,
+	0x080c, 0xb219, 0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a, 0x81ff,
+	0x01c8, 0x9192, 0x0021, 0x1260, 0x8304, 0x9098, 0x0018, 0x2011,
+	0x0029, 0x080c, 0xb219, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050,
+	0xb068, 0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68, 0x2950,
+	0x080c, 0xb1b8, 0x009e, 0x00ee, 0x00ae, 0x007e, 0x0005, 0x00f6,
+	0x00a6, 0x6003, 0x0003, 0x2079, 0x026c, 0x7c04, 0x7b00, 0x7e0c,
+	0x7d08, 0x6014, 0x2050, 0xb436, 0xb33a, 0xb646, 0xb54a, 0x00ae,
+	0x00fe, 0x2c10, 0x080c, 0x1976, 0x0804, 0x8f88, 0x6003, 0x0002,
+	0x6004, 0x9086, 0x0040, 0x11c8, 0x0096, 0x6014, 0x2048, 0xa87c,
+	0xd0ac, 0x0160, 0x601c, 0xd084, 0x1130, 0x00f6, 0x2c00, 0x2078,
+	0x080c, 0x1582, 0x00fe, 0x6003, 0x0004, 0x0010, 0x6003, 0x0002,
+	0x009e, 0x080c, 0x847d, 0x080c, 0x8582, 0x0096, 0x2001, 0x1957,
+	0x2004, 0x6042, 0x080c, 0x8532, 0x080c, 0x865d, 0x6114, 0x2148,
+	0xa97c, 0xd1e4, 0x0904, 0xacf5, 0xd1cc, 0x05a8, 0xa978, 0xa868,
+	0xd0fc, 0x0538, 0x0016, 0xa87c, 0x0006, 0xa880, 0x0006, 0xa860,
+	0x20e8, 0xa85c, 0x9080, 0x0019, 0x20a0, 0x810e, 0x810e, 0x810f,
+	0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080, 0x0019, 0x2098,
+	0x0156, 0x20a9, 0x0020, 0x4003, 0x015e, 0x000e, 0xa882, 0x000e,
+	0xa87e, 0x001e, 0xa874, 0x0006, 0x2148, 0x080c, 0x0f87, 0x001e,
+	0x0440, 0x0016, 0x080c, 0x0f87, 0x009e, 0xa974, 0x0016, 0x080c,
+	0xb209, 0x001e, 0x00f0, 0xa867, 0x0103, 0xa974, 0x9184, 0x00ff,
+	0x90b6, 0x0002, 0x0180, 0x9086, 0x0028, 0x1118, 0xa87b, 0x001c,
+	0x0060, 0xd1dc, 0x0118, 0xa87b, 0x0015, 0x0038, 0xd1d4, 0x0118,
+	0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000, 0x0016, 0x080c, 0x6351,
+	0x001e, 0xd1e4, 0x1120, 0x080c, 0x99d6, 0x009e, 0x0005, 0x080c,
+	0xb8ed, 0x0cd8, 0x6004, 0x9086, 0x0040, 0x1120, 0x080c, 0x847d,
+	0x080c, 0x8582, 0x2019, 0x0001, 0x080c, 0x9254, 0x6003, 0x0002,
+	0x080c, 0xbd09, 0x080c, 0x8532, 0x080c, 0x865d, 0x0005, 0x6004,
+	0x9086, 0x0040, 0x1120, 0x080c, 0x847d, 0x080c, 0x8582, 0x2019,
+	0x0001, 0x080c, 0x9254, 0x080c, 0x8532, 0x080c, 0x2e30, 0x080c,
+	0xbd01, 0x0096, 0x6114, 0x2148, 0x080c, 0xb5fb, 0x0150, 0xa867,
+	0x0103, 0xa87b, 0x0029, 0xa877, 0x0000, 0x080c, 0x6536, 0x080c,
+	0xb7dd, 0x009e, 0x080c, 0x99d6, 0x080c, 0x865d, 0x0005, 0xa87b,
+	0x0015, 0xd1fc, 0x0138, 0xa87b, 0x0007, 0x8002, 0x8000, 0x810a,
+	0x9189, 0x0000, 0xa992, 0xa88e, 0x0005, 0x9182, 0x0054, 0x1220,
+	0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xad61, 0xad61, 0xad61,
+	0xad61, 0xad61, 0xad63, 0xad61, 0xad61, 0xae09, 0xad61, 0xad61,
+	0xad61, 0xad61, 0xad61, 0xad61, 0xad61, 0xad61, 0xad61, 0xad61,
+	0xaf3a, 0x080c, 0x0db2, 0x0076, 0x00a6, 0x00e6, 0x0096, 0x2071,
+	0x0260, 0x6114, 0x2150, 0x7644, 0xb676, 0x96b4, 0x0fff, 0xb77c,
+	0xc7e5, 0xb77e, 0x6210, 0x00b6, 0x2258, 0xba3c, 0x82ff, 0x0110,
+	0x8211, 0xba3e, 0x00be, 0x86ff, 0x0904, 0xae02, 0x9694, 0xff00,
+	0x9284, 0x0c00, 0x0120, 0x7048, 0xb092, 0x704c, 0xb08e, 0x9284,
+	0x0300, 0x0904, 0xae02, 0x9686, 0x0100, 0x1130, 0x7064, 0x9005,
+	0x1118, 0xc6c4, 0xb676, 0x0c38, 0x080c, 0x0fd5, 0x090c, 0x0db2,
+	0x2900, 0xb07a, 0xb77c, 0x97bd, 0x0200, 0xb77e, 0xa867, 0x0103,
+	0xb068, 0xa86a, 0xb06c, 0xa86e, 0xb070, 0xa872, 0x7044, 0x9084,
+	0xf000, 0x9635, 0xae76, 0x968c, 0x0c00, 0x0120, 0x7348, 0xab92,
+	0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0180, 0x9186,
+	0x0028, 0x1118, 0xa87b, 0x001c, 0x0060, 0xd6dc, 0x0118, 0xa87b,
+	0x0015, 0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b,
+	0x0000, 0xaf7e, 0xb080, 0xa882, 0xb084, 0xa886, 0x901e, 0xd6c4,
+	0x0190, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210,
+	0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025,
+	0x080c, 0xb219, 0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a, 0x81ff,
+	0x01c8, 0x9192, 0x0021, 0x1260, 0x8304, 0x9098, 0x0018, 0x2011,
+	0x0029, 0x080c, 0xb219, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050,
+	0xb068, 0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68, 0x2950,
+	0x080c, 0xb1b8, 0x080c, 0x1805, 0x009e, 0x00ee, 0x00ae, 0x007e,
+	0x0005, 0x2001, 0x1957, 0x2004, 0x6042, 0x0096, 0x6114, 0x2148,
+	0xa83c, 0xa940, 0x9105, 0x1118, 0xa87c, 0xc0dc, 0xa87e, 0x6003,
+	0x0002, 0xa97c, 0xd1e4, 0x0904, 0xaf35, 0x6043, 0x0000, 0x6010,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1500, 0xd1cc, 0x0904,
+	0xaf04, 0xa978, 0xa868, 0xd0fc, 0x0904, 0xaec5, 0x0016, 0xa87c,
+	0x0006, 0xa880, 0x0006, 0x00a6, 0x2150, 0xb174, 0x9184, 0x00ff,
+	0x90b6, 0x0002, 0x0904, 0xae93, 0x9086, 0x0028, 0x1904, 0xae7f,
+	0xa87b, 0x001c, 0xb07b, 0x001c, 0x0804, 0xae9b, 0x6024, 0xd0f4,
+	0x11d0, 0xa838, 0xaa34, 0x9205, 0x09c8, 0xa838, 0xaa90, 0x9206,
+	0x1120, 0xa88c, 0xaa34, 0x9206, 0x0988, 0x6024, 0xd0d4, 0x1148,
+	0xa9ac, 0xa834, 0x9102, 0x603a, 0xa9b0, 0xa838, 0x9103, 0x603e,
+	0x6024, 0xc0f5, 0x6026, 0x6010, 0x00b6, 0x2058, 0xb83c, 0x8000,
+	0xb83e, 0x00be, 0x9006, 0xa876, 0xa892, 0xa88e, 0xa87c, 0xc0e4,
+	0xa87e, 0xd0cc, 0x0140, 0xc0cc, 0xa87e, 0x0096, 0xa878, 0x2048,
+	0x080c, 0x0f87, 0x009e, 0x080c, 0xb927, 0x0804, 0xaf35, 0xd1dc,
+	0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xbbb6, 0x0118,
+	0xb174, 0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007,
+	0xb07b, 0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938,
+	0x9115, 0x190c, 0xad37, 0xa87c, 0xb07e, 0xa890, 0xb092, 0xa88c,
+	0xb08e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0019, 0x20a0, 0x20a9,
+	0x0020, 0x8a06, 0x8006, 0x8007, 0x9094, 0x003f, 0x22e0, 0x9084,
+	0xffc0, 0x9080, 0x0019, 0x2098, 0x4003, 0x00ae, 0x000e, 0xa882,
+	0x000e, 0xa87e, 0x080c, 0xbc93, 0x001e, 0xa874, 0x0006, 0x2148,
+	0x080c, 0x0f87, 0x001e, 0x0804, 0xaf31, 0x0016, 0x00a6, 0x2150,
+	0xb174, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x01e0, 0x9086, 0x0028,
+	0x1128, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x00e0, 0xd1dc, 0x0158,
+	0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xbbb6, 0x0118, 0xb174,
+	0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b,
+	0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115,
+	0x190c, 0xad37, 0xa890, 0xb092, 0xa88c, 0xb08e, 0xa87c, 0xb07e,
+	0x00ae, 0x080c, 0x0f87, 0x009e, 0x080c, 0xbc93, 0xa974, 0x0016,
+	0x080c, 0xb209, 0x001e, 0x0468, 0xa867, 0x0103, 0xa974, 0x9184,
+	0x00ff, 0x90b6, 0x0002, 0x01b0, 0x9086, 0x0028, 0x1118, 0xa87b,
+	0x001c, 0x00d0, 0xd1dc, 0x0148, 0xa87b, 0x0015, 0x080c, 0xbbb6,
+	0x0118, 0xa974, 0xc1dc, 0xa976, 0x0078, 0xd1d4, 0x0118, 0xa87b,
+	0x0007, 0x0050, 0xa87b, 0x0000, 0xa87c, 0xd0ac, 0x0128, 0xa834,
+	0xa938, 0x9115, 0x190c, 0xad37, 0xa974, 0x0016, 0x080c, 0x6351,
+	0x001e, 0xd1e4, 0x1120, 0x080c, 0x99d6, 0x009e, 0x0005, 0x080c,
+	0xb8ed, 0x0cd8, 0x6114, 0x0096, 0x2148, 0xa97c, 0xd1e4, 0x190c,
+	0x1813, 0x009e, 0x0005, 0x080c, 0x847d, 0x0010, 0x080c, 0x8532,
+	0x080c, 0xb5fb, 0x01f0, 0x0096, 0x6114, 0x2148, 0x080c, 0xb7fa,
+	0x1118, 0x080c, 0xa364, 0x00a0, 0xa867, 0x0103, 0x2009, 0x180c,
+	0x210c, 0xd18c, 0x11b8, 0xd184, 0x1190, 0x6108, 0xa97a, 0x918e,
+	0x0029, 0x1110, 0x080c, 0xd28c, 0xa877, 0x0000, 0x080c, 0x6536,
+	0x009e, 0x080c, 0x99d6, 0x080c, 0x8582, 0x0804, 0x865d, 0xa87b,
+	0x0004, 0x0c90, 0xa87b, 0x0004, 0x0c78, 0x9182, 0x0054, 0x1220,
+	0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xaf91, 0xaf91, 0xaf91,
+	0xaf91, 0xaf91, 0xaf93, 0xaf91, 0xaf91, 0xaf91, 0xaf91, 0xaf91,
+	0xaf91, 0xaf91, 0xaf91, 0xaf91, 0xaf91, 0xaf91, 0xaf91, 0xaf91,
+	0xaf91, 0x080c, 0x0db2, 0x080c, 0x511b, 0x01f8, 0x6014, 0x7144,
+	0x918c, 0x0fff, 0x9016, 0xd1c4, 0x0118, 0x7264, 0x9294, 0x00ff,
+	0x0096, 0x904d, 0x0188, 0xa87b, 0x0000, 0xa864, 0x9086, 0x0139,
+	0x0128, 0xa867, 0x0103, 0xa976, 0xaa96, 0x0030, 0xa897, 0x4000,
+	0xa99a, 0xaa9e, 0x080c, 0x6536, 0x009e, 0x0804, 0x99d6, 0x9182,
+	0x0085, 0x0002, 0xafc9, 0xafc7, 0xafc7, 0xafd5, 0xafc7, 0xafc7,
+	0xafc7, 0xafc7, 0xafc7, 0xafc7, 0xafc7, 0xafc7, 0xafc7, 0x080c,
+	0x0db2, 0x6003, 0x0001, 0x6106, 0x080c, 0x8000, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x8582, 0x012e, 0x0005, 0x0026, 0x0056, 0x00d6,
+	0x00e6, 0x2071, 0x0260, 0x7224, 0x6216, 0x7220, 0x080c, 0xb5e9,
+	0x01a0, 0x2268, 0x6800, 0x9086, 0x0000, 0x0178, 0x6010, 0x6d10,
+	0x952e, 0x1158, 0x00c6, 0x2d60, 0x080c, 0xb244, 0x00ce, 0x0128,
+	0x6803, 0x0002, 0x6007, 0x0086, 0x0010, 0x6007, 0x0087, 0x6003,
+	0x0001, 0x080c, 0x8000, 0x080c, 0x8582, 0x9280, 0x0004, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140, 0x6824, 0xd0ec, 0x0128,
+	0x00c6, 0x2260, 0x080c, 0xb927, 0x00ce, 0x00ee, 0x00de, 0x005e,
+	0x002e, 0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085,
+	0x0a0c, 0x0db2, 0x908a, 0x0092, 0x1a0c, 0x0db2, 0x9082, 0x0085,
+	0x00e2, 0x9186, 0x0027, 0x0120, 0x9186, 0x0014, 0x190c, 0x0db2,
+	0x080c, 0x847d, 0x0096, 0x6014, 0x2048, 0x080c, 0xb5fb, 0x0140,
+	0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c, 0x6536,
+	0x009e, 0x080c, 0x9a06, 0x0804, 0x8582, 0xb04a, 0xb04c, 0xb04c,
+	0xb04a, 0xb04a, 0xb04a, 0xb04a, 0xb04a, 0xb04a, 0xb04a, 0xb04a,
+	0xb04a, 0xb04a, 0x080c, 0x0db2, 0x080c, 0x847d, 0x080c, 0x9a06,
+	0x080c, 0x8582, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004, 0x9082,
+	0x0085, 0x2008, 0x04b8, 0x9186, 0x0027, 0x11f8, 0x080c, 0x847d,
+	0x080c, 0x2e30, 0x080c, 0xbd01, 0x0096, 0x6014, 0x2048, 0x080c,
+	0xb5fb, 0x0150, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029,
+	0x080c, 0x6536, 0x080c, 0xb7dd, 0x009e, 0x080c, 0x99d6, 0x080c,
+	0x8582, 0x0005, 0x080c, 0x9a6b, 0x0ce0, 0x9186, 0x0014, 0x1dd0,
+	0x080c, 0x847d, 0x0096, 0x6014, 0x2048, 0x080c, 0xb5fb, 0x0d60,
+	0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0006, 0xa880, 0xc0ec,
+	0xa882, 0x08f0, 0x0002, 0xb0a2, 0xb0a0, 0xb0a0, 0xb0a0, 0xb0a0,
+	0xb0a0, 0xb0ba, 0xb0a0, 0xb0a0, 0xb0a0, 0xb0a0, 0xb0a0, 0xb0a0,
+	0x080c, 0x0db2, 0x080c, 0x847d, 0x6034, 0x908c, 0xff00, 0x810f,
+	0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x1955,
+	0x0010, 0x2001, 0x1956, 0x2004, 0x601a, 0x6003, 0x000c, 0x080c,
+	0x8582, 0x0005, 0x080c, 0x847d, 0x6034, 0x908c, 0xff00, 0x810f,
+	0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x1955,
+	0x0010, 0x2001, 0x1956, 0x2004, 0x601a, 0x6003, 0x000e, 0x080c,
+	0x8582, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085, 0x0208,
+	0x0012, 0x0804, 0x9a6b, 0xb0e8, 0xb0e8, 0xb0e8, 0xb0e8, 0xb0ea,
+	0xb137, 0xb0e8, 0xb0e8, 0xb0e8, 0xb0e8, 0xb0e8, 0xb0e8, 0xb0e8,
+	0x080c, 0x0db2, 0x0096, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x0168, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039,
+	0x0118, 0x9186, 0x0035, 0x1118, 0x009e, 0x0804, 0xb14b, 0x080c,
+	0xb5fb, 0x1118, 0x080c, 0xb7dd, 0x0068, 0x6014, 0x2048, 0xa87c,
+	0xd0e4, 0x1110, 0x080c, 0xb7dd, 0xa867, 0x0103, 0x080c, 0xbccc,
+	0x080c, 0x6536, 0x00d6, 0x2c68, 0x080c, 0x9980, 0x01d0, 0x6003,
+	0x0001, 0x6007, 0x001e, 0x600b, 0xffff, 0x2009, 0x026e, 0x210c,
+	0x613a, 0x2009, 0x026f, 0x210c, 0x613e, 0x6910, 0x6112, 0x080c,
+	0xba69, 0x6954, 0x6156, 0x6023, 0x0001, 0x080c, 0x8000, 0x080c,
+	0x8582, 0x2d60, 0x00de, 0x080c, 0x99d6, 0x009e, 0x0005, 0x6010,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x05a0, 0x6034, 0x908c,
+	0xff00, 0x810f, 0x9186, 0x0035, 0x0130, 0x9186, 0x001e, 0x0118,
+	0x9186, 0x0039, 0x1538, 0x00d6, 0x2c68, 0x080c, 0xbc66, 0x11f0,
+	0x080c, 0x9980, 0x01d8, 0x6106, 0x6003, 0x0001, 0x6023, 0x0001,
+	0x6910, 0x6112, 0x692c, 0x612e, 0x6930, 0x6132, 0x6934, 0x918c,
+	0x00ff, 0x6136, 0x6938, 0x613a, 0x693c, 0x613e, 0x6954, 0x6156,
+	0x080c, 0xba69, 0x080c, 0x8000, 0x080c, 0x8582, 0x2d60, 0x00de,
+	0x0804, 0x99d6, 0x0096, 0x6014, 0x2048, 0x080c, 0xb5fb, 0x01c8,
+	0xa867, 0x0103, 0xa880, 0xd0b4, 0x0128, 0xc0ec, 0xa882, 0xa87b,
+	0x0006, 0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b,
+	0x0005, 0x080c, 0xb8e9, 0xa877, 0x0000, 0x080c, 0x6536, 0x080c,
+	0xb7dd, 0x009e, 0x0804, 0x99d6, 0x0016, 0x0096, 0x6014, 0x2048,
+	0x080c, 0xb5fb, 0x0140, 0xa867, 0x0103, 0xa87b, 0x0028, 0xa877,
+	0x0000, 0x080c, 0x6536, 0x009e, 0x001e, 0x9186, 0x0013, 0x0148,
+	0x9186, 0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0x9a6b,
+	0x0030, 0x080c, 0x847d, 0x080c, 0x9a06, 0x080c, 0x8582, 0x0005,
+	0x0056, 0x0066, 0x0096, 0x00a6, 0x2029, 0x0001, 0x9182, 0x0101,
+	0x1208, 0x0010, 0x2009, 0x0100, 0x2130, 0x8304, 0x9098, 0x0018,
+	0x2009, 0x0020, 0x2011, 0x0029, 0x080c, 0xb219, 0x96b2, 0x0020,
+	0xb004, 0x904d, 0x0110, 0x080c, 0x0f87, 0x080c, 0x0fd5, 0x0520,
+	0x8528, 0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406, 0x968a,
+	0x003d, 0x1228, 0x2608, 0x2011, 0x001b, 0x0499, 0x00a8, 0x96b2,
+	0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x0451, 0x0c28,
+	0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0003,
+	0xb566, 0x95ac, 0x0000, 0x0048, 0x2001, 0x0205, 0x2003, 0x0000,
+	0x00ae, 0x852f, 0x95ad, 0x0003, 0xb566, 0x009e, 0x006e, 0x005e,
+	0x0005, 0x00a6, 0x89ff, 0x0158, 0xa804, 0x9055, 0x0130, 0xa807,
+	0x0000, 0x080c, 0x6536, 0x2a48, 0x0cb8, 0x080c, 0x6536, 0x00ae,
+	0x0005, 0x00f6, 0x2079, 0x0200, 0x7814, 0x9085, 0x0080, 0x7816,
+	0xd184, 0x0108, 0x8108, 0x810c, 0x20a9, 0x0001, 0xa860, 0x20e8,
+	0xa85c, 0x9200, 0x20a0, 0x20e1, 0x0000, 0x2300, 0x9e00, 0x2098,
+	0x4003, 0x8318, 0x9386, 0x0020, 0x1148, 0x2018, 0x2300, 0x9e00,
+	0x2098, 0x7814, 0x8000, 0x9085, 0x0080, 0x7816, 0x8109, 0x1d80,
+	0x7817, 0x0000, 0x00fe, 0x0005, 0x0066, 0x0126, 0x2091, 0x8000,
+	0x2031, 0x0001, 0x6020, 0x9084, 0x000f, 0x0083, 0x012e, 0x006e,
+	0x0005, 0x0126, 0x2091, 0x8000, 0x0066, 0x2031, 0x0000, 0x6020,
+	0x9084, 0x000f, 0x001b, 0x006e, 0x012e, 0x0005, 0xb27f, 0xb27f,
+	0xb27a, 0xb2a1, 0xb26d, 0xb27a, 0xb2a1, 0xb27a, 0xb26d, 0xb26d,
+	0xb27a, 0xb27a, 0xb27a, 0xb26d, 0xb26d, 0x080c, 0x0db2, 0x0036,
+	0x2019, 0x0010, 0x080c, 0xcbad, 0x6023, 0x0006, 0x6003, 0x0007,
+	0x003e, 0x0005, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x0096,
+	0x86ff, 0x11d8, 0x6014, 0x2048, 0x080c, 0xb5fb, 0x01c0, 0xa864,
+	0x9086, 0x0139, 0x1128, 0xa87b, 0x0005, 0xa883, 0x0000, 0x0028,
+	0x900e, 0x2001, 0x0005, 0x080c, 0x6770, 0x080c, 0xb8e9, 0x080c,
+	0x6529, 0x080c, 0x9a06, 0x9085, 0x0001, 0x009e, 0x0005, 0x9006,
+	0x0ce0, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0db2, 0x0002, 0xb2b7,
+	0xb2dc, 0xb2b9, 0xb2fd, 0xb2d7, 0xb2b7, 0xb27a, 0xb27f, 0xb27f,
+	0xb27a, 0xb27a, 0xb27a, 0xb27a, 0xb27a, 0xb27a, 0xb27a, 0x080c,
+	0x0db2, 0x86ff, 0x11c8, 0x6020, 0x9086, 0x0006, 0x01a8, 0x0096,
+	0x6014, 0x2048, 0x080c, 0xb5fb, 0x0110, 0x080c, 0xb8e9, 0x009e,
+	0x080c, 0xbca8, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002,
+	0x080c, 0x8000, 0x080c, 0x8582, 0x9085, 0x0001, 0x0005, 0x0066,
+	0x080c, 0x1827, 0x006e, 0x08e8, 0x00e6, 0x2071, 0x19b6, 0x7024,
+	0x9c06, 0x1120, 0x080c, 0x91de, 0x00ee, 0x0898, 0x6020, 0x9084,
+	0x000f, 0x9086, 0x0006, 0x1150, 0x0086, 0x0096, 0x2049, 0x0001,
+	0x2c40, 0x080c, 0x9349, 0x009e, 0x008e, 0x0010, 0x080c, 0x90db,
+	0x00ee, 0x1904, 0xb2b9, 0x0804, 0xb27a, 0x0036, 0x00e6, 0x2071,
+	0x19b6, 0x703c, 0x9c06, 0x1138, 0x901e, 0x080c, 0x9254, 0x00ee,
+	0x003e, 0x0804, 0xb2b9, 0x080c, 0x9479, 0x00ee, 0x003e, 0x1904,
+	0xb2b9, 0x0804, 0xb27a, 0x00c6, 0x6020, 0x9084, 0x000f, 0x0013,
+	0x00ce, 0x0005, 0xb330, 0xb3df, 0xb546, 0xb33a, 0x9a06, 0xb330,
+	0xcb9f, 0xbd0e, 0xb3df, 0xb329, 0xb5c5, 0xb329, 0xb329, 0xb329,
+	0xb329, 0x080c, 0x0db2, 0x080c, 0xb7fa, 0x1110, 0x080c, 0xa364,
+	0x0005, 0x080c, 0x847d, 0x080c, 0x8582, 0x0804, 0x99d6, 0x601b,
+	0x0001, 0x0005, 0x080c, 0xb5fb, 0x0130, 0x6014, 0x0096, 0x2048,
+	0x2c00, 0xa896, 0x009e, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0db2,
+	0x0002, 0xb359, 0xb35b, 0xb37f, 0xb393, 0xb3b7, 0xb359, 0xb330,
+	0xb330, 0xb330, 0xb393, 0xb393, 0xb359, 0xb359, 0xb359, 0xb359,
+	0xb39d, 0x080c, 0x0db2, 0x00e6, 0x6014, 0x0096, 0x2048, 0xa880,
+	0xc0b5, 0xa882, 0x009e, 0x2071, 0x19b6, 0x7024, 0x9c06, 0x01a0,
+	0x080c, 0x90db, 0x080c, 0xbca8, 0x6007, 0x0085, 0x6003, 0x000b,
+	0x6023, 0x0002, 0x2001, 0x1956, 0x2004, 0x601a, 0x080c, 0x8000,
+	0x080c, 0x8582, 0x00ee, 0x0005, 0x601b, 0x0001, 0x0cd8, 0x0096,
+	0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x080c, 0xbca8,
+	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c, 0x8000,
+	0x080c, 0x8582, 0x0005, 0x0096, 0x601b, 0x0001, 0x6014, 0x2048,
+	0xa880, 0xc0b5, 0xa882, 0x009e, 0x0005, 0x080c, 0x511b, 0x01a8,
+	0x6014, 0x0096, 0x904d, 0x0180, 0xa864, 0xa867, 0x0103, 0xa87b,
+	0x0006, 0x9086, 0x0139, 0x1140, 0xa867, 0x0139, 0xa897, 0x4005,
+	0xa89b, 0x0004, 0x080c, 0x6536, 0x009e, 0x0804, 0x99d6, 0x6014,
+	0x0096, 0x904d, 0x01f8, 0xa97c, 0xd1e4, 0x01e0, 0x2001, 0x180e,
+	0x2004, 0xd0c4, 0x0110, 0x009e, 0x0005, 0xa884, 0x009e, 0x8003,
+	0x800b, 0x810b, 0x9108, 0x611a, 0x2001, 0x0037, 0x2c08, 0x080c,
+	0x14d2, 0x6000, 0x9086, 0x0004, 0x1120, 0x2009, 0x0048, 0x080c,
+	0x9a50, 0x0005, 0x009e, 0x080c, 0x1827, 0x0804, 0xb37f, 0x6000,
+	0x908a, 0x0016, 0x1a0c, 0x0db2, 0x000b, 0x0005, 0xb3f6, 0xb337,
+	0xb3f8, 0xb3f6, 0xb3f8, 0xb3f8, 0xb331, 0xb3f6, 0xb32b, 0xb32b,
+	0xb3f6, 0xb3f6, 0xb3f6, 0xb3f6, 0xb3f6, 0xb3f6, 0x080c, 0x0db2,
+	0x6010, 0x00b6, 0x2058, 0xb804, 0x9084, 0x00ff, 0x00be, 0x908a,
+	0x000c, 0x1a0c, 0x0db2, 0x00b6, 0x0013, 0x00be, 0x0005, 0xb413,
+	0xb4e0, 0xb415, 0xb455, 0xb415, 0xb455, 0xb415, 0xb423, 0xb413,
+	0xb455, 0xb413, 0xb444, 0x080c, 0x0db2, 0x6004, 0x908e, 0x0016,
+	0x05c0, 0x908e, 0x0004, 0x05a8, 0x908e, 0x0002, 0x0590, 0x908e,
+	0x0052, 0x0904, 0xb4dc, 0x6004, 0x080c, 0xb7fa, 0x0904, 0xb4f9,
+	0x908e, 0x0004, 0x1110, 0x080c, 0x2e55, 0x908e, 0x0021, 0x0904,
+	0xb4fd, 0x908e, 0x0022, 0x0904, 0xb541, 0x908e, 0x003d, 0x0904,
+	0xb4fd, 0x908e, 0x0039, 0x0904, 0xb501, 0x908e, 0x0035, 0x0904,
+	0xb501, 0x908e, 0x001e, 0x0178, 0x908e, 0x0001, 0x1140, 0x6010,
+	0x2058, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x0110, 0x080c,
+	0x2e30, 0x080c, 0xa364, 0x0804, 0x9a06, 0x00c6, 0x00d6, 0x6104,
+	0x9186, 0x0016, 0x0904, 0xb4cd, 0x9186, 0x0002, 0x1904, 0xb4a2,
+	0x2001, 0x1835, 0x2004, 0xd08c, 0x11c8, 0x080c, 0x6c53, 0x11b0,
+	0x080c, 0xbcec, 0x0138, 0x080c, 0x6c76, 0x1120, 0x080c, 0x6b68,
+	0x0804, 0xb52a, 0x2001, 0x194e, 0x2003, 0x0001, 0x2001, 0x1800,
+	0x2003, 0x0001, 0x080c, 0x6b8a, 0x0804, 0xb52a, 0x6010, 0x2058,
+	0x2001, 0x1835, 0x2004, 0xd0ac, 0x1904, 0xb52a, 0xb8a0, 0x9084,
+	0xff80, 0x1904, 0xb52a, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0190,
+	0x8001, 0xb842, 0x6017, 0x0000, 0x6023, 0x0007, 0x601b, 0x0398,
+	0x6043, 0x0000, 0x080c, 0x9980, 0x0128, 0x2b00, 0x6012, 0x6023,
+	0x0001, 0x0458, 0x00de, 0x00ce, 0x6004, 0x908e, 0x0002, 0x11a0,
+	0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1170, 0x2009, 0x1835,
+	0x2104, 0xc085, 0x200a, 0x00e6, 0x2071, 0x1800, 0x080c, 0x59b4,
+	0x00ee, 0x080c, 0xa364, 0x0030, 0x080c, 0xa364, 0x080c, 0x2e30,
+	0x080c, 0xbd01, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x2e55,
+	0x012e, 0x00ee, 0x080c, 0x9a06, 0x0005, 0x2001, 0x0002, 0x080c,
+	0x5ecf, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8048, 0x080c,
+	0x8582, 0x00de, 0x00ce, 0x0c80, 0x080c, 0x2e55, 0x0804, 0xb451,
+	0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0d38, 0x6010, 0x2058,
+	0xb840, 0x9084, 0x00ff, 0x9005, 0x0904, 0xb4a2, 0x8001, 0xb842,
+	0x6003, 0x0001, 0x080c, 0x8048, 0x080c, 0x8582, 0x00de, 0x00ce,
+	0x0898, 0x080c, 0xa364, 0x0804, 0xb453, 0x080c, 0xa3a0, 0x0804,
+	0xb453, 0x00d6, 0x2c68, 0x6104, 0x080c, 0xbc66, 0x00de, 0x0118,
+	0x080c, 0x99d6, 0x00f0, 0x6004, 0x8007, 0x6134, 0x918c, 0x00ff,
+	0x9105, 0x6036, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002,
+	0x603c, 0x600a, 0x2001, 0x1956, 0x2004, 0x601a, 0x602c, 0x2c08,
+	0x2060, 0x6024, 0xc0b5, 0x6026, 0x2160, 0x080c, 0x8000, 0x080c,
+	0x8582, 0x0005, 0x00de, 0x00ce, 0x080c, 0xa364, 0x080c, 0x2e30,
+	0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x2e55, 0x6017, 0x0000,
+	0x6023, 0x0007, 0x601b, 0x0398, 0x6043, 0x0000, 0x012e, 0x00ee,
+	0x0005, 0x080c, 0x9e03, 0x1904, 0xb4f9, 0x0005, 0x6000, 0x908a,
+	0x0016, 0x1a0c, 0x0db2, 0x0096, 0x00d6, 0x001b, 0x00de, 0x009e,
+	0x0005, 0xb561, 0xb561, 0xb561, 0xb561, 0xb561, 0xb561, 0xb561,
+	0xb561, 0xb561, 0xb330, 0xb561, 0xb337, 0xb563, 0xb337, 0xb570,
+	0xb561, 0x080c, 0x0db2, 0x6004, 0x9086, 0x008b, 0x0148, 0x6007,
+	0x008b, 0x6003, 0x000d, 0x080c, 0x8000, 0x080c, 0x8582, 0x0005,
+	0x080c, 0xbce0, 0x0118, 0x080c, 0xbcf3, 0x0010, 0x080c, 0xbd01,
+	0x080c, 0xb7dd, 0x080c, 0xb5fb, 0x0570, 0x080c, 0x2e30, 0x080c,
+	0xb5fb, 0x0168, 0x6014, 0x2048, 0xa867, 0x0103, 0xa87b, 0x0006,
+	0xa877, 0x0000, 0xa880, 0xc0ed, 0xa882, 0x080c, 0x6536, 0x2c68,
+	0x080c, 0x9980, 0x0150, 0x6810, 0x6012, 0x080c, 0xba69, 0x00c6,
+	0x2d60, 0x080c, 0x9a06, 0x00ce, 0x0008, 0x2d60, 0x6017, 0x0000,
+	0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x8048,
+	0x080c, 0x8582, 0x00c8, 0x080c, 0xbce0, 0x0138, 0x6034, 0x9086,
+	0x4000, 0x1118, 0x080c, 0x2e30, 0x08d0, 0x6034, 0x908c, 0xff00,
+	0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x080c,
+	0x2e30, 0x0868, 0x080c, 0x9a06, 0x0005, 0x6000, 0x908a, 0x0016,
+	0x1a0c, 0x0db2, 0x0002, 0xb5db, 0xb5db, 0xb5dd, 0xb5dd, 0xb5dd,
+	0xb5db, 0xb5db, 0x9a06, 0xb5db, 0xb5db, 0xb5db, 0xb5db, 0xb5db,
+	0xb5db, 0xb5db, 0xb5db, 0x080c, 0x0db2, 0x080c, 0x9479, 0x6114,
+	0x0096, 0x2148, 0xa87b, 0x0006, 0x080c, 0x6536, 0x009e, 0x0804,
+	0x99d6, 0x9284, 0x0007, 0x1158, 0x9282, 0x1cd0, 0x0240, 0x2001,
+	0x1818, 0x2004, 0x9202, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006,
+	0x0ce8, 0x0096, 0x0028, 0x0096, 0x0006, 0x6014, 0x2048, 0x000e,
+	0x0006, 0x9984, 0xf000, 0x9086, 0xf000, 0x0110, 0x080c, 0x1080,
+	0x000e, 0x009e, 0x0005, 0x00e6, 0x00c6, 0x0036, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x2061, 0x1cd0, 0x2071, 0x1800, 0x734c, 0x706c,
+	0x9302, 0x1640, 0x6020, 0x9206, 0x11f8, 0x080c, 0xbcec, 0x0180,
+	0x9286, 0x0001, 0x1168, 0x6004, 0x9086, 0x0004, 0x1148, 0x080c,
+	0x2e30, 0x080c, 0xbd01, 0x00c6, 0x080c, 0x9a06, 0x00ce, 0x0060,
+	0x080c, 0xb9e3, 0x0148, 0x080c, 0xb7fa, 0x1110, 0x080c, 0xa364,
+	0x00c6, 0x080c, 0x99d6, 0x00ce, 0x9ce0, 0x0018, 0x7060, 0x9c02,
+	0x1208, 0x08a0, 0x012e, 0x000e, 0x003e, 0x00ce, 0x00ee, 0x0005,
+	0x00e6, 0x00c6, 0x0016, 0x9188, 0x1000, 0x210c, 0x81ff, 0x0128,
+	0x2061, 0x1a73, 0x6112, 0x080c, 0x2e30, 0x9006, 0x0010, 0x9085,
+	0x0001, 0x001e, 0x00ce, 0x00ee, 0x0005, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x9980, 0x01d8, 0x080c, 0x511b, 0x0110, 0x662e,
+	0x0008, 0x6616, 0x2b00, 0x6012, 0x080c, 0x511b, 0x0118, 0x080c,
+	0xb721, 0x0168, 0x080c, 0xba69, 0x6023, 0x0003, 0x2009, 0x004b,
+	0x080c, 0x9a50, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006,
+	0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0xbaa0, 0x080c, 0x9a23,
+	0x0590, 0x080c, 0x511b, 0x0118, 0x602f, 0x0000, 0x0010, 0x6017,
+	0x0000, 0x2b00, 0x6012, 0x080c, 0xba69, 0x6023, 0x0003, 0x0016,
+	0x080c, 0x8180, 0x0076, 0x903e, 0x080c, 0x8078, 0x2c08, 0x080c,
+	0xcd62, 0x007e, 0x001e, 0xd184, 0x0128, 0x080c, 0x99d6, 0x9085,
+	0x0001, 0x0070, 0x080c, 0x511b, 0x0128, 0xd18c, 0x1170, 0x080c,
+	0xb721, 0x0148, 0x2009, 0x004c, 0x080c, 0x9a50, 0x9085, 0x0001,
+	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2900, 0x6016, 0x0c90,
+	0x2009, 0x004d, 0x0010, 0x2009, 0x004e, 0x00f6, 0x00c6, 0x0046,
+	0x0016, 0x080c, 0x9980, 0x2c78, 0x01d8, 0x080c, 0x511b, 0x0110,
+	0x7e2e, 0x0008, 0x7e16, 0x2b00, 0x7812, 0x7823, 0x0003, 0x2021,
+	0x0005, 0x080c, 0xb733, 0x2f60, 0x080c, 0x511b, 0x0118, 0x080c,
+	0xb721, 0x0130, 0x001e, 0x0016, 0x080c, 0x9a50, 0x9085, 0x0001,
+	0x001e, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x00f6, 0x00c6, 0x0046,
+	0x080c, 0x9980, 0x2c78, 0x0530, 0x080c, 0x511b, 0x0110, 0x7e2e,
+	0x0008, 0x7e16, 0x2b00, 0x7812, 0x7823, 0x0003, 0x0096, 0x2021,
+	0x0004, 0x0489, 0x009e, 0x2001, 0x194f, 0x200c, 0xd1fc, 0x0120,
+	0x2f60, 0x080c, 0x99d6, 0x0060, 0x2f60, 0x080c, 0x511b, 0x0120,
+	0xd18c, 0x1160, 0x0071, 0x0130, 0x2009, 0x0052, 0x080c, 0x9a50,
+	0x9085, 0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x2900, 0x7816,
+	0x0c98, 0x00c6, 0x080c, 0x4612, 0x00ce, 0x1120, 0x080c, 0x99d6,
+	0x9006, 0x0005, 0xa867, 0x0000, 0xa86b, 0x8000, 0x2900, 0x6016,
+	0x9085, 0x0001, 0x0005, 0x0096, 0x0076, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x60b2, 0x0158, 0x2001, 0xb738, 0x0006, 0x900e, 0x2400,
+	0x080c, 0x6770, 0x080c, 0x6536, 0x000e, 0x0807, 0x2418, 0x080c,
+	0x8417, 0xbaa0, 0x0086, 0x2041, 0x0001, 0x2039, 0x0001, 0x2608,
+	0x080c, 0x8198, 0x008e, 0x080c, 0x8078, 0x2f08, 0x2648, 0x080c,
+	0xcd62, 0xb93c, 0x81ff, 0x090c, 0x8269, 0x080c, 0x8582, 0x012e,
+	0x007e, 0x009e, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x9980, 0x0190, 0x660a, 0x2b08, 0x6112, 0x080c, 0xba69, 0x6023,
+	0x0001, 0x2900, 0x6016, 0x2009, 0x001f, 0x080c, 0x9a50, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x9a23, 0x01b8, 0x660a, 0x2b08, 0x6112,
+	0x080c, 0xba69, 0x6023, 0x0008, 0x2900, 0x6016, 0x00f6, 0x2c78,
+	0x080c, 0x1582, 0x00fe, 0x2009, 0x0021, 0x080c, 0x9a50, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009, 0x003d,
+	0x00c6, 0x0126, 0x0016, 0x2091, 0x8000, 0x080c, 0x9980, 0x0198,
+	0x660a, 0x2b08, 0x6112, 0x080c, 0xba69, 0x6023, 0x0001, 0x2900,
+	0x6016, 0x001e, 0x0016, 0x080c, 0x9a50, 0x9085, 0x0001, 0x001e,
+	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd0, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x9a23, 0x0188, 0x2b08, 0x6112, 0x080c, 0xba69,
+	0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x0000, 0x080c, 0x9a50,
+	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009,
+	0x0044, 0x0830, 0x2009, 0x0049, 0x0818, 0x0026, 0x00b6, 0x6210,
+	0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be, 0x002e,
+	0x0005, 0x0006, 0x0016, 0x6004, 0x908e, 0x0002, 0x0140, 0x908e,
+	0x0003, 0x0128, 0x908e, 0x0004, 0x0110, 0x9085, 0x0001, 0x001e,
+	0x000e, 0x0005, 0x0006, 0x0096, 0x6020, 0x9086, 0x0004, 0x0190,
+	0x6014, 0x904d, 0x080c, 0xb5fb, 0x0168, 0xa864, 0x9086, 0x0139,
+	0x0158, 0x6020, 0x9086, 0x0003, 0x0128, 0xa868, 0xd0fc, 0x0110,
+	0x9006, 0x0010, 0x9085, 0x0001, 0x009e, 0x000e, 0x0005, 0x00c6,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x9a23, 0x0198, 0x2b08, 0x6112,
+	0x080c, 0xba69, 0x6023, 0x0001, 0x2900, 0x6016, 0x080c, 0x2e30,
+	0x2009, 0x0028, 0x080c, 0x9a50, 0x9085, 0x0001, 0x012e, 0x00ce,
+	0x0005, 0x9006, 0x0cd8, 0x9186, 0x0015, 0x11a8, 0x2011, 0x1822,
+	0x2204, 0x9086, 0x0074, 0x1178, 0x00b6, 0x080c, 0xa5aa, 0x00be,
+	0x080c, 0xa7a4, 0x6003, 0x0001, 0x6007, 0x0029, 0x080c, 0x8048,
+	0x080c, 0x8582, 0x0078, 0x6014, 0x0096, 0x2048, 0xa868, 0x009e,
+	0xd0fc, 0x0148, 0x2001, 0x0001, 0x080c, 0xbc27, 0x080c, 0xa364,
+	0x080c, 0x99d6, 0x0005, 0x0096, 0x6014, 0x904d, 0x090c, 0x0db2,
+	0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004,
+	0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c, 0x6536, 0x012e,
+	0x009e, 0x080c, 0x99d6, 0x0c30, 0x0096, 0x9186, 0x0016, 0x1128,
+	0x2001, 0x0004, 0x080c, 0x5ecf, 0x00e8, 0x9186, 0x0015, 0x1510,
+	0x2011, 0x1822, 0x2204, 0x9086, 0x0014, 0x11e0, 0x6010, 0x00b6,
+	0x2058, 0x080c, 0x6019, 0x00be, 0x080c, 0xa875, 0x1198, 0x6010,
+	0x00b6, 0x2058, 0xb890, 0x00be, 0x9005, 0x0160, 0x2001, 0x0006,
+	0x080c, 0x5ecf, 0x6014, 0x2048, 0xa868, 0xd0fc, 0x0170, 0x080c,
+	0x9dd7, 0x0048, 0x6014, 0x2048, 0xa868, 0xd0fc, 0x0528, 0x080c,
+	0xa364, 0x080c, 0x99d6, 0x009e, 0x0005, 0x6014, 0x6310, 0x2358,
+	0x904d, 0x090c, 0x0db2, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897,
+	0x4000, 0x900e, 0x080c, 0x619e, 0x1108, 0xc185, 0xb800, 0xd0bc,
+	0x0108, 0xc18d, 0xa99a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6536,
+	0x012e, 0x080c, 0x99d6, 0x08f8, 0x6014, 0x904d, 0x090c, 0x0db2,
+	0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004,
+	0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c, 0x6536, 0x012e,
+	0x080c, 0x99d6, 0x0840, 0xa878, 0x9086, 0x0005, 0x1108, 0x0009,
+	0x0005, 0xa880, 0xc0ad, 0xa882, 0x0005, 0x6043, 0x0000, 0x6017,
+	0x0000, 0x6003, 0x0001, 0x6007, 0x0050, 0x080c, 0x8000, 0x080c,
+	0x8582, 0x0005, 0x00c6, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x0120, 0x6020, 0x9084, 0x000f, 0x0013, 0x00ce, 0x0005,
+	0xb330, 0xb919, 0xb919, 0xb91c, 0xd030, 0xd04b, 0xd04e, 0xb330,
+	0xb330, 0xb330, 0xb330, 0xb330, 0xb330, 0xb330, 0xb330, 0x080c,
+	0x0db2, 0xa001, 0xa001, 0x0005, 0x0096, 0x6014, 0x904d, 0x0118,
+	0xa87c, 0xd0e4, 0x1110, 0x009e, 0x0010, 0x009e, 0x0005, 0x6010,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0550, 0x2001, 0x1832,
+	0x2004, 0x9005, 0x1540, 0x00f6, 0x2c78, 0x080c, 0x9980, 0x0508,
+	0x7810, 0x6012, 0x080c, 0xba69, 0x7820, 0x9086, 0x0003, 0x0128,
+	0x7808, 0x603a, 0x2f00, 0x603e, 0x0020, 0x7808, 0x603e, 0x2f00,
+	0x603a, 0x602e, 0x6023, 0x0001, 0x6007, 0x0035, 0x6003, 0x0001,
+	0x7954, 0x6156, 0x080c, 0x8000, 0x080c, 0x8582, 0x2f60, 0x00fe,
+	0x0005, 0x2f60, 0x00fe, 0x2001, 0x1957, 0x2004, 0x6042, 0x0005,
+	0x0016, 0x0096, 0x6814, 0x2048, 0xa87c, 0xd0e4, 0x0180, 0xc0e4,
+	0xa87e, 0xa877, 0x0000, 0xa893, 0x0000, 0xa88f, 0x0000, 0xd0cc,
+	0x0130, 0xc0cc, 0xa87e, 0xa878, 0x2048, 0x080c, 0x0f87, 0x6830,
+	0x6036, 0x908e, 0x0001, 0x0148, 0x6803, 0x0002, 0x9086, 0x0005,
+	0x0170, 0x9006, 0x602e, 0x6032, 0x00d0, 0x681c, 0xc085, 0x681e,
+	0x6803, 0x0004, 0x6824, 0xc0f4, 0x9085, 0x0c00, 0x6826, 0x6814,
+	0x2048, 0xa8ac, 0x6938, 0x9102, 0xa8b0, 0x693c, 0x9103, 0x1e48,
+	0x683c, 0x602e, 0x6838, 0x9084, 0xfffc, 0x683a, 0x6032, 0x2d00,
+	0x603a, 0x6808, 0x603e, 0x6910, 0x6112, 0x6954, 0x6156, 0x6023,
+	0x0001, 0x6007, 0x0039, 0x6003, 0x0001, 0x080c, 0x8000, 0x080c,
+	0x8582, 0x009e, 0x001e, 0x0005, 0x6024, 0xd0d4, 0x0510, 0xd0f4,
+	0x11f8, 0x6038, 0x940a, 0x603c, 0x9303, 0x0230, 0x9105, 0x0120,
+	0x6024, 0xc0d4, 0xc0f5, 0x0098, 0x643a, 0x633e, 0xac3e, 0xab42,
+	0x0046, 0x0036, 0x2400, 0xacac, 0x9402, 0xa836, 0x2300, 0xabb0,
+	0x9303, 0xa83a, 0x003e, 0x004e, 0x6024, 0xc0d4, 0x0000, 0x6026,
+	0x0005, 0xd0f4, 0x1138, 0xa83c, 0x603a, 0xa840, 0x603e, 0x6024,
+	0xc0f5, 0x6026, 0x0005, 0x0006, 0x0016, 0x6004, 0x908e, 0x0034,
+	0x01b8, 0x908e, 0x0035, 0x01a0, 0x908e, 0x0036, 0x0188, 0x908e,
+	0x0037, 0x0170, 0x908e, 0x0038, 0x0158, 0x908e, 0x0039, 0x0140,
+	0x908e, 0x003a, 0x0128, 0x908e, 0x003b, 0x0110, 0x9085, 0x0001,
+	0x001e, 0x000e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00e6,
+	0x2001, 0x1951, 0x200c, 0x8000, 0x2014, 0x2001, 0x0032, 0x080c,
+	0x7e7f, 0x2001, 0x1955, 0x82ff, 0x1110, 0x2011, 0x0014, 0x2202,
+	0x2001, 0x1953, 0x200c, 0x8000, 0x2014, 0x2071, 0x193d, 0x711a,
+	0x721e, 0x2001, 0x0064, 0x080c, 0x7e7f, 0x2001, 0x1956, 0x82ff,
+	0x1110, 0x2011, 0x0014, 0x2202, 0x2001, 0x1957, 0x9288, 0x000a,
+	0x2102, 0x2001, 0x1a55, 0x2102, 0x2001, 0x0032, 0x080c, 0x14d2,
+	0x080c, 0x6285, 0x00ee, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005,
+	0x0006, 0x0016, 0x00e6, 0x2001, 0x1955, 0x2003, 0x0028, 0x2001,
+	0x1956, 0x2003, 0x0014, 0x2071, 0x193d, 0x701b, 0x0000, 0x701f,
+	0x07d0, 0x2001, 0x1957, 0x2009, 0x001e, 0x2102, 0x2001, 0x1a55,
+	0x2102, 0x2001, 0x0032, 0x080c, 0x14d2, 0x00ee, 0x001e, 0x000e,
+	0x0005, 0x0096, 0x6058, 0x904d, 0x0110, 0x080c, 0x1007, 0x009e,
+	0x0005, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9980,
+	0x0180, 0x2b08, 0x6112, 0x0ca9, 0x6023, 0x0001, 0x2900, 0x6016,
+	0x2009, 0x0033, 0x080c, 0x9a50, 0x9085, 0x0001, 0x012e, 0x00ce,
+	0x0005, 0x9006, 0x0cd8, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800,
+	0x9186, 0x0015, 0x1500, 0x7088, 0x9086, 0x0018, 0x11e0, 0x6014,
+	0x2048, 0xaa3c, 0xd2e4, 0x1160, 0x2c78, 0x080c, 0x8772, 0x01d8,
+	0x7074, 0xaa50, 0x9206, 0x1160, 0x7078, 0xaa54, 0x9206, 0x1140,
+	0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be, 0x900e, 0x080c, 0x2e75,
+	0x080c, 0x9dd7, 0x0020, 0x080c, 0xa364, 0x080c, 0x99d6, 0x00fe,
+	0x00ee, 0x009e, 0x0005, 0x7058, 0xaa54, 0x9206, 0x0d48, 0x0c80,
+	0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9980, 0x0188, 0x2b08,
+	0x6112, 0x080c, 0xba69, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009,
+	0x004d, 0x080c, 0x9a50, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
+	0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x0016, 0x080c,
+	0x9980, 0x0180, 0x2b08, 0x6112, 0x080c, 0xba69, 0x6023, 0x0001,
+	0x2900, 0x6016, 0x001e, 0x080c, 0x9a50, 0x9085, 0x0001, 0x012e,
+	0x00ce, 0x0005, 0x001e, 0x9006, 0x0cd0, 0x0016, 0x0026, 0x0036,
+	0x0046, 0x0056, 0x0066, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800,
+	0x9186, 0x0015, 0x1568, 0x7188, 0x6014, 0x2048, 0xa814, 0x8003,
+	0x9106, 0x1530, 0x20e1, 0x0000, 0x2001, 0x196f, 0x2003, 0x0000,
+	0x6014, 0x2048, 0xa830, 0x20a8, 0x8906, 0x8006, 0x8007, 0x9094,
+	0x003f, 0x22e8, 0x9084, 0xffc0, 0x9080, 0x001b, 0x20a0, 0x2001,
+	0x196f, 0x0016, 0x200c, 0x080c, 0xc29a, 0x001e, 0xa804, 0x9005,
+	0x0110, 0x2048, 0x0c38, 0x6014, 0x2048, 0xa867, 0x0103, 0x0010,
+	0x080c, 0xa364, 0x080c, 0x99d6, 0x00fe, 0x00ee, 0x009e, 0x006e,
+	0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x0096, 0x00e6,
+	0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x11b8, 0x7088, 0x9086,
+	0x0004, 0x1198, 0x6014, 0x2048, 0x2c78, 0x080c, 0x8772, 0x01a8,
+	0x7074, 0xaa74, 0x9206, 0x1130, 0x7078, 0xaa78, 0x9206, 0x1110,
+	0x080c, 0x2e30, 0x080c, 0x9dd7, 0x0020, 0x080c, 0xa364, 0x080c,
+	0x99d6, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x7058, 0xaa78, 0x9206,
+	0x0d78, 0x0c80, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186,
+	0x0015, 0x1550, 0x7088, 0x9086, 0x0004, 0x1530, 0x6014, 0x2048,
+	0x2c78, 0x080c, 0x8772, 0x05e8, 0x7074, 0xaacc, 0x9206, 0x1180,
+	0x7078, 0xaad0, 0x9206, 0x1160, 0x080c, 0x2e30, 0x0016, 0xa998,
+	0xaab0, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x50cb, 0x001e, 0x0010,
+	0x080c, 0x4ebc, 0x080c, 0xb5fb, 0x0500, 0xa87b, 0x0000, 0xa883,
+	0x0000, 0xa897, 0x4000, 0x0078, 0x080c, 0x4ebc, 0x080c, 0xb5fb,
+	0x01a0, 0x6014, 0x2048, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897,
+	0x4005, 0xa89b, 0x0004, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139,
+	0x080c, 0x6536, 0x012e, 0x080c, 0x99d6, 0x00fe, 0x00ee, 0x009e,
+	0x0005, 0x7058, 0xaad0, 0x9206, 0x0938, 0x0890, 0x0016, 0x0026,
+	0xa87c, 0xd0ac, 0x0178, 0xa938, 0xaa34, 0x2100, 0x9205, 0x0150,
+	0xa890, 0x9106, 0x1118, 0xa88c, 0x9206, 0x0120, 0xa992, 0xaa8e,
+	0x9085, 0x0001, 0x002e, 0x001e, 0x0005, 0x00b6, 0x00d6, 0x0036,
+	0x080c, 0xb5fb, 0x0904, 0xbc23, 0x0096, 0x6314, 0x2348, 0xa87a,
+	0xa982, 0x929e, 0x4000, 0x1580, 0x6310, 0x00c6, 0x2358, 0x2009,
+	0x0000, 0xa868, 0xd0f4, 0x1140, 0x080c, 0x619e, 0x1108, 0xc185,
+	0xb800, 0xd0bc, 0x0108, 0xc18d, 0xaa96, 0xa99a, 0x20a9, 0x0004,
+	0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0, 0xb8b4, 0x20e0,
+	0xb8b8, 0x9080, 0x0006, 0x2098, 0x080c, 0x0f52, 0x20a9, 0x0004,
+	0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8b8, 0x9080, 0x000a, 0x2098,
+	0x080c, 0x0f52, 0x00ce, 0x0090, 0xaa96, 0x3918, 0x9398, 0x0007,
+	0x231c, 0x6004, 0x9086, 0x0016, 0x0110, 0xa89b, 0x0004, 0xaba2,
+	0x6310, 0x2358, 0xb804, 0x9084, 0x00ff, 0xa89e, 0x080c, 0x6529,
+	0x6017, 0x0000, 0x009e, 0x003e, 0x00de, 0x00be, 0x0005, 0x0026,
+	0x0036, 0x0046, 0x00b6, 0x0096, 0x00f6, 0x6214, 0x2248, 0x6210,
+	0x2258, 0x2079, 0x0260, 0x9096, 0x0000, 0x11a0, 0xb814, 0x9084,
+	0x00ff, 0x900e, 0x080c, 0x24d6, 0x2118, 0x831f, 0x939c, 0xff00,
+	0x7838, 0x9084, 0x00ff, 0x931d, 0x7c3c, 0x2011, 0x8018, 0x080c,
+	0x4672, 0x00a8, 0x9096, 0x0001, 0x1148, 0x89ff, 0x0180, 0xa89b,
+	0x000d, 0x7838, 0xa8a6, 0x783c, 0xa8aa, 0x0048, 0x9096, 0x0002,
+	0x1130, 0xa89b, 0x000d, 0x7838, 0xa8a6, 0x783c, 0xa8aa, 0x00fe,
+	0x009e, 0x00be, 0x004e, 0x003e, 0x002e, 0x0005, 0x00c6, 0x0026,
+	0x0016, 0x9186, 0x0035, 0x0110, 0x6a38, 0x0008, 0x6a2c, 0x080c,
+	0xb5e9, 0x01f0, 0x2260, 0x6120, 0x9186, 0x0003, 0x0118, 0x9186,
+	0x0006, 0x1190, 0x6838, 0x9206, 0x0140, 0x683c, 0x9206, 0x1160,
+	0x6108, 0x6838, 0x9106, 0x1140, 0x0020, 0x6008, 0x693c, 0x9106,
+	0x1118, 0x6010, 0x6910, 0x9106, 0x001e, 0x002e, 0x00ce, 0x0005,
+	0x9085, 0x0001, 0x0cc8, 0xa974, 0xd1cc, 0x0188, 0x918c, 0x00ff,
+	0x918e, 0x0002, 0x1160, 0xa9a8, 0x918c, 0x0f00, 0x810f, 0x918e,
+	0x0001, 0x1128, 0xa834, 0xa938, 0x9115, 0x190c, 0xad37, 0x0005,
+	0x0036, 0x2019, 0x0001, 0x0010, 0x0036, 0x901e, 0x0489, 0x01d0,
+	0x080c, 0xb5fb, 0x01b8, 0x6037, 0x4000, 0x6014, 0x6017, 0x0000,
+	0x0096, 0x2048, 0xa87c, 0x080c, 0xb7fa, 0x1118, 0x080c, 0xa364,
+	0x0040, 0xa867, 0x0103, 0xa877, 0x0000, 0x83ff, 0x1129, 0x080c,
+	0x6536, 0x009e, 0x003e, 0x0005, 0xa880, 0xd0b4, 0x0128, 0xa87b,
+	0x0006, 0xc0ec, 0xa882, 0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002,
+	0x0020, 0xa87b, 0x0005, 0x080c, 0xb8e9, 0xa877, 0x0000, 0x0005,
+	0x2001, 0x180f, 0x2004, 0xd0ec, 0x0005, 0x0006, 0x2001, 0x180f,
+	0x2004, 0xd0f4, 0x000e, 0x0005, 0x0006, 0x2001, 0x180f, 0x2004,
+	0xd0e4, 0x000e, 0x0005, 0x0036, 0x0046, 0x6010, 0x00b6, 0x2058,
+	0xbba0, 0x00be, 0x2021, 0x0007, 0x080c, 0x4829, 0x004e, 0x003e,
+	0x0005, 0x0c51, 0x1d81, 0x0005, 0x2001, 0x1955, 0x2004, 0x601a,
+	0x0005, 0x2001, 0x1957, 0x2004, 0x6042, 0x0005, 0x080c, 0x99d6,
+	0x0804, 0x8582, 0x00b6, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c,
+	0x0db2, 0x001b, 0x006e, 0x00be, 0x0005, 0xbd2d, 0xc3f7, 0xc552,
+	0xbd2d, 0xbd2d, 0xbd2d, 0xbd2d, 0xbd2d, 0xbd64, 0xc5d0, 0xbd2d,
+	0xbd2d, 0xbd2d, 0xbd2d, 0xbd2d, 0xbd2d, 0x080c, 0x0db2, 0x0066,
+	0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0db2, 0x0013, 0x006e, 0x0005,
+	0xbd48, 0xcb38, 0xbd48, 0xbd48, 0xbd48, 0xbd48, 0xbd48, 0xbd48,
+	0xcae5, 0xcb8c, 0xbd48, 0xd16d, 0xd1a3, 0xd16d, 0xd1a3, 0xbd48,
+	0x080c, 0x0db2, 0x6000, 0x9082, 0x0016, 0x1a0c, 0x0db2, 0x6000,
+	0x000a, 0x0005, 0xbd62, 0xc7ad, 0xc89d, 0xc8bf, 0xc97e, 0xbd62,
+	0xca5c, 0xca06, 0xc5dc, 0xcabb, 0xcad0, 0xbd62, 0xbd62, 0xbd62,
+	0xbd62, 0xbd62, 0x080c, 0x0db2, 0x91b2, 0x0053, 0x1a0c, 0x0db2,
+	0x2100, 0x91b2, 0x0040, 0x1a04, 0xc19a, 0x0002, 0xbdae, 0xbf8b,
+	0xbdae, 0xbdae, 0xbdae, 0xbf94, 0xbdae, 0xbdae, 0xbdae, 0xbdae,
+	0xbdae, 0xbdae, 0xbdae, 0xbdae, 0xbdae, 0xbdae, 0xbdae, 0xbdae,
+	0xbdae, 0xbdae, 0xbdae, 0xbdae, 0xbdae, 0xbdb0, 0xbe06, 0xbe15,
+	0xbe79, 0xbea4, 0xbf1d, 0xbf76, 0xbdae, 0xbdae, 0xbf97, 0xbdae,
+	0xbdae, 0xbfac, 0xbfb9, 0xbdae, 0xbdae, 0xbdae, 0xbdae, 0xbdae,
+	0xc03c, 0xbdae, 0xbdae, 0xc050, 0xbdae, 0xbdae, 0xc00b, 0xbdae,
+	0xbdae, 0xbdae, 0xc068, 0xbdae, 0xbdae, 0xbdae, 0xc0e5, 0xbdae,
+	0xbdae, 0xbdae, 0xbdae, 0xbdae, 0xbdae, 0xc162, 0x080c, 0x0db2,
+	0x080c, 0x6262, 0x1150, 0x2001, 0x1835, 0x2004, 0xd0cc, 0x1128,
+	0x9084, 0x0009, 0x9086, 0x0008, 0x1140, 0x6007, 0x0009, 0x602f,
+	0x0009, 0x6017, 0x0000, 0x0804, 0xbf84, 0x080c, 0x624b, 0x00e6,
+	0x00c6, 0x0036, 0x0026, 0x0016, 0x6210, 0x2258, 0xbaa0, 0x0026,
+	0x2019, 0x0029, 0x080c, 0x8180, 0x0076, 0x903e, 0x080c, 0x8078,
+	0x2c08, 0x080c, 0xcd62, 0x007e, 0x001e, 0x001e, 0x002e, 0x003e,
+	0x00ce, 0x00ee, 0x6610, 0x2658, 0x080c, 0x5f8d, 0xbe04, 0x9684,
+	0x00ff, 0x9082, 0x0006, 0x0278, 0x080c, 0xcc94, 0x1904, 0xbe71,
+	0x080c, 0xcc30, 0x1120, 0x6007, 0x0008, 0x0804, 0xbf84, 0x6007,
+	0x0009, 0x0804, 0xbf84, 0x080c, 0xce81, 0x0128, 0x080c, 0xcc94,
+	0x0d78, 0x0804, 0xbe71, 0x6017, 0x1900, 0x0c88, 0x080c, 0x2f50,
+	0x1904, 0xc197, 0x6106, 0x080c, 0xcbe7, 0x6007, 0x0006, 0x0804,
+	0xbf84, 0x6007, 0x0007, 0x0804, 0xbf84, 0x080c, 0xd1df, 0x1904,
+	0xc197, 0x080c, 0x2f50, 0x1904, 0xc197, 0x00d6, 0x6610, 0x2658,
+	0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x1220, 0x2001, 0x0001,
+	0x080c, 0x5ebb, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0188,
+	0x9686, 0x0004, 0x0170, 0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006,
+	0x0140, 0x9686, 0x0004, 0x0128, 0x9686, 0x0005, 0x0110, 0x00de,
+	0x0480, 0x00e6, 0x2071, 0x0260, 0x7034, 0x9084, 0x0003, 0x1140,
+	0x7034, 0x9082, 0x0014, 0x0220, 0x7030, 0x9084, 0x0003, 0x0130,
+	0x00ee, 0x6017, 0x0000, 0x602f, 0x0007, 0x00b0, 0x00ee, 0x080c,
+	0xccf8, 0x1190, 0x9686, 0x0006, 0x1140, 0x0026, 0x6210, 0x2258,
+	0xbaa0, 0x900e, 0x080c, 0x2e75, 0x002e, 0x080c, 0x6019, 0x6007,
+	0x000a, 0x00de, 0x0804, 0xbf84, 0x6007, 0x000b, 0x00de, 0x0804,
+	0xbf84, 0x080c, 0x2e30, 0x080c, 0xbd01, 0x6007, 0x0001, 0x0804,
+	0xbf84, 0x080c, 0xd1df, 0x1904, 0xc197, 0x080c, 0x2f50, 0x1904,
+	0xc197, 0x2071, 0x0260, 0x7034, 0x90b4, 0x0003, 0x1948, 0x90b2,
+	0x0014, 0x0a30, 0x7030, 0x9084, 0x0003, 0x1910, 0x6610, 0x2658,
+	0xbe04, 0x9686, 0x0707, 0x09e8, 0x0026, 0x6210, 0x2258, 0xbaa0,
+	0x900e, 0x080c, 0x2e75, 0x002e, 0x6007, 0x000c, 0x2001, 0x0001,
+	0x080c, 0xd2fb, 0x0804, 0xbf84, 0x080c, 0x6262, 0x1140, 0x2001,
+	0x1835, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008, 0x1110, 0x0804,
+	0xbdbd, 0x080c, 0x624b, 0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff,
+	0x9082, 0x0006, 0x06c8, 0x1138, 0x0026, 0x2001, 0x0006, 0x080c,
+	0x5efb, 0x002e, 0x0050, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0004,
+	0x0120, 0x9686, 0x0006, 0x1904, 0xbe71, 0x080c, 0xcd05, 0x1120,
+	0x6007, 0x000e, 0x0804, 0xbf84, 0x0046, 0x6410, 0x2458, 0xbca0,
+	0x0046, 0x080c, 0x2e30, 0x080c, 0xbd01, 0x004e, 0x0016, 0x9006,
+	0x2009, 0x1854, 0x210c, 0xd1a4, 0x0148, 0x2009, 0x0029, 0x080c,
+	0xcfe6, 0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802, 0x001e, 0x004e,
+	0x6007, 0x0001, 0x0804, 0xbf84, 0x2001, 0x0001, 0x080c, 0x5ebb,
+	0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805,
+	0x2011, 0x0270, 0x080c, 0xa909, 0x003e, 0x002e, 0x001e, 0x015e,
+	0x9005, 0x0168, 0x96b4, 0xff00, 0x8637, 0x9682, 0x0004, 0x0a04,
+	0xbe71, 0x9682, 0x0007, 0x0a04, 0xbecd, 0x0804, 0xbe71, 0x6017,
+	0x1900, 0x6007, 0x0009, 0x0804, 0xbf84, 0x080c, 0x6262, 0x1140,
+	0x2001, 0x1835, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008, 0x1110,
+	0x0804, 0xbdbd, 0x080c, 0x624b, 0x6610, 0x2658, 0xbe04, 0x9684,
+	0x00ff, 0x9082, 0x0006, 0x0690, 0x96b4, 0xff00, 0x8637, 0x9686,
+	0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xbe71, 0x080c, 0xcd33,
+	0x1130, 0x080c, 0xcc30, 0x1118, 0x6007, 0x0010, 0x04e8, 0x0046,
+	0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x2e30, 0x080c, 0xbd01,
+	0x004e, 0x0016, 0x9006, 0x2009, 0x1854, 0x210c, 0xd1a4, 0x0148,
+	0x2009, 0x0029, 0x080c, 0xcfe6, 0x6010, 0x2058, 0xb800, 0xc0e5,
+	0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x00f0, 0x080c, 0xce81,
+	0x0140, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0978, 0x0804,
+	0xbe71, 0x6017, 0x1900, 0x6007, 0x0009, 0x0070, 0x080c, 0x2f50,
+	0x1904, 0xc197, 0x080c, 0xd1df, 0x1904, 0xc197, 0x080c, 0xc335,
+	0x1904, 0xbe71, 0x6007, 0x0012, 0x6003, 0x0001, 0x080c, 0x8048,
+	0x080c, 0x8582, 0x0005, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c,
+	0x8048, 0x080c, 0x8582, 0x0cb0, 0x6007, 0x0005, 0x0c68, 0x080c,
+	0xd1df, 0x1904, 0xc197, 0x080c, 0x2f50, 0x1904, 0xc197, 0x080c,
+	0xc335, 0x1904, 0xbe71, 0x6007, 0x0020, 0x6003, 0x0001, 0x080c,
+	0x8048, 0x080c, 0x8582, 0x0005, 0x080c, 0x2f50, 0x1904, 0xc197,
+	0x6007, 0x0023, 0x6003, 0x0001, 0x080c, 0x8048, 0x080c, 0x8582,
+	0x0005, 0x080c, 0xd1df, 0x1904, 0xc197, 0x080c, 0x2f50, 0x1904,
+	0xc197, 0x080c, 0xc335, 0x1904, 0xbe71, 0x0016, 0x0026, 0x00e6,
+	0x2071, 0x0260, 0x7244, 0x9286, 0xffff, 0x0180, 0x2c08, 0x080c,
+	0xb5e9, 0x01b0, 0x2260, 0x7240, 0x6008, 0x9206, 0x1188, 0x6010,
+	0x9190, 0x0004, 0x2214, 0x9206, 0x01b8, 0x0050, 0x7240, 0x2c08,
+	0x9006, 0x080c, 0xcfb8, 0x1180, 0x7244, 0x9286, 0xffff, 0x01b0,
+	0x2160, 0x6007, 0x0026, 0x6017, 0x1700, 0x7214, 0x9296, 0xffff,
+	0x1180, 0x6007, 0x0025, 0x0068, 0x6020, 0x9086, 0x0007, 0x1d80,
+	0x6004, 0x9086, 0x0024, 0x1110, 0x080c, 0x99d6, 0x2160, 0x6007,
+	0x0025, 0x6003, 0x0001, 0x080c, 0x8048, 0x080c, 0x8582, 0x00ee,
+	0x002e, 0x001e, 0x0005, 0x2001, 0x0001, 0x080c, 0x5ebb, 0x0156,
+	0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011,
+	0x0276, 0x080c, 0xa909, 0x003e, 0x002e, 0x001e, 0x015e, 0x0120,
+	0x6007, 0x0031, 0x0804, 0xbf84, 0x080c, 0xa5c2, 0x080c, 0x6c53,
+	0x1190, 0x0006, 0x0026, 0x0036, 0x080c, 0x6c6d, 0x1138, 0x080c,
+	0x6f2a, 0x080c, 0x5a21, 0x080c, 0x6b8a, 0x0010, 0x080c, 0x6c2d,
+	0x003e, 0x002e, 0x000e, 0x0005, 0x080c, 0x2f50, 0x1904, 0xc197,
+	0x080c, 0xc335, 0x1904, 0xbe71, 0x6106, 0x080c, 0xc351, 0x1120,
+	0x6007, 0x002b, 0x0804, 0xbf84, 0x6007, 0x002c, 0x0804, 0xbf84,
+	0x080c, 0xd1df, 0x1904, 0xc197, 0x080c, 0x2f50, 0x1904, 0xc197,
+	0x080c, 0xc335, 0x1904, 0xbe71, 0x6106, 0x080c, 0xc356, 0x1120,
+	0x6007, 0x002e, 0x0804, 0xbf84, 0x6007, 0x002f, 0x0804, 0xbf84,
+	0x080c, 0x2f50, 0x1904, 0xc197, 0x00e6, 0x00d6, 0x00c6, 0x6010,
+	0x2058, 0xb904, 0x9184, 0x00ff, 0x9086, 0x0006, 0x0158, 0x9184,
+	0xff00, 0x8007, 0x9086, 0x0006, 0x0128, 0x00ce, 0x00de, 0x00ee,
+	0x0804, 0xbf8b, 0x080c, 0x5117, 0xd0e4, 0x0904, 0xc0e2, 0x2071,
+	0x026c, 0x7010, 0x603a, 0x7014, 0x603e, 0x7108, 0x720c, 0x080c,
+	0x62a0, 0x0140, 0x6010, 0x2058, 0xb810, 0x9106, 0x1118, 0xb814,
+	0x9206, 0x0510, 0x080c, 0x629c, 0x15b8, 0x2069, 0x1800, 0x6878,
+	0x9206, 0x1590, 0x6874, 0x9106, 0x1578, 0x7210, 0x080c, 0xb5e9,
+	0x0590, 0x080c, 0xc222, 0x0578, 0x080c, 0xd05d, 0x0560, 0x622e,
+	0x6007, 0x0036, 0x6003, 0x0001, 0x080c, 0x8000, 0x080c, 0x8582,
+	0x00ce, 0x00de, 0x00ee, 0x0005, 0x7214, 0x9286, 0xffff, 0x0150,
+	0x080c, 0xb5e9, 0x01c0, 0x9280, 0x0002, 0x2004, 0x7110, 0x9106,
+	0x1190, 0x08e0, 0x7210, 0x2c08, 0x9085, 0x0001, 0x080c, 0xcfb8,
+	0x2c10, 0x2160, 0x0140, 0x0890, 0x6007, 0x0037, 0x602f, 0x0009,
+	0x6017, 0x1500, 0x08b8, 0x6007, 0x0037, 0x602f, 0x0003, 0x6017,
+	0x1700, 0x0880, 0x6007, 0x0012, 0x0868, 0x080c, 0x2f50, 0x1904,
+	0xc197, 0x6010, 0x2058, 0xb804, 0x9084, 0xff00, 0x8007, 0x9086,
+	0x0006, 0x1904, 0xbf8b, 0x00e6, 0x00d6, 0x00c6, 0x080c, 0x5117,
+	0xd0e4, 0x0904, 0xc15a, 0x2069, 0x1800, 0x2071, 0x026c, 0x7008,
+	0x603a, 0x720c, 0x623e, 0x9286, 0xffff, 0x1150, 0x7208, 0x00c6,
+	0x2c08, 0x9085, 0x0001, 0x080c, 0xcfb8, 0x2c10, 0x00ce, 0x05e8,
+	0x080c, 0xb5e9, 0x05d0, 0x7108, 0x9280, 0x0002, 0x2004, 0x9106,
+	0x15a0, 0x00c6, 0x0026, 0x2260, 0x080c, 0xb244, 0x002e, 0x00ce,
+	0x7118, 0x918c, 0xff00, 0x810f, 0x9186, 0x0001, 0x0178, 0x9186,
+	0x0005, 0x0118, 0x9186, 0x0007, 0x1198, 0x9280, 0x0005, 0x2004,
+	0x9005, 0x0170, 0x080c, 0xc222, 0x0904, 0xc0db, 0x0056, 0x7510,
+	0x7614, 0x080c, 0xd076, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x0005,
+	0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00, 0x6003, 0x0001,
+	0x080c, 0x8000, 0x080c, 0x8582, 0x0c78, 0x6007, 0x003b, 0x602f,
+	0x0003, 0x6017, 0x0300, 0x6003, 0x0001, 0x080c, 0x8000, 0x080c,
+	0x8582, 0x0c10, 0x6007, 0x003b, 0x602f, 0x000b, 0x6017, 0x0000,
+	0x0804, 0xc0b2, 0x00e6, 0x0026, 0x080c, 0x6262, 0x0550, 0x080c,
+	0x624b, 0x080c, 0xd251, 0x1518, 0x2071, 0x1800, 0x70d4, 0x9085,
+	0x0003, 0x70d6, 0x00f6, 0x2079, 0x0100, 0x72a8, 0x9284, 0x00ff,
+	0x7076, 0x78e6, 0x9284, 0xff00, 0x7278, 0x9205, 0x707a, 0x78ea,
+	0x00fe, 0x70df, 0x0000, 0x080c, 0x62a0, 0x0120, 0x2011, 0x19cf,
+	0x2013, 0x07d0, 0xd0ac, 0x1128, 0x080c, 0x2c2b, 0x0010, 0x080c,
+	0xd283, 0x002e, 0x00ee, 0x080c, 0x99d6, 0x0804, 0xbf8a, 0x080c,
+	0x99d6, 0x0005, 0x2600, 0x0002, 0xc1ae, 0xc1ae, 0xc1ae, 0xc1ae,
+	0xc1ae, 0xc1b0, 0xc1ae, 0xc1ae, 0xc1ae, 0xc1ae, 0xc1cd, 0xc1ae,
+	0xc1ae, 0xc1ae, 0xc1df, 0xc1ec, 0xc21d, 0xc1ae, 0x080c, 0x0db2,
+	0x080c, 0xd1df, 0x1d20, 0x080c, 0x2f50, 0x1d08, 0x080c, 0xc335,
+	0x1148, 0x7038, 0x6016, 0x6007, 0x0045, 0x6003, 0x0001, 0x080c,
+	0x8048, 0x0005, 0x080c, 0x2e30, 0x080c, 0xbd01, 0x6007, 0x0001,
+	0x6003, 0x0001, 0x080c, 0x8048, 0x0005, 0x080c, 0xd1df, 0x1938,
+	0x080c, 0x2f50, 0x1920, 0x080c, 0xc335, 0x1d60, 0x703c, 0x6016,
+	0x6007, 0x004a, 0x6003, 0x0001, 0x080c, 0x8048, 0x0005, 0x080c,
+	0xc23d, 0x0904, 0xc197, 0x6007, 0x004e, 0x6003, 0x0001, 0x080c,
+	0x8048, 0x080c, 0x8582, 0x0005, 0x6007, 0x004f, 0x6017, 0x0000,
+	0x7134, 0x918c, 0x00ff, 0x81ff, 0x0508, 0x9186, 0x0001, 0x1160,
+	0x7140, 0x2001, 0x198c, 0x2004, 0x9106, 0x11b0, 0x7144, 0x2001,
+	0x198d, 0x2004, 0x9106, 0x0190, 0x9186, 0x0002, 0x1168, 0x2011,
+	0x0276, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x000a,
+	0x080c, 0xa91d, 0x009e, 0x0110, 0x6017, 0x0001, 0x6003, 0x0001,
+	0x080c, 0x8048, 0x080c, 0x8582, 0x0005, 0x6007, 0x0050, 0x703c,
+	0x6016, 0x0ca0, 0x00e6, 0x2071, 0x0260, 0x00b6, 0x00c6, 0x2260,
+	0x6010, 0x2058, 0xb8bc, 0xd084, 0x0150, 0x7128, 0x6048, 0x9106,
+	0x1120, 0x712c, 0x6044, 0x9106, 0x0110, 0x9006, 0x0010, 0x9085,
+	0x0001, 0x00ce, 0x00be, 0x00ee, 0x0005, 0x0016, 0x0096, 0x0086,
+	0x00e6, 0x01c6, 0x01d6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1800,
+	0x7088, 0x908a, 0x00f9, 0x16e8, 0x20e1, 0x0000, 0x2001, 0x196f,
+	0x2003, 0x0000, 0x080c, 0x0fee, 0x05a0, 0x2900, 0x6016, 0x7088,
+	0x8004, 0xa816, 0x908a, 0x001e, 0x02d0, 0xa833, 0x001e, 0x20a9,
+	0x001e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0, 0x2001,
+	0x196f, 0x0016, 0x200c, 0x0471, 0x001e, 0x2940, 0x080c, 0x0fee,
+	0x01c0, 0x2900, 0xa006, 0x2100, 0x81ff, 0x0180, 0x0c18, 0xa832,
+	0x20a8, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0, 0x2001,
+	0x196f, 0x0016, 0x200c, 0x00b1, 0x001e, 0x0000, 0x9085, 0x0001,
+	0x0048, 0x2071, 0x1800, 0x708b, 0x0000, 0x6014, 0x2048, 0x080c,
+	0x0f87, 0x9006, 0x012e, 0x01de, 0x01ce, 0x00ee, 0x008e, 0x009e,
+	0x001e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00c6, 0x918c,
+	0xffff, 0x11a8, 0x080c, 0x20b2, 0x2099, 0x026c, 0x2001, 0x0014,
+	0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x00f8, 0x20a8, 0x4003,
+	0x22a8, 0x8108, 0x080c, 0x20b2, 0x2099, 0x0260, 0x0ca8, 0x080c,
+	0x20b2, 0x2061, 0x196f, 0x6004, 0x2098, 0x6008, 0x3518, 0x9312,
+	0x1218, 0x23a8, 0x4003, 0x0048, 0x20a8, 0x4003, 0x22a8, 0x8108,
+	0x080c, 0x20b2, 0x2099, 0x0260, 0x0ca8, 0x2061, 0x196f, 0x2019,
+	0x0280, 0x3300, 0x931e, 0x0110, 0x6006, 0x0020, 0x2001, 0x0260,
+	0x6006, 0x8108, 0x2162, 0x9292, 0x0021, 0x9296, 0xffff, 0x620a,
+	0x00ce, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016,
+	0x0026, 0x0036, 0x00c6, 0x81ff, 0x11b8, 0x080c, 0x20ca, 0x20a1,
+	0x024c, 0x2001, 0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003,
+	0x0418, 0x20a8, 0x4003, 0x82ff, 0x01f8, 0x22a8, 0x8108, 0x080c,
+	0x20ca, 0x20a1, 0x0240, 0x0c98, 0x080c, 0x20ca, 0x2061, 0x1972,
+	0x6004, 0x20a0, 0x6008, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003,
+	0x0058, 0x20a8, 0x4003, 0x82ff, 0x0138, 0x22a8, 0x8108, 0x080c,
+	0x20ca, 0x20a1, 0x0240, 0x0c98, 0x2061, 0x1972, 0x2019, 0x0260,
+	0x3400, 0x931e, 0x0110, 0x6006, 0x0020, 0x2001, 0x0240, 0x6006,
+	0x8108, 0x2162, 0x9292, 0x0021, 0x9296, 0xffff, 0x620a, 0x00ce,
+	0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x00b6, 0x0066, 0x6610,
+	0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0170,
+	0x9686, 0x0004, 0x0158, 0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006,
+	0x0128, 0x9686, 0x0004, 0x0110, 0x9085, 0x0001, 0x006e, 0x00be,
+	0x0005, 0x00d6, 0x080c, 0xc3cd, 0x00de, 0x0005, 0x00d6, 0x080c,
+	0xc3da, 0x1520, 0x680c, 0x908c, 0xff00, 0x6820, 0x9084, 0x00ff,
+	0x9115, 0x6216, 0x6824, 0x602e, 0xd1e4, 0x0130, 0x9006, 0x080c,
+	0xd2fb, 0x2009, 0x0001, 0x0078, 0xd1ec, 0x0180, 0x6920, 0x918c,
+	0x00ff, 0x6824, 0x080c, 0x24d6, 0x1148, 0x2001, 0x0001, 0x080c,
+	0xd2fb, 0x2110, 0x900e, 0x080c, 0x2e75, 0x0018, 0x9085, 0x0001,
+	0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00c6, 0x080c, 0x9a23,
+	0x05a8, 0x0016, 0x0026, 0x00c6, 0x2011, 0x0263, 0x2204, 0x8211,
+	0x220c, 0x080c, 0x24d6, 0x1578, 0x080c, 0x5f1e, 0x1560, 0xbe12,
+	0xbd16, 0x00ce, 0x002e, 0x001e, 0x2b00, 0x6012, 0x080c, 0xd1df,
+	0x11d8, 0x080c, 0x2f50, 0x11c0, 0x080c, 0xc335, 0x0510, 0x2001,
+	0x0007, 0x080c, 0x5ecf, 0x2001, 0x0007, 0x080c, 0x5efb, 0x6017,
+	0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c,
+	0x8048, 0x080c, 0x8582, 0x0010, 0x080c, 0x99d6, 0x9085, 0x0001,
+	0x00ce, 0x00be, 0x0005, 0x080c, 0x99d6, 0x00ce, 0x002e, 0x001e,
+	0x0ca8, 0x080c, 0x99d6, 0x9006, 0x0c98, 0x2069, 0x026d, 0x6800,
+	0x9082, 0x0010, 0x1228, 0x6017, 0x0000, 0x9085, 0x0001, 0x0008,
+	0x9006, 0x0005, 0x6017, 0x0000, 0x2069, 0x026c, 0x6808, 0x9084,
+	0xff00, 0x9086, 0x0800, 0x1190, 0x6904, 0x9186, 0x0018, 0x0118,
+	0x9186, 0x0014, 0x1158, 0x810f, 0x6800, 0x9084, 0x00ff, 0x910d,
+	0x615a, 0x908e, 0x0014, 0x0110, 0x908e, 0x0010, 0x0005, 0x6004,
+	0x90b2, 0x0053, 0x1a0c, 0x0db2, 0x91b6, 0x0013, 0x1130, 0x2008,
+	0x91b2, 0x0040, 0x1a04, 0xc522, 0x0092, 0x91b6, 0x0027, 0x0120,
+	0x91b6, 0x0014, 0x190c, 0x0db2, 0x2001, 0x0007, 0x080c, 0x5efb,
+	0x080c, 0x847d, 0x080c, 0x9a06, 0x080c, 0x8582, 0x0005, 0xc457,
+	0xc459, 0xc457, 0xc457, 0xc457, 0xc459, 0xc468, 0xc51b, 0xc4ba,
+	0xc51b, 0xc4cc, 0xc51b, 0xc468, 0xc51b, 0xc513, 0xc51b, 0xc513,
+	0xc51b, 0xc51b, 0xc457, 0xc457, 0xc457, 0xc457, 0xc457, 0xc457,
+	0xc457, 0xc457, 0xc457, 0xc457, 0xc457, 0xc459, 0xc457, 0xc51b,
+	0xc457, 0xc457, 0xc51b, 0xc457, 0xc518, 0xc51b, 0xc457, 0xc457,
+	0xc457, 0xc457, 0xc51b, 0xc51b, 0xc457, 0xc51b, 0xc51b, 0xc457,
+	0xc463, 0xc457, 0xc457, 0xc457, 0xc457, 0xc517, 0xc51b, 0xc457,
+	0xc457, 0xc51b, 0xc51b, 0xc457, 0xc457, 0xc457, 0xc457, 0x080c,
+	0x0db2, 0x080c, 0x847d, 0x080c, 0xbd04, 0x6003, 0x0002, 0x080c,
+	0x8582, 0x0804, 0xc521, 0x9006, 0x080c, 0x5ebb, 0x0804, 0xc51b,
+	0x080c, 0x629c, 0x1904, 0xc51b, 0x9006, 0x080c, 0x5ebb, 0x6010,
+	0x2058, 0xb810, 0x9086, 0x00ff, 0x1140, 0x00f6, 0x2079, 0x1800,
+	0x78a0, 0x8000, 0x78a2, 0x00fe, 0x0428, 0x6010, 0x2058, 0xb8b0,
+	0x9005, 0x1178, 0x080c, 0xbcec, 0x1904, 0xc51b, 0x0036, 0x0046,
+	0xbba0, 0x2021, 0x0007, 0x080c, 0x4829, 0x004e, 0x003e, 0x0804,
+	0xc51b, 0x080c, 0x2f81, 0x1904, 0xc51b, 0x2001, 0x1800, 0x2004,
+	0x9086, 0x0002, 0x1138, 0x00f6, 0x2079, 0x1800, 0x78a0, 0x8000,
+	0x78a2, 0x00fe, 0x2001, 0x0002, 0x080c, 0x5ecf, 0x080c, 0x847d,
+	0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8048,
+	0x080c, 0x8582, 0x6110, 0x2158, 0x2009, 0x0001, 0x080c, 0x7c58,
+	0x0804, 0xc521, 0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0006, 0x0904, 0xc51b, 0x9686, 0x0004, 0x0904, 0xc51b,
+	0x2001, 0x0004, 0x0804, 0xc519, 0x2001, 0x1800, 0x2004, 0x9086,
+	0x0003, 0x1158, 0x0036, 0x0046, 0x6010, 0x2058, 0xbba0, 0x2021,
+	0x0006, 0x080c, 0x4829, 0x004e, 0x003e, 0x2001, 0x0006, 0x080c,
+	0xc53f, 0x6610, 0x2658, 0xbe04, 0x0066, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0006, 0x006e, 0x0168, 0x2001, 0x0006, 0x080c, 0x5efb,
+	0x9284, 0x00ff, 0x908e, 0x0007, 0x1120, 0x2001, 0x0006, 0x080c,
+	0x5ecf, 0x080c, 0x629c, 0x11f8, 0x2001, 0x1835, 0x2004, 0xd0a4,
+	0x01d0, 0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006, 0x01a0, 0x00f6,
+	0x2079, 0x1800, 0x78a0, 0x8000, 0x78a2, 0x00fe, 0x0804, 0xc4a2,
+	0x2001, 0x0004, 0x0030, 0x2001, 0x0006, 0x0449, 0x0020, 0x0018,
+	0x0010, 0x080c, 0x5efb, 0x080c, 0x847d, 0x080c, 0x99d6, 0x080c,
+	0x8582, 0x0005, 0x2600, 0x0002, 0xc536, 0xc536, 0xc536, 0xc536,
+	0xc536, 0xc538, 0xc536, 0xc536, 0xc536, 0xc536, 0xc538, 0xc536,
+	0xc536, 0xc536, 0xc538, 0xc538, 0xc538, 0xc538, 0x080c, 0x0db2,
+	0x080c, 0x847d, 0x080c, 0x99d6, 0x080c, 0x8582, 0x0005, 0x0016,
+	0x00b6, 0x00d6, 0x6110, 0x2158, 0xb900, 0xd184, 0x0138, 0x080c,
+	0x5ecf, 0x9006, 0x080c, 0x5ebb, 0x080c, 0x2e55, 0x00de, 0x00be,
+	0x001e, 0x0005, 0x6610, 0x2658, 0xb804, 0x9084, 0xff00, 0x8007,
+	0x90b2, 0x000c, 0x1a0c, 0x0db2, 0x91b6, 0x0015, 0x1110, 0x003b,
+	0x0028, 0x91b6, 0x0016, 0x190c, 0x0db2, 0x006b, 0x0005, 0xa445,
+	0xa445, 0xa445, 0xa445, 0xa445, 0xa445, 0xc5ba, 0xc57f, 0xa445,
+	0xa445, 0xa445, 0xa445, 0xa445, 0xa445, 0xa445, 0xa445, 0xa445,
+	0xa445, 0xc5ba, 0xc5c1, 0xa445, 0xa445, 0xa445, 0xa445, 0x00f6,
+	0x080c, 0x629c, 0x11d8, 0x080c, 0xbcec, 0x11c0, 0x6010, 0x905d,
+	0x01a8, 0xb8b0, 0x9005, 0x0190, 0x9006, 0x080c, 0x5ebb, 0x2001,
+	0x0002, 0x080c, 0x5ecf, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007,
+	0x0002, 0x080c, 0x8048, 0x080c, 0x8582, 0x00d0, 0x2011, 0x0263,
+	0x2204, 0x8211, 0x220c, 0x080c, 0x24d6, 0x1190, 0x080c, 0x5f7e,
+	0x0118, 0x080c, 0x99d6, 0x0060, 0xb810, 0x0006, 0xb814, 0x0006,
+	0x080c, 0x5a3b, 0x000e, 0xb816, 0x000e, 0xb812, 0x080c, 0x99d6,
+	0x00fe, 0x0005, 0x6604, 0x96b6, 0x001e, 0x1110, 0x080c, 0x99d6,
+	0x0005, 0x080c, 0xa7a1, 0x1148, 0x6003, 0x0001, 0x6007, 0x0001,
+	0x080c, 0x8048, 0x080c, 0x8582, 0x0010, 0x080c, 0x99d6, 0x0005,
+	0x6004, 0x908a, 0x0053, 0x1a0c, 0x0db2, 0x080c, 0x847d, 0x080c,
+	0x9a06, 0x080c, 0x8582, 0x0005, 0x9182, 0x0040, 0x0002, 0xc5f2,
+	0xc5f2, 0xc5f2, 0xc5f2, 0xc5f4, 0xc5f2, 0xc5f2, 0xc5f2, 0xc5f2,
+	0xc5f2, 0xc5f2, 0xc5f2, 0xc5f2, 0xc5f2, 0xc5f2, 0xc5f2, 0xc5f2,
+	0xc5f2, 0xc5f2, 0x080c, 0x0db2, 0x0096, 0x00b6, 0x00d6, 0x00e6,
+	0x00f6, 0x0046, 0x0026, 0x6210, 0x2258, 0xb8ac, 0x9005, 0x11a8,
+	0x6106, 0x2071, 0x0260, 0x7444, 0x94a4, 0xff00, 0x0904, 0xc65a,
+	0x080c, 0xd2ef, 0x1170, 0x9486, 0x2000, 0x1158, 0x2009, 0x0001,
+	0x2011, 0x0200, 0x080c, 0x7e3e, 0x0020, 0x9026, 0x080c, 0xd224,
+	0x0c38, 0x080c, 0x0fd5, 0x090c, 0x0db2, 0x6003, 0x0007, 0xa867,
+	0x010d, 0x9006, 0xa802, 0xa86a, 0xac8a, 0x2c00, 0xa88e, 0x6008,
+	0xa8e2, 0x6010, 0x2058, 0xb8a0, 0x7130, 0xa97a, 0x0016, 0xa876,
+	0xa87f, 0x0000, 0xa883, 0x0000, 0xa887, 0x0036, 0x080c, 0x6536,
+	0x001e, 0x080c, 0xd2ef, 0x1904, 0xc6ba, 0x9486, 0x2000, 0x1130,
+	0x2019, 0x0017, 0x080c, 0xcf62, 0x0804, 0xc6ba, 0x9486, 0x0200,
+	0x1120, 0x080c, 0xcefe, 0x0804, 0xc6ba, 0x9486, 0x0400, 0x0120,
+	0x9486, 0x1000, 0x1904, 0xc6ba, 0x2019, 0x0002, 0x080c, 0xcf19,
+	0x0804, 0xc6ba, 0x2069, 0x1a3e, 0x6a00, 0xd284, 0x0904, 0xc724,
+	0x9284, 0x0300, 0x1904, 0xc71d, 0x6804, 0x9005, 0x0904, 0xc705,
+	0x2d78, 0x6003, 0x0007, 0x080c, 0x0fee, 0x0904, 0xc6c6, 0x7800,
+	0xd08c, 0x1118, 0x7804, 0x8001, 0x7806, 0x6017, 0x0000, 0x2001,
+	0x180e, 0x2004, 0xd084, 0x1904, 0xc728, 0x9006, 0xa802, 0xa867,
+	0x0116, 0xa86a, 0x6008, 0xa8e2, 0x2c00, 0xa87a, 0x6010, 0x2058,
+	0xb8a0, 0x7130, 0xa9b6, 0xa876, 0xb928, 0xa9ba, 0xb92c, 0xa9be,
+	0xb930, 0xa9c2, 0xb934, 0xa9c6, 0xa883, 0x003d, 0x7044, 0x9084,
+	0x0003, 0x9080, 0xc6c2, 0x2005, 0xa87e, 0x20a9, 0x000a, 0x2001,
+	0x0270, 0xaa5c, 0x9290, 0x0021, 0x2009, 0x0205, 0x200b, 0x0080,
+	0x20e1, 0x0000, 0xab60, 0x23e8, 0x2098, 0x22a0, 0x4003, 0x200b,
+	0x0000, 0x2001, 0x027a, 0x200c, 0xa9b2, 0x8000, 0x200c, 0xa9ae,
+	0x080c, 0x6536, 0x002e, 0x004e, 0x00fe, 0x00ee, 0x00de, 0x00be,
+	0x009e, 0x0005, 0x0000, 0x0080, 0x0040, 0x0000, 0x2001, 0x180f,
+	0x2004, 0xd084, 0x0120, 0x080c, 0x0fd5, 0x1904, 0xc66f, 0x6017,
+	0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x8000, 0x080c,
+	0x8582, 0x0c00, 0x2069, 0x0260, 0x6848, 0x9084, 0xff00, 0x9086,
+	0x1200, 0x1198, 0x686c, 0x9084, 0x00ff, 0x0016, 0x6114, 0x918c,
+	0xf700, 0x910d, 0x6116, 0x001e, 0x6003, 0x0001, 0x6007, 0x0043,
+	0x080c, 0x8000, 0x080c, 0x8582, 0x0828, 0x6868, 0x602e, 0x686c,
+	0x6032, 0x6017, 0xf200, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c,
+	0x8000, 0x080c, 0x8582, 0x0804, 0xc6ba, 0x2001, 0x180d, 0x2004,
+	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x4672, 0x6017, 0xf300,
+	0x0010, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c,
+	0x8000, 0x080c, 0x8582, 0x0804, 0xc6ba, 0x6017, 0xf500, 0x0c98,
+	0x6017, 0xf600, 0x0804, 0xc6da, 0x6017, 0xf200, 0x0804, 0xc6da,
+	0xa867, 0x0146, 0xa86b, 0x0000, 0x6008, 0xa886, 0x2c00, 0xa87a,
+	0x7044, 0x9084, 0x0003, 0x9080, 0xc6c2, 0x2005, 0xa87e, 0x2928,
+	0x6010, 0x2058, 0xb8a0, 0xa876, 0xb828, 0xa88a, 0xb82c, 0xa88e,
+	0xb830, 0xa892, 0xb834, 0xa896, 0xa883, 0x003d, 0x2009, 0x0205,
+	0x2104, 0x9085, 0x0080, 0x200a, 0x20e1, 0x0000, 0x2011, 0x0210,
+	0x2214, 0x9294, 0x0fff, 0xaaa2, 0x9282, 0x0111, 0x1a0c, 0x0db2,
+	0x8210, 0x821c, 0x2001, 0x026c, 0x2098, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0029, 0x20a0, 0x2011, 0xc7a4, 0x2041, 0x0001, 0x223d,
+	0x9784, 0x00ff, 0x9322, 0x1208, 0x2300, 0x20a8, 0x4003, 0x931a,
+	0x0530, 0x8210, 0xd7fc, 0x1130, 0x8d68, 0x2d0a, 0x2001, 0x0260,
+	0x2098, 0x0c68, 0x2950, 0x080c, 0x0fee, 0x0170, 0x2900, 0xb002,
+	0xa867, 0x0147, 0xa86b, 0x0000, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x001b, 0x20a0, 0x8840, 0x08d8, 0x2548, 0xa800, 0x902d, 0x0118,
+	0x080c, 0x1007, 0x0cc8, 0x080c, 0x1007, 0x0804, 0xc6c6, 0x2548,
+	0x8847, 0x9885, 0x0046, 0xa866, 0x2009, 0x0205, 0x200b, 0x0000,
+	0x080c, 0xcf91, 0x0804, 0xc6ba, 0x8010, 0x0004, 0x801a, 0x0006,
+	0x8018, 0x0008, 0x8016, 0x000a, 0x8014, 0x9186, 0x0013, 0x1160,
+	0x6004, 0x908a, 0x0054, 0x1a0c, 0x0db2, 0x9082, 0x0040, 0x0a0c,
+	0x0db2, 0x2008, 0x0804, 0xc855, 0x9186, 0x0051, 0x0108, 0x00c0,
+	0x2001, 0x0109, 0x2004, 0xd084, 0x0904, 0xc806, 0x0126, 0x2091,
+	0x2800, 0x0006, 0x0016, 0x0026, 0x080c, 0x7eec, 0x002e, 0x001e,
+	0x000e, 0x012e, 0x6000, 0x9086, 0x0002, 0x1580, 0x0804, 0xc89d,
+	0x9186, 0x0027, 0x0530, 0x9186, 0x0048, 0x0128, 0x9186, 0x0014,
+	0x0500, 0x190c, 0x0db2, 0x2001, 0x0109, 0x2004, 0xd084, 0x01f0,
+	0x00c6, 0x0126, 0x2091, 0x2800, 0x00c6, 0x2061, 0x0100, 0x0006,
+	0x0016, 0x0026, 0x080c, 0x7eec, 0x002e, 0x001e, 0x000e, 0x00ce,
+	0x012e, 0x00ce, 0x6000, 0x9086, 0x0004, 0x190c, 0x0db2, 0x0804,
+	0xc97e, 0x6004, 0x9082, 0x0040, 0x2008, 0x001a, 0x080c, 0x9a6b,
+	0x0005, 0xc81c, 0xc81e, 0xc81e, 0xc845, 0xc81c, 0xc81c, 0xc81c,
+	0xc81c, 0xc81c, 0xc81c, 0xc81c, 0xc81c, 0xc81c, 0xc81c, 0xc81c,
+	0xc81c, 0xc81c, 0xc81c, 0xc81c, 0x080c, 0x0db2, 0x080c, 0x847d,
+	0x080c, 0x8582, 0x0036, 0x0096, 0x6014, 0x904d, 0x01d8, 0x080c,
+	0xb5fb, 0x01c0, 0x6003, 0x0002, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x1178, 0x2019, 0x0004, 0x080c, 0xcf91, 0x6017,
+	0x0000, 0x6018, 0x9005, 0x1120, 0x2001, 0x1956, 0x2004, 0x601a,
+	0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x0096, 0x080c, 0x847d,
+	0x080c, 0x8582, 0x080c, 0xb5fb, 0x0120, 0x6014, 0x2048, 0x080c,
+	0x1007, 0x080c, 0x9a06, 0x009e, 0x0005, 0x0002, 0xc869, 0xc880,
+	0xc86b, 0xc897, 0xc869, 0xc869, 0xc869, 0xc869, 0xc869, 0xc869,
+	0xc869, 0xc869, 0xc869, 0xc869, 0xc869, 0xc869, 0xc869, 0xc869,
+	0xc869, 0x080c, 0x0db2, 0x0096, 0x080c, 0x847d, 0x6014, 0x2048,
+	0xa87c, 0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009, 0x0043, 0x080c,
+	0x9a50, 0x0010, 0x6003, 0x0004, 0x080c, 0x8582, 0x009e, 0x0005,
+	0x080c, 0x847d, 0x080c, 0xb5fb, 0x0138, 0x6114, 0x0096, 0x2148,
+	0xa97c, 0x009e, 0xd1ec, 0x1138, 0x080c, 0x7e13, 0x080c, 0x99d6,
+	0x080c, 0x8582, 0x0005, 0x080c, 0xd1e8, 0x0db0, 0x0cc8, 0x080c,
+	0x847d, 0x2009, 0x0041, 0x0804, 0xca06, 0x9182, 0x0040, 0x0002,
+	0xc8b3, 0xc8b5, 0xc8b3, 0xc8b3, 0xc8b3, 0xc8b3, 0xc8b3, 0xc8b3,
+	0xc8b3, 0xc8b3, 0xc8b3, 0xc8b3, 0xc8b3, 0xc8b3, 0xc8b3, 0xc8b3,
+	0xc8b3, 0xc8b6, 0xc8b3, 0x080c, 0x0db2, 0x0005, 0x00d6, 0x080c,
+	0x7e13, 0x00de, 0x080c, 0xd240, 0x080c, 0x99d6, 0x0005, 0x9182,
+	0x0040, 0x0002, 0xc8d5, 0xc8d5, 0xc8d5, 0xc8d5, 0xc8d5, 0xc8d5,
+	0xc8d5, 0xc8d5, 0xc8d5, 0xc8d7, 0xc946, 0xc8d5, 0xc8d5, 0xc8d5,
+	0xc8d5, 0xc946, 0xc8d5, 0xc8d5, 0xc8d5, 0x080c, 0x0db2, 0x2001,
+	0x0105, 0x2004, 0x9084, 0x1800, 0x01c8, 0x2001, 0x0132, 0x200c,
+	0x2001, 0x0131, 0x2004, 0x9105, 0x1904, 0xc946, 0x2009, 0x180c,
+	0x2104, 0xd0d4, 0x0904, 0xc946, 0xc0d4, 0x200a, 0x2009, 0x0105,
+	0x2104, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x200a, 0x2001, 0x1873,
+	0x2004, 0xd0e4, 0x1528, 0x603b, 0x0000, 0x080c, 0x8532, 0x6014,
+	0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0188, 0x908c, 0x0003, 0x918e,
+	0x0002, 0x0508, 0x2001, 0x180c, 0x2004, 0xd0d4, 0x11e0, 0x080c,
+	0x865d, 0x2009, 0x0041, 0x009e, 0x0804, 0xca06, 0x080c, 0x865d,
+	0x6003, 0x0007, 0x601b, 0x0000, 0x080c, 0x7e13, 0x009e, 0x0005,
+	0x2001, 0x0100, 0x2004, 0x9082, 0x0005, 0x0aa8, 0x2001, 0x011f,
+	0x2004, 0x603a, 0x0890, 0x2001, 0x180c, 0x200c, 0xc1d4, 0x2102,
+	0xd1cc, 0x0110, 0x080c, 0x28ea, 0x080c, 0x865d, 0x6014, 0x2048,
+	0xa97c, 0xd1ec, 0x1130, 0x080c, 0x7e13, 0x080c, 0x99d6, 0x009e,
+	0x0005, 0x080c, 0xd1e8, 0x0db8, 0x009e, 0x0005, 0x2001, 0x180c,
+	0x200c, 0xc1d4, 0x2102, 0x0036, 0x080c, 0x8532, 0x080c, 0x865d,
+	0x6014, 0x0096, 0x2048, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x0188, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x0140,
+	0xa8ac, 0x6330, 0x931a, 0x6332, 0xa8b0, 0x632c, 0x931b, 0x632e,
+	0x6003, 0x0002, 0x0080, 0x2019, 0x0004, 0x080c, 0xcf91, 0x6018,
+	0x9005, 0x1128, 0x2001, 0x1956, 0x2004, 0x8003, 0x601a, 0x6017,
+	0x0000, 0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x9182, 0x0040,
+	0x0002, 0xc995, 0xc995, 0xc995, 0xc995, 0xc995, 0xc995, 0xc995,
+	0xc995, 0xc997, 0xc995, 0xc995, 0xc995, 0xc995, 0xc995, 0xc995,
+	0xc995, 0xc995, 0xc995, 0xc995, 0xc9e2, 0x080c, 0x0db2, 0x6014,
+	0x0096, 0x2048, 0xa834, 0xaa38, 0x6110, 0x00b6, 0x2058, 0xb900,
+	0x00be, 0xd1bc, 0x1190, 0x920d, 0x1518, 0xa87c, 0xd0fc, 0x0128,
+	0x2009, 0x0041, 0x009e, 0x0804, 0xca06, 0x6003, 0x0007, 0x601b,
+	0x0000, 0x080c, 0x7e13, 0x009e, 0x0005, 0x6124, 0xd1f4, 0x1d58,
+	0x0006, 0x0046, 0xacac, 0x9422, 0xa9b0, 0x2200, 0x910b, 0x6030,
+	0x9420, 0x6432, 0x602c, 0x9109, 0x612e, 0x004e, 0x000e, 0x08d8,
+	0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1bc, 0x1178, 0x2009,
+	0x180d, 0x210c, 0xd19c, 0x0118, 0x6003, 0x0007, 0x0010, 0x6003,
+	0x0006, 0x00e9, 0x080c, 0x7e15, 0x009e, 0x0005, 0x6003, 0x0002,
+	0x009e, 0x0005, 0x6024, 0xd0f4, 0x0128, 0x080c, 0x14c9, 0x1904,
+	0xc997, 0x0005, 0x6014, 0x0096, 0x2048, 0xa834, 0xa938, 0x009e,
+	0x9105, 0x1120, 0x080c, 0x14c9, 0x1904, 0xc997, 0x0005, 0xd2fc,
+	0x0140, 0x8002, 0x8000, 0x8212, 0x9291, 0x0000, 0x2009, 0x0009,
+	0x0010, 0x2009, 0x0015, 0xaa9a, 0xa896, 0x0005, 0x9182, 0x0040,
+	0x0208, 0x0062, 0x9186, 0x0013, 0x0120, 0x9186, 0x0014, 0x190c,
+	0x0db2, 0x6024, 0xd0dc, 0x090c, 0x0db2, 0x0005, 0xca29, 0xca35,
+	0xca41, 0xca4d, 0xca29, 0xca29, 0xca29, 0xca29, 0xca30, 0xca2b,
+	0xca2b, 0xca29, 0xca29, 0xca29, 0xca29, 0xca2b, 0xca29, 0xca2b,
+	0xca29, 0x080c, 0x0db2, 0x6024, 0xd0dc, 0x090c, 0x0db2, 0x0005,
+	0x6014, 0x9005, 0x190c, 0x0db2, 0x0005, 0x6003, 0x0001, 0x6106,
+	0x080c, 0x8000, 0x0126, 0x2091, 0x8000, 0x080c, 0x8582, 0x012e,
+	0x0005, 0x6003, 0x0001, 0x6106, 0x080c, 0x8000, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x8582, 0x012e, 0x0005, 0x6003, 0x0003, 0x6106,
+	0x2c10, 0x080c, 0x1976, 0x0126, 0x2091, 0x8000, 0x080c, 0x8065,
+	0x080c, 0x865d, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0036,
+	0x0096, 0x9182, 0x0040, 0x0023, 0x009e, 0x003e, 0x012e, 0x0005,
+	0xca78, 0xca7a, 0xca8c, 0xcaa6, 0xca78, 0xca78, 0xca78, 0xca78,
+	0xca78, 0xca78, 0xca78, 0xca78, 0xca78, 0xca78, 0xca78, 0xca78,
+	0x080c, 0x0db2, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x01f8, 0x909c,
+	0x0003, 0x939e, 0x0003, 0x01d0, 0x6003, 0x0001, 0x6106, 0x080c,
+	0x8000, 0x080c, 0x8582, 0x0470, 0x6014, 0x2048, 0xa87c, 0xd0fc,
+	0x0168, 0x909c, 0x0003, 0x939e, 0x0003, 0x0140, 0x6003, 0x0001,
+	0x6106, 0x080c, 0x8000, 0x080c, 0x8582, 0x00e0, 0x901e, 0x6316,
+	0x631a, 0x2019, 0x0004, 0x080c, 0xcf91, 0x00a0, 0x6014, 0x2048,
+	0xa87c, 0xd0fc, 0x0d98, 0x909c, 0x0003, 0x939e, 0x0003, 0x0d70,
+	0x6003, 0x0003, 0x6106, 0x2c10, 0x080c, 0x1976, 0x080c, 0x8065,
+	0x080c, 0x865d, 0x0005, 0x080c, 0x847d, 0x6114, 0x81ff, 0x0158,
+	0x0096, 0x2148, 0x080c, 0xd28c, 0x0036, 0x2019, 0x0029, 0x080c,
+	0xcf91, 0x003e, 0x009e, 0x080c, 0x9a06, 0x080c, 0x8582, 0x0005,
+	0x080c, 0x8532, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148, 0x080c,
+	0xd28c, 0x0036, 0x2019, 0x0029, 0x080c, 0xcf91, 0x003e, 0x009e,
+	0x080c, 0x9a06, 0x080c, 0x865d, 0x0005, 0x9182, 0x0085, 0x0002,
+	0xcaf7, 0xcaf5, 0xcaf5, 0xcb03, 0xcaf5, 0xcaf5, 0xcaf5, 0xcaf5,
+	0xcaf5, 0xcaf5, 0xcaf5, 0xcaf5, 0xcaf5, 0x080c, 0x0db2, 0x6003,
+	0x000b, 0x6106, 0x080c, 0x8000, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x8582, 0x012e, 0x0005, 0x0026, 0x00e6, 0x080c, 0xd1df, 0x0118,
+	0x080c, 0x99d6, 0x0450, 0x2071, 0x0260, 0x7224, 0x6216, 0x2001,
+	0x180d, 0x2004, 0xd0e4, 0x0150, 0x6010, 0x00b6, 0x2058, 0xbca0,
+	0x00be, 0x2c00, 0x2011, 0x014e, 0x080c, 0x9cf4, 0x7220, 0x080c,
+	0xce37, 0x0118, 0x6007, 0x0086, 0x0040, 0x6007, 0x0087, 0x7224,
+	0x9296, 0xffff, 0x1110, 0x6007, 0x0086, 0x6003, 0x0001, 0x080c,
+	0x8000, 0x080c, 0x8582, 0x080c, 0x865d, 0x00ee, 0x002e, 0x0005,
+	0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0db2,
+	0x908a, 0x0092, 0x1a0c, 0x0db2, 0x9082, 0x0085, 0x00a2, 0x9186,
+	0x0027, 0x0130, 0x9186, 0x0014, 0x0118, 0x080c, 0x9a6b, 0x0050,
+	0x2001, 0x0007, 0x080c, 0x5efb, 0x080c, 0x847d, 0x080c, 0x9a06,
+	0x080c, 0x8582, 0x0005, 0xcb68, 0xcb6a, 0xcb6a, 0xcb68, 0xcb68,
+	0xcb68, 0xcb68, 0xcb68, 0xcb68, 0xcb68, 0xcb68, 0xcb68, 0xcb68,
+	0x080c, 0x0db2, 0x080c, 0x847d, 0x080c, 0x9a06, 0x080c, 0x8582,
+	0x0005, 0x9182, 0x0085, 0x0a0c, 0x0db2, 0x9182, 0x0092, 0x1a0c,
+	0x0db2, 0x9182, 0x0085, 0x0002, 0xcb89, 0xcb89, 0xcb89, 0xcb8b,
+	0xcb89, 0xcb89, 0xcb89, 0xcb89, 0xcb89, 0xcb89, 0xcb89, 0xcb89,
+	0xcb89, 0x080c, 0x0db2, 0x0005, 0x9186, 0x0013, 0x0148, 0x9186,
+	0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0x9a6b, 0x0030,
+	0x080c, 0x847d, 0x080c, 0x9a06, 0x080c, 0x8582, 0x0005, 0x0036,
+	0x080c, 0xd240, 0x6043, 0x0000, 0x2019, 0x000b, 0x0031, 0x6023,
+	0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0x0126, 0x0036, 0x2091,
+	0x8000, 0x0086, 0x2c40, 0x0096, 0x904e, 0x080c, 0x9349, 0x009e,
+	0x008e, 0x1550, 0x0076, 0x2c38, 0x080c, 0x93f4, 0x007e, 0x1520,
+	0x6000, 0x9086, 0x0000, 0x0500, 0x6020, 0x9086, 0x0007, 0x01e0,
+	0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xd240, 0x080c, 0xbd04,
+	0x080c, 0x1827, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xb5fb,
+	0x0110, 0x080c, 0xcf91, 0x009e, 0x6017, 0x0000, 0x080c, 0xd240,
+	0x6023, 0x0007, 0x080c, 0xbd04, 0x003e, 0x012e, 0x0005, 0x00f6,
+	0x00c6, 0x00b6, 0x0036, 0x0156, 0x2079, 0x0260, 0x7938, 0x783c,
+	0x080c, 0x24d6, 0x15b8, 0x0016, 0x00c6, 0x080c, 0x5f7e, 0x1580,
+	0x001e, 0x00c6, 0x2160, 0x080c, 0xbd01, 0x00ce, 0x002e, 0x0026,
+	0x0016, 0x2019, 0x0029, 0x080c, 0x94b5, 0x080c, 0x8180, 0x0076,
+	0x903e, 0x080c, 0x8078, 0x007e, 0x001e, 0x0076, 0x903e, 0x080c,
+	0xcd62, 0x007e, 0x0026, 0xba04, 0x9294, 0xff00, 0x8217, 0x9286,
+	0x0006, 0x0118, 0x9286, 0x0004, 0x1118, 0xbaa0, 0x080c, 0x2eea,
+	0x002e, 0x001e, 0x080c, 0x5a3b, 0xbe12, 0xbd16, 0x9006, 0x0010,
+	0x00ce, 0x001e, 0x015e, 0x003e, 0x00be, 0x00ce, 0x00fe, 0x0005,
+	0x00c6, 0x00d6, 0x00b6, 0x0016, 0x2009, 0x1822, 0x2104, 0x9086,
+	0x0074, 0x1904, 0xcc89, 0x2069, 0x0260, 0x6944, 0x9182, 0x0100,
+	0x06e0, 0x6940, 0x9184, 0x8000, 0x0904, 0xcc86, 0x2001, 0x194d,
+	0x2004, 0x9005, 0x1140, 0x6010, 0x2058, 0xb8b0, 0x9005, 0x0118,
+	0x9184, 0x0800, 0x0598, 0x6948, 0x918a, 0x0001, 0x0648, 0x080c,
+	0xd2f4, 0x0118, 0x6978, 0xd1fc, 0x11b8, 0x2009, 0x0205, 0x200b,
+	0x0001, 0x693c, 0x81ff, 0x1198, 0x6944, 0x9182, 0x0100, 0x02a8,
+	0x6940, 0x81ff, 0x1178, 0x6948, 0x918a, 0x0001, 0x0288, 0x6950,
+	0x918a, 0x0001, 0x0298, 0x00d0, 0x6017, 0x0100, 0x00a0, 0x6017,
+	0x0300, 0x0088, 0x6017, 0x0500, 0x0070, 0x6017, 0x0700, 0x0058,
+	0x6017, 0x0900, 0x0040, 0x6017, 0x0b00, 0x0028, 0x6017, 0x0f00,
+	0x0010, 0x6017, 0x2d00, 0x9085, 0x0001, 0x0008, 0x9006, 0x001e,
+	0x00be, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00b6, 0x0026, 0x0036,
+	0x0156, 0x6210, 0x2258, 0xbb04, 0x9394, 0x00ff, 0x9286, 0x0006,
+	0x0180, 0x9286, 0x0004, 0x0168, 0x9394, 0xff00, 0x8217, 0x9286,
+	0x0006, 0x0138, 0x9286, 0x0004, 0x0120, 0x080c, 0x5f8d, 0x0804,
+	0xccf1, 0x2011, 0x0276, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019,
+	0x000a, 0x080c, 0xa91d, 0x009e, 0x15a8, 0x2011, 0x027a, 0x20a9,
+	0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c, 0xa91d, 0x009e,
+	0x1548, 0x0046, 0x0016, 0xbaa0, 0x2220, 0x9006, 0x2009, 0x1854,
+	0x210c, 0xd1a4, 0x0138, 0x2009, 0x0029, 0x080c, 0xcfe6, 0xb800,
+	0xc0e5, 0xb802, 0x2019, 0x0029, 0x080c, 0x8180, 0x0076, 0x2039,
+	0x0000, 0x080c, 0x8078, 0x2c08, 0x080c, 0xcd62, 0x007e, 0x2001,
+	0x0007, 0x080c, 0x5efb, 0x2001, 0x0007, 0x080c, 0x5ecf, 0x001e,
+	0x004e, 0x9006, 0x015e, 0x003e, 0x002e, 0x00be, 0x00ce, 0x0005,
+	0x00d6, 0x2069, 0x026e, 0x6800, 0x9086, 0x0800, 0x0118, 0x6017,
+	0x0000, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00f6, 0x0016,
+	0x0026, 0x0036, 0x0156, 0x2079, 0x026c, 0x7930, 0x7834, 0x080c,
+	0x24d6, 0x11d0, 0x080c, 0x5f7e, 0x11b8, 0x2011, 0x0270, 0x20a9,
+	0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xa91d, 0x009e,
+	0x1158, 0x2011, 0x0274, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019,
+	0x0006, 0x080c, 0xa91d, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e,
+	0x00fe, 0x00be, 0x0005, 0x00b6, 0x0006, 0x0016, 0x0026, 0x0036,
+	0x0156, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x24d6,
+	0x11d0, 0x080c, 0x5f7e, 0x11b8, 0x2011, 0x0276, 0x20a9, 0x0004,
+	0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xa91d, 0x009e, 0x1158,
+	0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006,
+	0x080c, 0xa91d, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e, 0x000e,
+	0x00be, 0x0005, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x0056,
+	0x0046, 0x0026, 0x0126, 0x2091, 0x8000, 0x2740, 0x2029, 0x19bf,
+	0x252c, 0x2021, 0x19c5, 0x2424, 0x2061, 0x1cd0, 0x2071, 0x1800,
+	0x764c, 0x706c, 0x81ff, 0x0150, 0x0006, 0x9186, 0x1a73, 0x000e,
+	0x0128, 0x8001, 0x9602, 0x1a04, 0xcdf0, 0x0018, 0x9606, 0x0904,
+	0xcdf0, 0x2100, 0x9c06, 0x0904, 0xcde7, 0x080c, 0xd022, 0x1904,
+	0xcde7, 0x080c, 0xd311, 0x0904, 0xcde7, 0x080c, 0xd012, 0x0904,
+	0xcde7, 0x6720, 0x9786, 0x0001, 0x1148, 0x080c, 0x2f81, 0x0904,
+	0xce0b, 0x6004, 0x9086, 0x0000, 0x1904, 0xce0b, 0x9786, 0x0004,
+	0x0904, 0xce0b, 0x9786, 0x0007, 0x05d0, 0x2500, 0x9c06, 0x05b8,
+	0x2400, 0x9c06, 0x05a0, 0x88ff, 0x0118, 0x6054, 0x9906, 0x1578,
+	0x0096, 0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x1827,
+	0x001e, 0x9786, 0x000a, 0x0148, 0x080c, 0xb7fa, 0x1130, 0x080c,
+	0xa364, 0x009e, 0x080c, 0x9a06, 0x00d0, 0x6014, 0x2048, 0x080c,
+	0xb5fb, 0x0190, 0x9786, 0x0003, 0x1528, 0xa867, 0x0103, 0xab7a,
+	0xa877, 0x0000, 0x080c, 0xd28c, 0x0016, 0x080c, 0xb8e3, 0x080c,
+	0x6529, 0x001e, 0x080c, 0xb7dd, 0x009e, 0x080c, 0x9a06, 0x9ce0,
+	0x0018, 0x2001, 0x1818, 0x2004, 0x9c02, 0x1210, 0x0804, 0xcd76,
+	0x012e, 0x002e, 0x004e, 0x005e, 0x006e, 0x007e, 0x008e, 0x00ce,
+	0x00ee, 0x0005, 0x9786, 0x0006, 0x1150, 0x9386, 0x0005, 0x0128,
+	0x080c, 0xd28c, 0x080c, 0xcf91, 0x08f8, 0x009e, 0x0c00, 0x9786,
+	0x000a, 0x0968, 0x0850, 0x81ff, 0x09d0, 0x9180, 0x0001, 0x2004,
+	0x9086, 0x0018, 0x0130, 0x9180, 0x0001, 0x2004, 0x9086, 0x002d,
+	0x1970, 0x6000, 0x9086, 0x0002, 0x1950, 0x080c, 0xb7e9, 0x0130,
+	0x080c, 0xb7fa, 0x1920, 0x080c, 0xa364, 0x0038, 0x080c, 0x2e55,
+	0x080c, 0xb7fa, 0x1110, 0x080c, 0xa364, 0x080c, 0x9a06, 0x0804,
+	0xcde7, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x0005, 0x00c6,
+	0x00e6, 0x0016, 0x2c08, 0x2170, 0x9006, 0x080c, 0xcfb8, 0x001e,
+	0x0120, 0x6020, 0x9084, 0x000f, 0x001b, 0x00ee, 0x00ce, 0x0005,
+	0xce56, 0xce56, 0xce56, 0xce56, 0xce56, 0xce56, 0xce58, 0xce56,
+	0xce56, 0xce56, 0xce56, 0x9a06, 0x9a06, 0xce56, 0x9006, 0x0005,
+	0x0036, 0x0046, 0x0016, 0x7010, 0x00b6, 0x2058, 0xbca0, 0x00be,
+	0x2c00, 0x2009, 0x0020, 0x080c, 0xcfe6, 0x001e, 0x004e, 0x2019,
+	0x0002, 0x080c, 0xcbad, 0x003e, 0x9085, 0x0001, 0x0005, 0x0096,
+	0x080c, 0xb5fb, 0x0140, 0x6014, 0x904d, 0x080c, 0xb251, 0x687b,
+	0x0005, 0x080c, 0x6536, 0x009e, 0x080c, 0x9a06, 0x9085, 0x0001,
+	0x0005, 0x2001, 0x0001, 0x080c, 0x5ebb, 0x0156, 0x0016, 0x0026,
+	0x0036, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011, 0x0276, 0x080c,
+	0xa909, 0x003e, 0x002e, 0x001e, 0x015e, 0x9005, 0x0005, 0x00f6,
+	0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x00b6, 0x0126, 0x2091,
+	0x8000, 0x2740, 0x2061, 0x1cd0, 0x2079, 0x0001, 0x8fff, 0x0904,
+	0xcef1, 0x2071, 0x1800, 0x764c, 0x706c, 0x8001, 0x9602, 0x1a04,
+	0xcef1, 0x88ff, 0x0120, 0x2800, 0x9c06, 0x1590, 0x2078, 0x080c,
+	0xd012, 0x0570, 0x2400, 0x9c06, 0x0558, 0x6720, 0x9786, 0x0006,
+	0x1538, 0x9786, 0x0007, 0x0520, 0x88ff, 0x1140, 0x6010, 0x9b06,
+	0x11f8, 0x85ff, 0x0118, 0x6054, 0x9106, 0x11d0, 0x0096, 0x601c,
+	0xd084, 0x0140, 0x080c, 0xd240, 0x080c, 0xbd04, 0x080c, 0x1827,
+	0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xb5fb, 0x0120, 0x0046,
+	0x080c, 0xcf91, 0x004e, 0x009e, 0x080c, 0x9a06, 0x88ff, 0x1198,
+	0x9ce0, 0x0018, 0x2001, 0x1818, 0x2004, 0x9c02, 0x1210, 0x0804,
+	0xcea6, 0x9006, 0x012e, 0x00be, 0x006e, 0x007e, 0x008e, 0x00ce,
+	0x00ee, 0x00fe, 0x0005, 0x98c5, 0x0001, 0x0ca0, 0x00b6, 0x0076,
+	0x0056, 0x0086, 0x9046, 0x2029, 0x0001, 0x2c20, 0x2019, 0x0002,
+	0x6210, 0x2258, 0x0096, 0x904e, 0x080c, 0x9349, 0x009e, 0x008e,
+	0x903e, 0x080c, 0x93f4, 0x080c, 0xce97, 0x005e, 0x007e, 0x00be,
+	0x0005, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6, 0x0156, 0x2c20,
+	0x2128, 0x20a9, 0x007f, 0x900e, 0x0016, 0x0036, 0x080c, 0x5f7e,
+	0x1190, 0x0056, 0x0086, 0x9046, 0x2508, 0x2029, 0x0001, 0x0096,
+	0x904e, 0x080c, 0x9349, 0x009e, 0x008e, 0x903e, 0x080c, 0x93f4,
+	0x080c, 0xce97, 0x005e, 0x003e, 0x001e, 0x8108, 0x1f04, 0xcf24,
+	0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x00be, 0x0005, 0x00b6,
+	0x0076, 0x0056, 0x6210, 0x2258, 0x0086, 0x9046, 0x2029, 0x0001,
+	0x2019, 0x0048, 0x0096, 0x904e, 0x080c, 0x9349, 0x009e, 0x008e,
+	0x903e, 0x080c, 0x93f4, 0x2c20, 0x080c, 0xce97, 0x005e, 0x007e,
+	0x00be, 0x0005, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6, 0x0156,
+	0x2c20, 0x20a9, 0x0800, 0x900e, 0x0016, 0x0036, 0x080c, 0x5f7e,
+	0x11a0, 0x0086, 0x9046, 0x2828, 0x0046, 0x2021, 0x0001, 0x080c,
+	0xd224, 0x004e, 0x0096, 0x904e, 0x080c, 0x9349, 0x009e, 0x008e,
+	0x903e, 0x080c, 0x93f4, 0x080c, 0xce97, 0x003e, 0x001e, 0x8108,
+	0x1f04, 0xcf6c, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x00be,
+	0x0005, 0x0016, 0x00f6, 0x080c, 0xb5f9, 0x0198, 0xa864, 0x9084,
+	0x00ff, 0x9086, 0x0046, 0x0180, 0xa800, 0x907d, 0x0138, 0xa803,
+	0x0000, 0xab82, 0x080c, 0x6536, 0x2f48, 0x0cb0, 0xab82, 0x080c,
+	0x6536, 0x00fe, 0x001e, 0x0005, 0xa800, 0x907d, 0x0130, 0xa803,
+	0x0000, 0x080c, 0x6536, 0x2f48, 0x0cb8, 0x080c, 0x6536, 0x0c88,
+	0x00e6, 0x0046, 0x0036, 0x2061, 0x1cd0, 0x9005, 0x1138, 0x2071,
+	0x1800, 0x744c, 0x706c, 0x8001, 0x9402, 0x12d8, 0x2100, 0x9c06,
+	0x0168, 0x6000, 0x9086, 0x0000, 0x0148, 0x6008, 0x9206, 0x1130,
+	0x6010, 0x91a0, 0x0004, 0x2424, 0x9406, 0x0140, 0x9ce0, 0x0018,
+	0x2001, 0x1818, 0x2004, 0x9c02, 0x1220, 0x0c40, 0x9085, 0x0001,
+	0x0008, 0x9006, 0x003e, 0x004e, 0x00ee, 0x0005, 0x0096, 0x0006,
+	0x080c, 0x0fd5, 0x000e, 0x090c, 0x0db2, 0xa867, 0x010d, 0xa88e,
+	0x0026, 0x2010, 0x080c, 0xb5e9, 0x2001, 0x0000, 0x0120, 0x2200,
+	0x9080, 0x0015, 0x2004, 0x002e, 0xa87a, 0xa986, 0xac76, 0xa87f,
+	0x0000, 0x2001, 0x195d, 0x2004, 0xa882, 0x9006, 0xa8e2, 0xa802,
+	0xa86a, 0xa88a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6536, 0x012e,
+	0x009e, 0x0005, 0x6700, 0x9786, 0x0000, 0x0158, 0x9786, 0x0001,
+	0x0140, 0x9786, 0x000a, 0x0128, 0x9786, 0x0009, 0x0110, 0x9085,
+	0x0001, 0x0005, 0x00e6, 0x6010, 0x9075, 0x0138, 0x00b6, 0x2058,
+	0xb8a0, 0x00be, 0x9206, 0x00ee, 0x0005, 0x9085, 0x0001, 0x0cd8,
+	0x0016, 0x6004, 0x908e, 0x001e, 0x11a0, 0x8007, 0x6134, 0x918c,
+	0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023,
+	0x0005, 0x2001, 0x1956, 0x2004, 0x601a, 0x080c, 0x8000, 0x080c,
+	0x8582, 0x001e, 0x0005, 0xa001, 0xa001, 0x0005, 0x6024, 0xd0e4,
+	0x0158, 0xd0cc, 0x0118, 0x080c, 0xb927, 0x0030, 0x080c, 0xd240,
+	0x080c, 0x7e13, 0x080c, 0x99d6, 0x0005, 0x9280, 0x0008, 0x2004,
+	0x9084, 0x000f, 0x0002, 0xd071, 0xd071, 0xd071, 0xd073, 0xd071,
+	0xd073, 0xd073, 0xd071, 0xd073, 0xd071, 0xd071, 0xd071, 0xd071,
+	0xd071, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x9280, 0x0008,
+	0x2004, 0x9084, 0x000f, 0x0002, 0xd08a, 0xd08a, 0xd08a, 0xd08a,
+	0xd08a, 0xd08a, 0xd097, 0xd08a, 0xd08a, 0xd08a, 0xd08a, 0xd08a,
+	0xd08a, 0xd08a, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00,
+	0x6003, 0x0001, 0x080c, 0x8000, 0x080c, 0x8582, 0x0005, 0x0096,
+	0x00c6, 0x2260, 0x080c, 0xd240, 0x6043, 0x0000, 0x6024, 0xc0f4,
+	0xc0e4, 0x6026, 0x603b, 0x0000, 0x00ce, 0x00d6, 0x2268, 0x9186,
+	0x0007, 0x1904, 0xd0f1, 0x6814, 0x9005, 0x0138, 0x2048, 0xa87c,
+	0xd0fc, 0x1118, 0x00de, 0x009e, 0x08a8, 0x6007, 0x003a, 0x6003,
+	0x0001, 0x080c, 0x8000, 0x080c, 0x8582, 0x00c6, 0x2d60, 0x6100,
+	0x9186, 0x0002, 0x1904, 0xd169, 0x6014, 0x9005, 0x1138, 0x6000,
+	0x9086, 0x0007, 0x190c, 0x0db2, 0x0804, 0xd169, 0x2048, 0x080c,
+	0xb5fb, 0x1130, 0x0028, 0x2048, 0xa800, 0x9005, 0x1de0, 0x2900,
+	0x2048, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x1170, 0xa87c,
+	0xc0dc, 0xc0f4, 0xa87e, 0xa880, 0xc0f4, 0xc0fc, 0xa882, 0x2009,
+	0x0043, 0x080c, 0xca06, 0x0804, 0xd169, 0x2009, 0x0041, 0x0804,
+	0xd163, 0x9186, 0x0005, 0x15a8, 0x6814, 0x2048, 0xa87c, 0xd0bc,
+	0x1120, 0x00de, 0x009e, 0x0804, 0xd08a, 0xd0b4, 0x0128, 0xd0fc,
+	0x090c, 0x0db2, 0x0804, 0xd0ab, 0x6007, 0x003a, 0x6003, 0x0001,
+	0x080c, 0x8000, 0x080c, 0x8582, 0x00c6, 0x2d60, 0x6100, 0x9186,
+	0x0002, 0x0120, 0x9186, 0x0004, 0x1904, 0xd169, 0x6814, 0x2048,
+	0xa97c, 0xc1f4, 0xc1dc, 0xa97e, 0xa980, 0xc1f4, 0xc1fc, 0xc1bc,
+	0xa982, 0x00f6, 0x2c78, 0x080c, 0x1582, 0x00fe, 0x2009, 0x0042,
+	0x04d0, 0x0036, 0x080c, 0x0fd5, 0x090c, 0x0db2, 0xa867, 0x010d,
+	0x9006, 0xa802, 0xa86a, 0xa88a, 0x2d18, 0xab8e, 0xa887, 0x0045,
+	0x2c00, 0xa892, 0x6038, 0xa8a2, 0x2360, 0x6024, 0xc0dd, 0x6026,
+	0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x2004, 0x6354, 0xab7a,
+	0xa876, 0x9006, 0xa87e, 0xa882, 0xad9a, 0xae96, 0xa89f, 0x0001,
+	0x080c, 0x6536, 0x2019, 0x0045, 0x6008, 0x2068, 0x080c, 0xcbad,
+	0x2d00, 0x600a, 0x6023, 0x0006, 0x6003, 0x0007, 0x901e, 0x631a,
+	0x6342, 0x003e, 0x0038, 0x6043, 0x0000, 0x6003, 0x0007, 0x080c,
+	0xca06, 0x00ce, 0x00de, 0x009e, 0x0005, 0x9186, 0x0013, 0x1128,
+	0x6004, 0x9082, 0x0085, 0x2008, 0x00c2, 0x9186, 0x0027, 0x1178,
+	0x080c, 0x847d, 0x0036, 0x0096, 0x6014, 0x2048, 0x2019, 0x0004,
+	0x080c, 0xcf91, 0x009e, 0x003e, 0x080c, 0x8582, 0x0005, 0x9186,
+	0x0014, 0x0d70, 0x080c, 0x9a6b, 0x0005, 0xd19c, 0xd19a, 0xd19a,
+	0xd19a, 0xd19a, 0xd19a, 0xd19c, 0xd19a, 0xd19a, 0xd19a, 0xd19a,
+	0xd19a, 0xd19a, 0x080c, 0x0db2, 0x080c, 0x847d, 0x6003, 0x000c,
+	0x080c, 0x8582, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085,
+	0x0208, 0x001a, 0x080c, 0x9a6b, 0x0005, 0xd1ba, 0xd1ba, 0xd1ba,
+	0xd1ba, 0xd1bc, 0xd1dc, 0xd1ba, 0xd1ba, 0xd1ba, 0xd1ba, 0xd1ba,
+	0xd1ba, 0xd1ba, 0x080c, 0x0db2, 0x00d6, 0x2c68, 0x080c, 0x9980,
+	0x01b0, 0x6003, 0x0001, 0x6007, 0x001e, 0x2009, 0x026e, 0x210c,
+	0x613a, 0x2009, 0x026f, 0x210c, 0x613e, 0x600b, 0xffff, 0x6910,
+	0x6112, 0x6023, 0x0004, 0x080c, 0x8000, 0x080c, 0x8582, 0x2d60,
+	0x080c, 0x99d6, 0x00de, 0x0005, 0x080c, 0x99d6, 0x0005, 0x00e6,
+	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0ec, 0x00ee, 0x0005,
+	0x2009, 0x1873, 0x210c, 0xd1ec, 0x05b0, 0x6003, 0x0002, 0x6024,
+	0xc0e5, 0x6026, 0xd0cc, 0x0150, 0x2001, 0x1957, 0x2004, 0x6042,
+	0x2009, 0x1873, 0x210c, 0xd1f4, 0x1520, 0x00a0, 0x2009, 0x1873,
+	0x210c, 0xd1f4, 0x0128, 0x6024, 0xc0e4, 0x6026, 0x9006, 0x00d8,
+	0x2001, 0x1957, 0x200c, 0x2001, 0x1955, 0x2004, 0x9100, 0x9080,
+	0x000a, 0x6042, 0x6010, 0x00b6, 0x2058, 0xb8ac, 0x00be, 0x0008,
+	0x2104, 0x9005, 0x0118, 0x9088, 0x0003, 0x0cd0, 0x2c0a, 0x600f,
+	0x0000, 0x9085, 0x0001, 0x0005, 0x0016, 0x00c6, 0x00e6, 0x6154,
+	0xb8ac, 0x2060, 0x8cff, 0x0180, 0x84ff, 0x1118, 0x6054, 0x9106,
+	0x1138, 0x600c, 0x2072, 0x080c, 0x7e13, 0x080c, 0x99d6, 0x0010,
+	0x9cf0, 0x0003, 0x2e64, 0x0c70, 0x00ee, 0x00ce, 0x001e, 0x0005,
+	0x00d6, 0x00b6, 0x6010, 0x2058, 0xb8ac, 0x2068, 0x9005, 0x0130,
+	0x9c06, 0x0110, 0x680c, 0x0cd0, 0x600c, 0x680e, 0x00be, 0x00de,
+	0x0005, 0x0026, 0x0036, 0x0156, 0x2011, 0x182a, 0x2204, 0x9084,
+	0x00ff, 0x2019, 0x026e, 0x2334, 0x9636, 0x1508, 0x8318, 0x2334,
+	0x2204, 0x9084, 0xff00, 0x9636, 0x11d0, 0x2011, 0x0270, 0x20a9,
+	0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x000a, 0x080c, 0xa91d,
+	0x009e, 0x1168, 0x2011, 0x0274, 0x20a9, 0x0004, 0x6010, 0x0096,
+	0x2048, 0x2019, 0x0006, 0x080c, 0xa91d, 0x009e, 0x1100, 0x015e,
+	0x003e, 0x002e, 0x0005, 0x00e6, 0x2071, 0x1800, 0x080c, 0x59b4,
+	0x080c, 0x2c2b, 0x00ee, 0x0005, 0x00e6, 0x6010, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0fc, 0x0108, 0x0011, 0x00ee, 0x0005, 0xa880,
+	0xc0e5, 0xa882, 0x0005, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066,
+	0x0056, 0x0046, 0x0026, 0x0016, 0x0126, 0x2091, 0x8000, 0x2029,
+	0x19bf, 0x252c, 0x2021, 0x19c5, 0x2424, 0x2061, 0x1cd0, 0x2071,
+	0x1800, 0x764c, 0x706c, 0x9606, 0x0578, 0x6720, 0x9786, 0x0001,
+	0x0118, 0x9786, 0x0008, 0x1500, 0x2500, 0x9c06, 0x01e8, 0x2400,
+	0x9c06, 0x01d0, 0x080c, 0xd012, 0x01b8, 0x080c, 0xd022, 0x11a0,
+	0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x1827, 0x001e,
+	0x080c, 0xb7e9, 0x1110, 0x080c, 0x2e55, 0x080c, 0xb7fa, 0x1110,
+	0x080c, 0xa364, 0x080c, 0x9a06, 0x9ce0, 0x0018, 0x2001, 0x1818,
+	0x2004, 0x9c02, 0x1208, 0x0858, 0x012e, 0x001e, 0x002e, 0x004e,
+	0x005e, 0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x2001,
+	0x180f, 0x2004, 0xd0dc, 0x0005, 0x0006, 0x2001, 0x1835, 0x2004,
+	0xd09c, 0x000e, 0x0005, 0x0006, 0x0036, 0x0046, 0x080c, 0xbcec,
+	0x0168, 0x2019, 0xffff, 0x9005, 0x0128, 0x6010, 0x00b6, 0x2058,
+	0xbba0, 0x00be, 0x2021, 0x0004, 0x080c, 0x4829, 0x004e, 0x003e,
+	0x000e, 0x6004, 0x9086, 0x0001, 0x1128, 0x080c, 0x94b5, 0x080c,
+	0x9a06, 0x9006, 0x0005, 0x0126, 0x0006, 0x00e6, 0x0016, 0x2091,
+	0x8000, 0x2071, 0x1840, 0xd5a4, 0x0118, 0x7034, 0x8000, 0x7036,
+	0xd5b4, 0x0118, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0178, 0x2500,
+	0x9084, 0x0007, 0x908e, 0x0003, 0x0148, 0x908e, 0x0004, 0x0130,
+	0x908e, 0x0005, 0x0118, 0x2071, 0x184a, 0x0089, 0x001e, 0x00ee,
+	0x000e, 0x012e, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000,
+	0x2071, 0x1842, 0x0021, 0x00ee, 0x000e, 0x012e, 0x0005, 0x2e04,
+	0x8000, 0x2072, 0x1220, 0x8e70, 0x2e04, 0x8000, 0x2072, 0x0005,
+	0x00e6, 0x2071, 0x1840, 0x0c99, 0x00ee, 0x0005, 0x00e6, 0x2071,
+	0x1844, 0x0c69, 0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091,
+	0x8000, 0x2071, 0x1840, 0x7044, 0x8000, 0x7046, 0x00ee, 0x000e,
+	0x012e, 0x0005, 0x0002, 0x0003, 0x03d8, 0x0000, 0x8064, 0x0008,
+	0x0010, 0x0000, 0x8066, 0x0000, 0x0101, 0x0008, 0x4406, 0x000b,
+	0x8060, 0x0000, 0x0400, 0x0000, 0x580c, 0x0003, 0x7933, 0x0003,
+	0x5090, 0x000b, 0x4c09, 0x0003, 0xbac0, 0x0009, 0x008a, 0x0000,
+	0x0c09, 0x000b, 0x15fe, 0x0008, 0x3409, 0x0003, 0x808c, 0x0008,
+	0x0001, 0x0000, 0x0000, 0x0007, 0x4047, 0x000a, 0x808c, 0x0008,
+	0x0002, 0x0000, 0x081b, 0x0003, 0x4022, 0x0000, 0x001c, 0x0003,
+	0x4122, 0x0008, 0x4447, 0x0002, 0x0de8, 0x0003, 0x0bfe, 0x0008,
+	0x11a0, 0x0001, 0x11ca, 0x000b, 0x0ca0, 0x0001, 0x11ca, 0x000b,
+	0x9180, 0x0001, 0x0004, 0x0000, 0x8060, 0x0000, 0x0400, 0x0000,
+	0x7f62, 0x0008, 0x8066, 0x0000, 0x0009, 0x0008, 0x442a, 0x0003,
+	0x808c, 0x0008, 0x0000, 0x0008, 0x0060, 0x0008, 0x8062, 0x0008,
+	0x0004, 0x0000, 0x8066, 0x0000, 0x0411, 0x0000, 0x4432, 0x0003,
+	0x03fe, 0x0000, 0x43e0, 0x0001, 0x0dc7, 0x000b, 0xc2c0, 0x0009,
+	0x00ff, 0x0008, 0x02e0, 0x0001, 0x0dc7, 0x000b, 0x9180, 0x0001,
+	0x0005, 0x0008, 0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008,
+	0x8066, 0x0000, 0x0019, 0x0000, 0x4441, 0x000b, 0x0240, 0x0002,
+	0x09c4, 0x0003, 0x00fe, 0x0000, 0x31c7, 0x000b, 0x112a, 0x0000,
+	0x002e, 0x0008, 0x022c, 0x0008, 0x3a44, 0x0002, 0x0c09, 0x000b,
+	0x808c, 0x0008, 0x0002, 0x0000, 0x1760, 0x0008, 0x8062, 0x0008,
+	0x000f, 0x0008, 0x8066, 0x0000, 0x0011, 0x0008, 0x4452, 0x0003,
+	0x01fe, 0x0008, 0x42e0, 0x0009, 0x0dba, 0x000b, 0x00fe, 0x0000,
+	0x43e0, 0x0001, 0x0dba, 0x000b, 0x1734, 0x0000, 0x1530, 0x0000,
+	0x1632, 0x0008, 0x0d2a, 0x0008, 0x9880, 0x0001, 0x0010, 0x0000,
+	0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000,
+	0x1e0a, 0x0008, 0x4464, 0x0003, 0x808a, 0x0008, 0x0003, 0x0008,
+	0x1a60, 0x0000, 0x8062, 0x0008, 0x0002, 0x0000, 0x586a, 0x0003,
+	0x8066, 0x0000, 0x3679, 0x0000, 0x446d, 0x0003, 0x586e, 0x000b,
+	0x8054, 0x0008, 0x0011, 0x0008, 0x8074, 0x0000, 0x1010, 0x0008,
+	0x1efe, 0x0000, 0x3009, 0x000b, 0x0077, 0x0004, 0x0009, 0x000b,
+	0x1c60, 0x0000, 0x1b62, 0x0000, 0x8066, 0x0000, 0x0231, 0x0008,
+	0x447b, 0x000b, 0x587c, 0x000b, 0x0140, 0x0008, 0x0242, 0x0000,
+	0x1f43, 0x0002, 0x0c86, 0x0003, 0x0d44, 0x0000, 0x0d46, 0x0008,
+	0x0348, 0x0008, 0x044a, 0x0008, 0x008a, 0x0003, 0x0344, 0x0008,
+	0x0446, 0x0008, 0x0548, 0x0008, 0x064a, 0x0000, 0x588a, 0x000b,
+	0x8054, 0x0008, 0x0001, 0x0000, 0x8074, 0x0000, 0x2020, 0x0008,
+	0x4000, 0x000f, 0x3a40, 0x000a, 0x0c0c, 0x000b, 0x2b24, 0x0008,
+	0x2b24, 0x0008, 0x5894, 0x000b, 0x8054, 0x0008, 0x0002, 0x0000,
+	0x1242, 0x0002, 0x08d8, 0x0003, 0x3a45, 0x000a, 0x08c9, 0x0003,
+	0x1e10, 0x000a, 0x7f3c, 0x0000, 0x08c6, 0x0003, 0x1d00, 0x0002,
+	0x7f3a, 0x0000, 0x0d60, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000,
+	0x0009, 0x0008, 0x44a4, 0x0003, 0x00fe, 0x0000, 0x34c3, 0x0003,
+	0x1c60, 0x0000, 0x8062, 0x0008, 0x0001, 0x0000, 0x8066, 0x0000,
+	0x0009, 0x0008, 0x44ac, 0x000b, 0x00fe, 0x0000, 0x31a3, 0x0003,
+	0x0038, 0x0000, 0x0060, 0x0008, 0x8062, 0x0008, 0x0019, 0x0000,
+	0x8066, 0x0000, 0x0009, 0x0008, 0x44b5, 0x0003, 0x80c0, 0x0009,
+	0x00ff, 0x0008, 0x7f3e, 0x0008, 0x0d60, 0x0000, 0x0efe, 0x0008,
+	0x1f80, 0x0001, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0009, 0x0008,
+	0x44bf, 0x0003, 0x003a, 0x0008, 0x1dfe, 0x0000, 0x00a0, 0x000b,
+	0x0036, 0x0008, 0x0077, 0x0004, 0x00d8, 0x000b, 0x8074, 0x0000,
+	0x2000, 0x0000, 0x00d8, 0x000b, 0x3a44, 0x0002, 0x09cd, 0x0003,
+	0x8074, 0x0000, 0x1000, 0x0000, 0x2d0e, 0x0000, 0x2d0e, 0x0000,
+	0x35a3, 0x000b, 0x26fe, 0x0008, 0x26fe, 0x0008, 0x2700, 0x0008,
+	0x2700, 0x0008, 0x00d0, 0x0009, 0x0ce6, 0x0003, 0x8074, 0x0000,
+	0x4040, 0x0008, 0x58d8, 0x0003, 0x5090, 0x000b, 0x3a46, 0x000a,
+	0x0ce6, 0x0003, 0x3a47, 0x0002, 0x08e3, 0x000b, 0x8054, 0x0008,
+	0x0004, 0x0000, 0x8074, 0x0000, 0x8000, 0x0000, 0x0127, 0x0003,
+	0x92c0, 0x0009, 0x0f88, 0x0008, 0x0809, 0x0003, 0x1a60, 0x0000,
+	0x8062, 0x0008, 0x0002, 0x0000, 0x8066, 0x0000, 0x362a, 0x0000,
+	0x44eb, 0x000b, 0x2000, 0x0000, 0x2000, 0x0000, 0x2102, 0x0000,
+	0x2102, 0x0000, 0x2204, 0x0000, 0x2204, 0x0000, 0x2306, 0x0000,
+	0x2306, 0x0000, 0x2408, 0x0000, 0x2408, 0x0000, 0x250a, 0x0000,
+	0x250a, 0x0000, 0x260c, 0x0000, 0x260c, 0x0000, 0x270e, 0x0000,
+	0x270e, 0x0000, 0x2810, 0x0000, 0x2810, 0x0000, 0x2912, 0x0000,
+	0x2912, 0x0000, 0x1a60, 0x0000, 0x8062, 0x0008, 0x0007, 0x0000,
+	0x8066, 0x0000, 0x0052, 0x0000, 0x4505, 0x0003, 0x92c0, 0x0009,
+	0x0780, 0x0008, 0x0db4, 0x0003, 0x124b, 0x0002, 0x090e, 0x0003,
+	0x2e4d, 0x0002, 0x2e4d, 0x0002, 0x09a3, 0x000b, 0x3a46, 0x000a,
+	0x0d1b, 0x0003, 0x5910, 0x0003, 0x8054, 0x0008, 0x0004, 0x0000,
+	0x1243, 0x000a, 0x0925, 0x0003, 0x8010, 0x0008, 0x000d, 0x0000,
+	0x0194, 0x0004, 0x1810, 0x0000, 0x0194, 0x0004, 0x0125, 0x000b,
+	0x194d, 0x000a, 0x091f, 0x0003, 0x1243, 0x000a, 0x09aa, 0x000b,
+	0x591f, 0x0003, 0x8054, 0x0008, 0x0004, 0x0000, 0x0189, 0x0004,
+	0x1810, 0x0000, 0x0194, 0x0004, 0x8074, 0x0000, 0xf000, 0x0008,
+	0x0d30, 0x0000, 0x3a42, 0x0002, 0x0d2d, 0x0003, 0x15fe, 0x0008,
+	0x344b, 0x0003, 0x0009, 0x000b, 0x8074, 0x0000, 0x0501, 0x0000,
+	0x8010, 0x0008, 0x000c, 0x0008, 0x0194, 0x0004, 0x0009, 0x000b,
+	0xbbe0, 0x0009, 0x0030, 0x0008, 0x0d43, 0x000b, 0x18fe, 0x0000,
+	0x3ce0, 0x0009, 0x0940, 0x0003, 0x15fe, 0x0008, 0x3ce0, 0x0009,
+	0x0940, 0x0003, 0x0184, 0x000c, 0x8076, 0x0008, 0x0040, 0x0000,
+	0x0181, 0x0003, 0x8076, 0x0008, 0x0041, 0x0008, 0x0181, 0x0003,
+	0xbbe0, 0x0009, 0x0032, 0x0000, 0x0d48, 0x0003, 0x3c1e, 0x0008,
+	0x0181, 0x0003, 0xbbe0, 0x0009, 0x0037, 0x0000, 0x0d66, 0x0003,
+	0x18fe, 0x0000, 0x3ce0, 0x0009, 0x0d40, 0x000b, 0x8076, 0x0008,
+	0x0040, 0x0000, 0x1a60, 0x0000, 0x8062, 0x0008, 0x000d, 0x0000,
+	0x2604, 0x0008, 0x2604, 0x0008, 0x2706, 0x0008, 0x2706, 0x0008,
+	0x2808, 0x0000, 0x2808, 0x0000, 0x290a, 0x0000, 0x290a, 0x0000,
+	0x8066, 0x0000, 0x0422, 0x0000, 0x455d, 0x000b, 0x0189, 0x0004,
+	0x8054, 0x0008, 0x0004, 0x0000, 0x8074, 0x0000, 0xf000, 0x0008,
+	0x8072, 0x0000, 0x8000, 0x0000, 0x0127, 0x0003, 0xbbe0, 0x0009,
+	0x0038, 0x0000, 0x0d78, 0x0003, 0x18fe, 0x0000, 0x3ce0, 0x0009,
+	0x0975, 0x0003, 0x15fe, 0x0008, 0x3ce0, 0x0009, 0x0d3c, 0x0003,
+	0x0184, 0x000c, 0x8076, 0x0008, 0x0040, 0x0000, 0x8072, 0x0000,
+	0x8000, 0x0000, 0x01c4, 0x000b, 0x8076, 0x0008, 0x0042, 0x0008,
+	0x0181, 0x0003, 0xbbe0, 0x0009, 0x0016, 0x0000, 0x0d81, 0x0003,
+	0x3a44, 0x0002, 0x0c0b, 0x0003, 0x8072, 0x0000, 0x8000, 0x0000,
+	0x8000, 0x000f, 0x0009, 0x000b, 0x8072, 0x0000, 0x8000, 0x0000,
+	0x0009, 0x000b, 0x3d30, 0x000a, 0x7f00, 0x0000, 0xbc80, 0x0001,
+	0x0007, 0x0000, 0x018d, 0x0003, 0x1930, 0x000a, 0x7f00, 0x0000,
+	0x9880, 0x0001, 0x0007, 0x0000, 0x8060, 0x0000, 0x0400, 0x0000,
+	0x7f62, 0x0008, 0x8066, 0x0000, 0x000a, 0x0008, 0x4592, 0x000b,
+	0x4000, 0x000f, 0x2194, 0x0003, 0x0870, 0x0008, 0x4000, 0x000f,
+	0xbac0, 0x0009, 0x0090, 0x0008, 0x099d, 0x0003, 0x8074, 0x0000,
+	0x0706, 0x0000, 0x019f, 0x0003, 0x8074, 0x0000, 0x0703, 0x0000,
+	0x4000, 0x000f, 0x8010, 0x0008, 0x0008, 0x0000, 0x01d2, 0x0003,
+	0x0189, 0x0004, 0x8010, 0x0008, 0x0007, 0x0000, 0x0194, 0x0004,
+	0x1810, 0x0000, 0x0194, 0x0004, 0x01dc, 0x000b, 0x0189, 0x0004,
+	0x8010, 0x0008, 0x001b, 0x0008, 0x0194, 0x0004, 0x1810, 0x0000,
+	0x0194, 0x0004, 0x8074, 0x0000, 0xf080, 0x0000, 0x0d30, 0x0000,
+	0x0009, 0x000b, 0x8010, 0x0008, 0x0009, 0x0008, 0x01d2, 0x0003,
+	0x8010, 0x0008, 0x0005, 0x0008, 0x01d2, 0x0003, 0x808c, 0x0008,
+	0x0001, 0x0000, 0x8010, 0x0008, 0x0004, 0x0000, 0x4143, 0x000a,
+	0x0859, 0x0003, 0x3a44, 0x0002, 0x0c09, 0x000b, 0x0d2a, 0x0008,
+	0x01d2, 0x0003, 0x8010, 0x0008, 0x0003, 0x0008, 0x01d4, 0x0003,
+	0x8010, 0x0008, 0x000b, 0x0000, 0x01d4, 0x0003, 0x8010, 0x0008,
+	0x0002, 0x0000, 0x01d4, 0x0003, 0x3a47, 0x0002, 0x0cd8, 0x000b,
+	0x8010, 0x0008, 0x0006, 0x0008, 0x01d4, 0x0003, 0x8074, 0x0000,
+	0xf000, 0x0008, 0x0194, 0x0004, 0x0197, 0x0004, 0x3a40, 0x000a,
+	0x0809, 0x0003, 0x8010, 0x0008, 0x000c, 0x0008, 0x0194, 0x0004,
+	0x0009, 0x000b, 0x8074, 0x0000, 0xf080, 0x0000, 0x0d30, 0x0000,
+	0x2e4d, 0x0002, 0x2e4d, 0x0002, 0x09e5, 0x0003, 0x8054, 0x0008,
+	0x0019, 0x0000, 0x0009, 0x000b, 0x8054, 0x0008, 0x0009, 0x0008,
+	0x0009, 0x000b, 0x3a44, 0x0002, 0x0c09, 0x000b, 0x01c7, 0x000b,
+	0x55d0, 0xf6d9, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020,
+	0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000,
+	0x4000, 0x8000, 0xac74
+};
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2300tpx_length01 = 0xcf5b;
+#else
+unsigned short risc_code_length01 = 0xcf5b;
+#endif
+
diff -Nru a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/qla_dbg.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,1229 @@
+/*
+ *                  QLOGIC LINUX SOFTWARE
+ *
+ * QLogic ISP2x00 device driver for Linux 2.6.x
+ * Copyright (C) 2003 QLogic Corporation
+ * (www.qlogic.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+#include "qla_os.h"
+
+#include "qla_def.h"
+
+static int qla_uprintf(char **, char *, ...);
+
+/**
+ * qla2300_fw_dump() - Dumps binary data from the 2300 firmware.
+ * @ha: HA context
+ * @hardware_locked: Called with the hardware_lock
+ */
+void
+qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
+{
+	int		rval;
+	uint32_t	cnt, timer;
+	uint32_t	risc_address;
+	uint16_t	mb0, mb2;
+
+	uint32_t	stat;
+	device_reg_t	*reg;
+	uint16_t	*dmp_reg;
+	unsigned long	flags;
+	struct qla2300_fw_dump	*fw;
+
+	reg = ha->iobase;
+	risc_address = 0;
+	mb0 = mb2 = 0;
+	flags = 0;
+
+	if (!hardware_locked)
+		spin_lock_irqsave(&ha->hardware_lock, flags);
+
+	if (ha->fw_dump != NULL) {
+		qla_printk(KERN_WARNING, ha,
+		    "Firmware has been previously dumped (%p) -- ignoring "
+		    "request...\n", ha->fw_dump);
+		return;
+	}
+
+	/* Allocate (large) dump buffer. */
+	ha->fw_dump_order = get_order(sizeof(struct qla2300_fw_dump));
+	ha->fw_dump = (struct qla2300_fw_dump *) __get_free_pages(GFP_ATOMIC,
+	    ha->fw_dump_order);
+	if (ha->fw_dump == NULL) {
+		qla_printk(KERN_WARNING, ha,
+		    "Unable to allocated memory for firmware dump (%d/%d).\n",
+		    ha->fw_dump_order, sizeof(struct qla2300_fw_dump));
+		return;
+	}
+	fw = ha->fw_dump;
+
+	rval = QLA_SUCCESS;
+	fw->hccr = RD_REG_WORD(&reg->hccr);
+
+	/* Pause RISC. */
+	WRT_REG_WORD(&reg->hccr, HCCR_PAUSE_RISC); 
+	if (!IS_QLA2312(ha) && !IS_QLA2322(ha)) {
+		for (cnt = 30000;
+		    (RD_REG_WORD(&reg->hccr) & HCCR_RISC_PAUSE) == 0 &&
+			rval == QLA_SUCCESS; cnt--) {
+			if (cnt)
+				udelay(100);
+			else
+				rval = QLA_FUNCTION_TIMEOUT;
+		}
+	} else {
+		udelay(10);
+	}
+
+	if (rval == QLA_SUCCESS) {
+		dmp_reg = (uint16_t *)(reg + 0);
+		for (cnt = 0; cnt < sizeof(fw->pbiu_reg) / 2; cnt++) 
+			fw->pbiu_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x10);
+		for (cnt = 0; cnt < sizeof(fw->risc_host_reg) / 2; cnt++) 
+			fw->risc_host_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x40);
+		for (cnt = 0; cnt < sizeof(fw->mailbox_reg) / 2; cnt++) 
+			fw->mailbox_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->ctrl_status, 0x40);
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->resp_dma_reg) / 2; cnt++) 
+			fw->resp_dma_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->ctrl_status, 0x50);
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->dma_reg) / 2; cnt++) 
+			fw->dma_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->ctrl_status, 0x00);
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0xA0);
+		for (cnt = 0; cnt < sizeof(fw->risc_hdw_reg) / 2; cnt++) 
+			fw->risc_hdw_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->pcr, 0x2000); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->risc_gp0_reg) / 2; cnt++) 
+			fw->risc_gp0_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->pcr, 0x2200); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->risc_gp1_reg) / 2; cnt++) 
+			fw->risc_gp1_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->pcr, 0x2400); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->risc_gp2_reg) / 2; cnt++) 
+			fw->risc_gp2_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->pcr, 0x2600); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->risc_gp3_reg) / 2; cnt++) 
+			fw->risc_gp3_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->pcr, 0x2800); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->risc_gp4_reg) / 2; cnt++) 
+			fw->risc_gp4_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->pcr, 0x2A00); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->risc_gp5_reg) / 2; cnt++) 
+			fw->risc_gp5_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->pcr, 0x2C00); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->risc_gp6_reg) / 2; cnt++) 
+			fw->risc_gp6_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->pcr, 0x2E00); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->risc_gp7_reg) / 2; cnt++) 
+			fw->risc_gp7_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->ctrl_status, 0x10); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->frame_buf_hdw_reg) / 2; cnt++) 
+			fw->frame_buf_hdw_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->ctrl_status, 0x20); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->fpm_b0_reg) / 2; cnt++) 
+			fw->fpm_b0_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->ctrl_status, 0x30); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->fpm_b1_reg) / 2; cnt++) 
+			fw->fpm_b1_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		/* Reset RISC. */
+		WRT_REG_WORD(&reg->ctrl_status, CSR_ISP_SOFT_RESET);
+		for (cnt = 0; cnt < 30000; cnt++) {
+			if ((RD_REG_WORD(&reg->ctrl_status) &
+			    CSR_ISP_SOFT_RESET) == 0)
+				break;
+
+			udelay(10);
+		}
+	}
+
+	if (IS_QLA2312(ha) || IS_QLA2322(ha)) {
+		for (cnt = 30000; RD_MAILBOX_REG(ha, reg, 0) != 0 &&
+		    rval == QLA_SUCCESS; cnt--) {
+			if (cnt)
+				udelay(100);
+			else
+				rval = QLA_FUNCTION_TIMEOUT;
+		}
+	}
+
+	if (rval == QLA_SUCCESS) {
+		/* Get RISC SRAM. */
+		risc_address = 0x800;
+ 		WRT_MAILBOX_REG(ha, reg, 0, MBC_READ_RAM_WORD);
+		clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
+	}
+	for (cnt = 0; cnt < sizeof(fw->risc_ram) / 2 && rval == QLA_SUCCESS;
+	    cnt++, risc_address++) {
+ 		WRT_MAILBOX_REG(ha, reg, 1, (uint16_t)risc_address);
+		WRT_REG_WORD(&reg->hccr, HCCR_SET_HOST_INT);
+
+		for (timer = 6000000; timer; timer--) {
+			/* Check for pending interrupts. */
+ 			stat = RD_REG_DWORD(&reg->u.isp2300.host_status);
+			if (stat & HSR_RISC_INT) {
+				stat &= 0xff;
+
+				if (stat == 0x1 || stat == 0x2) {
+					set_bit(MBX_INTERRUPT,
+					    &ha->mbx_cmd_flags);
+
+					mb0 = RD_MAILBOX_REG(ha, reg, 0);
+					mb2 = RD_MAILBOX_REG(ha, reg, 2);
+
+					/* Release mailbox registers. */
+					WRT_REG_WORD(&reg->semaphore, 0);
+					WRT_REG_WORD(&reg->hccr,
+					    HCCR_CLR_RISC_INT);
+					break;
+				} else if (stat == 0x10 || stat == 0x11) {
+					set_bit(MBX_INTERRUPT,
+					    &ha->mbx_cmd_flags);
+
+					mb0 = RD_MAILBOX_REG(ha, reg, 0);
+					mb2 = RD_MAILBOX_REG(ha, reg, 2);
+
+					WRT_REG_WORD(&reg->hccr,
+					    HCCR_CLR_RISC_INT);
+					break;
+				}
+
+				/* clear this intr; it wasn't a mailbox intr */
+				WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT);
+			}
+			udelay(5);
+		}
+
+		if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) {
+			rval = mb0 & MBS_MASK;
+			fw->risc_ram[cnt] = mb2;
+		} else {
+			rval = QLA_FUNCTION_FAILED;
+		}
+	}
+
+	if (rval == QLA_SUCCESS) {
+		/* Get stack SRAM. */
+		risc_address = 0x10000;
+ 		WRT_MAILBOX_REG(ha, reg, 0, MBC_READ_RAM_EXTENDED);
+		clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
+	}
+	for (cnt = 0; cnt < sizeof(fw->stack_ram) / 2 && rval == QLA_SUCCESS;
+	    cnt++, risc_address++) {
+ 		WRT_MAILBOX_REG(ha, reg, 1, LSW(risc_address));
+ 		WRT_MAILBOX_REG(ha, reg, 8, MSW(risc_address));
+		WRT_REG_WORD(&reg->hccr, HCCR_SET_HOST_INT);
+
+		for (timer = 6000000; timer; timer--) {
+			/* Check for pending interrupts. */
+ 			stat = RD_REG_DWORD(&reg->u.isp2300.host_status);
+			if (stat & HSR_RISC_INT) {
+				stat &= 0xff;
+
+				if (stat == 0x1 || stat == 0x2) {
+					set_bit(MBX_INTERRUPT,
+					    &ha->mbx_cmd_flags);
+
+					mb0 = RD_MAILBOX_REG(ha, reg, 0);
+					mb2 = RD_MAILBOX_REG(ha, reg, 2);
+
+					/* Release mailbox registers. */
+					WRT_REG_WORD(&reg->semaphore, 0);
+					WRT_REG_WORD(&reg->hccr,
+					    HCCR_CLR_RISC_INT);
+					break;
+				} else if (stat == 0x10 || stat == 0x11) {
+					set_bit(MBX_INTERRUPT,
+					    &ha->mbx_cmd_flags);
+
+					mb0 = RD_MAILBOX_REG(ha, reg, 0);
+					mb2 = RD_MAILBOX_REG(ha, reg, 2);
+
+					WRT_REG_WORD(&reg->hccr,
+					    HCCR_CLR_RISC_INT);
+					break;
+				}
+
+				/* clear this intr; it wasn't a mailbox intr */
+				WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT);
+			}
+			udelay(5);
+		}
+
+		if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) {
+			rval = mb0 & MBS_MASK;
+			fw->stack_ram[cnt] = mb2;
+		} else {
+			rval = QLA_FUNCTION_FAILED;
+		}
+	}
+
+	if (rval == QLA_SUCCESS) {
+		/* Get data SRAM. */
+		risc_address = 0x11000;
+ 		WRT_MAILBOX_REG(ha, reg, 0, MBC_READ_RAM_EXTENDED);
+		clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
+	}
+	for (cnt = 0; cnt < sizeof(fw->data_ram) / 2 && rval == QLA_SUCCESS;
+	    cnt++, risc_address++) {
+ 		WRT_MAILBOX_REG(ha, reg, 1, LSW(risc_address));
+ 		WRT_MAILBOX_REG(ha, reg, 8, MSW(risc_address));
+		WRT_REG_WORD(&reg->hccr, HCCR_SET_HOST_INT);
+
+		for (timer = 6000000; timer; timer--) {
+			/* Check for pending interrupts. */
+ 			stat = RD_REG_DWORD(&reg->u.isp2300.host_status);
+			if (stat & HSR_RISC_INT) {
+				stat &= 0xff;
+
+				if (stat == 0x1 || stat == 0x2) {
+					set_bit(MBX_INTERRUPT,
+					    &ha->mbx_cmd_flags);
+
+					mb0 = RD_MAILBOX_REG(ha, reg, 0);
+					mb2 = RD_MAILBOX_REG(ha, reg, 2);
+
+					/* Release mailbox registers. */
+					WRT_REG_WORD(&reg->semaphore, 0);
+					WRT_REG_WORD(&reg->hccr,
+					    HCCR_CLR_RISC_INT);
+					break;
+				} else if (stat == 0x10 || stat == 0x11) {
+					set_bit(MBX_INTERRUPT,
+					    &ha->mbx_cmd_flags);
+
+					mb0 = RD_MAILBOX_REG(ha, reg, 0);
+					mb2 = RD_MAILBOX_REG(ha, reg, 2);
+
+					WRT_REG_WORD(&reg->hccr,
+					    HCCR_CLR_RISC_INT);
+					break;
+				}
+
+				/* clear this intr; it wasn't a mailbox intr */
+				WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT);
+			}
+			udelay(5);
+		}
+
+		if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) {
+			rval = mb0 & MBS_MASK;
+			fw->data_ram[cnt] = mb2;
+		} else {
+			rval = QLA_FUNCTION_FAILED;
+		}
+	}
+
+
+	if (rval != QLA_SUCCESS) {
+		qla_printk(KERN_WARNING, ha,
+		    "Failed to dump firmware (%d)!!!\n", rval);
+
+		free_pages((unsigned long)ha->fw_dump, ha->fw_dump_order);
+		ha->fw_dump = NULL;
+	} else {
+		qla_printk(KERN_INFO, ha,
+		    "Firmware dump saved to temp buffer (%ld/%p).\n",
+		    ha->host_no, ha->fw_dump);
+	}
+
+	if (!hardware_locked)
+		spin_unlock_irqrestore(&ha->hardware_lock, flags);
+}
+
+/**
+ * qla2300_ascii_fw_dump() - Converts a binary firmware dump to ASCII.
+ * @ha: HA context
+ */
+void
+qla2300_ascii_fw_dump(scsi_qla_host_t *ha)
+{
+	uint32_t cnt;
+	char *uiter;
+	char fw_info[30];
+	struct qla2300_fw_dump *fw;
+
+	uiter = ha->fw_dump_buffer;
+	fw = ha->fw_dump;
+
+	qla_uprintf(&uiter, "%s Firmware Version %s\n", ha->model_number,
+	    qla2x00_get_fw_version_str(ha, fw_info));
+
+	qla_uprintf(&uiter, "\n[==>BEG]\n");
+
+	qla_uprintf(&uiter, "HCCR Register:\n%04x\n\n", fw->hccr);
+
+	qla_uprintf(&uiter, "PBIU Registers:");
+	for (cnt = 0; cnt < sizeof (fw->pbiu_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->pbiu_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nReqQ-RspQ-Risc2Host Status registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_host_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_host_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nMailbox Registers:");
+	for (cnt = 0; cnt < sizeof (fw->mailbox_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->mailbox_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nAuto Request Response DMA Registers:");
+	for (cnt = 0; cnt < sizeof (fw->resp_dma_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->resp_dma_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nDMA Registers:");
+	for (cnt = 0; cnt < sizeof (fw->dma_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->dma_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC Hardware Registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_hdw_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_hdw_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC GP0 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_gp0_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_gp0_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC GP1 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_gp1_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_gp1_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC GP2 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_gp2_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_gp2_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC GP3 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_gp3_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_gp3_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC GP4 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_gp4_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_gp4_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC GP5 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_gp5_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_gp5_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC GP6 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_gp6_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_gp6_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC GP7 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_gp7_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_gp7_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nFrame Buffer Hardware Registers:");
+	for (cnt = 0; cnt < sizeof (fw->frame_buf_hdw_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->frame_buf_hdw_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nFPM B0 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->fpm_b0_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->fpm_b0_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nFPM B1 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->fpm_b1_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->fpm_b1_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nCode RAM Dump:");
+	for (cnt = 0; cnt < sizeof (fw->risc_ram) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n%04x: ", cnt + 0x0800);
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_ram[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nStack RAM Dump:");
+	for (cnt = 0; cnt < sizeof (fw->stack_ram) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n%05x: ", cnt + 0x10000);
+		}
+		qla_uprintf(&uiter, "%04x ", fw->stack_ram[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nData RAM Dump:");
+	for (cnt = 0; cnt < sizeof (fw->data_ram) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n%05x: ", cnt + 0x11000);
+		}
+		qla_uprintf(&uiter, "%04x ", fw->data_ram[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\n[<==END] ISP Debug Dump.");
+}
+
+/**
+ * qla2100_fw_dump() - Dumps binary data from the 2100/2200 firmware.
+ * @ha: HA context
+ * @hardware_locked: Called with the hardware_lock
+ */
+void
+qla2100_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
+{
+	int		rval;
+	uint32_t	cnt, timer;
+	uint32_t	risc_address;
+	uint16_t	mb0, mb2;
+
+	device_reg_t	*reg;
+	uint16_t	*dmp_reg;
+	unsigned long	flags;
+	struct qla2100_fw_dump	*fw;
+
+	reg = ha->iobase;
+	risc_address = 0;
+	mb0 = mb2 = 0;
+	flags = 0;
+
+	if (!hardware_locked)
+		spin_lock_irqsave(&ha->hardware_lock, flags);
+
+	if (ha->fw_dump != NULL) {
+		qla_printk(KERN_WARNING, ha,
+		    "Firmware has been previously dumped (%p) -- ignoring "
+		    "request...\n", ha->fw_dump);
+		return;
+	}
+
+	/* Allocate (large) dump buffer. */
+	ha->fw_dump_order = get_order(sizeof(struct qla2100_fw_dump));
+	ha->fw_dump = (struct qla2100_fw_dump *) __get_free_pages(GFP_ATOMIC,
+	    ha->fw_dump_order);
+	if (ha->fw_dump == NULL) {
+		qla_printk(KERN_WARNING, ha,
+		    "Unable to allocated memory for firmware dump (%d/%d).\n",
+		    ha->fw_dump_order, sizeof(struct qla2100_fw_dump));
+		return;
+	}
+	fw = ha->fw_dump;
+
+	rval = QLA_SUCCESS;
+	fw->hccr = RD_REG_WORD(&reg->hccr);
+
+	/* Pause RISC. */
+	WRT_REG_WORD(&reg->hccr, HCCR_PAUSE_RISC); 
+	for (cnt = 30000; (RD_REG_WORD(&reg->hccr) & HCCR_RISC_PAUSE) == 0 &&
+	    rval == QLA_SUCCESS; cnt--) {
+		if (cnt)
+			udelay(100);
+		else
+			rval = QLA_FUNCTION_TIMEOUT;
+	}
+
+	if (rval == QLA_SUCCESS) {
+		dmp_reg = (uint16_t *)(reg + 0);
+		for (cnt = 0; cnt < sizeof(fw->pbiu_reg) / 2; cnt++) 
+			fw->pbiu_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x10);
+		for (cnt = 0; cnt < ha->mbx_count; cnt++) {
+			if (cnt == 8) {
+				dmp_reg = (uint16_t *)((uint8_t *)reg + 0xe0);
+			}
+			fw->mailbox_reg[cnt] = RD_REG_WORD(dmp_reg++);
+		}
+
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x20);
+		for (cnt = 0; cnt < sizeof(fw->dma_reg) / 2; cnt++) 
+			fw->dma_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->ctrl_status, 0x00);
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0xA0);
+		for (cnt = 0; cnt < sizeof(fw->risc_hdw_reg) / 2; cnt++) 
+			fw->risc_hdw_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->pcr, 0x2000); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->risc_gp0_reg) / 2; cnt++) 
+			fw->risc_gp0_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->pcr, 0x2100); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->risc_gp1_reg) / 2; cnt++) 
+			fw->risc_gp1_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->pcr, 0x2200); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->risc_gp2_reg) / 2; cnt++) 
+			fw->risc_gp2_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->pcr, 0x2300); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->risc_gp3_reg) / 2; cnt++) 
+			fw->risc_gp3_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->pcr, 0x2400); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->risc_gp4_reg) / 2; cnt++) 
+			fw->risc_gp4_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->pcr, 0x2500); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->risc_gp5_reg) / 2; cnt++) 
+			fw->risc_gp5_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->pcr, 0x2600); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->risc_gp6_reg) / 2; cnt++) 
+			fw->risc_gp6_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->pcr, 0x2700); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->risc_gp7_reg) / 2; cnt++) 
+			fw->risc_gp7_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->ctrl_status, 0x10); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->frame_buf_hdw_reg) / 2; cnt++) 
+			fw->frame_buf_hdw_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->ctrl_status, 0x20); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->fpm_b0_reg) / 2; cnt++) 
+			fw->fpm_b0_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		WRT_REG_WORD(&reg->ctrl_status, 0x30); 
+		dmp_reg = (uint16_t *)((uint8_t *)reg + 0x80);
+		for (cnt = 0; cnt < sizeof(fw->fpm_b1_reg) / 2; cnt++) 
+			fw->fpm_b1_reg[cnt] = RD_REG_WORD(dmp_reg++);
+
+		/* Disable ISP interrupts. */
+		WRT_REG_WORD(&reg->ictrl, 0);
+
+		/* Reset RISC module. */
+		WRT_REG_WORD(&reg->hccr, HCCR_RESET_RISC);
+
+		/* Release RISC module. */
+		WRT_REG_WORD(&reg->hccr, HCCR_RELEASE_RISC); 
+
+		/* Insure mailbox registers are free. */
+		WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT); 
+		WRT_REG_WORD(&reg->hccr, HCCR_CLR_HOST_INT); 
+	}
+
+	for (cnt = 30000; RD_MAILBOX_REG(ha, reg, 0) != 0 &&
+	    rval == QLA_SUCCESS; cnt--) {
+		if (cnt)
+			udelay(100);
+		else
+			rval = QLA_FUNCTION_TIMEOUT;
+	}
+
+	/* Pause RISC. */
+	if (rval == QLA_SUCCESS && (IS_QLA2200(ha) || (IS_QLA2100(ha) &&
+	    (RD_REG_WORD(&reg->mctr) & (BIT_1 | BIT_0)) != 0))) {
+
+		WRT_REG_WORD(&reg->hccr, HCCR_PAUSE_RISC); 
+		for (cnt = 30000;
+		    (RD_REG_WORD(&reg->hccr) & HCCR_RISC_PAUSE) == 0 &&
+		    rval == QLA_SUCCESS; cnt--) {
+			if (cnt)
+				udelay(100);
+			else
+				rval = QLA_FUNCTION_TIMEOUT;
+		}
+
+		if (rval == QLA_SUCCESS) {
+			/* Set memory configuration and timing. */
+			if (IS_QLA2100(ha))
+				WRT_REG_WORD(&reg->mctr, 0xf1);
+			else
+				WRT_REG_WORD(&reg->mctr, 0xf2);
+
+			/* Release RISC. */
+			WRT_REG_WORD(&reg->hccr, HCCR_RELEASE_RISC);
+		}
+	}
+
+	if (rval == QLA_SUCCESS) {
+		/* Get RISC SRAM. */
+		risc_address = 0x1000;
+ 		WRT_MAILBOX_REG(ha, reg, 0, MBC_READ_RAM_WORD);
+		clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
+	}
+	for (cnt = 0; cnt < sizeof(fw->risc_ram) / 2 && rval == QLA_SUCCESS;
+	    cnt++, risc_address++) {
+ 		WRT_MAILBOX_REG(ha, reg, 1, (uint16_t)risc_address);
+		WRT_REG_WORD(&reg->hccr, HCCR_SET_HOST_INT);
+
+		for (timer = 6000000; timer != 0; timer--) {
+			/* Check for pending interrupts. */
+			if (RD_REG_WORD(&reg->istatus) & ISR_RISC_INT) {
+				if (RD_REG_WORD(&reg->semaphore) & BIT_0) {
+					set_bit(MBX_INTERRUPT,
+					    &ha->mbx_cmd_flags);
+
+					mb0 = RD_MAILBOX_REG(ha, reg, 0);
+					mb2 = RD_MAILBOX_REG(ha, reg, 2);
+
+					WRT_REG_WORD(&reg->semaphore, 0);
+					WRT_REG_WORD(&reg->hccr,
+					    HCCR_CLR_RISC_INT);
+					break;
+				}
+				WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT);
+			}
+			udelay(5);
+		}
+
+		if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) {
+			rval = mb0 & MBS_MASK;
+			fw->risc_ram[cnt] = mb2;
+		} else {
+			rval = QLA_FUNCTION_FAILED;
+		}
+	}
+
+	if (rval != QLA_SUCCESS) {
+		qla_printk(KERN_WARNING, ha,
+		    "Failed to dump firmware (%d)!!!\n", rval);
+
+		free_pages((unsigned long)ha->fw_dump, ha->fw_dump_order);
+		ha->fw_dump = NULL;
+	} else {
+		qla_printk(KERN_INFO, ha,
+		    "Firmware dump saved to temp buffer (%ld/%p).\n",
+		    ha->host_no, ha->fw_dump);
+	}
+
+	if (!hardware_locked)
+		spin_unlock_irqrestore(&ha->hardware_lock, flags);
+}
+
+/**
+ * qla2100_ascii_fw_dump() - Converts a binary firmware dump to ASCII.
+ * @ha: HA context
+ */
+void
+qla2100_ascii_fw_dump(scsi_qla_host_t *ha)
+{
+	uint32_t cnt;
+	char *uiter;
+	char fw_info[30];
+	struct qla2100_fw_dump *fw;
+
+	uiter = ha->fw_dump_buffer;
+	fw = ha->fw_dump;
+
+	qla_uprintf(&uiter, "%s Firmware Version %s\n", ha->model_number,
+	    qla2x00_get_fw_version_str(ha, fw_info));
+
+	qla_uprintf(&uiter, "\n[==>BEG]\n");
+
+	qla_uprintf(&uiter, "HCCR Register:\n%04x\n\n", fw->hccr);
+
+	qla_uprintf(&uiter, "PBIU Registers:");
+	for (cnt = 0; cnt < sizeof (fw->pbiu_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->pbiu_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nMailbox Registers:");
+	for (cnt = 0; cnt < sizeof (fw->mailbox_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->mailbox_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nDMA Registers:");
+	for (cnt = 0; cnt < sizeof (fw->dma_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->dma_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC Hardware Registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_hdw_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_hdw_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC GP0 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_gp0_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_gp0_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC GP1 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_gp1_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_gp1_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC GP2 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_gp2_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_gp2_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC GP3 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_gp3_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_gp3_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC GP4 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_gp4_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_gp4_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC GP5 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_gp5_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_gp5_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC GP6 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_gp6_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_gp6_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC GP7 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->risc_gp7_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_gp7_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nFrame Buffer Hardware Registers:");
+	for (cnt = 0; cnt < sizeof (fw->frame_buf_hdw_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->frame_buf_hdw_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nFPM B0 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->fpm_b0_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->fpm_b0_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nFPM B1 Registers:");
+	for (cnt = 0; cnt < sizeof (fw->fpm_b1_reg) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n");
+		}
+		qla_uprintf(&uiter, "%04x ", fw->fpm_b1_reg[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\nRISC SRAM:");
+	for (cnt = 0; cnt < sizeof (fw->risc_ram) / 2; cnt++) {
+		if (cnt % 8 == 0) {
+			qla_uprintf(&uiter, "\n%04x: ", cnt + 0x1000);
+		}
+		qla_uprintf(&uiter, "%04x ", fw->risc_ram[cnt]);
+	}
+
+	qla_uprintf(&uiter, "\n\n[<==END] ISP Debug Dump.");
+
+	return;
+}
+
+static int
+qla_uprintf(char **uiter, char *fmt, ...)
+{
+	int	iter, len;
+	char	buf[128];
+	va_list	args;
+ 
+	va_start(args, fmt);
+	len = vsprintf(buf, fmt, args);
+	va_end(args);
+
+	for (iter = 0; iter < len; iter++, *uiter += 1)
+		*uiter[0] = buf[iter];
+
+	return (len);
+}
+
+//FIXME
+
+/****************************************************************************/
+/*                         Driver Debug Functions.                          */
+/****************************************************************************/
+
+void 
+qla2x00_dump_regs(scsi_qla_host_t *ha) 
+{
+	device_reg_t	*reg;
+
+	reg = ha->iobase;
+
+	printk("Mailbox registers:\n");
+	printk("scsi(%ld): mbox 0 0x%04x \n",
+	    ha->host_no, RD_MAILBOX_REG(ha, reg, 0));
+	printk("scsi(%ld): mbox 1 0x%04x \n",
+	    ha->host_no, RD_MAILBOX_REG(ha, reg, 1));
+	printk("scsi(%ld): mbox 2 0x%04x \n",
+	    ha->host_no, RD_MAILBOX_REG(ha, reg, 2));
+	printk("scsi(%ld): mbox 3 0x%04x \n",
+	    ha->host_no, RD_MAILBOX_REG(ha, reg, 3));
+	printk("scsi(%ld): mbox 4 0x%04x \n",
+	    ha->host_no, RD_MAILBOX_REG(ha, reg, 4));
+	printk("scsi(%ld): mbox 5 0x%04x \n",
+	    ha->host_no, RD_MAILBOX_REG(ha, reg, 5));
+}
+
+
+void
+qla2x00_dump_buffer(uint8_t * b, uint32_t size) 
+{
+	uint32_t cnt;
+	uint8_t c;
+
+	printk(" 0   1   2   3   4   5   6   7   8   9  "
+	    "Ah  Bh  Ch  Dh  Eh  Fh\n");
+	printk("----------------------------------------"
+	    "----------------------\n");
+
+	for (cnt = 0; cnt < size;) {
+		c = *b++;
+		printk("%02x",(uint32_t) c);
+		cnt++;
+		if (!(cnt % 16))
+			printk("\n");
+		else
+			printk("  ");
+	}
+	if (cnt % 16)
+		printk("\n");
+}
+
+/**************************************************************************
+ *   qla2x00_print_scsi_cmd
+ *	 Dumps out info about the scsi cmd and srb.
+ *   Input	 
+ *	 cmd : struct scsi_cmnd
+ **************************************************************************/
+void
+qla2x00_print_scsi_cmd(struct scsi_cmnd * cmd) 
+{
+	int i;
+	struct scsi_qla_host *ha;
+	srb_t *sp;
+
+	ha = (struct scsi_qla_host *)cmd->device->host->hostdata;
+
+	sp = (srb_t *) cmd->SCp.ptr;
+	printk("SCSI Command @=0x%p, Handle=0x%p\n", cmd, cmd->host_scribble);
+	printk("  chan=0x%02x, target=0x%02x, lun=0x%02x, cmd_len=0x%02x\n",
+	    cmd->device->channel, cmd->device->id, cmd->device->lun,
+	    cmd->cmd_len);
+	printk(" CDB: ");
+	for (i = 0; i < cmd->cmd_len; i++) {
+		printk("0x%02x ", cmd->cmnd[i]);
+	}
+	printk("\n  seg_cnt=%d, allowed=%d, retries=%d, "
+	    "serial_number_at_timeout=0x%lx\n",
+	    cmd->use_sg, cmd->allowed, cmd->retries,
+	    cmd->serial_number_at_timeout);
+	printk("  request buffer=0x%p, request buffer len=0x%x\n",
+	    cmd->request_buffer, cmd->request_bufflen);
+	printk("  tag=%d, transfersize=0x%x\n",
+	    cmd->tag, cmd->transfersize);
+	printk("  serial_number=%lx, SP=%p\n", cmd->serial_number, sp); 
+	printk("  data direction=%d\n", cmd->sc_data_direction);
+
+	if (!sp)
+		return;
+
+	printk("  sp flags=0x%x\n", sp->flags);
+	printk("  r_start=0x%lx, u_start=0x%lx, f_start=0x%lx, state=%d\n",
+	    sp->r_start, sp->u_start, sp->f_start, sp->state);
+
+	printk(" e_start= 0x%lx, ext_history=%d, fo retry=%d, loopid=%x, "
+	    "port path=%d\n", sp->e_start, sp->ext_history, sp->fo_retry_cnt,
+	    sp->lun_queue->fclun->fcport->loop_id,
+	    sp->lun_queue->fclun->fcport->cur_path);
+}
+
+/*
+ * qla2x00_print_q_info
+ * 	 Prints queue info
+ * Input
+ *      q: lun queue	 
+ */ 
+void 
+qla2x00_print_q_info(struct os_lun *q) 
+{
+	printk("Queue info: flags=0x%lx\n", q->q_flag);
+}
+
+#if defined(QL_DEBUG_ROUTINES)
+/*
+ * qla2x00_formatted_dump_buffer
+ *       Prints string plus buffer.
+ *
+ * Input:
+ *       string  = Null terminated string (no newline at end).
+ *       buffer  = buffer address.
+ *       wd_size = word size 8, 16, 32 or 64 bits
+ *       count   = number of words.
+ */
+void
+qla2x00_formatted_dump_buffer(char *string, uint8_t * buffer, 
+				uint8_t wd_size, uint32_t count) 
+{
+	uint32_t cnt;
+	uint16_t *buf16;
+	uint32_t *buf32;
+
+	if (strcmp(string, "") != 0)
+		printk("%s\n",string);
+
+	switch (wd_size) {
+		case 8:
+			printk(" 0    1    2    3    4    5    6    7    "
+				"8    9    Ah   Bh   Ch   Dh   Eh   Fh\n");
+			printk("-----------------------------------------"
+				"-------------------------------------\n");
+
+			for (cnt = 1; cnt <= count; cnt++, buffer++) {
+				printk("%02x",*buffer);
+				if (cnt % 16 == 0)
+					printk("\n");
+				else
+					printk("  ");
+			}
+			if (cnt % 16 != 0)
+				printk("\n");
+			break;
+		case 16:
+			printk("   0      2      4      6      8      Ah "
+				"	Ch     Eh\n");
+			printk("-----------------------------------------"
+				"-------------\n");
+
+			buf16 = (uint16_t *) buffer;
+			for (cnt = 1; cnt <= count; cnt++, buf16++) {
+				printk("%4x",*buf16);
+
+				if (cnt % 8 == 0)
+					printk("\n");
+				else if (*buf16 < 10)
+					printk("   ");
+				else
+					printk("  ");
+			}
+			if (cnt % 8 != 0)
+				printk("\n");
+			break;
+		case 32:
+			printk("       0          4          8          Ch\n");
+			printk("------------------------------------------\n");
+
+			buf32 = (uint32_t *) buffer;
+			for (cnt = 1; cnt <= count; cnt++, buf32++) {
+				printk("%8x", *buf32);
+
+				if (cnt % 4 == 0)
+					printk("\n");
+				else if (*buf32 < 10)
+					printk("   ");
+				else
+					printk("  ");
+			}
+			if (cnt % 4 != 0)
+				printk("\n");
+			break;
+		default:
+			break;
+	}
+}
+
+#endif
+
+
+#if STOP_ON_ERROR
+/**************************************************************************
+*   qla2x00_panic
+*
+**************************************************************************/
+static void 
+qla2x00_panic(char *cp, struct Scsi_Host *host) 
+{
+	struct scsi_qla_host *ha;
+	long *fp;
+
+	ha = (struct scsi_qla_host *) host->hostdata;
+	DEBUG2(ql2x_debug_print = 1;);
+	printk("qla2100 - PANIC:  %s\n", cp);
+	printk("Current time=0x%lx\n", jiffies);
+	printk("Number of pending commands =0x%lx\n", ha->actthreads);
+	printk("Number of queued commands =0x%lx\n", ha->qthreads);
+	printk("Number of free entries = (%d)\n", ha->req_q_cnt);
+	printk("Request Queue @ 0x%lx, Response Queue @ 0x%lx\n",
+			       ha->request_dma, ha->response_dma);
+	printk("Request In Ptr %d\n", ha->req_ring_index);
+	fp = (long *) &ha->flags;
+	printk("HA flags =0x%lx\n", *fp);
+	qla2x00_dump_requests(ha);
+	qla2x00_dump_regs(ha);
+	cli();
+	for (;;) {
+		udelay(2);
+		barrier();
+		/* cpu_relax();*/
+	}
+	sti();
+}
+
+#endif
+
+/**************************************************************************
+*   qla2x00_dump_requests
+*
+**************************************************************************/
+void
+qla2x00_dump_requests(scsi_qla_host_t *ha) 
+{
+
+	struct scsi_cmnd       *cp;
+	srb_t           *sp;
+	int i;
+
+	printk("Outstanding Commands on controller:\n");
+
+	for (i = 1; i < MAX_OUTSTANDING_COMMANDS; i++) {
+		if ((sp = ha->outstanding_cmds[i]) == NULL)
+			continue;
+		if ((cp = sp->cmd) == NULL)
+			continue;
+
+		printk("(%d): Pid=%ld, sp flags=0x%x, cmd=0x%p\n",
+		    i, sp->cmd->serial_number, sp->flags, CMD_SP(sp->cmd));
+	}
+}
diff -Nru a/drivers/scsi/qla2xxx/qla_dbg.h b/drivers/scsi/qla2xxx/qla_dbg.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/qla_dbg.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,229 @@
+/******************************************************************************
+ *                  QLOGIC LINUX SOFTWARE
+ *
+ * QLogic ISP2x00 device driver for Linux 2.6.x
+ * Copyright (C) 2003 QLogic Corporation
+ * (www.qlogic.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ ******************************************************************************/
+
+/*
+ * Firmware Dump structure definition
+ */
+#define FW_DUMP_SIZE	0xBC000		/* bytes */
+
+struct qla2300_fw_dump {
+	uint16_t hccr;
+	uint16_t pbiu_reg[8];
+	uint16_t risc_host_reg[8];
+	uint16_t mailbox_reg[32];
+	uint16_t resp_dma_reg[32];
+	uint16_t dma_reg[48];
+	uint16_t risc_hdw_reg[16];
+	uint16_t risc_gp0_reg[16];
+	uint16_t risc_gp1_reg[16];
+	uint16_t risc_gp2_reg[16];
+	uint16_t risc_gp3_reg[16];
+	uint16_t risc_gp4_reg[16];
+	uint16_t risc_gp5_reg[16];
+	uint16_t risc_gp6_reg[16];
+	uint16_t risc_gp7_reg[16];
+	uint16_t frame_buf_hdw_reg[64];
+	uint16_t fpm_b0_reg[64];
+	uint16_t fpm_b1_reg[64];
+	uint16_t risc_ram[0xf800];
+	uint16_t stack_ram[0x1000];
+	uint16_t data_ram[0xF000];
+};
+
+struct qla2100_fw_dump {
+	uint16_t hccr;
+	uint16_t pbiu_reg[8];
+	uint16_t mailbox_reg[32];
+	uint16_t dma_reg[48];
+	uint16_t risc_hdw_reg[16];
+	uint16_t risc_gp0_reg[16];
+	uint16_t risc_gp1_reg[16];
+	uint16_t risc_gp2_reg[16];
+	uint16_t risc_gp3_reg[16];
+	uint16_t risc_gp4_reg[16];
+	uint16_t risc_gp5_reg[16];
+	uint16_t risc_gp6_reg[16];
+	uint16_t risc_gp7_reg[16];
+	uint16_t frame_buf_hdw_reg[16];
+	uint16_t fpm_b0_reg[64];
+	uint16_t fpm_b1_reg[64];
+	uint16_t risc_ram[0xf000];
+};
+
+/*
+ * Driver debug definitions.
+ */
+/* #define QL_DEBUG_LEVEL_1  */ /* Output register accesses to COM1 */
+/* #define QL_DEBUG_LEVEL_2  */ /* Output error msgs to COM1 */
+/* #define QL_DEBUG_LEVEL_3  */ /* Output function trace msgs to COM1 */
+/* #define QL_DEBUG_LEVEL_4  */ /* Output NVRAM trace msgs to COM1 */
+/* #define QL_DEBUG_LEVEL_5  */ /* Output ring trace msgs to COM1 */
+/* #define QL_DEBUG_LEVEL_6  */ /* Output WATCHDOG timer trace to COM1 */
+/* #define QL_DEBUG_LEVEL_7  */ /* Output RISC load trace msgs to COM1 */
+/* #define QL_DEBUG_LEVEL_8  */ /* Output ring saturation msgs to COM1 */
+/* #define QL_DEBUG_LEVEL_9  */ /* Output IOCTL trace msgs */
+/* #define QL_DEBUG_LEVEL_10 */ /* Output IOCTL error msgs */
+/* #define QL_DEBUG_LEVEL_11 */ /* Output Mbx Cmd trace msgs */
+/* #define QL_DEBUG_LEVEL_12 */ /* Output IP trace msgs */
+/* #define QL_DEBUG_LEVEL_13 */ /* Output fdmi function trace msgs */
+/* #define QL_DEBUG_LEVEL_14 */ /* Output RSCN trace msgs */
+/*
+ *  Local Macro Definitions.
+ */
+#if defined(QL_DEBUG_LEVEL_1)  || defined(QL_DEBUG_LEVEL_2) || \
+    defined(QL_DEBUG_LEVEL_3)  || defined(QL_DEBUG_LEVEL_4) || \
+    defined(QL_DEBUG_LEVEL_5)  || defined(QL_DEBUG_LEVEL_6) || \
+    defined(QL_DEBUG_LEVEL_7)  || defined(QL_DEBUG_LEVEL_8) || \
+    defined(QL_DEBUG_LEVEL_9)  || defined(QL_DEBUG_LEVEL_10) || \
+    defined(QL_DEBUG_LEVEL_11) || defined(QL_DEBUG_LEVEL_12) || \
+    defined(QL_DEBUG_LEVEL_13) || defined(QL_DEBUG_LEVEL_14)
+    #define QL_DEBUG_ROUTINES
+#endif
+
+/*
+* Macros use for debugging the driver.
+*/
+#undef ENTER_TRACE
+#if defined(ENTER_TRACE)
+#define ENTER(x)	do { printk("qla2100 : Entering %s()\n", x); } while (0)
+#define LEAVE(x)	do { printk("qla2100 : Leaving %s()\n", x);  } while (0)
+#define ENTER_INTR(x)	do { printk("qla2100 : Entering %s()\n", x); } while (0)
+#define LEAVE_INTR(x)	do { printk("qla2100 : Leaving %s()\n", x);  } while (0)
+#else
+#define ENTER(x)	do {} while (0)
+#define LEAVE(x)	do {} while (0)
+#define ENTER_INTR(x) 	do {} while (0)
+#define LEAVE_INTR(x)   do {} while (0)
+#endif
+
+#if  DEBUG_QLA2100
+#define DEBUG(x)	do {x;} while (0);
+#else
+#define DEBUG(x)	do {} while (0);
+#endif
+
+#if defined(QL_DEBUG_LEVEL_1)
+#define DEBUG1(x)	do {x;} while (0);
+#else
+#define DEBUG1(x)	do {} while (0);
+#endif
+
+#if defined(QL_DEBUG_LEVEL_2)
+#define DEBUG2(x)       do {x;} while (0);
+#define DEBUG2_3(x)     do {x;} while (0);
+#define DEBUG2_3_11(x)  do {x;} while (0);
+#define DEBUG2_9_10(x)    do {x;} while (0);
+#define DEBUG2_11(x)    do {x;} while (0);
+#else
+#define DEBUG2(x)	do {} while (0);
+#endif
+
+#if defined(QL_DEBUG_LEVEL_3)
+#define DEBUG3(x)	do {x;} while (0);
+#define DEBUG2_3(x)	do {x;} while (0);
+#define DEBUG2_3_11(x)	do {x;} while (0);
+#define DEBUG3_11(x)	do {x;} while (0);
+#else
+#define DEBUG3(x)	do {} while (0);
+  #if !defined(QL_DEBUG_LEVEL_2)
+  #define DEBUG2_3(x)	do {} while (0);
+  #endif
+#endif
+
+#if defined(QL_DEBUG_LEVEL_4)
+#define DEBUG4(x)	do {x;} while (0);
+#else
+#define DEBUG4(x)	do {} while (0);
+#endif
+
+#if defined(QL_DEBUG_LEVEL_5)
+#define DEBUG5(x)          do {x;} while (0);
+#else
+#define DEBUG5(x)	do {} while (0);
+#endif
+
+#if defined(QL_DEBUG_LEVEL_7)
+#define DEBUG7(x)          do {x;} while (0);
+#else
+#define DEBUG7(x)	   do {} while (0);
+#endif
+
+#if defined(QL_DEBUG_LEVEL_9)
+#define DEBUG9(x)       do {x;} while (0);
+#define DEBUG9_10(x)    do {x;} while (0);
+#define DEBUG2_9_10(x)	do {x;} while (0);
+#else
+#define DEBUG9(x)	do {} while (0);
+#endif
+
+#if defined(QL_DEBUG_LEVEL_10)
+#define DEBUG10(x)      do {x;} while (0);
+#define DEBUG2_9_10(x)	do {x;} while (0);
+#define DEBUG9_10(x)	do {x;} while (0);
+#else
+#define DEBUG10(x)	do {} while (0);
+  #if !defined(DEBUG2_9_10)
+  #define DEBUG2_9_10(x)	do {} while (0);
+  #endif
+  #if !defined(DEBUG9_10)
+  #define DEBUG9_10(x)	do {} while (0);
+  #endif
+#endif
+
+#if defined(QL_DEBUG_LEVEL_11)
+#define DEBUG11(x)      do{x;} while(0);
+#if !defined(DEBUG2_11)
+#define DEBUG2_11(x)    do{x;} while(0);
+#endif
+#if !defined(DEBUG2_3_11)
+#define DEBUG2_3_11(x)  do{x;} while(0);
+#endif
+#if !defined(DEBUG3_11)
+#define DEBUG3_11(x)    do{x;} while(0);
+#endif
+#else
+#define DEBUG11(x)	do{} while(0);
+  #if !defined(QL_DEBUG_LEVEL_2)
+  #define DEBUG2_11(x)	do{} while(0);
+    #if !defined(QL_DEBUG_LEVEL_3)
+    #define DEBUG2_3_11(x) do{} while(0);
+    #endif
+  #endif
+  #if !defined(QL_DEBUG_LEVEL_3)
+  #define DEBUG3_11(x)	do{} while(0);
+  #endif
+#endif
+
+#if defined(QL_DEBUG_LEVEL_12)
+#define DEBUG12(x)      do {x;} while (0);
+#else
+#define DEBUG12(x)	do {} while (0);
+#endif
+
+#if defined(QL_DEBUG_LEVEL_13)
+#define DEBUG13(x)      do {x;} while (0)
+#else
+#define DEBUG13(x)	do {} while (0)
+#endif
+
+#if defined(QL_DEBUG_LEVEL_14)
+#define DEBUG14(x)      do {x;} while (0)
+#else
+#define DEBUG14(x)	do {} while (0)
+#endif
diff -Nru a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/qla_def.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,2371 @@
+/********************************************************************************
+*                  QLOGIC LINUX SOFTWARE
+*
+* QLogic ISP2x00 device driver for Linux 2.6.x
+* Copyright (C) 2003 QLogic Corporation
+* (www.qlogic.com)
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation; either version 2, or (at your option) any
+* later version.
+*
+* This program is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* General Public License for more details.
+**
+******************************************************************************/
+
+#ifndef __QLA_DEF_H
+#define __QLA_DEF_H
+
+/* XXX(hch): move to pci_ids.h */
+#ifndef PCI_DEVICE_ID_QLOGIC_ISP2300
+#define PCI_DEVICE_ID_QLOGIC_ISP2300	0x2300
+#endif
+
+#ifndef PCI_DEVICE_ID_QLOGIC_ISP2312
+#define PCI_DEVICE_ID_QLOGIC_ISP2312	0x2312
+#endif
+
+#ifndef PCI_DEVICE_ID_QLOGIC_ISP2322
+#define PCI_DEVICE_ID_QLOGIC_ISP2322	0x2322
+#endif
+
+#if defined(CONFIG_SCSI_QLA21XX) || defined(CONFIG_SCSI_QLA21XX_MODULE)
+#define IS_QLA2100(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2100)
+#else
+#define IS_QLA2100(ha)	0
+#endif
+
+#if defined(CONFIG_SCSI_QLA22XX) || defined(CONFIG_SCSI_QLA22XX_MODULE)
+#define IS_QLA2200(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2200)
+#else
+#define IS_QLA2200(ha)	0
+#endif
+
+#if defined(CONFIG_SCSI_QLA23XX) || defined(CONFIG_SCSI_QLA23XX_MODULE)
+#define IS_QLA2300(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2300)
+#define IS_QLA2312(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2312)
+#define IS_QLA2322(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2322)
+#define IS_QLA23XX(ha)	(IS_QLA2300(ha) || IS_QLA2312(ha) || IS_QLA2322(ha))
+#else
+#define IS_QLA2300(ha)	0
+#define IS_QLA2312(ha)	0
+#define IS_QLA2322(ha)	0
+#define IS_QLA23XX(ha)	0
+#endif
+
+/*
+ * Only ISP23XX has extended addressing support in the firmware.
+ */
+#define HAS_EXTENDED_IDS(ha)	IS_QLA23XX(ha)
+
+/*
+ * We have MAILBOX_REGISTER_COUNT sized arrays in a few places,
+ * but that's fine as we don't look at the last 24 ones for
+ * ISP2100 HBAs.
+ */
+#define MAILBOX_REGISTER_COUNT_2100	8
+#define MAILBOX_REGISTER_COUNT		32
+
+#define QLA2200A_RISC_ROM_VER	4
+#define FPM_2300		6
+#define FPM_2310		7
+
+#include "qla_settings.h"
+
+/* 
+ * Data bit definitions
+ */
+#define BIT_0	0x1
+#define BIT_1	0x2
+#define BIT_2	0x4
+#define BIT_3	0x8
+#define BIT_4	0x10
+#define BIT_5	0x20
+#define BIT_6	0x40
+#define BIT_7	0x80
+#define BIT_8	0x100
+#define BIT_9	0x200
+#define BIT_10	0x400
+#define BIT_11	0x800
+#define BIT_12	0x1000
+#define BIT_13	0x2000
+#define BIT_14	0x4000
+#define BIT_15	0x8000
+#define BIT_16	0x10000
+#define BIT_17	0x20000
+#define BIT_18	0x40000
+#define BIT_19	0x80000
+#define BIT_20	0x100000
+#define BIT_21	0x200000
+#define BIT_22	0x400000
+#define BIT_23	0x800000
+#define BIT_24	0x1000000
+#define BIT_25	0x2000000
+#define BIT_26	0x4000000
+#define BIT_27	0x8000000
+#define BIT_28	0x10000000
+#define BIT_29	0x20000000
+#define BIT_30	0x40000000
+#define BIT_31	0x80000000
+
+#define LSB(x)	((uint8_t)(x))
+#define MSB(x)	((uint8_t)((uint16_t)(x) >> 8))
+
+#define LSW(x)	((uint16_t)(x))
+#define MSW(x)	((uint16_t)((uint32_t)(x) >> 16))
+
+#define LSD(x)	((uint32_t)((uint64_t)(x)))
+#define MSD(x)	((uint32_t)((((uint64_t)(x)) >> 16) >> 16))
+
+
+/*
+ * I/O register
+*/
+
+#if MEMORY_MAPPED_IO
+#define RD_REG_BYTE(addr)		readb(addr)
+#define RD_REG_WORD(addr)		readw(addr)
+#define RD_REG_DWORD(addr)		readl(addr)
+#define WRT_REG_BYTE(addr, data)	writeb(data,addr)
+#define WRT_REG_WORD(addr, data)	writew(data,addr)
+#define WRT_REG_DWORD(addr, data)	writel(data,addr)
+#else   /* MEMORY_MAPPED_IO */
+#define RD_REG_BYTE(addr)		(inb((unsigned long)addr))
+#define RD_REG_WORD(addr)		(inw((unsigned long)addr))
+#define RD_REG_DWORD(addr)		(inl((unsigned long)addr))
+#define WRT_REG_BYTE(addr, data)	(outb(data,(unsigned long)addr))
+#define WRT_REG_WORD(addr, data)	(outw(data,(unsigned long)addr))
+#define WRT_REG_DWORD(addr, data)	(outl(data,(unsigned long)addr))
+#endif  /* MEMORY_MAPPED_IO */
+
+/*
+ * Fibre Channel device definitions.
+ */
+#define WWN_SIZE		8	/* Size of WWPN, WWN & WWNN */
+#define MAX_FIBRE_DEVICES	512
+#define MAX_FIBRE_LUNS  	256
+#define	MAX_RSCN_COUNT		32
+#define	MAX_HOST_COUNT		16
+
+/*
+ * Host adapter default definitions.
+ */
+#define MAX_BUSES		1  /* We only have one bus today */
+#define MAX_TARGETS_2100	MAX_FIBRE_DEVICES
+#define MAX_TARGETS_2200	MAX_FIBRE_DEVICES
+#define MAX_TARGETS		MAX_FIBRE_DEVICES
+#define MIN_LUNS		8
+#define MAX_LUNS		MAX_FIBRE_LUNS
+#define MAX_CMDS_PER_LUN	255 
+                                    
+/*
+ * Fibre Channel device definitions.
+ */
+#define SNS_LAST_LOOP_ID_2100	0xfe
+#define SNS_LAST_LOOP_ID_2300	0x7ff
+
+#define LAST_LOCAL_LOOP_ID	0x7d
+#define SNS_FL_PORT		0x7e
+#define FABRIC_CONTROLLER	0x7f
+#define SIMPLE_NAME_SERVER	0x80
+#define SNS_FIRST_LOOP_ID	0x81
+#define MANAGEMENT_SERVER	0xfe
+#define BROADCAST		0xff
+
+#define RESERVED_LOOP_ID(x)	((x > LAST_LOCAL_LOOP_ID && \
+				 x < SNS_FIRST_LOOP_ID) || \
+				 x == MANAGEMENT_SERVER || \
+				 x == BROADCAST)
+
+/*
+ * Timeout timer counts in seconds
+ */
+#define PORT_RETRY_TIME			2
+#define LOOP_DOWN_TIMEOUT		60
+#define LOOP_DOWN_TIME			255	/* 240 */
+#define	LOOP_DOWN_RESET			(LOOP_DOWN_TIME - 30)
+
+/* Maximum outstanding commands in ISP queues (1-65535) */
+#define MAX_OUTSTANDING_COMMANDS	1024
+
+/* ISP request and response entry counts (37-65535) */
+#define REQUEST_ENTRY_CNT		1024	/* Number of request entries. */
+#define RESPONSE_ENTRY_CNT_2100		64	/* Number of response entries.*/
+#define RESPONSE_ENTRY_CNT_2300		512	/* Number of response entries.*/
+
+/* Calculations for SG segments */
+#define SEGS_PER_REQUEST_32	3 
+#define SEGS_PER_CONT_32	7
+#define SG_SEGMENTS_32 (SEGS_PER_REQUEST_32 + \
+    (SEGS_PER_CONT_32 * (REQUEST_ENTRY_CNT - 2)))     
+#define SEGS_PER_REQUEST_64	2 
+#define SEGS_PER_CONT_64	5
+#define SG_SEGMENTS_64 (SEGS_PER_REQUEST_64 + \
+    (SEGS_PER_CONT_64 * (REQUEST_ENTRY_CNT - 2)))     
+
+/*
+ * SCSI Request Block 
+ */
+typedef struct srb {
+	struct list_head list;
+
+	struct scsi_qla_host *ha;	/* HA the SP is queued on */
+
+	struct scsi_cmnd *cmd;		/* Linux SCSI command pkt */
+
+	struct timer_list timer;	/* Command timer */
+	atomic_t ref_count;	/* Reference count for this structure */			
+	uint16_t flags;
+
+	/* Request state */
+	uint16_t state;
+
+	/* Target/LUN queue pointers. */
+	struct os_tgt *tgt_queue;	/* ptr to visible ha's target */
+	struct os_lun *lun_queue;	/* ptr to visible ha's lun */
+	struct fc_lun *fclun;		/* FC LUN context pointer. */
+
+	/* Timing counts. */
+	unsigned long e_start;		/* Start of extend timeout */
+	unsigned long r_start;		/* Start of request */
+	unsigned long u_start;		/* When sent to RISC */
+	unsigned long f_start;		/* When placed in FO queue*/
+
+	/* Single transfer DMA context */
+	dma_addr_t dma_handle;
+
+	uint32_t request_sense_length;
+	uint8_t *request_sense_ptr;
+
+	int ext_history;
+
+	/* Suspend delay */
+	int delay;
+
+	/* Raw completion info for use by failover ? */
+	uint8_t	fo_retry_cnt;		/* Retry count this request */
+	uint8_t	err_id;			/* error id */
+
+	/* SRB magic number */
+	uint16_t magic;
+#define SRB_MAGIC       0x10CB
+} srb_t;
+
+/*
+ * SRB flag definitions
+ */
+#define SRB_TIMEOUT		BIT_0	/* Command timed out */
+#define SRB_DMA_VALID		BIT_1	/* Command sent to ISP */
+#define SRB_WATCHDOG		BIT_2	/* Command on watchdog list */
+#define SRB_ABORT_PENDING	BIT_3	/* Command abort sent to device */
+
+#define SRB_ABORTED		BIT_4	/* Command aborted command already */
+#define SRB_RETRY		BIT_5	/* Command needs retrying */
+#define SRB_GOT_SENSE		BIT_6	/* Command has sense data */
+#define SRB_FAILOVER		BIT_7	/* Command in failover state */
+
+#define SRB_BUSY		BIT_8	/* Command is in busy retry state */
+#define SRB_FO_CANCEL		BIT_9	/* Command don't need to do failover */
+#define	SRB_IOCTL		BIT_10	/* IOCTL command. */
+
+/*
+ * SRB state definitions
+ */
+#define SRB_FREE_STATE		0	/*   returned back */
+#define SRB_PENDING_STATE	1	/*   queued in LUN Q */
+#define SRB_ACTIVE_STATE	2	/*   in Active Array */
+#define SRB_DONE_STATE		3	/*   queued in Done Queue */
+#define SRB_RETRY_STATE		4	/*   in Retry Queue */
+#define SRB_SUSPENDED_STATE	5	/*   in suspended state */
+#define SRB_NO_QUEUE_STATE	6	/*   is in between states */
+#define SRB_ACTIVE_TIMEOUT_STATE 7	/*   in Active Array but timed out */
+#define SRB_FAILOVER_STATE	8	/*   in Failover Queue */
+#define SRB_SCSI_RETRY_STATE	9	/*   in Scsi Retry Queue */
+
+
+/*
+ * ISP I/O Register Set structure definitions.
+ */
+typedef volatile struct {
+	volatile uint16_t flash_address; /* Flash BIOS address */
+	volatile uint16_t flash_data;	/* Flash BIOS data */
+	uint16_t unused_1[1];		/* Gap */
+	volatile uint16_t ctrl_status;	/* Control/Status */
+#define CSR_FLASH_64K_BANK	BIT_3	/* Flash upper 64K bank select */ 
+#define CSR_FLASH_ENABLE	BIT_1	/* Flash BIOS Read/Write enable */
+#define CSR_ISP_SOFT_RESET	BIT_0	/* ISP soft reset */
+
+	volatile uint16_t ictrl;	/* Interrupt control */
+#define ICR_EN_INT		BIT_15	/* ISP enable interrupts. */
+#define ICR_EN_RISC		BIT_3	/* ISP enable RISC interrupts. */
+
+	volatile uint16_t istatus;	/* Interrupt status */
+#define ISR_RISC_INT		BIT_3	/* RISC interrupt */
+
+	volatile uint16_t semaphore;	/* Semaphore */
+	volatile uint16_t nvram;	/* NVRAM register. */
+#define NVR_DESELECT		0
+#define NVR_BUSY		BIT_15
+#define NVR_DATA_IN		BIT_3
+#define NVR_DATA_OUT		BIT_2
+#define NVR_SELECT		BIT_1
+#define NVR_CLOCK		BIT_0
+
+	union {
+		struct {
+			volatile uint16_t mailbox0;
+			volatile uint16_t mailbox1;
+			volatile uint16_t mailbox2;
+			volatile uint16_t mailbox3;
+			volatile uint16_t mailbox4;
+			volatile uint16_t mailbox5;
+			volatile uint16_t mailbox6;
+			volatile uint16_t mailbox7;
+			uint16_t unused_2[59];		/* Gap */
+		} __attribute__((packed)) isp2100;
+		struct {
+							/* Request Queue */
+			volatile uint16_t req_q_in;	/*  In-Pointer */
+			volatile uint16_t req_q_out;	/*  Out-Pointer */
+							/* Response Queue */
+			volatile uint16_t rsp_q_in;	/*  In-Pointer */
+			volatile uint16_t rsp_q_out;	/*  Out-Pointer */
+
+						/* RISC to Host Status */
+			volatile uint32_t host_status;	
+#define HSR_RISC_INT		BIT_15	/* RISC interrupt */
+#define HSR_RISC_PAUSED		BIT_8	/* RISC Paused */
+
+					/* Host to Host Semaphore */
+			volatile uint16_t host_semaphore; 
+			uint16_t unused_3[17];		/* Gap */
+			volatile uint16_t mailbox0;
+			volatile uint16_t mailbox1;
+			volatile uint16_t mailbox2;
+			volatile uint16_t mailbox3;
+			volatile uint16_t mailbox4;
+			volatile uint16_t mailbox5;
+			volatile uint16_t mailbox6;
+			volatile uint16_t mailbox7;
+			volatile uint16_t mailbox8;
+			volatile uint16_t mailbox9;
+			volatile uint16_t mailbox10;
+			volatile uint16_t mailbox11;
+			volatile uint16_t mailbox12;
+			volatile uint16_t mailbox13;
+			volatile uint16_t mailbox14;
+			volatile uint16_t mailbox15;
+			volatile uint16_t mailbox16;
+			volatile uint16_t mailbox17;
+			volatile uint16_t mailbox18;
+			volatile uint16_t mailbox19;
+			volatile uint16_t mailbox20;
+			volatile uint16_t mailbox21;
+			volatile uint16_t mailbox22;
+			volatile uint16_t mailbox23;
+			volatile uint16_t mailbox24;
+			volatile uint16_t mailbox25;
+			volatile uint16_t mailbox26;
+			volatile uint16_t mailbox27;
+			volatile uint16_t mailbox28;
+			volatile uint16_t mailbox29;
+			volatile uint16_t mailbox30;
+			volatile uint16_t mailbox31;
+			volatile uint16_t fb_cmd;
+			uint16_t unused_4[10];		/* Gap */
+		} __attribute__((packed)) isp2300;
+	} u;
+
+	volatile uint16_t fpm_diag_config;
+	uint16_t unused_5[0x6];		/* Gap */
+	volatile uint16_t pcr;		/* Processor Control Register. */
+	uint16_t unused_6[0x5];		/* Gap */
+	volatile uint16_t mctr;		/* Memory Configuration and Timing. */
+	uint16_t unused_7[0x3];		/* Gap */
+	volatile uint16_t fb_cmd_2100;	/* Unused on 23XX */
+	uint16_t unused_8[0x3];		/* Gap */
+	volatile uint16_t hccr;		/* Host command & control register. */
+#define HCCR_HOST_INT		BIT_7	/* Host interrupt bit */
+#define HCCR_RISC_PAUSE		BIT_5	/* Pause mode bit */
+					/* HCCR commands */
+#define HCCR_RESET_RISC		0x1000	/* Reset RISC */
+#define HCCR_PAUSE_RISC		0x2000	/* Pause RISC */
+#define HCCR_RELEASE_RISC	0x3000	/* Release RISC from reset. */
+#define HCCR_SET_HOST_INT	0x5000	/* Set host interrupt */
+#define HCCR_CLR_HOST_INT	0x6000	/* Clear HOST interrupt */
+#define HCCR_CLR_RISC_INT	0x7000	/* Clear RISC interrupt */
+#define	HCCR_DISABLE_PARITY_PAUSE 0x4001 /* Disable parity error RISC pause. */
+#define HCCR_ENABLE_PARITY	0xA000	/* Enable PARITY interrupt */
+
+	uint16_t unused_9[5];		/* Gap */
+	volatile uint16_t gpiod;	/* GPIO Data register. */
+	volatile uint16_t gpioe;	/* GPIO Enable register. */
+#define GPIO_LED_MASK			0x00C0
+#define GPIO_LED_GREEN_OFF_AMBER_OFF	0x0000
+#define GPIO_LED_GREEN_ON_AMBER_OFF	0x0040
+#define GPIO_LED_GREEN_OFF_AMBER_ON	0x0080
+#define GPIO_LED_GREEN_ON_AMBER_ON	0x00C0
+
+	union {
+		struct {
+			uint16_t unused_10[8];		/* Gap */
+			volatile uint16_t mailbox8;
+			volatile uint16_t mailbox9;
+			volatile uint16_t mailbox10;
+			volatile uint16_t mailbox11;
+			volatile uint16_t mailbox12;
+			volatile uint16_t mailbox13;
+			volatile uint16_t mailbox14;
+			volatile uint16_t mailbox15;
+			volatile uint16_t mailbox16;
+			volatile uint16_t mailbox17;
+			volatile uint16_t mailbox18;
+			volatile uint16_t mailbox19;
+			volatile uint16_t mailbox20;
+			volatile uint16_t mailbox21;
+			volatile uint16_t mailbox22;
+			volatile uint16_t mailbox23;	/* Also probe reg. */
+		} __attribute__((packed)) isp2200;
+	} u_end;
+} device_reg_t;
+
+#define	ISP_REQ_Q_IN(ha, reg) \
+	(IS_QLA23XX(ha) ? \
+	 &(reg)->u.isp2300.req_q_in : \
+	 &(reg)->u.isp2100.mailbox4)
+#define	ISP_REQ_Q_OUT(ha, reg) \
+	(IS_QLA23XX(ha) ? \
+	 &(reg)->u.isp2300.req_q_out : \
+	 &(reg)->u.isp2100.mailbox4)
+#define	ISP_RSP_Q_IN(ha, reg) \
+	(IS_QLA23XX(ha) ? \
+	 &(reg)->u.isp2300.rsp_q_in : \
+	 &(reg)->u.isp2100.mailbox5)
+#define	ISP_RSP_Q_OUT(ha, reg) \
+	(IS_QLA23XX(ha) ? \
+	 &(reg)->u.isp2300.rsp_q_out : \
+	 &(reg)->u.isp2100.mailbox5)
+
+#define MAILBOX_REG(ha, reg, num) \
+	(IS_QLA23XX(ha) ? \
+	 &(reg)->u.isp2300.mailbox0 + (num) : \
+	 ((num < 8) ? \
+	  &(reg)->u.isp2100.mailbox0 + (num) : \
+	  &(reg)->u_end.isp2200.mailbox8 + (num) - 8))	/* only for isp2200 */
+#define RD_MAILBOX_REG(ha, reg, num) \
+	RD_REG_WORD(MAILBOX_REG(ha, reg, num))
+#define WRT_MAILBOX_REG(ha, reg, num, data) \
+	WRT_REG_WORD(MAILBOX_REG(ha, reg, num), data)
+
+#define FB_CMD_REG(ha, reg) \
+	(IS_QLA23XX(ha) ? &(reg)->u.isp2300.fb_cmd : &(reg)->fb_cmd_2100)
+#define RD_FB_CMD_REG(ha, reg) \
+	RD_REG_WORD(FB_CMD_REG(ha, reg))
+#define WRT_FB_CMD_REG(ha, reg, data) \
+	WRT_REG_WORD(FB_CMD_REG(ha, reg), data)
+
+
+typedef struct {
+	uint32_t	out_mb;		/* outbound from driver */
+	uint32_t	in_mb;			/* Incoming from RISC */
+	uint16_t	mb[MAILBOX_REGISTER_COUNT];
+	long		buf_size;
+	void		*bufp;
+	uint32_t	tov;
+	uint8_t		flags;
+#define MBX_DMA_IN	BIT_0
+#define	MBX_DMA_OUT	BIT_1
+#define IOCTL_CMD	BIT_2
+} mbx_cmd_t;
+
+#define	MBX_TOV_SECONDS	30
+
+/*
+ *  ISP product identification definitions in mailboxes after reset.
+ */
+#define PROD_ID_1		0x4953
+#define PROD_ID_2		0x0000
+#define PROD_ID_2a		0x5020
+#define PROD_ID_3		0x2020
+
+/*
+ * ISP mailbox Self-Test status codes
+ */
+#define MBS_FRM_ALIVE		0	/* Firmware Alive. */
+#define MBS_CHKSUM_ERR		1	/* Checksum Error. */
+#define MBS_BUSY		4	/* Busy. */
+
+/*
+ * ISP mailbox command complete status codes
+ */
+#define MBS_COMMAND_COMPLETE		0x4000
+#define MBS_INVALID_COMMAND		0x4001
+#define MBS_HOST_INTERFACE_ERROR	0x4002
+#define MBS_TEST_FAILED			0x4003
+#define MBS_COMMAND_ERROR		0x4005
+#define MBS_COMMAND_PARAMETER_ERROR	0x4006
+#define MBS_PORT_ID_USED		0x4007
+#define MBS_LOOP_ID_USED		0x4008
+#define MBS_ALL_IDS_IN_USE		0x4009
+#define MBS_NOT_LOGGED_IN		0x400A
+
+/*
+ * ISP mailbox asynchronous event status codes
+ */
+#define MBA_ASYNC_EVENT		0x8000	/* Asynchronous event. */
+#define MBA_RESET		0x8001	/* Reset Detected. */
+#define MBA_SYSTEM_ERR		0x8002	/* System Error. */
+#define MBA_REQ_TRANSFER_ERR	0x8003	/* Request Transfer Error. */
+#define MBA_RSP_TRANSFER_ERR	0x8004	/* Response Transfer Error. */
+#define MBA_WAKEUP_THRES	0x8005	/* Request Queue Wake-up. */
+#define MBA_LIP_OCCURRED	0x8010	/* Loop Initialization Procedure */
+					/* occurred. */
+#define MBA_LOOP_UP		0x8011	/* FC Loop UP. */
+#define MBA_LOOP_DOWN		0x8012	/* FC Loop Down. */
+#define MBA_LIP_RESET		0x8013	/* LIP reset occurred. */
+#define MBA_PORT_UPDATE		0x8014	/* Port Database update. */
+#define MBA_RSCN_UPDATE		0x8015	/* Register State Chg Notification. */
+#define MBA_LIP_F8		0x8016	/* Received a LIP F8. */
+#define MBA_LOOP_INIT_ERR	0x8017	/* Loop Initialization Error. */
+#define MBA_FABRIC_AUTH_REQ	0x801b	/* Fabric Authentication Required. */
+#define MBA_SCSI_COMPLETION	0x8020	/* SCSI Command Complete. */
+#define MBA_CTIO_COMPLETION	0x8021	/* CTIO Complete. */
+#define MBA_IP_COMPLETION	0x8022	/* IP Transmit Command Complete. */
+#define MBA_IP_RECEIVE		0x8023	/* IP Received. */
+#define MBA_IP_BROADCAST	0x8024	/* IP Broadcast Received. */
+#define MBA_IP_LOW_WATER_MARK	0x8025	/* IP Low Water Mark reached. */
+#define MBA_IP_RCV_BUFFER_EMPTY 0x8026	/* IP receive buffer queue empty. */
+#define MBA_IP_HDR_DATA_SPLIT	0x8027	/* IP header/data splitting feature */
+					/* used. */
+#define MBA_POINT_TO_POINT	0x8030	/* Point to point mode. */
+#define MBA_CMPLT_1_16BIT	0x8031	/* Completion 1 16bit IOSB. */
+#define MBA_CMPLT_2_16BIT	0x8032	/* Completion 2 16bit IOSB. */
+#define MBA_CMPLT_3_16BIT	0x8033	/* Completion 3 16bit IOSB. */
+#define MBA_CMPLT_4_16BIT	0x8034	/* Completion 4 16bit IOSB. */
+#define MBA_CMPLT_5_16BIT	0x8035	/* Completion 5 16bit IOSB. */
+#define MBA_CHG_IN_CONNECTION	0x8036	/* Change in connection mode. */
+#define MBA_RIO_RESPONSE	0x8040	/* RIO response queue update. */
+#define MBA_ZIO_RESPONSE	0x8040	/* ZIO response queue update. */
+#define MBA_CMPLT_2_32BIT	0x8042	/* Completion 2 32bit IOSB. */
+#define MBA_BYPASS_NOTIFICATION	0x8043	/* Auto bypass notification. */
+#define MBA_DISCARD_RND_FRAME	0x8048	/* discard RND frame due to error. */
+#define MBA_REJECTED_FCP_CMD	0x8049	/* rejected FCP_CMD. */
+
+/*
+ * Firmware options 1, 2, 3.
+ */
+#define FO1_AE_ON_LIPF8			BIT_0
+#define FO1_AE_ALL_LIP_RESET		BIT_1
+#define FO1_CTIO_RETRY			BIT_3
+#define FO1_DISABLE_LIP_F7_SW		BIT_4
+#define FO1_DISABLE_100MS_LOS_WAIT	BIT_5
+#define FO1_DISABLE_GPIO6_7		BIT_6
+#define FO1_AE_ON_LOOP_INIT_ERR		BIT_7
+#define FO1_SET_EMPHASIS_SWING		BIT_8
+#define FO1_AE_AUTO_BYPASS		BIT_9
+#define FO1_ENABLE_PURE_IOCB		BIT_10
+#define FO1_AE_PLOGI_RJT		BIT_11
+#define FO1_ENABLE_ABORT_SEQUENCE	BIT_12
+#define FO1_AE_QUEUE_FULL		BIT_13
+
+#define FO2_ENABLE_ATIO_TYPE_3		BIT_0
+#define FO2_REV_LOOPBACK		BIT_1
+
+#define FO3_ENABLE_EMERG_IOCB		BIT_0
+#define FO3_AE_RND_ERROR		BIT_1
+
+/*
+ * ISP mailbox commands
+ */
+#define MBC_LOAD_RAM			1	/* Load RAM. */
+#define MBC_EXECUTE_FIRMWARE		2	/* Execute firmware. */
+#define MBC_WRITE_RAM_WORD		4	/* Write RAM word. */
+#define MBC_READ_RAM_WORD		5	/* Read RAM word. */
+#define MBC_MAILBOX_REGISTER_TEST	6	/* Wrap incoming mailboxes */
+#define MBC_VERIFY_CHECKSUM		7	/* Verify checksum. */
+#define MBC_GET_FIRMWARE_VERSION	8	/* Get firmware revision. */
+#define MBC_LOAD_RISC_RAM		9	/* Load RAM command. */
+#define MBC_DUMP_RISC_RAM		0xa	/* Dump RAM command. */
+#define MBC_LOAD_RISC_RAM_EXTENDED	0xb	/* Load RAM extended. */
+#define MBC_DUMP_RISC_RAM_EXTENDED	0xc	/* Dump RAM extended. */
+#define MBC_WRITE_RAM_WORD_EXTENDED	0xd	/* Write RAM word extended */
+#define MBC_READ_RAM_EXTENDED		0xf	/* Read RAM extended. */
+#define MBC_IOCB_COMMAND		0x12	/* Execute IOCB command. */
+#define MBC_ABORT_COMMAND		0x15	/* Abort IOCB command. */
+#define MBC_ABORT_DEVICE		0x16	/* Abort device (ID/LUN). */
+#define MBC_ABORT_TARGET		0x17	/* Abort target (ID). */
+#define MBC_RESET			0x18	/* Reset. */
+#define MBC_GET_ADAPTER_LOOP_ID		0x20	/* Get loop id of ISP2200. */
+#define MBC_GET_RETRY_COUNT		0x22	/* Get f/w retry cnt/delay. */
+#define MBC_DISABLE_VI			0x24	/* Disable VI operation. */
+#define MBC_ENABLE_VI			0x25	/* Enable VI operation. */
+#define MBC_GET_FIRMWARE_OPTION		0x28	/* Get Firmware Options. */
+#define MBC_SET_FIRMWARE_OPTION		0x38	/* Set Firmware Options. */
+#define MBC_LOOP_PORT_BYPASS		0x40	/* Loop Port Bypass. */
+#define MBC_LOOP_PORT_ENABLE		0x41	/* Loop Port Enable. */
+#define MBC_GET_RESOURCE_COUNTS		0x42	/* Get Resource Counts. */
+#define MBC_NON_PARTICIPATE		0x43	/* Non-Participating Mode. */
+#define MBC_DIAGNOSTIC_ECHO		0x44	/* Diagnostic echo. */
+#define MBC_DIAGNOSTIC_LOOP_BACK	0x45	/* Diagnostic loop back. */
+#define MBC_ONLINE_SELF_TEST		0x46	/* Online self-test. */
+#define MBC_ENHANCED_GET_PORT_DATABASE	0x47	/* Get port database + login */
+#define MBC_RESET_LINK_STATUS		0x52	/* Reset Link Error Status */
+#define MBC_IOCB_COMMAND_A64		0x54	/* Execute IOCB command (64) */
+#define MBC_SEND_RNID_ELS		0x57	/* Send RNID ELS request */
+#define MBC_SET_RNID_PARAMS		0x59	/* Set RNID parameters */
+#define MBC_GET_RNID_PARAMS		0x5a	/* Data Rate */
+#define MBC_DATA_RATE			0x5d	/* Get RNID parameters */
+#define MBC_INITIALIZE_FIRMWARE		0x60	/* Initialize firmware */
+#define MBC_INITIATE_LIP		0x62	/* Initiate Loop */
+						/* Initialization Procedure */
+#define MBC_GET_FC_AL_POSITION_MAP	0x63	/* Get FC_AL Position Map. */
+#define MBC_GET_PORT_DATABASE		0x64	/* Get Port Database. */
+#define MBC_CLEAR_ACA			0x65	/* Clear ACA. */
+#define MBC_TARGET_RESET		0x66	/* Target Reset. */
+#define MBC_CLEAR_TASK_SET		0x67	/* Clear Task Set. */
+#define MBC_ABORT_TASK_SET		0x68	/* Abort Task Set. */
+#define MBC_GET_FIRMWARE_STATE		0x69	/* Get firmware state. */
+#define MBC_GET_PORT_NAME		0x6a	/* Get port name. */
+#define MBC_GET_LINK_STATUS		0x6b	/* Get port link status. */
+#define MBC_LIP_RESET			0x6c	/* LIP reset. */
+#define MBC_SEND_SNS_COMMAND		0x6e	/* Send Simple Name Server */
+						/* commandd. */
+#define MBC_LOGIN_FABRIC_PORT		0x6f	/* Login fabric port. */
+#define MBC_SEND_CHANGE_REQUEST		0x70	/* Send Change Request. */
+#define MBC_LOGOUT_FABRIC_PORT		0x71	/* Logout fabric port. */
+#define MBC_LIP_FULL_LOGIN		0x72	/* Full login LIP. */
+#define MBC_LOGIN_LOOP_PORT		0x74	/* Login Loop Port. */
+#define MBC_PORT_NODE_NAME_LIST		0x75	/* Get port/node name list. */
+#define MBC_INITIALIZE_RECEIVE_QUEUE	0x77	/* Initialize receive queue */
+#define MBC_UNLOAD_IP			0x79	/* Shutdown IP */
+#define MBC_GET_ID_LIST			0x7C	/* Get Port ID list. */
+#define MBC_SEND_LFA_COMMAND		0x7D	/* Send Loop Fabric Address */
+#define MBC_LUN_RESET			0x7E	/* Send LUN reset */
+
+/* Firmware return data sizes */
+#define FCAL_MAP_SIZE	128
+
+/* Mailbox bit definitions for out_mb and in_mb */
+#define	MBX_31		BIT_31
+#define	MBX_30		BIT_30
+#define	MBX_29		BIT_29
+#define	MBX_28		BIT_28
+#define	MBX_27		BIT_27
+#define	MBX_26		BIT_26
+#define	MBX_25		BIT_25
+#define	MBX_24		BIT_24
+#define	MBX_23		BIT_23
+#define	MBX_22		BIT_22
+#define	MBX_21		BIT_21
+#define	MBX_20		BIT_20
+#define	MBX_19		BIT_19
+#define	MBX_18		BIT_18
+#define	MBX_17		BIT_17
+#define	MBX_16		BIT_16
+#define	MBX_15		BIT_15
+#define	MBX_14		BIT_14
+#define	MBX_13		BIT_13
+#define	MBX_12		BIT_12
+#define	MBX_11		BIT_11
+#define	MBX_10		BIT_10
+#define	MBX_9		BIT_9
+#define	MBX_8		BIT_8
+#define	MBX_7		BIT_7
+#define	MBX_6		BIT_6
+#define	MBX_5		BIT_5
+#define	MBX_4		BIT_4
+#define	MBX_3		BIT_3
+#define	MBX_2		BIT_2
+#define	MBX_1		BIT_1
+#define	MBX_0		BIT_0
+
+/*
+ * Firmware state codes from get firmware state mailbox command
+ */
+#define FSTATE_CONFIG_WAIT      0
+#define FSTATE_WAIT_AL_PA       1
+#define FSTATE_WAIT_LOGIN       2
+#define FSTATE_READY            3
+#define FSTATE_LOSS_OF_SYNC     4
+#define FSTATE_ERROR            5
+#define FSTATE_REINIT           6
+#define FSTATE_NON_PART         7
+
+#define FSTATE_CONFIG_CORRECT      0
+#define FSTATE_P2P_RCV_LIP         1
+#define FSTATE_P2P_CHOOSE_LOOP     2
+#define FSTATE_P2P_RCV_UNIDEN_LIP  3
+#define FSTATE_FATAL_ERROR         4
+#define FSTATE_LOOP_BACK_CONN      5
+
+/*
+ * Port Database structure definition
+ * Little endian except where noted.
+ */
+#define	PORT_DATABASE_SIZE	128	/* bytes */
+typedef struct {
+	uint8_t options;
+	uint8_t control;
+	uint8_t master_state;
+	uint8_t slave_state;
+	uint8_t reserved[2];
+	uint8_t hard_address;
+	uint8_t reserved_1;
+	uint8_t port_id[4];
+	uint8_t node_name[WWN_SIZE];		/* Big endian. */
+	uint8_t port_name[WWN_SIZE];		/* Big endian. */
+	uint16_t execution_throttle;
+	uint16_t execution_count;
+	uint8_t reset_count;
+	uint8_t reserved_2;
+	uint16_t resource_allocation;
+	uint16_t current_allocation;
+	uint16_t queue_head;
+	uint16_t queue_tail;
+	uint16_t transmit_execution_list_next;
+	uint16_t transmit_execution_list_previous;
+	uint16_t common_features;
+	uint16_t total_concurrent_sequences;
+	uint16_t RO_by_information_category;
+	uint8_t recipient;
+	uint8_t initiator;
+	uint16_t receive_data_size;
+	uint16_t concurrent_sequences;
+	uint16_t open_sequences_per_exchange;
+	uint16_t lun_abort_flags;
+	uint16_t lun_stop_flags;
+	uint16_t stop_queue_head;
+	uint16_t stop_queue_tail;
+	uint16_t port_retry_timer;
+	uint16_t next_sequence_id;
+	uint16_t frame_count;
+	uint16_t PRLI_payload_length;
+	uint8_t prli_svc_param_word_0[2];	/* Big endian */
+						/* Bits 15-0 of word 0 */
+	uint8_t prli_svc_param_word_3[2];	/* Big endian */
+						/* Bits 15-0 of word 3 */
+	uint16_t loop_id;
+	uint16_t extended_lun_info_list_pointer;
+	uint16_t extended_lun_stop_list_pointer;
+} port_database_t;
+
+/*
+ * Port database slave/master states
+ */
+#define PD_STATE_DISCOVERY			0
+#define PD_STATE_WAIT_DISCOVERY_ACK		1
+#define PD_STATE_PORT_LOGIN			2
+#define PD_STATE_WAIT_PORT_LOGIN_ACK		3
+#define PD_STATE_PROCESS_LOGIN			4
+#define PD_STATE_WAIT_PROCESS_LOGIN_ACK		5
+#define PD_STATE_PORT_LOGGED_IN			6
+#define PD_STATE_PORT_UNAVAILABLE		7
+#define PD_STATE_PROCESS_LOGOUT			8
+#define PD_STATE_WAIT_PROCESS_LOGOUT_ACK	9
+#define PD_STATE_PORT_LOGOUT			10
+#define PD_STATE_WAIT_PORT_LOGOUT_ACK		11
+
+
+/*
+ * ISP Initialization Control Block.
+ * Little endian except where noted.
+ */
+#define	ICB_VERSION 1
+typedef struct {
+	uint8_t  version;
+	uint8_t  reserved_1;
+
+	/*
+	 * LSB BIT 0  = Enable Hard Loop Id
+	 * LSB BIT 1  = Enable Fairness
+	 * LSB BIT 2  = Enable Full-Duplex
+	 * LSB BIT 3  = Enable Fast Posting
+	 * LSB BIT 4  = Enable Target Mode
+	 * LSB BIT 5  = Disable Initiator Mode
+	 * LSB BIT 6  = Enable ADISC
+	 * LSB BIT 7  = Enable Target Inquiry Data
+	 *
+	 * MSB BIT 0  = Enable PDBC Notify
+	 * MSB BIT 1  = Non Participating LIP
+	 * MSB BIT 2  = Descending Loop ID Search
+	 * MSB BIT 3  = Acquire Loop ID in LIPA
+	 * MSB BIT 4  = Stop PortQ on Full Status
+	 * MSB BIT 5  = Full Login after LIP
+	 * MSB BIT 6  = Node Name Option
+	 * MSB BIT 7  = Ext IFWCB enable bit
+	 */
+	uint8_t  firmware_options[2];
+
+	uint16_t frame_payload_size;
+	uint16_t max_iocb_allocation;
+	uint16_t execution_throttle;
+	uint8_t  retry_count;
+	uint8_t	 retry_delay;			/* unused */
+	uint8_t	 port_name[WWN_SIZE];		/* Big endian. */
+	uint16_t hard_address;
+	uint8_t	 inquiry_data;
+	uint8_t	 login_timeout;
+	uint8_t	 node_name[WWN_SIZE];		/* Big endian. */
+
+	uint16_t request_q_outpointer;
+	uint16_t response_q_inpointer;
+	uint16_t request_q_length;
+	uint16_t response_q_length;
+	uint32_t request_q_address[2];
+	uint32_t response_q_address[2];
+
+	uint16_t lun_enables;
+	uint8_t  command_resource_count;
+	uint8_t  immediate_notify_resource_count;
+	uint16_t timeout;
+	uint8_t  reserved_2[2];
+
+	/*
+	 * LSB BIT 0 = Timer Operation mode bit 0
+	 * LSB BIT 1 = Timer Operation mode bit 1
+	 * LSB BIT 2 = Timer Operation mode bit 2
+	 * LSB BIT 3 = Timer Operation mode bit 3
+	 * LSB BIT 4 = Init Config Mode bit 0
+	 * LSB BIT 5 = Init Config Mode bit 1
+	 * LSB BIT 6 = Init Config Mode bit 2
+	 * LSB BIT 7 = Enable Non part on LIHA failure
+	 *
+	 * MSB BIT 0 = Enable class 2
+	 * MSB BIT 1 = Enable ACK0
+	 * MSB BIT 2 =
+	 * MSB BIT 3 =
+	 * MSB BIT 4 = FC Tape Enable
+	 * MSB BIT 5 = Enable FC Confirm
+	 * MSB BIT 6 = Enable command queuing in target mode
+	 * MSB BIT 7 = No Logo On Link Down
+	 */
+	uint8_t	 add_firmware_options[2];
+
+	uint8_t	 response_accumulation_timer;
+	uint8_t	 interrupt_delay_timer;
+
+	/*
+	 * LSB BIT 0 = Enable Read xfr_rdy
+	 * LSB BIT 1 = Soft ID only
+	 * LSB BIT 2 =
+	 * LSB BIT 3 =
+	 * LSB BIT 4 = FCP RSP Payload [0]
+	 * LSB BIT 5 = FCP RSP Payload [1] / Sbus enable - 2200
+	 * LSB BIT 6 = Enable Out-of-Order frame handling
+	 * LSB BIT 7 = Disable Automatic PLOGI on Local Loop
+	 *
+	 * MSB BIT 0 = Sbus enable - 2300
+	 * MSB BIT 1 =
+	 * MSB BIT 2 =
+	 * MSB BIT 3 =
+	 * MSB BIT 4 =
+	 * MSB BIT 5 = enable 50 ohm termination
+	 * MSB BIT 6 = Data Rate (2300 only)
+	 * MSB BIT 7 = Data Rate (2300 only)
+	 */
+	uint8_t	 special_options[2];
+
+	uint8_t  reserved_3[26];
+} init_cb_t;
+
+/*
+ * Get Link Status mailbox command return buffer.
+ */
+typedef struct {
+	uint32_t	link_fail_cnt;
+	uint32_t	loss_sync_cnt;
+	uint32_t	loss_sig_cnt;
+	uint32_t	prim_seq_err_cnt;
+	uint32_t	inval_xmit_word_cnt;
+	uint32_t	inval_crc_cnt;
+} link_stat_t;
+
+/*
+ * NVRAM Command values.
+ */
+#define NV_START_BIT            BIT_2
+#define NV_WRITE_OP             (BIT_26+BIT_24)
+#define NV_READ_OP              (BIT_26+BIT_25)
+#define NV_ERASE_OP             (BIT_26+BIT_25+BIT_24)
+#define NV_MASK_OP              (BIT_26+BIT_25+BIT_24)
+#define NV_DELAY_COUNT          10
+
+/*
+ * QLogic ISP2100, ISP2200 and ISP2300 NVRAM structure definition.
+ */
+typedef struct {
+	/*
+	 * NVRAM header
+	 */
+	uint8_t	id[4];
+	uint8_t	nvram_version;
+	uint8_t	reserved_0;
+
+	/*
+	 * NVRAM RISC parameter block
+	 */
+	uint8_t	parameter_block_version;
+	uint8_t	reserved_1;
+
+	/*
+	 * LSB BIT 0  = Enable Hard Loop Id
+	 * LSB BIT 1  = Enable Fairness
+	 * LSB BIT 2  = Enable Full-Duplex
+	 * LSB BIT 3  = Enable Fast Posting
+	 * LSB BIT 4  = Enable Target Mode
+	 * LSB BIT 5  = Disable Initiator Mode
+	 * LSB BIT 6  = Enable ADISC
+	 * LSB BIT 7  = Enable Target Inquiry Data
+	 *
+	 * MSB BIT 0  = Enable PDBC Notify
+	 * MSB BIT 1  = Non Participating LIP
+	 * MSB BIT 2  = Descending Loop ID Search
+	 * MSB BIT 3  = Acquire Loop ID in LIPA
+	 * MSB BIT 4  = Stop PortQ on Full Status
+	 * MSB BIT 5  = Full Login after LIP
+	 * MSB BIT 6  = Node Name Option
+	 * MSB BIT 7  = Ext IFWCB enable bit
+	 */
+	uint8_t	 firmware_options[2];
+
+	uint16_t frame_payload_size;
+	uint16_t max_iocb_allocation;
+	uint16_t execution_throttle;
+	uint8_t	 retry_count;
+	uint8_t	 retry_delay;			/* unused */
+	uint8_t	 port_name[WWN_SIZE];		/* Big endian. */
+	uint16_t hard_address;
+	uint8_t	 inquiry_data;
+	uint8_t	 login_timeout;
+	uint8_t	 node_name[WWN_SIZE];		/* Big endian. */
+
+	/*
+	 * LSB BIT 0 = Timer Operation mode bit 0
+	 * LSB BIT 1 = Timer Operation mode bit 1
+	 * LSB BIT 2 = Timer Operation mode bit 2
+	 * LSB BIT 3 = Timer Operation mode bit 3
+	 * LSB BIT 4 = Init Config Mode bit 0
+	 * LSB BIT 5 = Init Config Mode bit 1
+	 * LSB BIT 6 = Init Config Mode bit 2
+	 * LSB BIT 7 = Enable Non part on LIHA failure
+	 *
+	 * MSB BIT 0 = Enable class 2
+	 * MSB BIT 1 = Enable ACK0
+	 * MSB BIT 2 =
+	 * MSB BIT 3 =
+	 * MSB BIT 4 = FC Tape Enable
+	 * MSB BIT 5 = Enable FC Confirm
+	 * MSB BIT 6 = Enable command queuing in target mode
+	 * MSB BIT 7 = No Logo On Link Down
+	 */
+	uint8_t	 add_firmware_options[2];
+
+	uint8_t	 response_accumulation_timer;
+	uint8_t	 interrupt_delay_timer;
+
+	/*
+	 * LSB BIT 0 = Enable Read xfr_rdy
+	 * LSB BIT 1 = Soft ID only
+	 * LSB BIT 2 =
+	 * LSB BIT 3 =
+	 * LSB BIT 4 = FCP RSP Payload [0]
+	 * LSB BIT 5 = FCP RSP Payload [1] / Sbus enable - 2200
+	 * LSB BIT 6 = Enable Out-of-Order frame handling
+	 * LSB BIT 7 = Disable Automatic PLOGI on Local Loop
+	 *
+	 * MSB BIT 0 = Sbus enable - 2300
+	 * MSB BIT 1 =
+	 * MSB BIT 2 =
+	 * MSB BIT 3 =
+	 * MSB BIT 4 =
+	 * MSB BIT 5 = enable 50 ohm termination
+	 * MSB BIT 6 = Data Rate (2300 only)
+	 * MSB BIT 7 = Data Rate (2300 only)
+	 */
+	uint8_t	 special_options[2];
+
+	/* Reserved for expanded RISC parameter block */
+	uint8_t reserved_2[24];
+
+	/*
+	 * LSB BIT 0 = Output Swing 1G bit 0
+	 * LSB BIT 1 = Output Swing 1G bit 1
+	 * LSB BIT 2 = Output Swing 1G bit 2
+	 * LSB BIT 3 = Output Emphasis 1G bit 0
+	 * LSB BIT 4 = Output Emphasis 1G bit 1
+	 * LSB BIT 5 = Output Swing 2G bit 0
+	 * LSB BIT 6 = Output Swing 2G bit 1
+	 * LSB BIT 7 = Output Swing 2G bit 2
+	 *            
+	 * MSB BIT 0 = Output Emphasis 2G bit 0
+	 * MSB BIT 1 = Output Emphasis 2G bit 1
+	 * MSB BIT 2 = Output Enable
+	 * MSB BIT 3 =
+	 * MSB BIT 4 =
+	 * MSB BIT 5 =
+	 * MSB BIT 6 =
+	 * MSB BIT 7 =
+	 */
+	uint8_t seriallink_options[2];
+
+	/*
+	 * NVRAM host parameter block
+	 *
+	 * LSB BIT 0 = Enable spinup delay
+	 * LSB BIT 1 = Disable BIOS
+	 * LSB BIT 2 = Enable Memory Map BIOS
+	 * LSB BIT 3 = Enable Selectable Boot
+	 * LSB BIT 4 = Disable RISC code load
+	 * LSB BIT 5 = Set cache line size 1
+	 * LSB BIT 6 = PCI Parity Disable
+	 * LSB BIT 7 = Enable extended logging
+	 *
+	 * MSB BIT 0 = Enable 64bit addressing
+	 * MSB BIT 1 = Enable lip reset
+	 * MSB BIT 2 = Enable lip full login
+	 * MSB BIT 3 = Enable target reset
+	 * MSB BIT 4 = Enable database storage
+	 * MSB BIT 5 = Enable cache flush read
+	 * MSB BIT 6 = Enable database load
+	 * MSB BIT 7 = Enable alternate WWN
+	 */
+	uint8_t host_p[2];
+
+	uint8_t boot_node_name[WWN_SIZE];
+	uint8_t boot_lun_number;
+	uint8_t reset_delay;
+	uint8_t port_down_retry_count;
+	uint8_t boot_id_number;
+	uint16_t max_luns_per_target;
+	uint8_t fcode_boot_port_name[WWN_SIZE];
+	uint8_t alternate_port_name[WWN_SIZE];
+	uint8_t alternate_node_name[WWN_SIZE];
+
+	/*
+	 * BIT 0 = Boot Zoning
+	 * BIT 1 = Alt-Boot Enable
+	 * BIT 2 = Report SCSI Path
+	 * BIT 3 = unused
+	 * BIT 4 = unused
+	 * BIT 5 = unused
+	 * BIT 6 = unused
+	 * BIT 7 = unused
+	 */
+	uint8_t efi_parameters;
+
+	uint8_t link_down_timeout;
+
+	uint8_t adapter_id_0[4];
+	uint8_t adapter_id_1[4];
+	uint8_t adapter_id_2[4];
+	uint8_t adapter_id_3[4];
+
+	uint8_t alt1_boot_node_name[WWN_SIZE];
+	uint16_t alt1_boot_lun_number;
+	uint8_t alt2_boot_node_name[WWN_SIZE];
+	uint16_t alt2_boot_lun_number;
+	uint8_t alt3_boot_node_name[WWN_SIZE];
+	uint16_t alt3_boot_lun_number;
+	uint8_t alt4_boot_node_name[WWN_SIZE];
+	uint16_t alt4_boot_lun_number;
+	uint8_t alt5_boot_node_name[WWN_SIZE];
+	uint16_t alt5_boot_lun_number;
+	uint8_t alt6_boot_node_name[WWN_SIZE];
+	uint16_t alt6_boot_lun_number;
+	uint8_t alt7_boot_node_name[WWN_SIZE];
+	uint16_t alt7_boot_lun_number;
+
+	uint8_t reserved_3[2];
+
+	/* Offset 200-215 : Model Number */
+	uint8_t model_number[16];
+
+	/* OEM related items */
+	uint8_t oem_specific[16];
+
+	/*
+	 * NVRAM Adapter Features offset 232-239
+	 *
+	 * LSB BIT 0 = External GBIC
+	 * LSB BIT 1 = Risc RAM parity
+	 * LSB BIT 2 = Buffer Plus Module
+	 * LSB BIT 3 = Multi Chip Adapter
+	 * LSB BIT 4 = Internal connector
+	 * LSB BIT 5 =
+	 * LSB BIT 6 =
+	 * LSB BIT 7 =
+	 *
+	 * MSB BIT 0 =
+	 * MSB BIT 1 =
+	 * MSB BIT 2 =
+	 * MSB BIT 3 =
+	 * MSB BIT 4 =
+	 * MSB BIT 5 =
+	 * MSB BIT 6 =
+	 * MSB BIT 7 =
+	 */
+	uint8_t	adapter_features[2];
+
+	uint8_t reserved_4[16];
+
+	/* Subsystem vendor ID for ISP2200 */
+	uint16_t subsystem_vendor_id_2200;
+
+	/* Subsystem device ID for ISP2200 */
+	uint16_t subsystem_device_id_2200;
+
+	uint8_t	 reserved_5;
+	uint8_t	 checksum;
+} nvram_t;
+
+/*
+ * ISP queue - response queue entry definition.
+ */
+typedef struct {
+	uint8_t		data[60];
+	uint32_t	signature;
+#define RESPONSE_PROCESSED	0xDEADDEAD	/* Signature */
+} response_t;
+
+typedef union {
+	uint16_t extended;
+	struct {
+		uint8_t reserved;
+		uint8_t standard;
+	} id;
+} target_id_t;
+
+#define SET_TARGET_ID(ha, to, from)			\
+do {							\
+	if (HAS_EXTENDED_IDS(ha))			\
+		to.extended = cpu_to_le16(from);	\
+	else						\
+		to.id.standard = (uint8_t)from;		\
+} while (0)
+
+/*
+ * ISP queue - command entry structure definition.
+ */
+#define COMMAND_TYPE	0x11		/* Command entry */
+#define MAX_CMDSZ	16		/* SCSI maximum CDB size. */
+typedef struct {
+	uint8_t entry_type;		/* Entry type. */
+	uint8_t entry_count;		/* Entry count. */
+	uint8_t sys_define;		/* System defined. */
+	uint8_t entry_status;		/* Entry Status. */
+	uint32_t handle;		/* System handle. */
+	target_id_t target;		/* SCSI ID */
+	uint16_t lun;			/* SCSI LUN */
+	uint16_t control_flags;		/* Control flags. */
+#define CF_WRITE	BIT_6
+#define CF_READ		BIT_5
+#define CF_SIMPLE_TAG	BIT_3
+#define CF_ORDERED_TAG	BIT_2
+#define CF_HEAD_TAG	BIT_1
+	uint16_t reserved_1;
+	uint16_t timeout;		/* Command timeout. */
+	uint16_t dseg_count;		/* Data segment count. */
+	uint8_t scsi_cdb[MAX_CMDSZ]; 	/* SCSI command words. */
+	uint32_t byte_count;		/* Total byte count. */
+	uint32_t dseg_0_address;	/* Data segment 0 address. */
+	uint32_t dseg_0_length;		/* Data segment 0 length. */
+	uint32_t dseg_1_address;	/* Data segment 1 address. */
+	uint32_t dseg_1_length;		/* Data segment 1 length. */
+	uint32_t dseg_2_address;	/* Data segment 2 address. */
+	uint32_t dseg_2_length;		/* Data segment 2 length. */
+} cmd_entry_t;
+
+/*
+ * ISP queue - 64-Bit addressing, command entry structure definition.
+ */
+#define COMMAND_A64_TYPE	0x19	/* Command A64 entry */
+typedef struct {
+	uint8_t entry_type;		/* Entry type. */
+	uint8_t entry_count;		/* Entry count. */
+	uint8_t sys_define;		/* System defined. */
+	uint8_t entry_status;		/* Entry Status. */
+	uint32_t handle;		/* System handle. */
+	target_id_t target;		/* SCSI ID */
+	uint16_t lun;			/* SCSI LUN */
+	uint16_t control_flags;		/* Control flags. */
+	uint16_t reserved_1;
+	uint16_t timeout;		/* Command timeout. */
+	uint16_t dseg_count;		/* Data segment count. */
+	uint8_t scsi_cdb[MAX_CMDSZ];	/* SCSI command words. */
+	uint32_t byte_count;		/* Total byte count. */
+	uint32_t dseg_0_address[2];	/* Data segment 0 address. */
+	uint32_t dseg_0_length;		/* Data segment 0 length. */
+	uint32_t dseg_1_address[2];	/* Data segment 1 address. */
+	uint32_t dseg_1_length;		/* Data segment 1 length. */
+} cmd_a64_entry_t, request_t;
+
+/*
+ * ISP queue - continuation entry structure definition.
+ */
+#define CONTINUE_TYPE		0x02	/* Continuation entry. */
+typedef struct {
+	uint8_t entry_type;		/* Entry type. */
+	uint8_t entry_count;		/* Entry count. */
+	uint8_t sys_define;		/* System defined. */
+	uint8_t entry_status;		/* Entry Status. */
+	uint32_t reserved;
+	uint32_t dseg_0_address;	/* Data segment 0 address. */
+	uint32_t dseg_0_length;		/* Data segment 0 length. */
+	uint32_t dseg_1_address;	/* Data segment 1 address. */
+	uint32_t dseg_1_length;		/* Data segment 1 length. */
+	uint32_t dseg_2_address;	/* Data segment 2 address. */
+	uint32_t dseg_2_length;		/* Data segment 2 length. */
+	uint32_t dseg_3_address;	/* Data segment 3 address. */
+	uint32_t dseg_3_length;		/* Data segment 3 length. */
+	uint32_t dseg_4_address;	/* Data segment 4 address. */
+	uint32_t dseg_4_length;		/* Data segment 4 length. */
+	uint32_t dseg_5_address;	/* Data segment 5 address. */
+	uint32_t dseg_5_length;		/* Data segment 5 length. */
+	uint32_t dseg_6_address;	/* Data segment 6 address. */
+	uint32_t dseg_6_length;		/* Data segment 6 length. */
+} cont_entry_t;
+
+/*
+ * ISP queue - 64-Bit addressing, continuation entry structure definition.
+ */
+#define CONTINUE_A64_TYPE	0x0A	/* Continuation A64 entry. */
+typedef struct {
+	uint8_t entry_type;		/* Entry type. */
+	uint8_t entry_count;		/* Entry count. */
+	uint8_t sys_define;		/* System defined. */
+	uint8_t entry_status;		/* Entry Status. */
+	uint32_t dseg_0_address[2];	/* Data segment 0 address. */
+	uint32_t dseg_0_length;		/* Data segment 0 length. */
+	uint32_t dseg_1_address[2];	/* Data segment 1 address. */
+	uint32_t dseg_1_length;		/* Data segment 1 length. */
+	uint32_t dseg_2_address	[2];	/* Data segment 2 address. */
+	uint32_t dseg_2_length;		/* Data segment 2 length. */
+	uint32_t dseg_3_address[2];	/* Data segment 3 address. */
+	uint32_t dseg_3_length;		/* Data segment 3 length. */
+	uint32_t dseg_4_address[2];	/* Data segment 4 address. */
+	uint32_t dseg_4_length;		/* Data segment 4 length. */
+} cont_a64_entry_t;
+
+/*
+ * ISP queue - status entry structure definition.
+ */
+#define	STATUS_TYPE	0x03		/* Status entry. */
+typedef struct {
+	uint8_t entry_type;		/* Entry type. */
+	uint8_t entry_count;		/* Entry count. */
+	uint8_t sys_define;		/* System defined. */
+	uint8_t entry_status;		/* Entry Status. */
+	uint32_t handle;		/* System handle. */
+	uint16_t scsi_status;		/* SCSI status. */
+	uint16_t comp_status;		/* Completion status. */
+	uint16_t state_flags;		/* State flags. */
+	uint16_t status_flags;		/* Status flags. */
+	uint16_t rsp_info_len;		/* Response Info Length. */
+	uint16_t req_sense_length;	/* Request sense data length. */
+	uint32_t residual_length;	/* Residual transfer length. */
+	uint8_t rsp_info[8];		/* FCP response information. */
+	uint8_t req_sense_data[32];	/* Request sense data. */
+} sts_entry_t;
+
+/*
+ * Status entry entry status
+ */
+#define RF_INV_E_ORDER	BIT_5		/* Invalid entry order. */
+#define RF_INV_E_COUNT	BIT_4		/* Invalid entry count. */
+#define RF_INV_E_PARAM	BIT_3		/* Invalid entry parameter. */
+#define RF_INV_E_TYPE	BIT_2		/* Invalid entry type. */
+#define RF_BUSY		BIT_1		/* Busy */
+
+/*
+ * Status entry SCSI status bit definitions.
+ */
+#define SS_MASK				0xfff	/* Reserved bits BIT_12-BIT_15*/
+#define SS_RESIDUAL_UNDER		BIT_11
+#define SS_RESIDUAL_OVER		BIT_10
+#define SS_SENSE_LEN_VALID		BIT_9
+#define SS_RESIDUAL_LEN_VALID		BIT_8	/* ISP2100 only */
+#define SS_RESPONSE_INFO_LEN_VALID	BIT_8	/* ISP2200 and 23xx */
+
+#define SS_RESERVE_CONFLICT		(BIT_4 | BIT_3)
+#define SS_BUSY_CONDITION		BIT_3
+#define SS_CONDITION_MET		BIT_2
+#define SS_CHECK_CONDITION		BIT_1
+
+/*
+ * Status entry completion status
+ */
+#define CS_COMPLETE		0x0	/* No errors */
+#define CS_INCOMPLETE		0x1	/* Incomplete transfer of cmd. */
+#define CS_DMA			0x2	/* A DMA direction error. */
+#define CS_TRANSPORT		0x3	/* Transport error. */
+#define CS_RESET		0x4	/* SCSI bus reset occurred */
+#define CS_ABORTED		0x5	/* System aborted command. */
+#define CS_TIMEOUT		0x6	/* Timeout error. */
+#define CS_DATA_OVERRUN		0x7	/* Data overrun. */
+
+#define CS_DATA_UNDERRUN	0x15	/* Data Underrun. */
+#define CS_QUEUE_FULL		0x1C	/* Queue Full. */
+#define CS_PORT_UNAVAILABLE	0x28	/* Port unavailable */
+					/* (selection timeout) */
+#define CS_PORT_LOGGED_OUT	0x29	/* Port Logged Out */
+#define CS_PORT_CONFIG_CHG	0x2A	/* Port Configuration Changed */
+#define CS_PORT_BUSY		0x2B	/* Port Busy */
+#define CS_COMPLETE_CHKCOND	0x30	/* Error? */
+#define CS_BAD_PAYLOAD		0x80	/* Driver defined */
+#define CS_UNKNOWN		0x81	/* Driver defined */
+#define CS_RETRY		0x82	/* Driver defined */
+#define CS_LOOP_DOWN_ABORT	0x83	/* Driver defined */
+
+/*
+ * Status entry status flags
+ */
+#define SF_LOGOUT_SENT		BIT_13
+
+/*
+ * ISP queue - status continuation entry structure definition.
+ */
+#define	STATUS_CONT_TYPE	0x10	/* Status continuation entry. */
+typedef struct {
+	uint8_t entry_type;		/* Entry type. */
+	uint8_t entry_count;		/* Entry count. */
+	uint8_t sys_define;		/* System defined. */
+	uint8_t entry_status;		/* Entry Status. */
+	uint8_t data[60];		/* data */
+} sts_cont_entry_t;
+
+/*
+ * ISP queue -	RIO Type 1 status entry (32 bit I/O entry handles)
+ *		structure definition.
+ */
+#define	STATUS_TYPE_21 0x21		/* Status entry. */
+typedef struct {
+	uint8_t entry_type;		/* Entry type. */
+	uint8_t entry_count;		/* Entry count. */
+	uint8_t handle_count;		/* Handle count. */
+	uint8_t entry_status;		/* Entry Status. */
+	uint32_t handle[15];		/* System handles. */
+} sts21_entry_t;
+
+/*
+ * ISP queue -	RIO Type 2 status entry (16 bit I/O entry handles)
+ *		structure definition.
+ */
+#define	STATUS_TYPE_22	0x22		/* Status entry. */
+typedef struct {
+	uint8_t entry_type;		/* Entry type. */
+	uint8_t entry_count;		/* Entry count. */
+	uint8_t handle_count;		/* Handle count. */
+	uint8_t entry_status;		/* Entry Status. */
+	uint16_t handle[30];		/* System handles. */
+} sts22_entry_t;
+
+/*
+ * ISP queue - marker entry structure definition.
+ */
+#define MARKER_TYPE	0x04		/* Marker entry. */
+typedef struct {
+	uint8_t entry_type;		/* Entry type. */
+	uint8_t entry_count;		/* Entry count. */
+	uint8_t handle_count;		/* Handle count. */
+	uint8_t entry_status;		/* Entry Status. */
+	uint32_t sys_define_2;		/* System defined. */
+	target_id_t target;		/* SCSI ID */
+	uint8_t modifier;		/* Modifier (7-0). */
+#define MK_SYNC_ID_LUN	0		/* Synchronize ID/LUN */
+#define MK_SYNC_ID	1		/* Synchronize ID */
+#define MK_SYNC_ALL	2		/* Synchronize all ID/LUN */
+#define MK_SYNC_LIP	3		/* Synchronize all ID/LUN, */
+					/* clear port changed, */
+					/* use sequence number. */
+	uint8_t reserved_1;
+	uint16_t sequence_number;	/* Sequence number of event */
+	uint16_t lun;			/* SCSI LUN */
+	uint8_t reserved_2[48];
+} mrk_entry_t;
+
+/*
+ * ISP queue - Management Server entry structure definition.
+ */
+#define MS_IOCB_TYPE		0x29	/* Management Server IOCB entry */
+typedef struct {
+	uint8_t entry_type;		/* Entry type. */
+	uint8_t entry_count;		/* Entry count. */
+	uint8_t handle_count;		/* Handle count. */
+	uint8_t entry_status;		/* Entry Status. */
+	uint32_t handle1;		/* System handle. */
+	target_id_t loop_id;
+	uint16_t status;
+	uint16_t control_flags;		/* Control flags. */
+	uint16_t reserved2;
+	uint16_t timeout;
+	uint16_t cmd_dsd_count;
+	uint16_t total_dsd_count;
+	uint8_t type;
+	uint8_t r_ctl;
+	uint16_t rx_id;
+	uint16_t reserved3;
+	uint32_t handle2;
+	uint32_t rsp_bytecount;
+	uint32_t req_bytecount;
+	uint32_t dseg_req_address[2];	/* Data segment 0 address. */
+	uint32_t dseg_req_length;	/* Data segment 0 length. */
+	uint32_t dseg_rsp_address[2];	/* Data segment 1 address. */
+	uint32_t dseg_rsp_length;	/* Data segment 1 length. */
+} ms_iocb_entry_t;
+
+
+/*
+ * ISP queue - Mailbox Command entry structure definition.
+ */
+#define MBX_IOCB_TYPE	0x39
+struct mbx_entry {
+	uint8_t entry_type;
+	uint8_t entry_count;
+	uint8_t sys_define1;
+	/* Use sys_define1 for source type */
+#define SOURCE_SCSI	0x00
+#define SOURCE_IP	0x01
+#define SOURCE_VI	0x02
+#define SOURCE_SCTP	0x03
+#define SOURCE_MP	0x04
+#define SOURCE_MPIOCTL	0x05
+#define SOURCE_ASYNC_IOCB 0x07
+
+	uint8_t entry_status;
+
+	uint32_t handle;
+	target_id_t loop_id;
+
+	uint16_t status;
+	uint16_t state_flags;
+	uint16_t status_flags;
+
+	uint32_t sys_define2[2];
+
+	uint16_t mb0;
+	uint16_t mb1;
+	uint16_t mb2;
+	uint16_t mb3;
+	uint16_t mb6;
+	uint16_t mb7;
+	uint16_t mb9;
+	uint16_t mb10;
+	uint32_t reserved_2[2];
+	uint8_t node_name[WWN_SIZE];
+	uint8_t port_name[WWN_SIZE];
+};
+
+/*
+ * ISP request and response queue entry sizes
+ */
+#define RESPONSE_ENTRY_SIZE	(sizeof(response_t))
+#define REQUEST_ENTRY_SIZE	(sizeof(request_t))
+
+
+/*
+ * 24 bit port ID type definition.
+ */
+typedef union {
+	uint32_t b24 : 24;
+
+	struct {
+		uint8_t d_id[3];
+		uint8_t rsvd_1;
+	} r;
+
+	struct {
+		uint8_t al_pa;
+		uint8_t area;
+		uint8_t domain;
+		uint8_t rsvd_1;
+	} b;
+} port_id_t;
+#define INVALID_PORT_ID	0xFFFFFF
+
+/*
+ * Switch info gathering structure.
+ */
+typedef struct {
+	port_id_t d_id;
+	uint8_t node_name[WWN_SIZE];
+	uint8_t port_name[WWN_SIZE];
+	uint32_t type;
+#define SW_TYPE_IP	BIT_1
+#define SW_TYPE_SCSI	BIT_0
+} sw_info_t;
+
+/*
+ * Inquiry command structure.
+ */
+#define INQ_DATA_SIZE	8
+
+/*
+ * Inquiry mailbox IOCB packet definition.
+ */
+typedef struct {
+	union {
+		cmd_a64_entry_t cmd;
+		sts_entry_t rsp;
+	} p;
+	uint8_t inq[INQ_DATA_SIZE];
+} inq_cmd_rsp_t;
+
+/*
+ * Report LUN command structure.
+ */
+#define CHAR_TO_SHORT(a, b)	(uint16_t)((uint8_t)b << 8 | (uint8_t)a)
+
+typedef struct {
+	uint32_t len;
+	uint32_t rsrv;
+} rpt_hdr_t;
+
+typedef struct {
+	struct {
+		uint8_t b : 6;
+		uint8_t address_method : 2;
+	} msb;
+	uint8_t lsb;
+	uint8_t unused[6];
+} rpt_lun_t;
+
+typedef struct {
+	rpt_hdr_t hdr;
+	rpt_lun_t lst[MAX_LUNS];
+} rpt_lun_lst_t;
+
+/*
+ * Report Lun mailbox IOCB packet definition.
+ */
+typedef struct {
+	union {
+		cmd_a64_entry_t cmd;
+		sts_entry_t rsp;
+	} p;
+	rpt_lun_lst_t list;
+} rpt_lun_cmd_rsp_t;
+
+/*
+ * SCSI Target Queue structure
+ */
+typedef struct os_tgt {
+	struct os_lun *olun[MAX_LUNS]; /* LUN context pointer. */
+	struct fc_port *fcport;
+	uint32_t flags;
+	uint8_t port_down_retry_count;
+    	uint32_t down_timer;
+	struct scsi_qla_host *ha;
+
+	/* Persistent binding information */
+	port_id_t d_id;
+	uint8_t node_name[WWN_SIZE];
+	uint8_t port_name[WWN_SIZE];
+} os_tgt_t;
+
+/*
+ * SCSI Target Queue flags
+ */
+#define TQF_QUEUE_SUSPENDED	BIT_0		/* Queue suspended. */
+#define TQF_BOOT_DEVICE		BIT_1		/* Boot device. */
+#define TQF_ONLINE		BIT_2		/* Device online to OS. */
+#define TQF_TGT_RST_NEEDED	BIT_3
+
+/*
+ * SCSI LUN Queue structure
+ */
+typedef struct os_lun {
+	struct fc_lun *fclun;		/* FC LUN context pointer. */
+    	spinlock_t q_lock;		/* Lun Lock */
+
+	unsigned long q_flag;
+#define LUN_MPIO_BUSY		2	/* Lun is changing paths  */
+#define LUN_EXEC_DELAYED	7	/* Lun execution is delayed */
+
+	u_long q_timeout;		/* total command timeouts */
+	atomic_t q_timer;		/* suspend timer */
+	uint32_t q_count;		/* current count */
+	uint32_t q_max;			/* maxmum count lun can be suspended */
+	uint8_t q_state;		/* lun State */
+#define LUN_STATE_READY		1	/* lun is ready for i/o */
+#define LUN_STATE_RUN		2	/* lun has a timer running */
+#define LUN_STATE_WAIT		3	/* lun is suspended */
+#define LUN_STATE_TIMEOUT	4	/* lun has timed out */
+
+	u_long io_cnt;			/* total xfer count since boot */
+	u_long out_cnt;			/* total outstanding IO count */
+	u_long w_cnt;			/* total writes */
+	u_long r_cnt;			/* total reads */
+	u_long avg_time;		/*  */
+} os_lun_t;
+
+
+/* LUN BitMask structure definition, array of 32bit words,
+ * 1 bit per lun.  When bit == 1, the lun is masked.
+ * Most significant bit of mask[0] is lun 0, bit 24 is lun 7.
+ */
+typedef struct lun_bit_mask {
+	/* Must allocate at least enough bits to accomodate all LUNs */
+#if ((MAX_FIBRE_LUNS & 0x7) == 0)
+	uint8_t mask[MAX_FIBRE_LUNS >> 3];
+#else
+	uint8_t mask[(MAX_FIBRE_LUNS + 8) >> 3];
+#endif
+} lun_bit_mask_t;
+
+/*
+ * Fibre channel port type.
+ */
+ typedef enum {
+	FCT_UNKNOWN,
+	FCT_RSCN,
+	FCT_SWITCH,
+	FCT_BROADCAST,
+	FCT_INITIATOR,
+	FCT_TARGET
+} fc_port_type_t;
+
+/*
+ * Fibre channel port structure.
+ */
+typedef struct fc_port {
+	struct list_head list;
+	struct list_head fcluns;
+
+	struct scsi_qla_host *ha;
+	struct scsi_qla_host *vis_ha;	/* only used when suspending lun */
+
+	uint8_t node_name[WWN_SIZE];
+	uint8_t port_name[WWN_SIZE];
+	port_id_t d_id;
+	uint16_t loop_id;
+	uint16_t old_loop_id;
+
+	fc_port_type_t port_type;
+
+	atomic_t state;
+	uint32_t flags;
+
+	os_tgt_t *tgt_queue;
+	uint16_t os_target_id;
+
+	uint16_t iodesc_idx_sent;
+
+	int port_login_retry_count;
+	int login_retry;
+	atomic_t port_down_timer;
+
+	uint8_t device_type;
+	uint8_t unused;
+
+	uint8_t mp_byte;		/* multi-path byte (not used) */
+    	uint8_t cur_path;		/* current path id */
+
+	lun_bit_mask_t lun_mask;
+} fc_port_t;
+
+/*
+ * Fibre channel port/lun states.
+ */
+#define FCS_UNCONFIGURED	1
+#define FCS_DEVICE_DEAD		2
+#define FCS_DEVICE_LOST		3
+#define FCS_ONLINE		4
+#define FCS_NOT_SUPPORTED	5
+#define FCS_FAILOVER		6
+#define FCS_FAILOVER_FAILED	7
+
+/*
+ * FC port flags.
+ */
+#define FCF_FABRIC_DEVICE	BIT_0
+#define FCF_LOGIN_NEEDED	BIT_1
+#define FCF_FO_MASKED		BIT_2
+#define FCF_FAILOVER_NEEDED	BIT_3
+#define FCF_RESET_NEEDED	BIT_4
+#define FCF_PERSISTENT_BOUND	BIT_5
+#define FCF_TAPE_PRESENT	BIT_6
+#define FCF_FARP_DONE		BIT_7
+#define FCF_FARP_FAILED		BIT_8
+#define FCF_FARP_REPLY_NEEDED	BIT_9
+#define FCF_AUTH_REQ		BIT_10
+#define FCF_SEND_AUTH_REQ	BIT_11
+#define FCF_RECEIVE_AUTH_REQ	BIT_12
+#define FCF_AUTH_SUCCESS	BIT_13
+#define FCF_RLC_SUPPORT		BIT_14
+#define FCF_CONFIG		BIT_15	/* Needed? */
+#define FCF_RESCAN_NEEDED	BIT_16
+
+/* No loop ID flag. */
+#define FC_NO_LOOP_ID		0x1000
+
+/*
+ * Fibre channel LUN structure.
+ */
+typedef struct fc_lun {
+        struct list_head list;
+
+	fc_port_t *fcport;
+	fc_port_t *o_fcport;
+	uint16_t lun;
+	atomic_t state;
+	uint8_t device_type;
+	uint8_t max_path_retries;
+} fc_lun_t;
+
+
+/*
+ * FC-CT interface
+ *
+ * NOTE: All structures are big-endian in form.
+ */
+
+#define CT_REJECT_RESPONSE	0x8001
+#define CT_ACCEPT_RESPONSE	0x8002
+
+#define NS_N_PORT_TYPE	0x01
+#define NS_NL_PORT_TYPE	0x02
+#define NS_NX_PORT_TYPE	0x7F
+
+#define	GA_NXT_CMD	0x100
+#define	GA_NXT_REQ_SIZE	(16 + 4)
+#define	GA_NXT_RSP_SIZE	(16 + 620)
+
+#define	GID_PT_CMD	0x1A1
+#define	GID_PT_REQ_SIZE	(16 + 4)
+#define	GID_PT_RSP_SIZE	(16 + (MAX_FIBRE_DEVICES * 4))
+
+#define	GPN_ID_CMD	0x112
+#define	GPN_ID_REQ_SIZE	(16 + 4)
+#define	GPN_ID_RSP_SIZE	(16 + 8)
+
+#define	GNN_ID_CMD	0x113
+#define	GNN_ID_REQ_SIZE	(16 + 4)
+#define	GNN_ID_RSP_SIZE	(16 + 8)
+
+#define	GFT_ID_CMD	0x117
+#define	GFT_ID_REQ_SIZE	(16 + 4)
+#define	GFT_ID_RSP_SIZE	(16 + 32)
+
+#define	RFT_ID_CMD	0x217
+#define	RFT_ID_REQ_SIZE	(16 + 4 + 32)
+#define	RFT_ID_RSP_SIZE	16
+
+#define	RFF_ID_CMD	0x21F
+#define	RFF_ID_REQ_SIZE	(16 + 4 + 2 + 1 + 1)
+#define	RFF_ID_RSP_SIZE	16
+
+#define	RNN_ID_CMD	0x213
+#define	RNN_ID_REQ_SIZE	(16 + 4 + 8)
+#define	RNN_ID_RSP_SIZE	16
+
+#define	RSNN_NN_CMD	 0x239
+#define	RSNN_NN_REQ_SIZE (16 + 8 + 1 + 255)
+#define	RSNN_NN_RSP_SIZE 16
+
+/* CT command header -- request/response common fields */
+struct ct_cmd_hdr {
+	uint8_t revision;
+	uint8_t in_id[3];
+	uint8_t gs_type;
+	uint8_t gs_subtype;
+	uint8_t options;
+	uint8_t reserved;
+};
+
+/* CT command request */
+struct ct_sns_req {
+	struct ct_cmd_hdr header;
+	uint16_t command;
+	uint16_t max_rsp_size;
+	uint8_t fragment_id;
+	uint8_t reserved[3];
+
+	union {
+		/* GA_NXT, GPN_ID, GNN_ID, GFT_ID */
+		struct {
+			uint8_t reserved;
+			uint8_t port_id[3];
+		} port_id;
+
+		struct {
+			uint8_t port_type;
+			uint8_t domain;
+			uint8_t area;
+			uint8_t reserved;
+		} gid_pt;
+
+		struct {
+			uint8_t reserved;
+			uint8_t port_id[3];
+			uint8_t fc4_types[32];
+		} rft_id;
+
+		struct {
+			uint8_t reserved;
+			uint8_t port_id[3];
+			uint16_t reserved2;
+			uint8_t fc4_feature;
+			uint8_t fc4_type;
+		} rff_id;
+
+		struct {
+			uint8_t reserved;
+			uint8_t port_id[3];
+			uint8_t node_name[8];
+		} rnn_id;
+
+		struct {
+			uint8_t node_name[8];
+			uint8_t name_len;
+			uint8_t sym_node_name[255];
+		} rsnn_nn;
+	} req;
+};
+
+/* CT command response header */
+struct ct_rsp_hdr {
+	struct ct_cmd_hdr header;
+	uint16_t response;
+	uint16_t residual;
+	uint8_t fragment_id;
+	uint8_t reason_code;
+	uint8_t explanation_code;
+	uint8_t vendor_unique;
+};
+
+struct ct_sns_gid_pt_data {
+	uint8_t control_byte;
+	uint8_t port_id[3];
+};
+
+struct ct_sns_rsp {
+	struct ct_rsp_hdr header;
+
+	union {
+		struct {
+			uint8_t port_type;
+			uint8_t port_id[3];
+			uint8_t port_name[8];
+			uint8_t sym_port_name_len;
+			uint8_t sym_port_name[255];
+			uint8_t node_name[8];
+			uint8_t sym_node_name_len;
+			uint8_t sym_node_name[255];
+			uint8_t init_proc_assoc[8];
+			uint8_t node_ip_addr[16];
+			uint8_t class_of_service[4];
+			uint8_t fc4_types[32];
+			uint8_t ip_address[16];
+			uint8_t fabric_port_name[8];
+			uint8_t reserved;
+			uint8_t hard_address[3];
+		} ga_nxt;
+
+		struct {
+			struct ct_sns_gid_pt_data entries[MAX_FIBRE_DEVICES];
+		} gid_pt;
+
+		struct {
+			uint8_t port_name[8];
+		} gpn_id;
+
+		struct {
+			uint8_t node_name[8];
+		} gnn_id;
+
+		struct {
+			uint8_t fc4_types[32];
+		} gft_id;
+	} rsp;
+};
+
+struct ct_sns_pkt {
+	union {
+		struct ct_sns_req req;
+		struct ct_sns_rsp rsp;
+	} p;
+};
+
+
+/* IO descriptors */
+#define MAX_IO_DESCRIPTORS	32
+
+#define ABORT_IOCB_CB		0
+#define ADISC_PORT_IOCB_CB	1
+#define LOGOUT_PORT_IOCB_CB	2
+#define LOGIN_PORT_IOCB_CB	3
+#define LAST_IOCB_CB		4
+
+#define IODESC_INVALID_INDEX	0xFFFF
+#define IODESC_ADISC_NEEDED	0xFFFE
+#define IODESC_LOGIN_NEEDED	0xFFFD
+
+struct io_descriptor {
+	uint16_t used:1;
+	uint16_t idx:11;
+	uint16_t cb_idx:4;
+
+	struct timer_list timer;
+
+	struct scsi_qla_host *ha;
+
+	port_id_t d_id;
+	fc_port_t *remote_fcport;
+
+	uint32_t signature;
+};
+
+/* Mailbox command semaphore queue for command serialization */
+typedef struct _mbx_cmdq_t {
+	struct semaphore	cmd_sem;
+	struct _mbx_cmdq_t	*pnext;
+} mbx_cmdq_t;
+
+struct qla_fw_info {
+	unsigned short addressing;	/* addressing method used to load fw */
+#define FW_INFO_ADDR_NORMAL	0
+#define FW_INFO_ADDR_EXTENDED	1
+#define FW_INFO_ADDR_NOMORE	0xffff
+	unsigned short *fwcode;		/* pointer to FW array */
+	unsigned short *fwlen;		/* number of words in array */
+	unsigned short *fwstart;	/* start address for F/W */
+	unsigned long *lfwstart;	/* start address (long) for F/W */
+};
+
+struct qla_board_info {
+	char *drv_name;
+
+	char isp_name[8];
+	struct qla_fw_info *fw_info;
+};
+
+/*
+ * Linux Host Adapter structure
+ */
+typedef struct scsi_qla_host {
+	struct list_head list;
+
+	/* Commonly used flags and state information. */
+	struct Scsi_Host *host;
+	struct pci_dev	*pdev;
+
+	unsigned long	host_no;
+	unsigned long	instance;
+
+	volatile struct {
+		uint32_t	init_done		:1;
+		uint32_t	online			:1;
+		uint32_t	mbox_int		:1;
+		uint32_t	mbox_busy		:1;
+		uint32_t	rscn_queue_overflow	:1;
+		uint32_t	reset_active		:1;
+
+		uint32_t	management_server_logged_in :1;
+                uint32_t	process_response_queue	:1;
+
+		uint32_t	disable_risc_code_load	:1;
+		uint32_t	enable_64bit_addressing	:1;
+		uint32_t	enable_lip_reset	:1;
+		uint32_t	enable_lip_full_login	:1;
+		uint32_t	enable_target_reset	:1;
+	} flags;
+
+	atomic_t	loop_state;
+#define LOOP_TIMEOUT	1
+#define LOOP_DOWN	2
+#define LOOP_UP		3
+#define LOOP_UPDATE	4
+#define LOOP_READY	5
+#define LOOP_DEAD	6
+
+	unsigned long   dpc_flags;
+#define	RESET_MARKER_NEEDED	0	/* Send marker to ISP. */
+#define	RESET_ACTIVE		1
+#define	ISP_ABORT_NEEDED	2	/* Initiate ISP abort. */
+#define	ABORT_ISP_ACTIVE	3	/* ISP abort in progress. */
+#define	LOOP_RESYNC_NEEDED	4	/* Device Resync needed. */
+#define	LOOP_RESYNC_ACTIVE	5
+#define LOCAL_LOOP_UPDATE       6	/* Perform a local loop update. */
+#define RSCN_UPDATE             7	/* Perform an RSCN update. */
+#define MAILBOX_RETRY           8
+#define ISP_RESET_NEEDED        9	/* Initiate a ISP reset. */
+#define FAILOVER_EVENT_NEEDED   10
+#define FAILOVER_EVENT		11
+#define FAILOVER_NEEDED   	12
+#define SCSI_RESTART_NEEDED	13	/* Processes SCSI retry queue. */
+#define PORT_RESTART_NEEDED	14	/* Processes Retry queue. */
+#define RESTART_QUEUES_NEEDED	15	/* Restarts the Lun queue. */
+#define ABORT_QUEUES_NEEDED	16
+#define RELOGIN_NEEDED	        17
+#define LOGIN_RETRY_NEEDED	18	/* Initiate required fabric logins. */
+#define REGISTER_FC4_NEEDED	19	/* SNS FC4 registration required. */
+#define ISP_ABORT_RETRY         20      /* ISP aborted. */
+#define FCPORT_RESCAN_NEEDED	21      /* IO descriptor processing needed */
+#define IODESC_PROCESS_NEEDED	22      /* IO descriptor processing needed */
+
+	uint32_t	device_flags;
+#define DFLG_LOCAL_DEVICES		BIT_0
+#define DFLG_RETRY_LOCAL_DEVICES	BIT_1
+#define DFLG_FABRIC_DEVICES		BIT_2
+#define	SWITCH_FOUND			BIT_3
+#define	DFLG_NO_CABLE			BIT_4
+
+	/* SRB cache. */
+#define SRB_MIN_REQ	128
+	mempool_t	*srb_mempool;
+
+	/* This spinlock is used to protect "io transactions", you must	
+	 * aquire it before doing any IO to the card, eg with RD_REG*() and
+	 * WRT_REG*() for the duration of your entire commandtransaction.
+	 *
+	 * This spinlock is of lower priority than the io request lock.
+	 */
+
+	spinlock_t		hardware_lock ____cacheline_aligned;
+
+	device_reg_t	*iobase;		/* Base I/O address */
+	unsigned long	pio_address;
+	unsigned long	pio_length;
+	void *		mmio_address;
+	unsigned long	mmio_length;
+#define MIN_IOBASE_LEN		0x100
+
+	/* ISP ring lock, rings, and indexes */
+	dma_addr_t	request_dma;        /* Physical address. */
+	request_t       *request_ring;      /* Base virtual address */
+	request_t       *request_ring_ptr;  /* Current address. */
+	uint16_t        req_ring_index;     /* Current index. */
+	uint16_t        req_q_cnt;          /* Number of available entries. */
+
+	dma_addr_t	response_dma;       /* Physical address. */
+	response_t      *response_ring;     /* Base virtual address */
+	response_t      *response_ring_ptr; /* Current address. */
+	uint16_t        rsp_ring_index;     /* Current index. */
+	uint16_t	response_q_length;
+    
+	uint16_t	(*calc_request_entries)(uint16_t);
+	void		(*build_scsi_iocbs)(srb_t *, cmd_entry_t *, uint16_t);
+
+	/* Outstandings ISP commands. */
+	srb_t		*outstanding_cmds[MAX_OUTSTANDING_COMMANDS];
+	uint32_t	current_outstanding_cmd; 
+	srb_t		*status_srb;	/* Status continuation entry. */
+
+	/*
+	 * Need to hold the list_lock with irq's disabled in order to access
+	 * the following list.
+	 *
+	 * This list_lock is of lower priority than the host_lock.
+	 */
+	spinlock_t		list_lock ____cacheline_aligned;
+						/* lock to guard lists which
+						 * hold srb_t's */
+        struct list_head        retry_queue;    /* watchdog queue */
+        struct list_head        done_queue;     /* job on done queue */
+        struct list_head        failover_queue; /* failover list link. */
+	struct list_head        scsi_retry_queue;     /* SCSI retry queue */
+	struct list_head        pending_queue;	/* SCSI command pending queue */
+
+	unsigned long    done_q_cnt;
+	unsigned long    pending_in_q;
+        uint32_t	retry_q_cnt; 
+        uint32_t	scsi_retry_q_cnt; 
+        uint32_t	failover_cnt; 
+
+	unsigned long	last_irq_cpu;	/* cpu where we got our last irq */
+
+	uint16_t           revision;
+	uint8_t           ports;
+	u_long            actthreads;
+	u_long            ipreq_cnt;
+	u_long            qthreads;
+
+	uint32_t        total_isr_cnt;		/* Interrupt count */
+	uint32_t        total_isp_aborts;	/* controller err cnt */
+	uint32_t        total_lip_cnt;		/* LIP cnt */
+	uint32_t	total_dev_errs;		/* device error cnt */
+	uint32_t	total_ios;		/* IO cnt */
+	uint64_t	total_bytes;		/* xfr byte cnt */
+	uint32_t	total_mbx_timeout;	/* mailbox timeout cnt */
+	uint32_t 	total_loop_resync; 	/* loop resyn cnt */
+	uint32_t	dropped_frame_error_cnt;
+
+	/* ISP configuration data. */
+	uint16_t	loop_id;		/* Host adapter loop id */
+	uint16_t	fb_rev;
+
+	port_id_t	d_id;			/* Host adapter port id */
+	uint16_t	max_public_loop_ids;
+	uint16_t	min_external_loopid;	/* First external loop Id */
+
+	uint8_t		current_topology;
+	uint8_t		prev_topology;
+#define ISP_CFG_NL	1
+#define ISP_CFG_N	2
+#define ISP_CFG_FL	4
+#define ISP_CFG_F	8
+
+	uint8_t		operating_mode;		/* F/W operating mode */
+#define LOOP      0
+#define P2P       1
+#define LOOP_P2P  2
+#define P2P_LOOP  3
+
+	uint8_t		active_fc4_types;	/* Active fc4 types */
+
+	uint8_t		current_speed;		/* F/W operating speed */
+        uint8_t		marker_needed; 
+	uint8_t		sns_retry_cnt;
+	uint8_t		mem_err;
+
+	uint8_t		interrupts_on;
+
+	/* HBA serial number */
+	uint8_t		serial0;
+	uint8_t		serial1;
+	uint8_t		serial2;
+
+	/* NVRAM configuration data */
+	uint16_t	nvram_base;
+
+	uint16_t	loop_reset_delay;
+	uint16_t	minimum_timeout;
+	uint8_t		retry_count;
+	uint8_t		login_timeout;
+	uint16_t	r_a_tov;
+	int		port_down_retry_count;
+	uint8_t		loop_down_timeout;
+	uint8_t		mbx_count;
+	uint16_t	max_probe_luns;
+	uint16_t	max_luns;
+	uint16_t	max_targets;
+	uint16_t	last_loop_id;
+
+        uint32_t	login_retry_count; 
+
+	/* Fibre Channel Device List. */
+	struct list_head	fcports;
+	struct list_head	rscn_fcports;
+
+	struct io_descriptor	io_descriptors[MAX_IO_DESCRIPTORS];
+	uint16_t		iodesc_signature;
+	port_database_t		*iodesc_pd;
+	dma_addr_t		iodesc_pd_dma;
+
+	/* OS target queue pointers. */
+	os_tgt_t		*otgt[MAX_FIBRE_DEVICES];
+
+	/* RSCN queue. */
+	uint32_t rscn_queue[MAX_RSCN_COUNT];
+	uint8_t rscn_in_ptr;
+	uint8_t rscn_out_ptr;
+
+	ms_iocb_entry_t		*ms_iocb;
+	dma_addr_t		ms_iocb_dma;
+	struct ct_sns_pkt	*ct_sns;
+	dma_addr_t		ct_sns_dma;
+
+	pid_t			dpc_pid;
+	int			dpc_should_die;
+	struct completion	dpc_inited;
+	struct completion	dpc_exited;
+	struct semaphore	*dpc_wait;
+	uint8_t dpc_active;                  /* DPC routine is active */
+
+	/* Timeout timers. */
+	uint8_t         queue_restart_timer;   
+	uint8_t         loop_down_abort_time;    /* port down timer */
+	atomic_t        loop_down_timer;         /* loop down timer */
+	uint8_t         link_down_timeout;       /* link down timeout */
+
+	uint32_t        timer_active;
+	struct timer_list        timer;
+
+	/* Firmware Initialization Control Block data */
+	dma_addr_t	init_cb_dma;         /* Physical address. */
+	init_cb_t       *init_cb;
+  
+	/* These are used by mailbox operations. */
+	volatile uint16_t mailbox_out[MAILBOX_REGISTER_COUNT];
+
+	mbx_cmd_t	*mcp;
+	unsigned long	mbx_cmd_flags;
+#define MBX_CMD_ACTIVE	1
+#define MBX_CMD_WANT	2
+#define MBX_INTERRUPT	3
+#define MBX_INTR_WAIT   4
+
+	spinlock_t	mbx_reg_lock;   /* Mbx Cmd Register Lock */
+	spinlock_t	mbx_q_lock;     /* Mbx Active Cmd Queue Lock */
+	spinlock_t	mbx_bits_lock;  /* Mailbox access bits Lock */
+
+	struct semaphore  mbx_intr_sem;  /* Used for completion notification */
+
+	mbx_cmdq_t	*mbx_sem_pool_head;  /* Head Pointer to a list of
+			                      * recyclable mbx semaphore pool
+			                      * to be used during run time.
+			                      */
+	mbx_cmdq_t	*mbx_sem_pool_tail;  /* Tail Pointer to semaphore pool*/
+#define MBQ_INIT_LEN	16 /* initial mbx sem pool q len. actual len may vary */
+
+	mbx_cmdq_t	*mbx_q_head; /* Head Pointer to sem q for active cmds */
+	mbx_cmdq_t	*mbx_q_tail; /* Tail Pointer to sem q for active cmds */
+
+	uint32_t	mbx_flags;
+#define  MBX_IN_PROGRESS	BIT_0
+#define  MBX_BUSY		BIT_1	/* Got the Access */
+#define  MBX_SLEEPING_ON_SEM	BIT_2 
+#define  MBX_POLLING_FOR_COMP	BIT_3
+#define  MBX_COMPLETED		BIT_4
+#define  MBX_TIMEDOUT		BIT_5 
+#define  MBX_ACCESS_TIMEDOUT	BIT_6
+
+	mbx_cmd_t 	mc;
+
+	uint8_t	*cmdline;
+
+	uint32_t failover_type;
+	uint32_t failback_delay;
+	unsigned long   cfg_flags;
+#define	CFG_ACTIVE	0	/* CFG during a failover, event update, or ioctl */
+
+	uint32_t	binding_type;
+#define BIND_BY_PORT_NAME	0
+#define BIND_BY_PORT_ID		1
+
+	/* Basic firmware related information. */
+	struct qla_board_info	*brd_info;
+	uint16_t	fw_major_version;
+	uint16_t	fw_minor_version;
+	uint16_t	fw_subminor_version;
+	uint16_t	fw_attributes;
+	uint32_t	fw_transfer_size;
+
+	uint16_t	fw_options[16];		/* slots: 1,2,3,10,11 */
+	uint8_t		fw_seriallink_options[2];
+
+	/* Firmware dump information. */
+	void		*fw_dump;
+	int		fw_dump_order;
+	int		fw_dump_reading;
+	char		*fw_dump_buffer;
+	int		fw_dump_buffer_len;
+
+	uint8_t		host_str[16];
+	uint16_t	pci_attr;
+	uint16_t	xchg_buf_cnt;
+	uint16_t	iocb_buf_cnt;
+
+	uint8_t model_number[16+1];
+#define BINZERO		"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+	char *model_desc;
+
+/* following are new and needed for IOCTL support */
+#ifdef CONFIG_SCSI_QLA2XXX_IOCTL
+	struct hba_ioctl *ioctl;
+
+	void        *ioctl_mem;
+	dma_addr_t  ioctl_mem_phys;
+	uint32_t    ioctl_mem_size;
+#endif
+	uint8_t     node_name[WWN_SIZE];
+	uint8_t     nvram_version; 
+	uint8_t     optrom_major; 
+	uint8_t     optrom_minor; 
+	uint32_t    isp_abort_cnt;
+
+	/* Adapter I/O statistics for failover */
+	uint64_t	IosRequested;
+	uint64_t	BytesRequested;
+	uint64_t	IosExecuted;
+	uint64_t	BytesExecuted;
+
+	/* Needed for BEACON */
+	uint16_t	beacon_blink_led;
+	uint16_t	beacon_green_on;
+} scsi_qla_host_t;
+
+
+/*
+ * Macros to help code, maintain, etc.
+ */
+#define LOOP_TRANSITION(ha) \
+	(test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) || \
+	 test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags))
+
+#define LOOP_NOT_READY(ha) \
+	((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) || \
+	  test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags) || \
+	  test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || \
+	  test_bit(LOOP_RESYNC_ACTIVE, &ha->dpc_flags)) || \
+	 atomic_read(&ha->loop_state) == LOOP_DOWN)
+				 
+#define LOOP_RDY(ha)	(!LOOP_NOT_READY(ha))
+
+#define TGT_Q(ha, t) (ha->otgt[t])
+#define LUN_Q(ha, t, l)	(TGT_Q(ha, t)->olun[l])
+#define GET_LU_Q(ha, t, l) ((TGT_Q(ha,t) != NULL)? TGT_Q(ha, t)->olun[l] : NULL)
+
+#define to_qla_host(x)		((scsi_qla_host_t *) (x)->hostdata)
+
+#define qla_printk(level, ha, format, arg...) \
+	dev_printk(level , &((ha)->pdev->dev) , format , ## arg)
+
+/*
+ * qla2x00 local function return status codes
+ */
+#define MBS_MASK		0x3fff
+
+#define QLA_SUCCESS		(MBS_COMMAND_COMPLETE & MBS_MASK)
+#define QLA_INVALID_COMMAND	(MBS_INVALID_COMMAND & MBS_MASK)
+#define QLA_INTERFACE_ERROR	(MBS_HOST_INTERFACE_ERROR & MBS_MASK)
+#define QLA_TEST_FAILED		(MBS_TEST_FAILED & MBS_MASK)
+#define QLA_COMMAND_ERROR	(MBS_COMMAND_ERROR & MBS_MASK)
+#define QLA_PARAMETER_ERROR	(MBS_COMMAND_PARAMETER_ERROR & MBS_MASK)
+#define QLA_PORT_ID_USED	(MBS_PORT_ID_USED & MBS_MASK)
+#define QLA_LOOP_ID_USED	(MBS_LOOP_ID_USED & MBS_MASK)
+#define QLA_ALL_IDS_IN_USE	(MBS_ALL_IDS_IN_USE & MBS_MASK)
+#define QLA_NOT_LOGGED_IN	(MBS_NOT_LOGGED_IN & MBS_MASK)
+
+#define QLA_FUNCTION_TIMEOUT		0x100
+#define QLA_FUNCTION_PARAMETER_ERROR	0x101
+#define QLA_FUNCTION_FAILED		0x102
+#define QLA_MEMORY_ALLOC_FAILED		0x103
+#define QLA_LOCK_TIMEOUT		0x104
+#define QLA_ABORTED			0x105
+#define QLA_SUSPENDED			0x106
+#define QLA_BUSY			0x107
+#define QLA_RSCNS_HANDLED		0x108
+
+/*
+* Stat info for all adpaters
+*/
+struct _qla2x00stats  {
+        unsigned long   mboxtout;            /* mailbox timeouts */
+        unsigned long   mboxerr;             /* mailbox errors */
+        unsigned long   ispAbort;            /* ISP aborts */
+        unsigned long   debugNo;
+        unsigned long   loop_resync;
+        unsigned long   outarray_full;
+        unsigned long   retry_q_cnt;
+};
+
+#define NVRAM_DELAY()		udelay(10)
+
+#define INVALID_HANDLE	(MAX_OUTSTANDING_COMMANDS+1)
+
+/*
+ * Flash support definitions
+ */
+#define FLASH_IMAGE_SIZE	131072
+
+#include "qla_gbl.h"
+#include "qla_dbg.h"
+#include "qla_inline.h"
+#include "qla_listops.h"
+
+#endif
diff -Nru a/drivers/scsi/qla2xxx/qla_devtbl.h b/drivers/scsi/qla2xxx/qla_devtbl.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/qla_devtbl.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,65 @@
+#define QLA_MODEL_NAMES         0x1B
+
+/*
+ * Adapter model names.
+ */
+char	*qla2x00_model_name[QLA_MODEL_NAMES] = {
+	"QLA2340",	/* 0x100 */
+	"QLA2342",	/* 0x101 */
+	"QLA2344",	/* 0x102 */
+	"QCP2342",	/* 0x103 */
+	"QSB2340",	/* 0x104 */
+	"QSB2342",	/* 0x105 */
+	"QLA2310",	/* 0x106 */
+	"QLA2332",	/* 0x107 */
+	"QCP2332",	/* 0x108 */
+	"QCP2340",	/* 0x109 */
+	"QLA2342",	/* 0x10a */
+	"QCP2342",	/* 0x10b */
+	"QLA2350",	/* 0x10c */
+	"QLA2352",	/* 0x10d */
+	"QLA2352",	/* 0x10e */
+	"HPQSVS ",	/* 0x10f */
+	"HPQSVS ",	/* 0x110 */
+	"QLA4010",	/* 0x111 */
+	"QLA4010",	/* 0x112 */
+	"QLA4010C",	/* 0x113 */
+	"QLA4010C",	/* 0x114 */
+	"QLA2360",	/* 0x115 */
+	"QLA2362",	/* 0x116 */
+	" ",		/* 0x117 */
+	" ",		/* 0x118 */
+	"QLA200",	/* 0x119 */
+	"QLA200C"	/* 0x11A */
+};
+
+char	*qla2x00_model_desc[QLA_MODEL_NAMES] = {
+	"133MHz PCI-X to 2Gb FC, Single Channel",	/* 0x100 */
+	"133MHz PCI-X to 2Gb FC, Dual Channel",		/* 0x101 */
+	"133MHz PCI-X to 2Gb FC, Quad Channel",		/* 0x102 */
+	" ",						/* 0x103 */
+	" ",						/* 0x104 */
+	" ",						/* 0x105 */
+	" ",						/* 0x106 */
+	" ",						/* 0x107 */
+	" ",						/* 0x108 */
+	" ",						/* 0x109 */
+	" ",						/* 0x10a */
+	" ",						/* 0x10b */
+	"133MHz PCI-X to 2Gb FC, Single Channel",	/* 0x10c */
+	"133MHz PCI-X to 2Gb FC, Dual Channel",		/* 0x10d */
+	" ",						/* 0x10e */
+	"HPQ SVS HBA- Initiator device",		/* 0x10f */
+	"HPQ SVS HBA- Target device",			/* 0x110 */
+	"Optical- 133MHz to 1Gb iSCSI- networking",	/* 0x111 */
+	"Optical- 133MHz to 1Gb iSCSI- storage",	/* 0x112 */
+	"Copper- 133MHz to 1Gb iSCSI- networking",	/* 0x113 */
+	"Copper- 133MHz to 1Gb iSCSI- storage",		/* 0x114 */
+	"133MHz PCI-X to 2Gb FC Single Channel",	/* 0x115 */
+	"133MHz PCI-X to 2Gb FC Dual Channel",		/* 0x116 */
+	" ",						/* 0x117 */
+	" ",						/* 0x118 */
+	"133MHz PCI-X to 2Gb FC Optical",		/* 0x119 */
+	"133MHz PCI-X to 2Gb FC Copper"			/* 0x11A */
+};
+
diff -Nru a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/qla_gbl.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,327 @@
+/********************************************************************************
+*                  QLOGIC LINUX SOFTWARE
+*
+* QLogic ISP2x00 device driver for Linux 2.6.x
+* Copyright (C) 2003 QLogic Corporation
+* (www.qlogic.com)
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation; either version 2, or (at your option) any
+* later version.
+*
+* This program is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* General Public License for more details.
+*
+******************************************************************************
+* Global include file.
+******************************************************************************/
+
+
+#ifndef __QLA_GBL_H
+#define	__QLA_GBL_H
+
+extern void qla2x00_remove_one(struct pci_dev *);
+extern int qla2x00_probe_one(struct pci_dev *, struct qla_board_info *);
+
+/*
+ * Global Function Prototypes in qla_init.c source file.
+ */
+extern int qla2x00_initialize_adapter(scsi_qla_host_t *);
+extern fc_port_t *qla2x00_alloc_fcport(scsi_qla_host_t *, int);
+
+extern int qla2x00_loop_resync(scsi_qla_host_t *);
+
+extern int qla2x00_find_new_loop_id(scsi_qla_host_t *, fc_port_t *);
+extern int qla2x00_fabric_login(scsi_qla_host_t *, fc_port_t *, uint16_t *);
+extern int qla2x00_local_device_login(scsi_qla_host_t *, uint16_t);
+
+extern void qla2x00_restart_queues(scsi_qla_host_t *, uint8_t);
+
+extern void qla2x00_rescan_fcports(scsi_qla_host_t *);
+
+extern void qla2x00_tgt_free(scsi_qla_host_t *ha, uint16_t t);
+extern os_tgt_t *qla2x00_tgt_alloc(scsi_qla_host_t *, uint16_t);
+extern os_lun_t * qla2x00_lun_alloc(scsi_qla_host_t *, uint16_t, uint16_t);
+
+extern int qla2x00_abort_isp(scsi_qla_host_t *);
+
+
+/*
+ * Global Data in qla_os.c source file.
+ */
+extern char qla2x00_version_str[];
+
+extern int num_hosts;
+extern int apiHBAInstance;
+
+extern struct _qla2x00stats qla2x00_stats;
+extern int ql2xretrycount;
+extern int ql2xlogintimeout;
+extern int qlport_down_retry;
+extern int ql2xmaxqdepth;
+extern int displayConfig;
+extern int ql2xplogiabsentdevice;
+extern int ql2xintrdelaytimer;
+
+extern int ConfigRequired;
+
+extern int Bind;
+extern int ql2xsuspendcount;
+#if defined(MODULE)
+extern char *ql2xopts;
+#endif
+extern struct list_head qla_hostlist;
+extern rwlock_t qla_hostlist_lock;
+
+extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *);
+
+extern int qla2x00_queuecommand(struct scsi_cmnd *,
+    void (*)(struct scsi_cmnd *));
+
+extern int __qla2x00_suspend_lun(scsi_qla_host_t *, os_lun_t *, int, int, int);
+
+extern void qla2x00_done(scsi_qla_host_t *);
+extern void qla2x00_next(scsi_qla_host_t *);
+extern void qla2x00_flush_failover_q(scsi_qla_host_t *, os_lun_t *);
+extern void qla2x00_reset_lun_fo_counts(scsi_qla_host_t *, os_lun_t *);
+
+extern int qla2x00_check_tgt_status(scsi_qla_host_t *, struct scsi_cmnd *);
+extern int qla2x00_check_port_status(scsi_qla_host_t *, fc_port_t *);
+
+extern void qla2x00_extend_timeout(struct scsi_cmnd *, int);
+extern srb_t * qla2x00_get_new_sp (scsi_qla_host_t *ha);
+
+extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int);
+extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *);
+
+extern int qla2x00_get_prop_xstr(scsi_qla_host_t *, char *, uint8_t *, int);
+
+extern void qla2x00_abort_queues(scsi_qla_host_t *, uint8_t);
+
+extern void qla2x00_blink_led(scsi_qla_host_t *);
+
+/*
+ * Global Function Prototypes in qla_iocb.c source file.
+ */
+extern request_t *qla2x00_req_pkt(scsi_qla_host_t *);
+extern request_t *qla2x00_ms_req_pkt(scsi_qla_host_t *, srb_t *);
+extern void qla2x00_isp_cmd(scsi_qla_host_t *);
+
+extern uint16_t qla2x00_calc_iocbs_32(uint16_t);
+extern uint16_t qla2x00_calc_iocbs_64(uint16_t);
+extern void qla2x00_build_scsi_iocbs_32(srb_t *, cmd_entry_t *, uint16_t);
+extern void qla2x00_build_scsi_iocbs_64(srb_t *, cmd_entry_t *, uint16_t);
+extern int qla2x00_start_scsi(srb_t *sp);
+int qla2x00_marker(scsi_qla_host_t *, uint16_t, uint16_t, uint8_t);
+int __qla2x00_marker(scsi_qla_host_t *, uint16_t, uint16_t, uint8_t);
+
+/*
+ * Global Function Prototypes in qla_mbx.c source file.
+ */
+extern int
+qla2x00_mailbox_command(scsi_qla_host_t *, mbx_cmd_t *);
+
+extern int
+qla2x00_load_ram(scsi_qla_host_t *, dma_addr_t, uint16_t, uint16_t);
+
+extern int
+qla2x00_load_ram_ext(scsi_qla_host_t *, dma_addr_t, uint32_t, uint16_t);
+
+extern int
+qla2x00_execute_fw(scsi_qla_host_t *);
+
+extern void
+qla2x00_get_fw_version(scsi_qla_host_t *, uint16_t *,
+    uint16_t *, uint16_t *, uint16_t *);
+
+extern int
+qla2x00_get_fw_options(scsi_qla_host_t *, uint16_t *);
+
+extern int
+qla2x00_set_fw_options(scsi_qla_host_t *, uint16_t *);
+
+extern int
+qla2x00_read_ram_word(scsi_qla_host_t *, uint16_t, uint16_t *);
+extern int
+qla2x00_write_ram_word(scsi_qla_host_t *, uint16_t, uint16_t);
+extern int
+qla2x00_write_ram_word_ext(scsi_qla_host_t *, uint32_t, uint16_t);
+
+extern int
+qla2x00_mbx_reg_test(scsi_qla_host_t *);
+
+extern int
+qla2x00_verify_checksum(scsi_qla_host_t *);
+
+extern int
+qla2x00_issue_iocb(scsi_qla_host_t *, void *, dma_addr_t, size_t);
+
+extern int
+qla2x00_abort_command(scsi_qla_host_t *, srb_t *);
+
+extern int
+qla2x00_abort_device(scsi_qla_host_t *, uint16_t, uint16_t);
+
+#if USE_ABORT_TGT
+extern int
+qla2x00_abort_target(fc_port_t *fcport);
+#endif
+
+extern int
+qla2x00_target_reset(scsi_qla_host_t *, uint16_t, uint16_t);
+
+extern int
+qla2x00_get_adapter_id(scsi_qla_host_t *, uint16_t *, uint8_t *, uint8_t *,
+    uint8_t *, uint16_t *);
+
+extern int
+qla2x00_get_retry_cnt(scsi_qla_host_t *, uint8_t *, uint8_t *, uint16_t *);
+
+extern int
+qla2x00_init_firmware(scsi_qla_host_t *, uint16_t);
+
+extern int
+qla2x00_get_port_database(scsi_qla_host_t *, fc_port_t *, uint8_t);
+
+extern int
+qla2x00_get_firmware_state(scsi_qla_host_t *, uint16_t *);
+
+extern int
+qla2x00_get_port_name(scsi_qla_host_t *, uint16_t, uint8_t *, uint8_t);
+
+extern uint8_t
+qla2x00_get_link_status(scsi_qla_host_t *, uint8_t, void *, uint16_t *);
+
+extern int
+qla2x00_lip_reset(scsi_qla_host_t *);
+
+extern int
+qla2x00_send_sns(scsi_qla_host_t *, dma_addr_t, uint16_t, size_t);
+
+extern int
+qla2x00_login_fabric(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t,
+    uint16_t *, uint8_t);
+
+extern int
+qla2x00_login_local_device(scsi_qla_host_t *, uint16_t, uint16_t *, uint8_t);
+
+extern int
+qla2x00_fabric_logout(scsi_qla_host_t *ha, uint16_t loop_id);
+
+extern int
+qla2x00_full_login_lip(scsi_qla_host_t *ha);
+
+extern int
+qla2x00_get_id_list(scsi_qla_host_t *, void *, dma_addr_t, uint16_t *);
+
+#if 0 /* not yet needed */
+extern int
+qla2x00_dump_ram(scsi_qla_host_t *, uint32_t, dma_addr_t, uint32_t);
+#endif
+
+extern int
+qla2x00_lun_reset(scsi_qla_host_t *, uint16_t, uint16_t);
+
+extern int
+qla2x00_send_rnid_mbx(scsi_qla_host_t *, uint16_t, uint8_t, dma_addr_t,
+    size_t, uint16_t *);
+
+extern int
+qla2x00_set_rnid_params_mbx(scsi_qla_host_t *, dma_addr_t, size_t, uint16_t *);
+
+extern int
+qla2x00_get_rnid_params_mbx(scsi_qla_host_t *, dma_addr_t, size_t, uint16_t *);
+
+extern int
+qla2x00_get_resource_cnts(scsi_qla_host_t *, uint16_t *, uint16_t *, uint16_t *,
+    uint16_t *);
+
+#if defined(QL_DEBUG_LEVEL_3)
+extern int
+qla2x00_get_fcal_position_map(scsi_qla_host_t *ha, char *pos_map);
+#endif
+
+/*
+ * Global Function Prototypes in qla_isr.c source file.
+ */
+extern irqreturn_t qla2x00_intr_handler(int, void *, struct pt_regs *);
+extern void qla2x00_process_response_queue(struct scsi_qla_host *);
+
+/*
+ * Global Function Prototypes in qla_sup.c source file.
+ */
+extern void qla2x00_lock_nvram_access(scsi_qla_host_t *);
+extern void qla2x00_unlock_nvram_access(scsi_qla_host_t *);
+extern uint16_t qla2x00_get_nvram_word(scsi_qla_host_t *, uint32_t);
+extern void qla2x00_write_nvram_word(scsi_qla_host_t *, uint32_t, uint16_t);
+extern void qla2x00_flash_enable(scsi_qla_host_t *);
+extern void qla2x00_flash_disable(scsi_qla_host_t *);
+extern uint8_t qla2x00_read_flash_byte(scsi_qla_host_t *, uint32_t);
+extern uint8_t qla2x00_get_flash_manufacturer(scsi_qla_host_t *);
+extern uint16_t qla2x00_get_flash_version(scsi_qla_host_t *);
+extern uint16_t qla2x00_get_flash_image(scsi_qla_host_t *, uint8_t *);
+extern uint16_t qla2x00_set_flash_image(scsi_qla_host_t *, uint8_t *);
+
+/*
+ * Global Function Prototypes in qla_dbg.c source file.
+ */
+extern void qla2100_fw_dump(scsi_qla_host_t *, int);
+extern void qla2300_fw_dump(scsi_qla_host_t *, int);
+extern void qla2100_ascii_fw_dump(scsi_qla_host_t *);
+extern void qla2300_ascii_fw_dump(scsi_qla_host_t *);
+extern void qla2x00_dump_regs(scsi_qla_host_t *);
+extern void qla2x00_dump_buffer(uint8_t *, uint32_t);
+extern void qla2x00_print_scsi_cmd(struct scsi_cmnd *);
+extern void qla2x00_print_q_info(struct os_lun *);
+
+/*
+ * Global Function Prototypes in qla_ip.c source file.
+ */
+extern int qla2x00_ip_initialize(scsi_qla_host_t *);
+extern int qla2x00_update_ip_device_data(scsi_qla_host_t *, fc_port_t *);
+extern void qla2x00_ip_send_complete(scsi_qla_host_t *, uint32_t, uint16_t);
+extern void qla2x00_ip_receive(scsi_qla_host_t *, sts_entry_t *);
+extern void qla2x00_ip_receive_fastpost(scsi_qla_host_t *, uint16_t);
+extern void qla2x00_ip_mailbox_iocb_done(scsi_qla_host_t *, struct mbx_entry *);
+
+/*
+ * Global Function Prototypes in qla_gs.c source file.
+ */
+extern int qla2x00_ga_nxt(scsi_qla_host_t *, fc_port_t *);
+extern int qla2x00_gid_pt(scsi_qla_host_t *, sw_info_t *);
+extern int qla2x00_gpn_id(scsi_qla_host_t *, sw_info_t *);
+extern int qla2x00_gnn_id(scsi_qla_host_t *, sw_info_t *);
+extern int qla2x00_gft_id(scsi_qla_host_t *, sw_info_t *);
+extern int qla2x00_rft_id(scsi_qla_host_t *);
+extern int qla2x00_rff_id(scsi_qla_host_t *);
+extern int qla2x00_rnn_id(scsi_qla_host_t *);
+extern int qla2x00_rsnn_nn(scsi_qla_host_t *);
+
+/*
+ * Global Function Prototypes in qla_rscn.c source file.
+ */
+extern fc_port_t *qla2x00_alloc_rscn_fcport(scsi_qla_host_t *, int);
+extern int qla2x00_handle_port_rscn(scsi_qla_host_t *, uint32_t, fc_port_t *,
+    int);
+extern void qla2x00_process_iodesc(scsi_qla_host_t *, struct mbx_entry *);
+extern void qla2x00_cancel_io_descriptors(scsi_qla_host_t *);
+
+/*
+ * Global Function Prototypes in qla_xioctl.c source file.
+ */
+#ifdef CONFIG_SCSI_QLA2XXX_IOCTL
+extern void qla2x00_enqueue_aen(scsi_qla_host_t *, uint16_t, void *);
+extern int qla2x00_alloc_ioctl_mem(scsi_qla_host_t *);
+extern void qla2x00_free_ioctl_mem(scsi_qla_host_t *);
+extern int qla2x00_get_ioctl_scrap_mem(scsi_qla_host_t *, void **, uint32_t);
+extern void qla2x00_free_ioctl_scrap_mem(scsi_qla_host_t *);
+#else
+#define qla2x00_enqueue_aen(ha, cmd, mode)	do { } while (0)
+#define qla2x00_alloc_ioctl_mem(ha)		(0)
+#define qla2x00_free_ioctl_mem(ha)		do { } while (0)
+#endif
+
+#endif /* _QLA_GBL_H */
diff -Nru a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/qla_gs.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,681 @@
+/*
+ *                  QLOGIC LINUX SOFTWARE
+ *
+ * QLogic ISP2x00 device driver for Linux 2.6.x
+ * Copyright (C) 2003 QLogic Corporation
+ * (www.qlogic.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+#include "qla_os.h"
+
+#include "qla_def.h"
+
+/* XXX(hch): this is ugly, but we don't want to pull in exioctl.h */
+#ifndef EXT_DEF_FC4_TYPE_SCSI
+#define EXT_DEF_FC4_TYPE_SCSI		0x1
+#endif
+
+static inline ms_iocb_entry_t *
+qla2x00_prep_ms_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
+
+static inline struct ct_sns_req *
+qla2x00_prep_ct_req(struct ct_sns_req *, uint16_t, uint16_t);
+
+/**
+ * qla2x00_prep_ms_iocb() - Prepare common MS IOCB fields for SNS CT query.
+ * @ha: HA context
+ * @req_size: request size in bytes
+ * @rsp_size: response size in bytes
+ *
+ * Returns a pointer to the @ha's ms_iocb.
+ */
+static inline ms_iocb_entry_t *
+qla2x00_prep_ms_iocb(scsi_qla_host_t *ha, uint32_t req_size, uint32_t rsp_size)
+{
+	ms_iocb_entry_t *ms_pkt;
+
+	ms_pkt = ha->ms_iocb;
+	memset(ms_pkt, 0, sizeof(ms_iocb_entry_t));
+
+	ms_pkt->entry_type = MS_IOCB_TYPE;
+	ms_pkt->entry_count = 1;
+	SET_TARGET_ID(ha, ms_pkt->loop_id, SIMPLE_NAME_SERVER);
+	ms_pkt->control_flags = __constant_cpu_to_le16(CF_READ | CF_HEAD_TAG);
+	ms_pkt->timeout = __constant_cpu_to_le16(25);
+	ms_pkt->cmd_dsd_count = __constant_cpu_to_le16(1);
+	ms_pkt->total_dsd_count = __constant_cpu_to_le16(2);
+	ms_pkt->rsp_bytecount = cpu_to_le32(rsp_size);
+	ms_pkt->req_bytecount = cpu_to_le32(req_size);
+
+	ms_pkt->dseg_req_address[0] = cpu_to_le32(LSD(ha->ct_sns_dma));
+	ms_pkt->dseg_req_address[1] = cpu_to_le32(MSD(ha->ct_sns_dma));
+	ms_pkt->dseg_req_length = ms_pkt->req_bytecount;
+
+	ms_pkt->dseg_rsp_address[0] = cpu_to_le32(LSD(ha->ct_sns_dma));
+	ms_pkt->dseg_rsp_address[1] = cpu_to_le32(MSD(ha->ct_sns_dma));
+	ms_pkt->dseg_rsp_length = ms_pkt->rsp_bytecount;
+
+	return (ms_pkt);
+}
+
+/**
+ * qla2x00_prep_ct_req() - Prepare common CT request fields for SNS query.
+ * @ct_req: CT request buffer
+ * @cmd: GS command
+ * @rsp_size: response size in bytes
+ *
+ * Returns a pointer to the intitialized @ct_req.
+ */
+static inline struct ct_sns_req *
+qla2x00_prep_ct_req(struct ct_sns_req *ct_req, uint16_t cmd, uint16_t rsp_size)
+{
+	memset(ct_req, 0, sizeof(struct ct_sns_pkt));
+
+	ct_req->header.revision = 0x01;
+	ct_req->header.gs_type = 0xFC;
+	ct_req->header.gs_subtype = 0x02;
+	ct_req->command = cpu_to_be16(cmd);
+	ct_req->max_rsp_size = cpu_to_be16((rsp_size - 16) / 4);
+
+	return (ct_req);
+}
+
+/**
+ * qla2x00_ga_nxt() - SNS scan for fabric devices via GA_NXT command.
+ * @ha: HA context
+ * @fcport: fcport entry to updated
+ *
+ * Returns 0 on success.
+ */
+int
+qla2x00_ga_nxt(scsi_qla_host_t *ha, fc_port_t *fcport)
+{
+	int		rval;
+
+	ms_iocb_entry_t	*ms_pkt;
+	struct ct_sns_req	*ct_req;
+	struct ct_sns_rsp	*ct_rsp;
+
+	/* Issue GA_NXT */
+	/* Prepare common MS IOCB */
+	ms_pkt = qla2x00_prep_ms_iocb(ha, GA_NXT_REQ_SIZE, GA_NXT_RSP_SIZE);
+
+	/* Prepare CT request */
+	ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GA_NXT_CMD,
+	    GA_NXT_RSP_SIZE);
+	ct_rsp = &ha->ct_sns->p.rsp;
+
+	/* Prepare CT arguments -- port_id */
+	ct_req->req.port_id.port_id[0] = fcport->d_id.b.domain;
+	ct_req->req.port_id.port_id[1] = fcport->d_id.b.area;
+	ct_req->req.port_id.port_id[2] = fcport->d_id.b.al_pa;
+
+	/* Execute MS IOCB */
+	rval = qla2x00_issue_iocb(ha, ha->ms_iocb, ha->ms_iocb_dma,
+	    sizeof(ms_iocb_entry_t));
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3(printk("scsi(%ld): GA_NXT issue IOCB failed (%d).\n",
+		    ha->host_no, rval));
+	} else if (ct_rsp->header.response !=
+	    __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) {
+		DEBUG2_3(printk("scsi(%ld): GA_NXT failed, rejected request, "
+		    "ga_nxt_rsp:\n", ha->host_no));
+		DEBUG2_3(qla2x00_dump_buffer((uint8_t *)&ct_rsp->header,
+		    sizeof(struct ct_rsp_hdr)));
+		rval = QLA_FUNCTION_FAILED;
+	} else {
+		/* Populate fc_port_t entry. */
+		fcport->d_id.b.domain = ct_rsp->rsp.ga_nxt.port_id[0];
+		fcport->d_id.b.area = ct_rsp->rsp.ga_nxt.port_id[1];
+		fcport->d_id.b.al_pa = ct_rsp->rsp.ga_nxt.port_id[2];
+
+		memcpy(fcport->node_name, ct_rsp->rsp.ga_nxt.node_name,
+		    WWN_SIZE);
+		memcpy(fcport->port_name, ct_rsp->rsp.ga_nxt.port_name,
+		    WWN_SIZE);
+
+		if (ct_rsp->rsp.ga_nxt.port_type != NS_N_PORT_TYPE &&
+		    ct_rsp->rsp.ga_nxt.port_type != NS_NL_PORT_TYPE)
+			fcport->d_id.b.domain = 0xf0;
+
+		DEBUG2_3(printk("scsi(%ld): GA_NXT entry - "
+		    "nn %02x%02x%02x%02x%02x%02x%02x%02x "
+		    "pn %02x%02x%02x%02x%02x%02x%02x%02x "
+		    "portid=%02x%02x%02x.\n",
+		    ha->host_no,
+		    fcport->node_name[0], fcport->node_name[1],
+		    fcport->node_name[2], fcport->node_name[3],
+		    fcport->node_name[4], fcport->node_name[5],
+		    fcport->node_name[6], fcport->node_name[7],
+		    fcport->port_name[0], fcport->port_name[1],
+		    fcport->port_name[2], fcport->port_name[3],
+		    fcport->port_name[4], fcport->port_name[5],
+		    fcport->port_name[6], fcport->port_name[7],
+		    fcport->d_id.b.domain, fcport->d_id.b.area,
+		    fcport->d_id.b.al_pa));
+	}
+
+	return (rval);
+}
+
+/**
+ * qla2x00_gid_pt() - SNS scan for fabric devices via GID_PT command.
+ * @ha: HA context
+ * @list: switch info entries to populate
+ *
+ * NOTE: Non-Nx_Ports are not requested.
+ *
+ * Returns 0 on success.
+ */
+int
+qla2x00_gid_pt(scsi_qla_host_t *ha, sw_info_t *list)
+{
+	int		rval;
+	uint16_t	i;
+
+	ms_iocb_entry_t	*ms_pkt;
+	struct ct_sns_req	*ct_req;
+	struct ct_sns_rsp	*ct_rsp;
+
+	struct ct_sns_gid_pt_data *gid_data;
+
+	gid_data = NULL;
+
+	/* Issue GID_PT */
+	/* Prepare common MS IOCB */
+	ms_pkt = qla2x00_prep_ms_iocb(ha, GID_PT_REQ_SIZE, GID_PT_RSP_SIZE);
+
+	/* Prepare CT request */
+	ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GID_PT_CMD,
+	    GID_PT_RSP_SIZE);
+	ct_rsp = &ha->ct_sns->p.rsp;
+
+	/* Prepare CT arguments -- port_type */
+	ct_req->req.gid_pt.port_type = NS_NX_PORT_TYPE;
+
+	/* Execute MS IOCB */
+	rval = qla2x00_issue_iocb(ha, ha->ms_iocb, ha->ms_iocb_dma,
+	    sizeof(ms_iocb_entry_t));
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3(printk("scsi(%ld): GID_PT issue IOCB failed (%d).\n",
+		    ha->host_no, rval));
+	} else if (ct_rsp->header.response !=
+	    __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) {
+		DEBUG2_3(printk("scsi(%ld): GID_PT failed, rejected request, "
+		    "gid_pt_rsp:\n", ha->host_no));
+		DEBUG2_3(qla2x00_dump_buffer((uint8_t *)&ct_rsp->header,
+		    sizeof(struct ct_rsp_hdr)));
+		rval = QLA_FUNCTION_FAILED;
+	} else {
+		/* Set port IDs in switch info list. */
+		for (i = 0; i < MAX_FIBRE_DEVICES; i++) {
+			gid_data = &ct_rsp->rsp.gid_pt.entries[i];
+			list[i].d_id.b.domain = gid_data->port_id[0];
+			list[i].d_id.b.area = gid_data->port_id[1];
+			list[i].d_id.b.al_pa = gid_data->port_id[2];
+
+			/* Last one exit. */
+			if (gid_data->control_byte & BIT_7) {
+				list[i].d_id.b.rsvd_1 = gid_data->control_byte;
+				break;
+			}
+		}
+
+		/*
+		 * If we've used all available slots, then the switch is
+		 * reporting back more devices that we can handle with this
+		 * single call.  Return a failed status, and let GA_NXT handle
+		 * the overload.
+		 */
+		if (i == MAX_FIBRE_DEVICES) 
+			rval = QLA_FUNCTION_FAILED;
+	}
+
+	return (rval);
+}
+
+/**
+ * qla2x00_gpn_id() - SNS Get Port Name (GPN_ID) query.
+ * @ha: HA context
+ * @list: switch info entries to populate
+ *
+ * Returns 0 on success.
+ */
+int
+qla2x00_gpn_id(scsi_qla_host_t *ha, sw_info_t *list)
+{
+	int		rval;
+	uint16_t	i;
+
+	ms_iocb_entry_t	*ms_pkt;
+	struct ct_sns_req	*ct_req;
+	struct ct_sns_rsp	*ct_rsp;
+
+	for (i = 0; i < MAX_FIBRE_DEVICES; i++) {
+		/* Issue GPN_ID */
+		/* Prepare common MS IOCB */
+		ms_pkt = qla2x00_prep_ms_iocb(ha, GPN_ID_REQ_SIZE,
+		    GPN_ID_RSP_SIZE);
+
+		/* Prepare CT request */
+		ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GPN_ID_CMD,
+		    GPN_ID_RSP_SIZE);
+		ct_rsp = &ha->ct_sns->p.rsp;
+
+		/* Prepare CT arguments -- port_id */
+		ct_req->req.port_id.port_id[0] = list[i].d_id.b.domain;
+		ct_req->req.port_id.port_id[1] = list[i].d_id.b.area;
+		ct_req->req.port_id.port_id[2] = list[i].d_id.b.al_pa;
+
+		/* Execute MS IOCB */
+		rval = qla2x00_issue_iocb(ha, ha->ms_iocb, ha->ms_iocb_dma,
+		    sizeof(ms_iocb_entry_t));
+		if (rval != QLA_SUCCESS) {
+			/*EMPTY*/
+			DEBUG2_3(printk("scsi(%ld): GPN_ID issue IOCB failed "
+			    "(%d).\n", ha->host_no, rval));
+		} else if (ct_rsp->header.response !=
+		    __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) {
+			DEBUG2_3(printk("scsi(%ld): GPN_ID failed, rejected "
+			    "request, gpn_id_rsp:\n", ha->host_no));
+			DEBUG2_3(qla2x00_dump_buffer((uint8_t *)&ct_rsp->header,
+			    sizeof(struct ct_rsp_hdr)));
+			rval = QLA_FUNCTION_FAILED;
+		} else {
+			/* Save portname */
+			memcpy(list[i].port_name,
+			    ct_rsp->rsp.gpn_id.port_name, WWN_SIZE);
+		}
+
+		/* Last device exit. */
+		if (list[i].d_id.b.rsvd_1 != 0)
+			break;
+	}
+
+	return (rval);
+}
+
+/**
+ * qla2x00_gnn_id() - SNS Get Node Name (GPN_ID) query.
+ * @ha: HA context
+ * @list: switch info entries to populate
+ *
+ * Returns 0 on success.
+ */
+int
+qla2x00_gnn_id(scsi_qla_host_t *ha, sw_info_t *list)
+{
+	int		rval;
+	uint16_t	i;
+
+	ms_iocb_entry_t	*ms_pkt;
+	struct ct_sns_req	*ct_req;
+	struct ct_sns_rsp	*ct_rsp;
+
+	for (i = 0; i < MAX_FIBRE_DEVICES; i++) {
+		/* Issue GNN_ID */
+		/* Prepare common MS IOCB */
+		ms_pkt = qla2x00_prep_ms_iocb(ha, GNN_ID_REQ_SIZE,
+		    GNN_ID_RSP_SIZE);
+
+		/* Prepare CT request */
+		ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GNN_ID_CMD,
+		    GNN_ID_RSP_SIZE);
+		ct_rsp = &ha->ct_sns->p.rsp;
+
+		/* Prepare CT arguments -- port_id */
+		ct_req->req.port_id.port_id[0] = list[i].d_id.b.domain;
+		ct_req->req.port_id.port_id[1] = list[i].d_id.b.area;
+		ct_req->req.port_id.port_id[2] = list[i].d_id.b.al_pa;
+
+		/* Execute MS IOCB */
+		rval = qla2x00_issue_iocb(ha, ha->ms_iocb, ha->ms_iocb_dma,
+		    sizeof(ms_iocb_entry_t));
+		if (rval != QLA_SUCCESS) {
+			/*EMPTY*/
+			DEBUG2_3(printk("scsi(%ld): GNN_ID issue IOCB failed "
+			    "(%d).\n", ha->host_no, rval));
+		} else if (ct_rsp->header.response !=
+		    __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) {
+			DEBUG2_3(printk("scsi(%ld): GNN_ID failed, rejected "
+			    "request, gnn_id_rsp:\n", ha->host_no));
+			DEBUG2_3(qla2x00_dump_buffer((uint8_t *)&ct_rsp->header,
+			    sizeof(struct ct_rsp_hdr)));
+			rval = QLA_FUNCTION_FAILED;
+		} else {
+			/* Save nodename */
+			memcpy(list[i].node_name,
+			    ct_rsp->rsp.gnn_id.node_name, WWN_SIZE);
+
+			DEBUG2_3(printk("scsi(%ld): GID_PT entry - "
+			    "nn %02x%02x%02x%02x%02x%02x%02x%02x "
+			    "pn %02x%02x%02x%02x%02x%02x%02x%02x "
+			    "portid=%02x%02x%02x.\n",
+			    ha->host_no,
+			    list[i].node_name[0], list[i].node_name[1],
+			    list[i].node_name[2], list[i].node_name[3],
+			    list[i].node_name[4], list[i].node_name[5],
+			    list[i].node_name[6], list[i].node_name[7],
+			    list[i].port_name[0], list[i].port_name[1],
+			    list[i].port_name[2], list[i].port_name[3],
+			    list[i].port_name[4], list[i].port_name[5],
+			    list[i].port_name[6], list[i].port_name[7],
+			    list[i].d_id.b.domain, list[i].d_id.b.area,
+			    list[i].d_id.b.al_pa));
+		}
+
+		/* Last device exit. */
+		if (list[i].d_id.b.rsvd_1 != 0)
+			break;
+	}
+
+	return (rval);
+}
+
+/**
+ * qla2x00_gft_id() - SNS Get FC-4 TYPEs (GFT_ID) query.
+ * @ha: HA context
+ * @list: switch info entries to populate
+ *
+ * Returns 0 on success.
+ */
+int
+qla2x00_gft_id(scsi_qla_host_t *ha, sw_info_t *list)
+{
+	int		rval;
+	uint16_t	i;
+
+	ms_iocb_entry_t	*ms_pkt;
+	struct ct_sns_req	*ct_req;
+	struct ct_sns_rsp	*ct_rsp;
+
+	for (i = 0; i < MAX_FIBRE_DEVICES; i++) {
+		/* Issue GFT_ID */
+		/* Prepare common MS IOCB */
+		ms_pkt = qla2x00_prep_ms_iocb(ha, GFT_ID_REQ_SIZE,
+		    GFT_ID_RSP_SIZE);
+
+		/* Prepare CT request */
+		ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GFT_ID_CMD,
+		    GFT_ID_RSP_SIZE);
+		ct_rsp = &ha->ct_sns->p.rsp;
+
+		/* Prepare CT arguments -- port_id */
+		ct_req->req.port_id.port_id[0] = list[i].d_id.b.domain;
+		ct_req->req.port_id.port_id[1] = list[i].d_id.b.area;
+		ct_req->req.port_id.port_id[2] = list[i].d_id.b.al_pa;
+
+		/* Execute MS IOCB */
+		rval = qla2x00_issue_iocb(ha, ha->ms_iocb, ha->ms_iocb_dma,
+		    sizeof(ms_iocb_entry_t));
+		if (rval != QLA_SUCCESS) {
+			/*EMPTY*/
+			DEBUG2_3(printk("scsi(%ld): GFT_ID issue IOCB failed "
+			    "(%d).\n", ha->host_no, rval));
+		} else if (ct_rsp->header.response !=
+		    __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) {
+			DEBUG2_3(printk("scsi(%ld): GFT_ID failed, rejected "
+			    "request, gft_id_rsp:\n", ha->host_no));
+			DEBUG2_3(qla2x00_dump_buffer((uint8_t *)&ct_rsp->header,
+			    sizeof(struct ct_rsp_hdr)));
+			rval = QLA_FUNCTION_FAILED;
+		} else {
+			/* FCP-3 check necessary?  No, assume FCP-3 */
+			/*if (ct_rsp->rsp.gft_id.fc4_types[2] & 0x01)*/
+			list[i].type = SW_TYPE_SCSI;
+			if (ct_rsp->rsp.gft_id.fc4_types[3] & 0x20)
+				list[i].type |= SW_TYPE_IP;
+		}
+
+		/* Last device exit. */
+		if (list[i].d_id.b.rsvd_1 != 0)
+			break;
+	}
+
+	return (rval);
+}
+
+/**
+ * qla2x00_rft_id() - SNS Register FC-4 TYPEs (RFT_ID) supported by the HBA.
+ * @ha: HA context
+ *
+ * Returns 0 on success.
+ */
+int
+qla2x00_rft_id(scsi_qla_host_t *ha)
+{
+	int		rval;
+
+	ms_iocb_entry_t	*ms_pkt;
+	struct ct_sns_req	*ct_req;
+	struct ct_sns_rsp	*ct_rsp;
+
+	/* Issue RFT_ID */
+	/* Prepare common MS IOCB */
+	ms_pkt = qla2x00_prep_ms_iocb(ha, RFT_ID_REQ_SIZE, RFT_ID_RSP_SIZE);
+
+	/* Prepare CT request */
+	ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RFT_ID_CMD,
+	    RFT_ID_RSP_SIZE);
+	ct_rsp = &ha->ct_sns->p.rsp;
+
+	/* Prepare CT arguments -- port_id, FC-4 types */
+	ct_req->req.rft_id.port_id[0] = ha->d_id.b.domain;
+	ct_req->req.rft_id.port_id[1] = ha->d_id.b.area;
+	ct_req->req.rft_id.port_id[2] = ha->d_id.b.al_pa;
+
+	ct_req->req.rft_id.fc4_types[2] = 0x01;		/* FCP-3 */
+	ha->active_fc4_types = EXT_DEF_FC4_TYPE_SCSI;
+
+	/* Execute MS IOCB */
+	rval = qla2x00_issue_iocb(ha, ha->ms_iocb, ha->ms_iocb_dma,
+	    sizeof(ms_iocb_entry_t));
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3(printk("scsi(%ld): RFT_ID issue IOCB failed (%d).\n",
+		    ha->host_no, rval));
+	} else if (ct_rsp->header.response !=
+	    __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) {
+		DEBUG2_3(printk("scsi(%ld): RFT_ID failed, rejected "
+		    "request, rft_id_rsp:\n", ha->host_no));
+		DEBUG2_3(qla2x00_dump_buffer((uint8_t *)&ct_rsp->header,
+		    sizeof(struct ct_rsp_hdr)));
+		rval = QLA_FUNCTION_FAILED;
+	} else {
+		DEBUG2(printk("scsi(%ld): RFT_ID exiting normally.\n",
+		    ha->host_no));
+	}
+
+	return (rval);
+}
+
+/**
+ * qla2x00_rff_id() - SNS Register FC-4 Features (RFF_ID) supported by the HBA.
+ * @ha: HA context
+ *
+ * Returns 0 on success.
+ */
+int
+qla2x00_rff_id(scsi_qla_host_t *ha)
+{
+	int		rval;
+
+	ms_iocb_entry_t	*ms_pkt;
+	struct ct_sns_req	*ct_req;
+	struct ct_sns_rsp	*ct_rsp;
+
+	/* Issue RFF_ID */
+	/* Prepare common MS IOCB */
+	ms_pkt = qla2x00_prep_ms_iocb(ha, RFF_ID_REQ_SIZE, RFF_ID_RSP_SIZE);
+
+	/* Prepare CT request */
+	ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RFF_ID_CMD,
+	    RFF_ID_RSP_SIZE);
+	ct_rsp = &ha->ct_sns->p.rsp;
+
+	/* Prepare CT arguments -- port_id, FC-4 feature, FC-4 type */
+	ct_req->req.rff_id.port_id[0] = ha->d_id.b.domain;
+	ct_req->req.rff_id.port_id[1] = ha->d_id.b.area;
+	ct_req->req.rff_id.port_id[2] = ha->d_id.b.al_pa;
+
+	ct_req->req.rff_id.fc4_type = 0x08;		/* SCSI - FCP */
+
+	/* Execute MS IOCB */
+	rval = qla2x00_issue_iocb(ha, ha->ms_iocb, ha->ms_iocb_dma,
+	    sizeof(ms_iocb_entry_t));
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3(printk("scsi(%ld): RFF_ID issue IOCB failed (%d).\n",
+		    ha->host_no, rval));
+	} else if (ct_rsp->header.response !=
+	    __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) {
+		DEBUG2_3(printk("scsi(%ld): RFF_ID failed, rejected "
+		    "request, rff_id_rsp:\n", ha->host_no));
+		DEBUG2_3(qla2x00_dump_buffer((uint8_t *)&ct_rsp->header,
+		    sizeof(struct ct_rsp_hdr)));
+		rval = QLA_FUNCTION_FAILED;
+	} else {
+		DEBUG2(printk("scsi(%ld): RFF_ID exiting normally.\n",
+		    ha->host_no));
+	}
+
+	return (rval);
+}
+
+/**
+ * qla2x00_rnn_id() - SNS Register Node Name (RNN_ID) of the HBA.
+ * @ha: HA context
+ *
+ * Returns 0 on success.
+ */
+int
+qla2x00_rnn_id(scsi_qla_host_t *ha)
+{
+	int		rval;
+
+	ms_iocb_entry_t	*ms_pkt;
+	struct ct_sns_req	*ct_req;
+	struct ct_sns_rsp	*ct_rsp;
+
+	/* Issue RNN_ID */
+	/* Prepare common MS IOCB */
+	ms_pkt = qla2x00_prep_ms_iocb(ha, RNN_ID_REQ_SIZE, RNN_ID_RSP_SIZE);
+
+	/* Prepare CT request */
+	ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RNN_ID_CMD,
+	    RNN_ID_RSP_SIZE);
+	ct_rsp = &ha->ct_sns->p.rsp;
+
+	/* Prepare CT arguments -- port_id, node_name */
+	ct_req->req.rnn_id.port_id[0] = ha->d_id.b.domain;
+	ct_req->req.rnn_id.port_id[1] = ha->d_id.b.area;
+	ct_req->req.rnn_id.port_id[2] = ha->d_id.b.al_pa;
+
+	memcpy(ct_req->req.rnn_id.node_name, ha->init_cb->node_name, WWN_SIZE);
+
+	/* Execute MS IOCB */
+	rval = qla2x00_issue_iocb(ha, ha->ms_iocb, ha->ms_iocb_dma,
+	    sizeof(ms_iocb_entry_t));
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3(printk("scsi(%ld): RNN_ID issue IOCB failed (%d).\n",
+		    ha->host_no, rval));
+	} else if (ct_rsp->header.response !=
+	    __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) {
+		DEBUG2_3(printk("scsi(%ld): RNN_ID failed, rejected "
+		    "request, rnn_id_rsp:\n", ha->host_no));
+		DEBUG2_3(qla2x00_dump_buffer((uint8_t *)&ct_rsp->header,
+		    sizeof(struct ct_rsp_hdr)));
+		rval = QLA_FUNCTION_FAILED;
+	} else {
+		DEBUG2(printk("scsi(%ld): RNN_ID exiting normally.\n",
+		    ha->host_no));
+	}
+
+	return (rval);
+}
+
+/**
+ * qla2x00_rsnn_nn() - SNS Register Symbolic Node Name (RSNN_NN) of the HBA.
+ * @ha: HA context
+ *
+ * Returns 0 on success.
+ */
+int
+qla2x00_rsnn_nn(scsi_qla_host_t *ha)
+{
+	int		rval;
+	uint8_t		*snn;
+	uint8_t		version[20];
+
+	ms_iocb_entry_t	*ms_pkt;
+	struct ct_sns_req	*ct_req;
+	struct ct_sns_rsp	*ct_rsp;
+
+	/* Issue RSNN_NN */
+	/* Prepare common MS IOCB */
+	/*   Request size adjusted after CT preparation */
+	ms_pkt = qla2x00_prep_ms_iocb(ha, 0, RSNN_NN_RSP_SIZE);
+
+	/* Prepare CT request */
+	ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RSNN_NN_CMD,
+	    RSNN_NN_RSP_SIZE);
+	ct_rsp = &ha->ct_sns->p.rsp;
+
+	/* Prepare CT arguments -- node_name, symbolic node_name, size */
+	memcpy(ct_req->req.rsnn_nn.node_name, ha->init_cb->node_name, WWN_SIZE);
+	
+	/* Prepare the Symbolic Node Name */
+	/* Board type */
+	snn = ct_req->req.rsnn_nn.sym_node_name;
+	strcpy(snn, ha->model_number);
+	/* Firmware version */
+	strcat(snn, " FW:v");
+	sprintf(version, "%d.%02d.%02d", ha->fw_major_version,
+	    ha->fw_minor_version, ha->fw_subminor_version);
+	strcat(snn, version);
+	/* Driver version */
+	strcat(snn, " DVR:v");
+	strcat(snn, qla2x00_version_str);
+
+	/* Calculate SNN length */
+	ct_req->req.rsnn_nn.name_len = (uint8_t)strlen(snn);
+
+	/* Update MS IOCB request */
+	ms_pkt->req_bytecount =
+	    cpu_to_le32(24 + 1 + ct_req->req.rsnn_nn.name_len);
+	ms_pkt->dseg_req_length = ms_pkt->req_bytecount;
+
+	/* Execute MS IOCB */
+	rval = qla2x00_issue_iocb(ha, ha->ms_iocb, ha->ms_iocb_dma,
+	    sizeof(ms_iocb_entry_t));
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3(printk("scsi(%ld): RSNN_NN issue IOCB failed (%d).\n",
+		    ha->host_no, rval));
+	} else if (ct_rsp->header.response !=
+	    __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) {
+		DEBUG2_3(printk("scsi(%ld): RSNN_NN failed, rejected "
+		    "request, rsnn_id_rsp:\n", ha->host_no));
+		DEBUG2_3(qla2x00_dump_buffer((uint8_t *)&ct_rsp->header,
+		    sizeof(struct ct_rsp_hdr)));
+		rval = QLA_FUNCTION_FAILED;
+	} else {
+		DEBUG2(printk("scsi(%ld): RSNN_NN exiting normally.\n",
+		    ha->host_no));
+	}
+
+	return (rval);
+}
diff -Nru a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/qla_init.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,4260 @@
+/*
+ *                  QLOGIC LINUX SOFTWARE
+ *
+ * QLogic ISP2x00 device driver for Linux 2.6.x
+ * Copyright (C) 2003 QLogic Corporation
+ * (www.qlogic.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+#include "qla_os.h"
+#include "qla_def.h"
+#include "qla_devtbl.h"
+
+/* XXX(hch): this is ugly, but we don't want to pull in exioctl.h */
+#ifndef EXT_IS_LUN_BIT_SET
+#define EXT_IS_LUN_BIT_SET(P,L) \
+    (((P)->mask[L/8] & (0x80 >> (L%8)))?1:0)
+#define EXT_SET_LUN_BIT(P,L) \
+    ((P)->mask[L/8] |= (0x80 >> (L%8)))
+#endif
+
+/*
+*  QLogic ISP2x00 Hardware Support Function Prototypes.
+*/
+static int qla2x00_pci_config(scsi_qla_host_t *);
+static int qla2x00_isp_firmware(scsi_qla_host_t *);
+static void qla2x00_reset_chip(scsi_qla_host_t *);
+static int qla2x00_chip_diag(scsi_qla_host_t *);
+static int qla2x00_setup_chip(scsi_qla_host_t *);
+static void qla2x00_init_response_q_entries(scsi_qla_host_t *);
+static int qla2x00_init_rings(scsi_qla_host_t *);
+static int qla2x00_fw_ready(scsi_qla_host_t *);
+static int qla2x00_configure_hba(scsi_qla_host_t *);
+static int qla2x00_nvram_config(scsi_qla_host_t *);
+static void qla2x00_init_tgt_map(scsi_qla_host_t *);
+static int qla2x00_configure_loop(scsi_qla_host_t *);
+static int qla2x00_configure_local_loop(scsi_qla_host_t *);
+static void qla2x00_update_fcport(scsi_qla_host_t *, fc_port_t *);
+static void qla2x00_lun_discovery(scsi_qla_host_t *, fc_port_t *);
+static int qla2x00_rpt_lun_discovery(scsi_qla_host_t *, fc_port_t *,
+    inq_cmd_rsp_t *, dma_addr_t);
+static int qla2x00_report_lun(scsi_qla_host_t *, fc_port_t *,
+    rpt_lun_cmd_rsp_t *, dma_addr_t);
+static fc_lun_t *qla2x00_cfg_lun(scsi_qla_host_t *, fc_port_t *, uint16_t,
+    inq_cmd_rsp_t *, dma_addr_t);
+static fc_lun_t * qla2x00_add_lun(fc_port_t *, uint16_t);
+static int qla2x00_inquiry(scsi_qla_host_t *, fc_port_t *, uint16_t,
+    inq_cmd_rsp_t *, dma_addr_t);
+static int qla2x00_configure_fabric(scsi_qla_host_t *);
+static int qla2x00_find_all_fabric_devs(scsi_qla_host_t *, struct list_head *);
+static int qla2x00_device_resync(scsi_qla_host_t *);
+static int qla2x00_fabric_dev_login(scsi_qla_host_t *, fc_port_t *,
+    uint16_t *);
+static void qla2x00_config_os(scsi_qla_host_t *ha);
+static uint16_t qla2x00_fcport_bind(scsi_qla_host_t *ha, fc_port_t *fcport);
+static os_lun_t * qla2x00_fclun_bind(scsi_qla_host_t *, fc_port_t *,
+    fc_lun_t *);
+static void qla2x00_lun_free(scsi_qla_host_t *, uint16_t, uint16_t);
+static int qla2x00_bstr_to_hex(char *, uint8_t *, int);
+static int qla2x00_find_propname(scsi_qla_host_t *,
+    char *, char *, char *, int);
+#if 0
+static int qla2x00_get_prop_16chars(scsi_qla_host_t *,
+    char *, char *, char *);
+static void qla2x00_get_properties(scsi_qla_host_t *, char *);
+
+static void qla2x00_cfg_persistent_binding(scsi_qla_host_t *);
+static os_tgt_t *qla2x00_persistent_bind(scsi_qla_host_t *, uint8_t *,
+    uint8_t *, port_id_t *, uint16_t);
+#endif
+
+static int qla2x00_restart_isp(scsi_qla_host_t *);
+static void qla2x00_reset_adapter(scsi_qla_host_t *);
+
+/****************************************************************************/
+/*                QLogic ISP2x00 Hardware Support Functions.                */
+/****************************************************************************/
+
+/*
+* qla2x00_initialize_adapter
+*      Initialize board.
+*
+* Input:
+*      ha = adapter block pointer.
+*
+* Returns:
+*      0 = success
+*/
+int
+qla2x00_initialize_adapter(scsi_qla_host_t *ha)
+{
+	int	rval;
+	uint8_t	isp_init = 0;
+	uint8_t	restart_risc = 0;
+	uint8_t	retry;
+
+	/* Clear adapter flags. */
+	ha->flags.online = FALSE;
+	ha->flags.reset_active = FALSE;
+	atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME);
+	atomic_set(&ha->loop_state, LOOP_DOWN);
+	ha->device_flags = 0;
+	ha->sns_retry_cnt = 0;
+	ha->dpc_flags = 0;
+	ha->failback_delay = 0;
+	ha->flags.management_server_logged_in = 0;
+	ha->marker_needed = 0;
+	ha->mbx_flags = 0;
+	ha->isp_abort_cnt = 0;
+	ha->beacon_blink_led = 0;
+
+	rval = qla2x00_pci_config(ha);
+	if (rval) {
+		DEBUG2(printk("scsi(%ld): Unable to configure PCI space=n",
+		    ha->host_no));
+		return (rval);
+	}
+
+	qla2x00_reset_chip(ha);
+
+	/* Initialize target map database. */
+	qla2x00_init_tgt_map(ha);
+
+	/* Get Flash Version */
+	qla2x00_get_flash_version(ha);
+
+	qla_printk(KERN_INFO, ha, "Configure NVRAM parameters...\n");
+	qla2x00_nvram_config(ha);
+
+	ha->retry_count = ql2xretrycount;
+
+	qla_printk(KERN_INFO, ha, "Verifying loaded RISC code...\n");
+
+#if 0
+	/*
+	 * If the user specified a device configuration on the command line
+	 * then use it as the configuration.  Otherwise, we scan for all
+	 * devices.
+	 */
+	if (ql2xdevconf) {
+		ha->cmdline = ql2xdevconf;
+	}
+#endif
+
+	retry = 10;
+	/*
+	 * Try to configure the loop.
+	 */
+	do {
+		restart_risc = 0;
+		isp_init = 0;
+
+		/* If firmware needs to be loaded */
+		if (qla2x00_isp_firmware(ha) != QLA_SUCCESS) {
+			if ((rval = qla2x00_chip_diag(ha)) == QLA_SUCCESS) {
+				rval = qla2x00_setup_chip(ha);
+			}
+		}
+
+		/* Retrieve firmware information */
+		qla2x00_get_fw_version(ha, &ha->fw_major_version,
+		    &ha->fw_minor_version, &ha->fw_subminor_version,
+		    &ha->fw_attributes);
+		qla2x00_get_resource_cnts(ha, NULL, &ha->xchg_buf_cnt,
+		    &ha->iocb_buf_cnt, NULL);
+
+		if (rval == QLA_SUCCESS &&
+		    (rval = qla2x00_init_rings(ha)) == QLA_SUCCESS) {
+check_fw_ready_again:
+			/*
+			 * Wait for a successful LIP up to a maximum 
+			 * of (in seconds): RISC login timeout value,
+			 * RISC retry count value, and port down retry
+			 * value OR a minimum of 4 seconds OR If no 
+			 * cable, only 5 seconds.
+			 */
+			if (!qla2x00_fw_ready(ha)) {
+				clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags);
+
+				/*
+				 * Go setup flash database devices with proper
+				 * Loop ID's.
+				 */
+				do {
+					clear_bit(LOOP_RESYNC_NEEDED,
+					    &ha->dpc_flags);
+					rval = qla2x00_configure_loop(ha);
+
+					if (test_bit(ISP_ABORT_NEEDED,
+					    &ha->dpc_flags)) {
+
+						restart_risc = 1;
+						break;
+					}
+
+					/*
+					 * If loop state change while we were
+					 * discoverying devices then wait for
+					 * LIP to complete
+					 */
+
+					if (atomic_read(&ha->loop_state) ==
+					    LOOP_DOWN && retry--) {
+						goto check_fw_ready_again;
+					}
+				} while (!atomic_read(&ha->loop_down_timer) &&
+				    retry &&
+				    (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)));
+			}
+
+			if (ha->mem_err) {
+				restart_risc = 1;
+			}
+			isp_init = 1;
+
+		}
+	} while (restart_risc && retry--);
+
+	if (isp_init) {
+		clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags);
+		ha->marker_needed = 1;
+		qla2x00_marker(ha, 0, 0, MK_SYNC_ALL);
+		ha->marker_needed = 0;
+
+		ha->flags.online = TRUE;
+	}
+
+	if (rval) {
+		DEBUG2_3(printk("%s(): **** FAILED ****\n", __func__));
+	}
+
+	return (rval);
+}
+
+/**
+ * qla2x00_pci_config() - Setup device PCI configuration registers.
+ * @ha: HA context
+ *
+ * Returns 0 on success.
+ */
+static int
+qla2x00_pci_config(scsi_qla_host_t *ha)
+{
+	uint16_t	w, mwi;
+	unsigned long   flags = 0;
+	uint32_t	cnt;
+
+	qla_printk(KERN_INFO, ha, "Configuring PCI space...\n");
+
+	/* 
+	 * Turn on PCI master; for system BIOSes that don't turn it on by
+	 * default.
+	 */
+	pci_set_master(ha->pdev);
+	mwi = 0;
+	if (pci_set_mwi(ha->pdev))
+		mwi = PCI_COMMAND_INVALIDATE;
+	pci_read_config_word(ha->pdev, PCI_REVISION_ID, &ha->revision);
+
+	if (!ha->iobase)
+		return (QLA_FUNCTION_FAILED);
+
+	/*
+	 * We want to respect framework's setting of PCI configuration space
+	 * command register and also want to make sure that all bits of
+	 * interest to us are properly set in command register.
+	 */
+	pci_read_config_word(ha->pdev, PCI_COMMAND, &w);
+	w |= mwi | (PCI_COMMAND_PARITY | PCI_COMMAND_SERR);
+
+	/* Get PCI bus information. */
+	spin_lock_irqsave(&ha->hardware_lock, flags);
+	ha->pci_attr = RD_REG_WORD(&ha->iobase->ctrl_status);
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+	if (IS_QLA23XX(ha)) {
+		pci_write_config_byte(ha->pdev, PCI_LATENCY_TIMER, 0x80);
+
+		/* PCI Specification Revision 2.3 changes */
+		if (IS_QLA2322(ha))
+			/* Command Register - Reset Interrupt Disable. */
+			w &= ~BIT_10;
+
+		/*
+		 * If this is a 2300 card and not 2312, reset the
+		 * COMMAND_INVALIDATE due to a bug in the 2300. Unfortunately,
+		 * the 2310 also reports itself as a 2300 so we need to get the
+		 * fb revision level -- a 6 indicates it really is a 2300 and
+		 * not a 2310.
+		 */
+		if (IS_QLA2300(ha)) {
+			spin_lock_irqsave(&ha->hardware_lock, flags);
+
+			/* Pause RISC. */
+			WRT_REG_WORD(&ha->iobase->hccr, HCCR_PAUSE_RISC);
+			for (cnt = 0; cnt < 30000; cnt++) {
+				if ((RD_REG_WORD(&ha->iobase->hccr) &
+				    HCCR_RISC_PAUSE) != 0)
+					break;
+	
+				udelay(10);
+			}
+
+			/* Select FPM registers. */
+			WRT_REG_WORD(&ha->iobase->ctrl_status, 0x20);
+
+			/* Get the fb rev level */
+			ha->fb_rev = RD_FB_CMD_REG(ha, ha->iobase);
+
+			if (ha->fb_rev == FPM_2300)
+				w &= ~PCI_COMMAND_INVALIDATE;
+
+			/* Deselect FPM registers. */
+			WRT_REG_WORD(&ha->iobase->ctrl_status, 0x0);
+
+			/* Release RISC module. */
+			WRT_REG_WORD(&ha->iobase->hccr, HCCR_RELEASE_RISC);
+			for (cnt = 0; cnt < 30000; cnt++) {
+				if ((RD_REG_WORD(&ha->iobase->hccr) &
+				    HCCR_RISC_PAUSE) == 0)
+					break;
+	
+				udelay(10);
+			}
+
+			spin_unlock_irqrestore(&ha->hardware_lock, flags);
+		}
+	}
+
+	pci_write_config_word(ha->pdev, PCI_COMMAND, w);
+
+	/* Reset expansion ROM address decode enable */
+	pci_read_config_word(ha->pdev, PCI_ROM_ADDRESS, &w);
+	w &= ~PCI_ROM_ADDRESS_ENABLE;
+	pci_write_config_word(ha->pdev, PCI_ROM_ADDRESS, w);
+
+	return (QLA_SUCCESS);
+}
+
+/**
+ * qla2x00_isp_firmware() - Choose firmware image.
+ * @ha: HA context
+ *
+ * Returns 0 on success.
+ */
+static int
+qla2x00_isp_firmware(scsi_qla_host_t *ha)
+{
+	int  rval;
+
+	/* Assume loading risc code */
+	rval = QLA_FUNCTION_FAILED; 
+
+	if (ha->flags.disable_risc_code_load) {
+		DEBUG2(printk("scsi(%ld): RISC CODE NOT loaded\n",
+		    ha->host_no));
+		qla_printk(KERN_INFO, ha, "RISC CODE NOT loaded\n");
+
+		/* Verify checksum of loaded RISC code. */
+		rval = qla2x00_verify_checksum(ha);
+	}
+
+	if (rval) {
+		DEBUG2_3(printk("scsi(%ld): **** Load RISC code ****\n",
+		    ha->host_no));
+	}
+
+	return (rval);
+}
+
+/**
+ * qla2x00_reset_chip() - Reset ISP chip.
+ * @ha: HA context
+ *
+ * Returns 0 on success.
+ */
+static void
+qla2x00_reset_chip(scsi_qla_host_t *ha) 
+{
+	unsigned long   flags = 0;
+	device_reg_t	*reg = ha->iobase;
+	uint32_t	cnt;
+	unsigned long	mbx_flags = 0;
+	uint16_t	cmd;
+
+	/* Disable ISP interrupts. */
+	qla2x00_disable_intrs(ha);
+
+	spin_lock_irqsave(&ha->hardware_lock, flags);
+
+	/* Turn off master enable */
+	cmd = 0;
+	pci_read_config_word(ha->pdev, PCI_COMMAND, &cmd);
+	cmd &= ~PCI_COMMAND_MASTER;
+	pci_write_config_word(ha->pdev, PCI_COMMAND, cmd);
+
+	if (!IS_QLA2100(ha)) {
+		/* Pause RISC. */
+		WRT_REG_WORD(&reg->hccr, HCCR_PAUSE_RISC);
+		if (!IS_QLA2312(ha) && !IS_QLA2322(ha)) {
+			for (cnt = 0; cnt < 30000; cnt++) {
+				if ((RD_REG_WORD(&reg->hccr) &
+				    HCCR_RISC_PAUSE) != 0)
+					break;
+				udelay(100);
+			}
+		} else {
+			udelay(10);
+		}
+
+		/* Select FPM registers. */
+		WRT_REG_WORD(&reg->ctrl_status, 0x20);
+
+		/* FPM Soft Reset. */
+		WRT_REG_WORD(&reg->fpm_diag_config, 0x100);
+
+		/* Toggle Fpm Reset. */
+		if (IS_QLA23XX(ha))
+			WRT_REG_WORD(&reg->fpm_diag_config, 0x0);
+
+		/* Select frame buffer registers. */
+		WRT_REG_WORD(&reg->ctrl_status, 0x10);
+
+		/* Reset frame buffer FIFOs. */
+		if (IS_QLA2200(ha)) {
+			WRT_FB_CMD_REG(ha, reg, 0xa000);
+		} else {
+			WRT_FB_CMD_REG(ha, reg, 0x00fc);
+
+			/* Read back fb_cmd until zero or 3 seconds max */
+			for (cnt = 0; cnt < 3000; cnt++) {
+				if ((RD_FB_CMD_REG(ha, reg) & 0xff) == 0)
+					break;
+				udelay(100);
+			}
+		}
+
+		/* Select RISC module registers. */
+		WRT_REG_WORD(&reg->ctrl_status, 0);
+
+		/* Reset RISC processor. */
+		WRT_REG_WORD(&reg->hccr, HCCR_RESET_RISC);
+
+		/* Release RISC processor. */
+		WRT_REG_WORD(&reg->hccr, HCCR_RELEASE_RISC);
+	}
+
+	WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT);
+	WRT_REG_WORD(&reg->hccr, HCCR_CLR_HOST_INT);
+
+	/* Reset ISP chip. */
+	WRT_REG_WORD(&reg->ctrl_status, CSR_ISP_SOFT_RESET);
+
+	/* Wait for RISC to recover from reset. */
+	if (IS_QLA2312(ha) || IS_QLA2322(ha)) {
+		udelay(10);
+	} else {
+		/*
+		 * It is necessary to for a delay here since the card doesn't
+		 * respond to PCI reads during a reset. On some architectures
+		 * this will result in an MCA.
+		 */
+		udelay(20);
+		for (cnt = 30000; cnt; cnt--) {
+			if ((RD_REG_WORD(&reg->ctrl_status) &
+			    CSR_ISP_SOFT_RESET) == 0)
+				break;
+			udelay(100);
+		}
+	}
+
+	/* Reset RISC processor. */
+	WRT_REG_WORD(&reg->hccr, HCCR_RESET_RISC);
+
+	WRT_REG_WORD(&reg->semaphore, 0);
+
+	/* Release RISC processor. */
+	WRT_REG_WORD(&reg->hccr, HCCR_RELEASE_RISC);
+	RD_REG_WORD(&reg->hccr);		/* PCI Posting. */
+
+	if (IS_QLA2312(ha) || IS_QLA2322(ha))
+		udelay(100);
+	else {
+		for (cnt = 0; cnt < 30000; cnt++) {
+			if (!(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags)))
+				spin_lock_irqsave(&ha->mbx_reg_lock, mbx_flags);
+
+			if (RD_MAILBOX_REG(ha, reg, 0) != MBS_BUSY) {
+				if (!(test_bit(ABORT_ISP_ACTIVE,
+				    &ha->dpc_flags)))
+					spin_unlock_irqrestore(
+					    &ha->mbx_reg_lock, mbx_flags);
+				break;
+			}
+
+			if (!(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags)))
+				spin_unlock_irqrestore(&ha->mbx_reg_lock,
+				    mbx_flags);
+
+			udelay(100);
+		}
+	}
+
+	/* Turn on master enable */
+	cmd |= PCI_COMMAND_MASTER;
+	pci_write_config_word(ha->pdev, PCI_COMMAND, cmd);
+
+	/* Disable RISC pause on FPM parity error. */
+	if (!IS_QLA2100(ha))
+		WRT_REG_WORD(&reg->hccr, HCCR_DISABLE_PARITY_PAUSE);
+
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
+}
+
+/**
+ * qla2x00_chip_diag() - Test chip for proper operation.
+ * @ha: HA context
+ *
+ * Returns 0 on success.
+ */
+static int
+qla2x00_chip_diag(scsi_qla_host_t *ha)
+{
+	int		rval;
+	device_reg_t	*reg = ha->iobase;
+	unsigned long	flags = 0;
+	uint16_t	data;
+	uint32_t	cnt;
+	uint16_t	mb[5];
+
+	/* Assume a failed state */
+	rval = QLA_FUNCTION_FAILED;
+
+	DEBUG3(printk("scsi(%ld): Testing device at %lx.\n",
+	    ha->host_no, (u_long)&reg->flash_address));
+
+	spin_lock_irqsave(&ha->hardware_lock, flags);
+
+	/* Reset ISP chip. */
+	WRT_REG_WORD(&reg->ctrl_status, CSR_ISP_SOFT_RESET);
+	/*
+	 * We need to have a delay here since the card will not respond while
+	 * in reset causing an MCA on some architectures.
+	 */
+	udelay(20);
+	data = qla2x00_debounce_register(&reg->ctrl_status);
+	for (cnt = 6000000 ; cnt && (data & CSR_ISP_SOFT_RESET); cnt--) {
+		udelay(5);
+		data = RD_REG_WORD(&reg->ctrl_status);
+		barrier();
+	}
+
+	if (!cnt)
+		goto chip_diag_failed;
+
+	DEBUG3(printk("scsi(%ld): Reset register cleared by chip reset\n",
+	    ha->host_no));
+
+	/* Reset RISC processor. */
+	WRT_REG_WORD(&reg->hccr, HCCR_RESET_RISC);
+	WRT_REG_WORD(&reg->hccr, HCCR_RELEASE_RISC);
+
+	/* Workaround for QLA2312 PCI parity error */
+	if (IS_QLA2312(ha) || IS_QLA2322(ha))
+		udelay(10);
+	else {
+		data = qla2x00_debounce_register(MAILBOX_REG(ha, reg, 0));
+		for (cnt = 6000000; cnt && (data == MBS_BUSY); cnt--) {
+			udelay(5);
+			data = RD_MAILBOX_REG(ha, reg, 0);
+			barrier(); 
+		}
+	}
+
+	if (!cnt)
+		goto chip_diag_failed;
+
+	/* Check product ID of chip */
+	DEBUG3(printk("scsi(%ld): Checking product ID of chip\n", ha->host_no));
+
+	mb[1] = RD_MAILBOX_REG(ha, reg, 1);
+	mb[2] = RD_MAILBOX_REG(ha, reg, 2);
+	mb[3] = RD_MAILBOX_REG(ha, reg, 3);
+
+	if (mb[1] != PROD_ID_1 || (mb[2] != PROD_ID_2 && mb[2] != PROD_ID_2a) ||
+	    mb[3] != PROD_ID_3) {
+		qla_printk(KERN_WARNING, ha,
+		    "Wrong product ID = 0x%x,0x%x,0x%x\n", mb[1], mb[2], mb[3]);
+
+		goto chip_diag_failed;
+	}
+
+	/* Adjust fw RISC transfer size */
+	ha->fw_transfer_size = REQUEST_ENTRY_SIZE * REQUEST_ENTRY_CNT;
+
+	if (IS_QLA2200(ha) &&
+	    RD_MAILBOX_REG(ha, reg, 7) == QLA2200A_RISC_ROM_VER) {
+		/* Limit firmware transfer size with a 2200A */
+		DEBUG3(printk("scsi(%ld): Found QLA2200A chip.\n",
+		    ha->host_no));
+
+		ha->fw_transfer_size = 128;
+	}
+
+	/* Wrap Incoming Mailboxes Test. */
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+	DEBUG3(printk("scsi(%ld): Checking mailboxes.\n", ha->host_no));
+	rval = qla2x00_mbx_reg_test(ha);
+	if (rval) {
+		DEBUG(printk("scsi(%ld): Failed mailbox send register test\n",
+		    ha->host_no));
+		qla_printk(KERN_WARNING, ha,
+		    "Failed mailbox send register test\n");
+	}
+	else {
+		/* Flag a successful rval */
+		rval = QLA_SUCCESS;
+	}
+	spin_lock_irqsave(&ha->hardware_lock, flags);
+
+chip_diag_failed:
+	if (rval)
+		DEBUG2_3(printk("scsi(%ld): Chip diagnostics **** FAILED "
+		    "****\n", ha->host_no));
+
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+	return (rval);
+}
+
+/**
+ * qla2x00_setup_chip() - Load and start RISC firmware.
+ * @ha: HA context
+ *
+ * Returns 0 on success.
+ */
+static int
+qla2x00_setup_chip(scsi_qla_host_t *ha)
+{
+	int		rval;
+	uint16_t	cnt;
+	uint16_t	*risc_code;
+	unsigned long	risc_address;
+	unsigned long	risc_code_size;
+	int		num;
+	int		i;
+	uint16_t	*req_ring;
+	struct qla_fw_info *fw_iter;
+
+	rval = QLA_SUCCESS;
+
+	/* Load firmware sequences */
+	fw_iter = ha->brd_info->fw_info;
+	while (fw_iter->addressing != FW_INFO_ADDR_NOMORE) {
+		risc_code = fw_iter->fwcode;
+		risc_code_size = *fw_iter->fwlen;
+
+		if (fw_iter->addressing == FW_INFO_ADDR_NORMAL) {
+			risc_address = *fw_iter->fwstart;
+		} else {
+			/* Extended address */
+			risc_address = *fw_iter->lfwstart;
+		}
+
+		num = 0;
+		rval = 0;
+		while (risc_code_size > 0 && !rval) {
+			cnt = (uint16_t)(ha->fw_transfer_size >> 1);
+			if (cnt > risc_code_size)
+				cnt = risc_code_size;
+
+			DEBUG7(printk("scsi(%ld): Loading risc segment@ "
+			    "addr %p, number of bytes 0x%x, offset 0x%lx.\n",
+			    ha->host_no, risc_code, cnt, risc_address));
+
+			req_ring = (uint16_t *)ha->request_ring;
+			for (i = 0; i < cnt; i++)
+				req_ring[i] = cpu_to_le16(risc_code[i]);
+
+			/*
+			 * Flush written firmware to the ha->request_ring buffer
+			 * before DMA.
+			 */
+			flush_cache_all();
+
+			if (fw_iter->addressing == FW_INFO_ADDR_NORMAL) {
+				rval = qla2x00_load_ram(ha,
+				    ha->request_dma, risc_address, cnt);
+			} else {
+				rval = qla2x00_load_ram_ext(ha,
+				    ha->request_dma, risc_address, cnt);
+			}
+			if (rval) {
+				DEBUG(printk("scsi(%ld): [ERROR] Failed to "
+				    "load segment %d of firmware\n",
+				    ha->host_no, num));
+				qla_printk(KERN_WARNING, ha,
+				    "[ERROR] Failed to load "
+				    "segment %d of firmware\n", num);
+
+				qla2x00_dump_regs(ha);
+				break;
+			}
+
+			risc_code += cnt;
+			risc_address += cnt;
+			risc_code_size -= cnt;
+			num++;
+		}
+
+		/* Next firmware sequence */
+		fw_iter++;
+	}
+
+	/* Verify checksum of loaded RISC code. */
+	if (!rval) {
+		DEBUG(printk("scsi(%ld): Verifying Checksum of loaded RISC "
+		    "code.\n", ha->host_no));
+
+		rval = qla2x00_verify_checksum(ha);
+		if (rval == QLA_SUCCESS) {
+			/* Start firmware execution. */
+			DEBUG(printk("scsi(%ld): Checksum OK, start "
+			    "firmware.\n", ha->host_no));
+
+			rval = qla2x00_execute_fw(ha);
+		}
+		else {
+			DEBUG2(printk(KERN_INFO
+			    "scsi(%ld): ISP Firmware failed checksum.\n",
+			    ha->host_no));
+		}
+	}
+
+	if (rval) {
+		DEBUG2_3(printk("scsi(%ld): Setup chip **** FAILED ****.\n",
+		    ha->host_no));
+	}
+
+	return (rval);
+}
+
+/**
+ * qla2x00_init_response_q_entries() - Initializes response queue entries.
+ * @ha: HA context
+ *
+ * Beginning of request ring has initialization control block already built
+ * by nvram config routine.
+ *
+ * Returns 0 on success.
+ */
+static void
+qla2x00_init_response_q_entries(scsi_qla_host_t *ha)
+{
+	uint16_t cnt;
+	response_t *pkt;
+
+	pkt = ha->response_ring_ptr;
+	for (cnt = 0; cnt < ha->response_q_length; cnt++) {
+		pkt->signature = RESPONSE_PROCESSED;
+		pkt++;
+	}
+
+}
+
+/**
+ * qla2x00_init_rings() - Initializes firmware.
+ * @ha: HA context
+ *
+ * Beginning of request ring has initialization control block already built
+ * by nvram config routine.
+ *
+ * Returns 0 on success.
+ */
+static int
+qla2x00_init_rings(scsi_qla_host_t *ha)
+{
+	int	rval;
+	unsigned long flags = 0;
+	int cnt;
+	device_reg_t *reg = ha->iobase;
+
+	spin_lock_irqsave(&ha->hardware_lock, flags);
+
+	/* Clear outstanding commands array. */
+	for (cnt = 0; cnt < MAX_OUTSTANDING_COMMANDS; cnt++)
+		ha->outstanding_cmds[cnt] = 0;
+
+	ha->current_outstanding_cmd = 0;
+
+	/* Clear RSCN queue. */
+	ha->rscn_in_ptr = 0;
+	ha->rscn_out_ptr = 0;
+
+	/* Initialize firmware. */
+	ha->request_ring_ptr  = ha->request_ring;
+	ha->req_ring_index    = 0;
+	ha->req_q_cnt         = REQUEST_ENTRY_CNT;
+	ha->response_ring_ptr = ha->response_ring;
+	ha->rsp_ring_index    = 0;
+
+	/* Initialize response queue entries */
+	qla2x00_init_response_q_entries(ha);
+
+ 	WRT_REG_WORD(ISP_REQ_Q_IN(ha, reg), 0);
+ 	WRT_REG_WORD(ISP_REQ_Q_OUT(ha, reg), 0);
+ 	WRT_REG_WORD(ISP_RSP_Q_IN(ha, reg), 0);
+ 	WRT_REG_WORD(ISP_RSP_Q_OUT(ha, reg), 0);
+	RD_REG_WORD(ISP_RSP_Q_OUT(ha, reg));
+
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+	DEBUG(printk("scsi(%ld): Issue init firmware.\n", ha->host_no));
+	rval = qla2x00_init_firmware(ha, sizeof(init_cb_t));
+	if (rval) {
+		DEBUG2_3(printk("scsi(%ld): Init firmware **** FAILED ****.\n",
+		    ha->host_no));
+	} else {
+		/* Setup seriallink options */
+		uint16_t swing, emphasis;
+
+		DEBUG3(printk("scsi(%ld): Serial link options:\n",
+		    ha->host_no));
+		DEBUG3(qla2x00_dump_buffer(
+		    (uint8_t *)&ha->fw_seriallink_options,
+		    sizeof(ha->fw_seriallink_options)));
+
+		memset(ha->fw_options, 0, sizeof(ha->fw_options));
+		qla2x00_get_fw_options(ha, ha->fw_options);
+
+		ha->fw_options[1] &= ~FO1_SET_EMPHASIS_SWING;
+		if (ha->fw_seriallink_options[1] & BIT_2)
+			ha->fw_options[1] |= FO1_SET_EMPHASIS_SWING;
+
+		/* 1G settings */
+		swing = ha->fw_seriallink_options[0] & (BIT_2 | BIT_1 | BIT_0);
+		emphasis = ha->fw_seriallink_options[0] & (BIT_4 | BIT_3);
+		emphasis >>= 3;
+		ha->fw_options[10] = (emphasis << 14) | (swing << 8) | 0x3;
+
+		/* 2G settings */
+		swing = ha->fw_seriallink_options[0] & (BIT_7 | BIT_6 | BIT_5);
+		swing >>= 5;
+		emphasis = ha->fw_seriallink_options[1] & (BIT_1 | BIT_0);
+		ha->fw_options[11] = (emphasis << 14) | (swing << 8) | 0x3;
+
+		qla2x00_set_fw_options(ha, ha->fw_options);
+
+		DEBUG3(printk("scsi(%ld): Init firmware -- success.\n",
+		    ha->host_no));
+	}
+
+	return (rval);
+}
+
+/**
+ * qla2x00_fw_ready() - Waits for firmware ready.
+ * @ha: HA context
+ *
+ * Returns 0 on success.
+ */
+static int
+qla2x00_fw_ready(scsi_qla_host_t *ha)
+{
+	int		rval;
+	unsigned long	wtime, mtime;
+	uint16_t	min_wait;	/* Minimum wait time if loop is down */
+	uint16_t	wait_time;	/* Wait time if loop is coming ready */
+	uint16_t	fw_state;
+
+	rval = QLA_SUCCESS;
+
+	/* 20 seconds for loop down. */
+	min_wait = 20;		
+
+	/*
+	 * Firmware should take at most one RATOV to login, plus 5 seconds for
+	 * our own processing.
+	 */
+	if ((wait_time = (ha->retry_count*ha->login_timeout) + 5) < min_wait) {
+		wait_time = min_wait;
+	}
+
+	/* Min wait time if loop down */
+	mtime = jiffies + (min_wait * HZ);
+
+	/* wait time before firmware ready */
+	wtime = jiffies + (wait_time * HZ);
+
+	/* Wait for ISP to finish LIP */
+	if (!ha->flags.init_done)
+ 		qla_printk(KERN_INFO, ha, "Waiting for LIP to complete...\n");
+
+	DEBUG3(printk("scsi(%ld): Waiting for LIP to complete...\n",
+	    ha->host_no));
+
+	do {
+		rval = qla2x00_get_firmware_state(ha, &fw_state);
+		if (rval == QLA_SUCCESS) {
+			if (fw_state < FSTATE_LOSS_OF_SYNC) {
+				ha->device_flags &= ~DFLG_NO_CABLE;
+			}
+			if (fw_state == FSTATE_READY) {
+				DEBUG(printk("scsi(%ld): F/W Ready - OK \n",
+				    ha->host_no));
+
+				qla2x00_get_retry_cnt(ha, &ha->retry_count,
+				    &ha->login_timeout, &ha->r_a_tov);
+
+				rval = QLA_SUCCESS;
+				break;
+			}
+
+			rval = QLA_FUNCTION_FAILED;
+
+			if (atomic_read(&ha->loop_down_timer) &&
+			    fw_state >= FSTATE_LOSS_OF_SYNC) {
+				/* Loop down. Timeout on min_wait for states
+				 * other than Wait for Login. 
+				 */	
+				if (time_after_eq(jiffies, mtime)) {
+					qla_printk(KERN_INFO, ha,
+					    "Cable is unplugged...\n");
+
+					ha->device_flags |= DFLG_NO_CABLE;
+					break;
+				}
+			}
+		} else {
+			/* Mailbox cmd failed. Timeout on min_wait. */
+			if (time_after_eq(jiffies, mtime))
+				break;
+		}
+
+		if (time_after_eq(jiffies, wtime))
+			break;
+
+		/* Delay for a while */
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(HZ / 2);
+
+		DEBUG3(printk("scsi(%ld): fw_state=%x curr time=%lx.\n",
+		    ha->host_no, fw_state, jiffies));
+	} while (1);
+
+	DEBUG(printk("scsi(%ld): fw_state=%x curr time=%lx.\n",
+	    ha->host_no, fw_state, jiffies));
+
+	if (rval) {
+		DEBUG2_3(printk("scsi(%ld): Firmware ready **** FAILED ****.\n",
+		    ha->host_no));
+	}
+
+	return (rval);
+}
+
+/*
+*  qla2x00_configure_hba
+*      Setup adapter context.
+*
+* Input:
+*      ha = adapter state pointer.
+*
+* Returns:
+*      0 = success
+*
+* Context:
+*      Kernel context.
+*/
+static int
+qla2x00_configure_hba(scsi_qla_host_t *ha)
+{
+	int       rval;
+	uint16_t      loop_id;
+	uint16_t      topo;
+	uint8_t       al_pa;
+	uint8_t       area;
+	uint8_t       domain;
+	char		connect_type[22];
+
+	/* Get host addresses. */
+	rval = qla2x00_get_adapter_id(ha,
+	    &loop_id, &al_pa, &area, &domain, &topo);
+	if (rval != QLA_SUCCESS) {
+		qla_printk(KERN_WARNING, ha,
+		    "ERROR -- Unable to get host loop ID.\n");
+		return (rval);
+	}
+
+	if (topo == 4) {
+		qla_printk(KERN_INFO, ha,
+			"Cannot get topology - retrying.\n");
+		return (QLA_FUNCTION_FAILED);
+	}
+
+	ha->loop_id = loop_id;
+
+	/* Make sure 2100 only has loop, in case of any firmware bug. */
+	if (IS_QLA2100(ha))
+		topo = 0;
+
+	/* initialize */
+	ha->min_external_loopid = SNS_FIRST_LOOP_ID;
+	ha->operating_mode = LOOP;
+
+	switch (topo) {
+	case 0:
+		DEBUG3(printk("scsi(%ld): HBA in NL topology.\n",
+		    ha->host_no));
+		ha->current_topology = ISP_CFG_NL;
+		strcpy(connect_type, "(Loop)");
+		break;
+
+	case 1:
+		DEBUG3(printk("scsi(%ld): HBA in FL topology.\n",
+		    ha->host_no));
+		ha->current_topology = ISP_CFG_FL;
+		strcpy(connect_type, "(FL_Port)");
+		break;
+
+	case 2:
+		DEBUG3(printk("scsi(%ld): HBA in N P2P topology.\n",
+		    ha->host_no));
+		ha->operating_mode = P2P;
+		ha->current_topology = ISP_CFG_N;
+		strcpy(connect_type, "(N_Port-to-N_Port)");
+		break;
+
+	case 3:
+		DEBUG3(printk("scsi(%ld): HBA in F P2P topology.\n",
+		    ha->host_no));
+		ha->operating_mode = P2P;
+		ha->current_topology = ISP_CFG_F;
+		strcpy(connect_type, "(F_Port)");
+		break;
+
+	default:
+		DEBUG3(printk("scsi(%ld): HBA in unknown topology %x. "
+		    "Using NL.\n",
+		    ha->host_no, topo));
+		ha->current_topology = ISP_CFG_NL;
+		strcpy(connect_type, "(Loop)");
+		break;
+	}
+
+	/* Save Host port and loop ID. */
+	/* byte order - Big Endian */
+	ha->d_id.b.domain = domain;
+	ha->d_id.b.area = area;
+	ha->d_id.b.al_pa = al_pa;
+
+	if (!ha->flags.init_done)
+ 		qla_printk(KERN_INFO, ha,
+		    "Topology - %s, Host Loop address 0x%x\n",
+ 		    connect_type, ha->loop_id);
+
+	if (rval) {
+		DEBUG2_3(printk("scsi(%ld): FAILED.\n", ha->host_no));
+	} else {
+		DEBUG3(printk("scsi(%ld): exiting normally.\n", ha->host_no));
+	}
+
+	return(rval);
+}
+
+/*
+* NVRAM configuration for ISP 2xxx
+*
+* Input:
+*      ha                = adapter block pointer.
+*
+* Output:
+*      initialization control block in response_ring
+*      host adapters parameters in host adapter block
+*
+* Returns:
+*      0 = success.
+*/
+static int
+qla2x00_nvram_config(scsi_qla_host_t *ha)
+{
+	int   rval;
+	uint8_t   chksum = 0;
+	uint16_t  cnt;
+	uint8_t   *dptr1, *dptr2;
+	init_cb_t *icb   = ha->init_cb;
+	nvram_t *nv    = (nvram_t *)ha->request_ring;
+	uint16_t  *wptr  = (uint16_t *)ha->request_ring;
+	device_reg_t *reg = ha->iobase;
+	uint16_t  timer_mode;
+
+	rval = QLA_SUCCESS;
+
+	if (ha->flags.init_done)
+		return (rval);
+
+	/* Determine NVRAM starting address. */
+	ha->nvram_base = 0;
+	if (IS_QLA2312(ha) || IS_QLA2322(ha))
+		if ((RD_REG_WORD(&reg->ctrl_status) >> 14) == 1)
+			ha->nvram_base = 0x80;
+
+	/* Get NVRAM data and calculate checksum. */
+	qla2x00_lock_nvram_access(ha);
+	for (cnt = 0; cnt < sizeof(nvram_t)/2; cnt++) {
+		*wptr = cpu_to_le16(qla2x00_get_nvram_word(ha,
+		    (cnt+ha->nvram_base)));
+		chksum += (uint8_t)*wptr;
+		chksum += (uint8_t)(*wptr >> 8);
+		wptr++;
+	}
+	qla2x00_unlock_nvram_access(ha);
+
+	DEBUG5(printk("scsi(%ld): Contents of NVRAM\n", ha->host_no));
+	DEBUG5(qla2x00_dump_buffer((uint8_t *)ha->request_ring,
+	    sizeof(nvram_t)));
+
+	/* Bad NVRAM data, set defaults parameters. */
+	if (chksum || nv->id[0] != 'I' || nv->id[1] != 'S' ||
+	    nv->id[2] != 'P' || nv->id[3] != ' ' || nv->nvram_version < 1) {
+		/* Reset NVRAM data. */
+		qla_printk(KERN_WARNING, ha, "Inconsistent NVRAM detected: "
+		    "checksum=0x%x id=%c version=0x%x.\n", chksum, nv->id[0],
+		    nv->nvram_version);
+		qla_printk(KERN_WARNING, ha, "Falling back to functioning (yet "
+		    "invalid -- WWPN) defaults.\n");
+
+		/*
+		 * Set default initialization control block.
+		 */
+		memset(nv, 0, sizeof(nvram_t));
+		nv->parameter_block_version = ICB_VERSION;
+
+		if (IS_QLA23XX(ha)) {
+			nv->firmware_options[0] = BIT_2 | BIT_1;
+			nv->firmware_options[1] = BIT_7 | BIT_5;
+			nv->add_firmware_options[0] = BIT_5;
+			nv->add_firmware_options[1] = BIT_5 | BIT_4;
+			nv->frame_payload_size = __constant_cpu_to_le16(2048);
+			nv->special_options[1] = BIT_7;
+		} else if (IS_QLA2200(ha)) {
+			nv->firmware_options[0] = BIT_2 | BIT_1;
+			nv->firmware_options[1] = BIT_7 | BIT_5;
+			nv->add_firmware_options[0] = BIT_5 | BIT_4;
+			nv->add_firmware_options[1] = BIT_5 | BIT_4;
+			nv->frame_payload_size = __constant_cpu_to_le16(1024);
+		} else if (IS_QLA2100(ha)) {
+			nv->firmware_options[0] = BIT_3 | BIT_1;
+			nv->firmware_options[1] = BIT_5;
+			nv->frame_payload_size = __constant_cpu_to_le16(1024);
+		}
+
+		nv->max_iocb_allocation = __constant_cpu_to_le16(256);
+		nv->execution_throttle = __constant_cpu_to_le16(16);
+		nv->retry_count = 8;
+		nv->retry_delay = 1;
+
+		nv->port_name[0] = 33;
+		nv->port_name[3] = 224;
+		nv->port_name[4] = 139;
+
+		nv->login_timeout = 4;
+
+		/*
+		 * Set default host adapter parameters
+		 */
+		nv->host_p[1] = BIT_2;
+		nv->reset_delay = 5;
+		nv->port_down_retry_count = 8;
+		nv->max_luns_per_target = __constant_cpu_to_le16(8);
+		nv->link_down_timeout = 60;
+
+		rval = 1;
+	}
+
+#if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_SGI_SN2)
+	/*
+	 * The SN2 does not provide BIOS emulation which means you can't change
+	 * potentially bogus BIOS settings. Force the use of default settings
+	 * for link rate and frame size.  Hope that the rest of the settings
+	 * are valid.
+	 */
+	if (ia64_platform_is("sn2")) {
+		nv->frame_payload_size = __constant_cpu_to_le16(2048);
+		if (IS_QLA23XX(ha))
+			nv->special_options[1] = BIT_7;
+	}
+#endif
+
+	/* Reset Initialization control block */
+	memset(icb, 0, sizeof(init_cb_t));
+
+	/*
+	 * Setup driver NVRAM options.
+	 */
+	nv->firmware_options[0] |= (BIT_6 | BIT_1);
+	nv->firmware_options[0] &= ~(BIT_5 | BIT_4);
+	nv->firmware_options[1] |= (BIT_5 | BIT_0);
+	nv->firmware_options[1] &= ~BIT_4;
+
+	if (IS_QLA23XX(ha)) {
+		nv->firmware_options[0] |= BIT_2;
+		nv->firmware_options[0] &= ~BIT_3;
+
+		if (IS_QLA2300(ha)) {
+			if (ha->fb_rev == FPM_2310) {
+				strcpy(ha->model_number, "QLA2310");
+			} else {
+				strcpy(ha->model_number, "QLA2300");
+			}
+		} else if (IS_QLA2312(ha) || IS_QLA2322(ha)) {
+			if (rval == 0 &&
+			    memcmp(nv->model_number, BINZERO,
+				    sizeof(nv->model_number)) != 0) {
+				char *st, *en;
+
+				strncpy(ha->model_number, nv->model_number,
+				    sizeof(nv->model_number));
+				st = en = ha->model_number;
+				en += sizeof(nv->model_number) - 1;
+				while (en > st) {
+					if (*en != 0x20)
+						break;
+					*en-- = '\0';
+				}
+			} else {
+				uint16_t        index;
+
+				index = (ha->pdev->subsystem_device & 0xff);
+				if (index < QLA_MODEL_NAMES) {
+					strcpy(ha->model_number,
+					    qla2x00_model_name[index]);
+					ha->model_desc =
+					    qla2x00_model_desc[index];
+				} else {
+					strcpy(ha->model_number, "QLA23xx");
+				}
+			}
+		} else {
+			strcpy(ha->model_number, "QLA23xx");
+		}
+	} else if (IS_QLA2200(ha)) {
+		nv->firmware_options[0] |= BIT_2;
+		strcpy(ha->model_number, "QLA22xx");
+	} else /*if (IS_QLA2100(ha))*/ {
+		strcpy(ha->model_number, "QLA2100");
+	}
+
+	/*
+	 * Copy over NVRAM RISC parameter block to initialization control block.
+	 */
+	dptr1 = (uint8_t *)icb;
+	dptr2 = (uint8_t *)&nv->parameter_block_version;
+	cnt = (uint8_t *)&icb->request_q_outpointer - (uint8_t *)&icb->version;
+	while (cnt--)
+		*dptr1++ = *dptr2++;
+
+	/* Copy 2nd half. */
+	dptr1 = (uint8_t *)icb->add_firmware_options;
+	cnt = (uint8_t *)icb->reserved_3 - (uint8_t *)icb->add_firmware_options;
+	while (cnt--)
+		*dptr1++ = *dptr2++;
+
+	/* Prepare nodename */
+	if ((icb->firmware_options[1] & BIT_6) == 0) {
+		/*
+		 * Firmware will apply the following mask if the nodename was
+		 * not provided.
+		 */
+		memcpy(icb->node_name, icb->port_name, WWN_SIZE);
+		icb->node_name[0] &= 0xF0;
+	}
+
+	/*
+	 * Set host adapter parameters.
+	 */
+	ha->nvram_version = nv->nvram_version;
+
+	ha->flags.disable_risc_code_load = ((nv->host_p[0] & BIT_4) ? 1 : 0);
+	ha->flags.enable_lip_reset = ((nv->host_p[1] & BIT_1) ? 1 : 0);
+	ha->flags.enable_lip_full_login = ((nv->host_p[1] & BIT_2) ? 1 : 0);
+	ha->flags.enable_target_reset = ((nv->host_p[1] & BIT_3) ? 1 : 0);
+
+	ha->operating_mode =
+	    (icb->add_firmware_options[0] & (BIT_6 | BIT_5 | BIT_4)) >> 4;
+
+	ha->fw_seriallink_options[0] = nv->seriallink_options[0];
+	ha->fw_seriallink_options[1] = nv->seriallink_options[1];
+
+	/* save HBA serial number */
+	ha->serial0 = icb->port_name[5];
+	ha->serial1 = icb->port_name[6];
+	ha->serial2 = icb->port_name[7];
+	memcpy(ha->node_name, icb->node_name, WWN_SIZE);
+
+	icb->execution_throttle = __constant_cpu_to_le16(0xFFFF);
+
+	ha->retry_count = nv->retry_count;
+
+	/* Set minimum login_timeout to 4 seconds. */
+	if (nv->login_timeout < ql2xlogintimeout)
+		nv->login_timeout = ql2xlogintimeout;
+	if (nv->login_timeout < 4)
+		nv->login_timeout = 4;
+	ha->login_timeout = nv->login_timeout;
+	icb->login_timeout = nv->login_timeout;
+
+	/* Set minimum RATOV to 200 tenths of a second. */
+	ha->r_a_tov = 200;
+
+/* FIXME
+ *
+ * port_down_retry_count updated twice
+ *
+ */
+	ha->port_down_retry_count = nv->port_down_retry_count;
+	ha->minimum_timeout =
+	    (ha->login_timeout * ha->retry_count) + ha->port_down_retry_count;
+	ha->loop_reset_delay = nv->reset_delay;
+
+	/* Will get the value from NVRAM. */
+	ha->loop_down_timeout = LOOP_DOWN_TIMEOUT;
+
+	/* Link Down Timeout = 0:
+	 *
+	 * 	When Port Down timer expires we will start returning
+	 *	I/O's to OS with "DID_NO_CONNECT".
+	 *
+	 * Link Down Timeout != 0:
+	 *
+	 *	 The driver waits for the link to come up after link down
+	 *	 before returning I/Os to OS with "DID_NO_CONNECT".
+	 */						
+	if (nv->link_down_timeout == 0) {
+		ha->loop_down_abort_time =
+		    (LOOP_DOWN_TIME - ha->loop_down_timeout);
+	} else {
+		ha->link_down_timeout =	 nv->link_down_timeout;
+		ha->loop_down_abort_time =
+		    (LOOP_DOWN_TIME - ha->link_down_timeout);
+	} 
+
+	ha->max_probe_luns = le16_to_cpu(nv->max_luns_per_target);
+	if (ha->max_probe_luns == 0)
+		ha->max_probe_luns = MIN_LUNS;
+
+#if USE_BIOS_MAX_LUNS
+	ha->max_luns = le16_to_cpu(nv->max_luns_per_target);
+	if (ha->max_luns == 0)
+		ha->max_luns = MAX_LUNS;
+	else if (ha->max_luns > MAX_LUNS)
+		ha->max_luns = MAX_LUNS;
+#else
+	ha->max_luns = MAX_LUNS;
+#endif
+
+/* FIXME
+ *
+ * port_down_retry_count updated twice
+ *
+ */
+	/*
+	 * Need enough time to try and get the port back.
+	 */
+	if (qlport_down_retry)
+		ha->port_down_retry_count = qlport_down_retry;
+	/* Set login_retry_count */
+	ha->login_retry_count  = nv->retry_count;
+	if (ha->port_down_retry_count == nv->port_down_retry_count &&
+	    ha->port_down_retry_count > 3)
+		ha->login_retry_count = ha->port_down_retry_count;
+	else if (ha->port_down_retry_count > (int)ha->login_retry_count)
+		ha->login_retry_count = ha->port_down_retry_count;
+
+	ha->binding_type = Bind;
+	if (ha->binding_type != BIND_BY_PORT_NAME &&
+	    ha->binding_type != BIND_BY_PORT_ID) {
+		qla_printk(KERN_WARNING, ha,
+		    "Invalid binding type specified (%d), "
+		    "defaulting to BIND_BY_PORT_NAME!!!\n", ha->binding_type);
+
+		ha->binding_type = BIND_BY_PORT_NAME;
+	}
+
+	/*
+	 * Setup ring parameters in initialization control block
+	 */
+	icb->request_q_outpointer = __constant_cpu_to_le16(0);
+	icb->response_q_inpointer = __constant_cpu_to_le16(0);
+	icb->request_q_length = __constant_cpu_to_le16(REQUEST_ENTRY_CNT);
+	icb->response_q_length = cpu_to_le16(ha->response_q_length);
+	icb->request_q_address[0] = cpu_to_le32(LSD(ha->request_dma));
+	icb->request_q_address[1] = cpu_to_le32(MSD(ha->request_dma));
+	icb->response_q_address[0] = cpu_to_le32(LSD(ha->response_dma));
+	icb->response_q_address[1] = cpu_to_le32(MSD(ha->response_dma));
+
+	icb->lun_enables = __constant_cpu_to_le16(0);
+	icb->command_resource_count = 0;
+	icb->immediate_notify_resource_count = 0;
+	icb->timeout = __constant_cpu_to_le16(0);
+
+	if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
+		/* Enable RIO */
+		icb->firmware_options[0] &= ~BIT_3;
+		icb->add_firmware_options[0] &=
+		    ~(BIT_3 | BIT_2 | BIT_1 | BIT_0);
+		icb->add_firmware_options[0] |= (BIT_1 | BIT_0);
+		icb->response_accumulation_timer = 3;
+		icb->interrupt_delay_timer = 5;
+
+		ha->flags.process_response_queue = 1;
+	} else {
+		/* TEST ZIO:
+		 *
+		 * icb->add_firmware_options[0] &=
+		 *    ~(BIT_3 | BIT_2 | BIT_1 | BIT_0);
+		 * icb->add_firmware_options[0] |= (BIT_2 | BIT_0);
+		 */
+		timer_mode  = icb->add_firmware_options[0] &
+		    (BIT_3 | BIT_2 | BIT_1 | BIT_0);
+		if (timer_mode == 5) {
+			DEBUG2(printk("scsi(%ld): ZIO enabled; timer delay "
+			    "(%d).\n", ha->host_no, ql2xintrdelaytimer));
+			qla_printk(KERN_INFO, ha,
+			    "ZIO enabled; timer delay (%d).\n",
+			    ql2xintrdelaytimer);
+
+			icb->interrupt_delay_timer = ql2xintrdelaytimer;
+	
+			ha->flags.process_response_queue = 1;
+		}
+	}
+
+	if (rval) {
+		DEBUG2_3(printk(KERN_WARNING
+		    "scsi(%ld): NVRAM configuration failed!\n", ha->host_no));
+	}
+
+	LEAVE(__func__);
+
+	return (rval);
+}
+
+/*
+* qla2x00_init_tgt_map
+*      Initializes target map.
+*
+* Input:
+*      ha = adapter block pointer.
+*
+* Output:
+*      TGT_Q initialized
+*/
+static void
+qla2x00_init_tgt_map(scsi_qla_host_t *ha)
+{
+	uint32_t t;
+
+	ENTER(__func__);
+
+	for (t = 0; t < MAX_TARGETS; t++)
+		TGT_Q(ha, t) = (os_tgt_t *)NULL;
+
+	LEAVE(__func__);
+}
+
+/**
+ * qla2x00_alloc_fcport() - Allocate a generic fcport.
+ * @ha: HA context
+ * @flags: allocation flags
+ *
+ * Returns a pointer to the allocated fcport, or NULL, if none available.
+ */
+fc_port_t *
+qla2x00_alloc_fcport(scsi_qla_host_t *ha, int flags)
+{
+	fc_port_t *fcport;
+
+	fcport = kmalloc(sizeof(fc_port_t), flags);
+	if (fcport == NULL)
+		return (fcport);
+
+	/* Setup fcport template structure. */
+	memset(fcport, 0, sizeof (fc_port_t));
+	fcport->ha = ha;
+	fcport->port_type = FCT_UNKNOWN;
+	fcport->loop_id = FC_NO_LOOP_ID;
+	fcport->iodesc_idx_sent = IODESC_INVALID_INDEX;
+	atomic_set(&fcport->state, FCS_UNCONFIGURED);
+	fcport->flags = FCF_RLC_SUPPORT;
+	INIT_LIST_HEAD(&fcport->fcluns);
+
+	return (fcport);
+}
+
+/*
+ * qla2x00_configure_loop
+ *      Updates Fibre Channel Device Database with what is actually on loop.
+ *
+ * Input:
+ *      ha                = adapter block pointer.
+ *
+ * Returns:
+ *      0 = success.
+ *      1 = error.
+ *      2 = database was full and device was not configured.
+ */
+static int
+qla2x00_configure_loop(scsi_qla_host_t *ha) 
+{
+	int  rval;
+	uint8_t  rval1 = 0;
+	static unsigned long  flags, save_flags;
+
+	rval = QLA_SUCCESS;
+
+	/* Get Initiator ID */
+	if (qla2x00_configure_hba(ha)) {
+		DEBUG(printk("scsi(%ld): Unable to configure HBA.\n",
+		    ha->host_no));
+		return (QLA_FUNCTION_FAILED);
+	}
+
+	save_flags = flags = ha->dpc_flags;
+	DEBUG(printk("scsi(%ld): Configure loop -- dpc flags =0x%lx\n",
+	    ha->host_no, flags));
+
+	/* dg 02/26/02 ha->dpc_flags &= ~(LOCAL_LOOP_UPDATE | RSCN_UPDATE); */
+
+	/*
+	 * If we have both an RSCN and PORT UPDATE pending then handle them
+	 * both at the same time.
+	 */
+	clear_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags);
+	clear_bit(RSCN_UPDATE, &ha->dpc_flags);
+	ha->mem_err = 0 ;
+
+	/* Determine what we need to do */
+	if (ha->current_topology == ISP_CFG_FL &&
+	    (test_bit(LOCAL_LOOP_UPDATE, &flags))) {
+
+		ha->flags.rscn_queue_overflow = TRUE;
+		set_bit(RSCN_UPDATE, &flags);
+
+	} else if (ha->current_topology == ISP_CFG_F &&
+	    (test_bit(LOCAL_LOOP_UPDATE, &flags))) {
+
+		ha->flags.rscn_queue_overflow = TRUE;
+		set_bit(RSCN_UPDATE, &flags);
+		clear_bit(LOCAL_LOOP_UPDATE, &flags);
+
+	} else if (!ha->flags.online ||
+	    (test_bit(ABORT_ISP_ACTIVE, &flags))) {
+
+		ha->flags.rscn_queue_overflow = TRUE;
+		set_bit(RSCN_UPDATE, &flags);
+		set_bit(LOCAL_LOOP_UPDATE, &flags);
+	}
+
+	do {
+		if (test_bit(LOCAL_LOOP_UPDATE, &flags)) {
+			rval = rval | qla2x00_configure_local_loop(ha);
+		}
+
+		if (test_bit(RSCN_UPDATE, &flags)) {
+			rval1 = qla2x00_configure_fabric(ha);
+			if ((rval1 & BIT_0) && ha->sns_retry_cnt < 8) {
+				ha->sns_retry_cnt++;
+				set_bit(LOGIN_RETRY_NEEDED, &ha->dpc_flags);
+			}
+		}
+
+		/* Isolate error status. */
+		if (rval & BIT_0) {
+			rval = 1;
+		} else {
+			rval = QLA_SUCCESS;
+		}
+
+	} while (rval != QLA_SUCCESS);
+
+	if (!atomic_read(&ha->loop_down_timer) &&
+	    !(test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags))) {
+
+		qla2x00_config_os(ha);
+
+		/* If we found all devices then go ready */
+		if (!(test_bit(LOGIN_RETRY_NEEDED, &ha->dpc_flags))) {
+			atomic_set(&ha->loop_state, LOOP_READY);
+
+			DEBUG(printk("scsi(%ld): LOOP READY\n", ha->host_no));
+		} else {
+			if (test_bit(LOCAL_LOOP_UPDATE, &save_flags))
+				set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags);
+			if (test_bit(RSCN_UPDATE, &save_flags))
+				set_bit(RSCN_UPDATE, &ha->dpc_flags);
+		}
+	} else {
+		DEBUG(printk("scsi(%ld): Loop down counter running= %d or "
+		    "Resync needed- dpc flags= %ld\n",
+		    ha->host_no,
+		    atomic_read(&ha->loop_down_timer), ha->dpc_flags));
+		/* ???? dg 02/26/02  rval = 1; */
+	}
+
+	if (rval) {
+		DEBUG2_3(printk("%s(%ld): *** FAILED ***\n",
+		    __func__, ha->host_no));
+	} else {
+		DEBUG3(printk("%s: exiting normally\n", __func__));
+	}
+
+	return (rval);
+}
+
+
+
+/*
+ * qla2x00_configure_local_loop
+ *	Updates Fibre Channel Device Database with local loop devices.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *
+ * Returns:
+ *	0 = success.
+ *	BIT_0 = error.
+ */
+static int
+qla2x00_configure_local_loop(scsi_qla_host_t *ha) 
+{
+	int		rval, rval2;
+	int		found_devs;
+	int		found;
+	fc_port_t	*fcport, *new_fcport;
+
+	uint16_t	index;
+	uint16_t	entries;
+	struct dev_id {
+		uint8_t	al_pa;
+		uint8_t	area;
+		uint8_t	domain;		
+		uint8_t	loop_id_2100;	/* ISP2100/ISP2200 -- 4 bytes. */
+		uint16_t loop_id;	/* ISP23XX         -- 6 bytes. */
+	} *id_list;
+#define MAX_ID_LIST_SIZE (sizeof(struct dev_id) * MAX_FIBRE_DEVICES)
+	dma_addr_t	id_list_dma;
+	char		*id_iter;
+	uint16_t	loop_id;
+	uint8_t		domain, area, al_pa;
+
+	rval = QLA_SUCCESS;
+	found_devs = 0;
+	new_fcport = NULL;
+
+	/*
+	 * No point in continuing if the loop is in a volatile state -- 
+	 * reschedule LOCAL_LOOP_UPDATE for later processing
+	 */
+	if (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) {
+		set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags);
+		return (rval);
+	}
+
+	entries = MAX_FIBRE_DEVICES;
+	id_list = pci_alloc_consistent(ha->pdev, MAX_ID_LIST_SIZE,
+	    &id_list_dma);
+	if (id_list == NULL) {
+		DEBUG2(printk("scsi(%ld): Failed to allocate memory, No local "
+		    "loop\n", ha->host_no));
+
+		qla_printk(KERN_WARNING, ha,
+		    "Memory Allocation failed - port_list");
+
+		ha->mem_err++;
+		return (BIT_0);
+	}
+	memset(id_list, 0, MAX_ID_LIST_SIZE);
+
+	DEBUG3(printk("scsi(%ld): Getting FCAL position map\n", ha->host_no));
+	DEBUG3(qla2x00_get_fcal_position_map(ha, NULL));
+
+	/* Get list of logged in devices. */
+	rval = qla2x00_get_id_list(ha, id_list, id_list_dma, &entries);
+	if (rval) {
+		rval = BIT_0;
+		goto cleanup_allocation;
+	}
+
+	DEBUG3(printk("scsi(%ld): Entries in ID list (%d)\n",
+	    ha->host_no, entries));
+	DEBUG3(qla2x00_dump_buffer((uint8_t *)id_list,
+	    entries * sizeof(struct dev_id)));
+
+	/* Allocate temporary fcport for any new fcports discovered. */
+	new_fcport = qla2x00_alloc_fcport(ha, GFP_KERNEL);
+	if (new_fcport == NULL) {
+		rval = BIT_0;
+		goto cleanup_allocation;
+	}
+	new_fcport->flags &= ~FCF_FABRIC_DEVICE;
+
+	/*
+	 * Mark local devices that were present with FCF_DEVICE_LOST for now.
+	 */
+	list_for_each_entry(fcport, &ha->fcports, list) {
+		if (atomic_read(&fcport->state) == FCS_ONLINE &&
+		    fcport->port_type != FCT_BROADCAST &&
+		    (fcport->flags & FCF_FABRIC_DEVICE) == 0) {
+
+			DEBUG(printk("scsi(%ld): Marking port lost, "
+			    "loop_id=0x%04x\n",
+			    ha->host_no, fcport->loop_id));
+
+			atomic_set(&fcport->state, FCS_DEVICE_LOST);
+			fcport->flags &= ~FCF_FARP_DONE;
+		}
+	}
+
+	/* Add devices to port list. */
+	id_iter = (char *)id_list;
+	for (index = 0; index < entries; index++) {
+		domain = ((struct dev_id *)id_iter)->domain;
+		area = ((struct dev_id *)id_iter)->area;
+		al_pa = ((struct dev_id *)id_iter)->al_pa;
+		if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
+			loop_id =
+			    (uint16_t)((struct dev_id *)id_iter)->loop_id_2100;
+			id_iter += 4;
+		} else {
+			loop_id =
+			    le16_to_cpu(((struct dev_id *)id_iter)->loop_id);
+			id_iter += 6;
+		}
+
+		/* Bypass reserved domain fields. */
+		if ((domain & 0xf0) == 0xf0)
+			continue;
+
+		/* Bypass if not same domain and area of adapter. */
+		if (area != ha->d_id.b.area || domain != ha->d_id.b.domain)
+			continue;
+
+		/* Bypass invalid local loop ID. */
+		if (loop_id > LAST_LOCAL_LOOP_ID)
+			continue;
+
+		/* Fill in member data. */
+		new_fcport->d_id.b.domain = domain;
+		new_fcport->d_id.b.area = area;
+		new_fcport->d_id.b.al_pa = al_pa;
+		new_fcport->loop_id = loop_id;
+		rval2 = qla2x00_get_port_database(ha, new_fcport, 0);
+		if (rval2 != QLA_SUCCESS) {
+			DEBUG2(printk("scsi(%ld): Failed to retrieve fcport "
+			    "information -- get_port_database=%x, "
+			    "loop_id=0x%04x\n",
+			    ha->host_no, rval2, new_fcport->loop_id));
+			continue;
+		}
+
+		/* Check for matching device in port list. */
+		found = 0;
+		fcport = NULL;
+		list_for_each_entry(fcport, &ha->fcports, list) {
+			if (memcmp(new_fcport->port_name, fcport->port_name,
+			    WWN_SIZE))
+				continue;
+
+			fcport->flags &= ~(FCF_FABRIC_DEVICE |
+			    FCF_PERSISTENT_BOUND);
+			fcport->loop_id = new_fcport->loop_id;
+			fcport->port_type = new_fcport->port_type;
+			fcport->d_id.b24 = new_fcport->d_id.b24;
+			memcpy(fcport->node_name, new_fcport->node_name,
+			    WWN_SIZE);
+
+			found++;
+			break;
+		}
+
+		if (!found) {
+			/* New device, add to fcports list. */
+			new_fcport->flags &= ~FCF_PERSISTENT_BOUND;
+			list_add_tail(&new_fcport->list, &ha->fcports);
+
+			/* Allocate a new replacement fcport. */
+			fcport = new_fcport;
+			new_fcport = qla2x00_alloc_fcport(ha, GFP_KERNEL);
+			if (new_fcport == NULL) {
+				rval = BIT_0;
+				goto cleanup_allocation;
+			}
+			new_fcport->flags &= ~FCF_FABRIC_DEVICE;
+		}
+
+		qla2x00_update_fcport(ha, fcport);
+
+		found_devs++;
+	}
+
+cleanup_allocation:
+	pci_free_consistent(ha->pdev, MAX_ID_LIST_SIZE, id_list, id_list_dma);
+
+	if (new_fcport)
+		kfree(new_fcport);
+
+	if (rval & BIT_0) {
+		DEBUG2(printk("scsi(%ld): Configure local loop error exit: "
+		    "rval=%x\n", ha->host_no, rval));
+	}
+
+	if (found_devs) {
+		ha->device_flags |= DFLG_LOCAL_DEVICES;
+		ha->device_flags &= ~DFLG_RETRY_LOCAL_DEVICES;
+	}
+
+	return (rval);
+}
+
+/*
+ * qla2x00_update_fcport
+ *	Updates device on list.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	fcport = port structure pointer.
+ *
+ * Return:
+ *	0  - Success
+ *  BIT_0 - error
+ *
+ * Context:
+ *	Kernel context.
+ */
+static void
+qla2x00_update_fcport(scsi_qla_host_t *ha, fc_port_t *fcport)
+{
+	uint16_t	index;
+	unsigned long flags;
+	srb_t *sp;
+
+	fcport->ha = ha;
+	fcport->login_retry = 0;
+	fcport->port_login_retry_count = ha->port_down_retry_count *
+	    PORT_RETRY_TIME;
+	atomic_set(&fcport->port_down_timer, ha->port_down_retry_count *
+	    PORT_RETRY_TIME);
+	fcport->flags &= ~(FCF_LOGIN_NEEDED);
+
+	/*
+	 * Check for outstanding cmd on tape Bypass LUN discovery if active
+	 * command on tape.
+	 */
+	if (fcport->flags & FCF_TAPE_PRESENT) {
+		spin_lock_irqsave(&ha->hardware_lock, flags);
+		for (index = 1; index < MAX_OUTSTANDING_COMMANDS; index++) {
+			if ((sp = ha->outstanding_cmds[index]) != 0) {
+				if (sp->fclun->fcport == fcport) {
+					atomic_set(&fcport->state, FCS_ONLINE);
+					spin_unlock_irqrestore(
+					    &ha->hardware_lock, flags);
+					return;
+				}
+			}
+		}
+		spin_unlock_irqrestore(&ha->hardware_lock, flags);
+	}
+
+	/* Do LUN discovery. */
+	if (fcport->port_type == FCT_INITIATOR ||
+	    fcport->port_type == FCT_BROADCAST) {
+		fcport->device_type = TYPE_PROCESSOR;
+	} else {
+		qla2x00_lun_discovery(ha, fcport);
+	}
+	atomic_set(&fcport->state, FCS_ONLINE);
+}
+
+/*
+ * qla2x00_lun_discovery
+ *	Issue SCSI inquiry command for LUN discovery.
+ *
+ * Input:
+ *	ha:		adapter state pointer.
+ *	fcport:		FC port structure pointer.
+ *
+ * Context:
+ *	Kernel context.
+ */
+static void
+qla2x00_lun_discovery(scsi_qla_host_t *ha, fc_port_t *fcport)
+{
+	inq_cmd_rsp_t	*inq;
+	dma_addr_t	inq_dma;
+	uint16_t	lun;
+
+	inq = pci_alloc_consistent(ha->pdev, sizeof(inq_cmd_rsp_t), &inq_dma);
+	if (inq == NULL) {
+		qla_printk(KERN_WARNING, ha,
+		    "Memory Allocation failed - INQ\n");
+		return;
+	}
+
+	/* If report LUN works, exit. */
+	if (qla2x00_rpt_lun_discovery(ha, fcport, inq, inq_dma) !=
+	    QLA_SUCCESS) {
+		for (lun = 0; lun < ha->max_probe_luns; lun++) {
+			/* Configure LUN. */
+			qla2x00_cfg_lun(ha, fcport, lun, inq, inq_dma);
+		}
+	}
+
+	pci_free_consistent(ha->pdev, sizeof(inq_cmd_rsp_t), inq, inq_dma);
+}
+
+/*
+ * qla2x00_rpt_lun_discovery
+ *	Issue SCSI report LUN command for LUN discovery.
+ *
+ * Input:
+ *	ha:		adapter state pointer.
+ *	fcport:		FC port structure pointer.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+static int
+qla2x00_rpt_lun_discovery(scsi_qla_host_t *ha, fc_port_t *fcport,
+    inq_cmd_rsp_t *inq, dma_addr_t inq_dma)
+{
+	int			rval;
+	uint32_t		len, cnt;
+	uint16_t		lun;
+	rpt_lun_cmd_rsp_t	*rlc;
+	dma_addr_t		rlc_dma;
+
+	/* Assume a failed status */
+	rval = QLA_FUNCTION_FAILED;
+
+	/* No point in continuing if the device doesn't support RLC */
+	if ((fcport->flags & FCF_RLC_SUPPORT) == 0)
+		return (rval);
+
+	rlc = pci_alloc_consistent(ha->pdev, sizeof(rpt_lun_cmd_rsp_t),
+	    &rlc_dma);
+	if (rlc == NULL) {
+		qla_printk(KERN_WARNING, ha,
+			"Memory Allocation failed - RLC");
+		return QLA_MEMORY_ALLOC_FAILED;
+	}
+
+	rval = qla2x00_report_lun(ha, fcport, rlc, rlc_dma);
+	if (rval != QLA_SUCCESS) {
+		pci_free_consistent(ha->pdev, sizeof(rpt_lun_cmd_rsp_t), rlc,
+		    rlc_dma);
+		return (rval);
+	}
+
+	/* Always add a fc_lun_t structure for lun 0 -- mid-layer requirement */
+	qla2x00_add_lun(fcport, 0);
+
+	/* Configure LUN list. */
+	len = be32_to_cpu(rlc->list.hdr.len);
+	len /= 8;
+	for (cnt = 0; cnt < len; cnt++) {
+		lun = CHAR_TO_SHORT(rlc->list.lst[cnt].lsb,
+		    rlc->list.lst[cnt].msb.b);
+
+		DEBUG3(printk("scsi(%ld): RLC lun = (%d)\n", ha->host_no, lun));
+
+		/* We only support 0 through MAX_LUNS-1 range */
+		if (lun < MAX_LUNS) {
+			qla2x00_cfg_lun(ha, fcport, lun, inq, inq_dma);
+		}
+	}
+	atomic_set(&fcport->state, FCS_ONLINE);
+
+	pci_free_consistent(ha->pdev, sizeof(rpt_lun_cmd_rsp_t), rlc, rlc_dma);
+
+	return (rval);
+}
+
+/*
+ * qla2x00_report_lun
+ *	Issue SCSI report LUN command.
+ *
+ * Input:
+ *	ha:		adapter state pointer.
+ *	fcport:		FC port structure pointer.
+ *	mem:		pointer to dma memory object for report LUN IOCB
+ *			packet.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+static int
+qla2x00_report_lun(scsi_qla_host_t *ha,
+    fc_port_t *fcport, rpt_lun_cmd_rsp_t *rlc, dma_addr_t rlc_dma)
+{
+	int rval;
+	uint16_t retries;
+	uint16_t comp_status;
+	uint16_t scsi_status;
+
+	rval = QLA_FUNCTION_FAILED;
+
+	for (retries = 3; retries; retries--) {
+		memset(rlc, 0, sizeof(rpt_lun_cmd_rsp_t));
+		rlc->p.cmd.entry_type = COMMAND_A64_TYPE;
+		rlc->p.cmd.entry_count = 1;
+		SET_TARGET_ID(ha, rlc->p.cmd.target, fcport->loop_id);
+		rlc->p.cmd.control_flags =
+		    __constant_cpu_to_le16(CF_READ | CF_SIMPLE_TAG);
+		rlc->p.cmd.scsi_cdb[0] = REPORT_LUNS;
+		rlc->p.cmd.scsi_cdb[8] = MSB(sizeof(rpt_lun_lst_t));
+		rlc->p.cmd.scsi_cdb[9] = LSB(sizeof(rpt_lun_lst_t));
+		rlc->p.cmd.dseg_count = __constant_cpu_to_le16(1);
+		rlc->p.cmd.timeout = __constant_cpu_to_le16(10);
+		rlc->p.cmd.byte_count =
+		    __constant_cpu_to_le32(sizeof(rpt_lun_lst_t));
+		rlc->p.cmd.dseg_0_address[0] = cpu_to_le32(
+		    LSD(rlc_dma + sizeof(sts_entry_t)));
+		rlc->p.cmd.dseg_0_address[1] = cpu_to_le32(
+		    MSD(rlc_dma + sizeof(sts_entry_t)));
+		rlc->p.cmd.dseg_0_length =
+		    __constant_cpu_to_le32(sizeof(rpt_lun_lst_t));
+
+		rval = qla2x00_issue_iocb(ha, rlc, rlc_dma,
+		    sizeof(rpt_lun_cmd_rsp_t));
+
+		comp_status = le16_to_cpu(rlc->p.rsp.comp_status);
+		scsi_status = le16_to_cpu(rlc->p.rsp.scsi_status);
+
+		if (rval != QLA_SUCCESS || comp_status != CS_COMPLETE ||
+		    scsi_status & SS_CHECK_CONDITION) {
+
+			/* Device underrun, treat as OK. */
+			if (rval == QLA_SUCCESS &&
+			    comp_status == CS_DATA_UNDERRUN &&
+			    scsi_status & SS_RESIDUAL_UNDER) {
+
+				rval = QLA_SUCCESS;
+				break;
+			}
+
+			DEBUG(printk("scsi(%ld): RLC failed to issue iocb! "
+			    "fcport=[%04x/%p] rval=%x cs=%x ss=%x\n",
+			    ha->host_no, fcport->loop_id, fcport, rval,
+			    comp_status, scsi_status));
+
+			rval = QLA_FUNCTION_FAILED;
+			if (scsi_status & SS_CHECK_CONDITION) {
+				DEBUG2(printk("scsi(%ld): RLC "
+				    "SS_CHECK_CONDITION Sense Data "
+				    "%02x %02x %02x %02x %02x %02x %02x %02x\n",
+				    ha->host_no,
+				    rlc->p.rsp.req_sense_data[0],
+				    rlc->p.rsp.req_sense_data[1],
+				    rlc->p.rsp.req_sense_data[2],
+				    rlc->p.rsp.req_sense_data[3],
+				    rlc->p.rsp.req_sense_data[4],
+				    rlc->p.rsp.req_sense_data[5],
+				    rlc->p.rsp.req_sense_data[6],
+				    rlc->p.rsp.req_sense_data[7]));
+				if (rlc->p.rsp.req_sense_data[2] ==
+				    ILLEGAL_REQUEST) {
+					fcport->flags &= ~(FCF_RLC_SUPPORT);
+					break;
+				}
+			}
+		} else {
+			break;
+		}
+	}
+
+	return (rval);
+}
+
+/*
+ * qla2x00_cfg_lun
+ *	Configures LUN into fcport LUN list.
+ *
+ * Input:
+ *	fcport:		FC port structure pointer.
+ *	lun:		LUN number.
+ *
+ * Context:
+ *	Kernel context.
+ */
+static fc_lun_t *
+qla2x00_cfg_lun(scsi_qla_host_t *ha, fc_port_t *fcport, uint16_t lun,
+    inq_cmd_rsp_t *inq, dma_addr_t inq_dma) 
+{
+	fc_lun_t *fclun;
+
+	/* Bypass LUNs that failed. */
+	if (qla2x00_inquiry(ha, fcport, lun, inq, inq_dma) != QLA_SUCCESS) {
+		DEBUG2(printk("scsi(%ld): Failed inquiry - loop id=0x%04x "
+		    "lun=%d\n", ha->host_no, fcport->loop_id, lun));
+
+		return (NULL);
+	}
+
+	switch (inq->inq[0]) {
+	case TYPE_DISK:
+	case TYPE_PROCESSOR:
+	case TYPE_WORM:
+	case TYPE_ROM:
+	case TYPE_SCANNER:
+	case TYPE_MOD:
+	case TYPE_MEDIUM_CHANGER:
+	case TYPE_ENCLOSURE:
+	case 0x20:
+		break;
+	case TYPE_TAPE:
+		fcport->flags |= FCF_TAPE_PRESENT;
+		break;
+	default:
+		DEBUG2(printk("scsi(%ld): Unsupported lun type -- "
+		    "loop id=0x%04x lun=%d type=%x\n",
+		    ha->host_no, fcport->loop_id, lun, inq->inq[0]));
+		return (NULL);
+	}
+
+	fcport->device_type = inq->inq[0];
+	fclun = qla2x00_add_lun(fcport, lun);
+
+	if (fclun != NULL) {
+		atomic_set(&fcport->state, FCS_ONLINE);
+	}
+
+	return (fclun);
+}
+
+/*
+ * qla2x00_add_lun
+ *	Adds LUN to database
+ *
+ * Input:
+ *	fcport:		FC port structure pointer.
+ *	lun:		LUN number.
+ *
+ * Context:
+ *	Kernel context.
+ */
+static fc_lun_t *
+qla2x00_add_lun(fc_port_t *fcport, uint16_t lun)
+{
+	int		found;
+	fc_lun_t	*fclun;
+
+	if (fcport == NULL) {
+		DEBUG(printk("scsi: Unable to add lun to NULL port\n"));
+		return (NULL);
+	}
+
+	/* Allocate LUN if not already allocated. */
+	found = 0;
+	list_for_each_entry(fclun, &fcport->fcluns, list) {
+		if (fclun->lun == lun) {
+			found++;
+			break;
+		}
+	}
+	if (found)
+		return (NULL);
+
+	fclun = kmalloc(sizeof(fc_lun_t), GFP_ATOMIC);
+	if (fclun == NULL) {
+		printk(KERN_WARNING
+		    "%s(): Memory Allocation failed - FCLUN\n",
+		    __func__);
+		return (NULL);
+	}
+
+	/* Setup LUN structure. */
+	memset(fclun, 0, sizeof(fc_lun_t));
+	fclun->lun = lun;
+	fclun->fcport = fcport;
+	fclun->o_fcport = fcport;
+	fclun->device_type = fcport->device_type;
+	atomic_set(&fcport->state, FCS_UNCONFIGURED);
+
+	list_add_tail(&fclun->list, &fcport->fcluns);
+
+	return (fclun);
+}
+
+/*
+ * qla2x00_inquiry
+ *	Issue SCSI inquiry command.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	fcport = FC port structure pointer.
+ *
+ * Return:
+ *	0  - Success
+ *  BIT_0 - error
+ *
+ * Context:
+ *	Kernel context.
+ */
+static int
+qla2x00_inquiry(scsi_qla_host_t *ha,
+    fc_port_t *fcport, uint16_t lun, inq_cmd_rsp_t *inq, dma_addr_t inq_dma)
+{
+	int rval;
+	uint16_t retries;
+	uint16_t comp_status;
+	uint16_t scsi_status;
+
+	rval = QLA_FUNCTION_FAILED;
+
+	for (retries = 3; retries; retries--) {
+		memset(inq, 0, sizeof(inq_cmd_rsp_t));
+		inq->p.cmd.entry_type = COMMAND_A64_TYPE;
+		inq->p.cmd.entry_count = 1;
+		inq->p.cmd.lun = cpu_to_le16(lun);
+		SET_TARGET_ID(ha, inq->p.cmd.target, fcport->loop_id);
+		inq->p.cmd.control_flags =
+		    __constant_cpu_to_le16(CF_READ | CF_SIMPLE_TAG);
+		inq->p.cmd.scsi_cdb[0] = INQUIRY;
+		inq->p.cmd.scsi_cdb[4] = INQ_DATA_SIZE;
+		inq->p.cmd.dseg_count = __constant_cpu_to_le16(1);
+		inq->p.cmd.timeout = __constant_cpu_to_le16(10);
+		inq->p.cmd.byte_count =
+		    __constant_cpu_to_le32(INQ_DATA_SIZE);
+		inq->p.cmd.dseg_0_address[0] = cpu_to_le32(
+		    LSD(inq_dma + sizeof(sts_entry_t)));
+		inq->p.cmd.dseg_0_address[1] = cpu_to_le32(
+		    MSD(inq_dma + sizeof(sts_entry_t)));
+		inq->p.cmd.dseg_0_length =
+		    __constant_cpu_to_le32(INQ_DATA_SIZE);
+
+		DEBUG5(printk("scsi(%ld): Lun Inquiry - fcport=[%04x/%p],"
+		    " lun (%d)\n",
+		    ha->host_no, fcport->loop_id, fcport, lun));
+
+		rval = qla2x00_issue_iocb(ha, inq, inq_dma,
+		    sizeof(inq_cmd_rsp_t));
+
+		comp_status = le16_to_cpu(inq->p.rsp.comp_status);
+		scsi_status = le16_to_cpu(inq->p.rsp.scsi_status);
+
+		DEBUG5(printk("scsi(%ld): lun (%d) inquiry - "
+		    "inq[0]= 0x%x, comp status 0x%x, scsi status 0x%x, "
+		    "rval=%d\n",
+		    ha->host_no, lun, inq->inq[0], comp_status, scsi_status,
+		    rval));
+
+		if (rval != QLA_SUCCESS || comp_status != CS_COMPLETE ||
+		    scsi_status & SS_CHECK_CONDITION) {
+
+			DEBUG(printk("scsi(%ld): INQ failed to issue iocb! "
+			    "fcport=[%04x/%p] rval=%x cs=%x ss=%x\n",
+			    ha->host_no, fcport->loop_id, fcport, rval,
+			    comp_status, scsi_status));
+
+			if (rval == QLA_SUCCESS)
+				rval = QLA_FUNCTION_FAILED;
+
+			if (scsi_status & SS_CHECK_CONDITION) {
+				DEBUG2(printk("scsi(%ld): INQ "
+				    "SS_CHECK_CONDITION Sense Data "
+				    "%02x %02x %02x %02x %02x %02x %02x %02x\n",
+				    ha->host_no,
+				    inq->p.rsp.req_sense_data[0],
+				    inq->p.rsp.req_sense_data[1],
+				    inq->p.rsp.req_sense_data[2],
+				    inq->p.rsp.req_sense_data[3],
+				    inq->p.rsp.req_sense_data[4],
+				    inq->p.rsp.req_sense_data[5],
+				    inq->p.rsp.req_sense_data[6],
+				    inq->p.rsp.req_sense_data[7]));
+			}
+
+			/* Device underrun drop LUN. */
+			if (comp_status == CS_DATA_UNDERRUN &&
+			    scsi_status & SS_RESIDUAL_UNDER) {
+				break;
+			}
+		} else {
+			break;
+		}
+	}
+
+	return (rval);
+}
+
+
+/*
+ * qla2x00_configure_fabric
+ *      Setup SNS devices with loop ID's.
+ *
+ * Input:
+ *      ha = adapter block pointer.
+ *
+ * Returns:
+ *      0 = success.
+ *      BIT_0 = error
+ */
+static int
+qla2x00_configure_fabric(scsi_qla_host_t *ha)
+{
+	int	rval, rval2;
+	fc_port_t	*fcport, *fcptemp;
+	uint16_t	next_loopid;
+	LIST_HEAD(new_fcports);
+
+	/* If FL port exists, then SNS is present */
+	rval = qla2x00_get_port_name(ha, SNS_FL_PORT, NULL, 0);
+	if (rval != QLA_SUCCESS) {
+		DEBUG2(printk("scsi(%ld): MBC_GET_PORT_NAME Failed, No FL "
+		    "Port\n", ha->host_no));
+
+		ha->device_flags &= ~SWITCH_FOUND;
+		return (QLA_SUCCESS);
+	}
+
+	/* Mark devices that need re-synchronization. */
+	rval2 = qla2x00_device_resync(ha);
+	if (rval2 == QLA_RSCNS_HANDLED) {
+		/* No, point doing the scan, just continue. */
+		return (QLA_SUCCESS);
+	}
+	do {
+		if (test_and_clear_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags)) {
+			if (qla2x00_rft_id(ha)) {
+				/* EMPTY */
+				DEBUG2(printk("scsi(%ld): Register FC-4 "
+				    "TYPE failed.\n", ha->host_no));
+			}
+			if (qla2x00_rff_id(ha)) {
+				/* EMPTY */
+				DEBUG2(printk("scsi(%ld): Register FC-4 "
+				    "Features failed.\n", ha->host_no));
+			}
+			if (qla2x00_rnn_id(ha)) {
+				/* EMPTY */
+				DEBUG2(printk("scsi(%ld): Register Node Name "
+				    "failed.\n", ha->host_no));
+			} else if (qla2x00_rsnn_nn(ha)) {
+				/* EMPTY */
+				DEBUG2(printk("scsi(%ld): Register Symbolic "
+				    "Node Name failed.\n", ha->host_no));
+			}
+		}
+
+		rval = qla2x00_find_all_fabric_devs(ha, &new_fcports);
+		if (rval != QLA_SUCCESS)
+			break;
+
+		/*
+		 * Logout all previous fabric devices marked lost, except
+		 * tape devices.
+		 */
+		list_for_each_entry(fcport, &ha->fcports, list) {
+			if (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags))
+				break;
+
+			if ((fcport->flags & FCF_FABRIC_DEVICE) == 0)
+				continue;
+
+			if (atomic_read(&fcport->state) == FCS_DEVICE_LOST) {
+				qla2x00_mark_device_lost(ha, fcport,
+				    ql2xplogiabsentdevice);
+				if (fcport->loop_id != FC_NO_LOOP_ID &&
+				    (fcport->flags & FCF_TAPE_PRESENT) == 0 &&
+				    fcport->port_type != FCT_INITIATOR &&
+				    fcport->port_type != FCT_BROADCAST) {
+
+					qla2x00_fabric_logout(ha,
+					    fcport->loop_id);
+					fcport->loop_id = FC_NO_LOOP_ID;
+				}
+			}
+		}
+
+		/* Starting free loop ID. */
+		next_loopid = ha->min_external_loopid;
+
+		/*
+		 * Scan through our port list and login entries that need to be
+		 * logged in.
+		 */
+		list_for_each_entry(fcport, &ha->fcports, list) {
+			if (atomic_read(&ha->loop_down_timer) ||
+			    test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags))
+				break;
+
+			if ((fcport->flags & FCF_FABRIC_DEVICE) == 0 ||
+			    (fcport->flags & FCF_LOGIN_NEEDED) == 0)
+				continue;
+
+			if (fcport->loop_id == FC_NO_LOOP_ID) {
+				fcport->loop_id = next_loopid;
+				rval = qla2x00_find_new_loop_id(ha, fcport);
+				if (rval != QLA_SUCCESS) {
+					/* Ran out of IDs to use */
+					break;
+				}
+			}
+
+			/* Login and update database */
+			qla2x00_fabric_dev_login(ha, fcport, &next_loopid);
+		}
+
+		/* Exit if out of loop IDs. */
+		if (rval != QLA_SUCCESS) {
+			break;
+		}
+
+		/*
+		 * Login and add the new devices to our port list.
+		 */
+		list_for_each_entry_safe(fcport, fcptemp, &new_fcports, list) {
+			if (atomic_read(&ha->loop_down_timer) ||
+			    test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags))
+				break;
+
+			/* Find a new loop ID to use. */
+			fcport->loop_id = next_loopid;
+			rval = qla2x00_find_new_loop_id(ha, fcport);
+			if (rval != QLA_SUCCESS) {
+				/* Ran out of IDs to use */
+				break;
+			}
+
+			/* Login and update database */
+			qla2x00_fabric_dev_login(ha, fcport, &next_loopid);
+
+			/* Remove device from the new list and add it to DB */
+			list_del(&fcport->list);
+			list_add_tail(&fcport->list, &ha->fcports);
+		}
+	} while (0);
+
+	/* Free all new device structures not processed. */
+	list_for_each_entry_safe(fcport, fcptemp, &new_fcports, list) {
+		list_del(&fcport->list);
+		kfree(fcport);
+	}
+
+	if (rval) {
+		DEBUG2(printk("scsi(%ld): Configure fabric error exit: "
+		    "rval=%d\n", ha->host_no, rval));
+	}
+
+	return (rval);
+}
+
+
+/*
+ * qla2x00_find_all_fabric_devs
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	dev = database device entry pointer.
+ *
+ * Returns:
+ *	0 = success.
+ *	BIT_0 = error.
+ *
+ * Context:
+ *	Kernel context.
+ */
+static int
+qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
+{
+	int		rval;
+	uint16_t	loop_id;
+	fc_port_t	*fcport, *new_fcport;
+	int		found;
+
+	sw_info_t	*swl;
+	int		swl_idx;
+	int		first_dev, last_dev;
+	port_id_t	wrap, nxt_d_id;
+
+	rval = QLA_SUCCESS;
+
+	/* Try GID_PT to get device list, else GAN. */
+	swl = kmalloc(sizeof(sw_info_t) * MAX_FIBRE_DEVICES, GFP_ATOMIC);
+	if (swl == NULL) {
+		/*EMPTY*/
+		DEBUG2(printk("scsi(%ld): GID_PT allocations failed, fallback "
+		    "on GA_NXT\n", ha->host_no));
+	} else {
+		memset(swl, 0, sizeof(sw_info_t) * MAX_FIBRE_DEVICES);
+		if (qla2x00_gid_pt(ha, swl) != QLA_SUCCESS) {
+			kfree(swl);
+			swl = NULL;
+		} else if (qla2x00_gpn_id(ha, swl) != QLA_SUCCESS) {
+			kfree(swl);
+			swl = NULL;
+		} else if (qla2x00_gnn_id(ha, swl) != QLA_SUCCESS) {
+			kfree(swl);
+			swl = NULL;
+		}
+	}
+	swl_idx = 0;
+
+	/* Allocate temporary fcport for any new fcports discovered. */
+	new_fcport = qla2x00_alloc_fcport(ha, GFP_KERNEL);
+	if (new_fcport == NULL) {
+		if (swl)
+			kfree(swl);
+		return (QLA_MEMORY_ALLOC_FAILED);
+	}
+	new_fcport->flags |= (FCF_FABRIC_DEVICE | FCF_LOGIN_NEEDED);
+
+	/* Set start port ID scan at adapter ID. */
+	first_dev = 1;
+	last_dev = 0;
+
+	/* Starting free loop ID. */
+	loop_id = ha->min_external_loopid;
+
+	for (; loop_id <= ha->last_loop_id; loop_id++) {
+		if (RESERVED_LOOP_ID(loop_id))
+			continue;
+
+		if (atomic_read(&ha->loop_down_timer) ||
+		    test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags))
+			break;
+
+		if (swl != NULL) {
+			if (last_dev) {
+				wrap.b24 = new_fcport->d_id.b24;
+			} else {
+				new_fcport->d_id.b24 = swl[swl_idx].d_id.b24;
+				memcpy(new_fcport->node_name,
+				    swl[swl_idx].node_name, WWN_SIZE);
+				memcpy(new_fcport->port_name,
+				    swl[swl_idx].port_name, WWN_SIZE);
+
+				if (swl[swl_idx].d_id.b.rsvd_1 != 0) {
+					last_dev = 1;
+				}
+				swl_idx++;
+			}
+		} else {
+			/* Send GA_NXT to the switch */
+			rval = qla2x00_ga_nxt(ha, new_fcport);
+			if (rval != QLA_SUCCESS) {
+				break;
+			}
+		}
+
+		/* If wrap on switch device list, exit. */
+		if (first_dev) {
+			wrap.b24 = new_fcport->d_id.b24;
+			first_dev = 0;
+		} else if (new_fcport->d_id.b24 == wrap.b24) {
+			DEBUG2(printk("scsi(%ld): device wrap (%02x%02x%02x)\n",
+			    ha->host_no, new_fcport->d_id.b.domain,
+			    new_fcport->d_id.b.area, new_fcport->d_id.b.al_pa));
+			break;
+		}
+
+		/* Bypass if host adapter. */
+		if (new_fcport->d_id.b24 == ha->d_id.b24)
+			continue;
+
+		/* Bypass reserved domain fields. */
+		if ((new_fcport->d_id.b.domain & 0xf0) == 0xf0)
+			continue;
+
+		/* Bypass if same domain and area of adapter. */
+		if ((new_fcport->d_id.b24 & 0xffff00) ==
+		    (ha->d_id.b24 & 0xffff00))
+			continue;
+
+		/* Locate matching device in database. */
+		found = 0;
+		list_for_each_entry(fcport, &ha->fcports, list) {
+			if (memcmp(new_fcport->port_name, fcport->port_name,
+			    WWN_SIZE))
+				continue;
+
+			found++;
+
+			/*
+			 * If device was not a fabric device before.
+			 */
+			if ((fcport->flags & FCF_FABRIC_DEVICE) == 0) {
+				fcport->d_id.b24 = new_fcport->d_id.b24;
+				fcport->loop_id = FC_NO_LOOP_ID;
+				fcport->flags |= (FCF_FABRIC_DEVICE |
+				    FCF_LOGIN_NEEDED);
+				fcport->flags &= ~FCF_PERSISTENT_BOUND;
+				break;
+			}
+
+			/*
+			 * If address the same and state FCS_ONLINE, nothing
+			 * changed.
+			 */
+			if (fcport->d_id.b24 == new_fcport->d_id.b24 &&
+			    atomic_read(&fcport->state) == FCS_ONLINE) {
+				break;
+			}
+
+			/*
+			 * Port ID changed or device was marked to be updated;
+			 * Log it out if still logged in and mark it for
+			 * relogin later.
+			 */
+			fcport->d_id.b24 = new_fcport->d_id.b24;
+			fcport->flags |= FCF_LOGIN_NEEDED;
+			if (fcport->loop_id != FC_NO_LOOP_ID &&
+			    (fcport->flags & FCF_TAPE_PRESENT) == 0 &&
+			    fcport->port_type != FCT_INITIATOR &&
+			    fcport->port_type != FCT_BROADCAST) {
+				qla2x00_fabric_logout(ha, fcport->loop_id);
+				fcport->loop_id = FC_NO_LOOP_ID;
+			}
+
+			break;
+		}
+
+		if (found)
+			continue;
+
+		/* If device was not in our fcports list, then add it. */
+		list_add_tail(&new_fcport->list, new_fcports);
+
+		/* Allocate a new replacement fcport. */
+		nxt_d_id.b24 = new_fcport->d_id.b24;
+		new_fcport = qla2x00_alloc_fcport(ha, GFP_KERNEL);
+		if (new_fcport == NULL) {
+			if (swl)
+				kfree(swl);
+			return (QLA_MEMORY_ALLOC_FAILED);
+		}
+		new_fcport->flags |= (FCF_FABRIC_DEVICE | FCF_LOGIN_NEEDED);
+		new_fcport->d_id.b24 = nxt_d_id.b24;
+	}
+
+	if (swl)
+		kfree(swl);
+
+	if (new_fcport)
+		kfree(new_fcport);
+
+	if (!list_empty(new_fcports))
+		ha->device_flags |= DFLG_FABRIC_DEVICES;
+
+	return (rval);
+}
+
+/*
+ * qla2x00_find_new_loop_id
+ *	Scan through our port list and find a new usable loop ID.
+ *
+ * Input:
+ *	ha:	adapter state pointer.
+ *	dev:	port structure pointer.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_find_new_loop_id(scsi_qla_host_t *ha, fc_port_t *dev)
+{
+	int	rval;
+	int	found;
+	fc_port_t *fcport;
+	uint16_t first_loop_id;
+
+	rval = QLA_SUCCESS;
+
+	/* Save starting loop ID. */
+	first_loop_id = dev->loop_id;
+
+	for (;;) {
+		/* Skip loop ID if already used by adapter. */
+		if (dev->loop_id == ha->loop_id) {
+			dev->loop_id++;
+		}
+
+		/* Skip reserved loop IDs. */
+		while (RESERVED_LOOP_ID(dev->loop_id)) {
+			dev->loop_id++;
+		}
+
+		/* Reset loop ID if passed the end. */
+		if (dev->loop_id > ha->last_loop_id) {
+			/* first loop ID. */
+			dev->loop_id = ha->min_external_loopid;
+		}
+
+		/* Check for loop ID being already in use. */
+		found = 0;
+		fcport = NULL;
+		list_for_each_entry(fcport, &ha->fcports, list) {
+			if (fcport->loop_id == dev->loop_id && fcport != dev) {
+				/* ID possibly in use */
+				found++;
+				break;
+			}
+		}
+
+		/* If not in use then it is free to use. */
+		if (!found) {
+			break;
+		}
+
+		/* ID in use. Try next value. */
+		dev->loop_id++;
+
+		/* If wrap around. No free ID to use. */
+		if (dev->loop_id == first_loop_id) {
+			dev->loop_id = FC_NO_LOOP_ID;
+			rval = QLA_FUNCTION_FAILED;
+			break;
+		}
+	}
+
+	return (rval);
+}
+
+/*
+ * qla2x00_device_resync
+ *	Marks devices in the database that needs resynchronization.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *
+ * Context:
+ *	Kernel context.
+ */
+static int
+qla2x00_device_resync(scsi_qla_host_t *ha) 
+{
+	int	rval;
+	int	rval2;
+	uint32_t mask;
+	fc_port_t *fcport;
+	uint32_t rscn_entry;
+	uint8_t rscn_out_iter;
+	uint8_t format;
+	port_id_t d_id;
+
+	rval = QLA_RSCNS_HANDLED;
+
+	while (ha->rscn_out_ptr != ha->rscn_in_ptr ||
+	    ha->flags.rscn_queue_overflow) {
+
+		rscn_entry = ha->rscn_queue[ha->rscn_out_ptr];
+		format = MSB(MSW(rscn_entry));
+		d_id.b.domain = LSB(MSW(rscn_entry));
+		d_id.b.area = MSB(LSW(rscn_entry));
+		d_id.b.al_pa = LSB(LSW(rscn_entry));
+
+		DEBUG(printk("scsi(%ld): RSCN queue entry[%d] = "
+		    "[%02x/%02x%02x%02x].\n",
+		    ha->host_no, ha->rscn_out_ptr, format, d_id.b.domain,
+		    d_id.b.area, d_id.b.al_pa));
+
+		ha->rscn_out_ptr++;
+		if (ha->rscn_out_ptr == MAX_RSCN_COUNT)
+			ha->rscn_out_ptr = 0;
+
+		/* Skip duplicate entries. */
+		for (rscn_out_iter = ha->rscn_out_ptr;
+		    !ha->flags.rscn_queue_overflow &&
+		    rscn_out_iter != ha->rscn_in_ptr;
+		    rscn_out_iter = (rscn_out_iter ==
+			(MAX_RSCN_COUNT - 1)) ? 0: rscn_out_iter + 1) {
+
+			if (rscn_entry != ha->rscn_queue[rscn_out_iter])
+				break;
+
+			DEBUG(printk("scsi(%ld): Skipping duplicate RSCN queue "
+			    "entry found at [%d].\n", ha->host_no,
+			    rscn_out_iter));
+
+			ha->rscn_out_ptr = rscn_out_iter;
+		}
+
+		/* Queue overflow, set switch default case. */
+		if (ha->flags.rscn_queue_overflow) {
+			DEBUG(printk("scsi(%ld): device_resync: rscn "
+			    "overflow.\n", ha->host_no));
+
+			format = 3;
+			ha->flags.rscn_queue_overflow = 0;
+		}
+
+		switch (format) {
+		case 0:
+			if (IS_QLA23XX(ha) && ha->flags.init_done) {
+				/* Handle port RSCN via asyncronous IOCBs */
+				rval2 = qla2x00_handle_port_rscn(ha, rscn_entry,
+				    NULL, 0);
+				if (rval2 == QLA_SUCCESS)
+					continue;
+			}
+			mask = 0xffffff;
+			break;
+		case 1:
+			mask = 0xffff00;
+			break;
+		case 2:
+			mask = 0xff0000;
+			break;
+		default:
+			mask = 0x0;
+			d_id.b24 = 0;
+			ha->rscn_out_ptr = ha->rscn_in_ptr;
+			break;
+		}
+
+		rval = QLA_SUCCESS;
+
+		/* Abort any outstanding IO descriptors. */
+		if (IS_QLA23XX(ha))
+			qla2x00_cancel_io_descriptors(ha);
+
+		list_for_each_entry(fcport, &ha->fcports, list) {
+			if ((fcport->flags & FCF_FABRIC_DEVICE) == 0 ||
+			    (fcport->d_id.b24 & mask) != d_id.b24 ||
+			    fcport->port_type == FCT_BROADCAST)
+				continue;
+
+			if (atomic_read(&fcport->state) == FCS_ONLINE) {
+				if (format != 3 ||
+				    fcport->port_type != FCT_INITIATOR) {
+					atomic_set(&fcport->state,
+					    FCS_DEVICE_LOST);
+				}
+			}
+			fcport->flags &= ~FCF_FARP_DONE;
+		}
+	}
+	return (rval);
+}
+
+/*
+ * qla2x00_fabric_dev_login
+ *	Login fabric target device and update FC port database.
+ *
+ * Input:
+ *	ha:		adapter state pointer.
+ *	fcport:		port structure list pointer.
+ *	next_loopid:	contains value of a new loop ID that can be used
+ *			by the next login attempt.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+static int
+qla2x00_fabric_dev_login(scsi_qla_host_t *ha, fc_port_t *fcport,
+    uint16_t *next_loopid)
+{
+	int	rval;
+	int	retry;
+
+	rval = QLA_SUCCESS;
+	retry = 0;
+
+	rval = qla2x00_fabric_login(ha, fcport, next_loopid);
+	if (rval == QLA_SUCCESS) {
+		rval = qla2x00_get_port_database(ha, fcport, BIT_1 | BIT_0);
+		if (rval != QLA_SUCCESS) {
+			qla2x00_fabric_logout(ha, fcport->loop_id);
+		} else {
+			qla2x00_update_fcport(ha, fcport);
+		}
+	}
+
+	return (rval);
+}
+
+/*
+ * qla2x00_fabric_login
+ *	Issue fabric login command.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	device = pointer to FC device type structure.
+ *
+ * Returns:
+ *      0 - Login successfully
+ *      1 - Login failed
+ *      2 - Initiator device
+ *      3 - Fatal error
+ */
+int
+qla2x00_fabric_login(scsi_qla_host_t *ha, fc_port_t *fcport,
+    uint16_t *next_loopid)
+{
+	int	rval;
+	int	retry;
+	uint16_t tmp_loopid;
+	uint16_t mb[MAILBOX_REGISTER_COUNT];
+
+	retry = 0;
+	tmp_loopid = 0;
+
+	for (;;) {
+		DEBUG(printk("scsi(%ld): Trying Fabric Login w/loop id 0x%04x "
+ 		    "for port %02x%02x%02x.\n",
+ 		    ha->host_no, fcport->loop_id, fcport->d_id.b.domain,
+		    fcport->d_id.b.area, fcport->d_id.b.al_pa));
+
+		/* Login fcport on switch. */
+		qla2x00_login_fabric(ha, fcport->loop_id,
+		    fcport->d_id.b.domain, fcport->d_id.b.area,
+		    fcport->d_id.b.al_pa, mb, BIT_0);
+		if (mb[0] == MBS_PORT_ID_USED) {
+			/*
+			 * Device has another loop ID.  The firmware team
+			 * recommends us to perform an implicit login with the
+			 * specified ID again. The ID we just used is save here
+			 * so we return with an ID that can be tried by the
+			 * next login.
+			 */
+			retry++;
+			tmp_loopid = fcport->loop_id;
+			fcport->loop_id = mb[1];
+
+			DEBUG(printk("Fabric Login: port in use - next "
+ 			    "loop id=0x%04x, port Id=%02x%02x%02x.\n",
+			    fcport->loop_id, fcport->d_id.b.domain,
+			    fcport->d_id.b.area, fcport->d_id.b.al_pa));
+
+		} else if (mb[0] == MBS_COMMAND_COMPLETE) {
+			/*
+			 * Login succeeded.
+			 */
+			if (retry) {
+				/* A retry occurred before. */
+				*next_loopid = tmp_loopid;
+			} else {
+				/*
+				 * No retry occurred before. Just increment the
+				 * ID value for next login.
+				 */
+				*next_loopid = (fcport->loop_id + 1);
+			}
+
+			if (mb[1] & BIT_0) {
+				fcport->port_type = FCT_INITIATOR;
+			} else {
+				fcport->port_type = FCT_TARGET;
+				if (mb[1] & BIT_1) {
+					fcport->flags |= FCF_TAPE_PRESENT;
+				}
+			}
+
+			rval = QLA_SUCCESS;
+			break;
+		} else if (mb[0] == MBS_LOOP_ID_USED) {
+			/*
+			 * Loop ID already used, try next loop ID.
+			 */
+			fcport->loop_id++;
+			rval = qla2x00_find_new_loop_id(ha, fcport);
+			if (rval != QLA_SUCCESS) {
+				/* Ran out of loop IDs to use */
+				break;
+			}
+		} else if (mb[0] == MBS_COMMAND_ERROR) {
+			/*
+			 * Firmware possibly timed out during login. If NO
+			 * retries are left to do then the device is declared
+			 * dead.
+			 */
+			*next_loopid = fcport->loop_id;
+			qla2x00_fabric_logout(ha, fcport->loop_id);
+			fcport->loop_id = FC_NO_LOOP_ID;
+
+			rval = 3;
+			break;
+		} else {
+			/*
+			 * unrecoverable / not handled error
+			 */
+			DEBUG2(printk("%s(%ld): failed=%x port_id=%02x%02x%02x "
+ 			    "loop_id=%x jiffies=%lx.\n", 
+ 			    __func__, ha->host_no, mb[0], 
+			    fcport->d_id.b.domain, fcport->d_id.b.area,
+			    fcport->d_id.b.al_pa, fcport->loop_id, jiffies));
+
+			*next_loopid = fcport->loop_id;
+			qla2x00_fabric_logout(ha, fcport->loop_id);
+			fcport->loop_id = FC_NO_LOOP_ID;
+			atomic_set(&fcport->state, FCS_DEVICE_DEAD);
+
+			rval = 1;
+			break;
+		}
+	}
+
+	return (rval);
+}
+
+/*
+ * qla2x00_local_device_login
+ *	Issue local device login command.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	loop_id = loop id of device to login to.
+ *
+ * Returns (Where's the #define!!!!):
+ *      0 - Login successfully
+ *      1 - Login failed
+ *      3 - Fatal error
+ */
+int
+qla2x00_local_device_login(scsi_qla_host_t *ha, uint16_t loop_id)
+{
+	int		rval;
+	uint16_t	mb[MAILBOX_REGISTER_COUNT];
+
+	memset(mb, 0, sizeof(mb));
+	rval = qla2x00_login_local_device(ha, loop_id, mb, BIT_0);
+	if (rval == QLA_SUCCESS) {
+		/* Interrogate mailbox registers for any errors */
+		if (mb[0] == MBS_COMMAND_ERROR)
+			rval = 1;
+		else if (mb[0] == MBS_COMMAND_PARAMETER_ERROR)
+			/* device not in PCB table */
+			rval = 3;
+	}
+
+	return (rval);
+}
+
+/*
+ *  qla2x00_loop_resync
+ *      Resync with fibre channel devices.
+ *
+ * Input:
+ *      ha = adapter block pointer.
+ *
+ * Returns:
+ *      0 = success
+ */
+int
+qla2x00_loop_resync(scsi_qla_host_t *ha) 
+{
+	int   rval;
+
+	rval = QLA_SUCCESS;
+
+	atomic_set(&ha->loop_state, LOOP_UPDATE);
+	qla2x00_stats.loop_resync++;
+	clear_bit(ISP_ABORT_RETRY, &ha->dpc_flags);
+	if (ha->flags.online) {
+		if (!(rval = qla2x00_fw_ready(ha))) {
+			do {
+				/* v2.19.05b6 */
+				atomic_set(&ha->loop_state, LOOP_UPDATE);
+
+				/*
+				 * Issue marker command only when we are going
+				 * to start the I/O .
+				 */
+				ha->marker_needed = 1;
+
+				/* Remap devices on Loop. */
+				clear_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags);
+
+				qla2x00_configure_loop(ha);
+
+			} while (!atomic_read(&ha->loop_down_timer) &&
+				!(test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags)) &&
+				(test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)));
+		}
+		qla2x00_restart_queues(ha,TRUE);
+	}
+
+	if (test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags)) {
+		return (QLA_FUNCTION_FAILED);
+	}
+
+	if (rval) {
+		DEBUG2_3(printk("%s(): **** FAILED ****\n", __func__));
+	}
+
+	return (rval);
+}
+
+/*
+ *  qla2x00_restart_queues
+ *	Restart device queues.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *
+ * Context:
+ *	Kernel/Interrupt context.
+ */
+void
+qla2x00_restart_queues(scsi_qla_host_t *ha, uint8_t flush) 
+{
+	srb_t  		*sp;
+	int		retry_q_cnt = 0;
+	int		pending_q_cnt = 0;
+	struct list_head *list, *temp;
+	unsigned long flags = 0;
+
+	ENTER(__func__);
+
+	clear_bit(RESTART_QUEUES_NEEDED, &ha->dpc_flags);
+
+	/*
+	 * start pending queue
+	 */
+	pending_q_cnt = ha->qthreads;
+	if (flush) {
+		spin_lock_irqsave(&ha->list_lock,flags);
+		list_for_each_safe(list, temp, &ha->pending_queue) {
+			sp = list_entry(list, srb_t, list);
+			/* 
+			 * When time expire return request back to OS as BUSY 
+			 */
+			__del_from_pending_queue(ha, sp);
+			sp->cmd->result = DID_BUS_BUSY << 16;
+			sp->cmd->host_scribble = (unsigned char *)NULL;
+			__add_to_done_queue(ha, sp);
+		}
+		spin_unlock_irqrestore(&ha->list_lock, flags);
+	} else {
+		if (!list_empty(&ha->pending_queue))
+			qla2x00_next(ha);
+	}
+
+	/*
+	 * Clear out our retry queue
+	 */
+	if (flush) {
+		spin_lock_irqsave(&ha->list_lock, flags);
+		retry_q_cnt = ha->retry_q_cnt;
+		list_for_each_safe(list, temp, &ha->retry_queue) {
+			sp = list_entry(list, srb_t, list);
+			/* when time expire return request back to OS as BUSY */
+			__del_from_retry_queue(ha, sp);
+			sp->cmd->result = DID_BUS_BUSY << 16;
+			sp->cmd->host_scribble = (unsigned char *)NULL;
+			__add_to_done_queue(ha, sp);
+		}
+		spin_unlock_irqrestore(&ha->list_lock, flags);
+
+		DEBUG2(printk("%s(%ld): callback %d commands.\n",
+				__func__,
+				ha->host_no,
+				retry_q_cnt);)
+	}
+
+	DEBUG2(printk("%s(%ld): active=%ld, retry=%d, pending=%d, "
+			"done=%ld, scsi retry=%d commands.\n",
+			__func__,
+			ha->host_no,
+			ha->actthreads,
+			ha->retry_q_cnt,
+			pending_q_cnt,
+			ha->done_q_cnt,
+			ha->scsi_retry_q_cnt);)
+
+	if (!list_empty(&ha->done_queue))
+		qla2x00_done(ha);
+
+	LEAVE(__func__);
+}
+
+//FIXME - Document
+void
+qla2x00_rescan_fcports(scsi_qla_host_t *ha)
+{
+	int rescan_done;
+	fc_port_t *fcport;
+
+	rescan_done = 0;
+	list_for_each_entry(fcport, &ha->fcports, list) {
+		if ((fcport->flags & FCF_RESCAN_NEEDED) == 0)
+			continue;
+
+		qla2x00_update_fcport(ha, fcport);
+		fcport->flags &= ~FCF_RESCAN_NEEDED;
+
+		rescan_done = 1;
+	}
+
+	/* Update OS target and lun structures if necessary. */
+	if (rescan_done)
+		qla2x00_config_os(ha);
+}
+
+
+/*
+ * qla2x00_config_os
+ *	Setup OS target and LUN structures.
+ *
+ * Input:
+ *	ha = adapter state pointer.
+ *
+ * Context:
+ *	Kernel context.
+ */
+static void
+qla2x00_config_os(scsi_qla_host_t *ha) 
+{
+	fc_port_t	*fcport;
+	fc_lun_t	*fclun;
+	os_tgt_t	*tq;
+	uint16_t	tgt;
+
+
+	for (tgt = 0; tgt < MAX_TARGETS; tgt++) {
+		if ((tq = TGT_Q(ha, tgt)) == NULL)
+			continue;
+
+		tq->flags &= ~TQF_ONLINE;
+	}
+
+	list_for_each_entry(fcport, &ha->fcports, list) {
+		if (atomic_read(&fcport->state) != FCS_ONLINE ||
+		    fcport->port_type == FCT_INITIATOR ||
+		    fcport->port_type == FCT_BROADCAST) {
+			fcport->os_target_id = MAX_TARGETS;
+			continue;
+		}
+
+		if (fcport->flags & FCF_FO_MASKED) {
+			continue;
+		}
+
+		/* Bind FC port to OS target number. */
+		if (qla2x00_fcport_bind(ha, fcport) == MAX_TARGETS) {
+			continue;
+		}
+
+		/* Bind FC LUN to OS LUN number. */
+		list_for_each_entry(fclun, &fcport->fcluns, list) {
+			qla2x00_fclun_bind(ha, fcport, fclun);
+		}
+	}
+}
+
+/*
+ * qla2x00_fcport_bind
+ *	Locates a target number for FC port.
+ *
+ * Input:
+ *	ha = adapter state pointer.
+ *	fcport = FC port structure pointer.
+ *
+ * Returns:
+ *	target number
+ *
+ * Context:
+ *	Kernel context.
+ */
+static uint16_t
+qla2x00_fcport_bind(scsi_qla_host_t *ha, fc_port_t *fcport) 
+{
+	uint16_t	tgt;
+	os_tgt_t	*tq;
+
+	/* Check for persistent binding. */
+	for (tgt = 0; tgt < MAX_TARGETS; tgt++) {
+		if ((tq = TGT_Q(ha, tgt)) == NULL)
+			continue;
+
+		if (ha->binding_type == BIND_BY_PORT_ID &&
+		    fcport->d_id.b24 == tq->d_id.b24) {
+			memcpy(tq->node_name, fcport->node_name, WWN_SIZE);
+			memcpy(tq->port_name, fcport->port_name, WWN_SIZE);
+			break;
+		}
+
+		if (memcmp(fcport->port_name, tq->port_name, WWN_SIZE) == 0) {
+			/* In case of persistent binding, update the WWNN */
+			memcpy(tq->node_name, fcport->node_name, WWN_SIZE);
+			break;
+		}
+	}
+
+	/* TODO: honor the ConfigRequired flag */
+	if (tgt == MAX_TARGETS) {
+		/* Check if targetID 0 available. */
+		tgt = 0;
+
+		if (TGT_Q(ha, tgt) != NULL) {
+			/* Locate first free target for device. */
+			for (tgt = 0; tgt < MAX_TARGETS; tgt++) {
+				if (TGT_Q(ha, tgt) == NULL) {
+					break;
+				}
+			}
+		}
+		if (tgt != MAX_TARGETS) {
+			if ((tq = qla2x00_tgt_alloc(ha, tgt)) != NULL) {
+				memcpy(tq->node_name, fcport->node_name,
+				    WWN_SIZE);
+				memcpy(tq->port_name, fcport->port_name,
+				    WWN_SIZE);
+				tq->d_id.b24 = fcport->d_id.b24;
+			}
+		}
+	}
+
+	/* Reset target numbers incase it changed. */
+	fcport->os_target_id = tgt;
+	if (tgt != MAX_TARGETS && tq != NULL) {
+		DEBUG2(printk("scsi(%ld): Assigning target ID=%02d @ %p to "
+		    "loop id=0x%04x, port state=0x%x, port down retry=%d\n",
+		    ha->host_no, tgt, tq, fcport->loop_id,
+		    atomic_read(&fcport->state),
+		    atomic_read(&fcport->port_down_timer)));
+
+		fcport->tgt_queue = tq;
+		fcport->flags |= FCF_PERSISTENT_BOUND;
+		tq->fcport = fcport;
+		tq->flags |= TQF_ONLINE;
+		tq->port_down_retry_count = ha->port_down_retry_count;
+
+	}
+
+	if (tgt == MAX_TARGETS) {
+		qla_printk(KERN_WARNING, ha,
+		    "Unable to bind fcport, loop_id=%x\n", fcport->loop_id);
+	}
+
+	return (tgt);
+}
+
+/*
+ * qla2x00_fclun_bind
+ *	Binds all FC device LUNS to OS LUNS.
+ *
+ * Input:
+ *	ha:		adapter state pointer.
+ *	fcport:		FC port structure pointer.
+ *
+ * Returns:
+ *	target number
+ *
+ * Context:
+ *	Kernel context.
+ */
+static os_lun_t *
+qla2x00_fclun_bind(scsi_qla_host_t *ha, fc_port_t *fcport, fc_lun_t *fclun)
+{
+	os_lun_t	*lq;
+	uint16_t	tgt;
+	uint16_t	lun;
+
+	tgt = fcport->os_target_id;
+	lun = fclun->lun;
+
+	/* Allocate LUNs */
+	if (lun >= MAX_LUNS) {
+		DEBUG2(printk("scsi(%ld): Unable to bind lun, invalid "
+		    "lun=(%x).\n", ha->host_no, lun));
+		return (NULL);
+	}
+
+	/* Always alloc LUN 0 so kernel will scan past LUN 0. */
+	if (lun != 0 && (EXT_IS_LUN_BIT_SET(&(fcport->lun_mask), lun))) {
+		return (NULL);
+	}
+
+	if ((lq = qla2x00_lun_alloc(ha, tgt, lun)) == NULL) {
+		qla_printk(KERN_WARNING, ha,
+		    "Unable to bind fclun, loop_id=%x lun=%x\n",
+		    fcport->loop_id, lun);
+		return (NULL);
+	}
+
+	lq->fclun = fclun;
+
+	return (lq);
+}
+
+/*
+ * qla2x00_tgt_alloc
+ *	Allocate and pre-initialize target queue.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	t = SCSI target number.
+ *
+ * Returns:
+ *	NULL = failure
+ *
+ * Context:
+ *	Kernel context.
+ */
+os_tgt_t *
+qla2x00_tgt_alloc(scsi_qla_host_t *ha, uint16_t tgt) 
+{
+	os_tgt_t	*tq;
+
+	/*
+	 * If SCSI addressing OK, allocate TGT queue and lock.
+	 */
+	if (tgt >= MAX_TARGETS) {
+		DEBUG2(printk("scsi(%ld): Unable to allocate target, invalid "
+		    "target number %d.\n", ha->host_no, tgt));
+		return (NULL);
+	}
+
+	tq = TGT_Q(ha, tgt);
+	if (tq == NULL) {
+		tq = kmalloc(sizeof(os_tgt_t), GFP_ATOMIC);
+		if (tq != NULL) {
+			DEBUG2(printk("scsi(%ld): Alloc Target %d @ %p\n",
+			    ha->host_no, tgt, tq));
+
+			memset(tq, 0, sizeof(os_tgt_t));
+			tq->ha = ha;
+
+			TGT_Q(ha, tgt) = tq;
+		}
+	}
+	if (tq != NULL) {
+		tq->port_down_retry_count = ha->port_down_retry_count;
+	} else {
+		qla_printk(KERN_WARNING, ha,
+		    "Unable to allocate target.\n");
+		ha->mem_err++;
+	}
+
+	return (tq);
+}
+
+/*
+ * qla2x00_tgt_free
+ *	Frees target and LUN queues.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	t = SCSI target number.
+ *
+ * Context:
+ *	Kernel context.
+ */
+void
+qla2x00_tgt_free(scsi_qla_host_t *ha, uint16_t tgt) 
+{
+	os_tgt_t	*tq;
+	uint16_t	lun;
+
+	/*
+	 * If SCSI addressing OK, allocate TGT queue and lock.
+	 */
+	if (tgt >= MAX_TARGETS) {
+		DEBUG2(printk("scsi(%ld): Unable to de-allocate target, "
+		    "invalid target number %d.\n", ha->host_no, tgt));
+
+		return;
+	}
+
+	tq = TGT_Q(ha, tgt);
+	if (tq != NULL) {
+		TGT_Q(ha, tgt) = NULL;
+
+		/* Free LUN structures. */
+		for (lun = 0; lun < MAX_LUNS; lun++)
+			qla2x00_lun_free(ha, tgt, lun);
+
+		kfree(tq);
+	}
+
+	return;
+}
+
+/*
+ * qla2x00_lun_alloc
+ *	Allocate and initialize LUN queue.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	t = SCSI target number.
+ *	l = LUN number.
+ *
+ * Returns:
+ *	NULL = failure
+ *
+ * Context:
+ *	Kernel context.
+ */
+os_lun_t *
+qla2x00_lun_alloc(scsi_qla_host_t *ha, uint16_t tgt, uint16_t lun) 
+{
+	os_lun_t	*lq;
+
+	/*
+	 * If SCSI addressing OK, allocate LUN queue.
+	 */
+	if (tgt >= MAX_TARGETS || lun >= MAX_LUNS || TGT_Q(ha, tgt) == NULL) {
+		DEBUG2(printk("scsi(%ld): Unable to allocate lun, invalid "
+		    "parameter.\n", ha->host_no));
+
+		return (NULL);
+	}
+
+	lq = LUN_Q(ha, tgt, lun);
+	if (lq == NULL) {
+		lq = kmalloc(sizeof(os_lun_t), GFP_ATOMIC);
+		if (lq != NULL) {
+			DEBUG2(printk("scsi(%ld): Alloc Lun %d @ tgt %d.\n",
+			    ha->host_no, lun, tgt));
+
+			memset(lq, 0, sizeof (os_lun_t));
+			LUN_Q(ha, tgt, lun) = lq;
+
+			/*
+			 * The following lun queue initialization code
+			 * must be duplicated in alloc_ioctl_mem function
+			 * for ioctl_lq.
+			 */
+			lq->q_state = LUN_STATE_READY;
+			spin_lock_init(&lq->q_lock);
+		}
+	}
+
+	if (lq == NULL) {
+		qla_printk(KERN_WARNING, ha, "Unable to allocate lun.\n");
+	}
+
+	return (lq);
+}
+
+/*
+ * qla2x00_lun_free
+ *	Frees LUN queue.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	t = SCSI target number.
+ *
+ * Context:
+ *	Kernel context.
+ */
+static void
+qla2x00_lun_free(scsi_qla_host_t *ha, uint16_t tgt, uint16_t lun) 
+{
+	os_lun_t	*lq;
+
+	/*
+	 * If SCSI addressing OK, allocate TGT queue and lock.
+	 */
+	if (tgt >= MAX_TARGETS || lun >= MAX_LUNS) {
+		DEBUG2(printk("scsi(%ld): Unable to deallocate lun, invalid "
+		    "parameter.\n", ha->host_no));
+
+		return;
+	}
+
+	if (TGT_Q(ha, tgt) != NULL && (lq = LUN_Q(ha, tgt, lun)) != NULL) {
+		LUN_Q(ha, tgt, lun) = NULL;
+		kfree(lq);
+	}
+
+	return;
+}
+
+
+/*
+ * qla2x00_bstr_to_hex
+ *	Convert hex byte string to number.
+ *
+ * Input:
+ *	s = byte string pointer.
+ *	bp = byte pointer for number.
+ *	size = number of bytes.
+ *
+ * Context:
+ *	Kernel/Interrupt context.
+ */
+static int
+qla2x00_bstr_to_hex(char *s, uint8_t *bp, int size) 
+{
+	int		cnt;
+	uint8_t		n;
+
+	for (cnt = 0; *s != '\0' && cnt / 2 < size; cnt++) {
+		if (*s >= 'A' && *s <= 'F') {
+			n = (*s++ - 'A') + 10;
+		} else if (*s >= 'a' && *s <= 'f') {
+			n = (*s++ - 'a') + 10;
+		} else if (*s >= '0' && *s <= '9') {
+			n = *s++ - '0';
+		} else {
+			cnt = 0;
+			break;
+		}
+
+		if (cnt & BIT_0)
+			*bp++ |= n;
+		else
+			*bp = n << 4;
+	}
+
+	/* fixme(dg) Need to swap data little endian */
+
+	return (cnt / 2);
+}
+
+/*
+ * qla2x00_get_prop_xstr
+ *      Get a string property value for the specified property name and
+ *      convert from the property string found in the configuration file,
+ *      which are ASCII characters representing nibbles, 2 characters represent
+ *      the hexdecimal value for a byte in the byte array.
+ *      The byte array is initialized to zero.
+ *      The resulting converted value is in big endian format (MSB at byte0).
+ *
+ * Input:
+ *      ha = adapter state pointer.
+ *      propname = property name pointer.
+ *      propval  = pointer where to store converted property val.
+ *      size = max or expected size of 'propval' array.
+ *
+ * Returns:
+ *      0 = empty value string or invalid character in string
+ *      >0 = count of characters converted
+ *      -1 = property not found
+ *
+ * Context:
+ *      Kernel context.
+ */
+int
+qla2x00_get_prop_xstr(scsi_qla_host_t *ha, 
+		char *propname, uint8_t *propval, int size) 
+{
+	char		*propstr;
+	int		rval = -1;
+	static char	buf[LINESIZE];
+
+	/* Get the requested property string */
+	rval = qla2x00_find_propname(ha, propname, buf, ha->cmdline, size*2);
+	DEBUG3(printk("%s(): Ret rval from find propname = %d\n",
+			__func__,
+			rval);)
+
+	propstr = &buf[0];
+	if (*propstr == '=')
+		propstr++;   /* ignore equal sign */
+
+	if (rval == 0) {  /* not found */
+		LEAVE(__func__);
+		return (-1);
+	}
+
+	rval = qla2x00_bstr_to_hex(propstr, (uint8_t *)propval, size);
+	if (rval == 0) {
+		/* Invalid character in value string */
+		qla_printk(KERN_INFO, ha,
+			"%s(): %s Invalid hex string for property\n",
+			__func__,
+			propname);
+		qla_printk(KERN_INFO, ha,
+			" Invalid string - %s\n", 
+			propstr);
+	}
+
+	return (rval);
+}
+
+/*
+ * qla2x00_find_propname
+ *	Get property in database.
+ *
+ * Input:
+ *	ha = adapter structure pointer.
+ *      db = pointer to database
+ *      propstr = pointer to dest array for string
+ *	propname = name of property to search for.
+ *	siz = size of property
+ *
+ * Returns:
+ *	0 = no property
+ *      size = index of property
+ *
+ * Context:
+ *	Kernel context.
+ */
+static int
+qla2x00_find_propname(scsi_qla_host_t *ha, 
+			char *propname, char *propstr, 
+			char *db, int siz) 
+{
+	char	*cp;
+
+	/* find the specified string */
+	if (db) {
+		/* find the property name */
+		if ((cp = strstr(db,propname)) != NULL) {
+			while ((*cp)  && *cp != '=')
+				cp++;
+			if (*cp) {
+				strncpy(propstr, cp, siz+1);
+				propstr[siz+1] = '\0';
+				DEBUG(printk("qla2x00_find_propname: found "
+						"property = {%s}\n",
+						propstr);)
+				return (siz);   /* match */
+			}
+		}
+	}
+
+	return (0);
+}
+
+#if 0
+/*
+ * qla2x00_get_prop_16chars
+ *	Get an 8-byte property value for the specified property name by
+ *      converting from the property string found in the configuration file.
+ *      The resulting converted value is in big endian format (MSB at byte0).
+ *
+ * Input:
+ *	ha = adapter state pointer.
+ *	propname = property name pointer.
+ *	propval  = pointer to location for the converted property val.
+ *      db = pointer to database
+ *
+ * Returns:
+ *	0 = value returned successfully.
+ *
+ * Context:
+ *	Kernel context.
+ */
+static int
+qla2x00_get_prop_16chars(scsi_qla_host_t *ha,
+				char *propname, char *propval, char *db) 
+{
+	char		*propstr;
+	int		i, k;
+	int		rval;
+	uint8_t		nval;
+	uint8_t		*pchar;
+	uint8_t		*ret_byte;
+	uint8_t		*tmp_byte;
+	uint8_t		*retval = (uint8_t*)propval;
+	uint8_t		tmpval[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+	uint16_t	max_byte_cnt = 8; /* 16 chars = 8 bytes */
+	uint16_t	max_strlen = 16;
+	static char	buf[LINESIZE];
+
+	rval = qla2x00_find_propname(ha, propname, buf, db, max_strlen);
+
+	propstr = &buf[0];
+	if (*propstr == '=')
+		propstr++;   /* ignore equal sign */
+
+	if (rval == 0) {
+		return (1);
+	}
+
+	/* Convert string to numbers. */
+	pchar = (uint8_t *)propstr;
+	tmp_byte = (uint8_t *)tmpval;
+
+	rval = 0;
+	for (i = 0; i < max_strlen; i++) {
+		/*
+		 * Check for invalid character, two at a time,
+		 * then convert them starting with first byte.
+		 */
+
+		if ((pchar[i] >= '0') && (pchar[i] <= '9')) {
+			nval = pchar[i] - '0';
+		} else if ((pchar[i] >= 'A') && (pchar[i] <= 'F')) {
+			nval = pchar[i] - 'A' + 10;
+		} else if ((pchar[i] >= 'a') && (pchar[i] <= 'f')) {
+			nval = pchar[i] - 'a' + 10;
+		} else {
+			/* invalid character */
+			rval = 1;
+			break;
+		}
+
+		if (i & BIT_0) {
+			*tmp_byte = *tmp_byte | nval;
+			tmp_byte++;
+		} else {
+			*tmp_byte = *tmp_byte | nval << 4;
+		}
+	}
+
+	if (rval != 0) {
+		/* Encountered invalid character. */
+		return (rval);
+	}
+
+	/* Copy over the converted value. */
+	ret_byte = retval;
+	tmp_byte = tmpval;
+
+	i = max_byte_cnt;
+	k = 0;
+	while (i--) {
+		*ret_byte++ = *tmp_byte++;
+	}
+
+	/* big endian retval[0]; */
+	return (0);
+}
+
+/*
+* qla2x00_get_properties
+*	Find all properties for the specified adapeter in
+*      command line.
+*
+* Input:
+*	ha = adapter block pointer.
+*	cmdline = pointer to command line string
+*
+* Context:
+*	Kernel context.
+*/
+static void
+qla2x00_get_properties(scsi_qla_host_t *ha, char *cmdline) 
+{
+	int	rval;
+	static char propbuf[LINESIZE];
+	uint8_t fc_name[8];
+
+	/* Adapter FC node names. */
+	sprintf(propbuf, "scsi-qla%d-adapter-node", (int) ha->instance);
+	rval = qla2x00_get_prop_16chars(ha, propbuf, fc_name, cmdline);
+	if (rval == QLA_SUCCESS)
+		memcpy(ha->init_cb->node_name, fc_name, WWN_SIZE);
+
+	/* DG 04/07 check portname of adapter */
+	sprintf(propbuf, "scsi-qla%d-adapter-port", (int)ha->instance);
+	rval = qla2x00_get_prop_16chars(ha, propbuf, fc_name, cmdline);
+	if (rval == QLA_SUCCESS &&
+	    memcmp(ha->init_cb->port_name, fc_name, WWN_SIZE)) {
+		/*
+		 * Adapter port name is WWN, and cannot be changed.
+		 * Inform users of the mismatch, then just continue driver
+		 * loading using the original adapter port name in NVRAM.
+		 */
+		qla_printk(KERN_WARNING, ha,
+		    "Found mismatch in adapter port names.\n");
+		qla_printk(KERN_INFO, ha,
+		    "       qla%ld port name found in NVRAM -> "
+		    "%02x%02x%02x%02x%02x%02x%02x%02x\n",
+		    ha->instance,
+		    ha->init_cb->port_name[0],
+		    ha->init_cb->port_name[1],
+		    ha->init_cb->port_name[2],
+		    ha->init_cb->port_name[3],
+		    ha->init_cb->port_name[4],
+		    ha->init_cb->port_name[5],
+		    ha->init_cb->port_name[6],
+		    ha->init_cb->port_name[7]);
+		qla_printk(KERN_INFO, ha,
+		    "      qla%ld port name found on command line -> "
+		    "%02x%02x%02x%02x%02x%02x%02x%02x\n",
+		    ha->instance,
+		    fc_name[0], fc_name[1], fc_name[2], fc_name[3],
+		    fc_name[4], fc_name[5], fc_name[6], fc_name[7]);
+		qla_printk(KERN_INFO, ha,
+		    "      Using port name from NVRAM.\n");
+	}
+
+	qla2x00_cfg_persistent_binding(ha);
+}
+
+/*
+ * qla2x00_cfg_persistent_binding
+ *	Get driver configuration file target persistent binding entries.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *
+ * Context:
+ *	Kernel context.
+ */
+static void
+qla2x00_cfg_persistent_binding(scsi_qla_host_t *ha) 
+{
+	int		rval;
+	static char	propbuf[LINESIZE];
+	char		*cmdline = ha->cmdline;
+	uint16_t	tgt;
+	port_id_t	d_id;
+	uint8_t		portid[3];
+	uint8_t		port_name[8];
+
+	for (tgt = 0; tgt < MAX_TARGETS; tgt++) {
+		if (ha->binding_type == BIND_BY_PORT_ID) {
+			sprintf(propbuf, "scsi-qla%d-tgt-%d-di-0-pid",
+			    (int)ha->instance, tgt);
+			rval = qla2x00_get_prop_xstr(ha,
+			    propbuf, portid, sizeof(portid));
+			if (rval != sizeof(portid))
+				continue;
+			
+			memset(&d_id, 0, sizeof(port_id_t));
+			d_id.r.d_id[0] = portid[2];
+			d_id.r.d_id[1] = portid[1];
+			d_id.r.d_id[2] = portid[0];
+		} else {
+			sprintf(propbuf, "scsi-qla%d-tgt-%d-di-0-port",
+			    (int)ha->instance, tgt);
+			rval = qla2x00_get_prop_16chars(ha,
+			    propbuf, port_name, cmdline);
+			if (rval != QLA_SUCCESS)
+				continue;
+
+			/* Fallthru since port_name already populated */
+		}
+
+		/*
+		 * Create target context for device.
+		 */
+		if (ha->binding_type == BIND_BY_PORT_ID) {
+			qla2x00_persistent_bind(ha, NULL, NULL, &d_id, tgt);
+		} else {
+			qla2x00_persistent_bind(ha, NULL, port_name, NULL, tgt);
+		}
+	}
+}
+
+/*
+ * qla2x00_persistent_bind
+ *	Allocates target and fcport.
+ *
+ * Input:
+ *	ha:		adapter state pointer.
+ *	node_name:	node name pointer.
+ *	port_name:	port name pointer.
+ *	d_id:		port ID pointer.
+ *	tgt:		OS target number.
+ *
+ * Returns:
+ *	success = target queue pointer.
+ *	failure = NULL.
+ *
+ * Context:
+ *	Kernel context.
+ */
+static os_tgt_t *
+qla2x00_persistent_bind(scsi_qla_host_t *ha, uint8_t *node_name,
+    uint8_t *port_name, port_id_t *d_id, uint16_t tgt)
+{
+	os_tgt_t	*tq;
+	uint16_t	tgt2;
+
+	/*
+	 * Check for duplicates.
+	 */
+	for (tgt2 = 0; tgt2 < MAX_TARGETS; tgt2++) {
+		if ((tq = TGT_Q(ha, tgt2)) == NULL) {
+			continue;
+		}
+
+		if (ha->binding_type == BIND_BY_PORT_ID) {
+			if (tq->d_id.b24 != d_id->b24) {
+				continue;
+			}
+		} else if (memcmp(tq->port_name, port_name, WWN_SIZE) != 0) {
+			continue;
+		}
+
+		qla_printk(KERN_WARNING, ha,
+		    "Duplicate persistent bindings found for "
+		    "WWPN: %02x%02x%02x%02x%02x%02x%02x%02x.\n", 
+		    port_name[0], port_name[1], port_name[2], port_name[3],
+		    port_name[4], port_name[5], port_name[6], port_name[7]);
+
+		return (tq);
+	}
+
+	tq = qla2x00_tgt_alloc(ha, tgt);
+	if (tq == NULL) {
+		return (NULL);
+	}
+
+	if (node_name != NULL) {
+		memcpy(tq->node_name, node_name, WWN_SIZE);
+	}
+	if (port_name != NULL) {
+		memcpy(tq->port_name, port_name, WWN_SIZE);
+	}
+	if (d_id != NULL) {
+		tq->d_id.b24 = d_id->b24;
+	}
+
+	return (tq);
+}
+#endif
+
+/*
+*  qla2x00_abort_isp
+*      Resets ISP and aborts all outstanding commands.
+*
+* Input:
+*      ha           = adapter block pointer.
+*
+* Returns:
+*      0 = success
+*/
+int
+qla2x00_abort_isp(scsi_qla_host_t *ha)
+{
+	unsigned long flags = 0;
+	uint16_t       cnt;
+	srb_t          *sp;
+	uint8_t        status = 0;
+
+	ENTER("qla2x00_abort_isp");
+
+	if (ha->flags.online) {
+		ha->flags.online = FALSE;
+		clear_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+		qla2x00_stats.ispAbort++;
+		ha->total_isp_aborts++;  /* used by ioctl */
+		ha->sns_retry_cnt = 0;
+
+		qla_printk(KERN_INFO, ha,
+		    "Performing ISP error recovery - ha= %p.\n", ha);
+		qla2x00_reset_chip(ha);
+
+		if (atomic_read(&ha->loop_state) != LOOP_DOWN) {
+			atomic_set(&ha->loop_state, LOOP_DOWN);
+			atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME);
+			qla2x00_mark_all_devices_lost(ha);
+		}
+
+		spin_lock_irqsave(&ha->hardware_lock, flags);
+		/* Requeue all commands in outstanding command list. */
+		for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
+			sp = ha->outstanding_cmds[cnt];
+			if (sp) {
+				ha->outstanding_cmds[cnt] = 0;
+				if (ha->actthreads)
+					ha->actthreads--;
+				sp->lun_queue->out_cnt--;
+				sp->flags = 0;
+
+				/*
+				 * Set the cmd host_byte status depending on
+				 * whether the scsi_error_handler is
+				 * active or not.
+ 				 */
+				if (ha->host->eh_active != EH_ACTIVE) {
+					sp->cmd->result = DID_BUS_BUSY << 16;
+				} else {
+					sp->cmd->result = DID_RESET << 16;
+				}
+				sp->cmd->host_scribble = (unsigned char *)NULL;
+				add_to_done_queue(ha, sp);
+			}
+		}
+
+		spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+		qla2x00_nvram_config(ha);
+
+		if (!qla2x00_restart_isp(ha)) {
+			clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags);
+
+			if (!atomic_read(&ha->loop_down_timer)) {
+				/*
+				 * Issue marker command only when we are going
+				 * to start the I/O .
+				 */
+				ha->marker_needed = 1;
+			}
+
+			ha->flags.online = TRUE;
+
+			/* Enable ISP interrupts. */
+			qla2x00_enable_intrs(ha);
+
+			/* v2.19.5b6 Return all commands */
+			qla2x00_abort_queues(ha, TRUE);
+
+			/* Restart queues that may have been stopped. */
+			qla2x00_restart_queues(ha,TRUE);
+			ha->isp_abort_cnt = 0; 
+			clear_bit(ISP_ABORT_RETRY, &ha->dpc_flags);
+		} else {	/* failed the ISP abort */
+			ha->flags.online = TRUE;
+			if (test_bit(ISP_ABORT_RETRY, &ha->dpc_flags)) {
+				if (ha->isp_abort_cnt == 0) {
+ 					qla_printk(KERN_WARNING, ha,
+					    "ISP error recovery failed - "
+					    "board disabled\n");
+					/* 
+					 * The next call disables the board
+					 * completely.
+					 */
+					qla2x00_reset_adapter(ha);
+					qla2x00_abort_queues(ha, FALSE);
+					ha->flags.online = FALSE;
+					clear_bit(ISP_ABORT_RETRY,
+					    &ha->dpc_flags);
+					status = 0;
+				} else { /* schedule another ISP abort */
+					ha->isp_abort_cnt--;
+					DEBUG(printk("qla%ld: ISP abort - "
+					    "retry remainning %d\n",
+					    ha->host_no, ha->isp_abort_cnt);)
+					status = 1;
+				}
+			} else {
+				ha->isp_abort_cnt = MAX_RETRIES_OF_ISP_ABORT;
+				DEBUG(printk("qla2x00(%ld): ISP error recovery "
+				    "- retrying (%d) more times\n",
+				    ha->host_no, ha->isp_abort_cnt);)
+				set_bit(ISP_ABORT_RETRY, &ha->dpc_flags);
+				status = 1;
+			}
+		}
+		       
+	}
+
+	if (status) {
+		qla_printk(KERN_INFO, ha,
+			"qla2x00_abort_isp: **** FAILED ****\n");
+	} else {
+		DEBUG(printk(KERN_INFO
+				"qla2x00_abort_isp(%ld): exiting.\n",
+				ha->host_no);)
+	}
+
+	return(status);
+}
+
+/*
+*  qla2x00_restart_isp
+*      restarts the ISP after a reset
+*
+* Input:
+*      ha = adapter block pointer.
+*
+* Returns:
+*      0 = success
+*/
+static int
+qla2x00_restart_isp(scsi_qla_host_t *ha)
+{
+	uint8_t		status = 0;
+	device_reg_t	*reg;
+	unsigned long	flags = 0;
+
+	/* If firmware needs to be loaded */
+	if (qla2x00_isp_firmware(ha)) {
+		ha->flags.online = FALSE;
+		if (!(status = qla2x00_chip_diag(ha))) {
+			if (!IS_QLA23XX(ha)) {
+				status = qla2x00_setup_chip(ha);
+				goto done;
+			}
+
+			reg = ha->iobase;
+			spin_lock_irqsave(&ha->hardware_lock, flags);
+			/* Disable SRAM, Instruction RAM and GP RAM parity. */
+			WRT_REG_WORD(&reg->hccr, (HCCR_ENABLE_PARITY + 0x0));
+			spin_unlock_irqrestore(&ha->hardware_lock, flags);
+	
+			status = qla2x00_setup_chip(ha);
+
+			spin_lock_irqsave(&ha->hardware_lock, flags);
+ 
+ 			/* Enable proper parity */
+ 			if (IS_QLA2312(ha) || IS_QLA2322(ha))
+ 				/* SRAM, Instruction RAM and GP RAM parity */
+ 				WRT_REG_WORD(&reg->hccr,
+ 				    (HCCR_ENABLE_PARITY + 0x7));
+ 			else
+ 				/* SRAM parity */
+ 				WRT_REG_WORD(&reg->hccr,
+ 				    (HCCR_ENABLE_PARITY + 0x1));
+
+			spin_unlock_irqrestore(&ha->hardware_lock, flags);
+		}
+	}
+
+ done:
+	if (!status && !(status = qla2x00_init_rings(ha))) {
+		clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags);
+		if (!(status = qla2x00_fw_ready(ha))) {
+			DEBUG(printk("%s(): Start configure loop, "
+					"status = %d\n",
+					__func__,
+					status);)
+			ha->flags.online = TRUE;
+			do {
+				clear_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags);
+				qla2x00_configure_loop(ha);
+			} while (!atomic_read(&ha->loop_down_timer) &&
+				!(test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags)) &&
+				(test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)));
+		}
+
+		/* if no cable then assume it's good */
+		if ((ha->device_flags & DFLG_NO_CABLE)) 
+			status = 0;
+
+		DEBUG(printk("%s(): Configure loop done, status = 0x%x\n",
+				__func__,
+				status);)
+	}
+	return (status);
+}
+
+/*
+* qla2x00_reset_adapter
+*      Reset adapter.
+*
+* Input:
+*      ha = adapter block pointer.
+*/
+static void
+qla2x00_reset_adapter(scsi_qla_host_t *ha)
+{
+	unsigned long flags = 0;
+	device_reg_t *reg = ha->iobase;
+
+	ENTER(__func__);
+
+	ha->flags.online = FALSE;
+	qla2x00_disable_intrs(ha);
+	/* Reset RISC processor. */
+	spin_lock_irqsave(&ha->hardware_lock, flags);
+	WRT_REG_WORD(&reg->hccr, HCCR_RESET_RISC);
+	WRT_REG_WORD(&reg->hccr, HCCR_RELEASE_RISC);
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+	LEAVE(__func__);
+}
diff -Nru a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/qla_inline.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,242 @@
+/*
+ *                  QLOGIC LINUX SOFTWARE
+ *
+ * QLogic ISP2x00 device driver for Linux 2.6.x
+ * Copyright (C) 2003 QLogic Corporation
+ * (www.qlogic.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+
+static __inline__ uint16_t qla2x00_debounce_register(volatile uint16_t *);
+/*
+ * qla2x00_debounce_register
+ *      Debounce register.
+ *
+ * Input:
+ *      port = register address.
+ *
+ * Returns:
+ *      register value.
+ */
+static __inline__ uint16_t
+qla2x00_debounce_register(volatile uint16_t *addr) 
+{
+	volatile uint16_t first;
+	volatile uint16_t second;
+
+	do {
+		first = RD_REG_WORD(addr);
+		barrier();
+		cpu_relax();
+		second = RD_REG_WORD(addr);
+	} while (first != second);
+
+	return (first);
+}
+
+static __inline__ int qla2x00_normalize_dma_addr(
+    dma_addr_t *e_addr,  uint32_t *e_len,
+    dma_addr_t *ne_addr, uint32_t *ne_len);
+
+/**
+ * qla2x00_normalize_dma_addr() - Normalize an DMA address.
+ * @e_addr: Raw DMA address
+ * @e_len: Raw DMA length
+ * @ne_addr: Normalized second DMA address
+ * @ne_len: Normalized second DMA length
+ *
+ * If the address does not span a 4GB page boundary, the contents of @ne_addr
+ * and @ne_len are undefined.  @e_len is updated to reflect a normalization.
+ *
+ * Example:
+ *
+ * 	ffffabc0ffffeeee	(e_addr) start of DMA address
+ * 	0000000020000000	(e_len)  length of DMA transfer
+ *	ffffabc11fffeeed	end of DMA transfer
+ *
+ * Is the 4GB boundary crossed?
+ *
+ * 	ffffabc0ffffeeee	(e_addr)
+ *	ffffabc11fffeeed	(e_addr + e_len - 1)
+ *	00000001e0000003	((e_addr ^ (e_addr + e_len - 1))
+ *	0000000100000000	((e_addr ^ (e_addr + e_len - 1)) & ~(0xffffffff)
+ *
+ * Compute start of second DMA segment:
+ *
+ * 	ffffabc0ffffeeee	(e_addr)
+ *	ffffabc1ffffeeee	(0x100000000 + e_addr)
+ *	ffffabc100000000	(0x100000000 + e_addr) & ~(0xffffffff)
+ *	ffffabc100000000	(ne_addr)
+ *	
+ * Compute length of second DMA segment:
+ *
+ *	00000000ffffeeee	(e_addr & 0xffffffff)
+ *	0000000000001112	(0x100000000 - (e_addr & 0xffffffff))
+ *	000000001fffeeee	(e_len - (0x100000000 - (e_addr & 0xffffffff))
+ *	000000001fffeeee	(ne_len)
+ *
+ * Adjust length of first DMA segment
+ *
+ * 	0000000020000000	(e_len)
+ *	0000000000001112	(e_len - ne_len)
+ *	0000000000001112	(e_len)
+ *
+ * Returns non-zero if the specified address was normalized, else zero.
+ */
+static __inline__ int
+qla2x00_normalize_dma_addr(
+    dma_addr_t *e_addr,  uint32_t *e_len,
+    dma_addr_t *ne_addr, uint32_t *ne_len)
+{
+	int normalized;
+
+	normalized = 0;
+	if ((*e_addr ^ (*e_addr + *e_len - 1)) & ~(0xFFFFFFFFULL)) {
+		/* Compute normalized crossed address and len */
+		*ne_addr = (0x100000000ULL + *e_addr) & ~(0xFFFFFFFFULL);
+		*ne_len = *e_len - (0x100000000ULL - (*e_addr & 0xFFFFFFFFULL));
+		*e_len -= *ne_len;
+
+		normalized++;
+	}
+	return (normalized);
+}
+
+static __inline__ void qla2x00_poll(scsi_qla_host_t *);
+static inline void 
+qla2x00_poll(scsi_qla_host_t *ha)
+{
+	qla2x00_intr_handler(0, ha, NULL);
+}
+
+
+static __inline__ void qla2x00_enable_intrs(scsi_qla_host_t *);
+static __inline__ void qla2x00_disable_intrs(scsi_qla_host_t *);
+
+static inline void 
+qla2x00_enable_intrs(scsi_qla_host_t *ha)
+{
+	unsigned long flags = 0;
+	device_reg_t *reg;
+
+	spin_lock_irqsave(&ha->hardware_lock, flags);
+	reg = ha->iobase;
+	ha->interrupts_on = 1;
+	/* enable risc and host interrupts */
+	WRT_REG_WORD(&reg->ictrl, ICR_EN_INT | ICR_EN_RISC);
+	RD_REG_WORD(&reg->ictrl);
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+}
+
+static inline void 
+qla2x00_disable_intrs(scsi_qla_host_t *ha)
+{
+	unsigned long flags = 0;
+	device_reg_t *reg;
+
+	spin_lock_irqsave(&ha->hardware_lock, flags);
+	reg = ha->iobase;
+	ha->interrupts_on = 0;
+	/* disable risc and host interrupts */
+	WRT_REG_WORD(&reg->ictrl, 0);
+	RD_REG_WORD(&reg->ictrl);
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
+}
+
+
+static __inline__ int qla2x00_is_wwn_zero(uint8_t *);
+
+/*
+ * qla2x00_is_wwn_zero - Check for zero node name
+ *
+ * Input:
+ *      wwn = Pointer to WW name to check
+ *
+ * Returns:
+ *      TRUE if name is 0 else FALSE
+ *
+ * Context:
+ *      Kernel context.
+ */
+static __inline__ int
+qla2x00_is_wwn_zero(uint8_t *wwn)
+{
+	int cnt;
+
+	for (cnt = 0; cnt < WWN_SIZE ; cnt++, wwn++) {
+		if (*wwn != 0)
+			break;
+	}
+	/* if zero return TRUE */
+	if (cnt == WWN_SIZE)
+		return (1);
+	else
+		return (0);
+}
+
+static __inline__ uint8_t
+qla2x00_suspend_lun(scsi_qla_host_t *, os_lun_t *, int, int);
+static __inline__ uint8_t
+qla2x00_delay_lun(scsi_qla_host_t *, os_lun_t *, int);
+
+static __inline__ uint8_t
+qla2x00_suspend_lun(scsi_qla_host_t *ha, os_lun_t *lq, int time, int count)
+{
+	return (__qla2x00_suspend_lun(ha, lq, time, count, 0));
+}
+
+static __inline__ uint8_t
+qla2x00_delay_lun(scsi_qla_host_t *ha, os_lun_t *lq, int time)
+{
+	return (__qla2x00_suspend_lun(ha, lq, time, 1, 1));
+}
+
+static __inline__ void qla2x00_check_fabric_devices(scsi_qla_host_t *);
+/*
+ * This routine will wait for fabric devices for
+ * the reset delay.
+ */
+static __inline__ void qla2x00_check_fabric_devices(scsi_qla_host_t *ha) 
+{
+	uint16_t	fw_state;
+
+	qla2x00_get_firmware_state(ha, &fw_state);
+}
+
+/**
+ * qla2x00_issue_marker() - Issue a Marker IOCB if necessary.
+ * @ha: HA context
+ * @ha_locked: is function called with the hardware lock
+ *
+ * Returns non-zero if a failure occured, else zero.
+ */
+static inline int
+qla2x00_issue_marker(scsi_qla_host_t *ha, int ha_locked)
+{
+	/* Send marker if required */
+	if (ha->marker_needed != 0) {
+		if (ha_locked) {
+			if (__qla2x00_marker(ha, 0, 0, MK_SYNC_ALL) !=
+			    QLA_SUCCESS)
+				return (QLA_FUNCTION_FAILED);
+		} else {
+			if (qla2x00_marker(ha, 0, 0, MK_SYNC_ALL) !=
+			    QLA_SUCCESS)
+				return (QLA_FUNCTION_FAILED);
+		}
+		ha->marker_needed = 0;
+	}
+	return (QLA_SUCCESS);
+}
diff -Nru a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/qla_iocb.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,764 @@
+/******************************************************************************
+ *                  QLOGIC LINUX SOFTWARE
+ *
+ * QLogic ISP2x00 device driver for Linux 2.6.x
+ * Copyright (C) 2003 QLogic Corporation
+ * (www.qlogic.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ ******************************************************************************/
+
+#include "qla_os.h"
+#include "qla_def.h"
+
+static inline uint16_t qla2x00_get_cmd_direction(struct scsi_cmnd *cmd);
+static inline cont_entry_t *qla2x00_prep_cont_type0_iocb(scsi_qla_host_t *);
+static inline cont_a64_entry_t *qla2x00_prep_cont_type1_iocb(scsi_qla_host_t *);
+
+/**
+ * qla2x00_get_cmd_direction() - Determine control_flag data direction.
+ * @cmd: SCSI command
+ *
+ * Returns the proper CF_* direction based on CDB.
+ */
+static inline uint16_t
+qla2x00_get_cmd_direction(struct scsi_cmnd *cmd)
+{
+	uint16_t cflags;
+
+	cflags = 0;
+
+	/* Set transfer direction */
+	if (cmd->sc_data_direction == DMA_TO_DEVICE)
+		cflags = CF_WRITE;
+	else if (cmd->sc_data_direction == DMA_FROM_DEVICE)
+		cflags = CF_READ;
+	else {
+		switch (cmd->data_cmnd[0]) {
+		case WRITE_6:
+		case WRITE_10:
+		case WRITE_12:
+		case WRITE_BUFFER:
+		case WRITE_LONG:
+		case WRITE_SAME:
+		case WRITE_VERIFY:
+		case WRITE_VERIFY_12:
+		case FORMAT_UNIT:
+		case SEND_VOLUME_TAG:
+		case MODE_SELECT:
+		case SEND_DIAGNOSTIC:
+		case MODE_SELECT_10:
+			cflags = CF_WRITE;
+			break;
+		default:
+			cflags = CF_READ;
+			break;
+		}
+	}
+	return (cflags);
+}
+
+/**
+ * qla2x00_calc_iocbs_32() - Determine number of Command Type 2 and
+ * Continuation Type 0 IOCBs to allocate.
+ *
+ * @dsds: number of data segment decriptors needed
+ *
+ * Returns the number of IOCB entries needed to store @dsds.
+ */
+uint16_t
+qla2x00_calc_iocbs_32(uint16_t dsds)
+{
+	uint16_t iocbs;
+
+	iocbs = 1;
+	if (dsds > 3) {
+		iocbs += (dsds - 3) / 7;
+		if ((dsds - 3) % 7)
+			iocbs++;
+	}
+	return (iocbs);
+}
+
+/**
+ * qla2x00_calc_iocbs_64() - Determine number of Command Type 3 and
+ * Continuation Type 1 IOCBs to allocate.
+ *
+ * @dsds: number of data segment decriptors needed
+ *
+ * Returns the number of IOCB entries needed to store @dsds.
+ */
+uint16_t
+qla2x00_calc_iocbs_64(uint16_t dsds)
+{
+	uint16_t iocbs;
+
+	iocbs = 1;
+	if (dsds > 2) {
+		iocbs += (dsds - 2) / 5;
+		if ((dsds - 2) % 5)
+			iocbs++;
+	}
+	return (iocbs);
+}
+
+/**
+ * qla2x00_prep_cont_type0_iocb() - Initialize a Continuation Type 0 IOCB.
+ * @ha: HA context
+ *
+ * Returns a pointer to the Continuation Type 0 IOCB packet.
+ */
+static inline cont_entry_t *
+qla2x00_prep_cont_type0_iocb(scsi_qla_host_t *ha)
+{
+	cont_entry_t *cont_pkt;
+
+	/* Adjust ring index. */
+	ha->req_ring_index++;
+	if (ha->req_ring_index == REQUEST_ENTRY_CNT) {
+		ha->req_ring_index = 0;
+		ha->request_ring_ptr = ha->request_ring;
+	} else {
+		ha->request_ring_ptr++;
+	}
+
+	cont_pkt = (cont_entry_t *)ha->request_ring_ptr;
+
+	/* Load packet defaults. */
+	*((uint32_t *)(&cont_pkt->entry_type)) =
+	    __constant_cpu_to_le32(CONTINUE_TYPE);
+
+	return (cont_pkt);
+}
+
+/**
+ * qla2x00_prep_cont_type1_iocb() - Initialize a Continuation Type 1 IOCB.
+ * @ha: HA context
+ *
+ * Returns a pointer to the continuation type 1 IOCB packet.
+ */
+static inline cont_a64_entry_t *
+qla2x00_prep_cont_type1_iocb(scsi_qla_host_t *ha)
+{
+	cont_a64_entry_t *cont_pkt;
+
+	/* Adjust ring index. */
+	ha->req_ring_index++;
+	if (ha->req_ring_index == REQUEST_ENTRY_CNT) {
+		ha->req_ring_index = 0;
+		ha->request_ring_ptr = ha->request_ring;
+	} else {
+		ha->request_ring_ptr++;
+	}
+
+	cont_pkt = (cont_a64_entry_t *)ha->request_ring_ptr;
+
+	/* Load packet defaults. */
+	*((uint32_t *)(&cont_pkt->entry_type)) =
+	    __constant_cpu_to_le32(CONTINUE_A64_TYPE);
+
+	return (cont_pkt);
+}
+
+/**
+ * qla2x00_build_scsi_iocbs_32() - Build IOCB command utilizing 32bit
+ * capable IOCB types.
+ *
+ * @sp: SRB command to process
+ * @cmd_pkt: Command type 2 IOCB
+ * @tot_dsds: Total number of segments to transfer
+ */
+void qla2x00_build_scsi_iocbs_32(srb_t *sp, cmd_entry_t *cmd_pkt,
+    uint16_t tot_dsds)
+{
+	uint16_t	avail_dsds;
+	uint32_t	*cur_dsd;
+	scsi_qla_host_t	*ha;
+	struct scsi_cmnd *cmd;
+
+	cmd = sp->cmd;
+
+	/* Update entry type to indicate Command Type 2 IOCB */
+	*((uint32_t *)(&cmd_pkt->entry_type)) =
+	    __constant_cpu_to_le32(COMMAND_TYPE);
+
+	/* No data transfer */
+	if (cmd->request_bufflen == 0 || cmd->sc_data_direction == DMA_NONE) {
+		cmd_pkt->byte_count = __constant_cpu_to_le32(0);
+		return;
+	}
+
+	ha = sp->ha;
+
+	cmd_pkt->control_flags |= cpu_to_le16(qla2x00_get_cmd_direction(cmd));
+
+	/* Three DSDs are available in the Command Type 2 IOCB */
+	avail_dsds = 3;
+	cur_dsd = (uint32_t *)&cmd_pkt->dseg_0_address;
+
+	/* Load data segments */
+	if (cmd->use_sg != 0) {
+		struct	scatterlist *cur_seg;
+		struct	scatterlist *end_seg;
+
+		cur_seg = (struct scatterlist *)cmd->request_buffer;
+		end_seg = cur_seg + tot_dsds;
+		while (cur_seg < end_seg) {
+			cont_entry_t	*cont_pkt;
+
+			/* Allocate additional continuation packets? */
+			if (avail_dsds == 0) {
+				/*
+				 * Seven DSDs are available in the Continuation
+				 * Type 0 IOCB.
+				 */
+				cont_pkt = qla2x00_prep_cont_type0_iocb(ha);
+				cur_dsd = (uint32_t *)&cont_pkt->dseg_0_address;
+				avail_dsds = 7;
+			}
+
+			*cur_dsd++ = cpu_to_le32(sg_dma_address(cur_seg));
+			*cur_dsd++ = cpu_to_le32(sg_dma_len(cur_seg));
+			avail_dsds--;
+
+			cur_seg++;
+		}
+	} else {
+		dma_addr_t	req_dma;
+		struct page	*page;
+		unsigned long	offset;
+
+		page = virt_to_page(cmd->request_buffer);
+		offset = ((unsigned long)cmd->request_buffer & ~PAGE_MASK);
+		req_dma = pci_map_page(ha->pdev, page, offset,
+		    cmd->request_bufflen, cmd->sc_data_direction);
+
+		sp->dma_handle = req_dma;
+
+		*cur_dsd++ = cpu_to_le32(req_dma);
+		*cur_dsd++ = cpu_to_le32(cmd->request_bufflen);
+	}
+}
+
+/**
+ * qla2x00_build_scsi_iocbs_64() - Build IOCB command utilizing 64bit
+ * capable IOCB types.
+ *
+ * @sp: SRB command to process
+ * @cmd_pkt: Command type 3 IOCB
+ * @tot_dsds: Total number of segments to transfer
+ */
+void qla2x00_build_scsi_iocbs_64(srb_t *sp, cmd_entry_t *cmd_pkt,
+    uint16_t tot_dsds)
+{
+	uint16_t	avail_dsds;
+	uint32_t	*cur_dsd;
+	scsi_qla_host_t	*ha;
+	struct scsi_cmnd *cmd;
+
+	cmd = sp->cmd;
+
+	/* Update entry type to indicate Command Type 3 IOCB */
+	*((uint32_t *)(&cmd_pkt->entry_type)) =
+	    __constant_cpu_to_le32(COMMAND_A64_TYPE);
+
+	/* No data transfer */
+	if (cmd->request_bufflen == 0 || cmd->sc_data_direction == DMA_NONE) {
+		cmd_pkt->byte_count = __constant_cpu_to_le32(0);
+		return;
+	}
+
+	ha = sp->ha;
+
+	cmd_pkt->control_flags |= cpu_to_le16(qla2x00_get_cmd_direction(cmd));
+
+	/* Two DSDs are available in the Command Type 3 IOCB */
+	avail_dsds = 2;
+	cur_dsd = (uint32_t *)&cmd_pkt->dseg_0_address;
+
+	/* Load data segments */
+	if (cmd->use_sg != 0) {
+		struct	scatterlist *cur_seg;
+		struct	scatterlist *end_seg;
+
+		cur_seg = (struct scatterlist *)cmd->request_buffer;
+		end_seg = cur_seg + tot_dsds;
+		while (cur_seg < end_seg) {
+			dma_addr_t	sle_dma;
+			cont_a64_entry_t *cont_pkt;
+
+			/* Allocate additional continuation packets? */
+			if (avail_dsds == 0) {
+				/*
+				 * Five DSDs are available in the Continuation
+				 * Type 1 IOCB.
+				 */
+				cont_pkt = qla2x00_prep_cont_type1_iocb(ha);
+				cur_dsd = (uint32_t *)cont_pkt->dseg_0_address;
+				avail_dsds = 5;
+			}
+
+			sle_dma = sg_dma_address(cur_seg);
+			*cur_dsd++ = cpu_to_le32(LSD(sle_dma));
+			*cur_dsd++ = cpu_to_le32(MSD(sle_dma));
+			*cur_dsd++ = cpu_to_le32(sg_dma_len(cur_seg));
+			avail_dsds--;
+
+			cur_seg++;
+		}
+	} else {
+		dma_addr_t	req_dma;
+		struct page	*page;
+		unsigned long	offset;
+
+		page = virt_to_page(cmd->request_buffer);
+		offset = ((unsigned long)cmd->request_buffer & ~PAGE_MASK);
+		req_dma = pci_map_page(ha->pdev, page, offset,
+		    cmd->request_bufflen, cmd->sc_data_direction);
+
+		sp->dma_handle = req_dma;
+
+		*cur_dsd++ = cpu_to_le32(LSD(req_dma));
+		*cur_dsd++ = cpu_to_le32(MSD(req_dma));
+		*cur_dsd++ = cpu_to_le32(cmd->request_bufflen);
+	}
+}
+
+/**
+ * qla2x00_start_scsi() - Send a SCSI command to the ISP
+ * @sp: command to send to the ISP
+ *
+ * Returns non-zero if a failure occured, else zero.
+ */
+int
+qla2x00_start_scsi(srb_t *sp)
+{
+	int		ret;
+	unsigned long   flags;
+	scsi_qla_host_t	*ha;
+	fc_lun_t	*fclun;
+	struct scsi_cmnd *cmd;
+	uint32_t	*clr_ptr;
+	uint32_t        index;
+	uint32_t	handle;
+	uint16_t	cnt, tot_dsds, req_cnt;
+	cmd_entry_t	*cmd_pkt;
+	uint32_t        timeout;
+	struct scatterlist *sg;
+
+	device_reg_t	*reg;
+
+	/* Setup device pointers. */
+	ret = 0;
+	fclun = sp->lun_queue->fclun;
+	ha = fclun->fcport->ha;
+	cmd = sp->cmd;
+	reg = ha->iobase;
+
+	/* Send marker if required */
+	if (ha->marker_needed != 0) {
+		if (qla2x00_marker(ha, 0, 0, MK_SYNC_ALL) != QLA_SUCCESS) {
+			return (QLA_FUNCTION_FAILED);
+		}
+		ha->marker_needed = 0;
+	}
+
+	/* Calculate number of segments and entries required */
+	tot_dsds = 0;
+	if (cmd->use_sg) {
+		sg = (struct scatterlist *) cmd->request_buffer;
+		tot_dsds = pci_map_sg(ha->pdev, sg, cmd->use_sg,
+		    cmd->sc_data_direction);
+	} else if (cmd->request_bufflen) {   /* Single segment transfer */
+		tot_dsds++;
+	}
+	req_cnt = (ha->calc_request_entries)(tot_dsds);
+
+	/* Acquire ring specific lock */
+	spin_lock_irqsave(&ha->hardware_lock, flags);
+
+	if (ha->req_q_cnt < (req_cnt + 2)) {
+		/* Calculate number of free request entries */
+		cnt = RD_REG_WORD(ISP_REQ_Q_OUT(ha, reg));
+		if (ha->req_ring_index < cnt)
+			ha->req_q_cnt = cnt - ha->req_ring_index;
+		else
+			ha->req_q_cnt = REQUEST_ENTRY_CNT -
+			    (ha->req_ring_index - cnt);
+	}
+
+	/* If no room for request in request ring */
+	if (ha->req_q_cnt < (req_cnt + 2)) {
+		DEBUG5(printk("scsi(%ld): in-ptr=%x req_q_cnt=%x "
+		    "tot_dsds=%x.\n",
+		    ha->host_no, ha->req_ring_index, ha->req_q_cnt, tot_dsds));
+
+		goto queuing_error;
+	}
+
+	/* Check for room in outstanding command list. */
+	handle = ha->current_outstanding_cmd;
+	for (index = 1; index < MAX_OUTSTANDING_COMMANDS; index++) {
+		handle++;
+		if (handle == MAX_OUTSTANDING_COMMANDS)
+			handle = 1;
+		if (ha->outstanding_cmds[handle] == 0) {
+			ha->current_outstanding_cmd = handle;
+			break;
+		}
+	}
+	if (index == MAX_OUTSTANDING_COMMANDS) {
+		DEBUG5(printk("scsi(%ld): Unable to queue command -- NO ROOM "
+		    "IN OUTSTANDING ARRAY (req_q_cnt=%x).\n",
+		    ha->host_no, ha->req_q_cnt));
+		goto queuing_error;
+	}
+
+	/* Build command packet */
+	ha->outstanding_cmds[handle] = sp;
+	sp->ha = ha;
+	sp->cmd->host_scribble = (unsigned char *)(unsigned long)handle;
+	ha->req_q_cnt -= req_cnt;
+
+	cmd_pkt = (cmd_entry_t *)ha->request_ring_ptr;
+	cmd_pkt->handle = handle;
+	/* Zero out remaining portion of packet. */
+	clr_ptr = (uint32_t *)cmd_pkt + 2;
+	memset(clr_ptr, 0, REQUEST_ENTRY_SIZE - 8);
+	cmd_pkt->dseg_count = cpu_to_le16(tot_dsds);
+
+	/* Set target ID */
+	SET_TARGET_ID(ha, cmd_pkt->target, fclun->fcport->loop_id);
+
+	/* Set LUN number*/
+	cmd_pkt->lun = cpu_to_le16(fclun->lun);
+
+	/* Update tagged queuing modifier */
+	cmd_pkt->control_flags = __constant_cpu_to_le16(CF_SIMPLE_TAG);
+	if (cmd->device->tagged_supported) {
+		switch (cmd->tag) {
+		case HEAD_OF_QUEUE_TAG:
+			cmd_pkt->control_flags =
+			    __constant_cpu_to_le16(CF_HEAD_TAG);
+			break;
+		case ORDERED_QUEUE_TAG:
+			cmd_pkt->control_flags =
+			    __constant_cpu_to_le16(CF_ORDERED_TAG);
+			break;
+		}
+	}
+
+	/*
+	 * Allocate at least 5 (+ QLA_CMD_TIMER_DELTA) seconds for RISC timeout.
+	 */
+	timeout = (uint32_t)(cmd->timeout_per_command / HZ);
+	if (timeout > 65535)
+		cmd_pkt->timeout = __constant_cpu_to_le16(0);
+	else if (timeout > 25)
+		cmd_pkt->timeout = cpu_to_le16((uint16_t)timeout -
+		    (5 + QLA_CMD_TIMER_DELTA));
+	else
+		cmd_pkt->timeout = cpu_to_le16((uint16_t)timeout);
+
+	/* Load SCSI command packet. */
+	memcpy(cmd_pkt->scsi_cdb, cmd->cmnd, cmd->cmd_len);
+	cmd_pkt->byte_count = cpu_to_le32((uint32_t)cmd->request_bufflen);
+
+	/* Build IOCB segments */
+	(ha->build_scsi_iocbs)(sp, cmd_pkt, tot_dsds);
+
+	/* Set total data segment count. */
+	cmd_pkt->entry_count = (uint8_t)req_cnt;
+
+	/* Adjust ring index. */
+	ha->req_ring_index++;
+	if (ha->req_ring_index == REQUEST_ENTRY_CNT) {
+		ha->req_ring_index = 0;
+		ha->request_ring_ptr = ha->request_ring;
+	} else
+		ha->request_ring_ptr++;
+
+	ha->actthreads++;
+	ha->total_ios++;
+	sp->lun_queue->out_cnt++;
+	sp->flags |= SRB_DMA_VALID;
+	sp->state = SRB_ACTIVE_STATE;
+	sp->u_start = jiffies;
+
+	/* Set chip new ring index. */
+	WRT_REG_WORD(ISP_REQ_Q_IN(ha, reg), ha->req_ring_index);
+	RD_REG_WORD(ISP_REQ_Q_IN(ha, reg));	/* PCI Posting. */
+
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
+	return (QLA_SUCCESS);
+
+queuing_error:
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+	if (cmd->use_sg)
+		pci_unmap_sg(ha->pdev, sg, cmd->use_sg, cmd->sc_data_direction);
+
+	return (QLA_FUNCTION_FAILED);
+}
+
+/**
+ * qla2x00_marker() - Send a marker IOCB to the firmware.
+ * @ha: HA context
+ * @loop_id: loop ID
+ * @lun: LUN
+ * @type: marker modifier
+ *
+ * Can be called from both normal and interrupt context.
+ *
+ * Returns non-zero if a failure occured, else zero.
+ */
+int
+__qla2x00_marker(scsi_qla_host_t *ha, uint16_t loop_id, uint16_t lun,
+    uint8_t type)
+{
+	mrk_entry_t	*pkt;
+
+	ENTER(__func__);
+
+	pkt = (mrk_entry_t *)qla2x00_req_pkt(ha);
+	if (pkt == NULL) {
+		DEBUG2_3(printk("%s(): **** FAILED ****\n", __func__));
+
+		return (QLA_FUNCTION_FAILED);
+	}
+
+	pkt->entry_type = MARKER_TYPE;
+	pkt->modifier = type;
+
+	if (type != MK_SYNC_ALL) {
+		pkt->lun = cpu_to_le16(lun);
+		SET_TARGET_ID(ha, pkt->target, loop_id);
+	}
+
+	/* Issue command to ISP */
+	qla2x00_isp_cmd(ha);
+
+	LEAVE(__func__);
+
+	return (QLA_SUCCESS);
+}
+
+int 
+qla2x00_marker(scsi_qla_host_t *ha, uint16_t loop_id, uint16_t lun,
+    uint8_t type)
+{
+	int ret;
+	unsigned long flags = 0;
+
+	spin_lock_irqsave(&ha->hardware_lock, flags);
+	ret = __qla2x00_marker(ha, loop_id, lun, type);
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+	return (ret);
+}
+
+/**
+ * qla2x00_req_pkt() - Retrieve a request packet from the request ring.
+ * @ha: HA context
+ *
+ * Note: The caller must hold the hardware lock before calling this routine.
+ *
+ * Returns NULL if function failed, else, a pointer to the request packet.
+ */
+request_t *
+qla2x00_req_pkt(scsi_qla_host_t *ha)
+{
+	device_reg_t	*reg = ha->iobase;
+	request_t	*pkt = NULL;
+	uint16_t	cnt;
+	uint32_t	*dword_ptr;
+	uint32_t	timer;
+	uint16_t	req_cnt = 1;
+
+	ENTER(__func__);
+
+	/* Wait 1 second for slot. */
+	for (timer = HZ; timer; timer--) {
+		if ((req_cnt + 2) >= ha->req_q_cnt) {
+			/* Calculate number of free request entries. */
+			cnt = qla2x00_debounce_register(ISP_REQ_Q_OUT(ha, reg));
+			if  (ha->req_ring_index < cnt)
+				ha->req_q_cnt = cnt - ha->req_ring_index;
+			else
+				ha->req_q_cnt = REQUEST_ENTRY_CNT -
+				    (ha->req_ring_index - cnt);
+		}
+		/* If room for request in request ring. */
+		if ((req_cnt + 2) < ha->req_q_cnt) {
+			ha->req_q_cnt--;
+			pkt = ha->request_ring_ptr;
+
+			/* Zero out packet. */
+			dword_ptr = (uint32_t *)pkt;
+			for (cnt = 0; cnt < REQUEST_ENTRY_SIZE / 4; cnt++)
+				*dword_ptr++ = 0;
+
+			/* Set system defined field. */
+			pkt->sys_define = (uint8_t)ha->req_ring_index;
+
+			/* Set entry count. */
+			pkt->entry_count = 1;
+
+			break;
+		}
+
+		/* Release ring specific lock */
+		spin_unlock(&ha->hardware_lock);
+
+		udelay(2);   /* 2 us */
+
+		/* Check for pending interrupts. */
+		/* During init we issue marker directly */
+		if (!ha->marker_needed)
+			qla2x00_poll(ha);
+
+		spin_lock_irq(&ha->hardware_lock);
+	}
+	if (!pkt) {
+		DEBUG2_3(printk("%s(): **** FAILED ****\n", __func__));
+	}
+
+	LEAVE(__func__);
+
+	return (pkt);
+}
+
+/**
+ * qla2x00_ms_req_pkt() - Retrieve a Management Server request packet from
+ * 				the request ring.
+ * @ha: HA context
+ * @sp: pointer to handle post function call
+ *
+ * Note: The caller must hold the hardware lock before calling this routine.
+ *
+ * Returns NULL if function failed, else, a pointer to the request packet.
+ */
+request_t *
+qla2x00_ms_req_pkt(scsi_qla_host_t *ha, srb_t  *sp)
+{
+	device_reg_t	*reg = ha->iobase;
+	request_t	*pkt = NULL;
+	uint16_t	cnt, i, index;
+	uint32_t	*dword_ptr;
+	uint32_t	timer;
+	uint8_t		found = 0;
+	uint16_t	req_cnt = 1;
+
+	ENTER(__func__);
+
+	/* Wait 1 second for slot. */
+	for (timer = HZ; timer; timer--) {
+		if ((req_cnt + 2) >= ha->req_q_cnt) {
+			/* Calculate number of free request entries. */
+			cnt = qla2x00_debounce_register(ISP_REQ_Q_OUT(ha, reg));
+			if (ha->req_ring_index < cnt) {
+				ha->req_q_cnt = cnt - ha->req_ring_index;
+			} else {
+				ha->req_q_cnt = REQUEST_ENTRY_CNT -
+				    (ha->req_ring_index - cnt);
+			}
+		}
+
+		/* Check for room in outstanding command list. */
+		cnt = ha->current_outstanding_cmd;
+		for (index = 1; index < MAX_OUTSTANDING_COMMANDS; index++) {
+			cnt++;
+			if (cnt == MAX_OUTSTANDING_COMMANDS)
+				cnt = 1;
+
+			if (ha->outstanding_cmds[cnt] == 0) {
+				found = 1;
+				ha->current_outstanding_cmd = cnt;
+				break;
+			}
+		}
+
+		/* If room for request in request ring. */
+		if (found && (req_cnt + 2) < ha->req_q_cnt) {
+			pkt = ha->request_ring_ptr;
+
+			/* Zero out packet. */
+			dword_ptr = (uint32_t *)pkt;
+			for (i = 0; i < REQUEST_ENTRY_SIZE / 4; i++ )
+				*dword_ptr++ = 0;
+
+			DEBUG5(printk("%s(): putting sp=%p in "
+			    "outstanding_cmds[%x]\n",
+			    __func__,
+			    sp, cnt));
+
+			ha->outstanding_cmds[cnt] = sp;
+
+			/* save the handle */
+			sp->cmd->host_scribble = (unsigned char *) (u_long) cnt;
+			CMD_SP(sp->cmd) = (void *)sp;
+
+			ha->req_q_cnt--;
+			pkt->handle = (uint32_t)cnt;
+
+			/* Set system defined field. */
+			pkt->sys_define = (uint8_t)ha->req_ring_index;
+			pkt->entry_status = 0;
+
+			break;
+		}
+
+		/* Release ring specific lock */
+		spin_unlock(&ha->hardware_lock);
+		udelay(20);
+
+		/* Check for pending interrupts. */
+		qla2x00_poll(ha);
+
+		spin_lock_irq(&ha->hardware_lock);
+	}
+	if (!pkt) {
+		DEBUG2_3(printk("%s(): **** FAILED ****\n", __func__));
+	}
+
+	LEAVE(__func__);
+
+	return (pkt);
+}
+
+/**
+ * qla2x00_isp_cmd() - Modify the request ring pointer.
+ * @ha: HA context
+ *
+ * Note: The caller must hold the hardware lock before calling this routine.
+ */
+void
+qla2x00_isp_cmd(scsi_qla_host_t *ha)
+{
+	device_reg_t *reg = ha->iobase;
+
+	DEBUG5(printk("%s(): IOCB data:\n", __func__));
+	DEBUG5(qla2x00_dump_buffer(
+	    (uint8_t *)ha->request_ring_ptr, REQUEST_ENTRY_SIZE));
+
+	/* Adjust ring index. */
+	ha->req_ring_index++;
+	if (ha->req_ring_index == REQUEST_ENTRY_CNT) {
+		ha->req_ring_index = 0;
+		ha->request_ring_ptr = ha->request_ring;
+	} else
+		ha->request_ring_ptr++;
+
+	/* Set chip new ring index. */
+	WRT_REG_WORD(ISP_REQ_Q_IN(ha, reg), ha->req_ring_index);
+	RD_REG_WORD(ISP_REQ_Q_IN(ha, reg));	/* PCI Posting. */
+}
diff -Nru a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/qla_isr.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,1421 @@
+/*
+ *                  QLOGIC LINUX SOFTWARE
+ *
+ * QLogic ISP2x00 device driver for Linux 2.6.x
+ * Copyright (C) 2003 QLogic Corporation
+ * (www.qlogic.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#include "qla_os.h"
+
+#include "qla_def.h"
+
+/* XXX(hch): this is ugly, but we don't want to pull in exioctl.h */
+#ifndef EXT_DEF_PORTSPEED_1GBIT
+#define EXT_DEF_PORTSPEED_1GBIT		1
+#define EXT_DEF_PORTSPEED_2GBIT		2
+#endif
+
+static void qla2x00_mbx_completion(scsi_qla_host_t *, uint16_t);
+static void qla2x00_async_event(scsi_qla_host_t *, uint32_t);
+static void qla2x00_process_completed_request(struct scsi_qla_host *, uint32_t);
+void qla2x00_process_response_queue(struct scsi_qla_host *);
+static void qla2x00_status_entry(scsi_qla_host_t *, sts_entry_t *);
+static void qla2x00_status_cont_entry(scsi_qla_host_t *, sts_cont_entry_t *);
+static void qla2x00_error_entry(scsi_qla_host_t *, sts_entry_t *);
+static void qla2x00_ms_entry(scsi_qla_host_t *, ms_iocb_entry_t *);
+
+static int qla2x00_check_sense(struct scsi_cmnd *cp, os_lun_t *);
+
+/**
+ * qla2x00_intr_handler() - Process interrupts for the ISP.
+ * @irq:
+ * @dev_id: SCSI driver HA context
+ * @regs:
+ *
+ * Called by system whenever the host adapter generates an interrupt.
+ *
+ * Returns handled flag.
+ */
+irqreturn_t
+qla2x00_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
+{
+	scsi_qla_host_t	*ha;
+	device_reg_t	*reg;
+	uint32_t	mbx;
+	int		status = 0;
+	unsigned long	flags = 0;
+	unsigned long	mbx_flags = 0;
+	unsigned long	intr_iter;
+	uint32_t	stat;
+	uint16_t	hccr;
+
+	/* Don't loop forever, interrupt are OFF */
+	intr_iter = 50; 
+
+	ha = (scsi_qla_host_t *) dev_id;
+	if (!ha) {
+		printk(KERN_INFO
+		    "%s(): NULL host pointer\n", __func__);
+		return (IRQ_NONE);
+	}
+
+	reg = ha->iobase;
+
+	spin_lock_irqsave(&ha->hardware_lock, flags);
+
+	for (;;) {
+		/* Relax CPU! */
+		if (!(intr_iter--))
+			break;
+
+		if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
+			if ((RD_REG_WORD(&reg->istatus) & ISR_RISC_INT) == 0)
+				break;
+
+			if (RD_REG_WORD(&reg->semaphore) & BIT_0) {
+				WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT);
+				RD_REG_WORD(&reg->hccr);
+
+				/* Get mailbox data. */
+				mbx = RD_MAILBOX_REG(ha, reg, 0);
+				if (mbx > 0x3fff && mbx < 0x8000) {
+					qla2x00_mbx_completion(ha,
+					    (uint16_t)mbx);
+					status |= MBX_INTERRUPT;
+				} else if (mbx > 0x7fff && mbx < 0xc000) {
+					qla2x00_async_event(ha, mbx);
+				} else {
+					/*EMPTY*/
+					DEBUG2(printk("scsi(%ld): Unrecognized "
+					    "interrupt type (%d)\n",
+					    ha->host_no, mbx));
+				}
+				/* Release mailbox registers. */
+				WRT_REG_WORD(&reg->semaphore, 0);
+				/* Workaround for ISP2100 chip. */
+				if (IS_QLA2100(ha))
+					RD_REG_WORD(&reg->semaphore);
+			} else {
+				qla2x00_process_response_queue(ha);
+	
+				WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT);
+				RD_REG_WORD(&reg->hccr);
+			}
+		} else /* IS_QLA23XX(ha) */ {
+			stat = RD_REG_DWORD(&reg->u.isp2300.host_status);
+			if ((stat & HSR_RISC_INT) == 0)
+				break;
+
+			mbx = MSW(stat);
+			switch (stat & 0xff) {
+			case 0x13:
+				qla2x00_process_response_queue(ha);
+				break;
+			case 0x1:
+			case 0x2:
+			case 0x10:
+			case 0x11:
+				qla2x00_mbx_completion(ha, (uint16_t)mbx);
+				status |= MBX_INTERRUPT;
+
+				/* Release mailbox registers. */
+				WRT_REG_WORD(&reg->semaphore, 0);
+				break;
+			case 0x12:
+				qla2x00_async_event(ha, mbx);
+				break;
+			case 0x15:
+				mbx = mbx << 16 | MBA_CMPLT_1_16BIT;
+				qla2x00_async_event(ha, mbx);
+				break;
+			case 0x16:
+				mbx = mbx << 16 | MBA_SCSI_COMPLETION;
+				qla2x00_async_event(ha, mbx);
+				break;
+			default:
+				hccr = RD_REG_WORD(&reg->hccr);
+				if (hccr & HCCR_RISC_PAUSE) {
+					qla_printk(KERN_INFO, ha,
+					    "RISC paused, dumping HCCR=%x\n",
+					    hccr);
+
+					/*
+					 * Issue a "HARD" reset in order for
+					 * the RISC interrupt bit to be
+					 * cleared.  Schedule a big hammmer to
+					 * get out of the RISC PAUSED state.
+					 */
+					WRT_REG_WORD(&reg->hccr,
+					    HCCR_RESET_RISC);
+					RD_REG_WORD(&reg->hccr);
+					set_bit(ISP_ABORT_NEEDED,
+					    &ha->dpc_flags);
+					break;
+				} else {
+					DEBUG2(printk("scsi(%ld): Unrecognized "
+					    "interrupt type (%d)\n",
+					    ha->host_no, stat & 0xff));
+				}
+				break;
+			}
+			WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT);
+			RD_REG_WORD(&reg->hccr);
+		}
+	}
+
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+	qla2x00_next(ha);
+	ha->last_irq_cpu = smp_processor_id();
+	ha->total_isr_cnt++;
+
+	if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) &&
+	    (status & MBX_INTERRUPT) && ha->flags.mbox_int) {
+
+		/* There was a mailbox completion */
+		DEBUG3(printk("%s(%ld): Going to get mbx reg lock.\n",
+		    __func__, ha->host_no));
+
+		spin_lock_irqsave(&ha->mbx_reg_lock, mbx_flags);
+
+		if (ha->mcp == NULL) {
+			DEBUG3(printk("%s(%ld): Error mbx pointer.\n",
+			    __func__, ha->host_no));
+		} else {
+			DEBUG3(printk("%s(%ld): Going to set mbx intr flags. "
+			    "cmd=%x.\n",
+			    __func__, ha->host_no, ha->mcp->mb[0]));
+		}
+		set_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
+
+		DEBUG3(printk("%s(%ld): Going to wake up mbx function for "
+		    "completion.\n",
+		    __func__, ha->host_no));
+
+		up(&ha->mbx_intr_sem);
+
+		DEBUG3(printk("%s(%ld): Going to release mbx reg lock.\n",
+		    __func__, ha->host_no));
+
+		spin_unlock_irqrestore(&ha->mbx_reg_lock, mbx_flags);
+	}
+
+	if (!list_empty(&ha->done_queue))
+		qla2x00_done(ha);
+
+	/* Wakeup the DPC routine */
+	if ((!ha->flags.mbox_busy &&
+	    (test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) ||
+		test_bit(RESET_MARKER_NEEDED, &ha->dpc_flags) ||
+		test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags))) &&
+		    ha->dpc_wait && !ha->dpc_active) {
+
+		up(ha->dpc_wait);
+	}
+
+	return (IRQ_HANDLED);
+}
+
+/**
+ * qla2x00_mbx_completion() - Process mailbox command completions.
+ * @ha: SCSI driver HA context
+ * @mb0: Mailbox0 register
+ */
+static void
+qla2x00_mbx_completion(scsi_qla_host_t *ha, uint16_t mb0)
+{
+	uint16_t	cnt;
+	uint16_t	*wptr;
+	device_reg_t	*reg = ha->iobase;
+
+	/* Load return mailbox registers. */
+	ha->flags.mbox_int = TRUE;
+	ha->mailbox_out[0] = mb0;
+	wptr = (uint16_t *)MAILBOX_REG(ha, reg, 1);
+
+	for (cnt = 1; cnt < ha->mbx_count; cnt++) {
+		if (IS_QLA2200(ha) && cnt == 8) 
+			wptr = (uint16_t *)MAILBOX_REG(ha, reg, 8);
+		if (cnt == 4 || cnt == 5)
+			ha->mailbox_out[cnt] = qla2x00_debounce_register(wptr);
+		else
+			ha->mailbox_out[cnt] = RD_REG_WORD(wptr);
+	
+		wptr++;
+	}
+
+	if (ha->mcp) {
+		DEBUG3(printk("%s(%ld): Got mailbox completion. cmd=%x.\n",
+		    __func__, ha->host_no, ha->mcp->mb[0]));
+	} else {
+		DEBUG2_3(printk("%s(%ld): MBX pointer ERROR!\n",
+		    __func__, ha->host_no));
+	}
+}
+
+/**
+ * qla2x00_async_event() - Process aynchronous events.
+ * @ha: SCSI driver HA context
+ * @mb0: Mailbox0 register
+ */
+static void
+qla2x00_async_event(scsi_qla_host_t *ha, uint32_t mbx)
+{
+	static char	*link_speeds[5] = { "1", "2", "4", "?", "10" };
+	char		*link_speed;
+	uint16_t	mb[4];
+	uint16_t	handle_cnt;
+	uint16_t	cnt;
+	uint32_t	handles[5];
+	device_reg_t	*reg = ha->iobase;
+	uint32_t	rscn_entry, host_pid;
+	uint8_t		rscn_queue_index;
+
+	/* Setup to process RIO completion. */
+	handle_cnt = 0;
+	mb[0] = LSW(mbx);
+	switch (mb[0]) {
+	case MBA_SCSI_COMPLETION:
+		if (IS_QLA2100(ha) || IS_QLA2200(ha))
+			handles[0] = RD_MAILBOX_REG(ha, reg, 1);
+		else
+			handles[0] = MSW(mbx);
+		handles[0] |= (uint32_t)(RD_MAILBOX_REG(ha, reg, 2) << 16);
+		handle_cnt = 1;
+		break;
+	case MBA_CMPLT_1_16BIT:
+		if (IS_QLA2100(ha) || IS_QLA2200(ha))
+			handles[0] = (uint32_t)RD_MAILBOX_REG(ha, reg, 1);
+		else
+			handles[0] = MSW(mbx);
+		handle_cnt = 1;
+		mb[0] = MBA_SCSI_COMPLETION;
+		break;
+	case MBA_CMPLT_2_16BIT:
+		handles[0] = (uint32_t)RD_MAILBOX_REG(ha, reg, 1);
+		handles[1] = (uint32_t)RD_MAILBOX_REG(ha, reg, 2);
+		handle_cnt = 2;
+		mb[0] = MBA_SCSI_COMPLETION;
+		break;
+	case MBA_CMPLT_3_16BIT:
+		handles[0] = (uint32_t)RD_MAILBOX_REG(ha, reg, 1);
+		handles[1] = (uint32_t)RD_MAILBOX_REG(ha, reg, 2);
+		handles[2] = (uint32_t)RD_MAILBOX_REG(ha, reg, 3);
+		handle_cnt = 3;
+		mb[0] = MBA_SCSI_COMPLETION;
+		break;
+	case MBA_CMPLT_4_16BIT:
+		handles[0] = (uint32_t)RD_MAILBOX_REG(ha, reg, 1);
+		handles[1] = (uint32_t)RD_MAILBOX_REG(ha, reg, 2);
+		handles[2] = (uint32_t)RD_MAILBOX_REG(ha, reg, 3);
+		handles[3] = (uint32_t)RD_MAILBOX_REG(ha, reg, 6);
+		handle_cnt = 4;
+		mb[0] = MBA_SCSI_COMPLETION;
+		break;
+	case MBA_CMPLT_5_16BIT:
+		handles[0] = (uint32_t)RD_MAILBOX_REG(ha, reg, 1);
+		handles[1] = (uint32_t)RD_MAILBOX_REG(ha, reg, 2);
+		handles[2] = (uint32_t)RD_MAILBOX_REG(ha, reg, 3);
+		handles[3] = (uint32_t)RD_MAILBOX_REG(ha, reg, 6);
+		handles[4] = (uint32_t)RD_MAILBOX_REG(ha, reg, 7);
+		handle_cnt = 5;
+		mb[0] = MBA_SCSI_COMPLETION;
+		break;
+	case MBA_CMPLT_2_32BIT:
+		handles[0] = (uint32_t)((RD_MAILBOX_REG(ha, reg, 2) << 16) |
+		    RD_MAILBOX_REG(ha, reg, 1));
+		handles[1] = (uint32_t)((RD_MAILBOX_REG(ha, reg, 7) << 16) |
+		    RD_MAILBOX_REG(ha, reg, 6));
+		handle_cnt = 2;
+		mb[0] = MBA_SCSI_COMPLETION;
+		break;
+	default:
+		break;
+	}
+
+	mb[0] = LSW(mbx);
+	switch (mb[0]) {
+	case MBA_SCSI_COMPLETION:	/* Fast Post */
+		if (!ha->flags.online)
+			break;
+
+		for (cnt = 0; cnt < handle_cnt; cnt++)
+			qla2x00_process_completed_request(ha, handles[cnt]);
+		break;
+
+	case MBA_RESET:			/* Reset */
+		DEBUG2(printk("scsi(%ld): Asynchronous RESET.\n", ha->host_no));
+
+		set_bit(RESET_MARKER_NEEDED, &ha->dpc_flags);
+		break;
+
+	case MBA_SYSTEM_ERR:		/* System Error */
+		mb[1] = RD_MAILBOX_REG(ha, reg, 1);
+		mb[2] = RD_MAILBOX_REG(ha, reg, 2);
+		mb[3] = RD_MAILBOX_REG(ha, reg, 3);
+
+		qla_printk(KERN_INFO, ha,
+		    "ISP System Error - mbx1=%xh mbx2=%xh mbx3=%xh.\n",
+		    mb[1], mb[2], mb[3]);
+
+		if (IS_QLA2100(ha) || IS_QLA2200(ha))
+			qla2100_fw_dump(ha, 1);
+		else
+	    		qla2300_fw_dump(ha, 1);
+		set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+		break;
+
+	case MBA_REQ_TRANSFER_ERR:	/* Request Transfer Error */
+		DEBUG2(printk("scsi(%ld): ISP Request Transfer Error.\n",
+		    ha->host_no));
+		qla_printk(KERN_WARNING, ha, "ISP Request Transfer Error.\n");
+
+		set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+		break;
+
+	case MBA_RSP_TRANSFER_ERR:	/* Response Transfer Error */
+		DEBUG2(printk("scsi(%ld): ISP Response Transfer Error.\n",
+		    ha->host_no));
+		qla_printk(KERN_WARNING, ha, "ISP Response Transfer Error.\n");
+
+		set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+		break;
+
+	case MBA_WAKEUP_THRES:		/* Request Queue Wake-up */
+		DEBUG2(printk("scsi(%ld): Asynchronous WAKEUP_THRES.\n",
+		    ha->host_no));
+		break;
+
+	case MBA_LIP_OCCURRED:		/* Loop Initialization Procedure */
+		mb[1] = RD_MAILBOX_REG(ha, reg, 1);
+
+		DEBUG2(printk("scsi(%ld): LIP occured (%x).\n", ha->host_no,
+		    mb[1]));
+		qla_printk(KERN_INFO, ha, "LIP occured (%x).\n", mb[1]);
+
+		if (atomic_read(&ha->loop_state) != LOOP_DOWN) {
+			atomic_set(&ha->loop_state, LOOP_DOWN);
+			atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME);
+			qla2x00_mark_all_devices_lost(ha);
+		}
+
+		set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags);
+
+		ha->flags.management_server_logged_in = 0;
+
+		/* Update AEN queue. */
+		qla2x00_enqueue_aen(ha, MBA_LIP_OCCURRED, NULL);
+
+		ha->total_lip_cnt++;
+		break;
+
+	case MBA_LOOP_UP:		/* Loop Up Event */
+		mb[1] = RD_MAILBOX_REG(ha, reg, 1);
+
+		ha->current_speed = EXT_DEF_PORTSPEED_1GBIT;
+		if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
+			link_speed = link_speeds[0];
+		} else {
+			link_speed = link_speeds[3];
+			if (mb[1] < 5)
+				link_speed = link_speeds[mb[1]];
+			if (mb[1] == 1)
+				ha->current_speed = EXT_DEF_PORTSPEED_2GBIT;
+		}
+
+		DEBUG2(printk("scsi(%ld): Asynchronous LOOP UP (%s Gbps).\n",
+		    ha->host_no, link_speed));
+		qla_printk(KERN_INFO, ha, "LOOP UP detected (%s Gbps).\n",
+		    link_speed);
+
+		ha->flags.management_server_logged_in = 0;
+
+		/* Update AEN queue. */
+		qla2x00_enqueue_aen(ha, MBA_LOOP_UP, NULL);
+		break;
+
+	case MBA_LOOP_DOWN:		/* Loop Down Event */
+		DEBUG2(printk("scsi(%ld): Asynchronous LOOP DOWN.\n",
+		    ha->host_no));
+		qla_printk(KERN_INFO, ha, "LOOP DOWN detected.\n");
+
+		if (atomic_read(&ha->loop_state) != LOOP_DOWN) {
+			atomic_set(&ha->loop_state, LOOP_DOWN);
+			atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME);
+			qla2x00_mark_all_devices_lost(ha);
+		}
+
+		ha->flags.management_server_logged_in = 0;
+		ha->current_speed = 0; /* reset value */
+
+		/* Update AEN queue. */
+		qla2x00_enqueue_aen(ha, MBA_LOOP_DOWN, NULL);
+		break;
+
+	case MBA_LIP_RESET:		/* LIP reset occurred */
+		mb[1] = RD_MAILBOX_REG(ha, reg, 1);
+
+		DEBUG2(printk("scsi(%ld): Asynchronous LIP RESET (%x).\n",
+		    ha->host_no, mb[1]));
+		qla_printk(KERN_INFO, ha,
+		    "LIP reset occured (%x).\n", mb[1]);
+
+		if (atomic_read(&ha->loop_state) != LOOP_DOWN) {
+			atomic_set(&ha->loop_state, LOOP_DOWN);
+			atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME);
+			qla2x00_mark_all_devices_lost(ha);
+		}
+
+		set_bit(RESET_MARKER_NEEDED, &ha->dpc_flags);
+
+		ha->operating_mode = LOOP;
+		ha->flags.management_server_logged_in = 0;
+
+		/* Update AEN queue. */
+		qla2x00_enqueue_aen(ha, MBA_LIP_RESET, NULL);
+
+		ha->total_lip_cnt++;
+		break;
+
+	case MBA_POINT_TO_POINT:	/* Point-to-Point */
+		if (IS_QLA2100(ha))
+			break;
+
+		DEBUG2(printk("scsi(%ld): Asynchronous P2P MODE received.\n",
+		    ha->host_no));
+
+		/*
+		 * Until there's a transition from loop down to loop up, treat
+		 * this as loop down only.
+		 */
+		if (atomic_read(&ha->loop_state) != LOOP_DOWN) {
+			atomic_set(&ha->loop_state, LOOP_DOWN);
+			if (!atomic_read(&ha->loop_down_timer))
+				atomic_set(&ha->loop_down_timer,
+				    LOOP_DOWN_TIME);
+			qla2x00_mark_all_devices_lost(ha);
+		}
+
+		if (!(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags))) {
+			set_bit(RESET_MARKER_NEEDED, &ha->dpc_flags);
+		}
+		set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags);
+		break;
+
+	case MBA_CHG_IN_CONNECTION:	/* Change in connection mode */
+		if (IS_QLA2100(ha))
+			break;
+
+		mb[1] = RD_MAILBOX_REG(ha, reg, 1);
+
+		DEBUG2(printk("scsi(%ld): Asynchronous Change In Connection "
+		    "received.\n",
+		    ha->host_no));
+		qla_printk(KERN_INFO, ha,
+		    "Configuration change detected: value=%x.\n", mb[1]);
+
+		if (atomic_read(&ha->loop_state) != LOOP_DOWN) {
+			atomic_set(&ha->loop_state, LOOP_DOWN);  
+			if (!atomic_read(&ha->loop_down_timer))
+				atomic_set(&ha->loop_down_timer,
+				    LOOP_DOWN_TIME);
+			qla2x00_mark_all_devices_lost(ha);
+		}
+
+		set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags);
+		set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags);
+		break;
+
+	case MBA_PORT_UPDATE:		/* Port database update */
+		mb[1] = RD_MAILBOX_REG(ha, reg, 1);
+		mb[2] = RD_MAILBOX_REG(ha, reg, 2);
+
+		/*
+		 * If a single remote port just logged into (or logged out of)
+		 * us, create a new entry in our rscn fcports list and handle
+		 * the event like an RSCN.
+		 */
+		if (IS_QLA23XX(ha) && ha->flags.init_done && mb[1] != 0xffff &&
+		    ((ha->operating_mode == P2P && mb[1] != 0) ||
+		    (ha->operating_mode != P2P && mb[1] !=
+			SNS_FIRST_LOOP_ID)) && (mb[2] == 6 || mb[2] == 7)) {
+			int rval;
+			fc_port_t *rscn_fcport;
+
+			/* Create new fcport for login. */
+			rscn_fcport = qla2x00_alloc_rscn_fcport(ha, GFP_ATOMIC);
+			if (rscn_fcport) {
+				DEBUG14(printk("scsi(%ld): Port Update -- "
+				    "creating RSCN fcport %p for login.\n",
+				    ha->host_no, rscn_fcport));
+
+				rscn_fcport->loop_id = mb[1];
+				rscn_fcport->d_id.b24 = INVALID_PORT_ID;
+				atomic_set(&rscn_fcport->state,
+				    FCS_DEVICE_LOST);
+				list_add_tail(&rscn_fcport->list,
+				    &ha->rscn_fcports);
+
+				rval = qla2x00_handle_port_rscn(ha, 0,
+				    rscn_fcport, 1);
+				if (rval == QLA_SUCCESS)
+					break;
+			} else {
+				DEBUG14(printk("scsi(%ld): Port Update -- "
+				    "-- unable to allocate RSCN fcport "
+				    "login.\n", ha->host_no));
+			}
+		}
+
+		/*
+		 * If PORT UPDATE is global (recieved LIP_OCCURED/LIP_RESET
+		 * event etc. earlier indicating loop is down) then process
+		 * it.  Otherwise ignore it and Wait for RSCN to come in.
+		 */
+		if (atomic_read(&ha->loop_state) != LOOP_DOWN) {
+			DEBUG2(printk("scsi(%ld): Asynchronous PORT UPDATE "
+			    "ignored.\n", ha->host_no));
+			break;
+		}
+
+		DEBUG2(printk("scsi(%ld): Asynchronous PORT UPDATE.\n",
+		    ha->host_no));
+		DEBUG(printk(KERN_INFO
+		    "scsi(%ld): Port database changed %04x %04x.\n",
+		    ha->host_no, mb[1], mb[2]));
+
+		/*
+		 * Mark all devices as missing so we will login again.
+		 */
+		atomic_set(&ha->loop_state, LOOP_UP);
+
+		atomic_set(&ha->loop_down_timer, 0);
+		qla2x00_mark_all_devices_lost(ha);
+
+		ha->flags.rscn_queue_overflow = 1;
+
+		set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags);
+		set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags);
+
+		/* Update AEN queue. */
+		qla2x00_enqueue_aen(ha, MBA_PORT_UPDATE, NULL);
+		break;
+
+	case MBA_RSCN_UPDATE:		/* State Change Registration */
+		mb[1] = RD_MAILBOX_REG(ha, reg, 1);
+		mb[2] = RD_MAILBOX_REG(ha, reg, 2);
+
+		DEBUG2(printk("scsi(%ld): Asynchronous RSCR UPDATE.\n",
+		    ha->host_no));
+		DEBUG(printk(KERN_INFO
+		    "scsi(%ld): RSCN database changed -- %04x %04x.\n",
+		    ha->host_no, mb[1], mb[2]));
+
+		rscn_entry = (mb[1] << 16) | mb[2];
+		host_pid = (ha->d_id.b.domain << 16) | (ha->d_id.b.area << 8) |
+		    ha->d_id.b.al_pa;
+		if (rscn_entry == host_pid) {
+			DEBUG(printk(KERN_INFO
+			    "scsi(%ld): Ignoring RSCN update to local host "
+			    "port ID (%06x)\n",
+			    ha->host_no, host_pid));
+			break;
+		}
+
+		rscn_queue_index = ha->rscn_in_ptr + 1;
+		if (rscn_queue_index == MAX_RSCN_COUNT)
+			rscn_queue_index = 0;
+		if (rscn_queue_index != ha->rscn_out_ptr) {
+			ha->rscn_queue[ha->rscn_in_ptr] = rscn_entry;
+			ha->rscn_in_ptr = rscn_queue_index;
+		} else {
+			ha->flags.rscn_queue_overflow = 1;
+		}
+
+		atomic_set(&ha->loop_state, LOOP_UPDATE);
+		atomic_set(&ha->loop_down_timer, 0);
+		ha->flags.management_server_logged_in = 0;
+
+		set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags);
+		set_bit(RSCN_UPDATE, &ha->dpc_flags);
+
+		/* Update AEN queue. */
+		qla2x00_enqueue_aen(ha, MBA_RSCN_UPDATE, &mb[0]);
+		break;
+
+	/* case MBA_RIO_RESPONSE: */
+	case MBA_ZIO_RESPONSE:
+		DEBUG2(printk("scsi(%ld): [R|Z]IO update completion.\n",
+		    ha->host_no));
+		DEBUG(printk(KERN_INFO
+		    "scsi(%ld): [R|Z]IO update completion.\n",
+		    ha->host_no));
+
+		qla2x00_process_response_queue(ha);
+		break;
+	}
+}
+
+/**
+ * qla2x00_process_completed_request() - Process a Fast Post response.
+ * @ha: SCSI driver HA context
+ * @index: SRB index
+ */
+static void
+qla2x00_process_completed_request(struct scsi_qla_host *ha, uint32_t index)
+{
+	srb_t *sp;
+
+	/* Validate handle. */
+	if (index >= MAX_OUTSTANDING_COMMANDS) {
+		DEBUG2(printk("scsi(%ld): Invalid SCSI completion handle %d.\n",
+		    ha->host_no, index));
+		qla_printk(KERN_WARNING, ha,
+		    "Invalid SCSI completion handle %d.\n", index);
+
+		set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+		return;
+	}
+
+	sp = ha->outstanding_cmds[index];
+	if (sp) {
+		/* Free outstanding command slot. */
+		ha->outstanding_cmds[index] = 0;
+
+		if (ha->actthreads)
+			ha->actthreads--;
+		sp->lun_queue->out_cnt--;
+		CMD_COMPL_STATUS(sp->cmd) = 0L;
+		CMD_SCSI_STATUS(sp->cmd) = 0L;
+
+		/* Save ISP completion status */
+		sp->cmd->result = DID_OK << 16;
+		sp->fo_retry_cnt = 0;
+		add_to_done_queue(ha, sp);
+	} else {
+		DEBUG2(printk("scsi(%ld): Invalid ISP SCSI completion handle\n",
+		    ha->host_no));
+		qla_printk(KERN_WARNING, ha,
+		    "Invalid ISP SCSI completion handle\n");
+
+		set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+	}
+}
+
+/**
+ * qla2x00_process_response_queue() - Process response queue entries.
+ * @ha: SCSI driver HA context
+ */
+void
+qla2x00_process_response_queue(struct scsi_qla_host *ha)
+{
+	device_reg_t	*reg = ha->iobase;
+	sts_entry_t	*pkt;
+	uint16_t        handle_cnt;
+	uint16_t        cnt;
+
+	if (!ha->flags.online)
+		return;
+
+	while (ha->response_ring_ptr->signature != RESPONSE_PROCESSED) {
+		pkt = (sts_entry_t *)ha->response_ring_ptr;
+
+		ha->rsp_ring_index++;
+		if (ha->rsp_ring_index == ha->response_q_length) {
+			ha->rsp_ring_index = 0;
+			ha->response_ring_ptr = ha->response_ring;
+		} else {
+			ha->response_ring_ptr++;
+		}
+
+		if (pkt->entry_status != 0) {
+			DEBUG3(printk(KERN_INFO
+			    "scsi(%ld): Process error entry.\n", ha->host_no));
+
+			qla2x00_error_entry(ha, pkt);
+			((response_t *)pkt)->signature = RESPONSE_PROCESSED;
+			wmb();
+			continue;
+		}
+
+		switch (pkt->entry_type) {
+		case STATUS_TYPE:
+			qla2x00_status_entry(ha, pkt);
+			break;
+		case STATUS_TYPE_21:
+			handle_cnt = ((sts21_entry_t *)pkt)->handle_count;
+			for (cnt = 0; cnt < handle_cnt; cnt++) {
+				qla2x00_process_completed_request(ha,
+				    ((sts21_entry_t *)pkt)->handle[cnt]);
+			}
+			break;
+		case STATUS_TYPE_22:
+			handle_cnt = ((sts22_entry_t *)pkt)->handle_count;
+			for (cnt = 0; cnt < handle_cnt; cnt++) {
+				qla2x00_process_completed_request(ha,
+				    ((sts22_entry_t *)pkt)->handle[cnt]);
+			}
+			break;
+		case STATUS_CONT_TYPE:
+			qla2x00_status_cont_entry(ha, (sts_cont_entry_t *)pkt);
+			break;
+		case MS_IOCB_TYPE:
+			qla2x00_ms_entry(ha, (ms_iocb_entry_t *)pkt);
+			break;
+		case MBX_IOCB_TYPE:
+			if (IS_QLA23XX(ha)) {
+				if (pkt->sys_define == SOURCE_ASYNC_IOCB) {
+					qla2x00_process_iodesc(ha,
+					    (struct mbx_entry *)pkt);
+				} else {
+					/* MBX IOCB Type Not Supported. */
+					DEBUG4(printk(KERN_WARNING
+					    "scsi(%ld): Received unknown MBX "
+					    "IOCB response pkt type=%x "
+					    "source=%x entry status=%x.\n",
+					    ha->host_no, pkt->entry_type,
+					    pkt->sys_define,
+					    pkt->entry_status));
+				}
+				break;
+			}
+			/* Fallthrough. */
+		default:
+			/* Type Not Supported. */
+			DEBUG4(printk(KERN_WARNING
+			    "scsi(%ld): Received unknown response pkt type %x "
+			    "entry status=%x.\n",
+			    ha->host_no, pkt->entry_type, pkt->entry_status));
+			break;
+		}
+		((response_t *)pkt)->signature = RESPONSE_PROCESSED;
+		wmb();
+	}
+
+	/* Adjust ring index */
+	WRT_REG_WORD(ISP_RSP_Q_OUT(ha, reg), ha->rsp_ring_index);
+}
+
+/**
+ * qla2x00_status_entry() - Process a Status IOCB entry.
+ * @ha: SCSI driver HA context
+ * @pkt: Entry pointer
+ */
+static void
+qla2x00_status_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
+{
+	int		ret;
+	unsigned	b, t, l;
+	srb_t		*sp;
+	os_lun_t	*lq;
+	os_tgt_t	*tq;
+	fc_port_t	*fcport;
+	struct scsi_cmnd *cp;
+	uint16_t	comp_status;
+	uint16_t	scsi_status;
+	uint8_t		lscsi_status;
+	uint32_t	resid;
+	uint8_t		sense_sz = 0;
+
+	/* Fast path completion. */
+	if (le16_to_cpu(pkt->comp_status) == CS_COMPLETE &&
+	    (le16_to_cpu(pkt->scsi_status) & SS_MASK) == 0) {
+		qla2x00_process_completed_request(ha, pkt->handle);
+
+		return;
+	}
+
+	/* Validate handle. */
+	if (pkt->handle < MAX_OUTSTANDING_COMMANDS) {
+		sp = ha->outstanding_cmds[pkt->handle];
+		ha->outstanding_cmds[pkt->handle] = 0;
+	} else
+		sp = NULL;
+
+	if (sp == NULL) {
+		DEBUG2(printk("scsi(%ld): Status Entry invalid handle.\n",
+		    ha->host_no));
+		qla_printk(KERN_WARNING, ha, "Status Entry invalid handle.\n");
+
+		set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+		if (ha->dpc_wait && !ha->dpc_active) 
+			up(ha->dpc_wait);
+
+		return;
+	}
+	cp = sp->cmd;
+	if (cp == NULL) {
+		DEBUG2(printk("scsi(%ld): Command already returned back to OS "
+		    "pkt->handle=%d sp=%p sp->state:%d\n",
+		    ha->host_no, pkt->handle, sp, sp->state));
+		qla_printk(KERN_WARNING, ha,
+		    "Command is NULL: already returned to OS (sp=%p)\n", sp);
+
+		return;
+	}
+
+	if (ha->actthreads)
+		ha->actthreads--;
+
+	if (sp->lun_queue == NULL) {
+		DEBUG2(printk("scsi(%ld): Status Entry invalid lun pointer.\n",
+		    ha->host_no));
+		qla_printk(KERN_WARNING, ha,
+		    "Status Entry invalid lun pointer.\n");
+
+		set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+		if (ha->dpc_wait && !ha->dpc_active) 
+			up(ha->dpc_wait);
+
+		return;
+	}
+
+	sp->lun_queue->out_cnt--;
+
+	comp_status = le16_to_cpu(pkt->comp_status);
+	/* Mask of reserved bits 12-15, before we examine the scsi status */
+	scsi_status = le16_to_cpu(pkt->scsi_status) & SS_MASK;
+	lscsi_status = scsi_status & STATUS_MASK;
+
+	CMD_ENTRY_STATUS(cp) = pkt->entry_status;
+	CMD_COMPL_STATUS(cp) = comp_status;
+	CMD_SCSI_STATUS(cp) = scsi_status;
+
+	/* Generate LU queue on cntrl, target, LUN */
+	b = cp->device->channel;
+	t = cp->device->id;
+	l = cp->device->lun,
+
+	tq = sp->tgt_queue;
+	lq = sp->lun_queue;
+
+	/*
+	 * If loop is in transient state Report DID_BUS_BUSY
+	 */
+	if ((comp_status != CS_COMPLETE || scsi_status != 0)) {
+		if (!(sp->flags & SRB_IOCTL) &&
+		    (atomic_read(&ha->loop_down_timer) ||
+			atomic_read(&ha->loop_state) != LOOP_READY)) {
+
+			DEBUG2(printk("scsi(%ld:%d:%d:%d): Loop Not Ready - "
+			    "pid=%lx.\n",
+			    ha->host_no, b, t, l, cp->serial_number));
+
+			qla2x00_extend_timeout(cp, EXTEND_CMD_TIMEOUT);
+			add_to_retry_queue(ha, sp);
+			return;
+		}
+	}
+
+	/*
+	 * Based on Host and scsi status generate status code for Linux
+	 */
+	switch (comp_status) {
+	case CS_COMPLETE:
+		if (scsi_status == 0) {
+			cp->result = DID_OK << 16;
+			break;
+		}
+		if (lscsi_status == SS_BUSY_CONDITION) {
+			cp->result = DID_BUS_BUSY << 16 | lscsi_status;
+			break;
+		}
+
+		cp->result = DID_OK << 16 | lscsi_status;
+
+		if (lscsi_status != SS_CHECK_CONDITION)
+			break;
+
+		/*
+		 * Copy Sense Data into sense buffer
+		 */
+		memset(cp->sense_buffer, 0, sizeof(cp->sense_buffer));
+
+		if (!(scsi_status & SS_SENSE_LEN_VALID))
+			break;
+
+		if (le16_to_cpu(pkt->req_sense_length) <
+		    sizeof(cp->sense_buffer))
+			sense_sz = le16_to_cpu(pkt->req_sense_length);
+		else
+			sense_sz = sizeof(cp->sense_buffer) - 1;
+
+		CMD_ACTUAL_SNSLEN(cp) = sense_sz;
+		sp->request_sense_length = sense_sz;
+		sp->request_sense_ptr = cp->sense_buffer;
+
+		if (sp->request_sense_length > 32)
+			sense_sz = 32;
+
+		memcpy(cp->sense_buffer, pkt->req_sense_data, sense_sz);
+
+		sp->request_sense_ptr += sense_sz;
+		sp->request_sense_length -= sense_sz;
+		if (sp->request_sense_length != 0)
+			ha->status_srb = sp;
+
+		if (!(sp->flags & SRB_IOCTL) &&
+		    qla2x00_check_sense(cp, lq) == QLA_SUCCESS) {
+			/* Throw away status_cont if any */
+			ha->status_srb = NULL;
+			add_to_scsi_retry_queue(ha, sp);
+			return;
+		}
+
+		DEBUG5(printk("%s(): Check condition Sense data, "
+		    "scsi(%ld:%d:%d:%d) cmd=%p pid=%ld\n",
+		    __func__, ha->host_no, b, t, l, cp,
+		    cp->serial_number));
+		if (sense_sz)
+			DEBUG5(qla2x00_dump_buffer(cp->sense_buffer,
+			    CMD_ACTUAL_SNSLEN(cp)));
+		break;
+
+	case CS_DATA_UNDERRUN:
+		DEBUG2(printk(KERN_INFO
+		    "scsi(%ld:%d:%d) UNDERRUN status detected 0x%x-0x%x.\n",
+		    ha->host_no, t, l, comp_status, scsi_status));
+
+		resid = le32_to_cpu(pkt->residual_length);
+		CMD_RESID_LEN(cp) = resid;
+
+		/*
+		 * Check to see if SCSI Status is non zero. If so report SCSI 
+		 * Status.
+		 */
+		if (lscsi_status != 0) {
+			if (lscsi_status == SS_BUSY_CONDITION) {
+				cp->result = DID_BUS_BUSY << 16 |
+				    lscsi_status;
+				break;
+			}
+
+			cp->result = DID_OK << 16 | lscsi_status;
+
+			if (lscsi_status != SS_CHECK_CONDITION)
+				break;
+
+			/* Copy Sense Data into sense buffer */
+			memset(cp->sense_buffer, 0, sizeof(cp->sense_buffer));
+
+			if (!(scsi_status & SS_SENSE_LEN_VALID))
+				break;
+
+			if (le16_to_cpu(pkt->req_sense_length) <
+			    sizeof(cp->sense_buffer))
+				sense_sz = le16_to_cpu(pkt->req_sense_length);
+			else
+				sense_sz = sizeof(cp->sense_buffer) - 1;
+
+			CMD_ACTUAL_SNSLEN(cp) = sense_sz;
+			sp->request_sense_length = sense_sz;
+			sp->request_sense_ptr = cp->sense_buffer;
+
+			if (sp->request_sense_length > 32) 
+				sense_sz = 32;
+
+			memcpy(cp->sense_buffer, pkt->req_sense_data, sense_sz);
+
+			sp->request_sense_ptr += sense_sz;
+			sp->request_sense_length -= sense_sz;
+			if (sp->request_sense_length != 0)
+				ha->status_srb = sp;
+
+			if (!(sp->flags & SRB_IOCTL) &&
+			    (qla2x00_check_sense(cp, lq) == QLA_SUCCESS)) {
+				ha->status_srb = NULL;
+				add_to_scsi_retry_queue(ha, sp);
+				return;
+			}
+			DEBUG5(printk("%s(): Check condition Sense data, "
+			    "scsi(%ld:%d:%d:%d) cmd=%p pid=%ld\n",
+			    __func__, ha->host_no, b, t, l, cp,
+			    cp->serial_number));
+			if (sense_sz)
+				DEBUG5(qla2x00_dump_buffer(cp->sense_buffer,
+				    CMD_ACTUAL_SNSLEN(cp)));
+		} else {
+			/*
+			 * If RISC reports underrun and target does not report
+			 * it then we must have a lost frame, so tell upper
+			 * layer to retry it by reporting a bus busy.
+			 */
+			if (!(scsi_status & SS_RESIDUAL_UNDER)) {
+				DEBUG2(printk("scsi(%ld:%d:%d:%d) Dropped "
+				    "frame(s) detected (%x of %x bytes)..."
+				    "retrying command.\n",
+				    ha->host_no, b, t, l, resid,
+				    cp->request_bufflen));
+
+				cp->result = DID_BUS_BUSY << 16;
+				ha->dropped_frame_error_cnt++;
+				break;
+			}
+
+			/* Handle mid-layer underflow */
+			cp->resid = resid;
+			if ((unsigned)(cp->request_bufflen - resid) <
+			    cp->underflow) {
+				qla_printk(KERN_INFO, ha,
+				    "scsi(%ld:%d:%d:%d): Mid-layer underflow "
+				    "detected (%x of %x bytes)...returning "
+				    "error status.\n",
+				    ha->host_no, b, t, l, resid,
+				    cp->request_bufflen);
+
+				cp->result = DID_ERROR << 16;
+				break;
+			}
+
+			/* Everybody online, looking good... */
+			cp->result = DID_OK << 16;
+		}
+		break;
+
+	case CS_DATA_OVERRUN:
+		DEBUG2(printk(KERN_INFO
+		    "scsi(%ld:%d:%d): OVERRUN status detected 0x%x-0x%x\n",
+		    ha->host_no, t, l, comp_status, scsi_status));
+		DEBUG2(printk(KERN_INFO
+		    "CDB: 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",
+		    cp->cmnd[0], cp->cmnd[1], cp->cmnd[2], cp->cmnd[3],
+		    cp->cmnd[4], cp->cmnd[5]));
+		DEBUG2(printk(KERN_INFO
+		    "PID=0x%lx req=0x%x xtra=0x%x -- returning DID_ERROR "
+		    "status!\n",
+		    cp->serial_number, cp->request_bufflen,
+		    le32_to_cpu(pkt->residual_length)));
+
+		cp->result = DID_ERROR << 16;
+		break;
+
+	case CS_PORT_LOGGED_OUT:
+	case CS_PORT_CONFIG_CHG:
+	case CS_PORT_BUSY:
+	case CS_INCOMPLETE:
+	case CS_PORT_UNAVAILABLE:
+		/*
+		 * If the port is in Target Down state, return all IOs for this
+		 * Target with DID_NO_CONNECT ELSE Queue the IOs in the
+		 * retry_queue.
+		 */
+		fcport = sp->fclun->fcport;
+		DEBUG2(printk("scsi(%ld:%d:%d): status_entry: Port Down "
+		    "pid=%ld, compl status=0x%x, port state=0x%x\n",
+		    ha->host_no, t, l, cp->serial_number, comp_status,
+		    atomic_read(&fcport->state)));
+
+		if ((sp->flags & SRB_IOCTL) ||
+		    atomic_read(&fcport->state) == FCS_DEVICE_DEAD) {
+			cp->result = DID_NO_CONNECT << 16;
+			add_to_done_queue(ha, sp);
+		} else {
+			qla2x00_extend_timeout(cp, EXTEND_CMD_TIMEOUT);
+			add_to_retry_queue(ha, sp);
+		}
+
+		if (atomic_read(&fcport->state) == FCS_ONLINE) {
+			qla2x00_mark_device_lost(ha, fcport, 1);
+		}
+
+		return;
+		break;
+
+	case CS_RESET:
+		DEBUG2(printk(KERN_INFO
+		    "scsi(%ld): RESET status detected 0x%x-0x%x.\n",
+		    ha->host_no, comp_status, scsi_status));
+
+		if (sp->flags & SRB_IOCTL) {
+			cp->result = DID_RESET << 16;
+		} else {
+			qla2x00_extend_timeout(cp, EXTEND_CMD_TIMEOUT);
+			add_to_retry_queue(ha, sp);
+			return;
+		}
+		break;
+
+	case CS_ABORTED:
+		/* 
+		 * hv2.19.12 - DID_ABORT does not retry the request if we
+		 * aborted this request then abort otherwise it must be a
+		 * reset.
+		 */
+		DEBUG2(printk(KERN_INFO
+		    "scsi(%ld): ABORT status detected 0x%x-0x%x.\n",
+		    ha->host_no, comp_status, scsi_status));
+
+		cp->result = DID_RESET << 16;
+		break;
+
+	case CS_TIMEOUT:
+		DEBUG2(printk(KERN_INFO
+		    "scsi(%ld:%d:%d:%d): TIMEOUT status detected 0x%x-0x%x.\n",
+		    ha->host_no, b, t, l, comp_status, scsi_status));
+
+		cp->result = DID_BUS_BUSY << 16;
+
+		fcport = lq->fclun->fcport;
+
+		/* Check to see if logout occurred */
+		if ((le16_to_cpu(pkt->status_flags) & SF_LOGOUT_SENT)) {
+			qla2x00_mark_device_lost(ha, fcport, 1);
+		}
+		break;
+
+	case CS_QUEUE_FULL:
+		DEBUG2(printk(KERN_INFO
+		    "scsi(%ld): QUEUE FULL status detected 0x%x-0x%x.\n",
+		    ha->host_no, comp_status, scsi_status));
+
+		/* SCSI Mid-Layer handles device queue full */
+
+		cp->result = DID_OK << 16 | lscsi_status; 
+
+		/* TODO: ??? */
+		/* Adjust queue depth */
+		ret = scsi_track_queue_full(cp->device,
+		    sp->lun_queue->out_cnt - 1);
+		if (ret) {
+			qla_printk(KERN_INFO, ha,
+			    "scsi(%ld:%d:%d:%d): Queue depth adjusted to %d.\n",
+			    ha->host_no, cp->device->channel, cp->device->id,
+			    cp->device->lun, ret);
+		}
+		break;
+
+	default:
+		DEBUG3(printk("scsi(%ld): Error detected (unknown status) "
+		    "0x%x-0x%x.\n",
+		    ha->host_no, comp_status, scsi_status));
+		qla_printk(KERN_INFO, ha,
+		    "Unknown status detected 0x%x-0x%x.\n",
+		    comp_status, scsi_status);
+
+		cp->result = DID_ERROR << 16;
+		break;
+	}
+
+	/* Place command on done queue. */
+	if (ha->status_srb == NULL)
+		add_to_done_queue(ha, sp);
+}
+
+/**
+ * qla2x00_status_cont_entry() - Process a Status Continuations entry.
+ * @ha: SCSI driver HA context
+ * @pkt: Entry pointer
+ *
+ * Extended sense data.
+ */
+static void
+qla2x00_status_cont_entry(scsi_qla_host_t *ha, sts_cont_entry_t *pkt)
+{
+	uint8_t		sense_sz = 0;
+	srb_t		*sp = ha->status_srb;
+	struct scsi_cmnd *cp;
+
+	if (sp != NULL && sp->request_sense_length != 0) {
+		cp = sp->cmd;
+		if (cp == NULL) {
+			DEBUG2(printk("%s(): Cmd already returned back to OS "
+			    "sp=%p sp->state:%d\n", __func__, sp, sp->state));
+			qla_printk(KERN_INFO, ha,
+			    "cmd is NULL: already returned to OS (sp=%p)\n",
+			    sp); 
+
+			ha->status_srb = NULL;
+			return;
+		}
+
+		if (sp->request_sense_length > sizeof(pkt->data)) {
+			sense_sz = sizeof(pkt->data);
+		} else {
+			sense_sz = sp->request_sense_length;
+		}
+
+		/* Move sense data. */
+		memcpy(sp->request_sense_ptr, pkt->data, sense_sz);
+		DEBUG5(qla2x00_dump_buffer(sp->request_sense_ptr, sense_sz));
+
+		sp->request_sense_ptr += sense_sz;
+		sp->request_sense_length -= sense_sz;
+
+		/* Place command on done queue. */
+		if (sp->request_sense_length == 0) {
+			add_to_done_queue(ha, sp);
+			ha->status_srb = NULL;
+		}
+	}
+}
+
+/**
+ * qla2x00_error_entry() - Process an error entry.
+ * @ha: SCSI driver HA context
+ * @pkt: Entry pointer
+ */
+static void
+qla2x00_error_entry(scsi_qla_host_t *ha, sts_entry_t *pkt) 
+{
+	srb_t *sp;
+
+#if defined(QL_DEBUG_LEVEL_2)
+	if (pkt->entry_status & RF_INV_E_ORDER)
+		qla_printk(KERN_ERR, ha, "%s: Invalid Entry Order\n", __func__);
+	else if (pkt->entry_status & RF_INV_E_COUNT)
+		qla_printk(KERN_ERR, ha, "%s: Invalid Entry Count\n", __func__);
+	else if (pkt->entry_status & RF_INV_E_PARAM)
+		qla_printk(KERN_ERR, ha, 
+		    "%s: Invalid Entry Parameter\n", __func__);
+	else if (pkt->entry_status & RF_INV_E_TYPE)
+		qla_printk(KERN_ERR, ha, "%s: Invalid Entry Type\n", __func__);
+	else if (pkt->entry_status & RF_BUSY)
+		qla_printk(KERN_ERR, ha, "%s: Busy\n", __func__);
+	else
+		qla_printk(KERN_ERR, ha, "%s: UNKNOWN flag error\n", __func__);
+#endif
+
+	/* Validate handle. */
+	if (pkt->handle < MAX_OUTSTANDING_COMMANDS)
+		sp = ha->outstanding_cmds[pkt->handle];
+	else
+		sp = NULL;
+
+	if (sp) {
+		/* Free outstanding command slot. */
+		ha->outstanding_cmds[pkt->handle] = 0;
+		if (ha->actthreads)
+			ha->actthreads--;
+		sp->lun_queue->out_cnt--;
+
+		/* Bad payload or header */
+		if (pkt->entry_status &
+		    (RF_INV_E_ORDER | RF_INV_E_COUNT |
+		     RF_INV_E_PARAM | RF_INV_E_TYPE)) {
+			sp->cmd->result = DID_ERROR << 16;
+		} else if (pkt->entry_status & RF_BUSY) {
+			sp->cmd->result = DID_BUS_BUSY << 16;
+		} else {
+			sp->cmd->result = DID_ERROR << 16;
+		}
+		/* Place command on done queue. */
+		add_to_done_queue(ha, sp);
+
+	} else if (pkt->entry_type == COMMAND_A64_TYPE ||
+	    pkt->entry_type == COMMAND_TYPE) {
+		DEBUG2(printk("scsi(%ld): Error entry - invalid handle\n",
+		    ha->host_no));
+		qla_printk(KERN_WARNING, ha,
+		    "Error entry - invalid handle\n");
+
+		set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+		if (ha->dpc_wait && !ha->dpc_active) 
+			up(ha->dpc_wait);
+	}
+}
+
+/**
+ * qla2x00_ms_entry() - Process a Management Server entry.
+ * @ha: SCSI driver HA context
+ * @index: Response queue out pointer
+ */
+static void
+qla2x00_ms_entry(scsi_qla_host_t *ha, ms_iocb_entry_t *pkt) 
+{
+	srb_t          *sp;
+
+	DEBUG3(printk("%s(%ld): pkt=%p pkthandle=%d.\n",
+	    __func__, ha->host_no, pkt, pkt->handle1));
+
+	/* Validate handle. */
+ 	if (pkt->handle1 < MAX_OUTSTANDING_COMMANDS)
+ 		sp = ha->outstanding_cmds[pkt->handle1];
+	else
+		sp = NULL;
+
+	if (sp == NULL) {
+		DEBUG2(printk("scsi(%ld): MS entry - invalid handle\n",
+		    ha->host_no));
+		qla_printk(KERN_WARNING, ha, "MS entry - invalid handle\n");
+
+		set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+		return;
+	}
+
+	CMD_COMPL_STATUS(sp->cmd) = le16_to_cpu(pkt->status);
+	CMD_ENTRY_STATUS(sp->cmd) = pkt->entry_status;
+
+	/* Free outstanding command slot. */
+	ha->outstanding_cmds[pkt->handle1] = 0;
+
+	add_to_done_queue(ha, sp);
+}
+
+/**
+ * qla2x00_check_sense() - Perform any sense data interrogation.
+ * @cp: SCSI Command
+ * @lq: Lun queue
+ *
+ * Returns QLA_SUCCESS if the lun queue is suspended, else
+ * QLA_FUNCTION_FAILED  (lun queue not suspended).
+ */
+static int 
+qla2x00_check_sense(struct scsi_cmnd *cp, os_lun_t *lq)
+{
+	scsi_qla_host_t	*ha;
+	srb_t		*sp;
+	fc_port_t	*fcport;
+
+	ha = (scsi_qla_host_t *) cp->device->host->hostdata;
+	if ((cp->sense_buffer[0] & 0x70) != 0x70) {
+		return (QLA_FUNCTION_FAILED);
+	}
+
+	sp = (srb_t * )CMD_SP(cp);
+	sp->flags |= SRB_GOT_SENSE;
+
+	switch (cp->sense_buffer[2] & 0xf) {
+	case RECOVERED_ERROR:
+		cp->result = DID_OK << 16;
+		cp->sense_buffer[0] = 0;
+		break;
+
+	case NOT_READY:
+		fcport = lq->fclun->fcport;
+
+		/*
+		 * Suspend the lun only for hard disk device type.
+		 */
+		if ((fcport->flags & FCF_TAPE_PRESENT) == 0 &&
+		    lq->q_state != LUN_STATE_TIMEOUT) {
+			/*
+			 * If target is in process of being ready then suspend
+			 * lun for 6 secs and retry all the commands.
+			 */
+			if (cp->sense_buffer[12] == 0x4 &&
+			    cp->sense_buffer[13] == 0x1) {
+
+				/* Suspend the lun for 6 secs */
+				qla2x00_suspend_lun(ha, lq, 6,
+				    ql2xsuspendcount);
+
+				return (QLA_SUCCESS);
+			}
+		}
+		break;
+	}
+
+	return (QLA_FUNCTION_FAILED);
+}
diff -Nru a/drivers/scsi/qla2xxx/qla_listops.h b/drivers/scsi/qla2xxx/qla_listops.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/qla_listops.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,351 @@
+/******************************************************************************
+ *                  QLOGIC LINUX SOFTWARE
+ *
+ * QLogic ISP2x00 device driver for Linux 2.6.x
+ * Copyright (C) 2003 QLogic Corporation
+ * (www.qlogic.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ ******************************************************************************/
+
+/* Management functions for various lists */
+
+/* __add_to_done_queue()
+ * 
+ * Place SRB command on done queue.
+ *
+ * Input:
+ *      ha           = host pointer
+ *      sp           = srb pointer.
+ * Locking:
+ * 	this function assumes the ha->list_lock is already taken
+ */
+static inline void 
+__add_to_done_queue(struct scsi_qla_host * ha, srb_t * sp)
+{
+	/*
+        if (sp->state != SRB_NO_QUEUE_STATE && 
+        	sp->state != SRB_ACTIVE_STATE)
+		BUG();
+	*/
+
+        /* Place block on done queue */
+        sp->cmd->host_scribble = (unsigned char *) NULL;
+        sp->state = SRB_DONE_STATE;
+        list_add_tail(&sp->list,&ha->done_queue);
+        ha->done_q_cnt++;
+	sp->ha = ha;
+}
+
+static inline void 
+__add_to_retry_queue(struct scsi_qla_host * ha, srb_t * sp)
+{
+	/*
+        if( sp->state != SRB_NO_QUEUE_STATE && 
+        	sp->state != SRB_ACTIVE_STATE)
+		BUG();
+	*/
+
+        /* Place block on retry queue */
+        list_add_tail(&sp->list,&ha->retry_queue);
+        ha->retry_q_cnt++;
+        sp->flags |= SRB_WATCHDOG;
+        sp->state = SRB_RETRY_STATE;
+	sp->ha = ha;
+}
+
+static inline void 
+__add_to_scsi_retry_queue(struct scsi_qla_host * ha, srb_t * sp)
+{
+	/*
+        if( sp->state != SRB_NO_QUEUE_STATE && 
+        	sp->state != SRB_ACTIVE_STATE)
+		BUG();
+	*/
+
+        /* Place block on retry queue */
+        list_add_tail(&sp->list,&ha->scsi_retry_queue);
+        ha->scsi_retry_q_cnt++;
+        sp->state = SRB_SCSI_RETRY_STATE;
+	sp->ha = ha;
+}
+
+static inline void 
+add_to_done_queue(struct scsi_qla_host * ha, srb_t * sp)
+{
+        unsigned long flags;
+
+        spin_lock_irqsave(&ha->list_lock, flags);
+        __add_to_done_queue(ha,sp);
+        spin_unlock_irqrestore(&ha->list_lock, flags);
+}
+
+static inline void 
+add_to_free_queue(struct scsi_qla_host * ha, srb_t * sp)
+{
+	mempool_free(sp, ha->srb_mempool);
+}
+
+static inline void 
+add_to_retry_queue(struct scsi_qla_host * ha, srb_t * sp)
+{
+        unsigned long flags;
+
+        spin_lock_irqsave(&ha->list_lock, flags);
+        __add_to_retry_queue(ha,sp);
+        spin_unlock_irqrestore(&ha->list_lock, flags);
+}
+
+static inline void 
+add_to_scsi_retry_queue(struct scsi_qla_host * ha, srb_t * sp)
+{
+        unsigned long flags;
+
+        spin_lock_irqsave(&ha->list_lock, flags);
+        __add_to_scsi_retry_queue(ha,sp);
+        spin_unlock_irqrestore(&ha->list_lock, flags);
+}
+
+/*
+ * __del_from_retry_queue
+ *      Function used to remove a command block from the
+ *      watchdog timer queue.
+ *
+ *      Note: Must insure that command is on watchdog
+ *            list before calling del_from_retry_queue
+ *            if (sp->flags & SRB_WATCHDOG)
+ *
+ * Input: 
+ *      ha = adapter block pointer.
+ *      sp = srb pointer.
+ * Locking:
+ *	this function assumes the list_lock is already taken
+ */
+static inline void 
+__del_from_retry_queue(struct scsi_qla_host * ha, srb_t * sp)
+{
+        list_del_init(&sp->list);
+
+        sp->flags &= ~(SRB_WATCHDOG | SRB_BUSY);
+        sp->state = SRB_NO_QUEUE_STATE;
+        ha->retry_q_cnt--;
+}
+
+/*
+ * __del_from_scsi_retry_queue
+ *      Function used to remove a command block from the
+ *      scsi retry queue.
+ *
+ * Input: 
+ *      ha = adapter block pointer.
+ *      sp = srb pointer.
+ * Locking:
+ *	this function assumes the list_lock is already taken
+ */
+static inline void 
+__del_from_scsi_retry_queue(struct scsi_qla_host * ha, srb_t * sp)
+{
+        list_del_init(&sp->list);
+
+        ha->scsi_retry_q_cnt--;
+        sp->state = SRB_NO_QUEUE_STATE;
+}
+
+/*
+ * del_from_retry_queue
+ *      Function used to remove a command block from the
+ *      watchdog timer queue.
+ *
+ *      Note: Must insure that command is on watchdog
+ *            list before calling del_from_retry_queue
+ *            if (sp->flags & SRB_WATCHDOG)
+ *
+ * Input: 
+ *      ha = adapter block pointer.
+ *      sp = srb pointer.
+ * Locking:
+ *	this function takes and releases the list_lock
+ */
+static inline void 
+del_from_retry_queue(struct scsi_qla_host * ha, srb_t * sp)
+{
+        unsigned long flags;
+
+        /*	if (unlikely(!(sp->flags & SRB_WATCHDOG)))
+        		BUG();*/
+        spin_lock_irqsave(&ha->list_lock, flags);
+
+        /*	if (unlikely(list_empty(&ha->retry_queue)))
+        		BUG();*/
+
+        __del_from_retry_queue(ha,sp);
+
+        spin_unlock_irqrestore(&ha->list_lock, flags);
+}
+/*
+ * del_from_scsi_retry_queue
+ *      Function used to remove a command block from the
+ *      scsi retry queue.
+ *
+ * Input: 
+ *      ha = adapter block pointer.
+ *      sp = srb pointer.
+ * Locking:
+ *	this function takes and releases the list_lock
+ */
+static inline void 
+del_from_scsi_retry_queue(struct scsi_qla_host * ha, srb_t * sp)
+{
+        unsigned long flags;
+
+        spin_lock_irqsave(&ha->list_lock, flags);
+
+        /*	if (unlikely(list_empty(&ha->scsi_retry_queue)))
+        		BUG();*/
+
+        __del_from_scsi_retry_queue(ha,sp);
+
+        spin_unlock_irqrestore(&ha->list_lock, flags);
+}
+
+/*
+ * __add_to_pending_queue
+ *      Add the standard SCB job to the bottom of standard SCB commands.
+ *
+ * Input:
+ * COMPLETE!!!
+ *      q  = SCSI LU pointer.
+ *      sp = srb pointer.
+ *      SCSI_LU_Q lock must be already obtained.
+ */
+static inline int 
+__add_to_pending_queue(struct scsi_qla_host *ha, srb_t * sp)
+{
+	int	empty;
+	/*
+        if( sp->state != SRB_NO_QUEUE_STATE &&
+        	sp->state != SRB_FREE_STATE &&
+        	sp->state != SRB_ACTIVE_STATE)
+		BUG();
+	*/
+
+	empty = list_empty(&ha->pending_queue);
+	list_add_tail(&sp->list, &ha->pending_queue);
+	ha->qthreads++;
+	sp->state = SRB_PENDING_STATE;
+
+	return (empty);
+}
+
+static inline void 
+__add_to_pending_queue_head(struct scsi_qla_host *ha, srb_t * sp)
+{
+	/*
+        if( sp->state != SRB_NO_QUEUE_STATE && 
+        	sp->state != SRB_FREE_STATE &&
+        	sp->state != SRB_ACTIVE_STATE)
+		BUG();
+	*/
+
+	list_add(&sp->list, &ha->pending_queue);
+	ha->qthreads++;
+	sp->state = SRB_PENDING_STATE;
+}
+
+static inline int
+add_to_pending_queue(struct scsi_qla_host *ha, srb_t *sp)
+{
+	int	empty;
+	unsigned long flags;
+
+	spin_lock_irqsave(&ha->list_lock, flags);
+	empty = __add_to_pending_queue(ha, sp);
+	spin_unlock_irqrestore(&ha->list_lock, flags);
+
+	return (empty);
+}
+static inline void
+add_to_pending_queue_head(struct scsi_qla_host *ha, srb_t *sp)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&ha->list_lock, flags);
+	__add_to_pending_queue_head(ha, sp);
+	spin_unlock_irqrestore(&ha->list_lock, flags);
+}
+
+static inline void
+__del_from_pending_queue(struct scsi_qla_host *ha, srb_t *sp)
+{
+	list_del_init(&sp->list);
+	ha->qthreads--;
+	sp->state = SRB_NO_QUEUE_STATE;
+}
+
+/*
+ * Failover Stuff.
+ */
+static inline void
+__add_to_failover_queue(struct scsi_qla_host * ha, srb_t * sp)
+{
+	/*
+        if( sp->state != SRB_NO_QUEUE_STATE && 
+        	sp->state != SRB_ACTIVE_STATE)
+		BUG();
+	*/
+
+        list_add_tail(&sp->list,&ha->failover_queue);
+        ha->failover_cnt++;
+        sp->state = SRB_FAILOVER_STATE;
+	sp->ha = ha;
+}
+
+static inline void add_to_failover_queue(struct scsi_qla_host * ha, srb_t * sp)
+{
+        unsigned long flags;
+
+        spin_lock_irqsave(&ha->list_lock, flags);
+
+        __add_to_failover_queue(ha,sp);
+
+        spin_unlock_irqrestore(&ha->list_lock, flags);
+}
+static inline void __del_from_failover_queue(struct scsi_qla_host * ha, srb_t *
+                sp)
+{
+        ha->failover_cnt--;
+        list_del_init(&sp->list);
+        sp->state = SRB_NO_QUEUE_STATE;
+}
+
+static inline void del_from_failover_queue(struct scsi_qla_host * ha, srb_t * sp)
+{
+        unsigned long flags;
+
+        spin_lock_irqsave(&ha->list_lock, flags);
+
+        __del_from_failover_queue(ha,sp);
+
+        spin_unlock_irqrestore(&ha->list_lock, flags);
+}
+
+static inline void 
+del_from_pending_queue(struct scsi_qla_host * ha, srb_t * sp)
+{
+        unsigned long flags;
+
+        spin_lock_irqsave(&ha->list_lock, flags);
+
+        __del_from_pending_queue(ha,sp);
+
+        spin_unlock_irqrestore(&ha->list_lock, flags);
+}
diff -Nru a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/qla_mbx.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,2778 @@
+/*
+ *                  QLOGIC LINUX SOFTWARE
+ *
+ * QLogic ISP2x00 device driver for Linux 2.6.x
+ * Copyright (C) 2003 QLogic Corporation
+ * (www.qlogic.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#include "qla_os.h"
+
+#include "qla_def.h"
+
+/*
+ *  Local Function Prototypes.
+ */
+static void
+qla2x00_mbx_sem_timeout(unsigned long);
+
+static int
+qla2x00_get_mbx_access(scsi_qla_host_t *, uint32_t);
+
+static int
+qla2x00_release_mbx_access(scsi_qla_host_t *, uint32_t);
+
+static int
+qla2x00_mbx_q_add(scsi_qla_host_t *, mbx_cmdq_t **);
+
+static void
+qla2x00_mbx_q_get(scsi_qla_host_t *, mbx_cmdq_t **);
+
+static void
+qla2x00_mbx_q_memb_alloc(scsi_qla_host_t *, mbx_cmdq_t **);
+
+static void
+qla2x00_mbx_q_memb_free(scsi_qla_host_t *, mbx_cmdq_t *);
+
+/***************************/
+/* Function implementation */
+/***************************/
+
+static void
+qla2x00_mbx_sem_timeout(unsigned long data)
+{
+	struct semaphore	*sem_ptr = (struct semaphore *)data;
+
+	DEBUG11(printk("qla2x00_sem_timeout: entered.\n");)
+
+	if (sem_ptr != NULL) {
+		up(sem_ptr);
+	}
+
+	DEBUG11(printk("qla2x00_mbx_sem_timeout: exiting.\n");)
+}
+
+/*
+ *  tov = timeout value in seconds
+ */
+static int
+qla2x00_get_mbx_access(scsi_qla_host_t *ha, uint32_t tov)
+{
+	int		ret;
+	int		prev_val = 1;  /* assume no access yet */
+	mbx_cmdq_t	*ptmp_mbq;
+	struct timer_list	tmp_cmd_timer;
+	unsigned long	cpu_flags;
+
+
+	DEBUG11(printk("qla2x00_get_mbx_access(%ld): entered.\n",
+	    ha->host_no);)
+
+	while (1) {
+		if (test_bit(MBX_CMD_WANT, &ha->mbx_cmd_flags) == 0) {
+
+			DEBUG11(printk("qla2x00_get_mbx_access(%ld): going "
+			    " to test access flags.\n", ha->host_no);)
+
+			/* No one else is waiting. Go ahead and try to
+			 * get access.
+			 */
+			if ((prev_val = test_and_set_bit(MBX_CMD_ACTIVE,
+			    &ha->mbx_cmd_flags)) == 0) {
+				break;
+			}
+		}
+
+		/* wait for previous command to finish */
+		DEBUG(printk("qla2x00_get_mbx_access(%ld): access "
+		    "flags=%lx. busy. Waiting for access. curr time=0x%lx.\n",
+		    ha->host_no, ha->mbx_cmd_flags, jiffies);)
+
+		DEBUG11(printk("qla2x00_get_mbx_access(%ld): access "
+		    "flags=%lx. busy. Waiting for access. curr time=0x%lx.\n",
+		    ha->host_no, ha->mbx_cmd_flags, jiffies);)
+
+		/*
+		 * Init timer and get semaphore from mbx q. After we got valid
+		 * semaphore pointer the MBX_CMD_WANT flag would also had
+		 * been set.
+		 */
+		qla2x00_mbx_q_add(ha, &ptmp_mbq);
+
+		if (ptmp_mbq == NULL) {
+			/* queue full? problem? can't proceed. */
+			DEBUG2_3_11(printk("qla2x00_get_mbx_access(%ld): ERROR "
+			    "no more mbx_q allowed. exiting.\n", ha->host_no);)
+
+			break;
+		}
+
+		/* init timer and semaphore */
+		init_timer(&tmp_cmd_timer);
+		tmp_cmd_timer.data = (unsigned long)&ptmp_mbq->cmd_sem;
+		tmp_cmd_timer.function =
+		    (void (*)(unsigned long))qla2x00_mbx_sem_timeout;
+		tmp_cmd_timer.expires = jiffies + tov * HZ;
+
+		DEBUG11(printk("get_mbx_access(%ld): adding timer. "
+		    "curr time=0x%lx timeoutval=0x%lx.\n",
+		    ha->host_no, jiffies, tmp_cmd_timer.expires);)
+
+			/* wait. */
+/*	 	 add_timer(&tmp_cmd_timer);*/
+		DEBUG11(printk("get_mbx_access(%ld): going to sleep. "
+		    "current time=0x%lx.\n", ha->host_no, jiffies);)
+
+		down_interruptible(&ptmp_mbq->cmd_sem);
+
+		DEBUG11(printk("get_mbx_access(%ld): woke up. current "
+		    "time=0x%lx.\n",
+		    ha->host_no, jiffies);)
+
+/*		del_timer(&tmp_cmd_timer);*/
+
+		/* try to get lock again. we'll test later to see
+		 * if we actually got the lock.
+		 */
+		prev_val = test_and_set_bit(MBX_CMD_ACTIVE,
+		    &ha->mbx_cmd_flags);
+
+		/*
+		 * After we tried to get access then we check to see
+		 * if we need to clear the MBX_CMD_WANT flag. Don't clear
+		 * this flag before trying to get access or else another
+		 * new thread might grab it before we did.
+		 */
+		spin_lock_irqsave(&ha->mbx_q_lock, cpu_flags);
+		if (ha->mbx_q_head == NULL) {
+			/* We're the last thread in queue. */
+			clear_bit(MBX_CMD_WANT, &ha->mbx_cmd_flags);
+		}
+		qla2x00_mbx_q_memb_free(ha, ptmp_mbq);
+		spin_unlock_irqrestore(&ha->mbx_q_lock, cpu_flags);
+
+		break;
+	}
+
+	if (prev_val == 0) {
+		/* We got the lock */
+		DEBUG11(printk("qla2x00_get_mbx_access(%ld): success.\n",
+		    ha->host_no);)
+
+		ret = QLA_SUCCESS;
+	} else {
+		/* Timeout or resource error. */
+		DEBUG2_3_11(printk("qla2x00_get_mbx_access(%ld): timed out.\n",
+		    ha->host_no);)
+
+		ret = QLA_FUNCTION_TIMEOUT;
+	}
+
+	return ret;
+}
+
+static int
+qla2x00_release_mbx_access(scsi_qla_host_t *ha, uint32_t tov)
+{
+	mbx_cmdq_t	*next_thread;
+
+	DEBUG11(printk("qla2x00_release_mbx_access:(%ld): entered.\n",
+	    ha->host_no);)
+
+	clear_bit(MBX_CMD_ACTIVE, &ha->mbx_cmd_flags);
+
+	/* Wake up one pending mailbox cmd thread in queue. */
+	qla2x00_mbx_q_get(ha, &next_thread);
+	if (next_thread) {
+		DEBUG11(printk("qla2x00_release_mbx_access: found pending "
+		    "mbx cmd. Waking up sem in %p.\n", &next_thread);)
+		up(&next_thread->cmd_sem);
+	}
+
+	DEBUG11(printk("qla2x00_release_mbx_access:(%ld): exiting.\n",
+	    ha->host_no);)
+
+	return QLA_SUCCESS;
+}
+
+/* Allocates a mbx_cmdq_t struct and add to the mbx_q list. */
+static int
+qla2x00_mbx_q_add(scsi_qla_host_t *ha, mbx_cmdq_t **ret_mbq)
+{
+	int		ret;
+	unsigned long	cpu_flags;
+	mbx_cmdq_t	*ptmp = NULL;
+
+	spin_lock_irqsave(&ha->mbx_q_lock, cpu_flags);
+
+	DEBUG11(printk("qla2x00_mbx_q_add: got mbx_q spinlock. "
+	    "Inst=%d.\n", apiHBAInstance);)
+
+	qla2x00_mbx_q_memb_alloc(ha, &ptmp);
+	if (ptmp == NULL) {
+		/* can't add any more threads */
+		DEBUG2_3_11(printk("qla2x00_mbx_q_add: ERROR no more "
+		    "ioctl threads allowed. Inst=%d.\n", apiHBAInstance);)
+
+		ret = QLA_MEMORY_ALLOC_FAILED;
+	} else {
+		if (ha->mbx_q_tail == NULL) {
+			/* First thread to queue. */
+			set_bit(MBX_CMD_WANT, &ha->mbx_cmd_flags);
+
+			ha->mbx_q_head = ptmp;
+		} else {
+			ha->mbx_q_tail->pnext = ptmp;
+		}
+		ha->mbx_q_tail = ptmp;
+
+		/* Now init the semaphore */
+		init_MUTEX_LOCKED(&ptmp->cmd_sem);
+		ret = QLA_SUCCESS;
+	}
+
+	*ret_mbq = ptmp;
+
+	DEBUG11(printk("qla2x00_mbx_q_add: going to release spinlock. "
+	    "ret_mbq=%p, ret=%d. Inst=%d.\n", *ret_mbq, ret, apiHBAInstance);)
+
+	spin_unlock_irqrestore(&ha->mbx_q_lock, cpu_flags);
+
+	return ret;
+}
+
+/* Just remove and return first member from mbx_cmdq.  Don't free anything. */
+static void
+qla2x00_mbx_q_get(scsi_qla_host_t *ha, mbx_cmdq_t **ret_mbq)
+{
+	unsigned long	cpu_flags;
+
+	spin_lock_irqsave(&ha->mbx_q_lock, cpu_flags);
+
+	DEBUG11(printk("qla2x00_mbx_q_get: got mbx_q spinlock. "
+	    "Inst=%d.\n", apiHBAInstance);)
+
+	/* Remove from head */
+	*ret_mbq = ha->mbx_q_head;
+	if (ha->mbx_q_head != NULL) {
+		ha->mbx_q_head = ha->mbx_q_head->pnext;
+		if (ha->mbx_q_head == NULL) {
+			/* That's the last one in queue. */
+			ha->mbx_q_tail = NULL;
+		}
+		(*ret_mbq)->pnext = NULL;
+	}
+
+	DEBUG11(printk("qla2x00_mbx_q_remove: return ret_mbq=%p. Going to "
+	    "release spinlock. Inst=%d.\n", *ret_mbq, apiHBAInstance);)
+
+	spin_unlock_irqrestore(&ha->mbx_q_lock, cpu_flags);
+}
+
+/* Find a free mbx_q member from the array. Must already got the
+ * mbx_q_lock spinlock.
+ */
+static void
+qla2x00_mbx_q_memb_alloc(scsi_qla_host_t *ha, mbx_cmdq_t **ret_mbx_q_memb)
+{
+	mbx_cmdq_t	*ptmp = NULL;
+
+	DEBUG11(printk("qla2x00_mbx_q_memb_alloc: entered. "
+	    "Inst=%d.\n", apiHBAInstance);)
+
+	ptmp = ha->mbx_sem_pool_head;
+	if (ptmp != NULL) {
+		ha->mbx_sem_pool_head = ptmp->pnext;
+		ptmp->pnext = NULL;
+		if (ha->mbx_sem_pool_head == NULL) {
+			ha->mbx_sem_pool_tail = NULL;
+		}
+	} else {
+		/* We ran out of pre-allocated semaphores.  Try to allocate
+		 * a new one.
+		 */
+		ptmp = kmalloc(sizeof(mbx_cmdq_t), GFP_ATOMIC);
+		if(ptmp)
+			memset(ptmp, 0, sizeof(mbx_cmdq_t));
+	}
+
+	*ret_mbx_q_memb = ptmp;
+
+	DEBUG11(printk("qla2x00_mbx_q_memb_alloc: return waitq_memb=%p. "
+	    "Inst=%d.\n", *ret_mbx_q_memb, apiHBAInstance);)
+}
+
+/* Add the specified mbx_q member back to the free semaphore pool. Must
+ * already got the mbx_q_lock spinlock.
+ */
+static void
+qla2x00_mbx_q_memb_free(scsi_qla_host_t *ha, mbx_cmdq_t *pfree_mbx_q_memb)
+{
+	DEBUG11(printk("qla2x00_mbx_q_memb_free: entered. Inst=%d.\n",
+	    apiHBAInstance);)
+
+	if (pfree_mbx_q_memb != NULL) {
+		if (ha->mbx_sem_pool_tail != NULL) {
+			/* Add to tail */
+			ha->mbx_sem_pool_tail->pnext = pfree_mbx_q_memb;
+		} else {
+			ha->mbx_sem_pool_head = pfree_mbx_q_memb;
+		}
+		ha->mbx_sem_pool_tail = pfree_mbx_q_memb;
+	}
+
+	/* put it back to the free pool. */
+
+	DEBUG11(printk("qla2x00_mbx_q_memb_free: exiting. "
+	    "Inst=%d.\n", apiHBAInstance);)
+}
+
+/*
+ * qla2x00_mailbox_command
+ *	Issue mailbox command and waits for completion.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	mcp = driver internal mbx struct pointer.
+ *
+ * Output:
+ *	mb[MAX_MAILBOX_REGISTER_COUNT] = returned mailbox data.
+ *
+ * Returns:
+ *	0 : QLA_SUCCESS = cmd performed success
+ *	1 : QLA_FUNCTION_FAILED   (error encountered)
+ *	6 : QLA_FUNCTION_TIMEOUT (timeout condition encountered)
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
+{
+	int		rval;
+	unsigned long    flags = 0;
+	device_reg_t     *reg       = ha->iobase;
+	struct timer_list	tmp_intr_timer;
+	uint8_t		abort_active = test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags);
+	uint8_t		io_lock_on = ha->flags.init_done;
+	uint8_t		tmp_stat = 0;
+	uint16_t	command;
+	uint16_t	*iptr, *optr;
+	uint32_t	cnt;
+	uint32_t	mboxes;
+	unsigned long	mbx_flags = 0;
+	unsigned long	wait_time;
+
+	rval = QLA_SUCCESS;
+
+	DEBUG11(printk("qla2x00_mailbox_command(%ld): entered.\n",
+	    ha->host_no);)
+	/*
+	 * Wait for active mailbox commands to finish by waiting at most
+	 * tov seconds. This is to serialize actual issuing of mailbox cmds
+	 * during non ISP abort time.
+	 */
+	if (!abort_active) {
+		tmp_stat = qla2x00_get_mbx_access(ha, mcp->tov);
+		if (tmp_stat != QLA_SUCCESS) {
+			/* Timeout occurred. Return error. */
+			DEBUG2_3_11(printk("qla2x00_mailbox_command(%ld): cmd "
+			    "access timeout. Exiting.\n", ha->host_no);)
+			return QLA_FUNCTION_TIMEOUT;
+		}
+	}
+
+	ha->flags.mbox_busy = TRUE;
+	/* Save mailbox command for debug */
+	ha->mcp = mcp;
+
+	/* Try to get mailbox register access */
+	if (!abort_active)
+		spin_lock_irqsave(&ha->mbx_reg_lock, mbx_flags);
+
+	DEBUG11(printk("scsi%d: prepare to issue mbox cmd=0x%x.\n",
+	    (int)ha->host_no, mcp->mb[0]);)
+
+	spin_lock_irqsave(&ha->hardware_lock, flags);
+
+	/* Load mailbox registers. */
+	optr = (uint16_t *)MAILBOX_REG(ha, reg, 0);
+
+	iptr = mcp->mb;
+	command = mcp->mb[0];
+	mboxes = mcp->out_mb;
+
+	for (cnt = 0; cnt < ha->mbx_count; cnt++) {
+		if (IS_QLA2200(ha) && cnt == 8)
+			optr = (uint16_t *)MAILBOX_REG(ha, reg, 8);
+		if (mboxes & BIT_0)
+			WRT_REG_WORD(optr, *iptr);
+
+		mboxes >>= 1;
+		optr++;
+		iptr++;
+	}
+
+#if defined(QL_DEBUG_LEVEL_1)
+	printk("qla2x00_mailbox_command: Loaded MBX registers "
+	    "(displayed in bytes) = \n");
+	qla2x00_dump_buffer((uint8_t *)mcp->mb, 16);
+	printk("\n");
+	qla2x00_dump_buffer(((uint8_t *)mcp->mb + 0x10), 16);
+	printk("\n");
+	qla2x00_dump_buffer(((uint8_t *)mcp->mb + 0x20), 8);
+	printk("\n");
+	printk("qla2x00_mailbox_command: I/O address = %lx.\n",
+	    (u_long)optr);
+	qla2x00_dump_regs(ha);
+#endif
+
+	/* Issue set host interrupt command to send cmd out. */
+	ha->flags.mbox_int = FALSE;
+	clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
+
+	/* Unlock mbx registers and wait for interrupt */
+
+	DEBUG11(printk("qla2x00_mailbox_command: going to unlock irq & "
+	    "waiting for interrupt. jiffies=%lx.\n", jiffies);)
+
+	/* Wait for mbx cmd completion until timeout */
+
+	if (!abort_active && io_lock_on) {
+		/* sleep on completion semaphore */
+		DEBUG11(printk("qla2x00_mailbox_command(%ld): "
+		    "INTERRUPT MODE. Initializing timer.\n",
+		    ha->host_no);)
+
+		init_timer(&tmp_intr_timer);
+		tmp_intr_timer.data = (unsigned long)&ha->mbx_intr_sem;
+		tmp_intr_timer.expires = jiffies + mcp->tov * HZ;
+		tmp_intr_timer.function =
+		    (void (*)(unsigned long))qla2x00_mbx_sem_timeout;
+
+		DEBUG11(printk("qla2x00_mailbox_command(%ld): "
+		    "Adding timer.\n", ha->host_no);)
+		add_timer(&tmp_intr_timer);
+
+		DEBUG11(printk("qla2x00_mailbox_command: going to "
+		    "unlock & sleep. time=0x%lx.\n", jiffies);)
+
+		set_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags);
+
+		WRT_REG_WORD(&reg->hccr, HCCR_SET_HOST_INT);
+		spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+		if (!abort_active)
+			spin_unlock_irqrestore(&ha->mbx_reg_lock, mbx_flags);
+
+		/* Wait for either the timer to expire
+		 * or the mbox completion interrupt
+		 */
+		down(&ha->mbx_intr_sem);
+
+		DEBUG11(printk("qla2x00_mailbox_command:"
+		    "waking up."
+		    "time=0x%lx\n", jiffies);)
+		clear_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags);
+
+		/* delete the timer */
+		del_timer(&tmp_intr_timer);
+	} else {
+
+		DEBUG3_11(printk("qla2x00_mailbox_command(%ld): cmd=%x "
+			"POLLING MODE.\n", ha->host_no, command);)
+
+		WRT_REG_WORD(&reg->hccr, HCCR_SET_HOST_INT);
+		spin_unlock_irqrestore(&ha->hardware_lock, flags);
+		if (!abort_active)
+			spin_unlock_irqrestore(&ha->mbx_reg_lock, mbx_flags);
+
+		wait_time = jiffies + mcp->tov * HZ; /* wait at most tov secs */
+		while (!ha->flags.mbox_int) {
+			if (time_after(jiffies, wait_time))
+				break;
+
+			/* Check for pending interrupts. */
+			qla2x00_poll(ha);
+
+			udelay(10); /* v4.27 */
+		} /* while */
+	}
+
+	if (!abort_active)
+		spin_lock_irqsave(&ha->mbx_reg_lock, mbx_flags);
+
+	/* Check whether we timed out */
+	if (ha->flags.mbox_int) {
+
+		DEBUG3_11(printk("qla2x00_mailbox_cmd: cmd %x completed.\n",
+		    command);)
+
+		/* Got interrupt. Clear the flag. */
+		ha->flags.mbox_int = FALSE;
+		clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
+
+		if (ha->mailbox_out[0] != MBS_COMMAND_COMPLETE) {
+			qla2x00_stats.mboxerr++;
+			rval = QLA_FUNCTION_FAILED;
+		}
+
+		/* Load return mailbox registers. */
+		optr = mcp->mb;
+		iptr = (uint16_t *)&ha->mailbox_out[0];
+		mboxes = mcp->in_mb;
+		for (cnt = 0; cnt < ha->mbx_count; cnt++) {
+			if (mboxes & BIT_0)
+				*optr = *iptr;
+
+			mboxes >>= 1;
+			optr++;
+			iptr++;
+		}
+	} else {
+
+#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) || \
+		defined(QL_DEBUG_LEVEL_11)
+		printk("qla2x00_mailbox_command(%ld): **** MB Command Timeout "
+		    "for cmd %x ****\n", ha->host_no, command);
+		printk("qla2x00_mailbox_command: icontrol=%x jiffies=%lx\n",
+		    RD_REG_WORD(&reg->ictrl), jiffies);
+		printk("qla2x00_mailbox_command: *** mailbox[0] = 0x%x ***\n",
+		    RD_REG_WORD(optr));
+		qla2x00_dump_regs(ha);
+#endif
+
+		qla2x00_stats.mboxtout++;
+		ha->total_mbx_timeout++;
+		rval = QLA_FUNCTION_TIMEOUT;
+	}
+
+	if (!abort_active)
+		spin_unlock_irqrestore(&ha->mbx_reg_lock, mbx_flags);
+
+	ha->flags.mbox_busy = FALSE;
+
+	/* Clean up */
+	ha->mcp = NULL;
+
+	if (!abort_active) {
+		DEBUG11(printk("qla2x00_mailbox_cmd: checking for additional "
+		    "resp interrupt.\n");)
+
+		/* polling mode for non isp_abort commands. */
+		qla2x00_poll(ha);
+	}
+
+	if (rval == QLA_FUNCTION_TIMEOUT) {
+		if (!io_lock_on || (mcp->flags & IOCTL_CMD)) {
+			/* not in dpc. schedule it for dpc to take over. */
+			DEBUG(printk("qla2x00_mailbox_command(%ld): timeout "
+			    "schedule isp_abort_needed.\n",
+			    ha->host_no);)
+			DEBUG2_3_11(printk("qla2x00_mailbox_command(%ld): "
+			    "timeout schedule isp_abort_needed.\n",
+			    ha->host_no);)
+			set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+			if (ha->dpc_wait && !ha->dpc_active) 
+				up(ha->dpc_wait);
+
+		} else if (!abort_active) {
+
+			/* call abort directly since we are in the DPC thread */
+			DEBUG(printk("qla2x00_mailbox_command(%ld): timeout "
+			    "calling abort_isp\n", ha->host_no);)
+			DEBUG2_3_11(printk("qla2x00_mailbox_command(%ld): "
+			    "timeout calling abort_isp\n", ha->host_no);)
+
+			set_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags);
+			clear_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+			if (qla2x00_abort_isp(ha)) {
+				/* failed. retry later. */
+				set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+			}
+			clear_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags);
+
+			DEBUG(printk("qla2x00_mailbox_command: finished "
+			    "abort_isp\n");)
+			DEBUG2_3_11(printk("qla2x00_mailbox_command: finished "
+			    "abort_isp\n");)
+		}
+	}
+
+	/* Allow next mbx cmd to come in. */
+	if (!abort_active) {
+		tmp_stat = qla2x00_release_mbx_access(ha, mcp->tov);
+
+		if (rval == 0)
+			rval = tmp_stat;
+	}
+
+	if (rval) {
+		DEBUG2_3_11(printk("qla2x00_mailbox_command(%ld): **** FAILED. "
+		    "mbx0=%x, mbx1=%x, mbx2=%x, cmd=%x ****\n",
+		ha->host_no, mcp->mb[0], mcp->mb[1], mcp->mb[2], command);)
+	} else {
+		DEBUG11(printk("qla2x00_mailbox_command(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	DEBUG11(printk("qla2x00_mailbox_command(%ld): exiting.\n",
+	    ha->host_no);)
+
+	return rval;
+}
+
+/*
+ * qla2x00_load_ram
+ *	Load adapter RAM using DMA.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_load_ram(scsi_qla_host_t *ha, dma_addr_t req_dma, uint16_t risc_addr,
+    uint16_t risc_code_size)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+	uint32_t	req_len;
+	dma_addr_t	nml_dma;
+	uint32_t	nml_len;
+	uint32_t	normalized;
+
+	DEBUG11(printk("qla2x00_load_ram(%ld): entered.\n",
+	    ha->host_no);)
+
+	req_len = risc_code_size;
+	nml_dma = 0;
+	nml_len = 0;
+
+	normalized = qla2x00_normalize_dma_addr(&req_dma, &req_len, &nml_dma,
+	    &nml_len);
+
+	/* Load first segment */
+	mcp->mb[0] = MBC_LOAD_RISC_RAM;
+	mcp->mb[1] = risc_addr;
+	mcp->mb[2] = MSW(req_dma);
+	mcp->mb[3] = LSW(req_dma);
+	mcp->mb[4] = (uint16_t)req_len;
+	mcp->mb[6] = MSW(MSD(req_dma));
+	mcp->mb[7] = LSW(MSD(req_dma));
+	mcp->out_mb = MBX_7|MBX_6|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->in_mb = MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	/* Load second segment - if necessary */
+	if (normalized && (rval == QLA_SUCCESS)) {
+		mcp->mb[0] = MBC_LOAD_RISC_RAM;
+		mcp->mb[1] = risc_addr + (uint16_t)req_len;
+		mcp->mb[2] = MSW(nml_dma);
+		mcp->mb[3] = LSW(nml_dma);
+		mcp->mb[4] = (uint16_t)nml_len;
+		mcp->mb[6] = MSW(MSD(nml_dma));
+		mcp->mb[7] = LSW(MSD(nml_dma));
+		mcp->out_mb = MBX_7|MBX_6|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
+		mcp->in_mb = MBX_0;
+		mcp->tov = 30;
+		mcp->flags = 0;
+		rval = qla2x00_mailbox_command(ha, mcp);
+	}
+
+	if (rval == QLA_SUCCESS) {
+		/* Empty */
+		DEBUG11(printk("qla2x00_load_ram(%ld): done.\n", ha->host_no);)
+	} else {
+		/* Empty */
+		DEBUG2_3_11(printk("qla2x00_load_ram(%ld): failed. rval=%x "
+		    "mb[0]=%x.\n", ha->host_no, rval, mcp->mb[0]);)
+	}
+	return rval;
+}
+
+/*
+ * qla2x00_load_ram_ext
+ *	Load adapter extended RAM using DMA.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_load_ram_ext(scsi_qla_host_t *ha, dma_addr_t req_dma,
+    uint32_t risc_addr, uint16_t risc_code_size)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+	uint32_t	req_len;
+	dma_addr_t	nml_dma;
+	uint32_t	nml_len;
+	uint32_t	normalized;
+
+	DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
+
+	req_len = risc_code_size;
+	nml_dma = 0;
+	nml_len = 0;
+
+	normalized = qla2x00_normalize_dma_addr(&req_dma, &req_len, &nml_dma,
+	    &nml_len);
+
+	/* Load first segment */
+	mcp->mb[0] = MBC_LOAD_RISC_RAM_EXTENDED;
+	mcp->mb[1] = LSW(risc_addr);
+	mcp->mb[2] = MSW(req_dma);
+	mcp->mb[3] = LSW(req_dma);
+	mcp->mb[4] = (uint16_t)req_len;
+	mcp->mb[6] = MSW(MSD(req_dma));
+	mcp->mb[7] = LSW(MSD(req_dma));
+	mcp->mb[8] = MSW(risc_addr);
+	mcp->out_mb = MBX_8|MBX_7|MBX_6|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->in_mb = MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	/* Load second segment - if necessary */
+	if (normalized && (rval == QLA_SUCCESS)) {
+		risc_addr += req_len;
+		mcp->mb[0] = MBC_LOAD_RISC_RAM_EXTENDED;
+		mcp->mb[1] = LSW(risc_addr);
+		mcp->mb[2] = MSW(nml_dma);
+		mcp->mb[3] = LSW(nml_dma);
+		mcp->mb[4] = (uint16_t)nml_len;
+		mcp->mb[6] = MSW(MSD(nml_dma));
+		mcp->mb[7] = LSW(MSD(nml_dma));
+		mcp->mb[8] = MSW(risc_addr);
+		mcp->out_mb = MBX_8|MBX_7|MBX_6|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
+		mcp->in_mb = MBX_0;
+		mcp->tov = 30;
+		mcp->flags = 0;
+		rval = qla2x00_mailbox_command(ha, mcp);
+	}
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("%s(%ld): failed=%x mb[0]=%x.\n",
+		    __func__, ha->host_no, rval, mcp->mb[0]));
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_execute_fw
+ *	Start adapter firmware.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	TARGET_QUEUE_LOCK must be released.
+ *	ADAPTER_STATE_LOCK must be released.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_execute_fw(scsi_qla_host_t *ha)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("qla2x00_execute_fw(%ld): entered.\n", ha->host_no);)
+
+	mcp->mb[0] = MBC_EXECUTE_FIRMWARE;
+	mcp->mb[1] = *ha->brd_info->fw_info[0].fwstart;
+	mcp->out_mb = MBX_1|MBX_0;
+	if (IS_QLA2322(ha)) {
+		mcp->mb[2] = 0;
+		mcp->out_mb |= MBX_2;
+	}
+
+	mcp->in_mb = MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	DEBUG11(printk("qla2x00_execute_fw(%ld): done.\n", ha->host_no);)
+
+	return rval;
+}
+
+/*
+ * qla2x00_get_fw_version
+ *	Get firmware version.
+ *
+ * Input:
+ *	ha:		adapter state pointer.
+ *	major:		pointer for major number.
+ *	minor:		pointer for minor number.
+ *	subminor:	pointer for subminor number.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+void
+qla2x00_get_fw_version(scsi_qla_host_t *ha, uint16_t *major, uint16_t *minor,
+    uint16_t *subminor, uint16_t *attributes)
+{
+	int		rval;
+	mbx_cmd_t	mc;
+	mbx_cmd_t	*mcp = &mc;
+
+	DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
+
+	mcp->mb[0] = MBC_GET_FIRMWARE_VERSION;
+	mcp->out_mb = MBX_0;
+	mcp->in_mb = MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->flags = 0;
+	mcp->tov = 30;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	/* Return mailbox data. */
+	*major = mcp->mb[1];
+	*minor = mcp->mb[2];
+	*subminor = mcp->mb[3];
+	*attributes = mcp->mb[6];
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__,
+		    ha->host_no, rval));
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
+	}
+}
+
+/*
+ * qla2x00_get_fw_options
+ *	Set firmware options.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	fwopt = pointer for firmware options.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_get_fw_options(scsi_qla_host_t *ha, uint16_t *fwopts)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
+
+	mcp->mb[0] = MBC_GET_FIRMWARE_OPTION;
+	mcp->out_mb = MBX_0;
+	mcp->in_mb = MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__,
+		    ha->host_no, rval));
+	} else {
+		fwopts[1] = mcp->mb[1];
+		fwopts[2] = mcp->mb[2];
+		fwopts[3] = mcp->mb[3];
+
+		DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
+	}
+
+	return rval;
+}
+
+
+/*
+ * qla2x00_set_fw_options
+ *	Set firmware options.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	fwopt = pointer for firmware options.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_set_fw_options(scsi_qla_host_t *ha, uint16_t *fwopts)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
+
+	mcp->mb[0] = MBC_SET_FIRMWARE_OPTION;
+	mcp->mb[1] = fwopts[1];
+	mcp->mb[2] = fwopts[2];
+	mcp->mb[3] = fwopts[3];
+	mcp->mb[10] = fwopts[10];
+	mcp->mb[11] = fwopts[11];
+	mcp->mb[12] = 0;	/* Undocumented, but used */
+	mcp->out_mb = MBX_12|MBX_11|MBX_10|MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->in_mb = MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__,
+		    ha->host_no, rval));
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_read_ram_word
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_read_ram_word(scsi_qla_host_t *ha, uint16_t addr, uint16_t *data)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("qla2x00_read_ram_word(%ld): entered.\n", ha->host_no);)
+
+	mcp->mb[0] = MBC_READ_RAM_WORD;
+	mcp->mb[1] = addr;
+	mcp->out_mb = MBX_1|MBX_0;
+	mcp->in_mb = MBX_0|MBX_2;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("qla2x00_read_ram_word(%ld): failed=%x.\n",
+		    ha->host_no, rval);)
+	} else {
+		*data = mcp->mb[2];
+		DEBUG11(printk("qla2x00_read_ram_word(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_write_ram_word
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_write_ram_word(scsi_qla_host_t *ha, uint16_t addr, uint16_t data)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("qla2x00_write_ram_word(%ld): entered.\n",
+	    ha->host_no);)
+
+	mcp->mb[0] = MBC_WRITE_RAM_WORD;
+	mcp->mb[1] = addr;
+	mcp->mb[2] = data;
+	mcp->out_mb = MBX_2|MBX_1|MBX_0;
+	mcp->in_mb = MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("qla2x00_write_ram_word(%ld): failed=%x.\n",
+		    ha->host_no, rval);)
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("qla2x00_write_ram_word(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_write_ram_word_ext
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_write_ram_word_ext(scsi_qla_host_t *ha, uint32_t addr, uint16_t data)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
+
+	mcp->mb[0] = MBC_WRITE_RAM_WORD_EXTENDED;
+	mcp->mb[1] = LSW(addr);
+	mcp->mb[2] = data;
+	mcp->mb[8] = MSW(addr);
+	mcp->out_mb = MBX_8|MBX_2|MBX_1|MBX_0;
+	mcp->in_mb = MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__,
+		    ha->host_no, rval));
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_mbx_reg_test
+ *	Mailbox register wrap test.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	TARGET_QUEUE_LOCK must be released.
+ *	ADAPTER_STATE_LOCK must be released.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_mbx_reg_test(scsi_qla_host_t *ha)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("qla2x00_mbx_reg_test(%ld): entered.\n", ha->host_no);)
+
+	mcp->mb[0] = MBC_MAILBOX_REGISTER_TEST;
+	mcp->mb[1] = 0xAAAA;
+	mcp->mb[2] = 0x5555;
+	mcp->mb[3] = 0xAA55;
+	mcp->mb[4] = 0x55AA;
+	mcp->mb[5] = 0xA5A5;
+	mcp->mb[6] = 0x5A5A;
+	mcp->mb[7] = 0x2525;
+	mcp->out_mb = MBX_7|MBX_6|MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->in_mb = MBX_7|MBX_6|MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval == QLA_SUCCESS) {
+		if (mcp->mb[1] != 0xAAAA || mcp->mb[2] != 0x5555 ||
+		    mcp->mb[3] != 0xAA55 || mcp->mb[4] != 0x55AA)
+			rval = QLA_FUNCTION_FAILED;
+		if (mcp->mb[5] != 0xA5A5 || mcp->mb[6] != 0x5A5A ||
+		    mcp->mb[7] != 0x2525)
+			rval = QLA_FUNCTION_FAILED;
+	}
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("qla2x00_mbx_reg_test(%ld): failed=%x.\n",
+		    ha->host_no, rval);)
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("qla2x00_mbx_reg_test(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_verify_checksum
+ *	Verify firmware checksum.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	TARGET_QUEUE_LOCK must be released.
+ *	ADAPTER_STATE_LOCK must be released.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_verify_checksum(scsi_qla_host_t *ha)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("qla2x00_verify_checksum(%ld): entered.\n",
+	    ha->host_no);)
+
+	mcp->mb[0] = MBC_VERIFY_CHECKSUM;
+	mcp->mb[1] = *ha->brd_info->fw_info[0].fwstart;
+	mcp->out_mb = MBX_1|MBX_0;
+	mcp->in_mb = MBX_2|MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("qla2x00_verify_checksum(%ld): failed=%x.\n",
+		    ha->host_no, rval);)
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("qla2x00_verify_checksum(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_issue_iocb
+ *	Issue IOCB using mailbox command
+ *
+ * Input:
+ *	ha = adapter state pointer.
+ *	buffer = buffer pointer.
+ *	phys_addr = physical address of buffer.
+ *	size = size of buffer.
+ *	TARGET_QUEUE_LOCK must be released.
+ *	ADAPTER_STATE_LOCK must be released.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_issue_iocb(scsi_qla_host_t *ha, void*  buffer, dma_addr_t phys_addr,
+    size_t size)
+{
+	int		rval;
+	mbx_cmd_t	mc;
+	mbx_cmd_t	*mcp = &mc;
+
+	ENTER("qla2x00_issue_iocb: started");
+
+	mcp->mb[0] = MBC_IOCB_COMMAND_A64;
+	mcp->mb[1] = 0;
+	mcp->mb[2] = MSW(phys_addr);
+	mcp->mb[3] = LSW(phys_addr);
+	mcp->mb[6] = MSW(MSD(phys_addr));
+	mcp->mb[7] = LSW(MSD(phys_addr));
+	mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->in_mb = MBX_2|MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG(printk("qla2x00_issue_iocb(%ld): failed rval 0x%x",
+		    ha->host_no,rval);)
+		DEBUG2(printk("qla2x00_issue_iocb(%ld): failed rval 0x%x",
+		    ha->host_no,rval);)
+	} else {
+		/*EMPTY*/
+		LEAVE("qla2x00_issue_iocb: exiting normally");
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_abort_command
+ *	Abort command aborts a specified IOCB.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	sp = SB structure pointer.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_abort_command(scsi_qla_host_t *ha, srb_t *sp)
+{
+	unsigned long   flags = 0;
+	fc_port_t	*fcport;
+	int		rval;
+	uint32_t	handle;
+	mbx_cmd_t	mc;
+	mbx_cmd_t	*mcp = &mc;
+
+	DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", ha->host_no);)
+
+	fcport = sp->fclun->fcport;
+
+	if (atomic_read(&ha->loop_state) == LOOP_DOWN ||
+	    atomic_read(&fcport->state) == FCS_DEVICE_LOST) {
+		/* v2.19.8 Ignore abort request if port is down */
+		return 1;
+	}
+
+	spin_lock_irqsave(&ha->hardware_lock, flags);
+	for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) {
+		if (ha->outstanding_cmds[handle] == sp)
+			break;
+	}
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+	if (handle == MAX_OUTSTANDING_COMMANDS) {
+		/* command not found */
+		return QLA_FUNCTION_FAILED;
+	}
+
+	mcp->mb[0] = MBC_ABORT_COMMAND;
+	if (HAS_EXTENDED_IDS(ha))
+		mcp->mb[1] = fcport->loop_id;
+	else
+		mcp->mb[1] = fcport->loop_id << 8;
+	mcp->mb[2] = (uint16_t)handle;
+	mcp->mb[3] = (uint16_t)(handle >> 16);
+	mcp->mb[6] = (uint16_t)sp->fclun->lun;
+	mcp->out_mb = MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->in_mb = MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		DEBUG2_3_11(printk("qla2x00_abort_command(%ld): failed=%x.\n",
+		    ha->host_no, rval);)
+	} else {
+		sp->flags |= SRB_ABORT_PENDING;
+		DEBUG11(printk("qla2x00_abort_command(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_abort_device
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *      loop_id  = FC loop ID
+ *      lun  = SCSI LUN.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_abort_device(scsi_qla_host_t *ha, uint16_t loop_id, uint16_t lun)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("qla2x00_abort_device(%ld): entered.\n", ha->host_no);)
+
+	mcp->mb[0] = MBC_ABORT_DEVICE;
+	if (HAS_EXTENDED_IDS(ha))
+		mcp->mb[1] = loop_id;
+	else
+		mcp->mb[1] = loop_id << 8;
+	mcp->mb[2] = lun;
+	mcp->out_mb = MBX_2|MBX_1|MBX_0;
+	mcp->in_mb = MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	/* Issue marker command. */
+	qla2x00_marker(ha, loop_id, lun, MK_SYNC_ID_LUN);
+
+	if (rval != QLA_SUCCESS) {
+		set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+		if (ha->dpc_wait && !ha->dpc_active) 
+			up(ha->dpc_wait);
+		DEBUG2_3_11(printk("qla2x00_abort_device(%ld): failed=%x.\n",
+		    ha->host_no, rval);)
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("qla2x00_abort_device(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	return rval;
+}
+
+#if USE_ABORT_TGT
+/*
+ * qla2x00_abort_target
+ *	Issue abort target mailbox command.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_abort_target(fc_port_t *fcport)
+{
+	int        rval;
+	mbx_cmd_t  mc;
+	mbx_cmd_t  *mcp = &mc;
+
+	DEBUG11(printk("qla2x00_abort_target(%ld): entered.\n",
+	    fcport->ha->host_no);)
+
+	if (fcport == NULL) {
+		/* no target to abort */
+		return 0;
+	}
+
+	mcp->mb[0] = MBC_ABORT_TARGET;
+	mcp->out_mb = MBX_2|MBX_1|MBX_0;
+	if (HAS_EXTENDED_IDS(fcport->ha)) {
+		mcp->mb[1] = fcport->loop_id;
+		mcp->mb[10] = 0;
+		mcp->out_mb |= MBX_10;
+	} else {
+		mcp->mb[1] = fcport->loop_id << 8;
+	}
+	mcp->mb[2] = fcport->ha->loop_reset_delay;
+
+	mcp->in_mb = MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(fcport->ha, mcp);
+
+	/* Issue marker command. */
+	fcport->ha->marker_needed = 1;
+
+	if (rval != QLA_SUCCESS) {
+		DEBUG2_3_11(printk("qla2x00_abort_target(%ld): failed=%x.\n",
+		    fcport->ha->host_no, rval);)
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("qla2x00_abort_target(%ld): done.\n",
+		    fcport->ha->host_no);)
+	}
+
+	return rval;
+}
+#endif
+
+/*
+ * qla2x00_target_reset
+ *	Issue target reset mailbox command.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	TARGET_QUEUE_LOCK must be released.
+ *	ADAPTER_STATE_LOCK must be released.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_target_reset(scsi_qla_host_t *ha, uint16_t b, uint16_t t)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+	os_tgt_t *tgt;
+
+	DEBUG11(printk("qla2x00_target_reset(%ld): entered.\n", ha->host_no);)
+
+	tgt = TGT_Q(ha, t);
+	if (tgt->fcport == NULL) {
+		/* no target to abort */
+		return 0;
+	}
+	if (atomic_read(&tgt->fcport->state) != FCS_ONLINE) {
+		/* target not online */
+		return 0;
+	}
+
+	mcp->mb[0] = MBC_TARGET_RESET;
+	if (HAS_EXTENDED_IDS(ha))
+		mcp->mb[1] = tgt->fcport->loop_id;
+	else
+		mcp->mb[1] = tgt->fcport->loop_id << 8;
+	mcp->mb[2] = ha->loop_reset_delay;
+	mcp->out_mb = MBX_2|MBX_1|MBX_0;
+	mcp->in_mb = MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("qla2x00_target_reset(%ld): failed=%x.\n",
+		    ha->host_no, rval);)
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("qla2x00_target_reset(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_get_adapter_id
+ *	Get adapter ID and topology.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	id = pointer for loop ID.
+ *	al_pa = pointer for AL_PA.
+ *	area = pointer for area.
+ *	domain = pointer for domain.
+ *	top = pointer for topology.
+ *	TARGET_QUEUE_LOCK must be released.
+ *	ADAPTER_STATE_LOCK must be released.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_get_adapter_id(scsi_qla_host_t *ha, uint16_t *id, uint8_t *al_pa,
+    uint8_t *area, uint8_t *domain, uint16_t *top)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("qla2x00_get_adapter_id(%ld): entered.\n",
+	    ha->host_no);)
+
+	mcp->mb[0] = MBC_GET_ADAPTER_LOOP_ID;
+	mcp->out_mb = MBX_0;
+	mcp->in_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	/* Return data. */
+	*id = mcp->mb[1];
+	*al_pa = LSB(mcp->mb[2]);
+	*area = MSB(mcp->mb[2]);
+	*domain	= LSB(mcp->mb[3]);
+	*top = mcp->mb[6];
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("qla2x00_get_adapter_id(%ld): failed=%x.\n",
+		    ha->host_no, rval);)
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("qla2x00_get_adapter_id(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_get_retry_cnt
+ *	Get current firmware login retry count and delay.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	retry_cnt = pointer to login retry count.
+ *	tov = pointer to login timeout value.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_get_retry_cnt(scsi_qla_host_t *ha, uint8_t *retry_cnt, uint8_t *tov,
+    uint16_t *r_a_tov)
+{
+	int rval;
+	uint16_t ratov;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("qla2x00_get_retry_cnt(%ld): entered.\n",
+			ha->host_no);)
+
+	mcp->mb[0] = MBC_GET_RETRY_COUNT;
+	mcp->out_mb = MBX_0;
+	mcp->in_mb = MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("qla2x00_get_retry_cnt(%ld): failed = %x.\n",
+		    ha->host_no, mcp->mb[0]);)
+	} else {
+		/* Convert returned data and check our values. */
+		*r_a_tov = mcp->mb[3] / 2;
+		ratov = (mcp->mb[3]/2) / 10;  /* mb[3] value is in 100ms */
+		if (mcp->mb[1] * ratov > (*retry_cnt) * (*tov)) {
+			/* Update to the larger values */
+			*retry_cnt = (uint8_t)mcp->mb[1];
+			*tov = ratov;
+		}
+
+		DEBUG11(printk("qla2x00_get_retry_cnt(%ld): done. mb3=%d "
+		    "ratov=%d.\n", ha->host_no, mcp->mb[3], ratov);)
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_init_firmware
+ *	Initialize adapter firmware.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	dptr = Initialization control block pointer.
+ *	size = size of initialization control block.
+ *	TARGET_QUEUE_LOCK must be released.
+ *	ADAPTER_STATE_LOCK must be released.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_init_firmware(scsi_qla_host_t *ha, uint16_t size)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("qla2x00_init_firmware(%ld): entered.\n",
+	    ha->host_no);)
+
+	mcp->mb[0] = MBC_INITIALIZE_FIRMWARE;
+	mcp->mb[2] = MSW(ha->init_cb_dma);
+	mcp->mb[3] = LSW(ha->init_cb_dma);
+	mcp->mb[4] = 0;
+	mcp->mb[5] = 0;
+	mcp->mb[6] = MSW(MSD(ha->init_cb_dma));
+	mcp->mb[7] = LSW(MSD(ha->init_cb_dma));
+	mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_0;
+	mcp->in_mb = MBX_5|MBX_4|MBX_0;
+	mcp->buf_size = size;
+	mcp->flags = MBX_DMA_OUT;
+	mcp->tov = 30;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("qla2x00_init_firmware(%ld): failed=%x "
+		    "mb0=%x.\n",
+		    ha->host_no, rval, mcp->mb[0]);)
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("qla2x00_init_firmware(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_get_port_database
+ *	Issue normal/enhanced get port database mailbox command
+ *	and copy device name as necessary.
+ *
+ * Input:
+ *	ha = adapter state pointer.
+ *	dev = structure pointer.
+ *	opt = enhanced cmd option byte.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_get_port_database(scsi_qla_host_t *ha, fc_port_t *fcport, uint8_t opt)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+	port_database_t *pd;
+	dma_addr_t pd_dma;
+
+	DEBUG11(printk("qla2x00_get_port_database(%ld): entered.\n",
+	    ha->host_no);)
+
+	pd = pci_alloc_consistent(ha->pdev, PORT_DATABASE_SIZE, &pd_dma);
+	if (pd  == NULL) {
+		DEBUG2_3_11(printk("qla2x00_get_port_database(%ld): **** "
+		    "Mem Alloc Failed ****", ha->host_no);)
+		return QLA_MEMORY_ALLOC_FAILED;
+	}
+	memset(pd, 0, PORT_DATABASE_SIZE);
+
+	if (opt != 0)
+		mcp->mb[0] = MBC_ENHANCED_GET_PORT_DATABASE;
+	else
+		mcp->mb[0] = MBC_GET_PORT_DATABASE;
+	mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
+	if (HAS_EXTENDED_IDS(ha)) {
+		mcp->mb[1] = fcport->loop_id;
+		mcp->mb[10] = opt;
+		mcp->out_mb |= MBX_10;
+	} else {
+		mcp->mb[1] = fcport->loop_id << 8 | opt;
+	}
+	mcp->mb[2] = MSW(pd_dma);
+	mcp->mb[3] = LSW(pd_dma);
+	mcp->mb[6] = MSW(MSD(pd_dma));
+	mcp->mb[7] = LSW(MSD(pd_dma));
+
+	mcp->in_mb = MBX_0;
+	mcp->buf_size = PORT_DATABASE_SIZE;
+	mcp->flags = MBX_DMA_IN;
+	mcp->tov =  ha->login_timeout * 2;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval == QLA_SUCCESS) {
+		/* Names are little-endian. */
+		memcpy(fcport->node_name, pd->node_name, WWN_SIZE);
+		memcpy(fcport->port_name, pd->port_name, WWN_SIZE);
+
+		/* Get port_id of device. */
+		fcport->d_id.b.al_pa = pd->port_id[2];
+		fcport->d_id.b.area = pd->port_id[3];
+		fcport->d_id.b.domain = pd->port_id[0];
+		fcport->d_id.b.rsvd_1 = 0;
+
+		/* Check for device require authentication. */
+		pd->common_features & BIT_5 ? (fcport->flags |= FCF_AUTH_REQ) :
+		    (fcport->flags &= ~FCF_AUTH_REQ);
+
+		/* If not target must be initiator or unknown type. */
+		if ((pd->prli_svc_param_word_3[0] & BIT_4) == 0) {
+			fcport->port_type = FCT_INITIATOR;
+		} else {
+			fcport->port_type = FCT_TARGET;
+
+			/* Check for logged in. */
+			if (pd->master_state != PD_STATE_PORT_LOGGED_IN &&
+			    pd->slave_state != PD_STATE_PORT_LOGGED_IN)
+				rval = QLA_FUNCTION_FAILED;
+		}
+	}
+
+	pci_free_consistent(ha->pdev, PORT_DATABASE_SIZE, pd, pd_dma);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("qla2x00_get_port_database(%ld): "
+		    "failed=%x.\n", ha->host_no, rval);)
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("qla2x00_get_port_database(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_get_firmware_state
+ *	Get adapter firmware state.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	dptr = pointer for firmware state.
+ *	TARGET_QUEUE_LOCK must be released.
+ *	ADAPTER_STATE_LOCK must be released.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_get_firmware_state(scsi_qla_host_t *ha, uint16_t *dptr)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("qla2x00_get_firmware_state(%ld): entered.\n",
+	    ha->host_no);)
+
+	mcp->mb[0] = MBC_GET_FIRMWARE_STATE;
+	mcp->out_mb = MBX_0;
+	mcp->in_mb = MBX_2|MBX_1|MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	/* Return firmware state. */
+	*dptr = mcp->mb[1];
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("qla2x00_get_firmware_state(%ld): "
+		    "failed=%x.\n", ha->host_no, rval);)
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("qla2x00_get_firmware_state(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_get_port_name
+ *	Issue get port name mailbox command.
+ *	Returned name is in big endian format.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	loop_id = loop ID of device.
+ *	name = pointer for name.
+ *	TARGET_QUEUE_LOCK must be released.
+ *	ADAPTER_STATE_LOCK must be released.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_get_port_name(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t *name,
+    uint8_t opt)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("qla2x00_get_port_name(%ld): entered.\n",
+	    ha->host_no);)
+
+	mcp->mb[0] = MBC_GET_PORT_NAME;
+	mcp->out_mb = MBX_1|MBX_0;
+	if (HAS_EXTENDED_IDS(ha)) {
+		mcp->mb[1] = loop_id;
+		mcp->mb[10] = opt;
+		mcp->out_mb |= MBX_10;
+	} else {
+		mcp->mb[1] = loop_id << 8 | opt;
+	}
+
+	mcp->in_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("qla2x00_get_port_name(%ld): failed=%x.\n",
+		    ha->host_no, rval);)
+	} else {
+		if (name != NULL) {
+			/* This function returns name in big endian. */
+			name[0] = LSB(mcp->mb[2]);
+			name[1] = MSB(mcp->mb[2]);
+			name[2] = LSB(mcp->mb[3]);
+			name[3] = MSB(mcp->mb[3]);
+			name[4] = LSB(mcp->mb[6]);
+			name[5] = MSB(mcp->mb[6]);
+			name[6] = LSB(mcp->mb[7]);
+			name[7] = MSB(mcp->mb[7]);
+		}
+
+		DEBUG11(printk("qla2x00_get_port_name(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_get_link_status
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	loop_id = device loop ID.
+ *	ret_buf = pointer to link status return buffer.
+ *
+ * Returns:
+ *	0 = success.
+ *	BIT_0 = mem alloc error.
+ *	BIT_1 = mailbox error.
+ */
+uint8_t
+qla2x00_get_link_status(scsi_qla_host_t *ha, uint8_t loop_id, void *ret_buf,
+    uint16_t *status)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+	link_stat_t *stat_buf;
+	dma_addr_t phys_address = 0;
+
+
+	DEBUG11(printk("qla2x00_get_link_status(%ld): entered.\n",
+	    ha->host_no);)
+
+	stat_buf = pci_alloc_consistent(ha->pdev, sizeof(link_stat_t),
+	    &phys_address);
+	if (stat_buf == NULL) {
+		DEBUG2_3_11(printk("qla2x00_get_link_status(%ld): Failed to "
+		    "allocate memory.\n", ha->host_no));
+		return BIT_0;
+	}
+	memset(stat_buf, 0, sizeof(link_stat_t));
+
+	mcp->mb[0] = MBC_GET_LINK_STATUS;
+	mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
+	if (HAS_EXTENDED_IDS(ha)) {
+		mcp->mb[1] = loop_id;
+		mcp->mb[10] = 0;
+		mcp->out_mb |= MBX_10;
+	} else {
+		mcp->mb[1] = loop_id << 8;
+	}
+	mcp->mb[2] = MSW(phys_address);
+	mcp->mb[3] = LSW(phys_address);
+	mcp->mb[6] = MSW(MSD(phys_address));
+	mcp->mb[7] = LSW(MSD(phys_address));
+
+	mcp->in_mb = MBX_0;
+	mcp->tov = 30;
+	mcp->flags = IOCTL_CMD;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval == QLA_SUCCESS) {
+		if (mcp->mb[0] != MBS_COMMAND_COMPLETE) {
+			DEBUG2_3_11(printk("qla2x00_get_link_status(%ld): cmd "
+			    "failed. mbx0=%x.\n", ha->host_no, mcp->mb[0]);)
+			status[0] = mcp->mb[0];
+			rval = BIT_1;
+		} else {
+			/* copy over data */
+			memcpy(ret_buf, stat_buf,sizeof(link_stat_t));
+			DEBUG(printk("qla2x00_get_link_status(%ld): stat dump: "
+			    "fail_cnt=%d loss_sync=%d loss_sig=%d seq_err=%d "
+			    "inval_xmt_word=%d inval_crc=%d.\n",
+			    ha->host_no,
+			    stat_buf->link_fail_cnt, stat_buf->loss_sync_cnt,
+			    stat_buf->loss_sig_cnt, stat_buf->prim_seq_err_cnt,
+			    stat_buf->inval_xmit_word_cnt,
+			    stat_buf->inval_crc_cnt);)
+			DEBUG11(printk("qla2x00_get_link_status(%ld): stat "
+			    "dump: fail_cnt=%d loss_sync=%d loss_sig=%d "
+			    "seq_err=%d inval_xmt_word=%d inval_crc=%d.\n",
+			    ha->host_no,
+			    stat_buf->link_fail_cnt, stat_buf->loss_sync_cnt,
+			    stat_buf->loss_sig_cnt, stat_buf->prim_seq_err_cnt,
+			    stat_buf->inval_xmit_word_cnt,
+			    stat_buf->inval_crc_cnt);)
+		}
+	} else {
+		/* Failed. */
+		DEBUG2_3_11(printk("qla2x00_get_link_status(%ld): failed=%x.\n",
+		    ha->host_no, rval);)
+		rval = BIT_1;
+	}
+
+	pci_free_consistent(ha->pdev, sizeof(link_stat_t),
+	    stat_buf, phys_address);
+
+	return rval;
+}
+
+/*
+ * qla2x00_lip_reset
+ *	Issue LIP reset mailbox command.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	TARGET_QUEUE_LOCK must be released.
+ *	ADAPTER_STATE_LOCK must be released.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_lip_reset(scsi_qla_host_t *ha)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("qla2x00_lip_reset(%ld): entered.\n",
+	    ha->host_no);)
+
+	mcp->mb[0] = MBC_LIP_RESET;
+	mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0;
+	if (HAS_EXTENDED_IDS(ha)) {
+		mcp->mb[1] = 0x00ff;
+		mcp->mb[10] = 0;
+		mcp->out_mb |= MBX_10;
+	} else {
+		mcp->mb[1] = 0xff00;
+	}
+	mcp->mb[2] = ha->loop_reset_delay;
+	mcp->mb[3] = 0;
+
+	mcp->in_mb = MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("qla2x00_lip_reset(%ld): failed=%x.\n",
+		    ha->host_no, rval);)
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("qla2x00_lip_reset(%ld): done.\n", ha->host_no);)
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_send_sns
+ *	Send SNS command.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	sns = pointer for command.
+ *	cmd_size = command size.
+ *	buf_size = response/command size.
+ *	TARGET_QUEUE_LOCK must be released.
+ *	ADAPTER_STATE_LOCK must be released.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_send_sns(scsi_qla_host_t *ha, dma_addr_t sns_phys_address,
+    uint16_t cmd_size, size_t buf_size)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("qla2x00_send_sns(%ld): entered.\n",
+	    ha->host_no);)
+
+	DEBUG11(printk("qla2x00_send_sns: retry cnt=%d ratov=%d total "
+	    "tov=%d.\n", ha->retry_count, ha->login_timeout, mcp->tov);)
+
+	mcp->mb[0] = MBC_SEND_SNS_COMMAND;
+	mcp->mb[1] = cmd_size;
+	mcp->mb[2] = MSW(sns_phys_address);
+	mcp->mb[3] = LSW(sns_phys_address);
+	mcp->mb[6] = MSW(MSD(sns_phys_address));
+	mcp->mb[7] = LSW(MSD(sns_phys_address));
+	mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->in_mb = MBX_0|MBX_1;
+	mcp->buf_size = buf_size;
+	mcp->flags = MBX_DMA_OUT|MBX_DMA_IN;
+	/*mcp->tov = ha->retry_count * ha->login_timeout * 2;*/
+	mcp->tov =  ha->login_timeout * 2;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG(printk("qla2x00_send_sns(%ld): failed=%x mb[0]=%x "
+		    "mb[1]=%x.\n", ha->host_no, rval, mcp->mb[0], mcp->mb[1]);)
+		DEBUG2_3_11(printk("qla2x00_send_sns(%ld): failed=%x mb[0]=%x "
+		    "mb[1]=%x.\n", ha->host_no, rval, mcp->mb[0], mcp->mb[1]);)
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("qla2x00_send_sns(%ld): done.\n", ha->host_no);)
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_login_fabric
+ *	Issue login fabric port mailbox command.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	loop_id = device loop ID.
+ *	domain = device domain.
+ *	area = device area.
+ *	al_pa = device AL_PA.
+ *	status = pointer for return status.
+ *	opt = command options.
+ *	TARGET_QUEUE_LOCK must be released.
+ *	ADAPTER_STATE_LOCK must be released.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_login_fabric(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain,
+    uint8_t area, uint8_t al_pa, uint16_t *mb, uint8_t opt)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("qla2x00_login_fabric(%ld): entered.\n", ha->host_no);)
+
+	mcp->mb[0] = MBC_LOGIN_FABRIC_PORT;
+	mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0;
+	if (HAS_EXTENDED_IDS(ha)) {
+		mcp->mb[1] = loop_id;
+		mcp->mb[10] = opt;
+		mcp->out_mb |= MBX_10;
+	} else {
+		mcp->mb[1] = (loop_id << 8) | opt;
+	}
+	mcp->mb[2] = domain;
+	mcp->mb[3] = area << 8 | al_pa;
+
+	mcp->in_mb = MBX_7|MBX_6|MBX_2|MBX_1|MBX_0;
+	/*mcp->tov = ha->retry_count * ha->login_timeout * 2;*/
+	mcp->tov = ha->login_timeout * 2;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	/* Return mailbox statuses. */
+	if (mb != NULL) {
+		mb[0] = mcp->mb[0];
+		mb[1] = mcp->mb[1];
+		mb[2] = mcp->mb[2];
+		mb[6] = mcp->mb[6];
+		mb[7] = mcp->mb[7];
+	}
+
+	if (rval != QLA_SUCCESS) {
+		/* RLU tmp code: need to change main mailbox_command function to
+		 * return ok even when the mailbox completion value is not
+		 * SUCCESS. The caller needs to be responsible to interpret
+		 * the return values of this mailbox command if we're not
+		 * to change too much of the existing code.
+		 */
+		if (mcp->mb[0] == 0x4001 || mcp->mb[0] == 0x4002 ||
+		    mcp->mb[0] == 0x4003 || mcp->mb[0] == 0x4005 ||
+		    mcp->mb[0] == 0x4006)
+			rval = QLA_SUCCESS;
+
+		/*EMPTY*/
+		DEBUG2_3_11(printk("qla2x00_login_fabric(%ld): failed=%x "
+		    "mb[0]=%x mb[1]=%x mb[2]=%x.\n", ha->host_no, rval,
+		    mcp->mb[0], mcp->mb[1], mcp->mb[2]);)
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("qla2x00_login_fabric(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_login_local_device
+ *           Issue login loop port mailbox command.
+ *    
+ * Input:
+ *           ha = adapter block pointer.
+ *           loop_id = device loop ID.
+ *           opt = command options.
+ *          
+ * Returns:
+ *            Return status code.
+ *             
+ * Context:
+ *            Kernel context.
+ *             
+ */
+int
+qla2x00_login_local_device(scsi_qla_host_t *ha, uint16_t loop_id,
+    uint16_t *mb_ret, uint8_t opt)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG3(printk("%s(%ld): entered.\n", __func__, ha->host_no);)
+
+	mcp->mb[0] = MBC_LOGIN_LOOP_PORT;
+	if (HAS_EXTENDED_IDS(ha))
+		mcp->mb[1] = loop_id;
+	else
+		mcp->mb[1] = loop_id << 8;
+	mcp->mb[2] = opt;
+	mcp->out_mb = MBX_2|MBX_1|MBX_0;
+ 	mcp->in_mb = MBX_7|MBX_6|MBX_1|MBX_0;
+	mcp->tov =  ha->login_timeout * 2;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+ 	/* Return mailbox statuses. */
+ 	if (mb_ret != NULL) {
+ 		mb_ret[0] = mcp->mb[0];
+ 		mb_ret[1] = mcp->mb[1];
+ 		mb_ret[6] = mcp->mb[6];
+ 		mb_ret[7] = mcp->mb[7];
+ 	}
+
+	if (rval != QLA_SUCCESS) {
+ 		/* AV tmp code: need to change main mailbox_command function to
+ 		 * return ok even when the mailbox completion value is not
+ 		 * SUCCESS. The caller needs to be responsible to interpret
+ 		 * the return values of this mailbox command if we're not
+ 		 * to change too much of the existing code.
+ 		 */
+ 		if (mcp->mb[0] == 0x4005 || mcp->mb[0] == 0x4006)
+ 			rval = QLA_SUCCESS;
+
+		DEBUG(printk("%s(%ld): failed=%x mb[0]=%x mb[1]=%x "
+		    "mb[6]=%x mb[7]=%x.\n", __func__, ha->host_no, rval,
+		    mcp->mb[0], mcp->mb[1], mcp->mb[6], mcp->mb[7]);)
+		DEBUG2_3(printk("%s(%ld): failed=%x mb[0]=%x mb[1]=%x "
+		    "mb[6]=%x mb[7]=%x.\n", __func__, ha->host_no, rval,
+		    mcp->mb[0], mcp->mb[1], mcp->mb[6], mcp->mb[7]);)
+	} else {
+		/*EMPTY*/
+		DEBUG3(printk("%s(%ld): done.\n", __func__, ha->host_no);)
+	}
+
+	return (rval);
+}
+
+/*
+ * qla2x00_fabric_logout
+ *	Issue logout fabric port mailbox command.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	loop_id = device loop ID.
+ *	TARGET_QUEUE_LOCK must be released.
+ *	ADAPTER_STATE_LOCK must be released.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_fabric_logout(scsi_qla_host_t *ha, uint16_t loop_id)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("qla2x00_fabric_logout(%ld): entered.\n",
+	    ha->host_no);)
+
+	mcp->mb[0] = MBC_LOGOUT_FABRIC_PORT;
+	mcp->out_mb = MBX_1|MBX_0;
+	if (HAS_EXTENDED_IDS(ha)) {
+		mcp->mb[1] = loop_id;
+		mcp->mb[10] = 0;
+		mcp->out_mb |= MBX_10;
+	} else {
+		mcp->mb[1] = loop_id << 8;
+	}
+
+	mcp->in_mb = MBX_1|MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("qla2x00_fabric_logout(%ld): failed=%x "
+		    "mbx1=%x.\n", ha->host_no, rval, mcp->mb[1]);)
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("qla2x00_fabric_logout(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_full_login_lip
+ *	Issue full login LIP mailbox command.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	TARGET_QUEUE_LOCK must be released.
+ *	ADAPTER_STATE_LOCK must be released.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_full_login_lip(scsi_qla_host_t *ha)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("qla2x00_full_login_lip(%ld): entered.\n",
+	    ha->host_no);)
+
+	mcp->mb[0] = MBC_LIP_FULL_LOGIN;
+	mcp->mb[1] = 0;
+	mcp->mb[2] = 0;
+	mcp->mb[3] = 0;
+	mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->in_mb = MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("qla2x00_full_login_lip(%ld): failed=%x.\n",
+		    ha->instance, rval);)
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("qla2x00_full_login_lip(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_get_id_list
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_get_id_list(scsi_qla_host_t *ha, void *id_list, dma_addr_t id_list_dma,
+    uint16_t *entries)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("qla2x00_get_id_list(%ld): entered.\n",
+	    ha->host_no);)
+
+	if (id_list == NULL)
+		return QLA_FUNCTION_FAILED;
+
+	mcp->mb[0] = MBC_GET_ID_LIST;
+	mcp->mb[1] = MSW(id_list_dma);
+	mcp->mb[2] = LSW(id_list_dma);
+	mcp->mb[3] = MSW(MSD(id_list_dma));
+	mcp->mb[6] = LSW(MSD(id_list_dma));
+	mcp->out_mb = MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->in_mb = MBX_1|MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("qla2x00_get_id_list(%ld): failed=%x.\n",
+		    ha->host_no, rval);)
+	} else {
+		*entries = mcp->mb[1];
+		DEBUG11(printk("qla2x00_get_id_list(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	return rval;
+}
+
+#if 0 /* not yet needed */
+int
+qla2x00_dump_ram(scsi_qla_host_t *ha, uint32_t risc_address,
+    dma_addr_t ispdump_dma, uint32_t size)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	mcp->mb[0] = MBC_DUMP_RAM;
+	mcp->mb[1] = risc_address & 0xffff;
+	mcp->mb[2] = MSW(ispdump_dma);
+	mcp->mb[3] = LSW(ispdump_dma);
+	mcp->mb[4] = 0;
+	mcp->mb[6] = MSW(MSD(ispdump_dma));
+	mcp->mb[7] = LSW(MSD(ispdump_dma));
+	mcp->out_mb = MBX_7|MBX_6|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->in_mb = MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	return rval;
+}
+#endif
+
+/*
+ * qla2x00_lun_reset
+ *	Issue lun reset mailbox command.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	loop_id = device loop ID.
+ *      lun = lun to be reset.
+ *	TARGET_QUEUE_LOCK must be released.
+ *	ADAPTER_STATE_LOCK must be released.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_lun_reset(scsi_qla_host_t *ha, uint16_t loop_id, uint16_t lun)
+{
+	int		rval;
+	mbx_cmd_t	mc;
+	mbx_cmd_t	*mcp = &mc;
+
+	ENTER("qla2x00_lun_reset");
+
+	mcp->mb[0] = MBC_LUN_RESET;
+	if (HAS_EXTENDED_IDS(ha))
+		mcp->mb[1] = loop_id;
+	else
+		mcp->mb[1] = loop_id << 8;
+	mcp->mb[2] = lun;
+	mcp->out_mb = MBX_2|MBX_1|MBX_0;
+	mcp->in_mb = MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		printk(KERN_WARNING "qla2x00_lun_reset(%d): failed = %d",
+		    (int)ha->instance, rval);
+	} else {
+		/*EMPTY*/
+		LEAVE("qla2x00_lun_reset: exiting normally");
+	}
+
+	return rval;
+}
+
+/*
+ * qla2x00_send_rnid_mbx
+ *	Issue RNID ELS using mailbox command
+ *
+ * Input:
+ *	ha = adapter state pointer.
+ *	loop_id = loop ID of the target device.
+ *	data_fmt = currently supports only 0xDF.
+ *	buffer = buffer pointer.
+ *	buf_size = size of buffer.
+ *	mb_reg = pointer to return mailbox registers.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_send_rnid_mbx(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t data_fmt,
+    dma_addr_t buf_phys_addr, size_t buf_size, uint16_t *mb_reg)
+{
+	int		rval;
+	mbx_cmd_t	mc;
+	mbx_cmd_t	*mcp = &mc;
+
+	DEBUG11(printk("qla2x00_send_rnid_mbx(%ld): entered.\n",
+	    ha->host_no);)
+
+	mcp->mb[0] = MBC_SEND_RNID_ELS;
+	mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
+	if (HAS_EXTENDED_IDS(ha)) {
+		mcp->mb[1] = loop_id;
+		mcp->mb[10] = data_fmt;
+		mcp->out_mb |= MBX_10;
+	} else {
+		mcp->mb[1] = (loop_id << 8) | data_fmt;
+	}
+	mcp->mb[2] = MSW(buf_phys_addr);
+	mcp->mb[3] = LSW(buf_phys_addr);
+	mcp->mb[6] = MSW(MSD(buf_phys_addr));
+	mcp->mb[7] = LSW(MSD(buf_phys_addr));
+
+	mcp->in_mb = MBX_1|MBX_0;
+	mcp->buf_size = buf_size;
+	mcp->flags = MBX_DMA_IN;
+	mcp->tov = 30;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		memcpy(mb_reg, mcp->mb, 2 * 2); /* 2 status regs */
+
+		DEBUG2_3_11(printk("qla2x00_send_rnid_mbx(%ld): failed=%x "
+		    "mb[1]=%x.\n",
+		    ha->host_no, mcp->mb[0], mcp->mb[1]);)
+	} else {
+		/*EMPTY*/
+	 	DEBUG11(printk("qla2x00_send_rnid_mbx(%ld): done.\n",
+		     ha->host_no);)
+	}
+
+	return (rval);
+}
+
+/*
+ * qla2x00_set_rnid_params_mbx
+ *	Set RNID parameters using mailbox command
+ *
+ * Input:
+ *	ha = adapter state pointer.
+ *	buffer = buffer pointer.
+ *	buf_size = size of buffer.
+ *	mb_reg = pointer to return mailbox registers.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_set_rnid_params_mbx(scsi_qla_host_t *ha, dma_addr_t buf_phys_addr,
+    size_t buf_size, uint16_t *mb_reg)
+{
+	int		rval;
+	mbx_cmd_t	mc;
+	mbx_cmd_t	*mcp = &mc;
+
+	DEBUG11(printk("qla2x00_set_rnid_params_mbx(%ld): entered.\n",
+	    ha->host_no);)
+
+	mcp->mb[0] = MBC_SET_RNID_PARAMS;
+	mcp->mb[1] = 0;
+	mcp->mb[2] = MSW(buf_phys_addr);
+	mcp->mb[3] = LSW(buf_phys_addr);
+	mcp->mb[6] = MSW(MSD(buf_phys_addr));
+	mcp->mb[7] = LSW(MSD(buf_phys_addr));
+	mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->in_mb = MBX_1|MBX_0;
+	mcp->buf_size = buf_size;
+	mcp->flags = MBX_DMA_OUT;
+	mcp->tov = 30;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		memcpy(mb_reg, mcp->mb, 2 * 2); /* 2 status regs */
+
+		DEBUG2_3_11(printk("qla2x00_set_rnid_params_mbx(%ld): "
+		    "failed=%x mb[1]=%x.\n", ha->host_no, mcp->mb[0],
+		    mcp->mb[1]);)
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("qla2x00_set_rnid_params_mbx(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	return (rval);
+}
+
+/*
+ * qla2x00_get_rnid_params_mbx
+ *	Get RNID parameters using mailbox command
+ *
+ * Input:
+ *	ha = adapter state pointer.
+ *	buffer = buffer pointer.
+ *	buf_size = size of buffer.
+ *	mb_reg = pointer to return mailbox registers.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_get_rnid_params_mbx(scsi_qla_host_t *ha, dma_addr_t buf_phys_addr,
+    size_t buf_size, uint16_t *mb_reg)
+{
+	int		rval;
+	mbx_cmd_t	mc;
+	mbx_cmd_t	*mcp = &mc;
+
+	DEBUG11(printk("qla2x00_get_rnid_params_mbx(%ld): entered.\n",
+	    ha->host_no);)
+
+	mcp->mb[0] = MBC_GET_RNID_PARAMS;
+	mcp->mb[1] = 0;
+	mcp->mb[2] = MSW(buf_phys_addr);
+	mcp->mb[3] = LSW(buf_phys_addr);
+	mcp->mb[6] = MSW(MSD(buf_phys_addr));
+	mcp->mb[7] = LSW(MSD(buf_phys_addr));
+	mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->in_mb = MBX_1|MBX_0;
+	mcp->buf_size = buf_size;
+	mcp->flags = MBX_DMA_IN;
+	mcp->tov = 30;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		memcpy(mb_reg, mcp->mb, 2 * 2); /* 2 status regs */
+
+		DEBUG2_3_11(printk("qla2x00_get_rnid_params_mbx(%ld): "
+		    "failed=%x mb[1]=%x.\n", ha->host_no, mcp->mb[0],
+		    mcp->mb[1]);)
+	} else {
+		/*EMPTY*/
+		DEBUG11(printk("qla2x00_get_rnid_params_mbx(%ld): done.\n",
+		    ha->host_no);)
+	}
+
+	return (rval);
+}
+
+/*
+ * qla2x00_get_resource_cnts
+ *	Get current firmware resource counts.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_get_resource_cnts(scsi_qla_host_t *ha, uint16_t *cur_xchg_cnt,
+    uint16_t *orig_xchg_cnt, uint16_t *cur_iocb_cnt, uint16_t *orig_iocb_cnt)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+
+	DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
+
+	mcp->mb[0] = MBC_GET_RESOURCE_COUNTS;
+	mcp->out_mb = MBX_0;
+	mcp->in_mb = MBX_10|MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->tov = 30;
+	mcp->flags = 0;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3_11(printk("%s(%ld): failed = %x.\n", __func__,
+		    ha->host_no, mcp->mb[0]);)
+	} else {
+		DEBUG11(printk("%s(%ld): done. mb1=%x mb2=%x mb3=%x mb6=%x "
+		    "mb7=%x mb10=%x.\n", __func__, ha->host_no,
+		    mcp->mb[1], mcp->mb[2], mcp->mb[3], mcp->mb[6], mcp->mb[7], 
+		    mcp->mb[10]));
+
+		if (cur_xchg_cnt)
+			*cur_xchg_cnt = mcp->mb[3];
+		if (orig_xchg_cnt)
+			*orig_xchg_cnt = mcp->mb[6];
+		if (cur_iocb_cnt)
+			*cur_iocb_cnt = mcp->mb[7];
+		if (orig_iocb_cnt)
+			*orig_iocb_cnt = mcp->mb[10];
+	}
+
+	return (rval);
+}
+
+#if defined(QL_DEBUG_LEVEL_3)
+/*
+ * qla2x00_get_fcal_position_map
+ *	Get FCAL (LILP) position map using mailbox command
+ *
+ * Input:
+ *	ha = adapter state pointer.
+ *	pos_map = buffer pointer (can be NULL).
+ *
+ * Returns:
+ *	qla2x00 local function return status code.
+ *
+ * Context:
+ *	Kernel context.
+ */
+int
+qla2x00_get_fcal_position_map(scsi_qla_host_t *ha, char *pos_map)
+{
+	int rval;
+	mbx_cmd_t mc;
+	mbx_cmd_t *mcp = &mc;
+	char *pmap;
+	dma_addr_t pmap_dma;
+
+	pmap = pci_alloc_consistent(ha->pdev, FCAL_MAP_SIZE, &pmap_dma);
+	if (pmap  == NULL) {
+		DEBUG2_3_11(printk("%s(%ld): **** Mem Alloc Failed ****",
+		    __func__, ha->host_no));
+		return QLA_MEMORY_ALLOC_FAILED;
+	}
+	memset(pmap, 0, FCAL_MAP_SIZE);
+
+	mcp->mb[0] = MBC_GET_FC_AL_POSITION_MAP;
+	mcp->mb[2] = MSW(pmap_dma);
+	mcp->mb[3] = LSW(pmap_dma);
+	mcp->mb[6] = MSW(MSD(pmap_dma));
+	mcp->mb[7] = LSW(MSD(pmap_dma));
+	mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_0;
+	mcp->in_mb = MBX_1|MBX_0;
+	mcp->buf_size = FCAL_MAP_SIZE;
+	mcp->flags = MBX_DMA_IN;
+	mcp->tov =  ha->login_timeout * 2;
+	rval = qla2x00_mailbox_command(ha, mcp);
+
+	if (rval == QLA_SUCCESS) {
+		DEBUG11(printk("%s(%ld): (mb0=%x/mb1=%x) FC/AL Position Map "
+		    "size (%x)\n", __func__, ha->host_no, mcp->mb[0],
+		    mcp->mb[1], (unsigned)pmap[0]));
+		DEBUG11(qla2x00_dump_buffer(pmap, pmap[0] + 1));
+
+		if (pos_map)
+			memcpy(pos_map, pmap, FCAL_MAP_SIZE);
+	}
+	pci_free_consistent(ha->pdev, FCAL_MAP_SIZE, pmap, pmap_dma);
+
+	if (rval != QLA_SUCCESS) {
+		DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__,
+		    ha->host_no, rval));
+	} else {
+		DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
+	}
+
+	return rval;
+}
+#endif
diff -Nru a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/qla_os.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,4602 @@
+/*
+ *                  QLOGIC LINUX SOFTWARE
+ *
+ * QLogic ISP2x00 device driver for Linux 2.6.x
+ * Copyright (C) 2003 QLogic Corporation
+ * (www.qlogic.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#include "qla_os.h"
+#include "qla_def.h"
+
+/*
+ * Driver version
+ */
+char qla2x00_version_str[40];
+
+/*
+ * SRB allocation cache
+ */
+char srb_cachep_name[16];
+kmem_cache_t *srb_cachep;
+
+/*
+ * Stats for all adpaters.
+ */
+struct _qla2x00stats qla2x00_stats;
+
+/*
+ * Ioctl related information.
+ */
+int num_hosts;
+int apiHBAInstance;
+
+/*
+ * Module parameter information and variables
+ */
+int ql2xmaxqdepth;
+module_param(ql2xmaxqdepth, int, 0);
+MODULE_PARM_DESC(ql2xmaxqdepth,
+		"Maximum queue depth to report for target devices.");
+
+int ql2xlogintimeout = 20;
+module_param(ql2xlogintimeout, int, 0);
+MODULE_PARM_DESC(ql2xlogintimeout,
+		"Login timeout value in seconds.");
+
+int qlport_down_retry;
+module_param(qlport_down_retry, int, 0);
+MODULE_PARM_DESC(qlport_down_retry,
+		"Maximum number of command retries to a port that returns"
+		"a PORT-DOWN status.");
+
+int ql2xretrycount = 20;
+module_param(ql2xretrycount, int, 0);
+MODULE_PARM_DESC(ql2xretrycount,
+		"Maximum number of mid-layer retries allowed for a command.  "
+		"Default value is 20, ");
+
+int displayConfig;
+module_param(displayConfig, int, 0);
+MODULE_PARM_DESC(displayConfig,
+		"If 1 then display the configuration used in /etc/modules.conf.");
+
+int ql2xplogiabsentdevice;
+module_param(ql2xplogiabsentdevice, int, 0);
+MODULE_PARM_DESC(ql2xplogiabsentdevice,
+		"Option to enable PLOGI to devices that are not present after "
+		"a Fabric scan.  This is needed for several broken switches."
+		"Default is 0 - no PLOGI. 1 - perfom PLOGI.");
+
+int ql2xintrdelaytimer = 10;
+module_param(ql2xintrdelaytimer, int, 0);
+MODULE_PARM_DESC(ql2xintrdelaytimer,
+		"ZIO: Waiting time for Firmware before it generates an "
+		"interrupt to the host to notify completion of request.");
+
+int ConfigRequired;
+module_param(ConfigRequired, int, 0);
+MODULE_PARM_DESC(ConfigRequired,
+		"If 1, then only configured devices passed in through the"
+		"ql2xopts parameter will be presented to the OS");
+
+int Bind = BIND_BY_PORT_NAME;
+module_param(Bind, int, 0);
+MODULE_PARM_DESC(Bind,
+		"Target persistent binding method: "
+		"0 by Portname (default); 1 by PortID; 2 by Nodename. ");
+
+int ql2xsuspendcount = SUSPEND_COUNT;
+module_param(ql2xsuspendcount, int, 0);
+MODULE_PARM_DESC(ql2xsuspendcount,
+		"Number of 6-second suspend iterations to perform while a "
+		"target returns a <NOT READY> status.  Default is 10 "
+		"iterations.");
+
+int ql2xdoinitscan = 1;
+module_param(ql2xdoinitscan, int, 0);
+MODULE_PARM_DESC(ql2xdoinitscan,
+		"Signal mid-layer to perform scan after driver load: 0 -- no "
+		"signal sent to mid-layer.");
+
+/*
+ * Proc structures and functions
+ */
+struct info_str {
+	char	*buffer;
+	int	length;
+	off_t	offset;
+	int	pos;
+};
+
+static void copy_mem_info(struct info_str *, char *, int);
+static int copy_info(struct info_str *, char *, ...);
+
+
+/*
+ * List of host adapters
+ */
+LIST_HEAD(qla_hostlist);
+rwlock_t qla_hostlist_lock = RW_LOCK_UNLOCKED;
+
+static void qla2x00_free_device(scsi_qla_host_t *);
+
+static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha);
+
+/*
+ * SCSI host template entry points 
+ */
+static int qla2xxx_slave_configure(struct scsi_device * device);
+extern int qla2x00_ioctl(struct scsi_device *, int , void *);
+static int qla2xxx_eh_abort(struct scsi_cmnd *);
+static int qla2xxx_eh_device_reset(struct scsi_cmnd *);
+static int qla2xxx_eh_bus_reset(struct scsi_cmnd *);
+static int qla2xxx_eh_host_reset(struct scsi_cmnd *);
+static uint8_t qla2x00_loop_reset(scsi_qla_host_t *ha);
+static int qla2x00_device_reset(scsi_qla_host_t *, fc_port_t *);
+
+static int qla2x00_proc_info(struct Scsi_Host *, char *, char **,
+    off_t, int, int);
+
+static struct scsi_host_template qla2x00_driver_template = {
+	.module			= THIS_MODULE,
+	.name			= "qla2xxx",
+	.proc_name		= "qla2xxx",
+	.proc_info		= qla2x00_proc_info,
+	.queuecommand		= qla2x00_queuecommand,
+
+	.eh_abort_handler	= qla2xxx_eh_abort,
+	.eh_device_reset_handler = qla2xxx_eh_device_reset,
+	.eh_bus_reset_handler	= qla2xxx_eh_bus_reset,
+	.eh_host_reset_handler	= qla2xxx_eh_host_reset,
+
+	.slave_configure	= qla2xxx_slave_configure,
+
+	.this_id		= -1,
+	.can_queue		= REQUEST_ENTRY_CNT+128,
+	.cmd_per_lun		= 3,
+	.use_clustering		= ENABLE_CLUSTERING,
+	.sg_tablesize		= SG_ALL,
+
+	/*
+	 * The RISC allows for each command to transfer (2^32-1) bytes of data,
+	 * which equates to 0x800000 sectors.
+	 */
+	.max_sectors		= 0xFFFF,
+};
+
+static void qla2x00_display_fc_names(scsi_qla_host_t *);
+
+void qla2x00_blink_led(scsi_qla_host_t *);
+
+/* TODO Convert to inlines
+ *
+ * Timer routines
+ */
+#define	WATCH_INTERVAL		1       /* number of seconds */
+
+static void qla2x00_timer(scsi_qla_host_t *);
+
+static __inline__ void qla2x00_start_timer(scsi_qla_host_t *,
+    void *, unsigned long);
+static __inline__ void qla2x00_restart_timer(scsi_qla_host_t *, unsigned long);
+static __inline__ void qla2x00_stop_timer(scsi_qla_host_t *);
+
+static inline void
+qla2x00_start_timer(scsi_qla_host_t *ha, void *func, unsigned long interval)
+{
+	init_timer(&ha->timer);
+	ha->timer.expires = jiffies + interval * HZ;
+	ha->timer.data = (unsigned long)ha;
+	ha->timer.function = (void (*)(unsigned long))func;
+	add_timer(&ha->timer);
+	ha->timer_active = 1;
+}
+
+static inline void
+qla2x00_restart_timer(scsi_qla_host_t *ha, unsigned long interval)
+{
+	mod_timer(&ha->timer, jiffies + interval * HZ);
+}
+
+static __inline__ void
+qla2x00_stop_timer(scsi_qla_host_t *ha)
+{
+	del_timer_sync(&ha->timer);
+	ha->timer_active = 0;
+}
+
+
+static void qla2x00_cmd_timeout(srb_t *sp);
+static __inline__ void qla2x00_add_timer_to_cmd(srb_t *sp, int timeout);
+static __inline__ void qla2x00_delete_timer_from_cmd(srb_t *sp);
+
+/**************************************************************************
+*   qla2x00_add_timer_to_cmd
+*
+* Description:
+*       Creates a timer for the specified command. The timeout is usually
+*       the command time from kernel minus 2 secs.
+*
+* Input:
+*     sp - pointer to validate
+*
+* Returns:
+*     None.
+**************************************************************************/
+static inline void
+qla2x00_add_timer_to_cmd(srb_t *sp, int timeout)
+{
+	init_timer(&sp->timer);
+	sp->timer.expires = jiffies + timeout * HZ;
+	sp->timer.data = (unsigned long) sp;
+	sp->timer.function = (void (*) (unsigned long))qla2x00_cmd_timeout;
+	add_timer(&sp->timer);
+}
+
+/**************************************************************************
+*   qla2x00_delete_timer_from_cmd
+*
+* Description:
+*       Delete the timer for the specified command.
+*
+* Input:
+*     sp - pointer to validate
+*
+* Returns:
+*     None.
+**************************************************************************/
+static inline void 
+qla2x00_delete_timer_from_cmd(srb_t *sp)
+{
+	if (sp->timer.function != NULL) {
+		del_timer(&sp->timer);
+		sp->timer.function =  NULL;
+		sp->timer.data = (unsigned long) NULL;
+	}
+}
+
+static __inline__ void qla2x00_callback(scsi_qla_host_t *, struct scsi_cmnd *);
+static __inline__ void sp_put(struct scsi_qla_host * ha, srb_t *sp);
+static __inline__ void sp_get(struct scsi_qla_host * ha, srb_t *sp);
+static __inline__ void
+qla2x00_delete_from_done_queue(scsi_qla_host_t *, srb_t *); 
+
+/**************************************************************************
+* sp_put
+*
+* Description:
+*   Decrement reference count and call the callback if we're the last
+*   owner of the specified sp. Will get the host_lock before calling
+*   the callback.
+*
+* Input:
+*   ha - pointer to the scsi_qla_host_t where the callback is to occur.
+*   sp - pointer to srb_t structure to use.
+*
+* Returns:
+*
+**************************************************************************/
+static inline void
+sp_put(struct scsi_qla_host * ha, srb_t *sp)
+{
+        if (atomic_read(&sp->ref_count) == 0) {
+		qla_printk(KERN_INFO, ha,
+			"%s(): **** SP->ref_count not zero\n",
+			__func__);
+                DEBUG2(BUG();)
+
+                return;
+	}
+
+        if (!atomic_dec_and_test(&sp->ref_count)) {
+                return;
+        }
+
+        qla2x00_callback(ha, sp->cmd);
+}
+
+/**************************************************************************
+* sp_get
+*
+* Description:
+*   Increment reference count of the specified sp.
+*
+* Input:
+*   sp - pointer to srb_t structure to use.
+*
+* Returns:
+*
+**************************************************************************/
+static inline void
+sp_get(struct scsi_qla_host * ha, srb_t *sp)
+{
+        atomic_inc(&sp->ref_count);
+
+        if (atomic_read(&sp->ref_count) > 2) {
+		qla_printk(KERN_INFO, ha,
+			"%s(): **** SP->ref_count greater than two\n",
+			__func__);
+                DEBUG2(BUG();)
+
+		return;
+	}
+}
+
+/*
+* qla2x00_callback
+*      Returns the completed SCSI command to LINUX.
+*
+* Input:
+*	ha -- Host adapter structure
+*	cmd -- SCSI mid-level command structure.
+* Returns:
+*      None
+* Note:From failover point of view we always get the sp
+*      from vis_ha pool in queuecommand.So when we put it 
+*      back to the pool it has to be the vis_ha.	 
+*      So rely on struct scsi_cmnd to get the vis_ha and not on sp. 		 	
+*/
+static inline void
+qla2x00_callback(scsi_qla_host_t *ha, struct scsi_cmnd *cmd)
+{
+	srb_t *sp = (srb_t *) CMD_SP(cmd);
+	scsi_qla_host_t *vis_ha;
+	os_lun_t *lq;
+	int got_sense;
+	unsigned long	cpu_flags = 0;
+
+	ENTER(__func__);
+
+	cmd->host_scribble = (unsigned char *) NULL;
+	vis_ha = (scsi_qla_host_t *) cmd->device->host->hostdata;
+
+	if (sp == NULL) {
+		qla_printk(KERN_INFO, ha,
+			"%s(): **** CMD derives a NULL SP\n",
+			__func__);
+                DEBUG2(BUG();)
+		return;
+	}
+
+	/*
+	 * If command status is not DID_BUS_BUSY then go ahead and freed sp.
+	 */
+	/*
+	 * Cancel command timeout
+	 */
+	qla2x00_delete_timer_from_cmd(sp);
+
+	/*
+	 * Put SP back in the free queue
+	 */
+	sp->cmd   = NULL;
+	CMD_SP(cmd) = NULL;
+	lq = sp->lun_queue;
+	got_sense = (sp->flags & SRB_GOT_SENSE)? 1: 0;
+	add_to_free_queue(vis_ha, sp);
+
+	if (host_byte(cmd->result) == DID_OK) {
+		/* device ok */
+		ha->total_bytes += cmd->bufflen;
+		if (!got_sense) {
+			/* If lun was suspended then clear retry count */
+			spin_lock_irqsave(&lq->q_lock, cpu_flags);
+			if (!test_bit(LUN_EXEC_DELAYED, &lq->q_flag))
+				lq->q_state = LUN_STATE_READY;
+			spin_unlock_irqrestore(&lq->q_lock, cpu_flags);
+		}
+	} else if (host_byte(cmd->result) == DID_ERROR) {
+		/* device error */
+		ha->total_dev_errs++;
+	}
+
+	/* Call the mid-level driver interrupt handler */
+	(*(cmd)->scsi_done)(cmd);
+
+	LEAVE(__func__);
+}
+
+static inline void 
+qla2x00_delete_from_done_queue(scsi_qla_host_t *dest_ha, srb_t *sp) 
+{
+	/* remove command from done list */
+	list_del_init(&sp->list);
+	dest_ha->done_q_cnt--;
+	sp->state = SRB_NO_QUEUE_STATE;
+
+	if (sp->flags & SRB_DMA_VALID) {
+		sp->flags &= ~SRB_DMA_VALID;
+
+		/* Release memory used for this I/O */
+		if (sp->cmd->use_sg) {
+			pci_unmap_sg(dest_ha->pdev, sp->cmd->request_buffer,
+			    sp->cmd->use_sg, sp->cmd->sc_data_direction);
+		} else if (sp->cmd->request_bufflen) {
+			pci_unmap_page(dest_ha->pdev, sp->dma_handle,
+			    sp->cmd->request_bufflen,
+			    sp->cmd->sc_data_direction);
+		}
+	}
+}
+
+static int qla2x00_do_dpc(void *data);
+
+static void qla2x00_rst_aen(scsi_qla_host_t *);
+
+static uint8_t qla2x00_mem_alloc(scsi_qla_host_t *);
+static void qla2x00_mem_free(scsi_qla_host_t *ha);
+int qla2x00_allocate_sp_pool( scsi_qla_host_t *ha);
+void qla2x00_free_sp_pool(scsi_qla_host_t *ha);
+
+static ssize_t qla2x00_sysfs_read_fw_dump(struct kobject *, char *, loff_t,
+    size_t);
+static ssize_t qla2x00_sysfs_write_fw_dump(struct kobject *, char *, loff_t,
+    size_t);
+static struct bin_attribute sysfs_fw_dump_attr = {
+	.attr = {
+		.name = "fw_dump",
+		.mode = S_IRUSR | S_IWUSR,
+	},
+	.size = 0,
+	.read = qla2x00_sysfs_read_fw_dump,
+	.write = qla2x00_sysfs_write_fw_dump,
+};
+static ssize_t qla2x00_sysfs_read_nvram(struct kobject *, char *, loff_t,
+    size_t);
+static ssize_t qla2x00_sysfs_write_nvram(struct kobject *, char *, loff_t,
+    size_t);
+static struct bin_attribute sysfs_nvram_attr = {
+	.attr = {
+		.name = "nvram",
+		.mode = S_IRUSR | S_IWUSR,
+	},
+	.size = sizeof(nvram_t),
+	.read = qla2x00_sysfs_read_nvram,
+	.write = qla2x00_sysfs_write_nvram,
+};
+
+
+int
+qla2x00_set_info(char *buffer, int length, struct Scsi_Host *shost)
+{
+	return (-ENOSYS);  /* Currently this is a no-op */
+}
+
+/* -------------------------------------------------------------------------- */
+
+
+/* SysFS attributes. */
+static ssize_t qla2x00_sysfs_read_fw_dump(struct kobject *kobj, char *buf,
+    loff_t off, size_t count)
+{
+	struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
+	    struct device, kobj)));
+
+	if (ha->fw_dump_reading == 0)
+		return 0;
+	if (off > ha->fw_dump_buffer_len)
+		return 0;
+	if (off + count > ha->fw_dump_buffer_len)
+		count = ha->fw_dump_buffer_len - off;
+
+	memcpy(buf, &ha->fw_dump_buffer[off], count);
+
+	return (count);
+}
+
+static ssize_t qla2x00_sysfs_write_fw_dump(struct kobject *kobj, char *buf,
+    loff_t off, size_t count)
+{
+	struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
+	    struct device, kobj)));
+	int reading;
+
+	if (off != 0)
+		return (0);
+
+	reading = simple_strtol(buf, NULL, 10);
+	switch (reading) {
+	case 0:
+		if (ha->fw_dump_reading == 1) {
+			qla_printk(KERN_INFO, ha,
+			    "Firmware dump cleared on (%ld).\n",
+			    ha->host_no);
+
+			vfree(ha->fw_dump_buffer);
+			free_pages((unsigned long)ha->fw_dump,
+			    ha->fw_dump_order);
+
+			ha->fw_dump_reading = 0;
+			ha->fw_dump_buffer = NULL;
+			ha->fw_dump = NULL;
+		}
+		break;
+	case 1:
+		if (ha->fw_dump != NULL && !ha->fw_dump_reading) {
+			ha->fw_dump_reading = 1;
+
+			ha->fw_dump_buffer = (char *)vmalloc(FW_DUMP_SIZE);
+			if (ha->fw_dump_buffer == NULL) {
+				qla_printk(KERN_WARNING, ha,
+				    "Unable to allocate memory for firmware "
+				    "dump buffer (%d).\n", FW_DUMP_SIZE);
+
+				ha->fw_dump_reading = 0;
+				return (count);
+			}
+			qla_printk(KERN_INFO, ha,
+			    "Firmware dump ready for read on (%ld).\n",
+			    ha->host_no);
+			memset(ha->fw_dump_buffer, 0, FW_DUMP_SIZE);
+			if (IS_QLA2100(ha) || IS_QLA2200(ha))
+ 				qla2100_ascii_fw_dump(ha);
+ 			else
+ 				qla2300_ascii_fw_dump(ha);
+			ha->fw_dump_buffer_len = strlen(ha->fw_dump_buffer);
+		}
+		break;
+	}
+	return (count);
+}
+
+static ssize_t qla2x00_sysfs_read_nvram(struct kobject *kobj, char *buf,
+    loff_t off, size_t count)
+{
+	struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
+	    struct device, kobj)));
+	uint16_t	*witer;
+	unsigned long	flags;
+	uint16_t	cnt;
+
+	if (!capable(CAP_SYS_ADMIN) || off != 0 || count != sizeof(nvram_t))
+		return 0;
+
+	/* Read NVRAM. */
+	spin_lock_irqsave(&ha->hardware_lock, flags);
+	qla2x00_lock_nvram_access(ha);
+ 	witer = (uint16_t *)buf;
+ 	for (cnt = 0; cnt < count / 2; cnt++) {
+		*witer = cpu_to_le16(qla2x00_get_nvram_word(ha,
+		    cnt+ha->nvram_base));
+		witer++;
+ 	}
+	qla2x00_unlock_nvram_access(ha);
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+	return (count);
+}
+
+static ssize_t qla2x00_sysfs_write_nvram(struct kobject *kobj, char *buf,
+    loff_t off, size_t count)
+{
+	struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
+	    struct device, kobj)));
+	uint8_t		*iter;
+	uint16_t	*witer;
+	unsigned long	flags;
+	uint16_t	cnt;
+	uint8_t		chksum;
+
+	if (!capable(CAP_SYS_ADMIN) || off != 0 || count != sizeof(nvram_t))
+		return 0;
+
+	/* Checksum NVRAM. */
+	iter = (uint8_t *)buf;
+	chksum = 0;
+	for (cnt = 0; cnt < count - 1; cnt++)
+		chksum += *iter++;
+	chksum = ~chksum + 1;
+	*iter = chksum;
+
+	/* Write NVRAM. */
+	spin_lock_irqsave(&ha->hardware_lock, flags);
+	qla2x00_lock_nvram_access(ha);
+ 	witer = (uint16_t *)buf;
+	for (cnt = 0; cnt < count / 2; cnt++) {
+		qla2x00_write_nvram_word(ha, cnt+ha->nvram_base,
+		    cpu_to_le16(*witer));
+		witer++;
+	}
+	qla2x00_unlock_nvram_access(ha);
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+	return (count);
+}
+
+/* -------------------------------------------------------------------------- */
+char *
+qla2x00_get_pci_info_str(struct scsi_qla_host *ha, char *str)
+{
+	static char *pci_bus_modes[] = {
+		"33", "66", "100", "133",
+	};
+	uint16_t pci_bus;
+
+	strcpy(str, "PCI");
+	pci_bus = (ha->pci_attr & (BIT_9 | BIT_10)) >> 9;
+	if (pci_bus) {
+		strcat(str, "-X (");
+		strcat(str, pci_bus_modes[pci_bus]);
+	} else {
+		pci_bus = (ha->pci_attr & BIT_8) >> 8;
+		strcat(str, " (");
+		strcat(str, pci_bus_modes[pci_bus]);
+	}
+	strcat(str, " MHz)");
+
+	return (str);
+}
+
+char *
+qla2x00_get_fw_version_str(struct scsi_qla_host *ha, char *str)
+{
+	char un_str[10];
+	
+	sprintf(str, "%d.%02d.%02d ", ha->fw_major_version,
+	    ha->fw_minor_version,
+	    ha->fw_subminor_version);
+
+	switch (ha->fw_attributes & 0xFF) {
+	case 0x7:
+		strcat(str, "EF");
+		break;
+	case 0x17:
+		strcat(str, "TP");
+		break;
+	case 0x37:
+		strcat(str, "IP");
+		break;
+	case 0x77:
+		strcat(str, "VI");
+		break;
+	default:
+		sprintf(un_str, "(%x)", ha->fw_attributes);
+		strcat(str, un_str);
+		break;
+	}
+	if (ha->fw_attributes & 0x100)
+		strcat(str, "X");
+
+	return (str);
+}
+
+/**************************************************************************
+* qla2x00_queuecommand
+*
+* Description:
+*     Queue a command to the controller.
+*
+* Input:
+*     cmd - pointer to Scsi cmd structure
+*     fn - pointer to Scsi done function
+*
+* Returns:
+*   0 - Always
+*
+* Note:
+* The mid-level driver tries to ensures that queuecommand never gets invoked
+* concurrently with itself or the interrupt handler (although the
+* interrupt handler may call this routine as part of request-completion
+* handling).
+**************************************************************************/
+int
+qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
+{
+	fc_port_t	*fcport;
+	os_lun_t	*lq;
+	os_tgt_t	*tq;
+	scsi_qla_host_t	*ha, *ha2;
+	srb_t		*sp;
+	struct Scsi_Host *host;
+	unsigned int	b, t, l;
+	unsigned long	handle;
+	int		was_empty;
+
+
+	host = cmd->device->host;
+	ha = (scsi_qla_host_t *) host->hostdata;
+
+	cmd->scsi_done = fn;
+
+	spin_unlock_irq(ha->host->host_lock);
+
+	/*
+	 * Allocate a command packet from the "sp" pool.  If we cant get back
+	 * one then let scsi layer come back later.
+	 */
+	if ((sp = qla2x00_get_new_sp(ha)) == NULL) {
+		qla_printk(KERN_WARNING, ha,
+		    "Couldn't allocate memory for sp - retried.\n");
+
+		spin_lock_irq(ha->host->host_lock);
+
+		return (1);
+	}
+
+	sp->cmd = cmd;
+	CMD_SP(cmd) = (void *)sp;
+
+	sp->flags = 0;
+	if (CMD_RESID_LEN(cmd) & SRB_IOCTL) {
+		/* Need to set sp->flags */
+		sp->flags |= SRB_IOCTL;
+		CMD_RESID_LEN(cmd) = 0; /* Clear it since no more use. */
+	}
+
+	sp->fo_retry_cnt = 0;
+
+	/* Generate LU queue on bus, target, LUN */
+	b = cmd->device->channel;
+	t = cmd->device->id;
+	l = cmd->device->lun;
+
+	/*
+	 * Start Command Timer. Typically it will be 2 seconds less than what
+	 * is requested by the Host such that we can return the IO before
+	 * aborts are called.
+	 */
+	if ((cmd->timeout_per_command / HZ) > QLA_CMD_TIMER_DELTA)
+		qla2x00_add_timer_to_cmd(sp,
+		    (cmd->timeout_per_command / HZ) - QLA_CMD_TIMER_DELTA);
+	else
+		qla2x00_add_timer_to_cmd(sp, cmd->timeout_per_command / HZ);
+
+	if (l >= ha->max_luns) {
+		cmd->result = DID_NO_CONNECT << 16;
+
+		spin_lock_irq(ha->host->host_lock);
+
+		sp_put(ha, sp);
+
+		return (0);
+	}
+
+	if ((tq = (os_tgt_t *) TGT_Q(ha, t)) != NULL &&
+	    (lq = (os_lun_t *) LUN_Q(ha, t, l)) != NULL) {
+		fcport = lq->fclun->fcport;
+		ha2 = fcport->ha;
+	} else {
+		lq = NULL;
+		fcport = NULL;
+		ha2 = ha;
+	}
+
+	/* Set an invalid handle until we issue the command to ISP */
+	/* then we will set the real handle value.                 */
+	handle = INVALID_HANDLE;
+	cmd->host_scribble = (unsigned char *)handle;
+
+	/* Bookkeeping information */
+	sp->r_start = jiffies;       /* time the request was recieved */
+	sp->u_start = 0;
+
+	/* Setup device queue pointers. */
+	sp->tgt_queue = tq;
+	sp->lun_queue = lq;
+
+	/*
+	 * NOTE : q is NULL
+	 *
+	 * 1. When device is added from persistent binding but has not been
+	 *    discovered yet.The state of loopid == PORT_AVAIL.
+	 * 2. When device is never found on the bus.(loopid == UNUSED)
+	 *
+	 * IF Device Queue is not created, or device is not in a valid state
+	 * and link down error reporting is enabled, reject IO.
+	 */
+	if (fcport == NULL) {
+		DEBUG3(printk("scsi(%ld:%2d:%2d): port unavailable\n",
+		    ha->host_no,t,l));
+
+		cmd->result = DID_NO_CONNECT << 16;
+
+		spin_lock_irq(ha->host->host_lock);
+
+		sp_put(ha, sp);
+
+		return (0);
+	}
+
+	/* Only modify the allowed count if the target is a *non* tape device */
+	if ((fcport->flags & FCF_TAPE_PRESENT) == 0) {
+		if (cmd->allowed < ql2xretrycount) {
+			cmd->allowed = ql2xretrycount;
+		}
+	}
+
+	DEBUG5(printk("scsi(%ld:%2d:%2d): (queuecmd) queue sp = %p, "
+	    "flags=0x%x fo retry=%d, pid=%ld\n",
+	    ha->host_no, t, l, sp, sp->flags, sp->fo_retry_cnt,
+	    cmd->serial_number));
+	DEBUG5(qla2x00_print_scsi_cmd(cmd));
+
+	sp->fclun = lq->fclun;
+	sp->ha = ha2;
+
+	if (cmd->sc_data_direction == DMA_BIDIRECTIONAL &&
+	    cmd->request_bufflen != 0) {
+
+		DEBUG2(printk(KERN_WARNING
+		    "scsi(%ld): Incorrect data direction - transfer "
+		    "length=%d, direction=%d, pid=%ld, opcode=%x\n",
+		    ha->host_no, cmd->request_bufflen, cmd->sc_data_direction,
+		    cmd->serial_number, cmd->cmnd[0]));
+	}
+
+	/* Final pre-check :
+	 *
+	 *	Either PORT_DOWN_TIMER OR LINK_DOWN_TIMER Expired.
+	 */
+	if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
+	    atomic_read(&ha->loop_state) == LOOP_DEAD) {
+		/*
+		 * Add the command to the done-queue for later failover
+		 * processing
+		 */
+		cmd->result = DID_NO_CONNECT << 16;
+		add_to_done_queue(ha, sp);
+		if (!list_empty(&ha->done_queue))
+			qla2x00_done(ha);
+
+		spin_lock_irq(ha->host->host_lock);
+		return (0);
+	}
+	was_empty = add_to_pending_queue(ha, sp);
+
+	if ((IS_QLA2100(ha) || IS_QLA2200(ha)) && ha->flags.online) {
+		unsigned long flags;
+		device_reg_t *reg;
+		reg = ha->iobase;
+		
+		if (RD_REG_WORD(ISP_RSP_Q_IN(ha, reg)) != ha->rsp_ring_index) {
+			spin_lock_irqsave(&ha->hardware_lock, flags);	
+			qla2x00_process_response_queue(ha);
+			spin_unlock_irqrestore(&ha->hardware_lock, flags);
+		}
+	}
+
+	/* We submit to the hardware if:
+	 *
+	 *	1) we're on the cpu the irq's arrive on or
+	 *	2) there are very few io's outstanding.
+	 *
+	 * In all other cases we'll let an irq pick up our IO and submit it
+	 * to the controller to improve affinity.
+	 */
+	if (smp_processor_id() == ha->last_irq_cpu || was_empty)
+		qla2x00_next(ha);
+
+	spin_lock_irq(ha->host->host_lock);
+
+	return (0);
+}
+
+/*
+ * qla2x00_eh_wait_on_command
+ *    Waits for the command to be returned by the Firmware for some
+ *    max time.
+ *
+ * Input:
+ *    ha = actual ha whose done queue will contain the command
+ *	      returned by firmware.
+ *    cmd = Scsi Command to wait on.
+ *    flag = Abort/Reset(Bus or Device Reset)
+ *
+ * Return:
+ *    Not Found : 0
+ *    Found : 1
+ */
+static int
+qla2x00_eh_wait_on_command(scsi_qla_host_t *ha, struct scsi_cmnd *cmd)
+{
+#define ABORT_WAIT_TIME	10 /* seconds */
+
+	int		found = 0;
+	int		done = 0;
+	srb_t		*rp;
+	struct list_head *list, *temp;
+	u_long		cpu_flags = 0;
+	u_long		max_wait_time = ABORT_WAIT_TIME;
+
+	ENTER(__func__);
+
+	do {
+		/* Check on done queue */
+		if (!found) {
+			spin_lock_irqsave(&ha->list_lock, cpu_flags);
+			list_for_each_safe(list, temp, &ha->done_queue) {
+				rp = list_entry(list, srb_t, list);
+
+				/*
+				* Found command.  Just exit and wait for the
+				* cmd sent to OS.
+			 	*/
+				if (cmd == rp->cmd) {
+					found++;
+					DEBUG3(printk("%s: found in done "
+							"queue.\n", __func__);)
+					break;
+				}
+			}
+			spin_unlock_irqrestore(&ha->list_lock, cpu_flags);
+		}
+
+		/* Checking to see if its returned to OS */
+		rp = (srb_t *) CMD_SP(cmd);
+		if (rp == NULL ) {
+			done++;
+			break;
+		}
+
+		spin_unlock_irq(ha->host->host_lock);
+
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(2*HZ);
+
+		spin_lock_irq(ha->host->host_lock);
+
+	} while ((max_wait_time--));
+
+	if (done) {
+		DEBUG2(printk(KERN_INFO "%s: found cmd=%p.\n", __func__, cmd));
+	} else if (found) {
+		/* Immediately return command to the mid-layer */
+		qla2x00_delete_from_done_queue(ha, rp);
+		sp_put(ha, rp);
+		done++;
+	}
+
+	LEAVE(__func__);
+
+	return (done);
+}
+
+/*
+ * qla2x00_wait_for_hba_online
+ *    Wait till the HBA is online after going through 
+ *    <= MAX_RETRIES_OF_ISP_ABORT  or
+ *    finally HBA is disabled ie marked offline
+ *
+ * Input:
+ *     ha - pointer to host adapter structure
+ * 
+ * Note:    
+ *    Does context switching-Release SPIN_LOCK
+ *    (if any) before calling this routine.
+ *
+ * Return:
+ *    Success (Adapter is online) : 0
+ *    Failed  (Adapter is offline/disabled) : 1
+ */
+static inline int 
+qla2x00_wait_for_hba_online(scsi_qla_host_t *ha)
+{
+	int 	 return_status ;
+
+	while ((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags)) ||
+	    test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags) ||
+	    test_bit(ISP_ABORT_RETRY, &ha->dpc_flags)) {
+
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(3 * HZ);
+	}
+	if (ha->flags.online == TRUE) 
+		return_status = QLA_SUCCESS; 
+	else
+		/* Adapter is disabled/offline */
+		return_status = QLA_FUNCTION_FAILED;
+
+	DEBUG2(printk("%s return_status=%d\n",__func__,return_status));
+
+	return (return_status);
+}
+
+/*
+ * qla2x00_wait_for_loop_ready
+ *    Wait for MAX_LOOP_TIMEOUT(5 min) value for loop
+ *    to be in LOOP_READY state.	 
+ * Input:
+ *     ha - pointer to host adapter structure
+ * 
+ * Note:    
+ *    Does context switching-Release SPIN_LOCK
+ *    (if any) before calling this routine.
+ *    
+ *
+ * Return:
+ *    Success (LOOP_READY) : 0
+ *    Failed  (LOOP_NOT_READY) : 1
+ */
+static inline int 
+qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha)
+{
+	int 	 return_status = QLA_SUCCESS;
+	unsigned long loop_timeout ;
+
+	/* wait for 5 min at the max for loop to be ready */
+	loop_timeout = jiffies + (MAX_LOOP_TIMEOUT * HZ); 
+
+	while ((!atomic_read(&ha->loop_down_timer) &&
+	    atomic_read(&ha->loop_state) == LOOP_DOWN) ||
+	    test_bit(CFG_ACTIVE, &ha->cfg_flags) ||
+	    atomic_read(&ha->loop_state) != LOOP_READY) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(3 * HZ);
+		if (time_after_eq(jiffies, loop_timeout)) {
+			return_status = QLA_FUNCTION_FAILED;
+			break;
+		}
+	}
+	return (return_status);	
+}
+
+/**************************************************************************
+* qla2xxx_eh_abort
+*
+* Description:
+*    The abort function will abort the specified command.
+*
+* Input:
+*    cmd = Linux SCSI command packet to be aborted.
+*
+* Returns:
+*    Either SUCCESS or FAILED.
+*
+* Note:
+**************************************************************************/
+int
+qla2xxx_eh_abort(struct scsi_cmnd *cmd)
+{
+	int		i;
+	int		return_status = FAILED;
+	os_lun_t	*q;
+	scsi_qla_host_t *ha;
+	scsi_qla_host_t *vis_ha;
+	srb_t		*sp;
+	srb_t		*rp;
+	struct list_head *list, *temp;
+	struct Scsi_Host *host;
+	uint8_t		found = 0;
+	unsigned int	b, t, l;
+	unsigned long	flags;
+
+
+	ENTER(__func__);
+
+	/* Get the SCSI request ptr */
+	sp = (srb_t *) CMD_SP(cmd);
+
+	/*
+	 * If sp is NULL, command is already returned.
+	 * sp is NULLED just before we call back scsi_done
+	 *
+	 */
+	if ((sp == NULL)) {
+		/* no action - we don't have command */
+		qla_printk(KERN_INFO, to_qla_host(cmd->device->host),
+		    "qla2xxx_eh_abort: cmd already done sp=%p\n", sp);
+		DEBUG(printk("qla2xxx_eh_abort: cmd already done sp=%p\n", sp);)
+		return(SUCCESS);
+	}
+	if (sp) {
+		DEBUG(printk("qla2xxx_eh_abort: refcount %i \n",
+		    atomic_read(&sp->ref_count));)
+	}
+
+	vis_ha = (scsi_qla_host_t *) cmd->device->host->hostdata;
+	ha = (scsi_qla_host_t *)cmd->device->host->hostdata;
+
+	host = ha->host;
+
+	/* Generate LU queue on bus, target, LUN */
+	b = cmd->device->channel;
+	t = cmd->device->id;
+	l = cmd->device->lun;
+	q = GET_LU_Q(vis_ha, t, l);
+
+	qla_printk(KERN_INFO, ha, 
+	    "%s scsi(%ld:%d:%d:%d): cmd_timeout_in_sec=0x%x.\n", __func__,
+	    ha->host_no, (int)b, (int)t, (int)l,
+	    cmd->timeout_per_command / HZ);
+
+	/*
+	 * if no LUN queue then something is very wrong!!!
+	 */
+	if (q == NULL) {
+		qla_printk(KERN_WARNING, ha,
+			"qla2x00: (%x:%x:%x) No LUN queue.\n", b, t, l);
+
+		/* no action - we don't have command */
+		return(FAILED);
+	}
+
+	DEBUG2(printk("scsi(%ld): ABORTing cmd=%p sp=%p jiffies = 0x%lx, "
+	    "timeout=%x, dpc_flags=%lx, vis_ha->dpc_flags=%lx\n",
+	    ha->host_no, cmd, sp, jiffies, cmd->timeout_per_command / HZ,
+	    ha->dpc_flags, vis_ha->dpc_flags));
+	DEBUG2(qla2x00_print_scsi_cmd(cmd));
+	DEBUG2(qla2x00_print_q_info(q);)
+
+	spin_unlock_irq(ha->host->host_lock);
+	/* Blocking call-Does context switching if abort isp is active etc */  
+	if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS) {
+		DEBUG2(printk("%s failed:board disabled\n", __func__);)
+		spin_lock_irq(ha->host->host_lock);
+		return (FAILED);
+	}
+	spin_lock_irq(ha->host->host_lock);
+
+	/* Search done queue */
+	spin_lock_irqsave(&ha->list_lock,flags);
+	list_for_each_safe(list, temp, &ha->done_queue) {
+		rp = list_entry(list, srb_t, list);
+
+		if (cmd != rp->cmd)
+			continue;
+
+		/*
+		 * Found command.Remove it from done list.
+		 * And proceed to post completion to scsi mid layer.
+		 */
+		return_status = SUCCESS;
+		found++;
+		qla2x00_delete_from_done_queue(ha, sp);
+
+		break;
+	} /* list_for_each_safe() */
+	spin_unlock_irqrestore(&ha->list_lock, flags);
+
+	/*
+	 * Return immediately if the aborted command was already in the done
+	 * queue
+	 */
+	if (found) {
+		qla_printk(KERN_INFO, ha,
+		    "qla2xxx_eh_abort: Returning completed command=%p sp=%p\n",
+		    cmd, sp);
+		sp_put(ha, sp);
+		return (return_status);
+	}
+	
+
+	/*
+	 * See if this command is in the retry queue
+	 */
+	DEBUG3(printk("qla2xxx_eh_abort: searching sp %p in retry "
+		    "queue.\n", sp);)
+
+	spin_lock_irqsave(&ha->list_lock, flags);
+	list_for_each_safe(list, temp, &ha->retry_queue) {
+		rp = list_entry(list, srb_t, list);
+
+		if (cmd != rp->cmd)
+			continue;
+
+
+		DEBUG2(printk("qla2xxx_eh_abort: found "
+		    "in retry queue. SP=%p\n", sp);)
+
+		__del_from_retry_queue(ha, rp);
+		cmd->result = DID_ABORT << 16;
+		__add_to_done_queue(ha, rp);
+
+		return_status = SUCCESS;
+		found++;
+
+		break;
+
+	} 
+	spin_unlock_irqrestore(&ha->list_lock, flags);
+
+	/*
+	 * Our SP pointer points at the command we want to remove from the
+	 * pending queue providing we haven't already sent it to the adapter.
+	 */
+	if (!found) {
+		DEBUG3(printk("qla2xxx_eh_abort: searching sp %p "
+		    "in pending queue.\n", sp);)
+
+		spin_lock_irqsave(&vis_ha->list_lock, flags);
+		list_for_each_safe(list, temp, &vis_ha->pending_queue) {
+			rp = list_entry(list, srb_t, list);
+
+			if (rp->cmd != cmd)
+				continue;
+
+			/* Remove srb from LUN queue. */
+			rp->flags |=  SRB_ABORTED;
+
+			DEBUG2(printk("qla2xxx_eh_abort: Cmd in pending queue."
+			    " serial_number %ld.\n",
+			    sp->cmd->serial_number);)
+
+			__del_from_pending_queue(vis_ha, rp);
+			cmd->result = DID_ABORT << 16;
+
+			__add_to_done_queue(vis_ha, rp);
+
+			return_status = SUCCESS;
+
+			found++;
+			break;
+		} /* list_for_each_safe() */
+		spin_unlock_irqrestore(&vis_ha->list_lock, flags);
+	} /*End of if !found */
+
+	if (!found) {  /* find the command in our active list */
+		DEBUG3(printk("qla2xxx_eh_abort: searching sp %p "
+		    "in outstanding queue.\n", sp);)
+
+		spin_lock_irqsave(&ha->hardware_lock, flags);
+		for (i = 1; i < MAX_OUTSTANDING_COMMANDS; i++) {
+			sp = ha->outstanding_cmds[i];
+
+			if (sp == NULL)
+				continue;
+
+			if (sp->cmd != cmd)
+				continue;
+
+			DEBUG2(printk("qla2xxx_eh_abort(%ld): aborting sp %p "
+			    "from RISC. pid=%ld sp->state=%x\n",
+			    ha->host_no, sp, sp->cmd->serial_number,
+			    sp->state);)
+			DEBUG(qla2x00_print_scsi_cmd(cmd);)
+			DEBUG(qla2x00_print_q_info(q);)
+
+			/* Get a reference to the sp and drop the lock.*/
+			sp_get(ha, sp);
+
+			spin_unlock_irqrestore(&ha->hardware_lock, flags);
+			spin_unlock(ha->host->host_lock);
+
+			if (qla2x00_abort_command(ha, sp)) {
+				DEBUG2(printk("qla2xxx_eh_abort: abort_command "
+				    "mbx failed.\n");)
+				return_status = FAILED;
+			} else {
+				DEBUG3(printk("qla2xxx_eh_abort: abort_command "
+				    " mbx success.\n");)
+				return_status = SUCCESS;
+			}
+
+			sp_put(ha,sp);
+
+			spin_lock_irq(ha->host->host_lock);
+			spin_lock_irqsave(&ha->hardware_lock, flags);
+
+			/*
+			 * Regardless of mailbox command status, go check on
+			 * done queue just in case the sp is already done.
+			 */
+			break;
+
+		}/*End of for loop */
+		spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+	} /*End of if !found */
+
+	  /*Waiting for our command in done_queue to be returned to OS.*/
+	if (qla2x00_eh_wait_on_command(ha, cmd) != 0) {
+		DEBUG2(printk("qla2xxx_eh_abort: cmd returned back to OS.\n");)
+		return_status = SUCCESS;
+	}
+
+	if (return_status == FAILED) {
+		qla_printk(KERN_INFO, ha, 
+			"qla2xxx_eh_abort Exiting: status=Failed\n");
+		return FAILED;
+	}
+
+	DEBUG2(printk("qla2xxx_eh_abort: Exiting. return_status=0x%x.\n",
+	    return_status));
+
+	LEAVE("qla2xxx_eh_abort");
+
+	return(return_status);
+}
+
+/**************************************************************************
+* qla2x00_eh_wait_for_pending_target_commands
+*
+* Description:
+*    Waits for all the commands to come back from the specified target.
+*
+* Input:
+*    ha - pointer to scsi_qla_host structure.
+*    t  - target 	
+* Returns:
+*    Either SUCCESS or FAILED.
+*
+* Note:
+**************************************************************************/
+int
+qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
+{
+	int	cnt;
+	int	status;
+	unsigned long	flags;
+	srb_t		*sp;
+	struct scsi_cmnd *cmd;
+
+	status = 0;
+
+	/*
+	 * Waiting for all commands for the designated target in the active
+	 * array
+	 */
+	for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
+		spin_lock_irqsave(&ha->hardware_lock, flags);
+		sp = ha->outstanding_cmds[cnt];
+		if (sp) {
+			cmd = sp->cmd;
+			spin_unlock_irqrestore(&ha->hardware_lock, flags);
+			if (cmd->device->id == t) {
+				if (!qla2x00_eh_wait_on_command(ha, cmd)) {
+					status = 1;
+					break;
+				}
+			}
+		}
+		else {
+			spin_unlock_irqrestore(&ha->hardware_lock, flags);
+		}
+	}
+	return (status);
+}
+
+
+/**************************************************************************
+* qla2xxx_eh_device_reset
+*
+* Description:
+*    The device reset function will reset the target and abort any
+*    executing commands.
+*
+*    NOTE: The use of SP is undefined within this context.  Do *NOT*
+*          attempt to use this value, even if you determine it is 
+*          non-null.
+*
+* Input:
+*    cmd = Linux SCSI command packet of the command that cause the
+*          bus device reset.
+*
+* Returns:
+*    SUCCESS/FAILURE (defined as macro in scsi.h).
+*
+**************************************************************************/
+int
+qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)
+{
+	int		return_status;
+	unsigned int	b, t, l;
+	scsi_qla_host_t	*ha;
+	os_tgt_t	*tq;
+	os_lun_t	*lq;
+	fc_port_t	*fcport_to_reset;
+
+	return_status = FAILED;
+	if (cmd == NULL) {
+		printk(KERN_INFO
+		    "%s(): **** SCSI mid-layer passing in NULL cmd\n",
+		    __func__);
+
+		return (return_status);
+	}
+
+	b = cmd->device->channel;
+	t = cmd->device->id;
+	l = cmd->device->lun;
+	ha = (scsi_qla_host_t *)cmd->device->host->hostdata;
+
+	tq = TGT_Q(ha, t);
+	if (tq == NULL) {
+		qla_printk(KERN_INFO, ha,
+		    "%s(): **** CMD derives a NULL TGT_Q\n", __func__);
+
+		return (return_status);
+	}
+	lq = (os_lun_t *)LUN_Q(ha, t, l);
+	if (lq == NULL) {
+		printk(KERN_INFO
+		    "%s(): **** CMD derives a NULL LUN_Q\n", __func__);
+
+		return (return_status);
+	}
+	fcport_to_reset = lq->fclun->fcport;
+
+#if STOP_ON_RESET
+	qla2x00_panic(__func__, ha->host);
+#endif
+
+	qla_printk(KERN_INFO, ha,
+	    "scsi(%ld:%d:%d:%d): DEVICE RESET ISSUED.\n", ha->host_no, b, t, l);
+
+	DEBUG2(printk(KERN_INFO
+	    "scsi(%ld): DEVICE_RESET cmd=%p jiffies = 0x%lx, timeout=%x, "
+	    "dpc_flags=%lx, status=%x allowed=%d cmd.state=%x\n",
+	    ha->host_no, cmd, jiffies, cmd->timeout_per_command / HZ,
+	    ha->dpc_flags, cmd->result, cmd->allowed, cmd->state));
+
+	spin_unlock_irq(ha->host->host_lock);
+
+	/* Blocking call-Does context switching if abort isp is active etc */  
+	if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS) {
+		DEBUG2(printk(KERN_INFO
+		    "%s failed:board disabled\n",__func__));
+
+		spin_lock_irq(ha->host->host_lock);
+		goto eh_dev_reset_done;
+	}
+
+	/* Blocking call-Does context switching if loop is Not Ready */
+	if (qla2x00_wait_for_loop_ready(ha) == QLA_SUCCESS) {
+		if (qla2x00_device_reset(ha, fcport_to_reset) == 0) {
+			return_status = SUCCESS;
+		}
+
+#if defined(LOGOUT_AFTER_DEVICE_RESET)
+		if (return_status == SUCCESS) {
+			if (fcport_to_reset->flags & FC_FABRIC_DEVICE) {
+				qla2x00_fabric_logout(ha,
+				    fcport_to_reset->loop_id);
+				qla2x00_mark_device_lost(ha, fcport_to_reset);
+			}
+		}
+#endif
+	} else {
+		DEBUG2(printk(KERN_INFO
+		    "%s failed: loop not ready\n",__func__);)
+	}
+
+	spin_lock_irq(ha->host->host_lock);
+
+	if (return_status == FAILED) {
+		DEBUG3(printk("%s(%ld): device reset failed\n",
+		    __func__,ha->host_no));
+		qla_printk(KERN_INFO, ha, "%s: device reset failed\n",
+		    __func__);
+
+		goto eh_dev_reset_done;
+	}
+
+	/*
+	 * If we are coming down the EH path, wait for all commands to
+	 * complete for the device.
+	 */
+	if (cmd->device->host->eh_active) {
+		if (qla2x00_eh_wait_for_pending_target_commands(ha, t))
+			return_status = FAILED;
+
+		if (return_status == FAILED) {
+			DEBUG3(printk("%s(%ld): failed while waiting for "
+			    "commands\n", __func__, ha->host_no));
+			qla_printk(KERN_INFO, ha,
+			    "%s: failed while waiting for commands\n",
+			    __func__); 
+
+			goto eh_dev_reset_done;
+		}
+	}
+
+	qla_printk(KERN_INFO, ha,
+	    "scsi(%ld:%d:%d:%d): DEVICE RESET SUCCEEDED.\n",
+	    ha->host_no, b, t, l);
+
+eh_dev_reset_done:
+
+	return (return_status);
+}
+
+/**************************************************************************
+* qla2x00_eh_wait_for_pending_commands
+*
+* Description:
+*    Waits for all the commands to come back from the specified host.
+*
+* Input:
+*    ha - pointer to scsi_qla_host structure.
+*
+* Returns:
+*    1 : SUCCESS
+*    0 : FAILED
+*
+* Note:
+**************************************************************************/
+int
+qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha)
+{
+	int	cnt;
+	int	status;
+	unsigned long	flags;
+	srb_t		*sp;
+	struct scsi_cmnd *cmd;
+
+	status = 1;
+
+	/*
+	 * Waiting for all commands for the designated target in the active
+	 * array
+	 */
+	for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
+		spin_lock_irqsave(&ha->hardware_lock, flags);
+		sp = ha->outstanding_cmds[cnt];
+		if (sp) {
+			cmd = sp->cmd;
+			spin_unlock_irqrestore(&ha->hardware_lock, flags);
+			status = qla2x00_eh_wait_on_command(ha, cmd);
+			if (status == 0)
+				break;
+		}
+		else {
+			spin_unlock_irqrestore(&ha->hardware_lock, flags);
+		}
+	}
+	return (status);
+}
+
+
+/**************************************************************************
+* qla2xxx_eh_bus_reset
+*
+* Description:
+*    The bus reset function will reset the bus and abort any executing
+*    commands.
+*
+* Input:
+*    cmd = Linux SCSI command packet of the command that cause the
+*          bus reset.
+*
+* Returns:
+*    SUCCESS/FAILURE (defined as macro in scsi.h).
+*
+**************************************************************************/
+int
+qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd)
+{
+	scsi_qla_host_t *ha;
+	srb_t *sp;
+	int rval = FAILED;
+
+
+	ENTER("qla2xxx_eh_bus_reset");
+
+	ha = (scsi_qla_host_t *) cmd->device->host->hostdata;
+	sp = (srb_t *) CMD_SP(cmd);
+
+#if  STOP_ON_RESET
+	printk("Resetting the Bus= 0x%x\n", (int)cmd);
+	qla2x00_print_scsi_cmd(cmd);
+	qla2x00_panic("qla2100_reset", ha->host);
+#endif
+
+	qla_printk(KERN_INFO, ha,
+	    "scsi(%ld:%d:%d:%d): LOOP RESET ISSUED.\n", ha->host_no,
+	    cmd->device->channel, cmd->device->id, cmd->device->lun);
+
+	spin_unlock_irq(ha->host->host_lock);
+
+	/* Blocking call-Does context switching if abort isp is active etc*/  
+	if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS) {
+		DEBUG2(printk("%s failed:board disabled\n",__func__));
+		spin_lock_irq(ha->host->host_lock);
+		return FAILED;
+	}
+
+	/* Blocking call-Does context switching if loop is Not Ready */ 
+	if (qla2x00_wait_for_loop_ready(ha) == QLA_SUCCESS) {
+		if (qla2x00_loop_reset(ha)) 
+			rval = SUCCESS;
+	}
+
+	spin_lock_irq(ha->host->host_lock);
+	if (rval == FAILED)
+		goto out;
+
+	/*
+	 * Blocking Call. It goes to sleep waiting for cmd to get to done q
+	 *
+	 * XXX(hch): really?  We're under host_lock here..
+	 */
+	/* Waiting for our command in done_queue to be returned to OS.*/
+	if (!qla2x00_eh_wait_for_pending_commands(ha))
+		rval = FAILED;
+
+ out:
+	qla_printk(KERN_INFO, ha, "%s: reset %s\n", __func__,
+			(rval == FAILED) ? "failed" : "succeded");
+
+	LEAVE("qla2xxx_eh_bus_reset");
+	return rval;
+}
+
+/**************************************************************************
+* qla2xxx_eh_host_reset
+*
+* Description:
+*    The reset function will reset the Adapter.
+*
+* Input:
+*      cmd = Linux SCSI command packet of the command that cause the
+*            adapter reset.
+*
+* Returns:
+*      Either SUCCESS or FAILED.
+*
+* Note:
+**************************************************************************/
+int
+qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
+{
+	scsi_qla_host_t *ha = (scsi_qla_host_t *)cmd->device->host->hostdata;
+	int		rval = SUCCESS;
+
+	ENTER("qla2xxx_eh_host_reset");
+
+	/* Display which one we're actually resetting for debug. */
+	DEBUG(printk("qla2xxx_eh_host_reset:Resetting scsi(%ld).\n",
+	    ha->host_no));
+
+#if  STOP_ON_RESET
+	qla_printk(KERN_INFO, ha, "Host Reset...  Command=\n");
+	qla2x00_print_scsi_cmd(cmd);
+	qla2x00_panic("qla2xxx_eh_host_reset", ha->host);
+#endif
+
+	/*
+	 *  Now issue reset.
+	 */
+	qla_printk(KERN_INFO, ha,
+	    "scsi(%ld:%d:%d:%d): ADAPTER RESET issued.\n", ha->host_no,
+	    cmd->device->channel, cmd->device->id, cmd->device->lun);
+
+	spin_unlock_irq(ha->host->host_lock);
+
+	/* Blocking call-Does context switching if abort isp is active etc*/  
+	if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS)
+		goto board_disabled;
+
+	/*
+	 * Fixme-may be dpc thread is active and processing
+	 * loop_resync,so wait a while for it to 
+	 * be completed and then issue big hammer.Otherwise
+	 * it may cause I/O failure as big hammer marks the
+	 * devices as lost kicking of the port_down_timer
+	 * while dpc is stuck for the mailbox to complete.
+	 */
+	/* Blocking call-Does context switching if loop is Not Ready */
+	qla2x00_wait_for_loop_ready(ha);
+	set_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags);
+	if (qla2x00_abort_isp(ha)) {
+		clear_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags);
+		/* failed. schedule dpc to try */
+		set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+
+		if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS)
+			goto board_disabled;
+	} 
+
+	clear_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags);
+
+	spin_lock_irq(ha->host->host_lock);
+	if (rval == FAILED)
+		goto out;
+
+	/* Waiting for our command in done_queue to be returned to OS.*/
+	if (qla2x00_eh_wait_for_pending_commands(ha))
+		rval = FAILED;
+
+ out:
+	qla_printk(KERN_INFO, ha, "%s: reset %s\n", __func__,
+			(rval == FAILED) ? "failed" : "succeded");
+
+	LEAVE("qla2xxx_eh_host_reset");
+	return rval;
+
+ board_disabled:
+	spin_lock_irq(ha->host->host_lock);
+
+	qla_printk(KERN_INFO, ha, "%s: failed:board disabled\n", __func__);
+	return FAILED;
+}
+
+
+/*
+* qla2x00_loop_reset
+*      Issue loop reset.
+*
+* Input:
+*      ha = adapter block pointer.
+*
+* Returns:
+*      0 = success
+*/
+static uint8_t
+qla2x00_loop_reset(scsi_qla_host_t *ha)
+{
+	uint8_t  status = QLA_SUCCESS;
+	uint16_t t;
+	os_tgt_t        *tq;
+
+	ENTER(__func__);
+
+	if (ha->flags.enable_lip_reset) {
+		status = qla2x00_lip_reset(ha);
+	}
+
+	if (status == QLA_SUCCESS && ha->flags.enable_target_reset) {
+		for (t = 0; t < MAX_FIBRE_DEVICES; t++) {
+			if ((tq = TGT_Q(ha, t)) == NULL)
+				continue;
+
+			if (tq->fcport == NULL)
+				continue;
+
+			status = qla2x00_target_reset(ha, 0, t);
+			if (status != QLA_SUCCESS) {
+				break;
+			}
+		}
+	}
+
+	if (status == QLA_SUCCESS &&
+		((!ha->flags.enable_target_reset && 
+		  !ha->flags.enable_lip_reset) ||
+		ha->flags.enable_lip_full_login)) {
+
+		status = qla2x00_full_login_lip(ha);
+	}
+
+	/* Issue marker command only when we are going to start the I/O */
+	ha->marker_needed = 1;
+
+	if (status) {
+		/* Empty */
+		DEBUG2_3(printk("%s(%ld): **** FAILED ****\n",
+				__func__,
+				ha->host_no);)
+	} else {
+		/* Empty */
+		DEBUG3(printk("%s(%ld): exiting normally.\n",
+				__func__,
+				ha->host_no);)
+	}
+
+	LEAVE(__func__);
+
+	return(status);
+}
+
+/*
+ * qla2x00_device_reset
+ *	Issue bus device reset message to the target.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	t = SCSI ID.
+ *	TARGET_QUEUE_LOCK must be released.
+ *	ADAPTER_STATE_LOCK must be released.
+ *
+ * Context:
+ *	Kernel context.
+ */
+static int
+qla2x00_device_reset(scsi_qla_host_t *ha, fc_port_t *reset_fcport)
+{
+	/* Abort Target command will clear Reservation */
+	return qla2x00_abort_target(reset_fcport);
+}
+
+/**************************************************************************
+* qla2x00_slave_configure
+*
+* Description:
+**************************************************************************/
+int
+qla2xxx_slave_configure(struct scsi_device *sdev)
+{
+	scsi_qla_host_t *ha = to_qla_host(sdev->host);
+	int queue_depth;
+
+	if (IS_QLA2100(ha) || IS_QLA2200(ha))
+		queue_depth = 16;
+	else
+		queue_depth = 32;
+
+	if (sdev->tagged_supported) {
+#if defined(MODULE)
+		if (!(ql2xmaxqdepth == 0 || ql2xmaxqdepth > 256))
+			queue_depth = ql2xmaxqdepth;
+#endif 
+		ql2xmaxqdepth = queue_depth;
+
+		scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, queue_depth);
+
+		qla_printk(KERN_INFO, ha,
+		    "scsi(%d:%d:%d:%d): Enabled tagged queuing, queue "
+		    "depth %d.\n",
+		    sdev->host->host_no, sdev->channel, sdev->id, sdev->lun,
+		    sdev->queue_depth);
+	} else {
+		 scsi_adjust_queue_depth(sdev, 0 /* TCQ off */,
+		     sdev->host->hostt->cmd_per_lun /* 3 */);
+	}
+
+	return (0);
+}
+
+/**
+ * qla2x00_config_dma_addressing() - Configure OS DMA addressing method.
+ * @ha: HA context
+ *
+ * At exit, the @ha's flags.enable_64bit_addressing set to indicated
+ * supported addressing method.
+ */
+static void
+qla2x00_config_dma_addressing(scsi_qla_host_t *ha)
+{
+	/* Assume 32bit DMA address */
+	ha->flags.enable_64bit_addressing = 0;
+	ha->calc_request_entries = qla2x00_calc_iocbs_32;
+	ha->build_scsi_iocbs = qla2x00_build_scsi_iocbs_32;
+
+	/*
+	 * Given the two variants pci_set_dma_mask(), allow the compiler to
+	 * assist in setting the proper dma mask.
+	 */
+	if (sizeof(dma_addr_t) > 4) {
+		/* Update our PCI device dma_mask for full 64 bits */
+		if (pci_set_dma_mask(ha->pdev, 0xffffffffffffffffULL) == 0) {
+			ha->flags.enable_64bit_addressing = 1;
+			ha->calc_request_entries = qla2x00_calc_iocbs_64;
+			ha->build_scsi_iocbs = qla2x00_build_scsi_iocbs_64;
+
+			if (pci_set_consistent_dma_mask(ha->pdev,
+			    0xffffffffffffffffULL)) {
+				qla_printk(KERN_DEBUG, ha, 
+				    "Failed to set 64 bit PCI consistent mask; "
+				    "using 32 bit.\n");
+				pci_set_consistent_dma_mask(ha->pdev,
+				    0xffffffffULL);
+			}
+		} else {
+			qla_printk(KERN_DEBUG, ha,
+			    "Failed to set 64 bit PCI DMA mask, falling back "
+			    "to 32 bit MASK.\n");
+			pci_set_dma_mask(ha->pdev, 0xffffffff);
+		}
+	} else {
+		pci_set_dma_mask(ha->pdev, 0xffffffff);
+	}
+}
+
+static int
+qla2x00_iospace_config(scsi_qla_host_t *ha)
+{
+	unsigned long	pio, pio_len, pio_flags;
+	unsigned long	mmio, mmio_len, mmio_flags;
+
+	pio = pci_resource_start(ha->pdev, 0);
+	pio_len = pci_resource_len(ha->pdev, 0);
+	pio_flags = pci_resource_flags(ha->pdev, 0);
+
+	mmio = pci_resource_start(ha->pdev, 1);
+	mmio_len = pci_resource_len(ha->pdev, 1);
+	mmio_flags = pci_resource_flags(ha->pdev, 1);
+
+#if MEMORY_MAPPED_IO
+	if (!(mmio_flags & IORESOURCE_MEM)) {
+		qla_printk(KERN_ERR, ha,
+		    "region #0 not an MMIO resource (%s), aborting\n",
+		    ha->pdev->slot_name);
+		goto iospace_error_exit;
+	}
+	if (mmio_len < MIN_IOBASE_LEN) {
+		qla_printk(KERN_ERR, ha,
+		    "Invalid PCI mem region size (%s), aborting\n",
+		    ha->pdev->slot_name);
+		goto iospace_error_exit;
+	}
+#else
+	if (!(pio_flags & IORESOURCE_IO)) {
+		qla_printk(KERN_ERR, ha,
+		    "region #0 not a PIO resource (%s), aborting\n",
+		    ha->pdev->slot_name);
+		goto iospace_error_exit;
+	}
+	if (pio_len < MIN_IOBASE_LEN) {
+		qla_printk(KERN_ERR, ha,
+		    "Invalid PCI I/O region size (%s), aborting\n",
+		    ha->pdev->slot_name);
+		goto iospace_error_exit;
+	}
+#endif
+
+	if (pci_request_regions(ha->pdev, ha->brd_info->drv_name)) {
+		qla_printk(KERN_WARNING, ha,
+		    "Failed to reserve PIO/MMIO regions (%s)\n", 
+		    ha->pdev->slot_name);
+
+		goto iospace_error_exit;
+	}
+
+	/* Assume PIO */
+	ha->iobase = (device_reg_t *) pio;
+	ha->pio_address = pio;
+	ha->pio_length = pio_len;
+	ha->mmio_address = NULL;
+#if MEMORY_MAPPED_IO
+	ha->mmio_address = ioremap(mmio, MIN_IOBASE_LEN);
+	if (!ha->mmio_address) {
+		qla_printk(KERN_ERR, ha,
+		    "cannot remap MMIO (%s), aborting\n", ha->pdev->slot_name);
+
+		goto iospace_error_exit;
+	}
+	ha->iobase = (device_reg_t *) ha->mmio_address;
+	ha->mmio_length = mmio_len;
+#endif
+
+	return (0);
+
+iospace_error_exit:
+	return (-ENOMEM);
+}
+
+/*
+ * PCI driver interface
+ */
+int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
+{
+	int	ret;
+	device_reg_t *reg;
+	struct Scsi_Host *host;
+	scsi_qla_host_t *ha;
+	unsigned long	flags = 0;
+	unsigned long	wait_switch = 0;
+	char pci_info[20];
+	char fw_str[30];
+
+	if (pci_enable_device(pdev))
+		return -1;
+
+	host = scsi_host_alloc(&qla2x00_driver_template,
+	    sizeof(scsi_qla_host_t));
+	if (host == NULL) {
+		printk(KERN_WARNING
+		    "qla2xxx: Couldn't allocate host from scsi layer!\n");
+		return -1;
+	}
+
+	/* Clear our data area */
+	ha = (scsi_qla_host_t *)host->hostdata;
+	memset(ha, 0, sizeof(scsi_qla_host_t));
+
+	ha->pdev = pdev;
+	ha->host = host;
+	ha->host_no = host->host_no;
+	ha->brd_info = brd_info;
+	sprintf(ha->host_str, "%s_%ld", ha->brd_info->drv_name, ha->host_no);
+
+	/* Configure PCI I/O space */
+	ret = qla2x00_iospace_config(ha);
+	if (ret != 0) {
+		goto probe_failed;
+	}
+
+	/* Sanitize the information from PCI BIOS. */
+	host->irq = pdev->irq;
+
+	qla_printk(KERN_INFO, ha,
+	    "Found an %s, irq %d, iobase 0x%p\n", ha->brd_info->isp_name,
+	    host->irq, ha->iobase);
+
+	spin_lock_init(&ha->hardware_lock);
+
+	/* 4.23 Initialize /proc/scsi/qla2x00 counters */
+	ha->actthreads = 0;
+	ha->qthreads   = 0;
+	ha->total_isr_cnt = 0;
+	ha->total_isp_aborts = 0;
+	ha->total_lip_cnt = 0;
+	ha->total_dev_errs = 0;
+	ha->total_ios = 0;
+	ha->total_bytes = 0;
+
+	ha->prev_topology = 0;
+	ha->ports = MAX_BUSES;
+
+	if (IS_QLA2100(ha)) {
+		ha->max_targets = MAX_TARGETS_2100;
+		ha->mbx_count = MAILBOX_REGISTER_COUNT_2100;
+		ha->response_q_length = RESPONSE_ENTRY_CNT_2100;
+		ha->last_loop_id = SNS_LAST_LOOP_ID_2100;
+	} else if (IS_QLA2200(ha)) {
+		ha->max_targets = MAX_TARGETS_2200;
+		ha->mbx_count = MAILBOX_REGISTER_COUNT;
+		ha->response_q_length = RESPONSE_ENTRY_CNT_2100;
+		ha->last_loop_id = SNS_LAST_LOOP_ID_2100;
+	} else /*if (IS_QLA2300(ha))*/ {
+		ha->max_targets = MAX_TARGETS_2200;
+		ha->mbx_count = MAILBOX_REGISTER_COUNT;
+		ha->response_q_length = RESPONSE_ENTRY_CNT_2300;
+		ha->last_loop_id = SNS_LAST_LOOP_ID_2300;
+	}
+
+	/* load the F/W, read paramaters, and init the H/W */
+	ha->instance = num_hosts;
+
+	init_MUTEX_LOCKED(&ha->mbx_intr_sem);
+
+	INIT_LIST_HEAD(&ha->list);
+	INIT_LIST_HEAD(&ha->fcports);
+	INIT_LIST_HEAD(&ha->rscn_fcports);
+	INIT_LIST_HEAD(&ha->done_queue);
+	INIT_LIST_HEAD(&ha->retry_queue);
+	INIT_LIST_HEAD(&ha->scsi_retry_queue);
+	INIT_LIST_HEAD(&ha->pending_queue);
+
+	/*
+	 * These locks are used to prevent more than one CPU
+	 * from modifying the queue at the same time. The
+	 * higher level "host_lock" will reduce most
+	 * contention for these locks.
+	 */
+	spin_lock_init(&ha->mbx_bits_lock);
+	spin_lock_init(&ha->mbx_reg_lock);
+	spin_lock_init(&ha->mbx_q_lock);
+	spin_lock_init(&ha->list_lock);
+
+	init_completion(&ha->dpc_inited);
+	init_completion(&ha->dpc_exited);
+
+	qla2x00_config_dma_addressing(ha);
+	if (qla2x00_mem_alloc(ha)) {
+		qla_printk(KERN_WARNING, ha,
+		    "[ERROR] Failed to allocate memory for adapter\n");
+
+		goto probe_failed;
+	}
+
+	if (qla2x00_initialize_adapter(ha) &&
+	    !(ha->device_flags & DFLG_NO_CABLE)) {
+
+		qla_printk(KERN_WARNING, ha,
+		    "Failed to initialize adapter\n");
+
+		DEBUG2(printk("scsi(%ld): Failed to initialize adapter - "
+		    "Adapter flags %x.\n",
+		    ha->host_no, ha->device_flags));
+
+		goto probe_failed;
+	}
+
+	/*
+	 * Startup the kernel thread for this host adapter
+	 */
+	ha->dpc_should_die = 0;
+	ha->dpc_pid = kernel_thread(qla2x00_do_dpc, ha, 0);
+	if (ha->dpc_pid < 0) {
+		qla_printk(KERN_WARNING, ha,
+		    "Unable to start DPC thread!\n");
+
+		goto probe_failed;
+	}
+	wait_for_completion(&ha->dpc_inited);
+
+	host->this_id = 255;
+	host->cmd_per_lun = 3;
+	host->max_cmd_len = MAX_CMDSZ;
+	host->max_channel = ha->ports - 1;
+	host->max_lun = ha->max_luns;
+	host->unique_id = ha->instance;
+	host->max_id = ha->max_targets;
+
+	if (request_irq(host->irq, qla2x00_intr_handler, SA_INTERRUPT|SA_SHIRQ,
+	    ha->brd_info->drv_name, ha)) {
+		qla_printk(KERN_WARNING, ha,
+		    "Failed to reserve interrupt %d already in use.\n",
+		    host->irq);
+		goto probe_failed;
+	}
+
+	/* Initialized the timer */
+	qla2x00_start_timer(ha, qla2x00_timer, WATCH_INTERVAL);
+
+	DEBUG2(printk("DEBUG: detect hba %ld at address = %p\n",
+	    ha->host_no, ha));
+
+	reg = ha->iobase;
+
+	/* Disable ISP interrupts. */
+	qla2x00_disable_intrs(ha);
+
+	/* Ensure mailbox registers are free. */
+	spin_lock_irqsave(&ha->hardware_lock, flags);
+	WRT_REG_WORD(&reg->semaphore, 0);
+	WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT);
+	WRT_REG_WORD(&reg->hccr, HCCR_CLR_HOST_INT);
+
+	/* Enable proper parity */
+	if (IS_QLA23XX(ha)) {
+		if (IS_QLA2312(ha) || IS_QLA2322(ha))
+			/* SRAM, Instruction RAM and GP RAM parity */
+			WRT_REG_WORD(&reg->hccr, (HCCR_ENABLE_PARITY + 0x7));
+		else
+			/* SRAM parity */
+			WRT_REG_WORD(&reg->hccr, (HCCR_ENABLE_PARITY + 0x1));
+	}
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+	/* Enable chip interrupts. */
+	qla2x00_enable_intrs(ha);
+
+	/* Insert new entry into the list of adapters */
+	write_lock(&qla_hostlist_lock);
+	list_add_tail(&ha->list, &qla_hostlist);
+	write_unlock(&qla_hostlist_lock);
+
+	/* v2.19.5b6 */
+	/*
+	 * Wait around max loop_reset_delay secs for the devices to come
+	 * on-line. We don't want Linux scanning before we are ready.
+	 *
+	 */
+	for (wait_switch = jiffies + (ha->loop_reset_delay * HZ);
+	    time_before(jiffies,wait_switch) &&
+	     !(ha->device_flags & (DFLG_NO_CABLE | DFLG_FABRIC_DEVICES))
+	     && (ha->device_flags & SWITCH_FOUND) ;) {
+
+		qla2x00_check_fabric_devices(ha);
+
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(5);
+	}
+
+	pci_set_drvdata(pdev, ha);
+	ha->flags.init_done = 1;
+	num_hosts++;
+
+	/* List the target we have found */
+	if (displayConfig) {
+		qla2x00_display_fc_names(ha);
+	}
+
+	if (scsi_add_host(host, &pdev->dev))
+		goto probe_failed;
+
+	sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_fw_dump_attr);
+	sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_nvram_attr);
+
+	qla_printk(KERN_INFO, ha, "\n"
+	    " QLogic ISP2xxx PCI/PCI-X Fibre Channel HBA Driver: %s\n"
+	    "  QLogic %s - %s\n"
+	    "  %s: %s @ %s hdma%c, host#=%ld, fw=%s\n", qla2x00_version_str,
+	    ha->model_number, ha->model_desc ? ha->model_desc: "",
+	    ha->brd_info->isp_name, qla2x00_get_pci_info_str(ha, pci_info),
+	    pci_name(ha->pdev), ha->flags.enable_64bit_addressing ? '+': '-',
+	    ha->host_no, qla2x00_get_fw_version_str(ha, fw_str));
+
+	if (ql2xdoinitscan)
+		scsi_scan_host(host);
+
+	return 0;
+
+probe_failed:
+	qla2x00_free_device(ha);
+
+	scsi_host_put(host);
+
+	return -1;
+}
+EXPORT_SYMBOL_GPL(qla2x00_probe_one);
+
+void qla2x00_remove_one(struct pci_dev *pdev)
+{
+	scsi_qla_host_t *ha;
+
+	ha = pci_get_drvdata(pdev);
+
+	write_lock(&qla_hostlist_lock);
+	list_del(&ha->list);
+	write_unlock(&qla_hostlist_lock);
+
+	sysfs_remove_bin_file(&ha->host->shost_gendev.kobj,
+	    &sysfs_fw_dump_attr);
+	sysfs_remove_bin_file(&ha->host->shost_gendev.kobj, &sysfs_nvram_attr);
+
+	scsi_remove_host(ha->host);
+
+	qla2x00_free_device(ha);
+
+	scsi_host_put(ha->host);
+
+	pci_set_drvdata(pdev, NULL);
+}
+EXPORT_SYMBOL_GPL(qla2x00_remove_one);
+
+static void
+qla2x00_free_device(scsi_qla_host_t *ha)
+{
+	int ret;
+
+	/* Abort any outstanding IO descriptors. */
+	if (IS_QLA23XX(ha))
+		qla2x00_cancel_io_descriptors(ha);
+
+	/* turn-off interrupts on the card */
+	if (ha->interrupts_on)
+		qla2x00_disable_intrs(ha);
+
+	/* Disable timer */
+	if (ha->timer_active)
+		qla2x00_stop_timer(ha);
+
+	/* Kill the kernel thread for this host */
+	if (ha->dpc_pid >= 0) {
+		ha->dpc_should_die = 1;
+		wmb();
+		ret = kill_proc(ha->dpc_pid, SIGHUP, 1);
+		if (ret) {
+			qla_printk(KERN_ERR, ha,
+			    "Unable to signal DPC thread -- (%d)\n", ret);
+
+			/* TODO: SOMETHING MORE??? */
+		} else {
+			wait_for_completion(&ha->dpc_exited);
+		}
+	}
+
+	qla2x00_mem_free(ha);
+
+	ha->flags.online = FALSE;
+
+	/* Detach interrupts */
+	if (ha->pdev->irq)
+		free_irq(ha->pdev->irq, ha);
+
+	/* release io space registers  */
+	pci_release_regions(ha->pdev);
+
+#if MEMORY_MAPPED_IO
+	if (ha->mmio_address)
+		iounmap(ha->mmio_address);
+#endif
+}
+
+
+/*
+ * The following support functions are adopted to handle
+ * the re-entrant qla2x00_proc_info correctly.
+ */
+static void
+copy_mem_info(struct info_str *info, char *data, int len)
+{
+	if (info->pos + len > info->offset + info->length)
+		len = info->offset + info->length - info->pos;
+
+	if (info->pos + len < info->offset) {
+		info->pos += len;
+		return;
+	}
+ 
+	if (info->pos < info->offset) {
+		off_t partial;
+ 
+		partial = info->offset - info->pos;
+		data += partial;
+		info->pos += partial;
+		len  -= partial;
+	}
+ 
+	if (len > 0) {
+		memcpy(info->buffer, data, len);
+		info->pos += len;
+		info->buffer += len;
+	}
+}
+
+static int
+copy_info(struct info_str *info, char *fmt, ...)
+{
+	va_list args;
+	char buf[256];
+	int len;
+ 
+	va_start(args, fmt);
+	len = vsprintf(buf, fmt, args);
+	va_end(args);
+ 
+	copy_mem_info(info, buf, len);
+
+	return (len);
+}
+
+/*************************************************************************
+* qla2x00_proc_info
+*
+* Description:
+*   Return information to handle /proc support for the driver.
+*
+* inout : decides the direction of the dataflow and the meaning of the
+*         variables
+* buffer: If inout==FALSE data is being written to it else read from it
+*         (ptr to a page buffer)
+* *start: If inout==FALSE start of the valid data in the buffer
+* offset: If inout==FALSE starting offset from the beginning of all
+*         possible data to return.
+* length: If inout==FALSE max number of bytes to be written into the buffer
+*         else number of bytes in "buffer"
+* Returns:
+*         < 0:  error. errno value.
+*         >= 0: sizeof data returned.
+*************************************************************************/
+int
+qla2x00_proc_info(struct Scsi_Host *shost, char *buffer,
+    char **start, off_t offset, int length, int inout)
+{
+	struct info_str	info;
+	int             i;
+	int             retval = -EINVAL;
+	os_lun_t	*up;
+	os_tgt_t	*tq;
+	unsigned int	t, l;
+	uint32_t        tmp_sn;
+	unsigned long   *flags;
+	uint8_t		*loop_state;
+	int	found;
+	scsi_qla_host_t *ha;
+	char fw_info[30];
+
+	DEBUG3(printk(KERN_INFO
+	    "Entering proc_info buff_in=%p, offset=0x%lx, length=0x%x\n",
+	    buffer, offset, length);)
+
+	ha = NULL;
+
+	/* Find the host that was specified */
+	found = 0;
+	read_lock(&qla_hostlist_lock);
+	list_for_each_entry(ha, &qla_hostlist, list) {
+		if (ha->host == shost) {
+			found++;
+			break;
+		}
+	}
+	read_unlock(&qla_hostlist_lock);
+
+	/* if host wasn't found then exit */
+	if (!found) {
+		DEBUG2_3(printk(KERN_WARNING
+		    "%s: Can't find adapter for host %p\n", 
+		    __func__, shost);)
+
+		return (retval);
+	}
+
+	if (inout == TRUE) {
+		/* Has data been written to the file? */
+		DEBUG3(printk(
+		    "%s: has data been written to the file. \n",
+		    __func__);)
+
+		return (qla2x00_set_info(buffer, length, shost));
+	}
+
+	if (start) {
+		*start = buffer;
+	}
+
+	info.buffer = buffer;
+	info.length = length;
+	info.offset = offset;
+	info.pos    = 0;
+
+	/* start building the print buffer */
+	copy_info(&info,
+	    "QLogic PCI to Fibre Channel Host Adapter for %s:\n"
+	    "        Firmware version %s, ",
+	    ha->model_number, qla2x00_get_fw_version_str(ha, fw_info));
+
+	copy_info(&info, "Driver version %s\n", qla2x00_version_str);
+
+	copy_info(&info, "Entry address = %p\n", qla2x00_set_info);
+
+	tmp_sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) | 
+	    ha->serial1;
+	copy_info(&info, "ISP: %s, Serial# %c%05d\n",
+	    ha->brd_info->isp_name, ('A' + tmp_sn/100000), (tmp_sn%100000));
+
+	copy_info(&info,
+	    "Request Queue = 0x%p, Response Queue = 0x%p\n",
+	    (void *)ha->request_dma, (void *)ha->response_dma);
+
+	copy_info(&info,
+	    "Request Queue count = %ld, Response Queue count = %ld\n",
+	    (long)REQUEST_ENTRY_CNT, (long)ha->response_q_length);
+
+	copy_info(&info,
+	    "Total number of active commands = %ld\n",
+	    ha->actthreads);
+
+	copy_info(&info,
+	    "Total number of interrupts = %ld\n",
+	    (long)ha->total_isr_cnt);
+
+	copy_info(&info,
+	    "    Device queue depth = 0x%x\n",
+	    (ql2xmaxqdepth == 0) ? 16 : ql2xmaxqdepth);
+
+	copy_info(&info,
+	    "Number of free request entries = %d\n", ha->req_q_cnt);
+
+	copy_info(&info,
+	    "Number of mailbox timeouts = %ld\n", ha->total_mbx_timeout);
+
+	copy_info(&info,
+	    "Number of ISP aborts = %ld\n", ha->total_isp_aborts);
+
+	copy_info(&info,
+	    "Number of loop resyncs = %ld\n", ha->total_loop_resync);
+
+	copy_info(&info,
+	    "Number of retries for empty slots = %ld\n",
+	    qla2x00_stats.outarray_full);
+
+	copy_info(&info,
+	    "Number of reqs in pending_q= %ld, retry_q= %d, "
+	    "done_q= %ld, scsi_retry_q= %d\n",
+	    ha->qthreads, ha->retry_q_cnt,
+	    ha->done_q_cnt, ha->scsi_retry_q_cnt);
+
+	flags = (unsigned long *) &ha->flags;
+
+	if (atomic_read(&ha->loop_state) == LOOP_DOWN) {
+		loop_state = "DOWN";
+	} else if (atomic_read(&ha->loop_state) == LOOP_UP) {
+		loop_state = "UP";
+	} else if (atomic_read(&ha->loop_state) == LOOP_READY) {
+		loop_state = "READY";
+	} else if (atomic_read(&ha->loop_state) == LOOP_TIMEOUT) {
+		loop_state = "TIMEOUT";
+	} else if (atomic_read(&ha->loop_state) == LOOP_UPDATE) {
+		loop_state = "UPDATE";
+	} else {
+		loop_state = "UNKNOWN";
+	}
+
+	copy_info(&info, 
+	    "Host adapter:loop state = <%s>, flags = 0x%lx\n",
+	    loop_state , *flags);
+
+	copy_info(&info, "Dpc flags = 0x%lx\n", ha->dpc_flags);
+
+	copy_info(&info, "MBX flags = 0x%x\n", ha->mbx_flags);
+
+	copy_info(&info, "Link down Timeout = %3.3d\n",
+	    ha->link_down_timeout);
+
+	copy_info(&info, "Port down retry = %3.3d\n",
+	    ha->port_down_retry_count);
+
+	copy_info(&info, "Login retry count = %3.3d\n",
+	    ha->login_retry_count);
+
+	copy_info(&info,
+	    "Commands retried with dropped frame(s) = %d\n",
+	    ha->dropped_frame_error_cnt);
+
+	copy_info(&info,
+	    "Info -- pci=%x xchgs=0x%x iocbs=0x%x\n", ha->pci_attr,
+	    ha->xchg_buf_cnt, ha->iocb_buf_cnt);
+
+	copy_info(&info, "\n");
+
+	/* 2.25 node/port display to proc */
+	/* Display the node name for adapter */
+	copy_info(&info, "\nSCSI Device Information:\n");
+	copy_info(&info,
+	    "scsi-qla%d-adapter-node="
+	    "%02x%02x%02x%02x%02x%02x%02x%02x;\n",
+	    (int)ha->instance,
+	    ha->init_cb->node_name[0],
+	    ha->init_cb->node_name[1],
+	    ha->init_cb->node_name[2],
+	    ha->init_cb->node_name[3],
+	    ha->init_cb->node_name[4],
+	    ha->init_cb->node_name[5],
+	    ha->init_cb->node_name[6],
+	    ha->init_cb->node_name[7]);
+
+	/* display the port name for adapter */
+	copy_info(&info,
+	    "scsi-qla%d-adapter-port="
+	    "%02x%02x%02x%02x%02x%02x%02x%02x;\n",
+	    (int)ha->instance,
+	    ha->init_cb->port_name[0],
+	    ha->init_cb->port_name[1],
+	    ha->init_cb->port_name[2],
+	    ha->init_cb->port_name[3],
+	    ha->init_cb->port_name[4],
+	    ha->init_cb->port_name[5],
+	    ha->init_cb->port_name[6],
+	    ha->init_cb->port_name[7]);
+
+	/* Print out device port names */
+	for (i = 0; i < MAX_TARGETS; i++) {
+		if ((tq = TGT_Q(ha, i)) == NULL)
+			continue;
+
+		copy_info(&info,
+			  "scsi-qla%d-target-%d="
+			  "%02x%02x%02x%02x%02x%02x%02x%02x;\n",
+			  (int)ha->instance, i,
+			  tq->port_name[0], tq->port_name[1],
+			  tq->port_name[2], tq->port_name[3],
+			  tq->port_name[4], tq->port_name[5],
+			  tq->port_name[6], tq->port_name[7]);
+	} /* 2.25 node/port display to proc */
+
+	copy_info(&info, "\nSCSI LUN Information:\n");
+	copy_info(&info,
+	    "(Id:Lun)  * - indicates lun is not registered with the OS.\n");
+
+	/* scan for all equipment stats */
+	for (t = 0; t < MAX_FIBRE_DEVICES; t++) {
+		/* scan all luns */
+		for (l = 0; l < ha->max_luns; l++) {
+			up = (os_lun_t *) GET_LU_Q(ha, t, l);
+
+			if (up == NULL) {
+				continue;
+			}
+			if (up->fclun == NULL) {
+				continue;
+			}
+
+			copy_info(&info,
+			    "(%2d:%2d): Total reqs %ld,",
+			    t,l,up->io_cnt);
+
+			copy_info(&info,
+			    " Pending reqs %ld,",
+			    up->out_cnt);
+
+			if (up->io_cnt < 4) {
+				copy_info(&info,
+				    " flags 0x%x*,",
+				    (int)up->q_flag);
+			} else {
+				copy_info(&info,
+				    " flags 0x%x,",
+				    (int)up->q_flag);
+			}
+
+			copy_info(&info, 
+			    " %ld:%d:%02x %02x",
+			    up->fclun->fcport->ha->instance,
+			    up->fclun->fcport->cur_path,
+			    up->fclun->fcport->loop_id,
+			    up->fclun->device_type);
+
+			copy_info(&info, "\n");
+
+			if (info.pos >= info.offset + info.length) {
+				/* No need to continue */
+				goto profile_stop;
+			}
+		}
+
+		if (info.pos >= info.offset + info.length) {
+			/* No need to continue */
+			break;
+		}
+	}
+
+profile_stop:
+
+	retval = info.pos > info.offset ? info.pos - info.offset : 0;
+
+	DEBUG3(printk(KERN_INFO 
+	    "Exiting proc_info: info.pos=%d, offset=0x%lx, "
+	    "length=0x%x\n", info.pos, offset, length);)
+
+	return (retval);
+}
+
+/*
+* qla2x00_display_fc_names
+*      This routine will the node names of the different devices found
+*      after port inquiry.
+*
+* Input:
+*      cmd = SCSI command structure
+*
+* Returns:
+*      None.
+*/
+static void
+qla2x00_display_fc_names(scsi_qla_host_t *ha) 
+{
+	uint16_t	tgt;
+	os_tgt_t	*tq;
+
+	/* Display the node name for adapter */
+	qla_printk(KERN_INFO, ha,
+	    "scsi-qla%d-adapter-node=%02x%02x%02x%02x%02x%02x%02x%02x\\;\n",
+	    (int)ha->instance,
+	    ha->init_cb->node_name[0],
+	    ha->init_cb->node_name[1],
+	    ha->init_cb->node_name[2],
+	    ha->init_cb->node_name[3],
+	    ha->init_cb->node_name[4],
+	    ha->init_cb->node_name[5],
+	    ha->init_cb->node_name[6],
+	    ha->init_cb->node_name[7]);
+
+	/* display the port name for adapter */
+	qla_printk(KERN_INFO, ha,
+	    "scsi-qla%d-adapter-port=%02x%02x%02x%02x%02x%02x%02x%02x\\;\n",
+	    (int)ha->instance,
+	    ha->init_cb->port_name[0],
+	    ha->init_cb->port_name[1],
+	    ha->init_cb->port_name[2],
+	    ha->init_cb->port_name[3],
+	    ha->init_cb->port_name[4],
+	    ha->init_cb->port_name[5],
+	    ha->init_cb->port_name[6],
+	    ha->init_cb->port_name[7]);
+
+	/* Print out device port names */
+	for (tgt = 0; tgt < MAX_TARGETS; tgt++) {
+		if ((tq = ha->otgt[tgt]) == NULL)
+			continue;
+
+		if (tq->fcport == NULL)
+			continue;
+
+		switch (ha->binding_type) {
+			case BIND_BY_PORT_NAME:
+				qla_printk(KERN_INFO, ha,
+				    "scsi-qla%d-tgt-%d-di-0-port="
+				    "%02x%02x%02x%02x%02x%02x%02x%02x\\;\n",
+				    (int)ha->instance, 
+				    tgt,
+				    tq->port_name[0], 
+				    tq->port_name[1],
+				    tq->port_name[2], 
+				    tq->port_name[3],
+				    tq->port_name[4], 
+				    tq->port_name[5],
+				    tq->port_name[6], 
+				    tq->port_name[7]);
+
+				break;
+
+			case BIND_BY_PORT_ID:
+				qla_printk(KERN_INFO, ha,
+				    "scsi-qla%d-tgt-%d-di-0-pid="
+				    "%02x%02x%02x\\;\n",
+				    (int)ha->instance,
+				    tgt,
+				    tq->d_id.b.domain,
+				    tq->d_id.b.area,
+				    tq->d_id.b.al_pa);
+				break;
+		}
+
+#if VSA
+		qla_printk(KERN_INFO, ha,
+		    "scsi-qla%d-target-%d-vsa=01;\n", (int)ha->instance, tgt);
+#endif
+	}
+}
+
+/*
+ *  qla2x00_suspend_lun
+ *	Suspend lun and start port down timer
+ *
+ * Input:
+ *	ha = visable adapter block pointer.
+ *  lq = lun queue
+ *  cp = Scsi command pointer 
+ *  time = time in seconds
+ *  count = number of times to let time expire
+ *  delay_lun = non-zero, if lun should be delayed rather than suspended
+ *
+ * Return:
+ *     QLA_SUCCESS  -- suspended lun 
+ *     QLA_FUNCTION_FAILED  -- Didn't suspend lun
+ *
+ * Context:
+ *	Interrupt context.
+ */
+int
+__qla2x00_suspend_lun(scsi_qla_host_t *ha,
+		os_lun_t *lq, int time, int count, int delay_lun)
+{
+	int	rval;
+	srb_t *sp;
+	struct list_head *list, *temp;
+	unsigned long flags;
+
+	rval = QLA_SUCCESS;
+
+	/* if the lun_q is already suspended then don't do it again */
+	if (lq->q_state == LUN_STATE_READY ||lq->q_state == LUN_STATE_RUN) {
+
+		spin_lock_irqsave(&lq->q_lock, flags);
+		if (lq->q_state == LUN_STATE_READY) {
+			lq->q_max = count;
+			lq->q_count = 0;
+		}
+		/* Set the suspend time usually 6 secs */
+		atomic_set(&lq->q_timer, time);
+
+		/* now suspend the lun */
+		lq->q_state = LUN_STATE_WAIT;
+
+		if (delay_lun) {
+			set_bit(LUN_EXEC_DELAYED, &lq->q_flag);
+			DEBUG(printk(KERN_INFO
+			    "scsi(%ld): Delay lun execution for %d secs, "
+			    "count=%d, max count=%d, state=%d\n",
+			    ha->host_no,
+			    time,
+			    lq->q_count, lq->q_max, lq->q_state));
+		} else {
+			DEBUG(printk(KERN_INFO
+			    "scsi(%ld): Suspend lun for %d secs, count=%d, "
+			    "max count=%d, state=%d\n",
+			    ha->host_no,
+			    time,
+			    lq->q_count, lq->q_max, lq->q_state));
+		}
+		spin_unlock_irqrestore(&lq->q_lock, flags);
+
+		/*
+		 * Remove all pending commands from request queue and  put them
+		 * in the scsi_retry queue.
+		 */
+		spin_lock_irqsave(&ha->list_lock, flags);
+		list_for_each_safe(list, temp, &ha->pending_queue) {
+			sp = list_entry(list, srb_t, list);
+			if (sp->lun_queue != lq)
+				continue;
+
+			__del_from_pending_queue(ha, sp);
+
+			if (sp->cmd->allowed < count)
+				sp->cmd->allowed = count;
+			__add_to_scsi_retry_queue(ha, sp);
+
+		} /* list_for_each_safe */
+		spin_unlock_irqrestore(&ha->list_lock, flags);
+		rval = QLA_SUCCESS;
+	} else {
+		rval = QLA_FUNCTION_FAILED;
+	}
+
+	return (rval);
+}
+
+/*
+ * qla2x00_mark_device_lost Updates fcport state when device goes offline.
+ *
+ * Input: ha = adapter block pointer.  fcport = port structure pointer.
+ *
+ * Return: None.
+ *
+ * Context:
+ */
+void qla2x00_mark_device_lost(scsi_qla_host_t *ha, fc_port_t *fcport,
+    int do_login)
+{
+	/* 
+	 * We may need to retry the login, so don't change the state of the
+	 * port but do the retries.
+	 */
+	if (atomic_read(&fcport->state) != FCS_DEVICE_DEAD)
+		atomic_set(&fcport->state, FCS_DEVICE_LOST);
+
+	if (!do_login)
+		return;
+
+	if (fcport->login_retry == 0) {
+		fcport->login_retry = ha->login_retry_count;
+		set_bit(RELOGIN_NEEDED, &ha->dpc_flags);
+
+		DEBUG(printk("scsi(%ld): Port login retry: "
+		    "%02x%02x%02x%02x%02x%02x%02x%02x, "
+		    "id = 0x%04x retry cnt=%d\n",
+		    ha->host_no,
+		    fcport->port_name[0],
+		    fcport->port_name[1],
+		    fcport->port_name[2],
+		    fcport->port_name[3],
+		    fcport->port_name[4],
+		    fcport->port_name[5],
+		    fcport->port_name[6],
+		    fcport->port_name[7],
+		    fcport->loop_id,
+		    fcport->login_retry));
+	}
+}
+
+/*
+ * qla2x00_mark_all_devices_lost
+ *	Updates fcport state when device goes offline.
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *	fcport = port structure pointer.
+ *
+ * Return:
+ *	None.
+ *
+ * Context:
+ */
+void
+qla2x00_mark_all_devices_lost(scsi_qla_host_t *ha) 
+{
+	struct list_head	*fcpl;
+	fc_port_t		*fcport;
+
+	list_for_each(fcpl, &ha->fcports) {
+		fcport = list_entry(fcpl, fc_port_t, list);
+
+		/*
+		 * No point in marking the device as lost, if the device is
+		 * already DEAD.
+		 */
+		if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD)
+			continue;
+
+		atomic_set(&fcport->state, FCS_DEVICE_LOST);
+	}
+}
+
+/*
+* qla2x00_mem_alloc
+*      Allocates adapter memory.
+*
+* Returns:
+*      0  = success.
+*      1  = failure.
+*/
+static uint8_t
+qla2x00_mem_alloc(scsi_qla_host_t *ha)
+{
+	uint8_t   status = 1;
+	uint8_t   i;
+	int	retry= 10;
+	mbx_cmdq_t	*ptmp;
+	mbx_cmdq_t	*tmp_q_head;
+	mbx_cmdq_t	*tmp_q_tail;
+
+	ENTER(__func__);
+
+	do {
+		/*
+		 * This will loop only once if everything goes well, else some
+		 * number of retries will be performed to get around a kernel
+		 * bug where available mem is not allocated until after a
+		 * little delay and a retry.
+		 */
+		ha->request_ring = pci_alloc_consistent(ha->pdev,
+		    ((REQUEST_ENTRY_CNT + 1) * (sizeof(request_t))),
+		    &ha->request_dma);
+		if (ha->request_ring == NULL) {
+			qla_printk(KERN_WARNING, ha,
+			    "Memory Allocation failed - request_ring\n");
+
+			qla2x00_mem_free(ha);
+			set_current_state(TASK_INTERRUPTIBLE);
+			schedule_timeout(HZ/10);
+
+			continue;
+		}
+
+		ha->response_ring = pci_alloc_consistent(ha->pdev,
+		    ((ha->response_q_length + 1) * (sizeof(response_t))),
+		    &ha->response_dma);
+		if (ha->response_ring == NULL) {
+			qla_printk(KERN_WARNING, ha,
+			    "Memory Allocation failed - response_ring\n");
+
+			qla2x00_mem_free(ha);
+			set_current_state(TASK_INTERRUPTIBLE);
+			schedule_timeout(HZ/10);
+
+			continue;
+		}
+
+		/* get consistent memory allocated for init control block */
+		ha->init_cb = pci_alloc_consistent(ha->pdev,
+		    sizeof(init_cb_t), &ha->init_cb_dma);
+		if (ha->init_cb == NULL) {
+			qla_printk(KERN_WARNING, ha,
+			    "Memory Allocation failed - init_cb\n");
+
+			qla2x00_mem_free(ha);
+			set_current_state(TASK_INTERRUPTIBLE);
+			schedule_timeout(HZ/10);
+
+			continue;
+		}
+		memset(ha->init_cb, 0, sizeof(init_cb_t));
+
+		/* Allocate ioctl related memory. */
+		if (qla2x00_alloc_ioctl_mem(ha)) {
+			qla_printk(KERN_WARNING, ha,
+			    "Memory Allocation failed - ioctl_mem\n");
+
+			qla2x00_mem_free(ha);
+			set_current_state(TASK_INTERRUPTIBLE);
+			schedule_timeout(HZ/10);
+
+			continue;
+		}
+
+		if (qla2x00_allocate_sp_pool(ha)) {
+			qla_printk(KERN_WARNING, ha,
+			    "Memory Allocation failed - "
+			    "qla2x00_allocate_sp_pool()\n");
+
+			qla2x00_mem_free(ha);
+			set_current_state(TASK_INTERRUPTIBLE);
+			schedule_timeout(HZ/10);
+
+			continue;
+		}
+
+		/*
+		 * Allocate an initial list of mailbox semaphore queue to be
+		 * used for serialization of the mailbox commands.
+		 */
+		tmp_q_head = kmalloc(sizeof(mbx_cmdq_t), GFP_KERNEL);
+		if (tmp_q_head == NULL) {
+			/* error */
+			qla_printk(KERN_WARNING, ha,
+			    "Memory Allocation failed - mbx_cmd_q");
+
+			qla2x00_mem_free(ha);
+			set_current_state(TASK_INTERRUPTIBLE);
+			schedule_timeout(HZ/10);
+
+			continue;
+		}
+		memset(tmp_q_head, 0, sizeof(mbx_cmdq_t));
+		ha->mbx_sem_pool_head = tmp_q_head;
+		tmp_q_tail = tmp_q_head;
+
+		/* Now try to allocate more */
+		for (i = 1; i < MBQ_INIT_LEN; i++) {
+			ptmp = kmalloc(sizeof(mbx_cmdq_t), GFP_KERNEL);
+			if (ptmp == NULL) {
+				/*
+				 * Error. Just exit. If more is needed later
+				 * they will be allocated at that time.
+				 */
+				break;
+			}
+			memset(ptmp, 0, sizeof(mbx_cmdq_t));
+			tmp_q_tail->pnext = ptmp;
+			tmp_q_tail = ptmp;
+		}
+		ha->mbx_sem_pool_tail = tmp_q_tail;
+
+		/* Get consistent memory allocated for MS IOCB */
+		ha->ms_iocb = pci_alloc_consistent(ha->pdev,
+		    sizeof(ms_iocb_entry_t), &ha->ms_iocb_dma);
+		if (ha->ms_iocb == NULL) {
+			/* error */
+			qla_printk(KERN_WARNING, ha,
+			    "Memory Allocation failed - ms_iocb\n");
+
+			qla2x00_mem_free(ha);
+			set_current_state(TASK_INTERRUPTIBLE);
+			schedule_timeout(HZ/10);
+
+			continue;
+		}
+		memset(ha->ms_iocb, 0, sizeof(ms_iocb_entry_t));
+
+		/* Get consistent memory allocated for CT SNS commands */
+		ha->ct_sns = pci_alloc_consistent(ha->pdev,
+		    sizeof(struct ct_sns_pkt), &ha->ct_sns_dma);
+		if (ha->ct_sns == NULL) {
+			/* error */
+			qla_printk(KERN_WARNING, ha,
+			    "Memory Allocation failed - ct_sns\n");
+
+			qla2x00_mem_free(ha);
+			set_current_state(TASK_INTERRUPTIBLE);
+			schedule_timeout(HZ/10);
+
+			continue;
+		}
+		memset(ha->ct_sns, 0, sizeof(struct ct_sns_pkt));
+
+		/* Get consistent memory allocated for Get Port Database cmd */
+		ha->iodesc_pd = pci_alloc_consistent(ha->pdev,
+		    PORT_DATABASE_SIZE, &ha->iodesc_pd_dma);
+		if (ha->iodesc_pd == NULL) {
+			/* error */
+			qla_printk(KERN_WARNING, ha,
+			    "Memory Allocation failed - iodesc_pd\n");
+
+			qla2x00_mem_free(ha);
+			set_current_state(TASK_INTERRUPTIBLE);
+			schedule_timeout(HZ/10);
+
+			continue;
+		}
+		memset(ha->iodesc_pd, 0, PORT_DATABASE_SIZE);
+
+		/* Done all allocations without any error. */
+		status = 0;
+
+	} while (retry-- && status != 0);
+
+	if (status) {
+		printk(KERN_WARNING
+			"%s(): **** FAILED ****\n", __func__);
+	}
+
+	LEAVE(__func__);
+
+	return(status);
+}
+
+/*
+* qla2x00_mem_free
+*      Frees all adapter allocated memory.
+*
+* Input:
+*      ha = adapter block pointer.
+*/
+static void
+qla2x00_mem_free(scsi_qla_host_t *ha)
+{
+	uint32_t	t;
+	struct list_head	*fcpl, *fcptemp;
+	fc_port_t	*fcport;
+	struct list_head	*fcll, *fcltemp;
+	fc_lun_t	*fclun;
+	mbx_cmdq_t	*ptmp;
+	mbx_cmdq_t	*tmp_q_head;
+	unsigned long	wtime;/* max wait time if mbx cmd is busy. */
+
+	ENTER(__func__);
+
+	if (ha == NULL) {
+		/* error */
+		DEBUG2(printk("%s(): ERROR invalid ha pointer.\n", __func__));
+		return;
+	}
+
+	/* Free the target queues */
+	for (t = 0; t < MAX_TARGETS; t++) {
+		qla2x00_tgt_free(ha, t);
+	}
+
+	/* Make sure all other threads are stopped. */
+	wtime = 60 * HZ;
+	while ((ha->dpc_wait != NULL || ha->mbx_q_head != NULL) && wtime) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		wtime = schedule_timeout(wtime);
+	}
+
+	/* Now free the mbx sem pool */
+	tmp_q_head = ha->mbx_sem_pool_head;
+	while (tmp_q_head != NULL) {
+		ptmp = tmp_q_head->pnext;
+		kfree(tmp_q_head);
+		tmp_q_head = ptmp;
+	}
+	ha->mbx_sem_pool_head = NULL;
+
+	/* free ioctl memory */
+	qla2x00_free_ioctl_mem(ha);
+
+	/* free sp pool */
+	qla2x00_free_sp_pool(ha);
+
+	if (ha->iodesc_pd) {
+		pci_free_consistent(ha->pdev, PORT_DATABASE_SIZE,
+		    ha->iodesc_pd, ha->iodesc_pd_dma);
+	}
+	if (ha->ct_sns) {
+		pci_free_consistent(ha->pdev,
+		    sizeof(struct ct_sns_pkt), ha->ct_sns, ha->ct_sns_dma);
+	}
+	if (ha->ms_iocb) {
+		pci_free_consistent(ha->pdev,
+		    sizeof(ms_iocb_entry_t), ha->ms_iocb, ha->ms_iocb_dma);
+	}
+
+	if (ha->init_cb) {
+		pci_free_consistent(ha->pdev,
+		    sizeof(init_cb_t), ha->init_cb, ha->init_cb_dma);
+	}
+
+	if (ha->request_ring) {
+		pci_free_consistent(ha->pdev,
+		    ((REQUEST_ENTRY_CNT + 1) * (sizeof(request_t))),
+		    ha->request_ring, ha->request_dma);
+	}
+
+	if (ha->response_ring) {
+		pci_free_consistent(ha->pdev,
+		    ((ha->response_q_length + 1) * (sizeof(response_t))),
+		    ha->response_ring, ha->response_dma);
+	}
+
+	ha->iodesc_pd = NULL;
+	ha->iodesc_pd_dma = 0;
+	ha->ct_sns = NULL;
+	ha->ms_iocb = NULL;
+
+	ha->init_cb = NULL;
+	ha->request_ring = NULL;
+	ha->request_dma = 0;
+	ha->response_ring = NULL;
+	ha->response_dma = 0;
+
+	list_for_each_safe(fcpl, fcptemp, &ha->fcports) {
+		fcport = list_entry(fcpl, fc_port_t, list);
+
+		/* fc luns */
+		list_for_each_safe(fcll, fcltemp, &fcport->fcluns) {
+			fclun = list_entry(fcll, fc_lun_t, list);
+
+			list_del_init(&fclun->list);
+			kfree(fclun);
+		}
+
+		/* fc ports */
+		list_del_init(&fcport->list);
+		kfree(fcport);
+	}
+	INIT_LIST_HEAD(&ha->fcports);
+
+	if (ha->fw_dump) {
+		free_pages((unsigned long)ha->fw_dump, ha->fw_dump_order);
+		ha->fw_dump = NULL;
+	}
+
+	if (ha->fw_dump_buffer) {
+		vfree(ha->fw_dump_buffer);
+		ha->fw_dump_reading = 0;
+		ha->fw_dump_buffer = NULL;
+	}
+
+	LEAVE(__func__);
+}
+
+/*
+ * qla2x00_allocate_sp_pool
+ * 	 This routine is called during initialization to allocate
+ *  	 memory for local srb_t.
+ *
+ * Input:
+ *	 ha   = adapter block pointer.
+ *
+ * Context:
+ *      Kernel context.
+ * 
+ * Note: Sets the ref_count for non Null sp to one.
+ */
+int
+qla2x00_allocate_sp_pool(scsi_qla_host_t *ha) 
+{
+	int      rval;
+
+	rval = QLA_SUCCESS;
+	ha->srb_mempool = mempool_create(SRB_MIN_REQ, mempool_alloc_slab,
+	    mempool_free_slab, srb_cachep);
+	if (ha->srb_mempool == NULL) {
+		qla_printk(KERN_INFO, ha, "Unable to allocate SRB mempool.\n");
+		rval = QLA_FUNCTION_FAILED;
+	}
+	return (rval);
+}
+
+/*
+ *  This routine frees all adapter allocated memory.
+ *  
+ */
+void
+qla2x00_free_sp_pool( scsi_qla_host_t *ha) 
+{
+	if (ha->srb_mempool) {
+		mempool_destroy(ha->srb_mempool);
+		ha->srb_mempool = NULL;
+	}
+}
+
+/**************************************************************************
+* qla2x00_do_dpc
+*   This kernel thread is a task that is schedule by the interrupt handler
+*   to perform the background processing for interrupts.
+*
+* Notes:
+* This task always run in the context of a kernel thread.  It
+* is kick-off by the driver's detect code and starts up
+* up one per adapter. It immediately goes to sleep and waits for
+* some fibre event.  When either the interrupt handler or
+* the timer routine detects a event it will one of the task
+* bits then wake us up.
+**************************************************************************/
+static int
+qla2x00_do_dpc(void *data)
+{
+	DECLARE_MUTEX_LOCKED(sem);
+	scsi_qla_host_t *ha;
+	struct list_head *fcpl;
+	fc_port_t	*fcport;
+	os_lun_t        *q;
+	srb_t           *sp;
+	uint8_t		status;
+	unsigned long	flags = 0;
+	struct list_head *list, *templist;
+	int	dead_cnt, online_cnt;
+	uint16_t	next_loopid;
+
+	ha = (scsi_qla_host_t *)data;
+
+	lock_kernel();
+
+	daemonize("%s_dpc", ha->host_str);
+	allow_signal(SIGHUP);
+
+	ha->dpc_wait = &sem;
+
+	set_user_nice(current, -20);
+
+	unlock_kernel();
+
+	complete(&ha->dpc_inited);
+
+	while (1) {
+		DEBUG3(printk("qla2x00: DPC handler sleeping\n"));
+
+		if (down_interruptible(&sem))
+			break;
+
+		if (ha->dpc_should_die)
+			break;
+
+		if (!list_empty(&ha->done_queue))
+			qla2x00_done(ha);
+
+		DEBUG3(printk("qla2x00: DPC handler waking up\n"));
+
+		/* Initialization not yet finished. Don't do anything yet. */
+		if (!ha->flags.init_done || ha->dpc_active)
+			continue;
+
+		DEBUG3(printk("scsi(%ld): DPC handler\n", ha->host_no));
+
+		ha->dpc_active = 1;
+
+		/* Process commands in retry queue */
+		if (test_and_clear_bit(PORT_RESTART_NEEDED, &ha->dpc_flags)) {
+			DEBUG(printk("scsi(%ld): DPC checking retry_q. "
+			    "total=%d\n",
+			    ha->host_no, ha->retry_q_cnt));
+
+			spin_lock_irqsave(&ha->list_lock, flags);
+			dead_cnt = online_cnt = 0;
+			list_for_each_safe(list, templist, &ha->retry_queue) {
+				sp = list_entry(list, srb_t, list);
+				q = sp->lun_queue;
+				DEBUG3(printk("scsi(%ld): pid=%ld sp=%p, "
+				    "spflags=0x%x, q_flag= 0x%lx\n",
+				    ha->host_no, sp->cmd->serial_number, sp,
+				    sp->flags, q->q_flag));
+
+				if (q == NULL)
+					continue;
+				fcport = q->fclun->fcport;
+
+				if (atomic_read(&fcport->state) ==
+				    FCS_DEVICE_DEAD ||
+				    atomic_read(&ha->loop_state) == LOOP_DEAD) {
+
+					__del_from_retry_queue(ha, sp);
+					sp->cmd->result = DID_NO_CONNECT << 16;
+					sp->cmd->host_scribble =
+					    (unsigned char *) NULL;
+					__add_to_done_queue(ha, sp);
+					dead_cnt++;
+				} else if (atomic_read(&fcport->state) !=
+				    FCS_DEVICE_LOST) {
+
+					__del_from_retry_queue(ha, sp);
+					sp->cmd->result = DID_BUS_BUSY << 16;
+					sp->cmd->host_scribble =
+					    (unsigned char *) NULL;
+					__add_to_done_queue(ha, sp);
+					online_cnt++;
+				}
+			} /* list_for_each_safe() */
+			spin_unlock_irqrestore(&ha->list_lock, flags);
+
+			DEBUG(printk("scsi(%ld): done processing retry queue "
+			    "- dead=%d, online=%d\n ",
+			    ha->host_no, dead_cnt, online_cnt));
+		}
+
+		/* Process commands in scsi retry queue */
+		if (test_and_clear_bit(SCSI_RESTART_NEEDED, &ha->dpc_flags)) {
+			/*
+			 * Any requests we want to delay for some period is put
+			 * in the scsi retry queue with a delay added. The
+			 * timer will schedule a "scsi_restart_needed" every 
+			 * second as long as there are requests in the scsi
+			 * queue. 
+			 */
+			DEBUG(printk("scsi(%ld): DPC checking scsi "
+			    "retry_q.total=%d\n",
+			    ha->host_no, ha->scsi_retry_q_cnt));
+
+			online_cnt = 0;
+			spin_lock_irqsave(&ha->list_lock, flags);
+			list_for_each_safe(list, templist,
+			    &ha->scsi_retry_queue) {
+
+				sp = list_entry(list, srb_t, list);
+				q = sp->lun_queue;
+
+				DEBUG3(printk("scsi(%ld): scsi_retry_q: "
+				    "pid=%ld sp=%p, spflags=0x%x, "
+				    "q_flag= 0x%lx,q_state=%d\n",
+				    ha->host_no, sp->cmd->serial_number,
+				    sp, sp->flags, q->q_flag, q->q_state));
+
+				/* Was this lun suspended */
+				if (q->q_state != LUN_STATE_WAIT) {
+					online_cnt++;
+					__del_from_scsi_retry_queue(ha, sp);
+					__add_to_retry_queue(ha,sp);
+				}
+
+				/* Was this command suspended for N secs */
+				if (sp->delay != 0) {
+					sp->delay--;
+					if (sp->delay == 0) {
+						online_cnt++;
+						__del_from_scsi_retry_queue(
+						    ha, sp);
+						__add_to_retry_queue(ha,sp);
+					}
+				}
+			}
+			spin_unlock_irqrestore(&ha->list_lock, flags);
+
+			DEBUG(if (online_cnt > 0))
+			DEBUG(printk("scsi(%ld): dpc() found scsi reqs to "
+			    "restart= %d\n",
+			    ha->host_no, online_cnt));
+		}
+
+		if (ha->flags.mbox_busy) {
+			if (!list_empty(&ha->done_queue))
+				qla2x00_done(ha);
+
+			ha->dpc_active = 0;
+			continue;
+		}
+
+		if (test_and_clear_bit(ISP_ABORT_NEEDED, &ha->dpc_flags)) {
+
+			DEBUG(printk("scsi(%ld): dpc: sched "
+			    "qla2x00_abort_isp ha = %p\n",
+			    ha->host_no, ha));
+			if (!(test_and_set_bit(ABORT_ISP_ACTIVE,
+			    &ha->dpc_flags))) {
+
+				if (qla2x00_abort_isp(ha)) {
+					/* failed. retry later */
+					set_bit(ISP_ABORT_NEEDED,
+					    &ha->dpc_flags);
+				}
+				clear_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags);
+			}
+			DEBUG(printk("scsi(%ld): dpc: qla2x00_abort_isp end\n",
+			    ha->host_no));
+		}
+
+		if (test_and_clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags) &&
+		    (!(test_and_set_bit(RESET_ACTIVE, &ha->dpc_flags)))) {
+
+			DEBUG(printk("scsi(%ld): qla2x00_reset_marker()\n",
+			    ha->host_no));
+
+			qla2x00_rst_aen(ha);
+			clear_bit(RESET_ACTIVE, &ha->dpc_flags);
+		}
+
+		/* Retry each device up to login retry count */
+		if ((test_and_clear_bit(RELOGIN_NEEDED, &ha->dpc_flags)) &&
+		    !test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) &&
+		    atomic_read(&ha->loop_state) != LOOP_DOWN) {
+
+			DEBUG(printk("scsi(%ld): qla2x00_port_login()\n",
+			    ha->host_no));
+
+			next_loopid = 0;
+			list_for_each(fcpl, &ha->fcports) {
+				fcport = list_entry(fcpl, fc_port_t, list);
+				
+				/*
+				 * If the port is not ONLINE then try to login
+				 * to it if we haven't run out of retries.
+				 */
+				if (atomic_read(&fcport->state) != FCS_ONLINE &&
+				    fcport->login_retry) {
+
+					fcport->login_retry--;
+					if (fcport->flags & FCF_FABRIC_DEVICE)
+						status = qla2x00_fabric_login(
+						    ha, fcport, &next_loopid);
+					else 	
+						status =
+						    qla2x00_local_device_login(
+							ha, fcport->loop_id);
+
+					if (status == QLA_SUCCESS) {
+						fcport->old_loop_id = fcport->loop_id;
+
+						DEBUG(printk("scsi(%ld): port login OK: logged in ID 0x%x\n",
+						    ha->host_no, fcport->loop_id));
+						
+						fcport->port_login_retry_count =
+						    ha->port_down_retry_count * PORT_RETRY_TIME;
+						atomic_set(&fcport->state, FCS_ONLINE);
+						atomic_set(&fcport->port_down_timer,
+						    ha->port_down_retry_count * PORT_RETRY_TIME);
+
+						fcport->login_retry = 0;
+					} else if (status == 1) {
+						set_bit(RELOGIN_NEEDED, &ha->dpc_flags);
+						/* retry the login again */
+						DEBUG(printk("scsi(%ld): Retrying %d login again loop_id 0x%x\n",
+						    ha->host_no,
+						    fcport->login_retry, fcport->loop_id));
+					} else {
+						fcport->login_retry = 0;
+					}
+				}
+				if (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags))
+					break;
+			}
+			DEBUG(printk("scsi(%ld): qla2x00_port_login - end\n",
+			    ha->host_no));
+		}
+
+		if ((test_bit(LOGIN_RETRY_NEEDED, &ha->dpc_flags)) &&
+		    atomic_read(&ha->loop_state) != LOOP_DOWN) {
+
+			clear_bit(LOGIN_RETRY_NEEDED, &ha->dpc_flags);
+			DEBUG(printk("scsi(%ld): qla2x00_login_retry()\n",
+			    ha->host_no));
+				
+			set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags);
+
+			DEBUG(printk("scsi(%ld): qla2x00_login_retry - end\n",
+			    ha->host_no));
+		}
+
+		if (test_and_clear_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) {
+
+			DEBUG(printk("scsi(%ld): qla2x00_loop_resync()\n",
+			    ha->host_no));
+
+			if (!(test_and_set_bit(LOOP_RESYNC_ACTIVE,
+			    &ha->dpc_flags))) {
+
+				qla2x00_loop_resync(ha);
+
+				clear_bit(LOOP_RESYNC_ACTIVE, &ha->dpc_flags);
+			}
+
+			DEBUG(printk("scsi(%ld): qla2x00_loop_resync - end\n",
+			    ha->host_no));
+		}
+
+		if (test_bit(RESTART_QUEUES_NEEDED, &ha->dpc_flags)) {
+			DEBUG(printk("scsi(%ld): qla2x00_restart_queues()\n",
+			    ha->host_no));
+
+			qla2x00_restart_queues(ha,FALSE);
+
+			DEBUG(printk("scsi(%ld): qla2x00_restart_queues - end\n",
+			    ha->host_no));
+		}
+
+		if (test_bit(ABORT_QUEUES_NEEDED, &ha->dpc_flags)) {
+
+			DEBUG(printk("scsi(%ld): qla2x00_abort_queues()\n",
+			    ha->host_no));
+				
+			qla2x00_abort_queues(ha, FALSE);
+
+			DEBUG(printk("scsi(%ld): qla2x00_abort_queues - end\n",
+			    ha->host_no));
+		}
+
+		if (test_and_clear_bit(FCPORT_RESCAN_NEEDED, &ha->dpc_flags)) {
+
+			DEBUG(printk("scsi(%ld): Rescan flagged fcports...\n",
+			    ha->host_no));
+
+			qla2x00_rescan_fcports(ha);
+
+			DEBUG(printk("scsi(%ld): Rescan flagged fcports..."
+			    "end.\n",
+			    ha->host_no));
+		}
+
+
+		if (!ha->interrupts_on)
+			qla2x00_enable_intrs(ha);
+
+		if (!list_empty(&ha->done_queue))
+			qla2x00_done(ha);
+
+		ha->dpc_active = 0;
+	} /* End of while(1) */
+
+	DEBUG(printk("scsi(%ld): DPC handler exiting\n", ha->host_no));
+
+	/*
+	 * Make sure that nobody tries to wake us up again.
+	 */
+	ha->dpc_wait = NULL;
+	ha->dpc_active = 0;
+
+	complete_and_exit(&ha->dpc_exited, 0);
+}
+
+/*
+ *  qla2x00_abort_queues
+ *	Abort all commands on queues on device
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *
+ * Context:
+ *	Interrupt context.
+ */
+void
+qla2x00_abort_queues(scsi_qla_host_t *ha, uint8_t doneqflg) 
+{
+
+	srb_t       *sp;
+	struct list_head *list, *temp;
+	unsigned long flags;
+
+	ENTER(__func__);
+
+	clear_bit(ABORT_QUEUES_NEEDED, &ha->dpc_flags);
+
+	/* Return all commands device queues. */
+	spin_lock_irqsave(&ha->list_lock,flags);
+	list_for_each_safe(list, temp, &ha->pending_queue) {
+		sp = list_entry(list, srb_t, list);
+
+		if (sp->flags & SRB_ABORTED)
+			continue;
+
+		/* Remove srb from LUN queue. */
+		__del_from_pending_queue(ha, sp);
+
+		/* Set ending status. */
+		sp->cmd->result = DID_BUS_BUSY << 16;
+
+		__add_to_done_queue(ha, sp);
+	}
+	spin_unlock_irqrestore(&ha->list_lock, flags);
+
+	LEAVE(__func__);
+}
+
+/*
+*  qla2x00_rst_aen
+*      Processes asynchronous reset.
+*
+* Input:
+*      ha  = adapter block pointer.
+*/
+static void
+qla2x00_rst_aen(scsi_qla_host_t *ha) 
+{
+	ENTER(__func__);
+
+	if (ha->flags.online && !ha->flags.reset_active &&
+	    !atomic_read(&ha->loop_down_timer) &&
+	    !(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags))) {
+
+		/* 10/15 ha->flags.reset_active = TRUE; */
+		do {
+			clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags);
+
+			/*
+			 * Issue marker command only when we are going to start
+			 * the I/O.
+			 */
+			ha->marker_needed = 1;
+		} while (!atomic_read(&ha->loop_down_timer) &&
+		    (test_bit(RESET_MARKER_NEEDED, &ha->dpc_flags)));
+
+		/* 10/15 ha->flags.reset_active = FALSE; */
+	}
+
+	LEAVE(__func__);
+}
+
+
+/*
+ * This routine will alloacte SP from the free queue
+ * input:
+ *        scsi_qla_host_t *
+ * output:
+ *        srb_t * or NULL
+ */
+srb_t *
+qla2x00_get_new_sp(scsi_qla_host_t *ha)
+{
+	srb_t *sp;
+
+	sp = mempool_alloc(ha->srb_mempool, GFP_KERNEL);
+	if (sp) {
+		atomic_set(&sp->ref_count, 1);
+	}
+	return (sp);
+}
+
+/**************************************************************************
+ * qla2x00_blink_led
+ *
+ * Description:
+ *   This function sets the colour of the LED while preserving the
+ *   unsued GPIO pins every sec.
+ *
+ * Input:
+ *       ha - Host adapter structure
+ *      
+ * Return:
+ * 	None
+ *
+ * Context: qla2x00_timer() Interrupt
+ ***************************************************************************/
+void
+qla2x00_blink_led(scsi_qla_host_t *ha)
+{
+	uint16_t	gpio_enable, gpio_data, led_color;
+	unsigned long	cpu_flags = 0;
+	device_reg_t	*reg = ha->iobase;
+
+	ENTER(__func__);
+
+	/* Save the Original GPIOE */ 
+	spin_lock_irqsave(&ha->hardware_lock, cpu_flags);
+	gpio_enable = RD_REG_WORD(&reg->gpioe);
+	gpio_data = RD_REG_WORD(&reg->gpiod);
+	spin_unlock_irqrestore(&ha->hardware_lock, cpu_flags);
+
+	DEBUG2(printk("%s Original data of gpio_enable_reg=0x%x"
+	    " gpio_data_reg=0x%x\n",
+	    __func__,gpio_enable,gpio_data));
+
+	if (ha->beacon_green_on){
+		led_color = GPIO_LED_GREEN_ON_AMBER_OFF;
+		ha->beacon_green_on = 0;
+	} else {
+		led_color = GPIO_LED_GREEN_OFF_AMBER_OFF;
+		ha->beacon_green_on = 1;
+	}
+
+	/* Set the modified gpio_enable values */
+	gpio_enable |= GPIO_LED_GREEN_ON_AMBER_OFF;
+
+	DEBUG2(printk("%s Before writing enable : gpio_enable_reg=0x%x"
+	    " gpio_data_reg=0x%x led_color=0x%x\n",
+	    __func__, gpio_enable, gpio_data, led_color));
+
+	spin_lock_irqsave(&ha->hardware_lock, cpu_flags);
+	WRT_REG_WORD(&reg->gpioe,gpio_enable);
+	spin_unlock_irqrestore(&ha->hardware_lock, cpu_flags);
+
+	/* Clear out the previously set LED colour */
+	gpio_data &= ~GPIO_LED_GREEN_ON_AMBER_OFF;
+
+	/* Set the new input LED colour to GPIOD */
+	gpio_data |= led_color;
+
+	DEBUG2(printk("%s Before writing data: gpio_enable_reg=0x%x"
+	    " gpio_data_reg=0x%x led_color=0x%x\n",
+	    __func__,gpio_enable,gpio_data,led_color));
+
+	/* Set the modified gpio_data values */
+	spin_lock_irqsave(&ha->hardware_lock, cpu_flags);
+	WRT_REG_WORD(&reg->gpiod,gpio_data);
+	spin_unlock_irqrestore(&ha->hardware_lock, cpu_flags);
+
+	LEAVE(__func__);
+}
+
+/**************************************************************************
+*   qla2x00_timer
+*
+* Description:
+*   One second timer
+*
+* Context: Interrupt
+***************************************************************************/
+static void
+qla2x00_timer(scsi_qla_host_t *ha)
+{
+	int		t,l;
+	unsigned long	cpu_flags = 0;
+	struct list_head	*fcpl;
+	fc_port_t	*fcport;
+	os_lun_t *lq;
+	os_tgt_t *tq;
+	int		start_dpc = 0;
+
+	/*
+	 * We try and restart any request in the retry queue every second.
+	 */
+	if (!list_empty(&ha->retry_queue)) {
+		set_bit(PORT_RESTART_NEEDED, &ha->dpc_flags);
+		start_dpc++;
+	}
+
+	/*
+	 * We try and restart any request in the scsi_retry queue every second.
+	 */
+	if (!list_empty(&ha->scsi_retry_queue)) {
+		set_bit(SCSI_RESTART_NEEDED, &ha->dpc_flags);
+		start_dpc++;
+	}
+
+	/* Check if beacon LED needs to be blinked */
+	if (IS_QLA23XX(ha) && ha->beacon_blink_led)
+		qla2x00_blink_led(ha);
+
+	/*
+	 * Ports - Port down timer.
+	 *
+	 * Whenever, a port is in the LOST state we start decrementing its port
+	 * down timer every second until it reaches zero. Once  it reaches zero
+	 * the port it marked DEAD. 
+	 */
+	t = 0;
+	list_for_each(fcpl, &ha->fcports) {
+		fcport = list_entry(fcpl, fc_port_t, list);
+
+		if (atomic_read(&fcport->state) == FCS_DEVICE_LOST) {
+
+			if (atomic_read(&fcport->port_down_timer) == 0)
+				continue;
+
+			if (atomic_dec_and_test(&fcport->port_down_timer) != 0) 
+				atomic_set(&fcport->state, FCS_DEVICE_DEAD);
+			
+			DEBUG(printk("scsi(%ld): fcport-%d - port retry count: "
+			    "%d remainning\n",
+			    ha->host_no,
+			    t, atomic_read(&fcport->port_down_timer)));
+		}
+		t++;
+	} /* End of for fcport  */
+
+	/*
+	 * LUNS - lun suspend timer.
+	 *
+	 * Whenever, a lun is suspended the timer starts decrementing its
+	 * suspend timer every second until it reaches zero. Once  it reaches
+	 * zero the lun retry count is decremented. 
+	 */
+
+	/*
+	 * FIXME(dg) - Need to convert this linear search of luns into a search
+	 * of a list of suspended luns.
+	 */
+	for (t = 0; t < ha->max_targets; t++) {
+		if ((tq = ha->otgt[t]) == NULL)
+			continue;
+
+		for (l = 0; l < ha->max_luns; l++) {
+			if ((lq = (os_lun_t *) tq->olun[l]) == NULL)
+				continue;
+
+			spin_lock_irqsave(&lq->q_lock, cpu_flags);
+			if (lq->q_state == LUN_STATE_WAIT &&
+				atomic_read(&lq->q_timer) != 0) {
+
+				if (atomic_dec_and_test(&lq->q_timer) != 0) {
+					/*
+					 * A delay should immediately
+					 * transition to a READY state
+					 */
+					if (test_and_clear_bit(LUN_EXEC_DELAYED,
+					    &lq->q_flag)) {
+						lq->q_state = LUN_STATE_READY;
+					}
+					else {
+						lq->q_count++;
+						if (lq->q_count == lq->q_max)
+							lq->q_state =
+							    LUN_STATE_TIMEOUT;
+						else
+							lq->q_state =
+							    LUN_STATE_RUN;
+					}
+				}
+				DEBUG3(printk("scsi(%ld): lun%d - timer %d, "
+				    "count=%d, max=%d, state=%d\n",
+				    ha->host_no,
+				    l,
+				    atomic_read(&lq->q_timer),
+				    lq->q_count, lq->q_max, lq->q_state));
+			}
+			spin_unlock_irqrestore(&lq->q_lock, cpu_flags);
+		} /* End of for luns  */
+	} /* End of for targets  */
+
+	/* Loop down handler. */
+	if (atomic_read(&ha->loop_down_timer) > 0 &&
+	    !(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags)) && ha->flags.online) {
+
+		/* dg 10/30 if (atomic_read(&ha->loop_down_timer) == LOOP_DOWN_TIME) { */
+		if (atomic_read(&ha->loop_down_timer) ==
+		    ha->loop_down_abort_time) {
+
+			DEBUG(printk("scsi(%ld): Loop Down - aborting the "
+			    "queues before time expire\n",
+			    ha->host_no));
+
+			if (!IS_QLA2100(ha) && ha->link_down_timeout)
+				atomic_set(&ha->loop_state, LOOP_DEAD); 
+
+			set_bit(ABORT_QUEUES_NEEDED, &ha->dpc_flags);
+			start_dpc++;
+		}
+
+		/* if the loop has been down for 4 minutes, reinit adapter */
+		if (atomic_dec_and_test(&ha->loop_down_timer) != 0) {
+			DEBUG(printk("scsi(%ld): Loop down exceed 4 mins - "
+			    "restarting queues.\n",
+			    ha->host_no));
+
+			set_bit(RESTART_QUEUES_NEEDED, &ha->dpc_flags);
+			start_dpc++;
+
+		}
+		DEBUG3(printk("scsi(%ld): Loop Down - seconds remainning %d\n",
+		    ha->host_no,
+		    atomic_read(&ha->loop_down_timer)));
+	}
+
+	/*
+	 * Done Q Handler -- dgFIXME This handler will kick off doneq if we
+	 * haven't process it in 2 seconds.
+	 */
+	if (!list_empty(&ha->done_queue))
+		qla2x00_done(ha);
+
+	/* Schedule the DPC routine if needed */
+	if ((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) ||
+	    test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) ||
+	    start_dpc ||
+	    test_bit(LOGIN_RETRY_NEEDED, &ha->dpc_flags) ||
+	    test_bit(RELOGIN_NEEDED, &ha->dpc_flags)) &&
+	    ha->dpc_wait && !ha->dpc_active) {
+
+		up(ha->dpc_wait);
+	}
+
+	qla2x00_restart_timer(ha, WATCH_INTERVAL);
+}
+
+/*
+ * qla2x00_extend_timeout
+ *      This routine will extend the timeout to the specified value.
+ *
+ * Input:
+ *      cmd = SCSI command structure
+ *
+ * Returns:
+ *      None.
+ */
+void 
+qla2x00_extend_timeout(struct scsi_cmnd *cmd, int timeout) 
+{
+	srb_t *sp = (srb_t *) CMD_SP(cmd);
+	u_long our_jiffies = (timeout * HZ) + jiffies;
+
+    	sp->ext_history= 0; 
+	sp->e_start = jiffies;
+	if (cmd->eh_timeout.function) {
+		mod_timer(&cmd->eh_timeout,our_jiffies);
+		sp->ext_history |= 1;
+	}
+	if (sp->timer.function != NULL) {
+		/* 
+		 * Our internal timer should timeout before the midlayer has a
+		 * chance begin the abort process
+		 */
+		mod_timer(&sp->timer,our_jiffies - (QLA_CMD_TIMER_DELTA * HZ));
+
+    	 	sp->ext_history |= 2;
+	}
+}
+
+/**************************************************************************
+*   qla2x00_cmd_timeout
+*
+* Description:
+*       Handles the command if it times out in any state.
+*
+* Input:
+*     sp - pointer to validate
+*
+* Returns:
+* None.
+* Note:Need to add the support for if( sp->state == SRB_FAILOVER_STATE).
+**************************************************************************/
+static void
+qla2x00_cmd_timeout(srb_t *sp)
+{
+	int t, l;
+	int processed;
+	scsi_qla_host_t *vis_ha, *dest_ha;
+	struct scsi_cmnd *cmd;
+	ulong      flags;
+#if defined(QL_DEBUG_LEVEL_3)
+	ulong      cpu_flags;
+#endif
+	fc_port_t	*fcport;
+
+	cmd = sp->cmd;
+	vis_ha = (scsi_qla_host_t *)cmd->device->host->hostdata;
+
+	DEBUG3(printk("cmd_timeout: Entering sp->state = %x\n", sp->state));
+
+	t = cmd->device->id;
+	l = cmd->device->lun;
+	fcport = sp->fclun->fcport;
+	dest_ha = sp->ha;
+
+	/*
+	 * If IO is found either in retry Queue 
+	 *    OR in Lun Queue
+	 * Return this IO back to host
+	 */
+	spin_lock_irqsave(&vis_ha->list_lock, flags);
+	processed = 0;
+	if (sp->state == SRB_PENDING_STATE) {
+		__del_from_pending_queue(vis_ha, sp);
+		DEBUG2(printk("scsi(%ld): Found in Pending queue pid %ld, "
+		    "State = %x., fcport state=%d jiffies=%lx\n",
+		    vis_ha->host_no, cmd->serial_number, sp->state,
+		    atomic_read(&fcport->state), jiffies));
+
+		/*
+		 * If FC_DEVICE is marked as dead return the cmd with
+		 * DID_NO_CONNECT status.  Otherwise set the host_byte to
+		 * DID_BUS_BUSY to let the OS  retry this cmd.
+		 */
+		if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
+		    atomic_read(&vis_ha->loop_state) == LOOP_DEAD) {
+			cmd->result = DID_NO_CONNECT << 16;
+		} else {
+			cmd->result = DID_BUS_BUSY << 16;
+		}
+		__add_to_done_queue(vis_ha, sp);
+		processed++;
+	} 
+	spin_unlock_irqrestore(&vis_ha->list_lock, flags);
+
+	if (processed) {
+		qla2x00_done(vis_ha);
+		return;
+	}
+
+	spin_lock_irqsave(&dest_ha->list_lock, flags);
+	if ((sp->state == SRB_RETRY_STATE) ||
+	    (sp->state == SRB_SCSI_RETRY_STATE)) {
+
+		DEBUG2(printk("scsi(%ld): Found in (Scsi) Retry queue or "
+		    "failover Q pid %ld, State = %x., fcport state=%d "
+		    "jiffies=%lx retried=%d\n",
+		    dest_ha->host_no, cmd->serial_number, sp->state,
+		    atomic_read(&fcport->state), jiffies, cmd->retries));
+
+		if ((sp->state == SRB_RETRY_STATE)) {
+			__del_from_retry_queue(dest_ha, sp);
+		} else if ((sp->state == SRB_SCSI_RETRY_STATE)) {
+			__del_from_scsi_retry_queue(dest_ha, sp);
+		}
+
+		/*
+		 * If FC_DEVICE is marked as dead return the cmd with
+		 * DID_NO_CONNECT status.  Otherwise set the host_byte to
+		 * DID_BUS_BUSY to let the OS  retry this cmd.
+		 */
+
+		if ((atomic_read(&fcport->state) == FCS_DEVICE_DEAD) ||
+		    atomic_read(&dest_ha->loop_state) == LOOP_DEAD) {
+			qla2x00_extend_timeout(cmd, EXTEND_CMD_TIMEOUT);
+			cmd->result = DID_NO_CONNECT << 16;
+		} else {
+			cmd->result = DID_BUS_BUSY << 16;
+		}
+
+		__add_to_done_queue(dest_ha, sp);
+		processed++;
+	} 
+	spin_unlock_irqrestore(&dest_ha->list_lock, flags);
+
+	if (processed) {
+		qla2x00_done(dest_ha);
+
+		 return;
+	}
+/* TODO: Remove this code!!! */
+#if defined(QL_DEBUG_LEVEL_3)
+	spin_lock_irqsave(&dest_ha->list_lock, cpu_flags);
+	if (sp->state == SRB_DONE_STATE) {
+		/* IO in done_q  -- leave it */
+		DEBUG(printk("scsi(%ld): Found in Done queue pid %ld sp=%p.\n",
+		    dest_ha->host_no, cmd->serial_number, sp));
+	} else if (sp->state == SRB_SUSPENDED_STATE) {
+		DEBUG(printk("scsi(%ld): Found SP %p in suspended state  "
+		    "- pid %ld:\n",
+		    dest_ha->host_no, sp, cmd->serial_number));
+		DEBUG(qla2x00_dump_buffer((uint8_t *)sp, sizeof(srb_t));)
+	} else if (sp->state == SRB_ACTIVE_STATE) {
+		/*
+		 * IO is with ISP find the command in our active list.
+		 */
+		spin_unlock_irqrestore(&dest_ha->list_lock, cpu_flags);
+		spin_lock_irqsave(&dest_ha->hardware_lock, flags);
+		if (sp ==
+		    dest_ha->outstanding_cmds[(u_long)sp->cmd->host_scribble]) {
+
+			DEBUG(printk("cmd_timeout: Found in ISP \n");)
+
+			sp->state = SRB_ACTIVE_TIMEOUT_STATE;
+			spin_unlock_irqrestore(&dest_ha->hardware_lock, flags);
+		} else {
+			spin_unlock_irqrestore(&dest_ha->hardware_lock, flags);
+			printk(KERN_INFO 
+				"qla_cmd_timeout: State indicates it is with "
+				"ISP, But not in active array\n");
+		}
+		spin_lock_irqsave(&dest_ha->list_lock, cpu_flags); 	/* 01/03 */
+	} else if (sp->state == SRB_ACTIVE_TIMEOUT_STATE) {
+		DEBUG(printk("qla2100%ld: Found in Active timeout state"
+				"pid %ld, State = %x., \n",
+				dest_ha->host_no,
+				sp->cmd->serial_number, sp->state);)
+	} else {
+		/* EMPTY */
+		DEBUG2(printk("cmd_timeout%ld: LOST command state = "
+				"0x%x, sp=%p\n",
+				vis_ha->host_no, sp->state,sp);)
+
+		qla_printk(KERN_INFO, vis_ha,
+			"cmd_timeout: LOST command state = 0x%x\n", sp->state);
+	}
+	spin_unlock_irqrestore(&dest_ha->list_lock, cpu_flags);
+#endif
+	
+	DEBUG3(printk("cmd_timeout: Leaving\n");)
+}
+
+/**************************************************************************
+* qla2x00_done
+*      Process completed commands.
+*
+* Input:
+*      old_ha           = adapter block pointer.
+*
+**************************************************************************/
+void
+qla2x00_done(scsi_qla_host_t *old_ha)
+{
+	os_lun_t	*lq;
+	struct scsi_cmnd *cmd;
+	unsigned long	flags = 0;
+	scsi_qla_host_t	*ha;
+	scsi_qla_host_t	*vis_ha;
+	int	send_marker_once = 0;
+	srb_t           *sp, *sptemp;
+	LIST_HEAD(local_sp_list);
+
+	/*
+	 * Get into local queue such that we do not wind up calling done queue
+	 * tasklet for the same IOs from DPC or any other place.
+	 */
+	spin_lock_irqsave(&old_ha->list_lock, flags);
+	list_splice_init(&old_ha->done_queue, &local_sp_list);
+	spin_unlock_irqrestore(&old_ha->list_lock, flags);
+
+	/*
+	 * All done commands are in the local queue, now do the call back.
+	 */
+	list_for_each_entry_safe(sp, sptemp, &local_sp_list, list) {
+		old_ha->done_q_cnt--;
+        	sp->state = SRB_NO_QUEUE_STATE;
+
+		/* remove command from local list */
+		list_del_init(&sp->list);
+
+		cmd = sp->cmd;
+		if (cmd == NULL)
+		 	continue;
+
+		vis_ha = (scsi_qla_host_t *)cmd->device->host->hostdata;
+		lq = sp->lun_queue;
+		ha = sp->ha;
+
+		if (sp->flags & SRB_DMA_VALID) {
+			sp->flags &= ~SRB_DMA_VALID;
+
+			/* Release memory used for this I/O */
+			if (cmd->use_sg) {
+				pci_unmap_sg(ha->pdev, cmd->request_buffer,
+				    cmd->use_sg, cmd->sc_data_direction);
+			} else if (cmd->request_bufflen) {
+				pci_unmap_page(ha->pdev, sp->dma_handle,
+				    cmd->request_bufflen,
+				    cmd->sc_data_direction);
+			}
+		}
+
+		switch (host_byte(cmd->result)) {
+			case DID_OK:
+			case DID_ERROR:
+				break;
+
+			case DID_RESET:
+				/*
+				 * Set marker needed, so we don't have to
+				 * send multiple markers
+				 */
+				if (!send_marker_once) {
+					ha->marker_needed = 1;
+					send_marker_once++;
+				}
+
+				/*
+				 * WORKAROUND
+				 *
+				 * A backdoor device-reset requires different
+				 * error handling.  This code differentiates
+				 * between normal error handling and the
+				 * backdoor method.
+				 *
+				 */
+				if (ha->host->eh_active != EH_ACTIVE)
+					cmd->result = DID_BUS_BUSY << 16;
+				break;
+
+
+			case DID_ABORT:
+				sp->flags &= ~SRB_ABORT_PENDING;
+				sp->flags |= SRB_ABORTED;
+
+				if (sp->flags & SRB_TIMEOUT)
+					cmd->result = DID_TIME_OUT << 16;
+
+				break;
+
+			default:
+				DEBUG2(printk("scsi(%ld:%d:%d) %s: did_error "
+				    "= %d, comp-scsi= 0x%x-0x%x.\n",
+				    vis_ha->host_no,
+				    cmd->device->id, cmd->device->lun,
+				    __func__,
+				    host_byte(cmd->result),
+				    CMD_COMPL_STATUS(cmd),
+				    CMD_SCSI_STATUS(cmd)));
+				break;
+		}
+
+		/*
+		 * Call the mid-level driver interrupt handler -- via sp_put()
+		 */
+		sp_put(ha, sp);
+	} /* end of while */
+}
+
+/*
+ * qla2x00_process_response_queue_in_zio_mode
+ *	Process response queue completion as fast as possible
+ *	to achieve Zero Interrupt Opertions-ZIO
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *
+ * Context:
+ *	Kernel context.
+ */
+static inline void
+qla2x00_process_response_queue_in_zio_mode(scsi_qla_host_t *ha)
+{
+	unsigned long flags;
+
+	/* Check for unprocessed commands in response queue. */
+	if (!ha->flags.process_response_queue)
+		return;
+	if (!ha->flags.online)
+		return;
+	if (ha->response_ring_ptr->signature == RESPONSE_PROCESSED)
+		return;
+	
+	spin_lock_irqsave(&ha->hardware_lock,flags);
+	qla2x00_process_response_queue(ha);
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+	if (!list_empty(&ha->done_queue))
+		qla2x00_done(ha);
+}
+
+/*
+ * qla2x00_next
+ *	Retrieve and process next job in the LUN queue.
+ *
+ * Input:
+ *	tq = SCSI target queue pointer.
+ *	lq = SCSI LUN queue pointer.
+ *	TGT_LOCK must be already obtained.
+ *
+ * Output:
+ *	Releases TGT_LOCK upon exit.
+ *
+ * Context:
+ *	Kernel/Interrupt context.
+ * 
+ * Note: This routine will always try to start I/O from visible HBA.
+ */
+void
+qla2x00_next(scsi_qla_host_t *vis_ha) 
+{
+	int		rval;
+	unsigned long   flags;
+	scsi_qla_host_t *dest_ha;
+	fc_port_t	*fcport;
+	srb_t           *sp, *sptemp;
+	LIST_HEAD(local_sp_list);
+
+	dest_ha = NULL;
+
+	spin_lock_irqsave(&vis_ha->list_lock, flags);
+	list_splice_init(&vis_ha->pending_queue, &local_sp_list);
+	vis_ha->qthreads = 0;
+	spin_unlock_irqrestore(&vis_ha->list_lock, flags);
+
+	list_for_each_entry_safe(sp, sptemp, &local_sp_list, list) {
+		list_del_init(&sp->list);
+        	sp->state = SRB_NO_QUEUE_STATE;
+
+		fcport = sp->fclun->fcport;
+		dest_ha = fcport->ha;
+
+		/* If device is dead then send request back to OS */
+		if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD) {
+
+			sp->cmd->result = DID_NO_CONNECT << 16;
+
+			if (!atomic_read(&dest_ha->loop_down_timer) &&
+			    atomic_read(&dest_ha->loop_state) == LOOP_DOWN) {
+				sp->err_id = 2;
+			} else {
+				sp->err_id = 1;
+			}
+			DEBUG3(printk("scsi(%ld): loop/port is down - "
+			    "pid=%ld, sp=%p loopid=0x%x queued to dest HBA "
+			    "scsi%ld.\n",
+			    dest_ha->host_no,
+			    sp->cmd->serial_number, sp,
+			    fcport->loop_id, dest_ha->host_no));
+			/* 
+			 * Initiate a failover - done routine will initiate.
+			 */
+			add_to_done_queue(vis_ha, sp);
+
+			continue;
+		}
+
+		/*
+		 * SCSI Kluge: Whenever, we need to wait for an event such as
+		 * loop down (i.e. loop_down_timer ) or port down (i.e.  LUN
+		 * request qeueue is suspended) then we will recycle new
+		 * commands back to the SCSI layer.  We do this because this is
+		 * normally a temporary condition and we don't want the
+		 * mid-level scsi.c driver to get upset and start aborting
+		 * commands.  The timeout value is extracted from the command
+		 * minus 1-second and put on a retry queue (watchdog). Once the
+		 * command timeout it is returned to the mid-level with a BUSY
+		 * status, so the mid-level will retry it. This process
+		 * continues until the LOOP DOWN time expires or the condition
+		 * goes away.
+		 */
+	 	if (!(sp->flags & SRB_IOCTL) &&
+		    (atomic_read(&fcport->state) != FCS_ONLINE ||
+			test_bit(ABORT_ISP_ACTIVE, &dest_ha->dpc_flags) ||
+			atomic_read(&dest_ha->loop_state) != LOOP_READY)) {
+
+			DEBUG3(printk("scsi(%ld): port=(0x%x) retry_q(%d) "
+			    "loop state = %d, loop counter = 0x%x dpc flags "
+			    "= 0x%lx\n",
+			    dest_ha->host_no,
+			    fcport->loop_id,
+			    atomic_read(&fcport->state),
+			    atomic_read(&dest_ha->loop_state),
+			    atomic_read(&dest_ha->loop_down_timer),
+			    dest_ha->dpc_flags));
+
+			qla2x00_extend_timeout(sp->cmd, EXTEND_CMD_TIMEOUT);
+			add_to_retry_queue(vis_ha, sp);
+
+			continue;
+		} 
+
+		/*
+		 * If this request's lun is suspended then put the request on
+		 * the  scsi_retry queue. 
+		 */
+	 	if (!(sp->flags & SRB_IOCTL) &&
+		    sp->lun_queue->q_state == LUN_STATE_WAIT) {
+			DEBUG3(printk("scsi(%ld): lun wait state - pid=%ld, "
+			    "opcode=%d, allowed=%d, retries=%d\n",
+			    dest_ha->host_no,
+			    sp->cmd->serial_number,
+			    sp->cmd->cmnd[0],
+			    sp->cmd->allowed,
+			    sp->cmd->retries));
+				
+			add_to_scsi_retry_queue(vis_ha, sp);
+
+			continue;
+		}
+
+		sp->lun_queue->io_cnt++;
+
+		rval = qla2x00_start_scsi(sp);
+		if (rval != QLA_SUCCESS) {
+			/* Place request back on top of device queue */
+			/* add to the top of queue */
+			add_to_pending_queue_head(vis_ha, sp);
+
+			sp->lun_queue->io_cnt--;
+		}
+	}
+
+	if (IS_QLA23XX(vis_ha)) {
+		/* Process response_queue if ZIO support is enabled*/ 
+		qla2x00_process_response_queue_in_zio_mode(vis_ha);
+
+	}
+}
+
+
+/*
+ * qla2x00_reset_lun_fo_counts
+ *	Reset failover retry counts
+ *
+ * Input:
+ *	ha = adapter block pointer.
+ *
+ * Context:
+ *	Interrupt context.
+ */
+void 
+qla2x00_reset_lun_fo_counts(scsi_qla_host_t *ha, os_lun_t *lq) 
+{
+	srb_t		*tsp;
+	os_lun_t	*orig_lq;
+	struct list_head *list;
+	unsigned long	flags ;
+
+	spin_lock_irqsave(&ha->list_lock, flags);
+	/*
+	 * the pending queue.
+	 */
+	list_for_each(list,&ha->pending_queue) {
+		tsp = list_entry(list, srb_t, list);
+		orig_lq = tsp->lun_queue;
+		if (orig_lq == lq)
+			tsp->fo_retry_cnt = 0;
+	}
+	/*
+	 * the retry queue.
+	 */
+	list_for_each(list,&ha->retry_queue) {
+		tsp = list_entry(list, srb_t, list);
+		orig_lq = tsp->lun_queue;
+		if (orig_lq == lq)
+			tsp->fo_retry_cnt = 0;
+	}
+
+	/*
+	 * the done queue.
+	 */
+	list_for_each(list, &ha->done_queue) {
+		tsp = list_entry(list, srb_t, list);
+		orig_lq = tsp->lun_queue;
+		if (orig_lq == lq)
+			tsp->fo_retry_cnt = 0;
+	}
+	spin_unlock_irqrestore(&ha->list_lock, flags);
+}
+
+/**************************************************************************
+*   qla2x00_check_tgt_status
+*
+* Description:
+*     Checks to see if the target or loop is down.
+*
+* Input:
+*     cmd - pointer to Scsi cmd structure
+*
+* Returns:
+*   1 - if target is present
+*   0 - if target is not present
+*
+**************************************************************************/
+int
+qla2x00_check_tgt_status(scsi_qla_host_t *ha, struct scsi_cmnd *cmd)
+{
+	os_lun_t        *lq;
+	unsigned int	b, t, l;
+	fc_port_t	*fcport;
+
+	/* Generate LU queue on bus, target, LUN */
+	b = cmd->device->channel;
+	t = cmd->device->id;
+	l = cmd->device->lun;
+
+	if ((lq = GET_LU_Q(ha,t,l)) == NULL) {
+		return (QLA_FUNCTION_FAILED);
+	}
+
+	fcport = lq->fclun->fcport;
+
+	if (TGT_Q(ha, t) == NULL ||
+	    l >= ha->max_luns ||
+	    atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
+	    atomic_read(&ha->loop_state) == LOOP_DEAD ||
+	    (!atomic_read(&ha->loop_down_timer) &&
+		atomic_read(&ha->loop_state) == LOOP_DOWN) ||
+	    test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags) ||
+	    test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) ||
+	    atomic_read(&ha->loop_state) != LOOP_READY) {
+
+		DEBUG(printk(KERN_INFO
+		    "scsi(%ld:%2d:%2d:%2d): %s connection is down\n",
+		    ha->host_no,
+		    b, t, l,
+		    __func__));
+
+		cmd->result = DID_NO_CONNECT << 16;
+		return (QLA_FUNCTION_FAILED);
+	}
+	return (QLA_SUCCESS);
+}
+
+/**************************************************************************
+*   qla2x00_check_port_status
+*
+* Description:
+*     Checks to see if the port or loop is down.
+*
+* Input:
+*     fcport - pointer to fc_port_t structure.
+*
+* Returns:
+*   1 - if port is present
+*   0 - if port is not present
+*
+**************************************************************************/
+int
+qla2x00_check_port_status(scsi_qla_host_t *ha, fc_port_t *fcport)
+{
+	if (fcport == NULL) {
+		return (QLA_FUNCTION_FAILED);
+	}
+
+	if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
+	    atomic_read(&ha->loop_state) == LOOP_DEAD) {
+		return (QLA_FUNCTION_FAILED);
+	}
+
+	if ((atomic_read(&fcport->state) != FCS_ONLINE) || 
+	    (!atomic_read(&ha->loop_down_timer) &&
+		atomic_read(&ha->loop_state) == LOOP_DOWN) ||
+	    (test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags)) ||
+	    test_bit(CFG_ACTIVE, &ha->cfg_flags) ||
+	    test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) ||
+	    atomic_read(&ha->loop_state) != LOOP_READY) {
+
+		DEBUG(printk(KERN_INFO
+		    "scsi(%ld): Connection is down. fcport=%p.\n",
+		    ha->host_no, fcport));
+
+		return (QLA_BUSY);
+	}
+
+	return (QLA_SUCCESS);
+}
+
+/**
+ * qla2x00_module_init - Module initialization.
+ **/
+static int __init
+qla2x00_module_init(void)
+{
+	/* Derive version string. */
+	strcpy(qla2x00_version_str, QLA2XXX_VERSION);
+#if DEBUG_QLA2100
+	strcat(qla2x00_version_str, "-debug");
+#endif
+	/* Allocate cache for SRBs. */
+	sprintf(srb_cachep_name, "qla2xxx_srbs");
+	srb_cachep = kmem_cache_create(srb_cachep_name, sizeof(srb_t), 0,
+	    SLAB_HWCACHE_ALIGN, NULL, NULL);
+	if (srb_cachep == NULL) {
+		printk(KERN_ERR
+		    "qla2xxx: Unable to allocate SRB cache...Failing load!\n");
+		return -ENOMEM;
+	}
+
+	printk(KERN_INFO
+	    "QLogic ISP2xxx PCI/PCI-X Fibre Channel HBA Driver (%p)\n",
+	    qla2x00_set_info);
+
+	return 0;
+}
+
+/**
+ * qla2x00_module_exit - Module cleanup.
+ **/
+static void __exit
+qla2x00_module_exit(void)
+{
+	/* Free SRBs cache. */
+	if (srb_cachep != NULL) {
+		if (kmem_cache_destroy(srb_cachep) != 0) {
+			printk(KERN_ERR
+			    "qla2xxx: Unable to free SRB cache...Memory pools "
+			    "still active?\n");
+		}
+		srb_cachep = NULL;
+	}
+}
+
+module_init(qla2x00_module_init);
+module_exit(qla2x00_module_exit);
+
+MODULE_AUTHOR("QLogic Corporation");
+MODULE_DESCRIPTION("QLogic ISP2xxx FC-SCSI Host Bus Adapter driver");
+MODULE_LICENSE("GPL");
diff -Nru a/drivers/scsi/qla2xxx/qla_os.h b/drivers/scsi/qla2xxx/qla_os.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/qla_os.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,93 @@
+/******************************************************************************
+ *                  QLOGIC LINUX SOFTWARE
+ *
+ * QLogic ISP2x00 device driver for Linux 2.6.x
+ * Copyright (C) 2003 QLogic Corporation
+ * (www.qlogic.com)
+ *
+ * Portions (C) Arjan van de Ven <arjanv@redhat.com> for Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ ******************************************************************************/
+
+#ifndef __QLA_OS_H
+#define __QLA_OS_H
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/version.h>
+#include <linux/init.h>
+#include <linux/string.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/ioport.h>
+#include <linux/delay.h>
+#include <linux/timer.h>
+#include <linux/sched.h>
+#include <linux/pci.h>
+#include <linux/proc_fs.h>
+#include <linux/blkdev.h>
+#include <linux/interrupt.h>
+#include <linux/stat.h>
+#include <linux/slab.h>
+#include <linux/mempool.h>
+#include <linux/vmalloc.h>
+#define __KERNEL_SYSCALLS__
+#include <linux/unistd.h>
+#include <linux/smp_lock.h>
+#include <linux/bio.h>
+#include <linux/moduleparam.h>
+#include <linux/capability.h>
+
+#include <asm/system.h>
+
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/segment.h>
+#include <asm/byteorder.h>
+#include <asm/pgtable.h>
+
+#include <linux/ioctl.h>
+#include <asm/uaccess.h>
+
+#include "scsi.h"
+#include "hosts.h"
+
+#include <scsi/scsicam.h>
+#include <scsi/scsi_ioctl.h>
+
+//TODO Fix this!!!
+/*
+* String arrays
+*/
+#define LINESIZE    256
+#define MAXARGS      26
+
+/***********************************************************************
+* We use the struct scsi_pointer structure that's included with each 
+* command SCSI_Cmnd as a scratchpad. 
+*
+* SCp is defined as follows:
+*  - SCp.ptr  -- > pointer to the SRB
+*  - SCp.this_residual  -- > HBA completion status for ioctl code. 
+*
+* Cmnd->host_scribble --> Used to hold the hba actived handle (1..255).
+***********************************************************************/
+#define	CMD_SP(Cmnd)		((Cmnd)->SCp.ptr)
+#define CMD_COMPL_STATUS(Cmnd)  ((Cmnd)->SCp.this_residual)
+/* Additional fields used by ioctl passthru */
+#define CMD_RESID_LEN(Cmnd)	((Cmnd)->SCp.buffers_residual)
+#define CMD_SCSI_STATUS(Cmnd)	((Cmnd)->SCp.Status)
+#define CMD_ACTUAL_SNSLEN(Cmnd)	((Cmnd)->SCp.Message)
+#define CMD_ENTRY_STATUS(Cmnd)	((Cmnd)->SCp.have_data_in)
+
+#endif
diff -Nru a/drivers/scsi/qla2xxx/qla_rscn.c b/drivers/scsi/qla2xxx/qla_rscn.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/qla_rscn.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,1458 @@
+/*
+ *                  QLOGIC LINUX SOFTWARE
+ *
+ * QLogic ISP2x00 device driver for Linux 2.6.x
+ * Copyright (C) 2003 QLogic Corporation
+ * (www.qlogic.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+#include "qla_os.h"
+
+#include "qla_def.h"
+
+/**
+ * IO descriptor handle definitions.
+ *
+ * Signature form:
+ *
+ *	|31------28|27-------------------12|11-------0|
+ *	|   Type   |   Rolling Signature   |   Index  |
+ *	|----------|-----------------------|----------|
+ *
+ **/
+
+#define HDL_TYPE_SCSI		0
+#define HDL_TYPE_ASYNC_IOCB	0x0A
+
+#define HDL_INDEX_BITS	12
+#define HDL_ITER_BITS	16
+#define HDL_TYPE_BITS	4
+
+#define HDL_INDEX_MASK	((1UL << HDL_INDEX_BITS) - 1)
+#define HDL_ITER_MASK	((1UL << HDL_ITER_BITS) - 1)
+#define HDL_TYPE_MASK	((1UL << HDL_TYPE_BITS) - 1)
+
+#define HDL_INDEX_SHIFT	0
+#define HDL_ITER_SHIFT	(HDL_INDEX_SHIFT + HDL_INDEX_BITS)
+#define HDL_TYPE_SHIFT	(HDL_ITER_SHIFT + HDL_ITER_BITS)
+
+/* Local Prototypes. */
+static inline uint32_t qla2x00_to_handle(uint16_t, uint16_t, uint16_t);
+static inline uint16_t qla2x00_handle_to_idx(uint32_t);
+static inline uint16_t qla2x00_handle_to_iter(uint32_t);
+static inline uint16_t qla2x00_handle_to_type(uint32_t);
+static inline uint32_t qla2x00_iodesc_to_handle(struct io_descriptor *);
+static inline struct io_descriptor *qla2x00_handle_to_iodesc(scsi_qla_host_t *,
+    uint32_t);
+
+static inline struct io_descriptor *qla2x00_alloc_iodesc(scsi_qla_host_t *);
+static inline void qla2x00_free_iodesc(struct io_descriptor *);
+static inline void qla2x00_init_io_descriptors(scsi_qla_host_t *);
+
+static void qla2x00_iodesc_timeout(unsigned long);
+static inline void qla2x00_add_iodesc_timer(struct io_descriptor *);
+static inline void qla2x00_remove_iodesc_timer(struct io_descriptor *);
+
+static inline void qla2x00_update_login_fcport(scsi_qla_host_t *,
+    struct mbx_entry *, fc_port_t *);
+
+static int qla2x00_send_abort_iocb(scsi_qla_host_t *, struct io_descriptor *,
+    uint32_t, int);
+static int qla2x00_send_abort_iocb_cb(scsi_qla_host_t *, struct io_descriptor *,
+    struct mbx_entry *);
+
+static int qla2x00_send_adisc_iocb(scsi_qla_host_t *, struct io_descriptor *,
+    int);
+static int qla2x00_send_adisc_iocb_cb(scsi_qla_host_t *, struct io_descriptor *,
+    struct mbx_entry *);
+
+static int qla2x00_send_logout_iocb(scsi_qla_host_t *, struct io_descriptor *,
+    int);
+static int qla2x00_send_logout_iocb_cb(scsi_qla_host_t *,
+    struct io_descriptor *, struct mbx_entry *);
+
+static int qla2x00_send_login_iocb(scsi_qla_host_t *, struct io_descriptor *,
+    port_id_t *, int);
+static int qla2x00_send_login_iocb_cb(scsi_qla_host_t *, struct io_descriptor *,
+    struct mbx_entry *);
+
+/** 
+ * Mailbox IOCB callback array.
+ **/
+int (*iocb_function_cb_list[LAST_IOCB_CB])
+	(scsi_qla_host_t *, struct io_descriptor *, struct mbx_entry *) = {
+
+	qla2x00_send_abort_iocb_cb,
+	qla2x00_send_adisc_iocb_cb,
+	qla2x00_send_logout_iocb_cb,
+	qla2x00_send_login_iocb_cb,
+};
+
+
+/** 
+ * Generic IO descriptor handle routines.
+ **/
+
+/**
+ * qla2x00_to_handle() - Create a descriptor handle.
+ * @type: descriptor type
+ * @iter: descriptor rolling signature
+ * @idx: index to the descriptor array
+ *
+ * Returns a composite handle based in the @type, @iter, and @idx.
+ */
+static inline uint32_t
+qla2x00_to_handle(uint16_t type, uint16_t iter, uint16_t idx)
+{
+	return ((uint32_t)(((uint32_t)type << HDL_TYPE_SHIFT) |
+	    ((uint32_t)iter << HDL_ITER_SHIFT) |
+	    ((uint32_t)idx << HDL_INDEX_SHIFT)));
+}
+
+/**
+ * qla2x00_handle_to_idx() - Retrive the index for a given handle.
+ * @handle: descriptor handle
+ *
+ * Returns the index specified by the @handle.
+ */
+static inline uint16_t
+qla2x00_handle_to_idx(uint32_t handle)
+{
+	return ((uint16_t)(((handle) >> HDL_INDEX_SHIFT) & HDL_INDEX_MASK));
+}
+
+/**
+ * qla2x00_handle_to_type() - Retrive the descriptor type for a given handle.
+ * @handle: descriptor handle
+ *
+ * Returns the descriptor type specified by the @handle.
+ */
+static inline uint16_t
+qla2x00_handle_to_type(uint32_t handle)
+{
+	return ((uint16_t)(((handle) >> HDL_TYPE_SHIFT) & HDL_TYPE_MASK));
+}
+
+/**
+ * qla2x00_handle_to_iter() - Retrive the rolling signature for a given handle.
+ * @handle: descriptor handle
+ *
+ * Returns the signature specified by the @handle.
+ */
+static inline uint16_t
+qla2x00_handle_to_iter(uint32_t handle)
+{
+	return ((uint16_t)(((handle) >> HDL_ITER_SHIFT) & HDL_ITER_MASK));
+}
+
+/**
+ * qla2x00_iodesc_to_handle() - Convert an IO descriptor to a unique handle.
+ * @iodesc: io descriptor
+ *
+ * Returns a unique handle for @iodesc.
+ */
+static inline uint32_t
+qla2x00_iodesc_to_handle(struct io_descriptor *iodesc)
+{
+	uint32_t handle;
+
+	handle = qla2x00_to_handle(HDL_TYPE_ASYNC_IOCB,
+	    ++iodesc->ha->iodesc_signature, iodesc->idx);
+	iodesc->signature = handle;
+
+	return (handle);
+}
+
+/**
+ * qla2x00_handle_to_iodesc() - Retrieve an IO descriptor given a unique handle.
+ * @ha: HA context
+ * @handle: handle to io descriptor
+ *
+ * Returns a pointer to the io descriptor, or NULL, if the io descriptor does
+ * not exist or the io descriptors signature does not @handle.
+ */
+static inline struct io_descriptor *
+qla2x00_handle_to_iodesc(scsi_qla_host_t *ha, uint32_t handle)
+{
+	uint16_t idx;
+	struct io_descriptor *iodesc;
+
+	idx = qla2x00_handle_to_idx(handle);
+	iodesc = &ha->io_descriptors[idx];
+	if (iodesc)
+		if (iodesc->signature != handle)
+			iodesc = NULL;
+
+	return (iodesc);
+}
+
+
+/** 
+ * IO descriptor allocation routines.
+ **/
+
+/**
+ * qla2x00_alloc_iodesc() - Allocate an IO descriptor from the pool.
+ * @ha: HA context
+ *
+ * Returns a pointer to the allocated io descriptor, or NULL, if none available.
+ */
+static inline struct io_descriptor *
+qla2x00_alloc_iodesc(scsi_qla_host_t *ha)
+{
+	uint16_t iter;
+	struct io_descriptor *iodesc;
+
+	iodesc = NULL;
+	for (iter = 0; iter < MAX_IO_DESCRIPTORS; iter++) {
+		if (ha->io_descriptors[iter].used)
+			continue;
+
+		iodesc = &ha->io_descriptors[iter];
+		iodesc->used = 1;
+		iodesc->idx = iter;
+		init_timer(&iodesc->timer);
+		iodesc->ha = ha;
+		iodesc->signature = qla2x00_iodesc_to_handle(iodesc);
+		break;
+	}
+
+	return (iodesc);
+}
+
+/**
+ * qla2x00_free_iodesc() - Free an IO descriptor.
+ * @iodesc: io descriptor
+ *
+ * NOTE: The io descriptors timer *must* be stopped before it can be free'd.
+ */
+static inline void
+qla2x00_free_iodesc(struct io_descriptor *iodesc)
+{
+	iodesc->used = 0;
+	iodesc->signature = 0;
+}
+
+/**
+ * qla2x00_init_io_descriptors() - Initialize the pool of IO descriptors.
+ * @ha: HA context
+ */
+static inline void
+qla2x00_init_io_descriptors(scsi_qla_host_t *ha)
+{
+	uint16_t iter;
+
+	for (iter = 0; iter < MAX_IO_DESCRIPTORS; iter++) {
+		if (!ha->io_descriptors[iter].used)
+			continue;
+
+		qla2x00_remove_iodesc_timer(&ha->io_descriptors[iter]);
+		qla2x00_free_iodesc(&ha->io_descriptors[iter]);
+	}
+}
+
+
+/** 
+ * IO descriptor timer routines.
+ **/
+
+/**
+ * qla2x00_iodesc_timeout() - Timeout IO descriptor handler.
+ * @data: io descriptor
+ */
+static void
+qla2x00_iodesc_timeout(unsigned long data)
+{
+	struct io_descriptor *iodesc;
+
+	iodesc = (struct io_descriptor *) data;
+
+	DEBUG14(printk("scsi(%ld): IO descriptor timeout, index=%x "
+	    "signature=%08x, scheduling ISP abort.\n", iodesc->ha->host_no,
+	    iodesc->idx, iodesc->signature));
+
+	qla2x00_free_iodesc(iodesc);
+
+	set_bit(ISP_ABORT_NEEDED, &iodesc->ha->dpc_flags);
+}
+
+/**
+ * qla2x00_add_iodesc_timer() - Add and start a timer for an IO descriptor.
+ * @iodesc: io descriptor
+ *
+ * NOTE:
+ * The firmware shall timeout an outstanding mailbox IOCB in 2 * R_A_TOV (in
+ * tenths of a second).  The driver will wait 2.5 * R_A_TOV before scheduling
+ * a recovery (big hammer).
+ */
+static inline void
+qla2x00_add_iodesc_timer(struct io_descriptor *iodesc)
+{
+	unsigned long timeout;
+
+	timeout = ((iodesc->ha->r_a_tov * 2) + (iodesc->ha->r_a_tov / 2)) / 10;
+	init_timer(&iodesc->timer);
+	iodesc->timer.data = (unsigned long) iodesc;
+	iodesc->timer.expires = jiffies + (timeout * HZ);
+	iodesc->timer.function =
+	    (void (*) (unsigned long)) qla2x00_iodesc_timeout;
+	add_timer(&iodesc->timer);
+}
+
+/**
+ * qla2x00_remove_iodesc_timer() - Remove an active timer from an IO descriptor.
+ * @iodesc: io descriptor
+ */
+static inline void
+qla2x00_remove_iodesc_timer(struct io_descriptor *iodesc)
+{
+	if (iodesc->timer.function != NULL) {
+		del_timer_sync(&iodesc->timer);
+		iodesc->timer.data = (unsigned long) NULL;
+		iodesc->timer.function = NULL;
+	}
+}
+
+/** 
+ * IO descriptor support routines.
+ **/
+
+/**
+ * qla2x00_update_login_fcport() - Update fcport data after login processing.
+ * @ha: HA context
+ * @mbxstat: Mailbox command status IOCB
+ * @fcport: port to update
+ */
+static inline void
+qla2x00_update_login_fcport(scsi_qla_host_t *ha, struct mbx_entry *mbxstat,
+    fc_port_t *fcport)
+{
+	if (le16_to_cpu(mbxstat->mb1) & BIT_0) {
+		fcport->port_type = FCT_INITIATOR;
+	} else {
+		fcport->port_type = FCT_TARGET;
+		if (le16_to_cpu(mbxstat->mb1) & BIT_1) {
+			fcport->flags |= FCF_TAPE_PRESENT;
+		}
+	}
+	fcport->login_retry = 0;
+	fcport->port_login_retry_count = ha->port_down_retry_count *
+	    PORT_RETRY_TIME;
+	atomic_set(&fcport->port_down_timer, ha->port_down_retry_count *
+	    PORT_RETRY_TIME);
+	fcport->flags |= FCF_FABRIC_DEVICE;
+	fcport->flags &= ~FCF_FAILOVER_NEEDED;
+	fcport->iodesc_idx_sent = IODESC_INVALID_INDEX;
+	atomic_set(&fcport->state, FCS_ONLINE);
+}
+
+
+/** 
+ * Mailbox IOCB commands.
+ **/
+
+/**
+ * qla2x00_get_mbx_iocb_entry() - Retrieve an IOCB from the request queue.
+ * @ha: HA context
+ * @handle: handle to io descriptor
+ *
+ * Returns a pointer to the reqest entry, or NULL, if none were available.
+ */
+static inline struct mbx_entry *
+qla2x00_get_mbx_iocb_entry(scsi_qla_host_t *ha, uint32_t handle)
+{
+	uint16_t cnt;
+	device_reg_t *reg;
+	struct mbx_entry *mbxentry;
+
+	reg = ha->iobase;
+	mbxentry = NULL;
+
+	if (ha->req_q_cnt < 3) {
+		cnt = qla2x00_debounce_register(ISP_REQ_Q_OUT(ha, reg));
+		if  (ha->req_ring_index < cnt)
+			ha->req_q_cnt = cnt - ha->req_ring_index;
+		else
+			ha->req_q_cnt = REQUEST_ENTRY_CNT -
+			    (ha->req_ring_index - cnt);
+	}
+	if (ha->req_q_cnt >= 3) {
+		mbxentry = (struct mbx_entry *)ha->request_ring_ptr;
+
+		memset(mbxentry, 0, sizeof(struct mbx_entry));
+		mbxentry->entry_type = MBX_IOCB_TYPE;
+		mbxentry->entry_count = 1;
+		mbxentry->sys_define1 = SOURCE_ASYNC_IOCB;
+		mbxentry->handle = handle;
+	}
+	return (mbxentry);
+}
+
+/**
+ * qla2x00_send_abort_iocb() - Issue an abort IOCB to the firmware.
+ * @ha: HA context
+ * @iodesc: io descriptor
+ * @handle_to_abort: firmware handle to abort
+ * @ha_locked: is function called with the hardware lock
+ *
+ * Returns QLA_SUCCESS if the IOCB was issued.
+ */
+static int
+qla2x00_send_abort_iocb(scsi_qla_host_t *ha, struct io_descriptor *iodesc, 
+    uint32_t handle_to_abort, int ha_locked)
+{
+	unsigned long flags = 0;
+	struct mbx_entry *mbxentry;
+
+	/* Send marker if required. */
+	if (qla2x00_issue_marker(ha, ha_locked) != QLA_SUCCESS)
+		return (QLA_FUNCTION_FAILED);
+
+	if (!ha_locked)
+		spin_lock_irqsave(&ha->hardware_lock, flags);
+
+	/* Build abort mailbox IOCB. */
+	mbxentry = qla2x00_get_mbx_iocb_entry(ha, iodesc->signature);
+	if (mbxentry == NULL) {
+		if (!ha_locked)
+			spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+		return (QLA_FUNCTION_FAILED);
+	}
+	mbxentry->mb0 = __constant_cpu_to_le16(MBC_ABORT_COMMAND);
+	mbxentry->mb1 = mbxentry->loop_id.extended =
+	    cpu_to_le16(iodesc->remote_fcport->loop_id);
+	mbxentry->mb2 = LSW(handle_to_abort);
+	mbxentry->mb3 = MSW(handle_to_abort);
+
+	qla2x00_add_iodesc_timer(iodesc);
+
+	/* Issue command to ISP. */
+	qla2x00_isp_cmd(ha);
+
+	if (!ha_locked)
+		spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+	DEBUG14(printk("scsi(%ld): Sending Abort IOCB (%08x) to [%x], aborting "
+	    "%08x.\n", ha->host_no, iodesc->signature,
+	    iodesc->remote_fcport->loop_id, handle_to_abort));
+
+	return (QLA_SUCCESS);
+}
+
+/**
+ * qla2x00_send_abort_iocb_cb() - Abort IOCB callback.
+ * @ha: HA context
+ * @iodesc: io descriptor
+ * @mbxstat: mailbox status IOCB
+ *
+ * Returns QLA_SUCCESS if @iodesc can be freed by the caller, else, @iodesc
+ * will be used for a retry.
+ */
+static int
+qla2x00_send_abort_iocb_cb(scsi_qla_host_t *ha, struct io_descriptor *iodesc,
+    struct mbx_entry *mbxstat)
+{
+	DEBUG14(printk("scsi(%ld): Abort IOCB -- sent to [%x/%02x%02x%02x], "
+	    "status=%x mb0=%x.\n", ha->host_no, iodesc->remote_fcport->loop_id,
+	    iodesc->d_id.b.domain, iodesc->d_id.b.area, iodesc->d_id.b.al_pa,
+	    le16_to_cpu(mbxstat->status), le16_to_cpu(mbxstat->mb0)));
+
+	return (QLA_SUCCESS);
+}
+
+
+/**
+ * qla2x00_send_adisc_iocb() - Issue a Get Port Database IOCB to the firmware.
+ * @ha: HA context
+ * @iodesc: io descriptor
+ * @ha_locked: is function called with the hardware lock
+ *
+ * Returns QLA_SUCCESS if the IOCB was issued.
+ */
+static int
+qla2x00_send_adisc_iocb(scsi_qla_host_t *ha, struct io_descriptor *iodesc,
+    int ha_locked)
+{
+	unsigned long flags = 0;
+	struct mbx_entry *mbxentry;
+
+	/* Send marker if required. */
+	if (qla2x00_issue_marker(ha, ha_locked) != QLA_SUCCESS)
+		return (QLA_FUNCTION_FAILED);
+
+	if (!ha_locked)
+		spin_lock_irqsave(&ha->hardware_lock, flags);
+
+	/* Build Get Port Database IOCB. */
+	mbxentry = qla2x00_get_mbx_iocb_entry(ha, iodesc->signature);
+	if (mbxentry == NULL) {
+		if (!ha_locked)
+			spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+		return (QLA_FUNCTION_FAILED);
+	}
+	mbxentry->mb0 = __constant_cpu_to_le16(MBC_GET_PORT_DATABASE);
+	mbxentry->mb1 = mbxentry->loop_id.extended =
+	    cpu_to_le16(iodesc->remote_fcport->loop_id);
+	mbxentry->mb2 = cpu_to_le16(MSW(LSD(ha->iodesc_pd_dma)));
+	mbxentry->mb3 = cpu_to_le16(LSW(LSD(ha->iodesc_pd_dma)));
+	mbxentry->mb6 = cpu_to_le16(MSW(MSD(ha->iodesc_pd_dma)));
+	mbxentry->mb7 = cpu_to_le16(LSW(MSD(ha->iodesc_pd_dma)));
+	mbxentry->mb10 = __constant_cpu_to_le16(BIT_0);
+
+	qla2x00_add_iodesc_timer(iodesc);
+
+	/* Issue command to ISP. */
+	qla2x00_isp_cmd(ha);
+
+	if (!ha_locked)
+		spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+	DEBUG14(printk("scsi(%ld): Sending Adisc IOCB (%08x) to [%x].\n",
+	    ha->host_no, iodesc->signature, iodesc->remote_fcport->loop_id));
+
+	return (QLA_SUCCESS);
+}
+
+/**
+ * qla2x00_send_adisc_iocb_cb() - Get Port Database IOCB callback.
+ * @ha: HA context
+ * @iodesc: io descriptor
+ * @mbxstat: mailbox status IOCB
+ *
+ * Returns QLA_SUCCESS if @iodesc can be freed by the caller, else, @iodesc
+ * will be used for a retry.
+ */
+static int
+qla2x00_send_adisc_iocb_cb(scsi_qla_host_t *ha, struct io_descriptor *iodesc,
+    struct mbx_entry *mbxstat)
+{
+	fc_port_t *remote_fcport;
+
+	remote_fcport = iodesc->remote_fcport;
+
+	/* Ensure the port IDs are consistent. */
+	if (remote_fcport->d_id.b24 != iodesc->d_id.b24) {
+		DEBUG14(printk("scsi(%ld): Adisc IOCB -- ignoring, remote port "
+		    "id changed from [%02x%02x%02x] to [%02x%02x%02x].\n",
+		    ha->host_no, remote_fcport->d_id.b.domain,
+		    remote_fcport->d_id.b.area, remote_fcport->d_id.b.al_pa,
+		    iodesc->d_id.b.domain, iodesc->d_id.b.area,
+		    iodesc->d_id.b.al_pa));
+
+		return (QLA_SUCCESS);
+	}
+
+	/* Only process the last command. */
+	if (remote_fcport->iodesc_idx_sent != iodesc->idx) {
+		DEBUG14(printk("scsi(%ld): Adisc IOCB -- ignoring, sent to "
+		    "[%02x%02x%02x], expected %x, received %x.\n", ha->host_no,
+		    iodesc->d_id.b.domain, iodesc->d_id.b.area,
+		    iodesc->d_id.b.al_pa, remote_fcport->iodesc_idx_sent,
+		    iodesc->idx));
+
+		return (QLA_SUCCESS);
+	}
+
+	if (le16_to_cpu(mbxstat->status) == CS_COMPLETE) {
+		DEBUG14(printk("scsi(%ld): Adisc IOCB -- marking "
+		    "[%x/%02x%02x%02x] online.\n", ha->host_no,
+		    remote_fcport->loop_id, remote_fcport->d_id.b.domain,
+		    remote_fcport->d_id.b.area, remote_fcport->d_id.b.al_pa));
+
+		atomic_set(&remote_fcport->state, FCS_ONLINE);
+	} else {
+		DEBUG14(printk("scsi(%ld): Adisc IOCB -- marking "
+		    "[%x/%02x%02x%02x] lost, status=%x mb0=%x.\n", ha->host_no,
+		    remote_fcport->loop_id, remote_fcport->d_id.b.domain,
+		    remote_fcport->d_id.b.area, remote_fcport->d_id.b.al_pa,
+		    le16_to_cpu(mbxstat->status), le16_to_cpu(mbxstat->mb0)));
+
+		if (atomic_read(&remote_fcport->state) != FCS_DEVICE_DEAD)
+			atomic_set(&remote_fcport->state, FCS_DEVICE_LOST);
+	}
+	remote_fcport->iodesc_idx_sent = IODESC_INVALID_INDEX;
+
+	return (QLA_SUCCESS);
+}
+
+
+/**
+ * qla2x00_send_logout_iocb() - Issue a fabric port logout IOCB to the firmware.
+ * @ha: HA context
+ * @iodesc: io descriptor
+ * @ha_locked: is function called with the hardware lock
+ *
+ * Returns QLA_SUCCESS if the IOCB was issued.
+ */
+static int
+qla2x00_send_logout_iocb(scsi_qla_host_t *ha, struct io_descriptor *iodesc,
+    int ha_locked)
+{
+	unsigned long flags = 0;
+	struct mbx_entry *mbxentry;
+
+	/* Send marker if required. */
+	if (qla2x00_issue_marker(ha, ha_locked) != QLA_SUCCESS)
+		return (QLA_FUNCTION_FAILED);
+
+	if (!ha_locked)
+		spin_lock_irqsave(&ha->hardware_lock, flags);
+
+	/* Build fabric port logout mailbox IOCB. */
+	mbxentry = qla2x00_get_mbx_iocb_entry(ha, iodesc->signature);
+	if (mbxentry == NULL) {
+		if (!ha_locked)
+			spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+		return (QLA_FUNCTION_FAILED);
+	}
+	mbxentry->mb0 = __constant_cpu_to_le16(MBC_LOGOUT_FABRIC_PORT);
+	mbxentry->mb1 = mbxentry->loop_id.extended =
+	    cpu_to_le16(iodesc->remote_fcport->loop_id);
+
+	qla2x00_add_iodesc_timer(iodesc);
+
+	/* Issue command to ISP. */
+	qla2x00_isp_cmd(ha);
+
+	if (!ha_locked)
+		spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+	DEBUG14(printk("scsi(%ld): Sending Logout IOCB (%08x) to [%x].\n",
+	    ha->host_no, iodesc->signature, iodesc->remote_fcport->loop_id));
+
+	return (QLA_SUCCESS);
+}
+
+/**
+ * qla2x00_send_logout_iocb_cb() - Fabric port logout IOCB callback.
+ * @ha: HA context
+ * @iodesc: io descriptor
+ * @mbxstat: mailbox status IOCB
+ *
+ * Returns QLA_SUCCESS if @iodesc can be freed by the caller, else, @iodesc
+ * will be used for a retry.
+ */
+static int
+qla2x00_send_logout_iocb_cb(scsi_qla_host_t *ha, struct io_descriptor *iodesc,
+    struct mbx_entry *mbxstat)
+{
+	DEBUG14(printk("scsi(%ld): Logout IOCB -- sent to [%x/%02x%02x%02x], "
+	    "status=%x mb0=%x mb1=%x.\n", ha->host_no,
+	    iodesc->remote_fcport->loop_id,
+	    iodesc->remote_fcport->d_id.b.domain,
+	    iodesc->remote_fcport->d_id.b.area,
+	    iodesc->remote_fcport->d_id.b.al_pa, le16_to_cpu(mbxstat->status),
+	    le16_to_cpu(mbxstat->mb0), le16_to_cpu(mbxstat->mb1)));
+
+	return (QLA_SUCCESS);
+}
+
+
+/**
+ * qla2x00_send_login_iocb() - Issue a fabric port login IOCB to the firmware.
+ * @ha: HA context
+ * @iodesc: io descriptor
+ * @d_id: port id for device
+ * @ha_locked: is function called with the hardware lock
+ *
+ * Returns QLA_SUCCESS if the IOCB was issued.
+ */
+static int
+qla2x00_send_login_iocb(scsi_qla_host_t *ha, struct io_descriptor *iodesc,
+    port_id_t *d_id, int ha_locked)
+{
+	unsigned long flags = 0;
+	struct mbx_entry *mbxentry;
+
+	/* Send marker if required. */
+	if (qla2x00_issue_marker(ha, ha_locked) != QLA_SUCCESS)
+		return (QLA_FUNCTION_FAILED);
+
+	if (!ha_locked)
+		spin_lock_irqsave(&ha->hardware_lock, flags);
+
+	/* Build fabric port login mailbox IOCB. */
+	mbxentry = qla2x00_get_mbx_iocb_entry(ha, iodesc->signature);
+	if (mbxentry == NULL) {
+		if (!ha_locked)
+			spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+		return (QLA_FUNCTION_FAILED);
+	}
+	mbxentry->mb0 = __constant_cpu_to_le16(MBC_LOGIN_FABRIC_PORT);
+	mbxentry->mb1 = mbxentry->loop_id.extended =
+	    cpu_to_le16(iodesc->remote_fcport->loop_id);
+	mbxentry->mb2 = cpu_to_le16(d_id->b.domain);
+	mbxentry->mb3 = cpu_to_le16(d_id->b.area << 8 | d_id->b.al_pa);
+	mbxentry->mb10 = __constant_cpu_to_le16(BIT_0);
+
+	qla2x00_add_iodesc_timer(iodesc);
+
+	/* Issue command to ISP. */
+	qla2x00_isp_cmd(ha);
+
+	if (!ha_locked)
+		spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+	DEBUG14(printk("scsi(%ld): Sending Login IOCB (%08x) to "
+	    "[%x/%02x%02x%02x].\n", ha->host_no, iodesc->signature,
+	    iodesc->remote_fcport->loop_id, d_id->b.domain, d_id->b.area,
+	    d_id->b.al_pa));
+
+	return (QLA_SUCCESS);
+}
+
+/**
+ * qla2x00_send_login_iocb_cb() - Fabric port logout IOCB callback.
+ * @ha: HA context
+ * @iodesc: io descriptor
+ * @mbxstat: mailbox status IOCB
+ *
+ * Returns QLA_SUCCESS if @iodesc can be freed by the caller, else, @iodesc
+ * will be used for a retry.
+ */
+static int
+qla2x00_send_login_iocb_cb(scsi_qla_host_t *ha, struct io_descriptor *iodesc,
+    struct mbx_entry *mbxstat)
+{
+	int rval;
+	fc_port_t *fcport, *remote_fcport, *exist_fcport;
+	struct io_descriptor *abort_iodesc, *login_iodesc;
+	uint16_t status, mb[8];
+	uint16_t reuse;
+	uint16_t remote_loopid;
+	port_id_t remote_did, inuse_did;
+
+	remote_fcport = iodesc->remote_fcport;
+
+	/* Only process the last command. */
+	if (remote_fcport->iodesc_idx_sent != iodesc->idx) {
+		DEBUG14(printk("scsi(%ld): Login IOCB -- ignoring, sent to "
+		    "[%02x%02x%02x], expected %x, received %x.\n", 
+		    ha->host_no, iodesc->d_id.b.domain, iodesc->d_id.b.area,
+		    iodesc->d_id.b.al_pa, remote_fcport->iodesc_idx_sent,
+		    iodesc->idx));
+
+		/* Free RSCN fcport resources. */
+		if (remote_fcport->port_type == FCT_RSCN) {
+			DEBUG14(printk("scsi(%ld): Login IOCB -- Freeing RSCN "
+			    "fcport %p [%x/%02x%02x%02x] given ignored Login "
+			    "IOCB.\n", ha->host_no, remote_fcport,
+			    remote_fcport->loop_id,
+			    remote_fcport->d_id.b.domain,
+			    remote_fcport->d_id.b.area,
+			    remote_fcport->d_id.b.al_pa));
+
+			list_del(&remote_fcport->list);
+			kfree(remote_fcport);
+		}
+		return (QLA_SUCCESS);
+	}
+
+	status = le16_to_cpu(mbxstat->status);
+	mb[0] = le16_to_cpu(mbxstat->mb0);
+	mb[1] = le16_to_cpu(mbxstat->mb1);
+	mb[2] = le16_to_cpu(mbxstat->mb2);
+	mb[6] = le16_to_cpu(mbxstat->mb6);
+	mb[7] = le16_to_cpu(mbxstat->mb7);
+
+	/* Good status? */
+	if ((status == CS_COMPLETE || status == CS_COMPLETE_CHKCOND) &&
+	    mb[0] == MBS_COMMAND_COMPLETE) {
+
+		DEBUG14(printk("scsi(%ld): Login IOCB -- status=%x mb1=%x pn="
+		    "%02x%02x%02x%02x%02x%02x%02x%02x.\n", ha->host_no, status,
+		    mb[1], mbxstat->port_name[0], mbxstat->port_name[1], 
+		    mbxstat->port_name[2], mbxstat->port_name[3], 
+		    mbxstat->port_name[4], mbxstat->port_name[5], 
+		    mbxstat->port_name[6], mbxstat->port_name[7]));
+
+		memcpy(remote_fcport->node_name, mbxstat->node_name, WWN_SIZE);
+		memcpy(remote_fcport->port_name, mbxstat->port_name, WWN_SIZE);
+
+		/* Is the device already in our fcports list? */
+		if (remote_fcport->port_type != FCT_RSCN) {
+			DEBUG14(printk("scsi(%ld): Login IOCB -- marking "
+			    "[%x/%02x%02x%02x] online.\n", ha->host_no,
+			    remote_fcport->loop_id,
+			    remote_fcport->d_id.b.domain,
+			    remote_fcport->d_id.b.area,
+			    remote_fcport->d_id.b.al_pa));
+
+			qla2x00_update_login_fcport(ha, mbxstat, remote_fcport);
+
+			return (QLA_SUCCESS);
+		}
+
+		/* Does the RSCN portname already exist in our fcports list? */
+		exist_fcport = NULL;
+		list_for_each_entry(fcport, &ha->fcports, list) {
+			if (memcmp(remote_fcport->port_name, fcport->port_name,
+			    WWN_SIZE) == 0) {
+				exist_fcport = fcport;
+				break;
+			}
+		}
+		if (exist_fcport != NULL) {
+			DEBUG14(printk("scsi(%ld): Login IOCB -- found RSCN "
+			    "fcport in fcports list [%p].\n", ha->host_no,
+			    exist_fcport));
+
+			/* Abort any ADISC that could have been sent. */
+			if (exist_fcport->iodesc_idx_sent != iodesc->idx &&
+			    exist_fcport->iodesc_idx_sent <
+			    MAX_IO_DESCRIPTORS &&
+			    ha->io_descriptors[exist_fcport->iodesc_idx_sent].
+			    cb_idx == ADISC_PORT_IOCB_CB) {
+
+				abort_iodesc = qla2x00_alloc_iodesc(ha);
+				if (abort_iodesc) {
+					DEBUG14(printk("scsi(%ld): Login IOCB "
+					    "-- issuing abort to outstanding "
+					    "Adisc [%x/%02x%02x%02x].\n",
+					    ha->host_no, remote_fcport->loop_id,
+					    exist_fcport->d_id.b.domain,
+					    exist_fcport->d_id.b.area,
+					    exist_fcport->d_id.b.al_pa));
+
+					abort_iodesc->cb_idx = ABORT_IOCB_CB;
+					abort_iodesc->d_id.b24 =
+					    exist_fcport->d_id.b24;
+					abort_iodesc->remote_fcport =
+					    exist_fcport;
+					exist_fcport->iodesc_idx_sent =
+					    abort_iodesc->idx;
+					qla2x00_send_abort_iocb(ha,
+					    abort_iodesc, ha->io_descriptors[
+					     exist_fcport->iodesc_idx_sent].
+					      signature, 1);
+				} else {
+					DEBUG14(printk("scsi(%ld): Login IOCB "
+					    "-- unable to abort outstanding "
+					    "Adisc [%x/%02x%02x%02x].\n",
+					    ha->host_no, remote_fcport->loop_id,
+					    exist_fcport->d_id.b.domain,
+					    exist_fcport->d_id.b.area,
+					    exist_fcport->d_id.b.al_pa));
+				}
+			}
+
+			/*
+			 * If the existing fcport is waiting to send an ADISC
+			 * or LOGIN, then reuse remote fcport (RSCN) to
+			 * continue waiting.
+			 */
+			reuse = 0;
+			remote_loopid = remote_fcport->loop_id;
+			remote_did.b24 = remote_fcport->d_id.b24;
+			if (exist_fcport->iodesc_idx_sent ==
+			    IODESC_ADISC_NEEDED ||
+			    exist_fcport->iodesc_idx_sent ==
+			    IODESC_LOGIN_NEEDED) {
+				DEBUG14(printk("scsi(%ld): Login IOCB -- "
+				    "existing fcport [%x/%02x%02x%02x] "
+				    "waiting for IO descriptor, reuse RSCN "
+				    "fcport.\n", ha->host_no,
+				    exist_fcport->loop_id,
+				    exist_fcport->d_id.b.domain,
+				    exist_fcport->d_id.b.area,
+				    exist_fcport->d_id.b.al_pa));
+
+				reuse++;
+				remote_fcport->iodesc_idx_sent =
+				    exist_fcport->iodesc_idx_sent;
+				exist_fcport->iodesc_idx_sent =
+				    IODESC_INVALID_INDEX;
+				remote_fcport->loop_id = exist_fcport->loop_id;
+				remote_fcport->d_id.b24 =
+				    exist_fcport->d_id.b24;
+			}
+
+			/* Logout the old loopid. */
+			if (!reuse &&
+			    exist_fcport->loop_id != remote_fcport->loop_id &&
+			    exist_fcport->loop_id != FC_NO_LOOP_ID) {
+				login_iodesc = qla2x00_alloc_iodesc(ha);
+				if (login_iodesc) {
+					DEBUG14(printk("scsi(%ld): Login IOCB "
+					    "-- issuing logout to free old "
+					    "loop id [%x/%02x%02x%02x].\n",
+					    ha->host_no, exist_fcport->loop_id,
+					    exist_fcport->d_id.b.domain,
+					    exist_fcport->d_id.b.area,
+					    exist_fcport->d_id.b.al_pa));
+
+					login_iodesc->cb_idx =
+					    LOGOUT_PORT_IOCB_CB;
+					login_iodesc->d_id.b24 =
+					    exist_fcport->d_id.b24;
+					login_iodesc->remote_fcport =
+					    exist_fcport;
+					exist_fcport->iodesc_idx_sent =
+					    login_iodesc->idx;
+					qla2x00_send_logout_iocb(ha,
+					    login_iodesc, 1);
+				} else {
+					/* Ran out of IO descriptiors. */
+					DEBUG14(printk("scsi(%ld): Login IOCB "
+					    "-- unable to logout to free old "
+					    "loop id [%x/%02x%02x%02x].\n",
+					    ha->host_no, exist_fcport->loop_id,
+					    exist_fcport->d_id.b.domain,
+					    exist_fcport->d_id.b.area,
+					    exist_fcport->d_id.b.al_pa));
+
+					exist_fcport->iodesc_idx_sent =
+					    IODESC_INVALID_INDEX;
+				}
+
+			}
+
+			/* Update existing fcport with remote fcport info. */
+			DEBUG14(printk("scsi(%ld): Login IOCB -- marking "
+			    "existing fcport [%x/%02x%02x%02x] online.\n",
+			    ha->host_no, remote_loopid, remote_did.b.domain,
+			    remote_did.b.area, remote_did.b.al_pa));
+
+			memcpy(exist_fcport->node_name,
+			    remote_fcport->node_name, WWN_SIZE);
+			exist_fcport->loop_id = remote_loopid;
+			exist_fcport->d_id.b24 = remote_did.b24;
+			qla2x00_update_login_fcport(ha, mbxstat, exist_fcport);
+
+			/* Finally, free the remote (RSCN) fcport. */
+			if (!reuse) {
+				DEBUG14(printk("scsi(%ld): Login IOCB -- "
+				    "Freeing RSCN fcport %p "
+				    "[%x/%02x%02x%02x].\n", ha->host_no,
+				    remote_fcport, remote_fcport->loop_id,
+				    remote_fcport->d_id.b.domain,
+				    remote_fcport->d_id.b.area,
+				    remote_fcport->d_id.b.al_pa));
+
+				list_del(&remote_fcport->list);
+				kfree(remote_fcport);
+			}
+
+			return (QLA_SUCCESS);
+		}
+
+		/*
+		 * A new device has been added, move the RSCN fcport to our
+		 * fcports list.
+		 */
+		DEBUG14(printk("scsi(%ld): Login IOCB -- adding RSCN fcport "
+		    "[%x/%02x%02x%02x] to fcports list.\n", ha->host_no,
+		    remote_fcport->loop_id, remote_fcport->d_id.b.domain,
+		    remote_fcport->d_id.b.area, remote_fcport->d_id.b.al_pa));
+
+		list_del(&remote_fcport->list);
+		remote_fcport->flags = (FCF_RLC_SUPPORT | FCF_RESCAN_NEEDED);
+		qla2x00_update_login_fcport(ha, mbxstat, remote_fcport);
+		list_add_tail(&remote_fcport->list, &ha->fcports);
+		set_bit(FCPORT_RESCAN_NEEDED, &ha->dpc_flags);
+	} else {
+		/* Handle login failure. */
+		if (remote_fcport->login_retry != 0) {
+			if (mb[0] == MBS_LOOP_ID_USED) {
+				inuse_did.b.domain = LSB(mb[1]);
+				inuse_did.b.area = MSB(mb[2]);
+				inuse_did.b.al_pa = LSB(mb[2]);
+
+				DEBUG14(printk("scsi(%ld): Login IOCB -- loop "
+				    "id [%x] used by port id [%02x%02x%02x].\n",
+				    ha->host_no, remote_fcport->loop_id,
+				    inuse_did.b.domain, inuse_did.b.area,
+				    inuse_did.b.al_pa));
+
+				if (remote_fcport->d_id.b24 ==
+				    INVALID_PORT_ID) {
+					/*
+					 * Invalid port id means we are trying
+					 * to login to a remote port with just
+					 * a loop id without knowing about the
+					 * port id.  Copy the port id and try
+					 * again.
+					 */
+					remote_fcport->d_id.b24 = inuse_did.b24;
+					iodesc->d_id.b24 = inuse_did.b24;
+				} else {
+					remote_fcport->loop_id++;
+					rval = qla2x00_find_new_loop_id(ha,
+					    remote_fcport);
+					if (rval == QLA_FUNCTION_FAILED) {
+						/* No more loop ids. */
+						return (QLA_SUCCESS);
+					}
+				}
+			} else if (mb[0] == MBS_PORT_ID_USED) {
+				/*
+				 * Device has another loop ID.  The firmware
+				 * group recommends the driver perform an
+				 * implicit login with the specified ID.
+				 */
+				DEBUG14(printk("scsi(%ld): Login IOCB -- port "
+				    "id [%02x%02x%02x] already assigned to "
+				    "loop id [%x].\n", ha->host_no,
+				    iodesc->d_id.b.domain, iodesc->d_id.b.area,
+				    iodesc->d_id.b.al_pa, mb[1]));
+
+				remote_fcport->loop_id = mb[1];
+
+			} else {
+				/* Unable to perform login, try again. */
+				DEBUG14(printk("scsi(%ld): Login IOCB -- "
+				    "failed login [%x/%02x%02x%02x], status=%x "
+				    "mb0=%x mb1=%x mb2=%x mb6=%x mb7=%x.\n",
+				    ha->host_no, remote_fcport->loop_id,
+				    iodesc->d_id.b.domain, iodesc->d_id.b.area,
+				    iodesc->d_id.b.al_pa, status, mb[0], mb[1],
+				    mb[2], mb[6], mb[7]));
+			}
+
+			/* Reissue Login with the same IO descriptor. */
+			iodesc->signature =
+			    qla2x00_iodesc_to_handle(iodesc);
+			iodesc->cb_idx = LOGIN_PORT_IOCB_CB;
+			iodesc->d_id.b24 = remote_fcport->d_id.b24;
+			remote_fcport->iodesc_idx_sent = iodesc->idx;
+			remote_fcport->login_retry--;
+
+			DEBUG14(printk("scsi(%ld): Login IOCB -- retrying "
+			    "login to [%x/%02x%02x%02x] (%d).\n", ha->host_no,
+			    remote_fcport->loop_id,
+			    remote_fcport->d_id.b.domain,
+			    remote_fcport->d_id.b.area,
+			    remote_fcport->d_id.b.al_pa,
+			    remote_fcport->login_retry));
+
+			qla2x00_send_login_iocb(ha, iodesc,
+			    &remote_fcport->d_id, 1);
+
+			return (QLA_FUNCTION_FAILED);
+		} else {
+			/* No more logins, mark device dead. */
+			DEBUG14(printk("scsi(%ld): Login IOCB -- failed "
+			    "login [%x/%02x%02x%02x] after retries, status=%x "
+			    "mb0=%x mb1=%x mb2=%x mb6=%x mb7=%x.\n",
+			    ha->host_no, remote_fcport->loop_id,
+			    iodesc->d_id.b.domain, iodesc->d_id.b.area,
+			    iodesc->d_id.b.al_pa, status, mb[0], mb[1],
+			    mb[2], mb[6], mb[7]));
+
+			atomic_set(&remote_fcport->state, FCS_DEVICE_DEAD);
+			if (remote_fcport->port_type == FCT_RSCN) {
+				DEBUG14(printk("scsi(%ld): Login IOCB -- "
+				    "Freeing dead RSCN fcport %p "
+				    "[%x/%02x%02x%02x].\n", ha->host_no,
+				    remote_fcport, remote_fcport->loop_id,
+				    remote_fcport->d_id.b.domain,
+				    remote_fcport->d_id.b.area,
+				    remote_fcport->d_id.b.al_pa));
+
+				list_del(&remote_fcport->list);
+				kfree(remote_fcport);
+			}
+		}
+	}
+
+	return (QLA_SUCCESS);
+}
+
+
+/** 
+ * IO descriptor processing routines.
+ **/
+
+/**
+ * qla2x00_alloc_rscn_fcport() - Allocate an RSCN type fcport.
+ * @ha: HA context
+ * @flags: allocation flags
+ *
+ * Returns a pointer to the allocated RSCN fcport, or NULL, if none available.
+ */
+fc_port_t *
+qla2x00_alloc_rscn_fcport(scsi_qla_host_t *ha, int flags)
+{
+	fc_port_t *fcport;
+
+	fcport = qla2x00_alloc_fcport(ha, flags);
+	if (fcport == NULL)
+		return (fcport);
+
+	/* Setup RSCN fcport structure. */
+	fcport->port_type = FCT_RSCN;
+
+	return (fcport);
+}
+
+/**
+ * qla2x00_handle_port_rscn() - Handle port RSCN.
+ * @ha: HA context
+ * @rscn_entry: RSCN entry
+ * @fcport: fcport entry to updated
+ *
+ * Returns QLA_SUCCESS if the port RSCN was handled.
+ */
+int
+qla2x00_handle_port_rscn(scsi_qla_host_t *ha, uint32_t rscn_entry,
+    fc_port_t *known_fcport, int ha_locked)
+{
+	int	rval;
+	port_id_t rscn_pid;
+	fc_port_t *fcport, *remote_fcport, *rscn_fcport;
+	struct io_descriptor *iodesc;
+
+	remote_fcport = NULL;
+	rscn_fcport = NULL;
+
+	/* Prepare port id based on incoming entries. */
+	if (known_fcport) {
+		rscn_pid.b24 = known_fcport->d_id.b24;
+		remote_fcport = known_fcport;
+
+		DEBUG14(printk("scsi(%ld): Handle RSCN -- process RSCN for "
+		    "fcport [%02x%02x%02x].\n", ha->host_no,
+		    remote_fcport->d_id.b.domain, remote_fcport->d_id.b.area,
+		    remote_fcport->d_id.b.al_pa));
+	} else {
+		rscn_pid.b.domain = LSB(MSW(rscn_entry));
+		rscn_pid.b.area = MSB(LSW(rscn_entry));
+		rscn_pid.b.al_pa = LSB(LSW(rscn_entry));
+
+		DEBUG14(printk("scsi(%ld): Handle RSCN -- process RSCN for "
+		    "port id [%02x%02x%02x].\n", ha->host_no,
+		    rscn_pid.b.domain, rscn_pid.b.area, rscn_pid.b.al_pa));
+
+		/*
+		 * Search fcport lists for a known entry at the specified port
+		 * ID.
+		 */
+		list_for_each_entry(fcport, &ha->fcports, list) {
+		    if (rscn_pid.b24 == fcport->d_id.b24) {
+			    remote_fcport = fcport;
+			    break;
+		    }
+		}
+		list_for_each_entry(fcport, &ha->rscn_fcports, list) {
+		    if (rscn_pid.b24 == fcport->d_id.b24) {
+			    rscn_fcport = fcport;
+			    break;
+		    }
+		}
+		if (remote_fcport == NULL)
+		    remote_fcport = rscn_fcport;
+	}
+
+	/* 
+	 * If the port is already in our fcport list and online, send an ADISC
+	 * to see if it's still alive.  Issue login if a new fcport or the known
+	 * fcport is currently offline.
+	 */
+	if (remote_fcport) {
+		/*
+		 * No need to send request if the remote fcport is currently
+		 * waiting for an available io descriptor.
+		 */
+		if (known_fcport == NULL &&
+		    (remote_fcport->iodesc_idx_sent == IODESC_ADISC_NEEDED ||
+		    remote_fcport->iodesc_idx_sent == IODESC_LOGIN_NEEDED)) {
+			/*
+			 * If previous waiting io descriptor is an ADISC, then
+			 * the new RSCN may come from a new remote fcport being
+			 * plugged into the same location.
+			 */
+			if (remote_fcport->port_type == FCT_RSCN) {
+			    remote_fcport->iodesc_idx_sent =
+				IODESC_LOGIN_NEEDED;
+			} else if (remote_fcport->iodesc_idx_sent ==
+			    IODESC_ADISC_NEEDED) {
+				fc_port_t *new_fcport;
+
+				remote_fcport->iodesc_idx_sent =
+				    IODESC_INVALID_INDEX;
+
+				/* Create new fcport for later login. */
+				new_fcport = qla2x00_alloc_rscn_fcport(ha,
+				    ha_locked ? GFP_ATOMIC: GFP_KERNEL);
+				if (new_fcport) {
+					DEBUG14(printk("scsi(%ld): Handle RSCN "
+					    "-- creating RSCN fcport %p for "
+					    "future login.\n", ha->host_no,
+					    new_fcport));
+
+					new_fcport->d_id.b24 =
+					    remote_fcport->d_id.b24;
+					new_fcport->iodesc_idx_sent =
+					    IODESC_LOGIN_NEEDED;
+
+					list_add_tail(&new_fcport->list,
+					    &ha->rscn_fcports);
+					set_bit(IODESC_PROCESS_NEEDED,
+					    &ha->dpc_flags);
+				} else {
+					DEBUG14(printk("scsi(%ld): Handle RSCN "
+					    "-- unable to allocate RSCN fcport "
+					    "for future login.\n",
+					    ha->host_no));
+				}
+			}
+			return (QLA_SUCCESS);
+		}
+		
+		/* Send ADISC if the fcport is online */
+		if (atomic_read(&remote_fcport->state) == FCS_ONLINE ||
+		    remote_fcport->iodesc_idx_sent == IODESC_ADISC_NEEDED) {
+
+			atomic_set(&remote_fcport->state, FCS_DEVICE_LOST);
+
+			iodesc = qla2x00_alloc_iodesc(ha);
+			if (iodesc == NULL) {
+				/* Mark fcport for later adisc processing */
+				DEBUG14(printk("scsi(%ld): Handle RSCN -- not "
+				    "enough IO descriptors for Adisc, flag "
+				    "for later processing.\n", ha->host_no));
+
+				remote_fcport->iodesc_idx_sent =
+				    IODESC_ADISC_NEEDED;
+				set_bit(IODESC_PROCESS_NEEDED, &ha->dpc_flags);
+
+				return (QLA_SUCCESS);
+			}
+
+			iodesc->cb_idx = ADISC_PORT_IOCB_CB;
+			iodesc->d_id.b24 = rscn_pid.b24;
+			iodesc->remote_fcport = remote_fcport;
+			remote_fcport->iodesc_idx_sent = iodesc->idx;
+			qla2x00_send_adisc_iocb(ha, iodesc, ha_locked);
+
+			return (QLA_SUCCESS);
+		} else if (remote_fcport->iodesc_idx_sent <
+		    MAX_IO_DESCRIPTORS &&
+		    ha->io_descriptors[remote_fcport->iodesc_idx_sent].cb_idx ==
+		    ADISC_PORT_IOCB_CB) {
+			/*
+			 * Receiving another RSCN while an ADISC is pending,
+			 * abort the IOCB.  Use the same descriptor for the
+			 * abort.
+			 */
+			uint32_t handle_to_abort;
+			
+			iodesc = &ha->io_descriptors[
+				remote_fcport->iodesc_idx_sent];
+			qla2x00_remove_iodesc_timer(iodesc);
+			handle_to_abort = iodesc->signature;
+			iodesc->signature = qla2x00_iodesc_to_handle(iodesc);
+			iodesc->cb_idx = ABORT_IOCB_CB;
+			iodesc->d_id.b24 = remote_fcport->d_id.b24;
+			iodesc->remote_fcport = remote_fcport;
+			remote_fcport->iodesc_idx_sent = iodesc->idx;
+
+			DEBUG14(printk("scsi(%ld): Handle RSCN -- issuing "
+			    "abort to outstanding Adisc [%x/%02x%02x%02x].\n",
+			    ha->host_no, remote_fcport->loop_id,
+			    iodesc->d_id.b.domain, iodesc->d_id.b.area,
+			    iodesc->d_id.b.al_pa));
+
+			qla2x00_send_abort_iocb(ha, iodesc, handle_to_abort,
+			    ha_locked);
+		}
+	}
+
+	/* We need to login to the remote port, find it. */
+	if (known_fcport) {
+		remote_fcport = known_fcport;
+	} else if (rscn_fcport && rscn_fcport->d_id.b24 != INVALID_PORT_ID &&
+	    rscn_fcport->iodesc_idx_sent < MAX_IO_DESCRIPTORS &&
+	    ha->io_descriptors[rscn_fcport->iodesc_idx_sent].cb_idx ==
+	    LOGIN_PORT_IOCB_CB) {
+		/*
+		 * Ignore duplicate RSCN on fcport which has already
+		 * initiated a login IOCB.
+		 */
+		DEBUG14(printk("scsi(%ld): Handle RSCN -- ignoring, login "
+		    "already sent to [%02x%02x%02x].\n", ha->host_no,
+		    rscn_fcport->d_id.b.domain, rscn_fcport->d_id.b.area,
+		    rscn_fcport->d_id.b.al_pa));
+
+		return (QLA_SUCCESS);
+	} else if (rscn_fcport && rscn_fcport->d_id.b24 != INVALID_PORT_ID &&
+	    rscn_fcport != remote_fcport) {
+		/* Reuse same rscn fcport. */
+		DEBUG14(printk("scsi(%ld): Handle RSCN -- reusing RSCN fcport "
+		    "[%02x%02x%02x].\n", ha->host_no,
+		    rscn_fcport->d_id.b.domain, rscn_fcport->d_id.b.area,
+		    rscn_fcport->d_id.b.al_pa));
+
+		remote_fcport = rscn_fcport;
+	} else {
+		/* Create new fcport for later login. */
+		remote_fcport = qla2x00_alloc_rscn_fcport(ha,
+		    ha_locked ? GFP_ATOMIC: GFP_KERNEL);
+		list_add_tail(&remote_fcport->list, &ha->rscn_fcports);
+	}
+	if (remote_fcport == NULL)
+		return (QLA_SUCCESS);
+
+	/* Prepare fcport for login. */
+	atomic_set(&remote_fcport->state, FCS_DEVICE_LOST);
+	remote_fcport->login_retry = 3; /* ha->login_retry_count; */
+	remote_fcport->d_id.b24 = rscn_pid.b24;
+
+	iodesc = qla2x00_alloc_iodesc(ha);
+	if (iodesc == NULL) {
+		/* Mark fcport for later adisc processing. */
+		DEBUG14(printk("scsi(%ld): Handle RSCN -- not enough IO "
+		    "descriptors for Login, flag for later processing.\n",
+		    ha->host_no));
+
+		remote_fcport->iodesc_idx_sent = IODESC_LOGIN_NEEDED;
+		set_bit(IODESC_PROCESS_NEEDED, &ha->dpc_flags);
+
+		return (QLA_SUCCESS);
+	}
+
+	if (known_fcport == NULL || rscn_pid.b24 != INVALID_PORT_ID) {
+		remote_fcport->loop_id = ha->min_external_loopid;
+
+		rval = qla2x00_find_new_loop_id(ha, remote_fcport);
+		if (rval == QLA_FUNCTION_FAILED) {
+			/* No more loop ids, failed. */
+			DEBUG14(printk("scsi(%ld): Handle RSCN -- no available "
+			    "loop id to perform Login, failed.\n",
+			    ha->host_no));
+
+			return (rval);
+		}
+	}
+
+	iodesc->cb_idx = LOGIN_PORT_IOCB_CB;
+	iodesc->d_id.b24 = rscn_pid.b24;
+	iodesc->remote_fcport = remote_fcport;
+	remote_fcport->iodesc_idx_sent = iodesc->idx;
+
+	DEBUG14(printk("scsi(%ld): Handle RSCN -- attempting login to "
+	    "[%x/%02x%02x%02x].\n", ha->host_no, remote_fcport->loop_id,
+	    iodesc->d_id.b.domain, iodesc->d_id.b.area, iodesc->d_id.b.al_pa));
+
+	qla2x00_send_login_iocb(ha, iodesc, &rscn_pid, ha_locked);
+
+	return (QLA_SUCCESS);
+}
+
+/**
+ * qla2x00_process_iodesc() - Complete IO descriptor processing.
+ * @ha: HA context
+ * @mbxstat: Mailbox IOCB status
+ */
+void
+qla2x00_process_iodesc(scsi_qla_host_t *ha, struct mbx_entry *mbxstat)
+{
+	int rval;
+	uint32_t signature;
+	fc_port_t *fcport;
+	struct io_descriptor *iodesc;
+
+	signature = mbxstat->handle;
+
+	DEBUG14(printk("scsi(%ld): Process IODesc -- processing %08x.\n",
+	    ha->host_no, signature));
+
+	/* Retrieve proper IO descriptor. */
+	iodesc = qla2x00_handle_to_iodesc(ha, signature);
+	if (iodesc == NULL) {
+		DEBUG14(printk("scsi(%ld): Process IODesc -- ignoring, "
+		    "incorrect signature %08x.\n", ha->host_no, signature));
+
+		return;
+	}
+
+	/* Stop IO descriptor timer. */
+	qla2x00_remove_iodesc_timer(iodesc);
+
+	/* Verify signature match. */
+	if (iodesc->signature != signature) {
+		DEBUG14(printk("scsi(%ld): Process IODesc -- ignoring, "
+		    "signature mismatch, sent %08x, received %08x.\n",
+		    ha->host_no, iodesc->signature, signature));
+
+		return;
+	}
+
+	/* Go with IOCB callback. */
+	rval = iocb_function_cb_list[iodesc->cb_idx](ha, iodesc, mbxstat);
+	if (rval != QLA_SUCCESS) {
+		/* IO descriptor reused by callback. */
+		return;
+	}
+
+	qla2x00_free_iodesc(iodesc);
+
+	if (test_bit(IODESC_PROCESS_NEEDED, &ha->dpc_flags)) {
+		/* Scan our fcports list for any RSCN requests. */
+		list_for_each_entry(fcport, &ha->fcports, list) {
+			if (fcport->iodesc_idx_sent == IODESC_ADISC_NEEDED ||
+			    fcport->iodesc_idx_sent == IODESC_LOGIN_NEEDED) {
+				qla2x00_handle_port_rscn(ha, 0, fcport, 1);
+				return;
+			}
+		}
+
+		/* Scan our RSCN fcports list for any RSCN requests. */
+		list_for_each_entry(fcport, &ha->rscn_fcports, list) {
+			if (fcport->iodesc_idx_sent == IODESC_ADISC_NEEDED ||
+			    fcport->iodesc_idx_sent == IODESC_LOGIN_NEEDED) {
+				qla2x00_handle_port_rscn(ha, 0, fcport, 1);
+				return;
+			}
+		}
+	}
+	clear_bit(IODESC_PROCESS_NEEDED, &ha->dpc_flags);
+}
+
+/**
+ * qla2x00_cancel_io_descriptors() - Cancel all outstanding io descriptors.
+ * @ha: HA context
+ *
+ * This routine will also delete any RSCN entries related to the outstanding
+ * IO descriptors.
+ */
+void
+qla2x00_cancel_io_descriptors(scsi_qla_host_t *ha)
+{
+	fc_port_t *fcport, *fcptemp;
+
+	clear_bit(IODESC_PROCESS_NEEDED, &ha->dpc_flags);
+
+	/* Abort all IO descriptors. */
+	qla2x00_init_io_descriptors(ha);
+
+	/* Reset all pending IO descriptors in fcports list. */
+	list_for_each_entry(fcport, &ha->fcports, list) {
+		fcport->iodesc_idx_sent = IODESC_INVALID_INDEX;
+	}
+
+	/* Reset all pending IO descriptors in rscn fcports list. */
+	list_for_each_entry_safe(fcport, fcptemp, &ha->rscn_fcports, list) {
+		DEBUG14(printk("scsi(%ld): Cancel IOs -- Freeing RSCN fcport "
+		    "%p [%x/%02x%02x%02x].\n", ha->host_no, fcport,
+		    fcport->loop_id, fcport->d_id.b.domain, fcport->d_id.b.area,
+		    fcport->d_id.b.al_pa));
+
+		list_del(&fcport->list);
+		kfree(fcport);
+	}
+}
diff -Nru a/drivers/scsi/qla2xxx/qla_settings.h b/drivers/scsi/qla2xxx/qla_settings.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/qla_settings.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,66 @@
+/******************************************************************************
+ *                  QLOGIC LINUX SOFTWARE
+ *
+ * QLogic ISP2x00 device driver for Linux 2.6.x
+ * Copyright (C) 2003 QLogic Corporation
+ * (www.qlogic.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ ******************************************************************************/
+/*
+ * Compile time Options:
+ *     0 - Disable and 1 - Enable
+ */
+#define DEBUG_QLA2100		0	/* For Debug of qla2x00 */
+
+#define MEMORY_MAPPED_IO	1
+#define STOP_ON_ERROR		0	/* Stop on aborts and resets  */
+#define STOP_ON_RESET		0
+#define USE_ABORT_TGT		1	/* Use Abort Target mbx cmd */
+
+#define VSA			0	/* Volume Set Addressing */
+
+/* Failover options */
+#define MAX_RECOVERYTIME	10	/*
+					 * Max suspend time for a lun recovery
+					 * time
+					 */
+#define MAX_FAILBACKTIME	5	/* Max suspend time before fail back */
+
+#define QLA_CMD_TIMER_DELTA	3
+
+/* 
+ * When a lun is suspended for the "Not Ready" condition then it will suspend
+ * the lun for increments of 6 sec delays.  SUSPEND_COUNT is that count.
+ */
+#define SUSPEND_COUNT		10	/* 6 secs * 10 retries = 60 secs */
+
+/*
+ * Defines the time in seconds that the driver extends the command timeout to
+ * get around the problem where the mid-layer only allows 5 retries for
+ * commands that return BUS_BUSY
+ */
+#define EXTEND_CMD_TIMEOUT	60
+
+#define MAX_RETRIES_OF_ISP_ABORT	5
+
+/* Max time to wait for the loop to be in LOOP_READY state */
+#define MAX_LOOP_TIMEOUT	(60 * 5)
+#define EH_ACTIVE		1	/* Error handler active */
+
+/*
+ * Some vendor subsystems do not recover properly after a device reset.  Define
+ * the following to force a logout after a successful device reset.
+ */
+#undef LOGOUT_AFTER_DEVICE_RESET
+
+#include "qla_version.h"
diff -Nru a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/qla_sup.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,680 @@
+/******************************************************************************
+ *                  QLOGIC LINUX SOFTWARE
+ *
+ * QLogic ISP2x00 device driver for Linux 2.6.x
+ * Copyright (C) 2003 QLogic Corporation
+ * (www.qlogic.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ ******************************************************************************/
+
+#include "qla_os.h"
+#include "qla_def.h"
+
+static uint16_t qla2x00_nvram_request(scsi_qla_host_t *, uint32_t);
+static void qla2x00_nv_deselect(scsi_qla_host_t *);
+static void qla2x00_nv_write(scsi_qla_host_t *, uint16_t);
+
+uint8_t qla2x00_read_flash_byte(scsi_qla_host_t *, uint32_t);
+static void qla2x00_write_flash_byte(scsi_qla_host_t *, uint32_t, uint8_t);
+static uint8_t qla2x00_poll_flash(scsi_qla_host_t *ha,
+		uint32_t addr, uint8_t poll_data, uint8_t mid);
+static uint8_t qla2x00_program_flash_address(scsi_qla_host_t *ha,
+		uint32_t addr, uint8_t data, uint8_t mid);
+static uint8_t qla2x00_erase_flash_sector(scsi_qla_host_t *ha,
+		uint32_t addr, uint32_t sec_mask, uint8_t mid);
+
+uint8_t qla2x00_get_flash_manufacturer(scsi_qla_host_t *ha);
+uint16_t qla2x00_get_flash_version(scsi_qla_host_t *);
+uint16_t qla2x00_get_flash_image(scsi_qla_host_t *ha, uint8_t *image);
+uint16_t qla2x00_set_flash_image(scsi_qla_host_t *ha, uint8_t *image);
+
+
+/*
+ * NVRAM support routines
+ */
+
+/**
+ * qla2x00_lock_nvram_access() - 
+ * @ha: HA context
+ */
+void
+qla2x00_lock_nvram_access(scsi_qla_host_t *ha)
+{
+	uint16_t data;
+	device_reg_t *reg;
+
+	reg = ha->iobase;
+
+	if (IS_QLA2312(ha) || IS_QLA2322(ha)) {
+		data = RD_REG_WORD(&reg->nvram);
+		while (data & NVR_BUSY) {
+			udelay(100);
+			data = RD_REG_WORD(&reg->nvram);
+		}
+
+		/* Lock resource */
+		WRT_REG_WORD(&reg->u.isp2300.host_semaphore, 0x1);
+		udelay(5);
+		data = RD_REG_WORD(&reg->u.isp2300.host_semaphore);
+		while ((data & BIT_0) == 0) {
+			/* Lock failed */
+			udelay(100);
+			WRT_REG_WORD(&reg->u.isp2300.host_semaphore, 0x1);
+			udelay(5);
+			data = RD_REG_WORD(&reg->u.isp2300.host_semaphore);
+		}
+	}
+}
+
+/**
+ * qla2x00_unlock_nvram_access() - 
+ * @ha: HA context
+ */
+void
+qla2x00_unlock_nvram_access(scsi_qla_host_t *ha)
+{
+	device_reg_t *reg;
+
+	reg = ha->iobase;
+
+	if (IS_QLA2312(ha) || IS_QLA2322(ha)) 
+		WRT_REG_WORD(&reg->u.isp2300.host_semaphore, 0);
+}
+
+/**
+ * qla2x00_get_nvram_word() - Calculates word position in NVRAM and calls the
+ *	request routine to get the word from NVRAM.
+ * @ha: HA context
+ * @addr: Address in NVRAM to read
+ *
+ * Returns the word read from nvram @addr.
+ */
+uint16_t
+qla2x00_get_nvram_word(scsi_qla_host_t *ha, uint32_t addr)
+{
+	uint16_t	data;
+	uint32_t	nv_cmd;
+
+	nv_cmd = addr << 16;
+	nv_cmd |= NV_READ_OP;
+	data = qla2x00_nvram_request(ha, nv_cmd);
+
+	return (data);
+}
+
+/**
+ * qla2x00_write_nvram_word() - Write NVRAM data.
+ * @ha: HA context
+ * @addr: Address in NVRAM to write
+ * @data: word to program
+ */
+void
+qla2x00_write_nvram_word(scsi_qla_host_t *ha, uint32_t addr, uint16_t data)
+{
+	int count;
+	uint16_t word;
+	uint32_t nv_cmd;
+	device_reg_t *reg = ha->iobase;
+
+	qla2x00_nv_write(ha, NVR_DATA_OUT);
+	qla2x00_nv_write(ha, 0);
+	qla2x00_nv_write(ha, 0);
+
+	for (word = 0; word < 8; word++)
+		qla2x00_nv_write(ha, NVR_DATA_OUT);
+
+	qla2x00_nv_deselect(ha);
+
+	/* Erase Location */
+	nv_cmd = (addr << 16) | NV_ERASE_OP;
+	nv_cmd <<= 5;
+	for (count = 0; count < 11; count++) {
+		if (nv_cmd & BIT_31)
+			qla2x00_nv_write(ha, NVR_DATA_OUT);
+		else
+			qla2x00_nv_write(ha, 0);
+
+		nv_cmd <<= 1;
+	}
+
+	qla2x00_nv_deselect(ha);
+
+	/* Wait for Erase to Finish */
+	WRT_REG_WORD(&reg->nvram, NVR_SELECT);
+	do {
+		NVRAM_DELAY();
+		word = RD_REG_WORD(&reg->nvram);
+	} while ((word & NVR_DATA_IN) == 0);
+
+	qla2x00_nv_deselect(ha);
+
+	/* Write data */
+	nv_cmd = (addr << 16) | NV_WRITE_OP;
+	nv_cmd |= data;
+	nv_cmd <<= 5;
+	for (count = 0; count < 27; count++) {
+		if (nv_cmd & BIT_31)
+			qla2x00_nv_write(ha, NVR_DATA_OUT);
+		else
+			qla2x00_nv_write(ha, 0);
+
+		nv_cmd <<= 1;
+	}
+
+	qla2x00_nv_deselect(ha);
+
+	/* Wait for NVRAM to become ready */
+	WRT_REG_WORD(&reg->nvram, NVR_SELECT);
+	do {
+		NVRAM_DELAY();
+		word = RD_REG_WORD(&reg->nvram);
+	} while ((word & NVR_DATA_IN) == 0);
+
+	qla2x00_nv_deselect(ha);
+
+	/* Disable writes */
+	qla2x00_nv_write(ha, NVR_DATA_OUT);
+	for (count = 0; count < 10; count++)
+		qla2x00_nv_write(ha, 0);
+
+	qla2x00_nv_deselect(ha);
+}
+
+/**
+ * qla2x00_nvram_request() - Sends read command to NVRAM and gets data from
+ *	NVRAM.
+ * @ha: HA context
+ * @nv_cmd: NVRAM command
+ *
+ * Bit definitions for NVRAM command:
+ *
+ *	Bit 26     = start bit
+ *	Bit 25, 24 = opcode
+ *	Bit 23-16  = address
+ *	Bit 15-0   = write data
+ *
+ * Returns the word read from nvram @addr.
+ */
+static uint16_t
+qla2x00_nvram_request(scsi_qla_host_t *ha, uint32_t nv_cmd)
+{
+	uint8_t		cnt;
+	device_reg_t	*reg = ha->iobase;
+	uint16_t	data = 0;
+	uint16_t	reg_data;
+
+	/* Send command to NVRAM. */
+	nv_cmd <<= 5;
+	for (cnt = 0; cnt < 11; cnt++) {
+		if (nv_cmd & BIT_31)
+			qla2x00_nv_write(ha, NVR_DATA_OUT);
+		else
+			qla2x00_nv_write(ha, 0);
+		nv_cmd <<= 1;
+	}
+
+	/* Read data from NVRAM. */
+	for (cnt = 0; cnt < 16; cnt++) {
+		WRT_REG_WORD(&reg->nvram, NVR_SELECT | NVR_CLOCK);
+		NVRAM_DELAY();
+		data <<= 1;
+		reg_data = RD_REG_WORD(&reg->nvram);
+		if (reg_data & NVR_DATA_IN)
+			data |= BIT_0;
+		WRT_REG_WORD(&reg->nvram, NVR_SELECT);
+		NVRAM_DELAY();
+		RD_REG_WORD(&reg->nvram);	/* PCI Posting. */
+	}
+
+	/* Deselect chip. */
+	WRT_REG_WORD(&reg->nvram, NVR_DESELECT);
+	NVRAM_DELAY();
+	RD_REG_WORD(&reg->nvram);		/* PCI Posting. */
+
+	return (data);
+}
+
+/**
+ * qla2x00_nv_write() - Clean NVRAM operations.
+ * @ha: HA context
+ */
+void
+qla2x00_nv_deselect(scsi_qla_host_t *ha)
+{
+	device_reg_t *reg = ha->iobase;
+
+	WRT_REG_WORD(&reg->nvram, NVR_DESELECT);
+	NVRAM_DELAY();
+	RD_REG_WORD(&reg->nvram);		/* PCI Posting. */
+}
+
+/**
+ * qla2x00_nv_write() - Prepare for NVRAM read/write operation.
+ * @ha: HA context
+ * @data: Serial interface selector
+ */
+void
+qla2x00_nv_write(scsi_qla_host_t *ha, uint16_t data)
+{
+	device_reg_t *reg = ha->iobase;
+
+	WRT_REG_WORD(&reg->nvram, data | NVR_SELECT);
+	NVRAM_DELAY();
+	RD_REG_WORD(&reg->nvram);		/* PCI Posting. */
+	WRT_REG_WORD(&reg->nvram, data | NVR_SELECT | NVR_CLOCK);
+	NVRAM_DELAY();
+	RD_REG_WORD(&reg->nvram);		/* PCI Posting. */
+	WRT_REG_WORD(&reg->nvram, data | NVR_SELECT);
+	NVRAM_DELAY();
+	RD_REG_WORD(&reg->nvram);		/* PCI Posting. */
+}
+
+/*
+ * Flash support routines
+ */
+
+/**
+ * qla2x00_flash_enable() - Setup flash for reading and writing.
+ * @ha: HA context
+ */
+void
+qla2x00_flash_enable(scsi_qla_host_t *ha)
+{
+	uint16_t	data;
+	device_reg_t	*reg = ha->iobase;
+
+	data = RD_REG_WORD(&reg->ctrl_status);
+	data |= CSR_FLASH_ENABLE;
+	WRT_REG_WORD(&reg->ctrl_status, data);
+}
+
+/**
+ * qla2x00_flash_disable() - Disable flash and allow RISC to run.
+ * @ha: HA context
+ */
+void
+qla2x00_flash_disable(scsi_qla_host_t *ha)
+{
+	uint16_t	data;
+	device_reg_t	*reg = ha->iobase;
+
+	data = RD_REG_WORD(&reg->ctrl_status);
+	data &= ~(CSR_FLASH_ENABLE);
+	WRT_REG_WORD(&reg->ctrl_status, data);
+}
+
+/**
+ * qla2x00_read_flash_byte() - Reads a byte from flash
+ * @ha: HA context
+ * @addr: Address in flash to read
+ *
+ * A word is read from the chip, but, only the lower byte is valid.
+ *
+ * Returns the byte read from flash @addr.
+ */
+uint8_t
+qla2x00_read_flash_byte(scsi_qla_host_t *ha, uint32_t addr)
+{
+	uint16_t	data;
+	uint16_t	bank_select;
+	device_reg_t	*reg = ha->iobase;
+
+	/* Setup bit 16 of flash address. */
+	bank_select = RD_REG_WORD(&reg->ctrl_status);
+	if ((addr & BIT_16) && ((bank_select & CSR_FLASH_64K_BANK) == 0)) {
+		bank_select |= CSR_FLASH_64K_BANK;
+		WRT_REG_WORD(&reg->ctrl_status, bank_select);
+	} else if (((addr & BIT_16) == 0) &&
+	    (bank_select & CSR_FLASH_64K_BANK)) {
+		bank_select &= ~(CSR_FLASH_64K_BANK);
+		WRT_REG_WORD(&reg->ctrl_status, bank_select);
+	}
+	WRT_REG_WORD(&reg->flash_address, (uint16_t)addr);
+	data = qla2x00_debounce_register(&reg->flash_data);
+
+	return ((uint8_t)data);
+}
+
+/**
+ * qla2x00_write_flash_byte() - Write a byte to flash
+ * @ha: HA context
+ * @addr: Address in flash to write
+ * @data: Data to write
+ */
+static void
+qla2x00_write_flash_byte(scsi_qla_host_t *ha, uint32_t addr, uint8_t data)
+{
+	uint16_t	bank_select;
+	device_reg_t	*reg = ha->iobase;
+
+	/* Setup bit 16 of flash address. */
+	bank_select = RD_REG_WORD(&reg->ctrl_status);
+	if ((addr & BIT_16) && ((bank_select & CSR_FLASH_64K_BANK) == 0)) {
+		bank_select |= CSR_FLASH_64K_BANK;
+		WRT_REG_WORD(&reg->ctrl_status, bank_select);
+	} else if (((addr & BIT_16) == 0) &&
+	    (bank_select & CSR_FLASH_64K_BANK)) {
+		bank_select &= ~(CSR_FLASH_64K_BANK);
+		WRT_REG_WORD(&reg->ctrl_status, bank_select);
+	}
+	WRT_REG_WORD(&reg->flash_address, (uint16_t)addr);
+	WRT_REG_WORD(&reg->flash_data, (uint16_t)data);
+}
+
+/**
+ * qla2x00_poll_flash() - Polls flash for completion.
+ * @ha: HA context
+ * @addr: Address in flash to poll
+ * @poll_data: Data to be polled
+ * @mid: Flash manufacturer ID
+ *
+ * This function polls the device until bit 7 of what is read matches data
+ * bit 7 or until data bit 5 becomes a 1.  If that hapens, the flash ROM timed
+ * out (a fatal error).  The flash book recommeds reading bit 7 again after
+ * reading bit 5 as a 1.
+ *
+ * Returns 0 on success, else non-zero.
+ */
+static uint8_t
+qla2x00_poll_flash(scsi_qla_host_t *ha,
+    uint32_t addr, uint8_t poll_data, uint8_t mid)
+{
+	uint8_t		status;
+	uint8_t		flash_data;
+	uint32_t	cnt;
+	int		failed_pass;
+
+	status = 1;
+	failed_pass = 1;
+
+	/* Wait for 30 seconds for command to finish. */
+	poll_data &= BIT_7;
+	for (cnt = 3000000; cnt; cnt--) {
+		flash_data = qla2x00_read_flash_byte(ha, addr);
+		if ((flash_data & BIT_7) == poll_data) {
+			status = 0;
+			break;
+		}
+
+		if (mid != 0x40 && mid != 0xda) {
+			if (flash_data & BIT_5)
+				failed_pass--;
+			if (failed_pass < 0)
+				break;
+		}
+		udelay(10);
+		barrier();
+	}
+	return (status);
+}
+
+/**
+ * qla2x00_program_flash_address() - Programs a flash address
+ * @ha: HA context
+ * @addr: Address in flash to program
+ * @data: Data to be written in flash
+ * @mid: Flash manufacturer ID
+ *
+ * Returns 0 on success, else non-zero.
+ */
+static uint8_t
+qla2x00_program_flash_address(scsi_qla_host_t *ha,
+    uint32_t addr, uint8_t data, uint8_t mid)
+{
+	/* Write Program Command Sequence */
+	qla2x00_write_flash_byte(ha, 0x5555, 0xaa);
+	qla2x00_write_flash_byte(ha, 0x2aaa, 0x55);
+	qla2x00_write_flash_byte(ha, 0x5555, 0xa0);
+	qla2x00_write_flash_byte(ha, addr, data);
+
+	/* Wait for write to complete. */
+	return (qla2x00_poll_flash(ha, addr, data, mid));
+}
+
+/**
+ * qla2x00_erase_flash_sector() - Erase a flash sector.
+ * @ha: HA context
+ * @addr: Flash sector to erase
+ * @sec_mask: Sector address mask
+ * @mid: Flash manufacturer ID
+ *
+ * Returns 0 on success, else non-zero.
+ */
+static uint8_t
+qla2x00_erase_flash_sector(scsi_qla_host_t *ha,
+    uint32_t addr, uint32_t sec_mask, uint8_t mid)
+{
+	/* Individual Sector Erase Command Sequence */
+	qla2x00_write_flash_byte(ha, 0x5555, 0xaa);
+	qla2x00_write_flash_byte(ha, 0x2aaa, 0x55);
+	qla2x00_write_flash_byte(ha, 0x5555, 0x80);
+	qla2x00_write_flash_byte(ha, 0x5555, 0xaa);
+	qla2x00_write_flash_byte(ha, 0x2aaa, 0x55);
+
+	if (mid == 0xda)
+		qla2x00_write_flash_byte(ha, addr & sec_mask, 0x10);
+	else
+		qla2x00_write_flash_byte(ha, addr & sec_mask, 0x30);
+
+	udelay(150);
+
+	/* Wait for erase to complete. */
+	return (qla2x00_poll_flash(ha, addr, 0x80, mid));
+}
+
+/**
+ * qla2x00_get_flash_manufacturer() - Read manufacturer ID from flash chip.
+ * @ha: HA context
+ *
+ * Returns the manufacturer's ID read from the flash chip.
+ */
+uint8_t
+qla2x00_get_flash_manufacturer(scsi_qla_host_t *ha)
+{
+	uint8_t	manuf_id;
+
+	qla2x00_write_flash_byte(ha, 0x5555, 0xaa);
+	qla2x00_write_flash_byte(ha, 0x2aaa, 0x55);
+	qla2x00_write_flash_byte(ha, 0x5555, 0x90);
+	manuf_id = qla2x00_read_flash_byte(ha, 0x0001);
+
+	return (manuf_id);
+}
+
+/**
+ * qla2x00_get_flash_version() - Read version information from flash.
+ * @ha: HA context
+ *
+ * Returns QLA_SUCCESS on successful retrieval of flash version.
+ */
+uint16_t
+qla2x00_get_flash_version(scsi_qla_host_t *ha)
+{
+	uint16_t	ret = QLA_SUCCESS;
+	uint32_t	loop_cnt = 1;  /* this is for error exit only */
+	uint32_t	pcir_adr;
+
+	ENTER(__func__);
+
+	qla2x00_flash_enable(ha);
+	do {	/* Loop once to provide quick error exit */
+		/* Match signature */
+		if (!(qla2x00_read_flash_byte(ha, 0) == 0x55 &&
+		    qla2x00_read_flash_byte(ha, 1) == 0xaa)) {
+			/* No signature */
+			DEBUG2(printk("scsi(%ld): No matching FLASH "
+			    "signature.\n", ha->host_no));
+			ret = QLA_FUNCTION_FAILED;
+			break;
+		}
+
+		pcir_adr = qla2x00_read_flash_byte(ha, 0x18) & 0xff;
+
+		/* validate signature of PCI data structure */
+		if ((qla2x00_read_flash_byte(ha, pcir_adr)) == 'P' &&
+		    (qla2x00_read_flash_byte(ha, pcir_adr + 1)) == 'C' &&
+		    (qla2x00_read_flash_byte(ha, pcir_adr + 2)) == 'I' &&
+		    (qla2x00_read_flash_byte(ha, pcir_adr + 3)) == 'R') {
+
+			/* Read version */
+			ha->optrom_minor =
+			    qla2x00_read_flash_byte(ha, pcir_adr + 0x12);
+			ha->optrom_major =
+			    qla2x00_read_flash_byte(ha, pcir_adr + 0x13);
+			DEBUG3(printk("%s(): got %d.%d.\n",
+			    __func__, ha->optrom_major, ha->optrom_minor));
+		} else {
+			/* error */
+			DEBUG2(printk("%s(): PCI data struct not found. "
+			    "pcir_adr=%x.\n",
+			    __func__, pcir_adr));
+			ret = QLA_FUNCTION_FAILED;
+			break;
+		}
+
+	} while (--loop_cnt);
+	qla2x00_flash_disable(ha);
+
+	LEAVE(__func__);
+
+	return (ret);
+}
+
+/**
+ * qla2x00_get_flash_image() - Read image from flash chip.
+ * @ha: HA context
+ * @image: Buffer to receive flash image
+ *
+ * Returns 0 on success, else non-zero.
+ */
+uint16_t
+qla2x00_get_flash_image(scsi_qla_host_t *ha, uint8_t *image)
+{
+	uint32_t	addr;
+	uint32_t	midpoint;
+	uint8_t		*data;
+	device_reg_t	*reg = ha->iobase;
+
+	midpoint = FLASH_IMAGE_SIZE / 2;
+
+	qla2x00_flash_enable(ha);
+	WRT_REG_WORD(&reg->nvram, 0);
+	for (addr = 0, data = image; addr < FLASH_IMAGE_SIZE; addr++, data++) {
+		if (addr == midpoint)
+			WRT_REG_WORD(&reg->nvram, NVR_SELECT);
+
+		*data = qla2x00_read_flash_byte(ha, addr);
+	}
+	qla2x00_flash_disable(ha);
+
+	return (0);
+}
+
+/**
+ * qla2x00_set_flash_image() - Write image to flash chip.
+ * @ha: HA context
+ * @image: Source image to write to flash
+ *
+ * Returns 0 on success, else non-zero.
+ */
+uint16_t
+qla2x00_set_flash_image(scsi_qla_host_t *ha, uint8_t *image)
+{
+	uint16_t	status;
+	uint32_t	addr;
+	uint32_t	midpoint;
+	uint32_t	sec_mask;
+	uint32_t	rest_addr;
+	uint8_t		mid;
+	uint8_t		sec_number;
+	uint8_t		data;
+	device_reg_t	*reg = ha->iobase;
+
+	status = 0;
+	sec_number = 0;
+
+	/* Reset ISP chip. */
+	WRT_REG_WORD(&reg->ctrl_status, CSR_ISP_SOFT_RESET);
+
+	qla2x00_flash_enable(ha);
+	do {	/* Loop once to provide quick error exit */
+		/* Structure of flash memory based on manufacturer */
+		mid = qla2x00_get_flash_manufacturer(ha);
+		if (mid == 0x6d) {
+			// Am29LV001 part
+			rest_addr = 0x1fff;
+			sec_mask = 0x1e000;
+		} else if (mid == 0x40) {
+			// Mostel v29c51001 part
+			rest_addr = 0x1ff;
+			sec_mask = 0x1fe00;
+		} else if (mid == 0xbf) {
+			// SST39sf10 part
+			rest_addr = 0xfff;
+			sec_mask = 0x1f000;
+		} else if (mid == 0xda) {
+			// Winbond W29EE011 part
+			rest_addr = 0x7f;
+			sec_mask = 0x1ff80;
+			addr = 0;
+			if (qla2x00_erase_flash_sector(ha, addr, sec_mask,
+			    mid)) {
+				status = 1;
+				break;
+			}
+		} else {
+			// Am29F010 part
+			rest_addr = 0x3fff;
+			sec_mask = 0x1c000;
+		}
+
+		midpoint = FLASH_IMAGE_SIZE / 2;
+		for (addr = 0; addr < FLASH_IMAGE_SIZE; addr++) {
+			data = *image++;
+			/* Are we at the beginning of a sector? */
+			if (!(addr & rest_addr)) {
+				if (addr == midpoint)
+					WRT_REG_WORD(&reg->nvram, NVR_SELECT);
+
+				/* Then erase it */
+				if (qla2x00_erase_flash_sector(ha, addr,
+				    sec_mask, mid)) {
+					status = 1;
+					break;
+				}
+
+				sec_number++;
+			}
+			if (mid == 0x6d) {
+				if (sec_number == 1 &&
+				    (addr == (rest_addr - 1))) {
+					rest_addr = 0x0fff;
+					sec_mask   = 0x1f000;
+				} else if (sec_number == 3 && (addr & 0x7ffe)) {
+					rest_addr = 0x3fff;
+					sec_mask   = 0x1c000;
+				}
+			}
+
+			if (qla2x00_program_flash_address(ha, addr, data,
+			    mid)) {
+				status = 1;
+				break;
+			}
+		}
+	} while (0);
+
+	qla2x00_flash_disable(ha);
+
+	return (status);
+}
diff -Nru a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/scsi/qla2xxx/qla_version.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,27 @@
+/******************************************************************************
+ *                  QLOGIC LINUX SOFTWARE
+ *
+ * QLogic ISP2x00 device driver for Linux 2.6.x
+ * Copyright (C) 2003 QLogic Corporation
+ * (www.qlogic.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ ******************************************************************************/
+/*
+ * Driver version 
+ */
+#define QLA2XXX_VERSION      "8.00.00b8"
+
+#define QLA_DRIVER_MAJOR_VER	8
+#define QLA_DRIVER_MINOR_VER	0
+#define QLA_DRIVER_PATCH_VER	0
+#define QLA_DRIVER_BETA_VER	8
diff -Nru a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
--- a/drivers/scsi/qlogicpti.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/scsi/qlogicpti.c	Tue Feb  3 19:45:34 2004
@@ -319,7 +319,7 @@
 
 	risc_code_addr = 0x1000;	/* all load addresses are at 0x1000 */
 
-	spin_lock_irqsave(&qpti->lock, flags);
+	spin_lock_irqsave(host->host_lock, flags);
 
 	sbus_writew(HCCTRL_PAUSE, qpti->qregs + HCCTRL);
 
@@ -367,7 +367,7 @@
 	if (qlogicpti_mbox_command(qpti, param, 1)) {
 		printk(KERN_EMERG "qlogicpti%d: Cannot execute ISP firmware.\n",
 		       qpti->qpti_id);
-		spin_unlock_irqrestore(&qpti->lock, flags);
+		spin_unlock_irqrestore(host->host_lock, flags);
 		return 1;
 	}
 
@@ -378,7 +378,7 @@
 	   (param[0] != MBOX_COMMAND_COMPLETE)) {
 		printk(KERN_EMERG "qlogicpti%d: Cannot set initiator SCSI ID.\n",
 		       qpti->qpti_id);
-		spin_unlock_irqrestore(&qpti->lock, flags);
+		spin_unlock_irqrestore(host->host_lock, flags);
 		return 1;
 	}
 
@@ -393,7 +393,7 @@
 	if (qlogicpti_mbox_command(qpti, param, 1)) {
 		printk(KERN_EMERG "qlogicpti%d: Cannot init response queue.\n",
 		       qpti->qpti_id);
-		spin_unlock_irqrestore(&qpti->lock, flags);
+		spin_unlock_irqrestore(host->host_lock, flags);
 		return 1;
 	}
 
@@ -405,7 +405,7 @@
 	if (qlogicpti_mbox_command(qpti, param, 1)) {
 		printk(KERN_EMERG "qlogicpti%d: Cannot init request queue.\n",
 		       qpti->qpti_id);
-		spin_unlock_irqrestore(&qpti->lock, flags);
+		spin_unlock_irqrestore(host->host_lock, flags);
 		return 1;
 	}
 
@@ -451,7 +451,7 @@
 	qlogicpti_mbox_command(qpti, param, 0);
 	qpti->send_marker = 1;
 
-	spin_unlock_irqrestore(&qpti->lock, flags);
+	spin_unlock_irqrestore(host->host_lock, flags);
 	return 0;
 }
 
@@ -459,6 +459,7 @@
 
 static int __init qlogicpti_load_firmware(struct qlogicpti *qpti)
 {
+	struct Scsi_Host *host = qpti->qhost;
 	unsigned short csum = 0;
 	unsigned short param[6];
 	unsigned short *risc_code, risc_code_addr, risc_code_length;
@@ -469,7 +470,7 @@
 	risc_code_addr = 0x1000;	/* all f/w modules load at 0x1000 */
 	risc_code_length = sbus_risc_code_length01;
 
-	spin_lock_irqsave(&qpti->lock, flags);
+	spin_lock_irqsave(host->host_lock, flags);
 
 	/* Verify the checksum twice, one before loading it, and once
 	 * afterwards via the mailbox commands.
@@ -477,7 +478,7 @@
 	for (i = 0; i < risc_code_length; i++)
 		csum += risc_code[i];
 	if (csum) {
-		spin_unlock_irqrestore(&qpti->lock, flags);
+		spin_unlock_irqrestore(host->host_lock, flags);
 		printk(KERN_EMERG "qlogicpti%d: Aieee, firmware checksum failed!",
 		       qpti->qpti_id);
 		return 1;
@@ -489,7 +490,7 @@
 	while (--timeout && (sbus_readw(qpti->qregs + SBUS_CTRL) & SBUS_CTRL_RESET))
 		udelay(20);
 	if (!timeout) {
-		spin_unlock_irqrestore(&qpti->lock, flags);
+		spin_unlock_irqrestore(host->host_lock, flags);
 		printk(KERN_EMERG "qlogicpti%d: Cannot reset the ISP.", qpti->qpti_id);
 		return 1;
 	}
@@ -529,7 +530,7 @@
 	if (qlogicpti_mbox_command(qpti, param, 1)) {
 		printk(KERN_EMERG "qlogicpti%d: Cannot stop firmware for reload.\n",
 		       qpti->qpti_id);
-		spin_unlock_irqrestore(&qpti->lock, flags);
+		spin_unlock_irqrestore(host->host_lock, flags);
 		return 1;
 	}		
 
@@ -542,7 +543,7 @@
 		    param[0] != MBOX_COMMAND_COMPLETE) {
 			printk("qlogicpti%d: Firmware dload failed, I'm bolixed!\n",
 			       qpti->qpti_id);
-			spin_unlock_irqrestore(&qpti->lock, flags);
+			spin_unlock_irqrestore(host->host_lock, flags);
 			return 1;
 		}
 	}
@@ -562,7 +563,7 @@
 	    (param[0] != MBOX_COMMAND_COMPLETE)) {
 		printk(KERN_EMERG "qlogicpti%d: New firmware csum failure!\n",
 		       qpti->qpti_id);
-		spin_unlock_irqrestore(&qpti->lock, flags);
+		spin_unlock_irqrestore(host->host_lock, flags);
 		return 1;
 	}
 
@@ -576,7 +577,7 @@
 	    (param[0] != MBOX_COMMAND_COMPLETE)) {
 		printk(KERN_EMERG "qlogicpti%d: AboutFirmware cmd fails.\n",
 		       qpti->qpti_id);
-		spin_unlock_irqrestore(&qpti->lock, flags);
+		spin_unlock_irqrestore(host->host_lock, flags);
 		return 1;
 	}
 
@@ -592,7 +593,7 @@
 	    (param[0] != MBOX_COMMAND_COMPLETE)) {
 		printk(KERN_EMERG "qlogicpti%d: could not set clock rate.\n",
 		       qpti->qpti_id);
-		spin_unlock_irqrestore(&qpti->lock, flags);
+		spin_unlock_irqrestore(host->host_lock, flags);
 		return 1;
 	}
 
@@ -609,7 +610,7 @@
 		qlogicpti_mbox_command(qpti, param, 1);
 	}
 
-	spin_unlock_irqrestore(&qpti->lock, flags);
+	spin_unlock_irqrestore(host->host_lock, flags);
 	return 0;
 }
 
@@ -844,8 +845,6 @@
 			}
 			qpti = (struct qlogicpti *) qpti_host->hostdata;
 
-			spin_lock_init(&qpti->lock);
-
 			/* We are wide capable, 16 targets. */
 			qpti_host->max_id = MAX_TARGETS;
 
@@ -1171,7 +1170,6 @@
 				       void (*done)(Scsi_Cmnd *))
 {
 	struct qlogicpti *qpti = (struct qlogicpti *) Cmnd->device->host->hostdata;
-	unsigned long flags;
 
 	/*
 	 * done checking this host adapter?
@@ -1188,8 +1186,6 @@
 		return qlogicpti_queuecommand(Cmnd, ourdone);
 	}
 
-	spin_lock_irqsave(&qpti->lock, flags);
-
 	/*
 	 * We've peeked at all targets for this bus- time
 	 * to set parameters for devices for real now.
@@ -1231,8 +1227,6 @@
 	if (qpti == NULL)
 		Cmnd->device->host->hostt->queuecommand = qlogicpti_queuecommand;
 
-	spin_unlock_irqrestore(&qpti->lock, flags);
-
 	return qlogicpti_queuecommand(Cmnd, done);
 }
 
@@ -1249,14 +1243,11 @@
 	struct Scsi_Host *host = Cmnd->device->host;
 	struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata;
 	struct Command_Entry *cmd;
-	unsigned long flags;
 	u_int out_ptr;
 	int in_ptr;
 
 	Cmnd->scsi_done = done;
 
-	spin_lock_irqsave(&qpti->lock, flags);
-
 	in_ptr = qpti->req_in_ptr;
 	cmd = (struct Command_Entry *) &qpti->req_cpu[in_ptr];
 	out_ptr = sbus_readw(qpti->qregs + MBOX4);
@@ -1281,15 +1272,12 @@
 
 	update_can_queue(host, in_ptr, out_ptr);
 
-	spin_unlock_irqrestore(&qpti->lock, flags);
 	return 0;
 
 toss_command:
 	printk(KERN_EMERG "qlogicpti%d: request queue overflow\n",
 	       qpti->qpti_id);
 
-	spin_unlock_irqrestore(&qpti->lock, flags);
-
 	/* Unfortunately, unless you use the new EH code, which
 	 * we don't, the midlayer will ignore the return value,
 	 * which is insane.  We pick up the pieces like this.
@@ -1447,12 +1435,10 @@
 	unsigned long flags;
 	Scsi_Cmnd *dq;
 
-	spin_lock_irqsave(&qpti->lock, flags);
+	spin_lock_irqsave(qpti->qhost->host_lock, flags);
 	dq = qlogicpti_intr_handler(qpti);
-	spin_unlock(&qpti->lock);
 
 	if (dq != NULL) {
-		spin_lock(qpti->qhost->host_lock);
 		do {
 			Scsi_Cmnd *next;
 
@@ -1460,9 +1446,8 @@
 			dq->scsi_done(dq);
 			dq = next;
 		} while (dq != NULL);
-		spin_unlock(qpti->qhost->host_lock);
 	}
-	local_irq_restore(flags);
+	spin_unlock_irqrestore(qpti->qhost->host_lock, flags);
 
 	return IRQ_HANDLED;
 }
@@ -1473,15 +1458,12 @@
 	struct Scsi_Host *host = Cmnd->device->host;
 	struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata;
 	int return_status = SUCCESS;
-	unsigned long flags;
 	u32 cmd_cookie;
 	int i;
 
 	printk(KERN_WARNING "qlogicpti : Aborting cmd for tgt[%d] lun[%d]\n",
 	       (int)Cmnd->device->id, (int)Cmnd->device->lun);
 
-	spin_lock_irqsave(&qpti->lock, flags);
-
 	qlogicpti_disable_irqs(qpti);
 
 	/* Find the 32-bit cookie we gave to the firmware for
@@ -1504,8 +1486,6 @@
 
 	qlogicpti_enable_irqs(qpti);
 
-	spin_unlock_irqrestore(&qpti->lock, flags);
-
 	return return_status;
 }
 
@@ -1515,12 +1495,9 @@
 	struct Scsi_Host *host = Cmnd->device->host;
 	struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata;
 	int return_status = SUCCESS;
-	unsigned long flags;
 
 	printk(KERN_WARNING "qlogicpti : Resetting SCSI bus!\n");
 
-	spin_lock_irqsave(&qpti->lock, flags);
-
 	qlogicpti_disable_irqs(qpti);
 
 	param[0] = MBOX_BUS_RESET;
@@ -1532,8 +1509,6 @@
 	}
 
 	qlogicpti_enable_irqs(qpti);
-
-	spin_unlock_irqrestore(&qpti->lock, flags);
 
 	return return_status;
 }
diff -Nru a/drivers/scsi/qlogicpti.h b/drivers/scsi/qlogicpti.h
--- a/drivers/scsi/qlogicpti.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/scsi/qlogicpti.h	Tue Feb  3 19:45:17 2004
@@ -335,7 +335,6 @@
 /* Software state for the driver. */
 struct qlogicpti {
 	/* These are the hot elements in the cache, so they come first. */
-	spinlock_t		  lock;			/* Driver mutex		      */
 	unsigned long             qregs;                /* Adapter registers          */
 	struct pti_queue_entry   *res_cpu;              /* Ptr to RESPONSE bufs (CPU) */
 	struct pti_queue_entry   *req_cpu;              /* Ptr to REQUEST bufs (CPU)  */
diff -Nru a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c
--- a/drivers/scsi/sata_sil.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/scsi/sata_sil.c	Tue Feb  3 19:45:16 2004
@@ -34,11 +34,16 @@
 #include "hosts.h"
 #include <linux/libata.h>
 
-#define DRV_NAME	"ata_sil"
-#define DRV_VERSION	"0.51"
+#define DRV_NAME	"sata_sil"
+#define DRV_VERSION	"0.52"
 
 enum {
 	sil_3112		= 0,
+	sil_3114		= 1,
+
+	SIL_SYSCFG		= 0x48,
+	SIL_MASK_IDE0_INT	= (1 << 22),
+	SIL_MASK_IDE1_INT	= (1 << 23),
 
 	SIL_IDE0_TF		= 0x80,
 	SIL_IDE0_CTL		= 0x8A,
@@ -49,6 +54,19 @@
 	SIL_IDE1_CTL		= 0xCA,
 	SIL_IDE1_BMDMA		= 0x08,
 	SIL_IDE1_SCR		= 0x180,
+
+	SIL_IDE2_TF		= 0x280,
+	SIL_IDE2_CTL		= 0x28A,
+	SIL_IDE2_BMDMA		= 0x200,
+	SIL_IDE2_SCR		= 0x300,
+
+	SIL_IDE3_TF		= 0x2C0,
+	SIL_IDE3_CTL		= 0x2CA,
+	SIL_IDE3_BMDMA		= 0x208,
+	SIL_IDE3_SCR		= 0x380,
+
+	SIL_QUIRK_MOD15WRITE	= (1 << 0),
+	SIL_QUIRK_UDMA5MAX	= (1 << 1),
 };
 
 static void sil_set_piomode (struct ata_port *ap, struct ata_device *adev,
@@ -62,9 +80,33 @@
 
 static struct pci_device_id sil_pci_tbl[] = {
 	{ 0x1095, 0x3112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 },
+	{ 0x1095, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 },
+	{ 0x1095, 0x3512, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 },
+	{ 0x1095, 0x3114, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3114 },
 	{ }	/* terminate list */
 };
 
+
+/* TODO firmware versions should be added - eric */
+struct sil_drivelist {
+	const char * product;
+	unsigned int quirk;
+} sil_blacklist [] = {
+	{ "ST320012AS",		SIL_QUIRK_MOD15WRITE },
+	{ "ST330013AS",		SIL_QUIRK_MOD15WRITE },
+	{ "ST340017AS",		SIL_QUIRK_MOD15WRITE },
+	{ "ST360015AS",		SIL_QUIRK_MOD15WRITE },
+	{ "ST380023AS",		SIL_QUIRK_MOD15WRITE },
+	{ "ST3120023AS",	SIL_QUIRK_MOD15WRITE },
+	{ "ST340014ASL",	SIL_QUIRK_MOD15WRITE },
+	{ "ST360014ASL",	SIL_QUIRK_MOD15WRITE },
+	{ "ST380011ASL",	SIL_QUIRK_MOD15WRITE },
+	{ "ST3120022ASL",	SIL_QUIRK_MOD15WRITE },
+	{ "ST3160021ASL",	SIL_QUIRK_MOD15WRITE },
+	{ "Maxtor 4D060H3",	SIL_QUIRK_UDMA5MAX },
+	{ }
+};
+
 static struct pci_driver sil_pci_driver = {
 	.name			= DRV_NAME,
 	.id_table		= sil_pci_tbl,
@@ -120,6 +162,14 @@
 		.pio_mask	= 0x03,			/* pio3-4 */
 		.udma_mask	= 0x7f,			/* udma0-6; FIXME */
 		.port_ops	= &sil_ops,
+	}, /* sil_3114 */
+	{
+		.sht		= &sil_sht,
+		.host_flags	= ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
+				  ATA_FLAG_SRST | ATA_FLAG_MMIO,
+		.pio_mask	= 0x03,			/* pio3-4 */
+		.udma_mask	= 0x7f,			/* udma0-6; FIXME */
+		.port_ops	= &sil_ops,
 	},
 };
 
@@ -182,34 +232,52 @@
  *	information on these errata, I will create a more exhaustive
  *	list, and apply the fixups to only the specific
  *	devices/hosts/firmwares that need it.
+ *
+ *	20040111 - Seagate drives affected by the Mod15Write bug are blacklisted
+ *	The Maxtor quirk is in the blacklist, but I'm keeping the original
+ *	pessimistic fix for the following reasons:
+ *	- There seems to be less info on it, only one device gleaned off the
+ *	Windows	driver, maybe only one is affected.  More info would be greatly
+ *	appreciated.
+ *	- But then again UDMA5 is hardly anything to complain about
  */
 static void sil_dev_config(struct ata_port *ap, struct ata_device *dev)
 {
+	unsigned int n, quirks = 0;
+	u32 class_rev = 0;
 	const char *s = &dev->product[0];
 	unsigned int len = strnlen(s, sizeof(dev->product));
 
+	pci_read_config_dword(ap->host_set->pdev, PCI_CLASS_REVISION, &class_rev);
+	class_rev &= 0xff;
+
 	/* ATAPI specifies that empty space is blank-filled; remove blanks */
 	while ((len > 0) && (s[len - 1] == ' '))
 		len--;
 
-	/* limit to udma5 */
-	if (!memcmp(s, "Maxtor ", 7)) {
-		printk(KERN_INFO "ata%u(%u): applying pessimistic Maxtor errata fix\n",
+	for (n = 0; sil_blacklist[n].product; n++) 
+		if (!memcmp(sil_blacklist[n].product, s,
+			    strlen(sil_blacklist[n].product))) {
+			quirks = sil_blacklist[n].quirk;
+			break;
+		}
+	
+	/* limit requests to 15 sectors */
+	if ((class_rev <= 0x01) && (quirks & SIL_QUIRK_MOD15WRITE)) {
+		printk(KERN_INFO "ata%u(%u): applying Seagate errata fix\n",
 		       ap->id, dev->devno);
-		ap->udma_mask &= ATA_UDMA5;
+		ap->host->max_sectors = 15;
+		ap->host->hostt->max_sectors = 15;
 		return;
 	}
 
-	/* limit requests to 15 sectors */
-	if ((len > 4) && (!memcmp(s, "ST", 2))) {
-		if ((!memcmp(s + len - 2, "AS", 2)) ||
-		    (!memcmp(s + len - 3, "ASL", 3))) {
-			printk(KERN_INFO "ata%u(%u): applying pessimistic Seagate errata fix\n",
-			       ap->id, dev->devno);
-			ap->host->max_sectors = 15;
-			ap->host->hostt->max_sectors = 15;
-			return;
-		}
+	/* limit to udma5 */
+	/* is this for (class_rev <= 0x01) only, too? */
+	if (quirks & SIL_QUIRK_UDMA5MAX) {
+		printk(KERN_INFO "ata%u(%u): applying Maxtor errata fix %s\n",
+		       ap->id, dev->devno, s);
+		ap->udma_mask &= ATA_UDMA5;
+		return;
 	}
 }
 
@@ -236,6 +304,7 @@
 	unsigned long base;
 	void *mmio_base;
 	int rc;
+	u32 tmp;
 
 	if (!printed_version++)
 		printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
@@ -267,7 +336,7 @@
 	probe_ent->pdev = pdev;
 	probe_ent->port_ops = sil_port_info[ent->driver_data].port_ops;
 	probe_ent->sht = sil_port_info[ent->driver_data].sht;
-	probe_ent->n_ports = 2;
+	probe_ent->n_ports = (ent->driver_data == sil_3114) ? 4 : 2;
 	probe_ent->pio_mask = sil_port_info[ent->driver_data].pio_mask;
 	probe_ent->udma_mask = sil_port_info[ent->driver_data].udma_mask;
        	probe_ent->irq = pdev->irq;
@@ -295,6 +364,28 @@
 	probe_ent->port[1].bmdma_addr = base + SIL_IDE1_BMDMA;
 	probe_ent->port[1].scr_addr = base + SIL_IDE1_SCR;
 	ata_std_ports(&probe_ent->port[1]);
+
+	/* make sure IDE0/1 interrupts are not masked */
+	tmp = readl(mmio_base + SIL_SYSCFG);
+	if (tmp & (SIL_MASK_IDE0_INT | SIL_MASK_IDE1_INT)) {
+		tmp &= ~(SIL_MASK_IDE0_INT | SIL_MASK_IDE1_INT);
+		writel(tmp, mmio_base + SIL_SYSCFG);
+		readl(mmio_base + SIL_SYSCFG);	/* flush */
+	}
+
+	if (ent->driver_data == sil_3114) {
+		probe_ent->port[2].cmd_addr = base + SIL_IDE2_TF;
+		probe_ent->port[2].ctl_addr = base + SIL_IDE2_CTL;
+		probe_ent->port[2].bmdma_addr = base + SIL_IDE2_BMDMA;
+		probe_ent->port[2].scr_addr = base + SIL_IDE2_SCR;
+		ata_std_ports(&probe_ent->port[2]);
+
+		probe_ent->port[3].cmd_addr = base + SIL_IDE3_TF;
+		probe_ent->port[3].ctl_addr = base + SIL_IDE3_CTL;
+		probe_ent->port[3].bmdma_addr = base + SIL_IDE3_BMDMA;
+		probe_ent->port[3].scr_addr = base + SIL_IDE3_SCR;
+		ata_std_ports(&probe_ent->port[3]);
+	}
 
 	pci_set_master(pdev);
 
diff -Nru a/drivers/scsi/sata_svw.c b/drivers/scsi/sata_svw.c
--- a/drivers/scsi/sata_svw.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/scsi/sata_svw.c	Tue Feb  3 19:45:30 2004
@@ -38,13 +38,41 @@
 #include "hosts.h"
 #include <linux/libata.h>
 
-#ifdef CONFIG_ALL_PPC
+#ifdef CONFIG_PPC_OF
 #include <asm/prom.h>
 #include <asm/pci-bridge.h>
-#endif /* CONFIG_ALL_PPC */
+#endif /* CONFIG_PPC_OF */
 
-#define DRV_NAME	"ata_k2"
-#define DRV_VERSION	"1.03"
+#define DRV_NAME	"sata_svw"
+#define DRV_VERSION	"1.04"
+
+/* Taskfile registers offsets */
+#define K2_SATA_TF_CMD_OFFSET		0x00
+#define K2_SATA_TF_DATA_OFFSET		0x00
+#define K2_SATA_TF_ERROR_OFFSET		0x04
+#define K2_SATA_TF_NSECT_OFFSET		0x08
+#define K2_SATA_TF_LBAL_OFFSET		0x0c
+#define K2_SATA_TF_LBAM_OFFSET		0x10
+#define K2_SATA_TF_LBAH_OFFSET		0x14
+#define K2_SATA_TF_DEVICE_OFFSET	0x18
+#define K2_SATA_TF_CMDSTAT_OFFSET      	0x1c
+#define K2_SATA_TF_CTL_OFFSET		0x20
+
+/* DMA base */
+#define K2_SATA_DMA_CMD_OFFSET		0x30
+
+/* SCRs base */
+#define K2_SATA_SCR_STATUS_OFFSET	0x40
+#define K2_SATA_SCR_ERROR_OFFSET	0x44
+#define K2_SATA_SCR_CONTROL_OFFSET	0x48
+
+/* Others */
+#define K2_SATA_SICR1_OFFSET		0x80
+#define K2_SATA_SICR2_OFFSET		0x84
+#define K2_SATA_SIM_OFFSET		0x88
+
+/* Port stride */
+#define K2_SATA_PORT_OFFSET		0x100
 
 
 static u32 k2_sata_scr_read (struct ata_port *ap, unsigned int sc_reg)
@@ -139,7 +167,7 @@
 }
 
 
-#ifdef CONFIG_ALL_PPC
+#ifdef CONFIG_PPC_OF
 /*
  * k2_sata_proc_info
  * inout : decides on the direction of the dataflow and the meaning of the
@@ -151,29 +179,15 @@
  * length: If inout==FALSE max number of bytes to be written into the buffer
  *	   else number of bytes in the buffer
  */
-static int k2_sata_proc_info(char *page, char **start, off_t offset, int count,
-		   int hostno, int inout)
+static int k2_sata_proc_info(struct Scsi_Host *shost, char *page, char **start,
+			     off_t offset, int count, int inout)
 {
-	struct Scsi_Host *hpnt;
 	struct ata_port *ap;
 	struct device_node *np;
 	int len, index;
 
-	/* Find ourself. That's locking-broken, shitty etc... but thanks to
-	 * /proc/scsi interface and lack of state kept around in this driver,
-	 * its best I want to do for now...
-	 */
-	hpnt = scsi_hostlist;
-	while (hpnt) {
-		if (hostno == hpnt->host_no)
-			break;
-		hpnt = hpnt->next;
-	}
-	if (!hpnt)
-		return 0;
-
 	/* Find  the ata_port */
-	ap = (struct ata_port *) &hpnt->hostdata[0];
+	ap = (struct ata_port *) &shost->hostdata[0];
 	if (ap == NULL)
 		return 0;
 
@@ -198,7 +212,7 @@
 
 	return len;
 }
-#endif /* CONFIG_ALL_PPC */
+#endif /* CONFIG_PPC_OF */
 
 
 static Scsi_Host_Template k2_sata_sht = {
@@ -216,8 +230,8 @@
 	.proc_name		= DRV_NAME,
 	.dma_boundary		= ATA_DMA_BOUNDARY,
 	.slave_configure	= ata_scsi_slave_config,
-#ifdef CONFIG_ALL_PPC
-	.proc_info		= k2_sata_proc_info
+#ifdef CONFIG_PPC_OF
+	.proc_info		= k2_sata_proc_info,
 #endif
 	.bios_param		= ata_std_bios_param,
 };
@@ -243,21 +257,20 @@
 	.port_stop		= ata_port_stop,
 };
 
-
 static void k2_sata_setup_port(struct ata_ioports *port, unsigned long base)
 {
-	port->cmd_addr = base;
-	port->data_addr = base;
-	port->error_addr = base + 0x4;
-	port->nsect_addr = base + 0x8;
-	port->lbal_addr = base + 0xc;
-	port->lbam_addr = base + 0x10;
-	port->lbah_addr = base + 0x14;
-	port->device_addr = base + 0x18;
-	port->cmdstat_addr = base + 0x1c;
-	port->ctl_addr = base + 0x20;
-	port->bmdma_addr = base + 0x30;
-	port->scr_addr = base + 0x40;
+	port->cmd_addr		= base + K2_SATA_TF_CMD_OFFSET;
+	port->data_addr		= base + K2_SATA_TF_DATA_OFFSET;
+	port->error_addr	= base + K2_SATA_TF_ERROR_OFFSET;
+	port->nsect_addr	= base + K2_SATA_TF_NSECT_OFFSET;
+	port->lbal_addr		= base + K2_SATA_TF_LBAL_OFFSET;
+	port->lbam_addr		= base + K2_SATA_TF_LBAM_OFFSET;
+	port->lbah_addr		= base + K2_SATA_TF_LBAH_OFFSET;
+	port->device_addr	= base + K2_SATA_TF_DEVICE_OFFSET;
+	port->cmdstat_addr	= base + K2_SATA_TF_CMDSTAT_OFFSET;
+	port->ctl_addr		= base + K2_SATA_TF_CTL_OFFSET;
+	port->bmdma_addr	= base + K2_SATA_DMA_CMD_OFFSET;
+	port->scr_addr		= base + K2_SATA_SCR_STATUS_OFFSET;
 }
 
 
@@ -279,7 +292,14 @@
 	rc = pci_enable_device(pdev);
 	if (rc)
 		return rc;
+	/*
+	 * Check if we have resources mapped at all (second function may
+	 * have been disabled by firmware)
+	 */
+	if (pci_resource_len(pdev, 5) == 0)
+		return -ENODEV;
 
+	/* Request PCI regions */
 	rc = pci_request_regions(pdev, DRV_NAME);
 	if (rc)
 		goto err_out;
@@ -306,44 +326,37 @@
 	}
 	base = (unsigned long) mmio_base;
 
-	/*
-	 * Check for the "disabled" second function to avoid registering
-	 * useless interfaces on K2
-	 */
-	if (readl(mmio_base + 0x40)  == 0xffffffffUL &&
-	    readl(mmio_base + 0x140) == 0xffffffffUL) {
-		rc = -ENODEV;
-		goto err_out_unmap;
-	}
-
 	/* Clear a magic bit in SCR1 according to Darwin, those help
 	 * some funky seagate drives (though so far, those were already
 	 * set by the firmware on the machines I had access to
 	 */
-	writel(readl(mmio_base + 0x80) & ~0x00040000, mmio_base + 0x80);
+	writel(readl(mmio_base + K2_SATA_SICR1_OFFSET) & ~0x00040000,
+	       mmio_base + K2_SATA_SICR1_OFFSET);
 
 	/* Clear SATA error & interrupts we don't use */
-	writel(0xffffffff, mmio_base + 0x44);
-	writel(0x0, mmio_base + 0x88);
+	writel(0xffffffff, mmio_base + K2_SATA_SCR_ERROR_OFFSET);
+	writel(0x0, mmio_base + K2_SATA_SIM_OFFSET);
 
 	probe_ent->sht = &k2_sata_sht;
 	probe_ent->host_flags = ATA_FLAG_SATA | ATA_FLAG_SATA_RESET |
 				ATA_FLAG_NO_LEGACY | ATA_FLAG_MMIO;
 	probe_ent->port_ops = &k2_sata_ops;
-	probe_ent->n_ports = 2;
+	probe_ent->n_ports = 4;
 	probe_ent->irq = pdev->irq;
 	probe_ent->irq_flags = SA_SHIRQ;
 	probe_ent->mmio_base = mmio_base;
 
-	/*
-	 * We don't care much about the PIO/UDMA masks, but the core won't like us
+	/* We don't care much about the PIO/UDMA masks, but the core won't like us
 	 * if we don't fill these
 	 */
 	probe_ent->pio_mask = 0x1f;
-	probe_ent->udma_mask = 0x7f;
+	probe_ent->udma_mask = 0x3f;
 
-	k2_sata_setup_port(&probe_ent->port[0], base);
-	k2_sata_setup_port(&probe_ent->port[1], base + 0x100);
+	/* We have 4 ports per PCI function */
+	k2_sata_setup_port(&probe_ent->port[0], base + 0 * K2_SATA_PORT_OFFSET);
+	k2_sata_setup_port(&probe_ent->port[1], base + 1 * K2_SATA_PORT_OFFSET);
+	k2_sata_setup_port(&probe_ent->port[2], base + 2 * K2_SATA_PORT_OFFSET);
+	k2_sata_setup_port(&probe_ent->port[3], base + 3 * K2_SATA_PORT_OFFSET);
 
 	pci_set_master(pdev);
 
@@ -353,8 +366,6 @@
 
 	return 0;
 
-err_out_unmap:
-	iounmap((void *)base);
 err_out_free_ent:
 	kfree(probe_ent);
 err_out_regions:
diff -Nru a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
--- a/drivers/scsi/scsi.c	Tue Feb  3 19:45:26 2004
+++ b/drivers/scsi/scsi.c	Tue Feb  3 19:45:26 2004
@@ -142,6 +142,21 @@
 
 void __scsi_release_request(struct scsi_request *sreq)
 {
+	struct request *req = sreq->sr_request;
+
+	/* unlikely because the tag was usually ended earlier by the
+	 * mid-layer. However, for layering reasons ULD's don't end
+	 * the tag of commands they generate. */
+	if (unlikely(blk_rq_tagged(req))) {
+		unsigned long flags;
+		struct request_queue *q = req->q;
+
+		spin_lock_irqsave(q->queue_lock, flags);
+		blk_queue_end_tag(q, req);
+		spin_unlock_irqrestore(q->queue_lock, flags);
+	}
+
+
 	if (likely(sreq->sr_command != NULL)) {
 		struct scsi_cmnd *cmd = sreq->sr_command;
 
@@ -441,7 +456,7 @@
 			case FAILED:
 				printk("FAILED ");
 				break;
-			case TIMEOUT:
+			case TIMEOUT_ERROR:
 				/* 
 				 * If called via scsi_times_out.
 				 */
diff -Nru a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
--- a/drivers/scsi/scsi_error.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/scsi/scsi_error.c	Tue Feb  3 19:45:16 2004
@@ -164,7 +164,7 @@
  **/
 void scsi_times_out(struct scsi_cmnd *scmd)
 {
-	scsi_log_completion(scmd, TIMEOUT);
+	scsi_log_completion(scmd, TIMEOUT_ERROR);
 	if (unlikely(!scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD))) {
 		panic("Error handler thread not present at %p %p %s %d",
 		      scmd, scmd->device->host, __FILE__, __LINE__);
@@ -1420,23 +1420,21 @@
 	list_for_each_safe(lh, lh_sf, done_q) {
 		scmd = list_entry(lh, struct scsi_cmnd, eh_entry);
 		list_del_init(lh);
-		if (!scmd->device->online) {
-			 scmd->result |= (DRIVER_TIMEOUT << 24);
-		} else {
-			if (++scmd->retries < scmd->allowed) {
-				SCSI_LOG_ERROR_RECOVERY(3,
-					printk("%s: flush retry"
-					       " cmd: %p\n",
-						  current->comm,
-						  scmd));
+		if (scmd->device->online &&
+		    	(++scmd->retries < scmd->allowed)) {
+			SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush"
+							  " retry cmd: %p\n",
+							  current->comm,
+							  scmd));
 				scsi_queue_insert(scmd, SCSI_MLQUEUE_EH_RETRY);
-				continue;
-			}
+		} else {
+			if (!scmd->result)
+				scmd->result |= (DRIVER_TIMEOUT << 24);
+			SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush finish"
+							" cmd: %p\n",
+							current->comm, scmd));
+			scsi_finish_command(scmd);
 		}
-		SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush finish"
-				       " cmd: %p\n",
-					  current->comm, scmd));
-		scsi_finish_command(scmd);
 	}
 }
 
diff -Nru a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
--- a/drivers/scsi/scsi_scan.c	Tue Feb  3 19:45:37 2004
+++ b/drivers/scsi/scsi_scan.c	Tue Feb  3 19:45:37 2004
@@ -254,7 +254,7 @@
 			 "%d:%d:%d:%d", sdev->host->host_no,
 			 sdev->channel, sdev->id, sdev->lun);
 	} else
-		goto out_free_queue;
+		goto out_cleanup_slave;
 
 	/*
 	 * If there are any same target siblings, add this to the
@@ -283,6 +283,9 @@
 	spin_unlock_irqrestore(shost->host_lock, flags);
 	return sdev;
 
+out_cleanup_slave:
+	if (shost->hostt->slave_destroy)
+		shost->hostt->slave_destroy(sdev);
 out_free_queue:
 	scsi_free_queue(sdev->request_queue);
 out_free_dev:
diff -Nru a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
--- a/drivers/scsi/scsi_sysfs.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/scsi/scsi_sysfs.c	Tue Feb  3 19:45:17 2004
@@ -361,7 +361,6 @@
 	if (error) {
 		printk(KERN_INFO "error 2\n");
 		goto clean_device;
-		return error;
 	}
 
 	get_device(&sdev->sdev_gendev);
@@ -370,8 +369,10 @@
 		for (i = 0; sdev->host->hostt->sdev_attrs[i]; i++) {
 			error = attr_add(&sdev->sdev_gendev,
 					sdev->host->hostt->sdev_attrs[i]);
-			if (error)
+			if (error) {
 				scsi_remove_device(sdev);
+				goto out;
+			}
 		}
 	}
 	
@@ -380,11 +381,14 @@
 					scsi_sysfs_sdev_attrs[i])) {
 			error = device_create_file(&sdev->sdev_gendev,
 					scsi_sysfs_sdev_attrs[i]);
-			if (error)
+			if (error) {
 				scsi_remove_device(sdev);
+				goto out;
+			}
 		}
 	}
 
+ out:
 	return error;
 
 clean_device:
@@ -394,7 +398,6 @@
 	put_device(&sdev->sdev_gendev);
 
 	return error;
-
 }
 
 /**
diff -Nru a/drivers/scsi/sr.c b/drivers/scsi/sr.c
--- a/drivers/scsi/sr.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/scsi/sr.c	Tue Feb  3 19:45:17 2004
@@ -67,7 +67,8 @@
 	(CDC_CLOSE_TRAY|CDC_OPEN_TRAY|CDC_LOCK|CDC_SELECT_SPEED| \
 	 CDC_SELECT_DISC|CDC_MULTI_SESSION|CDC_MCN|CDC_MEDIA_CHANGED| \
 	 CDC_PLAY_AUDIO|CDC_RESET|CDC_IOCTLS|CDC_DRIVE_STATUS| \
-	 CDC_CD_R|CDC_CD_RW|CDC_DVD|CDC_DVD_R|CDC_DVD_RAM|CDC_GENERIC_PACKET)
+	 CDC_CD_R|CDC_CD_RW|CDC_DVD|CDC_DVD_R|CDC_DVD_RAM|CDC_GENERIC_PACKET| \
+	 CDC_MRW|CDC_MRW_W|CDC_RAM)
 
 static int sr_probe(struct device *);
 static int sr_remove(struct device *);
@@ -692,7 +693,7 @@
 static void get_capabilities(struct scsi_cd *cd)
 {
 	unsigned char *buffer;
-	int rc, n;
+	int rc, n, mrw_write = 0, mrw = 1;
 	struct scsi_mode_data data;
 	struct scsi_request *SRpnt;
 	unsigned char cmd[MAX_COMMAND_SIZE];
@@ -765,6 +766,15 @@
 		printk("%s: scsi-1 drive\n", cd->cdi.name);
 		return;
 	}
+
+	if (cdrom_is_mrw(&cd->cdi, &mrw_write)) {
+		mrw = 0;
+		cd->cdi.mask |= CDC_MRW;
+		cd->cdi.mask |= CDC_MRW_W;
+	}
+	if (!mrw_write)
+		cd->cdi.mask |= CDC_MRW_W;
+
 	n = data.header_length + data.block_descriptor_length;
 	cd->cdi.speed = ((buffer[n + 8] << 8) + buffer[n + 9]) / 176;
 	cd->readcd_known = 1;
@@ -788,9 +798,7 @@
 	if ((buffer[n + 3] & 0x20) == 0) {
 		/* can't write DVD-RAM media */
 		cd->cdi.mask |= CDC_DVD_RAM;
-	} else {
-		cd->device->writeable = 1;
-	}
+	} else
 	if ((buffer[n + 3] & 0x10) == 0)
 		/* can't write DVD-R media */
 		cd->cdi.mask |= CDC_DVD_R;
@@ -813,6 +821,12 @@
 		cd->cdi.mask |= CDC_SELECT_DISC;
 	/*else    I don't think it can close its tray
 		cd->cdi.mask |= CDC_CLOSE_TRAY; */
+
+	/*
+	 * if DVD-RAM of MRW-W, we are randomly writeable
+	 */
+	if ((cd->cdi.mask & (CDC_DVD_RAM | CDC_MRW_W)) != (CDC_DVD_RAM | CDC_MRW_W))
+		cd->device->writeable = 1;
 
 	scsi_release_request(SRpnt);
 	kfree(buffer);
diff -Nru a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
--- a/drivers/scsi/sym53c8xx_2/sym_glue.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.c	Tue Feb  3 19:45:43 2004
@@ -2177,7 +2177,7 @@
  *  Detach the host.
  *  We have to free resources and halt the NCR chip.
  */
-static int __devexit sym_detach(struct sym_hcb *np)
+static int sym_detach(struct sym_hcb *np)
 {
 	printk("%s: detaching ...\n", sym_name(np));
 
diff -Nru a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c	Tue Feb  3 19:45:16 2004
@@ -1058,12 +1058,10 @@
 		 *  and BUS width.
 		 */
 		if (np->features & FE_ULTRA3) {
-			if (tp->tinfo.user.period <= 9	&&
-			    tp->tinfo.user.width == BUS_16_BIT) {
-				tp->tinfo.user.options |= PPR_OPT_DT;
-				tp->tinfo.user.offset   = np->maxoffs_dt;
-				tp->tinfo.user.spi_version = 3;
-			}
+			tp->tinfo.user.options |= PPR_OPT_DT;
+			tp->tinfo.user.period = np->minsync_dt;
+			tp->tinfo.user.offset = np->maxoffs_dt;
+			tp->tinfo.user.spi_version = 3;
 		}
 
 		if (!tp->usrtags)
@@ -2126,9 +2124,15 @@
 
 	sym_settrans(np, target, 0, ofs, per, wide, div, fak);
 
-	tp->tinfo.goal.period	= tp->tinfo.curr.period  = per;
-	tp->tinfo.goal.offset	= tp->tinfo.curr.offset  = ofs;
-	tp->tinfo.goal.options	= tp->tinfo.curr.options = 0;
+	tp->tinfo.curr.period  = per;
+	tp->tinfo.curr.offset  = ofs;
+	tp->tinfo.curr.options = 0;
+
+	if (!(tp->tinfo.goal.options & PPR_OPT_MASK)) {
+		tp->tinfo.goal.period	= per;
+		tp->tinfo.goal.offset	= ofs;
+		tp->tinfo.goal.options	= 0;
+	}
 
 	sym_xpt_async_nego_sync(np, target);
 }
diff -Nru a/drivers/scsi/sym53c8xx_2/sym_misc.c b/drivers/scsi/sym53c8xx_2/sym_misc.c
--- a/drivers/scsi/sym53c8xx_2/sym_misc.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/scsi/sym53c8xx_2/sym_misc.c	Tue Feb  3 19:45:41 2004
@@ -328,7 +328,6 @@
 	    tp->inq_byte56  != inq_byte56) {
 		tp->inq_version = inq_version;
 		tp->inq_byte7   = inq_byte7;
-		tp->inq_byte56  = inq_byte56;
 		return 1;
 	}
 	return 0;
diff -Nru a/drivers/serial/8250_acpi.c b/drivers/serial/8250_acpi.c
--- a/drivers/serial/8250_acpi.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/serial/8250_acpi.c	Tue Feb  3 19:45:42 2004
@@ -1,6 +1,7 @@
 /*
- * serial/acpi.c
  * Copyright (c) 2002-2003 Matthew Wilcox for Hewlett-Packard
+ * Copyright (C) 2004 Hewlett-Packard Co
+ *	Bjorn Helgaas <bjorn.helgaas@hp.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -11,13 +12,21 @@
 #include <linux/acpi.h>
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/tty.h>
 #include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_core.h>
 
 #include <acpi/acpi_bus.h>
 
 #include <asm/io.h>
 #include <asm/serial.h>
 
+struct serial_private {
+	int	line;
+	void	*iomem_base;
+};
+
 static acpi_status acpi_serial_mmio(struct serial_struct *req,
 				    struct acpi_resource_address64 *addr)
 {
@@ -94,38 +103,72 @@
 
 static int acpi_serial_add(struct acpi_device *device)
 {
+	struct serial_private *priv;
 	acpi_status status;
 	struct serial_struct serial_req;
-	int line;
+	int result;
 
 	memset(&serial_req, 0, sizeof(serial_req));
 
+	priv = kmalloc(sizeof(struct serial_private), GFP_KERNEL);
+	if (!priv) {
+		result = -ENOMEM;
+		goto fail;
+	}
+	memset(priv, 0, sizeof(*priv));
+
 	status = acpi_walk_resources(device->handle, METHOD_NAME__CRS,
 				     acpi_serial_resource, &serial_req);
-	if (ACPI_FAILURE(status))
-		return -ENODEV;
+	if (ACPI_FAILURE(status)) {
+		result = -ENODEV;
+		goto fail;
+	}
 
-	if (!serial_req.iomem_base && !serial_req.port) {
+	if (serial_req.iomem_base)
+		priv->iomem_base = serial_req.iomem_base;
+	else if (!serial_req.port) {
 		printk(KERN_ERR "%s: no iomem or port address in %s _CRS\n",
 			__FUNCTION__, device->pnp.bus_id);
-		return -ENODEV;
+		result = -ENODEV;
+		goto fail;
 	}
 
 	serial_req.baud_base = BASE_BAUD;
-	serial_req.flags = ASYNC_SKIP_TEST|ASYNC_BOOT_AUTOCONF|ASYNC_AUTO_IRQ;
+	serial_req.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF |
+			   UPF_AUTO_IRQ  | UPF_RESOURCES;
 
-	line = register_serial(&serial_req);
-	if (line < 0) {
-		printk(KERN_WARNING "Couldn't register serial port %s: %d",
-			device->pnp.bus_id, line);
-		return -ENODEV;
+	priv->line = register_serial(&serial_req);
+	if (priv->line < 0) {
+		printk(KERN_WARNING "Couldn't register serial port %s: %d\n",
+			device->pnp.bus_id, priv->line);
+		result = -ENODEV;
+		goto fail;
 	}
 
+	acpi_driver_data(device) = priv;
 	return 0;
+
+fail:
+	if (serial_req.iomem_base)
+		iounmap(serial_req.iomem_base);
+	kfree(priv);
+
+	return result;
 }
 
 static int acpi_serial_remove(struct acpi_device *device, int type)
 {
+	struct serial_private *priv;
+
+	if (!device || !acpi_driver_data(device))
+		return -EINVAL;
+
+	priv = acpi_driver_data(device);
+	unregister_serial(priv->line);
+	if (priv->iomem_base)
+		iounmap(priv->iomem_base);
+	kfree(priv);
+
 	return 0;
 }
 
diff -Nru a/drivers/serial/8250_hcdp.c b/drivers/serial/8250_hcdp.c
--- a/drivers/serial/8250_hcdp.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/serial/8250_hcdp.c	Tue Feb  3 19:45:41 2004
@@ -185,7 +185,7 @@
 #else
 		port.irq = gsi;
 #endif
-		port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF;
+		port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF | UPF_RESOURCES;
 		if (gsi)
 			port.flags |= ASYNC_AUTO_IRQ;
 
diff -Nru a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c
--- a/drivers/serial/8250_pnp.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/serial/8250_pnp.c	Tue Feb  3 19:45:16 2004
@@ -295,6 +295,8 @@
 	{	"USR2080",		0	},
 	/* U.S. Robotics 56K FAX INT */
 	{	"USR3031",		0	},
+	/* U.S. Robotics 56K FAX INT */
+	{	"USR3050",		0	},
 	/* U.S. Robotics 56K Voice INT PnP */
 	{	"USR3070",		0	},
 	/* U.S. Robotics 56K Voice EXT PnP */
diff -Nru a/drivers/serial/Kconfig b/drivers/serial/Kconfig
--- a/drivers/serial/Kconfig	Tue Feb  3 19:45:42 2004
+++ b/drivers/serial/Kconfig	Tue Feb  3 19:45:42 2004
@@ -62,6 +62,15 @@
 
 	  If unsure, say N.
 
+config SERIAL_8250_HCDP
+	bool "Console device discovery via EFI HCDP table"
+	depends on IA64
+	depends on SERIAL_8250_CONSOLE=y
+	---help---
+	  If you wish to make the serial console port described by the EFI
+	  HCDP table available for use as serial console, say Y here.  See
+	  <http://www.dig64.org/specifications/DIG64_HCDPv10a_01.pdf>.
+
 config SERIAL_8250_CS
 	tristate "8250/16550 PCMCIA device support"
 	depends on PCMCIA && SERIAL_8250
@@ -83,15 +92,6 @@
 	---help---
 	  If you wish to enable serial port discovery via the ACPI
 	  namespace, say Y here.  If unsure, say N.
-
-config SERIAL_8250_HCDP
-	bool "8250/16550 device discovery support via EFI HCDP table"
-	depends on IA64 && SERIAL_8250
-	---help---
-	  If you wish to make the serial console port described by the EFI
-	  HCDP table available for use as serial console or general
-	  purpose port, say Y here. See
-	  <http://www.dig64.org/specifications/DIG64_HCDPv10a_01.pdf>.
 
 config SERIAL_8250_NR_UARTS
 	int "Maximum number of non-legacy 8250/16550 serial ports"
diff -Nru a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
--- a/drivers/serial/serial_core.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/serial/serial_core.c	Tue Feb  3 19:45:17 2004
@@ -529,8 +529,7 @@
 {
 	struct uart_state *state = tty->driver_data;
 
-	if (tty)
-		__uart_put_char(state->port, &state->info->xmit, ch);
+	__uart_put_char(state->port, &state->info->xmit, ch);
 }
 
 static void uart_flush_chars(struct tty_struct *tty)
@@ -545,7 +544,7 @@
 	struct uart_state *state = tty->driver_data;
 	int ret;
 
-	if (!tty || !state->info->xmit.buf)
+	if (!state->info->xmit.buf)
 		return 0;
 
 	if (from_user)
@@ -833,13 +832,17 @@
 	if (state->info->flags & UIF_INITIALIZED) {
 		if (((old_flags ^ port->flags) & UPF_SPD_MASK) ||
 		    old_custom_divisor != port->custom_divisor) {
-			/* If they're setting up a custom divisor or speed,
+			/*
+			 * If they're setting up a custom divisor or speed,
 			 * instead of clearing it, then bitch about it. No
-			 * need to rate-limit; it's CAP_SYS_ADMIN only. */
+			 * need to rate-limit; it's CAP_SYS_ADMIN only.
+			 */
 			if (port->flags & UPF_SPD_MASK) {
-				printk(KERN_NOTICE "%s sets custom speed on %s%d. This is deprecated.\n",
-				       current->comm, state->info->tty->driver->name, 
-				       state->port->line);
+				char buf[64];
+				printk(KERN_NOTICE
+				       "%s sets custom speed on %s. This "
+				       "is deprecated.\n", current->comm,
+				       tty_name(state->info->tty, buf));
 			}
 			uart_change_speed(state, NULL);
 		}
@@ -1209,9 +1212,15 @@
 static void uart_close(struct tty_struct *tty, struct file *filp)
 {
 	struct uart_state *state = tty->driver_data;
-	struct uart_port *port = state->port;
+	struct uart_port *port;
 
 	BUG_ON(!kernel_locked());
+
+	if (!state || !state->port)
+		return;
+
+	port = state->port;
+
 	DPRINTK("uart_close(%d) called\n", port->line);
 
 	down(&state->sem);
diff -Nru a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c
--- a/drivers/serial/serial_cs.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/serial/serial_cs.c	Tue Feb  3 19:45:18 2004
@@ -149,9 +149,9 @@
 		info->link.dev = NULL;
 
 		if (!info->slave) {
-			CardServices(ReleaseConfiguration, info->link.handle);
-			CardServices(ReleaseIO, info->link.handle, &info->link.io);
-			CardServices(ReleaseIRQ, info->link.handle, &info->link.irq);
+			pcmcia_release_configuration(info->link.handle);
+			pcmcia_release_io(info->link.handle, &info->link.io);
+			pcmcia_release_irq(info->link.handle, &info->link.irq);
 		}
 
 		info->link.state &= ~DEV_CONFIG;
@@ -211,7 +211,7 @@
 	client_reg.event_handler = &serial_event;
 	client_reg.Version = 0x0210;
 	client_reg.event_callback_args.client_data = link;
-	ret = CardServices(RegisterClient, &link->handle, &client_reg);
+	ret = pcmcia_register_client(&link->handle, &client_reg);
 	if (ret != CS_SUCCESS) {
 		cs_error(link->handle, RegisterClient, ret);
 		serial_detach(link);
@@ -256,7 +256,7 @@
 	serial_remove(link);
 
 	if (link->handle) {
-		ret = CardServices(DeregisterClient, link->handle);
+		ret = pcmcia_deregister_client(link->handle);
 		if (ret != CS_SUCCESS)
 			cs_error(link->handle, DeregisterClient, ret);
 	}
@@ -300,20 +300,30 @@
 /*====================================================================*/
 
 static int
-get_tuple(int fn, client_handle_t handle, tuple_t * tuple, cisparse_t * parse)
+first_tuple(client_handle_t handle, tuple_t * tuple, cisparse_t * parse)
 {
 	int i;
-	i = CardServices(fn, handle, tuple);
+	i = pcmcia_get_first_tuple(handle, tuple);
 	if (i != CS_SUCCESS)
 		return CS_NO_MORE_ITEMS;
-	i = CardServices(GetTupleData, handle, tuple);
+	i = pcmcia_get_tuple_data(handle, tuple);
 	if (i != CS_SUCCESS)
 		return i;
-	return CardServices(ParseTuple, handle, tuple, parse);
+	return pcmcia_parse_tuple(handle, tuple, parse);
 }
 
-#define first_tuple(a, b, c) get_tuple(GetFirstTuple, a, b, c)
-#define next_tuple(a, b, c) get_tuple(GetNextTuple, a, b, c)
+static int
+next_tuple(client_handle_t handle, tuple_t * tuple, cisparse_t * parse)
+{
+	int i;
+	i = pcmcia_get_next_tuple(handle, tuple);
+	if (i != CS_SUCCESS)
+		return CS_NO_MORE_ITEMS;
+	i = pcmcia_get_tuple_data(handle, tuple);
+	if (i != CS_SUCCESS)
+		return i;
+	return pcmcia_parse_tuple(handle, tuple, parse);
+}
 
 /*====================================================================*/
 
@@ -330,7 +340,7 @@
 	int i, j, try;
 
 	/* If the card is already configured, look up the port and irq */
-	i = CardServices(GetConfigurationInfo, handle, &config);
+	i = pcmcia_get_configuration_info(handle, &config);
 	if ((i == CS_SUCCESS) && (config.Attributes & CONF_VALID_CLIENT)) {
 		ioaddr_t port = 0;
 		if ((config.BasePort2 != 0) && (config.NumPorts2 == 8)) {
@@ -367,9 +377,7 @@
 				link->io.BasePort1 = cf->io.win[0].base;
 				link->io.IOAddrLines = (try == 0) ?
 				    16 : cf->io.flags & CISTPL_IO_LINES_MASK;
-				i =
-				    CardServices(RequestIO, link->handle,
-						 &link->io);
+				i = pcmcia_request_io(link->handle, &link->io);
 				if (i == CS_SUCCESS)
 					goto found_port;
 			}
@@ -389,8 +397,7 @@
 			for (j = 0; j < 5; j++) {
 				link->io.BasePort1 = base[j];
 				link->io.IOAddrLines = base[j] ? 16 : 3;
-				i = CardServices(RequestIO, link->handle,
-						 &link->io);
+				i = pcmcia_request_io(link->handle, &link->io);
 				if (i == CS_SUCCESS)
 					goto found_port;
 			}
@@ -406,14 +413,14 @@
 		return -1;
 	}
 
-	i = CardServices(RequestIRQ, link->handle, &link->irq);
+	i = pcmcia_request_irq(link->handle, &link->irq);
 	if (i != CS_SUCCESS) {
 		cs_error(link->handle, RequestIRQ, i);
 		link->irq.AssignedIRQ = 0;
 	}
 	if (info->multi && (info->manfid == MANFID_3COM))
 		link->conf.ConfigIndex &= ~(0x08);
-	i = CardServices(RequestConfiguration, link->handle, &link->conf);
+	i = pcmcia_request_configuration(link->handle, &link->conf);
 	if (i != CS_SUCCESS) {
 		cs_error(link->handle, RequestConfiguration, i);
 		return -1;
@@ -433,7 +440,7 @@
 	config_info_t config;
 	int i, base2 = 0;
 
-	i = CardServices(GetConfigurationInfo, handle, &config);
+	i = pcmcia_get_configuration_info(handle, &config);
 	if (i != CS_SUCCESS) {
 		cs_error(handle, GetConfigurationInfo, i);
 		return -1;
@@ -458,7 +465,7 @@
 			link->io.BasePort1 = cf->io.win[0].base;
 			link->io.IOAddrLines =
 			    cf->io.flags & CISTPL_IO_LINES_MASK;
-			i = CardServices(RequestIO, link->handle, &link->io);
+			i = pcmcia_request_io(link->handle, &link->io);
 			base2 = link->io.BasePort1 + 8;
 			if (i == CS_SUCCESS)
 				break;
@@ -478,9 +485,7 @@
 				link->io.BasePort2 = cf->io.win[1].base;
 				link->io.IOAddrLines =
 				    cf->io.flags & CISTPL_IO_LINES_MASK;
-				i =
-				    CardServices(RequestIO, link->handle,
-						 &link->io);
+				i = pcmcia_request_io(link->handle, &link->io);
 				base2 = link->io.BasePort2;
 				if (i == CS_SUCCESS)
 					break;
@@ -494,7 +499,7 @@
 		return -1;
 	}
 
-	i = CardServices(RequestIRQ, link->handle, &link->irq);
+	i = pcmcia_request_irq(link->handle, &link->irq);
 	if (i != CS_SUCCESS) {
 		printk(KERN_NOTICE
 		       "serial_cs: no usable port range found, giving up\n");
@@ -506,7 +511,7 @@
 		link->conf.Present |= PRESENT_EXT_STATUS;
 		link->conf.ExtStatus = ESR_REQ_ATTN_ENA;
 	}
-	i = CardServices(RequestConfiguration, link->handle, &link->conf);
+	i = pcmcia_request_configuration(link->handle, &link->conf);
 	if (i != CS_SUCCESS) {
 		cs_error(link->handle, RequestConfiguration, i);
 		return -1;
@@ -543,9 +548,6 @@
 
 ======================================================================*/
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
-
 void serial_config(dev_link_t * link)
 {
 	client_handle_t handle = link->handle;
@@ -619,10 +621,18 @@
 
 	if (info->manfid == MANFID_IBM) {
 		conf_reg_t reg = { 0, CS_READ, 0x800, 0 };
-		CS_CHECK(AccessConfigurationRegister, link->handle, &reg);
+		last_ret = pcmcia_access_configuration_register(link->handle, &reg);
+		if (last_ret) {
+			last_fn = AccessConfigurationRegister;
+			goto cs_failed;
+		}
 		reg.Action = CS_WRITE;
 		reg.Value = reg.Value | 1;
-		CS_CHECK(AccessConfigurationRegister, link->handle, &reg);
+		last_ret = pcmcia_access_configuration_register(link->handle, &reg);
+		if (last_ret) {
+			last_fn = AccessConfigurationRegister;
+			goto cs_failed;
+		}
 	}
 
 	link->dev = &info->node[0];
@@ -668,7 +678,7 @@
 		/* Fall through... */
 	case CS_EVENT_RESET_PHYSICAL:
 		if ((link->state & DEV_CONFIG) && !info->slave)
-			CardServices(ReleaseConfiguration, link->handle);
+			pcmcia_release_configuration(link->handle);
 		break;
 
 	case CS_EVENT_PM_RESUME:
@@ -676,8 +686,7 @@
 		/* Fall through... */
 	case CS_EVENT_CARD_RESET:
 		if (DEV_OK(link) && !info->slave)
-			CardServices(RequestConfiguration, link->handle,
-				     &link->conf);
+			pcmcia_request_configuration(link->handle, &link->conf);
 		break;
 	}
 	return 0;
diff -Nru a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
--- a/drivers/serial/sunsab.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/serial/sunsab.c	Tue Feb  3 19:45:17 2004
@@ -101,13 +101,16 @@
 			  union sab82532_irq_status *stat,
 			  struct pt_regs *regs)
 {
-	struct tty_struct *tty = up->port.info->tty;
+	struct tty_struct *tty = NULL;
 	unsigned char buf[32];
 	int saw_console_brk = 0;
 	int free_fifo = 0;
 	int count = 0;
 	int i;
 
+	if (up->port.info != NULL)		/* Unopened serial console */
+		tty = up->port.info->tty;
+
 	/* Read number of BYTES (Character + Status) available. */
 	if (stat->sreg.isr0 & SAB82532_ISR0_RPF) {
 		count = SAB82532_RECV_FIFO_SIZE;
@@ -142,6 +145,11 @@
 	for (i = 0; i < count; i++) {
 		unsigned char ch = buf[i];
 
+		if (tty == NULL) {
+			uart_handle_sysrq_char(&up->port, ch, regs);
+			continue;
+		}
+
 		if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) {
 			tty->flip.work.func((void *)tty);
 			if (tty->flip.count >= TTY_FLIPBUF_SIZE)
@@ -217,7 +225,8 @@
 		}
 	}
 
-	tty_flip_buffer_push(tty);
+	if (tty)
+		tty_flip_buffer_push(tty);
 
 	if (saw_console_brk)
 		sun_do_break();
diff -Nru a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
--- a/drivers/serial/sunzilog.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/serial/sunzilog.c	Tue Feb  3 19:45:43 2004
@@ -723,36 +723,28 @@
 	}
 }
 
-/* The port lock is not held.  */
+/* The port lock is held.  */
 static void sunzilog_stop_rx(struct uart_port *port)
 {
 	struct uart_sunzilog_port *up = UART_ZILOG(port);
 	struct zilog_channel *channel;
-	unsigned long flags;
 
 	if (ZS_IS_CONS(up))
 		return;
 
-	spin_lock_irqsave(&port->lock, flags);
-
 	channel = ZILOG_CHANNEL_FROM_PORT(port);
 
 	/* Disable all RX interrupts.  */
 	up->curregs[R1] &= ~RxINT_MASK;
 	sunzilog_maybe_update_regs(up, channel);
-
-	spin_unlock_irqrestore(&port->lock, flags);
 }
 
-/* The port lock is not held.  */
+/* The port lock is held.  */
 static void sunzilog_enable_ms(struct uart_port *port)
 {
 	struct uart_sunzilog_port *up = (struct uart_sunzilog_port *) port;
 	struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port);
 	unsigned char new_reg;
-	unsigned long flags;
-
-	spin_lock_irqsave(&port->lock, flags);
 
 	new_reg = up->curregs[R15] | (DCDIE | SYNCIE | CTSIE);
 	if (new_reg != up->curregs[R15]) {
@@ -761,8 +753,6 @@
 		/* NOTE: Not subject to 'transmitter active' rule.  */ 
 		write_zsreg(channel, R15, up->curregs[R15]);
 	}
-
-	spin_unlock_irqrestore(&port->lock, flags);
 }
 
 /* The port lock is not held.  */
diff -Nru a/drivers/telephony/ixj_pcmcia.c b/drivers/telephony/ixj_pcmcia.c
--- a/drivers/telephony/ixj_pcmcia.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/telephony/ixj_pcmcia.c	Tue Feb  3 19:45:41 2004
@@ -77,7 +77,7 @@
 	client_reg.event_handler = &ixj_event;
 	client_reg.Version = 0x0210;
 	client_reg.event_callback_args.client_data = link;
-	ret = CardServices(RegisterClient, &link->handle, &client_reg);
+	ret = pcmcia_register_client(&link->handle, &client_reg);
 	if (ret != CS_SUCCESS) {
 		cs_error(link->handle, RegisterClient, ret);
 		ixj_detach(link);
@@ -100,7 +100,7 @@
 	if (link->state & DEV_CONFIG)
 		ixj_cs_release(link);
 	if (link->handle) {
-		ret = CardServices(DeregisterClient, link->handle);
+		ret = pcmcia_deregister_client(link->handle);
 		if (ret != CS_SUCCESS)
 			cs_error(link->handle, DeregisterClient, ret);
 	}
@@ -110,11 +110,8 @@
         kfree(link);
 }
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
-
-#define CFG_CHECK(fn, args...) \
-if (CardServices(fn, args) != 0) goto next_entry
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static void ixj_get_serial(dev_link_t * link, IXJ * j)
 {
@@ -130,8 +127,8 @@
 	tuple.TupleDataMax = 80;
 	tuple.Attributes = 0;
 	tuple.DesiredTuple = CISTPL_VERS_1;
-	CS_CHECK(GetFirstTuple, handle, &tuple);
-	CS_CHECK(GetTupleData, handle, &tuple);
+	CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+	CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
 	str = (char *) buf;
 	printk("PCMCIA Version %d.%d\n", str[0], str[1]);
 	str += 2;
@@ -202,19 +199,20 @@
 	tuple.TupleDataMax = 255;
 	tuple.Attributes = 0;
 	tuple.DesiredTuple = CISTPL_CONFIG;
-	CS_CHECK(GetFirstTuple, handle, &tuple);
-	CS_CHECK(GetTupleData, handle, &tuple);
-	CS_CHECK(ParseTuple, handle, &tuple, &parse);
+	CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+	CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+	CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
 	link->conf.ConfigBase = parse.config.base;
 	link->conf.Present = parse.config.rmask[0];
 	link->state |= DEV_CONFIG;
-	CS_CHECK(GetConfigurationInfo, handle, &conf);
+	CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf));
 	tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
 	tuple.Attributes = 0;
-	CS_CHECK(GetFirstTuple, handle, &tuple);
+	CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
 	while (1) {
-		CFG_CHECK(GetTupleData, handle, &tuple);
-		CFG_CHECK(ParseTuple, handle, &tuple, &parse);
+		if (pcmcia_get_tuple_data(handle, &tuple) != 0 ||
+				pcmcia_parse_tuple(handle, &tuple, &parse) != 0)
+			goto next_entry;
 		if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
 			cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
 			link->conf.ConfigIndex = cfg->index;
@@ -224,17 +222,18 @@
 				link->io.BasePort2 = io->win[1].base;
 				link->io.NumPorts2 = io->win[1].len;
 			}
-			CFG_CHECK(RequestIO, link->handle, &link->io);
+			if (pcmcia_request_io(link->handle, &link->io) != 0)
+				goto next_entry;
 			/* If we've got this far, we're done */
 			break;
 		}
 	      next_entry:
 		if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
 			dflt = *cfg;
-		CS_CHECK(GetNextTuple, handle, &tuple);
+		CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));
 	}
 
-	CS_CHECK(RequestConfiguration, handle, &link->conf);
+	CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf));
 
 	/*
  	 *	Register the card with the core.
@@ -258,8 +257,8 @@
 	DEBUG(0, "ixj_cs_release(0x%p)\n", link);
 	info->ndev = 0;
 	link->dev = NULL;
-	CardServices(ReleaseConfiguration, link->handle);
-	CardServices(ReleaseIO, link->handle, &link->io);
+	pcmcia_release_configuration(link->handle);
+	pcmcia_release_io(link->handle, &link->io);
 	link->state &= ~DEV_CONFIG;
 }
 
@@ -284,14 +283,14 @@
 		/* Fall through... */
 	case CS_EVENT_RESET_PHYSICAL:
 		if (link->state & DEV_CONFIG)
-			CardServices(ReleaseConfiguration, link->handle);
+			pcmcia_release_configuration(link->handle);
 		break;
 	case CS_EVENT_PM_RESUME:
 		link->state &= ~DEV_SUSPEND;
 		/* Fall through... */
 	case CS_EVENT_CARD_RESET:
 		if (DEV_OK(link))
-			CardServices(RequestConfiguration, link->handle, &link->conf);
+			pcmcia_request_configuration(link->handle, &link->conf);
 		break;
 	}
 	return 0;
diff -Nru a/drivers/usb/Kconfig b/drivers/usb/Kconfig
--- a/drivers/usb/Kconfig	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/Kconfig	Tue Feb  3 19:45:17 2004
@@ -7,7 +7,7 @@
 # ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface.
 config USB
 	tristate "Support for USB"
-	depends on PCI || SA1111
+	depends on PCI || SA1111 || ARCH_OMAP1510 || ARCH_OMAP1610
 	---help---
 	  Universal Serial Bus (USB) is a specification for a serial bus
 	  subsystem which offers higher speeds and more features than the
diff -Nru a/drivers/usb/Makefile b/drivers/usb/Makefile
--- a/drivers/usb/Makefile	Tue Feb  3 19:45:42 2004
+++ b/drivers/usb/Makefile	Tue Feb  3 19:45:42 2004
@@ -54,6 +54,7 @@
 obj-$(CONFIG_USB_BRLVGER)	+= misc/
 obj-$(CONFIG_USB_EMI26)		+= misc/
 obj-$(CONFIG_USB_LCD)		+= misc/
+obj-$(CONFIG_USB_LEGOTOWER)	+= misc/
 obj-$(CONFIG_USB_RIO500)	+= misc/
 obj-$(CONFIG_USB_SPEEDTOUCH)	+= misc/
 obj-$(CONFIG_USB_TEST)		+= misc/
diff -Nru a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c
--- a/drivers/usb/core/buffer.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/usb/core/buffer.c	Tue Feb  3 19:45:42 2004
@@ -127,6 +127,8 @@
 	struct usb_hcd		*hcd = bus->hcpriv;
 	int 			i;
 
+	if (!addr)
+		return;
 	for (i = 0; i < HCD_BUFFER_POOLS; i++) {
 		if (size <= pool_max [i]) {
 			pci_pool_free (hcd->pool [i], addr, dma);
diff -Nru a/drivers/usb/core/driverfs.c b/drivers/usb/core/driverfs.c
--- a/drivers/usb/core/driverfs.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/core/driverfs.c	Tue Feb  3 19:45:17 2004
@@ -23,28 +23,29 @@
 #include "usb.h"
 
 /* Active configuration fields */
-#define usb_actconfig_show(field, format_string)			\
-static ssize_t								\
-show_##field (struct device *dev, char *buf)				\
+#define usb_actconfig_show(field, multiplier, format_string)		\
+static ssize_t  show_##field (struct device *dev, char *buf)		\
 {									\
 	struct usb_device *udev;					\
 									\
 	udev = to_usb_device (dev);					\
-	if (udev->actconfig) \
-	return sprintf (buf, format_string, udev->actconfig->desc.field); \
-	else return 0;							\
+	if (udev->actconfig)						\
+		return sprintf (buf, format_string,			\
+				udev->actconfig->desc.field * multiplier);	\
+	else								\
+		return 0;						\
 }									\
 
-#define usb_actconfig_attr(field, format_string)			\
-usb_actconfig_show(field,format_string)					\
+#define usb_actconfig_attr(field, multiplier, format_string)		\
+usb_actconfig_show(field, multiplier, format_string)			\
 static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL);
 
-usb_actconfig_attr (bNumInterfaces, "%2d\n")
-usb_actconfig_attr (bmAttributes, "%2x\n")
-usb_actconfig_attr (bMaxPower, "%3dmA\n")
+usb_actconfig_attr (bNumInterfaces, 1, "%2d\n")
+usb_actconfig_attr (bmAttributes, 1, "%2x\n")
+usb_actconfig_attr (bMaxPower, 2, "%3dmA\n")
 
 /* configuration value is always present, and r/w */
-usb_actconfig_show(bConfigurationValue,"%u\n");
+usb_actconfig_show(bConfigurationValue, 1, "%u\n");
 
 static ssize_t
 set_bConfigurationValue (struct device *dev, const char *buf, size_t count)
@@ -62,55 +63,25 @@
 		show_bConfigurationValue, set_bConfigurationValue);
 
 /* String fields */
-static ssize_t show_product (struct device *dev, char *buf)
-{
-	struct usb_device *udev;
-	int len;
-
-	udev = to_usb_device (dev);
-
-	len = usb_string(udev, udev->descriptor.iProduct, buf, PAGE_SIZE);
-	if (len < 0)
-		return 0;
-	buf[len] = '\n';
-	buf[len+1] = 0;
-	return len+1;
-}
-static DEVICE_ATTR(product,S_IRUGO,show_product,NULL);
-
-static ssize_t
-show_manufacturer (struct device *dev, char *buf)
-{
-	struct usb_device *udev;
-	int len;
-
-	udev = to_usb_device (dev);
-
-	len = usb_string(udev, udev->descriptor.iManufacturer, buf, PAGE_SIZE);
-	if (len < 0)
-		return 0;
-	buf[len] = '\n';
-	buf[len+1] = 0;
-	return len+1;
-}
-static DEVICE_ATTR(manufacturer,S_IRUGO,show_manufacturer,NULL);
-
-static ssize_t
-show_serial (struct device *dev, char *buf)
-{
-	struct usb_device *udev;
-	int len;
-
-	udev = to_usb_device (dev);
+#define usb_string_attr(name, field)		\
+static ssize_t  show_##name(struct device *dev, char *buf)		\
+{									\
+	struct usb_device *udev;					\
+	int len;							\
+									\
+	udev = to_usb_device (dev);					\
+	len = usb_string(udev, udev->descriptor.field, buf, PAGE_SIZE);	\
+	if (len < 0)							\
+		return 0;						\
+	buf[len] = '\n';						\
+	buf[len+1] = 0;							\
+	return len+1;							\
+}									\
+static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL);
 
-	len = usb_string(udev, udev->descriptor.iSerialNumber, buf, PAGE_SIZE);
-	if (len < 0)
-		return 0;
-	buf[len] = '\n';
-	buf[len+1] = 0;
-	return len+1;
-}
-static DEVICE_ATTR(serial,S_IRUGO,show_serial,NULL);
+usb_string_attr(product, iProduct);
+usb_string_attr(manufacturer, iManufacturer);
+usb_string_attr(serial, iSerialNumber);
 
 static ssize_t
 show_speed (struct device *dev, char *buf)
diff -Nru a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
--- a/drivers/usb/core/hub.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/core/hub.c	Tue Feb  3 19:45:17 2004
@@ -31,6 +31,7 @@
 #include <asm/uaccess.h>
 #include <asm/byteorder.h>
 
+#include "usb.h"
 #include "hcd.h"
 #include "hub.h"
 
@@ -1316,8 +1317,8 @@
 		kfree(descriptor);
 		usb_destroy_configuration(dev);
 
-		ret = usb_get_device_descriptor(dev);
-		if (ret < sizeof(dev->descriptor)) {
+		ret = usb_get_device_descriptor(dev, sizeof(dev->descriptor));
+		if (ret != sizeof(dev->descriptor)) {
 			if (ret < 0)
 				err("unable to get device %s descriptor "
 					"(error=%d)", dev->devpath, ret);
diff -Nru a/drivers/usb/core/message.c b/drivers/usb/core/message.c
--- a/drivers/usb/core/message.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/core/message.c	Tue Feb  3 19:45:17 2004
@@ -546,10 +546,10 @@
  *
  * Gets a USB descriptor.  Convenience functions exist to simplify
  * getting some types of descriptors.  Use
- * usb_get_device_descriptor() for USB_DT_DEVICE,
+ * usb_get_device_descriptor() for USB_DT_DEVICE (not exported),
  * and usb_get_string() or usb_string() for USB_DT_STRING.
- * Configuration descriptors (USB_DT_CONFIG) are part of the device
- * structure, at least for the current configuration.
+ * Device (USB_DT_DEVICE) and configuration descriptors (USB_DT_CONFIG)
+ * are part of the device structure.
  * In addition to a number of USB-standard descriptors, some
  * devices also use class-specific or vendor-specific descriptors.
  *
@@ -610,6 +610,7 @@
 /**
  * usb_get_device_descriptor - (re)reads the device descriptor
  * @dev: the device whose device descriptor is being updated
+ * @size: how much of the descriptor to read
  * Context: !in_interrupt ()
  *
  * Updates the copy of the device descriptor stored in the device structure,
@@ -618,24 +619,35 @@
  * vendors product and version fields (idVendor, idProduct, and bcdDevice).
  * That lets device drivers compare against non-byteswapped constants.
  *
- * There's normally no need to use this call, although some devices
- * will change their descriptors after events like updating firmware.
+ * Not exported, only for use by the core.  If drivers really want to read
+ * the device descriptor directly, they can call usb_get_descriptor() with
+ * type = USB_DT_DEVICE and index = 0.
  *
  * This call is synchronous, and may not be used in an interrupt context.
  *
  * Returns the number of bytes received on success, or else the status code
  * returned by the underlying usb_control_msg() call.
  */
-int usb_get_device_descriptor(struct usb_device *dev)
+int usb_get_device_descriptor(struct usb_device *dev, unsigned int size)
 {
-	int ret = usb_get_descriptor(dev, USB_DT_DEVICE, 0, &dev->descriptor,
-				     sizeof(dev->descriptor));
+	struct usb_device_descriptor *desc;
+	int ret;
+
+	if (size > sizeof(*desc))
+		return -EINVAL;
+	desc = kmalloc(sizeof(*desc), GFP_NOIO);
+	if (!desc)
+		return -ENOMEM;
+
+	ret = usb_get_descriptor(dev, USB_DT_DEVICE, 0, desc, size);
 	if (ret >= 0) {
-		le16_to_cpus(&dev->descriptor.bcdUSB);
-		le16_to_cpus(&dev->descriptor.idVendor);
-		le16_to_cpus(&dev->descriptor.idProduct);
-		le16_to_cpus(&dev->descriptor.bcdDevice);
+		le16_to_cpus(&desc->bcdUSB);
+		le16_to_cpus(&desc->idVendor);
+		le16_to_cpus(&desc->idProduct);
+		le16_to_cpus(&desc->bcdDevice);
+		memcpy(&dev->descriptor, desc, size);
 	}
+	kfree(desc);
 	return ret;
 }
 
@@ -1241,7 +1253,6 @@
 
 // synchronous control message convenience routines
 EXPORT_SYMBOL(usb_get_descriptor);
-EXPORT_SYMBOL(usb_get_device_descriptor);
 EXPORT_SYMBOL(usb_get_status);
 EXPORT_SYMBOL(usb_get_string);
 EXPORT_SYMBOL(usb_string);
diff -Nru a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
--- a/drivers/usb/core/urb.c	Tue Feb  3 19:45:30 2004
+++ b/drivers/usb/core/urb.c	Tue Feb  3 19:45:30 2004
@@ -268,7 +268,7 @@
 		/* "high bandwidth" mode, 1-3 packets/uframe? */
 		if (dev->speed == USB_SPEED_HIGH) {
 			int	mult = 1 + ((max >> 11) & 0x03);
-			max &= 0x03ff;
+			max &= 0x07ff;
 			max *= mult;
 		}
 
diff -Nru a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
--- a/drivers/usb/core/usb.c	Tue Feb  3 19:45:26 2004
+++ b/drivers/usb/core/usb.c	Tue Feb  3 19:45:26 2004
@@ -206,12 +206,15 @@
  */
 struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, unsigned ifnum)
 {
+	struct usb_host_config *config = dev->actconfig;
 	int i;
 
-	for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++)
-		if (dev->actconfig->interface[i]->altsetting[0]
+	if (!config)
+		return NULL;
+	for (i = 0; i < config->desc.bNumInterfaces; i++)
+		if (config->interface[i]->altsetting[0]
 				.desc.bInterfaceNumber == ifnum)
-			return dev->actconfig->interface[i];
+			return config->interface[i];
 
 	return NULL;
 }
@@ -233,14 +236,17 @@
 struct usb_endpoint_descriptor *
 usb_epnum_to_ep_desc(struct usb_device *dev, unsigned epnum)
 {
+	struct usb_host_config *config = dev->actconfig;
 	int i, k;
 
-	for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
+	if (!config)
+		return NULL;
+	for (i = 0; i < config->desc.bNumInterfaces; i++) {
 		struct usb_interface		*intf;
 		struct usb_host_interface	*alt;
 
-		/* only endpoints in current altseting are active */
-		intf = dev->actconfig->interface[i];
+		/* only endpoints in current altsetting are active */
+		intf = config->interface[i];
 		alt = intf->altsetting + intf->act_altsetting;
 
 		for (k = 0; k < alt->desc.bNumEndpoints; k++)
@@ -1059,7 +1065,7 @@
 		wait_ms(10);	/* Let the SET_ADDRESS settle */
 
 		/* high and low speed devices don't need this... */
-		err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, &dev->descriptor, 8);
+		err = usb_get_device_descriptor(dev, 8);
 		if (err >= 8)
 			break;
 		wait_ms(100);
@@ -1079,8 +1085,8 @@
 
 	/* USB device state == addressed ... still not usable */
 
-	err = usb_get_device_descriptor(dev);
-	if (err < (signed)sizeof(dev->descriptor)) {
+	err = usb_get_device_descriptor(dev, sizeof(dev->descriptor));
+	if (err != (signed)sizeof(dev->descriptor)) {
 		dev_err(&dev->dev, "device descriptor read/all, error %d\n", err);
 		goto fail;
 	}
diff -Nru a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
--- a/drivers/usb/core/usb.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/core/usb.h	Tue Feb  3 19:45:17 2004
@@ -14,3 +14,6 @@
 		struct usb_endpoint_descriptor *epd);
 extern void usb_enable_interface (struct usb_device *dev,
 		struct usb_interface *intf);
+
+extern int usb_get_device_descriptor(struct usb_device *dev,
+		unsigned int size);
diff -Nru a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
--- a/drivers/usb/gadget/Kconfig	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/gadget/Kconfig	Tue Feb  3 19:45:17 2004
@@ -3,12 +3,10 @@
 #    (a) a peripheral controller, and
 #    (b) the gadget driver using it.
 #
-# for 2.5 kbuild, drivers/usb/gadget/Kconfig
-# source this at the end of drivers/usb/Kconfig
-#
-menuconfig USB_GADGET
+menu "USB Gadget Support"
+
+config USB_GADGET
 	tristate "Support for USB Gadgets"
-	depends on EXPERIMENTAL
 	help
 	   USB is a master/slave protocol, organized with one master
 	   host (such as a PC) controlling up to 127 peripheral devices.
@@ -36,12 +34,15 @@
 # USB Peripheral Controller Support
 #
 choice
-	prompt "USB Peripheral Controller Support"
+	prompt "USB Peripheral Controller"
 	depends on USB_GADGET
+	help
+	   A USB device uses a controller to talk to its host.
+	   Systems should have only one such upstream link.
 
-config USB_NET2280
-	tristate "NetChip 2280 USB Peripheral Controller"
-	depends on PCI && USB_GADGET
+config USB_GADGET_NET2280
+	boolean "NetChip 2280"
+	depends on PCI
 	help
 	   NetChip 2280 is a PCI based USB peripheral controller which
 	   supports both full and high speed USB 2.0 data transfers.  
@@ -54,21 +55,91 @@
 	   dynamically linked module called "net2280" and force all
 	   gadget drivers to also be dynamically linked.
 
+config USB_NET2280
+	tristate
+	depends on USB_GADGET_NET2280
+	default USB_GADGET
+
+config USB_GADGET_PXA2XX
+	boolean "PXA 2xx or IXP 42x"
+	depends on ARCH_PXA || ARCH_IXP425
+	help
+	   Intel's PXA 2xx series XScale ARM-5TE processors include
+	   an integrated full speed USB 1.1 device controller.  The
+	   controller in the IXP 4xx series is register-compatible.
+
+	   It has fifteen fixed-function endpoints, as well as endpoint
+	   zero (for control transfers).
+
+	   Say "y" to link the driver statically, or "m" to build a
+	   dynamically linked module called "pxa2xx_udc" and force all
+	   gadget drivers to also be dynamically linked.
+
+config USB_PXA2XX
+	tristate
+	depends on USB_GADGET_PXA2XX
+	default USB_GADGET
+
+# if there's only one gadget driver, using only two bulk endpoints,
+# don't waste memory for the other endpoints
+config USB_PXA2XX_SMALL
+	depends on USB_GADGET_PXA2XX
+	bool
+	default y if USB_ZERO
+	default y if USB_ETH
+	default y if USB_G_SERIAL
+
+config USB_GADGET_GOKU
+	boolean "Toshiba TC86C001 'Goku-S'"
+	depends on PCI
+	help
+	   The Toshiba TC86C001 is a PCI device which includes controllers
+	   for full speed USB devices, IDE, I2C, SIO, plus a USB host (OHCI).
+	   
+	   The device controller has three configurable (bulk or interrupt)
+	   endpoints, plus endpoint zero (for control transfers).
+
+	   Say "y" to link the driver statically, or "m" to build a
+	   dynamically linked module called "goku_udc" and to force all
+	   gadget drivers to also be dynamically linked.
+
+config USB_GOKU
+	tristate
+	depends on USB_GADGET_GOKU
+	default USB_GADGET
+
+# this could be built elsewhere (doesn't yet exist)
+config USB_GADGET_SA1100
+	boolean "SA 1100"
+	depends on ARCH_SA1100
+	help
+	   Intel's SA-1100 is an ARM-4 processor with an integrated
+	   full speed USB 1.1 device controller.
+
+	   It has two fixed-function endpoints, as well as endpoint
+	   zero (for control transfers).
+
+config USB_SA1100
+	tristate
+	depends on USB_GADGET_SA1100
+	default USB_GADGET
+
 endchoice
 
+
 #
 # USB Gadget Drivers
 #
 choice
-	prompt "USB Gadget Drivers"
+	tristate "USB Gadget Drivers"
 	depends on USB_GADGET
 	default USB_ETH
 
-# FIXME want a cleaner dependency/config approach for drivers.
+# this first set of drivers all depend on bulk-capable hardware.
 
 config USB_ZERO
 	tristate "Gadget Zero (DEVELOPMENT)"
-	depends on USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA2XX || USB_SA1100)
+	depends on EXPERIMENTAL
 	help
 	  Gadget Zero is a two-configuration device.  It either sinks and
 	  sources bulk data; or it loops back a configurable number of
@@ -91,26 +162,9 @@
 	  Say "y" to link the driver statically, or "m" to build a
 	  dynamically linked module called "g_zero".
 
-config USB_ZERO_NET2280
-	bool
-	# for now, treat the "dummy" hcd as if it were a net2280
-	depends on USB_ZERO && (USB_NET2280 || USB_DUMMY_HCD)
-	default y
-
-config USB_ZERO_PXA2XX
-	bool
-	depends on USB_ZERO && USB_PXA2XX
-	default y
-
-config USB_ZERO_SA1100
-	bool
-	depends on USB_ZERO && USB_SA1100
-	default y
-
-
 config USB_ETH
 	tristate "Ethernet Gadget"
-	depends on USB_GADGET && NET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA2XX || USB_SA1100)
+	depends on NET
 	help
 	  This driver implements Ethernet style communication, in either
 	  of two ways:
@@ -136,26 +190,9 @@
 	  Say "y" to link the driver statically, or "m" to build a
 	  dynamically linked module called "g_ether".
 
-
-config USB_ETH_NET2280
-	bool
-	# for now, treat the "dummy" hcd as if it were a net2280
-	depends on USB_ETH && (USB_NET2280 || USB_DUMMY_HCD)
-	default y
-
-config USB_ETH_PXA2XX
-	bool
-	depends on USB_ETH && USB_PXA2XX
-	default y
-
-config USB_ETH_SA1100
-	bool
-	depends on USB_ETH && USB_SA1100
-	default y
-
 config USB_GADGETFS
 	tristate "Gadget Filesystem (EXPERIMENTAL)"
-	depends on USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA2XX) && EXPERIMENTAL
+	depends on EXPERIMENTAL
 	help
 	  This driver provides a filesystem based API that lets user mode
 	  programs implement a single-configuration USB device, including
@@ -166,17 +203,44 @@
 	  Say "y" to link the driver statically, or "m" to build a
 	  dynamically linked module called "gadgetfs".
 
-config USB_GADGETFS_NET2280
-	bool
-	# for now, treat the "dummy" hcd as if it were a net2280
-	depends on USB_GADGETFS && (USB_NET2280 || USB_DUMMY_HCD)
-	default y
+config USB_FILE_STORAGE
+	tristate "File-backed Storage Gadget (DEVELOPMENT)"
+	# we don't support the SA1100 because of its limitations
+	depends on USB_GADGET_SA1100 = n
+	help
+	  The File-backed Storage Gadget acts as a USB Mass Storage
+	  disk drive.  As its storage repository it can use a regular
+	  file or a block device (in much the same way as the "loop"
+	  device driver), specified as a module parameter.
 
-config USB_GADGETFS_PXA2XX
-	bool
-	depends on USB_GADGETFS && USB_PXA2XX
-	default y
+	  Say "y" to link the driver statically, or "m" to build a
+	  dynamically linked module called "g_file_storage".
+
+config USB_FILE_STORAGE_TEST
+	bool "File-backed Storage Gadget test version"
+	depends on USB_FILE_STORAGE
+	default n
+	help
+	  Say "y" to generate the larger testing version of the
+	  File-backed Storage Gadget, useful for probing the
+	  behavior of USB Mass Storage hosts.  Not needed for
+	  normal operation.
+
+config USB_G_SERIAL
+	tristate "Serial Gadget"
+	help
+	  The Serial Gadget talks to the Linux-USB generic serial driver.
+
+	  Say "y" to link the driver statically, or "m" to build a
+	  dynamically linked module called "g_serial".
+
+
+
+# put drivers that need isochronous transfer support (for audio
+# or video class gadget drivers), or specific hardware, here.
+
+# - none yet
 
 endchoice
 
-# endmenuconfig
+endmenu
diff -Nru a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
--- a/drivers/usb/gadget/Makefile	Tue Feb  3 19:45:16 2004
+++ b/drivers/usb/gadget/Makefile	Tue Feb  3 19:45:16 2004
@@ -2,15 +2,21 @@
 # USB peripheral controller drivers
 #
 obj-$(CONFIG_USB_NET2280)	+= net2280.o
+obj-$(CONFIG_USB_PXA2XX)	+= pxa2xx_udc.o
+obj-$(CONFIG_USB_GOKU)		+= goku_udc.o
 
 #
 # USB gadget drivers
 #
 g_zero-objs			:= zero.o usbstring.o
 g_ether-objs			:= ether.o usbstring.o
+g_serial-objs			:= serial.o usbstring.o
 gadgetfs-objs			:= inode.o usbstring.o
+g_file_storage-objs		:= file_storage.o usbstring.o
  
 obj-$(CONFIG_USB_ZERO)		+= g_zero.o
 obj-$(CONFIG_USB_ETH)		+= g_ether.o
 obj-$(CONFIG_USB_GADGETFS)	+= gadgetfs.o
+obj-$(CONFIG_USB_FILE_STORAGE)	+= g_file_storage.o
+obj-$(CONFIG_USB_G_SERIAL)	+= g_serial.o
 
diff -Nru a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
--- a/drivers/usb/gadget/ether.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/usb/gadget/ether.c	Tue Feb  3 19:45:42 2004
@@ -122,12 +122,9 @@
  *
  * CHIP ... hardware identifier
  * DRIVER_VERSION_NUM ... alerts the host side driver to differences
- * EP0_MAXPACKET ... controls packetization of control requests
  * EP_*_NAME ... which endpoints do we use for which purpose?
  * EP_*_NUM ... numbers for them (often limited by hardware)
  * HIGHSPEED ... define if ep0 and descriptors need high speed support
- * MAX_USB_POWER ... define if we use other than 100 mA bus current
- * SELFPOWER ... unless we can run on bus power, USB_CONFIG_ATT_SELFPOWER
  * WAKEUP ... if hardware supports remote wakeup AND we will issue the
  * 	usb_gadget_wakeup() call to initiate it, USB_CONFIG_ATT_WAKEUP
  *
@@ -143,6 +140,9 @@
 /* #undef on hardware that can't implement CDC */
 #define	DEV_CONFIG_CDC
 
+/* undef on bus-powered hardware, and #define MAX_USB_POWER */
+#define SELFPOWER
+
 /*
  * NetChip 2280, PCI based.
  *
@@ -152,11 +152,10 @@
  * performance note:  only PIO needs per-usb-packet IRQs (ep0, ep-e, ep-f)
  * otherwise IRQs are per-Ethernet-packet unless TX_DELAY and chaining help.
  */
-#ifdef	CONFIG_USB_ETH_NET2280
+#ifdef	CONFIG_USB_GADGET_NET2280
 #define CHIP			"net2280"
 #define DEFAULT_QLEN		4		/* has dma chaining */
 #define DRIVER_VERSION_NUM	0x0101
-#define EP0_MAXPACKET		64
 static const char EP_OUT_NAME [] = "ep-a";
 #define EP_OUT_NUM	1
 static const char EP_IN_NAME [] = "ep-b";
@@ -164,8 +163,6 @@
 static const char EP_STATUS_NAME [] = "ep-f";
 #define EP_STATUS_NUM	3
 #define HIGHSPEED
-/* specific hardware configs could be bus-powered */
-#define SELFPOWER USB_CONFIG_ATT_SELFPOWER
 /* supports remote wakeup, but this driver doesn't */
 
 extern int net2280_set_fifo_mode (struct usb_gadget *gadget, int mode);
@@ -186,17 +183,14 @@
  * multiple interfaces (or altsettings) aren't usable.  so this hardware
  * can't implement CDC, which needs both capabilities.
  */
-#ifdef	CONFIG_USB_ETH_PXA2XX
+#ifdef	CONFIG_USB_GADGET_PXA2XX
 #undef	DEV_CONFIG_CDC
 #define CHIP			"pxa2xx"
 #define DRIVER_VERSION_NUM	0x0103
-#define EP0_MAXPACKET		16
 static const char EP_OUT_NAME [] = "ep2out-bulk";
 #define EP_OUT_NUM	2
 static const char EP_IN_NAME [] = "ep1in-bulk";
 #define EP_IN_NUM	1
-/* doesn't support bus-powered operation */
-#define SELFPOWER USB_CONFIG_ATT_SELFPOWER
 /* supports remote wakeup, but this driver doesn't */
 
 /* no hw optimizations to apply */
@@ -209,17 +203,14 @@
  * can't have a notification endpoint, since there are only the two
  * bulk-capable ones.  the CDC spec allows that.
  */
-#ifdef	CONFIG_USB_ETH_SA1100
+#ifdef	CONFIG_USB_GADGET_SA1100
 #define CHIP			"sa1100"
 #define DRIVER_VERSION_NUM	0x0105
-#define EP0_MAXPACKET		8
 static const char EP_OUT_NAME [] = "ep1out-bulk";
 #define EP_OUT_NUM	1
 static const char EP_IN_NAME [] = "ep2in-bulk";
 #define EP_IN_NUM	2
 // EP_STATUS_NUM is undefined
-/* doesn't support bus-powered operation */
-#define SELFPOWER USB_CONFIG_ATT_SELFPOWER
 /* doesn't support remote wakeup? */
 
 /* no hw optimizations to apply */
@@ -231,25 +222,43 @@
  *
  * This has three semi-configurable full speed bulk/interrupt endpoints.
  */
-#ifdef	CONFIG_USB_ETH_GOKU
+#ifdef	CONFIG_USB_GADGET_GOKU
 #define CHIP			"goku"
 #define DRIVER_VERSION_NUM	0x0106
-#define EP0_MAXPACKET		8
 static const char EP_OUT_NAME [] = "ep1-bulk";
 #define EP_OUT_NUM	1
 static const char EP_IN_NAME [] = "ep2-bulk";
 #define EP_IN_NUM	2
 static const char EP_STATUS_NAME [] = "ep3-bulk";
 #define EP_STATUS_NUM	3
-#define SELFPOWER USB_CONFIG_ATT_SELFPOWER
 /* doesn't support remote wakeup */
 
 #define hw_optimize(g) do {} while (0)
 #endif
 
+/*
+ * SuperH UDC:  UDC built-in to some Renesas SH processors.
+ *
+ * This has three semi-configurable full speed bulk/interrupt endpoints.
+ *
+ * Only one configuration and interface is supported.  So this hardware
+ * can't implement CDC.
+ */
+#ifdef	CONFIG_USB_GADGET_SUPERH
+#undef	DEV_CONFIG_CDC
+#define CHIP			"superh"
+#define DRIVER_VERSION_NUM	0x0107
+static const char EP_OUT_NAME[] = "ep1out-bulk";
+#define EP_OUT_NUM		1
+static const char EP_IN_NAME[] = "ep2in-bulk";
+#define EP_IN_NUM		2
+
+#define hw_optimize(g) do {} while (0)
+#endif
+
 /*-------------------------------------------------------------------------*/
 
-#ifndef EP0_MAXPACKET
+#ifndef CHIP
 #	error Configure some USB peripheral controller driver!
 #endif
 
@@ -280,19 +289,15 @@
  * hardware that supports remote wakeup defaults to disabling it.
  */
 
-#ifndef	SELFPOWER
-/* default: say we rely on bus power */
-#define SELFPOWER	0
-/* else:
- * - SELFPOWER value must be USB_CONFIG_ATT_SELFPOWER
- * - MAX_USB_POWER may be nonzero.
- */
-#endif
-
 #ifndef	MAX_USB_POWER
-/* any hub supports this steady state bus power consumption */
-#define MAX_USB_POWER	100	/* mA */
+#ifdef	SELFPOWER
+/* some hosts are confused by 0mA  */
+#define MAX_USB_POWER	2	/* mA */
+#else
+/* bus powered */
+#error	Define your bus power consumption!
 #endif
+#endif	/* MAX_USB_POWER */
 
 #ifndef	WAKEUP
 /* default: this driver won't do remote wakeup */
@@ -376,7 +381,7 @@
 /*
  * This device advertises one configuration.
  */
-static const struct usb_device_descriptor
+static struct usb_device_descriptor
 device_desc = {
 	.bLength =		sizeof device_desc,
 	.bDescriptorType =	USB_DT_DEVICE,
@@ -386,7 +391,6 @@
 	.bDeviceClass =		DEV_CONFIG_CLASS,
 	.bDeviceSubClass =	0,
 	.bDeviceProtocol =	0,
-	.bMaxPacketSize0 =	EP0_MAXPACKET,
 
 	.idVendor =		__constant_cpu_to_le16 (DRIVER_VENDOR_NUM),
 	.idProduct =		__constant_cpu_to_le16 (DRIVER_PRODUCT_NUM),
@@ -396,7 +400,7 @@
 	.bNumConfigurations =	1,
 };
 
-static const struct usb_config_descriptor
+static struct usb_config_descriptor
 eth_config = {
 	.bLength =		sizeof eth_config,
 	.bDescriptorType =	USB_DT_CONFIG,
@@ -409,7 +413,7 @@
 #endif
 	.bConfigurationValue =	DEV_CONFIG_VALUE,
 	.iConfiguration =	STRING_PRODUCT,
-	.bmAttributes =		USB_CONFIG_ATT_ONE | SELFPOWER | WAKEUP,
+	.bmAttributes =		USB_CONFIG_ATT_ONE | WAKEUP,
 	.bMaxPower =		(MAX_USB_POWER + 1) / 2,
 };
 
@@ -645,7 +649,7 @@
 	.bInterval =		1,
 };
 
-static const struct usb_qualifier_descriptor
+static struct usb_qualifier_descriptor
 dev_qualifier = {
 	.bLength =		sizeof dev_qualifier,
 	.bDescriptorType =	USB_DT_DEVICE_QUALIFIER,
@@ -653,12 +657,10 @@
 	.bcdUSB =		__constant_cpu_to_le16 (0x0200),
 	.bDeviceClass =		DEV_CONFIG_CLASS,
 
-	/* assumes ep0 uses the same value for both speeds ... */
-	.bMaxPacketSize0 =	EP0_MAXPACKET,
-
 	.bNumConfigurations =	1,
 };
 
+
 /* maxpacket and other transfer characteristics vary by speed. */
 #define ep_desc(g,hs,fs) (((g)->speed==USB_SPEED_HIGH)?(hs):(fs))
 
@@ -959,7 +961,7 @@
 	if (number == dev->config)
 		return 0;
 
-#ifdef CONFIG_USB_ETH_SA1100
+#ifdef CONFIG_USB_GADGET_SA1100
 	if (dev->config && atomic_read (&dev->tx_qlen) != 0) {
 		/* tx fifo is full, but we can't clear it...*/
 		INFO (dev, "can't change configurations\n");
@@ -1006,6 +1008,7 @@
 
 /* section 3.8.2 table 11 of the CDC spec lists Ethernet notifications */
 #define CDC_NOTIFY_NETWORK_CONNECTION	0x00	/* required; 6.3.1 */
+#define CDC_NOTIFY_RESPONSE_AVAILABLE	0x01	/* optional; 6.3.2 */
 #define CDC_NOTIFY_SPEED_CHANGE		0x2a	/* required; 6.3.8 */
 
 struct cdc_notification {
@@ -1123,6 +1126,8 @@
 /* see section 3.8.2 table 10 of the CDC spec for more ethernet
  * requests, mostly for filters (multicast, pm) and statistics
  */
+#define CDC_SEND_ENCAPSULATED_REQUEST	0x00	/* optional */
+#define CDC_GET_ENCAPSULATED_RESPONSE	0x01	/* optional */
 #define CDC_SET_ETHERNET_PACKET_FILTER	0x43	/* required */
 
 /*
@@ -1188,7 +1193,7 @@
 		value = eth_set_config (dev, ctrl->wValue, GFP_ATOMIC);
 		spin_unlock (&dev->lock);
 		break;
-#ifdef	CONFIG_USB_ETH_PXA2XX
+#ifdef	CONFIG_USB_GADGET_PXA2XX
 	/* PXA UDC prevents us from using SET_INTERFACE in normal ways.
 	 * And it hides GET_CONFIGURATION and GET_INTERFACE too.
 	 */
@@ -1638,7 +1643,7 @@
 	req->context = skb;
 	req->complete = tx_complete;
 
-#ifdef	CONFIG_USB_ETH_SA1100
+#ifdef	CONFIG_USB_GADGET_SA1100
 	/* don't demand zlp (req->zero) support from all hardware */
 	if ((length % dev->in_ep->maxpacket) == 0)
 		length++;
@@ -1768,6 +1773,17 @@
 	/* just one upstream link at a time */
 	if (ethaddr [0] != 0)
 		return -ENODEV;
+#endif
+
+	device_desc.bMaxPacketSize0 = gadget->ep0->maxpacket;
+#ifdef	HIGHSPEED
+	/* assumes ep0 uses the same value for both speeds ... */
+	dev_qualifier.bMaxPacketSize0 = device_desc.bMaxPacketSize0;
+#endif
+
+#ifdef	SELFPOWERED
+	eth_config.bmAttributes |= USB_CONFIG_ATT_SELFPOWERED;
+	usb_gadget_set_selfpowered (gadget);
 #endif
 
  	net = alloc_etherdev (sizeof *dev);
diff -Nru a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/usb/gadget/file_storage.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,4169 @@
+/*
+ * file_storage.c -- File-backed USB Storage Gadget, for USB development
+ *
+ * Copyright (C) 2003 Alan Stern
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The names of the above-listed copyright holders may not be used
+ *    to endorse or promote products derived from this software without
+ *    specific prior written permission.
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+/*
+ * The File-backed Storage Gadget acts as a USB Mass Storage device,
+ * appearing to the host as a disk drive.  In addition to providing an
+ * example of a genuinely useful gadget driver for a USB device, it also
+ * illustrates a technique of double-buffering for increased throughput.
+ * Last but not least, it gives an easy way to probe the behavior of the
+ * Mass Storage drivers in a USB host.
+ *
+ * Backing storage is provided by a regular file or a block device, specified
+ * by the "file" module parameter.  Access can be limited to read-only by
+ * setting the optional "ro" module parameter.
+ *
+ * The gadget supports the Control-Bulk (CB), Control-Bulk-Interrupt (CBI),
+ * and Bulk-Only (also known as Bulk-Bulk-Bulk or BBB) transports, selected
+ * by the optional "transport" module parameter.  It also supports the
+ * following protocols: RBC (0x01), ATAPI or SFF-8020i (0x02), QIC-157 (0c03),
+ * UFI (0x04), SFF-8070i (0x05), and transparent SCSI (0x06), selected by
+ * the optional "protocol" module parameter.  For testing purposes the
+ * gadget will indicate that it has removable media if the optional
+ * "removable" module parameter is set.  In addition, the default Vendor ID,
+ * Product ID, and release number can be overridden.
+ *
+ * There is support for multiple logical units (LUNs), each of which has
+ * its own backing file.  The number of LUNs can be set using the optional
+ * "luns" module parameter (anywhere from 1 to 8), and the corresponding
+ * files are specified using comma-separated lists for "file" and "ro".
+ * The default number of LUNs is taken from the number of "file" elements;
+ * it is 1 if "file" is not given.  If "removable" is not set then a backing
+ * file must be specified for each LUN.  If it is set, then an unspecified
+ * or empty backing filename means the LUN's medium is not loaded.
+ *
+ * Requirements are modest; only a bulk-in and a bulk-out endpoint are
+ * needed (an interrupt-out endpoint is also needed for CBI).  The memory
+ * requirement amounts to two 16K buffers, size configurable by a parameter.
+ * Support is included for both full-speed and high-speed operation.
+ *
+ * Module options:
+ *
+ *	file=filename[,filename...]
+ *				Required if "removable" is not set, names of
+ *					the files or block devices used for
+ *					backing storage
+ *	ro=b[,b...]		Default false, booleans for read-only access
+ *	luns=N			Default N = number of filenames, number of
+ *					LUNs to support
+ *	transport=XXX		Default BBB, transport name (CB, CBI, or BBB)
+ *	protocol=YYY		Default SCSI, protocol name (RBC, 8020 or
+ *					ATAPI, QIC, UFI, 8070, or SCSI;
+ *					also 1 - 6)
+ *	removable		Default false, boolean for removable media
+ *	vendor=0xVVVV		Default 0x0525 (NetChip), USB Vendor ID
+ *	product=0xPPPP		Default 0xa4a5 (FSG), USB Product ID
+ *	release=0xRRRR		Override the USB release number (bcdDevice)
+ *	buflen=N		Default N=16384, buffer size used (will be
+ *					rounded down to a multiple of
+ *					PAGE_CACHE_SIZE)
+ *	stall			Default determined according to the type of
+ *					USB device controller (usually true),
+ *					boolean to permit the driver to halt
+ *					bulk endpoints
+ *
+ * If CONFIG_USB_FILE_STORAGE_TEST is not set, only the "file" and "ro"
+ * options are available; default values are used for everything else.
+ *
+ * The pathnames of the backing files and the ro settings are available in
+ * the attribute files "file" and "ro" in the lun<n> subdirectory of the
+ * gadget's sysfs directory.  If CONFIG_USB_FILE_STORAGE_TEST and the
+ * "removable" option are both set, writing to these files will simulate
+ * ejecting/loading the medium (writing an empty line means eject) and
+ * adjusting a write-enable tab.  Changes to the ro setting are not allowed
+ * when the medium is loaded.
+ *
+ * This gadget driver is heavily based on "Gadget Zero" by David Brownell.
+ */
+
+
+/*
+ *				Driver Design
+ *
+ * The FSG driver is fairly straightforward.  There is a main kernel
+ * thread that handles most of the work.  Interrupt routines field
+ * callbacks from the controller driver: bulk- and interrupt-request
+ * completion notifications, endpoint-0 events, and disconnect events.
+ * Completion events are passed to the main thread by wakeup calls.  Many
+ * ep0 requests are handled at interrupt time, but SetInterface,
+ * SetConfiguration, and device reset requests are forwarded to the
+ * thread in the form of "exceptions" using SIGUSR1 signals (since they
+ * should interrupt any ongoing file I/O operations).
+ *
+ * The thread's main routine implements the standard command/data/status
+ * parts of a SCSI interaction.  It and its subroutines are full of tests
+ * for pending signals/exceptions -- all this polling is necessary since
+ * the kernel has no setjmp/longjmp equivalents.  (Maybe this is an
+ * indication that the driver really wants to be running in userspace.)
+ * An important point is that so long as the thread is alive it keeps an
+ * open reference to the backing file.  This will prevent unmounting
+ * the backing file's underlying filesystem and could cause problems
+ * during system shutdown, for example.  To prevent such problems, the
+ * thread catches INT, TERM, and KILL signals and converts them into
+ * an EXIT exception.
+ *
+ * In normal operation the main thread is started during the gadget's
+ * fsg_bind() callback and stopped during fsg_unbind().  But it can also
+ * exit when it receives a signal, and there's no point leaving the
+ * gadget running when the thread is dead.  So just before the thread
+ * exits, it deregisters the gadget driver.  This makes things a little
+ * tricky: The driver is deregistered at two places, and the exiting
+ * thread can indirectly call fsg_unbind() which in turn can tell the
+ * thread to exit.  The first problem is resolved through the use of the
+ * REGISTERED atomic bitflag; the driver will only be deregistered once.
+ * The second problem is resolved by having fsg_unbind() check
+ * fsg->state; it won't try to stop the thread if the state is already
+ * FSG_STATE_TERMINATED.
+ *
+ * To provide maximum throughput, the driver uses a circular pipeline of
+ * buffer heads (struct fsg_buffhd).  In principle the pipeline can be
+ * arbitrarily long; in practice the benefits don't justify having more
+ * than 2 stages (i.e., double buffering).  But it helps to think of the
+ * pipeline as being a long one.  Each buffer head contains a bulk-in and
+ * a bulk-out request pointer (since the buffer can be used for both
+ * output and input -- directions always are given from the host's
+ * point of view) as well as a pointer to the buffer and various state
+ * variables.
+ *
+ * Use of the pipeline follows a simple protocol.  There is a variable
+ * (fsg->next_buffhd_to_fill) that points to the next buffer head to use.
+ * At any time that buffer head may still be in use from an earlier
+ * request, so each buffer head has a state variable indicating whether
+ * it is EMPTY, FULL, or BUSY.  Typical use involves waiting for the
+ * buffer head to be EMPTY, filling the buffer either by file I/O or by
+ * USB I/O (during which the buffer head is BUSY), and marking the buffer
+ * head FULL when the I/O is complete.  Then the buffer will be emptied
+ * (again possibly by USB I/O, during which it is marked BUSY) and
+ * finally marked EMPTY again (possibly by a completion routine).
+ *
+ * A module parameter tells the driver to avoid stalling the bulk
+ * endpoints wherever the transport specification allows.  This is
+ * necessary for some UDCs like the SuperH, which cannot reliably clear a
+ * halt on a bulk endpoint.  However, under certain circumstances the
+ * Bulk-only specification requires a stall.  In such cases the driver
+ * will halt the endpoint and set a flag indicating that it should clear
+ * the halt in software during the next device reset.  Hopefully this
+ * will permit everything to work correctly.
+ *
+ * One subtle point concerns sending status-stage responses for ep0
+ * requests.  Some of these requests, such as device reset, can involve
+ * interrupting an ongoing file I/O operation, which might take an
+ * arbitrarily long time.  During that delay the host might give up on
+ * the original ep0 request and issue a new one.  When that happens the
+ * driver should not notify the host about completion of the original
+ * request, as the host will no longer be waiting for it.  So the driver
+ * assigns to each ep0 request a unique tag, and it keeps track of the
+ * tag value of the request associated with a long-running exception
+ * (device-reset, interface-change, or configuration-change).  When the
+ * exception handler is finished, the status-stage response is submitted
+ * only if the current ep0 request tag is equal to the exception request
+ * tag.  Thus only the most recently received ep0 request will get a
+ * status-stage response.
+ *
+ * Warning: This driver source file is too long.  It ought to be split up
+ * into a header file plus about 3 separate .c files, to handle the details
+ * of the Gadget, USB Mass Storage, and SCSI protocols.
+ */
+
+
+#undef DEBUG
+#undef VERBOSE
+#undef DUMP_MSGS
+
+#include <linux/config.h>
+
+#include <asm/system.h>
+#include <asm/uaccess.h>
+
+#include <linux/bitops.h>
+#include <linux/blkdev.h>
+#include <linux/compiler.h>
+#include <linux/completion.h>
+#include <linux/dcache.h>
+#include <linux/device.h>
+#include <linux/fcntl.h>
+#include <linux/file.h>
+#include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/limits.h>
+#include <linux/list.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/pagemap.h>
+#include <linux/rwsem.h>
+#include <linux/sched.h>
+#include <linux/signal.h>
+#include <linux/slab.h>
+#include <linux/spinlock.h>
+#include <linux/string.h>
+#include <linux/uts.h>
+#include <linux/version.h>
+#include <linux/wait.h>
+
+#include <linux/usb_ch9.h>
+#include <linux/usb_gadget.h>
+
+
+/*-------------------------------------------------------------------------*/
+
+#define DRIVER_DESC		"File-backed Storage Gadget"
+#define DRIVER_NAME		"g_file_storage"
+#define DRIVER_VERSION		"14 January 2004"
+
+static const char longname[] = DRIVER_DESC;
+static const char shortname[] = DRIVER_NAME;
+
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_AUTHOR("Alan Stern");
+MODULE_LICENSE("Dual BSD/GPL");
+
+/* Thanks to NetChip Technologies for donating this product ID.
+ *
+ * DO NOT REUSE THESE IDs with any other driver!!  Ever!!
+ * Instead:  allocate your own, using normal USB-IF procedures. */
+#define DRIVER_VENDOR_ID	0x0525	// NetChip
+#define DRIVER_PRODUCT_ID	0xa4a5	// Linux-USB File-backed Storage Gadget
+
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * Hardware-specific configuration, controlled by which device
+ * controller driver was configured.
+ *
+ * CHIP ... hardware identifier
+ * DRIVER_VERSION_NUM ... alerts the host side driver to differences
+ * EP_*_NAME ... which endpoints do we use for which purpose?
+ * EP_*_NUM ... numbers for them (often limited by hardware)
+ * FS_BULK_IN_MAXPACKET ... maxpacket value for full-speed bulk-in ep
+ * FS_BULK_OUT_MAXPACKET ... maxpacket value for full-speed bulk-out ep
+ * HIGHSPEED ... define if ep0 and descriptors need high speed support
+ * MAX_USB_POWER ... define if we use other than 100 mA bus current
+ * SELFPOWER ... if we can run on bus power, zero
+ * NO_BULK_STALL ... bulk endpoint halts don't work well so avoid them
+ */
+
+
+/*
+ * NetChip 2280, PCI based.
+ *
+ * This has half a dozen configurable endpoints, four with dedicated
+ * DMA channels to manage their FIFOs.  It supports high speed.
+ * Those endpoints can be arranged in any desired configuration.
+ */
+#ifdef	CONFIG_USB_GADGET_NET2280
+#define CHIP			"net2280"
+#define DRIVER_VERSION_NUM	0x0201
+static const char EP_BULK_IN_NAME[] = "ep-a";
+#define EP_BULK_IN_NUM		1
+#define FS_BULK_IN_MAXPACKET	64
+static const char EP_BULK_OUT_NAME[] = "ep-b";
+#define EP_BULK_OUT_NUM		2
+#define FS_BULK_OUT_MAXPACKET	64
+static const char EP_INTR_IN_NAME[] = "ep-e";
+#define EP_INTR_IN_NUM		5
+#define HIGHSPEED
+#endif
+
+
+/*
+ * Dummy_hcd, software-based loopback controller.
+ *
+ * This imitates the abilities of the NetChip 2280, so we will use
+ * the same configuration.
+ */
+#ifdef	CONFIG_USB_GADGET_DUMMY_HCD
+#define CHIP			"dummy"
+#define DRIVER_VERSION_NUM	0x0202
+static const char EP_BULK_IN_NAME[] = "ep-a";
+#define EP_BULK_IN_NUM		1
+#define FS_BULK_IN_MAXPACKET	64
+static const char EP_BULK_OUT_NAME[] = "ep-b";
+#define EP_BULK_OUT_NUM		2
+#define FS_BULK_OUT_MAXPACKET	64
+static const char EP_INTR_IN_NAME[] = "ep-e";
+#define EP_INTR_IN_NUM		5
+#define HIGHSPEED
+#endif
+
+
+/*
+ * PXA-2xx UDC:  widely used in second gen Linux-capable PDAs.
+ *
+ * This has fifteen fixed-function full speed endpoints, and it
+ * can support all USB transfer types.
+ *
+ * These supports three or four configurations, with fixed numbers.
+ * The hardware interprets SET_INTERFACE, net effect is that you
+ * can't use altsettings or reset the interfaces independently.
+ * So stick to a single interface.
+ */
+#ifdef	CONFIG_USB_GADGET_PXA2XX
+#define CHIP			"pxa2xx"
+#define DRIVER_VERSION_NUM	0x0203
+static const char EP_BULK_IN_NAME[] = "ep1in-bulk";
+#define EP_BULK_IN_NUM		1
+#define FS_BULK_IN_MAXPACKET	64
+static const char EP_BULK_OUT_NAME[] = "ep2out-bulk";
+#define EP_BULK_OUT_NUM		2
+#define FS_BULK_OUT_MAXPACKET	64
+static const char EP_INTR_IN_NAME[] = "ep6in-bulk";
+#define EP_INTR_IN_NUM		6
+#endif
+
+
+/*
+ * SuperH UDC:  UDC built-in to some Renesas SH processors.
+ *
+ * This has three fixed-function full speed bulk/interrupt endpoints.
+ *
+ * Only one configuration and interface is supported (SET_CONFIGURATION
+ * and SET_INTERFACE are handled completely by the hardware).
+ */
+#ifdef	CONFIG_USB_GADGET_SUPERH
+#define CHIP			"superh"
+#define DRIVER_VERSION_NUM	0x0205
+static const char EP_BULK_IN_NAME[] = "ep2in-bulk";
+#define EP_BULK_IN_NUM		2
+#define FS_BULK_IN_MAXPACKET	64
+static const char EP_BULK_OUT_NAME[] = "ep1out-bulk";
+#define EP_BULK_OUT_NUM		1
+#define FS_BULK_OUT_MAXPACKET	64
+static const char EP_INTR_IN_NAME[] = "ep3in-bulk";
+#define EP_INTR_IN_NUM		3
+#define NO_BULK_STALL
+#endif
+
+
+/*
+ * Toshiba TC86C001 ("Goku-S") UDC
+ *
+ * This has three semi-configurable full speed bulk/interrupt endpoints.
+ */
+#ifdef	CONFIG_USB_GADGET_GOKU
+#define CHIP			"goku"
+#define DRIVER_VERSION_NUM	0x0206
+static const char EP_BULK_OUT_NAME [] = "ep1-bulk";
+#define EP_BULK_OUT_NUM		1
+#define FS_BULK_IN_MAXPACKET	64
+static const char EP_BULK_IN_NAME [] = "ep2-bulk";
+#define EP_BULK_IN_NUM		2
+#define FS_BULK_OUT_MAXPACKET	64
+static const char EP_INTR_IN_NAME [] = "ep3-bulk";
+#define EP_INTR_IN_NUM		3
+#endif
+
+
+/*-------------------------------------------------------------------------*/
+
+#ifndef CHIP
+#	error Configure some USB peripheral controller driver!
+#endif
+
+/* Power usage is config specific.
+ * Hardware that supports remote wakeup defaults to disabling it.
+ */
+#ifndef	SELFPOWER
+/* default: say we're self-powered */
+#define SELFPOWER USB_CONFIG_ATT_SELFPOWER
+/* else:
+ * - SELFPOWER value must be zero
+ * - MAX_USB_POWER may be nonzero.
+ */
+#endif
+
+#ifndef	MAX_USB_POWER
+/* Any hub supports this steady state bus power consumption */
+#define MAX_USB_POWER	100	/* mA */
+#endif
+
+/* We don't support remote wake-up */
+
+#ifdef NO_BULK_STALL
+#define CAN_STALL	0
+#else
+#define CAN_STALL	1
+#endif
+
+
+/*-------------------------------------------------------------------------*/
+
+#define xprintk(f,level,fmt,args...) \
+	dev_printk(level , &(f)->gadget->dev , fmt , ## args)
+#define yprintk(l,level,fmt,args...) \
+	dev_printk(level , &(l)->dev , fmt , ## args)
+
+#ifdef DEBUG
+#define DBG(fsg,fmt,args...) \
+	xprintk(fsg , KERN_DEBUG , fmt , ## args)
+#define LDBG(lun,fmt,args...) \
+	yprintk(lun , KERN_DEBUG , fmt , ## args)
+#define MDBG(fmt,args...) \
+	printk(KERN_DEBUG DRIVER_NAME ": " fmt, ## args)
+#else
+#define DBG(fsg,fmt,args...) \
+	do { } while (0)
+#define LDBG(lun,fmt,args...) \
+	do { } while (0)
+#define MDBG(fmt,args...) \
+	do { } while (0)
+#undef VERBOSE
+#undef DUMP_MSGS
+#endif /* DEBUG */
+
+#ifdef VERBOSE
+#define VDBG	DBG
+#define VLDBG	LDBG
+#else
+#define VDBG(fsg,fmt,args...) \
+	do { } while (0)
+#define VLDBG(lun,fmt,args...) \
+	do { } while (0)
+#endif /* VERBOSE */
+
+#define ERROR(fsg,fmt,args...) \
+	xprintk(fsg , KERN_ERR , fmt , ## args)
+#define LERROR(lun,fmt,args...) \
+	yprintk(lun , KERN_ERR , fmt , ## args)
+
+#define WARN(fsg,fmt,args...) \
+	xprintk(fsg , KERN_WARNING , fmt , ## args)
+#define LWARN(lun,fmt,args...) \
+	yprintk(lun , KERN_WARNING , fmt , ## args)
+
+#define INFO(fsg,fmt,args...) \
+	xprintk(fsg , KERN_INFO , fmt , ## args)
+#define LINFO(lun,fmt,args...) \
+	yprintk(lun , KERN_INFO , fmt , ## args)
+
+#define MINFO(fmt,args...) \
+	printk(KERN_INFO DRIVER_NAME ": " fmt, ## args)
+
+
+/*-------------------------------------------------------------------------*/
+
+/* Encapsulate the module parameter settings */
+
+#define MAX_LUNS	8
+
+	/* Arggh!  There should be a module_param_array_named macro! */
+static char		*file[MAX_LUNS] = {NULL, };
+static int		ro[MAX_LUNS] = {0, };
+
+static struct {
+	int		num_filenames;
+	int		num_ros;
+	unsigned int	nluns;
+
+	char		*transport_parm;
+	char		*protocol_parm;
+	int		removable;
+	unsigned short	vendor;
+	unsigned short	product;
+	unsigned short	release;
+	unsigned int	buflen;
+	int		can_stall;
+
+	int		transport_type;
+	char		*transport_name;
+	int		protocol_type;
+	char		*protocol_name;
+
+} mod_data = {					// Default values
+	.transport_parm		= "BBB",
+	.protocol_parm		= "SCSI",
+	.removable		= 0,
+	.vendor			= DRIVER_VENDOR_ID,
+	.product		= DRIVER_PRODUCT_ID,
+	.release		= DRIVER_VERSION_NUM,
+	.buflen			= 16384,
+	.can_stall		= CAN_STALL,
+	};
+
+
+module_param_array(file, charp, mod_data.num_filenames, S_IRUGO);
+MODULE_PARM_DESC(file, "names of backing files or devices");
+
+module_param_array(ro, bool, mod_data.num_ros, S_IRUGO);
+MODULE_PARM_DESC(ro, "true to force read-only");
+
+
+/* In the non-TEST version, only the file and ro module parameters
+ * are available. */
+#ifdef CONFIG_USB_FILE_STORAGE_TEST
+
+module_param_named(luns, mod_data.nluns, uint, S_IRUGO);
+MODULE_PARM_DESC(luns, "number of LUNs");
+
+module_param_named(transport, mod_data.transport_parm, charp, S_IRUGO);
+MODULE_PARM_DESC(transport, "type of transport (BBB, CBI, or CB)");
+
+module_param_named(protocol, mod_data.protocol_parm, charp, S_IRUGO);
+MODULE_PARM_DESC(protocol, "type of protocol (RBC, 8020, QIC, UFI, "
+		"8070, or SCSI)");
+
+module_param_named(removable, mod_data.removable, bool, S_IRUGO);
+MODULE_PARM_DESC(removable, "true to simulate removable media");
+
+module_param_named(vendor, mod_data.vendor, ushort, S_IRUGO);
+MODULE_PARM_DESC(vendor, "USB Vendor ID");
+
+module_param_named(product, mod_data.product, ushort, S_IRUGO);
+MODULE_PARM_DESC(product, "USB Product ID");
+
+module_param_named(release, mod_data.release, ushort, S_IRUGO);
+MODULE_PARM_DESC(release, "USB release number");
+
+module_param_named(buflen, mod_data.buflen, uint, S_IRUGO);
+MODULE_PARM_DESC(buflen, "I/O buffer size");
+
+module_param_named(stall, mod_data.can_stall, bool, S_IRUGO);
+MODULE_PARM_DESC(stall, "false to prevent bulk stalls");
+
+#endif /* CONFIG_USB_FILE_STORAGE_TEST */
+
+
+/*-------------------------------------------------------------------------*/
+
+/* USB protocol value = the transport method */
+#define USB_PR_CBI	0x00		// Control/Bulk/Interrupt
+#define USB_PR_CB	0x01		// Control/Bulk w/o interrupt
+#define USB_PR_BULK	0x50		// Bulk-only
+
+/* USB subclass value = the protocol encapsulation */
+#define USB_SC_RBC	0x01		// Reduced Block Commands (flash)
+#define USB_SC_8020	0x02		// SFF-8020i, MMC-2, ATAPI (CD-ROM)
+#define USB_SC_QIC	0x03		// QIC-157 (tape)
+#define USB_SC_UFI	0x04		// UFI (floppy)
+#define USB_SC_8070	0x05		// SFF-8070i (removable)
+#define USB_SC_SCSI	0x06		// Transparent SCSI
+
+/* Bulk-only data structures */
+
+/* Command Block Wrapper */
+struct bulk_cb_wrap {
+	u32	Signature;		// Contains 'USBC'
+	u32	Tag;			// Unique per command id
+	u32	DataTransferLength;	// Size of the data
+	u8	Flags;			// Direction in bit 7
+	u8	Lun;			// LUN (normally 0)
+	u8	Length;			// Of the CDB, <= MAX_COMMAND_SIZE
+	u8	CDB[16];		// Command Data Block
+};
+
+#define USB_BULK_CB_WRAP_LEN	31
+#define USB_BULK_CB_SIG		0x43425355	// Spells out USBC
+#define USB_BULK_IN_FLAG	0x80
+
+/* Command Status Wrapper */
+struct bulk_cs_wrap {
+	u32	Signature;		// Should = 'USBS'
+	u32	Tag;			// Same as original command
+	u32	Residue;		// Amount not transferred
+	u8	Status;			// See below
+};
+
+#define USB_BULK_CS_WRAP_LEN	13
+#define USB_BULK_CS_SIG		0x53425355	// Spells out 'USBS'
+#define USB_STATUS_PASS		0
+#define USB_STATUS_FAIL		1
+#define USB_STATUS_PHASE_ERROR	2
+
+/* Bulk-only class specific requests */
+#define USB_BULK_RESET_REQUEST		0xff
+#define USB_BULK_GET_MAX_LUN_REQUEST	0xfe
+
+
+/* CBI Interrupt data structure */
+struct interrupt_data {
+	u8	bType;
+	u8	bValue;
+};
+
+#define CBI_INTERRUPT_DATA_LEN		2
+
+/* CBI Accept Device-Specific Command request */
+#define USB_CBI_ADSC_REQUEST		0x00
+
+
+#define MAX_COMMAND_SIZE	16	// Length of a SCSI Command Data Block
+
+/* SCSI commands that we recognize */
+#define SC_FORMAT_UNIT			0x04
+#define SC_INQUIRY			0x12
+#define SC_MODE_SELECT_6		0x15
+#define SC_MODE_SELECT_10		0x55
+#define SC_MODE_SENSE_6			0x1a
+#define SC_MODE_SENSE_10		0x5a
+#define SC_PREVENT_ALLOW_MEDIUM_REMOVAL	0x1e
+#define SC_READ_6			0x08
+#define SC_READ_10			0x28
+#define SC_READ_12			0xa8
+#define SC_READ_CAPACITY		0x25
+#define SC_READ_FORMAT_CAPACITIES	0x23
+#define SC_RELEASE			0x17
+#define SC_REQUEST_SENSE		0x03
+#define SC_RESERVE			0x16
+#define SC_SEND_DIAGNOSTIC		0x1d
+#define SC_START_STOP_UNIT		0x1b
+#define SC_SYNCHRONIZE_CACHE		0x35
+#define SC_TEST_UNIT_READY		0x00
+#define SC_VERIFY			0x2f
+#define SC_WRITE_6			0x0a
+#define SC_WRITE_10			0x2a
+#define SC_WRITE_12			0xaa
+
+/* SCSI Sense Key/Additional Sense Code/ASC Qualifier values */
+#define SS_NO_SENSE				0
+#define SS_COMMUNICATION_FAILURE		0x040800
+#define SS_INVALID_COMMAND			0x052000
+#define SS_INVALID_FIELD_IN_CDB			0x052400
+#define SS_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE	0x052100
+#define SS_LOGICAL_UNIT_NOT_SUPPORTED		0x052500
+#define SS_MEDIUM_NOT_PRESENT			0x023a00
+#define SS_MEDIUM_REMOVAL_PREVENTED		0x055302
+#define SS_NOT_READY_TO_READY_TRANSITION	0x062800
+#define SS_RESET_OCCURRED			0x062900
+#define SS_SAVING_PARAMETERS_NOT_SUPPORTED	0x053900
+#define SS_UNRECOVERED_READ_ERROR		0x031100
+#define SS_WRITE_ERROR				0x030c02
+#define SS_WRITE_PROTECTED			0x072700
+
+#define SK(x)		((u8) ((x) >> 16))	// Sense Key byte, etc.
+#define ASC(x)		((u8) ((x) >> 8))
+#define ASCQ(x)		((u8) (x))
+
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * These definitions will permit the compiler to avoid generating code for
+ * parts of the driver that aren't used in the non-TEST version.  Even gcc
+ * can recognize when a test of a constant expression yields a dead code
+ * path.
+ *
+ * Also, in the non-TEST version, open_backing_file() is only used during
+ * initialization and the sysfs attribute store_xxx routines aren't used
+ * at all.  We will define NORMALLY_INIT to mark them as __init so they
+ * don't occupy kernel code space unnecessarily.
+ */
+
+#ifdef CONFIG_USB_FILE_STORAGE_TEST
+
+#define transport_is_bbb()	(mod_data.transport_type == USB_PR_BULK)
+#define transport_is_cbi()	(mod_data.transport_type == USB_PR_CBI)
+#define protocol_is_scsi()	(mod_data.protocol_type == USB_SC_SCSI)
+#define backing_file_is_open(curlun)	((curlun)->filp != NULL)
+#define NORMALLY_INIT
+
+#else
+
+#define transport_is_bbb()	1
+#define transport_is_cbi()	0
+#define protocol_is_scsi()	1
+#define backing_file_is_open(curlun)	1
+#define NORMALLY_INIT		__init
+
+#endif /* CONFIG_USB_FILE_STORAGE_TEST */
+
+
+struct lun {
+	struct file	*filp;
+	loff_t		file_length;
+	loff_t		num_sectors;
+
+	unsigned int	ro : 1;
+	unsigned int	prevent_medium_removal : 1;
+	unsigned int	registered : 1;
+
+	u32		sense_data;
+	u32		sense_data_info;
+	u32		unit_attention_data;
+
+	struct device	dev;
+};
+
+static inline struct lun *dev_to_lun(struct device *dev)
+{
+	return container_of(dev, struct lun, dev);
+}
+
+
+/* Big enough to hold our biggest descriptor */
+#define EP0_BUFSIZE	256
+#define DELAYED_STATUS	(EP0_BUFSIZE + 999)	// An impossibly large value
+
+/* Number of buffers we will use.  2 is enough for double-buffering */
+#define NUM_BUFFERS	2
+
+enum fsg_buffer_state {
+	BUF_STATE_EMPTY = 0,
+	BUF_STATE_FULL,
+	BUF_STATE_BUSY
+};
+
+struct fsg_buffhd {
+	void				*buf;
+	dma_addr_t			dma;
+	volatile enum fsg_buffer_state	state;
+	struct fsg_buffhd		*next;
+
+	/* The NetChip 2280 is faster, and handles some protocol faults
+	 * better, if we don't submit any short bulk-out read requests.
+	 * So we will record the intended request length here. */
+	unsigned int			bulk_out_intended_length;
+
+	struct usb_request		*inreq;
+	volatile int			inreq_busy;
+	struct usb_request		*outreq;
+	volatile int			outreq_busy;
+};
+
+enum fsg_state {
+	FSG_STATE_COMMAND_PHASE = -10,		// This one isn't used anywhere
+	FSG_STATE_DATA_PHASE,
+	FSG_STATE_STATUS_PHASE,
+
+	FSG_STATE_IDLE = 0,
+	FSG_STATE_ABORT_BULK_OUT,
+	FSG_STATE_RESET,
+	FSG_STATE_INTERFACE_CHANGE,
+	FSG_STATE_CONFIG_CHANGE,
+	FSG_STATE_DISCONNECT,
+	FSG_STATE_EXIT,
+	FSG_STATE_TERMINATED
+};
+
+enum data_direction {
+	DATA_DIR_UNKNOWN = 0,
+	DATA_DIR_FROM_HOST,
+	DATA_DIR_TO_HOST,
+	DATA_DIR_NONE
+};
+
+struct fsg_dev {
+	/* lock protects: state, all the req_busy's, and cbbuf_cmnd */
+	spinlock_t		lock;
+	struct usb_gadget	*gadget;
+
+	/* filesem protects: backing files in use */
+	struct rw_semaphore	filesem;
+
+	struct usb_ep		*ep0;		// Handy copy of gadget->ep0
+	struct usb_request	*ep0req;	// For control responses
+	volatile unsigned int	ep0_req_tag;
+	const char		*ep0req_name;
+
+	struct usb_request	*intreq;	// For interrupt responses
+	volatile int		intreq_busy;
+	struct fsg_buffhd	*intr_buffhd;
+
+ 	unsigned int		bulk_out_maxpacket;
+	enum fsg_state		state;		// For exception handling
+	unsigned int		exception_req_tag;
+
+	u8			config, new_config;
+
+	unsigned int		running : 1;
+	unsigned int		bulk_in_enabled : 1;
+	unsigned int		bulk_out_enabled : 1;
+	unsigned int		intr_in_enabled : 1;
+	unsigned int		phase_error : 1;
+	unsigned int		short_packet_received : 1;
+	unsigned int		bad_lun_okay : 1;
+
+	unsigned long		atomic_bitflags;
+#define REGISTERED		0
+#define CLEAR_BULK_HALTS	1
+
+	struct usb_ep		*bulk_in;
+	struct usb_ep		*bulk_out;
+	struct usb_ep		*intr_in;
+
+	struct fsg_buffhd	*next_buffhd_to_fill;
+	struct fsg_buffhd	*next_buffhd_to_drain;
+	struct fsg_buffhd	buffhds[NUM_BUFFERS];
+
+	wait_queue_head_t	thread_wqh;
+	int			thread_wakeup_needed;
+	struct completion	thread_notifier;
+	int			thread_pid;
+	struct task_struct	*thread_task;
+	sigset_t		thread_signal_mask;
+
+	int			cmnd_size;
+	u8			cmnd[MAX_COMMAND_SIZE];
+	enum data_direction	data_dir;
+	u32			data_size;
+	u32			data_size_from_cmnd;
+	u32			tag;
+	unsigned int		lun;
+	u32			residue;
+	u32			usb_amount_left;
+
+	/* The CB protocol offers no way for a host to know when a command
+	 * has completed.  As a result the next command may arrive early,
+	 * and we will still have to handle it.  For that reason we need
+	 * a buffer to store new commands when using CB (or CBI, which
+	 * does not oblige a host to wait for command completion either). */
+	int			cbbuf_cmnd_size;
+	u8			cbbuf_cmnd[MAX_COMMAND_SIZE];
+
+	unsigned int		nluns;
+	struct lun		*luns;
+	struct lun		*curlun;
+};
+
+typedef void (*fsg_routine_t)(struct fsg_dev *);
+
+static int inline exception_in_progress(struct fsg_dev *fsg)
+{
+	return (fsg->state > FSG_STATE_IDLE);
+}
+
+/* Make bulk-out requests be divisible by the maxpacket size */
+static void inline set_bulk_out_req_length(struct fsg_dev *fsg,
+		struct fsg_buffhd *bh, unsigned int length)
+{
+	unsigned int	rem;
+
+	bh->bulk_out_intended_length = length;
+	rem = length % fsg->bulk_out_maxpacket;
+	if (rem > 0)
+		length += fsg->bulk_out_maxpacket - rem;
+	bh->outreq->length = length;
+}
+
+static struct fsg_dev			*the_fsg;
+static struct usb_gadget_driver		fsg_driver;
+
+static void	close_backing_file(struct lun *curlun);
+static void	close_all_backing_files(struct fsg_dev *fsg);
+
+
+/*-------------------------------------------------------------------------*/
+
+#ifdef DUMP_MSGS
+
+static void dump_msg(struct fsg_dev *fsg, const char *label,
+		const u8 *buf, unsigned int length)
+{
+	unsigned int	start, num, i;
+	char		line[52], *p;
+
+	if (length >= 512)
+		return;
+	DBG(fsg, "%s, length %u:\n", label, length);
+
+	start = 0;
+	while (length > 0) {
+		num = min(length, 16u);
+		p = line;
+		for (i = 0; i < num; ++i) {
+			if (i == 8)
+				*p++ = ' ';
+			sprintf(p, " %02x", buf[i]);
+			p += 3;
+		}
+		*p = 0;
+		printk(KERN_DEBUG "%6x: %s\n", start, line);
+		buf += num;
+		start += num;
+		length -= num;
+	}
+}
+
+static void inline dump_cdb(struct fsg_dev *fsg)
+{}
+
+#else
+
+static void inline dump_msg(struct fsg_dev *fsg, const char *label,
+		const u8 *buf, unsigned int length)
+{}
+
+static void inline dump_cdb(struct fsg_dev *fsg)
+{
+	int	i;
+	char	cmdbuf[3*MAX_COMMAND_SIZE + 1];
+
+	for (i = 0; i < fsg->cmnd_size; ++i)
+		sprintf(cmdbuf + i*3, " %02x", fsg->cmnd[i]);
+	VDBG(fsg, "SCSI CDB: %s\n", cmdbuf);
+}
+
+#endif /* DUMP_MSGS */
+
+
+static int fsg_set_halt(struct fsg_dev *fsg, struct usb_ep *ep)
+{
+	const char	*name;
+
+	if (ep == fsg->bulk_in)
+		name = "bulk-in";
+	else if (ep == fsg->bulk_out)
+		name = "bulk-out";
+	else
+		name = ep->name;
+	DBG(fsg, "%s set halt\n", name);
+	return usb_ep_set_halt(ep);
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+/* Routines for unaligned data access */
+
+static u16 inline get_be16(u8 *buf)
+{
+	return ((u16) buf[0] << 8) | ((u16) buf[1]);
+}
+
+static u32 inline get_be32(u8 *buf)
+{
+	return ((u32) buf[0] << 24) | ((u32) buf[1] << 16) |
+			((u32) buf[2] << 8) | ((u32) buf[3]);
+}
+
+static void inline put_be16(u8 *buf, u16 val)
+{
+	buf[0] = val >> 8;
+	buf[1] = val;
+}
+
+static void inline put_be32(u8 *buf, u32 val)
+{
+	buf[0] = val >> 24;
+	buf[1] = val >> 16;
+	buf[2] = val >> 8;
+	buf[3] = val;
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * DESCRIPTORS ... most are static, but strings and (full) configuration
+ * descriptors are built on demand.  Also the (static) config and interface
+ * descriptors are adjusted during fsg_bind().
+ */
+#define STRING_MANUFACTURER	1
+#define STRING_PRODUCT		2
+#define STRING_SERIAL		3
+
+/* There is only one configuration. */
+#define	CONFIG_VALUE		1
+
+static struct usb_device_descriptor
+device_desc = {
+	.bLength =		sizeof device_desc,
+	.bDescriptorType =	USB_DT_DEVICE,
+
+	.bcdUSB =		__constant_cpu_to_le16(0x0200),
+	.bDeviceClass =		USB_CLASS_PER_INTERFACE,
+
+	/* The next three values can be overridden by module parameters */
+	.idVendor =		__constant_cpu_to_le16(DRIVER_VENDOR_ID),
+	.idProduct =		__constant_cpu_to_le16(DRIVER_PRODUCT_ID),
+	.bcdDevice =		__constant_cpu_to_le16(DRIVER_VERSION_NUM),
+
+	.iManufacturer =	STRING_MANUFACTURER,
+	.iProduct =		STRING_PRODUCT,
+	.iSerialNumber =	STRING_SERIAL,
+	.bNumConfigurations =	1,
+};
+
+static struct usb_config_descriptor
+config_desc = {
+	.bLength =		sizeof config_desc,
+	.bDescriptorType =	USB_DT_CONFIG,
+
+	/* wTotalLength adjusted during bind() */
+	.bNumInterfaces =	1,
+	.bConfigurationValue =	CONFIG_VALUE,
+	.bmAttributes =		USB_CONFIG_ATT_ONE | SELFPOWER,
+	.bMaxPower =		(MAX_USB_POWER + 1) / 2,
+};
+
+/* There is only one interface. */
+
+static struct usb_interface_descriptor
+intf_desc = {
+	.bLength =		sizeof intf_desc,
+	.bDescriptorType =	USB_DT_INTERFACE,
+
+	.bNumEndpoints =	2,		// Adjusted during bind()
+	.bInterfaceClass =	USB_CLASS_MASS_STORAGE,
+	.bInterfaceSubClass =	USB_SC_SCSI,	// Adjusted during bind()
+	.bInterfaceProtocol =	USB_PR_BULK,	// Adjusted during bind()
+};
+
+/* Three full-speed endpoint descriptors: bulk-in, bulk-out,
+ * and interrupt-in. */
+
+static const struct usb_endpoint_descriptor
+fs_bulk_in_desc = {
+	.bLength =		USB_DT_ENDPOINT_SIZE,
+	.bDescriptorType =	USB_DT_ENDPOINT,
+
+	.bEndpointAddress =	EP_BULK_IN_NUM | USB_DIR_IN,
+	.bmAttributes =		USB_ENDPOINT_XFER_BULK,
+	.wMaxPacketSize =	__constant_cpu_to_le16(FS_BULK_IN_MAXPACKET),
+};
+
+static const struct usb_endpoint_descriptor
+fs_bulk_out_desc = {
+	.bLength =		USB_DT_ENDPOINT_SIZE,
+	.bDescriptorType =	USB_DT_ENDPOINT,
+
+	.bEndpointAddress =	EP_BULK_OUT_NUM,
+	.bmAttributes =		USB_ENDPOINT_XFER_BULK,
+	.wMaxPacketSize =	__constant_cpu_to_le16(FS_BULK_OUT_MAXPACKET),
+};
+
+static const struct usb_endpoint_descriptor
+fs_intr_in_desc = {
+	.bLength =		USB_DT_ENDPOINT_SIZE,
+	.bDescriptorType =	USB_DT_ENDPOINT,
+
+	.bEndpointAddress =	EP_INTR_IN_NUM | USB_DIR_IN,
+	.bmAttributes =		USB_ENDPOINT_XFER_INT,
+	.wMaxPacketSize =	__constant_cpu_to_le16(2),
+	.bInterval =		32,	// frames -> 32 ms
+};
+
+#ifdef	HIGHSPEED
+
+/*
+ * USB 2.0 devices need to expose both high speed and full speed
+ * descriptors, unless they only run at full speed.
+ *
+ * That means alternate endpoint descriptors (bigger packets)
+ * and a "device qualifier" ... plus more construction options
+ * for the config descriptor.
+ */
+static const struct usb_endpoint_descriptor
+hs_bulk_in_desc = {
+	.bLength =		USB_DT_ENDPOINT_SIZE,
+	.bDescriptorType =	USB_DT_ENDPOINT,
+
+	.bEndpointAddress =	EP_BULK_IN_NUM | USB_DIR_IN,
+	.bmAttributes =		USB_ENDPOINT_XFER_BULK,
+	.wMaxPacketSize =	__constant_cpu_to_le16(512),
+};
+
+static const struct usb_endpoint_descriptor
+hs_bulk_out_desc = {
+	.bLength =		USB_DT_ENDPOINT_SIZE,
+	.bDescriptorType =	USB_DT_ENDPOINT,
+
+	.bEndpointAddress =	EP_BULK_OUT_NUM,
+	.bmAttributes =		USB_ENDPOINT_XFER_BULK,
+	.wMaxPacketSize =	__constant_cpu_to_le16(512),
+	.bInterval =		1,	// NAK every 1 uframe
+};
+
+static const struct usb_endpoint_descriptor
+hs_intr_in_desc = {
+	.bLength =		USB_DT_ENDPOINT_SIZE,
+	.bDescriptorType =	USB_DT_ENDPOINT,
+
+	.bEndpointAddress =	EP_INTR_IN_NUM | USB_DIR_IN,
+	.bmAttributes =		USB_ENDPOINT_XFER_INT,
+	.wMaxPacketSize =	__constant_cpu_to_le16(2),
+	.bInterval =		9,	// 2**(9-1) = 256 uframes -> 32 ms
+};
+
+static struct usb_qualifier_descriptor
+dev_qualifier = {
+	.bLength =		sizeof dev_qualifier,
+	.bDescriptorType =	USB_DT_DEVICE_QUALIFIER,
+
+	.bcdUSB =		__constant_cpu_to_le16(0x0200),
+	.bDeviceClass =		USB_CLASS_PER_INTERFACE,
+
+	.bNumConfigurations =	1,
+};
+
+/* Maxpacket and other transfer characteristics vary by speed. */
+#define ep_desc(g,fs,hs)	(((g)->speed==USB_SPEED_HIGH) ? (hs) : (fs))
+
+#else
+
+/* If there's no high speed support, maxpacket doesn't change. */
+#define ep_desc(g,fs,hs)	fs
+
+#endif	/* !HIGHSPEED */
+
+
+/* The CBI specification limits the serial string to 12 uppercase hexadecimal
+ * characters. */
+static char				serial[13];
+
+/* Static strings, in ISO 8859/1 */
+static struct usb_string		strings[] = {
+	{ STRING_MANUFACTURER, UTS_SYSNAME " " UTS_RELEASE " with " CHIP, },
+	{ STRING_PRODUCT, longname, },
+	{ STRING_SERIAL, serial, },
+	{ }			// end of list
+};
+
+static struct usb_gadget_strings	stringtab = {
+	.language	= 0x0409,		// en-us
+	.strings	= strings,
+};
+
+
+/*
+ * Config descriptors are handcrafted.  They must agree with the code
+ * that sets configurations and with code managing interfaces and their
+ * altsettings.  They must also handle different speeds and other-speed
+ * requests.
+ */
+static int populate_config_buf(enum usb_device_speed speed,
+		u8 *buf0, u8 type, unsigned index)
+{
+	u8	*buf = buf0;
+#ifdef HIGHSPEED
+	int	hs;
+#endif
+
+	if (index > 0)
+		return -EINVAL;
+	if (config_desc.wTotalLength  > EP0_BUFSIZE)
+		return -EDOM;
+
+	/* Config (or other speed config) */
+	memcpy(buf, &config_desc, USB_DT_CONFIG_SIZE);
+	buf[1] = type;
+	buf += USB_DT_CONFIG_SIZE;
+
+	/* Interface */
+	memcpy(buf, &intf_desc, USB_DT_INTERFACE_SIZE);
+	buf += USB_DT_INTERFACE_SIZE;
+
+	/* The endpoints in the interface (at that speed) */
+#ifdef HIGHSPEED
+	hs = (speed == USB_SPEED_HIGH);
+	if (type == USB_DT_OTHER_SPEED_CONFIG)
+		hs = !hs;
+	if (hs) {
+		memcpy(buf, &hs_bulk_in_desc, USB_DT_ENDPOINT_SIZE);
+		buf += USB_DT_ENDPOINT_SIZE;
+		memcpy(buf, &hs_bulk_out_desc, USB_DT_ENDPOINT_SIZE);
+		buf += USB_DT_ENDPOINT_SIZE;
+		if (transport_is_cbi()) {
+			memcpy(buf, &hs_intr_in_desc, USB_DT_ENDPOINT_SIZE);
+			buf += USB_DT_ENDPOINT_SIZE;
+		}
+	} else
+#endif
+	{
+		memcpy(buf, &fs_bulk_in_desc, USB_DT_ENDPOINT_SIZE);
+		buf += USB_DT_ENDPOINT_SIZE;
+		memcpy(buf, &fs_bulk_out_desc, USB_DT_ENDPOINT_SIZE);
+		buf += USB_DT_ENDPOINT_SIZE;
+		if (transport_is_cbi()) {
+			memcpy(buf, &fs_intr_in_desc, USB_DT_ENDPOINT_SIZE);
+			buf += USB_DT_ENDPOINT_SIZE;
+		}
+	}
+
+	return buf - buf0;
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+/* These routines may be called in process context or in_irq */
+
+static void wakeup_thread(struct fsg_dev *fsg)
+{
+	/* Tell the main thread that something has happened */
+	fsg->thread_wakeup_needed = 1;
+	wake_up_all(&fsg->thread_wqh);
+}
+
+
+static void raise_exception(struct fsg_dev *fsg, enum fsg_state new_state)
+{
+	unsigned long		flags;
+	struct task_struct	*thread_task;
+
+	/* Do nothing if a higher-priority exception is already in progress.
+	 * If a lower-or-equal priority exception is in progress, preempt it
+	 * and notify the main thread by sending it a signal. */
+	spin_lock_irqsave(&fsg->lock, flags);
+	if (fsg->state <= new_state) {
+		fsg->exception_req_tag = fsg->ep0_req_tag;
+		fsg->state = new_state;
+		thread_task = fsg->thread_task;
+		if (thread_task)
+			send_sig_info(SIGUSR1, SEND_SIG_FORCED, thread_task);
+	}
+	spin_unlock_irqrestore(&fsg->lock, flags);
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+/* The disconnect callback and ep0 routines.  These always run in_irq,
+ * except that ep0_queue() is called in the main thread to acknowledge
+ * completion of various requests: set config, set interface, and
+ * Bulk-only device reset. */
+
+static void fsg_disconnect(struct usb_gadget *gadget)
+{
+	struct fsg_dev		*fsg = get_gadget_data(gadget);
+
+	DBG(fsg, "disconnect or port reset\n");
+	raise_exception(fsg, FSG_STATE_DISCONNECT);
+}
+
+
+static int ep0_queue(struct fsg_dev *fsg)
+{
+	int	rc;
+
+	rc = usb_ep_queue(fsg->ep0, fsg->ep0req, GFP_ATOMIC);
+	if (rc != 0 && rc != -ESHUTDOWN) {
+
+		/* We can't do much more than wait for a reset */
+		WARN(fsg, "error in submission: %s --> %d\n",
+				fsg->ep0->name, rc);
+	}
+	return rc;
+}
+
+static void ep0_complete(struct usb_ep *ep, struct usb_request *req)
+{
+	struct fsg_dev		*fsg = (struct fsg_dev *) ep->driver_data;
+
+	if (req->actual > 0)
+		dump_msg(fsg, fsg->ep0req_name, req->buf, req->actual);
+	if (req->status || req->actual != req->length)
+		DBG(fsg, "%s --> %d, %u/%u\n", __FUNCTION__,
+				req->status, req->actual, req->length);
+	if (req->status == -ECONNRESET)		// Request was cancelled
+		usb_ep_fifo_flush(ep);
+
+	if (req->status == 0 && req->context)
+		((fsg_routine_t) (req->context))(fsg);
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+/* Bulk and interrupt endpoint completion handlers.
+ * These always run in_irq. */
+
+static void bulk_in_complete(struct usb_ep *ep, struct usb_request *req)
+{
+	struct fsg_dev		*fsg = (struct fsg_dev *) ep->driver_data;
+	struct fsg_buffhd	*bh = (struct fsg_buffhd *) req->context;
+
+	if (req->status || req->actual != req->length)
+		DBG(fsg, "%s --> %d, %u/%u\n", __FUNCTION__,
+				req->status, req->actual, req->length);
+	if (req->status == -ECONNRESET)		// Request was cancelled
+		usb_ep_fifo_flush(ep);
+
+	/* Hold the lock while we update the request and buffer states */
+	spin_lock(&fsg->lock);
+	bh->inreq_busy = 0;
+	bh->state = BUF_STATE_EMPTY;
+	spin_unlock(&fsg->lock);
+	wakeup_thread(fsg);
+}
+
+static void bulk_out_complete(struct usb_ep *ep, struct usb_request *req)
+{
+	struct fsg_dev		*fsg = (struct fsg_dev *) ep->driver_data;
+	struct fsg_buffhd	*bh = (struct fsg_buffhd *) req->context;
+
+	dump_msg(fsg, "bulk-out", req->buf, req->actual);
+	if (req->status || req->actual != bh->bulk_out_intended_length)
+		DBG(fsg, "%s --> %d, %u/%u\n", __FUNCTION__,
+				req->status, req->actual,
+				bh->bulk_out_intended_length);
+	if (req->status == -ECONNRESET)		// Request was cancelled
+		usb_ep_fifo_flush(ep);
+
+	/* Hold the lock while we update the request and buffer states */
+	spin_lock(&fsg->lock);
+	bh->outreq_busy = 0;
+	bh->state = BUF_STATE_FULL;
+	spin_unlock(&fsg->lock);
+	wakeup_thread(fsg);
+}
+
+static void intr_in_complete(struct usb_ep *ep, struct usb_request *req)
+{
+#ifdef CONFIG_USB_FILE_STORAGE_TEST
+	struct fsg_dev		*fsg = (struct fsg_dev *) ep->driver_data;
+	struct fsg_buffhd	*bh = (struct fsg_buffhd *) req->context;
+
+	if (req->status || req->actual != req->length)
+		DBG(fsg, "%s --> %d, %u/%u\n", __FUNCTION__,
+				req->status, req->actual, req->length);
+	if (req->status == -ECONNRESET)		// Request was cancelled
+		usb_ep_fifo_flush(ep);
+
+	/* Hold the lock while we update the request and buffer states */
+	spin_lock(&fsg->lock);
+	fsg->intreq_busy = 0;
+	bh->state = BUF_STATE_EMPTY;
+	spin_unlock(&fsg->lock);
+	wakeup_thread(fsg);
+#endif /* CONFIG_USB_FILE_STORAGE_TEST */
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+/* Ep0 class-specific handlers.  These always run in_irq. */
+
+static void received_cbi_adsc(struct fsg_dev *fsg, struct fsg_buffhd *bh)
+{
+#ifdef CONFIG_USB_FILE_STORAGE_TEST
+	struct usb_request	*req = fsg->ep0req;
+	static u8		cbi_reset_cmnd[6] = {
+			SC_SEND_DIAGNOSTIC, 4, 0xff, 0xff, 0xff, 0xff};
+
+	/* Error in command transfer? */
+	if (req->status || req->length != req->actual ||
+			req->actual < 6 || req->actual > MAX_COMMAND_SIZE) {
+
+		/* Not all controllers allow a protocol stall after
+		 * receiving control-out data, but we'll try anyway. */
+		fsg_set_halt(fsg, fsg->ep0);
+		return;			// Wait for reset
+	}
+
+	/* Is it the special reset command? */
+	if (req->actual >= sizeof cbi_reset_cmnd &&
+			memcmp(req->buf, cbi_reset_cmnd,
+				sizeof cbi_reset_cmnd) == 0) {
+
+		/* Raise an exception to stop the current operation
+		 * and reinitialize our state. */
+		DBG(fsg, "cbi reset request\n");
+		raise_exception(fsg, FSG_STATE_RESET);
+		return;
+	}
+
+	VDBG(fsg, "CB[I] accept device-specific command\n");
+	spin_lock(&fsg->lock);
+
+	/* Save the command for later */
+	if (fsg->cbbuf_cmnd_size)
+		WARN(fsg, "CB[I] overwriting previous command\n");
+	fsg->cbbuf_cmnd_size = req->actual;
+	memcpy(fsg->cbbuf_cmnd, req->buf, fsg->cbbuf_cmnd_size);
+
+	spin_unlock(&fsg->lock);
+	wakeup_thread(fsg);
+#endif /* CONFIG_USB_FILE_STORAGE_TEST */
+}
+
+
+static int class_setup_req(struct fsg_dev *fsg,
+		const struct usb_ctrlrequest *ctrl)
+{
+	struct usb_request	*req = fsg->ep0req;
+	int			value = -EOPNOTSUPP;
+
+	if (!fsg->config)
+		return value;
+
+	/* Handle Bulk-only class-specific requests */
+	if (transport_is_bbb()) {
+		switch (ctrl->bRequest) {
+
+		case USB_BULK_RESET_REQUEST:
+			if (ctrl->bRequestType != (USB_DIR_OUT |
+					USB_TYPE_CLASS | USB_RECIP_INTERFACE))
+				break;
+			if (ctrl->wIndex != 0) {
+				value = -EDOM;
+				break;
+			}
+
+			/* Raise an exception to stop the current operation
+			 * and reinitialize our state. */
+			DBG(fsg, "bulk reset request\n");
+			raise_exception(fsg, FSG_STATE_RESET);
+			value = DELAYED_STATUS;
+			break;
+
+		case USB_BULK_GET_MAX_LUN_REQUEST:
+			if (ctrl->bRequestType != (USB_DIR_IN |
+					USB_TYPE_CLASS | USB_RECIP_INTERFACE))
+				break;
+			if (ctrl->wIndex != 0) {
+				value = -EDOM;
+				break;
+			}
+			VDBG(fsg, "get max LUN\n");
+			*(u8 *) req->buf = fsg->nluns - 1;
+			value = min(ctrl->wLength, (u16) 1);
+			break;
+		}
+	}
+
+	/* Handle CBI class-specific requests */
+	else {
+		switch (ctrl->bRequest) {
+
+		case USB_CBI_ADSC_REQUEST:
+			if (ctrl->bRequestType != (USB_DIR_OUT |
+					USB_TYPE_CLASS | USB_RECIP_INTERFACE))
+				break;
+			if (ctrl->wIndex != 0) {
+				value = -EDOM;
+				break;
+			}
+			if (ctrl->wLength > MAX_COMMAND_SIZE) {
+				value = -EOVERFLOW;
+				break;
+			}
+			value = ctrl->wLength;
+			fsg->ep0req->context = received_cbi_adsc;
+			break;
+		}
+	}
+
+	if (value == -EOPNOTSUPP)
+		VDBG(fsg,
+			"unknown class-specific control req "
+			"%02x.%02x v%04x i%04x l%u\n",
+			ctrl->bRequestType, ctrl->bRequest,
+			ctrl->wValue, ctrl->wIndex, ctrl->wLength);
+	return value;
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+/* Ep0 standard request handlers.  These always run in_irq. */
+
+static int standard_setup_req(struct fsg_dev *fsg,
+		const struct usb_ctrlrequest *ctrl)
+{
+	struct usb_request	*req = fsg->ep0req;
+	int			value = -EOPNOTSUPP;
+
+	/* Usually this just stores reply data in the pre-allocated ep0 buffer,
+	 * but config change events will also reconfigure hardware. */
+	switch (ctrl->bRequest) {
+
+	case USB_REQ_GET_DESCRIPTOR:
+		if (ctrl->bRequestType != (USB_DIR_IN | USB_TYPE_STANDARD |
+				USB_RECIP_DEVICE))
+			break;
+		switch (ctrl->wValue >> 8) {
+
+		case USB_DT_DEVICE:
+			VDBG(fsg, "get device descriptor\n");
+			value = min(ctrl->wLength, (u16) sizeof device_desc);
+			memcpy(req->buf, &device_desc, value);
+			break;
+#ifdef HIGHSPEED
+		case USB_DT_DEVICE_QUALIFIER:
+			VDBG(fsg, "get device qualifier\n");
+			value = min(ctrl->wLength, (u16) sizeof dev_qualifier);
+			memcpy(req->buf, &dev_qualifier, value);
+			break;
+
+		case USB_DT_OTHER_SPEED_CONFIG:
+			VDBG(fsg, "get other-speed config descriptor\n");
+			goto get_config;
+#endif /* HIGHSPEED */
+		case USB_DT_CONFIG:
+			VDBG(fsg, "get configuration descriptor\n");
+#ifdef HIGHSPEED
+		get_config:
+#endif /* HIGHSPEED */
+			value = populate_config_buf(fsg->gadget->speed,
+					req->buf,
+					ctrl->wValue >> 8,
+					ctrl->wValue & 0xff);
+			if (value >= 0)
+				value = min(ctrl->wLength, (u16) value);
+			break;
+
+		case USB_DT_STRING:
+			VDBG(fsg, "get string descriptor\n");
+
+			/* wIndex == language code */
+			value = usb_gadget_get_string(&stringtab,
+					ctrl->wValue & 0xff, req->buf);
+			if (value >= 0)
+				value = min(ctrl->wLength, (u16) value);
+			break;
+		}
+		break;
+
+	/* One config, two speeds */
+	case USB_REQ_SET_CONFIGURATION:
+		if (ctrl->bRequestType != (USB_DIR_OUT | USB_TYPE_STANDARD |
+				USB_RECIP_DEVICE))
+			break;
+		VDBG(fsg, "set configuration\n");
+		if (ctrl->wValue == CONFIG_VALUE || ctrl->wValue == 0) {
+			fsg->new_config = ctrl->wValue;
+
+			/* Raise an exception to wipe out previous transaction
+			 * state (queued bufs, etc) and set the new config. */
+			raise_exception(fsg, FSG_STATE_CONFIG_CHANGE);
+			value = DELAYED_STATUS;
+		}
+		break;
+	case USB_REQ_GET_CONFIGURATION:
+		if (ctrl->bRequestType != (USB_DIR_IN | USB_TYPE_STANDARD |
+				USB_RECIP_DEVICE))
+			break;
+		VDBG(fsg, "get configuration\n");
+		*(u8 *) req->buf = fsg->config;
+		value = min(ctrl->wLength, (u16) 1);
+		break;
+
+	case USB_REQ_SET_INTERFACE:
+		if (ctrl->bRequestType != (USB_DIR_OUT| USB_TYPE_STANDARD |
+				USB_RECIP_INTERFACE))
+			break;
+		if (fsg->config && ctrl->wIndex == 0) {
+
+			/* Raise an exception to wipe out previous transaction
+			 * state (queued bufs, etc) and install the new
+			 * interface altsetting. */
+			raise_exception(fsg, FSG_STATE_INTERFACE_CHANGE);
+			value = DELAYED_STATUS;
+		}
+		break;
+	case USB_REQ_GET_INTERFACE:
+		if (ctrl->bRequestType != (USB_DIR_IN | USB_TYPE_STANDARD |
+				USB_RECIP_INTERFACE))
+			break;
+		if (!fsg->config)
+			break;
+		if (ctrl->wIndex != 0) {
+			value = -EDOM;
+			break;
+		}
+		VDBG(fsg, "get interface\n");
+		*(u8 *) req->buf = 0;
+		value = min(ctrl->wLength, (u16) 1);
+		break;
+
+	default:
+		VDBG(fsg,
+			"unknown control req %02x.%02x v%04x i%04x l%u\n",
+			ctrl->bRequestType, ctrl->bRequest,
+			ctrl->wValue, ctrl->wIndex, ctrl->wLength);
+	}
+
+	return value;
+}
+
+
+static int fsg_setup(struct usb_gadget *gadget,
+		const struct usb_ctrlrequest *ctrl)
+{
+	struct fsg_dev		*fsg = get_gadget_data(gadget);
+	int			rc;
+
+	++fsg->ep0_req_tag;		// Record arrival of a new request
+	fsg->ep0req->context = NULL;
+	fsg->ep0req->length = 0;
+	dump_msg(fsg, "ep0-setup", (u8 *) ctrl, sizeof(*ctrl));
+
+	if ((ctrl->bRequestType & USB_TYPE_MASK) == USB_TYPE_CLASS)
+		rc = class_setup_req(fsg, ctrl);
+	else
+		rc = standard_setup_req(fsg, ctrl);
+
+	/* Respond with data/status or defer until later? */
+	if (rc >= 0 && rc != DELAYED_STATUS) {
+		fsg->ep0req->length = rc;
+		fsg->ep0req_name = (ctrl->bRequestType & USB_DIR_IN ?
+				"ep0-in" : "ep0-out");
+		rc = ep0_queue(fsg);
+	}
+
+	/* Device either stalls (rc < 0) or reports success */
+	return rc;
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+/* All the following routines run in process context */
+
+
+/* Use this for bulk or interrupt transfers, not ep0 */
+static void start_transfer(struct fsg_dev *fsg, struct usb_ep *ep,
+		struct usb_request *req, volatile int *pbusy,
+		volatile enum fsg_buffer_state *state)
+{
+	int	rc;
+
+	if (ep == fsg->bulk_in)
+		dump_msg(fsg, "bulk-in", req->buf, req->length);
+	else if (ep == fsg->intr_in)
+		dump_msg(fsg, "intr-in", req->buf, req->length);
+	*pbusy = 1;
+	*state = BUF_STATE_BUSY;
+	rc = usb_ep_queue(ep, req, GFP_KERNEL);
+	if (rc != 0) {
+		*pbusy = 0;
+		*state = BUF_STATE_EMPTY;
+
+		/* We can't do much more than wait for a reset */
+
+		/* Note: currently the net2280 driver fails zero-length
+		 * submissions if DMA is enabled. */
+		if (rc != -ESHUTDOWN && !(rc == -EOPNOTSUPP &&
+						req->length == 0))
+			WARN(fsg, "error in submission: %s --> %d\n",
+					ep->name, rc);
+	}
+}
+
+
+static int sleep_thread(struct fsg_dev *fsg)
+{
+	int	rc;
+
+	/* Wait until a signal arrives or we are woken up */
+	rc = wait_event_interruptible(fsg->thread_wqh,
+			fsg->thread_wakeup_needed);
+	fsg->thread_wakeup_needed = 0;
+	return (rc ? -EINTR : 0);
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+static int do_read(struct fsg_dev *fsg)
+{
+	struct lun		*curlun = fsg->curlun;
+	u32			lba;
+	struct fsg_buffhd	*bh;
+	int			rc;
+	u32			amount_left;
+	loff_t			file_offset, file_offset_tmp;
+	unsigned int		amount;
+	unsigned int		partial_page;
+	ssize_t			nread;
+
+	/* Get the starting Logical Block Address and check that it's
+	 * not too big */
+	if (fsg->cmnd[0] == SC_READ_6)
+		lba = (fsg->cmnd[1] << 16) | get_be16(&fsg->cmnd[2]);
+	else {
+		lba = get_be32(&fsg->cmnd[2]);
+
+		/* We allow DPO (Disable Page Out = don't save data in the
+		 * cache) and FUA (Force Unit Access = don't read from the
+		 * cache), but we don't implement them. */
+		if ((fsg->cmnd[1] & ~0x18) != 0) {
+			curlun->sense_data = SS_INVALID_FIELD_IN_CDB;
+			return -EINVAL;
+		}
+	}
+	if (lba >= curlun->num_sectors) {
+		curlun->sense_data = SS_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE;
+		return -EINVAL;
+	}
+	file_offset = ((loff_t) lba) << 9;
+
+	/* Carry out the file reads */
+	amount_left = fsg->data_size_from_cmnd;
+	if (unlikely(amount_left == 0))
+		return -EIO;		// No default reply
+
+	for (;;) {
+
+		/* Figure out how much we need to read:
+		 * Try to read the remaining amount.
+		 * But don't read more than the buffer size.
+		 * And don't try to read past the end of the file.
+		 * Finally, if we're not at a page boundary, don't read past
+		 *	the next page.
+		 * If this means reading 0 then we were asked to read past
+		 *	the end of file. */
+		amount = min((unsigned int) amount_left, mod_data.buflen);
+		amount = min((loff_t) amount,
+				curlun->file_length - file_offset);
+		partial_page = file_offset & (PAGE_CACHE_SIZE - 1);
+		if (partial_page > 0)
+			amount = min(amount, (unsigned int) PAGE_CACHE_SIZE -
+					partial_page);
+
+		/* Wait for the next buffer to become available */
+		bh = fsg->next_buffhd_to_fill;
+		while (bh->state != BUF_STATE_EMPTY) {
+			if ((rc = sleep_thread(fsg)) != 0)
+				return rc;
+		}
+
+		/* If we were asked to read past the end of file,
+		 * end with an empty buffer. */
+		if (amount == 0) {
+			curlun->sense_data =
+					SS_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE;
+			curlun->sense_data_info = file_offset >> 9;
+			bh->inreq->length = 0;
+			bh->state = BUF_STATE_FULL;
+			break;
+		}
+
+		/* Perform the read */
+		file_offset_tmp = file_offset;
+		nread = vfs_read(curlun->filp,
+				(char __user *) bh->buf,
+				amount, &file_offset_tmp);
+		VLDBG(curlun, "file read %u @ %llu -> %d\n", amount,
+				(unsigned long long) file_offset,
+				(int) nread);
+		if (signal_pending(current))
+			return -EINTR;
+
+		if (nread < 0) {
+			LDBG(curlun, "error in file read: %d\n",
+					(int) nread);
+			nread = 0;
+		} else if (nread < amount) {
+			LDBG(curlun, "partial file read: %d/%u\n",
+					(int) nread, amount);
+			nread -= (nread & 511);	// Round down to a block
+		}
+		file_offset  += nread;
+		amount_left  -= nread;
+		fsg->residue -= nread;
+		bh->inreq->length = nread;
+		bh->state = BUF_STATE_FULL;
+
+		/* If an error occurred, report it and its position */
+		if (nread < amount) {
+			curlun->sense_data = SS_UNRECOVERED_READ_ERROR;
+			curlun->sense_data_info = file_offset >> 9;
+			break;
+		}
+
+		if (amount_left == 0)
+			break;		// No more left to read
+
+		/* Send this buffer and go read some more */
+		bh->inreq->zero = 0;
+		start_transfer(fsg, fsg->bulk_in, bh->inreq,
+				&bh->inreq_busy, &bh->state);
+		fsg->next_buffhd_to_fill = bh->next;
+	}
+
+	return -EIO;		// No default reply
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+static int do_write(struct fsg_dev *fsg)
+{
+	struct lun		*curlun = fsg->curlun;
+	u32			lba;
+	struct fsg_buffhd	*bh;
+	int			get_some_more;
+	u32			amount_left_to_req, amount_left_to_write;
+	loff_t			usb_offset, file_offset, file_offset_tmp;
+	unsigned int		amount;
+	unsigned int		partial_page;
+	ssize_t			nwritten;
+	int			rc;
+
+	if (curlun->ro) {
+		curlun->sense_data = SS_WRITE_PROTECTED;
+		return -EINVAL;
+	}
+	curlun->filp->f_flags &= ~O_SYNC;	// Default is not to wait
+
+	/* Get the starting Logical Block Address and check that it's
+	 * not too big */
+	if (fsg->cmnd[0] == SC_WRITE_6)
+		lba = (fsg->cmnd[1] << 16) | get_be16(&fsg->cmnd[2]);
+	else {
+		lba = get_be32(&fsg->cmnd[2]);
+
+		/* We allow DPO (Disable Page Out = don't save data in the
+		 * cache) and FUA (Force Unit Access = write directly to the
+		 * medium).  We don't implement DPO; we implement FUA by
+		 * performing synchronous output. */
+		if ((fsg->cmnd[1] & ~0x18) != 0) {
+			curlun->sense_data = SS_INVALID_FIELD_IN_CDB;
+			return -EINVAL;
+		}
+		if (fsg->cmnd[1] & 0x08)	// FUA
+			curlun->filp->f_flags |= O_SYNC;
+	}
+	if (lba >= curlun->num_sectors) {
+		curlun->sense_data = SS_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE;
+		return -EINVAL;
+	}
+
+	/* Carry out the file writes */
+	get_some_more = 1;
+	file_offset = usb_offset = ((loff_t) lba) << 9;
+	amount_left_to_req = amount_left_to_write = fsg->data_size_from_cmnd;
+
+	while (amount_left_to_write > 0) {
+
+		/* Queue a request for more data from the host */
+		bh = fsg->next_buffhd_to_fill;
+		if (bh->state == BUF_STATE_EMPTY && get_some_more) {
+
+			/* Figure out how much we want to get:
+			 * Try to get the remaining amount.
+			 * But don't get more than the buffer size.
+			 * And don't try to go past the end of the file.
+			 * If we're not at a page boundary,
+			 *	don't go past the next page.
+			 * If this means getting 0, then we were asked
+			 *	to write past the end of file.
+			 * Finally, round down to a block boundary. */
+			amount = min(amount_left_to_req, mod_data.buflen);
+			amount = min((loff_t) amount, curlun->file_length -
+					usb_offset);
+			partial_page = usb_offset & (PAGE_CACHE_SIZE - 1);
+			if (partial_page > 0)
+				amount = min(amount,
+	(unsigned int) PAGE_CACHE_SIZE - partial_page);
+
+			if (amount == 0) {
+				get_some_more = 0;
+				curlun->sense_data =
+					SS_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE;
+				curlun->sense_data_info = usb_offset >> 9;
+				continue;
+			}
+			amount -= (amount & 511);
+			if (amount == 0) {
+
+				/* Why were we were asked to transfer a
+				 * partial block? */
+				get_some_more = 0;
+				continue;
+			}
+
+			/* Get the next buffer */
+			usb_offset += amount;
+			fsg->usb_amount_left -= amount;
+			amount_left_to_req -= amount;
+			if (amount_left_to_req == 0)
+				get_some_more = 0;
+
+			/* amount is always divisible by 512, hence by
+			 * the bulk-out maxpacket size */
+			bh->outreq->length = bh->bulk_out_intended_length =
+					amount;
+			start_transfer(fsg, fsg->bulk_out, bh->outreq,
+					&bh->outreq_busy, &bh->state);
+			fsg->next_buffhd_to_fill = bh->next;
+			continue;
+		}
+
+		/* Write the received data to the backing file */
+		bh = fsg->next_buffhd_to_drain;
+		if (bh->state == BUF_STATE_EMPTY && !get_some_more)
+			break;			// We stopped early
+		if (bh->state == BUF_STATE_FULL) {
+			fsg->next_buffhd_to_drain = bh->next;
+			bh->state = BUF_STATE_EMPTY;
+
+			/* Did something go wrong with the transfer? */
+			if (bh->outreq->status != 0) {
+				curlun->sense_data = SS_COMMUNICATION_FAILURE;
+				curlun->sense_data_info = file_offset >> 9;
+				break;
+			}
+
+			amount = bh->outreq->actual;
+			if (curlun->file_length - file_offset < amount) {
+				LERROR(curlun,
+	"write %u @ %llu beyond end %llu\n",
+	amount, (unsigned long long) file_offset,
+	(unsigned long long) curlun->file_length);
+				amount = curlun->file_length - file_offset;
+			}
+
+			/* Perform the write */
+			file_offset_tmp = file_offset;
+			nwritten = vfs_write(curlun->filp,
+					(char __user *) bh->buf,
+					amount, &file_offset_tmp);
+			VLDBG(curlun, "file write %u @ %llu -> %d\n", amount,
+					(unsigned long long) file_offset,
+					(int) nwritten);
+			if (signal_pending(current))
+				return -EINTR;		// Interrupted!
+
+			if (nwritten < 0) {
+				LDBG(curlun, "error in file write: %d\n",
+						(int) nwritten);
+				nwritten = 0;
+			} else if (nwritten < amount) {
+				LDBG(curlun, "partial file write: %d/%u\n",
+						(int) nwritten, amount);
+				nwritten -= (nwritten & 511);
+						// Round down to a block
+			}
+			file_offset += nwritten;
+			amount_left_to_write -= nwritten;
+			fsg->residue -= nwritten;
+
+			/* If an error occurred, report it and its position */
+			if (nwritten < amount) {
+				curlun->sense_data = SS_WRITE_ERROR;
+				curlun->sense_data_info = file_offset >> 9;
+				break;
+			}
+
+			/* Did the host decide to stop early? */
+			if (bh->outreq->actual != bh->outreq->length) {
+				fsg->short_packet_received = 1;
+				break;
+			}
+			continue;
+		}
+
+		/* Wait for something to happen */
+		if ((rc = sleep_thread(fsg)) != 0)
+			return rc;
+	}
+
+	return -EIO;		// No default reply
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+/* Sync the file data, don't bother with the metadata.
+ * This code was copied from fs/buffer.c:sys_fdatasync(). */
+static int fsync_sub(struct lun *curlun)
+{
+	struct file	*filp = curlun->filp;
+	struct inode	*inode;
+	int		rc, err;
+
+	if (curlun->ro || !filp)
+		return 0;
+	if (!filp->f_op->fsync)
+		return -EINVAL;
+
+	inode = filp->f_dentry->d_inode;
+	down(&inode->i_sem);
+	current->flags |= PF_SYNCWRITE;
+	rc = filemap_fdatawrite(inode->i_mapping);
+	err = filp->f_op->fsync(filp, filp->f_dentry, 1);
+	if (!rc)
+		rc = err;
+	err = filemap_fdatawait(inode->i_mapping);
+	if (!rc)
+		rc = err;
+	current->flags &= ~PF_SYNCWRITE;
+	up(&inode->i_sem);
+	VLDBG(curlun, "fdatasync -> %d\n", rc);
+	return rc;
+}
+
+static void fsync_all(struct fsg_dev *fsg)
+{
+	int	i;
+
+	for (i = 0; i < fsg->nluns; ++i)
+		fsync_sub(&fsg->luns[i]);
+}
+
+static int do_synchronize_cache(struct fsg_dev *fsg)
+{
+	struct lun	*curlun = fsg->curlun;
+	int		rc;
+
+	/* We ignore the requested LBA and write out all file's
+	 * dirty data buffers. */
+	rc = fsync_sub(curlun);
+	if (rc)
+		curlun->sense_data = SS_WRITE_ERROR;
+	return 0;
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+static void invalidate_sub(struct lun *curlun)
+{
+	struct file	*filp = curlun->filp;
+	struct inode	*inode = filp->f_dentry->d_inode;
+	unsigned long	rc;
+
+	rc = invalidate_inode_pages(inode->i_mapping);
+	VLDBG(curlun, "invalidate_inode_pages -> %ld\n", rc);
+}
+
+static int do_verify(struct fsg_dev *fsg)
+{
+	struct lun		*curlun = fsg->curlun;
+	u32			lba;
+	u32			verification_length;
+	struct fsg_buffhd	*bh = fsg->next_buffhd_to_fill;
+	loff_t			file_offset, file_offset_tmp;
+	u32			amount_left;
+	unsigned int		amount;
+	ssize_t			nread;
+
+	/* Get the starting Logical Block Address and check that it's
+	 * not too big */
+	lba = get_be32(&fsg->cmnd[2]);
+	if (lba >= curlun->num_sectors) {
+		curlun->sense_data = SS_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE;
+		return -EINVAL;
+	}
+
+	/* We allow DPO (Disable Page Out = don't save data in the
+	 * cache) but we don't implement it. */
+	if ((fsg->cmnd[1] & ~0x10) != 0) {
+		curlun->sense_data = SS_INVALID_FIELD_IN_CDB;
+		return -EINVAL;
+	}
+
+	verification_length = get_be16(&fsg->cmnd[7]);
+	if (unlikely(verification_length == 0))
+		return -EIO;		// No default reply
+
+	/* Prepare to carry out the file verify */
+	amount_left = verification_length << 9;
+	file_offset = ((loff_t) lba) << 9;
+
+	/* Write out all the dirty buffers before invalidating them */
+	fsync_sub(curlun);
+	if (signal_pending(current))
+		return -EINTR;
+
+	invalidate_sub(curlun);
+	if (signal_pending(current))
+		return -EINTR;
+
+	/* Just try to read the requested blocks */
+	while (amount_left > 0) {
+
+		/* Figure out how much we need to read:
+		 * Try to read the remaining amount, but not more than
+		 * the buffer size.
+		 * And don't try to read past the end of the file.
+		 * If this means reading 0 then we were asked to read
+		 * past the end of file. */
+		amount = min((unsigned int) amount_left, mod_data.buflen);
+		amount = min((loff_t) amount,
+				curlun->file_length - file_offset);
+		if (amount == 0) {
+			curlun->sense_data =
+					SS_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE;
+			curlun->sense_data_info = file_offset >> 9;
+			break;
+		}
+
+		/* Perform the read */
+		file_offset_tmp = file_offset;
+		nread = vfs_read(curlun->filp,
+				(char __user *) bh->buf,
+				amount, &file_offset_tmp);
+		VLDBG(curlun, "file read %u @ %llu -> %d\n", amount,
+				(unsigned long long) file_offset,
+				(int) nread);
+		if (signal_pending(current))
+			return -EINTR;
+
+		if (nread < 0) {
+			LDBG(curlun, "error in file verify: %d\n",
+					(int) nread);
+			nread = 0;
+		} else if (nread < amount) {
+			LDBG(curlun, "partial file verify: %d/%u\n",
+					(int) nread, amount);
+			nread -= (nread & 511);	// Round down to a sector
+		}
+		if (nread == 0) {
+			curlun->sense_data = SS_UNRECOVERED_READ_ERROR;
+			curlun->sense_data_info = file_offset >> 9;
+			break;
+		}
+		file_offset += nread;
+		amount_left -= nread;
+	}
+	return 0;
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+static int do_inquiry(struct fsg_dev *fsg, struct fsg_buffhd *bh)
+{
+	u8	*buf = (u8 *) bh->buf;
+
+	static char vendor_id[] = "Linux   ";
+	static char product_id[] = "File-Stor Gadget";
+
+	if (!fsg->curlun) {		// Unsupported LUNs are okay
+		fsg->bad_lun_okay = 1;
+		memset(buf, 0, 36);
+		buf[0] = 0x7f;		// Unsupported, no device-type
+		return 36;
+	}
+
+	memset(buf, 0, 8);	// Non-removable, direct-access device
+	if (mod_data.removable)
+		buf[1] = 0x80;
+	buf[2] = 2;		// ANSI SCSI level 2
+	buf[3] = 2;		// SCSI-2 INQUIRY data format
+	buf[4] = 31;		// Additional length
+				// No special options
+	sprintf(buf + 8, "%-8s%-16s%04x", vendor_id, product_id,
+			DRIVER_VERSION_NUM);
+	return 36;
+}
+
+
+static int do_request_sense(struct fsg_dev *fsg, struct fsg_buffhd *bh)
+{
+	struct lun	*curlun = fsg->curlun;
+	u8		*buf = (u8 *) bh->buf;
+	u32		sd, sdinfo;
+
+	/*
+	 * From the SCSI-2 spec., section 7.9 (Unit attention condition):
+	 *
+	 * If a REQUEST SENSE command is received from an initiator
+	 * with a pending unit attention condition (before the target
+	 * generates the contingent allegiance condition), then the
+	 * target shall either:
+	 *   a) report any pending sense data and preserve the unit
+	 *	attention condition on the logical unit, or,
+	 *   b) report the unit attention condition, may discard any
+	 *	pending sense data, and clear the unit attention
+	 *	condition on the logical unit for that initiator.
+	 *
+	 * FSG normally uses option a); enable this code to use option b).
+	 */
+#if 0
+	if (curlun && curlun->unit_attention_data != SS_NO_SENSE) {
+		curlun->sense_data = curlun->unit_attention_data;
+		curlun->unit_attention_data = SS_NO_SENSE;
+	}
+#endif
+
+	if (!curlun) {		// Unsupported LUNs are okay
+		fsg->bad_lun_okay = 1;
+		sd = SS_LOGICAL_UNIT_NOT_SUPPORTED;
+		sdinfo = 0;
+	} else {
+		sd = curlun->sense_data;
+		sdinfo = curlun->sense_data_info;
+		curlun->sense_data = SS_NO_SENSE;
+		curlun->sense_data_info = 0;
+	}
+
+	memset(buf, 0, 18);
+	buf[0] = 0x80 | 0x70;			// Valid, current error
+	buf[2] = SK(sd);
+	put_be32(&buf[3], sdinfo);		// Sense information
+	buf[7] = 18 - 7;			// Additional sense length
+	buf[12] = ASC(sd);
+	buf[13] = ASCQ(sd);
+	return 18;
+}
+
+
+static int do_read_capacity(struct fsg_dev *fsg, struct fsg_buffhd *bh)
+{
+	struct lun	*curlun = fsg->curlun;
+	u32		lba = get_be32(&fsg->cmnd[2]);
+	int		pmi = fsg->cmnd[8];
+	u8		*buf = (u8 *) bh->buf;
+
+	/* Check the PMI and LBA fields */
+	if (pmi > 1 || (pmi == 0 && lba != 0)) {
+		curlun->sense_data = SS_INVALID_FIELD_IN_CDB;
+		return -EINVAL;
+	}
+
+	put_be32(&buf[0], curlun->num_sectors - 1);	// Max logical block
+	put_be32(&buf[4], 512);				// Block length
+	return 8;
+}
+
+
+static int do_mode_sense(struct fsg_dev *fsg, struct fsg_buffhd *bh)
+{
+	struct lun	*curlun = fsg->curlun;
+	int		mscmnd = fsg->cmnd[0];
+	u8		*buf = (u8 *) bh->buf;
+	u8		*buf0 = buf;
+	int		pc, page_code;
+	int		changeable_values, all_pages;
+	int		valid_page = 0;
+	int		len, limit;
+
+	if ((fsg->cmnd[1] & ~0x08) != 0) {		// Mask away DBD
+		curlun->sense_data = SS_INVALID_FIELD_IN_CDB;
+		return -EINVAL;
+	}
+	pc = fsg->cmnd[2] >> 6;
+	page_code = fsg->cmnd[2] & 0x3f;
+	if (pc == 3) {
+		curlun->sense_data = SS_SAVING_PARAMETERS_NOT_SUPPORTED;
+		return -EINVAL;
+	}
+	changeable_values = (pc == 1);
+	all_pages = (page_code == 0x3f);
+
+	/* Write the mode parameter header.  Fixed values are: default
+	 * medium type, no cache control (DPOFUA), and no block descriptors.
+	 * The only variable value is the WriteProtect bit.  We will fill in
+	 * the mode data length later. */
+	memset(buf, 0, 8);
+	if (mscmnd == SC_MODE_SENSE_6) {
+		buf[2] = (curlun->ro ? 0x80 : 0x00);		// WP, DPOFUA
+		buf += 4;
+		limit = 255;
+	} else {			// SC_MODE_SENSE_10
+		buf[3] = (curlun->ro ? 0x80 : 0x00);		// WP, DPOFUA
+		buf += 8;
+		limit = 65535;		// Should really be mod_data.buflen
+	}
+
+	/* No block descriptors */
+
+	/* The mode pages, in numerical order.  The only page we support
+	 * is the Caching page. */
+	if (page_code == 0x08 || all_pages) {
+		valid_page = 1;
+		buf[0] = 0x08;		// Page code
+		buf[1] = 10;		// Page length
+		memset(buf+2, 0, 10);	// None of the fields are changeable
+
+		if (!changeable_values) {
+			buf[2] = 0x04;	// Write cache enable,
+					// Read cache not disabled
+					// No cache retention priorities
+			put_be16(&buf[4], 0xffff);  // Don't disable prefetch
+					// Minimum prefetch = 0
+			put_be16(&buf[8], 0xffff);  // Maximum prefetch
+			put_be16(&buf[10], 0xffff); // Maximum prefetch ceiling
+		}
+		buf += 12;
+	}
+
+	/* Check that a valid page was requested and the mode data length
+	 * isn't too long. */
+	len = buf - buf0;
+	if (!valid_page || len > limit) {
+		curlun->sense_data = SS_INVALID_FIELD_IN_CDB;
+		return -EINVAL;
+	}
+
+	/*  Store the mode data length */
+	if (mscmnd == SC_MODE_SENSE_6)
+		buf0[0] = len - 1;
+	else
+		put_be16(buf0, len - 2);
+	return len;
+}
+
+
+static int do_start_stop(struct fsg_dev *fsg)
+{
+	struct lun	*curlun = fsg->curlun;
+	int		loej, start;
+
+	if (!mod_data.removable) {
+		curlun->sense_data = SS_INVALID_COMMAND;
+		return -EINVAL;
+	}
+
+	// int immed = fsg->cmnd[1] & 0x01;
+	loej = fsg->cmnd[4] & 0x02;
+	start = fsg->cmnd[4] & 0x01;
+
+#ifdef CONFIG_USB_FILE_STORAGE_TEST
+	if ((fsg->cmnd[1] & ~0x01) != 0 ||		// Mask away Immed
+			(fsg->cmnd[4] & ~0x03) != 0) {	// Mask LoEj, Start
+		curlun->sense_data = SS_INVALID_FIELD_IN_CDB;
+		return -EINVAL;
+	}
+
+	if (!start) {
+
+		/* Are we allowed to unload the media? */
+		if (curlun->prevent_medium_removal) {
+			LDBG(curlun, "unload attempt prevented\n");
+			curlun->sense_data = SS_MEDIUM_REMOVAL_PREVENTED;
+			return -EINVAL;
+		}
+		if (loej) {		// Simulate an unload/eject
+			up_read(&fsg->filesem);
+			down_write(&fsg->filesem);
+			close_backing_file(curlun);
+			up_write(&fsg->filesem);
+			down_read(&fsg->filesem);
+		}
+	} else {
+
+		/* Our emulation doesn't support mounting; the medium is
+		 * available for use as soon as it is loaded. */
+		if (!backing_file_is_open(curlun)) {
+			curlun->sense_data = SS_MEDIUM_NOT_PRESENT;
+			return -EINVAL;
+		}
+	}
+#endif
+	return 0;
+}
+
+
+static int do_prevent_allow(struct fsg_dev *fsg)
+{
+	struct lun	*curlun = fsg->curlun;
+	int		prevent;
+
+	if (!mod_data.removable) {
+		curlun->sense_data = SS_INVALID_COMMAND;
+		return -EINVAL;
+	}
+
+	prevent = fsg->cmnd[4] & 0x01;
+	if ((fsg->cmnd[4] & ~0x01) != 0) {		// Mask away Prevent
+		curlun->sense_data = SS_INVALID_FIELD_IN_CDB;
+		return -EINVAL;
+	}
+
+	if (curlun->prevent_medium_removal && !prevent)
+		fsync_sub(curlun);
+	curlun->prevent_medium_removal = prevent;
+	return 0;
+}
+
+
+static int do_read_format_capacities(struct fsg_dev *fsg,
+			struct fsg_buffhd *bh)
+{
+	struct lun	*curlun = fsg->curlun;
+	u8		*buf = (u8 *) bh->buf;
+
+	buf[0] = buf[1] = buf[2] = 0;
+	buf[3] = 8;		// Only the Current/Maximum Capacity Descriptor
+	buf += 4;
+
+	put_be32(&buf[0], curlun->num_sectors);		// Number of blocks
+	put_be32(&buf[4], 512);				// Block length
+	buf[4] = 0x02;					// Current capacity
+	return 12;
+}
+
+
+static int do_mode_select(struct fsg_dev *fsg, struct fsg_buffhd *bh)
+{
+	struct lun	*curlun = fsg->curlun;
+
+	/* We don't support MODE SELECT */
+	curlun->sense_data = SS_INVALID_COMMAND;
+	return -EINVAL;
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+static int halt_bulk_in_endpoint(struct fsg_dev *fsg)
+{
+	int	rc;
+
+	rc = fsg_set_halt(fsg, fsg->bulk_in);
+	if (rc == -EAGAIN)
+		VDBG(fsg, "delayed bulk-in endpoint halt\n");
+	while (rc != 0) {
+		if (rc != -EAGAIN) {
+			WARN(fsg, "usb_ep_set_halt -> %d\n", rc);
+			rc = 0;
+			break;
+		}
+
+		/* Wait for a short time and then try again */
+		set_current_state(TASK_INTERRUPTIBLE);
+		if (schedule_timeout(HZ / 10) != 0)
+			return -EINTR;
+		rc = usb_ep_set_halt(fsg->bulk_in);
+	}
+	return rc;
+}
+
+static int pad_with_zeros(struct fsg_dev *fsg)
+{
+	struct fsg_buffhd	*bh = fsg->next_buffhd_to_fill;
+	u32			nkeep = bh->inreq->length;
+	u32			nsend;
+	int			rc;
+
+	bh->state = BUF_STATE_EMPTY;		// For the first iteration
+	fsg->usb_amount_left = nkeep + fsg->residue;
+	while (fsg->usb_amount_left > 0) {
+
+		/* Wait for the next buffer to be free */
+		while (bh->state != BUF_STATE_EMPTY) {
+			if ((rc = sleep_thread(fsg)) != 0)
+				return rc;
+		}
+
+		nsend = min(fsg->usb_amount_left, (u32) mod_data.buflen);
+		memset(bh->buf + nkeep, 0, nsend - nkeep);
+		bh->inreq->length = nsend;
+		bh->inreq->zero = 0;
+		start_transfer(fsg, fsg->bulk_in, bh->inreq,
+				&bh->inreq_busy, &bh->state);
+		bh = fsg->next_buffhd_to_fill = bh->next;
+		fsg->usb_amount_left -= nsend;
+		nkeep = 0;
+	}
+	return 0;
+}
+
+static int throw_away_data(struct fsg_dev *fsg)
+{
+	struct fsg_buffhd	*bh;
+	u32			amount;
+	int			rc;
+
+	while ((bh = fsg->next_buffhd_to_drain)->state != BUF_STATE_EMPTY ||
+			fsg->usb_amount_left > 0) {
+
+		/* Throw away the data in a filled buffer */
+		if (bh->state == BUF_STATE_FULL) {
+			bh->state = BUF_STATE_EMPTY;
+			fsg->next_buffhd_to_drain = bh->next;
+
+			/* A short packet or an error ends everything */
+			if (bh->outreq->actual != bh->outreq->length ||
+					bh->outreq->status != 0) {
+				raise_exception(fsg, FSG_STATE_ABORT_BULK_OUT);
+				return -EINTR;
+			}
+			continue;
+		}
+
+		/* Try to submit another request if we need one */
+		bh = fsg->next_buffhd_to_fill;
+		if (bh->state == BUF_STATE_EMPTY && fsg->usb_amount_left > 0) {
+			amount = min(fsg->usb_amount_left,
+					(u32) mod_data.buflen);
+
+			/* amount is always divisible by 512, hence by
+			 * the bulk-out maxpacket size */
+			bh->outreq->length = bh->bulk_out_intended_length =
+					amount;
+			start_transfer(fsg, fsg->bulk_out, bh->outreq,
+					&bh->outreq_busy, &bh->state);
+			fsg->next_buffhd_to_fill = bh->next;
+			fsg->usb_amount_left -= amount;
+			continue;
+		}
+
+		/* Otherwise wait for something to happen */
+		if ((rc = sleep_thread(fsg)) != 0)
+			return rc;
+	}
+	return 0;
+}
+
+
+static int finish_reply(struct fsg_dev *fsg)
+{
+	struct fsg_buffhd	*bh = fsg->next_buffhd_to_fill;
+	int			rc = 0;
+
+	switch (fsg->data_dir) {
+	case DATA_DIR_NONE:
+		break;			// Nothing to send
+
+	/* If we don't know whether the host wants to read or write,
+	 * this must be CB or CBI with an unknown command.  We mustn't
+	 * try to send or receive any data.  So stall both bulk pipes
+	 * if we can and wait for a reset. */
+	case DATA_DIR_UNKNOWN:
+		if (mod_data.can_stall) {
+			fsg_set_halt(fsg, fsg->bulk_out);
+			rc = halt_bulk_in_endpoint(fsg);
+		}
+		break;
+
+	/* All but the last buffer of data must have already been sent */
+	case DATA_DIR_TO_HOST:
+		if (fsg->data_size == 0)
+			;		// Nothing to send
+
+		/* If there's no residue, simply send the last buffer */
+		else if (fsg->residue == 0) {
+			bh->inreq->zero = 0;
+			start_transfer(fsg, fsg->bulk_in, bh->inreq,
+					&bh->inreq_busy, &bh->state);
+			fsg->next_buffhd_to_fill = bh->next;
+		}
+
+		/* There is a residue.  For CB and CBI, simply mark the end
+		 * of the data with a short packet.  However, if we are
+		 * allowed to stall, there was no data at all (residue ==
+		 * data_size), and the command failed (invalid LUN or
+		 * sense data is set), then halt the bulk-in endpoint
+		 * instead. */
+		else if (!transport_is_bbb()) {
+			if (mod_data.can_stall &&
+					fsg->residue == fsg->data_size &&
+	(!fsg->curlun || fsg->curlun->sense_data != SS_NO_SENSE)) {
+				bh->state = BUF_STATE_EMPTY;
+				rc = halt_bulk_in_endpoint(fsg);
+			} else {
+				bh->inreq->zero = 1;
+				start_transfer(fsg, fsg->bulk_in, bh->inreq,
+						&bh->inreq_busy, &bh->state);
+				fsg->next_buffhd_to_fill = bh->next;
+			}
+		}
+
+		/* For Bulk-only, if we're allowed to stall then send the
+		 * short packet and halt the bulk-in endpoint.  If we can't
+		 * stall, pad out the remaining data with 0's. */
+		else {
+			if (mod_data.can_stall) {
+				bh->inreq->zero = 1;
+				start_transfer(fsg, fsg->bulk_in, bh->inreq,
+						&bh->inreq_busy, &bh->state);
+				fsg->next_buffhd_to_fill = bh->next;
+				rc = halt_bulk_in_endpoint(fsg);
+			} else
+				rc = pad_with_zeros(fsg);
+		}
+		break;
+
+	/* We have processed all we want from the data the host has sent.
+	 * There may still be outstanding bulk-out requests. */
+	case DATA_DIR_FROM_HOST:
+		if (fsg->residue == 0)
+			;		// Nothing to receive
+
+		/* Did the host stop sending unexpectedly early? */
+		else if (fsg->short_packet_received) {
+			raise_exception(fsg, FSG_STATE_ABORT_BULK_OUT);
+			rc = -EINTR;
+		}
+
+		/* We haven't processed all the incoming data.  If we are
+		 * allowed to stall, halt the bulk-out endpoint and cancel
+		 * any outstanding requests. */
+		else if (mod_data.can_stall) {
+			fsg_set_halt(fsg, fsg->bulk_out);
+			raise_exception(fsg, FSG_STATE_ABORT_BULK_OUT);
+			rc = -EINTR;
+		}
+
+		/* We can't stall.  Read in the excess data and throw it
+		 * all away. */
+		else
+			rc = throw_away_data(fsg);
+		break;
+	}
+	return rc;
+}
+
+
+static int send_status(struct fsg_dev *fsg)
+{
+	struct lun		*curlun = fsg->curlun;
+	struct fsg_buffhd	*bh;
+	int			rc;
+	u8			status = USB_STATUS_PASS;
+	u32			sd, sdinfo = 0;
+
+	/* Wait for the next buffer to become available */
+	bh = fsg->next_buffhd_to_fill;
+	while (bh->state != BUF_STATE_EMPTY) {
+		if ((rc = sleep_thread(fsg)) != 0)
+			return rc;
+	}
+
+	if (curlun) {
+		sd = curlun->sense_data;
+		sdinfo = curlun->sense_data_info;
+	} else if (fsg->bad_lun_okay)
+		sd = SS_NO_SENSE;
+	else
+		sd = SS_LOGICAL_UNIT_NOT_SUPPORTED;
+
+	if (fsg->phase_error) {
+		DBG(fsg, "sending phase-error status\n");
+		status = USB_STATUS_PHASE_ERROR;
+		sd = SS_INVALID_COMMAND;
+	} else if (sd != SS_NO_SENSE) {
+		DBG(fsg, "sending command-failure status\n");
+		status = USB_STATUS_FAIL;
+		VDBG(fsg, "  sense data: SK x%02x, ASC x%02x, ASCQ x%02x;"
+				"  info x%x\n",
+				SK(sd), ASC(sd), ASCQ(sd), sdinfo);
+	}
+
+	if (transport_is_bbb()) {
+		struct bulk_cs_wrap	*csw = (struct bulk_cs_wrap *) bh->buf;
+
+		/* Store and send the Bulk-only CSW */
+		csw->Signature = __constant_cpu_to_le32(USB_BULK_CS_SIG);
+		csw->Tag = fsg->tag;
+		csw->Residue = fsg->residue;
+		csw->Status = status;
+
+		bh->inreq->length = USB_BULK_CS_WRAP_LEN;
+		bh->inreq->zero = 0;
+		start_transfer(fsg, fsg->bulk_in, bh->inreq,
+				&bh->inreq_busy, &bh->state);
+
+	} else if (mod_data.transport_type == USB_PR_CB) {
+
+		/* Control-Bulk transport has no status stage! */
+		return 0;
+
+	} else {			// USB_PR_CBI
+		struct interrupt_data	*buf = (struct interrupt_data *)
+						bh->buf;
+
+		/* Store and send the Interrupt data.  UFI sends the ASC
+		 * and ASCQ bytes.  Everything else sends a Type (which
+		 * is always 0) and the status Value. */
+		if (mod_data.protocol_type == USB_SC_UFI) {
+			buf->bType = ASC(sd);
+			buf->bValue = ASCQ(sd);
+		} else {
+			buf->bType = 0;
+			buf->bValue = status;
+		}
+		fsg->intreq->length = CBI_INTERRUPT_DATA_LEN;
+
+		fsg->intr_buffhd = bh;		// Point to the right buffhd
+		fsg->intreq->buf = bh->inreq->buf;
+		fsg->intreq->dma = bh->inreq->dma;
+		fsg->intreq->context = bh;
+		start_transfer(fsg, fsg->intr_in, fsg->intreq,
+				&fsg->intreq_busy, &bh->state);
+	}
+
+	fsg->next_buffhd_to_fill = bh->next;
+	return 0;
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+/* Check whether the command is properly formed and whether its data size
+ * and direction agree with the values we already have. */
+static int check_command(struct fsg_dev *fsg, int cmnd_size,
+		enum data_direction data_dir, unsigned int mask,
+		int needs_medium, const char *name)
+{
+	int			i;
+	int			lun = fsg->cmnd[1] >> 5;
+	static const char	dirletter[4] = {'u', 'o', 'i', 'n'};
+	char			hdlen[20];
+	struct lun		*curlun;
+
+	/* Adjust the expected cmnd_size for protocol encapsulation padding.
+	 * Transparent SCSI doesn't pad. */
+	if (protocol_is_scsi())
+		;
+
+	/* There's some disagreement as to whether RBC pads commands or not.
+	 * We'll play it safe and accept either form. */
+	else if (mod_data.protocol_type == USB_SC_RBC) {
+		if (fsg->cmnd_size == 12)
+			cmnd_size = 12;
+
+	/* All the other protocols pad to 12 bytes */
+	} else
+		cmnd_size = 12;
+
+	hdlen[0] = 0;
+	if (fsg->data_dir != DATA_DIR_UNKNOWN)
+		sprintf(hdlen, ", H%c=%u", dirletter[(int) fsg->data_dir],
+				fsg->data_size);
+	VDBG(fsg, "SCSI command: %s;  Dc=%d, D%c=%u;  Hc=%d%s\n",
+			name, cmnd_size, dirletter[(int) data_dir],
+			fsg->data_size_from_cmnd, fsg->cmnd_size, hdlen);
+
+	/* We can't reply at all until we know the correct data direction
+	 * and size. */
+	if (fsg->data_size_from_cmnd == 0)
+		data_dir = DATA_DIR_NONE;
+	if (fsg->data_dir == DATA_DIR_UNKNOWN) {	// CB or CBI
+		fsg->data_dir = data_dir;
+		fsg->data_size = fsg->data_size_from_cmnd;
+
+	} else {					// Bulk-only
+		if (fsg->data_size < fsg->data_size_from_cmnd) {
+
+			/* Host data size < Device data size is a phase error.
+			 * Carry out the command, but only transfer as much
+			 * as we are allowed. */
+			fsg->data_size_from_cmnd = fsg->data_size;
+			fsg->phase_error = 1;
+		}
+	}
+	fsg->residue = fsg->usb_amount_left = fsg->data_size;
+
+	/* Conflicting data directions is a phase error */
+	if (fsg->data_dir != data_dir && fsg->data_size_from_cmnd > 0)
+		goto phase_error;
+
+	/* Verify the length of the command itself */
+	if (cmnd_size != fsg->cmnd_size) {
+
+		/* Special case workaround: MS-Windows issues REQUEST SENSE
+		 * with cbw->Length == 12 (it should be 6). */
+		if (fsg->cmnd[0] == SC_REQUEST_SENSE && fsg->cmnd_size == 12)
+			cmnd_size = fsg->cmnd_size;
+		else
+			goto phase_error;
+	}
+
+	/* Check that the LUN values are oonsistent */
+	if (transport_is_bbb()) {
+		if (fsg->lun != lun)
+			DBG(fsg, "using LUN %d from CBW, "
+					"not LUN %d from CDB\n",
+					fsg->lun, lun);
+	} else
+		fsg->lun = lun;		// Use LUN from the command
+
+	/* Check the LUN */
+	if (fsg->lun >= 0 && fsg->lun < fsg->nluns) {
+		fsg->curlun = curlun = &fsg->luns[fsg->lun];
+		if (fsg->cmnd[0] != SC_REQUEST_SENSE) {
+			curlun->sense_data = SS_NO_SENSE;
+			curlun->sense_data_info = 0;
+		}
+	} else {
+		fsg->curlun = curlun = NULL;
+		fsg->bad_lun_okay = 0;
+
+		/* INQUIRY and REQUEST SENSE commands are explicitly allowed
+		 * to use unsupported LUNs; all others may not. */
+		if (fsg->cmnd[0] != SC_INQUIRY &&
+				fsg->cmnd[0] != SC_REQUEST_SENSE) {
+			DBG(fsg, "unsupported LUN %d\n", fsg->lun);
+			return -EINVAL;
+		}
+	}
+
+	/* If a unit attention condition exists, only INQUIRY and
+	 * REQUEST SENSE commands are allowed; anything else must fail. */
+	if (curlun && curlun->unit_attention_data != SS_NO_SENSE &&
+			fsg->cmnd[0] != SC_INQUIRY &&
+			fsg->cmnd[0] != SC_REQUEST_SENSE) {
+		curlun->sense_data = curlun->unit_attention_data;
+		curlun->unit_attention_data = SS_NO_SENSE;
+		return -EINVAL;
+	}
+
+	/* Check that only command bytes listed in the mask are non-zero */
+	fsg->cmnd[1] &= 0x1f;			// Mask away the LUN
+	for (i = 1; i < cmnd_size; ++i) {
+		if (fsg->cmnd[i] && !(mask & (1 << i))) {
+			if (curlun)
+				curlun->sense_data = SS_INVALID_FIELD_IN_CDB;
+			return -EINVAL;
+		}
+	}
+
+	/* If the medium isn't mounted and the command needs to access
+	 * it, return an error. */
+	if (curlun && !backing_file_is_open(curlun) && needs_medium) {
+		curlun->sense_data = SS_MEDIUM_NOT_PRESENT;
+		return -EINVAL;
+	}
+
+	return 0;
+
+phase_error:
+	fsg->phase_error = 1;
+	return -EINVAL;
+}
+
+
+static int do_scsi_command(struct fsg_dev *fsg)
+{
+	struct fsg_buffhd	*bh;
+	int			rc;
+	int			reply = -EINVAL;
+	int			i;
+	static char		unknown[16];
+
+	dump_cdb(fsg);
+
+	/* Wait for the next buffer to become available for data or status */
+	bh = fsg->next_buffhd_to_drain = fsg->next_buffhd_to_fill;
+	while (bh->state != BUF_STATE_EMPTY) {
+		if ((rc = sleep_thread(fsg)) != 0)
+			return rc;
+		}
+	fsg->phase_error = 0;
+	fsg->short_packet_received = 0;
+
+	down_read(&fsg->filesem);	// We're using the backing file
+	switch (fsg->cmnd[0]) {
+
+	case SC_INQUIRY:
+		fsg->data_size_from_cmnd = fsg->cmnd[4];
+		if ((reply = check_command(fsg, 6, DATA_DIR_TO_HOST,
+				(1<<4), 0,
+				"INQUIRY")) == 0)
+			reply = do_inquiry(fsg, bh);
+		break;
+
+	case SC_MODE_SELECT_6:
+		fsg->data_size_from_cmnd = fsg->cmnd[4];
+		if ((reply = check_command(fsg, 6, DATA_DIR_FROM_HOST,
+				(1<<1) | (1<<4), 0,
+				"MODE SELECT(6)")) == 0)
+			reply = do_mode_select(fsg, bh);
+		break;
+
+	case SC_MODE_SELECT_10:
+		fsg->data_size_from_cmnd = get_be16(&fsg->cmnd[7]);
+		if ((reply = check_command(fsg, 10, DATA_DIR_FROM_HOST,
+				(1<<1) | (3<<7), 0,
+				"MODE SELECT(10)")) == 0)
+			reply = do_mode_select(fsg, bh);
+		break;
+
+	case SC_MODE_SENSE_6:
+		fsg->data_size_from_cmnd = fsg->cmnd[4];
+		if ((reply = check_command(fsg, 6, DATA_DIR_TO_HOST,
+				(1<<1) | (1<<2) | (1<<4), 0,
+				"MODE SENSE(6)")) == 0)
+			reply = do_mode_sense(fsg, bh);
+		break;
+
+	case SC_MODE_SENSE_10:
+		fsg->data_size_from_cmnd = get_be16(&fsg->cmnd[7]);
+		if ((reply = check_command(fsg, 10, DATA_DIR_TO_HOST,
+				(1<<1) | (1<<2) | (3<<7), 0,
+				"MODE SENSE(10)")) == 0)
+			reply = do_mode_sense(fsg, bh);
+		break;
+
+	case SC_PREVENT_ALLOW_MEDIUM_REMOVAL:
+		fsg->data_size_from_cmnd = 0;
+		if ((reply = check_command(fsg, 6, DATA_DIR_NONE,
+				(1<<4), 0,
+				"PREVENT-ALLOW MEDIUM REMOVAL")) == 0)
+			reply = do_prevent_allow(fsg);
+		break;
+
+	case SC_READ_6:
+		i = fsg->cmnd[4];
+		fsg->data_size_from_cmnd = (i == 0 ? 256 : i) << 9;
+		if ((reply = check_command(fsg, 6, DATA_DIR_TO_HOST,
+				(7<<1) | (1<<4), 1,
+				"READ(6)")) == 0)
+			reply = do_read(fsg);
+		break;
+
+	case SC_READ_10:
+		fsg->data_size_from_cmnd = get_be16(&fsg->cmnd[7]) << 9;
+		if ((reply = check_command(fsg, 10, DATA_DIR_TO_HOST,
+				(1<<1) | (0xf<<2) | (3<<7), 1,
+				"READ(10)")) == 0)
+			reply = do_read(fsg);
+		break;
+
+	case SC_READ_12:
+		fsg->data_size_from_cmnd = get_be32(&fsg->cmnd[6]) << 9;
+		if ((reply = check_command(fsg, 12, DATA_DIR_TO_HOST,
+				(1<<1) | (0xf<<2) | (0xf<<6), 1,
+				"READ(12)")) == 0)
+			reply = do_read(fsg);
+		break;
+
+	case SC_READ_CAPACITY:
+		fsg->data_size_from_cmnd = 8;
+		if ((reply = check_command(fsg, 10, DATA_DIR_TO_HOST,
+				(0xf<<2) | (1<<8), 1,
+				"READ CAPACITY")) == 0)
+			reply = do_read_capacity(fsg, bh);
+		break;
+
+	case SC_READ_FORMAT_CAPACITIES:
+		fsg->data_size_from_cmnd = get_be16(&fsg->cmnd[7]);
+		if ((reply = check_command(fsg, 10, DATA_DIR_TO_HOST,
+				(3<<7), 1,
+				"READ FORMAT CAPACITIES")) == 0)
+			reply = do_read_format_capacities(fsg, bh);
+		break;
+
+	case SC_REQUEST_SENSE:
+		fsg->data_size_from_cmnd = fsg->cmnd[4];
+		if ((reply = check_command(fsg, 6, DATA_DIR_TO_HOST,
+				(1<<4), 0,
+				"REQUEST SENSE")) == 0)
+			reply = do_request_sense(fsg, bh);
+		break;
+
+	case SC_START_STOP_UNIT:
+		fsg->data_size_from_cmnd = 0;
+		if ((reply = check_command(fsg, 6, DATA_DIR_NONE,
+				(1<<1) | (1<<4), 0,
+				"START-STOP UNIT")) == 0)
+			reply = do_start_stop(fsg);
+		break;
+
+	case SC_SYNCHRONIZE_CACHE:
+		fsg->data_size_from_cmnd = 0;
+		if ((reply = check_command(fsg, 10, DATA_DIR_NONE,
+				(0xf<<2) | (3<<7), 1,
+				"SYNCHRONIZE CACHE")) == 0)
+			reply = do_synchronize_cache(fsg);
+		break;
+
+	case SC_TEST_UNIT_READY:
+		fsg->data_size_from_cmnd = 0;
+		reply = check_command(fsg, 6, DATA_DIR_NONE,
+				0, 1,
+				"TEST UNIT READY");
+		break;
+
+	/* Although optional, this command is used by MS-Windows.  We
+	 * support a minimal version: BytChk must be 0. */
+	case SC_VERIFY:
+		fsg->data_size_from_cmnd = 0;
+		if ((reply = check_command(fsg, 10, DATA_DIR_NONE,
+				(1<<1) | (0xf<<2) | (3<<7), 1,
+				"VERIFY")) == 0)
+			reply = do_verify(fsg);
+		break;
+
+	case SC_WRITE_6:
+		i = fsg->cmnd[4];
+		fsg->data_size_from_cmnd = (i == 0 ? 256 : i) << 9;
+		if ((reply = check_command(fsg, 6, DATA_DIR_FROM_HOST,
+				(7<<1) | (1<<4), 1,
+				"WRITE(6)")) == 0)
+			reply = do_write(fsg);
+		break;
+
+	case SC_WRITE_10:
+		fsg->data_size_from_cmnd = get_be16(&fsg->cmnd[7]) << 9;
+		if ((reply = check_command(fsg, 10, DATA_DIR_FROM_HOST,
+				(1<<1) | (0xf<<2) | (3<<7), 1,
+				"WRITE(10)")) == 0)
+			reply = do_write(fsg);
+		break;
+
+	case SC_WRITE_12:
+		fsg->data_size_from_cmnd = get_be32(&fsg->cmnd[6]) << 9;
+		if ((reply = check_command(fsg, 12, DATA_DIR_FROM_HOST,
+				(1<<1) | (0xf<<2) | (0xf<<6), 1,
+				"WRITE(12)")) == 0)
+			reply = do_write(fsg);
+		break;
+
+	/* Some mandatory commands that we recognize but don't implement.
+	 * They don't mean much in this setting.  It's left as an exercise
+	 * for anyone interested to implement RESERVE and RELEASE in terms
+	 * of Posix locks. */
+	case SC_FORMAT_UNIT:
+	case SC_RELEASE:
+	case SC_RESERVE:
+	case SC_SEND_DIAGNOSTIC:
+		// Fall through
+
+	default:
+		fsg->data_size_from_cmnd = 0;
+		sprintf(unknown, "Unknown x%02x", fsg->cmnd[0]);
+		if ((reply = check_command(fsg, fsg->cmnd_size,
+				DATA_DIR_UNKNOWN, 0xff, 0, unknown)) == 0) {
+			fsg->curlun->sense_data = SS_INVALID_COMMAND;
+			reply = -EINVAL;
+		}
+		break;
+	}
+	up_read(&fsg->filesem);
+
+	if (reply == -EINTR || signal_pending(current))
+		return -EINTR;
+
+	/* Set up the single reply buffer for finish_reply() */
+	if (reply == -EINVAL)
+		reply = 0;		// Error reply length
+	if (reply >= 0 && fsg->data_dir == DATA_DIR_TO_HOST) {
+		reply = min((u32) reply, fsg->data_size_from_cmnd);
+		bh->inreq->length = reply;
+		bh->state = BUF_STATE_FULL;
+		fsg->residue -= reply;
+	}				// Otherwise it's already set
+
+	return 0;
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh)
+{
+	struct usb_request	*req = bh->outreq;
+	struct bulk_cb_wrap	*cbw = (struct bulk_cb_wrap *) req->buf;
+
+	/* Was this a real packet? */
+	if (req->status)
+		return -EINVAL;
+
+	/* Is the CBW valid? */
+	if (req->actual != USB_BULK_CB_WRAP_LEN ||
+			cbw->Signature != __constant_cpu_to_le32(
+				USB_BULK_CB_SIG)) {
+		DBG(fsg, "invalid CBW: len %u sig 0x%x\n",
+				req->actual,
+				le32_to_cpu(cbw->Signature));
+
+		/* The Bulk-only spec says we MUST stall the bulk pipes!
+		 * If we want to avoid stalls, set a flag so that we will
+		 * clear the endpoint halts at the next reset. */
+		if (!mod_data.can_stall)
+			set_bit(CLEAR_BULK_HALTS, &fsg->atomic_bitflags);
+		fsg_set_halt(fsg, fsg->bulk_out);
+		halt_bulk_in_endpoint(fsg);
+		return -EINVAL;
+	}
+
+	/* Is the CBW meaningful? */
+	if (cbw->Lun >= MAX_LUNS || cbw->Flags & ~USB_BULK_IN_FLAG ||
+			cbw->Length < 6 || cbw->Length > MAX_COMMAND_SIZE) {
+		DBG(fsg, "non-meaningful CBW: lun = %u, flags = 0x%x, "
+				"cmdlen %u\n",
+				cbw->Lun, cbw->Flags, cbw->Length);
+
+		/* We can do anything we want here, so let's stall the
+		 * bulk pipes if we are allowed to. */
+		if (mod_data.can_stall) {
+			fsg_set_halt(fsg, fsg->bulk_out);
+			halt_bulk_in_endpoint(fsg);
+		}
+		return -EINVAL;
+	}
+
+	/* Save the command for later */
+	fsg->cmnd_size = cbw->Length;
+	memcpy(fsg->cmnd, cbw->CDB, fsg->cmnd_size);
+	if (cbw->Flags & USB_BULK_IN_FLAG)
+		fsg->data_dir = DATA_DIR_TO_HOST;
+	else
+		fsg->data_dir = DATA_DIR_FROM_HOST;
+	fsg->data_size = cbw->DataTransferLength;
+	if (fsg->data_size == 0)
+		fsg->data_dir = DATA_DIR_NONE;
+	fsg->lun = cbw->Lun;
+	fsg->tag = cbw->Tag;
+	return 0;
+}
+
+
+static int get_next_command(struct fsg_dev *fsg)
+{
+	struct fsg_buffhd	*bh;
+	int			rc = 0;
+
+	if (transport_is_bbb()) {
+
+		/* Wait for the next buffer to become available */
+		bh = fsg->next_buffhd_to_fill;
+		while (bh->state != BUF_STATE_EMPTY) {
+			if ((rc = sleep_thread(fsg)) != 0)
+				return rc;
+			}
+
+		/* Queue a request to read a Bulk-only CBW */
+		set_bulk_out_req_length(fsg, bh, USB_BULK_CB_WRAP_LEN);
+		start_transfer(fsg, fsg->bulk_out, bh->outreq,
+				&bh->outreq_busy, &bh->state);
+
+		/* We will drain the buffer in software, which means we
+		 * can reuse it for the next filling.  No need to advance
+		 * next_buffhd_to_fill. */
+
+		/* Wait for the CBW to arrive */
+		while (bh->state != BUF_STATE_FULL) {
+			if ((rc = sleep_thread(fsg)) != 0)
+				return rc;
+			}
+		rc = received_cbw(fsg, bh);
+		bh->state = BUF_STATE_EMPTY;
+
+	} else {		// USB_PR_CB or USB_PR_CBI
+
+		/* Wait for the next command to arrive */
+		while (fsg->cbbuf_cmnd_size == 0) {
+			if ((rc = sleep_thread(fsg)) != 0)
+				return rc;
+			}
+
+		/* Is the previous status interrupt request still busy?
+		 * The host is allowed to skip reading the status,
+		 * so we must cancel it. */
+		if (fsg->intreq_busy)
+			usb_ep_dequeue(fsg->intr_in, fsg->intreq);
+
+		/* Copy the command and mark the buffer empty */
+		fsg->data_dir = DATA_DIR_UNKNOWN;
+		spin_lock_irq(&fsg->lock);
+		fsg->cmnd_size = fsg->cbbuf_cmnd_size;
+		memcpy(fsg->cmnd, fsg->cbbuf_cmnd, fsg->cmnd_size);
+		fsg->cbbuf_cmnd_size = 0;
+		spin_unlock_irq(&fsg->lock);
+	}
+	return rc;
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+static int enable_endpoint(struct fsg_dev *fsg, struct usb_ep *ep,
+		const struct usb_endpoint_descriptor *d)
+{
+	int	rc;
+
+	ep->driver_data = fsg;
+	rc = usb_ep_enable(ep, d);
+	if (rc)
+		ERROR(fsg, "can't enable %s, result %d\n", ep->name, rc);
+	return rc;
+}
+
+static int alloc_request(struct fsg_dev *fsg, struct usb_ep *ep,
+		struct usb_request **preq)
+{
+	*preq = usb_ep_alloc_request(ep, GFP_ATOMIC);
+	if (*preq)
+		return 0;
+	ERROR(fsg, "can't allocate request for %s\n", ep->name);
+	return -ENOMEM;
+}
+
+/*
+ * Reset interface setting and re-init endpoint state (toggle etc).
+ * Call with altsetting < 0 to disable the interface.  The only other
+ * available altsetting is 0, which enables the interface.
+ */
+static int do_set_interface(struct fsg_dev *fsg, int altsetting)
+{
+	int	rc = 0;
+	int	i;
+	const struct usb_endpoint_descriptor	*d;
+
+	if (fsg->running)
+		DBG(fsg, "reset interface\n");
+
+reset:
+	/* Deallocate the requests */
+	for (i = 0; i < NUM_BUFFERS; ++i) {
+		struct fsg_buffhd *bh = &fsg->buffhds[i];
+
+		if (bh->inreq) {
+			usb_ep_free_request(fsg->bulk_in, bh->inreq);
+			bh->inreq = NULL;
+		}
+		if (bh->outreq) {
+			usb_ep_free_request(fsg->bulk_out, bh->outreq);
+			bh->outreq = NULL;
+		}
+	}
+	if (fsg->intreq) {
+		usb_ep_free_request(fsg->intr_in, fsg->intreq);
+		fsg->intreq = NULL;
+	}
+
+	/* Disable the endpoints */
+	if (fsg->bulk_in_enabled) {
+		usb_ep_disable(fsg->bulk_in);
+		fsg->bulk_in_enabled = 0;
+	}
+	if (fsg->bulk_out_enabled) {
+		usb_ep_disable(fsg->bulk_out);
+		fsg->bulk_out_enabled = 0;
+	}
+	if (fsg->intr_in_enabled) {
+		usb_ep_disable(fsg->intr_in);
+		fsg->intr_in_enabled = 0;
+	}
+
+	fsg->running = 0;
+	if (altsetting < 0 || rc != 0)
+		return rc;
+
+	DBG(fsg, "set interface %d\n", altsetting);
+
+	/* Enable the endpoints */
+	d = ep_desc(fsg->gadget, &fs_bulk_in_desc, &hs_bulk_in_desc);
+	if ((rc = enable_endpoint(fsg, fsg->bulk_in, d)) != 0)
+		goto reset;
+	fsg->bulk_in_enabled = 1;
+
+	d = ep_desc(fsg->gadget, &fs_bulk_out_desc, &hs_bulk_out_desc);
+	if ((rc = enable_endpoint(fsg, fsg->bulk_out, d)) != 0)
+		goto reset;
+	fsg->bulk_out_enabled = 1;
+
+	if (transport_is_cbi()) {
+		d = ep_desc(fsg->gadget, &fs_intr_in_desc, &hs_intr_in_desc);
+		if ((rc = enable_endpoint(fsg, fsg->intr_in, d)) != 0)
+			goto reset;
+		fsg->intr_in_enabled = 1;
+	}
+
+	/* Allocate the requests */
+	for (i = 0; i < NUM_BUFFERS; ++i) {
+		struct fsg_buffhd	*bh = &fsg->buffhds[i];
+
+		if ((rc = alloc_request(fsg, fsg->bulk_in, &bh->inreq)) != 0)
+			goto reset;
+		if ((rc = alloc_request(fsg, fsg->bulk_out, &bh->outreq)) != 0)
+			goto reset;
+		bh->inreq->buf = bh->outreq->buf = bh->buf;
+		bh->inreq->dma = bh->outreq->dma = bh->dma;
+		bh->inreq->context = bh->outreq->context = bh;
+		bh->inreq->complete = bulk_in_complete;
+		bh->outreq->complete = bulk_out_complete;
+	}
+	if (transport_is_cbi()) {
+		if ((rc = alloc_request(fsg, fsg->intr_in, &fsg->intreq)) != 0)
+			goto reset;
+		fsg->intreq->complete = intr_in_complete;
+	}
+
+	fsg->running = 1;
+	for (i = 0; i < fsg->nluns; ++i)
+		fsg->luns[i].unit_attention_data = SS_RESET_OCCURRED;
+	return rc;
+}
+
+
+/*
+ * Change our operational configuration.  This code must agree with the code
+ * that returns config descriptors, and with interface altsetting code.
+ *
+ * It's also responsible for power management interactions.  Some
+ * configurations might not work with our current power sources.
+ * For now we just assume the gadget is always self-powered.
+ */
+static int do_set_config(struct fsg_dev *fsg, u8 new_config)
+{
+	int	rc = 0;
+
+	/* Disable the single interface */
+	if (fsg->config != 0) {
+		DBG(fsg, "reset config\n");
+		fsg->config = 0;
+		rc = do_set_interface(fsg, -1);
+	}
+
+	/* Enable the interface */
+	if (new_config != 0) {
+		fsg->config = new_config;
+		if ((rc = do_set_interface(fsg, 0)) != 0)
+			fsg->config = 0;	// Reset on errors
+		else {
+			char *speed;
+
+			switch (fsg->gadget->speed) {
+			case USB_SPEED_LOW:	speed = "low";	break;
+			case USB_SPEED_FULL:	speed = "full";	break;
+			case USB_SPEED_HIGH:	speed = "high";	break;
+			default: 		speed = "?";	break;
+			}
+			INFO(fsg, "%s speed config #%d\n", speed, fsg->config);
+		}
+	}
+	return rc;
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+static void handle_exception(struct fsg_dev *fsg)
+{
+	siginfo_t		info;
+	int			sig;
+	int			i;
+	int			num_active;
+	struct fsg_buffhd	*bh;
+	enum fsg_state		old_state;
+	u8			new_config;
+	struct lun		*curlun;
+	unsigned int		exception_req_tag;
+	int			rc;
+
+	/* Clear the existing signals.  Anything but SIGUSR1 is converted
+	 * into a high-priority EXIT exception. */
+	for (;;) {
+		sig = dequeue_signal_lock(current, &fsg->thread_signal_mask,
+				&info);
+		if (!sig)
+			break;
+		if (sig != SIGUSR1) {
+			if (fsg->state < FSG_STATE_EXIT)
+				DBG(fsg, "Main thread exiting on signal\n");
+			raise_exception(fsg, FSG_STATE_EXIT);
+		}
+	}
+
+	/* Cancel all the pending transfers */
+	if (fsg->intreq_busy)
+		usb_ep_dequeue(fsg->intr_in, fsg->intreq);
+	for (i = 0; i < NUM_BUFFERS; ++i) {
+		bh = &fsg->buffhds[i];
+		if (bh->inreq_busy)
+			usb_ep_dequeue(fsg->bulk_in, bh->inreq);
+		if (bh->outreq_busy)
+			usb_ep_dequeue(fsg->bulk_out, bh->outreq);
+	}
+
+	/* Wait until everything is idle */
+	for (;;) {
+		num_active = fsg->intreq_busy;
+		for (i = 0; i < NUM_BUFFERS; ++i) {
+			bh = &fsg->buffhds[i];
+			num_active += bh->inreq_busy + bh->outreq_busy;
+		}
+		if (num_active == 0)
+			break;
+		if (sleep_thread(fsg))
+			return;
+	}
+
+	/* Clear out the controller's fifos */
+	if (fsg->bulk_in_enabled)
+		usb_ep_fifo_flush(fsg->bulk_in);
+	if (fsg->bulk_out_enabled)
+		usb_ep_fifo_flush(fsg->bulk_out);
+	if (fsg->intr_in_enabled)
+		usb_ep_fifo_flush(fsg->intr_in);
+
+	/* Reset the I/O buffer states and pointers, the SCSI
+	 * state, and the exception.  Then invoke the handler. */
+	spin_lock_irq(&fsg->lock);
+
+	for (i = 0; i < NUM_BUFFERS; ++i) {
+		bh = &fsg->buffhds[i];
+		bh->state = BUF_STATE_EMPTY;
+	}
+	fsg->next_buffhd_to_fill = fsg->next_buffhd_to_drain =
+			&fsg->buffhds[0];
+
+	exception_req_tag = fsg->exception_req_tag;
+	new_config = fsg->new_config;
+	old_state = fsg->state;
+
+	if (old_state == FSG_STATE_ABORT_BULK_OUT)
+		fsg->state = FSG_STATE_STATUS_PHASE;
+	else {
+		for (i = 0; i < fsg->nluns; ++i) {
+			curlun = &fsg->luns[i];
+			curlun->prevent_medium_removal = 0;
+			curlun->sense_data = curlun->unit_attention_data =
+					SS_NO_SENSE;
+			curlun->sense_data_info = 0;
+		}
+		fsg->state = FSG_STATE_IDLE;
+	}
+	spin_unlock_irq(&fsg->lock);
+
+	/* Carry out any extra actions required for the exception */
+	switch (old_state) {
+	default:
+		break;
+
+	case FSG_STATE_ABORT_BULK_OUT:
+		send_status(fsg);
+		spin_lock_irq(&fsg->lock);
+		if (fsg->state == FSG_STATE_STATUS_PHASE)
+			fsg->state = FSG_STATE_IDLE;
+		spin_unlock_irq(&fsg->lock);
+		break;
+
+	case FSG_STATE_RESET:
+		/* In case we were forced against our will to halt a
+		 * bulk endpoint, clear the halt now.  (The SuperH UDC
+		 * requires this.) */
+		if (test_and_clear_bit(CLEAR_BULK_HALTS,
+				&fsg->atomic_bitflags)) {
+			usb_ep_clear_halt(fsg->bulk_in);
+			usb_ep_clear_halt(fsg->bulk_out);
+		}
+
+		if (transport_is_bbb()) {
+			if (fsg->ep0_req_tag == exception_req_tag)
+				ep0_queue(fsg);	// Complete the status stage
+
+		} else if (transport_is_cbi())
+			send_status(fsg);	// Status by interrupt pipe
+
+		/* Technically this should go here, but it would only be
+		 * a waste of time.  Ditto for the INTERFACE_CHANGE and
+		 * CONFIG_CHANGE cases. */
+		// for (i = 0; i < fsg->nluns; ++i)
+		//	fsg->luns[i].unit_attention_data = SS_RESET_OCCURRED;
+		break;
+
+	case FSG_STATE_INTERFACE_CHANGE:
+		rc = do_set_interface(fsg, 0);
+		if (fsg->ep0_req_tag != exception_req_tag)
+			break;
+		if (rc != 0)			// STALL on errors
+			fsg_set_halt(fsg, fsg->ep0);
+		else				// Complete the status stage
+			ep0_queue(fsg);
+		break;
+
+	case FSG_STATE_CONFIG_CHANGE:
+		rc = do_set_config(fsg, new_config);
+		if (fsg->ep0_req_tag != exception_req_tag)
+			break;
+		if (rc != 0)			// STALL on errors
+			fsg_set_halt(fsg, fsg->ep0);
+		else				// Complete the status stage
+			ep0_queue(fsg);
+		break;
+
+	case FSG_STATE_DISCONNECT:
+		fsync_all(fsg);
+		do_set_config(fsg, 0);		// Unconfigured state
+		break;
+
+	case FSG_STATE_EXIT:
+	case FSG_STATE_TERMINATED:
+		do_set_config(fsg, 0);			// Free resources
+		spin_lock_irq(&fsg->lock);
+		fsg->state = FSG_STATE_TERMINATED;	// Stop the thread
+		spin_unlock_irq(&fsg->lock);
+		break;
+	}
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+static int fsg_main_thread(void *fsg_)
+{
+	struct fsg_dev		*fsg = (struct fsg_dev *) fsg_;
+
+	fsg->thread_task = current;
+
+	/* Release all our userspace resources */
+	daemonize("file-storage-gadget");
+
+	/* Allow the thread to be killed by a signal, but set the signal mask
+	 * to block everything but INT, TERM, KILL, and USR1. */
+	siginitsetinv(&fsg->thread_signal_mask, sigmask(SIGINT) |
+			sigmask(SIGTERM) | sigmask(SIGKILL) |
+			sigmask(SIGUSR1));
+	sigprocmask(SIG_SETMASK, &fsg->thread_signal_mask, NULL);
+
+	/* Arrange for userspace references to be interpreted as kernel
+	 * pointers.  That way we can pass a kernel pointer to a routine
+	 * that expects a __user pointer and it will work okay. */
+	set_fs(get_ds());
+
+	/* Wait for the gadget registration to finish up */
+	wait_for_completion(&fsg->thread_notifier);
+
+	/* The main loop */
+	while (fsg->state != FSG_STATE_TERMINATED) {
+		if (exception_in_progress(fsg) || signal_pending(current)) {
+			handle_exception(fsg);
+			continue;
+		}
+
+		if (!fsg->running) {
+			sleep_thread(fsg);
+			continue;
+		}
+
+		if (get_next_command(fsg))
+			continue;
+
+		spin_lock_irq(&fsg->lock);
+		if (!exception_in_progress(fsg))
+			fsg->state = FSG_STATE_DATA_PHASE;
+		spin_unlock_irq(&fsg->lock);
+
+		if (do_scsi_command(fsg) || finish_reply(fsg))
+			continue;
+
+		spin_lock_irq(&fsg->lock);
+		if (!exception_in_progress(fsg))
+			fsg->state = FSG_STATE_STATUS_PHASE;
+		spin_unlock_irq(&fsg->lock);
+
+		if (send_status(fsg))
+			continue;
+
+		spin_lock_irq(&fsg->lock);
+		if (!exception_in_progress(fsg))
+			fsg->state = FSG_STATE_IDLE;
+		spin_unlock_irq(&fsg->lock);
+		}
+
+	fsg->thread_task = NULL;
+	flush_signals(current);
+
+	/* In case we are exiting because of a signal, unregister the
+	 * gadget driver and close the backing file. */
+	if (test_and_clear_bit(REGISTERED, &fsg->atomic_bitflags)) {
+		usb_gadget_unregister_driver(&fsg_driver);
+		close_all_backing_files(fsg);
+	}
+
+	/* Let the unbind and cleanup routines know the thread has exited */
+	complete_and_exit(&fsg->thread_notifier, 0);
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+/* If the next two routines are called while the gadget is registered,
+ * the caller must own fsg->filesem for writing. */
+
+static int NORMALLY_INIT open_backing_file(struct lun *curlun,
+		const char *filename)
+{
+	int				ro;
+	struct file			*filp = NULL;
+	int				rc = -EINVAL;
+	struct inode			*inode = NULL;
+	loff_t				size;
+	loff_t				num_sectors;
+
+	/* R/W if we can, R/O if we must */
+	ro = curlun->ro;
+	if (!ro) {
+		filp = filp_open(filename, O_RDWR | O_LARGEFILE, 0);
+		if (-EROFS == PTR_ERR(filp))
+			ro = 1;
+	}
+	if (ro)
+		filp = filp_open(filename, O_RDONLY | O_LARGEFILE, 0);
+	if (IS_ERR(filp)) {
+		LINFO(curlun, "unable to open backing file: %s\n", filename);
+		return PTR_ERR(filp);
+	}
+
+	if (!(filp->f_mode & FMODE_WRITE))
+		ro = 1;
+
+	if (filp->f_dentry)
+		inode = filp->f_dentry->d_inode;
+	if (inode && S_ISBLK(inode->i_mode)) {
+		if (bdev_read_only(inode->i_bdev))
+			ro = 1;
+	} else if (!inode || !S_ISREG(inode->i_mode)) {
+		LINFO(curlun, "invalid file type: %s\n", filename);
+		goto out;
+	}
+
+	/* If we can't read the file, it's no good.
+	 * If we can't write the file, use it read-only. */
+	if (!filp->f_op || !(filp->f_op->read || filp->f_op->aio_read)) {
+		LINFO(curlun, "file not readable: %s\n", filename);
+		goto out;
+	}
+	if (!(filp->f_op->write || filp->f_op->aio_write))
+		ro = 1;
+
+	size = i_size_read(inode->i_mapping->host);
+	if (size < 0) {
+		LINFO(curlun, "unable to find file size: %s\n", filename);
+		rc = (int) size;
+		goto out;
+	}
+	num_sectors = size >> 9;	// File size in 512-byte sectors
+	if (num_sectors == 0) {
+		LINFO(curlun, "file too small: %s\n", filename);
+		rc = -ETOOSMALL;
+		goto out;
+	}
+
+	get_file(filp);
+	curlun->ro = ro;
+	curlun->filp = filp;
+	curlun->file_length = size;
+	curlun->num_sectors = num_sectors;
+	LDBG(curlun, "open backing file: %s\n", filename);
+	rc = 0;
+
+out:
+	filp_close(filp, current->files);
+	return rc;
+}
+
+
+static void close_backing_file(struct lun *curlun)
+{
+	if (curlun->filp) {
+		LDBG(curlun, "close backing file\n");
+		fput(curlun->filp);
+		curlun->filp = NULL;
+	}
+}
+
+static void close_all_backing_files(struct fsg_dev *fsg)
+{
+	int	i;
+
+	for (i = 0; i < fsg->nluns; ++i)
+		close_backing_file(&fsg->luns[i]);
+}
+
+
+static ssize_t show_ro(struct device *dev, char *buf)
+{
+	struct lun	*curlun = dev_to_lun(dev);
+
+	return sprintf(buf, "%d\n", curlun->ro);
+}
+
+static ssize_t show_file(struct device *dev, char *buf)
+{
+	struct lun	*curlun = dev_to_lun(dev);
+	struct fsg_dev	*fsg = (struct fsg_dev *) dev_get_drvdata(dev);
+	char		*p;
+	ssize_t		rc;
+
+	down_read(&fsg->filesem);
+	if (backing_file_is_open(curlun)) {	// Get the complete pathname
+		p = d_path(curlun->filp->f_dentry, curlun->filp->f_vfsmnt,
+				buf, PAGE_SIZE - 1);
+		if (IS_ERR(p))
+			rc = PTR_ERR(p);
+		else {
+			rc = strlen(p);
+			memmove(buf, p, rc);
+			buf[rc] = '\n';		// Add a newline
+			buf[++rc] = 0;
+		}
+	} else {				// No file, return 0 bytes
+		*buf = 0;
+		rc = 0;
+	}
+	up_read(&fsg->filesem);
+	return rc;
+}
+
+
+ssize_t NORMALLY_INIT store_ro(struct device *dev, const char *buf,
+		size_t count)
+{
+	ssize_t		rc = count;
+	struct lun	*curlun = dev_to_lun(dev);
+	struct fsg_dev	*fsg = (struct fsg_dev *) dev_get_drvdata(dev);
+	int		i;
+
+	if (sscanf(buf, "%d", &i) != 1)
+		return -EINVAL;
+
+	/* Allow the write-enable status to change only while the backing file
+	 * is closed. */
+	down_read(&fsg->filesem);
+	if (backing_file_is_open(curlun)) {
+		LDBG(curlun, "read-only status change prevented\n");
+		rc = -EBUSY;
+	} else {
+		curlun->ro = !!i;
+		LDBG(curlun, "read-only status set to %d\n", curlun->ro);
+	}
+	up_read(&fsg->filesem);
+	return rc;
+}
+
+ssize_t NORMALLY_INIT store_file(struct device *dev, const char *buf,
+		size_t count)
+{
+	struct lun	*curlun = dev_to_lun(dev);
+	struct fsg_dev	*fsg = (struct fsg_dev *) dev_get_drvdata(dev);
+	int		rc = 0;
+
+	if (curlun->prevent_medium_removal && backing_file_is_open(curlun)) {
+		LDBG(curlun, "eject attempt prevented\n");
+		return -EBUSY;				// "Door is locked"
+	}
+
+	/* Remove a trailing newline */
+	if (count > 0 && buf[count-1] == '\n')
+		((char *) buf)[count-1] = 0;		// Ugh!
+
+	/* Eject current medium */
+	down_write(&fsg->filesem);
+	if (backing_file_is_open(curlun)) {
+		close_backing_file(curlun);
+		curlun->unit_attention_data = SS_MEDIUM_NOT_PRESENT;
+	}
+
+	/* Load new medium */
+	if (count > 0 && buf[0]) {
+		rc = open_backing_file(curlun, buf);
+		if (rc == 0)
+			curlun->unit_attention_data =
+					SS_NOT_READY_TO_READY_TRANSITION;
+	}
+	up_write(&fsg->filesem);
+	return (rc < 0 ? rc : count);
+}
+
+
+/* The write permissions and store_xxx pointers are set in fsg_bind() */
+static DEVICE_ATTR(ro, 0444, show_ro, NULL);
+static DEVICE_ATTR(file, 0444, show_file, NULL);
+
+
+/*-------------------------------------------------------------------------*/
+
+static void fsg_unbind(struct usb_gadget *gadget)
+{
+	struct fsg_dev		*fsg = get_gadget_data(gadget);
+	int			i;
+	struct lun		*curlun;
+	struct usb_request	*req = fsg->ep0req;
+
+	DBG(fsg, "unbind\n");
+	clear_bit(REGISTERED, &fsg->atomic_bitflags);
+
+	/* Unregister the sysfs attribute files and the LUNs */
+	for (i = 0; i < fsg->nluns; ++i) {
+		curlun = &fsg->luns[i];
+		if (curlun->registered) {
+			device_remove_file(&curlun->dev, &dev_attr_ro);
+			device_remove_file(&curlun->dev, &dev_attr_file);
+			device_unregister_wait(&curlun->dev);
+			curlun->registered = 0;
+		}
+	}
+
+	/* If the thread isn't already dead, tell it to exit now */
+	if (fsg->state != FSG_STATE_TERMINATED) {
+		raise_exception(fsg, FSG_STATE_EXIT);
+		wait_for_completion(&fsg->thread_notifier);
+
+		/* The cleanup routine waits for this completion also */
+		complete(&fsg->thread_notifier);
+	}
+
+	/* Free the data buffers */
+	for (i = 0; i < NUM_BUFFERS; ++i) {
+		struct fsg_buffhd	*bh = &fsg->buffhds[i];
+
+		if (bh->buf)
+			usb_ep_free_buffer(fsg->bulk_in, bh->buf, bh->dma,
+					mod_data.buflen);
+	}
+
+	/* Free the request and buffer for endpoint 0 */
+	if (req) {
+		if (req->buf)
+			usb_ep_free_buffer(fsg->ep0, req->buf,
+					req->dma, EP0_BUFSIZE);
+		usb_ep_free_request(fsg->ep0, req);
+	}
+
+	set_gadget_data(gadget, 0);
+}
+
+
+static int __init check_parameters(struct fsg_dev *fsg)
+{
+	int	prot;
+
+	/* Store the default values */
+	mod_data.transport_type = USB_PR_BULK;
+	mod_data.transport_name = "Bulk-only";
+	mod_data.protocol_type = USB_SC_SCSI;
+	mod_data.protocol_name = "Transparent SCSI";
+
+	prot = simple_strtol(mod_data.protocol_parm, NULL, 0);
+
+#ifdef CONFIG_USB_FILE_STORAGE_TEST
+	if (strnicmp(mod_data.transport_parm, "BBB", 10) == 0) {
+		;		// Use default setting
+	} else if (strnicmp(mod_data.transport_parm, "CB", 10) == 0) {
+		mod_data.transport_type = USB_PR_CB;
+		mod_data.transport_name = "Control-Bulk";
+	} else if (strnicmp(mod_data.transport_parm, "CBI", 10) == 0) {
+		mod_data.transport_type = USB_PR_CBI;
+		mod_data.transport_name = "Control-Bulk-Interrupt";
+	} else {
+		INFO(fsg, "invalid transport: %s\n", mod_data.transport_parm);
+		return -EINVAL;
+	}
+
+	if (strnicmp(mod_data.protocol_parm, "SCSI", 10) == 0 ||
+			prot == USB_SC_SCSI) {
+		;		// Use default setting
+	} else if (strnicmp(mod_data.protocol_parm, "RBC", 10) == 0 ||
+			prot == USB_SC_RBC) {
+		mod_data.protocol_type = USB_SC_RBC;
+		mod_data.protocol_name = "RBC";
+	} else if (strnicmp(mod_data.protocol_parm, "8020", 4) == 0 ||
+			strnicmp(mod_data.protocol_parm, "ATAPI", 10) == 0 ||
+			prot == USB_SC_8020) {
+		mod_data.protocol_type = USB_SC_8020;
+		mod_data.protocol_name = "8020i (ATAPI)";
+	} else if (strnicmp(mod_data.protocol_parm, "QIC", 3) == 0 ||
+			prot == USB_SC_QIC) {
+		mod_data.protocol_type = USB_SC_QIC;
+		mod_data.protocol_name = "QIC-157";
+	} else if (strnicmp(mod_data.protocol_parm, "UFI", 10) == 0 ||
+			prot == USB_SC_UFI) {
+		mod_data.protocol_type = USB_SC_UFI;
+		mod_data.protocol_name = "UFI";
+	} else if (strnicmp(mod_data.protocol_parm, "8070", 4) == 0 ||
+			prot == USB_SC_8070) {
+		mod_data.protocol_type = USB_SC_8070;
+		mod_data.protocol_name = "8070i";
+	} else {
+		INFO(fsg, "invalid protocol: %s\n", mod_data.protocol_parm);
+		return -EINVAL;
+	}
+
+	mod_data.buflen &= PAGE_CACHE_MASK;
+	if (mod_data.buflen <= 0) {
+		INFO(fsg, "invalid buflen\n");
+		return -ETOOSMALL;
+	}
+#endif /* CONFIG_USB_FILE_STORAGE_TEST */
+
+	return 0;
+}
+
+
+static int __init fsg_bind(struct usb_gadget *gadget)
+{
+	struct fsg_dev		*fsg = the_fsg;
+	int			rc;
+	int			i;
+	struct lun		*curlun;
+	struct usb_ep		*ep;
+	struct usb_request	*req;
+	char			*pathbuf, *p;
+
+	fsg->gadget = gadget;
+	set_gadget_data(gadget, fsg);
+	fsg->ep0 = gadget->ep0;
+	fsg->ep0->driver_data = fsg;
+
+	if ((rc = check_parameters(fsg)) != 0)
+		goto out;
+
+	if (mod_data.removable) {	// Enable the store_xxx attributes
+		dev_attr_ro.attr.mode = dev_attr_file.attr.mode = 0644;
+		dev_attr_ro.store = store_ro;
+		dev_attr_file.store = store_file;
+	}
+
+	/* Find out how many LUNs there should be */
+	i = mod_data.nluns;
+	if (i == 0)
+		i = max(mod_data.num_filenames, 1);
+	if (i > MAX_LUNS) {
+		INFO(fsg, "invalid number of LUNs: %d\n", i);
+		rc = -EINVAL;
+		goto out;
+	}
+
+	/* Create the LUNs and open their backing files.  We can't register
+	 * the LUN devices until the gadget itself is registered, which
+	 * doesn't happen until after fsg_bind() returns. */
+	fsg->luns = kmalloc(i * sizeof(struct lun), GFP_KERNEL);
+	if (!fsg->luns) {
+		rc = -ENOMEM;
+		goto out;
+	}
+	memset(fsg->luns, 0, i * sizeof(struct lun));
+	fsg->nluns = i;
+
+	for (i = 0; i < fsg->nluns; ++i) {
+		curlun = &fsg->luns[i];
+		curlun->ro = ro[i];
+		curlun->dev.parent = &gadget->dev;
+		curlun->dev.driver = &fsg_driver.driver;
+		dev_set_drvdata(&curlun->dev, fsg);
+		snprintf(curlun->dev.bus_id, BUS_ID_SIZE,
+				"%s-lun%d", gadget->dev.bus_id, i);
+
+		if (file[i] && *file[i]) {
+			if ((rc = open_backing_file(curlun, file[i])) != 0)
+				goto out;
+		} else if (!mod_data.removable) {
+			INFO(fsg, "no file given for LUN%d\n", i);
+			rc = -EINVAL;
+			goto out;
+		}
+	}
+
+	/* Fix up the descriptors */
+	device_desc.bMaxPacketSize0 = fsg->ep0->maxpacket;
+#ifdef HIGHSPEED
+	dev_qualifier.bMaxPacketSize0 = fsg->ep0->maxpacket;		// ???
+#endif
+	device_desc.idVendor = cpu_to_le16(mod_data.vendor);
+	device_desc.idProduct = cpu_to_le16(mod_data.product);
+	device_desc.bcdDevice = cpu_to_le16(mod_data.release);
+
+	i = (transport_is_cbi() ? 3 : 2);	// Number of endpoints
+	config_desc.wTotalLength = USB_DT_CONFIG_SIZE + USB_DT_INTERFACE_SIZE
+			+ USB_DT_ENDPOINT_SIZE * i;
+	intf_desc.bNumEndpoints = i;
+	intf_desc.bInterfaceSubClass = mod_data.protocol_type;
+	intf_desc.bInterfaceProtocol = mod_data.transport_type;
+
+	/* Find all the endpoints we will use */
+	gadget_for_each_ep(ep, gadget) {
+		if (strcmp(ep->name, EP_BULK_IN_NAME) == 0)
+			fsg->bulk_in = ep;
+		else if (strcmp(ep->name, EP_BULK_OUT_NAME) == 0)
+			fsg->bulk_out = ep;
+		else if (strcmp(ep->name, EP_INTR_IN_NAME) == 0)
+			fsg->intr_in = ep;
+	}
+	if (!fsg->bulk_in || !fsg->bulk_out ||
+			(transport_is_cbi() && !fsg->intr_in)) {
+		DBG(fsg, "unable to find all endpoints\n");
+		rc = -ENOTSUPP;
+		goto out;
+	}
+	fsg->bulk_out_maxpacket = (gadget->speed == USB_SPEED_HIGH ? 512 :
+			FS_BULK_OUT_MAXPACKET);
+
+	rc = -ENOMEM;
+
+	/* Allocate the request and buffer for endpoint 0 */
+	fsg->ep0req = req = usb_ep_alloc_request(fsg->ep0, GFP_KERNEL);
+	if (!req)
+		goto out;
+	req->buf = usb_ep_alloc_buffer(fsg->ep0, EP0_BUFSIZE,
+			&req->dma, GFP_KERNEL);
+	if (!req->buf)
+		goto out;
+	req->complete = ep0_complete;
+
+	/* Allocate the data buffers */
+	for (i = 0; i < NUM_BUFFERS; ++i) {
+		struct fsg_buffhd	*bh = &fsg->buffhds[i];
+
+		bh->buf = usb_ep_alloc_buffer(fsg->bulk_in, mod_data.buflen,
+				&bh->dma, GFP_KERNEL);
+		if (!bh->buf)
+			goto out;
+		bh->next = bh + 1;
+	}
+	fsg->buffhds[NUM_BUFFERS - 1].next = &fsg->buffhds[0];
+
+	/* This should reflect the actual gadget power source */
+	usb_gadget_set_selfpowered(gadget);
+
+	/* On a real device, serial[] would be loaded from permanent
+	 * storage.  We just encode it from the driver version string. */
+	for (i = 0; i < sizeof(serial) - 2; i += 2) {
+		unsigned char		c = DRIVER_VERSION[i / 2];
+
+		if (!c)
+			break;
+		sprintf(&serial[i], "%02X", c);
+	}
+
+	if ((rc = kernel_thread(fsg_main_thread, fsg, (CLONE_VM | CLONE_FS |
+			CLONE_FILES))) < 0)
+		goto out;
+	fsg->thread_pid = rc;
+
+	INFO(fsg, DRIVER_DESC ", version: " DRIVER_VERSION "\n");
+	INFO(fsg, "Number of LUNs=%d\n", fsg->nluns);
+
+	pathbuf = kmalloc(PATH_MAX, GFP_KERNEL);
+	for (i = 0; i < fsg->nluns; ++i) {
+		curlun = &fsg->luns[i];
+		if (backing_file_is_open(curlun)) {
+			p = NULL;
+			if (pathbuf) {
+				p = d_path(curlun->filp->f_dentry,
+					curlun->filp->f_vfsmnt,
+					pathbuf, PATH_MAX);
+				if (IS_ERR(p))
+					p = NULL;
+			}
+			LINFO(curlun, "ro=%d, file: %s\n",
+					curlun->ro, (p ? p : "(error)"));
+		}
+	}
+	kfree(pathbuf);
+
+	DBG(fsg, "transport=%s (x%02x)\n",
+			mod_data.transport_name, mod_data.transport_type);
+	DBG(fsg, "protocol=%s (x%02x)\n",
+			mod_data.protocol_name, mod_data.protocol_type);
+	DBG(fsg, "VendorID=x%04x, ProductID=x%04x, Release=x%04x\n",
+			mod_data.vendor, mod_data.product, mod_data.release);
+	DBG(fsg, "removable=%d, stall=%d, buflen=%u\n",
+			mod_data.removable, mod_data.can_stall,
+			mod_data.buflen);
+	DBG(fsg, "I/O thread pid: %d\n", fsg->thread_pid);
+	return 0;
+
+out:
+	fsg->state = FSG_STATE_TERMINATED;	// The thread is dead
+	fsg_unbind(gadget);
+	close_all_backing_files(fsg);
+	return rc;
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+static struct usb_gadget_driver		fsg_driver = {
+#ifdef HIGHSPEED
+	.speed		= USB_SPEED_HIGH,
+#else
+	.speed		= USB_SPEED_FULL,
+#endif
+	.function	= (char *) longname,
+	.bind		= fsg_bind,
+	.unbind		= fsg_unbind,
+	.disconnect	= fsg_disconnect,
+	.setup		= fsg_setup,
+
+	.driver		= {
+		.name		= (char *) shortname,
+		// .release = ...
+		// .suspend = ...
+		// .resume = ...
+	},
+};
+
+
+static int __init fsg_alloc(void)
+{
+	struct fsg_dev		*fsg;
+
+	fsg = kmalloc(sizeof *fsg, GFP_KERNEL);
+	if (!fsg)
+		return -ENOMEM;
+	memset(fsg, 0, sizeof *fsg);
+	spin_lock_init(&fsg->lock);
+	init_rwsem(&fsg->filesem);
+	init_waitqueue_head(&fsg->thread_wqh);
+	init_completion(&fsg->thread_notifier);
+
+	the_fsg = fsg;
+	return 0;
+}
+
+
+static void fsg_free(struct fsg_dev *fsg)
+{
+	kfree(fsg->luns);
+	kfree(fsg);
+}
+
+
+static int __init fsg_init(void)
+{
+	int		rc;
+	struct fsg_dev	*fsg;
+	int		i;
+	struct lun	*curlun;
+
+	if ((rc = fsg_alloc()) != 0)
+		return rc;
+	fsg = the_fsg;
+	if ((rc = usb_gadget_register_driver(&fsg_driver)) != 0) {
+		fsg_free(fsg);
+		return rc;
+	}
+	set_bit(REGISTERED, &fsg->atomic_bitflags);
+
+	/* Register the LUN devices and their attribute files */
+	for (i = 0; i < fsg->nluns; ++i) {
+		curlun = &fsg->luns[i];
+		if ((rc = device_register(&curlun->dev)) != 0)
+			INFO(fsg, "failed to register LUN%d: %d\n", i, rc);
+		else {
+			curlun->registered = 1;
+			device_create_file(&curlun->dev, &dev_attr_ro);
+			device_create_file(&curlun->dev, &dev_attr_file);
+		}
+	}
+
+	/* Tell the thread to start working */
+	complete(&fsg->thread_notifier);
+	return 0;
+}
+module_init(fsg_init);
+
+
+static void __exit fsg_cleanup(void)
+{
+	struct fsg_dev	*fsg = the_fsg;
+
+	/* Unregister the driver iff the thread hasn't already done so */
+	if (test_and_clear_bit(REGISTERED, &fsg->atomic_bitflags))
+		usb_gadget_unregister_driver(&fsg_driver);
+
+	/* Wait for the thread to finish up */
+	wait_for_completion(&fsg->thread_notifier);
+
+	close_all_backing_files(fsg);
+	fsg_free(fsg);
+}
+module_exit(fsg_cleanup);
diff -Nru a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/usb/gadget/goku_udc.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,1988 @@
+/*
+ * Toshiba TC86C001 ("Goku-S") USB Device Controller driver
+ *
+ * Copyright (C) 2000-2002 Lineo
+ *      by Stuart Lynne, Tom Rushworth, and Bruce Balden
+ * Copyright (C) 2002 Toshiba Corporation
+ * Copyright (C) 2003 MontaVista Software (source@mvista.com)
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+/*
+ * This device has ep0 and three semi-configurable bulk/interrupt endpoints.
+ *
+ *  - Endpoint numbering is fixed: ep{1,2,3}-bulk
+ *  - Gadget drivers can choose ep maxpacket (8/16/32/64)
+ *  - Gadget drivers can choose direction (IN, OUT)
+ *  - DMA works with ep1 (OUT transfers) and ep2 (IN transfers).
+ */
+
+#undef DEBUG
+// #define	VERBOSE		/* extra debug messages (success too) */
+// #define	USB_TRACE	/* packet-level success messages */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/delay.h>
+#include <linux/ioport.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/smp_lock.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/timer.h>
+#include <linux/list.h>
+#include <linux/interrupt.h>
+#include <linux/proc_fs.h>
+#include <linux/device.h>
+#include <linux/usb_ch9.h>
+#include <linux/usb_gadget.h>
+
+#include <asm/byteorder.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/system.h>
+#include <asm/unaligned.h>
+
+
+#include "goku_udc.h"
+
+#define	DRIVER_DESC		"TC86C001 USB Device Controller"
+#define	DRIVER_VERSION		"30-Oct 2003"
+
+#define	DMA_ADDR_INVALID	(~(dma_addr_t)0)
+
+static const char driver_name [] = "goku_udc";
+static const char driver_desc [] = DRIVER_DESC;
+
+MODULE_AUTHOR("source@mvista.com");
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_LICENSE("GPL");
+
+
+/*
+ * IN dma behaves ok under testing, though the IN-dma abort paths don't
+ * seem to behave quite as expected.  Used by default.
+ *
+ * OUT dma documents design problems handling the common "short packet"
+ * transfer termination policy; it couldn't enabled by default, even
+ * if the OUT-dma abort problems had a resolution.
+ */
+static unsigned use_dma = 1;
+
+#if 0
+//#include <linux/moduleparam.h>
+/* "modprobe goku_udc use_dma=1" etc
+ *	0 to disable dma
+ *	1 to use IN dma only (normal operation)
+ *	2 to use IN and OUT dma
+ */
+module_param(use_dma, uint, S_IRUGO);
+#endif
+
+/*-------------------------------------------------------------------------*/
+
+static void nuke(struct goku_ep *, int status);
+
+static inline void
+command(struct goku_udc_regs *regs, int command, unsigned epnum)
+{
+	writel(COMMAND_EP(epnum) | command, &regs->Command);
+	udelay(300);
+}
+
+static int
+goku_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
+{
+	struct goku_udc	*dev;
+	struct goku_ep	*ep;
+	u32		mode;
+	u16		max;
+	unsigned long	flags;
+
+	ep = container_of(_ep, struct goku_ep, ep);
+	if (!_ep || !desc || ep->desc
+			|| desc->bDescriptorType != USB_DT_ENDPOINT)
+		return -EINVAL;
+	dev = ep->dev;
+	if (ep == &dev->ep[0])
+		return -EINVAL;
+	if (!dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN)
+		return -ESHUTDOWN;
+	if (ep->num != (desc->bEndpointAddress & 0x0f))
+		return -EINVAL;
+
+	switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
+	case USB_ENDPOINT_XFER_BULK:
+	case USB_ENDPOINT_XFER_INT:
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	if ((readl(ep->reg_status) & EPxSTATUS_EP_MASK)
+			!= EPxSTATUS_EP_INVALID)
+		return -EBUSY;
+
+	/* enabling the no-toggle interrupt mode would need an api hook */
+	mode = 0;
+	max = le16_to_cpu(get_unaligned(&desc->wMaxPacketSize));
+	switch (max) {
+	case 64:	mode++;
+	case 32:	mode++;
+	case 16:	mode++;
+	case 8:		mode <<= 3;
+			break;
+	default:
+		return -EINVAL;
+	}
+	mode |= 2 << 1;		/* bulk, or intr-with-toggle */
+
+	/* ep1/ep2 dma direction is chosen early; it works in the other
+	 * direction, with pio.  be cautious with out-dma.
+	 */
+	ep->is_in = (USB_DIR_IN & desc->bEndpointAddress) != 0;
+	if (ep->is_in) {
+		mode |= 1;
+		ep->dma = (use_dma != 0) && (ep->num == UDC_MSTRD_ENDPOINT);
+	} else {
+		ep->dma = (use_dma == 2) && (ep->num == UDC_MSTWR_ENDPOINT);
+		if (ep->dma)
+			DBG(dev, "%s out-dma hides short packets\n",
+				ep->ep.name);
+	}
+
+	spin_lock_irqsave(&ep->dev->lock, flags);
+
+	/* ep1 and ep2 can do double buffering and/or dma */
+	if (ep->num < 3) {
+		struct goku_udc_regs	*regs = ep->dev->regs;
+		u32			tmp;
+
+		/* double buffer except (for now) with pio in */
+		tmp = ((ep->dma || !ep->is_in)
+				? 0x10	/* double buffered */
+				: 0x11	/* single buffer */
+			) << ep->num;
+		tmp |= readl(&regs->EPxSingle);
+		writel(tmp, &regs->EPxSingle);
+
+		tmp = (ep->dma ? 0x10/*dma*/ : 0x11/*pio*/) << ep->num;
+		tmp |= readl(&regs->EPxBCS);
+		writel(tmp, &regs->EPxBCS);
+	}
+	writel(mode, ep->reg_mode);
+	command(ep->dev->regs, COMMAND_RESET, ep->num);
+	ep->ep.maxpacket = max;
+	ep->stopped = 0;
+	ep->desc = desc;
+	spin_unlock_irqrestore(&ep->dev->lock, flags);
+
+	DBG(dev, "enable %s %s %s maxpacket %u\n", ep->ep.name,
+		ep->is_in ? "IN" : "OUT",
+		ep->dma ? "dma" : "pio",
+		max);
+
+	return 0;
+}
+
+static void ep_reset(struct goku_udc_regs *regs, struct goku_ep *ep)
+{
+	struct goku_udc		*dev = ep->dev;
+
+	if (regs) {
+		command(regs, COMMAND_INVALID, ep->num);
+		if (ep->num) {
+			if (ep->num == UDC_MSTWR_ENDPOINT)
+				dev->int_enable &= ~(INT_MSTWREND
+							|INT_MSTWRTMOUT);
+			else if (ep->num == UDC_MSTRD_ENDPOINT)
+				dev->int_enable &= ~INT_MSTRDEND;
+			dev->int_enable &= ~INT_EPxDATASET (ep->num);
+		} else
+			dev->int_enable &= ~INT_EP0;
+		writel(dev->int_enable, &regs->int_enable);
+		readl(&regs->int_enable);
+		if (ep->num < 3) {
+			struct goku_udc_regs	*regs = ep->dev->regs;
+			u32			tmp;
+
+			tmp = readl(&regs->EPxSingle);
+			tmp &= ~(0x11 << ep->num);
+			writel(tmp, &regs->EPxSingle);
+
+			tmp = readl(&regs->EPxBCS);
+			tmp &= ~(0x11 << ep->num);
+			writel(tmp, &regs->EPxBCS);
+		}
+		/* reset dma in case we're still using it */
+		if (ep->dma) {
+			u32	master;
+
+			master = readl(&regs->dma_master) & MST_RW_BITS;
+			if (ep->num == UDC_MSTWR_ENDPOINT) {
+				master &= ~MST_W_BITS;
+				master |= MST_WR_RESET;
+			} else {
+				master &= ~MST_R_BITS;
+				master |= MST_RD_RESET;
+			}
+			writel(master, &regs->dma_master);
+		}
+	}
+
+	ep->ep.maxpacket = MAX_FIFO_SIZE;
+	ep->desc = 0;
+	ep->stopped = 1;
+	ep->irqs = 0;
+	ep->dma = 0;
+}
+
+static int goku_ep_disable(struct usb_ep *_ep)
+{
+	struct goku_ep	*ep;
+	struct goku_udc	*dev;
+	unsigned long	flags;
+
+	ep = container_of(_ep, struct goku_ep, ep);
+	if (!_ep || !ep->desc)
+		return -ENODEV;
+	dev = ep->dev;
+	if (dev->ep0state == EP0_SUSPEND)
+		return -EBUSY;
+
+	VDBG(dev, "disable %s\n", _ep->name);
+
+	spin_lock_irqsave(&dev->lock, flags);
+	nuke(ep, -ESHUTDOWN);
+	ep_reset(dev->regs, ep);
+	spin_unlock_irqrestore(&dev->lock, flags);
+
+	return 0;
+}
+
+/*-------------------------------------------------------------------------*/
+
+static struct usb_request *
+goku_alloc_request(struct usb_ep *_ep, int gfp_flags)
+{
+	struct goku_request	*req;
+
+	if (!_ep)
+		return 0;
+	req = kmalloc(sizeof *req, gfp_flags);
+	if (!req)
+		return 0;
+
+	memset(req, 0, sizeof *req);
+	req->req.dma = DMA_ADDR_INVALID;
+	INIT_LIST_HEAD(&req->queue);
+	return &req->req;
+}
+
+static void
+goku_free_request(struct usb_ep *_ep, struct usb_request *_req)
+{
+	struct goku_request	*req;
+
+	if (!_ep || !_req)
+		return;
+
+	req = container_of(_req, struct goku_request, req);
+	WARN_ON(!list_empty(&req->queue));
+	kfree(req);
+}
+
+/*-------------------------------------------------------------------------*/
+
+#undef USE_KMALLOC
+
+/* many common platforms have dma-coherent caches, which means that it's
+ * safe to use kmalloc() memory for all i/o buffers without using any
+ * cache flushing calls.  (unless you're trying to share cache lines
+ * between dma and non-dma activities, which is a slow idea in any case.)
+ *
+ * other platforms need more care, with 2.6 having a moderately general
+ * solution except for the common "buffer is smaller than a page" case.
+ */
+#if	defined(CONFIG_X86)
+#define USE_KMALLOC
+
+#elif	defined(CONFIG_MIPS) && !defined(CONFIG_NONCOHERENT_IO)
+#define USE_KMALLOC
+
+#elif	defined(CONFIG_PPC) && !defined(CONFIG_NOT_COHERENT_CACHE)
+#define USE_KMALLOC
+
+#endif
+
+/* allocating buffers this way eliminates dma mapping overhead, which
+ * on some platforms will mean eliminating a per-io buffer copy.  with
+ * some kinds of system caches, further tweaks may still be needed.
+ */
+static void *
+goku_alloc_buffer(struct usb_ep *_ep, unsigned bytes,
+			dma_addr_t *dma, int  gfp_flags)
+{
+	void		*retval;
+	struct goku_ep	*ep;
+
+	ep = container_of(_ep, struct goku_ep, ep);
+	if (!_ep)
+		return 0;
+	*dma = DMA_ADDR_INVALID;
+
+#if	defined(USE_KMALLOC)
+	retval = kmalloc(bytes, gfp_flags);
+	if (retval)
+		*dma = virt_to_phys(retval);
+#else
+	if (ep->dma) {
+		/* the main problem with this call is that it wastes memory
+		 * on typical 1/N page allocations: it allocates 1-N pages.
+		 */
+#warning Using dma_alloc_coherent even with buffers smaller than a page.
+		retval = dma_alloc_coherent(&ep->dev->pdev->dev,
+				bytes, dma, gfp_flags);
+	} else
+		retval = kmalloc(bytes, gfp_flags);
+#endif
+	return retval;
+}
+
+static void
+goku_free_buffer(struct usb_ep *_ep, void *buf, dma_addr_t dma, unsigned bytes)
+{
+	/* free memory into the right allocator */
+#ifndef	USE_KMALLOC
+	if (dma != DMA_ADDR_INVALID) {
+		struct goku_ep	*ep;
+
+		ep = container_of(_ep, struct goku_ep, ep);
+		if (!_ep)
+			return;
+		dma_free_coherent(&ep->dev->pdev->dev, bytes, buf, dma);
+	} else
+#endif
+		kfree (buf);
+}
+
+/*-------------------------------------------------------------------------*/
+
+static void
+done(struct goku_ep *ep, struct goku_request *req, int status)
+{
+	struct goku_udc		*dev;
+	unsigned		stopped = ep->stopped;
+
+	list_del_init(&req->queue);
+
+	if (likely(req->req.status == -EINPROGRESS))
+		req->req.status = status;
+	else
+		status = req->req.status;
+
+	dev = ep->dev;
+	if (req->mapped) {
+		pci_unmap_single(dev->pdev, req->req.dma, req->req.length,
+			ep->is_in ? PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE);
+		req->req.dma = DMA_ADDR_INVALID;
+		req->mapped = 0;
+	}
+
+#ifndef USB_TRACE
+	if (status && status != -ESHUTDOWN)
+#endif
+		VDBG(dev, "complete %s req %p stat %d len %u/%u\n",
+			ep->ep.name, &req->req, status,
+			req->req.actual, req->req.length);
+
+	/* don't modify queue heads during completion callback */
+	ep->stopped = 1;
+	spin_unlock(&dev->lock);
+	req->req.complete(&ep->ep, &req->req);
+	spin_lock(&dev->lock);
+	ep->stopped = stopped;
+}
+
+/*-------------------------------------------------------------------------*/
+
+static inline int
+write_packet(u32 *fifo, u8 *buf, struct goku_request *req, unsigned max)
+{
+	unsigned	length, count;
+
+	length = min(req->req.length - req->req.actual, max);
+	req->req.actual += length;
+
+	count = length;
+	while (likely(count--))
+		writel(*buf++, fifo);
+	return length;
+}
+
+// return:  0 = still running, 1 = completed, negative = errno
+static int write_fifo(struct goku_ep *ep, struct goku_request *req)
+{
+	struct goku_udc	*dev = ep->dev;
+	u32		tmp;
+	u8		*buf;
+	unsigned	count;
+	int		is_last;
+
+	tmp = readl(&dev->regs->DataSet);
+	buf = req->req.buf + req->req.actual;
+	prefetch(buf);
+
+	dev = ep->dev;
+	if (unlikely(ep->num == 0 && dev->ep0state != EP0_IN))
+		return -EL2HLT;
+
+	/* NOTE:  just single-buffered PIO-IN for now.  */
+	if (unlikely((tmp & DATASET_A(ep->num)) != 0))
+		return 0;
+
+	/* clear our "packet available" irq */
+	if (ep->num != 0)
+		writel(~INT_EPxDATASET(ep->num), &dev->regs->int_status);
+
+	count = write_packet(ep->reg_fifo, buf, req, ep->ep.maxpacket);
+
+	/* last packet often short (sometimes a zlp, especially on ep0) */
+	if (unlikely(count != ep->ep.maxpacket)) {
+		writel(~(1<<ep->num), &dev->regs->EOP);
+		if (ep->num == 0) {
+			dev->ep[0].stopped = 1;
+			dev->ep0state = EP0_STATUS;
+		}
+		is_last = 1;
+	} else {
+		if (likely(req->req.length != req->req.actual)
+				|| req->req.zero)
+			is_last = 0;
+		else
+			is_last = 1;
+	}
+#if 0		/* printk seemed to trash is_last...*/
+//#ifdef USB_TRACE
+	VDBG(dev, "wrote %s %u bytes%s IN %u left %p\n",
+		ep->ep.name, count, is_last ? "/last" : "",
+		req->req.length - req->req.actual, req);
+#endif
+
+	/* requests complete when all IN data is in the FIFO,
+	 * or sometimes later, if a zlp was needed.
+	 */
+	if (is_last) {
+		done(ep, req, 0);
+		return 1;
+	}
+
+	return 0;
+}
+
+static int read_fifo(struct goku_ep *ep, struct goku_request *req)
+{
+	struct goku_udc_regs	*regs;
+	u32			size, set;
+	u8			*buf;
+	unsigned		bufferspace, is_short, dbuff;
+
+	regs = ep->dev->regs;
+top:
+	buf = req->req.buf + req->req.actual;
+	prefetchw(buf);
+
+	if (unlikely(ep->num == 0 && ep->dev->ep0state != EP0_OUT))
+		return -EL2HLT;
+
+	dbuff = (ep->num == 1 || ep->num == 2);
+	do {
+		/* ack dataset irq matching the status we'll handle */
+		if (ep->num != 0)
+			writel(~INT_EPxDATASET(ep->num), &regs->int_status);
+
+		set = readl(&regs->DataSet) & DATASET_AB(ep->num);
+		size = readl(&regs->EPxSizeLA[ep->num]);
+		bufferspace = req->req.length - req->req.actual;
+
+		/* usually do nothing without an OUT packet */
+		if (likely(ep->num != 0 || bufferspace != 0)) {
+			if (unlikely(set == 0))
+				break;
+			/* use ep1/ep2 double-buffering for OUT */
+			if (!(size & PACKET_ACTIVE))
+				size = readl(&regs->EPxSizeLB[ep->num]);
+			if (!(size & PACKET_ACTIVE)) 	// "can't happen"
+				break;
+			size &= DATASIZE;	/* EPxSizeH == 0 */
+
+		/* ep0out no-out-data case for set_config, etc */
+		} else
+			size = 0;
+
+		/* read all bytes from this packet */
+		req->req.actual += size;
+		is_short = (size < ep->ep.maxpacket);
+#ifdef USB_TRACE
+		VDBG(ep->dev, "read %s %u bytes%s OUT req %p %u/%u\n",
+			ep->ep.name, size, is_short ? "/S" : "",
+			req, req->req.actual, req->req.length);
+#endif
+		while (likely(size-- != 0)) {
+			u8	byte = (u8) readl(ep->reg_fifo);
+
+			if (unlikely(bufferspace == 0)) {
+				/* this happens when the driver's buffer
+				 * is smaller than what the host sent.
+				 * discard the extra data in this packet.
+				 */
+				if (req->req.status != -EOVERFLOW)
+					DBG(ep->dev, "%s overflow %u\n",
+						ep->ep.name, size);
+				req->req.status = -EOVERFLOW;
+			} else {
+				*buf++ = byte;
+				bufferspace--;
+			}
+		}
+
+		/* completion */
+		if (unlikely(is_short || req->req.actual == req->req.length)) {
+			if (unlikely(ep->num == 0)) {
+				/* non-control endpoints now usable? */
+				if (ep->dev->req_config)
+					writel(ep->dev->configured
+							? USBSTATE_CONFIGURED
+							: 0,
+						&regs->UsbState);
+				/* ep0out status stage */
+				writel(~(1<<0), &regs->EOP);
+				ep->stopped = 1;
+				ep->dev->ep0state = EP0_STATUS;
+			}
+			done(ep, req, 0);
+
+			/* empty the second buffer asap */
+			if (dbuff && !list_empty(&ep->queue)) {
+				req = list_entry(ep->queue.next,
+						struct goku_request, queue);
+				goto top;
+			}
+			return 1;
+		}
+	} while (dbuff);
+	return 0;
+}
+
+static inline void
+pio_irq_enable(struct goku_udc *dev, struct goku_udc_regs *regs, int epnum)
+{
+	dev->int_enable |= INT_EPxDATASET (epnum);
+	writel(dev->int_enable, &regs->int_enable);
+	/* write may still be posted */
+}
+
+static inline void
+pio_irq_disable(struct goku_udc *dev, struct goku_udc_regs *regs, int epnum)
+{
+	dev->int_enable &= ~INT_EPxDATASET (epnum);
+	writel(dev->int_enable, &regs->int_enable);
+	/* write may still be posted */
+}
+
+static inline void
+pio_advance(struct goku_ep *ep)
+{
+	struct goku_request	*req;
+
+	if (unlikely(list_empty (&ep->queue)))
+		return;
+	req = list_entry(ep->queue.next, struct goku_request, queue);
+	(ep->is_in ? write_fifo : read_fifo)(ep, req);
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+// return:  0 = q running, 1 = q stopped, negative = errno
+static int start_dma(struct goku_ep *ep, struct goku_request *req)
+{
+	struct goku_udc_regs	*regs = ep->dev->regs;
+	u32			master;
+	u32			start = req->req.dma;
+	u32			end = start + req->req.length - 1;
+
+	master = readl(&regs->dma_master) & MST_RW_BITS;
+
+	/* re-init the bits affecting IN dma; careful with zlps */
+	if (likely(ep->is_in)) {
+		if (unlikely(master & MST_RD_ENA)) {
+			DBG (ep->dev, "start, IN active dma %03x!!\n",
+				master);
+//			return -EL2HLT;
+		}
+		writel(end, &regs->in_dma_end);
+		writel(start, &regs->in_dma_start);
+
+		master &= ~MST_R_BITS;
+		if (unlikely(req->req.length == 0))
+			master = MST_RD_ENA | MST_RD_EOPB;
+		else if ((req->req.length % ep->ep.maxpacket) != 0
+					|| req->req.zero)
+			master = MST_RD_ENA | MST_EOPB_ENA;
+		else
+			master = MST_RD_ENA | MST_EOPB_DIS;
+
+		ep->dev->int_enable |= INT_MSTRDEND;
+
+	/* Goku DMA-OUT merges short packets, which plays poorly with
+	 * protocols where short packets mark the transfer boundaries.
+	 * The chip supports a nonstandard policy with INT_MSTWRTMOUT,
+	 * ending transfers after 3 SOFs; we don't turn it on.
+	 */
+	} else {
+		if (unlikely(master & MST_WR_ENA)) {
+			DBG (ep->dev, "start, OUT active dma %03x!!\n",
+				master);
+//			return -EL2HLT;
+		}
+		writel(end, &regs->out_dma_end);
+		writel(start, &regs->out_dma_start);
+
+		master &= ~MST_W_BITS;
+		master |= MST_WR_ENA | MST_TIMEOUT_DIS;
+
+		ep->dev->int_enable |= INT_MSTWREND|INT_MSTWRTMOUT;
+	}
+
+	writel(master, &regs->dma_master);
+	writel(ep->dev->int_enable, &regs->int_enable);
+	return 0;
+}
+
+static void dma_advance(struct goku_udc *dev, struct goku_ep *ep)
+{
+	struct goku_request	*req;
+	struct goku_udc_regs	*regs = ep->dev->regs;
+	u32			master;
+
+	master = readl(&regs->dma_master);
+
+	if (unlikely(list_empty(&ep->queue))) {
+stop:
+		if (ep->is_in)
+			dev->int_enable &= ~INT_MSTRDEND;
+		else
+			dev->int_enable &= ~(INT_MSTWREND|INT_MSTWRTMOUT);
+		writel(dev->int_enable, &regs->int_enable);
+		return;
+	}
+	req = list_entry(ep->queue.next, struct goku_request, queue);
+
+	/* normal hw dma completion (not abort) */
+	if (likely(ep->is_in)) {
+		if (unlikely(master & MST_RD_ENA))
+			return;
+		req->req.actual = readl(&regs->in_dma_current);
+	} else {
+		if (unlikely(master & MST_WR_ENA))
+			return;
+
+		/* hardware merges short packets, and also hides packet
+		 * overruns.  a partial packet MAY be in the fifo here.
+		 */
+		req->req.actual = readl(&regs->out_dma_current);
+	}
+	req->req.actual -= req->req.dma;
+	req->req.actual++;
+
+#ifdef USB_TRACE
+	VDBG(dev, "done %s %s dma, %u/%u bytes, req %p\n",
+		ep->ep.name, ep->is_in ? "IN" : "OUT",
+		req->req.actual, req->req.length, req);
+#endif
+	done(ep, req, 0);
+	if (list_empty(&ep->queue))
+		goto stop;
+	req = list_entry(ep->queue.next, struct goku_request, queue);
+	(void) start_dma(ep, req);
+}
+
+static void abort_dma(struct goku_ep *ep, int status)
+{
+	struct goku_udc_regs	*regs = ep->dev->regs;
+	struct goku_request	*req;
+	u32			curr, master;
+
+	/* NAK future host requests, hoping the implicit delay lets the
+	 * dma engine finish reading (or writing) its latest packet and
+	 * empty the dma buffer (up to 16 bytes).
+	 *
+	 * This avoids needing to clean up a partial packet in the fifo;
+	 * we can't do that for IN without side effects to HALT and TOGGLE.
+	 */
+	command(regs, COMMAND_FIFO_DISABLE, ep->num);
+	req = list_entry(ep->queue.next, struct goku_request, queue);
+	master = readl(&regs->dma_master) & MST_RW_BITS;
+
+	/* FIXME using these resets isn't usably documented. this may
+	 * not work unless it's followed by disabling the endpoint.
+	 *
+	 * FIXME the OUT reset path doesn't even behave consistently.
+	 */
+	if (ep->is_in) {
+		if (unlikely((readl(&regs->dma_master) & MST_RD_ENA) == 0))
+			goto finished;
+		curr = readl(&regs->in_dma_current);
+
+		writel(curr, &regs->in_dma_end);
+		writel(curr, &regs->in_dma_start);
+
+		master &= ~MST_R_BITS;
+		master |= MST_RD_RESET;
+		writel(master, &regs->dma_master);
+
+		if (readl(&regs->dma_master) & MST_RD_ENA)
+			DBG(ep->dev, "IN dma active after reset!\n");
+
+	} else {
+		if (unlikely((readl(&regs->dma_master) & MST_WR_ENA) == 0))
+			goto finished;
+		curr = readl(&regs->out_dma_current);
+
+		writel(curr, &regs->out_dma_end);
+		writel(curr, &regs->out_dma_start);
+
+		master &= ~MST_W_BITS;
+		master |= MST_WR_RESET;
+		writel(master, &regs->dma_master);
+
+		if (readl(&regs->dma_master) & MST_WR_ENA)
+			DBG(ep->dev, "OUT dma active after reset!\n");
+	}
+	req->req.actual = (curr - req->req.dma) + 1;
+	req->req.status = status;
+
+	VDBG(ep->dev, "%s %s %s %d/%d\n", __FUNCTION__, ep->ep.name,
+		ep->is_in ? "IN" : "OUT",
+		req->req.actual, req->req.length);
+
+	command(regs, COMMAND_FIFO_ENABLE, ep->num);
+
+	return;
+
+finished:
+	/* dma already completed; no abort needed */
+	command(regs, COMMAND_FIFO_ENABLE, ep->num);
+	req->req.actual = req->req.length;
+	req->req.status = 0;
+}
+
+/*-------------------------------------------------------------------------*/
+
+static int
+goku_queue(struct usb_ep *_ep, struct usb_request *_req, int gfp_flags)
+{
+	struct goku_request	*req;
+	struct goku_ep		*ep;
+	struct goku_udc		*dev;
+	unsigned long		flags;
+	int			status;
+
+	/* always require a cpu-view buffer so pio works */
+	req = container_of(_req, struct goku_request, req);
+	if (unlikely(!_req || !_req->complete
+			|| !_req->buf || !list_empty(&req->queue)))
+		return -EINVAL;
+	ep = container_of(_ep, struct goku_ep, ep);
+	if (unlikely(!_ep || (!ep->desc && ep->num != 0)))
+		return -EINVAL;
+	dev = ep->dev;
+	if (unlikely(!dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN))
+		return -ESHUTDOWN;
+
+	/* can't touch registers when suspended */
+	if (dev->ep0state == EP0_SUSPEND)
+		return -EBUSY;
+
+	/* set up dma mapping in case the caller didn't */
+	if (ep->dma && _req->dma == DMA_ADDR_INVALID) {
+		_req->dma = pci_map_single(dev->pdev, _req->buf, _req->length,
+			ep->is_in ? PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE);
+		req->mapped = 1;
+	}
+
+#ifdef USB_TRACE
+	VDBG(dev, "%s queue req %p, len %u buf %p\n",
+			_ep->name, _req, _req->length, _req->buf);
+#endif
+
+	spin_lock_irqsave(&dev->lock, flags);
+
+	_req->status = -EINPROGRESS;
+	_req->actual = 0;
+
+	/* for ep0 IN without premature status, zlp is required and
+	 * writing EOP starts the status stage (OUT).
+	 */
+	if (unlikely(ep->num == 0 && ep->is_in))
+		_req->zero = 1;
+
+	/* kickstart this i/o queue? */
+	status = 0;
+	if (list_empty(&ep->queue) && likely(!ep->stopped)) {
+		/* dma:  done after dma completion IRQ (or error)
+		 * pio:  done after last fifo operation
+		 */
+		if (ep->dma)
+			status = start_dma(ep, req);
+		else
+			status = (ep->is_in ? write_fifo : read_fifo)(ep, req);
+
+		if (unlikely(status != 0)) {
+			if (status > 0)
+				status = 0;
+			req = 0;
+		}
+
+	} /* else pio or dma irq handler advances the queue. */
+
+	if (likely(req != 0))
+		list_add_tail(&req->queue, &ep->queue);
+
+	if (likely(!list_empty(&ep->queue))
+			&& likely(ep->num != 0)
+			&& !ep->dma
+			&& !(dev->int_enable & INT_EPxDATASET (ep->num)))
+		pio_irq_enable(dev, dev->regs, ep->num);
+
+	spin_unlock_irqrestore(&dev->lock, flags);
+
+	/* pci writes may still be posted */
+	return status;
+}
+
+/* dequeue ALL requests */
+static void nuke(struct goku_ep *ep, int status)
+{
+	struct goku_request	*req;
+
+	ep->stopped = 1;
+	if (list_empty(&ep->queue))
+		return;
+	if (ep->dma)
+		abort_dma(ep, status);
+	while (!list_empty(&ep->queue)) {
+		req = list_entry(ep->queue.next, struct goku_request, queue);
+		done(ep, req, status);
+	}
+}
+
+/* dequeue JUST ONE request */
+static int goku_dequeue(struct usb_ep *_ep, struct usb_request *_req)
+{
+	struct goku_request	*req;
+	struct goku_ep		*ep;
+	struct goku_udc		*dev;
+	unsigned long		flags;
+
+	ep = container_of(_ep, struct goku_ep, ep);
+	if (!_ep || !_req || (!ep->desc && ep->num != 0))
+		return -EINVAL;
+	dev = ep->dev;
+	if (!dev->driver)
+		return -ESHUTDOWN;
+
+	/* we can't touch (dma) registers when suspended */
+	if (dev->ep0state == EP0_SUSPEND)
+		return -EBUSY;
+
+	VDBG(dev, "%s %s %s %s %p\n", __FUNCTION__, _ep->name,
+		ep->is_in ? "IN" : "OUT",
+		ep->dma ? "dma" : "pio",
+		_req);
+
+	spin_lock_irqsave(&dev->lock, flags);
+
+	/* make sure it's actually queued on this endpoint */
+	list_for_each_entry (req, &ep->queue, queue) {
+		if (&req->req == _req)
+			break;
+	}
+	if (&req->req != _req) {
+		spin_unlock_irqrestore (&dev->lock, flags);
+		return -EINVAL;
+	}
+
+	if (ep->dma && ep->queue.next == &req->queue && !ep->stopped) {
+		abort_dma(ep, -ECONNRESET);
+		done(ep, req, -ECONNRESET);
+		dma_advance(dev, ep);
+	} else if (!list_empty(&req->queue))
+		done(ep, req, -ECONNRESET);
+	else
+		req = 0;
+	spin_unlock_irqrestore(&dev->lock, flags);
+
+	return req ? 0 : -EOPNOTSUPP;
+}
+
+/*-------------------------------------------------------------------------*/
+
+static void goku_clear_halt(struct goku_ep *ep)
+{
+	// assert (ep->num !=0)
+	VDBG(ep->dev, "%s clear halt\n", ep->ep.name);
+	command(ep->dev->regs, COMMAND_SETDATA0, ep->num);
+	command(ep->dev->regs, COMMAND_STALL_CLEAR, ep->num);
+	if (ep->stopped) {
+		ep->stopped = 0;
+		if (ep->dma) {
+			struct goku_request	*req;
+
+			if (list_empty(&ep->queue))
+				return;
+			req = list_entry(ep->queue.next, struct goku_request,
+						queue);
+			(void) start_dma(ep, req);
+		} else
+			pio_advance(ep);
+	}
+}
+
+static int goku_set_halt(struct usb_ep *_ep, int value)
+{
+	struct goku_ep	*ep;
+	unsigned long	flags;
+	int		retval = 0;
+
+	if (!_ep)
+		return -ENODEV;
+	ep = container_of (_ep, struct goku_ep, ep);
+
+	if (ep->num == 0) {
+		if (value) {
+			ep->dev->ep0state = EP0_STALL;
+			ep->dev->ep[0].stopped = 1;
+		} else
+			return -EINVAL;
+
+	/* don't change EPxSTATUS_EP_INVALID to READY */
+	} else if (!ep->desc) {
+		DBG(ep->dev, "%s %s inactive?\n", __FUNCTION__, ep->ep.name);
+		return -EINVAL;
+	}
+
+	spin_lock_irqsave(&ep->dev->lock, flags);
+	if (!list_empty(&ep->queue))
+		retval = -EAGAIN;
+	else if (ep->is_in && value
+			/* data in (either) packet buffer? */
+			&& (ep->dev->regs->DataSet & DATASET_AB(ep->num)))
+		retval = -EAGAIN;
+	else if (!value)
+		goku_clear_halt(ep);
+	else {
+		ep->stopped = 1;
+		VDBG(ep->dev, "%s set halt\n", ep->ep.name);
+		command(ep->dev->regs, COMMAND_STALL, ep->num);
+		readl(ep->reg_status);
+	}
+	spin_unlock_irqrestore(&ep->dev->lock, flags);
+	return retval;
+}
+
+static int goku_fifo_status(struct usb_ep *_ep)
+{
+	struct goku_ep		*ep;
+	struct goku_udc_regs	*regs;
+	u32			size;
+
+	if (!_ep)
+		return -ENODEV;
+	ep = container_of(_ep, struct goku_ep, ep);
+
+	/* size is only reported sanely for OUT */
+	if (ep->is_in)
+		return -EOPNOTSUPP;
+
+	/* ignores 16-byte dma buffer; SizeH == 0 */
+	regs = ep->dev->regs;
+	size = readl(&regs->EPxSizeLA[ep->num]) & DATASIZE;
+	size += readl(&regs->EPxSizeLB[ep->num]) & DATASIZE;
+	VDBG(ep->dev, "%s %s %u\n", __FUNCTION__, ep->ep.name, size);
+	return size;
+}
+
+static void goku_fifo_flush(struct usb_ep *_ep)
+{
+	struct goku_ep		*ep;
+	struct goku_udc_regs	*regs;
+	u32			size;
+
+	if (!_ep)
+		return;
+	ep = container_of(_ep, struct goku_ep, ep);
+	VDBG(ep->dev, "%s %s\n", __FUNCTION__, ep->ep.name);
+
+	/* don't change EPxSTATUS_EP_INVALID to READY */
+	if (!ep->desc && ep->num != 0) {
+		DBG(ep->dev, "%s %s inactive?\n", __FUNCTION__, ep->ep.name);
+		return;
+	}
+
+	regs = ep->dev->regs;
+	size = readl(&regs->EPxSizeLA[ep->num]);
+	size &= DATASIZE;
+
+	/* Non-desirable behavior:  FIFO_CLEAR also clears the
+	 * endpoint halt feature.  For OUT, we _could_ just read
+	 * the bytes out (PIO, if !ep->dma); for in, no choice.
+	 */
+	if (size)
+		command(regs, COMMAND_FIFO_CLEAR, ep->num);
+}
+
+static struct usb_ep_ops goku_ep_ops = {
+	.enable		= goku_ep_enable,
+	.disable	= goku_ep_disable,
+
+	.alloc_request	= goku_alloc_request,
+	.free_request	= goku_free_request,
+
+	.alloc_buffer	= goku_alloc_buffer,
+	.free_buffer	= goku_free_buffer,
+
+	.queue		= goku_queue,
+	.dequeue	= goku_dequeue,
+
+	.set_halt	= goku_set_halt,
+	.fifo_status	= goku_fifo_status,
+	.fifo_flush	= goku_fifo_flush,
+};
+
+/*-------------------------------------------------------------------------*/
+
+static int goku_get_frame(struct usb_gadget *_gadget)
+{
+	return -EOPNOTSUPP;
+}
+
+static const struct usb_gadget_ops goku_ops = {
+	.get_frame	= goku_get_frame,
+	// no remote wakeup
+	// not selfpowered
+};
+
+/*-------------------------------------------------------------------------*/
+
+static inline char *dmastr(void)
+{
+	if (use_dma == 0)
+		return "(dma disabled)";
+	else if (use_dma == 2)
+		return "(dma IN and OUT)";
+	else
+		return "(dma IN)";
+}
+
+/* if we're trying to save space, don't bother with this proc file */
+
+#if defined(CONFIG_PROC_FS) && !defined(CONFIG_EMBEDDED)
+#  define	UDC_PROC_FILE
+#endif
+
+#ifdef UDC_PROC_FILE
+
+static const char proc_node_name [] = "driver/udc";
+
+#define FOURBITS "%s%s%s%s"
+#define EIGHTBITS FOURBITS FOURBITS
+
+static void
+dump_intmask(const char *label, u32 mask, char **next, unsigned *size)
+{
+	int t;
+
+	/* int_status is the same format ... */
+	t = snprintf(*next, *size,
+		"%s %05X =" FOURBITS EIGHTBITS EIGHTBITS "\n",
+		label, mask,
+		(mask & INT_PWRDETECT) ? " power" : "",
+		(mask & INT_SYSERROR) ? " sys" : "",
+		(mask & INT_MSTRDEND) ? " in-dma" : "",
+		(mask & INT_MSTWRTMOUT) ? " wrtmo" : "",
+
+		(mask & INT_MSTWREND) ? " out-dma" : "",
+		(mask & INT_MSTWRSET) ? " wrset" : "",
+		(mask & INT_ERR) ? " err" : "",
+		(mask & INT_SOF) ? " sof" : "",
+
+		(mask & INT_EP3NAK) ? " ep3nak" : "",
+		(mask & INT_EP2NAK) ? " ep2nak" : "",
+		(mask & INT_EP1NAK) ? " ep1nak" : "",
+		(mask & INT_EP3DATASET) ? " ep3" : "",
+
+		(mask & INT_EP2DATASET) ? " ep2" : "",
+		(mask & INT_EP1DATASET) ? " ep1" : "",
+		(mask & INT_STATUSNAK) ? " ep0snak" : "",
+		(mask & INT_STATUS) ? " ep0status" : "",
+
+		(mask & INT_SETUP) ? " setup" : "",
+		(mask & INT_ENDPOINT0) ? " ep0" : "",
+		(mask & INT_USBRESET) ? " reset" : "",
+		(mask & INT_SUSPEND) ? " suspend" : "");
+	*size -= t;
+	*next += t;
+}
+
+
+static int
+udc_proc_read(char *buffer, char **start, off_t off, int count,
+		int *eof, void *_dev)
+{
+	char			*buf = buffer;
+	struct goku_udc		*dev = _dev;
+	struct goku_udc_regs	*regs = dev->regs;
+	char			*next = buf;
+	unsigned		size = count;
+	unsigned long		flags;
+	int			i, t, is_usb_connected;
+	u32			tmp;
+
+	if (off != 0)
+		return 0;
+
+	local_irq_save(flags);
+
+	/* basic device status */
+	tmp = readl(&regs->power_detect);
+	is_usb_connected = tmp & PW_DETECT;
+	t = snprintf(next, size,
+		"%s - %s\n"
+		"%s version: %s %s\n"
+		"Gadget driver: %s\n"
+		"Host %s, %s\n"
+		"\n",
+		pci_name(dev->pdev), driver_desc,
+		driver_name, DRIVER_VERSION, dmastr(),
+		dev->driver ? dev->driver->driver.name : "(none)",
+		is_usb_connected
+			? ((tmp & PW_PULLUP) ? "full speed" : "powered")
+			: "disconnected",
+		({char *tmp;
+		switch(dev->ep0state){
+		case EP0_DISCONNECT:	tmp = "ep0_disconnect"; break;
+		case EP0_IDLE:		tmp = "ep0_idle"; break;
+		case EP0_IN:		tmp = "ep0_in"; break;
+		case EP0_OUT:		tmp = "ep0_out"; break;
+		case EP0_STATUS:	tmp = "ep0_status"; break;
+		case EP0_STALL:		tmp = "ep0_stall"; break;
+		case EP0_SUSPEND:	tmp = "ep0_suspend"; break;
+		default:		tmp = "ep0_?"; break;
+		} tmp; })
+		);
+	size -= t;
+	next += t;
+
+	dump_intmask("int_status", readl(&regs->int_status), &next, &size);
+	dump_intmask("int_enable", readl(&regs->int_enable), &next, &size);
+
+	if (!is_usb_connected || !dev->driver || (tmp & PW_PULLUP) == 0)
+		goto done;
+
+	/* registers for (active) device and ep0 */
+	t = snprintf(next, size, "\nirqs %lu\ndataset %02x "
+			"single.bcs %02x.%02x state %x addr %u\n",
+			dev->irqs, readl(&regs->DataSet),
+			readl(&regs->EPxSingle), readl(&regs->EPxBCS),
+			readl(&regs->UsbState),
+			readl(&regs->address));
+	size -= t;
+	next += t;
+
+	tmp = readl(&regs->dma_master);
+	t = snprintf(next, size,
+		"dma %03X =" EIGHTBITS "%s %s\n", tmp,
+		(tmp & MST_EOPB_DIS) ? " eopb-" : "",
+		(tmp & MST_EOPB_ENA) ? " eopb+" : "",
+		(tmp & MST_TIMEOUT_DIS) ? " tmo-" : "",
+		(tmp & MST_TIMEOUT_ENA) ? " tmo+" : "",
+
+		(tmp & MST_RD_EOPB) ? " eopb" : "",
+		(tmp & MST_RD_RESET) ? " in_reset" : "",
+		(tmp & MST_WR_RESET) ? " out_reset" : "",
+		(tmp & MST_RD_ENA) ? " IN" : "",
+
+		(tmp & MST_WR_ENA) ? " OUT" : "",
+		(tmp & MST_CONNECTION)
+			? "ep1in/ep2out"
+			: "ep1out/ep2in");
+	size -= t;
+	next += t;
+
+	/* dump endpoint queues */
+	for (i = 0; i < 4; i++) {
+		struct goku_ep		*ep = &dev->ep [i];
+		struct goku_request	*req;
+		int			t;
+
+		if (i && !ep->desc)
+			continue;
+
+		tmp = readl(ep->reg_status);
+		t = snprintf(next, size,
+			"%s %s max %u %s, irqs %lu, "
+			"status %02x (%s) " FOURBITS "\n",
+			ep->ep.name,
+			ep->is_in ? "in" : "out",
+			ep->ep.maxpacket,
+			ep->dma ? "dma" : "pio",
+			ep->irqs,
+			tmp, ({ char *s;
+			switch (tmp & EPxSTATUS_EP_MASK) {
+			case EPxSTATUS_EP_READY:
+				s = "ready"; break;
+			case EPxSTATUS_EP_DATAIN:
+				s = "packet"; break;
+			case EPxSTATUS_EP_FULL:
+				s = "full"; break;
+			case EPxSTATUS_EP_TX_ERR:	// host will retry
+				s = "tx_err"; break;
+			case EPxSTATUS_EP_RX_ERR:
+				s = "rx_err"; break;
+			case EPxSTATUS_EP_BUSY:		/* ep0 only */
+				s = "busy"; break;
+			case EPxSTATUS_EP_STALL:
+				s = "stall"; break;
+			case EPxSTATUS_EP_INVALID:	// these "can't happen"
+				s = "invalid"; break;
+			default:
+				s = "?"; break;
+			}; s; }),
+			(tmp & EPxSTATUS_TOGGLE) ? "data1" : "data0",
+			(tmp & EPxSTATUS_SUSPEND) ? " suspend" : "",
+			(tmp & EPxSTATUS_FIFO_DISABLE) ? " disable" : "",
+			(tmp & EPxSTATUS_STAGE_ERROR) ? " ep0stat" : ""
+			);
+		if (t <= 0 || t > size)
+			goto done;
+		size -= t;
+		next += t;
+
+		if (list_empty(&ep->queue)) {
+			t = snprintf(next, size, "\t(nothing queued)\n");
+			if (t <= 0 || t > size)
+				goto done;
+			size -= t;
+			next += t;
+			continue;
+		}
+		list_for_each_entry(req, &ep->queue, queue) {
+			if (ep->dma && req->queue.prev == &ep->queue) {
+				if (i == UDC_MSTRD_ENDPOINT)
+					tmp = readl(&regs->in_dma_current);
+				else
+					tmp = readl(&regs->out_dma_current);
+				tmp -= req->req.dma;
+				tmp++;
+			} else
+				tmp = req->req.actual;
+
+			t = snprintf(next, size,
+				"\treq %p len %u/%u buf %p\n",
+				&req->req, tmp, req->req.length,
+				req->req.buf);
+			if (t <= 0 || t > size)
+				goto done;
+			size -= t;
+			next += t;
+		}
+	}
+
+done:
+	local_irq_restore(flags);
+	*eof = 1;
+	return count - size;
+}
+
+#endif	/* UDC_PROC_FILE */
+
+/*-------------------------------------------------------------------------*/
+
+static void udc_reinit (struct goku_udc *dev)
+{
+	static char *names [] = { "ep0", "ep1-bulk", "ep2-bulk", "ep3-bulk" };
+	
+	unsigned i;
+
+	INIT_LIST_HEAD (&dev->gadget.ep_list);
+	dev->gadget.ep0 = &dev->ep [0].ep;
+	dev->gadget.speed = USB_SPEED_UNKNOWN;
+	dev->ep0state = EP0_DISCONNECT;
+	dev->irqs = 0;
+
+	for (i = 0; i < 4; i++) {
+		struct goku_ep	*ep = &dev->ep[i];
+
+		ep->num = i;
+		ep->ep.name = names[i];
+		ep->reg_fifo = &dev->regs->ep_fifo [i];
+		ep->reg_status = &dev->regs->ep_status [i];
+		ep->reg_mode = &dev->regs->ep_mode[i];
+
+		ep->ep.ops = &goku_ep_ops;
+		list_add_tail (&ep->ep.ep_list, &dev->gadget.ep_list);
+		ep->dev = dev;
+		INIT_LIST_HEAD (&ep->queue);
+
+		ep_reset(0, ep);
+	}
+
+	dev->ep[0].reg_mode = 0;
+	dev->ep[0].ep.maxpacket = MAX_EP0_SIZE;
+	list_del_init (&dev->ep[0].ep.ep_list);
+}
+
+static void udc_reset(struct goku_udc *dev)
+{
+	struct goku_udc_regs	*regs = dev->regs;
+
+	writel(0, &regs->power_detect);
+	writel(0, &regs->int_enable);
+	readl(&regs->int_enable);
+	dev->int_enable = 0;
+
+	/* deassert reset, leave USB D+ at hi-Z (no pullup)
+	 * don't let INT_PWRDETECT sequence begin
+	 */
+	udelay(250);
+	writel(PW_RESETB, &regs->power_detect);
+	readl(&regs->int_enable);
+}
+
+static void ep0_start(struct goku_udc *dev)
+{
+	struct goku_udc_regs	*regs = dev->regs;
+	unsigned		i;
+
+	VDBG(dev, "%s\n", __FUNCTION__);
+
+	udc_reset(dev);
+	udc_reinit (dev);
+	//writel(MST_EOPB_ENA | MST_TIMEOUT_ENA, &regs->dma_master);
+
+	/* hw handles set_address, set_feature, get_status; maybe more */
+	writel(   G_REQMODE_SET_INTF | G_REQMODE_GET_INTF
+		| G_REQMODE_SET_CONF | G_REQMODE_GET_CONF
+		| G_REQMODE_GET_DESC
+		| G_REQMODE_CLEAR_FEAT
+		, &regs->reqmode);
+
+	for (i = 0; i < 4; i++)
+		dev->ep[i].irqs = 0;
+
+	/* can't modify descriptors after writing UsbReady */
+	for (i = 0; i < DESC_LEN; i++)
+		writel(0, &regs->descriptors[i]);
+	writel(0, &regs->UsbReady);
+
+	/* expect ep0 requests when the host drops reset */
+	writel(PW_RESETB | PW_PULLUP, &regs->power_detect);
+	dev->int_enable = INT_DEVWIDE | INT_EP0;
+	writel(dev->int_enable, &dev->regs->int_enable);
+	readl(&regs->int_enable);
+	dev->gadget.speed = USB_SPEED_FULL;
+	dev->ep0state = EP0_IDLE;
+}
+
+static void udc_enable(struct goku_udc *dev)
+{
+	/* start enumeration now, or after power detect irq */
+	if (readl(&dev->regs->power_detect) & PW_DETECT)
+		ep0_start(dev);
+	else {
+		DBG(dev, "%s\n", __FUNCTION__);
+		dev->int_enable = INT_PWRDETECT;
+		writel(dev->int_enable, &dev->regs->int_enable);
+	}
+}
+
+/*-------------------------------------------------------------------------*/
+
+/* keeping it simple:
+ * - one bus driver, initted first;
+ * - one function driver, initted second
+ */
+
+static struct goku_udc	*the_controller;
+
+/* when a driver is successfully registered, it will receive
+ * control requests including set_configuration(), which enables
+ * non-control requests.  then usb traffic follows until a
+ * disconnect is reported.  then a host may connect again, or
+ * the driver might get unbound.
+ */
+int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+{
+	struct goku_udc	*dev = the_controller;
+	int			retval;
+
+	if (!driver
+			|| driver->speed != USB_SPEED_FULL
+			|| !driver->bind
+			|| !driver->unbind
+			|| !driver->disconnect
+			|| !driver->setup)
+		return -EINVAL;
+	if (!dev)
+		return -ENODEV;
+	if (dev->driver)
+		return -EBUSY;
+
+	/* hook up the driver */
+	driver->driver.bus = 0;
+	dev->driver = driver;
+	dev->gadget.dev.driver = &driver->driver;
+	retval = driver->bind(&dev->gadget);
+	if (retval) {
+		DBG(dev, "bind to driver %s --> error %d\n",
+				driver->driver.name, retval);
+		dev->driver = 0;
+		dev->gadget.dev.driver = 0;
+		return retval;
+	}
+
+	/* then enable host detection and ep0; and we're ready
+	 * for set_configuration as well as eventual disconnect.
+	 */
+	udc_enable(dev);
+
+	DBG(dev, "registered gadget driver '%s'\n", driver->driver.name);
+	return 0;
+}
+EXPORT_SYMBOL(usb_gadget_register_driver);
+
+static void
+stop_activity(struct goku_udc *dev, struct usb_gadget_driver *driver)
+{
+	unsigned	i;
+
+	DBG (dev, "%s\n", __FUNCTION__);
+
+	if (dev->gadget.speed == USB_SPEED_UNKNOWN)
+		driver = 0;
+
+	/* disconnect gadget driver after quiesceing hw and the driver */
+	udc_reset (dev);
+	for (i = 0; i < 4; i++)
+		nuke(&dev->ep [i], -ESHUTDOWN);
+	if (driver) {
+		spin_unlock(&dev->lock);
+		driver->disconnect(&dev->gadget);
+		spin_lock(&dev->lock);
+	}
+
+	if (dev->driver)
+		udc_enable(dev);
+}
+
+int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
+{
+	struct goku_udc	*dev = the_controller;
+	unsigned long	flags;
+
+	if (!dev)
+		return -ENODEV;
+	if (!driver || driver != dev->driver)
+		return -EINVAL;
+
+	spin_lock_irqsave(&dev->lock, flags);
+	dev->driver = 0;
+	stop_activity(dev, driver);
+	spin_unlock_irqrestore(&dev->lock, flags);
+
+	driver->unbind(&dev->gadget);
+
+	DBG(dev, "unregistered driver '%s'\n", driver->driver.name);
+	return 0;
+}
+EXPORT_SYMBOL(usb_gadget_unregister_driver);
+
+
+/*-------------------------------------------------------------------------*/
+
+static void ep0_setup(struct goku_udc *dev)
+{
+	struct goku_udc_regs	*regs = dev->regs;
+	struct usb_ctrlrequest	ctrl;
+	int			tmp;
+
+	/* read SETUP packet and enter DATA stage */
+	ctrl.bRequestType = readl(&regs->bRequestType);
+	ctrl.bRequest = readl(&regs->bRequest);
+	ctrl.wValue  = (readl(&regs->wValueH)  << 8) | readl(&regs->wValueL);
+	ctrl.wIndex  = (readl(&regs->wIndexH)  << 8) | readl(&regs->wIndexL);
+	ctrl.wLength = (readl(&regs->wLengthH) << 8) | readl(&regs->wLengthL);
+	writel(0, &regs->SetupRecv);
+
+	nuke(&dev->ep[0], 0);
+	dev->ep[0].stopped = 0;
+	if (likely(ctrl.bRequestType & USB_DIR_IN)) {
+		dev->ep[0].is_in = 1;
+		dev->ep0state = EP0_IN;
+		/* detect early status stages */
+		writel(ICONTROL_STATUSNAK, &dev->regs->IntControl);
+	} else {
+		dev->ep[0].is_in = 0;
+		dev->ep0state = EP0_OUT;
+
+		/* NOTE:  CLEAR_FEATURE is done in software so that we can
+		 * synchronize transfer restarts after bulk IN stalls.  data
+		 * won't even enter the fifo until the halt is cleared.
+		 */
+		switch (ctrl.bRequest) {
+		case USB_REQ_CLEAR_FEATURE:
+			switch (ctrl.bRequestType) {
+			case USB_RECIP_ENDPOINT:
+				tmp = ctrl.wIndex & 0x0f;
+				/* active endpoint */
+				if (tmp > 3 || (!dev->ep[tmp].desc && tmp != 0))
+					goto stall;
+				if (ctrl.wIndex & USB_DIR_IN) {
+					if (!dev->ep[tmp].is_in)
+						goto stall;
+				} else {
+					if (dev->ep[tmp].is_in)
+						goto stall;
+				}
+				/* endpoint halt */
+				if (ctrl.wValue != 0)
+					goto stall;
+				if (tmp)
+					goku_clear_halt(&dev->ep[tmp]);
+succeed:
+				/* start ep0out status stage */
+				writel(~(1<<0), &regs->EOP);
+				dev->ep[0].stopped = 1;
+				dev->ep0state = EP0_STATUS;
+				return;
+			case USB_RECIP_DEVICE:
+				/* device remote wakeup: always clear */
+				if (ctrl.wValue != 1)
+					goto stall;
+				VDBG(dev, "clear dev remote wakeup\n");
+				goto succeed;
+			case USB_RECIP_INTERFACE:
+				goto stall;
+			default:		/* pass to gadget driver */
+				break;
+			}
+			break;
+		default:
+			break;
+		}
+	}
+
+#ifdef USB_TRACE
+	VDBG(dev, "SETUP %02x.%02x v%04x i%04x l%04x\n",
+		ctrl.bRequestType, ctrl.bRequest,
+		ctrl.wValue, ctrl.wIndex, ctrl.wLength);
+#endif
+
+	/* hw wants to know when we're configured (or not) */
+	dev->req_config = (ctrl.bRequest == USB_REQ_SET_CONFIGURATION
+				&& ctrl.bRequestType == USB_RECIP_DEVICE);
+	if (unlikely(dev->req_config))
+		dev->configured = (ctrl.wValue != 0);
+
+	/* delegate everything to the gadget driver.
+	 * it may respond after this irq handler returns.
+	 */
+	spin_unlock (&dev->lock);
+	tmp = dev->driver->setup(&dev->gadget, &ctrl);
+	spin_lock (&dev->lock);
+	if (unlikely(tmp < 0)) {
+stall:
+#ifdef USB_TRACE
+		VDBG(dev, "req %02x.%02x protocol STALL; err %d\n",
+				ctrl.bRequestType, ctrl.bRequest, tmp);
+#endif
+		command(regs, COMMAND_STALL, 0);
+		dev->ep[0].stopped = 1;
+		dev->ep0state = EP0_STALL;
+	}
+
+	/* expect at least one data or status stage irq */
+}
+
+#define ACK(irqbit) { \
+		stat &= ~irqbit; \
+		writel(~irqbit, &regs->int_status); \
+		handled = 1; \
+		}
+
+static irqreturn_t goku_irq(int irq, void *_dev, struct pt_regs *r)
+{
+	struct goku_udc		*dev = _dev;
+	struct goku_udc_regs	*regs = dev->regs;
+	struct goku_ep		*ep;
+	u32			stat, handled = 0;
+	unsigned		i, rescans = 5;
+
+	spin_lock(&dev->lock);
+
+rescan:
+	stat = readl(&regs->int_status) & dev->int_enable;
+        if (!stat)
+		goto done;
+	dev->irqs++;
+
+	/* device-wide irqs */
+	if (unlikely(stat & INT_DEVWIDE)) {
+		if (stat & INT_SYSERROR) {
+			ERROR(dev, "system error\n");
+			stop_activity(dev, dev->driver);
+			stat = 0;
+			handled = 1;
+			// FIXME have a neater way to prevent re-enumeration
+			dev->driver = 0;
+			goto done;
+		}
+		if (stat & INT_PWRDETECT) {
+			writel(~stat, &regs->int_status);
+			if (readl(&dev->regs->power_detect) & PW_DETECT) {
+				VDBG(dev, "connect\n");
+				ep0_start(dev);
+			} else {
+				DBG(dev, "disconnect\n");
+				if (dev->gadget.speed == USB_SPEED_FULL)
+					stop_activity(dev, dev->driver);
+				dev->ep0state = EP0_DISCONNECT;
+				dev->int_enable = INT_DEVWIDE;
+				writel(dev->int_enable, &dev->regs->int_enable);
+			}
+			stat = 0;
+			handled = 1;
+			goto done;
+		}
+		if (stat & INT_SUSPEND) {
+			ACK(INT_SUSPEND);
+			if (readl(&regs->ep_status[0]) & EPxSTATUS_SUSPEND) {
+				switch (dev->ep0state) {
+				case EP0_DISCONNECT:
+				case EP0_SUSPEND:
+					goto pm_next;
+				default:
+					break;
+				}
+				DBG(dev, "USB suspend\n");
+				dev->ep0state = EP0_SUSPEND;
+				if (dev->gadget.speed != USB_SPEED_UNKNOWN
+						&& dev->driver
+						&& dev->driver->suspend) {
+					spin_unlock(&dev->lock);
+					dev->driver->suspend(&dev->gadget);
+					spin_lock(&dev->lock);
+				}
+			} else {
+				if (dev->ep0state != EP0_SUSPEND) {
+					DBG(dev, "bogus USB resume %d\n",
+						dev->ep0state);
+					goto pm_next;
+				}
+				DBG(dev, "USB resume\n");
+				dev->ep0state = EP0_IDLE;
+				if (dev->gadget.speed != USB_SPEED_UNKNOWN
+						&& dev->driver
+						&& dev->driver->resume) {
+					spin_unlock(&dev->lock);
+					dev->driver->resume(&dev->gadget);
+					spin_lock(&dev->lock);
+				}
+			}
+		}
+pm_next:
+		if (stat & INT_USBRESET) {		/* hub reset done */
+			ACK(INT_USBRESET);
+			INFO(dev, "USB reset done, gadget %s\n",
+				dev->driver->driver.name);
+		}
+		// and INT_ERR on some endpoint's crc/bitstuff/... problem
+	}
+
+	/* progress ep0 setup, data, or status stages.
+	 * no transition {EP0_STATUS, EP0_STALL} --> EP0_IDLE; saves irqs
+	 */
+	if (stat & INT_SETUP) {
+		ACK(INT_SETUP);
+		dev->ep[0].irqs++;
+		ep0_setup(dev);
+	}
+        if (stat & INT_STATUSNAK) {
+		ACK(INT_STATUSNAK|INT_ENDPOINT0);
+		if (dev->ep0state == EP0_IN) {
+			ep = &dev->ep[0];
+			ep->irqs++;
+			nuke(ep, 0);
+			writel(~(1<<0), &regs->EOP);
+			dev->ep0state = EP0_STATUS;
+		}
+	}
+        if (stat & INT_ENDPOINT0) {
+		ACK(INT_ENDPOINT0);
+		ep = &dev->ep[0];
+		ep->irqs++;
+		pio_advance(ep);
+        }
+
+	/* dma completion */
+        if (stat & INT_MSTRDEND) {	/* IN */
+		ACK(INT_MSTRDEND);
+		ep = &dev->ep[UDC_MSTRD_ENDPOINT];
+		ep->irqs++;
+		dma_advance(dev, ep);
+        }
+        if (stat & INT_MSTWREND) {	/* OUT */
+		ACK(INT_MSTWREND);
+		ep = &dev->ep[UDC_MSTWR_ENDPOINT];
+		ep->irqs++;
+		dma_advance(dev, ep);
+        }
+        if (stat & INT_MSTWRTMOUT) {	/* OUT */
+		ACK(INT_MSTWRTMOUT);
+		ep = &dev->ep[UDC_MSTWR_ENDPOINT];
+		ep->irqs++;
+		ERROR(dev, "%s write timeout ?\n", ep->ep.name);
+		// reset dma? then dma_advance()
+        }
+
+	/* pio */
+	for (i = 1; i < 4; i++) {
+		u32		tmp = INT_EPxDATASET(i);
+
+		if (!(stat & tmp))
+			continue;
+		ep = &dev->ep[i];
+		pio_advance(ep);
+		if (list_empty (&ep->queue))
+			pio_irq_disable(dev, regs, i);
+		stat &= ~tmp;
+		handled = 1;
+		ep->irqs++;
+	}
+
+	if (rescans--)
+		goto rescan;
+
+done:
+	(void)readl(&regs->int_enable);
+	spin_unlock(&dev->lock);
+	if (stat)
+		DBG(dev, "unhandled irq status: %05x (%05x, %05x)\n", stat,
+				readl(&regs->int_status), dev->int_enable);
+	return IRQ_RETVAL(handled);
+}
+
+#undef ACK
+
+/*-------------------------------------------------------------------------*/
+
+static void gadget_release(struct device *_dev)
+{
+	struct goku_udc	*dev = dev_get_drvdata(_dev);
+
+	kfree(dev);
+}
+
+/* tear down the binding between this driver and the pci device */
+
+static void goku_remove(struct pci_dev *pdev)
+{
+	struct goku_udc		*dev = pci_get_drvdata(pdev);
+
+	DBG(dev, "%s\n", __FUNCTION__);
+	/* start with the driver above us */
+	if (dev->driver) {
+		/* should have been done already by driver model core */
+		WARN(dev, "pci remove, driver '%s' is still registered\n",
+				dev->driver->driver.name);
+		usb_gadget_unregister_driver(dev->driver);
+	}
+
+#ifdef	UDC_PROC_FILE
+	remove_proc_entry(proc_node_name, NULL);
+#endif
+	if (dev->regs)
+		udc_reset(dev);
+	if (dev->got_irq)
+		free_irq(pdev->irq, dev);
+	if (dev->regs)
+		iounmap(dev->regs);
+	if (dev->got_region)
+		release_mem_region(pci_resource_start (pdev, 0),
+				pci_resource_len (pdev, 0));
+	if (dev->enabled)
+		pci_disable_device(pdev);
+	device_unregister(&dev->gadget.dev);
+
+	pci_set_drvdata(pdev, 0);
+	dev->regs = 0;
+	the_controller = 0;
+
+	INFO(dev, "unbind\n");
+}
+
+/* wrap this driver around the specified pci device, but
+ * don't respond over USB until a gadget driver binds to us.
+ */
+
+static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+{
+	struct goku_udc		*dev = 0;
+	unsigned long		resource, len;
+	void			*base = 0;
+	int			retval;
+	char			buf [8], *bufp;
+
+	/* if you want to support more than one controller in a system,
+	 * usb_gadget_driver_{register,unregister}() must change.
+	 */
+	if (the_controller) {
+		WARN(dev, "ignoring %s\n", pci_name(pdev));
+		return -EBUSY;
+	}
+	if (!pdev->irq) {
+		printk(KERN_ERR "Check PCI %s IRQ setup!\n", pci_name(pdev));
+		retval = -ENODEV;
+		goto done;
+	}
+
+	/* alloc, and start init */
+	dev = kmalloc (sizeof *dev, SLAB_KERNEL);
+	if (dev == NULL){
+		pr_debug("enomem %s\n", pci_name(pdev));
+		retval = -ENOMEM;
+		goto done;
+	}
+
+	memset(dev, 0, sizeof *dev);
+	spin_lock_init(&dev->lock);
+	dev->pdev = pdev;
+	dev->gadget.ops = &goku_ops;
+
+	/* the "gadget" abstracts/virtualizes the controller */
+	strcpy(dev->gadget.dev.bus_id, "gadget");
+	dev->gadget.dev.parent = &pdev->dev;
+	dev->gadget.dev.dma_mask = pdev->dev.dma_mask;
+	dev->gadget.dev.release = gadget_release;
+	dev->gadget.name = driver_name;
+
+	/* now all the pci goodies ... */
+	retval = pci_enable_device(pdev);
+	if (retval < 0) {
+		DBG(dev, "can't enable, %d\n", retval);
+		goto done;
+	}
+	dev->enabled = 1;
+
+	resource = pci_resource_start(pdev, 0);
+	len = pci_resource_len(pdev, 0);
+	if (!request_mem_region(resource, len, driver_name)) {
+		DBG(dev, "controller already in use\n");
+		retval = -EBUSY;
+		goto done;
+	}
+	dev->got_region = 1;
+
+	base = ioremap_nocache(resource, len);
+	if (base == NULL) {
+		DBG(dev, "can't map memory\n");
+		retval = -EFAULT;
+		goto done;
+	}
+	dev->regs = (struct goku_udc_regs *) base;
+
+	pci_set_drvdata(pdev, dev);
+	INFO(dev, "%s\n", driver_desc);
+	INFO(dev, "version: " DRIVER_VERSION " %s\n", dmastr());
+#ifndef __sparc__
+	snprintf(buf, sizeof buf, "%d", pdev->irq);
+	bufp = buf;
+#else
+	bufp = __irq_itoa(pdev->irq);
+#endif
+	INFO(dev, "irq %s, pci mem %p\n", bufp, base);
+
+	/* init to known state, then setup irqs */
+	udc_reset(dev);
+	udc_reinit (dev);
+	if (request_irq(pdev->irq, goku_irq, SA_SHIRQ/*|SA_SAMPLE_RANDOM*/,
+			driver_name, dev) != 0) {
+		DBG(dev, "request interrupt %s failed\n", bufp);
+		retval = -EBUSY;
+		goto done;
+	}
+	dev->got_irq = 1;
+	if (use_dma)
+		pci_set_master(pdev);
+
+
+#ifdef	UDC_PROC_FILE
+	create_proc_read_entry(proc_node_name, 0, NULL, udc_proc_read, dev);
+#endif
+
+	/* done */
+	the_controller = dev;
+	device_register(&dev->gadget.dev);
+
+	return 0;
+
+done:
+	if (dev)
+		goku_remove (pdev);
+	return retval;
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+static struct pci_device_id pci_ids [] = { {
+	.class = 	((PCI_CLASS_SERIAL_USB << 8) | 0xfe),
+	.class_mask = 	~0,
+	.vendor =	0x102f,		/* Toshiba */
+	.device =	0x0107,		/* this UDC */
+	.subvendor =	PCI_ANY_ID,
+	.subdevice =	PCI_ANY_ID,
+
+}, { /* end: all zeroes */ }
+};
+MODULE_DEVICE_TABLE (pci, pci_ids);
+
+static struct pci_driver goku_pci_driver = {
+	.name =		(char *) driver_name,
+	.id_table =	pci_ids,
+
+	.probe =	goku_probe,
+	.remove =	goku_remove,
+
+	/* FIXME add power management support */
+};
+
+static int __init init (void)
+{
+	return pci_module_init (&goku_pci_driver);
+}
+module_init (init);
+
+static void __exit cleanup (void)
+{
+	pci_unregister_driver (&goku_pci_driver);
+}
+module_exit (cleanup);
diff -Nru a/drivers/usb/gadget/goku_udc.h b/drivers/usb/gadget/goku_udc.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/usb/gadget/goku_udc.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,290 @@
+/*
+ * Toshiba TC86C001 ("Goku-S") USB Device Controller driver
+ *
+ * Copyright (C) 2000-2002 Lineo
+ *      by Stuart Lynne, Tom Rushworth, and Bruce Balden
+ * Copyright (C) 2002 Toshiba Corporation
+ * Copyright (C) 2003 MontaVista Software (source@mvista.com)
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+/*
+ * PCI BAR 0 points to these registers.
+ */
+struct goku_udc_regs {
+	/* irq management */
+	u32	int_status;		/* 0x000 */
+	u32	int_enable;
+#define INT_SUSPEND		0x00001		/* or resume */
+#define INT_USBRESET		0x00002
+#define INT_ENDPOINT0		0x00004
+#define INT_SETUP		0x00008
+#define INT_STATUS		0x00010
+#define INT_STATUSNAK		0x00020
+#define INT_EPxDATASET(n)	(0x00020 << (n))	/* 0 < n < 4 */
+#	define INT_EP1DATASET		0x00040
+#	define INT_EP2DATASET		0x00080
+#	define INT_EP3DATASET		0x00100
+#define INT_EPnNAK(n)		(0x00100 < (n))		/* 0 < n < 4 */
+#	define INT_EP1NAK		0x00200
+#	define INT_EP2NAK		0x00400
+#	define INT_EP3NAK		0x00800
+#define INT_SOF			0x01000
+#define INT_ERR			0x02000
+#define INT_MSTWRSET		0x04000
+#define INT_MSTWREND		0x08000
+#define INT_MSTWRTMOUT		0x10000
+#define INT_MSTRDEND		0x20000
+#define INT_SYSERROR		0x40000
+#define INT_PWRDETECT		0x80000
+
+#define	INT_DEVWIDE		(INT_PWRDETECT|INT_SYSERROR/*|INT_ERR*/|INT_USBRESET|INT_SUSPEND)
+#define	INT_EP0 		(INT_SETUP|INT_ENDPOINT0/*|INT_STATUS*/|INT_STATUSNAK)
+
+	u32	dma_master;
+#define MST_EOPB_DIS		0x0800
+#define MST_EOPB_ENA		0x0400
+#define MST_TIMEOUT_DIS		0x0200
+#define MST_TIMEOUT_ENA		0x0100
+#define MST_RD_EOPB		0x0080		/* write-only */
+#define MST_RD_RESET		0x0040
+#define MST_WR_RESET		0x0020
+#define MST_RD_ENA		0x0004		/* 1:start, 0:ignore */
+#define MST_WR_ENA		0x0002		/* 1:start, 0:ignore */
+#define MST_CONNECTION		0x0001		/* 0 for ep1out/ep2in */
+
+#define MST_R_BITS		(MST_EOPB_DIS|MST_EOPB_ENA \
+					|MST_RD_ENA|MST_RD_RESET)
+#define MST_W_BITS		(MST_TIMEOUT_DIS|MST_TIMEOUT_ENA \
+					|MST_WR_ENA|MST_WR_RESET)
+#define MST_RW_BITS		(MST_R_BITS|MST_W_BITS \
+					|MST_CONNECTION)
+
+/* these values assume (dma_master & MST_CONNECTION) == 0 */
+#define UDC_MSTWR_ENDPOINT        1
+#define UDC_MSTRD_ENDPOINT        2
+
+	/* dma master write */
+	u32	out_dma_start;
+	u32	out_dma_end;
+	u32	out_dma_current;
+
+	/* dma master read */
+	u32	in_dma_start;
+	u32	in_dma_end;
+	u32	in_dma_current;
+
+	u32	power_detect;
+#define PW_DETECT		0x04
+#define PW_RESETB		0x02
+#define PW_PULLUP		0x01
+
+	u8	_reserved0 [0x1d8];
+
+	/* endpoint registers */
+	u32	ep_fifo [4];		/* 0x200 */
+	u8	_reserved1 [0x10];
+	u32	ep_mode [4];		/* only 1-3 valid */
+	u8	_reserved2 [0x10];
+
+	u32	ep_status [4];
+#define EPxSTATUS_TOGGLE	0x40
+#define EPxSTATUS_SUSPEND	0x20
+#define EPxSTATUS_EP_MASK	(0x07<<2)
+#	define EPxSTATUS_EP_READY	(0<<2)
+#	define EPxSTATUS_EP_DATAIN	(1<<2)
+#	define EPxSTATUS_EP_FULL	(2<<2)
+#	define EPxSTATUS_EP_TX_ERR	(3<<2)
+#	define EPxSTATUS_EP_RX_ERR	(4<<2)
+#	define EPxSTATUS_EP_BUSY	(5<<2)
+#	define EPxSTATUS_EP_STALL	(6<<2)
+#	define EPxSTATUS_EP_INVALID	(7<<2)
+#define EPxSTATUS_FIFO_DISABLE	0x02
+#define EPxSTATUS_STAGE_ERROR	0x01
+
+	u8	_reserved3 [0x10];
+	u32	EPxSizeLA[4];
+#define PACKET_ACTIVE		(1<<7)
+#define DATASIZE		0x7f
+	u8	_reserved3a [0x10];
+	u32	EPxSizeLB[4];		/* only 1,2 valid */
+	u8	_reserved3b [0x10];
+	u32	EPxSizeHA[4];		/* only 1-3 valid */
+	u8	_reserved3c [0x10];
+	u32	EPxSizeHB[4];		/* only 1,2 valid */
+	u8	_reserved4[0x30];
+
+	/* SETUP packet contents */
+	u32	bRequestType;		/* 0x300 */
+	u32	bRequest;
+	u32	wValueL;
+	u32	wValueH;
+	u32	wIndexL;
+	u32	wIndexH;
+	u32	wLengthL;
+	u32	wLengthH;
+
+	/* command interaction/handshaking */
+	u32	SetupRecv;		/* 0x320 */
+	u32	CurrConfig;
+	u32	StdRequest;
+	u32	Request;
+	u32	DataSet;
+#define DATASET_A(epnum)	(1<<(2*(epnum)))
+#define DATASET_B(epnum)	(2<<(2*(epnum)))
+#define DATASET_AB(epnum)	(3<<(2*(epnum)))
+	u8	_reserved5[4];
+
+	u32	UsbState;
+#define USBSTATE_CONFIGURED	0x04
+#define USBSTATE_ADDRESSED	0x02
+#define USBSTATE_DEFAULT	0x01
+
+	u32	EOP;
+
+	u32	Command;		/* 0x340 */
+#define COMMAND_SETDATA0	2
+#define COMMAND_RESET		3
+#define COMMAND_STALL		4
+#define COMMAND_INVALID		5
+#define COMMAND_FIFO_DISABLE	7
+#define COMMAND_FIFO_ENABLE	8
+#define COMMAND_INIT_DESCRIPTOR	9
+#define COMMAND_FIFO_CLEAR	10	/* also stall */
+#define COMMAND_STALL_CLEAR	11
+#define COMMAND_EP(n)		((n) << 4)
+
+	u32	EPxSingle;
+	u8	_reserved6[4];
+	u32	EPxBCS;
+	u8	_reserved7[8];
+	u32	IntControl;
+#define ICONTROL_STATUSNAK	1
+	u8	_reserved8[4];
+
+	u32	reqmode;	// 0x360 standard request mode, low 8 bits
+#define G_REQMODE_SET_INTF	(1<<7)
+#define G_REQMODE_GET_INTF	(1<<6)
+#define G_REQMODE_SET_CONF	(1<<5)
+#define G_REQMODE_GET_CONF	(1<<4)
+#define G_REQMODE_GET_DESC	(1<<3)
+#define G_REQMODE_SET_FEAT	(1<<2)
+#define G_REQMODE_CLEAR_FEAT	(1<<1)
+#define G_REQMODE_GET_STATUS	(1<<0)
+
+	u32	ReqMode;
+	u8	_reserved9[0x18];
+	u32	PortStatus;		/* 0x380 */
+	u8	_reserved10[8];
+	u32	address;
+	u32	buff_test;
+	u8	_reserved11[4];
+	u32	UsbReady;
+	u8	_reserved12[4];
+	u32	SetDescStall;		/* 0x3a0 */
+	u8	_reserved13[0x45c];
+
+	/* hardware could handle limited GET_DESCRIPTOR duties */
+#define	DESC_LEN	0x80
+	u32	descriptors[DESC_LEN];	/* 0x800 */
+	u8	_reserved14[0x600];
+
+} __attribute__ ((packed));
+
+#define	MAX_FIFO_SIZE	64
+#define	MAX_EP0_SIZE	8		/* ep0 fifo is bigger, though */
+
+
+/*-------------------------------------------------------------------------*/
+
+/* DRIVER DATA STRUCTURES and UTILITIES */
+
+struct goku_ep {
+	struct usb_ep				ep;
+	struct goku_udc				*dev;
+	unsigned long				irqs;
+
+	unsigned				num:8,
+						dma:1,
+						is_in:1,
+						stopped:1;
+
+	/* analogous to a host-side qh */
+	struct list_head			queue;
+	const struct usb_endpoint_descriptor	*desc;
+
+	u32					*reg_fifo;
+	u32					*reg_mode;
+	u32					*reg_status;
+};
+
+struct goku_request {
+	struct usb_request		req;
+	struct list_head		queue;
+
+	unsigned			mapped:1;
+};
+
+enum ep0state {
+	EP0_DISCONNECT,		/* no host */
+	EP0_IDLE,		/* between STATUS ack and SETUP report */
+	EP0_IN, EP0_OUT, 	/* data stage */
+	EP0_STATUS,		/* status stage */
+	EP0_STALL,		/* data or status stages */
+	EP0_SUSPEND,		/* usb suspend */
+};
+
+struct goku_udc {
+	/* each pci device provides one gadget, several endpoints */
+	struct usb_gadget		gadget;
+	spinlock_t			lock;
+	struct goku_ep			ep[4];
+	struct usb_gadget_driver 	*driver;
+
+	enum ep0state			ep0state;
+	unsigned			got_irq:1,
+					got_region:1,
+					req_config:1,
+					configured:1,
+					enabled:1;
+
+	/* pci state used to access those endpoints */
+	struct pci_dev			*pdev;
+	struct goku_udc_regs		*regs;
+	u32				int_enable;
+
+	/* statistics... */
+	unsigned long			irqs;
+};
+
+/*-------------------------------------------------------------------------*/
+
+#define xprintk(dev,level,fmt,args...) \
+	printk(level "%s %s: " fmt , driver_name , \
+			pci_name(dev->pdev) , ## args)
+
+#ifdef DEBUG
+#define DBG(dev,fmt,args...) \
+	xprintk(dev , KERN_DEBUG , fmt , ## args)
+#else
+#define DBG(dev,fmt,args...) \
+	do { } while (0)
+#endif /* DEBUG */
+
+#ifdef VERBOSE
+#define VDBG DBG
+#else
+#define VDBG(dev,fmt,args...) \
+	do { } while (0)
+#endif	/* VERBOSE */
+
+#define ERROR(dev,fmt,args...) \
+	xprintk(dev , KERN_ERR , fmt , ## args)
+#define WARN(dev,fmt,args...) \
+	xprintk(dev , KERN_WARNING , fmt , ## args)
+#define INFO(dev,fmt,args...) \
+	xprintk(dev , KERN_INFO , fmt , ## args)
+
diff -Nru a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
--- a/drivers/usb/gadget/inode.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/usb/gadget/inode.c	Tue Feb  3 19:45:34 2004
@@ -232,18 +232,27 @@
  * the usb controller exposes.
  */
 
-#ifdef	CONFIG_USB_GADGETFS_NET2280
+#ifdef	CONFIG_USB_GADGET_DUMMY_HCD
+/* act (mostly) like a net2280 */
+#define CONFIG_USB_GADGET_NET2280
+#endif
+
+#ifdef	CONFIG_USB_GADGET_NET2280
 #define CHIP			"net2280"
 #define HIGHSPEED
 #endif
 
-#ifdef	CONFIG_USB_GADGETFS_PXA2XX
+#ifdef	CONFIG_USB_GADGET_PXA2XX
 #define CHIP			"pxa2xx_udc"
 /* earlier hardware doesn't have UDCCFR, races set_{config,interface} */
 #warning works best with pxa255 or newer
 #endif
 
-#ifdef	CONFIG_USB_GADGETFS_SA1100
+#ifdef	CONFIG_USB_GADGET_GOKU
+#define CHIP			"goku_udc"
+#endif
+
+#ifdef	CONFIG_USB_GADGET_SA1100
 #define CHIP			"sa1100"
 #endif
 
@@ -397,7 +406,7 @@
 
 /* handle a synchronous OUT bulk/intr/iso transfer */
 static ssize_t
-ep_read (struct file *fd, char *buf, size_t len, loff_t *ptr)
+ep_read (struct file *fd, char __user *buf, size_t len, loff_t *ptr)
 {
 	struct ep_data		*data = fd->private_data;
 	void			*kbuf;
@@ -441,7 +450,7 @@
 
 /* handle a synchronous IN bulk/intr/iso transfer */
 static ssize_t
-ep_write (struct file *fd, const char *buf, size_t len, loff_t *ptr)
+ep_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
 {
 	struct ep_data		*data = fd->private_data;
 	void			*kbuf;
diff -Nru a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
--- a/drivers/usb/gadget/net2280.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/usb/gadget/net2280.c	Tue Feb  3 19:45:16 2004
@@ -25,9 +25,6 @@
  * rev1 chips.  Rev1a silicon (0110) fixes almost all of them.
  */
 
-#define USE_DMA_CHAINING
-
-
 /*
  * Copyright (C) 2003 David Brownell
  * Copyright (C) 2003 NetChip Technologies
@@ -47,8 +44,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#define DEBUG	1
-// #define	VERBOSE		/* extra debug messages (success too) */
+#undef	DEBUG		/* messages on error and most fault paths */
+#undef	VERBOSE		/* extra debug messages (success too) */
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -77,7 +74,7 @@
 
 
 #define	DRIVER_DESC		"NetChip 2280 USB Peripheral Controller"
-#define	DRIVER_VERSION		"Bastille Day 2003"
+#define	DRIVER_VERSION		"2004 Jan 14"
 
 #define	DMA_ADDR_INVALID	(~(dma_addr_t)0)
 #define	EP_DONTUSE		13	/* nonzero */
@@ -96,10 +93,21 @@
 	"ep-e", "ep-f",
 };
 
+/* use_dma -- general goodness, fewer interrupts, less cpu load (vs PIO)
+ * use_dma_chaining -- dma descriptor queueing gives even more irq reduction
+ *
+ * The net2280 DMA engines are not tightly integrated with their FIFOs;
+ * not all cases are (yet) handled well in this driver or the silicon.
+ * Some gadget drivers work better with the dma support here than others.
+ * These two parameters let you use PIO or more aggressive DMA.
+ */
 static int use_dma = 1;
+static int use_dma_chaining = 0;
 
 /* "modprobe net2280 use_dma=n" etc */
-module_param (use_dma, bool, S_IRUGO|S_IWUSR);
+module_param (use_dma, bool, S_IRUGO);
+module_param (use_dma_chaining, bool, S_IRUGO);
+
 
 /* mode 0 == ep-{a,b,c,d} 1K fifo each
  * mode 1 == ep-{a,b} 2K fifo each, ep-{c,d} unavailable
@@ -110,6 +118,7 @@
 /* "modprobe net2280 fifo_mode=1" etc */
 module_param (fifo_mode, ushort, 0644);
 
+
 #define	DIR_STRING(bAddress) (((bAddress) & USB_DIR_IN) ? "in" : "out")
 
 #if defined(USE_SYSFS_DEBUG_FILES) || defined (DEBUG)
@@ -162,6 +171,7 @@
 
 	/* ep_reset() has already been called */
 	ep->stopped = 0;
+	ep->out_overflow = 0;
 
 	/* set speed-dependent max packet; may kick in high bandwidth */
 	set_idx_reg (dev->regs, REG_EP_MAXPKT (dev, ep->num), max);
@@ -169,8 +179,8 @@
 	/* FIFO lines can't go to different packets.  PIO is ok, so
 	 * use it instead of troublesome (non-bulk) multi-packet DMA.
 	 */
-	if (ep->is_in && ep->dma && (max % 4) != 0) {
-		DEBUG (ep->dev, "%s, no IN dma for maxpacket %d\n",
+	if (ep->dma && (max % 4) != 0 && use_dma_chaining) {
+		DEBUG (ep->dev, "%s, no dma for maxpacket %d\n",
 			ep->ep.name, ep->ep.maxpacket);
 		ep->dma = 0;
 	}
@@ -179,17 +189,21 @@
 	writel ((1 << FIFO_FLUSH), &ep->regs->ep_stat);
 	tmp = (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK);
 	if (tmp == USB_ENDPOINT_XFER_INT) {
-		/* not just because of erratum 0105; avoid ever
-		 * kicking in the "toggle-irrelevant" mode.
-		 */
-		tmp = USB_ENDPOINT_XFER_BULK;
+		/* erratum 0105 workaround prevents hs NYET */
+		if (dev->chiprev == 0100
+				&& dev->gadget.speed == USB_SPEED_HIGH
+				&& !(desc->bEndpointAddress & USB_DIR_IN))
+			writel ((1 << CLEAR_NAK_OUT_PACKETS_MODE),
+				&ep->regs->ep_rsp);
 	} else if (tmp == USB_ENDPOINT_XFER_BULK) {
 		/* catch some particularly blatant driver bugs */
 		if ((dev->gadget.speed == USB_SPEED_HIGH
 					&& max != 512)
 				|| (dev->gadget.speed == USB_SPEED_FULL
-					&& max > 64))
+					&& max > 64)) {
+			spin_unlock_irqrestore (&dev->lock, flags);
 			return -ERANGE;
+		}
 	}
 	ep->is_iso = (tmp == USB_ENDPOINT_XFER_ISOC) ? 1 : 0;
 	tmp <<= ENDPOINT_TYPE;
@@ -205,11 +219,6 @@
 
 	writel (tmp, &ep->regs->ep_cfg);
 
-#ifdef NET2280_DMA_OUT_WORKAROUND
-	if (!ep->is_in)
-		ep->dma = 0;
-#endif
-
 	/* enable irqs */
 	if (!ep->dma) {				/* pio, per-packet */
 		tmp = (1 << ep->num) | readl (&dev->regs->pciirqenb0);
@@ -388,6 +397,7 @@
 		}
 		td->dmacount = 0;	/* not VALID */
 		td->dmaaddr = __constant_cpu_to_le32 (DMA_ADDR_INVALID);
+		td->dmadesc = td->dmaaddr;
 		req->td = td;
 	}
 	return &req->req;
@@ -541,8 +551,11 @@
 		count -= 4;
 	}
 
-	/* last fifo entry is "short" unless we wrote a full packet */
-	if (total < ep->ep.maxpacket) {
+	/* last fifo entry is "short" unless we wrote a full packet.
+	 * also explicitly validate last word in (periodic) transfers
+	 * when maxpacket is not a multiple of 4 bytes.
+	 */
+	if (count || total < ep->ep.maxpacket) {
 		tmp = count ? get_unaligned ((u32 *)buf) : count;
 		cpu_to_le32s (&tmp);
 		set_fifo_bytecount (ep, count & 0x03);
@@ -555,6 +568,9 @@
 /* work around erratum 0106: PCI and USB race over the OUT fifo.
  * caller guarantees chiprev 0100, out endpoint is NAKing, and
  * there's no real data in the fifo.
+ *
+ * NOTE:  also used in cases where that erratum doesn't apply:
+ * where the host wrote "too much" data to us.
  */
 static void out_flush (struct net2280_ep *ep)
 {
@@ -599,13 +615,13 @@
 	/* erratum 0106 ... packets coming in during fifo reads might
 	 * be incompletely rejected.  not all cases have workarounds.
 	 */
-	if (ep->dev->chiprev == 0x0100) {
+	if (ep->dev->chiprev == 0x0100
+			&& ep->dev->gadget.speed == USB_SPEED_FULL) {
+		udelay (1);
 		tmp = readl (&ep->regs->ep_stat);
 		if ((tmp & (1 << NAK_OUT_PACKETS)))
-			/* cleanup = 1 */;
-		else if ((tmp & (1 << FIFO_FULL))
-				/* don't break hs PING protocol ... */
-				|| ep->dev->gadget.speed == USB_SPEED_FULL) {
+			cleanup = 1;
+		else if ((tmp & (1 << FIFO_FULL))) {
 			start_out_naking (ep);
 			prevent = 1;
 		}
@@ -617,6 +633,15 @@
 	 */
 	prefetchw (buf);
 	count = readl (&regs->ep_avail);
+	if (unlikely (count == 0)) {
+		udelay (1);
+		tmp = readl (&ep->regs->ep_stat);
+		count = readl (&regs->ep_avail);
+		/* handled that data already? */
+		if (count == 0 && (tmp & (1 << NAK_OUT_PACKETS)) == 0)
+			return 0;
+	}
+
 	tmp = req->req.length - req->req.actual;
 	if (count > tmp) {
 		/* as with DMA, data overflow gets flushed */
@@ -626,7 +651,10 @@
 				ep->ep.name, count, tmp);
 			req->req.status = -EOVERFLOW;
 			cleanup = 1;
-		}
+			/* NAK_OUT_PACKETS will be set, so flushing is safe;
+			 * the next read will start with the next packet
+			 */
+		} /* else it's a ZLP, no worries */
 		count = tmp;
 	}
 	req->req.actual += count;
@@ -665,7 +693,7 @@
 }
 
 /* fill out dma descriptor to match a given request */
-static inline void
+static void
 fill_dma_desc (struct net2280_ep *ep, struct net2280_request *req, int valid)
 {
 	struct net2280_dma	*td = req->td;
@@ -678,15 +706,13 @@
 	 */
 	if (ep->is_in)
 		dmacount |= (1 << DMA_DIRECTION);
-	else
+	else if ((dmacount % ep->ep.maxpacket) != 0)
 		dmacount |= (1 << END_OF_CHAIN);
 
 	req->valid = valid;
 	if (valid)
 		dmacount |= (1 << VALID_BIT);
-#ifdef USE_DMA_CHAINING
-	if (!req->req.no_interrupt)
-#endif
+	if (likely(!req->req.no_interrupt || !use_dma_chaining))
 		dmacount |= (1 << DMA_DONE_INTERRUPT_ENABLE);
 
 	/* td->dmadesc = previously set by caller */
@@ -698,7 +724,8 @@
 }
 
 static const u32 dmactl_default =
-		  (1 << DMA_CLEAR_COUNT_ENABLE)
+		  (1 << DMA_SCATTER_GATHER_DONE_INTERRUPT)
+		| (1 << DMA_CLEAR_COUNT_ENABLE)
 		/* erratum 0116 workaround part 1 (use POLLING) */
 		| (POLL_100_USEC << DESCRIPTOR_POLLING_RATE)
 		| (1 << DMA_VALID_BIT_POLLING_ENABLE)
@@ -714,18 +741,41 @@
 
 static inline void stop_dma (struct net2280_dma_regs *dma)
 {
-	writel (dmactl_default & ~(1 << DMA_ENABLE), &dma->dmactl);
+	writel (readl (&dma->dmactl) & ~(1 << DMA_ENABLE), &dma->dmactl);
 	spin_stop_dma (dma);
 }
 
+static void start_queue (struct net2280_ep *ep, u32 dmactl, u32 td_dma)
+{
+	struct net2280_dma_regs	*dma = ep->dma;
+
+	writel ((1 << VALID_BIT) | (ep->is_in << DMA_DIRECTION),
+			&dma->dmacount);
+	writel (readl (&dma->dmastat), &dma->dmastat);
+
+	writel (td_dma, &dma->dmadesc);
+	writel (dmactl, &dma->dmactl);
+
+	/* erratum 0116 workaround part 3:  pci arbiter away from net2280 */
+	(void) readl (&ep->dev->pci->pcimstctl);
+
+	writel ((1 << DMA_START), &dma->dmastat);
+
+	if (!ep->is_in)
+		stop_out_naking (ep);
+}
+
 static void start_dma (struct net2280_ep *ep, struct net2280_request *req)
 {
 	u32			tmp;
-	int			clear_nak = 0;
 	struct net2280_dma_regs	*dma = ep->dma;
 
 	/* FIXME can't use DMA for ZLPs */
 
+	/* on this path we "know" there's no dma active (yet) */
+	WARN_ON (readl (&dma->dmactl) & (1 << DMA_ENABLE));
+	writel (0, &ep->dma->dmactl);
+
 	/* previous OUT packet might have been short */
 	if (!ep->is_in && ((tmp = readl (&ep->regs->ep_stat))
 		 		& (1 << NAK_OUT_PACKETS)) != 0) {
@@ -733,9 +783,9 @@
 			&ep->regs->ep_stat);
 
 		tmp = readl (&ep->regs->ep_avail);
-		if (tmp == 0)
-			clear_nak = 1;
-		else {
+		if (tmp) {
+			writel (readl (&dma->dmastat), &dma->dmastat);
+
 			/* transfer all/some fifo data */
 			writel (req->req.dma, &dma->dmaaddr);
 			tmp = min (tmp, req->req.length);
@@ -744,6 +794,8 @@
 			req->td->dmacount = cpu_to_le32 (req->req.length - tmp);
 			writel ((1 << DMA_DONE_INTERRUPT_ENABLE)
 				| tmp, &dma->dmacount);
+			req->td->dmadesc = 0;
+			req->valid = 1;
 
 			writel ((1 << DMA_ENABLE), &dma->dmactl);
 			writel ((1 << DMA_START), &dma->dmastat);
@@ -751,8 +803,6 @@
 		}
 	}
 
-	/* on this path we know there's no dma queue (yet) */
-	WARN_ON (readl (&dma->dmactl) & (1 << DMA_ENABLE));
 	tmp = dmactl_default;
 
 	/* force packet boundaries between dma requests, but prevent the
@@ -772,25 +822,10 @@
 	req->td->dmadesc = cpu_to_le32 (ep->td_dma);
 	fill_dma_desc (ep, req, 1);
 
-#ifdef USE_DMA_CHAINING
-	writel (  (1 << VALID_BIT)
-		| (ep->is_in << DMA_DIRECTION)
-		| 0, &dma->dmacount);
-#else
-	req->td->dmacount |= __constant_cpu_to_le32 (1 << END_OF_CHAIN);
-#endif
-
-	writel (req->td_dma, &dma->dmadesc);
-	writel (tmp, &dma->dmactl);
+	if (!use_dma_chaining)
+		req->td->dmacount |= __constant_cpu_to_le32 (1 << END_OF_CHAIN);
 
-	/* erratum 0116 workaround part 3:  pci arbiter away from net2280 */
-	(void) readl (&ep->dev->pci->pcimstctl);
-
-	writel ((1 << DMA_START), &dma->dmastat);
-
-	/* recover from previous short read; erratum 0112 workaround #1 */
-	if (clear_nak)
-		writel ((1 << CLEAR_NAK_OUT_PACKETS), &ep->regs->ep_rsp);
+	start_queue (ep, tmp, req->td_dma);
 }
 
 static inline void
@@ -893,7 +928,6 @@
 
 	_req->status = -EINPROGRESS;
 	_req->actual = 0;
-	req->dma_done = 0;
 
 	/* kickstart this i/o queue? */
 	if (list_empty (&ep->queue) && !ep->stopped) {
@@ -977,10 +1011,11 @@
 )
 {
 	req->req.actual = req->req.length - (DMA_BYTE_COUNT_MASK & dmacount);
-	rmb ();
 	done (ep, req, status);
 }
 
+static void restart_dma (struct net2280_ep *ep);
+
 static void scan_dma_completions (struct net2280_ep *ep)
 {
 	/* only look at descriptors that were "naturally" retired,
@@ -1000,14 +1035,37 @@
 			break;
 
 		/* SHORT_PACKET_TRANSFERRED_INTERRUPT handles "usb-short"
-		 * packets, including overruns, even when the transfer was
-		 * exactly the length requested (dmacount now zero).
-		 * FIXME there's an overrun case here too, where we expect
-		 * a short packet but receive a max length one (won't NAK).
+		 * cases where DMA must be aborted; this code handles
+		 * all non-abort DMA completions.
 		 */
-		if (!ep->is_in && (req->req.length % ep->ep.maxpacket) != 0) {
-			req->dma_done = 1;
+		if (unlikely (req->td->dmadesc == 0)) {
+			/* paranoia */
+			tmp = readl (&ep->dma->dmacount);
+			if (tmp & DMA_BYTE_COUNT_MASK)
+				break;
+			/* single transfer mode */
+			dma_done (ep, req, tmp, 0);
 			break;
+		} else if (!ep->is_in
+				&& (req->req.length % ep->ep.maxpacket) != 0) {
+			tmp = readl (&ep->regs->ep_stat);
+
+			/* AVOID TROUBLE HERE by not issuing short reads from
+			 * your gadget driver.  That helps avoids errata 0121,
+			 * 0122, and 0124; not all cases trigger the warning.
+			 */
+			if ((tmp & (1 << NAK_OUT_PACKETS)) == 0) {
+				WARN (ep->dev, "%s lost packet sync!\n",
+						ep->ep.name);
+				req->req.status = -EOVERFLOW;
+			} else if ((tmp = readl (&ep->regs->ep_avail)) != 0) {
+				/* fifo gets flushed later */
+				ep->out_overflow = 1;
+				DEBUG (ep->dev, "%s dma, discard %d len %d\n",
+						ep->ep.name, tmp,
+						req->req.length);
+				req->req.status = -EOVERFLOW;
+			}
 		}
 		dma_done (ep, req, tmp, 0);
 	}
@@ -1016,41 +1074,50 @@
 static void restart_dma (struct net2280_ep *ep)
 {
 	struct net2280_request	*req;
+	u32			dmactl = dmactl_default;
 
 	if (ep->stopped)
 		return;
 	req = list_entry (ep->queue.next, struct net2280_request, queue);
 
-#ifdef USE_DMA_CHAINING
+	if (!use_dma_chaining) {
+		start_dma (ep, req);
+		return;
+	}
+
 	/* the 2280 will be processing the queue unless queue hiccups after
 	 * the previous transfer:
 	 *  IN:   wanted automagic zlp, head doesn't (or vice versa)
+	 *        DMA_FIFO_VALIDATE doesn't init from dma descriptors.
 	 *  OUT:  was "usb-short", we must restart.
 	 */
-	if (!req->valid) {
+	if (ep->is_in && !req->valid) {
 		struct net2280_request	*entry, *prev = 0;
-		int			qmode, reqmode, done = 0;
+		int			reqmode, done = 0;
 
 		DEBUG (ep->dev, "%s dma hiccup td %p\n", ep->ep.name, req->td);
-		qmode = likely (req->req.zero
+		ep->in_fifo_validate = likely (req->req.zero
 			|| (req->req.length % ep->ep.maxpacket) != 0);
+		if (ep->in_fifo_validate)
+			dmactl |= (1 << DMA_FIFO_VALIDATE);
 		list_for_each_entry (entry, &ep->queue, queue) {
 			u32		dmacount;
 
-			if (entry != req)
+			if (entry == req)
 				continue;
 			dmacount = entry->td->dmacount;
 			if (!done) {
 				reqmode = likely (entry->req.zero
 					|| (entry->req.length
 						% ep->ep.maxpacket) != 0);
-				if (reqmode == qmode) {
+				if (reqmode == ep->in_fifo_validate) {
 					entry->valid = 1;
 					dmacount |= valid_bit;
 					entry->td->dmacount = dmacount;
 					prev = entry;
 					continue;
 				} else {
+					/* force a hiccup */
 					prev->td->dmacount |= dma_done_ie;
 					done = 1;
 				}
@@ -1062,22 +1129,21 @@
 			entry->td->dmacount = dmacount;
 			prev = entry;
 		}
-		start_dma (ep, req);
-	} else if (!ep->is_in
-			&& (readl (&ep->regs->ep_stat)
-				& (1 << NAK_OUT_PACKETS)) != 0)
-		start_dma (ep, req);
-#else
-	start_dma (ep, req);
-#endif
+	}
+
+	writel (0, &ep->dma->dmactl);
+	start_queue (ep, dmactl, req->td_dma);
 }
 
-static inline void abort_dma (struct net2280_ep *ep)
+static void abort_dma (struct net2280_ep *ep)
 {
 	/* abort the current transfer */
-	writel ((1 << DMA_ABORT), &ep->dma->dmastat);
-
-	/* collect completed transfers (except the current one) */
+	if (likely (!list_empty (&ep->queue))) {
+		/* FIXME work around errata 0121, 0122, 0124 */
+		writel ((1 << DMA_ABORT), &ep->dma->dmastat);
+		spin_stop_dma (ep->dma);
+	} else
+		stop_dma (ep->dma);
 	scan_dma_completions (ep);
 }
 
@@ -1108,43 +1174,53 @@
 	int			stopped;
 
 	ep = container_of (_ep, struct net2280_ep, ep);
-	req = container_of (_req, struct net2280_request, req);
 	if (!_ep || (!ep->desc && ep->num != 0) || !_req)
 		return -EINVAL;
 
 	spin_lock_irqsave (&ep->dev->lock, flags);
 	stopped = ep->stopped;
 
-	/* pause dma while we scan the queue */
+	/* quiesce dma while we patch the queue */
 	dmactl = 0;
 	ep->stopped = 1;
 	if (ep->dma) {
 		dmactl = readl (&ep->dma->dmactl);
-		writel (dmactl & ~(1 << DMA_ENABLE), &ep->dma->dmactl);
-		/* force synch, clean any completed requests */
-		spin_stop_dma (ep->dma);
+		/* WARNING erratum 0127 may kick in ... */
+		stop_dma (ep->dma);
 		scan_dma_completions (ep);
 	}
 
+	/* make sure it's still queued on this endpoint */
+	list_for_each_entry (req, &ep->queue, queue) {
+		if (&req->req == _req)
+			break;
+	}
+	if (&req->req != _req) {
+		spin_unlock_irqrestore (&ep->dev->lock, flags);
+		return -EINVAL;
+	}
+
 	/* queue head may be partially complete. */
 	if (ep->queue.next == &req->queue) {
 		if (ep->dma) {
 			DEBUG (ep->dev, "unlink (%s) dma\n", _ep->name);
 			_req->status = -ECONNRESET;
 			abort_dma (ep);
-			if (likely (ep->queue.next == &req->queue))
+			if (likely (ep->queue.next == &req->queue)) {
+				// NOTE: misreports single-transfer mode
+				req->td->dmacount = 0;	/* invalidate */
 				dma_done (ep, req,
-					le32_to_cpup (&req->td->dmacount),
+					readl (&ep->dma->dmacount),
 					-ECONNRESET);
+			}
 		} else {
 			DEBUG (ep->dev, "unlink (%s) pio\n", _ep->name);
 			done (ep, req, -ECONNRESET);
 		}
 		req = 0;
 
-#ifdef USE_DMA_CHAINING
 	/* patch up hardware chaining data */
-	} else if (ep->dma) {
+	} else if (ep->dma && use_dma_chaining) {
 		if (req->queue.prev == ep->queue.next) {
 			writel (le32_to_cpu (req->td->dmadesc),
 				&ep->dma->dmadesc);
@@ -1161,7 +1237,6 @@
 			if (req->td->dmacount & dma_done_ie)
 				prev->td->dmacount |= dma_done_ie;
 		}
-#endif
 	}
 
 	if (req)
@@ -1188,10 +1263,14 @@
 
 /*-------------------------------------------------------------------------*/
 
+static int net2280_fifo_status (struct usb_ep *_ep);
+
 static int
 net2280_set_halt (struct usb_ep *_ep, int value)
 {
 	struct net2280_ep	*ep;
+	unsigned long		flags;
+	int			retval = 0;
 
 	ep = container_of (_ep, struct net2280_ep, ep);
 	if (!_ep || (!ep->desc && ep->num != 0))
@@ -1202,19 +1281,27 @@
 						== USB_ENDPOINT_XFER_ISOC)
 		return -EINVAL;
 
-	VDEBUG (ep->dev, "%s %s halt\n", _ep->name, value ? "set" : "clear");
-
-	/* set/clear, then synch memory views with the device */
-	if (value) {
-		if (ep->num == 0)
-			ep->dev->protocol_stall = 1;
-		else
-			set_halt (ep);
-	} else
-		clear_halt (ep);
-	(void) readl (&ep->regs->ep_rsp);
+	spin_lock_irqsave (&ep->dev->lock, flags);
+	if (!list_empty (&ep->queue))
+		retval = -EAGAIN;
+	else if (ep->is_in && value && net2280_fifo_status (_ep) != 0)
+		retval = -EAGAIN;
+	else {
+		VDEBUG (ep->dev, "%s %s halt\n", _ep->name,
+				value ? "set" : "clear");
+		/* set/clear, then synch memory views with the device */
+		if (value) {
+			if (ep->num == 0)
+				ep->dev->protocol_stall = 1;
+			else
+				set_halt (ep);
+		} else
+			clear_halt (ep);
+		(void) readl (&ep->regs->ep_rsp);
+	}
+	spin_unlock_irqrestore (&ep->dev->lock, flags);
 
-	return 0;
+	return retval;
 }
 
 static int
@@ -1290,21 +1377,49 @@
 static int net2280_wakeup (struct usb_gadget *_gadget)
 {
 	struct net2280		*dev;
+	u32			tmp;
+	unsigned long		flags;
 
 	if (!_gadget)
 		return 0;
 	dev = container_of (_gadget, struct net2280, gadget);
-	writel (1 << GENERATE_RESUME, &dev->usb->usbstat);
+
+	spin_lock_irqsave (&dev->lock, flags);
+	tmp = readl (&dev->usb->usbctl);
+	if (tmp & (1 << DEVICE_REMOTE_WAKEUP_ENABLE))
+		writel (1 << GENERATE_RESUME, &dev->usb->usbstat);
+	spin_unlock_irqrestore (&dev->lock, flags);
 
 	/* pci writes may still be posted */
 	return 0;
 }
 
+static int net2280_set_selfpowered (struct usb_gadget *_gadget, int value)
+{
+	struct net2280		*dev;
+	u32			tmp;
+	unsigned long		flags;
+
+	if (!_gadget)
+		return 0;
+	dev = container_of (_gadget, struct net2280, gadget);
+
+	spin_lock_irqsave (&dev->lock, flags);
+	tmp = readl (&dev->usb->usbctl);
+	if (value)
+		tmp |= (1 << SELF_POWERED_STATUS);
+	else
+		tmp &= ~(1 << SELF_POWERED_STATUS);
+	writel (tmp, &dev->usb->usbctl);
+	spin_unlock_irqrestore (&dev->lock, flags);
+
+	return 0;
+}
+
 static const struct usb_gadget_ops net2280_ops = {
 	.get_frame	= net2280_get_frame,
 	.wakeup		= net2280_wakeup,
-
-	// .set_selfpowered = net2280_set_selfpowered,
+	.set_selfpowered = net2280_set_selfpowered,
 };
 
 /*-------------------------------------------------------------------------*/
@@ -1348,11 +1463,14 @@
 
 	/* Main Control Registers */
 	t = snprintf (next, size, "%s version " DRIVER_VERSION
-			", chiprev %04x\n"
+			", chiprev %04x, dma %s\n\n"
 			"devinit %03x fifoctl %08x gadget '%s'\n"
 			"pci irqenb0 %02x irqenb1 %08x "
 			"irqstat0 %04x irqstat1 %08x\n",
 			driver_name, dev->chiprev,
+			use_dma
+				? (use_dma_chaining ? "chaining" : "enabled")
+				: "disabled",
 			readl (&dev->regs->devinit),
 			readl (&dev->regs->fifoctl),
 			s,
@@ -1399,7 +1517,7 @@
 		t1 = readl (&ep->regs->ep_cfg);
 		t2 = readl (&ep->regs->ep_rsp) & 0xff;
 		t = snprintf (next, size,
-				"%s\tcfg %05x rsp (%02x) %s%s%s%s%s%s%s%s"
+				"\n%s\tcfg %05x rsp (%02x) %s%s%s%s%s%s%s%s"
 					"irqenb %02x\n",
 				ep->ep.name, t1, t2,
 				(t2 & (1 << CLEAR_NAK_OUT_PACKETS))
@@ -1453,7 +1571,7 @@
 		// none yet 
 
 	/* Statistics */
-	t = snprintf (next, size, "irqs:  ");
+	t = snprintf (next, size, "\nirqs:  ");
 	size -= t;
 	next += t;
 	for (i = 0; i < 7; i++) {
@@ -1462,7 +1580,7 @@
 		ep = &dev->ep [i];
 		if (i && !ep->irqs)
 			continue;
-		t = snprintf (next, size, " %s/%ld", ep->ep.name, ep->irqs);
+		t = snprintf (next, size, " %s/%lu", ep->ep.name, ep->irqs);
 		size -= t;
 		next += t;
 
@@ -1504,7 +1622,7 @@
 				continue;
 			t = d->bEndpointAddress;
 			t = snprintf (next, size,
-				"%s (ep%d%s-%s) max %04x %s\n",
+				"\n%s (ep%d%s-%s) max %04x %s fifo %d\n",
 				ep->ep.name, t & USB_ENDPOINT_NUMBER_MASK,
 				(t & USB_DIR_IN) ? "in" : "out",
 				({ char *val;
@@ -1517,7 +1635,7 @@
 				 	val = "iso"; break;
 				 }; val; }),
 				le16_to_cpu (d->wMaxPacketSize) & 0x1fff,
-				ep->dma ? "dma" : "pio"
+				ep->dma ? "dma" : "pio", ep->fifo_size
 				);
 		} else /* ep0 should only have one transfer queued */
 			t = snprintf (next, size, "ep0 max 64 pio %s\n",
@@ -1552,6 +1670,20 @@
 				goto done;
 			size -= t;
 			next += t;
+
+			if (ep->dma) {
+				struct net2280_dma	*td;
+
+				td = req->td;
+				t = snprintf (next, size, "\t    td %08x "
+					" count %08x buf %08x desc %08x\n",
+					req->td_dma, td->dmacount,
+					td->dmaaddr, td->dmadesc);
+				if (t <= 0 || t > size)
+					goto done;
+				size -= t;
+				next += t;
+			}
 		}
 	}
 
@@ -1686,8 +1818,10 @@
 
 	/* clear old dma and irq state */
 	for (tmp = 0; tmp < 4; tmp++) {
-		writel ((1 << DMA_ABORT), &dev->dma [tmp].dmastat);
-		stop_dma (&dev->dma [tmp]);
+		struct net2280_ep	*ep = &dev->ep [tmp + 1];
+
+		if (ep->dma)
+			abort_dma (ep);
 	}
 	writel (~0, &dev->regs->irqstat0),
 	writel (~(1 << SUSPEND_REQUEST_INTERRUPT), &dev->regs->irqstat1),
@@ -1767,7 +1901,7 @@
 		| (1 << SELF_POWERED_USB_DEVICE)
 		| (1 << REMOTE_WAKEUP_SUPPORT)
 		| (1 << USB_DETECT_ENABLE)
-		| (1 << DEVICE_REMOTE_WAKEUP_ENABLE)
+		| (1 << SELF_POWERED_STATUS)
 		, &dev->usb->usbctl);
 
 	/* enable irqs so we can see ep0 and general operation  */
@@ -1889,6 +2023,7 @@
 	spin_unlock_irqrestore (&dev->lock, flags);
 
 	driver->unbind (&dev->gadget);
+	dev->gadget.dev.driver = 0;
 	dev->driver = 0;
 
 	net2280_led_active (dev, 0);
@@ -1947,6 +2082,8 @@
 					ep->stopped = 1;
 					set_halt (ep);
 				}
+				if (!req)
+					allow_status (ep);
 				mode = 2;
 			/* reply to extra IN data tokens with a zlp */
 			} else if (t & (1 << DATA_IN_TOKEN_INTERRUPT)) {
@@ -1987,41 +2124,62 @@
 	if (likely (ep->dma != 0)) {
 		if (t & (1 << SHORT_PACKET_TRANSFERRED_INTERRUPT)) {
 			u32	count;
+			int	stopped = ep->stopped;
 
 			/* TRANSFERRED works around OUT_DONE erratum 0112.
 			 * we expect (N <= maxpacket) bytes; host wrote M.
 			 * iff (M < N) we won't ever see a DMA interrupt.
 			 */
-			count = readl (&ep->dma->dmacount);
-			count &= DMA_BYTE_COUNT_MASK;
-			if (!req->dma_done) {
-				/* dma can finish with the FIFO non-empty,
-				 * on (M > N) errors.
+			ep->stopped = 1;
+			for (count = 0; ; t = readl (&ep->regs->ep_stat)) {
+
+				/* any preceding dma transfers must finish.
+				 * dma handles (M >= N), may empty the queue
+				 */
+				scan_dma_completions (ep);
+				if (unlikely (list_empty (&ep->queue)
+						|| ep->out_overflow)) {
+					req = 0;
+					break;
+				}
+				req = list_entry (ep->queue.next,
+					struct net2280_request, queue);
+
+				/* here either (M < N), a "real" short rx;
+				 * or (M == N) and the queue didn't empty
 				 */
-				while (count && (t & (1 << FIFO_EMPTY)) == 0) {
-					cpu_relax ();
-					t = readl (&ep->regs->ep_stat);
+				if (likely (t & (1 << FIFO_EMPTY))) {
 					count = readl (&ep->dma->dmacount);
 					count &= DMA_BYTE_COUNT_MASK;
+					if (readl (&ep->dma->dmadesc)
+							!= req->td_dma)
+						req = 0;
+					break;
 				}
+				udelay(1);
 			}
 
 			/* stop DMA, leave ep NAKing */
 			writel ((1 << DMA_ABORT), &ep->dma->dmastat);
 			spin_stop_dma (ep->dma);
 
-			/* buffer might have been too small */
-			t = readl (&ep->regs->ep_avail);
-			if (t != 0)
-				DEBUG (ep->dev, "%s dma, discard %d len %d\n",
-						ep->ep.name, t, count);
-			dma_done (ep, req, count, t ? -EOVERFLOW : 0);
+			if (likely (req)) {
+				req->td->dmacount = 0;
+				t = readl (&ep->regs->ep_avail);
+				dma_done (ep, req, count, t);
+			}
 
 			/* also flush to prevent erratum 0106 trouble */
-			if (t || ep->dev->chiprev == 0x0100)
+			if (unlikely (ep->out_overflow
+					|| (ep->dev->chiprev == 0x0100
+						&& ep->dev->gadget.speed
+							== USB_SPEED_FULL))) {
 				out_flush (ep);
+				ep->out_overflow = 0;
+			}
 
-			/* restart dma (still NAKing OUT!) if needed */
+			/* (re)start dma if needed, stop NAKing */
+			ep->stopped = stopped;
 			if (!list_empty (&ep->queue))
 				restart_dma (ep);
 		} else
@@ -2192,11 +2350,12 @@
 		 * that'll mean a lot less irqs for some drivers.
 		 */
 		ep->is_in = (u.r.bRequestType & USB_DIR_IN) != 0;
-		if (ep->is_in)
+		if (ep->is_in) {
 			scratch = (1 << DATA_PACKET_TRANSMITTED_INTERRUPT)
 				| (1 << DATA_OUT_PING_TOKEN_INTERRUPT)
 				| (1 << DATA_IN_TOKEN_INTERRUPT);
-		else
+			stop_out_naking (ep);
+		} else
 			scratch = (1 << DATA_PACKET_RECEIVED_INTERRUPT)
 				| (1 << DATA_OUT_PING_TOKEN_INTERRUPT)
 				| (1 << DATA_IN_TOKEN_INTERRUPT);
@@ -2398,18 +2557,18 @@
 		tmp = readl (&dma->dmastat);
 		writel (tmp, &dma->dmastat);
 
-#ifdef USE_DMA_CHAINING
-		/* chaining should stop only on error (which?)
+		/* chaining should stop on abort, short OUT from fifo,
 		 * or (stat0 codepath) short OUT transfer.
 		 */
-#else
-		if ((tmp & (1 << DMA_TRANSACTION_DONE_INTERRUPT)) == 0) {
-			DEBUG (ep->dev, "%s no xact done? %08x\n",
-				ep->ep.name, tmp);
-			continue;
+		if (!use_dma_chaining) {
+			if ((tmp & (1 << DMA_TRANSACTION_DONE_INTERRUPT))
+					== 0) {
+				DEBUG (ep->dev, "%s no xact done? %08x\n",
+					ep->ep.name, tmp);
+				continue;
+			}
+			stop_dma (ep->dma);
 		}
-		stop_dma (ep->dma);
-#endif
 
 		/* OUT transfers terminate when the data from the
 		 * host is in our memory.  Process whatever's done.
@@ -2425,16 +2584,14 @@
 
 		/* disable dma on inactive queues; else maybe restart */
 		if (list_empty (&ep->queue)) {
-#ifdef USE_DMA_CHAINING
-			stop_dma (ep->dma);
-#endif
+			if (use_dma_chaining)
+				stop_dma (ep->dma);
 		} else {
 			tmp = readl (&dma->dmactl);
-			if ((tmp & (1 << DMA_SCATTER_GATHER_ENABLE)) == 0
+			if (!use_dma_chaining
 					|| (tmp & (1 << DMA_ENABLE)) == 0)
 				restart_dma (ep);
-#ifdef USE_DMA_CHAINING
-			else if (ep->desc->bEndpointAddress & USB_DIR_IN) {
+			else if (ep->is_in && use_dma_chaining) {
 				struct net2280_request	*req;
 				u32			dmacount;
 
@@ -2449,12 +2606,9 @@
 				dmacount &= __constant_cpu_to_le32 (
 						(1 << VALID_BIT)
 						| DMA_BYTE_COUNT_MASK);
-				if (dmacount && (dmacount & valid_bit) == 0) {
-					stop_dma (ep->dma);
+				if (dmacount && (dmacount & valid_bit) == 0)
 					restart_dma (ep);
-				}
 			}
-#endif
 		}
 		ep->irqs++;
 	}
@@ -2505,7 +2659,7 @@
 
 /* tear down the binding between this driver and the pci device */
 
-static void net2280_remove (struct pci_dev *pdev)
+static void __exit net2280_remove (struct pci_dev *pdev)
 {
 	struct net2280		*dev = pci_get_drvdata (pdev);
 
@@ -2665,12 +2819,14 @@
 		}
 		td->dmacount = 0;	/* not VALID */
 		td->dmaaddr = __constant_cpu_to_le32 (DMA_ADDR_INVALID);
+		td->dmadesc = td->dmaaddr;
 		dev->ep [i].dummy = td;
 	}
 
 	/* enable lower-overhead pci memory bursts during DMA */
-	writel ((1 << PCI_RETRY_ABORT_ENABLE)
-			| (1 << DMA_MEMORY_WRITE_AND_INVALIDATE_ENABLE)
+	writel ( (1 << DMA_MEMORY_WRITE_AND_INVALIDATE_ENABLE)
+			// 256 write retries may not be enough...
+			// | (1 << PCI_RETRY_ABORT_ENABLE)
 			| (1 << DMA_READ_MULTIPLE_ENABLE)
 			| (1 << DMA_READ_LINE_ENABLE)
 			, &dev->pci->pcimstctl);
@@ -2686,15 +2842,10 @@
 	INFO (dev, "%s\n", driver_desc);
 	INFO (dev, "irq %s, pci mem %p, chip rev %04x\n",
 			bufp, base, dev->chiprev);
-	bufp = DRIVER_VERSION
-#ifndef USE_DMA_CHAINING
-		" (no dma chain)"
-#endif
-#ifdef NET2280_DMA_OUT_WORKAROUND
-		" (no dma out)"
-#endif
-		;
-	INFO (dev, "version: %s\n", bufp);
+	INFO (dev, "version: " DRIVER_VERSION "; dma %s\n",
+			use_dma
+				? (use_dma_chaining ? "chaining" : "enabled")
+				: "disabled");
 	the_controller = dev;
 
 	device_register (&dev->gadget.dev);
@@ -2729,7 +2880,7 @@
 	.id_table =	pci_ids,
 
 	.probe =	net2280_probe,
-	.remove =	net2280_remove,
+	.remove =	__exit_p(net2280_remove),
 
 	/* FIXME add power management support */
 };
@@ -2740,6 +2891,8 @@
 
 static int __init init (void)
 {
+	if (!use_dma)
+		use_dma_chaining = 0;
 	return pci_module_init (&net2280_pci_driver);
 }
 module_init (init);
diff -Nru a/drivers/usb/gadget/net2280.h b/drivers/usb/gadget/net2280.h
--- a/drivers/usb/gadget/net2280.h	Tue Feb  3 19:45:34 2004
+++ b/drivers/usb/gadget/net2280.h	Tue Feb  3 19:45:34 2004
@@ -520,6 +520,7 @@
 	unsigned				num : 8,
 						fifo_size : 12,
 						in_fifo_validate : 1,
+						out_overflow : 1,
 						stopped : 1,
 						is_in : 1,
 						is_iso : 1;
@@ -529,6 +530,7 @@
 {
 	/* ep0 only */
 	writel (  (1 << CLEAR_CONTROL_STATUS_PHASE_HANDSHAKE)
+		| (1 << CLEAR_NAK_OUT_PACKETS)
 		| (1 << CLEAR_NAK_OUT_PACKETS_MODE)
 		, &ep->regs->ep_rsp);
 	ep->stopped = 1;
@@ -546,7 +548,6 @@
 	dma_addr_t			td_dma;
 	struct list_head		queue;
 	unsigned			mapped : 1,
-					dma_done : 1,
 					valid : 1;
 };
 
@@ -559,8 +560,7 @@
 	unsigned			enabled : 1,
 					protocol_stall : 1,
 					got_irq : 1,
-					region : 1,
-					selfpowered : 1;
+					region : 1;
 	u16				chiprev;
 
 	/* pci state used to access those endpoints */
diff -Nru a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/usb/gadget/pxa2xx_udc.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,2515 @@
+/*
+ * linux/drivers/usb/gadget/pxa2xx_udc.c
+ * Intel PXA2xx on-chip full speed USB device controllers
+ *
+ * Copyright (C) 2002 Intrinsyc, Inc. (Frank Becker)
+ * Copyright (C) 2003 Robert Schwebel, Pengutronix
+ * Copyright (C) 2003 Benedikt Spranger, Pengutronix
+ * Copyright (C) 2003 David Brownell
+ * Copyright (C) 2003 Joshua Wise
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#undef	DEBUG
+// #define	VERBOSE	DBG_VERBOSE
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/ioport.h>
+#include <linux/types.h>
+#include <linux/version.h>
+#include <linux/errno.h>
+#include <linux/delay.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/timer.h>
+#include <linux/list.h>
+#include <linux/interrupt.h>
+#include <linux/proc_fs.h>
+#include <linux/mm.h>
+#include <linux/device.h>
+#include <linux/dma-mapping.h>
+
+#include <asm/byteorder.h>
+#include <asm/dma.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/system.h>
+#include <asm/unaligned.h>
+#include <asm/hardware.h>
+
+#include <linux/usb_ch9.h>
+#include <linux/usb_gadget.h>
+
+#include <asm/arch/udc.h>
+
+#include "pxa2xx_udc.h"
+
+
+/*
+ * This driver handles the USB Device Controller (UDC) in Intel's PXA 2xx
+ * series processors.  The UDC for the IXP 4xx series is very similar.
+ *
+ * Such controller drivers work with a gadget driver.  The gadget driver
+ * returns descriptors, implements configuration and data protocols used
+ * by the host to interact with this device, and allocates endpoints to
+ * the different protocol interfaces.  The controller driver virtualizes
+ * usb hardware so that the gadget drivers will be more portable.
+ *
+ * This UDC hardware wants to implement a bit too much USB protocol, so
+ * it constrains the sorts of USB configuration change events that work.
+ * The errata for these chips are misleading; some "fixed" bugs from
+ * pxa250 a0/a1 b0/b1/b2 sure act like they're still there.
+ */
+
+#define	DRIVER_VERSION	"7-Nov-2003"
+#define DRIVER_DESC	"PXA 2xx USB Device Controller driver"
+
+
+static const char driver_name [] = "pxa2xx_udc";
+
+static const char ep0name [] = "ep0";
+
+
+// #define	USE_DMA
+// #define	USE_OUT_DMA
+// #define	DISABLE_TEST_MODE
+
+#ifdef CONFIG_PROC_FS
+#define	UDC_PROC_FILE
+#endif
+
+#ifdef CONFIG_EMBEDDED
+/* few strings, and little code to use them */
+#undef	DEBUG
+#undef	UDC_PROC_FILE
+#endif
+
+#ifdef	USE_DMA
+static int use_dma = 1;
+MODULE_PARM (use_dma, "i");
+MODULE_PARM_DESC (use_dma, "true to use dma");
+
+static void dma_nodesc_handler (int dmach, void *_ep, struct pt_regs *r);
+static void kick_dma(struct pxa2xx_ep *ep, struct pxa2xx_request *req);
+
+#ifdef USE_OUT_DMA
+#define	DMASTR " (dma support)"
+#else
+#define	DMASTR " (dma in)"
+#endif
+
+#else	/* !USE_DMA */
+#define	DMASTR " (pio only)"
+#undef	USE_OUT_DMA
+#endif
+
+#ifdef	CONFIG_USB_PXA2XX_SMALL
+#define SIZE_STR	" (small)"
+#else
+#define SIZE_STR	""
+#endif
+
+#ifdef DISABLE_TEST_MODE
+/* (mode == 0) == no undocumented chip tweaks
+ * (mode & 1)  == double buffer bulk IN
+ * (mode & 2)  == double buffer bulk OUT
+ * ... so mode = 3 (or 7, 15, etc) does it for both
+ */
+static ushort fifo_mode = 0;
+MODULE_PARM (fifo_mode, "h");
+MODULE_PARM_DESC (fifo_mode, "pxa2xx udc fifo mode");
+#endif
+
+/* ---------------------------------------------------------------------------
+ * 	endpoint related parts of the api to the usb controller hardware,
+ *	used by gadget driver; and the inner talker-to-hardware core.
+ * ---------------------------------------------------------------------------
+ */
+
+static void pxa2xx_ep_fifo_flush (struct usb_ep *ep);
+static void nuke (struct pxa2xx_ep *, int status);
+
+static void pio_irq_enable(int bEndpointAddress)
+{
+        bEndpointAddress &= 0xf;
+        if (bEndpointAddress < 8)
+                UICR0 &= ~(1 << bEndpointAddress);
+        else {
+                bEndpointAddress -= 8;
+                UICR1 &= ~(1 << bEndpointAddress);
+	}
+}
+
+static void pio_irq_disable(int bEndpointAddress)
+{
+        bEndpointAddress &= 0xf;
+        if (bEndpointAddress < 8)
+                UICR0 |= 1 << bEndpointAddress;
+        else {
+                bEndpointAddress -= 8;
+                UICR1 |= 1 << bEndpointAddress;
+        }
+}
+
+/* The UDCCR reg contains mask and interrupt status bits,
+ * so using '|=' isn't safe as it may ack an interrupt.
+ */
+#define UDCCR_MASK_BITS         (UDCCR_REM | UDCCR_SRM | UDCCR_UDE)
+
+static inline void udc_set_mask_UDCCR(int mask)
+{
+	UDCCR = (UDCCR & UDCCR_MASK_BITS) | (mask & UDCCR_MASK_BITS);
+}
+
+static inline void udc_clear_mask_UDCCR(int mask)
+{
+	UDCCR = (UDCCR & UDCCR_MASK_BITS) & ~(mask & UDCCR_MASK_BITS);
+}
+
+static inline void udc_ack_int_UDCCR(int mask)
+{
+	/* udccr contains the bits we dont want to change */
+	__u32 udccr = UDCCR & UDCCR_MASK_BITS;
+
+	UDCCR = udccr | (mask & ~UDCCR_MASK_BITS);
+}
+
+/*
+ * endpoint enable/disable
+ *
+ * we need to verify the descriptors used to enable endpoints.  since pxa2xx
+ * endpoint configurations are fixed, and are pretty much always enabled,
+ * there's not a lot to manage here.
+ *
+ * because pxa2xx can't selectively initialize bulk (or interrupt) endpoints,
+ * (resetting endpoint halt and toggle), SET_INTERFACE is unusable except
+ * for a single interface (with only the default altsetting) and for gadget
+ * drivers that don't halt endpoints (not reset by set_interface).  that also
+ * means that if you use ISO, you must violate the USB spec rule that all
+ * iso endpoints must be in non-default altsettings.
+ */
+static int pxa2xx_ep_enable (struct usb_ep *_ep,
+		const struct usb_endpoint_descriptor *desc)
+{
+	struct pxa2xx_ep        *ep;
+	struct pxa2xx_udc       *dev;
+
+	ep = container_of (_ep, struct pxa2xx_ep, ep);
+	if (!_ep || !desc || ep->desc || _ep->name == ep0name
+			|| desc->bDescriptorType != USB_DT_ENDPOINT
+			|| ep->bEndpointAddress != desc->bEndpointAddress
+			|| ep->ep.maxpacket < desc->wMaxPacketSize) {
+		DMSG("%s, bad ep or descriptor\n", __FUNCTION__);
+		return -EINVAL;
+	}
+
+	/* xfer types must match, except that interrupt ~= bulk */
+	if (ep->bmAttributes != desc->bmAttributes
+			&& ep->bmAttributes != USB_ENDPOINT_XFER_BULK
+			&& desc->bmAttributes != USB_ENDPOINT_XFER_INT) {
+		DMSG("%s, %s type mismatch\n", __FUNCTION__, _ep->name);
+		return -EINVAL;
+	}
+
+	/* hardware _could_ do smaller, but driver doesn't */
+	if ((desc->bmAttributes == USB_ENDPOINT_XFER_BULK
+				&& desc->wMaxPacketSize != BULK_FIFO_SIZE)
+			|| !desc->wMaxPacketSize) {
+		DMSG("%s, bad %s maxpacket\n", __FUNCTION__, _ep->name);
+		return -ERANGE;
+	}
+
+	dev = ep->dev;
+	if (!dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN) {
+		DMSG("%s, bogus device state\n", __FUNCTION__);
+		return -ESHUTDOWN;
+	}
+
+	ep->desc = desc;
+	ep->dma = -1;
+	ep->stopped = 0;
+	ep->pio_irqs = ep->dma_irqs = 0;
+
+	/* flush fifo (mostly for OUT buffers) */
+	pxa2xx_ep_fifo_flush (_ep);
+
+	/* ... reset halt state too, if we could ... */
+
+#ifdef	USE_DMA
+	/* for (some) bulk and ISO endpoints, try to get a DMA channel and
+	 * bind it to the endpoint.  otherwise use PIO.
+	 */
+	switch (ep->bmAttributes) {
+	case USB_ENDPOINT_XFER_ISOC:
+		if (desc->wMaxPacketSize % 32)
+			break;
+		// fall through
+	case USB_ENDPOINT_XFER_BULK:
+		if (!use_dma || !ep->reg_drcmr)
+			break;
+		ep->dma = pxa_request_dma ((char *)_ep->name,
+				(desc->wMaxPacketSize > 64)
+					? DMA_PRIO_MEDIUM /* some iso */
+					: DMA_PRIO_LOW,
+				dma_nodesc_handler, ep);
+		if (ep->dma >= 0) {
+			*ep->reg_drcmr = DRCMR_MAPVLD | ep->dma;
+			DMSG("%s using dma%d\n", _ep->name, ep->dma);
+		}
+	}
+#endif
+
+	DBG(DBG_VERBOSE, "enabled %s\n", _ep->name);
+	return 0;
+}
+
+static int pxa2xx_ep_disable (struct usb_ep *_ep)
+{
+	struct pxa2xx_ep	*ep;
+
+	ep = container_of (_ep, struct pxa2xx_ep, ep);
+	if (!_ep || !ep->desc) {
+		DMSG("%s, %s not enabled\n", __FUNCTION__,
+			_ep ? ep->ep.name : NULL);
+		return -EINVAL;
+	}
+	nuke (ep, -ESHUTDOWN);
+
+#ifdef	USE_DMA
+	if (ep->dma >= 0) {
+		*ep->reg_drcmr = 0;
+		pxa_free_dma (ep->dma);
+		ep->dma = -1;
+	}
+#endif
+
+	/* flush fifo (mostly for IN buffers) */
+	pxa2xx_ep_fifo_flush (_ep);
+
+	ep->desc = 0;
+	ep->stopped = 1;
+
+	DBG(DBG_VERBOSE, "%s disabled\n", _ep->name);
+	return 0;
+}
+
+/*-------------------------------------------------------------------------*/
+
+/* for the pxa2xx, these can just wrap kmalloc/kfree.  gadget drivers
+ * must still pass correctly initialized endpoints, since other controller
+ * drivers may care about how it's currently set up (dma issues etc).
+ */
+
+/*
+ * 	pxa2xx_ep_alloc_request - allocate a request data structure
+ */
+static struct usb_request *
+pxa2xx_ep_alloc_request (struct usb_ep *_ep, int gfp_flags)
+{
+	struct pxa2xx_request *req;
+
+	req = kmalloc (sizeof *req, gfp_flags);
+	if (!req)
+		return 0;
+
+	memset (req, 0, sizeof *req);
+	INIT_LIST_HEAD (&req->queue);
+	return &req->req;
+}
+
+
+/*
+ * 	pxa2xx_ep_free_request - deallocate a request data structure
+ */
+static void
+pxa2xx_ep_free_request (struct usb_ep *_ep, struct usb_request *_req)
+{
+	struct pxa2xx_request	*req;
+
+	req = container_of (_req, struct pxa2xx_request, req);
+	WARN_ON (!list_empty (&req->queue));
+	kfree(req);
+}
+
+
+/* PXA cache needs flushing with DMA I/O (it's dma-incoherent), but there's
+ * no device-affinity and the heap works perfectly well for i/o buffers.
+ * It wastes much less memory than dma_alloc_coherent() would, and even
+ * prevents cacheline (32 bytes wide) sharing problems.
+ */
+static void *
+pxa2xx_ep_alloc_buffer(struct usb_ep *_ep, unsigned bytes,
+	dma_addr_t *dma, int gfp_flags)
+{
+	char			*retval;
+
+	retval = kmalloc (bytes, gfp_flags & ~(__GFP_DMA|__GFP_HIGHMEM));
+	if (retval)
+		*dma = virt_to_bus (retval);
+	return retval;
+}
+
+static void
+pxa2xx_ep_free_buffer(struct usb_ep *_ep, void *buf, dma_addr_t dma,
+		unsigned bytes)
+{
+	kfree (buf);
+}
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ *	done - retire a request; caller blocked irqs
+ */
+static void done(struct pxa2xx_ep *ep, struct pxa2xx_request *req, int status)
+{
+	unsigned		stopped = ep->stopped;
+
+	list_del_init(&req->queue);
+
+	if (likely (req->req.status == -EINPROGRESS))
+		req->req.status = status;
+	else
+		status = req->req.status;
+
+	if (status && status != -ESHUTDOWN)
+		DBG(DBG_VERBOSE, "complete %s req %p stat %d len %u/%u\n",
+			ep->ep.name, &req->req, status,
+			req->req.actual, req->req.length);
+
+	/* don't modify queue heads during completion callback */
+	ep->stopped = 1;
+	req->req.complete(&ep->ep, &req->req);
+	ep->stopped = stopped;
+}
+
+
+static inline void ep0_idle (struct pxa2xx_udc *dev)
+{
+	dev->ep0state = EP0_IDLE;
+	LED_EP0_OFF;
+}
+
+static int
+write_packet(volatile u32 *uddr, struct pxa2xx_request *req, unsigned max)
+{
+	u8		*buf;
+	unsigned	length, count;
+
+	buf = req->req.buf + req->req.actual;
+	prefetch(buf);
+
+	/* how big will this packet be? */
+	length = min(req->req.length - req->req.actual, max);
+	req->req.actual += length;
+
+	count = length;
+	while (likely(count--))
+		*uddr = *buf++;
+
+	return length;
+}
+
+/*
+ * write to an IN endpoint fifo, as many packets as possible.
+ * irqs will use this to write the rest later.
+ * caller guarantees at least one packet buffer is ready (or a zlp).
+ */
+static int
+write_fifo (struct pxa2xx_ep *ep, struct pxa2xx_request *req)
+{
+	unsigned		max;
+
+	max = ep->desc->wMaxPacketSize;
+	do {
+		unsigned	count;
+		int		is_last, is_short;
+
+		count = write_packet(ep->reg_uddr, req, max);
+
+		/* last packet is usually short (or a zlp) */
+		if (unlikely (count != max))
+			is_last = is_short = 1;
+		else {
+			if (likely(req->req.length != req->req.actual)
+					|| req->req.zero)
+				is_last = 0;
+			else
+				is_last = 1;
+			/* interrupt/iso maxpacket may not fill the fifo */
+			is_short = unlikely (max < ep->ep.maxpacket);
+
+			/* FIXME ep.maxpacket should be the current size,
+			 * modified (for periodic endpoints) when the
+			 * ep is enabled.  do that, re-init as needed,
+			 * and change maxpacket refs accordingly.
+			 */
+		}
+
+		DBG(DBG_VERY_NOISY, "wrote %s %d bytes%s%s %d left %p\n",
+			ep->ep.name, count,
+			is_last ? "/L" : "", is_short ? "/S" : "",
+			req->req.length - req->req.actual, req);
+
+		/* let loose that packet. maybe try writing another one,
+		 * double buffering might work.  TSP, TPC, and TFS
+		 * bit values are the same for all normal IN endpoints.
+		 */
+		*ep->reg_udccs = UDCCS_BI_TPC;
+		if (is_short)
+			*ep->reg_udccs = UDCCS_BI_TSP;
+
+		/* requests complete when all IN data is in the FIFO */
+		if (is_last) {
+			done (ep, req, 0);
+			if (list_empty(&ep->queue) || unlikely(ep->dma >= 0)) {
+				pio_irq_disable (ep->bEndpointAddress);
+#ifdef USE_DMA
+				/* unaligned data and zlps couldn't use dma */
+				if (unlikely(!list_empty(&ep->queue))) {
+					req = list_entry(ep->queue.next,
+						struct pxa2xx_request, queue);
+					kick_dma(ep,req);
+					return 0;
+				}
+#endif
+			}
+			return 1;
+		}
+
+		// TODO experiment: how robust can fifo mode tweaking be?
+		// double buffering is off in the default fifo mode, which
+		// prevents TFS from being set here.
+
+	} while (*ep->reg_udccs & UDCCS_BI_TFS);
+	return 0;
+}
+
+/* caller asserts req->pending (ep0 irq status nyet cleared); starts
+ * ep0 data stage.  these chips want very simple state transitions.
+ */
+static inline
+void ep0start(struct pxa2xx_udc *dev, u32 flags, const char *tag)
+{
+	UDCCS0 = flags|UDCCS0_SA|UDCCS0_OPR;
+	USIR0 = USIR0_IR0;
+	dev->req_pending = 0;
+	DBG(DBG_VERY_NOISY, "%s %s, %02x/%02x\n",
+		__FUNCTION__, tag, UDCCS0, flags);
+}
+
+static int
+write_ep0_fifo (struct pxa2xx_ep *ep, struct pxa2xx_request *req)
+{
+	unsigned	count;
+	int		is_short;
+
+	count = write_packet(&UDDR0, req, EP0_FIFO_SIZE);
+	ep->dev->stats.write.bytes += count;
+
+	/* last packet "must be" short (or a zlp) */
+	is_short = (count != EP0_FIFO_SIZE);
+
+	DBG(DBG_VERY_NOISY, "ep0in %d bytes %d left %p\n", count,
+		req->req.length - req->req.actual, req);
+
+	if (unlikely (is_short)) {
+		if (ep->dev->req_pending)
+			ep0start(ep->dev, UDCCS0_IPR, "short IN");
+		else
+			UDCCS0 = UDCCS0_IPR;
+
+		count = req->req.length;
+		done (ep, req, 0);
+		ep0_idle(ep->dev);
+#if 1
+		/* This seems to get rid of lost status irqs in some cases:
+		 * host responds quickly, or next request involves config
+		 * change automagic, or should have been hidden, or ...
+		 *
+		 * FIXME get rid of all udelays possible...
+		 */
+		if (count >= EP0_FIFO_SIZE) {
+			count = 100;
+			do {
+				if ((UDCCS0 & UDCCS0_OPR) != 0) {
+					/* clear OPR, generate ack */
+					UDCCS0 = UDCCS0_OPR;
+					break;
+				}
+				count--;
+				udelay(1);
+			} while (count);
+		}
+#endif
+	} else if (ep->dev->req_pending)
+		ep0start(ep->dev, 0, "IN");
+	return is_short;
+}
+
+
+/*
+ * read_fifo -  unload packet(s) from the fifo we use for usb OUT
+ * transfers and put them into the request.  caller should have made
+ * sure there's at least one packet ready.
+ *
+ * returns true if the request completed because of short packet or the
+ * request buffer having filled (and maybe overran till end-of-packet).
+ */
+static int
+read_fifo (struct pxa2xx_ep *ep, struct pxa2xx_request *req)
+{
+	for (;;) {
+		u32		udccs;
+		u8		*buf;
+		unsigned	bufferspace, count, is_short;
+
+		/* make sure there's a packet in the FIFO.
+		 * UDCCS_{BO,IO}_RPC are all the same bit value.
+		 * UDCCS_{BO,IO}_RNE are all the same bit value.
+		 */
+		udccs = *ep->reg_udccs;
+		if (unlikely ((udccs & UDCCS_BO_RPC) == 0))
+			break;
+		buf = req->req.buf + req->req.actual;
+		prefetchw(buf);
+		bufferspace = req->req.length - req->req.actual;
+
+		/* read all bytes from this packet */
+		if (likely (udccs & UDCCS_BO_RNE)) {
+			count = 1 + (0x0ff & *ep->reg_ubcr);
+			req->req.actual += min (count, bufferspace);
+		} else /* zlp */
+			count = 0;
+		is_short = (count < ep->desc->wMaxPacketSize);
+		DBG(DBG_VERY_NOISY, "read %s %02x, %d bytes%s req %p %d/%d\n",
+			ep->ep.name, udccs, count,
+			is_short ? "/S" : "",
+			req, req->req.actual, req->req.length);
+		while (likely (count-- != 0)) {
+			u8	byte = (u8) *ep->reg_uddr;
+
+			if (unlikely (bufferspace == 0)) {
+				/* this happens when the driver's buffer
+				 * is smaller than what the host sent.
+				 * discard the extra data.
+				 */
+				if (req->req.status != -EOVERFLOW)
+					DMSG("%s overflow %d\n",
+						ep->ep.name, count);
+				req->req.status = -EOVERFLOW;
+			} else {
+				*buf++ = byte;
+				bufferspace--;
+			}
+		}
+		*ep->reg_udccs =  UDCCS_BO_RPC;
+		/* RPC/RSP/RNE could now reflect the other packet buffer */
+
+		/* iso is one request per packet */
+		if (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC) {
+			if (udccs & UDCCS_IO_ROF)
+				req->req.status = -EHOSTUNREACH;
+			/* more like "is_done" */
+			is_short = 1;
+		}
+
+		/* completion */
+		if (is_short || req->req.actual == req->req.length) {
+			done (ep, req, 0);
+			if (list_empty(&ep->queue))
+				pio_irq_disable (ep->bEndpointAddress);
+			return 1;
+		}
+
+		/* finished that packet.  the next one may be waiting... */
+	}
+	return 0;
+}
+
+/*
+ * special ep0 version of the above.  no UBCR0 or double buffering; status
+ * handshaking is magic.  most device protocols don't need control-OUT.
+ * CDC vendor commands (and RNDIS), mass storage CB/CBI, and some other
+ * protocols do use them.
+ */
+static int
+read_ep0_fifo (struct pxa2xx_ep *ep, struct pxa2xx_request *req)
+{
+	u8		*buf, byte;
+	unsigned	bufferspace;
+
+	buf = req->req.buf + req->req.actual;
+	bufferspace = req->req.length - req->req.actual;
+
+	while (UDCCS0 & UDCCS0_RNE) {
+		byte = (u8) UDDR0;
+
+		if (unlikely (bufferspace == 0)) {
+			/* this happens when the driver's buffer
+			 * is smaller than what the host sent.
+			 * discard the extra data.
+			 */
+			if (req->req.status != -EOVERFLOW)
+				DMSG("%s overflow\n", ep->ep.name);
+			req->req.status = -EOVERFLOW;
+		} else {
+			*buf++ = byte;
+			req->req.actual++;
+			bufferspace--;
+		}
+	}
+
+	UDCCS0 = UDCCS0_OPR | UDCCS0_IPR;
+
+	/* completion */
+	if (req->req.actual >= req->req.length)
+		return 1;
+
+	/* finished that packet.  the next one may be waiting... */
+	return 0;
+}
+
+#ifdef	USE_DMA
+
+#define	MAX_IN_DMA	((DCMD_LENGTH + 1) - BULK_FIFO_SIZE)
+
+static void
+start_dma_nodesc(struct pxa2xx_ep *ep, struct pxa2xx_request *req, int is_in)
+{
+	u32	dcmd = req->req.length;
+	u32	buf = req->req.dma;
+	u32	fifo = io_v2p ((u32)ep->reg_uddr);
+
+	/* caller guarantees there's a packet or more remaining
+	 *  - IN may end with a short packet (TSP set separately),
+	 *  - OUT is always full length
+	 */
+	buf += req->req.actual;
+	dcmd -= req->req.actual;
+	ep->dma_fixup = 0;
+
+	/* no-descriptor mode can be simple for bulk-in, iso-in, iso-out */
+	DCSR(ep->dma) = DCSR_NODESC;
+	if (is_in) {
+		DSADR(ep->dma) = buf;
+		DTADR(ep->dma) = fifo;
+		if (dcmd > MAX_IN_DMA)
+			dcmd = MAX_IN_DMA;
+		else
+			ep->dma_fixup = (dcmd % ep->ep.maxpacket) != 0;
+		dcmd |= DCMD_BURST32 | DCMD_WIDTH1
+			| DCMD_FLOWTRG | DCMD_INCSRCADDR;
+	} else {
+#ifdef USE_OUT_DMA
+		DSADR(ep->dma) = fifo;
+		DTADR(ep->dma) = buf;
+		if (ep->bmAttributes != USB_ENDPOINT_XFER_ISOC)
+			dcmd = ep->ep.maxpacket;
+		dcmd |= DCMD_BURST32 | DCMD_WIDTH1
+			| DCMD_FLOWSRC | DCMD_INCTRGADDR;
+#endif
+	}
+	DCMD(ep->dma) = dcmd;
+	DCSR(ep->dma) = DCSR_RUN | DCSR_NODESC
+		| (unlikely(is_in)
+			? DCSR_STOPIRQEN	/* use dma_nodesc_handler() */
+			: 0);			/* use handle_ep() */
+}
+
+static void kick_dma(struct pxa2xx_ep *ep, struct pxa2xx_request *req)
+{
+	int	is_in = ep->bEndpointAddress & USB_DIR_IN;
+
+	if (is_in) {
+		/* unaligned tx buffers and zlps only work with PIO */
+		if ((req->req.dma & 0x0f) != 0
+				|| unlikely((req->req.length - req->req.actual)
+						== 0)) {
+			pio_irq_enable(ep->bEndpointAddress);
+			if ((*ep->reg_udccs & UDCCS_BI_TFS) != 0)
+				(void) write_fifo(ep, req);
+		} else {
+			start_dma_nodesc(ep, req, USB_DIR_IN);
+		}
+	} else {
+		if ((req->req.length - req->req.actual) < ep->ep.maxpacket) {
+			DMSG("%s short dma read...\n", ep->ep.name);
+			/* we're always set up for pio out */
+			read_fifo (ep, req);
+		} else {
+			*ep->reg_udccs = UDCCS_BO_DME
+				| (*ep->reg_udccs & UDCCS_BO_FST);
+			start_dma_nodesc(ep, req, USB_DIR_OUT);
+		}
+	}
+}
+
+static void cancel_dma(struct pxa2xx_ep *ep)
+{
+	struct pxa2xx_request	*req;
+	u32			tmp;
+
+	if (DCSR(ep->dma) == 0 || list_empty(&ep->queue))
+		return;
+
+	DCSR(ep->dma) = 0;
+	while ((DCSR(ep->dma) & DCSR_STOPSTATE) == 0)
+		cpu_relax();
+
+	req = list_entry(ep->queue.next, struct pxa2xx_request, queue);
+	tmp = DCMD(ep->dma) & DCMD_LENGTH;
+	req->req.actual = req->req.length - (tmp & DCMD_LENGTH);
+
+	/* the last tx packet may be incomplete, so flush the fifo.
+	 * FIXME correct req.actual if we can
+	 */
+	if (ep->bEndpointAddress & USB_DIR_IN)
+		*ep->reg_udccs = UDCCS_BI_FTF;
+}
+
+/* dma channel stopped ... normal tx end (IN), or on error (IN/OUT) */
+static void dma_nodesc_handler(int dmach, void *_ep, struct pt_regs *r)
+{
+	struct pxa2xx_ep	*ep = _ep;
+	struct pxa2xx_request	*req;
+	u32			tmp, completed;
+
+	local_irq_disable();
+
+	req = list_entry(ep->queue.next, struct pxa2xx_request, queue);
+
+	ep->dma_irqs++;
+	ep->dev->stats.irqs++;
+	HEX_DISPLAY(ep->dev->stats.irqs);
+
+	/* ack/clear */
+	tmp = DCSR(ep->dma);
+	DCSR(ep->dma) = tmp;
+	if ((tmp & DCSR_STOPSTATE) == 0
+			|| (DDADR(ep->dma) & DDADR_STOP) != 0) {
+		DBG(DBG_VERBOSE, "%s, dcsr %08x ddadr %08x\n",
+			ep->ep.name, DCSR(ep->dma), DDADR(ep->dma));
+		goto done;
+	}
+	DCSR(ep->dma) = 0;	/* clear DCSR_STOPSTATE */
+
+	/* update transfer status */
+	completed = tmp & DCSR_BUSERR;
+	if (ep->bEndpointAddress & USB_DIR_IN)
+		tmp = DSADR(ep->dma);
+	else
+		tmp = DTADR(ep->dma);
+	req->req.actual = tmp - req->req.dma;
+
+	/* FIXME seems we sometimes see partial transfers... */
+
+	if (unlikely(completed != 0))
+		req->req.status = -EIO;
+	else if (req->req.actual) {
+		/* these registers have zeroes in low bits; they miscount
+		 * some (end-of-transfer) short packets:  tx 14 as tx 12
+		 */
+		if (ep->dma_fixup)
+			req->req.actual = min(req->req.actual + 3,
+						req->req.length);
+
+		tmp = (req->req.length - req->req.actual);
+		completed = (tmp == 0);
+		if (completed && (ep->bEndpointAddress & USB_DIR_IN)) {
+
+			/* maybe validate final short packet ... */
+			if ((req->req.actual % ep->ep.maxpacket) != 0)
+				*ep->reg_udccs = UDCCS_BI_TSP/*|UDCCS_BI_TPC*/;
+
+			/* ... or zlp, using pio fallback */
+			else if (ep->bmAttributes == USB_ENDPOINT_XFER_BULK
+					&& req->req.zero) {
+				DMSG("%s zlp terminate ...\n", ep->ep.name);
+				completed = 0;
+			}
+		}
+	}
+
+	if (likely(completed)) {
+		done(ep, req, 0);
+
+		/* maybe re-activate after completion */
+		if (ep->stopped || list_empty(&ep->queue))
+			goto done;
+		req = list_entry(ep->queue.next, struct pxa2xx_request, queue);
+	}
+	kick_dma(ep, req);
+done:
+	local_irq_enable();
+}
+
+#endif
+
+/*-------------------------------------------------------------------------*/
+
+static int
+pxa2xx_ep_queue(struct usb_ep *_ep, struct usb_request *_req, int gfp_flags)
+{
+	struct pxa2xx_request	*req;
+	struct pxa2xx_ep	*ep;
+	struct pxa2xx_udc	*dev;
+	unsigned long		flags;
+
+	req = container_of(_req, struct pxa2xx_request, req);
+	if (unlikely (!_req || !_req->complete || !_req->buf
+			|| !list_empty(&req->queue))) {
+		DMSG("%s, bad params\n", __FUNCTION__);
+		return -EINVAL;
+	}
+
+	ep = container_of(_ep, struct pxa2xx_ep, ep);
+	if (unlikely (!_ep || (!ep->desc && ep->ep.name != ep0name))) {
+		DMSG("%s, bad ep\n", __FUNCTION__);
+		return -EINVAL;
+	}
+
+	dev = ep->dev;
+	if (unlikely (!dev->driver
+			|| dev->gadget.speed == USB_SPEED_UNKNOWN)) {
+		DMSG("%s, bogus device state\n", __FUNCTION__);
+		return -ESHUTDOWN;
+	}
+
+	/* iso is always one packet per request, that's the only way
+	 * we can report per-packet status.  that also helps with dma.
+	 */
+	if (unlikely (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC
+			&& req->req.length > ep->desc->wMaxPacketSize))
+		return -EMSGSIZE;
+
+#ifdef	USE_DMA
+	// FIXME caller may already have done the dma mapping
+	if (ep->dma >= 0) {
+		_req->dma = dma_map_single(&dev->dev.dev,
+			_req->buf, _req->length,
+			((ep->bEndpointAddress & USB_DIR_IN) != 0)
+				? DMA_TO_DEVICE
+				: DMA_FROM_DEVICE);
+	}
+#endif
+
+	DBG(DBG_NOISY, "%s queue req %p, len %d buf %p\n",
+	     _ep->name, _req, _req->length, _req->buf);
+
+	local_irq_save(flags);
+
+	_req->status = -EINPROGRESS;
+	_req->actual = 0;
+
+	/* kickstart this i/o queue? */
+	if (list_empty(&ep->queue) && !ep->stopped) {
+		if (ep->desc == 0 /* ep0 */) {
+			unsigned	length = _req->length;
+
+			switch (dev->ep0state) {
+			case EP0_IN_DATA_PHASE:
+				dev->stats.write.ops++;
+				if (write_ep0_fifo(ep, req))
+					req = 0;
+				break;
+
+			case EP0_OUT_DATA_PHASE:
+				dev->stats.read.ops++;
+				/* messy ... */
+				if (dev->req_config) {
+					DBG(DBG_VERBOSE, "ep0 config ack%s\n",
+						dev->has_cfr ?  "" : " raced");
+					if (dev->has_cfr)
+						UDCCFR = UDCCFR_AREN|UDCCFR_ACM;
+					done(ep, req, 0);
+					dev->ep0state = EP0_END_XFER;
+					return 0;
+				}
+				if (dev->req_pending)
+					ep0start(dev, UDCCS0_IPR, "OUT");
+				if (length == 0 || ((UDCCS0 & UDCCS0_RNE) != 0
+						&& read_ep0_fifo(ep, req))) {
+					ep0_idle(dev);
+					done(ep, req, 0);
+					req = 0;
+				}
+				break;
+
+			default:
+				DMSG("ep0 i/o, odd state %d\n", dev->ep0state);
+				local_irq_restore (flags);
+				return -EL2HLT;
+			}
+#ifdef	USE_DMA
+		/* either start dma or prime pio pump */
+		} else if (ep->dma >= 0) {
+			kick_dma(ep, req);
+#endif
+		/* can the FIFO can satisfy the request immediately? */
+		} else if ((ep->bEndpointAddress & USB_DIR_IN) != 0
+				&& (*ep->reg_udccs & UDCCS_BI_TFS) != 0
+				&& write_fifo(ep, req)) {
+			req = 0;
+		} else if ((*ep->reg_udccs & UDCCS_BO_RFS) != 0
+				&& read_fifo(ep, req)) {
+			req = 0;
+		}
+
+		if (likely (req && ep->desc) && ep->dma < 0)
+			pio_irq_enable(ep->bEndpointAddress);
+	}
+
+	/* pio or dma irq handler advances the queue. */
+	if (likely (req != 0))
+		list_add_tail(&req->queue, &ep->queue);
+	local_irq_restore(flags);
+
+	return 0;
+}
+
+
+/*
+ * 	nuke - dequeue ALL requests
+ */
+static void nuke(struct pxa2xx_ep *ep, int status)
+{
+	struct pxa2xx_request *req;
+
+	/* called with irqs blocked */
+#ifdef	USE_DMA
+	if (ep->dma >= 0 && !ep->stopped)
+		cancel_dma(ep);
+#endif
+	while (!list_empty(&ep->queue)) {
+		req = list_entry(ep->queue.next,
+				struct pxa2xx_request,
+				queue);
+		done(ep, req, status);
+	}
+	if (ep->desc)
+		pio_irq_disable (ep->bEndpointAddress);
+}
+
+
+/* dequeue JUST ONE request */
+static int pxa2xx_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
+{
+	struct pxa2xx_ep	*ep;
+	struct pxa2xx_request	*req;
+	unsigned long		flags;
+
+	ep = container_of(_ep, struct pxa2xx_ep, ep);
+	req = container_of(_req, struct pxa2xx_request, req);
+	if (!_ep || !_req || ep->ep.name == ep0name)
+		return -EINVAL;
+
+	local_irq_save(flags);
+#ifdef	USE_DMA
+	if (ep->dma >= 0 && ep->queue.next == &req->queue && !ep->stopped) {
+		cancel_dma(ep);
+		done(ep, req, -ECONNRESET);
+		/* restart i/o */
+		if (!list_empty(&ep->queue)) {
+			req = list_entry(ep->queue.next,
+					struct pxa2xx_request, queue);
+			kick_dma(ep, req);
+		}
+	} else
+#endif
+	if (!list_empty(&req->queue))
+		done(ep, req, -ECONNRESET);
+	else
+		req = 0;
+	local_irq_restore(flags);
+
+	return req ? 0 : -EOPNOTSUPP;
+}
+
+/*-------------------------------------------------------------------------*/
+
+static int pxa2xx_ep_set_halt(struct usb_ep *_ep, int value)
+{
+	struct pxa2xx_ep	*ep;
+	unsigned long		flags;
+
+	ep = container_of(_ep, struct pxa2xx_ep, ep);
+	if (unlikely (!_ep
+			|| (!ep->desc && ep->ep.name != ep0name))
+			|| ep->bmAttributes == USB_ENDPOINT_XFER_ISOC) {
+		DMSG("%s, bad ep\n", __FUNCTION__);
+		return -EINVAL;
+	}
+	if (value == 0) {
+		/* this path (reset toggle+halt) is needed to implement
+		 * SET_INTERFACE on normal hardware.  but it can't be
+		 * done from software on the PXA UDC, and the hardware
+		 * forgets to do it as part of SET_INTERFACE automagic.
+		 */
+		DMSG("only host can clear %s halt\n", _ep->name);
+		return -EROFS;
+	}
+
+	local_irq_save(flags);
+
+	if ((ep->bEndpointAddress & USB_DIR_IN) != 0
+			&& ((*ep->reg_udccs & UDCCS_BI_TFS) == 0
+			   || !list_empty(&ep->queue))) {
+		local_irq_restore(flags);
+		return -EAGAIN;
+	}
+
+	/* FST bit is the same for control, bulk in, bulk out, interrupt in */
+	*ep->reg_udccs = UDCCS_BI_FST|UDCCS_BI_FTF;
+
+	/* ep0 needs special care */
+	if (!ep->desc) {
+		start_watchdog(ep->dev);
+		ep->dev->req_pending = 0;
+		ep->dev->ep0state = EP0_STALL;
+		LED_EP0_OFF;
+
+ 	/* and bulk/intr endpoints like dropping stalls too */
+ 	} else {
+ 		unsigned i;
+ 		for (i = 0; i < 1000; i += 20) {
+ 			if (*ep->reg_udccs & UDCCS_BI_SST)
+ 				break;
+ 			udelay(20);
+ 		}
+  	}
+ 	local_irq_restore(flags);
+
+	DBG(DBG_VERBOSE, "%s halt\n", _ep->name);
+	return 0;
+}
+
+static int pxa2xx_ep_fifo_status(struct usb_ep *_ep)
+{
+	struct pxa2xx_ep        *ep;
+
+	ep = container_of(_ep, struct pxa2xx_ep, ep);
+	if (!_ep) {
+		DMSG("%s, bad ep\n", __FUNCTION__);
+		return -ENODEV;
+	}
+	/* pxa can't report unclaimed bytes from IN fifos */
+	if ((ep->bEndpointAddress & USB_DIR_IN) != 0)
+		return -EOPNOTSUPP;
+	if (ep->dev->gadget.speed == USB_SPEED_UNKNOWN
+			|| (*ep->reg_udccs & UDCCS_BO_RFS) == 0)
+		return 0;
+	else
+		return (*ep->reg_ubcr & 0xfff) + 1;
+}
+
+static void pxa2xx_ep_fifo_flush(struct usb_ep *_ep)
+{
+	struct pxa2xx_ep        *ep;
+
+	ep = container_of(_ep, struct pxa2xx_ep, ep);
+	if (!_ep || ep->ep.name == ep0name || !list_empty(&ep->queue)) {
+		DMSG("%s, bad ep\n", __FUNCTION__);
+		return;
+	}
+
+	/* toggle and halt bits stay unchanged */
+
+	/* for OUT, just read and discard the FIFO contents. */
+	if ((ep->bEndpointAddress & USB_DIR_IN) == 0) {
+		while (((*ep->reg_udccs) & UDCCS_BO_RNE) != 0)
+			(void) *ep->reg_uddr;
+		return;
+	}
+
+	/* most IN status is the same, but ISO can't stall */
+	*ep->reg_udccs = UDCCS_BI_TPC|UDCCS_BI_FTF|UDCCS_BI_TUR
+		| (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC)
+			? 0 : UDCCS_BI_SST;
+}
+
+
+static struct usb_ep_ops pxa2xx_ep_ops = {
+	.enable		= pxa2xx_ep_enable,
+	.disable	= pxa2xx_ep_disable,
+
+	.alloc_request	= pxa2xx_ep_alloc_request,
+	.free_request	= pxa2xx_ep_free_request,
+
+	.alloc_buffer	= pxa2xx_ep_alloc_buffer,
+	.free_buffer	= pxa2xx_ep_free_buffer,
+
+	.queue		= pxa2xx_ep_queue,
+	.dequeue	= pxa2xx_ep_dequeue,
+
+	.set_halt	= pxa2xx_ep_set_halt,
+	.fifo_status	= pxa2xx_ep_fifo_status,
+	.fifo_flush	= pxa2xx_ep_fifo_flush,
+};
+
+
+/* ---------------------------------------------------------------------------
+ * 	device-scoped parts of the api to the usb controller hardware
+ * ---------------------------------------------------------------------------
+ */
+
+static int pxa2xx_udc_get_frame(struct usb_gadget *_gadget)
+{
+	return ((UFNRH & 0x07) << 8) | (UFNRL & 0xff);
+}
+
+static int pxa2xx_udc_wakeup(struct usb_gadget *_gadget)
+{
+	/* host may not have enabled remote wakeup */
+	if ((UDCCS0 & UDCCS0_DRWF) == 0)
+		return -EHOSTUNREACH;
+	udc_set_mask_UDCCR(UDCCR_RSM);
+	return 0;
+}
+
+static const struct usb_gadget_ops pxa2xx_udc_ops = {
+	.get_frame	 = pxa2xx_udc_get_frame,
+	.wakeup		 = pxa2xx_udc_wakeup,
+	// current versions must always be self-powered
+};
+
+
+/*-------------------------------------------------------------------------*/
+
+#ifdef UDC_PROC_FILE
+
+static const char proc_node_name [] = "driver/udc";
+
+static int
+udc_proc_read(char *page, char **start, off_t off, int count,
+		int *eof, void *_dev)
+{
+	char			*buf = page;
+	struct pxa2xx_udc	*dev = _dev;
+	char			*next = buf;
+	unsigned		size = count;
+	unsigned long		flags;
+	int			i, t;
+	u32			tmp;
+
+	if (off != 0)
+		return 0;
+
+	local_irq_save(flags);
+
+	/* basic device status */
+	t = snprintf(next, size, DRIVER_DESC "\n"
+		"%s version: %s\nGadget driver: %s\nHost %s\n\n",
+		driver_name, DRIVER_VERSION SIZE_STR DMASTR,
+		dev->driver ? dev->driver->driver.name : "(none)",
+		is_usb_connected() ? "full speed" : "disconnected");
+	size -= t;
+	next += t;
+
+	/* registers for device and ep0 */
+	t = snprintf(next, size,
+		"uicr %02X.%02X, usir %02X.%02x, ufnr %02X.%02X\n",
+		UICR1, UICR0, USIR1, USIR0, UFNRH, UFNRL);
+	size -= t;
+	next += t;
+
+	tmp = UDCCR;
+	t = snprintf(next, size,
+		"udccr %02X =%s%s%s%s%s%s%s%s\n", tmp,
+		(tmp & UDCCR_REM) ? " rem" : "",
+		(tmp & UDCCR_RSTIR) ? " rstir" : "",
+		(tmp & UDCCR_SRM) ? " srm" : "",
+		(tmp & UDCCR_SUSIR) ? " susir" : "",
+		(tmp & UDCCR_RESIR) ? " resir" : "",
+		(tmp & UDCCR_RSM) ? " rsm" : "",
+		(tmp & UDCCR_UDA) ? " uda" : "",
+		(tmp & UDCCR_UDE) ? " ude" : "");
+	size -= t;
+	next += t;
+
+	tmp = UDCCS0;
+	t = snprintf(next, size,
+		"udccs0 %02X =%s%s%s%s%s%s%s%s\n", tmp,
+		(tmp & UDCCS0_SA) ? " sa" : "",
+		(tmp & UDCCS0_RNE) ? " rne" : "",
+		(tmp & UDCCS0_FST) ? " fst" : "",
+		(tmp & UDCCS0_SST) ? " sst" : "",
+		(tmp & UDCCS0_DRWF) ? " dwrf" : "",
+		(tmp & UDCCS0_FTF) ? " ftf" : "",
+		(tmp & UDCCS0_IPR) ? " ipr" : "",
+		(tmp & UDCCS0_OPR) ? " opr" : "");
+	size -= t;
+	next += t;
+
+	if (dev->has_cfr) {
+		tmp = UDCCFR;
+		t = snprintf(next, size,
+			"udccfr %02X =%s%s\n", tmp,
+			(tmp & UDCCFR_AREN) ? " aren" : "",
+			(tmp & UDCCFR_ACM) ? " acm" : "");
+		size -= t;
+		next += t;
+	}
+
+	if (!is_usb_connected() || !dev->driver)
+		goto done;
+
+	t = snprintf(next, size, "ep0 IN %lu/%lu, OUT %lu/%lu\nirqs %lu\n\n",
+		dev->stats.write.bytes, dev->stats.write.ops,
+		dev->stats.read.bytes, dev->stats.read.ops,
+		dev->stats.irqs);
+	size -= t;
+	next += t;
+
+	/* dump endpoint queues */
+	for (i = 0; i < PXA_UDC_NUM_ENDPOINTS; i++) {
+		struct pxa2xx_ep	*ep = &dev->ep [i];
+		struct pxa2xx_request	*req;
+		int			t;
+
+		if (i != 0) {
+			const struct usb_endpoint_descriptor	*d;
+
+			d = ep->desc;
+			if (!d)
+				continue;
+			tmp = *dev->ep [i].reg_udccs;
+			t = snprintf(next, size,
+				"%s max %d %s udccs %02x irqs %lu/%lu\n",
+				ep->ep.name, le16_to_cpu (d->wMaxPacketSize),
+				(ep->dma >= 0) ? "dma" : "pio", tmp,
+				ep->pio_irqs, ep->dma_irqs);
+			/* TODO translate all five groups of udccs bits! */
+
+		} else /* ep0 should only have one transfer queued */
+			t = snprintf(next, size, "ep0 max 16 pio irqs %lu\n",
+				ep->pio_irqs);
+		if (t <= 0 || t > size)
+			goto done;
+		size -= t;
+		next += t;
+
+		if (list_empty(&ep->queue)) {
+			t = snprintf(next, size, "\t(nothing queued)\n");
+			if (t <= 0 || t > size)
+				goto done;
+			size -= t;
+			next += t;
+			continue;
+		}
+		list_for_each_entry(req, &ep->queue, queue) {
+#ifdef	USE_DMA
+			if (ep->dma >= 0 && req->queue.prev == &ep->queue)
+				t = snprintf(next, size,
+					"\treq %p len %d/%d "
+					"buf %p (dma%d dcmd %08x)\n",
+					&req->req, req->req.actual,
+					req->req.length, req->req.buf,
+					ep->dma, DCMD(ep->dma)
+					// low 13 bits == bytes-to-go
+					);
+			else
+#endif
+				t = snprintf(next, size,
+					"\treq %p len %d/%d buf %p\n",
+					&req->req, req->req.actual,
+					req->req.length, req->req.buf);
+			if (t <= 0 || t > size)
+				goto done;
+			size -= t;
+			next += t;
+		}
+	}
+
+done:
+	local_irq_restore(flags);
+	*eof = 1;
+	return count - size;
+}
+
+#define create_proc_files() \
+	create_proc_read_entry(proc_node_name, 0, NULL, udc_proc_read, dev)
+#define remove_proc_files() \
+	remove_proc_entry(proc_node_name, NULL)
+
+#else	/* !UDC_PROC_FILE */
+#define create_proc_files() do {} while (0)
+#define remove_proc_files() do {} while (0)
+
+#endif	/* UDC_PROC_FILE */
+
+/* "function" sysfs attribute */
+static ssize_t
+show_function (struct device *_dev, char *buf)
+{
+	struct pxa2xx_udc	*dev = dev_get_drvdata (_dev);
+
+	if (!dev->driver
+			|| !dev->driver->function
+			|| strlen (dev->driver->function) > PAGE_SIZE)
+		return 0;
+	return snprintf (buf, PAGE_SIZE, "%s\n", dev->driver->function);
+}
+static DEVICE_ATTR (function, S_IRUGO, show_function, NULL);
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * 	udc_disable - disable USB device controller
+ */
+static void udc_disable(struct pxa2xx_udc *dev)
+{
+	/* block all irqs */
+	udc_set_mask_UDCCR(UDCCR_SRM|UDCCR_REM);
+	UICR0 = UICR1 = 0xff;
+	UFNRH = UFNRH_SIM;
+
+	/* if hardware supports it, disconnect from usb */
+	make_usb_disappear();
+
+	udc_clear_mask_UDCCR(UDCCR_UDE);
+
+        /* Disable clock for USB device */
+        CKEN &= ~CKEN11_USB;
+
+	ep0_idle (dev);
+	dev->gadget.speed = USB_SPEED_UNKNOWN;
+	LED_CONNECTED_OFF;
+}
+
+
+/*
+ * 	udc_reinit - initialize software state
+ */
+static void udc_reinit(struct pxa2xx_udc *dev)
+{
+	u32	i;
+
+	/* device/ep0 records init */
+	INIT_LIST_HEAD (&dev->gadget.ep_list);
+	INIT_LIST_HEAD (&dev->gadget.ep0->ep_list);
+	dev->ep0state = EP0_IDLE;
+
+	/* basic endpoint records init */
+	for (i = 0; i < PXA_UDC_NUM_ENDPOINTS; i++) {
+		struct pxa2xx_ep *ep = &dev->ep[i];
+
+		if (i != 0)
+			list_add_tail (&ep->ep.ep_list, &dev->gadget.ep_list);
+
+		ep->desc = 0;
+		ep->stopped = 0;
+		INIT_LIST_HEAD (&ep->queue);
+		ep->pio_irqs = ep->dma_irqs = 0;
+	}
+
+	/* the rest was statically initialized, and is read-only */
+}
+
+/* until it's enabled, this UDC should be completely invisible
+ * to any USB host.
+ */
+static void udc_enable (struct pxa2xx_udc *dev)
+{
+	udc_clear_mask_UDCCR(UDCCR_UDE);
+
+        /* Enable clock for USB device */
+        CKEN |= CKEN11_USB;
+
+	/* try to clear these bits before we enable the udc */
+	udc_ack_int_UDCCR(UDCCR_SUSIR|/*UDCCR_RSTIR|*/UDCCR_RESIR);
+
+	ep0_idle(dev);
+	dev->gadget.speed = USB_SPEED_UNKNOWN;
+	dev->stats.irqs = 0;
+
+	/*
+	 * sequence taken from chapter 12.5.10, PXA250 AppProcDevManual:
+	 * - enable UDC
+	 * - if RESET is already in progress, ack interrupt
+	 * - unmask reset interrupt
+	 */
+	udc_set_mask_UDCCR(UDCCR_UDE);
+	if (!(UDCCR & UDCCR_UDA))
+		udc_ack_int_UDCCR(UDCCR_RSTIR);
+
+	if (dev->has_cfr /* UDC_RES2 is defined */) {
+		/* pxa255 (a0+) can avoid a set_config race that could
+		 * prevent gadget drivers from configuring correctly
+		 */
+		UDCCFR = UDCCFR_ACM;
+	} else {
+		/* "USB test mode" for pxa250 errata 40-42 (stepping a0, a1)
+		 * which could result in missing packets and interrupts.
+		 * supposedly one bit per endpoint, controlling whether it
+		 * double buffers or not; ACM/AREN bits fit into the holes.
+		 * zero bits (like USIR0_IRx) disable double buffering.
+		 */
+		UDC_RES1 = 0x00;
+		UDC_RES2 = 0x00;
+	}
+
+#ifdef	DISABLE_TEST_MODE
+	/* "test mode" seems to have become the default in later chip
+	 * revs, preventing double buffering (and invalidating docs).
+	 * this EXPERIMENT enables it for bulk endpoints by tweaking
+	 * undefined/reserved register bits (that other drivers clear).
+	 * Belcarra code comments noted this usage.
+	 */
+	if (fifo_mode & 1) {	/* IN endpoints */
+		UDC_RES1 |= USIR0_IR1|USIR0_IR6;
+		UDC_RES2 |= USIR1_IR11;
+	}
+	if (fifo_mode & 2) {	/* OUT endpoints */
+		UDC_RES1 |= USIR0_IR2|USIR0_IR7;
+		UDC_RES2 |= USIR1_IR12;
+	}
+#endif
+
+	/* caller must be able to sleep in order to cope
+	 * with startup transients.
+	 */
+	schedule_timeout(HZ/10);
+
+	/* enable suspend/resume and reset irqs */
+	udc_clear_mask_UDCCR(UDCCR_SRM | UDCCR_REM);
+
+	/* enable ep0 irqs */
+	UICR0 &= ~UICR0_IM0;
+
+	/* if hardware supports it, connect to usb and wait for host */
+	let_usb_appear();
+}
+
+
+/* when a driver is successfully registered, it will receive
+ * control requests including set_configuration(), which enables
+ * non-control requests.  then usb traffic follows until a
+ * disconnect is reported.  then a host may connect again, or
+ * the driver might get unbound.
+ */
+int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+{
+	struct pxa2xx_udc	*dev = the_controller;
+	int			retval;
+
+	if (!driver
+			|| driver->speed != USB_SPEED_FULL
+			|| !driver->bind
+			|| !driver->unbind
+			|| !driver->disconnect
+			|| !driver->setup)
+		return -EINVAL;
+	if (!dev)
+		return -ENODEV;
+	if (dev->driver)
+		return -EBUSY;
+
+	/* first hook up the driver ... */
+	dev->driver = driver;
+	dev->gadget.dev.driver = &driver->driver;
+
+	device_add (&dev->gadget.dev);
+	retval = driver->bind(&dev->gadget);
+	if (retval) {
+		DMSG("bind to driver %s --> error %d\n",
+				driver->driver.name, retval);
+		device_del (&dev->gadget.dev);
+
+		dev->driver = 0;
+		dev->gadget.dev.driver = 0;
+		return retval;
+	}
+	device_create_file(dev->dev, &dev_attr_function);
+
+	/* ... then enable host detection and ep0; and we're ready
+	 * for set_configuration as well as eventual disconnect.
+	 * NOTE:  this shouldn't power up until later.
+	 */
+	DMSG("registered gadget driver '%s'\n", driver->driver.name);
+	udc_enable(dev);
+	dump_state(dev);
+	return 0;
+}
+EXPORT_SYMBOL(usb_gadget_register_driver);
+
+static void
+stop_activity(struct pxa2xx_udc *dev, struct usb_gadget_driver *driver)
+{
+	int i;
+
+	/* don't disconnect drivers more than once */
+	if (dev->gadget.speed == USB_SPEED_UNKNOWN)
+		driver = 0;
+	dev->gadget.speed = USB_SPEED_UNKNOWN;
+
+	/* prevent new request submissions, kill any outstanding requests  */
+	for (i = 0; i < PXA_UDC_NUM_ENDPOINTS; i++) {
+		struct pxa2xx_ep *ep = &dev->ep[i];
+
+		ep->stopped = 1;
+		nuke(ep, -ESHUTDOWN);
+	}
+	del_timer_sync(&dev->timer);
+
+	/* report disconnect; the driver is already quiesced */
+	LED_CONNECTED_OFF;
+	if (driver)
+		driver->disconnect(&dev->gadget);
+
+	/* re-init driver-visible data structures */
+	udc_reinit(dev);
+}
+
+int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
+{
+	struct pxa2xx_udc	*dev = the_controller;
+
+	if (!dev)
+		return -ENODEV;
+	if (!driver || driver != dev->driver)
+		return -EINVAL;
+
+	local_irq_disable();
+	udc_disable(dev);
+	stop_activity(dev, driver);
+	driver->unbind(&dev->gadget);
+	dev->driver = 0;
+	local_irq_enable();
+
+	device_del (&dev->gadget.dev);
+	device_remove_file(dev->dev, &dev_attr_function);
+
+	DMSG("unregistered gadget driver '%s'\n", driver->driver.name);
+	dump_state(dev);
+	return 0;
+}
+EXPORT_SYMBOL(usb_gadget_unregister_driver);
+
+
+/*-------------------------------------------------------------------------*/
+
+#ifdef CONFIG_ARCH_LUBBOCK
+
+/* Lubbock can report connect or disconnect irqs.  Likely more hardware
+ * could support it as a timer callback.
+ *
+ * FIXME for better power management, keep the hardware powered down
+ * until a host is powering the link.  means scheduling work later
+ * in some task that can udc_enable().
+ */
+
+#define	enable_disconnect_irq() \
+	if (machine_is_lubbock()) { enable_irq(LUBBOCK_USB_DISC_IRQ); }
+#define	disable_disconnect_irq() \
+	if (machine_is_lubbock()) { disable_irq(LUBBOCK_USB_DISC_IRQ); }
+
+static irqreturn_t
+usb_connection_irq(int irq, void *_dev, struct pt_regs *r)
+{
+	struct pxa2xx_udc	*dev = _dev;
+
+	dev->stats.irqs++;
+	HEX_DISPLAY(dev->stats.irqs);
+
+	if (!is_usb_connected()) {
+		LED_CONNECTED_OFF;
+		disable_disconnect_irq();
+		/* report disconnect just once */
+		if (dev->gadget.speed != USB_SPEED_UNKNOWN) {
+			DMSG("disconnect %s\n",
+				dev->driver ? dev->driver->driver.name : 0);
+			stop_activity(dev, dev->driver);
+
+			// udc_disable (dev);
+			// no more udc irqs
+			// maybe "ACTION=disconnect /sbin/hotplug gadget".
+		}
+	} else if (dev->gadget.speed == USB_SPEED_UNKNOWN) {
+		LED_CONNECTED_ON;
+
+		DMSG("?? connect irq ??\n");
+
+		// if there's no driver bound, ignore; else
+		// udc_enable (dev);
+		// UDC irqs drive the rest.
+		// maybe "ACTION=connect /sbin/hotplug gadget".
+	}
+	return IRQ_HANDLED;
+}
+
+#endif
+
+#ifndef	enable_disconnect_irq
+#warning USB disconnect() is not yet reported.
+#define	enable_disconnect_irq()		do {} while (0)
+#define	disable_disconnect_irq()	do {} while (0)
+#endif
+
+
+/*-------------------------------------------------------------------------*/
+
+static inline void clear_ep_state (struct pxa2xx_udc *dev)
+{
+	unsigned i;
+
+	/* hardware SET_{CONFIGURATION,INTERFACE} automagic resets endpoint
+	 * fifos, and pending transactions mustn't be continued in any case.
+	 */
+	for (i = 1; i < PXA_UDC_NUM_ENDPOINTS; i++)
+		nuke(&dev->ep[i], -ECONNABORTED);
+}
+
+static void udc_watchdog(unsigned long _dev)
+{
+	struct pxa2xx_udc	*dev = (void *)_dev;
+
+	local_irq_disable();
+	if (dev->ep0state == EP0_STALL
+			&& (UDCCS0 & UDCCS0_FST) == 0
+			&& (UDCCS0 & UDCCS0_SST) == 0) {
+		UDCCS0 = UDCCS0_FST|UDCCS0_FTF;
+		DBG(DBG_VERBOSE, "ep0 re-stall\n");
+		start_watchdog(dev);
+	}
+	local_irq_enable();
+}
+
+static void handle_ep0 (struct pxa2xx_udc *dev)
+{
+	u32			udccs0 = UDCCS0;
+	struct pxa2xx_ep	*ep = &dev->ep [0];
+	struct pxa2xx_request	*req;
+	union {
+		struct usb_ctrlrequest	r;
+		u8			raw [8];
+		u32			word [2];
+	} u;
+
+	if (list_empty(&ep->queue))
+		req = 0;
+	else
+		req = list_entry(ep->queue.next, struct pxa2xx_request, queue);
+
+	/* clear stall status */
+	if (udccs0 & UDCCS0_SST) {
+		nuke(ep, -EPIPE);
+		UDCCS0 = UDCCS0_SST;
+		del_timer(&dev->timer);
+		ep0_idle(dev);
+	}
+
+	/* previous request unfinished?  non-error iff back-to-back ... */
+	if ((udccs0 & UDCCS0_SA) != 0 && dev->ep0state != EP0_IDLE) {
+		nuke(ep, 0);
+		del_timer(&dev->timer);
+		ep0_idle(dev);
+	}
+
+	switch (dev->ep0state) {
+	case EP0_IDLE:
+		/* late-breaking status? */
+		udccs0 = UDCCS0;
+
+		/* start control request? */
+		if (likely((udccs0 & (UDCCS0_OPR|UDCCS0_SA|UDCCS0_RNE))
+				== (UDCCS0_OPR|UDCCS0_SA|UDCCS0_RNE))) {
+			int i;
+
+			nuke (ep, -EPROTO);
+
+			/* read SETUP packet */
+			for (i = 0; i < 8; i++) {
+				if (unlikely(!(UDCCS0 & UDCCS0_RNE))) {
+bad_setup:
+					DMSG("SETUP %d!\n", i);
+					goto stall;
+				}
+				u.raw [i] = (u8) UDDR0;
+			}
+			if (unlikely((UDCCS0 & UDCCS0_RNE) != 0))
+				goto bad_setup;
+
+got_setup:
+			le16_to_cpus (&u.r.wValue);
+			le16_to_cpus (&u.r.wIndex);
+			le16_to_cpus (&u.r.wLength);
+
+			LED_EP0_ON;
+			DBG(DBG_VERBOSE, "SETUP %02x.%02x v%04x i%04x l%04x\n",
+				u.r.bRequestType, u.r.bRequest,
+				u.r.wValue, u.r.wIndex, u.r.wLength);
+
+			/* cope with automagic for some standard requests. */
+			dev->req_std = (u.r.bRequestType & USB_TYPE_MASK)
+						== USB_TYPE_STANDARD;
+			dev->req_config = 0;
+			dev->req_pending = 1;
+			switch (u.r.bRequest) {
+			/* hardware restricts gadget drivers here! */
+			case USB_REQ_SET_CONFIGURATION:
+				if (u.r.bRequestType == USB_RECIP_DEVICE) {
+					/* reflect hardware's automagic
+					 * up to the gadget driver.
+					 */
+config_change:
+					dev->req_config = 1;
+					clear_ep_state(dev);
+					/* if !has_cfr, there's no synch
+					 * else use AREN (later) not SA|OPR
+					 * USIR0_IR0 acts edge sensitive
+					 */
+					dev->req_pending = 0;
+				}
+				break;
+			/* ... and here, even more ... */
+			case USB_REQ_SET_INTERFACE:
+				if (u.r.bRequestType == USB_RECIP_INTERFACE) {
+					/* udc hardware is broken by design:
+					 *  - altsetting may only be zero;
+					 *  - hw resets all interfaces' eps;
+					 *  - ep reset doesn't include halt(?).
+					 */
+					DMSG("broken set_interface (%d/%d)\n",
+						u.r.wIndex, u.r.wValue);
+					goto config_change;
+				}
+				break;
+			/* hardware was supposed to hide this */
+			case USB_REQ_SET_ADDRESS:
+				if (u.r.bRequestType == USB_RECIP_DEVICE) {
+					ep0start(dev, 0, "address");
+					return;
+				}
+				break;
+			}
+
+			if (u.r.bRequestType & USB_DIR_IN)
+				dev->ep0state = EP0_IN_DATA_PHASE;
+			else
+				dev->ep0state = EP0_OUT_DATA_PHASE;
+
+			i = dev->driver->setup(&dev->gadget, &u.r);
+			if (i < 0) {
+				/* hardware automagic preventing STALL... */
+				if (dev->req_config) {
+					/* hardware sometimes neglects to tell
+					 * tell us about config change events,
+					 * so later ones may fail...
+					 */
+					WARN("config change %02x fail %d?\n",
+						u.r.bRequest, i);
+					return;
+					/* TODO experiment:  if has_cfr,
+					 * hardware didn't ACK; maybe we
+					 * could actually STALL!
+					 */
+				}
+				DBG(DBG_VERBOSE, "protocol STALL, "
+					"%02x err %d\n", UDCCS0, i);
+stall:
+				/* the watchdog timer helps deal with cases
+				 * where udc seems to clear FST wrongly, and
+				 * then NAKs instead of STALLing.
+				 */
+				ep0start(dev, UDCCS0_FST|UDCCS0_FTF, "stall");
+				start_watchdog(dev);
+				dev->ep0state = EP0_STALL;
+				LED_EP0_OFF;
+
+			/* deferred i/o == no response yet */
+			} else if (dev->req_pending) {
+				if (likely(dev->ep0state == EP0_IN_DATA_PHASE
+						|| dev->req_std || u.r.wLength))
+					ep0start(dev, 0, "defer");
+				else
+					ep0start(dev, UDCCS0_IPR, "defer/IPR");
+			}
+
+			/* expect at least one data or status stage irq */
+			return;
+
+		} else if (likely((udccs0 & (UDCCS0_OPR|UDCCS0_SA))
+				== (UDCCS0_OPR|UDCCS0_SA))) {
+			unsigned i;
+
+			/* pxa210/250 erratum 131 for B0/B1 says RNE lies.
+			 * still observed on a pxa255 a0.
+			 */
+			nuke(ep, -EPROTO);
+
+			/* read SETUP data, but don't trust it too much */
+			for (i = 0; i < 8; i++)
+				u.raw [i] = (u8) UDDR0;
+			if ((u.r.bRequestType & USB_RECIP_MASK)
+					> USB_RECIP_OTHER)
+				goto stall;
+			if (u.word [0] == 0 && u.word [1] == 0)
+				goto stall;
+			goto got_setup;
+		} else {
+			/* some random early IRQ:
+			 * - we acked FST
+			 * - IPR cleared
+			 * - OPR got set, without SA (likely status stage)
+			 */
+			UDCCS0 = udccs0 & (UDCCS0_SA|UDCCS0_OPR);
+		}
+		break;
+	case EP0_IN_DATA_PHASE:			/* GET_DESCRIPTOR etc */
+		if (udccs0 & UDCCS0_OPR) {
+			UDCCS0 = UDCCS0_OPR|UDCCS0_FTF;
+			DBG(DBG_VERBOSE, "ep0in premature status\n");
+			if (req)
+				done(ep, req, 0);
+			ep0_idle(dev);
+		} else /* irq was IPR clearing */ {
+			if (req) {
+				/* this IN packet might finish the request */
+				(void) write_ep0_fifo(ep, req);
+			} /* else IN token before response was written */
+		}
+		break;
+	case EP0_OUT_DATA_PHASE:		/* SET_DESCRIPTOR etc */
+		if (udccs0 & UDCCS0_OPR) {
+			if (req) {
+				/* this OUT packet might finish the request */
+				if (read_ep0_fifo(ep, req))
+					done(ep, req, 0);
+				/* else more OUT packets expected */
+			} /* else OUT token before read was issued */
+		} else /* irq was IPR clearing */ {
+			DBG(DBG_VERBOSE, "ep0out premature status\n");
+			if (req)
+				done(ep, req, 0);
+			ep0_idle(dev);
+		}
+		break;
+	case EP0_END_XFER:
+		if (req)
+			done(ep, req, 0);
+		/* ack control-IN status (maybe in-zlp was skipped)
+		 * also appears after some config change events.
+		 */
+		if (udccs0 & UDCCS0_OPR)
+			UDCCS0 = UDCCS0_OPR;
+		ep0_idle(dev);
+		break;
+	case EP0_STALL:
+		UDCCS0 = UDCCS0_FST;
+		break;
+	}
+	USIR0 = USIR0_IR0;
+}
+
+static void handle_ep(struct pxa2xx_ep *ep)
+{
+	struct pxa2xx_request	*req;
+	int			is_in = ep->bEndpointAddress & USB_DIR_IN;
+	int			completed;
+	u32			udccs, tmp;
+
+	do {
+		completed = 0;
+		if (likely (!list_empty(&ep->queue)))
+			req = list_entry(ep->queue.next,
+					struct pxa2xx_request, queue);
+		else
+			req = 0;
+
+		// TODO check FST handling
+
+		udccs = *ep->reg_udccs;
+		if (unlikely(is_in)) {	/* irq from TPC, SST, or (ISO) TUR */
+			tmp = UDCCS_BI_TUR;
+			if (likely(ep->bmAttributes == USB_ENDPOINT_XFER_BULK))
+				tmp |= UDCCS_BI_SST;
+			tmp &= udccs;
+			if (likely (tmp))
+				*ep->reg_udccs = tmp;
+			if (req && likely ((udccs & UDCCS_BI_TFS) != 0))
+				completed = write_fifo(ep, req);
+
+		} else {	/* irq from RPC (or for ISO, ROF) */
+			if (likely(ep->bmAttributes == USB_ENDPOINT_XFER_BULK))
+				tmp = UDCCS_BO_SST | UDCCS_BO_DME;
+			else
+				tmp = UDCCS_IO_ROF | UDCCS_IO_DME;
+			tmp &= udccs;
+			if (likely(tmp))
+				*ep->reg_udccs = tmp;
+
+			/* fifos can hold packets, ready for reading... */
+			if (likely(req)) {
+#ifdef USE_OUT_DMA
+// TODO didn't yet debug out-dma.  this approach assumes
+// the worst about short packets and RPC; it might be better.
+
+				if (likely(ep->dma >= 0)) {
+					if (!(udccs & UDCCS_BO_RSP)) {
+						*ep->reg_udccs = UDCCS_BO_RPC;
+						ep->dma_irqs++;
+						return;
+					}
+				}
+#endif
+				completed = read_fifo(ep, req);
+			} else
+				pio_irq_disable (ep->bEndpointAddress);
+		}
+		ep->pio_irqs++;
+	} while (completed);
+}
+
+/*
+ *	pxa2xx_udc_irq - interrupt handler
+ *
+ * avoid delays in ep0 processing. the control handshaking isn't always
+ * under software control (pxa250c0 and the pxa255 are better), and delays
+ * could cause usb protocol errors.
+ */
+static irqreturn_t
+pxa2xx_udc_irq(int irq, void *_dev, struct pt_regs *r)
+{
+	struct pxa2xx_udc	*dev = _dev;
+	int			handled;
+
+	dev->stats.irqs++;
+	HEX_DISPLAY(dev->stats.irqs);
+	do {
+		u32		udccr = UDCCR;
+
+		handled = 0;
+
+		/* SUSpend Interrupt Request */
+		if (unlikely(udccr & UDCCR_SUSIR)) {
+			udc_ack_int_UDCCR(UDCCR_SUSIR);
+			handled = 1;
+			DBG(DBG_VERBOSE, "USB suspend%s\n", is_usb_connected()
+				? "" : "+disconnect");
+
+			if (!is_usb_connected())
+				stop_activity(dev, dev->driver);
+			else if (dev->gadget.speed != USB_SPEED_UNKNOWN
+					&& dev->driver
+					&& dev->driver->suspend)
+				dev->driver->suspend(&dev->gadget);
+			ep0_idle (dev);
+		}
+
+		/* RESume Interrupt Request */
+		if (unlikely(udccr & UDCCR_RESIR)) {
+			udc_ack_int_UDCCR(UDCCR_RESIR);
+			handled = 1;
+			DBG(DBG_VERBOSE, "USB resume\n");
+
+			if (dev->gadget.speed != USB_SPEED_UNKNOWN
+					&& dev->driver
+					&& dev->driver->resume
+					&& is_usb_connected())
+				dev->driver->resume(&dev->gadget);
+		}
+
+		/* ReSeT Interrupt Request - USB reset */
+		if (unlikely(udccr & UDCCR_RSTIR)) {
+			udc_ack_int_UDCCR(UDCCR_RSTIR);
+			handled = 1;
+
+			if ((UDCCR & UDCCR_UDA) == 0) {
+				DBG(DBG_VERBOSE, "USB reset start\n");
+				if (dev->gadget.speed != USB_SPEED_UNKNOWN)
+					disable_disconnect_irq();
+
+				/* reset driver and endpoints,
+				 * in case that's not yet done
+				 */
+				stop_activity (dev, dev->driver);
+
+			} else {
+				dev_info(&dev->gadget.dev, "USB reset\n");
+				dev->gadget.speed = USB_SPEED_FULL;
+				LED_CONNECTED_ON;
+				memset(&dev->stats, 0, sizeof dev->stats);
+				/* driver and endpoints are still reset */
+				enable_disconnect_irq();
+			}
+
+		} else {
+			u32	usir0 = USIR0 & ~UICR0;
+			u32	usir1 = USIR1 & ~UICR1;
+			int	i;
+
+			if (unlikely (!usir0 && !usir1))
+				continue;
+
+			DBG(DBG_VERY_NOISY, "irq %02x.%02x\n", usir1, usir0);
+
+			/* control traffic */
+			if (usir0 & USIR0_IR0) {
+				dev->ep[0].pio_irqs++;
+				handle_ep0(dev);
+				handled = 1;
+			}
+
+			/* endpoint data transfers */
+			for (i = 0; i < 8; i++) {
+				u32	tmp = 1 << i;
+
+				if (i && (usir0 & tmp)) {
+					handle_ep(&dev->ep[i]);
+					USIR0 |= tmp;
+					handled = 1;
+				}
+				if (usir1 & tmp) {
+					handle_ep(&dev->ep[i+8]);
+					USIR1 |= tmp;
+					handled = 1;
+				}
+			}
+		}
+
+		/* we could also ask for 1 msec SOF (SIR) interrupts */
+
+	} while (handled);
+	return IRQ_HANDLED;
+}
+
+/*-------------------------------------------------------------------------*/
+
+static void nop_release (struct device *dev)
+{
+	DMSG("%s %s\n", __FUNCTION__, dev->bus_id);
+}
+
+/* this uses load-time allocation and initialization (instead of
+ * doing it at run-time) to save code, eliminate fault paths, and
+ * be more obviously correct.
+ */
+static struct pxa2xx_udc memory = {
+	.gadget = {
+		.ops		= &pxa2xx_udc_ops,
+		.ep0		= &memory.ep[0].ep,
+		.name		= driver_name,
+		.dev = {
+			.bus_id		= "gadget",
+			.release	= nop_release,
+		},
+	},
+
+	/* control endpoint */
+	.ep[0] = {
+		.ep = {
+			.name		= ep0name,
+			.ops		= &pxa2xx_ep_ops,
+			.maxpacket	= EP0_FIFO_SIZE,
+		},
+		.dev		= &memory,
+		.reg_udccs	= &UDCCS0,
+		.reg_uddr	= &UDDR0,
+	},
+
+	/* first group of endpoints */
+	.ep[1] = {
+		.ep = {
+			.name		= "ep1in-bulk",
+			.ops		= &pxa2xx_ep_ops,
+			.maxpacket	= BULK_FIFO_SIZE,
+		},
+		.dev		= &memory,
+		.bEndpointAddress = USB_DIR_IN | 1,
+		.bmAttributes	= USB_ENDPOINT_XFER_BULK,
+		.reg_udccs	= &UDCCS1,
+		.reg_uddr	= &UDDR1,
+		.reg_drcmr	= &DRCMR25,
+	},
+	.ep[2] = {
+		.ep = {
+			.name		= "ep2out-bulk",
+			.ops		= &pxa2xx_ep_ops,
+			.maxpacket	= BULK_FIFO_SIZE,
+		},
+		.dev		= &memory,
+		.bEndpointAddress = 2,
+		.bmAttributes	= USB_ENDPOINT_XFER_BULK,
+		.reg_udccs	= &UDCCS2,
+		.reg_ubcr	= &UBCR2,
+		.reg_uddr	= &UDDR2,
+		.reg_drcmr	= &DRCMR26,
+	},
+#ifndef CONFIG_USB_PXA2XX_SMALL
+	.ep[3] = {
+		.ep = {
+			.name		= "ep3in-iso",
+			.ops		= &pxa2xx_ep_ops,
+			.maxpacket	= ISO_FIFO_SIZE,
+		},
+		.dev		= &memory,
+		.bEndpointAddress = USB_DIR_IN | 3,
+		.bmAttributes	= USB_ENDPOINT_XFER_ISOC,
+		.reg_udccs	= &UDCCS3,
+		.reg_uddr	= &UDDR3,
+		.reg_drcmr	= &DRCMR27,
+	},
+	.ep[4] = {
+		.ep = {
+			.name		= "ep4out-iso",
+			.ops		= &pxa2xx_ep_ops,
+			.maxpacket	= ISO_FIFO_SIZE,
+		},
+		.dev		= &memory,
+		.bEndpointAddress = 4,
+		.bmAttributes	= USB_ENDPOINT_XFER_ISOC,
+		.reg_udccs	= &UDCCS4,
+		.reg_ubcr	= &UBCR4,
+		.reg_uddr	= &UDDR4,
+		.reg_drcmr	= &DRCMR28,
+	},
+	.ep[5] = {
+		.ep = {
+			.name		= "ep5in-int",
+			.ops		= &pxa2xx_ep_ops,
+			.maxpacket	= INT_FIFO_SIZE,
+		},
+		.dev		= &memory,
+		.bEndpointAddress = USB_DIR_IN | 5,
+		.bmAttributes	= USB_ENDPOINT_XFER_INT,
+		.reg_udccs	= &UDCCS5,
+		.reg_uddr	= &UDDR5,
+	},
+
+	/* second group of endpoints */
+	.ep[6] = {
+		.ep = {
+			.name		= "ep6in-bulk",
+			.ops		= &pxa2xx_ep_ops,
+			.maxpacket	= BULK_FIFO_SIZE,
+		},
+		.dev		= &memory,
+		.bEndpointAddress = USB_DIR_IN | 6,
+		.bmAttributes	= USB_ENDPOINT_XFER_BULK,
+		.reg_udccs	= &UDCCS6,
+		.reg_uddr	= &UDDR6,
+		.reg_drcmr	= &DRCMR30,
+	},
+	.ep[7] = {
+		.ep = {
+			.name		= "ep7out-bulk",
+			.ops		= &pxa2xx_ep_ops,
+			.maxpacket	= BULK_FIFO_SIZE,
+		},
+		.dev		= &memory,
+		.bEndpointAddress = 7,
+		.bmAttributes	= USB_ENDPOINT_XFER_BULK,
+		.reg_udccs	= &UDCCS7,
+		.reg_ubcr	= &UBCR7,
+		.reg_uddr	= &UDDR7,
+		.reg_drcmr	= &DRCMR31,
+	},
+	.ep[8] = {
+		.ep = {
+			.name		= "ep8in-iso",
+			.ops		= &pxa2xx_ep_ops,
+			.maxpacket	= ISO_FIFO_SIZE,
+		},
+		.dev		= &memory,
+		.bEndpointAddress = USB_DIR_IN | 8,
+		.bmAttributes	= USB_ENDPOINT_XFER_ISOC,
+		.reg_udccs	= &UDCCS8,
+		.reg_uddr	= &UDDR8,
+		.reg_drcmr	= &DRCMR32,
+	},
+	.ep[9] = {
+		.ep = {
+			.name		= "ep9out-iso",
+			.ops		= &pxa2xx_ep_ops,
+			.maxpacket	= ISO_FIFO_SIZE,
+		},
+		.dev		= &memory,
+		.bEndpointAddress = 9,
+		.bmAttributes	= USB_ENDPOINT_XFER_ISOC,
+		.reg_udccs	= &UDCCS9,
+		.reg_ubcr	= &UBCR9,
+		.reg_uddr	= &UDDR9,
+		.reg_drcmr	= &DRCMR33,
+	},
+	.ep[10] = {
+		.ep = {
+			.name		= "ep10in-int",
+			.ops		= &pxa2xx_ep_ops,
+			.maxpacket	= INT_FIFO_SIZE,
+		},
+		.dev		= &memory,
+		.bEndpointAddress = USB_DIR_IN | 10,
+		.bmAttributes	= USB_ENDPOINT_XFER_INT,
+		.reg_udccs	= &UDCCS10,
+		.reg_uddr	= &UDDR10,
+	},
+
+	/* third group of endpoints */
+	.ep[11] = {
+		.ep = {
+			.name		= "ep11in-bulk",
+			.ops		= &pxa2xx_ep_ops,
+			.maxpacket	= BULK_FIFO_SIZE,
+		},
+		.dev		= &memory,
+		.bEndpointAddress = USB_DIR_IN | 11,
+		.bmAttributes	= USB_ENDPOINT_XFER_BULK,
+		.reg_udccs	= &UDCCS11,
+		.reg_uddr	= &UDDR11,
+		.reg_drcmr	= &DRCMR35,
+	},
+	.ep[12] = {
+		.ep = {
+			.name		= "ep12out-bulk",
+			.ops		= &pxa2xx_ep_ops,
+			.maxpacket	= BULK_FIFO_SIZE,
+		},
+		.dev		= &memory,
+		.bEndpointAddress = 12,
+		.bmAttributes	= USB_ENDPOINT_XFER_BULK,
+		.reg_udccs	= &UDCCS12,
+		.reg_ubcr	= &UBCR12,
+		.reg_uddr	= &UDDR12,
+		.reg_drcmr	= &DRCMR36,
+	},
+	.ep[13] = {
+		.ep = {
+			.name		= "ep13in-iso",
+			.ops		= &pxa2xx_ep_ops,
+			.maxpacket	= ISO_FIFO_SIZE,
+		},
+		.dev		= &memory,
+		.bEndpointAddress = USB_DIR_IN | 13,
+		.bmAttributes	= USB_ENDPOINT_XFER_ISOC,
+		.reg_udccs	= &UDCCS13,
+		.reg_uddr	= &UDDR13,
+		.reg_drcmr	= &DRCMR37,
+	},
+	.ep[14] = {
+		.ep = {
+			.name		= "ep14out-iso",
+			.ops		= &pxa2xx_ep_ops,
+			.maxpacket	= ISO_FIFO_SIZE,
+		},
+		.dev		= &memory,
+		.bEndpointAddress = 14,
+		.bmAttributes	= USB_ENDPOINT_XFER_ISOC,
+		.reg_udccs	= &UDCCS14,
+		.reg_ubcr	= &UBCR14,
+		.reg_uddr	= &UDDR14,
+		.reg_drcmr	= &DRCMR38,
+	},
+	.ep[15] = {
+		.ep = {
+			.name		= "ep15in-int",
+			.ops		= &pxa2xx_ep_ops,
+			.maxpacket	= INT_FIFO_SIZE,
+		},
+		.dev		= &memory,
+		.bEndpointAddress = USB_DIR_IN | 15,
+		.bmAttributes	= USB_ENDPOINT_XFER_INT,
+		.reg_udccs	= &UDCCS15,
+		.reg_uddr	= &UDDR15,
+	},
+#endif /* !CONFIG_USB_PXA2XX_SMALL */
+};
+
+#define CP15R0_VENDOR_MASK	0xffffe000
+#define CP15R0_XSCALE_VALUE	0x69052000	/* intel/arm/xscale */
+
+#define CP15R0_PROD_MASK	0x000003f0
+#define PXA25x			0x00000100	/* and PXA26x */
+#define PXA210			0x00000120
+
+#define CP15R0_REV_MASK		0x0000000f
+
+#define CP15R0_PRODREV_MASK	(CP15R0_PROD_MASK | CP15R0_REV_MASK)
+
+#define PXA255_A0		0x00000106	/* or PXA260_B1 */
+#define PXA250_C0		0x00000105	/* or PXA26x_B0 */
+#define PXA250_B2		0x00000104
+#define PXA250_B1		0x00000103	/* or PXA260_A0 */
+#define PXA250_B0		0x00000102
+#define PXA250_A1		0x00000101
+#define PXA250_A0		0x00000100
+
+#define PXA210_C0		0x00000125
+#define PXA210_B2		0x00000124
+#define PXA210_B1		0x00000123
+#define PXA210_B0		0x00000122
+
+/*
+ * 	probe - binds to the platform device
+ */
+static int __init pxa2xx_udc_probe(struct device *_dev)
+{
+	struct pxa2xx_udc *dev = &memory;
+	int retval, out_dma = 1;
+	u32 chiprev;
+
+	/* insist on Intel/ARM/XScale */
+	asm("mrc%? p15, 0, %0, c0, c0" : "=r" (chiprev));
+	if ((chiprev & CP15R0_VENDOR_MASK) != CP15R0_XSCALE_VALUE) {
+		printk(KERN_ERR "%s: not XScale!\n", driver_name);
+		return -ENODEV;
+	}
+
+	/* trigger chiprev-specific logic */
+	switch (chiprev & CP15R0_PRODREV_MASK) {
+	case PXA255_A0:
+		dev->has_cfr = 1;
+		break;
+	case PXA250_A0:
+	case PXA250_A1:
+		/* A0/A1 "not released"; ep 13, 15 unusable */
+		/* fall through */
+	case PXA250_B2: case PXA210_B2:
+	case PXA250_B1: case PXA210_B1:
+	case PXA250_B0: case PXA210_B0:
+		out_dma = 0;
+		/* fall through */
+	case PXA250_C0: case PXA210_C0:
+		break;
+	default:
+		out_dma = 0;
+		printk(KERN_ERR "%s: unrecognized processor: %08x\n",
+			driver_name, chiprev);
+		/* iop3xx, ixp4xx, ... */
+		return -ENODEV;
+	}
+
+	pr_debug("%s: IRQ %d%s%s%s\n", driver_name, IRQ_USB,
+		dev->has_cfr ? "" : " (!cfr)",
+		out_dma ? "" : " (broken dma-out)",
+		SIZE_STR DMASTR
+		);
+
+#ifdef	USE_DMA
+#ifndef	USE_OUT_DMA
+	out_dma = 0;
+#endif
+	/* pxa 250 erratum 130 prevents using OUT dma (fixed C0) */
+	if (!out_dma) {
+		DMSG("disabled OUT dma\n");
+		dev->ep[ 2].reg_drcmr = dev->ep[ 4].reg_drcmr = 0;
+		dev->ep[ 7].reg_drcmr = dev->ep[ 9].reg_drcmr = 0;
+		dev->ep[12].reg_drcmr = dev->ep[14].reg_drcmr = 0;
+	}
+#endif
+
+	/* other non-static parts of init */
+	dev->dev = _dev;
+	dev->mach = _dev->platform_data;
+
+	init_timer(&dev->timer);
+	dev->timer.function = udc_watchdog;
+	dev->timer.data = (unsigned long) dev;
+
+	device_initialize(&dev->gadget.dev);
+	dev->gadget.dev.parent = _dev;
+	dev->gadget.dev.dma_mask = _dev->dma_mask;
+
+	the_controller = dev;
+	dev_set_drvdata(_dev, dev);
+
+	udc_disable(dev);
+	udc_reinit(dev);
+
+	/* irq setup after old hardware state is cleaned up */
+	retval = request_irq(IRQ_USB, pxa2xx_udc_irq,
+			SA_INTERRUPT, driver_name, dev);
+	if (retval != 0) {
+		printk(KERN_ERR "%s: can't get irq %i, err %d\n",
+			driver_name, IRQ_USB, retval);
+		return -EBUSY;
+	}
+	dev->got_irq = 1;
+
+	if (machine_is_lubbock()) {
+		disable_irq(LUBBOCK_USB_DISC_IRQ);
+		retval = request_irq(LUBBOCK_USB_DISC_IRQ,
+				usb_connection_irq,
+				SA_INTERRUPT /* OOPSING | SA_SAMPLE_RANDOM */,
+				driver_name, dev);
+		if (retval != 0) {
+			enable_irq(LUBBOCK_USB_DISC_IRQ);
+			printk(KERN_ERR "%s: can't get irq %i, err %d\n",
+				driver_name, LUBBOCK_USB_DISC_IRQ, retval);
+			return -EBUSY;
+		}
+		dev->got_disc = 1;
+	}
+
+	create_proc_files();
+
+	return 0;
+}
+static int __exit pxa2xx_udc_remove(struct device *_dev)
+{
+	struct pxa2xx_udc *dev = _dev->driver_data;
+
+	udc_disable(dev);
+	remove_proc_files();
+	usb_gadget_unregister_driver(dev->driver);
+
+	if (dev->got_irq) {
+		free_irq(IRQ_USB, dev);
+		dev->got_irq = 0;
+	}
+	if (machine_is_lubbock() && dev->got_disc) {
+		free_irq(LUBBOCK_USB_DISC_IRQ, dev);
+		dev->got_disc = 0;
+	}
+	dev_set_drvdata(_dev, 0);
+	the_controller = 0;
+	return 0;
+}
+
+/*-------------------------------------------------------------------------*/
+
+static struct device_driver udc_driver = {
+	.name		= (char *) driver_name,
+	.bus		= &platform_bus_type,
+	.probe		= pxa2xx_udc_probe,
+	.remove		= __exit_p(pxa2xx_udc_remove),
+
+	// FIXME power management support
+	// .suspend = ... disable UDC
+	// .resume = ... re-enable UDC
+};
+
+static int __init udc_init(void)
+{
+	printk(KERN_INFO "%s: version %s\n", driver_name, DRIVER_VERSION);
+	return driver_register(&udc_driver);
+}
+module_init(udc_init);
+
+static void __exit udc_exit(void)
+{
+	driver_unregister(&udc_driver);
+}
+module_exit(udc_exit);
+
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_AUTHOR("Frank Becker, Robert Schwebel, David Brownell");
+MODULE_LICENSE("GPL");
+
diff -Nru a/drivers/usb/gadget/pxa2xx_udc.h b/drivers/usb/gadget/pxa2xx_udc.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/usb/gadget/pxa2xx_udc.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,311 @@
+/*
+ * linux/drivers/usb/gadget/pxa2xx_udc.h
+ * Intel PXA2xx on-chip full speed USB device controller
+ *
+ * Copyright (C) 2003 Robert Schwebel <r.schwebel@pengutronix.de>, Pengutronix
+ * Copyright (C) 2003 David Brownell
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __LINUX_USB_GADGET_PXA2XX_H
+#define __LINUX_USB_GADGET_PXA2XX_H
+
+#include <linux/types.h>
+
+/*-------------------------------------------------------------------------*/
+
+/* pxa2xx has this (move to include/asm-arm/arch-pxa/pxa-regs.h) */
+#define UFNRH_SIR	(1 << 7)	/* SOF interrupt request */
+#define UFNRH_SIM	(1 << 6)	/* SOF interrupt mask */
+#define UFNRH_IPE14	(1 << 5)	/* ISO packet error, ep14 */
+#define UFNRH_IPE9	(1 << 4)	/* ISO packet error, ep9 */
+#define UFNRH_IPE4	(1 << 3)	/* ISO packet error, ep4 */
+
+/* pxa255 has this (move to include/asm-arm/arch-pxa/pxa-regs.h) */
+#define	UDCCFR		UDC_RES2	/* UDC Control Function Register */
+#define UDCCFR_AREN	(1 << 7)	/* ACK response enable (now) */
+#define UDCCFR_ACM	(1 << 2)	/* ACK control mode (wait for AREN) */
+
+/*-------------------------------------------------------------------------*/
+
+struct pxa2xx_udc;
+
+struct pxa2xx_ep {
+	struct usb_ep				ep;
+	struct pxa2xx_udc			*dev;
+
+	const struct usb_endpoint_descriptor	*desc;
+	struct list_head			queue;
+	unsigned long				pio_irqs;
+	unsigned long				dma_irqs;
+	int					dma;
+
+	u8					bEndpointAddress;
+	u8					bmAttributes;
+
+	unsigned				stopped : 1;
+	unsigned				dma_fixup : 1;
+
+	/* UDCCS = UDC Control/Status for this EP
+	 * UBCR = UDC Byte Count Remaining (contents of OUT fifo)
+	 * UDDR = UDC Endpoint Data Register (the fifo)
+	 * DRCM = DMA Request Channel Map
+	 */
+	volatile u32				*reg_udccs;
+	volatile u32				*reg_ubcr;
+	volatile u32				*reg_uddr;
+	volatile u32				*reg_drcmr;
+};
+
+struct pxa2xx_request {
+	struct usb_request			req;
+	struct list_head			queue;
+};
+
+enum ep0_state {
+	EP0_IDLE,
+	EP0_IN_DATA_PHASE,
+	EP0_OUT_DATA_PHASE,
+	EP0_END_XFER,
+	EP0_STALL,
+};
+
+#define EP0_FIFO_SIZE	((unsigned)16)
+#define BULK_FIFO_SIZE	((unsigned)64)
+#define ISO_FIFO_SIZE	((unsigned)256)
+#define INT_FIFO_SIZE	((unsigned)8)
+
+struct udc_stats {
+	struct ep0stats {
+		unsigned long		ops;
+		unsigned long		bytes;
+	} read, write;
+	unsigned long			irqs;
+};
+
+#ifdef CONFIG_USB_PXA2XX_SMALL
+/* when memory's tight, SMALL config saves code+data.  */
+#undef	USE_DMA
+#define	PXA_UDC_NUM_ENDPOINTS	3
+#endif
+
+#ifndef	PXA_UDC_NUM_ENDPOINTS
+#define	PXA_UDC_NUM_ENDPOINTS	16
+#endif
+
+struct pxa2xx_udc {
+	struct usb_gadget			gadget;
+	struct usb_gadget_driver		*driver;
+
+	enum ep0_state				ep0state;
+	struct udc_stats			stats;
+	unsigned				got_irq : 1,
+						got_disc : 1,
+						has_cfr : 1,
+						req_pending : 1,
+						req_std : 1,
+						req_config : 1;
+
+#define start_watchdog(dev) mod_timer(&dev->timer, jiffies + (HZ/200))
+	struct timer_list			timer;
+
+	struct device				*dev;
+	struct pxa2xx_udc_mach_info		*mach;
+	u64					dma_mask;
+	struct pxa2xx_ep			ep [PXA_UDC_NUM_ENDPOINTS];
+};
+
+/*-------------------------------------------------------------------------*/
+
+#ifdef CONFIG_ARCH_LUBBOCK
+#include <asm/arch/lubbock.h>
+/* lubbock can also report usb connect/disconnect irqs */
+
+#ifdef DEBUG
+#define HEX_DISPLAY(n)	if (machine_is_lubbock()) { LUB_HEXLED = (n); }
+
+#define LED_CONNECTED_ON	if (machine_is_lubbock()) { \
+	DISCRETE_LED_ON(D26); }
+#define LED_CONNECTED_OFF	if(machine_is_lubbock()) { \
+	DISCRETE_LED_OFF(D26); LUB_HEXLED = 0; }
+#define LED_EP0_ON	if (machine_is_lubbock()) { DISCRETE_LED_ON(D25); }
+#define LED_EP0_OFF	if (machine_is_lubbock()) { DISCRETE_LED_OFF(D25); }
+#endif /* DEBUG */
+
+#endif
+
+/*-------------------------------------------------------------------------*/
+
+/* LEDs are only for debug */
+#ifndef HEX_DISPLAY
+#define HEX_DISPLAY(n)		do {} while(0)
+#endif
+
+#ifndef LED_CONNECTED_ON
+#define LED_CONNECTED_ON	do {} while(0)
+#define LED_CONNECTED_OFF	do {} while(0)
+#endif
+#ifndef LED_EP0_ON
+#define LED_EP0_ON		do {} while (0)
+#define LED_EP0_OFF		do {} while (0)
+#endif
+
+/*-------------------------------------------------------------------------*/
+
+static struct pxa2xx_udc *the_controller;
+
+/* one GPIO should be used to detect host disconnect */
+static inline int is_usb_connected(void)
+{
+	if (!the_controller->mach->udc_is_connected)
+		return 1;
+	return the_controller->mach->udc_is_connected();
+}
+
+/* one GPIO should force the host to see this device (or not) */
+static inline void make_usb_disappear(void)
+{
+	if (!the_controller->mach->udc_command)
+		return;
+	the_controller->mach->udc_command(PXA2XX_UDC_CMD_CONNECT);
+}
+
+static inline void let_usb_appear(void)
+{
+	if (!the_controller->mach->udc_command)
+		return;
+	the_controller->mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT);
+}
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * Debugging support vanishes in non-debug builds.  DBG_NORMAL should be
+ * mostly silent during normal use/testing, with no timing side-effects.
+ */
+#define DBG_NORMAL	1	/* error paths, device state transitions */
+#define DBG_VERBOSE	2	/* add some success path trace info */
+#define DBG_NOISY	3	/* ... even more: request level */
+#define DBG_VERY_NOISY	4	/* ... even more: packet level */
+
+#ifdef DEBUG
+
+static const char *state_name[] = {
+	"EP0_IDLE",
+	"EP0_IN_DATA_PHASE", "EP0_OUT_DATA_PHASE",
+	"EP0_END_XFER", "EP0_STALL"
+};
+
+#define DMSG(stuff...) printk(KERN_DEBUG "udc: " stuff)
+
+#ifdef VERBOSE
+#    define UDC_DEBUG DBG_VERBOSE
+#else
+#    define UDC_DEBUG DBG_NORMAL
+#endif
+
+static void __attribute__ ((__unused__))
+dump_udccr(const char *label)
+{
+	u32	udccr = UDCCR;
+	DMSG("%s %02X =%s%s%s%s%s%s%s%s\n",
+		label, udccr,
+		(udccr & UDCCR_REM) ? " rem" : "",
+		(udccr & UDCCR_RSTIR) ? " rstir" : "",
+		(udccr & UDCCR_SRM) ? " srm" : "",
+		(udccr & UDCCR_SUSIR) ? " susir" : "",
+		(udccr & UDCCR_RESIR) ? " resir" : "",
+		(udccr & UDCCR_RSM) ? " rsm" : "",
+		(udccr & UDCCR_UDA) ? " uda" : "",
+		(udccr & UDCCR_UDE) ? " ude" : "");
+}
+
+static void __attribute__ ((__unused__))
+dump_udccs0(const char *label)
+{
+	u32		udccs0 = UDCCS0;
+
+	DMSG("%s %s %02X =%s%s%s%s%s%s%s%s\n",
+		label, state_name[the_controller->ep0state], udccs0,
+		(udccs0 & UDCCS0_SA) ? " sa" : "",
+		(udccs0 & UDCCS0_RNE) ? " rne" : "",
+		(udccs0 & UDCCS0_FST) ? " fst" : "",
+		(udccs0 & UDCCS0_SST) ? " sst" : "",
+		(udccs0 & UDCCS0_DRWF) ? " dwrf" : "",
+		(udccs0 & UDCCS0_FTF) ? " ftf" : "",
+		(udccs0 & UDCCS0_IPR) ? " ipr" : "",
+		(udccs0 & UDCCS0_OPR) ? " opr" : "");
+}
+
+static void __attribute__ ((__unused__))
+dump_state(struct pxa2xx_udc *dev)
+{
+	u32		tmp;
+	unsigned	i;
+
+	DMSG("%s %s, uicr %02X.%02X, usir %02X.%02x, ufnr %02X.%02X\n",
+		is_usb_connected() ? "host " : "disconnected",
+		state_name[dev->ep0state],
+		UICR1, UICR0, USIR1, USIR0, UFNRH, UFNRL);
+	dump_udccr("udccr");
+	if (dev->has_cfr) {
+		tmp = UDCCFR;
+		DMSG("udccfr %02X =%s%s\n", tmp,
+			(tmp & UDCCFR_AREN) ? " aren" : "",
+			(tmp & UDCCFR_ACM) ? " acm" : "");
+	}
+
+	if (!dev->driver) {
+		DMSG("no gadget driver bound\n");
+		return;
+	} else
+		DMSG("ep0 driver '%s'\n", dev->driver->driver.name);
+
+	if (!is_usb_connected())
+		return;
+
+	dump_udccs0 ("udccs0");
+	DMSG("ep0 IN %lu/%lu, OUT %lu/%lu\n",
+		dev->stats.write.bytes, dev->stats.write.ops,
+		dev->stats.read.bytes, dev->stats.read.ops);
+
+	for (i = 1; i < PXA_UDC_NUM_ENDPOINTS; i++) {
+		if (dev->ep [i].desc == 0)
+			continue;
+		DMSG ("udccs%d = %02x\n", i, *dev->ep->reg_udccs);
+	}
+}
+
+#else
+
+#define DMSG(stuff...)		do{}while(0)
+
+#define	dump_udccr(x)	do{}while(0)
+#define	dump_udccs0(x)	do{}while(0)
+#define	dump_state(x)	do{}while(0)
+
+#define UDC_DEBUG ((unsigned)0)
+
+#endif
+
+#define DBG(lvl, stuff...) do{if ((lvl) <= UDC_DEBUG) DMSG(stuff);}while(0)
+
+#define WARN(stuff...) printk(KERN_WARNING "udc: " stuff)
+
+
+
+#endif /* __LINUX_USB_GADGET_PXA2XX_H */
diff -Nru a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/usb/gadget/serial.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,2126 @@
+/*
+ * g_serial.c -- USB gadget serial driver
+ *
+ * Copyright 2003 (C) Al Borchers (alborchers@steinerpoint.com)
+ *
+ * This code is based in part on the Gadget Zero driver, which
+ * is Copyright (C) 2003 by David Brownell, all rights reserved.
+ *
+ * This code also borrows from usbserial.c, which is
+ * Copyright (C) 1999 - 2002 Greg Kroah-Hartman (greg@kroah.com)
+ * Copyright (C) 2000 Peter Berger (pberger@brimson.com)
+ * Copyright (C) 2000 Al Borchers (alborchers@steinerpoint.com)
+ *
+ * This software is distributed under the terms of the GNU General
+ * Public License ("GPL") as published by the Free Software Foundation,
+ * either version 2 of that License or (at your option) any later version.
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/delay.h>
+#include <linux/ioport.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/smp_lock.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/timer.h>
+#include <linux/list.h>
+#include <linux/interrupt.h>
+#include <linux/uts.h>
+#include <linux/version.h>
+#include <linux/wait.h>
+#include <linux/list.h>
+#include <linux/proc_fs.h>
+#include <linux/device.h>
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
+
+#include <asm/byteorder.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/system.h>
+#include <asm/unaligned.h>
+#include <asm/uaccess.h>
+
+#include <linux/usb_ch9.h>
+#include <linux/usb_gadget.h>
+
+
+/* Wait Cond */
+
+#define __wait_cond_interruptible(wq, condition, lock, flags, ret)	\
+do {									\
+	wait_queue_t __wait;						\
+	init_waitqueue_entry(&__wait, current);				\
+									\
+	add_wait_queue(&wq, &__wait);					\
+	for (;;) {							\
+		set_current_state(TASK_INTERRUPTIBLE);			\
+		if (condition)						\
+			break;						\
+		if (!signal_pending(current)) {				\
+			spin_unlock_irqrestore(lock, flags);		\
+			schedule();					\
+			spin_lock_irqsave(lock, flags);			\
+			continue;					\
+		}							\
+		ret = -ERESTARTSYS;					\
+		break;							\
+	}								\
+	current->state = TASK_RUNNING;					\
+	remove_wait_queue(&wq, &__wait);				\
+} while (0)
+	
+#define wait_cond_interruptible(wq, condition, lock, flags)		\
+({									\
+	int __ret = 0;							\
+	if (!(condition))						\
+		__wait_cond_interruptible(wq, condition, lock, flags,	\
+						__ret);			\
+	__ret;								\
+})
+
+#define __wait_cond_interruptible_timeout(wq, condition, lock, flags, 	\
+						timeout, ret)		\
+do {									\
+	signed long __timeout = timeout;				\
+	wait_queue_t __wait;						\
+	init_waitqueue_entry(&__wait, current);				\
+									\
+	add_wait_queue(&wq, &__wait);					\
+	for (;;) {							\
+		set_current_state(TASK_INTERRUPTIBLE);			\
+		if (__timeout == 0)					\
+			break;						\
+		if (condition)						\
+			break;						\
+		if (!signal_pending(current)) {				\
+			spin_unlock_irqrestore(lock, flags);		\
+			__timeout = schedule_timeout(__timeout);	\
+			spin_lock_irqsave(lock, flags);			\
+			continue;					\
+		}							\
+		ret = -ERESTARTSYS;					\
+		break;							\
+	}								\
+	current->state = TASK_RUNNING;					\
+	remove_wait_queue(&wq, &__wait);				\
+} while (0)
+	
+#define wait_cond_interruptible_timeout(wq, condition, lock, flags,	\
+						timeout)		\
+({									\
+	int __ret = 0;							\
+	if (!(condition))						\
+		__wait_cond_interruptible_timeout(wq, condition, lock,	\
+						flags, timeout, __ret);	\
+	__ret;								\
+})
+
+
+/* Defines */
+
+#define GS_VERSION_STR			"v0.1"
+#define GS_VERSION_NUM			0x0001
+
+#define GS_LONG_NAME			"Gadget Serial"
+#define GS_SHORT_NAME			"g_serial"
+
+#define GS_MAJOR			127
+#define GS_MINOR_START			0
+
+#define GS_NUM_PORTS			16
+
+#define GS_NUM_CONFIGS			1
+#define GS_NO_CONFIG_ID			0
+#define GS_BULK_CONFIG_ID		2
+
+#define GS_NUM_INTERFACES		1
+#define GS_INTERFACE_ID			0
+#define GS_ALT_INTERFACE_ID		0
+
+#define GS_NUM_ENDPOINTS		2
+
+#define GS_MAX_DESC_LEN			256
+
+#define GS_DEFAULT_READ_Q_SIZE		32
+#define GS_DEFAULT_WRITE_Q_SIZE		32
+
+#define GS_DEFAULT_WRITE_BUF_SIZE	8192
+#define GS_TMP_BUF_SIZE			8192
+
+#define GS_CLOSE_TIMEOUT		15
+
+/* debug macro */
+#if G_SERIAL_DEBUG
+
+static int debug = G_SERIAL_DEBUG;
+
+#define gs_debug(format, arg...) \
+	do { if (debug) printk(KERN_DEBUG format, ## arg); } while(0)
+#define gs_debug_level(level, format, arg...) \
+	do { if (debug>=level) printk(KERN_DEBUG format, ## arg); } while(0)
+
+#else
+
+#define gs_debug(format, arg...) \
+	do { } while(0)
+#define gs_debug_level(level, format, arg...) \
+	do { } while(0)
+
+#endif /* G_SERIAL_DEBUG */
+
+
+/* USB Controllers */
+
+/*
+ * NetChip 2280, PCI based.
+ *
+ * This has half a dozen configurable endpoints, four with dedicated
+ * DMA channels to manage their FIFOs.  It supports high speed.
+ * Those endpoints can be arranged in any desired configuration.
+ */
+#ifdef	CONFIG_USB_GADGET_NET2280
+#define CHIP				"net2280"
+#define EP0_MAXPACKET			64
+static const char EP_OUT_NAME[] =	"ep-a";
+#define EP_OUT_NUM			2
+static const char EP_IN_NAME[] =	"ep-b";
+#define EP_IN_NUM			2
+#define HIGHSPEED
+#define SELFPOWER			USB_CONFIG_ATT_SELFPOWER
+
+extern int net2280_set_fifo_mode(struct usb_gadget *gadget, int mode);
+
+static inline void hw_optimize(struct usb_gadget *gadget)
+{
+	/* we can have bigger ep-a/ep-b fifos (2KB each, 4 packets
+	 * for highspeed bulk) because we're not using ep-c/ep-d.
+	 */
+	net2280_set_fifo_mode (gadget, 1);
+}
+#endif
+
+
+/*
+ * PXA-2xx UDC:  widely used in second gen Linux-capable PDAs.
+ *
+ * This has fifteen fixed-function full speed endpoints, and it
+ * can support all USB transfer types.
+ *
+ * These supports three or four configurations, with fixed numbers.
+ * The hardware interprets SET_INTERFACE, net effect is that you
+ * can't use altsettings or reset the interfaces independently.
+ * So stick to a single interface.
+ */
+#ifdef	CONFIG_USB_GADGET_PXA2XX
+#define CHIP				"pxa2xx"
+#define EP0_MAXPACKET			16
+static const char EP_OUT_NAME[] =	"ep2out-bulk";
+#define EP_OUT_NUM			2
+static const char EP_IN_NAME[] =	"ep1in-bulk";
+#define EP_IN_NUM			1
+#define SELFPOWER 			USB_CONFIG_ATT_SELFPOWER
+
+/* no hw optimizations to apply */
+#define hw_optimize(g)			do {} while (0)
+#endif
+
+
+/*
+ * SA-1100 UDC:  widely used in first gen Linux-capable PDAs.
+ *
+ * This has only two fixed function endpoints, which can only
+ * be used for bulk (or interrupt) transfers.  (Plus control.)
+ *
+ * Since it can't flush its TX fifos without disabling the UDC,
+ * the current configuration or altsettings can't change except
+ * in special situations.  So this is a case of "choose it right
+ * during enumeration" ...
+ */
+#ifdef	CONFIG_USB_GADGET_SA1100
+#define CHIP				"sa1100"
+#define EP0_MAXPACKET			8
+static const char EP_OUT_NAME[] =	"ep1out-bulk";
+#define EP_OUT_NUM			1
+static const char EP_IN_NAME [] =	"ep2in-bulk";
+#define EP_IN_NUM			2
+#define SELFPOWER			USB_CONFIG_ATT_SELFPOWER
+
+/* no hw optimizations to apply */
+#define hw_optimize(g)			do {} while (0)
+#endif
+
+
+/*
+ * Toshiba TC86C001 ("Goku-S") UDC
+ *
+ * This has three semi-configurable full speed bulk/interrupt endpoints.
+ */
+#ifdef	CONFIG_USB_GADGET_GOKU
+#define CHIP				"goku"
+#define DRIVER_VERSION_NUM		0x0116
+#define EP0_MAXPACKET			8
+static const char EP_OUT_NAME [] =	"ep1-bulk";
+#define EP_OUT_NUM			1
+static const char EP_IN_NAME [] =	"ep2-bulk";
+#define EP_IN_NUM			2
+#define SELFPOWER			USB_CONFIG_ATT_SELFPOWER
+
+/* no hw optimizations to apply */
+#define hw_optimize(g)			do {} while (0)
+#endif
+
+/*
+ * USB Controller Defaults
+ */
+#ifndef EP0_MAXPACKET
+#error Configure some USB peripheral controller for g_serial!
+#endif
+
+#ifndef SELFPOWER
+/* default: say we rely on bus power */
+#define SELFPOWER   			0
+/* else value must be USB_CONFIG_ATT_SELFPOWER */
+#endif
+
+#ifndef	MAX_USB_POWER
+/* any hub supports this steady state bus power consumption */
+#define MAX_USB_POWER			100	/* mA */
+#endif
+
+#ifndef	WAKEUP
+/* default: this driver won't do remote wakeup */
+#define WAKEUP				0
+/* else value must be USB_CONFIG_ATT_WAKEUP */
+#endif
+
+/* Thanks to NetChip Technologies for donating this product ID.
+ *
+ * DO NOT REUSE THESE IDs with a protocol-incompatible driver!!  Ever!!
+ * Instead:  allocate your own, using normal USB-IF procedures.
+ */
+#define GS_VENDOR_ID	0x0525		/* NetChip */
+#define GS_PRODUCT_ID	0xa4a6		/* Linux-USB Serial Gadget */
+
+
+/* Structures */
+
+struct gs_dev;
+
+/* circular buffer */
+struct gs_buf {
+	unsigned int		buf_size;
+	char			*buf_buf;
+	char			*buf_get;
+	char			*buf_put;
+};
+
+/* list of requests */
+struct gs_req_entry {
+	struct list_head	re_entry;
+	struct usb_request	*re_req;
+};
+
+/* the port structure holds info for each port, one for each minor number */
+struct gs_port {
+	struct gs_dev 		*port_dev;	/* pointer to device struct */
+	struct tty_struct	*port_tty;	/* pointer to tty struct */
+	spinlock_t		port_lock;
+	int 			port_num;
+	int			port_open_count;
+	int			port_in_use;	/* open/close in progress */
+	wait_queue_head_t	port_write_wait;/* waiting to write */
+	struct gs_buf		*port_write_buf;
+};
+
+/* the device structure holds info for the USB device */
+struct gs_dev {
+	struct usb_gadget	*dev_gadget;	/* gadget device pointer */
+	spinlock_t		dev_lock;	/* lock for set/reset config */
+	int			dev_config;	/* configuration number */
+	struct usb_ep		*dev_in_ep;	/* address of in endpoint */
+	struct usb_ep		*dev_out_ep;	/* address of out endpoint */
+	struct usb_request	*dev_ctrl_req;	/* control request */
+	struct list_head	dev_req_list;	/* list of write requests */
+	int			dev_sched_port;	/* round robin port scheduled */
+	struct gs_port		*dev_port[GS_NUM_PORTS]; /* the ports */
+};
+
+
+/* Functions */
+
+/* module */
+static int __init gs_module_init(void);
+static void __exit gs_module_exit(void);
+
+/* tty driver */
+static int gs_open(struct tty_struct *tty, struct file *file);
+static void gs_close(struct tty_struct *tty, struct file *file);
+static int gs_write(struct tty_struct *tty, int from_user,
+	const unsigned char *buf, int count);
+static void gs_put_char(struct tty_struct *tty, unsigned char ch);
+static void gs_flush_chars(struct tty_struct *tty);
+static int gs_write_room(struct tty_struct *tty);
+static int gs_chars_in_buffer(struct tty_struct *tty);
+static void gs_throttle(struct tty_struct * tty);
+static void gs_unthrottle(struct tty_struct * tty);
+static void gs_break(struct tty_struct *tty, int break_state);
+static int  gs_ioctl(struct tty_struct *tty, struct file *file,
+	unsigned int cmd, unsigned long arg);
+static void gs_set_termios(struct tty_struct *tty, struct termios *old);
+
+static int gs_send(struct gs_dev *dev);
+static int gs_send_packet(struct gs_dev *dev, char *packet,
+	unsigned int size);
+static int gs_recv_packet(struct gs_dev *dev, char *packet,
+	unsigned int size);
+static void gs_read_complete(struct usb_ep *ep, struct usb_request *req);
+static void gs_write_complete(struct usb_ep *ep, struct usb_request *req);
+
+/* gadget driver */
+static int gs_bind(struct usb_gadget *gadget);
+static void gs_unbind(struct usb_gadget *gadget);
+static int gs_setup(struct usb_gadget *gadget,
+	const struct usb_ctrlrequest *ctrl);
+static void gs_setup_complete(struct usb_ep *ep, struct usb_request *req);
+static void gs_disconnect(struct usb_gadget *gadget);
+static int gs_set_config(struct gs_dev *dev, unsigned config);
+static void gs_reset_config(struct gs_dev *dev);
+static int gs_build_config_desc(u8 *buf, enum usb_device_speed speed,
+		u8 type, unsigned int index);
+
+static struct usb_request *gs_alloc_req(struct usb_ep *ep, unsigned int len,
+	int kmalloc_flags);
+static void gs_free_req(struct usb_ep *ep, struct usb_request *req);
+
+static struct gs_req_entry *gs_alloc_req_entry(struct usb_ep *ep, unsigned len,
+	int kmalloc_flags);
+static void gs_free_req_entry(struct usb_ep *ep, struct gs_req_entry *req);
+
+static int gs_alloc_ports(struct gs_dev *dev, int kmalloc_flags);
+static void gs_free_ports(struct gs_dev *dev);
+
+/* circular buffer */
+static struct gs_buf *gs_buf_alloc(unsigned int size, int kmalloc_flags);
+static void gs_buf_free(struct gs_buf *gb);
+static void gs_buf_clear(struct gs_buf *gb);
+static unsigned int gs_buf_data_avail(struct gs_buf *gb);
+static unsigned int gs_buf_space_avail(struct gs_buf *gb);
+static unsigned int gs_buf_put(struct gs_buf *gb, const char *buf,
+	unsigned int count);
+static unsigned int gs_buf_get(struct gs_buf *gb, char *buf,
+	unsigned int count);
+
+
+/* Globals */
+
+static struct gs_dev *gs_device;
+
+static struct semaphore	gs_open_close_sem[GS_NUM_PORTS];
+
+static unsigned int read_q_size = GS_DEFAULT_READ_Q_SIZE;
+static unsigned int write_q_size = GS_DEFAULT_WRITE_Q_SIZE;
+
+static unsigned int write_buf_size = GS_DEFAULT_WRITE_BUF_SIZE;
+
+static unsigned char gs_tmp_buf[GS_TMP_BUF_SIZE];
+static struct semaphore	gs_tmp_buf_sem;
+
+/* tty driver struct */
+static struct tty_operations gs_tty_ops = {
+	.open =			gs_open,
+	.close =		gs_close,
+	.write =		gs_write,
+	.put_char =		gs_put_char,
+	.flush_chars =		gs_flush_chars,
+	.write_room =		gs_write_room,
+	.ioctl =		gs_ioctl,
+	.set_termios =		gs_set_termios,
+	.throttle =		gs_throttle,
+	.unthrottle =		gs_unthrottle,
+	.break_ctl =		gs_break,
+	.chars_in_buffer =	gs_chars_in_buffer,
+};
+static struct tty_driver *gs_tty_driver;
+
+/* gadget driver struct */
+static struct usb_gadget_driver gs_gadget_driver = {
+#ifdef HIGHSPEED
+	.speed =		USB_SPEED_HIGH,
+#else
+	.speed =		USB_SPEED_FULL,
+#endif
+	.function =		GS_LONG_NAME,
+	.bind =			gs_bind,
+	.unbind =		gs_unbind,
+	.setup =		gs_setup,
+	.disconnect =		gs_disconnect,
+	.driver = {
+		.name =		GS_SHORT_NAME,
+		/* .shutdown = ... */
+		/* .suspend = ...  */
+		/* .resume = ...   */
+	},
+};
+
+
+/* USB descriptors */
+
+#define GS_MANUFACTURER_STR_ID	1
+#define GS_PRODUCT_STR_ID	2
+#define GS_SERIAL_STR_ID	3
+#define GS_CONFIG_STR_ID	4
+
+/* static strings, in iso 8859/1 */
+static struct usb_string gs_strings[] = {
+	{ GS_MANUFACTURER_STR_ID, UTS_SYSNAME " " UTS_RELEASE " with " CHIP },
+	{ GS_PRODUCT_STR_ID, GS_LONG_NAME },
+	{ GS_SERIAL_STR_ID, "0" },
+	{ GS_CONFIG_STR_ID, "Bulk" },
+	{  } /* end of list */
+};
+
+static struct usb_gadget_strings gs_string_table = {
+	.language =		0x0409,	/* en-us */
+	.strings =		gs_strings,
+};
+
+static const struct usb_device_descriptor gs_device_desc = {
+	.bLength =		USB_DT_DEVICE_SIZE,
+	.bDescriptorType =	USB_DT_DEVICE,
+	.bcdUSB =		__constant_cpu_to_le16(0x0200),
+	.bDeviceClass =		USB_CLASS_VENDOR_SPEC,
+	.bMaxPacketSize0 =	EP0_MAXPACKET,
+	.idVendor =		__constant_cpu_to_le16(GS_VENDOR_ID),
+	.idProduct =		__constant_cpu_to_le16(GS_PRODUCT_ID),
+	.bcdDevice =		__constant_cpu_to_le16(GS_VERSION_NUM),
+	.iManufacturer =	GS_MANUFACTURER_STR_ID,
+	.iProduct =		GS_PRODUCT_STR_ID,
+	.iSerialNumber =	GS_SERIAL_STR_ID,
+	.bNumConfigurations =	GS_NUM_CONFIGS,
+};
+
+static const struct usb_config_descriptor gs_config_desc = {
+	.bLength =		USB_DT_CONFIG_SIZE,
+	.bDescriptorType =	USB_DT_CONFIG,
+	/* .wTotalLength set by gs_build_config_desc */
+	.bNumInterfaces =	GS_NUM_INTERFACES,
+	.bConfigurationValue =	GS_BULK_CONFIG_ID,
+	.iConfiguration =	GS_CONFIG_STR_ID,
+	.bmAttributes =		USB_CONFIG_ATT_ONE | SELFPOWER | WAKEUP,
+	.bMaxPower =		(MAX_USB_POWER + 1) / 2,
+};
+
+static const struct usb_interface_descriptor gs_interface_desc = {
+	.bLength =		USB_DT_INTERFACE_SIZE,
+	.bDescriptorType =	USB_DT_INTERFACE,
+	.bNumEndpoints =	GS_NUM_ENDPOINTS,
+	.bInterfaceClass =	USB_CLASS_VENDOR_SPEC,
+	.iInterface =		GS_CONFIG_STR_ID,
+};
+
+static const struct usb_endpoint_descriptor gs_fullspeed_in_desc = {
+	.bLength =		USB_DT_ENDPOINT_SIZE,
+	.bDescriptorType =	USB_DT_ENDPOINT,
+	.bEndpointAddress =	EP_IN_NUM | USB_DIR_IN,
+	.bmAttributes =		USB_ENDPOINT_XFER_BULK,
+	.wMaxPacketSize =	__constant_cpu_to_le16(64),
+};
+
+static const struct usb_endpoint_descriptor gs_fullspeed_out_desc = {
+	.bLength =		USB_DT_ENDPOINT_SIZE,
+	.bDescriptorType =	USB_DT_ENDPOINT,
+	.bEndpointAddress =	EP_OUT_NUM | USB_DIR_OUT,
+	.bmAttributes =		USB_ENDPOINT_XFER_BULK,
+	.wMaxPacketSize =	__constant_cpu_to_le16(64),
+};
+
+static const struct usb_endpoint_descriptor gs_highspeed_in_desc = {
+	.bLength =		USB_DT_ENDPOINT_SIZE,
+	.bDescriptorType =	USB_DT_ENDPOINT,
+	.bEndpointAddress =	EP_IN_NUM | USB_DIR_IN,
+	.bmAttributes =		USB_ENDPOINT_XFER_BULK,
+	.wMaxPacketSize =	__constant_cpu_to_le16(512),
+};
+
+static const struct usb_endpoint_descriptor gs_highspeed_out_desc = {
+	.bLength =		USB_DT_ENDPOINT_SIZE,
+	.bDescriptorType =	USB_DT_ENDPOINT,
+	.bEndpointAddress =	EP_OUT_NUM | USB_DIR_OUT,
+	.bmAttributes =		USB_ENDPOINT_XFER_BULK,
+	.wMaxPacketSize =	__constant_cpu_to_le16(512),
+};
+
+#ifdef HIGHSPEED
+static const struct usb_qualifier_descriptor gs_qualifier_desc = {
+	.bLength =		sizeof(struct usb_qualifier_descriptor),
+	.bDescriptorType =	USB_DT_DEVICE_QUALIFIER,
+	.bcdUSB =		__constant_cpu_to_le16 (0x0200),
+	.bDeviceClass =		USB_CLASS_VENDOR_SPEC,
+	/* assumes ep0 uses the same value for both speeds ... */
+	.bMaxPacketSize0 =	EP0_MAXPACKET,
+	.bNumConfigurations =	GS_NUM_CONFIGS,
+};
+#endif
+
+
+/* Module */
+MODULE_DESCRIPTION(GS_LONG_NAME);
+MODULE_AUTHOR("Al Borchers");
+MODULE_LICENSE("GPL");
+
+MODULE_PARM(debug, "i");
+MODULE_PARM_DESC(debug, "Enable debugging, 0=off, 1=on");
+
+MODULE_PARM(read_q_size, "i");
+MODULE_PARM_DESC(read_q_size, "Read request queue size, default=32");
+
+MODULE_PARM(write_q_size, "i");
+MODULE_PARM_DESC(write_q_size, "Write request queue size, default=32");
+
+MODULE_PARM(write_buf_size, "i");
+MODULE_PARM_DESC(write_buf_size, "Write buffer size, default=8192");
+
+module_init(gs_module_init);
+module_exit(gs_module_exit);
+
+/*
+*  gs_module_init
+*
+*  Register as a USB gadget driver and a tty driver.
+*/
+static int __init gs_module_init(void)
+{
+	int i;
+	int retval;
+
+	retval = usb_gadget_register_driver(&gs_gadget_driver);
+	if (retval) {
+		printk(KERN_ERR "gs_module_init: cannot register gadget driver, ret=%d\n", retval);
+		return retval;
+	}
+
+	gs_tty_driver = alloc_tty_driver(GS_NUM_PORTS);
+	if (!gs_tty_driver)
+		return -ENOMEM;
+	gs_tty_driver->owner = THIS_MODULE;
+	gs_tty_driver->driver_name = GS_SHORT_NAME;
+	gs_tty_driver->name = "ttygs";
+	gs_tty_driver->devfs_name = "usb/ttygs/";
+	gs_tty_driver->major = GS_MAJOR;
+	gs_tty_driver->minor_start = GS_MINOR_START;
+	gs_tty_driver->type = TTY_DRIVER_TYPE_SERIAL;
+	gs_tty_driver->subtype = SERIAL_TYPE_NORMAL;
+	gs_tty_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
+	gs_tty_driver->init_termios = tty_std_termios;
+	gs_tty_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
+	tty_set_operations(gs_tty_driver, &gs_tty_ops);
+
+	for (i=0; i < GS_NUM_PORTS; i++)
+		sema_init(&gs_open_close_sem[i], 1);
+
+	sema_init(&gs_tmp_buf_sem, 1);
+
+	retval = tty_register_driver(gs_tty_driver);
+	if (retval) {
+		usb_gadget_unregister_driver(&gs_gadget_driver);
+		put_tty_driver(gs_tty_driver);
+		printk(KERN_ERR "gs_module_init: cannot register tty driver, ret=%d\n", retval);
+		return retval;
+	}
+
+	printk(KERN_INFO "gs_module_init: %s %s loaded\n", GS_LONG_NAME, GS_VERSION_STR);
+	return 0;
+}
+
+/*
+* gs_module_exit
+*
+* Unregister as a tty driver and a USB gadget driver.
+*/
+static void __exit gs_module_exit(void)
+{
+	tty_unregister_driver(gs_tty_driver);
+	put_tty_driver(gs_tty_driver);
+	usb_gadget_unregister_driver(&gs_gadget_driver);
+
+	printk(KERN_INFO "gs_module_exit: %s %s unloaded\n", GS_LONG_NAME, GS_VERSION_STR);
+}
+
+/* TTY Driver */
+
+/*
+ * gs_open
+ */
+static int gs_open(struct tty_struct *tty, struct file *file)
+{
+	int port_num;
+	unsigned long flags;
+	struct gs_port *port;
+	struct gs_dev *dev;
+	struct gs_buf *buf;
+	struct semaphore *sem;
+
+	port_num = tty->index;
+
+	gs_debug("gs_open: (%d,%p,%p)\n", port_num, tty, file);
+
+	tty->driver_data = NULL;
+
+	if (port_num < 0 || port_num >= GS_NUM_PORTS) {
+		printk(KERN_ERR "gs_open: (%d,%p,%p) invalid port number\n",
+			port_num, tty, file);
+		return -ENODEV;
+	}
+
+	dev = gs_device;
+
+	if (dev == NULL) {
+		printk(KERN_ERR "gs_open: (%d,%p,%p) NULL device pointer\n",
+			port_num, tty, file);
+		return -ENODEV;
+	}
+
+	sem = &gs_open_close_sem[port_num];
+	if (down_interruptible(sem)) {
+		printk(KERN_ERR
+		"gs_open: (%d,%p,%p) interrupted waiting for semaphore\n",
+			port_num, tty, file);
+		return -ERESTARTSYS;
+	}
+
+	spin_lock_irqsave(&dev->dev_lock, flags);
+
+	if (dev->dev_config == GS_NO_CONFIG_ID) {
+		printk(KERN_ERR
+			"gs_open: (%d,%p,%p) device is not connected\n",
+			port_num, tty, file);
+		spin_unlock_irqrestore(&dev->dev_lock, flags);
+		up(sem);
+		return -ENODEV;
+	}
+
+	port = dev->dev_port[port_num];
+
+	if (port == NULL) {
+		printk(KERN_ERR "gs_open: (%d,%p,%p) NULL port pointer\n",
+			port_num, tty, file);
+		spin_unlock_irqrestore(&dev->dev_lock, flags);
+		up(sem);
+		return -ENODEV;
+	}
+
+	spin_lock(&port->port_lock);
+	spin_unlock(&dev->dev_lock);
+
+	if (port->port_dev == NULL) {
+		printk(KERN_ERR "gs_open: (%d,%p,%p) port disconnected (1)\n",
+			port_num, tty, file);
+		spin_unlock_irqrestore(&port->port_lock, flags);
+		up(sem);
+		return -EIO;
+	}
+
+	if (port->port_open_count > 0) {
+		++port->port_open_count;
+		spin_unlock_irqrestore(&port->port_lock, flags);
+		gs_debug("gs_open: (%d,%p,%p) already open\n",
+			port_num, tty, file);
+		up(sem);
+		return 0;
+	}
+
+	/* mark port as in use, we can drop port lock and sleep if necessary */
+	port->port_in_use = 1;
+
+	/* allocate write buffer on first open */
+	if (port->port_write_buf == NULL) {
+		spin_unlock_irqrestore(&port->port_lock, flags);
+		buf = gs_buf_alloc(write_buf_size, GFP_KERNEL);
+		spin_lock_irqsave(&port->port_lock, flags);
+
+		/* might have been disconnected while asleep, check */
+		if (port->port_dev == NULL) {
+			printk(KERN_ERR
+				"gs_open: (%d,%p,%p) port disconnected (2)\n",
+				port_num, tty, file);
+			port->port_in_use = 0;
+			spin_unlock_irqrestore(&port->port_lock, flags);
+			up(sem);
+			return -EIO;
+		}
+
+		if ((port->port_write_buf=buf) == NULL) {
+			printk(KERN_ERR "gs_open: (%d,%p,%p) cannot allocate port write buffer\n",
+				port_num, tty, file);
+			port->port_in_use = 0;
+			spin_unlock_irqrestore(&port->port_lock, flags);
+			up(sem);
+			return -ENOMEM;
+		}
+
+	}
+
+	/* wait for carrier detect (not implemented) */
+
+	/* might have been disconnected while asleep, check */
+	if (port->port_dev == NULL) {
+		printk(KERN_ERR "gs_open: (%d,%p,%p) port disconnected (3)\n",
+			port_num, tty, file);
+		port->port_in_use = 0;
+		spin_unlock_irqrestore(&port->port_lock, flags);
+		up(sem);
+		return -EIO;
+	}
+
+	tty->driver_data = port;
+	port->port_tty = tty;
+	port->port_open_count = 1;
+	port->port_in_use = 0;
+
+	spin_unlock_irqrestore(&port->port_lock, flags);
+	up(sem);
+
+	gs_debug("gs_open: (%d,%p,%p) completed\n", port_num, tty, file);
+
+	return 0;
+}
+
+/*
+ * gs_close
+ */
+static void gs_close(struct tty_struct *tty, struct file *file)
+{
+	unsigned long flags;
+	struct gs_port *port = tty->driver_data;
+	struct semaphore *sem;
+
+	if (port == NULL) {
+		printk(KERN_ERR "gs_close: NULL port pointer\n");
+		return;
+	}
+
+	gs_debug("gs_close: (%d,%p,%p)\n", port->port_num, tty, file);
+
+	sem = &gs_open_close_sem[port->port_num];
+	down(sem);
+
+	spin_lock_irqsave(&port->port_lock, flags);
+
+	if (port->port_open_count == 0) {
+		printk(KERN_ERR
+			"gs_close: (%d,%p,%p) port is already closed\n",
+			port->port_num, tty, file);
+		spin_unlock_irqrestore(&port->port_lock, flags);
+		up(sem);
+		return;
+	}
+
+	if (port->port_open_count > 0) {
+		--port->port_open_count;
+		spin_unlock_irqrestore(&port->port_lock, flags);
+		up(sem);
+		return;
+	}
+
+	/* free disconnected port on final close */
+	if (port->port_dev == NULL) {
+		kfree(port);
+		spin_unlock_irqrestore(&port->port_lock, flags);
+		up(sem);
+		return;
+	}
+
+	/* mark port as closed but in use, we can drop port lock */
+	/* and sleep if necessary */
+	port->port_in_use = 1;
+	port->port_open_count = 0;
+
+	/* wait for write buffer to drain, or */
+	/* at most GS_CLOSE_TIMEOUT seconds */
+	if (gs_buf_data_avail(port->port_write_buf) > 0) {
+		wait_cond_interruptible_timeout(port->port_write_wait,
+		port->port_dev == NULL
+		|| gs_buf_data_avail(port->port_write_buf) == 0,
+		&port->port_lock, flags, GS_CLOSE_TIMEOUT * HZ);
+	}
+
+	/* free disconnected port on final close */
+	/* (might have happened during the above sleep) */
+	if (port->port_dev == NULL) {
+		kfree(port);
+		spin_unlock_irqrestore(&port->port_lock, flags);
+		up(sem);
+		return;
+	}
+
+	gs_buf_clear(port->port_write_buf);
+
+	tty->driver_data = NULL;
+	port->port_tty = NULL;
+	port->port_in_use = 0;
+
+	spin_unlock_irqrestore(&port->port_lock, flags);
+	up(sem);
+
+	gs_debug("gs_close: (%d,%p,%p) completed\n",
+		port->port_num, tty, file);
+}
+
+/*
+ * gs_write
+ */
+static int gs_write(struct tty_struct *tty, int from_user, const unsigned char *buf, int count)
+{
+	unsigned long flags;
+	struct gs_port *port = tty->driver_data;
+
+	if (port == NULL) {
+		printk(KERN_ERR "gs_write: NULL port pointer\n");
+		return -EIO;
+	}
+
+	gs_debug("gs_write: (%d,%p) writing %d bytes\n", port->port_num, tty,
+		count);
+
+	if (count == 0)
+		return 0;
+
+	/* copy from user into tmp buffer, get tmp_buf semaphore */
+	if (from_user) {
+		if (count > GS_TMP_BUF_SIZE)
+			count = GS_TMP_BUF_SIZE;
+		down(&gs_tmp_buf_sem);
+		if (copy_from_user(gs_tmp_buf, buf, count) != 0) {
+			up(&gs_tmp_buf_sem);
+			printk(KERN_ERR
+			"gs_write: (%d,%p) cannot copy from user space\n",
+				port->port_num, tty);
+			return -EFAULT;
+		}
+		buf = gs_tmp_buf;
+	}
+
+	spin_lock_irqsave(&port->port_lock, flags);
+
+	if (port->port_dev == NULL) {
+		printk(KERN_ERR "gs_write: (%d,%p) port is not connected\n",
+			port->port_num, tty);
+		spin_unlock_irqrestore(&port->port_lock, flags);
+		if (from_user)
+			up(&gs_tmp_buf_sem);
+		return -EIO;
+	}
+
+	if (port->port_open_count == 0) {
+		printk(KERN_ERR "gs_write: (%d,%p) port is closed\n",
+			port->port_num, tty);
+		spin_unlock_irqrestore(&port->port_lock, flags);
+		if (from_user)
+			up(&gs_tmp_buf_sem);
+		return -EBADF;
+	}
+
+	count = gs_buf_put(port->port_write_buf, buf, count);
+
+	spin_unlock_irqrestore(&port->port_lock, flags);
+
+	if (from_user)
+		up(&gs_tmp_buf_sem);
+
+	gs_send(gs_device);
+
+	gs_debug("gs_write: (%d,%p) wrote %d bytes\n", port->port_num, tty,
+		count);
+
+	return count;
+}
+
+/*
+ * gs_put_char
+ */
+static void gs_put_char(struct tty_struct *tty, unsigned char ch)
+{
+	unsigned long flags;
+	struct gs_port *port = tty->driver_data;
+
+	if (port == NULL) {
+		printk(KERN_ERR "gs_put_char: NULL port pointer\n");
+		return;
+	}
+
+	gs_debug("gs_put_char: (%d,%p) char=0x%x, called from %p, %p, %p\n", port->port_num, tty, ch, __builtin_return_address(0), __builtin_return_address(1), __builtin_return_address(2));
+
+	spin_lock_irqsave(&port->port_lock, flags);
+
+	if (port->port_dev == NULL) {
+		printk(KERN_ERR "gs_put_char: (%d,%p) port is not connected\n",
+			port->port_num, tty);
+		spin_unlock_irqrestore(&port->port_lock, flags);
+		return;
+	}
+
+	if (port->port_open_count == 0) {
+		printk(KERN_ERR "gs_put_char: (%d,%p) port is closed\n",
+			port->port_num, tty);
+		spin_unlock_irqrestore(&port->port_lock, flags);
+		return;
+	}
+
+	gs_buf_put(port->port_write_buf, &ch, 1);
+
+	spin_unlock_irqrestore(&port->port_lock, flags);
+}
+
+/*
+ * gs_flush_chars
+ */
+static void gs_flush_chars(struct tty_struct *tty)
+{
+	unsigned long flags;
+	struct gs_port *port = tty->driver_data;
+
+	if (port == NULL) {
+		printk(KERN_ERR "gs_flush_chars: NULL port pointer\n");
+		return;
+	}
+
+	gs_debug("gs_flush_chars: (%d,%p)\n", port->port_num, tty);
+
+	spin_lock_irqsave(&port->port_lock, flags);
+
+	if (port->port_dev == NULL) {
+		printk(KERN_ERR
+			"gs_flush_chars: (%d,%p) port is not connected\n",
+			port->port_num, tty);
+		spin_unlock_irqrestore(&port->port_lock, flags);
+		return;
+	}
+
+	if (port->port_open_count == 0) {
+		printk(KERN_ERR "gs_flush_chars: (%d,%p) port is closed\n",
+			port->port_num, tty);
+		spin_unlock_irqrestore(&port->port_lock, flags);
+		return;
+	}
+
+	spin_unlock_irqrestore(&port->port_lock, flags);
+
+	gs_send(gs_device);
+}
+
+/*
+ * gs_write_room
+ */
+static int gs_write_room(struct tty_struct *tty)
+{
+
+	int room = 0;
+	unsigned long flags;
+	struct gs_port *port = tty->driver_data;
+
+
+	if (port == NULL)
+		return 0;
+
+	spin_lock_irqsave(&port->port_lock, flags);
+
+	if (port->port_dev != NULL && port->port_open_count > 0
+	&& port->port_write_buf != NULL)
+		room = gs_buf_space_avail(port->port_write_buf);
+
+	spin_unlock_irqrestore(&port->port_lock, flags);
+
+	gs_debug("gs_write_room: (%d,%p) room=%d\n",
+		port->port_num, tty, room);
+
+	return room;
+}
+
+/*
+ * gs_chars_in_buffer
+ */
+static int gs_chars_in_buffer(struct tty_struct *tty)
+{
+	int chars = 0;
+	unsigned long flags;
+	struct gs_port *port = tty->driver_data;
+
+	if (port == NULL)
+		return 0;
+
+	spin_lock_irqsave(&port->port_lock, flags);
+
+	if (port->port_dev != NULL && port->port_open_count > 0
+	&& port->port_write_buf != NULL)
+		chars = gs_buf_data_avail(port->port_write_buf);
+
+	spin_unlock_irqrestore(&port->port_lock, flags);
+
+	gs_debug("gs_chars_in_buffer: (%d,%p) chars=%d\n",
+		port->port_num, tty, chars);
+
+	return chars;
+}
+
+/*
+ * gs_throttle
+ */
+static void gs_throttle(struct tty_struct *tty)
+{
+}
+
+/*
+ * gs_unthrottle
+ */
+static void gs_unthrottle(struct tty_struct *tty)
+{
+}
+
+/*
+ * gs_break
+ */
+static void gs_break(struct tty_struct *tty, int break_state)
+{
+}
+
+/*
+ * gs_ioctl
+ */
+static int gs_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg)
+{
+	struct gs_port *port = tty->driver_data;
+
+	if (port == NULL) {
+		printk(KERN_ERR "gs_ioctl: NULL port pointer\n");
+		return -EIO;
+	}
+
+	gs_debug("gs_ioctl: (%d,%p,%p) cmd=0x%4.4x, arg=%lu\n",
+		port->port_num, tty, file, cmd, arg);
+
+	/* handle ioctls */
+
+	/* could not handle ioctl */
+	return -ENOIOCTLCMD;
+}
+
+/*
+ * gs_set_termios
+ */
+static void gs_set_termios(struct tty_struct *tty, struct termios *old)
+{
+}
+
+/*
+* gs_send
+*
+* This function finds available write requests, calls
+* gs_send_packet to fill these packets with data, and
+* continues until either there are no more write requests
+* available or no more data to send.  This function is
+* run whenever data arrives or write requests are available.
+*/
+static int gs_send(struct gs_dev *dev)
+{
+	int ret,len;
+	unsigned long flags;
+	struct usb_ep *ep;
+	struct usb_request *req;
+	struct gs_req_entry *req_entry;
+
+	if (dev == NULL) {
+		printk(KERN_ERR "gs_send: NULL device pointer\n");
+		return -ENODEV;
+	}
+
+	spin_lock_irqsave(&dev->dev_lock, flags);
+
+	ep = dev->dev_in_ep;
+
+	while(!list_empty(&dev->dev_req_list)) {
+
+		req_entry = list_entry(dev->dev_req_list.next,
+			struct gs_req_entry, re_entry);
+
+		req = req_entry->re_req;
+
+		len = gs_send_packet(dev, req->buf, ep->maxpacket);
+
+		if (len > 0) {
+gs_debug_level(3, "gs_send: len=%d, 0x%2.2x 0x%2.2x 0x%2.2x ...\n", len, *((unsigned char *)req->buf), *((unsigned char *)req->buf+1), *((unsigned char *)req->buf+2));
+			list_del(&req_entry->re_entry);
+			req->length = len;
+			if ((ret=usb_ep_queue(ep, req, GFP_ATOMIC))) {
+				printk(KERN_ERR
+				"gs_send: cannot queue read request, ret=%d\n",
+					ret);
+				break;
+			}
+		} else {
+			break;
+		}
+
+	}
+
+	spin_unlock_irqrestore(&dev->dev_lock, flags);
+
+	return 0;
+}
+
+/*
+ * gs_send_packet
+ *
+ * If there is data to send, a packet is built in the given
+ * buffer and the size is returned.  If there is no data to
+ * send, 0 is returned.  If there is any error a negative
+ * error number is returned.
+ *
+ * Called during USB completion routine, on interrupt time.
+ *
+ * We assume that disconnect will not happen until all completion
+ * routines have completed, so we can assume that the dev_port
+ * array does not change during the lifetime of this function.
+ */
+static int gs_send_packet(struct gs_dev *dev, char *packet, unsigned int size)
+{
+	unsigned int len;
+	struct gs_port *port;
+
+	/* TEMPORARY -- only port 0 is supported right now */
+	port = dev->dev_port[0];
+
+	if (port == NULL) {
+		printk(KERN_ERR
+			"gs_send_packet: port=%d, NULL port pointer\n",
+			0);
+		return -EIO;
+	}
+
+	spin_lock(&port->port_lock);
+
+	len = gs_buf_data_avail(port->port_write_buf);
+	if (len < size)
+		size = len;
+
+	if (size == 0) {
+		spin_unlock(&port->port_lock);
+		return 0;
+	}
+
+	size = gs_buf_get(port->port_write_buf, packet, size);
+
+	wake_up_interruptible(&port->port_tty->write_wait);
+
+	spin_unlock(&port->port_lock);
+
+	return size;
+}
+
+/*
+ * gs_recv_packet
+ *
+ * Called for each USB packet received.  Reads the packet
+ * header and stuffs the data in the appropriate tty buffer.
+ * Returns 0 if successful, or a negative error number.
+ *
+ * Called during USB completion routine, on interrupt time.
+ *
+ * We assume that disconnect will not happen until all completion
+ * routines have completed, so we can assume that the dev_port
+ * array does not change during the lifetime of this function.
+ */
+static int gs_recv_packet(struct gs_dev *dev, char *packet, unsigned int size)
+{
+	unsigned int len;
+	struct gs_port *port;
+
+	/* TEMPORARY -- only port 0 is supported right now */
+	port = dev->dev_port[0];
+
+	if (port == NULL) {
+		printk(KERN_ERR "gs_recv_packet: port=%d, NULL port pointer\n",
+			port->port_num);
+		return -EIO;
+	}
+
+	spin_lock(&port->port_lock);
+
+	if (port->port_tty == NULL) {
+		printk(KERN_ERR "gs_recv_packet: port=%d, NULL tty pointer\n",
+			port->port_num);
+		spin_unlock(&port->port_lock);
+		return -EIO;
+	}
+
+	if (port->port_tty->magic != TTY_MAGIC) {
+		printk(KERN_ERR "gs_recv_packet: port=%d, bad tty magic\n",
+			port->port_num);
+		spin_unlock(&port->port_lock);
+		return -EIO;
+	}
+
+	len = (unsigned int)(TTY_FLIPBUF_SIZE - port->port_tty->flip.count);
+	if (len < size)
+		size = len;
+
+	if (size > 0) {
+		memcpy(port->port_tty->flip.char_buf_ptr, packet, size);
+		port->port_tty->flip.char_buf_ptr += size;
+		port->port_tty->flip.count += size;
+		tty_flip_buffer_push(port->port_tty);
+		wake_up_interruptible(&port->port_tty->read_wait);
+	}
+
+	spin_unlock(&port->port_lock);
+
+	return 0;
+}
+
+/*
+* gs_read_complete
+*/
+static void gs_read_complete(struct usb_ep *ep, struct usb_request *req)
+{
+	int ret;
+	struct gs_dev *dev = ep->driver_data;
+
+	if (dev == NULL) {
+		printk(KERN_ERR "gs_read_complete: NULL device pointer\n");
+		return;
+	}
+
+	switch(req->status) {
+	case 0:
+ 		/* normal completion */
+		gs_recv_packet(dev, req->buf, req->actual);
+requeue:
+		req->length = ep->maxpacket;
+		if ((ret=usb_ep_queue(ep, req, GFP_ATOMIC))) {
+			printk(KERN_ERR
+			"gs_read_complete: cannot queue read request, ret=%d\n",
+				ret);
+		}
+		break;
+
+	case -ESHUTDOWN:
+		/* disconnect */
+		gs_debug("gs_read_complete: shutdown\n");
+		gs_free_req(ep, req);
+		break;
+
+	default:
+		/* unexpected */
+		printk(KERN_ERR
+		"gs_read_complete: unexpected status error, status=%d\n",
+			req->status);
+		goto requeue;
+		break;
+	}
+}
+
+/*
+* gs_write_complete
+*/
+static void gs_write_complete(struct usb_ep *ep, struct usb_request *req)
+{
+	struct gs_dev *dev = ep->driver_data;
+	struct gs_req_entry *gs_req = req->context;
+
+	if (dev == NULL) {
+		printk(KERN_ERR "gs_write_complete: NULL device pointer\n");
+		return;
+	}
+
+	switch(req->status) {
+	case 0:
+		/* normal completion */
+requeue:
+		if (gs_req == NULL) {
+			printk(KERN_ERR
+				"gs_write_complete: NULL request pointer\n");
+			return;
+		}
+
+		spin_lock(&dev->dev_lock);
+		list_add(&gs_req->re_entry, &dev->dev_req_list);
+		spin_unlock(&dev->dev_lock);
+
+		gs_send(dev);
+
+		break;
+
+	case -ESHUTDOWN:
+		/* disconnect */
+		gs_debug("gs_write_complete: shutdown\n");
+		gs_free_req(ep, req);
+		break;
+
+	default:
+		printk(KERN_ERR
+		"gs_write_complete: unexpected status error, status=%d\n",
+			req->status);
+		goto requeue;
+		break;
+	}
+}
+
+/* Gadget Driver */
+
+/*
+ * gs_bind
+ *
+ * Called on module load.  Allocates and initializes the device
+ * structure and a control request.
+ */
+static int gs_bind(struct usb_gadget *gadget)
+{
+	int ret;
+	struct gs_dev *dev;
+
+	gs_device = dev = kmalloc(sizeof(struct gs_dev), GFP_KERNEL);
+	if (dev == NULL)
+		return -ENOMEM;
+
+	set_gadget_data(gadget, dev);
+
+	memset(dev, 0, sizeof(struct gs_dev));
+	dev->dev_gadget = gadget;
+	spin_lock_init(&dev->dev_lock);
+	INIT_LIST_HEAD(&dev->dev_req_list);
+
+	if ((ret=gs_alloc_ports(dev, GFP_KERNEL)) != 0) {
+		printk(KERN_ERR "gs_bind: cannot allocate ports\n");
+		gs_unbind(gadget);
+		return ret;
+	}
+
+	/* preallocate control response and buffer */
+	dev->dev_ctrl_req = gs_alloc_req(gadget->ep0, GS_MAX_DESC_LEN,
+		GFP_KERNEL);
+	if (dev->dev_ctrl_req == NULL) {
+		gs_unbind(gadget);
+		return -ENOMEM;
+	}
+	dev->dev_ctrl_req->complete = gs_setup_complete;
+
+	gadget->ep0->driver_data = dev;
+
+	printk(KERN_INFO "gs_bind: %s %s bound\n",
+		GS_LONG_NAME, GS_VERSION_STR);
+
+	return 0;
+}
+
+/*
+ * gs_unbind
+ *
+ * Called on module unload.  Frees the control request and device
+ * structure.
+ */
+static void gs_unbind(struct usb_gadget *gadget)
+{
+	struct gs_dev *dev = get_gadget_data(gadget);
+
+	gs_device = NULL;
+
+	/* read/write requests already freed, only control request remains */
+	if (dev != NULL) {
+		if (dev->dev_ctrl_req != NULL)
+			gs_free_req(gadget->ep0, dev->dev_ctrl_req);
+		gs_free_ports(dev);
+		kfree(dev);
+		set_gadget_data(gadget, NULL);
+	}
+
+	printk(KERN_INFO "gs_unbind: %s %s unbound\n", GS_LONG_NAME,
+		GS_VERSION_STR);
+}
+
+/*
+ * gs_setup
+ *
+ * Implements all the control endpoint functionality that's not
+ * handled in hardware or the hardware driver.
+ *
+ * Returns the size of the data sent to the host, or a negative
+ * error number.
+ */
+static int gs_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
+{
+	int ret = -EOPNOTSUPP;
+	unsigned int sv_config;
+	struct gs_dev *dev = get_gadget_data(gadget);
+	struct usb_request *req = dev->dev_ctrl_req;
+
+	switch (ctrl->bRequest) {
+	case USB_REQ_GET_DESCRIPTOR:
+		if (ctrl->bRequestType != USB_DIR_IN)
+			break;
+
+		switch (ctrl->wValue >> 8) {
+		case USB_DT_DEVICE:
+			ret = min(ctrl->wLength,
+				(u16)sizeof(struct usb_device_descriptor));
+			memcpy(req->buf, &gs_device_desc, ret);
+			break;
+
+#ifdef HIGHSPEED
+		case USB_DT_DEVICE_QUALIFIER:
+			ret = min(ctrl->wLength,
+				(u16)sizeof(struct usb_qualifier_descriptor));
+			memcpy(req->buf, &gs_qualifier_desc, ret);
+			break;
+
+		case USB_DT_OTHER_SPEED_CONFIG:
+#endif /* HIGHSPEED */
+		case USB_DT_CONFIG:
+			ret = gs_build_config_desc(req->buf, gadget->speed,
+				ctrl->wValue >> 8, ctrl->wValue & 0xff);
+			if (ret >= 0)
+				ret = min(ctrl->wLength, (u16)ret);
+			break;
+
+		case USB_DT_STRING:
+			/* wIndex == language code. */
+			ret = usb_gadget_get_string(&gs_string_table,
+				ctrl->wValue & 0xff, req->buf);
+			if (ret >= 0)
+				ret = min(ctrl->wLength, (u16)ret);
+			break;
+		}
+		break;
+
+	case USB_REQ_SET_CONFIGURATION:
+		if (ctrl->bRequestType != 0)
+			break;
+		spin_lock(&dev->dev_lock);
+		ret = gs_set_config(dev, ctrl->wValue);
+		spin_unlock(&dev->dev_lock);
+		break;
+
+	case USB_REQ_GET_CONFIGURATION:
+		if (ctrl->bRequestType != USB_DIR_IN)
+			break;
+		*(u8 *)req->buf = dev->dev_config;
+		ret = min(ctrl->wLength, (u16)1);
+		break;
+
+	case USB_REQ_SET_INTERFACE:
+		if (ctrl->bRequestType != USB_RECIP_INTERFACE)
+			break;
+		spin_lock(&dev->dev_lock);
+		if (dev->dev_config == GS_BULK_CONFIG_ID
+		&& ctrl->wIndex == GS_INTERFACE_ID
+		&& ctrl->wValue == GS_ALT_INTERFACE_ID) {
+			sv_config = dev->dev_config;
+			/* since there is only one interface, setting the */
+			/* interface is equivalent to setting the config */
+			gs_reset_config(dev);
+			gs_set_config(dev, sv_config);
+			ret = 0;
+		}
+		spin_unlock(&dev->dev_lock);
+		break;
+
+	case USB_REQ_GET_INTERFACE:
+		if (ctrl->bRequestType != (USB_DIR_IN|USB_RECIP_INTERFACE))
+			break;
+		if (dev->dev_config == GS_NO_CONFIG_ID)
+			break;
+		if (ctrl->wIndex != GS_INTERFACE_ID) {
+			ret = -EDOM;
+			break;
+		}
+		*(u8 *)req->buf = GS_ALT_INTERFACE_ID;
+		ret = min(ctrl->wLength, (u16)1);
+		break;
+
+	default:
+		printk(KERN_ERR "gs_setup: unknown request, type=%02x, request=%02x, value=%04x, index=%04x, length=%d\n",
+			ctrl->bRequestType, ctrl->bRequest, ctrl->wValue,
+			ctrl->wIndex, ctrl->wLength);
+		break;
+
+	}
+
+	/* respond with data transfer before status phase? */
+	if (ret >= 0) {
+		req->length = ret;
+		ret = usb_ep_queue(gadget->ep0, req, GFP_ATOMIC);
+		if (ret < 0) {
+			printk(KERN_ERR
+				"gs_setup: cannot queue response, ret=%d\n",
+				ret);
+			req->status = 0;
+			gs_setup_complete(gadget->ep0, req);
+		}
+	}
+
+	/* device either stalls (ret < 0) or reports success */
+	return ret;
+}
+
+/*
+ * gs_setup_complete
+ */
+static void gs_setup_complete(struct usb_ep *ep, struct usb_request *req)
+{
+	if (req->status || req->actual != req->length) {
+		printk(KERN_ERR "gs_setup_complete: status error, status=%d, actual=%d, length=%d\n",
+			req->status, req->actual, req->length);
+	}
+}
+
+/*
+ * gs_disconnect
+ *
+ * Called when the device is disconnected.  Frees the closed
+ * ports and disconnects open ports.  Open ports will be freed
+ * on close.  Then reallocates the ports for the next connection.
+ */
+static void gs_disconnect(struct usb_gadget *gadget)
+{
+	unsigned long flags;
+	struct gs_dev *dev = get_gadget_data(gadget);
+
+	spin_lock_irqsave(&dev->dev_lock, flags);
+
+	gs_reset_config(dev);
+
+	/* free closed ports and disconnect open ports */
+	/* (open ports will be freed when closed) */
+	gs_free_ports(dev);
+
+	/* re-allocate ports for the next connection */
+	if (gs_alloc_ports(dev, GFP_ATOMIC) != 0)
+		printk(KERN_ERR "gs_disconnect: cannot re-allocate ports\n");
+
+	spin_unlock_irqrestore(&dev->dev_lock, flags);
+
+	printk(KERN_INFO "gs_disconnect: %s disconnected\n", GS_LONG_NAME);
+}
+
+/*
+ * gs_set_config
+ *
+ * Configures the device by enabling device specific
+ * optimizations, setting up the endpoints, allocating
+ * read and write requests and queuing read requests.
+ *
+ * The device lock must be held when calling this function.
+ */
+static int gs_set_config(struct gs_dev *dev, unsigned config)
+{
+	int i;
+	int ret = 0;
+	struct usb_gadget *gadget = dev->dev_gadget;
+	struct usb_ep *ep;
+	struct usb_request *req;
+	struct gs_req_entry *req_entry;
+
+	if (dev == NULL) {
+		printk(KERN_ERR "gs_set_config: NULL device pointer\n");
+		return 0;
+	}
+
+	if (config == dev->dev_config)
+		return 0;
+
+	gs_reset_config(dev);
+
+	if (config == GS_NO_CONFIG_ID)
+		return 0;
+
+	if (config != GS_BULK_CONFIG_ID)
+		return -EINVAL;
+
+	hw_optimize(gadget);
+
+	gadget_for_each_ep(ep, gadget) {
+
+		if (strcmp(ep->name, EP_IN_NAME) == 0) {
+			ret = usb_ep_enable(ep,
+				gadget->speed == USB_SPEED_HIGH ?
+ 				&gs_highspeed_in_desc : &gs_fullspeed_in_desc);
+			if (ret == 0) {
+				ep->driver_data = dev;
+				dev->dev_in_ep = ep;
+			} else {
+				printk(KERN_ERR "gs_set_config: cannot enable in endpoint %s, ret=%d\n",
+					ep->name, ret);
+				gs_reset_config(dev);
+				return ret;
+			}
+		}
+
+		else if (strcmp(ep->name, EP_OUT_NAME) == 0) {
+			ret = usb_ep_enable(ep,
+				gadget->speed == USB_SPEED_HIGH ?
+				&gs_highspeed_out_desc :
+				&gs_fullspeed_out_desc);
+			if (ret == 0) {
+				ep->driver_data = dev;
+				dev->dev_out_ep = ep;
+			} else {
+				printk(KERN_ERR "gs_set_config: cannot enable out endpoint %s, ret=%d\n",
+					ep->name, ret);
+				gs_reset_config(dev);
+				return ret;
+			}
+		}
+
+	}
+
+	if (dev->dev_in_ep == NULL || dev->dev_out_ep == NULL) {
+		gs_reset_config(dev);
+		printk(KERN_ERR "gs_set_config: cannot find endpoints\n");
+		return -ENODEV;
+	}
+
+	/* allocate and queue read requests */
+	ep = dev->dev_out_ep;
+	for (i=0; i<read_q_size && ret == 0; i++) {
+		if ((req=gs_alloc_req(ep, ep->maxpacket, GFP_ATOMIC))) {
+			req->complete = gs_read_complete;
+			if ((ret=usb_ep_queue(ep, req, GFP_ATOMIC))) {
+				printk(KERN_ERR "gs_set_config: cannot queue read request, ret=%d\n",
+					ret);
+			}
+		} else {
+			gs_reset_config(dev);
+			printk(KERN_ERR
+			"gs_set_config: cannot allocate read requests\n");
+			return -ENOMEM;
+		}
+	}
+
+	/* allocate write requests, and put on free list */
+	ep = dev->dev_in_ep;
+	for (i=0; i<write_q_size; i++) {
+		if ((req_entry=gs_alloc_req_entry(ep, ep->maxpacket, GFP_ATOMIC))) {
+			req_entry->re_req->complete = gs_write_complete;
+			list_add(&req_entry->re_entry, &dev->dev_req_list);
+		} else {
+			gs_reset_config(dev);
+			printk(KERN_ERR
+			"gs_set_config: cannot allocate write requests\n");
+			return -ENOMEM;
+		}
+	}
+
+	dev->dev_config = config;
+
+	printk(KERN_INFO "gs_set_config: %s configured for %s speed\n",
+		GS_LONG_NAME,
+		gadget->speed == USB_SPEED_HIGH ? "high" : "full");
+
+	return 0;
+}
+
+/*
+ * gs_reset_config
+ *
+ * Mark the device as not configured, disable all endpoints,
+ * which forces completion of pending I/O and frees queued
+ * requests, and free the remaining write requests on the
+ * free list.
+ *
+ * The device lock must be held when calling this function.
+ */
+static void gs_reset_config(struct gs_dev *dev)
+{
+	struct gs_req_entry *req_entry;
+
+	if (dev == NULL) {
+		printk(KERN_ERR "gs_reset_config: NULL device pointer\n");
+		return;
+	}
+
+	if (dev->dev_config == GS_NO_CONFIG_ID)
+		return;
+
+	dev->dev_config = GS_NO_CONFIG_ID;
+
+	/* free write requests on the free list */
+	while(!list_empty(&dev->dev_req_list)) {
+		req_entry = list_entry(dev->dev_req_list.next,
+			struct gs_req_entry, re_entry);
+		list_del(&req_entry->re_entry);
+		gs_free_req_entry(dev->dev_in_ep, req_entry);
+	}
+
+	/* disable endpoints, forcing completion of pending i/o; */
+	/* completion handlers free their requests in this case */
+	if (dev->dev_in_ep) {
+		usb_ep_disable(dev->dev_in_ep);
+		dev->dev_in_ep = NULL;
+	}
+	if (dev->dev_out_ep) {
+		usb_ep_disable(dev->dev_out_ep);
+		dev->dev_out_ep = NULL;
+	}
+}
+
+/*
+ * gs_build_config_desc
+ *
+ * Builds a config descriptor in the given buffer and returns the
+ * length, or a negative error number.
+ */
+static int gs_build_config_desc(u8 *buf, enum usb_device_speed speed, u8 type, unsigned int index)
+{
+	int high_speed;
+	int len = USB_DT_CONFIG_SIZE + USB_DT_INTERFACE_SIZE
+				+ GS_NUM_ENDPOINTS * USB_DT_ENDPOINT_SIZE;
+
+	/* only one config */
+	if (index != 0)
+		return -EINVAL;
+
+	memcpy(buf, &gs_config_desc, USB_DT_CONFIG_SIZE);
+	((struct usb_config_descriptor *)buf)->bDescriptorType = type;
+	((struct usb_config_descriptor *)buf)->wTotalLength = __constant_cpu_to_le16(len);
+	buf += USB_DT_CONFIG_SIZE;
+
+	memcpy(buf, &gs_interface_desc, USB_DT_INTERFACE_SIZE);
+	buf += USB_DT_INTERFACE_SIZE;
+
+	/* other speed switches high and full speed */
+	high_speed = (speed == USB_SPEED_HIGH);
+	if (type == USB_DT_OTHER_SPEED_CONFIG)
+		high_speed = !high_speed;
+
+	memcpy(buf,
+		high_speed ? &gs_highspeed_in_desc : &gs_fullspeed_in_desc,
+		USB_DT_ENDPOINT_SIZE);
+	buf += USB_DT_ENDPOINT_SIZE;
+	memcpy(buf,
+		high_speed ? &gs_highspeed_out_desc : &gs_fullspeed_out_desc,
+		USB_DT_ENDPOINT_SIZE);
+
+	return len;
+}
+
+/*
+ * gs_alloc_req
+ *
+ * Allocate a usb_request and its buffer.  Returns a pointer to the
+ * usb_request or NULL if there is an error.
+ */
+static struct usb_request *gs_alloc_req(struct usb_ep *ep, unsigned int len, int kmalloc_flags)
+{
+	struct usb_request *req;
+
+	if (ep == NULL)
+		return NULL;
+
+	req = usb_ep_alloc_request(ep, kmalloc_flags);
+
+	if (req != NULL) {
+		req->length = len;
+		req->buf = usb_ep_alloc_buffer(ep, len, &req->dma,
+			kmalloc_flags);
+		if (req->buf == NULL) {
+			usb_ep_free_request(ep, req);
+			return NULL;
+		}
+	}
+
+	return req;
+}
+
+/*
+ * gs_free_req
+ *
+ * Free a usb_request and its buffer.
+ */
+static void gs_free_req(struct usb_ep *ep, struct usb_request *req)
+{
+	if (ep != NULL && req != NULL) {
+		if (req->buf != NULL)
+			usb_ep_free_buffer(ep, req->buf, req->dma,
+				req->length);
+		usb_ep_free_request(ep, req);
+	}
+}
+
+/*
+ * gs_alloc_req_entry
+ *
+ * Allocates a request and its buffer, using the given
+ * endpoint, buffer len, and kmalloc flags.
+ */
+static struct gs_req_entry *gs_alloc_req_entry(struct usb_ep *ep, unsigned len, int kmalloc_flags)
+{
+	struct gs_req_entry	*req;
+
+	req = kmalloc(sizeof(struct gs_req_entry), kmalloc_flags);
+	if (req == NULL)
+		return NULL;
+
+	req->re_req = gs_alloc_req(ep, len, kmalloc_flags);
+	if (req->re_req == NULL) {
+		kfree(req);
+		return NULL;
+	}
+
+	req->re_req->context = req;
+
+	return req;
+}
+
+/*
+ * gs_free_req_entry
+ *
+ * Frees a request and its buffer.
+ */
+static void gs_free_req_entry(struct usb_ep *ep, struct gs_req_entry *req)
+{
+	if (ep != NULL && req != NULL) {
+		if (req->re_req != NULL)
+			gs_free_req(ep, req->re_req);
+		kfree(req);
+	}
+}
+
+/*
+ * gs_alloc_ports
+ *
+ * Allocate all ports and set the gs_dev struct to point to them.
+ * Return 0 if successful, or a negative error number.
+ *
+ * The device lock is normally held when calling this function.
+ */
+static int gs_alloc_ports(struct gs_dev *dev, int kmalloc_flags)
+{
+	int i;
+	struct gs_port *port;
+
+	if (dev == NULL)
+		return -EIO;
+
+	for (i=0; i<GS_NUM_PORTS; i++) {
+		if ((port=(struct gs_port *)kmalloc(sizeof(struct gs_port), kmalloc_flags)) == NULL)
+			return -ENOMEM;
+
+		memset(port, 0, sizeof(struct gs_port));
+		port->port_dev = dev;
+		port->port_num = i;
+		spin_lock_init(&port->port_lock);
+		init_waitqueue_head(&port->port_write_wait);
+
+		dev->dev_port[i] = port;
+	}
+
+	return 0;
+}
+
+/*
+ * gs_free_ports
+ *
+ * Free all closed ports.  Open ports are disconnected by
+ * freeing their write buffers, setting their device pointers
+ * and the pointers to them in the device to NULL.  These
+ * ports will be freed when closed.
+ *
+ * The device lock is normally held when calling this function.
+ */
+static void gs_free_ports(struct gs_dev *dev)
+{
+	int i;
+	unsigned long flags;
+	struct gs_port *port;
+
+	if (dev == NULL)
+		return;
+
+	for (i=0; i<GS_NUM_PORTS; i++) {
+		if ((port=dev->dev_port[i]) != NULL) {
+			dev->dev_port[i] = NULL;
+
+			spin_lock_irqsave(&port->port_lock, flags);
+
+			if (port->port_write_buf != NULL) {
+				gs_buf_free(port->port_write_buf);
+				port->port_write_buf = NULL;
+			}
+
+			if (port->port_open_count > 0 || port->port_in_use) {
+				port->port_dev = NULL;
+				wake_up_interruptible(&port->port_write_wait);
+				wake_up_interruptible(&port->port_tty->read_wait);
+				wake_up_interruptible(&port->port_tty->write_wait);
+			} else {
+				kfree(port);
+			}
+
+			spin_unlock_irqrestore(&port->port_lock, flags);
+		}
+	}
+}
+
+/* Circular Buffer */
+
+/*
+ * gs_buf_alloc
+ *
+ * Allocate a circular buffer and all associated memory.
+ */
+static struct gs_buf *gs_buf_alloc(unsigned int size, int kmalloc_flags)
+{
+	struct gs_buf *gb;
+
+	if (size == 0)
+		return NULL;
+
+	gb = (struct gs_buf *)kmalloc(sizeof(struct gs_buf), kmalloc_flags);
+	if (gb == NULL)
+		return NULL;
+
+	gb->buf_buf = kmalloc(size, kmalloc_flags);
+	if (gb->buf_buf == NULL) {
+		kfree(gb);
+		return NULL;
+	}
+
+	gb->buf_size = size;
+	gb->buf_get = gb->buf_put = gb->buf_buf;
+
+	return gb;
+}
+
+/*
+ * gs_buf_free
+ *
+ * Free the buffer and all associated memory.
+ */
+void gs_buf_free(struct gs_buf *gb)
+{
+	if (gb != NULL) {
+		if (gb->buf_buf != NULL)
+			kfree(gb->buf_buf);
+		kfree(gb);
+	}
+}
+
+/*
+ * gs_buf_clear
+ *
+ * Clear out all data in the circular buffer.
+ */
+void gs_buf_clear(struct gs_buf *gb)
+{
+	if (gb != NULL)
+		gb->buf_get = gb->buf_put;
+		/* equivalent to a get of all data available */
+}
+
+/*
+ * gs_buf_data_avail
+ *
+ * Return the number of bytes of data available in the circular
+ * buffer.
+ */
+unsigned int gs_buf_data_avail(struct gs_buf *gb)
+{
+	if (gb != NULL)
+		return (gb->buf_size + gb->buf_put - gb->buf_get) % gb->buf_size;
+	else
+		return 0;
+}
+
+/*
+ * gs_buf_space_avail
+ *
+ * Return the number of bytes of space available in the circular
+ * buffer.
+ */
+unsigned int gs_buf_space_avail(struct gs_buf *gb)
+{
+	if (gb != NULL)
+		return (gb->buf_size + gb->buf_get - gb->buf_put - 1) % gb->buf_size;
+	else
+		return 0;
+}
+
+/*
+ * gs_buf_put
+ *
+ * Copy data data from a user buffer and put it into the circular buffer.
+ * Restrict to the amount of space available.
+ *
+ * Return the number of bytes copied.
+ */
+unsigned int gs_buf_put(struct gs_buf *gb, const char *buf, unsigned int count)
+{
+	unsigned int len;
+
+	if (gb == NULL)
+		return 0;
+
+	len  = gs_buf_space_avail(gb);
+	if (count > len)
+		count = len;
+
+	if (count == 0)
+		return 0;
+
+	len = gb->buf_buf + gb->buf_size - gb->buf_put;
+	if (count > len) {
+		memcpy(gb->buf_put, buf, len);
+		memcpy(gb->buf_buf, buf+len, count - len);
+		gb->buf_put = gb->buf_buf + count - len;
+	} else {
+		memcpy(gb->buf_put, buf, count);
+		if (count < len)
+			gb->buf_put += count;
+		else /* count == len */
+			gb->buf_put = gb->buf_buf;
+	}
+
+	return count;
+}
+
+/*
+ * gs_buf_get
+ *
+ * Get data from the circular buffer and copy to the given buffer.
+ * Restrict to the amount of data available.
+ *
+ * Return the number of bytes copied.
+ */
+unsigned int gs_buf_get(struct gs_buf *gb, char *buf, unsigned int count)
+{
+	unsigned int len;
+
+	if (gb == NULL)
+		return 0;
+
+	len = gs_buf_data_avail(gb);
+	if (count > len)
+		count = len;
+
+	if (count == 0)
+		return 0;
+
+	len = gb->buf_buf + gb->buf_size - gb->buf_get;
+	if (count > len) {
+		memcpy(buf, gb->buf_get, len);
+		memcpy(buf+len, gb->buf_buf, count - len);
+		gb->buf_get = gb->buf_buf + count - len;
+	} else {
+		memcpy(buf, gb->buf_get, count);
+		if (count < len)
+			gb->buf_get += count;
+		else /* count == len */
+			gb->buf_get = gb->buf_buf;
+	}
+
+	return count;
+}
diff -Nru a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c
--- a/drivers/usb/gadget/zero.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/gadget/zero.c	Tue Feb  3 19:45:17 2004
@@ -131,7 +131,7 @@
  * DMA channels to manage their FIFOs.  It supports high speed.
  * Those endpoints can be arranged in any desired configuration.
  */
-#ifdef	CONFIG_USB_ZERO_NET2280
+#if defined(CONFIG_USB_GADGET_NET2280) || defined(CONFIG_USB_GADGET_DUMMY_HCD)
 #define CHIP			"net2280"
 #define DRIVER_VERSION_NUM	0x0101
 static const char EP_OUT_NAME [] = "ep-a";
@@ -154,7 +154,7 @@
  * can't use altsettings or reset the interfaces independently.
  * So stick to a single interface.
  */
-#ifdef	CONFIG_USB_ZERO_PXA2XX
+#ifdef	CONFIG_USB_GADGET_PXA2XX
 #define CHIP			"pxa2xx"
 #define DRIVER_VERSION_NUM	0x0103
 static const char EP_OUT_NAME [] = "ep12out-bulk";
@@ -176,7 +176,7 @@
  * in special situations.  So this is a case of "choose it right
  * during enumeration" ...
  */
-#ifdef	CONFIG_USB_ZERO_SA1100
+#ifdef	CONFIG_USB_GADGET_SA1100
 #define CHIP			"sa1100"
 #define DRIVER_VERSION_NUM	0x0105
 static const char EP_OUT_NAME [] = "ep1out-bulk";
@@ -192,7 +192,7 @@
  *
  * This has three semi-configurable full speed bulk/interrupt endpoints.
  */
-#ifdef	CONFIG_USB_ZERO_GOKU
+#ifdef	CONFIG_USB_GADGET_GOKU
 #define CHIP			"goku"
 #define DRIVER_VERSION_NUM	0x0106
 static const char EP_OUT_NAME [] = "ep1-bulk";
@@ -936,7 +936,7 @@
 	if (number == dev->config)
 		return 0;
 
-#ifdef CONFIG_USB_ZERO_SA1100
+#ifdef CONFIG_USB_GADGET_SA1100
 	if (dev->config) {
 		/* tx fifo is full, but we can't clear it...*/
 		INFO (dev, "can't change configurations\n");
diff -Nru a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
--- a/drivers/usb/host/ehci-dbg.c	Tue Feb  3 19:45:40 2004
+++ b/drivers/usb/host/ehci-dbg.c	Tue Feb  3 19:45:40 2004
@@ -63,6 +63,7 @@
 
 		buf[0] = 0;
 		for (i = 0; i < HCS_N_PORTS (params); i++) {
+			// FIXME MIPS won't readb() ...
 			byte = readb (&ehci->caps->portroute[(i>>1)]);
 			sprintf(tmp, "%d ", 
 				((i & 0x1) ? ((byte)&0xf) : ((byte>>4)&0xf)));
@@ -115,7 +116,7 @@
 #ifdef	DEBUG
 
 static void __attribute__((__unused__))
-dbg_qtd (char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd)
+dbg_qtd (const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd)
 {
 	ehci_dbg (ehci, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd,
 		cpu_to_le32p (&qtd->hw_next),
@@ -131,7 +132,7 @@
 }
 
 static void __attribute__((__unused__))
-dbg_qh (char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
+dbg_qh (const char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
 {
 	ehci_dbg (ehci, "%s qh %p n%08x info %x %x qtd %x\n", label,
 		qh, qh->hw_next, qh->hw_info1, qh->hw_info2,
@@ -139,6 +140,36 @@
 	dbg_qtd ("overlay", ehci, (struct ehci_qtd *) &qh->hw_qtd_next);
 }
 
+static void __attribute__((__unused__))
+dbg_itd (const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd) 
+{
+	ehci_dbg (ehci, "%s [%d] itd %p, next %08x, urb %p\n",
+		label, itd->frame, itd, le32_to_cpu(itd->hw_next), itd->urb);
+	ehci_dbg (ehci,
+		"  trans: %08x %08x %08x %08x %08x %08x %08x %08x\n", 
+		le32_to_cpu(itd->hw_transaction[0]),
+		le32_to_cpu(itd->hw_transaction[1]),
+		le32_to_cpu(itd->hw_transaction[2]),
+		le32_to_cpu(itd->hw_transaction[3]),
+		le32_to_cpu(itd->hw_transaction[4]),
+		le32_to_cpu(itd->hw_transaction[5]),
+		le32_to_cpu(itd->hw_transaction[6]),
+		le32_to_cpu(itd->hw_transaction[7]));
+	ehci_dbg (ehci,
+		"  buf:   %08x %08x %08x %08x %08x %08x %08x\n", 
+		le32_to_cpu(itd->hw_bufp[0]),
+		le32_to_cpu(itd->hw_bufp[1]),
+		le32_to_cpu(itd->hw_bufp[2]),
+		le32_to_cpu(itd->hw_bufp[3]),
+		le32_to_cpu(itd->hw_bufp[4]),
+		le32_to_cpu(itd->hw_bufp[5]),
+		le32_to_cpu(itd->hw_bufp[6]));
+	ehci_dbg (ehci, "  index: %d %d %d %d %d %d %d %d\n",
+		itd->index[0], itd->index[1], itd->index[2],
+		itd->index[3], itd->index[4], itd->index[5],
+		itd->index[6], itd->index[7]);
+}
+
 static int __attribute__((__unused__))
 dbg_status_buf (char *buf, unsigned len, char *label, u32 status)
 {
@@ -591,7 +622,7 @@
 	spin_lock_irqsave (&ehci->lock, flags);
 
 	/* Capability Registers */
-	i = readw (&ehci->caps->hci_version);
+	i = HC_VERSION(readl (&ehci->caps->hc_capbase));
 	temp = snprintf (next, size,
 		"PCI device %s\nEHCI %x.%02x, hcd state %d (driver " DRIVER_VERSION ")\n",
 		pci_name(hcd->pdev),
diff -Nru a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
--- a/drivers/usb/host/ehci-hcd.c	Tue Feb  3 19:45:33 2004
+++ b/drivers/usb/host/ehci-hcd.c	Tue Feb  3 19:45:33 2004
@@ -67,6 +67,9 @@
  *
  * HISTORY:
  *
+ * 2003-12-29 Rewritten high speed iso transfer support (by Michal Sojka,
+ *	<sojkam@centrum.cz>, updates by DB).
+ *
  * 2002-11-29	Correct handling for hw async_next register.
  * 2002-08-06	Handling for bulk and interrupt transfers is mostly shared;
  *	only scheduling is different, no arbitrary limitations.
@@ -90,14 +93,16 @@
  * 2001-June	Works with usb-storage and NEC EHCI on 2.4
  */
 
-#define DRIVER_VERSION "2003-Jun-13"
+#define DRIVER_VERSION "2003-Dec-29"
 #define DRIVER_AUTHOR "David Brownell"
 #define DRIVER_DESC "USB 2.0 'Enhanced' Host Controller (EHCI) Driver"
 
 static const char	hcd_name [] = "ehci_hcd";
 
 
-// #define EHCI_VERBOSE_DEBUG
+#undef EHCI_VERBOSE_DEBUG
+#undef EHCI_URB_TRACE
+
 // #define have_split_iso
 
 #ifdef DEBUG
@@ -324,8 +329,8 @@
 	spin_lock_init (&ehci->lock);
 
 	ehci->caps = (struct ehci_caps *) hcd->regs;
-	ehci->regs = (struct ehci_regs *) (hcd->regs +
-				readb (&ehci->caps->length));
+	ehci->regs = (struct ehci_regs *) (hcd->regs + 
+				HC_LENGTH (readl (&ehci->caps->hc_capbase)));
 	dbg_hcs_params (ehci, "reset");
 	dbg_hcc_params (ehci, "reset");
 
@@ -489,7 +494,7 @@
 
         /* PCI Serial Bus Release Number is at 0x60 offset */
 	pci_read_config_byte (hcd->pdev, 0x60, &tempbyte);
-	temp = readw (&ehci->caps->hci_version);
+	temp = HC_VERSION(readl (&ehci->caps->hc_capbase));
 	ehci_info (ehci,
 		"USB %x.%x enabled, EHCI %x.%02x, driver %s\n",
 		((tempbyte & 0xf0)>>4), (tempbyte & 0x0f),
@@ -899,10 +904,19 @@
 	if (!qh)
 		goto done;
 
+	/* endpoints can be iso streams.  for now, we don't
+	 * accelerate iso completions ... so spin a while.
+	 */
+	if (qh->hw_info1 == 0) {
+		ehci_vdbg (ehci, "iso delay\n");
+		goto idle_timeout;
+	}
+
 	if (!HCD_IS_RUNNING (ehci->hcd.state))
 		qh->qh_state = QH_STATE_IDLE;
 	switch (qh->qh_state) {
 	case QH_STATE_UNLINK:		/* wait for hw to finish? */
+idle_timeout:
 		spin_unlock_irqrestore (&ehci->lock, flags);
 		set_current_state (TASK_UNINTERRUPTIBLE);
 		schedule_timeout (1);
diff -Nru a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
--- a/drivers/usb/host/ehci-hub.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/usb/host/ehci-hub.c	Tue Feb  3 19:45:42 2004
@@ -113,7 +113,7 @@
 	u16		temp;
 
 	desc->bDescriptorType = 0x29;
-	desc->bPwrOn2PwrGood = 0;	/* FIXME: f(system power) */
+	desc->bPwrOn2PwrGood = 10;	/* FIXME: f(system power) */
 	desc->bHubContrCurrent = 0;
 
 	desc->bNbrPorts = ports;
diff -Nru a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c
--- a/drivers/usb/host/ehci-mem.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/usb/host/ehci-mem.c	Tue Feb  3 19:45:42 2004
@@ -28,7 +28,7 @@
  *	- driver buffers, read/written by HC ... single shot DMA mapped 
  *
  * There's also PCI "register" data, which is memory mapped.
- * No memory seen by this driver is pagable.
+ * No memory seen by this driver is pageable.
  */
 
 /*-------------------------------------------------------------------------*/
@@ -131,6 +131,7 @@
 	}
 	if (qh->dummy)
 		ehci_qtd_free (ehci, qh->dummy);
+	usb_put_dev (qh->dev);
 	pci_pool_free (ehci->qh_pool, qh, qh->qh_dma);
 }
 
diff -Nru a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
--- a/drivers/usb/host/ehci-q.c	Tue Feb  3 19:45:40 2004
+++ b/drivers/usb/host/ehci-q.c	Tue Feb  3 19:45:40 2004
@@ -164,7 +164,8 @@
 
 		/* if async CSPLIT failed, try cleaning out the TT buffer */
 		} else if (urb->dev->tt && !usb_pipeint (urb->pipe)
-				&& QTD_CERR(token) == 0) {
+				&& ((token & QTD_STS_MMF) != 0
+					|| QTD_CERR(token) == 0)) {
 #ifdef DEBUG
 			struct usb_device *tt = urb->dev->tt->hub;
 			dev_dbg (&tt->dev,
@@ -212,6 +213,16 @@
 	}
 	spin_unlock (&urb->lock);
 
+#ifdef EHCI_URB_TRACE
+	ehci_dbg (ehci,
+		"%s %s urb %p ep%d%s status %d len %d/%d\n",
+		__FUNCTION__, urb->dev->devpath, urb,
+		usb_pipeendpoint (urb->pipe),
+		usb_pipein (urb->pipe) ? "in" : "out",
+		urb->status,
+		urb->actual_length, urb->transfer_buffer_length);
+#endif
+
 	/* complete() can reenter this HCD */
 	spin_unlock (&ehci->lock);
 	usb_hcd_giveback_urb (&ehci->hcd, urb, regs);
@@ -640,6 +651,9 @@
 
 			qh->period = urb->interval;
 		}
+
+		/* support for tt scheduling */
+		qh->dev = usb_get_dev (urb->dev);
 	}
 
 	/* using TT? */
@@ -699,8 +713,6 @@
 	usb_settoggle (urb->dev, usb_pipeendpoint (urb->pipe), !is_input, 1);
 	return qh;
 }
-#undef hb_mult
-#undef hb_packet
 
 /*-------------------------------------------------------------------------*/
 
@@ -887,10 +899,14 @@
 	if (usb_pipein (urb->pipe) && !usb_pipecontrol (urb->pipe))
 		epnum |= 0x10;
 
-	ehci_vdbg (ehci, "submit_async urb %p len %d ep%d%s qtd %p [qh %p]\n",
-		urb, urb->transfer_buffer_length,
-		epnum & 0x0f, (epnum & 0x10) ? "in" : "out",
+#ifdef EHCI_URB_TRACE
+	ehci_dbg (ehci,
+		"%s %s urb %p ep%d%s len %d, qtd %p [qh %p]\n",
+		__FUNCTION__, urb->dev->devpath, urb,
+		epnum & 0x0f, usb_pipein (urb->pipe) ? "in" : "out",
+		urb->transfer_buffer_length,
 		qtd, dev ? dev->ep [epnum] : (void *)~0);
+#endif
 
 	spin_lock_irqsave (&ehci->lock, flags);
 	qh = qh_append_tds (ehci, urb, qtd_list, epnum, &dev->ep [epnum]);
diff -Nru a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
--- a/drivers/usb/host/ehci-sched.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/host/ehci-sched.c	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2001-2002 by David Brownell
+ * Copyright (c) 2001-2003 by David Brownell
+ * Copyright (c) 2003 Michal Sojka, for high-speed iso transfers
  * 
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -27,10 +28,10 @@
  * Note that for interrupt transfers, the QH/QTD manipulation is shared
  * with the "asynchronous" transaction support (control/bulk transfers).
  * The only real difference is in how interrupt transfers are scheduled.
- * We get some funky API restrictions from the current URB model, which
- * works notably better for reading transfers than for writing.  (And
- * which accordingly needs to change before it'll work inside devices,
- * or with "USB On The Go" additions to USB 2.0 ...)
+ *
+ * For ISO, we make an "iso_stream" head to serve the same role as a QH.
+ * It keeps track of every ITD (or SITD) that's linked, and holds enough
+ * pre-calculated schedule data to make appending to the queue be quick.
  */
 
 static int ehci_get_frame (struct usb_hcd *hcd);
@@ -126,9 +127,7 @@
 			q = &q->fstn->fstn_next;
 			break;
 		case Q_TYPE_ITD:
-			/* NOTE the "one uframe per itd" policy */
-			if (q->itd->hw_transaction [uframe] != 0)
-				usecs += q->itd->usecs;
+			usecs += q->itd->usecs [uframe];
 			q = &q->itd->itd_next;
 			break;
 #ifdef have_split_iso
@@ -520,417 +519,646 @@
 
 /*-------------------------------------------------------------------------*/
 
-static void
-itd_free_list (struct ehci_hcd *ehci, struct urb *urb)
+static inline struct ehci_iso_stream *
+iso_stream_alloc (int mem_flags)
 {
-	struct ehci_itd *first_itd = urb->hcpriv;
+	struct ehci_iso_stream *stream;
 
-	while (!list_empty (&first_itd->itd_list)) {
-		struct ehci_itd	*itd;
-
-		itd = list_entry (
-			first_itd->itd_list.next,
-			struct ehci_itd, itd_list);
-		list_del (&itd->itd_list);
-		pci_pool_free (ehci->itd_pool, itd, itd->itd_dma);
+	stream = kmalloc(sizeof *stream, mem_flags);
+	if (likely (stream != 0)) {
+		memset (stream, 0, sizeof(*stream));
+		INIT_LIST_HEAD(&stream->itd_list);
+		INIT_LIST_HEAD(&stream->free_itd_list);
+		stream->next_uframe = -1;
+		stream->refcount = 1;
 	}
-	pci_pool_free (ehci->itd_pool, first_itd, first_itd->itd_dma);
-	urb->hcpriv = 0;
+	return stream;
 }
 
-static int
-itd_fill (
-	struct ehci_hcd	*ehci,
-	struct ehci_itd	*itd,
-	struct urb	*urb,
-	unsigned	index,		// urb->iso_frame_desc [index]
-	dma_addr_t	dma		// mapped transfer buffer
-) {
-	u64		temp;
-	u32		buf1;
-	unsigned	i, epnum, maxp, multi;
-	unsigned	length;
-	int		is_input;
-
-	itd->hw_next = EHCI_LIST_END;
-	itd->urb = urb;
-	itd->index = index;
-
-	/* tell itd about its transfer buffer, max 2 pages */
-	length = urb->iso_frame_desc [index].length;
-	dma += urb->iso_frame_desc [index].offset;
-	temp = dma & ~0x0fff;
-	for (i = 0; i < 2; i++) {
-		itd->hw_bufp [i] = cpu_to_le32 ((u32) temp);
-		itd->hw_bufp_hi [i] = cpu_to_le32 ((u32)(temp >> 32));
-		temp += 0x1000;
-	}
-	itd->buf_dma = dma;
+static inline void
+iso_stream_init (
+	struct ehci_iso_stream	*stream,
+	struct usb_device	*dev,
+	int			pipe,
+	unsigned		interval
+)
+{
+	u32			buf1;
+	unsigned		epnum, maxp, multi;
+	int			is_input;
+	long			bandwidth;
 
 	/*
 	 * this might be a "high bandwidth" highspeed endpoint,
-	 * as encoded in the ep descriptor's maxpacket field
+	 * as encoded in the ep descriptor's wMaxPacket field
 	 */
-	epnum = usb_pipeendpoint (urb->pipe);
-	is_input = usb_pipein (urb->pipe);
+	epnum = usb_pipeendpoint (pipe);
+	is_input = usb_pipein (pipe) ? USB_DIR_IN : 0;
 	if (is_input) {
-		maxp = urb->dev->epmaxpacketin [epnum];
+		maxp = dev->epmaxpacketin [epnum];
 		buf1 = (1 << 11);
 	} else {
-		maxp = urb->dev->epmaxpacketout [epnum];
+		maxp = dev->epmaxpacketout [epnum];
 		buf1 = 0;
 	}
-	buf1 |= (maxp & 0x03ff);
-	multi = 1;
-	multi += (maxp >> 11) & 0x03;
-	maxp &= 0x03ff;
+
+	multi = hb_mult(maxp);
+	maxp = max_packet(maxp);
+	buf1 |= maxp;
 	maxp *= multi;
 
-	/* transfer can't fit in any uframe? */ 
-	if (length < 0 || maxp < length) {
-		dbg ("BAD iso packet: %d bytes, max %d, urb %p [%d] (of %d)",
-			length, maxp, urb, index,
-			urb->iso_frame_desc [index].length);
-		return -ENOSPC;
-	}
-	itd->usecs = usb_calc_bus_time (USB_SPEED_HIGH, is_input, 1, length);
-
-	/* "plus" info in low order bits of buffer pointers */
-	itd->hw_bufp [0] |= cpu_to_le32 ((epnum << 8) | urb->dev->devnum);
-	itd->hw_bufp [1] |= cpu_to_le32 (buf1);
-	itd->hw_bufp [2] |= cpu_to_le32 (multi);
-
-	/* figure hw_transaction[] value (it's scheduled later) */
-	itd->transaction = EHCI_ISOC_ACTIVE;
-	itd->transaction |= dma & 0x0fff;		/* offset; buffer=0 */
-	if ((index + 1) == urb->number_of_packets)
-		itd->transaction |= EHCI_ITD_IOC; 	/* end-of-urb irq */
-	itd->transaction |= length << 16;
-	cpu_to_le32s (&itd->transaction);
+	stream->dev = (struct hcd_dev *)dev->hcpriv;
+
+	stream->bEndpointAddress = is_input | epnum;
+	stream->interval = interval;
+	stream->maxp = maxp;
+
+	stream->buf0 = cpu_to_le32 ((epnum << 8) | dev->devnum);
+	stream->buf1 = cpu_to_le32 (buf1);
+	stream->buf2 = cpu_to_le32 (multi);
+
+	/* usbfs wants to report the average usecs per frame tied up
+	 * when transfers on this endpoint are scheduled ...
+	 */
+	stream->usecs = HS_USECS_ISO (maxp);
+	bandwidth = stream->usecs * 8;
+	bandwidth /= 1 << (interval - 1);
+	stream->bandwidth = bandwidth;
+}
+
+static void
+iso_stream_put(struct ehci_hcd *ehci, struct ehci_iso_stream *stream)
+{
+	stream->refcount--;
+
+	/* free whenever just a dev->ep reference remains.
+	 * not like a QH -- no persistent state (toggle, halt)
+	 */
+	if (stream->refcount == 1) {
+		int is_in;
+
+		// BUG_ON (!list_empty(&stream->itd_list));
+
+		while (!list_empty (&stream->free_itd_list)) {
+			struct ehci_itd	*itd;
+
+			itd = list_entry (stream->free_itd_list.next,
+				struct ehci_itd, itd_list);
+			list_del (&itd->itd_list);
+			pci_pool_free (ehci->itd_pool, itd, itd->itd_dma);
+		}
+
+		is_in = (stream->bEndpointAddress & USB_DIR_IN) ? 0x10 : 0;
+		stream->bEndpointAddress &= 0x0f;
+		stream->dev->ep [is_in + stream->bEndpointAddress] = 0;
+
+		if (stream->rescheduled) {
+			ehci_info (ehci, "ep%d%s-iso rescheduled "
+				"%lu times in %lu seconds\n",
+				stream->bEndpointAddress, is_in ? "in" : "out",
+				stream->rescheduled,
+				((jiffies - stream->start)/HZ)
+				);
+		}
+
+		kfree(stream);
+	}
+}
+
+static inline struct ehci_iso_stream *
+iso_stream_get (struct ehci_iso_stream *stream)
+{
+	if (likely (stream != 0))
+		stream->refcount++;
+	return stream;
+}
+
+static struct ehci_iso_stream *
+iso_stream_find (struct ehci_hcd *ehci, struct urb *urb)
+{
+	unsigned		epnum;
+	struct hcd_dev		*dev;
+	struct ehci_iso_stream	*stream;
+	unsigned long		flags;
+
+	epnum = usb_pipeendpoint (urb->pipe);
+	if (usb_pipein(urb->pipe))
+		epnum += 0x10;
+
+	spin_lock_irqsave (&ehci->lock, flags);
+
+	dev = (struct hcd_dev *)urb->dev->hcpriv;
+	stream = dev->ep [epnum];
+
+	if (unlikely (stream == 0)) {
+		stream = iso_stream_alloc(GFP_ATOMIC);
+		if (likely (stream != 0)) {
+			/* dev->ep owns the initial refcount */
+			dev->ep[epnum] = stream;
+			iso_stream_init(stream, urb->dev, urb->pipe,
+					urb->interval);
+		}
+
+	/* if dev->ep [epnum] is a QH, info1.maxpacket is nonzero */
+	} else if (unlikely (stream->hw_info1 != 0)) {
+		ehci_dbg (ehci, "dev %s ep%d%s, not iso??\n",
+			urb->dev->devpath, epnum & 0x0f,
+			(epnum & 0x10) ? "in" : "out");
+		stream = 0;
+	}
+
+	/* caller guarantees an eventual matching iso_stream_put */
+	stream = iso_stream_get (stream);
+
+	spin_unlock_irqrestore (&ehci->lock, flags);
+	return stream;
+}
+
+/*-------------------------------------------------------------------------*/
 
+static inline struct ehci_itd_sched *
+itd_sched_alloc (unsigned packets, int mem_flags)
+{
+	struct ehci_itd_sched	*itd_sched;
+	int			size = sizeof *itd_sched;
+
+	size += packets * sizeof (struct ehci_iso_uframe);
+	itd_sched = kmalloc (size, mem_flags);
+	if (likely (itd_sched != 0)) {
+		memset(itd_sched, 0, size);
+		INIT_LIST_HEAD (&itd_sched->itd_list);
+	}
+	return itd_sched;
+}
+
+static int
+itd_sched_init (
+	struct ehci_itd_sched	*itd_sched,
+	struct ehci_iso_stream	*stream,
+	struct urb		*urb
+)
+{
+	unsigned	i;
+	dma_addr_t	dma = urb->transfer_dma;
+
+	/* how many uframes are needed for these transfers */
+	itd_sched->span = urb->number_of_packets * stream->interval;
+
+	/* figure out per-uframe itd fields that we'll need later
+	 * when we fit new itds into the schedule.
+	 */
+	for (i = 0; i < urb->number_of_packets; i++) {
+		struct ehci_iso_uframe	*uframe = &itd_sched->packet [i];
+		unsigned		length;
+		dma_addr_t		buf;
+		u32			trans;
+
+		length = urb->iso_frame_desc [i].length;
+		buf = dma + urb->iso_frame_desc [i].offset;
+
+		trans = EHCI_ISOC_ACTIVE;
+		trans |= buf & 0x0fff;
+		if (unlikely ((i + 1) == urb->number_of_packets))
+			trans |= EHCI_ITD_IOC;
+		trans |= length << 16;
+		uframe->transaction = cpu_to_le32 (trans);
+
+		/* might need to cross a buffer page within a td */
+		uframe->bufp = (buf & ~(u64)0x0fff);
+		buf += length;
+		if (unlikely ((uframe->bufp != (buf & ~(u64)0x0fff))))
+			uframe->cross = 1;
+	}
 	return 0;
 }
 
+static void
+itd_sched_free (
+	struct ehci_iso_stream	*stream,
+	struct ehci_itd_sched	*itd_sched
+)
+{
+	list_splice (&itd_sched->itd_list, &stream->free_itd_list);
+	kfree (itd_sched);
+}
+
 static int
 itd_urb_transaction (
+	struct ehci_iso_stream	*stream,
 	struct ehci_hcd		*ehci,
 	struct urb		*urb,
 	int			mem_flags
-) {
-	int			frame_index;
-	struct ehci_itd		*first_itd, *itd;
+)
+{
+	struct ehci_itd		*itd;
 	int			status;
 	dma_addr_t		itd_dma;
+	int			i;
+	unsigned		num_itds;
+	struct ehci_itd_sched	*itd_sched;
+
+	itd_sched = itd_sched_alloc (urb->number_of_packets, mem_flags);
+	if (unlikely (itd_sched == 0))
+		return -ENOMEM;
+
+	status = itd_sched_init (itd_sched, stream, urb);
+	if (unlikely (status != 0))  {
+		itd_sched_free (stream, itd_sched);
+		return status;
+	}
+
+	if (urb->interval < 8)
+		num_itds = 1 + (itd_sched->span + 7) / 8;
+	else
+		num_itds = urb->number_of_packets;
 
 	/* allocate/init ITDs */
-	for (frame_index = 0, first_itd = 0;
-			frame_index < urb->number_of_packets;
-			frame_index++) {
-		itd = pci_pool_alloc (ehci->itd_pool, mem_flags, &itd_dma);
-		if (!itd) {
-			status = -ENOMEM;
-			goto fail;
+	for (i = 0; i < num_itds; i++) {
+
+		/* free_itd_list.next might be cache-hot ... but maybe
+		 * the HC caches it too. avoid that issue for now.
+		 */
+
+		/* prefer previously-allocated itds */
+		if (likely (!list_empty(&stream->free_itd_list))) {
+			itd = list_entry (stream->free_itd_list.prev,
+					 struct ehci_itd, itd_list);
+			list_del (&itd->itd_list);
+			itd_dma = itd->itd_dma;
+		} else
+			itd = pci_pool_alloc (ehci->itd_pool, mem_flags,
+					&itd_dma);
+
+		if (unlikely (0 == itd)) {
+			itd_sched_free (stream, itd_sched);
+			return -ENOMEM;
 		}
 		memset (itd, 0, sizeof *itd);
 		itd->itd_dma = itd_dma;
-
-		status = itd_fill (ehci, itd, urb, frame_index,
-				urb->transfer_dma);
-		if (status != 0)
-			goto fail;
-
-		if (first_itd)
-			list_add_tail (&itd->itd_list,
-					&first_itd->itd_list);
-		else {
-			INIT_LIST_HEAD (&itd->itd_list);
-			urb->hcpriv = first_itd = itd;
-		}
+		list_add (&itd->itd_list, &itd_sched->itd_list);
 	}
+
+	/* temporarily store schedule info in hcpriv */
+	urb->hcpriv = itd_sched;
 	urb->error_count = 0;
 	return 0;
-
-fail:
-	if (urb->hcpriv)
-		itd_free_list (ehci, urb);
-	return status;
-}
-
-/*-------------------------------------------------------------------------*/
-
-static inline void
-itd_link (struct ehci_hcd *ehci, unsigned frame, struct ehci_itd *itd)
-{
-	/* always prepend ITD/SITD ... only QH tree is order-sensitive */
-	itd->itd_next = ehci->pshadow [frame];
-	itd->hw_next = ehci->periodic [frame];
-	ehci->pshadow [frame].itd = itd;
-	ehci->periodic [frame] = cpu_to_le32 (itd->itd_dma) | Q_TYPE_ITD;
 }
 
 /*
- * return zero on success, else -errno
- * - start holds first uframe to start scheduling into
- * - max is the first uframe it's NOT (!) OK to start scheduling into
- * math to be done modulo "mod" (ehci->periodic_size << 3)
+ * This scheduler plans almost as far into the future as it has actual
+ * periodic schedule slots.  (Affected by TUNE_FLS, which defaults to
+ * "as small as possible" to be cache-friendlier.)  That limits the size
+ * transfers you can stream reliably; avoid more than 64 msec per urb.
+ * Also avoid queue depths of less than the system's worst irq latency.
  */
-static int get_iso_range (
+
+#define SCHEDULE_SLOP	10	/* frames */
+
+static int
+itd_stream_schedule (
 	struct ehci_hcd		*ehci,
 	struct urb		*urb,
-	unsigned		*start,
-	unsigned		*max,
-	unsigned		mod
-) {
-	struct list_head	*lh;
-	struct hcd_dev		*dev = urb->dev->hcpriv;
-	int			last = -1;
-	unsigned		now, span, end;
-
-	span = urb->interval * urb->number_of_packets;
-
-	/* first see if we know when the next transfer SHOULD happen */
-	list_for_each (lh, &dev->urb_list) {
-		struct urb	*u;
-		struct ehci_itd	*itd;
-		unsigned	s;
+	struct ehci_iso_stream	*stream
+)
+{
+	u32			now, start, end, max;
+	int			status;
+	unsigned		mod = ehci->periodic_size << 3;
+	struct ehci_itd_sched	*itd_sched = urb->hcpriv;
 
-		u = list_entry (lh, struct urb, urb_list);
-		if (u == urb || u->pipe != urb->pipe)
-			continue;
-		if (u->interval != urb->interval) {	/* must not change! */ 
-			dbg ("urb %p interval %d ... != %p interval %d",
-				u, u->interval, urb, urb->interval);
-			return -EINVAL;
-		}
-		
-		/* URB for this endpoint... covers through when?  */
-		itd = urb->hcpriv;
-		s = itd->uframe + u->interval * u->number_of_packets;
-		if (last < 0)
-			last = s;
-		else {
-			/*
-			 * So far we can only queue two ISO URBs...
-			 *
-			 * FIXME do interval math, figure out whether
-			 * this URB is "before" or not ... also, handle
-			 * the case where the URB might have completed,
-			 * but hasn't yet been processed.
-			 */
-			dbg ("NYET: queue >2 URBs per ISO endpoint");
-			return -EDOM;
-		}
+	if (unlikely (itd_sched->span > (mod - 8 * SCHEDULE_SLOP))) {
+		ehci_dbg (ehci, "iso request %p too long\n", urb);
+		status = -EFBIG;
+		goto fail;
 	}
 
-	/* calculate the legal range [start,max) */
-	now = readl (&ehci->regs->frame_index) + 1;	/* next uframe */
-	if (!ehci->periodic_sched)
-		now += 8;				/* startup delay */
-	now %= mod;
-	end = now + mod;
-	if (last < 0) {
-		*start = now + ehci->i_thresh + /* paranoia */ 1;
-		*max = end - span;
-		if (*max < *start + 1)
-			*max = *start + 1;
-	} else {
-		*start = last % mod;
-		*max = (last + 1) % mod;
-	}
+	now = readl (&ehci->regs->frame_index) % mod;
 
-	/* explicit start frame? */
-	if (!(urb->transfer_flags & URB_ISO_ASAP)) {
-		unsigned	temp;
-
-		/* sanity check: must be in range */
-		urb->start_frame %= ehci->periodic_size;
-		temp = urb->start_frame << 3;
-		if (temp < *start)
-			temp += mod;
-		if (temp > *max)
-			return -EDOM;
-
-		/* use that explicit start frame */
-		*start = urb->start_frame << 3;
-		temp += 8;
-		if (temp < *max)
-			*max = temp;
+	/* when's the last uframe this urb could start? */
+	max = now + mod;
+	max -= itd_sched->span;
+	max -= 8 * SCHEDULE_SLOP;
+
+	/* typical case: reuse current schedule. stream is still active,
+	 * and no gaps from host falling behind (irq delays etc)
+	 */
+	if (likely (!list_empty (&stream->itd_list))) {
+
+		start = stream->next_uframe;
+		if (start < now)
+			start += mod;
+		if (likely (start < max))
+			goto ready;
+
+		/* two cases:
+		 * (a) we missed some uframes ... can reschedule
+		 * (b) trying to overcommit the schedule
+		 * FIXME (b) should be a hard failure
+		 */
 	}
 
-	// FIXME minimize wraparound to "now" ... insist max+span
-	// (and start+span) remains a few frames short of "end"
+	/* need to schedule; when's the next (u)frame we could start?
+	 * this is bigger than ehci->i_thresh allows; scheduling itself
+	 * isn't free, the slop should handle reasonably slow cpus.  it
+	 * can also help high bandwidth if the dma and irq loads don't
+	 * jump until after the queue is primed.
+	 */
+	start = SCHEDULE_SLOP * 8 + (now & ~0x07);
+	end = start;
 
-	*max %= ehci->periodic_size;
-	if ((*start + span) < end)
-		return 0;
-	return -EFBIG;
-}
+	ehci_vdbg (ehci, "%s schedule from %d (%d..%d), was %d\n",
+			__FUNCTION__, now, start, max,
+			stream->next_uframe);
 
-static int
-itd_schedule (struct ehci_hcd *ehci, struct urb *urb)
-{
-	unsigned	start, max, i;
-	int		status;
-	unsigned	mod = ehci->periodic_size << 3;
+	/* NOTE:  assumes URB_ISO_ASAP, to limit complexity/bugs */
 
-	for (i = 0; i < urb->number_of_packets; i++) {
-		urb->iso_frame_desc [i].status = -EINPROGRESS;
-		urb->iso_frame_desc [i].actual_length = 0;
-	}
+	if (likely (max > (start + urb->interval)))
+		max = start + urb->interval;
 
-	if ((status = get_iso_range (ehci, urb, &start, &max, mod)) != 0)
-		return status;
+	/* hack:  account for itds already scheduled to this endpoint */
+	if (unlikely (list_empty (&stream->itd_list)))
+		end = max;
 
+	/* within [start..max] find a uframe slot with enough bandwidth */
+	end %= mod;
 	do {
 		unsigned	uframe;
-		unsigned	usecs;
-		struct ehci_itd	*itd;
+		int		enough_space = 1;
 
 		/* check schedule: enough space? */
-		itd = urb->hcpriv;
 		uframe = start;
-		for (i = 0, uframe = start;
-				i < urb->number_of_packets;
-				i++, uframe += urb->interval) {
+		do {
 			uframe %= mod;
 
 			/* can't commit more than 80% periodic == 100 usec */
 			if (periodic_usecs (ehci, uframe >> 3, uframe & 0x7)
-					> (100 - itd->usecs)) {
-				itd = 0;
+					> (100 - stream->usecs)) {
+				enough_space = 0;
 				break;
 			}
-			itd = list_entry (itd->itd_list.next,
-				struct ehci_itd, itd_list);
-		}
-		if (!itd)
-			continue;
-		
-		/* that's where we'll schedule this! */
-		itd = urb->hcpriv;
-		urb->start_frame = start >> 3;
-		vdbg ("ISO urb %p (%d packets period %d) starting %d.%d",
-			urb, urb->number_of_packets, urb->interval,
-			urb->start_frame, start & 0x7);
-		for (i = 0, uframe = start, usecs = 0;
-				i < urb->number_of_packets;
-				i++, uframe += urb->interval) {
-			uframe %= mod;
-
-			itd->uframe = uframe;
-			itd->hw_transaction [uframe & 0x07] = itd->transaction;
-			itd_link (ehci, (uframe >> 3) % ehci->periodic_size,
-				itd);
-			wmb ();
-			usecs += itd->usecs;
-
-			itd = list_entry (itd->itd_list.next,
-				struct ehci_itd, itd_list);
-		}
 
-		/* update bandwidth utilization records (for usbfs)
-		 *
-		 * FIXME This claims each URB queued to an endpoint, as if
-		 * transfers were concurrent, not sequential.  So bandwidth
-		 * typically gets double-billed ... comes from tying it to
-		 * URBs rather than endpoints in the schedule.  Luckily we
-		 * don't use this usbfs data for serious decision making.
-		 */
-		usecs /= urb->number_of_packets;
-		usecs /= urb->interval;
-		usecs >>= 3;
-		if (usecs < 1)
-			usecs = 1;
-		usb_claim_bandwidth (urb->dev, urb, usecs, 1);
-
-		/* maybe enable periodic schedule processing */
-		if (!ehci->periodic_sched++) {
-			if ((status =  enable_periodic (ehci)) != 0) {
-				// FIXME deschedule right away
-				err ("itd_schedule, enable = %d", status);
+			/* we know urb->interval is 2^N uframes */
+			uframe += urb->interval;
+		} while (uframe != end);
+
+		/* (re)schedule it here if there's enough bandwidth */
+		if (enough_space) {
+			start %= mod;
+			if (unlikely (!list_empty (&stream->itd_list))) {
+				/* host fell behind ... maybe irq latencies
+				 * delayed this request queue for too long.
+				 */
+				stream->rescheduled++;
+				dev_dbg (&urb->dev->dev,
+					"iso%d%s %d.%d skip %d.%d\n",
+					stream->bEndpointAddress & 0x0f,
+					(stream->bEndpointAddress & USB_DIR_IN)
+						? "in" : "out",
+					stream->next_uframe >> 3,
+					stream->next_uframe & 0x7,
+					start >> 3, start & 0x7);
 			}
+			stream->next_uframe = start;
+			goto ready;
 		}
 
-		return 0;
-
-	} while ((start = ++start % mod) != max);
+	} while (++start < max);
 
 	/* no room in the schedule */
-	dbg ("urb %p, CAN'T SCHEDULE", urb);
-	return -ENOSPC;
+	ehci_dbg (ehci, "iso %ssched full %p (now %d end %d max %d)\n",
+		list_empty (&stream->itd_list) ? "" : "re",
+		urb, now, end, max);
+	status = -ENOSPC;
+
+fail:
+	itd_sched_free (stream, itd_sched);
+	urb->hcpriv = 0;
+	return status;
+
+ready:
+	urb->start_frame = stream->next_uframe;
+	return 0;
 }
 
 /*-------------------------------------------------------------------------*/
 
+static inline void
+itd_init (struct ehci_iso_stream *stream, struct ehci_itd *itd)
+{
+	int i;
+
+	itd->hw_next = EHCI_LIST_END;
+	itd->hw_bufp [0] = stream->buf0;
+	itd->hw_bufp [1] = stream->buf1;
+	itd->hw_bufp [2] = stream->buf2;
+
+	for (i = 0; i < 8; i++)
+		itd->index[i] = -1;
+
+	/* All other fields are filled when scheduling */
+}
+
+static inline void
+itd_patch (
+	struct ehci_itd		*itd,
+	struct ehci_itd_sched	*itd_sched,
+	unsigned		index,
+	u16			uframe,
+	int			first
+)
+{
+	struct ehci_iso_uframe	*uf = &itd_sched->packet [index];
+	unsigned		pg = itd->pg;
+
+	// BUG_ON (pg == 6 && uf->cross);
+
+	uframe &= 0x07;
+	itd->index [uframe] = index;
+
+	itd->hw_transaction [uframe] = uf->transaction;
+	itd->hw_transaction [uframe] |= cpu_to_le32 (pg << 12);
+	itd->hw_bufp [pg] |= cpu_to_le32 (uf->bufp & ~(u32)0);
+	itd->hw_bufp_hi [pg] |= cpu_to_le32 ((u32)(uf->bufp >> 32));
+
+	/* iso_frame_desc[].offset must be strictly increasing */
+	if (unlikely (!first && uf->cross)) {
+		u64	bufp = uf->bufp + 4096;
+		itd->pg = ++pg;
+		itd->hw_bufp [pg] |= cpu_to_le32 (bufp & ~(u32)0);
+		itd->hw_bufp_hi [pg] |= cpu_to_le32 ((u32)(bufp >> 32));
+	}
+}
+
+static inline void
+itd_link (struct ehci_hcd *ehci, unsigned frame, struct ehci_itd *itd)
+{
+	/* always prepend ITD/SITD ... only QH tree is order-sensitive */
+	itd->itd_next = ehci->pshadow [frame];
+	itd->hw_next = ehci->periodic [frame];
+	ehci->pshadow [frame].itd = itd;
+	itd->frame = frame;
+	wmb ();
+	ehci->periodic [frame] = cpu_to_le32 (itd->itd_dma) | Q_TYPE_ITD;
+}
+
+/* fit urb's itds into the selected schedule slot; activate as needed */
+static int
+itd_link_urb (
+	struct ehci_hcd		*ehci,
+	struct urb		*urb,
+	unsigned		mod,
+	struct ehci_iso_stream	*stream
+)
+{
+	int			packet, first = 1;
+	unsigned		next_uframe, uframe, frame;
+	struct ehci_itd_sched	*itd_sched = urb->hcpriv;
+	struct ehci_itd		*itd;
+
+	next_uframe = stream->next_uframe % mod;
+
+	if (unlikely (list_empty(&stream->itd_list))) {
+		hcd_to_bus (&ehci->hcd)->bandwidth_allocated
+				+= stream->bandwidth;
+		ehci_vdbg (ehci,
+			"schedule devp %s ep%d%s-iso period %d start %d.%d\n",
+			urb->dev->devpath, stream->bEndpointAddress & 0x0f,
+			(stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out",
+			urb->interval,
+			next_uframe >> 3, next_uframe & 0x7);
+		stream->start = jiffies;
+	}
+	hcd_to_bus (&ehci->hcd)->bandwidth_isoc_reqs++;
+
+	/* fill iTDs uframe by uframe */
+	for (packet = 0, itd = 0; packet < urb->number_of_packets; ) {
+		if (itd == 0) {
+			/* ASSERT:  we have all necessary itds */
+			// BUG_ON (list_empty (&itd_sched->itd_list));
+
+			/* ASSERT:  no itds for this endpoint in this uframe */
+
+			itd = list_entry (itd_sched->itd_list.next,
+					struct ehci_itd, itd_list);
+			list_move_tail (&itd->itd_list, &stream->itd_list);
+			itd->stream = iso_stream_get (stream);
+			itd->urb = usb_get_urb (urb);
+			first = 1;
+			itd_init (stream, itd);
+		}
+
+		uframe = next_uframe & 0x07;
+		frame = next_uframe >> 3;
+
+		itd->usecs [uframe] = stream->usecs;
+		itd_patch (itd, itd_sched, packet, uframe, first);
+		first = 0;
+
+		next_uframe += stream->interval;
+		next_uframe %= mod;
+		packet++;
+
+		/* link completed itds into the schedule */
+		if (((next_uframe >> 3) != frame)
+				|| packet == urb->number_of_packets) {
+			itd_link (ehci, frame % ehci->periodic_size, itd);
+			itd = 0;
+		}
+	}
+	stream->next_uframe = next_uframe;
+
+	/* don't need that schedule data any more */
+	itd_sched_free (stream, itd_sched);
+	urb->hcpriv = 0;
+
+	if (unlikely (!ehci->periodic_sched++))
+		return enable_periodic (ehci);
+	return 0;
+}
+
 #define	ISO_ERRS (EHCI_ISOC_BUF_ERR | EHCI_ISOC_BABBLE | EHCI_ISOC_XACTERR)
 
 static unsigned
 itd_complete (
 	struct ehci_hcd	*ehci,
 	struct ehci_itd	*itd,
-	unsigned	uframe,
 	struct pt_regs	*regs
 ) {
 	struct urb				*urb = itd->urb;
 	struct usb_iso_packet_descriptor	*desc;
 	u32					t;
+	unsigned				uframe;
+	int					urb_index = -1;
+	struct ehci_iso_stream			*stream = itd->stream;
+	struct usb_device			*dev;
+
+	/* for each uframe with a packet */
+	for (uframe = 0; uframe < 8; uframe++) {
+		if (likely (itd->index[uframe] == -1))
+			continue;
+		urb_index = itd->index[uframe];
+		desc = &urb->iso_frame_desc [urb_index];
 
-	/* update status for this uframe's transfers */
-	desc = &urb->iso_frame_desc [itd->index];
+		t = le32_to_cpup (&itd->hw_transaction [uframe]);
+		itd->hw_transaction [uframe] = 0;
 
-	t = itd->hw_transaction [uframe];
-	itd->hw_transaction [uframe] = 0;
-	if (t & EHCI_ISOC_ACTIVE)
-		desc->status = -EXDEV;
-	else if (t & ISO_ERRS) {
-		urb->error_count++;
-		if (t & EHCI_ISOC_BUF_ERR)
-			desc->status = usb_pipein (urb->pipe)
-				? -ENOSR  /* couldn't read */
-				: -ECOMM; /* couldn't write */
-		else if (t & EHCI_ISOC_BABBLE)
-			desc->status = -EOVERFLOW;
-		else /* (t & EHCI_ISOC_XACTERR) */
-			desc->status = -EPROTO;
-
-		/* HC need not update length with this error */
-		if (!(t & EHCI_ISOC_BABBLE))
-			desc->actual_length += EHCI_ITD_LENGTH (t);
-	} else {
-		desc->status = 0;
-		desc->actual_length += EHCI_ITD_LENGTH (t);
+		/* report transfer status */
+		if (unlikely (t & ISO_ERRS)) {
+			urb->error_count++;
+			if (t & EHCI_ISOC_BUF_ERR)
+				desc->status = usb_pipein (urb->pipe)
+					? -ENOSR  /* hc couldn't read */
+					: -ECOMM; /* hc couldn't write */
+			else if (t & EHCI_ISOC_BABBLE)
+				desc->status = -EOVERFLOW;
+			else /* (t & EHCI_ISOC_XACTERR) */
+				desc->status = -EPROTO;
+
+			/* HC need not update length with this error */
+			if (!(t & EHCI_ISOC_BABBLE))
+				desc->actual_length = EHCI_ITD_LENGTH (t);
+		} else if (likely ((t & EHCI_ISOC_ACTIVE) == 0)) {
+			desc->status = 0;
+			desc->actual_length = EHCI_ITD_LENGTH (t);
+		}
 	}
 
-	vdbg ("itd %p urb %p packet %d/%d trans %x status %d len %d",
-		itd, urb, itd->index + 1, urb->number_of_packets,
-		t, desc->status, desc->actual_length);
+	usb_put_urb (urb);
+	itd->urb = 0;
+	itd->stream = 0;
+	list_move (&itd->itd_list, &stream->free_itd_list);
+	iso_stream_put (ehci, stream);
 
 	/* handle completion now? */
-	if ((itd->index + 1) != urb->number_of_packets)
+	if (likely ((urb_index + 1) != urb->number_of_packets))
 		return 0;
 
-	/*
-	 * Always give the urb back to the driver ... expect it to submit
-	 * a new urb (or resubmit this), and to have another already queued
-	 * when un-interrupted transfers are needed.
-	 *
-	 * NOTE that for now we don't accelerate ISO unlinks; they just
-	 * happen according to the current schedule.  Means a delay of
-	 * up to about a second (max).
+	/* ASSERT: it's really the last itd for this urb
+	list_for_each_entry (itd, &stream->itd_list, itd_list)
+		BUG_ON (itd->urb == urb);
 	 */
-	itd_free_list (ehci, urb);
-	if (urb->status == -EINPROGRESS)
-		urb->status = 0;
-
-	/* complete() can reenter this HCD */
-	spin_unlock (&ehci->lock);
-	usb_hcd_giveback_urb (&ehci->hcd, urb, regs);
-	spin_lock (&ehci->lock);
+
+	/* give urb back to the driver ... can be out-of-order */
+	dev = usb_get_dev (urb->dev);
+	ehci_urb_done (ehci, urb, regs);
+	urb = 0;
 
 	/* defer stopping schedule; completion can submit */
 	ehci->periodic_sched--;
-	if (!ehci->periodic_sched)
+	if (unlikely (!ehci->periodic_sched))
 		(void) disable_periodic (ehci);
+	hcd_to_bus (&ehci->hcd)->bandwidth_isoc_reqs--;
+
+	if (unlikely (list_empty (&stream->itd_list))) {
+		hcd_to_bus (&ehci->hcd)->bandwidth_allocated
+				-= stream->bandwidth;
+		ehci_vdbg (ehci,
+			"deschedule devp %s ep%d%s-iso\n",
+			dev->devpath, stream->bEndpointAddress & 0x0f,
+			(stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out");
+	}
+	iso_stream_put (ehci, stream);
+	usb_put_dev (dev);
 
 	return 1;
 }
@@ -939,23 +1167,50 @@
 
 static int itd_submit (struct ehci_hcd *ehci, struct urb *urb, int mem_flags)
 {
-	int		status;
-	unsigned long	flags;
+	int			status = -EINVAL;
+	unsigned long		flags;
+	struct ehci_iso_stream	*stream;
 
-	dbg ("itd_submit urb %p", urb);
+	/* Get iso_stream head */
+	stream = iso_stream_find (ehci, urb);
+	if (unlikely (stream == 0)) {
+		ehci_dbg (ehci, "can't get iso stream\n");
+		return -ENOMEM;
+	}
+	if (unlikely (urb->interval != stream->interval)) {
+		ehci_dbg (ehci, "can't change iso interval %d --> %d\n",
+			stream->interval, urb->interval);
+		goto done;
+	}
+
+#ifdef EHCI_URB_TRACE
+	ehci_dbg (ehci,
+		"%s %s urb %p ep%d%s len %d, %d pkts %d uframes [%p]\n",
+		__FUNCTION__, urb->dev->devpath, urb,
+		usb_pipeendpoint (urb->pipe),
+		usb_pipein (urb->pipe) ? "in" : "out",
+		urb->transfer_buffer_length,
+		urb->number_of_packets, urb->interval,
+		stream);
+#endif
 
 	/* allocate ITDs w/o locking anything */
-	status = itd_urb_transaction (ehci, urb, mem_flags);
-	if (status < 0)
-		return status;
+	status = itd_urb_transaction (stream, ehci, urb, mem_flags);
+	if (unlikely (status < 0)) {
+		ehci_dbg (ehci, "can't init itds\n");
+		goto done;
+	}
 
 	/* schedule ... need to lock */
 	spin_lock_irqsave (&ehci->lock, flags);
-	status = itd_schedule (ehci, urb);
+	status = itd_stream_schedule (ehci, urb, stream);
+ 	if (likely (status == 0))
+		itd_link_urb (ehci, urb, ehci->periodic_size << 3, stream);
 	spin_unlock_irqrestore (&ehci->lock, flags);
-	if (status < 0)
-		itd_free_list (ehci, urb);
 
+done:
+	if (unlikely (status < 0))
+		iso_stream_put (ehci, stream);
 	return status;
 }
 
@@ -986,24 +1241,23 @@
 	 * When running, scan from last scan point up to "now"
 	 * else clean up by scanning everything that's left.
 	 * Touches as few pages as possible:  cache-friendly.
-	 * Don't scan ISO entries more than once, though.
 	 */
-	frame = ehci->next_uframe >> 3;
+	now_uframe = ehci->next_uframe;
 	if (HCD_IS_RUNNING (ehci->hcd.state))
-		now_uframe = readl (&ehci->regs->frame_index);
+		clock = readl (&ehci->regs->frame_index) % mod;
 	else
-		now_uframe = (frame << 3) - 1;
-	now_uframe %= mod;
-	clock = now_uframe >> 3;
+		clock = now_uframe + mod - 1;
 
 	for (;;) {
 		union ehci_shadow	q, *q_p;
 		u32			type, *hw_p;
 		unsigned		uframes;
 
+		frame = now_uframe >> 3;
 restart:
 		/* scan schedule to _before_ current frame index */
-		if (frame == clock)
+		if ((frame == (clock >> 3))
+				&& HCD_IS_RUNNING (ehci->hcd.state))
 			uframes = now_uframe & 0x07;
 		else
 			uframes = 8;
@@ -1043,34 +1297,31 @@
 			case Q_TYPE_ITD:
 				last = (q.itd->hw_next == EHCI_LIST_END);
 
-				/* Unlink each (S)ITD we see, since the ISO
-				 * URB model forces constant rescheduling.
-				 * That complicates sharing uframes in ITDs,
-				 * and means we need to skip uframes the HC
-				 * hasn't yet processed.
-				 */
-				for (uf = 0; uf < uframes; uf++) {
-					if (q.itd->hw_transaction [uf] != 0) {
-						temp = q;
-						*q_p = q.itd->itd_next;
-						*hw_p = q.itd->hw_next;
-						type = Q_NEXT_TYPE (*hw_p);
-
-						/* might free q.itd ... */
-						count += itd_complete (ehci,
-							temp.itd, uf, regs);
-						break;
-					}
-				}
-				/* we might skip this ITD's uframe ... */
-				if (uf == uframes) {
+				/* skip itds for later in the frame */
+				rmb ();
+				for (uf = uframes; uf < 8; uf++) {
+					if (0 == (q.itd->hw_transaction [uf]
+							& ISO_ACTIVE))
+						continue;
 					q_p = &q.itd->itd_next;
 					hw_p = &q.itd->hw_next;
 					type = Q_NEXT_TYPE (q.itd->hw_next);
+					q = *q_p;
+					break;
 				}
+				if (uf != 8)
+					break;
 
-				q = *q_p;
-				break;
+				/* this one's ready ... HC won't cache the
+				 * pointer for much longer, if at all.
+				 */
+				*q_p = q.itd->itd_next;
+				*hw_p = q.itd->hw_next;
+				wmb();
+
+				/* always rescan here; simpler */
+				count += itd_complete (ehci, q.itd, regs);
+				goto restart;
 #ifdef have_split_iso
 			case Q_TYPE_SITD:
 				last = (q.sitd->hw_next == EHCI_LIST_END);
@@ -1104,7 +1355,7 @@
 
 		// FIXME:  likewise assumes HC doesn't halt mid-scan
 
-		if (frame == clock) {
+		if (now_uframe == clock) {
 			unsigned	now;
 
 			if (!HCD_IS_RUNNING (ehci->hcd.state))
@@ -1115,9 +1366,13 @@
 				break;
 
 			/* rescan the rest of this frame, then ... */
-			now_uframe = now;
-			clock = now_uframe >> 3;
-		} else
-			frame = (frame + 1) % ehci->periodic_size;
+			clock = now;
+		} else {
+			/* FIXME sometimes we can scan the next frame
+			 * right away, not always inching up on it ...
+			 */
+			now_uframe++;
+			now_uframe %= mod;
+		}
 	} 
 }
diff -Nru a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
--- a/drivers/usb/host/ehci.h	Tue Feb  3 19:45:41 2004
+++ b/drivers/usb/host/ehci.h	Tue Feb  3 19:45:41 2004
@@ -153,9 +153,12 @@
 
 /* Section 2.2 Host Controller Capability Registers */
 struct ehci_caps {
-	u8		length;		/* CAPLENGTH - size of this struct */
-	u8		reserved;       /* offset 0x1 */
-	u16		hci_version;    /* HCIVERSION - offset 0x2 */
+	/* these fields are specified as 8 and 16 bit registers,
+	 * but some hosts can't perform 8 or 16 bit PCI accesses.
+	 */
+	u32	hc_capbase;
+#define HC_LENGTH(p)		(((p)>>00)&0x00ff)	/* bits 7:0 */
+#define HC_VERSION(p)		(((p)>>16)&0xffff)	/* bits 31:16 */
 	u32		hcs_params;     /* HCSPARAMS - offset 0x4 */
 #define HCS_DEBUG_PORT(p)	(((p)>>20)&0xf)	/* bits 23:20, debug port? */
 #define HCS_INDICATOR(p)	((p)&(1 << 16))	/* true: has port indicators */
@@ -378,11 +381,68 @@
 	unsigned short		period;		/* polling interval */
 	unsigned short		start;		/* where polling starts */
 #define NO_FRAME ((unsigned short)~0)			/* pick new start */
-
+	struct usb_device	*dev;		/* access to TT */
 } __attribute__ ((aligned (32)));
 
 /*-------------------------------------------------------------------------*/
 
+/* description of one iso highspeed transaction (up to 3 KB data) */
+struct ehci_iso_uframe {
+	/* These will be copied to iTD when scheduling */
+	u64			bufp;		/* itd->hw_bufp{,_hi}[pg] |= */
+	u32			transaction;	/* itd->hw_transaction[i] |= */
+	u8			cross;		/* buf crosses pages */
+};
+
+/* temporary schedule data for highspeed packets from iso urbs
+ * each packet is one uframe's usb transactions, in some itd,
+ * beginning at stream->next_uframe
+ */
+struct ehci_itd_sched {
+	struct list_head	itd_list;
+	unsigned		span;
+	struct ehci_iso_uframe	packet [0];
+};
+
+/*
+ * ehci_iso_stream - groups all (s)itds for this endpoint.
+ * acts like a qh would, if EHCI had them for ISO.
+ */
+struct ehci_iso_stream {
+	/* first two fields match QH, but info1 == 0 */
+	u32			hw_next;
+	u32			hw_info1;
+
+	u32			refcount;
+	u8			bEndpointAddress;
+	struct list_head	itd_list;	/* queued itds */
+	struct list_head	free_itd_list;	/* list of unused itds */
+	struct hcd_dev		*dev;
+
+	/* output of (re)scheduling */
+	unsigned long		start;		/* jiffies */
+	unsigned long		rescheduled;
+	int			next_uframe;
+
+	/* the rest is derived from the endpoint descriptor,
+	 * trusting urb->interval == (1 << (epdesc->bInterval - 1)),
+	 * including the extra info for hw_bufp[0..2]
+	 */
+	u8			interval;
+	u8			usecs;		
+	u16			maxp;
+	unsigned		bandwidth;
+
+	/* This is used to initialize iTD's hw_bufp fields */
+	u32			buf0;		
+	u32			buf1;		
+	u32			buf2;
+
+	/* ... sITD won't use buf[012], and needs TT access ... */
+};
+
+/*-------------------------------------------------------------------------*/
+
 /*
  * EHCI Specification 0.95 Section 3.3
  * Fig 3-4 "Isochronous Transaction Descriptor (iTD)"
@@ -397,9 +457,11 @@
 #define EHCI_ISOC_BUF_ERR       (1<<30)        /* Data buffer error */
 #define EHCI_ISOC_BABBLE        (1<<29)        /* babble detected */
 #define EHCI_ISOC_XACTERR       (1<<28)        /* XactErr - transaction error */
-#define	EHCI_ITD_LENGTH(tok)	(((tok)>>16) & 0x7fff)
+#define	EHCI_ITD_LENGTH(tok)	(((tok)>>16) & 0x0fff)
 #define	EHCI_ITD_IOC		(1 << 15)	/* interrupt on complete */
 
+#define ISO_ACTIVE	__constant_cpu_to_le32(EHCI_ISOC_ACTIVE)
+
 	u32			hw_bufp [7];	/* see EHCI 3.3.3 */ 
 	u32			hw_bufp_hi [7];	/* Appendix B */
 
@@ -408,14 +470,14 @@
 	union ehci_shadow	itd_next;	/* ptr to periodic q entry */
 
 	struct urb		*urb;
-	struct list_head	itd_list;	/* list of urb frames' itds */
-	dma_addr_t		buf_dma;	/* frame's buffer address */
+	struct ehci_iso_stream	*stream;	/* endpoint's queue */
+	struct list_head	itd_list;	/* list of stream's itds */
 
-	/* for now, only one hw_transaction per itd */
-	u32			transaction;
-	u16			index;		/* in urb->iso_frame_desc */
-	u16			uframe;		/* in periodic schedule */
-	u16			usecs;
+	/* any/all hw_transactions here may be used by that urb */
+	unsigned		frame;		/* where scheduled */
+	unsigned		pg;
+	unsigned		index[8];	/* in urb->iso_frame_desc */
+	u8			usecs[8];
 } __attribute__ ((aligned (32)));
 
 /*-------------------------------------------------------------------------*/
diff -Nru a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
--- a/drivers/usb/host/ohci-hcd.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/usb/host/ohci-hcd.c	Tue Feb  3 19:45:16 2004
@@ -684,6 +684,10 @@
 #include "ohci-sa1111.c"
 #endif
 
-#if !(defined(CONFIG_PCI) || defined(CONFIG_SA1111))
+#ifdef CONFIG_ARCH_OMAP
+#include "ohci-omap.c"
+#endif
+
+#if !(defined(CONFIG_PCI) || defined(CONFIG_SA1111) || defined(CONFIG_ARCH_OMAP))
 #error "missing bus glue for ohci-hcd"
 #endif
diff -Nru a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/usb/host/ohci-omap.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,673 @@
+/*
+ * OHCI HCD (Host Controller Driver) for USB.
+ *
+ * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
+ * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net>
+ * (C) Copyright 2002 Hewlett-Packard Company
+ * 
+ * OMAP Bus Glue
+ *
+ * Written by Christopher Hoover <ch@hpl.hp.com>
+ * Based on fragments of previous driver by Rusell King et al.
+ *
+ * Modified for OMAP from ohci-sa1111.c by Tony Lindgren <tony@atomide.com>
+ * Based on the 2.4 OMAP OHCI driver originally done by MontaVista Software Inc.
+ *
+ * This file is licenced under the GPL.
+ */
+ 
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/io.h>
+
+#include <asm/arch/bus.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/mux.h>
+#include <asm/arch/irqs.h>
+
+#include "ohci-omap.h"
+
+#ifndef CONFIG_ARCH_OMAP
+#error "This file is OMAP bus glue.  CONFIG_OMAP must be defined."
+#endif
+
+extern int usb_disabled(void);
+extern int ocpi_enable(void);
+
+/*
+ * Use the first port only by default. Override with hmc_mode option.
+ *
+ * NOTE: Many OMAP-1510 Innovators supposedly have bad wiring for the USB ports
+ *       1 & 2, so only port 0 will work. To use the OHCI on the first port, use 
+ *       the Innovator USB client cable with a client-to-client connector and modify
+ *       either the cable or the hub to feed 5V VBUS back to Innovator. VBUS should
+ *       be the red lead in the cable.
+ *
+ *       To mount USB hard disk as root, see the patch for do_mounts.c that tries 
+ *       remounting the root, and use root=0801 if your root is on sda1. Does not 
+ *       work with devfs.
+ */
+static int default_hmc_mode = 16;
+static int hmc_mode = 1234;
+
+/*
+ * Set the USB host pin multiplexing and the selected HMC mode
+ */
+static int omap_usb_set_hmc_mode(int hmc_mode)
+{
+	unsigned int val;
+
+	switch (hmc_mode) {
+	case 0:
+		/* 0: function, 1: disabled, 2: disabled */
+		omap_cfg_reg(W4_USB_PUEN);
+		omap_cfg_reg(R18_1510_USB_GPIO0);
+		break;
+	case 4:
+		/* 0: function 1: host 2: host */
+		omap_cfg_reg(usb1_speed);
+		omap_cfg_reg(usb1_susp);
+		omap_cfg_reg(usb1_seo);
+		omap_cfg_reg(usb1_txen);
+		omap_cfg_reg(usb1_txd);
+		omap_cfg_reg(usb1_vp);
+		omap_cfg_reg(usb1_vm);
+		omap_cfg_reg(usb1_rcv);
+		omap_cfg_reg(usb2_susp);
+		omap_cfg_reg(usb2_seo);
+		omap_cfg_reg(usb2_txen);
+		omap_cfg_reg(usb2_txd);
+		omap_cfg_reg(usb2_vp);
+		omap_cfg_reg(usb2_vm);
+		omap_cfg_reg(usb2_rcv);
+		break;
+	case 16:
+		/* 0: host, 1: disabled, 2: disabled */
+		omap_cfg_reg(W9_USB0_TXEN);
+		omap_cfg_reg(AA9_USB0_VP);
+		omap_cfg_reg(Y5_USB0_RCV);
+		omap_cfg_reg(R9_USB0_VM);
+		omap_cfg_reg(V6_USB0_TXD);
+		omap_cfg_reg(W5_USB0_SE0);
+		break;
+	default:
+		printk("Unknown USB host configuration: %i\n", hmc_mode);
+		return -ENODEV;
+	}
+
+	/* Write the selected HMC mode */
+	val = readl(MOD_CONF_CTRL_0) & ~HMC_CLEAR;
+	val |= (hmc_mode << 1);
+	writel(val, MOD_CONF_CTRL_0);
+
+	return 0;
+}
+
+/*
+ * OHCI clock initialization for OMAP-1510 and 1610
+ */
+static int omap_ohci_clock_power(int on)
+{
+	if (on) {
+		if (cpu_is_omap_1510()) {
+			/* Use DPLL, not APLL */
+			writel(readl(ULPD_APLL_CTRL_REG) & ~APLL_NDPLL_SWITCH,
+			       ULPD_APLL_CTRL_REG);
+
+			/* Enable DPLL */
+			writel(readl(ULPD_DPLL_CTRL_REG) | DPLL_PLL_ENABLE,
+			       ULPD_DPLL_CTRL_REG);
+
+			/* Software request for USB 48MHz clock */
+			writel(readl(ULPD_SOFT_REQ_REG) | SOFT_REQ_REG_REQ,
+			       ULPD_SOFT_REQ_REG);
+
+			while (!(readl(ULPD_DPLL_CTRL_REG) & DPLL_LOCK));
+		}
+
+		if (cpu_is_omap_1610()) {
+			/* Enable OHCI */
+			writel(readl(ULPD_SOFT_REQ_REG) | SOFT_USB_OTG_REQ,
+				ULPD_SOFT_REQ_REG);
+
+			/* USB host clock request if not using OTG */
+			writel(readl(ULPD_SOFT_REQ_REG) | SOFT_USB_REQ,
+				ULPD_SOFT_REQ_REG);
+
+			outl(inl(ULPD_STATUS_REQ_REG) | USB_HOST_DPLL_REQ,
+			     ULPD_STATUS_REQ_REG);
+		}
+
+		/* Enable 48MHz clock to USB */
+		writel(readl(ULPD_CLOCK_CTRL_REG) | USB_MCLK_EN,
+		       ULPD_CLOCK_CTRL_REG);
+
+		writel(readl(ARM_IDLECT2) | (1 << EN_LBFREECK) | (1 << EN_LBCK),
+		       ARM_IDLECT2);
+
+		writel(readl(MOD_CONF_CTRL_0) | USB_HOST_HHC_UHOST_EN,
+		       MOD_CONF_CTRL_0);
+	} else {
+		/* Disable 48MHz clock to USB */
+		writel(readl(ULPD_CLOCK_CTRL_REG) & ~USB_MCLK_EN,
+		       ULPD_CLOCK_CTRL_REG);
+
+		/* FIXME: The DPLL stays on for now */
+	}
+
+	return 0;
+}
+
+/*
+ * Hardware specific transceiver power on/off
+ */
+static int omap_ohci_transceiver_power(int on)
+{
+	if (on) {
+		if (omap_is_innovator())
+			writel(readl(OMAP1510_FPGA_HOST_CTRL) | 0x20, 
+			       OMAP1510_FPGA_HOST_CTRL);
+	} else {
+		if (omap_is_innovator())
+			writel(readl(OMAP1510_FPGA_HOST_CTRL) & ~0x20, 
+			       OMAP1510_FPGA_HOST_CTRL);
+	}
+
+	return 0;
+}
+
+/*
+ * OMAP-1510 specific Local Bus clock on/off
+ */
+static int omap_1510_local_bus_power(int on)
+{
+	if (on) {
+		writel((1 << 1) | (1 << 0), OMAP1510_LB_MMU_CTL);
+		udelay(200);
+	} else {
+		writel(0, OMAP1510_LB_MMU_CTL);
+	}
+
+	return 0;
+}
+
+/*
+ * OMAP-1510 specific Local Bus initialization
+ * NOTE: This assumes 32MB memory size in OMAP1510LB_MEMSIZE.
+ *       See also arch/mach-omap/memory.h for __virt_to_bus() and 
+ *       __bus_to_virt() which need to match with the physical 
+ *       Local Bus address below.
+ */
+static int omap_1510_local_bus_init(void)
+{
+	unsigned int tlb;
+	unsigned long lbaddr, physaddr;
+
+	writel((readl(OMAP1510_LB_CLOCK_DIV) & 0xfffffff8) | 0x4, 
+	       OMAP1510_LB_CLOCK_DIV);
+
+	/* Configure the Local Bus MMU table */
+	for (tlb = 0; tlb < OMAP1510_LB_MEMSIZE; tlb++) {
+		lbaddr = tlb * 0x00100000 + OMAP1510_LB_OFFSET;
+		physaddr = tlb * 0x00100000 + PHYS_OFFSET;
+		writel((lbaddr & 0x0fffffff) >> 22, OMAP1510_LB_MMU_CAM_H);
+		writel(((lbaddr & 0x003ffc00) >> 6) | 0xc, 
+		       OMAP1510_LB_MMU_CAM_L);
+		writel(physaddr >> 16, OMAP1510_LB_MMU_RAM_H);
+		writel((physaddr & 0x0000fc00) | 0x300, OMAP1510_LB_MMU_RAM_L);
+		writel(tlb << 4, OMAP1510_LB_MMU_LCK);
+		writel(0x1, OMAP1510_LB_MMU_LD_TLB);
+	}
+
+	/* Enable the walking table */
+	writel(readl(OMAP1510_LB_MMU_CTL) | (1 << 3), OMAP1510_LB_MMU_CTL);
+	udelay(200);
+
+	return 0;
+}
+
+/*
+ * OMAP-1610 specific hardware initialization
+ *
+ * Intended to configure OMAP-1610 USB host and OTG ports depending on 
+ * the HMC mode selected.
+ *
+ * FIXME: Currently only supports alternate ping group 2 mode, should
+ *        be easy to modify for other configurations once there is some
+ *        hardware to test with.
+ */
+static int omap_1610_usb_init(int mode)
+{
+	u_int val = 0;
+
+	/* Configure the OMAP transceiver settings */
+	val |= (1 << 8); /* CONF_USB2_UNI TRM p 15-205*/
+	val |= (4 << 4); /* TRM p 5-59, p 15-157 (1224) */
+
+	//val |= (1 << 3); /* Isolate integrated transceiver from port 0 */
+	val |= (1 << 2); /* Disable pulldown on integrated transceiver DM */
+	val |= (1 << 1); /* Disable pulldown on integraded transceiver DP */
+
+	outl(val, USB_TRANSCEIVER_CTRL);
+
+	/* Set the USB0_TRX_MODE */
+	val = 0;
+	val &= ~OTG_IDLE_EN;
+	val &= ~DEV_IDLE_EN;
+	val &= ~(7 << 16);	/* Clear USB0_TRX_MODE */
+	val |= (3 << 16);	/* 0 or 3, 6-wire DAT/SE0, TRM p 15-159 */
+	outl(val, OTG_SYSCON_1);
+
+	/* 
+	 * Control via OTG, see TRM p 15-163
+	 */
+	val = 0;
+	//val |= 1;		/* REVISIT: Enable OTG = 1 */
+
+	/* Control via OTG */
+	val &= ~HMC_PADEN;
+	val &= ~OTG_PADEN;
+	val |= UHOST_EN;	
+
+	val &= ~0x3f;		/* Clear HMC mode */
+	val |= mode;		/* Set HMC mode */
+	val &= ~(7 << 16);	/* Clear ASE0_BRST */
+	val |= (4 << 16);	/* Must be 4 */
+	val |= USBX_SYNCHRO;	/* Must be set */
+	val |= SRP_VBUS;
+	outl(val, OTG_SYSCON_2);
+
+	/* Enable OTG idle */
+	//outl(inl(OTG_SYSCON_1) | OTG_IDLE_EN, OTG_SYSCON_1);
+
+	return 0;
+}
+
+/*-------------------------------------------------------------------------*/
+
+static void omap_start_hc(struct omap_dev *dev)
+{
+	printk(KERN_DEBUG __FILE__ 
+	       ": starting OMAP OHCI USB Controller\n");
+
+	/* 
+	 * Set the HMC mode for the USB ports
+	 */
+#if 0
+	/* See note about the Innovator wiring above */
+	if (omap_is_innovator())
+		hmc_mode = 4;	/* 0: function 1: host 2: host */
+#endif
+
+	if (cpu_is_omap_1610())
+		ocpi_enable();
+
+	omap_usb_set_hmc_mode(hmc_mode);
+
+	omap_ohci_clock_power(1);
+	omap_ohci_transceiver_power(1);
+
+	if (cpu_is_omap_1510()) {
+		omap_1510_local_bus_power(1);
+		omap_1510_local_bus_init();
+	}
+
+	if (cpu_is_omap_1610())
+		omap_1610_usb_init(hmc_mode);
+
+	//omap_enable_device(dev);
+}
+
+static void omap_stop_hc(struct omap_dev *dev)
+{
+	printk(KERN_DEBUG __FILE__ 
+	       ": stopping OMAP OHCI USB Controller\n");
+
+	/*
+	 * FIXME: Put the USB host controller into reset.
+	 */
+
+	/*
+	 * FIXME: Stop the USB clock.
+	 */
+	//omap_disable_device(dev);
+
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+static irqreturn_t usb_hcd_omap_hcim_irq (int irq, void *__hcd, struct pt_regs * r)
+{
+	struct usb_hcd *hcd = __hcd;
+
+	return usb_hcd_irq(irq, hcd, r);
+}
+
+/*-------------------------------------------------------------------------*/
+
+void usb_hcd_omap_remove (struct usb_hcd *, struct omap_dev *);
+
+/* configure so an HC device and id are always provided */
+/* always called with process context; sleeping is OK */
+
+
+/**
+ * usb_hcd_omap_probe - initialize OMAP-based HCDs
+ * Context: !in_interrupt()
+ *
+ * Allocates basic resources for this USB host controller, and
+ * then invokes the start() method for the HCD associated with it
+ * through the hotplug entry's driver_data.
+ *
+ * Store this function in the HCD's struct pci_driver as probe().
+ */
+int usb_hcd_omap_probe (const struct hc_driver *driver,
+			  struct usb_hcd **hcd_out,
+			  struct omap_dev *dev)
+{
+	int retval;
+	struct usb_hcd *hcd = 0;
+
+	if (!request_mem_region(dev->res.start, 
+				dev->res.end - dev->res.start + 1, hcd_name)) {
+		dbg("request_mem_region failed");
+		return -EBUSY;
+	}
+
+	omap_start_hc(dev);
+
+	hcd = driver->hcd_alloc ();
+	if (hcd == NULL){
+		dbg ("hcd_alloc failed");
+		retval = -ENOMEM;
+		goto err1;
+	}
+
+	hcd->driver = (struct hc_driver *) driver;
+	hcd->description = driver->description;
+	hcd->irq = dev->irq[0];
+	hcd->regs = dev->mapbase;
+	hcd->pdev = OMAP_FAKE_PCIDEV;
+	hcd->self.controller = &dev->dev;
+	hcd->controller = hcd->self.controller;
+
+	retval = hcd_buffer_create (hcd);
+	if (retval != 0) {
+		dbg ("pool alloc fail");
+		goto err1;
+	}
+
+	retval = request_irq (hcd->irq, 
+			      usb_hcd_omap_hcim_irq, 
+			      SA_INTERRUPT, hcd->description, hcd);
+	if (retval != 0) {
+		dbg("request_irq failed");
+		retval = -EBUSY;
+		goto err2;
+	}
+
+	info ("%s (OMAP) at 0x%p, irq %d\n",
+	      hcd->description, hcd->regs, hcd->irq);
+
+	usb_bus_init (&hcd->self);
+	hcd->self.op = &usb_hcd_operations;
+	hcd->self.hcpriv = (void *) hcd;
+	hcd->self.bus_name = "omap";
+	hcd->product_desc = "OMAP OHCI";
+
+	INIT_LIST_HEAD (&hcd->dev_list);
+	usb_register_bus (&hcd->self);
+
+	if ((retval = driver->start (hcd)) < 0) 
+	{
+		usb_hcd_omap_remove(hcd, dev);
+		return retval;
+	}
+
+	*hcd_out = hcd;
+	return 0;
+
+ err2:
+	hcd_buffer_destroy (hcd);
+	if (hcd)
+		driver->hcd_free(hcd);
+ err1:
+	omap_stop_hc(dev);
+
+	release_mem_region(dev->res.start, dev->res.end - dev->res.start + 1);
+
+	return retval;
+}
+
+
+/* may be called without controller electrically present */
+/* may be called with controller, bus, and devices active */
+
+/**
+ * usb_hcd_omap_remove - shutdown processing for OMAP-based HCDs
+ * @dev: USB Host Controller being removed
+ * Context: !in_interrupt()
+ *
+ * Reverses the effect of usb_hcd_omap_probe(), first invoking
+ * the HCD's stop() method.  It is always called from a thread
+ * context, normally "rmmod", "apmd", or something similar.
+ *
+ */
+void usb_hcd_omap_remove (struct usb_hcd *hcd, struct omap_dev *dev)
+{
+	struct usb_device	*hub;
+	void *base;
+
+	info ("remove: %s, state %x", hcd->self.bus_name, hcd->state);
+
+	if (in_interrupt ())
+		BUG ();
+
+	hub = hcd->self.root_hub;
+	hcd->state = USB_STATE_QUIESCING;
+
+	dbg ("%s: roothub graceful disconnect", hcd->self.bus_name);
+	usb_disconnect (&hub);
+
+	hcd->driver->stop (hcd);
+	hcd_buffer_destroy (hcd);
+	hcd->state = USB_STATE_HALT;
+
+	free_irq (hcd->irq, hcd);
+
+	usb_deregister_bus (&hcd->self);
+
+	base = hcd->regs;
+	hcd->driver->hcd_free (hcd);
+
+	omap_stop_hc(dev);
+
+	release_mem_region(dev->res.start, dev->res.end - dev->res.start + 1);
+}
+
+/*-------------------------------------------------------------------------*/
+
+static int __devinit
+ohci_omap_start (struct usb_hcd *hcd)
+{
+	struct ohci_hcd	*ohci = hcd_to_ohci (hcd);
+	int		ret;
+
+	if (hcd->pdev) {
+		ohci->hcca = pci_alloc_consistent (hcd->pdev,
+				sizeof *ohci->hcca, &ohci->hcca_dma);
+		if (!ohci->hcca)
+			return -ENOMEM;
+	}
+
+        memset (ohci->hcca, 0, sizeof (struct ohci_hcca));
+	if ((ret = ohci_mem_init (ohci)) < 0) {
+		ohci_stop (hcd);
+		return ret;
+	}
+	ohci->regs = hcd->regs;
+	if (hc_reset (ohci) < 0) {
+		ohci_stop (hcd);
+		return -ENODEV;
+	}
+
+	if (hc_start (ohci) < 0) {
+		err ("can't start %s", ohci->hcd.self.bus_name);
+		ohci_stop (hcd);
+		return -EBUSY;
+	}
+	create_debug_files (ohci);
+
+#ifdef	DEBUG
+	ohci_dump (ohci, 1);
+#endif
+	return 0;
+}
+
+/*-------------------------------------------------------------------------*/
+
+static const struct hc_driver ohci_omap_hc_driver = {
+	.description =		hcd_name,
+
+	/*
+	 * generic hardware linkage
+	 */
+	.irq =			ohci_irq,
+	.flags =		HCD_USB11,
+
+	/*
+	 * basic lifecycle operations
+	 */
+	.start =		ohci_omap_start,
+#ifdef	CONFIG_PM
+	/* suspend:		ohci_omap_suspend,  -- tbd */
+	/* resume:		ohci_omap_resume,   -- tbd */
+#endif
+	.stop =			ohci_stop,
+
+	/*
+	 * memory lifecycle (except per-request)
+	 */
+	.hcd_alloc =		ohci_hcd_alloc,
+	.hcd_free =		ohci_hcd_free,
+
+	/*
+	 * managing i/o requests and associated device resources
+	 */
+	.urb_enqueue =		ohci_urb_enqueue,
+	.urb_dequeue =		ohci_urb_dequeue,
+	.endpoint_disable =	ohci_endpoint_disable,
+
+	/*
+	 * scheduling support
+	 */
+	.get_frame_number =	ohci_get_frame,
+
+	/*
+	 * root hub support
+	 */
+	.hub_status_data =	ohci_hub_status_data,
+	.hub_control =		ohci_hub_control,
+};
+
+/*-------------------------------------------------------------------------*/
+
+static int ohci_hcd_omap_drv_probe(struct omap_dev *dev)
+{
+	struct usb_hcd *hcd = NULL;
+	int ret;
+
+	if (usb_disabled())
+		return -ENODEV;
+
+	ret = usb_hcd_omap_probe(&ohci_omap_hc_driver, &hcd, dev);
+
+	if (ret == 0)
+		omap_set_drvdata(dev, hcd);
+
+	return ret;
+}
+
+static int ohci_hcd_omap_drv_remove(struct omap_dev *dev)
+{
+	struct usb_hcd *hcd = omap_get_drvdata(dev);
+
+	usb_hcd_omap_remove(hcd, dev);
+
+	omap_set_drvdata(dev, NULL);
+
+	return 0;
+}
+
+/*
+ * Driver definition to register with the OMAP bus
+ */
+static struct omap_driver ohci_hcd_omap_driver = {
+	.drv = {
+		.name	= OMAP_OHCI_NAME,
+	},
+	.devid		= OMAP_OCP_DEVID_USB,
+	.busid		= OMAP_BUS_OCP,
+	.clocks		= 0,
+	.probe		= ohci_hcd_omap_drv_probe,
+	.remove		= ohci_hcd_omap_drv_remove,
+};
+
+/* Any dma_mask must be set for OHCI to work */
+static u64 omap_dmamask = 0xffffffffUL;	
+
+/*
+ * Device definition to match the driver above
+ */
+static struct omap_dev ohci_hcd_omap_device = {
+	.name		= OMAP_OHCI_NAME,
+	.devid		= OMAP_OCP_DEVID_USB,
+	.busid		= OMAP_BUS_OCP,
+	.mapbase	= (void *)OMAP_OHCI_BASE,
+	.dma_mask	= &omap_dmamask,	/* Needed only for OHCI */
+	.res = {
+		.start	= OMAP_OHCI_BASE,
+		.end	= OMAP_OHCI_BASE + OMAP_OHCI_SIZE,
+	},
+	.irq = {
+		INT_OHCI,
+	},
+};
+
+static int __init ohci_hcd_omap_init (void)
+{
+	int ret;
+
+	dbg (DRIVER_INFO " (OMAP)");
+	dbg ("block sizes: ed %d td %d\n",
+		sizeof (struct ed), sizeof (struct td));
+
+	if (hmc_mode < 0 || hmc_mode > 25)
+		hmc_mode = default_hmc_mode;
+
+	/* Register the driver with OMAP bus */
+	ret = omap_driver_register(&ohci_hcd_omap_driver);
+	if (ret != 0)
+		return -ENODEV;
+
+	/* Register the device with OMAP bus */
+	ret = omap_device_register(&ohci_hcd_omap_device);
+	if (ret != 0) {
+		omap_driver_unregister(&ohci_hcd_omap_driver);
+		return -ENODEV;
+	}
+
+	return ret;
+}
+
+MODULE_PARM(hmc_mode, "hmc_mode");
+
+static void __exit ohci_hcd_omap_cleanup (void)
+{
+	omap_device_unregister(&ohci_hcd_omap_device);
+	omap_driver_unregister(&ohci_hcd_omap_driver);
+}
+
+module_init (ohci_hcd_omap_init);
+module_exit (ohci_hcd_omap_cleanup);
diff -Nru a/drivers/usb/host/ohci-omap.h b/drivers/usb/host/ohci-omap.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/usb/host/ohci-omap.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,57 @@
+/*
+ * linux/drivers/usb/host/ohci-omap.h
+ *
+ * OMAP OHCI USB controller specific defines
+ */
+
+/* OMAP USB OHCI common defines */
+#define OMAP_OHCI_NAME		"omap-ohci"
+#define OMAP_OHCI_BASE		0xfffba000
+#define OMAP_OHCI_SIZE		4096
+
+#define HMC_CLEAR		(0x3f << 1)
+#define APLL_NDPLL_SWITCH	0x0001
+#define DPLL_PLL_ENABLE		0x0010
+#define DPLL_LOCK		0x0001
+#define SOFT_REQ_REG_REQ	0x0001
+#define USB_MCLK_EN		0x0010
+#define USB_HOST_HHC_UHOST_EN	0x00000200
+#define SOFT_USB_OTG_REQ	(1 << 8)
+#define SOFT_USB_REQ		(1 << 3)
+#define STATUS_REQ_REG		0xfffe0840
+#define USB_HOST_DPLL_REQ	(1 << 8)
+#define SOFT_DPLL_REQ		(1 << 0)
+
+/* OMAP-1510 USB OHCI defines */
+#define OMAP1510_LB_MEMSIZE	32		/* Should be same as SDRAM size */
+#define OMAP1510_LB_CLOCK_DIV	0xfffec10c
+#define OMAP1510_LB_MMU_CTL	0xfffec208	
+#define OMAP1510_LB_MMU_LCK	0xfffec224
+#define OMAP1510_LB_MMU_LD_TLB	0xfffec228
+#define OMAP1510_LB_MMU_CAM_H	0xfffec22c
+#define OMAP1510_LB_MMU_CAM_L	0xfffec230
+#define OMAP1510_LB_MMU_RAM_H	0xfffec234
+#define OMAP1510_LB_MMU_RAM_L	0xfffec238
+
+/* OMAP-1610 USB OHCI defines */
+#define USB_TRANSCEIVER_CTRL	0xfffe1064
+#define OTG_REV			0xfffb0400
+
+#define OTG_SYSCON_1		0xfffb0404
+#define OTG_IDLE_EN		(1 << 15)
+#define DEV_IDLE_EN		(1 << 13)
+
+#define OTG_SYSCON_2		0xfffb0408
+#define OTG_CTRL		0xfffb040c
+#define OTG_IRQ_EN		0xfffb0410
+#define OTG_IRQ_SRC		0xfffb0414
+
+#define OTG_EN			(1 << 31)
+#define USBX_SYNCHRO		(1 << 30)
+#define SRP_VBUS		(1 << 12)
+#define OTG_PADEN		(1 << 10)
+#define HMC_PADEN		(1 << 9)
+#define UHOST_EN		(1 << 8)
+
+/* Hardware specific defines */
+#define OMAP1510_FPGA_HOST_CTRL	0xe800020c
diff -Nru a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
--- a/drivers/usb/host/uhci-hcd.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/usb/host/uhci-hcd.c	Tue Feb  3 19:45:42 2004
@@ -525,8 +525,12 @@
 
 	lltd = list_entry(lurbp->td_list.prev, struct uhci_td, list);
 
-	usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), usb_pipeout(urb->pipe),
-		uhci_fixup_toggle(urb, uhci_toggle(td_token(lltd)) ^ 1));
+	/* Control transfers always start with toggle 0 */
+	if (!usb_pipecontrol(urb->pipe))
+		usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe),
+				usb_pipeout(urb->pipe),
+				uhci_fixup_toggle(urb,
+					uhci_toggle(td_token(lltd)) ^ 1));
 
 	/* All qh's in the queue need to link to the next queue */
 	urbp->qh->link = eurbp->qh->link;
@@ -560,38 +564,43 @@
 
 	nurbp = list_entry(urbp->queue_list.next, struct urb_priv, queue_list);
 
-	/* Fix up the toggle for the next URB's */
-	if (!urbp->queued)
-		/* We just set the toggle in uhci_unlink_generic */
-		toggle = usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe), usb_pipeout(urb->pipe));
-	else {
-		/* If we're in the middle of the queue, grab the toggle */
-		/*  from the TD previous to us */
-		purbp = list_entry(urbp->queue_list.prev, struct urb_priv,
-				queue_list);
+	/*
+	 * Fix up the toggle for the following URBs in the queue.
+	 * Only needed for bulk and interrupt: control and isochronous
+	 * endpoints don't propagate toggles between messages.
+	 */
+	if (usb_pipebulk(urb->pipe) || usb_pipeint(urb->pipe)) {
+		if (!urbp->queued)
+			/* We just set the toggle in uhci_unlink_generic */
+			toggle = usb_gettoggle(urb->dev,
+					usb_pipeendpoint(urb->pipe),
+					usb_pipeout(urb->pipe));
+		else {
+			/* If we're in the middle of the queue, grab the */
+			/* toggle from the TD previous to us */
+			purbp = list_entry(urbp->queue_list.prev,
+					struct urb_priv, queue_list);
+			pltd = list_entry(purbp->td_list.prev,
+					struct uhci_td, list);
+			toggle = uhci_toggle(td_token(pltd)) ^ 1;
+		}
+
+		head = &urbp->queue_list;
+		tmp = head->next;
+		while (head != tmp) {
+			struct urb_priv *turbp;
+
+			turbp = list_entry(tmp, struct urb_priv, queue_list);
+			tmp = tmp->next;
+
+			if (!turbp->queued)
+				break;
+			toggle = uhci_fixup_toggle(turbp->urb, toggle);
+		}
 
-		pltd = list_entry(purbp->td_list.prev, struct uhci_td, list);
-
-		toggle = uhci_toggle(td_token(pltd)) ^ 1;
-	}
-
-	head = &urbp->queue_list;
-	tmp = head->next;
-	while (head != tmp) {
-		struct urb_priv *turbp;
-
-		turbp = list_entry(tmp, struct urb_priv, queue_list);
-
-		tmp = tmp->next;
-
-		if (!turbp->queued)
-			break;
-
-		toggle = uhci_fixup_toggle(turbp->urb, toggle);
+		usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe),
+				usb_pipeout(urb->pipe), toggle);
 	}
-
-	usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe),
-		usb_pipeout(urb->pipe), toggle);
 
 	if (!urbp->queued) {
 		struct uhci_qh *pqh;
diff -Nru a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c
--- a/drivers/usb/input/aiptek.c	Tue Feb  3 19:45:35 2004
+++ b/drivers/usb/input/aiptek.c	Tue Feb  3 19:45:35 2004
@@ -318,6 +318,7 @@
 	aiptek->dev.id.vendor = dev->descriptor.idVendor;
 	aiptek->dev.id.product = dev->descriptor.idProduct;
 	aiptek->dev.id.version = dev->descriptor.bcdDevice;
+	aiptek->dev.dev = &intf->dev;
 	aiptek->usbdev = dev;
 
 	endpoint = &intf->altsetting[0].endpoint[0].desc;
diff -Nru a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
--- a/drivers/usb/input/hid-core.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/usb/input/hid-core.c	Tue Feb  3 19:45:29 2004
@@ -1357,6 +1357,9 @@
 #define USB_VENDOR_ID_BERKSHIRE		0x0c98
 #define USB_DEVICE_ID_BERKSHIRE_PCWD	0x1140
 
+#define USB_VENDOR_ID_ALPS		0x0433
+#define USB_DEVICE_ID_IBM_GAMEPAD	0x1101
+
 struct hid_blacklist {
 	__u16 idVendor;
 	__u16 idProduct;
@@ -1366,6 +1369,7 @@
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 1, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 2, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 3, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 1, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 2, HID_QUIRK_IGNORE },
@@ -1407,6 +1411,7 @@
 	{ USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK },
 	{ USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD },
 	{ 0, 0 }
 };
 
@@ -1525,9 +1530,9 @@
 				continue;
 			if (!(hid->urbout = usb_alloc_urb(0, GFP_KERNEL)))
 				goto fail;
-			pipe = usb_sndbulkpipe(dev, endpoint->bEndpointAddress);
-			usb_fill_bulk_urb(hid->urbout, dev, pipe, hid->outbuf, 0,
-					  hid_irq_out, hid);
+			pipe = usb_sndintpipe(dev, endpoint->bEndpointAddress);
+			usb_fill_int_urb(hid->urbout, dev, pipe, hid->outbuf, 0,
+					  hid_irq_out, hid, 1);
 			hid->urbout->transfer_dma = hid->outbuf_dma;
 			hid->urbout->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
 		}
@@ -1546,6 +1551,7 @@
 	hid->version = le16_to_cpu(hdesc->bcdHID);
 	hid->country = hdesc->bCountryCode;
 	hid->dev = dev;
+	hid->intf = intf;
 	hid->ifnum = interface->desc.bInterfaceNumber;
 
 	hid->name[0] = 0;
diff -Nru a/drivers/usb/input/hid-ff.c b/drivers/usb/input/hid-ff.c
--- a/drivers/usb/input/hid-ff.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/input/hid-ff.c	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *  Not all hid devices use the same protocol. For example, some use PID,
  *  other use their own proprietary procotol.
  *
- *  Copyright (c) 2002 Johann Deneux
+ *  Copyright (c) 2002-2004 Johann Deneux
  */
 
 /*
@@ -24,7 +24,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  *
  * Should you need to contact me, the author, you can do so by
- * e-mail - mail your message to <deneux@ifrance.com>
+ * e-mail - mail your message to <johann.deneux@it.uu.se>
  */
 
 #include <linux/input.h>
@@ -52,8 +52,9 @@
 
 static struct hid_ff_initializer inits[] = {
 #ifdef CONFIG_LOGITECH_FF
-	{0x46d, 0xc211, hid_lgff_init},
-	{0x46d, 0xc283, hid_lgff_init},
+	{0x46d, 0xc211, hid_lgff_init}, // Logitech Cordless rumble pad
+	{0x46d, 0xc283, hid_lgff_init}, // Logitech Wingman Force 3d
+	{0x46d, 0xc295, hid_lgff_init},	// Logitech MOMO force wheel
 #endif
 #ifdef CONFIG_HID_PID
 	{0x45e, 0x001b, hid_pid_init},
diff -Nru a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c
--- a/drivers/usb/input/hid-input.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/input/hid-input.c	Tue Feb  3 19:45:17 2004
@@ -40,13 +40,13 @@
 	  0,  0,  0,  0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38,
 	 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44,  2,  3,
 	  4,  5,  6,  7,  8,  9, 10, 11, 28,  1, 14, 15, 57, 12, 13, 26,
-	 27, 43, 84, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64,
+	 27, 43, 43, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64,
 	 65, 66, 67, 68, 87, 88, 99, 70,119,110,102,104,111,107,109,106,
 	105,108,103, 69, 98, 55, 74, 78, 96, 79, 80, 81, 75, 76, 77, 71,
-	 72, 73, 82, 83, 86,127,116,117, 85, 89, 90, 91, 92, 93, 94, 95,
-	120,121,122,123,134,138,130,132,128,129,131,137,133,135,136,113,
-	115,114,unk,unk,unk,124,unk,181,182,183,184,185,186,187,188,189,
-	190,191,192,193,194,195,196,197,198,unk,unk,unk,unk,unk,unk,unk,
+	 72, 73, 82, 83, 86,127,116,117,183,184,185,186,187,188,189,190,
+	191,192,193,194,134,138,130,132,128,129,131,137,133,135,136,113,
+	115,114,unk,unk,unk,121,unk, 89, 93,124, 92, 94, 95,unk,unk,unk,
+	122,123, 90, 91, 85,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,
 	unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,
 	unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,
 	unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,
@@ -592,6 +592,7 @@
 				hidinput->input.id.vendor = dev->descriptor.idVendor;
 				hidinput->input.id.product = dev->descriptor.idProduct;
 				hidinput->input.id.version = dev->descriptor.bcdDevice;
+				hidinput->input.dev = &hid->intf->dev;
 			}
 
 			for (i = 0; i < report->maxfield; i++)
diff -Nru a/drivers/usb/input/hid-lgff.c b/drivers/usb/input/hid-lgff.c
--- a/drivers/usb/input/hid-lgff.c	Tue Feb  3 19:45:35 2004
+++ b/drivers/usb/input/hid-lgff.c	Tue Feb  3 19:45:35 2004
@@ -6,7 +6,7 @@
  * - WingMan Cordless RumblePad
  * - WingMan Force 3D
  *
- *  Copyright (c) 2002 Johann Deneux
+ *  Copyright (c) 2002-2004 Johann Deneux
  */
 
 /*
@@ -25,13 +25,13 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  *
  * Should you need to contact me, the author, you can do so by
- * e-mail - mail your message to <deneux@ifrance.com>
+ * e-mail - mail your message to <johann.deneux@it.uu.se>
  */
 
 #include <linux/input.h>
 #include <linux/sched.h>
 
-#define DEBUG
+//#define DEBUG
 #include <linux/usb.h>
 
 #include <linux/circ_buf.h>
@@ -179,8 +179,7 @@
 		kfree(private);
 		return -1;
 	}
-	private->rumble->field[0]->value[0] = 0x03;
-	private->rumble->field[0]->value[1] = 0x42;
+	private->rumble->field[0]->value[0] = 0x42;
 
 
 	private->condition = hid_lgff_duplicate_report(report);
@@ -207,7 +206,7 @@
 	add_timer(&private->timer);  /*TODO: only run the timer when at least
 				       one effect is playing */
 
-	printk(KERN_INFO "Force feedback for Logitech force feedback devices by Johann Deneux <deneux@ifrance.com>\n");
+	printk(KERN_INFO "Force feedback for Logitech force feedback devices by Johann Deneux <johann.deneux@it.uu.se>\n");
 
 	return 0;
 }
@@ -254,7 +253,7 @@
 	signed short* ff;
 	u16 idVendor = hid->dev->descriptor.idVendor;
 	u16 idProduct = hid->dev->descriptor.idProduct;
-	struct hid_input *hidinput = list_entry(&hid->inputs, struct hid_input, list);
+	struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);
 
 	while (dev->idVendor && (idVendor != dev->idVendor || idProduct != dev->idProduct))
 		dev++;
@@ -511,10 +510,10 @@
 		hid_submit_report(hid, lgff->constant, USB_DIR_OUT);
 	}
 
-	if (left != lgff->rumble->field[0]->value[3]
-	    || right != lgff->rumble->field[0]->value[4]) {
-		lgff->rumble->field[0]->value[3] = left;
-		lgff->rumble->field[0]->value[4] = right;
+	if (left != lgff->rumble->field[0]->value[2]
+	    || right != lgff->rumble->field[0]->value[3]) {
+		lgff->rumble->field[0]->value[2] = left;
+		lgff->rumble->field[0]->value[3] = right;
 		dbg("(left,right)=(%04x, %04x)", left, right);
 		hid_submit_report(hid, lgff->rumble, USB_DIR_OUT);
 	}
diff -Nru a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h
--- a/drivers/usb/input/hid.h	Tue Feb  3 19:45:16 2004
+++ b/drivers/usb/input/hid.h	Tue Feb  3 19:45:16 2004
@@ -342,6 +342,7 @@
 	struct hid_report_enum report_enum[HID_REPORT_TYPES];
 
 	struct usb_device *dev;						/* USB device */
+	struct usb_interface *intf;					/* USB interface */
 	int ifnum;							/* USB interface number */
 
 	unsigned long iofl;						/* I/O flags (CTRL_RUNNING, OUT_RUNNING) */
@@ -448,6 +449,7 @@
 void hid_submit_report(struct hid_device *, struct hid_report *, unsigned char dir);
 void hid_init_reports(struct hid_device *hid);
 int hid_find_report_by_usage(struct hid_device *hid, __u32 wanted_usage, struct hid_report **report, int type);
+int hid_wait_io(struct hid_device* hid);
 
 
 #ifdef CONFIG_HID_FF
diff -Nru a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c
--- a/drivers/usb/input/hiddev.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/input/hiddev.c	Tue Feb  3 19:45:17 2004
@@ -509,6 +509,7 @@
 			return -EINVAL;
 
 		hid_submit_report(hid, report, USB_DIR_IN);
+		hid_wait_io(hid);
 
 		return 0;
 
diff -Nru a/drivers/usb/input/kbtab.c b/drivers/usb/input/kbtab.c
--- a/drivers/usb/input/kbtab.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/usb/input/kbtab.c	Tue Feb  3 19:45:16 2004
@@ -172,6 +172,7 @@
 	kbtab->dev.id.vendor = dev->descriptor.idVendor;
 	kbtab->dev.id.product = dev->descriptor.idProduct;
 	kbtab->dev.id.version = dev->descriptor.bcdDevice;
+	kbtab->dev.dev = &intf->dev;
 	kbtab->usbdev = dev;
 
 	endpoint = &intf->altsetting[0].endpoint[0].desc;
diff -Nru a/drivers/usb/input/powermate.c b/drivers/usb/input/powermate.c
--- a/drivers/usb/input/powermate.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/usb/input/powermate.c	Tue Feb  3 19:45:29 2004
@@ -54,7 +54,11 @@
 #define UPDATE_PULSE_AWAKE       (1<<2)
 #define UPDATE_PULSE_MODE        (1<<3)
 
-#define POWERMATE_PAYLOAD_SIZE 3
+/* at least two versions of the hardware exist, with differing payload
+   sizes. the first three bytes always contain the "interesting" data in
+   the relevant format. */
+#define POWERMATE_PAYLOAD_SIZE_MAX 6
+#define POWERMATE_PAYLOAD_SIZE_MIN 3
 struct powermate_device {
 	signed char *data;
 	dma_addr_t data_dma;
@@ -269,7 +273,7 @@
 
 static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_device *pm)
 {
-	pm->data = usb_buffer_alloc(udev, POWERMATE_PAYLOAD_SIZE,
+	pm->data = usb_buffer_alloc(udev, POWERMATE_PAYLOAD_SIZE_MAX,
 				    SLAB_ATOMIC, &pm->data_dma);
 	if (!pm->data)
 		return -1;
@@ -284,7 +288,7 @@
 static void powermate_free_buffers(struct usb_device *udev, struct powermate_device *pm)
 {
 	if (pm->data)
-		usb_buffer_free(udev, POWERMATE_PAYLOAD_SIZE,
+		usb_buffer_free(udev, POWERMATE_PAYLOAD_SIZE_MAX,
 				pm->data, pm->data_dma);
 	if (pm->configcr)
 		usb_buffer_free(udev, sizeof(*(pm->configcr)),
@@ -347,12 +351,14 @@
 	pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);
 	maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
 
-	if (maxp != POWERMATE_PAYLOAD_SIZE)
-		printk("powermate: Expected payload of %d bytes, found %d bytes!\n", POWERMATE_PAYLOAD_SIZE, maxp);
-
+	if(maxp < POWERMATE_PAYLOAD_SIZE_MIN || maxp > POWERMATE_PAYLOAD_SIZE_MAX){
+		printk("powermate: Expected payload of %d--%d bytes, found %d bytes!\n",
+			POWERMATE_PAYLOAD_SIZE_MIN, POWERMATE_PAYLOAD_SIZE_MAX, maxp);
+		maxp = POWERMATE_PAYLOAD_SIZE_MAX;
+	}
 
 	usb_fill_int_urb(pm->irq, udev, pipe, pm->data,
-			 POWERMATE_PAYLOAD_SIZE, powermate_irq,
+			 maxp, powermate_irq,
 			 pm, endpoint->bInterval);
 	pm->irq->transfer_dma = pm->data_dma;
 	pm->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
@@ -382,6 +388,7 @@
 	pm->input.id.product = udev->descriptor.idProduct;
 	pm->input.id.version = udev->descriptor.bcdDevice;
 	pm->input.event = powermate_input_event;
+	pm->input.dev = &intf->dev;
 
 	input_register_device(&pm->input);
 
diff -Nru a/drivers/usb/input/usbkbd.c b/drivers/usb/input/usbkbd.c
--- a/drivers/usb/input/usbkbd.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/usb/input/usbkbd.c	Tue Feb  3 19:45:42 2004
@@ -49,13 +49,13 @@
 	  0,  0,  0,  0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38,
 	 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44,  2,  3,
 	  4,  5,  6,  7,  8,  9, 10, 11, 28,  1, 14, 15, 57, 12, 13, 26,
-	 27, 43, 84, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64,
+	 27, 43, 43, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64,
 	 65, 66, 67, 68, 87, 88, 99, 70,119,110,102,104,111,107,109,106,
 	105,108,103, 69, 98, 55, 74, 78, 96, 79, 80, 81, 75, 76, 77, 71,
-	 72, 73, 82, 83, 86,127,116,117, 85, 89, 90, 91, 92, 93, 94, 95,
-	120,121,122,123,134,138,130,132,128,129,131,137,133,135,136,113,
-	115,114,  0,  0,  0,124,  0,181,182,183,184,185,186,187,188,189,
-	190,191,192,193,194,195,196,197,198,  0,  0,  0,  0,  0,  0,  0,
+	 72, 73, 82, 83, 86,127,116,117,183,184,185,186,187,188,189,190,
+	191,192,193,194,134,138,130,132,128,129,131,137,133,135,136,113,
+	115,114,  0,  0,  0,121,  0, 89, 93,124, 92, 94, 95,  0,  0,  0,
+	122,123, 90, 91, 85,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
@@ -299,6 +299,7 @@
 	kbd->dev.id.vendor = dev->descriptor.idVendor;
 	kbd->dev.id.product = dev->descriptor.idProduct;
 	kbd->dev.id.version = dev->descriptor.bcdDevice;
+	kbd->dev.dev = &iface->dev;
 
 	if (!(buf = kmalloc(63, GFP_KERNEL))) {
 		usb_free_urb(kbd->irq);
diff -Nru a/drivers/usb/input/usbmouse.c b/drivers/usb/input/usbmouse.c
--- a/drivers/usb/input/usbmouse.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/usb/input/usbmouse.c	Tue Feb  3 19:45:42 2004
@@ -183,6 +183,7 @@
 	mouse->dev.id.vendor = dev->descriptor.idVendor;
 	mouse->dev.id.product = dev->descriptor.idProduct;
 	mouse->dev.id.version = dev->descriptor.bcdDevice;
+	mouse->dev.dev = &intf->dev;
 
 	if (!(buf = kmalloc(63, GFP_KERNEL))) {
 		usb_buffer_free(dev, 8, mouse->data, mouse->data_dma);
diff -Nru a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c
--- a/drivers/usb/input/wacom.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/usb/input/wacom.c	Tue Feb  3 19:45:16 2004
@@ -428,6 +428,7 @@
         { "Wacom Graphire",      8,  10206,  7422,  511, 32, 1, wacom_graphire_irq },
 	{ "Wacom Graphire2 4x5", 8,  10206,  7422,  511, 32, 1, wacom_graphire_irq },
  	{ "Wacom Graphire2 5x7", 8,  13918, 10206,  511, 32, 1, wacom_graphire_irq },
+	{ "Wacom Graphire3",     8,  10208,  7424,  511, 32, 1, wacom_graphire_irq },
   	{ "Wacom Intuos 4x5",   10,  12700, 10360, 1023, 15, 2, wacom_intuos_irq },
  	{ "Wacom Intuos 6x8",   10,  20600, 16450, 1023, 15, 2, wacom_intuos_irq },
  	{ "Wacom Intuos 9x12",  10,  30670, 24130, 1023, 15, 2, wacom_intuos_irq },
@@ -452,6 +453,7 @@
 	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x10) },
 	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x11) },
 	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x12) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x13) },
 	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x20) },
 	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x21) },
 	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x22) },
@@ -578,6 +580,7 @@
 	wacom->dev.id.vendor = dev->descriptor.idVendor;
 	wacom->dev.id.product = dev->descriptor.idProduct;
 	wacom->dev.id.version = dev->descriptor.bcdDevice;
+	wacom->dev.dev = &intf->dev;
 	wacom->usbdev = dev;
 
 	endpoint = &intf->altsetting[0].endpoint[0].desc;
diff -Nru a/drivers/usb/input/xpad.c b/drivers/usb/input/xpad.c
--- a/drivers/usb/input/xpad.c	Tue Feb  3 19:45:26 2004
+++ b/drivers/usb/input/xpad.c	Tue Feb  3 19:45:26 2004
@@ -267,6 +267,7 @@
 	xpad->dev.id.vendor = udev->descriptor.idVendor;
 	xpad->dev.id.product = udev->descriptor.idProduct;
 	xpad->dev.id.version = udev->descriptor.bcdDevice;
+	xpad->dev.dev = &intf->dev;
 	xpad->dev.private = xpad;
 	xpad->dev.name = xpad_device[i].name;
 	xpad->dev.phys = xpad->phys;
diff -Nru a/drivers/usb/media/Kconfig b/drivers/usb/media/Kconfig
--- a/drivers/usb/media/Kconfig	Tue Feb  3 19:45:16 2004
+++ b/drivers/usb/media/Kconfig	Tue Feb  3 19:45:16 2004
@@ -182,24 +182,21 @@
 	tristate "USB W996[87]CF JPEG Dual Mode Camera support"
 	depends on USB && VIDEO_DEV && I2C
 	---help---
-	  Say Y here if you want support for cameras based on
+	  Say Y here if you want support for cameras based on OV681 or
 	  Winbond W9967CF/W9968CF JPEG USB Dual Mode Camera Chips.
 	
 	  This driver has an optional plugin, which is distributed as a
-	  separate module only (released under GPL). It contains code that 
-	  allows you to use higher resolutions and framerates, and can't
-	  be included into the official Linux kernel for performance 
-	  purposes.
-	  At the moment the driver needs a third-part module for the CMOS 
+	  separate module only (released under GPL). It allows to use higher 
+	  resolutions and framerates, but cannot be included in the official 
+	  Linux kernel for performance purposes.
+	  At the moment the driver needs a third-party module for the CMOS 
 	  sensors, which is available on internet: it is recommended to read
 	  <file:Documentation/usb/w9968cf.txt> for more informations and for
 	  a list of supported cameras.
 	
-	  This driver uses the Video For Linux and the I2C APIs. 
-	  You must say Y or M to both "Video For Linux" and 
-	  "I2C Support" to use this driver.
-	  Information on this API and pointers to "v4l" programs may be found
-	  on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
+	  This driver uses the Video For Linux and the I2C APIs. You must say
+	  Y or M to both "Video For Linux" and "I2C Support" to use this 
+	  driver.
 	
 	  This code is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
diff -Nru a/drivers/usb/media/dabusb.c b/drivers/usb/media/dabusb.c
--- a/drivers/usb/media/dabusb.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/usb/media/dabusb.c	Tue Feb  3 19:45:29 2004
@@ -781,17 +781,25 @@
 
 static void dabusb_disconnect (struct usb_interface *intf)
 {
+	wait_queue_t __wait;
 	pdabusb_t s = usb_get_intfdata (intf);
 
 	dbg("dabusb_disconnect");
-
+	
+	init_waitqueue_entry(&__wait, current);
+	
 	usb_set_intfdata (intf, NULL);
 	if (s) {
 		usb_deregister_dev (intf, &dabusb_class);
 		s->remove_pending = 1;
 		wake_up (&s->wait);
+		add_wait_queue(&s->remove_ok, &__wait);
+		set_current_state(TASK_UNINTERRUPTIBLE);
 		if (s->state == _started)
-			sleep_on (&s->remove_ok);
+			schedule();
+		current->state = TASK_RUNNING;
+		remove_wait_queue(&s->remove_ok, &__wait);
+		
 		s->usbdev = NULL;
 		s->overruns = 0;
 	}
diff -Nru a/drivers/usb/media/w9968cf.c b/drivers/usb/media/w9968cf.c
--- a/drivers/usb/media/w9968cf.c	Tue Feb  3 19:45:35 2004
+++ b/drivers/usb/media/w9968cf.c	Tue Feb  3 19:45:35 2004
@@ -1,14 +1,14 @@
 /***************************************************************************
  * Video4Linux driver for W996[87]CF JPEG USB Dual Mode Camera Chip.       *
  *                                                                         *
- * Copyright (C) 2002 2003 by Luca Risolia <luca_ing@libero.it>            *
+ * Copyright (C) 2002-2004 by Luca Risolia <luca.risolia@studio.unibo.it>  *
  *                                                                         *
  * - Memory management code from bttv driver by Ralph Metzler,             *
  *   Marcus Metzler and Gerd Knorr.                                        *
  * - I2C interface to kernel, high-level CMOS sensor control routines and  *
  *   some symbolic names from OV511 driver by Mark W. McClelland.          *
  * - Low-level I2C fast write function by Piotr Czerczak.                  *
- * - Low-level I2C read function by FrÃ©dÃ©ric Jouault.                      *
+ * - Low-level I2C read function by Frederic Jouault.                      *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify    *
  * it under the terms of the GNU General Public License as published by    *
@@ -27,6 +27,7 @@
 
 #include <linux/version.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/fs.h>
@@ -48,81 +49,86 @@
 
 
 /****************************************************************************
- * Modules paramaters                                                       *
+ * Module macros and paramaters                                             *
  ****************************************************************************/
 
-static u8 vppmod_load = W9968CF_VPPMOD_LOAD;
-static u8 simcams = W9968CF_SIMCAMS;
-static int video_nr[]={[0 ... W9968CF_MAX_DEVICES-1] = -1}; /* -1=first free */
-static u16 packet_size[] = {[0 ... W9968CF_MAX_DEVICES-1]=W9968CF_PACKET_SIZE};
-static u8 max_buffers[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_BUFFERS};
-static u8 double_buffer[] = {[0 ... W9968CF_MAX_DEVICES-1] = 
-                             W9968CF_DOUBLE_BUFFER};
-static u8 clamping[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_CLAMPING};
-static u8 filter_type[]= {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_FILTER_TYPE};
-static u8 largeview[]= {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_LARGEVIEW};
-static u8 decompression[] = {[0 ... W9968CF_MAX_DEVICES-1] = 
-                             W9968CF_DECOMPRESSION};
-static u8 upscaling[]= {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_UPSCALING};
-static u8 force_palette[] = {[0 ... W9968CF_MAX_DEVICES-1] = 0};
-static u8 force_rgb[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_FORCE_RGB};
-static u8 autobright[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_AUTOBRIGHT};
-static u8 autoexp[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_AUTOEXP};
-static u8 lightfreq[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_LIGHTFREQ};
-static u8 bandingfilter[] = {[0 ... W9968CF_MAX_DEVICES-1]=
-                             W9968CF_BANDINGFILTER};
-static int clockdiv[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_CLOCKDIV};
-static u8 backlight[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_BACKLIGHT};
-static u8 mirror[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_MIRROR};
-static u8 sensor_mono[] = {[0 ... W9968CF_MAX_DEVICES-1]=W9968CF_SENSOR_MONO};
-static u16 brightness[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_BRIGHTNESS};
-static u16 hue[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_HUE};
-static u16 colour[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_COLOUR};
-static u16 contrast[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_CONTRAST};
-static u16 whiteness[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_WHITENESS};
+MODULE_AUTHOR(W9968CF_MODULE_AUTHOR" "W9968CF_AUTHOR_EMAIL);
+MODULE_DESCRIPTION(W9968CF_MODULE_NAME" "W9968CF_MODULE_VERSION);
+MODULE_LICENSE(W9968CF_MODULE_LICENSE);
+MODULE_SUPPORTED_DEVICE("Video");
+
+static int vppmod_load = W9968CF_VPPMOD_LOAD;
+static unsigned short simcams = W9968CF_SIMCAMS;
+static short video_nr[]={[0 ... W9968CF_MAX_DEVICES-1] = -1}; /*-1=first free*/
+static unsigned int packet_size[] = {[0 ... W9968CF_MAX_DEVICES-1] = 
+                                     W9968CF_PACKET_SIZE};
+static unsigned short max_buffers[] = {[0 ... W9968CF_MAX_DEVICES-1] = 
+                                       W9968CF_BUFFERS};
+static int double_buffer[] = {[0 ... W9968CF_MAX_DEVICES-1] = 
+                              W9968CF_DOUBLE_BUFFER};
+static int clamping[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_CLAMPING};
+static unsigned short filter_type[]= {[0 ... W9968CF_MAX_DEVICES-1] = 
+                                      W9968CF_FILTER_TYPE};
+static int largeview[]= {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_LARGEVIEW};
+static unsigned short decompression[] = {[0 ... W9968CF_MAX_DEVICES-1] = 
+                                         W9968CF_DECOMPRESSION};
+static int upscaling[]= {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_UPSCALING};
+static unsigned short force_palette[] = {[0 ... W9968CF_MAX_DEVICES-1] = 0};
+static int force_rgb[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_FORCE_RGB};
+static int autobright[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_AUTOBRIGHT};
+static int autoexp[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_AUTOEXP};
+static unsigned short lightfreq[] = {[0 ... W9968CF_MAX_DEVICES-1] = 
+                                     W9968CF_LIGHTFREQ};
+static int bandingfilter[] = {[0 ... W9968CF_MAX_DEVICES-1]=
+                              W9968CF_BANDINGFILTER};
+static short clockdiv[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_CLOCKDIV};
+static int backlight[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_BACKLIGHT};
+static int mirror[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_MIRROR};
+static int monochrome[] = {[0 ... W9968CF_MAX_DEVICES-1]=W9968CF_MONOCHROME};
+static unsigned int brightness[] = {[0 ... W9968CF_MAX_DEVICES-1] = 
+                                    W9968CF_BRIGHTNESS};
+static unsigned int hue[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_HUE};
+static unsigned int colour[]={[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_COLOUR};
+static unsigned int contrast[] = {[0 ... W9968CF_MAX_DEVICES-1] = 
+                                  W9968CF_CONTRAST};
+static unsigned int whiteness[] = {[0 ... W9968CF_MAX_DEVICES-1] = 
+                                   W9968CF_WHITENESS};
 #ifdef W9968CF_DEBUG
-static u8 debug = W9968CF_DEBUG_LEVEL;
-static u8 specific_debug = W9968CF_SPECIFIC_DEBUG;
+static unsigned short debug = W9968CF_DEBUG_LEVEL;
+static int specific_debug = W9968CF_SPECIFIC_DEBUG;
 #endif
 
-MODULE_AUTHOR("Luca Risolia <luca_ing@libero.it>");
-
-MODULE_DESCRIPTION("Video4Linux driver for "
-                   "W996[87]CF JPEG USB Dual Mode Camera Chip");
-
-MODULE_SUPPORTED_DEVICE("Video");
-
-MODULE_LICENSE("GPL");
+static unsigned int param_nv[24]; /* number of values per parameter */
 
-MODULE_PARM(vppmod_load, "i");
-MODULE_PARM(simcams, "i");
-MODULE_PARM(video_nr, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "i");
-MODULE_PARM(packet_size, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "i");
-MODULE_PARM(max_buffers, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "i");
-MODULE_PARM(double_buffer, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "i");
-MODULE_PARM(clamping, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "i");
-MODULE_PARM(filter_type, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "i");
-MODULE_PARM(largeview, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "i");
-MODULE_PARM(decompression, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "i");
-MODULE_PARM(upscaling, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "i");
-MODULE_PARM(force_palette, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "i");
-MODULE_PARM(force_rgb, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "i");
-MODULE_PARM(autobright, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "l");
-MODULE_PARM(autoexp, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "l");
-MODULE_PARM(lightfreq, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "l");
-MODULE_PARM(bandingfilter, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "l");
-MODULE_PARM(clockdiv, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "l");
-MODULE_PARM(backlight, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "l");
-MODULE_PARM(mirror, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "l");
-MODULE_PARM(sensor_mono, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "l");
-MODULE_PARM(brightness, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "l");
-MODULE_PARM(hue, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "l");
-MODULE_PARM(colour, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "l");
-MODULE_PARM(contrast, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "l");
-MODULE_PARM(whiteness, "0-" __MODULE_STRING(W9968CF_MAX_DEVICES) "l");
+module_param(vppmod_load, bool, 0444);
+module_param(simcams, ushort, 0444);
+module_param_array(video_nr, short, param_nv[0], 0444);
+module_param_array(packet_size, uint, param_nv[1], 0444);
+module_param_array(max_buffers, ushort, param_nv[2], 0444);
+module_param_array(double_buffer, bool, param_nv[3], 0444);
+module_param_array(clamping, bool, param_nv[4], 0444);
+module_param_array(filter_type, ushort, param_nv[5], 0444);
+module_param_array(largeview, bool, param_nv[6], 0444);
+module_param_array(decompression, ushort, param_nv[7], 0444);
+module_param_array(upscaling, bool, param_nv[8], 0444);
+module_param_array(force_palette, ushort, param_nv[9], 0444);
+module_param_array(force_rgb, ushort, param_nv[10], 0444);
+module_param_array(autobright, bool, param_nv[11], 0444);
+module_param_array(autoexp, bool, param_nv[12], 0444);
+module_param_array(lightfreq, ushort, param_nv[13], 0444);
+module_param_array(bandingfilter, bool, param_nv[14], 0444);
+module_param_array(clockdiv, short, param_nv[15], 0444);
+module_param_array(backlight, bool, param_nv[16], 0444);
+module_param_array(mirror, bool, param_nv[17], 0444);
+module_param_array(monochrome, bool, param_nv[18], 0444);
+module_param_array(brightness, uint, param_nv[19], 0444);
+module_param_array(hue, uint, param_nv[20], 0444);
+module_param_array(colour, uint, param_nv[21], 0444);
+module_param_array(contrast, uint, param_nv[22], 0444);
+module_param_array(whiteness, uint, param_nv[23], 0444);
 #ifdef W9968CF_DEBUG
-MODULE_PARM(debug, "i");
-MODULE_PARM(specific_debug, "i");
+module_param(debug, ushort, 0444);
+module_param(specific_debug, bool, 0444);
 #endif
 
 MODULE_PARM_DESC(vppmod_load, 
@@ -146,7 +152,7 @@
                  "\n<-1|n[,...]> Specify V4L minor mode number."
                  "\n -1 = use next available (default)"
                  "\n  n = use minor number n (integer >= 0)"
-                 "\nYou can specify " __MODULE_STRING(W9968CF_MAX_DEVICES)
+                 "\nYou can specify up to "__MODULE_STRING(W9968CF_MAX_DEVICES)
                  " cameras this way."
                  "\nFor example:"
                  "\nvideo_nr=-1,2,-1 would assign minor number 2 to"
@@ -160,7 +166,7 @@
                  "(default is "__MODULE_STRING(W9968CF_PACKET_SIZE)")."
                  "\n");
 MODULE_PARM_DESC(max_buffers,
-                 "\n<n[,...]> Only for advanced users."
+                 "\n<n[,...]> For advanced users."
                  "\nSpecify the maximum number of video frame buffers"
                  "\nto allocate for each device, from 2 to "
                  __MODULE_STRING(W9968CF_MAX_BUFFERS)
@@ -203,7 +209,8 @@
                  "\nDefault value is "__MODULE_STRING(W9968CF_UPSCALING)
                  " for every device."
                  "\nIf 'w9968cf-vpp' is not loaded, this paramater is"
-                 " set to 0.");
+                 " set to 0."
+                 "\n");
 MODULE_PARM_DESC(decompression,
                  "\n<0|1|2[,...]> Software video decompression:"
                  "\n- 0 disables decompression (doesn't allow formats needing"
@@ -218,7 +225,8 @@
                  "\nDefault value is "__MODULE_STRING(W9968CF_DECOMPRESSION)
                  " for every device."
                  "\nIf 'w9968cf-vpp' is not loaded, forcing decompression is "
-                 "\nnot allowed; in this case this paramater is set to 2.");
+                 "\nnot allowed; in this case this paramater is set to 2."
+                 "\n");
 MODULE_PARM_DESC(force_palette,
                  "\n<0"
                  "|" __MODULE_STRING(VIDEO_PALETTE_UYVY)
@@ -252,7 +260,8 @@
                  "\nInitial palette is "
                  __MODULE_STRING(W9968CF_PALETTE_DECOMP_ON)"."
                  "\nIf 'w9968cf-vpp' is not loaded, this paramater is"
-                 " set to 9 (UYVY).");
+                 " set to 9 (UYVY)."
+                 "\n");
 MODULE_PARM_DESC(force_rgb, 
                  "\n<0|1[,...]> Read RGB video data instead of BGR:"
                  "\n 1 = use RGB component ordering."
@@ -311,10 +320,11 @@
                  "\nDefault value is "__MODULE_STRING(W9968CF_MIRROR)
                  " for every device."
                  "\n");
-MODULE_PARM_DESC(sensor_mono,
-                 "\n<0|1[,...]> The OV CMOS sensor is monochrome:"
+MODULE_PARM_DESC(monochrome,
+                 "\n<0|1[,...]> Use OV CMOS sensor as monochrome sensor:"
                  "\n 0 = no, 1 = yes"
-                 "\nDefault value is "__MODULE_STRING(W9968CF_SENSOR_MONO)
+                 "\nNot all the sensors support monochrome color."
+                 "\nDefault value is "__MODULE_STRING(W9968CF_MONOCHROME)
                  " for every device."
                  "\n");
 MODULE_PARM_DESC(brightness, 
@@ -346,7 +356,7 @@
 #ifdef W9968CF_DEBUG
 MODULE_PARM_DESC(debug,
                  "\n<n> Debugging information level, from 0 to 6:"
-                 "\n0 = none (be cautious)"
+                 "\n0 = none (use carefully)"
                  "\n1 = critical errors"
                  "\n2 = significant informations"
                  "\n3 = configuration or general messages"
@@ -380,13 +390,12 @@
 static int w9968cf_release(struct inode*, struct file*);
 static ssize_t w9968cf_read(struct file*, char*, size_t, loff_t*);
 static int w9968cf_mmap(struct file*, struct vm_area_struct*);
-static int w9968cf_ioctl(struct inode*, struct file*,
-                         unsigned int, unsigned long);
-static int w9968cf_do_ioctl(struct w9968cf_device*, unsigned int, void*);
+static int w9968cf_ioctl(struct inode*, struct file*, unsigned, unsigned long);
+static int w9968cf_v4l_ioctl(struct inode*, struct file*, unsigned int, void*);
 
 /* USB-specific */
-static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs);
 static int w9968cf_start_transfer(struct w9968cf_device*);
+static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs);
 static int w9968cf_stop_transfer(struct w9968cf_device*);
 static int w9968cf_write_reg(struct w9968cf_device*, u16 value, u16 index);
 static int w9968cf_read_reg(struct w9968cf_device*, u16 index);
@@ -402,6 +411,7 @@
 static int w9968cf_smbus_read_byte(struct w9968cf_device*, u8* v);
 static int w9968cf_smbus_write_ack(struct w9968cf_device*);
 static int w9968cf_smbus_read_ack(struct w9968cf_device*);
+static int w9968cf_smbus_refresh_bus(struct w9968cf_device*);
 static int w9968cf_i2c_adap_read_byte(struct w9968cf_device* cam,
                                       u16 address, u8* value);
 static int w9968cf_i2c_adap_read_byte_data(struct w9968cf_device*, u16 address, 
@@ -436,12 +446,11 @@
 static int w9968cf_sensor_get_control(struct w9968cf_device*,int cid,int *val);
 static inline int w9968cf_sensor_cmd(struct w9968cf_device*, 
                                      unsigned int cmd, void *arg);
-static void w9968cf_sensor_configure(struct w9968cf_device*);
-static int w9968cf_sensor_change_settings(struct w9968cf_device*);
-static int w9968cf_sensor_get_picture(struct w9968cf_device*, 
-                                      struct video_picture*);
-static int w9968cf_sensor_set_picture(struct w9968cf_device*, 
-                                      struct video_picture pict);
+static int w9968cf_sensor_init(struct w9968cf_device*);
+static int w9968cf_sensor_update_settings(struct w9968cf_device*);
+static int w9968cf_sensor_get_picture(struct w9968cf_device*);
+static int w9968cf_sensor_update_picture(struct w9968cf_device*, 
+                                         struct video_picture pict);
 
 /* Other helper functions */
 static void w9968cf_configure_camera(struct w9968cf_device*,struct usb_device*,
@@ -587,8 +596,6 @@
  * Memory management functions                                              *
  ****************************************************************************/
 
-/* Shameless copy from bttv-driver.c */
-
 /* Here we want the physical address of the memory.
    This is used when initializing the contents of the area. */
 static inline unsigned long kvirt_to_pa(unsigned long adr)
@@ -639,7 +646,6 @@
 	}
 	vfree(mem);
 }
-/* End of shameless copy */
 
 
 /*--------------------------------------------------------------------------
@@ -820,9 +826,9 @@
 	}
 
 	for (i = 0; i < urb->number_of_packets; i++) {
-		len    = urb->iso_frame_desc[i].actual_length;
+		len = urb->iso_frame_desc[i].actual_length;
 		status = urb->iso_frame_desc[i].status;
-		pos    = urb->iso_frame_desc[i].offset + urb->transfer_buffer;
+		pos = urb->iso_frame_desc[i].offset + urb->transfer_buffer;
 
 		if (status && len != 0) {
 			DBG(4, "URB failed, error in data packet "
@@ -923,7 +929,6 @@
 	for (i = 0; i < W9968CF_URBS; i++) {
 		urb = usb_alloc_urb(W9968CF_ISO_PACKETS, GFP_KERNEL);
 		cam->urb[i] = urb;
-
 		if (!urb) {
 			for (j = 0; j < i; j++)
 				usb_free_urb(cam->urb[j]);
@@ -953,7 +958,7 @@
 
 	t_size = (w*h*d)/16;
 
-	err = w9968cf_write_reg(cam, 0xbf17, 0x00); /* reset  everything */
+	err = w9968cf_write_reg(cam, 0xbf17, 0x00); /* reset everything */
 	err += w9968cf_write_reg(cam, 0xbf10, 0x00); /* normal operation */
 
 	/* Transfer size */
@@ -1026,11 +1031,12 @@
 	spin_unlock_irqrestore(&cam->urb_lock, lock_flags);
 
 	for (i = W9968CF_URBS-1; i >= 0; i--)
-		if (cam->urb[i])
+		if (cam->urb[i]) {
 			if (!usb_unlink_urb(cam->urb[i])) {
 				usb_free_urb(cam->urb[i]);
 				cam->urb[i] = NULL;
 			}
+		}
 
 	if (cam->disconnected)
 		goto exit;
@@ -1086,8 +1092,7 @@
 
 	res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 1,
 	                      USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-	                      0, index, (void*)buff,
-	                      2, W9968CF_USB_CTRL_TIMEOUT);
+	                      0, index, buff, 2, W9968CF_USB_CTRL_TIMEOUT);
 
 	if (res < 0)
 		DBG(4, "Failed to read a register "
@@ -1099,7 +1104,7 @@
 
 
 /*--------------------------------------------------------------------------
-  Write data to the fast serial bus registers.
+  Write 64-bit data to the fast serial bus registers.
   Return 0 on success, -1 otherwise.
   --------------------------------------------------------------------------*/
 static int w9968cf_write_fsb(struct w9968cf_device* cam, u16* data)
@@ -1112,8 +1117,7 @@
 
 	res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0,
 	                      USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE,
-	                      value, 0x06, (void*)data, 6,
-	                      W9968CF_USB_CTRL_TIMEOUT);
+	                      value, 0x06, data, 6, W9968CF_USB_CTRL_TIMEOUT);
 
 	if (res < 0)
 		DBG(4, "Failed to write the FSB registers "
@@ -1275,6 +1279,22 @@
 }
 
 
+/* This seems to refresh the communication through the serial bus */
+static int w9968cf_smbus_refresh_bus(struct w9968cf_device* cam)
+{
+	int err = 0, j;
+
+	for (j = 1; j <= 10; j++) {
+		err = w9968cf_write_reg(cam, 0x0020, 0x01);
+		err += w9968cf_write_reg(cam, 0x0000, 0x01);
+		if (err)
+			break;
+	}
+
+	return err;
+}
+
+
 /* SMBus protocol: S Addr Wr [A] Subaddr [A] Value [A] P */
 static int 
 w9968cf_i2c_adap_fastwrite_byte_data(struct w9968cf_device* cam, 
@@ -1283,8 +1303,10 @@
 	u16* data = cam->data_buffer;
 	int err = 0;
 
-	 /* Enable SBUS outputs */
-	err += w9968cf_write_reg(cam, 0x0020, 0x01);
+	err += w9968cf_smbus_refresh_bus(cam);
+
+	/* Enable SBUS outputs */
+	err += w9968cf_write_sb(cam, 0x0020);
 
 	data[0] = 0x082f | ((address & 0x80) ? 0x1500 : 0x0);
 	data[0] |= (address & 0x40) ? 0x4000 : 0x0;
@@ -1328,7 +1350,7 @@
 	err += w9968cf_write_fsb(cam, data);
 
 	/* Disable SBUS outputs */
-	err += w9968cf_write_reg(cam, 0x0000, 0x01);
+	err += w9968cf_write_sb(cam, 0x0000);
 
 	if (!err)
 		DBG(5, "I2C write byte data done, addr.0x%04X, subaddr.0x%02X "
@@ -1365,7 +1387,7 @@
 	err += w9968cf_smbus_read_byte(cam, value);
 	err += w9968cf_smbus_write_ack(cam);
 	err += w9968cf_smbus_stop(cam);
- 
+
 	/* Serial data disable */
 	err += w9968cf_write_sb(cam, 0x0000);
 
@@ -1434,8 +1456,8 @@
                        int size, union i2c_smbus_data *data)
 {
 	struct w9968cf_device* cam = i2c_get_adapdata(adapter);
-	u8 i, j;
-	int rc = 0, err = 0; 
+	u8 i;
+	int err = 0; 
 
 	switch (addr) {
 		case OV6xx0_SID:
@@ -1451,31 +1473,26 @@
 		addr <<= 1;
 
 		if (read_write == I2C_SMBUS_WRITE)
- 			rc = w9968cf_i2c_adap_write_byte(cam, addr, command);
+ 			err = w9968cf_i2c_adap_write_byte(cam, addr, command);
 		else if (read_write == I2C_SMBUS_READ) 
-			rc = w9968cf_i2c_adap_read_byte(cam,addr, &data->byte);
+			err = w9968cf_i2c_adap_read_byte(cam,addr,&data->byte);
 
 	} else if (size == I2C_SMBUS_BYTE_DATA) {
 		addr <<= 1;
 
 		if (read_write == I2C_SMBUS_WRITE)
- 			rc = w9968cf_i2c_adap_fastwrite_byte_data(cam, addr,
+ 			err = w9968cf_i2c_adap_fastwrite_byte_data(cam, addr,
 			                                  command, data->byte);
 		else if (read_write == I2C_SMBUS_READ) {
 			for (i = 1; i <= W9968CF_I2C_RW_RETRIES; i++) {
-				rc = w9968cf_i2c_adap_read_byte_data(cam, addr, 
+				err = w9968cf_i2c_adap_read_byte_data(cam,addr,
 				                         command, &data->byte);
-				if (rc < 0) {
-					/* Work around: this seems to wake up  
-					   the EEPROM from the stall state */
-					for (j = 0; j <= 10; j++) {
-					   err += w9968cf_write_sb(cam,0x0020);
-					   err += w9968cf_write_sb(cam,0x0000);
-					   if (err)
-					   	break;
+				if (err) {
+					if (w9968cf_smbus_refresh_bus(cam)) {
+						err = -EIO;
+						break;
 					}
-				}
-				else
+				} else
 					break;
 			}
 
@@ -1487,11 +1504,7 @@
 		return -EINVAL;
 	}
 
-	/* This works around a bug in the I2C core */
-	if (rc > 0)
-		rc = 0;
-
-	return rc;
+	return err;
 }
 
 
@@ -1507,41 +1520,22 @@
 {
 	struct w9968cf_device* cam = i2c_get_adapdata(client->adapter);
 	const char* clientname = i2c_clientname(client);
-	int id = client->driver->id;
+	int id = client->driver->id, err = 0;
 
 	if (id == I2C_DRIVERID_OVCAMCHIP) {
-		int rc = 0;
-
 		cam->sensor_client = client;
-
-		rc = w9968cf_sensor_cmd(cam, OVCAMCHIP_CMD_INITIALIZE, 
-		                        &cam->sensor_mono);
-		if (rc < 0) {
-			DBG(1, "CMOS sensor initialization failed (rc=%d)",rc);
-			cam->sensor_client = NULL;
-			return rc;
-		}
-
-		if (w9968cf_sensor_cmd(cam, OVCAMCHIP_CMD_Q_SUBTYPE, 
-		                       &cam->sensor) < 0)
-			rc = -EIO;
-		else if (client->addr==OV7xx0_SID || client->addr==OV6xx0_SID)
-			w9968cf_sensor_configure(cam);
-		else
-			rc = -EINVAL;
-
-		if (rc < 0) {
+		err = w9968cf_sensor_init(cam);
+		if (err) {
 			cam->sensor_client = NULL;
-			cam->sensor = CC_UNKNOWN;
-			return rc;
+			return err;
 		}
-	} else	{
-		DBG(4, "Rejected client [%s] with [%s]", 
+	} else {
+		DBG(4, "Rejected client [%s] with driver [%s]", 
 		    clientname, client->driver->name)
-		return -1;
+		return -EINVAL;
 	}
 
-	DBG(2, "I2C attach client [%s] with [%s]",
+	DBG(5, "I2C attach client [%s] with driver [%s]",
 	    clientname, client->driver->name)
 
 	return 0;
@@ -1557,7 +1551,7 @@
 		cam->sensor_client = NULL;
 	}
 
-	DBG(2, "I2C detach [%s]", clientname)
+	DBG(5, "I2C detach client [%s]", clientname)
 
 	return 0;
 }
@@ -1573,7 +1567,7 @@
 
 static int w9968cf_i2c_init(struct w9968cf_device* cam)
 {
-	int rc = 0;
+	int err = 0;
 
 	static struct i2c_algorithm algo = {
 		.name =          "W996[87]CF algorithm",
@@ -1596,15 +1590,15 @@
 	strcpy(cam->i2c_adapter.name, "w9968cf");
 	i2c_set_adapdata(&cam->i2c_adapter, cam);
 
-	DBG(6, "Registering I2C bus with kernel...")
+	DBG(6, "Registering I2C adapter with kernel...")
 
-	rc = i2c_add_adapter(&cam->i2c_adapter);
-	if (rc)
-		DBG(5, "Failed to register the I2C bus.")
+	err = i2c_add_adapter(&cam->i2c_adapter);
+	if (err)
+		DBG(1, "Failed to register the I2C adapter.")
 	else
-		DBG(5, "I2C bus registered.")
+		DBG(5, "I2C adapter registered.")
 
-	return rc;
+	return err;
 }
 
 
@@ -1644,7 +1638,7 @@
   --------------------------------------------------------------------------*/
 static int w9968cf_init_chip(struct w9968cf_device* cam)
 {
-	int err = 0, rc = 0;
+	int err = 0;
 
 	err += w9968cf_write_reg(cam, 0xff00, 0x00); /* power off */
 	err += w9968cf_write_reg(cam, 0xbf10, 0x00); /* power on */
@@ -1679,22 +1673,11 @@
 	err += w9968cf_set_window(cam, cam->window);
 
 	if (err)
-		goto error;
-
-	rc = w9968cf_sensor_change_settings(cam);
-	if (rc)
-		goto error;
-
-	DBG(5, "Chip successfully initialized.");
-	
-	return 0;
-
-error:
-	DBG(1, "Chip initialization failed.")
-	if (err)
-		return err;
+		DBG(1, "Chip initialization failed.")
 	else
-		return rc;
+		DBG(5, "Chip successfully initialized.")
+
+	return err;
 }
 
 
@@ -1706,7 +1689,7 @@
 w9968cf_set_picture(struct w9968cf_device* cam, struct video_picture pict)
 {
 	u16 fmt, hw_depth, hw_palette, reg_v = 0x0000;
-	int err = 0, rc = 0;
+	int err = 0;
 
 	/* Make sure we are using a valid depth */
 	pict.depth = w9968cf_valid_depth(pict.palette);
@@ -1767,12 +1750,10 @@
 	else if (cam->filter_type == 2)
 		reg_v |= 0x000c;
 
-	err = w9968cf_write_reg(cam, reg_v, 0x16);
-	if (err)
+	if ((err = w9968cf_write_reg(cam, reg_v, 0x16)))
 		goto error;
 
-	rc = w9968cf_sensor_set_picture(cam, pict);
-	if (rc)
+	if ((err = w9968cf_sensor_update_picture(cam, pict)))
 		goto error;
 
 	/* If all went well, update the device data structure */
@@ -1791,10 +1772,7 @@
 
 error:
 	DBG(1, "Failed to change picture settings.")
-	if (err)
-		return err;
-	else 
-		return rc;
+	return err;
 }
 
 
@@ -1809,7 +1787,7 @@
 	u16 x, y, w, h, scx, scy, cw, ch, ax, ay;
 	unsigned long fw, fh;
 	struct ovcamchip_window s_win;
-	int err=0, rc=0;
+	int err = 0;
 
 	/* Work around to avoid FP arithmetics */
 	#define __SC(x) ((x) << 10)
@@ -1853,8 +1831,8 @@
 		ch = h;
 	}
 
-	/* Setup the sensor window */
-	s_win.format = SENSOR_FORMAT;
+	/* Setup the window of the sensor */
+	s_win.format = VIDEO_PALETTE_UYVY;
 	s_win.width = cam->maxwidth;
 	s_win.height = cam->maxheight;
 	s_win.quarter = 0; /* full progressive video */
@@ -1883,7 +1861,7 @@
 				s_win.clockdiv = W9968CF_DEF_CLOCKDIVISOR;
 		}
 
-	/* We have to scale win.x and win.y offsets */	
+	/* We have to scale win.x and win.y offsets */
 	if ( (cam->largeview && !(cam->vpp_flag & VPP_UPSCALE))
 	     || (cam->vpp_flag & VPP_UPSCALE) ) {
 		ax = __SC(win.x)/fw;
@@ -1914,7 +1892,7 @@
 	y = ay + s_win.y;
 
 	/* Go ! */
-	if ((rc = w9968cf_sensor_cmd(cam, OVCAMCHIP_CMD_S_MODE, &s_win)))
+	if ((err = w9968cf_sensor_cmd(cam, OVCAMCHIP_CMD_S_MODE, &s_win)))
 		goto error;
 
 	err += w9968cf_write_reg(cam, scx + x, 0x10);
@@ -1959,10 +1937,7 @@
 
 error:
 	DBG(1, "Failed to change the capture area size.")
-	if (err)
-		return err;
-	else
-		return rc;
+	return err;
 }
 
 
@@ -2177,173 +2152,192 @@
 w9968cf_sensor_set_control(struct w9968cf_device* cam, int cid, int val)
 {
 	struct ovcamchip_control ctl;
-	int rc;
+	int err;
 
 	ctl.id = cid;
 	ctl.value = val;
 
-	rc = w9968cf_sensor_cmd(cam, OVCAMCHIP_CMD_S_CTRL, &ctl);
+	err = w9968cf_sensor_cmd(cam, OVCAMCHIP_CMD_S_CTRL, &ctl);
 
-	return rc;
+	return err;
 }
 
+
 static int 
-w9968cf_sensor_get_control(struct w9968cf_device* cam, int cid, int *val)
+w9968cf_sensor_get_control(struct w9968cf_device* cam, int cid, int* val)
 {
 	struct ovcamchip_control ctl;
-	int rc;
+	int err;
 
 	ctl.id = cid;
 
-	rc = w9968cf_sensor_cmd(cam, OVCAMCHIP_CMD_G_CTRL, &ctl);
-	if (rc >= 0)
+	err = w9968cf_sensor_cmd(cam, OVCAMCHIP_CMD_G_CTRL, &ctl);
+	if (!err)
 		*val = ctl.value;
 
-	return rc;
+	return err;
 }
 
 
 static inline int
-w9968cf_sensor_cmd(struct w9968cf_device* cam, unsigned int cmd, void *arg)
+w9968cf_sensor_cmd(struct w9968cf_device* cam, unsigned int cmd, void* arg)
 {
 	struct i2c_client* c = cam->sensor_client;
+	int rc = 0;
 
-	DBG(6, "Executing CMOS sensor command...")
-
-	if (c && c->driver->command)
-		return c->driver->command(cam->sensor_client, cmd, arg);
-	else
+	if (c->driver->command) {
+		rc = c->driver->command(cam->sensor_client, cmd, arg);
+		/* The I2C driver returns -EPERM on non-supported controls */
+		return (rc < 0 && rc != -EPERM) ? rc : 0;
+	} else
 		return -ENODEV;
 }
 
 
 /*--------------------------------------------------------------------------
-  Change some settings of the CMOS sensor.
-  Returns: 0 for success, a negative number otherwise.
+  Update some settings of the CMOS sensor.
+  Returns: 0 on success, a negative number otherwise.
   --------------------------------------------------------------------------*/
-static int w9968cf_sensor_change_settings(struct w9968cf_device* cam)
+static int w9968cf_sensor_update_settings(struct w9968cf_device* cam)
 {
-	int rc;
+	int err = 0;
 
 	/* Auto brightness */
-	rc = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_AUTOBRIGHT, 
-	                                cam->auto_brt);
-	if (SENSOR_FATAL_ERROR(rc))
-		return rc;
+	err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_AUTOBRIGHT, 
+	                                 cam->auto_brt);
+	if (err)
+		return err;
 
 	/* Auto exposure */
-	rc = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_AUTOEXP, 
-	                                cam->auto_exp);
-	if (SENSOR_FATAL_ERROR(rc))
-		return rc;
+	err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_AUTOEXP, 
+	                                 cam->auto_exp);
+	if (err)
+		return err;
 
 	/* Banding filter */
-	rc = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_BANDFILT, 
-	                                cam->bandfilt);
-	if (SENSOR_FATAL_ERROR(rc))
-		return rc;
+	err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_BANDFILT, 
+	                                 cam->bandfilt);
+	if (err)
+		return err;
 
 	/* Light frequency */
-	rc = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_FREQ,
-	                                cam->lightfreq);
-	if (SENSOR_FATAL_ERROR(rc))
-		return rc;
+	err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_FREQ,
+	                                 cam->lightfreq);
+	if (err)
+		return err;
 
 	/* Back light */
-	rc = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_BACKLIGHT,
-	                                cam->backlight);
-	if (SENSOR_FATAL_ERROR(rc))
-		return rc;
+	err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_BACKLIGHT,
+	                                 cam->backlight);
+	if (err)
+		return err;
 
 	/* Mirror */
-	rc = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_MIRROR,
-	                                cam->mirror);
-	if (SENSOR_FATAL_ERROR(rc))
-		return rc;
+	err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_MIRROR,
+	                                 cam->mirror);
+	if (err)
+		return err;
 
 	return 0;
 }
 
 
 /*--------------------------------------------------------------------------
-  Get some current picture settings from the CMOS sensor.
-  Returns: 0 for success, a negative number otherwise.
+  Get some current picture settings from the CMOS sensor and update the
+  internal 'picture' structure of the camera.
+  Returns: 0 on success, a negative number otherwise.
   --------------------------------------------------------------------------*/
-static int
-w9968cf_sensor_get_picture(struct w9968cf_device* cam, 
-                           struct video_picture* pict)
+static int w9968cf_sensor_get_picture(struct w9968cf_device* cam)
 {
-	int rc, v;
+	int err, v;
+
+	err = w9968cf_sensor_get_control(cam, OVCAMCHIP_CID_CONT, &v);
+	if (err)
+		return err;
+	cam->picture.contrast = v;
 
-	/* Don't return error if a setting is unsupported, or rest of settings
-	   will not be performed */
+	err = w9968cf_sensor_get_control(cam, OVCAMCHIP_CID_BRIGHT, &v);
+	if (err)
+		return err;
+	cam->picture.brightness = v;
 
-	rc = w9968cf_sensor_get_control(cam, OVCAMCHIP_CID_CONT, &v);
-	if (SENSOR_FATAL_ERROR(rc))
-		return rc;
-	pict->contrast = v;
-
-	rc = w9968cf_sensor_get_control(cam, OVCAMCHIP_CID_BRIGHT, &v);
-	if (SENSOR_FATAL_ERROR(rc))
-		return rc;
-	pict->brightness = v;
-
-	rc = w9968cf_sensor_get_control(cam, OVCAMCHIP_CID_SAT, &v);
-	if (SENSOR_FATAL_ERROR(rc))
-		return rc;
-	pict->colour = v;
-
-	rc = w9968cf_sensor_get_control(cam, OVCAMCHIP_CID_HUE, &v);
-	if (SENSOR_FATAL_ERROR(rc))
-		return rc;
-	pict->hue = v;
+	err = w9968cf_sensor_get_control(cam, OVCAMCHIP_CID_SAT, &v);
+	if (err)
+		return err;
+	cam->picture.colour = v;
 
-	pict->whiteness = W9968CF_WHITENESS; /* to do! */
+	err = w9968cf_sensor_get_control(cam, OVCAMCHIP_CID_HUE, &v);
+	if (err)
+		return err;
+	cam->picture.hue = v;
 
 	DBG(5, "Got picture settings from the CMOS sensor.")
 
 	PDBGG("Brightness, contrast, hue, colour, whiteness are "
-	      "%d,%d,%d,%d,%d.", pict->brightness, pict->contrast,
-	      pict->hue, pict->colour, pict->whiteness)
+	      "%d,%d,%d,%d,%d.", cam->picture.brightness,cam->picture.contrast,
+	      cam->picture.hue, cam->picture.colour, cam->picture.whiteness)
 
 	return 0;
 }
 
 
 /*--------------------------------------------------------------------------
-  Change picture settings of the CMOS sensor.
-  Returns: 0 for success, a negative number otherwise.
+  Update picture settings of the CMOS sensor.
+  Returns: 0 on success, a negative number otherwise.
   --------------------------------------------------------------------------*/
 static int
-w9968cf_sensor_set_picture(struct w9968cf_device* cam, 
-                           struct video_picture pict)
+w9968cf_sensor_update_picture(struct w9968cf_device* cam, 
+                              struct video_picture pict)
 {
-	int rc;
-
-	rc = w9968cf_sensor_set_control(cam,OVCAMCHIP_CID_CONT, pict.contrast);
-	if (SENSOR_FATAL_ERROR(rc))
-		return rc;
+	int err = 0;
 
-	if (!cam->auto_brt) {
-		rc = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_BRIGHT, 
-	                                        pict.brightness);
-		if (SENSOR_FATAL_ERROR(rc))
-			return rc;
+	if ((!cam->sensor_initialized)
+	    || pict.contrast != cam->picture.contrast) {
+		err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_CONT,
+		                                 pict.contrast);
+		if (err)
+			goto fail;
+		DBG(4, "Contrast changed from %d to %d.",
+		    cam->picture.contrast, pict.contrast)
+		cam->picture.contrast = pict.contrast;
 	}
 
-	rc = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_SAT, pict.colour);
-	if (SENSOR_FATAL_ERROR(rc))
-		return rc;
+	if (((!cam->sensor_initialized) || 
+	    pict.brightness != cam->picture.brightness) && (!cam->auto_brt)) {
+		err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_BRIGHT, 
+		                                 pict.brightness);
+		if (err)
+			goto fail;
+		DBG(4, "Brightness changed from %d to %d.",
+		    cam->picture.brightness, pict.brightness)
+		cam->picture.brightness = pict.brightness;
+	}
 
-	rc = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_HUE, pict.hue);
-	if (SENSOR_FATAL_ERROR(rc))
-		return rc;
+	if ((!cam->sensor_initialized) || pict.colour != cam->picture.colour) {
+		err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_SAT, 
+		                                 pict.colour);
+		if (err)
+			goto fail;
+		DBG(4, "Colour changed from %d to %d.",
+		    cam->picture.colour, pict.colour)
+		cam->picture.colour = pict.colour;
+	}
 
-	PDBGG("Brightness, contrast, hue, colour, whiteness are "
-	      "%d,%d,%d,%d,%d.", pict.brightness, pict.contrast,
-	      pict.hue, pict.colour, pict.whiteness)
+	if ((!cam->sensor_initialized) || pict.hue != cam->picture.hue) {
+		err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_HUE, 
+		                                 pict.hue);
+		if (err)
+			goto fail;
+		DBG(4, "Hue changed from %d to %d.",
+		    cam->picture.hue, pict.hue)
+		cam->picture.hue = pict.hue;
+	}
 
 	return 0;
+
+fail:
+	DBG(4, "Failed to change sensor picture setting.")
+	return err;
 }
 
 
@@ -2353,12 +2347,22 @@
  ****************************************************************************/
 
 /*--------------------------------------------------------------------------
-  This function is called when the CMOS sensor is detected.
+  This function is called when a supported CMOS sensor is detected.
+  Return 0 if the initialization succeeds, a negative number otherwise.
   --------------------------------------------------------------------------*/
-static void w9968cf_sensor_configure(struct w9968cf_device* cam)
+static int w9968cf_sensor_init(struct w9968cf_device* cam)
 {
-	/* NOTE: Make sure width and height are a multiple of 16 */
+	int err = 0;
 
+	if ((err = w9968cf_sensor_cmd(cam, OVCAMCHIP_CMD_INITIALIZE, 
+	                              &cam->monochrome)))
+		goto error;
+
+	if ((err = w9968cf_sensor_cmd(cam, OVCAMCHIP_CMD_Q_SUBTYPE, 
+	                              &cam->sensor)))
+		goto error;
+
+	/* NOTE: Make sure width and height are a multiple of 16 */
 	switch (cam->sensor_client->addr) {
 		case OV6xx0_SID:
 			cam->maxwidth = 352;
@@ -2372,6 +2376,10 @@
 			cam->minwidth = 64;
 			cam->minheight = 48;
 			break;
+		default:
+			DBG(1, "Not supported CMOS sensor detected for %s.",
+			    symbolic(camlist, cam->id))
+			return -EINVAL;
 	}
 
 	/* These values depend on the ones in the ovxxx0.c sources */
@@ -2390,7 +2398,24 @@
 			cam->hs_polarity = 0;
 	}
 
-	DBG(5, "CMOS sensor %s configured.", symbolic(senlist, cam->sensor))
+	if ((err = w9968cf_sensor_update_settings(cam)))
+		goto error;
+
+	if ((err = w9968cf_sensor_update_picture(cam, cam->picture)))
+		goto error;
+
+	cam->sensor_initialized = 1;
+
+	DBG(2, "%s CMOS sensor initialized.", symbolic(senlist, cam->sensor))
+	return 0;
+
+error:
+	cam->sensor_initialized = 0;
+	cam->sensor = CC_UNKNOWN;
+	DBG(1, "CMOS sensor initialization failed for %s (/dev/video%d). "
+	       "Try to detach and attach this device again.",
+	    symbolic(camlist, cam->id), cam->v4ldev->minor)
+	return err;
 }
 
 
@@ -2415,13 +2440,7 @@
 	cam->usbdev = udev;
 	cam->id = mod_id;
 	cam->sensor = CC_UNKNOWN;
-
-	strcpy(cam->v4ldev.name, symbolic(camlist, mod_id));
-	cam->v4ldev.type = VID_TYPE_CAPTURE | VID_TYPE_SCALES;
-	cam->v4ldev.hardware = VID_HARDWARE_W9968CF;
-	cam->v4ldev.fops = &w9968cf_fops;
-	cam->v4ldev.priv = (void*)cam;
-	cam->v4ldev.minor = video_nr[dev_nr];
+	cam->sensor_initialized = 0;
 
 	/* Calculate the alternate setting number (from 1 to 16)
 	   according to the 'packet_size' module parameter */
@@ -2433,66 +2452,66 @@
 
 	cam->max_buffers = (max_buffers[dev_nr] < 2 || 
 	                    max_buffers[dev_nr] > W9968CF_MAX_BUFFERS)
-	                   ? W9968CF_BUFFERS : max_buffers[dev_nr];
+	                   ? W9968CF_BUFFERS : (u8)max_buffers[dev_nr];
 
 	cam->double_buffer = (double_buffer[dev_nr] == 0 || 
 	                      double_buffer[dev_nr] == 1)
-	                     ? double_buffer[dev_nr] : W9968CF_DOUBLE_BUFFER;
+	                     ? (u8)double_buffer[dev_nr]:W9968CF_DOUBLE_BUFFER;
 
 	cam->clamping = (clamping[dev_nr] == 0 || clamping[dev_nr] == 1)
-	                ? clamping[dev_nr] : W9968CF_CLAMPING;
+	                ? (u8)clamping[dev_nr] : W9968CF_CLAMPING;
 	
 	cam->filter_type = (filter_type[dev_nr] == 0 ||
 	                    filter_type[dev_nr] == 1 ||
 	                    filter_type[dev_nr] == 2)
-	                   ? filter_type[dev_nr] : W9968CF_FILTER_TYPE;
+	                   ? (u8)filter_type[dev_nr] : W9968CF_FILTER_TYPE;
 
 	cam->capture = 1;
 
 	cam->largeview = (largeview[dev_nr] == 0 || largeview[dev_nr] == 1)
-	                 ? largeview[dev_nr] : W9968CF_LARGEVIEW;
+	                 ? (u8)largeview[dev_nr] : W9968CF_LARGEVIEW;
 
 	cam->decompression = (decompression[dev_nr] == 0 || 
 	                      decompression[dev_nr] == 1 ||
 	                      decompression[dev_nr] == 2)
-	                     ? decompression[dev_nr] : W9968CF_DECOMPRESSION;
+	                     ? (u8)decompression[dev_nr]:W9968CF_DECOMPRESSION;
 
 	cam->upscaling = (upscaling[dev_nr] == 0 || 
 	                  upscaling[dev_nr] == 1)
-	                 ? upscaling[dev_nr] : W9968CF_UPSCALING;
+	                 ? (u8)upscaling[dev_nr] : W9968CF_UPSCALING;
 
 	cam->auto_brt = (autobright[dev_nr] == 0 || autobright[dev_nr] == 1)
-	                ? autobright[dev_nr] : W9968CF_AUTOBRIGHT;
+	                ? (u8)autobright[dev_nr] : W9968CF_AUTOBRIGHT;
 
 	cam->auto_exp = (autoexp[dev_nr] == 0 || autoexp[dev_nr] == 1)
-	                ? autoexp[dev_nr] : W9968CF_AUTOEXP;
+	                ? (u8)autoexp[dev_nr] : W9968CF_AUTOEXP;
 
 	cam->lightfreq = (lightfreq[dev_nr] == 50 || lightfreq[dev_nr] == 60)
-	                 ? lightfreq[dev_nr] : W9968CF_LIGHTFREQ;
+	                 ? (u8)lightfreq[dev_nr] : W9968CF_LIGHTFREQ;
 
 	cam->bandfilt = (bandingfilter[dev_nr] == 0 || 
 	                 bandingfilter[dev_nr] == 1)
-	                ? bandingfilter[dev_nr] : W9968CF_BANDINGFILTER;
+	                ? (u8)bandingfilter[dev_nr] : W9968CF_BANDINGFILTER;
 
 	cam->backlight = (backlight[dev_nr] == 0 || backlight[dev_nr] == 1)
-	                 ? backlight[dev_nr] : W9968CF_BACKLIGHT;
+	                 ? (u8)backlight[dev_nr] : W9968CF_BACKLIGHT;
 
 	cam->clockdiv = (clockdiv[dev_nr] == -1 || clockdiv[dev_nr] >= 0)
-	                ? clockdiv[dev_nr] : W9968CF_CLOCKDIV;
+	                ? (s8)clockdiv[dev_nr] : W9968CF_CLOCKDIV;
 
 	cam->mirror = (mirror[dev_nr] == 0 || mirror[dev_nr] == 1)
-	              ? mirror[dev_nr] : W9968CF_MIRROR;
+	              ? (u8)mirror[dev_nr] : W9968CF_MIRROR;
 
-	cam->sensor_mono = (sensor_mono[dev_nr]==0 || sensor_mono[dev_nr]==1)
-	                   ? sensor_mono[dev_nr] : W9968CF_SENSOR_MONO;
+	cam->monochrome = (monochrome[dev_nr] == 0 || monochrome[dev_nr] == 1)
+	                  ? monochrome[dev_nr] : W9968CF_MONOCHROME;
 
-	cam->picture.brightness = brightness[dev_nr];
-	cam->picture.hue = hue[dev_nr];
-	cam->picture.colour = colour[dev_nr];
-	cam->picture.contrast = contrast[dev_nr];
-	cam->picture.whiteness = whiteness[dev_nr];
-	if (w9968cf_valid_palette(force_palette[dev_nr])) {
-		cam->picture.palette = force_palette[dev_nr];
+	cam->picture.brightness = (u16)brightness[dev_nr];
+	cam->picture.hue = (u16)hue[dev_nr];
+	cam->picture.colour = (u16)colour[dev_nr];
+	cam->picture.contrast = (u16)contrast[dev_nr];
+	cam->picture.whiteness = (u16)whiteness[dev_nr];
+	if (w9968cf_valid_palette((u16)force_palette[dev_nr])) {
+		cam->picture.palette = (u16)force_palette[dev_nr];
 		cam->force_palette = 1;
 	} else {
 		cam->force_palette = 0;
@@ -2505,7 +2524,7 @@
 	}
 
 	cam->force_rgb = (force_rgb[dev_nr] == 0 || force_rgb[dev_nr] == 1)
-	                 ? force_rgb[dev_nr] : W9968CF_FORCE_RGB;
+	                 ? (u8)force_rgb[dev_nr] : W9968CF_FORCE_RGB;
 
 	cam->window.x = 0;
 	cam->window.y = 0;
@@ -2610,7 +2629,7 @@
 	else
 		DBG(3, "- Clock divisor: %d", cam->clockdiv)
 
-	if (cam->sensor_mono)
+	if (cam->monochrome)
 		DBG(3, "- CMOS sensor used as monochrome.")
 	else
 		DBG(3, "- CMOS sensor not used as monochrome.")
@@ -2626,9 +2645,9 @@
 {
 	down(&w9968cf_devlist_sem);
 
-	DBG(2, "V4L device deregistered: /dev/video%d", cam->v4ldev.minor)
+	DBG(2, "V4L device deregistered: /dev/video%d", cam->v4ldev->minor)
 
-	video_unregister_device(&cam->v4ldev);
+	video_unregister_device(cam->v4ldev);
 	list_del(&cam->v4llist);
 	i2c_del_adapter(&cam->i2c_adapter);
 	w9968cf_deallocate_memory(cam);
@@ -2648,24 +2667,25 @@
 
 static int w9968cf_open(struct inode* inode, struct file* filp)
 {
-	struct w9968cf_device* cam =
-	  (struct w9968cf_device*)video_devdata(filp)->priv;    
+	struct w9968cf_device* cam;
 	int err;
 
+	cam = (struct w9968cf_device*)video_get_drvdata(video_devdata(filp));
+
 	down(&cam->dev_sem);
 
 	if (cam->sensor == CC_UNKNOWN) {
 		DBG(2, "No supported CMOS sensor has been detected by the "
 		       "'ovcamchip' module for the %s (/dev/video%d). Make "
 		       "sure it is loaded *before* the 'w9968cf' module.", 
-		    symbolic(camlist, cam->id),cam->v4ldev.minor)
+		    symbolic(camlist, cam->id), cam->v4ldev->minor)
 		up(&cam->dev_sem);
 		return -ENODEV;
 	}
 
 	if (cam->users) {
 		DBG(2, "%s (/dev/video%d) has been already occupied by '%s'.",
-		    symbolic(camlist, cam->id),cam->v4ldev.minor, cam->command)
+		    symbolic(camlist, cam->id),cam->v4ldev->minor,cam->command)
 		if ((filp->f_flags & O_NONBLOCK)||(filp->f_flags & O_NDELAY)) {
 			up(&cam->dev_sem);
 			return -EWOULDBLOCK;
@@ -2680,8 +2700,8 @@
 		down(&cam->dev_sem);
 	}
 
-	DBG(5, "Opening the %s, /dev/video%d ...",
-	    symbolic(camlist, cam->id), cam->v4ldev.minor)
+	DBG(5, "Opening '%s', /dev/video%d ...",
+	    symbolic(camlist, cam->id), cam->v4ldev->minor)
 
 	cam->streaming = 0;
 	cam->misconfigured = 0;
@@ -2698,7 +2718,7 @@
 	if ((err = w9968cf_start_transfer(cam)))
 		goto deallocate_memory;
 
-	filp->private_data = (void*)cam;
+	filp->private_data = cam;
 
 	cam->users++;
 	strcpy(cam->command, current->comm);
@@ -2720,8 +2740,9 @@
 
 static int w9968cf_release(struct inode* inode, struct file* filp)
 {
-	struct w9968cf_device* cam = 
-	  (struct w9968cf_device*)video_devdata(filp)->priv;
+	struct w9968cf_device* cam;
+
+	cam = (struct w9968cf_device*)video_get_drvdata(video_devdata(filp));
 
 	down(&cam->dev_sem); /* prevent disconnect() to be called */
 
@@ -2749,11 +2770,12 @@
 static ssize_t
 w9968cf_read(struct file* filp, char* buf, size_t count, loff_t* f_pos)
 {
-	struct w9968cf_device* cam =
-	  (struct w9968cf_device*)video_devdata(filp)->priv;
+	struct w9968cf_device* cam;
 	struct w9968cf_frame_t* fr;
 	int err = 0;
 
+	cam = (struct w9968cf_device*)video_get_drvdata(video_devdata(filp));
+
 	if (filp->f_flags & O_NONBLOCK)
 		return -EWOULDBLOCK;
 
@@ -2817,9 +2839,8 @@
 
 static int w9968cf_mmap(struct file* filp, struct vm_area_struct *vma)
 {
-	struct w9968cf_device* cam =
-	  (struct w9968cf_device*)video_devdata(filp)->priv;
-
+	struct w9968cf_device* cam = (struct w9968cf_device*)
+	                             video_get_drvdata(video_devdata(filp));
 	unsigned long vsize = vma->vm_end - vma->vm_start,
 	              psize = cam->nbuffers * w9968cf_get_max_bufsize(cam),
 	              start = vma->vm_start,
@@ -2860,10 +2881,11 @@
 w9968cf_ioctl(struct inode* inode, struct file* filp,
               unsigned int cmd, unsigned long arg)
 {
-	struct w9968cf_device* cam =
-	  (struct w9968cf_device*)video_devdata(filp)->priv;
+	struct w9968cf_device* cam;
 	int err;
 
+	cam = (struct w9968cf_device*)video_get_drvdata(video_devdata(filp));
+
 	if (down_interruptible(&cam->fileop_sem))
 		return -ERESTARTSYS;
 
@@ -2879,7 +2901,7 @@
 		return -EIO;
 	}
 
-	err = w9968cf_do_ioctl(cam, cmd, (void*)arg);
+	err = w9968cf_v4l_ioctl(inode, filp, cmd, (void* )arg);
 
 	up(&cam->fileop_sem);
 	return err;
@@ -2887,8 +2909,10 @@
 
 
 static int 
-w9968cf_do_ioctl(struct w9968cf_device* cam, unsigned cmd, void* arg)
+w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
+                  unsigned int cmd, void* arg)
 {
+	struct w9968cf_device* cam;
 	const char* v4l1_ioctls[] = {
 		"?", "CGAP", "GCHAN", "SCHAN", "GTUNER", "STUNER", 
 		"GPICT", "SPICT", "CCAPTURE", "GWIN", "SWIN", "GFBUF",
@@ -2900,7 +2924,9 @@
 
 	#define V4L1_IOCTL(cmd) \
 	        ((_IOC_NR((cmd)) < sizeof(v4l1_ioctls)/sizeof(char*)) ? \
-	        v4l1_ioctls[_IOC_NR((cmd))] : "???")
+	        v4l1_ioctls[_IOC_NR((cmd))] : "?")
+
+	cam = (struct w9968cf_device*)video_get_drvdata(video_devdata(filp));
 
 	switch (cmd) {
 
@@ -2914,7 +2940,7 @@
 			.minheight = cam->minheight,
 		};
 		sprintf(cap.name, "W996[87]CF USB Camera #%d", 
-		        cam->v4ldev.minor);
+		        cam->v4ldev->minor);
 		cap.maxwidth = (cam->upscaling && w9968cf_vppmod_present)
 		               ? W9968CF_MAX_WIDTH : cam->maxwidth;
 		cap.maxheight = (cam->upscaling && w9968cf_vppmod_present)
@@ -2965,15 +2991,10 @@
 
 	case VIDIOCGPICT: /* get image properties of the picture */
 	{
-		struct video_picture pict;
-
-		if (w9968cf_sensor_get_picture(cam, &pict))
+		if (w9968cf_sensor_get_picture(cam))
 			return -EIO;
 
-		pict.depth = cam->picture.depth;
-		pict.palette = cam->picture.palette;
-
-		if (copy_to_user(arg, &pict, sizeof(pict)))
+		if (copy_to_user(arg, &cam->picture, sizeof(cam->picture)))
 			return -EFAULT;
 
 		DBG(5, "VIDIOCGPICT successfully called.")
@@ -3002,13 +3023,6 @@
 			return -EINVAL;
 		}
 
-		if (pict.depth != w9968cf_valid_depth(pict.palette)) {
-			DBG(4, "Depth %d bpp is not supported for %s palette. "
-			       "VIDIOCSPICT failed.", 
-			    pict.depth, symbolic(v4l1_plist, pict.palette))
-			return -EINVAL;
-		}
-
 		if (!cam->force_palette) {
 		   if (cam->decompression == 0) {
 		      if (w9968cf_need_decompression(pict.palette)) {
@@ -3027,9 +3041,15 @@
 		   }
 		}
 
-		if (pict.palette != cam->picture.palette ||
-		    pict.depth   != cam->picture.depth)
-		{
+		if (pict.depth != w9968cf_valid_depth(pict.palette)) {
+			DBG(4, "Requested depth %d bpp is not valid for %s "
+			       "palette: ignored and changed to %d bpp.", 
+			    pict.depth, symbolic(v4l1_plist, pict.palette),
+			    w9968cf_valid_depth(pict.palette))
+			pict.depth = w9968cf_valid_depth(pict.palette);
+		}
+
+		if (pict.palette != cam->picture.palette) {
 			if(*cam->requested_frame
 			   || cam->frame_current->queued) {
 				err = wait_event_interruptible
@@ -3052,15 +3072,9 @@
 			if (w9968cf_start_transfer(cam))
 				goto ioctl_fail;
 
-		} else if ( ((pict.brightness != cam->picture.brightness) &&
-		            (!cam->auto_brt)) ||
-		            pict.hue != cam->picture.hue ||
-		            pict.colour != cam->picture.colour ||
-		            pict.contrast != cam->picture.contrast ||
-		            pict.whiteness != cam->picture.whiteness ) {
-			if (w9968cf_sensor_set_picture(cam, pict))
-				return -EIO;
-		}
+		} else if (w9968cf_sensor_update_picture(cam, pict))
+			return -EIO;
+
 
 		DBG(5, "VIDIOCSPICT successfully called.")
 		return 0;
@@ -3092,7 +3106,6 @@
 		    win.y != cam->window.y ||
 		    win.width != cam->window.width ||
 		    win.height != cam->window.height) {
-
 			if(*cam->requested_frame
 			   || cam->frame_current->queued) {
 				err = wait_event_interruptible
@@ -3203,12 +3216,12 @@
 		   }
 		}
 
-		if (w9968cf_adjust_window_size(cam, (u16*)&mmap.width, 
-		                               (u16*)&mmap.height)) {
+		if ((err = w9968cf_adjust_window_size(cam, (u16*)&mmap.width, 
+		                                      (u16*)&mmap.height))) {
 			DBG(4, "Resolution not supported (%dx%d). "
 			       "VIDIOCMCAPTURE failed.",
 			    mmap.width, mmap.height)
-			return -EINVAL;
+			return err;
 		}
 
 		fr = &cam->frame[mmap.frame];
@@ -3276,10 +3289,13 @@
 
 	case VIDIOCSYNC: /* wait until the capture of a frame is finished */
 	{
-		unsigned int f_num = *((unsigned int *) arg);
+		unsigned int f_num;
 		struct w9968cf_frame_t* fr;
 		int err = 0;
 
+		if (copy_from_user(&f_num, arg, sizeof(f_num)))
+			return -EFAULT;
+
 		if (f_num >= cam->nbuffers) {
 			DBG(4, "Invalid frame number (%d). "
 			       "VIDIOCMCAPTURE failed.", f_num)
@@ -3323,7 +3339,7 @@
 	case VIDIOCGUNIT:/* report the unit numbers of the associated devices*/
 	{
 		struct video_unit unit = {
-			.video = cam->v4ldev.minor,
+			.video = cam->v4ldev->minor,
 			.vbi = VIDEO_NO_UNIT,
 			.radio = VIDEO_NO_UNIT,
 			.audio = VIDEO_NO_UNIT,
@@ -3342,9 +3358,8 @@
 
 	case VIDIOCGFBUF:
 	{
-		struct video_buffer* buffer = (struct video_buffer*)arg;
-
-		memset(buffer, 0, sizeof(struct video_buffer));
+		if (clear_user(arg, sizeof(struct video_buffer)))
+			return -EFAULT;
 
 		DBG(5, "VIDIOCGFBUF successfully called.")
 		return 0;
@@ -3470,10 +3485,6 @@
 	else
 		return -ENODEV;
 
-	/* We don't handle multi-config cameras */
-	if (udev->descriptor.bNumConfigurations != 1)
-		return -ENODEV;
-
 	DBG(2, "%s detected.", symbolic(camlist, mod_id))
 
 	if (simcams > W9968CF_MAX_DEVICES)
@@ -3491,14 +3502,6 @@
 		return -EPERM;
 	}
 
-	err = usb_set_configuration(udev, 1);
-	err += usb_set_interface(udev, 0, 0);
-
-	if (err) {
-		DBG(1, "Device configuration failed.")
-		return -EIO;
-	}
-
 	cam = (struct w9968cf_device*)
 	          kmalloc(sizeof(struct w9968cf_device), GFP_KERNEL);
 
@@ -3530,10 +3533,24 @@
 	}
 	memset(cam->data_buffer, 0, 8);
 
-	/* Set some basic constants */
-	w9968cf_configure_camera(cam, udev, mod_id, dev_nr);
+	/* Register the V4L device */
+	cam->v4ldev = video_device_alloc();
+	if (!cam->v4ldev) {
+		DBG(1, "Could not allocate memory for a V4L structure.")
+		err = -ENOMEM;
+		goto fail;
+	}
 
-	err = video_register_device(&cam->v4ldev, VFL_TYPE_GRABBER,
+	strcpy(cam->v4ldev->name, symbolic(camlist, mod_id));
+	cam->v4ldev->owner = THIS_MODULE;
+	cam->v4ldev->type = VID_TYPE_CAPTURE | VID_TYPE_SCALES;
+	cam->v4ldev->hardware = VID_HARDWARE_W9968CF;
+	cam->v4ldev->fops = &w9968cf_fops;
+	cam->v4ldev->minor = video_nr[dev_nr];
+	cam->v4ldev->release = video_device_release;
+	video_set_drvdata(cam->v4ldev, cam);
+
+	err = video_register_device(cam->v4ldev, VFL_TYPE_GRABBER,
 	                            video_nr[dev_nr]);
 	if (err) {
 		DBG(1, "V4L device registration failed.")
@@ -3544,13 +3561,15 @@
 		goto fail;
 	}
 
-	DBG(2, "V4L device registered as /dev/video%d", cam->v4ldev.minor)
+	DBG(2, "V4L device registered as /dev/video%d.", cam->v4ldev->minor)
 
-	/* Ok, add a new entry into the list of V4L registered devices */
+	/* Set some basic constants */
+	w9968cf_configure_camera(cam, udev, mod_id, dev_nr);
+
+	/* Add a new entry into the list of V4L registered devices */
 	down(&w9968cf_devlist_sem);
 	list_add(&cam->v4llist, &w9968cf_dev_list);
 	up(&w9968cf_devlist_sem);
-
 	dev_nr = (dev_nr < W9968CF_MAX_DEVICES-1) ? dev_nr+1 : 0;
 
 	w9968cf_turn_on_led(cam);
@@ -3559,8 +3578,7 @@
 
 	up(&cam->dev_sem);
 
-	dev_set_drvdata(&intf->dev, (void*)cam);
-
+	usb_set_intfdata(intf, cam);
 	return 0;
 
 fail: /* Free unused memory */
@@ -3569,6 +3587,8 @@
 			kfree(cam->control_buffer);
 		if (cam->data_buffer)
 			kfree(cam->data_buffer);
+		if (cam->v4ldev)
+			video_device_release(cam->v4ldev);
 		up(&cam->dev_sem);
 		kfree(cam);
 	}
@@ -3579,9 +3599,7 @@
 static void w9968cf_usb_disconnect(struct usb_interface* intf)
 {
 	struct w9968cf_device* cam = 
-	   (struct w9968cf_device*)dev_get_drvdata(&intf->dev);
-
-	dev_set_drvdata(&intf->dev, NULL);
+	   (struct w9968cf_device*)usb_get_intfdata(intf);
 
 	if (cam) {
 		/* Prevent concurrent accesses to data */
@@ -3599,7 +3617,7 @@
 			DBG(2, "The device is open (/dev/video%d)! "
 			       "Process name: %s. Deregistration and memory "
 			       "deallocation are deferred on close.",
-			    cam->v4ldev.minor, cam->command)
+			    cam->v4ldev->minor, cam->command)
 
 			cam->misconfigured = 1;
 
@@ -3613,6 +3631,8 @@
 		if (!cam->users)
 			kfree(cam);
 	}
+
+	usb_set_intfdata(intf, NULL);
 }
 
 
diff -Nru a/drivers/usb/media/w9968cf.h b/drivers/usb/media/w9968cf.h
--- a/drivers/usb/media/w9968cf.h	Tue Feb  3 19:45:16 2004
+++ b/drivers/usb/media/w9968cf.h	Tue Feb  3 19:45:16 2004
@@ -1,7 +1,7 @@
 /***************************************************************************
  * Video4Linux driver for W996[87]CF JPEG USB Dual Mode Camera Chip.       *
  *                                                                         *
- * Copyright (C) 2002 2003 by Luca Risolia <luca_ing@libero.it>            *
+ * Copyright (C) 2002-2004 by Luca Risolia <luca.risolia@studio.unibo.it>  *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify    *
  * it under the terms of the GNU General Public License as published by    *
@@ -28,6 +28,7 @@
 #include <linux/list.h>
 #include <linux/wait.h>
 #include <linux/config.h>
+#include <linux/param.h>
 #include <asm/semaphore.h>
 #include <asm/types.h>
 
@@ -105,7 +106,7 @@
 #define W9968CF_LARGEVIEW      1 /* 0 disable, 1 enable */
 #define W9968CF_UPSCALING      0 /* 0 disable, 1 enable */
 
-#define W9968CF_SENSOR_MONO    0 /* 0 not monochrome, 1 monochrome sensor */
+#define W9968CF_MONOCHROME     0 /* 0 not monochrome, 1 monochrome sensor */
 #define W9968CF_BRIGHTNESS     31000 /* from 0 to 65535 */
 #define W9968CF_HUE            32768 /* from 0 to 65535 */
 #define W9968CF_COLOUR         32768 /* from 0 to 65535 */
@@ -129,9 +130,10 @@
 
 #define W9968CF_MODULE_NAME     "V4L driver for W996[87]CF JPEG USB " \
                                 "Dual Mode Camera Chip"
-#define W9968CF_MODULE_VERSION  "v1.22"
-#define W9968CF_MODULE_AUTHOR   "(C) 2002 2003 Luca Risolia"
-#define W9968CF_AUTHOR_EMAIL    "<luca_ing@libero.it>"
+#define W9968CF_MODULE_VERSION  "v1.25-basic"
+#define W9968CF_MODULE_AUTHOR   "(C) 2002-2004 Luca Risolia"
+#define W9968CF_AUTHOR_EMAIL    "<luca.risolia@studio.unibo.it>"
+#define W9968CF_MODULE_LICENSE  "GPL"
 
 static u8 w9968cf_vppmod_present; /* status flag: yes=1, no=0 */
 
@@ -171,6 +173,7 @@
 };
 
 struct w9968cf_frame_t {
+	#define W9968CF_HW_BUF_SIZE 640*480*2 /* buf.size of original frames */
 	void* buffer;
 	u32 length;
 	enum w9968cf_frame_status status;
@@ -194,8 +197,8 @@
 struct w9968cf_device {
 	enum w9968cf_model_id id;   /* private device identifier */
 
-	struct video_device v4ldev; /* V4L structure */
-	struct list_head v4llist;   /* entry of the list of V4L cameras */
+	struct video_device* v4ldev; /* -> V4L structure */
+	struct list_head v4llist;    /* entry of the list of V4L cameras */
 
 	struct usb_device* usbdev;           /* -> main USB structure */
 	struct urb* urb[W9968CF_URBS];       /* -> USB request block structs */
@@ -207,9 +210,9 @@
 	struct w9968cf_frame_t frame_tmp;  /* temporary frame */
 	struct w9968cf_frame_t* frame_current; /* -> frame being grabbed */
 	struct w9968cf_frame_t* requested_frame[W9968CF_MAX_BUFFERS];
-	void* vpp_buffer; /* -> helper buffer for post-processing routines */
+	void* vpp_buffer; /*-> helper buf.for video post-processing routines */
 
-	u8 max_buffers,   /* number of requested buffers */	   
+	u8 max_buffers,   /* number of requested buffers */
 	   force_palette, /* yes=1/no=0 */
 	   force_rgb,     /* read RGB instead of BGR, yes=1, no=0 */
 	   double_buffer, /* hardware double buffering yes=1/no=0 */
@@ -220,15 +223,17 @@
 	   decompression, /* 0=disabled, 1=forced, 2=allowed */
 	   upscaling;     /* software image scaling, 0=enabled, 1=disabled */
 
-	struct video_picture picture; /* current window settings */
-	struct video_window window;   /* current picture settings */
+	struct video_picture picture; /* current picture settings */
+	struct video_window window;   /* current window settings */
 
 	u16 hw_depth,    /* depth (used by the chip) */
 	    hw_palette,  /* palette (used by the chip) */
 	    hw_width,    /* width (used by the chip) */
 	    hw_height,   /* height (used by the chip) */
 	    hs_polarity, /* 0=negative sync pulse, 1=positive sync pulse */
-	    vs_polarity; /* 0=negative sync pulse, 1=positive sync pulse */
+	    vs_polarity, /* 0=negative sync pulse, 1=positive sync pulse */
+	    start_cropx, /* pixels from HS inactive edge to 1st cropped pixel*/
+	    start_cropy; /* pixels from VS incative edge to 1st cropped pixel*/
 
 	enum w9968cf_vpp_flag vpp_flag; /* post-processing routines in use */
 
@@ -239,16 +244,15 @@
 	   users,         /* flag: number of users holding the device */
 	   streaming;     /* flag: yes=1, no=0 */
 
-	int sensor; /* type of image CMOS sensor chip (CC_*) */
-
-	/* Determined by CMOS sensor type */
-	u16 maxwidth,
-	    maxheight,
-	    minwidth,
-	    minheight,
-	    start_cropx,
-	    start_cropy;
+	u8 sensor_initialized; /* flag: yes=1, no=0 */
 
+	/* Determined by CMOS sensor type: */
+	int sensor,       /* type of image sensor chip (CC_*) */
+	    monochrome;   /* CMOS sensor is (probably) monochrome */
+	u16 maxwidth,     /* maximum width supported by the CMOS sensor */
+	    maxheight,    /* maximum height supported by the CMOS sensor */
+	    minwidth,     /* minimum width supported by the CMOS sensor */
+	    minheight;    /* minimum height supported by the CMOS sensor */
 	u8  auto_brt,     /* auto brightness enabled flag */
 	    auto_exp,     /* auto exposure enabled flag */
 	    backlight,    /* backlight exposure algorithm flag */
@@ -256,7 +260,6 @@
 	    lightfreq,    /* power (lighting) frequency */
 	    bandfilt;     /* banding filter enabled flag */
 	s8  clockdiv;     /* clock divisor */
-	int sensor_mono;  /* CMOS sensor is (probably) monochrome */
 
 	/* I2C interface to kernel */
 	struct i2c_adapter i2c_adapter;
@@ -271,14 +274,9 @@
 	wait_queue_head_t open, wait_queue;
 };
 
-#define W9968CF_HW_BUF_SIZE 640*480*2 /* buf. size for original video frames */
-
-#define SENSOR_FORMAT          VIDEO_PALETTE_UYVY
-#define SENSOR_FATAL_ERROR(rc) ((rc) < 0 && (rc) != -EPERM)
-
 
 /****************************************************************************
- * Macros and other constants                                               *
+ * Macros for debugging                                                     *
  ****************************************************************************/
 
 #undef DBG
@@ -294,7 +292,7 @@
 	else if ((level) == 4) \
 		warn(fmt, ## args); \
 	else if ((level) >= 5) \
-		info("[%s,%d] " fmt, \
+		info("[%s:%d] " fmt, \
 		     __PRETTY_FUNCTION__, __LINE__ , ## args); \
 } \
 }
@@ -305,7 +303,7 @@
 
 #undef PDBG
 #undef PDBGG
-#define PDBG(fmt, args...) info("[%s, %d] "fmt, \
+#define PDBG(fmt, args...) info("[%s:%d] "fmt, \
 	                        __PRETTY_FUNCTION__, __LINE__ , ## args);
 #define PDBGG(fmt, args...) do {;} while(0); /* nothing: it's a placeholder */
 
diff -Nru a/drivers/usb/media/w9968cf_decoder.h b/drivers/usb/media/w9968cf_decoder.h
--- a/drivers/usb/media/w9968cf_decoder.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/media/w9968cf_decoder.h	Tue Feb  3 19:45:17 2004
@@ -1,7 +1,7 @@
 /***************************************************************************
  * Video decoder for the W996[87]CF driver for Linux.                      *
  *                                                                         *
- * Copyright (C) 2003 by Luca Risolia <luca_ing@libero.it>                 *
+ * Copyright (C) 2003 2004 by Luca Risolia <luca.risolia@studio.unibo.it>  *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify    *
  * it under the terms of the GNU General Public License as published by    *
diff -Nru a/drivers/usb/media/w9968cf_externaldef.h b/drivers/usb/media/w9968cf_externaldef.h
--- a/drivers/usb/media/w9968cf_externaldef.h	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/media/w9968cf_externaldef.h	Tue Feb  3 19:45:17 2004
@@ -1,8 +1,9 @@
 /***************************************************************************
- * Various definitions for compatibility with external modules.            *
+ * Various definitions for compatibility with OVCAMCHIP external module.   *
  * This file is part of the W996[87]CF driver for Linux.                   *
  *                                                                         *
- * Copyright (C) 2002 2003 by Luca Risolia <luca_ing@libero.it>            *
+ * The definitions have been taken from the OVCAMCHIP module written by    *
+ * Mark McClelland.                                                        *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify    *
  * it under the terms of the GNU General Public License as published by    *
@@ -27,10 +28,8 @@
 #include <asm/ioctl.h>
 #include <asm/types.h>
 
-/* The following values have been copied from the "ovcamchip" module. */
-
 #ifndef I2C_DRIVERID_OVCAMCHIP
-#	define I2C_DRIVERID_OVCAMCHIP   0xf00f
+#	define I2C_DRIVERID_OVCAMCHIP 0xf00f
 #endif
 
 /* Controls */
@@ -77,10 +76,10 @@
 	int width;
 	int height;
 	int format;
-	int quarter;   /* Scale width and height down 2x */
+	int quarter;  /* Scale width and height down 2x */
 
 	/* This stuff will be removed eventually */
-	int clockdiv;  /* Clock divisor setting */
+	int clockdiv; /* Clock divisor setting */
 };
 
 /* Commands. 
diff -Nru a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig
--- a/drivers/usb/misc/Kconfig	Tue Feb  3 19:45:42 2004
+++ b/drivers/usb/misc/Kconfig	Tue Feb  3 19:45:42 2004
@@ -4,9 +4,24 @@
 comment "USB Miscellaneous drivers"
 	depends on USB
 
+config USB_EMI62
+	tristate "EMI 6|2m USB Audio interface support"
+	depends on USB
+	---help---
+	  This driver loads firmware to Emagic EMI 6|2m low latency USB
+	  Audio and Midi interface.
+
+	  After firmware load the device is handled with standard linux
+	  USB Audio driver.
+
+	  This code is also available as a module ( = code which can be
+	  inserted in and removed from the running kernel whenever you want).
+	  The module will be called audio. If you want to compile it as a
+	  module, say M here and read <file:Documentation/modules.txt>.
+
 config USB_EMI26
 	tristate "EMI 2|6 USB Audio interface support"
-	depends on USB_AUDIO
+	depends on USB
 	---help---
 	  This driver loads firmware to Emagic EMI 2|6 low latency USB
 	  Audio interface.
@@ -92,6 +107,16 @@
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called usblcd.
+
+config USB_LED
+	tristate "USB LED driver support"
+	depends on USB
+	help
+	  Say Y here if you want to connect an USBLED device to your 
+	  computer's USB port.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called usbled.
 
 config USB_SPEEDTOUCH
 	tristate "Alcatel Speedtouch USB support"
diff -Nru a/drivers/usb/misc/Makefile b/drivers/usb/misc/Makefile
--- a/drivers/usb/misc/Makefile	Tue Feb  3 19:45:28 2004
+++ b/drivers/usb/misc/Makefile	Tue Feb  3 19:45:28 2004
@@ -5,11 +5,13 @@
 
 obj-$(CONFIG_USB_AUERSWALD)	+= auerswald.o
 obj-$(CONFIG_USB_BRLVGER)	+= brlvger.o
+obj-$(CONFIG_USB_EMI62)		+= emi62.o
 obj-$(CONFIG_USB_EMI26)		+= emi26.o
 obj-$(CONFIG_USB_LCD)		+= usblcd.o
+obj-$(CONFIG_USB_LED)		+= usbled.o
+obj-$(CONFIG_USB_LEGOTOWER)	+= legousbtower.o
 obj-$(CONFIG_USB_RIO500)	+= rio500.o
 obj-$(CONFIG_USB_SPEEDTOUCH)	+= speedtch.o
 obj-$(CONFIG_USB_TEST)		+= usbtest.o
 obj-$(CONFIG_USB_TIGL)		+= tiglusb.o
 obj-$(CONFIG_USB_USS720)	+= uss720.o
-obj-$(CONFIG_USB_LEGOTOWER)	+= legousbtower.o
diff -Nru a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c
--- a/drivers/usb/misc/auerswald.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/misc/auerswald.c	Tue Feb  3 19:45:17 2004
@@ -1927,7 +1927,6 @@
 {
 	struct usb_device *usbdev = interface_to_usbdev(intf);
 	pauerswald_t cp = NULL;
-	DECLARE_WAIT_QUEUE_HEAD (wqh);
 	unsigned int u = 0;
 	char *pbuf;
 	int ret;
@@ -1975,7 +1974,8 @@
 	dbg ("Version is %X", cp->version);
 
 	/* allow some time to settle the device */
-	sleep_on_timeout (&wqh, HZ / 3 );
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout(HZ/3);
 
 	/* Try to get a suitable textual description of the device */
 	/* Device name:*/
diff -Nru a/drivers/usb/misc/emi62.c b/drivers/usb/misc/emi62.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/usb/misc/emi62.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,298 @@
+/* 
+ * Emagic EMI 2|6 usb audio interface firmware loader.
+ * Copyright (C) 2002
+ * 	Tapio Laxström (tapio.laxstrom@iptime.fi)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, as published by
+ * the Free Software Foundation, version 2.
+ * 
+ * $Id: emi62.c,v 1.15 2002/04/23 06:13:59 tapio Exp $
+ */
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/usb.h>
+
+#define MAX_INTEL_HEX_RECORD_LENGTH 16
+typedef struct _INTEL_HEX_RECORD
+{
+	__u32	length;
+	__u32	address;
+	__u32	type;
+	__u8	data[MAX_INTEL_HEX_RECORD_LENGTH];
+} INTEL_HEX_RECORD, *PINTEL_HEX_RECORD;
+
+/* include firmware (variables)*/
+
+/* FIXME: This is quick and dirty solution! */
+#define SPDIF	/* if you want SPDIF comment next line */
+//#undef SPDIF	/* if you want MIDI uncomment this line */ 
+
+#ifdef SPDIF
+#  include "emi62_fw_s.h" /* spdif fw */
+#else
+#  include "emi62_fw_m.h" /* midi fw */
+#endif
+
+#define EMI62_VENDOR_ID 		0x086a  /* Emagic Soft-und Hardware GmBH */
+#define EMI62_PRODUCT_ID		0x0110	/* EMI 6|2m without firmware */
+
+#define ANCHOR_LOAD_INTERNAL	0xA0	/* Vendor specific request code for Anchor Upload/Download (This one is implemented in the core) */
+#define ANCHOR_LOAD_EXTERNAL	0xA3	/* This command is not implemented in the core. Requires firmware */
+#define ANCHOR_LOAD_FPGA	0xA5	/* This command is not implemented in the core. Requires firmware. Emagic extension */
+#define MAX_INTERNAL_ADDRESS	0x1B3F	/* This is the highest internal RAM address for the AN2131Q */
+#define CPUCS_REG		0x7F92  /* EZ-USB Control and Status Register.  Bit 0 controls 8051 reset */ 
+#define INTERNAL_RAM(address)   (address <= MAX_INTERNAL_ADDRESS)
+
+static int emi62_writememory( struct usb_device *dev, int address, unsigned char *data, int length, __u8 bRequest);
+static int emi62_set_reset(struct usb_device *dev, unsigned char reset_bit);
+static int emi62_load_firmware (struct usb_device *dev);
+static int emi62_probe(struct usb_interface *intf, const struct usb_device_id *id);
+static void emi62_disconnect(struct usb_interface *intf);
+static int __init emi62_init (void);
+static void __exit emi62_exit (void);
+
+
+/* thanks to drivers/usb/serial/keyspan_pda.c code */
+static int emi62_writememory (struct usb_device *dev, int address, unsigned char *data, int length, __u8 request)
+{
+	int result;
+	unsigned char *buffer =  kmalloc (length, GFP_KERNEL);
+
+	if (!buffer) {
+		err("emi62: kmalloc(%d) failed.", length);
+		return -ENOMEM;
+	}
+	memcpy (buffer, data, length);
+	/* Note: usb_control_msg returns negative value on error or length of the
+	 * 		 data that was written! */
+	result = usb_control_msg (dev, usb_sndctrlpipe(dev, 0), request, 0x40, address, 0, buffer, length, 300);
+	kfree (buffer);
+	return result;
+}
+
+/* thanks to drivers/usb/serial/keyspan_pda.c code */
+static int emi62_set_reset (struct usb_device *dev, unsigned char reset_bit)
+{
+	int response;
+	info("%s - %d", __FUNCTION__, reset_bit);
+	
+	response = emi62_writememory (dev, CPUCS_REG, &reset_bit, 1, 0xa0);
+	if (response < 0) {
+		err("emi62: set_reset (%d) failed", reset_bit);
+	}
+	return response;
+}
+
+#define FW_LOAD_SIZE		1023
+
+static int emi62_load_firmware (struct usb_device *dev)
+{
+	int err;
+	int i;
+	int pos = 0;	/* Position in hex record */
+	__u32 addr;	/* Address to write */
+	__u8 *buf;
+
+	dev_dbg(&dev->dev, "load_firmware\n");
+	buf = kmalloc(FW_LOAD_SIZE, GFP_KERNEL);
+	if (!buf) {
+		err( "%s - error loading firmware: error = %d", __FUNCTION__, -ENOMEM);
+		err = -ENOMEM;
+		goto wraperr;
+	}
+
+	/* Assert reset (stop the CPU in the EMI) */
+	err = emi62_set_reset(dev,1);
+	if (err < 0) {
+		err("%s - error loading firmware: error = %d", __FUNCTION__, err);
+		goto wraperr;
+	}
+
+	/* 1. We need to put the loader for the FPGA into the EZ-USB */
+	for (i=0; g_emi62_loader[i].type == 0; i++) {
+		err = emi62_writememory(dev, g_emi62_loader[i].address, g_emi62_loader[i].data, g_emi62_loader[i].length, ANCHOR_LOAD_INTERNAL);
+		if (err < 0) {
+			err("%s - error loading firmware: error = %d", __FUNCTION__, err);
+			goto wraperr;
+		}
+	}
+
+	/* De-assert reset (let the CPU run) */
+	err = emi62_set_reset(dev,0);
+
+	/* 2. We upload the FPGA firmware into the EMI
+	 * Note: collect up to 1023 (yes!) bytes and send them with
+	 * a single request. This is _much_ faster! */
+	do {
+		i = 0;
+		addr = g_emi62bs[pos].address;
+
+		/* intel hex records are terminated with type 0 element */
+		while ((g_emi62bs[pos].type == 0) && (i + g_emi62bs[pos].length < FW_LOAD_SIZE)) {
+			memcpy(buf + i, g_emi62bs[pos].data, g_emi62bs[pos].length);
+			i += g_emi62bs[pos].length;
+			pos++;
+		}
+		err = emi62_writememory(dev, addr, buf, i, ANCHOR_LOAD_FPGA);
+		if (err < 0) {
+			err("%s - error loading firmware: error = %d", __FUNCTION__, err);
+			goto wraperr;
+		}
+	} while (i > 0);
+
+	/* Assert reset (stop the CPU in the EMI) */
+	err = emi62_set_reset(dev,1);
+	if (err < 0) {
+		err("%s - error loading firmware: error = %d", __FUNCTION__, err);
+		goto wraperr;
+	}
+
+	/* 3. We need to put the loader for the firmware into the EZ-USB (again...) */
+	for (i=0; g_emi62_loader[i].type == 0; i++) {
+		err = emi62_writememory(dev, g_emi62_loader[i].address, g_emi62_loader[i].data, g_emi62_loader[i].length, ANCHOR_LOAD_INTERNAL);
+		if (err < 0) {
+			err("%s - error loading firmware: error = %d", __FUNCTION__, err);
+			goto wraperr;
+		}
+	}
+
+	/* De-assert reset (let the CPU run) */
+	err = emi62_set_reset(dev,0);
+	if (err < 0) {
+		err("%s - error loading firmware: error = %d", __FUNCTION__, err);
+		goto wraperr;
+	}
+
+	/* 4. We put the part of the firmware that lies in the external RAM into the EZ-USB */
+
+/* FIXME: quick and dirty ifdefs */
+#ifdef SPDIF
+	for (i=0; g_HexSpdifFw62[i].type == 0; i++) {
+		if (!INTERNAL_RAM(g_HexSpdifFw62[i].address)) {
+			err = emi62_writememory(dev, g_HexSpdifFw62[i].address, g_HexSpdifFw62[i].data, g_HexSpdifFw62[i].length, ANCHOR_LOAD_EXTERNAL);
+			if (err < 0) {
+				err("%s - error loading firmware: error = %d", __FUNCTION__, err);
+				goto wraperr;
+			}
+		}
+	}
+#else /* MIDI */
+	for (i=0; g_HexMidiFw62[i].type == 0; i++) {
+		if (!INTERNAL_RAM(g_HexMidiFw62[i].address)) {
+			err = emi62_writememory(dev, g_HexMidiFw62[i].address, g_HexMidiFw62[i].data, g_HexMidiFw62[i].length, ANCHOR_LOAD_EXTERNAL);
+			if (err < 0) {
+				err("%s - error loading firmware: error = %d\n", __FUNCTION__, err);
+				goto wraperr;
+				return err;
+			}
+		}
+	}
+#endif	
+	/* Assert reset (stop the CPU in the EMI) */
+	err = emi62_set_reset(dev,1);
+	if (err < 0) {
+		err("%s - error loading firmware: error = %d", __FUNCTION__, err);
+		goto wraperr;
+	}
+
+/* FIXME: quick and dirty ifdefs */
+#ifdef SPDIF
+	for (i=0; g_HexSpdifFw62[i].type == 0; i++) {
+		if (INTERNAL_RAM(g_HexSpdifFw62[i].address)) {
+			err = emi62_writememory(dev, g_HexSpdifFw62[i].address, g_HexSpdifFw62[i].data, g_HexSpdifFw62[i].length, ANCHOR_LOAD_INTERNAL);
+			if (err < 0) {
+				err("%s - error loading firmware: error = %d", __FUNCTION__, err);
+				goto wraperr;
+			}
+		}
+	}
+#else /* MIDI */
+	for (i=0; g_HexMidiFw62[i].type == 0; i++) {
+		if (INTERNAL_RAM(g_HexMidiFw62[i].address)) {
+			err = emi62_writememory(dev, g_HexMidiFw62[i].address, g_HexMidiFw62[i].data, g_HexMidiFw62[i].length, ANCHOR_LOAD_INTERNAL);
+			if (err < 0) {
+				err("%s - error loading firmware: error = %d\n", __FUNCTION__, err);
+				goto wraperr;
+			}
+		}
+	}
+#endif
+	
+	/* De-assert reset (let the CPU run) */
+	err = emi62_set_reset(dev,0);
+	if (err < 0) {
+		err("%s - error loading firmware: error = %d", __FUNCTION__, err);
+		goto wraperr;
+	}
+
+	/* return 1 to fail the driver inialization
+	 * and give real driver change to load */
+	return 1;
+
+wraperr:
+	kfree(buf);
+	dev_err(&dev->dev, "Error\n");
+	return err;
+}
+
+static __devinitdata struct usb_device_id id_table [] = {
+	{ USB_DEVICE(EMI62_VENDOR_ID, EMI62_PRODUCT_ID) },
+	{ }                                             /* Terminating entry */
+};
+
+MODULE_DEVICE_TABLE (usb, id_table);
+
+static int emi62_probe(struct usb_interface *intf, const struct usb_device_id *id)
+{
+	struct usb_device *dev = interface_to_usbdev(intf);
+	dev_dbg(&intf->dev, "emi62_probe\n");
+
+	info("%s start", __FUNCTION__); 
+
+	if((dev->descriptor.idVendor == EMI62_VENDOR_ID) && (dev->descriptor.idProduct == EMI62_PRODUCT_ID)) {
+		emi62_load_firmware(dev);
+	}
+	
+	/* do not return the driver context, let real audio driver do that */
+	return -EIO;
+}
+
+static void emi62_disconnect(struct usb_interface *intf)
+{
+}
+
+struct usb_driver emi62_driver = {
+	.owner		= THIS_MODULE,
+	.name		= "emi62 - firmware loader",
+	.probe		= emi62_probe,
+	.disconnect	= emi62_disconnect,
+	.id_table	= id_table,
+};
+
+static int __init emi62_init (void)
+{
+	int retval;
+	retval = usb_register (&emi62_driver);
+	if (retval)
+		printk(KERN_ERR "adi-emi: registration failed\n");
+	return retval;
+}
+
+static void __exit emi62_exit (void)
+{
+	usb_deregister (&emi62_driver);
+}
+
+module_init(emi62_init);
+module_exit(emi62_exit);
+
+MODULE_AUTHOR("tapio laxström");
+MODULE_DESCRIPTION("Emagic EMI 6|2m firmware loader.");
+MODULE_LICENSE("GPL");
+
+/* vi:ai:syntax=c:sw=8:ts=8:tw=80
+ */
diff -Nru a/drivers/usb/misc/emi62_fw_m.h b/drivers/usb/misc/emi62_fw_m.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/usb/misc/emi62_fw_m.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,8852 @@
+/*
+ * This file is generated from three different files, provided by Emagic.
+ */
+/* generated Tue Jun 3 21:36:11 EEST 2003 */
+
+INTEL_HEX_RECORD g_emi62bs[]={
+  16, 0x8010, 0, {0xff,0xff,0xff,0xff,0xaa,0x99,0x55,0x66,0x30,0x00,0x80,0x01,0x00,0x00,0x00,0x07 },
+  16, 0x8020, 0, {0x30,0x01,0x60,0x01,0x00,0x00,0x00,0x0d,0x30,0x01,0x20,0x01,0x00,0x80,0x3f,0x2d },
+  16, 0x8030, 0, {0x30,0x00,0xc0,0x01,0x00,0x00,0x00,0x00,0x30,0x00,0x80,0x01,0x00,0x00,0x00,0x09 },
+  16, 0x8040, 0, {0x30,0x00,0x20,0x01,0x00,0x00,0x00,0x00,0x30,0x00,0x80,0x01,0x00,0x00,0x00,0x01 },
+  16, 0x8050, 0, {0x30,0x00,0x40,0x00,0x50,0x00,0x58,0x1a,0x80,0x12,0x10,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8060, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8070, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8080, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x40,0x04,0x80,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8090, 0, {0x00,0x12,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x80a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x80b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x48 },
+  16, 0x80c0, 0, {0x04,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x80d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x80e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x80f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8100, 0, {0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8110, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8120, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8130, 0, {0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8140, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8150, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8160, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x80,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8170, 0, {0x80,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8180, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8190, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x81a0, 0, {0x00,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x81b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x81c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x81d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x04,0x90,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x81e0, 0, {0x7f,0x10,0x00,0x34,0x00,0x0d,0x00,0x03,0x40,0x00,0xd0,0x00,0x34,0x00,0x05,0x00 },
+  16, 0x81f0, 0, {0x07,0x40,0x01,0xd0,0x00,0x74,0x00,0x1d,0x00,0x07,0x40,0x01,0xd0,0x00,0x74,0x00 },
+  16, 0x8200, 0, {0x1d,0x80,0x07,0xe0,0x01,0xb8,0x00,0x6e,0x00,0x1b,0x80,0x06,0xe0,0x01,0x38,0x37 },
+  16, 0x8210, 0, {0xc4,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0xfc,0x80,0xfb,0x30,0x36,0xc8 },
+  16, 0x8220, 0, {0x4e,0x09,0x03,0xfc,0x84,0xff,0x10,0x3b,0xc0,0x0e,0xc8,0x07,0x22,0x80,0xff,0x22 },
+  16, 0x8230, 0, {0x33,0xc0,0x0f,0xc8,0x33,0x6e,0x00,0xfb,0x80,0x3f,0x20,0x0d,0xc2,0x53,0xd4,0x80 },
+  16, 0x8240, 0, {0xcc,0x3a,0x3f,0x00,0x0c,0xf1,0x03,0xf0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8250, 0, {0x80,0x00,0xed,0x60,0xbf,0x60,0x23,0xf0,0x0d,0x82,0x12,0x3c,0x60,0x8f,0x70,0x23 },
+  16, 0x8260, 0, {0xf0,0x08,0x88,0x02,0xa5,0x40,0xbf,0xd0,0x63,0xd6,0x0b,0x88,0x02,0x2e,0x0c,0xbb },
+  16, 0x8270, 0, {0x80,0x2e,0x20,0x88,0x8d,0x02,0xe6,0x40,0x80,0x60,0x2e,0x30,0x0a,0xb1,0x12,0x20 },
+  16, 0x8280, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x80,0xa3,0x40,0x2c,0xc4 },
+  16, 0x8290, 0, {0x4a,0x00,0x12,0x8c,0x88,0xa3,0x22,0x20,0xc4,0x0a,0x90,0x42,0x04,0xa9,0xa3,0x00 },
+  16, 0x82a0, 0, {0x24,0xc8,0x8b,0x80,0x02,0xcc,0x00,0xb3,0x00,0x2e,0x01,0x09,0x08,0x02,0x84,0x00 },
+  16, 0x82b0, 0, {0x80,0x20,0x2c,0x10,0x0a,0x32,0x42,0x22,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x82c0, 0, {0xc0,0x15,0xac,0x04,0xb3,0x00,0x2a,0xc0,0x08,0x08,0xa2,0x8c,0x00,0x8b,0x00,0xa2 },
+  16, 0x82d0, 0, {0xc1,0x10,0x98,0x42,0xa7,0x00,0xbb,0x01,0x66,0xc1,0x0b,0x80,0x02,0xac,0x04,0xbb },
+  16, 0x82e0, 0, {0x00,0x2e,0x00,0x0b,0xb8,0x12,0xe4,0x02,0x89,0x08,0x0e,0x40,0x0a,0xb0,0x02,0x30 },
+  16, 0x82f0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xac,0x00,0xeb,0x00,0x3e,0xc0 },
+  16, 0x8300, 0, {0x4a,0xb8,0x23,0xec,0x18,0xeb,0x00,0x32,0xc0,0x0e,0x2c,0x12,0x22,0x10,0xeb,0x00 },
+  16, 0x8310, 0, {0x26,0xc0,0x4f,0x00,0x43,0xed,0x00,0xfb,0x00,0x2e,0x24,0x0d,0x80,0x13,0xe4,0x00 },
+  16, 0x8320, 0, {0xc8,0xd0,0x7c,0x12,0x0e,0xb0,0x03,0x40,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8330, 0, {0xe1,0x00,0xbc,0x00,0xff,0x00,0x35,0xc0,0x4f,0xe0,0x03,0x7c,0x08,0xff,0x01,0x17 },
+  16, 0x8340, 0, {0xc2,0x4d,0xc0,0x03,0xf4,0x08,0xf7,0x00,0x3b,0xc0,0x07,0xc0,0x03,0x7c,0x80,0xff },
+  16, 0x8350, 0, {0x24,0x3f,0x40,0x0c,0xf0,0x01,0xf4,0x04,0xbc,0x08,0x3f,0x28,0x0f,0xf0,0x03,0x78 },
+  16, 0x8360, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x08,0xfb,0x04,0x3a,0xc8 },
+  16, 0x8370, 0, {0x0f,0x94,0x03,0xec,0x10,0xf3,0x00,0x34,0xc0,0x0e,0xb0,0x03,0x61,0x04,0xfb,0x00 },
+  16, 0x8380, 0, {0x36,0xc0,0x0e,0xa3,0x03,0x2c,0x80,0xfb,0x72,0x3e,0x02,0x0f,0x8a,0x03,0xe4,0x02 },
+  16, 0x8390, 0, {0xc9,0x80,0x2a,0x50,0x0f,0xb0,0x03,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x83a0, 0, {0xca,0x44,0x3c,0x00,0xbf,0x00,0x03,0xc0,0x08,0x80,0x03,0x7c,0x00,0xbf,0x00,0x3f },
+  16, 0x83b0, 0, {0xe2,0x08,0x90,0x43,0x60,0x00,0xbf,0x00,0x37,0xc0,0x08,0x90,0x01,0x6d,0x00,0xbb },
+  16, 0x83c0, 0, {0x40,0x2c,0x10,0x0b,0xb0,0x42,0xd7,0xc0,0x89,0x00,0x2a,0x7c,0x0b,0xf0,0x02,0xf2 },
+  16, 0x83d0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe2,0x05,0x4c,0x00,0xb3,0x00,0x20,0xd5 },
+  16, 0x83e0, 0, {0x4a,0x00,0x00,0x0c,0x04,0x93,0x00,0x0c,0xf0,0x0b,0x09,0x02,0x08,0x01,0xb3,0x20 },
+  16, 0x83f0, 0, {0x28,0xc0,0x0a,0x0c,0x0a,0x0e,0x00,0xb3,0x00,0x24,0x30,0x09,0x00,0x02,0xc6,0x10 },
+  16, 0x8400, 0, {0x80,0x42,0x20,0x00,0x8b,0xb0,0x02,0xf8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8410, 0, {0x22,0x01,0x1e,0x00,0xb7,0x94,0x21,0xe4,0x48,0xd9,0x12,0x5e,0x40,0xb7,0x90,0x29 },
+  16, 0x8420, 0, {0xe0,0x8b,0x69,0x12,0xd6,0x80,0x37,0x82,0x2c,0xe8,0x08,0x4a,0x02,0x5e,0x00,0xb7 },
+  16, 0x8430, 0, {0xa4,0x2d,0x20,0x0b,0x79,0x02,0xd6,0x08,0x86,0x90,0x29,0xa0,0x0b,0x79,0x02,0xd8 },
+  16, 0x8440, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x0c,0x00,0xfb,0xa0,0x28,0xe8 },
+  16, 0x8450, 0, {0x0e,0x2a,0x02,0x8c,0x00,0xd3,0x00,0x64,0xc0,0x0f,0x00,0x43,0x0e,0xc4,0xf3,0x00 },
+  16, 0x8460, 0, {0x78,0xec,0x0e,0x0a,0x43,0x0e,0x20,0x73,0xe0,0x3c,0x02,0x4f,0x00,0x03,0xc4,0x40 },
+  16, 0x8470, 0, {0xc3,0x00,0x38,0xc0,0x0f,0x30,0x03,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8480, 0, {0x40,0x1d,0xbc,0x00,0xff,0x00,0xbc,0xcc,0x0e,0xb0,0x03,0xec,0x20,0xfb,0x00,0x3c },
+  16, 0x8490, 0, {0xc2,0x0c,0x20,0x03,0x6c,0x50,0xf3,0x00,0x36,0xc4,0x0f,0x40,0x03,0xfc,0x08,0xff },
+  16, 0x84a0, 0, {0x1a,0x3f,0x80,0x0f,0xf0,0x01,0xe4,0x30,0xff,0x02,0x3f,0xc0,0x0f,0xf0,0x63,0xd0 },
+  16, 0x84b0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xec,0x40,0xfb,0x00,0xb2,0xd8 },
+  16, 0x84c0, 0, {0x0c,0xb0,0x01,0x2d,0x20,0xdb,0x01,0x3a,0xc8,0x8c,0x38,0x03,0xa8,0x00,0xfb,0x48 },
+  16, 0x84d0, 0, {0x3e,0xc9,0x0f,0x80,0x03,0xec,0x40,0xfb,0x01,0x3e,0x00,0x0f,0x08,0x03,0xa4,0x08 },
+  16, 0x84e0, 0, {0xfa,0x80,0xb2,0x80,0x0f,0xb1,0x02,0x6a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x84f0, 0, {0x48,0x19,0x1c,0x80,0xbf,0x30,0x21,0xca,0x08,0xf0,0x0a,0x0c,0x80,0x8f,0x50,0x21 },
+  16, 0x8500, 0, {0xc2,0x08,0x70,0x50,0x9c,0x00,0xb7,0x00,0x39,0xc4,0x0b,0x40,0x02,0x9c,0x04,0xb7 },
+  16, 0x8510, 0, {0x20,0x25,0x40,0x0b,0x70,0x02,0x14,0x80,0xb6,0x00,0x21,0x80,0x0b,0xf8,0x02,0x12 },
+  16, 0x8520, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x00,0xb7,0xb0,0x21,0xec },
+  16, 0x8530, 0, {0x0b,0x78,0x12,0xde,0x84,0x97,0x80,0x0d,0xe0,0x28,0xf8,0x02,0xde,0x00,0xb7,0x90 },
+  16, 0x8540, 0, {0x2d,0xe4,0x0b,0x68,0x82,0x5e,0x80,0xb7,0xa0,0x29,0x20,0x0b,0x48,0x02,0x96,0x00 },
+  16, 0x8550, 0, {0xb7,0x80,0x21,0xe1,0x0b,0x7a,0x02,0x70,0x40,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8560, 0, {0x48,0x04,0xcc,0x00,0xb3,0x00,0x20,0xc0,0x0b,0x38,0x02,0x8c,0x04,0x83,0x00,0x28 },
+  16, 0x8570, 0, {0xc0,0x88,0x39,0x02,0x4c,0x40,0xb3,0x04,0x28,0xc0,0x1b,0x10,0x02,0x8c,0x01,0xb3 },
+  16, 0x8580, 0, {0x04,0x24,0x88,0x4b,0x31,0x02,0x04,0x00,0xb3,0x80,0x20,0xf2,0x0b,0x30,0x02,0x02 },
+  16, 0x8590, 0, {0x24,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x05,0xa8,0x00,0xfa,0x00,0x32,0x80 },
+  16, 0x85a0, 0, {0x0f,0xe8,0x03,0xe8,0x00,0xda,0x01,0x3a,0x80,0x8c,0xed,0x03,0xfb,0x04,0xfa,0x00 },
+  16, 0x85b0, 0, {0x3e,0x80,0x0f,0x6c,0x03,0xfb,0xc8,0xbe,0xc2,0x1f,0x80,0x0f,0xe5,0x03,0xa8,0x00 },
+  16, 0x85c0, 0, {0xfe,0x48,0x33,0x80,0x4f,0xa0,0x03,0x7a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x85d0, 0, {0x48,0x00,0xe0,0x00,0xf8,0x00,0x3c,0x00,0x0c,0x81,0x93,0x60,0x00,0xf8,0x01,0x36 },
+  16, 0x85e0, 0, {0x10,0x0f,0x80,0x03,0xa0,0x20,0xf8,0x00,0x2a,0x01,0x8f,0x84,0x13,0xe1,0x00,0xf8 },
+  16, 0x85f0, 0, {0x18,0x36,0x00,0x0f,0x80,0x13,0xe0,0x00,0xf8,0x20,0x3e,0x14,0x0f,0x80,0x03,0xd2 },
+  16, 0x8600, 0, {0x80,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0xe4,0x00,0xf1,0x00,0xaa,0x40 },
+  16, 0x8610, 0, {0x0c,0x90,0x03,0x24,0x00,0xe1,0x00,0x38,0x40,0x1c,0x90,0x03,0xe4,0x00,0xf9,0xa0 },
+  16, 0x8620, 0, {0x3a,0x40,0x47,0x9a,0x93,0xa2,0x80,0xf8,0x10,0x3e,0x40,0x0b,0x94,0x03,0xe6,0x40 },
+  16, 0x8630, 0, {0xf9,0xc0,0x3e,0x68,0x0b,0x10,0x03,0x02,0x84,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8640, 0, {0x80,0x04,0xe4,0x04,0xb9,0x00,0x22,0x40,0x08,0x90,0x02,0x24,0x04,0x89,0x00,0x36 },
+  16, 0x8650, 0, {0x40,0x08,0x90,0x02,0xe4,0x04,0xb9,0x80,0x2e,0x40,0x4f,0x94,0x03,0x61,0x10,0xe8 },
+  16, 0x8660, 0, {0x40,0x2e,0x40,0x0b,0x90,0x42,0xe6,0x04,0xb9,0x00,0x2e,0x40,0x0b,0x90,0x02,0x20 },
+  16, 0x8670, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x04,0x24,0x00,0xb9,0x00,0x22,0x40 },
+  16, 0x8680, 0, {0x0a,0x10,0x52,0x04,0x04,0xa9,0x04,0x2a,0x40,0x08,0xb0,0x02,0xe4,0x01,0xb9,0x00 },
+  16, 0x8690, 0, {0x2e,0x40,0x0b,0x90,0x02,0xa8,0x0d,0xb8,0x40,0x2e,0x40,0x09,0x94,0x02,0xe5,0x00 },
+  16, 0x86a0, 0, {0xb9,0x04,0x2e,0x40,0x0b,0x90,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x86b0, 0, {0x08,0x04,0x04,0x80,0xb1,0x20,0x20,0xc8,0x0a,0x10,0x42,0x04,0x90,0x81,0x20,0x04 },
+  16, 0x86c0, 0, {0xc8,0x08,0x30,0x26,0xc4,0x00,0xb1,0x20,0x2c,0x48,0x0b,0x90,0x02,0x45,0x01,0xb1 },
+  16, 0x86d0, 0, {0x40,0x2c,0x40,0x0b,0x12,0x82,0xc4,0x00,0xb1,0x2b,0x2c,0x4a,0x0b,0x12,0x82,0x02 },
+  16, 0x86e0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x08,0x21,0x48,0xf8,0x50,0x32,0x00 },
+  16, 0x86f0, 0, {0x4e,0x85,0x0b,0x21,0x40,0xa8,0x52,0x2a,0x00,0x08,0x80,0x23,0xe1,0x40,0xf8,0x00 },
+  16, 0x8700, 0, {0x3a,0x14,0x0f,0xa0,0x43,0xa8,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x82,0x03,0xe0,0x00 },
+  16, 0x8710, 0, {0xf0,0x20,0x3e,0x88,0x4f,0x82,0x0b,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8720, 0, {0x98,0x19,0xe4,0x40,0xf9,0x11,0x34,0x44,0x2d,0xd0,0x03,0xe4,0x50,0x79,0x10,0x38 },
+  16, 0x8730, 0, {0x44,0x2f,0xd0,0x03,0xf5,0x10,0xf9,0x10,0x3e,0x45,0x06,0x50,0x03,0xe5,0x00,0xe9 },
+  16, 0x8740, 0, {0x40,0x3f,0x40,0x0f,0xd0,0x43,0xf5,0x00,0xfd,0x28,0x3f,0x40,0x0f,0x92,0x83,0xe6 },
+  16, 0x8750, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x01,0xe6,0x00,0xd9,0x90,0x37,0x69 },
+  16, 0x8760, 0, {0x4d,0x90,0x23,0x67,0x80,0xd9,0xe0,0x37,0x68,0x0e,0xd0,0x07,0xa4,0x00,0x05,0x86 },
+  16, 0x8770, 0, {0x3e,0x66,0x0d,0x50,0x23,0x26,0x00,0xc9,0x82,0x3d,0x40,0x0d,0xd8,0x07,0x36,0x02 },
+  16, 0x8780, 0, {0xcd,0xc0,0x33,0x60,0x0c,0x9c,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8790, 0, {0x38,0x10,0xe2,0x80,0x88,0xa2,0x22,0x10,0x28,0x8a,0x82,0x23,0x84,0x88,0xa0,0x22 },
+  16, 0x87a0, 0, {0x14,0x48,0x80,0x42,0x82,0x00,0x88,0x40,0x2e,0x30,0x08,0x80,0x02,0xa2,0x00,0xd8 },
+  16, 0x87b0, 0, {0x90,0x26,0x00,0x08,0x84,0x0a,0x21,0x00,0xc8,0xa0,0xa2,0x14,0x28,0x8c,0x02,0x0e },
+  16, 0x87c0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc5,0x20,0x91,0x40,0x2c,0x44 },
+  16, 0x87d0, 0, {0x18,0x10,0x02,0x85,0x04,0xb1,0x40,0x0c,0x40,0x0a,0x10,0x06,0x84,0x30,0x81,0x40 },
+  16, 0x87e0, 0, {0x2c,0x48,0x59,0x10,0x1a,0x04,0x60,0x81,0x09,0x2e,0x40,0x1b,0x14,0x02,0x25,0x00 },
+  16, 0x87f0, 0, {0x91,0xe0,0x20,0x60,0x08,0x16,0x02,0x00,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8800, 0, {0x18,0x15,0xa4,0x00,0x81,0x00,0x2a,0x41,0x08,0x90,0x02,0xa4,0x00,0xa1,0x00,0x2a },
+  16, 0x8810, 0, {0x41,0x08,0xb0,0x82,0x24,0x11,0x8b,0x00,0x2e,0x40,0x18,0x91,0x02,0xa0,0x04,0x98 },
+  16, 0x8820, 0, {0x20,0x2e,0x54,0x1b,0x90,0x82,0x2c,0x00,0x89,0x10,0x22,0x44,0x88,0x90,0x02,0x06 },
+  16, 0x8830, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x00,0xd9,0x00,0x3e,0x40 },
+  16, 0x8840, 0, {0x4c,0x90,0x03,0xa4,0x10,0xf9,0x00,0x3e,0x40,0x8e,0x10,0x02,0xa4,0xc2,0xc9,0x00 },
+  16, 0x8850, 0, {0x3e,0x40,0x0d,0x16,0x13,0x01,0x84,0xc8,0x20,0x3c,0x60,0x0f,0x90,0x12,0x04,0x00 },
+  16, 0x8860, 0, {0xd9,0x40,0x32,0x50,0x0c,0x90,0x03,0x28,0x84,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8870, 0, {0x28,0x01,0x84,0x00,0xf9,0x00,0x36,0x40,0x4f,0x99,0x4a,0x44,0x00,0x99,0x00,0xb4 },
+  16, 0x8880, 0, {0x40,0x0f,0x90,0x13,0xe6,0x00,0xf9,0x00,0x3c,0x40,0x0f,0x90,0x03,0xe3,0x00,0xf8 },
+  16, 0x8890, 0, {0x01,0x36,0x40,0x0c,0x99,0x03,0xe4,0x02,0xf9,0x80,0x3e,0x60,0x4f,0x90,0x0b,0xca },
+  16, 0x88a0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xd8,0x00,0x3c,0x00 },
+  16, 0x88b0, 0, {0x1d,0x80,0x03,0x20,0x00,0xe8,0x00,0x32,0x00,0x0c,0x84,0x83,0xe0,0x10,0xe8,0x20 },
+  16, 0x88c0, 0, {0x32,0x00,0x8e,0x84,0x03,0x21,0x80,0xc8,0x00,0x3a,0x19,0x0f,0x04,0x03,0xe0,0x24 },
+  16, 0x88d0, 0, {0xf0,0x02,0x3c,0x00,0x0f,0x80,0x13,0x8a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x88e0, 0, {0x28,0x05,0x28,0x02,0x8a,0x01,0x0f,0xa2,0x68,0xa0,0x00,0x28,0x00,0x8a,0x00,0x77 },
+  16, 0x88f0, 0, {0x80,0x68,0xe0,0x12,0xe8,0x00,0xde,0x00,0x36,0x81,0x08,0xe0,0x03,0x7a,0x08,0xae },
+  16, 0x8900, 0, {0xc4,0x2f,0x80,0x08,0xed,0x02,0xfa,0x00,0xbe,0xa0,0x3b,0x80,0x0b,0xa0,0x42,0x0a },
+  16, 0x8910, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x85,0x4c,0x00,0x93,0x00,0x2c,0xc0 },
+  16, 0x8920, 0, {0x88,0xb0,0x02,0x0c,0x14,0xa3,0x04,0x20,0xc4,0x18,0x38,0x02,0xec,0x10,0x93,0x54 },
+  16, 0x8930, 0, {0x28,0xc0,0x0a,0x00,0x02,0x4e,0x00,0x83,0x49,0x68,0xc0,0x02,0x39,0x42,0xce,0x40 },
+  16, 0x8940, 0, {0xb3,0x00,0x2c,0xe6,0x0b,0xb0,0x02,0x8b,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8950, 0, {0x20,0x01,0x1c,0x08,0x87,0x20,0x2c,0x80,0x18,0xf2,0x22,0x1c,0x00,0x87,0x10,0x21 },
+  16, 0x8960, 0, {0xc0,0x08,0x70,0x82,0xdc,0x80,0x96,0x80,0x2d,0xc0,0x0a,0x40,0x02,0x7d,0x40,0x27 },
+  16, 0x8970, 0, {0x64,0x6d,0xd0,0x48,0x60,0x42,0xd8,0x05,0xb6,0x04,0x29,0xc0,0x4b,0x72,0x02,0x28 },
+  16, 0x8980, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x08,0x3e,0x88,0xd7,0xe0,0x3d,0xe0 },
+  16, 0x8990, 0, {0x08,0x7c,0x42,0x3e,0x00,0xe3,0x82,0x20,0xe0,0x0c,0x68,0x03,0xdf,0x04,0xd7,0x80 },
+  16, 0x89a0, 0, {0x3b,0xe0,0x4e,0x48,0x0a,0x5e,0x80,0xc7,0xc2,0x19,0xe0,0x0e,0x78,0x03,0xd6,0x08 },
+  16, 0x89b0, 0, {0xf7,0x80,0x3d,0xe0,0x0f,0xf8,0x03,0xaa,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x89c0, 0, {0x08,0x1d,0xac,0x40,0xfb,0x40,0x7e,0x80,0x0e,0x36,0x83,0xed,0x40,0xdb,0x60,0x3e },
+  16, 0x89d0, 0, {0x80,0x0f,0xa0,0x03,0xed,0x28,0xda,0x00,0x32,0xc4,0x0c,0xb0,0x0b,0xcc,0x00,0xfb },
+  16, 0x89e0, 0, {0x00,0x3e,0xc0,0x0e,0x80,0x13,0xe0,0x10,0xf8,0x00,0x3e,0x00,0x0f,0xb1,0x53,0xc2 },
+  16, 0x89f0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xfe,0x00,0xff,0xc0,0x33,0xe0 },
+  16, 0x8a00, 0, {0x0c,0xf9,0x03,0x7f,0x04,0xcf,0xd0,0x3f,0xe4,0x0f,0xb8,0x03,0xfe,0x00,0xff,0x94 },
+  16, 0x8a10, 0, {0x3f,0xe0,0x0f,0xc8,0x03,0x7e,0x10,0xf3,0x80,0x3b,0xe0,0x0f,0xf8,0x03,0xfe,0x48 },
+  16, 0x8a20, 0, {0xed,0x80,0x33,0x24,0x04,0xf8,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8a30, 0, {0xa8,0x11,0x9c,0x80,0xbf,0x04,0x21,0x28,0x08,0xf8,0x02,0x1e,0xc0,0xcf,0x90,0x21 },
+  16, 0x8a40, 0, {0x4c,0x0b,0x5a,0x42,0xde,0x00,0xb7,0x80,0x2c,0xe8,0x0b,0x04,0x02,0x1c,0x00,0xb7 },
+  16, 0x8a50, 0, {0xa0,0x35,0x10,0x8f,0x71,0x13,0xde,0xc0,0x84,0x10,0x21,0x80,0x0d,0x71,0x02,0x2a },
+  16, 0x8a60, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x40,0x9c,0x08,0xb7,0x00,0x25,0xc8 },
+  16, 0x8a70, 0, {0x08,0x71,0x02,0xcc,0x80,0x97,0x00,0x29,0xc0,0x8b,0x72,0x06,0xdc,0x08,0xb5,0x00 },
+  16, 0x8a80, 0, {0x2d,0xc8,0x0b,0x40,0x02,0x1c,0x40,0xbf,0x10,0x21,0xc0,0x0b,0x74,0x02,0xd4,0x80 },
+  16, 0x8a90, 0, {0xa7,0x40,0x21,0x41,0x08,0x70,0x02,0x04,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8aa0, 0, {0x60,0x14,0xcc,0x00,0xb3,0x00,0x24,0x00,0x08,0x34,0x82,0xac,0x11,0x83,0x00,0x20 },
+  16, 0x8ab0, 0, {0x00,0x4b,0x18,0x26,0xcf,0x20,0xb1,0x06,0x2c,0xc1,0x0b,0x32,0x02,0x0e,0x08,0xb3 },
+  16, 0x8ac0, 0, {0x88,0x24,0x32,0x0a,0x30,0x12,0x84,0x08,0x80,0x00,0xa0,0x34,0x28,0x30,0x02,0x18 },
+  16, 0x8ad0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x11,0xbc,0x00,0xff,0x00,0xb6,0x40 },
+  16, 0x8ae0, 0, {0x2c,0xf4,0x43,0xfc,0x01,0xdf,0x00,0x3a,0x00,0x03,0x92,0x03,0xff,0x88,0xf9,0x00 },
+  16, 0x8af0, 0, {0x2f,0xc0,0x1b,0x0e,0x4b,0x2e,0x90,0xfb,0xe0,0x30,0x32,0x0b,0x98,0x02,0xec,0x08 },
+  16, 0x8b00, 0, {0x6b,0xc0,0x32,0xc0,0x08,0xf0,0x09,0x3e,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8b10, 0, {0x80,0x00,0xec,0x00,0xf3,0x00,0x3a,0xc0,0x0f,0xb0,0x01,0x6c,0x00,0xfb,0x00,0x3a },
+  16, 0x8b20, 0, {0x10,0x0f,0xb4,0x03,0xec,0x00,0xf0,0x00,0x3c,0xc0,0x0f,0x80,0x0b,0xad,0x20,0xfb },
+  16, 0x8b30, 0, {0x40,0x3e,0x10,0x07,0xa8,0x63,0xe0,0x00,0xfb,0x80,0x3e,0xd8,0x0f,0xb0,0x03,0xe0 },
+  16, 0x8b40, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x00,0xff,0x00,0x72,0x00 },
+  16, 0x8b50, 0, {0x0f,0xf0,0x23,0xfc,0x00,0xdf,0x00,0x3f,0x40,0x0f,0xc0,0x03,0xdc,0x00,0x8f,0x00 },
+  16, 0x8b60, 0, {0x33,0xc1,0x0c,0xc0,0x03,0xbe,0x00,0xff,0x90,0x3b,0x28,0x0e,0x59,0x03,0x2e,0x00 },
+  16, 0x8b70, 0, {0x7b,0x00,0x32,0xc4,0x0f,0xb0,0x03,0xd0,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8b80, 0, {0xc1,0x04,0x6c,0x00,0xbb,0x00,0x62,0xa0,0x0f,0xb0,0x02,0xec,0x09,0x8b,0x00,0x2e },
+  16, 0x8b90, 0, {0x30,0x0b,0xa8,0x03,0xac,0x00,0xfa,0xc1,0x22,0xc1,0x08,0x8c,0x02,0x2c,0x00,0xb3 },
+  16, 0x8ba0, 0, {0x81,0x2a,0x00,0x0d,0x88,0xb2,0x22,0x00,0xb3,0xc0,0x22,0xc8,0x0b,0xb0,0x42,0x61 },
+  16, 0x8bb0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x6c,0x00,0xbb,0x01,0x22,0x62 },
+  16, 0x8bc0, 0, {0x0b,0xb0,0x02,0xec,0x04,0x8b,0x00,0x2e,0xa2,0x49,0x88,0x26,0xec,0x00,0xa8,0x80 },
+  16, 0x8bd0, 0, {0x22,0xc0,0x28,0x82,0x0a,0xac,0xa0,0xbb,0x08,0x22,0xc0,0x08,0x80,0x0a,0x28,0x84 },
+  16, 0x8be0, 0, {0xb9,0xc0,0xa2,0x00,0x0b,0xb0,0x02,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8bf0, 0, {0x08,0x04,0x0c,0x00,0xb3,0x10,0x20,0x48,0x0a,0x32,0x02,0xcc,0x80,0x83,0x01,0x24 },
+  16, 0x8c00, 0, {0x00,0x0b,0x02,0x06,0x8c,0x60,0xa0,0x20,0x20,0xc8,0x08,0x01,0x02,0x0c,0x00,0xb3 },
+  16, 0x8c10, 0, {0x00,0x28,0x00,0x09,0x20,0x02,0x08,0x80,0xb1,0x00,0xa0,0x80,0x0b,0x30,0x02,0x42 },
+  16, 0x8c20, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x6c,0x00,0xff,0x00,0xa2,0x0e },
+  16, 0x8c30, 0, {0x0b,0xf1,0x03,0xfc,0x08,0xcf,0x20,0x3e,0xc0,0x0f,0x80,0x03,0xfc,0x84,0xa8,0x20 },
+  16, 0x8c40, 0, {0xb2,0xc8,0x8c,0x80,0x03,0xac,0x44,0xfb,0x70,0x3a,0xc0,0x0e,0x90,0x03,0x2c,0xa4 },
+  16, 0x8c50, 0, {0xfb,0x00,0xb2,0x40,0x0f,0xb0,0x03,0xc0,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8c60, 0, {0xa0,0x1d,0xfc,0x00,0xff,0x26,0x3e,0x00,0x0f,0xb6,0x13,0xed,0x00,0xfb,0x10,0x3f },
+  16, 0x8c70, 0, {0x00,0x0f,0xc1,0x13,0xac,0x80,0xf8,0x12,0x3e,0xc6,0x4f,0x42,0x43,0xfc,0x04,0xff },
+  16, 0x8c80, 0, {0x31,0x3f,0x00,0x0f,0xf0,0x03,0xec,0x00,0xff,0x00,0xbf,0xc0,0x8f,0xf0,0x03,0xe8 },
+  16, 0x8c90, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0xfc,0x40,0xfc,0x80,0x36,0xc8 },
+  16, 0x8ca0, 0, {0x0f,0x09,0x03,0xc2,0x00,0xf8,0xc0,0x33,0xcc,0x2c,0x4c,0x03,0x63,0x90,0xe0,0x90 },
+  16, 0x8cb0, 0, {0x3a,0xc0,0x0d,0x50,0x0b,0x3c,0x04,0xdf,0x64,0x3f,0xc8,0x8d,0xf1,0x43,0x2c,0x00 },
+  16, 0x8cc0, 0, {0xd5,0x00,0x33,0xc0,0x45,0xf2,0x23,0x70,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8cd0, 0, {0x80,0x10,0xed,0x80,0xba,0x02,0x21,0xde,0x8b,0x82,0x22,0xe0,0x20,0xb0,0x00,0x2b },
+  16, 0x8ce0, 0, {0xec,0x09,0x80,0x02,0xe3,0x40,0xba,0x20,0x2f,0xdc,0x08,0x98,0x12,0x2c,0x00,0x8b },
+  16, 0x8cf0, 0, {0x51,0x2a,0xd0,0x08,0x72,0x22,0x2e,0x00,0x8d,0x80,0x21,0xd0,0x08,0xb6,0x82,0x20 },
+  16, 0x8d00, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x40,0xb9,0x28,0x24,0xc0 },
+  16, 0x8d10, 0, {0x4a,0x12,0x12,0x88,0x85,0xa8,0x20,0x20,0xc0,0x0b,0x22,0x02,0xc0,0x91,0xa1,0x00 },
+  16, 0x8d20, 0, {0x28,0xc2,0x0b,0x00,0x12,0x8c,0x40,0xa3,0x20,0x20,0xc4,0x0b,0x30,0x0a,0x0c,0x11 },
+  16, 0x8d30, 0, {0x99,0x00,0x20,0xc5,0x09,0x01,0x02,0x62,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8d40, 0, {0xc0,0x11,0xac,0x00,0xb8,0x80,0x22,0xc0,0x0b,0x88,0x02,0xee,0x01,0xb8,0xc1,0x2a },
+  16, 0x8d50, 0, {0xc0,0x1b,0xa8,0x06,0xe2,0x00,0xbb,0x80,0x2e,0xc0,0x8a,0x80,0x02,0xac,0x00,0xab },
+  16, 0x8d60, 0, {0x00,0x2e,0xc0,0x0a,0xb0,0x02,0x2c,0x00,0x99,0x00,0x24,0xc0,0x08,0x80,0x02,0x30 },
+  16, 0x8d70, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xec,0x00,0xb0,0x80,0x36,0xc0 },
+  16, 0x8d80, 0, {0x0e,0xa8,0x13,0xe2,0x85,0xf3,0xc0,0x32,0xc0,0x0e,0x9c,0x23,0xe7,0x24,0xe8,0x82 },
+  16, 0x8d90, 0, {0x3a,0xc1,0x0f,0x94,0x03,0xac,0x02,0xeb,0x00,0x3e,0xc0,0x0f,0xb0,0x03,0x2e,0x10 },
+  16, 0x8da0, 0, {0x51,0x00,0xb2,0xc0,0x0d,0xb0,0x03,0x50,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8db0, 0, {0xe0,0x01,0xbc,0x00,0xff,0x00,0x3f,0xc0,0x8f,0xd0,0x03,0xf0,0x04,0xfd,0x04,0x3f },
+  16, 0x8dc0, 0, {0xc0,0x4c,0xc0,0x03,0xf0,0x10,0xfc,0x00,0x1f,0xc0,0x0d,0xd1,0x23,0x1c,0x00,0xc7 },
+  16, 0x8dd0, 0, {0x00,0x39,0xc0,0x0d,0xf0,0x83,0xfe,0x44,0xed,0x00,0x3b,0xc0,0x0f,0x74,0x03,0xf8 },
+  16, 0x8de0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xf9,0x01,0xba,0xc1 },
+  16, 0x8df0, 0, {0x0c,0xb0,0x03,0xa1,0x08,0xfa,0x00,0x30,0xc8,0x8f,0x94,0x03,0x25,0x00,0xf9,0x00 },
+  16, 0x8e00, 0, {0x3c,0xc0,0x0f,0x04,0x83,0xec,0x00,0xfb,0x00,0x3e,0xe0,0x0f,0x71,0x0b,0x2c,0x40 },
+  16, 0x8e10, 0, {0xfd,0x08,0x37,0xc0,0x4e,0x91,0x03,0x90,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8e20, 0, {0xc8,0x05,0x3c,0x00,0xb9,0x00,0x23,0xc0,0x08,0x90,0x02,0x24,0x00,0xc8,0x00,0x37 },
+  16, 0x8e30, 0, {0xf0,0x0b,0x80,0x01,0x64,0x00,0x49,0x02,0x33,0xc0,0x84,0x9c,0x03,0x3c,0x00,0xbf },
+  16, 0x8e40, 0, {0x02,0x0f,0xd0,0x08,0xf4,0x02,0x0e,0x10,0xbd,0x80,0x33,0xe0,0x08,0x90,0x0a,0x32 },
+  16, 0x8e50, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x00,0xb0,0x06,0x20,0xc0 },
+  16, 0x8e60, 0, {0x08,0x00,0x42,0x84,0x00,0xa0,0x00,0x20,0xf0,0x0b,0x00,0x22,0xcc,0x00,0x90,0x00 },
+  16, 0x8e70, 0, {0x28,0xc0,0x02,0x3d,0x02,0x8c,0x00,0xb3,0x00,0x2c,0xc2,0x9a,0x38,0x02,0x06,0x04 },
+  16, 0x8e80, 0, {0xb1,0x12,0x20,0xe0,0x08,0x30,0x02,0x38,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8e90, 0, {0x20,0x01,0x1e,0x00,0xb6,0x80,0x21,0xe0,0x28,0xea,0x02,0x36,0x80,0x86,0x90,0x65 },
+  16, 0x8ea0, 0, {0xe0,0x1b,0xda,0x06,0x5e,0x01,0x9e,0x84,0x25,0xec,0x0a,0x78,0x02,0x5e,0x00,0xb7 },
+  16, 0x8eb0, 0, {0x80,0x2d,0xe0,0x08,0x79,0x4a,0x16,0x40,0xbd,0x80,0x25,0xe0,0x08,0x38,0x02,0x08 },
+  16, 0x8ec0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0xfb,0x00,0x28,0xe0 },
+  16, 0x8ed0, 0, {0x08,0x18,0x02,0x8a,0x88,0xa1,0xa0,0x20,0xc2,0x1f,0x2a,0x23,0xe6,0xc8,0xf0,0xc0 },
+  16, 0x8ee0, 0, {0x3a,0xed,0x4e,0x34,0x02,0x8c,0x08,0xf3,0x81,0x1e,0xc0,0x0e,0x30,0x03,0x0e,0xc0 },
+  16, 0x8ef0, 0, {0xf1,0x00,0xb0,0xca,0x0e,0x21,0x03,0x92,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8f00, 0, {0x40,0x1d,0xbc,0x08,0xfe,0x10,0x3f,0xd2,0x0f,0xe0,0x03,0xec,0x04,0xff,0x14,0x7e },
+  16, 0x8f10, 0, {0xc0,0x0f,0xb1,0x23,0xfc,0x01,0xee,0x00,0x3a,0xc4,0x0d,0xb0,0x13,0xbc,0x00,0xff },
+  16, 0x8f20, 0, {0x00,0x3f,0xc0,0x0e,0xf0,0x83,0xfc,0x0c,0xfd,0x10,0x3b,0xc0,0x2f,0xe1,0x03,0xd0 },
+  16, 0x8f30, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x40,0xf0,0x80,0x32,0xd0 },
+  16, 0x8f40, 0, {0x0c,0xa0,0x03,0x6c,0x00,0xf3,0x80,0x32,0xda,0x0f,0xb0,0x03,0xec,0x00,0xfb,0x00 },
+  16, 0x8f50, 0, {0x3e,0xcc,0x4c,0x98,0x13,0x2c,0x10,0xfb,0x04,0x3e,0xc4,0x0c,0xf2,0x83,0xa6,0x10 },
+  16, 0x8f60, 0, {0xdd,0x20,0x3f,0xd1,0x0c,0xb0,0x03,0xea,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8f70, 0, {0x48,0x11,0x9c,0x80,0xb7,0x00,0x21,0xc8,0x0c,0x70,0x02,0xdc,0x08,0xb7,0x00,0x21 },
+  16, 0x8f80, 0, {0xc8,0x0e,0x70,0x22,0xd8,0x00,0xb7,0x00,0x2c,0xc2,0x0a,0x70,0x0a,0x1f,0x08,0xb7 },
+  16, 0x8f90, 0, {0x00,0x39,0xc8,0x0a,0x70,0x02,0x14,0x00,0xc5,0x69,0x2c,0xca,0x2a,0x70,0x02,0xd2 },
+  16, 0x8fa0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x00,0xbf,0x81,0x64,0xe1 },
+  16, 0x8fb0, 0, {0x08,0x78,0x02,0x5a,0x01,0xbf,0x80,0x21,0xec,0x4b,0x78,0x46,0x9f,0x08,0x37,0x80 },
+  16, 0x8fc0, 0, {0x2d,0xe8,0x88,0x18,0x02,0x1e,0x81,0xb7,0xb0,0x2d,0xe0,0x09,0x7a,0x02,0x8e,0x00 },
+  16, 0x8fd0, 0, {0x95,0xa0,0x2d,0xe4,0x08,0x78,0x02,0xf0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8fe0, 0, {0x48,0x14,0xec,0x00,0xb3,0x60,0x20,0xc0,0x08,0xb6,0x02,0xcc,0x00,0xb3,0x01,0x20 },
+  16, 0x8ff0, 0, {0xc0,0x8a,0xb0,0x86,0xcf,0x00,0xbb,0x10,0x6c,0xc1,0x0a,0x38,0x02,0x0c,0x01,0xb3 },
+  16, 0x9000, 0, {0x02,0x28,0xc0,0x0b,0xb0,0x0a,0x0c,0x00,0x81,0x00,0x2e,0xc0,0x0a,0xb4,0x82,0xd2 },
+  16, 0x9010, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x00,0xfe,0x40,0xb6,0x80 },
+  16, 0x9020, 0, {0x0c,0xe4,0x03,0x78,0x80,0xfe,0x74,0x32,0x80,0x0b,0xe6,0x03,0xf9,0x00,0xfe,0x00 },
+  16, 0x9030, 0, {0x3e,0x80,0x0c,0xe0,0x03,0x28,0x00,0xfa,0x00,0x3e,0x80,0x4d,0xa0,0x03,0xa8,0x00 },
+  16, 0x9040, 0, {0xda,0x04,0x3e,0x80,0x0c,0xe4,0x03,0xfa,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9050, 0, {0x48,0x00,0xe0,0x00,0xf8,0x00,0x3e,0x00,0x2e,0x80,0x23,0xe0,0x00,0xf8,0x01,0x3c },
+  16, 0x9060, 0, {0x00,0x0e,0x80,0x03,0xe0,0x20,0xf8,0x20,0x3e,0x01,0x8f,0x89,0x03,0xe0,0x00,0xf8 },
+  16, 0x9070, 0, {0x00,0x3a,0x10,0x0e,0x80,0x01,0xe0,0x00,0xe8,0x40,0x7e,0x00,0x4f,0x80,0x03,0xd2 },
+  16, 0x9080, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x02,0xc9,0x01,0x7e,0x40 },
+  16, 0x9090, 0, {0x2c,0x90,0x0b,0x24,0x00,0xf9,0x00,0x3e,0x68,0x05,0x90,0x13,0xa4,0x04,0xd9,0x00 },
+  16, 0x90a0, 0, {0x32,0x41,0x0e,0x91,0x03,0xe4,0x00,0xf9,0x00,0x3e,0x60,0x0e,0x90,0x03,0x24,0x00 },
+  16, 0x90b0, 0, {0xf1,0x00,0x32,0x40,0x68,0x90,0x43,0x82,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x90c0, 0, {0x80,0x04,0x64,0x00,0x89,0x00,0x6e,0x40,0x08,0x90,0x42,0x24,0x00,0xb9,0x00,0x2e },
+  16, 0x90d0, 0, {0x70,0x88,0x90,0x03,0x24,0x00,0xb9,0x00,0x22,0x40,0x08,0x98,0x12,0xe4,0x00,0xb9 },
+  16, 0x90e0, 0, {0x00,0x2e,0x40,0x0a,0x90,0x0a,0x26,0x00,0xb9,0x80,0xa2,0x40,0x08,0x90,0x12,0x20 },
+  16, 0x90f0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0x89,0x04,0x2c,0x40 },
+  16, 0x9100, 0, {0x08,0x90,0x02,0x24,0x01,0xb9,0x00,0x2a,0x40,0x0b,0xb0,0x02,0xa4,0x01,0xb9,0x00 },
+  16, 0x9110, 0, {0xe0,0x40,0x0a,0x90,0x82,0xa4,0x00,0xb9,0x00,0x2c,0x48,0x0a,0x98,0x02,0x24,0x80 },
+  16, 0x9120, 0, {0x39,0x20,0x22,0x40,0x2a,0x90,0x02,0x86,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9130, 0, {0x08,0x04,0x04,0x80,0x81,0x00,0x2c,0x48,0x08,0x10,0x12,0x04,0x10,0xb1,0x04,0x2c },
+  16, 0x9140, 0, {0xd8,0x0a,0x10,0x02,0x04,0x00,0xb1,0x00,0x20,0x48,0x08,0x10,0x02,0xc4,0x80,0xb1 },
+  16, 0x9150, 0, {0x22,0x2c,0x50,0x8a,0x32,0x82,0x05,0xa0,0xb1,0x2a,0x20,0x4a,0x0a,0x12,0x82,0x02 },
+  16, 0x9160, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x61,0x50,0xc8,0x52,0x2e,0x14 },
+  16, 0x9170, 0, {0x0c,0x85,0x03,0x21,0x40,0xf8,0x50,0x3a,0x00,0x1f,0x85,0x03,0xa1,0x40,0xf8,0x50 },
+  16, 0x9180, 0, {0x32,0x14,0x0e,0x80,0x03,0xa1,0x40,0xf8,0x50,0x3c,0x80,0x0e,0x02,0x03,0x20,0x80 },
+  16, 0x9190, 0, {0xfa,0x20,0x32,0x08,0x0e,0x82,0x13,0xae,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x91a0, 0, {0x98,0x1d,0xe4,0x50,0xfd,0x00,0x3e,0x44,0x0f,0xd0,0x03,0xf4,0x00,0xfd,0x00,0x3e },
+  16, 0x91b0, 0, {0x44,0x8d,0xd0,0x01,0xbd,0x00,0xfd,0x02,0x3e,0x44,0x0f,0xd4,0x00,0xe4,0x48,0x79 },
+  16, 0x91c0, 0, {0x14,0x3e,0x50,0x0f,0x92,0xa2,0xf4,0x08,0xfd,0x00,0x3e,0x4a,0x0d,0xd2,0x83,0xe6 },
+  16, 0x91d0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xe7,0x00,0xf9,0x10,0x3a,0x6e },
+  16, 0x91e0, 0, {0x0c,0xb1,0x03,0xe4,0x40,0xf9,0x44,0x3b,0x61,0x8e,0x94,0x03,0xe4,0x00,0xe9,0x40 },
+  16, 0x91f0, 0, {0x32,0x66,0x0f,0xda,0x0b,0xa7,0x28,0xc9,0xe0,0x3f,0x68,0x0c,0xda,0x83,0xb3,0x20 },
+  16, 0x9200, 0, {0xed,0xa0,0x33,0x79,0x08,0xd8,0x03,0x46,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9210, 0, {0x38,0x10,0xe2,0x00,0xb8,0xa0,0x2e,0x38,0x08,0x8a,0x02,0xe2,0x88,0xe8,0x81,0x2e },
+  16, 0x9220, 0, {0x14,0x09,0x0a,0x03,0xe2,0x80,0xb8,0x80,0x32,0x30,0x0b,0x85,0x02,0x21,0x01,0xa8 },
+  16, 0x9230, 0, {0xf4,0x38,0x2a,0x08,0x0e,0xca,0x23,0x90,0xc8,0x54,0x34,0x38,0x08,0x8a,0x92,0x0e },
+  16, 0x9240, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc5,0x00,0xb1,0x00,0x28,0x40 },
+  16, 0x9250, 0, {0x19,0x10,0x02,0xc4,0x00,0xb1,0x20,0x28,0x40,0x0b,0x10,0x06,0xc4,0x20,0xa1,0xa2 },
+  16, 0x9260, 0, {0x6c,0x48,0x0b,0x10,0x02,0x84,0x08,0x81,0x20,0x2c,0x50,0x09,0x10,0x02,0xc4,0x04 },
+  16, 0x9270, 0, {0xb1,0x00,0x24,0x58,0x08,0x3c,0x02,0x42,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9280, 0, {0x18,0x15,0xa4,0x01,0xb9,0x20,0x2c,0x40,0x09,0x90,0x02,0xe4,0x10,0xa9,0x40,0x2e },
+  16, 0x9290, 0, {0x40,0x0b,0x90,0x02,0xa4,0x00,0xb1,0x01,0x2a,0x40,0x0b,0x94,0x02,0x24,0x00,0xa9 },
+  16, 0x92a0, 0, {0x00,0x2a,0x40,0x01,0x10,0x52,0x64,0x00,0x89,0x00,0x26,0x40,0x00,0x98,0x02,0x46 },
+  16, 0x92b0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x00,0xf9,0x61,0x3a,0x40 },
+  16, 0x92c0, 0, {0x0d,0x90,0x83,0xe5,0x20,0xf9,0x01,0x3a,0x40,0x2e,0x90,0x02,0xe4,0x40,0xe9,0x01 },
+  16, 0x92d0, 0, {0x9e,0x40,0x0f,0x94,0x03,0xa4,0x00,0x89,0x00,0x3e,0x40,0x2d,0x90,0x02,0xe6,0x08 },
+  16, 0x92e0, 0, {0xb9,0x01,0x36,0x40,0x2c,0x90,0x01,0x68,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x92f0, 0, {0x28,0x01,0xa4,0x00,0xf9,0x00,0x3e,0x40,0x2e,0x90,0x03,0xe4,0x80,0xf9,0x00,0x3c },
+  16, 0x9300, 0, {0x40,0x0c,0x9c,0x23,0xe4,0x00,0xf9,0x00,0x36,0x40,0x0f,0x10,0x43,0x84,0x00,0xf9 },
+  16, 0x9310, 0, {0x02,0x3e,0x40,0x0e,0x90,0x03,0x80,0x80,0xf9,0x00,0x3c,0x40,0x2f,0x90,0x03,0x8a },
+  16, 0x9320, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xc8,0x40,0x36,0x01 },
+  16, 0x9330, 0, {0x0d,0x84,0x03,0xe1,0x00,0xe8,0x40,0x3e,0x08,0x0c,0x80,0x03,0xe1,0x00,0xf8,0x00 },
+  16, 0x9340, 0, {0x32,0x00,0x8f,0x80,0x03,0xa0,0x10,0xf8,0x00,0x32,0x04,0x0e,0x80,0x83,0x60,0x00 },
+  16, 0x9350, 0, {0xf8,0x00,0x3e,0x00,0x0c,0x00,0x03,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9360, 0, {0x28,0x05,0x28,0x00,0x8a,0x01,0x22,0x80,0x08,0xa0,0x24,0xe8,0x00,0x0a,0x00,0x2f },
+  16, 0x9370, 0, {0x80,0x1a,0xa0,0x02,0x28,0x00,0xba,0x00,0x16,0x80,0x0b,0xe0,0x03,0x28,0x08,0xea },
+  16, 0x9380, 0, {0x00,0x33,0x90,0x08,0xec,0x1b,0x22,0x80,0xc6,0x14,0x2f,0x91,0x08,0xa0,0x43,0x4a },
+  16, 0x9390, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0x93,0x00,0x24,0xc0 },
+  16, 0x93a0, 0, {0x09,0x30,0x12,0xcc,0x04,0xa3,0x04,0x6c,0xc0,0x09,0x30,0x02,0x8c,0x00,0xb3,0x00 },
+  16, 0x93b0, 0, {0x2c,0xc0,0x13,0x30,0x02,0x8c,0x00,0xb3,0x00,0xe6,0xb8,0x0a,0x38,0x02,0x44,0x08 },
+  16, 0x93c0, 0, {0x82,0x50,0x2c,0xd2,0x3a,0x30,0x02,0x8a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x93d0, 0, {0xa0,0x01,0x0e,0x80,0x97,0xb4,0x21,0xc4,0x49,0x71,0x02,0xde,0x81,0x87,0x21,0x2d },
+  16, 0x93e0, 0, {0xd0,0x0b,0x7b,0x02,0x1c,0x01,0xbf,0x20,0x29,0xc4,0x0b,0x30,0x02,0x5c,0x00,0xa7 },
+  16, 0x93f0, 0, {0xa1,0x21,0xc0,0x4a,0x70,0x8a,0x0c,0x81,0x84,0x00,0x2d,0xd0,0x0a,0x50,0x02,0xe8 },
+  16, 0x9400, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0x82,0xdf,0xa0,0x34,0xec },
+  16, 0x9410, 0, {0x0d,0x79,0x02,0xfe,0x80,0xe7,0xe8,0x2f,0xa0,0x09,0x7a,0x02,0x9e,0x00,0xf7,0xa2 },
+  16, 0x9420, 0, {0x25,0xea,0x0b,0x48,0x03,0x9e,0x04,0xff,0xc0,0x65,0xe4,0x0e,0x68,0x03,0x5f,0x00 },
+  16, 0x9430, 0, {0xe4,0x80,0x3d,0xe0,0x0e,0xf8,0x03,0xaa,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9440, 0, {0x08,0x1d,0xac,0x48,0xeb,0x05,0x3e,0xd9,0x0e,0xb2,0x03,0xec,0x00,0xfb,0x60,0x3e },
+  16, 0x9450, 0, {0xc0,0x0e,0xb2,0x83,0xac,0x00,0xf3,0x50,0xa6,0xc0,0x4f,0xb0,0x03,0xac,0x00,0xfb },
+  16, 0x9460, 0, {0x80,0x3f,0xd8,0x0d,0xa0,0x03,0xec,0x0a,0xf9,0x00,0x3e,0xc0,0x0d,0x90,0x03,0x42 },
+  16, 0x9470, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xfe,0x00,0xbb,0x90,0x3e,0xe0 },
+  16, 0x9480, 0, {0x08,0x39,0x03,0x9e,0x20,0xcf,0x82,0x77,0xe0,0x1f,0xf8,0x03,0xee,0x00,0xff,0xc0 },
+  16, 0x9490, 0, {0x3f,0xe5,0x0d,0xf9,0x03,0xee,0x00,0xfb,0x90,0x37,0xa0,0x08,0xf8,0x0f,0x1e,0x00 },
+  16, 0x94a0, 0, {0xcc,0x94,0x33,0x60,0x0d,0xf8,0x03,0xc0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x94b0, 0, {0xa8,0x11,0x9c,0x00,0xb7,0x90,0x2f,0xe4,0x08,0x7a,0x02,0x1e,0x00,0x8f,0x12,0x25 },
+  16, 0x94c0, 0, {0xd8,0x0b,0xbb,0x02,0x1e,0x00,0xb7,0x00,0x2d,0xe8,0x08,0x7d,0x82,0xde,0x40,0xbb },
+  16, 0x94d0, 0, {0xa0,0x27,0x90,0x0a,0x76,0x02,0x5c,0x80,0x85,0x00,0x37,0xc4,0x4d,0x71,0x03,0xea },
+  16, 0x94e0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x00,0xb7,0x20,0x2d,0xc0 },
+  16, 0x94f0, 0, {0x29,0xf2,0x22,0xbc,0x80,0x97,0x00,0x25,0x41,0x0b,0x70,0x12,0x9c,0x00,0xb7,0x08 },
+  16, 0x9500, 0, {0x29,0xc0,0x08,0x42,0x12,0xdc,0x40,0xb7,0x00,0x29,0xc0,0x09,0x60,0x22,0xdc,0x10 },
+  16, 0x9510, 0, {0x80,0x00,0x21,0x40,0x09,0x70,0x02,0xc0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9520, 0, {0x20,0x14,0xcc,0x00,0xb3,0xc0,0x2e,0xc0,0x08,0x34,0x82,0x2d,0x00,0x93,0x00,0x24 },
+  16, 0x9530, 0, {0xc0,0x0b,0x30,0x02,0x0f,0x80,0x13,0x00,0x2c,0xc0,0x0a,0x34,0xa2,0xec,0x00,0xb3 },
+  16, 0x9540, 0, {0x00,0x28,0xc0,0x0b,0x00,0x02,0xcc,0x00,0x81,0x00,0x20,0xc0,0x09,0x30,0x02,0x89 },
+  16, 0x9550, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x11,0xbc,0x00,0xff,0xe0,0x3f,0xc0 },
+  16, 0x9560, 0, {0x0c,0xf4,0x83,0xbd,0x00,0xdf,0x08,0x36,0x40,0x0b,0x75,0x42,0xfc,0x20,0xff,0x80 },
+  16, 0x9570, 0, {0x3b,0xc0,0x2c,0x3c,0x03,0xfc,0x00,0xbf,0x00,0xbe,0xc0,0x8d,0x90,0x0b,0xac,0x02 },
+  16, 0x9580, 0, {0xca,0x00,0x22,0x80,0x0d,0xb0,0x02,0xea,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9590, 0, {0x80,0x00,0xec,0x00,0xfb,0x08,0x1e,0xc0,0x0f,0xb0,0x13,0xec,0x00,0xeb,0x00,0x3a },
+  16, 0x95a0, 0, {0x10,0x0f,0xb0,0x23,0xac,0x01,0xfb,0x00,0x3e,0xc0,0x3c,0x84,0x03,0xec,0x00,0xfb },
+  16, 0x95b0, 0, {0x00,0x26,0x40,0x0e,0x94,0x0b,0x2c,0x00,0xf9,0x40,0x3e,0x90,0x0e,0x90,0x13,0xe0 },
+  16, 0x95c0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xdc,0x02,0xcf,0x00,0x3f,0xc0 },
+  16, 0x95d0, 0, {0x0d,0xf0,0x0b,0x3c,0x20,0xcf,0x00,0x3d,0x00,0x0e,0xf0,0x07,0x9c,0x01,0xcf,0x02 },
+  16, 0x95e0, 0, {0x3e,0xc0,0x0f,0xc4,0x03,0x3c,0x00,0xcf,0x00,0x0f,0xc0,0x0e,0x44,0x03,0x1f,0x02 },
+  16, 0x95f0, 0, {0xcc,0x00,0x3f,0x80,0x2c,0x70,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9600, 0, {0x81,0x04,0x6c,0x00,0x8b,0x02,0x2e,0xc0,0x0d,0xb0,0x02,0x2c,0x00,0xab,0x00,0x06 },
+  16, 0x9610, 0, {0x20,0x08,0xb0,0x03,0xfc,0x00,0xab,0x00,0x2e,0xc0,0x0f,0x80,0x06,0xbc,0x00,0xab },
+  16, 0x9620, 0, {0x04,0x3a,0xf0,0x0c,0x88,0x02,0x2c,0x00,0xc9,0x80,0x3a,0x92,0x08,0x90,0x0a,0xa0 },
+  16, 0x9630, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0xab,0x00,0x2e,0xc0 },
+  16, 0x9640, 0, {0x09,0x30,0x02,0x2c,0x00,0x8b,0x00,0x26,0x60,0x0b,0xb0,0x02,0xac,0x00,0x8b,0x00 },
+  16, 0x9650, 0, {0x6e,0xc0,0x0b,0xb0,0x42,0x2c,0x00,0x9b,0x00,0x4c,0xe0,0x0a,0x90,0x22,0x2c,0x00 },
+  16, 0x9660, 0, {0x8a,0xc2,0x2c,0x40,0x08,0xb0,0x42,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9670, 0, {0x08,0x04,0x0c,0x00,0x83,0x0d,0x2c,0xc6,0x09,0x31,0x02,0x0d,0x81,0xa3,0x11,0x24 },
+  16, 0x9680, 0, {0x00,0x8a,0xb1,0xe2,0x4c,0x80,0xa3,0x00,0x2c,0xcc,0x0b,0x02,0x02,0x8c,0x80,0xa3 },
+  16, 0x9690, 0, {0x48,0x08,0xc0,0x08,0x00,0x0a,0x0d,0x00,0x81,0x00,0x28,0xc0,0x08,0x30,0x02,0x82 },
+  16, 0x96a0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x6c,0x00,0xcb,0x20,0x2f,0xc8 },
+  16, 0x96b0, 0, {0x8d,0xf6,0x13,0x2d,0xb0,0x8f,0x00,0x36,0x40,0x0f,0xf0,0x02,0xad,0xa8,0x8f,0x10 },
+  16, 0x96c0, 0, {0x3f,0xca,0x0b,0x80,0x92,0x2c,0x10,0xdb,0x40,0x3f,0xc0,0x0e,0x00,0x03,0x2d,0x04 },
+  16, 0x96d0, 0, {0xc8,0x02,0x3e,0x40,0x0c,0xb0,0x03,0x00,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x96e0, 0, {0xa0,0x1d,0xfc,0x00,0xff,0x00,0x3f,0xc8,0x0e,0xf1,0x03,0xec,0x84,0xff,0x20,0x37 },
+  16, 0x96f0, 0, {0x00,0x0d,0xb2,0x03,0xbc,0xa0,0xff,0x00,0x3e,0xc9,0x0e,0x80,0x03,0xfd,0x11,0xff },
+  16, 0x9700, 0, {0x00,0x3b,0xc0,0x0e,0xc0,0x03,0xfc,0x80,0xed,0x00,0x3b,0xc0,0x0f,0xf0,0x43,0x68 },
+  16, 0x9710, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0xfc,0x90,0xcc,0x92,0x3b,0xc8 },
+  16, 0x9720, 0, {0x0d,0xf0,0x83,0x73,0x10,0xff,0x28,0x37,0xca,0x4f,0xb2,0x03,0xfc,0x00,0xdf,0x20 },
+  16, 0x9730, 0, {0xb3,0xc4,0x0d,0x68,0x43,0xfe,0x14,0xcb,0x84,0x33,0xe0,0x0d,0x78,0x03,0xbe,0x00 },
+  16, 0x9740, 0, {0xff,0x80,0x37,0xa0,0x0c,0xf3,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9750, 0, {0x80,0x00,0xfc,0x48,0x82,0x21,0x03,0xf4,0x0f,0xf6,0x42,0x20,0x04,0x8a,0x60,0x2b },
+  16, 0x9760, 0, {0xda,0x0b,0xf9,0x02,0x3f,0x04,0x8f,0x52,0x23,0xd5,0x4d,0x88,0x02,0xae,0x00,0xdb },
+  16, 0x9770, 0, {0x80,0x36,0xc0,0x08,0x80,0x02,0x20,0x04,0xb8,0x00,0x22,0x60,0x0d,0x74,0x03,0xe0 },
+  16, 0x9780, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0xa0,0x80,0x01,0x08,0xc0 },
+  16, 0x9790, 0, {0x4b,0x30,0x82,0x42,0x90,0xa3,0x08,0x2c,0xc8,0x1a,0x30,0x22,0x8d,0x00,0x93,0x00 },
+  16, 0x97a0, 0, {0x24,0xc8,0x09,0xa0,0x12,0x0c,0x04,0xab,0x00,0x62,0xc0,0x09,0xb0,0x02,0xcc,0x00 },
+  16, 0x97b0, 0, {0xb3,0x00,0x28,0x80,0x08,0x36,0x06,0xa2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x97c0, 0, {0xc0,0x15,0xac,0x00,0x88,0x08,0x22,0xc0,0x0a,0x30,0x1a,0x00,0x11,0x82,0x00,0x0a },
+  16, 0x97d0, 0, {0xc0,0x0b,0xb0,0x42,0x2c,0x00,0x8b,0x00,0x26,0xc0,0x09,0x91,0x02,0xec,0x20,0xbb },
+  16, 0x97e0, 0, {0x28,0x66,0xc0,0x08,0x80,0x02,0x60,0x00,0xb8,0x00,0x2a,0x40,0x81,0xb0,0x06,0xf8 },
+  16, 0x97f0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0xec,0x02,0xc8,0x04,0x3a,0xc0 },
+  16, 0x9800, 0, {0x89,0xb0,0x03,0x68,0x00,0xe9,0xc1,0x1e,0xc1,0x0e,0x30,0x03,0xec,0x00,0xdb,0x00 },
+  16, 0x9810, 0, {0x36,0xc1,0x0d,0x00,0x23,0x0e,0x00,0xeb,0x80,0x32,0xc8,0xcd,0x30,0x32,0xec,0x08 },
+  16, 0x9820, 0, {0xf3,0x00,0x3c,0x80,0x0c,0xb0,0x06,0x80,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9830, 0, {0xe0,0x01,0x9c,0x00,0x7c,0x00,0x3f,0xc0,0x0b,0xb0,0x43,0xfd,0x00,0xbe,0xc4,0x37 },
+  16, 0x9840, 0, {0xc0,0x1f,0xf0,0x03,0x5c,0x00,0xff,0x01,0x3b,0xc0,0x0e,0xc8,0x03,0xbf,0x20,0xdf },
+  16, 0x9850, 0, {0x00,0x3f,0xd0,0x0f,0xc0,0x13,0xb0,0x00,0x7c,0x00,0xb7,0x40,0x0f,0xf0,0x1b,0xb0 },
+  16, 0x9860, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x0c,0xd8,0x41,0x32,0xc0 },
+  16, 0x9870, 0, {0x0e,0xb0,0x07,0xa8,0x01,0x69,0x40,0xb2,0xc0,0x8d,0xb0,0xa3,0xec,0x08,0xf3,0x00 },
+  16, 0x9880, 0, {0x32,0xc0,0x0f,0x80,0x03,0xed,0x00,0xfb,0x48,0x3a,0xc0,0x0d,0xb0,0x83,0x2c,0x00 },
+  16, 0x9890, 0, {0xfb,0x20,0x3e,0x80,0x0f,0x70,0x23,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x98a0, 0, {0xc8,0x05,0x3c,0x00,0x88,0x00,0x23,0xc0,0x08,0xf0,0x06,0x2c,0x10,0x88,0x51,0x37 },
+  16, 0x98b0, 0, {0xc0,0x08,0xf0,0x07,0x7d,0x60,0x8f,0x02,0x37,0xc0,0x0b,0x8c,0x00,0x2d,0x00,0xb3 },
+  16, 0x98c0, 0, {0x00,0x38,0xc0,0x08,0x80,0x82,0x20,0x00,0xb8,0x00,0x2e,0x50,0x0b,0xf0,0x00,0x32 },
+  16, 0x98d0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x00,0x98,0x00,0x28,0xc0 },
+  16, 0x98e0, 0, {0x0a,0x30,0x02,0x84,0x04,0xa3,0x00,0x00,0xc0,0x68,0x39,0x06,0x0c,0x10,0x93,0x20 },
+  16, 0x98f0, 0, {0x22,0xc0,0x9b,0x01,0xa0,0x8f,0x14,0x33,0x14,0x28,0xc0,0x09,0x3c,0x02,0x0c,0x01 },
+  16, 0x9900, 0, {0x93,0x40,0x2c,0x88,0x0b,0x30,0x02,0xb8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9910, 0, {0x60,0x01,0x1e,0x10,0x87,0x80,0x29,0xe0,0x08,0x78,0x02,0x3e,0x00,0x83,0x90,0x24 },
+  16, 0x9920, 0, {0xe0,0x08,0x78,0x10,0xce,0x04,0x07,0x91,0x25,0xe0,0x83,0xc9,0x02,0x1e,0x04,0xb7 },
+  16, 0x9930, 0, {0x84,0x2b,0xa4,0x08,0x48,0x42,0x12,0xcc,0xb4,0x80,0x2d,0x64,0x0b,0x78,0x02,0x19 },
+  16, 0x9940, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x2c,0x00,0xd0,0x10,0x28,0xc8 },
+  16, 0x9950, 0, {0x0e,0x3b,0x02,0x84,0x00,0xe3,0x40,0x30,0xc8,0x0c,0x38,0x62,0x8c,0x00,0x53,0x00 },
+  16, 0x9960, 0, {0x30,0xc4,0x1f,0x00,0x23,0x8c,0x3c,0xf3,0x80,0x18,0xc0,0x0d,0x30,0x03,0x0e,0x80 },
+  16, 0x9970, 0, {0xd3,0x10,0x3c,0x80,0x0f,0x30,0x03,0x92,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9980, 0, {0x40,0x1d,0xbd,0x00,0xf9,0x12,0xb4,0xc0,0x07,0xb0,0x03,0xcc,0x00,0x4a,0x00,0x77 },
+  16, 0x9990, 0, {0xc0,0x0e,0x71,0x43,0x6c,0x00,0xf3,0x00,0x3f,0xd0,0x1f,0xd0,0x53,0xac,0x68,0xfb },
+  16, 0x99a0, 0, {0x18,0x3d,0xc0,0x0f,0xc0,0x13,0xf0,0x50,0xfc,0x04,0x3f,0x40,0x0f,0xf4,0x03,0x90 },
+  16, 0x99b0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xed,0x40,0xf8,0x04,0x3e,0xd2 },
+  16, 0x99c0, 0, {0x0f,0xb3,0x13,0xe0,0x10,0xf9,0x00,0xb2,0xcc,0x0e,0xba,0x03,0x6d,0x80,0xdb,0x02 },
+  16, 0x99d0, 0, {0x32,0xdc,0x4f,0x00,0x03,0x6c,0x04,0xf3,0x02,0x36,0x40,0x0e,0xb0,0x03,0xcc,0x00 },
+  16, 0x99e0, 0, {0x4b,0x00,0x3c,0x80,0x0c,0xf1,0x03,0x62,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x99f0, 0, {0x48,0x11,0x9c,0x00,0xb4,0x00,0x2d,0xc9,0x0b,0x70,0x82,0xdc,0x00,0xbc,0x04,0x21 },
+  16, 0x9a00, 0, {0xc4,0x4b,0x37,0x02,0x0c,0xa0,0x8f,0x74,0x21,0xc0,0x0b,0x40,0x02,0x1c,0x81,0xb7 },
+  16, 0x9a10, 0, {0x20,0x2b,0xc0,0x08,0x40,0x02,0xd0,0x02,0x84,0x00,0x2d,0x40,0x0a,0xf2,0x02,0x12 },
+  16, 0x9a20, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x80,0xb4,0xc0,0x2d,0xe4 },
+  16, 0x9a30, 0, {0x0b,0x7a,0x02,0xd2,0x00,0xb5,0x88,0x21,0xe8,0x0a,0x78,0x02,0xde,0x40,0x97,0x00 },
+  16, 0x9a40, 0, {0x21,0xe8,0x0b,0xcc,0x46,0x5e,0x28,0xb7,0xc4,0x21,0xf0,0x0a,0x78,0x02,0xfe,0x08 },
+  16, 0x9a50, 0, {0x97,0x84,0x2d,0xa0,0x08,0x78,0x02,0x70,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9a60, 0, {0x08,0x14,0xcc,0x00,0xb0,0xc0,0x2c,0xc0,0x9b,0xb0,0x02,0xcc,0x20,0xb3,0x60,0x22 },
+  16, 0x9a70, 0, {0xc0,0x0b,0x30,0x02,0x8c,0x00,0x83,0x01,0x20,0xc0,0x1b,0x06,0x16,0x4f,0x00,0xb3 },
+  16, 0x9a80, 0, {0xa0,0x2a,0xf0,0x08,0x00,0x02,0xe0,0x00,0x90,0x00,0x2c,0x40,0x0a,0x30,0x02,0x02 },
+  16, 0x9a90, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x10,0xfe,0xc0,0x3e,0x80 },
+  16, 0x9aa0, 0, {0x0f,0xa0,0x03,0xf9,0x08,0xfe,0x40,0x22,0x80,0x0e,0xa0,0x03,0xe8,0x00,0xd2,0x00 },
+  16, 0x9ab0, 0, {0x32,0x80,0x8f,0xe0,0x03,0x58,0x00,0xf6,0x00,0x33,0xb0,0x0e,0x20,0x02,0xe8,0x0c },
+  16, 0x9ac0, 0, {0xd2,0x02,0x3c,0x80,0x0c,0xa0,0x03,0x7a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9ad0, 0, {0x48,0x00,0xe0,0x00,0xf8,0x20,0x3e,0x01,0x0b,0x80,0x03,0xe0,0x00,0xf0,0x40,0x3e },
+  16, 0x9ae0, 0, {0x00,0x57,0x80,0x23,0x00,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x84,0x03,0xa0,0x30,0x38 },
+  16, 0x9af0, 0, {0x00,0x3a,0x08,0x0f,0xc4,0x03,0xf0,0x00,0xec,0x00,0x3f,0x10,0x0f,0x80,0x03,0xd2 },
+  16, 0x9b00, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xd9,0x01,0x3c,0x48 },
+  16, 0x9b10, 0, {0x4c,0x90,0x0b,0x24,0x01,0xc9,0xc0,0x32,0x40,0xac,0x90,0x03,0xe4,0x00,0xd9,0x40 },
+  16, 0x9b20, 0, {0x30,0x40,0x0d,0x9a,0x03,0x22,0x84,0xc8,0x14,0x32,0x40,0x0e,0x90,0x03,0x24,0x00 },
+  16, 0x9b30, 0, {0xc9,0x00,0x82,0x68,0x2c,0x90,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9b40, 0, {0x80,0x04,0x64,0x00,0x89,0x00,0x2e,0x40,0x08,0x90,0x22,0x24,0x00,0x89,0x02,0x82 },
+  16, 0x9b50, 0, {0x40,0x08,0x90,0x02,0xe7,0x40,0x89,0x80,0x36,0x41,0x8d,0x18,0x02,0xa0,0x24,0xa8 },
+  16, 0x9b60, 0, {0x04,0x62,0x40,0x08,0x94,0x83,0x24,0x00,0x89,0x01,0x22,0x72,0x08,0x90,0x0b,0x20 },
+  16, 0x9b70, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x04,0x00,0x99,0x00,0x2a,0x40 },
+  16, 0x9b80, 0, {0x28,0x90,0x12,0x04,0x00,0x89,0x00,0x22,0x40,0x08,0x90,0x02,0xa4,0x20,0x99,0x00 },
+  16, 0x9b90, 0, {0x22,0x40,0x18,0x90,0x06,0x20,0x01,0x88,0x08,0x62,0x40,0x0a,0x90,0x02,0x34,0x10 },
+  16, 0x9ba0, 0, {0x8d,0x81,0x23,0x41,0x08,0x10,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9bb0, 0, {0x08,0x04,0x04,0x80,0x81,0x04,0x2c,0x48,0x08,0x12,0x02,0x04,0x02,0x83,0x20,0x20 },
+  16, 0x9bc0, 0, {0x48,0x08,0x12,0x02,0xc4,0x80,0x83,0x60,0x24,0x48,0x19,0x34,0x62,0xa5,0x04,0xa1 },
+  16, 0x9bd0, 0, {0x02,0x60,0x40,0x08,0xd0,0x02,0x54,0x00,0x8d,0x00,0x29,0x40,0x08,0x12,0x82,0x02 },
+  16, 0x9be0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x61,0x40,0xd8,0x50,0x3a,0x80 },
+  16, 0x9bf0, 0, {0x0c,0x85,0x02,0x21,0x44,0x88,0x50,0x32,0x14,0x4c,0x80,0x43,0xe0,0x00,0xd8,0x00 },
+  16, 0x9c00, 0, {0x22,0x14,0x0c,0x80,0x03,0x20,0x00,0xc8,0x00,0xa2,0x00,0x0e,0x80,0x03,0x20,0x00 },
+  16, 0x9c10, 0, {0xc8,0x00,0x33,0x00,0x0c,0x82,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9c20, 0, {0x98,0x1d,0xe4,0x44,0xfd,0x00,0x3e,0x44,0x0f,0x91,0x03,0xf4,0x10,0xff,0x10,0x3e },
+  16, 0x9c30, 0, {0x44,0x0f,0x91,0x03,0xe4,0x40,0xf9,0x10,0x3e,0x44,0x0b,0xf0,0x13,0xe5,0x10,0xf9 },
+  16, 0x9c40, 0, {0x40,0x3f,0x4a,0x2f,0x92,0x8a,0xa4,0xa2,0xf9,0x28,0x36,0x40,0x0f,0x92,0x83,0xa6 },
+  16, 0x9c50, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x11,0xe6,0xc0,0xc1,0x00,0x3f,0x69 },
+  16, 0x9c60, 0, {0x0c,0x9a,0x43,0x6c,0x00,0xfd,0xa0,0x3e,0x78,0x2c,0xd8,0x07,0xd6,0x02,0xd5,0x96 },
+  16, 0x9c70, 0, {0x32,0x78,0x0d,0x90,0x03,0x27,0x00,0xfd,0xa0,0x35,0x50,0x06,0xd4,0x03,0xe5,0x00 },
+  16, 0x9c80, 0, {0xfd,0x40,0xb3,0x40,0x0f,0x98,0xa3,0x46,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9c90, 0, {0x38,0x10,0xe3,0xc2,0x88,0x88,0x2e,0x14,0xa8,0x8a,0xc2,0x22,0xa0,0xb8,0xc0,0x2c },
+  16, 0x9ca0, 0, {0x24,0x48,0x84,0x02,0xe1,0x00,0x98,0xc4,0x20,0x3c,0x08,0x8a,0x82,0x23,0x80,0xb8 },
+  16, 0x9cb0, 0, {0x04,0x22,0x20,0x08,0x88,0x03,0xa2,0x00,0xb8,0xa0,0x22,0x00,0x0b,0x88,0x02,0x0e },
+  16, 0x9cc0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x80,0xa1,0x20,0x6c,0x40 },
+  16, 0x9cd0, 0, {0x0a,0x14,0x02,0x44,0x04,0xa1,0x68,0x2c,0x48,0x08,0x14,0x02,0xc5,0x00,0x81,0x60 },
+  16, 0x9ce0, 0, {0x20,0x48,0x19,0x90,0x02,0x85,0x81,0xb1,0x40,0x24,0x68,0x0a,0x12,0x42,0xc4,0x80 },
+  16, 0x9cf0, 0, {0xb9,0x20,0x20,0x40,0x8b,0x10,0x82,0x42,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9d00, 0, {0x18,0x05,0xa4,0x10,0xa9,0x00,0x6e,0xc0,0x0a,0x10,0x02,0x24,0x14,0xb9,0x00,0x2e },
+  16, 0x9d10, 0, {0x40,0x08,0x90,0x12,0xe4,0x00,0x99,0x00,0x22,0x40,0x08,0x80,0x06,0xa0,0x60,0xb9 },
+  16, 0x9d20, 0, {0x09,0x22,0x60,0x08,0x90,0x02,0xa4,0x00,0xb9,0x00,0x02,0x40,0x0b,0x10,0x06,0x06 },
+  16, 0x9d30, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x05,0xe4,0x00,0xe9,0x80,0x3e,0x41 },
+  16, 0x9d40, 0, {0x0e,0x90,0x03,0x64,0x00,0xe9,0xc0,0x3e,0x40,0x0c,0x90,0x02,0xe4,0x00,0xc9,0x00 },
+  16, 0x9d50, 0, {0x22,0x41,0x0d,0x80,0x02,0xa3,0x04,0xf1,0x40,0x36,0x40,0x0e,0x90,0x02,0xe4,0x00 },
+  16, 0x9d60, 0, {0xf1,0x00,0x12,0x40,0x0f,0x90,0x03,0x68,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9d70, 0, {0x28,0x01,0xa4,0x00,0xd9,0x22,0x3e,0x42,0x0d,0x90,0x03,0xe4,0x00,0xb9,0xc4,0x3c },
+  16, 0x9d80, 0, {0x40,0x0f,0x90,0x03,0xe4,0x00,0xe9,0x02,0xae,0x40,0x0f,0x80,0x4b,0x62,0x10,0xf9 },
+  16, 0x9d90, 0, {0x20,0x3e,0x40,0x0f,0x90,0x03,0xe4,0x00,0xf9,0x02,0x7e,0x41,0x0f,0x90,0x13,0xca },
+  16, 0x9da0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x00,0x80,0x00,0xc8,0x00,0x38,0x00 },
+  16, 0x9db0, 0, {0x0f,0x80,0x20,0xe0,0x00,0xa8,0x20,0x32,0x00,0x0c,0x80,0x07,0xe0,0x80,0xc8,0x00 },
+  16, 0x9dc0, 0, {0x38,0x00,0x0d,0x80,0x83,0x21,0x10,0xf8,0x60,0x32,0x00,0x8e,0x80,0xb3,0x20,0x08 },
+  16, 0x9dd0, 0, {0xf8,0x00,0x3e,0x00,0x0c,0x80,0x03,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9de0, 0, {0x28,0x05,0x28,0x04,0x8a,0x00,0x33,0x90,0x43,0xa0,0x22,0x28,0x00,0x8e,0x80,0x76 },
+  16, 0x9df0, 0, {0x80,0x08,0xe1,0x03,0x19,0x00,0x86,0x80,0x22,0x80,0x0d,0x60,0x01,0x78,0x00,0xbe },
+  16, 0x9e00, 0, {0x00,0x36,0x80,0x0c,0xe4,0x02,0xa8,0x10,0xbe,0xa0,0x2f,0x80,0x0d,0xa0,0x02,0x0a },
+  16, 0x9e10, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x11,0x4c,0x04,0x03,0x04,0x2c,0xd4 },
+  16, 0x9e20, 0, {0x0b,0x30,0x02,0x4c,0x01,0xa3,0xc4,0x20,0xc0,0x28,0x35,0x02,0x86,0x00,0x83,0x80 },
+  16, 0x9e30, 0, {0x28,0xc0,0x08,0x38,0x06,0x0e,0x94,0x30,0xc0,0xa2,0xc0,0x0b,0x3c,0x02,0x0c,0x00 },
+  16, 0x9e40, 0, {0xb3,0x80,0x2c,0x48,0x08,0x30,0x02,0x8a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9e50, 0, {0xa0,0x01,0x0c,0x04,0x8f,0x80,0x21,0xc1,0x1b,0x72,0x42,0x1e,0xc0,0x83,0x88,0x21 },
+  16, 0x9e60, 0, {0xc0,0x18,0x28,0x06,0x10,0x21,0x86,0x38,0x21,0xc0,0x19,0xf7,0x02,0x5d,0xc0,0xb4 },
+  16, 0x9e70, 0, {0x41,0x27,0xd0,0x08,0x78,0xc6,0x9c,0x00,0xb7,0x00,0x2f,0x60,0x09,0x72,0x02,0x28 },
+  16, 0x9e80, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0x02,0xc7,0x80,0x2d,0xa0 },
+  16, 0x9e90, 0, {0x0f,0x3e,0x03,0xfe,0x80,0xa7,0x80,0xa1,0xe0,0x0c,0x78,0x02,0x94,0x00,0x85,0xa0 },
+  16, 0x9ea0, 0, {0x39,0xe4,0x0c,0x78,0x13,0x1e,0x90,0xb5,0x84,0x31,0xe0,0x0f,0xf8,0x87,0x1e,0x04 },
+  16, 0x9eb0, 0, {0xf7,0x80,0x3d,0x60,0x0c,0x3b,0x03,0xaa,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9ec0, 0, {0x08,0x1d,0xad,0xe4,0xfb,0x54,0x3e,0x80,0x0f,0xb4,0x23,0xec,0x32,0xfb,0x00,0x3e },
+  16, 0x9ed0, 0, {0xd8,0x4f,0xa0,0x03,0xe4,0x00,0xf9,0x00,0x3e,0xc0,0x0f,0x30,0x33,0xec,0x04,0xf2 },
+  16, 0x9ee0, 0, {0x01,0x3e,0xc0,0x0f,0xb2,0x03,0xfe,0x10,0xfb,0x68,0x3c,0x41,0x0f,0xf0,0x43,0x82 },
+  16, 0x9ef0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xfe,0x00,0xcf,0xe4,0x3f,0xe4 },
+  16, 0x9f00, 0, {0x0c,0xfc,0x03,0x7e,0x80,0xcf,0x81,0x33,0xfa,0x0f,0xf8,0x03,0xf6,0x00,0xff,0x80 },
+  16, 0x9f10, 0, {0x3f,0xe2,0x0f,0x79,0x03,0x3e,0x40,0xf4,0x80,0x33,0x60,0x0c,0xe8,0x03,0x3e,0x00 },
+  16, 0x9f20, 0, {0xff,0x80,0x33,0x60,0x0c,0xf8,0x83,0x50,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9f30, 0, {0xa8,0x11,0x9c,0x00,0xd7,0xa0,0x2d,0xc4,0x08,0xba,0x02,0x3c,0xa0,0x87,0x20,0x21 },
+  16, 0x9f40, 0, {0xc0,0x0f,0x52,0x03,0xd4,0x00,0xb6,0x10,0x2d,0xc0,0x8b,0x73,0x03,0x5c,0x40,0xb4 },
+  16, 0x9f50, 0, {0xb0,0x2b,0x48,0x28,0x41,0x02,0x0c,0x00,0xbf,0x18,0x35,0x46,0x28,0x72,0x42,0x2a },
+  16, 0x9f60, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x9c,0x00,0x87,0x41,0x2d,0x44 },
+  16, 0x9f70, 0, {0x0a,0x73,0x02,0x9c,0xc4,0x81,0x00,0x6d,0xc8,0x8b,0x70,0x02,0xd4,0x00,0xb7,0x00 },
+  16, 0x9f80, 0, {0x2d,0xc0,0x0b,0xf0,0x46,0x9c,0x55,0xb4,0x20,0x25,0x40,0x18,0x60,0x82,0x1c,0x00 },
+  16, 0x9f90, 0, {0xb7,0x00,0x23,0x40,0x08,0x70,0x46,0x44,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9fa0, 0, {0x60,0x14,0xcc,0x00,0x93,0x00,0x2c,0x40,0x0b,0xb0,0x02,0x0c,0x82,0x80,0xc0,0x20 },
+  16, 0x9fb0, 0, {0xc0,0x0a,0x10,0x02,0x04,0x00,0xb3,0x00,0x2c,0xc0,0x1b,0x30,0x00,0xcd,0x01,0xb0 },
+  16, 0x9fc0, 0, {0x40,0xac,0x78,0x88,0x8c,0x06,0x0d,0x60,0xb3,0x4c,0x24,0x12,0x08,0x30,0x0a,0x18 },
+  16, 0x9fd0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x15,0xbc,0x00,0xc7,0x00,0x2e,0x40 },
+  16, 0x9fe0, 0, {0x0e,0xf0,0x2a,0xbf,0x00,0xc8,0xc8,0xbf,0xc0,0x0b,0x90,0x02,0xe4,0x04,0xbf,0x00 },
+  16, 0x9ff0, 0, {0x3f,0xc0,0x0f,0xb2,0x0a,0xac,0x00,0xf8,0x80,0x34,0x49,0x0c,0xb9,0x0b,0x3f,0x00 },
+  16, 0xa000, 0, {0xfb,0xc0,0x30,0xf0,0x0c,0xf0,0x03,0x6e,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa010, 0, {0x80,0x00,0xcc,0x00,0xfb,0x80,0x3e,0x41,0x2c,0xb0,0x13,0xac,0x00,0xf8,0x00,0x3e },
+  16, 0xa020, 0, {0xc1,0x0f,0xa0,0x03,0xe8,0x00,0xfa,0x40,0x3e,0xc0,0x0f,0xb0,0x0b,0x6d,0x40,0xf8 },
+  16, 0xa030, 0, {0x10,0x3a,0x40,0x0f,0xb0,0x03,0xec,0x10,0xfe,0x40,0x3e,0xc0,0x0f,0xf0,0x03,0xe1 },
+  16, 0xa040, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xec,0x0c,0xdf,0x00,0x3b,0x80 },
+  16, 0xa050, 0, {0x0f,0xf0,0x0b,0x3c,0x08,0xe7,0x08,0x33,0xc0,0x0b,0xd0,0x23,0x74,0x00,0x54,0x00 },
+  16, 0xa060, 0, {0x33,0xc0,0x0f,0xf0,0x83,0xbe,0x20,0xfd,0x0c,0x3b,0x60,0x2c,0xe0,0x03,0x3c,0x00 },
+  16, 0xa070, 0, {0xcf,0x12,0x33,0x50,0x0c,0x30,0x03,0x80,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa080, 0, {0x81,0x04,0x6c,0x04,0xab,0x00,0x22,0xa0,0x0b,0xb0,0x06,0x0c,0x00,0xab,0x40,0x36 },
+  16, 0xa090, 0, {0xc0,0x0b,0xa8,0x02,0x66,0x00,0xb8,0x00,0x36,0xc1,0x0b,0x34,0x43,0xee,0x00,0xb2 },
+  16, 0xa0a0, 0, {0x00,0x22,0x60,0x08,0xb4,0x82,0x8c,0x04,0x8a,0x21,0x22,0x40,0x08,0xb0,0x02,0x20 },
+  16, 0xa0b0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0x9b,0x00,0x2a,0x20 },
+  16, 0xa0c0, 0, {0x0b,0xb0,0x02,0x2c,0x00,0x88,0xc5,0x22,0xc0,0x0b,0x88,0x82,0xe6,0x01,0xbb,0x08 },
+  16, 0xa0d0, 0, {0x22,0xc0,0x0a,0xb2,0x82,0xac,0x60,0xb8,0x02,0x4a,0xc4,0x08,0xb1,0x02,0x2c,0x00 },
+  16, 0xa0e0, 0, {0x83,0x00,0x22,0xc0,0x08,0xb0,0x02,0xa0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa0f0, 0, {0x08,0x04,0x0c,0x00,0xab,0x20,0x20,0x01,0x0b,0x32,0x06,0x2c,0x00,0xa0,0x00,0x20 },
+  16, 0xa100, 0, {0xc0,0x09,0x04,0x22,0xc4,0x00,0xb2,0x00,0x24,0xc1,0x8b,0xb0,0x02,0x4c,0x00,0xb0 },
+  16, 0xa110, 0, {0x00,0x62,0xc0,0x48,0x30,0x02,0xac,0x10,0x82,0x00,0x20,0xc0,0x08,0x30,0x02,0x02 },
+  16, 0xa120, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x7c,0x08,0xdf,0x2a,0x3a,0x00 },
+  16, 0xa130, 0, {0x0f,0xf5,0x12,0x3c,0x10,0xc9,0x00,0xa3,0xc0,0x0f,0x80,0x53,0xec,0x01,0xda,0x00 },
+  16, 0xa140, 0, {0x33,0xc0,0x0e,0xb0,0x03,0xac,0x04,0xf8,0x70,0x3a,0xc0,0x0c,0x60,0x43,0x2c,0x42 },
+  16, 0xa150, 0, {0xcd,0x00,0xb2,0x40,0x2c,0xf0,0x03,0x80,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa160, 0, {0xa0,0x19,0xfc,0x00,0xfb,0x01,0x3d,0x00,0x0f,0xb4,0x17,0xfc,0x00,0x3c,0x00,0x3f },
+  16, 0xa170, 0, {0xc0,0x4f,0xc0,0x03,0x74,0x08,0xfe,0x00,0x3f,0xc0,0x4f,0xf0,0x03,0xfc,0x08,0xf8 },
+  16, 0xa180, 0, {0x30,0x3f,0xc0,0x0f,0xf0,0x03,0xfc,0x04,0xfc,0x00,0x3d,0x00,0x0f,0xf0,0x03,0xe8 },
+  16, 0xa190, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xf4,0x90,0xef,0x00,0x3f,0xd8 },
+  16, 0xa1a0, 0, {0x0e,0xf3,0x03,0x2c,0x01,0xd4,0x80,0x37,0xcc,0x0d,0x89,0x43,0x12,0x50,0xec,0x2c },
+  16, 0xa1b0, 0, {0x32,0x05,0x0d,0xb0,0x53,0x3c,0xd4,0xc5,0x94,0x7f,0xa0,0x8f,0xf0,0x43,0x30,0x00 },
+  16, 0xa1c0, 0, {0xdc,0x00,0x33,0x00,0x0c,0x48,0x07,0xf0,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa1d0, 0, {0x80,0x10,0xe6,0x40,0x8b,0x70,0x2f,0xdc,0x08,0xf7,0x02,0x0c,0x80,0x8a,0x20,0x00 },
+  16, 0xa1e0, 0, {0xc8,0x4a,0x22,0x02,0xa0,0x00,0x8a,0x48,0x22,0x58,0x88,0xfd,0x02,0xad,0x02,0xa9 },
+  16, 0xa1f0, 0, {0x20,0x1e,0xa0,0x03,0x80,0x02,0x2c,0x04,0x8b,0x00,0x22,0xc0,0x4c,0x88,0x07,0x60 },
+  16, 0xa200, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xc0,0x00,0x23,0x2c,0x2c,0xc9 },
+  16, 0xa210, 0, {0x02,0x30,0x02,0x0c,0x68,0xa0,0x28,0x2c,0xd0,0x09,0x12,0x02,0x84,0x00,0xa0,0x21 },
+  16, 0xa220, 0, {0x20,0x18,0x19,0x30,0x22,0x80,0xd0,0x83,0x06,0x0c,0xa0,0x0b,0xb0,0x06,0x00,0x12 },
+  16, 0xa230, 0, {0xa0,0x00,0x20,0x00,0x29,0x00,0x0e,0xa2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa240, 0, {0xc0,0x11,0xa8,0x30,0x8b,0x00,0x2e,0xc0,0x4a,0x30,0x0a,0x2c,0x14,0xa0,0x80,0x0a },
+  16, 0xa250, 0, {0xc1,0x08,0x88,0x86,0x87,0x00,0x83,0x00,0x22,0x49,0x08,0xb0,0x06,0xa0,0x40,0xab },
+  16, 0xa260, 0, {0x20,0x22,0x20,0x0b,0x80,0x0a,0x0c,0x04,0xab,0x02,0x22,0xc0,0x88,0x80,0x02,0xf0 },
+  16, 0xa270, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xef,0x40,0xeb,0x06,0x3e,0xc0 },
+  16, 0xa280, 0, {0x0e,0xb0,0x03,0x2c,0x02,0xf9,0xa0,0x3e,0xc0,0x0d,0x8c,0x03,0xaa,0x10,0xe9,0x40 },
+  16, 0xa290, 0, {0xb2,0x48,0x0d,0xb0,0x43,0xad,0x00,0xcb,0x86,0x2e,0x20,0x0f,0x30,0x03,0x24,0x00 },
+  16, 0xa2a0, 0, {0xf9,0x80,0x32,0xc0,0x0d,0x0c,0xc2,0x90,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa2b0, 0, {0xe0,0x01,0x94,0x00,0xff,0x00,0x3d,0xc0,0x0d,0xf0,0x03,0x7c,0x00,0xdf,0x00,0x37 },
+  16, 0xa2c0, 0, {0xc0,0x0f,0xe0,0x03,0xf0,0x00,0xfe,0x20,0x3f,0x40,0x0f,0x70,0x03,0xfe,0x00,0xff },
+  16, 0xa2d0, 0, {0x82,0x7f,0x00,0x0f,0xc0,0x03,0xf9,0x04,0xde,0x20,0xbd,0x00,0x0f,0xd9,0x0b,0x7c },
+  16, 0xa2e0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x01,0xcb,0x00,0x3e,0xc0 },
+  16, 0xa2f0, 0, {0x2c,0xb0,0x0b,0x2c,0x00,0xe8,0x40,0x3e,0xc0,0x0f,0x94,0x07,0x29,0x00,0xc9,0x40 },
+  16, 0xa300, 0, {0xb2,0xc0,0x0f,0xb0,0x03,0x01,0x02,0xcb,0x00,0x32,0x04,0x4f,0xf0,0x43,0x34,0xc0 },
+  16, 0xa310, 0, {0xb5,0x1a,0x3f,0xc1,0x0f,0x80,0x93,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa320, 0, {0xc8,0x05,0x28,0x00,0x8f,0x00,0x2f,0xc0,0x08,0xf0,0x02,0x3c,0x04,0xd8,0x00,0x2b },
+  16, 0xa330, 0, {0xc0,0x0c,0x80,0x45,0x60,0x00,0x7b,0x58,0x22,0xc8,0x0b,0xfa,0x01,0x61,0x40,0x8b },
+  16, 0xa340, 0, {0x00,0x32,0x04,0x4b,0xce,0x02,0x28,0x00,0x3a,0x40,0x2e,0x07,0x0b,0x90,0x02,0x26 },
+  16, 0xa350, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x00,0x83,0x01,0x4c,0xc0 },
+  16, 0xa360, 0, {0x0b,0x30,0x02,0xec,0x10,0x90,0x00,0x2a,0xc0,0x0a,0x80,0x06,0xc0,0x04,0x83,0x04 },
+  16, 0xa370, 0, {0xa2,0x89,0x19,0x30,0x06,0xcc,0x00,0x83,0x00,0x20,0x90,0x0b,0x30,0xc2,0x48,0x00 },
+  16, 0xa380, 0, {0xb2,0x40,0x24,0x20,0x0b,0x09,0x00,0xb8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa390, 0, {0x20,0x01,0x06,0x04,0x87,0xa4,0x2d,0xe0,0x09,0x38,0x02,0xde,0x00,0x9e,0x81,0x29 },
+  16, 0xa3a0, 0, {0xe0,0x08,0x78,0x52,0xfa,0xc0,0x96,0x80,0x01,0xa0,0x8b,0x3a,0x22,0xce,0x40,0x8f },
+  16, 0xa3b0, 0, {0xb0,0x25,0xa0,0x0b,0x08,0x02,0x56,0x08,0xb5,0x90,0x2d,0xe4,0x4b,0xd8,0x22,0x0c },
+  16, 0xa3c0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x08,0x02,0x83,0x80,0x2e,0xe8 },
+  16, 0xa3d0, 0, {0x0b,0x38,0x13,0xce,0x41,0xd3,0x10,0x28,0xc0,0x0e,0x3a,0x02,0xc6,0x08,0x4b,0x40 },
+  16, 0xa3e0, 0, {0x30,0x60,0x0d,0x3b,0x27,0xcf,0xc4,0xc3,0xa0,0x30,0x00,0x0f,0x30,0x43,0x48,0x40 },
+  16, 0xa3f0, 0, {0xf2,0x00,0x3c,0x04,0x0f,0x02,0x03,0x92,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa400, 0, {0x40,0x1d,0xb8,0x00,0xff,0x00,0x3f,0xc4,0x0e,0xf1,0x03,0x3c,0x00,0xff,0x01,0x33 },
+  16, 0xa410, 0, {0xc0,0x4d,0xb1,0x07,0x7c,0x90,0xff,0x00,0x3f,0x40,0x03,0xf1,0x03,0x70,0x00,0xfb },
+  16, 0xa420, 0, {0x10,0x3b,0x00,0x0f,0xc0,0x0b,0xb4,0x00,0xfd,0x00,0x3f,0xc4,0x0f,0xd0,0x03,0x90 },
+  16, 0xa430, 0, {0x02,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x04,0xfb,0x84,0x3a,0xc2 },
+  16, 0xa440, 0, {0x4c,0xb4,0x93,0x2c,0x04,0xe9,0x00,0x3a,0xc4,0x8d,0x08,0x03,0x2e,0x00,0xcb,0x01 },
+  16, 0xa450, 0, {0x32,0x80,0x8f,0xb2,0x83,0xec,0x00,0xcb,0x80,0x32,0x00,0x0f,0xf9,0x03,0x3c,0x10 },
+  16, 0xa460, 0, {0xdf,0x81,0xb3,0xe0,0x8c,0xa0,0x03,0xea,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa470, 0, {0x48,0x11,0x94,0x08,0xb7,0x04,0x24,0xc8,0x1a,0x30,0x4a,0x1d,0x00,0xb7,0x01,0x2d },
+  16, 0xa480, 0, {0xc0,0x88,0x70,0x06,0x1c,0x00,0x82,0x00,0x21,0x80,0x4b,0x76,0x12,0xdc,0x00,0x87 },
+  16, 0xa490, 0, {0x00,0x29,0x40,0x8b,0x40,0x02,0x10,0x00,0xbc,0x00,0x20,0x01,0x28,0x70,0x03,0xb2 },
+  16, 0xa4a0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9a,0x00,0xb3,0x90,0x2d,0xe4 },
+  16, 0xa4b0, 0, {0x09,0x79,0x02,0x1e,0x80,0xa7,0x80,0x2c,0xe8,0x19,0xf8,0x12,0x5e,0x01,0x87,0x80 },
+  16, 0xa4c0, 0, {0x25,0xe0,0x4b,0x78,0x06,0xd2,0x00,0x97,0x80,0x21,0x62,0x0b,0x3a,0x02,0x1e,0x00 },
+  16, 0xa4d0, 0, {0xb7,0x86,0x29,0xf0,0x08,0x68,0x06,0xe0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa4e0, 0, {0x48,0x14,0xcf,0xc0,0xb3,0x00,0x24,0xc0,0x8a,0x30,0x32,0x0c,0x00,0xb3,0x08,0x2c },
+  16, 0xa4f0, 0, {0xc0,0x08,0x30,0x12,0x0e,0x20,0x83,0x00,0x24,0xf1,0x0b,0x30,0x06,0xce,0x00,0x83 },
+  16, 0xa500, 0, {0x90,0x28,0x60,0x0b,0x00,0x2a,0x21,0x80,0xb0,0x08,0x28,0x00,0x08,0x37,0x02,0x92 },
+  16, 0xa510, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xb9,0x00,0xfa,0x00,0x3e,0x80 },
+  16, 0xa520, 0, {0x4d,0xa0,0x03,0x28,0x00,0xee,0x41,0x3e,0x80,0x0d,0xe0,0x03,0x78,0x00,0x8e,0x40 },
+  16, 0xa530, 0, {0x27,0xa8,0x0b,0xa0,0x03,0xfb,0x02,0xca,0x82,0x33,0xa0,0x0f,0xa0,0x13,0x29,0x00 },
+  16, 0xa540, 0, {0xfa,0x40,0x3a,0x80,0x0c,0x6c,0x03,0xfa,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa550, 0, {0x48,0x00,0xc0,0x00,0xf8,0x00,0x3a,0x00,0x0c,0x80,0x03,0xe0,0x08,0xf8,0x00,0x3e },
+  16, 0xa560, 0, {0x00,0x8f,0x80,0x23,0xa0,0x42,0xf8,0x09,0xba,0x10,0x4f,0x80,0x03,0xe0,0x60,0xf8 },
+  16, 0xa570, 0, {0x00,0x3e,0x20,0x0f,0xc0,0x03,0xf0,0x00,0xfc,0x00,0x27,0x00,0x8f,0x80,0x03,0x92 },
+  16, 0xa580, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe5,0x00,0x89,0x00,0x3e,0x40 },
+  16, 0xa590, 0, {0x6e,0x90,0x03,0xa4,0x08,0xc9,0x00,0x3c,0x40,0x0d,0x90,0x03,0x24,0x10,0xf9,0xa0 },
+  16, 0xa5a0, 0, {0x32,0x42,0x0c,0x90,0x13,0xc4,0x00,0xc9,0x00,0x3e,0x40,0x0f,0x90,0x03,0xe4,0x40 },
+  16, 0xa5b0, 0, {0xc9,0x20,0x3e,0x52,0xcf,0x90,0x09,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa5c0, 0, {0x80,0x04,0x66,0x00,0x89,0x04,0x2e,0x40,0x08,0x90,0x02,0x24,0x00,0xd9,0x00,0x3a },
+  16, 0xa5d0, 0, {0x41,0x08,0x90,0x05,0xa4,0x00,0xb9,0x40,0xa2,0x40,0x0d,0x90,0x02,0xe5,0x46,0x89 },
+  16, 0xa5e0, 0, {0x00,0x2e,0x40,0x0b,0x90,0x12,0xe5,0x00,0xa9,0xc8,0x2e,0x61,0x8b,0x94,0x42,0x20 },
+  16, 0xa5f0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0x24,0x00,0xa9,0x00,0x6c,0x40 },
+  16, 0xa600, 0, {0x48,0x10,0x22,0x84,0x03,0xa9,0x00,0x2e,0x40,0x09,0x90,0x02,0xe4,0x04,0xb1,0x08 },
+  16, 0xa610, 0, {0x28,0x40,0x18,0x98,0x02,0xe5,0x00,0x89,0x00,0x2e,0x40,0x0b,0x90,0x02,0xf4,0x20 },
+  16, 0xa620, 0, {0x8d,0x00,0x2f,0x40,0x0b,0x94,0x42,0x86,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa630, 0, {0x08,0x04,0x04,0x80,0xa1,0x24,0x2c,0x48,0x18,0x12,0x02,0x04,0x80,0xa1,0x00,0x28 },
+  16, 0xa640, 0, {0x48,0x08,0x10,0x02,0x84,0x00,0x91,0x20,0x20,0x48,0x09,0x12,0x02,0xc4,0x94,0x81 },
+  16, 0xa650, 0, {0x00,0x2c,0x61,0x0b,0x5a,0x82,0xd4,0xa0,0xa5,0x28,0x2d,0x4a,0x0b,0x90,0x02,0x82 },
+  16, 0xa660, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x02,0xe8,0x50,0x2e,0x14 },
+  16, 0xa670, 0, {0x0e,0x85,0x03,0xa1,0x40,0xa8,0x50,0x3e,0x14,0x0d,0x85,0x01,0x81,0x40,0xf8,0x52 },
+  16, 0xa680, 0, {0x32,0x94,0x0c,0x80,0x13,0xc1,0x42,0xc0,0x51,0x3e,0x00,0x8f,0x82,0x03,0xe0,0x80 },
+  16, 0xa690, 0, {0xc8,0x20,0x3f,0x08,0x0f,0x80,0x03,0xae,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa6a0, 0, {0x98,0x19,0xf4,0x50,0xd9,0x11,0x3e,0x44,0x8f,0x91,0x43,0xe4,0x40,0xdd,0x00,0x3a },
+  16, 0xa6b0, 0, {0x44,0x4f,0xd0,0x27,0xb4,0x00,0xfd,0x12,0x3f,0x44,0x4f,0x91,0x43,0xf4,0x40,0xfd },
+  16, 0xa6c0, 0, {0x00,0x3f,0x41,0x0f,0x92,0x83,0xe4,0xa0,0xf9,0x28,0x3e,0x4a,0x0f,0xd0,0x03,0x66 },
+  16, 0xa6d0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x11,0xf6,0x80,0xe9,0xc0,0x3e,0x78 },
+  16, 0xa6e0, 0, {0x8f,0x9b,0x03,0xa7,0x80,0xc9,0x40,0x36,0x78,0x0f,0x10,0x23,0xe5,0x04,0xdd,0xa4 },
+  16, 0xa6f0, 0, {0x33,0x62,0x0f,0xda,0x03,0xf6,0x60,0xc9,0x10,0x33,0x40,0x0e,0x98,0x93,0xe6,0x30 },
+  16, 0xa700, 0, {0xc9,0xc9,0x32,0x78,0x8c,0xd0,0x0b,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa710, 0, {0x38,0x10,0xe0,0x00,0x88,0xe2,0x2e,0x30,0x0b,0x88,0x42,0x23,0x40,0xa0,0xa1,0x22 },
+  16, 0xa720, 0, {0x38,0x0b,0x8a,0x02,0xe2,0x80,0xaa,0xe0,0x22,0x30,0x0b,0x80,0x23,0xab,0x02,0x88 },
+  16, 0xa730, 0, {0xa0,0x2a,0x00,0x0b,0x8c,0x02,0xe3,0x00,0x88,0xe0,0x23,0x38,0x08,0x80,0x02,0x0e },
+  16, 0xa740, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc5,0x00,0xa1,0x44,0x28,0x58 },
+  16, 0xa750, 0, {0x43,0x16,0x22,0x84,0x81,0x81,0x20,0x2c,0x58,0x49,0x10,0x80,0xc4,0x81,0x91,0x48 },
+  16, 0xa760, 0, {0x6c,0x4a,0x0b,0x14,0x02,0x44,0x84,0x81,0x01,0x60,0x40,0x0a,0x52,0x86,0xd4,0xa0 },
+  16, 0xa770, 0, {0x85,0x00,0xa1,0x50,0x68,0x90,0x06,0xd2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa780, 0, {0x18,0x05,0xa6,0x00,0x89,0x00,0x2e,0x40,0x0b,0x90,0x02,0x04,0x00,0xa9,0x60,0x22 },
+  16, 0xa790, 0, {0x40,0x0b,0x95,0x02,0xe4,0x10,0xb1,0x00,0x4e,0x40,0x0b,0x90,0x66,0xac,0x80,0x89 },
+  16, 0xa7a0, 0, {0x00,0x2a,0x60,0x0b,0x90,0x52,0xf4,0x00,0x85,0x00,0x21,0x40,0x08,0x90,0x02,0xc6 },
+  16, 0xa7b0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x05,0xe6,0x20,0xe9,0x00,0x3e,0x40 },
+  16, 0xa7c0, 0, {0x0f,0x90,0x03,0xa4,0x10,0xc9,0x00,0x36,0x40,0x0f,0x94,0x01,0xe5,0x20,0xd9,0x40 },
+  16, 0xa7d0, 0, {0xba,0x68,0x8f,0x90,0x07,0xe6,0x00,0xc9,0x10,0x32,0x62,0x0e,0x90,0x02,0xe4,0x18 },
+  16, 0xa7e0, 0, {0xc9,0x00,0x32,0x40,0x0c,0x90,0x03,0xe8,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa7f0, 0, {0x28,0x01,0xa4,0x00,0xf9,0x04,0x3e,0x40,0x0b,0x90,0x03,0x64,0x00,0xf9,0x00,0x3e },
+  16, 0xa800, 0, {0x40,0x8f,0x90,0x03,0xe4,0x00,0xe9,0x02,0x72,0x68,0x0f,0x90,0x03,0xe6,0x00,0xf9 },
+  16, 0xa810, 0, {0x01,0x3e,0x42,0x0f,0x90,0x03,0xc4,0x02,0xf9,0x04,0x3e,0x40,0x4f,0x90,0x03,0x1a },
+  16, 0xa820, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x00,0x80,0x02,0xc8,0x00,0x32,0x00 },
+  16, 0xa830, 0, {0x0c,0x80,0x03,0x60,0x00,0xc8,0x40,0x36,0x00,0x0f,0x84,0x03,0xa0,0x00,0xd8,0x50 },
+  16, 0xa840, 0, {0xb2,0x10,0x8c,0x81,0x03,0xc1,0x20,0xc8,0x00,0x3e,0x00,0x0f,0xc0,0x13,0xf0,0x04 },
+  16, 0xa850, 0, {0x4c,0x00,0x3f,0x00,0x0f,0x80,0x03,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa860, 0, {0x28,0x15,0x2a,0x00,0x8a,0x04,0x22,0x81,0x28,0xa0,0x12,0x28,0x00,0x8a,0x01,0x36 },
+  16, 0xa870, 0, {0x80,0x0b,0xa0,0x10,0x28,0x10,0xce,0x01,0x23,0x81,0x0c,0xa8,0x12,0xfb,0x00,0x8a },
+  16, 0xa880, 0, {0x01,0x3b,0x80,0x83,0xa0,0x42,0xe8,0x10,0x8a,0x00,0x2f,0x80,0x0b,0x60,0x42,0x0a },
+  16, 0xa890, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0x83,0x00,0xa0,0xc0 },
+  16, 0xa8a0, 0, {0x18,0xb0,0x00,0xcc,0x00,0x9b,0x00,0x24,0xc0,0x0b,0x30,0x06,0x6c,0x00,0xa3,0x08 },
+  16, 0xa8b0, 0, {0x28,0xc8,0x09,0x30,0x02,0xcc,0x43,0x8b,0x00,0x2c,0x80,0x0b,0x30,0x02,0xcc,0x02 },
+  16, 0xa8c0, 0, {0x83,0x01,0x2c,0xc0,0x4b,0x30,0x00,0x4a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa8d0, 0, {0xa0,0x01,0x0c,0x24,0x87,0x94,0x21,0xe4,0x18,0x31,0x02,0xdc,0x80,0x97,0x10,0x25 },
+  16, 0xa8e0, 0, {0xcd,0x0b,0xf2,0x02,0x7c,0x00,0xa0,0x00,0x28,0xe0,0x18,0x70,0x02,0xdc,0x01,0x87 },
+  16, 0xa8f0, 0, {0x34,0x29,0x40,0x09,0x40,0x02,0xd0,0x04,0x84,0x04,0x2d,0x00,0x4b,0xd0,0x22,0x68 },
+  16, 0xa900, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x16,0x00,0xcf,0xa0,0x70,0xe9 },
+  16, 0xa910, 0, {0x18,0x7b,0x03,0xff,0x40,0x97,0xa0,0x35,0xe8,0x0f,0x74,0x02,0x5e,0x20,0xe4,0x80 },
+  16, 0xa920, 0, {0x39,0xa0,0x2d,0x78,0x03,0xfe,0x00,0xc7,0x80,0x3d,0xe0,0x5f,0x68,0x43,0xc2,0x00 },
+  16, 0xa930, 0, {0xc4,0x84,0x1d,0x60,0x0f,0x78,0x03,0x6a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa940, 0, {0x08,0x0d,0xa4,0x00,0x3b,0x00,0x2e,0xd8,0x0f,0xb4,0x03,0x2d,0x8a,0xeb,0x62,0x3a },
+  16, 0xa950, 0, {0xd0,0x0f,0xb2,0x87,0x0c,0xd0,0xd8,0x00,0x32,0xc0,0x4f,0x90,0x43,0xec,0x00,0xfb },
+  16, 0xa960, 0, {0x08,0x3e,0x40,0x8f,0x90,0x03,0xfc,0x00,0xff,0x04,0x3f,0x80,0x0f,0x00,0x2b,0x82 },
+  16, 0xa970, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xf6,0x00,0xff,0xa0,0x3e,0xf4 },
+  16, 0xa980, 0, {0x0e,0xb8,0x03,0xee,0x08,0x4b,0xf0,0x7f,0xf4,0x0c,0xf9,0x23,0xee,0x48,0x78,0x90 },
+  16, 0xa990, 0, {0x32,0xe4,0x0c,0xf9,0x03,0xfe,0x00,0xff,0x80,0x3f,0xe4,0x1c,0x79,0x03,0x2e,0x40 },
+  16, 0xa9a0, 0, {0xff,0x80,0x33,0xe0,0x2c,0x78,0x07,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa9b0, 0, {0xa8,0x11,0x94,0x00,0xb3,0x00,0x0c,0xe5,0x0b,0x38,0x02,0xfe,0x80,0x8f,0x80,0x61 },
+  16, 0xa9c0, 0, {0xc4,0x28,0x78,0x00,0x4e,0x00,0xf4,0x84,0x25,0xa8,0x0c,0x70,0x02,0xcc,0x04,0xb3 },
+  16, 0xa9d0, 0, {0x90,0x25,0x40,0x0c,0x41,0x83,0x52,0x40,0xb4,0x10,0xa3,0x00,0x0c,0x52,0x03,0x6a },
+  16, 0xa9e0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0x00,0xb7,0x21,0x6d,0xc8 },
+  16, 0xa9f0, 0, {0x4b,0x70,0x02,0xdc,0x42,0xa7,0x31,0x29,0xc4,0x08,0x72,0x02,0xdc,0x00,0xb7,0x28 },
+  16, 0xaa00, 0, {0x24,0x80,0x08,0x70,0x06,0xd4,0x20,0xb7,0x01,0x2d,0xc1,0x08,0x60,0x02,0x50,0x80 },
+  16, 0xaa10, 0, {0xb4,0x08,0x21,0x62,0x09,0x74,0x06,0x80,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xaa20, 0, {0x20,0x14,0xc7,0x04,0xb3,0x00,0x2c,0xc0,0x0b,0xb0,0x02,0xcc,0x00,0xa3,0x02,0x60 },
+  16, 0xaa30, 0, {0xc0,0x08,0x38,0x02,0x4e,0x44,0xa0,0xc0,0x24,0x91,0x08,0x30,0x02,0xc0,0x00,0xb3 },
+  16, 0xaa40, 0, {0x00,0x24,0x60,0x08,0x1c,0x02,0x4c,0x88,0xb3,0xc0,0x20,0xa0,0x08,0x00,0x0a,0x88 },
+  16, 0xaa50, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xac,0x00,0xff,0x00,0x2f,0xc0 },
+  16, 0xaa60, 0, {0x4f,0xf0,0x13,0xfc,0x08,0xe7,0x8a,0x3f,0xc0,0x0c,0xf5,0xc2,0xfe,0x10,0xbb,0xc0 },
+  16, 0xaa70, 0, {0x32,0xd4,0x0c,0x30,0x13,0xe3,0x04,0xbf,0x00,0x2e,0x62,0x08,0xb9,0x02,0x6e,0x00 },
+  16, 0xaa80, 0, {0xfb,0x01,0x32,0xa4,0x4d,0x94,0x02,0xab,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xaa90, 0, {0x80,0x00,0xec,0x60,0xfb,0x00,0x1e,0xc0,0x0f,0xb0,0x13,0xec,0x00,0x5b,0x00,0x3a },
+  16, 0xaaa0, 0, {0xc0,0x0f,0xb0,0x41,0xec,0x00,0x7b,0x45,0xba,0x40,0x2e,0xb0,0x15,0xe0,0x01,0xfb },
+  16, 0xaab0, 0, {0x00,0x3e,0x50,0x0e,0xc0,0x03,0xf0,0x40,0xfc,0x20,0x3f,0x50,0x8f,0x90,0x01,0x60 },
+  16, 0xaac0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xf4,0x00,0xff,0x00,0x3f,0xc0 },
+  16, 0xaad0, 0, {0x8f,0xf0,0x03,0x1c,0x02,0xcf,0x00,0x36,0xc0,0x0d,0xf0,0x03,0x7c,0x00,0x7f,0x2a },
+  16, 0xaae0, 0, {0x3f,0x80,0x0f,0xf8,0x13,0x90,0x21,0xcf,0x00,0x3f,0x62,0x0c,0xe0,0x03,0x30,0x00 },
+  16, 0xaaf0, 0, {0xf8,0x00,0x3f,0x00,0x0f,0xd0,0x03,0x80,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xab00, 0, {0x81,0x04,0x64,0x11,0xbb,0x00,0x2e,0xc0,0x0b,0xb0,0x02,0x2c,0x00,0xdb,0x04,0x32 },
+  16, 0xab10, 0, {0xc0,0x0e,0xb0,0x02,0xec,0x00,0xbb,0x84,0x2e,0x40,0x0b,0xb9,0x42,0x22,0x42,0x8b },
+  16, 0xab20, 0, {0x01,0x2c,0x72,0x0a,0x90,0x42,0x2c,0x00,0xbb,0x00,0x2e,0xc2,0x8f,0x88,0x06,0xe0 },
+  16, 0xab30, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x24,0x00,0xbb,0x00,0x6e,0xc0 },
+  16, 0xab40, 0, {0x48,0xb0,0x42,0x2c,0x00,0x8b,0x00,0x26,0xc0,0x0a,0xb0,0x12,0xec,0x00,0xbb,0x40 },
+  16, 0xab50, 0, {0x2e,0xc8,0x0b,0xb0,0x12,0x2c,0x00,0x8b,0x00,0x2e,0x48,0x0a,0x30,0x02,0x6c,0x00 },
+  16, 0xab60, 0, {0xbb,0x00,0x2e,0x80,0x4b,0x98,0x02,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xab70, 0, {0x08,0x04,0x04,0x00,0xb3,0x00,0x6c,0xc2,0x4b,0x31,0x02,0x0c,0x50,0x9b,0x20,0x20 },
+  16, 0xab80, 0, {0xc0,0x0a,0x32,0x12,0xcc,0x80,0xb3,0x00,0x6c,0x0c,0x0b,0x31,0x02,0x0c,0x42,0x83 },
+  16, 0xab90, 0, {0x08,0x2e,0x40,0x0a,0x00,0x02,0x00,0x80,0xb0,0x00,0x2c,0x41,0x0b,0x10,0x02,0x42 },
+  16, 0xaba0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x64,0x00,0xbb,0x40,0x3f,0xcc },
+  16, 0xabb0, 0, {0x0e,0xf0,0x83,0x3d,0xa0,0xcf,0x20,0x37,0xc0,0x0c,0xf7,0xc3,0xfd,0x48,0xf3,0x00 },
+  16, 0xabc0, 0, {0x3e,0x88,0x0f,0xb4,0x13,0xa5,0x00,0x8f,0x30,0x3e,0x40,0x0c,0xa0,0x03,0x60,0x80 },
+  16, 0xabd0, 0, {0xf8,0x00,0x3e,0x00,0x0f,0x90,0x23,0xc0,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xabe0, 0, {0xa0,0x19,0xf4,0x00,0xff,0x29,0x3f,0xc9,0x0f,0xf0,0x13,0xfc,0x94,0xef,0x12,0x3b },
+  16, 0xabf0, 0, {0xc0,0x8e,0xb2,0x07,0xfd,0x04,0xff,0x10,0x3f,0x0c,0x0f,0xf0,0x03,0xf0,0x00,0xfb },
+  16, 0xac00, 0, {0x20,0x3d,0x40,0x0f,0xd0,0x43,0xfc,0x40,0xff,0x04,0x3f,0xc0,0x0e,0xc0,0x43,0xe8 },
+  16, 0xac10, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfc,0xa2,0xc7,0x20,0x3f,0x24 },
+  16, 0xac20, 0, {0x0c,0xf0,0x03,0x3c,0x80,0xcc,0x09,0x33,0xd1,0x0c,0xf1,0x23,0xfc,0x20,0xdf,0x36 },
+  16, 0xac30, 0, {0x3f,0xc0,0x0e,0x48,0x03,0xfe,0x00,0xff,0x80,0x37,0xe4,0x0d,0x78,0x03,0x11,0xa0 },
+  16, 0xac40, 0, {0xcf,0x00,0x37,0xc8,0x0c,0xf0,0x03,0x30,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xac50, 0, {0x80,0x10,0xff,0x00,0x8f,0xd1,0x2e,0x08,0x0d,0xb6,0x12,0x3d,0x45,0xf9,0x64,0x27 },
+  16, 0xac60, 0, {0xd0,0x88,0xba,0x14,0xcc,0x04,0x8f,0x40,0x23,0xf0,0x0b,0x88,0x02,0x2e,0x04,0xbb },
+  16, 0xac70, 0, {0x80,0xae,0xc0,0x08,0xb8,0x0a,0x21,0x00,0x88,0xd0,0x22,0x20,0x28,0xb0,0x02,0x20 },
+  16, 0xac80, 0, {0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x00,0x93,0x00,0x2e,0x00 },
+  16, 0xac90, 0, {0x0a,0x34,0x82,0x8c,0xa0,0xa0,0x08,0x24,0xd8,0x09,0x31,0x02,0xcc,0x20,0xb3,0x32 },
+  16, 0xaca0, 0, {0x28,0xd0,0x4a,0x80,0x02,0xcc,0x0c,0xbb,0x00,0x22,0x40,0x89,0xb0,0x02,0x60,0x80 },
+  16, 0xacb0, 0, {0x93,0x00,0x24,0xd0,0x0b,0x30,0x02,0xa2,0x01,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xacc0, 0, {0xc0,0x11,0xac,0x00,0x9b,0x00,0x2e,0x20,0x09,0xb0,0x4a,0x2c,0x02,0xa0,0x00,0x06 },
+  16, 0xacd0, 0, {0xc0,0x09,0xb0,0x00,0xec,0x00,0xab,0x00,0x2a,0xc0,0x0b,0x88,0x02,0x6c,0x00,0xbb },
+  16, 0xace0, 0, {0x20,0x2a,0xe2,0x41,0xb8,0x2a,0x60,0x0a,0x98,0x00,0x26,0x00,0x0b,0xb0,0x02,0xb8 },
+  16, 0xacf0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xec,0x08,0xdb,0x02,0x3e,0x20 },
+  16, 0xad00, 0, {0x4c,0xb0,0x03,0x2c,0x02,0x8b,0x20,0x12,0xc0,0x29,0xb0,0x12,0xec,0x00,0xfb,0x00 },
+  16, 0xad10, 0, {0x3a,0xc0,0x0e,0x88,0x03,0xed,0x20,0xfb,0xc8,0x34,0xf0,0x0d,0xba,0x03,0x47,0x60 },
+  16, 0xad20, 0, {0xc9,0x00,0x36,0x40,0x0f,0xb0,0x0b,0x90,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xad30, 0, {0xe0,0x01,0x9c,0x00,0xef,0x00,0x0f,0x00,0x0f,0x30,0x00,0xfc,0x00,0xdf,0x90,0xbb },
+  16, 0xad40, 0, {0xc0,0xce,0xf0,0x03,0xfc,0x04,0xcb,0x00,0x17,0xc0,0x0f,0xc0,0x03,0xbc,0x84,0xff },
+  16, 0xad50, 0, {0x00,0x37,0xc0,0x0e,0xd0,0x63,0xb8,0x00,0xea,0x00,0x3a,0x80,0x0c,0x30,0x03,0x70 },
+  16, 0xad60, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xfb,0x02,0x32,0x00 },
+  16, 0xad70, 0, {0x0f,0xb0,0x53,0x2c,0x00,0xfa,0x00,0x32,0xc0,0x8f,0xb0,0x07,0x2c,0x00,0xfb,0x00 },
+  16, 0xad80, 0, {0xb2,0xc0,0x0f,0x80,0x07,0xac,0x80,0xdb,0x24,0x7e,0xd0,0x0e,0xb0,0x23,0x74,0x04 },
+  16, 0xad90, 0, {0xdd,0x08,0xb5,0x40,0x0c,0xb0,0x03,0x10,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xada0, 0, {0xc8,0x05,0x3c,0x00,0xbf,0xc0,0xa0,0x00,0x1b,0xf0,0x02,0x3f,0x60,0xea,0x50,0x23 },
+  16, 0xadb0, 0, {0xc0,0x08,0xfa,0x07,0xfc,0x00,0xdf,0x00,0x63,0xc0,0x48,0x18,0x02,0x2d,0x00,0xb3 },
+  16, 0xadc0, 0, {0x00,0x6e,0xc0,0x0d,0x3a,0x03,0x24,0x00,0x82,0x80,0x32,0x80,0x0d,0xf0,0x03,0x32 },
+  16, 0xadd0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x14,0xb3,0x59,0x20,0x80 },
+  16, 0xade0, 0, {0x09,0x30,0x02,0x2e,0x05,0xb0,0x44,0x2e,0xc0,0x09,0x34,0x82,0xec,0x00,0xab,0x04 },
+  16, 0xadf0, 0, {0x20,0xc0,0x09,0x21,0xb2,0x8e,0x04,0x93,0xc0,0x24,0xc0,0x0a,0x18,0x06,0x4c,0x00 },
+  16, 0xae00, 0, {0x92,0x50,0x20,0xc0,0x08,0x30,0x02,0x70,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xae10, 0, {0x20,0x01,0x1e,0x00,0xb7,0x80,0x61,0xe0,0x0b,0x78,0x0a,0x5e,0x01,0xb1,0xa0,0x2d },
+  16, 0xae20, 0, {0xe0,0x0a,0x78,0x02,0x5e,0x00,0x07,0x90,0x21,0xe0,0x18,0xc8,0x02,0x1e,0x00,0xb7 },
+  16, 0xae30, 0, {0x80,0x2d,0xe0,0x8a,0xd8,0x02,0x3e,0xc0,0x85,0x80,0x21,0x20,0x19,0x78,0x22,0x00 },
+  16, 0xae40, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0xf3,0x94,0x20,0x10 },
+  16, 0xae50, 0, {0x4b,0x30,0x07,0x0c,0x00,0xf3,0x00,0x3e,0xc8,0x0f,0x30,0x03,0xcc,0x00,0x23,0x10 },
+  16, 0xae60, 0, {0x00,0xcb,0x05,0x20,0x02,0x8c,0x60,0x93,0x0a,0x2e,0xc4,0x0a,0x01,0x07,0x4c,0x80 },
+  16, 0xae70, 0, {0xd2,0x01,0x30,0xc0,0x2c,0x30,0x0b,0x5a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xae80, 0, {0x40,0x1d,0xbc,0x00,0xff,0x01,0x0f,0x40,0x0f,0xf0,0x13,0xbc,0x00,0xef,0x26,0x73 },
+  16, 0xae90, 0, {0xc2,0x0c,0xb0,0x83,0xbc,0x40,0xff,0x18,0x3d,0xc0,0x4a,0xc1,0x03,0xfc,0x00,0xfb },
+  16, 0xaea0, 0, {0x12,0x3f,0xc4,0x4d,0xc1,0x0b,0xfc,0x81,0xfd,0x00,0x3f,0x20,0x0f,0xf0,0x03,0xd0 },
+  16, 0xaeb0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x20,0xcb,0x48,0x3e,0x00 },
+  16, 0xaec0, 0, {0x0c,0xb0,0x03,0x2d,0x20,0xe9,0x80,0xfa,0xc8,0x0d,0xb0,0x03,0xee,0x00,0xdb,0x24 },
+  16, 0xaed0, 0, {0x76,0xf3,0x8e,0x80,0x33,0xec,0x44,0xeb,0x10,0x3e,0xc0,0x0f,0x90,0x03,0xe8,0x04 },
+  16, 0xaee0, 0, {0xdc,0x00,0xb3,0x61,0x0c,0xb0,0x03,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xaef0, 0, {0x48,0x11,0x8d,0x00,0x87,0x20,0x2f,0x01,0x28,0x70,0x02,0x0c,0x84,0x8d,0x04,0x31 },
+  16, 0xaf00, 0, {0xcc,0xc9,0x72,0x02,0xdd,0x00,0x37,0x33,0x21,0xd8,0x08,0x40,0x02,0xdc,0x00,0xb7 },
+  16, 0xaf10, 0, {0x20,0x3d,0xc0,0x09,0x50,0x22,0xf0,0x00,0x97,0x00,0x21,0x80,0x0a,0xfc,0x02,0x92 },
+  16, 0xaf20, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x1e,0x82,0x87,0xb0,0x2d,0x20 },
+  16, 0xaf30, 0, {0x08,0x39,0x02,0x1e,0x41,0xa7,0x80,0x24,0xe0,0x09,0x7a,0x32,0x8e,0x82,0x07,0xa0 },
+  16, 0xaf40, 0, {0x25,0xe0,0x8b,0x48,0x02,0x1e,0x00,0xa7,0xe1,0x2d,0xe0,0x4b,0x58,0x00,0xda,0x00 },
+  16, 0xaf50, 0, {0xa0,0x80,0x24,0x60,0x08,0x7a,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xaf60, 0, {0x48,0x14,0xcc,0x00,0x83,0x00,0x2c,0x00,0x08,0x30,0x02,0x8c,0x00,0x93,0x00,0x22 },
+  16, 0xaf70, 0, {0xc1,0x09,0x30,0x42,0xcc,0x00,0x83,0x00,0x60,0xc0,0x08,0x1a,0x02,0xce,0x04,0xb3 },
+  16, 0xaf80, 0, {0xe0,0x28,0xa0,0x09,0x1c,0x82,0x4b,0x08,0xa3,0x80,0x24,0xa0,0x2a,0x30,0x02,0x9a },
+  16, 0xaf90, 0, {0x04,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x00,0xca,0x00,0x2f,0x88 },
+  16, 0xafa0, 0, {0x0c,0xa0,0x13,0x28,0x00,0xee,0x00,0x2e,0x80,0x2d,0xa0,0x03,0xe8,0x00,0xda,0x00 },
+  16, 0xafb0, 0, {0x76,0x80,0x0e,0xe8,0x03,0xbb,0x80,0xee,0x40,0x2f,0xa2,0x8f,0xe6,0x03,0xeb,0x86 },
+  16, 0xafc0, 0, {0xfa,0x80,0x37,0x82,0x0c,0x20,0x07,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xafd0, 0, {0x48,0x00,0xe0,0x00,0xf8,0x40,0x1e,0x00,0x0f,0x80,0x0b,0x61,0x00,0xe8,0xc0,0x3a },
+  16, 0xafe0, 0, {0x00,0x0e,0x80,0x03,0xe0,0x01,0xf8,0x00,0x7e,0x10,0x1e,0x81,0x03,0xe0,0x08,0xf8 },
+  16, 0xaff0, 0, {0x00,0x3e,0x00,0x0d,0x80,0x03,0xc0,0x28,0xdc,0x50,0x3b,0x00,0x0f,0x80,0x03,0xd2 },
+  16, 0xb000, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xc4,0x02,0xc9,0x00,0x3e,0x42 },
+  16, 0xb010, 0, {0x0f,0x10,0x03,0xa6,0x00,0xc9,0x01,0x3a,0x40,0x0e,0x94,0x01,0xe4,0x10,0xf1,0x04 },
+  16, 0xb020, 0, {0x32,0x40,0x0f,0x9a,0x23,0x20,0x60,0xf8,0x04,0x0a,0x42,0x0e,0x90,0x13,0x24,0x00 },
+  16, 0xb030, 0, {0xc1,0x00,0x32,0x40,0x0f,0x90,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb040, 0, {0x80,0x04,0x67,0x08,0xa9,0x00,0x6e,0x40,0x08,0x90,0x02,0x27,0x82,0x89,0x00,0x26 },
+  16, 0xb050, 0, {0x40,0x08,0x9c,0x03,0xa4,0x10,0xb9,0x00,0x36,0x40,0x9b,0x1c,0x1a,0x23,0x04,0xb8 },
+  16, 0xb060, 0, {0x00,0x3a,0x40,0x0e,0x10,0x02,0x24,0x02,0xc9,0xa0,0xa2,0x40,0x0b,0x90,0x0a,0x20 },
+  16, 0xb070, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x25,0x80,0x89,0x04,0x2c,0x40 },
+  16, 0xb080, 0, {0x08,0x90,0x02,0x84,0x81,0x99,0x40,0x2e,0x40,0x1a,0x90,0x06,0xe4,0x01,0xb9,0x00 },
+  16, 0xb090, 0, {0xa6,0x41,0x1b,0x90,0x82,0x21,0x00,0xb8,0x10,0x2e,0x40,0x0a,0x92,0x0a,0xa4,0x01 },
+  16, 0xb0a0, 0, {0x8f,0x22,0x23,0x40,0x0b,0x90,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb0b0, 0, {0x08,0x04,0x04,0x80,0xa3,0x20,0x2c,0x41,0x09,0x12,0x02,0x04,0x80,0x81,0x20,0x24 },
+  16, 0xb0c0, 0, {0x48,0x0a,0x36,0x02,0xc4,0x80,0xb1,0x20,0x04,0xc8,0x4b,0x14,0x02,0x05,0x00,0xb1 },
+  16, 0xb0d0, 0, {0x05,0x28,0x50,0x0a,0x90,0x02,0x05,0x02,0x85,0x00,0x21,0x40,0x0b,0x12,0x02,0x02 },
+  16, 0xb0e0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xc8,0x00,0x6e,0x14 },
+  16, 0xb0f0, 0, {0x2c,0x85,0x02,0xa1,0x40,0xc8,0x50,0x3a,0x14,0x0e,0x80,0x02,0xe1,0x40,0xb0,0x50 },
+  16, 0xb100, 0, {0x32,0x00,0x0b,0x80,0x03,0x20,0x00,0xfa,0x00,0x3e,0x00,0x0e,0x80,0x03,0xa0,0x02 },
+  16, 0xb110, 0, {0xc8,0x00,0x13,0x00,0x0f,0x82,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb120, 0, {0x98,0x1d,0xe4,0x48,0xf9,0x14,0x3f,0x40,0x0c,0x91,0x03,0xe4,0x42,0xfd,0x10,0x36 },
+  16, 0xb130, 0, {0x44,0x0d,0x91,0x23,0xa4,0x48,0xf9,0x11,0x38,0x44,0x0f,0xd0,0x03,0xe5,0x14,0x39 },
+  16, 0xb140, 0, {0x42,0x7b,0x40,0x8e,0xd0,0x01,0xf5,0x00,0xa9,0x40,0x3e,0x50,0x07,0x96,0x83,0xe6 },
+  16, 0xb150, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0xf6,0x80,0xdd,0xae,0x3a,0x50 },
+  16, 0xb160, 0, {0x0d,0x9a,0x0b,0x76,0x80,0xcf,0x88,0x32,0x70,0x2d,0xda,0x03,0xa7,0x01,0xe9,0x92 },
+  16, 0xb170, 0, {0x37,0x68,0x0d,0x94,0x03,0xe7,0x00,0xed,0xa0,0x3a,0x50,0x0f,0xd0,0x03,0xe7,0x02 },
+  16, 0xb180, 0, {0xcd,0x80,0x33,0x68,0x0c,0xd8,0x83,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb190, 0, {0x38,0x10,0xe1,0x00,0x88,0x40,0x20,0x20,0x0c,0x8c,0x02,0x23,0x00,0x88,0xe0,0x22 },
+  16, 0xb1a0, 0, {0x30,0x08,0x84,0x02,0xe3,0x00,0xb8,0xe0,0x22,0x14,0x8d,0x88,0x02,0xe3,0x00,0xb8 },
+  16, 0xb1b0, 0, {0x50,0x2e,0xa8,0x8b,0x80,0x22,0xe3,0x48,0x88,0x50,0x22,0x00,0x08,0x8c,0x02,0x0e },
+  16, 0xb1c0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x40,0x91,0x00,0x2a,0x48 },
+  16, 0xb1d0, 0, {0x09,0x14,0x82,0x05,0x20,0x81,0x08,0x20,0x58,0x09,0x11,0x02,0x85,0x88,0xb1,0x40 },
+  16, 0xb1e0, 0, {0xa0,0x40,0x08,0x12,0x02,0xc5,0x80,0xa1,0x00,0x28,0x40,0x0b,0x18,0x02,0xc4,0x84 },
+  16, 0xb1f0, 0, {0xa1,0x00,0x24,0x50,0x08,0x10,0x92,0x03,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb200, 0, {0x18,0x15,0xac,0x10,0x9b,0x00,0x22,0x40,0x08,0x90,0x02,0x04,0x06,0x89,0x04,0x20 },
+  16, 0xb210, 0, {0x40,0x09,0x90,0x02,0xe4,0x01,0xb9,0x02,0x22,0x41,0x89,0xa0,0x82,0xe0,0xa0,0xb9 },
+  16, 0xb220, 0, {0x28,0x2e,0x44,0x0b,0xb0,0x02,0xe4,0x02,0xb9,0x00,0x26,0x40,0x28,0x10,0x02,0x06 },
+  16, 0xb230, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x00,0xd9,0x00,0x38,0x40 },
+  16, 0xb240, 0, {0x0d,0x90,0x03,0x24,0x00,0xc9,0xa0,0xa2,0x40,0x8d,0x90,0x03,0xa4,0x00,0xf9,0x00 },
+  16, 0xb250, 0, {0x36,0x40,0x0c,0x84,0x13,0xe2,0x00,0xe9,0x00,0x3a,0x50,0x0f,0x9c,0x02,0xe6,0x84 },
+  16, 0xb260, 0, {0xe9,0x00,0xb6,0x40,0x0c,0x90,0x03,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb270, 0, {0x28,0x01,0xa4,0x00,0xe1,0x00,0x3e,0x68,0x0e,0x10,0x03,0xa4,0x00,0xf1,0x28,0x3a },
+  16, 0xb280, 0, {0x40,0x0e,0x90,0x03,0xe4,0x00,0xf9,0x00,0x3e,0x42,0x0f,0x80,0x23,0xe2,0x00,0xf9 },
+  16, 0xb290, 0, {0x00,0x3e,0x40,0x0f,0x91,0x23,0xe4,0x40,0xc1,0x00,0x3a,0x40,0x0f,0x90,0x0b,0xca },
+  16, 0xb2a0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0x80,0x00,0xc8,0x00,0x32,0x00 },
+  16, 0xb2b0, 0, {0x0c,0x80,0x03,0xa0,0x20,0xc8,0x40,0x3e,0x00,0x0e,0x81,0x63,0x60,0x00,0xf0,0x04 },
+  16, 0xb2c0, 0, {0x3c,0x01,0x0c,0x84,0x03,0xe0,0x00,0xc8,0x00,0x3e,0x00,0x0e,0x80,0x03,0xc1,0x00 },
+  16, 0xb2d0, 0, {0xd8,0x10,0x32,0x00,0x0c,0x80,0x23,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb2e0, 0, {0x28,0x05,0x38,0x60,0x8e,0x00,0x22,0x80,0x0a,0xa0,0x02,0x38,0x80,0xbe,0x00,0x3a },
+  16, 0xb2f0, 0, {0x80,0x08,0xe0,0x02,0x28,0x00,0xba,0x00,0x23,0x98,0x18,0xec,0x02,0xf8,0x20,0xae },
+  16, 0xb300, 0, {0x00,0x22,0x80,0x0b,0xe4,0x82,0xe8,0x02,0xce,0x44,0x28,0x80,0x0d,0xa0,0x0a,0x0a },
+  16, 0xb310, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x40,0x00,0x82,0x04,0xa0,0xc0 },
+  16, 0xb320, 0, {0x09,0x30,0x02,0x8e,0x04,0x83,0x50,0x6c,0xc0,0x0a,0x30,0x86,0x0c,0x00,0xb3,0x00 },
+  16, 0xb330, 0, {0x28,0x30,0x0a,0x36,0x12,0xcc,0x80,0x81,0x00,0x24,0xc0,0x0b,0x32,0x06,0xcc,0x00 },
+  16, 0xb340, 0, {0x80,0x88,0x64,0x60,0x28,0x10,0x02,0x02,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb350, 0, {0xa0,0x01,0x10,0x12,0x84,0x40,0x21,0xc8,0x0a,0x72,0x02,0x10,0x00,0xb7,0x00,0x2d },
+  16, 0xb360, 0, {0xcc,0x08,0x38,0x12,0x1c,0x00,0xb3,0x30,0x20,0x00,0x08,0x71,0x82,0xfe,0x00,0xa4 },
+  16, 0xb370, 0, {0x80,0x21,0xc8,0x0b,0x70,0x02,0xdc,0x01,0x87,0x00,0x2c,0x42,0x09,0x51,0x02,0x20 },
+  16, 0xb380, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x12,0x00,0xc2,0x80,0x31,0xf8 },
+  16, 0xb390, 0, {0x4c,0xfc,0x13,0x92,0x09,0xc7,0x80,0x3c,0xed,0x1e,0x78,0x27,0x1e,0x00,0xf7,0x8c },
+  16, 0xb3a0, 0, {0x79,0x20,0x08,0x7a,0x03,0xde,0x81,0x84,0x80,0x3d,0xe0,0x0e,0x78,0x03,0xfe,0x20 },
+  16, 0xb3b0, 0, {0xc5,0x81,0x35,0x60,0x2c,0x58,0x03,0x2a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb3c0, 0, {0x08,0x1d,0x80,0x00,0xf8,0x04,0x3e,0xd0,0x0f,0xb0,0x13,0xe0,0x00,0xfb,0x02,0x3a },
+  16, 0xb3d0, 0, {0xd0,0x0f,0xa0,0x0b,0xac,0x40,0xfb,0x00,0x3a,0x00,0x2f,0xb0,0x03,0xcc,0x00,0xf0 },
+  16, 0xb3e0, 0, {0x00,0x3a,0xc4,0x0f,0xb0,0x03,0xfc,0x41,0xf3,0x00,0x3a,0x40,0x0f,0x50,0x93,0xc2 },
+  16, 0xb3f0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xf6,0x00,0xcc,0x81,0x3f,0xfc },
+  16, 0xb400, 0, {0x1c,0xf8,0x03,0x76,0x40,0xef,0x92,0x3f,0xe4,0x8c,0xf8,0x03,0xbf,0x10,0xff,0x80 },
+  16, 0xb410, 0, {0xb3,0x20,0x0e,0xf9,0x13,0xfe,0x24,0xfd,0x94,0x37,0xe0,0x1c,0xf9,0x03,0xee,0x00 },
+  16, 0xb420, 0, {0xcd,0x80,0xb3,0xe0,0x0c,0x58,0x02,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb430, 0, {0xa8,0x11,0x94,0x40,0x80,0x00,0x2f,0xc4,0x08,0x72,0x02,0xdd,0x08,0xd7,0x00,0x2d },
+  16, 0xb440, 0, {0xcc,0x08,0xde,0x03,0x5c,0x00,0xb7,0x04,0x21,0x80,0xc8,0x70,0x83,0xdc,0x00,0xb4 },
+  16, 0xb450, 0, {0xa0,0x2f,0xc0,0x0c,0x70,0x02,0xde,0x80,0x87,0x00,0x21,0xc2,0x0a,0x51,0x42,0x2a },
+  16, 0xb460, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x00,0x84,0x00,0x2d,0xc8 },
+  16, 0xb470, 0, {0x48,0x70,0x02,0x54,0x0c,0xa7,0x00,0x2c,0xc0,0x89,0x72,0x02,0x5c,0x00,0xb3,0x10 },
+  16, 0xb480, 0, {0x20,0x00,0x0a,0x70,0x06,0xdc,0x00,0xb4,0x20,0x2d,0xc0,0x08,0x70,0x02,0xdc,0x80 },
+  16, 0xb490, 0, {0x93,0x00,0x20,0xc0,0x08,0x50,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb4a0, 0, {0x20,0x14,0xc0,0x00,0x80,0x00,0x2e,0xc0,0x08,0x30,0x02,0xc4,0x08,0xa2,0x42,0x2c },
+  16, 0xb4b0, 0, {0xc1,0x09,0x20,0x02,0x4c,0x00,0xb3,0x00,0x20,0x80,0x08,0x3c,0x22,0x8c,0x20,0xb0 },
+  16, 0xb4c0, 0, {0x08,0x2e,0xe0,0x08,0x38,0x10,0xcf,0x0a,0x93,0x40,0xa0,0xf0,0x0a,0x10,0x02,0x08 },
+  16, 0xb4d0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xa8,0x00,0xc1,0x00,0x3f,0xc0 },
+  16, 0xb4e0, 0, {0x2c,0xf0,0x03,0x68,0x00,0xaa,0x00,0x3f,0xc0,0x2d,0x80,0x03,0x7c,0x00,0xff,0x00 },
+  16, 0xb4f0, 0, {0x32,0x00,0x0e,0xb0,0x12,0xed,0x24,0xfa,0x08,0x27,0xc8,0x10,0xb8,0xa2,0xff,0x60 },
+  16, 0xb500, 0, {0x98,0xa0,0xa2,0xe0,0x0c,0x50,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb510, 0, {0x80,0x00,0xc9,0x06,0xf8,0x41,0x3e,0xc0,0x0f,0xb0,0x03,0xe9,0x10,0x5a,0x20,0x3e },
+  16, 0xb520, 0, {0xc0,0x0e,0x80,0x03,0xec,0x00,0xf3,0x00,0x7e,0x01,0x0f,0xb0,0x93,0xed,0x00,0xf8 },
+  16, 0xb530, 0, {0x40,0x3e,0xc0,0x0e,0xb0,0x03,0xfc,0x00,0xe3,0x08,0x3c,0xc2,0x0f,0xd0,0x13,0xe0 },
+  16, 0xb540, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xf3,0x02,0xcc,0x00,0x3b,0xc2 },
+  16, 0xb550, 0, {0x0c,0xf0,0x23,0xae,0x40,0xdf,0x81,0x39,0xc0,0x06,0xd0,0x03,0xfc,0x00,0xff,0x04 },
+  16, 0xb560, 0, {0x31,0x41,0x0c,0xf0,0x03,0xfc,0x00,0xcc,0xa0,0x37,0xc2,0x0c,0xf0,0x03,0x7c,0x04 },
+  16, 0xb570, 0, {0xcd,0x00,0x33,0xf0,0x0c,0xd0,0x03,0x08,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb580, 0, {0x81,0x04,0x60,0x00,0x88,0x80,0x22,0xc0,0x0a,0xb0,0x02,0xe9,0x00,0xab,0x44,0x2e },
+  16, 0xb590, 0, {0xc0,0x08,0x88,0x02,0xec,0x00,0xbb,0x00,0xa2,0x70,0x0a,0xb4,0x02,0xcc,0x00,0xa0 },
+  16, 0xb5a0, 0, {0x20,0x22,0xc0,0x0f,0xbc,0x02,0xcc,0x0a,0x8b,0x80,0xa2,0xc0,0x0d,0x90,0x02,0x20 },
+  16, 0xb5b0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x20,0x00,0x89,0x80,0x2a,0xc0 },
+  16, 0xb5c0, 0, {0x08,0xb0,0x02,0xcc,0x06,0x88,0x60,0x2e,0xc0,0x0a,0x98,0x06,0xec,0x01,0xbb,0x00 },
+  16, 0xb5d0, 0, {0x22,0x31,0x02,0xb2,0x02,0xec,0xa0,0x8a,0x00,0x26,0xc0,0x48,0xa8,0x02,0xec,0x04 },
+  16, 0xb5e0, 0, {0xa9,0x80,0x22,0x40,0x08,0x90,0x02,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb5f0, 0, {0x08,0x04,0x00,0x00,0x80,0x00,0x20,0xc0,0x0a,0x30,0x42,0xcc,0x00,0x80,0x01,0x2c },
+  16, 0xb600, 0, {0xc0,0x1a,0x12,0x02,0xcc,0x00,0xb3,0x00,0x20,0x00,0x4a,0x30,0x02,0xcc,0x00,0xa0 },
+  16, 0xb610, 0, {0x00,0x08,0xc0,0x0b,0x20,0x06,0xec,0xa0,0xa3,0x00,0xa0,0x40,0x29,0x10,0x00,0x02 },
+  16, 0xb620, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x60,0x00,0xc8,0x50,0x3b,0xc0 },
+  16, 0xb630, 0, {0x0c,0xb0,0x03,0xac,0x00,0xc9,0x00,0x3b,0xc0,0x0e,0x92,0x83,0xfc,0x00,0xbf,0x00 },
+  16, 0xb640, 0, {0x12,0x00,0x0c,0xb0,0x03,0xec,0x00,0x88,0x26,0x16,0xc0,0x0c,0x80,0x17,0x5c,0x80 },
+  16, 0xb650, 0, {0xe9,0x01,0x32,0x40,0x2c,0xd0,0x03,0x00,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb660, 0, {0xa0,0x1d,0xd0,0x00,0xfc,0x20,0x3f,0xc0,0x0f,0xf0,0x03,0xfc,0x00,0xfc,0x00,0x3f },
+  16, 0xb670, 0, {0xc0,0x0d,0x80,0x03,0xfc,0x08,0xff,0x00,0x3f,0x00,0x0f,0xf0,0x03,0xfc,0x10,0xf8 },
+  16, 0xb680, 0, {0x40,0x37,0xc0,0x0e,0xe0,0x21,0xfc,0x08,0xdf,0x00,0x3f,0x40,0x0f,0xd0,0x03,0xe0 },
+  16, 0xb690, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfc,0xc0,0xff,0x21,0x71,0x24 },
+  16, 0xb6a0, 0, {0x0f,0xf1,0x83,0xf2,0x40,0xff,0x00,0x37,0xc4,0x9f,0xf2,0x47,0x3d,0x04,0xc7,0x20 },
+  16, 0xb6b0, 0, {0x33,0xc0,0x0c,0x78,0x23,0xfe,0x40,0xe8,0x10,0x27,0xc4,0x0f,0xf2,0x13,0x3c,0x84 },
+  16, 0xb6c0, 0, {0xc4,0x81,0x33,0x20,0x4c,0xf0,0x23,0x70,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb6d0, 0, {0x80,0x10,0xed,0x40,0xbf,0x54,0x62,0xc8,0x0b,0xf6,0x02,0xe0,0x00,0xbb,0xd0,0x22 },
+  16, 0xb6e0, 0, {0xf0,0x1f,0xf9,0x12,0x3d,0x80,0x9f,0x81,0x2b,0xe0,0x0a,0xb8,0x12,0xe8,0x00,0x8f },
+  16, 0xb6f0, 0, {0x04,0x22,0xd0,0x08,0xb3,0x8a,0xbf,0x42,0x8b,0x82,0x22,0xe0,0x28,0x8c,0x02,0x20 },
+  16, 0xb700, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x00,0xb3,0x28,0x28,0x08 },
+  16, 0xb710, 0, {0x0b,0x30,0x06,0x80,0x80,0xb3,0x02,0x24,0xd1,0x0b,0x30,0x02,0x8d,0x80,0x93,0x10 },
+  16, 0xb720, 0, {0x20,0xce,0x8b,0x30,0x02,0xcc,0x84,0xa1,0x21,0x2c,0xcc,0x0a,0x30,0x0a,0x4c,0x00 },
+  16, 0xb730, 0, {0x93,0x00,0x28,0xc0,0x08,0x3c,0x02,0x22,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb740, 0, {0xc0,0x15,0xac,0x10,0xbb,0x02,0x6a,0xe0,0x0b,0xb0,0x02,0xe1,0x08,0xbb,0x04,0x2a },
+  16, 0xb750, 0, {0xc0,0x0a,0xb0,0x12,0x8c,0x00,0x9b,0x00,0x2a,0xc0,0x0b,0xb1,0x06,0xc8,0x80,0x8b },
+  16, 0xb760, 0, {0x82,0x6a,0xc1,0x0a,0x30,0x02,0xac,0x18,0x88,0x10,0x2a,0x48,0x08,0x80,0x02,0x30 },
+  16, 0xb770, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xec,0x00,0xfb,0x00,0xaa,0x30 },
+  16, 0xb780, 0, {0x0f,0xb0,0x03,0xa8,0x00,0xf3,0x01,0xb6,0xc1,0x0b,0xb0,0x02,0xac,0x08,0x4b,0x00 },
+  16, 0xb790, 0, {0xb2,0xc0,0x0f,0xb8,0x02,0xec,0x10,0xa9,0x81,0x3e,0xc0,0x0f,0xb0,0x03,0x0c,0x00 },
+  16, 0xb7a0, 0, {0xcb,0xa0,0x18,0xd0,0x0c,0xb0,0x03,0x10,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb7b0, 0, {0xe0,0x01,0xbc,0x08,0xf7,0x00,0x37,0x00,0x0f,0xf0,0x03,0xfd,0x00,0xff,0x00,0x37 },
+  16, 0xb7c0, 0, {0xc0,0x0f,0xb0,0x07,0x7c,0x00,0xe7,0x00,0x3e,0xc0,0x0a,0xf0,0x03,0xfe,0x00,0xf7 },
+  16, 0xb7d0, 0, {0x00,0x36,0xc0,0x0c,0xf0,0x03,0xfc,0x00,0xff,0x80,0x37,0xe0,0x0f,0xa0,0x03,0xb8 },
+  16, 0xb7e0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xdb,0x00,0x36,0x00 },
+  16, 0xb7f0, 0, {0x0e,0xb0,0x03,0x69,0x00,0xdb,0x09,0x3a,0xc0,0x1f,0x30,0x23,0xec,0x08,0xcb,0x20 },
+  16, 0xb800, 0, {0x34,0xc0,0x2f,0xb0,0x03,0xec,0x40,0xeb,0x48,0x3e,0xc4,0x4d,0xb0,0x8b,0x6c,0x00 },
+  16, 0xb810, 0, {0xcb,0x00,0x32,0x90,0x0f,0x30,0x03,0x90,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb820, 0, {0xc8,0x05,0x3c,0x00,0x8f,0x00,0x22,0x00,0x48,0xf0,0x22,0x2c,0x00,0x8f,0x00,0x23 },
+  16, 0xb830, 0, {0xe0,0x8b,0xf5,0x10,0x3c,0x00,0x8f,0x80,0x23,0xf0,0x80,0x98,0x03,0x2d,0x44,0xdb },
+  16, 0xb840, 0, {0x00,0x23,0xd4,0x08,0xf8,0x02,0x3c,0x00,0x83,0x00,0x22,0xc0,0x0b,0xa4,0x82,0x32 },
+  16, 0xb850, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x00,0x93,0x00,0x24,0x00 },
+  16, 0xb860, 0, {0x0b,0x30,0x02,0x84,0x00,0xb3,0x01,0x28,0xf6,0x09,0x34,0x32,0x8c,0x01,0xb3,0xd0 },
+  16, 0xb870, 0, {0x24,0xe8,0x0a,0x31,0x0a,0x86,0x00,0x83,0x00,0x2a,0xe0,0x00,0x30,0x02,0x8c,0x00 },
+  16, 0xb880, 0, {0x83,0x00,0x28,0xc0,0x89,0x38,0xa2,0x78,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb890, 0, {0x20,0x01,0x1e,0x00,0x97,0x94,0x23,0xe0,0x09,0x38,0x02,0x32,0x00,0x97,0xa1,0x21 },
+  16, 0xb8a0, 0, {0xe4,0x0b,0x78,0x02,0x1e,0x40,0xb7,0xa0,0x25,0xec,0x08,0xfc,0x02,0x3a,0x00,0x93 },
+  16, 0xb8b0, 0, {0xb8,0x21,0xe0,0x08,0x78,0x82,0x9e,0x40,0x87,0xc0,0x29,0xa0,0x0b,0x58,0x02,0x48 },
+  16, 0xb8c0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x2c,0x00,0xdb,0x00,0x34,0x20 },
+  16, 0xb8d0, 0, {0x0f,0x3a,0x03,0x8e,0x00,0xf3,0xb0,0x28,0xc4,0x0b,0x3a,0x03,0xae,0x40,0xf3,0xa0 },
+  16, 0xb8e0, 0, {0x34,0xee,0x0f,0x30,0x23,0x84,0x00,0xe3,0xf0,0x38,0xc0,0x0c,0xb0,0x0b,0x8e,0x42 },
+  16, 0xb8f0, 0, {0xc3,0x00,0x38,0xc0,0x0f,0x30,0x63,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb900, 0, {0x40,0x1d,0xbc,0x00,0xeb,0x42,0x3a,0xc4,0x1e,0xb1,0x07,0x88,0xd1,0xe3,0x00,0x3f },
+  16, 0xb910, 0, {0xc5,0x8f,0xf1,0x63,0xac,0x10,0xcb,0x50,0x3b,0xc3,0x0f,0xd1,0x03,0xc8,0x00,0xbb },
+  16, 0xb920, 0, {0x20,0x3b,0xc0,0x2e,0xf1,0x03,0x1c,0x00,0xff,0x00,0x37,0xc0,0x4f,0xd1,0x03,0x90 },
+  16, 0xb930, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x40,0xfb,0x44,0xb2,0xc0 },
+  16, 0xb940, 0, {0x4f,0xb3,0x43,0x24,0x00,0xdb,0x10,0x36,0xc0,0x4c,0xbe,0x22,0x6d,0x20,0xcb,0x50 },
+  16, 0xb950, 0, {0x3e,0xc9,0x4c,0xb0,0x13,0x24,0x00,0xcf,0x20,0x33,0xc0,0x3d,0xf0,0x23,0x2c,0xc0 },
+  16, 0xb960, 0, {0xd8,0x00,0x3e,0x40,0x8f,0x30,0x03,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb970, 0, {0x48,0x11,0x9c,0x04,0xb7,0x60,0x21,0xc1,0x8b,0xf0,0xa2,0x14,0x10,0x87,0x00,0x0f },
+  16, 0xb980, 0, {0xc8,0x0d,0x71,0x0a,0x1d,0x00,0x87,0x00,0x2c,0xcc,0x48,0x70,0x2a,0x9c,0x00,0x87 },
+  16, 0xb990, 0, {0x0c,0x21,0xc0,0x0c,0x72,0x02,0x0c,0xa2,0x87,0x00,0x2d,0xc0,0x0b,0x70,0x02,0x12 },
+  16, 0xb9a0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x00,0xb3,0x80,0x21,0xe0 },
+  16, 0xb9b0, 0, {0x0b,0x7a,0x02,0xde,0x00,0xb7,0x81,0x05,0xe4,0x08,0x79,0x02,0x5c,0x80,0x87,0xa0 },
+  16, 0xb9c0, 0, {0x2d,0xe0,0x08,0xf8,0x06,0xb6,0x00,0x87,0x80,0x20,0xe4,0x0a,0x7b,0x12,0x1e,0x90 },
+  16, 0xb9d0, 0, {0x97,0x88,0x2d,0xe0,0x0b,0x78,0x0e,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb9e0, 0, {0x48,0x14,0xcc,0x00,0xb3,0x00,0x20,0xd0,0x0b,0xb0,0x02,0x6e,0x34,0xa3,0x00,0x2c },
+  16, 0xb9f0, 0, {0xc1,0x09,0x30,0x02,0x4c,0x00,0x83,0x00,0x2c,0xc0,0x48,0x10,0x02,0x8d,0x80,0x83 },
+  16, 0xba00, 0, {0xc0,0x00,0xc0,0x8a,0x30,0x12,0x0c,0x00,0x80,0x00,0x2c,0x16,0x0b,0x38,0x02,0x12 },
+  16, 0xba10, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x00,0xfa,0x00,0x33,0x88 },
+  16, 0xba20, 0, {0x0f,0xa0,0x03,0x79,0x90,0xfa,0x01,0x36,0x80,0x1c,0xa0,0x03,0x68,0x00,0xca,0x00 },
+  16, 0xba30, 0, {0x3e,0x81,0x2c,0xa0,0x0b,0xb9,0x0c,0xce,0xe2,0xb2,0x80,0x8e,0xa0,0x0b,0x28,0x00 },
+  16, 0xba40, 0, {0xda,0x80,0x3c,0xb0,0x0f,0xe0,0x83,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xba50, 0, {0x48,0x00,0xe0,0x00,0xf0,0x00,0x3e,0x00,0x0f,0x80,0x03,0xa0,0x00,0xc8,0x00,0x2e },
+  16, 0xba60, 0, {0x00,0x0f,0x84,0x23,0xa0,0x00,0xf0,0x40,0x3e,0x10,0x0f,0x84,0x03,0xe1,0x02,0xf8 },
+  16, 0xba70, 0, {0x48,0x3e,0x10,0x0c,0x80,0x03,0xc0,0x10,0xf8,0x80,0x3e,0x00,0x0f,0x00,0x03,0xd2 },
+  16, 0xba80, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xd9,0x00,0x36,0x42 },
+  16, 0xba90, 0, {0x0f,0x90,0x03,0x24,0x18,0xf9,0x10,0x3c,0x48,0x68,0x92,0x13,0xe4,0x00,0xa9,0x11 },
+  16, 0xbaa0, 0, {0xb2,0x60,0x0e,0x91,0x03,0x26,0x00,0xc9,0x00,0x32,0x60,0x0c,0x10,0x03,0x24,0x08 },
+  16, 0xbab0, 0, {0xc9,0x00,0x3e,0x40,0x0c,0x90,0x23,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbac0, 0, {0x80,0x04,0x64,0x00,0x89,0x00,0x22,0x40,0x0b,0x90,0x02,0xa4,0x08,0x89,0x00,0x2e },
+  16, 0xbad0, 0, {0x42,0x48,0x94,0x02,0xe4,0x00,0x89,0x80,0x22,0x70,0x08,0x14,0x22,0xa4,0x02,0x89 },
+  16, 0xbae0, 0, {0x42,0x2a,0x70,0x28,0x90,0x0a,0x24,0x00,0xa9,0x00,0x2e,0x40,0x28,0x90,0x02,0xa0 },
+  16, 0xbaf0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x04,0x00,0x99,0x00,0x26,0xc0 },
+  16, 0xbb00, 0, {0x03,0x90,0x02,0x24,0x01,0xa9,0x00,0x0e,0x40,0x0a,0x90,0x46,0xc4,0x0a,0x89,0x00 },
+  16, 0xbb10, 0, {0x20,0x48,0x0a,0x90,0x02,0x05,0x80,0x81,0x41,0xa0,0x58,0x88,0x90,0x02,0x24,0x08 },
+  16, 0xbb20, 0, {0x8d,0x80,0x2f,0xc0,0x08,0x98,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbb30, 0, {0x08,0x04,0x04,0x80,0x81,0x20,0x20,0x40,0x0b,0x12,0x02,0x84,0x00,0x81,0x24,0x2c },
+  16, 0xbb40, 0, {0x58,0x0a,0x32,0x22,0xc5,0x84,0xa1,0x00,0x20,0x50,0x08,0xb0,0x02,0x85,0x08,0x81 },
+  16, 0xbb50, 0, {0x40,0x20,0x5a,0x08,0x16,0x82,0x04,0x00,0xa5,0x00,0x2d,0x40,0x08,0x12,0x82,0x82 },
+  16, 0xbb60, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x61,0x40,0xd8,0x50,0x36,0x14 },
+  16, 0xbb70, 0, {0x0f,0x85,0x23,0x01,0x40,0xe8,0x00,0x3e,0x00,0x0e,0x80,0x43,0xc0,0x08,0xca,0x00 },
+  16, 0xbb80, 0, {0x32,0x80,0x0e,0x80,0x03,0x20,0x00,0xc0,0x00,0x32,0x08,0x2c,0x02,0x03,0x20,0x08 },
+  16, 0xbb90, 0, {0xc8,0x00,0x3f,0x00,0x0c,0x82,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbba0, 0, {0x98,0x1d,0xe4,0x40,0xf9,0x10,0x3f,0x40,0x0f,0x91,0x43,0xf4,0x04,0xf9,0x10,0x3e },
+  16, 0xbbb0, 0, {0x44,0x0d,0x11,0x03,0xe4,0x44,0x59,0x40,0x3e,0x50,0x4f,0x50,0x43,0xd4,0x02,0xfd },
+  16, 0xbbc0, 0, {0x40,0x3e,0x40,0x0f,0x90,0x0b,0xe5,0x00,0xf9,0x00,0x3e,0x40,0x4f,0xd0,0x03,0xe6 },
+  16, 0xbbd0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x66,0x60,0xc9,0xe0,0x32,0x44 },
+  16, 0xbbe0, 0, {0x0f,0x9c,0x03,0xe4,0x00,0xdd,0x84,0x3f,0x68,0x8f,0xd8,0x42,0xe6,0xa0,0xdd,0xa4 },
+  16, 0xbbf0, 0, {0x33,0x68,0x0d,0x70,0x03,0x25,0x00,0xc9,0xe0,0xb2,0x68,0x0c,0x9a,0xc3,0x26,0x00 },
+  16, 0xbc00, 0, {0x99,0x00,0x3e,0x40,0x0f,0x9a,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbc10, 0, {0x38,0x10,0xe3,0x00,0x88,0x80,0xaa,0x20,0x8b,0x88,0x02,0xe2,0x88,0xb8,0x01,0x2e },
+  16, 0xbc20, 0, {0x00,0x0b,0x84,0x02,0xe2,0xb0,0x88,0x50,0x22,0x14,0x08,0x80,0x02,0x82,0x80,0x88 },
+  16, 0xbc30, 0, {0xe0,0xb6,0x3a,0x08,0xce,0xa2,0x21,0x08,0x88,0x00,0x2e,0x00,0x0b,0xc4,0x02,0x0e },
+  16, 0xbc40, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x80,0x81,0x60,0x68,0x48 },
+  16, 0xbc50, 0, {0x5b,0x16,0x02,0xc4,0x20,0xa1,0x40,0x6c,0x50,0x0b,0x14,0x02,0xc4,0x00,0xa1,0x00 },
+  16, 0xbc60, 0, {0x24,0x40,0x0b,0x90,0x22,0x14,0x90,0x85,0x42,0x21,0x50,0x5b,0x50,0x1a,0x15,0x00 },
+  16, 0xbc70, 0, {0x95,0x00,0x2d,0x40,0x0b,0x51,0x0a,0x82,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbc80, 0, {0x18,0x15,0xa4,0x01,0x89,0x00,0x2a,0x40,0x0b,0x90,0x46,0xe4,0x00,0xb9,0x01,0x2e },
+  16, 0xbc90, 0, {0x40,0x0b,0x90,0x20,0xe4,0x00,0xb9,0x00,0x26,0x40,0x18,0xb8,0x02,0xa4,0x02,0x8d },
+  16, 0xbca0, 0, {0x08,0x2f,0x40,0x8b,0xd0,0x02,0x24,0x00,0x8d,0x20,0x2f,0x48,0x0b,0xd0,0x02,0x86 },
+  16, 0xbcb0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x00,0xc9,0x00,0x32,0x40 },
+  16, 0xbcc0, 0, {0x0f,0x90,0x02,0xe4,0x10,0x49,0x00,0x3e,0x40,0x0f,0x90,0x02,0xe4,0x00,0xe9,0x01 },
+  16, 0xbcd0, 0, {0x36,0x40,0x0f,0x18,0x13,0x24,0x10,0xc9,0x82,0x32,0x40,0x7f,0x90,0x23,0x24,0x00 },
+  16, 0xbce0, 0, {0xd9,0x20,0x3e,0x72,0x0f,0x90,0x03,0xa8,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbcf0, 0, {0x28,0x01,0x84,0x02,0xf1,0x01,0x16,0x40,0x4f,0x90,0x03,0xe5,0x10,0xf9,0x08,0x2e },
+  16, 0xbd00, 0, {0x40,0x0f,0x90,0x13,0xe4,0x00,0xc9,0x01,0x3a,0x40,0x1f,0x90,0x03,0xe4,0x00,0xf9 },
+  16, 0xbd10, 0, {0x20,0x34,0x40,0x8c,0x90,0x03,0xc4,0x08,0xf9,0x00,0x3e,0x60,0x0f,0x10,0x03,0x4a },
+  16, 0xbd20, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x08,0xf8,0x00,0x3e,0x00 },
+  16, 0xbd30, 0, {0x0c,0x80,0x03,0x60,0x00,0xe8,0x00,0x3e,0x02,0x4f,0x80,0x13,0xe0,0x00,0xd0,0x00 },
+  16, 0xbd40, 0, {0x3e,0x00,0x0e,0x81,0x03,0x30,0x00,0xcc,0x40,0x33,0x00,0x0c,0xc0,0x0b,0x20,0x20 },
+  16, 0xbd50, 0, {0xe8,0x00,0x3e,0x10,0x0f,0xc0,0x03,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbd60, 0, {0x28,0x05,0x28,0x04,0xba,0x00,0x22,0x80,0x08,0xa0,0x02,0x28,0x00,0xbe,0xc8,0x6f },
+  16, 0xbd70, 0, {0x80,0x0b,0xe1,0x22,0xa8,0x00,0x8e,0x20,0x2f,0x80,0x0b,0xe0,0x23,0x68,0x00,0x8a },
+  16, 0xbd80, 0, {0x00,0x22,0x80,0x08,0xe0,0x02,0x29,0x00,0x8a,0x00,0x2e,0xa8,0x0b,0xa0,0x00,0xca },
+  16, 0xbd90, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0xb3,0x00,0x24,0xc0 },
+  16, 0xbda0, 0, {0x09,0x30,0x02,0x0c,0x00,0xb3,0xc1,0x2c,0xe0,0x0b,0x38,0x56,0x2c,0x10,0x13,0x00 },
+  16, 0xbdb0, 0, {0x2e,0xc0,0x0a,0x38,0x6a,0x20,0x00,0x88,0x00,0x20,0x00,0x09,0x80,0x22,0x4c,0x42 },
+  16, 0xbdc0, 0, {0xa3,0x00,0x2c,0xe0,0x0b,0x24,0x80,0xca,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbdd0, 0, {0xa0,0x01,0x1c,0x08,0xb7,0x24,0x2f,0xe0,0x09,0x39,0x02,0x1c,0x01,0xb6,0x00,0x2d },
+  16, 0xbde0, 0, {0x90,0x0b,0x60,0x92,0x8e,0x00,0x86,0x82,0x2d,0xc2,0x0b,0xf0,0x02,0x5c,0x06,0x87 },
+  16, 0xbdf0, 0, {0x00,0x60,0xc0,0x29,0x70,0x02,0x5c,0x00,0x86,0x00,0x2d,0xc0,0x0b,0x60,0x02,0xe8 },
+  16, 0xbe00, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1f,0x40,0xf3,0xe4,0x3d,0xe8 },
+  16, 0xbe10, 0, {0x0d,0x79,0x0b,0x1e,0xc0,0x67,0x80,0x2d,0xe0,0x0f,0x70,0x43,0x1d,0x80,0xd5,0x00 },
+  16, 0xbe20, 0, {0x3d,0x60,0x0e,0x78,0x03,0x1e,0x00,0xcd,0x80,0x31,0xe0,0x0d,0xc8,0x03,0x4e,0x00 },
+  16, 0xbe30, 0, {0xe5,0x80,0x3d,0xe0,0x0f,0x48,0x03,0xea,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbe40, 0, {0x08,0x1d,0xac,0x80,0xfb,0x00,0x70,0xc0,0x6e,0xb6,0x13,0xad,0x40,0xfa,0x00,0x3e },
+  16, 0xbe50, 0, {0xc0,0x0f,0x20,0x43,0x2d,0x18,0x59,0x00,0x3e,0x00,0x03,0xb0,0x0b,0xe0,0x00,0xfa },
+  16, 0xbe60, 0, {0x00,0xbe,0x00,0x0e,0xb0,0x13,0xac,0x00,0xf8,0x00,0x3e,0xc0,0x0f,0x80,0x03,0xc2 },
+  16, 0xbe70, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xfe,0x40,0xff,0x80,0x3f,0xe6 },
+  16, 0xbe80, 0, {0x0f,0xf8,0x23,0x2e,0x04,0xff,0x90,0x3f,0xe4,0x0d,0xba,0x03,0xff,0x40,0xcf,0x80 },
+  16, 0xbe90, 0, {0x22,0xe1,0x0c,0x39,0x43,0x32,0x10,0xec,0x90,0x33,0x20,0x8e,0xc8,0x03,0xf2,0x00 },
+  16, 0xbea0, 0, {0xdf,0x80,0x3f,0x60,0x0f,0xf8,0x03,0xc0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbeb0, 0, {0xa8,0x11,0x9c,0x40,0xb7,0x90,0x3c,0xe0,0x0b,0x3a,0x03,0x4e,0x80,0xf3,0xb1,0x2d },
+  16, 0xbec0, 0, {0x04,0x4c,0x38,0x23,0xae,0x00,0x80,0x80,0x34,0xe8,0x4d,0x78,0x02,0x3e,0x80,0x87 },
+  16, 0xbed0, 0, {0xa0,0x29,0xc0,0x08,0x70,0x02,0xc0,0x80,0x86,0x02,0x2d,0x41,0x0b,0x70,0x02,0xea },
+  16, 0xbee0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x48,0x37,0x01,0x2d,0xc9 },
+  16, 0xbef0, 0, {0x0b,0x72,0x22,0x1c,0x84,0xb5,0x16,0x0d,0xc4,0x19,0x40,0x42,0xdc,0x80,0x87,0x00 },
+  16, 0xbf00, 0, {0x20,0xc8,0x88,0x73,0x0a,0x9c,0x80,0xb5,0x00,0x29,0xc0,0x0a,0x48,0x02,0xc0,0x02 },
+  16, 0xbf10, 0, {0x95,0x00,0x2d,0x42,0x0b,0x58,0x02,0xc0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbf20, 0, {0x20,0x14,0xcc,0x00,0xb3,0x00,0x2a,0xe0,0x0b,0x30,0x02,0x4c,0x20,0xa1,0x01,0x24 },
+  16, 0xbf30, 0, {0xc1,0x08,0x00,0x02,0x8c,0x00,0x81,0x00,0x24,0x80,0x09,0x38,0x0a,0x60,0x80,0x92 },
+  16, 0xbf40, 0, {0x40,0x2a,0x00,0x0a,0x30,0x02,0xc0,0x00,0x80,0xc8,0x2c,0x72,0x0b,0x14,0x02,0xc8 },
+  16, 0xbf50, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xbc,0x00,0xff,0x00,0x2f,0xf4 },
+  16, 0xbf60, 0, {0x8f,0xf0,0x03,0x3c,0x00,0xb9,0x00,0x3e,0x40,0x09,0x90,0x03,0xfc,0x02,0xc3,0x01 },
+  16, 0xbf70, 0, {0x32,0xc0,0x48,0xb8,0x13,0xa1,0x00,0xba,0x00,0x2a,0x00,0x0a,0xa0,0x07,0xec,0x00 },
+  16, 0xbf80, 0, {0xdb,0xc8,0x3e,0x90,0x0f,0xa2,0x02,0xea,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbf90, 0, {0x80,0x00,0xec,0x00,0xfb,0x02,0x3e,0xc4,0x0f,0xb0,0x63,0xec,0x01,0xf8,0x40,0x3e },
+  16, 0xbfa0, 0, {0x40,0x0b,0x80,0x03,0xcc,0x00,0xfa,0x42,0x3e,0xc0,0x0f,0xb5,0x00,0xac,0x58,0xe9 },
+  16, 0xbfb0, 0, {0x82,0x3e,0xc0,0x1d,0x90,0x03,0xec,0x04,0xfa,0x00,0x3e,0x80,0x0f,0xa0,0x03,0xe0 },
+  16, 0xbfc0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x0c,0xdf,0x00,0x7f,0xc0 },
+  16, 0xbfd0, 0, {0x2c,0xf0,0x03,0x7c,0x01,0xc7,0x00,0x33,0x40,0x8f,0xd0,0x03,0xfc,0x00,0xd8,0x00 },
+  16, 0xbfe0, 0, {0x15,0x44,0x0c,0xe0,0x1b,0x3c,0x00,0xcb,0x0e,0x33,0xc0,0x5c,0x62,0x02,0x1c,0x02 },
+  16, 0xbff0, 0, {0xc5,0x00,0x2b,0x80,0x0f,0xc0,0x87,0x80,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc000, 0, {0x81,0x44,0x6c,0x10,0xbb,0x00,0x2e,0xc0,0x08,0xb0,0x52,0x0c,0x01,0xfa,0xc4,0x22 },
+  16, 0xc010, 0, {0x61,0x0b,0x88,0x03,0x6c,0x00,0x88,0x47,0x2a,0x00,0x0e,0x1c,0x02,0x20,0x02,0x88 },
+  16, 0xc020, 0, {0x00,0xaa,0x00,0x28,0x90,0x0a,0x2c,0x04,0xa8,0x00,0x22,0x90,0x0b,0x80,0x02,0xe0 },
+  16, 0xc030, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x2c,0x00,0xbb,0x00,0x2e,0xc1 },
+  16, 0xc040, 0, {0x08,0x30,0x12,0x6c,0x00,0x88,0x88,0x2a,0x30,0x0b,0xb8,0x02,0xec,0x00,0x9b,0x08 },
+  16, 0xc050, 0, {0x2a,0x40,0x08,0xb8,0x02,0x20,0x00,0x82,0x10,0x22,0x00,0x08,0xa0,0x22,0xa0,0x00 },
+  16, 0xc060, 0, {0x8b,0x00,0x2a,0x02,0x0b,0xb0,0x02,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc070, 0, {0x08,0x00,0x0c,0x00,0xb3,0x20,0x2c,0xc2,0x08,0x36,0x02,0x2c,0xc0,0xa0,0x08,0x20 },
+  16, 0xc080, 0, {0x00,0x0b,0x33,0x46,0xcd,0x28,0x80,0x20,0x28,0xc0,0x0b,0x32,0x02,0x0c,0x20,0x81 },
+  16, 0xc090, 0, {0x30,0x28,0xc0,0x08,0x10,0x02,0x81,0x00,0xaa,0x00,0x28,0x00,0x03,0x30,0x02,0xc2 },
+  16, 0xc0a0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x7c,0x00,0xfb,0x28,0x2e,0xcc },
+  16, 0xc0b0, 0, {0x0c,0x70,0x53,0x7d,0x09,0x88,0x00,0xba,0x00,0x0f,0x80,0x03,0xfd,0x80,0xda,0x60 },
+  16, 0xc0c0, 0, {0x3a,0x50,0x8c,0xa2,0x83,0x2c,0x80,0x4b,0x20,0x30,0xc0,0x28,0xa0,0x03,0xa1,0x00 },
+  16, 0xc0d0, 0, {0xc9,0x00,0x3a,0x00,0x0f,0x90,0x03,0xc0,0x03,0x10,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc0e0, 0, {0xa0,0x1d,0xfc,0x04,0xfb,0x00,0x7e,0xc9,0x0b,0xb6,0x03,0xfc,0xc0,0xf8,0x0c,0x3f },
+  16, 0xc0f0, 0, {0x00,0x4f,0xc3,0x43,0x2c,0x00,0xb8,0x38,0x3f,0x8e,0x5e,0xf0,0x43,0xe0,0x10,0xf8 },
+  16, 0xc100, 0, {0x30,0x3f,0x01,0x0f,0xd0,0x03,0x70,0x00,0xfc,0x00,0x37,0x00,0x0d,0xd0,0x07,0xe9 },
+  16, 0xc110, 0, {0x03,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfc,0xe0,0xcc,0x80,0x33,0xc0 },
+  16, 0xc120, 0, {0x0d,0xf0,0x83,0xfc,0x80,0xdc,0x94,0x33,0xc0,0x1c,0xf1,0x03,0x7d,0x8c,0xff,0x30 },
+  16, 0xc130, 0, {0x3f,0x30,0x8f,0xc8,0x03,0x7e,0x10,0xcf,0x90,0x39,0xa0,0x8d,0xf8,0x03,0xae,0x00 },
+  16, 0xc140, 0, {0xd5,0x80,0x13,0xe0,0x0c,0x58,0x03,0xf0,0x01,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc150, 0, {0x80,0x10,0xdd,0x08,0x88,0x00,0x23,0xc4,0x08,0xfc,0x02,0xec,0xa8,0xcb,0x20,0x21 },
+  16, 0xc160, 0, {0xc2,0x0d,0xf7,0x12,0x1c,0x40,0xdf,0x30,0x22,0xa0,0x0b,0x88,0x02,0x2e,0x04,0xdb },
+  16, 0xc170, 0, {0x21,0x22,0xc0,0x08,0xb8,0x22,0x2e,0x00,0xb9,0x80,0x2a,0x60,0x0a,0x88,0x02,0xe0 },
+  16, 0xc180, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x45,0xcc,0x10,0x80,0x2c,0x28,0xca },
+  16, 0xc190, 0, {0x68,0x30,0x02,0x8d,0x00,0x9b,0x20,0x28,0xc4,0x08,0x32,0x02,0xcc,0x10,0xb3,0x00 },
+  16, 0xc1a0, 0, {0x24,0x08,0x0b,0x80,0x42,0x6c,0x00,0x83,0x00,0x2a,0xca,0x3a,0xb0,0x02,0x8c,0x04 },
+  16, 0xc1b0, 0, {0xb0,0x04,0x28,0xc0,0x08,0x10,0x02,0xe3,0x01,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc1c0, 0, {0xc0,0x15,0x8c,0x02,0x80,0x40,0xaa,0xc0,0x08,0xb0,0x02,0xec,0x00,0x9b,0x20,0x2a },
+  16, 0xc1d0, 0, {0xc0,0x88,0xb0,0x02,0xac,0x00,0x9b,0x00,0x26,0xe0,0x03,0x80,0x82,0x2c,0x28,0x9b },
+  16, 0xc1e0, 0, {0x20,0x22,0xe1,0x0b,0xb2,0x02,0xac,0x80,0xb8,0x80,0x2a,0xc1,0x0a,0x98,0x02,0xf0 },
+  16, 0xc1f0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xec,0x00,0xc8,0x50,0x3a,0xc0 },
+  16, 0xc200, 0, {0x0d,0xb0,0x03,0xec,0x00,0xdb,0x88,0xba,0xc0,0x08,0xb0,0x03,0x6c,0x08,0xfb,0x00 },
+  16, 0xc210, 0, {0x36,0x60,0x0f,0x8c,0x63,0x6c,0x00,0xcb,0xc0,0x3a,0x80,0x0e,0xbe,0x03,0xaf,0x84 },
+  16, 0xc220, 0, {0x79,0x80,0x3a,0x88,0x04,0x98,0x01,0xd0,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc230, 0, {0xe0,0x01,0xbc,0x00,0xfc,0x80,0x35,0xc0,0x4f,0xf0,0x03,0xdc,0x00,0xef,0x00,0x37 },
+  16, 0xc240, 0, {0xc0,0xaf,0xf0,0x03,0x1c,0x01,0x6f,0x00,0x13,0x00,0x0f,0xc1,0x23,0xfc,0xb8,0xff },
+  16, 0xc250, 0, {0x04,0x37,0xc0,0x0c,0xf8,0x43,0x7e,0x04,0xfd,0x00,0x3f,0x04,0x0f,0xd0,0x03,0xf8 },
+  16, 0xc260, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xc8,0x40,0x3a,0xc0 },
+  16, 0xc270, 0, {0x0c,0xb0,0x03,0xec,0x00,0xfb,0x40,0x38,0xc1,0x0e,0xb0,0x43,0x2c,0x08,0xc3,0x00 },
+  16, 0xc280, 0, {0x3e,0x40,0x0e,0x82,0x03,0x6d,0x00,0xdb,0x40,0x32,0xc1,0x5f,0xb4,0xa3,0xed,0x20 },
+  16, 0xc290, 0, {0xc9,0x40,0x32,0xe0,0x8f,0x98,0x43,0x90,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc2a0, 0, {0xc8,0x05,0x3c,0x00,0x88,0x00,0x23,0xc0,0x28,0xf5,0xc2,0xfc,0x00,0xb3,0x04,0x23 },
+  16, 0xc2b0, 0, {0xc1,0x48,0xf0,0x22,0xbc,0x06,0xaf,0x00,0x0e,0x40,0x08,0x00,0x02,0xcd,0x00,0xbb },
+  16, 0xc2c0, 0, {0x01,0x20,0xc0,0x08,0x30,0x02,0xee,0x00,0x81,0xe0,0x34,0xa0,0x0b,0x90,0x02,0x32 },
+  16, 0xc2d0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x02,0x80,0x00,0x28,0xc0 },
+  16, 0xc2e0, 0, {0x09,0x3c,0x02,0x4c,0x00,0xb3,0x00,0x2c,0xc0,0x0a,0xb0,0x02,0x0c,0x00,0x83,0x01 },
+  16, 0xc2f0, 0, {0x2c,0x00,0x0a,0x05,0x02,0xcd,0x58,0xbb,0x00,0x20,0x00,0x0a,0x3d,0x02,0xcf,0x40 },
+  16, 0xc300, 0, {0x21,0x20,0x60,0xc0,0x09,0x10,0x02,0xf8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc310, 0, {0x20,0x01,0x1e,0x00,0x84,0x80,0x28,0xe4,0x88,0x78,0x42,0xde,0x00,0xb7,0x90,0x65 },
+  16, 0xc320, 0, {0xe4,0x88,0x7a,0x42,0x9e,0x40,0xa7,0x90,0x2d,0xa0,0x0a,0x48,0x22,0xde,0x04,0xb7 },
+  16, 0xc330, 0, {0x80,0x23,0x60,0x48,0x78,0x42,0xfe,0x80,0xaf,0x90,0x65,0xe0,0x0b,0xe8,0x02,0xc8 },
+  16, 0xc340, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0xc8,0x00,0x38,0xc0 },
+  16, 0xc350, 0, {0x0c,0x30,0x03,0xcc,0x00,0xfb,0x00,0x3c,0xc0,0x0e,0xba,0x03,0x0c,0x00,0xc3,0x00 },
+  16, 0xc360, 0, {0x3e,0x00,0x4e,0x22,0x02,0xcc,0xc0,0xfb,0x40,0x30,0xc0,0x0a,0x30,0x03,0xce,0x80 },
+  16, 0xc370, 0, {0xe1,0x41,0x30,0xc9,0x0f,0x30,0x03,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc380, 0, {0x40,0x1d,0xbc,0x20,0xfc,0x00,0x37,0xc2,0x0e,0xf1,0x23,0xec,0x40,0xff,0x04,0x3a },
+  16, 0xc390, 0, {0xc0,0x0f,0xb0,0x23,0xfc,0x00,0xff,0x04,0x3e,0xc0,0x0d,0xa0,0x03,0xfc,0x58,0xff },
+  16, 0xc3a0, 0, {0x00,0xbf,0xc0,0x06,0xf0,0x83,0xdc,0x62,0xdf,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0x10 },
+  16, 0xc3b0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xed,0x80,0xc9,0x01,0x3e,0xc0 },
+  16, 0xc3c0, 0, {0x8c,0xb2,0x07,0xae,0x04,0xcb,0x80,0x3a,0xc8,0x4c,0xb2,0x03,0x2c,0x84,0xcb,0x30 },
+  16, 0xc3d0, 0, {0xb0,0xe0,0x0d,0x88,0x0b,0x2c,0x00,0xeb,0x00,0x30,0x00,0x0c,0xbc,0x83,0x2d,0x80 },
+  16, 0xc3e0, 0, {0xfb,0x00,0x32,0xc0,0x0c,0x90,0x03,0xea,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc3f0, 0, {0x48,0x11,0x9c,0x40,0x87,0x00,0x2c,0xcc,0x08,0x76,0x82,0x3c,0x82,0x87,0x00,0x21 },
+  16, 0xc400, 0, {0xc2,0x8d,0x32,0x82,0x0d,0x4c,0xa7,0x28,0x21,0x80,0x08,0x40,0x02,0x1d,0x80,0xbf },
+  16, 0xc410, 0, {0x20,0x35,0x40,0x09,0x72,0x43,0x5c,0xa0,0xb7,0x00,0x29,0xc0,0x08,0x70,0x02,0xd2 },
+  16, 0xc420, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x8e,0x00,0x84,0x80,0x2d,0xe0 },
+  16, 0xc430, 0, {0x08,0x78,0x02,0xde,0xc0,0x8f,0x80,0x28,0xec,0x28,0x7b,0x0a,0x9e,0x94,0x83,0x84 },
+  16, 0xc440, 0, {0x23,0xe0,0x09,0x58,0x50,0x9e,0x10,0xa7,0xb0,0x23,0xe0,0x0b,0x78,0x02,0x1e,0x20 },
+  16, 0xc450, 0, {0xb7,0x80,0x21,0xe0,0x09,0x78,0x02,0xf0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc460, 0, {0x48,0x14,0xcc,0x02,0x82,0x1c,0x2c,0xc0,0x28,0x30,0x02,0x4c,0x00,0x83,0xc0,0x20 },
+  16, 0xc470, 0, {0xc0,0x08,0x30,0x02,0x0c,0x00,0xa3,0x00,0x60,0xd2,0x08,0x1d,0x02,0x0f,0x20,0xbb },
+  16, 0xc480, 0, {0x24,0x24,0xc0,0x0b,0x3c,0x02,0x4f,0x00,0xb3,0x80,0x28,0xd8,0x09,0x32,0x02,0xd2 },
+  16, 0xc490, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x11,0xa8,0x00,0xce,0x84,0x3e,0x80 },
+  16, 0xc4a0, 0, {0x0c,0xa0,0x03,0xe8,0x00,0xce,0xc0,0x3a,0x80,0x08,0xa0,0x03,0xa8,0x00,0xca,0x00 },
+  16, 0xc4b0, 0, {0x33,0x80,0x0d,0xec,0x03,0x3b,0x80,0xee,0x82,0x33,0x80,0x0a,0xc0,0x87,0x10,0x40 },
+  16, 0xc4c0, 0, {0xf6,0xc0,0x33,0x90,0xad,0x64,0x03,0xfa,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc4d0, 0, {0x48,0x00,0xc0,0x02,0xf8,0x00,0x3c,0x00,0x1f,0x04,0x03,0xa0,0x04,0xf8,0x30,0x3e },
+  16, 0xc4e0, 0, {0x00,0x0f,0x80,0x03,0xe0,0x00,0xf8,0x00,0x3e,0x04,0x0f,0x80,0x93,0xe0,0x00,0xf8 },
+  16, 0xc4f0, 0, {0x10,0x3e,0x00,0x2c,0x84,0x03,0xe0,0x00,0xf8,0x18,0x3e,0x10,0x0e,0x80,0x03,0xd2 },
+  16, 0xc500, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xd9,0x00,0x3e,0x40 },
+  16, 0xc510, 0, {0x0e,0x90,0x03,0xa4,0x10,0xf9,0x00,0x3e,0x40,0x04,0x90,0x03,0x24,0x00,0x41,0x00 },
+  16, 0xc520, 0, {0x3e,0x40,0x0f,0x91,0x13,0xe1,0x08,0xf8,0x00,0x32,0x40,0x08,0x89,0x83,0xa2,0x00 },
+  16, 0xc530, 0, {0xc9,0x80,0x32,0x40,0x0c,0x90,0x0b,0x02,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc540, 0, {0x80,0x04,0x64,0x02,0x89,0x00,0x2e,0x40,0x0d,0x90,0x02,0x24,0x00,0xb9,0x00,0x2e },
+  16, 0xc550, 0, {0x40,0x48,0x90,0x02,0xa4,0x00,0x89,0x00,0x22,0x40,0x8b,0x94,0x42,0xe2,0x20,0xb8 },
+  16, 0xc560, 0, {0x00,0xa2,0x40,0x08,0x94,0x02,0xe5,0x04,0xa9,0x90,0x34,0x60,0x08,0x90,0x02,0x20 },
+  16, 0xc570, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x10,0x99,0x00,0x2e,0x40 },
+  16, 0xc580, 0, {0x0a,0x90,0x02,0xe4,0x00,0xb9,0x00,0x24,0x40,0x0a,0x10,0x02,0x04,0x00,0xa9,0x00 },
+  16, 0xc590, 0, {0x2a,0x40,0x0b,0x90,0x82,0xe0,0x01,0xb8,0x00,0x20,0x40,0x3a,0x90,0x02,0xa4,0x44 },
+  16, 0xc5a0, 0, {0x89,0x04,0x22,0x62,0x08,0x98,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc5b0, 0, {0x08,0x04,0x04,0x8a,0x81,0x00,0x2c,0x48,0x09,0x32,0x06,0x44,0x80,0xb1,0x00,0x2c },
+  16, 0xc5c0, 0, {0x48,0x0a,0x12,0x02,0x84,0x80,0xa1,0x20,0x20,0x50,0x0b,0x14,0x02,0xc5,0x00,0xb1 },
+  16, 0xc5d0, 0, {0x40,0x20,0x50,0x0a,0x24,0x02,0xc9,0x00,0xa3,0x00,0x24,0x40,0x08,0x11,0x02,0x02 },
+  16, 0xc5e0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x61,0x40,0xd8,0x50,0x3e,0x14 },
+  16, 0xc5f0, 0, {0x0e,0x80,0x03,0xe1,0x40,0xf8,0x51,0x36,0x14,0x2e,0x85,0x43,0x21,0x42,0xe8,0x50 },
+  16, 0xc600, 0, {0x3a,0x00,0x0f,0x80,0x12,0xe0,0x00,0xf8,0x00,0x32,0x00,0x1e,0x80,0x43,0xa0,0x00 },
+  16, 0xc610, 0, {0xc8,0x01,0x32,0x00,0x0c,0x80,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc620, 0, {0x98,0x1d,0xe4,0x40,0xfd,0x00,0x3e,0x44,0x4e,0x11,0x03,0xa4,0x40,0xb5,0x00,0x3e },
+  16, 0xc630, 0, {0x44,0x0d,0x91,0x03,0xe4,0x40,0xd9,0x10,0x3f,0x40,0x0f,0x50,0x03,0xe5,0x00,0xf9 },
+  16, 0xc640, 0, {0x40,0x3f,0x40,0x0d,0x44,0x03,0xf1,0x00,0xf5,0x02,0x3d,0xc0,0x2f,0xd2,0x03,0xe6 },
+  16, 0xc650, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xe7,0x00,0xe9,0x00,0x36,0x60 },
+  16, 0xc660, 0, {0x0d,0xda,0x03,0xe6,0x40,0xf9,0x40,0x3e,0x68,0x0c,0x9a,0x03,0x66,0x20,0x89,0xa0 },
+  16, 0xc670, 0, {0x33,0x40,0x0e,0x90,0x07,0xa6,0x00,0xf9,0x80,0x3e,0x50,0x0c,0xca,0x03,0xf3,0x80 },
+  16, 0xc680, 0, {0xc5,0x02,0x33,0x40,0x0c,0xc0,0x03,0xc6,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc690, 0, {0x38,0x10,0xe3,0x04,0x88,0xa2,0x20,0x38,0x08,0x80,0x02,0xe3,0x40,0xb0,0x80,0x2e },
+  16, 0xc6a0, 0, {0x28,0x08,0x8a,0x82,0x23,0x80,0x88,0x80,0x22,0x00,0xdb,0x88,0x02,0x62,0x04,0xb8 },
+  16, 0xc6b0, 0, {0xb0,0x2e,0xa8,0x88,0x8e,0xa2,0xea,0x80,0x88,0x00,0x2a,0x00,0x28,0x88,0x03,0x8e },
+  16, 0xc6c0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc5,0x82,0xa9,0x08,0x2c,0x52 },
+  16, 0xc6d0, 0, {0x0b,0x14,0x02,0xc4,0x80,0xb1,0x21,0x0c,0x52,0x88,0x14,0x02,0x44,0x20,0x91,0x69 },
+  16, 0xc6e0, 0, {0x20,0x40,0x0a,0x10,0x82,0xc6,0xe0,0xb1,0x0c,0x2c,0x48,0x08,0x01,0x02,0xe1,0x93 },
+  16, 0xc6f0, 0, {0xa1,0x01,0x24,0x41,0x0a,0x10,0x02,0xc2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc700, 0, {0x18,0x15,0xa4,0x00,0x89,0x04,0x22,0x40,0x08,0x90,0x00,0xe4,0x00,0x39,0x02,0x0e },
+  16, 0xc710, 0, {0x40,0x08,0x10,0x62,0x24,0x00,0x91,0x00,0x62,0x40,0x8b,0x80,0x02,0xe0,0x54,0xb9 },
+  16, 0xc720, 0, {0x0c,0x2e,0x40,0x09,0xb6,0x52,0xec,0x00,0xa9,0x00,0x2a,0x40,0x0a,0x92,0x80,0x86 },
+  16, 0xc730, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x11,0xe4,0x00,0xe1,0x60,0x36,0x40 },
+  16, 0xc740, 0, {0x0d,0x90,0x23,0xe4,0x00,0xf9,0x30,0x3e,0x40,0x2c,0x90,0x43,0x64,0x06,0xc9,0x00 },
+  16, 0xc750, 0, {0x32,0x49,0x0e,0x8d,0x93,0xe0,0x00,0xf9,0x00,0x2e,0x40,0x2c,0x94,0x03,0xc7,0x40 },
+  16, 0xc760, 0, {0xe9,0x20,0x30,0x55,0x0e,0x90,0x03,0xe8,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc770, 0, {0x28,0x01,0xa4,0x00,0xf9,0x00,0x1e,0x40,0x0f,0x90,0x03,0xe4,0x00,0xf9,0x80,0x3c },
+  16, 0xc780, 0, {0x40,0x4f,0x90,0x03,0xe4,0x00,0xe9,0x04,0xbe,0x40,0x0f,0x88,0x33,0x62,0x00,0xf9 },
+  16, 0xc790, 0, {0xc2,0x3e,0x48,0x2e,0x88,0x33,0xe2,0x00,0xd9,0x00,0x3e,0x60,0x0d,0x80,0x03,0xca },
+  16, 0xc7a0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xc8,0x00,0x3e,0x00 },
+  16, 0xc7b0, 0, {0x0d,0x80,0x03,0xa0,0x04,0xe8,0x40,0xba,0x00,0x0c,0x80,0x03,0xe0,0x04,0xc8,0x00 },
+  16, 0xc7c0, 0, {0x3a,0x00,0x0e,0x8c,0x03,0xe0,0x00,0xf8,0x02,0x32,0x00,0x0e,0x80,0x03,0x61,0x20 },
+  16, 0xc7d0, 0, {0xf8,0x00,0x32,0x16,0x0f,0x80,0x03,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc7e0, 0, {0x28,0x05,0x28,0x00,0x8a,0x00,0x2e,0x80,0x08,0xe2,0x03,0x28,0x00,0x8a,0x00,0x22 },
+  16, 0xc7f0, 0, {0x80,0x08,0xa0,0x02,0xe8,0x04,0x8a,0x00,0x2e,0xa2,0x09,0xe8,0x02,0xfa,0x04,0xbe },
+  16, 0xc800, 0, {0x00,0xa2,0x80,0x08,0xcd,0x82,0x33,0x20,0xb6,0xc0,0x37,0xa0,0x4b,0xc8,0x82,0xca },
+  16, 0xc810, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x6c,0x00,0x83,0x00,0x26,0xc0 },
+  16, 0xc820, 0, {0x09,0x38,0x02,0x4c,0x00,0xb3,0x00,0x24,0xc0,0x08,0x30,0x02,0xec,0x00,0x83,0x00 },
+  16, 0xc830, 0, {0x28,0xe0,0x0b,0x30,0x02,0xce,0x81,0xb3,0x00,0x62,0xc0,0x08,0x3c,0x02,0x4f,0x00 },
+  16, 0xc840, 0, {0xb3,0xa0,0x20,0xb0,0x03,0x30,0x02,0xca,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc850, 0, {0xa0,0x01,0x0c,0x41,0x87,0x34,0x2d,0xc0,0x08,0x60,0x02,0x9e,0x40,0xb7,0xa0,0x2d },
+  16, 0xc860, 0, {0xc0,0x08,0x73,0x02,0xdc,0x00,0x87,0x20,0x2d,0xc0,0x0b,0x70,0x82,0xdd,0x85,0xbf },
+  16, 0xc870, 0, {0x81,0x63,0xc8,0x88,0x7b,0x02,0x1c,0x00,0xb7,0x40,0x65,0x00,0x1b,0x72,0x02,0xe8 },
+  16, 0xc880, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0x00,0xc7,0x81,0x3d,0xe0 },
+  16, 0xc890, 0, {0xdd,0x70,0x03,0xfe,0x80,0xf7,0x90,0x3f,0xe0,0x2c,0x79,0x03,0xfe,0x80,0xc7,0xa0 },
+  16, 0xc8a0, 0, {0x39,0xe0,0x0f,0x7a,0x02,0xde,0x84,0xf7,0xc2,0x31,0xf2,0x0c,0x79,0x03,0x5e,0x04 },
+  16, 0xc8b0, 0, {0xf7,0x84,0x31,0x60,0x0f,0x7e,0x03,0xea,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc8c0, 0, {0x08,0x1d,0xad,0x0a,0xfb,0x60,0x7e,0xd4,0x0f,0x30,0x03,0x6c,0x00,0xcb,0x00,0x32 },
+  16, 0xc8d0, 0, {0xde,0x2f,0xb2,0x03,0xed,0x42,0x1b,0x60,0x3e,0xc1,0x0d,0xb1,0x03,0xec,0x50,0xf7 },
+  16, 0xc8e0, 0, {0x80,0x3d,0xd8,0x2e,0x32,0x03,0xec,0x30,0xfb,0x00,0x3e,0x40,0x0f,0xb0,0x03,0xc2 },
+  16, 0xc8f0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xff,0x00,0xcb,0xd0,0x3f,0xf0 },
+  16, 0xc900, 0, {0x4c,0xf8,0x13,0xfe,0x00,0xcf,0x88,0x3f,0xe0,0x0c,0xf8,0x43,0x3f,0x00,0xcf,0xc8 },
+  16, 0xc910, 0, {0x33,0xe0,0x0c,0xf8,0x03,0xfe,0x00,0xff,0x80,0x3f,0xe0,0x2c,0xf8,0x03,0xbe,0x20 },
+  16, 0xc920, 0, {0xc7,0x80,0x33,0xe0,0x0c,0xf8,0x01,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc930, 0, {0xa8,0x01,0xbc,0x40,0x87,0x90,0x3d,0xc0,0x08,0x40,0x02,0xdc,0x80,0xd7,0x00,0x2d },
+  16, 0xc940, 0, {0xc0,0x0c,0x30,0x03,0x7c,0x00,0x87,0x10,0x21,0xc4,0x1e,0x70,0x20,0xdc,0x44,0xb7 },
+  16, 0xc950, 0, {0x00,0x39,0xc0,0x0c,0x71,0x02,0x1c,0x40,0xd7,0x02,0x29,0x40,0x08,0x70,0x02,0x2a },
+  16, 0xc960, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x00,0x87,0x32,0x2d,0xc0 },
+  16, 0xc970, 0, {0x08,0x70,0x02,0xdc,0x01,0x87,0x00,0x2c,0xc0,0x2b,0x70,0x0a,0x5c,0x00,0x83,0x00 },
+  16, 0xc980, 0, {0x23,0xc0,0x08,0x70,0x02,0xdd,0x00,0xb7,0x00,0x2d,0xc4,0x0b,0xf0,0x02,0x9c,0x20 },
+  16, 0xc990, 0, {0x87,0x18,0x29,0x40,0x08,0x70,0x82,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc9a0, 0, {0x20,0x14,0xcc,0x00,0x83,0x02,0x28,0xc0,0x08,0x10,0x02,0xcc,0x08,0x83,0x40,0x2e },
+  16, 0xc9b0, 0, {0xc0,0x2a,0x30,0x02,0x0c,0x00,0x8b,0x00,0x20,0xf2,0x0a,0x30,0x02,0xce,0x00,0xb3 },
+  16, 0xc9c0, 0, {0x88,0x2a,0xd0,0x0a,0x30,0x06,0x0c,0x00,0x92,0x00,0x28,0x78,0x08,0x3c,0x42,0x08 },
+  16, 0xc9d0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xbc,0x02,0xc7,0x00,0x2f,0xc0 },
+  16, 0xc9e0, 0, {0x2c,0x90,0x02,0xfc,0x02,0x8f,0xd8,0x3f,0xc0,0x4b,0xf0,0x02,0x7c,0x02,0xcf,0x00 },
+  16, 0xc9f0, 0, {0x20,0xf2,0x08,0xb0,0x13,0xee,0x80,0xff,0x00,0x3f,0xd4,0x2e,0xbd,0x83,0xac,0x00 },
+  16, 0xca00, 0, {0xcb,0x80,0x3a,0xa0,0xac,0xb8,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xca10, 0, {0x80,0x00,0xec,0x00,0xfb,0x10,0x3e,0xc0,0x0f,0x84,0x03,0xec,0x10,0xfb,0x00,0x3e },
+  16, 0xca20, 0, {0xc0,0x01,0xb0,0x03,0xec,0x00,0xfb,0x00,0xbe,0xc0,0x0e,0xb0,0x23,0xec,0x08,0xfb },
+  16, 0xca30, 0, {0x10,0x3f,0xc0,0x0d,0xb4,0x03,0xed,0x04,0xf9,0x00,0x1e,0x14,0xcf,0xb0,0x83,0xe0 },
+  16, 0xca40, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x00,0xcf,0x00,0x30,0xc0 },
+  16, 0xca50, 0, {0x0c,0x40,0x03,0xac,0x00,0xff,0x00,0x3f,0xc0,0x2c,0xb0,0x03,0xbc,0x00,0xff,0x00 },
+  16, 0xca60, 0, {0xb3,0xe0,0x0d,0xfa,0x03,0x7e,0x80,0xcf,0x00,0x33,0xc0,0x0c,0xfc,0x43,0xff,0x20 },
+  16, 0xca70, 0, {0xff,0x00,0x3f,0x40,0x08,0xf8,0x03,0xc0,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xca80, 0, {0x81,0x04,0x6c,0x10,0xab,0x00,0x2a,0xc0,0x0a,0x8e,0x42,0x2c,0x04,0xbb,0x00,0x2e },
+  16, 0xca90, 0, {0xc0,0x08,0xb0,0x02,0x6c,0x00,0xbb,0x00,0x3a,0xc0,0x0e,0x30,0x02,0x0d,0x08,0x83 },
+  16, 0xcaa0, 0, {0x02,0x22,0xc0,0x0a,0xbc,0x02,0xef,0x00,0xbb,0xc0,0x2c,0x68,0x0a,0xb9,0x02,0xe0 },
+  16, 0xcab0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x0c,0x00,0x8b,0x00,0x22,0xc0 },
+  16, 0xcac0, 0, {0x08,0xb8,0x02,0xac,0x00,0xbb,0x02,0x2e,0xc0,0x08,0xb0,0x02,0xec,0x00,0xbb,0x00 },
+  16, 0xcad0, 0, {0x26,0x48,0x19,0xb0,0x02,0x6d,0x00,0x8b,0x00,0x22,0xc0,0x0a,0xb0,0x02,0xec,0x04 },
+  16, 0xcae0, 0, {0xbb,0x1c,0x2e,0x20,0x0a,0xb0,0x02,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcaf0, 0, {0x08,0x14,0x0c,0x00,0xab,0x20,0x28,0xc0,0x0a,0x00,0x02,0x0c,0x00,0x93,0x04,0x2c },
+  16, 0xcb00, 0, {0xc1,0x08,0x30,0x02,0x4c,0x00,0xb3,0x00,0x24,0x41,0x09,0xb8,0x02,0x0c,0x02,0x83 },
+  16, 0xcb10, 0, {0x01,0xa0,0xc0,0x0a,0x30,0x02,0xcc,0x10,0x93,0x00,0x2c,0x00,0x0a,0x30,0x02,0xc2 },
+  16, 0xcb20, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x7c,0x00,0xcf,0x28,0x33,0xc0 },
+  16, 0xcb30, 0, {0x0c,0xa0,0x46,0xac,0x11,0xbf,0x00,0x3f,0xc0,0x5c,0xf0,0x43,0xfc,0x00,0xff,0x04 },
+  16, 0xcb40, 0, {0x32,0x40,0x0d,0xb0,0x03,0x6c,0x08,0xcb,0x04,0x31,0xc0,0x0c,0xb0,0x33,0xed,0x40 },
+  16, 0xcb50, 0, {0xfb,0x04,0x3e,0x40,0x0e,0xb0,0x03,0xc0,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcb60, 0, {0xa0,0x15,0xfc,0x00,0xff,0x00,0x3f,0xc0,0x0f,0xc0,0x23,0xfc,0x01,0xff,0x00,0x3f },
+  16, 0xcb70, 0, {0xc0,0x4f,0xf0,0x87,0x7c,0x00,0xff,0x00,0x39,0x40,0x0e,0xf0,0x03,0xfc,0x00,0xff },
+  16, 0xcb80, 0, {0x00,0x3f,0xc0,0x0f,0x70,0x03,0xdc,0x80,0xff,0x00,0x3d,0x40,0x0f,0x70,0x03,0xe8 },
+  16, 0xcb90, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfc,0x40,0xeb,0x48,0x3e,0xc2 },
+  16, 0xcba0, 0, {0x0e,0x09,0x03,0xbc,0x60,0xc0,0x20,0x35,0x24,0x0e,0xd2,0x13,0x2c,0x60,0xfb,0x6a },
+  16, 0xcbb0, 0, {0x33,0xc0,0x0f,0xca,0x03,0x22,0x20,0xc0,0x80,0x37,0xc0,0x0d,0xf0,0x03,0x7c,0x00 },
+  16, 0xcbc0, 0, {0xef,0x00,0x33,0x24,0x0f,0xc8,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcbd0, 0, {0x80,0x10,0xdd,0x00,0x8f,0x60,0x2f,0xd8,0x08,0xa2,0x02,0xfd,0x80,0xc8,0x70,0x22 },
+  16, 0xcbe0, 0, {0x00,0x2c,0xfd,0x07,0xdc,0x84,0xbf,0x60,0x23,0xd2,0x0b,0xbd,0x02,0x23,0x00,0x88 },
+  16, 0xcbf0, 0, {0x80,0xa2,0x20,0x88,0xb0,0x22,0x34,0x00,0xbb,0x50,0x22,0xc8,0x0b,0xb0,0x02,0x20 },
+  16, 0xcc00, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x40,0xa3,0x03,0x2c,0xc2 },
+  16, 0xcc10, 0, {0x0a,0x00,0x42,0x8c,0x82,0xa3,0x0a,0x24,0x80,0x0b,0x30,0x02,0xcc,0x90,0xb3,0x00 },
+  16, 0xcc20, 0, {0x28,0xd8,0x0b,0x10,0x02,0x8c,0x02,0x90,0x00,0x20,0xc0,0x0b,0x10,0x42,0x4c,0x00 },
+  16, 0xcc30, 0, {0xb3,0x04,0x24,0xc0,0x0b,0x30,0x0e,0xa2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcc40, 0, {0xc0,0x15,0xac,0x10,0x9b,0x04,0x2c,0xc0,0xf8,0x98,0x06,0xec,0x00,0xab,0x80,0x26 },
+  16, 0xcc50, 0, {0x20,0x08,0x90,0x2a,0xac,0x10,0xbb,0x00,0x0a,0xc0,0x1b,0xb0,0x22,0xad,0x00,0x98 },
+  16, 0xcc60, 0, {0x40,0x2a,0x70,0x4b,0xb0,0x02,0x2c,0x00,0xb3,0x00,0xa6,0x86,0x1b,0xb0,0x82,0xb0 },
+  16, 0xcc70, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xec,0x00,0xeb,0x00,0x3e,0xc0 },
+  16, 0xcc80, 0, {0x8e,0x98,0x03,0xac,0x08,0xe8,0xc0,0x36,0x30,0x4f,0xb0,0x42,0xec,0x00,0xf9,0x80 },
+  16, 0xcc90, 0, {0x3a,0xc0,0x8f,0x88,0x42,0x20,0x10,0xc8,0x10,0x30,0xf0,0x0f,0x30,0x13,0x6c,0x10 },
+  16, 0xcca0, 0, {0xeb,0x00,0x36,0xf0,0x0f,0xbd,0x03,0x90,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xccb0, 0, {0xe0,0x01,0xbc,0x00,0xef,0x04,0x7f,0xc0,0x0f,0xf0,0x43,0xdc,0x00,0xc4,0x00,0x3b },
+  16, 0xccc0, 0, {0x40,0x8b,0xdc,0x03,0x7c,0x10,0xf9,0x90,0x36,0xc2,0x4f,0xf9,0x23,0x62,0x41,0xac },
+  16, 0xccd0, 0, {0x01,0x13,0x40,0x04,0xb0,0x03,0xe4,0x00,0xff,0x00,0x3b,0xc0,0x0f,0xc0,0x03,0x78 },
+  16, 0xcce0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0x8c,0x12,0xcb,0x00,0xf2,0xc0 },
+  16, 0xccf0, 0, {0x0f,0x80,0x03,0xac,0x08,0xd9,0x00,0x3a,0x80,0x0f,0x12,0x03,0xac,0x00,0xe1,0x00 },
+  16, 0xcd00, 0, {0x32,0xc0,0x0c,0x90,0x03,0xed,0x02,0xc8,0x40,0x3e,0xd0,0x0f,0x90,0x13,0x2c,0x02 },
+  16, 0xcd10, 0, {0xdb,0x00,0x3e,0x50,0x0c,0xb4,0x03,0x10,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcd20, 0, {0xc8,0x05,0x3c,0x00,0x8f,0x00,0x17,0xc0,0x08,0x90,0x02,0x3c,0x08,0x8d,0x00,0x22 },
+  16, 0xcd30, 0, {0x54,0x08,0xb4,0x03,0x3c,0x00,0x89,0x00,0x23,0xc0,0x40,0x35,0x02,0xcc,0x24,0x80 },
+  16, 0xcd40, 0, {0x00,0x22,0x74,0x4c,0xb0,0x02,0x2c,0x00,0x8f,0x00,0x2e,0xd4,0x0a,0xb0,0x0a,0x32 },
+  16, 0xcd50, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x01,0x4c,0x02,0x83,0x00,0x24,0xc0 },
+  16, 0xcd60, 0, {0x09,0x00,0x02,0x8c,0x01,0x90,0x00,0x6a,0x41,0x0a,0x30,0x20,0x4e,0x10,0x31,0x02 },
+  16, 0xcd70, 0, {0x2c,0xc0,0x09,0x20,0x06,0xce,0x00,0x80,0x00,0x60,0xe0,0x0a,0x30,0x82,0x0c,0x08 },
+  16, 0xcd80, 0, {0x83,0x08,0x2c,0xd0,0x09,0xb0,0x02,0x78,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcd90, 0, {0x20,0x01,0x1e,0x04,0x87,0xb0,0x20,0xec,0x09,0xe9,0x02,0x8e,0x58,0x9d,0xb0,0x2b },
+  16, 0xcda0, 0, {0xa5,0x40,0x5b,0x06,0xde,0x40,0x95,0x94,0x2d,0xe4,0x19,0x7b,0x06,0xde,0x00,0x84 },
+  16, 0xcdb0, 0, {0x80,0x60,0xe0,0x0a,0x78,0x0a,0x16,0x10,0x87,0x80,0x2d,0x68,0x0b,0x79,0x02,0x48 },
+  16, 0xcdc0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0xcb,0xa0,0x24,0xe0 },
+  16, 0xcdd0, 0, {0x0f,0x2a,0x03,0x8e,0x00,0xd2,0xd0,0x38,0xfa,0x0f,0x18,0xc3,0xce,0x24,0x31,0xb0 },
+  16, 0xcde0, 0, {0x3c,0xe5,0x0c,0x3b,0x17,0xce,0x04,0xc0,0x82,0x38,0xc2,0x9e,0x10,0x03,0x0c,0x00 },
+  16, 0xcdf0, 0, {0xc3,0x01,0x3e,0xc0,0x0d,0x81,0x03,0x52,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xce00, 0, {0x40,0x1d,0xbc,0x00,0xef,0x10,0x3e,0xc2,0x0e,0xb1,0x23,0x2c,0xc1,0xab,0x01,0x36 },
+  16, 0xce10, 0, {0x80,0x0f,0xb0,0x23,0x2d,0x90,0xe9,0x84,0x72,0xc8,0x62,0xf1,0x17,0xfc,0x00,0xfc },
+  16, 0xce20, 0, {0x00,0x3b,0xc4,0x1d,0xf0,0x03,0xec,0x00,0xef,0x08,0x3f,0xc8,0x0e,0xf1,0x03,0x90 },
+  16, 0xce30, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x80,0xfb,0xa4,0x3a,0xc8 },
+  16, 0xce40, 0, {0x0e,0x90,0x03,0x2c,0x04,0xca,0x00,0x30,0x60,0x2d,0x1a,0x27,0x6c,0x84,0xcb,0x60 },
+  16, 0xce50, 0, {0x32,0xd2,0x0c,0xa0,0x13,0x2d,0x84,0xcb,0x02,0x3e,0xc0,0x0d,0xb8,0x03,0xac,0x80 },
+  16, 0xce60, 0, {0xcb,0x81,0x32,0x80,0x0c,0xb0,0x03,0xaa,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xce70, 0, {0x48,0x11,0x9c,0xa4,0xb7,0x28,0x73,0xc2,0x08,0xf0,0x02,0x3c,0xc0,0x8f,0x00,0x31 },
+  16, 0xce80, 0, {0xc0,0x09,0x70,0x82,0x9c,0x80,0x87,0x0c,0x20,0xd8,0x09,0x70,0x22,0x1c,0x30,0x84 },
+  16, 0xce90, 0, {0x00,0x3d,0xc0,0x08,0x70,0x02,0x14,0x24,0x87,0xa0,0x21,0xc0,0x08,0x70,0x12,0x12 },
+  16, 0xcea0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x40,0xb3,0x95,0x29,0xe9 },
+  16, 0xceb0, 0, {0x0a,0x68,0x02,0x9e,0xd0,0x86,0xf0,0xa3,0xe0,0x08,0x78,0x12,0x9e,0x44,0xa3,0x82 },
+  16, 0xcec0, 0, {0x21,0xe8,0x0b,0x38,0x02,0x0e,0x10,0x87,0x80,0x2f,0xe0,0x0b,0x18,0x02,0x8e,0x02 },
+  16, 0xced0, 0, {0x87,0x00,0x21,0xe0,0x08,0x78,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcee0, 0, {0x48,0x14,0xcc,0x00,0xb3,0x00,0x24,0xc0,0x48,0x30,0x02,0x0c,0x04,0x83,0x80,0x20 },
+  16, 0xcef0, 0, {0xd0,0x09,0x10,0x02,0x8c,0x06,0xa3,0x80,0x20,0xc0,0x0b,0x30,0x02,0x0c,0x02,0x80 },
+  16, 0xcf00, 0, {0x40,0x28,0xd2,0x0a,0x30,0x02,0x0c,0x01,0x83,0x00,0x22,0x3c,0x08,0x87,0x02,0x12 },
+  16, 0xcf10, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x18,0xfa,0x00,0x3a,0x80 },
+  16, 0xcf20, 0, {0x8e,0xe4,0x42,0x28,0x02,0xce,0x80,0x33,0x80,0x4d,0xa0,0x83,0xe8,0x00,0xea,0xa0 },
+  16, 0xcf30, 0, {0xb2,0x80,0x0a,0xa0,0x0a,0x28,0x00,0xce,0x18,0x2f,0x80,0x0f,0xa0,0x13,0xa8,0x00 },
+  16, 0xcf40, 0, {0xca,0x00,0x32,0x90,0x2c,0xac,0x0b,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcf50, 0, {0x48,0x00,0xe0,0x00,0xf8,0x04,0x3a,0x00,0x0f,0x80,0x83,0xc0,0x08,0xe8,0x03,0x3a },
+  16, 0xcf60, 0, {0x00,0x0e,0x80,0x22,0xc0,0x00,0xd0,0x00,0x7e,0x10,0xa4,0x80,0x03,0xc0,0x00,0xf8 },
+  16, 0xcf70, 0, {0x00,0x3e,0x10,0x0d,0x84,0x03,0xc0,0x00,0xf8,0x00,0xbe,0x00,0x0f,0x80,0x01,0x52 },
+  16, 0xcf80, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xc4,0x02,0xc9,0x00,0x36,0x40 },
+  16, 0xcf90, 0, {0x0c,0x90,0x03,0x64,0x02,0x89,0x04,0x32,0x42,0x0d,0x92,0x03,0xe6,0x42,0xc9,0x00 },
+  16, 0xcfa0, 0, {0x32,0x70,0x0e,0x12,0x0b,0x24,0x08,0xc9,0x00,0x3e,0x45,0x0e,0x99,0x03,0xe4,0x02 },
+  16, 0xcfb0, 0, {0xc1,0x00,0x32,0x50,0x04,0x94,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcfc0, 0, {0x80,0x04,0x64,0x00,0x89,0x00,0x6e,0x40,0x08,0x90,0x02,0x24,0x00,0x89,0x00,0x22 },
+  16, 0xcfd0, 0, {0x54,0x0b,0x90,0x03,0xe6,0x00,0x89,0x00,0x22,0x40,0x08,0x90,0x0a,0x24,0x00,0x89 },
+  16, 0xcfe0, 0, {0x00,0x38,0x48,0x08,0x90,0x82,0xe4,0x04,0xd9,0x00,0x22,0x40,0x08,0x90,0x02,0x20 },
+  16, 0xcff0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0x89,0x01,0x2c,0x40 },
+  16, 0xd000, 0, {0x28,0x10,0x42,0x64,0x00,0xa1,0x04,0x22,0x50,0x01,0x90,0x42,0xe4,0x00,0x89,0x04 },
+  16, 0xd010, 0, {0x20,0x42,0x0a,0x90,0x42,0x34,0x00,0x89,0x00,0x6e,0x40,0x0a,0x90,0x00,0xe4,0x00 },
+  16, 0xd020, 0, {0x89,0x00,0x23,0x40,0x0a,0xd0,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd030, 0, {0x08,0x04,0x04,0x80,0x81,0x24,0x2c,0x48,0x08,0x10,0x02,0x04,0x80,0xa1,0x20,0x28 },
+  16, 0xd040, 0, {0x40,0x0b,0x10,0x02,0x85,0x80,0x81,0x20,0x20,0x48,0x08,0x50,0x62,0x14,0x02,0x81 },
+  16, 0xd050, 0, {0x03,0x2e,0x40,0x88,0x16,0x82,0xc4,0xa0,0x91,0x28,0x21,0x40,0x2a,0x50,0x02,0x02 },
+  16, 0xd060, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x61,0x40,0xc8,0x50,0x2e,0x14 },
+  16, 0xd070, 0, {0x0c,0x85,0x03,0x61,0x40,0xe8,0x50,0xb2,0x15,0x4d,0x80,0x02,0xc0,0x00,0x48,0x50 },
+  16, 0xd080, 0, {0xb2,0x15,0x1a,0x80,0x13,0x30,0x08,0xc8,0x00,0x3e,0x00,0x0e,0x82,0x03,0xe0,0x80 },
+  16, 0xd090, 0, {0xc0,0x20,0x30,0x00,0x0e,0x40,0x0b,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd0a0, 0, {0x98,0x1d,0xe4,0x40,0xf9,0x10,0x3e,0x44,0x0f,0xd0,0x03,0xe4,0x48,0xdd,0x10,0x37 },
+  16, 0xd0b0, 0, {0x40,0x0f,0xd4,0x07,0xe4,0x40,0xfd,0x10,0x3e,0x45,0x0f,0x94,0x03,0xe5,0x08,0xfd },
+  16, 0xd0c0, 0, {0x02,0x39,0xd0,0x0f,0xd0,0x43,0xf4,0xa0,0xf9,0x28,0x3e,0x4b,0x0d,0x92,0x83,0xe6 },
+  16, 0xd0d0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xe6,0x80,0xc9,0xa6,0x32,0x68 },
+  16, 0xd0e0, 0, {0x0c,0x90,0x03,0xa6,0x81,0xe9,0xe9,0x3b,0x40,0x0e,0x58,0x03,0x36,0x20,0xc9,0xa0 },
+  16, 0xd0f0, 0, {0x37,0x78,0x0d,0xda,0x03,0x36,0x26,0xc5,0x00,0x37,0x69,0x0e,0xde,0x03,0xa6,0x82 },
+  16, 0xd100, 0, {0xcd,0xc0,0x33,0x50,0x0f,0xd0,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd110, 0, {0x38,0x10,0xe3,0xa4,0x88,0xa9,0x22,0x3a,0x08,0x08,0x00,0x22,0xa0,0xb8,0xe5,0x30 },
+  16, 0xd120, 0, {0x20,0x28,0x80,0x22,0x43,0xa0,0x08,0xe8,0x2a,0x3d,0x08,0xa4,0x62,0x20,0x00,0x88 },
+  16, 0xd130, 0, {0x00,0x2e,0x10,0x08,0x8e,0x03,0x23,0xa0,0x88,0xa0,0x20,0x28,0x0b,0x8a,0x82,0x0e },
+  16, 0xd140, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x40,0x91,0x40,0x20,0x44 },
+  16, 0xd150, 0, {0x08,0x90,0xa2,0x85,0x10,0xa1,0x20,0x2c,0x42,0x0b,0x14,0x12,0x8c,0x01,0x91,0x10 },
+  16, 0xd160, 0, {0x2c,0x48,0x09,0x11,0x0a,0xc4,0x00,0x81,0x00,0x2c,0x50,0x0b,0x11,0x12,0xc5,0x01 },
+  16, 0xd170, 0, {0xb1,0x40,0x24,0x48,0x0b,0x18,0x0e,0x02,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd180, 0, {0x18,0x15,0xa4,0x00,0x91,0x00,0x22,0x41,0x08,0x94,0x42,0x24,0x00,0xb1,0x40,0x20 },
+  16, 0xd190, 0, {0x40,0x49,0xb2,0x62,0x24,0x00,0x99,0x00,0x0a,0x40,0x08,0x90,0x02,0xe5,0x80,0x89 },
+  16, 0xd1a0, 0, {0x00,0x2e,0x40,0x09,0xb0,0x02,0x24,0x80,0xb9,0x00,0x26,0x50,0x4b,0x90,0x02,0x06 },
+  16, 0xd1b0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x02,0xd9,0x00,0xb2,0x40 },
+  16, 0xd1c0, 0, {0x2c,0x95,0x13,0xa4,0x10,0xe9,0x00,0xbe,0x60,0x8f,0x90,0x0b,0xa4,0x10,0x59,0x00 },
+  16, 0xd1d0, 0, {0x1e,0x40,0x9d,0x94,0x23,0xe4,0x02,0x89,0x00,0x34,0x40,0x0f,0x90,0x03,0xe6,0x08 },
+  16, 0xd1e0, 0, {0x79,0x00,0xb6,0x40,0x07,0x98,0x03,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd1f0, 0, {0x28,0x01,0x84,0x00,0xe9,0x02,0x3c,0x40,0x2f,0x98,0x02,0xe4,0x00,0xf9,0x42,0x3a },
+  16, 0xd200, 0, {0x68,0x0a,0x10,0x03,0xe4,0x10,0xe9,0x00,0x3e,0x40,0x0e,0x90,0x0f,0x26,0x00,0xf9 },
+  16, 0xd210, 0, {0x04,0x3e,0x40,0x0e,0x1c,0x03,0xe6,0x00,0xc1,0x00,0x3a,0x50,0x0f,0x99,0x83,0xca },
+  16, 0xd220, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xe8,0x00,0x3a,0x00 },
+  16, 0xd230, 0, {0x0c,0x84,0x03,0x20,0x00,0xd8,0x42,0x32,0x04,0x0c,0x88,0x13,0xe0,0x00,0xc8,0x00 },
+  16, 0xd240, 0, {0x30,0x00,0x0c,0x04,0x0b,0x00,0x00,0xd8,0x00,0x36,0x00,0x0e,0x80,0x23,0x00,0x00 },
+  16, 0xd250, 0, {0xc8,0x80,0x32,0x00,0x0c,0x80,0x01,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd260, 0, {0x28,0x05,0x28,0x10,0x8a,0x00,0x2e,0x80,0x28,0x20,0x22,0x28,0x00,0x8a,0x00,0x23 },
+  16, 0xd270, 0, {0xb0,0x88,0xe0,0x02,0x28,0x10,0xda,0x00,0xa3,0xb4,0x08,0xe8,0x10,0x28,0x00,0x8e },
+  16, 0xd280, 0, {0x20,0x23,0xa0,0x48,0xed,0x1a,0x28,0x00,0xde,0x00,0x23,0x90,0x0a,0xe0,0x02,0x0a },
+  16, 0xd290, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0xa3,0x00,0x28,0xc0 },
+  16, 0xd2a0, 0, {0x08,0x30,0x0a,0x0c,0x00,0x93,0x00,0x20,0xc2,0x2a,0x30,0x22,0xa4,0x00,0xbb,0x00 },
+  16, 0xd2b0, 0, {0x08,0xe0,0x18,0x09,0x0a,0x4c,0x00,0x93,0x02,0x24,0xe8,0x02,0x08,0x06,0x4c,0x00 },
+  16, 0xd2c0, 0, {0x93,0x00,0x20,0xd8,0x0a,0x90,0x02,0x4a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd2d0, 0, {0xa0,0x01,0x1c,0x80,0x87,0x04,0x2d,0xc0,0x08,0x70,0x02,0x0e,0x00,0x87,0x10,0x25 },
+  16, 0xd2e0, 0, {0x00,0x0a,0x60,0x02,0x5e,0x00,0x97,0x00,0x29,0x82,0x08,0x50,0x12,0x54,0x00,0x8f },
+  16, 0xd2f0, 0, {0x80,0x61,0xd0,0x08,0x04,0x02,0x5c,0x01,0xb7,0x08,0xa9,0xa0,0x0a,0x50,0x82,0x68 },
+  16, 0xd300, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x3e,0x80,0xe7,0x80,0x38,0xe4 },
+  16, 0xd310, 0, {0x08,0x7e,0x03,0x1f,0x00,0xdf,0x80,0xb1,0x21,0x1e,0x78,0x03,0xdc,0x04,0xf3,0x80 },
+  16, 0xd320, 0, {0x5b,0xe1,0x08,0x28,0x03,0x5e,0x00,0xd7,0x80,0x35,0x60,0x0e,0x68,0x03,0x4e,0x00 },
+  16, 0xd330, 0, {0xdf,0x80,0x31,0xe0,0x0e,0xf8,0x0b,0x6a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd340, 0, {0x08,0x1d,0xad,0x02,0xfb,0x74,0x3e,0xd0,0x4f,0xb2,0x83,0xed,0x00,0x7b,0x68,0x3a },
+  16, 0xd350, 0, {0x00,0x8d,0x80,0x03,0xa4,0x20,0xdb,0x01,0x36,0x80,0x6f,0xb0,0x41,0x84,0x00,0xeb },
+  16, 0xd360, 0, {0x00,0x3c,0xc0,0x0f,0xe6,0x83,0xbc,0x40,0xdb,0x00,0xb6,0x80,0x0f,0xb0,0x03,0x82 },
+  16, 0xd370, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xff,0x20,0xdf,0xc0,0x3b,0xe6 },
+  16, 0xd380, 0, {0x0e,0xf8,0x13,0xff,0x44,0xc7,0x82,0x3b,0xe0,0x0f,0xf9,0x03,0xbe,0x10,0xcf,0xc8 },
+  16, 0xd390, 0, {0x33,0x60,0x8d,0xeb,0x03,0x3e,0x00,0xdb,0x82,0x3f,0xe0,0x0c,0xd8,0x03,0x3e,0x40 },
+  16, 0xd3a0, 0, {0xce,0x80,0x33,0xe4,0x0f,0xf8,0x03,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd3b0, 0, {0xa8,0x11,0xbc,0x40,0x87,0x00,0x21,0xe4,0x0b,0x78,0xa2,0xce,0x90,0xc7,0xb0,0x20 },
+  16, 0xd3c0, 0, {0xe8,0x0b,0x28,0x92,0xb6,0x88,0x87,0xa0,0x20,0x64,0x0b,0x35,0x03,0x14,0x00,0x87 },
+  16, 0xd3d0, 0, {0xb2,0x39,0xc0,0x2c,0xc0,0x03,0x5e,0x02,0xcf,0x00,0x31,0xce,0x0b,0x76,0x12,0x2a },
+  16, 0xd3e0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x00,0xa3,0x10,0x29,0xc8 },
+  16, 0xd3f0, 0, {0x0b,0x74,0x02,0xdc,0x80,0x8f,0x00,0x29,0xcc,0x0a,0x30,0x06,0x14,0x80,0x87,0x10 },
+  16, 0xd400, 0, {0x21,0xc0,0x0b,0x66,0x02,0x5c,0x00,0x87,0x00,0x2d,0xc0,0x0b,0x51,0x02,0x1c,0x80 },
+  16, 0xd410, 0, {0x96,0x00,0x21,0xc0,0x5b,0x74,0x82,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd420, 0, {0x20,0x14,0xcc,0x08,0xa3,0x00,0x20,0xc0,0x0b,0xb8,0x02,0xcc,0x00,0x8b,0x40,0xa8 },
+  16, 0xd430, 0, {0xc0,0x8b,0x08,0x22,0x8c,0x02,0x83,0x00,0x60,0xc0,0x0b,0x30,0x42,0x04,0x00,0x83 },
+  16, 0xd440, 0, {0x40,0x28,0xfc,0x8a,0x00,0x02,0x6e,0x00,0x83,0x00,0xa0,0xd0,0x8b,0x38,0x02,0x08 },
+  16, 0xd450, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x11,0xbc,0x02,0xef,0x00,0x3b,0xc0 },
+  16, 0xd460, 0, {0x4f,0xf8,0x02,0xfc,0x02,0xcf,0x00,0x38,0x12,0x0e,0x98,0x02,0x2c,0x00,0xcf,0x00 },
+  16, 0xd470, 0, {0x32,0xc0,0x09,0x90,0x03,0x64,0x02,0x81,0xc0,0x3e,0xd0,0x0f,0x90,0x07,0x3c,0x03 },
+  16, 0xd480, 0, {0xd9,0x00,0x32,0x60,0x0f,0x88,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd490, 0, {0x80,0x00,0xcc,0x00,0xdb,0x00,0x3e,0xc0,0x8f,0xb0,0x03,0xec,0x00,0xfb,0x02,0x36 },
+  16, 0xd4a0, 0, {0xc0,0x4f,0x90,0x02,0xe4,0x00,0xfb,0x00,0xbe,0x90,0x0f,0x9c,0x13,0xec,0x00,0xe9 },
+  16, 0xd4b0, 0, {0x18,0x3a,0xd0,0x04,0xd5,0x03,0xec,0x40,0xe9,0x00,0x3a,0x00,0x8f,0x80,0x03,0xe0 },
+  16, 0xd4c0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x00,0xcf,0x00,0x3d,0xc1 },
+  16, 0xd4d0, 0, {0x8c,0xf0,0x03,0x2c,0x00,0xef,0x0a,0xb3,0x12,0x2c,0x70,0x23,0x14,0x0a,0x4f,0x00 },
+  16, 0xd4e0, 0, {0x35,0x60,0x0d,0xb0,0x03,0x04,0x00,0xcd,0x80,0x07,0xe8,0x0c,0xc4,0x03,0x2c,0x00 },
+  16, 0xd4f0, 0, {0xcd,0x00,0x31,0xe2,0x2c,0xe0,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd500, 0, {0x81,0x04,0x6c,0x02,0xab,0x02,0x2e,0xc0,0x0e,0xb0,0x02,0x2c,0x00,0x8b,0x00,0x32 },
+  16, 0xd510, 0, {0x30,0x00,0x9c,0x03,0x6c,0x00,0x8b,0x04,0x22,0x36,0x08,0x34,0x4a,0x2c,0x08,0x89 },
+  16, 0xd520, 0, {0x90,0x20,0xb8,0x0f,0x84,0x00,0xac,0x02,0x89,0x00,0x36,0xa0,0x08,0xa4,0x02,0x20 },
+  16, 0xd530, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0x8b,0x00,0x2e,0xc0 },
+  16, 0xd540, 0, {0x08,0xb0,0x02,0x0c,0x00,0x8b,0x00,0x22,0xd1,0x08,0x88,0x12,0x26,0x00,0xa3,0x00 },
+  16, 0xd550, 0, {0x26,0x40,0x0b,0xb0,0x02,0x26,0x00,0x8b,0x00,0x26,0xc0,0x58,0x10,0x12,0x2c,0x04 },
+  16, 0xd560, 0, {0x82,0x80,0x2a,0x49,0x08,0x30,0x02,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd570, 0, {0x08,0x04,0x0c,0x00,0xa3,0x14,0x2c,0xc8,0x1a,0x34,0x8a,0x0c,0x84,0x83,0x40,0x22 },
+  16, 0xd580, 0, {0xc8,0x08,0x03,0x62,0x4c,0xc0,0xa3,0x60,0x20,0x40,0x0a,0x30,0x02,0x0c,0x00,0x8b },
+  16, 0xd590, 0, {0x45,0x08,0xc0,0x0b,0x10,0x02,0x8c,0xa0,0x83,0x00,0x26,0x40,0x08,0x30,0x0a,0x02 },
+  16, 0xd5a0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x7c,0x00,0xcf,0x40,0x2f,0xd2 },
+  16, 0xd5b0, 0, {0x8c,0xf6,0x03,0x3c,0x22,0xcf,0x40,0x32,0xd6,0x4c,0xa6,0xc1,0x3d,0xa0,0x87,0x48 },
+  16, 0xd5c0, 0, {0x36,0x0d,0x0f,0xb1,0x02,0x24,0x42,0xcb,0x60,0x16,0xc0,0x0c,0xd0,0x03,0x2c,0x80 },
+  16, 0xd5d0, 0, {0xca,0x00,0x32,0xc0,0x0c,0x30,0x03,0x00,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd5e0, 0, {0xa0,0x19,0xfc,0x00,0xff,0x20,0x3e,0xca,0x0e,0xb0,0x03,0xec,0x20,0xdb,0x34,0x3a },
+  16, 0xd5f0, 0, {0xc8,0x0f,0x80,0x03,0xe4,0x10,0xdb,0x21,0x3e,0x18,0x0d,0xf2,0x03,0xfc,0x80,0xff },
+  16, 0xd600, 0, {0x30,0x35,0xc0,0x0f,0xc0,0x13,0xec,0x00,0xff,0x00,0x3b,0xc0,0x0f,0xf0,0x03,0xe8 },
+  16, 0xd610, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x11,0xfc,0x00,0xfb,0x0b,0x2f,0xca },
+  16, 0xd620, 0, {0x8d,0xf2,0x03,0xfa,0x00,0x96,0x80,0x3b,0xc4,0x0d,0xf1,0x03,0x7c,0x80,0xec,0x80 },
+  16, 0xd630, 0, {0x3b,0x08,0x0c,0xc2,0x03,0x74,0x02,0xcc,0x80,0x3f,0x48,0x0e,0xf0,0x03,0x30,0xa0 },
+  16, 0xd640, 0, {0xd5,0x80,0x3f,0x40,0x0c,0xf8,0x03,0xf0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd650, 0, {0x80,0x08,0xee,0x40,0xbf,0x80,0x2f,0xf0,0x0b,0xf7,0x22,0xee,0x20,0x8a,0x80,0x23 },
+  16, 0xd660, 0, {0xfc,0x88,0x75,0x12,0x3d,0x00,0x88,0x00,0x22,0x00,0x28,0x80,0x02,0x24,0x08,0x88 },
+  16, 0xd670, 0, {0x00,0x6f,0x50,0x00,0xf5,0x02,0x29,0x00,0x89,0x00,0x2e,0x54,0x0d,0x90,0x11,0xa0 },
+  16, 0xd680, 0, {0x04,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x00,0xb3,0x00,0x2c,0xc1 },
+  16, 0xd690, 0, {0x09,0x30,0x82,0xcc,0x82,0xbb,0x00,0x28,0xc0,0x49,0x32,0x02,0xcd,0x00,0xb8,0x00 },
+  16, 0xd6a0, 0, {0x2c,0x50,0x09,0x01,0x02,0x0c,0x40,0x80,0x00,0x6c,0x44,0x09,0x30,0x02,0x20,0x00 },
+  16, 0xd6b0, 0, {0xb0,0x00,0x2c,0x40,0x18,0x30,0x06,0xe2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd6c0, 0, {0xc0,0x01,0xac,0x00,0xbb,0x01,0x2e,0xc0,0x0b,0xb0,0x02,0xee,0x00,0xaa,0x00,0x4a },
+  16, 0xd6d0, 0, {0xc0,0x08,0xb0,0x52,0xec,0x00,0x98,0x02,0x26,0x40,0x09,0x80,0x02,0x6c,0x01,0xaa },
+  16, 0xd6e0, 0, {0x04,0x2e,0x40,0x09,0xb0,0x02,0x22,0x00,0xa9,0x80,0x2e,0x41,0x09,0x90,0x02,0xf0 },
+  16, 0xd6f0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xec,0x00,0xfb,0x00,0x3e,0xc0 },
+  16, 0xd700, 0, {0x0d,0xb0,0x03,0xce,0x84,0xfa,0x00,0x1a,0xc0,0x8d,0xb0,0x43,0xec,0x00,0xf0,0x02 },
+  16, 0xd710, 0, {0x3f,0x00,0x0d,0xd1,0x03,0x35,0x00,0xcb,0x48,0x2e,0x40,0x2f,0xb0,0x09,0x22,0x80 },
+  16, 0xd720, 0, {0xf9,0xc8,0x1e,0xe0,0x08,0xb1,0xe2,0xd0,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd730, 0, {0xe0,0x01,0xbc,0x00,0x7b,0x00,0x3f,0xc0,0x0f,0xf0,0x23,0xfc,0x00,0xde,0x00,0x24 },
+  16, 0xd740, 0, {0xc0,0x4f,0xf0,0x03,0x2c,0x00,0xec,0x20,0x3b,0x00,0x0e,0x98,0x03,0x94,0x02,0xdd },
+  16, 0xd750, 0, {0x00,0x3f,0x40,0x4e,0xf0,0x01,0xf8,0x00,0xdd,0x00,0x3c,0xe4,0x0f,0xd8,0x03,0xb8 },
+  16, 0xd760, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0xac,0xc0,0xfb,0x20,0x32,0xc8 },
+  16, 0xd770, 0, {0x8d,0xb0,0x03,0xec,0x00,0xf9,0x00,0x3a,0xc2,0x2c,0x30,0x03,0x6c,0x04,0xd8,0x02 },
+  16, 0xd780, 0, {0x3c,0x44,0x8d,0x10,0x03,0xad,0x03,0xea,0x00,0x3c,0x40,0x0c,0x70,0x23,0xe4,0x00 },
+  16, 0xd790, 0, {0xc8,0x40,0x3a,0xc0,0x0d,0xbc,0x03,0x50,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd7a0, 0, {0xc8,0x01,0x3d,0x00,0xbf,0x42,0x23,0xf0,0x0d,0xf0,0x02,0xe5,0x00,0xe2,0x01,0x37 },
+  16, 0xd7b0, 0, {0xf1,0x08,0xf0,0x0e,0x3d,0xc0,0xa8,0x00,0x2e,0x54,0x28,0x90,0x02,0x2c,0x00,0x8a },
+  16, 0xd7c0, 0, {0x05,0x3b,0x41,0x48,0xf5,0x03,0x8c,0x00,0x89,0x00,0x22,0xd4,0x0e,0x95,0x02,0xf2 },
+  16, 0xd7d0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x00,0xb3,0x04,0x20,0xc0 },
+  16, 0xd7e0, 0, {0x89,0x30,0x02,0xcc,0x40,0xb2,0x00,0x2c,0xc4,0x48,0x30,0x02,0x2c,0x02,0xa2,0x00 },
+  16, 0xd7f0, 0, {0x2c,0x20,0x19,0x20,0x1a,0x80,0x08,0xb0,0x00,0x6c,0x40,0x08,0x30,0x02,0xc4,0x00 },
+  16, 0xd800, 0, {0x81,0x00,0x2c,0x40,0x08,0x30,0x02,0xf8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd810, 0, {0x20,0x01,0x1e,0x00,0xb7,0xa0,0xe1,0xe0,0x09,0x78,0x02,0xdf,0x04,0xae,0x80,0x2d },
+  16, 0xd820, 0, {0xe0,0x08,0x79,0x02,0x1e,0x10,0x87,0x90,0x2c,0x28,0x29,0x68,0x02,0x82,0x81,0xb4 },
+  16, 0xd830, 0, {0x80,0x2d,0x60,0x08,0x78,0x10,0xbc,0x00,0x8f,0x80,0x2d,0x60,0x0b,0x68,0x02,0xc8 },
+  16, 0xd840, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x0c,0x05,0xf3,0x92,0x30,0xca },
+  16, 0xd850, 0, {0x0d,0x30,0x03,0xcc,0x00,0xf3,0x00,0x3c,0xc0,0x0c,0x30,0x02,0x0c,0x80,0x70,0x00 },
+  16, 0xd860, 0, {0x2c,0x40,0x0d,0x20,0x03,0x89,0x00,0xb1,0x00,0x3e,0x40,0x2c,0x30,0x03,0xec,0x50 },
+  16, 0xd870, 0, {0xc3,0x20,0x3c,0x40,0x0c,0x30,0x03,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd880, 0, {0x40,0x1d,0xbc,0x00,0xff,0x00,0x3c,0xc0,0x0e,0xb0,0x83,0xec,0x40,0xea,0x00,0x36 },
+  16, 0xd890, 0, {0xc2,0x0f,0xb0,0x83,0xac,0x00,0xf8,0x00,0x3e,0x48,0x0e,0xe0,0x0b,0x7a,0x80,0xcf },
+  16, 0xd8a0, 0, {0x00,0x3b,0x44,0x0f,0xf0,0x03,0xec,0xc0,0xff,0x00,0x03,0x44,0x0e,0xe0,0x03,0xd0 },
+  16, 0xd8b0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x00,0xfb,0x23,0x3e,0xc8 },
+  16, 0xd8c0, 0, {0x1d,0xb0,0x03,0xee,0x00,0xca,0x00,0x3e,0xc8,0x0c,0xb2,0x03,0x2d,0x90,0xc8,0x84 },
+  16, 0xd8d0, 0, {0x36,0x00,0x2d,0xb0,0x03,0x60,0x18,0x9b,0x80,0x33,0x50,0x0c,0xf2,0x03,0xe2,0x00 },
+  16, 0xd8e0, 0, {0xc9,0x80,0x32,0x40,0x0c,0xb8,0x03,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd8f0, 0, {0x48,0x11,0x9c,0x00,0xb7,0x28,0x0c,0xd2,0x28,0x73,0x02,0xfc,0x00,0x86,0x04,0x2c },
+  16, 0xd900, 0, {0xcc,0x28,0x70,0x83,0x0c,0x20,0x95,0x01,0x20,0x00,0x09,0x30,0x12,0x10,0x04,0x85 },
+  16, 0xd910, 0, {0x00,0x21,0x52,0x08,0x75,0x02,0xd8,0x00,0x87,0x00,0x21,0x40,0x08,0x60,0x02,0x12 },
+  16, 0xd920, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0xd4,0xb7,0xb1,0x09,0xe1 },
+  16, 0xd930, 0, {0x08,0x78,0x22,0xde,0x00,0x95,0x80,0x2d,0xe0,0x08,0x78,0x0a,0x5e,0x42,0x94,0xc0 },
+  16, 0xd940, 0, {0x21,0x60,0x08,0x78,0x02,0x5a,0x00,0x87,0x80,0x2d,0x68,0x08,0x7a,0x02,0xd7,0x00 },
+  16, 0xd950, 0, {0x97,0x80,0x20,0x60,0x09,0x78,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd960, 0, {0x48,0x10,0xcc,0x00,0xb3,0x00,0x2c,0xc0,0x08,0xb0,0x02,0xcd,0x80,0x92,0x00,0x2c },
+  16, 0xd970, 0, {0xc0,0x08,0xb0,0x02,0xcc,0x00,0x90,0x80,0xa0,0x40,0x09,0x36,0x02,0x48,0x02,0x83 },
+  16, 0xd980, 0, {0xa0,0xac,0x40,0x2a,0x30,0x06,0xce,0x02,0x93,0x04,0xa0,0x40,0x09,0x20,0x0a,0x12 },
+  16, 0xd990, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x00,0xfa,0x00,0x3a,0x80 },
+  16, 0xd9a0, 0, {0x0d,0xa0,0x03,0xfb,0x02,0xde,0x80,0x3e,0x80,0x0c,0xa0,0x03,0x28,0x00,0xce,0x80 },
+  16, 0xd9b0, 0, {0x32,0x80,0x0c,0xa4,0x03,0x78,0x00,0xce,0xa4,0x3f,0x80,0x0c,0xa0,0x07,0xf9,0x00 },
+  16, 0xd9c0, 0, {0xde,0x00,0x32,0x80,0x2d,0xe0,0x02,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd9d0, 0, {0x48,0x00,0xe1,0x00,0xf8,0x00,0x7c,0x00,0x0f,0x80,0x03,0xe0,0x40,0xe8,0x10,0x3c },
+  16, 0xd9e0, 0, {0x01,0xcf,0x80,0x0f,0x20,0x00,0xe8,0x00,0x3e,0x00,0x0e,0x04,0x03,0x90,0x00,0xe8 },
+  16, 0xd9f0, 0, {0x00,0x20,0x00,0x0d,0x80,0x07,0xe0,0x00,0xe8,0x00,0x3e,0x04,0x0e,0x80,0x03,0xd2 },
+  16, 0xda00, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xf9,0x10,0x7e,0x41 },
+  16, 0xda10, 0, {0x0e,0x90,0x03,0x24,0x00,0xf9,0x00,0x36,0x68,0x0e,0x90,0x0f,0xa4,0x08,0xc9,0x00 },
+  16, 0xda20, 0, {0x3a,0x40,0x0c,0x90,0x0b,0x24,0x12,0xe9,0x00,0x3e,0x44,0x2c,0x90,0x03,0x64,0x24 },
+  16, 0xda30, 0, {0xf9,0x02,0x2e,0x40,0x0c,0x90,0x03,0xc2,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xda40, 0, {0x80,0x04,0x65,0x10,0xb9,0x80,0x3e,0x40,0x08,0x90,0x0a,0x26,0x00,0xb1,0x10,0x2a },
+  16, 0xda50, 0, {0x72,0x08,0x90,0x07,0x64,0x02,0x89,0x40,0x2e,0x40,0x28,0x90,0x12,0x25,0x00,0x89 },
+  16, 0xda60, 0, {0x45,0x3e,0x50,0x0d,0x90,0x0a,0x25,0x00,0xb9,0x40,0x2e,0x40,0x28,0x94,0x03,0xe0 },
+  16, 0xda70, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0xb9,0x00,0x2e,0x40 },
+  16, 0xda80, 0, {0x48,0x90,0x42,0x26,0x01,0xb9,0x40,0x26,0x40,0x0a,0x90,0x42,0x84,0x01,0x8b,0x08 },
+  16, 0xda90, 0, {0x2c,0x40,0x09,0xd0,0x82,0x34,0x32,0xa9,0x08,0x6e,0x42,0x08,0x10,0x02,0x24,0x20 },
+  16, 0xdaa0, 0, {0xb9,0x08,0x2c,0x40,0x18,0x90,0x82,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdab0, 0, {0x08,0x04,0x04,0x80,0xb3,0x20,0x28,0x48,0x08,0x12,0x02,0x04,0x01,0xb1,0x00,0x28 },
+  16, 0xdac0, 0, {0x58,0x08,0x12,0x02,0x05,0x89,0x81,0x40,0x2c,0x58,0x08,0x56,0x06,0x15,0x80,0x81 },
+  16, 0xdad0, 0, {0x40,0x28,0x50,0x09,0x14,0x02,0x05,0x80,0xb1,0x40,0x2c,0x5a,0x08,0x14,0x02,0xc2 },
+  16, 0xdae0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x68,0x00,0xf8,0x00,0x2e,0x00 },
+  16, 0xdaf0, 0, {0x2e,0x85,0x03,0x21,0x48,0xf8,0x00,0x36,0x00,0x8e,0x05,0x02,0xa0,0x08,0x80,0x00 },
+  16, 0xdb00, 0, {0x3e,0x00,0x0d,0x80,0x0b,0x10,0x04,0xe0,0x00,0x2c,0x00,0x4c,0x80,0x03,0x40,0x00 },
+  16, 0xdb10, 0, {0xf0,0x00,0x3e,0x08,0x0c,0x00,0x03,0xee,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdb20, 0, {0x98,0x1d,0xe4,0x40,0xf9,0x10,0x3e,0x44,0x0f,0x91,0x03,0xf4,0x00,0xfd,0x00,0x3e },
+  16, 0xdb30, 0, {0x44,0x0f,0x91,0x03,0xe4,0x40,0xfd,0x03,0x3f,0x44,0x1f,0x91,0x1b,0xe4,0x40,0xfd },
+  16, 0xdb40, 0, {0x01,0x3f,0x50,0x0e,0x94,0x03,0xf4,0x40,0xfd,0x00,0x3f,0x40,0x0f,0xd0,0x03,0xa6 },
+  16, 0xdb50, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x15,0xf4,0x00,0xcd,0xa0,0x71,0x68 },
+  16, 0xdb60, 0, {0x8d,0x98,0x03,0xd4,0x00,0xcd,0x00,0x33,0x60,0x0c,0x98,0x8f,0x27,0x20,0xc9,0x40 },
+  16, 0xdb70, 0, {0x3e,0x78,0x0c,0x9e,0x8b,0x27,0x20,0xd1,0x11,0x30,0x60,0x8c,0x9c,0x03,0x25,0x00 },
+  16, 0xdb80, 0, {0xf9,0x40,0x3e,0x78,0x0f,0x90,0x03,0x46,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdb90, 0, {0x38,0x10,0xe0,0x10,0x88,0x01,0x22,0x01,0x08,0x8c,0x22,0xe8,0x00,0x88,0x02,0x2a },
+  16, 0xdba0, 0, {0x14,0x08,0x8c,0x0b,0x23,0x90,0x88,0xa0,0x2e,0xb0,0x08,0x8c,0x42,0x23,0x00,0x88 },
+  16, 0xdbb0, 0, {0xa0,0x36,0x2a,0x18,0x8a,0x02,0x22,0x00,0xb8,0xa0,0x2e,0x34,0x0b,0xca,0x82,0x0e },
+  16, 0xdbc0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x00,0x81,0x40,0x24,0x50 },
+  16, 0xdbd0, 0, {0x09,0x16,0x82,0xc4,0x00,0xa9,0x00,0x20,0x40,0x08,0x12,0x92,0x54,0x08,0x85,0x00 },
+  16, 0xdbe0, 0, {0x2f,0x4c,0x09,0x52,0x12,0x14,0x80,0x9d,0x00,0x21,0x50,0x08,0x54,0x22,0x14,0x80 },
+  16, 0xdbf0, 0, {0xb5,0x00,0x2d,0x48,0x0b,0xd0,0x02,0x42,0x05,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdc00, 0, {0x18,0x05,0xa4,0x02,0x89,0x01,0xa2,0x40,0x48,0x90,0x02,0xe4,0x02,0xa9,0x00,0x2a },
+  16, 0xdc10, 0, {0x40,0x68,0x90,0x02,0x64,0x10,0xad,0x00,0x2f,0x41,0x28,0x50,0x02,0x34,0x00,0x8d },
+  16, 0xdc20, 0, {0x44,0x27,0x40,0x39,0xd0,0x02,0x35,0x00,0xbd,0x14,0x2f,0x40,0x0b,0xd0,0x02,0x46 },
+  16, 0xdc30, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x05,0xc4,0x00,0xc9,0x00,0x36,0x40 },
+  16, 0xdc40, 0, {0x2d,0x90,0x03,0xe7,0x00,0xe1,0xe0,0x32,0x40,0x0c,0x90,0x0b,0x64,0x02,0xc9,0x08 },
+  16, 0xdc50, 0, {0x3c,0x50,0x0c,0x90,0x02,0x26,0x02,0xd9,0xc0,0x32,0x40,0x0c,0x90,0x13,0x27,0x00 },
+  16, 0xdc60, 0, {0xf9,0x20,0x3e,0x40,0x0f,0x90,0x03,0x68,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdc70, 0, {0x28,0x01,0xa4,0x02,0xf9,0x00,0x38,0x40,0x0f,0x90,0x03,0xe6,0x80,0xd9,0xa0,0x3c },
+  16, 0xdc80, 0, {0x40,0x0f,0x10,0x03,0xa4,0x00,0xd9,0x10,0x3e,0x40,0x0f,0x90,0x03,0xc4,0x92,0xf9 },
+  16, 0xdc90, 0, {0x21,0x3c,0x40,0x2e,0x90,0x0f,0xe6,0x80,0xf9,0x80,0x3e,0x40,0x0f,0x90,0x03,0x8a },
+  16, 0xdca0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x00,0xa0,0x40,0xe8,0x10,0x3e,0x04 },
+  16, 0xdcb0, 0, {0x4e,0x80,0x03,0x20,0x80,0xd8,0x60,0x3a,0x02,0x0c,0x80,0x13,0x20,0x00,0xf8,0x40 },
+  16, 0xdcc0, 0, {0x36,0x10,0x2d,0x80,0x03,0xa0,0x08,0xe8,0x40,0x32,0x00,0x0d,0x00,0x03,0x21,0x02 },
+  16, 0xdcd0, 0, {0xc8,0x40,0xb2,0x00,0x0f,0xc0,0x03,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdce0, 0, {0x28,0x11,0x3b,0x10,0x86,0x01,0x2f,0xa0,0x0d,0xa0,0x02,0x38,0x00,0x8e,0xe0,0x23 },
+  16, 0xdcf0, 0, {0xa2,0x08,0xa0,0x02,0x28,0x00,0xba,0x80,0x22,0x80,0x08,0xa0,0x02,0x28,0x00,0x82 },
+  16, 0xdd00, 0, {0x00,0x2a,0x80,0x28,0xa0,0x02,0x2a,0x04,0x8a,0x80,0x22,0xa0,0x0b,0x60,0x02,0xca },
+  16, 0xdd10, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x43,0x80,0xa2,0x00,0x2c,0xa0 },
+  16, 0xdd20, 0, {0x08,0x30,0x02,0x2e,0x00,0x92,0x00,0x28,0xc0,0x28,0x30,0x02,0x2c,0x00,0xb3,0x80 },
+  16, 0xdd30, 0, {0x24,0xc0,0x09,0x30,0x0a,0x8c,0x00,0xa3,0x00,0x60,0xc0,0x08,0x30,0x0a,0x4c,0x00 },
+  16, 0xdd40, 0, {0x83,0x00,0x20,0xe0,0x0b,0x20,0x02,0xca,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdd50, 0, {0xa0,0x01,0x10,0x00,0x86,0x00,0x2d,0xc0,0x09,0x3a,0x02,0x35,0x00,0x86,0x00,0x21 },
+  16, 0xdd60, 0, {0xc0,0x08,0x73,0x02,0x10,0x00,0xbf,0x88,0x21,0x00,0x08,0x70,0x02,0x1c,0x08,0x8f },
+  16, 0xdd70, 0, {0x00,0x2b,0xc0,0x08,0x20,0x12,0x5e,0x20,0x87,0x88,0x21,0x83,0x0b,0x60,0x02,0xe8 },
+  16, 0xdd80, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x12,0x00,0xe5,0x81,0x3d,0xa0 },
+  16, 0xdd90, 0, {0x2c,0x7a,0x0b,0x1e,0x00,0xd4,0x80,0x38,0xe0,0x0c,0xfa,0x0b,0x1e,0x00,0xf6,0x80 },
+  16, 0xdda0, 0, {0x34,0xe0,0x0d,0x28,0x03,0x8a,0x00,0xe6,0x80,0x31,0x20,0x0c,0x78,0x03,0x7a,0x04 },
+  16, 0xddb0, 0, {0xce,0x84,0x31,0xe0,0x4f,0x78,0x43,0xea,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xddc0, 0, {0x08,0x0d,0x80,0x00,0xf8,0x00,0x3e,0xc0,0x0f,0xb5,0x23,0xe4,0x00,0xf0,0x04,0x36 },
+  16, 0xddd0, 0, {0x40,0x0f,0xb6,0x87,0xe0,0x00,0xf2,0x00,0x3e,0x00,0x1f,0xa0,0x0b,0xe8,0x00,0xfa },
+  16, 0xdde0, 0, {0x00,0x3e,0x00,0x0e,0xa0,0x03,0xa8,0x00,0xfa,0x00,0x3e,0x80,0x0f,0xb0,0x03,0xc2 },
+  16, 0xddf0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xf6,0x00,0xcc,0x80,0x33,0xa0 },
+  16, 0xde00, 0, {0x0c,0xfc,0x03,0x3e,0x00,0xfc,0x80,0x37,0xe0,0x0f,0xb9,0x21,0x3e,0x00,0xfd,0x82 },
+  16, 0xde10, 0, {0x33,0xe0,0x2c,0xf8,0x03,0x7e,0x10,0xdf,0x84,0x3d,0xe0,0x0c,0xf8,0x03,0xf6,0x00 },
+  16, 0xde20, 0, {0xfd,0x80,0x3f,0x60,0x0c,0xe8,0x23,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xde30, 0, {0xa8,0x11,0x98,0x40,0x84,0x10,0x21,0xc0,0x08,0x70,0x02,0x10,0x80,0xb4,0x00,0x21 },
+  16, 0xde40, 0, {0xc8,0x0b,0x7a,0x02,0x10,0x00,0xfd,0x00,0x21,0x04,0x08,0x70,0x02,0x1c,0x42,0x87 },
+  16, 0xde50, 0, {0x00,0x2d,0xc4,0x48,0x61,0x02,0xd6,0x80,0xb5,0x00,0x2f,0x04,0x08,0x61,0x82,0x2a },
+  16, 0xde60, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x00,0x81,0x00,0x21,0x80 },
+  16, 0xde70, 0, {0x08,0x30,0x02,0x1c,0x10,0xbc,0x08,0x25,0x80,0x4b,0x30,0x0e,0x1c,0x00,0xb4,0x00 },
+  16, 0xde80, 0, {0x20,0xc0,0x08,0x20,0x02,0x58,0x00,0x96,0x00,0x2f,0x00,0x0a,0x70,0x02,0xd0,0x80 },
+  16, 0xde90, 0, {0xb4,0x18,0x2d,0x40,0x09,0xf8,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdea0, 0, {0x20,0x14,0xc8,0x02,0x80,0x00,0xa0,0xc0,0x08,0x30,0x22,0x0b,0xc0,0xb0,0xc0,0x22 },
+  16, 0xdeb0, 0, {0x80,0x0b,0x30,0x02,0x00,0x00,0xa0,0x04,0x22,0x00,0x28,0xa0,0x02,0x2b,0x00,0x8a },
+  16, 0xdec0, 0, {0x00,0x2c,0x00,0x08,0xa0,0x06,0xc0,0x00,0xb0,0xc2,0x2c,0x00,0x09,0xbc,0x1a,0x08 },
+  16, 0xded0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xa0,0x00,0xc8,0x00,0x32,0xc0 },
+  16, 0xdee0, 0, {0x0c,0xf0,0x0b,0x26,0x00,0xf9,0xc0,0x36,0x00,0x0f,0xf0,0x13,0x2c,0x10,0xbb,0x40 },
+  16, 0xdef0, 0, {0xf2,0xc0,0x08,0x90,0x03,0x67,0x00,0xd9,0x80,0x3e,0xc0,0x08,0x90,0x02,0xec,0x00 },
+  16, 0xdf00, 0, {0xfb,0xd0,0x3e,0xc0,0x29,0x8c,0x00,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdf10, 0, {0x80,0x00,0xe0,0x00,0xf8,0x44,0x3c,0xd0,0x2f,0xb0,0x03,0xe4,0x00,0xf9,0x20,0x3e },
+  16, 0xdf20, 0, {0x40,0x0f,0x30,0x03,0xe0,0x00,0xfb,0x08,0x3e,0x00,0x0f,0x90,0x13,0xe4,0x42,0xf9 },
+  16, 0xdf30, 0, {0x10,0x3e,0xc0,0x0f,0x80,0x03,0xee,0x00,0xfb,0x00,0x3e,0x80,0x0e,0x82,0x03,0xe0 },
+  16, 0xdf40, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xe0,0x08,0xfc,0x80,0x32,0xe4 },
+  16, 0xdf50, 0, {0x0e,0xf0,0x03,0x74,0x00,0xfc,0x00,0x3f,0x40,0x0c,0xf0,0x0b,0x3c,0x00,0xfe,0x00 },
+  16, 0xdf60, 0, {0x3f,0xc0,0x0d,0xc1,0x03,0x20,0x20,0xcc,0x10,0x33,0x00,0x0c,0xd1,0x03,0x58,0x00 },
+  16, 0xdf70, 0, {0xce,0x00,0x2f,0xc0,0x0f,0xd1,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdf80, 0, {0x81,0x44,0x62,0x00,0xb0,0x40,0x2a,0xf1,0x08,0xb0,0x12,0x26,0x08,0xb8,0xc8,0x2e },
+  16, 0xdf90, 0, {0x70,0x0a,0xb0,0x02,0x20,0x00,0xba,0x00,0x2e,0x00,0x28,0x80,0x03,0x22,0x40,0x88 },
+  16, 0xdfa0, 0, {0x01,0x20,0x00,0x0a,0x80,0x02,0x28,0x00,0x8a,0x01,0x2e,0x80,0x8b,0x90,0x02,0x20 },
+  16, 0xdfb0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x26,0x00,0xb8,0x28,0x22,0x42 },
+  16, 0xdfc0, 0, {0x08,0x30,0x02,0x66,0x00,0xb8,0x80,0x2e,0x30,0x88,0xb0,0x02,0x2c,0x00,0xb9,0x01 },
+  16, 0xdfd0, 0, {0x2e,0xc0,0x88,0x90,0x02,0xa4,0x00,0x89,0x00,0x22,0xc0,0x08,0x90,0x02,0x24,0x0c },
+  16, 0xdfe0, 0, {0x89,0x01,0x2e,0x40,0x1b,0x80,0x02,0x60,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdff0, 0, {0x08,0x04,0x00,0x00,0xb0,0x00,0x28,0xc0,0x28,0x30,0x02,0x00,0x00,0xb0,0x00,0x2c },
+  16, 0xe000, 0, {0x40,0x0a,0x30,0x02,0x00,0x00,0xb1,0x00,0x2c,0x00,0x08,0x10,0x0a,0x04,0x00,0x81 },
+  16, 0xe010, 0, {0x01,0xa2,0xc0,0x08,0x00,0x0a,0x04,0x80,0x81,0x00,0x2c,0x00,0x1b,0x00,0x0a,0x02 },
+  16, 0xe020, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x60,0x00,0xf8,0x00,0x32,0x40 },
+  16, 0xe030, 0, {0x0e,0xf0,0x23,0x64,0x08,0xf8,0x00,0x2e,0x00,0x0c,0xf0,0x03,0x2c,0x00,0xf8,0x00 },
+  16, 0xe040, 0, {0x3e,0xc0,0x0c,0x80,0x03,0x20,0x02,0xc8,0x04,0x32,0x00,0x1c,0x90,0x03,0x20,0x00 },
+  16, 0xe050, 0, {0xc8,0x01,0x3e,0x41,0x9f,0x90,0x43,0x40,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe060, 0, {0xa0,0x1d,0xf0,0x00,0xfc,0x0c,0x3f,0xc0,0x0f,0xf0,0x03,0xf0,0x10,0xf4,0x00,0x3f },
+  16, 0xe070, 0, {0x00,0x0f,0xf4,0x23,0xf0,0x00,0xfc,0x00,0x3f,0x00,0x0e,0xc0,0x03,0xb0,0x00,0xfc },
+  16, 0xe080, 0, {0x00,0x3f,0x00,0x0f,0xc0,0x03,0xe1,0x00,0xfc,0x00,0x3f,0x01,0x1f,0x50,0x03,0xe8 },
+  16, 0xe090, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x0d,0xf0,0xd0,0xff,0x20,0x3e,0xd0 },
+  16, 0xe0a0, 0, {0x8e,0xb0,0x03,0xec,0xa0,0xdb,0x28,0x3e,0xcc,0x0c,0xb3,0x03,0xad,0x08,0xf8,0x3c },
+  16, 0xe0b0, 0, {0x32,0x23,0x0e,0x48,0x23,0x7a,0x00,0xfd,0x94,0x3f,0xe0,0x0f,0x78,0x33,0xee,0x08 },
+  16, 0xe0c0, 0, {0xbf,0x80,0x3f,0xe4,0x0f,0xf9,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe0d0, 0, {0xa0,0x00,0xec,0xc8,0xbf,0xd1,0x0f,0xc8,0x0c,0x26,0x82,0xfd,0x24,0x8f,0x00,0x2e },
+  16, 0xe0e0, 0, {0x99,0x0a,0xf2,0x62,0x1d,0xd0,0x99,0x61,0x22,0x71,0x88,0x88,0x02,0xac,0x00,0xb8 },
+  16, 0xe0f0, 0, {0x22,0x2e,0x20,0x4b,0x88,0x03,0xa0,0x00,0x80,0x00,0x2e,0x08,0x0b,0x80,0x23,0x60 },
+  16, 0xe100, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x04,0xb3,0x03,0x0c,0xcc },
+  16, 0xe110, 0, {0x0a,0x13,0x12,0xcc,0x14,0xa3,0x0e,0x0c,0x58,0x0a,0x33,0x02,0x8c,0x10,0xa3,0x20 },
+  16, 0xe120, 0, {0xa0,0x0a,0x18,0x90,0x02,0x48,0xa0,0xb0,0x20,0x24,0x80,0x0a,0x20,0x02,0xcc,0x09 },
+  16, 0xe130, 0, {0xa1,0x00,0x2c,0x80,0x0b,0x32,0x42,0xa2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe140, 0, {0xe0,0x11,0xac,0x20,0xbb,0x00,0x2e,0xc0,0x4b,0x80,0xa2,0xec,0x00,0xab,0x00,0x4e },
+  16, 0xe150, 0, {0x46,0x2a,0xb0,0x02,0x2c,0x04,0x9b,0x80,0x2a,0x60,0x8a,0x9c,0x02,0xac,0x00,0xb9 },
+  16, 0xe160, 0, {0x81,0x2e,0x40,0x0b,0x98,0x02,0xa3,0x00,0x8a,0x00,0x2e,0x40,0x0b,0x80,0x04,0xf0 },
+  16, 0xe170, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xe1,0x00,0xfb,0x04,0x3e,0xc0 },
+  16, 0xe180, 0, {0x0e,0xb4,0x03,0xec,0x0a,0xdb,0x02,0x2e,0xd1,0x0e,0xb0,0x03,0xac,0x00,0xfb,0x82 },
+  16, 0xe190, 0, {0x32,0x28,0x1e,0x0c,0x03,0x68,0x00,0xb9,0x00,0x3e,0x40,0x4f,0xb0,0x43,0xed,0x00 },
+  16, 0xe1a0, 0, {0xea,0x00,0x3e,0x40,0x0f,0x80,0x03,0x90,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe1b0, 0, {0xc0,0x01,0xb8,0x18,0xff,0x02,0x1f,0xc0,0x0c,0xe2,0x03,0xfc,0x00,0xdf,0x03,0x2f },
+  16, 0xe1c0, 0, {0xa1,0x0f,0x70,0x03,0xfc,0x04,0xab,0x04,0x37,0x42,0x2d,0xd0,0x02,0x7c,0x00,0xfc },
+  16, 0xe1d0, 0, {0x00,0x3f,0x80,0x0f,0xc0,0x03,0xb0,0x00,0xfd,0x00,0x3f,0x80,0x0f,0xf0,0x03,0x78 },
+  16, 0xe1e0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xa9,0x00,0xdb,0x00,0x3c,0xc0 },
+  16, 0xe1f0, 0, {0x2e,0x94,0x01,0x6c,0x11,0xcb,0x00,0xb8,0xc0,0x0c,0xb0,0x03,0x6c,0x00,0xeb,0x01 },
+  16, 0xe200, 0, {0x32,0x10,0x07,0x92,0x03,0xa8,0x00,0xf8,0x00,0x3e,0x0c,0x07,0xa2,0x03,0xad,0x00 },
+  16, 0xe210, 0, {0xd8,0x00,0x32,0x00,0x0c,0x80,0x03,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe220, 0, {0xc8,0x05,0x28,0x08,0xbf,0x00,0x2f,0xc0,0x88,0x80,0x02,0x3c,0x08,0xef,0x03,0x22 },
+  16, 0xe230, 0, {0x00,0x0d,0xf5,0x00,0x3c,0x00,0x8b,0x82,0x22,0x60,0x03,0x9c,0x02,0x2c,0x10,0xb9 },
+  16, 0xe240, 0, {0xb0,0x22,0xf0,0x0b,0x90,0x02,0x20,0x00,0xbb,0x00,0x22,0xe2,0x0d,0xb0,0x02,0xf2 },
+  16, 0xe250, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x40,0x00,0xb3,0x02,0x2c,0xc0 },
+  16, 0xe260, 0, {0x08,0x30,0x02,0x6c,0x00,0x83,0x00,0x20,0xc0,0x09,0x34,0x04,0xec,0x00,0xa8,0x00 },
+  16, 0xe270, 0, {0x22,0xf0,0x0b,0x00,0x02,0x88,0x00,0xb3,0x00,0x28,0xe0,0x0b,0x14,0x02,0xa0,0x00 },
+  16, 0xe280, 0, {0x93,0x00,0x20,0xc0,0x08,0xb0,0x02,0xf8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe290, 0, {0x20,0x01,0x1e,0x04,0xb7,0x80,0x2d,0xe8,0x08,0x78,0x02,0x0e,0xc8,0xa7,0x90,0x21 },
+  16, 0xe2a0, 0, {0xa8,0x19,0x38,0x52,0x9e,0xc1,0x87,0x80,0x21,0xe2,0x0b,0xd9,0x82,0x9e,0x00,0xb6 },
+  16, 0xe2b0, 0, {0xa0,0x2d,0x20,0x0b,0x68,0x02,0x1e,0x00,0xb4,0xc1,0x21,0x20,0x09,0x48,0x02,0xc8 },
+  16, 0xe2c0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x0c,0x80,0xb3,0x10,0x3e,0xe0 },
+  16, 0xe2d0, 0, {0x0e,0x3a,0x07,0x4e,0x00,0xcb,0x90,0x3a,0x61,0x0d,0x38,0x03,0xce,0xd1,0xe1,0x98 },
+  16, 0xe2e0, 0, {0x30,0xa4,0x8f,0x10,0x03,0x88,0x00,0xba,0xa1,0x3c,0x84,0x07,0x00,0x03,0x82,0xd4 },
+  16, 0xe2f0, 0, {0xd1,0x00,0x72,0x80,0x0c,0x30,0x03,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe300, 0, {0x40,0x15,0xbc,0x04,0xff,0x00,0x3f,0xc0,0x0f,0xc2,0x23,0xec,0xb0,0xff,0x00,0x32 },
+  16, 0xe310, 0, {0x04,0x06,0xb4,0x23,0x7c,0x10,0xbf,0x00,0x3e,0x84,0x0f,0xb0,0x03,0x7c,0x40,0xff },
+  16, 0xe320, 0, {0x00,0x33,0x40,0x0f,0xf0,0x03,0xfc,0x00,0xfe,0x00,0xbf,0x40,0x0f,0xc8,0x03,0xd0 },
+  16, 0xe330, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xe4,0x00,0xcb,0x33,0x3e,0xc8 },
+  16, 0xe340, 0, {0x4c,0xb0,0x03,0xac,0x90,0xdb,0xa0,0x36,0xc0,0x0e,0xba,0x43,0x6c,0x00,0xc9,0x00 },
+  16, 0xe350, 0, {0x3e,0x40,0x0f,0x00,0x0f,0x28,0x00,0xfb,0x00,0x3e,0x40,0x0f,0x18,0x43,0x60,0x00 },
+  16, 0xe360, 0, {0xfa,0x00,0x3e,0x40,0x4f,0x08,0x0b,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe370, 0, {0x48,0x11,0x9c,0x10,0x07,0x08,0x2c,0xca,0x08,0x20,0x02,0x1c,0x20,0x87,0x28,0x3f },
+  16, 0xe380, 0, {0x80,0x8a,0xf0,0x02,0x1d,0x40,0x87,0x04,0x2d,0xc0,0x0b,0x70,0x02,0x1c,0x00,0xb6 },
+  16, 0xe390, 0, {0x00,0x2d,0x80,0x0b,0x60,0x03,0x1c,0x00,0xb5,0x00,0x2d,0x80,0x0b,0x70,0x02,0x12 },
+  16, 0xe3a0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x8e,0x00,0x87,0xa0,0x2d,0xe4 },
+  16, 0xe3b0, 0, {0x0a,0x58,0x02,0x1e,0x01,0x83,0x90,0x21,0x70,0x0b,0x79,0x02,0x9e,0x01,0x85,0xc0 },
+  16, 0xe3c0, 0, {0x2d,0xe0,0x4b,0x58,0x12,0x1a,0x00,0xb6,0x80,0x2d,0x20,0x0b,0x48,0x02,0x52,0x00 },
+  16, 0xe3d0, 0, {0xb4,0x80,0x2d,0x20,0x0b,0x48,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe3e0, 0, {0x48,0x14,0xec,0x00,0x83,0x00,0x2c,0xc0,0x88,0x36,0x02,0x0c,0x02,0x83,0x00,0x6c },
+  16, 0xe3f0, 0, {0xc0,0x0b,0x30,0x0a,0xac,0x00,0x9b,0xe0,0x6c,0xc8,0x0b,0x32,0x02,0x0c,0x01,0xb3 },
+  16, 0xe400, 0, {0x00,0x2c,0xc0,0x0b,0x30,0x02,0x0c,0x10,0xb3,0x40,0x2c,0xc0,0x0b,0x3c,0x82,0x12 },
+  16, 0xe410, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xb8,0x02,0xca,0x00,0x3e,0x80 },
+  16, 0xe420, 0, {0x0e,0xe4,0x8b,0x28,0x00,0xca,0x00,0x33,0x95,0x0f,0xa0,0x07,0xa8,0x02,0xce,0x40 },
+  16, 0xe430, 0, {0x3f,0xb0,0x0f,0xe4,0x82,0x28,0x00,0xfa,0x00,0x3e,0x80,0x0f,0xa0,0x23,0x68,0x00 },
+  16, 0xe440, 0, {0xfa,0x40,0x3e,0x81,0x4f,0xa4,0xe3,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe450, 0, {0x48,0x00,0xe0,0x80,0xf0,0x00,0x3c,0x00,0x2f,0x00,0x02,0x60,0x00,0xe8,0x00,0x3c },
+  16, 0xe460, 0, {0x00,0x0e,0x80,0x01,0x20,0x00,0xe8,0x04,0x5e,0x04,0x0f,0x80,0x03,0xe0,0x00,0xfc },
+  16, 0xe470, 0, {0x01,0x3f,0x10,0x0f,0xc4,0x03,0xb0,0x00,0xfc,0x09,0x3f,0x00,0x0f,0xc0,0x03,0xd2 },
+  16, 0xe480, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xa9,0x20,0x36,0x40 },
+  16, 0xe490, 0, {0x0e,0x90,0x03,0x44,0x04,0xd9,0x00,0x3e,0x40,0x0d,0x90,0x03,0xe4,0x04,0xc9,0x00 },
+  16, 0xe4a0, 0, {0x32,0x40,0x8f,0x90,0x0b,0xe4,0x08,0xf9,0x00,0x3e,0x44,0x0e,0x98,0x03,0xe6,0x00 },
+  16, 0xe4b0, 0, {0xf9,0x00,0x3e,0x40,0x0f,0x90,0x03,0xc2,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe4c0, 0, {0x80,0x04,0x64,0x00,0x89,0x00,0x22,0x40,0x18,0x90,0x02,0x24,0x00,0x89,0x00,0x2e },
+  16, 0xe4d0, 0, {0x40,0x08,0x94,0x02,0xe4,0x00,0xd9,0x04,0x22,0x40,0x0b,0x1c,0x0b,0x64,0x00,0xb9 },
+  16, 0xe4e0, 0, {0x94,0x2c,0x50,0x08,0x9c,0x02,0xe4,0x14,0xb9,0x90,0x0e,0x40,0x0b,0x90,0x02,0xe0 },
+  16, 0xe4f0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x02,0x89,0x00,0x26,0x40 },
+  16, 0xe500, 0, {0x4a,0x90,0x02,0x64,0x00,0x99,0x04,0x2e,0x40,0x08,0x98,0x82,0xe4,0x00,0x89,0x00 },
+  16, 0xe510, 0, {0x6a,0x40,0x0a,0x92,0x82,0xe4,0x00,0xbd,0x01,0x2f,0x50,0x12,0xd6,0x02,0xf4,0x40 },
+  16, 0xe520, 0, {0xbd,0x00,0x0f,0x40,0x0b,0xd0,0x02,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe530, 0, {0x08,0x04,0x04,0x80,0x81,0x20,0x20,0x48,0x08,0x12,0x02,0x04,0x80,0x81,0x22,0x2c },
+  16, 0xe540, 0, {0x48,0xa8,0x12,0x06,0xc4,0x90,0x91,0x20,0x28,0x50,0x0b,0x90,0x02,0x45,0x00,0xb5 },
+  16, 0xe550, 0, {0x40,0x6d,0x40,0x08,0x50,0x12,0xd4,0x04,0xb5,0x02,0x2d,0x40,0x0b,0x50,0x02,0xc2 },
+  16, 0xe560, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x61,0x40,0xc8,0x00,0x36,0x14 },
+  16, 0xe570, 0, {0x0a,0x85,0x03,0x41,0x40,0xd8,0x50,0x2e,0x14,0x0c,0x85,0x03,0xc1,0x40,0xc8,0x50 },
+  16, 0xe580, 0, {0xba,0x00,0x0e,0x80,0x23,0xe0,0x00,0x78,0x00,0x3e,0x00,0x0e,0x80,0x03,0xe0,0x04 },
+  16, 0xe590, 0, {0xf8,0x00,0x3e,0x00,0x0f,0xc0,0x03,0xee,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe5a0, 0, {0x98,0x1d,0xf4,0x40,0xd9,0x10,0x3e,0x44,0x07,0xf1,0x03,0xe4,0x40,0xf9,0x10,0x3f },
+  16, 0xe5b0, 0, {0x44,0xaf,0x91,0x03,0xe4,0x40,0xfd,0x10,0x37,0x50,0x0f,0xd0,0x03,0xe4,0x00,0xf9 },
+  16, 0xe5c0, 0, {0x00,0x3e,0x40,0x0f,0x90,0x03,0xe4,0xa0,0xf9,0x28,0x3e,0x4a,0x0f,0x92,0x83,0xe6 },
+  16, 0xe5d0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xe6,0xd4,0xfd,0xa2,0x3a,0x70 },
+  16, 0xe5e0, 0, {0x8c,0x9e,0x03,0x26,0x80,0xc9,0xa0,0x32,0x68,0x0c,0xdb,0x43,0x27,0x80,0x9d,0xa2 },
+  16, 0xe5f0, 0, {0xb7,0x40,0x0f,0x50,0x03,0x65,0x00,0xfd,0x00,0x3f,0xc1,0x07,0xd0,0x03,0xf5,0x04 },
+  16, 0xe600, 0, {0xfd,0x40,0x2f,0xc0,0x0c,0xd0,0x03,0xc6,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe610, 0, {0x38,0x10,0xe3,0x88,0xb8,0x50,0x22,0x38,0x08,0x8e,0x00,0xa2,0xa0,0x88,0xe8,0x22 },
+  16, 0xe620, 0, {0x38,0x48,0x88,0x03,0x62,0x10,0xa8,0xe8,0x3c,0x00,0x0b,0x80,0x03,0x62,0x80,0xb8 },
+  16, 0xe630, 0, {0x01,0x2e,0x80,0x0b,0x80,0x21,0xa2,0x00,0xb0,0x84,0x2e,0x2a,0x28,0x8a,0x82,0xce },
+  16, 0xe640, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x40,0xb1,0x00,0x28,0x58 },
+  16, 0xe650, 0, {0x80,0x13,0x40,0x05,0x00,0x81,0x40,0x20,0x52,0x28,0x16,0x02,0x85,0x80,0x9b,0xc2 },
+  16, 0xe660, 0, {0x64,0x41,0x8b,0x98,0x02,0x04,0x00,0xb1,0x09,0x2c,0x40,0x1b,0x10,0x20,0xc4,0x00 },
+  16, 0xe670, 0, {0xb1,0x00,0x2c,0x40,0x48,0x10,0x02,0xc2,0x05,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe680, 0, {0x18,0x15,0xa5,0x84,0xb9,0x00,0x20,0x40,0x08,0x90,0x02,0x24,0x00,0x01,0x00,0x20 },
+  16, 0xe690, 0, {0x50,0x08,0x90,0x42,0x64,0x00,0xa9,0x10,0xae,0x58,0x03,0x98,0x02,0x64,0x00,0xb9 },
+  16, 0xe6a0, 0, {0x00,0x2e,0x40,0x0b,0x90,0x46,0xa4,0x10,0xb9,0x00,0x2e,0x41,0x08,0x90,0x02,0xc6 },
+  16, 0xe6b0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x11,0xe7,0x00,0xf9,0x00,0x2a,0x40 },
+  16, 0xe6c0, 0, {0x2c,0x94,0x0b,0x24,0x02,0xc9,0x00,0xb2,0x44,0x0c,0x90,0x03,0x24,0x04,0xd9,0x80 },
+  16, 0xe6d0, 0, {0xb6,0x41,0x8f,0x18,0x03,0x24,0x00,0xf9,0x60,0x3e,0x40,0x0f,0x96,0x03,0xe4,0x00 },
+  16, 0xe6e0, 0, {0xf9,0x80,0x3e,0x42,0x8c,0x90,0x03,0xe8,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe6f0, 0, {0x28,0x01,0xa6,0x00,0xf1,0x00,0x3e,0x40,0x0f,0x1c,0x03,0xc4,0x00,0xf9,0x00,0x3e },
+  16, 0xe700, 0, {0x40,0x8f,0x90,0x23,0xc4,0x10,0xf9,0x00,0xbe,0x40,0x0f,0x90,0x0b,0xe4,0x00,0xf9 },
+  16, 0xe710, 0, {0x00,0x3e,0x40,0x07,0x90,0x23,0xe4,0x00,0xf9,0x20,0x3e,0x40,0x8f,0x90,0x03,0xca },
+  16, 0xe720, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa1,0x00,0xf8,0x00,0xbe,0x00 },
+  16, 0xe730, 0, {0x0e,0x84,0x03,0x20,0x00,0xc8,0x00,0x32,0x00,0x0c,0x00,0x83,0x20,0x00,0xf8,0x00 },
+  16, 0xe740, 0, {0x3e,0x00,0x0c,0x80,0x03,0xa0,0x00,0xf8,0x00,0x36,0x10,0x0f,0x80,0x43,0xe0,0x08 },
+  16, 0xe750, 0, {0xf8,0x00,0x32,0x00,0x0f,0x80,0x03,0xca,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe760, 0, {0x28,0x05,0x28,0x00,0xba,0x00,0x22,0x80,0x48,0xa0,0x03,0x68,0x00,0xaa,0x00,0x2a },
+  16, 0xe770, 0, {0x80,0x08,0xe0,0x03,0x68,0x00,0x82,0x00,0x2f,0x80,0x08,0xe6,0x02,0x28,0x04,0xbe },
+  16, 0xe780, 0, {0x40,0x23,0x80,0x0b,0xe8,0x02,0xea,0x00,0xbe,0x01,0x22,0x80,0x0b,0xe0,0x02,0xca },
+  16, 0xe790, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x01,0x93,0x01,0x20,0xc1 },
+  16, 0xe7a0, 0, {0x0a,0x30,0x02,0x0c,0x00,0xa3,0x00,0x20,0xc0,0x88,0x38,0x42,0x0c,0x00,0xa3,0x00 },
+  16, 0xe7b0, 0, {0x24,0xc0,0x0a,0x3e,0x42,0x8c,0x00,0xb2,0x4c,0x24,0xe0,0x4b,0x38,0x02,0xc4,0x41 },
+  16, 0xe7c0, 0, {0xb3,0x00,0x22,0xc0,0x0b,0x10,0x02,0xca,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe7d0, 0, {0xa0,0x01,0x1c,0x00,0xb7,0x00,0x20,0xc9,0x48,0x70,0x02,0xdc,0x40,0xa7,0x14,0x2c },
+  16, 0xe7e0, 0, {0xc8,0x28,0x30,0x82,0x5c,0xc1,0x85,0x00,0x2d,0xe0,0x2a,0xf0,0x12,0x1c,0x80,0xb7 },
+  16, 0xe7f0, 0, {0xa0,0x21,0x82,0x0b,0x70,0x82,0xd4,0x11,0xb6,0x80,0x21,0x40,0x4b,0x50,0x02,0xe8 },
+  16, 0xe800, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0x80,0xd5,0x80,0x29,0xea },
+  16, 0xe810, 0, {0x4e,0x3a,0x07,0x0e,0x80,0xe3,0xb0,0x31,0xfc,0x0c,0x48,0x03,0x0e,0x41,0xe7,0x80 },
+  16, 0xe820, 0, {0x3d,0xe0,0x0e,0x78,0x03,0x9e,0x80,0xf4,0xc4,0x35,0xe0,0x0f,0x78,0x27,0xde,0x00 },
+  16, 0xe830, 0, {0xf5,0x80,0xb1,0xe0,0x0f,0x58,0x03,0xea,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe840, 0, {0x08,0x1d,0xac,0x00,0x31,0x04,0x3a,0xc4,0x0f,0xb5,0x93,0x6d,0x08,0xfb,0x40,0x3a },
+  16, 0xe850, 0, {0xc8,0x63,0x80,0x23,0xec,0x98,0xe9,0x00,0x3e,0xc0,0x0d,0xb0,0x43,0xec,0x00,0xf3 },
+  16, 0xe860, 0, {0x80,0x3e,0x40,0x4f,0xa0,0x03,0xec,0x00,0xf8,0x68,0x3e,0x40,0x8f,0x98,0x03,0xc2 },
+  16, 0xe870, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xfe,0x60,0xeb,0x90,0x3e,0xe4 },
+  16, 0xe880, 0, {0x0f,0xb8,0x00,0x3f,0x40,0xcb,0x80,0x7f,0xe0,0x0e,0xfb,0x03,0x2e,0x40,0xcb,0x80 },
+  16, 0xe890, 0, {0x3f,0xe0,0x0f,0x79,0x43,0x2e,0x60,0xca,0x81,0x33,0x64,0x8f,0xd9,0x03,0xfe,0x00 },
+  16, 0xe8a0, 0, {0xff,0x81,0x33,0xe0,0x0f,0xd9,0x8b,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe8b0, 0, {0xa8,0x01,0x9c,0x00,0x87,0x81,0x19,0xe4,0x0b,0xfa,0x13,0x5e,0x80,0x87,0xb2,0x2d },
+  16, 0xe8c0, 0, {0xec,0x0d,0x79,0x01,0x9e,0x00,0xd5,0x90,0x2d,0xf8,0x0b,0x78,0x03,0x7e,0x08,0xab },
+  16, 0xe8d0, 0, {0x91,0x29,0x85,0x0b,0x51,0x02,0xdc,0x48,0xb6,0x40,0x21,0x40,0x0b,0x50,0x02,0x2a },
+  16, 0xe8e0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8c,0x14,0xb5,0x20,0x6d,0xc8 },
+  16, 0xe8f0, 0, {0x0b,0x72,0x02,0x5c,0x80,0x87,0x20,0x69,0xc0,0x88,0x53,0x02,0xcc,0x81,0x97,0x50 },
+  16, 0xe900, 0, {0x2d,0xc8,0x0b,0xf7,0x0a,0xdc,0xc0,0x84,0x01,0x21,0x44,0x1b,0x70,0x22,0xdc,0x00 },
+  16, 0xe910, 0, {0xb5,0x00,0x21,0xc4,0x0b,0x50,0x86,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe920, 0, {0x20,0x14,0xcf,0x30,0x91,0x00,0x2c,0xc0,0x0b,0x34,0x02,0x4c,0x00,0x83,0x00,0x2c },
+  16, 0xe930, 0, {0xf2,0x0b,0x10,0x22,0x0c,0x00,0x91,0x00,0x2c,0xc8,0x0b,0x18,0x0a,0xcd,0x01,0xa3 },
+  16, 0xe940, 0, {0x00,0x28,0x60,0x0b,0x21,0x02,0xce,0x20,0xb8,0x40,0xa0,0x54,0x0b,0x18,0x02,0x08 },
+  16, 0xe950, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x11,0xbd,0x00,0xf9,0x00,0x2f,0xc0 },
+  16, 0xe960, 0, {0x0f,0xf4,0x02,0x7c,0x12,0xcf,0x03,0x3f,0xc2,0x0e,0xb0,0x03,0xfc,0x04,0x9b,0x02 },
+  16, 0xe970, 0, {0x2e,0xf2,0x0f,0xa4,0x0b,0xdc,0x00,0xce,0x00,0xb0,0xc8,0x8f,0xa4,0x03,0xef,0x00 },
+  16, 0xe980, 0, {0xf8,0x80,0x32,0xf5,0x1f,0xdd,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe990, 0, {0x80,0x00,0xec,0x40,0xe9,0x00,0x3a,0xc0,0x0f,0xb1,0x03,0xcc,0x00,0xf3,0x00,0x3e },
+  16, 0xe9a0, 0, {0xc0,0x0d,0xb4,0x09,0xec,0x18,0xf9,0x10,0x3e,0x10,0x4f,0xb1,0x0a,0x6c,0x80,0xf9 },
+  16, 0xe9b0, 0, {0x89,0x36,0x82,0x0b,0xa6,0x03,0xec,0x50,0xf9,0x50,0x3e,0xc0,0x1f,0x90,0x03,0x60 },
+  16, 0xe9c0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x00,0xfd,0xa0,0x3d,0xc0 },
+  16, 0xe9d0, 0, {0x0c,0x70,0x83,0x2c,0x00,0xef,0x02,0x35,0xc0,0x0d,0xe2,0x03,0xfc,0x04,0xff,0x02 },
+  16, 0xe9e0, 0, {0x2d,0xe0,0x8e,0xf0,0x03,0x3c,0x10,0xdc,0x00,0x3f,0x80,0x0c,0xd8,0x03,0xfc,0x00 },
+  16, 0xe9f0, 0, {0xde,0x18,0x33,0xf0,0x4f,0xd0,0x03,0xc0,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xea00, 0, {0x81,0x00,0x6c,0x00,0xb9,0x00,0x2e,0xc0,0x4c,0xb0,0x03,0x6c,0x00,0x8b,0x02,0x36 },
+  16, 0xea10, 0, {0xc0,0x0d,0xac,0x12,0xec,0x00,0x79,0x00,0x2e,0x30,0x0d,0x3d,0x42,0xac,0x00,0x89 },
+  16, 0xea20, 0, {0x88,0x1a,0x10,0x0d,0x86,0x02,0xee,0x04,0xbb,0x40,0x22,0xe0,0x0b,0x90,0x02,0xe0 },
+  16, 0xea30, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x01,0xb9,0x00,0x2e,0xc0 },
+  16, 0xea40, 0, {0x08,0xb0,0x42,0xac,0x00,0x0b,0x05,0x26,0xc0,0x09,0x94,0x20,0xec,0x00,0xb9,0x80 },
+  16, 0xea50, 0, {0x6e,0xc4,0x88,0xb0,0x82,0x2c,0x00,0x9b,0x82,0x2e,0x42,0x08,0x81,0x02,0xe4,0x80 },
+  16, 0xea60, 0, {0xb8,0x00,0x22,0xc1,0x0b,0x90,0x02,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xea70, 0, {0x08,0x04,0x0c,0x10,0xb1,0x25,0x2c,0xca,0x08,0x34,0x46,0xcc,0x08,0x83,0x00,0x24 },
+  16, 0xea80, 0, {0xc2,0x0b,0x02,0x52,0xcc,0x81,0x83,0x00,0x2c,0x00,0x19,0xb2,0x42,0xac,0x80,0x81 },
+  16, 0xea90, 0, {0x08,0x28,0x80,0x09,0x00,0x02,0xc4,0x40,0xb1,0x00,0x20,0xc0,0x0b,0x10,0x02,0xc2 },
+  16, 0xeaa0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x6c,0x00,0xb9,0x00,0x3f,0xd0 },
+  16, 0xeab0, 0, {0x08,0xf6,0x07,0xbc,0xc2,0xaf,0x30,0x75,0xdc,0x0d,0x16,0x02,0xfc,0xe0,0xb9,0x50 },
+  16, 0xeac0, 0, {0x3e,0xcc,0x0c,0xb0,0x23,0x2c,0x10,0xd9,0x00,0x3e,0x00,0x0c,0x90,0x03,0xec,0x00 },
+  16, 0xead0, 0, {0xde,0x01,0x32,0xc0,0x0f,0x90,0x03,0xc0,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeae0, 0, {0xa0,0x19,0xfc,0x00,0xfd,0x10,0x3f,0xca,0x2e,0xf6,0x03,0x6d,0x94,0x9f,0x30,0x3a },
+  16, 0xeaf0, 0, {0xc9,0x0c,0x83,0x93,0xfc,0x80,0xff,0x11,0x7e,0x19,0x0b,0xb1,0x03,0xfc,0x40,0xfd },
+  16, 0xeb00, 0, {0x08,0x3b,0x00,0x0f,0xc0,0x03,0xfc,0x80,0x77,0x00,0xbf,0xc0,0x0f,0x50,0x03,0xe8 },
+  16, 0xeb10, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0xfc,0x00,0xf4,0x94,0x37,0xc8 },
+  16, 0xeb20, 0, {0x0d,0x69,0x63,0x7c,0x10,0xff,0x62,0x37,0xc0,0x0d,0xb4,0x03,0x7c,0x60,0xd4,0x80 },
+  16, 0xeb30, 0, {0x3f,0x40,0x0f,0x48,0x23,0x32,0x00,0xce,0x00,0xbf,0x40,0x8f,0xd1,0x03,0x30,0xe0 },
+  16, 0xeb40, 0, {0xff,0x30,0x3b,0x60,0x0f,0xd8,0x03,0xb0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeb50, 0, {0x80,0x10,0xed,0x20,0xb8,0x24,0x23,0xf4,0x49,0xa2,0x02,0x3f,0x40,0x8f,0x51,0x23 },
+  16, 0xeb60, 0, {0xda,0x08,0xf6,0x12,0x3d,0x80,0x9b,0x80,0x2e,0x49,0x4b,0x80,0x03,0x40,0x00,0xd9 },
+  16, 0xeb70, 0, {0x01,0x22,0x74,0x0b,0xd5,0x02,0x21,0x00,0xbf,0x42,0x2e,0x49,0x0b,0x9c,0x02,0xe0 },
+  16, 0xeb80, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcd,0x80,0xb8,0x20,0x28,0xc1 },
+  16, 0xeb90, 0, {0x1b,0xa0,0x02,0x4c,0x00,0x93,0x20,0x2c,0xd8,0x0b,0x34,0x02,0xcc,0x00,0x90,0x01 },
+  16, 0xeba0, 0, {0x2c,0xc6,0x1a,0xa0,0x02,0x68,0x08,0x83,0x00,0xa4,0x40,0x0b,0x10,0x02,0x00,0x00 },
+  16, 0xebb0, 0, {0xb3,0x10,0x28,0x42,0x0b,0x14,0x02,0xa2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xebc0, 0, {0xc0,0x15,0xac,0x00,0xb8,0x60,0x2a,0xc0,0x1b,0xa0,0x8e,0xac,0x01,0x9b,0x05,0x26 },
+  16, 0xebd0, 0, {0xc0,0x03,0xb0,0x42,0x6c,0x00,0x9b,0x80,0x2e,0xc0,0x03,0xa0,0x06,0x69,0x00,0x99 },
+  16, 0xebe0, 0, {0x80,0xaa,0xc0,0x0b,0x90,0x02,0x63,0x00,0x3b,0x00,0x2e,0x58,0x4b,0x90,0x02,0xf0 },
+  16, 0xebf0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x11,0xec,0x04,0xf8,0x80,0xba,0xc0 },
+  16, 0xec00, 0, {0x0f,0x30,0x03,0x6c,0x10,0xdb,0x03,0x36,0xc0,0x8f,0xb0,0x03,0xec,0x08,0xd8,0x80 },
+  16, 0xec10, 0, {0x7e,0xe0,0x06,0x88,0x03,0x41,0x08,0xcb,0xa0,0x3e,0x64,0x0f,0x90,0x0b,0x2a,0x00 },
+  16, 0xec20, 0, {0x7b,0x00,0x3a,0x01,0x0f,0x90,0x03,0x90,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xec30, 0, {0xe0,0x01,0xbc,0x00,0xfc,0x84,0x32,0xc0,0x0c,0xf9,0x03,0x5c,0x10,0xef,0x00,0x3b },
+  16, 0xec40, 0, {0xc0,0x0c,0x70,0x03,0x9c,0x00,0xec,0x01,0x3f,0xe4,0x4f,0xd1,0x03,0xf1,0x00,0xf3 },
+  16, 0xec50, 0, {0x05,0x33,0x60,0x0f,0xd0,0x03,0xbc,0x04,0xff,0x00,0x3f,0x21,0x0f,0xd0,0x03,0xf8 },
+  16, 0xec60, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xc8,0x40,0x3a,0xc6 },
+  16, 0xec70, 0, {0x0d,0xb4,0x03,0x6c,0x00,0xf3,0x00,0x34,0xc0,0x0e,0xb0,0x03,0x6c,0x00,0xe9,0x10 },
+  16, 0xec80, 0, {0x3a,0xc0,0x0f,0x84,0x03,0x2c,0x60,0xcb,0x00,0x32,0x60,0x0c,0x50,0x03,0x61,0x00 },
+  16, 0xec90, 0, {0xcb,0x00,0x3e,0x90,0x0e,0x90,0xa3,0x90,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeca0, 0, {0xc8,0x05,0x3c,0x02,0x88,0x01,0x01,0xf0,0x20,0xb0,0x01,0x3e,0x00,0x3f,0x00,0x33 },
+  16, 0xecb0, 0, {0xc0,0x0b,0xf0,0x32,0x3c,0x08,0x89,0x80,0x22,0xc0,0x01,0x15,0x12,0xac,0x00,0x8b },
+  16, 0xecc0, 0, {0x00,0x22,0xc0,0x48,0xdb,0x02,0x2f,0x40,0x8f,0x00,0x2e,0x01,0x08,0xd4,0x80,0x32 },
+  16, 0xecd0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x00,0x08,0x00,0x08,0xf0 },
+  16, 0xece0, 0, {0x08,0x00,0x12,0x4c,0x00,0x33,0x01,0x24,0xc0,0x4a,0x30,0x02,0x4c,0x00,0xa0,0x20 },
+  16, 0xecf0, 0, {0x28,0xc0,0x0b,0x10,0x02,0x46,0x04,0x83,0x04,0x20,0xc0,0x29,0x18,0x02,0x04,0x40 },
+  16, 0xed00, 0, {0xb3,0x00,0x2c,0x40,0x0a,0x1c,0x42,0xb1,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xed10, 0, {0x20,0x01,0x1e,0x01,0x8d,0x80,0x21,0xe0,0x18,0xc8,0x02,0x1e,0x00,0xb3,0xa0,0x21 },
+  16, 0xed20, 0, {0xe0,0x1b,0x38,0x02,0x0e,0x01,0xa7,0x80,0x21,0xe0,0x09,0xd8,0x40,0xd6,0x40,0x87 },
+  16, 0xed30, 0, {0x80,0x01,0xe0,0x09,0x59,0x02,0x16,0x00,0x97,0x84,0x2d,0x60,0x08,0x58,0x40,0x00 },
+  16, 0xed40, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x2c,0x40,0xc0,0x00,0x38,0xc4 },
+  16, 0xed50, 0, {0x0c,0x30,0x27,0x4c,0x20,0xf3,0x01,0x34,0xc1,0x0e,0x3a,0x03,0x4c,0xc4,0xe0,0x00 },
+  16, 0xed60, 0, {0x18,0xc8,0x0f,0x34,0x03,0x44,0x40,0xc3,0x00,0x30,0xc0,0x0d,0x90,0x03,0x2e,0x00 },
+  16, 0xed70, 0, {0xf3,0x00,0x3e,0x40,0x0e,0x10,0x01,0x9a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xed80, 0, {0x40,0x1d,0xbc,0x00,0xf9,0x00,0x0e,0xd4,0x0e,0xb0,0x03,0xec,0x20,0xfb,0x20,0x3f },
+  16, 0xed90, 0, {0xc4,0x0f,0xf1,0x03,0xec,0x60,0xdb,0x10,0x3f,0xc0,0x4f,0xf0,0x03,0xa4,0x46,0xfb },
+  16, 0xeda0, 0, {0x00,0xbd,0xc0,0x0e,0xd0,0x0b,0xb4,0x00,0xef,0x48,0x3f,0x40,0x0f,0x50,0x03,0xd0 },
+  16, 0xedb0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x00,0xf8,0x00,0x32,0xd4 },
+  16, 0xedc0, 0, {0x0f,0x80,0x03,0xad,0x00,0xeb,0x08,0x22,0xd2,0x0c,0xb6,0x03,0x6c,0x00,0xf2,0x80 },
+  16, 0xedd0, 0, {0x36,0xc0,0x0e,0xa0,0x03,0x28,0x10,0xcb,0x00,0xb2,0xc0,0x0f,0xd6,0x03,0x28,0x10 },
+  16, 0xede0, 0, {0xfb,0x20,0x3e,0x40,0x4f,0x99,0x13,0x2b,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xedf0, 0, {0x48,0x11,0x9d,0x10,0xb4,0x01,0x21,0xc1,0x8b,0xc0,0x02,0x1c,0xa0,0xbf,0x04,0x27 },
+  16, 0xee00, 0, {0xc8,0x08,0x75,0x02,0x1c,0xc0,0xb6,0x00,0x21,0xc0,0x08,0xf0,0x42,0x18,0x10,0x8f },
+  16, 0xee10, 0, {0x00,0x21,0xc0,0x0b,0x54,0xa2,0x1c,0x00,0xb7,0x04,0x2d,0x41,0x0b,0x52,0x02,0x12 },
+  16, 0xee20, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x80,0xb6,0x88,0xa5,0xe0 },
+  16, 0xee30, 0, {0x0b,0x78,0x12,0x9e,0x81,0xa7,0x90,0x25,0xe4,0x88,0x78,0x02,0x1e,0x80,0xbf,0x80 },
+  16, 0xee40, 0, {0x24,0x60,0x0b,0x68,0x02,0x1e,0x00,0x87,0x84,0x61,0xe0,0x0a,0x1a,0x0a,0x1a,0x00 },
+  16, 0xee50, 0, {0xb7,0xa0,0x2d,0xe0,0x0b,0xda,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xee60, 0, {0x48,0x14,0xcc,0x00,0xba,0xc0,0xa4,0xc0,0x0b,0x34,0x02,0x0c,0x00,0xb3,0x00,0x24 },
+  16, 0xee70, 0, {0xc0,0x08,0xb0,0x0e,0x2c,0x00,0xb3,0x98,0x20,0x60,0x09,0x33,0x02,0x2c,0x00,0xa3 },
+  16, 0xee80, 0, {0xc8,0x20,0xc0,0x0b,0x10,0x02,0x0c,0x00,0xb3,0x00,0x2c,0xf0,0x0b,0x10,0x02,0x12 },
+  16, 0xee90, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x00,0xfe,0x80,0x36,0x81 },
+  16, 0xeea0, 0, {0x0b,0xe0,0x03,0xa8,0x00,0xea,0x00,0xb2,0x80,0x08,0xa0,0x03,0x68,0x00,0xfe,0x00 },
+  16, 0xeeb0, 0, {0x36,0xa0,0x1f,0xe8,0x13,0x3b,0x82,0xce,0xe0,0x22,0x80,0x8e,0xa0,0x03,0x38,0x00 },
+  16, 0xeec0, 0, {0xba,0x00,0x3f,0xa2,0x0f,0xa0,0x03,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeed0, 0, {0x48,0x00,0xe0,0x00,0xf8,0x20,0x3a,0x10,0x07,0x80,0x03,0xc1,0x00,0xf8,0x00,0x38 },
+  16, 0xeee0, 0, {0x00,0x2f,0x80,0x03,0xa0,0x01,0xf8,0x42,0x3e,0x05,0x0e,0x80,0x0b,0xe0,0x80,0xd8 },
+  16, 0xeef0, 0, {0x00,0x3e,0x00,0x0f,0x84,0x03,0xe1,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x84,0x0b,0xd2 },
+  16, 0xef00, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xc9,0x00,0x3a,0x50 },
+  16, 0xef10, 0, {0x8f,0x90,0x83,0xa4,0x02,0xd1,0x00,0xb2,0x40,0x4c,0x90,0x23,0x24,0x08,0xc9,0x01 },
+  16, 0xef20, 0, {0x3e,0x40,0x0c,0x90,0x03,0x24,0x00,0xc1,0x00,0x32,0x40,0x0f,0x14,0x0a,0x25,0x20 },
+  16, 0xef30, 0, {0xe9,0x00,0x3e,0x42,0x0f,0x90,0x03,0xc2,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xef40, 0, {0x80,0x04,0x64,0x0a,0x89,0x00,0x22,0x70,0x0b,0x90,0x12,0x25,0x80,0xc9,0x00,0x22 },
+  16, 0xef50, 0, {0x40,0x0a,0x90,0x03,0x64,0x00,0x89,0x20,0x2c,0x40,0x0a,0x90,0x0a,0x24,0x00,0x89 },
+  16, 0xef60, 0, {0xc1,0x32,0x40,0x0b,0x98,0x02,0x06,0x00,0x89,0x90,0x2e,0x40,0x0b,0x94,0x12,0xe0 },
+  16, 0xef70, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0x04,0x00,0x89,0x00,0x6a,0x42 },
+  16, 0xef80, 0, {0x0a,0x10,0x02,0xa4,0x00,0x89,0x00,0xa2,0x40,0x0a,0x90,0x02,0x24,0x00,0x09,0x00 },
+  16, 0xef90, 0, {0x2e,0x40,0x58,0x10,0x02,0x24,0x00,0x89,0x80,0xaa,0x60,0x0b,0x90,0x02,0xa4,0x04 },
+  16, 0xefa0, 0, {0xa9,0x00,0x2e,0x40,0x0b,0x94,0x02,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xefb0, 0, {0x08,0x04,0x04,0x80,0x81,0x00,0x60,0x48,0x0b,0x10,0x02,0x04,0x81,0x81,0x20,0x60 },
+  16, 0xefc0, 0, {0x48,0x0a,0x12,0x02,0x44,0x88,0x81,0x00,0x0e,0x59,0x0a,0x14,0x02,0x05,0x00,0x81 },
+  16, 0xefd0, 0, {0xc0,0x28,0x50,0x49,0x30,0x02,0x8c,0x84,0x01,0x60,0x2c,0x50,0x0b,0x10,0x02,0xc2 },
+  16, 0xefe0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x61,0x40,0xc0,0x54,0x2a,0x00 },
+  16, 0xeff0, 0, {0x0e,0x85,0x03,0xa0,0x00,0xc8,0x50,0x32,0x15,0x1e,0x05,0x22,0x21,0x42,0xc8,0x00 },
+  16, 0xf000, 0, {0x3e,0x00,0x0c,0x80,0x03,0x00,0x04,0xc8,0x00,0x3a,0x00,0x4f,0x85,0x03,0xa1,0x40 },
+  16, 0xf010, 0, {0x68,0x00,0x3e,0x00,0x0f,0x80,0x03,0xee,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf020, 0, {0x98,0x1d,0xe4,0x40,0xfd,0x03,0x3e,0x44,0x0f,0xd0,0x03,0xe4,0x48,0xe9,0x10,0x3e },
+  16, 0xf030, 0, {0x45,0x0f,0x91,0x13,0xe4,0x40,0xfd,0x00,0x3f,0x44,0x0f,0xd0,0x03,0xf4,0x02,0xfd },
+  16, 0xf040, 0, {0x40,0x33,0x50,0x0f,0xd4,0x23,0x74,0x40,0xf9,0x10,0x3f,0x40,0x0f,0x54,0x03,0xe6 },
+  16, 0xf050, 0, {0x02,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xe4,0x00,0xf9,0x01,0x33,0x6a },
+  16, 0xf060, 0, {0x09,0x90,0x03,0xb6,0x34,0xf9,0xc8,0x32,0x64,0x0c,0x9a,0x03,0xe6,0xa0,0xdd,0x00 },
+  16, 0xf070, 0, {0x3c,0x70,0x0f,0x90,0x03,0xa5,0x00,0x89,0x80,0x33,0x32,0x0f,0xd8,0x13,0x3c,0x00 },
+  16, 0xf080, 0, {0xfd,0x00,0x70,0x50,0x0f,0xd0,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf090, 0, {0x38,0x10,0xe2,0x80,0xb8,0xa8,0x22,0x10,0x08,0x88,0x02,0x21,0x00,0xb8,0xc0,0x20 },
+  16, 0xf0a0, 0, {0x30,0x0d,0x8e,0x87,0x83,0x88,0x88,0x00,0x2e,0x34,0x0b,0x8a,0x82,0x22,0x80,0xdc },
+  16, 0xf0b0, 0, {0xe0,0x22,0x38,0x0b,0x80,0x02,0x20,0x00,0xf8,0xa8,0x2a,0x28,0x0b,0x80,0x02,0x0e },
+  16, 0xf0c0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x20,0xb1,0x00,0x20,0x40 },
+  16, 0xf0d0, 0, {0x0a,0x92,0x92,0x84,0x11,0xb1,0x24,0x68,0x58,0x09,0x11,0x02,0xc4,0x20,0x91,0x01 },
+  16, 0xf0e0, 0, {0x2c,0x48,0x1b,0x50,0x02,0x74,0x84,0x95,0x48,0xac,0x48,0x0b,0x94,0x02,0x04,0x04 },
+  16, 0xf0f0, 0, {0xb1,0x02,0x24,0x48,0x0b,0x10,0x02,0x02,0x05,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf100, 0, {0x18,0x11,0xa4,0x00,0xb1,0x20,0x22,0x40,0x0a,0x90,0x06,0x2c,0x01,0xb9,0x00,0x2a },
+  16, 0xf110, 0, {0x40,0x09,0x90,0x02,0xa4,0x00,0x9b,0x08,0x2e,0x48,0x0b,0x12,0x1a,0x74,0x00,0x95 },
+  16, 0xf120, 0, {0x45,0x2e,0x60,0x03,0x90,0x02,0x24,0x00,0xb9,0x00,0x2e,0x40,0x0b,0x90,0x02,0x06 },
+  16, 0xf130, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x00,0xf9,0x80,0x30,0x40 },
+  16, 0xf140, 0, {0x0e,0x16,0x03,0xa4,0x00,0xb9,0x04,0x32,0x40,0x0d,0x90,0x02,0xe4,0x00,0xd9,0x40 },
+  16, 0xf150, 0, {0x2e,0x40,0x1f,0x98,0x03,0xe5,0x80,0xd9,0x00,0xae,0x60,0x07,0x10,0x0b,0x26,0x01 },
+  16, 0xf160, 0, {0xb9,0x00,0xa6,0x40,0x0f,0x90,0x0b,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf170, 0, {0x28,0x01,0xa4,0x00,0xf9,0x00,0xbe,0x40,0xac,0x92,0x03,0xe4,0x00,0xf9,0x00,0xb4 },
+  16, 0xf180, 0, {0x40,0x0f,0x90,0x03,0xe4,0x00,0xe9,0x00,0x3e,0x60,0x0f,0x90,0x03,0xa4,0x80,0xf9 },
+  16, 0xf190, 0, {0x00,0x32,0x00,0x0f,0x90,0x83,0xe6,0x85,0xe1,0x00,0x32,0x44,0x0f,0x10,0x03,0xca },
+  16, 0xf1a0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xf8,0x00,0x32,0x00 },
+  16, 0xf1b0, 0, {0x0f,0x80,0x13,0xe0,0x94,0xe0,0x00,0x32,0x00,0x0c,0x80,0x03,0x60,0x00,0xc8,0x00 },
+  16, 0xf1c0, 0, {0x3e,0x00,0x0d,0x80,0x43,0x20,0x08,0xf8,0x00,0x32,0x00,0x0f,0x80,0x03,0xe0,0x40 },
+  16, 0xf1d0, 0, {0xf8,0x00,0x32,0x00,0x4c,0x80,0x23,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf1e0, 0, {0x28,0x05,0x28,0x00,0xba,0x00,0x23,0x80,0x0b,0xa0,0x02,0xfb,0x04,0x6a,0x00,0x22 },
+  16, 0xf1f0, 0, {0x80,0x0a,0xa0,0x03,0x68,0x0a,0x8e,0x88,0x3a,0x80,0x08,0xa0,0x02,0x08,0x00,0xba },
+  16, 0xf200, 0, {0x00,0xb7,0x22,0x03,0xe4,0x02,0xfa,0x00,0x8a,0x00,0x22,0x80,0x08,0xe8,0x02,0xca },
+  16, 0xf210, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0xb3,0x00,0x60,0x41 },
+  16, 0xf220, 0, {0x03,0x30,0x02,0xcc,0x41,0xa3,0x00,0x04,0xc0,0x0b,0x30,0x02,0x2c,0x00,0xa3,0x80 },
+  16, 0xf230, 0, {0x2c,0xc0,0x09,0x38,0x02,0x0c,0x00,0xb3,0x00,0xa0,0xc0,0x0b,0x34,0x02,0xcc,0x80 },
+  16, 0xf240, 0, {0xa1,0x00,0x20,0xc0,0x08,0x38,0x02,0xca,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf250, 0, {0xa0,0x01,0x1c,0x40,0xb7,0x00,0x61,0x00,0x0b,0x71,0x02,0xdc,0x00,0xa3,0x00,0x25 },
+  16, 0xf260, 0, {0xc8,0x19,0x38,0x02,0x5c,0x80,0xa7,0x00,0x0f,0xe8,0x09,0x64,0x22,0x10,0x00,0xb3 },
+  16, 0xf270, 0, {0x00,0x25,0xc8,0x0b,0x60,0x02,0xf2,0x00,0x85,0x01,0x23,0xe8,0x08,0x70,0x82,0xe8 },
+  16, 0xf280, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0x20,0xff,0x80,0xa1,0xa0 },
+  16, 0xf290, 0, {0x0f,0x7a,0x42,0xda,0x00,0xe7,0xe8,0x35,0xf0,0x2f,0x7b,0x62,0x1e,0x82,0xe6,0x80 },
+  16, 0xf2a0, 0, {0x1d,0xe0,0x0d,0xf8,0x0b,0x1e,0x00,0xf7,0x80,0x31,0xf0,0x0f,0x78,0x03,0xde,0x0c },
+  16, 0xf2b0, 0, {0xef,0x80,0x31,0xf8,0x2c,0x78,0x03,0xea,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf2c0, 0, {0x08,0x1d,0xad,0x84,0xfb,0x68,0x3e,0x00,0x0f,0xb0,0x03,0xe8,0x00,0xfb,0x00,0xfa },
+  16, 0xf2d0, 0, {0xd8,0x0e,0xb5,0x03,0xed,0x00,0xdb,0x00,0x3a,0xc0,0x8e,0xa0,0x03,0xe0,0x00,0xfb },
+  16, 0xf2e0, 0, {0x40,0x3e,0xc0,0x0b,0xb0,0x43,0xc4,0x04,0xef,0x02,0xbf,0xc0,0x0f,0xb0,0x03,0xc2 },
+  16, 0xf2f0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xfe,0x42,0xc7,0x38,0x33,0x64 },
+  16, 0xf300, 0, {0x0e,0x7c,0x03,0x5e,0x00,0xdf,0xa0,0x37,0xf0,0x0d,0xf8,0x03,0xff,0x20,0xcf,0x81 },
+  16, 0xf310, 0, {0x33,0xe2,0x0c,0xd8,0x03,0xbe,0x00,0x7f,0xc0,0x33,0xe0,0x0c,0xf9,0x03,0x7e,0x00 },
+  16, 0xf320, 0, {0xfd,0x80,0x3f,0xe0,0x0f,0xf8,0x03,0xc0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf330, 0, {0xa8,0x11,0x9c,0x00,0x87,0xa0,0x21,0x14,0x08,0x71,0x02,0x14,0x10,0xd7,0x20,0x35 },
+  16, 0xf340, 0, {0xc0,0x0c,0x70,0x03,0xbc,0x00,0x85,0x08,0x2b,0xc0,0x4d,0x46,0x02,0xd1,0x00,0xb7 },
+  16, 0xf350, 0, {0x00,0x21,0xc0,0x08,0x60,0x02,0x08,0x80,0xf5,0x20,0x3d,0xca,0x0f,0x54,0x03,0xea },
+  16, 0xf360, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x11,0x8f,0x01,0x20,0x84 },
+  16, 0xf370, 0, {0x1a,0xf0,0x02,0x18,0x00,0xa7,0x34,0x65,0xc0,0x09,0x71,0x02,0xdc,0x00,0x8e,0x00 },
+  16, 0xf380, 0, {0x29,0xc0,0x08,0x50,0x06,0x9c,0x00,0xbf,0x88,0x2d,0xc4,0x0a,0x60,0x26,0x58,0x24 },
+  16, 0xf390, 0, {0x97,0x00,0x6d,0xc0,0x9b,0x70,0x02,0xc0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf3a0, 0, {0x20,0x14,0xcc,0x00,0x8b,0x40,0x20,0x00,0x18,0x30,0x02,0x00,0x00,0xbb,0x02,0x24 },
+  16, 0xf3b0, 0, {0xc0,0x08,0x30,0x20,0xcc,0x00,0x81,0xc0,0x28,0xc0,0x0b,0x04,0x82,0xe0,0x10,0xbb },
+  16, 0xf3c0, 0, {0xa0,0x2c,0xe0,0x0a,0x20,0x06,0x00,0x00,0xb3,0x00,0x28,0xc0,0x0a,0x10,0x02,0x88 },
+  16, 0xf3d0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xbc,0x00,0xcf,0x10,0x32,0x00 },
+  16, 0xf3e0, 0, {0x0e,0xf0,0x0b,0x24,0x00,0xef,0x00,0x37,0xc0,0x0d,0xf0,0x03,0xfc,0x06,0xc1,0x50 },
+  16, 0xf3f0, 0, {0x3b,0xc0,0x0c,0xb4,0x03,0xac,0x00,0xf8,0xc0,0xbe,0xc8,0x2e,0xb0,0x03,0x6e,0x01 },
+  16, 0xf400, 0, {0xfb,0x00,0x2d,0xc0,0x4b,0x90,0x02,0xea,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf410, 0, {0x80,0x00,0xec,0x04,0xfb,0x00,0x3e,0x00,0x0f,0xb0,0x03,0xad,0x00,0x9b,0x00,0x3e },
+  16, 0xf420, 0, {0xc0,0x0f,0x30,0x03,0xac,0x00,0xf8,0x00,0x2e,0xc0,0x05,0xb4,0x03,0xed,0x00,0xf8 },
+  16, 0xf430, 0, {0x40,0x32,0xc0,0x09,0x00,0x03,0xe0,0x91,0xe3,0x00,0x3e,0xc0,0x0f,0x90,0x11,0xe0 },
+  16, 0xf440, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xec,0x00,0xef,0x00,0x33,0x20 },
+  16, 0xf450, 0, {0x4f,0xf0,0x03,0xb4,0x00,0xef,0x03,0x3a,0xc0,0x0f,0xf0,0x03,0x3c,0x00,0xdc,0x00 },
+  16, 0xf460, 0, {0x31,0xc0,0x8d,0xf8,0x03,0xfe,0x04,0xcf,0x00,0x32,0xc8,0x0c,0xf0,0x0b,0x1c,0x00 },
+  16, 0xf470, 0, {0xcf,0x93,0x33,0xc0,0x8c,0x40,0x02,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf480, 0, {0x81,0x04,0x6c,0x00,0xbb,0x00,0xa2,0x04,0x0b,0x30,0x02,0x0e,0x00,0xab,0x00,0x2a },
+  16, 0xf490, 0, {0xc0,0x09,0xb0,0x03,0x6c,0x08,0xa8,0xc0,0x36,0xc0,0x08,0xbc,0x02,0xef,0x02,0xab },
+  16, 0xf4a0, 0, {0xd0,0x20,0xe0,0x08,0xb8,0x22,0x26,0x10,0x8b,0x00,0x22,0xc0,0x20,0x9c,0x02,0x20 },
+  16, 0xf4b0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0xbb,0x00,0x26,0x00 },
+  16, 0xf4c0, 0, {0x0a,0xb0,0x02,0xa2,0x08,0xab,0x00,0x6a,0xc0,0x0b,0xb0,0x0a,0x0c,0x00,0x8b,0x80 },
+  16, 0xf4d0, 0, {0x22,0xc0,0x09,0xb1,0x02,0xec,0x40,0x88,0x08,0x22,0xc0,0x08,0xb8,0x02,0x26,0x00 },
+  16, 0xf4e0, 0, {0x8b,0x00,0x22,0xc0,0x08,0x98,0x02,0xa0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf4f0, 0, {0x08,0x04,0x0c,0x00,0xb3,0x00,0x24,0x00,0x0b,0xb0,0x02,0x00,0x01,0x83,0x00,0x20 },
+  16, 0xf500, 0, {0xc0,0x09,0x30,0x02,0x4c,0x00,0x00,0x04,0x24,0xc0,0x08,0x30,0x06,0x4c,0x00,0x80 },
+  16, 0xf510, 0, {0x00,0x2c,0xc0,0x08,0x00,0x02,0x00,0x41,0x83,0x00,0xa2,0xc0,0x08,0x10,0x0a,0x82 },
+  16, 0xf520, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x7c,0x00,0xef,0x08,0x26,0x00 },
+  16, 0xf530, 0, {0x0e,0xf0,0x02,0xa0,0x00,0xe7,0x00,0x3b,0xc0,0x0f,0xf5,0x43,0x3c,0x02,0xda,0x00 },
+  16, 0xf540, 0, {0x32,0xc0,0x0d,0xb0,0x03,0xec,0x00,0xcb,0x00,0xb2,0xc0,0x0c,0xa0,0x03,0x28,0x10 },
+  16, 0xf550, 0, {0xcb,0x00,0x32,0xc0,0x0c,0x80,0x03,0x80,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf560, 0, {0xa0,0x0d,0xfc,0x00,0xfb,0x00,0x3b,0x00,0x0f,0xf0,0x03,0xf0,0x00,0xff,0x02,0x3f },
+  16, 0xf570, 0, {0xc0,0x0d,0xf2,0x03,0xbc,0x00,0xf4,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0xfc,0x00,0xf7 },
+  16, 0xf580, 0, {0x00,0x33,0xc0,0x0f,0x60,0x03,0xf0,0x88,0xff,0x00,0x3f,0xc0,0x4f,0xd0,0x03,0x68 },
+  16, 0xf590, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfc,0x40,0xfc,0x31,0x3b,0x08 },
+  16, 0xf5a0, 0, {0x4f,0xf9,0x43,0xef,0x00,0xdf,0x30,0x32,0x21,0x0f,0x94,0x07,0x7d,0x80,0xef,0x38 },
+  16, 0xf5b0, 0, {0x32,0x09,0x1c,0x38,0x03,0xf2,0x21,0xfd,0x00,0x33,0xc4,0x0c,0xf0,0x02,0xfc,0x00 },
+  16, 0xf5c0, 0, {0xdf,0x00,0x33,0xc0,0x0f,0xf0,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf5d0, 0, {0x80,0x10,0xec,0x88,0x8b,0x60,0x22,0xe5,0x0e,0xb2,0x22,0xec,0x80,0xaf,0x11,0x2a },
+  16, 0xf5e0, 0, {0x20,0x0b,0xb1,0x13,0xac,0x48,0x8b,0x45,0x34,0xcc,0x48,0xb0,0x02,0x6b,0x00,0xba },
+  16, 0xf5f0, 0, {0x82,0x36,0x00,0x08,0x88,0x22,0xc0,0x04,0x88,0x00,0xa2,0x08,0x8b,0x88,0x62,0x20 },
+  16, 0xf600, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x00,0xa1,0x30,0x28,0x00 },
+  16, 0xf610, 0, {0x0b,0x32,0x02,0xcc,0x00,0xa3,0x22,0x2c,0x00,0x8b,0x12,0x06,0xc8,0x80,0xa3,0x00 },
+  16, 0xf620, 0, {0x20,0x02,0xca,0x30,0x06,0xc4,0x01,0xb1,0x00,0x68,0x80,0x09,0x20,0x02,0x88,0x00 },
+  16, 0xf630, 0, {0x83,0x00,0x20,0xc2,0x0b,0x00,0x0a,0xa2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf640, 0, {0xc0,0x15,0xac,0x00,0x8b,0x61,0x62,0xc0,0x0b,0xb2,0x02,0xe8,0x00,0xab,0x02,0x2a },
+  16, 0xf650, 0, {0x61,0x1b,0x90,0x02,0xa8,0x00,0xab,0x00,0x20,0xc0,0x0a,0xb0,0x02,0x6c,0x04,0xba },
+  16, 0xf660, 0, {0x00,0x2e,0x40,0x89,0x90,0x02,0xe6,0x08,0x98,0x00,0x22,0x00,0x0b,0xb0,0x02,0xb0 },
+  16, 0xf670, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xee,0x00,0xf8,0x01,0x3a,0x04 },
+  16, 0xf680, 0, {0x0f,0xac,0x03,0xec,0x90,0xfb,0x02,0x3e,0xe0,0x0b,0x90,0x42,0x67,0x80,0xa8,0xc4 },
+  16, 0xf690, 0, {0x22,0x48,0x22,0x86,0x03,0xe1,0x40,0xb8,0x02,0x2a,0x40,0x29,0x90,0x03,0xec,0x02 },
+  16, 0xf6a0, 0, {0xc9,0x48,0x32,0x40,0x0f,0xb0,0x13,0x90,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf6b0, 0, {0xe0,0x01,0xac,0x40,0xfb,0x00,0x1f,0xa2,0x0e,0xf8,0x82,0xfc,0x08,0xff,0x00,0x3f },
+  16, 0xf6c0, 0, {0xc0,0x0f,0xfa,0x43,0x96,0x44,0xd4,0x91,0x3f,0x40,0x0d,0xc0,0x03,0xfa,0x00,0xff },
+  16, 0xf6d0, 0, {0x08,0x25,0x80,0x0e,0xe0,0x03,0xd0,0x00,0xea,0x00,0x3f,0x80,0x0f,0xc0,0x03,0x78 },
+  16, 0xf6e0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xe1,0x20,0x3a,0x50 },
+  16, 0xf6f0, 0, {0x0f,0x90,0x03,0x2c,0x00,0xeb,0x08,0x76,0x05,0x0e,0xb0,0x27,0xe0,0x10,0xea,0x40 },
+  16, 0xf700, 0, {0xb2,0xc0,0x0c,0xa4,0x43,0x25,0x00,0xf8,0x00,0x32,0x08,0x0f,0x80,0x43,0xe8,0x00 },
+  16, 0xf710, 0, {0xd1,0x08,0xee,0x40,0x0f,0x00,0x03,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf720, 0, {0xc8,0x05,0x2c,0x00,0x8b,0x00,0x22,0xd0,0x0b,0x90,0x82,0x2c,0x00,0x87,0x40,0x22 },
+  16, 0xf730, 0, {0x60,0x8b,0xb0,0x02,0xe0,0x00,0xd8,0x50,0x22,0xd0,0x0c,0xa0,0x03,0x6c,0x00,0xb3 },
+  16, 0xf740, 0, {0xc8,0x3e,0xd0,0x0b,0xb8,0x02,0x25,0x08,0x8a,0x20,0x2a,0x80,0x8b,0xb8,0x82,0xf2 },
+  16, 0xf750, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x64,0x00,0xa0,0xc0,0x24,0xc0 },
+  16, 0xf760, 0, {0x09,0x38,0x02,0x2c,0x00,0x83,0x03,0x20,0x00,0x10,0x30,0x22,0xcc,0x00,0x83,0x00 },
+  16, 0xf770, 0, {0x60,0x08,0x0a,0x30,0x82,0x4c,0x00,0xb1,0xc0,0x00,0xd1,0x0b,0x38,0x02,0x84,0x80 },
+  16, 0xf780, 0, {0x82,0x01,0x20,0x80,0x03,0x38,0x02,0xf8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf790, 0, {0x20,0x01,0x16,0x40,0x84,0x98,0x25,0xe0,0x0b,0x7a,0x02,0xfa,0x48,0xa3,0x20,0x61 },
+  16, 0xf7a0, 0, {0x24,0x0b,0x79,0x00,0xce,0xc0,0x93,0xa4,0x21,0xa6,0x0b,0x78,0x12,0xde,0x80,0xb6 },
+  16, 0xf7b0, 0, {0x80,0x2d,0x24,0x0b,0x4b,0x02,0x1a,0x40,0x85,0x81,0x21,0x60,0x0b,0x48,0x02,0xc8 },
+  16, 0xf7c0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0xe2,0xa0,0xb4,0xfe },
+  16, 0xf7d0, 0, {0x4b,0xb8,0x0b,0x0e,0x00,0xa3,0xb0,0x24,0xa8,0x0e,0x1b,0x02,0xce,0xc1,0xc3,0xc0 },
+  16, 0xf7e0, 0, {0x30,0x68,0x2e,0x3a,0x47,0x4e,0x80,0xf1,0x80,0x30,0x80,0x0f,0x22,0x83,0x80,0x00 },
+  16, 0xf7f0, 0, {0xc2,0x10,0x38,0x80,0x4f,0x00,0x07,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf800, 0, {0x40,0x0d,0xbc,0x10,0xfe,0x04,0x3b,0xc1,0x07,0xf0,0x03,0x1c,0xc8,0xdf,0x2a,0x0b },
+  16, 0xf810, 0, {0xc4,0x8f,0xd1,0x43,0xf8,0x02,0x7f,0x00,0x3f,0xc0,0x0c,0xf1,0x0f,0x3c,0x00,0xf2 },
+  16, 0xf820, 0, {0x11,0x3f,0x41,0x1f,0x52,0x03,0xbc,0x0e,0xed,0x14,0x3f,0x40,0x0f,0xf8,0x03,0xd0 },
+  16, 0xf830, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xe4,0x00,0xe9,0x00,0x32,0x80 },
+  16, 0xf840, 0, {0x0e,0xbe,0x4b,0x6f,0x00,0xcb,0x82,0x7a,0xc0,0x2c,0xb0,0x03,0x2c,0x00,0xc9,0x00 },
+  16, 0xf850, 0, {0x32,0x00,0x2c,0x10,0x03,0x2c,0x08,0xc0,0x00,0x26,0x40,0x6c,0x90,0x13,0x24,0x12 },
+  16, 0xf860, 0, {0xc8,0x01,0x3e,0x00,0x0f,0xb8,0x0b,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf870, 0, {0x48,0x11,0x94,0x00,0x8d,0x00,0x21,0x80,0x0b,0x70,0x82,0x3c,0x20,0x83,0x32,0x29 },
+  16, 0xf880, 0, {0xc0,0x08,0xf0,0x20,0x14,0x00,0x80,0x00,0x23,0x00,0x08,0x50,0x06,0x9c,0x04,0xd7 },
+  16, 0xf890, 0, {0x02,0x28,0x80,0x08,0x60,0x02,0x08,0x10,0x87,0x00,0x2d,0xc0,0x0b,0x40,0x02,0x12 },
+  16, 0xf8a0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x00,0xa7,0x80,0x21,0xe0 },
+  16, 0xf8b0, 0, {0x0b,0x5c,0x12,0x1e,0x04,0x87,0x82,0x0d,0xa0,0x09,0x78,0x16,0x02,0x00,0xb4,0x80 },
+  16, 0xf8c0, 0, {0x25,0xe0,0x0b,0x78,0x02,0x9e,0x00,0x84,0x80,0x21,0x22,0x08,0x08,0x02,0x12,0x01 },
+  16, 0xf8d0, 0, {0x84,0xc0,0x2d,0x20,0x0b,0x08,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf8e0, 0, {0x48,0x14,0xcc,0x00,0x83,0x42,0xa0,0xd8,0x0b,0x34,0x82,0x0c,0x00,0xa3,0x02,0x20 },
+  16, 0xf8f0, 0, {0xe0,0x08,0xb0,0x02,0x0c,0x88,0xb3,0x21,0x24,0xd8,0x0b,0x3e,0x02,0x8c,0x00,0x93 },
+  16, 0xf900, 0, {0x08,0x28,0xc0,0x08,0x38,0x02,0x2c,0x05,0x8b,0x01,0x2c,0xe0,0x0b,0x30,0x02,0x12 },
+  16, 0xf910, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x00,0xee,0x00,0x33,0x90 },
+  16, 0xf920, 0, {0x0f,0xa0,0x0b,0x68,0x00,0xca,0x01,0x7f,0xa8,0x0c,0xaa,0x03,0x3a,0x12,0xfe,0xe2 },
+  16, 0xf930, 0, {0x37,0xb0,0x0f,0xee,0x02,0x18,0x00,0xca,0x40,0x36,0xa0,0x08,0xa0,0x8b,0x28,0x00 },
+  16, 0xf940, 0, {0xca,0x81,0x2e,0xa0,0x0f,0xe0,0x03,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf950, 0, {0x48,0x00,0xe0,0x00,0xf8,0x08,0x3e,0x00,0x0f,0x80,0x03,0xa2,0x02,0xd8,0x40,0x3e },
+  16, 0xf960, 0, {0x08,0x0f,0x80,0x13,0xe0,0x40,0x48,0x40,0xb8,0x04,0x08,0x84,0x03,0x61,0x00,0xfc },
+  16, 0xf970, 0, {0x00,0x3f,0x00,0x4f,0xc0,0x03,0xf1,0x00,0xfc,0x00,0x3f,0x04,0x0f,0xc0,0x03,0xd2 },
+  16, 0xf980, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xc4,0x00,0xf9,0x00,0x30,0x50 },
+  16, 0xf990, 0, {0x4c,0xb9,0x03,0x6c,0x18,0xf9,0x00,0x36,0x40,0x0e,0x9c,0x23,0xa4,0x02,0x41,0x00 },
+  16, 0xf9a0, 0, {0xb2,0x44,0x0e,0x9a,0x03,0xa6,0x80,0xc9,0x00,0x3a,0x60,0x0a,0x90,0x03,0xa4,0x80 },
+  16, 0xf9b0, 0, {0xc9,0x00,0x34,0x40,0x0c,0x90,0x03,0xc2,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf9c0, 0, {0x80,0x04,0x64,0x00,0x89,0x40,0x22,0x78,0x08,0x94,0x02,0xe4,0x10,0xb9,0x00,0x3c },
+  16, 0xf9d0, 0, {0x62,0x18,0x94,0x82,0xa4,0x00,0x89,0xc8,0x22,0x70,0x48,0x1e,0x01,0x67,0x80,0xd1 },
+  16, 0xf9e0, 0, {0x00,0xbc,0x42,0x08,0x10,0x02,0x25,0x20,0x89,0x02,0x22,0x40,0x08,0x90,0x02,0xe0 },
+  16, 0xf9f0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0xb1,0x28,0x22,0x40 },
+  16, 0xfa00, 0, {0x08,0xb0,0x82,0x64,0x04,0x39,0x41,0x2e,0x48,0x0a,0x90,0x02,0x04,0x18,0xa9,0x20 },
+  16, 0xfa10, 0, {0x22,0x42,0x4a,0x90,0x02,0x2c,0x04,0x89,0x04,0x2b,0x48,0x02,0xd0,0x02,0xb4,0x0a },
+  16, 0xfa20, 0, {0x8d,0x80,0x23,0xc0,0x48,0xd0,0x02,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfa30, 0, {0x08,0x04,0x04,0x80,0x81,0x20,0xa0,0x48,0x28,0x10,0x02,0xc4,0x00,0xb1,0x24,0x2a },
+  16, 0xfa40, 0, {0x40,0x08,0x12,0x42,0x85,0x80,0xa1,0x20,0xa0,0x48,0x08,0x90,0x02,0x44,0x00,0x95 },
+  16, 0xfa50, 0, {0x2c,0x2d,0x5a,0x0a,0x72,0x82,0x14,0xa0,0x85,0xa8,0x21,0x4a,0x08,0x52,0x82,0xc2 },
+  16, 0xfa60, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x41,0x40,0xf8,0x50,0x32,0x00 },
+  16, 0xfa70, 0, {0x8c,0x05,0x03,0x61,0x40,0xf8,0x51,0x2e,0x00,0x0a,0x85,0x02,0x20,0x00,0xe8,0x50 },
+  16, 0xfa80, 0, {0x32,0x14,0x06,0x85,0x17,0xa0,0x00,0xc8,0x20,0x3a,0x08,0x0e,0x82,0x03,0xa0,0x80 },
+  16, 0xfa90, 0, {0xc8,0x20,0x32,0x08,0x2c,0xc2,0x03,0xee,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfaa0, 0, {0x98,0x19,0xf4,0x40,0xff,0x10,0x3f,0x44,0x0b,0xb0,0x03,0xe4,0x00,0xf9,0x10,0x3d },
+  16, 0xfab0, 0, {0x40,0x0f,0xd1,0x03,0xf4,0x58,0x9d,0x10,0x3f,0x44,0x4f,0xd0,0x03,0xd5,0x00,0xf9 },
+  16, 0xfac0, 0, {0x00,0x3e,0x40,0x8d,0x90,0x03,0xe4,0xb8,0xf9,0x28,0xba,0x6a,0x0f,0x90,0x03,0xe6 },
+  16, 0xfad0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0xe7,0x00,0xfd,0x88,0x3e,0x60 },
+  16, 0xfae0, 0, {0x8f,0xd0,0x03,0x24,0x01,0xdd,0x80,0x73,0x40,0x0f,0xd8,0x03,0xa6,0x04,0xcd,0xa2 },
+  16, 0xfaf0, 0, {0x33,0x78,0x1c,0xd0,0x03,0x34,0x01,0xf5,0x88,0x3b,0x68,0x0c,0xda,0x47,0x37,0x80 },
+  16, 0xfb00, 0, {0xcd,0x88,0x32,0x62,0x0c,0xda,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfb10, 0, {0x38,0x10,0xe3,0x80,0xb8,0x80,0x2e,0x14,0x0b,0x0a,0x82,0x22,0x80,0xb8,0xf8,0xa2 },
+  16, 0xfb20, 0, {0x00,0x0b,0x8f,0xa3,0x83,0xe0,0x88,0xeb,0x22,0xa9,0x08,0x88,0x12,0xa0,0x05,0xb8 },
+  16, 0xfb30, 0, {0x00,0x2a,0xaa,0x88,0x80,0x13,0x62,0x82,0x88,0x80,0x22,0x28,0x88,0xa4,0x02,0x0e },
+  16, 0xfb40, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc5,0x00,0xb1,0x0a,0x2c,0x41 },
+  16, 0xfb50, 0, {0x0b,0x10,0x06,0x04,0x20,0xa1,0x00,0x00,0x40,0x8b,0x10,0x46,0xc4,0x01,0x91,0x11 },
+  16, 0xfb60, 0, {0x24,0x58,0x68,0x90,0xc2,0x04,0x00,0xb1,0x00,0xa8,0x50,0x09,0x14,0x0a,0x05,0x95 },
+  16, 0xfb70, 0, {0xa1,0x08,0xa0,0x42,0x28,0x11,0x0a,0x02,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfb80, 0, {0x18,0x15,0xa4,0x18,0xb9,0x20,0x2e,0x50,0x0b,0x90,0x06,0x24,0x09,0xb9,0x00,0x22 },
+  16, 0xfb90, 0, {0x40,0x8b,0x91,0x02,0x84,0x00,0x99,0x64,0x24,0x40,0x58,0x90,0x02,0xa4,0x20,0xbb },
+  16, 0xfba0, 0, {0x00,0x2a,0x40,0x09,0xb0,0x02,0x05,0x01,0xa9,0x00,0x22,0x40,0x88,0x92,0x02,0x06 },
+  16, 0xfbb0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe6,0x00,0xf9,0x40,0x3e,0x40 },
+  16, 0xfbc0, 0, {0x4f,0x98,0x0b,0x24,0x80,0xd9,0x00,0x22,0x72,0x0b,0x98,0x03,0xe4,0x84,0xd9,0x00 },
+  16, 0xfbd0, 0, {0xb6,0x70,0x08,0x99,0x02,0x24,0x00,0xb9,0x00,0x2a,0x40,0x0d,0x94,0xc2,0x25,0x00 },
+  16, 0xfbe0, 0, {0xa9,0x00,0x22,0x40,0x0c,0x94,0x03,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfbf0, 0, {0x28,0x01,0xa6,0x80,0xf9,0x08,0x3e,0xc0,0x0f,0x91,0x43,0xe4,0x00,0xf9,0x00,0x3e },
+  16, 0xfc00, 0, {0x50,0x0f,0x98,0x03,0xa5,0x00,0xe9,0x00,0x3a,0x64,0x0f,0x90,0x03,0xe4,0x00,0xf9 },
+  16, 0xfc10, 0, {0x00,0x3c,0x40,0x6e,0x90,0x03,0xe4,0x20,0xd9,0x00,0x3c,0x40,0x0f,0x90,0x82,0xca },
+  16, 0xfc20, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xe8,0x00,0x3e,0x00 },
+  16, 0xfc30, 0, {0x4f,0x84,0x0b,0x20,0x00,0xf8,0x00,0x36,0x01,0x0e,0x80,0x03,0xe0,0x00,0xc8,0x40 },
+  16, 0xfc40, 0, {0x32,0x10,0x2d,0x80,0x03,0xe0,0x54,0xc8,0x00,0x36,0x10,0x0f,0x04,0x83,0xe0,0x50 },
+  16, 0xfc50, 0, {0xd8,0x04,0x12,0x00,0x0c,0x00,0x0b,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfc60, 0, {0x28,0x05,0x28,0x00,0x8e,0x42,0x2e,0xa2,0x8b,0xea,0x02,0x28,0x08,0xbe,0x89,0x37 },
+  16, 0xfc70, 0, {0x84,0x48,0xe0,0x12,0x28,0x02,0x8e,0xc0,0x23,0xb0,0x4d,0x60,0x62,0xf8,0x00,0x86 },
+  16, 0xfc80, 0, {0x00,0x23,0x80,0x0b,0xe0,0x02,0xf8,0x00,0x0e,0x00,0x22,0x80,0x08,0xe4,0x02,0x0a },
+  16, 0xfc90, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0xa3,0x00,0x2c,0x80 },
+  16, 0xfca0, 0, {0x1b,0xb0,0x9a,0x4c,0x10,0x9b,0x80,0x24,0xc0,0x0a,0x30,0x00,0x0c,0x04,0x9b,0x20 },
+  16, 0xfcb0, 0, {0x20,0xd6,0x08,0x30,0x02,0x8e,0x08,0xa3,0x04,0x24,0xc0,0x19,0x34,0x02,0xc7,0x07 },
+  16, 0xfcc0, 0, {0xaa,0xa4,0xa0,0xc0,0x48,0x34,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfcd0, 0, {0xa0,0x01,0x0e,0x00,0x87,0x00,0x2d,0xc0,0x0b,0x40,0x02,0x5c,0x40,0xb3,0x14,0x25 },
+  16, 0xfce0, 0, {0xe0,0x08,0x7a,0x02,0x9e,0xc0,0x92,0x40,0xa0,0x00,0x49,0x60,0x02,0xce,0x02,0x8e },
+  16, 0xfcf0, 0, {0x01,0x21,0xc0,0x8b,0x54,0x02,0xc4,0x08,0x86,0x40,0x21,0xc8,0x88,0x10,0x02,0x28 },
+  16, 0xfd00, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0xc0,0xe4,0x80,0x3d,0xe2 },
+  16, 0xfd10, 0, {0x0f,0x58,0x03,0x5e,0x90,0xb6,0xa2,0x35,0xe0,0x0e,0x7c,0x23,0x1c,0x00,0xd6,0x80 },
+  16, 0xfd20, 0, {0x31,0xe0,0x84,0x78,0x03,0xde,0x00,0xc7,0x80,0x35,0xe0,0x0f,0x68,0x03,0xde,0x00 },
+  16, 0xfd30, 0, {0xe3,0x80,0x33,0xe8,0x2c,0x78,0x03,0x2a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfd40, 0, {0x08,0x1d,0xac,0x90,0xfa,0x00,0x7e,0x40,0x0f,0x90,0x03,0xac,0x01,0xfb,0x00,0x3c },
+  16, 0xfd50, 0, {0x41,0x0f,0x30,0x0b,0x2d,0x04,0xeb,0x01,0x3e,0xc0,0x0e,0xb0,0x03,0xec,0x00,0xfa },
+  16, 0xfd60, 0, {0x00,0x3f,0xc0,0x0f,0x80,0x03,0xec,0x00,0xe9,0x60,0x3e,0xe4,0x0f,0x90,0x03,0xc2 },
+  16, 0xfd70, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xfe,0x20,0xff,0x90,0x3e,0x20 },
+  16, 0xfd80, 0, {0x0c,0xa9,0x07,0x2e,0x44,0xc9,0x91,0x30,0xa0,0x0c,0xb8,0x63,0x2f,0x44,0xcb,0xa1 },
+  16, 0xfd90, 0, {0x36,0x20,0x8c,0xf8,0x03,0x36,0x00,0xcf,0x82,0x33,0xe0,0x0c,0xf8,0x23,0x2e,0x00 },
+  16, 0xfda0, 0, {0xce,0xc0,0x3b,0xe0,0x0c,0x68,0x03,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfdb0, 0, {0xa8,0x11,0x9c,0x84,0xb3,0x54,0x2c,0xf4,0x28,0xba,0x8a,0x3e,0x40,0x81,0xa0,0x29 },
+  16, 0xfdc0, 0, {0xb0,0x0f,0x78,0x42,0xae,0x00,0x83,0x90,0x33,0xe8,0x0d,0xe1,0x00,0x85,0x40,0x82 },
+  16, 0xfdd0, 0, {0x24,0x23,0xc6,0x0d,0x71,0x03,0x5e,0xe0,0x87,0x00,0x2b,0xc1,0x0d,0x44,0x02,0x2a },
+  16, 0xfde0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x08,0x35,0x14,0x6d,0xc0 },
+  16, 0xfdf0, 0, {0x88,0x72,0x32,0x5c,0x80,0x84,0x30,0x2b,0x88,0x0a,0x70,0x42,0x5c,0xa8,0x91,0x08 },
+  16, 0xfe00, 0, {0x25,0xc8,0x09,0x70,0x02,0x4c,0x22,0x83,0x0a,0x61,0xc0,0x09,0x20,0x02,0x04,0x00 },
+  16, 0xfe10, 0, {0x87,0x00,0x21,0xc0,0x08,0x60,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfe20, 0, {0x20,0x14,0xcc,0x10,0xb3,0x85,0x6c,0xdc,0x08,0x34,0x02,0x4d,0x21,0x81,0x00,0x28 },
+  16, 0xfe30, 0, {0x02,0x4a,0x31,0x12,0xef,0x0c,0x91,0xc2,0x20,0xf0,0x08,0x30,0x42,0x8e,0x00,0x82 },
+  16, 0xfe40, 0, {0x40,0x20,0xc8,0x19,0x28,0x02,0x22,0x81,0x83,0xc0,0x28,0xd4,0x09,0x00,0x0a,0x08 },
+  16, 0xfe50, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xbc,0x00,0xfb,0xa0,0x3e,0xc0 },
+  16, 0xfe60, 0, {0x8c,0x04,0x12,0x7d,0x10,0xcf,0x02,0x3a,0x50,0x08,0xc0,0x42,0x7d,0x52,0x58,0x01 },
+  16, 0xfe70, 0, {0x36,0x22,0x69,0xd0,0x13,0x2a,0x00,0x88,0x82,0x32,0xf0,0x09,0xb8,0x82,0x2f,0x00 },
+  16, 0xfe80, 0, {0xc9,0xc8,0x23,0xc0,0x0c,0x8a,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfe90, 0, {0x80,0x00,0xec,0x00,0xb9,0x40,0x3c,0x50,0x4f,0x80,0x23,0xac,0x12,0xfb,0x00,0x2a },
+  16, 0xfea0, 0, {0xc0,0x6d,0x80,0x13,0xac,0x00,0xe8,0x04,0xba,0x10,0x0f,0x80,0x03,0xe8,0x00,0xf3 },
+  16, 0xfeb0, 0, {0x08,0x3c,0x80,0x0f,0x90,0x83,0xec,0x04,0xf9,0x60,0x2c,0xc2,0x0f,0x80,0x83,0xe0 },
+  16, 0xfec0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xdc,0x00,0xec,0x2c,0x3f,0xf0 },
+  16, 0xfed0, 0, {0x8c,0xfa,0x8b,0xbc,0x00,0xfe,0x00,0x3f,0x00,0x0f,0x79,0x03,0x3c,0x00,0xce,0x08 },
+  16, 0xfee0, 0, {0x0b,0xc2,0x0c,0xf0,0x03,0xbc,0x00,0xfc,0x00,0x33,0x40,0x8c,0x7a,0x03,0x3a,0x00 },
+  16, 0xfef0, 0, {0xc5,0x00,0x33,0xc0,0x4c,0xc8,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xff00, 0, {0x81,0x04,0x6c,0x00,0x88,0xc0,0x2e,0xe0,0x08,0x94,0x02,0x2c,0x00,0xbb,0x80,0x66 },
+  16, 0xff10, 0, {0x30,0x16,0xb0,0x02,0x2c,0x00,0xda,0x4c,0x22,0xf0,0x08,0xf0,0x03,0xec,0x00,0xeb },
+  16, 0xff20, 0, {0xc0,0x22,0x68,0x00,0x94,0x02,0x2c,0x02,0xa9,0x80,0x22,0xc0,0x08,0x0c,0x02,0xa0 },
+  16, 0xff30, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0xab,0x04,0x2e,0xc0 },
+  16, 0xff40, 0, {0x08,0xa4,0x06,0x2c,0x04,0xab,0x10,0x2e,0x60,0x43,0x80,0x82,0x6c,0x01,0x81,0x80 },
+  16, 0xff50, 0, {0x28,0x0a,0x08,0x91,0x00,0xe0,0x00,0xb8,0x80,0x02,0xe0,0x08,0x80,0x02,0x2d,0x80 },
+  16, 0xff60, 0, {0x88,0xc0,0x22,0xc0,0x08,0x82,0x02,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xff70, 0, {0x08,0x04,0x0c,0x00,0x80,0x44,0x2c,0xc8,0x28,0xa0,0x22,0x0c,0x04,0xb3,0x26,0x2c },
+  16, 0xff80, 0, {0xc8,0x88,0x01,0x06,0x0c,0xe0,0x91,0x20,0x20,0x0c,0x38,0x04,0x22,0xc0,0x48,0xa3 },
+  16, 0xff90, 0, {0x42,0xa0,0x81,0x08,0x00,0x02,0x0c,0x80,0x81,0x00,0x20,0xc0,0x28,0x00,0x02,0x82 },
+  16, 0xffa0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x7c,0x00,0xa9,0x40,0x3e,0x44 },
+  16, 0xffb0, 0, {0x08,0xb1,0x03,0x2c,0x40,0xea,0x49,0x2e,0x0d,0x0b,0xb6,0x13,0x7d,0x80,0xc9,0x40 },
+  16, 0xffc0, 0, {0xba,0xd0,0x0c,0xb4,0x03,0xac,0x00,0xf8,0x00,0x32,0x40,0x0c,0x80,0x0b,0x20,0x00 },
+  16, 0xffd0, 0, {0xc5,0x00,0xb2,0xc0,0x0c,0x80,0x03,0x00,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xffe0, 0, {0xa0,0x1d,0xfc,0x04,0xfc,0x00,0x3d,0xc5,0x0b,0xf1,0x00,0xfc,0xd0,0x77,0x29,0x37 },
+  16, 0xfff0, 0, {0x0c,0x8e,0x74,0x03,0xfc,0x08,0xfd,0x69,0x3f,0xd8,0x0f,0xf0,0x03,0xbc,0x00,0xef },
+  16, 0x8010, 0, {0x00,0x3f,0x40,0x07,0xc0,0x03,0xf0,0x40,0xfd,0x00,0x3f,0xc0,0x0f,0xc0,0x03,0xe8 },
+  16, 0x8020, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x0d,0xfc,0xc0,0xdc,0x80,0x3f,0xc8 },
+  16, 0x8030, 0, {0x0f,0x48,0x03,0x7c,0x20,0xff,0x68,0x37,0xe0,0x0e,0xf1,0x03,0x9c,0x00,0xbf,0x20 },
+  16, 0x8040, 0, {0x37,0xe0,0x0c,0xc8,0x13,0x3c,0x40,0xed,0x60,0xbb,0xe4,0x2c,0x43,0x4b,0x70,0xa0 },
+  16, 0x8050, 0, {0xcc,0x2c,0x3f,0x09,0x0f,0xd8,0x43,0x70,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8060, 0, {0x80,0x00,0xed,0xc0,0xb8,0x80,0x2f,0xf4,0x0f,0x98,0x02,0x3f,0x00,0xbf,0x42,0x22 },
+  16, 0x8070, 0, {0xca,0x08,0xf4,0x02,0x3e,0x00,0xbf,0xd0,0x22,0x60,0x28,0x88,0x0a,0x3d,0x80,0x8d },
+  16, 0x8080, 0, {0x40,0x22,0xc8,0x08,0x81,0x02,0x21,0x80,0xdb,0xc0,0x2e,0xa5,0x0b,0x98,0x42,0x20 },
+  16, 0x8090, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x10,0xb0,0x00,0x2c,0xc0 },
+  16, 0x80a0, 0, {0x0b,0x20,0x02,0xcc,0x00,0xb3,0x20,0x26,0xc0,0x8a,0x36,0x12,0x8c,0x41,0xb3,0x00 },
+  16, 0x80b0, 0, {0x2e,0x40,0x08,0x00,0x02,0x0d,0x81,0xa1,0x30,0x22,0xc8,0x89,0xa2,0x42,0x08,0x20 },
+  16, 0x80c0, 0, {0xb0,0x00,0x2c,0x40,0x0b,0x90,0x26,0x62,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x80d0, 0, {0xc0,0x15,0xac,0x00,0xb8,0x50,0x2e,0xc0,0x0a,0x90,0x02,0xac,0x00,0xbb,0x00,0x22 },
+  16, 0x80e0, 0, {0xc0,0x08,0xb0,0x62,0x2c,0x10,0xbb,0x04,0x2a,0xf0,0x4a,0x88,0x02,0x0c,0x00,0x81 },
+  16, 0x80f0, 0, {0x00,0x22,0xc0,0x09,0xb8,0x80,0x26,0x00,0xb8,0x80,0x2e,0x21,0x0b,0x90,0x02,0x30 },
+  16, 0x8100, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x15,0xec,0x00,0xd8,0xc0,0x3e,0xc0 },
+  16, 0x8110, 0, {0x0b,0x80,0x03,0xec,0x00,0xfb,0x00,0x36,0x80,0x0e,0xb0,0x03,0xac,0x00,0xfb,0x00 },
+  16, 0x8120, 0, {0x3c,0xe0,0x0c,0x0c,0x03,0x2c,0x00,0xe9,0x00,0x10,0xc0,0x0c,0x8c,0x03,0x06,0x00 },
+  16, 0x8130, 0, {0xf8,0xcd,0x3e,0x22,0x0f,0x18,0x03,0x40,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8140, 0, {0xe0,0x01,0xbc,0x00,0xff,0x00,0x3e,0xc0,0x0f,0xf0,0x03,0x7c,0x00,0xf7,0x02,0x3f },
+  16, 0x8150, 0, {0xe4,0x0f,0x70,0x03,0x7c,0x04,0xb7,0x00,0x37,0x40,0x0d,0xc0,0x03,0xfc,0x00,0xfd },
+  16, 0x8160, 0, {0x00,0x37,0xd0,0x0e,0xc0,0x43,0xf4,0x00,0xdf,0x00,0x3f,0x80,0x8f,0xda,0x03,0xf8 },
+  16, 0x8170, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xf8,0x10,0x3a,0xc0 },
+  16, 0x8180, 0, {0x6d,0xa6,0x13,0xec,0x00,0xcb,0x00,0x3a,0xd0,0x0f,0xb0,0x03,0x2c,0x10,0xdb,0x10 },
+  16, 0x8190, 0, {0x36,0xd8,0x0d,0x84,0x03,0xec,0x06,0xc9,0x08,0x3a,0xc0,0x0e,0x86,0x03,0xa8,0x60 },
+  16, 0x81a0, 0, {0xf8,0x20,0x3a,0x40,0x0c,0x90,0x03,0x54,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x81b0, 0, {0x98,0x05,0x3c,0x00,0xbb,0x40,0x23,0xd0,0x08,0x30,0x02,0x3e,0x10,0xaf,0x00,0x20 },
+  16, 0x81c0, 0, {0xc0,0x0b,0xf0,0x02,0x3c,0x00,0x8f,0x50,0x2e,0xc8,0x06,0x8a,0x02,0xfc,0x00,0x8d },
+  16, 0x81d0, 0, {0x24,0x82,0xd6,0x08,0x32,0x02,0x2d,0x08,0x3a,0x40,0x22,0x80,0x0d,0x90,0x03,0x62 },
+  16, 0x81e0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x05,0x4c,0x00,0xb0,0x20,0x28,0xc2 },
+  16, 0x81f0, 0, {0x08,0x04,0x02,0x8c,0x00,0x13,0x02,0x28,0xc0,0x0b,0x30,0x02,0x0c,0x30,0x93,0x80 },
+  16, 0x8200, 0, {0x24,0xd0,0x09,0x20,0x02,0xcc,0x00,0x91,0x40,0x08,0xc0,0x2a,0x14,0x02,0x81,0x00 },
+  16, 0x8210, 0, {0x90,0x00,0x68,0x00,0x08,0x18,0x02,0x3a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8220, 0, {0x70,0x01,0x1e,0x00,0xb4,0xa0,0x21,0xe0,0x08,0xc8,0x12,0x9e,0x00,0xb3,0x82,0x21 },
+  16, 0x8230, 0, {0xe0,0x0b,0x7a,0x0a,0x1e,0x00,0x97,0x80,0x2d,0xe1,0x0a,0x48,0x02,0xce,0x40,0x95 },
+  16, 0x8240, 0, {0x90,0x29,0xe4,0x08,0x58,0x02,0x9a,0x00,0xb7,0x88,0x21,0xe0,0x09,0x58,0x02,0x5c },
+  16, 0x8250, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x4a,0x00,0x0c,0x00,0xf0,0x80,0x38,0xc4 },
+  16, 0x8260, 0, {0x0c,0x25,0x03,0x8c,0x20,0x93,0x00,0x38,0xc4,0x0f,0xb0,0x03,0x0c,0x80,0xd3,0x00 },
+  16, 0x8270, 0, {0x34,0xc0,0x0d,0x04,0x13,0xcc,0x08,0x99,0x00,0x2a,0xc0,0x0e,0x21,0x03,0x88,0x04 },
+  16, 0x8280, 0, {0xf3,0x00,0x38,0xc0,0x0c,0x11,0x83,0x12,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8290, 0, {0x42,0x15,0xbc,0x00,0xf4,0x00,0x3f,0xc3,0x0e,0xc0,0x03,0x1c,0x00,0xaf,0x4a,0x7f },
+  16, 0x82a0, 0, {0xc4,0x0f,0xb2,0x03,0xfd,0x01,0xef,0x10,0x3f,0x84,0x0f,0xc0,0x03,0xfc,0x00,0xe9 },
+  16, 0x82b0, 0, {0x00,0x37,0xc2,0x0e,0xf1,0x47,0x7c,0x00,0xf7,0x00,0x3d,0xc0,0x0f,0x50,0x03,0xd0 },
+  16, 0x82c0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xaa,0x15,0xec,0x08,0xf8,0x00,0x3e,0xca },
+  16, 0x82d0, 0, {0x0f,0x90,0x03,0xef,0x21,0xfb,0x80,0x7a,0x40,0x8f,0xb2,0xa1,0x2f,0x00,0xcb,0x60 },
+  16, 0x82e0, 0, {0x3e,0xc0,0x0f,0xb0,0x03,0xed,0xa0,0xe9,0x30,0x32,0xc0,0x2d,0xb0,0x03,0xe4,0x00 },
+  16, 0x82f0, 0, {0xf8,0x00,0x3e,0x00,0x0f,0xb0,0x03,0xea,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8300, 0, {0xc8,0x91,0x9d,0x00,0xb4,0x01,0x2d,0xc8,0x0b,0x70,0x02,0xcc,0x80,0x8f,0x20,0x21 },
+  16, 0x8310, 0, {0xc0,0x8b,0x76,0x03,0x5d,0x00,0x87,0x0a,0x2d,0xc0,0x0b,0x40,0x22,0xfd,0x00,0x8d },
+  16, 0x8320, 0, {0x10,0x23,0xc8,0x08,0x50,0x12,0xd4,0x00,0xb7,0x00,0x2d,0xc0,0x0b,0x70,0x02,0xf2 },
+  16, 0x8330, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x81,0x00,0x9e,0x00,0xb4,0x80,0x2d,0xe0 },
+  16, 0x8340, 0, {0x0b,0x7c,0x02,0xde,0x40,0xa7,0x82,0x2d,0xe0,0x0b,0x3a,0x02,0x8e,0x00,0x87,0x90 },
+  16, 0x8350, 0, {0x2d,0xe0,0x0b,0x58,0x02,0x5e,0x00,0xa5,0xa2,0x65,0xe0,0x08,0x68,0x82,0xda,0x00 },
+  16, 0x8360, 0, {0x95,0x80,0x2d,0x60,0x0b,0x78,0x02,0xe0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8370, 0, {0x08,0x84,0xcc,0x00,0xb0,0x09,0x2c,0xc0,0x0b,0x38,0x02,0xcc,0x00,0x83,0x00,0x2e },
+  16, 0x8380, 0, {0xc0,0x0b,0x30,0x42,0x4c,0x00,0x83,0x00,0x2c,0xa0,0x0b,0x04,0x02,0xcc,0x00,0x81 },
+  16, 0x8390, 0, {0x00,0xa0,0xc0,0x08,0xb0,0x06,0xcf,0x80,0xb3,0x10,0x2c,0xc4,0x0b,0x31,0x02,0xc3 },
+  16, 0x83a0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x05,0xa8,0x00,0xfe,0x80,0x3e,0x80 },
+  16, 0x83b0, 0, {0x0f,0xe8,0x13,0xe8,0x00,0xea,0x00,0x3f,0xb0,0x0f,0xa0,0x03,0xa8,0x02,0xc2,0x00 },
+  16, 0x83c0, 0, {0x2f,0x88,0x0f,0xe0,0x03,0xe8,0x00,0xea,0x00,0x36,0x00,0x0c,0xe0,0x03,0xf9,0x20 },
+  16, 0x83d0, 0, {0xde,0x80,0x3f,0xa0,0x4f,0xa8,0x03,0xfa,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x83e0, 0, {0x48,0x00,0xe0,0x00,0xf8,0x10,0x3c,0x10,0x0f,0x80,0x83,0xe1,0x00,0xe8,0x00,0x22 },
+  16, 0x83f0, 0, {0x06,0x0f,0x00,0x13,0xe0,0x01,0xf8,0x00,0x3e,0x00,0x0f,0x80,0x83,0xe0,0x00,0xf8 },
+  16, 0x8400, 0, {0x00,0x3e,0x00,0x0f,0x84,0x23,0xe0,0x00,0xf8,0x00,0x3e,0x10,0x0f,0x80,0x03,0xd2 },
+  16, 0x8410, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0xe4,0x00,0xf9,0x10,0x3e,0x44 },
+  16, 0x8420, 0, {0x0d,0x90,0x03,0xe4,0x00,0xf9,0x00,0x3e,0x40,0x0c,0x90,0x12,0x24,0x00,0xf9,0x10 },
+  16, 0x8430, 0, {0x32,0x40,0x8f,0x90,0x03,0xc4,0x00,0xc9,0x00,0x32,0x10,0x0c,0x9c,0x01,0x24,0x00 },
+  16, 0x8440, 0, {0xf9,0x10,0x3e,0x70,0x0f,0x90,0x02,0xc2,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8450, 0, {0x80,0x14,0x64,0x00,0xb9,0xc0,0x2e,0x48,0x08,0x91,0x02,0xe4,0x00,0xb9,0x00,0x2e },
+  16, 0x8460, 0, {0x40,0x0d,0x90,0x03,0x67,0x00,0xb9,0x80,0x2a,0x60,0x0b,0x99,0x02,0xe4,0x00,0x81 },
+  16, 0x8470, 0, {0x00,0x22,0x40,0x2c,0x90,0x12,0x25,0x20,0xb9,0x48,0x2e,0x52,0x0b,0x94,0x02,0xe0 },
+  16, 0x8480, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0xb9,0x00,0x2e,0x40 },
+  16, 0x8490, 0, {0x68,0x90,0x46,0xe4,0x00,0xb9,0x00,0x2e,0xc0,0x08,0x90,0x02,0xa4,0x60,0xb9,0x00 },
+  16, 0x84a0, 0, {0x22,0x48,0x0b,0x90,0x06,0xe4,0x02,0x89,0x00,0xa0,0x40,0x08,0x90,0x02,0xa6,0x10 },
+  16, 0x84b0, 0, {0xb9,0x00,0x0e,0x40,0x0b,0x90,0x02,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x84c0, 0, {0x08,0x04,0x04,0x80,0xb1,0x00,0x2c,0x48,0x08,0x10,0x02,0xc4,0x84,0xb1,0x20,0x2c },
+  16, 0x84d0, 0, {0x40,0x09,0x12,0x02,0xc4,0x80,0xb1,0x20,0x28,0x40,0x0b,0x10,0x02,0xc4,0x80,0x89 },
+  16, 0x84e0, 0, {0x20,0x20,0x40,0x4b,0x12,0x0a,0x84,0x84,0xb1,0x20,0x2c,0x48,0x8b,0x10,0x02,0xc2 },
+  16, 0x84f0, 0, {0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x61,0x40,0xba,0x00,0x2e,0x00 },
+  16, 0x8500, 0, {0x0c,0x80,0x03,0xe8,0x08,0xf8,0x50,0x3e,0x14,0x0c,0x85,0x03,0x20,0x00,0xb8,0x00 },
+  16, 0x8510, 0, {0x32,0x00,0x0f,0xa0,0x03,0xe1,0x40,0xc8,0x50,0x32,0x14,0x0c,0xa5,0x03,0xa1,0x40 },
+  16, 0x8520, 0, {0xf8,0x00,0x3e,0x00,0x0f,0xa0,0x03,0xee,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8530, 0, {0x88,0x0d,0xe4,0x40,0xfd,0x00,0x3e,0x44,0x0f,0xd0,0x03,0xe4,0x40,0xb9,0x11,0x3f },
+  16, 0x8540, 0, {0x40,0x0f,0x91,0x03,0x64,0x44,0xf9,0x10,0x3f,0x40,0x0f,0xd0,0x03,0xe4,0x40,0xfd },
+  16, 0x8550, 0, {0x10,0x3f,0x10,0x8c,0xd1,0x03,0x74,0x40,0xff,0x10,0x3f,0x44,0x0f,0xd0,0x03,0xe6 },
+  16, 0x8560, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0x66,0x20,0xed,0x00,0x33,0x69 },
+  16, 0x8570, 0, {0x4d,0x50,0x43,0x56,0x00,0xf9,0xa0,0x34,0x40,0x0f,0x9a,0x0b,0x34,0x00,0xdd,0x80 },
+  16, 0x8580, 0, {0x3b,0x40,0x0b,0x50,0x03,0xe4,0x00,0xf9,0x00,0x32,0xe0,0x0e,0xd0,0x03,0xf4,0x00 },
+  16, 0x8590, 0, {0xfd,0x00,0x3f,0x40,0x0c,0xd0,0x03,0xc6,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x85a0, 0, {0x78,0x10,0xe2,0x80,0x88,0x04,0x22,0x10,0x0b,0x80,0x02,0x20,0x09,0xb8,0xf0,0x22 },
+  16, 0x85b0, 0, {0x00,0x0b,0x8e,0x12,0xa0,0x00,0xb8,0x52,0x2e,0x00,0x0b,0x80,0x02,0xe0,0x05,0xb8 },
+  16, 0x85c0, 0, {0xaa,0x23,0x3e,0x0d,0x80,0x02,0xe0,0x00,0xb8,0x00,0x3a,0x00,0x08,0x80,0x02,0xce },
+  16, 0x85d0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x05,0xc4,0x20,0xa9,0x00,0xa4,0x44 },
+  16, 0x85e0, 0, {0x09,0x90,0x02,0xc5,0x00,0xa1,0x08,0x2c,0x40,0x0b,0x11,0x82,0x04,0x00,0xb1,0x00 },
+  16, 0x85f0, 0, {0x28,0x40,0x0a,0x10,0x42,0xc4,0x00,0xb5,0x00,0xa1,0x40,0x08,0x10,0x02,0xc4,0x00 },
+  16, 0x8600, 0, {0xb1,0x01,0x2c,0x40,0x08,0x10,0x20,0xd2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8610, 0, {0x18,0x15,0xa4,0x00,0x89,0x04,0x22,0x40,0x0b,0x90,0x00,0xac,0x00,0x39,0x00,0x2a },
+  16, 0x8620, 0, {0x40,0x0b,0x10,0x02,0xa4,0x00,0xb9,0x00,0x2e,0x48,0x0b,0x90,0x12,0xe4,0x00,0xb9 },
+  16, 0x8630, 0, {0x00,0x21,0x60,0x09,0x92,0x22,0xe4,0x28,0xb9,0x00,0x0a,0x50,0x08,0x90,0x06,0xc6 },
+  16, 0x8640, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x00,0xe9,0x00,0x36,0x40 },
+  16, 0x8650, 0, {0x0d,0x90,0x03,0xe4,0x00,0xf9,0x00,0x3e,0x48,0x0f,0x90,0x03,0x24,0x00,0xd9,0x00 },
+  16, 0x8660, 0, {0x3a,0x78,0x0e,0x98,0x03,0xe4,0x00,0xb9,0x00,0xb2,0x40,0x0e,0x92,0x23,0xe6,0x00 },
+  16, 0x8670, 0, {0xb9,0x50,0x3e,0x70,0x2c,0x90,0x03,0xe8,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8680, 0, {0x68,0x01,0x84,0x00,0xf9,0x00,0x3e,0x40,0x4f,0x9c,0x23,0x64,0x00,0xf9,0x04,0x36 },
+  16, 0x8690, 0, {0x48,0x0f,0x90,0x03,0xe4,0x00,0xf9,0x00,0x3e,0x60,0x0f,0x92,0x03,0xe4,0x00,0xf9 },
+  16, 0x86a0, 0, {0x00,0x3e,0x40,0x8f,0x90,0x83,0xe4,0x44,0xf9,0x00,0x78,0x64,0x0f,0x90,0x03,0xda },
+  16, 0x86b0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xf8,0x00,0x3e,0x00 },
+  16, 0x86c0, 0, {0x0f,0x82,0x03,0xa0,0x40,0xe8,0x00,0x3e,0x00,0x0d,0x80,0x03,0x20,0xc0,0xc8,0x80 },
+  16, 0x86d0, 0, {0x3e,0x12,0x0f,0x80,0x03,0x60,0x00,0x7c,0x00,0x33,0x00,0x0d,0x80,0x13,0xe0,0x10 },
+  16, 0x86e0, 0, {0xc8,0x64,0x3e,0x08,0x0c,0x82,0x03,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x86f0, 0, {0x28,0x05,0x28,0x00,0xb6,0xe0,0x0f,0xa0,0x0b,0x60,0x82,0x38,0x00,0xaa,0x00,0x2e },
+  16, 0x8700, 0, {0x80,0x08,0xa0,0x42,0xba,0x00,0xae,0x20,0x2f,0x88,0x0b,0xe5,0x02,0x28,0x00,0xba },
+  16, 0x8710, 0, {0xd8,0x37,0x80,0x08,0xec,0x02,0xf8,0x04,0x8e,0x00,0x2f,0x90,0x0d,0xe0,0x02,0xca },
+  16, 0x8720, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0xb0,0x24,0x2c,0x60 },
+  16, 0x8730, 0, {0x0b,0x38,0x02,0x8e,0x80,0xab,0x00,0x2c,0xc0,0x09,0x30,0x02,0x0d,0x08,0x00,0x80 },
+  16, 0x8740, 0, {0x6c,0xd0,0x0b,0x34,0x02,0xcc,0x00,0xb8,0xc0,0x20,0x00,0x48,0x34,0x12,0xcc,0x40 },
+  16, 0x8750, 0, {0x83,0x00,0x2c,0xe0,0x0a,0x35,0x02,0xca,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8760, 0, {0xa0,0x01,0x1c,0x40,0xb7,0x00,0x2d,0x02,0x8b,0x60,0x02,0x9e,0x00,0x87,0x20,0x2f },
+  16, 0x8770, 0, {0xe0,0x08,0x72,0x02,0x9e,0x00,0xa4,0x00,0x2d,0xc0,0x0b,0xf8,0x02,0x9c,0xc0,0xb3 },
+  16, 0x8780, 0, {0x02,0xa5,0xc0,0x08,0x50,0x86,0xfe,0x00,0x87,0x00,0x2f,0xd0,0x09,0x70,0x02,0xe8 },
+  16, 0x8790, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0x00,0xf4,0x80,0x3d,0x20 },
+  16, 0x87a0, 0, {0x0f,0x58,0x03,0x9e,0x00,0x67,0x80,0x3d,0xf8,0x0d,0x38,0x02,0x1a,0x10,0x44,0x80 },
+  16, 0x87b0, 0, {0x3d,0xe0,0x0f,0x58,0x03,0xde,0x20,0xb4,0x80,0x33,0xa0,0x2c,0x68,0x03,0xd6,0x00 },
+  16, 0x87c0, 0, {0xc7,0x81,0x3d,0xe0,0x0c,0x78,0x03,0xea,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x87d0, 0, {0x08,0x1d,0xac,0x08,0xf8,0x00,0x3e,0x00,0x8f,0x80,0x03,0x6c,0x00,0x3b,0x12,0x3e },
+  16, 0x87e0, 0, {0xca,0x0f,0xb5,0x03,0xc8,0x00,0xf8,0x04,0x7e,0xc0,0x0f,0x90,0x03,0x6c,0x80,0xfb },
+  16, 0x87f0, 0, {0x04,0x3a,0x40,0x0f,0x90,0x23,0xc8,0x00,0xf9,0x01,0x3c,0xc0,0x0f,0xb0,0x03,0xc2 },
+  16, 0x8800, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfe,0x00,0xac,0x90,0x31,0x48 },
+  16, 0x8810, 0, {0x08,0xf8,0x03,0xfa,0x00,0xcf,0x80,0x3f,0xe0,0x0c,0xfc,0x13,0x3e,0x04,0xfc,0x80 },
+  16, 0x8820, 0, {0x35,0xa0,0x0c,0x78,0x03,0xbe,0x00,0xdf,0x80,0x3b,0x20,0x24,0xf8,0x03,0x2e,0x40 },
+  16, 0x8830, 0, {0xcf,0x80,0x33,0xe0,0x03,0xf9,0x03,0xd0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8840, 0, {0xa8,0x11,0xbc,0x00,0x80,0x00,0x01,0x00,0x08,0x72,0x02,0xd0,0x00,0x87,0x00,0x2d },
+  16, 0x8850, 0, {0xc8,0x0a,0xf0,0x02,0x98,0x40,0xf5,0x00,0x61,0x41,0x00,0x74,0x02,0x1c,0x00,0xb4 },
+  16, 0x8860, 0, {0x00,0x21,0xc8,0x08,0x60,0x02,0x3e,0x20,0x86,0x08,0x21,0xd8,0x0f,0x50,0x02,0xea },
+  16, 0x8870, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x9c,0x00,0xa4,0x00,0x21,0x00 },
+  16, 0x8880, 0, {0x08,0x50,0x02,0xd8,0x00,0x97,0x00,0x2d,0xc0,0x88,0x71,0x02,0x14,0x00,0xb0,0x00 },
+  16, 0x8890, 0, {0x25,0x90,0x08,0xc0,0x82,0x9c,0x40,0x93,0x00,0x29,0xa1,0x88,0x60,0x02,0x14,0x12 },
+  16, 0x88a0, 0, {0x87,0x40,0x29,0x40,0x0b,0x60,0x02,0xc4,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x88b0, 0, {0x60,0x14,0xcc,0x00,0x80,0xd0,0xa0,0x00,0x08,0x1c,0x02,0xc0,0x00,0x93,0x00,0x2c },
+  16, 0x88c0, 0, {0xd0,0x0a,0xb0,0x26,0x80,0x00,0xb3,0x00,0x24,0xe4,0x08,0x08,0x02,0x8c,0x00,0xb0 },
+  16, 0x88d0, 0, {0x02,0x02,0x41,0x08,0x08,0x02,0x03,0x01,0x81,0x00,0x28,0x42,0x1a,0x00,0x42,0xd8 },
+  16, 0x88e0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x15,0xbc,0x00,0xe8,0xc0,0x32,0x80 },
+  16, 0x88f0, 0, {0x0c,0xb5,0x03,0xe4,0x00,0x9f,0x00,0x3d,0xe0,0x0c,0xf0,0x0b,0x24,0x00,0xf8,0x00 },
+  16, 0x8900, 0, {0x36,0xe0,0x0c,0x25,0x03,0xbc,0x05,0xd8,0x02,0x2a,0x00,0x08,0xba,0x02,0x2a,0x00 },
+  16, 0x8910, 0, {0xc1,0x02,0x3a,0x50,0x8b,0x90,0x03,0xee,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8920, 0, {0x80,0x00,0xec,0x00,0xfb,0x08,0x3e,0x80,0x0f,0xa1,0x03,0xec,0x04,0xeb,0x02,0x2e },
+  16, 0x8930, 0, {0xc6,0x0f,0xb0,0x17,0x44,0x00,0xe8,0x00,0x3a,0x40,0x0f,0x80,0x02,0x6c,0x00,0xfb },
+  16, 0x8940, 0, {0x00,0x3e,0xe0,0x0f,0x90,0x93,0xe1,0x00,0xd9,0x00,0x26,0x70,0x8f,0x90,0x01,0xe1 },
+  16, 0x8950, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xfc,0x00,0xfc,0x03,0x37,0x24 },
+  16, 0x8960, 0, {0x0d,0xf8,0x03,0xe0,0x00,0xff,0x00,0x3f,0xc1,0x8d,0xf0,0x0b,0x38,0x00,0xcc,0x00 },
+  16, 0x8970, 0, {0x3f,0xc0,0x0f,0xfa,0x03,0x3c,0x0c,0xfc,0x04,0x3b,0x80,0x0c,0xa0,0x03,0x94,0x20 },
+  16, 0x8980, 0, {0x89,0x05,0x3b,0x00,0x4f,0xd0,0x23,0xc0,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8990, 0, {0x80,0x04,0x6c,0x00,0xb0,0x06,0x20,0x13,0x88,0xa8,0x02,0xeb,0x00,0xbb,0x00,0x2e },
+  16, 0x89a0, 0, {0xc0,0x08,0xb0,0x02,0x2a,0x00,0xa8,0x80,0x2e,0xe0,0x0b,0x94,0x1a,0x2c,0x00,0xbb },
+  16, 0x89b0, 0, {0x00,0xa2,0x40,0x29,0x98,0x02,0xe2,0x00,0xa9,0x84,0x22,0x20,0x0b,0x98,0x02,0xe0 },
+  16, 0x89c0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0xb8,0x00,0x22,0x00 },
+  16, 0x89d0, 0, {0x09,0x82,0x02,0xe6,0x00,0xbb,0x00,0x2e,0xc0,0x0b,0xb0,0x02,0x26,0x00,0x88,0x80 },
+  16, 0x89e0, 0, {0x2e,0xa0,0x0b,0xa0,0x02,0x2c,0x00,0xb3,0x00,0x2a,0x00,0x09,0x98,0x02,0xea,0x20 },
+  16, 0x89f0, 0, {0xa9,0x80,0x2a,0x60,0x9b,0x98,0x82,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8a00, 0, {0x08,0x04,0x0c,0x00,0xb8,0x00,0x20,0x00,0x09,0x08,0x02,0xc4,0x00,0xb3,0x00,0x26 },
+  16, 0x8a10, 0, {0xc0,0x00,0x30,0x02,0x00,0x00,0x81,0x00,0x2c,0x41,0x0b,0x00,0x02,0x0c,0x00,0xb0 },
+  16, 0x8a20, 0, {0x00,0x20,0xc0,0x0b,0x00,0x02,0xc8,0x80,0xa8,0x00,0x20,0x41,0x0b,0x10,0x02,0xc2 },
+  16, 0x8a30, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x6c,0x10,0xf8,0x50,0xb2,0x00 },
+  16, 0x8a40, 0, {0x0d,0x80,0x03,0xe0,0x00,0xfb,0x00,0x3d,0xc0,0x0d,0xf0,0x13,0x24,0x02,0xc8,0x06 },
+  16, 0x8a50, 0, {0x3e,0x80,0x0f,0xa0,0x03,0x3c,0x04,0xfb,0x00,0x78,0x80,0x0c,0xa0,0x03,0xe4,0x00 },
+  16, 0x8a60, 0, {0xe9,0x00,0x1a,0x40,0x0f,0x90,0x03,0xc0,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8a70, 0, {0xa0,0x1d,0xfc,0x00,0xf4,0x20,0x3f,0x00,0x0e,0xc0,0x02,0xf0,0x01,0xff,0x00,0x3f },
+  16, 0x8a80, 0, {0xc0,0x0f,0xf0,0x23,0xf0,0x00,0xfd,0x00,0x3f,0xc0,0x0f,0xc0,0x03,0xfc,0x00,0xfc },
+  16, 0x8a90, 0, {0x00,0x3f,0x40,0x9c,0xc0,0x03,0xf0,0x40,0xfd,0x00,0x3f,0x40,0x0f,0xd0,0x43,0xe8 },
+  16, 0x8aa0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xf0,0x00,0xed,0x23,0xb7,0x48 },
+  16, 0x8ab0, 0, {0x0c,0xe1,0xc3,0x7c,0xc0,0xdd,0x80,0x37,0xe0,0x0f,0xcb,0x03,0xfe,0x08,0xfc,0x28 },
+  16, 0x8ac0, 0, {0x3f,0xf0,0x1c,0xfb,0x23,0x7c,0x01,0xff,0x14,0x77,0xe2,0x4f,0xe8,0x23,0x7c,0x00 },
+  16, 0x8ad0, 0, {0xc4,0x80,0x33,0x48,0x2c,0xf8,0x22,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8ae0, 0, {0x80,0x10,0xe0,0xe0,0xc9,0xc0,0x22,0x5b,0x88,0x96,0x22,0x2d,0x00,0x89,0x22,0x22 },
+  16, 0x8af0, 0, {0xca,0x0b,0x9e,0x22,0xe2,0xa0,0xb9,0x61,0x2c,0xe0,0x88,0x9f,0x02,0x3d,0x85,0xbf },
+  16, 0x8b00, 0, {0x60,0x26,0x50,0x48,0xa0,0x02,0x3c,0x00,0x88,0x00,0x22,0x50,0x08,0xb0,0x02,0x20 },
+  16, 0x8b10, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xc0,0x80,0xb1,0x10,0x20,0x44 },
+  16, 0x8b20, 0, {0x0b,0xb2,0x02,0xce,0xd0,0x81,0x08,0x2c,0xc0,0x0b,0x01,0x02,0x8c,0x08,0xb3,0x08 },
+  16, 0x8b30, 0, {0x2c,0xc9,0x08,0x10,0x62,0x8c,0x60,0xb3,0x32,0x24,0x80,0x0a,0xa0,0x02,0x6c,0x03 },
+  16, 0x8b40, 0, {0x9a,0x01,0x26,0x44,0x48,0xb0,0x42,0x62,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8b50, 0, {0xc0,0x15,0xa4,0xa0,0x8b,0x02,0x22,0xe0,0x0b,0xb0,0x62,0xac,0x98,0x99,0x00,0x2a },
+  16, 0x8b60, 0, {0xc2,0x0b,0x98,0x06,0xe4,0x00,0xbb,0x02,0x2e,0xc0,0x08,0x91,0x42,0x2c,0x10,0xbb },
+  16, 0x8b70, 0, {0x00,0x6e,0x80,0x0a,0x80,0x02,0x6c,0x00,0x1b,0x00,0x06,0x40,0x48,0xb8,0x0a,0x70 },
+  16, 0x8b80, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0xe7,0x00,0xa1,0x00,0x76,0x78 },
+  16, 0x8b90, 0, {0x0f,0xb0,0x03,0xe8,0x10,0xd9,0x00,0x3e,0xd0,0x4b,0x9e,0x13,0xac,0x08,0xb8,0xa0 },
+  16, 0x8ba0, 0, {0x7e,0xc6,0x08,0xa8,0x02,0x2c,0x01,0xbb,0x00,0x26,0x30,0x4e,0x20,0x03,0x4c,0x18 },
+  16, 0x8bb0, 0, {0x99,0x80,0xb4,0x40,0x4c,0x3a,0x03,0x40,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8bc0, 0, {0xe0,0x01,0xb2,0x00,0xfd,0xc5,0x3b,0xc0,0x4c,0xd0,0x03,0x6a,0x02,0xed,0x06,0x33 },
+  16, 0x8bd0, 0, {0xc4,0x0f,0xd0,0x53,0xf8,0x00,0xfc,0x90,0x7f,0xc1,0x0f,0x78,0x03,0xbc,0x04,0xff },
+  16, 0x8be0, 0, {0x00,0x37,0x64,0x0c,0xf1,0x03,0xa4,0x00,0xed,0xa1,0x3b,0x40,0x0b,0xf0,0x83,0xb8 },
+  16, 0x8bf0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0x8c,0x00,0xcb,0x20,0x3e,0x71 },
+  16, 0x8c00, 0, {0x0f,0xb3,0x03,0x98,0x02,0xfb,0x02,0x36,0x48,0x0f,0x90,0x03,0xec,0x20,0xf8,0x00 },
+  16, 0x8c10, 0, {0x3e,0xcc,0x04,0x84,0x03,0x2c,0x00,0xdb,0x04,0x3c,0x10,0x0f,0xa0,0x03,0xec,0x00 },
+  16, 0x8c20, 0, {0x9b,0x00,0x32,0x40,0x0c,0x90,0x03,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8c30, 0, {0x88,0x05,0x2c,0x02,0x8b,0x48,0x2e,0xe0,0x0b,0x34,0x03,0x6b,0x00,0x8b,0xf5,0x22 },
+  16, 0x8c40, 0, {0xf2,0x0b,0x9c,0x03,0xaf,0x00,0xb8,0x50,0x2e,0xc0,0x08,0xb0,0x02,0x7c,0x00,0x8f },
+  16, 0x8c50, 0, {0x00,0x0e,0x5d,0x0b,0x80,0x02,0xf5,0x40,0x83,0x50,0x23,0x54,0x08,0x9c,0x02,0xe6 },
+  16, 0x8c60, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x04,0x4c,0x00,0x81,0x81,0x2e,0x40 },
+  16, 0x8c70, 0, {0x03,0x2c,0x02,0x04,0x33,0x99,0x00,0x20,0xf0,0x4a,0x28,0x80,0xcc,0x40,0xb0,0x00 },
+  16, 0x8c80, 0, {0x26,0x10,0x08,0x20,0x02,0x4c,0x00,0x83,0x00,0x2c,0xc0,0x09,0x20,0x02,0xcc,0x00 },
+  16, 0x8c90, 0, {0xa0,0x02,0x28,0x40,0x08,0x08,0x02,0x7a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8ca0, 0, {0x20,0x01,0x0a,0x00,0x85,0x80,0x2d,0xf8,0x0b,0xda,0x02,0xd6,0x40,0x85,0xa0,0x21 },
+  16, 0x8cb0, 0, {0xe0,0x0b,0x48,0x06,0x92,0x04,0xb5,0x80,0x2d,0x21,0x08,0x00,0x02,0x4e,0x00,0x87 },
+  16, 0x8cc0, 0, {0xa4,0x2d,0x60,0x0b,0x68,0x02,0xde,0xc2,0xad,0x90,0x2b,0x60,0x28,0x58,0x82,0xdc },
+  16, 0x8cd0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x4c,0x40,0xc3,0x10,0x2c,0x6c },
+  16, 0x8ce0, 0, {0x0f,0x30,0x03,0x86,0xa2,0xf9,0xb0,0xb0,0xe0,0x0f,0x29,0x83,0xce,0x44,0xf3,0x80 },
+  16, 0x8cf0, 0, {0x3c,0xac,0x0c,0x30,0x03,0x0c,0x00,0xc3,0x00,0x3c,0xd5,0x0f,0x20,0x03,0xce,0xc1 },
+  16, 0x8d00, 0, {0xe0,0x10,0xb8,0x40,0x0c,0x00,0x03,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8d10, 0, {0xc0,0x1d,0xbc,0x00,0xeb,0x00,0x3e,0xcc,0x0f,0x32,0x03,0x64,0x08,0xf9,0x00,0x3b },
+  16, 0x8d20, 0, {0x90,0x0f,0xf0,0x43,0xe4,0x40,0xfb,0x34,0x3f,0x81,0x07,0xd1,0x03,0xad,0x20,0xeb },
+  16, 0x8d30, 0, {0x20,0x7f,0xc4,0x0f,0xe1,0x03,0xfc,0x50,0xcd,0x10,0x35,0x40,0x0f,0xd0,0x03,0xd0 },
+  16, 0x8d40, 0, {0x02,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xe4,0x04,0xfd,0x04,0x3d,0x40 },
+  16, 0x8d50, 0, {0x2d,0x30,0x02,0x3c,0x00,0xc9,0x01,0x3e,0xc0,0x4f,0xb8,0x43,0xec,0x10,0xfb,0x00 },
+  16, 0x8d60, 0, {0x32,0x40,0x0f,0xa0,0x23,0xec,0x80,0xcb,0x36,0x32,0x80,0x4d,0xa8,0x03,0x2c,0x10 },
+  16, 0x8d70, 0, {0xcb,0x00,0x32,0x40,0x0c,0x90,0x03,0x6a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8d80, 0, {0xc8,0x11,0x90,0x08,0xb5,0x00,0x2d,0xc0,0x08,0x50,0x02,0xbc,0x02,0x85,0x04,0x2d },
+  16, 0x8d90, 0, {0xc0,0x8e,0x60,0x06,0xd8,0x04,0xb7,0x04,0x21,0x40,0x0b,0x70,0x02,0xfc,0x80,0xaf },
+  16, 0x8da0, 0, {0x28,0x21,0xc0,0x0b,0x70,0x02,0x06,0x40,0x87,0x00,0x21,0x50,0x08,0x50,0x02,0x32 },
+  16, 0x8db0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x9e,0x20,0xb7,0x80,0x2b,0x70 },
+  16, 0x8dc0, 0, {0x08,0xf8,0x06,0x1e,0x00,0x87,0x80,0x2d,0xe0,0x0b,0x70,0x32,0xde,0x04,0x37,0x84 },
+  16, 0x8dd0, 0, {0x25,0xe0,0x0b,0x68,0x06,0xde,0x80,0x87,0x80,0x21,0xa1,0x1b,0x68,0x02,0x1e,0x40 },
+  16, 0x8de0, 0, {0x9f,0x80,0x20,0x60,0x08,0x58,0x02,0x20,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8df0, 0, {0x48,0x14,0xcc,0x20,0xb3,0x00,0x2c,0x80,0x88,0xb4,0x22,0x8d,0x00,0x83,0x90,0x2c },
+  16, 0x8e00, 0, {0xc0,0x0a,0x38,0x02,0xce,0x08,0xbb,0x20,0x24,0xd0,0x0b,0xb3,0x02,0xcc,0x00,0xa3 },
+  16, 0x8e10, 0, {0x00,0x60,0xd2,0x0b,0x20,0x2a,0x04,0x08,0x93,0x50,0x20,0x40,0x08,0x17,0x0a,0x02 },
+  16, 0x8e20, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xba,0x00,0xba,0xa0,0x3f,0x84 },
+  16, 0x8e30, 0, {0x1c,0xe0,0x0b,0x38,0x40,0x8e,0x06,0x2e,0x80,0x0b,0xe3,0x03,0xf8,0x80,0xfe,0xe4 },
+  16, 0x8e40, 0, {0xb7,0x90,0x0f,0xec,0x02,0xe8,0x00,0x8a,0x00,0xa3,0xa0,0x09,0xe4,0x03,0x2a,0x02 },
+  16, 0x8e50, 0, {0xde,0xc0,0xf3,0x80,0x0c,0x6c,0x03,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8e60, 0, {0x48,0x01,0xe0,0x00,0xf8,0x40,0x3e,0x00,0x0f,0x84,0x13,0xe0,0x00,0xf8,0x00,0x2e },
+  16, 0x8e70, 0, {0x30,0x0a,0x84,0x03,0xe0,0x04,0xf8,0x00,0x3a,0x02,0x0f,0x80,0x13,0xe0,0x00,0xf8 },
+  16, 0x8e80, 0, {0x00,0x3e,0x04,0x0d,0x80,0x83,0xe0,0x40,0xe8,0x20,0x3e,0x00,0x2f,0x80,0x03,0xd2 },
+  16, 0x8e90, 0, {0x10,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xa4,0x00,0xf9,0x00,0x3c,0x64 },
+  16, 0x8ea0, 0, {0x4e,0x90,0x83,0x24,0x80,0xc9,0x00,0x32,0xe0,0x0f,0x10,0x03,0x25,0x00,0xf9,0x00 },
+  16, 0x8eb0, 0, {0x32,0x44,0x0f,0x92,0x23,0x64,0x00,0xc1,0x00,0x32,0x40,0x0c,0x90,0x13,0xe4,0x00 },
+  16, 0x8ec0, 0, {0xc9,0x00,0x22,0x40,0x0c,0x90,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8ed0, 0, {0x80,0x04,0x64,0x00,0xb9,0x20,0x2e,0x40,0x48,0x96,0x22,0x25,0x00,0xd9,0xc0,0xa2 },
+  16, 0x8ee0, 0, {0x70,0x0b,0x98,0x02,0x24,0x00,0xb9,0x40,0xa2,0x70,0x4b,0x90,0x02,0x24,0x00,0xd9 },
+  16, 0x8ef0, 0, {0x00,0xa2,0x40,0x2c,0x94,0x22,0xe4,0x02,0x89,0x00,0xa2,0x40,0x28,0x94,0x13,0x20 },
+  16, 0x8f00, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0x24,0x00,0xb9,0x00,0x2e,0x40 },
+  16, 0x8f10, 0, {0x0a,0x90,0x02,0x04,0x00,0x81,0x80,0xa2,0x44,0x0b,0x91,0x02,0x25,0x00,0x19,0x40 },
+  16, 0x8f20, 0, {0x62,0x40,0x0b,0xb4,0x02,0x44,0x00,0x89,0x00,0x20,0x40,0x08,0x90,0x82,0xc4,0x01 },
+  16, 0x8f30, 0, {0x83,0x02,0x28,0x40,0x48,0x90,0x82,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8f40, 0, {0x00,0x04,0x05,0x80,0xb1,0x00,0x6c,0x51,0x08,0x14,0x1a,0x05,0x00,0x93,0x00,0x20 },
+  16, 0x8f50, 0, {0x40,0x8b,0x14,0x02,0x05,0x00,0xb1,0x20,0x20,0x50,0x0b,0x14,0x06,0x04,0x80,0x91 },
+  16, 0x8f60, 0, {0x20,0x20,0x40,0x09,0x10,0x02,0xc4,0xa8,0x81,0x00,0x28,0x4a,0x08,0x90,0x4a,0x42 },
+  16, 0x8f70, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xf8,0x00,0x3e,0x00 },
+  16, 0x8f80, 0, {0x0e,0x80,0x03,0x28,0x01,0xc8,0x50,0x32,0x94,0x8b,0xa0,0x03,0x20,0x00,0xb0,0x50 },
+  16, 0x8f90, 0, {0x32,0x80,0x0f,0x80,0x07,0x61,0x51,0xc8,0x50,0x22,0x00,0x0c,0x00,0x03,0xe0,0x84 },
+  16, 0x8fa0, 0, {0xc8,0x04,0x3a,0x08,0x0c,0x00,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8fb0, 0, {0x98,0x9d,0xf4,0x40,0xbd,0x41,0x3f,0x50,0x0f,0xf4,0x03,0xf5,0x10,0xfd,0x00,0x3e },
+  16, 0x8fc0, 0, {0x40,0x0f,0xd4,0x03,0xf4,0x00,0xff,0x10,0x2f,0x40,0x4f,0xd4,0x40,0xa4,0x48,0xf9 },
+  16, 0x8fd0, 0, {0x12,0x3f,0x5a,0x8e,0xd2,0x83,0xf4,0xa8,0xf5,0x2c,0x37,0x4a,0x0f,0xd2,0x83,0xa6 },
+  16, 0x8fe0, 0, {0x12,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xe6,0x80,0xfd,0x28,0x3f,0x4c },
+  16, 0x8ff0, 0, {0x0f,0x50,0x03,0x3c,0x44,0xcd,0x40,0x3f,0xd0,0x0d,0xd0,0x02,0x14,0x01,0xfd,0xa0 },
+  16, 0x9000, 0, {0x31,0x40,0x03,0xd0,0x03,0xe7,0x89,0xf9,0x90,0x7e,0x50,0x0c,0x94,0x03,0xe6,0xc0 },
+  16, 0x9010, 0, {0xc9,0x10,0x32,0x6d,0x0f,0x91,0x02,0xc6,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9020, 0, {0x38,0x10,0xe0,0x80,0xb8,0x01,0x2e,0x0c,0x8b,0x84,0x82,0x20,0x42,0x88,0xa0,0x6e },
+  16, 0x9030, 0, {0x20,0x08,0x80,0x03,0x60,0x00,0x98,0xe8,0x22,0x00,0x09,0x80,0x02,0xe3,0xc0,0xe8 },
+  16, 0x9040, 0, {0xd0,0x2e,0x28,0x08,0x8a,0x23,0xe2,0x84,0xd8,0xa0,0x22,0x3d,0x0b,0xc8,0x02,0xce },
+  16, 0x9050, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x05,0xc5,0xb0,0xb1,0x00,0x2c,0x48 },
+  16, 0x9060, 0, {0x0b,0x13,0x02,0x04,0x02,0xb1,0x20,0x2e,0x40,0x88,0x10,0x22,0xc4,0x00,0xb1,0x14 },
+  16, 0x9070, 0, {0x24,0x40,0x0b,0x10,0x52,0xc4,0x00,0xb1,0x21,0x2d,0x48,0x0a,0x52,0x02,0xd5,0x00 },
+  16, 0x9080, 0, {0xbd,0x00,0xad,0x40,0x0b,0x52,0x02,0xd2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9090, 0, {0x18,0x55,0xa5,0x00,0xb9,0x82,0x2e,0x49,0x8b,0xb0,0x12,0x24,0x10,0x99,0x02,0x2e },
+  16, 0x90a0, 0, {0x40,0x08,0xb2,0x00,0x65,0x00,0x99,0x80,0x26,0x44,0x09,0x91,0x02,0xe4,0x09,0xa9 },
+  16, 0x90b0, 0, {0x04,0x2e,0x46,0x0a,0xd4,0x02,0xb4,0x00,0xbd,0x40,0x2f,0x40,0x0b,0xd0,0x02,0xc6 },
+  16, 0x90c0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe7,0x40,0xf9,0x80,0x2e,0x62 },
+  16, 0x90d0, 0, {0x0f,0x9c,0x42,0x24,0x00,0x99,0x01,0x2e,0x68,0x2c,0x92,0x02,0x64,0x00,0xb9,0x40 },
+  16, 0x90e0, 0, {0xb6,0x60,0x0f,0x9a,0x03,0xe4,0x00,0xb9,0x00,0x2e,0x70,0x3e,0x99,0x06,0xe4,0x02 },
+  16, 0x90f0, 0, {0xf9,0x00,0x3e,0x40,0x0f,0x98,0x03,0xe8,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9100, 0, {0x68,0x01,0xa6,0x00,0xf9,0x00,0x3e,0x40,0x1f,0x12,0xab,0xe4,0x00,0xe9,0x90,0x3e },
+  16, 0x9110, 0, {0x49,0x0e,0x98,0x03,0xe4,0x00,0xf1,0x00,0x3a,0x40,0x0d,0x98,0x03,0xe4,0x00,0xf9 },
+  16, 0x9120, 0, {0x01,0x3e,0x60,0x05,0x90,0x13,0xe4,0x00,0x59,0x20,0x32,0x40,0x8f,0x91,0x03,0xda },
+  16, 0x9130, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x68,0x10,0xa0,0x00,0xc8,0x08,0x3e,0x01 },
+  16, 0x9140, 0, {0x0f,0x84,0x63,0x00,0x22,0xe8,0x20,0x3e,0x13,0x0f,0x84,0x03,0xe1,0xc0,0xd8,0x4c },
+  16, 0x9150, 0, {0x32,0x00,0x0c,0x84,0x43,0xe0,0x00,0xf8,0x00,0x22,0x10,0x0f,0x84,0x03,0x00,0x00 },
+  16, 0x9160, 0, {0xc8,0x00,0xb2,0x00,0x0c,0xc0,0x03,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9170, 0, {0x28,0x05,0x28,0x00,0x8e,0x00,0x2f,0x86,0x4b,0xe0,0x02,0x39,0x08,0x8e,0x20,0x2d },
+  16, 0x9180, 0, {0x90,0x0b,0xed,0x92,0xf8,0x02,0x8e,0xe0,0xa3,0x98,0x08,0xe0,0x02,0xe8,0x08,0xba },
+  16, 0x9190, 0, {0x00,0x62,0x80,0x08,0xa0,0x02,0x28,0x00,0x02,0x80,0x02,0x80,0x48,0xe0,0x03,0x4a },
+  16, 0x91a0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x68,0x05,0x4c,0x00,0x83,0x10,0x2c,0xf0 },
+  16, 0x91b0, 0, {0x0a,0x14,0x2a,0x0d,0x1a,0xb3,0x01,0x24,0xd0,0x0b,0xbc,0x32,0xcc,0x08,0x03,0x00 },
+  16, 0x91c0, 0, {0x20,0xc8,0x0b,0x30,0x02,0xcc,0x00,0xb3,0x02,0x22,0xc0,0x09,0x30,0x02,0x0c,0x11 },
+  16, 0x91d0, 0, {0x83,0x00,0x20,0xc0,0x28,0x20,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x91e0, 0, {0x20,0x01,0x1e,0x01,0x85,0x00,0x2d,0x00,0x0b,0x70,0x02,0x18,0x32,0x86,0x00,0x2d },
+  16, 0x91f0, 0, {0xc0,0x0b,0x60,0x16,0xfe,0x04,0x86,0x00,0x27,0xa0,0x8b,0x70,0x42,0xdc,0x80,0xb7 },
+  16, 0x9200, 0, {0x80,0x21,0x01,0x08,0xf8,0x0a,0x18,0x00,0x86,0x08,0x20,0xa0,0x08,0xe8,0x0a,0x68 },
+  16, 0x9210, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x08,0x3e,0x02,0xc6,0x80,0x3d,0xe0 },
+  16, 0x9220, 0, {0x0f,0x48,0x03,0x06,0x04,0xf5,0x82,0x35,0xe0,0x0f,0x78,0x03,0xda,0x00,0xd3,0x80 },
+  16, 0x9230, 0, {0x31,0x60,0x07,0x78,0x03,0xde,0x20,0xf3,0xb0,0x81,0xe0,0x4f,0x68,0x07,0x0e,0x02 },
+  16, 0x9240, 0, {0xcf,0x80,0x31,0xe0,0x0c,0x78,0x13,0x2a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9250, 0, {0x08,0x1d,0xad,0xa0,0xf9,0x00,0x3f,0x00,0x0f,0xb0,0x53,0xf8,0x10,0xa9,0x00,0x3e },
+  16, 0x9260, 0, {0x00,0x0f,0x80,0x01,0xec,0x00,0xfb,0x02,0x3a,0xc0,0x0c,0xb0,0x03,0xec,0x00,0xfb },
+  16, 0x9270, 0, {0x74,0x3c,0x00,0x0f,0x20,0x03,0xe8,0x00,0xfa,0x00,0x3e,0x80,0x0f,0x30,0x03,0xc2 },
+  16, 0x9280, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xfe,0x02,0x8f,0x80,0x35,0xe0 },
+  16, 0x9290, 0, {0x8d,0xd9,0x03,0x2e,0xc4,0xf6,0x80,0x32,0xa4,0x0c,0xb8,0x03,0xde,0x00,0xcf,0x90 },
+  16, 0x92a0, 0, {0x3c,0xe4,0x0c,0xb8,0x03,0xfe,0x65,0xff,0x80,0x0f,0xec,0x8f,0xf8,0x03,0xfe,0x00 },
+  16, 0x92b0, 0, {0xc5,0x80,0x33,0xe0,0x0f,0x68,0x03,0x10,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x92c0, 0, {0xaa,0x11,0x9c,0x80,0x84,0xb0,0x20,0x20,0x29,0x73,0x0a,0x0e,0x82,0xa2,0xa0,0xa2 },
+  16, 0x92d0, 0, {0xa0,0x4f,0x3b,0x03,0x87,0x84,0xb2,0x80,0x2c,0xa0,0x0a,0x7d,0x02,0xde,0x80,0xf7 },
+  16, 0x92e0, 0, {0x20,0x25,0x06,0x08,0x70,0x02,0xc8,0x40,0x84,0x00,0x35,0x80,0x0b,0x60,0x03,0x6a },
+  16, 0x92f0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x10,0x86,0x38,0x27,0xc0 },
+  16, 0x9300, 0, {0x49,0x54,0x06,0x54,0x40,0x1d,0x20,0x21,0xca,0x09,0x61,0x40,0xf8,0x80,0xb7,0x20 },
+  16, 0x9310, 0, {0x2f,0x00,0x89,0x70,0x12,0xdc,0x81,0xb7,0x04,0x2d,0xc9,0x0a,0x60,0x02,0xcc,0x00 },
+  16, 0x9320, 0, {0x8d,0x00,0x2d,0xc0,0x0b,0xf8,0x02,0x04,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9330, 0, {0x60,0x14,0xcd,0x28,0x80,0x00,0x24,0x00,0x09,0xb0,0x22,0x4c,0x02,0xa1,0x01,0x20 },
+  16, 0x9340, 0, {0x30,0x1b,0x23,0x02,0xaf,0x20,0xb3,0x08,0x2c,0x80,0x1b,0x30,0x00,0xcc,0x04,0xa3 },
+  16, 0x9350, 0, {0x01,0x26,0x30,0x08,0xac,0x22,0xe8,0x02,0x80,0x08,0x2e,0x80,0x4b,0xb4,0x02,0x58 },
+  16, 0x9360, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xbc,0x10,0x8b,0x80,0x36,0xf0 },
+  16, 0x9370, 0, {0x2d,0xbc,0x0b,0x6c,0x01,0xda,0x04,0x22,0x40,0x7d,0x94,0x22,0xe4,0x00,0xab,0x44 },
+  16, 0x9380, 0, {0x2e,0xc0,0x09,0xb8,0x02,0xfc,0x00,0xbf,0x00,0x3e,0xf0,0xca,0x92,0x02,0xe4,0x02 },
+  16, 0x9390, 0, {0xcb,0x00,0x6e,0x40,0x0f,0x84,0x01,0x2e,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x93a0, 0, {0x80,0x00,0xec,0x00,0xfb,0x00,0x3a,0xe0,0x2e,0xbc,0x03,0x98,0x08,0xea,0x40,0x36 },
+  16, 0x93b0, 0, {0x43,0x8c,0x90,0x03,0xa4,0x44,0x2a,0x40,0x3e,0x10,0x0e,0xb5,0x83,0xec,0x14,0xfb },
+  16, 0x93c0, 0, {0x00,0x26,0x00,0x0e,0x92,0x03,0xe0,0x40,0xfa,0x00,0x16,0x00,0x0f,0x80,0x13,0xe0 },
+  16, 0x93d0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xec,0x02,0xfa,0x80,0x3f,0xe2 },
+  16, 0x93e0, 0, {0x0f,0xb0,0x0b,0x24,0x00,0xef,0x92,0xbb,0xe0,0x1c,0xd0,0x03,0x74,0x00,0xcf,0x05 },
+  16, 0x93f0, 0, {0x3b,0x40,0x0f,0xc8,0x03,0x5c,0x00,0xcf,0x00,0x32,0xc2,0x4d,0xc1,0x23,0x34,0x40 },
+  16, 0x9400, 0, {0xcf,0x00,0x17,0x44,0x0c,0xd1,0x83,0x00,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9410, 0, {0x81,0x04,0x6c,0x00,0x8b,0x84,0x2e,0x54,0x0b,0xbc,0x0a,0x29,0x80,0x8b,0x80,0x32 },
+  16, 0x9420, 0, {0x00,0x08,0x9c,0x03,0xa7,0x00,0xab,0x84,0x2e,0x7c,0x0b,0x80,0x02,0x2c,0x10,0xdb },
+  16, 0x9430, 0, {0x01,0x36,0x00,0x08,0x80,0x02,0x20,0x00,0x82,0x00,0x22,0x00,0x08,0x90,0x02,0x24 },
+  16, 0x9440, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x0c,0x00,0x89,0x10,0x66,0x90 },
+  16, 0x9450, 0, {0x0b,0xb8,0x02,0x6e,0x12,0xa3,0x41,0x20,0x04,0x0a,0x98,0x22,0xe2,0x00,0x89,0x19 },
+  16, 0x9460, 0, {0x2e,0xc0,0x4b,0x31,0x22,0x6c,0x08,0x83,0x00,0x22,0xc0,0x09,0x90,0x02,0x24,0x00 },
+  16, 0x9470, 0, {0x89,0x00,0x2a,0x40,0x08,0x80,0x02,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9480, 0, {0x08,0x10,0x0c,0x00,0x80,0x20,0x2c,0x0e,0x1b,0x30,0x02,0x04,0x41,0x80,0x20,0x20 },
+  16, 0x9490, 0, {0x12,0x18,0x16,0x42,0x00,0x50,0xa0,0x40,0x2c,0x88,0x1b,0x30,0x02,0x0c,0x81,0x93 },
+  16, 0x94a0, 0, {0x00,0x24,0x00,0x08,0x10,0x2a,0x00,0x0a,0x88,0x00,0x28,0x00,0x28,0x00,0x0a,0x02 },
+  16, 0x94b0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x7c,0x11,0xe8,0x00,0x26,0x98 },
+  16, 0x94c0, 0, {0x0f,0xb0,0x13,0x21,0x0c,0xeb,0x60,0x3a,0xd8,0x28,0x84,0xa2,0xe1,0x80,0xc8,0x20 },
+  16, 0x94d0, 0, {0x3e,0x5e,0x1f,0x82,0x03,0x7c,0x00,0xcf,0x00,0x32,0xc0,0x4d,0x80,0x07,0x25,0x00 },
+  16, 0x94e0, 0, {0xc9,0x00,0x32,0x40,0x0c,0x90,0x03,0x00,0x01,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x94f0, 0, {0xa1,0x11,0xfc,0x00,0xf8,0x13,0x1e,0x00,0x0b,0xf0,0x01,0xf0,0xd0,0xf9,0x19,0x1f },
+  16, 0x9500, 0, {0x08,0x4f,0xc0,0x13,0xa1,0x00,0xf8,0x62,0x3f,0xc0,0x0b,0xc4,0x07,0xed,0x00,0xff },
+  16, 0x9510, 0, {0x00,0x3f,0x00,0x0f,0xc0,0x23,0xf0,0xa0,0xfc,0x00,0x33,0x00,0x0f,0xd0,0x03,0xe8 },
+  16, 0x9520, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfc,0x00,0xff,0x0c,0x3f,0x20 },
+  16, 0x9530, 0, {0x0c,0xc9,0x03,0x32,0x00,0xcf,0x38,0x3f,0xd0,0x0f,0x48,0x03,0xfc,0xa0,0xce,0x22 },
+  16, 0x9540, 0, {0x33,0x00,0x0f,0xc1,0x03,0x3c,0x00,0xff,0x00,0x3d,0xc4,0x4c,0xc0,0x23,0x8c,0xe4 },
+  16, 0x9550, 0, {0xff,0x10,0x37,0x20,0x08,0xf1,0x03,0xf0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9560, 0, {0x80,0x10,0xfe,0x00,0xbf,0x80,0x2e,0x74,0x05,0x22,0x02,0xa2,0x10,0xdf,0x61,0x2f },
+  16, 0x9570, 0, {0xd0,0x8b,0x90,0x02,0x3d,0xa4,0xaa,0x90,0x22,0xf4,0x0b,0x07,0x12,0x1d,0x20,0xbb },
+  16, 0x9580, 0, {0xc0,0x2f,0xd8,0x88,0x97,0x82,0xfd,0x80,0xef,0x72,0x22,0x08,0x28,0xf6,0x23,0xe0 },
+  16, 0x9590, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x40,0xb3,0x00,0x2c,0x00 },
+  16, 0x95a0, 0, {0x08,0x82,0x02,0x22,0x00,0x83,0x01,0x08,0xcc,0x8b,0x20,0x82,0xcc,0x00,0x90,0x00 },
+  16, 0x95b0, 0, {0x20,0x00,0x4b,0x12,0x02,0x0d,0x80,0xb3,0x40,0x2c,0xd8,0x08,0x20,0x42,0x8c,0x80 },
+  16, 0x95c0, 0, {0xb3,0x20,0x26,0x02,0x18,0x33,0x26,0xe2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x95d0, 0, {0xc0,0x15,0xac,0x09,0xbb,0x00,0x2e,0x60,0x08,0x80,0x02,0xa2,0x00,0x9b,0x00,0x2e },
+  16, 0x95e0, 0, {0xc0,0x0b,0xac,0x02,0x2c,0x00,0xba,0x06,0x22,0xc2,0x0b,0x94,0x02,0xac,0x10,0xbb },
+  16, 0x95f0, 0, {0x00,0x2e,0xc1,0x08,0xa8,0x02,0xec,0x00,0xab,0x00,0x22,0x00,0x08,0xb0,0x06,0xf0 },
+  16, 0x9600, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x15,0xec,0x00,0xfb,0x04,0x3e,0x60 },
+  16, 0x9610, 0, {0x28,0x82,0x13,0x0e,0x08,0xcb,0x00,0x3a,0xc0,0x0f,0x8c,0x03,0xec,0x11,0xdb,0x20 },
+  16, 0x9620, 0, {0xb2,0x90,0x4b,0xa8,0x0b,0x2c,0x00,0xbb,0x00,0x2c,0xc0,0x0c,0x88,0x13,0xac,0x00 },
+  16, 0x9630, 0, {0xf3,0x00,0x36,0x06,0x48,0xb0,0x12,0xc4,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9640, 0, {0xe0,0x01,0xbc,0x00,0xfb,0x08,0x3d,0x40,0x8f,0xea,0x01,0xf4,0x00,0xff,0x01,0x2f },
+  16, 0x9650, 0, {0xc0,0x0f,0xd0,0x22,0xfc,0x04,0xaf,0x00,0x3f,0xc0,0x8f,0xe9,0x03,0x7c,0x00,0xff },
+  16, 0x9660, 0, {0x00,0x3f,0xc0,0x0f,0x90,0x43,0xfc,0x20,0xef,0x02,0x3f,0x00,0x8f,0xf0,0x03,0xb8 },
+  16, 0x9670, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x10,0xac,0x08,0xeb,0x00,0x12,0x40 },
+  16, 0x9680, 0, {0x0f,0x90,0x03,0x28,0x20,0xab,0x00,0x3a,0xc0,0x8f,0x85,0x83,0xac,0x10,0xf3,0x50 },
+  16, 0x9690, 0, {0x32,0x90,0x4c,0x34,0x13,0x6c,0x00,0xfb,0x00,0x3e,0xc0,0x0c,0x98,0x03,0x2c,0x40 },
+  16, 0x96a0, 0, {0xeb,0x80,0x32,0x12,0x0d,0xb0,0x0b,0x50,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x96b0, 0, {0x88,0x01,0x3c,0x10,0x0f,0x05,0xa2,0x50,0x0c,0x10,0x02,0x22,0x10,0x8f,0x00,0x23 },
+  16, 0x96c0, 0, {0xc0,0x0b,0x88,0x12,0x3c,0x00,0x9b,0x82,0x22,0xc0,0x08,0xb0,0x02,0x3c,0x00,0x8f },
+  16, 0x96d0, 0, {0xa0,0x2f,0xc0,0x08,0xb0,0x02,0x3c,0x08,0x8f,0x02,0x20,0x00,0x08,0xf0,0x03,0x26 },
+  16, 0x96e0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4d,0x20,0x93,0x00,0x20,0xb2 },
+  16, 0x96f0, 0, {0x0b,0x10,0x02,0x01,0x00,0xa3,0x00,0x68,0xc0,0x0b,0x84,0x02,0xac,0x00,0xb3,0x80 },
+  16, 0x9700, 0, {0x20,0x40,0x0a,0x30,0x02,0x4c,0x00,0xa3,0x04,0x2c,0xc0,0x08,0x00,0x02,0x0d,0x00 },
+  16, 0x9710, 0, {0xa3,0x00,0x20,0x24,0x08,0x30,0x02,0x38,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9720, 0, {0x70,0x01,0x1c,0x20,0x97,0x80,0x23,0x60,0x08,0x78,0x12,0x3a,0x00,0x83,0x91,0x29 },
+  16, 0x9730, 0, {0xe4,0x0b,0x59,0x02,0x1e,0x00,0x97,0x90,0x20,0xfc,0x0a,0x78,0x02,0x1e,0x00,0x87 },
+  16, 0x9740, 0, {0x90,0x2d,0xe0,0x19,0x59,0x02,0x1e,0x80,0x83,0x80,0x61,0xa0,0x08,0x78,0x02,0x18 },
+  16, 0x9750, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x40,0xd3,0x32,0x30,0x06 },
+  16, 0x9760, 0, {0x0f,0x30,0x03,0x04,0x64,0xe3,0x01,0x38,0xc4,0x1f,0x30,0x07,0x8c,0x18,0xf1,0x00 },
+  16, 0x9770, 0, {0x30,0x4c,0x0e,0x30,0x03,0x4c,0x00,0xe3,0x00,0x2c,0xc0,0x0c,0x20,0x03,0x0e,0x00 },
+  16, 0x9780, 0, {0xe3,0x00,0x32,0x08,0x0c,0xb1,0x03,0x12,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9790, 0, {0x40,0x1d,0x9c,0x80,0xef,0x10,0x3d,0x44,0x4f,0xf1,0x07,0xcc,0x00,0xff,0x08,0x36 },
+  16, 0x97a0, 0, {0xc6,0xcf,0xb0,0x03,0xfc,0x00,0x97,0x00,0xbe,0xcc,0x0d,0xb1,0x03,0xfd,0x04,0xff },
+  16, 0x97b0, 0, {0x0c,0x3f,0xd2,0x9e,0xe0,0x4b,0xfd,0x20,0xff,0x02,0x3f,0x80,0x0e,0xf0,0x13,0xd0 },
+  16, 0x97c0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xec,0xc0,0xcb,0x28,0x3e,0xc0 },
+  16, 0x97d0, 0, {0x0f,0x80,0x03,0xec,0x00,0xfb,0x01,0x32,0xe9,0x0c,0x28,0x03,0x2c,0x00,0xfb,0x00 },
+  16, 0x97e0, 0, {0x32,0xc0,0x0c,0xb4,0x83,0x2c,0x01,0xef,0x00,0xb2,0xc8,0x0c,0x20,0x03,0x6d,0x00 },
+  16, 0x97f0, 0, {0xcb,0x10,0x3e,0x00,0x0f,0xb2,0x03,0xea,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9800, 0, {0xc8,0x91,0x9c,0xc4,0x87,0x60,0x2d,0xc0,0x0b,0x60,0x02,0xdc,0x00,0xb7,0x12,0x20 },
+  16, 0x9810, 0, {0xcc,0x0a,0x70,0x02,0x1c,0xc0,0xb3,0x00,0xa0,0xc0,0xc8,0x70,0x22,0x1c,0x80,0xb7 },
+  16, 0x9820, 0, {0x24,0x21,0xc8,0x48,0x50,0x02,0x0c,0x80,0x87,0x10,0x2d,0x40,0x0b,0x72,0x82,0xf2 },
+  16, 0x9830, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x81,0x00,0x8e,0x02,0x87,0x80,0x2d,0xe0 },
+  16, 0x9840, 0, {0x0b,0x78,0x12,0xde,0x00,0xb7,0xa0,0x21,0xe0,0x08,0xf8,0x8e,0x1e,0x40,0xb7,0x88 },
+  16, 0x9850, 0, {0x21,0xe0,0x08,0x38,0x02,0x1e,0x40,0xb3,0xa1,0x20,0xe8,0x48,0xf8,0x82,0x5e,0x02 },
+  16, 0x9860, 0, {0x87,0x80,0x2d,0x22,0x0b,0x79,0x02,0xe0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9870, 0, {0x08,0x04,0xcc,0x04,0x83,0x02,0x2c,0xd4,0x0b,0x30,0x02,0xcc,0x00,0xb3,0x00,0xa0 },
+  16, 0x9880, 0, {0xc0,0x8a,0x38,0x06,0x0c,0x00,0xb3,0x80,0x20,0xe1,0x48,0x39,0x12,0x2c,0x00,0xb3 },
+  16, 0x9890, 0, {0x00,0x22,0xc0,0x08,0xb0,0x82,0x6c,0x00,0x83,0x00,0x2c,0x48,0x0b,0x30,0x02,0xc2 },
+  16, 0x98a0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x05,0xa8,0x00,0xca,0x00,0x3f,0xa0 },
+  16, 0x98b0, 0, {0x0f,0xe4,0x03,0xd8,0x00,0xfa,0x00,0x32,0x80,0x0c,0xe8,0x03,0x28,0x00,0xfa,0x40 },
+  16, 0x98c0, 0, {0x32,0xa8,0x2c,0xa0,0x09,0x28,0x08,0xf2,0x00,0x32,0x80,0x0c,0xe4,0x03,0x68,0x00 },
+  16, 0x98d0, 0, {0xca,0x00,0x3f,0x80,0x0f,0xa0,0x03,0xfb,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x98e0, 0, {0x48,0x00,0xc0,0x00,0xf8,0x01,0x3e,0x12,0x0b,0x80,0x03,0xe0,0x40,0xf8,0x00,0x3e },
+  16, 0x98f0, 0, {0x00,0x4f,0x84,0x03,0xe0,0x04,0xf0,0x08,0x3e,0x00,0x4f,0x00,0x03,0xe0,0x00,0xf8 },
+  16, 0x9900, 0, {0x41,0x3e,0x00,0x2f,0x84,0x03,0xa0,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x80,0x03,0xd2 },
+  16, 0x9910, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0xe6,0x00,0xc9,0x12,0x3e,0x50 },
+  16, 0x9920, 0, {0x8f,0x90,0x83,0xe4,0x20,0xc1,0x00,0x3a,0x41,0x0f,0x90,0x03,0xe4,0x00,0xf9,0x00 },
+  16, 0x9930, 0, {0x30,0x68,0x0c,0x90,0x03,0x24,0x00,0xd9,0x00,0x3a,0x40,0x0e,0x98,0x03,0x24,0x00 },
+  16, 0x9940, 0, {0xc9,0x90,0x3e,0x69,0x0c,0x10,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9950, 0, {0x80,0x04,0x67,0x4a,0x89,0x80,0x2e,0x50,0x0b,0x90,0x02,0xe4,0x80,0xa9,0x00,0x22 },
+  16, 0x9960, 0, {0x40,0x0b,0x90,0x02,0xe4,0x00,0xb9,0x01,0x22,0x40,0x08,0x90,0x02,0x24,0x10,0x89 },
+  16, 0x9970, 0, {0x00,0x22,0x40,0x08,0x93,0x02,0x24,0x22,0x89,0x42,0x2c,0x60,0x48,0x90,0x02,0x20 },
+  16, 0x9980, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x15,0x24,0x00,0x99,0x00,0x2e,0x40 },
+  16, 0x9990, 0, {0x0b,0x90,0x02,0xe4,0x00,0x89,0x00,0x2a,0x40,0x0b,0x90,0x02,0xe4,0x00,0xb9,0x00 },
+  16, 0x99a0, 0, {0x23,0x40,0x08,0xd0,0x02,0x24,0x00,0x99,0x00,0x2a,0x40,0x0a,0x90,0x06,0x24,0x40 },
+  16, 0x99b0, 0, {0x89,0x41,0x2e,0x40,0x08,0x90,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x99c0, 0, {0x08,0x04,0x0c,0x80,0x91,0x20,0x2c,0x48,0x0b,0x10,0x02,0xc4,0x00,0xa1,0x20,0x20 },
+  16, 0x99d0, 0, {0x48,0x0b,0x10,0x02,0xc4,0x80,0xb1,0x20,0xa1,0x49,0x08,0x52,0x4a,0x04,0x80,0x81 },
+  16, 0x99e0, 0, {0x00,0x20,0x48,0x48,0x12,0x0a,0x04,0x80,0x81,0x20,0x2c,0x40,0x28,0x12,0x02,0x02 },
+  16, 0x99f0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x08,0xd8,0x04,0x3e,0x80 },
+  16, 0x9a00, 0, {0x0f,0x85,0x03,0xe0,0x00,0xc0,0x50,0x3a,0x14,0x0f,0xa5,0x03,0xe1,0x40,0xf8,0x02 },
+  16, 0x9a10, 0, {0x32,0x80,0x2c,0xc5,0x03,0x21,0x40,0xda,0x00,0x3a,0x14,0x0e,0x85,0x43,0x21,0x40 },
+  16, 0x9a20, 0, {0xc8,0x52,0x3e,0x14,0x0c,0x85,0x0b,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9a30, 0, {0x88,0x1d,0xe4,0x44,0xe9,0x10,0x3f,0x44,0x4f,0xd0,0x02,0xfc,0x00,0xf9,0x12,0x3e },
+  16, 0x9a40, 0, {0x44,0x0f,0xd0,0x03,0xe4,0x40,0xfd,0x10,0x3e,0x44,0x4f,0x91,0x03,0xe4,0x40,0xe9 },
+  16, 0x9a50, 0, {0x40,0x3e,0x44,0x0f,0xd1,0x03,0xe4,0x40,0xf9,0x12,0x3f,0x40,0x0f,0x91,0x03,0xe6 },
+  16, 0x9a60, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xf6,0xa0,0xfd,0x80,0xb3,0x40 },
+  16, 0x9a70, 0, {0x0c,0x10,0x03,0x14,0x00,0xfd,0xa0,0x32,0x40,0x0f,0xd1,0x03,0xe4,0x00,0xf5,0x86 },
+  16, 0x9a80, 0, {0x33,0x60,0x2c,0x9a,0x83,0x24,0x04,0xfd,0xa8,0x22,0x40,0x0d,0x50,0x43,0xf4,0x00 },
+  16, 0x9a90, 0, {0xfd,0x00,0x33,0x40,0x0f,0x90,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9aa0, 0, {0x78,0x10,0xe1,0x00,0xb8,0x00,0x22,0x00,0x28,0x80,0x02,0x20,0x00,0xb8,0x00,0xa2 },
+  16, 0x9ab0, 0, {0x00,0x0b,0x8a,0x12,0xe0,0x00,0xb8,0x04,0x22,0x14,0x08,0x84,0x02,0x20,0x00,0xb8 },
+  16, 0x9ac0, 0, {0x40,0x20,0x00,0x88,0x80,0x02,0xe0,0x00,0xb8,0x00,0xa2,0x00,0x0b,0x80,0x02,0x0e },
+  16, 0x9ad0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x05,0xc4,0x00,0xb1,0x42,0x20,0x40 },
+  16, 0x9ae0, 0, {0x08,0x10,0x02,0x04,0x00,0xb1,0x40,0x20,0x40,0x0b,0x10,0x06,0xc4,0x00,0xb1,0x40 },
+  16, 0x9af0, 0, {0x24,0x40,0x08,0x10,0x02,0x44,0x04,0xb1,0x00,0x60,0x40,0x09,0x10,0x02,0xc4,0x00 },
+  16, 0x9b00, 0, {0xb1,0x00,0x20,0x40,0x0b,0x10,0x02,0x12,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9b10, 0, {0x18,0x15,0xa4,0x00,0xb9,0x02,0x22,0x60,0x08,0x94,0x02,0x24,0x00,0xb9,0x01,0x22 },
+  16, 0x9b20, 0, {0x40,0x0b,0x90,0x06,0xe4,0x00,0xb9,0x20,0x26,0x40,0x08,0x94,0x02,0x64,0x08,0xb9 },
+  16, 0x9b30, 0, {0x00,0x22,0x40,0x08,0x92,0x02,0xec,0x08,0xb9,0x04,0x22,0x41,0x0b,0x10,0x02,0x06 },
+  16, 0x9b40, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x10,0xf1,0x00,0x32,0x60 },
+  16, 0x9b50, 0, {0x0c,0x94,0x0b,0x25,0x00,0xf9,0x00,0x32,0x40,0x8f,0x94,0xd3,0xe4,0x00,0xf9,0x00 },
+  16, 0x9b60, 0, {0x36,0x40,0x4c,0x90,0x0b,0x64,0x00,0xf1,0x00,0x32,0x40,0x0d,0x92,0x12,0xe4,0x00 },
+  16, 0x9b70, 0, {0xf9,0x00,0x32,0x40,0x0f,0x90,0x0b,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9b80, 0, {0x68,0x41,0xa4,0x00,0xf9,0x00,0x3c,0x40,0x8f,0x92,0x03,0xe4,0x00,0xf9,0x00,0x3e },
+  16, 0x9b90, 0, {0x40,0x0f,0x9c,0x03,0xe4,0x00,0xf9,0x00,0xba,0x40,0x2f,0x90,0x23,0xa4,0x00,0xf9 },
+  16, 0x9ba0, 0, {0x08,0xbe,0x40,0xcf,0x90,0x03,0xe4,0x10,0xf1,0x01,0x3e,0x41,0x0f,0x90,0x03,0xda },
+  16, 0x9bb0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0xc8,0xf8,0x00,0x3e,0x03 },
+  16, 0x9bc0, 0, {0x0c,0x84,0x03,0xa1,0x10,0xe8,0x00,0x32,0x00,0x8c,0x85,0x83,0xe0,0x00,0xc0,0x00 },
+  16, 0x9bd0, 0, {0x38,0x0c,0x2c,0x00,0x03,0x60,0x00,0xc8,0x00,0x3c,0x00,0x0d,0x80,0x02,0x20,0x10 },
+  16, 0x9be0, 0, {0xc8,0x20,0xb2,0x02,0x0f,0x80,0x03,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9bf0, 0, {0x28,0x05,0x39,0x10,0xbe,0x04,0x6f,0xa0,0x08,0xa0,0x02,0x3a,0x00,0x82,0x00,0xa2 },
+  16, 0x9c00, 0, {0x80,0x8d,0xec,0x03,0xa8,0x00,0x8a,0x00,0x23,0x80,0x08,0xa0,0x22,0x28,0x00,0x8e },
+  16, 0x9c10, 0, {0xcc,0x2f,0x80,0x08,0xe8,0xc2,0xb8,0x00,0x8e,0x60,0x23,0x90,0x0b,0xa0,0x02,0xca },
+  16, 0x9c20, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4e,0x08,0xb0,0x72,0x2c,0xd0 },
+  16, 0x9c30, 0, {0x28,0xb0,0x06,0x8c,0x01,0xa1,0x02,0x20,0xc0,0x08,0x38,0x02,0xcc,0x00,0x83,0x00 },
+  16, 0x9c40, 0, {0x20,0xc0,0x29,0x30,0x02,0x4c,0x00,0x81,0x00,0x2c,0xc0,0x08,0x32,0x02,0x0c,0x40 },
+  16, 0x9c50, 0, {0x83,0x00,0x20,0xf4,0x0b,0x30,0x02,0xca,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9c60, 0, {0xa0,0x01,0x1c,0x00,0xb4,0x00,0x2d,0xd0,0x48,0xf2,0x02,0x1e,0x21,0x85,0x20,0x20 },
+  16, 0x9c70, 0, {0xe8,0x09,0x72,0x02,0x8e,0x80,0x8f,0x01,0x20,0xc0,0x09,0x72,0x02,0x0e,0x80,0x87 },
+  16, 0x9c80, 0, {0x00,0x2d,0xcc,0x18,0x58,0x02,0x8e,0x00,0x85,0x00,0x21,0xc0,0x0b,0x72,0x02,0xe8 },
+  16, 0x9c90, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0x00,0xb4,0x80,0x2d,0xe0 },
+  16, 0x9ca0, 0, {0x0c,0x78,0x83,0x9a,0x00,0xed,0xd0,0x31,0xf4,0x0c,0x6a,0x03,0xde,0x82,0xc7,0x80 },
+  16, 0x9cb0, 0, {0x39,0xe0,0x0d,0xf8,0x83,0x5e,0xc2,0xc5,0x80,0x3d,0xe8,0x0c,0x68,0x03,0x12,0x00 },
+  16, 0x9cc0, 0, {0xcf,0x80,0x31,0xe0,0x0f,0x7e,0x83,0xea,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9cd0, 0, {0x08,0x0d,0xac,0x08,0xf8,0x00,0x3c,0xc0,0x0f,0xb3,0x03,0xec,0x00,0xf9,0x02,0x3e },
+  16, 0x9ce0, 0, {0xc8,0x0f,0xb0,0x03,0xed,0x40,0xfb,0x00,0xbe,0x80,0x0e,0xb3,0x03,0xed,0xc0,0xfb },
+  16, 0x9cf0, 0, {0x00,0x3e,0xd2,0x2e,0x80,0x03,0xec,0x02,0xf9,0x00,0x3e,0xc0,0x0f,0xb0,0x03,0xc2 },
+  16, 0x9d00, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfe,0x00,0xf0,0x91,0x33,0xe0 },
+  16, 0x9d10, 0, {0x8f,0xf8,0x03,0xfe,0x00,0xfd,0x80,0x3f,0xe0,0x0c,0x78,0x83,0x3f,0x00,0xcf,0x80 },
+  16, 0x9d20, 0, {0x3f,0xa0,0x0c,0xf8,0x03,0x3e,0x00,0xcd,0x80,0x3f,0xe0,0x0f,0xf8,0x13,0xfe,0x10 },
+  16, 0x9d30, 0, {0xff,0x80,0x3f,0x20,0x0f,0xf9,0x43,0xd0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9d40, 0, {0xa8,0x11,0x9c,0x00,0xb4,0xc1,0x31,0xc0,0x0b,0x70,0x02,0xd4,0x10,0xe5,0x20,0x2f },
+  16, 0x9d50, 0, {0xc8,0x0f,0x40,0x03,0x5c,0x00,0x87,0x00,0x2d,0x80,0x08,0x70,0x02,0x1c,0x40,0x87 },
+  16, 0x9d60, 0, {0x10,0x2d,0xc0,0x0b,0x76,0x02,0xdc,0x80,0xb7,0x00,0x2d,0xc0,0x0b,0x70,0x02,0xea },
+  16, 0x9d70, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x9c,0x00,0xb6,0x22,0x21,0xd0 },
+  16, 0x9d80, 0, {0x0b,0x70,0x82,0xd8,0x40,0xb5,0x02,0x2d,0xc0,0x88,0x65,0x02,0x0c,0x00,0x87,0x18 },
+  16, 0x9d90, 0, {0x2c,0x04,0x08,0x30,0x02,0x8c,0x02,0x85,0x00,0x2d,0xc0,0x0b,0x70,0x46,0x90,0x10 },
+  16, 0x9da0, 0, {0xb6,0x00,0x2d,0x00,0x0b,0x70,0x22,0xc4,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9db0, 0, {0x60,0x14,0xcc,0x08,0xb2,0x00,0xa4,0xc0,0x0b,0x30,0x42,0xc6,0x10,0xa1,0x00,0x2c },
+  16, 0x9dc0, 0, {0xc0,0x0a,0x00,0x02,0x4c,0x00,0x83,0x00,0x2c,0x08,0x08,0x30,0x02,0x8c,0x00,0x83 },
+  16, 0x9dd0, 0, {0x00,0x2c,0xc0,0x0b,0x18,0x82,0xc4,0x00,0xb0,0x00,0x2c,0x40,0x0b,0x30,0x12,0xd8 },
+  16, 0x9de0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x15,0xac,0x00,0x38,0x00,0x32,0x50 },
+  16, 0x9df0, 0, {0x0f,0xf0,0x03,0xe6,0x20,0xfd,0x00,0x3f,0xc0,0x08,0xd0,0x02,0x3c,0x02,0xcb,0x80 },
+  16, 0x9e00, 0, {0x3c,0x50,0x2c,0xf0,0x0a,0xbc,0x00,0xc9,0x00,0x3f,0xc0,0x0f,0xbe,0x03,0xac,0x00 },
+  16, 0x9e10, 0, {0xfa,0x02,0x2e,0xf7,0x4f,0xf0,0x03,0xee,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9e20, 0, {0x80,0x00,0xec,0x00,0xf1,0x00,0x3a,0xf0,0x0f,0xb0,0x03,0xe9,0x00,0xf9,0x01,0x3e },
+  16, 0x9e30, 0, {0xc0,0x0f,0x90,0x13,0xec,0x00,0xf9,0x00,0x3e,0x55,0x0f,0xb0,0x01,0x6c,0x00,0xfb },
+  16, 0x9e40, 0, {0x02,0x3e,0xc0,0x0f,0x90,0x73,0xe0,0x00,0xf8,0x41,0x3e,0x00,0x0f,0x30,0x01,0xe0 },
+  16, 0x9e50, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xfc,0x00,0xfc,0x00,0x33,0xc0 },
+  16, 0x9e60, 0, {0x1f,0xf0,0x13,0xf0,0x08,0xfd,0x02,0x3f,0xc0,0x8d,0xc0,0x03,0x3c,0x00,0xcf,0xa0 },
+  16, 0x9e70, 0, {0x3f,0x80,0x0c,0x70,0x03,0x3c,0x10,0xfc,0x00,0x37,0xc0,0x0f,0xe0,0x03,0xb0,0x00 },
+  16, 0x9e80, 0, {0xfe,0x00,0x3f,0xc0,0x0c,0xf0,0x03,0x04,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9e90, 0, {0x84,0x04,0x6e,0x00,0xb9,0xc2,0xa2,0xf0,0x0b,0xb0,0x42,0xeb,0x00,0xb9,0x00,0x2e },
+  16, 0x9ea0, 0, {0xc0,0x0f,0x18,0x03,0x6c,0x00,0xd9,0x81,0x2e,0xb0,0x0a,0xb0,0x42,0x2c,0x00,0xba },
+  16, 0x9eb0, 0, {0xc6,0x2e,0xc0,0x0b,0x8c,0x02,0xe3,0x00,0xb8,0xc0,0x3c,0xa0,0x0d,0xb0,0x02,0x20 },
+  16, 0x9ec0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2f,0x00,0xb8,0x80,0x22,0xe2 },
+  16, 0x9ed0, 0, {0x0b,0xb0,0x02,0xe6,0x20,0xb9,0x00,0x2c,0xc0,0x08,0xb8,0x02,0x0c,0x00,0x8b,0x00 },
+  16, 0x9ee0, 0, {0x2e,0x30,0x48,0xb0,0x02,0x2c,0x00,0xb9,0xc0,0x2e,0xc1,0x0b,0x88,0x02,0xee,0x10 },
+  16, 0x9ef0, 0, {0xb9,0xc0,0x2e,0x20,0x19,0xb0,0x02,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9f00, 0, {0x08,0x04,0x0c,0x00,0xb0,0x00,0x20,0xc0,0x0b,0x30,0x06,0xc0,0x00,0x91,0x00,0x2c },
+  16, 0x9f10, 0, {0xc0,0x49,0x80,0x02,0x4c,0x04,0x91,0x00,0x2c,0x00,0x8a,0x30,0x0a,0x0c,0x04,0xb1 },
+  16, 0x9f20, 0, {0x00,0x2c,0xc0,0x1b,0x00,0x12,0x49,0x10,0xb1,0x00,0x2e,0x20,0x09,0x30,0x02,0x02 },
+  16, 0x9f30, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x6c,0x00,0xb8,0x20,0x22,0xc0 },
+  16, 0x9f40, 0, {0x8b,0xf0,0x03,0xe0,0x08,0xfd,0x00,0x3f,0xc0,0x0c,0xa0,0x03,0x3c,0x00,0xcb,0x00 },
+  16, 0x9f50, 0, {0x3e,0x00,0x4c,0xf0,0x0a,0x3c,0x00,0xb9,0x00,0x37,0xc1,0x0f,0xa0,0x03,0xe0,0x00 },
+  16, 0x9f60, 0, {0xfa,0x00,0x3e,0x00,0x0d,0xf0,0x0b,0x00,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9f70, 0, {0xa0,0x1d,0xf0,0x01,0xfc,0x40,0x3f,0x80,0x4f,0xf0,0x02,0xf0,0x00,0xfd,0x00,0x3f },
+  16, 0x9f80, 0, {0xc1,0x0f,0xc0,0x03,0xfc,0x00,0xfd,0x00,0x3f,0x00,0x4f,0xf0,0x63,0xfc,0x00,0xfd },
+  16, 0x9f90, 0, {0x04,0x3f,0xc0,0x0f,0xc0,0x03,0xf0,0x80,0xfc,0x00,0x7b,0x00,0x0f,0xf0,0x43,0xe8 },
+  16, 0x9fa0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xf8,0x00,0xc8,0x10,0x33,0x04 },
+  16, 0x9fb0, 0, {0x0c,0x40,0x02,0x34,0x00,0xc8,0x85,0x1f,0xc0,0x2d,0xd9,0x03,0xfc,0xc0,0xdb,0x28 },
+  16, 0x9fc0, 0, {0x37,0x64,0x0f,0xdb,0x03,0x3e,0x00,0xff,0x25,0x3f,0xc8,0x0e,0xf2,0x03,0xfe,0x20 },
+  16, 0x9fd0, 0, {0xff,0xa4,0x37,0xc4,0x0c,0xc8,0x03,0x30,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9fe0, 0, {0x80,0x10,0xe8,0x00,0x88,0x20,0x22,0x00,0x08,0x88,0x12,0x26,0x04,0x89,0x82,0x2e },
+  16, 0x9ff0, 0, {0xf4,0x48,0xb8,0x02,0xfc,0xc4,0x98,0xc2,0x22,0x7c,0x4b,0x9d,0x42,0x26,0x08,0xbf },
+  16, 0xa000, 0, {0x18,0x77,0xe4,0x08,0xf1,0x82,0xef,0x00,0xbb,0xd0,0x22,0xd8,0x08,0x90,0x83,0x60 },
+  16, 0xa010, 0, {0x02,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x45,0xc8,0x04,0xa0,0x00,0x24,0x00 },
+  16, 0xa020, 0, {0x0a,0x00,0x02,0x0c,0x00,0x82,0x04,0x2c,0xe0,0x08,0x10,0x02,0xcc,0x80,0x83,0x00 },
+  16, 0xa030, 0, {0x24,0x00,0x0b,0x10,0x06,0xc8,0x01,0xb3,0x20,0x2c,0xc0,0x29,0x32,0x02,0xc8,0x08 },
+  16, 0xa040, 0, {0xb1,0x00,0x24,0xd0,0x08,0x82,0x02,0x62,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa050, 0, {0xc0,0x15,0xa8,0x00,0xa8,0x0c,0x26,0x00,0x0a,0x80,0x02,0x2c,0x14,0x8a,0x02,0x6e },
+  16, 0xa060, 0, {0xe0,0x08,0xb0,0x02,0x4c,0x08,0xa8,0x00,0x26,0x20,0x0b,0x9c,0x02,0xe4,0x00,0xbb },
+  16, 0xa070, 0, {0x04,0x22,0xc0,0x19,0xb0,0x02,0xe8,0x01,0xbb,0x11,0x02,0xc0,0x88,0x90,0x02,0xf0 },
+  16, 0xa080, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0xec,0x02,0xea,0x40,0xb6,0x60 },
+  16, 0xa090, 0, {0x2e,0x98,0x0b,0x20,0x02,0xc8,0x02,0x3e,0xc0,0x0d,0x98,0x03,0xec,0x02,0xdb,0x88 },
+  16, 0xa0a0, 0, {0xb6,0x21,0x0f,0x88,0x03,0xac,0x08,0xfb,0x00,0x2c,0xc0,0x0e,0xb0,0x43,0xe5,0x80 },
+  16, 0xa0b0, 0, {0xf0,0x60,0x36,0xc0,0x0c,0x01,0x43,0x48,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa0c0, 0, {0xe0,0x01,0xbc,0x00,0xd6,0x01,0x3b,0x64,0x85,0xd9,0x03,0xf0,0x0c,0xff,0x00,0x3e },
+  16, 0xa0d0, 0, {0xc1,0x0f,0xfc,0x21,0xec,0x00,0xd7,0x90,0x3b,0x40,0x0f,0x50,0x03,0x3c,0x00,0xff },
+  16, 0xa0e0, 0, {0x00,0x3f,0xc0,0x8e,0xf0,0x03,0xf4,0x40,0xfd,0x88,0x3f,0xc0,0x2f,0xd0,0x02,0x78 },
+  16, 0xa0f0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0x8c,0x00,0xda,0x40,0x3c,0x40 },
+  16, 0xa100, 0, {0x0f,0x10,0x03,0x48,0x00,0xf9,0x22,0x3c,0xc2,0x0e,0x90,0x83,0xec,0x02,0xdb,0x04 },
+  16, 0xa110, 0, {0x3a,0x08,0x0f,0x84,0x87,0xe8,0x00,0xcb,0x00,0x3e,0xc4,0x0e,0xb0,0x03,0xed,0x00 },
+  16, 0xa120, 0, {0xe8,0x42,0x3a,0xc0,0x0f,0x80,0x0b,0x10,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa130, 0, {0x88,0x05,0x2c,0x08,0x8a,0x00,0x2e,0x42,0x8b,0x90,0x02,0x28,0x18,0xbb,0x49,0x22 },
+  16, 0xa140, 0, {0xd0,0x38,0xbc,0x82,0xfc,0x00,0xe8,0x02,0x22,0x62,0xcb,0x9c,0x00,0xef,0x60,0xdf },
+  16, 0xa150, 0, {0x00,0x2f,0xc0,0x0b,0xf0,0x02,0xec,0x00,0x09,0x40,0x37,0xc0,0x0b,0x90,0x02,0x32 },
+  16, 0xa160, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x48,0x10,0x11,0x00,0x2c,0xa0 },
+  16, 0xa170, 0, {0x0b,0x20,0x02,0x44,0x00,0x90,0xc0,0x64,0x34,0x28,0x34,0x02,0xcc,0x00,0x93,0x84 },
+  16, 0xa180, 0, {0x28,0x40,0x0b,0x08,0x00,0xce,0x00,0x93,0x00,0x2c,0xc2,0x0a,0x30,0x02,0xc0,0x00 },
+  16, 0xa190, 0, {0xb2,0x40,0x22,0xc0,0x0b,0x20,0x02,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa1a0, 0, {0x70,0x01,0x1a,0x40,0x85,0x80,0x2d,0xa0,0x0b,0x68,0x06,0x16,0x80,0xbd,0x90,0x25 },
+  16, 0xa1b0, 0, {0x24,0x18,0x7b,0x42,0xde,0x40,0xa0,0x80,0x21,0xe0,0x0b,0x68,0x02,0xd6,0x00,0x97 },
+  16, 0xa1c0, 0, {0x90,0x2d,0xe0,0x0b,0x78,0x02,0xce,0x40,0x92,0x80,0x6d,0xe4,0x0b,0x78,0x02,0x08 },
+  16, 0xa1d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x28,0x00,0xd1,0x80,0x3c,0x88 },
+  16, 0xa1e0, 0, {0x0b,0x22,0x03,0x4e,0x80,0xf2,0xa1,0x3c,0x24,0x2a,0x39,0x03,0xcc,0x40,0xd3,0xac },
+  16, 0xa1f0, 0, {0x38,0xc5,0x0f,0x30,0x82,0xc8,0x00,0xd3,0x00,0x3c,0xc0,0x0e,0x30,0x13,0xc0,0x00 },
+  16, 0xa200, 0, {0xf1,0x00,0x38,0xc0,0x0f,0xa0,0x03,0x1a,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa210, 0, {0x40,0x1d,0xb8,0x10,0xfd,0x34,0x3e,0x80,0x0f,0xe0,0x03,0xee,0x00,0x72,0x00,0x3a },
+  16, 0xa220, 0, {0x00,0x0f,0xb0,0x63,0xec,0x40,0xf8,0x22,0x3e,0xc0,0x0f,0xf0,0x03,0xd4,0x40,0xff },
+  16, 0xa230, 0, {0x00,0x3f,0xd2,0x0f,0xf0,0x03,0xec,0x00,0xcf,0x00,0x37,0xc0,0x0f,0xf0,0x03,0xd0 },
+  16, 0xa240, 0, {0x06,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xee,0x00,0xeb,0x00,0x36,0xe0 },
+  16, 0xa250, 0, {0x0d,0xb0,0x03,0x20,0x00,0xf0,0x80,0x33,0xc0,0x08,0xb8,0x03,0x2c,0x80,0xcb,0x00 },
+  16, 0xa260, 0, {0x32,0x80,0x0f,0xa0,0x13,0x6e,0x08,0xcb,0x28,0x32,0xe0,0x0d,0xb4,0x83,0xe2,0x00 },
+  16, 0xa270, 0, {0xca,0x00,0x3e,0xe0,0x0c,0xa8,0x03,0x02,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa280, 0, {0xc8,0x11,0x8c,0x04,0x83,0x00,0x21,0xc0,0x48,0x70,0x02,0x10,0x00,0xb7,0x02,0x21 },
+  16, 0xa290, 0, {0xc0,0x4a,0x70,0x02,0x0d,0x48,0xd4,0x00,0x35,0xc0,0x0e,0x60,0x02,0xdc,0x00,0xa7 },
+  16, 0xa2a0, 0, {0x40,0x29,0xc0,0x09,0x72,0x02,0xd4,0x10,0xa6,0x02,0x2f,0xc8,0x08,0x70,0x02,0x12 },
+  16, 0xa2b0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x9e,0x00,0xa7,0x80,0x20,0xe0 },
+  16, 0xa2c0, 0, {0x0a,0x38,0x02,0x1a,0x00,0xb5,0x80,0x21,0xe0,0x08,0xf8,0x22,0x5c,0x81,0x83,0x80 },
+  16, 0xa2d0, 0, {0x21,0xa1,0x0b,0x78,0x82,0x5a,0x10,0x83,0xa0,0x20,0xe8,0x0a,0x7b,0x02,0xda,0x00 },
+  16, 0xa2e0, 0, {0x97,0xc0,0x2d,0xe4,0x08,0xe8,0x02,0x08,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa2f0, 0, {0x08,0x14,0xcc,0x00,0x83,0x10,0x20,0xc0,0x0a,0x30,0x02,0x08,0x08,0xb3,0x70,0x20 },
+  16, 0xa300, 0, {0xf8,0x0a,0x30,0x42,0x4c,0x04,0x93,0x14,0x26,0xc4,0x0a,0x38,0x02,0xcc,0x00,0xa3 },
+  16, 0xa310, 0, {0x00,0x28,0xc0,0xaa,0x30,0x02,0xce,0x40,0xb3,0x88,0x2c,0xc0,0x28,0x30,0x0a,0x12 },
+  16, 0xa320, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa9,0x00,0xea,0x80,0xb6,0x90 },
+  16, 0xa330, 0, {0x2f,0x24,0x0b,0x39,0x04,0xbe,0xc0,0x33,0x92,0x0c,0xa0,0x0b,0x68,0x18,0xce,0xc0 },
+  16, 0xa340, 0, {0x33,0x80,0x0f,0xe9,0x43,0x78,0x00,0xca,0x00,0x32,0x80,0x0f,0xa0,0x13,0xf8,0x48 },
+  16, 0xa350, 0, {0xde,0x00,0x3e,0x80,0x0c,0xe0,0x02,0x3a,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa360, 0, {0x48,0x00,0xe0,0x24,0xf8,0x00,0x3e,0x12,0x0d,0x80,0x93,0xb0,0x28,0xf8,0x00,0xbc },
+  16, 0xa370, 0, {0x00,0x0f,0x84,0x03,0xa0,0x00,0xf0,0x00,0x3e,0x02,0x0e,0x80,0x00,0xe0,0x00,0xf8 },
+  16, 0xa380, 0, {0x01,0x3e,0x00,0x0d,0x80,0x03,0xe0,0x00,0xe8,0x00,0x3e,0x00,0x0f,0x80,0x03,0xd2 },
+  16, 0xa390, 0, {0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xf9,0x00,0xb2,0x70 },
+  16, 0xa3a0, 0, {0x0f,0x90,0x01,0x04,0x00,0xc9,0x00,0x3e,0x40,0x0c,0x98,0x03,0xe4,0x04,0xe9,0x08 },
+  16, 0xa3b0, 0, {0x3a,0x48,0x0c,0x9a,0x03,0xe4,0x00,0xf9,0x00,0x36,0x40,0x0b,0x10,0x0b,0x26,0x80 },
+  16, 0xa3c0, 0, {0xf1,0x80,0x32,0x40,0x0f,0x90,0x03,0xc2,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa3d0, 0, {0x80,0x04,0x64,0x00,0xb9,0x00,0x22,0x61,0x0b,0x90,0x02,0x24,0x08,0x89,0x00,0x2e },
+  16, 0xa3e0, 0, {0x40,0x0d,0x9a,0x02,0xe4,0x08,0xa9,0x00,0x22,0x78,0x0d,0x94,0x06,0xe4,0x10,0xb9 },
+  16, 0xa3f0, 0, {0x00,0x22,0x50,0x0b,0x90,0x02,0x25,0x80,0xb9,0x80,0x36,0x40,0x0b,0x90,0x02,0xe0 },
+  16, 0xa400, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0xb5,0x00,0x23,0x42 },
+  16, 0xa410, 0, {0x0b,0xd0,0x0e,0xb4,0x00,0x89,0x04,0x2e,0x60,0x08,0x91,0x02,0xc4,0x04,0xb9,0x04 },
+  16, 0xa420, 0, {0x2a,0xc0,0x08,0x94,0x02,0xe4,0x10,0xb1,0x00,0x26,0x42,0x0a,0x90,0x02,0x24,0x00 },
+  16, 0xa430, 0, {0xb9,0x21,0x62,0x40,0x0b,0x90,0x02,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa440, 0, {0x08,0x04,0x05,0x00,0xb5,0x40,0x21,0x50,0x4b,0x50,0x06,0x94,0x02,0x81,0x00,0x2c },
+  16, 0xa450, 0, {0x60,0x29,0x14,0x06,0xc5,0x00,0xa1,0x22,0x20,0x51,0x89,0x14,0x02,0xc4,0x00,0xb1 },
+  16, 0xa460, 0, {0x20,0x20,0x48,0x0b,0x14,0x02,0x04,0x01,0xb1,0x00,0x04,0x50,0x0b,0x10,0x02,0xc2 },
+  16, 0xa470, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x08,0xb8,0x00,0x32,0x00 },
+  16, 0xa480, 0, {0x8f,0x80,0x03,0xb0,0x00,0x88,0x00,0x3e,0x00,0x0c,0x80,0x03,0xe0,0x00,0xe8,0x04 },
+  16, 0xa490, 0, {0x3a,0x00,0x0c,0x80,0x02,0xe0,0x00,0xf8,0x50,0x36,0x00,0x0f,0x80,0x03,0x20,0x04 },
+  16, 0xa4a0, 0, {0xf8,0x01,0x12,0x00,0x4f,0x80,0x07,0xee,0x07,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa4b0, 0, {0x98,0x1d,0xe5,0x10,0xf9,0x40,0x3e,0x50,0x0f,0x94,0x02,0x65,0x01,0xfd,0x01,0x3d },
+  16, 0xa4c0, 0, {0x50,0x4f,0x50,0x13,0xe5,0x00,0xfd,0x10,0x1f,0x50,0x07,0xd4,0x43,0xd4,0x00,0xf9 },
+  16, 0xa4d0, 0, {0x10,0x1e,0x44,0x0f,0x94,0x03,0xd5,0x00,0xfd,0x40,0x3e,0x50,0x0f,0x52,0x83,0xee },
+  16, 0xa4e0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x15,0xe4,0x40,0xf9,0x60,0x3f,0x44 },
+  16, 0xa4f0, 0, {0x0f,0xd0,0xc3,0xe4,0x30,0xf9,0x01,0x3e,0x42,0x0c,0xd0,0x03,0xe7,0x80,0xdd,0xa0 },
+  16, 0xa500, 0, {0x33,0x40,0x0c,0xd0,0x03,0xfc,0x00,0xc9,0x90,0x3f,0x68,0x1e,0x91,0x03,0x34,0x00 },
+  16, 0xa510, 0, {0xfd,0x00,0x3e,0x68,0x0c,0x94,0x03,0x0e,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa520, 0, {0x39,0x10,0xe0,0x00,0xb8,0x42,0x2e,0x09,0x0b,0x84,0x02,0xe1,0x04,0xbe,0x00,0x2e },
+  16, 0xa530, 0, {0x10,0x08,0x80,0x22,0xc2,0x80,0x88,0x40,0x22,0x00,0x0a,0x80,0x02,0xe0,0x00,0xa8 },
+  16, 0xa540, 0, {0xd0,0x2e,0x10,0x4b,0x8a,0x03,0x60,0x00,0xba,0x00,0x2e,0x30,0x08,0x8a,0x02,0x86 },
+  16, 0xa550, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xc5,0x80,0xb1,0x60,0x6c,0xd0 },
+  16, 0xa560, 0, {0x0b,0x10,0x00,0xdc,0x0c,0xb5,0x00,0x2c,0x41,0x08,0x10,0x02,0xc5,0x80,0x91,0x10 },
+  16, 0xa570, 0, {0x68,0xc0,0x08,0x30,0x02,0xe4,0x0c,0x81,0x22,0x2c,0x50,0x08,0x10,0x42,0x04,0x00 },
+  16, 0xa580, 0, {0xa1,0x00,0x2c,0x5a,0x28,0x90,0x02,0x52,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa590, 0, {0x18,0x15,0xa4,0x00,0xb9,0x00,0x2e,0x41,0x0b,0x90,0x12,0xf4,0x80,0xbf,0x00,0x2e },
+  16, 0xa5a0, 0, {0x40,0x08,0x90,0x02,0xe4,0x00,0xa9,0x60,0x60,0x42,0x0a,0x94,0x12,0xe5,0x00,0xa9 },
+  16, 0xa5b0, 0, {0x00,0x2e,0x40,0x0b,0x90,0x02,0x64,0x20,0xb9,0x00,0x0e,0x40,0x09,0x90,0x02,0xc6 },
+  16, 0xa5c0, 0, {0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x05,0xe4,0x00,0xf9,0x00,0x3e,0x41 },
+  16, 0xa5d0, 0, {0x0f,0x90,0x23,0xe4,0x00,0xf9,0x00,0x3e,0x40,0x0c,0x90,0x03,0xe4,0x04,0xd1,0xc0 },
+  16, 0xa5e0, 0, {0xba,0x70,0x0c,0x98,0x03,0xc4,0x00,0xc9,0x00,0x3e,0x40,0x0e,0x90,0x03,0x25,0x40 },
+  16, 0xa5f0, 0, {0xe9,0x40,0x3e,0x40,0x0c,0x10,0x03,0x68,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa600, 0, {0x68,0x01,0xa4,0x14,0xf9,0x00,0x3e,0x40,0x0f,0x90,0x23,0xe4,0x08,0xf9,0xa0,0x3c },
+  16, 0xa610, 0, {0xc2,0x2f,0x90,0x03,0xc4,0x00,0xd9,0x80,0x3e,0x70,0x0f,0x91,0x43,0xe4,0x00,0xf9 },
+  16, 0xa620, 0, {0x00,0x3e,0x40,0x1f,0x90,0x13,0xe6,0x20,0xf9,0xa0,0x3c,0x40,0x4e,0x90,0x03,0x9a },
+  16, 0xa630, 0, {0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x00,0xa0,0x00,0xf8,0x00,0x3e,0x02 },
+  16, 0xa640, 0, {0x0f,0x80,0x13,0x20,0x0c,0xfc,0x01,0x3e,0x00,0x0c,0x80,0x03,0xe0,0x00,0xc8,0x50 },
+  16, 0xa650, 0, {0x32,0x00,0x0f,0x80,0x0b,0x20,0x08,0xf8,0x00,0x32,0x00,0x2c,0x80,0x43,0xe0,0x40 },
+  16, 0xa660, 0, {0xf8,0x02,0x3a,0x00,0x8f,0x80,0x03,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa670, 0, {0xa8,0x85,0x28,0x08,0x3a,0x00,0x0f,0x80,0x4b,0xa1,0x02,0x28,0x00,0xba,0x82,0x2e },
+  16, 0xa680, 0, {0x88,0x48,0xe4,0x02,0xe8,0x00,0xae,0x90,0xa3,0x90,0x0b,0xe0,0x00,0x38,0x00,0xba },
+  16, 0xa690, 0, {0x00,0x37,0xa0,0x08,0xa0,0x02,0xf8,0x00,0x9e,0xe0,0x22,0x80,0x0b,0xa0,0x23,0x42 },
+  16, 0xa6a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x10,0x33,0x00,0x2c,0xd0 },
+  16, 0xa6b0, 0, {0x0b,0x14,0x02,0x0c,0x00,0xb2,0x91,0x2c,0xd0,0x08,0x3e,0x02,0x4c,0x00,0x83,0x40 },
+  16, 0xa6c0, 0, {0x24,0xc2,0x0b,0x36,0x00,0x8c,0x00,0xb3,0x00,0x20,0xc0,0x09,0xb0,0x02,0xce,0x00 },
+  16, 0xa6d0, 0, {0xb3,0xcc,0x68,0xc0,0x0b,0x30,0x02,0x02,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa6e0, 0, {0xe0,0x01,0x1c,0x88,0xb7,0x25,0x2d,0xc0,0x8b,0x58,0x1a,0x1c,0x08,0xb6,0x00,0x2d },
+  16, 0xa6f0, 0, {0xc0,0x08,0x74,0x02,0xdc,0x40,0xa5,0x00,0x25,0xc0,0x1b,0x78,0x02,0x94,0x08,0xb7 },
+  16, 0xa700, 0, {0x80,0x25,0xe3,0x0a,0x71,0x02,0xdc,0x00,0x97,0x83,0x21,0xc8,0x8b,0xf1,0x02,0x48 },
+  16, 0xa710, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1f,0x00,0xf7,0xe2,0x7d,0xe0 },
+  16, 0xa720, 0, {0x0f,0x58,0x43,0x1e,0x18,0xf6,0x80,0x7c,0xe0,0x2c,0x68,0x02,0x5e,0x90,0xc3,0x80 },
+  16, 0xa730, 0, {0x35,0xe0,0x0f,0xf8,0x03,0x9e,0x04,0xff,0xa1,0x20,0xa1,0x0d,0x78,0x03,0xd6,0x00 },
+  16, 0xa740, 0, {0xf7,0x80,0x39,0xf8,0x0f,0x78,0x03,0x0a,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa750, 0, {0x48,0x1d,0xac,0x00,0xfb,0x40,0x7f,0x41,0x0f,0x10,0x03,0xec,0x04,0xfa,0x00,0x3e },
+  16, 0xa760, 0, {0xd0,0x0f,0xa0,0x03,0xed,0x00,0xe9,0x00,0x2a,0x00,0x0f,0xb0,0x03,0x64,0x00,0xfb },
+  16, 0xa770, 0, {0x40,0x3e,0xc0,0x0d,0xb0,0x03,0xe4,0x00,0xd3,0x00,0x36,0xc0,0x0f,0x38,0x03,0xc2 },
+  16, 0xa780, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xfe,0x48,0xcf,0xc0,0x33,0x60 },
+  16, 0xa790, 0, {0x8c,0xc8,0x43,0xd6,0x00,0xcc,0x94,0x3f,0xb0,0x0d,0xf8,0x03,0x7f,0x00,0xdf,0x80 },
+  16, 0xa7a0, 0, {0x3f,0x60,0x0f,0xd8,0x03,0xde,0x00,0xcf,0xca,0x3d,0x60,0x0c,0xf8,0x13,0x3a,0x44 },
+  16, 0xa7b0, 0, {0xdd,0x80,0x3f,0xe0,0x0f,0xf8,0x43,0x18,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa7c0, 0, {0xa8,0x11,0x9c,0x00,0x8f,0x11,0x33,0xc0,0x48,0x41,0x12,0xc4,0x48,0x84,0x11,0x2c },
+  16, 0xa7d0, 0, {0xec,0x2a,0xba,0x03,0x3c,0x40,0xd7,0x48,0x2d,0x41,0x0b,0x60,0x02,0xd4,0x00,0xd7 },
+  16, 0xa7e0, 0, {0x01,0x3d,0xc0,0x0d,0xf0,0x03,0x5a,0x00,0x84,0x18,0x2d,0xc0,0x0b,0x70,0x03,0x6a },
+  16, 0xa7f0, 0, {0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x8c,0x08,0x87,0x00,0x21,0x40 },
+  16, 0xa800, 0, {0x09,0x40,0x02,0xd4,0x00,0xa4,0x92,0x2d,0xc8,0x09,0x62,0x82,0x5c,0x00,0x87,0x00 },
+  16, 0xa810, 0, {0x2d,0xc0,0x0b,0x50,0x02,0xfc,0x00,0x87,0x00,0x2d,0x04,0x08,0x70,0x02,0x1c,0x80 },
+  16, 0xa820, 0, {0xb5,0x00,0x2d,0xc0,0x0b,0xf0,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa830, 0, {0x60,0x10,0xcc,0x00,0x83,0x00,0x20,0x40,0x09,0x00,0x22,0xc7,0x00,0xa0,0x41,0x2c },
+  16, 0xa840, 0, {0xc1,0x4b,0x08,0x02,0x2c,0x00,0x93,0x40,0x2c,0x7c,0x0b,0x38,0x02,0xc7,0x20,0x93 },
+  16, 0xa850, 0, {0x00,0x2c,0xc0,0x09,0x30,0x02,0x4f,0x84,0xb0,0x80,0x2c,0xc0,0x0b,0x32,0x10,0x50 },
+  16, 0xa860, 0, {0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xaa,0x15,0xbc,0x02,0xcf,0x00,0xb2,0x40 },
+  16, 0xa870, 0, {0x0d,0x10,0x03,0xe8,0x24,0xeb,0xc1,0x3e,0xc0,0x2d,0x98,0x13,0x7c,0x0a,0xc2,0x43 },
+  16, 0xa880, 0, {0x3e,0xb0,0x0f,0xa9,0x03,0xe9,0x20,0xcf,0x00,0x3e,0xc0,0x8c,0xf0,0x03,0x0d,0x20 },
+  16, 0xa890, 0, {0xfa,0xc0,0x3f,0xc0,0x0f,0x74,0x01,0x2a,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa8a0, 0, {0x80,0x00,0xec,0x00,0xfb,0x02,0x3a,0x40,0x8e,0x90,0x03,0xe8,0x14,0x5b,0x50,0x3c },
+  16, 0xa8b0, 0, {0x50,0x4e,0x84,0x03,0xec,0x00,0xf8,0x40,0x3e,0x80,0x07,0x81,0x03,0xec,0x08,0xf3 },
+  16, 0xa8c0, 0, {0x00,0x3a,0xc0,0x9f,0x30,0x03,0xec,0x00,0xcb,0x20,0x3e,0xc0,0x0f,0xb0,0x23,0xe8 },
+  16, 0xa8d0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x90,0xfc,0x00,0xff,0x00,0x3f,0x40 },
+  16, 0xa8e0, 0, {0x0f,0xd0,0x03,0x38,0x20,0xcf,0x08,0x32,0xc1,0x0e,0xd0,0x03,0xfc,0x00,0xfe,0x08 },
+  16, 0xa8f0, 0, {0x31,0xe5,0x0e,0xe4,0x03,0x3a,0x00,0xff,0x00,0x33,0x80,0x0f,0xf0,0x2b,0x24,0x00 },
+  16, 0xa900, 0, {0xcc,0xa0,0x3f,0xc0,0x0f,0xf0,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa910, 0, {0x80,0x04,0x6c,0x00,0xbb,0x00,0x3a,0x69,0x0b,0x90,0x6e,0x08,0x00,0x83,0x41,0x36 },
+  16, 0xa920, 0, {0x40,0xc8,0x88,0xc6,0xec,0x00,0x88,0x40,0x36,0x80,0x0d,0xa8,0x03,0x6e,0x50,0xbb },
+  16, 0xa930, 0, {0x00,0x36,0xc0,0x0b,0xb0,0x02,0x24,0x00,0xd9,0x08,0x2e,0xc0,0x0b,0xb0,0x03,0xe0 },
+  16, 0xa940, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0xbb,0x00,0x2e,0x60 },
+  16, 0xa950, 0, {0x03,0x80,0x02,0x20,0x00,0x89,0x01,0x22,0x58,0x08,0x98,0x22,0xec,0x01,0xab,0x00 },
+  16, 0xa960, 0, {0x22,0x00,0x0a,0x10,0x02,0x28,0x00,0xbb,0x00,0x22,0x40,0x0b,0xb0,0x02,0x28,0x00 },
+  16, 0xa970, 0, {0x8a,0x00,0x2e,0xc0,0x0b,0xb0,0x42,0x20,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa980, 0, {0x08,0x04,0x0c,0x00,0xb3,0x00,0x28,0x40,0x8b,0x00,0x02,0x02,0x40,0x89,0x01,0x24 },
+  16, 0xa990, 0, {0xd2,0x28,0x10,0x02,0xcc,0x00,0x83,0x10,0x24,0x20,0x08,0x08,0x02,0x4e,0x00,0xb3 },
+  16, 0xa9a0, 0, {0x04,0xa0,0xc0,0x0b,0x30,0x02,0x08,0x88,0x92,0x00,0x2c,0xc0,0x0b,0xb0,0x02,0xc2 },
+  16, 0xa9b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x6c,0x00,0xff,0x00,0x3e,0x00 },
+  16, 0xa9c0, 0, {0x0f,0x80,0x02,0x20,0x10,0x89,0x50,0x22,0xd8,0x2e,0x96,0x22,0xfc,0x00,0xeb,0x40 },
+  16, 0xa9d0, 0, {0x32,0xc0,0x0a,0x90,0x03,0x28,0x00,0xff,0x00,0x22,0x00,0x0f,0xb0,0x03,0x2c,0xa0 },
+  16, 0xa9e0, 0, {0xc8,0x00,0x3e,0xc0,0x0f,0xb0,0x03,0x00,0x06,0x10,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa9f0, 0, {0xa0,0x19,0xfc,0x00,0xff,0x0c,0x3b,0x00,0x0f,0xc0,0x02,0x70,0x90,0xfd,0x00,0x3e },
+  16, 0xaa00, 0, {0xc9,0x0f,0x96,0xc3,0xfc,0x00,0xff,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0xfc,0x04,0xff },
+  16, 0xaa10, 0, {0x04,0x3f,0xc0,0x0f,0xf0,0x03,0xec,0x00,0xfc,0x00,0x3f,0xc0,0x0f,0x70,0x03,0xe8 },
+  16, 0xaa20, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xdc,0x80,0xfb,0x28,0x3f,0x00 },
+  16, 0xaa30, 0, {0x0c,0xc1,0x0b,0xf1,0x02,0xed,0x00,0x37,0x30,0x2c,0xf1,0x03,0xb2,0x40,0xff,0x00 },
+  16, 0xaa40, 0, {0xbb,0xc0,0x0f,0x48,0x06,0xb2,0x00,0xfc,0x80,0x3b,0xcc,0x0c,0xf0,0x03,0x70,0x80 },
+  16, 0xaa50, 0, {0xdf,0x28,0x33,0x04,0x0f,0xf4,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xaa60, 0, {0x80,0x10,0xff,0x40,0xbf,0x60,0x2e,0x21,0x08,0x82,0x02,0x20,0x00,0xa9,0x28,0x2a },
+  16, 0xaa70, 0, {0x00,0x09,0xfa,0x02,0x20,0x00,0xbf,0x51,0x23,0xd8,0x09,0x98,0x02,0xe4,0x30,0xb0 },
+  16, 0xaa80, 0, {0x00,0x23,0xd0,0x08,0xf5,0xa2,0x25,0xa4,0x8f,0x42,0x3c,0x10,0x0b,0xb0,0x0a,0x20 },
+  16, 0xaa90, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x00,0xb3,0x08,0x2c,0x00 },
+  16, 0xaaa0, 0, {0x28,0x00,0x1a,0xc0,0x84,0x20,0x00,0x24,0xc8,0x4b,0x31,0x42,0xc0,0x00,0x93,0x02 },
+  16, 0xaab0, 0, {0x20,0xc6,0x08,0x00,0x06,0xc0,0x81,0xb3,0x00,0x2c,0xd8,0x09,0x32,0x02,0xa0,0x40 },
+  16, 0xaac0, 0, {0x93,0x01,0x24,0x4c,0x0b,0x32,0x02,0x22,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xaad0, 0, {0xc0,0x11,0xac,0x00,0xbb,0x02,0x2e,0x0a,0x08,0x80,0x82,0x60,0x00,0xa8,0x00,0x2e },
+  16, 0xaae0, 0, {0xe0,0x1b,0xb0,0x02,0x62,0x01,0x3b,0x00,0x22,0xc1,0x09,0x90,0x02,0xe2,0x00,0xbb },
+  16, 0xaaf0, 0, {0x60,0x26,0xc1,0x08,0xb0,0x2a,0x26,0x00,0x9b,0x04,0x2e,0x21,0x0b,0xb0,0x02,0x30 },
+  16, 0xab00, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x11,0xec,0x10,0xfb,0x00,0x3e,0x10 },
+  16, 0xab10, 0, {0x08,0x84,0x13,0xec,0x02,0xa9,0x04,0x36,0x20,0x0f,0xb0,0x03,0xee,0x80,0xfb,0x00 },
+  16, 0xab20, 0, {0x3a,0xc0,0x0c,0xa0,0x03,0xa2,0x80,0x79,0x40,0x1e,0xc0,0x8c,0xb0,0x63,0x6a,0x10 },
+  16, 0xab30, 0, {0xd3,0x00,0x36,0xa2,0x07,0xb0,0x03,0x00,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xab40, 0, {0xe0,0x01,0xbc,0x00,0xff,0x00,0x3e,0x20,0x4d,0x41,0x03,0x9c,0x00,0xfd,0x20,0xab },
+  16, 0xab50, 0, {0x00,0x0c,0xf0,0x03,0xb8,0x00,0xf7,0x00,0x3f,0xc0,0x4d,0xc9,0x03,0xf4,0x00,0xff },
+  16, 0xab60, 0, {0x00,0x3b,0xc0,0x2e,0xf0,0x00,0xf0,0x00,0xef,0x00,0x3f,0x00,0x4b,0x70,0x03,0xf8 },
+  16, 0xab70, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x80,0xeb,0x00,0x7e,0x10 },
+  16, 0xab80, 0, {0x2e,0x84,0x03,0xec,0x00,0xe0,0x00,0x32,0x50,0x0f,0xb0,0x86,0x25,0x00,0xdb,0x20 },
+  16, 0xab90, 0, {0x3a,0xc0,0x0d,0xb0,0x63,0xe1,0x10,0xfb,0x48,0x38,0xc1,0x0f,0x30,0x03,0x2c,0x04 },
+  16, 0xaba0, 0, {0xfb,0x08,0x32,0xc0,0x0c,0xb0,0x0b,0x90,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xabb0, 0, {0xc8,0x05,0x3c,0x00,0x8f,0x00,0x64,0x29,0x28,0x80,0x03,0xec,0x02,0xe8,0x04,0xa8 },
+  16, 0xabc0, 0, {0x56,0x08,0xfc,0x07,0xe0,0x00,0x0f,0xa0,0xbf,0xc0,0x0b,0x95,0x02,0xa0,0x00,0xbb },
+  16, 0xabd0, 0, {0x05,0x37,0xc0,0x89,0xf0,0x0a,0x0d,0xc8,0xbf,0x08,0x2a,0x80,0x08,0xf0,0x02,0x32 },
+  16, 0xabe0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x01,0xb3,0x02,0x24,0xe0 },
+  16, 0xabf0, 0, {0x0a,0x30,0x12,0x80,0x03,0xa3,0x00,0xa8,0x00,0x02,0xb8,0x22,0xc0,0x00,0xb3,0x00 },
+  16, 0xac00, 0, {0x28,0xc1,0x0b,0x04,0x02,0x08,0x00,0xb9,0x40,0x28,0xc0,0x0b,0x30,0x02,0x03,0x04 },
+  16, 0xac10, 0, {0xb3,0x44,0x20,0x00,0x4a,0x30,0x02,0x38,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xac20, 0, {0x20,0x01,0x1e,0x20,0x17,0xa0,0x65,0xec,0x08,0x38,0x02,0xc2,0x41,0xb3,0x92,0x2b },
+  16, 0xac30, 0, {0x64,0x0a,0x38,0x02,0x36,0x01,0xb7,0x90,0x2d,0xe0,0x03,0xf8,0x00,0x9a,0x00,0xb5 },
+  16, 0xac40, 0, {0x80,0x2d,0xe0,0x89,0x78,0x12,0x1e,0x00,0xb7,0x80,0x29,0xe0,0x0a,0x78,0x02,0x08 },
+  16, 0xac50, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0x73,0xb0,0x24,0xc8 },
+  16, 0xac60, 0, {0x4e,0x30,0x0a,0x80,0x02,0xe2,0x00,0x38,0x94,0x0e,0x31,0xa2,0xc8,0x00,0x73,0x00 },
+  16, 0xac70, 0, {0x18,0xc4,0x05,0x00,0x03,0x00,0x00,0xf3,0x00,0x38,0xc0,0x07,0xb1,0x03,0x00,0x00 },
+  16, 0xac80, 0, {0xf3,0x01,0x30,0x41,0x0e,0xb0,0x03,0x92,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xac90, 0, {0x40,0x1d,0xbd,0x00,0xef,0x10,0x26,0xc8,0x03,0xb1,0x03,0xe0,0x00,0xea,0x81,0x78 },
+  16, 0xaca0, 0, {0xc5,0x0c,0xb5,0xe3,0xdc,0x00,0xc3,0x00,0x3e,0xc1,0x0f,0xf0,0x83,0xb0,0x00,0xff },
+  16, 0xacb0, 0, {0x00,0x37,0xc0,0x0d,0xf4,0x03,0xe4,0x00,0xf7,0x00,0x3f,0x40,0x0d,0xf0,0x03,0xd0 },
+  16, 0xacc0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xed,0x10,0xcb,0x28,0x3e,0xc0 },
+  16, 0xacd0, 0, {0x0d,0xb0,0x13,0xac,0x10,0xfb,0x00,0x3a,0x80,0x04,0xb4,0x03,0xac,0x00,0xfb,0x04 },
+  16, 0xace0, 0, {0x3e,0xc0,0x0f,0xa4,0xb3,0xe0,0x00,0xfb,0x80,0x32,0xc0,0x0f,0xb0,0x03,0xe8,0x00 },
+  16, 0xacf0, 0, {0xfb,0x48,0xb2,0x80,0x0f,0xb0,0x43,0xea,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xad00, 0, {0x48,0x11,0x9c,0x02,0x87,0x44,0x38,0xc0,0x8d,0x30,0x02,0x4c,0x00,0xff,0x00,0x21 },
+  16, 0xad10, 0, {0xc0,0x08,0x70,0x03,0x9c,0x00,0xb3,0x50,0x21,0xd4,0x4e,0x62,0x02,0xd0,0x00,0xbf },
+  16, 0xad20, 0, {0x00,0x35,0xd4,0x09,0x70,0x22,0xd8,0x00,0xbf,0x22,0x21,0xc0,0x0b,0x72,0x02,0xd2 },
+  16, 0xad30, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x40,0x87,0x80,0x2d,0xe0 },
+  16, 0xad40, 0, {0x09,0x78,0x02,0xde,0x00,0xb6,0x80,0x29,0xa1,0x28,0x7a,0x32,0xde,0x00,0x37,0xa0 },
+  16, 0xad50, 0, {0x25,0xe0,0x09,0x78,0x06,0xd2,0x00,0xb7,0x80,0x21,0xe8,0x0b,0x79,0x02,0xde,0x00 },
+  16, 0xad60, 0, {0xb7,0x90,0x21,0xe0,0x0b,0x79,0x02,0xf0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xad70, 0, {0x48,0x14,0xcc,0x04,0x83,0x01,0x28,0xc0,0x89,0xb0,0x0a,0x4f,0x00,0xb2,0x00,0x20 },
+  16, 0xad80, 0, {0xc4,0x88,0x30,0x16,0xcf,0x00,0xbb,0x04,0x20,0xc1,0x0a,0x32,0x06,0xc2,0x00,0xb3 },
+  16, 0xad90, 0, {0x00,0x24,0xc0,0x09,0x30,0x42,0xef,0x10,0xb3,0x00,0x20,0xc0,0x0b,0x30,0x02,0xd2 },
+  16, 0xada0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x00,0x4a,0x00,0x3e,0x80 },
+  16, 0xadb0, 0, {0x2d,0xa0,0x0b,0xaa,0x80,0xfe,0x00,0x2b,0x80,0x0c,0xa0,0x43,0xfb,0x30,0xfa,0x00 },
+  16, 0xadc0, 0, {0x3e,0x80,0x0f,0xa0,0x83,0xfa,0x04,0xfe,0x18,0x22,0x80,0x0f,0xa0,0x03,0xfa,0x84 },
+  16, 0xadd0, 0, {0xf2,0x00,0x33,0xa2,0x0f,0xa0,0x03,0xf2,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xade0, 0, {0x48,0x00,0xe0,0x00,0xf0,0x00,0x3e,0x00,0x2f,0x80,0x03,0xa0,0x20,0xfc,0x02,0x3e },
+  16, 0xadf0, 0, {0x00,0x1f,0x84,0x03,0xa0,0x00,0xf8,0x40,0x3e,0x00,0x4f,0x80,0x01,0xe0,0x40,0xf8 },
+  16, 0xae00, 0, {0x40,0x3e,0x00,0x0d,0x80,0x13,0xe0,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x80,0x03,0xd2 },
+  16, 0xae10, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xc6,0x00,0xd9,0x00,0x36,0x40 },
+  16, 0xae20, 0, {0x0f,0x90,0x0b,0x04,0x00,0xc9,0x00,0x36,0x68,0x6c,0x94,0x03,0xe4,0x20,0xb9,0x90 },
+  16, 0xae30, 0, {0x36,0x40,0x0c,0x94,0x03,0xe4,0x00,0x29,0x80,0x3e,0x40,0x0f,0x90,0x03,0x24,0x20 },
+  16, 0xae40, 0, {0xc9,0x00,0x36,0x40,0x0f,0x90,0x03,0xc2,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xae50, 0, {0x80,0x04,0x66,0x50,0x89,0x00,0x20,0x50,0x08,0x90,0x02,0x24,0x09,0xd9,0x00,0x20 },
+  16, 0xae60, 0, {0x48,0x48,0x90,0x06,0xe4,0x04,0x99,0xa0,0x22,0x40,0x0d,0xb8,0x22,0x64,0x00,0x09 },
+  16, 0xae70, 0, {0x50,0x32,0x40,0x0b,0x90,0x02,0x27,0x90,0x89,0x40,0x2a,0x40,0x0b,0x90,0x02,0xe0 },
+  16, 0xae80, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0x24,0x00,0x99,0x00,0x66,0x42 },
+  16, 0xae90, 0, {0x0a,0xd0,0x12,0x34,0x00,0x85,0x00,0x26,0x40,0x4a,0x90,0x02,0xe4,0x01,0xb9,0x01 },
+  16, 0xaea0, 0, {0x24,0x40,0x58,0x90,0x12,0xc4,0x00,0x29,0x40,0x2e,0x40,0x0b,0x10,0x0a,0x24,0x80 },
+  16, 0xaeb0, 0, {0x89,0x05,0x26,0x41,0x0b,0x90,0x02,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xaec0, 0, {0x08,0x04,0x04,0x80,0x81,0x20,0x61,0x48,0x08,0x52,0x02,0x14,0x81,0x95,0x20,0x20 },
+  16, 0xaed0, 0, {0x40,0x0a,0x36,0x02,0xc4,0x00,0xb1,0x20,0x00,0x48,0x41,0x10,0x42,0x44,0x01,0xa1 },
+  16, 0xaee0, 0, {0x00,0x24,0x48,0x0b,0x12,0x12,0x04,0x80,0x81,0x20,0x28,0x48,0x0b,0x12,0x02,0xca },
+  16, 0xaef0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xd8,0x50,0x36,0x00 },
+  16, 0xaf00, 0, {0x0e,0x85,0x23,0x21,0x42,0x8c,0x54,0x34,0x14,0x0e,0x80,0x02,0xe1,0x40,0xf8,0x50 },
+  16, 0xaf10, 0, {0x36,0x14,0x04,0x80,0x03,0xe1,0x44,0xe8,0x50,0x7e,0x15,0x0f,0x85,0x03,0x21,0x42 },
+  16, 0xaf20, 0, {0x4a,0x00,0x36,0x14,0x0f,0x80,0x03,0xee,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xaf30, 0, {0x98,0x1d,0xc4,0x40,0xf9,0x10,0x1e,0x44,0x4e,0x91,0x03,0xe4,0x40,0xf9,0x10,0x3f },
+  16, 0xaf40, 0, {0xc0,0x0d,0x91,0x03,0xf4,0x00,0xd9,0x14,0x3e,0x44,0x0f,0x90,0x03,0x74,0x00,0xdd },
+  16, 0xaf50, 0, {0x00,0x7a,0x44,0x0f,0x91,0x03,0xf4,0x40,0xf9,0x38,0x3f,0x44,0x0f,0x93,0x83,0xe7 },
+  16, 0xaf60, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0xf6,0x80,0xf9,0xa4,0x3f,0x68 },
+  16, 0xaf70, 0, {0x0e,0x9e,0x43,0x67,0x80,0xd9,0xe4,0x3f,0x41,0x0f,0xd8,0x43,0x04,0x00,0xed,0xc0 },
+  16, 0xaf80, 0, {0x36,0x40,0x0c,0x90,0x03,0xe4,0x00,0xd5,0x40,0x32,0x40,0x0c,0x90,0x03,0xf4,0x00 },
+  16, 0xaf90, 0, {0xdd,0x00,0x32,0x40,0x2c,0x9a,0x03,0xc6,0x01,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xafa0, 0, {0x38,0x10,0xe0,0x00,0xe8,0xc0,0x2e,0x14,0x4d,0x8f,0x22,0x23,0xc0,0xf8,0xf0,0xaa },
+  16, 0xafb0, 0, {0x00,0x0c,0x80,0x03,0xa2,0xa0,0xd8,0x82,0x22,0x00,0x08,0x80,0x02,0xe8,0x00,0xd8 },
+  16, 0xafc0, 0, {0x80,0x2a,0x00,0x08,0x80,0x02,0xe8,0x08,0x88,0xa8,0x36,0x00,0x48,0x8a,0x82,0xce },
+  16, 0xafd0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc5,0x00,0xb1,0x48,0x2e,0x40 },
+  16, 0xafe0, 0, {0x0a,0x12,0x22,0x44,0x00,0x91,0x04,0xa4,0x41,0x0a,0x94,0x06,0x24,0x00,0x91,0x42 },
+  16, 0xaff0, 0, {0x24,0x41,0x09,0x10,0x02,0xe4,0x01,0x91,0x20,0x24,0x40,0x09,0x10,0x02,0xc4,0x01 },
+  16, 0xb000, 0, {0x91,0x00,0x2c,0x40,0x09,0x14,0x02,0xc2,0x01,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb010, 0, {0x18,0x15,0xa4,0x00,0xa9,0x00,0x2e,0x40,0x48,0x10,0x02,0x24,0x00,0xb9,0x40,0xaa },
+  16, 0xb020, 0, {0x40,0x18,0xb0,0x02,0xe4,0x08,0x99,0x00,0x22,0x40,0x19,0x90,0x46,0xe4,0x80,0x99 },
+  16, 0xb030, 0, {0x04,0x2e,0x40,0x09,0x90,0x02,0xe4,0x01,0x99,0x04,0x26,0x50,0x09,0x90,0x02,0xc6 },
+  16, 0xb040, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x11,0xe4,0x00,0xf9,0x06,0x3c,0x40 },
+  16, 0xb050, 0, {0x0a,0x90,0x03,0x64,0x02,0xd9,0x00,0xb6,0x50,0x0e,0x90,0x23,0x26,0x01,0xf9,0x00 },
+  16, 0xb060, 0, {0x36,0x40,0x29,0x94,0x83,0xe4,0x00,0xd9,0x48,0x36,0x40,0x0d,0x90,0x03,0xc7,0x00 },
+  16, 0xb070, 0, {0xd1,0x07,0x3a,0x50,0xcd,0x90,0x03,0xe8,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb080, 0, {0x28,0x01,0xa4,0x08,0xe9,0x00,0x3e,0x40,0x8f,0x90,0x03,0xc4,0x08,0xf1,0x00,0x3a },
+  16, 0xb090, 0, {0x68,0x8f,0x90,0x03,0xa4,0x41,0xf9,0x00,0xbe,0x40,0x0e,0x90,0x03,0xe4,0x00,0xf9 },
+  16, 0xb0a0, 0, {0xc0,0x38,0x40,0x2e,0x90,0x03,0xe6,0x40,0xe9,0x00,0x3e,0x68,0x06,0x90,0x03,0xca },
+  16, 0xb0b0, 0, {0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xd8,0x05,0x3e,0x00 },
+  16, 0xb0c0, 0, {0x07,0x80,0x0b,0x20,0x00,0xe8,0x40,0x3e,0x10,0x0d,0x82,0x03,0x60,0x00,0xc8,0x00 },
+  16, 0xb0d0, 0, {0xb2,0x00,0x8d,0x83,0x03,0xe0,0x00,0xd8,0x50,0x3a,0x00,0x1e,0x80,0x03,0xe1,0x24 },
+  16, 0xb0e0, 0, {0xf8,0x00,0xb2,0x00,0x0f,0x80,0x03,0x02,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb0f0, 0, {0x28,0x05,0x38,0x00,0x8a,0x04,0x2f,0x84,0x6a,0xa0,0x0b,0xe8,0x08,0x8e,0x00,0x3d },
+  16, 0xb100, 0, {0x80,0x88,0xec,0x03,0x68,0x10,0xa6,0x01,0x36,0x80,0x08,0xa8,0x00,0xc8,0x10,0x8e },
+  16, 0xb110, 0, {0x10,0x22,0x80,0x08,0xa0,0x02,0xfb,0x20,0xbe,0x51,0x2a,0x80,0x0b,0xa0,0x02,0x82 },
+  16, 0xb120, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x41,0x21,0x93,0x00,0x2c,0xf0 },
+  16, 0xb130, 0, {0x39,0x30,0x06,0x0c,0x00,0xa3,0x00,0x28,0x08,0x28,0xbc,0x02,0x2c,0x00,0x83,0x80 },
+  16, 0xb140, 0, {0x2a,0xc0,0x08,0x30,0x00,0xcc,0x00,0x9a,0x80,0x28,0xc0,0x0a,0x30,0x02,0xcd,0x00 },
+  16, 0xb150, 0, {0xb3,0x04,0x62,0xc1,0x0b,0x30,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb160, 0, {0xa0,0x01,0x1e,0x04,0x07,0x11,0x2c,0xd0,0x0a,0x32,0x22,0xdc,0xc1,0x87,0x00,0x6d },
+  16, 0xb170, 0, {0xd0,0x08,0x34,0x02,0x7c,0x00,0xa7,0x08,0x24,0xc8,0x08,0x70,0x02,0xdc,0x80,0x0f },
+  16, 0xb180, 0, {0x00,0x21,0xc4,0x08,0x73,0x06,0xdc,0x00,0xb2,0x00,0x61,0xc8,0x0b,0x3a,0x02,0x88 },
+  16, 0xb190, 0, {0x04,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x0a,0x00,0x57,0x81,0x2d,0xa0 },
+  16, 0xb1a0, 0, {0x2d,0x7c,0x02,0x3e,0x82,0xe3,0xe0,0x3b,0xe0,0x0c,0x78,0x03,0x1e,0x20,0xc7,0x80 },
+  16, 0xb1b0, 0, {0xb9,0xe8,0x2c,0x78,0x03,0xff,0x80,0xd6,0x80,0x3b,0xec,0x02,0x7a,0x03,0xde,0x00 },
+  16, 0xb1c0, 0, {0xf7,0x81,0x31,0xec,0x8f,0x7c,0x03,0x0a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb1d0, 0, {0x08,0x1d,0xac,0x00,0xfb,0x00,0x1e,0x80,0x23,0xb6,0x83,0xed,0xa0,0xdb,0x64,0x3e },
+  16, 0xb1e0, 0, {0xc0,0x0e,0xb0,0x03,0xed,0xc0,0xf2,0x00,0x3e,0xd4,0x0a,0xb0,0x03,0xec,0x30,0xee },
+  16, 0xb1f0, 0, {0x64,0x3e,0xc0,0x07,0xb0,0xc3,0xe8,0x00,0xfb,0x01,0x3e,0xc8,0x0f,0xb8,0x03,0xc2 },
+  16, 0xb200, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xf6,0x00,0xef,0x80,0x3b,0xe0 },
+  16, 0xb210, 0, {0x0f,0xf8,0x63,0x7e,0x04,0xcf,0xc0,0xb7,0x20,0x0e,0xf8,0x03,0xfc,0x00,0xc7,0x80 },
+  16, 0xb220, 0, {0x33,0xf0,0x0c,0xcc,0x03,0xfe,0x08,0xf7,0xc1,0x33,0xe0,0x4f,0xf8,0x03,0xb2,0x40 },
+  16, 0xb230, 0, {0xff,0xa0,0x31,0xe6,0x0c,0xf8,0x03,0x10,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb240, 0, {0xa8,0x11,0x9c,0x00,0xef,0x02,0x21,0x40,0x2d,0x70,0x02,0x1c,0x00,0xf7,0x10,0x29 },
+  16, 0xb250, 0, {0x40,0x08,0x70,0x22,0xfc,0xc0,0xa7,0x00,0x3d,0xc0,0x08,0x40,0x02,0xdc,0x00,0xb7 },
+  16, 0xb260, 0, {0x40,0x21,0xc0,0x0b,0x70,0x02,0xda,0x80,0xb7,0x24,0x29,0xc6,0x48,0xf0,0x02,0x2a },
+  16, 0xb270, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x00,0xa7,0x00,0x28,0x84 },
+  16, 0xb280, 0, {0x0b,0x30,0x02,0x0c,0x00,0x93,0x00,0x25,0x80,0x0a,0x61,0x02,0xdc,0x01,0xa7,0x10 },
+  16, 0xb290, 0, {0x24,0xc0,0x08,0x40,0x82,0xdc,0x00,0x9f,0x00,0x25,0xc4,0x0b,0x70,0x02,0x94,0x25 },
+  16, 0xb2a0, 0, {0xb7,0x32,0x23,0xc4,0x1b,0x70,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb2b0, 0, {0x20,0x14,0xcc,0x0c,0xa3,0x00,0x20,0x00,0x29,0x30,0x0a,0x0c,0x00,0xa3,0x00,0x6c },
+  16, 0xb2c0, 0, {0x00,0x08,0x10,0x42,0xcd,0x10,0xaa,0x00,0xac,0xc0,0x00,0x04,0x02,0xcd,0x00,0xbb },
+  16, 0xb2d0, 0, {0x10,0x24,0xc0,0x03,0x30,0x42,0xc3,0x09,0xb3,0x00,0x2c,0xd0,0x0a,0x30,0x02,0x18 },
+  16, 0xb2e0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0x80,0x00,0xef,0x00,0x3a,0x40 },
+  16, 0xb2f0, 0, {0x07,0xf0,0x43,0x3c,0x00,0x9f,0xc0,0xb6,0x14,0x0e,0x80,0x06,0xfc,0x01,0xcb,0x01 },
+  16, 0xb300, 0, {0x37,0xc0,0xac,0xb4,0x02,0xfc,0x00,0xd9,0x01,0x37,0xc0,0x4b,0xf0,0x13,0xae,0x08 },
+  16, 0xb310, 0, {0xfb,0x00,0x33,0xd0,0x2e,0xf0,0x0b,0x2a,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb320, 0, {0x80,0x00,0xec,0x00,0xfb,0x05,0x3e,0x40,0x0f,0x30,0x03,0xac,0x14,0xfb,0xa0,0x3a },
+  16, 0xb330, 0, {0xc0,0x0f,0x84,0x43,0xec,0x01,0xf9,0x40,0x3e,0xc0,0x0f,0xa2,0x03,0xec,0x21,0xf9 },
+  16, 0xb340, 0, {0x00,0x3a,0xc0,0x0f,0xb0,0x03,0xe4,0x20,0xf0,0x00,0xba,0xc0,0x0d,0xb0,0x03,0xe0 },
+  16, 0xb350, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xf8,0x00,0xd7,0x01,0x35,0x68 },
+  16, 0xb360, 0, {0x6d,0xf0,0x03,0x3c,0x01,0xe7,0x00,0x33,0xc0,0x0d,0xc0,0x03,0xfc,0x24,0xcf,0x02 },
+  16, 0xb370, 0, {0x37,0xc0,0x0d,0xd2,0x02,0xfc,0x00,0xdf,0x01,0x33,0xc0,0x5e,0x70,0x33,0x1c,0x18 },
+  16, 0xb380, 0, {0xcf,0x41,0x31,0xc2,0x0c,0xf0,0x03,0x40,0x40,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb390, 0, {0x81,0x00,0x6c,0x00,0x8b,0x00,0x22,0x52,0x2a,0xb0,0x03,0x6c,0x00,0xab,0x00,0x28 },
+  16, 0xb3a0, 0, {0xc0,0x0a,0x8c,0x02,0xec,0x10,0x8b,0xe0,0x22,0xc0,0x0f,0x80,0x02,0xcc,0x00,0x8b },
+  16, 0xb3b0, 0, {0x80,0x22,0xc0,0x08,0xb0,0x02,0x2a,0x10,0xd9,0x80,0x22,0xc0,0xc8,0xb0,0x02,0xe0 },
+  16, 0xb3c0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x24,0x01,0x9b,0x00,0x26,0x80 },
+  16, 0xb3d0, 0, {0x29,0xb0,0x62,0x0c,0x00,0xab,0x01,0x6a,0x00,0x08,0x98,0x02,0xcc,0x00,0x9b,0x83 },
+  16, 0xb3e0, 0, {0x2e,0xc0,0xcb,0xb4,0x12,0xec,0x03,0x8b,0x80,0x28,0xc0,0x0a,0xb0,0x06,0xa2,0x00 },
+  16, 0xb3f0, 0, {0x8b,0x02,0x62,0xc0,0x08,0xb0,0x02,0xe0,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb400, 0, {0x08,0x04,0x0c,0x01,0x83,0x14,0x20,0x00,0x0a,0x30,0x02,0x4c,0x00,0x83,0x00,0x2a },
+  16, 0xb410, 0, {0x40,0x0a,0x10,0x00,0xcc,0x02,0x93,0x00,0x28,0xc0,0x0a,0x20,0x02,0xec,0x00,0x03 },
+  16, 0xb420, 0, {0x00,0x20,0xc0,0x08,0x30,0x16,0x00,0x80,0x91,0x00,0x60,0xc0,0x08,0x30,0x02,0xc2 },
+  16, 0xb430, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x6c,0x00,0xdb,0x00,0x36,0x80 },
+  16, 0xb440, 0, {0x2d,0xf0,0x03,0x3c,0x00,0xaf,0x00,0x3a,0x80,0x0d,0x80,0x03,0xfc,0x00,0x5b,0x00 },
+  16, 0xb450, 0, {0x37,0xc0,0x09,0x90,0x03,0xfc,0x00,0xdf,0x00,0x33,0xc0,0x0a,0xf0,0x03,0xa4,0x20 },
+  16, 0xb460, 0, {0xcb,0x00,0xb3,0xc0,0x8c,0xb0,0x03,0x40,0x02,0x10,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb470, 0, {0xa0,0x1d,0xfc,0x04,0xff,0x20,0x0f,0x00,0x27,0xf0,0x03,0xfc,0x00,0xff,0x00,0x2d },
+  16, 0xb480, 0, {0x00,0x0b,0xd0,0x27,0xfc,0x00,0xef,0x00,0x37,0xc0,0x0f,0xc0,0x43,0xfc,0x00,0xff },
+  16, 0xb490, 0, {0x00,0x3f,0xc0,0x0d,0xf0,0x0b,0xe0,0x00,0xf5,0x00,0x3f,0xc0,0x1f,0xf0,0x03,0xe8 },
+  16, 0xb4a0, 0, {0x07,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0xf4,0xc0,0xfc,0x22,0x7f,0xc0 },
+  16, 0xb4b0, 0, {0x0c,0xd0,0x43,0x36,0x00,0xc4,0x81,0x34,0xc0,0x1c,0x89,0x07,0xf2,0x80,0xcf,0x80 },
+  16, 0xb4c0, 0, {0x33,0x60,0x0f,0x79,0x03,0x3c,0xe0,0xcf,0x08,0x33,0x48,0x0d,0xc4,0x03,0xf0,0x50 },
+  16, 0xb4d0, 0, {0xdc,0x90,0x37,0xcc,0x0f,0xf8,0x03,0xf0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb4e0, 0, {0x80,0x10,0xe9,0x90,0xb8,0x80,0x7e,0xe4,0x88,0x99,0x0a,0x26,0x08,0xa9,0x80,0x22 },
+  16, 0xb4f0, 0, {0xf4,0x2c,0x99,0x03,0xa7,0x02,0x89,0x80,0x22,0x34,0x0b,0x9a,0x03,0x7d,0x00,0xdf },
+  16, 0xb500, 0, {0x48,0x2b,0x60,0x08,0x05,0x02,0xe5,0x00,0x82,0x20,0x22,0xc4,0x8b,0xb0,0x02,0xe0 },
+  16, 0xb510, 0, {0x06,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xc5,0x00,0xb0,0x10,0x2c,0xc0 },
+  16, 0xb520, 0, {0x2a,0x00,0x02,0xa4,0x08,0xa8,0x04,0xe0,0x80,0x0b,0x00,0x02,0xc4,0x41,0xb2,0x04 },
+  16, 0xb530, 0, {0xa4,0x0a,0x0b,0xb0,0x02,0x8c,0x81,0x83,0x20,0x60,0x50,0x98,0x12,0x12,0x8b,0x80 },
+  16, 0xb540, 0, {0x89,0x00,0x2c,0xc8,0x0b,0x30,0x02,0xe2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb550, 0, {0xc0,0x11,0xac,0x20,0xbb,0x02,0x2a,0xc0,0x0a,0x88,0x02,0xa4,0x08,0xa9,0x80,0xa2 },
+  16, 0xb560, 0, {0xe1,0x1b,0x9c,0x22,0xe6,0x00,0xb8,0x40,0x26,0x30,0x0b,0x90,0x02,0xcc,0x01,0x93 },
+  16, 0xb570, 0, {0x04,0x2a,0x40,0x39,0x98,0x82,0xec,0x14,0x8b,0x65,0x2a,0xc0,0x0b,0xb2,0x02,0xf8 },
+  16, 0xb580, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xe7,0x00,0xb8,0x48,0x2e,0x00 },
+  16, 0xb590, 0, {0x0e,0x88,0x43,0x84,0x00,0xe3,0xc1,0x36,0xe8,0x0f,0x9c,0x12,0xe2,0x80,0xf3,0xc0 },
+  16, 0xb5a0, 0, {0x36,0x70,0x5f,0xa8,0x23,0xac,0x01,0xcb,0x04,0x22,0x40,0x4d,0x84,0x03,0xe2,0x00 },
+  16, 0xb5b0, 0, {0xd8,0x00,0x3e,0xc0,0x0f,0x90,0x03,0xd0,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb5c0, 0, {0xe0,0x01,0xb3,0x09,0xfe,0x10,0x3e,0x81,0x0d,0xc0,0x03,0x74,0x0c,0xff,0x00,0x3d },
+  16, 0xb5d0, 0, {0xc1,0x8c,0xd0,0x83,0x14,0x00,0xcd,0x20,0x3a,0x40,0x0d,0xca,0x01,0x7c,0x00,0xff },
+  16, 0xb5e0, 0, {0x00,0x1f,0x40,0x0e,0xc0,0x23,0xf2,0x46,0xfe,0x84,0x37,0xc0,0x0f,0xd8,0x03,0xf8 },
+  16, 0xb5f0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xdd,0x02,0x3d,0x40 },
+  16, 0xb600, 0, {0x0e,0x90,0x03,0xac,0x00,0xeb,0x48,0x3e,0xd0,0x0c,0x80,0x63,0xa2,0x08,0xca,0x00 },
+  16, 0xb610, 0, {0x32,0x08,0x0c,0xb0,0x03,0xac,0x08,0xeb,0x00,0x3e,0x40,0x0c,0xd4,0x83,0x58,0x20 },
+  16, 0xb620, 0, {0xf9,0x42,0x32,0xc0,0x0c,0xb0,0x03,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb630, 0, {0xc8,0x05,0x28,0x02,0xdb,0x00,0x2e,0xe0,0x28,0x3a,0x02,0x2e,0x00,0xdb,0x60,0x76 },
+  16, 0xb640, 0, {0xe0,0x0d,0x8c,0x02,0xe0,0x00,0x88,0x02,0x36,0x58,0x68,0x15,0x83,0x7c,0x08,0xbf },
+  16, 0xb650, 0, {0x00,0x2d,0x60,0x08,0x90,0x02,0xa9,0x00,0xb3,0x05,0x23,0xc0,0x08,0xb0,0x02,0xf2 },
+  16, 0xb660, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x10,0x80,0x00,0x0c,0xc1 },
+  16, 0xb670, 0, {0x08,0x1c,0x82,0x06,0x00,0x93,0xc0,0x20,0xf6,0x0a,0x20,0x02,0x08,0x00,0x93,0x00 },
+  16, 0xb680, 0, {0x24,0x60,0x09,0x3c,0x02,0x0c,0x00,0x83,0x00,0x2c,0x60,0x09,0x01,0x12,0x00,0x40 },
+  16, 0xb690, 0, {0xb0,0x00,0xe0,0xc0,0x08,0x30,0x02,0x70,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb6a0, 0, {0x20,0x41,0x0a,0x40,0x86,0x81,0x2d,0xe0,0x58,0x18,0x0a,0x16,0xa0,0x97,0x80,0x25 },
+  16, 0xb6b0, 0, {0xe9,0x19,0x78,0x82,0xd6,0x00,0x97,0x80,0x25,0xa0,0x19,0xf8,0x02,0x5e,0x00,0xb7 },
+  16, 0xb6c0, 0, {0x80,0x2d,0x60,0x28,0x48,0x12,0x96,0x00,0xb4,0x80,0x21,0xe0,0x28,0x78,0x02,0xc8 },
+  16, 0xb6d0, 0, {0x04,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0x81,0x30,0x3c,0xc2 },
+  16, 0xb6e0, 0, {0x0e,0x00,0x02,0x84,0x00,0xe3,0x40,0x28,0xe8,0x4c,0x29,0x03,0x0c,0x00,0xd3,0x00 },
+  16, 0xb6f0, 0, {0x34,0xc4,0x0d,0x31,0x03,0x8c,0x08,0xe3,0x00,0x3c,0x46,0x0c,0x20,0x03,0x00,0x80 },
+  16, 0xb700, 0, {0xf2,0x00,0x32,0xc0,0x0c,0x30,0x03,0xd2,0x02,0x10,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb710, 0, {0x40,0x19,0xb8,0x00,0xff,0x10,0x2f,0xc0,0x0f,0xc0,0x23,0xc4,0x80,0x7f,0x10,0x3e },
+  16, 0xb720, 0, {0xc0,0x0f,0xb1,0x03,0xdc,0x00,0xe7,0x00,0x3f,0x80,0x06,0xf1,0x43,0xfc,0x00,0xff },
+  16, 0xb730, 0, {0x08,0x7d,0x50,0x0e,0xe1,0x23,0xb4,0x08,0xfe,0x10,0x3f,0xc4,0x0f,0xf0,0x03,0xd0 },
+  16, 0xb740, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xe4,0x02,0xcc,0x00,0x3e,0x00 },
+  16, 0xb750, 0, {0x2c,0xc0,0x03,0x04,0x01,0xcb,0x00,0x33,0x60,0x2c,0x90,0x13,0xe8,0x00,0x73,0x00 },
+  16, 0xb760, 0, {0xb2,0xc1,0x0f,0xa0,0x03,0xec,0x80,0xfb,0x28,0x3e,0x54,0x1f,0xd0,0x03,0xfe,0x02 },
+  16, 0xb770, 0, {0xc9,0x80,0x32,0xc0,0x0f,0xb0,0x03,0xca,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb780, 0, {0x48,0x11,0x80,0x00,0x86,0x00,0x2d,0x80,0x08,0x20,0x02,0x14,0x08,0x87,0x00,0x29 },
+  16, 0xb790, 0, {0x40,0x08,0x70,0x02,0xdc,0x00,0xb7,0x00,0x21,0xc0,0x0b,0x60,0x02,0x5c,0xa0,0x97 },
+  16, 0xb7a0, 0, {0x20,0x2d,0x48,0x0b,0x50,0x02,0xdc,0x10,0x8d,0x00,0x21,0xc8,0x0b,0x70,0x02,0xd2 },
+  16, 0xb7b0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9f,0x00,0x85,0x81,0x2c,0x60 },
+  16, 0xb7c0, 0, {0x18,0x58,0x02,0xde,0x20,0xb7,0x82,0x28,0x60,0x5a,0x78,0x52,0xde,0x10,0xbf,0x80 },
+  16, 0xb7d0, 0, {0x21,0xe0,0x4b,0x78,0x06,0xde,0x40,0xb7,0xa0,0x2d,0x69,0x9b,0x78,0x12,0xce,0x00 },
+  16, 0xb7e0, 0, {0x87,0x80,0xe1,0xe4,0x0b,0x78,0x02,0xc0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb7f0, 0, {0x48,0x14,0xee,0x00,0x83,0x00,0x2c,0xc2,0x08,0x36,0x02,0x8c,0x08,0x83,0xf0,0x68 },
+  16, 0xb800, 0, {0x40,0x0a,0x3e,0x02,0xcd,0x40,0xb3,0x00,0x20,0xe0,0x0b,0x32,0x06,0x4c,0x00,0x9b },
+  16, 0xb810, 0, {0x00,0x0c,0x40,0x0b,0x30,0x02,0xcd,0x80,0x83,0x08,0x20,0xc0,0x0b,0xb1,0x02,0xda },
+  16, 0xb820, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xb8,0x00,0xce,0x08,0x3f,0xb0 },
+  16, 0xb830, 0, {0x0c,0xe4,0x23,0xda,0x02,0xde,0x40,0xbb,0xb2,0x0e,0xe2,0x43,0xfa,0x00,0xfe,0x00 },
+  16, 0xb840, 0, {0x33,0x90,0x0b,0xe0,0x03,0xe8,0x00,0xfa,0x00,0x3e,0x81,0x0b,0xe0,0x13,0xf9,0x08 },
+  16, 0xb850, 0, {0xce,0x40,0x32,0x80,0x0f,0xa8,0x03,0xfa,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb860, 0, {0x48,0x00,0xe0,0x24,0x98,0x08,0x3c,0x04,0x0f,0x00,0x0b,0x60,0x00,0xf8,0x40,0x2e },
+  16, 0xb870, 0, {0x03,0x0d,0x80,0x03,0xe0,0x00,0xf8,0x00,0x3e,0x06,0x0b,0x80,0x03,0xe0,0x00,0xd8 },
+  16, 0xb880, 0, {0x00,0x3c,0x00,0x03,0x8c,0x23,0xe1,0x00,0xf8,0x00,0x7e,0x00,0x0f,0x80,0x03,0xd2 },
+  16, 0xb890, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x02,0xc9,0x00,0x3e,0x40 },
+  16, 0xb8a0, 0, {0x8c,0x90,0x03,0x25,0x00,0xe9,0x80,0x32,0x44,0x0f,0x94,0x02,0xe4,0x20,0xf9,0x00 },
+  16, 0xb8b0, 0, {0x32,0x70,0x0f,0x9a,0x43,0xe4,0x00,0xf9,0x00,0x32,0x40,0x0c,0x10,0x33,0x24,0x10 },
+  16, 0xb8c0, 0, {0xf9,0x01,0x3e,0x40,0x0f,0x90,0x03,0x02,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb8d0, 0, {0x80,0x04,0x64,0x00,0x89,0x82,0x2e,0x40,0x28,0x90,0x02,0x24,0x82,0x81,0xc0,0xa2 },
+  16, 0xb8e0, 0, {0x70,0x0b,0x9c,0x02,0xe4,0x00,0x31,0x42,0xa2,0x60,0x0b,0x94,0x82,0xe4,0x00,0xb9 },
+  16, 0xb8f0, 0, {0x00,0x2a,0x40,0x08,0x94,0xa2,0x25,0x00,0xb9,0x00,0x2e,0x40,0x0b,0x90,0x0a,0x20 },
+  16, 0xb900, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0x89,0x64,0x2e,0x40 },
+  16, 0xb910, 0, {0x08,0x90,0x42,0xa4,0x00,0x89,0x60,0x22,0x42,0x0b,0x90,0x02,0xe6,0x00,0xb9,0x80 },
+  16, 0xb920, 0, {0x22,0x40,0x0b,0x90,0x02,0xa4,0x04,0xb9,0x00,0x22,0x40,0x28,0x90,0x02,0x24,0x04 },
+  16, 0xb930, 0, {0xb9,0x00,0x2e,0x40,0x0b,0x90,0x02,0x0e,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb940, 0, {0x08,0x04,0x05,0x80,0x81,0x00,0x2c,0xc1,0x48,0x10,0x02,0xa4,0x02,0x81,0x00,0x20 },
+  16, 0xb950, 0, {0x40,0x83,0x34,0x02,0xc4,0x00,0xbb,0x00,0x20,0xd0,0x0b,0x14,0x02,0xc4,0x80,0xb1 },
+  16, 0xb960, 0, {0x20,0xa0,0x68,0x18,0x14,0x1a,0x0d,0x00,0xb1,0x40,0x2c,0x50,0x0b,0x10,0x02,0x0a },
+  16, 0xb970, 0, {0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xc8,0x00,0x3e,0x00 },
+  16, 0xb980, 0, {0x8c,0x80,0x0b,0xa0,0x04,0xe8,0x00,0x32,0x00,0x07,0x80,0x03,0xe0,0x00,0xf8,0x00 },
+  16, 0xb990, 0, {0x32,0x00,0x1f,0x80,0x03,0xa1,0x40,0xf8,0x50,0x32,0x00,0x0c,0x80,0x03,0x20,0x00 },
+  16, 0xb9a0, 0, {0xf8,0x00,0x3e,0x00,0x0f,0x80,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb9b0, 0, {0x98,0x1d,0xf4,0x46,0xfd,0x40,0x3f,0x50,0x23,0xd4,0x13,0x74,0x04,0xf5,0x02,0x3f },
+  16, 0xb9c0, 0, {0x50,0x0f,0xd4,0x03,0xfd,0x00,0xbd,0x00,0x2f,0x50,0x0f,0xd0,0x03,0xe4,0x40,0xf9 },
+  16, 0xb9d0, 0, {0x10,0x3f,0x44,0x0f,0xd4,0x03,0xf5,0x08,0xfd,0x06,0x3e,0x50,0x0f,0xd2,0x83,0xe6 },
+  16, 0xb9e0, 0, {0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xe6,0x40,0xed,0x04,0x3e,0x48 },
+  16, 0xb9f0, 0, {0x0c,0xb2,0x83,0xf4,0x00,0xc1,0x00,0x32,0x40,0x8c,0xd0,0x03,0x34,0x00,0xfd,0x00 },
+  16, 0xba00, 0, {0x37,0x40,0x0f,0xd0,0x03,0xe6,0x20,0xf9,0x88,0x3d,0x62,0x0c,0xd8,0x03,0xfe,0x24 },
+  16, 0xba10, 0, {0xc1,0x00,0x3e,0x78,0x0f,0xd0,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xba20, 0, {0x38,0x10,0xe1,0x00,0x88,0x40,0x2e,0x10,0x08,0xc4,0x23,0xa0,0x08,0x88,0x06,0x2a },
+  16, 0xba30, 0, {0x14,0x08,0x80,0x03,0x60,0x04,0xb8,0x00,0x22,0x00,0x0b,0x80,0x02,0xe2,0x00,0xb8 },
+  16, 0xba40, 0, {0x80,0x2e,0x00,0x08,0x8c,0x02,0xe3,0x80,0x88,0x02,0x2e,0x38,0x0b,0x88,0x02,0x0e },
+  16, 0xba50, 0, {0x06,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc5,0x80,0xa1,0xc0,0x2d,0x70 },
+  16, 0xba60, 0, {0x08,0x50,0x42,0xc4,0x00,0xa9,0x00,0x20,0xe0,0x2a,0x10,0x0a,0x04,0x10,0xb1,0x00 },
+  16, 0xba70, 0, {0x24,0x40,0x4b,0x10,0x06,0xc4,0x20,0xb1,0x08,0x6e,0x40,0x0b,0x16,0x82,0xc4,0x20 },
+  16, 0xba80, 0, {0x81,0x00,0x2c,0x50,0x0b,0x92,0x82,0x52,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xba90, 0, {0x18,0x11,0xa4,0x00,0xa9,0x01,0x2e,0x40,0x28,0xd0,0x20,0xa4,0x04,0xa9,0x00,0x2a },
+  16, 0xbaa0, 0, {0x40,0x1a,0xb0,0x12,0x24,0x00,0xb9,0x0c,0x22,0x42,0x0b,0x94,0x02,0xe4,0x00,0xb9 },
+  16, 0xbab0, 0, {0x00,0x6e,0x40,0x0b,0x96,0x02,0xe4,0x11,0x89,0x20,0x6e,0x40,0x0b,0x90,0x02,0x46 },
+  16, 0xbac0, 0, {0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0xc0,0xa9,0xc0,0x3e,0x50 },
+  16, 0xbad0, 0, {0x08,0x9c,0x83,0xe4,0x02,0xe9,0x00,0xb2,0x40,0x2a,0x92,0x12,0x26,0x40,0xf9,0x40 },
+  16, 0xbae0, 0, {0x36,0x70,0x0f,0x94,0x03,0xe4,0x04,0xf9,0x01,0x3c,0x40,0x0f,0x98,0x03,0xe6,0x02 },
+  16, 0xbaf0, 0, {0xc9,0x22,0x3e,0x40,0x0f,0x10,0x02,0x68,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbb00, 0, {0x28,0x01,0x86,0x04,0xd9,0x40,0x1c,0x40,0x0f,0x92,0x23,0xa4,0xb0,0xdb,0x04,0x3c },
+  16, 0xbb10, 0, {0xc0,0x0d,0x9a,0x03,0xe4,0x00,0xf9,0x00,0x3e,0x44,0x0f,0x90,0x03,0xe4,0x00,0xf9 },
+  16, 0xbb20, 0, {0x00,0x3e,0x42,0x2c,0x90,0x23,0xe4,0x80,0xf9,0x00,0x3e,0x40,0x8f,0x92,0x03,0x92 },
+  16, 0xbb30, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa1,0x00,0xc8,0x20,0x32,0x00 },
+  16, 0xbb40, 0, {0x4c,0xc0,0x8b,0x20,0x02,0xc8,0x31,0x32,0x20,0x2d,0x84,0x03,0xe1,0x04,0xf8,0x48 },
+  16, 0xbb50, 0, {0xba,0x00,0x0f,0x89,0x03,0xe0,0x00,0xc8,0x00,0x32,0x00,0x0d,0x81,0x13,0x20,0x10 },
+  16, 0xbb60, 0, {0xf8,0x00,0x3a,0x00,0x0f,0x81,0x23,0x02,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbb70, 0, {0x28,0x05,0x28,0x00,0x0e,0x40,0x22,0x80,0x28,0xa4,0x02,0x19,0x00,0x52,0x80,0xa2 },
+  16, 0xbb80, 0, {0x80,0x4d,0xed,0x82,0xe8,0x00,0xb6,0x42,0x23,0xbd,0x0b,0xe8,0x02,0xe8,0x04,0xda },
+  16, 0xbb90, 0, {0x00,0x37,0x80,0x08,0xe0,0x02,0x3a,0x20,0xba,0x00,0x22,0x80,0x0b,0xa8,0x0a,0x0a },
+  16, 0xbba0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0x83,0x80,0x60,0xc0 },
+  16, 0xbbb0, 0, {0x08,0x29,0x02,0x0d,0x00,0x92,0x40,0x24,0xc0,0x08,0xb4,0x02,0xcc,0x00,0xb3,0x00 },
+  16, 0xbbc0, 0, {0x68,0xe0,0x1b,0x30,0x02,0xcc,0x00,0x93,0x01,0x24,0xc0,0x69,0x38,0x02,0x6c,0x00 },
+  16, 0xbbd0, 0, {0xb3,0x00,0x2c,0xc0,0x0b,0x30,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbbe0, 0, {0xa0,0x01,0x1c,0x40,0x83,0xc0,0x20,0x40,0x08,0x28,0x06,0x9c,0x18,0x9c,0x02,0x24 },
+  16, 0xbbf0, 0, {0xc0,0x09,0x70,0x02,0xd4,0x00,0xb7,0x00,0x21,0xc0,0x0b,0x70,0x02,0xce,0x40,0x97 },
+  16, 0xbc00, 0, {0xb0,0x25,0x40,0x08,0x78,0x1a,0x58,0x00,0xbf,0xa2,0x65,0xc8,0x0b,0x78,0x02,0x20 },
+  16, 0xbc10, 0, {0x04,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x0e,0x02,0x87,0x80,0xb1,0xa0 },
+  16, 0xbc20, 0, {0x0c,0x68,0x03,0x1a,0x08,0xd6,0x92,0x35,0xe4,0x28,0x78,0x42,0xd6,0x10,0xf5,0x80 },
+  16, 0xbc30, 0, {0x39,0xa0,0x0f,0x78,0x23,0xde,0x30,0xd3,0xa2,0x35,0xa0,0x4d,0xe8,0x03,0x5e,0x00 },
+  16, 0xbc40, 0, {0xf7,0xd0,0x3d,0xf8,0x0f,0xf0,0x03,0x22,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbc50, 0, {0x08,0x1d,0xac,0x00,0xfb,0x04,0x3e,0x00,0x0b,0xa0,0x03,0x48,0x04,0xfa,0x41,0x3a },
+  16, 0xbc60, 0, {0x50,0x0f,0xb0,0x03,0xe4,0x00,0xf1,0x00,0x3e,0xc0,0x0f,0xb0,0x03,0xed,0x88,0xfb },
+  16, 0xbc70, 0, {0x4d,0x3e,0x00,0x0f,0xf0,0x03,0xbc,0x08,0xfb,0x20,0x3a,0xc0,0x0f,0xb0,0x03,0xc2 },
+  16, 0xbc80, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xfe,0x00,0xdc,0x80,0xb3,0xe0 },
+  16, 0xbc90, 0, {0x0c,0xd8,0x03,0xce,0x00,0xc8,0xa0,0x31,0xa0,0x8d,0xe9,0x03,0xbe,0x00,0xb2,0x80 },
+  16, 0xbca0, 0, {0x33,0xe0,0x0c,0xe8,0x43,0x7e,0x04,0x0f,0x81,0x31,0xe4,0x0c,0xd8,0x03,0xf6,0x00 },
+  16, 0xbcb0, 0, {0xff,0x80,0x3f,0xe0,0x0f,0xf8,0x03,0x00,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbcc0, 0, {0xa8,0x11,0x9c,0x00,0xb4,0x40,0x35,0x40,0x08,0x50,0x82,0xde,0x80,0xd4,0x90,0x21 },
+  16, 0xbcd0, 0, {0xe0,0x0d,0x51,0x02,0xd4,0x40,0xb6,0xb0,0x2b,0x90,0x0e,0xe5,0x02,0x9c,0x40,0xd7 },
+  16, 0xbce0, 0, {0x22,0x19,0x5c,0x0d,0x70,0x02,0xd8,0x00,0xb7,0x20,0x2d,0xc0,0x0b,0xf0,0x03,0x6a },
+  16, 0xbcf0, 0, {0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x00,0x93,0x10,0x21,0x80 },
+  16, 0xbd00, 0, {0x08,0x58,0x02,0xdc,0xc0,0x94,0x00,0x23,0xd0,0x08,0x70,0xa0,0xd4,0x20,0xb5,0x02 },
+  16, 0xbd10, 0, {0x29,0x80,0x09,0x60,0x82,0x0c,0x00,0x87,0x02,0x25,0xc0,0x19,0x40,0x02,0xd4,0x00 },
+  16, 0xbd20, 0, {0xb7,0x00,0x6d,0xc0,0x0b,0x70,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbd30, 0, {0x20,0x14,0xec,0x00,0xb3,0xc0,0x20,0x01,0x48,0x18,0x02,0xcc,0x02,0x81,0x44,0xa0 },
+  16, 0xbd40, 0, {0xc0,0x89,0x38,0x02,0xc7,0x80,0xb1,0x00,0x2c,0x09,0x4a,0x00,0x62,0xac,0x09,0x93 },
+  16, 0xbd50, 0, {0x01,0x28,0x40,0x19,0x30,0x02,0xcd,0x10,0xb3,0x90,0x2c,0xc0,0x0b,0x30,0x02,0xc8 },
+  16, 0xbd60, 0, {0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xbc,0x20,0xdb,0x62,0x22,0xe0 },
+  16, 0xbd70, 0, {0x6c,0xa0,0x03,0xe4,0x00,0x98,0x00,0x32,0xc0,0xec,0x98,0x23,0xae,0x08,0xfb,0x08 },
+  16, 0xbd80, 0, {0x3a,0x78,0x09,0x90,0x03,0x7c,0x10,0xcf,0x00,0x26,0x40,0x0c,0xb0,0x03,0xec,0x00 },
+  16, 0xbd90, 0, {0xff,0x80,0x3f,0xc0,0x0f,0x90,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbda0, 0, {0x80,0x00,0xec,0x20,0xfb,0x48,0x3c,0x61,0x0f,0xa0,0x43,0xed,0x00,0xf8,0x24,0x3e },
+  16, 0xbdb0, 0, {0x50,0x0f,0x90,0x83,0xe4,0x00,0xfb,0x00,0x3a,0x50,0x0f,0x80,0x43,0xec,0x08,0xfb },
+  16, 0xbdc0, 0, {0x00,0x3e,0x40,0x0f,0x40,0x03,0xf0,0x00,0xfb,0x00,0x3e,0xc1,0x0f,0x90,0x03,0x60 },
+  16, 0xbdd0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x00,0xdd,0xa0,0x32,0x80 },
+  16, 0xbde0, 0, {0x0c,0xe0,0x01,0xfc,0x00,0xdc,0x91,0x39,0xc0,0x3c,0x40,0x03,0x34,0x00,0xff,0x80 },
+  16, 0xbdf0, 0, {0x3f,0x00,0x0f,0xd0,0x07,0xfc,0x00,0xcb,0x00,0x3d,0x40,0x0c,0xe0,0x03,0x38,0x20 },
+  16, 0xbe00, 0, {0xcf,0x02,0x3d,0xc0,0x0c,0xd0,0x03,0x08,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbe10, 0, {0x81,0x04,0x6c,0x00,0x01,0x40,0x22,0x00,0x28,0xa0,0x02,0xce,0x86,0x83,0x64,0x22 },
+  16, 0xbe20, 0, {0xf4,0x08,0x8c,0x0f,0x64,0x00,0xbb,0x10,0x2e,0x60,0x0b,0x9c,0x03,0xac,0x01,0xdb },
+  16, 0xbe30, 0, {0x00,0x3e,0x60,0x08,0x8f,0x02,0x23,0x40,0x8b,0x00,0x3a,0xc0,0x0d,0x10,0x43,0x68 },
+  16, 0xbe40, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0x99,0x00,0xa2,0xc0 },
+  16, 0xbe50, 0, {0x08,0x90,0x02,0xa6,0x07,0x98,0x00,0x02,0xc2,0x48,0x88,0x02,0x2c,0x00,0xba,0x02 },
+  16, 0xbe60, 0, {0x6e,0x60,0x0a,0x98,0x02,0xec,0x00,0x8b,0x01,0x2e,0x60,0x08,0x90,0x02,0x05,0x00 },
+  16, 0xbe70, 0, {0x8b,0x00,0x2e,0xc0,0x08,0xb1,0x02,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbe80, 0, {0x08,0x04,0x0c,0x10,0x81,0x00,0x20,0x40,0x28,0x10,0x26,0xcc,0x80,0x80,0x20,0xa0 },
+  16, 0xbe90, 0, {0xcc,0x18,0x14,0x42,0x04,0x00,0xb2,0x20,0x6c,0x40,0x0b,0x00,0x02,0x8c,0x00,0x83 },
+  16, 0xbea0, 0, {0x00,0x28,0x40,0x28,0x00,0x02,0x00,0x00,0x83,0x00,0x28,0xc0,0x09,0xb0,0x02,0x42 },
+  16, 0xbeb0, 0, {0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x6c,0x00,0xd9,0x00,0x22,0x80 },
+  16, 0xbec0, 0, {0x0c,0x90,0x03,0xac,0x80,0xda,0x29,0x2a,0xd2,0x28,0x80,0x02,0x24,0x00,0xfb,0x20 },
+  16, 0xbed0, 0, {0x3e,0x00,0x0f,0x90,0x02,0xfc,0x00,0x8f,0x00,0x2e,0x40,0x0c,0x80,0x0b,0x20,0x02 },
+  16, 0xbee0, 0, {0xcf,0x00,0x3e,0xc0,0x0c,0xb0,0x03,0x00,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbef0, 0, {0xa0,0x1d,0xfc,0x00,0xfd,0x00,0x3f,0x00,0x0f,0xd0,0x63,0xfc,0x49,0xf5,0x00,0x3e },
+  16, 0xbf00, 0, {0xc0,0x0b,0xc0,0x01,0xf4,0x00,0x7f,0x40,0x3f,0x40,0x1f,0xd0,0x03,0xbc,0x00,0xff },
+  16, 0xbf10, 0, {0x00,0x3f,0x40,0x0f,0xc0,0x03,0xf0,0x00,0xff,0x00,0x3b,0xc0,0x0f,0xf0,0x03,0xe8 },
+  16, 0xbf20, 0, {0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0xf2,0x40,0xec,0xa0,0x3f,0xe0 },
+  16, 0xbf30, 0, {0x0d,0x48,0x03,0x7d,0x80,0xf4,0x80,0x33,0x6c,0x0e,0xc8,0x03,0x32,0x00,0xdd,0x90 },
+  16, 0xbf40, 0, {0x3b,0xa0,0x2d,0xf0,0x03,0xfc,0xc0,0xff,0x00,0x3b,0xe0,0x8e,0xf0,0x03,0x3c,0x04 },
+  16, 0xbf50, 0, {0xec,0x60,0x31,0x00,0x0c,0xf0,0x03,0xb0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbf60, 0, {0x80,0x10,0xec,0x00,0xd9,0xc1,0x2e,0xe1,0x0d,0x88,0x02,0x3c,0x80,0xf8,0x80,0x36 },
+  16, 0xbf70, 0, {0x7d,0x18,0xa0,0x02,0x28,0xb0,0xea,0x20,0x22,0x20,0x08,0x77,0x02,0xfd,0x50,0xbb },
+  16, 0xbf80, 0, {0x80,0x22,0x40,0x0b,0xf4,0x42,0x3d,0x80,0x88,0x31,0x22,0x12,0x08,0xf6,0x02,0xe0 },
+  16, 0xbf90, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x00,0x80,0x11,0x2e,0xc1 },
+  16, 0xbfa0, 0, {0x08,0x00,0x02,0x4d,0x80,0xb8,0x00,0x20,0x00,0x0a,0x02,0x82,0x00,0x00,0x99,0x20 },
+  16, 0xbfb0, 0, {0x22,0xc0,0x09,0x30,0x82,0xcc,0x00,0xb3,0x00,0x28,0xca,0x0b,0x34,0x82,0x0d,0x20 },
+  16, 0xbfc0, 0, {0x80,0x00,0xa0,0x8c,0x08,0x34,0x82,0xa2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbfd0, 0, {0xc0,0x15,0xac,0x40,0x99,0x80,0x2e,0xc2,0x09,0x94,0x02,0x2c,0x00,0xa9,0x80,0x26 },
+  16, 0xbfe0, 0, {0x60,0x08,0x38,0x42,0x22,0x20,0xba,0x41,0x62,0x46,0x3b,0xb0,0x02,0xec,0x01,0xbb },
+  16, 0xbff0, 0, {0x80,0x22,0x40,0x0b,0xb0,0x46,0x0c,0x18,0x88,0xc0,0x22,0x22,0x08,0xb0,0x06,0xf0 },
+  16, 0xc000, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xcc,0x00,0xc9,0x81,0x3c,0xc1 },
+  16, 0xc010, 0, {0x0c,0xa9,0x23,0x6c,0x00,0xb2,0x80,0x32,0x78,0x0a,0x8a,0x0b,0x26,0x00,0x99,0x01 },
+  16, 0xc020, 0, {0x30,0xe0,0x0d,0xb0,0x03,0xec,0x00,0xb9,0x00,0x3a,0xc0,0x1e,0xb0,0x03,0x2c,0x00 },
+  16, 0xc030, 0, {0xcb,0x80,0x32,0x61,0x0c,0xb0,0x13,0x90,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc040, 0, {0xe0,0x01,0xbc,0x10,0xdd,0x00,0x3f,0xc2,0x0f,0xe8,0x03,0xac,0x00,0xfe,0x00,0x3d },
+  16, 0xc050, 0, {0x40,0x0f,0xc0,0x43,0xf8,0x10,0xef,0x14,0xb7,0xe0,0x0c,0xf0,0x03,0xfc,0x00,0xf5 },
+  16, 0xc060, 0, {0x02,0x3f,0x44,0x4f,0xb0,0x4b,0xfc,0x02,0xd4,0x04,0x3d,0x40,0x2f,0xf0,0x03,0xf8 },
+  16, 0xc070, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xf9,0x08,0x3e,0x60 },
+  16, 0xc080, 0, {0x0d,0xa0,0x03,0xac,0x00,0xe8,0x50,0x32,0x00,0x0c,0x84,0x03,0xa5,0x00,0xe9,0x00 },
+  16, 0xc090, 0, {0x3a,0xd8,0x0f,0xb0,0x03,0x2c,0x00,0xf9,0x00,0x3a,0xc0,0x0f,0x30,0x03,0x2c,0x00 },
+  16, 0xc0a0, 0, {0xcb,0x44,0x3e,0xd4,0x0e,0xb0,0x03,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc0b0, 0, {0xc8,0x05,0x2c,0x08,0xb9,0x80,0x2e,0xc0,0x0a,0x30,0x42,0x3c,0x00,0x89,0x04,0x76 },
+  16, 0xc0c0, 0, {0x60,0x08,0x90,0x62,0x20,0x00,0x82,0x04,0x22,0xd0,0x08,0xf0,0x43,0x7c,0x00,0xbb },
+  16, 0xc0d0, 0, {0x82,0x22,0x40,0x0b,0xf0,0x42,0x3c,0x00,0x8a,0xc0,0x2e,0xc1,0x08,0xf0,0x02,0xf2 },
+  16, 0xc0e0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x10,0xb2,0xd0,0x2c,0xc0 },
+  16, 0xc0f0, 0, {0x29,0x18,0x02,0x8c,0x04,0xa1,0x00,0x24,0x9c,0x08,0x10,0x02,0x80,0x00,0xa1,0x01 },
+  16, 0xc100, 0, {0x0c,0xc1,0x2b,0x30,0x52,0x8c,0x04,0xb3,0x01,0x28,0x40,0x4b,0x30,0x02,0x4c,0x00 },
+  16, 0xc110, 0, {0x90,0x20,0x2c,0x20,0x0a,0x30,0x02,0xf8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc120, 0, {0x20,0x41,0x1e,0x00,0xb7,0xa2,0x25,0xe8,0x8a,0x68,0x02,0x1e,0x00,0x85,0x80,0x25 },
+  16, 0xc130, 0, {0x80,0x88,0xe8,0x02,0x3e,0x00,0x85,0x80,0x2f,0xe4,0x28,0x78,0x02,0xde,0x00,0xb7 },
+  16, 0xc140, 0, {0x80,0x61,0xe0,0x03,0x78,0x02,0x5e,0x82,0xb7,0x82,0x2d,0xe0,0x08,0x78,0x02,0xc8 },
+  16, 0xc150, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0d,0x00,0xf0,0x10,0x3c,0x80 },
+  16, 0xc160, 0, {0x0d,0x10,0x83,0x8c,0x00,0xe2,0x50,0x26,0x04,0x0c,0x11,0x03,0x88,0x40,0xeb,0x00 },
+  16, 0xc170, 0, {0x3c,0xc4,0x0f,0x30,0x03,0x8c,0x00,0xf3,0x08,0x38,0x40,0x07,0x30,0x03,0x6e,0x40 },
+  16, 0xc180, 0, {0xd0,0x08,0x3c,0x88,0x0e,0x30,0x43,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc190, 0, {0x40,0x1d,0xbc,0x00,0xfb,0x34,0x3c,0xc9,0x4e,0xb0,0x23,0xed,0x20,0xfb,0x04,0x3f },
+  16, 0xc1a0, 0, {0xc8,0x8f,0x70,0x53,0x4c,0x00,0xeb,0x10,0x31,0xc5,0x0e,0xf4,0x03,0x6d,0x00,0xf3 },
+  16, 0xc1b0, 0, {0x00,0x3f,0xc0,0x0f,0xf4,0x0b,0xbc,0x00,0xcd,0x00,0x3f,0xc0,0x0f,0xf4,0x83,0xd0 },
+  16, 0xc1c0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xce,0x04,0xc9,0x04,0xb0,0xc1 },
+  16, 0xc1d0, 0, {0x0f,0x98,0x13,0x6c,0x90,0xcb,0x02,0x3e,0xc0,0x4f,0xb0,0x63,0xe4,0x00,0xf1,0x80 },
+  16, 0xc1e0, 0, {0x12,0xc0,0x0c,0xb5,0x03,0xec,0xc0,0xcf,0x83,0x32,0x40,0x0f,0xb3,0x23,0x2d,0xa4 },
+  16, 0xc1f0, 0, {0xfb,0x00,0x3e,0x00,0x0f,0xb4,0x03,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc200, 0, {0x48,0x11,0x9c,0x00,0x87,0x00,0x21,0xc0,0x2d,0x60,0x02,0x1c,0x00,0xd7,0x00,0x39 },
+  16, 0xc210, 0, {0xc0,0x0b,0x60,0x02,0xdc,0x00,0xb5,0x00,0x21,0xc0,0x2a,0x70,0x12,0xcc,0x80,0x87 },
+  16, 0xc220, 0, {0x00,0x35,0xc0,0x0b,0x72,0x52,0x1c,0x00,0xb7,0x00,0x2d,0x41,0x0b,0x32,0x02,0x12 },
+  16, 0xc230, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0xbe,0x00,0x81,0xc0,0x23,0x20 },
+  16, 0xc240, 0, {0x0b,0xd8,0x02,0x5e,0x00,0x06,0xc0,0x2d,0xa0,0x0b,0x7c,0x12,0xde,0x08,0xbf,0x80 },
+  16, 0xc250, 0, {0xa1,0xe2,0x2a,0x7a,0x02,0xde,0x00,0x93,0x80,0x25,0x60,0x0b,0x78,0x1e,0x5e,0x50 },
+  16, 0xc260, 0, {0xb7,0x80,0x2d,0xa0,0x0b,0x78,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc270, 0, {0x48,0x14,0xce,0x00,0x83,0x60,0x20,0xc0,0x09,0x31,0x02,0x2c,0x00,0x93,0x00,0x28 },
+  16, 0xc280, 0, {0xc0,0x1b,0xb0,0x06,0xcc,0x80,0xb3,0x48,0x20,0xf0,0x0a,0x30,0x02,0xec,0x00,0x93 },
+  16, 0xc290, 0, {0x80,0x24,0xc0,0x0b,0xb0,0x02,0x4c,0x10,0xb3,0xc8,0x2c,0xd2,0x8b,0x30,0x02,0x12 },
+  16, 0xc2a0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xbb,0x00,0xc6,0xc4,0x31,0x81 },
+  16, 0xc2b0, 0, {0x0f,0xe0,0x03,0x68,0x00,0xce,0x80,0x3f,0xa2,0x0b,0xe8,0x03,0xf9,0x00,0xfe,0x40 },
+  16, 0xc2c0, 0, {0x31,0x80,0x6e,0xa0,0x07,0xe8,0x00,0xda,0x00,0x26,0x81,0x0f,0xa0,0x02,0x68,0x01 },
+  16, 0xc2d0, 0, {0xf6,0xe0,0x3d,0x92,0x0f,0xa0,0x03,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc2e0, 0, {0x48,0x00,0xe0,0xc2,0xf8,0x04,0x3e,0x14,0x0f,0x80,0x13,0xe0,0x10,0xf8,0x01,0x3e },
+  16, 0xc2f0, 0, {0x10,0x0f,0x80,0x43,0xe0,0x00,0xb8,0x00,0x3e,0x00,0x47,0x80,0x03,0xe0,0x02,0xe8 },
+  16, 0xc300, 0, {0x10,0x3e,0x00,0x0f,0x80,0x07,0xa0,0x00,0xf8,0x00,0x2e,0x00,0x0f,0x80,0x0b,0xd2 },
+  16, 0xc310, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xf9,0x01,0x32,0x40 },
+  16, 0xc320, 0, {0x8c,0x90,0x03,0xe4,0x00,0xc9,0x00,0x36,0x42,0x0f,0x90,0x03,0xa4,0x00,0xc9,0x00 },
+  16, 0xc330, 0, {0x3e,0x42,0x0d,0x90,0x03,0x64,0x00,0xd9,0x00,0x3e,0x40,0x0f,0x90,0x0b,0x64,0x00 },
+  16, 0xc340, 0, {0xf9,0x90,0x32,0x41,0x0c,0x90,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc350, 0, {0x80,0x04,0x64,0x00,0xb9,0xc8,0xa2,0x60,0x0a,0x92,0x02,0xe4,0x00,0x89,0x40,0x2e },
+  16, 0xc360, 0, {0x58,0x0b,0x90,0x02,0x04,0x00,0xd9,0x00,0x2e,0x42,0x08,0x90,0x02,0xe4,0x04,0x89 },
+  16, 0xc370, 0, {0x00,0x2e,0x40,0x0b,0x90,0x06,0x24,0x04,0xb9,0x08,0x2a,0x40,0x48,0x90,0x12,0x20 },
+  16, 0xc380, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0xb9,0x10,0x22,0x44 },
+  16, 0xc390, 0, {0x08,0x90,0x02,0xe4,0x00,0x89,0x00,0x22,0x45,0x8b,0x90,0x02,0xa4,0x00,0x89,0x00 },
+  16, 0xc3a0, 0, {0x2a,0x40,0x09,0x90,0x02,0xe4,0x00,0x99,0x80,0x2e,0x40,0x0b,0x90,0x26,0x24,0x00 },
+  16, 0xc3b0, 0, {0xb9,0x01,0x22,0x70,0x09,0x10,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc3c0, 0, {0x08,0x04,0x04,0x08,0xb1,0x20,0x20,0x40,0x0a,0x10,0x02,0xc4,0x80,0x83,0x00,0x2c },
+  16, 0xc3d0, 0, {0x50,0x4b,0x10,0x02,0x24,0x00,0x91,0x00,0x2e,0x40,0x08,0x12,0x02,0xc4,0x81,0x81 },
+  16, 0xc3e0, 0, {0xa2,0x6c,0x40,0x0b,0x12,0x02,0x04,0x80,0xb9,0x20,0x2a,0x48,0x29,0x12,0x02,0x02 },
+  16, 0xc3f0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x61,0x40,0xf8,0x00,0x32,0x80 },
+  16, 0xc400, 0, {0x08,0x80,0x03,0xe1,0x42,0xc8,0x00,0x32,0x00,0x1f,0x85,0x03,0xa1,0x40,0xc8,0x50 },
+  16, 0xc410, 0, {0x3a,0x00,0x8d,0x85,0x03,0x61,0x40,0xd8,0x00,0x3e,0x00,0x0f,0x05,0x03,0x21,0x40 },
+  16, 0xc420, 0, {0xf8,0x50,0x32,0x14,0x0d,0x85,0x0b,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc430, 0, {0x98,0x1d,0xf4,0x04,0xfd,0x10,0x3f,0x40,0x0f,0x50,0x03,0xc4,0x40,0xfd,0x00,0x3f },
+  16, 0xc440, 0, {0x51,0x0f,0xd0,0x03,0xf4,0x00,0xff,0x01,0x3d,0x40,0x0f,0x91,0x03,0xe4,0x40,0xfd },
+  16, 0xc450, 0, {0x10,0x3f,0x4a,0x0f,0x91,0x03,0xe4,0x40,0xfd,0x10,0x3f,0x44,0x0e,0x91,0x03,0xe6 },
+  16, 0xc460, 0, {0x02,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xc5,0x00,0xcd,0x00,0x31,0x40 },
+  16, 0xc470, 0, {0x0d,0xd0,0x43,0xe4,0x00,0xcd,0x00,0x33,0x40,0x4f,0x11,0x02,0xe4,0x04,0xc1,0x00 },
+  16, 0xc480, 0, {0x3d,0x40,0x0c,0x90,0x03,0xe4,0x00,0xed,0xa4,0x32,0x50,0x0f,0x90,0x03,0xe4,0x00 },
+  16, 0xc490, 0, {0xfd,0x00,0x3f,0x40,0x0f,0x90,0x03,0xc6,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc4a0, 0, {0x38,0x10,0xe2,0x08,0xd8,0x00,0x32,0x01,0x00,0x80,0x12,0xc0,0x00,0x48,0x00,0x36 },
+  16, 0xc4b0, 0, {0x80,0x0b,0x8a,0x02,0xe0,0x00,0xa8,0x00,0x2e,0x00,0x0f,0x80,0x02,0xe0,0x00,0x88 },
+  16, 0xc4c0, 0, {0x50,0x34,0x28,0x0b,0x80,0x02,0xe0,0x00,0xb8,0x00,0x2e,0x00,0x0b,0x80,0x02,0xce },
+  16, 0xc4d0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x80,0x81,0x00,0x26,0x40 },
+  16, 0xc4e0, 0, {0x09,0x18,0x02,0xc4,0x08,0x21,0x00,0x28,0x40,0x8b,0x10,0x02,0xc4,0x00,0xb1,0x01 },
+  16, 0xc4f0, 0, {0x2e,0x40,0x18,0x10,0x02,0xc4,0x00,0xa1,0x01,0x20,0x48,0x1b,0x10,0x02,0xc4,0x00 },
+  16, 0xc500, 0, {0xb1,0x00,0x6c,0x40,0x0b,0x10,0x12,0xc2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc510, 0, {0x18,0x11,0xa4,0x00,0x99,0x80,0xa2,0x42,0x48,0x90,0x02,0xe4,0x00,0xa9,0x2a,0x26 },
+  16, 0xc520, 0, {0x44,0x0b,0x90,0x82,0xc4,0x81,0xb9,0x00,0x2e,0x40,0x0b,0x90,0x42,0xc4,0x00,0x89 },
+  16, 0xc530, 0, {0x00,0x26,0x40,0x0b,0x90,0x02,0xe4,0x00,0xb9,0x01,0x2e,0x41,0x0b,0x90,0x02,0xc6 },
+  16, 0xc540, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xc5,0x20,0xc9,0x84,0x30,0x70 },
+  16, 0xc550, 0, {0x0d,0x90,0x13,0xe4,0x02,0xe9,0x00,0x32,0x70,0x0f,0x94,0x03,0xe4,0x00,0xf9,0x40 },
+  16, 0xc560, 0, {0x3c,0x48,0x0c,0x90,0x03,0xe4,0x00,0xe1,0x00,0x32,0x40,0x0f,0x90,0x01,0xe4,0x00 },
+  16, 0xc570, 0, {0xf9,0x90,0x3e,0x60,0x0f,0x90,0x26,0xe8,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc580, 0, {0x28,0x01,0xa5,0x00,0xf1,0x04,0x3a,0x44,0x8f,0x90,0x03,0xe4,0x10,0xc9,0x04,0x3e },
+  16, 0xc590, 0, {0x60,0x0f,0x90,0x03,0xe4,0x00,0xe9,0x20,0x3e,0x40,0x0f,0x90,0x03,0xe4,0x10,0xf9 },
+  16, 0xc5a0, 0, {0x90,0x3e,0x40,0x0f,0x90,0x03,0xe4,0x00,0xf9,0x80,0x3e,0x64,0x0f,0x90,0x07,0xca },
+  16, 0xc5b0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa1,0x00,0xc8,0x04,0x3a,0x00 },
+  16, 0xc5c0, 0, {0x1e,0x80,0x03,0x80,0x03,0xc8,0x40,0x2a,0x04,0x1f,0x80,0x03,0x20,0x00,0x88,0x00 },
+  16, 0xc5d0, 0, {0x32,0x30,0x0c,0x80,0x03,0x20,0x00,0xf8,0x00,0x3e,0x00,0x0c,0x80,0x03,0xe0,0x00 },
+  16, 0xc5e0, 0, {0xc8,0x80,0x3e,0x20,0x0f,0x80,0x03,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc5f0, 0, {0x28,0x05,0x38,0x00,0xae,0xd0,0x37,0x80,0x08,0xec,0x46,0x38,0x00,0xd6,0x04,0x23 },
+  16, 0xc600, 0, {0xa0,0x0b,0xa0,0x41,0x78,0x04,0xfa,0x00,0x37,0x80,0x0d,0xa0,0x02,0xa8,0x10,0xee },
+  16, 0xc610, 0, {0x21,0x2e,0x80,0x08,0xa0,0x02,0xe8,0x08,0x8e,0x80,0x2f,0xa0,0x8b,0xa0,0x02,0xca },
+  16, 0xc620, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x01,0x4c,0x02,0x83,0xc0,0xa8,0xe8 },
+  16, 0xc630, 0, {0x4a,0x36,0x02,0x8c,0x00,0x13,0xa0,0x28,0xc2,0x0b,0x30,0x06,0x0c,0x00,0xb3,0x00 },
+  16, 0xc640, 0, {0x24,0x84,0x09,0x30,0x02,0x0c,0x00,0xb3,0x20,0x28,0xc0,0x09,0x30,0x02,0xcc,0x00 },
+  16, 0xc650, 0, {0x83,0x80,0x2c,0xc0,0x0b,0x30,0x02,0xca,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc660, 0, {0xa0,0x01,0x3c,0x44,0xaf,0x40,0x25,0xc2,0x48,0xf8,0x82,0x1c,0xc8,0x9f,0x08,0x21 },
+  16, 0xc670, 0, {0xc0,0x8b,0xf8,0x02,0x5c,0x00,0xbf,0xb0,0x27,0x80,0x09,0x3a,0x02,0x9c,0x00,0xa5 },
+  16, 0xc680, 0, {0x02,0x2d,0xe8,0x09,0x70,0x02,0xce,0x80,0x85,0x08,0x2d,0xc2,0x0b,0x73,0x02,0xe8 },
+  16, 0xc690, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0x00,0xc7,0x82,0xa9,0xe0 },
+  16, 0xc6a0, 0, {0x0a,0x78,0x02,0x9e,0x40,0x97,0x84,0x39,0xa0,0x0b,0x7a,0x83,0x3f,0x80,0xd7,0x91 },
+  16, 0xc6b0, 0, {0x35,0xa0,0x0d,0x7a,0x09,0x1e,0x44,0xf7,0x80,0x3d,0xe8,0x2d,0x7a,0x03,0xde,0x82 },
+  16, 0xc6c0, 0, {0xc6,0x80,0x3d,0x20,0x4b,0x7b,0x23,0xea,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc6d0, 0, {0x08,0x1d,0xac,0x00,0xd3,0x00,0x3e,0xc1,0x0f,0x30,0x03,0xed,0x80,0xe3,0x00,0x3e },
+  16, 0xc6e0, 0, {0x80,0x0f,0xb6,0x21,0xec,0x08,0xdb,0x21,0x3e,0x80,0x0f,0xb5,0x03,0x6c,0x40,0xf9 },
+  16, 0xc6f0, 0, {0x00,0x3e,0xdc,0x0e,0xb2,0x03,0xed,0x40,0xf9,0x02,0x3e,0x80,0x0f,0xb0,0x03,0xc2 },
+  16, 0xc700, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xfe,0x00,0xcf,0x80,0x3d,0xe0 },
+  16, 0xc710, 0, {0x0f,0xc8,0x43,0xfe,0x00,0xfe,0x84,0x3f,0xe0,0x0d,0xf8,0xc3,0xff,0x10,0xaf,0x90 },
+  16, 0xc720, 0, {0x35,0xa0,0x0c,0xfc,0x03,0x3e,0x14,0xec,0x84,0x3f,0xf0,0x0e,0xfc,0xc3,0xff,0x08 },
+  16, 0xc730, 0, {0x4f,0x80,0x33,0xe4,0x0c,0xf8,0x03,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc740, 0, {0xa8,0x11,0x9c,0x00,0xd7,0xa2,0x2d,0xc4,0x0c,0x41,0xc2,0xdc,0x00,0x74,0x00,0x25 },
+  16, 0xc750, 0, {0x80,0x0f,0x72,0x42,0xdc,0x90,0xd7,0x38,0x2d,0x98,0x0a,0x70,0x02,0x1c,0x04,0x86 },
+  16, 0xc760, 0, {0x00,0x3f,0xc0,0x0d,0x70,0x02,0xcc,0x00,0x86,0x08,0x37,0xc6,0x28,0x70,0x02,0x2a },
+  16, 0xc770, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x00,0x87,0x60,0x2d,0xc2 },
+  16, 0xc780, 0, {0x0a,0x50,0x02,0xdc,0x00,0xb6,0x10,0x25,0xc2,0x09,0x70,0x86,0xdc,0x30,0x97,0x00 },
+  16, 0xc790, 0, {0x25,0x80,0x08,0x30,0x02,0x5c,0x00,0x87,0x08,0x2d,0xc0,0x08,0x70,0x02,0xcc,0x40 },
+  16, 0xc7a0, 0, {0x86,0x00,0x21,0x00,0x09,0x70,0x0a,0x00,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc7b0, 0, {0x20,0x14,0xed,0x80,0x93,0x00,0x0c,0xe1,0x28,0x18,0x02,0xcc,0x08,0xa0,0x00,0x24 },
+  16, 0xc7c0, 0, {0x12,0x1a,0x34,0x02,0xcf,0x04,0x93,0x40,0x2c,0x80,0x0a,0xb0,0x22,0x4c,0x02,0x81 },
+  16, 0xc7d0, 0, {0x80,0x28,0xe0,0x28,0x30,0x02,0xcc,0x00,0x88,0x82,0x24,0x20,0x08,0xb0,0x02,0x08 },
+  16, 0xc7e0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xbf,0x20,0xc9,0xe0,0x2c,0xf1 },
+  16, 0xc7f0, 0, {0x0e,0xbd,0x03,0xfc,0x00,0xb9,0x40,0x36,0x40,0x09,0xf5,0x02,0xfd,0x40,0xff,0x80 },
+  16, 0xc800, 0, {0x36,0xa2,0x08,0xf0,0x0b,0x7c,0x00,0xeb,0x80,0x2f,0xe0,0x0a,0xf0,0x43,0xfc,0x02 },
+  16, 0xc810, 0, {0x8b,0xd0,0x32,0xf0,0x0d,0xf0,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc820, 0, {0x80,0x00,0xec,0x10,0xfb,0x00,0x3e,0xc8,0x0f,0x94,0x13,0xec,0x00,0xf9,0x40,0x36 },
+  16, 0xc830, 0, {0x40,0x1f,0xb0,0x03,0xec,0x10,0xfb,0x01,0x3e,0xd0,0x0f,0xb0,0x03,0xac,0x00,0xf9 },
+  16, 0xc840, 0, {0x00,0x3e,0xc4,0x0f,0xb0,0x01,0xec,0x00,0xf9,0x04,0x3e,0x48,0x0f,0xb0,0x03,0xe0 },
+  16, 0xc850, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x00,0xdf,0x00,0x3f,0xc0 },
+  16, 0xc860, 0, {0x0c,0xe0,0x07,0xfc,0x00,0xfc,0x0a,0x27,0x00,0x4f,0xf0,0x03,0xfc,0x00,0xff,0x08 },
+  16, 0xc870, 0, {0x33,0x80,0x0c,0xf0,0x00,0x2c,0x00,0x5f,0x00,0x33,0xc0,0x0c,0xf0,0x01,0xfc,0x00 },
+  16, 0xc880, 0, {0xfe,0x00,0x23,0x40,0x0f,0xb0,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc890, 0, {0x81,0x04,0x6c,0x00,0x8b,0x86,0x2e,0xe0,0x48,0x8f,0x02,0xec,0x08,0xb8,0xa0,0x36 },
+  16, 0xc8a0, 0, {0x30,0x4b,0xb0,0x03,0xac,0x0c,0x9b,0x02,0x3c,0xa0,0x0c,0xb0,0x43,0x6c,0x00,0xb1 },
+  16, 0xc8b0, 0, {0x00,0x28,0xc0,0x0d,0xb0,0x12,0xec,0x10,0xb9,0x80,0xa2,0x61,0x0b,0xb0,0x02,0x20 },
+  16, 0xc8c0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0x9b,0x88,0x2e,0xe0 },
+  16, 0xc8d0, 0, {0x08,0xa0,0x02,0xec,0x01,0xbb,0x80,0x26,0x62,0x0b,0xb0,0x02,0xec,0x00,0xb3,0x01 },
+  16, 0xc8e0, 0, {0x2a,0x21,0x08,0xb0,0x12,0x2c,0x00,0xb8,0x00,0x22,0xc0,0x08,0xb0,0x12,0xec,0x14 },
+  16, 0xc8f0, 0, {0xb9,0x84,0x22,0xa2,0x0b,0xb0,0x02,0xa0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc900, 0, {0x08,0x04,0x0c,0x04,0x93,0x00,0x2c,0xe0,0x08,0x00,0x02,0xcc,0x09,0x91,0x00,0x20 },
+  16, 0xc910, 0, {0x40,0x0b,0x30,0x06,0x4c,0x04,0x13,0x00,0x26,0x00,0x08,0x30,0x02,0xcc,0x04,0xb2 },
+  16, 0xc920, 0, {0x00,0x2a,0xc0,0x01,0x30,0x00,0xcd,0x00,0xb0,0x00,0x20,0x80,0x0b,0x30,0x0a,0x02 },
+  16, 0xc930, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x6c,0x00,0xdb,0x24,0x6e,0xc0 },
+  16, 0xc940, 0, {0x2c,0xa0,0x02,0xfc,0x00,0xba,0x04,0x26,0x40,0x4f,0xf0,0x57,0xfc,0x00,0x3f,0x01 },
+  16, 0xc950, 0, {0x3a,0x00,0x2c,0xf0,0x01,0x3c,0x00,0xdb,0x00,0x33,0xc0,0x84,0xf0,0x03,0xfd,0x08 },
+  16, 0xc960, 0, {0xfa,0x00,0x32,0x00,0x0f,0xf0,0x03,0x00,0x01,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc970, 0, {0xa0,0x19,0xdc,0x00,0xea,0x40,0x3f,0x00,0x07,0xc0,0x03,0xfc,0x04,0xfc,0x00,0x3f },
+  16, 0xc980, 0, {0x40,0x0f,0xf0,0x03,0x9c,0x00,0xff,0x00,0x3f,0x00,0x0e,0xf0,0x03,0x7c,0x00,0xfd },
+  16, 0xc990, 0, {0x00,0x3f,0xc1,0x0f,0xf0,0x03,0xfc,0x84,0xf4,0x00,0x3f,0x00,0x0f,0xf0,0x03,0xe8 },
+  16, 0xc9a0, 0, {0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0xf0,0x80,0xff,0x00,0x03,0xc2 },
+  16, 0xc9b0, 0, {0x0f,0xc2,0x03,0x3e,0x00,0xdf,0xc0,0x3e,0xc0,0x4d,0xdb,0x02,0xb0,0xc0,0xdc,0x30 },
+  16, 0xc9c0, 0, {0x3f,0xe0,0x0f,0xdb,0x23,0xf6,0x20,0xff,0x26,0x33,0xe0,0x0f,0x52,0x03,0x5e,0x00 },
+  16, 0xc9d0, 0, {0xff,0x80,0x33,0xc0,0x4c,0x49,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc9e0, 0, {0x80,0x10,0xe1,0xe0,0xb7,0x08,0x23,0xf0,0x0b,0xad,0x0a,0x2e,0x00,0x9a,0x04,0x2e },
+  16, 0xc9f0, 0, {0xb0,0x09,0x8f,0x03,0xa0,0x40,0xb9,0x30,0x2e,0xa0,0x0b,0x9f,0x03,0xa7,0x00,0xbb },
+  16, 0xca00, 0, {0x80,0x26,0xe0,0x0b,0xdd,0x02,0x2e,0x00,0xbb,0x80,0x22,0xf4,0x0a,0x92,0x02,0xa0 },
+  16, 0xca10, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xc8,0x80,0xb3,0x10,0x24,0xc0 },
+  16, 0xca20, 0, {0x0b,0x80,0x02,0xac,0x00,0xa3,0x24,0x2c,0xd0,0x08,0x10,0x06,0xc0,0x80,0xb2,0x01 },
+  16, 0xca30, 0, {0x2c,0xea,0x4b,0x00,0x12,0xc2,0x04,0xb3,0x10,0x08,0xc0,0x0a,0x90,0x02,0x0c,0x00 },
+  16, 0xca40, 0, {0x93,0x04,0x24,0xc0,0x09,0x82,0x02,0xa2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xca50, 0, {0xc0,0x15,0xa5,0x00,0xbb,0x00,0x22,0xc0,0x0b,0x80,0x02,0xac,0x08,0xbb,0x18,0x2e },
+  16, 0xca60, 0, {0xe0,0x18,0x88,0x02,0xec,0x01,0xba,0x00,0x2e,0x80,0x0b,0x98,0x86,0xe2,0x00,0xbb },
+  16, 0xca70, 0, {0x00,0x22,0xc4,0x0b,0x90,0x02,0x6c,0x00,0xbb,0x00,0xa6,0xc0,0x0b,0x90,0x00,0xb0 },
+  16, 0xca80, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x11,0xe7,0x00,0xfb,0x00,0xb2,0xc0 },
+  16, 0xca90, 0, {0x0f,0xa8,0x03,0xac,0x02,0xeb,0x00,0x3e,0x60,0x0d,0x9e,0x03,0xec,0x00,0xd8,0x40 },
+  16, 0xcaa0, 0, {0x3e,0x40,0x0f,0x88,0x43,0xe2,0x00,0xfb,0x20,0x32,0xc0,0x0f,0x10,0x0b,0x6f,0x90 },
+  16, 0xcab0, 0, {0x5b,0x82,0x36,0xc0,0x2d,0x08,0x01,0x90,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcac0, 0, {0xe0,0x01,0xb7,0x08,0xf7,0x00,0x3f,0xc0,0x0f,0xf9,0x03,0x7c,0x08,0xcf,0x82,0x3c },
+  16, 0xcad0, 0, {0x00,0xaf,0xd0,0x21,0xbc,0x08,0xfd,0x10,0x3f,0x80,0x8f,0xc0,0x03,0xa4,0x00,0xf7 },
+  16, 0xcae0, 0, {0x01,0xbf,0xc0,0x07,0xd0,0x03,0xbd,0x30,0xff,0xa4,0x38,0xc0,0x0e,0xda,0x03,0xf8 },
+  16, 0xcaf0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xa8,0x00,0xfb,0x00,0xb2,0xc1 },
+  16, 0xcb00, 0, {0x0e,0x81,0x03,0xec,0x40,0xfb,0x44,0x3a,0xc1,0x0e,0x95,0x03,0xe0,0x00,0xcb,0x41 },
+  16, 0xcb10, 0, {0x32,0x4d,0x0f,0x81,0x03,0xe0,0x20,0xc9,0x00,0x72,0xe8,0x44,0x91,0x03,0x6d,0x00 },
+  16, 0xcb20, 0, {0xcb,0x02,0x3e,0xc0,0x0c,0x80,0x03,0x90,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcb30, 0, {0xc8,0x05,0x24,0x00,0xbf,0x00,0x33,0xc4,0x08,0x1d,0x03,0x8c,0x00,0xbb,0x98,0x36 },
+  16, 0xcb40, 0, {0x48,0x4d,0x98,0x22,0xed,0x40,0xdb,0x00,0x36,0xb0,0x0b,0x98,0x02,0xe3,0x00,0xdb },
+  16, 0xcb50, 0, {0x00,0x32,0xe0,0x88,0xd8,0x02,0x2c,0x02,0xc3,0x80,0x2f,0xc0,0x08,0x90,0x03,0x72 },
+  16, 0xcb60, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x01,0x44,0x00,0xb3,0x00,0x20,0xf0 },
+  16, 0xcb70, 0, {0x18,0x08,0x02,0x4f,0x84,0xb1,0xc0,0x24,0xc0,0x89,0x06,0x02,0xc4,0x00,0x91,0x00 },
+  16, 0xcb80, 0, {0x20,0xf0,0x1b,0x18,0x82,0xc6,0x00,0x93,0x00,0x2c,0xd1,0x08,0x1e,0x02,0x0e,0x44 },
+  16, 0xcb90, 0, {0x93,0x94,0x2c,0xc0,0x08,0x20,0x02,0xb8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcba0, 0, {0x20,0x01,0x1e,0x04,0xb7,0x80,0x20,0xe2,0x08,0x68,0x06,0x9e,0x80,0xbf,0x84,0x25 },
+  16, 0xcbb0, 0, {0xa8,0x09,0x68,0x02,0xc6,0x00,0x93,0xa0,0x65,0xe4,0x0b,0x78,0x12,0xde,0x00,0x93 },
+  16, 0xcbc0, 0, {0x00,0xa1,0xe0,0x08,0xd8,0x02,0x1e,0xd0,0xa7,0x80,0x2d,0xe0,0x08,0xf8,0x02,0x48 },
+  16, 0xcbd0, 0, {0x10,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x08,0x00,0xb3,0x20,0x30,0xc0 },
+  16, 0xcbe0, 0, {0x0a,0x22,0x02,0xce,0x40,0xf3,0xa0,0x3c,0xe8,0x0b,0x30,0x02,0xc1,0x00,0xd0,0xc1 },
+  16, 0xcbf0, 0, {0x30,0xc0,0x0b,0x21,0x13,0xcc,0x21,0xd3,0x00,0x2c,0xc0,0x2c,0x10,0x0b,0x0c,0x80 },
+  16, 0xcc00, 0, {0xd3,0x61,0x3c,0xc8,0x2c,0x20,0x03,0x92,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcc10, 0, {0x40,0x1d,0xbc,0x00,0xff,0x40,0x3b,0xc0,0x0f,0xe0,0x03,0xfc,0x00,0xf7,0x50,0x7f },
+  16, 0xcc20, 0, {0xc4,0x2e,0xf0,0x03,0xfc,0x40,0xfe,0x00,0x3f,0xc0,0x0f,0xf0,0x47,0xfc,0x00,0xff },
+  16, 0xcc30, 0, {0x00,0x7d,0xc2,0x0f,0xd0,0x01,0xbc,0x80,0x5f,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0xd0 },
+  16, 0xcc40, 0, {0x02,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xe4,0x00,0xfb,0xc0,0x32,0xc8 },
+  16, 0xcc50, 0, {0x0e,0xe0,0x03,0xac,0xa0,0xeb,0x20,0x32,0x40,0x8c,0xa0,0x13,0x2c,0x00,0xd9,0x00 },
+  16, 0xcc60, 0, {0x3e,0x60,0x0c,0xb0,0x03,0xe8,0x00,0xfa,0x80,0x30,0xc0,0x3c,0x92,0x03,0xef,0x60 },
+  16, 0xcc70, 0, {0xc3,0x20,0x31,0xc4,0x0c,0xa0,0x03,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcc80, 0, {0x48,0x11,0x9c,0x00,0x33,0x20,0x21,0xda,0x0b,0x70,0x43,0x9c,0x01,0xb5,0x00,0x21 },
+  16, 0xcc90, 0, {0x00,0x0a,0xe0,0x02,0x1c,0x00,0xb7,0x00,0x2f,0xc0,0x0d,0x70,0x03,0x9c,0x00,0xb6 },
+  16, 0xcca0, 0, {0x00,0x31,0xc8,0x08,0x57,0x02,0xdc,0x00,0x87,0x50,0x21,0xc0,0x0a,0x70,0x42,0x92 },
+  16, 0xccb0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9a,0x11,0xb7,0x90,0x21,0xe0 },
+  16, 0xccc0, 0, {0x0b,0x68,0x82,0xde,0x08,0xa7,0x80,0x24,0x60,0x08,0x70,0x12,0x12,0x08,0x95,0x80 },
+  16, 0xccd0, 0, {0x2d,0x60,0x09,0x6c,0x02,0xde,0x00,0xb1,0x80,0x23,0xe0,0x0a,0x58,0x62,0xfe,0x00 },
+  16, 0xcce0, 0, {0x97,0xa0,0x21,0xe8,0x09,0xe8,0x02,0x30,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xccf0, 0, {0x48,0x14,0xcd,0x00,0xb3,0x00,0x20,0xc0,0x8b,0x3c,0x02,0x8c,0x00,0xbb,0x00,0x24 },
+  16, 0xcd00, 0, {0xc4,0x1a,0x3d,0x02,0x2f,0x88,0xb3,0x48,0x2c,0xe0,0x89,0x3e,0x02,0x8d,0x80,0x93 },
+  16, 0xcd10, 0, {0xd9,0xa4,0x40,0x88,0x10,0x02,0xcc,0x04,0x93,0xc8,0x20,0xc0,0x0b,0x30,0x02,0x92 },
+  16, 0xcd20, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xb9,0x40,0xfa,0x00,0xb2,0x80 },
+  16, 0xcd30, 0, {0x0f,0xe0,0x03,0xe8,0x00,0xea,0x80,0x37,0xa0,0x0c,0xe8,0x13,0x3b,0x08,0xde,0x01 },
+  16, 0xcd40, 0, {0x3f,0x82,0x0c,0xe0,0x43,0xfa,0x80,0xfe,0x80,0x31,0x28,0x0c,0xa0,0x03,0xf0,0x02 },
+  16, 0xcd50, 0, {0xc4,0xc0,0xb2,0x80,0x0d,0xe0,0x03,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcd60, 0, {0x48,0x00,0xe0,0x00,0xf8,0x00,0x3e,0x10,0x0b,0x80,0x83,0xe0,0x00,0xf8,0x30,0x3a },
+  16, 0xcd70, 0, {0x00,0x6d,0x80,0x83,0xe1,0x44,0xb8,0x04,0x3e,0x10,0x0f,0x80,0x13,0xe0,0x00,0xf8 },
+  16, 0xcd80, 0, {0x00,0x3a,0x10,0x4f,0x04,0x03,0xe3,0x00,0xe8,0x10,0x3e,0x00,0x0e,0x80,0x03,0xd2 },
+  16, 0xcd90, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xc9,0x00,0x38,0x40 },
+  16, 0xcda0, 0, {0x0f,0x1a,0x03,0x2e,0x00,0xfb,0xa0,0x36,0x60,0x0c,0x98,0x03,0xe6,0x04,0xd1,0x00 },
+  16, 0xcdb0, 0, {0x36,0x48,0x0e,0x91,0x02,0xe6,0x00,0xf9,0x00,0x3e,0x00,0x0c,0x99,0x03,0x62,0x40 },
+  16, 0xcdc0, 0, {0xf8,0x00,0xa0,0x68,0x0c,0x90,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcdd0, 0, {0x80,0x04,0x64,0x02,0x89,0x04,0x2e,0x64,0x88,0x94,0x02,0xa5,0x00,0xb9,0x80,0x20 },
+  16, 0xcde0, 0, {0x64,0x0d,0x9c,0x02,0xe6,0x42,0x89,0x00,0x22,0x60,0x0b,0x9c,0x02,0xe4,0x10,0xb9 },
+  16, 0xcdf0, 0, {0x40,0x3a,0x50,0x08,0x9c,0x02,0x27,0x20,0xb9,0x00,0x22,0x40,0x08,0x10,0x03,0x60 },
+  16, 0xce00, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x04,0x00,0x89,0x00,0x22,0x40 },
+  16, 0xce10, 0, {0x0a,0x90,0x82,0x25,0x4c,0xb9,0x00,0x02,0x40,0x08,0x96,0x02,0xe4,0x10,0x89,0x00 },
+  16, 0xce20, 0, {0x26,0x50,0x13,0x94,0x02,0xe4,0x40,0xb9,0x08,0x2e,0x40,0x08,0x90,0x8a,0x24,0x00 },
+  16, 0xce30, 0, {0xb9,0x01,0x2a,0x40,0x08,0x90,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xce40, 0, {0x08,0x04,0x05,0x80,0x81,0x40,0x2c,0xc8,0x08,0x10,0x06,0x84,0x00,0xb1,0x04,0x20 },
+  16, 0xce50, 0, {0x49,0x09,0x14,0x42,0xcc,0x89,0x81,0x20,0x20,0x50,0x0b,0x14,0x46,0xc4,0x00,0xb1 },
+  16, 0xce60, 0, {0x00,0x2a,0xc0,0x28,0x14,0x02,0x01,0x01,0xb0,0x04,0x28,0x40,0x38,0x94,0x02,0x42 },
+  16, 0xce70, 0, {0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0x88,0x00,0x3a,0x00 },
+  16, 0xce80, 0, {0x0e,0x80,0x23,0x20,0x00,0xf8,0x50,0xb2,0x00,0x0c,0x80,0x12,0xe1,0x40,0xd8,0x50 },
+  16, 0xce90, 0, {0x36,0x00,0x0e,0x80,0x03,0xe0,0x00,0xf8,0x00,0x2e,0x00,0x0c,0x80,0x53,0x60,0x04 },
+  16, 0xcea0, 0, {0xf8,0x00,0x3a,0x00,0x0c,0x80,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xceb0, 0, {0x98,0x1d,0xf4,0x40,0xf9,0x44,0x3e,0x44,0x0f,0xd4,0x03,0xe4,0x00,0xf1,0x00,0x3f },
+  16, 0xcec0, 0, {0x44,0x0f,0xd4,0x53,0xf4,0x44,0xfd,0x10,0x2f,0x40,0x0f,0xf4,0x03,0xfd,0x00,0xfd },
+  16, 0xced0, 0, {0x40,0x3b,0x10,0x0f,0xd4,0x23,0xd1,0x04,0x7c,0x43,0x36,0x50,0x0f,0x50,0x03,0xe6 },
+  16, 0xcee0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xa6,0x00,0xf9,0x10,0x2e,0x62 },
+  16, 0xcef0, 0, {0x0f,0xd2,0x83,0xe4,0x00,0xbd,0x42,0x3e,0x61,0x0f,0xd0,0x03,0xf6,0xc0,0xc9,0xa2 },
+  16, 0xcf00, 0, {0x2b,0x40,0x0c,0xd0,0x03,0x34,0x00,0xf9,0x81,0x3e,0x68,0x08,0xc1,0x43,0xfa,0x00 },
+  16, 0xcf10, 0, {0xf5,0x80,0x3f,0x62,0x0c,0x14,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcf20, 0, {0x38,0x10,0xe1,0x20,0x88,0x11,0x2e,0x10,0x0b,0x80,0x02,0xe0,0x00,0xb8,0x82,0x2e },
+  16, 0xcf30, 0, {0x10,0x0b,0x80,0x00,0xe3,0xc4,0x88,0xf0,0x22,0x00,0x0b,0x80,0x0a,0x20,0x00,0xe8 },
+  16, 0xcf40, 0, {0x40,0x2f,0x14,0x08,0x88,0x02,0xe2,0x00,0xb8,0x00,0x2e,0x00,0x08,0x88,0x02,0x8e },
+  16, 0xcf50, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x04,0xc5,0x00,0xa1,0x00,0x2c,0x40 },
+  16, 0xcf60, 0, {0x0b,0x10,0x02,0xc4,0x18,0xb1,0x22,0x6c,0xd1,0x0b,0x10,0x26,0xc4,0x00,0x81,0x08 },
+  16, 0xcf70, 0, {0x2a,0x40,0x88,0x10,0x02,0x04,0x04,0xb5,0xc0,0x0f,0x40,0x0b,0x02,0x02,0x41,0xa0 },
+  16, 0xcf80, 0, {0xb1,0x40,0x2c,0x40,0x08,0x12,0x02,0x02,0x11,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcf90, 0, {0x18,0x15,0xa4,0x00,0x89,0x06,0x2e,0x40,0x0b,0x90,0x12,0xe4,0x00,0xb9,0x40,0x2e },
+  16, 0xcfa0, 0, {0x40,0x0b,0xb0,0x82,0xc4,0x02,0x89,0x44,0x22,0x40,0x0a,0x90,0x02,0x24,0x00,0xa9 },
+  16, 0xcfb0, 0, {0x00,0x27,0x48,0x09,0xb0,0x12,0xec,0x18,0xb9,0x01,0x2e,0x40,0x40,0x90,0x02,0x86 },
+  16, 0xcfc0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe7,0x84,0xe9,0x01,0x3e,0x40 },
+  16, 0xcfd0, 0, {0x0f,0x90,0x03,0xe4,0x00,0xf9,0x00,0x3e,0x72,0x0f,0x90,0x03,0xe7,0x60,0x89,0x10 },
+  16, 0xcfe0, 0, {0x3a,0x40,0x0c,0x90,0x03,0x24,0x00,0xf9,0x44,0x3c,0x40,0x2d,0x90,0x03,0xe7,0x60 },
+  16, 0xcff0, 0, {0xf9,0x71,0x3e,0x40,0x28,0x90,0x03,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd000, 0, {0x28,0x01,0xa4,0x48,0xa9,0x00,0x3e,0xc0,0x0f,0x9a,0x43,0xec,0x00,0xf9,0x20,0x7e },
+  16, 0xd010, 0, {0xc8,0x0f,0x9a,0x07,0x66,0x00,0x79,0x80,0x7e,0x40,0x0f,0x1c,0x03,0xe7,0x00,0xe9 },
+  16, 0xd020, 0, {0xa0,0x3e,0x40,0x46,0x80,0x03,0xe0,0x20,0xf9,0x00,0x3c,0x40,0x0f,0x90,0x03,0xca },
+  16, 0xd030, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0x80,0x00,0xf8,0x00,0x3a,0x00 },
+  16, 0xd040, 0, {0x0f,0x80,0x03,0xa0,0x08,0xe8,0x40,0x3a,0x10,0x0c,0x83,0x03,0xa1,0xc0,0xf0,0x40 },
+  16, 0xd050, 0, {0x3e,0x06,0x0f,0x84,0x03,0xe1,0x00,0xf8,0x00,0x3b,0x00,0x0f,0x81,0x03,0x20,0x00 },
+  16, 0xd060, 0, {0xf8,0x10,0xb2,0x00,0x4c,0x80,0x0b,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd070, 0, {0x28,0x05,0x28,0x00,0xba,0x00,0x2e,0xb0,0x0b,0xe8,0x02,0xe9,0x00,0x3e,0x90,0x02 },
+  16, 0xd080, 0, {0x81,0x08,0xe4,0x12,0x78,0x00,0xba,0x00,0x2d,0xb0,0x89,0xe8,0x22,0xf8,0x0c,0xba },
+  16, 0xd090, 0, {0x00,0x6e,0x80,0x03,0xc5,0x03,0x30,0x00,0xba,0x00,0x22,0xa8,0x08,0xa0,0x22,0x8a },
+  16, 0xd0a0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0xb3,0x00,0x28,0xe8 },
+  16, 0xd0b0, 0, {0x1b,0x31,0x12,0x8c,0xc4,0xa3,0x92,0x2c,0x40,0x88,0x34,0x06,0x8e,0x00,0x93,0x00 },
+  16, 0xd0c0, 0, {0x2c,0xf0,0x19,0x31,0xa2,0xcc,0x04,0xb3,0x00,0x28,0x80,0x01,0x38,0x02,0x4c,0x00 },
+  16, 0xd0d0, 0, {0xb3,0x80,0x20,0xe0,0x0a,0xb0,0x12,0x02,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd0e0, 0, {0xa0,0x01,0x1c,0x00,0xb7,0x14,0x2d,0x42,0x0b,0x60,0x02,0xdc,0x00,0xb7,0x81,0x27 },
+  16, 0xd0f0, 0, {0xe0,0x18,0x60,0x02,0x58,0x18,0xb7,0x22,0x2d,0x80,0x09,0x70,0x22,0xdc,0x00,0xb7 },
+  16, 0xd100, 0, {0x00,0x2d,0x80,0x0b,0x3b,0x02,0x1d,0xd0,0xbf,0x80,0x28,0xc0,0x8a,0xf2,0x02,0xa0 },
+  16, 0xd110, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1f,0x80,0xf7,0xa0,0x39,0xe2 },
+  16, 0xd120, 0, {0x0f,0x68,0x03,0x9e,0x00,0xed,0x84,0x3d,0xe2,0x44,0x78,0x03,0x9e,0x00,0xf7,0xb4 },
+  16, 0xd130, 0, {0x2d,0xe0,0x0d,0x68,0x03,0xd6,0x00,0xf6,0x80,0x39,0xe0,0x0f,0x79,0x03,0x5e,0x90 },
+  16, 0xd140, 0, {0xf7,0x81,0x31,0x60,0x2e,0x7c,0x03,0x2a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd150, 0, {0x08,0x1d,0xad,0x00,0xfb,0x42,0x3e,0xc8,0x0f,0xa0,0x03,0xed,0xa0,0xbb,0x00,0x38 },
+  16, 0xd160, 0, {0xc8,0x0f,0xb0,0x03,0x68,0x00,0xfb,0x11,0x3e,0x40,0x09,0xb0,0x41,0xec,0x00,0xfa },
+  16, 0xd170, 0, {0x02,0x3e,0xc0,0x0f,0xb2,0x0b,0xed,0x80,0x3b,0x00,0x36,0x40,0x0d,0xb0,0x23,0x42 },
+  16, 0xd180, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xff,0x00,0xcf,0xd0,0x33,0xe4 },
+  16, 0xd190, 0, {0x4f,0xf9,0x03,0xde,0x40,0xdc,0x80,0x36,0xe4,0x0c,0xb9,0x13,0xfe,0x00,0xcf,0x90 },
+  16, 0xd1a0, 0, {0x37,0xe5,0x0f,0xf8,0x43,0xfe,0x00,0xcf,0x92,0x3f,0xa4,0x0f,0x78,0x03,0x1f,0x00 },
+  16, 0xd1b0, 0, {0xc5,0x80,0x33,0x60,0x0c,0xf8,0x20,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd1c0, 0, {0xa8,0x11,0xbc,0x00,0x0f,0x10,0x21,0x81,0x0b,0x60,0x03,0x84,0x00,0x8b,0x08,0x21 },
+  16, 0xd1d0, 0, {0x60,0x0a,0x7b,0x03,0x98,0x00,0x8b,0x10,0x29,0x84,0x0e,0x64,0x22,0xdc,0x40,0xd7 },
+  16, 0xd1e0, 0, {0x02,0x2d,0x84,0x0b,0x70,0x02,0x1c,0x00,0x85,0x18,0x21,0x40,0x0a,0xf0,0x22,0xaa },
+  16, 0xd1f0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x00,0xa7,0x14,0x69,0xc0 },
+  16, 0xd200, 0, {0x1a,0x60,0x12,0xfc,0x01,0xa4,0x10,0x2d,0xc0,0x0a,0x52,0x02,0x45,0x40,0x87,0x0c },
+  16, 0xd210, 0, {0x21,0x80,0x1b,0x60,0x82,0xd4,0x00,0x86,0x03,0x25,0xe0,0x1b,0x70,0x02,0x5c,0x40 },
+  16, 0xd220, 0, {0x9d,0x00,0x29,0x40,0x08,0x70,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd230, 0, {0x20,0x14,0xcd,0x00,0xa3,0x00,0x28,0xc0,0x1b,0x20,0x22,0x8c,0x11,0xa3,0x00,0x68 },
+  16, 0xd240, 0, {0xf6,0x0a,0x3c,0x06,0x82,0x00,0x83,0x80,0x28,0x84,0x0a,0x8c,0x82,0xcc,0x44,0x92 },
+  16, 0xd250, 0, {0x00,0x2c,0xc0,0x0b,0x30,0x02,0x4e,0x00,0x91,0x00,0x28,0x40,0x0a,0x30,0x02,0x88 },
+  16, 0xd260, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xbe,0x22,0xef,0x04,0xba,0xc0 },
+  16, 0xd270, 0, {0x0f,0x14,0x93,0xec,0x02,0xf1,0xc3,0x3e,0xf0,0x0e,0x90,0x83,0x66,0x00,0xcf,0xd2 },
+  16, 0xd280, 0, {0x32,0x50,0x0f,0x9c,0x03,0xcb,0x00,0xc9,0x80,0x3e,0x28,0x0f,0xb0,0x03,0x4f,0x00 },
+  16, 0xd290, 0, {0xd1,0xc0,0xaa,0xc0,0x0c,0x71,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd2a0, 0, {0x80,0x00,0xec,0x20,0xdb,0x00,0x26,0x80,0x0f,0xa0,0x03,0xec,0x08,0x1b,0x00,0x36 },
+  16, 0xd2b0, 0, {0xc0,0x0f,0x86,0x01,0xe5,0x40,0xfb,0x02,0x3a,0x48,0x0e,0x94,0x03,0xec,0x80,0xf1 },
+  16, 0xd2c0, 0, {0x84,0x3e,0x00,0x4f,0xb0,0x03,0xad,0xc0,0xeb,0x20,0x36,0xc0,0x0f,0xb0,0x23,0xe0 },
+  16, 0xd2d0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xdc,0x00,0xcf,0x00,0x3f,0x60 },
+  16, 0xd2e0, 0, {0x0c,0xe0,0x83,0x3e,0x80,0xed,0x08,0x33,0xd0,0x8f,0x50,0x03,0x9e,0x00,0xdf,0x00 },
+  16, 0xd2f0, 0, {0x33,0x40,0x0c,0xc0,0x03,0x30,0x00,0xcc,0x10,0x33,0x68,0x0c,0xf0,0x03,0x3c,0x84 },
+  16, 0xd300, 0, {0x8d,0x90,0x30,0x40,0x0c,0xf0,0x03,0x08,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd310, 0, {0x81,0x04,0x6c,0x00,0x8b,0x02,0x2c,0xf4,0x08,0xa8,0x62,0x0c,0x80,0x8b,0x80,0x2a },
+  16, 0xd320, 0, {0x60,0x0f,0x9c,0x02,0x2e,0x00,0x8b,0x00,0x20,0x60,0x0d,0x98,0x02,0x2c,0x80,0xd8 },
+  16, 0xd330, 0, {0x00,0x14,0x40,0x08,0x34,0x12,0x2e,0x00,0x8b,0x82,0x32,0x40,0x0d,0xb0,0x03,0x60 },
+  16, 0xd340, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0x8b,0x00,0x2e,0xd0 },
+  16, 0xd350, 0, {0x08,0xb8,0x02,0x2c,0x00,0x8a,0x84,0x22,0xc0,0x0b,0x88,0x02,0xe4,0xa0,0x83,0x00 },
+  16, 0xd360, 0, {0x22,0x62,0x0a,0x98,0x02,0x28,0x00,0x89,0x00,0x22,0x00,0x0a,0xb1,0x06,0x2c,0x00 },
+  16, 0xd370, 0, {0xab,0x00,0x22,0x40,0x08,0xb0,0x02,0x60,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd380, 0, {0x08,0x04,0x0c,0x02,0xa3,0x00,0x2c,0xc1,0x08,0x20,0x02,0x0c,0x02,0x8b,0x00,0x28 },
+  16, 0xd390, 0, {0xc2,0x0a,0x00,0x02,0x44,0x10,0x83,0x10,0x22,0x40,0x0b,0x10,0x06,0x0c,0x00,0x91 },
+  16, 0xd3a0, 0, {0x04,0xaa,0x00,0x28,0x30,0x02,0x2c,0x00,0xa1,0x01,0x20,0x40,0x09,0xb0,0x02,0x42 },
+  16, 0xd3b0, 0, {0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x7c,0x00,0x8f,0x00,0x3e,0xc0 },
+  16, 0xd3c0, 0, {0x2c,0xa0,0x03,0x29,0x40,0xa8,0x40,0x32,0xcc,0x8b,0x80,0x02,0xe0,0x00,0xcf,0x40 },
+  16, 0xd3d0, 0, {0x32,0x00,0x0e,0x80,0x0a,0x20,0x00,0x88,0x00,0x22,0x40,0x0c,0xb0,0x03,0x2c,0x04 },
+  16, 0xd3e0, 0, {0xeb,0x00,0xb2,0x40,0x8c,0xb0,0x03,0x40,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd3f0, 0, {0xa0,0x1d,0xfc,0x00,0xdf,0x00,0x3f,0x40,0x0f,0xe0,0x03,0xfc,0x80,0xff,0x28,0x3d },
+  16, 0xd400, 0, {0xc0,0x0b,0xc1,0x03,0xb0,0x14,0xff,0x00,0x3f,0x00,0x0d,0xd0,0x03,0xdc,0x00,0xfc },
+  16, 0xd410, 0, {0x00,0x37,0x40,0x0f,0xf0,0x21,0xfc,0x00,0x1d,0x00,0x7b,0x40,0x8f,0xf0,0x03,0xe0 },
+  16, 0xd420, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xd2,0x00,0xdf,0x00,0x31,0xa0 },
+  16, 0xd430, 0, {0x4d,0xf0,0x43,0x32,0x00,0xce,0x14,0x1b,0x68,0x0e,0xda,0x23,0xb2,0xc0,0x2f,0x00 },
+  16, 0xd440, 0, {0x3f,0xc2,0x2c,0xe8,0x03,0x3c,0x40,0xfd,0x08,0x3b,0xc8,0x4c,0xf0,0x83,0x3c,0xa0 },
+  16, 0xd450, 0, {0xcf,0x00,0x33,0xc4,0x0c,0xf3,0x07,0xf0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd460, 0, {0x80,0x10,0xe2,0x00,0x8f,0xc0,0x22,0xa0,0x08,0xfd,0x42,0x2f,0x00,0x8b,0x70,0x22 },
+  16, 0xd470, 0, {0x1e,0x48,0x89,0x02,0x27,0xc0,0x8f,0x5a,0x2e,0x50,0x48,0x30,0x02,0xbd,0xc0,0xbd },
+  16, 0xd480, 0, {0x40,0x23,0xc5,0x48,0xf4,0x82,0x3d,0x2c,0x87,0x70,0x22,0xc0,0x08,0xf1,0x03,0xe0 },
+  16, 0xd490, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xe0,0x00,0x93,0x10,0x26,0x81 },
+  16, 0xd4a0, 0, {0x49,0x30,0x02,0x80,0x40,0x83,0x20,0x28,0x40,0x0a,0x10,0x02,0x80,0x00,0xa3,0x24 },
+  16, 0xd4b0, 0, {0x2c,0xca,0x08,0x32,0x82,0x0c,0x00,0x91,0x28,0x20,0xca,0x1b,0x32,0x02,0x0c,0x88 },
+  16, 0xd4c0, 0, {0x83,0x09,0x20,0xc8,0x09,0x32,0x02,0xe2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd4d0, 0, {0xc0,0x15,0xa3,0x14,0x8b,0x04,0x26,0x89,0x08,0xb0,0x02,0xac,0x22,0x8b,0x88,0x2a },
+  16, 0xd4e0, 0, {0x20,0x08,0x98,0x82,0xa6,0x10,0xab,0x00,0x2e,0xca,0x08,0xb0,0x82,0xac,0x00,0xb9 },
+  16, 0xd4f0, 0, {0x00,0x22,0xc0,0x29,0xb0,0x0a,0x2c,0x01,0x8b,0x00,0x22,0xc0,0x09,0xb0,0x22,0xf0 },
+  16, 0xd500, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xe3,0x00,0xdb,0x00,0x34,0xe2 },
+  16, 0xd510, 0, {0x0d,0xb0,0x03,0xa3,0x00,0xca,0x80,0xba,0x70,0x0e,0x88,0x03,0xa6,0x00,0xeb,0x00 },
+  16, 0xd520, 0, {0x3e,0x90,0x0c,0xb5,0x03,0x2c,0x00,0xfb,0x10,0xba,0xc0,0x0e,0xb0,0x03,0x2c,0x02 },
+  16, 0xd530, 0, {0xcb,0x02,0x32,0xc0,0x09,0xb0,0x02,0xd0,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd540, 0, {0xe0,0x01,0xb0,0x08,0xff,0x00,0xbb,0xe0,0x0f,0x70,0x03,0x65,0x00,0xf4,0x00,0x35 },
+  16, 0xd550, 0, {0x40,0x0f,0x40,0x03,0x54,0x00,0xdf,0x00,0x3e,0x40,0x0f,0xf8,0x03,0xec,0x00,0xf7 },
+  16, 0xd560, 0, {0x01,0x3d,0xc1,0x0e,0x30,0x03,0xec,0x00,0xff,0x00,0x3f,0xc0,0x8e,0xf0,0x03,0xb8 },
+  16, 0xd570, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xa0,0x40,0xeb,0x08,0x3e,0x80 },
+  16, 0xd580, 0, {0x0d,0xb0,0x03,0xe0,0x00,0xc8,0x00,0x3a,0x51,0x0f,0x82,0x03,0x64,0x20,0xdb,0x00 },
+  16, 0xd590, 0, {0x3d,0x82,0x0c,0xbc,0x03,0x2c,0x10,0xdb,0x00,0x72,0xc0,0x0d,0xb1,0x03,0x0c,0x20 },
+  16, 0xd5a0, 0, {0xd3,0x00,0x32,0xc0,0x0f,0xb0,0x0b,0x50,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd5b0, 0, {0xc8,0x05,0x01,0x00,0x87,0xc0,0x2e,0xa8,0x08,0xf1,0x12,0xc5,0x40,0x88,0x00,0x22 },
+  16, 0xd5c0, 0, {0x40,0x0b,0x84,0x02,0x27,0x00,0xaf,0x00,0x2e,0xc0,0x08,0xbc,0x12,0x3c,0x00,0x8b },
+  16, 0xd5d0, 0, {0x01,0x23,0xc0,0x28,0xf5,0x4a,0x3d,0x28,0xdf,0x00,0x33,0xc0,0x4b,0xf0,0x03,0x32 },
+  16, 0xd5e0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x48,0x80,0xa3,0x90,0x2c,0x00 },
+  16, 0xd5f0, 0, {0x08,0x30,0x02,0xc1,0x00,0x92,0x04,0x28,0x00,0x0b,0x14,0x12,0x43,0x00,0xb3,0x04 },
+  16, 0xd600, 0, {0x2c,0x30,0x0a,0xb0,0x0a,0x8c,0x00,0x93,0x00,0x60,0xc0,0x08,0x3c,0x06,0x0e,0x01 },
+  16, 0xd610, 0, {0xb3,0x00,0x2e,0xc0,0x8b,0x30,0x06,0x38,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd620, 0, {0x20,0x01,0x12,0x00,0x87,0x80,0x2d,0x24,0x08,0x78,0x02,0xd2,0x00,0x95,0x80,0x21 },
+  16, 0xd630, 0, {0xa0,0x0b,0x68,0x02,0x5a,0x20,0x87,0x80,0x2d,0x66,0x1a,0x7c,0x02,0x9e,0x00,0x87 },
+  16, 0xd640, 0, {0x80,0x21,0xe1,0x18,0x79,0x02,0x9e,0x40,0xb7,0x80,0xa1,0xe0,0x0b,0x78,0x02,0x48 },
+  16, 0xd650, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x00,0x00,0xe3,0xa0,0x3c,0x40 },
+  16, 0xd660, 0, {0x0c,0x30,0x03,0xc4,0x22,0xd9,0x00,0x38,0xd4,0x0f,0x30,0x83,0x68,0x40,0xf3,0x00 },
+  16, 0xd670, 0, {0x3c,0x80,0x0a,0x32,0x02,0x8c,0x00,0xdb,0x00,0xa2,0xc4,0x0c,0x30,0x03,0x0c,0x00 },
+  16, 0xd680, 0, {0xf3,0x00,0x3c,0xc0,0x0f,0xb1,0x03,0x12,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd690, 0, {0x40,0x0d,0xb0,0x00,0xff,0x10,0x3f,0x40,0x0e,0xf0,0x03,0xfc,0x00,0xed,0x00,0x3f },
+  16, 0xd6a0, 0, {0xc0,0x0f,0x30,0x13,0xbc,0x40,0x7f,0x10,0x3f,0xc1,0x2d,0xf0,0x03,0x7c,0x00,0xfb },
+  16, 0xd6b0, 0, {0x40,0x3f,0xc2,0x0e,0xf4,0x83,0x7c,0x00,0xdf,0x00,0x3f,0xc2,0x0f,0xf0,0x03,0x90 },
+  16, 0xd6c0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x00,0xdb,0xa0,0x32,0xc0 },
+  16, 0xd6d0, 0, {0x0d,0xb7,0x03,0xe0,0x00,0xca,0x04,0x3e,0x80,0x0f,0xb8,0x03,0x2c,0x10,0xfb,0x00 },
+  16, 0xd6e0, 0, {0x33,0x00,0x8d,0xb0,0x03,0x2c,0x80,0xe9,0x40,0x3e,0xd2,0x0f,0xb4,0x03,0x2d,0x80 },
+  16, 0xd6f0, 0, {0xeb,0x20,0xb2,0xc0,0x0f,0xb2,0x03,0xea,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd700, 0, {0x48,0x11,0x90,0x00,0xb7,0x10,0x11,0xc0,0x08,0x70,0x82,0xd8,0x0a,0x87,0x01,0x2d },
+  16, 0xd710, 0, {0x80,0x89,0x70,0x03,0xd8,0x08,0xb7,0x0a,0x21,0x40,0x2c,0x70,0x02,0x0d,0xc0,0x85 },
+  16, 0xd720, 0, {0x01,0x79,0xc8,0x0b,0x32,0x02,0x0d,0x20,0x8f,0x28,0x21,0xc0,0x0b,0x72,0x82,0xd2 },
+  16, 0xd730, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x40,0x96,0x10,0x97,0x90,0x23,0xe0 },
+  16, 0xd740, 0, {0x09,0x7a,0x02,0xd6,0x00,0x97,0x80,0x2d,0xf0,0x0b,0x78,0x82,0x1e,0x00,0xb3,0xb0 },
+  16, 0xd750, 0, {0x21,0xa0,0x08,0x78,0x02,0x1e,0x00,0xa5,0x80,0x2d,0xe0,0x0b,0x7a,0x02,0x1e,0x80 },
+  16, 0xd760, 0, {0xa7,0xb0,0x21,0xe8,0x0b,0x79,0x02,0xf0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd770, 0, {0x48,0x14,0xc0,0x00,0xb3,0x00,0x20,0xe2,0x08,0x30,0x02,0xc6,0x40,0x93,0x70,0x2c },
+  16, 0xd780, 0, {0xc0,0x09,0x3c,0x02,0x8e,0x00,0xb3,0x00,0x20,0xd8,0x08,0x18,0x02,0x0c,0x00,0x81 },
+  16, 0xd790, 0, {0x90,0x2e,0xc0,0x0b,0x30,0x2a,0x2c,0x10,0x83,0x00,0xa0,0xc0,0x0b,0x30,0x02,0xd2 },
+  16, 0xd7a0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x11,0xb9,0x00,0xda,0x02,0x33,0xb8 },
+  16, 0xd7b0, 0, {0x0d,0xa0,0x03,0xf8,0x00,0xde,0xc0,0x3f,0xb0,0x4f,0xec,0x06,0x38,0x40,0xfa,0x00 },
+  16, 0xd7c0, 0, {0xb3,0x90,0x0c,0x6c,0x0b,0x28,0x08,0xea,0x01,0x7e,0x80,0x0f,0xa0,0x03,0x28,0x00 },
+  16, 0xd7d0, 0, {0xea,0x00,0x32,0x80,0x0f,0xa0,0x03,0xfa,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd7e0, 0, {0x48,0x00,0xe0,0x00,0xf8,0x40,0x3a,0x00,0x0f,0x84,0x03,0xe1,0x00,0xe8,0x02,0x3e },
+  16, 0xd7f0, 0, {0x00,0x0f,0x84,0x03,0xe1,0x40,0xf8,0x00,0x3e,0x00,0x0f,0x81,0x03,0xe0,0x00,0xf8 },
+  16, 0xd800, 0, {0x00,0x3a,0x00,0x0f,0x80,0x03,0xe0,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x80,0x03,0xd2 },
+  16, 0xd810, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x20,0xf9,0xc0,0x3e,0x70 },
+  16, 0xd820, 0, {0x0e,0x90,0x02,0xe4,0x80,0xc9,0x00,0x32,0x42,0x0c,0x98,0x83,0xa4,0x84,0xf9,0x00 },
+  16, 0xd830, 0, {0xb2,0x60,0x0c,0x90,0x83,0x24,0x00,0xc9,0x00,0x3e,0x40,0x0c,0x1a,0x02,0x24,0x00 },
+  16, 0xd840, 0, {0xc1,0x00,0xb2,0x40,0x0f,0x90,0x01,0xc2,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd850, 0, {0x80,0x04,0x65,0x00,0xb9,0x81,0x2c,0x60,0x0d,0x94,0xc2,0xc7,0x08,0x89,0x00,0x22 },
+  16, 0xd860, 0, {0x40,0x08,0x95,0xc7,0xa4,0x00,0xb9,0x00,0x28,0x70,0xa8,0x94,0x0a,0x24,0x00,0x89 },
+  16, 0xd870, 0, {0x04,0x2e,0x40,0x28,0x90,0x2a,0x26,0x00,0x89,0x00,0x22,0x40,0x0b,0x90,0x02,0xe0 },
+  16, 0xd880, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0xb9,0x40,0x2e,0x40 },
+  16, 0xd890, 0, {0x0a,0x90,0x02,0xe5,0x00,0x81,0x00,0xa0,0x40,0x09,0x90,0x42,0xec,0x00,0xb1,0x00 },
+  16, 0xd8a0, 0, {0x22,0x58,0x08,0x90,0xa2,0x04,0x02,0x89,0x00,0x2e,0x40,0x08,0x90,0x02,0xa4,0xa0 },
+  16, 0xd8b0, 0, {0x89,0x00,0x22,0x40,0x0b,0x90,0x02,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd8c0, 0, {0x08,0x04,0x04,0x00,0xb1,0x20,0x2e,0xc0,0x89,0x12,0x02,0xc4,0x80,0x81,0x20,0x20 },
+  16, 0xd8d0, 0, {0x40,0x61,0x10,0x42,0xc5,0x00,0xb1,0x20,0x28,0x48,0x18,0x90,0x42,0x04,0x80,0x81 },
+  16, 0xd8e0, 0, {0x28,0x2c,0x48,0x08,0x12,0x82,0x84,0xa0,0x81,0x20,0x20,0x48,0x0b,0x12,0x82,0xc2 },
+  16, 0xd8f0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x68,0x00,0xf8,0x00,0x2e,0x00 },
+  16, 0xd900, 0, {0x0e,0x80,0x03,0xe0,0x08,0xc8,0x50,0x32,0x14,0x0d,0x80,0x17,0xe8,0x04,0xf8,0x50 },
+  16, 0xd910, 0, {0x32,0x14,0x4c,0x05,0x0b,0x21,0x40,0xc8,0x20,0x3e,0x00,0x0c,0x87,0x03,0xa1,0xc2 },
+  16, 0xd920, 0, {0xc8,0x00,0x32,0x14,0x8f,0x82,0x03,0xee,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd930, 0, {0x98,0x1d,0xf4,0x00,0xf1,0x10,0x3d,0x40,0x0f,0x91,0x02,0xd4,0x42,0xfd,0x10,0x3f },
+  16, 0xd940, 0, {0x51,0x0e,0x54,0x13,0xb5,0x00,0xf9,0x10,0x35,0x44,0x2f,0xd0,0x03,0xe4,0x50,0xfd },
+  16, 0xd950, 0, {0x28,0x3e,0x4e,0x0f,0x90,0x03,0x64,0x00,0xf9,0x38,0x3e,0x44,0x0f,0x92,0x83,0xe6 },
+  16, 0xd960, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x15,0xf4,0x00,0xfd,0x00,0x3d,0x40 },
+  16, 0xd970, 0, {0x2c,0xd0,0x03,0xb6,0x00,0xf9,0x82,0x3e,0x40,0x0c,0xd0,0x03,0xf4,0x00,0xf9,0x80 },
+  16, 0xd980, 0, {0x33,0x70,0x0c,0x50,0x03,0x34,0x00,0xc9,0xc0,0x3e,0x40,0x0c,0xda,0x03,0x16,0x80 },
+  16, 0xd990, 0, {0xc9,0x40,0x3e,0x62,0x2c,0x98,0x83,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd9a0, 0, {0x38,0x10,0xe0,0x00,0xb8,0x00,0x2e,0x00,0x08,0x80,0x02,0x28,0x00,0xb8,0x50,0x26 },
+  16, 0xd9b0, 0, {0x00,0x08,0xa0,0x02,0xe8,0x00,0xb8,0x00,0x2a,0x34,0x2a,0xaa,0x0a,0x20,0x00,0x88 },
+  16, 0xd9c0, 0, {0xc0,0x2e,0x2a,0x08,0x80,0x22,0x21,0x00,0xa8,0x80,0x2e,0x00,0x08,0x80,0x02,0x0e },
+  16, 0xd9d0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x00,0xb1,0x00,0x2e,0x40 },
+  16, 0xd9e0, 0, {0x48,0x10,0x06,0x8d,0x00,0xb1,0x00,0x2c,0x40,0x28,0x10,0x02,0xc4,0x00,0xb1,0x40 },
+  16, 0xd9f0, 0, {0x2c,0x48,0x08,0x10,0x82,0x44,0x00,0x81,0x60,0x2c,0x40,0x28,0x14,0x0a,0x04,0x40 },
+  16, 0xda00, 0, {0x81,0x20,0x2c,0x40,0x08,0x10,0x02,0x02,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xda10, 0, {0x18,0x05,0xa4,0x40,0xb9,0x00,0x2e,0x40,0x08,0xb0,0x02,0x24,0x00,0xb9,0x28,0x2e },
+  16, 0xda20, 0, {0x50,0x08,0x90,0x22,0xe4,0x00,0xb9,0x00,0x2e,0x60,0x0b,0x12,0x42,0x64,0x00,0x89 },
+  16, 0xda30, 0, {0x00,0x2c,0x40,0x09,0x90,0x02,0x24,0x00,0xa9,0x00,0x2c,0x40,0x08,0x10,0x02,0x46 },
+  16, 0xda40, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x05,0xe6,0x00,0xf9,0x00,0x3c,0x42 },
+  16, 0xda50, 0, {0x0c,0x90,0x03,0xa7,0x40,0xf9,0x40,0x3e,0x70,0x0c,0x98,0x02,0xe5,0x40,0xf9,0x00 },
+  16, 0xda60, 0, {0x3e,0x40,0x0c,0x98,0x03,0x64,0x06,0xc9,0x01,0x2e,0x40,0x0c,0x90,0x03,0x24,0x04 },
+  16, 0xda70, 0, {0xc9,0x00,0x3e,0x40,0x0c,0x90,0x0b,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xda80, 0, {0x28,0x01,0xa4,0x00,0xf9,0x00,0x3e,0x40,0x0f,0x90,0x83,0xe6,0x10,0xf9,0x00,0x36 },
+  16, 0xda90, 0, {0x68,0x0f,0x9c,0x03,0xe6,0x00,0xf9,0x00,0x3a,0x40,0x0e,0x98,0x93,0xa4,0x00,0xf9 },
+  16, 0xdaa0, 0, {0x00,0x3e,0x40,0x0e,0x90,0x83,0xc4,0x00,0xf9,0x00,0x3e,0x40,0x0f,0x90,0x03,0x8a },
+  16, 0xdab0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x00,0xa0,0x00,0xf8,0x00,0x3e,0x04 },
+  16, 0xdac0, 0, {0x0c,0x80,0x03,0x21,0x02,0xc8,0x40,0x32,0x00,0x0f,0x80,0x03,0xe1,0x00,0xf0,0x00 },
+  16, 0xdad0, 0, {0x3e,0x02,0x0c,0x80,0x03,0x20,0x00,0xf8,0x00,0x3e,0x00,0x0c,0x00,0x03,0x20,0x00 },
+  16, 0xdae0, 0, {0xc8,0x00,0x32,0x00,0x0f,0x80,0x03,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdaf0, 0, {0x28,0x15,0x3a,0x00,0xbe,0x02,0x2f,0xb0,0x08,0x68,0x12,0x38,0x00,0x8a,0x04,0x2a },
+  16, 0xdb00, 0, {0x80,0x0b,0xe0,0x42,0xfb,0x20,0xba,0x00,0x2f,0x91,0x08,0xe0,0x02,0x28,0x00,0xba },
+  16, 0xdb10, 0, {0x00,0x26,0x80,0x08,0xee,0x0a,0x38,0x00,0x8a,0x00,0x22,0x80,0x0b,0xa0,0x02,0x8a },
+  16, 0xdb20, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x42,0x00,0xb3,0x00,0x2c,0xc2 },
+  16, 0xdb30, 0, {0x28,0x38,0x0a,0x48,0x00,0x83,0x04,0x22,0xc0,0x0b,0x10,0x02,0xcd,0x80,0xb3,0x00 },
+  16, 0xdb40, 0, {0x2e,0xc0,0x08,0x1c,0x02,0x24,0x00,0xb3,0x00,0x2c,0xc0,0x08,0x34,0x12,0x0e,0x40 },
+  16, 0xdb50, 0, {0x83,0x00,0x20,0xc0,0x0b,0x30,0x12,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdb60, 0, {0xa0,0x01,0x11,0x00,0xb7,0x00,0x2f,0xc0,0x08,0x70,0xa2,0x4e,0x00,0x8f,0xb0,0x21 },
+  16, 0xdb70, 0, {0xcc,0x0b,0x60,0x12,0xdc,0x10,0xb7,0x30,0x2d,0xc0,0x08,0xd0,0x82,0x14,0x80,0xb7 },
+  16, 0xdb80, 0, {0x12,0x25,0xc8,0x28,0x60,0x02,0x14,0x00,0x87,0xb2,0x21,0xcc,0x0b,0x31,0x02,0xa8 },
+  16, 0xdb90, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x12,0x00,0xf7,0x80,0x3d,0xe0 },
+  16, 0xdba0, 0, {0x0c,0x38,0x03,0x56,0x00,0xc7,0x90,0xb1,0xe4,0x0f,0x78,0x03,0xde,0x00,0xf7,0x90 },
+  16, 0xdbb0, 0, {0x1f,0x60,0x2c,0x48,0x0b,0x16,0xa0,0xf7,0x80,0x3c,0xf4,0x0c,0x38,0x03,0x1e,0x00 },
+  16, 0xdbc0, 0, {0xcf,0xa0,0xb1,0xe8,0x0f,0x7b,0x03,0x2a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdbd0, 0, {0x08,0x0d,0xa0,0x00,0xf8,0x00,0x3e,0xc0,0x0b,0xb0,0x03,0xac,0x00,0xf3,0x21,0x3e },
+  16, 0xdbe0, 0, {0xc8,0x07,0xb0,0x02,0xe4,0x00,0xfb,0x20,0x3f,0x40,0x0f,0x80,0x03,0xe4,0x80,0xfb },
+  16, 0xdbf0, 0, {0x00,0x36,0xd0,0x0f,0xa0,0x03,0xe0,0x08,0xfb,0x42,0x3e,0xd8,0x0f,0xb0,0x03,0xc2 },
+  16, 0xdc00, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xf0,0x80,0xcf,0x80,0x31,0xe1 },
+  16, 0xdc10, 0, {0x0c,0xf8,0x03,0xda,0x10,0xef,0x80,0x3f,0xe4,0x0f,0xd8,0x03,0xfe,0x10,0xff,0x82 },
+  16, 0xdc20, 0, {0x3f,0xe0,0x4c,0xd8,0x1b,0x16,0x20,0xcf,0x80,0x3f,0xe0,0x4c,0xd8,0x30,0xee,0x40 },
+  16, 0xdc30, 0, {0xff,0xc0,0xb3,0xf4,0x0f,0xf8,0x03,0xc0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdc40, 0, {0xa8,0x01,0x98,0x20,0x83,0x40,0x21,0xc0,0x08,0x71,0x02,0xdc,0x84,0x87,0x20,0x2d },
+  16, 0xdc50, 0, {0xc0,0x0b,0x60,0x02,0xd9,0x60,0xf7,0x00,0x2d,0xc0,0x08,0xf0,0x82,0x14,0x04,0x87 },
+  16, 0xdc60, 0, {0x00,0x2d,0xc0,0x08,0xf0,0x03,0x1e,0x00,0xb7,0x20,0x21,0xc0,0x8b,0x70,0x02,0xea },
+  16, 0xdc70, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x00,0x87,0x00,0x21,0x80 },
+  16, 0xdc80, 0, {0x08,0x70,0x02,0xf5,0x04,0x27,0x00,0x2d,0xc0,0x8b,0x70,0x02,0xdc,0x00,0xb7,0x00 },
+  16, 0xdc90, 0, {0x2c,0x50,0x08,0x40,0x02,0x14,0x00,0x87,0x00,0x2d,0xc0,0x08,0x50,0x02,0x5c,0x04 },
+  16, 0xdca0, 0, {0xb7,0x00,0xa1,0xc0,0x8b,0x70,0x02,0xc0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdcb0, 0, {0x20,0x14,0xc8,0x00,0x80,0x00,0x00,0x80,0x08,0x30,0x02,0xce,0x00,0x83,0xc0,0x2c },
+  16, 0xdcc0, 0, {0xd0,0x4b,0x30,0x02,0xce,0x00,0xab,0x02,0x2c,0x40,0x48,0xbc,0x02,0x04,0x00,0x83 },
+  16, 0xdcd0, 0, {0x00,0x2c,0xc0,0x08,0x10,0x02,0x00,0x08,0xb3,0x00,0x20,0xc0,0x09,0x30,0x02,0xc8 },
+  16, 0xdce0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0x83,0x40,0xc8,0x00,0x30,0xc0 },
+  16, 0xdcf0, 0, {0x2c,0xb0,0x03,0xec,0x00,0xef,0x88,0x3f,0xe6,0x07,0xb1,0x83,0xe1,0x00,0xbf,0x00 },
+  16, 0xdd00, 0, {0x3e,0xe0,0x0c,0xb8,0x03,0x34,0x00,0xcf,0x00,0x3f,0xc0,0x2c,0xb0,0x03,0x68,0x10 },
+  16, 0xdd10, 0, {0xff,0x00,0x33,0xc0,0x0f,0xf0,0x03,0xea,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdd20, 0, {0x80,0x00,0xe4,0x00,0xf1,0x40,0x3e,0xc0,0x0f,0xb4,0x03,0xed,0x40,0xfb,0x08,0x3e },
+  16, 0xdd30, 0, {0xc0,0x0f,0xa0,0x03,0xe5,0x20,0xfb,0x00,0x3e,0xe0,0x0d,0xb0,0x83,0xe4,0x00,0xf3 },
+  16, 0xdd40, 0, {0x00,0x3e,0xc0,0x0f,0x80,0x03,0xc4,0x00,0xfb,0x00,0x3e,0xc0,0x0f,0x30,0x03,0xe0 },
+  16, 0xdd50, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xf0,0x00,0xca,0x00,0x33,0xe0 },
+  16, 0xdd60, 0, {0x4e,0xf0,0x03,0x34,0x00,0xff,0x00,0x3f,0xc0,0x8f,0xe8,0x03,0xf0,0x00,0xff,0x00 },
+  16, 0xdd70, 0, {0xb1,0x40,0x0c,0xe0,0x03,0x34,0x00,0xef,0x00,0xb3,0xc0,0x0c,0xf0,0x03,0x38,0x00 },
+  16, 0xdd80, 0, {0xcf,0x00,0x3d,0xc0,0x0a,0xf0,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdd90, 0, {0x81,0x04,0x62,0x22,0x88,0x90,0x22,0xe0,0x08,0x3c,0x02,0x2e,0x08,0xbb,0x01,0x2e },
+  16, 0xdda0, 0, {0xc0,0x0b,0xa0,0x02,0x66,0x00,0xbb,0x00,0x22,0xa0,0x08,0xa9,0x02,0x24,0x00,0xbb },
+  16, 0xddb0, 0, {0x00,0x22,0xc0,0x28,0x2c,0x02,0xa2,0x00,0xdb,0x00,0x2e,0xc0,0x0a,0xb0,0x02,0xa0 },
+  16, 0xddc0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x22,0x00,0x98,0x00,0x22,0xc8 },
+  16, 0xddd0, 0, {0x0a,0x98,0x02,0x27,0x04,0xbb,0x00,0x2e,0xc0,0x0b,0xb1,0x02,0xe2,0x00,0xbb,0x00 },
+  16, 0xdde0, 0, {0x22,0xe2,0x08,0xb0,0x02,0xa4,0x00,0xab,0x00,0x20,0xc0,0x0a,0x88,0x82,0x23,0x00 },
+  16, 0xddf0, 0, {0x8b,0x00,0x2e,0xc0,0x08,0xb0,0x02,0xa0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xde00, 0, {0x08,0x14,0x04,0x00,0x91,0x40,0x22,0xc0,0x08,0x10,0x02,0x0c,0x00,0xb3,0x00,0x2c },
+  16, 0xde10, 0, {0xc0,0x4b,0x28,0x22,0x40,0x04,0xb3,0x00,0x20,0xc0,0x28,0x30,0x0a,0x04,0x04,0xb3 },
+  16, 0xde20, 0, {0x00,0x60,0xc0,0x08,0x00,0x02,0x84,0x20,0x93,0x00,0x2c,0xc0,0x0a,0x30,0x02,0x82 },
+  16, 0xde30, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x60,0x00,0xda,0x40,0xb2,0x80 },
+  16, 0xde40, 0, {0x0e,0x90,0x03,0x24,0x00,0xff,0x00,0x3f,0xc0,0x8f,0xa0,0x03,0xe0,0x09,0xff,0x00 },
+  16, 0xde50, 0, {0x32,0x40,0x08,0xa0,0x0b,0x34,0x00,0xeb,0x00,0x31,0xc0,0x0c,0x80,0x03,0x28,0x80 },
+  16, 0xde60, 0, {0xc7,0x00,0x3f,0xc0,0x0c,0xf0,0x03,0x00,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xde70, 0, {0xa0,0x15,0xd0,0x00,0xec,0x20,0x3f,0x00,0x0f,0xc0,0x0b,0xfc,0x10,0xff,0x01,0x3f },
+  16, 0xde80, 0, {0xc0,0x0f,0xe0,0x03,0xf4,0x00,0xff,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0xf4,0x00,0xff },
+  16, 0xde90, 0, {0x00,0x3f,0xc0,0x4f,0xc0,0x01,0xf0,0x08,0xff,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0xe8 },
+  16, 0xdea0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfc,0x00,0xcc,0x90,0x37,0x20 },
+  16, 0xdeb0, 0, {0x0e,0xf0,0x13,0xbd,0x04,0xd4,0xc1,0x33,0x2c,0x4c,0xd9,0x23,0x32,0x60,0xff,0x20 },
+  16, 0xdec0, 0, {0x3d,0xe0,0x4f,0xc1,0x03,0xb6,0x40,0xcd,0x00,0x37,0xe0,0x0c,0xe2,0x8b,0x10,0xc0 },
+  16, 0xded0, 0, {0xcd,0x00,0x33,0xc6,0x0f,0xd8,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdee0, 0, {0x80,0x10,0xee,0x08,0x8a,0x20,0x22,0x00,0x08,0xb7,0x02,0x2d,0x00,0x8a,0x00,0xb6 },
+  16, 0xdef0, 0, {0x3c,0x08,0x99,0x02,0x27,0x84,0xbf,0x68,0x2e,0x82,0x0b,0x01,0x02,0x24,0x40,0xd9 },
+  16, 0xdf00, 0, {0x42,0x20,0xc0,0x8a,0xac,0x02,0x2d,0xc2,0x82,0x48,0xa2,0xd0,0x0b,0x82,0x02,0x20 },
+  16, 0xdf10, 0, {0x06,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x00,0x88,0x04,0x26,0x80 },
+  16, 0xdf20, 0, {0x2a,0x30,0xc2,0xa5,0x80,0xa9,0x21,0x28,0x00,0x8a,0x00,0x02,0x00,0x00,0xa3,0x10 },
+  16, 0xdf30, 0, {0x2c,0xc8,0x0b,0x00,0x02,0xc4,0x90,0x83,0x42,0x24,0xc1,0x08,0x00,0x02,0x40,0x88 },
+  16, 0xdf40, 0, {0xa3,0x60,0xa8,0xc0,0x0b,0x00,0xc2,0x22,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdf50, 0, {0xc0,0x15,0xac,0x06,0x8a,0x00,0x22,0xe0,0x48,0xb0,0x02,0x2e,0x02,0xab,0x80,0x2e },
+  16, 0xdf60, 0, {0x20,0x4a,0x8c,0x02,0x26,0x20,0xbb,0x00,0x6e,0x80,0x0b,0x30,0xc2,0x46,0x04,0x9b },
+  16, 0xdf70, 0, {0x0a,0xa2,0xc0,0x0a,0x80,0x12,0x6c,0x40,0xa8,0x00,0x2a,0xc0,0x0b,0x8c,0x02,0x30 },
+  16, 0xdf80, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xec,0x00,0xc1,0x09,0x36,0x61 },
+  16, 0xdf90, 0, {0x0e,0x32,0x03,0xab,0x20,0xf8,0x84,0x3a,0x78,0x2e,0x98,0x03,0x26,0x00,0xeb,0x00 },
+  16, 0xdfa0, 0, {0x3e,0x40,0x4f,0x90,0x03,0xe2,0x00,0xc9,0x40,0x36,0xe0,0x0c,0xb4,0x03,0x6e,0x00 },
+  16, 0xdfb0, 0, {0xeb,0x00,0x3a,0xc0,0x0f,0x88,0x03,0x10,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdfc0, 0, {0xe0,0x01,0xbc,0x00,0xfd,0x00,0x3f,0x40,0x0f,0xfa,0x13,0xf8,0x10,0xdc,0x04,0x27 },
+  16, 0xdfd0, 0, {0x40,0x0d,0x50,0x43,0xf4,0x00,0xff,0x00,0x3f,0x40,0x0f,0xd9,0x03,0xb0,0x00,0xf9 },
+  16, 0xdfe0, 0, {0x01,0x3f,0xf0,0x0f,0xf0,0x23,0xb2,0x00,0xd4,0xa0,0x37,0xc0,0x0f,0xc0,0x0b,0xf8 },
+  16, 0xdff0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x20,0xeb,0x10,0xf2,0x00 },
+  16, 0xe000, 0, {0x0e,0xb4,0x03,0x21,0x80,0xc9,0x40,0x3a,0x48,0x0f,0x90,0x13,0xe1,0x20,0xfb,0x00 },
+  16, 0xe010, 0, {0x3e,0xc0,0x0c,0x84,0x03,0x24,0x00,0xfb,0x01,0x36,0xe0,0x0c,0x74,0x0b,0x9c,0x00 },
+  16, 0xe020, 0, {0xcf,0x00,0x32,0xe0,0x0f,0x84,0x03,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe030, 0, {0xc8,0x05,0x1e,0x00,0x8b,0x80,0x20,0x40,0x08,0xb8,0x02,0x83,0x80,0x81,0xa0,0x22 },
+  16, 0xe040, 0, {0x78,0x0b,0x91,0x83,0xe3,0x00,0xbf,0x00,0x0e,0xc1,0x0a,0xb4,0x03,0x64,0x04,0xb9 },
+  16, 0xe050, 0, {0x50,0x32,0xc0,0x0a,0xb2,0x02,0x20,0x00,0x88,0x00,0x23,0xd4,0x0b,0x88,0x02,0xf2 },
+  16, 0xe060, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x42,0xa0,0x80,0x20,0x00 },
+  16, 0xe070, 0, {0x48,0x00,0x02,0x0d,0x06,0x80,0x80,0x2a,0xd0,0x03,0x00,0x02,0xc8,0x00,0xb3,0x00 },
+  16, 0xe080, 0, {0x2c,0xc0,0x08,0x36,0x02,0x40,0x00,0xb9,0x02,0x22,0xc2,0x8b,0x26,0x02,0x0c,0x10 },
+  16, 0xe090, 0, {0x01,0x02,0x24,0xc0,0x4b,0xa1,0x02,0xf8,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe0a0, 0, {0x20,0x01,0x1e,0x08,0x8e,0x80,0x21,0x21,0x08,0x28,0xc2,0x9e,0x00,0x8e,0x80,0x21 },
+  16, 0xe0b0, 0, {0x60,0x0b,0x78,0x02,0x9e,0x20,0xb7,0x82,0x2f,0xa1,0x0a,0x78,0x02,0x5e,0x00,0xb5 },
+  16, 0xe0c0, 0, {0x91,0xa1,0xe0,0x0b,0x29,0x02,0x32,0x44,0x86,0x80,0xa5,0xe0,0x0b,0x4c,0x02,0xc8 },
+  16, 0xe0d0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0xe1,0x00,0x22,0x80 },
+  16, 0xe0e0, 0, {0x0e,0x00,0x0b,0x24,0x00,0xc0,0x44,0x28,0xad,0x0f,0x20,0x02,0xc8,0x00,0xf3,0x00 },
+  16, 0xe0f0, 0, {0x1c,0xc0,0x0c,0x01,0x03,0x48,0x4c,0xf2,0x04,0x30,0xc0,0x0f,0x15,0x03,0x80,0x40 },
+  16, 0xe100, 0, {0xc1,0x00,0x14,0xc8,0x0f,0x00,0x03,0xda,0x02,0x10,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe110, 0, {0x40,0x1d,0x9c,0x40,0xf7,0x00,0x3f,0xc0,0x8f,0xc0,0x03,0xe4,0x00,0xfa,0x01,0x3f },
+  16, 0xe120, 0, {0xc0,0x0f,0xf0,0x23,0xfc,0x08,0xfb,0x00,0x3f,0x80,0x0f,0xf0,0x01,0xfc,0x10,0xff },
+  16, 0xe130, 0, {0x00,0x3f,0xc0,0x0e,0xd1,0x03,0xfc,0x42,0xfe,0x80,0x3b,0xc0,0x0f,0xc0,0x03,0xd0 },
+  16, 0xe140, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x40,0xc8,0x00,0x3e,0xc0 },
+  16, 0xe150, 0, {0x0f,0x90,0x03,0xee,0x08,0xcb,0x00,0x32,0xc0,0x0f,0xa0,0x23,0xe6,0x03,0xcb,0x4c },
+  16, 0xe160, 0, {0x32,0x40,0x0f,0xb0,0x07,0xe8,0x00,0xf9,0x00,0x16,0x40,0x0c,0xa0,0x0b,0x6c,0x00 },
+  16, 0xe170, 0, {0xcf,0x02,0x32,0xc5,0x0c,0x80,0x03,0x02,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe180, 0, {0x48,0x11,0x9c,0x80,0x84,0x04,0x2d,0xc1,0x0b,0x40,0x40,0xdc,0x00,0x87,0x04,0x21 },
+  16, 0xe190, 0, {0xc0,0x4b,0x70,0x12,0xfc,0x01,0x8f,0x60,0x29,0x40,0x0b,0x70,0x13,0x9c,0x00,0xb5 },
+  16, 0xe1a0, 0, {0x00,0xa3,0x40,0x0a,0x60,0x02,0x00,0x00,0x84,0x00,0x21,0xc0,0x08,0x40,0x02,0x12 },
+  16, 0xe1b0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x8e,0x00,0x87,0x80,0x2d,0xa2 },
+  16, 0xe1c0, 0, {0x0b,0x4c,0x16,0xd6,0x08,0x97,0x88,0x21,0xa0,0x4b,0x68,0x02,0xde,0x04,0xa7,0x80 },
+  16, 0xe1d0, 0, {0x21,0xe0,0x0b,0x48,0x02,0xda,0x04,0xb6,0x82,0x25,0x60,0x0a,0xe8,0x62,0x1e,0x00 },
+  16, 0xe1e0, 0, {0x87,0x80,0x20,0xe8,0x08,0x48,0x02,0x08,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe1f0, 0, {0x48,0x14,0xcc,0x00,0x8b,0x80,0x6c,0xf0,0x0b,0x3c,0x02,0xce,0x46,0x9b,0xc0,0x20 },
+  16, 0xe200, 0, {0xe4,0x0b,0x3c,0x02,0xcc,0x20,0xa3,0x00,0x28,0xe0,0x0b,0x30,0x02,0x8d,0x80,0xb1 },
+  16, 0xe210, 0, {0x80,0x22,0x44,0x0a,0x21,0x0a,0x03,0x82,0x80,0x80,0xa0,0xc0,0x08,0x06,0x0a,0x12 },
+  16, 0xe220, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x02,0xce,0x80,0x3f,0xa0 },
+  16, 0xe230, 0, {0x0f,0xe0,0x03,0xfa,0x40,0xde,0xc0,0xb3,0x90,0x0f,0xea,0x13,0xf9,0x08,0xea,0x04 },
+  16, 0xe240, 0, {0x33,0x82,0x8f,0xe4,0x03,0xfb,0x08,0xfe,0xa0,0x36,0xa0,0x0c,0xac,0x0b,0x6b,0x82 },
+  16, 0xe250, 0, {0xc6,0xa0,0x32,0x80,0x2c,0xe4,0x03,0x3a,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe260, 0, {0x48,0x00,0xe0,0x00,0xf8,0x90,0x3e,0x02,0x0f,0x80,0x83,0xe1,0x00,0xe8,0x20,0x3e },
+  16, 0xe270, 0, {0x03,0x0f,0x82,0x03,0xe1,0x40,0xd8,0x00,0x3e,0x20,0x0f,0x00,0x93,0xa0,0x40,0xf8 },
+  16, 0xe280, 0, {0x00,0x3e,0x10,0x8f,0x08,0x0b,0xf0,0x00,0xfc,0x00,0x3e,0x00,0x0f,0x80,0x03,0xd2 },
+  16, 0xe290, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xe9,0x00,0x36,0x40 },
+  16, 0xe2a0, 0, {0x0f,0x94,0x07,0xe6,0x00,0xf9,0x80,0xb0,0x40,0x0c,0x94,0x03,0xe4,0x40,0xf9,0x00 },
+  16, 0xe2b0, 0, {0x32,0x40,0x0f,0x94,0x0b,0xa4,0x00,0x71,0xc0,0x32,0x40,0x2c,0x94,0x23,0x24,0x02 },
+  16, 0xe2c0, 0, {0xc9,0x00,0x32,0x40,0x0c,0x90,0x03,0x02,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe2d0, 0, {0x80,0x04,0x44,0x00,0x89,0x00,0x22,0x40,0x0b,0x98,0x02,0xe6,0x60,0xb9,0x00,0x22 },
+  16, 0xe2e0, 0, {0x60,0x0a,0x9c,0x02,0xe6,0x24,0xb9,0x04,0x36,0x40,0x0b,0x98,0x00,0x24,0x00,0xb9 },
+  16, 0xe2f0, 0, {0x80,0xa2,0x52,0x08,0x90,0x02,0x24,0x00,0x89,0x40,0x22,0x40,0x68,0x94,0x02,0x20 },
+  16, 0xe300, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0xa9,0x00,0x26,0x40 },
+  16, 0xe310, 0, {0x03,0x94,0x02,0xe4,0x01,0xb9,0x10,0x22,0x55,0x08,0x90,0x22,0xe4,0x00,0xb1,0x00 },
+  16, 0xe320, 0, {0x26,0x40,0x0b,0x90,0x00,0x2c,0x09,0xb9,0x00,0x22,0x60,0x08,0x90,0x0a,0x1c,0x04 },
+  16, 0xe330, 0, {0x8d,0x08,0xa0,0x40,0x08,0x10,0x82,0x0e,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe340, 0, {0x08,0x04,0x06,0x00,0x81,0x00,0x20,0x50,0x0b,0x12,0x42,0xc4,0x80,0xb1,0x04,0x20 },
+  16, 0xe350, 0, {0x50,0x0a,0x14,0x02,0xc5,0x00,0xb1,0x22,0x24,0x40,0x0b,0x12,0x22,0x04,0x01,0xb1 },
+  16, 0xe360, 0, {0x40,0x20,0x50,0x08,0x10,0x0a,0x15,0x00,0x85,0x40,0x28,0x50,0x08,0x14,0x0a,0x0a },
+  16, 0xe370, 0, {0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xe8,0x50,0x36,0x00 },
+  16, 0xe380, 0, {0x0f,0x85,0x02,0xe1,0x40,0xf8,0x50,0x32,0x00,0x0c,0xa0,0x23,0xe0,0x10,0xf8,0x50 },
+  16, 0xe390, 0, {0xb2,0x14,0x0f,0xa5,0x03,0xa1,0x48,0xfa,0x00,0xb2,0x00,0x0c,0x80,0x03,0x20,0x04 },
+  16, 0xe3a0, 0, {0xc4,0x02,0x32,0x00,0x0c,0x00,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe3b0, 0, {0x98,0x1d,0xe5,0x00,0xfd,0x00,0x3f,0x40,0x0f,0xd1,0x03,0xd4,0x44,0xf5,0x00,0x3f },
+  16, 0xe3c0, 0, {0x51,0x0f,0xd4,0x03,0xf5,0x00,0xf9,0x10,0x3b,0x40,0x0f,0xd1,0x00,0xf5,0x10,0xf5 },
+  16, 0xe3d0, 0, {0x40,0x7f,0x40,0x0f,0x54,0x2b,0xe5,0x00,0xf9,0x40,0x36,0x50,0x0f,0xd0,0x03,0xe6 },
+  16, 0xe3e0, 0, {0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xf6,0x10,0xbd,0x40,0x33,0x40 },
+  16, 0xe3f0, 0, {0x0f,0xda,0x03,0x37,0x80,0xcd,0x00,0x3f,0x40,0x0f,0xd0,0x03,0xf4,0x00,0xe9,0xa0 },
+  16, 0xe400, 0, {0x3e,0x40,0x0c,0xde,0x17,0xa4,0x08,0xfd,0xc0,0x33,0x41,0x8d,0xda,0x13,0x26,0xa0 },
+  16, 0xe410, 0, {0xf9,0xa8,0x32,0x78,0x0c,0xb4,0x0b,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe420, 0, {0x38,0x10,0xe1,0x00,0xb8,0xa0,0x36,0x20,0x0b,0x8a,0x82,0xa2,0x80,0x2a,0xa8,0x2e },
+  16, 0xe430, 0, {0x00,0x0b,0x80,0x12,0xe0,0x04,0xb8,0xa1,0x2e,0x28,0x4a,0x8e,0x02,0x2a,0xa0,0xba },
+  16, 0xe440, 0, {0xc0,0x22,0x28,0x08,0x85,0x02,0x21,0x08,0xb8,0xe8,0xa2,0x3c,0x08,0xc8,0x02,0x0e },
+  16, 0xe450, 0, {0x06,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc5,0x00,0xb9,0x00,0x20,0x4a },
+  16, 0xe460, 0, {0x0b,0x14,0x02,0x05,0x80,0x01,0x00,0x2c,0x41,0x0b,0x10,0x02,0xc4,0x04,0xa1,0x4a },
+  16, 0xe470, 0, {0x2e,0x42,0x08,0x14,0x02,0x84,0x10,0xb1,0x60,0xa0,0x4a,0x09,0x10,0x02,0x44,0x00 },
+  16, 0xe480, 0, {0xb5,0x01,0x29,0x40,0x18,0xd2,0x02,0x12,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe490, 0, {0x18,0x15,0xa4,0x00,0xb9,0x21,0x26,0x40,0x0b,0x96,0x02,0xa4,0x10,0xa9,0x00,0x2e },
+  16, 0xe4a0, 0, {0x40,0x0b,0x96,0x12,0xe4,0x20,0xb9,0x00,0x2e,0x41,0x0a,0x90,0x42,0x24,0x00,0xb9 },
+  16, 0xe4b0, 0, {0x00,0x22,0x41,0x08,0x98,0x22,0x64,0x00,0xb9,0x20,0x2b,0x41,0x28,0xd4,0x02,0x06 },
+  16, 0xe4c0, 0, {0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x11,0xe4,0x00,0xf9,0xe0,0x32,0x58 },
+  16, 0xe4d0, 0, {0x0f,0x98,0x03,0x26,0x40,0xc9,0x40,0x3e,0x58,0x0f,0x9c,0x03,0xe4,0x00,0xe9,0x00 },
+  16, 0xe4e0, 0, {0x6e,0x40,0x0c,0x9a,0x02,0xa6,0x00,0xf9,0x44,0x32,0x40,0x0d,0x9a,0x0b,0x64,0x84 },
+  16, 0xe4f0, 0, {0xf9,0x00,0xba,0x40,0x0c,0x18,0x03,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe500, 0, {0x28,0x01,0xa4,0x00,0xf9,0x00,0x3e,0x50,0x0f,0x90,0x03,0xe6,0x00,0xf9,0x04,0x3e },
+  16, 0xe510, 0, {0x48,0x0f,0x90,0x03,0xe4,0x40,0xf9,0x00,0x3e,0x65,0x0f,0x99,0x81,0xe4,0x50,0xf9 },
+  16, 0xe520, 0, {0x20,0x3e,0x40,0x8f,0x90,0x03,0xa4,0x80,0xf9,0x00,0x34,0x40,0x0f,0x92,0x03,0xd2 },
+  16, 0xe530, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xf8,0x40,0x3e,0x10 },
+  16, 0xe540, 0, {0x0e,0x84,0x03,0x60,0x08,0xc8,0x00,0x3e,0x08,0x0f,0x80,0x83,0xe0,0x28,0xe8,0x04 },
+  16, 0xe550, 0, {0x3e,0x00,0x0c,0x84,0x03,0x21,0x1c,0xf0,0x48,0x32,0x00,0x0b,0x00,0x03,0xe0,0x02 },
+  16, 0xe560, 0, {0xc0,0x00,0x32,0x00,0x0c,0xc0,0x0b,0x02,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe570, 0, {0x28,0x05,0x38,0x00,0xb2,0x88,0x2e,0x80,0x08,0xe0,0x03,0x7a,0x80,0x8e,0x00,0x2f },
+  16, 0xe580, 0, {0xa0,0x0b,0xe8,0x02,0xf9,0x10,0xba,0x00,0x2c,0x80,0x28,0xe4,0x02,0x28,0x00,0xbe },
+  16, 0xe590, 0, {0x40,0x23,0xb8,0x08,0xe8,0x02,0xe8,0x04,0xca,0x20,0xa2,0x80,0x08,0xe8,0x02,0x0a },
+  16, 0xe5a0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x01,0xb3,0x00,0x2c,0x40 },
+  16, 0xe5b0, 0, {0x08,0xb8,0x42,0x6c,0x02,0x83,0x00,0x2c,0xe0,0x0b,0x38,0x00,0xcf,0x40,0xb3,0x00 },
+  16, 0xe5c0, 0, {0x2c,0xc0,0x08,0xb4,0x0a,0x0c,0x00,0xb3,0x40,0xa2,0x82,0x0a,0x39,0x02,0xcc,0x00 },
+  16, 0xe5d0, 0, {0x93,0x80,0xa0,0xc0,0x29,0x20,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe5e0, 0, {0xa0,0x01,0x1d,0x00,0xb7,0x00,0x2d,0x64,0x28,0x74,0x02,0x40,0x00,0x87,0x05,0x2d },
+  16, 0xe5f0, 0, {0x90,0x0b,0x74,0x02,0xdc,0x10,0xb7,0x30,0x2d,0xc8,0x08,0x34,0x06,0x1c,0x80,0xb7 },
+  16, 0xe600, 0, {0x00,0xa1,0xc0,0x0a,0x70,0x02,0xde,0x80,0x83,0x00,0x01,0x00,0x09,0x60,0x82,0x20 },
+  16, 0xe610, 0, {0x04,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1a,0x00,0xf7,0x80,0x3d,0x60 },
+  16, 0xe620, 0, {0x0e,0xd8,0x0b,0x5e,0x00,0xc7,0x80,0x3d,0xe0,0x0f,0x68,0x03,0xde,0x10,0xf7,0xa9 },
+  16, 0xe630, 0, {0x7f,0xe8,0x48,0x78,0x03,0x1f,0x30,0xff,0x94,0x33,0xa0,0x0e,0x78,0x03,0xcf,0x24 },
+  16, 0xe640, 0, {0xd6,0x80,0xb1,0xe0,0x0d,0xf8,0x43,0x22,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe650, 0, {0x08,0x1d,0xac,0x00,0xbb,0x00,0x0c,0x40,0x0f,0xb0,0x03,0xec,0x08,0xf9,0x00,0x3e },
+  16, 0xe660, 0, {0x00,0x0f,0x90,0x41,0xec,0x00,0xfb,0x61,0x7e,0xd0,0x0f,0xb0,0x03,0xec,0x80,0xfb },
+  16, 0xe670, 0, {0x40,0x3f,0x9b,0x0c,0xb0,0x03,0xed,0x90,0xfa,0x00,0x3c,0x00,0x0e,0xb0,0x03,0xc2 },
+  16, 0xe680, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xde,0x00,0xef,0x80,0x33,0x60 },
+  16, 0xe690, 0, {0x0d,0xd8,0x03,0x36,0x40,0xef,0x90,0x3e,0xe0,0x0f,0xf9,0x03,0xfe,0x00,0xff,0x80 },
+  16, 0xe6a0, 0, {0x33,0xfe,0x0c,0xfa,0x03,0xfe,0x00,0xcf,0x80,0xb3,0xe0,0x0f,0xf8,0x03,0xfe,0x00 },
+  16, 0xe6b0, 0, {0xcd,0x80,0x33,0xe0,0x0f,0xc8,0x43,0xc0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe6c0, 0, {0xa8,0x11,0x9c,0x00,0x85,0x08,0x35,0x40,0x08,0x70,0x03,0x52,0x20,0x87,0x11,0x2c },
+  16, 0xe6d0, 0, {0xec,0x0b,0x71,0x02,0xd0,0x00,0xe7,0x00,0x35,0xc4,0x08,0x74,0x02,0xdc,0x40,0x87 },
+  16, 0xe6e0, 0, {0x10,0x21,0xc0,0x0b,0x70,0x02,0xfc,0x80,0x85,0x08,0x21,0x00,0x0b,0x41,0x82,0xea },
+  16, 0xe6f0, 0, {0x06,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x00,0xaf,0x00,0x23,0x50 },
+  16, 0xe700, 0, {0x09,0x50,0x02,0x1c,0x80,0xa7,0x01,0x29,0xc0,0x1b,0x60,0x06,0xdc,0x40,0xb7,0x10 },
+  16, 0xe710, 0, {0x21,0xc8,0x4a,0x52,0x02,0xdc,0x00,0x83,0x00,0x21,0xc0,0x0b,0x70,0x02,0xdc,0x13 },
+  16, 0xe720, 0, {0x84,0x00,0x25,0xc0,0x0b,0x58,0x02,0xc0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe730, 0, {0x20,0x14,0xcc,0x00,0x81,0x80,0x24,0x40,0x08,0x3e,0x02,0x6e,0x00,0x89,0x00,0x2c },
+  16, 0xe740, 0, {0xc0,0x0b,0xb4,0x02,0xca,0x80,0xa3,0x00,0x24,0xc0,0x0a,0x04,0x02,0xec,0x40,0x82 },
+  16, 0xe750, 0, {0x0a,0x20,0xc0,0x0b,0x30,0x02,0xcd,0x10,0x80,0xc0,0xa4,0x00,0x0b,0x1c,0x02,0xc8 },
+  16, 0xe760, 0, {0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0x84,0x00,0xeb,0x80,0x33,0x40 },
+  16, 0xe770, 0, {0x0d,0x8c,0x83,0x26,0x00,0xe9,0xa0,0x3e,0x78,0x8f,0x90,0x83,0xe1,0x00,0xff,0x00 },
+  16, 0xe780, 0, {0x31,0xd1,0x0e,0x84,0x23,0xfc,0x00,0xcb,0x82,0x32,0xc0,0x8f,0xb0,0x02,0xfd,0x40 },
+  16, 0xe790, 0, {0xcb,0x80,0xb6,0xc0,0x0f,0xa4,0x03,0xea,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe7a0, 0, {0x80,0x00,0xec,0x00,0xfb,0x00,0x3e,0x40,0x0f,0xa0,0x03,0xe0,0x00,0xf9,0x01,0x3e },
+  16, 0xe7b0, 0, {0x42,0x0f,0x90,0x03,0xe5,0x54,0xe3,0x00,0x3e,0xc8,0x05,0x93,0x03,0xec,0x80,0xfb },
+  16, 0xe7c0, 0, {0xc1,0x3e,0xc0,0x0f,0x20,0x03,0xcc,0x48,0xf3,0x08,0x3a,0x00,0x0f,0xa0,0x43,0xe0 },
+  16, 0xe7d0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xf0,0x00,0xcf,0x00,0x3f,0x40 },
+  16, 0xe7e0, 0, {0x0f,0x30,0x01,0x2c,0x0a,0xcd,0x10,0x33,0x00,0x0f,0xd0,0x83,0x14,0x00,0xcb,0x02 },
+  16, 0xe7f0, 0, {0x33,0xc0,0x0c,0xe1,0x03,0xec,0x10,0xcd,0x00,0x33,0xc0,0x0c,0xf0,0x33,0x3c,0x00 },
+  16, 0xe800, 0, {0xea,0x00,0x33,0xc0,0x0c,0xf0,0x83,0xc8,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe810, 0, {0x81,0x04,0x6e,0x00,0x8b,0x00,0x2e,0x40,0x0b,0xbc,0x02,0x2e,0x00,0x0b,0x00,0x22 },
+  16, 0xe820, 0, {0x30,0x0b,0x9c,0x02,0x27,0x80,0xab,0x00,0x2a,0xc0,0x08,0xb8,0x02,0xec,0x00,0x89 },
+  16, 0xe830, 0, {0xc0,0x20,0xe0,0x08,0xae,0x02,0x2c,0x08,0x8a,0x00,0x22,0x00,0x08,0xb0,0x42,0xe8 },
+  16, 0xe840, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2e,0x00,0x8b,0x04,0x2e,0x40 },
+  16, 0xe850, 0, {0x8b,0x8c,0x02,0xae,0x10,0x89,0x00,0x22,0x70,0x0b,0x8c,0x02,0xa2,0x00,0x8b,0x01 },
+  16, 0xe860, 0, {0x22,0xc0,0x08,0x80,0x02,0xec,0x10,0x82,0x88,0xa2,0x70,0x09,0xb8,0x02,0x2c,0x08 },
+  16, 0xe870, 0, {0x89,0x00,0x20,0xc0,0x28,0x80,0x22,0xe0,0x10,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe880, 0, {0x08,0x04,0x0c,0x04,0x81,0x00,0x2c,0x40,0x0b,0x20,0x02,0x80,0x00,0x81,0x04,0xa0 },
+  16, 0xe890, 0, {0x50,0x4b,0x00,0x0a,0x80,0x00,0xa3,0x01,0x2a,0xc1,0x20,0x10,0x02,0xcc,0x14,0x83 },
+  16, 0xe8a0, 0, {0x00,0x22,0xc0,0x08,0x20,0x02,0x0c,0x00,0x81,0x00,0xe0,0x00,0x08,0x00,0x02,0xc2 },
+  16, 0xe8b0, 0, {0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x68,0x00,0xcb,0x00,0x3e,0x40 },
+  16, 0xe8c0, 0, {0x0f,0x90,0x0b,0xac,0x80,0xc9,0x00,0x32,0x10,0x0f,0x80,0x03,0xa4,0x00,0xcf,0x02 },
+  16, 0xe8d0, 0, {0x31,0xc0,0x0c,0x80,0x13,0xfc,0x02,0xcd,0x00,0x33,0xc0,0x2c,0x90,0x03,0x3c,0x02 },
+  16, 0xe8e0, 0, {0xe8,0x00,0xb2,0xc0,0x0c,0x90,0x03,0xc0,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe8f0, 0, {0xa0,0x1d,0xfc,0x02,0xf5,0x00,0x3d,0x40,0x8f,0xf0,0x23,0x6d,0x00,0xff,0x00,0x3f },
+  16, 0xe900, 0, {0x04,0x0f,0xc0,0x03,0x70,0x1c,0xff,0x01,0x3f,0xc0,0x4f,0xc0,0x03,0xfc,0x00,0xfd },
+  16, 0xe910, 0, {0x00,0x3f,0xc0,0x0f,0xe0,0x0f,0xfc,0x18,0xfc,0x00,0x3f,0x00,0x0f,0xd0,0x03,0xe8 },
+  16, 0xe920, 0, {0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfe,0x00,0xd7,0x02,0x0f,0x30 },
+  16, 0xe930, 0, {0x0c,0xf2,0x01,0x7e,0x06,0x44,0x30,0x3f,0x20,0x0e,0xf0,0x02,0x7c,0x84,0xfd,0x20 },
+  16, 0xe940, 0, {0x27,0x08,0x0c,0xd0,0x01,0x36,0x00,0xff,0x60,0x33,0xcc,0x0b,0xf1,0x13,0x2c,0xc4 },
+  16, 0xe950, 0, {0xff,0x30,0x0f,0xcd,0x0c,0xf4,0x03,0xf0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe960, 0, {0x80,0x10,0xee,0x00,0x8f,0xc0,0x2e,0x00,0x08,0xfc,0x02,0x2e,0x00,0x8a,0x30,0x28 },
+  16, 0xe970, 0, {0x52,0x08,0xf6,0x82,0x3c,0x68,0xbd,0x90,0x32,0x34,0x48,0x9c,0x12,0x26,0x00,0xcf },
+  16, 0xe980, 0, {0x40,0x23,0xcc,0x0b,0xf6,0x02,0x3d,0x00,0xbf,0x10,0x2f,0xcc,0x88,0xf6,0x02,0xe0 },
+  16, 0xe990, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x00,0x93,0x10,0x2c,0x08 },
+  16, 0xe9a0, 0, {0x09,0x31,0x02,0x4c,0x00,0x9b,0x20,0x64,0x58,0x03,0x31,0x62,0x4c,0x81,0xa1,0x00 },
+  16, 0xe9b0, 0, {0x20,0x00,0x48,0x14,0x02,0x44,0x00,0x93,0x30,0x24,0xc0,0x0b,0x33,0x02,0x8d,0x84 },
+  16, 0xe9c0, 0, {0xb3,0x20,0x6c,0xc0,0x2a,0x36,0x02,0xe2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe9d0, 0, {0xc0,0x15,0xac,0x10,0x9b,0x02,0x2e,0x41,0x0b,0xb0,0x02,0xa4,0x00,0x9a,0x00,0x4a },
+  16, 0xe9e0, 0, {0x60,0x88,0xb0,0x52,0x6c,0x01,0xb9,0x00,0x26,0x00,0x08,0x91,0x22,0xec,0x08,0xbb },
+  16, 0xe9f0, 0, {0x00,0x26,0xc0,0x0b,0xb0,0x02,0xac,0x00,0xbb,0x05,0x6e,0xc1,0x0a,0xb0,0x02,0xf0 },
+  16, 0xea00, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xec,0x00,0xdb,0x01,0x3e,0x30 },
+  16, 0xea10, 0, {0x2d,0x30,0x03,0x47,0x60,0xd8,0xa0,0x16,0x38,0x8f,0xb0,0x03,0x6c,0x00,0x79,0x02 },
+  16, 0xea20, 0, {0x31,0x60,0x0c,0xc8,0x0a,0x66,0x00,0xbb,0x00,0xb6,0xc0,0x0f,0xb0,0x0b,0xac,0x00 },
+  16, 0xea30, 0, {0xfb,0x01,0x3e,0xc1,0x0e,0xb0,0x03,0xd0,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xea40, 0, {0xe0,0x01,0xbc,0x10,0xef,0x08,0x3f,0x24,0x0c,0xf0,0x03,0x76,0x20,0xee,0x90,0x35 },
+  16, 0xea50, 0, {0x40,0x0e,0x70,0x03,0xac,0x00,0xfd,0x00,0xbb,0x64,0x0f,0x88,0x13,0x34,0x80,0xcb },
+  16, 0xea60, 0, {0x00,0x3b,0xc0,0x0f,0xb0,0x03,0x6c,0x08,0xff,0x00,0x3e,0xc0,0x0d,0xf0,0x03,0xf8 },
+  16, 0xea70, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x01,0xfb,0x80,0x32,0x10 },
+  16, 0xea80, 0, {0x0e,0xb0,0x03,0xed,0x00,0xcb,0x50,0x3e,0x40,0x8c,0xb0,0x43,0x2c,0x10,0xf9,0x00 },
+  16, 0xea90, 0, {0x32,0x60,0x0c,0x40,0x0b,0x26,0x00,0xc3,0x04,0x36,0xc0,0x0c,0x30,0x03,0x2c,0x00 },
+  16, 0xeaa0, 0, {0x9b,0x00,0xb0,0xc0,0x0c,0xb0,0x03,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeab0, 0, {0xc8,0x05,0x0e,0x80,0xbf,0x04,0x2a,0x40,0x00,0xf5,0x00,0xe6,0x00,0x82,0xd2,0x22 },
+  16, 0xeac0, 0, {0x40,0x0d,0xf0,0x22,0x3c,0x00,0x95,0x02,0x36,0x40,0x0a,0x80,0x02,0x2e,0x00,0x8f },
+  16, 0xead0, 0, {0x00,0x37,0xc0,0x0a,0xf0,0x42,0x3c,0x00,0x8f,0x00,0x23,0xc0,0x28,0xf0,0x02,0xf2 },
+  16, 0xeae0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4e,0x00,0xb3,0x00,0x22,0x20 },
+  16, 0xeaf0, 0, {0x4a,0x30,0x00,0xcc,0x00,0x81,0xc0,0x28,0x00,0x08,0x30,0x02,0x0c,0x10,0xa1,0x00 },
+  16, 0xeb00, 0, {0x28,0x80,0x18,0x30,0x22,0x04,0x04,0x83,0x00,0x24,0xc0,0x08,0x30,0x02,0xcc,0x08 },
+  16, 0xeb10, 0, {0x93,0x00,0x20,0xc0,0x08,0x30,0x06,0xf8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeb20, 0, {0x20,0x01,0x1e,0x00,0xb7,0x80,0x29,0xa0,0x08,0x78,0x02,0xfe,0x20,0x8d,0x80,0x29 },
+  16, 0xeb30, 0, {0xe5,0x5b,0x38,0x42,0x1e,0x40,0xa1,0x81,0x25,0xa8,0x08,0x79,0x02,0x37,0x00,0x87 },
+  16, 0xeb40, 0, {0x80,0x25,0xe0,0x0a,0x78,0x0a,0xde,0x81,0x87,0x80,0x25,0xe5,0x48,0x78,0x02,0xc8 },
+  16, 0xeb50, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0xb3,0x10,0x30,0x12 },
+  16, 0xeb60, 0, {0x0e,0x30,0x12,0xcc,0xc0,0xc3,0x00,0x38,0x80,0x0c,0x31,0x06,0x0c,0x40,0xf1,0x00 },
+  16, 0xeb70, 0, {0x38,0x80,0x0c,0x30,0x43,0x04,0x42,0xc3,0x00,0x36,0xc0,0x0c,0x32,0x03,0xce,0xc0 },
+  16, 0xeb80, 0, {0xdb,0x00,0x30,0xc0,0x0c,0x30,0x03,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeb90, 0, {0x40,0x1d,0xbc,0x00,0xff,0x10,0x3d,0x84,0x4f,0xf1,0x03,0xd0,0x40,0xfc,0x10,0x33 },
+  16, 0xeba0, 0, {0x80,0x5d,0xb1,0x83,0xfc,0x50,0xdd,0x0a,0x25,0x89,0x0f,0xb8,0x03,0xd4,0x00,0xff },
+  16, 0xebb0, 0, {0x10,0x3f,0xc0,0x0f,0xf4,0x03,0x3c,0x40,0xff,0x00,0x3b,0xc0,0x0f,0xf0,0x03,0xd0 },
+  16, 0xebc0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x00,0xfb,0x20,0x3e,0x00 },
+  16, 0xebd0, 0, {0x0f,0xb5,0x03,0x29,0x20,0xf9,0x00,0x32,0xa0,0x0c,0xb0,0x83,0xec,0x00,0x49,0xc8 },
+  16, 0xebe0, 0, {0xb2,0xc0,0x8c,0xa0,0x03,0x64,0x00,0xfb,0x08,0x12,0xea,0x0c,0xb0,0x0b,0x2c,0x80 },
+  16, 0xebf0, 0, {0xfb,0x20,0x2e,0xd2,0x6c,0xb6,0x43,0xea,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xec00, 0, {0x48,0x11,0x9c,0x00,0xb7,0x49,0x2d,0x00,0x0b,0x30,0x82,0x10,0x01,0xb5,0x02,0x83 },
+  16, 0xec10, 0, {0xc0,0x1a,0x72,0x22,0xdd,0x41,0x85,0x00,0x61,0xc0,0x18,0x20,0x20,0x14,0x00,0xbf },
+  16, 0xec20, 0, {0x40,0x35,0xd0,0x0d,0x34,0x02,0x1d,0x20,0xb7,0x28,0x25,0xc1,0x08,0x74,0x82,0xd2 },
+  16, 0xec30, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x04,0x37,0xa0,0x2d,0x20 },
+  16, 0xec40, 0, {0x0b,0x7a,0x12,0x16,0x01,0xb3,0x80,0x21,0xe2,0x08,0x78,0x42,0x9e,0x00,0x85,0x80 },
+  16, 0xec50, 0, {0x20,0xe1,0x18,0x68,0x02,0x56,0x00,0xb7,0xa0,0x25,0xe0,0x08,0x7a,0x02,0x1e,0x00 },
+  16, 0xec60, 0, {0xb7,0x90,0x2c,0xe5,0x88,0x7a,0x02,0xf0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xec70, 0, {0x48,0x14,0xcc,0x00,0xb3,0x00,0x6c,0x24,0x1b,0x30,0x02,0x00,0x00,0xb0,0x00,0x20 },
+  16, 0xec80, 0, {0xf8,0x0a,0x30,0x02,0xcc,0x00,0x81,0x00,0x20,0xd8,0x18,0x20,0x02,0x04,0x00,0xb3 },
+  16, 0xec90, 0, {0x00,0x24,0xc0,0x09,0x30,0x02,0x0c,0x00,0xb3,0x00,0x26,0xc0,0x08,0x30,0x02,0xd2 },
+  16, 0xeca0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x00,0xfa,0x00,0x3d,0x80 },
+  16, 0xecb0, 0, {0x0f,0x20,0x0b,0x28,0x80,0xfe,0x00,0x33,0xa0,0x0c,0xa0,0x03,0xe8,0x02,0xca,0x02 },
+  16, 0xecc0, 0, {0x32,0x90,0x2c,0xe4,0x03,0x78,0x00,0xfa,0x00,0x32,0x80,0x0c,0xa0,0x03,0x28,0x00 },
+  16, 0xecd0, 0, {0xfa,0x00,0x3e,0x80,0x0c,0xa0,0x03,0xfa,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xece0, 0, {0x48,0x00,0xe1,0x00,0xf0,0x00,0x3e,0x00,0x4f,0x80,0x03,0xe0,0x80,0xf8,0x00,0x3e },
+  16, 0xecf0, 0, {0x00,0x0f,0x80,0x23,0xc0,0x00,0xf8,0x02,0x3c,0x00,0x0f,0xc0,0x83,0x60,0x00,0xb8 },
+  16, 0xed00, 0, {0x00,0x3e,0x00,0x0f,0x80,0x23,0xe0,0x18,0xf8,0x01,0x36,0x00,0x0f,0x80,0x03,0xd2 },
+  16, 0xed10, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe6,0x00,0xf9,0x21,0x32,0x60 },
+  16, 0xed20, 0, {0x0c,0x90,0x03,0x2c,0x44,0xf9,0x00,0xb2,0x40,0x0f,0x90,0x1b,0x24,0x00,0xe9,0x00 },
+  16, 0xed30, 0, {0x3e,0x40,0x0c,0x10,0x03,0xa4,0x00,0xf9,0x00,0x32,0x40,0x0f,0x10,0x33,0x24,0x10 },
+  16, 0xed40, 0, {0xf1,0x00,0x32,0x40,0x0c,0x90,0x03,0x02,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xed50, 0, {0x80,0x04,0x64,0x00,0xb9,0x40,0xa2,0x41,0x08,0x90,0x02,0x24,0x80,0xe9,0x00,0x22 },
+  16, 0xed60, 0, {0x40,0x0b,0x90,0x12,0x24,0x00,0x89,0x00,0x6e,0x41,0x18,0x90,0x42,0x24,0x00,0xb9 },
+  16, 0xed70, 0, {0x04,0x2a,0x41,0x0b,0x90,0x03,0x64,0x00,0xf9,0x00,0x2a,0x40,0x0a,0x90,0x0a,0x20 },
+  16, 0xed80, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0x24,0x80,0xb9,0x42,0x62,0x48 },
+  16, 0xed90, 0, {0x28,0x90,0x0a,0x24,0x00,0xb1,0x00,0x22,0x40,0x0b,0x10,0x02,0x24,0x10,0xb9,0x02 },
+  16, 0xeda0, 0, {0x2e,0x40,0x08,0xd0,0x02,0xa4,0x00,0xb1,0x00,0x22,0x40,0x0b,0x90,0x02,0x24,0x04 },
+  16, 0xedb0, 0, {0xb9,0x00,0x22,0x40,0x08,0x10,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xedc0, 0, {0x08,0x04,0x0c,0x00,0xb1,0x20,0x60,0x40,0x08,0x12,0x02,0x04,0x00,0xa1,0x20,0x20 },
+  16, 0xedd0, 0, {0x40,0x0b,0x12,0x02,0x04,0x80,0x91,0x20,0x2d,0x68,0x08,0x52,0x12,0x04,0x00,0xb1 },
+  16, 0xede0, 0, {0x28,0x28,0x4a,0x09,0x12,0x82,0x44,0xa0,0xb1,0x2c,0x28,0x4a,0x0a,0x12,0x82,0x02 },
+  16, 0xedf0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xf8,0x00,0x32,0x14 },
+  16, 0xee00, 0, {0x0c,0x80,0x03,0x20,0x00,0xf8,0x50,0x32,0x14,0x0f,0x85,0x03,0x01,0x40,0xf8,0x00 },
+  16, 0xee10, 0, {0x2e,0x00,0x28,0xc0,0x03,0xa0,0x00,0xf8,0x24,0x30,0x08,0x0f,0x82,0x23,0x20,0x80 },
+  16, 0xee20, 0, {0xf8,0x20,0x32,0x08,0x0c,0x82,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xee30, 0, {0x98,0x1d,0xe4,0x08,0xf9,0x10,0x3f,0x40,0x8f,0x91,0x13,0xe4,0x00,0xed,0x10,0x3f },
+  16, 0xee40, 0, {0x50,0x0f,0x91,0x03,0xe4,0x40,0xa5,0x10,0x3e,0x44,0x0f,0x91,0x03,0xf4,0x04,0xf9 },
+  16, 0xee50, 0, {0x28,0x3e,0x4b,0x0b,0x92,0xa3,0xe4,0xa0,0xe9,0x28,0x3e,0x4a,0x0f,0x92,0x83,0xe6 },
+  16, 0xee60, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xf4,0x00,0xcd,0x00,0x33,0x40 },
+  16, 0xee70, 0, {0x80,0xd0,0x01,0xf4,0x00,0xa5,0x00,0x26,0x40,0x0f,0x90,0x03,0x26,0x00,0xf1,0x88 },
+  16, 0xee80, 0, {0x3e,0x68,0x0d,0x98,0x83,0x44,0x00,0xc9,0xc0,0x3a,0x40,0x0c,0x98,0x03,0x24,0x08 },
+  16, 0xee90, 0, {0xf9,0xa0,0x32,0x78,0x0f,0x9a,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeea0, 0, {0x38,0x10,0xe0,0x02,0x88,0x00,0xa2,0x00,0x08,0x80,0x02,0xe0,0x00,0x0a,0x00,0x22 },
+  16, 0xeeb0, 0, {0x00,0x0b,0x80,0x02,0x20,0x00,0xb8,0x40,0x2e,0x14,0x08,0x80,0x43,0x30,0x00,0x88 },
+  16, 0xeec0, 0, {0xa0,0x22,0x2a,0x0a,0x8a,0x42,0xa0,0x05,0xb8,0x42,0x32,0x38,0x0b,0x80,0x02,0x0e },
+  16, 0xeed0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x03,0x91,0x00,0x24,0x40 },
+  16, 0xeee0, 0, {0x0b,0x10,0x02,0xc4,0x11,0xb1,0x04,0x20,0x41,0x1b,0x10,0x22,0x45,0x00,0xb5,0x00 },
+  16, 0xeef0, 0, {0x25,0x40,0x09,0x50,0x02,0x54,0x01,0x81,0x40,0x2c,0x40,0x09,0x14,0x92,0x44,0x00 },
+  16, 0xef00, 0, {0xb1,0x40,0x24,0x4c,0x0b,0x14,0x0a,0x42,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xef10, 0, {0x18,0x15,0xa4,0x00,0x99,0x00,0x24,0x42,0x0b,0x90,0x02,0xe4,0x01,0x99,0x20,0x26 },
+  16, 0xef20, 0, {0x40,0xcb,0x90,0x02,0x64,0x00,0xbb,0x00,0x2f,0x41,0x0a,0xd0,0x02,0x34,0x00,0x89 },
+  16, 0xef30, 0, {0x00,0x26,0x40,0x0b,0x10,0x02,0xe4,0x00,0x31,0x00,0x62,0x40,0x0b,0x90,0x02,0x46 },
+  16, 0xef40, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xc4,0x00,0xd9,0x01,0x36,0x50 },
+  16, 0xef50, 0, {0x2f,0x90,0x03,0xe6,0x60,0xf9,0x80,0x36,0x52,0x0b,0x90,0x0a,0x64,0x00,0xf9,0x00 },
+  16, 0xef60, 0, {0x36,0x40,0x0d,0x90,0x03,0x64,0x02,0x09,0x00,0x3e,0x40,0x0d,0x90,0x03,0x64,0x00 },
+  16, 0xef70, 0, {0xb9,0x00,0xb6,0x40,0x0f,0x90,0x03,0x68,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xef80, 0, {0x28,0x01,0xa4,0x00,0xe1,0x00,0x3a,0x41,0x0c,0x90,0x23,0xe6,0x20,0xe9,0x00,0xba },
+  16, 0xef90, 0, {0x70,0x0f,0x90,0x03,0xa4,0x00,0xf9,0x00,0x3e,0x40,0x0d,0x10,0x13,0xa7,0x00,0xf9 },
+  16, 0xefa0, 0, {0x00,0x3a,0x40,0x0e,0x90,0x43,0xa4,0x08,0xf9,0x00,0x3a,0x40,0x0f,0x90,0x03,0x8a },
+  16, 0xefb0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x20,0xf8,0x00,0x32,0x00 },
+  16, 0xefc0, 0, {0x0f,0x80,0x83,0x21,0x00,0xf0,0x00,0x3a,0x11,0x09,0x80,0x03,0xe0,0x00,0xc8,0x01 },
+  16, 0xefd0, 0, {0x30,0x01,0x0c,0x80,0x03,0xb0,0x00,0xd0,0x00,0x34,0x00,0x0d,0x80,0x03,0x20,0x00 },
+  16, 0xefe0, 0, {0xc8,0x00,0x32,0x00,0x0c,0x80,0x03,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeff0, 0, {0x28,0x05,0x38,0x00,0xbe,0x00,0x22,0x80,0x03,0xe8,0x02,0x1a,0x08,0xbe,0x48,0x22 },
+  16, 0xf000, 0, {0x80,0x0a,0xa0,0x03,0xb8,0x00,0xca,0x08,0x22,0x80,0x0f,0xa4,0x02,0x08,0x00,0x8a },
+  16, 0xf010, 0, {0x00,0x22,0x80,0x8d,0xa0,0x02,0x28,0x00,0xda,0x00,0x2a,0x81,0x08,0xa0,0x02,0x8a },
+  16, 0xf020, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x44,0x00,0xb3,0x00,0x20,0x40 },
+  16, 0xf030, 0, {0x0b,0x30,0x02,0x08,0x00,0xb0,0x64,0x68,0xc1,0x08,0xb0,0x22,0xcc,0x0c,0x93,0x80 },
+  16, 0xf040, 0, {0x00,0xc0,0x48,0x36,0x02,0x88,0x00,0xb3,0x00,0x24,0xc0,0x08,0x30,0x06,0x0c,0x01 },
+  16, 0xf050, 0, {0xa3,0x02,0x2c,0xc0,0x08,0xb0,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf060, 0, {0xa0,0x01,0x14,0x08,0xb5,0x00,0x21,0x40,0x0b,0x38,0x82,0x1c,0x21,0xb7,0x00,0x23 },
+  16, 0xf070, 0, {0xe8,0x4a,0x72,0x26,0x9e,0x40,0x8f,0x81,0xab,0x40,0x42,0x70,0x52,0x38,0x00,0xa3 },
+  16, 0xf080, 0, {0x22,0x20,0xc4,0x49,0x31,0x02,0x1e,0x0a,0xb7,0x22,0x2d,0xe8,0x08,0x72,0x02,0xa8 },
+  16, 0xf090, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x12,0x00,0xf6,0x80,0x21,0xe0 },
+  16, 0xf0a0, 0, {0x0b,0x78,0x0b,0x1e,0x00,0xb4,0x82,0x3b,0xe8,0x4c,0x7c,0x13,0xfe,0x02,0x97,0x80 },
+  16, 0xf0b0, 0, {0x33,0xa0,0x08,0x38,0x03,0x9a,0x00,0xf7,0x88,0x35,0xe2,0x0c,0x78,0xe3,0x0e,0x00 },
+  16, 0xf0c0, 0, {0xe3,0xe8,0x34,0xf8,0x0c,0x3c,0x23,0x2a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf0d0, 0, {0x08,0x1d,0xa8,0x04,0xf1,0x00,0x3e,0x42,0x0f,0xb0,0x13,0xec,0x00,0xfb,0x00,0xbe },
+  16, 0xf0e0, 0, {0xcc,0x1e,0xb6,0x07,0xed,0x80,0xfb,0x00,0x36,0x00,0x0f,0xb0,0x43,0x68,0x00,0xcb },
+  16, 0xf0f0, 0, {0x30,0x3e,0xd8,0x0f,0xb6,0x0b,0xed,0x40,0xcb,0x00,0x3a,0xc0,0x2f,0xb6,0x03,0xc2 },
+  16, 0xf100, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xf2,0x40,0xfb,0x91,0x3d,0x4c },
+  16, 0xf110, 0, {0x80,0xf8,0x03,0xde,0x40,0xc6,0x80,0x1b,0xf0,0x4f,0xfd,0x07,0xff,0x00,0xcd,0x80 },
+  16, 0xf120, 0, {0x33,0xe0,0x0c,0x68,0x03,0xba,0x00,0xff,0x80,0x33,0xe0,0x07,0xf8,0x03,0x3f,0x10 },
+  16, 0xf130, 0, {0xcf,0x80,0x3f,0xe0,0x0c,0xfc,0x03,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf140, 0, {0xa8,0x11,0x90,0x00,0xb5,0xc0,0x2d,0x40,0x08,0x62,0x02,0xdc,0x20,0xd6,0x02,0x21 },
+  16, 0xf150, 0, {0xc8,0x8f,0x70,0x02,0xdc,0x81,0xb5,0x00,0x81,0x44,0x0d,0x61,0x22,0x18,0x04,0xb7 },
+  16, 0xf160, 0, {0x00,0x35,0xc0,0x0b,0x70,0x02,0xbc,0x00,0xa7,0x01,0x2d,0xc0,0x08,0x70,0x03,0xea },
+  16, 0xf170, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x01,0xb6,0x01,0x2f,0xc0 },
+  16, 0xf180, 0, {0x18,0x70,0x02,0xdc,0x0a,0x96,0x10,0x29,0xc1,0x4b,0x70,0x06,0xdc,0x10,0x85,0x00 },
+  16, 0xf190, 0, {0x25,0x80,0x08,0x60,0x82,0x1a,0x20,0xa3,0x00,0x25,0xc0,0x0b,0x31,0x02,0x5c,0x40 },
+  16, 0xf1a0, 0, {0x87,0x00,0x2d,0xc0,0x08,0x70,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf1b0, 0, {0x20,0x14,0xc8,0x00,0xb1,0x00,0x2c,0x40,0x88,0x20,0x02,0xed,0x00,0x8a,0x60,0x20 },
+  16, 0xf1c0, 0, {0xc0,0x0a,0x30,0x02,0xcc,0x04,0xb1,0x00,0x24,0x00,0x28,0x24,0x02,0x0a,0x00,0x33 },
+  16, 0xf1d0, 0, {0x00,0x24,0xc0,0x0b,0xb0,0x02,0xcc,0x00,0xa3,0x00,0x2c,0xc0,0x88,0x30,0x02,0x88 },
+  16, 0xf1e0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xa0,0x00,0xfb,0x00,0x3e,0xc6 },
+  16, 0xf1f0, 0, {0x0c,0x80,0x03,0xe5,0x00,0x09,0xc8,0xab,0xe2,0x0b,0xf0,0x02,0xfc,0x00,0x4a,0x00 },
+  16, 0xf200, 0, {0x36,0xc0,0x08,0x90,0x03,0xa6,0x00,0xff,0x00,0x33,0xc0,0x0f,0xf0,0x03,0x7c,0x00 },
+  16, 0xf210, 0, {0x8f,0x00,0x2f,0xc0,0x28,0xf0,0x02,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf220, 0, {0x80,0x00,0xe1,0x00,0xfa,0x01,0x3e,0xc0,0x0f,0x80,0x03,0xec,0x00,0xf9,0x40,0x3e },
+  16, 0xf230, 0, {0xc0,0x07,0xb0,0x03,0xec,0x00,0xfa,0x00,0x3a,0x40,0x0f,0x90,0x23,0xe5,0x00,0xfb },
+  16, 0xf240, 0, {0x00,0x3e,0xc0,0x0f,0xb0,0x03,0xac,0x00,0xfb,0x00,0x3c,0xc0,0x0f,0xb0,0x23,0xe0 },
+  16, 0xf250, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xf0,0x00,0xfc,0x20,0x3f,0xc0 },
+  16, 0xf260, 0, {0x0c,0xc8,0x03,0xfc,0x20,0xcd,0x81,0xb3,0xc2,0x4f,0xf0,0x03,0xfc,0x00,0xca,0x00 },
+  16, 0xf270, 0, {0x3c,0x80,0x0c,0xd0,0x82,0x36,0x01,0xff,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0x3c,0x08 },
+  16, 0xf280, 0, {0xcf,0x04,0x3a,0xc0,0x5c,0xb0,0x03,0xc0,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf290, 0, {0x81,0x04,0x62,0x04,0xb8,0x40,0x2c,0x60,0x08,0x89,0x02,0xee,0x80,0xa9,0x60,0x2a },
+  16, 0xf2a0, 0, {0xc0,0x0b,0xb0,0x03,0x8c,0x00,0xaa,0x40,0x2e,0x00,0x08,0x10,0x02,0x26,0x81,0xeb },
+  16, 0xf2b0, 0, {0x00,0x26,0xc0,0x8b,0xb0,0x13,0x6c,0x00,0xdb,0x00,0x2e,0xc0,0x3d,0xb0,0x02,0xe0 },
+  16, 0xf2c0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x23,0x00,0xbb,0x03,0x2e,0xc8 },
+  16, 0xf2d0, 0, {0x09,0xb0,0x02,0xee,0x00,0x8b,0x10,0x26,0xc0,0x0b,0xb0,0x02,0xec,0x00,0xa8,0x00 },
+  16, 0xf2e0, 0, {0x2e,0xc0,0x08,0x88,0x22,0xa4,0x80,0xbb,0x00,0x2e,0xc0,0x4b,0xb0,0x22,0x0c,0x00 },
+  16, 0xf2f0, 0, {0x8b,0x00,0x2e,0xc0,0x0b,0xb0,0x02,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf300, 0, {0x08,0x04,0x00,0x00,0xb2,0x00,0x2e,0xc0,0x29,0x28,0x02,0xec,0x01,0xa0,0x02,0x20 },
+  16, 0xf310, 0, {0xc0,0x09,0x30,0x02,0xcc,0x00,0xa0,0x00,0x2c,0x40,0x08,0x00,0x42,0x84,0x00,0x93 },
+  16, 0xf320, 0, {0x00,0x6c,0xc0,0x0b,0x30,0x06,0x4d,0x00,0x93,0x00,0x2c,0xc0,0x08,0x30,0x02,0xc2 },
+  16, 0xf330, 0, {0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x60,0x00,0xf8,0x20,0x2f,0xc0 },
+  16, 0xf340, 0, {0x0d,0xb0,0x03,0xec,0x00,0xcb,0x00,0x33,0xc0,0x0b,0xf0,0x03,0xfc,0x18,0xe8,0x00 },
+  16, 0xf350, 0, {0x2e,0x80,0x08,0x80,0x03,0xa4,0x00,0xbf,0x00,0x3f,0xc0,0x0f,0xf0,0x43,0x3d,0x11 },
+  16, 0xf360, 0, {0xcf,0x03,0x3e,0xc1,0x5d,0xf0,0x23,0xc0,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf370, 0, {0xa0,0x1d,0xf0,0x00,0xfc,0x10,0x3f,0x40,0x0e,0xe0,0x03,0xfc,0x00,0xfc,0x00,0x3f },
+  16, 0xf380, 0, {0xc0,0x0f,0xf0,0x03,0xbc,0x00,0xfc,0x00,0x3f,0x00,0x2f,0xc0,0x03,0x74,0x00,0xef },
+  16, 0xf390, 0, {0x00,0x27,0xc0,0x0f,0xf0,0x03,0xfc,0x18,0xff,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0xe8 },
+  16, 0xf3a0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x15,0xfc,0x88,0x9c,0x29,0x3f,0x08 },
+  16, 0xf3b0, 0, {0x0f,0xd2,0x83,0xec,0x00,0xff,0x08,0x3f,0x28,0x0f,0xca,0x03,0x3c,0x41,0xcf,0x20 },
+  16, 0xf3c0, 0, {0x73,0x2c,0x0c,0xc0,0x03,0x30,0x20,0xcf,0x60,0x33,0xd8,0x0f,0x78,0x03,0x3f,0x80 },
+  16, 0xf3d0, 0, {0xdd,0x92,0x33,0xc8,0x0f,0x50,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf3e0, 0, {0x80,0x10,0xe5,0x40,0x88,0x40,0x2e,0x04,0x8b,0x94,0x02,0xe4,0x00,0xb9,0x00,0x0e },
+  16, 0xf3f0, 0, {0x7f,0x8f,0x9e,0x83,0x65,0x82,0xcf,0x68,0x3e,0x50,0x8d,0x04,0x92,0x2f,0x04,0xd3 },
+  16, 0xf400, 0, {0x40,0x74,0xdc,0x0d,0xa2,0x02,0x20,0x40,0x89,0x00,0x22,0xf0,0x0b,0x98,0x02,0x20 },
+  16, 0xf410, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xc8,0x09,0xa0,0x85,0x2c,0x01 },
+  16, 0xf420, 0, {0x0b,0x00,0x10,0xcc,0x40,0xa2,0x08,0x2c,0x00,0xdb,0x11,0x02,0x89,0x00,0x93,0x30 },
+  16, 0xf430, 0, {0x20,0x05,0x08,0x13,0x02,0x80,0x08,0xa3,0x60,0x60,0xc0,0x0a,0xb0,0x82,0x08,0x84 },
+  16, 0xf440, 0, {0x81,0x20,0x20,0xd0,0x0b,0x10,0x02,0xa2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf450, 0, {0xc0,0x15,0xa4,0x12,0x88,0x80,0x6e,0x20,0x0b,0x88,0x82,0xee,0x00,0xba,0x81,0x2e },
+  16, 0xf460, 0, {0x60,0x5a,0x98,0x02,0xa2,0x00,0x8b,0x00,0x2a,0x60,0x08,0x11,0x1a,0x2c,0x00,0xbb },
+  16, 0xf470, 0, {0x00,0x22,0xc0,0x08,0xb8,0x0a,0x28,0x00,0x81,0x20,0x02,0xc0,0x0b,0x90,0x02,0xb0 },
+  16, 0xf480, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xed,0x00,0xd9,0x80,0x3e,0x20 },
+  16, 0xf490, 0, {0x4f,0x98,0x00,0xeb,0x20,0xfb,0xe0,0x2e,0x60,0x0b,0x8c,0x62,0xae,0x20,0x8b,0x00 },
+  16, 0xf4a0, 0, {0x22,0x60,0x08,0xbc,0x03,0xa0,0x20,0xeb,0x00,0x22,0xc1,0x0a,0x18,0x0b,0x25,0x00 },
+  16, 0xf4b0, 0, {0xd9,0x00,0xb2,0xc0,0x0f,0x90,0x0b,0x90,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf4c0, 0, {0xe0,0x01,0x94,0x88,0xff,0x00,0x3f,0x01,0x0f,0xd0,0x01,0xf0,0x08,0xdd,0x01,0x3f },
+  16, 0xf4d0, 0, {0x42,0x07,0x40,0x03,0x5c,0x00,0xaf,0x00,0x3f,0x40,0x0f,0xf8,0x00,0xf0,0x00,0xdf },
+  16, 0xf4e0, 0, {0x00,0x3f,0xc0,0x0f,0xc0,0x23,0xf4,0x50,0xfd,0x80,0x3f,0xc0,0x0f,0xd0,0x03,0x78 },
+  16, 0xf4f0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0xac,0x00,0xd9,0x00,0x3e,0x40 },
+  16, 0xf500, 0, {0x0f,0x94,0x03,0xa8,0x20,0xca,0x40,0x3a,0x40,0x0f,0x94,0x03,0xea,0x08,0xfb,0x00 },
+  16, 0xf510, 0, {0x3a,0x00,0x4c,0xf6,0x23,0x2c,0x30,0xcb,0x00,0x36,0xc0,0x0d,0x90,0x03,0xa1,0x02 },
+  16, 0xf520, 0, {0xd9,0x00,0xba,0xc0,0x0f,0x98,0x03,0x10,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf530, 0, {0xc8,0x05,0x24,0x00,0x8a,0x00,0x2e,0x40,0x0b,0x95,0x02,0xe0,0x08,0x88,0x80,0x22 },
+  16, 0xf540, 0, {0x70,0x8f,0x8c,0x02,0xe0,0x00,0xbf,0x02,0x20,0x00,0x08,0xb8,0x02,0x0e,0x00,0xdf },
+  16, 0xf550, 0, {0x00,0x23,0xdd,0x08,0x98,0x82,0x2a,0x00,0x89,0x80,0x23,0xc0,0x0b,0x50,0x1a,0x32 },
+  16, 0xf560, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x44,0x00,0x83,0x05,0x24,0x41 },
+  16, 0xf570, 0, {0x09,0x10,0x02,0xce,0x00,0x83,0x90,0x2c,0x80,0x1b,0x24,0x82,0xcc,0x00,0xbb,0x00 },
+  16, 0xf580, 0, {0x2c,0x80,0x08,0x04,0x08,0x04,0x01,0x8b,0x00,0x22,0xc0,0x28,0x12,0x02,0x6c,0x80 },
+  16, 0xf590, 0, {0x81,0x48,0x24,0xc4,0x0b,0x10,0x02,0x38,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf5a0, 0, {0x20,0x01,0x3e,0x42,0x86,0x80,0x2d,0x60,0x0b,0x68,0x02,0xf6,0x90,0x8d,0x80,0x21 },
+  16, 0xf5b0, 0, {0x22,0x0b,0x58,0x02,0xd7,0x40,0xb7,0x90,0x21,0xe0,0x08,0x49,0x92,0x1e,0x53,0x97 },
+  16, 0xf5c0, 0, {0x81,0x21,0xe0,0x48,0xc8,0x0a,0x52,0x22,0x85,0x88,0x25,0xe0,0x0b,0x58,0x02,0x08 },
+  16, 0xf5d0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0x83,0x00,0x34,0xc0 },
+  16, 0xf5e0, 0, {0x0f,0x00,0x03,0xce,0x20,0xc3,0x30,0x7c,0x94,0x0b,0x34,0x83,0xcc,0x14,0xf3,0x02 },
+  16, 0xf5f0, 0, {0x3c,0x80,0x0c,0x04,0x03,0x04,0x60,0xc3,0x00,0xb0,0xc0,0x0c,0x10,0x03,0xec,0x00 },
+  16, 0xf600, 0, {0xc9,0x00,0x3c,0xc4,0x0f,0x11,0x03,0x12,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf610, 0, {0x40,0x1d,0x9c,0x00,0xee,0x01,0x3f,0xc0,0x4f,0xe1,0x03,0xd4,0x40,0xf5,0x16,0x7a },
+  16, 0xf620, 0, {0xc0,0x4e,0xf0,0x03,0xf4,0x10,0x37,0x05,0x3d,0xc0,0x0f,0xc0,0x0b,0xdc,0x40,0xff },
+  16, 0xf630, 0, {0x00,0x3b,0xc2,0x0e,0xd0,0x07,0xbc,0x02,0xef,0x00,0x3b,0xc6,0x0f,0xd0,0x03,0xd0 },
+  16, 0xf640, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xf4,0x00,0xdd,0x84,0x33,0x80 },
+  16, 0xf650, 0, {0x04,0xf0,0x03,0x6c,0x02,0xcb,0x02,0x7e,0xc0,0x1f,0xa0,0x53,0xec,0x00,0xcb,0x20 },
+  16, 0xf660, 0, {0x34,0x40,0x0c,0xd0,0x0b,0x20,0x10,0xeb,0x00,0x1e,0xe0,0x0f,0x30,0x0b,0x2c,0x00 },
+  16, 0xf670, 0, {0xc1,0x00,0x32,0xc0,0x0f,0x91,0x03,0xea,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf680, 0, {0x48,0x11,0x9c,0x00,0x87,0x00,0x21,0x80,0x08,0x60,0x00,0x14,0x00,0x85,0x00,0x2d },
+  16, 0xf690, 0, {0x80,0x0b,0x70,0x52,0xd4,0x04,0x83,0x28,0x29,0xc0,0x28,0x50,0x03,0x50,0x00,0x87 },
+  16, 0xf6a0, 0, {0x40,0x25,0xc8,0x0f,0x60,0x02,0x04,0x00,0xa7,0x00,0x3d,0xc8,0x0b,0x52,0x02,0xd2 },
+  16, 0xf6b0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x8e,0x00,0x95,0x80,0x21,0xe0 },
+  16, 0xf6c0, 0, {0x09,0x38,0x02,0x1e,0x11,0xa7,0x80,0x2d,0xf0,0x0b,0x78,0x52,0xce,0x0a,0x97,0x95 },
+  16, 0xf6d0, 0, {0x21,0xe0,0x19,0x5c,0x02,0x0e,0x00,0xa7,0x80,0x29,0xc8,0x0b,0xf8,0x02,0x1e,0x20 },
+  16, 0xf6e0, 0, {0x8d,0x80,0x21,0xe0,0x0b,0x58,0x02,0xf0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf6f0, 0, {0x48,0x14,0xcc,0x00,0x82,0xe0,0xa0,0xe8,0x29,0x30,0x06,0x0e,0x50,0xab,0x80,0x2c },
+  16, 0xf700, 0, {0xf0,0x0b,0x31,0x42,0xcc,0x00,0x93,0x00,0x28,0xc4,0x09,0x98,0x02,0x4c,0x28,0x83 },
+  16, 0xf710, 0, {0x00,0x24,0xc0,0x0a,0xb0,0x02,0x0d,0x00,0xa2,0x58,0x28,0xc0,0x0b,0x10,0x02,0xd2 },
+  16, 0xf720, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xb9,0x00,0xde,0x80,0x31,0xa0 },
+  16, 0xf730, 0, {0x09,0xe2,0x0b,0x78,0x04,0xee,0xa4,0x2f,0xa4,0x8b,0xec,0x02,0xd8,0x00,0xda,0x00 },
+  16, 0xf740, 0, {0x27,0x81,0x0d,0xec,0x06,0x1b,0x00,0xea,0x04,0x3e,0x80,0x0b,0xe0,0x03,0x3b,0x00 },
+  16, 0xf750, 0, {0xce,0xc0,0x22,0x80,0x0f,0xa0,0x03,0xfa,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf760, 0, {0x48,0x00,0xe0,0x80,0xf8,0x10,0x3e,0x05,0x0e,0x88,0x03,0xe0,0x08,0x98,0x40,0x3e },
+  16, 0xf770, 0, {0x00,0x0f,0x84,0x83,0xe1,0x40,0xe8,0x00,0x3a,0x02,0x0e,0x80,0x43,0xe1,0x40,0xf8 },
+  16, 0xf780, 0, {0x00,0x36,0x00,0x0f,0x80,0x03,0xe0,0x20,0xf8,0x00,0x3e,0x00,0x0f,0x80,0x03,0xd2 },
+  16, 0xf790, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xc4,0x00,0xe9,0x00,0x3e,0x40 },
+  16, 0xf7a0, 0, {0x0c,0x90,0x03,0x04,0x20,0xe9,0x90,0x32,0x68,0x0e,0x98,0x03,0xa4,0x00,0xc1,0x00 },
+  16, 0xf7b0, 0, {0x30,0x40,0x0c,0x94,0x83,0x24,0x08,0xc9,0x00,0x3e,0x40,0x0c,0x90,0x03,0xa4,0x00 },
+  16, 0xf7c0, 0, {0xc9,0x00,0x30,0x50,0x0c,0x1a,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf7d0, 0, {0x80,0x04,0x64,0x00,0x89,0x40,0x2e,0x50,0x28,0x90,0x0a,0x24,0x08,0x89,0x06,0x16 },
+  16, 0xf7e0, 0, {0x61,0x0b,0x9c,0x02,0xe4,0x20,0xa9,0x00,0x36,0x40,0x0d,0x90,0x02,0x27,0x60,0xa9 },
+  16, 0xf7f0, 0, {0x00,0x2e,0x40,0x28,0x90,0x1a,0x24,0x00,0x89,0x00,0x36,0x40,0x28,0x98,0x02,0x20 },
+  16, 0xf800, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x2c,0x00,0xa9,0x08,0x2e,0xc2 },
+  16, 0xf810, 0, {0x09,0x10,0x00,0x24,0x00,0xa9,0x00,0x06,0x40,0x89,0x96,0x06,0xe6,0x00,0x89,0x00 },
+  16, 0xf820, 0, {0x22,0xc0,0x08,0x90,0x02,0x24,0x02,0x89,0x00,0x24,0x40,0x08,0x90,0x02,0x0c,0x06 },
+  16, 0xf830, 0, {0x83,0x00,0x22,0x40,0x08,0x90,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf840, 0, {0x08,0x04,0x05,0x00,0x81,0x44,0x2c,0x50,0x08,0x14,0x02,0x05,0x80,0x81,0x20,0x64 },
+  16, 0xf850, 0, {0x70,0x1b,0x14,0x02,0xe4,0x80,0xa1,0x20,0x64,0x40,0x19,0x12,0x0a,0x04,0x80,0xa1 },
+  16, 0xf860, 0, {0x00,0x2c,0x50,0x18,0x14,0x02,0x85,0x00,0x81,0x40,0x24,0x40,0x40,0x10,0x02,0x02 },
+  16, 0xf870, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xe0,0x00,0x3c,0x00 },
+  16, 0xf880, 0, {0x0d,0x80,0x02,0x00,0x00,0xaa,0x50,0x36,0x00,0x0f,0x80,0x03,0xe1,0x40,0xc8,0x52 },
+  16, 0xf890, 0, {0x72,0x14,0x0c,0x05,0x16,0x20,0x08,0xc8,0x50,0x3e,0x01,0x0c,0x80,0x03,0xa0,0x04 },
+  16, 0xf8a0, 0, {0xc8,0x00,0xb2,0x00,0x0c,0x80,0x0b,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf8b0, 0, {0x98,0x19,0xf5,0x02,0xfd,0x40,0x3f,0xd0,0x0f,0xd4,0x23,0xf4,0x44,0xfd,0x14,0x7f },
+  16, 0xf8c0, 0, {0x50,0x0f,0xd4,0x07,0xf4,0x40,0xf9,0x10,0x3f,0x50,0x07,0xd1,0x23,0xf4,0x40,0xf9 },
+  16, 0xf8d0, 0, {0x40,0x1e,0x50,0x07,0xd0,0x0b,0x75,0x00,0xfd,0x02,0x3e,0x50,0x0f,0xd4,0x03,0xe6 },
+  16, 0xf8e0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xf6,0x00,0xc9,0xa8,0x3e,0x72 },
+  16, 0xf8f0, 0, {0x0f,0x98,0x03,0xe6,0xc0,0xfd,0xa0,0xb3,0x40,0x0f,0xd0,0x03,0x77,0x80,0xcd,0x90 },
+  16, 0xf900, 0, {0x7f,0x40,0x0f,0xda,0xa3,0x16,0x90,0xa9,0xc0,0x32,0x60,0x4c,0xb1,0x03,0x24,0x00 },
+  16, 0xf910, 0, {0xc1,0x00,0x33,0x6a,0x0b,0xda,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf920, 0, {0x38,0x10,0xe3,0x40,0x88,0xe0,0x2e,0x30,0x0b,0x8d,0x02,0xf3,0x40,0xb8,0xe8,0x76 },
+  16, 0xf930, 0, {0x00,0x4f,0x80,0x0a,0x22,0x80,0x88,0x90,0x6e,0x28,0x8f,0x8a,0x03,0x61,0x44,0xf8 },
+  16, 0xf940, 0, {0xe1,0x3e,0x2a,0x08,0x88,0x03,0x42,0xa0,0xdc,0xa0,0x3e,0x10,0x0b,0x85,0x0a,0x0e },
+  16, 0xf950, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0xa0,0x85,0x08,0x2d,0x48 },
+  16, 0xf960, 0, {0x1b,0x52,0x82,0xd4,0x80,0xb1,0x14,0x20,0x40,0x0b,0x18,0x02,0x05,0x82,0x81,0x00 },
+  16, 0xf970, 0, {0x6c,0x42,0x0b,0x12,0x82,0x04,0x00,0xa1,0x60,0x21,0x50,0x0b,0x50,0x02,0x14,0x90 },
+  16, 0xf980, 0, {0x95,0x2c,0x28,0x40,0x0b,0x10,0x02,0x02,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf990, 0, {0x18,0x15,0xa4,0x01,0x8d,0x44,0x2f,0x40,0x0b,0xd4,0x02,0xf4,0x04,0xb9,0x08,0x22 },
+  16, 0xf9a0, 0, {0x40,0x0a,0x92,0x02,0x2c,0x84,0x89,0x00,0x2e,0x40,0x0a,0x14,0x02,0x6c,0x80,0xa9 },
+  16, 0xf9b0, 0, {0x01,0x2a,0x40,0x09,0x50,0x0a,0x5c,0x02,0x8d,0x60,0x2a,0x40,0x0b,0x90,0x42,0x06 },
+  16, 0xf9c0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe6,0x62,0xc9,0x02,0x3e,0x54 },
+  16, 0xf9d0, 0, {0x0f,0x90,0x03,0xe4,0x00,0xf9,0x40,0x22,0x46,0x0b,0x98,0x03,0x67,0x20,0xc9,0x01 },
+  16, 0xf9e0, 0, {0x2e,0x69,0x0b,0x94,0x0b,0x25,0x20,0xa9,0x00,0x22,0x40,0x2d,0x92,0x0a,0x26,0x22 },
+  16, 0xf9f0, 0, {0x99,0x00,0x2a,0x40,0x8f,0x90,0x03,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfa00, 0, {0x28,0x01,0x86,0x02,0xf9,0x00,0x3e,0x40,0x0f,0x90,0x03,0xe6,0x80,0xf1,0xa0,0x3e },
+  16, 0xfa10, 0, {0x62,0x0f,0x98,0x83,0xc6,0x20,0xf9,0x00,0x3e,0x49,0x0f,0x90,0x83,0xe4,0x00,0x71 },
+  16, 0xfa20, 0, {0x02,0x3e,0x40,0x0e,0x90,0x0b,0xe6,0x80,0xf9,0x80,0x3e,0x40,0x0f,0x90,0x03,0xca },
+  16, 0xfa30, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x10,0xc8,0x00,0x3e,0x00 },
+  16, 0xfa40, 0, {0x4f,0x80,0x43,0xb0,0x00,0xc8,0x41,0x32,0x00,0x0f,0x80,0x03,0x21,0x02,0xc8,0x02 },
+  16, 0xfa50, 0, {0x3e,0x10,0x4c,0x80,0x03,0x01,0x20,0xc8,0x00,0x3b,0x00,0x0c,0xc0,0x03,0xb0,0x00 },
+  16, 0xfa60, 0, {0xcc,0x04,0x32,0x00,0x0f,0x80,0x03,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfa70, 0, {0x28,0x05,0x28,0x00,0x8a,0x80,0x2e,0x80,0x0b,0xa0,0x02,0xf8,0x04,0x8e,0x00,0x23 },
+  16, 0xfa80, 0, {0xb2,0x0e,0xe0,0x82,0xf9,0x04,0x8a,0x00,0x2e,0x81,0x0c,0xe0,0x0a,0x3a,0x80,0xda },
+  16, 0xfa90, 0, {0x00,0x22,0xb6,0x08,0xa0,0x02,0x28,0x00,0x8e,0x00,0x2a,0x80,0x0b,0x60,0x0b,0x0a },
+  16, 0xfaa0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x44,0x02,0x93,0x81,0x2c,0xc0 },
+  16, 0xfab0, 0, {0x4b,0x30,0x02,0xc8,0x00,0x83,0xca,0x20,0xe0,0x19,0xb0,0x06,0x8c,0x00,0x81,0x04 },
+  16, 0xfac0, 0, {0x44,0x40,0x08,0x34,0x02,0x0d,0x00,0x83,0x00,0x2a,0x00,0x08,0x00,0x0a,0x80,0x40 },
+  16, 0xfad0, 0, {0x88,0x00,0x20,0xc0,0x0b,0x30,0x02,0x4b,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfae0, 0, {0xa0,0x01,0x04,0x02,0x97,0x08,0x2d,0xc0,0x0b,0x60,0x06,0xca,0x00,0x83,0x09,0x21 },
+  16, 0xfaf0, 0, {0xc0,0x0a,0x70,0x02,0xdc,0x00,0x85,0x31,0x2d,0x68,0x09,0x30,0x02,0x1c,0x14,0x93 },
+  16, 0xfb00, 0, {0x20,0x20,0xc0,0x08,0xf0,0x42,0x9c,0x02,0x8f,0x00,0x29,0x40,0x03,0x70,0x12,0x28 },
+  16, 0xfb10, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x16,0x00,0x96,0x84,0x3d,0xa0 },
+  16, 0xfb20, 0, {0x0f,0x78,0x03,0x9a,0x02,0x87,0x80,0xb1,0xe0,0x0b,0x78,0x03,0xb6,0x00,0xc5,0xa0 },
+  16, 0xfb30, 0, {0x35,0x61,0x0c,0x78,0x13,0x1e,0x02,0xc7,0x80,0x29,0x00,0x0c,0x48,0x03,0x90,0x00 },
+  16, 0xfb40, 0, {0xc4,0x80,0x31,0x60,0x0f,0x58,0x03,0x6a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfb50, 0, {0x08,0x1d,0xa4,0x00,0xea,0x00,0x3e,0x80,0x0f,0xa0,0x03,0xe8,0x08,0xfb,0x00,0x3e },
+  16, 0xfb60, 0, {0x80,0x0f,0x90,0x13,0xe4,0x08,0xf9,0x00,0x3c,0x50,0x2e,0xf0,0x03,0xe8,0x08,0xfb },
+  16, 0xfb70, 0, {0x40,0x3e,0xc0,0x0b,0x30,0x13,0x6c,0x00,0xfb,0x00,0x3e,0x40,0x0f,0x30,0x03,0xc2 },
+  16, 0xfb80, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xd6,0x00,0xcd,0x80,0x33,0xe0 },
+  16, 0xfb90, 0, {0x0c,0xf8,0x03,0xfa,0x00,0xfd,0x80,0x3f,0xa0,0x0d,0xf8,0x03,0xfa,0x40,0xcd,0xd0 },
+  16, 0xfba0, 0, {0x77,0x7e,0x0c,0xe8,0x43,0x1e,0x00,0xcf,0xd8,0x3f,0xe0,0x0c,0xc8,0x03,0x3a,0xc4 },
+  16, 0xfbb0, 0, {0xcc,0x80,0x33,0xe0,0x0c,0xf8,0x03,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfbc0, 0, {0xa8,0x11,0x94,0x02,0x8d,0x00,0x21,0xc0,0x08,0x60,0x03,0xd8,0x10,0x35,0x20,0x8b },
+  16, 0xfbd0, 0, {0xd4,0x0d,0x64,0x03,0xd8,0xc0,0x85,0x00,0x2f,0x4e,0x07,0x64,0x02,0x9c,0x02,0xd7 },
+  16, 0xfbe0, 0, {0x30,0x2f,0x04,0x0d,0xf1,0x0b,0x54,0x40,0xaf,0x00,0x35,0x40,0x08,0x70,0x02,0x2a },
+  16, 0xfbf0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0x40,0x84,0x18,0x21,0x80 },
+  16, 0xfc00, 0, {0x08,0x70,0x02,0xda,0x20,0xb5,0x00,0x09,0x00,0x08,0x70,0x02,0xd4,0x04,0x85,0x00 },
+  16, 0xfc10, 0, {0x6d,0x4c,0x89,0x60,0x02,0x5c,0x40,0x97,0x00,0x6d,0xc0,0x09,0x40,0x02,0x58,0x80 },
+  16, 0xfc20, 0, {0x84,0x88,0x25,0x40,0x08,0xd0,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfc30, 0, {0x20,0x14,0xc6,0x48,0x80,0x00,0x20,0x80,0x08,0xac,0x02,0xa8,0x00,0xb1,0x00,0xa8 },
+  16, 0xfc40, 0, {0x88,0x09,0x22,0x02,0x86,0x42,0x81,0x00,0x6c,0x52,0x0b,0x20,0x02,0xc7,0x52,0x83 },
+  16, 0xfc50, 0, {0x00,0x2c,0x00,0x08,0x34,0x82,0x67,0x00,0xa3,0x80,0x20,0x40,0x08,0x30,0x02,0x08 },
+  16, 0xfc60, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xa3,0x00,0xcb,0xc0,0xb2,0x40 },
+  16, 0xfc70, 0, {0x2c,0x90,0x82,0xe6,0x00,0xbb,0x80,0xbe,0x78,0x08,0x8e,0x02,0xee,0x00,0x8d,0x00 },
+  16, 0xfc80, 0, {0x27,0x60,0x0d,0x90,0x0a,0x6f,0x00,0x9f,0x02,0x2e,0x00,0x09,0xb4,0x03,0x67,0x80 },
+  16, 0xfc90, 0, {0xca,0x40,0xe4,0xc0,0x0c,0x30,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfca0, 0, {0x80,0x00,0xe0,0x80,0xfb,0x22,0x3e,0x40,0x0f,0x80,0x13,0xe4,0x00,0xfb,0x80,0x3e },
+  16, 0xfcb0, 0, {0x40,0x0f,0x90,0x03,0xe5,0x00,0xf9,0x00,0x3e,0x40,0x0e,0x70,0x23,0xac,0x20,0xfb },
+  16, 0xfcc0, 0, {0x00,0x3e,0xc0,0x8f,0x80,0x03,0xe9,0x20,0xf9,0x08,0x3e,0x40,0x0f,0xb0,0x13,0xe0 },
+  16, 0xfcd0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xf0,0x00,0xc6,0x00,0x32,0x00 },
+  16, 0xfce0, 0, {0x0f,0xd1,0x83,0x34,0x40,0xcf,0x00,0x3d,0x40,0x0c,0xd0,0x03,0xde,0x50,0x0d,0x00 },
+  16, 0xfcf0, 0, {0x73,0x40,0x0c,0xd1,0x03,0x7c,0x40,0x87,0x02,0xb3,0x00,0x0d,0xf4,0x03,0x24,0x00 },
+  16, 0xfd00, 0, {0xce,0x20,0x32,0x40,0x0c,0xd0,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfd10, 0, {0x81,0x04,0x61,0x22,0x8a,0x00,0x22,0x00,0x0b,0x80,0x40,0x25,0x00,0x89,0xc3,0x2e },
+  16, 0xfd20, 0, {0x20,0x0a,0x98,0x03,0xa1,0x00,0x89,0x00,0x36,0x40,0x88,0x94,0x02,0x0f,0x01,0xab },
+  16, 0xfd30, 0, {0x00,0x32,0xc0,0x08,0x04,0x0a,0x29,0x00,0xa9,0x02,0xa2,0x40,0x0d,0xb0,0x0a,0x20 },
+  16, 0xfd40, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x00,0x00,0x89,0x00,0x22,0x61 },
+  16, 0xfd50, 0, {0x0b,0x90,0x02,0x25,0x01,0x9b,0x88,0x2e,0x60,0x08,0x88,0x02,0xe8,0x00,0xb1,0x02 },
+  16, 0xfd60, 0, {0x24,0x40,0x18,0x90,0x02,0x2c,0x00,0xab,0x01,0x20,0xc1,0x08,0xb4,0x42,0x2c,0x00 },
+  16, 0xfd70, 0, {0x82,0x00,0x22,0xc0,0x08,0xb0,0x02,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfd80, 0, {0x08,0x04,0x00,0x00,0x01,0x00,0x20,0x40,0x0b,0x00,0x0a,0x04,0x46,0x83,0x01,0x2c },
+  16, 0xfd90, 0, {0x40,0x1a,0x00,0x06,0x80,0x00,0x81,0x00,0x24,0x40,0x08,0x20,0x0a,0x0c,0x01,0xa3 },
+  16, 0xfda0, 0, {0x00,0x24,0x00,0x08,0x80,0x02,0x00,0x00,0xa1,0x00,0x20,0x40,0x09,0x30,0x02,0x02 },
+  16, 0xfdb0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x60,0x02,0xc8,0x00,0x22,0x00 },
+  16, 0xfdc0, 0, {0x0f,0x90,0x02,0x25,0x00,0xda,0x00,0x3e,0x40,0x0c,0x90,0x02,0xcc,0x00,0xfd,0x00 },
+  16, 0xfdd0, 0, {0x37,0x40,0x0c,0x10,0x13,0x2c,0x02,0xaf,0x00,0x32,0xc0,0x0d,0xb0,0x03,0x2c,0x00 },
+  16, 0xfde0, 0, {0xca,0x00,0x32,0x40,0x4c,0x90,0x0b,0x00,0x01,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfdf0, 0, {0xa0,0x1d,0xf0,0x00,0xfc,0x00,0x3f,0x00,0x07,0xc0,0x03,0xf4,0x1c,0xf4,0x00,0x3f },
+  16, 0xfe00, 0, {0x00,0x1f,0xc0,0x23,0xb0,0x02,0x9d,0x01,0x3f,0x40,0x8f,0xc0,0x07,0xfc,0x02,0xff },
+  16, 0xfe10, 0, {0x00,0x7b,0x00,0x0f,0xc0,0x03,0xf0,0x00,0xfd,0x00,0x3f,0x40,0x0f,0x70,0x03,0xe8 },
+  16, 0xfe20, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfa,0x00,0xcb,0x80,0x3f,0x24 },
+  16, 0xfe30, 0, {0x0a,0xc1,0x03,0xfc,0x24,0xcd,0x20,0x37,0x0a,0x0c,0xc2,0x83,0x30,0x80,0xdc,0x02 },
+  16, 0xfe40, 0, {0x3f,0xcc,0x0d,0xd9,0x03,0x3c,0x58,0xdf,0x30,0x33,0xc8,0x0d,0xf4,0x23,0x3c,0x40 },
+  16, 0xfe50, 0, {0xff,0x00,0x3f,0xc5,0x4f,0xf0,0x23,0xb0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfe60, 0, {0x80,0x00,0xec,0x02,0x0b,0x82,0x2e,0x08,0x0d,0xb7,0x02,0xfd,0x00,0x83,0x18,0x0a },
+  16, 0xfe70, 0, {0x58,0x0a,0x84,0xa2,0xa5,0xa0,0x89,0x30,0x22,0x55,0x08,0x12,0x62,0xbd,0x90,0x8f },
+  16, 0xfe80, 0, {0x62,0x21,0xd6,0x48,0xf3,0x02,0x3c,0xc5,0xbf,0x48,0x2f,0xd8,0x4b,0xb7,0x02,0xe0 },
+  16, 0xfe90, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xec,0x00,0x83,0x00,0x2e,0x89 },
+  16, 0xfea0, 0, {0x28,0x00,0x02,0xec,0xa0,0x89,0x22,0x28,0x82,0x08,0x12,0x02,0x28,0x40,0x9a,0x08 },
+  16, 0xfeb0, 0, {0x28,0xc8,0x88,0xb2,0x0a,0x0d,0x10,0x93,0x10,0xa0,0xc8,0x28,0x30,0x02,0x4c,0x00 },
+  16, 0xfec0, 0, {0xb3,0x60,0x2c,0xc4,0x0b,0x30,0xc2,0xe2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfed0, 0, {0xc0,0x15,0xac,0x40,0x8b,0x00,0x2e,0x80,0x08,0xb1,0x02,0xec,0x02,0x8b,0x00,0x20 },
+  16, 0xfee0, 0, {0xd0,0x0a,0x90,0x02,0xac,0x00,0x0b,0x01,0x26,0x40,0x08,0x94,0x02,0x8c,0x00,0x8b },
+  16, 0xfef0, 0, {0x00,0x22,0xc0,0x08,0xb0,0x02,0x2c,0x10,0xbb,0x00,0x2e,0xc0,0x0b,0xb0,0x02,0xf0 },
+  16, 0xff00, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x8c,0x20,0xcb,0x02,0x3e,0x2d },
+  16, 0xff10, 0, {0x08,0x80,0x03,0xec,0x08,0xc9,0x80,0x1e,0x04,0x0c,0xb0,0x03,0x01,0x08,0x50,0x18 },
+  16, 0xff20, 0, {0x3e,0x40,0x0c,0x04,0x03,0x2c,0x00,0xdb,0x01,0x32,0xc0,0x0c,0xb0,0x0b,0x2c,0x08 },
+  16, 0xff30, 0, {0xbb,0x00,0x3e,0xc0,0x0f,0xb0,0x03,0x80,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xff40, 0, {0xe1,0x00,0xbc,0x00,0xff,0x00,0x3f,0x60,0x0f,0xc0,0x23,0xec,0x00,0xff,0xc0,0xbe },
+  16, 0xff50, 0, {0x60,0x8f,0xc9,0x23,0xf6,0x50,0xed,0x80,0xb8,0x50,0xaf,0xc0,0x03,0xfc,0x00,0xff },
+  16, 0xff60, 0, {0x00,0x3f,0xc1,0x0e,0xb0,0x03,0xfc,0x04,0xff,0x02,0x3f,0xc0,0x0f,0xf0,0x03,0xf8 },
+  16, 0xff70, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xeb,0x00,0x32,0x80 },
+  16, 0xff80, 0, {0x0d,0x90,0x03,0x2c,0x00,0x89,0x00,0x3e,0x98,0x8c,0x30,0x03,0x61,0x80,0xfa,0x40 },
+  16, 0xff90, 0, {0x3e,0x40,0x2c,0xa5,0x03,0x2c,0x00,0xfb,0x01,0x3c,0xc0,0x2c,0x30,0x03,0x2c,0x00 },
+  16, 0xffa0, 0, {0xdb,0x02,0x32,0xc0,0x0f,0xb0,0x03,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xffb0, 0, {0xca,0x00,0x2e,0x80,0x8b,0x82,0xa0,0xc0,0x8c,0x90,0x02,0x3c,0x00,0x8b,0xf0,0x22 },
+  16, 0xffc0, 0, {0xc2,0x0d,0x80,0x02,0x27,0x00,0x8b,0x10,0x22,0x40,0x08,0x80,0x22,0x3c,0x00,0xbf },
+  16, 0xffd0, 0, {0x00,0x2f,0xc0,0x08,0xf0,0x02,0x3c,0x00,0xbf,0x01,0xa3,0xc0,0x0b,0xf0,0x12,0xf2 },
+  16, 0xffe0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x00,0xb3,0x1c,0x20,0x40 },
+  16, 0xfff0, 0, {0x08,0x00,0x06,0x2c,0x00,0x9b,0x00,0x20,0xd0,0x08,0x20,0x02,0x4c,0x00,0xa3,0x00 },
+  16, 0x8010, 0, {0x2c,0xc0,0x08,0x10,0x0a,0x0c,0x00,0xbb,0x00,0x28,0xc0,0x09,0x30,0x02,0x0c,0x00 },
+  16, 0x8020, 0, {0xb3,0x00,0x20,0xc0,0x0b,0x30,0x02,0xf8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8030, 0, {0x22,0x11,0x1e,0x00,0x97,0xa0,0x21,0xa0,0x08,0x79,0x02,0x1e,0x00,0x97,0x90,0x21 },
+  16, 0x8040, 0, {0x60,0x09,0xe8,0x22,0x3e,0x00,0xaf,0x84,0x21,0xe4,0x48,0x5c,0x02,0x1e,0x00,0xb7 },
+  16, 0x8050, 0, {0x90,0x2d,0xe0,0x09,0x78,0x00,0x1e,0x09,0xb3,0x90,0x21,0xe4,0x0b,0x78,0x02,0xd8 },
+  16, 0x8060, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x18,0x2c,0x40,0xb3,0xb0,0x32,0x40 },
+  16, 0x8070, 0, {0x2c,0x81,0x13,0x0c,0x42,0xd1,0x00,0xb0,0xc0,0x8c,0x30,0x03,0x48,0x20,0xe3,0x01 },
+  16, 0x8080, 0, {0x3c,0xc0,0x0c,0x30,0x03,0x0c,0x00,0xf3,0x10,0x3c,0xc0,0xcd,0x32,0x0b,0x0c,0x40 },
+  16, 0x8090, 0, {0xd3,0x00,0x30,0xc0,0x0f,0x30,0x03,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x80a0, 0, {0x40,0x15,0xbc,0x00,0xe7,0x00,0x3f,0x80,0x0b,0xf1,0x03,0xfd,0x00,0x6d,0x00,0x32 },
+  16, 0x80b0, 0, {0x40,0x1f,0x70,0x07,0xd8,0x41,0xc3,0x10,0x3b,0xc0,0x0f,0xd1,0x03,0xfd,0x00,0xff },
+  16, 0x80c0, 0, {0x10,0x3f,0xc0,0x0e,0xf0,0x03,0xec,0x10,0xff,0x08,0x3f,0xc3,0x0f,0xf0,0x03,0xd0 },
+  16, 0x80d0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xec,0x04,0xfb,0x02,0x3e,0x40 },
+  16, 0x80e0, 0, {0x0b,0xa0,0x03,0xac,0x00,0xdb,0x00,0x36,0x80,0x0d,0xb0,0x03,0xac,0x00,0xe8,0x00 },
+  16, 0x80f0, 0, {0x36,0xc1,0x2e,0x90,0x03,0x2c,0x00,0xcb,0xa0,0x36,0xdc,0x0f,0xb0,0x03,0x2d,0x68 },
+  16, 0x8100, 0, {0xfb,0xa0,0x92,0xc2,0x0c,0xb1,0x03,0xea,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8110, 0, {0x48,0x11,0x9c,0x08,0x37,0x00,0x2d,0xc0,0x0b,0xe0,0x02,0x1d,0x80,0xb7,0x04,0x23 },
+  16, 0x8120, 0, {0x00,0x0a,0x40,0x02,0x1c,0x18,0x84,0x00,0x25,0xc0,0x18,0x50,0x32,0x0d,0x80,0xa3 },
+  16, 0x8130, 0, {0x30,0x21,0xcc,0x0b,0x34,0x82,0x1c,0x10,0xb7,0x30,0x21,0xc8,0x08,0x70,0x02,0xd2 },
+  16, 0x8140, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x20,0xb7,0x80,0x2d,0x60 },
+  16, 0x8150, 0, {0x0b,0xfc,0x22,0x9e,0x00,0x8d,0x80,0x25,0xa0,0x08,0xf8,0x22,0x92,0x00,0xb4,0x80 },
+  16, 0x8160, 0, {0x25,0xe0,0x08,0xf8,0x02,0x1e,0x00,0x87,0xb0,0x21,0xe0,0x09,0x7a,0x02,0x1e,0x18 },
+  16, 0x8170, 0, {0xb3,0x80,0x21,0xe0,0x08,0x78,0x02,0xf0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8180, 0, {0x48,0x04,0xc5,0x20,0xb3,0x01,0x2c,0xd8,0x0b,0x3c,0x02,0x2c,0x08,0xb9,0x00,0x20 },
+  16, 0x8190, 0, {0x03,0x0a,0x00,0x82,0x22,0x08,0x90,0x0d,0x26,0xe4,0x08,0x10,0x02,0x0c,0x00,0xa3 },
+  16, 0x81a0, 0, {0x00,0x22,0xc0,0x0b,0x30,0x02,0x6c,0x00,0xb3,0x00,0x22,0xc0,0x28,0x30,0x02,0xc2 },
+  16, 0x81b0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x05,0x99,0x00,0xfa,0x02,0x3f,0x90 },
+  16, 0x81c0, 0, {0x0f,0xec,0x23,0xa8,0x00,0xda,0x00,0x35,0x80,0x0d,0xe0,0x02,0xba,0x02,0xfe,0xc2 },
+  16, 0x81d0, 0, {0xb6,0xa0,0x0e,0xe4,0x0b,0x28,0x00,0xca,0x00,0xb2,0x80,0x0f,0xa0,0x0b,0x28,0x00 },
+  16, 0x81e0, 0, {0xfa,0x00,0x32,0x80,0x0c,0xa0,0x03,0xfa,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x81f0, 0, {0x48,0x00,0xe0,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x82,0x03,0xe0,0x00,0xf8,0x00,0x3e },
+  16, 0x8200, 0, {0x00,0x0f,0x81,0x03,0xe0,0x40,0xe8,0x10,0x3a,0x00,0x4f,0x84,0x83,0xe0,0x00,0xf8 },
+  16, 0x8210, 0, {0x00,0x3a,0x00,0x0f,0x00,0x03,0xa0,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x80,0x03,0xd2 },
+  16, 0x8220, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0xe5,0x00,0xc9,0x02,0x3e,0x40 },
+  16, 0x8230, 0, {0x0f,0x90,0x23,0x24,0x00,0xc9,0x00,0x32,0x68,0x2f,0x10,0x03,0x24,0x00,0xe9,0x14 },
+  16, 0x8240, 0, {0x32,0x40,0x0d,0x90,0x0b,0x04,0x00,0xd9,0x00,0x1e,0x40,0x0c,0x90,0x03,0x24,0x00 },
+  16, 0x8250, 0, {0xc9,0x00,0x36,0x40,0x0c,0x90,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8260, 0, {0x80,0x14,0x64,0x00,0x89,0x01,0x2e,0x40,0x4b,0x90,0x12,0x24,0x00,0x89,0xc2,0xa2 },
+  16, 0x8270, 0, {0x60,0x88,0x90,0x03,0x64,0x00,0x89,0xc1,0xa2,0x40,0x48,0x16,0x03,0x64,0x02,0x89 },
+  16, 0x8280, 0, {0x00,0x2e,0x40,0x08,0x90,0x22,0x24,0x00,0x89,0x00,0x3e,0x40,0x28,0x90,0x0a,0x20 },
+  16, 0x8290, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x04,0x24,0x00,0x89,0x02,0x2e,0x40 },
+  16, 0x82a0, 0, {0x0b,0x10,0x02,0x24,0x00,0x89,0x10,0x22,0x40,0x89,0x90,0x02,0xac,0x00,0xa1,0x08 },
+  16, 0x82b0, 0, {0x22,0x40,0x09,0x98,0x02,0xa4,0x00,0x89,0x00,0x2a,0x40,0x08,0x90,0x02,0x24,0x00 },
+  16, 0x82c0, 0, {0x89,0x00,0x26,0x40,0x08,0x10,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x82d0, 0, {0x08,0x00,0x24,0x00,0x81,0x00,0x2c,0x41,0x0b,0x12,0x02,0x04,0x81,0x81,0x20,0x22 },
+  16, 0x82e0, 0, {0x48,0x08,0x12,0x02,0xc4,0x81,0x81,0x24,0x02,0x48,0x0a,0x90,0x02,0x84,0xa0,0x81 },
+  16, 0x82f0, 0, {0x28,0x6c,0x4a,0x08,0x12,0xd2,0x04,0xa1,0x81,0x28,0x2c,0x4a,0x08,0x12,0x82,0x02 },
+  16, 0x8300, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x08,0x61,0x40,0xc8,0x00,0x2e,0x14 },
+  16, 0x8310, 0, {0x0f,0x85,0x0b,0x21,0x42,0xca,0x50,0x22,0x14,0x0d,0x85,0x43,0xa1,0x40,0xe8,0x50 },
+  16, 0x8320, 0, {0x30,0x00,0x0d,0x85,0x02,0xa1,0xc0,0xd8,0x20,0x3a,0x08,0x2c,0x82,0x0b,0x20,0x82 },
+  16, 0x8330, 0, {0xc8,0x20,0x34,0x09,0x8c,0x82,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8340, 0, {0x98,0x0d,0xfc,0x02,0xf9,0x00,0x3f,0x40,0x4f,0xd1,0x03,0xe4,0x40,0xf5,0x14,0xbf },
+  16, 0x8350, 0, {0x44,0x0d,0x51,0x23,0x5c,0x40,0xf5,0x10,0x1f,0x4e,0x4d,0x50,0x03,0x64,0x08,0xf9 },
+  16, 0x8360, 0, {0x28,0x3e,0x4a,0x8f,0x92,0x83,0xe4,0xa0,0xf9,0x28,0x3a,0x4b,0x0f,0x92,0x83,0xe6 },
+  16, 0x8370, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xf4,0x40,0xfd,0x00,0x30,0x40 },
+  16, 0x8380, 0, {0x0c,0x90,0x03,0x24,0x00,0xdd,0x00,0x3b,0x40,0x0e,0x90,0x03,0x74,0x00,0x5d,0x00 },
+  16, 0x8390, 0, {0x36,0x64,0x0d,0xd0,0x00,0xa6,0x00,0xf9,0x40,0x32,0x78,0x0c,0x99,0x03,0x24,0x40 },
+  16, 0x83a0, 0, {0xc9,0x90,0x32,0x50,0x0f,0x9b,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x83b0, 0, {0x38,0x10,0xe2,0x80,0xb8,0x00,0x22,0x01,0x08,0x80,0x0a,0x20,0x00,0x88,0x00,0x2a },
+  16, 0x83c0, 0, {0x00,0x08,0x80,0x02,0x20,0x00,0x88,0x00,0x22,0x20,0x08,0x8a,0x8b,0xe1,0x00,0xb8 },
+  16, 0x83d0, 0, {0x80,0x22,0x30,0x28,0x0d,0x02,0x22,0x00,0xd8,0xe4,0x22,0x28,0x0b,0x8f,0x0a,0x0e },
+  16, 0x83e0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x80,0xb1,0x00,0xa0,0x40 },
+  16, 0x83f0, 0, {0x08,0x10,0x02,0x04,0x00,0x89,0x00,0x08,0x40,0x0a,0x90,0x42,0x44,0x00,0x91,0x00 },
+  16, 0x8400, 0, {0x20,0x58,0x28,0x90,0x02,0x85,0x00,0x81,0x20,0xa0,0x4c,0x09,0x12,0x0a,0x04,0x80 },
+  16, 0x8410, 0, {0x91,0x40,0xa0,0x40,0x0b,0x10,0x02,0x02,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8420, 0, {0x18,0x15,0xa4,0x00,0xb9,0x02,0x20,0x40,0x08,0x90,0x02,0x04,0x00,0x89,0x01,0x22 },
+  16, 0x8430, 0, {0x40,0x28,0x90,0x22,0x04,0x00,0x89,0x10,0x22,0x40,0x08,0x90,0x02,0xe4,0x00,0xb1 },
+  16, 0x8440, 0, {0x00,0x22,0x40,0x81,0x90,0x02,0x04,0x00,0x91,0x00,0x22,0x40,0x0b,0x90,0x02,0x06 },
+  16, 0x8450, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe5,0x00,0xf1,0x00,0x32,0x60 },
+  16, 0x8460, 0, {0x2c,0x92,0x13,0x24,0x02,0xd1,0x10,0x3a,0x40,0x0e,0x12,0x03,0x66,0x04,0xd9,0x00 },
+  16, 0x8470, 0, {0xb6,0x40,0x0d,0x19,0x03,0xa4,0x00,0xf9,0x00,0x32,0x40,0x09,0x90,0x01,0x24,0x00 },
+  16, 0x8480, 0, {0xd9,0x02,0x22,0x40,0x0f,0x90,0x03,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8490, 0, {0x2a,0x01,0xa5,0x00,0xf9,0x00,0x3e,0x64,0x0f,0x10,0x03,0xe4,0x00,0xf9,0x81,0x3e },
+  16, 0x84a0, 0, {0x66,0x8f,0x90,0x23,0xe4,0x80,0xf9,0x04,0x3e,0x40,0x8f,0x90,0x03,0xe4,0x04,0xf9 },
+  16, 0x84b0, 0, {0x00,0x3c,0x40,0x0e,0x90,0x03,0xe4,0x00,0xf9,0x00,0x3e,0x40,0x0f,0x10,0x03,0xca },
+  16, 0x84c0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x2a,0x10,0xa0,0x00,0xf8,0x24,0x3e,0x00 },
+  16, 0x84d0, 0, {0x2c,0x84,0x03,0x20,0x00,0xb8,0x20,0x3e,0x00,0x8c,0x80,0x03,0xa0,0x00,0x70,0x82 },
+  16, 0x84e0, 0, {0x32,0x00,0x0f,0x80,0x03,0x20,0x08,0xf8,0x00,0x32,0x00,0x2c,0x80,0x0b,0x20,0x08 },
+  16, 0x84f0, 0, {0xc8,0x00,0x3e,0x00,0x0c,0x80,0x03,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8500, 0, {0x28,0x05,0x28,0x04,0xbe,0x80,0x3a,0x80,0x08,0xa0,0x02,0x28,0x04,0x8e,0x00,0x6d },
+  16, 0x8510, 0, {0x90,0x0d,0xa0,0x02,0x3a,0x00,0x8e,0x80,0xa2,0x80,0x0e,0xe0,0x0b,0x68,0x00,0xba },
+  16, 0x8520, 0, {0x00,0x22,0x80,0x08,0xa0,0x02,0x28,0x00,0xda,0x00,0x2e,0x80,0x08,0xa0,0x02,0xca },
+  16, 0x8530, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x81,0x4c,0x00,0xb1,0x00,0x2c,0xc0 },
+  16, 0x8540, 0, {0x08,0x30,0x02,0x0c,0x18,0xa3,0x02,0x2c,0x10,0x88,0x30,0x06,0x82,0x81,0xa0,0x00 },
+  16, 0x8550, 0, {0x2a,0xc0,0x0b,0x30,0x0a,0x4c,0x00,0xb3,0x00,0x20,0xc0,0x1a,0xb0,0x02,0x8c,0x01 },
+  16, 0x8560, 0, {0x83,0x00,0x2c,0xc0,0x08,0x30,0x02,0xca,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8570, 0, {0x20,0x01,0x1c,0x10,0xb4,0x0a,0x2b,0xc8,0x08,0x31,0x26,0x1c,0x00,0x86,0x00,0x2d },
+  16, 0x8580, 0, {0xc0,0x09,0x72,0x02,0x1d,0x00,0xa5,0x40,0x29,0xc0,0x0a,0x60,0x02,0x5c,0x88,0xb3 },
+  16, 0x8590, 0, {0x20,0x25,0xc8,0x0a,0x72,0x02,0x9c,0x80,0x97,0x20,0x2c,0xe8,0x80,0x72,0x02,0xe8 },
+  16, 0x85a0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x08,0x16,0x00,0xb5,0x80,0x3d,0xe2 },
+  16, 0x85b0, 0, {0x0c,0x7a,0x8b,0x0e,0xc0,0xa7,0x81,0x2c,0x20,0x0c,0xfc,0x03,0x92,0x02,0xef,0x80 },
+  16, 0x85c0, 0, {0x39,0xe4,0x0b,0xd8,0x01,0x1f,0x00,0xf7,0x80,0xb3,0xf4,0x8e,0x79,0x03,0x8e,0x00 },
+  16, 0x85d0, 0, {0xc7,0xc4,0x3d,0xe8,0x2c,0x7b,0x03,0xea,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x85e0, 0, {0x08,0x1d,0xac,0x00,0xf8,0x00,0x3e,0xdd,0x87,0xb6,0x03,0xed,0xcc,0xe9,0x00,0x3e },
+  16, 0x85f0, 0, {0x40,0x0f,0xb0,0x07,0xcc,0x10,0x0b,0x00,0x36,0xd8,0x0f,0x80,0x43,0xad,0x80,0xfb },
+  16, 0x8600, 0, {0x28,0x3a,0xc0,0x0d,0xb4,0x03,0x6c,0xe2,0xeb,0x60,0x3e,0xd4,0x0f,0xb0,0x03,0xc2 },
+  16, 0x8610, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xfe,0x00,0xfe,0x90,0x3f,0xe5 },
+  16, 0x8620, 0, {0x0e,0xf8,0x03,0x3e,0x10,0xff,0x90,0x17,0x60,0x0f,0xfc,0x03,0x7a,0x00,0xee,0x80 },
+  16, 0x8630, 0, {0x37,0xe2,0x0e,0x78,0x0f,0xff,0x40,0xef,0x88,0x1f,0xe0,0x0c,0xf8,0x83,0xfe,0x80 },
+  16, 0x8640, 0, {0xcf,0xd0,0xb3,0xf0,0x0c,0xf8,0xc3,0x10,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8650, 0, {0xa8,0x11,0x9c,0x40,0xb4,0x10,0x0f,0xcc,0x00,0x72,0x02,0x1c,0x00,0xb6,0x02,0x09 },
+  16, 0x8660, 0, {0xc0,0x28,0xf0,0x02,0x98,0x00,0xa6,0x00,0x21,0xc0,0x0b,0x60,0x03,0xfc,0x02,0x87 },
+  16, 0x8670, 0, {0x00,0x2d,0xc0,0x08,0x70,0x02,0xde,0x00,0x8f,0x10,0x21,0xc0,0x08,0xf0,0x03,0x6a },
+  16, 0x8680, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x94,0x00,0xb6,0x02,0x2f,0xc2 },
+  16, 0x8690, 0, {0x1a,0x30,0x80,0x1c,0x00,0xb6,0x08,0x01,0x40,0x0a,0xf0,0x02,0x18,0x00,0x87,0x00 },
+  16, 0x86a0, 0, {0x21,0xc0,0x0b,0xd0,0x02,0x9c,0x10,0x87,0x00,0x29,0xc0,0x08,0x70,0x02,0xdc,0x44 },
+  16, 0x86b0, 0, {0x87,0x10,0x64,0xc0,0x08,0x70,0x02,0x06,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x86c0, 0, {0x60,0x14,0xce,0x60,0xb0,0x00,0x2c,0xc0,0x08,0x34,0x0a,0x0c,0x08,0xb0,0x04,0x00 },
+  16, 0x86d0, 0, {0x40,0x08,0x30,0xa2,0x89,0x80,0xa2,0x62,0x20,0xe0,0x0b,0x00,0x0a,0xcc,0x08,0x83 },
+  16, 0x86e0, 0, {0x00,0x6c,0xc0,0x08,0x30,0x52,0xcc,0x00,0x83,0x00,0x24,0xc0,0x08,0x30,0x02,0x58 },
+  16, 0x86f0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xae,0x00,0xf8,0x00,0x3f,0xd0 },
+  16, 0x8700, 0, {0x0e,0xfc,0x03,0x3c,0x00,0xf9,0x00,0x92,0x84,0x0f,0xfc,0x03,0x64,0x00,0x80,0x00 },
+  16, 0x8710, 0, {0xb7,0xc3,0x0f,0xb8,0x83,0xbc,0x04,0xef,0x00,0x3f,0xc0,0x3c,0xf0,0x03,0xfc,0x02 },
+  16, 0x8720, 0, {0xcf,0x00,0x37,0xc0,0x28,0xf0,0x13,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8730, 0, {0x80,0x00,0xec,0x00,0xf8,0x41,0x3e,0xc8,0x0f,0x32,0x03,0xec,0x00,0xf8,0x00,0x3a },
+  16, 0x8740, 0, {0xc4,0x0f,0xb1,0x03,0xc4,0x00,0xf9,0x00,0x36,0xc0,0x0f,0xe4,0x0b,0xec,0x04,0xfb },
+  16, 0x8750, 0, {0x00,0x3e,0xc1,0x0f,0xb0,0x43,0xec,0x04,0xfb,0x00,0x3a,0xc0,0x0f,0xb0,0x03,0xe4 },
+  16, 0x8760, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xf4,0x00,0xfc,0x80,0x3f,0xc0 },
+  16, 0x8770, 0, {0x1f,0xf0,0x03,0x3c,0x08,0xfb,0x00,0x33,0x80,0x2e,0xf0,0x13,0xa4,0x04,0xcb,0x00 },
+  16, 0x8780, 0, {0xb9,0xc0,0x2c,0xd8,0x0b,0x3c,0x00,0xff,0x00,0x3f,0xc0,0x09,0x70,0x00,0x2c,0x04 },
+  16, 0x8790, 0, {0xff,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0xc0,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x87a0, 0, {0xc1,0x00,0x6c,0x00,0xb8,0x80,0x2e,0xc0,0x0b,0xb0,0x03,0x6c,0x00,0xb9,0x16,0x28 },
+  16, 0x87b0, 0, {0x72,0x08,0xb0,0x22,0x27,0x40,0xdb,0x00,0x22,0xc0,0x08,0xbd,0x82,0x2c,0x08,0xbb },
+  16, 0x87c0, 0, {0x00,0x2e,0xc0,0x48,0xb0,0x02,0x2c,0x00,0xbb,0x00,0x2e,0xc1,0x0b,0xb0,0x02,0xe0 },
+  16, 0x87d0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0xb8,0x60,0x2e,0xc0 },
+  16, 0x87e0, 0, {0x0b,0xb0,0x02,0x2c,0x00,0xb1,0x00,0x2a,0x84,0x4a,0x30,0x22,0xac,0x20,0x98,0x80 },
+  16, 0x87f0, 0, {0x2a,0xc0,0x08,0x30,0x02,0xac,0x00,0x3b,0x00,0x2c,0xc0,0x0a,0xb0,0x02,0xac,0x08 },
+  16, 0x8800, 0, {0xbb,0x00,0x2e,0xc0,0x0b,0xb0,0x42,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8810, 0, {0x08,0x04,0x0c,0x01,0xb0,0x00,0x2c,0xc0,0x0b,0x30,0x02,0x4c,0x04,0xb0,0x00,0x2a },
+  16, 0x8820, 0, {0x80,0x08,0x30,0x02,0x00,0x00,0x10,0x04,0x28,0xc0,0x08,0x20,0x42,0x8c,0x00,0xb3 },
+  16, 0x8830, 0, {0x00,0x2c,0xc0,0x42,0x30,0x0a,0x8c,0x00,0xb3,0x00,0x2c,0xc0,0x8b,0x30,0x02,0xc2 },
+  16, 0x8840, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x64,0x00,0xf8,0x50,0x3f,0xc0 },
+  16, 0x8850, 0, {0x0b,0xf0,0x03,0x3c,0x00,0xfa,0x04,0x32,0x80,0x0e,0xf0,0x23,0xac,0x00,0xd9,0x00 },
+  16, 0x8860, 0, {0x3b,0xc0,0x0c,0x90,0x03,0xbc,0x04,0xff,0x00,0x3d,0xc0,0x2e,0xf0,0x0b,0x3c,0x00 },
+  16, 0x8870, 0, {0xff,0x04,0x3f,0xc0,0x0f,0xf0,0x03,0xc0,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8880, 0, {0xa0,0x1d,0xfc,0x00,0xfc,0x00,0x3f,0xc0,0x07,0xf0,0x03,0xfc,0x04,0x7c,0x02,0xb5 },
+  16, 0x8890, 0, {0x00,0x0f,0xf0,0x03,0xf0,0x00,0xfc,0x00,0x37,0xc0,0x0f,0xf0,0x13,0x7c,0x00,0xff },
+  16, 0x88a0, 0, {0x00,0x3f,0xc0,0x0d,0xf0,0x03,0x6d,0x00,0xff,0x00,0x3f,0xc0,0x1f,0xf0,0x03,0xe8 },
+  16, 0x88b0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xd2,0x00,0xd5,0x80,0x33,0x0a },
+  16, 0x88c0, 0, {0x4c,0xf8,0x03,0xf2,0x00,0xfc,0x00,0x37,0x26,0x1f,0xca,0x03,0xbc,0xc4,0xcf,0x20 },
+  16, 0x88d0, 0, {0x33,0xe4,0x0f,0x78,0x03,0x3e,0x44,0xcf,0x00,0x3b,0xce,0x9f,0x68,0x13,0xd0,0x00 },
+  16, 0x88e0, 0, {0xcd,0x80,0xb3,0x60,0x0f,0xfa,0x83,0xf0,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x88f0, 0, {0x80,0x10,0xe0,0x80,0xc9,0x28,0x22,0x30,0x08,0xb2,0x22,0xea,0x01,0xb8,0x82,0x20 },
+  16, 0x8900, 0, {0x50,0x4f,0x9c,0x00,0xa8,0xd1,0xdb,0x10,0xa6,0xe0,0x17,0xb8,0x03,0xec,0x80,0xdb },
+  16, 0x8910, 0, {0x08,0x1f,0xd0,0x0b,0xb8,0x02,0xf6,0x00,0xfb,0x80,0x22,0x40,0x0b,0xb0,0x02,0x60 },
+  16, 0x8920, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xc4,0x20,0x81,0x80,0x20,0x00 },
+  16, 0x8930, 0, {0x8b,0x30,0x82,0xc0,0x00,0xb0,0x10,0x28,0x08,0x8b,0x11,0x30,0xc4,0x84,0x90,0x28 },
+  16, 0x8940, 0, {0x24,0xc8,0x0b,0x30,0x02,0x4c,0x00,0x83,0x10,0x04,0xc8,0x0b,0x30,0x02,0xcc,0x00 },
+  16, 0x8950, 0, {0xb3,0x00,0x24,0x40,0x0b,0x30,0x02,0xe2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8960, 0, {0xc0,0x15,0xa6,0x00,0x81,0x00,0x22,0x10,0x0b,0xb0,0x12,0xea,0x20,0xbb,0x00,0x2a },
+  16, 0x8970, 0, {0x70,0x0a,0x9c,0x02,0x62,0x00,0x98,0x88,0x26,0xc8,0x02,0xb2,0x02,0x8e,0x08,0x8b },
+  16, 0x8980, 0, {0x18,0x22,0xc0,0x0b,0xa0,0x02,0xee,0x20,0x3b,0x00,0x26,0x40,0x0b,0xb0,0x02,0x70 },
+  16, 0x8990, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xe0,0x00,0xcb,0x00,0x32,0x80 },
+  16, 0x89a0, 0, {0x0f,0xb0,0x03,0xe7,0x00,0xb8,0x52,0x3e,0x20,0x4b,0x0c,0x43,0xef,0x82,0x9b,0xc0 },
+  16, 0x89b0, 0, {0x32,0xc0,0x0b,0xb0,0x02,0x6c,0x01,0x8b,0x80,0x2e,0xc0,0x0b,0xa0,0x83,0xe6,0x00 },
+  16, 0x89c0, 0, {0xfb,0x00,0x36,0x40,0x0f,0xf0,0x03,0xd0,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x89d0, 0, {0xe0,0x01,0xb0,0x02,0xff,0x04,0x3f,0x90,0x0c,0xf1,0x01,0xf4,0x08,0x7d,0x80,0x37 },
+  16, 0x89e0, 0, {0x00,0x0f,0xc0,0x23,0x98,0x00,0xf7,0x00,0x2b,0xe0,0x0f,0xf8,0x23,0xfc,0x06,0xfb },
+  16, 0x89f0, 0, {0x83,0xbf,0xc0,0x87,0xd0,0x03,0xdc,0x00,0xef,0x00,0x3b,0xc0,0x0f,0xb0,0x01,0xf8 },
+  16, 0x8a00, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xa6,0x00,0xcb,0x00,0x33,0x80 },
+  16, 0x8a10, 0, {0x0f,0xb0,0x03,0xe1,0x10,0xf2,0x40,0xb2,0x00,0x3d,0x94,0x17,0x2d,0x44,0xfa,0x41 },
+  16, 0x8a20, 0, {0x32,0xc0,0x9f,0xb0,0x23,0x2c,0x02,0xcb,0x40,0x32,0xc0,0x4f,0x90,0x03,0x3d,0x00 },
+  16, 0x8a30, 0, {0xcb,0x00,0x3e,0x40,0x0f,0xb0,0x03,0x10,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8a40, 0, {0x88,0x05,0x26,0x00,0x8b,0x71,0x20,0xd5,0x03,0x99,0x02,0xe0,0x00,0xbb,0x80,0x22 },
+  16, 0x8a50, 0, {0x60,0x1c,0x80,0x03,0x60,0x00,0xb8,0x02,0x22,0xc2,0x0b,0x32,0x02,0x2c,0x01,0x8f },
+  16, 0x8a60, 0, {0x02,0xd7,0xc0,0x0b,0xa0,0x03,0x6d,0x40,0x53,0x80,0x2e,0xc0,0x0e,0xf0,0x43,0x72 },
+  16, 0x8a70, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x68,0x02,0x80,0x00,0x24,0x00 },
+  16, 0x8a80, 0, {0x0b,0x35,0x26,0xc2,0x00,0xb0,0x90,0x20,0xc0,0x88,0x00,0x02,0x4f,0x20,0xb3,0x02 },
+  16, 0x8a90, 0, {0x60,0xe2,0x1b,0x38,0x02,0x0c,0x00,0x88,0x00,0x60,0xc0,0x0b,0x34,0x82,0x4c,0x02 },
+  16, 0x8aa0, 0, {0xa1,0x90,0x2c,0x40,0x0b,0x30,0x02,0x30,0x01,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8ab0, 0, {0x20,0x01,0x3a,0x08,0x8c,0xa0,0x2d,0x20,0x4b,0x78,0x02,0xda,0x00,0xb2,0x90,0x21 },
+  16, 0x8ac0, 0, {0x66,0x48,0x79,0x02,0xde,0x40,0xb7,0x91,0xa1,0xe0,0xdb,0xf8,0x02,0x1e,0x40,0x84 },
+  16, 0x8ad0, 0, {0x90,0x01,0xe0,0x8b,0xf9,0x02,0x5e,0x01,0x97,0x80,0x2d,0x60,0x0a,0x78,0x00,0x48 },
+  16, 0x8ae0, 0, {0x04,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0x80,0x00,0x24,0x04 },
+  16, 0x8af0, 0, {0x0f,0x32,0x03,0xc4,0xa0,0xf1,0x42,0x30,0xc4,0x2c,0x31,0x02,0x44,0x00,0xf1,0x11 },
+  16, 0x8b00, 0, {0xa0,0xc0,0x0b,0x30,0x0b,0x0c,0x42,0x83,0x00,0x00,0xc0,0x0f,0x30,0x03,0x4c,0x02 },
+  16, 0x8b10, 0, {0xe3,0x00,0x3c,0x40,0x0b,0x30,0x01,0x12,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8b20, 0, {0xc0,0x1d,0xbc,0x00,0xfc,0xa5,0x33,0xc0,0x0f,0xd0,0x03,0xfc,0x01,0xbf,0x00,0x3f },
+  16, 0x8b30, 0, {0xc4,0x0e,0x71,0x03,0x74,0x00,0x75,0x10,0x3f,0xc0,0x05,0xf0,0x03,0xdc,0x40,0xff },
+  16, 0x8b40, 0, {0x04,0x3f,0xc0,0x0f,0xf0,0x43,0xfc,0x00,0x7f,0x00,0x3f,0x40,0x0e,0xf0,0x03,0xd0 },
+  16, 0x8b50, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x04,0xe8,0x00,0xf2,0x04,0xb3,0x80 },
+  16, 0x8b60, 0, {0x0f,0xb8,0x0b,0x2c,0x00,0xeb,0x80,0x32,0xc0,0x0c,0x20,0x13,0x2e,0x08,0xcb,0x01 },
+  16, 0x8b70, 0, {0x32,0xc5,0x0f,0xb1,0x03,0xec,0x48,0xc8,0x10,0x32,0xfa,0x8c,0x38,0x03,0x3c,0x90 },
+  16, 0x8b80, 0, {0xcb,0x00,0x3e,0x40,0x0f,0xb0,0x13,0xc2,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8b90, 0, {0xc8,0x10,0x98,0x00,0xf6,0x00,0x61,0x81,0x0b,0xf0,0x02,0x1c,0x00,0xd7,0x00,0xb7 },
+  16, 0x8ba0, 0, {0x80,0x0c,0x70,0x02,0xbc,0x10,0x8f,0x00,0x21,0xc8,0x8b,0x72,0x43,0xfc,0x88,0xdc },
+  16, 0x8bb0, 0, {0x00,0x37,0xc8,0x0d,0x50,0x02,0x1c,0x22,0x87,0x00,0x2d,0xc0,0x0b,0x70,0x02,0xd3 },
+  16, 0x8bc0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x9e,0x00,0xb6,0x80,0xa9,0xa0 },
+  16, 0x8bd0, 0, {0x4b,0x7c,0x02,0x5e,0x30,0xa3,0x88,0x21,0xf0,0x08,0x78,0x02,0x16,0x00,0x85,0x80 },
+  16, 0x8be0, 0, {0x21,0xe0,0x0b,0x78,0x02,0xde,0x00,0x87,0x80,0xa1,0xe4,0x08,0xd8,0x02,0x4e,0x00 },
+  16, 0x8bf0, 0, {0x97,0x80,0x2d,0x70,0x0b,0x78,0x02,0xc8,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8c00, 0, {0x48,0x14,0xec,0x00,0xb2,0x00,0x28,0xc0,0x0b,0x10,0x02,0x4e,0x90,0x93,0x02,0x22 },
+  16, 0x8c10, 0, {0xf0,0x08,0x38,0x42,0x8c,0x42,0x83,0x04,0x22,0xe4,0x4b,0x38,0x02,0x8e,0x40,0x83 },
+  16, 0x8c20, 0, {0x00,0x20,0xc0,0x09,0x38,0x22,0x4e,0x21,0x93,0x00,0x2e,0xe0,0x0b,0x30,0x02,0xdb },
+  16, 0x8c30, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x01,0xfa,0x00,0x3b,0x89 },
+  16, 0x8c40, 0, {0x0f,0xa0,0x02,0x78,0x08,0xae,0x40,0x23,0x80,0x2c,0x6c,0x0b,0x3a,0x00,0x8e,0x8c },
+  16, 0x8c50, 0, {0xb2,0x00,0x0b,0x80,0x82,0xe0,0x02,0x8e,0x00,0x22,0x80,0x0c,0xe8,0x02,0x7b,0x80 },
+  16, 0x8c60, 0, {0x9a,0x80,0x3e,0x80,0x0f,0xa0,0x03,0xfa,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8c70, 0, {0x48,0x00,0xe0,0x09,0xec,0x00,0x36,0x21,0x0b,0x80,0x13,0xa1,0x00,0xf8,0x60,0x3e },
+  16, 0x8c80, 0, {0x00,0x0f,0x81,0x03,0xe0,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x80,0x43,0xe0,0x10,0xf8 },
+  16, 0x8c90, 0, {0x00,0xbe,0x00,0x0f,0x85,0x0b,0x80,0x00,0xe8,0x10,0x3e,0x00,0x0f,0x80,0x03,0xd2 },
+  16, 0x8ca0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x02,0xc9,0x02,0x30,0x48 },
+  16, 0x8cb0, 0, {0x0c,0x99,0x13,0xa4,0x02,0xc9,0x00,0x3e,0x42,0x0c,0x90,0x8f,0x24,0x00,0xf9,0x00 },
+  16, 0x8cc0, 0, {0x32,0x28,0x0c,0x88,0x03,0xe0,0x00,0xc9,0x00,0xb2,0x40,0x0f,0x90,0x03,0xe7,0x00 },
+  16, 0x8cd0, 0, {0xc9,0x10,0x3e,0x40,0x0c,0x10,0x03,0x02,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8ce0, 0, {0x80,0x04,0x64,0x01,0x89,0x80,0xa2,0x48,0x28,0x92,0x42,0xc5,0x00,0x89,0x40,0x2e },
+  16, 0x8cf0, 0, {0x40,0x2c,0x90,0x06,0x25,0x00,0xb9,0x00,0x22,0x50,0x08,0x98,0x02,0xc4,0x00,0x89 },
+  16, 0x8d00, 0, {0x01,0x76,0x40,0x4b,0x92,0x02,0xe5,0x02,0x89,0x00,0x2e,0x40,0x0d,0x90,0x03,0x60 },
+  16, 0x8d10, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x0c,0x85,0x20,0xa2,0x40 },
+  16, 0x8d20, 0, {0x08,0x90,0x06,0xe5,0x00,0x89,0x40,0x2e,0x40,0x09,0x90,0x42,0xa4,0xa0,0x31,0x00 },
+  16, 0x8d30, 0, {0x22,0x50,0x18,0x91,0x02,0xe4,0x00,0x81,0x00,0x22,0x40,0x0b,0x90,0x06,0xe4,0x00 },
+  16, 0x8d40, 0, {0x89,0x00,0x2e,0x40,0x09,0x90,0x02,0x0e,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8d50, 0, {0x00,0x04,0x15,0x00,0x85,0x40,0x20,0x40,0x08,0x14,0x26,0xe4,0x00,0x81,0x00,0x2c },
+  16, 0x8d60, 0, {0x40,0x18,0x10,0x02,0x84,0x80,0xb1,0x20,0xa0,0x50,0x08,0x14,0x02,0xe5,0x02,0x81 },
+  16, 0x8d70, 0, {0x40,0x20,0x48,0x0b,0x10,0x06,0xcc,0x00,0x81,0x01,0x2c,0x50,0x09,0x14,0x02,0x4a },
+  16, 0x8d80, 0, {0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0x8c,0x00,0x32,0x00 },
+  16, 0x8d90, 0, {0x0c,0x80,0x23,0xe0,0x00,0xc8,0x00,0x3e,0x14,0x0d,0x80,0x12,0xa1,0x44,0xf8,0x51 },
+  16, 0x8da0, 0, {0x32,0x00,0x2c,0x80,0x03,0xe0,0x00,0x88,0x04,0x22,0x14,0x0f,0x80,0x07,0xe0,0x00 },
+  16, 0x8db0, 0, {0xc8,0x00,0x3e,0x00,0x0d,0x80,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8dc0, 0, {0x98,0x9d,0xe4,0x00,0xf9,0x00,0x3f,0x50,0x0f,0xd0,0x03,0xdc,0x01,0xbd,0x42,0x3f },
+  16, 0x8dd0, 0, {0x50,0x4f,0xd4,0x43,0x74,0x41,0xfd,0x10,0x3f,0x10,0x1f,0xc4,0x13,0xf1,0x00,0xfd },
+  16, 0x8de0, 0, {0x40,0x7e,0x44,0x0f,0xd0,0x43,0xf5,0x01,0xfd,0x00,0x3f,0x40,0x0f,0x94,0x03,0xe6 },
+  16, 0x8df0, 0, {0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xf4,0x00,0xdf,0x05,0x33,0x61 },
+  16, 0x8e00, 0, {0x0f,0x50,0x53,0x34,0x10,0xfd,0x04,0x33,0x44,0x4f,0x50,0x03,0x76,0xc1,0xcd,0xe0 },
+  16, 0x8e10, 0, {0x33,0x60,0x0c,0xce,0x03,0xf6,0xc0,0xe1,0xc0,0xb6,0x64,0x8f,0x50,0x0b,0x36,0x82 },
+  16, 0x8e20, 0, {0xcd,0x00,0x3e,0x44,0x4c,0x9e,0xc3,0xc6,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8e30, 0, {0x38,0x10,0xea,0x28,0x80,0xa0,0xb2,0x04,0x0b,0x8a,0x83,0x60,0x00,0xfa,0x00,0x36 },
+  16, 0x8e40, 0, {0x28,0x8b,0x80,0x03,0xe3,0xc8,0xc8,0x84,0x22,0x14,0x08,0x8a,0x02,0xe2,0x80,0xd8 },
+  16, 0x8e50, 0, {0x82,0x34,0x34,0x1b,0x80,0x03,0x60,0x04,0x88,0x00,0x2e,0x20,0x0a,0x8e,0x42,0xce },
+  16, 0x8e60, 0, {0x06,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x05,0xc4,0x80,0x81,0x08,0x04,0x41 },
+  16, 0x8e70, 0, {0x0b,0x92,0x02,0x04,0x00,0xb1,0x00,0x2c,0x40,0x0b,0x18,0x02,0x24,0x00,0xb1,0x60 },
+  16, 0x8e80, 0, {0x26,0x40,0x0a,0x16,0x02,0xc5,0x00,0xa1,0xc0,0x20,0x48,0x0b,0x90,0x02,0x47,0x00 },
+  16, 0x8e90, 0, {0x91,0x01,0x2c,0x48,0x18,0x12,0x02,0xd2,0x01,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8ea0, 0, {0x18,0x15,0xa4,0x0c,0x8b,0x04,0xa2,0x50,0x0b,0x91,0x02,0x24,0x04,0xa9,0x01,0x2e },
+  16, 0x8eb0, 0, {0x42,0x0b,0x90,0x02,0xa4,0x00,0xa9,0x00,0x26,0x60,0x0a,0x90,0x02,0xe6,0x00,0x81 },
+  16, 0x8ec0, 0, {0x00,0x22,0x40,0x8b,0xb0,0x02,0x24,0x08,0x99,0x10,0x2e,0x40,0x1a,0x90,0x02,0xc6 },
+  16, 0x8ed0, 0, {0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe5,0x00,0xc9,0x00,0x36,0x40 },
+  16, 0x8ee0, 0, {0x0f,0x10,0x02,0x25,0x00,0xb1,0x00,0x2e,0x60,0x0f,0x10,0x12,0x24,0x02,0xb9,0xa0 },
+  16, 0x8ef0, 0, {0xa4,0x40,0x2e,0x91,0x03,0xe6,0x00,0xa9,0x00,0x22,0x40,0x0b,0x19,0x80,0x64,0x04 },
+  16, 0x8f00, 0, {0xd9,0x81,0x2e,0x40,0x4c,0x90,0x03,0xe8,0x14,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8f10, 0, {0x68,0x01,0xa4,0x0a,0xe9,0x00,0xbe,0x48,0x0f,0x98,0x0b,0xe4,0x00,0xf9,0xc4,0x36 },
+  16, 0x8f20, 0, {0x70,0x1f,0x92,0x03,0xe6,0x90,0xc1,0x90,0x3a,0x40,0x8d,0x88,0x03,0xe4,0x00,0xf9 },
+  16, 0x8f30, 0, {0x90,0x3e,0x40,0x0b,0x98,0x03,0xe6,0x40,0xe9,0x00,0x3e,0x40,0x0f,0x90,0x03,0xd2 },
+  16, 0x8f40, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x68,0x10,0xa1,0x02,0xd8,0x20,0xb2,0x10 },
+  16, 0x8f50, 0, {0x0c,0x80,0x83,0x21,0x40,0xc8,0x58,0xb2,0x10,0x4c,0x80,0x0b,0x20,0x00,0xf8,0x42 },
+  16, 0x8f60, 0, {0x32,0x00,0x0f,0x80,0x03,0xe0,0x02,0xd8,0x00,0x72,0x00,0x1c,0x80,0x00,0x20,0x00 },
+  16, 0x8f70, 0, {0xf8,0x04,0x3e,0x00,0x0f,0x80,0x03,0x02,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8f80, 0, {0x28,0x05,0x38,0x04,0xce,0x41,0x23,0x80,0x08,0xe0,0x02,0x39,0x10,0xae,0x40,0x22 },
+  16, 0x8f90, 0, {0x80,0x08,0xe0,0x02,0x1a,0x00,0xba,0x00,0x2b,0xad,0x03,0x80,0x02,0xe8,0x00,0xca },
+  16, 0x8fa0, 0, {0x00,0x2a,0x80,0x0a,0xe0,0x02,0x18,0x00,0xba,0x00,0x1a,0x80,0x0b,0xa0,0x03,0x4a },
+  16, 0x8fb0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x68,0x05,0x6c,0x12,0x89,0x00,0xa0,0xe0 },
+  16, 0x8fc0, 0, {0x08,0x38,0x02,0x0d,0x88,0x83,0x00,0x04,0xe0,0x08,0x38,0x32,0x0e,0x25,0x31,0x01 },
+  16, 0x8fd0, 0, {0x24,0xe0,0x8b,0x38,0x02,0xe4,0x01,0x83,0x00,0x20,0xc0,0x08,0x30,0x02,0x8c,0x00 },
+  16, 0x8fe0, 0, {0xb3,0x00,0x2e,0xc0,0x0b,0x30,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x8ff0, 0, {0xa0,0x01,0x14,0x20,0x86,0x20,0x29,0xb0,0x08,0xf0,0x82,0x3e,0x04,0xa7,0x00,0x21 },
+  16, 0x9000, 0, {0x70,0x88,0x70,0x92,0x1c,0x20,0xbd,0x00,0x69,0xc0,0x0b,0x76,0x02,0xd4,0x80,0x8f },
+  16, 0x9010, 0, {0x21,0x29,0xe0,0x0a,0x60,0x86,0x98,0x01,0xb7,0x00,0x2d,0xc8,0x0b,0x3b,0x02,0x60 },
+  16, 0x9020, 0, {0x04,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x3e,0x00,0xc7,0xa0,0xb0,0xe0 },
+  16, 0x9030, 0, {0x2c,0x78,0x0b,0x1a,0x00,0xc3,0x80,0x37,0xe0,0x28,0x78,0x03,0x1a,0x08,0xf5,0x90 },
+  16, 0x9040, 0, {0x35,0xe0,0x0f,0x7c,0x12,0xd6,0x82,0xc7,0x90,0x21,0xe4,0x08,0x78,0x03,0x9e,0x00 },
+  16, 0x9050, 0, {0xf5,0x80,0x3d,0xf1,0x0f,0x78,0x03,0x22,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9060, 0, {0x08,0x19,0xa4,0x00,0xee,0x80,0x36,0xc1,0x4f,0xd0,0x03,0xc8,0x00,0xfb,0x00,0x3e },
+  16, 0x9070, 0, {0x51,0x0f,0xb0,0x03,0xe4,0x08,0xf1,0x60,0x3e,0xc0,0x0f,0xb0,0x03,0xc5,0x00,0xeb },
+  16, 0x9080, 0, {0x10,0x3e,0xc0,0x0f,0xb0,0x09,0x6c,0x00,0xfb,0x00,0x3a,0xc0,0x0f,0xb0,0x03,0xc2 },
+  16, 0x9090, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xfe,0x00,0xfd,0x88,0x33,0x60 },
+  16, 0x90a0, 0, {0x0f,0xf9,0x03,0xce,0x40,0xd7,0x84,0x37,0x70,0x0c,0xd8,0x23,0x36,0x00,0xc5,0x88 },
+  16, 0x90b0, 0, {0x33,0xe0,0x4f,0xf8,0x13,0xf7,0x28,0xdf,0x80,0x37,0xe2,0x0c,0x58,0x03,0x3e,0x00 },
+  16, 0x90c0, 0, {0xff,0x90,0x3f,0xe0,0x0c,0xf8,0x03,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x90d0, 0, {0xa9,0x11,0x9c,0x08,0xf6,0x00,0xa1,0x00,0x0b,0x63,0x02,0xd6,0x30,0x85,0x41,0x31 },
+  16, 0x90e0, 0, {0xc8,0x08,0x50,0x23,0x1c,0x00,0xd5,0x20,0xb1,0x80,0x0f,0x70,0x03,0xb4,0x00,0xc7 },
+  16, 0x90f0, 0, {0x00,0x21,0xc0,0x0f,0x40,0xa3,0x58,0x40,0xb7,0x00,0x3f,0xc4,0x0a,0xf0,0x02,0x2a },
+  16, 0x9100, 0, {0x06,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x40,0xb7,0x10,0x21,0xd2 },
+  16, 0x9110, 0, {0x0b,0x70,0x02,0xdc,0x42,0x86,0x00,0x25,0x61,0x08,0x51,0x02,0x50,0x00,0x95,0x00 },
+  16, 0x9120, 0, {0x25,0xc0,0x09,0x70,0x82,0xd4,0x00,0x87,0x00,0x24,0xc0,0x08,0x50,0x02,0x5c,0x00 },
+  16, 0x9130, 0, {0x95,0x04,0x2d,0xc0,0x08,0x70,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9140, 0, {0x20,0x14,0xcc,0x08,0xb2,0xd0,0x20,0xe0,0x4b,0x08,0x02,0xc4,0x00,0x80,0x80,0x20 },
+  16, 0x9150, 0, {0xf0,0x08,0x1a,0x02,0x85,0x48,0x81,0x10,0x20,0x40,0x0a,0x30,0x02,0xc6,0x10,0x93 },
+  16, 0x9160, 0, {0x00,0x20,0xc0,0x0a,0x1c,0x02,0x0d,0x40,0xb3,0x00,0x68,0xc4,0x0a,0xb0,0x02,0x09 },
+  16, 0x9170, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xac,0x01,0xfe,0x00,0x32,0xf0 },
+  16, 0x9180, 0, {0x0f,0x88,0x03,0xe6,0x00,0xc8,0xc8,0x36,0xf6,0x28,0xa6,0x0a,0x6d,0x00,0x9d,0x00 },
+  16, 0x9190, 0, {0x32,0x00,0x0b,0xb0,0x03,0xf6,0x03,0xc7,0x00,0x37,0xc0,0x08,0x9c,0x0a,0x6e,0x00 },
+  16, 0x91a0, 0, {0xbb,0x00,0x2f,0xc0,0x0c,0xf0,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x91b0, 0, {0x80,0x00,0xe4,0x01,0xeb,0x40,0x3e,0x80,0x4f,0xc1,0x03,0xe4,0x00,0xb8,0x08,0x3a },
+  16, 0x91c0, 0, {0x40,0x8f,0xa4,0x13,0x6c,0x20,0xf9,0x00,0x3e,0x70,0x0f,0xb0,0x03,0xa4,0x40,0xeb },
+  16, 0x91d0, 0, {0x00,0x3e,0xc0,0x0f,0x92,0x23,0xe8,0x00,0xf9,0x80,0x3e,0xc0,0x0f,0xb0,0x63,0xe0 },
+  16, 0x91e0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x08,0xce,0x08,0x33,0xc0 },
+  16, 0x91f0, 0, {0x0f,0xda,0x03,0x30,0x00,0xe4,0x04,0x35,0xc0,0x0d,0xa0,0x03,0x28,0x00,0xc5,0x00 },
+  16, 0x9200, 0, {0x33,0x00,0x0b,0xfa,0x03,0xf4,0x03,0xcb,0x00,0x31,0xc0,0x0c,0xd4,0x03,0x14,0x20 },
+  16, 0x9210, 0, {0xcd,0x80,0x23,0xc1,0x0c,0xf0,0x02,0x08,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9220, 0, {0x81,0x04,0x44,0x10,0xcb,0xd0,0x22,0xc0,0x0b,0x94,0x02,0x22,0x84,0xb8,0xc6,0x02 },
+  16, 0x9230, 0, {0x40,0x08,0x28,0x02,0xa5,0x80,0x89,0x00,0x22,0x60,0x0b,0xb8,0x02,0x64,0x00,0x8b },
+  16, 0x9240, 0, {0x00,0x2a,0xc0,0xc8,0x00,0x03,0x66,0x00,0x81,0x00,0x00,0xc0,0x0d,0xb0,0x0a,0xa8 },
+  16, 0x9250, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0x13,0x00,0x22,0x40 },
+  16, 0x9260, 0, {0x8b,0x24,0x02,0x2a,0x00,0xbb,0x82,0x22,0x40,0x00,0xac,0x02,0x84,0x00,0x89,0x00 },
+  16, 0x9270, 0, {0x22,0x22,0x0b,0xb0,0x02,0xc4,0x00,0x9b,0x00,0x2a,0xc0,0x08,0xb0,0x02,0x2e,0x00 },
+  16, 0x9280, 0, {0x8b,0x10,0x2a,0xc0,0x08,0xb0,0x02,0xa0,0x10,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9290, 0, {0x08,0x04,0x0c,0x10,0x83,0x00,0x20,0x01,0x0b,0x20,0x02,0x00,0x80,0xb1,0x00,0x20 },
+  16, 0x92a0, 0, {0xc1,0x08,0x20,0x02,0x88,0x01,0x81,0x00,0xa0,0x00,0x0b,0x30,0x02,0x44,0x01,0x9b },
+  16, 0x92b0, 0, {0x00,0x28,0xc0,0x08,0xb0,0x02,0x48,0x06,0x89,0x00,0x2a,0xc0,0x09,0x30,0x02,0x82 },
+  16, 0x92c0, 0, {0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8d,0x6c,0x00,0xc3,0x00,0xb2,0xc0 },
+  16, 0x92d0, 0, {0x0f,0xb0,0x03,0x28,0x20,0xfa,0x00,0xb1,0x40,0x0d,0xa0,0x07,0xa0,0x00,0xcd,0x00 },
+  16, 0x92e0, 0, {0x22,0x00,0x0f,0xb0,0x03,0xf4,0x00,0x9f,0x00,0x3b,0xc0,0x2c,0xb0,0x0b,0x24,0x00 },
+  16, 0x92f0, 0, {0xc9,0x00,0xba,0xc0,0x0c,0xb0,0x03,0x80,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9300, 0, {0xa0,0x1d,0xfc,0x06,0xff,0x02,0xaf,0xc0,0x0f,0xc0,0x03,0xf0,0x10,0xfc,0x00,0x3f },
+  16, 0x9310, 0, {0xc0,0x9f,0xe0,0x13,0xf0,0x00,0xfd,0x04,0x3f,0x40,0x4f,0xf0,0x03,0x74,0x00,0xef },
+  16, 0x9320, 0, {0x00,0x3f,0xc0,0x8f,0xe0,0x02,0xb4,0x01,0xfd,0x04,0x37,0xc0,0x0f,0xf0,0x43,0x68 },
+  16, 0x9330, 0, {0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfc,0x00,0xc7,0x20,0xb3,0xc8 },
+  16, 0x9340, 0, {0x1c,0xf1,0x03,0x7c,0x20,0xcf,0x0a,0x3f,0xd0,0x0d,0xf0,0x03,0x7c,0x80,0x8f,0x32 },
+  16, 0x9350, 0, {0x33,0xc4,0x0f,0xf1,0x83,0x3c,0xe0,0xcf,0x10,0x33,0xc4,0x0d,0xf2,0x83,0x3c,0xe2 },
+  16, 0x9360, 0, {0xc7,0x80,0x17,0xcc,0x4c,0xf3,0x83,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9370, 0, {0x80,0x10,0xe3,0x40,0x88,0x68,0x22,0x30,0x08,0x06,0x02,0x01,0xa1,0x88,0xc4,0x0e },
+  16, 0x9380, 0, {0x14,0x08,0x87,0x80,0x01,0xc0,0x28,0x50,0x02,0x04,0x8b,0x86,0x02,0xa1,0x98,0x88 },
+  16, 0x9390, 0, {0x41,0x2a,0x04,0x0a,0x84,0x82,0xbd,0x80,0x8b,0x08,0x2b,0xc4,0x88,0xf4,0x03,0x60 },
+  16, 0x93a0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x08,0x82,0x40,0x20,0x10 },
+  16, 0x93b0, 0, {0x08,0x21,0x12,0x44,0x04,0x82,0x04,0x2c,0x08,0x89,0x90,0x02,0x44,0x21,0x8b,0x00 },
+  16, 0x93c0, 0, {0x24,0x88,0x8b,0xa0,0x00,0x40,0x84,0x89,0x30,0x22,0x48,0x88,0xb0,0x02,0xcc,0x08 },
+  16, 0x93d0, 0, {0x88,0x20,0xa4,0xc8,0x00,0x32,0x0a,0x22,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x93e0, 0, {0xc0,0x15,0xa0,0x00,0x89,0x00,0x22,0xc1,0x88,0x90,0x62,0x28,0x08,0x89,0x08,0x2e },
+  16, 0x93f0, 0, {0xc0,0x08,0xa0,0x02,0x28,0x08,0xa8,0x00,0x26,0x42,0x0b,0x90,0x02,0xcc,0x50,0x8a },
+  16, 0x9400, 0, {0x22,0x2a,0x86,0x0a,0x80,0x02,0xec,0x00,0x88,0x84,0x2a,0xc1,0x08,0xb0,0x26,0x30 },
+  16, 0x9410, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xf0,0x02,0xcf,0x00,0x33,0xc0 },
+  16, 0x9420, 0, {0x48,0xf8,0x43,0x79,0x00,0x8d,0xc0,0x3f,0x30,0x8d,0x60,0x83,0x78,0x60,0xc4,0x58 },
+  16, 0x9430, 0, {0x37,0x20,0x0f,0x58,0x13,0x7b,0x02,0xcc,0xc4,0x31,0x20,0x0c,0x44,0x03,0xec,0x02 },
+  16, 0x9440, 0, {0x8b,0x80,0x36,0xc0,0x24,0xb0,0x12,0x10,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9450, 0, {0xe0,0x01,0x9c,0x00,0xf4,0x10,0x3d,0x00,0x6f,0xc9,0x13,0xd4,0x12,0xfe,0x90,0x3f },
+  16, 0x9460, 0, {0xf0,0x0f,0xda,0x23,0xf4,0x14,0xff,0x02,0x3b,0xf0,0x0f,0xea,0x23,0xb6,0x00,0xff },
+  16, 0x9470, 0, {0x82,0x3f,0xe1,0x8f,0xf4,0x03,0xbc,0x00,0xff,0x00,0x3f,0xc0,0xaf,0x70,0x03,0xf8 },
+  16, 0x9480, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xa0,0x00,0xca,0x00,0x32,0x08 },
+  16, 0x9490, 0, {0x1c,0xa0,0x03,0xa5,0x20,0xcb,0x40,0xba,0x10,0x1f,0xb0,0x03,0xac,0x00,0xeb,0x00 },
+  16, 0x94a0, 0, {0x72,0x90,0x0c,0xb4,0x03,0x29,0x04,0xc9,0x52,0x32,0x50,0x0c,0xb4,0x03,0x0c,0x00 },
+  16, 0x94b0, 0, {0xf8,0x40,0x32,0xc1,0x0e,0xb0,0x0b,0x50,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x94c0, 0, {0xc8,0x05,0x2d,0x80,0x89,0x80,0x22,0xd9,0x08,0x90,0x22,0x2a,0x00,0x88,0x54,0x22 },
+  16, 0x94d0, 0, {0xc0,0x8b,0x80,0x22,0x20,0x19,0xc8,0x00,0x22,0x40,0x8d,0x80,0x1a,0x24,0x10,0xd2 },
+  16, 0x94e0, 0, {0x44,0x22,0x81,0x0d,0x80,0x03,0x7c,0x00,0xb0,0x00,0x37,0xc0,0x88,0xf0,0x02,0x32 },
+  16, 0x94f0, 0, {0x10,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4e,0x00,0x81,0x00,0xa0,0xf0 },
+  16, 0x9500, 0, {0x08,0x90,0x02,0x89,0x02,0x80,0x00,0x22,0xc0,0x0b,0x00,0x22,0xa0,0x00,0xb0,0x00 },
+  16, 0x9510, 0, {0x20,0x40,0x08,0x00,0x02,0x04,0x00,0x82,0x60,0x20,0x80,0x08,0x00,0x02,0x0c,0x08 },
+  16, 0x9520, 0, {0xb2,0x00,0x22,0xc0,0x08,0x30,0x02,0x38,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9530, 0, {0x20,0x01,0x03,0x10,0x8e,0x90,0x23,0x24,0x08,0x6b,0x02,0x16,0x60,0x8f,0x80,0x21 },
+  16, 0x9540, 0, {0x28,0x0b,0xf9,0x06,0x1e,0x40,0x8f,0x80,0x23,0xa4,0x49,0x79,0x02,0x3a,0x40,0x9d },
+  16, 0x9550, 0, {0x90,0x23,0x64,0x09,0xf8,0x02,0x5e,0x40,0xbe,0x90,0x24,0xe4,0x28,0x79,0x02,0x08 },
+  16, 0x9560, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x42,0xc0,0x09,0x30,0x00 },
+  16, 0x9570, 0, {0x28,0x02,0x03,0x84,0x00,0x8a,0x20,0x30,0xc4,0x8b,0x11,0x03,0x84,0x50,0xb3,0x00 },
+  16, 0x9580, 0, {0x20,0xc0,0x0c,0xa4,0x22,0x04,0x00,0xcb,0x40,0x30,0xc5,0x0c,0x30,0x03,0x0e,0x40 },
+  16, 0x9590, 0, {0xf3,0x10,0x30,0xc4,0x0c,0xb0,0x03,0x12,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x95a0, 0, {0x40,0x1d,0xb0,0x04,0xfb,0x04,0x3d,0xc0,0x0f,0xf2,0x43,0xf8,0x04,0xfd,0x01,0x3f },
+  16, 0x95b0, 0, {0x0c,0x0f,0x61,0x03,0xf8,0x48,0xf4,0x00,0x3d,0x01,0x0f,0xd0,0x03,0xc8,0x00,0xfc },
+  16, 0x95c0, 0, {0x04,0xbd,0x04,0x0b,0x48,0x03,0xfc,0x18,0xff,0x14,0x3f,0xd5,0x0d,0xf0,0x03,0x90 },
+  16, 0x95d0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xe0,0x00,0xf9,0x01,0x32,0xc0 },
+  16, 0x95e0, 0, {0x8e,0x90,0x03,0x28,0x02,0xd1,0x00,0x32,0xc0,0x0d,0xa8,0x0b,0x08,0x00,0xe8,0x00 },
+  16, 0x95f0, 0, {0x2e,0x40,0x0c,0x98,0x0b,0x2e,0x02,0xca,0x00,0xb2,0xa0,0x6c,0x80,0x23,0x2d,0x80 },
+  16, 0x9600, 0, {0xca,0x80,0x32,0xd0,0x0c,0xba,0x03,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9610, 0, {0x48,0x11,0x9c,0x00,0xb6,0x00,0xa3,0x00,0x08,0x60,0x02,0x04,0x00,0x86,0x04,0x29 },
+  16, 0x9620, 0, {0x00,0x08,0x50,0x42,0x14,0x04,0xa7,0x00,0x0d,0x80,0x4a,0x60,0x02,0x00,0x00,0x81 },
+  16, 0x9630, 0, {0x00,0x21,0x40,0x08,0x70,0x02,0x9d,0x42,0x86,0x01,0x20,0xc0,0x08,0x32,0x82,0x12 },
+  16, 0x9640, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x92,0x00,0xbc,0x80,0x63,0x20 },
+  16, 0x9650, 0, {0x82,0x08,0x02,0x52,0x00,0x84,0xc2,0x23,0x20,0x88,0x0c,0x02,0x33,0x00,0x84,0x80 },
+  16, 0x9660, 0, {0x2f,0x21,0x89,0x4c,0x02,0x12,0x14,0x94,0xc5,0x64,0x21,0x08,0x4c,0x02,0x0e,0x80 },
+  16, 0x9670, 0, {0x97,0x82,0xa1,0xec,0x08,0x79,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9680, 0, {0x48,0x14,0xcd,0x44,0xb3,0x00,0x20,0xc0,0x08,0x30,0x02,0x4d,0x80,0x03,0x88,0x28 },
+  16, 0x9690, 0, {0xc0,0x08,0x3c,0x06,0x0f,0x00,0xa3,0x43,0x2c,0xc2,0x1b,0x38,0x02,0x0f,0x00,0x9b },
+  16, 0x96a0, 0, {0x88,0x64,0xd0,0x08,0xb8,0x02,0x8c,0x10,0x93,0x00,0x20,0xc0,0x08,0x30,0x0a,0x12 },
+  16, 0x96b0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xaa,0x00,0xfa,0x05,0x32,0x80 },
+  16, 0x96c0, 0, {0x8e,0xa0,0x0b,0x69,0x00,0xca,0x40,0x32,0xa0,0x3c,0xa8,0x03,0x2a,0x00,0xea,0x26 },
+  16, 0x96d0, 0, {0x3e,0xb0,0x0d,0xa1,0x63,0x28,0x20,0xca,0x40,0x36,0xa0,0x0c,0xe0,0x13,0x28,0x09 },
+  16, 0x96e0, 0, {0xde,0x00,0x32,0x80,0x2c,0xa0,0x03,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x96f0, 0, {0x48,0x00,0xf0,0x20,0xf4,0x00,0x3f,0x00,0x0f,0x40,0x23,0xb0,0x00,0xec,0x00,0x3f },
+  16, 0x9700, 0, {0x06,0x1e,0xc2,0x13,0xf0,0x88,0xfc,0x20,0x3f,0x04,0x8e,0xc0,0x03,0xf0,0x80,0xec },
+  16, 0x9710, 0, {0x40,0x3b,0x0c,0x0f,0xc0,0xa3,0xe0,0x00,0xe8,0x00,0x3e,0x00,0x4f,0x80,0x03,0xd2 },
+  16, 0x9720, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xf9,0x00,0x32,0x40 },
+  16, 0x9730, 0, {0x0c,0x90,0x03,0x24,0x00,0xc9,0x80,0x32,0x40,0x0f,0x90,0x53,0xe4,0x10,0xc9,0x00 },
+  16, 0x9740, 0, {0x32,0x40,0x0d,0x90,0x03,0xe4,0x00,0xf9,0x00,0x36,0x40,0x8f,0x90,0x03,0x24,0x10 },
+  16, 0x9750, 0, {0xc9,0x01,0x3c,0x40,0x0c,0x90,0x03,0xc2,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9760, 0, {0x80,0x04,0x47,0x44,0x89,0x00,0x20,0x40,0x08,0x90,0x02,0x25,0x0a,0x81,0x10,0x22 },
+  16, 0x9770, 0, {0x40,0x48,0x90,0x03,0xc4,0x00,0x89,0x00,0x76,0x40,0x28,0x90,0x02,0xe4,0x10,0xb9 },
+  16, 0x9780, 0, {0x40,0xb2,0x40,0x0b,0x90,0x03,0x64,0x00,0x89,0x00,0x2e,0x41,0x08,0x90,0x42,0xe0 },
+  16, 0x9790, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x02,0xbd,0x00,0x23,0x48 },
+  16, 0x97a0, 0, {0x08,0xd0,0x06,0x1d,0x04,0x8d,0x00,0x29,0xc0,0x4a,0xd0,0x22,0xf4,0x00,0x85,0x00 },
+  16, 0x97b0, 0, {0x61,0x40,0x18,0xd0,0x12,0xfc,0x00,0xbd,0x40,0xa3,0x40,0x4b,0xf0,0x02,0x04,0x01 },
+  16, 0x97c0, 0, {0x8b,0x00,0x2e,0x40,0x08,0x90,0x02,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x97d0, 0, {0x08,0x04,0x36,0x80,0x85,0x20,0xa3,0x48,0x08,0x52,0x0a,0x14,0x81,0x85,0x20,0x29 },
+  16, 0x97e0, 0, {0x48,0x08,0x52,0x02,0xb4,0x80,0x85,0x20,0x25,0x48,0x88,0x52,0x02,0xd4,0x80,0xb5 },
+  16, 0x97f0, 0, {0x20,0x21,0x48,0x0b,0x52,0x02,0x44,0xa2,0x81,0x00,0x2c,0x4a,0x08,0x12,0x82,0xc2 },
+  16, 0x9800, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xf8,0x51,0x22,0x00 },
+  16, 0x9810, 0, {0x2c,0x85,0x02,0x21,0x48,0xc8,0x00,0xba,0x14,0x0f,0x85,0x12,0xe1,0x42,0xc8,0x50 },
+  16, 0x9820, 0, {0x22,0x00,0x0c,0x00,0x03,0xe0,0x00,0xf8,0x50,0x32,0x00,0x07,0x45,0x03,0x20,0x80 },
+  16, 0x9830, 0, {0xc0,0x01,0x3e,0x08,0x2c,0x82,0x03,0xee,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9840, 0, {0x98,0x0d,0xe4,0x40,0xf1,0x10,0x3e,0x44,0x07,0x91,0x43,0xe4,0x58,0xf9,0x11,0x34 },
+  16, 0x9850, 0, {0x44,0x4f,0x91,0x02,0xe4,0x50,0xf9,0x10,0x3c,0x4f,0x0f,0x93,0x83,0xe4,0xf0,0xf9 },
+  16, 0x9860, 0, {0x11,0x3a,0x4f,0x0f,0x91,0x03,0xe4,0xa0,0xfd,0x28,0x3e,0x4a,0x0f,0x92,0x83,0xe6 },
+  16, 0x9870, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xf6,0xa0,0xcd,0xa0,0xb3,0x68 },
+  16, 0x9880, 0, {0x8c,0x9a,0x03,0x36,0x80,0xc5,0xa0,0x22,0x60,0x0c,0x9a,0x23,0x26,0x04,0xf9,0xa0 },
+  16, 0x9890, 0, {0x32,0x66,0x0c,0x9a,0x83,0x06,0x20,0xc5,0xa0,0x22,0x60,0x0c,0x9b,0x03,0x26,0x48 },
+  16, 0x98a0, 0, {0xc9,0x00,0x3e,0x78,0x0c,0x9a,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x98b0, 0, {0x38,0x00,0xe1,0x00,0x88,0x44,0x22,0x95,0x08,0x85,0x12,0xa1,0x42,0x88,0x40,0x02 },
+  16, 0x98c0, 0, {0x90,0x08,0x84,0x02,0x23,0xa0,0xba,0x40,0x22,0xa0,0x08,0x8e,0x92,0xa3,0xa0,0xa8 },
+  16, 0x98d0, 0, {0x40,0x2a,0x10,0x08,0xae,0x02,0x23,0x40,0x88,0x00,0x2e,0x38,0x08,0x84,0x12,0x0e },
+  16, 0x98e0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x15,0xc4,0x00,0x8b,0x12,0x22,0x40 },
+  16, 0x98f0, 0, {0x08,0x90,0x02,0x44,0x00,0x81,0x40,0xa0,0x50,0x08,0x11,0x0a,0x05,0x00,0xb1,0x10 },
+  16, 0x9900, 0, {0xa0,0x48,0x08,0x90,0x02,0x04,0x00,0x81,0x40,0x20,0x50,0x28,0x11,0x02,0x44,0x82 },
+  16, 0x9910, 0, {0x81,0x00,0x2c,0x50,0x08,0x11,0x02,0x02,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9920, 0, {0x18,0x15,0xa4,0x02,0x89,0x40,0x22,0x40,0x08,0x94,0x12,0xa5,0x00,0x89,0x28,0x22 },
+  16, 0x9930, 0, {0x49,0x08,0x94,0x02,0x24,0x48,0xb9,0x14,0x22,0x40,0x08,0x94,0x02,0xa4,0x40,0xa1 },
+  16, 0x9940, 0, {0x50,0x2a,0x50,0x08,0x91,0x42,0x64,0x00,0x89,0x40,0x2e,0x40,0x08,0x10,0x02,0x06 },
+  16, 0x9950, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x00,0xc9,0x00,0x30,0x70 },
+  16, 0x9960, 0, {0x2c,0x10,0x0b,0x66,0x00,0xc9,0x40,0x32,0x50,0x0c,0x90,0x03,0x26,0x20,0xf9,0xc0 },
+  16, 0x9970, 0, {0x32,0x70,0x0c,0x90,0x03,0x26,0x20,0xc9,0x00,0x32,0x40,0x0c,0x9c,0x03,0x64,0x00 },
+  16, 0x9980, 0, {0xc9,0x41,0x3e,0x40,0x2c,0x90,0x0b,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9990, 0, {0x28,0x01,0xa4,0x00,0xf9,0x04,0x3e,0x48,0x0f,0x90,0x03,0xe4,0x88,0xf9,0x00,0x34 },
+  16, 0x99a0, 0, {0x41,0x2f,0x9c,0x03,0xe4,0x10,0xf9,0x00,0x3e,0x44,0x2f,0x99,0x03,0xe4,0x10,0xf9 },
+  16, 0x99b0, 0, {0x00,0x3e,0x50,0x0f,0x10,0x4b,0xa4,0x10,0xf9,0x20,0x3c,0x40,0x0f,0x90,0x03,0x4a },
+  16, 0x99c0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xc8,0x00,0x3e,0x10 },
+  16, 0x99d0, 0, {0x2c,0x80,0x03,0x20,0x02,0xc0,0x40,0x32,0x00,0x1c,0x04,0x0f,0x21,0x00,0xc0,0x04 },
+  16, 0x99e0, 0, {0x38,0x00,0x0f,0x80,0x03,0x21,0x08,0xc8,0x60,0x30,0x10,0x0f,0x80,0x02,0x20,0x00 },
+  16, 0x99f0, 0, {0xf8,0x00,0x32,0x00,0x0c,0x80,0x03,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9a00, 0, {0x28,0x05,0x1a,0x20,0x82,0x04,0x2f,0x80,0x08,0xa0,0x02,0x38,0x00,0x8e,0x80,0x22 },
+  16, 0x9a10, 0, {0x80,0x08,0xe0,0x02,0x28,0x00,0x8a,0x00,0x22,0x81,0x0b,0x20,0x02,0x28,0x00,0xde },
+  16, 0x9a20, 0, {0xe4,0x36,0x80,0x0b,0xa0,0x42,0x28,0x00,0xba,0x04,0x22,0x80,0x08,0xa0,0x02,0xca },
+  16, 0x9a30, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0x83,0x01,0x2c,0x80 },
+  16, 0x9a40, 0, {0x08,0x30,0x02,0x2e,0x60,0x82,0x90,0xa0,0xc0,0x48,0x30,0x02,0x0c,0x02,0x83,0x00 },
+  16, 0x9a50, 0, {0x28,0xc0,0x0b,0x30,0x0a,0x2c,0x00,0x83,0xc2,0x20,0xc0,0x0b,0x30,0x2a,0x2c,0x00 },
+  16, 0x9a60, 0, {0xb3,0x00,0xa0,0xc0,0x08,0x30,0x02,0xca,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9a70, 0, {0xa0,0x01,0x3c,0x00,0x87,0x01,0x2d,0xc2,0x08,0xf3,0x12,0x3c,0x00,0x8f,0x01,0x21 },
+  16, 0x9a80, 0, {0xc8,0x68,0x72,0x22,0x1e,0x04,0x87,0x20,0x21,0xc4,0x0b,0x70,0x02,0x3c,0x84,0x9f },
+  16, 0x9a90, 0, {0x00,0x25,0xc4,0x4b,0x70,0x02,0x1c,0x04,0xb7,0x81,0x21,0xc8,0x08,0x72,0x02,0xe8 },
+  16, 0x9aa0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x00,0x1e,0x00,0xc7,0x81,0x3c,0xa0 },
+  16, 0x9ab0, 0, {0x4c,0x7a,0x0b,0x1a,0x00,0xc6,0x80,0x30,0xe0,0x08,0xf8,0x82,0x0e,0x40,0xcf,0xf0 },
+  16, 0x9ac0, 0, {0x39,0xe8,0x0f,0x3a,0x03,0x1e,0x20,0xc7,0x80,0x31,0xe3,0x0f,0x38,0x23,0x1f,0x08 },
+  16, 0x9ad0, 0, {0xff,0xc0,0x33,0xf2,0x0c,0x7e,0x03,0xea,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9ae0, 0, {0x08,0x15,0x88,0x0a,0x7b,0x00,0x3e,0xc1,0x0b,0x34,0x23,0xc8,0x10,0xfb,0x02,0x3e },
+  16, 0x9af0, 0, {0xca,0x0f,0xb7,0x43,0xec,0x80,0xfb,0x00,0x2e,0xc2,0x0b,0xb4,0x83,0xed,0xd0,0xfa },
+  16, 0x9b00, 0, {0x00,0x3e,0xd9,0x0f,0xb3,0x83,0xec,0x80,0xbb,0x20,0x3e,0xd8,0x2f,0xb4,0x03,0xc2 },
+  16, 0x9b10, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xfe,0x00,0xf5,0x91,0x31,0xa0 },
+  16, 0x9b20, 0, {0x0c,0xfc,0x03,0xfe,0x00,0xc4,0x81,0x31,0xee,0x8d,0xf8,0x0a,0x3e,0x30,0xcf,0x84 },
+  16, 0x9b30, 0, {0x33,0xe0,0x2c,0xf8,0x83,0xfe,0x10,0xfe,0x80,0x33,0xe0,0x0c,0xf9,0x19,0x3f,0x48 },
+  16, 0x9b40, 0, {0xcf,0xc0,0x33,0xe0,0x04,0xfc,0x03,0xc0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9b50, 0, {0xa8,0x11,0x9c,0x08,0xb7,0xa1,0x21,0xc8,0x08,0x71,0x02,0xf0,0xa0,0x85,0x20,0x21 },
+  16, 0x9b60, 0, {0xce,0x08,0x70,0x02,0x3c,0x80,0x8f,0x00,0x2b,0xc5,0x08,0x71,0x02,0xdc,0x10,0xb4 },
+  16, 0x9b70, 0, {0x00,0x21,0xc1,0x0a,0xf3,0x82,0x0c,0x00,0x87,0x01,0x29,0xc0,0x08,0x71,0x02,0x6a },
+  16, 0x9b80, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9d,0x00,0xbd,0x21,0x27,0x82 },
+  16, 0x9b90, 0, {0x00,0x70,0x02,0xfc,0x04,0x8c,0x00,0xa7,0xcc,0xa8,0x70,0x02,0x3c,0x08,0xaf,0x00 },
+  16, 0x9ba0, 0, {0x21,0xc0,0x08,0x70,0x02,0xdc,0x00,0xb7,0x00,0x21,0xc4,0x08,0x70,0x16,0x1c,0x0a },
+  16, 0x9bb0, 0, {0x8f,0x00,0x21,0xc0,0x08,0x70,0x02,0xc0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9bc0, 0, {0x20,0x10,0xc8,0x00,0xbb,0x44,0x24,0xe2,0x08,0xb1,0x02,0xc2,0x80,0x01,0x80,0x24 },
+  16, 0x9bd0, 0, {0xd0,0x88,0x30,0x02,0x0f,0x52,0x83,0x91,0x28,0xe4,0x88,0x3d,0x02,0xce,0xd0,0xb0 },
+  16, 0x9be0, 0, {0xb2,0xa2,0xc0,0x0a,0x34,0x12,0x0c,0x02,0x83,0x00,0x28,0xc0,0x08,0x30,0x02,0x48 },
+  16, 0x9bf0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xac,0x00,0xfb,0x01,0xe4,0x40 },
+  16, 0x9c00, 0, {0x2c,0xf0,0x43,0xe5,0x00,0x8a,0x88,0x37,0xe0,0x00,0xfa,0x02,0x3d,0x00,0xef,0x00 },
+  16, 0x9c10, 0, {0x33,0xd1,0x0c,0xf4,0x03,0xfd,0x00,0xf9,0x40,0x33,0xe8,0x0c,0xfc,0x01,0x3c,0x04 },
+  16, 0x9c20, 0, {0xcf,0x02,0x33,0xc0,0x2c,0xf0,0x03,0xea,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9c30, 0, {0x80,0x00,0xee,0x08,0xf9,0x10,0x3a,0xd0,0x0f,0xb0,0x93,0xec,0x00,0xfb,0x0b,0x3a },
+  16, 0x9c40, 0, {0xc0,0x8e,0xb0,0x83,0xec,0x80,0xfb,0x09,0x7e,0xc8,0x0f,0xb2,0x13,0xec,0x00,0xf9 },
+  16, 0x9c50, 0, {0x00,0x3e,0xc2,0x8f,0xb2,0x4b,0xcc,0x04,0xfb,0x00,0x3e,0xc0,0x0f,0xb0,0x03,0x60 },
+  16, 0x9c60, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x00,0xff,0x08,0x33,0xc0 },
+  16, 0x9c70, 0, {0x1c,0xf0,0x03,0x70,0x40,0xc4,0xc0,0x33,0xc2,0x0f,0xf0,0x03,0x1c,0x10,0xc7,0x00 },
+  16, 0x9c80, 0, {0x31,0xc0,0x0c,0x70,0x03,0x1c,0x00,0xc5,0x41,0x33,0xc0,0x0c,0xf0,0x23,0x2c,0x00 },
+  16, 0x9c90, 0, {0xcf,0x00,0xb3,0xc0,0x6c,0xf0,0x03,0x80,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9ca0, 0, {0x81,0x04,0x6a,0x00,0xb9,0x90,0x32,0xf1,0x08,0xb0,0x02,0x0a,0x10,0xd9,0x00,0x22 },
+  16, 0x9cb0, 0, {0xc1,0x0b,0xb0,0x02,0x2c,0x00,0xcb,0x06,0x22,0xc0,0x88,0xb0,0x12,0x2c,0x00,0x88 },
+  16, 0x9cc0, 0, {0x80,0x22,0xc1,0x0d,0xb0,0x02,0x2c,0x00,0x83,0x00,0x22,0xc1,0x08,0xb0,0x46,0xe0 },
+  16, 0x9cd0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x2e,0x00,0xb9,0x00,0x22,0xf0 },
+  16, 0x9ce0, 0, {0x08,0xb0,0x12,0x64,0x00,0x8a,0x00,0x22,0xc0,0x0b,0x30,0x42,0x2c,0x00,0x8b,0x00 },
+  16, 0x9cf0, 0, {0x22,0xc0,0x08,0xb0,0x02,0x2c,0x00,0x8a,0x00,0x22,0xc0,0x88,0x30,0x0a,0x2c,0x00 },
+  16, 0x9d00, 0, {0x8b,0x00,0x20,0xc0,0x08,0xb0,0x02,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9d10, 0, {0x08,0x04,0x0c,0x04,0xb1,0x02,0xe4,0xc1,0x08,0xb0,0x22,0x20,0x02,0x93,0x00,0x20 },
+  16, 0x9d20, 0, {0xc0,0x0b,0x30,0x12,0x0c,0x02,0x83,0x02,0xa0,0xc0,0x28,0x30,0x0e,0x0c,0x02,0x80 },
+  16, 0x9d30, 0, {0x00,0xa0,0xc0,0x49,0x30,0x0a,0x0c,0x02,0x8b,0x00,0x20,0xc0,0x08,0x30,0x02,0xc2 },
+  16, 0x9d40, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x6c,0x00,0xf9,0x24,0x32,0xc0 },
+  16, 0x9d50, 0, {0x08,0xf0,0x03,0x64,0x00,0xc8,0x00,0xb3,0xc0,0x1f,0xf0,0x0b,0x3c,0x00,0x8f,0x00 },
+  16, 0x9d60, 0, {0x33,0xc0,0x4c,0xf0,0x43,0x3c,0x08,0xc3,0x00,0x31,0xc0,0x0c,0xf0,0x03,0x3d,0x48 },
+  16, 0x9d70, 0, {0xcf,0x00,0x31,0xc0,0x0c,0xf0,0x03,0x80,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9d80, 0, {0xa0,0x1d,0xf0,0x04,0xf9,0x41,0x3b,0xc0,0x4f,0xf0,0x03,0xf0,0x11,0xfd,0x00,0x3f },
+  16, 0x9d90, 0, {0xc0,0x87,0x70,0x27,0xfc,0x00,0xef,0x06,0x3f,0xc0,0x0f,0xf0,0x02,0xfc,0x08,0xfc },
+  16, 0x9da0, 0, {0x00,0x3f,0xc0,0x47,0xf0,0x43,0xfc,0x00,0x77,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0xe8 },
+  16, 0x9db0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xd2,0x00,0xc7,0x01,0x37,0x0c },
+  16, 0x9dc0, 0, {0x0f,0xe8,0x23,0x10,0x4a,0xc4,0xc0,0x31,0x30,0x0c,0xc9,0x03,0x34,0x46,0xcf,0x10 },
+  16, 0x9dd0, 0, {0x33,0xd0,0x0c,0xf4,0x03,0x3c,0x58,0xcf,0x00,0x33,0xc0,0x2d,0xf1,0x03,0x3e,0x02 },
+  16, 0x9de0, 0, {0xcf,0x21,0x3f,0xe4,0x0f,0xf2,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9df0, 0, {0x80,0x10,0xe4,0x84,0x0b,0x40,0x22,0x4c,0x0b,0xa8,0x02,0x2c,0xc0,0x8b,0x20,0x22 },
+  16, 0x9e00, 0, {0xc8,0x4a,0x32,0x02,0x24,0x80,0x83,0x20,0x20,0xc0,0x08,0x30,0x02,0x20,0x00,0x8b },
+  16, 0x9e10, 0, {0x21,0x32,0xca,0x48,0x32,0x02,0x2c,0x30,0x8f,0x90,0x2e,0x88,0x0b,0xbd,0x12,0x20 },
+  16, 0x9e20, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xce,0x20,0xa3,0x40,0xe0,0x48 },
+  16, 0x9e30, 0, {0x4b,0x20,0x22,0x0c,0x02,0x82,0x00,0x2a,0x00,0x08,0x20,0x02,0x04,0x80,0x80,0x20 },
+  16, 0x9e40, 0, {0x20,0xc8,0x08,0x02,0x02,0x0c,0x00,0x80,0x0c,0x60,0x00,0x08,0x20,0x12,0x2c,0x88 },
+  16, 0x9e50, 0, {0x83,0x00,0x2c,0xe8,0x0b,0x30,0x02,0x62,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9e60, 0, {0xc0,0x15,0xae,0x00,0xab,0x01,0xa2,0x60,0x0b,0xa0,0x02,0x20,0x01,0x81,0x00,0x22 },
+  16, 0x9e70, 0, {0xc0,0x0a,0x90,0x12,0x04,0x20,0x8a,0x08,0x22,0xc1,0x08,0xa0,0x02,0x28,0x00,0x88 },
+  16, 0x9e80, 0, {0x00,0x24,0x44,0x08,0xa2,0x02,0xac,0x00,0x8b,0x04,0x2e,0x88,0x03,0xb0,0x02,0x70 },
+  16, 0x9e90, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xec,0x00,0xea,0x90,0x32,0x28 },
+  16, 0x9ea0, 0, {0x0f,0xb6,0x03,0x20,0x08,0xc9,0x04,0x3a,0xc0,0x4c,0x90,0x22,0x24,0x00,0xcb,0x40 },
+  16, 0x9eb0, 0, {0x32,0xa8,0x0c,0xb2,0x03,0x2c,0x00,0xcb,0x80,0xb2,0xe0,0x0c,0xb0,0x0b,0x04,0x00 },
+  16, 0x9ec0, 0, {0xcb,0x00,0x3e,0xc0,0x4f,0xb0,0x0b,0x50,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9ed0, 0, {0xe0,0x01,0xbc,0x00,0xdf,0x80,0x3b,0x81,0x0f,0xf0,0xc3,0xfc,0x00,0xbe,0x01,0x1f },
+  16, 0x9ee0, 0, {0x00,0x0f,0xe0,0x23,0xf4,0x00,0xff,0x00,0x3f,0xb0,0x4f,0xf0,0x43,0xd4,0x02,0xff },
+  16, 0x9ef0, 0, {0x91,0x3a,0xe0,0x4e,0xf0,0x03,0x7c,0x0c,0xff,0x00,0x2f,0x80,0x0f,0x30,0x03,0xb8 },
+  16, 0x9f00, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x01,0xca,0x00,0x72,0x50 },
+  16, 0x9f10, 0, {0x04,0xb4,0x03,0x2c,0x82,0xcb,0x00,0x32,0xe0,0x0c,0xb8,0x03,0x27,0x04,0xc8,0xc8 },
+  16, 0x9f20, 0, {0xb2,0xa2,0x0c,0x88,0x03,0x2c,0x00,0xc1,0x00,0x3e,0x00,0x2c,0x30,0x1b,0x2c,0x04 },
+  16, 0x9f30, 0, {0xfb,0x10,0x3e,0xc0,0x0f,0xb0,0x03,0x10,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9f40, 0, {0xc8,0x05,0x2c,0x04,0x03,0x50,0xa2,0xe0,0x08,0x34,0x42,0x33,0x00,0x88,0x00,0x20 },
+  16, 0x9f50, 0, {0x10,0x0d,0x84,0x03,0x25,0x00,0x8a,0x40,0x22,0x90,0x08,0xa5,0x02,0x2c,0x00,0x89 },
+  16, 0x9f60, 0, {0xa4,0x3a,0x40,0x08,0xb0,0x02,0x2c,0x00,0xbf,0x84,0x2e,0x80,0x0b,0xf0,0x52,0x32 },
+  16, 0x9f70, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x6c,0x80,0x81,0x80,0x24,0x88 },
+  16, 0x9f80, 0, {0x89,0x3c,0x26,0x21,0x00,0x90,0x00,0x20,0x02,0x08,0x80,0x82,0x00,0x20,0x9b,0x00 },
+  16, 0x9f90, 0, {0x22,0x40,0x88,0xb0,0x12,0x0c,0x08,0x83,0x80,0x2c,0xc0,0x08,0x10,0x02,0x0c,0x00 },
+  16, 0x9fa0, 0, {0xb3,0x80,0x2c,0x40,0x0b,0x30,0x02,0x38,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0x9fb0, 0, {0x20,0x01,0x3e,0x0a,0x85,0xa0,0xa5,0x60,0x08,0xfb,0x82,0x3e,0x84,0x9f,0x81,0x63 },
+  16, 0x9fc0, 0, {0xe0,0x89,0x79,0x12,0x52,0x80,0x97,0x82,0x21,0x6c,0x18,0x78,0x02,0x12,0x00,0x87 },
+  16, 0x9fd0, 0, {0xa1,0x29,0xe0,0x08,0x5b,0x02,0x1e,0x00,0xb7,0xc0,0x2d,0x60,0x0b,0x78,0x02,0x08 },
+  16, 0x9fe0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0x81,0x08,0x26,0xc2 },
+  16, 0x9ff0, 0, {0x2c,0x32,0x13,0x0e,0xa4,0xd2,0x00,0xb0,0x00,0x1c,0x21,0x12,0x24,0x02,0xd1,0x20 },
+  16, 0xa000, 0, {0x30,0xc8,0x0c,0x10,0x03,0x0c,0x00,0xc2,0x10,0x3c,0x80,0x0c,0x23,0x03,0x0c,0x40 },
+  16, 0xa010, 0, {0xf3,0x00,0x3c,0x48,0x0f,0x30,0x0b,0x12,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa020, 0, {0x40,0x1d,0xbc,0x00,0xfd,0x20,0xbb,0x40,0x07,0x72,0x02,0xf0,0x10,0xed,0x10,0x3f },
+  16, 0xa030, 0, {0xc4,0x0f,0xd1,0x63,0xb4,0x80,0xef,0x00,0x3f,0xc8,0x0f,0xf0,0x03,0xd8,0x00,0xfe },
+  16, 0xa040, 0, {0x34,0x3f,0xc4,0x0f,0xeb,0x43,0xfc,0x00,0xff,0x08,0x7f,0x40,0x0f,0xf1,0x83,0xd0 },
+  16, 0xa050, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x00,0xc8,0x00,0x33,0x80 },
+  16, 0xa060, 0, {0x8f,0x28,0x03,0x20,0x00,0x49,0x02,0x32,0xc0,0x0f,0x90,0x03,0x20,0x00,0xcb,0x00 },
+  16, 0xa070, 0, {0x32,0x40,0x4c,0xb0,0x0b,0x2c,0x00,0xcb,0x80,0x32,0xc0,0x0e,0x9e,0x03,0x24,0x00 },
+  16, 0xa080, 0, {0xfb,0x20,0x3e,0xc0,0x0f,0xb0,0x03,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa090, 0, {0x48,0x11,0x9c,0x00,0x8d,0x01,0x21,0xc0,0x0b,0x60,0x02,0x1d,0x00,0xd6,0x00,0x21 },
+  16, 0xa0a0, 0, {0x00,0x0b,0xe0,0x02,0x00,0x00,0x83,0x04,0x20,0x40,0x08,0x70,0x42,0x34,0x02,0x87 },
+  16, 0xa0b0, 0, {0x01,0x23,0xc0,0x28,0x51,0x0a,0x1c,0x04,0xb7,0x30,0x2d,0xc0,0x0b,0x72,0x03,0x92 },
+  16, 0xa0c0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x00,0xa6,0x40,0x21,0xa0 },
+  16, 0xa0d0, 0, {0x0b,0x68,0x02,0x0e,0x00,0x8f,0x80,0x21,0xe0,0x0b,0x78,0x02,0x16,0x10,0xa5,0x80 },
+  16, 0xa0e0, 0, {0x21,0xe0,0x08,0x18,0x02,0x1e,0x00,0x83,0x80,0x21,0xa0,0x08,0x78,0x02,0x1f,0x00 },
+  16, 0xa0f0, 0, {0xb7,0x80,0x2d,0xe0,0x0b,0x38,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa100, 0, {0x48,0x14,0xec,0x12,0xa1,0x64,0x20,0xe6,0x0b,0x20,0x02,0x00,0x10,0x90,0x4a,0x20 },
+  16, 0xa110, 0, {0x20,0x4b,0x00,0x42,0x04,0x00,0x83,0x00,0x20,0xc2,0x08,0x30,0x02,0x8c,0x00,0x83 },
+  16, 0xa120, 0, {0x04,0x20,0xc0,0x08,0x30,0x02,0x0e,0x00,0xb3,0x00,0x2c,0xe0,0x4b,0x30,0x02,0x92 },
+  16, 0xa130, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xb8,0x00,0xee,0xc0,0x33,0x90 },
+  16, 0xa140, 0, {0x0f,0xa0,0x1b,0x08,0x00,0xca,0x40,0xb2,0x82,0x0f,0xa0,0x0b,0x28,0x02,0xca,0x00 },
+  16, 0xa150, 0, {0xb2,0x90,0xac,0xa0,0x03,0x29,0x00,0xca,0x40,0xb2,0x80,0x8e,0xa4,0x03,0x2a,0x00 },
+  16, 0xa160, 0, {0xfa,0x00,0x3f,0xa8,0x0f,0xa0,0x0b,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa170, 0, {0x48,0x00,0xe2,0x02,0x90,0x00,0x3e,0x00,0x0f,0x88,0x03,0xf1,0x00,0xfc,0x02,0x3f },
+  16, 0xa180, 0, {0x20,0x0f,0xc8,0x03,0xc1,0x00,0xf0,0x00,0x3e,0x00,0x8f,0x00,0x01,0x60,0x02,0xf8 },
+  16, 0xa190, 0, {0x08,0x3e,0x00,0x0f,0x80,0x83,0xe0,0x00,0xf8,0x00,0x2e,0x00,0x8f,0x80,0x13,0x92 },
+  16, 0xa1a0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x02,0xc9,0x00,0xb2,0x64 },
+  16, 0xa1b0, 0, {0x0f,0x91,0x03,0xe4,0x04,0xc9,0x00,0x32,0x40,0x6c,0x90,0x03,0x25,0x02,0xc9,0x90 },
+  16, 0xa1c0, 0, {0xb0,0x40,0x0c,0x90,0x03,0x24,0x20,0xc9,0xa0,0x3e,0x40,0x4c,0x90,0x23,0xe4,0x00 },
+  16, 0xa1d0, 0, {0xf1,0x00,0x92,0x40,0x0c,0x10,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa1e0, 0, {0x80,0x04,0x64,0x00,0x89,0x80,0xa2,0x40,0x0b,0x96,0x42,0xe5,0x04,0x89,0x00,0x22 },
+  16, 0xa1f0, 0, {0x40,0x08,0x90,0x02,0x24,0x08,0x09,0x41,0x22,0x40,0x48,0x90,0x42,0x24,0x04,0x89 },
+  16, 0xa200, 0, {0x80,0x26,0x40,0x08,0x90,0x02,0xe4,0x00,0xb9,0x00,0x22,0x40,0x08,0x94,0x02,0x20 },
+  16, 0xa210, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x25,0x00,0x89,0x20,0x22,0x40 },
+  16, 0xa220, 0, {0x0b,0x90,0x02,0xf4,0x84,0x85,0x00,0x21,0x40,0x48,0x50,0x02,0x24,0x20,0x8d,0x08 },
+  16, 0xa230, 0, {0x23,0x40,0x08,0xd0,0x02,0x94,0x00,0x8d,0x00,0x29,0x40,0x0a,0xd0,0x02,0xa4,0x08 },
+  16, 0xa240, 0, {0xb9,0x00,0x28,0x40,0x18,0x90,0xc2,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa250, 0, {0x08,0x04,0x05,0x00,0x81,0x00,0x20,0x51,0x0b,0x10,0x02,0xf5,0x80,0x85,0xc1,0xa1 },
+  16, 0xa260, 0, {0x50,0x08,0x54,0x0a,0x05,0x06,0x85,0x40,0x21,0x50,0x88,0x54,0x02,0x95,0x00,0x85 },
+  16, 0xa270, 0, {0x44,0x2d,0x50,0x2a,0x54,0x12,0xc5,0x01,0xb1,0x00,0x08,0x50,0x08,0x10,0x02,0x02 },
+  16, 0xa280, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xca,0x50,0x32,0x80 },
+  16, 0xa290, 0, {0x0f,0x80,0x03,0xe8,0x02,0xc8,0x01,0x32,0x00,0x2c,0xc0,0x03,0x20,0x00,0xc8,0x02 },
+  16, 0xa2a0, 0, {0x32,0x00,0x2c,0x80,0x0b,0xa0,0x00,0xc8,0x00,0x3a,0x00,0x4e,0x40,0x23,0xa0,0x08 },
+  16, 0xa2b0, 0, {0xf8,0x00,0x3a,0x00,0x2c,0x80,0x0b,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa2c0, 0, {0x98,0x1d,0xdc,0x04,0xfd,0x40,0x3f,0x50,0x4f,0x90,0x63,0xe4,0x40,0xf1,0x02,0x3e },
+  16, 0xa2d0, 0, {0x41,0x0f,0x90,0x13,0xf5,0x04,0xf9,0x41,0x3e,0x50,0x0f,0x94,0x43,0x65,0x02,0xf9 },
+  16, 0xa2e0, 0, {0x41,0x36,0x50,0x4d,0x94,0x03,0xf4,0x00,0xf9,0x41,0x37,0x40,0x4f,0x94,0x03,0xe6 },
+  16, 0xa2f0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0xfc,0x00,0xcd,0xa8,0x33,0x70 },
+  16, 0xa300, 0, {0x0f,0xd0,0x13,0xf6,0x88,0xcd,0x00,0x32,0x50,0x4f,0x14,0x23,0x07,0xa0,0xc9,0xc0 },
+  16, 0xa310, 0, {0x32,0x78,0x0c,0x9e,0x03,0x37,0x02,0xcd,0xc0,0x32,0x64,0x0f,0x98,0x03,0x24,0x00 },
+  16, 0xa320, 0, {0xcd,0x00,0x32,0x40,0x2c,0xda,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa330, 0, {0x38,0x10,0xe2,0x08,0x88,0xeb,0x22,0x30,0x0b,0x80,0x12,0xe8,0x04,0xa0,0xa0,0x2a },
+  16, 0xa340, 0, {0x20,0x0b,0x8a,0x0a,0x23,0x00,0x88,0x80,0x22,0x28,0x00,0xc8,0x42,0x23,0x80,0x80 },
+  16, 0xa350, 0, {0xd4,0x20,0x28,0x09,0x80,0x02,0x22,0x94,0xa8,0x00,0x2a,0x00,0x88,0x85,0x02,0x0e },
+  16, 0xa360, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0xa0,0x83,0x00,0x24,0xd8 },
+  16, 0xa370, 0, {0x8b,0x10,0x02,0xe5,0x14,0x89,0x0a,0x21,0x48,0x0b,0x52,0x02,0x54,0x80,0x85,0x40 },
+  16, 0xa380, 0, {0x25,0x58,0x09,0x56,0x02,0x45,0x02,0x81,0x20,0x20,0x50,0x0b,0x14,0x02,0x04,0x30 },
+  16, 0xa390, 0, {0x81,0x00,0x20,0x40,0x08,0x10,0x02,0x42,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa3a0, 0, {0x18,0x15,0xa4,0x12,0x89,0x00,0xa6,0x40,0x0b,0x90,0x42,0xe4,0x98,0xa9,0x80,0x2b },
+  16, 0xa3b0, 0, {0x40,0x0b,0x51,0x02,0x55,0x00,0x9d,0x08,0x27,0x48,0x09,0xf6,0x02,0x44,0x00,0x81 },
+  16, 0xa3c0, 0, {0x04,0x22,0x40,0x19,0x91,0x8a,0x24,0x80,0xa9,0x00,0x2a,0x40,0x08,0x90,0x02,0x46 },
+  16, 0xa3d0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe7,0x02,0xc9,0x04,0x36,0x58 },
+  16, 0xa3e0, 0, {0x0f,0x90,0x03,0xc5,0x00,0xc9,0x00,0x32,0x40,0x0f,0x90,0x13,0x64,0x02,0xc9,0x00 },
+  16, 0xa3f0, 0, {0x36,0x40,0x2d,0x90,0x0b,0x66,0x04,0xc9,0xe0,0xb2,0x48,0x8f,0x98,0x47,0x24,0x00 },
+  16, 0xa400, 0, {0xc9,0x00,0x72,0x40,0x0c,0x10,0x03,0x68,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa410, 0, {0x28,0x01,0xa5,0x08,0xf9,0x21,0x3a,0x40,0x0f,0x90,0x03,0xe6,0x04,0xf9,0x00,0x3e },
+  16, 0xa420, 0, {0x40,0x4f,0x98,0x83,0xa4,0x00,0xe9,0x40,0xba,0x60,0x0e,0x90,0x03,0xa4,0x80,0xf9 },
+  16, 0xa430, 0, {0xa3,0x3e,0x48,0x0f,0x98,0x0b,0xe4,0x00,0xf9,0x00,0x1e,0x40,0x0f,0x90,0x03,0x8a },
+  16, 0xa440, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa2,0x48,0xc8,0x20,0x32,0x08 },
+  16, 0xa450, 0, {0x1f,0x80,0x83,0xe1,0x22,0xc8,0x01,0x33,0x00,0x2c,0xc0,0x03,0x30,0x04,0xcc,0x40 },
+  16, 0xa460, 0, {0xb1,0x00,0x0c,0x44,0x03,0x20,0x12,0xc8,0x41,0x32,0x00,0x2d,0x84,0x0b,0x60,0x00 },
+  16, 0xa470, 0, {0xf8,0x00,0xb2,0x00,0x4c,0x80,0x0b,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa480, 0, {0x28,0x05,0x3a,0x00,0xa6,0x00,0x23,0x90,0x03,0xe4,0x92,0xf8,0x00,0x82,0x00,0x36 },
+  16, 0xa490, 0, {0x80,0x08,0xa0,0x03,0x68,0x00,0xca,0x00,0x22,0x83,0x08,0xa0,0x02,0x28,0x03,0x8a },
+  16, 0xa4a0, 0, {0x00,0x22,0x80,0x08,0xa0,0x02,0x28,0x00,0xb6,0x80,0x22,0x80,0x0d,0xe8,0x02,0x0a },
+  16, 0xa4b0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x6e,0x00,0x82,0x42,0x20,0xc0 },
+  16, 0xa4c0, 0, {0x0b,0x34,0x02,0xcd,0x09,0x80,0x00,0x20,0x00,0x08,0x00,0x02,0x00,0x02,0x98,0x00 },
+  16, 0xa4d0, 0, {0x20,0x20,0x28,0x00,0x0a,0x04,0x10,0x81,0x80,0x20,0xc0,0x08,0xb0,0x02,0x2c,0x00 },
+  16, 0xa4e0, 0, {0xb3,0x00,0x22,0xc0,0x18,0x31,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa4f0, 0, {0xa0,0x01,0x38,0x02,0xa3,0x00,0x21,0x40,0x1b,0x70,0x02,0xdc,0x20,0x84,0x05,0x65 },
+  16, 0xa500, 0, {0xe0,0x08,0xf0,0x02,0x7c,0x10,0x97,0x00,0x24,0xc0,0x08,0x30,0x02,0x54,0x88,0x87 },
+  16, 0xa510, 0, {0x09,0x21,0xe8,0x09,0x33,0x02,0x1c,0x80,0xb6,0x08,0x63,0xc8,0x09,0x38,0x12,0x28 },
+  16, 0xa520, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0x00,0xc7,0xa0,0xa1,0xe0 },
+  16, 0xa530, 0, {0x0b,0x78,0x03,0xfe,0x00,0xc5,0x82,0x33,0x20,0x0c,0x48,0x03,0x1e,0x01,0xdf,0x80 },
+  16, 0xa540, 0, {0x31,0x20,0x0c,0x48,0x03,0x06,0x40,0x87,0x82,0x31,0xf8,0x0d,0x7b,0x03,0x5f,0x00 },
+  16, 0xa550, 0, {0xf3,0x80,0x31,0xf2,0x0c,0x60,0x03,0x2a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa560, 0, {0x08,0x1d,0x9c,0x00,0xfb,0x01,0x2f,0x40,0x07,0xb0,0x03,0xe8,0x04,0xf9,0x00,0x3e },
+  16, 0xa570, 0, {0xc1,0x0f,0xb0,0x03,0xe0,0x06,0xe8,0x02,0x3a,0xc0,0x0f,0xb0,0x01,0xa4,0x10,0xf9 },
+  16, 0xa580, 0, {0x40,0xbe,0xd0,0x06,0xb0,0x03,0xee,0x00,0xfa,0x00,0x3c,0xd8,0x0f,0xa0,0x03,0xc2 },
+  16, 0xa590, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xf6,0x00,0xcf,0x88,0x33,0x64 },
+  16, 0xa5a0, 0, {0x2c,0xf8,0x03,0xfe,0x02,0xc4,0xb0,0x33,0x20,0x8c,0xd8,0x03,0x32,0x00,0xcc,0xb4 },
+  16, 0xa5b0, 0, {0x33,0xa0,0x0c,0xc8,0x03,0x16,0x20,0xcf,0xc0,0x33,0xf0,0x0c,0xf8,0x03,0xfe,0x00 },
+  16, 0xa5c0, 0, {0xcd,0x80,0x3f,0xe0,0x0f,0xd8,0x03,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa5d0, 0, {0xa8,0x11,0xb5,0x04,0x87,0x12,0xa1,0x50,0x0a,0x74,0x12,0xc4,0x40,0x84,0x11,0x23 },
+  16, 0xa5e0, 0, {0xc0,0x28,0xe0,0x02,0x1c,0x02,0xa7,0x11,0x21,0x58,0x48,0x70,0x0a,0x14,0x00,0x8d },
+  16, 0xa5f0, 0, {0x00,0x23,0xc0,0x0b,0x70,0x02,0xfc,0x40,0x86,0x00,0x2d,0xc0,0x0b,0x50,0x02,0x2a },
+  16, 0xa600, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x95,0x00,0x87,0x40,0x21,0x00 },
+  16, 0xa610, 0, {0x18,0x71,0x02,0xdc,0x00,0x95,0x28,0xe1,0x02,0x08,0x50,0x02,0x3c,0x42,0xa7,0x22 },
+  16, 0xa620, 0, {0x21,0x80,0x88,0x41,0x02,0x14,0x00,0x85,0x00,0xa1,0xc0,0x09,0x71,0x02,0xdc,0x00 },
+  16, 0xa630, 0, {0xb5,0x10,0x2d,0xc0,0x0b,0x40,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa640, 0, {0x20,0x14,0xc4,0x10,0x83,0x84,0x20,0x11,0x08,0x30,0x02,0xc3,0x10,0x91,0x20,0x20 },
+  16, 0xa650, 0, {0xc0,0x08,0x28,0x12,0x00,0x00,0xa0,0x84,0x20,0x40,0x08,0x30,0x02,0x04,0x26,0x83 },
+  16, 0xa660, 0, {0x00,0x20,0xd0,0x0b,0x30,0x02,0xcc,0x00,0xb2,0x00,0x2c,0xc0,0x0b,0x00,0x02,0x08 },
+  16, 0xa670, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xad,0x00,0xcf,0x88,0xb2,0xe8 },
+  16, 0xa680, 0, {0x0c,0x30,0x13,0xce,0xc2,0xd0,0x82,0x32,0x00,0x0c,0x0e,0x0b,0x20,0x00,0xc8,0x88 },
+  16, 0xa690, 0, {0xb2,0x40,0x2c,0xba,0x43,0x37,0x02,0xcb,0x00,0xb3,0xc0,0x2c,0xf0,0x03,0xfc,0x12 },
+  16, 0xa6a0, 0, {0xfb,0x00,0x7f,0xd1,0x0f,0x30,0x0b,0x2b,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa6b0, 0, {0x80,0x00,0xed,0x02,0xf1,0x40,0x3e,0x41,0x0f,0xb0,0x23,0xed,0x00,0xe8,0x01,0x3e },
+  16, 0xa6c0, 0, {0xc8,0x0f,0xb0,0x13,0xec,0x04,0xdb,0x00,0x3c,0x80,0x0f,0x04,0x03,0xe4,0x40,0xf9 },
+  16, 0xa6d0, 0, {0x00,0x3c,0xc2,0x0e,0xb0,0x03,0xee,0x00,0x4b,0x41,0x3e,0xc0,0x0f,0xb0,0x03,0xe0 },
+  16, 0xa6e0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x00,0x4b,0x00,0x32,0x42 },
+  16, 0xa6f0, 0, {0x0c,0xf0,0x03,0x36,0x80,0xcd,0x00,0x33,0x00,0x4c,0xc0,0x83,0x3c,0x04,0xf7,0x00 },
+  16, 0xa700, 0, {0x32,0x40,0x0c,0xb1,0x43,0x14,0x00,0xcd,0x80,0x33,0xc0,0x0c,0xf0,0x03,0xfc,0x00 },
+  16, 0xa710, 0, {0xff,0x00,0xb3,0xc2,0x0c,0xa0,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa720, 0, {0x81,0x04,0x4f,0x02,0x8b,0x80,0x20,0x30,0x08,0xbc,0x02,0x20,0x10,0x89,0x00,0x22 },
+  16, 0xa730, 0, {0xc0,0x00,0xb0,0x03,0x60,0x04,0xb8,0x00,0xa2,0x90,0x28,0x8c,0x1a,0x24,0x02,0x8b },
+  16, 0xa740, 0, {0x83,0x22,0xc1,0x08,0xb0,0x02,0xfc,0x00,0xb3,0x60,0x20,0xc0,0x0d,0xa0,0x03,0xe0 },
+  16, 0xa750, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2e,0x00,0xab,0xc0,0x22,0x60 },
+  16, 0xa760, 0, {0x08,0xb8,0x02,0x29,0x00,0x88,0x01,0x20,0x00,0x08,0x90,0x02,0x20,0x00,0xb8,0x00 },
+  16, 0xa770, 0, {0x22,0xc0,0x08,0xb0,0x02,0xe4,0x00,0x81,0x24,0xa2,0xc0,0x09,0xb0,0x46,0xec,0x00 },
+  16, 0xa780, 0, {0xb9,0x00,0x22,0xc0,0x08,0x90,0x02,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa790, 0, {0x08,0x04,0x2c,0x00,0xa1,0x00,0xa0,0x41,0x08,0xb0,0x0a,0x20,0x53,0x88,0x00,0x20 },
+  16, 0xa7a0, 0, {0xc0,0x28,0xa0,0x02,0x4c,0x00,0xb3,0x00,0x20,0x00,0x88,0x00,0x02,0x84,0x00,0x83 },
+  16, 0xa7b0, 0, {0x04,0x20,0xc0,0x28,0x30,0x02,0xcc,0x00,0xb3,0x02,0x62,0xc0,0x09,0x10,0x02,0xc2 },
+  16, 0xa7c0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x6c,0x00,0xe9,0x00,0x22,0x00 },
+  16, 0xa7d0, 0, {0x0c,0xb0,0x03,0x00,0x04,0xc9,0x00,0xb2,0x00,0x0c,0x90,0x03,0x2c,0x00,0xf3,0x00 },
+  16, 0xa7e0, 0, {0xb2,0xc0,0x8c,0xb0,0x03,0xb4,0x02,0x8f,0x00,0x23,0xc0,0x04,0xf0,0x03,0xec,0x08 },
+  16, 0xa7f0, 0, {0xf9,0x00,0x33,0xc0,0x0c,0x80,0x03,0x00,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa800, 0, {0xa0,0x1d,0xfc,0x10,0xdd,0x04,0x3f,0x00,0x0f,0xc0,0x23,0xf0,0x90,0xfd,0x00,0x2f },
+  16, 0xa810, 0, {0xc0,0x0f,0xe0,0x43,0xd0,0x00,0xfc,0x00,0x3f,0x00,0x8f,0xc0,0x22,0x74,0x00,0xfd },
+  16, 0xa820, 0, {0x04,0x3f,0xc0,0x0f,0xf0,0x03,0xfc,0x00,0xff,0x06,0x3f,0xc0,0x0f,0xc0,0x43,0xe8 },
+  16, 0xa830, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfc,0x80,0xef,0x20,0x11,0xc0 },
+  16, 0xa840, 0, {0x0e,0x72,0x03,0xbd,0xb0,0xcf,0x31,0xbf,0xcc,0x02,0xf0,0x03,0xfc,0xc6,0xcf,0x01 },
+  16, 0xa850, 0, {0x0b,0xc5,0x0f,0xf1,0x03,0x3c,0x04,0xef,0x61,0x33,0xd8,0x07,0xf0,0x03,0x34,0x80 },
+  16, 0xa860, 0, {0xcd,0x30,0x73,0xcc,0x0f,0xe8,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa870, 0, {0x80,0x18,0xe9,0x00,0x88,0x69,0x22,0x10,0x08,0x8c,0x00,0x21,0x84,0x88,0x41,0x22 },
+  16, 0xa880, 0, {0x10,0x88,0x86,0x92,0x01,0x00,0x88,0x62,0x22,0x10,0x4b,0x87,0x02,0x21,0xa0,0x88 },
+  16, 0xa890, 0, {0x60,0x20,0x10,0x0b,0x86,0xa2,0x35,0xa0,0xab,0x60,0xa1,0xc4,0x0b,0xb8,0x02,0x20 },
+  16, 0xa8a0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcd,0xa8,0x33,0x41,0x20,0xc6 },
+  16, 0xa8b0, 0, {0x4a,0x31,0x00,0x8c,0x10,0x93,0x33,0x28,0xcc,0x29,0x34,0x12,0x8c,0x50,0x93,0x1c },
+  16, 0xa8c0, 0, {0x28,0x84,0x01,0x20,0x4a,0x4c,0x41,0x83,0x10,0x24,0xcc,0x4b,0x31,0x42,0x4c,0x40 },
+  16, 0xa8d0, 0, {0x91,0x10,0x24,0xc0,0x0b,0x80,0x02,0x22,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa8e0, 0, {0xc0,0x05,0xa8,0x20,0x90,0x02,0x22,0x00,0x08,0x80,0x00,0x20,0x30,0xb8,0x08,0x26 },
+  16, 0xa8f0, 0, {0x00,0x01,0x80,0x82,0x20,0x20,0x18,0x08,0x42,0x40,0x03,0x91,0x02,0x60,0x00,0x08 },
+  16, 0xa900, 0, {0x01,0xa6,0x00,0x0b,0x80,0x00,0x6c,0x10,0xbb,0x01,0x26,0xc0,0x4b,0x90,0x0a,0x30 },
+  16, 0xa910, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0xfd,0x00,0xfd,0x41,0x33,0xa1 },
+  16, 0xa920, 0, {0x0e,0xd2,0x03,0xb5,0x02,0xdf,0x42,0x3b,0x01,0x0f,0xd4,0x43,0xb5,0x00,0xcd,0x40 },
+  16, 0xa930, 0, {0x1b,0xc4,0x0d,0x78,0x03,0x70,0x02,0xec,0x00,0x17,0xa1,0x0f,0xe8,0x0b,0x2c,0x02 },
+  16, 0xa940, 0, {0xd9,0x90,0x26,0xc0,0x0f,0xac,0x03,0x00,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa950, 0, {0xe0,0x01,0xb8,0x00,0xee,0x00,0x1f,0x64,0x4f,0xe0,0x03,0xd8,0x10,0xc4,0x18,0x33 },
+  16, 0xa960, 0, {0xc0,0x0c,0xa0,0xa1,0xb8,0x09,0xe6,0x09,0x36,0x22,0x0f,0x88,0x23,0xbc,0x00,0xfb },
+  16, 0xa970, 0, {0x00,0x3b,0x64,0x0f,0xd9,0x03,0x9c,0x00,0xe3,0x04,0x3b,0xc0,0x0f,0xf4,0x03,0xf8 },
+  16, 0xa980, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0x8d,0x00,0xc9,0x40,0xb6,0x80 },
+  16, 0xa990, 0, {0x0f,0x10,0x03,0xa7,0x20,0xfb,0x50,0xb6,0x08,0x4c,0x14,0x03,0x65,0x22,0xd9,0x40 },
+  16, 0xa9a0, 0, {0xb6,0x80,0x0e,0xa0,0x0b,0x00,0x00,0xd8,0x00,0x76,0x82,0x28,0xa0,0x23,0x64,0x00 },
+  16, 0xa9b0, 0, {0xc9,0x04,0x12,0xc0,0x8e,0x80,0x03,0x90,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xa9c0, 0, {0xc8,0x05,0x2b,0x60,0x8a,0x09,0x20,0x50,0x08,0xa0,0x23,0xe9,0x00,0xb8,0xc0,0x22 },
+  16, 0xa9d0, 0, {0xf0,0x08,0xac,0x02,0x28,0x04,0x8a,0xc2,0x22,0x50,0x08,0x90,0x06,0x2c,0x00,0x8b },
+  16, 0xa9e0, 0, {0x04,0x22,0x51,0x08,0x94,0x02,0xe4,0x04,0x8b,0x04,0x37,0xc0,0x08,0x18,0x42,0x26 },
+  16, 0xa9f0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x04,0x4b,0x00,0x82,0xc8,0x24,0x43 },
+  16, 0xaa00, 0, {0x0b,0x26,0x0a,0x88,0x00,0xb0,0x80,0x22,0xe4,0x0b,0x20,0x42,0x69,0x00,0xa2,0x90 },
+  16, 0xaa10, 0, {0x28,0x40,0xe8,0x10,0x02,0x0c,0x00,0xbb,0x00,0x28,0x50,0x88,0x90,0x82,0xc4,0x01 },
+  16, 0xaa20, 0, {0x83,0x00,0x20,0xc0,0x0a,0x10,0x02,0xba,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xaa30, 0, {0x20,0x10,0x4e,0x80,0x81,0x00,0x21,0xa8,0x08,0x58,0x02,0xd6,0x01,0xb7,0x90,0x68 },
+  16, 0xaa40, 0, {0x20,0x03,0x59,0x82,0x56,0x00,0xa5,0x84,0x2d,0xa2,0x18,0x69,0x22,0x02,0x00,0x34 },
+  16, 0xaa50, 0, {0x80,0x29,0xa8,0x08,0x68,0x06,0xc6,0x14,0x85,0x82,0x25,0xe0,0x08,0x58,0x82,0x1c },
+  16, 0xaa60, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x48,0x00,0xc2,0xf0,0x34,0x40 },
+  16, 0xaa70, 0, {0x0f,0x20,0x03,0x88,0x80,0xf8,0x10,0x30,0xc0,0x27,0x21,0x0b,0x48,0x80,0xea,0x20 },
+  16, 0xaa80, 0, {0x38,0x00,0x0c,0x00,0x12,0x0c,0x08,0x73,0x00,0xb8,0x40,0x0c,0x12,0x23,0x4c,0x02 },
+  16, 0xaa90, 0, {0x43,0x34,0x30,0xc0,0x0e,0x11,0x03,0x92,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xaaa0, 0, {0x40,0x15,0xac,0x90,0xf9,0x01,0x2e,0x88,0x4b,0x90,0x11,0x64,0x00,0xfb,0x10,0x32 },
+  16, 0xaab0, 0, {0x00,0x00,0x91,0x03,0xa4,0x00,0xc9,0x00,0x32,0xc4,0x4d,0xb0,0x43,0xe0,0x04,0xc8 },
+  16, 0xaac0, 0, {0x00,0x36,0x89,0x0f,0xa8,0x03,0xed,0x00,0xf9,0x14,0x3e,0xc0,0x0f,0x10,0x43,0xd0 },
+  16, 0xaad0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xe8,0x00,0xc8,0x00,0x3a,0x00 },
+  16, 0xaae0, 0, {0x0c,0x00,0x53,0xa0,0x00,0xe8,0x01,0x32,0x01,0x0e,0x80,0x53,0x20,0x10,0xc8,0x00 },
+  16, 0xaaf0, 0, {0x3a,0x40,0x0c,0x90,0x03,0x20,0x10,0xe8,0x04,0xb6,0x00,0x84,0x80,0x03,0x2d,0x12 },
+  16, 0xab00, 0, {0xcb,0x00,0x2e,0xca,0x04,0x90,0x03,0xea,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xab10, 0, {0x4c,0x19,0x8c,0x00,0x87,0x02,0x21,0xc0,0x08,0x70,0x02,0x0c,0x00,0x83,0x00,0x21 },
+  16, 0xab20, 0, {0xc0,0x08,0x30,0x62,0x4c,0x04,0x83,0x00,0x21,0x80,0x48,0xe0,0x12,0x3c,0x00,0x87 },
+  16, 0xab30, 0, {0x00,0x21,0xc0,0x08,0x70,0x02,0x1c,0x00,0x85,0x01,0x24,0xd0,0x0a,0x50,0x02,0xf2 },
+  16, 0xab40, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x9a,0x00,0x80,0x80,0x28,0x20 },
+  16, 0xab50, 0, {0x08,0x4c,0x22,0xd2,0x00,0xa4,0x80,0x24,0x30,0x0b,0x48,0x02,0x52,0x00,0x84,0xc0 },
+  16, 0xab60, 0, {0x21,0x20,0x09,0x48,0x68,0x13,0x00,0xa4,0x80,0x60,0x20,0x09,0x08,0x02,0x56,0x00 },
+  16, 0xab70, 0, {0x97,0x80,0x2d,0xe0,0x88,0x58,0x02,0xe0,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xab80, 0, {0x6c,0x04,0xcc,0x00,0x83,0x80,0x20,0xd8,0x08,0x30,0x02,0x4c,0x40,0x83,0x00,0x24 },
+  16, 0xab90, 0, {0xd1,0x09,0xb9,0x42,0x4e,0x00,0x83,0x00,0x20,0xc1,0x89,0x30,0x42,0x0c,0x00,0x83 },
+  16, 0xaba0, 0, {0xf0,0xa0,0xd9,0x19,0x36,0x22,0x66,0x06,0x91,0x00,0x0c,0xc1,0x0a,0x10,0x02,0xc2 },
+  16, 0xabb0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xe8,0x02,0xca,0xa5,0x2a,0x91 },
+  16, 0xabc0, 0, {0x28,0xa8,0x03,0xea,0x02,0xaa,0x00,0xb6,0xa0,0x0f,0xa0,0x0a,0x2a,0x92,0xca,0x83 },
+  16, 0xabd0, 0, {0xba,0x80,0x29,0xa0,0x03,0x2b,0x00,0xea,0x40,0x66,0x90,0x2d,0xe4,0x0b,0x6a,0x80 },
+  16, 0xabe0, 0, {0xda,0x00,0x3e,0x80,0x0c,0xe0,0x03,0xfa,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xabf0, 0, {0x48,0x01,0x80,0x00,0xfc,0x00,0x3d,0x00,0x0f,0xc0,0x03,0xb0,0x14,0xfc,0x00,0x3b },
+  16, 0xac00, 0, {0x12,0x0e,0xc0,0x43,0xb1,0x14,0xfc,0x00,0x3d,0x00,0x0e,0xc0,0x03,0xf0,0x20,0xf4 },
+  16, 0xac10, 0, {0x00,0x31,0x00,0x0e,0x44,0x13,0xa0,0x00,0xe8,0x06,0x36,0x00,0x4f,0x80,0x13,0xd2 },
+  16, 0xac20, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xa4,0x00,0xd1,0x00,0x36,0x60 },
+  16, 0xac30, 0, {0x1c,0x18,0x0b,0x46,0x00,0xd9,0x80,0x30,0x40,0x2c,0x98,0x05,0x86,0x00,0xc1,0x80 },
+  16, 0xac40, 0, {0x92,0x40,0x0d,0x10,0x03,0x44,0x02,0x89,0x00,0x32,0x70,0x0c,0x98,0x01,0x24,0x00 },
+  16, 0xac50, 0, {0xc9,0x04,0x30,0x40,0x0c,0x90,0x03,0xc2,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xac60, 0, {0x80,0x04,0x64,0x00,0x89,0x00,0x22,0x40,0x08,0x94,0x02,0x24,0x80,0x89,0x01,0x22 },
+  16, 0xac70, 0, {0x40,0x48,0x91,0x02,0x24,0x00,0xd9,0x90,0x22,0x41,0x08,0x90,0x12,0x24,0x10,0x89 },
+  16, 0xac80, 0, {0x00,0x32,0x40,0x08,0x95,0x12,0x24,0x02,0x81,0x00,0xa2,0x41,0x0d,0x90,0x42,0xe0 },
+  16, 0xac90, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x05,0x24,0x02,0x9d,0x00,0x23,0x44 },
+  16, 0xaca0, 0, {0x08,0xd2,0x06,0x74,0x80,0xb5,0x20,0x23,0x40,0x1a,0xd0,0x06,0x35,0x90,0x8d,0x02 },
+  16, 0xacb0, 0, {0x2f,0x44,0x19,0xd0,0x02,0x74,0x00,0x8d,0x00,0x63,0x40,0x18,0xd4,0x02,0xa4,0x11 },
+  16, 0xacc0, 0, {0x89,0x00,0x22,0x40,0x08,0xb0,0x02,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xacd0, 0, {0x28,0x14,0x04,0x80,0x85,0x20,0x21,0x68,0x08,0x52,0x02,0x14,0x80,0xa5,0x20,0xa1 },
+  16, 0xace0, 0, {0x48,0x0a,0x72,0x38,0x14,0x80,0x95,0x24,0x2d,0x48,0x28,0x52,0x02,0x14,0x80,0x85 },
+  16, 0xacf0, 0, {0x20,0x21,0x48,0x08,0x52,0x06,0x84,0x80,0x81,0x20,0x20,0x4a,0x09,0x10,0x02,0xc2 },
+  16, 0xad00, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x0d,0x61,0x40,0xd8,0x50,0xb2,0x14 },
+  16, 0xad10, 0, {0x28,0xa0,0x03,0x61,0x40,0xf8,0x50,0x32,0x94,0x4e,0x85,0x04,0x21,0x42,0xc8,0x50 },
+  16, 0xad20, 0, {0x3c,0x14,0x0d,0x80,0x03,0x61,0x40,0x88,0x50,0xb2,0x14,0x2c,0xc5,0x09,0xa1,0x40 },
+  16, 0xad30, 0, {0xc8,0x50,0x32,0x1c,0x0c,0x80,0x03,0xee,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xad40, 0, {0x98,0x15,0xe4,0x40,0xf9,0x10,0x3a,0x44,0x0f,0x91,0x03,0xe4,0x40,0xd9,0x14,0x3e },
+  16, 0xad50, 0, {0x44,0x0d,0x91,0x43,0x64,0x40,0xe9,0x10,0x32,0x44,0x07,0x93,0xc3,0xe4,0x50,0xd1 },
+  16, 0xad60, 0, {0x10,0x7e,0x44,0x03,0x91,0x01,0x54,0x44,0xfd,0x14,0x3e,0x40,0x0f,0xd0,0x03,0xe6 },
+  16, 0xad70, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xf6,0x80,0xdd,0xa0,0x33,0x68 },
+  16, 0xad80, 0, {0x1e,0xda,0x03,0x36,0x90,0xcd,0xa0,0x3b,0x68,0x0a,0xd8,0x23,0x76,0x0c,0xed,0x80 },
+  16, 0xad90, 0, {0x2b,0x62,0x0b,0x99,0x02,0xa7,0x80,0xf9,0xe1,0x37,0x68,0x0c,0xda,0x03,0x27,0x80 },
+  16, 0xada0, 0, {0xc9,0xa2,0x22,0x68,0x4c,0x50,0x03,0xc6,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xadb0, 0, {0x38,0x18,0xe1,0x40,0x88,0x50,0x22,0x14,0x08,0x80,0x22,0x60,0x00,0x88,0x04,0x22 },
+  16, 0xadc0, 0, {0x00,0x08,0x04,0x26,0x01,0x00,0x88,0x50,0x22,0x10,0x08,0xaf,0x02,0x23,0x00,0x88 },
+  16, 0xadd0, 0, {0xc0,0xa0,0x10,0x88,0x84,0x02,0x23,0x80,0xa0,0x40,0x2a,0x10,0x08,0x80,0x12,0x4e },
+  16, 0xade0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x84,0x00,0x81,0x01,0x20,0x40 },
+  16, 0xadf0, 0, {0x0a,0x14,0x02,0x45,0x00,0x81,0x41,0x2c,0x50,0x0b,0x14,0x02,0x05,0x04,0xa1,0x00 },
+  16, 0xae00, 0, {0x28,0x40,0x82,0x10,0x02,0x84,0x40,0xa1,0x32,0x80,0x50,0x09,0x14,0x02,0x04,0xc4 },
+  16, 0xae10, 0, {0x91,0x10,0x64,0x44,0x28,0x10,0x02,0xd2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xae20, 0, {0x18,0x04,0xac,0x02,0x81,0x00,0x22,0xc1,0x08,0x90,0x02,0x44,0x02,0x89,0x02,0x26 },
+  16, 0xae30, 0, {0x41,0x09,0x90,0x0a,0x24,0x0c,0x89,0x04,0x22,0x50,0x08,0x90,0x26,0x24,0x00,0x89 },
+  16, 0xae40, 0, {0x00,0x22,0x41,0x09,0x10,0x22,0x24,0x40,0xb9,0x01,0x2e,0x40,0x08,0x90,0x02,0x46 },
+  16, 0xae50, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x10,0x89,0x00,0x32,0x40 },
+  16, 0xae60, 0, {0x0a,0x90,0x0b,0x24,0x10,0x89,0x00,0x1e,0x40,0x9b,0x90,0x02,0x24,0x10,0x29,0x00 },
+  16, 0xae70, 0, {0x1a,0x40,0x0e,0x94,0x41,0xa4,0x00,0x29,0x00,0x12,0x40,0x05,0x90,0x41,0x26,0x00 },
+  16, 0xae80, 0, {0xd9,0x00,0x24,0x40,0x0c,0x90,0x03,0xe8,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xae90, 0, {0x48,0x01,0xa4,0x02,0xa9,0x00,0xbc,0x40,0x0f,0x90,0x03,0xa4,0x04,0xf9,0x00,0x3a },
+  16, 0xaea0, 0, {0x41,0x0e,0x90,0x83,0x84,0x00,0xf9,0x00,0x3c,0x40,0x0e,0x90,0x02,0xc4,0x08,0xe9 },
+  16, 0xaeb0, 0, {0x00,0x3a,0x40,0x2e,0x90,0x0b,0xe6,0x00,0xe1,0x04,0x3a,0x40,0x0f,0x92,0x03,0x5a },
+  16, 0xaec0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xa0,0x20,0xd8,0x00,0x36,0x02 },
+  16, 0xaed0, 0, {0x0e,0x00,0xa3,0xe0,0x18,0xc0,0x00,0x30,0x03,0x0f,0x80,0x33,0x20,0x00,0x40,0x00 },
+  16, 0xaee0, 0, {0x32,0x0d,0x0f,0x04,0x0b,0xa0,0x02,0xc8,0x02,0x32,0x02,0x8c,0x82,0x03,0x20,0x02 },
+  16, 0xaef0, 0, {0xc8,0x04,0x16,0x00,0x4e,0x80,0x01,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xaf00, 0, {0x28,0x05,0x3b,0x00,0x8e,0xd8,0x23,0x80,0x08,0xe0,0x02,0xf8,0x80,0x8e,0x10,0x23 },
+  16, 0xaf10, 0, {0xa2,0x0b,0xe0,0x82,0x7a,0x20,0x8e,0x30,0x23,0xa1,0x0b,0xe0,0x02,0x28,0x00,0x8e },
+  16, 0xaf20, 0, {0x00,0x2b,0x88,0x08,0xe4,0x42,0x38,0x00,0x8e,0x04,0x23,0x80,0x08,0xa0,0x02,0x0a },
+  16, 0xaf30, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x6f,0x40,0x93,0xc6,0x24,0x40 },
+  16, 0xaf40, 0, {0x0a,0x38,0x02,0xcc,0x00,0x83,0x01,0xac,0xf0,0x0b,0xb4,0x02,0x4c,0x04,0xa3,0x80 },
+  16, 0xaf50, 0, {0x28,0xd0,0x4b,0x30,0x02,0x4c,0x00,0xab,0x04,0x2a,0xc0,0x2a,0x30,0x0a,0xac,0x10 },
+  16, 0xaf60, 0, {0x93,0x00,0x20,0xc1,0x0a,0x31,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xaf70, 0, {0x80,0x11,0x1c,0x00,0x82,0x00,0x21,0x42,0x88,0x74,0x06,0xdc,0x0b,0x86,0x02,0x2d },
+  16, 0xaf80, 0, {0x80,0x0b,0x70,0x2a,0x58,0x00,0xa6,0x00,0xa9,0xc0,0x0b,0x70,0x02,0x5c,0x88,0xa7 },
+  16, 0xaf90, 0, {0x20,0x29,0xc0,0x0a,0x70,0x02,0x9c,0x10,0x97,0x20,0xa1,0xc8,0x08,0xd8,0x02,0x28 },
+  16, 0xafa0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x08,0x0e,0x00,0xd7,0x80,0x37,0x60 },
+  16, 0xafb0, 0, {0x0e,0x68,0x13,0xfe,0x00,0xcf,0x80,0x3d,0xe0,0x0f,0x78,0x23,0x1e,0x00,0xef,0x82 },
+  16, 0xafc0, 0, {0x31,0xe0,0x0f,0x3c,0xc3,0x7e,0x04,0xef,0x80,0xb1,0xe0,0x0e,0xe8,0x03,0xbe,0x80 },
+  16, 0xafd0, 0, {0xd7,0xe0,0x33,0xea,0x0e,0x78,0x03,0x2a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xafe0, 0, {0x08,0x15,0xac,0x00,0xfa,0x01,0x3e,0x00,0x0f,0xb0,0x03,0xe0,0x04,0xf8,0x00,0x32 },
+  16, 0xaff0, 0, {0x80,0x0f,0x80,0x43,0xac,0x0a,0xd8,0x00,0x36,0x40,0x0f,0xb0,0x03,0x2c,0x0c,0xdb },
+  16, 0xb000, 0, {0x00,0x26,0xc1,0x09,0xa0,0x13,0x6c,0x40,0xeb,0x40,0x3a,0xdc,0x0f,0x90,0x0b,0xc2 },
+  16, 0xb010, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x04,0xbe,0x00,0xcf,0x81,0x33,0xe9 },
+  16, 0xb020, 0, {0x1f,0xf9,0x13,0xb6,0x50,0xef,0x80,0x1f,0xe4,0x04,0xc8,0x03,0x7e,0x00,0x6d,0x81 },
+  16, 0xb030, 0, {0x33,0x64,0x0c,0xf8,0x1b,0x3e,0x20,0x2f,0x88,0x93,0xe8,0x0f,0xfb,0x03,0x2e,0x80 },
+  16, 0xb040, 0, {0xcf,0xc0,0x73,0xe0,0x2c,0xd9,0x03,0xd0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb050, 0, {0xa8,0x18,0x90,0x42,0x89,0x18,0x21,0xc0,0x1f,0x71,0x02,0x14,0xc0,0xf7,0x20,0x27 },
+  16, 0xb060, 0, {0x40,0x40,0x71,0x12,0x18,0x00,0x87,0x20,0x21,0x80,0x48,0x71,0x02,0x3c,0x08,0x87 },
+  16, 0xb070, 0, {0x20,0x21,0x82,0x0b,0x61,0xa2,0x1e,0x44,0xdf,0x01,0x31,0xc8,0x08,0x73,0x02,0xea },
+  16, 0xb080, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x8c,0x00,0x87,0x00,0x21,0xc8 },
+  16, 0xb090, 0, {0x0b,0x70,0x02,0x9c,0x09,0x87,0x02,0x2d,0x82,0x99,0x40,0x02,0x04,0x00,0xa5,0x09 },
+  16, 0xb0a0, 0, {0x21,0x40,0x19,0x70,0x02,0x1c,0x00,0x87,0x05,0x25,0x48,0x4b,0x72,0x02,0x0c,0x40 },
+  16, 0xb0b0, 0, {0x87,0x00,0xa1,0xc0,0x48,0x50,0x02,0xc4,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb0c0, 0, {0x68,0x04,0xc1,0x20,0x89,0x4c,0xa0,0xb4,0x0a,0x38,0x02,0x22,0x00,0xa1,0xd0,0x24 },
+  16, 0xb0d0, 0, {0x30,0x09,0x80,0x02,0x27,0x44,0x81,0xc6,0x22,0x14,0x09,0x3d,0x2a,0x0f,0x02,0x8b },
+  16, 0xb0e0, 0, {0xc0,0xa6,0x20,0x0b,0x24,0x00,0x0c,0x10,0x93,0x81,0x20,0xc0,0x48,0x30,0x06,0xd8 },
+  16, 0xb0f0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x15,0xa1,0x00,0x89,0xc1,0x32,0xd1 },
+  16, 0xb100, 0, {0x03,0xbc,0x03,0xa9,0x20,0x89,0x41,0x3e,0x60,0x85,0xbc,0x8b,0x25,0x40,0xeb,0x41 },
+  16, 0xb110, 0, {0xa2,0xa0,0x0d,0xf0,0x13,0x3e,0x20,0xcf,0x90,0x36,0x30,0x4f,0xbc,0x0b,0x3c,0x00 },
+  16, 0xb120, 0, {0xcf,0x80,0x33,0xc1,0x0c,0xb1,0x03,0xea,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb130, 0, {0x80,0x00,0xed,0x00,0xf8,0x01,0x3c,0xd0,0x0f,0xb3,0x03,0xe8,0x82,0xd8,0x20,0x36 },
+  16, 0xb140, 0, {0x80,0x2e,0xb2,0x13,0xe1,0x00,0xfa,0x00,0x7e,0xc8,0x2e,0xb0,0x03,0xec,0x80,0xdb },
+  16, 0xb150, 0, {0x10,0x3a,0x08,0x4f,0xb2,0x23,0xcc,0x02,0xfb,0x10,0x3a,0xc0,0x0f,0x90,0x03,0xe4 },
+  16, 0xb160, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x10,0xf0,0x00,0xcd,0x10,0x33,0x42 },
+  16, 0xb170, 0, {0x0c,0xca,0x23,0x7c,0x00,0xcf,0x00,0x33,0x62,0x06,0xf0,0x01,0x3a,0x00,0xcf,0x08 },
+  16, 0xb180, 0, {0x33,0x80,0x1c,0xf0,0x81,0x3c,0x00,0xff,0x00,0x33,0xa0,0x0c,0xca,0x01,0xfc,0x04 },
+  16, 0xb190, 0, {0xcf,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0xc0,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb1a0, 0, {0xa1,0x04,0x6d,0x40,0x88,0x48,0xa2,0x31,0x08,0x10,0x02,0x20,0x10,0x88,0xb4,0x22 },
+  16, 0xb1b0, 0, {0xa0,0x08,0x80,0x00,0x6a,0x84,0x88,0x20,0x22,0x52,0x08,0xb0,0x0a,0x2c,0x10,0xbb },
+  16, 0xb1c0, 0, {0x00,0x32,0xb3,0x88,0x80,0x02,0xec,0x00,0xdb,0x00,0x2e,0xc0,0x0b,0x90,0x12,0xe1 },
+  16, 0xb1d0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x10,0x8a,0x01,0x22,0xa0 },
+  16, 0xb1e0, 0, {0x08,0xb0,0x42,0x60,0x20,0x80,0x00,0x20,0x44,0x1a,0x80,0x1a,0xe4,0x42,0xa0,0x06 },
+  16, 0xb1f0, 0, {0x22,0x00,0x78,0x30,0x02,0xac,0x00,0xbb,0x00,0xa2,0x44,0x08,0xb0,0x12,0xec,0x00 },
+  16, 0xb200, 0, {0x8b,0x00,0x0e,0xc0,0x0b,0x90,0x02,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb210, 0, {0x08,0x14,0x00,0x08,0x80,0x00,0x20,0x81,0x08,0x30,0x02,0x40,0x12,0x80,0x00,0xa0 },
+  16, 0xb220, 0, {0x40,0x08,0xb0,0x02,0xc0,0x00,0x82,0x00,0x00,0x80,0x08,0x30,0x02,0x8c,0x00,0xbb },
+  16, 0xb230, 0, {0x00,0x20,0x00,0x08,0x20,0x02,0xcc,0x80,0x93,0x00,0x2c,0xc0,0x0b,0x30,0x02,0xc2 },
+  16, 0xb240, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x60,0x00,0xca,0x14,0x32,0x00 },
+  16, 0xb250, 0, {0x0c,0xb0,0x03,0x4c,0x00,0xca,0x00,0x32,0x00,0x0e,0x00,0x12,0xa0,0x00,0xc0,0x00 },
+  16, 0xb260, 0, {0x70,0x00,0x28,0xf0,0x13,0xac,0x00,0xfb,0x00,0x32,0x40,0x2c,0x10,0x43,0xec,0x00 },
+  16, 0xb270, 0, {0xcf,0x00,0x3f,0xc0,0x0f,0x90,0x03,0xc0,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb280, 0, {0x20,0x15,0xf0,0x02,0xfc,0x00,0x1f,0x00,0x67,0x70,0x03,0xb0,0x00,0xfc,0x00,0x3f },
+  16, 0xb290, 0, {0x00,0x2d,0xc0,0x03,0x30,0x10,0xfc,0x01,0xbf,0x00,0x0f,0x70,0x03,0x7c,0x00,0xf7 },
+  16, 0xb2a0, 0, {0x04,0x3b,0x00,0x0f,0xc0,0x13,0xfd,0x10,0xff,0x00,0x3d,0xc0,0x0f,0xf0,0x03,0xe8 },
+  16, 0xb2b0, 0, {0x12,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xf4,0xc0,0xcf,0x80,0x33,0x60 },
+  16, 0xb2c0, 0, {0x0e,0xc9,0x13,0x36,0x50,0xce,0x86,0x3f,0x08,0x0c,0xc0,0x03,0x3e,0x02,0xd7,0x80 },
+  16, 0xb2d0, 0, {0x39,0xe0,0x0f,0xf8,0x13,0x3e,0x40,0xc7,0x30,0x3b,0xce,0x0d,0xf6,0x03,0x3d,0x88 },
+  16, 0xb2e0, 0, {0xcf,0x31,0x33,0xe4,0x0f,0x78,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb2f0, 0, {0x80,0x10,0xe5,0xd0,0xdb,0x80,0x72,0x60,0x88,0x92,0x02,0xe4,0x10,0x8a,0x80,0x2e },
+  16, 0xb300, 0, {0x34,0x4a,0x8c,0x03,0x2e,0x00,0xab,0x80,0x02,0xe0,0x0b,0xb8,0x02,0x2c,0x80,0x8f },
+  16, 0xb310, 0, {0x60,0x13,0xd8,0x4a,0x76,0x02,0x9d,0x84,0xaf,0x30,0x22,0x48,0x0b,0x88,0x12,0xa0 },
+  16, 0xb320, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xc4,0x00,0x8b,0x00,0x24,0x00 },
+  16, 0xb330, 0, {0x4a,0x00,0x02,0xac,0x80,0x83,0x00,0x2c,0x01,0x28,0x04,0x02,0xac,0x00,0x8b,0x01 },
+  16, 0xb340, 0, {0x20,0xc0,0x03,0xb0,0x02,0x0c,0x80,0x83,0x40,0x20,0xc1,0xa8,0x34,0x22,0x8d,0x13 },
+  16, 0xb350, 0, {0x83,0x20,0xac,0xc8,0x0b,0xb0,0x02,0x62,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb360, 0, {0xc0,0x15,0x86,0x00,0x9b,0x04,0xae,0x00,0x0a,0x90,0x02,0xec,0x00,0x0b,0x14,0x2e },
+  16, 0xb370, 0, {0xc6,0x02,0xb1,0x12,0x6c,0x00,0xab,0x20,0x2a,0xc1,0x0b,0xb0,0x42,0x2c,0x00,0x8b },
+  16, 0xb380, 0, {0x02,0x26,0xc1,0x0a,0xb0,0x02,0xac,0x00,0xab,0x04,0x2a,0x40,0x0b,0x90,0x02,0xf0 },
+  16, 0xb390, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0xe7,0x00,0xc3,0x01,0x36,0x40 },
+  16, 0xb3a0, 0, {0x0e,0x88,0x13,0x24,0x02,0xca,0x00,0x1e,0x20,0x2c,0x8e,0x0b,0x2c,0x00,0xcb,0x00 },
+  16, 0xb3b0, 0, {0x2a,0xc0,0x0f,0xb8,0x03,0x2e,0x06,0xcb,0x00,0x3a,0xc0,0x4c,0xb0,0x13,0xac,0x0c },
+  16, 0xb3c0, 0, {0xcb,0x00,0x3e,0xc8,0x0f,0xb0,0x43,0x50,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb3d0, 0, {0xe0,0x01,0xb4,0x08,0xff,0x91,0x33,0x40,0x09,0xdc,0x01,0xf4,0x20,0x7e,0x02,0x2e },
+  16, 0xb3e0, 0, {0x40,0x0d,0x98,0x01,0xbc,0x80,0xef,0x80,0xb7,0xe4,0x8f,0xf4,0x0b,0xfe,0x40,0x7f },
+  16, 0xb3f0, 0, {0x00,0xb9,0xc0,0x4e,0xf0,0x03,0xfc,0x08,0xf7,0x00,0x37,0xc0,0x0f,0xe0,0x02,0xb8 },
+  16, 0xb400, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xa1,0x44,0xcb,0x02,0x32,0x00 },
+  16, 0xb410, 0, {0x0d,0x80,0x0a,0x6d,0x00,0xeb,0x04,0x10,0x90,0x28,0x22,0x0b,0x2c,0xc2,0xcb,0x20 },
+  16, 0xb420, 0, {0x76,0xc0,0x0e,0xb1,0x03,0xec,0x01,0xcb,0x06,0x32,0xc1,0x0c,0x30,0x03,0x2c,0x02 },
+  16, 0xb430, 0, {0xcb,0x00,0x3e,0xd0,0x0c,0xb0,0x03,0x10,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb440, 0, {0xc8,0x05,0x21,0x48,0xab,0x00,0x20,0x00,0x00,0x95,0x23,0x4c,0x08,0xbb,0x01,0x22 },
+  16, 0xb450, 0, {0xc0,0x08,0xb2,0x02,0x0c,0x08,0x83,0x88,0x92,0xd5,0x28,0x34,0x02,0xec,0x02,0x8f },
+  16, 0xb460, 0, {0x20,0x23,0xc0,0x4d,0xf0,0x01,0x7c,0x00,0xdf,0x00,0x2e,0xc0,0x0d,0x30,0x03,0x72 },
+  16, 0xb470, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x44,0x00,0x83,0x10,0x20,0x60 },
+  16, 0xb480, 0, {0x09,0x25,0x02,0x00,0x08,0xa0,0x00,0x4c,0x00,0x0b,0x0c,0x22,0x4f,0x12,0x93,0x40 },
+  16, 0xb490, 0, {0x00,0xc0,0x09,0x3e,0x02,0xec,0x00,0xab,0x80,0xa4,0xc0,0x09,0x30,0x22,0x2c,0x08 },
+  16, 0xb4a0, 0, {0xb3,0x01,0x0c,0x81,0x08,0x30,0x02,0x38,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb4b0, 0, {0x60,0x01,0x16,0x09,0xb7,0x80,0x21,0x64,0x08,0x78,0x06,0x12,0x00,0xb4,0x82,0x2d },
+  16, 0xb4c0, 0, {0xa4,0x1b,0x69,0x06,0x7e,0x04,0x17,0x92,0x25,0xe6,0x09,0x78,0x06,0xde,0x80,0xa7 },
+  16, 0xb4d0, 0, {0x90,0x25,0xe0,0x09,0x79,0x50,0x5e,0x04,0xb7,0x92,0x2f,0x61,0x09,0xc8,0x02,0x48 },
+  16, 0xb4e0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x25,0x00,0xc3,0x00,0xb0,0x03 },
+  16, 0xb4f0, 0, {0x0d,0xa3,0x42,0x09,0x40,0xe1,0x00,0xbc,0x40,0x0f,0x11,0x03,0x4c,0x00,0x13,0x00 },
+  16, 0xb500, 0, {0x20,0xc0,0x09,0x32,0x03,0xcc,0x10,0xa3,0x00,0x26,0xc4,0x8d,0x30,0x2b,0x0c,0x80 },
+  16, 0xb510, 0, {0xf3,0x00,0x7c,0x80,0x0c,0x30,0x01,0x12,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb520, 0, {0x40,0x1d,0xbc,0x00,0xe7,0x10,0x3d,0x01,0x2f,0xf1,0x42,0xe8,0x00,0xf5,0x90,0x03 },
+  16, 0xb530, 0, {0xc1,0x0c,0xf1,0x43,0x9c,0x04,0xef,0x08,0x3b,0xc2,0x0c,0xf0,0x81,0xdc,0xa0,0xdf },
+  16, 0xb540, 0, {0x00,0x3b,0xc3,0x3f,0xf0,0x83,0xfc,0x05,0xdf,0x0c,0x3d,0x40,0x0f,0xd1,0x03,0xd0 },
+  16, 0xb550, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xf4,0x00,0xcb,0x80,0x30,0x40 },
+  16, 0xb560, 0, {0x2c,0xa0,0x03,0xe0,0x00,0xf8,0x80,0x32,0xc0,0x2e,0xb8,0x0b,0x2c,0x46,0xd3,0x00 },
+  16, 0xb570, 0, {0x30,0xc0,0x0c,0x30,0x03,0x0c,0x00,0xdb,0x48,0x32,0xc0,0x1f,0xb4,0x03,0x2c,0x88 },
+  16, 0xb580, 0, {0xcb,0x48,0x32,0x80,0x0c,0x30,0x13,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb590, 0, {0x48,0x11,0xb4,0x00,0x87,0x01,0x21,0x40,0x08,0x70,0x42,0xd0,0x08,0xb4,0x00,0x29 },
+  16, 0xb5a0, 0, {0xc0,0x08,0x70,0x02,0x1c,0x00,0x87,0x00,0x21,0xc8,0x0c,0x72,0x0a,0x1c,0x84,0x8f },
+  16, 0xb5b0, 0, {0x40,0x09,0xc4,0x8f,0x73,0x12,0x9c,0x40,0x83,0x20,0x21,0xc0,0x08,0x60,0x02,0x92 },
+  16, 0xb5c0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x96,0x01,0xaf,0x80,0x21,0x20 },
+  16, 0xb5d0, 0, {0x08,0x68,0x02,0xda,0x00,0xbd,0x80,0x21,0xe0,0x09,0x78,0x02,0x1e,0x00,0x8f,0x88 },
+  16, 0xb5e0, 0, {0x83,0xe2,0x29,0xf8,0x82,0x5f,0x80,0x87,0xa0,0x25,0xe0,0x0b,0x3a,0x12,0x0e,0x50 },
+  16, 0xb5f0, 0, {0x97,0xa4,0x21,0xa0,0x29,0x78,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb600, 0, {0x08,0x14,0xcc,0x02,0xa1,0x81,0x00,0x00,0x48,0x70,0x02,0xc8,0x00,0xb1,0x00,0x2c },
+  16, 0xb610, 0, {0xf8,0x09,0x31,0x42,0x0c,0x10,0x83,0x00,0x20,0xe0,0x08,0x38,0x12,0x4e,0x00,0x83 },
+  16, 0xb620, 0, {0x00,0x6a,0xc0,0x0b,0x30,0x02,0x8c,0x04,0x93,0x00,0x20,0xe0,0x09,0x38,0x02,0x92 },
+  16, 0xb630, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xb9,0x40,0xee,0x20,0x30,0x80 },
+  16, 0xb640, 0, {0x0c,0xa0,0x03,0xe8,0x00,0xfa,0x00,0x33,0xb0,0x0d,0xe4,0x03,0x32,0x88,0xcc,0x80 },
+  16, 0xb650, 0, {0x23,0x00,0x0d,0xc0,0x03,0x62,0x02,0xca,0x00,0x36,0x80,0x0f,0xa0,0x43,0x28,0x06 },
+  16, 0xb660, 0, {0xda,0x00,0x33,0xa0,0x0d,0x6a,0x03,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb670, 0, {0x48,0x00,0xe0,0x00,0x98,0x01,0xbe,0x00,0x0f,0x80,0x03,0xf0,0x00,0xbc,0x00,0x38 },
+  16, 0xb680, 0, {0x04,0x08,0x80,0xa3,0xe0,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x80,0x13,0xa0,0x00,0xe0 },
+  16, 0xb690, 0, {0x00,0x3e,0x00,0x0e,0x00,0x03,0xc0,0x00,0xe8,0x00,0xbe,0x04,0x4e,0x80,0x07,0xd2 },
+  16, 0xb6a0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x80,0xc9,0x00,0x3e,0x68 },
+  16, 0xb6b0, 0, {0x0c,0x90,0x03,0x64,0x00,0xc9,0x00,0x3e,0x40,0x0c,0x90,0x43,0xe0,0x00,0xc8,0x00 },
+  16, 0xb6c0, 0, {0x32,0x00,0x0c,0x80,0x13,0x20,0x00,0xc9,0x00,0x36,0x40,0x0c,0x90,0x03,0x64,0x00 },
+  16, 0xb6d0, 0, {0x81,0x00,0x32,0x40,0x04,0x90,0x13,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb6e0, 0, {0x80,0x04,0x65,0x06,0x89,0x40,0x2e,0x60,0x1a,0x14,0x2a,0x05,0x20,0x89,0x00,0x2e },
+  16, 0xb6f0, 0, {0x40,0x08,0x90,0x02,0xc4,0x08,0xc1,0x02,0x20,0x40,0x08,0x10,0x1a,0x24,0x00,0x89 },
+  16, 0xb700, 0, {0x10,0x32,0x41,0x08,0x90,0x12,0x24,0x00,0x89,0x04,0x36,0x40,0x88,0x94,0x0a,0x20 },
+  16, 0xb710, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x04,0x20,0x89,0x55,0x2e,0x40 },
+  16, 0xb720, 0, {0x08,0xd5,0x02,0x34,0x00,0x8d,0x00,0x2e,0x40,0x18,0x90,0x02,0xe4,0x00,0x99,0x00 },
+  16, 0xb730, 0, {0x26,0x40,0x08,0x90,0x02,0x04,0x0a,0x89,0x00,0x26,0x40,0x38,0x90,0x0a,0x24,0x00 },
+  16, 0xb740, 0, {0xa9,0x00,0x20,0x40,0x0a,0x90,0x82,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb750, 0, {0x08,0x04,0x05,0x00,0x81,0x00,0x2f,0x40,0x0a,0xd4,0x02,0x34,0x00,0x85,0x01,0x2c },
+  16, 0xb760, 0, {0x40,0x08,0x10,0x42,0xe4,0x06,0x99,0x00,0x22,0x40,0x08,0x10,0x02,0x05,0x00,0x81 },
+  16, 0xb770, 0, {0x40,0x28,0x50,0x08,0x14,0x12,0x05,0x00,0xa1,0x40,0x24,0x50,0x5a,0x10,0x02,0x02 },
+  16, 0xb780, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xc8,0x04,0x3e,0x00 },
+  16, 0xb790, 0, {0x08,0x80,0x03,0x21,0x42,0xcc,0x00,0x3e,0x00,0x2c,0x80,0x02,0xe0,0x00,0xd8,0x00 },
+  16, 0xb7a0, 0, {0xb6,0x00,0x2c,0x80,0x02,0x20,0x02,0xc8,0x00,0x36,0x00,0x0c,0x80,0x03,0x60,0x02 },
+  16, 0xb7b0, 0, {0xe8,0x00,0x32,0x00,0x8e,0x80,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb7c0, 0, {0x98,0x1d,0xf5,0x00,0xf5,0x00,0x3e,0x40,0x87,0x90,0x03,0xe4,0x00,0xf1,0x00,0x3d },
+  16, 0xb7d0, 0, {0x50,0x0f,0x54,0x03,0xd1,0x00,0xec,0x40,0x3f,0x10,0x0b,0xc4,0x43,0xf1,0x00,0xf9 },
+  16, 0xb7e0, 0, {0x40,0x36,0x50,0x0f,0x94,0x13,0xe5,0x10,0xd9,0x44,0x3d,0x40,0x2d,0xd0,0x03,0xe6 },
+  16, 0xb7f0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xf6,0x60,0xcd,0x02,0x3b,0x40 },
+  16, 0xb800, 0, {0x0c,0xd0,0x03,0xb4,0x40,0xfd,0x06,0x3e,0x40,0x0c,0x90,0x03,0x66,0x04,0xc9,0x82 },
+  16, 0xb810, 0, {0xb6,0x62,0x0f,0x18,0x0b,0x36,0x00,0xcd,0x40,0x32,0x61,0x0c,0x90,0x23,0x24,0x0a },
+  16, 0xb820, 0, {0xc9,0x00,0x32,0x40,0x4c,0xd0,0x43,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb830, 0, {0x39,0x10,0xe3,0x80,0xd8,0x00,0x22,0x00,0x0d,0x80,0x02,0x22,0x94,0xb8,0x00,0x2e },
+  16, 0xb840, 0, {0x00,0x0d,0x80,0x03,0x21,0x00,0x88,0x40,0x22,0x00,0x0b,0xc4,0x22,0x21,0x50,0x88 },
+  16, 0xb850, 0, {0x80,0x22,0x22,0x08,0x80,0x02,0x20,0x10,0x80,0x01,0x2a,0x00,0x0a,0x80,0x03,0x4e },
+  16, 0xb860, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xc6,0x00,0x89,0x00,0x2a,0x40 },
+  16, 0xb870, 0, {0x88,0x10,0x0a,0x84,0x08,0xb1,0x00,0x29,0x40,0x0a,0x70,0x0a,0xb5,0x00,0x8f,0x40 },
+  16, 0xb880, 0, {0x29,0xc0,0x0b,0xf4,0x02,0x24,0x00,0x81,0x20,0x28,0x44,0x89,0x10,0x02,0x04,0x04 },
+  16, 0xb890, 0, {0x81,0x02,0x2a,0x40,0x08,0x10,0x02,0x02,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb8a0, 0, {0x18,0x15,0xa6,0x00,0x99,0x20,0x22,0x40,0x09,0x90,0x12,0x24,0x80,0xb9,0x00,0x2f },
+  16, 0xb8b0, 0, {0x44,0x03,0xd0,0x02,0xf4,0x00,0x8d,0x00,0x2b,0x41,0x0b,0xd0,0x02,0x26,0x10,0x89 },
+  16, 0xb8c0, 0, {0x04,0x2a,0x40,0x09,0x90,0x6e,0x24,0x00,0x89,0x00,0x2a,0x40,0x0a,0x94,0x02,0x46 },
+  16, 0xb8d0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa2,0x15,0xe6,0x00,0xc9,0x00,0x38,0x42 },
+  16, 0xb8e0, 0, {0x0c,0x10,0x13,0xa6,0x04,0x79,0x08,0x3a,0x78,0x06,0x92,0x03,0xa4,0x08,0xc9,0x00 },
+  16, 0xb8f0, 0, {0x3a,0x60,0x8f,0x98,0x23,0x06,0x02,0xc9,0x02,0x3a,0x40,0x0d,0x90,0x03,0x04,0x00 },
+  16, 0xb900, 0, {0xc9,0x00,0x38,0x40,0x0c,0x90,0x03,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb910, 0, {0x28,0x01,0x84,0x10,0xf9,0x80,0xbe,0x40,0x4f,0x90,0x02,0xe4,0x00,0xf9,0x00,0x3c },
+  16, 0xb920, 0, {0x60,0x8d,0x92,0x03,0x24,0x42,0xe9,0x10,0x32,0x50,0x0f,0x94,0x03,0xe4,0x00,0xf9 },
+  16, 0xb930, 0, {0x00,0xb6,0x41,0x2e,0x10,0x03,0xe4,0x00,0xf9,0x00,0x2e,0x40,0x0f,0x90,0x03,0xca },
+  16, 0xb940, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x08,0xc8,0x00,0x3e,0x10 },
+  16, 0xb950, 0, {0x0f,0x88,0x03,0x20,0x08,0xf8,0xc0,0x1e,0x10,0x2c,0x40,0x03,0xf2,0x00,0xcc,0x00 },
+  16, 0xb960, 0, {0x3f,0x00,0x0c,0xc0,0x13,0x20,0x02,0xc0,0x00,0x30,0x00,0x0c,0x80,0x2b,0x20,0x10 },
+  16, 0xb970, 0, {0xc0,0x04,0x32,0x00,0x0f,0x80,0x03,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb980, 0, {0xa8,0x05,0x3a,0x80,0x86,0xe0,0x2f,0xa0,0x1b,0xe0,0x02,0x3a,0x80,0xba,0x04,0x2e },
+  16, 0xb990, 0, {0x80,0x08,0xa0,0x03,0x88,0x08,0xc2,0x00,0x2e,0x81,0x08,0x60,0x02,0x28,0x10,0x8e },
+  16, 0xb9a0, 0, {0x81,0x03,0x80,0x08,0xe0,0x01,0x78,0x00,0x8e,0x04,0x03,0x80,0x09,0x68,0x03,0xca },
+  16, 0xb9b0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0x83,0x60,0x2c,0x44 },
+  16, 0xb9c0, 0, {0x0b,0x38,0x02,0x0f,0x80,0xb1,0x00,0x2c,0xe5,0x03,0x30,0x10,0xcc,0x10,0x83,0x00 },
+  16, 0xb9d0, 0, {0x0c,0xc0,0x29,0x30,0x22,0x04,0x09,0x91,0x10,0x24,0xc0,0xc8,0x30,0x00,0x4c,0x04 },
+  16, 0xb9e0, 0, {0x93,0x02,0x24,0xc0,0x0b,0x31,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xb9f0, 0, {0xe0,0x01,0x18,0x80,0x87,0x00,0x2d,0x40,0x0b,0x74,0x42,0x1c,0x01,0xb5,0x01,0x2c },
+  16, 0xba00, 0, {0xc0,0x0b,0x60,0x02,0xb0,0x00,0x94,0x04,0x2f,0x20,0x09,0xc0,0x02,0x14,0x90,0x97 },
+  16, 0xba10, 0, {0x00,0x25,0xc8,0x08,0x70,0x02,0x4c,0x80,0x97,0x20,0x25,0xc0,0x09,0x70,0x02,0xe8 },
+  16, 0xba20, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x3a,0x82,0xc6,0x80,0x2d,0x60 },
+  16, 0xba30, 0, {0x0b,0xf8,0x0b,0x1a,0x00,0xf5,0x80,0x3d,0xe0,0x8f,0x78,0x03,0xde,0x02,0xc7,0x80 },
+  16, 0xba40, 0, {0x2d,0xe0,0x0d,0x78,0x0b,0x17,0x02,0xdf,0x80,0x24,0xf8,0x2c,0xfd,0x03,0x5e,0x0c },
+  16, 0xba50, 0, {0xd7,0xe0,0x35,0xe0,0x0f,0x68,0x03,0x2a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xba60, 0, {0x48,0x1d,0xae,0x40,0xfa,0x04,0x3e,0x40,0x0f,0x80,0x13,0xec,0x04,0xf9,0x00,0x3e },
+  16, 0xba70, 0, {0xc1,0x0c,0xa0,0x13,0xc0,0x10,0xe8,0x00,0x3c,0x00,0x4e,0x80,0x43,0xc4,0x20,0x89 },
+  16, 0xba80, 0, {0x00,0xba,0xc0,0x07,0xb6,0x21,0xed,0x06,0xeb,0x68,0xba,0xcc,0x0f,0x20,0x13,0xc2 },
+  16, 0xba90, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xbe,0x00,0xc6,0x80,0x31,0x60 },
+  16, 0xbaa0, 0, {0x2d,0x78,0x0b,0x3e,0x48,0xec,0x92,0x3d,0x60,0x0c,0x58,0x03,0x5a,0x40,0xd5,0x80 },
+  16, 0xbab0, 0, {0x31,0x61,0x0c,0x58,0x23,0x36,0x00,0xcf,0x82,0x3f,0xe0,0x0c,0xf8,0x03,0xff,0x60 },
+  16, 0xbac0, 0, {0xcf,0x90,0x33,0xf0,0x0c,0x52,0x03,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbad0, 0, {0xa8,0x11,0xb8,0x84,0x86,0x14,0xb5,0xc0,0x08,0x70,0x02,0x1e,0xc0,0xc4,0x00,0x2d },
+  16, 0xbae0, 0, {0x40,0x08,0x40,0x02,0x14,0xd0,0x86,0x10,0x21,0x80,0x4c,0x62,0x42,0x34,0x40,0xa5 },
+  16, 0xbaf0, 0, {0x00,0x35,0xc0,0x28,0x70,0x42,0xdc,0xc2,0x8f,0x30,0x23,0xc0,0x08,0x50,0x02,0x2a },
+  16, 0xbb00, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x98,0x28,0x8e,0x00,0xa5,0x40 },
+  16, 0xbb10, 0, {0x08,0xf1,0x02,0x18,0x64,0xb4,0x00,0x6d,0x42,0x08,0x50,0x02,0x18,0x01,0x85,0x08 },
+  16, 0xbb20, 0, {0x21,0x40,0x09,0x58,0x22,0x54,0x00,0x85,0x10,0x2d,0xc4,0x09,0x70,0x02,0xdc,0x04 },
+  16, 0xbb30, 0, {0x97,0x00,0x25,0xc0,0x08,0x44,0x02,0x00,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbb40, 0, {0x60,0x14,0x8c,0x00,0x82,0x80,0x24,0xc0,0x08,0x80,0x02,0x2d,0x00,0x80,0x4a,0x2c },
+  16, 0xbb50, 0, {0x42,0x08,0x0a,0x42,0x06,0x00,0x92,0x84,0x20,0xa0,0x88,0x28,0x42,0x44,0x00,0xa3 },
+  16, 0xbb60, 0, {0x06,0x24,0xc0,0x0b,0x30,0x02,0xcc,0x10,0x93,0x04,0x24,0xc1,0x09,0x00,0x02,0x08 },
+  16, 0xbb70, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xbc,0x00,0xcb,0x00,0x36,0x40 },
+  16, 0xbb80, 0, {0x0c,0xb4,0x13,0x2c,0x00,0xf9,0x00,0x3e,0xa0,0x0c,0xa2,0x03,0x04,0x08,0xc2,0x80 },
+  16, 0xbb90, 0, {0x30,0xa8,0x0d,0x2a,0x03,0x54,0x00,0xcb,0x00,0x3f,0xc0,0x0d,0xf0,0x03,0xfc,0x08 },
+  16, 0xbba0, 0, {0xdf,0x00,0x37,0xd0,0x0c,0xb0,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbbb0, 0, {0x80,0x00,0xe0,0x00,0xfb,0x10,0x3a,0x40,0x0e,0xb0,0x03,0xed,0x90,0xf9,0x11,0x7e },
+  16, 0xbbc0, 0, {0x80,0x4f,0xb0,0x53,0xe8,0x40,0xe9,0x00,0x3e,0x40,0x0f,0x90,0x03,0xa6,0x08,0xf9 },
+  16, 0xbbd0, 0, {0x01,0x3a,0xc0,0x0c,0xb0,0x13,0xcc,0x00,0xeb,0x02,0x3a,0xc6,0x8e,0xb8,0x03,0xe0 },
+  16, 0xbbe0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xf0,0x0c,0xce,0x00,0x3f,0xe0 },
+  16, 0xbbf0, 0, {0x2c,0xf0,0x83,0x3a,0x48,0xcd,0x01,0x35,0x80,0x0c,0x60,0x12,0x34,0x0a,0xce,0x00 },
+  16, 0xbc00, 0, {0xb3,0x80,0x2c,0xe0,0x0b,0x74,0x00,0xc9,0x10,0xb3,0xc1,0x0f,0xf0,0x1b,0x3c,0x00 },
+  16, 0xbc10, 0, {0xcf,0x00,0xb7,0xc0,0x2c,0xe0,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbc20, 0, {0x81,0x04,0x6e,0x10,0x88,0x80,0x2c,0xc0,0x18,0x98,0x02,0x2d,0x80,0x81,0x00,0x36 },
+  16, 0xbc30, 0, {0x91,0x08,0xb0,0x03,0x68,0x00,0xc9,0x00,0x22,0x40,0x08,0x90,0x02,0x24,0x00,0x83 },
+  16, 0xbc40, 0, {0x80,0x36,0xc0,0x0b,0x30,0x02,0x2c,0x02,0x83,0x00,0x20,0xc0,0x08,0x20,0x03,0x60 },
+  16, 0xbc50, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x06,0x00,0x8a,0x80,0x2e,0x45 },
+  16, 0xbc60, 0, {0x28,0x88,0x02,0x24,0x02,0x88,0x02,0x02,0x02,0x08,0x80,0x02,0xa2,0x00,0x98,0x00 },
+  16, 0xbc70, 0, {0x22,0x00,0x08,0x80,0x12,0x24,0x00,0x89,0x01,0x22,0xc1,0x0a,0xb0,0x02,0x6c,0x00 },
+  16, 0xbc80, 0, {0xab,0x00,0x22,0xc1,0x08,0x90,0x12,0x60,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbc90, 0, {0x08,0x04,0x00,0x00,0x80,0x00,0x2c,0xc0,0x48,0x08,0x12,0x00,0x80,0x80,0x02,0x24 },
+  16, 0xbca0, 0, {0x00,0x08,0x18,0x42,0xac,0x02,0x8b,0x80,0x22,0xe0,0x08,0xb8,0x12,0x04,0x02,0x83 },
+  16, 0xbcb0, 0, {0x00,0x20,0xc0,0x0b,0x30,0x42,0x0c,0x00,0xa3,0x01,0x60,0xc0,0x48,0x10,0x02,0x42 },
+  16, 0xbcc0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x68,0x08,0xca,0x00,0x2e,0x40 },
+  16, 0xbcd0, 0, {0x08,0x80,0x03,0x00,0x00,0xc8,0x06,0x32,0x00,0x0c,0x80,0x02,0xa0,0x00,0xd8,0x00 },
+  16, 0xbce0, 0, {0x32,0x00,0x0c,0x80,0x03,0x74,0x00,0xcb,0x00,0x22,0xc0,0x0f,0xf0,0x03,0x3c,0x00 },
+  16, 0xbcf0, 0, {0xef,0x00,0x37,0xc0,0x0c,0x80,0x01,0x40,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbd00, 0, {0xa0,0x19,0xfc,0x00,0xfc,0x04,0x3f,0xc0,0x0f,0xc0,0x03,0xe1,0x00,0xfc,0x00,0x3b },
+  16, 0xbd10, 0, {0x00,0x0f,0xd0,0x03,0x7c,0x00,0xef,0x00,0x2f,0xc0,0x0f,0xf0,0x11,0xf4,0x10,0xfd },
+  16, 0xbd20, 0, {0x02,0x3d,0xc0,0x4f,0xf0,0x03,0xdc,0x00,0xdf,0x04,0x3f,0xc0,0x0f,0xc0,0x43,0xe9 },
+  16, 0xbd30, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x41,0x02,0x70,0x20,0xdc,0x10 },
+  16, 0xbd40, 0, {0x67,0x04,0x0d,0xc1,0x02,0x70,0x20,0x9c,0x10,0x37,0x04,0x0d,0xc1,0x06,0x70,0x40 },
+  16, 0xbd50, 0, {0x4c,0x10,0x37,0x14,0x15,0xc1,0x03,0x70,0x40,0xdc,0x10,0x13,0x04,0x0d,0xc1,0x07 },
+  16, 0xbd60, 0, {0x70,0x40,0xdc,0x10,0x37,0x04,0x0d,0xc0,0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbd70, 0, {0x00,0xc5,0x44,0x05,0x71,0x21,0x5c,0x40,0x57,0x10,0x15,0xc4,0x05,0x71,0x05,0x5c },
+  16, 0xbd80, 0, {0x40,0x57,0x10,0x15,0xc4,0x06,0x71,0x01,0x4c,0x40,0x57,0x10,0x0d,0xc4,0x05,0x71 },
+  16, 0xbd90, 0, {0x05,0x5c,0x40,0x53,0x10,0x15,0xc4,0x07,0x71,0x01,0x5c,0x40,0x57,0x10,0x15,0xc0 },
+  16, 0xbda0, 0, {0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x02,0x01,0x20,0x80,0x48,0x20 },
+  16, 0xbdb0, 0, {0x12,0x08,0x04,0x82,0x01,0x20,0x80,0x48,0x20,0x12,0x08,0x04,0x82,0x01,0x20,0x80 },
+  16, 0xbdc0, 0, {0x48,0x20,0x12,0x08,0x04,0x82,0x01,0x20,0x80,0x48,0x20,0x12,0x08,0x04,0x82,0x01 },
+  16, 0xbdd0, 0, {0x20,0x80,0x48,0x20,0x12,0x08,0x04,0x80,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbde0, 0, {0x00,0x84,0x00,0x01,0x60,0x00,0x58,0x00,0x56,0x00,0x05,0x80,0x01,0x60,0x04,0x58 },
+  16, 0xbdf0, 0, {0x00,0x16,0x00,0x05,0x80,0x01,0x20,0x01,0x58,0x00,0x16,0x00,0x05,0x80,0x01,0x60 },
+  16, 0xbe00, 0, {0x00,0x58,0x00,0x56,0x00,0x05,0x80,0x01,0x60,0x00,0x58,0x00,0x16,0x00,0x01,0x80 },
+  16, 0xbe10, 0, {0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x48,0x05,0x72,0x11,0x5c,0x80 },
+  16, 0xbe20, 0, {0x17,0x20,0x15,0xd8,0x05,0x32,0x11,0x1c,0x80,0x47,0x20,0x14,0x88,0x00,0x72,0x01 },
+  16, 0xbe30, 0, {0x1c,0x80,0x57,0x20,0x05,0xc8,0x04,0x72,0x01,0x5c,0x80,0x57,0x20,0x15,0xc8,0x01 },
+  16, 0xbe40, 0, {0x72,0x01,0x5c,0x80,0x57,0x24,0x15,0xc0,0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbe50, 0, {0x00,0xc1,0x40,0x00,0x60,0x00,0x18,0x00,0x06,0x00,0x01,0x80,0x40,0x20,0x00,0x18 },
+  16, 0xbe60, 0, {0x00,0x06,0x00,0x01,0x90,0x00,0x60,0x00,0x18,0x00,0x06,0x00,0x41,0x80,0x00,0x60 },
+  16, 0xbe70, 0, {0x00,0x18,0x00,0x06,0x00,0x01,0x80,0x00,0x60,0x00,0x18,0x10,0x06,0x00,0x01,0x80 },
+  16, 0xbe80, 0, {0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x48,0x04,0x22,0x01,0x08,0x80 },
+  16, 0xbe90, 0, {0x02,0x20,0x10,0x88,0x04,0x62,0x01,0x08,0x80,0x42,0x20,0x10,0x88,0x00,0x20,0x01 },
+  16, 0xbea0, 0, {0x08,0x80,0x42,0x20,0x00,0x88,0x04,0x22,0x01,0x08,0x00,0x42,0x20,0x10,0x88,0x00 },
+  16, 0xbeb0, 0, {0x22,0x01,0x08,0x80,0x42,0x30,0x10,0x80,0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbec0, 0, {0x00,0xc5,0x4a,0x05,0x42,0x81,0x50,0xa0,0x04,0x28,0x15,0x0a,0x05,0x52,0x81,0x10 },
+  16, 0xbed0, 0, {0xa0,0x44,0x28,0x11,0x1a,0x00,0x40,0x80,0x10,0xa0,0x54,0x28,0x05,0x0a,0x05,0x42 },
+  16, 0xbee0, 0, {0x81,0x51,0x20,0x14,0x28,0x15,0x0a,0x01,0x42,0x81,0x50,0xa0,0x54,0x28,0x15,0x00 },
+  16, 0xbef0, 0, {0x31,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0c,0x01,0x53,0x40,0x54,0xc0 },
+  16, 0xbf00, 0, {0x15,0x30,0x05,0x5c,0x01,0x57,0x40,0x54,0xc0,0x15,0x30,0x05,0x5c,0x01,0x53,0x00 },
+  16, 0xbf10, 0, {0x55,0xc0,0x15,0x74,0x05,0x4c,0x01,0x53,0x00,0x55,0xc0,0x15,0x74,0x05,0x4c,0x01 },
+  16, 0xbf20, 0, {0x53,0x00,0x54,0xc0,0x11,0x30,0x01,0x40,0x21,0x10,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbf30, 0, {0x00,0x80,0x00,0x00,0x40,0x00,0x10,0x00,0x04,0x00,0x01,0x00,0x00,0x40,0x00,0x10 },
+  16, 0xbf40, 0, {0x00,0x04,0x00,0x01,0x00,0x00,0x42,0x00,0x10,0x00,0x04,0x00,0x11,0x00,0x00,0x40 },
+  16, 0xbf50, 0, {0x00,0x10,0xc1,0x04,0x00,0x01,0x00,0x00,0x40,0x00,0x10,0x00,0x01,0x10,0x01,0x01 },
+  16, 0xbf60, 0, {0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x60,0x02,0x08,0x00,0x82,0x00 },
+  16, 0xbf70, 0, {0x20,0x80,0x08,0x20,0x02,0x08,0x00,0x82,0x00,0x20,0x80,0x08,0x20,0x02,0x08,0x00 },
+  16, 0xbf80, 0, {0x82,0x00,0x20,0x84,0x00,0x20,0x02,0x08,0x00,0x82,0x00,0x20,0x84,0x08,0x20,0x02 },
+  16, 0xbf90, 0, {0x08,0x00,0x82,0x00,0x21,0x80,0x08,0x01,0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xbfa0, 0, {0x00,0xc5,0x40,0x05,0x60,0x01,0x58,0x00,0x96,0x00,0x15,0x90,0x05,0x64,0x02,0x58 },
+  16, 0xbfb0, 0, {0x00,0x56,0x00,0x55,0x90,0x05,0x60,0x01,0xd9,0x00,0x16,0x40,0x15,0x80,0x05,0x60 },
+  16, 0xbfc0, 0, {0x01,0x59,0x00,0x76,0x40,0x15,0x80,0x05,0x60,0x01,0x58,0x00,0x56,0x00,0x15,0x80 },
+  16, 0xbfd0, 0, {0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0x40,0x03,0x60,0x00,0xd8,0x00 },
+  16, 0xbfe0, 0, {0x36,0x00,0x4d,0x80,0x03,0x60,0x00,0xd8,0x00,0x36,0x00,0x0d,0x80,0x07,0x62,0x00 },
+  16, 0xbff0, 0, {0x58,0x00,0x36,0x00,0x0d,0x80,0x07,0x60,0x00,0xd8,0x80,0x16,0x00,0x0d,0x80,0x03 },
+  16, 0xc000, 0, {0x60,0x00,0xd8,0x00,0x36,0x00,0x1d,0x80,0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc010, 0, {0x00,0xc5,0x42,0x04,0x30,0x81,0x0c,0x20,0x43,0x08,0x10,0xc2,0x04,0x30,0x81,0x0c },
+  16, 0xc020, 0, {0x20,0x43,0x08,0x10,0xc2,0x04,0x30,0xc1,0x0c,0x20,0x43,0x08,0x10,0xc2,0x06,0x30 },
+  16, 0xc030, 0, {0x81,0x0c,0x20,0x43,0x08,0x10,0xc2,0x04,0x30,0x81,0x0c,0x20,0x43,0x08,0x18,0xc0 },
+  16, 0xc040, 0, {0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x30,0x00,0x0c,0x00 },
+  16, 0xc050, 0, {0x03,0x00,0x00,0xc0,0x00,0x30,0x00,0x0c,0x00,0x03,0x00,0x00,0xc0,0x40,0x30,0x00 },
+  16, 0xc060, 0, {0x0c,0x00,0x03,0x00,0x00,0xc0,0x00,0x30,0x00,0x0c,0x00,0x03,0x00,0x00,0xc0,0x00 },
+  16, 0xc070, 0, {0x30,0x00,0x0c,0x00,0x03,0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc080, 0, {0x00,0x80,0x02,0x01,0x30,0x80,0x4c,0x20,0x13,0x08,0x04,0xc2,0x01,0x30,0x80,0x4c },
+  16, 0xc090, 0, {0x20,0x13,0x08,0x04,0xc2,0x25,0x30,0x81,0x4c,0x20,0x13,0x08,0x04,0xc2,0x01,0x30 },
+  16, 0xc0a0, 0, {0x80,0x4c,0x32,0x53,0x08,0x04,0xc2,0x01,0x30,0x80,0x4c,0x20,0x13,0x08,0x04,0xc0 },
+  16, 0xc0b0, 0, {0x20,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x42,0x05,0x62,0x81,0x58,0x20 },
+  16, 0xc0c0, 0, {0x56,0x08,0x15,0x82,0x04,0x60,0x81,0x58,0x20,0x46,0x08,0x15,0x82,0x01,0x60,0xc1 },
+  16, 0xc0d0, 0, {0x58,0x20,0x46,0x08,0x15,0x82,0x01,0x60,0x81,0x58,0x30,0x56,0x08,0x15,0x82,0x05 },
+  16, 0xc0e0, 0, {0x60,0x81,0x58,0x20,0x56,0x08,0x05,0x80,0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc0f0, 0, {0x00,0xc5,0x42,0x00,0x20,0x80,0x08,0x20,0x02,0x08,0x00,0x82,0x00,0x20,0x80,0x08 },
+  16, 0xc100, 0, {0x20,0x02,0x08,0x00,0x82,0x00,0x20,0x80,0x0c,0x20,0x02,0x08,0x00,0x82,0x00,0x20 },
+  16, 0xc110, 0, {0x80,0x08,0x20,0x03,0x08,0x00,0x82,0x00,0x20,0x80,0x08,0x20,0x02,0x08,0x00,0x80 },
+  16, 0xc120, 0, {0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x42,0x04,0x66,0x81,0x18,0x20 },
+  16, 0xc130, 0, {0x46,0x08,0x11,0x82,0x04,0x64,0x81,0x18,0x20,0x46,0x08,0x11,0x82,0x00,0x60,0x81 },
+  16, 0xc140, 0, {0x0c,0x20,0x46,0x08,0x11,0x82,0x00,0x60,0x81,0x19,0x20,0x43,0x08,0x11,0x82,0x04 },
+  16, 0xc150, 0, {0x60,0x81,0x19,0x20,0x46,0x48,0x01,0x80,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc160, 0, {0x00,0xc5,0x60,0x05,0x58,0x01,0x56,0x00,0x55,0x80,0x15,0x60,0x04,0x58,0x01,0x56 },
+  16, 0xc170, 0, {0x00,0x45,0x80,0x11,0x60,0x00,0x58,0x00,0x06,0x00,0x45,0x80,0x15,0x60,0x01,0x58 },
+  16, 0xc180, 0, {0x01,0x16,0x00,0x01,0x80,0x15,0x60,0x05,0x58,0x01,0x56,0x00,0x55,0x80,0x05,0x40 },
+  16, 0xc190, 0, {0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x06,0x01,0x49,0x80,0x10,0x60 },
+  16, 0xc1a0, 0, {0x14,0x18,0x05,0x06,0x01,0x79,0x80,0x50,0x60,0x14,0x18,0x01,0x06,0x01,0x41,0x80 },
+  16, 0xc1b0, 0, {0x50,0x60,0x04,0x18,0x05,0x06,0x01,0x41,0x80,0x10,0x60,0x14,0x18,0x05,0x06,0x01 },
+  16, 0xc1c0, 0, {0x41,0x80,0x50,0x60,0x14,0x18,0x05,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc1d0, 0, {0x00,0x80,0x02,0x01,0x04,0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x00,0x04,0x04,0x40 },
+  16, 0xc1e0, 0, {0x20,0x10,0x08,0x04,0x02,0x01,0x00,0x84,0x40,0x20,0x10,0x08,0x04,0x02,0x01,0x00 },
+  16, 0xc1f0, 0, {0x80,0x41,0x20,0x10,0x08,0x04,0x02,0x11,0x00,0x80,0x41,0x20,0x10,0x48,0x04,0x00 },
+  16, 0xc200, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x46,0x03,0x51,0x80,0xd4,0x60 },
+  16, 0xc210, 0, {0x35,0x18,0x0d,0x46,0x02,0x11,0x80,0xd4,0x60,0x35,0x18,0x0d,0x46,0x03,0x11,0x80 },
+  16, 0xc220, 0, {0xd4,0x60,0x35,0x18,0x0d,0x46,0x03,0x51,0x80,0xd4,0x60,0x35,0x18,0x0d,0x46,0x03 },
+  16, 0xc230, 0, {0x51,0x80,0xd4,0x60,0x35,0x18,0x0d,0x40,0x31,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc240, 0, {0x00,0xc5,0x46,0x05,0x70,0x81,0x5c,0x60,0x07,0x18,0x15,0xc6,0x04,0x71,0x81,0x1c },
+  16, 0xc250, 0, {0x60,0x17,0x18,0x15,0xc6,0x05,0x31,0x81,0xdc,0x60,0x57,0x18,0x15,0xc6,0x05,0x71 },
+  16, 0xc260, 0, {0x80,0x1c,0x60,0x77,0x18,0x15,0xce,0x05,0x71,0x81,0x5c,0x60,0x57,0x18,0x15,0xc0 },
+  16, 0xc270, 0, {0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x46,0x02,0x71,0x80,0x9c,0x61 },
+  16, 0xc280, 0, {0x77,0x18,0x0d,0xc6,0x02,0x71,0x80,0x9c,0x60,0x37,0x18,0x0d,0xc2,0x03,0x31,0x80 },
+  16, 0xc290, 0, {0x5c,0x60,0x27,0x18,0x0d,0xc6,0x03,0x71,0x80,0x9c,0x60,0x17,0x18,0x0d,0xce,0x03 },
+  16, 0xc2a0, 0, {0x71,0x80,0xdc,0x60,0x37,0x18,0x0d,0xc0,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc2b0, 0, {0x00,0x45,0x46,0x05,0x75,0x81,0x5c,0x60,0x77,0x18,0x15,0xc6,0x05,0x75,0x81,0x5c },
+  16, 0xc2c0, 0, {0x60,0x57,0x18,0x15,0xc6,0x05,0x31,0x81,0x0c,0x60,0x57,0x18,0x15,0xc6,0x05,0x71 },
+  16, 0xc2d0, 0, {0x81,0x5c,0x60,0x43,0x18,0x15,0xc6,0x05,0x71,0x81,0x5c,0x60,0x57,0x18,0x15,0xc0 },
+  16, 0xc2e0, 0, {0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x02,0x01,0x20,0x80,0x48,0x20 },
+  16, 0xc2f0, 0, {0x12,0x08,0x04,0x82,0x01,0x20,0x80,0x48,0x20,0x12,0x08,0x04,0x82,0x01,0x20,0x80 },
+  16, 0xc300, 0, {0x5c,0x20,0x12,0x08,0x04,0x82,0x01,0x20,0x80,0x48,0x00,0x17,0x08,0x04,0x82,0x01 },
+  16, 0xc310, 0, {0x20,0x80,0x48,0x20,0x12,0x08,0x04,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc320, 0, {0x00,0x00,0x06,0x01,0x63,0x80,0x58,0x60,0x16,0x18,0x05,0x86,0x01,0x61,0x80,0x58 },
+  16, 0xc330, 0, {0x60,0x16,0x18,0x05,0x86,0x01,0x61,0x81,0x58,0x60,0x16,0x18,0x05,0x86,0x01,0x61 },
+  16, 0xc340, 0, {0x80,0x58,0x60,0x56,0x18,0x05,0x86,0x01,0x61,0x80,0x58,0x60,0x16,0x18,0x05,0x80 },
+  16, 0xc350, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x45,0x40,0x05,0x70,0x01,0x5c,0x00 },
+  16, 0xc360, 0, {0x17,0x00,0x15,0xc0,0x85,0x74,0x01,0x1c,0x00,0x47,0x00,0x11,0xc0,0x05,0x70,0x01 },
+  16, 0xc370, 0, {0x5c,0x00,0x53,0x00,0x10,0xc0,0x05,0x70,0x01,0x5c,0x00,0x57,0x00,0x14,0xc9,0x04 },
+  16, 0xc380, 0, {0x70,0x01,0x1c,0x00,0x57,0x00,0x15,0xc0,0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc390, 0, {0x00,0x45,0x42,0x00,0x60,0xc0,0x18,0x20,0x06,0x08,0x01,0x82,0x00,0x60,0x80,0x18 },
+  16, 0xc3a0, 0, {0x20,0x06,0x08,0x01,0x82,0x00,0x20,0x80,0x18,0x30,0x02,0x08,0x00,0x82,0x10,0x60 },
+  16, 0xc3b0, 0, {0x80,0x18,0x20,0x06,0x08,0x00,0x82,0x00,0x60,0x80,0x18,0x20,0x06,0x08,0x01,0x80 },
+  16, 0xc3c0, 0, {0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x42,0x04,0x20,0x81,0x08,0x20 },
+  16, 0xc3d0, 0, {0x02,0x08,0x10,0x82,0x04,0x20,0x81,0x08,0x20,0x42,0x08,0x10,0x82,0x04,0x20,0x81 },
+  16, 0xc3e0, 0, {0x08,0x20,0x46,0x08,0x11,0x82,0x04,0x20,0x81,0x08,0x20,0x42,0x08,0x11,0x82,0x04 },
+  16, 0xc3f0, 0, {0x20,0x81,0x08,0x20,0x42,0x08,0x10,0x80,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc400, 0, {0x00,0x45,0x42,0x05,0x40,0xc5,0x50,0x20,0x14,0x08,0x15,0x00,0x04,0x40,0x81,0x50 },
+  16, 0xc410, 0, {0x20,0x54,0x08,0x11,0x02,0x05,0x00,0x80,0x10,0x20,0x45,0x0c,0x11,0x42,0x04,0x40 },
+  16, 0xc420, 0, {0x81,0x50,0x20,0x14,0x0c,0x15,0x42,0x04,0x40,0x81,0x10,0x20,0x54,0x08,0x15,0x00 },
+  16, 0xc430, 0, {0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x03,0x01,0x50,0xc0,0x44,0x30 },
+  16, 0xc440, 0, {0x15,0x0c,0x05,0x43,0x01,0x50,0xc0,0x4c,0x30,0x15,0x0c,0x05,0x43,0x21,0x50,0xc0 },
+  16, 0xc450, 0, {0x54,0x30,0x15,0x0c,0x05,0x43,0x01,0x50,0xc0,0x54,0x30,0x15,0x0c,0x05,0x43,0x01 },
+  16, 0xc460, 0, {0x50,0xc0,0x54,0x20,0x15,0x0c,0x05,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc470, 0, {0x00,0x00,0x08,0x00,0x42,0x00,0x04,0x80,0x04,0x20,0x01,0x08,0x00,0x42,0x00,0x04 },
+  16, 0xc480, 0, {0x80,0x04,0x20,0x01,0x08,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0x01,0x08,0x00,0x42 },
+  16, 0xc490, 0, {0x00,0x10,0x80,0x04,0x00,0x01,0x08,0x00,0x42,0x00,0x10,0x80,0x04,0x20,0x01,0x00 },
+  16, 0xc4a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x45,0x42,0x02,0x00,0x80,0x84,0x20 },
+  16, 0xc4b0, 0, {0x20,0x08,0x08,0x02,0x02,0x00,0x80,0x84,0x20,0x20,0x08,0x08,0x02,0x02,0x00,0x80 },
+  16, 0xc4c0, 0, {0x80,0xa0,0x20,0x28,0x08,0x02,0x02,0x00,0x80,0x80,0x20,0x20,0x28,0x08,0x02,0x02 },
+  16, 0xc4d0, 0, {0x00,0x80,0x80,0x20,0x20,0x08,0x08,0x00,0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc4e0, 0, {0x00,0x45,0x40,0x05,0x60,0x41,0x58,0x00,0x56,0x00,0x15,0x80,0x05,0x60,0x01,0x58 },
+  16, 0xc4f0, 0, {0x00,0x56,0x00,0x15,0x80,0x05,0x20,0x01,0xd8,0x00,0x56,0x00,0x15,0x80,0x05,0x60 },
+  16, 0xc500, 0, {0x01,0x58,0x00,0x76,0x00,0x15,0x80,0x05,0x60,0x01,0x58,0x00,0x56,0x00,0x15,0x80 },
+  16, 0xc510, 0, {0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x40,0x03,0x60,0x00,0xd8,0x00 },
+  16, 0xc520, 0, {0x26,0x00,0x0d,0x80,0x02,0x60,0x00,0xd8,0x00,0x36,0x00,0x0d,0x80,0x07,0x60,0x01 },
+  16, 0xc530, 0, {0x5c,0x00,0x36,0x00,0x0d,0x80,0x03,0x60,0x00,0xd8,0x00,0x57,0x00,0x0d,0x80,0x02 },
+  16, 0xc540, 0, {0x60,0x00,0x98,0x00,0x36,0x00,0x0d,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc550, 0, {0x00,0x00,0x00,0x04,0x30,0x21,0x0c,0x00,0x43,0x00,0x10,0xc0,0x04,0x30,0x01,0x0c },
+  16, 0xc560, 0, {0x00,0x43,0x00,0x10,0xc0,0x04,0x30,0x01,0x18,0x00,0x43,0x00,0x10,0xc0,0x04,0x30 },
+  16, 0xc570, 0, {0x01,0x0c,0x00,0x46,0x00,0x10,0xc0,0x04,0x30,0x01,0x0c,0x00,0x43,0x00,0x10,0xc0 },
+  16, 0xc580, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x0c,0x00 },
+  16, 0xc590, 0, {0x03,0x00,0x00,0xc0,0x00,0x35,0x08,0x0c,0x00,0x03,0x00,0x00,0xc6,0x00,0x14,0x00 },
+  16, 0xc5a0, 0, {0x08,0x00,0x03,0x40,0x00,0xc0,0x00,0x30,0x00,0x0d,0x40,0x02,0x00,0x00,0xc0,0x00 },
+  16, 0xc5b0, 0, {0x30,0x00,0x0c,0x00,0x03,0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc5c0, 0, {0x00,0x00,0x05,0x01,0x31,0x40,0x4c,0x50,0x13,0x14,0x04,0xc5,0x01,0x31,0xc0,0x4c },
+  16, 0xc5d0, 0, {0x50,0x13,0x14,0x04,0xc5,0x05,0x31,0x41,0x4c,0x50,0x13,0x14,0x04,0xc5,0x01,0x31 },
+  16, 0xc5e0, 0, {0x40,0x4c,0x70,0x53,0x14,0x04,0xc5,0x01,0x31,0x40,0x4c,0x40,0x13,0x14,0x04,0xc0 },
+  16, 0xc5f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x05,0x68,0xc1,0x5a,0x30 },
+  16, 0xc600, 0, {0x56,0x8c,0x15,0xa3,0x05,0x69,0xc1,0x5a,0x30,0x46,0x8c,0x11,0xa7,0x01,0x68,0xc0 },
+  16, 0xc610, 0, {0x1a,0x30,0x56,0x8c,0x11,0xa3,0x04,0x68,0xc1,0x1a,0x30,0x16,0x8c,0x15,0xa3,0x04 },
+  16, 0xc620, 0, {0x68,0xc1,0x5a,0x30,0x56,0x8c,0x11,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc630, 0, {0x00,0x00,0x00,0x00,0x20,0x00,0x08,0x00,0x02,0x00,0x00,0x80,0x00,0x24,0x00,0x08 },
+  16, 0xc640, 0, {0x01,0x02,0x00,0x00,0x80,0x00,0x24,0x00,0x08,0x80,0x02,0x60,0x00,0x80,0x00,0x20 },
+  16, 0xc650, 0, {0x00,0x09,0x40,0x02,0x20,0x00,0x80,0x00,0x20,0x00,0x08,0x00,0x02,0x00,0x00,0x80 },
+  16, 0xc660, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x44,0x62,0x11,0x18,0x84 },
+  16, 0xc670, 0, {0x46,0x21,0x11,0x88,0x44,0x62,0x09,0x18,0x84,0x46,0x21,0x11,0x88,0x60,0x62,0x10 },
+  16, 0xc680, 0, {0x18,0x04,0x46,0x01,0x11,0x88,0x44,0x62,0x11,0x18,0x80,0x06,0x01,0x11,0x88,0x44 },
+  16, 0xc690, 0, {0x62,0x11,0x18,0x84,0x46,0x21,0x11,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc6a0, 0, {0x00,0x00,0x00,0x45,0x50,0x11,0x54,0x04,0x55,0x01,0x15,0x40,0x44,0x50,0x11,0x54 },
+  16, 0xc6b0, 0, {0x04,0x45,0x01,0x11,0x40,0x40,0x50,0x10,0x54,0x04,0x45,0x01,0x15,0x40,0x44,0x50 },
+  16, 0xc6c0, 0, {0x11,0x14,0x00,0x15,0x01,0x15,0x40,0x44,0x50,0x11,0x54,0x04,0x55,0x00,0x11,0x40 },
+  16, 0xc6d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x21,0x42,0x08,0x50,0x82 },
+  16, 0xc6e0, 0, {0x14,0x20,0x85,0x08,0x21,0x42,0x00,0x50,0x82,0x14,0x20,0x85,0x08,0x20,0x42,0x08 },
+  16, 0xc6f0, 0, {0x50,0x82,0x15,0x20,0x05,0x48,0x21,0x42,0x08,0x50,0x82,0x14,0x20,0x81,0x40,0x21 },
+  16, 0xc700, 0, {0x42,0x08,0x50,0x82,0x14,0x20,0x85,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc710, 0, {0x00,0x00,0x0a,0x01,0x02,0x80,0x40,0xa0,0x10,0x28,0x04,0x0a,0x01,0x02,0x84,0x40 },
+  16, 0xc720, 0, {0xa1,0x10,0x28,0x04,0x0a,0x01,0x02,0x80,0x40,0xa0,0x00,0x28,0x00,0x0a,0x01,0x02 },
+  16, 0xc730, 0, {0x80,0x40,0xb0,0x10,0x28,0x00,0x0a,0x01,0x02,0x80,0x40,0xa0,0x10,0x28,0x04,0x00 },
+  16, 0xc740, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x03,0x53,0x00,0xd4,0xc0 },
+  16, 0xc750, 0, {0x35,0x30,0x0d,0x4c,0x03,0x53,0x00,0xd4,0xc0,0x35,0x30,0x0d,0x4c,0x03,0x53,0x00 },
+  16, 0xc760, 0, {0xd4,0xc0,0x21,0x30,0x08,0x4c,0x03,0x53,0x00,0xd4,0xc0,0x35,0x30,0x08,0x4c,0x03 },
+  16, 0xc770, 0, {0x53,0x00,0xd4,0xc0,0x35,0x30,0x0d,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc780, 0, {0x00,0x00,0x08,0x04,0x70,0x01,0x5c,0x80,0x07,0x20,0x25,0xc9,0x04,0x72,0x01,0x5c },
+  16, 0xc790, 0, {0x80,0x47,0x20,0x15,0xc8,0x00,0x72,0x05,0xdc,0x80,0x57,0x20,0x15,0xc8,0x05,0x72 },
+  16, 0xc7a0, 0, {0x01,0x1c,0x90,0x67,0x20,0x15,0xc8,0x05,0x72,0x01,0x1c,0x80,0x57,0x20,0x15,0xc0 },
+  16, 0xc7b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x18,0x48,0xc2,0x12,0x31 },
+  16, 0xc7c0, 0, {0x84,0x8c,0x61,0x03,0x18,0x40,0xc8,0x12,0x31,0x84,0x8c,0x61,0x03,0x18,0x48,0xc4 },
+  16, 0xc7d0, 0, {0x10,0x31,0x84,0x0c,0x41,0x23,0x18,0x48,0xc6,0x10,0x30,0x04,0x0c,0x61,0x23,0x18 },
+  16, 0xc7e0, 0, {0x48,0xc6,0x12,0x30,0x84,0x8c,0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc7f0, 0, {0x00,0x00,0x3f,0xff,0x4f,0xff,0xd3,0xff,0xf4,0xff,0xfd,0x3f,0xff,0x4f,0xff,0xd3 },
+  16, 0xc800, 0, {0xff,0xf4,0xff,0xfd,0x3f,0xff,0x4f,0xff,0xd3,0xff,0xf4,0xff,0xfd,0x3f,0xff,0x4f },
+  16, 0xc810, 0, {0xff,0xd3,0xff,0xf4,0xff,0xfd,0x3f,0xff,0x4f,0xff,0xd3,0xff,0xf4,0xff,0xbd,0x00 },
+  16, 0xc820, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc830, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc840, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc850, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc860, 0, {0x00,0x00,0x2c,0xdb,0x0b,0x36,0xc2,0xcd,0xb0,0xb3,0x6c,0x2c,0xdb,0x09,0x36,0xc2 },
+  16, 0xc870, 0, {0xcd,0xb0,0xb3,0x6c,0x2c,0xdb,0x0b,0x36,0xc2,0xcd,0xb0,0xb3,0x6c,0x2c,0xdb,0x0b },
+  16, 0xc880, 0, {0x36,0xc2,0xcd,0xb0,0xb3,0x6c,0x2c,0xdb,0x0b,0x36,0xc2,0xcd,0xb0,0xb3,0x2c,0x00 },
+  16, 0xc890, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x3c,0x4c,0xcf,0x13,0x33 },
+  16, 0xc8a0, 0, {0xc4,0xcc,0xf1,0x33,0x3c,0x4d,0x4e,0x93,0x33,0xc4,0xcc,0xf1,0x2b,0x3c,0x4c,0xcf },
+  16, 0xc8b0, 0, {0x13,0x33,0xc4,0xcc,0xe9,0x33,0x3c,0x4c,0xcf,0x12,0xb5,0xc4,0xcc,0xf1,0x33,0x3c },
+  16, 0xc8c0, 0, {0x4c,0xcf,0x13,0x33,0xc4,0xcd,0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc8d0, 0, {0x00,0x00,0x3b,0x7e,0x4e,0xc7,0x93,0xb7,0xe4,0xed,0xf9,0x23,0x7e,0x4e,0x47,0x93 },
+  16, 0xc8e0, 0, {0xb7,0xe4,0xed,0xf9,0x3f,0x7e,0x4e,0xde,0x12,0x37,0xe4,0x8d,0xf9,0x3b,0x7e,0x4e },
+  16, 0xc8f0, 0, {0xdf,0x93,0xf7,0x84,0x8d,0xf9,0x3b,0x7e,0x4e,0xdf,0x93,0xb1,0xe4,0xed,0xb9,0x00 },
+  16, 0xc900, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x70,0x40,0x9c,0x11 },
+  16, 0xc910, 0, {0x67,0x04,0x19,0xc3,0x02,0x70,0x40,0x9c,0x10,0x27,0x04,0x09,0xc1,0x02,0x70,0x40 },
+  16, 0xc920, 0, {0x1c,0x10,0x27,0x14,0x01,0xc1,0x02,0x70,0x40,0x9c,0x50,0x07,0x04,0x09,0xc1,0x02 },
+  16, 0xc930, 0, {0x70,0x40,0x9c,0x10,0x67,0x14,0x11,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc940, 0, {0x00,0x00,0x04,0x05,0x71,0x01,0x5c,0x40,0x57,0x10,0x15,0xc4,0x05,0x71,0x01,0x5c },
+  16, 0xc950, 0, {0x40,0x57,0x10,0x15,0xc6,0x05,0x71,0x01,0x5c,0x40,0x57,0x10,0x10,0xc4,0x05,0x71 },
+  16, 0xc960, 0, {0x01,0x5c,0x64,0x03,0x10,0x55,0xc4,0x05,0x71,0x01,0x5c,0x40,0x57,0x10,0x15,0xc0 },
+  16, 0xc970, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x20,0x80,0x48,0x20 },
+  16, 0xc980, 0, {0x12,0x08,0x04,0x82,0x01,0x21,0x80,0x48,0x20,0x12,0x08,0x04,0x80,0x01,0x20,0x80 },
+  16, 0xc990, 0, {0x48,0x20,0x12,0x08,0x05,0xc2,0x01,0x20,0x80,0x48,0x24,0x17,0x08,0x04,0x82,0x01 },
+  16, 0xc9a0, 0, {0x20,0x80,0x48,0x20,0x12,0x08,0x04,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xc9b0, 0, {0x00,0x00,0x00,0x00,0x60,0x00,0x18,0x00,0x46,0x00,0x11,0x84,0x00,0x60,0x00,0x18 },
+  16, 0xc9c0, 0, {0x00,0x06,0x00,0x01,0x80,0x00,0x60,0x01,0x18,0x00,0x06,0x10,0x91,0x80,0x00,0x60 },
+  16, 0xc9d0, 0, {0x00,0x18,0x46,0x46,0x18,0x01,0x80,0x00,0x60,0x00,0x18,0x00,0x06,0x10,0x01,0x80 },
+  16, 0xc9e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x04,0x73,0x01,0x1c,0x80 },
+  16, 0xc9f0, 0, {0x07,0x20,0x01,0xc8,0x04,0x72,0x01,0x1c,0x80,0x47,0x20,0x11,0xc8,0x04,0x72,0x01 },
+  16, 0xca00, 0, {0x1c,0x80,0x47,0x22,0x11,0xc8,0x04,0x72,0x01,0x1c,0x80,0x07,0x20,0x11,0xc8,0x04 },
+  16, 0xca10, 0, {0x72,0x01,0x1c,0x80,0x07,0x28,0x11,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xca20, 0, {0x00,0x00,0x00,0x00,0x60,0x00,0x18,0x00,0x06,0x00,0x01,0x80,0x00,0x60,0x00,0x18 },
+  16, 0xca30, 0, {0x00,0x06,0x00,0x01,0x80,0x00,0x60,0x00,0x18,0x00,0x06,0x00,0x01,0x80,0x00,0x60 },
+  16, 0xca40, 0, {0x00,0x18,0x00,0x46,0x04,0x01,0x80,0x00,0x60,0x00,0x18,0x00,0x06,0x00,0x01,0x80 },
+  16, 0xca50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x04,0x22,0x01,0x08,0x80 },
+  16, 0xca60, 0, {0x02,0x20,0x00,0x90,0x04,0x27,0x81,0x08,0x80,0x42,0x20,0x10,0x98,0x04,0x24,0x01 },
+  16, 0xca70, 0, {0x08,0x80,0x42,0x48,0x10,0x88,0x04,0x22,0x01,0x09,0x40,0x42,0x60,0x10,0x88,0x04 },
+  16, 0xca80, 0, {0x22,0x01,0x08,0xc0,0x02,0x40,0x10,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xca90, 0, {0x00,0x00,0x2a,0x04,0x4b,0x81,0x12,0xa0,0x04,0xa8,0x01,0x2a,0x04,0x4a,0x81,0x12 },
+  16, 0xcaa0, 0, {0xa0,0x44,0xa8,0x11,0x2a,0x04,0x48,0x80,0x12,0xa0,0x44,0x88,0x01,0x2a,0x04,0x4a },
+  16, 0xcab0, 0, {0x81,0x12,0x20,0x04,0xac,0x11,0x2a,0x04,0x4a,0x81,0x12,0xb0,0x44,0x9c,0x11,0x00 },
+  16, 0xcac0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xc0,0x0c,0x00,0x53,0x00,0x14,0xc0 },
+  16, 0xcad0, 0, {0x05,0x30,0x01,0x44,0x00,0x53,0x00,0x14,0xc0,0x05,0x30,0x04,0x0c,0x00,0x53,0x00 },
+  16, 0xcae0, 0, {0x14,0xc0,0x05,0xb0,0x01,0x4c,0x00,0x53,0x00,0x16,0xc0,0x01,0x30,0x01,0x4c,0x00 },
+  16, 0xcaf0, 0, {0x53,0x00,0x14,0xc0,0x01,0x38,0x00,0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcb00, 0, {0x08,0xc0,0x00,0x10,0x40,0x00,0x10,0x00,0x04,0x00,0x01,0x10,0x00,0x44,0x80,0x10 },
+  16, 0xcb10, 0, {0x00,0x04,0x00,0x01,0x10,0x00,0x46,0x00,0x00,0x00,0x04,0x60,0x01,0x00,0x00,0x40 },
+  16, 0xcb20, 0, {0x00,0x11,0x60,0x02,0x40,0x01,0x00,0x10,0x40,0x00,0x10,0x60,0x01,0x50,0x10,0x40 },
+  16, 0xcb30, 0, {0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xc0,0x40,0x02,0x00,0x00,0x80,0x00 },
+  16, 0xcb40, 0, {0x20,0x00,0x08,0x08,0x02,0x00,0x00,0x80,0x00,0x20,0x00,0x08,0x00,0x02,0x00,0x00 },
+  16, 0xcb50, 0, {0x80,0x00,0x20,0x00,0x08,0x00,0x02,0x00,0x00,0x80,0x00,0x00,0x00,0x08,0x00,0x02 },
+  16, 0xcb60, 0, {0x00,0x00,0x80,0x00,0x21,0x00,0x08,0x40,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcb70, 0, {0x08,0xc0,0x40,0x04,0x60,0x01,0x18,0x00,0x46,0x00,0x11,0x80,0x04,0x60,0x01,0x18 },
+  16, 0xcb80, 0, {0x00,0x46,0x00,0x11,0x80,0x04,0x60,0x01,0xc8,0x00,0x46,0x00,0x19,0x80,0x00,0x60 },
+  16, 0xcb90, 0, {0x00,0x18,0x00,0x66,0x00,0x11,0x80,0x04,0x60,0x01,0x18,0x00,0x06,0x00,0x11,0x80 },
+  16, 0xcba0, 0, {0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x01,0x00,0x02,0x60,0x00,0x98,0x00 },
+  16, 0xcbb0, 0, {0x26,0x00,0x09,0x81,0x02,0x60,0x01,0x98,0x00,0x26,0x00,0x09,0x80,0x06,0x62,0x00 },
+  16, 0xcbc0, 0, {0x48,0x00,0x26,0x20,0x01,0xc0,0x02,0x60,0x01,0x98,0x00,0x07,0x00,0x09,0x80,0x02 },
+  16, 0xcbd0, 0, {0x60,0x00,0x98,0x00,0x26,0x00,0x11,0x82,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcbe0, 0, {0x40,0x45,0x42,0x04,0x30,0x81,0x0c,0x20,0x43,0x08,0x10,0xc2,0x04,0x30,0x85,0x8c },
+  16, 0xcbf0, 0, {0x20,0x43,0x08,0x10,0xc2,0x04,0x30,0x81,0x0c,0x20,0x43,0x48,0x11,0x82,0x04,0x30 },
+  16, 0xcc00, 0, {0x81,0x8d,0x20,0x46,0x08,0x10,0xc2,0x04,0x30,0x81,0x0c,0x20,0x43,0x0c,0x10,0xc0 },
+  16, 0xcc10, 0, {0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x04,0x00,0x00,0x30,0x00,0x0c,0x00 },
+  16, 0xcc20, 0, {0x03,0x00,0x00,0xc0,0x00,0x10,0x00,0x0c,0x00,0x03,0x00,0x00,0xc0,0x00,0x30,0x00 },
+  16, 0xcc30, 0, {0x08,0x00,0x03,0x00,0x00,0x80,0x00,0x30,0x00,0x0c,0x80,0x02,0x00,0x00,0xc0,0x00 },
+  16, 0xcc40, 0, {0x30,0x00,0x0c,0x00,0x03,0x20,0x00,0xc0,0x10,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcc50, 0, {0x40,0x00,0x02,0x00,0x30,0x80,0x0c,0x21,0x03,0x08,0x00,0xc2,0x00,0x30,0x80,0x0c },
+  16, 0xcc60, 0, {0x20,0x03,0x08,0x00,0xc2,0x04,0x30,0xc1,0x0c,0x20,0x03,0x0c,0x10,0xc2,0x00,0x30 },
+  16, 0xcc70, 0, {0x80,0x0c,0xb0,0x43,0x08,0x00,0xc2,0x00,0x30,0x80,0x0c,0x20,0x03,0x28,0x10,0xc0 },
+  16, 0xcc80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x45,0x42,0x04,0x60,0x81,0x18,0x20 },
+  16, 0xcc90, 0, {0x46,0x08,0x11,0x82,0x04,0x60,0x80,0x18,0x20,0x46,0x08,0x11,0x82,0x00,0x60,0x81 },
+  16, 0xcca0, 0, {0x18,0x20,0x46,0x08,0x11,0x82,0x04,0x60,0x80,0x18,0x20,0x06,0x08,0x11,0x82,0x04 },
+  16, 0xccb0, 0, {0x60,0x81,0x18,0x20,0x46,0x0c,0x11,0xc0,0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xccc0, 0, {0x40,0x01,0x42,0x00,0x20,0x80,0x08,0x20,0x02,0x08,0x00,0x82,0x00,0x20,0x80,0x08 },
+  16, 0xccd0, 0, {0x20,0x02,0x08,0x00,0x82,0x00,0x20,0x80,0x0c,0x20,0x02,0x08,0x00,0xc2,0x00,0x20 },
+  16, 0xcce0, 0, {0x80,0x08,0x20,0x42,0x08,0x00,0x82,0x00,0x20,0x80,0x08,0x20,0x02,0x08,0x01,0x80 },
+  16, 0xccf0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x01,0x42,0x04,0x60,0x81,0x18,0x20 },
+  16, 0xcd00, 0, {0x46,0x08,0x11,0x82,0x04,0x60,0x80,0x18,0x20,0x46,0x08,0x11,0x82,0x00,0x60,0xc1 },
+  16, 0xcd10, 0, {0x0c,0x20,0x46,0x0c,0x10,0xc2,0x04,0x60,0x80,0x18,0x30,0x42,0x08,0x11,0x82,0x04 },
+  16, 0xcd20, 0, {0x60,0x81,0x18,0x20,0x46,0x08,0x10,0x80,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcd30, 0, {0x40,0x45,0x40,0x04,0x50,0x01,0x14,0x00,0x45,0x00,0x11,0x40,0x04,0x50,0x00,0x14 },
+  16, 0xcd40, 0, {0x00,0x45,0x00,0x11,0x40,0x00,0x50,0x00,0x04,0x00,0x45,0x00,0x00,0x40,0x04,0x50 },
+  16, 0xcd50, 0, {0x00,0x14,0x00,0x01,0x00,0x11,0x40,0x04,0x50,0x01,0x14,0x00,0x45,0x00,0x00,0x42 },
+  16, 0xcd60, 0, {0x01,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x06,0x00,0x41,0x80,0x10,0x60 },
+  16, 0xcd70, 0, {0x04,0x18,0x01,0x06,0x00,0x41,0x80,0x10,0x60,0x04,0x18,0x01,0x06,0x00,0x41,0x80 },
+  16, 0xcd80, 0, {0x10,0x60,0x04,0x18,0x01,0x06,0x00,0x41,0x80,0x10,0x60,0x04,0x18,0x01,0x06,0x00 },
+  16, 0xcd90, 0, {0x41,0x80,0x10,0x60,0x04,0x18,0x01,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcda0, 0, {0x48,0x00,0x02,0x01,0x00,0x80,0x40,0x21,0x10,0x08,0x04,0x02,0x01,0x00,0x80,0x40 },
+  16, 0xcdb0, 0, {0x20,0x10,0x08,0x04,0x02,0x01,0x00,0x80,0x40,0x21,0x10,0x08,0x04,0x02,0x01,0x00 },
+  16, 0xcdc0, 0, {0x80,0x40,0x30,0x10,0x08,0x04,0x02,0x11,0x00,0x84,0x40,0x20,0x10,0x08,0x14,0x00 },
+  16, 0xcdd0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x45,0x46,0x03,0x51,0x80,0xd4,0x60 },
+  16, 0xcde0, 0, {0x35,0x18,0x0d,0x46,0x03,0x51,0x80,0xd4,0x60,0x35,0x18,0x0d,0x46,0x03,0x51,0x80 },
+  16, 0xcdf0, 0, {0xd4,0x60,0x35,0x10,0x0d,0x46,0x03,0x51,0x80,0xd4,0x40,0x35,0x18,0x0d,0x46,0x03 },
+  16, 0xce00, 0, {0x51,0x80,0xd4,0x60,0x35,0x18,0x0d,0x40,0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xce10, 0, {0x00,0x01,0x46,0x04,0x71,0x81,0x1c,0x60,0x07,0x18,0x11,0xce,0x04,0x71,0x81,0x1c },
+  16, 0xce20, 0, {0x60,0x47,0x18,0x01,0xc6,0x04,0x71,0x81,0x9c,0x60,0x47,0x18,0x19,0xc6,0x04,0x71 },
+  16, 0xce30, 0, {0x80,0x1c,0x60,0x67,0x18,0x11,0xc6,0x04,0x71,0x81,0x1c,0x60,0x47,0x18,0x11,0xc0 },
+  16, 0xce40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x46,0x02,0x71,0x80,0x9c,0x60 },
+  16, 0xce50, 0, {0x27,0x18,0x09,0xc6,0x06,0x71,0x80,0x1c,0x60,0x27,0x18,0x09,0xc6,0x01,0x31,0x80 },
+  16, 0xce60, 0, {0x1c,0x60,0x07,0x18,0x09,0xc6,0x02,0x71,0x80,0x9c,0x60,0x07,0x18,0x09,0xc6,0x12 },
+  16, 0xce70, 0, {0x71,0x80,0x9c,0x60,0x33,0x18,0x01,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xce80, 0, {0x50,0x45,0x46,0x05,0x71,0x81,0x5c,0x60,0x57,0x18,0x15,0xc6,0x05,0x71,0x80,0x5c },
+  16, 0xce90, 0, {0x60,0x57,0x18,0x15,0xc6,0x01,0x31,0x81,0x0c,0x60,0x17,0x18,0x10,0xc6,0x05,0x71 },
+  16, 0xcea0, 0, {0x81,0x5c,0x60,0x03,0x18,0x15,0xc6,0x05,0x71,0x81,0x5c,0x60,0x53,0x18,0x18,0x82 },
+  16, 0xceb0, 0, {0x10,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x12,0x01,0x24,0x80,0x48,0x20 },
+  16, 0xcec0, 0, {0x12,0x08,0x04,0x82,0x01,0x24,0x80,0x48,0x20,0x12,0x08,0x04,0x82,0x01,0x20,0x80 },
+  16, 0xced0, 0, {0x58,0x20,0x52,0x0c,0x05,0x82,0x01,0x20,0x80,0x49,0x20,0x02,0x08,0x04,0x82,0x01 },
+  16, 0xcee0, 0, {0x20,0x80,0x49,0x20,0x12,0x48,0x04,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcef0, 0, {0x40,0x04,0x06,0x00,0x61,0x80,0x18,0x60,0x06,0x18,0x01,0x86,0x04,0x61,0x80,0x18 },
+  16, 0xcf00, 0, {0x60,0x06,0x18,0x01,0x86,0x00,0x61,0x81,0x48,0x60,0x06,0x18,0x14,0x86,0x00,0x61 },
+  16, 0xcf10, 0, {0x80,0x18,0x60,0x42,0x18,0x01,0x86,0x00,0x61,0x80,0x18,0x60,0x06,0x18,0x00,0x80 },
+  16, 0xcf20, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x45,0x60,0x04,0x78,0x01,0x1e,0x00 },
+  16, 0xcf30, 0, {0x47,0x80,0x11,0xe8,0x00,0x78,0x01,0x1e,0x00,0x47,0x80,0x11,0xe0,0x04,0x78,0x01 },
+  16, 0xcf40, 0, {0x1e,0x00,0x43,0x80,0x11,0xe0,0x04,0x78,0x01,0x1e,0x00,0x03,0x80,0x15,0xe0,0x04 },
+  16, 0xcf50, 0, {0x78,0x01,0x1e,0x00,0x47,0x80,0x11,0xc0,0x10,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcf60, 0, {0x40,0x01,0x12,0x00,0x64,0x80,0x18,0x20,0x06,0x08,0x01,0x82,0x00,0x64,0x80,0x18 },
+  16, 0xcf70, 0, {0x20,0x06,0x08,0x01,0x82,0x00,0x60,0x80,0x18,0x30,0x02,0x08,0x01,0x82,0x00,0x60 },
+  16, 0xcf80, 0, {0x80,0x19,0x30,0x42,0x08,0x00,0x82,0x00,0x60,0x80,0x19,0x20,0x06,0x48,0x01,0x80 },
+  16, 0xcf90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x01,0x42,0x04,0x20,0x81,0x08,0x20 },
+  16, 0xcfa0, 0, {0x42,0x08,0x10,0x82,0x00,0x20,0x81,0x08,0x20,0x42,0x08,0x10,0x82,0x04,0x20,0x81 },
+  16, 0xcfb0, 0, {0x08,0x20,0x46,0x08,0x10,0x82,0x04,0x20,0x81,0x08,0x20,0x42,0x08,0x11,0x82,0x04 },
+  16, 0xcfc0, 0, {0x20,0x81,0x08,0x20,0x42,0x08,0x10,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xcfd0, 0, {0x40,0x45,0x42,0x04,0x40,0x81,0x10,0x20,0x44,0x08,0x11,0x02,0x00,0x40,0x81,0x10 },
+  16, 0xcfe0, 0, {0x20,0x44,0x08,0x11,0x02,0x04,0x40,0x80,0x10,0x20,0x45,0x08,0x01,0x02,0x04,0x40 },
+  16, 0xcff0, 0, {0x81,0x10,0x21,0x00,0x0c,0x11,0x02,0x04,0x40,0x81,0x10,0x20,0x44,0x08,0x01,0x00 },
+  16, 0xd000, 0, {0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x03,0x00,0x50,0xc0,0x14,0x30 },
+  16, 0xd010, 0, {0x05,0x0c,0x01,0x43,0x00,0x50,0xc0,0x14,0x30,0x05,0x0c,0x01,0x43,0x00,0x50,0xc0 },
+  16, 0xd020, 0, {0x14,0x30,0x05,0x0c,0x01,0x43,0x00,0x50,0xc0,0x14,0x30,0x05,0x0c,0x01,0x43,0x00 },
+  16, 0xd030, 0, {0x50,0xc0,0x14,0x30,0x05,0x0c,0x01,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd040, 0, {0x40,0x00,0x08,0x00,0x42,0x04,0x10,0x80,0x04,0x20,0x01,0x09,0x00,0x42,0x01,0x10 },
+  16, 0xd050, 0, {0x80,0x04,0x20,0x01,0x08,0x00,0x42,0x00,0x10,0x00,0x04,0x20,0x01,0x08,0x00,0x42 },
+  16, 0xd060, 0, {0x00,0x10,0x00,0x04,0x00,0x01,0x08,0x00,0x42,0x00,0x10,0x80,0x04,0x20,0x11,0x00 },
+  16, 0xd070, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x45,0x42,0x02,0x00,0x80,0x80,0x20 },
+  16, 0xd080, 0, {0x20,0x08,0x08,0x02,0x02,0x00,0x80,0x00,0x20,0x20,0x08,0x08,0x02,0x00,0x00,0x80 },
+  16, 0xd090, 0, {0x80,0xa0,0x00,0x0a,0x08,0x02,0x02,0x00,0x80,0x80,0x34,0x62,0x28,0x08,0x02,0x02 },
+  16, 0xd0a0, 0, {0x00,0x80,0x80,0x30,0x20,0x0c,0x08,0x00,0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd0b0, 0, {0x40,0x01,0x40,0x04,0x60,0x01,0x18,0x00,0x46,0x00,0x11,0x80,0x04,0x60,0x03,0x18 },
+  16, 0xd0c0, 0, {0x00,0x46,0x00,0x11,0x80,0x06,0x60,0x01,0x98,0x00,0x46,0x00,0x11,0x80,0x04,0x60 },
+  16, 0xd0d0, 0, {0x01,0x18,0x00,0x66,0x00,0x11,0x80,0x04,0x60,0x01,0x18,0x00,0x46,0x00,0x11,0x80 },
+  16, 0xd0e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x01,0x00,0x02,0x60,0x00,0x98,0x00 },
+  16, 0xd0f0, 0, {0x26,0x00,0x09,0x80,0x02,0x64,0x00,0x98,0x00,0x26,0x00,0x19,0x90,0x02,0x60,0x00 },
+  16, 0xd100, 0, {0x1d,0x00,0x26,0x00,0x01,0xc0,0x02,0x60,0x00,0x99,0x00,0x06,0x40,0x19,0x80,0x02 },
+  16, 0xd110, 0, {0x60,0x00,0x98,0x00,0x66,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd120, 0, {0x40,0x45,0x60,0x04,0x38,0x01,0x0e,0x00,0x43,0x80,0x10,0xe0,0x04,0x38,0x01,0x0e },
+  16, 0xd130, 0, {0x00,0x43,0x80,0x10,0xe0,0x04,0x38,0x01,0x1a,0x00,0x43,0x80,0x11,0xa0,0x04,0x38 },
+  16, 0xd140, 0, {0x01,0x0e,0x00,0x02,0x80,0x40,0xe0,0x04,0x38,0x01,0x0e,0x00,0x43,0x80,0x18,0x80 },
+  16, 0xd150, 0, {0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x04,0x01,0x00,0x30,0x40,0x0c,0x10 },
+  16, 0xd160, 0, {0x03,0x04,0x00,0xc9,0x00,0x30,0x40,0x0c,0x10,0x03,0x04,0x00,0xc1,0x00,0x30,0x40 },
+  16, 0xd170, 0, {0x08,0x10,0x03,0x04,0x00,0x81,0x00,0x30,0x40,0x0c,0x78,0x02,0x14,0x00,0xc1,0x00 },
+  16, 0xd180, 0, {0x30,0x40,0x0c,0x10,0x03,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd190, 0, {0x40,0x00,0x05,0x00,0x31,0x40,0x0c,0x50,0x03,0x14,0x00,0xc5,0x00,0x35,0x40,0x0c },
+  16, 0xd1a0, 0, {0x50,0x03,0x14,0x10,0xd5,0x00,0x31,0x41,0x0d,0x50,0x03,0x14,0x10,0xc5,0x00,0x31 },
+  16, 0xd1b0, 0, {0x40,0x0d,0x48,0x43,0x54,0x10,0xc5,0x00,0x31,0x40,0x0c,0x40,0x43,0x10,0x00,0xc2 },
+  16, 0xd1c0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x45,0x43,0x04,0x60,0xc1,0x18,0x30 },
+  16, 0xd1d0, 0, {0x46,0x0c,0x11,0x83,0x04,0x61,0xc1,0x18,0x30,0x46,0x0c,0x01,0x87,0x04,0x60,0xc1 },
+  16, 0xd1e0, 0, {0x18,0x30,0x46,0x08,0x11,0x83,0x04,0x60,0xc1,0x18,0x20,0x06,0x0c,0x01,0x83,0x04 },
+  16, 0xd1f0, 0, {0x60,0xc1,0x18,0x30,0x46,0x0c,0x11,0x80,0x10,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd200, 0, {0x40,0x01,0x40,0x00,0x20,0x00,0x08,0x00,0x02,0x00,0x00,0x80,0x00,0x20,0x00,0x08 },
+  16, 0xd210, 0, {0x00,0x02,0x00,0x00,0x81,0x00,0x20,0x00,0x08,0x80,0x02,0x00,0x00,0xc0,0x00,0x20 },
+  16, 0xd220, 0, {0x00,0x08,0x40,0x43,0x30,0x00,0x80,0x00,0x20,0x00,0x08,0x00,0x02,0x00,0x00,0x80 },
+  16, 0xd230, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x01,0x48,0x44,0x62,0x11,0x18,0x84 },
+  16, 0xd240, 0, {0x46,0x21,0x11,0x88,0x44,0x63,0x01,0x18,0x84,0x46,0x21,0x01,0x88,0x04,0x62,0x11 },
+  16, 0xd250, 0, {0x18,0x04,0x46,0x21,0x10,0xc8,0x44,0x62,0x11,0x18,0x05,0x43,0x01,0x81,0x88,0x44 },
+  16, 0xd260, 0, {0x62,0x11,0x18,0x84,0x46,0x21,0x11,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd270, 0, {0x40,0x45,0x40,0x04,0x50,0x01,0x14,0x04,0x45,0x01,0x11,0x40,0x44,0x50,0x01,0x14 },
+  16, 0xd280, 0, {0x04,0x45,0x01,0x01,0x40,0x45,0x00,0x10,0x14,0x04,0x45,0x03,0x00,0x40,0x44,0x50 },
+  16, 0xd290, 0, {0x11,0x14,0x04,0x01,0x05,0x41,0x40,0x44,0x50,0x11,0x14,0x04,0x05,0x01,0x01,0x40 },
+  16, 0xd2a0, 0, {0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x08,0x20,0x42,0x08,0x10,0x82 },
+  16, 0xd2b0, 0, {0x04,0x20,0x81,0x08,0x00,0x42,0x00,0x10,0x82,0x04,0x20,0x81,0x08,0x00,0x42,0x08 },
+  16, 0xd2c0, 0, {0x10,0x82,0x05,0x20,0x81,0x08,0x20,0x42,0x08,0x10,0x8a,0x05,0x20,0x05,0x08,0x20 },
+  16, 0xd2d0, 0, {0x42,0x08,0x10,0x82,0x04,0x22,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd2e0, 0, {0x00,0x00,0x0a,0x01,0x02,0x80,0x40,0xa0,0x10,0x28,0x04,0x02,0x01,0x02,0x80,0x40 },
+  16, 0xd2f0, 0, {0xa0,0x10,0x28,0x04,0x0a,0x01,0x02,0x80,0x40,0xa0,0x00,0x29,0x04,0x0a,0x01,0x02 },
+  16, 0xd300, 0, {0x80,0x40,0xa4,0x00,0x28,0x04,0x0a,0x01,0x02,0x80,0x40,0xa8,0x10,0x2b,0x14,0x00 },
+  16, 0xd310, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x45,0x4d,0x03,0x53,0x40,0xd4,0xd0 },
+  16, 0xd320, 0, {0x35,0x34,0x0d,0x4d,0x03,0x53,0x40,0xd4,0xd0,0x35,0x34,0x0d,0x4d,0x03,0x53,0x40 },
+  16, 0xd330, 0, {0xd4,0xd0,0x21,0x34,0x4d,0x4d,0x03,0x53,0x40,0xd4,0xd9,0x61,0x34,0x04,0x0d,0x03 },
+  16, 0xd340, 0, {0x53,0x40,0xc0,0xd8,0x35,0x37,0x0d,0x40,0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd350, 0, {0x40,0x01,0x48,0x04,0x72,0x00,0x1c,0x80,0x47,0x20,0x11,0xc8,0x04,0x72,0x01,0x1c },
+  16, 0xd360, 0, {0x80,0x47,0x20,0x11,0xc8,0x04,0x72,0x00,0x9c,0x80,0x47,0x20,0x19,0xc8,0x00,0x72 },
+  16, 0xd370, 0, {0x01,0x1c,0x88,0x67,0x20,0x11,0xc8,0x04,0x72,0x01,0x5c,0x82,0x47,0x22,0x11,0xc0 },
+  16, 0xd380, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x08,0x48,0xc2,0x12,0x31 },
+  16, 0xd390, 0, {0x84,0x8c,0x61,0x23,0x10,0x40,0xc0,0x12,0x31,0x84,0x8c,0x61,0x03,0x10,0x48,0xc4 },
+  16, 0xd3a0, 0, {0x10,0x31,0x84,0x8c,0x41,0x23,0x18,0x48,0xc6,0x10,0x30,0x04,0x0c,0x41,0x23,0x18 },
+  16, 0xd3b0, 0, {0x48,0xc6,0x12,0x30,0x84,0x8c,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd3c0, 0, {0x00,0x00,0x3f,0xff,0x4f,0xff,0xd3,0xff,0xf4,0xff,0xfd,0x3f,0xff,0x4f,0xff,0xd3 },
+  16, 0xd3d0, 0, {0xff,0xf4,0xff,0xfd,0x3f,0xff,0x4f,0xff,0xd3,0xff,0xf4,0xff,0xfd,0x3f,0xff,0x4f },
+  16, 0xd3e0, 0, {0xff,0xd3,0xff,0xf4,0xff,0xdd,0x3f,0xff,0x4f,0xff,0xd3,0xff,0xf4,0xff,0xfd,0x00 },
+  16, 0xd3f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd400, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd410, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd420, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd430, 0, {0x00,0x00,0x2c,0xdb,0x0b,0x36,0xc2,0xcd,0xb0,0xb3,0x6c,0x2c,0xdb,0x0b,0x36,0xc2 },
+  16, 0xd440, 0, {0xcd,0xb0,0xb3,0x6c,0x2c,0xdb,0x0b,0x36,0xc2,0xcd,0xb0,0xb3,0x6c,0x2c,0xdb,0x0b },
+  16, 0xd450, 0, {0x36,0xc2,0xcd,0xb0,0xb3,0x4c,0x2c,0xdb,0x0b,0x36,0xc2,0xcd,0xb0,0xb3,0x6c,0x00 },
+  16, 0xd460, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x5c,0x4c,0xd7,0x13,0x33 },
+  16, 0xd470, 0, {0xc4,0xcc,0xf1,0x33,0x3a,0x4a,0xd6,0x93,0x33,0xc4,0xcc,0xf1,0x2b,0x3a,0x4c,0xcf },
+  16, 0xd480, 0, {0x13,0x33,0xc4,0xcc,0xe9,0x33,0x3c,0x4c,0xcf,0x12,0xb5,0xa4,0xac,0xc9,0x33,0x3c },
+  16, 0xd490, 0, {0x4c,0xcf,0x13,0x35,0xc4,0xcd,0x69,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd4a0, 0, {0x00,0x00,0x3b,0x7e,0x4e,0xdf,0x93,0xb7,0xe4,0xed,0xf9,0x3b,0x7e,0x4e,0xdf,0x93 },
+  16, 0xd4b0, 0, {0xb7,0xe4,0xed,0xf9,0x3b,0x7e,0x4e,0xde,0x12,0x37,0xe4,0xed,0xe1,0x3b,0x7e,0x4e },
+  16, 0xd4c0, 0, {0xdf,0x92,0x31,0x84,0x8d,0xd9,0x3b,0x7e,0x4e,0xdf,0x93,0xb1,0xe4,0xec,0x61,0x00 },
+  16, 0xd4d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0x04,0xa1,0x83,0x2c },
+  16, 0xd4e0, 0, {0x03,0x0a,0x10,0x82,0xc1,0x34,0x10,0x8f,0x00,0x40,0x09,0x14,0x02,0x03,0x14,0x91 },
+  16, 0xd4f0, 0, {0x00,0x08,0x42,0x0b,0x18,0x82,0xc4,0x00,0x31,0xca,0x0c,0x52,0x02,0x10,0x80,0x85 },
+  16, 0xd500, 0, {0x00,0x21,0x82,0x28,0x40,0x0a,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd510, 0, {0x00,0x00,0x0a,0x04,0x02,0x01,0x40,0x80,0x73,0x28,0x10,0x48,0x07,0x06,0x01,0x04 },
+  16, 0xd520, 0, {0xa4,0x41,0x21,0x14,0x08,0x44,0x06,0x11,0x40,0x80,0x70,0x20,0x14,0x0a,0x04,0x02 },
+  16, 0xd530, 0, {0x00,0xc8,0x84,0x41,0x21,0x1c,0x08,0x06,0x12,0x01,0xc0,0x80,0x60,0x20,0x14,0x00 },
+  16, 0xd540, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x84,0x04,0x21,0x82,0x08 },
+  16, 0xd550, 0, {0x53,0x02,0x10,0x80,0xc5,0x00,0x81,0x4a,0x04,0x42,0x02,0x14,0x00,0x04,0x20,0x21 },
+  16, 0xd560, 0, {0x80,0xa8,0x72,0x22,0x1c,0x88,0xc4,0x06,0xa1,0x42,0x8c,0x52,0x22,0x1c,0x88,0x85 },
+  16, 0xd570, 0, {0x26,0x21,0xc0,0x88,0x50,0x22,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd580, 0, {0x00,0x00,0x02,0x44,0x00,0x01,0x01,0x00,0x62,0x00,0x10,0x00,0x04,0x00,0x01,0x01 },
+  16, 0xd590, 0, {0x20,0x40,0x00,0x1c,0x00,0x44,0x04,0x01,0x02,0x20,0x62,0x00,0x1c,0x80,0x04,0x04 },
+  16, 0xd5a0, 0, {0x80,0x89,0x20,0x50,0x08,0x14,0x80,0x04,0x24,0x01,0xc1,0x00,0x50,0x00,0x18,0x00 },
+  16, 0xd5b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x80,0x38,0x20,0x04,0x0c },
+  16, 0xd5c0, 0, {0x31,0x0a,0x00,0x00,0x02,0x18,0x20,0x8c,0xa8,0x10,0x28,0x08,0x88,0xc1,0x14,0x10 },
+  16, 0xd5d0, 0, {0xc6,0x00,0x22,0x03,0x08,0x02,0x01,0x08,0xb0,0x00,0x0c,0x21,0x02,0x00,0x82,0x80 },
+  16, 0xd5e0, 0, {0x08,0x00,0x49,0x08,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd5f0, 0, {0x00,0x00,0x00,0x01,0x00,0x80,0x08,0x20,0x03,0x00,0x04,0x02,0x43,0x20,0x00,0x40 },
+  16, 0xd600, 0, {0x00,0x20,0x00,0x04,0x42,0x01,0x10,0x80,0x84,0x20,0x11,0x08,0x04,0x00,0x00,0x00 },
+  16, 0xd610, 0, {0x00,0x44,0x24,0x20,0x09,0x08,0x40,0x03,0x00,0x90,0xc4,0x20,0x20,0x08,0x0c,0x02 },
+  16, 0xd620, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x81,0x08,0x20,0x04,0x88 },
+  16, 0xd630, 0, {0x02,0x22,0x08,0x08,0xc3,0x2a,0x90,0x40,0x84,0x10,0x20,0x04,0x80,0xc2,0x26,0x20 },
+  16, 0xd640, 0, {0x49,0x88,0x22,0x22,0x0c,0x08,0xc1,0x26,0xa0,0xc9,0x8c,0x12,0x2a,0x04,0x88,0x43 },
+  16, 0xd650, 0, {0x0e,0xa0,0xcb,0x88,0x10,0x22,0x0c,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd660, 0, {0x08,0x00,0x0a,0x40,0x32,0x00,0x01,0x80,0x31,0x28,0x00,0x00,0x01,0x12,0x80,0x8d },
+  16, 0xd670, 0, {0x84,0x00,0x28,0x0c,0x08,0x01,0x32,0x00,0x8c,0x80,0x02,0x20,0x0c,0x08,0x01,0x2e },
+  16, 0xd680, 0, {0x00,0xc3,0x80,0x02,0x20,0x04,0x08,0x43,0x02,0x00,0x40,0x80,0x10,0x20,0x04,0x02 },
+  16, 0xd690, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x87,0x0a,0x21,0x04,0x88 },
+  16, 0xd6a0, 0, {0x11,0x2a,0x1c,0x0a,0x06,0x22,0x21,0x40,0xa0,0x42,0x2a,0x10,0x88,0x85,0x0a,0xa1 },
+  16, 0xd6b0, 0, {0x06,0xa4,0x62,0x22,0x1c,0x0a,0xc4,0x02,0x21,0x80,0x8c,0x52,0x22,0x14,0x48,0x86 },
+  16, 0xd6c0, 0, {0x22,0x20,0x08,0xa8,0x60,0x2a,0x14,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd6d0, 0, {0x00,0x00,0x08,0x45,0x06,0x01,0x89,0x80,0x63,0x20,0x1c,0x88,0x40,0x34,0x11,0x01 },
+  16, 0xd6e0, 0, {0xa4,0x50,0x28,0x18,0x48,0x04,0x0e,0x01,0x4b,0x80,0x73,0x28,0x1c,0x8a,0x04,0x06 },
+  16, 0xd6f0, 0, {0x91,0x49,0x04,0x63,0x20,0x1c,0x8a,0x06,0x26,0x01,0x85,0x80,0x70,0x20,0x18,0x02 },
+  16, 0xd700, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x85,0x00,0xb1,0x45,0x2c },
+  16, 0xd710, 0, {0x70,0x02,0x14,0xc0,0x07,0x08,0x21,0x49,0x00,0x42,0x01,0x14,0x82,0x05,0x00,0x11 },
+  16, 0xd720, 0, {0x84,0x00,0x52,0x02,0x1c,0x00,0xc4,0x00,0x21,0xc4,0x2c,0x53,0x02,0x1c,0x02,0x81 },
+  16, 0xd730, 0, {0x04,0xa1,0xcd,0x08,0x50,0x02,0x14,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd740, 0, {0x08,0x10,0x12,0x04,0x34,0x01,0xcc,0x00,0x73,0x40,0x1c,0x90,0x45,0x04,0x01,0x48 },
+  16, 0xd750, 0, {0x04,0x60,0x41,0x18,0xc0,0x44,0x04,0x01,0x05,0x04,0x73,0x48,0x14,0x50,0x47,0x34 },
+  16, 0xd760, 0, {0x01,0x45,0x20,0x62,0x08,0x1c,0xc2,0x04,0x0c,0x81,0xc7,0x00,0x73,0x80,0x18,0xc2 },
+  16, 0xd770, 0, {0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x10,0x84,0x10,0x21,0xcc,0x28 },
+  16, 0xd780, 0, {0x42,0x02,0x14,0x12,0xc5,0x10,0x21,0x84,0x04,0x40,0x00,0x1c,0x80,0x84,0x00,0x91 },
+  16, 0xd790, 0, {0x00,0x08,0x73,0x82,0x1c,0x90,0x05,0x0c,0x01,0xcf,0x0c,0x40,0x02,0x14,0x30,0x45 },
+  16, 0xd7a0, 0, {0x20,0xa1,0xc0,0x08,0x50,0x02,0x10,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd7b0, 0, {0x00,0x00,0x00,0x45,0x0c,0x81,0x00,0x00,0x01,0x08,0x08,0x00,0x05,0x18,0x91,0x05 },
+  16, 0xd7c0, 0, {0x04,0x00,0x01,0x04,0x40,0x06,0x18,0x00,0x02,0x24,0x70,0x40,0x04,0x00,0x40,0x00 },
+  16, 0xd7d0, 0, {0x01,0xc4,0x24,0x00,0x88,0x04,0x00,0x43,0x10,0x00,0x40,0x20,0x00,0x88,0x00,0x00 },
+  16, 0xd7e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x85,0x24,0x31,0x02,0x0c },
+  16, 0xd7f0, 0, {0x02,0xc2,0x04,0x10,0xc4,0x28,0x21,0x49,0x0c,0x02,0xc0,0x04,0xb2,0x06,0x1c,0x20 },
+  16, 0xd800, 0, {0x03,0x08,0x50,0x42,0x0c,0x80,0x01,0x04,0xa1,0x49,0x0c,0x00,0xc2,0x0c,0x10,0x43 },
+  16, 0xd810, 0, {0x24,0xa0,0xc1,0x08,0x10,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd820, 0, {0x00,0x10,0xa2,0x00,0x20,0x00,0xcd,0x00,0x00,0x40,0x04,0x20,0x01,0x10,0x00,0x09 },
+  16, 0xd830, 0, {0x04,0x02,0x49,0x0c,0x92,0x07,0x30,0x00,0x00,0x00,0x33,0x08,0x0c,0x92,0x41,0x00 },
+  16, 0xd840, 0, {0x80,0xcc,0x00,0x00,0x00,0x0c,0x00,0x43,0x28,0x80,0xc2,0x00,0x10,0x00,0x00,0x00 },
+  16, 0xd850, 0, {0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x10,0x50,0x80,0x00,0x00 },
+  16, 0xd860, 0, {0x10,0x00,0x00,0xf0,0x00,0x10,0x80,0x00,0x00,0x00,0x80,0x00,0xd0,0x80,0x80,0x00 },
+  16, 0xd870, 0, {0x00,0x00,0x00,0x80,0x10,0x90,0x80,0x80,0x00,0x00,0x00,0x00,0x80,0x10,0x90,0x80 },
+  16, 0xd880, 0, {0x00,0x00,0x00,0x00,0x00,0xc0,0x10,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd890, 0, {0x3c,0x3c,0x10,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x10,0x90,0xa0,0x80,0x00,0x00 },
+  16, 0xd8a0, 0, {0x00,0x00,0x40,0x10,0x90,0x80,0xa0,0x00,0x00,0x00,0x00,0xc0,0x10,0x90,0x80,0xa0 },
+  16, 0xd8b0, 0, {0x00,0x00,0x00,0x20,0x80,0x10,0x90,0xa0,0xa0,0x00,0x00,0x00,0x00,0x80,0x10,0x8f },
+  16, 0xd8c0, 0, {0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xc2,0xe4,0x81,0x80,0x3f },
+  16, 0xd8d0, 0, {0xd9,0xbf,0xd9,0x98,0x71,0x9d,0x42,0x80,0x00,0x26,0x7f,0xe6,0x72,0xab,0x7c,0x3a },
+  16, 0xd8e0, 0, {0x40,0x00,0x19,0x80,0x26,0x48,0xdd,0x3c,0x91,0xc0,0x26,0x40,0x26,0x40,0x38,0x31 },
+  16, 0xd8f0, 0, {0xdb,0x61,0xc0,0x19,0x99,0xbf,0xc9,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd900, 0, {0x00,0x00,0x10,0x80,0x10,0x14,0x80,0x06,0x84,0x97,0x96,0x86,0x96,0x06,0x90,0x00 },
+  16, 0xd910, 0, {0x3f,0xa1,0x28,0x01,0x02,0x90,0x12,0x00,0x80,0x17,0x88,0x16,0x9e,0x90,0x90,0x04 },
+  16, 0xd920, 0, {0x10,0x00,0x36,0xbe,0xbe,0x9e,0x86,0x16,0x12,0x84,0x80,0x13,0xbe,0x97,0xae,0x80 },
+  16, 0xd930, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x82 },
+  16, 0xd940, 0, {0x81,0x84,0x21,0x40,0x00,0x00,0x00,0x08,0xa1,0x38,0x01,0x78,0x00,0x00,0x00,0x00 },
+  16, 0xd950, 0, {0x08,0xb8,0x21,0x72,0x68,0x80,0x00,0x00,0x00,0x08,0x98,0x44,0x88,0x68,0x80,0x00 },
+  16, 0xd960, 0, {0x00,0x00,0x08,0xb8,0x01,0x78,0x01,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd970, 0, {0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xf7,0xaf,0xff,0xc0 },
+  16, 0xd980, 0, {0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff },
+  16, 0xd990, 0, {0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xbf,0xff,0xc0,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd9a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00 },
+  16, 0xd9b0, 0, {0x00,0x00,0x00,0x3f,0xff,0xff,0x7f,0x40,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff },
+  16, 0xd9c0, 0, {0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff },
+  16, 0xd9d0, 0, {0x2f,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xd9e0, 0, {0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0x7f,0xc0 },
+  16, 0xd9f0, 0, {0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff },
+  16, 0xda00, 0, {0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0x7f,0x80,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xda10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00 },
+  16, 0xda20, 0, {0x00,0x00,0x00,0x3f,0xff,0xbf,0xbf,0xc0,0x00,0x00,0x00,0x00,0x3f,0xdf,0xbf,0xdf },
+  16, 0xda30, 0, {0xc0,0x00,0x00,0x00,0x00,0x3f,0xef,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x3f,0xdf },
+  16, 0xda40, 0, {0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xda50, 0, {0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0x3e,0xaf,0xff,0xc0 },
+  16, 0xda60, 0, {0x00,0x00,0x00,0x00,0x1f,0xff,0xdf,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xe7,0xfe },
+  16, 0xda70, 0, {0xef,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xdf,0xc0,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xda80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00 },
+  16, 0xda90, 0, {0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x2f,0xf7,0xff,0xff },
+  16, 0xdaa0, 0, {0xc0,0x00,0x00,0x00,0x00,0x2f,0xff,0xff,0xdf,0xc0,0x00,0x00,0x00,0x00,0x3f,0xf7 },
+  16, 0xdab0, 0, {0xdf,0xf7,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdac0, 0, {0x00,0x00,0x02,0xc4,0x00,0xb1,0xc3,0x2c,0x50,0x09,0x14,0x82,0xc4,0x30,0x91,0xc7 },
+  16, 0xdad0, 0, {0x24,0x60,0x08,0x1c,0x82,0x07,0x34,0x91,0x4c,0x04,0x43,0x0a,0x10,0xc2,0x84,0x04 },
+  16, 0xdae0, 0, {0x91,0x84,0x24,0x52,0x0b,0x18,0x02,0xc4,0x24,0xb1,0xc3,0x2c,0x40,0x0a,0x10,0x80 },
+  16, 0xdaf0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0x02,0x01,0xc4,0x80 },
+  16, 0xdb00, 0, {0x60,0x20,0x1c,0x08,0x44,0x22,0x01,0xc0,0x84,0x50,0x01,0x9c,0x08,0x07,0x0a,0x01 },
+  16, 0xdb10, 0, {0xc0,0x84,0x72,0x20,0x1c,0xc8,0x04,0x12,0x11,0x44,0x80,0x41,0x01,0x1c,0x80,0x07 },
+  16, 0xdb20, 0, {0x08,0x11,0xc4,0x00,0x70,0x00,0x10,0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdb30, 0, {0x00,0x00,0x00,0x86,0x2c,0x21,0x4a,0x0c,0x52,0x02,0x1c,0x80,0x04,0x20,0x21,0xca },
+  16, 0xdb40, 0, {0x10,0x62,0x02,0x1c,0x81,0x47,0x04,0x21,0xc3,0x20,0x51,0x01,0x1c,0x80,0x04,0x2c },
+  16, 0xdb50, 0, {0x01,0xcb,0x04,0x52,0x03,0x14,0x40,0xc7,0x20,0x31,0xc8,0x0c,0x50,0x22,0x10,0x80 },
+  16, 0xdb60, 0, {0x01,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x20,0x01,0x89,0x00 },
+  16, 0xdb70, 0, {0x52,0x00,0x14,0x80,0x04,0x28,0x01,0x45,0x04,0x62,0x00,0x10,0x80,0x46,0x30,0x11 },
+  16, 0xdb80, 0, {0x0d,0x00,0x42,0x01,0x14,0xc0,0x44,0x00,0x11,0x05,0x00,0x50,0x00,0x1c,0x00,0x44 },
+  16, 0xdb90, 0, {0x28,0x01,0x49,0x00,0x70,0x00,0x10,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdba0, 0, {0x00,0x00,0x08,0xc0,0x02,0x30,0x0c,0x8c,0x30,0x22,0x08,0x88,0xc2,0x26,0x00,0x08 },
+  16, 0xdbb0, 0, {0x80,0x20,0x22,0x0c,0x88,0x81,0x02,0x10,0xc4,0x80,0x10,0x22,0x0c,0x08,0x40,0x02 },
+  16, 0xdbc0, 0, {0x10,0x48,0x88,0x01,0x23,0x04,0xc8,0x42,0x02,0x10,0x46,0x8c,0x12,0x22,0x00,0x00 },
+  16, 0xdbd0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x02,0x00,0x00,0x80,0xc8,0x20 },
+  16, 0xdbe0, 0, {0x11,0x09,0x00,0x80,0x41,0x10,0x90,0x08,0x24,0x30,0x08,0x04,0x42,0x41,0x00,0x90 },
+  16, 0xdbf0, 0, {0xc4,0x20,0x00,0x08,0x04,0x42,0x00,0x10,0x80,0x4c,0x20,0x23,0x09,0x04,0xc2,0x43 },
+  16, 0xdc00, 0, {0x30,0x80,0x40,0x20,0x11,0x08,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdc10, 0, {0x08,0x00,0x08,0x81,0x02,0x20,0xc9,0x8c,0x12,0x20,0x04,0x48,0x41,0x22,0x00,0x09 },
+  16, 0xdc20, 0, {0x88,0x30,0x20,0x0c,0x88,0x03,0x0e,0x00,0x49,0x8c,0x10,0x22,0x0c,0x88,0x40,0x2e },
+  16, 0xdc30, 0, {0x00,0xc9,0x84,0x13,0x21,0x04,0xc8,0xc3,0x22,0x00,0xcb,0x8c,0x32,0x22,0x00,0x00 },
+  16, 0xdc40, 0, {0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x01,0x02,0x00,0x4b,0x80 },
+  16, 0xdc50, 0, {0x32,0x21,0x08,0x88,0x41,0x02,0x10,0x0f,0x80,0x10,0x21,0x8c,0x08,0x41,0x02,0x00 },
+  16, 0xdc60, 0, {0x87,0x84,0x10,0x20,0x04,0x88,0x00,0x02,0x00,0x47,0x80,0x10,0x21,0x0c,0x88,0x41 },
+  16, 0xdc70, 0, {0x16,0x10,0x46,0x80,0x30,0x20,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdc80, 0, {0x00,0x00,0x0a,0xc4,0x22,0xa1,0x08,0xa4,0x72,0x2a,0x14,0x0a,0x85,0x02,0x81,0x84 },
+  16, 0xdc90, 0, {0xa0,0x42,0x28,0x1c,0x0a,0xc5,0x02,0x91,0x40,0xb8,0x73,0x29,0x10,0xca,0xc4,0x02 },
+  16, 0xdca0, 0, {0xa1,0x80,0xa4,0x42,0x2a,0x14,0xca,0x85,0x22,0x91,0x80,0xa8,0x70,0x2a,0x18,0x02 },
+  16, 0xdcb0, 0, {0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x04,0x1e,0x01,0xc8,0x80 },
+  16, 0xdcc0, 0, {0x43,0x20,0x18,0x08,0x45,0x3e,0x01,0x0c,0x80,0x61,0x20,0x9c,0x48,0x06,0x12,0x81 },
+  16, 0xdcd0, 0, {0xc0,0x80,0x73,0x00,0x10,0x88,0x06,0x02,0x01,0xc8,0x00,0x42,0x20,0x10,0xc8,0x07 },
+  16, 0xdce0, 0, {0x02,0x11,0xcd,0x80,0x51,0x20,0x14,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdcf0, 0, {0x08,0x00,0x00,0xc4,0x24,0x21,0xc8,0x0c,0x42,0x01,0x14,0x00,0x00,0x28,0x10,0x4c },
+  16, 0xdd00, 0, {0x08,0x52,0x02,0x14,0x80,0x45,0x24,0x29,0x40,0x04,0x72,0x00,0x10,0xc0,0x05,0x24 },
+  16, 0xdd10, 0, {0x11,0x44,0x08,0x43,0x01,0x14,0xc0,0x47,0x24,0x20,0x48,0x08,0x72,0x02,0x10,0x00 },
+  16, 0xdd20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x07,0x10,0x11,0x06,0x00 },
+  16, 0xdd30, 0, {0x72,0x00,0x18,0xd0,0x46,0x20,0x01,0x4d,0x00,0x71,0x40,0x10,0x50,0x07,0x30,0x11 },
+  16, 0xdd40, 0, {0xc3,0x00,0x71,0x41,0x10,0xb0,0x05,0x2c,0x01,0x49,0x00,0x43,0x00,0x1c,0x50,0x45 },
+  16, 0xdd50, 0, {0x30,0x01,0x8c,0x00,0x61,0x40,0x18,0x42,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdd60, 0, {0x00,0x00,0x30,0xc5,0x00,0x21,0xc0,0x0c,0x40,0x01,0x14,0x12,0x44,0x04,0x31,0x84 },
+  16, 0xdd70, 0, {0x24,0x40,0x80,0x14,0xa1,0xc7,0x00,0x01,0x40,0x08,0x40,0x01,0x14,0x20,0x05,0x20 },
+  16, 0xdd80, 0, {0x11,0xc0,0x02,0x60,0x82,0x18,0x00,0x87,0x24,0x11,0x40,0x08,0x40,0x42,0x10,0x02 },
+  16, 0xdd90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x0c,0x80,0xc4,0x24 },
+  16, 0xdda0, 0, {0x31,0x48,0x0c,0x00,0x01,0x08,0xc1,0x41,0x00,0x00,0x49,0x00,0x42,0x03,0x08,0x10 },
+  16, 0xddb0, 0, {0x80,0x20,0x21,0x09,0x0c,0x02,0x02,0x18,0x80,0xc1,0x24,0x30,0x08,0x0c,0x42,0x01 },
+  16, 0xddc0, 0, {0x10,0x80,0x83,0x20,0x11,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xddd0, 0, {0x00,0x00,0x10,0xc1,0x04,0x20,0x48,0x0c,0x12,0x42,0x04,0x00,0x83,0x00,0x31,0x48 },
+  16, 0xdde0, 0, {0x00,0x02,0x41,0x04,0xa0,0x07,0x0c,0x20,0x40,0x00,0x12,0xc2,0x0c,0x80,0xc1,0x20 },
+  16, 0xddf0, 0, {0x20,0xc8,0x00,0x12,0xc1,0x0c,0xb0,0x41,0x20,0x00,0x49,0x08,0x02,0x42,0x00,0x00 },
+  16, 0xde00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x80,0x01,0x00,0x10,0x81,0x00 },
+  16, 0xde10, 0, {0x30,0x40,0x08,0x20,0x03,0x00,0x10,0xc1,0x20,0x02,0x00,0x04,0x80,0x40,0x30,0x90 },
+  16, 0xde20, 0, {0x01,0x14,0x02,0x40,0x04,0x80,0x40,0x20,0x00,0x09,0x04,0x32,0x01,0x08,0xa0,0x03 },
+  16, 0xde30, 0, {0x04,0x10,0x08,0x00,0x22,0x40,0x00,0x00,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xde40, 0, {0x00,0x00,0x30,0x00,0x10,0x80,0x00,0x00,0x00,0x40,0x00,0xf0,0x00,0x00,0x00,0x00 },
+  16, 0xde50, 0, {0x00,0x10,0x80,0x00,0xf0,0x00,0x80,0x80,0x00,0x00,0x20,0x00,0x00,0xf0,0x10,0xa0 },
+  16, 0xde60, 0, {0x00,0x00,0x00,0x20,0x00,0x00,0xf0,0x00,0x10,0x00,0x00,0x00,0x20,0x80,0x00,0xcc },
+  16, 0xde70, 0, {0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x3c,0x10,0xa0,0x80,0x00,0x00,0x00 },
+  16, 0xde80, 0, {0x00,0x00,0x10,0x90,0x80,0xc0,0x40,0x00,0x00,0x00,0x00,0x10,0x90,0x80,0x80,0x00 },
+  16, 0xde90, 0, {0x00,0x00,0x00,0x00,0x10,0x90,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x10,0x90,0x80 },
+  16, 0xdea0, 0, {0xe0,0x00,0x00,0x00,0x00,0x00,0x10,0x8c,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdeb0, 0, {0x00,0x00,0x09,0x4d,0xb1,0xe9,0x00,0x26,0x40,0x2a,0x7f,0xe3,0xf2,0x54,0x98,0xc0 },
+  16, 0xdec0, 0, {0x3f,0xe6,0x40,0x00,0x01,0x42,0x91,0xd0,0xc0,0x13,0xe5,0x87,0x63,0x83,0xb8,0xcd },
+  16, 0xded0, 0, {0xf9,0x00,0x26,0x7f,0x00,0x00,0x35,0x2e,0xd5,0x03,0x40,0x3f,0xd9,0xbf,0xb1,0x80 },
+  16, 0xdee0, 0, {0x01,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x02,0x16,0x14,0x00,0x1c },
+  16, 0xdef0, 0, {0xa8,0x3f,0x88,0x16,0x00,0x80,0x84,0x80,0x37,0x9e,0xba,0xa0,0x50,0x10,0x02,0x12 },
+  16, 0xdf00, 0, {0x00,0x17,0x96,0x97,0x26,0x50,0x10,0x10,0x82,0x80,0x1e,0x80,0xde,0xbe,0x94,0x14 },
+  16, 0xdf10, 0, {0x02,0x10,0x80,0x17,0xbe,0x81,0x94,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdf20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xa8,0x44,0x94,0x28,0x80,0x00,0x00,0x00,0x08 },
+  16, 0xdf30, 0, {0x94,0x21,0x44,0x51,0x00,0x00,0x00,0x00,0x08,0x84,0x42,0x41,0x01,0x00,0x00,0x00 },
+  16, 0xdf40, 0, {0x00,0x08,0xa1,0x72,0x23,0x41,0x40,0x00,0x00,0x00,0x08,0xb8,0x01,0x78,0x32,0x40 },
+  16, 0xdf50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00 },
+  16, 0xdf60, 0, {0x00,0x00,0x00,0x3f,0xf7,0xfe,0xd7,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xd7,0xdf },
+  16, 0xdf70, 0, {0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0x7f,0xff,0xc0,0x00,0x00,0x00,0x00,0x37,0x7f },
+  16, 0xdf80, 0, {0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdf90, 0, {0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x1e,0xff,0xde,0x77,0xc0 },
+  16, 0xdfa0, 0, {0x00,0x00,0x00,0x00,0x1f,0xef,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff },
+  16, 0xdfb0, 0, {0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0x7f,0xc0,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xdfc0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00 },
+  16, 0xdfd0, 0, {0x00,0x00,0x00,0x1f,0xcf,0xdf,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xbf },
+  16, 0xdfe0, 0, {0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xbf,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff },
+  16, 0xdff0, 0, {0xff,0xbf,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe000, 0, {0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0 },
+  16, 0xe010, 0, {0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x1f,0xff,0x1f },
+  16, 0xe020, 0, {0x7f,0xc0,0x00,0x00,0x00,0x00,0x2f,0xdf,0xff,0xcf,0xc0,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe030, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00 },
+  16, 0xe040, 0, {0x00,0x00,0x00,0x3f,0xbf,0xaf,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff },
+  16, 0xe050, 0, {0xc0,0x00,0x00,0x00,0x00,0x3e,0xde,0x7f,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff },
+  16, 0xe060, 0, {0xff,0xf7,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe070, 0, {0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0x7f,0xff,0xff,0xc0 },
+  16, 0xe080, 0, {0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xfe,0xbe },
+  16, 0xe090, 0, {0x7f,0xc0,0x00,0x00,0x00,0x00,0x3e,0xff,0xd7,0x7f,0xc0,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe0a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe0b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe0c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe0d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe0e0, 0, {0x30,0x00,0x20,0x01,0x02,0x00,0x00,0x00,0x30,0x00,0x43,0x8e,0x00,0x00,0x00,0x00 },
+  16, 0xe0f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe100, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe110, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe120, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe130, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe140, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe150, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe160, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe170, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe180, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe190, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe1a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe1b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe1c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe1d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe1e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe1f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe200, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe210, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe220, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe230, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe240, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe250, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe260, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe270, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe280, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe290, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe2a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe2b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe2c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe2d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe2e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe2f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe300, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe310, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe320, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe330, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe340, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe350, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe360, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe370, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe380, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe390, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe3a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe3b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe3c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe3d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe3e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe3f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe400, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe410, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe420, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe430, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe440, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe450, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe460, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe470, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe480, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe490, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe4a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe4b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe4c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe4d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe4e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe4f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe500, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe510, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe520, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe530, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe540, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe550, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe560, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe570, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe580, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe590, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe5a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe5b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe5c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe5d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe5e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe5f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe600, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe610, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe620, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe630, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe640, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe650, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe660, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe670, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe680, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe690, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe6a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe6b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe6c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe6d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe6e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe6f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe700, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe710, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe720, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe730, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe740, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe750, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe760, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe770, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe780, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe790, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe7a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe7b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe7c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe7d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe7e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe7f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe800, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe810, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe820, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe830, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe840, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe850, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe860, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe870, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe880, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe890, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe8a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe8b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe8c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe8d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe8e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe8f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe900, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe910, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe920, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe930, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe940, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe950, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe960, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe970, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe980, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe990, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe9a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe9b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe9c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe9d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe9e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xe9f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xea00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xea10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xea20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xea30, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xea40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xea50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xea60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xea70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xea80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xea90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeaa0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeab0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeac0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xead0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeae0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeaf0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeb00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeb10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeb20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeb30, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeb40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeb50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeb60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeb70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeb80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeb90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeba0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xebb0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xebc0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xebd0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xebe0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xebf0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xec00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xec10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xec20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xec30, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xec40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xec50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xec60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xec70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xec80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xec90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeca0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xecb0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xecc0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xecd0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xece0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xecf0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xed00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xed10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xed20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xed30, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xed40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xed50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xed60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xed70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xed80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xed90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeda0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xedb0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xedc0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xedd0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xede0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xedf0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xee00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xee10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xee20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xee30, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xee40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xee50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xee60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xee70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xee80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xee90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeea0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeeb0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeec0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeed0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeee0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeef0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xef00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xef10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xef20, 0, {0x00,0x00,0x00,0x00,0x30,0x00,0x20,0x01,0x02,0x02,0x00,0x00,0x30,0x00,0x43,0x80 },
+  16, 0xef30, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xef40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xef50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xef60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xef70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xef80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xef90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xefa0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xefb0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xefc0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xefd0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xefe0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xeff0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf000, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf010, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf020, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf030, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf040, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf050, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf060, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf070, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf080, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf090, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf0a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf0b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf0c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf0d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf0e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf0f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf100, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf110, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf120, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf130, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf140, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf150, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf160, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf170, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf180, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf190, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf1a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf1b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf1c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf1d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf1e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf1f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf200, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf210, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf220, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf230, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf240, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf250, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf260, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf270, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf280, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf290, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf2a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf2b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf2c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf2d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf2e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf2f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf300, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf310, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf320, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf330, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf340, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf350, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf360, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf370, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf380, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf390, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf3a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf3b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf3c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf3d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf3e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf3f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf400, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf410, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf420, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf430, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf440, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf450, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf460, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf470, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf480, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf490, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf4a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf4b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf4c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf4d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf4e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf4f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf500, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf510, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf520, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf530, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf540, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf550, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf560, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf570, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf580, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf590, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf5a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf5b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf5c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf5d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf5e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf5f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf600, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf610, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf620, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf630, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf640, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf650, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf660, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf670, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf680, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf690, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf6a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf6b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf6c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf6d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf6e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf6f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf700, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf710, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf720, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf730, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf740, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf750, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf760, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf770, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf780, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf790, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf7a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf7b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf7c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf7d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf7e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf7f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf800, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf810, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf820, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf830, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf840, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf850, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf860, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf870, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf880, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf890, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf8a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf8b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf8c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf8d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf8e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf8f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf900, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf910, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf920, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf930, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf940, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf950, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf960, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf970, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf980, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf990, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf9a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf9b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf9c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf9d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf9e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xf9f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfa00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfa10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfa20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfa30, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfa40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfa50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfa60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfa70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfa80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfa90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfaa0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfab0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfac0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfad0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfae0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfaf0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfb00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfb10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfb20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfb30, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfb40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfb50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfb60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfb70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfb80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfb90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfba0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfbb0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfbc0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfbd0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfbe0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfbf0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfc00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfc10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfc20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfc30, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfc40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfc50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfc60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfc70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfc80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfc90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfca0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfcb0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfcc0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfcd0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfce0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfcf0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfd00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfd10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfd20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfd30, 0, {0x30,0x00,0x00,0x01,0x00,0x00,0x5f,0xa7,0x30,0x00,0x80,0x01,0x00,0x00,0x00,0x03 },
+  16, 0xfd40, 0, {0x30,0x00,0x40,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfd50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfd60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  16, 0xfd70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x80,0x01 },
+  16, 0xfd80, 0, {0x00,0x00,0x00,0x05,0x30,0x00,0xa0,0x01,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x01 },
+  16, 0xfd90, 0, {0x00,0x00,0x6b,0x97,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+  4, 0xfda0, 0, {0x00,0x00,0x00,0x00 },
+  0 , 0x0000, 1, {0}
+};
+// VERSION= 1.0.0.191
+// DATE= 2002oct28
+INTEL_HEX_RECORD g_HexMidiFw62[] = {
+   3,0x0000,0,{0x02,0x46,0xb9},
+   3,0x0003,0,{0x02,0x0f,0xfd},
+   3,0x000b,0,{0x02,0x4e,0x0f},
+   3,0x0013,0,{0x02,0x17,0xfd},
+   3,0x001b,0,{0x02,0x4e,0x12},
+   3,0x0023,0,{0x02,0x4d,0xef},
+   3,0x002b,0,{0x02,0x48,0x00},
+   3,0x0033,0,{0x02,0x4d,0xe6},
+   3,0x003b,0,{0x02,0x4d,0xf6},
+   3,0x0043,0,{0x02,0x49,0x00},
+   3,0x004b,0,{0x02,0x4e,0x03},
+   3,0x0053,0,{0x02,0x48,0xfa},
+   3,0x005b,0,{0x02,0x4d,0xfd},
+   3,0x0063,0,{0x02,0x4e,0x07},
+  16,0x0500,0,{0x12,0x01,0x10,0x01,0x00,0x00,0x00,0x40,0x6a,0x08,0x11,0x01,0x00,0x01,0x01,0x02},
+  16,0x0510,0,{0x00,0x01,0x09,0x02,0x08,0x02,0x05,0x01,0x00,0x80,0x32,0x09,0x04,0x00,0x00,0x00},
+  16,0x0520,0,{0x01,0x01,0x00,0x00,0x0a,0x24,0x01,0x00,0x01,0x56,0x00,0x02,0x01,0x02,0x0c,0x24},
+  16,0x0530,0,{0x02,0x01,0x01,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x0d,0x24,0x06,0x05,0x01,0x02},
+  16,0x0540,0,{0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x24,0x03,0x02,0x04,0x03,0x00,0x05,0x00},
+  16,0x0550,0,{0x0c,0x24,0x02,0x03,0x05,0x02,0x00,0x06,0x00,0x00,0x00,0x00,0x15,0x24,0x06,0x06},
+  16,0x0560,0,{0x03,0x02,0x00,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00},
+  16,0x0570,0,{0x00,0x09,0x24,0x03,0x04,0x01,0x01,0x00,0x06,0x00,0x09,0x04,0x01,0x00,0x00,0x01},
+  16,0x0580,0,{0x02,0x00,0x00,0x09,0x04,0x01,0x01,0x02,0x01,0x02,0x00,0x00,0x07,0x24,0x01,0x01},
+  16,0x0590,0,{0x00,0x01,0x00,0x11,0x24,0x02,0x01,0x02,0x02,0x10,0x03,0x44,0xac,0x00,0x80,0xbb},
+  16,0x05a0,0,{0x00,0x00,0x77,0x01,0x09,0x05,0x0a,0x05,0x84,0x01,0x01,0x00,0x8f,0x07,0x25,0x01},
+  16,0x05b0,0,{0x01,0x00,0x00,0x00,0x09,0x05,0x8f,0x01,0x03,0x00,0x01,0x05,0x00,0x09,0x04,0x01},
+  16,0x05c0,0,{0x02,0x02,0x01,0x02,0x00,0x00,0x07,0x24,0x01,0x01,0x00,0x01,0x00,0x11,0x24,0x02},
+  16,0x05d0,0,{0x01,0x02,0x03,0x18,0x03,0x44,0xac,0x00,0x80,0xbb,0x00,0x00,0x77,0x01,0x09,0x05},
+  16,0x05e0,0,{0x0a,0x05,0x46,0x02,0x01,0x00,0x8f,0x07,0x25,0x01,0x01,0x00,0x00,0x00,0x09,0x05},
+  16,0x05f0,0,{0x8f,0x01,0x03,0x00,0x01,0x05,0x00,0x09,0x04,0x02,0x00,0x00,0x01,0x02,0x00,0x00},
+  16,0x0600,0,{0x09,0x04,0x02,0x01,0x01,0x01,0x02,0x00,0x00,0x07,0x24,0x01,0x04,0x00,0x01,0x00},
+  16,0x0610,0,{0x0e,0x24,0x02,0x01,0x06,0x02,0x10,0x02,0x44,0xac,0x00,0x80,0xbb,0x00,0x09,0x05},
+  16,0x0620,0,{0x8c,0x05,0x4c,0x02,0x01,0x00,0x00,0x07,0x25,0x01,0x00,0x02,0x00,0x00,0x09,0x04},
+  16,0x0630,0,{0x02,0x02,0x01,0x01,0x02,0x00,0x00,0x07,0x24,0x01,0x04,0x00,0x01,0x00,0x0e,0x24},
+  16,0x0640,0,{0x02,0x01,0x06,0x03,0x18,0x02,0x44,0xac,0x00,0x80,0xbb,0x00,0x09,0x05,0x8c,0x05},
+  16,0x0650,0,{0x72,0x03,0x01,0x00,0x00,0x07,0x25,0x01,0x00,0x02,0x00,0x00,0x09,0x04,0x02,0x03},
+  16,0x0660,0,{0x01,0x01,0x02,0x00,0x00,0x07,0x24,0x01,0x04,0x00,0x01,0x00,0x11,0x24,0x02,0x01},
+  16,0x0670,0,{0x02,0x02,0x10,0x03,0x44,0xac,0x00,0x80,0xbb,0x00,0x00,0x77,0x01,0x09,0x05,0x8c},
+  16,0x0680,0,{0x05,0x84,0x01,0x01,0x00,0x00,0x07,0x25,0x01,0x00,0x02,0x00,0x00,0x09,0x04,0x02},
+  16,0x0690,0,{0x04,0x01,0x01,0x02,0x00,0x00,0x07,0x24,0x01,0x04,0x00,0x01,0x00,0x11,0x24,0x02},
+  16,0x06a0,0,{0x01,0x02,0x03,0x18,0x03,0x44,0xac,0x00,0x80,0xbb,0x00,0x00,0x77,0x01,0x09,0x05},
+  16,0x06b0,0,{0x8c,0x05,0x46,0x02,0x01,0x00,0x00,0x07,0x25,0x01,0x00,0x02,0x00,0x00,0x09,0x04},
+  16,0x06c0,0,{0x03,0x00,0x00,0x01,0x01,0x00,0x00,0x09,0x24,0x01,0x00,0x01,0x09,0x00,0x01,0x04},
+  16,0x06d0,0,{0x09,0x04,0x04,0x00,0x02,0x01,0x03,0x00,0x00,0x07,0x24,0x01,0x00,0x01,0x24,0x00},
+  16,0x06e0,0,{0x06,0x24,0x02,0x01,0x07,0x00,0x09,0x24,0x03,0x02,0x08,0x01,0x07,0x01,0x00,0x06},
+  16,0x06f0,0,{0x24,0x02,0x02,0x09,0x00,0x09,0x24,0x03,0x01,0x0a,0x01,0x09,0x01,0x00,0x09,0x05},
+  16,0x0700,0,{0x01,0x02,0x04,0x00,0x00,0x00,0x00,0x05,0x25,0x01,0x01,0x07,0x09,0x05,0x81,0x02},
+  16,0x0710,0,{0x04,0x00,0x00,0x00,0x00,0x05,0x25,0x01,0x01,0x0a,0x04,0x03,0x09,0x04,0x18,0x03},
+  16,0x0720,0,{0x45,0x00,0x6d,0x00,0x61,0x00,0x67,0x00,0x69,0x00,0x63,0x00,0x20,0x00,0x47,0x00},
+  16,0x0730,0,{0x6d,0x00,0x62,0x00,0x48,0x00,0x22,0x03,0x45,0x00,0x6d,0x00,0x61,0x00,0x67,0x00},
+  16,0x0740,0,{0x69,0x00,0x63,0x00,0x20,0x00,0x45,0x00,0x4d,0x00,0x49,0x00,0x20,0x00,0x36,0x00},
+  16,0x0750,0,{0x7c,0x00,0x32,0x00,0x20,0x00,0x6d,0x00,0x2a,0x03,0x43,0x00,0x6f,0x00,0x6e,0x00},
+  16,0x0760,0,{0x66,0x00,0x69,0x00,0x67,0x00,0x75,0x00,0x72,0x00,0x61,0x00,0x74,0x00,0x69,0x00},
+  16,0x0770,0,{0x6f,0x00,0x6e,0x00,0x20,0x00,0x53,0x00,0x74,0x00,0x72,0x00,0x69,0x00,0x6e,0x00},
+  16,0x0780,0,{0x67,0x00,0x22,0x03,0x49,0x00,0x6e,0x00,0x74,0x00,0x65,0x00,0x72,0x00,0x66,0x00},
+  16,0x0790,0,{0x61,0x00,0x63,0x00,0x65,0x00,0x20,0x00,0x53,0x00,0x74,0x00,0x72,0x00,0x69,0x00},
+   6,0x07a0,0,{0x6e,0x00,0x67,0x00,0x00,0x00},
+  16,0x07a6,0,{0xe4,0x90,0x76,0x66,0xf0,0x12,0x44,0xad,0x20,0x26,0x13,0x90,0x76,0x66,0xe0,0xc3},
+  16,0x07b6,0,{0x94,0x02,0x50,0x0a,0xe0,0x04,0xf0,0xd2,0x42,0x12,0x4b,0x7f,0x80,0xea,0x30,0x26},
+  16,0x07c6,0,{0x05,0x12,0x28,0x01,0xc2,0x26,0x30,0x25,0x2b,0x90,0x76,0x96,0xe0,0x54,0xfc,0xf0},
+  16,0x07d6,0,{0x90,0x80,0x03,0xf0,0x12,0x14,0x96,0x90,0x76,0x96,0xe0,0x44,0x03,0xf0,0x90,0x80},
+  16,0x07e6,0,{0x03,0xf0,0xe4,0x90,0x76,0x67,0xf0,0x90,0x76,0x67,0xe0,0x04,0xf0,0xe0,0xb4,0x4b},
+  10,0x07f6,0,{0xf6,0x12,0x47,0xfa,0x12,0x41,0x1b,0x80,0xc5,0x22},
+  16,0x0800,0,{0xe4,0x90,0x76,0x31,0xf0,0x90,0x76,0x31,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x0f},
+  16,0x0810,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xed,0xe0,0xfd,0xee,0x6d},
+  16,0x0820,0,{0x60,0x0e,0xef,0xc3,0x94,0x0b,0x50,0x08,0x90,0x76,0x31,0xe0,0x04,0xf0,0x80,0xd5},
+  16,0x0830,0,{0xef,0xb4,0x0b,0x08,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0xef,0x75,0xf0,0x03},
+  16,0x0840,0,{0xa4,0x24,0x0e,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x76,0x33,0xf0,0x24},
+  16,0x0850,0,{0xf0,0x60,0x0a,0x24,0x0e,0x60,0x02,0x81,0x87,0x12,0x4b,0xc7,0x22,0x90,0x7f,0xed},
+  16,0x0860,0,{0xe0,0x64,0x05,0x70,0x51,0x90,0x76,0x18,0x74,0x05,0xf0,0x90,0x76,0x37,0x74,0x01},
+  16,0x0870,0,{0xf0,0x90,0x76,0x39,0x74,0x03,0xf0,0x90,0x76,0x21,0xf0,0xe4,0x90,0x76,0x20,0xf0},
+  16,0x0880,0,{0x90,0x7f,0xea,0xe0,0xf4,0x60,0x2f,0x90,0x76,0x20,0xe0,0xff,0x75,0xf0,0x0a,0xa4},
+  16,0x0890,0,{0x24,0xaa,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xea,0xe0,0xfd},
+  16,0x08a0,0,{0xee,0x6d,0x60,0x12,0x90,0x76,0x21,0xe0,0xfe,0xef,0xc3,0x9e,0x50,0x08,0x90,0x76},
+  16,0x08b0,0,{0x20,0xe0,0x04,0xf0,0x80,0xd1,0x90,0x7f,0xed,0xe0,0x64,0x06,0x70,0x52,0x90,0x76},
+  16,0x08c0,0,{0x18,0x74,0x06,0xf0,0x90,0x76,0x37,0x74,0x04,0xf0,0x90,0x76,0x39,0x74,0x0a,0xf0},
+  16,0x08d0,0,{0x90,0x76,0x21,0xf0,0x90,0x76,0x20,0x74,0x03,0xf0,0x90,0x7f,0xea,0xe0,0xf4,0x60},
+  16,0x08e0,0,{0x2f,0x90,0x76,0x20,0xe0,0xff,0x75,0xf0,0x0a,0xa4,0x24,0xaa,0xf5,0x82,0xe4,0x34},
+  16,0x08f0,0,{0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xea,0xe0,0xfd,0xee,0x6d,0x60,0x12,0x90,0x76},
+  16,0x0900,0,{0x21,0xe0,0xfe,0xef,0xc3,0x9e,0x50,0x08,0x90,0x76,0x20,0xe0,0x04,0xf0,0x80,0xd1},
+  16,0x0910,0,{0x90,0x76,0x20,0xe0,0xff,0x75,0xf0,0x0a,0xa4,0x24,0xaa,0xf5,0x82,0xe4,0x34,0x75},
+  16,0x0920,0,{0xf5,0x83,0xe0,0x90,0x72,0x29,0xf0,0xe4,0x90,0x76,0x3b,0xf0,0x90,0x76,0x21,0xe0},
+  16,0x0930,0,{0xfe,0xef,0x6e,0x70,0x08,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xeb},
+  16,0x0940,0,{0xe0,0x14,0x60,0x13,0x14,0x70,0x02,0x21,0xe2,0x24,0x02,0x60,0x02,0x81,0x7f,0x90},
+  16,0x0950,0,{0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xe9,0xe0,0x14,0x70,0x7c,0x90,0x7f},
+  16,0x0960,0,{0xea,0xe0,0xf4,0x70,0x48,0x90,0x76,0x37,0xe0,0x90,0x76,0x20,0xf0,0x90,0x76,0x39},
+  16,0x0970,0,{0xe0,0xfe,0x90,0x76,0x20,0xe0,0xfd,0xc3,0x9e,0x50,0x2b,0x90,0x76,0x3b,0xe0,0xfe},
+  16,0x0980,0,{0x04,0xf0,0x74,0xc0,0x2e,0xf5,0x82,0xe4,0x34,0x7e,0xf5,0x83,0xe0,0xfe,0xed,0x75},
+  16,0x0990,0,{0xf0,0x0a,0xa4,0x24,0xab,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xee,0xf0,0x90,0x76},
+  16,0x09a0,0,{0x20,0xe0,0x04,0xf0,0x80,0xc7,0x90,0x76,0x3f,0x74,0x01,0xf0,0x22,0x90,0x7e,0xc0},
+  16,0x09b0,0,{0xe0,0xfe,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xab,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83},
+  16,0x09c0,0,{0xee,0xf0,0xe0,0xb4,0x01,0x08,0x90,0x76,0x3e,0x74,0x01,0xf0,0x80,0x05,0xe4,0x90},
+  16,0x09d0,0,{0x76,0x3e,0xf0,0x90,0x76,0x3f,0x74,0x01,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01},
+  16,0x09e0,0,{0xf0,0x22,0x90,0x7f,0xe9,0xe0,0x24,0xfe,0x70,0x02,0x41,0xa3,0x14,0x70,0x02,0x61},
+  16,0x09f0,0,{0x3f,0x14,0x70,0x02,0x61,0xdb,0x24,0x03,0x60,0x02,0x81,0x77,0x90,0x7f,0xea,0xe0},
+  16,0x0a00,0,{0xf4,0x70,0x6b,0x90,0x76,0x37,0xe0,0x90,0x76,0x20,0xf0,0x90,0x76,0x39,0xe0,0xff},
+  16,0x0a10,0,{0x90,0x76,0x20,0xe0,0xfe,0xc3,0x9f,0x50,0x4e,0x90,0x76,0x3b,0xe0,0xff,0x04,0xf0},
+  16,0x0a20,0,{0x74,0xc0,0x2f,0xf5,0x82,0xe4,0x34,0x7e,0xf5,0x83,0xe0,0xff,0xee,0x75,0xf0,0x0a},
+  16,0x0a30,0,{0xa4,0x24,0xac,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x90,0x76,0x3b,0xe0},
+  16,0x0a40,0,{0xff,0x04,0xf0,0x74,0xc0,0x2f,0xf5,0x82,0xe4,0x34,0x7e,0xf5,0x83,0xe0,0xff,0xee},
+  16,0x0a50,0,{0x75,0xf0,0x0a,0xa4,0x24,0xad,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x90},
+  16,0x0a60,0,{0x76,0x20,0xe0,0x04,0xf0,0x80,0xa4,0x90,0x76,0x40,0x74,0x01,0xf0,0x22,0x90,0x7e},
+  16,0x0a70,0,{0xc0,0xe0,0xff,0x90,0x76,0x20,0xe0,0xfe,0x75,0xf0,0x0a,0xa4,0x24,0xac,0xf5,0x82},
+  16,0x0a80,0,{0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x90,0x7e,0xc1,0xe0,0xff,0xee,0x75,0xf0,0x0a},
+  16,0x0a90,0,{0xa4,0x24,0xad,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x90,0x76,0x41,0x74},
+  16,0x0aa0,0,{0x01,0xf0,0x22,0x90,0x7f,0xea,0xe0,0xf4,0x70,0x66,0x90,0x76,0x37,0xe0,0x90,0x76},
+  16,0x0ab0,0,{0x20,0xf0,0x90,0x76,0x39,0xe0,0xff,0x90,0x76,0x20,0xe0,0xfe,0xc3,0x9f,0x40,0x02},
+  16,0x0ac0,0,{0x81,0x8e,0x90,0x76,0x3b,0xe0,0xff,0x04,0xf0,0x74,0xc0,0x2f,0xf5,0x82,0xe4,0x34},
+  16,0x0ad0,0,{0x7e,0xf5,0x83,0xe0,0xff,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xae,0xf5,0x82,0xe4,0x34},
+  16,0x0ae0,0,{0x75,0xf5,0x83,0xef,0xf0,0x90,0x76,0x3b,0xe0,0xff,0x04,0xf0,0x74,0xc0,0x2f,0xf5},
+  16,0x0af0,0,{0x82,0xe4,0x34,0x7e,0xf5,0x83,0xe0,0xff,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xaf,0xf5},
+  16,0x0b00,0,{0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x90,0x76,0x20,0xe0,0x04,0xf0,0x80,0xa2},
+  16,0x0b10,0,{0x90,0x7e,0xc0,0xe0,0xff,0x90,0x76,0x20,0xe0,0xfe,0x75,0xf0,0x0a,0xa4,0x24,0xae},
+  16,0x0b20,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x90,0x7e,0xc1,0xe0,0xff,0xee,0x75},
+  16,0x0b30,0,{0xf0,0x0a,0xa4,0x24,0xaf,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x22,0x90},
+  16,0x0b40,0,{0x7f,0xea,0xe0,0xf4,0x70,0x66,0x90,0x76,0x37,0xe0,0x90,0x76,0x20,0xf0,0x90,0x76},
+  16,0x0b50,0,{0x39,0xe0,0xff,0x90,0x76,0x20,0xe0,0xfe,0xc3,0x9f,0x40,0x02,0x81,0x8e,0x90,0x76},
+  16,0x0b60,0,{0x3b,0xe0,0xff,0x04,0xf0,0x74,0xc0,0x2f,0xf5,0x82,0xe4,0x34,0x7e,0xf5,0x83,0xe0},
+  16,0x0b70,0,{0xff,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xb0,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef},
+  16,0x0b80,0,{0xf0,0x90,0x76,0x3b,0xe0,0xff,0x04,0xf0,0x74,0xc0,0x2f,0xf5,0x82,0xe4,0x34,0x7e},
+  16,0x0b90,0,{0xf5,0x83,0xe0,0xff,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xb1,0xf5,0x82,0xe4,0x34,0x75},
+  16,0x0ba0,0,{0xf5,0x83,0xef,0xf0,0x90,0x76,0x20,0xe0,0x04,0xf0,0x80,0xa2,0x90,0x7e,0xc0,0xe0},
+  16,0x0bb0,0,{0xff,0x90,0x76,0x20,0xe0,0xfe,0x75,0xf0,0x0a,0xa4,0x24,0xb0,0xf5,0x82,0xe4,0x34},
+  16,0x0bc0,0,{0x75,0xf5,0x83,0xef,0xf0,0x90,0x7e,0xc1,0xe0,0xff,0xee,0x75,0xf0,0x0a,0xa4,0x24},
+  16,0x0bd0,0,{0xb1,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x22,0x90,0x7f,0xea,0xe0,0xf4},
+  16,0x0be0,0,{0x70,0x66,0x90,0x76,0x37,0xe0,0x90,0x76,0x20,0xf0,0x90,0x76,0x39,0xe0,0xff,0x90},
+  16,0x0bf0,0,{0x76,0x20,0xe0,0xfe,0xc3,0x9f,0x40,0x02,0x81,0x8e,0x90,0x76,0x3b,0xe0,0xff,0x04},
+  16,0x0c00,0,{0xf0,0x74,0xc0,0x2f,0xf5,0x82,0xe4,0x34,0x7e,0xf5,0x83,0xe0,0xff,0xee,0x75,0xf0},
+  16,0x0c10,0,{0x0a,0xa4,0x24,0xb2,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x90,0x76,0x3b},
+  16,0x0c20,0,{0xe0,0xff,0x04,0xf0,0x74,0xc0,0x2f,0xf5,0x82,0xe4,0x34,0x7e,0xf5,0x83,0xe0,0xff},
+  16,0x0c30,0,{0xee,0x75,0xf0,0x0a,0xa4,0x24,0xb3,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0},
+  16,0x0c40,0,{0x90,0x76,0x20,0xe0,0x04,0xf0,0x80,0xa2,0x90,0x7e,0xc0,0xe0,0xff,0x90,0x76,0x20},
+  16,0x0c50,0,{0xe0,0xfe,0x75,0xf0,0x0a,0xa4,0x24,0xb2,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef},
+  16,0x0c60,0,{0xf0,0x90,0x7e,0xc1,0xe0,0xff,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xb3,0xf5,0x82,0xe4},
+  16,0x0c70,0,{0x34,0x75,0xf5,0x83,0xef,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90},
+  15,0x0c80,0,{0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22},
+  16,0x0c8f,0,{0x41,0x76,0x68,0x01,0x41,0x76,0x6a,0x02,0x41,0x76,0x6b,0x0a,0xc1,0x20,0xc1,0x21},
+   2,0x0c9f,0,{0xc1,0x2f},
+   4,0x0ca1,0,{0x41,0x76,0x23,0x00},
+  16,0x0ca5,0,{0x41,0x72,0x01,0x01,0x45,0x72,0x05,0x00,0x02,0xc9,0x00,0x00,0x45,0x72,0x0a,0x00},
+  16,0x0cb5,0,{0x01,0x02,0x03,0x04,0x4d,0x72,0x0f,0xd1,0x00,0xd1,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x0cc5,0,{0x28,0x28,0x09,0x00,0x4d,0x72,0x1c,0x01,0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07},
+  16,0x0cd5,0,{0x08,0x09,0x0a,0x0b,0x41,0x72,0x2e,0x22,0x41,0x72,0x2f,0x23,0x41,0x72,0x30,0x20},
+  16,0x0ce5,0,{0x41,0x72,0x31,0x21,0x62,0xd2,0x72,0x3a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x0cf5,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x0d05,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x0d15,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x0d25,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x0d35,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x0d45,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x0d55,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x0d65,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x0d75,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01},
+  16,0x0d85,0,{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},
+  16,0x0d95,0,{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},
+  16,0x0da5,0,{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},
+  16,0x0db5,0,{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},
+  16,0x0dc5,0,{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},
+  16,0x0dd5,0,{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},
+  16,0x0de5,0,{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},
+  16,0x0df5,0,{0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03},
+  16,0x0e05,0,{0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03},
+  16,0x0e15,0,{0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03},
+  16,0x0e25,0,{0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03},
+  16,0x0e35,0,{0x03,0x03,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},
+  16,0x0e45,0,{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},
+  16,0x0e55,0,{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},
+  16,0x0e65,0,{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},
+  16,0x0e75,0,{0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05},
+  16,0x0e85,0,{0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05},
+  16,0x0e95,0,{0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05},
+  16,0x0ea5,0,{0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x06,0x06},
+  16,0x0eb5,0,{0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06},
+  16,0x0ec5,0,{0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06},
+  16,0x0ed5,0,{0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06},
+  16,0x0ee5,0,{0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x07,0x07,0x07,0x08,0x08},
+  16,0x0ef5,0,{0x08,0x09,0x09,0x09,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0c,0x0c,0x0c,0x0d,0x0d,0x0d},
+  16,0x0f05,0,{0x0e,0x0e,0x0e,0x0f,0x0f,0x0f,0x10,0x10,0x10,0x11,0x11,0x11,0x12,0x12,0x12,0x13},
+  16,0x0f15,0,{0x13,0x13,0x14,0x14,0x14,0x15,0x15,0x15,0x16,0x16,0x16,0x17,0x17,0x17,0x18,0x18},
+  16,0x0f25,0,{0x18,0x19,0x19,0x19,0x19,0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b,0x1c,0x1c,0x1c},
+  16,0x0f35,0,{0x1c,0x1d,0x1d,0x1d,0x1d,0x1e,0x1e,0x1e,0x1e,0x1f,0x1f,0x1f,0x1f,0x20,0x20,0x20},
+  16,0x0f45,0,{0x21,0x21,0x21,0x22,0x22,0x22,0x23,0x23,0x24,0x24,0x25,0x25,0x26,0x26,0x27,0x27},
+  16,0x0f55,0,{0x28,0x28,0x29,0x29,0x2a,0x2a,0x2b,0x2b,0x2c,0x2c,0x2d,0x2d,0x2e,0x2e,0x2f,0x2f},
+  16,0x0f65,0,{0x30,0x30,0x31,0x31,0x32,0x32,0x33,0x33,0x34,0x34,0x35,0x35,0x36,0x36,0x37,0x37},
+  16,0x0f75,0,{0x38,0x38,0x39,0x39,0x3a,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,0x40,0x41,0x42,0x43,0x44},
+  16,0x0f85,0,{0x45,0x46,0x47,0x48,0x49,0x49,0x4a,0x4b,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52},
+  16,0x0f95,0,{0x53,0x54,0x55,0x55,0x56,0x56,0x57,0x57,0x58,0x5a,0x5b,0x5d,0x5e,0x5f,0x61,0x62},
+  16,0x0fa5,0,{0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6f,0x71,0x72,0x73,0x74},
+  16,0x0fb5,0,{0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7e,0x80,0x01,0x37,0x01,0x01,0x38,0x00},
+   1,0x0fc5,0,{0x00},
+  16,0x0fc6,0,{0xe4,0xff,0x74,0x46,0x2f,0xf5,0x82,0xe4,0x34,0x76,0xf5,0x83,0xe0,0xfe,0x74,0x20},
+  16,0x0fd6,0,{0x2f,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xee,0xf0,0x74,0x4e,0x2f,0xf5,0x82,0xe4},
+  16,0x0fe6,0,{0x34,0x76,0xf5,0x83,0xe0,0xfe,0x74,0x30,0x2f,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83},
+   6,0x0ff6,0,{0xee,0xf0,0x0f,0xbf,0x08,0xcc},
+   1,0x0ffc,0,{0x22},
+   3,0x0ffd,0,{0xc2,0x89,0x32},
+  16,0x1000,0,{0xe4,0x90,0x76,0x2c,0xf0,0x90,0x76,0x2c,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x0f},
+  16,0x1010,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xed,0xe0,0xfd,0xee,0x6d},
+  16,0x1020,0,{0x60,0x0e,0xef,0xc3,0x94,0x0b,0x50,0x08,0x90,0x76,0x2c,0xe0,0x04,0xf0,0x80,0xd5},
+  16,0x1030,0,{0xef,0xb4,0x0b,0x08,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0xef,0x75,0xf0,0x03},
+  16,0x1040,0,{0xa4,0x24,0x0e,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x76,0x2e,0xf0,0x24},
+  16,0x1050,0,{0xf0,0x60,0x0a,0x24,0x0f,0x60,0x02,0x81,0x7d,0x12,0x4b,0xa4,0x22,0x90,0x7f,0xed},
+  16,0x1060,0,{0xe0,0x64,0x05,0x70,0x51,0x90,0x76,0x18,0x74,0x05,0xf0,0x90,0x76,0x38,0x74,0x01},
+  16,0x1070,0,{0xf0,0x90,0x76,0x3a,0x74,0x03,0xf0,0x90,0x76,0x1c,0xf0,0xe4,0x90,0x76,0x1b,0xf0},
+  16,0x1080,0,{0x90,0x7f,0xea,0xe0,0xf4,0x60,0x2f,0x90,0x76,0x1b,0xe0,0xff,0x75,0xf0,0x0a,0xa4},
+  16,0x1090,0,{0x24,0xaa,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xea,0xe0,0xfd},
+  16,0x10a0,0,{0xee,0x6d,0x60,0x12,0x90,0x76,0x1c,0xe0,0xfe,0xef,0xc3,0x9e,0x50,0x08,0x90,0x76},
+  16,0x10b0,0,{0x1b,0xe0,0x04,0xf0,0x80,0xd1,0x90,0x7f,0xed,0xe0,0x64,0x06,0x70,0x52,0x90,0x76},
+  16,0x10c0,0,{0x18,0x74,0x06,0xf0,0x90,0x76,0x38,0x74,0x04,0xf0,0x90,0x76,0x3a,0x74,0x0a,0xf0},
+  16,0x10d0,0,{0x90,0x76,0x1c,0xf0,0x90,0x76,0x1b,0x74,0x03,0xf0,0x90,0x7f,0xea,0xe0,0xf4,0x60},
+  16,0x10e0,0,{0x2f,0x90,0x76,0x1b,0xe0,0xff,0x75,0xf0,0x0a,0xa4,0x24,0xaa,0xf5,0x82,0xe4,0x34},
+  16,0x10f0,0,{0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xea,0xe0,0xfd,0xee,0x6d,0x60,0x12,0x90,0x76},
+  16,0x1100,0,{0x1c,0xe0,0xfe,0xef,0xc3,0x9e,0x50,0x08,0x90,0x76,0x1b,0xe0,0x04,0xf0,0x80,0xd1},
+  16,0x1110,0,{0xe4,0x90,0x76,0x1e,0xf0,0x90,0x76,0x1c,0xe0,0xff,0x90,0x76,0x1b,0xe0,0xfe,0x6f},
+  16,0x1120,0,{0x70,0x08,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xeb,0xe0,0x14,0x60},
+  16,0x1130,0,{0x13,0x14,0x70,0x02,0x21,0xbf,0x24,0x02,0x60,0x02,0x81,0x75,0x90,0x7f,0xb4,0xe0},
+  16,0x1140,0,{0x44,0x01,0xf0,0x22,0x90,0x7f,0xe9,0xe0,0x24,0x7f,0x70,0x6b,0x90,0x7f,0xea,0xe0},
+  16,0x1150,0,{0xf4,0x70,0x4a,0x90,0x76,0x38,0xe0,0x90,0x76,0x1b,0xf0,0x90,0x76,0x3a,0xe0,0xff},
+  16,0x1160,0,{0x90,0x76,0x1b,0xe0,0xfd,0xc3,0x9f,0x50,0x2b,0xed,0x75,0xf0,0x0a,0xa4,0x24,0xab},
+  16,0x1170,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xff,0x90,0x76,0x1e,0xe0,0xfd,0x04,0xf0},
+  16,0x1180,0,{0x74,0x00,0x2d,0xf5,0x82,0xe4,0x34,0x7f,0xf5,0x83,0xef,0xf0,0x90,0x76,0x1b,0xe0},
+  16,0x1190,0,{0x04,0xf0,0x80,0xc7,0x90,0x76,0x1e,0xe0,0x90,0x7f,0xb5,0xf0,0x22,0xee,0x75,0xf0},
+  16,0x11a0,0,{0x0a,0xa4,0x24,0xab,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x7f,0x00,0xf0},
+  16,0x11b0,0,{0x90,0x7f,0xb5,0x74,0x01,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90},
+  16,0x11c0,0,{0x7f,0xe9,0xe0,0x24,0x7e,0x70,0x02,0x41,0x7e,0x14,0x70,0x02,0x61,0x23,0x14,0x70},
+  16,0x11d0,0,{0x02,0x61,0xc8,0x24,0x03,0x60,0x02,0x81,0x6d,0x90,0x7f,0xea,0xe0,0xf4,0x70,0x6d},
+  16,0x11e0,0,{0x90,0x76,0x38,0xe0,0x90,0x76,0x1b,0xf0,0x90,0x76,0x3a,0xe0,0xff,0x90,0x76,0x1b},
+  16,0x11f0,0,{0xe0,0xc3,0x9f,0x50,0x4f,0xe0,0xff,0x75,0xf0,0x0a,0xa4,0x24,0xac,0xf5,0x82,0xe4},
+  16,0x1200,0,{0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x76,0x1e,0xe0,0xfd,0x04,0xf0,0x74,0x00,0x2d},
+  16,0x1210,0,{0xf5,0x82,0xe4,0x34,0x7f,0xf5,0x83,0xee,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xad},
+  16,0x1220,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xff,0x90,0x76,0x1e,0xe0,0xfe,0x04,0xf0},
+  16,0x1230,0,{0x74,0x00,0x2e,0xf5,0x82,0xe4,0x34,0x7f,0xf5,0x83,0xef,0xf0,0x90,0x76,0x1b,0xe0},
+  16,0x1240,0,{0x04,0xf0,0x80,0xa4,0x90,0x76,0x1e,0xe0,0x90,0x7f,0xb5,0xf0,0x22,0x90,0x76,0x1b},
+  16,0x1250,0,{0xe0,0xff,0x75,0xf0,0x0a,0xa4,0x24,0xac,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0},
+  16,0x1260,0,{0x90,0x7f,0x00,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xad,0xf5,0x82,0xe4,0x34,0x75},
+  16,0x1270,0,{0xf5,0x83,0xe0,0x90,0x7f,0x01,0xf0,0x90,0x7f,0xb5,0x74,0x02,0xf0,0x22,0x90,0x7f},
+  16,0x1280,0,{0xea,0xe0,0xf4,0x70,0x6d,0x90,0x76,0x38,0xe0,0x90,0x76,0x1b,0xf0,0x90,0x76,0x3a},
+  16,0x1290,0,{0xe0,0xff,0x90,0x76,0x1b,0xe0,0xc3,0x9f,0x50,0x4f,0xe0,0xff,0x75,0xf0,0x0a,0xa4},
+  16,0x12a0,0,{0x24,0xae,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x76,0x1e,0xe0,0xfd},
+  16,0x12b0,0,{0x04,0xf0,0x74,0x00,0x2d,0xf5,0x82,0xe4,0x34,0x7f,0xf5,0x83,0xee,0xf0,0xef,0x75},
+  16,0x12c0,0,{0xf0,0x0a,0xa4,0x24,0xaf,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xff,0x90,0x76},
+  16,0x12d0,0,{0x1e,0xe0,0xfe,0x04,0xf0,0x74,0x00,0x2e,0xf5,0x82,0xe4,0x34,0x7f,0xf5,0x83,0xef},
+  16,0x12e0,0,{0xf0,0x90,0x76,0x1b,0xe0,0x04,0xf0,0x80,0xa4,0x90,0x76,0x1e,0xe0,0x90,0x7f,0xb5},
+  16,0x12f0,0,{0xf0,0x22,0x90,0x76,0x1b,0xe0,0xff,0x75,0xf0,0x0a,0xa4,0x24,0xae,0xf5,0x82,0xe4},
+  16,0x1300,0,{0x34,0x75,0xf5,0x83,0xe0,0x90,0x7f,0x00,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xaf},
+  16,0x1310,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x7f,0x01,0xf0,0x90,0x7f,0xb5,0x74},
+  16,0x1320,0,{0x02,0xf0,0x22,0x90,0x7f,0xea,0xe0,0xf4,0x70,0x6d,0x90,0x76,0x38,0xe0,0x90,0x76},
+  16,0x1330,0,{0x1b,0xf0,0x90,0x76,0x3a,0xe0,0xff,0x90,0x76,0x1b,0xe0,0xc3,0x9f,0x50,0x4f,0xe0},
+  16,0x1340,0,{0xff,0x75,0xf0,0x0a,0xa4,0x24,0xb0,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe},
+  16,0x1350,0,{0x90,0x76,0x1e,0xe0,0xfd,0x04,0xf0,0x74,0x00,0x2d,0xf5,0x82,0xe4,0x34,0x7f,0xf5},
+  16,0x1360,0,{0x83,0xee,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xb1,0xf5,0x82,0xe4,0x34,0x75,0xf5},
+  16,0x1370,0,{0x83,0xe0,0xff,0x90,0x76,0x1e,0xe0,0xfe,0x04,0xf0,0x74,0x00,0x2e,0xf5,0x82,0xe4},
+  16,0x1380,0,{0x34,0x7f,0xf5,0x83,0xef,0xf0,0x90,0x76,0x1b,0xe0,0x04,0xf0,0x80,0xa4,0x90,0x76},
+  16,0x1390,0,{0x1e,0xe0,0x90,0x7f,0xb5,0xf0,0x22,0x90,0x76,0x1b,0xe0,0xff,0x75,0xf0,0x0a,0xa4},
+  16,0x13a0,0,{0x24,0xb0,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x7f,0x00,0xf0,0xef,0x75},
+  16,0x13b0,0,{0xf0,0x0a,0xa4,0x24,0xb1,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x7f,0x01},
+  16,0x13c0,0,{0xf0,0x90,0x7f,0xb5,0x74,0x02,0xf0,0x22,0x90,0x7f,0xea,0xe0,0xf4,0x70,0x6d,0x90},
+  16,0x13d0,0,{0x76,0x38,0xe0,0x90,0x76,0x1b,0xf0,0x90,0x76,0x3a,0xe0,0xff,0x90,0x76,0x1b,0xe0},
+  16,0x13e0,0,{0xc3,0x9f,0x50,0x4f,0xe0,0xff,0x75,0xf0,0x0a,0xa4,0x24,0xb2,0xf5,0x82,0xe4,0x34},
+  16,0x13f0,0,{0x75,0xf5,0x83,0xe0,0xfe,0x90,0x76,0x1e,0xe0,0xfd,0x04,0xf0,0x74,0x00,0x2d,0xf5},
+  16,0x1400,0,{0x82,0xe4,0x34,0x7f,0xf5,0x83,0xee,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xb3,0xf5},
+  16,0x1410,0,{0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xff,0x90,0x76,0x1e,0xe0,0xfe,0x04,0xf0,0x74},
+  16,0x1420,0,{0x00,0x2e,0xf5,0x82,0xe4,0x34,0x7f,0xf5,0x83,0xef,0xf0,0x90,0x76,0x1b,0xe0,0x04},
+  16,0x1430,0,{0xf0,0x80,0xa4,0x90,0x76,0x1e,0xe0,0x90,0x7f,0xb5,0xf0,0x22,0x90,0x76,0x1b,0xe0},
+  16,0x1440,0,{0xff,0x75,0xf0,0x0a,0xa4,0x24,0xb2,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90},
+  16,0x1450,0,{0x7f,0x00,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xb3,0xf5,0x82,0xe4,0x34,0x75,0xf5},
+  16,0x1460,0,{0x83,0xe0,0x90,0x7f,0x01,0xf0,0x90,0x7f,0xb5,0x74,0x02,0xf0,0x22,0x90,0x7f,0xb4},
+  16,0x1470,0,{0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xb4},
+   5,0x1480,0,{0xe0,0x44,0x01,0xf0,0x22},
+  16,0x1485,0,{0x74,0x00,0xf5,0x86,0x90,0xfd,0xa5,0x7c,0x05,0xa3,0xe5,0x82,0x45,0x83,0x70,0xf9},
+   1,0x1495,0,{0x22},
+  16,0x1496,0,{0x90,0x7f,0xd6,0xe0,0x44,0x80,0xf0,0x43,0x87,0x01,0x00,0x00,0x00,0x00,0x00,0x22},
+  16,0x14a6,0,{0xc0,0xd0,0xc0,0xe0,0x8f,0xe0,0xc0,0xe0,0x8e,0xe0,0xc0,0xe0,0x8d,0xe0,0xc0,0xe0},
+  16,0x14b6,0,{0x8c,0xe0,0xc0,0xe0,0xc0,0x82,0xc0,0x83,0x05,0x86,0xc0,0x84,0xc0,0x85,0x7d,0x00},
+  16,0x14c6,0,{0x90,0x7f,0xe3,0x74,0x7b,0xf0,0xa3,0x74,0x80,0xf0,0x7c,0x11,0x90,0x7f,0x99,0xe0},
+  16,0x14d6,0,{0x54,0x40,0xdc,0x03,0x02,0x14,0xf3,0xb4,0x00,0x13,0x90,0x7f,0xe2,0x74,0x40,0xf0},
+  16,0x14e6,0,{0x90,0x7f,0xe5,0xf0,0x90,0x7f,0xe2,0x74,0x00,0xf0,0x02,0x14,0xd2,0x90,0x76,0x90},
+  16,0x14f6,0,{0xe0,0xb4,0x01,0x12,0x90,0x76,0x8f,0xe0,0x2d,0xfd,0x90,0x7f,0xe2,0x74,0x80,0xf0},
+  16,0x1506,0,{0x90,0x7f,0x6c,0x02,0x15,0x57,0xb4,0x02,0x12,0x90,0x76,0x8f,0xe0,0x2d,0xfd,0x90},
+  16,0x1516,0,{0x7f,0xe2,0x74,0x80,0xf0,0x90,0x7f,0x6c,0x02,0x15,0x96,0xb4,0x03,0x12,0x90,0x76},
+  16,0x1526,0,{0x8f,0xe0,0x2d,0xfd,0x90,0x7f,0xe2,0x74,0x80,0xf0,0x90,0x7f,0x6c,0x02,0x15,0xe1},
+  16,0x1536,0,{0xb4,0x04,0x12,0x90,0x76,0x8f,0xe0,0x2d,0xfd,0x90,0x7f,0xe2,0x74,0x80,0xf0,0x90},
+  16,0x1546,0,{0x7f,0x6c,0x02,0x16,0x10,0x90,0x7f,0xe2,0x74,0x80,0xf0,0x90,0x7f,0x6c,0x02,0x16},
+  16,0x1556,0,{0x40,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xdd,0xf2,0x7d},
+  16,0x1566,0,{0x02,0x05,0x86,0x90,0x7f,0xe2,0x74,0x00,0xf0,0x90,0x7f,0x9b,0xe0,0x54,0x04,0xb4},
+  16,0x1576,0,{0x00,0x05,0x05,0x86,0x02,0x16,0x40,0x90,0x7f,0xe2,0x74,0x80,0xf0,0x05,0x86,0xf0},
+  16,0x1586,0,{0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xdd,0xd4,0x02,0x16,0x40},
+  16,0x1596,0,{0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0},
+  16,0x15a6,0,{0xf0,0xf0,0xdd,0xec,0x7d,0x02,0x05,0x86,0x90,0x7f,0xe2,0x74,0x00,0xf0,0x90,0x7f},
+  16,0x15b6,0,{0x9b,0xe0,0x54,0x04,0xb4,0x00,0x05,0x05,0x86,0x02,0x16,0x40,0x90,0x7f,0xe2,0x74},
+  16,0x15c6,0,{0x80,0xf0,0x05,0x86,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0},
+   6,0x15d6,0,{0xf0,0xf0,0xf0,0xf0,0xf0,0xf0},
+  16,0x15dc,0,{0xdd,0xce,0x02,0x16,0x40,0xf0,0xf0,0xf0,0xf0,0xdd,0xfa,0x7d,0x02,0x05,0x86,0x90},
+  16,0x15ec,0,{0x7f,0xe2,0x74,0x00,0xf0,0x90,0x7f,0x9b,0xe0,0x54,0x04,0xb4,0x00,0x05,0x05,0x86},
+  16,0x15fc,0,{0x02,0x16,0x40,0x90,0x7f,0xe2,0x74,0x80,0xf0,0x05,0x86,0xf0,0xf0,0xf0,0xf0,0xdd},
+  16,0x160c,0,{0xdc,0x02,0x16,0x40,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xdd,0xf8,0x7d,0x02,0x05,0x86},
+  16,0x161c,0,{0x90,0x7f,0xe2,0x74,0x00,0xf0,0x90,0x7f,0x9b,0xe0,0x54,0x04,0xb4,0x00,0x05,0x05},
+  16,0x162c,0,{0x86,0x02,0x16,0x40,0x90,0x7f,0xe2,0x74,0x80,0xf0,0x05,0x86,0xf0,0xf0,0xf0,0xf0},
+  16,0x163c,0,{0xf0,0xf0,0xdd,0xda,0x90,0x7f,0xe2,0x74,0x00,0xf0,0xd0,0x85,0xd0,0x84,0x05,0x86},
+  16,0x164c,0,{0xd0,0x83,0xd0,0x82,0xd0,0xe0,0xfc,0xd0,0xe0,0xfd,0xd0,0xe0,0xfe,0xd0,0xe0,0xff},
+   5,0x165c,0,{0xd0,0xe0,0xd0,0xd0,0x22},
+  16,0x1661,0,{0xc0,0xd0,0xc0,0xe0,0xc0,0x82,0xc0,0x83,0x90,0x76,0x7c,0xe0,0x90,0x7f,0x6f,0xf0},
+  16,0x1671,0,{0x90,0x76,0x7d,0xe0,0x90,0x7f,0x6f,0xf0,0x90,0x76,0x7e,0xe0,0x90,0x7f,0x6f,0xf0},
+   9,0x1681,0,{0xd0,0x83,0xd0,0x82,0xd0,0xe0,0xd0,0xd0,0x22},
+  16,0x168a,0,{0xc0,0xd0,0xc0,0xe0,0x8f,0xe0,0xc0,0xe0,0x8e,0xe0,0xc0,0xe0,0xc0,0x82,0xc0,0x83},
+  16,0x169a,0,{0x05,0x86,0xc0,0x84,0xc0,0x85,0x90,0x76,0x87,0xe0,0xff,0xbf,0x00,0x03,0x02,0x17},
+  16,0x16aa,0,{0x01,0x90,0x7f,0x96,0xe0,0x44,0x80,0xf0,0x90,0x7f,0xe2,0x74,0x80,0xf0,0x90,0x7f},
+  16,0x16ba,0,{0x62,0xe0,0x05,0x86,0x90,0x7f,0xe2,0x74,0x00,0xf0,0x90,0x7f,0x96,0xe0,0x54,0x7f},
+  16,0x16ca,0,{0xf0,0x90,0x7f,0xe2,0x74,0x80,0xf0,0x90,0x76,0x8e,0xe0,0xb4,0x01,0x05,0x05,0x86},
+  16,0x16da,0,{0x02,0x16,0xf6,0xb4,0x02,0x05,0x05,0x86,0x02,0x16,0xeb,0x05,0x86,0x02,0x16,0xfb},
+  16,0x16ea,0,{0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xdf,0xf8,0x02,0x16,0xfb,0xe0,0xe0,0xe0,0xe0,0xdf},
+  16,0x16fa,0,{0xfa,0x90,0x7f,0xe2,0x74,0x00,0xf0,0xd0,0x85,0xd0,0x84,0x05,0x86,0xd0,0x83,0xd0},
+  12,0x170a,0,{0x82,0xd0,0xe0,0xfe,0xd0,0xe0,0xff,0xd0,0xe0,0xd0,0xd0,0x22},
+  16,0x1716,0,{0xc0,0x82,0xc0,0x83,0xc0,0xe0,0xe8,0xc0,0xe0,0x78,0xd1,0xe8,0x14,0xf8,0x70,0xfb},
+  10,0x1726,0,{0xd0,0xe0,0xf8,0xd0,0xe0,0xd0,0x83,0xd0,0x82,0x22},
+  16,0x1730,0,{0xc0,0x82,0xc0,0x83,0xc0,0xe0,0xe8,0xc0,0xe0,0x78,0x78,0xe8,0x14,0xf8,0x70,0xfb},
+  10,0x1740,0,{0xd0,0xe0,0xf8,0xd0,0xe0,0xd0,0x83,0xd0,0x82,0x22},
+   7,0x174a,0,{0x90,0x7f,0xc5,0x74,0x02,0xf0,0x22},
+  16,0x1751,0,{0x90,0x7e,0xc0,0xe0,0x90,0x76,0x45,0xf0,0x90,0x7e,0xc1,0xe0,0x90,0x76,0x44,0xf0},
+  16,0x1761,0,{0x90,0x7e,0xc2,0xe0,0x90,0x76,0x43,0xf0,0xb4,0x00,0x03,0x02,0x17,0x78,0x90,0x76},
+  16,0x1771,0,{0x19,0x74,0x03,0xf0,0x02,0x17,0x8e,0x90,0x76,0x44,0xe0,0xb4,0xbb,0x09,0x90,0x76},
+  16,0x1781,0,{0x19,0x74,0x02,0xf0,0x02,0x17,0x8e,0x90,0x76,0x19,0x74,0x01,0xf0,0x90,0x76,0x42},
+   3,0x1791,0,{0xe4,0xf0,0x22},
+   4,0x1794,0,{0x8d,0x29,0x8b,0x2a},
+  16,0x1798,0,{0x12,0x4a,0x55,0xea,0x49,0x60,0x57,0x12,0x36,0x92,0x7e,0x00,0x29,0xff,0xee,0x3a},
+  16,0x17a8,0,{0xc9,0xef,0xc9,0x75,0x2b,0xff,0xf5,0x2c,0x89,0x2d,0xab,0x2b,0xaa,0x2c,0xa9,0x2d},
+  16,0x17b8,0,{0x90,0x00,0x01,0x12,0x36,0xab,0xff,0x64,0x04,0x60,0x05,0xef,0x64,0x05,0x70,0x2e},
+  16,0x17c8,0,{0xef,0xb4,0x04,0x15,0x90,0x00,0x02,0x12,0x36,0xab,0x65,0x29,0x70,0x0b,0x90,0x00},
+  16,0x17d8,0,{0x03,0x12,0x36,0xab,0x65,0x2a,0x70,0x01,0x22,0x12,0x36,0x92,0x7e,0x00,0x29,0xff},
+  16,0x17e8,0,{0xee,0x3a,0xc9,0xef,0xc9,0x75,0x2b,0xff,0xf5,0x2c,0x89,0x2d,0x80,0xbc,0x7b,0x00},
+   4,0x17f8,0,{0x7a,0x00,0x79,0x00},
+   1,0x17fc,0,{0x22},
+   3,0x17fd,0,{0xc2,0x8b,0x32},
+  16,0x1800,0,{0x90,0x76,0x90,0xe0,0x14,0x60,0x37,0x14,0x70,0x02,0x01,0xd8,0x14,0x70,0x02,0x21},
+  16,0x1810,0,{0x72,0x14,0x70,0x02,0x41,0x3b,0x24,0x04,0x60,0x02,0x61,0x03,0x90,0x7f,0xfc,0x74},
+  16,0x1820,0,{0xcc,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x95,0xe0,0x44,0x01,0xf0,0x54},
+  16,0x1830,0,{0x05,0xf0,0x90,0x80,0x01,0xf0,0xe4,0x90,0x76,0x1a,0xf0,0xc2,0x2e,0x22,0x90,0x76},
+  16,0x1840,0,{0x95,0xe0,0x44,0x01,0xf0,0x44,0x02,0xf0,0x30,0x3e,0x06,0xe0,0x44,0x04,0xf0,0x80},
+  16,0x1850,0,{0x07,0x90,0x76,0x95,0xe0,0x54,0xfb,0xf0,0x90,0x76,0x1a,0xe0,0xb4,0x01,0x08,0x90},
+  16,0x1860,0,{0x76,0x95,0xe0,0x90,0x80,0x01,0xf0,0x90,0x76,0x19,0xe0,0xff,0xb4,0x01,0x22,0x90},
+  16,0x1870,0,{0x7f,0xfc,0x74,0x74,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x8f,0x74,0x2b},
+  16,0x1880,0,{0xf0,0x90,0x76,0x97,0xe0,0x54,0xfd,0xf0,0xe4,0x90,0x76,0x81,0xf0,0x90,0x76,0x80},
+  16,0x1890,0,{0xf0,0xef,0xb4,0x02,0x22,0x90,0x7f,0xfc,0x74,0x68,0xf0,0x90,0x7f,0xff,0x74,0xfc},
+  16,0x18a0,0,{0xf0,0x90,0x76,0x8f,0x74,0x2f,0xf0,0x90,0x76,0x97,0xe0,0x44,0x02,0xf0,0xe4,0x90},
+  16,0x18b0,0,{0x76,0x81,0xf0,0x90,0x76,0x80,0xf0,0x30,0x3f,0x09,0x90,0x76,0x97,0xe0,0x54,0xfe},
+  16,0x18c0,0,{0xf0,0x80,0x07,0x90,0x76,0x97,0xe0,0x44,0x01,0xf0,0x90,0x76,0x97,0xe0,0x54,0xfb},
+  16,0x18d0,0,{0xf0,0x90,0x80,0x02,0xf0,0xd2,0x2e,0x22,0x90,0x76,0x95,0xe0,0x54,0xfe,0xf0,0x44},
+  16,0x18e0,0,{0x02,0xf0,0x30,0x3e,0x06,0xe0,0x44,0x04,0xf0,0x80,0x07,0x90,0x76,0x95,0xe0,0x54},
+  16,0x18f0,0,{0xfb,0xf0,0x90,0x76,0x1a,0xe0,0xb4,0x01,0x08,0x90,0x76,0x95,0xe0,0x90,0x80,0x01},
+  16,0x1900,0,{0xf0,0x90,0x76,0x19,0xe0,0xff,0xb4,0x01,0x22,0x90,0x7f,0xfc,0x74,0x30,0xf0,0x90},
+  16,0x1910,0,{0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x8f,0x74,0x2b,0xf0,0x90,0x76,0x97,0xe0,0x54},
+  16,0x1920,0,{0xfd,0xf0,0xe4,0x90,0x76,0x81,0xf0,0x90,0x76,0x80,0xf0,0xef,0xb4,0x02,0x22,0x90},
+  16,0x1930,0,{0x7f,0xfc,0x74,0x1c,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x8f,0x74,0x2f},
+  16,0x1940,0,{0xf0,0x90,0x76,0x97,0xe0,0x44,0x02,0xf0,0xe4,0x90,0x76,0x81,0xf0,0x90,0x76,0x80},
+  16,0x1950,0,{0xf0,0x30,0x3f,0x09,0x90,0x76,0x97,0xe0,0x54,0xfe,0xf0,0x80,0x07,0x90,0x76,0x97},
+  16,0x1960,0,{0xe0,0x44,0x01,0xf0,0x90,0x76,0x97,0xe0,0x54,0xfb,0xf0,0x90,0x80,0x02,0xf0,0xd2},
+  16,0x1970,0,{0x2e,0x22,0x90,0x76,0x95,0xe0,0x44,0x01,0xf0,0x44,0x02,0xf0,0x44,0x08,0xf0,0x30},
+  16,0x1980,0,{0x3e,0x06,0xe0,0x44,0x04,0xf0,0x80,0x07,0x90,0x76,0x95,0xe0,0x54,0xfb,0xf0,0x90},
+  16,0x1990,0,{0x76,0x1a,0xe0,0xb4,0x01,0x08,0x90,0x76,0x95,0xe0,0x90,0x80,0x01,0xf0,0x90,0x76},
+  16,0x19a0,0,{0x19,0xe0,0xff,0xb4,0x01,0x25,0x90,0x7f,0xfc,0x74,0xcc,0xf0,0x90,0x7f,0xff,0x74},
+  16,0x19b0,0,{0xfc,0xf0,0x90,0x76,0x8f,0x74,0x2b,0xf0,0x90,0x76,0x97,0xe0,0x54,0xfd,0xf0,0x54},
+  16,0x19c0,0,{0xfb,0xf0,0xe4,0x90,0x76,0x81,0xf0,0x90,0x76,0x80,0xf0,0xef,0xb4,0x02,0x25,0x90},
+  16,0x19d0,0,{0x7f,0xfc,0x74,0xc8,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x8f,0x74,0x2f},
+  16,0x19e0,0,{0xf0,0x90,0x76,0x97,0xe0,0x44,0x02,0xf0,0x54,0xfb,0xf0,0xe4,0x90,0x76,0x81,0xf0},
+  16,0x19f0,0,{0x90,0x76,0x80,0xf0,0xef,0xb4,0x03,0x25,0x90,0x7f,0xfc,0x74,0x98,0xf0,0x90,0x7f},
+  16,0x1a00,0,{0xff,0x74,0xfc,0xf0,0x90,0x76,0x8f,0x74,0x5f,0xf0,0x90,0x76,0x97,0xe0,0x54,0xfd},
+  16,0x1a10,0,{0xf0,0x44,0x04,0xf0,0xe4,0x90,0x76,0x81,0xf0,0x90,0x76,0x80,0xf0,0x30,0x3f,0x09},
+  16,0x1a20,0,{0x90,0x76,0x97,0xe0,0x54,0xfe,0xf0,0x80,0x07,0x90,0x76,0x97,0xe0,0x44,0x01,0xf0},
+  16,0x1a30,0,{0x90,0x76,0x97,0xe0,0x90,0x80,0x02,0xf0,0xd2,0x2e,0x22,0x90,0x76,0x95,0xe0,0x54},
+  16,0x1a40,0,{0xfe,0xf0,0x44,0x02,0xf0,0x44,0x08,0xf0,0x30,0x3e,0x06,0xe0,0x44,0x04,0xf0,0x80},
+  16,0x1a50,0,{0x07,0x90,0x76,0x95,0xe0,0x54,0xfb,0xf0,0x90,0x76,0x1a,0xe0,0xb4,0x01,0x08,0x90},
+  16,0x1a60,0,{0x76,0x95,0xe0,0x90,0x80,0x01,0xf0,0x90,0x76,0x19,0xe0,0xff,0xb4,0x01,0x25,0x90},
+  16,0x1a70,0,{0x7f,0xfc,0x74,0xb4,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x8f,0x74,0x2b},
+  16,0x1a80,0,{0xf0,0x90,0x76,0x97,0xe0,0x54,0xfd,0xf0,0x54,0xfb,0xf0,0xe4,0x90,0x76,0x81,0xf0},
+  16,0x1a90,0,{0x90,0x76,0x80,0xf0,0xef,0xb4,0x02,0x25,0x90,0x7f,0xfc,0x74,0xb0,0xf0,0x90,0x7f},
+  16,0x1aa0,0,{0xff,0x74,0xfc,0xf0,0x90,0x76,0x8f,0x74,0x2f,0xf0,0x90,0x76,0x97,0xe0,0x44,0x02},
+  16,0x1ab0,0,{0xf0,0x54,0xfb,0xf0,0xe4,0x90,0x76,0x81,0xf0,0x90,0x76,0x80,0xf0,0xef,0xb4,0x03},
+  16,0x1ac0,0,{0x25,0x90,0x7f,0xfc,0x74,0x68,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x8f},
+  16,0x1ad0,0,{0x74,0x5f,0xf0,0x90,0x76,0x97,0xe0,0x54,0xfd,0xf0,0x44,0x04,0xf0,0xe4,0x90,0x76},
+  16,0x1ae0,0,{0x81,0xf0,0x90,0x76,0x80,0xf0,0x30,0x3f,0x09,0x90,0x76,0x97,0xe0,0x54,0xfe,0xf0},
+  16,0x1af0,0,{0x80,0x07,0x90,0x76,0x97,0xe0,0x44,0x01,0xf0,0x90,0x76,0x97,0xe0,0x90,0x80,0x02},
+   4,0x1b00,0,{0xf0,0xd2,0x2e,0x22},
+  16,0x1b04,0,{0x30,0x2c,0x38,0xc2,0x2c,0x90,0x76,0x19,0xe0,0xff,0xb4,0x01,0x0e,0x90,0x76,0x7c},
+  16,0x1b14,0,{0x74,0xc0,0xf0,0xa3,0x74,0x14,0xf0,0xa3,0x74,0x0b,0xf0,0xef,0xb4,0x02,0x0d,0xe4},
+  16,0x1b24,0,{0x90,0x76,0x7c,0xf0,0xa3,0x74,0x10,0xf0,0xa3,0x74,0x0c,0xf0,0xef,0xb4,0x03,0x0b},
+  12,0x1b34,0,{0xe4,0x90,0x76,0x7c,0xf0,0xa3,0x74,0x18,0xf0,0xa3,0xf0,0x22},
+  16,0x1b40,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1b50,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1b60,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1b70,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1b80,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1b90,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1ba0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1bb0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1bc0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1bd0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1be0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1bf0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1c00,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1c10,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1c20,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1c30,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1c40,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1c50,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1c60,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1c70,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1c80,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1c90,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1ca0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1cb0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1cc0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1cd0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1ce0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1cf0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1d00,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1d10,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1d20,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1d30,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1d40,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1d50,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1d60,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1d70,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1d80,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1d90,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1da0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1db0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1dc0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1dd0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1de0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1df0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1e00,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1e10,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1e20,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1e30,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1e40,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1e50,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1e60,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1e70,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1e80,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1e90,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1ea0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  14,0x1eb0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1ebe,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1ece,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1ede,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1eee,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1efe,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1f0e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1f1e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1f2e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+   2,0x1f3e,0,{0x00,0x00},
+  16,0x1f40,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1f50,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1f60,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1f70,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1f80,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1f90,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1fa0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1fb0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1fc0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1fd0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1fe0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x1ff0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2000,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2010,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2020,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2030,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2040,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2050,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2060,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2070,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2080,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2090,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x20a0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x20b0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x20c0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x20d0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x20e0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x20f0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2100,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2110,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2120,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2130,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2140,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2150,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2160,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2170,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2180,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2190,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x21a0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x21b0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x21c0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x21d0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x21e0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x21f0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2200,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2210,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2220,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2230,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2240,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2250,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2260,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2270,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2280,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2290,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x22a0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x22b0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x22c0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x22d0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x22e0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x22f0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2300,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2310,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2320,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2330,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2340,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2350,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x2360,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  14,0x2370,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x237e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x238e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x239e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x23ae,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x23be,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x23ce,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x23de,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x23ee,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x23fe,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x240e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x241e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x242e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x243e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x244e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x245e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x246e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x247e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x248e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x249e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x24ae,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x24be,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x24ce,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x24de,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x24ee,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x24fe,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x250e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x251e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x252e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x253e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x254e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x255e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x256e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x257e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x258e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x259e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x25ae,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x25be,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x25ce,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x25de,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x25ee,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x25fe,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x260e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x261e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x262e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x263e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x264e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x265e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x266e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x267e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x268e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x269e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x26ae,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x26be,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x26ce,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x26de,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  14,0x26ee,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x26fc,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x270c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x271c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x272c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x273c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x274c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x275c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x276c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x277c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x278c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x279c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x27ac,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x27bc,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x27cc,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x27dc,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+  16,0x27ec,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+   5,0x27fc,0,{0x00,0x00,0x00,0x00,0x22},
+  16,0x2801,0,{0xc2,0x20,0xc2,0x21,0xc2,0x2a,0x90,0x7f,0xe8,0xe0,0x12,0x37,0xf9,0x28,0x30,0x00},
+  16,0x2811,0,{0x28,0x8c,0x01,0x28,0xa2,0x02,0x2a,0x1f,0x21,0x2a,0x6a,0x22,0x29,0x3d,0x80,0x29},
+  16,0x2821,0,{0x7d,0x81,0x29,0xd1,0x82,0x2a,0x84,0xa1,0x2a,0xba,0xa2,0x00,0x00,0x2a,0xbf,0x90},
+  16,0x2831,0,{0x7f,0xe9,0xe0,0x14,0x60,0x11,0x24,0xfe,0x60,0x28,0x24,0xfe,0x60,0x3b,0x24,0xfc},
+  16,0x2841,0,{0x70,0x40,0x12,0x3f,0xe5,0x41,0xcb,0x12,0x4e,0x1d,0x40,0x02,0x41,0xcb,0x90,0x7f},
+  16,0x2851,0,{0xea,0xe0,0xb4,0x01,0x04,0xc2,0x22,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0},
+  16,0x2861,0,{0x41,0xcb,0x12,0x4e,0x1f,0x90,0x7f,0xea,0xe0,0xb4,0x01,0x04,0xd2,0x22,0x41,0xcb},
+  16,0x2871,0,{0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0},
+  16,0x2881,0,{0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb,0x90,0x7f,0xe9,0xe0,0x24},
+  16,0x2891,0,{0xf5,0x70,0x05,0x12,0x48,0x63,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41},
+  16,0x28a1,0,{0xcb,0x90,0x7f,0xe9,0xe0,0x24,0xfd,0x60,0x54,0x24,0x02,0x60,0x02,0x21,0x34,0x12},
+  16,0x28b1,0,{0x4e,0x1d,0x40,0x02,0x41,0xcb,0x90,0x7f,0xea,0xe0,0x70,0x38,0x90,0x7f,0xec,0xe0},
+  16,0x28c1,0,{0xf4,0x54,0x80,0xff,0xc4,0x54,0x0f,0xff,0xe0,0x54,0x07,0x2f,0x25,0xe0,0x24,0xb4},
+  16,0x28d1,0,{0xf5,0x82,0xe4,0x34,0x7f,0xf5,0x83,0xe4,0xf0,0x90,0x7f,0xec,0xe0,0x54,0x80,0xff},
+  16,0x28e1,0,{0x13,0x13,0x13,0x54,0x1f,0xff,0xe0,0x54,0x07,0x2f,0x90,0x7f,0xd7,0xf0,0xe0,0x44},
+  16,0x28f1,0,{0x20,0xf0,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb,0x12,0x4e,0x1f},
+  16,0x2901,0,{0x40,0x02,0x41,0xcb,0x90,0x7f,0xea,0xe0,0x70,0x20,0x90,0x7f,0xec,0xe0,0xf4,0x54},
+  16,0x2911,0,{0x80,0xff,0xc4,0x54,0x0f,0xff,0xe0,0x54,0x07,0x2f,0x25,0xe0,0x24,0xb4,0xf5,0x82},
+  16,0x2921,0,{0xe4,0x34,0x7f,0xf5,0x83,0x74,0x01,0xf0,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01},
+  16,0x2931,0,{0xf0,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb,0x90,0x7f,0xe9,0xe0},
+  16,0x2941,0,{0x60,0x12,0x24,0xf8,0x60,0x09,0x24,0x02,0x70,0x29,0x12,0x43,0xe7,0x41,0xcb,0x12},
+  16,0x2951,0,{0x4d,0xca,0x41,0xcb,0x12,0x4e,0x1b,0xa2,0x22,0xe4,0x33,0xff,0x25,0xe0,0xff,0xa2},
+  16,0x2961,0,{0x23,0xe4,0x33,0x4f,0x90,0x7f,0x00,0xf0,0xe4,0xa3,0xf0,0x90,0x7f,0xb5,0x74,0x02},
+  16,0x2971,0,{0xf0,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb,0x90,0x7f,0xe9,0xe0},
+  16,0x2981,0,{0x60,0x33,0x24,0xf6,0x60,0x2a,0x24,0x04,0x70,0x3d,0x90,0x7f,0xeb,0xe0,0x24,0xde},
+  16,0x2991,0,{0x60,0x0c,0x04,0x70,0x12,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb,0x90,0x7f},
+  16,0x29a1,0,{0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb},
+  16,0x29b1,0,{0x12,0x47,0x45,0x41,0xcb,0x12,0x4e,0x1b,0xe4,0x90,0x7f,0x00,0xf0,0xa3,0xf0,0x90},
+  16,0x29c1,0,{0x7f,0xb5,0x74,0x02,0xf0,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb},
+  16,0x29d1,0,{0x90,0x7f,0xe9,0xe0,0x24,0xf4,0x60,0x34,0x24,0x0c,0x70,0x39,0x12,0x4e,0x1b,0x90},
+  16,0x29e1,0,{0x7f,0xec,0xe0,0xf4,0x54,0x80,0xff,0xc4,0x54,0x0f,0xff,0xe0,0x54,0x07,0x2f,0x25},
+  16,0x29f1,0,{0xe0,0x24,0xb4,0xf5,0x82,0xe4,0x34,0x7f,0xf5,0x83,0xe0,0x54,0xfd,0x90,0x7f,0x00},
+  16,0x2a01,0,{0xf0,0xe4,0xa3,0xf0,0x90,0x7f,0xb5,0x74,0x02,0xf0,0x41,0xcb,0x90,0x7f,0xb4,0xe0},
+  16,0x2a11,0,{0x44,0x01,0xf0,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb,0x90,0x7f},
+  16,0x2a21,0,{0xe9,0xe0,0x24,0xf6,0x60,0x12,0x14,0x60,0x1a,0x24,0x02,0x70,0x1d,0xd2,0x20,0x90},
+  16,0x2a31,0,{0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x80,0x12,0xd2,0x20,0x90,0x7f,0xb4,0xe0,0x44,0x01},
+  16,0x2a41,0,{0xf0,0x80,0x07,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x20,0x20,0x18,0x90,0x7f,0xee},
+  16,0x2a51,0,{0xe0,0x70,0x04,0xa3,0xe0,0x60,0x0b,0xd2,0x29,0xd2,0x27,0x12,0x17,0x4a,0xd2,0x2a},
+  16,0x2a61,0,{0x80,0x03,0x12,0x08,0x00,0xc2,0x20,0x80,0x61,0x90,0x7f,0xee,0xe0,0x70,0x04,0xa3},
+  16,0x2a71,0,{0xe0,0x60,0x0b,0xd2,0x29,0xd2,0x28,0x12,0x17,0x4a,0xd2,0x2a,0x80,0x4c,0x12,0x38},
+  16,0x2a81,0,{0x74,0x80,0x47,0x90,0x7f,0xe9,0xe0,0x24,0xfe,0x60,0x12,0x14,0x60,0x1a,0x24,0x02},
+  16,0x2a91,0,{0x70,0x1d,0xd2,0x21,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x80,0x12,0xd2,0x21,0x90},
+  16,0x2aa1,0,{0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x80,0x07,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x20},
+  16,0x2ab1,0,{0x21,0x03,0x12,0x10,0x00,0xc2,0x21,0x80,0x11,0x12,0x2a,0xd6,0x80,0x0c,0x12,0x4e},
+  16,0x2ac1,0,{0x21,0x50,0x07,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x20,0x2a,0x07,0x90,0x7f,0xb4},
+   5,0x2ad1,0,{0xe0,0x44,0x02,0xf0,0x22},
+  16,0x2ad6,0,{0xe4,0x90,0x76,0x27,0xf0,0x90,0x76,0x27,0xe0,0xff,0x75,0xf0,0x0f,0xa4,0x24,0x42},
+  16,0x2ae6,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xec,0xe0,0xfd,0xee,0x6d},
+  16,0x2af6,0,{0x60,0x0e,0xef,0xc3,0x94,0x06,0x50,0x08,0x90,0x76,0x27,0xe0,0x04,0xf0,0x80,0xd5},
+  16,0x2b06,0,{0xef,0xb4,0x06,0x08,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0xef,0x75,0xf0,0x0f},
+  16,0x2b16,0,{0xa4,0x24,0x41,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x76,0x28,0xf0,0x24},
+  16,0x2b26,0,{0x9f,0x70,0x02,0xa1,0x74,0x24,0x21,0x60,0x02,0xa1,0xa1,0x90,0x7f,0xe9,0xe0,0x24},
+  16,0x2b36,0,{0x7e,0x70,0x02,0x61,0xfc,0x14,0x70,0x02,0x81,0xb5,0x24,0x02,0x60,0x02,0xa1,0x6c},
+  16,0x2b46,0,{0xef,0x75,0xf0,0x0f,0xa4,0x24,0x43,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfc},
+  16,0x2b56,0,{0xa3,0xe0,0xfd,0xa3,0xe0,0xfe,0xa3,0xe0,0xff,0x7b,0x44,0x7a,0xac,0x79,0x00,0x78},
+  16,0x2b66,0,{0x00,0xc3,0x12,0x37,0xab,0x70,0x13,0x90,0x7f,0x00,0x74,0x44,0xf0,0xa3,0x74,0xac},
+  16,0x2b76,0,{0xf0,0xe4,0xa3,0xf0,0x90,0x7f,0xb5,0x74,0x03,0xf0,0x90,0x76,0x27,0xe0,0x75,0xf0},
+  16,0x2b86,0,{0x0f,0xa4,0x24,0x43,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfc,0xa3,0xe0,0xfd},
+  16,0x2b96,0,{0xa3,0xe0,0xfe,0xa3,0xe0,0xff,0x7b,0x80,0x7a,0xbb,0x79,0x00,0x78,0x00,0xc3,0x12},
+  16,0x2ba6,0,{0x37,0xab,0x70,0x13,0x90,0x7f,0x00,0x74,0x80,0xf0,0xa3,0x74,0xbb,0xf0,0xe4,0xa3},
+  16,0x2bb6,0,{0xf0,0x90,0x7f,0xb5,0x74,0x03,0xf0,0x90,0x76,0x27,0xe0,0x75,0xf0,0x0f,0xa4,0x24},
+  16,0x2bc6,0,{0x43,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfc,0xa3,0xe0,0xfd,0xa3,0xe0,0xfe},
+  16,0x2bd6,0,{0xa3,0xe0,0xff,0x7b,0x00,0x7a,0x77,0x79,0x01,0x78,0x00,0xc3,0x12,0x37,0xab,0x60},
+  16,0x2be6,0,{0x02,0xa1,0xa8,0x90,0x7f,0x00,0xf0,0xa3,0x74,0x77,0xf0,0xa3,0x74,0x01,0xf0,0x90},
+  16,0x2bf6,0,{0x7f,0xb5,0x74,0x03,0xf0,0x22,0x90,0x76,0x27,0xe0,0x75,0xf0,0x0f,0xa4,0x24,0x47},
+  16,0x2c06,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfc,0xa3,0xe0,0xfd,0xa3,0xe0,0xfe,0xa3},
+  16,0x2c16,0,{0xe0,0xff,0x7b,0x44,0x7a,0xac,0x79,0x00,0x78,0x00,0xc3,0x12,0x37,0xab,0x70,0x13},
+  16,0x2c26,0,{0x90,0x7f,0x00,0x74,0x44,0xf0,0xa3,0x74,0xac,0xf0,0xe4,0xa3,0xf0,0x90,0x7f,0xb5},
+  16,0x2c36,0,{0x74,0x03,0xf0,0x90,0x76,0x27,0xe0,0x75,0xf0,0x0f,0xa4,0x24,0x47,0xf5,0x82,0xe4},
+  16,0x2c46,0,{0x34,0x75,0xf5,0x83,0xe0,0xfc,0xa3,0xe0,0xfd,0xa3,0xe0,0xfe,0xa3,0xe0,0xff,0x7b},
+  16,0x2c56,0,{0x80,0x7a,0xbb,0x79,0x00,0x78,0x00,0xc3,0x12,0x37,0xab,0x70,0x13,0x90,0x7f,0x00},
+  16,0x2c66,0,{0x74,0x80,0xf0,0xa3,0x74,0xbb,0xf0,0xe4,0xa3,0xf0,0x90,0x7f,0xb5,0x74,0x03,0xf0},
+  16,0x2c76,0,{0x90,0x76,0x27,0xe0,0x75,0xf0,0x0f,0xa4,0x24,0x47,0xf5,0x82,0xe4,0x34,0x75,0xf5},
+  16,0x2c86,0,{0x83,0xe0,0xfc,0xa3,0xe0,0xfd,0xa3,0xe0,0xfe,0xa3,0xe0,0xff,0x7b,0x00,0x7a,0x77},
+  16,0x2c96,0,{0x79,0x01,0x78,0x00,0xc3,0x12,0x37,0xab,0x60,0x02,0xa1,0xa8,0x90,0x7f,0x00,0xf0},
+  16,0x2ca6,0,{0xa3,0x74,0x77,0xf0,0xa3,0x74,0x01,0xf0,0x90,0x7f,0xb5,0x74,0x03,0xf0,0x22,0x90},
+  16,0x2cb6,0,{0x76,0x27,0xe0,0x75,0xf0,0x0f,0xa4,0x24,0x4b,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83},
+  16,0x2cc6,0,{0xe0,0xfc,0xa3,0xe0,0xfd,0xa3,0xe0,0xfe,0xa3,0xe0,0xff,0x7b,0x44,0x7a,0xac,0x79},
+  16,0x2cd6,0,{0x00,0x78,0x00,0xc3,0x12,0x37,0xab,0x70,0x13,0x90,0x7f,0x00,0x74,0x44,0xf0,0xa3},
+  16,0x2ce6,0,{0x74,0xac,0xf0,0xe4,0xa3,0xf0,0x90,0x7f,0xb5,0x74,0x03,0xf0,0x90,0x76,0x27,0xe0},
+  16,0x2cf6,0,{0x75,0xf0,0x0f,0xa4,0x24,0x4b,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfc,0xa3},
+  16,0x2d06,0,{0xe0,0xfd,0xa3,0xe0,0xfe,0xa3,0xe0,0xff,0x7b,0x80,0x7a,0xbb,0x79,0x00,0x78,0x00},
+  16,0x2d16,0,{0xc3,0x12,0x37,0xab,0x70,0x13,0x90,0x7f,0x00,0x74,0x80,0xf0,0xa3,0x74,0xbb,0xf0},
+  16,0x2d26,0,{0xe4,0xa3,0xf0,0x90,0x7f,0xb5,0x74,0x03,0xf0,0x90,0x76,0x27,0xe0,0x75,0xf0,0x0f},
+  16,0x2d36,0,{0xa4,0x24,0x4b,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfc,0xa3,0xe0,0xfd,0xa3},
+  16,0x2d46,0,{0xe0,0xfe,0xa3,0xe0,0xff,0x7b,0x00,0x7a,0x77,0x79,0x01,0x78,0x00,0xc3,0x12,0x37},
+  16,0x2d56,0,{0xab,0x70,0x4f,0x90,0x7f,0x00,0xf0,0xa3,0x74,0x77,0xf0,0xa3,0x74,0x01,0xf0,0x90},
+  16,0x2d66,0,{0x7f,0xb5,0x74,0x03,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f},
+  16,0x2d76,0,{0xe9,0xe0,0x24,0x7f,0x70,0x1e,0x90,0x76,0x27,0xe0,0x75,0xf0,0x0f,0xa4,0x24,0x4f},
+  16,0x2d86,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x7f,0x00,0xf0,0x90,0x7f,0xb5,0x74},
+  16,0x2d96,0,{0x01,0xf0,0x80,0x07,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x90,0x7f,0xb4,0xe0,0x44},
+   3,0x2da6,0,{0x01,0xf0,0x22},
+  16,0x2da9,0,{0xe4,0x90,0x76,0x36,0xf0,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x0e,0xf5,0x82,0xe4},
+  16,0x2db9,0,{0x34,0x75,0xf5,0x83,0x74,0x01,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x0f,0xf5,0x82},
+  16,0x2dc9,0,{0xe4,0x34,0x75,0xf5,0x83,0x74,0x01,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x10,0xf5},
+  16,0x2dd9,0,{0x82,0xe4,0x34,0x75,0xf5,0x83,0xe4,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff},
+  16,0x2de9,0,{0x75,0xf0,0x03,0xa4,0x24,0x0e,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x10,0xf0},
+  16,0x2df9,0,{0xef,0x75,0xf0,0x03,0xa4,0x24,0x0f,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x05},
+  16,0x2e09,0,{0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x10,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe4},
+  16,0x2e19,0,{0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x0e,0xf5},
+  16,0x2e29,0,{0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x02,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x0f},
+  16,0x2e39,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x02,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24},
+  16,0x2e49,0,{0x10,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe4,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0},
+  16,0x2e59,0,{0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x0e,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74},
+  16,0x2e69,0,{0x01,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x0f,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83},
+  16,0x2e79,0,{0x74,0x03,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x10,0xf5,0x82,0xe4,0x34,0x75,0xf5},
+  16,0x2e89,0,{0x83,0xe4,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24},
+  16,0x2e99,0,{0x0e,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x10,0xf0,0xef,0x75,0xf0,0x03,0xa4},
+  16,0x2ea9,0,{0x24,0x0f,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x06,0xf0,0xef,0x75,0xf0,0x03},
+  16,0x2eb9,0,{0xa4,0x24,0x10,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe4,0xf0,0x90,0x76,0x36,0xe0},
+  16,0x2ec9,0,{0x04,0xf0,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x0e,0xf5,0x82,0xe4,0x34,0x75,0xf5},
+  16,0x2ed9,0,{0x83,0x74,0x02,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x0f,0xf5,0x82,0xe4,0x34,0x75},
+  16,0x2ee9,0,{0xf5,0x83,0x74,0x04,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x10,0xf5,0x82,0xe4,0x34},
+  16,0x2ef9,0,{0x75,0xf5,0x83,0xe4,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75,0xf0,0x03},
+  16,0x2f09,0,{0xa4,0x24,0x0e,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x02,0xf0,0xef,0x75,0xf0},
+  16,0x2f19,0,{0x03,0xa4,0x24,0x0f,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x08,0xf0,0xef,0x75},
+  16,0x2f29,0,{0xf0,0x03,0xa4,0x24,0x10,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x04,0xf0,0x90},
+  16,0x2f39,0,{0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x0e,0xf5,0x82,0xe4},
+  16,0x2f49,0,{0x34,0x75,0xf5,0x83,0x74,0x02,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x0f,0xf5,0x82},
+  16,0x2f59,0,{0xe4,0x34,0x75,0xf5,0x83,0x74,0x0a,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x10,0xf5},
+  16,0x2f69,0,{0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x04,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0},
+  16,0x2f79,0,{0xff,0x75,0xf0,0x03,0xa4,0x24,0x0e,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x02},
+  16,0x2f89,0,{0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x0f,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74},
+  16,0x2f99,0,{0x09,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x10,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83},
+  16,0x2fa9,0,{0x74,0x04,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24},
+  16,0x2fb9,0,{0x0e,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x02,0xf0,0xef,0x75,0xf0,0x03,0xa4},
+  16,0x2fc9,0,{0x24,0x0f,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x07,0xf0,0xef,0x75,0xf0,0x03},
+  14,0x2fd9,0,{0xa4,0x24,0x10,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x04,0xf0,0x22},
+  16,0x2fe7,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0xd2,0x26,0x53,0x91,0xef,0x90,0x7f,0xab,0x74,0x01},
+   8,0x2ff7,0,{0xf0,0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+   1,0x2fff,0,{0x32},
+  16,0x3000,0,{0x90,0x7f,0xb6,0xe0,0x20,0xe1,0x02,0xc2,0x3d,0xd2,0x36,0x20,0x36,0x02,0x41,0x6e},
+  16,0x3010,0,{0x30,0x3d,0x02,0x41,0x6e,0x90,0x80,0x07,0xe0,0x60,0x04,0xd2,0x36,0x80,0x02,0xc2},
+  16,0x3020,0,{0x36,0x20,0x36,0x02,0x41,0x2e,0xd2,0x35,0xe4,0xf5,0x1a,0x90,0x80,0x04,0xe0,0xf5},
+  16,0x3030,0,{0x19,0x74,0x08,0x25,0x0e,0xf8,0xa6,0x19,0x85,0x19,0x18,0xe5,0x18,0x20,0xe7,0x04},
+  16,0x3040,0,{0xd2,0x38,0x80,0x02,0xc2,0x38,0x30,0x38,0x02,0x21,0xd4,0xe4,0xf5,0x16,0xe5,0x19},
+  16,0x3050,0,{0xb4,0xf0,0x0c,0xd2,0x39,0x75,0x08,0x04,0x75,0x09,0xf0,0x05,0x0e,0x80,0x02,0x05},
+  16,0x3060,0,{0x16,0xe5,0x19,0x64,0xf7,0x70,0x3d,0xc2,0x39,0xe5,0x0e,0x24,0xfe,0x60,0x17,0x14},
+  16,0x3070,0,{0x60,0x22,0x24,0x03,0x70,0x29,0x75,0x08,0x05,0x75,0x09,0xf7,0xe4,0xf5,0x0a,0xf5},
+  16,0x3080,0,{0x0b,0x75,0x0e,0x04,0x80,0x20,0x75,0x08,0x06,0x75,0x0a,0xf7,0xe4,0xf5,0x0b,0x75},
+  16,0x3090,0,{0x0e,0x04,0x80,0x12,0x75,0x08,0x07,0x75,0x0b,0xf7,0x75,0x0e,0x04,0x80,0x07,0x12},
+  16,0x30a0,0,{0x4d,0xda,0x80,0x02,0x05,0x16,0xe5,0x19,0x54,0xf8,0x64,0xf8,0x70,0x3b,0xc2,0x35},
+  16,0x30b0,0,{0xe5,0x19,0x24,0x07,0x60,0x0c,0x24,0xfc,0x60,0x08,0x24,0x05,0x24,0xf8,0x50,0x06},
+  16,0x30c0,0,{0x80,0x08,0xd2,0x3a,0x80,0x06,0xc2,0x3a,0x80,0x02,0xd2,0x3a,0x75,0x1a,0x01,0x20},
+  16,0x30d0,0,{0x3a,0x19,0x90,0x7e,0x80,0x74,0x0f,0xf0,0xa3,0xe5,0x19,0xf0,0xe4,0xa3,0xf0,0xa3},
+  16,0x30e0,0,{0xf0,0x90,0x7f,0xb7,0x74,0x04,0xf0,0x80,0x02,0x05,0x16,0x20,0x39,0x6d,0xe5,0x19},
+  16,0x30f0,0,{0x64,0xf7,0x60,0x67,0xe5,0x1a,0x70,0x63,0xe5,0x18,0x54,0xf0,0x64,0xf0,0x70,0x59},
+  16,0x3100,0,{0x85,0x18,0x19,0xf5,0x0e,0xe5,0x19,0x24,0x0f,0x60,0x1b,0x24,0xfe,0x60,0x17,0x24},
+  16,0x3110,0,{0xfd,0x60,0x22,0x14,0x60,0x1f,0x24,0x05,0x70,0x2f,0x75,0x08,0x03,0x05,0x0e,0x85},
+  16,0x3120,0,{0x18,0x09,0xd2,0x37,0x80,0x28,0x75,0x08,0x02,0x05,0x0e,0x85,0x18,0x09,0x75,0x14},
+  16,0x3130,0,{0x01,0xd2,0x37,0x80,0x19,0x75,0x08,0x05,0x05,0x0e,0x85,0x18,0x09,0xe4,0xf5,0x0a},
+  16,0x3140,0,{0xf5,0x0b,0x75,0x0e,0x03,0xd2,0x37,0x80,0x05,0x12,0x4d,0xda,0xc2,0x35,0x30,0x35},
+  16,0x3150,0,{0x0a,0x85,0x08,0x13,0x85,0x18,0x12,0x80,0x02,0x05,0x16,0x85,0x18,0x19,0xe5,0x16},
+  16,0x3160,0,{0x64,0x04,0x70,0x62,0xf5,0x0e,0xe5,0x19,0x54,0xf0,0xf5,0x19,0xf5,0x15,0x85,0x18},
+  16,0x3170,0,{0x19,0xe5,0x15,0x24,0x70,0x60,0x18,0x24,0xf0,0x60,0x14,0x24,0xf0,0x60,0x10,0x24},
+  16,0x3180,0,{0xf0,0x60,0x1e,0x24,0xf0,0x60,0x1a,0x24,0xf0,0x60,0x04,0x24,0x60,0x70,0x27,0xe5},
+  16,0x3190,0,{0x15,0xc4,0x54,0x0f,0xf5,0x19,0xf5,0x08,0x05,0x0e,0x85,0x18,0x09,0xd2,0x37,0x80},
+  16,0x31a0,0,{0x1a,0xe5,0x15,0xc4,0x54,0x0f,0xf5,0x19,0xf5,0x08,0x05,0x0e,0x85,0x18,0x09,0x75},
+  16,0x31b0,0,{0x14,0x01,0xd2,0x37,0x80,0x05,0x12,0x4d,0xda,0xc2,0x35,0x30,0x35,0x0a,0x85,0x19},
+  16,0x31c0,0,{0x13,0x85,0x18,0x12,0x80,0x02,0x05,0x16,0xe5,0x16,0xd3,0x94,0x05,0x40,0x57,0x12},
+  16,0x31d0,0,{0x4d,0xda,0x80,0x52,0x30,0x39,0x17,0xe5,0x0e,0x70,0x0a,0x85,0x08,0x09,0x75,0x08},
+  16,0x31e0,0,{0x04,0x05,0x0e,0x80,0x41,0x74,0x08,0x25,0x0e,0xf8,0xa6,0x19,0x80,0x38,0x20,0x37},
+  16,0x31f0,0,{0x2a,0xe5,0x0e,0xb4,0x01,0x0f,0x85,0x08,0x0a,0x85,0x09,0x0b,0x85,0x13,0x08,0x85},
+  16,0x3200,0,{0x12,0x09,0x75,0x0e,0x04,0xe5,0x14,0xb4,0x01,0x1c,0x85,0x08,0x0a,0xe4,0xf5,0x0b},
+  16,0x3210,0,{0x85,0x13,0x08,0x85,0x12,0x09,0x75,0x0e,0x04,0x80,0x0b,0xe5,0x14,0xb4,0x01,0x06},
+  16,0x3220,0,{0xe4,0xf5,0x0b,0x75,0x0e,0x04,0xe4,0xf5,0x1a,0x30,0x35,0x02,0x05,0x0e,0xe5,0x0e},
+  16,0x3230,0,{0xd3,0x94,0x03,0x50,0x02,0x01,0x0b,0xc2,0x37,0xe4,0xf5,0x0e,0xf5,0x10,0xc2,0x36},
+  16,0x3240,0,{0xd2,0x3d,0xf5,0x14,0x74,0x08,0x25,0x10,0xf8,0xe6,0xff,0x74,0x80,0x25,0x10,0xf5},
+  16,0x3250,0,{0x82,0xe4,0x34,0x7e,0xf5,0x83,0xef,0xf0,0x74,0x08,0x25,0x10,0xf8,0xe4,0xf6,0x05},
+  15,0x3260,0,{0x10,0xe5,0x10,0xb4,0x04,0xde,0x90,0x7f,0xb7,0x74,0x04,0xf0,0x01,0x0b,0x22},
+  16,0x326f,0,{0x90,0x76,0x18,0xe0,0xff,0x64,0x05,0x70,0x42,0x90,0x75,0xab,0xe0,0xb4,0x01,0x19},
+  16,0x327f,0,{0x90,0x72,0x37,0x74,0x01,0xf0,0xe4,0x90,0x80,0x20,0xf0,0x90,0x80,0x31,0xf0,0x90},
+  16,0x328f,0,{0x80,0x28,0xf0,0x90,0x80,0x39,0xf0,0x80,0x22,0xe4,0x90,0x72,0x37,0xf0,0x90,0x75},
+  16,0x329f,0,{0xad,0xe0,0x90,0x72,0x2b,0xf0,0xe0,0x24,0x80,0xf0,0xe0,0x90,0x80,0x20,0xf0,0x90},
+  16,0x32af,0,{0x80,0x31,0xf0,0x90,0x80,0x28,0xf0,0x90,0x80,0x39,0xf0,0xef,0x64,0x06,0x60,0x02},
+  16,0x32bf,0,{0x81,0x99,0x90,0x72,0x39,0x74,0x04,0xf0,0x90,0x72,0x39,0xe0,0xff,0x24,0xfe,0x90},
+  16,0x32cf,0,{0x72,0x04,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xab,0xf5,0x82,0xe4,0x34,0x75,0xf5},
+  16,0x32df,0,{0x83,0xe0,0x64,0x01,0x70,0x54,0x90,0x72,0x36,0x04,0xf0,0x90,0x72,0x04,0xe0,0xff},
+  16,0x32ef,0,{0x24,0xfd,0x60,0x28,0x24,0xfe,0x60,0x24,0x24,0x03,0x24,0xfb,0x50,0x04,0x60,0x1c},
+  16,0x32ff,0,{0x81,0x8c,0x74,0x20,0x2f,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xe4,0xf0,0x74,0x28},
+  16,0x330f,0,{0x2f,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xe4,0xf0,0x81,0x8c,0x90,0x72,0x04,0xe0},
+  16,0x331f,0,{0xff,0x24,0x30,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xe4,0xf0,0x74,0x38,0x2f,0xf5},
+  16,0x332f,0,{0x82,0xe4,0x34,0x80,0xf5,0x83,0xe4,0xf0,0x81,0x8c,0xe4,0x90,0x72,0x36,0xf0,0x90},
+  16,0x333f,0,{0x72,0x39,0xe0,0x75,0xf0,0x0a,0xa4,0x24,0xad,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83},
+  16,0x334f,0,{0xe0,0xff,0x7e,0x00,0x90,0x75,0x0c,0xee,0xf0,0xa3,0xef,0xf0,0x70,0x06,0x90,0x72},
+  16,0x335f,0,{0x02,0x74,0x3b,0xf0,0x90,0x75,0x0c,0xe0,0xfe,0xa3,0xe0,0xff,0x64,0x80,0x4e,0x70},
+  16,0x336f,0,{0x04,0x90,0x72,0x02,0xf0,0xef,0x4e,0x70,0x02,0x81,0x35,0xef,0x64,0x80,0x4e,0x70},
+  16,0x337f,0,{0x02,0x81,0x35,0xef,0xf8,0xe4,0x90,0x75,0x0d,0xf0,0xe8,0x90,0x75,0x0c,0xf0,0x90},
+  16,0x338f,0,{0x72,0x34,0xe0,0x75,0xf0,0x0a,0xa4,0x24,0xac,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83},
+  16,0x339f,0,{0xe0,0xff,0x90,0x72,0x02,0xf0,0x90,0x75,0x0d,0xe0,0x2f,0xf0,0x90,0x75,0x0c,0xe0},
+  16,0x33af,0,{0x34,0x00,0xf0,0xe0,0xfe,0xa3,0xe0,0xff,0xe4,0xfc,0xfd,0x7b,0xd6,0x7a,0xa5,0xf9},
+  16,0x33bf,0,{0xf8,0xd3,0x12,0x37,0x95,0x40,0x0a,0x90,0x75,0x0c,0x74,0xa5,0xf0,0xa3,0x74,0xd6},
+  16,0x33cf,0,{0xf0,0x90,0x75,0x0d,0xe0,0x24,0x2a,0xf0,0x90,0x75,0x0c,0xe0,0x34,0x5a,0xf0,0xe0},
+  16,0x33df,0,{0xfe,0xa3,0xe0,0x78,0x05,0xce,0xa2,0xe7,0x13,0xce,0x13,0xd8,0xf8,0xff,0x90,0x75},
+  16,0x33ef,0,{0x0c,0xee,0xf0,0xa3,0xef,0xf0,0x90,0x72,0x2c,0xee,0xf0,0xa3,0xef,0xf0,0xd3,0x94},
+  16,0x33ff,0,{0xd2,0xee,0x64,0x80,0x94,0x82,0x40,0x0a,0x90,0x72,0x2c,0x74,0x02,0xf0,0xa3,0x74},
+  16,0x340f,0,{0xd2,0xf0,0xc3,0x90,0x72,0x2c,0xe0,0x64,0x80,0x94,0x80,0x50,0x04,0xe4,0xf0,0xa3},
+  16,0x341f,0,{0xf0,0x90,0x72,0x2c,0xe0,0xfe,0xa3,0xe0,0x24,0x3a,0xf5,0x82,0xee,0x34,0x72,0xf5},
+  16,0x342f,0,{0x83,0xe0,0x90,0x72,0x02,0xf0,0x90,0x72,0x04,0xe0,0xff,0x24,0xfd,0x60,0x2d,0x24},
+  16,0x343f,0,{0xfe,0x60,0x29,0x24,0x03,0x24,0xfb,0x50,0x04,0x60,0x21,0x80,0x40,0x90,0x72,0x02},
+  16,0x344f,0,{0xe0,0xfe,0x74,0x20,0x2f,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xee,0xf0,0x74,0x28},
+  16,0x345f,0,{0x2f,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xee,0xf0,0x80,0x21,0x90,0x72,0x02,0xe0},
+  16,0x346f,0,{0xff,0x90,0x72,0x04,0xe0,0xfe,0x24,0x30,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xef},
+  16,0x347f,0,{0xf0,0x74,0x38,0x2e,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xef,0xf0,0x90,0x72,0x39},
+  11,0x348f,0,{0xe0,0x04,0xf0,0xe0,0x64,0x0a,0x60,0x02,0x41,0xc7,0x22},
+  16,0x349a,0,{0x90,0x76,0x18,0xe0,0xff,0xb4,0x05,0x23,0x90,0x72,0x37,0xe0,0x70,0x1d,0x90,0x75},
+  16,0x34aa,0,{0xad,0xe0,0x90,0x72,0x2b,0xf0,0xe0,0x24,0x80,0xf0,0xe0,0x90,0x80,0x20,0xf0,0x90},
+  16,0x34ba,0,{0x80,0x31,0xf0,0x90,0x80,0x28,0xf0,0x90,0x80,0x39,0xf0,0xef,0x64,0x06,0x60,0x02},
+  16,0x34ca,0,{0xc1,0x91,0x90,0x72,0x36,0xe0,0x60,0x02,0xc1,0x91,0x90,0x76,0x40,0xe0,0x70,0x31},
+  16,0x34da,0,{0x90,0x72,0x03,0x74,0x03,0xf0,0x90,0x72,0x03,0xe0,0xff,0x75,0xf0,0x0a,0xa4,0x24},
+  16,0x34ea,0,{0xaa,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x72,0x29,0xe0,0xfd,0xee},
+  16,0x34fa,0,{0x6d,0x60,0x0e,0xef,0xc3,0x94,0x0a,0x50,0x08,0x90,0x72,0x03,0xe0,0x04,0xf0,0x80},
+  16,0x350a,0,{0xd5,0x90,0x72,0x39,0x74,0x04,0xf0,0x90,0x76,0x40,0xe0,0x70,0x08,0x90,0x72,0x03},
+  16,0x351a,0,{0xe0,0x90,0x72,0x39,0xf0,0x90,0x72,0x39,0xe0,0xfd,0x24,0xfe,0x90,0x72,0x2a,0xf0},
+  16,0x352a,0,{0xed,0x75,0xf0,0x0a,0xa4,0x24,0xad,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xff},
+  16,0x353a,0,{0x7e,0x00,0x90,0x75,0x0c,0xee,0xf0,0xa3,0xef,0xf0,0x70,0x06,0x90,0x72,0x02,0x74},
+  16,0x354a,0,{0x80,0xf0,0x90,0x75,0x0c,0xe0,0xfe,0xa3,0xe0,0xff,0x64,0x80,0x4e,0x70,0x04,0x90},
+  16,0x355a,0,{0x72,0x02,0xf0,0xef,0x4e,0x70,0x02,0xc1,0x1b,0xef,0x64,0x80,0x4e,0x70,0x02,0xc1},
+  16,0x356a,0,{0x1b,0xef,0xf8,0xe4,0x90,0x75,0x0d,0xf0,0xe8,0x90,0x75,0x0c,0xf0,0xed,0x75,0xf0},
+  16,0x357a,0,{0x0a,0xa4,0x24,0xac,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xff,0x90,0x72,0x02},
+  16,0x358a,0,{0xf0,0x90,0x75,0x0d,0xe0,0x2f,0xf0,0x90,0x75,0x0c,0xe0,0x34,0x00,0xf0,0xe0,0xfe},
+  16,0x359a,0,{0xa3,0xe0,0xff,0xe4,0xfc,0xfd,0x7b,0xd6,0x7a,0xa5,0xf9,0xf8,0xd3,0x12,0x37,0x95},
+  16,0x35aa,0,{0x40,0x0a,0x90,0x75,0x0c,0x74,0xa5,0xf0,0xa3,0x74,0xd6,0xf0,0x90,0x75,0x0d,0xe0},
+  16,0x35ba,0,{0x24,0x2a,0xf0,0x90,0x75,0x0c,0xe0,0x34,0x5a,0xf0,0xe0,0xfe,0xa3,0xe0,0x78,0x05},
+  16,0x35ca,0,{0xce,0xa2,0xe7,0x13,0xce,0x13,0xd8,0xf8,0xff,0x90,0x75,0x0c,0xee,0xf0,0xa3,0xef},
+  16,0x35da,0,{0xf0,0x90,0x72,0x2c,0xee,0xf0,0xa3,0xef,0xf0,0xd3,0x94,0xd2,0xee,0x64,0x80,0x94},
+  16,0x35ea,0,{0x82,0x40,0x0a,0x90,0x72,0x2c,0x74,0x02,0xf0,0xa3,0x74,0xd2,0xf0,0xc3,0x90,0x72},
+  16,0x35fa,0,{0x2c,0xe0,0x64,0x80,0x94,0x80,0x50,0x04,0xe4,0xf0,0xa3,0xf0,0x90,0x72,0x2c,0xe0},
+  16,0x360a,0,{0xfe,0xa3,0xe0,0x24,0x3a,0xf5,0x82,0xee,0x34,0x72,0xf5,0x83,0xe0,0x90,0x72,0x02},
+  16,0x361a,0,{0xf0,0x90,0x72,0x2a,0xe0,0xff,0x24,0xfd,0x60,0x2d,0x24,0xfe,0x60,0x29,0x24,0x03},
+  16,0x362a,0,{0x24,0xfb,0x50,0x04,0x60,0x21,0x80,0x40,0x90,0x72,0x02,0xe0,0xfe,0x74,0x20,0x2f},
+  16,0x363a,0,{0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xee,0xf0,0x74,0x28,0x2f,0xf5,0x82,0xe4,0x34},
+  16,0x364a,0,{0x80,0xf5,0x83,0xee,0xf0,0x80,0x21,0x90,0x72,0x02,0xe0,0xff,0x90,0x72,0x2a,0xe0},
+  16,0x365a,0,{0xfe,0x24,0x30,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xef,0xf0,0x74,0x38,0x2e,0xf5},
+  16,0x366a,0,{0x82,0xe4,0x34,0x80,0xf5,0x83,0xef,0xf0,0x90,0x76,0x40,0xe0,0x70,0x06,0x90,0x72},
+  16,0x367a,0,{0x39,0x74,0x0a,0xf0,0x90,0x72,0x39,0xe0,0x04,0xf0,0xe0,0xc3,0x94,0x0a,0x50,0x02},
+   8,0x368a,0,{0xa1,0x11,0xe4,0x90,0x76,0x40,0xf0,0x22},
+  16,0x3692,0,{0xbb,0x01,0x06,0x89,0x82,0x8a,0x83,0xe0,0x22,0x50,0x02,0xe7,0x22,0xbb,0xfe,0x02},
+   9,0x36a2,0,{0xe3,0x22,0x89,0x82,0x8a,0x83,0xe4,0x93,0x22},
+  16,0x36ab,0,{0xbb,0x01,0x0c,0xe5,0x82,0x29,0xf5,0x82,0xe5,0x83,0x3a,0xf5,0x83,0xe0,0x22,0x50},
+  16,0x36bb,0,{0x06,0xe9,0x25,0x82,0xf8,0xe6,0x22,0xbb,0xfe,0x06,0xe9,0x25,0x82,0xf8,0xe2,0x22},
+  13,0x36cb,0,{0xe5,0x82,0x29,0xf5,0x82,0xe5,0x83,0x3a,0xf5,0x83,0xe4,0x93,0x22},
+  16,0x36d8,0,{0xc2,0xd5,0xec,0x30,0xe7,0x09,0xb2,0xd5,0xe4,0xc3,0x9d,0xfd,0xe4,0x9c,0xfc,0xee},
+  16,0x36e8,0,{0x30,0xe7,0x15,0xb2,0xd5,0xe4,0xc3,0x9f,0xff,0xe4,0x9e,0xfe,0x12,0x38,0x1f,0xc3},
+  16,0x36f8,0,{0xe4,0x9d,0xfd,0xe4,0x9c,0xfc,0x80,0x03,0x12,0x38,0x1f,0x30,0xd5,0x07,0xc3,0xe4},
+   6,0x3708,0,{0x9f,0xff,0xe4,0x9e,0xfe,0x22},
+  16,0x370e,0,{0xbb,0x01,0x10,0xe5,0x82,0x29,0xf5,0x82,0xe5,0x83,0x3a,0xf5,0x83,0xe0,0xf5,0xf0},
+  16,0x371e,0,{0xa3,0xe0,0x22,0x50,0x09,0xe9,0x25,0x82,0xf8,0x86,0xf0,0x08,0xe6,0x22,0xbb,0xfe},
+  16,0x372e,0,{0x0a,0xe9,0x25,0x82,0xf8,0xe2,0xf5,0xf0,0x08,0xe2,0x22,0xe5,0x83,0x2a,0xf5,0x83},
+   8,0x373e,0,{0xe9,0x93,0xf5,0xf0,0xa3,0xe9,0x93,0x22},
+  16,0x3746,0,{0xe8,0x8f,0xf0,0xa4,0xcc,0x8b,0xf0,0xa4,0x2c,0xfc,0xe9,0x8e,0xf0,0xa4,0x2c,0xfc},
+  16,0x3756,0,{0x8a,0xf0,0xed,0xa4,0x2c,0xfc,0xea,0x8e,0xf0,0xa4,0xcd,0xa8,0xf0,0x8b,0xf0,0xa4},
+  16,0x3766,0,{0x2d,0xcc,0x38,0x25,0xf0,0xfd,0xe9,0x8f,0xf0,0xa4,0x2c,0xcd,0x35,0xf0,0xfc,0xeb},
+  16,0x3776,0,{0x8e,0xf0,0xa4,0xfe,0xa9,0xf0,0xeb,0x8f,0xf0,0xa4,0xcf,0xc5,0xf0,0x2e,0xcd,0x39},
+  15,0x3786,0,{0xfe,0xe4,0x3c,0xfc,0xea,0xa4,0x2d,0xce,0x35,0xf0,0xfd,0xe4,0x3c,0xfc,0x22},
+  16,0x3795,0,{0xeb,0x9f,0xf5,0xf0,0xea,0x9e,0x42,0xf0,0xe9,0x9d,0x42,0xf0,0xec,0x64,0x80,0xc8},
+   6,0x37a5,0,{0x64,0x80,0x98,0x45,0xf0,0x22},
+  16,0x37ab,0,{0xeb,0x9f,0xf5,0xf0,0xea,0x9e,0x42,0xf0,0xe9,0x9d,0x42,0xf0,0xe8,0x9c,0x45,0xf0},
+   1,0x37bb,0,{0x22},
+  12,0x37bc,0,{0xec,0xf0,0xa3,0xed,0xf0,0xa3,0xee,0xf0,0xa3,0xef,0xf0,0x22},
+  16,0x37c8,0,{0xa8,0x82,0x85,0x83,0xf0,0xd0,0x83,0xd0,0x82,0x12,0x37,0xdf,0x12,0x37,0xdf,0x12},
+  16,0x37d8,0,{0x37,0xdf,0x12,0x37,0xdf,0xe4,0x73,0xe4,0x93,0xa3,0xc5,0x83,0xc5,0xf0,0xc5,0x83},
+  16,0x37e8,0,{0xc8,0xc5,0x82,0xc8,0xf0,0xa3,0xc5,0x83,0xc5,0xf0,0xc5,0x83,0xc8,0xc5,0x82,0xc8},
+   1,0x37f8,0,{0x22},
+  16,0x37f9,0,{0xd0,0x83,0xd0,0x82,0xf8,0xe4,0x93,0x70,0x12,0x74,0x01,0x93,0x70,0x0d,0xa3,0xa3},
+  16,0x3809,0,{0x93,0xf8,0x74,0x01,0x93,0xf5,0x82,0x88,0x83,0xe4,0x73,0x74,0x02,0x93,0x68,0x60},
+   6,0x3819,0,{0xef,0xa3,0xa3,0xa3,0x80,0xdf},
+  16,0x381f,0,{0xbc,0x00,0x0b,0xbe,0x00,0x29,0xef,0x8d,0xf0,0x84,0xff,0xad,0xf0,0x22,0xe4,0xcc},
+  16,0x382f,0,{0xf8,0x75,0xf0,0x08,0xef,0x2f,0xff,0xee,0x33,0xfe,0xec,0x33,0xfc,0xee,0x9d,0xec},
+  16,0x383f,0,{0x98,0x40,0x05,0xfc,0xee,0x9d,0xfe,0x0f,0xd5,0xf0,0xe9,0xe4,0xce,0xfd,0x22,0xed},
+  16,0x384f,0,{0xf8,0xf5,0xf0,0xee,0x84,0x20,0xd2,0x1c,0xfe,0xad,0xf0,0x75,0xf0,0x08,0xef,0x2f},
+  16,0x385f,0,{0xff,0xed,0x33,0xfd,0x40,0x07,0x98,0x50,0x06,0xd5,0xf0,0xf2,0x22,0xc3,0x98,0xfd},
+   5,0x386f,0,{0x0f,0xd5,0xf0,0xea,0x22},
+  16,0x3874,0,{0xe4,0x90,0x76,0x29,0xf0,0x90,0x76,0x29,0xe0,0xff,0x75,0xf0,0x0f,0xa4,0x24,0x42},
+  16,0x3884,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xec,0xe0,0xfd,0xee,0x6d},
+  16,0x3894,0,{0x60,0x0e,0xef,0xc3,0x94,0x06,0x50,0x08,0x90,0x76,0x29,0xe0,0x04,0xf0,0x80,0xd5},
+  16,0x38a4,0,{0xef,0xb4,0x06,0x08,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0xef,0x75,0xf0,0x0f},
+  16,0x38b4,0,{0xa4,0x24,0x41,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x76,0x2a,0xf0,0x24},
+  16,0x38c4,0,{0xbf,0x70,0x02,0x41,0x41,0x24,0xe0,0x70,0x02,0x41,0x12,0x24,0x21,0x60,0x02,0x41},
+  16,0x38d4,0,{0x3a,0x90,0x7f,0xe9,0xe0,0x24,0xfe,0x60,0x7d,0x14,0x70,0x02,0x21,0xb2,0x24,0x02},
+  16,0x38e4,0,{0x60,0x02,0x41,0x0a,0x12,0x17,0x51,0x90,0x76,0x42,0xe0,0xfc,0xa3,0xe0,0xfd,0xa3},
+  16,0x38f4,0,{0xe0,0xfe,0xa3,0xe0,0xff,0x90,0x76,0x29,0xe0,0x75,0xf0,0x0f,0xa4,0x24,0x43,0xf5},
+  16,0x3904,0,{0x82,0xe4,0x34,0x75,0xf5,0x83,0x12,0x37,0xbc,0x90,0x76,0x19,0xe0,0xff,0xb4,0x01},
+  16,0x3914,0,{0x12,0x90,0x76,0x7c,0x74,0x67,0xf0,0x90,0x76,0x7d,0x74,0x06,0xf0,0x90,0x76,0x7e},
+  16,0x3924,0,{0x74,0x0b,0xf0,0xef,0xb4,0x02,0x0f,0xe4,0x90,0x76,0x7c,0xf0,0x90,0x76,0x7d,0xf0},
+  16,0x3934,0,{0x90,0x76,0x7e,0x74,0x0c,0xf0,0xef,0xb4,0x03,0x0f,0xe4,0x90,0x76,0x7c,0xf0,0x90},
+  16,0x3944,0,{0x76,0x7d,0xf0,0x90,0x76,0x7e,0x74,0x18,0xf0,0x90,0x76,0x1a,0x74,0x01,0xf0,0x12},
+  16,0x3954,0,{0x3e,0x9f,0x12,0x18,0x00,0x22,0x90,0x7e,0xc2,0xe0,0xff,0xe4,0xfc,0xfd,0xfe,0xfb},
+  16,0x3964,0,{0xfa,0x79,0x01,0xf8,0x12,0x37,0x46,0xc8,0xec,0xc8,0xc9,0xed,0xc9,0xca,0xee,0xca},
+  16,0x3974,0,{0xcb,0xef,0xcb,0x90,0x7e,0xc1,0xe0,0xfe,0xe4,0xfc,0xfd,0x2b,0xfb,0xea,0x3e,0xfa},
+  16,0x3984,0,{0xed,0x39,0xf9,0xec,0x38,0xf8,0x90,0x7e,0xc0,0xe0,0xff,0xe4,0xfe,0xeb,0x2f,0xff},
+  16,0x3994,0,{0xee,0x3a,0xfe,0xed,0x39,0xfd,0xec,0x38,0xfc,0x90,0x76,0x29,0xe0,0x75,0xf0,0x0f},
+  16,0x39a4,0,{0xa4,0x24,0x47,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x12,0x37,0xbc,0x22,0x90,0x7e},
+  16,0x39b4,0,{0xc2,0xe0,0xff,0xe4,0xfc,0xfd,0xfe,0xfb,0xfa,0x79,0x01,0xf8,0x12,0x37,0x46,0xc8},
+  16,0x39c4,0,{0xec,0xc8,0xc9,0xed,0xc9,0xca,0xee,0xca,0xcb,0xef,0xcb,0x90,0x7e,0xc1,0xe0,0xfe},
+  16,0x39d4,0,{0xe4,0xfc,0xfd,0x2b,0xfb,0xea,0x3e,0xfa,0xed,0x39,0xf9,0xec,0x38,0xf8,0x90,0x7e},
+  16,0x39e4,0,{0xc0,0xe0,0xff,0xe4,0xfe,0xeb,0x2f,0xff,0xee,0x3a,0xfe,0xed,0x39,0xfd,0xec,0x38},
+  16,0x39f4,0,{0xfc,0x90,0x76,0x29,0xe0,0x75,0xf0,0x0f,0xa4,0x24,0x4b,0xf5,0x82,0xe4,0x34,0x75},
+  16,0x3a04,0,{0xf5,0x83,0x12,0x37,0xbc,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f},
+  16,0x3a14,0,{0xe9,0xe0,0x14,0x70,0x19,0x90,0x7e,0xc0,0xe0,0xff,0x90,0x76,0x29,0xe0,0x75,0xf0},
+  16,0x3a24,0,{0x0f,0xa4,0x24,0x4f,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x22,0x90,0x7f},
+  14,0x3a34,0,{0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22},
+  16,0x3a42,0,{0xe4,0x90,0x76,0x35,0xf0,0x90,0x76,0x35,0xe0,0xff,0xc3,0x94,0x03,0x40,0x02,0x41},
+  16,0x3a52,0,{0xff,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xaa,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef},
+  16,0x3a62,0,{0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xab,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe4},
+  16,0x3a72,0,{0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xac,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74},
+  16,0x3a82,0,{0xf0,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xad,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83},
+  16,0x3a92,0,{0x74,0xff,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xae,0xf5,0x82,0xe4,0x34,0x75,0xf5},
+  16,0x3aa2,0,{0x83,0xe4,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xaf,0xf5,0x82,0xe4,0x34,0x75,0xf5},
+  16,0x3ab2,0,{0x83,0x74,0x80,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xb0,0xf5,0x82,0xe4,0x34,0x75},
+  16,0x3ac2,0,{0xf5,0x83,0xe4,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xb1,0xf5,0x82,0xe4,0x34,0x75},
+  16,0x3ad2,0,{0xf5,0x83,0xe4,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xb2,0xf5,0x82,0xe4,0x34,0x75},
+  16,0x3ae2,0,{0xf5,0x83,0xe4,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xb3,0xf5,0x82,0xe4,0x34,0x75},
+  16,0x3af2,0,{0xf5,0x83,0x74,0x01,0xf0,0x90,0x76,0x35,0xe0,0x04,0xf0,0x41,0x47,0x90,0x76,0x3c},
+  16,0x3b02,0,{0x74,0x0a,0xf0,0xe4,0xa3,0xf0,0x90,0x76,0x35,0x74,0x03,0xf0,0x90,0x76,0x3c,0xe0},
+  16,0x3b12,0,{0xff,0x90,0x76,0x35,0xe0,0xfe,0xc3,0x9f,0x40,0x02,0x61,0xd2,0x90,0x76,0x3d,0xe0},
+  16,0x3b22,0,{0xff,0x04,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xaa,0xf5,0x82,0xe4,0x34,0x75,0xf5},
+  16,0x3b32,0,{0x83,0xef,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xab,0xf5,0x82,0xe4,0x34,0x75,0xf5},
+  16,0x3b42,0,{0x83,0xe4,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xac,0xf5,0x82,0xe4,0x34,0x75,0xf5},
+  16,0x3b52,0,{0x83,0x74,0x5e,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xad,0xf5,0x82,0xe4,0x34,0x75},
+  16,0x3b62,0,{0xf5,0x83,0x74,0xba,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xae,0xf5,0x82,0xe4,0x34},
+  16,0x3b72,0,{0x75,0xf5,0x83,0x74,0x05,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xaf,0xf5,0x82,0xe4},
+  16,0x3b82,0,{0x34,0x75,0xf5,0x83,0x74,0x80,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xb0,0xf5,0x82},
+  16,0x3b92,0,{0xe4,0x34,0x75,0xf5,0x83,0xe4,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xb1,0xf5,0x82},
+  16,0x3ba2,0,{0xe4,0x34,0x75,0xf5,0x83,0xe4,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xb2,0xf5,0x82},
+  16,0x3bb2,0,{0xe4,0x34,0x75,0xf5,0x83,0x74,0x15,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xb3,0xf5},
+  16,0x3bc2,0,{0x82,0xe4,0x34,0x75,0xf5,0x83,0xe4,0xf0,0x90,0x76,0x35,0xe0,0x04,0xf0,0x61,0x0e},
+   1,0x3bd2,0,{0x22},
+  16,0x3bd3,0,{0xe4,0x90,0x76,0x36,0xf0,0xe0,0xfb,0x75,0xf0,0x0f,0xa4,0x24,0x41,0xf5,0x82,0xe4},
+  16,0x3be3,0,{0x34,0x75,0xf5,0x83,0x74,0x40,0xf0,0xeb,0x75,0xf0,0x0f,0xa4,0x24,0x42,0xf5,0x82},
+  16,0x3bf3,0,{0xe4,0x34,0x75,0xf5,0x83,0x74,0x0a,0xf0,0xeb,0x75,0xf0,0x0f,0xa4,0x24,0x43,0xf5},
+  16,0x3c03,0,{0x82,0xe4,0x34,0x75,0xf5,0x83,0x12,0x37,0xc8,0x00,0x00,0xac,0x44,0xeb,0x75,0xf0},
+  16,0x3c13,0,{0x0f,0xa4,0x24,0x47,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x12,0x37,0xc8,0x00,0x00},
+  16,0x3c23,0,{0xac,0x44,0xeb,0x75,0xf0,0x0f,0xa4,0x24,0x4b,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83},
+  16,0x3c33,0,{0x12,0x37,0xc8,0x00,0x01,0x77,0x00,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xfb,0x75},
+  16,0x3c43,0,{0xf0,0x0f,0xa4,0x24,0x41,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x40,0xf0,0xeb},
+  16,0x3c53,0,{0x75,0xf0,0x0f,0xa4,0x24,0x42,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x8c,0xf0},
+  16,0x3c63,0,{0xeb,0x75,0xf0,0x0f,0xa4,0x24,0x43,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x12,0x37},
+  16,0x3c73,0,{0xc8,0x00,0x00,0xac,0x44,0xeb,0x75,0xf0,0x0f,0xa4,0x24,0x47,0xf5,0x82,0xe4,0x34},
+  16,0x3c83,0,{0x75,0xf5,0x83,0x12,0x37,0xc8,0x00,0x00,0xac,0x44,0xeb,0x75,0xf0,0x0f,0xa4,0x24},
+  16,0x3c93,0,{0x4b,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x12,0x37,0xc8,0x00,0x01,0x77,0x00,0x90},
+  16,0x3ca3,0,{0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75,0xf0,0x0f,0xa4,0x24,0x41,0xf5,0x82,0xe4},
+  16,0x3cb3,0,{0x34,0x75,0xf5,0x83,0x74,0x40,0xf0,0xef,0x75,0xf0,0x0f,0xa4,0x24,0x42,0xf5,0x82},
+  16,0x3cc3,0,{0xe4,0x34,0x75,0xf5,0x83,0x74,0x8f,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff},
+  16,0x3cd3,0,{0x75,0xf0,0x0f,0xa4,0x24,0x41,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x41,0xf0},
+  16,0x3ce3,0,{0xef,0x75,0xf0,0x0f,0xa4,0x24,0x42,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x84},
+  16,0x3cf3,0,{0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75,0xf0,0x0f,0xa4,0x24,0x41,0xf5},
+  16,0x3d03,0,{0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x61,0xf0,0xef,0x75,0xf0,0x0f,0xa4,0x24,0x42},
+  16,0x3d13,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x81,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0},
+  16,0x3d23,0,{0xe0,0xff,0x75,0xf0,0x0f,0xa4,0x24,0x41,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74},
+  16,0x3d33,0,{0x61,0xf0,0xef,0x75,0xf0,0x0f,0xa4,0x24,0x42,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83},
+   4,0x3d43,0,{0x74,0x01,0xf0,0x22},
+  16,0x3d47,0,{0xc0,0xe0,0xc0,0xf0,0xc0,0x83,0xc0,0x82,0xc0,0xd0,0xe8,0xc0,0xe0,0xe9,0xc0,0xe0},
+  16,0x3d57,0,{0xea,0xc0,0xe0,0xeb,0xc0,0xe0,0xec,0xc0,0xe0,0xed,0xc0,0xe0,0xee,0xc0,0xe0,0xef},
+  16,0x3d67,0,{0xc0,0xe0,0x90,0x7f,0xa2,0xe0,0x90,0x76,0x7f,0xf0,0x90,0x7f,0x74,0xe0,0x90,0x76},
+  16,0x3d77,0,{0x87,0xf0,0x90,0x7f,0x75,0xe0,0x90,0x76,0x88,0xf0,0x90,0x7f,0x98,0xe0,0x44,0x02},
+  16,0x3d87,0,{0xf0,0x90,0x76,0x96,0xe0,0xff,0x20,0xe1,0x0c,0x44,0x02,0xf0,0x90,0x80,0x03,0xf0},
+  16,0x3d97,0,{0xd2,0x32,0x12,0x4b,0x28,0x90,0x76,0x7f,0xe0,0x20,0xe2,0x50,0x90,0x76,0x87,0xe0},
+  16,0x3da7,0,{0xfe,0xa3,0xe0,0x7c,0x00,0x24,0x00,0xf5,0x34,0xec,0x3e,0xf5,0x33,0x90,0x76,0x98},
+  16,0x3db7,0,{0xe0,0xfd,0xae,0x33,0xaf,0x34,0x12,0x36,0xd8,0x90,0x76,0x87,0xef,0xf0,0xd2,0x2f},
+  16,0x3dc7,0,{0x30,0x31,0x29,0x20,0x3f,0x26,0xc2,0x31,0x90,0x7f,0x94,0xe0,0x54,0xcf,0xf0,0x90},
+  16,0x3dd7,0,{0x7f,0x9a,0xe0,0x30,0xe4,0x04,0xd2,0x2d,0xc2,0x2c,0x90,0x7f,0x9a,0xe0,0x20,0xe5},
+  16,0x3de7,0,{0x04,0xc2,0x2d,0xd2,0x2c,0x90,0x7f,0x94,0xe0,0x44,0x30,0xf0,0x12,0x48,0xbd,0x12},
+  16,0x3df7,0,{0x1b,0x04,0x30,0x2f,0x12,0x12,0x42,0x1f,0xc2,0x2f,0x75,0xe8,0x01,0x12,0x16,0x8a},
+  16,0x3e07,0,{0x75,0xe8,0x0d,0xd2,0x2b,0x80,0x05,0x75,0xe8,0x01,0xc2,0x2b,0x20,0x2b,0x34,0x90},
+  16,0x3e17,0,{0x76,0x19,0xe0,0xff,0xb4,0x01,0x0e,0x90,0x76,0x7c,0x74,0x67,0xf0,0xa3,0x74,0x06},
+  16,0x3e27,0,{0xf0,0xa3,0x74,0x0b,0xf0,0xef,0xb4,0x02,0x0b,0x90,0x76,0x7c,0xe4,0xf0,0xa3,0xf0},
+  16,0x3e37,0,{0xa3,0x74,0x0c,0xf0,0xef,0xb4,0x03,0x0b,0x90,0x76,0x7c,0xe4,0xf0,0xa3,0xf0,0xa3},
+  16,0x3e47,0,{0x74,0x18,0xf0,0x75,0xca,0xd3,0x75,0xcb,0xfe,0xd2,0xca,0x30,0x34,0x04,0xc2,0x34},
+  16,0x3e57,0,{0x80,0x02,0xd2,0x34,0x30,0x34,0x0d,0x90,0x76,0x89,0xe0,0xc3,0x94,0x03,0x40,0x04},
+  16,0x3e67,0,{0xe0,0x24,0xfd,0xf0,0x53,0x91,0xef,0x90,0x7f,0xab,0x74,0x02,0xf0,0xf0,0x90,0x7f},
+  16,0x3e77,0,{0x98,0xe0,0x54,0xfd,0xf0,0xd0,0xe0,0xff,0xd0,0xe0,0xfe,0xd0,0xe0,0xfd,0xd0,0xe0},
+  16,0x3e87,0,{0xfc,0xd0,0xe0,0xfb,0xd0,0xe0,0xfa,0xd0,0xe0,0xf9,0xd0,0xe0,0xf8,0xd0,0xd0,0xd0},
+   8,0x3e97,0,{0x82,0xd0,0x83,0xd0,0xf0,0xd0,0xe0,0x32},
+  16,0x3e9f,0,{0x90,0x76,0x92,0xe0,0x14,0x60,0x1d,0x14,0x70,0x02,0xe1,0x54,0x24,0x02,0x60,0x02},
+  16,0x3eaf,0,{0xe1,0xe4,0x90,0x76,0x94,0x74,0x01,0xf0,0x90,0x80,0x00,0xf0,0xe4,0x90,0x76,0x8e},
+  16,0x3ebf,0,{0xf0,0xd2,0x31,0x22,0x90,0x76,0x19,0xe0,0xff,0xb4,0x01,0x1b,0xe4,0x90,0x7f,0xf2},
+  16,0x3ecf,0,{0xf0,0x90,0x7f,0xf3,0x74,0x30,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x97},
+  16,0x3edf,0,{0xe0,0x54,0xfd,0xf0,0x54,0xfb,0xf0,0xef,0xb4,0x02,0x1b,0xe4,0x90,0x7f,0xf2,0xf0},
+  16,0x3eef,0,{0x90,0x7f,0xf3,0x74,0x34,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x97,0xe0},
+  16,0x3eff,0,{0x44,0x02,0xf0,0x54,0xfb,0xf0,0xef,0xb4,0x03,0x18,0xe4,0x90,0x7f,0xf2,0xf0,0x90},
+  16,0x3f0f,0,{0x7f,0xf3,0x74,0x64,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x97,0xe0,0x44},
+  16,0x3f1f,0,{0x04,0xf0,0x90,0x76,0x94,0xe0,0x44,0x01,0xf0,0x90,0x80,0x00,0xf0,0x30,0x3f,0x09},
+  16,0x3f2f,0,{0x90,0x76,0x97,0xe0,0x54,0xfe,0xf0,0x80,0x07,0x90,0x76,0x97,0xe0,0x44,0x01,0xf0},
+  16,0x3f3f,0,{0x90,0x76,0x97,0xe0,0x90,0x80,0x02,0xf0,0x90,0x76,0x98,0x74,0x04,0xf0,0x90,0x76},
+  16,0x3f4f,0,{0x8e,0x74,0x01,0xf0,0x22,0x90,0x76,0x19,0xe0,0xff,0xb4,0x01,0x1b,0xe4,0x90,0x7f},
+  16,0x3f5f,0,{0xf2,0xf0,0x90,0x7f,0xf3,0x74,0x44,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76},
+  16,0x3f6f,0,{0x97,0xe0,0x54,0xfd,0xf0,0x54,0xfb,0xf0,0xef,0xb4,0x02,0x1b,0xe4,0x90,0x7f,0xf2},
+  16,0x3f7f,0,{0xf0,0x90,0x7f,0xf3,0x74,0x4c,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x97},
+  16,0x3f8f,0,{0xe0,0x44,0x02,0xf0,0x54,0xfb,0xf0,0xef,0xb4,0x03,0x18,0xe4,0x90,0x7f,0xf2,0xf0},
+  16,0x3f9f,0,{0x90,0x7f,0xf3,0x74,0x94,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x97,0xe0},
+  16,0x3faf,0,{0x44,0x04,0xf0,0x90,0x76,0x94,0xe0,0x54,0xfe,0xf0,0x90,0x80,0x00,0xf0,0x30,0x3f},
+  16,0x3fbf,0,{0x09,0x90,0x76,0x97,0xe0,0x54,0xfe,0xf0,0x80,0x07,0x90,0x76,0x97,0xe0,0x44,0x01},
+  16,0x3fcf,0,{0xf0,0x90,0x76,0x97,0xe0,0x90,0x80,0x02,0xf0,0x90,0x76,0x98,0x74,0x06,0xf0,0x90},
+   6,0x3fdf,0,{0x76,0x8e,0x74,0x02,0xf0,0x22},
+  16,0x3fe5,0,{0x90,0x7f,0xea,0xe0,0x90,0x76,0x82,0xf0,0xe4,0x90,0x76,0x91,0xf0,0x90,0x76,0x92},
+  11,0x3ff5,0,{0xf0,0x90,0x76,0x90,0xf0,0x90,0x76,0x93,0xf0,0xd3,0x22},
+  16,0x4000,0,{0xe5,0x11,0xd3,0x94,0x00,0x50,0x02,0x21,0x06,0x90,0x76,0x89,0xe0,0xc3,0x94,0x08},
+  16,0x4010,0,{0x40,0x02,0x21,0x06,0x74,0x40,0x25,0x0f,0xf5,0x82,0xe4,0x34,0x7e,0xf5,0x83,0xe0},
+  16,0x4020,0,{0xf5,0x17,0xe5,0x0d,0x60,0x0e,0x90,0x80,0x05,0xe5,0x17,0xf0,0x90,0x76,0x89,0xe0},
+  16,0x4030,0,{0x04,0xf0,0x01,0xda,0xe5,0x17,0x12,0x37,0xf9,0x40,0xc1,0x02,0x40,0x67,0x05,0x40},
+  16,0x4040,0,{0x7a,0x06,0x40,0x98,0x07,0x40,0xc1,0x0c,0x40,0xc1,0x0d,0x40,0xc7,0x0f,0x40,0xcb},
+  16,0x4050,0,{0xf6,0x40,0xcb,0xf8,0x40,0xcb,0xfa,0x40,0xcb,0xfb,0x40,0xcb,0xfc,0x40,0xcb,0xfe},
+  16,0x4060,0,{0x40,0xcb,0xff,0x00,0x00,0x40,0xda,0x90,0x7e,0x41,0xe0,0x90,0x80,0x05,0xf0,0x90},
+  16,0x4070,0,{0x76,0x89,0xe0,0x04,0xf0,0x75,0x11,0x01,0x80,0x60,0x90,0x7e,0x41,0xe0,0x90,0x80},
+  16,0x4080,0,{0x05,0xf0,0x90,0x7e,0x42,0xe0,0x90,0x80,0x05,0xf0,0x90,0x76,0x89,0xe0,0x04,0xf0},
+  16,0x4090,0,{0xe0,0x04,0xf0,0x75,0x11,0x01,0x80,0x42,0x90,0x7e,0x41,0xe0,0x90,0x80,0x05,0xf0},
+  16,0x40a0,0,{0x90,0x7e,0x42,0xe0,0x90,0x80,0x05,0xf0,0x90,0x7e,0x43,0xe0,0x90,0x80,0x05,0xf0},
+  16,0x40b0,0,{0x90,0x76,0x89,0xe0,0x04,0xf0,0xe0,0x04,0xf0,0xe0,0x04,0xf0,0x75,0x11,0x01,0x80},
+  16,0x40c0,0,{0x19,0xd2,0x3b,0xd2,0x3c,0x80,0x13,0xd2,0x3b,0x80,0x0f,0x90,0x80,0x05,0xe5,0x17},
+  16,0x40d0,0,{0xf0,0x90,0x76,0x89,0xe0,0x04,0xf0,0x75,0x11,0x01,0x20,0x3b,0x04,0x05,0x0d,0x80},
+  16,0x40e0,0,{0x1f,0x30,0x3c,0x1c,0x90,0x7e,0x41,0xe0,0x90,0x80,0x05,0xf0,0x90,0x7e,0x42,0xe0},
+  16,0x40f0,0,{0x90,0x80,0x05,0xf0,0x90,0x76,0x89,0xe0,0x04,0xf0,0xe0,0x04,0xf0,0x75,0x11,0x01},
+  16,0x4100,0,{0x05,0x0f,0x15,0x11,0x01,0x00,0xe5,0x11,0x70,0x10,0xc2,0x33,0xf5,0x0d,0xf5,0x0f},
+  11,0x4110,0,{0x90,0x7f,0xc7,0x74,0x04,0xf0,0xc2,0x3b,0xc2,0x3c,0x22},
+  16,0x411b,0,{0x90,0x76,0x8d,0xe0,0x64,0x01,0x70,0x27,0x30,0x27,0x08,0xc2,0x27,0x12,0x08,0x00},
+  16,0x412b,0,{0x12,0x17,0x4a,0x30,0x28,0x08,0xc2,0x28,0x12,0x38,0x74,0x12,0x17,0x4a,0x30,0x2a},
+  16,0x413b,0,{0x0e,0xe4,0x90,0x76,0x8d,0xf0,0xc2,0x2a,0x90,0x7f,0xb4,0xe0,0x44,0x02,0xf0,0x90},
+  16,0x414b,0,{0x76,0x3f,0xe0,0xb4,0x01,0x05,0xe4,0xf0,0x12,0x32,0x6f,0x90,0x76,0x41,0xe0,0xb4},
+  16,0x415b,0,{0x01,0x05,0xe4,0xf0,0x12,0x34,0x9a,0x90,0x76,0x40,0xe0,0xb4,0x01,0x03,0x12,0x34},
+  16,0x416b,0,{0x9a,0x12,0x30,0x00,0x30,0x33,0x03,0x12,0x40,0x00,0x90,0x7f,0x9b,0xe0,0x20,0xe4},
+  16,0x417b,0,{0x02,0xc2,0x3f,0x90,0x7f,0x9b,0xe0,0x30,0xe4,0x02,0xd2,0x3f,0x90,0x7f,0x9b,0xe0},
+  16,0x418b,0,{0x20,0xe5,0x02,0xc2,0x3e,0x90,0x7f,0x9b,0xe0,0x30,0xe5,0x02,0xd2,0x3e,0xa2,0x41},
+  16,0x419b,0,{0x30,0x3f,0x01,0xb3,0x50,0x1f,0xa2,0x3f,0x92,0x41,0x30,0x3f,0x09,0x90,0x76,0x97},
+  16,0x41ab,0,{0xe0,0x54,0xfe,0xf0,0x80,0x07,0x90,0x76,0x97,0xe0,0x44,0x01,0xf0,0x90,0x76,0x97},
+  16,0x41bb,0,{0xe0,0x90,0x80,0x02,0xf0,0x30,0x3f,0x34,0x90,0x76,0x19,0xe0,0xff,0xb4,0x01,0x0e},
+  16,0x41cb,0,{0x90,0x76,0x7c,0x74,0x67,0xf0,0xa3,0x74,0x06,0xf0,0xa3,0x74,0x0b,0xf0,0xef,0xb4},
+  16,0x41db,0,{0x02,0x0b,0xe4,0x90,0x76,0x7c,0xf0,0xa3,0xf0,0xa3,0x74,0x0c,0xf0,0xef,0xb4,0x03},
+  16,0x41eb,0,{0x0b,0xe4,0x90,0x76,0x7c,0xf0,0xa3,0xf0,0xa3,0x74,0x18,0xf0,0xa2,0x40,0x30,0x3e},
+  16,0x41fb,0,{0x01,0xb3,0x50,0x1f,0xa2,0x3e,0x92,0x40,0x30,0x3e,0x09,0x90,0x76,0x95,0xe0,0x44},
+  16,0x420b,0,{0x04,0xf0,0x80,0x07,0x90,0x76,0x95,0xe0,0x54,0xfb,0xf0,0x90,0x76,0x95,0xe0,0x90},
+   4,0x421b,0,{0x80,0x01,0xf0,0x22},
+  16,0x421f,0,{0x90,0x76,0x19,0xe0,0x64,0x01,0x70,0x35,0x90,0x76,0x87,0xe0,0xff,0xd3,0x94,0x2d},
+  16,0x422f,0,{0x40,0x2b,0x90,0x76,0x86,0x74,0x01,0xf0,0x90,0x76,0x85,0xe0,0x04,0xf0,0xe0,0xd3},
+  16,0x423f,0,{0x94,0x0f,0x40,0x19,0xe4,0xf0,0xef,0xd3,0x94,0x31,0x40,0x08,0x90,0x76,0x19,0x74},
+  16,0x424f,0,{0x03,0xf0,0x80,0x06,0x90,0x76,0x19,0x74,0x02,0xf0,0x12,0x3e,0x9f,0x90,0x76,0x19},
+  16,0x425f,0,{0xe0,0xb4,0x02,0x2c,0x90,0x76,0x87,0xe0,0xff,0xc3,0x94,0x2f,0x50,0x22,0xef,0xd3},
+  16,0x426f,0,{0x94,0x2a,0x40,0x1c,0x90,0x76,0x86,0x74,0x01,0xf0,0x90,0x76,0x85,0xe0,0x04,0xf0},
+  16,0x427f,0,{0xe0,0xd3,0x94,0x0f,0x40,0x0a,0xe4,0xf0,0x90,0x76,0x19,0x04,0xf0,0x12,0x3e,0x9f},
+  16,0x428f,0,{0x90,0x76,0x19,0xe0,0xb4,0x02,0x26,0x90,0x76,0x87,0xe0,0xd3,0x94,0x31,0x40,0x1d},
+  16,0x429f,0,{0x90,0x76,0x86,0x74,0x01,0xf0,0x90,0x76,0x85,0xe0,0x04,0xf0,0xe0,0xd3,0x94,0x0f},
+  16,0x42af,0,{0x40,0x0b,0xe4,0xf0,0x90,0x76,0x19,0x74,0x03,0xf0,0x12,0x3e,0x9f,0x90,0x76,0x19},
+  16,0x42bf,0,{0xe0,0x64,0x03,0x70,0x3f,0x90,0x76,0x87,0xe0,0xff,0xc3,0x94,0x5f,0x50,0x35,0x90},
+  16,0x42cf,0,{0x76,0x86,0x74,0x01,0xf0,0x90,0x76,0x85,0xe0,0x04,0xf0,0xe0,0xd3,0x94,0x0f,0x40},
+  16,0x42df,0,{0x23,0xe4,0xf0,0xef,0xc3,0x94,0x2f,0x50,0x0c,0xef,0xd3,0x94,0x2a,0x40,0x06,0x90},
+  16,0x42ef,0,{0x76,0x19,0x74,0x01,0xf0,0xef,0xd3,0x94,0x2f,0x40,0x06,0x90,0x76,0x19,0x74,0x02},
+  16,0x42ff,0,{0xf0,0x12,0x3e,0x9f,0x90,0x76,0x86,0xe0,0x70,0x05,0x90,0x76,0x85,0xf0,0x22,0xe4},
+   5,0x430f,0,{0x90,0x76,0x86,0xf0,0x22},
+  16,0x4314,0,{0xe4,0x90,0x76,0x96,0xf0,0x90,0x80,0x03,0xf0,0x90,0x7f,0xe0,0x74,0x90,0xf0,0x90},
+  16,0x4324,0,{0x7f,0xe1,0x74,0x04,0xf0,0xe4,0x90,0x7f,0xdd,0xf0,0x90,0x7f,0xa1,0xf0,0x53,0x8e},
+  16,0x4334,0,{0xf8,0x75,0x88,0x05,0x75,0xb8,0x20,0x75,0xf8,0x01,0x43,0x8e,0x30,0xf5,0xc8,0x75},
+  16,0x4344,0,{0xca,0x7f,0x75,0xcb,0xf8,0x43,0xa8,0x20,0x12,0x45,0x65,0xc2,0x2c,0xc2,0x2d,0xc2},
+  16,0x4354,0,{0x2b,0xc2,0x2f,0x90,0x7f,0xfc,0x74,0xdd,0xf0,0x90,0x7f,0xff,0x74,0xff,0xf0,0x90},
+  16,0x4364,0,{0x7f,0x97,0xe0,0x44,0x01,0xf0,0x90,0x76,0x19,0x74,0x01,0xf0,0xe4,0x90,0x76,0x85},
+  16,0x4374,0,{0xf0,0xa3,0xf0,0x90,0x76,0x81,0xf0,0x90,0x76,0x80,0xf0,0x12,0x49,0xae,0x12,0x0f},
+  16,0x4384,0,{0xc6,0x12,0x4a,0xf1,0x90,0x7f,0x97,0xe0,0x44,0x08,0xf0,0xe0,0x54,0xb9,0xf0,0xd2},
+  16,0x4394,0,{0x30,0x20,0x30,0x18,0x12,0x4a,0xa6,0x12,0x30,0x00,0x12,0x40,0x00,0x12,0x42,0x1f},
+  16,0x43a4,0,{0x12,0x48,0xbd,0x12,0x1b,0x04,0x12,0x16,0x61,0x12,0x42,0x1f,0x12,0x4a,0xa6,0xc2},
+  16,0x43b4,0,{0x2f,0xc2,0x31,0xc2,0x32,0xc2,0x34,0xc2,0x33,0xc2,0x29,0xc2,0x27,0xc2,0x28,0xe4},
+  16,0x43c4,0,{0xf5,0x11,0x90,0x76,0x89,0xf0,0x90,0x76,0x3f,0xf0,0x90,0x76,0x41,0xf0,0x90,0x76},
+  16,0x43d4,0,{0x40,0xf0,0x90,0x76,0x8a,0xf0,0xa3,0xf0,0xa3,0x04,0xf0,0xe4,0xa3,0xf0,0x90,0x76},
+   3,0x43e4,0,{0x99,0xf0,0x22},
+  16,0x43e7,0,{0x12,0x4e,0x19,0x40,0x02,0x81,0xac,0x90,0x7f,0xeb,0xe0,0x24,0xfe,0x60,0x1e,0x14},
+  16,0x43f7,0,{0x60,0x46,0x14,0x60,0x6e,0x14,0x70,0x02,0x81,0x9d,0x24,0x04,0x60,0x02,0x81,0xa5},
+  16,0x4407,0,{0x74,0x05,0x90,0x7f,0xd4,0xf0,0x74,0x00,0x90,0x7f,0xd5,0xf0,0x22,0x90,0x7f,0xea},
+  16,0x4417,0,{0xe0,0xff,0x12,0x4a,0x55,0x8b,0x20,0x8a,0x21,0x89,0x22,0xea,0x49,0x60,0x11,0xce},
+  16,0x4427,0,{0xea,0xce,0xee,0x90,0x7f,0xd4,0xf0,0xcf,0xe9,0xcf,0xef,0x90,0x7f,0xd5,0xf0,0x22},
+  16,0x4437,0,{0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xea,0xe0,0xff,0x12,0x47,0xb7},
+  16,0x4447,0,{0x8b,0x20,0x8a,0x21,0x89,0x22,0xea,0x49,0x60,0x11,0xce,0xea,0xce,0xee,0x90,0x7f},
+  16,0x4457,0,{0xd4,0xf0,0xcf,0xe9,0xcf,0xef,0x90,0x7f,0xd5,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44},
+  16,0x4467,0,{0x01,0xf0,0x22,0x90,0x7f,0xea,0xe0,0xff,0x90,0x7e,0xc0,0xe0,0xfd,0xa3,0xe0,0xfb},
+  16,0x4477,0,{0x12,0x17,0x94,0x8b,0x20,0x8a,0x21,0x89,0x22,0xea,0x49,0x60,0x11,0xce,0xea,0xce},
+  16,0x4487,0,{0xee,0x90,0x7f,0xd4,0xf0,0xcf,0xe9,0xcf,0xef,0x90,0x7f,0xd5,0xf0,0x22,0x90,0x7f},
+  16,0x4497,0,{0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f},
+   5,0x44a7,0,{0xb4,0xe0,0x44,0x01,0xf0},
+   1,0x44ac,0,{0x22},
+  16,0x44ad,0,{0xc2,0xaf,0xd2,0x24,0x90,0x7f,0x93,0x74,0x30,0xf0,0x90,0x7f,0x9c,0x74,0xbb,0xf0},
+  16,0x44bd,0,{0x90,0x7f,0x96,0xe0,0x44,0x30,0xf0,0xe0,0x54,0x30,0xf0,0x90,0x7f,0x94,0x74,0x30},
+  16,0x44cd,0,{0xf0,0x90,0x7f,0x9d,0x74,0xcf,0xf0,0x90,0x7f,0x97,0x74,0xa0,0xf0,0x90,0x7f,0x95},
+  16,0x44dd,0,{0x74,0xc0,0xf0,0x90,0x7f,0x9e,0x74,0x03,0xf0,0x90,0x7f,0x99,0xe0,0x30,0xe2,0x09},
+  16,0x44ed,0,{0x90,0x05,0x19,0x74,0xa0,0xf0,0xe4,0xa3,0xf0,0xc2,0x25,0xc2,0x22,0xc2,0x23,0xc2},
+  16,0x44fd,0,{0x26,0x12,0x4b,0x28,0x12,0x2d,0xa9,0x12,0x3b,0xd3,0x12,0x46,0x19,0x12,0x3a,0x42},
+  16,0x450d,0,{0x90,0x76,0x68,0x74,0x01,0xf0,0x70,0x0f,0x12,0x4c,0x29,0x12,0x4e,0x15,0x12,0x4e},
+  16,0x451d,0,{0x17,0x12,0x1b,0x40,0x12,0x14,0x96,0x12,0x43,0x14,0x90,0x7f,0xaf,0xe0,0x44,0x01},
+  16,0x452d,0,{0xf0,0x90,0x7f,0xae,0xe0,0x44,0x1f,0xf0,0x90,0x7f,0xac,0x74,0xff,0xf0,0x90,0x7f},
+  16,0x453d,0,{0xad,0xf0,0x90,0x7f,0xde,0xf0,0x90,0x7f,0xdf,0xf0,0x90,0x7f,0xab,0xf0,0x90,0x7f},
+  16,0x454d,0,{0xa9,0xf0,0x90,0x7f,0xaa,0xf0,0x53,0x91,0xef,0x43,0xd8,0x20,0xd2,0xe8,0x43,0xd8},
+   8,0x455d,0,{0x20,0x53,0xa8,0xa0,0x43,0xa8,0x80,0x22},
+  16,0x4565,0,{0x90,0x76,0x9a,0x74,0x02,0xf0,0xe4,0x90,0x76,0x91,0xf0,0xa3,0xf0,0x90,0x76,0x90},
+  16,0x4575,0,{0xf0,0x90,0x76,0x93,0xf0,0x90,0x76,0x96,0x74,0x03,0xf0,0x90,0x80,0x03,0xf0,0xe4},
+  16,0x4585,0,{0x90,0x76,0x97,0xf0,0x90,0x80,0x02,0xf0,0x90,0x76,0x94,0x04,0xf0,0x90,0x80,0x00},
+  16,0x4595,0,{0xf0,0xe4,0x90,0x76,0x8e,0xf0,0x90,0x76,0x1a,0xf0,0x90,0x76,0x95,0x04,0xf0,0xc2},
+  16,0x45a5,0,{0x2e,0x90,0x7f,0x9b,0xe0,0xff,0x54,0x10,0xff,0x70,0x02,0xc2,0x3f,0x90,0x7f,0x9b},
+  16,0x45b5,0,{0xe0,0xff,0x54,0x10,0xfe,0xff,0xbe,0x10,0x02,0xd2,0x3f,0x90,0x7f,0x9b,0xe0,0xff},
+  16,0x45c5,0,{0x54,0x20,0xff,0x70,0x02,0xc2,0x3e,0x90,0x7f,0x9b,0xe0,0xff,0x54,0x20,0xfe,0xff},
+  16,0x45d5,0,{0xbe,0x20,0x02,0xd2,0x3e,0x30,0x3f,0x09,0x90,0x76,0x97,0xe0,0x54,0xfe,0xf0,0x80},
+  16,0x45e5,0,{0x07,0x90,0x76,0x97,0xe0,0x44,0x01,0xf0,0x90,0x76,0x97,0xe0,0x90,0x80,0x02,0xf0},
+  16,0x45f5,0,{0x30,0x3e,0x09,0x90,0x76,0x95,0xe0,0x44,0x04,0xf0,0x80,0x07,0x90,0x76,0x95,0xe0},
+  16,0x4605,0,{0x54,0xfb,0xf0,0x90,0x76,0x95,0xe0,0x90,0x80,0x01,0xf0,0xa2,0x3e,0x92,0x40,0xa2},
+   3,0x4615,0,{0x3f,0x92,0x41},
+   1,0x4618,0,{0x22},
+  16,0x4619,0,{0xe4,0x90,0x76,0x36,0xf0,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x32,0xf5,0x82,0xe4},
+  16,0x4629,0,{0x34,0x75,0xf5,0x83,0xe4,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x33,0xf5,0x82,0xe4},
+  16,0x4639,0,{0x34,0x75,0xf5,0x83,0x74,0x01,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75},
+  16,0x4649,0,{0xf0,0x03,0xa4,0x24,0x32,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe4,0xf0,0xef,0x75},
+  16,0x4659,0,{0xf0,0x03,0xa4,0x24,0x33,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x02,0xf0,0x90},
+  16,0x4669,0,{0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x32,0xf5,0x82,0xe4},
+  16,0x4679,0,{0x34,0x75,0xf5,0x83,0xe4,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x33,0xf5,0x82,0xe4},
+  16,0x4689,0,{0x34,0x75,0xf5,0x83,0x74,0x03,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75},
+  16,0x4699,0,{0xf0,0x03,0xa4,0x24,0x32,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe4,0xf0,0xef,0x75},
+  16,0x46a9,0,{0xf0,0x03,0xa4,0x24,0x33,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x04,0xf0,0x22},
+  12,0x46b9,0,{0x78,0x7f,0xe4,0xf6,0xd8,0xfd,0x75,0x81,0x38,0x02,0x47,0x00},
+  16,0x46c5,0,{0x02,0x07,0xa6,0xe4,0x93,0xa3,0xf8,0xe4,0x93,0xa3,0x40,0x03,0xf6,0x80,0x01,0xf2},
+  16,0x46d5,0,{0x08,0xdf,0xf4,0x80,0x29,0xe4,0x93,0xa3,0xf8,0x54,0x07,0x24,0x0c,0xc8,0xc3,0x33},
+  16,0x46e5,0,{0xc4,0x54,0x0f,0x44,0x20,0xc8,0x83,0x40,0x04,0xf4,0x56,0x80,0x01,0x46,0xf6,0xdf},
+  16,0x46f5,0,{0xe4,0x80,0x0b,0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x90,0x0c,0x8f,0xe4,0x7e},
+  16,0x4705,0,{0x01,0x93,0x60,0xbc,0xa3,0xff,0x54,0x3f,0x30,0xe5,0x09,0x54,0x1f,0xfe,0xe4,0x93},
+  16,0x4715,0,{0xa3,0x60,0x01,0x0e,0xcf,0x54,0xc0,0x25,0xe0,0x60,0xa8,0x40,0xb8,0xe4,0x93,0xa3},
+  16,0x4725,0,{0xfa,0xe4,0x93,0xa3,0xf8,0xe4,0x93,0xa3,0xc8,0xc5,0x82,0xc8,0xca,0xc5,0x83,0xca},
+  16,0x4735,0,{0xf0,0xa3,0xc8,0xc5,0x82,0xc8,0xca,0xc5,0x83,0xca,0xdf,0xe9,0xde,0xe7,0x80,0xbe},
+  16,0x4745,0,{0x90,0x7f,0xec,0xe0,0x90,0x76,0x83,0xf0,0xe0,0x14,0x60,0x1d,0x14,0x60,0x2a,0x14},
+  16,0x4755,0,{0x60,0x37,0x14,0x60,0x44,0x24,0x04,0x70,0x50,0x90,0x76,0x91,0xe0,0x90,0x7f,0x00},
+  16,0x4765,0,{0xf0,0x90,0x7f,0xb5,0x74,0x01,0xf0,0x80,0x47,0x90,0x76,0x92,0xe0,0x90,0x7f,0x00},
+  16,0x4775,0,{0xf0,0x90,0x7f,0xb5,0x74,0x01,0xf0,0x80,0x37,0x90,0x76,0x90,0xe0,0x90,0x7f,0x00},
+  16,0x4785,0,{0xf0,0x90,0x7f,0xb5,0x74,0x01,0xf0,0x80,0x27,0x90,0x76,0x84,0xe0,0x90,0x7f,0x00},
+  16,0x4795,0,{0xf0,0x90,0x7f,0xb5,0x74,0x01,0xf0,0x80,0x17,0x90,0x76,0x93,0xe0,0x90,0x7f,0x00},
+  16,0x47a5,0,{0xf0,0x90,0x7f,0xb5,0x74,0x01,0xf0,0x80,0x07,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0},
+   2,0x47b5,0,{0xd3,0x22},
+   2,0x47b7,0,{0x8f,0x2e},
+  16,0x47b9,0,{0xe4,0xf5,0x2f,0x75,0x30,0xff,0x75,0x31,0x07,0x75,0x32,0x1a,0xab,0x30,0xaa,0x31},
+  16,0x47c9,0,{0xa9,0x32,0x90,0x00,0x01,0x12,0x36,0xab,0xb4,0x03,0x1f,0xaf,0x2f,0x05,0x2f,0xef},
+  16,0x47d9,0,{0x65,0x2e,0x70,0x01,0x22,0x12,0x36,0x92,0x7e,0x00,0x29,0xff,0xee,0x3a,0xc9,0xef},
+  16,0x47e9,0,{0xc9,0x75,0x30,0xff,0xf5,0x31,0x89,0x32,0x80,0xd2,0x7b,0x00,0x7a,0x00,0x79,0x00},
+   1,0x47f9,0,{0x22},
+   6,0x47fa,0,{0x12,0x4b,0x28,0xc2,0x31,0x22},
+  16,0x4800,0,{0xc0,0xe0,0xc0,0xf0,0xc0,0x83,0xc0,0x82,0xc0,0xd0,0xe8,0xc0,0xe0,0xe9,0xc0,0xe0},
+  16,0x4810,0,{0xea,0xc0,0xe0,0xeb,0xc0,0xe0,0xec,0xc0,0xe0,0xed,0xc0,0xe0,0xee,0xc0,0xe0,0xef},
+  16,0x4820,0,{0xc0,0xe0,0xc2,0xca,0xc2,0xcf,0x90,0x7f,0x98,0xe0,0x44,0x01,0xf0,0x30,0x2e,0x03},
+  16,0x4830,0,{0x12,0x14,0xa6,0x90,0x7f,0x98,0xe0,0x54,0xfe,0xf0,0x53,0xa8,0xfa,0x12,0x16,0x61},
+  16,0x4840,0,{0xd0,0xe0,0xff,0xd0,0xe0,0xfe,0xd0,0xe0,0xfd,0xd0,0xe0,0xfc,0xd0,0xe0,0xfb,0xd0},
+  16,0x4850,0,{0xe0,0xfa,0xd0,0xe0,0xf9,0xd0,0xe0,0xf8,0xd0,0xd0,0xd0,0x82,0xd0,0x83,0xd0,0xf0},
+   3,0x4860,0,{0xd0,0xe0,0x32},
+  16,0x4863,0,{0x90,0x7f,0xec,0xe0,0x90,0x76,0x83,0xf0,0xe0,0x14,0x60,0x17,0x14,0x60,0x21,0x14},
+  16,0x4873,0,{0x60,0x2b,0x14,0x60,0x32,0x24,0x04,0x70,0x38,0x90,0x7f,0xea,0xe0,0x90,0x76,0x91},
+  16,0x4883,0,{0xf0,0x80,0x35,0x90,0x7f,0xea,0xe0,0x90,0x76,0x92,0xf0,0x12,0x3e,0x9f,0x80,0x28},
+  16,0x4893,0,{0x90,0x7f,0xea,0xe0,0x90,0x76,0x90,0xf0,0x12,0x18,0x00,0x80,0x1b,0x90,0x7f,0xea},
+  16,0x48a3,0,{0xe0,0x90,0x76,0x84,0xf0,0x80,0x11,0x90,0x7f,0xea,0xe0,0x90,0x76,0x93,0xf0,0x80},
+  10,0x48b3,0,{0x07,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0xd3,0x22},
+  16,0x48bd,0,{0x30,0x2d,0x39,0xc2,0x2d,0x90,0x76,0x19,0xe0,0xff,0xb4,0x01,0x0d,0xe4,0x90,0x76},
+  16,0x48cd,0,{0x7c,0xf0,0xa3,0x74,0xf8,0xf0,0xa3,0x74,0x0a,0xf0,0xef,0xb4,0x02,0x0d,0xe4,0x90},
+  16,0x48dd,0,{0x76,0x7c,0xf0,0xa3,0x74,0xf0,0xf0,0xa3,0x74,0x0b,0xf0,0xef,0xb4,0x03,0x0d,0xe4},
+  13,0x48ed,0,{0x90,0x76,0x7c,0xf0,0xa3,0x74,0xf8,0xf0,0xa3,0x74,0x17,0xf0,0x22},
+   6,0x48fa,0,{0x53,0x91,0xbf,0xd2,0x2d,0x32},
+  16,0x4900,0,{0x02,0x2f,0xe7,0x00,0x02,0x3d,0x47,0x00,0x02,0x4d,0xb4,0x00,0x02,0x4c,0x43,0x00},
+  16,0x4910,0,{0x02,0x4b,0xe9,0x00,0x02,0x2f,0xff,0x00,0x02,0x4c,0x5b,0x00,0x02,0x4c,0x0a,0x00},
+  16,0x4920,0,{0x02,0x4c,0x72,0x00,0x02,0x4b,0x5a,0x00,0x02,0x4c,0x89,0x00,0x02,0x4c,0xa0,0x00},
+  16,0x4930,0,{0x02,0x4c,0xb7,0x00,0x02,0x4c,0xce,0x00,0x02,0x4c,0xe5,0x00,0x02,0x4c,0xfc,0x00},
+  16,0x4940,0,{0x02,0x4d,0x13,0x00,0x02,0x4d,0x2a,0x00,0x02,0x4d,0x41,0x00,0x02,0x4d,0x58,0x00},
+   8,0x4950,0,{0x02,0x4d,0x6f,0x00,0x02,0x4d,0x86,0x00},
+  16,0x4958,0,{0xe4,0x90,0x76,0x26,0xf0,0x90,0x76,0x26,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x34},
+  16,0x4968,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xec,0xe0,0xfd,0xee,0x6d},
+  16,0x4978,0,{0x60,0x0e,0xef,0xc3,0x94,0x04,0x50,0x08,0x90,0x76,0x26,0xe0,0x04,0xf0,0x80,0xd5},
+  16,0x4988,0,{0xef,0xb4,0x04,0x08,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0xef,0x75,0xf0,0x03},
+  16,0x4998,0,{0xa4,0x24,0x32,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x7f,0x00,0xf0,0x90},
+   6,0x49a8,0,{0x7f,0xb5,0x74,0x01,0xf0,0x22},
+  16,0x49ae,0,{0x90,0x76,0x46,0x74,0x80,0xf0,0xe4,0xa3,0xf0,0xa3,0xf0,0xa3,0xf0,0xa3,0xf0,0xa3},
+  16,0x49be,0,{0xf0,0xa3,0xf0,0xa3,0xf0,0xa3,0xf0,0xa3,0x74,0x80,0xf0,0xe4,0xa3,0xf0,0xa3,0xf0},
+  16,0x49ce,0,{0xa3,0xf0,0xa3,0xf0,0xa3,0xf0,0xa3,0xf0,0xa3,0x74,0x40,0xf0,0xe4,0xa3,0xf0,0xa3},
+  16,0x49de,0,{0x74,0x40,0xf0,0xe4,0xa3,0xf0,0xa3,0xf0,0xa3,0xf0,0xa3,0xf0,0xa3,0xf0,0xa3,0xf0},
+  16,0x49ee,0,{0xa3,0x74,0x40,0xf0,0xe4,0xa3,0xf0,0xa3,0x74,0x40,0xf0,0xe4,0xa3,0xf0,0xa3,0xf0},
+   5,0x49fe,0,{0xa3,0xf0,0xa3,0xf0,0x22},
+  16,0x4a03,0,{0xe4,0x90,0x76,0x25,0xf0,0x90,0x76,0x25,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x34},
+  16,0x4a13,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xec,0xe0,0xfd,0xee,0x6d},
+  16,0x4a23,0,{0x60,0x0e,0xef,0xc3,0x94,0x04,0x50,0x08,0x90,0x76,0x25,0xe0,0x04,0xf0,0x80,0xd5},
+  16,0x4a33,0,{0xef,0xb4,0x04,0x08,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7e,0xc0,0xe0},
+  16,0x4a43,0,{0xfe,0xef,0x75,0xf0,0x03,0xa4,0x24,0x32,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xee},
+   2,0x4a53,0,{0xf0,0x22},
+  16,0x4a55,0,{0xe4,0xfe,0x75,0x1d,0xff,0x75,0x1e,0x05,0x75,0x1f,0x12,0xab,0x1d,0xaa,0x1e,0xa9},
+  16,0x4a65,0,{0x1f,0x90,0x00,0x01,0x12,0x36,0xab,0x64,0x02,0x70,0x2f,0xcd,0xee,0xcd,0x0e,0xed},
+  16,0x4a75,0,{0x6f,0x70,0x01,0x22,0x90,0x00,0x02,0x12,0x37,0x0e,0x85,0xf0,0x1b,0xf5,0x1c,0x62},
+  16,0x4a85,0,{0x1b,0xe5,0x1b,0x62,0x1c,0xe5,0x1c,0x62,0x1b,0x29,0xfd,0xe5,0x1b,0x3a,0xc9,0xed},
+  16,0x4a95,0,{0xc9,0x75,0x1d,0xff,0xf5,0x1e,0x89,0x1f,0x80,0xc1,0x7b,0x00,0x7a,0x00,0x79,0x00},
+   1,0x4aa5,0,{0x22},
+  16,0x4aa6,0,{0xe4,0x90,0x76,0x9b,0xf0,0x90,0x76,0x9b,0xe0,0xff,0x04,0xf0,0xef,0x60,0x08,0xe0},
+  16,0x4ab6,0,{0x24,0x08,0xf8,0xe4,0xf6,0x80,0xee,0x90,0x76,0x96,0xe0,0x44,0x04,0xf0,0x44,0x08},
+  16,0x4ac6,0,{0xf0,0x90,0x80,0x03,0xf0,0xe4,0xf5,0x18,0xd2,0x35,0xf5,0x0e,0xf5,0x10,0xd2,0x36},
+  16,0x4ad6,0,{0x75,0x12,0x11,0x75,0x13,0x22,0xc2,0x37,0xc2,0x39,0xc2,0x38,0xf5,0x16,0xf5,0x14},
+  11,0x4ae6,0,{0xf5,0x1a,0xf5,0x0d,0xc2,0x3b,0xc2,0x3c,0xc2,0x3d,0x22},
+  16,0x4af1,0,{0xe4,0xff,0x74,0x56,0x2f,0xf5,0x82,0xe4,0x34,0x76,0xf5,0x83,0xe0,0xfe,0x74,0x28},
+  16,0x4b01,0,{0x2f,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xee,0xf0,0x74,0x5e,0x2f,0xf5,0x82,0xe4},
+  16,0x4b11,0,{0x34,0x76,0xf5,0x83,0xe0,0xfe,0x74,0x38,0x2f,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83},
+   6,0x4b21,0,{0xee,0xf0,0x0f,0xbf,0x08,0xcc},
+   1,0x4b27,0,{0x22},
+  16,0x4b28,0,{0xe4,0x90,0x72,0x36,0xf0,0xa3,0xf0,0x90,0x7f,0x97,0xe0,0x54,0xfb,0xf0,0xe4,0x90},
+  16,0x4b38,0,{0x72,0x33,0xf0,0x90,0x72,0x32,0xf0,0x90,0x72,0x01,0x04,0xf0,0xe4,0x90,0x72,0x33},
+  16,0x4b48,0,{0xf0,0x90,0x72,0x32,0xf0,0x90,0x72,0x01,0x04,0xf0,0x90,0x7f,0x97,0xe0,0x44,0x04},
+   2,0x4b58,0,{0xf0,0x22},
+  16,0x4b5a,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xaa,0xe0,0x44,0x02,0xf0},
+  16,0x4b6a,0,{0x90,0x7f,0xc7,0xe0,0xf5,0x11,0x75,0x0f,0x00,0x75,0x0d,0x00,0xd2,0x33,0xd0,0x82},
+   5,0x4b7a,0,{0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x4b7f,0,{0x90,0x7f,0xd6,0xe0,0x54,0xfb,0xf0,0xe0,0x44,0x08,0xf0,0x30,0x42,0x04,0xe0,0x44},
+  16,0x4b8f,0,{0x02,0xf0,0x7f,0xdc,0x7e,0x05,0x12,0x4d,0x9d,0x90,0x7f,0xd6,0xe0,0x54,0xf7,0xf0},
+   5,0x4b9f,0,{0xe0,0x44,0x04,0xf0,0x22},
+  16,0x4ba4,0,{0x90,0x7f,0xeb,0xe0,0x14,0x70,0x14,0x90,0x7f,0xe9,0xe0,0x24,0x7f,0x70,0x04,0x12},
+  16,0x4bb4,0,{0x49,0x58,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44},
+   3,0x4bc4,0,{0x01,0xf0,0x22},
+  16,0x4bc7,0,{0x90,0x7f,0xeb,0xe0,0x14,0x70,0x13,0x90,0x7f,0xe9,0xe0,0x14,0x70,0x04,0x12,0x4a},
+  16,0x4bd7,0,{0x03,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01},
+   2,0x4be7,0,{0xf0,0x22},
+  16,0x4be9,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xab,0x74,0x10,0xf0,0x90},
+  16,0x4bf9,0,{0x76,0x96,0xe0,0x54,0xfd,0xf0,0x90,0x80,0x03,0xf0,0xd0,0x82,0xd0,0x83,0xd0,0xe0},
+   1,0x4c09,0,{0x32},
+  16,0x4c0a,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xaa,0xe0,0x44,0x01,0xf0},
+  15,0x4c1a,0,{0xc2,0x29,0x90,0x76,0x8d,0x74,0x01,0xf0,0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x4c29,0,{0x90,0x7f,0xd6,0xe0,0x30,0xe7,0x12,0xe0,0x44,0x01,0xf0,0x7f,0x14,0x7e,0x00,0x12},
+  10,0x4c39,0,{0x4d,0x9d,0x90,0x7f,0xd6,0xe0,0x54,0xfe,0xf0,0x22},
+  16,0x4c43,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0xd2,0x25,0x53,0x91,0xef,0x90,0x7f,0xab,0x74,0x08},
+   8,0x4c53,0,{0xf0,0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x4c5b,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xa9,0xe0,0x44,0x01,0xf0},
+   7,0x4c6b,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x4c72,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xa9,0xe0,0x44,0x02,0xf0},
+   7,0x4c82,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x4c89,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xa9,0xe0,0x44,0x04,0xf0},
+   7,0x4c99,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x4ca0,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xaa,0xe0,0x44,0x04,0xf0},
+   7,0x4cb0,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x4cb7,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xa9,0xe0,0x44,0x08,0xf0},
+   7,0x4cc7,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x4cce,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xaa,0xe0,0x44,0x08,0xf0},
+   7,0x4cde,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x4ce5,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xa9,0xe0,0x44,0x10,0xf0},
+   7,0x4cf5,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x4cfc,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xaa,0xe0,0x44,0x10,0xf0},
+   7,0x4d0c,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x4d13,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xa9,0xe0,0x44,0x20,0xf0},
+   7,0x4d23,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x4d2a,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xaa,0xe0,0x44,0x20,0xf0},
+   7,0x4d3a,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x4d41,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xa9,0xe0,0x44,0x40,0xf0},
+   7,0x4d51,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x4d58,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xaa,0xe0,0x44,0x40,0xf0},
+   7,0x4d68,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x4d6f,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xa9,0xe0,0x44,0x80,0xf0},
+   7,0x4d7f,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x4d86,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xaa,0xe0,0x44,0x80,0xf0},
+   7,0x4d96,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x4d9d,0,{0x8e,0x35,0x8f,0x36,0xe5,0x36,0x15,0x36,0xae,0x35,0x70,0x02,0x15,0x35,0x4e,0x60},
+   7,0x4dad,0,{0x05,0x12,0x14,0x85,0x80,0xee,0x22},
+  16,0x4db4,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xab,0x74,0x04,0xf0,0xd0},
+   6,0x4dc4,0,{0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x4dca,0,{0x90,0x76,0x82,0xe0,0x90,0x7f,0x00,0xf0,0x90,0x7f,0xb5,0x74,0x01,0xf0,0xd3,0x22},
+  12,0x4dda,0,{0xc2,0x37,0xe4,0xf5,0x0e,0xf5,0x10,0xc2,0x36,0xf5,0x14,0x22},
+   9,0x4de6,0,{0xc2,0x25,0x53,0xd8,0xef,0x43,0xd8,0x20,0x32},
+   7,0x4def,0,{0x53,0x98,0xfe,0x53,0x98,0xfd,0x32},
+   7,0x4df6,0,{0x53,0xc0,0xfe,0x53,0xc0,0xfd,0x32},
+   6,0x4dfd,0,{0x53,0x91,0x7f,0xd2,0x2c,0x32},
+   4,0x4e03,0,{0x53,0x91,0xdf,0x32},
+   4,0x4e07,0,{0x53,0xd8,0xf7,0x32},
+   4,0x4e0b,0,{0x12,0x17,0x30,0x22},
+   3,0x4e0f,0,{0xc2,0x8d,0x32},
+   3,0x4e12,0,{0xc2,0x8f,0x32},
+   2,0x4e15,0,{0xd3,0x22},
+   2,0x4e17,0,{0xd3,0x22},
+   2,0x4e19,0,{0xd3,0x22},
+   2,0x4e1b,0,{0xd3,0x22},
+   2,0x4e1d,0,{0xd3,0x22},
+   2,0x4e1f,0,{0xd3,0x22},
+   2,0x4e21,0,{0xc3,0x22},
+   0,0x0000,1,{0}
+};
+/* Source: EMI62MFW.HEX 
+:100C8F004176680141766A0241766B0AC120C12123
+:1044AD00C2AFD224907F937430F0907F9C74BBF098
+:1044BD00907F96E04430F0E05430F0907F9474306B
+:1044CD00F0907F9D74CFF0907F9774A0F0907F95C2
+:1044DD0074C0F0907F9E7403F0907F99E030E209F4
+:1044ED0090051974A0F0E4A3F0C225C222C223C224
+:1044FD0026124B28122DA9123BD3124619123A42FD
+:10450D009076687401F0700F124C29124E15124EF0
+:10451D0017121B40121496124314907FAFE0440102
+:10452D00F0907FAEE0441FF0907FAC74FFF0907F71
+:10453D00ADF0907FDEF0907FDFF0907FABF0907F5D
+:10454D00A9F0907FAAF05391EF43D820D2E843D839
+:08455D002053A8A043A880220E
+:1007A600E4907666F01244AD202613907666E0C398
+:1007B6009402500AE004F0D242124B7F80EA3026BF
+:1007C60005122801C22630252B907696E054FCF0BF
+:1007D600908003F0121496907696E04403F0908091
+:1007E60003F0E4907667F0907667E004F0E0B44BAF
+:0A07F600F61247FA12411B80C522DB
+:10280100C220C221C22A907FE8E01237F9283000A5
+:10281100288C0128A2022A1F212A6A22293D802907
+:102821007D8129D1822A84A12ABAA200002ABF90DF
+:102831007FE9E014601124FE602824FE603B24FC43
+:102841007040123FE541CB124E1D400241CB907FBB
+:10285100EAE0B40104C22241CB907FB4E04401F02C
+:1028610041CB124E1F907FEAE0B40104D22241CB4A
+:10287100907FB4E04401F041CB907FB4E04401F09B
+:1028810041CB907FB4E04401F041CB907FE9E0245B
+:10289100F5700512486341CB907FB4E04401F041EB
+:1028A100CB907FE9E024FD605424026002213412C0
+:1028B1004E1D400241CB907FEAE07038907FECE002
+:1028C100F45480FFC4540FFFE054072F25E024B4D3
+:1028D100F582E4347FF583E4F0907FECE05480FFEF
+:1028E100131313541FFFE054072F907FD7F0E044D8
+:1028F10020F041CB907FB4E04401F041CB124E1F58
+:10290100400241CB907FEAE07020907FECE0F454EC
+:1029110080FFC4540FFFE054072F25E024B4F58253
+:10292100E4347FF5837401F041CB907FB4E044013E
+:10293100F041CB907FB4E04401F041CB907FE9E0DE
+:10294100601224F86009240270291243E741CB1276
+:102951004DCA41CB124E1BA222E433FF25E0FFA258
+:1029610023E4334F907F00F0E4A3F0907FB574022D
+:10297100F041CB907FB4E04401F041CB907FE9E09E
+:10298100603324F6602A2404703D907FEBE024DE5E
+:10299100600C047012907FB4E04401F041CB907F51
+:1029A100B4E04401F041CB907FB4E04401F041CB6D
+:1029B10012474541CB124E1BE4907F00F0A3F090EB
+:1029C1007FB57402F041CB907FB4E04401F041CB7C
+:1029D100907FE9E024F46034240C7039124E1B908E
+:1029E1007FECE0F45480FFC4540FFFE054072F251F
+:1029F100E024B4F582E4347FF583E054FD907F0058
+:102A0100F0E4A3F0907FB57402F041CB907FB4E085
+:102A11004401F041CB907FB4E04401F041CB907F81
+:102A2100E9E024F6601214601A2402701DD220908D
+:102A31007FB4E04401F08012D220907FB4E04401E1
+:102A4100F08007907FB4E04401F0202018907FEEE1
+:102A5100E07004A3E0600BD229D22712174AD22AD0
+:102A61008003120800C2208061907FEEE07004A311
+:102A7100E0600BD229D22812174AD22A804C123890
+:102A8100748047907FE9E024FE601214601A2402EA
+:102A9100701DD221907FB4E04401F08012D22190C8
+:102AA1007FB4E04401F08007907FB4E04401F0205E
+:102AB1002103121000C2218011122AD6800C124E5D
+:102AC100215007907FB4E04401F0202A07907FB4A1
+:052AD100E04402F022C8
+:1043E700124E19400281AC907FEBE024FE601E1450
+:1043F700604614606E147002819D2404600281A5DA
+:104407007405907FD4F07400907FD5F022907FEAF6
+:10441700E0FF124A558B208A218922EA496011CE92
+:10442700EACEEE907FD4F0CFE9CFEF907FD5F022A0
+:10443700907FB4E04401F022907FEAE0FF1247B793
+:104447008B208A218922EA496011CEEACEEE907F3D
+:10445700D4F0CFE9CFEF907FD5F022907FB4E0443E
+:1044670001F022907FEAE0FF907EC0E0FDA3E0FB31
+:104477001217948B208A218922EA496011CEEACE4D
+:10448700EE907FD4F0CFE9CFEF907FD5F022907FE9
+:10449700B4E04401F022907FB4E04401F022907F21
+:0544A700B4E04401F047
+:0144AC0022ED
+:03003300024DE695
+:094DE600C22553D8EF43D8203256
+:020C9F00C12F63
+:0647FA00124B28C231221F
+:10431400E4907696F0908003F0907FE07490F090B3
+:104324007FE17404F0E4907FDDF0907FA1F0538E80
+:10433400F875880575B82075F801438E30F5C87591
+:10434400CA7F75CBF843A820124565C22CC22DC282
+:104354002BC22F907FFC74DDF0907FFF74FFF090F0
+:104364007F97E04401F09076197401F0E49076852B
+:10437400F0A3F0907681F0907680F01249AE120F9F
+:10438400C6124AF1907F97E04408F0E054B9F0D2A5
+:1043940030203018124AA612300012400012421F78
+:1043A4001248BD121B0412166112421F124AA6C201
+:1043B4002FC231C232C234C233C229C227C228E456
+:1043C400F511907689F090763FF0907641F09076F2
+:1043D40040F090768AF0A3F0A304F0E4A3F0907682
+:0343E40099F0222B
+:1048BD00302D39C22D907619E0FFB4010DE49076BC
+:1048CD007CF0A374F8F0A3740AF0EFB4020DE49039
+:1048DD00767CF0A374F0F0A3740BF0EFB4030DE449
+:0D48ED0090767CF0A374F8F0A37417F0220D
+:101B0400302C38C22C907619E0FFB4010E90767C0C
+:101B140074C0F0A37414F0A3740BF0EFB4020DE4DA
+:101B240090767CF0A37410F0A3740CF0EFB4030B64
+:0C1B3400E490767CF0A37418F0A3F0227B
+:10411B0090768DE064017027302708C227120800C3
+:10412B0012174A302808C22812387412174A302A3C
+:10413B000EE490768DF0C22A907FB4E04402F090AA
+:10414B00763FE0B40105E4F012326F907641E0B4B3
+:10415B000105E4F012349A907640E0B40103123476
+:10416B009A123000303303124000907F9BE020E422
+:10417B0002C23F907F9BE030E402D23F907F9BE0F6
+:10418B0020E502C23E907F9BE030E502D23EA24189
+:10419B00303F01B3501FA23F9241303F09907697B9
+:1041AB00E054FEF08007907697E04401F09076970C
+:1041BB00E0908002F0303F34907619E0FFB4010EAE
+:1041CB0090767C7467F0A37406F0A3740BF0EFB4D5
+:1041DB00020BE490767CF0A3F0A3740CF0EFB40325
+:1041EB000BE490767CF0A3F0A37418F0A240303E61
+:1041FB0001B3501FA23E9240303E09907695E044A9
+:10420B0004F08007907695E054FBF0907695E09063
+:04421B008001F0220C
+:024E1500D322A6
+:024E1700D322A4
+:024E1900D322A2
+:103FE500907FEAE0907682F0E4907691F090769278
+:0B3FF500F0907690F0907693F0D322CD
+:104DCA00907682E0907F00F0907FB57401F0D32254
+:10486300907FECE0907683F0E014601714602114DD
+:10487300602B14603224047038907FEAE0907691C4
+:10488300F08035907FEAE0907692F0123E9F802888
+:10489300907FEAE0907690F0121800801B907FEAF8
+:1048A300E0907684F08011907FEAE0907693F08038
+:0A48B30007907FB4E04401F0D32227
+:10474500907FECE0907683F0E014601D14602A14ED
+:10475500603714604424047050907691E0907F0097
+:10476500F0907FB57401F08047907692E0907F00DD
+:10477500F0907FB57401F08037907690E0907F00DF
+:10478500F0907FB57401F08027907684E0907F00EB
+:10479500F0907FB57401F08017907693E0907F00DC
+:1047A500F0907FB57401F08007907FB4E04401F08C
+:0247B500D3220D
+:024E1B00D322A0
+:024E1D00D3229E
+:024E1F00D3229C
+:024E2100C322AA
+:102FE700C0E0C083C082D2265391EF907FAB7401BB
+:082FF700F0D082D083D0E0325B
+:104DB400C0E0C083C0825391EF907FAB7404F0D005
+:064DC40082D083D0E03232
+:103D4700C0E0C0F0C083C082C0D0E8C0E0E9C0E0F6
+:103D5700EAC0E0EBC0E0ECC0E0EDC0E0EEC0E0EFB1
+:103D6700C0E0907FA2E090767FF0907F74E090763D
+:103D770087F0907F75E0907688F0907F98E0440216
+:103D8700F0907696E0FF20E10C4402F0908003F07B
+:103D9700D232124B2890767FE020E250907687E06F
+:103DA700FEA3E07C002400F534EC3EF533907698D2
+:103DB700E0FDAE33AF341236D8907687EFF0D22FCE
+:103DC700303129203F26C231907F94E054CFF090C4
+:103DD7007F9AE030E404D22DC22C907F9AE020E550
+:103DE70004C22DD22C907F94E04430F01248BD12CB
+:103DF7001B04302F1212421FC22F75E80112168AB8
+:103E070075E80DD22B800575E801C22B202B349065
+:103E17007619E0FFB4010E90767C7467F0A3740600
+:103E2700F0A3740BF0EFB4020B90767CE4F0A3F0F0
+:103E3700A3740CF0EFB4030B90767CE4F0A3F0A32B
+:103E47007418F075CAD375CBFED2CA303404C234A5
+:103E57008002D23430340D907689E0C39403400455
+:103E6700E024FDF05391EF907FAB7402F0F0907F68
+:103E770098E054FDF0D0E0FFD0E0FED0E0FDD0E0C8
+:103E8700FCD0E0FBD0E0FAD0E0F9D0E0F8D0D0D019
+:083E970082D083D0F0D0E032AC
+:104BE900C0E0C083C0825391EF907FAB7410F09006
+:104BF9007696E054FDF0908003F0D082D083D0E027
+:014C09003278
+:012FFF00329F
+:104C4300C0E0C083C082D2255391EF907FAB74083C
+:084C5300F0D082D083D0E032E2
+:104C5B00C0E0C083C0825391EF907FA9E04401F084
+:074C6B00D082D083D0E032BB
+:104C0A00C0E0C083C0825391EF907FAAE04401F0D4
+:0F4C1A00C22990768D7401F0D082D083D0E03221
+:104C7200C0E0C083C0825391EF907FA9E04402F06C
+:074C8200D082D083D0E032A4
+:104B5A00C0E0C083C0825391EF907FAAE04402F084
+:104B6A00907FC7E0F511750F00750D00D233D08222
+:054B7A00D083D0E03201
+:104C8900C0E0C083C0825391EF907FA9E04404F053
+:074C9900D082D083D0E0328D
+:104CA000C0E0C083C0825391EF907FAAE04404F03B
+:074CB000D082D083D0E03276
+:104CB700C0E0C083C0825391EF907FA9E04408F021
+:074CC700D082D083D0E0325F
+:104CCE00C0E0C083C0825391EF907FAAE04408F009
+:074CDE00D082D083D0E03248
+:104CE500C0E0C083C0825391EF907FA9E04410F0EB
+:074CF500D082D083D0E03231
+:104CFC00C0E0C083C0825391EF907FAAE04410F0D3
+:074D0C00D082D083D0E03219
+:104D1300C0E0C083C0825391EF907FA9E04420F0AC
+:074D2300D082D083D0E03202
+:104D2A00C0E0C083C0825391EF907FAAE04420F094
+:074D3A00D082D083D0E032EB
+:104D4100C0E0C083C0825391EF907FA9E04440F05E
+:074D5100D082D083D0E032D4
+:104D5800C0E0C083C0825391EF907FAAE04440F046
+:074D6800D082D083D0E032BD
+:104D6F00C0E0C083C0825391EF907FA9E04480F0F0
+:074D7F00D082D083D0E032A6
+:104D8600C0E0C083C0825391EF907FAAE04480F0D8
+:074D9600D082D083D0E0328F
+:10421F00907619E064017035907687E0FFD3942D86
+:10422F00402B9076867401F0907685E004F0E0D311
+:10423F00940F4019E4F0EFD394314008907619743D
+:10424F0003F080069076197402F0123E9F90761953
+:10425F00E0B4022C907687E0FFC3942F5022EFD367
+:10426F00942A401C9076867401F0907685E004F0D5
+:10427F00E0D3940F400AE4F090761904F0123E9FB9
+:10428F00907619E0B40226907687E0D39431401DE2
+:10429F009076867401F0907685E004F0E0D3940F69
+:1042AF00400BE4F09076197403F0123E9F9076194C
+:1042BF00E06403703F907687E0FFC3945F503590C2
+:1042CF0076867401F0907685E004F0E0D3940F4089
+:1042DF0023E4F0EFC3942F500CEFD3942A400690B1
+:1042EF0076197401F0EFD3942F400690761974026B
+:1042FF00F0123E9F907686E07005907685F022E46E
+:05430F00907686F0220B
+:1045650090769A7402F0E4907691F0A3F0907690AC
+:10457500F0907693F09076967403F0908003F0E4D3
+:10458500907697F0908002F090769404F0908000F9
+:10459500F0E490768EF090761AF090769504F0C25D
+:1045A5002E907F9BE0FF5410FF7002C23F907F9BCF
+:1045B500E0FF5410FEFFBE1002D23F907F9BE0FF4C
+:1045C5005420FF7002C23E907F9BE0FF5420FEFF07
+:1045D500BE2002D23E303F09907697E054FEF0802F
+:1045E50007907697E04401F0907697E0908002F08E
+:1045F500303E09907695E04404F08007907695E08A
+:1046050054FBF0907695E0908001F0A23E9240A296
+:034615003F924190
+:01461800227F
+:103E9F00907692E014601D147002E15424026002C7
+:103EAF00E1E49076947401F0908000F0E490768EC7
+:103EBF00F0D23122907619E0FFB4011BE4907FF22B
+:103ECF00F0907FF37430F0907FFF74FCF090769752
+:103EDF00E054FDF054FBF0EFB4021BE4907FF2F0DE
+:103EEF00907FF37434F0907FFF74FCF0907697E03E
+:103EFF004402F054FBF0EFB40318E4907FF2F0901B
+:103F0F007FF37464F0907FFF74FCF0907697E04439
+:103F1F0004F0907694E04401F0908000F0303F0977
+:103F2F00907697E054FEF08007907697E04401F08A
+:103F3F00907697E0908002F09076987404F09076E7
+:103F4F008E7401F022907619E0FFB4011BE4907F8C
+:103F5F00F2F0907FF37444F0907FFF74FCF0907652
+:103F6F0097E054FDF054FBF0EFB4021BE4907FF2A6
+:103F7F00F0907FF3744CF0907FFF74FCF090769785
+:103F8F00E04402F054FBF0EFB40318E4907FF2F03A
+:103F9F00907FF37494F0907FFF74FCF0907697E02D
+:103FAF004404F0907694E054FEF0908000F0303F9F
+:103FBF0009907697E054FEF08007907697E04401E1
+:103FCF00F0907697E0908002F09076987406F090DB
+:063FDF00768E7402F02250
+:10180000907690E014603714700201D814700221B1
+:1018100072147002413B240460026103907FFC74E7
+:10182000CCF0907FFF74FCF0907695E04401F0548A
+:1018300005F0908001F0E490761AF0C22E229076A6
+:1018400095E04401F04402F0303E06E04404F080AC
+:1018500007907695E054FBF090761AE0B40108907A
+:101860007695E0908001F0907619E0FFB401229027
+:101870007FFC7474F0907FFF74FCF090768F742B73
+:10188000F0907697E054FDF0E4907681F0907680C9
+:10189000F0EFB40222907FFC7468F0907FFF74FC3C
+:1018A000F090768F742FF0907697E04402F0E490F9
+:1018B0007681F0907680F0303F09907697E054FE84
+:1018C000F08007907697E04401F0907697E054FB23
+:1018D000F0908002F0D22E22907695E054FEF044F3
+:1018E00002F0303E06E04404F08007907695E05424
+:1018F000FBF090761AE0B40108907695E0908001B4
+:10190000F0907619E0FFB40122907FFC7430F090E3
+:101910007FFF74FCF090768F742BF0907697E054F4
+:10192000FDF0E4907681F0907680F0EFB4022290A2
+:101930007FFC741CF0907FFF74FCF090768F742F06
+:10194000F0907697E04402F0E4907681F090768013
+:10195000F0303F09907697E054FEF080079076973C
+:10196000E04401F0907697E054FBF0908002F0D2D2
+:101970002E22907695E04401F04402F04408F030C5
+:101980003E06E04404F08007907695E054FBF0902A
+:10199000761AE0B40108907695E0908001F0907698
+:1019A00019E0FFB40125907FFC74CCF0907FFF74A8
+:1019B000FCF090768F742BF0907697E054FDF05405
+:1019C000FBF0E4907681F0907680F0EFB402259001
+:1019D0007FFC74C8F0907FFF74FCF090768F742FBA
+:1019E000F0907697E04402F054FBF0E4907681F0BA
+:1019F000907680F0EFB40325907FFC7498F0907F90
+:101A0000FF74FCF090768F745FF0907697E054FD51
+:101A1000F04404F0E4907681F0907680F0303F0955
+:101A2000907697E054FEF08007907697E04401F0BE
+:101A3000907697E0908002F0D22E22907695E05436
+:101A4000FEF04402F04408F0303E06E04404F0802A
+:101A500007907695E054FBF090761AE0B401089078
+:101A60007695E0908001F0907619E0FFB401259022
+:101A70007FFC74B4F0907FFF74FCF090768F742B31
+:101A8000F0907697E054FDF054FBF0E4907681F00E
+:101A9000907680F0EFB40225907FFC74B0F0907FD8
+:101AA000FF74FCF090768F742FF0907697E04402EC
+:101AB000F054FBF0E4907681F0907680F0EFB40380
+:101AC00025907FFC7468F0907FFF74FCF090768F17
+:101AD000745FF0907697E054FDF04404F0E4907663
+:101AE00081F0907680F0303F09907697E054FEF0D8
+:101AF0008007907697E04401F0907697E09080021E
+:041B0000F0D22E22CF
+:040CA1004176230075
+:102DA900E4907636F0E0FF75F003A4240EF582E492
+:102DB9003475F5837401F0EF75F003A4240FF582DF
+:102DC900E43475F5837401F0EF75F003A42410F56C
+:102DD90082E43475F583E4F0907636E004F0E0FFA0
+:102DE90075F003A4240EF582E43475F5837410F0AC
+:102DF900EF75F003A4240FF582E43475F5837405A7
+:102E0900F0EF75F003A42410F582E43475F583E43A
+:102E1900F0907636E004F0E0FF75F003A4240EF597
+:102E290082E43475F5837402F0EF75F003A4240F7E
+:102E3900F582E43475F5837402F0EF75F003A42488
+:102E490010F582E43475F583E4F0907636E004F009
+:102E5900E0FF75F003A4240EF582E43475F583745C
+:102E690001F0EF75F003A4240FF582E43475F583BE
+:102E79007403F0EF75F003A42410F582E43475F5BA
+:102E890083E4F0907636E004F0E0FF75F003A424C3
+:102E99000EF582E43475F5837410F0EF75F003A430
+:102EA900240FF582E43475F5837406F0EF75F003A9
+:102EB900A42410F582E43475F583E4F0907636E0C5
+:102EC90004F0E0FF75F003A4240EF582E43475F5EF
+:102ED900837402F0EF75F003A4240FF582E43475CE
+:102EE900F5837404F0EF75F003A42410F582E4343B
+:102EF90075F583E4F0907636E004F0E0FF75F003B1
+:102F0900A4240EF582E43475F5837402F0EF75F0AC
+:102F190003A4240FF582E43475F5837408F0EF7582
+:102F2900F003A42410F582E43475F5837404F09059
+:102F39007636E004F0E0FF75F003A4240EF582E490
+:102F49003475F5837402F0EF75F003A4240FF5824C
+:102F5900E43475F583740AF0EF75F003A42410F5D1
+:102F690082E43475F5837404F0907636E004F0E079
+:102F7900FF75F003A4240EF582E43475F583740219
+:102F8900F0EF75F003A4240FF582E43475F583742A
+:102F990009F0EF75F003A42410F582E43475F58384
+:102FA9007404F0907636E004F0E0FF75F003A42491
+:102FB9000EF582E43475F5837402F0EF75F003A41D
+:102FC900240FF582E43475F5837407F0EF75F00387
+:0E2FD900A42410F582E43475F5837404F0220C
+:103BD300E4907636F0E0FB75F00FA42441F582E41F
+:103BE3003475F5837440F0EB75F00FA42442F5822D
+:103BF300E43475F583740AF0EB75F00FA42443F5F0
+:103C030082E43475F5831237C80000AC44EB75F0D9
+:103C13000FA42447F582E43475F5831237C80000F6
+:103C2300AC44EB75F00FA4244BF582E43475F583B3
+:103C33001237C800017700907636E004F0E0FB7598
+:103C4300F00FA42441F582E43475F5837440F0EB5E
+:103C530075F00FA42442F582E43475F583748CF077
+:103C6300EB75F00FA42443F582E43475F583123722
+:103C7300C80000AC44EB75F00FA42447F582E4348C
+:103C830075F5831237C80000AC44EB75F00FA4241C
+:103C93004BF582E43475F5831237C8000177009041
+:103CA3007636E004F0E0FF75F00FA42441F582E4DA
+:103CB3003475F5837440F0EF75F00FA42442F58258
+:103CC300E43475F583748FF0907636E004F0E0FF0A
+:103CD30075F00FA42441F582E43475F5837441F043
+:103CE300EF75F00FA42442F582E43475F5837484F0
+:103CF300F0907636E004F0E0FF75F00FA42441F570
+:103D030082E43475F5837461F0EF75F00FA42442F7
+:103D1300F582E43475F5837481F0907636E004F02F
+:103D2300E0FF75F00FA42441F582E43475F5837444
+:103D330061F0EF75F00FA42442F582E43475F58346
+:043D43007401F022F5
+:10461900E4907636F0E0FF75F003A42432F582E4E5
+:104629003475F583E4F0EF75F003A42433F582E4DF
+:104639003475F5837401F0907636E004F0E0FF7587
+:10464900F003A42432F582E43475F583E4F0EF75C0
+:10465900F003A42433F582E43475F5837402F090F1
+:104669007636E004F0E0FF75F003A42432F582E425
+:104679003475F583E4F0EF75F003A42433F582E48F
+:104689003475F5837403F0907636E004F0E0FF7535
+:10469900F003A42432F582E43475F583E4F0EF7570
+:1046A900F003A42433F582E43475F5837404F0220D
+:103A4200E4907635F0907635E0FFC394034002416E
+:103A5200FFEF75F00AA424AAF582E43475F583EF2A
+:103A6200F0EF75F00AA424ABF582E43475F583E433
+:103A7200F0EF75F00AA424ACF582E43475F5837492
+:103A8200F0F0EF75F00AA424ADF582E43475F58305
+:103A920074FFF0EF75F00AA424AEF582E43475F5F4
+:103AA20083E4F0EF75F00AA424AFF582E43475F5EF
+:103AB200837480F0EF75F00AA424B0F582E43475C3
+:103AC200F583E4F0EF75F00AA424B1F582E43475CD
+:103AD200F583E4F0EF75F00AA424B2F582E43475BC
+:103AE200F583E4F0EF75F00AA424B3F582E43475AB
+:103AF200F5837401F0907635E004F0414790763C0E
+:103B0200740AF0E4A3F09076357403F090763CE00A
+:103B1200FF907635E0FEC39F400261D290763DE091
+:103B2200FF04F0EE75F00AA424AAF582E43475F5D8
+:103B320083EFF0EE75F00AA424ABF582E43475F558
+:103B420083E4F0EE75F00AA424ACF582E43475F552
+:103B520083745EF0EE75F00AA424ADF582E4347548
+:103B6200F58374BAF0EE75F00AA424AEF582E4345B
+:103B720075F5837405F0EE75F00AA424AFF582E4BE
+:103B82003475F5837480F0EE75F00AA424B0F582E2
+:103B9200E43475F583E4F0EE75F00AA424B1F582FD
+:103BA200E43475F583E4F0EE75F00AA424B2F582EC
+:103BB200E43475F5837415F0EE75F00AA424B3F5B8
+:103BC20082E43475F583E4F0907635E004F0610E1A
+:013BD20022D0
+:10080000E4907631F0907631E0FF75F003A4240F88
+:10081000F582E43475F583E0FE907FEDE0FDEE6D4A
+:10082000600EEFC3940B5008907631E004F080D551
+:10083000EFB40B08907FB4E04401F022EF75F003B1
+:10084000A4240EF582E43475F583E0907633F02429
+:10085000F0600A240E60028187124BC722907FED60
+:10086000E0640570519076187405F0907637740145
+:10087000F09076397403F0907621F0E4907620F0D1
+:10088000907FEAE0F4602F907620E0FF75F00AA4F4
+:1008900024AAF582E43475F583E0FE907FEAE0FD5A
+:1008A000EE6D6012907621E0FEEFC39E50089076C8
+:1008B00020E004F080D1907FEDE0640670529076E5
+:1008C000187406F09076377404F0907639740AF054
+:1008D000907621F09076207403F0907FEAE0F46047
+:1008E0002F907620E0FF75F00AA424AAF582E43464
+:1008F00075F583E0FE907FEAE0FDEE6D6012907684
+:1009000021E0FEEFC39E5008907620E004F080D1F5
+:10091000907620E0FF75F00AA424AAF582E43475ED
+:10092000F583E0907229F0E490763BF0907621E038
+:10093000FEEF6E7008907FB4E04401F022907FEBF0
+:10094000E014601314700221E224026002817F909F
+:100950007FB4E04401F022907FE9E014707C907F46
+:10096000EAE0F47048907637E0907620F09076399F
+:10097000E0FE907620E0FDC39E502B90763BE0FE9B
+:1009800004F074C02EF582E4347EF583E0FEED754C
+:10099000F00AA424ABF582E43475F583EEF090768A
+:1009A00020E004F080C790763F7401F022907EC072
+:1009B000E0FEEF75F00AA424ABF582E43475F5830C
+:1009C000EEF0E0B4010890763E7401F08005E4900A
+:1009D000763EF090763F7401F022907FB4E04401BF
+:1009E000F022907FE9E024FE700241A314700261BE
+:1009F0003F14700261DB240360028177907FEAE09C
+:100A0000F4706B907637E0907620F0907639E0FFC6
+:100A1000907620E0FEC39F504E90763BE0FF04F0BE
+:100A200074C02FF582E4347EF583E0FFEE75F00AA2
+:100A3000A424ACF582E43475F583EFF090763BE0C6
+:100A4000FF04F074C02FF582E4347EF583E0FFEEFE
+:100A500075F00AA424ADF582E43475F583EFF090C7
+:100A60007620E004F080A49076407401F022907E1D
+:100A7000C0E0FF907620E0FE75F00AA424ACF58279
+:100A8000E43475F583EFF0907EC1E0FFEE75F00A77
+:100A9000A424ADF582E43475F583EFF090764174CB
+:100AA00001F022907FEAE0F47066907637E090766D
+:100AB00020F0907639E0FF907620E0FEC39F400260
+:100AC000818E90763BE0FF04F074C02FF582E43411
+:100AD0007EF583E0FFEE75F00AA424AEF582E434DF
+:100AE00075F583EFF090763BE0FF04F074C02FF5CE
+:100AF00082E4347EF583E0FFEE75F00AA424AFF5BE
+:100B000082E43475F583EFF0907620E004F080A263
+:100B1000907EC0E0FF907620E0FE75F00AA424AE3F
+:100B2000F582E43475F583EFF0907EC1E0FFEE7559
+:100B3000F00AA424AFF582E43475F583EFF0229037
+:100B40007FEAE0F47066907637E0907620F0907659
+:100B500039E0FF907620E0FEC39F4002818E9076C0
+:100B60003BE0FF04F074C02FF582E4347EF583E0AF
+:100B7000FFEE75F00AA424B0F582E43475F583EF36
+:100B8000F090763BE0FF04F074C02FF582E4347EF1
+:100B9000F583E0FFEE75F00AA424B1F582E4347524
+:100BA000F583EFF0907620E004F080A2907EC0E024
+:100BB000FF907620E0FE75F00AA424B0F582E434BC
+:100BC00075F583EFF0907EC1E0FFEE75F00AA42486
+:100BD000B1F582E43475F583EFF022907FEAE0F41A
+:100BE0007066907637E0907620F0907639E0FF904E
+:100BF0007620E0FEC39F4002818E90763BE0FF04AA
+:100C0000F074C02FF582E4347EF583E0FFEE75F0DA
+:100C10000AA424B2F582E43475F583EFF090763BB4
+:100C2000E0FF04F074C02FF582E4347EF583E0FF2A
+:100C3000EE75F00AA424B3F582E43475F583EFF081
+:100C4000907620E004F080A2907EC0E0FF907620B5
+:100C5000E0FE75F00AA424B2F582E43475F583EF62
+:100C6000F0907EC1E0FFEE75F00AA424B3F582E4B3
+:100C70003475F583EFF022907FB4E04401F02290C8
+:0F0C80007FB4E04401F022907FB4E04401F02201
+:10100000E490762CF090762CE0FF75F003A4240F8A
+:10101000F582E43475F583E0FE907FEDE0FDEE6D42
+:10102000600EEFC3940B500890762CE004F080D54E
+:10103000EFB40B08907FB4E04401F022EF75F003A9
+:10104000A4240EF582E43475F583E090762EF02426
+:10105000F0600A240F6002817D124BA422907FED84
+:10106000E0640570519076187405F090763874013C
+:10107000F090763A7403F090761CF0E490761BF0D2
+:10108000907FEAE0F4602F90761BE0FF75F00AA4F1
+:1010900024AAF582E43475F583E0FE907FEAE0FD52
+:1010A000EE6D601290761CE0FEEFC39E50089076C5
+:1010B0001BE004F080D1907FEDE0640670529076E2
+:1010C000187406F09076387404F090763A740AF04A
+:1010D00090761CF090761B7403F0907FEAE0F46049
+:1010E0002F90761BE0FF75F00AA424AAF582E43461
+:1010F00075F583E0FE907FEAE0FDEE6D601290767C
+:101100001CE0FEEFC39E500890761BE004F080D1F7
+:10111000E490761EF090761CE0FF90761BE0FE6F68
+:101120007008907FB4E04401F022907FEBE01460FF
+:101130001314700221BF240260028175907FB4E015
+:101140004401F022907FE9E0247F706B907FEAE019
+:10115000F4704A907638E090761BF090763AE0FF93
+:1011600090761BE0FDC39F502BED75F00AA424ABD5
+:10117000F582E43475F583E0FF90761EE0FD04F01F
+:1011800074002DF582E4347FF583EFF090761BE058
+:1011900004F080C790761EE0907FB5F022EE75F0E7
+:1011A0000AA424ABF582E43475F583E0907F00F067
+:1011B000907FB57401F022907FB4E04401F022905A
+:1011C0007FE9E0247E7002417E1470026123147076
+:1011D0000261C824036002816D907FEAE0F4706DC3
+:1011E000907638E090761BF090763AE0FF90761B90
+:1011F000E0C39F504FE0FF75F00AA424ACF582E4F1
+:101200003475F583E0FE90761EE0FD04F074002D49
+:10121000F582E4347FF583EEF0EF75F00AA424AD97
+:10122000F582E43475F583E0FF90761EE0FE04F06D
+:1012300074002EF582E4347FF583EFF090761BE0A6
+:1012400004F080A490761EE0907FB5F02290761B8B
+:10125000E0FF75F00AA424ACF582E43475F583E070
+:10126000907F00F0EF75F00AA424ADF582E43475A8
+:10127000F583E0907F01F0907FB57402F022907FBB
+:10128000EAE0F4706D907638E090761BF090763A54
+:10129000E0FF90761BE0C39F504FE0FF75F00AA47B
+:1012A00024AEF582E43475F583E0FE90761EE0FD11
+:1012B00004F074002DF582E4347FF583EEF0EF75D1
+:1012C000F00AA424AFF582E43475F583E0FF90764C
+:1012D0001EE0FE04F074002EF582E4347FF583EF07
+:1012E000F090761BE004F080A490761EE0907FB52D
+:1012F000F02290761BE0FF75F00AA424AEF582E49C
+:101300003475F583E0907F00F0EF75F00AA424AF08
+:10131000F582E43475F583E0907F01F0907FB57439
+:1013200002F022907FEAE0F4706D907638E09076DB
+:101330001BF090763AE0FF90761BE0C39F504FE0A1
+:10134000FF75F00AA424B0F582E43475F583E0FE5D
+:1013500090761EE0FD04F074002DF582E4347FF5F4
+:1013600083EEF0EF75F00AA424B1F582E43475F54C
+:1013700083E0FF90761EE0FE04F074002EF582E418
+:10138000347FF583EFF090761BE004F080A4907634
+:101390001EE0907FB5F02290761BE0FF75F00AA466
+:1013A00024B0F582E43475F583E0907F00F0EF75AA
+:1013B000F00AA424B1F582E43475F583E0907F014E
+:1013C000F0907FB57402F022907FEAE0F4706D90A7
+:1013D0007638E090761BF090763AE0FF90761BE04E
+:1013E000C39F504FE0FF75F00AA424B2F582E434A5
+:1013F00075F583E0FE90761EE0FD04F074002DF597
+:1014000082E4347FF583EEF0EF75F00AA424B3F59F
+:1014100082E43475F583E0FF90761EE0FE04F074FC
+:10142000002EF582E4347FF583EFF090761BE00424
+:10143000F080A490761EE0907FB5F02290761BE0BD
+:10144000FF75F00AA424B2F582E43475F583E090C8
+:101450007F00F0EF75F00AA424B3F582E43475F54B
+:1014600083E0907F01F0907FB57402F022907FB40A
+:10147000E04401F022907FB4E04401F022907FB478
+:05148000E04401F02230
+:10387400E4907629F0907629E0FF75F00FA42442B5
+:10388400F582E43475F583E0FE907FECE0FDEE6DA7
+:10389400600EEFC394065008907629E004F080D5BA
+:1038A400EFB40608907FB4E04401F022EF75F00F06
+:1038B400A42441F582E43475F583E090762AF0245B
+:1038C400BF7002414124E070024112242160024190
+:1038D4003A907FE9E024FE607D14700221B2240254
+:1038E4006002410A121751907642E0FCA3E0FDA366
+:1038F400E0FEA3E0FF907629E075F00FA42443F5E1
+:1039040082E43475F5831237BC907619E0FFB40174
+:103914001290767C7467F090767D7406F090767ED3
+:10392400740BF0EFB4020FE490767CF090767DF0A7
+:1039340090767E740CF0EFB4030FE490767CF090F4
+:10394400767DF090767E7418F090761A7401F012F9
+:103954003E9F12180022907EC2E0FFE4FCFDFEFBB5
+:10396400FA7901F8123746C8ECC8C9EDC9CAEECADB
+:10397400CBEFCB907EC1E0FEE4FCFD2BFBEA3EFAEC
+:10398400ED39F9EC38F8907EC0E0FFE4FEEB2FFF50
+:10399400EE3AFEED39FDEC38FC907629E075F00F37
+:1039A400A42447F582E43475F5831237BC22907E53
+:1039B400C2E0FFE4FCFDFEFBFA7901F8123746C8C9
+:1039C400ECC8C9EDC9CAEECACBEFCB907EC1E0FE0C
+:1039D400E4FCFD2BFBEA3EFAED39F9EC38F8907E75
+:1039E400C0E0FFE4FEEB2FFFEE3AFEED39FDEC38CC
+:1039F400FC907629E075F00FA4244BF582E434752D
+:103A0400F5831237BC22907FB4E04401F022907F0A
+:103A1400E9E0147019907EC0E0FF907629E075F01B
+:103A24000FA4244FF582E43475F583EFF022907FE0
+:0E3A3400B4E04401F022907FB4E04401F0229F
+:102AD600E4907627F0907627E0FF75F00FA4244265
+:102AE600F582E43475F583E0FE907FECE0FDEE6D53
+:102AF600600EEFC394065008907627E004F080D568
+:102B0600EFB40608907FB4E04401F022EF75F00FB1
+:102B1600A42441F582E43475F583E0907628F02408
+:102B26009F7002A17424216002A1A1907FE9E02494
+:102B36007E700261FC14700281B524026002A16CF1
+:102B4600EF75F00FA42443F582E43475F583E0FCB9
+:102B5600A3E0FDA3E0FEA3E0FF7B447AAC79007816
+:102B660000C31237AB7013907F007444F0A374ACAB
+:102B7600F0E4A3F0907FB57403F0907627E075F04B
+:102B86000FA42443F582E43475F583E0FCA3E0FD4D
+:102B9600A3E0FEA3E0FF7B807ABB79007800C31236
+:102BA60037AB7013907F007480F0A374BBF0E4A37E
+:102BB600F0907FB57403F0907627E075F00FA424AB
+:102BC60043F582E43475F583E0FCA3E0FDA3E0FE63
+:102BD600A3E0FF7B007A7779017800C31237AB60F8
+:102BE60002A1A8907F00F0A37477F0A37401F0907F
+:102BF6007FB57403F022907627E075F00FA4244782
+:102C0600F582E43475F583E0FCA3E0FDA3E0FEA3C2
+:102C1600E0FF7B447AAC79007800C31237AB7013BF
+:102C2600907F007444F0A374ACF0E4A3F0907FB5F9
+:102C36007403F0907627E075F00FA42447F582E43C
+:102C46003475F583E0FCA3E0FDA3E0FEA3E0FF7B83
+:102C5600807ABB79007800C31237AB7013907F007F
+:102C66007480F0A374BBF0E4A3F0907FB57403F016
+:102C7600907627E075F00FA42447F582E43475F5C5
+:102C860083E0FCA3E0FDA3E0FEA3E0FF7B007A77F0
+:102C960079017800C31237AB6002A1A8907F00F0DB
+:102CA600A37477F0A37401F0907FB57403F02290BB
+:102CB6007627E075F00FA4244BF582E43475F5838E
+:102CC600E0FCA3E0FDA3E0FEA3E0FF7B447AAC7941
+:102CD600007800C31237AB7013907F007444F0A3E2
+:102CE60074ACF0E4A3F0907FB57403F0907627E01F
+:102CF60075F00FA4244BF582E43475F583E0FCA34C
+:102D0600E0FDA3E0FEA3E0FF7B807ABB79007800BC
+:102D1600C31237AB7013907F007480F0A374BBF0BE
+:102D2600E4A3F0907FB57403F0907627E075F00F7A
+:102D3600A4244BF582E43475F583E0FCA3E0FDA3FF
+:102D4600E0FEA3E0FF7B007A7779017800C31237B3
+:102D5600AB704F907F00F0A37477F0A37401F090EE
+:102D66007FB57403F022907FB4E04401F022907F97
+:102D7600E9E0247F701E907627E075F00FA4244FBB
+:102D8600F582E43475F583E0907F00F0907FB574AA
+:102D960001F08007907FB4E04401F0907FB4E044F6
+:032DA60001F02217
+:104BA400907FEBE0147014907FE9E0247F7004128E
+:104BB400495822907FB4E04401F022907FB4E0444D
+:034BC40001F022DB
+:104BC700907FEBE0147013907FE9E0147004124AB1
+:104BD7000322907FB4E04401F022907FB4E04401C7
+:024BE700F022BA
+:10495800E4907626F0907626E0FF75F003A42434E0
+:10496800F582E43475F583E0FE907FECE0FDEE6DB2
+:10497800600EEFC394045008907626E004F080D5CA
+:10498800EFB40408907FB4E04401F022EF75F0031F
+:10499800A42432F582E43475F583E0907F00F0902A
+:0649A8007FB57401F0224E
+:104A0300E4907625F0907625E0FF75F003A4243436
+:104A1300F582E43475F583E0FE907FECE0FDEE6D06
+:104A2300600EEFC394045008907625E004F080D51F
+:104A3300EFB40408907FB4E04401F022907EC0E01C
+:104A4300FEEF75F003A42432F582E43475F583EEAA
+:024A5300F0224F
+:03000300020FFDEC
+:030FFD00C2893274
+:030013000217FDD4
+:0317FD00C28B326A
+:03004B00024E035F
+:044E03005391DF32B6
+:030053000248FA66
+:0648FA005391BFD22D32E4
+:03005B00024DFD56
+:064DFD0053917FD22C321D
+:03006300024E0743
+:044E070053D8F73253
+:03000B00024E0F93
+:034E0F00C28D321F
+:03001B00024E1280
+:034E1200C28F321A
+:03002300024DEF9C
+:074DEF005398FE5398FD32BA
+:03003B00024DF67D
+:074DF60053C0FE53C0FD3263
+:03002B0002480088
+:10480000C0E0C0F0C083C082C0D0E8C0E0E9C0E032
+:10481000EAC0E0EBC0E0ECC0E0EDC0E0EEC0E0EFED
+:10482000C0E0C2CAC2CF907F98E04401F0302E03AE
+:104830001214A6907F98E054FEF053A8FA12166165
+:10484000D0E0FFD0E0FED0E0FDD0E0FCD0E0FBD037
+:10485000E0FAD0E0F9D0E0F8D0D0D082D083D0F028
+:03486000D0E03273
+:104AA600E490769BF090769BE0FF04F0EF6008E0E0
+:104AB6002408F8E4F680EE907696E04404F0440884
+:104AC600F0908003F0E4F518D235F50EF510D236E5
+:104AD600751211751322C237C239C238F516F5148C
+:0B4AE600F51AF50DC23BC23CC23D2298
+:10300000907FB6E020E102C23DD236203602416E0A
+:10301000303D02416E908007E06004D2368002C2EB
+:1030200036203602412ED235E4F51A908004E0F5C0
+:10303000197408250EF8A619851918E51820E70453
+:10304000D2388002C23830380221D4E4F516E519AE
+:10305000B4F00CD2397508047509F0050E8002052C
+:1030600016E51964F7703DC239E50E24FE601714A9
+:103070006022240370297508057509F7E4F50AF53F
+:103080000B750E048020750806750AF7E4F50B75BC
+:103090000E048012750807750BF7750E0480071271
+:1030A0004DDA80020516E51954F864F8703BC23514
+:1030B000E5192407600C24FC6008240524F8500658
+:1030C0008008D23A8006C23A8002D23A751A0120AC
+:1030D0003A19907E80740FF0A3E519F0E4A3F0A3F1
+:1030E000F0907FB77404F08002051620396DE51961
+:1030F00064F76067E51A7063E51854F064F070597E
+:10310000851819F50EE519240F601B24FE6017249D
+:10311000FD602214601F2405702F750803050E85BD
+:103120001809D2378028750802050E85180975140C
+:1031300001D2378019750805050E851809E4F50ACE
+:10314000F50B750E03D2378005124DDAC2353035D6
+:103150000A85081385181280020516851819E516C8
+:1031600064047062F50EE51954F0F519F51585182B
+:1031700019E5152470601824F0601424F060102400
+:10318000F0601E24F0601A24F0600424607027E5CB
+:1031900015C4540FF519F508050E851809D23780A6
+:1031A0001AE515C4540FF519F508050E85180975AB
+:1031B0001401D2378005124DDAC23530350A85192F
+:1031C0001385181280020516E516D3940540571290
+:1031D0004DDA8052303917E50E700A8508097508F6
+:1031E00004050E80417408250EF8A6198038203792
+:1031F0002AE50EB4010F85080A85090B8513088599
+:103200001209750E04E514B4011C85080AE4F50BD7
+:10321000851308851209750E04800BE514B40106A8
+:10322000E4F50B750E04E4F51A303502050EE50ED3
+:10323000D394035002010BC237E4F50EF510C236E9
+:10324000D23DF51474082510F8E6FF74802510F5BA
+:1032500082E4347EF583EFF074082510F8E4F60577
+:0F32600010E510B404DE907FB77404F0010B2268
+:0C4DDA00C237E4F50EF510C236F51422C5
+:10400000E511D3940050022106907689E0C394080C
+:10401000400221067440250FF582E4347EF583E0EA
+:10402000F517E50D600E908005E517F0907689E0B4
+:1040300004F001DAE5171237F940C1024067054084
+:104040007A0640980740C10C40C10D40C70F40CBD5
+:10405000F640CBF840CBFA40CBFB40CBFC40CBFE4C
+:1040600040CBFF000040DA907E41E0908005F09068
+:104070007689E004F07511018060907E41E09080C7
+:1040800005F0907E42E0908005F0907689E004F0A3
+:10409000E004F07511018042907E41E0908005F0CF
+:1040A000907E42E0908005F0907E43E0908005F0A5
+:1040B000907689E004F0E004F0E004F075110180EE
+:1040C00019D23BD23C8013D23B800F908005E5177C
+:1040D000F0907689E004F0751101203B04050D8015
+:1040E0001F303C1C907E41E0908005F0907E42E0C5
+:1040F000908005F0907689E004F0E004F0751101FD
+:10410000050F15110100E5117010C233F50DF50F03
+:0B411000907FC77404F0C23BC23C2249
+:104C2900907FD6E030E712E04401F07F147E001255
+:0A4C39004D9D907FD6E054FEF0225E
+:104B7F00907FD6E054FBF0E04408F0304204E0446C
+:104B8F0002F07FDC7E05124D9D907FD6E054F7F04A
+:054B9F00E04404F022D7
+:104D9D008E358F36E5361536AE35700215354E60CB
+:074DAD000512148580EE22BF
+:104A5500E4FE751DFF751E05751F12AB1DAA1EA967
+:104A65001F9000011236AB6402702FCDEECD0EED16
+:104A75006F70012290000212370E85F01BF51C6243
+:104A85001BE51B621CE51C621B29FDE51B3AC9EDF4
+:104A9500C9751DFFF51E891F80C17B007A0079004D
+:014AA50022EE
+:041794008D298B2AE6
+:10179800124A55EA4960571236927E0029FFEE3AFE
+:1017A800C9EFC9752BFFF52C892DAB2BAA2CA92DB8
+:1017B8009000011236ABFF64046005EF6405702EDB
+:1017C800EFB404159000021236AB6529700B900037
+:1017D800031236AB652A7001221236927E0029FF69
+:1017E800EE3AC9EFC9752BFFF52C892D80BC7B001B
+:0417F8007A007900FA
+:0117FC0022CA
+:0247B7008F2E43
+:1047B900E4F52F7530FF75310775321AAB30AA3120
+:1047C900A9329000011236ABB4031FAF2F052FEFAA
+:1047D900652E7001221236927E0029FFEE3AC9EF4A
+:1047E900C97530FFF531893280D27B007A007900B2
+:0147F900229D
+:1005000012011001000000406A08110100010102FF
+:100510000001090208020501008032090400000000
+:10052000010100000A2401000156000201020C240E
+:10053000020101010002000000000D240605010275
+:10054000030000000000000924030204030005006A
+:100550000C24020305020006000000001524060614
+:100560000302000003000300030003000300030074
+:100570000009240304010100060009040100000130
+:100580000200000904010102010200000724010128
+:10059000000100112402010202100344AC0080BBE0
+:1005A0000000770109050A05840101008F07250174
+:1005B0000100000009058F01030001050009040185
+:1005C00002020102000007240101000100112402BF
+:1005D000010203180344AC0080BB00007701090549
+:1005E0000A05460201008F072501010000000905E8
+:1005F0008F01030001050009040200000102000050
+:1006000009040201010102000007240104000100A5
+:100610000E2402010602100244AC0080BB00090552
+:100620008C054C02010000072501000200000904AE
+:1006300002020101020000072401040001000E244F
+:1006400002010603180244AC0080BB0009058C05BA
+:1006500072030100000725010002000009040203E3
+:10066000010102000007240104000100112402011D
+:100670000202100344AC0080BB0000770109058C26
+:1006800005840101000007250100020000090402A1
+:1006900004010102000007240104000100112402EA
+:1006A000010203180344AC0080BB00007701090578
+:1006B0008C05460201000007250100020000090424
+:1006C00003000001010000092401000109000104E8
+:1006D00009040400020103000007240100012400B2
+:1006E000062402010700092403020801070100068D
+:1006F0002402020900092403010A01090100090575
+:10070000010204000000000525010107090581021E
+:100710000400000000052501010A04030904180370
+:1007200045006D006100670069006300200047001C
+:100730006D0062004800220345006D006100670003
+:1007400069006300200045004D004900200036008C
+:100750007C00320020006D002A0343006F006E0011
+:10076000660069006700750072006100740069002E
+:100770006F006E00200053007400720069006E006C
+:100780006700220349006E00740065007200660075
+:10079000610063006500200053007400720069006E
+:0607A0006E00670000007E
+:101485007400F58690FDA57C05A3E582458370F97A
+:011495002234
+:10149600907FD6E04480F0438701000000000022E0
+:1014A600C0D0C0E08FE0C0E08EE0C0E08DE0C0E0DC
+:1014B6008CE0C0E0C082C0830586C084C0857D0004
+:1014C600907FE3747BF0A37480F07C11907F99E0A9
+:1014D6005440DC030214F3B40013907FE27440F02E
+:1014E600907FE5F0907FE27400F00214D29076903F
+:1014F600E0B4011290768FE02DFD907FE27480F0CB
+:10150600907F6C021557B4021290768FE02DFD90F5
+:101516007FE27480F0907F6C021596B40312907689
+:101526008FE02DFD907FE27480F0907F6C0215E1D4
+:10153600B4041290768FE02DFD907FE27480F090D7
+:101546007F6C021610907FE27480F0907F6C02161A
+:1015560040F0F0F0F0F0F0F0F0F0F0F0F0DDF27DB9
+:10156600020586907FE27400F0907F9BE05404B4FD
+:1015760000050586021640907FE27480F00586F02D
+:10158600F0F0F0F0F0F0F0F0F0F0F0DDD4021640FC
+:10159600F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F045
+:1015A600F0F0DDEC7D020586907FE27400F0907F1E
+:1015B6009BE05404B400050586021640907FE27451
+:1015C60080F00586F0F0F0F0F0F0F0F0F0F0F0F0DA
+:0615D600F0F0F0F0F0F06F
+:1015DC00DDCE021640F0F0F0F0DDFA7D02058690CB
+:1015EC007FE27400F0907F9BE05404B40005058604
+:1015FC00021640907FE27480F00586F0F0F0F0DD8A
+:10160C00DC021640F0F0F0F0F0F0DDF87D0205861B
+:10161C00907FE27400F0907F9BE05404B4000505C9
+:10162C0086021640907FE27480F00586F0F0F0F0B0
+:10163C00F0F0DDDA907FE27400F0D085D08405867E
+:10164C00D083D082D0E0FCD0E0FDD0E0FED0E0FF33
+:05165C00D0E0D0D02217
+:10166100C0D0C0E0C082C08390767CE0907F6FF0F4
+:1016710090767DE0907F6FF090767EE0907F6FF0C6
+:09168100D083D082D0E0D0D02249
+:10168A00C0D0C0E08FE0C0E08EE0C0E0C082C0837E
+:10169A000586C084C085907687E0FFBF00030217E5
+:1016AA0001907F96E04480F0907FE27480F0907F12
+:1016BA0062E00586907FE27400F0907F96E0547FA6
+:1016CA00F0907FE27480F090768EE0B40105058692
+:1016DA000216F6B4020505860216EB05860216FB0B
+:1016EA00E0E0E0E0E0E0DFF80216FBE0E0E0E0DF67
+:1016FA00FA907FE27400F0D085D0840586D083D03A
+:0C170A0082D0E0FED0E0FFD0E0D0D02282
+:10171600C082C083C0E0E8C0E078D1E814F870FB6E
+:0A172600D0E0F8D0E0D083D082229A
+:100CA500417201014572050002C9000045720A0042
+:100CB500010203044D720FD100D1000000000000B5
+:100CC500282809004D721C010001020304050607CE
+:100CD50008090A0B41722E2241722F2341723020DE
+:100CE5004172312162D2723A00000000000000001A
+:100CF50000000000000000000000000000000000EF
+:100D050000000000000000000000000000000000DE
+:100D150000000000000000000000000000000000CE
+:100D250000000000000000000000000000000000BE
+:100D350000000000000000000000000000000000AE
+:100D4500000000000000000000000000000000009E
+:100D5500000000000000000000000000000000008E
+:100D6500000000000000000000000000000000007E
+:100D75000000000000000000000001010101010168
+:100D8500010101010101010101010101010101014E
+:100D9500010101010101010101010101010101013E
+:100DA500010101010101010101010101010101012E
+:100DB5000101010101010101020202020202020216
+:100DC50002020202020202020202020202020202FE
+:100DD50002020202020202020202020202020202EE
+:100DE50002020202020202020202020202020202DE
+:100DF50002020202020303030303030303030303C3
+:100E050003030303030303030303030303030303AD
+:100E1500030303030303030303030303030303039D
+:100E2500030303030303030303030303030303038D
+:100E3500030304040404040404040404040404046F
+:100E4500040404040404040404040404040404045D
+:100E5500040404040404040404040404040404044D
+:100E6500040404040404040404040404040404043D
+:100E7500050505050505050505050505050505051D
+:100E8500050505050505050505050505050505050D
+:100E950005050505050505050505050505050505FD
+:100EA50005050505050505050505050505050606EB
+:100EB50006060606060606060606060606060606CD
+:100EC50006060606060606060606060606060606BD
+:100ED50006060606060606060606060606060606AD
+:100EE5000606060606060606060606070707080896
+:100EF500080909090A0A0A0B0B0B0C0C0C0D0D0D40
+:100F05000E0E0E0F0F0F10101011111112121213D9
+:100F15001313141414151515161616171717181874
+:100F250018191919191A1A1A1A1B1B1B1B1C1C1C18
+:100F35001C1D1D1D1D1E1E1E1E1F1F1F1F202020C8
+:100F45002121212222222323242425252626272761
+:100F5500282829292A2A2B2B2C2C2D2D2E2E2F2FD4
+:100F65003030313132323333343435353636373744
+:100F7500383839393A3A3B3C3D3E3F40414243449B
+:100F85004546474849494A4B4B4C4D4E4F505152A7
+:100F95005354555556565757585A5B5D5E5F6162B7
+:100FA500636465666768696A6B6C6D6F717273748B
+:100FB50075767778797A7B7C7E80013701013800F8
+:104B2800E4907236F0A3F0907F97E054FBF0E490A5
+:104B38007233F0907232F090720104F0E4907233A4
+:104B4800F0907232F090720104F0907F97E0440484
+:024B5800F02249
+:10326F00907618E0FF640570429075ABE0B40119D9
+:10327F009072377401F0E4908020F0908031F090DC
+:10328F008028F0908039F08022E4907237F09075AA
+:10329F00ADE090722BF0E02480F0E0908020F09071
+:1032AF008031F0908028F0908039F0EF6406600252
+:1032BF0081999072397404F0907239E0FF24FE9076
+:1032CF007204F0EF75F00AA424ABF582E43475F5BF
+:1032DF0083E06401705490723604F0907204E0FF42
+:1032EF0024FD602824FE6024240324FB5004601C6A
+:1032FF00818C74202FF582E43480F583E4F07428F8
+:10330F002FF582E43480F583E4F0818C907204E031
+:10331F00FF2430F582E43480F583E4F074382FF520
+:10332F0082E43480F583E4F0818CE4907236F0907F
+:10333F007239E075F00AA424ADF582E43475F58393
+:10334F00E0FF7E0090750CEEF0A3EFF07006907228
+:10335F0002743BF090750CE0FEA3E0FF64804E70AA
+:10336F0004907202F0EF4E70028135EF64804E7060
+:10337F00028135EFF8E490750DF0E890750CF09040
+:10338F007234E075F00AA424ACF582E43475F58349
+:10339F00E0FF907202F090750DE02FF090750CE049
+:1033AF003400F0E0FEA3E0FFE4FCFD7BD67AA5F944
+:1033BF00F8D3123795400A90750C74A5F0A374D604
+:1033CF00F090750DE0242AF090750CE0345AF0E07F
+:1033DF00FEA3E07805CEA2E713CE13D8F8FF9075C1
+:1033EF000CEEF0A3EFF090722CEEF0A3EFF0D3946D
+:1033FF00D2EE64809482400A90722C7402F0A3740F
+:10340F00D2F0C390722CE0648094805004E4F0A357
+:10341F00F090722CE0FEA3E0243AF582EE3472F5C0
+:10342F0083E0907202F0907204E0FF24FD602D247F
+:10343F00FE6029240324FB50046021804090720217
+:10344F00E0FE74202FF582E43480F583EEF07428CB
+:10345F002FF582E43480F583EEF08021907202E044
+:10346F00FF907204E0FE2430F582E43480F583EFA0
+:10347F00F074382EF582E43480F583EFF0907239D2
+:0B348F00E004F0E0640A600241C72284
+:10349A00907618E0FFB40523907237E0701D90759E
+:1034AA00ADE090722BF0E02480F0E0908020F09064
+:1034BA008031F0908028F0908039F0EF6406600245
+:1034CA00C191907236E06002C191907640E070310D
+:1034DA009072037403F0907203E0FF75F00AA4245B
+:1034EA00AAF582E43475F583E0FE907229E0FDEED8
+:1034FA006D600EEFC3940A5008907203E004F080E6
+:10350A00D59072397404F0907640E0700890720396
+:10351A00E0907239F0907239E0FD24FE90722AF040
+:10352A00ED75F00AA424ADF582E43475F583E0FF65
+:10353A007E0090750CEEF0A3EFF0700690720274A4
+:10354A0080F090750CE0FEA3E0FF64804E7004905A
+:10355A007202F0EF4E7002C11BEF64804E7002C11E
+:10356A001BEFF8E490750DF0E890750CF0ED75F02E
+:10357A000AA424ACF582E43475F583E0FF90720264
+:10358A00F090750DE02FF090750CE03400F0E0FE3D
+:10359A00A3E0FFE4FCFD7BD67AA5F9F8D3123795B0
+:1035AA00400A90750C74A5F0A374D6F090750DE0DE
+:1035BA00242AF090750CE0345AF0E0FEA3E0780576
+:1035CA00CEA2E713CE13D8F8FF90750CEEF0A3EF56
+:1035DA00F090722CEEF0A3EFF0D394D2EE648094C4
+:1035EA0082400A90722C7402F0A374D2F0C39072D3
+:1035FA002CE0648094805004E4F0A3F090722CE0F4
+:10360A00FEA3E0243AF582EE3472F583E09072026A
+:10361A00F090722AE0FF24FD602D24FE6029240325
+:10362A0024FB500460218040907202E0FE74202F37
+:10363A00F582E43480F583EEF074282FF582E434C1
+:10364A0080F583EEF08021907202E0FF90722AE00A
+:10365A00FE2430F582E43480F583EFF074382EF5D9
+:10366A0082E43480F583EFF0907640E07006907241
+:10367A0039740AF0907239E004F0E0C3940A5002F7
+:08368A00A111E4907640F0224A
+:044E0B001217302228
+:1049AE009076467480F0E4A3F0A3F0A3F0A3F0A3F6
+:1049BE00F0A3F0A3F0A3F0A37480F0E4A3F0A3F0AF
+:1049CE00A3F0A3F0A3F0A3F0A37440F0E4A3F0A32C
+:1049DE007440F0E4A3F0A3F0A3F0A3F0A3F0A3F0CF
+:1049EE00A37440F0E4A3F0A37440F0E4A3F0A3F0AA
+:0549FE00A3F0A3F0226C
+:100FC600E4FF74462FF582E43476F583E0FE742060
+:100FD6002FF582E43480F583EEF0744E2FF582E42B
+:100FE6003476F583E0FE74302FF582E43480F583A1
+:060FF600EEF00FBF08CC75
+:010FFC0022D2
+:104AF100E4FF74562FF582E43476F583E0FE7428E2
+:104B01002FF582E43480F583EEF0745E2FF582E4B4
+:104B11003476F583E0FE74382FF582E43480F58332
+:064B2100EEF00FBF08CC0E
+:014B2700226B
+:10173000C082C083C0E0E8C0E07878E814F870FBAD
+:0A174000D0E0F8D0E0D083D0822280
+:030043000249006F
+:10490000022FE700023D4700024DB400024C430075
+:10491000024BE900022FFF00024C5B00024C0A0030
+:10492000024C7200024B5A00024C8900024CA0005B
+:10493000024CB700024CCE00024CE500024CFC00D9
+:10494000024D1300024D2A00024D4100024D580055
+:08495000024D6F00024D8600CC
+:101B40000000000000000000000000000000000095
+:101B50000000000000000000000000000000000085
+:101B60000000000000000000000000000000000075
+:101B70000000000000000000000000000000000065
+:101B80000000000000000000000000000000000055
+:101B90000000000000000000000000000000000045
+:101BA0000000000000000000000000000000000035
+:101BB0000000000000000000000000000000000025
+:101BC0000000000000000000000000000000000015
+:101BD0000000000000000000000000000000000005
+:101BE00000000000000000000000000000000000F5
+:101BF00000000000000000000000000000000000E5
+:101C000000000000000000000000000000000000D4
+:101C100000000000000000000000000000000000C4
+:101C200000000000000000000000000000000000B4
+:101C300000000000000000000000000000000000A4
+:101C40000000000000000000000000000000000094
+:101C50000000000000000000000000000000000084
+:101C60000000000000000000000000000000000074
+:101C70000000000000000000000000000000000064
+:101C80000000000000000000000000000000000054
+:101C90000000000000000000000000000000000044
+:101CA0000000000000000000000000000000000034
+:101CB0000000000000000000000000000000000024
+:101CC0000000000000000000000000000000000014
+:101CD0000000000000000000000000000000000004
+:101CE00000000000000000000000000000000000F4
+:101CF00000000000000000000000000000000000E4
+:101D000000000000000000000000000000000000D3
+:101D100000000000000000000000000000000000C3
+:101D200000000000000000000000000000000000B3
+:101D300000000000000000000000000000000000A3
+:101D40000000000000000000000000000000000093
+:101D50000000000000000000000000000000000083
+:101D60000000000000000000000000000000000073
+:101D70000000000000000000000000000000000063
+:101D80000000000000000000000000000000000053
+:101D90000000000000000000000000000000000043
+:101DA0000000000000000000000000000000000033
+:101DB0000000000000000000000000000000000023
+:101DC0000000000000000000000000000000000013
+:101DD0000000000000000000000000000000000003
+:101DE00000000000000000000000000000000000F3
+:101DF00000000000000000000000000000000000E3
+:101E000000000000000000000000000000000000D2
+:101E100000000000000000000000000000000000C2
+:101E200000000000000000000000000000000000B2
+:101E300000000000000000000000000000000000A2
+:101E40000000000000000000000000000000000092
+:101E50000000000000000000000000000000000082
+:101E60000000000000000000000000000000000072
+:101E70000000000000000000000000000000000062
+:101E80000000000000000000000000000000000052
+:101E90000000000000000000000000000000000042
+:101EA0000000000000000000000000000000000032
+:0E1EB000000000000000000000000000000024
+:101EBE000000000000000000000000000000000014
+:101ECE000000000000000000000000000000000004
+:101EDE0000000000000000000000000000000000F4
+:101EEE0000000000000000000000000000000000E4
+:101EFE0000000000000000000000000000000000D4
+:101F0E0000000000000000000000000000000000C3
+:101F1E0000000000000000000000000000000000B3
+:101F2E0000000000000000000000000000000000A3
+:021F3E000000A1
+:101F40000000000000000000000000000000000091
+:101F50000000000000000000000000000000000081
+:101F60000000000000000000000000000000000071
+:101F70000000000000000000000000000000000061
+:101F80000000000000000000000000000000000051
+:101F90000000000000000000000000000000000041
+:101FA0000000000000000000000000000000000031
+:101FB0000000000000000000000000000000000021
+:101FC0000000000000000000000000000000000011
+:101FD0000000000000000000000000000000000001
+:101FE00000000000000000000000000000000000F1
+:101FF00000000000000000000000000000000000E1
+:1020000000000000000000000000000000000000D0
+:1020100000000000000000000000000000000000C0
+:1020200000000000000000000000000000000000B0
+:1020300000000000000000000000000000000000A0
+:102040000000000000000000000000000000000090
+:102050000000000000000000000000000000000080
+:102060000000000000000000000000000000000070
+:102070000000000000000000000000000000000060
+:102080000000000000000000000000000000000050
+:102090000000000000000000000000000000000040
+:1020A0000000000000000000000000000000000030
+:1020B0000000000000000000000000000000000020
+:1020C0000000000000000000000000000000000010
+:1020D0000000000000000000000000000000000000
+:1020E00000000000000000000000000000000000F0
+:1020F00000000000000000000000000000000000E0
+:1021000000000000000000000000000000000000CF
+:1021100000000000000000000000000000000000BF
+:1021200000000000000000000000000000000000AF
+:10213000000000000000000000000000000000009F
+:10214000000000000000000000000000000000008F
+:10215000000000000000000000000000000000007F
+:10216000000000000000000000000000000000006F
+:10217000000000000000000000000000000000005F
+:10218000000000000000000000000000000000004F
+:10219000000000000000000000000000000000003F
+:1021A000000000000000000000000000000000002F
+:1021B000000000000000000000000000000000001F
+:1021C000000000000000000000000000000000000F
+:1021D00000000000000000000000000000000000FF
+:1021E00000000000000000000000000000000000EF
+:1021F00000000000000000000000000000000000DF
+:1022000000000000000000000000000000000000CE
+:1022100000000000000000000000000000000000BE
+:1022200000000000000000000000000000000000AE
+:10223000000000000000000000000000000000009E
+:10224000000000000000000000000000000000008E
+:10225000000000000000000000000000000000007E
+:10226000000000000000000000000000000000006E
+:10227000000000000000000000000000000000005E
+:10228000000000000000000000000000000000004E
+:10229000000000000000000000000000000000003E
+:1022A000000000000000000000000000000000002E
+:1022B000000000000000000000000000000000001E
+:1022C000000000000000000000000000000000000E
+:1022D00000000000000000000000000000000000FE
+:1022E00000000000000000000000000000000000EE
+:1022F00000000000000000000000000000000000DE
+:1023000000000000000000000000000000000000CD
+:1023100000000000000000000000000000000000BD
+:1023200000000000000000000000000000000000AD
+:10233000000000000000000000000000000000009D
+:10234000000000000000000000000000000000008D
+:10235000000000000000000000000000000000007D
+:10236000000000000000000000000000000000006D
+:0E23700000000000000000000000000000005F
+:10237E00000000000000000000000000000000004F
+:10238E00000000000000000000000000000000003F
+:10239E00000000000000000000000000000000002F
+:1023AE00000000000000000000000000000000001F
+:1023BE00000000000000000000000000000000000F
+:1023CE0000000000000000000000000000000000FF
+:1023DE0000000000000000000000000000000000EF
+:1023EE0000000000000000000000000000000000DF
+:1023FE0000000000000000000000000000000000CF
+:10240E0000000000000000000000000000000000BE
+:10241E0000000000000000000000000000000000AE
+:10242E00000000000000000000000000000000009E
+:10243E00000000000000000000000000000000008E
+:10244E00000000000000000000000000000000007E
+:10245E00000000000000000000000000000000006E
+:10246E00000000000000000000000000000000005E
+:10247E00000000000000000000000000000000004E
+:10248E00000000000000000000000000000000003E
+:10249E00000000000000000000000000000000002E
+:1024AE00000000000000000000000000000000001E
+:1024BE00000000000000000000000000000000000E
+:1024CE0000000000000000000000000000000000FE
+:1024DE0000000000000000000000000000000000EE
+:1024EE0000000000000000000000000000000000DE
+:1024FE0000000000000000000000000000000000CE
+:10250E0000000000000000000000000000000000BD
+:10251E0000000000000000000000000000000000AD
+:10252E00000000000000000000000000000000009D
+:10253E00000000000000000000000000000000008D
+:10254E00000000000000000000000000000000007D
+:10255E00000000000000000000000000000000006D
+:10256E00000000000000000000000000000000005D
+:10257E00000000000000000000000000000000004D
+:10258E00000000000000000000000000000000003D
+:10259E00000000000000000000000000000000002D
+:1025AE00000000000000000000000000000000001D
+:1025BE00000000000000000000000000000000000D
+:1025CE0000000000000000000000000000000000FD
+:1025DE0000000000000000000000000000000000ED
+:1025EE0000000000000000000000000000000000DD
+:1025FE0000000000000000000000000000000000CD
+:10260E0000000000000000000000000000000000BC
+:10261E0000000000000000000000000000000000AC
+:10262E00000000000000000000000000000000009C
+:10263E00000000000000000000000000000000008C
+:10264E00000000000000000000000000000000007C
+:10265E00000000000000000000000000000000006C
+:10266E00000000000000000000000000000000005C
+:10267E00000000000000000000000000000000004C
+:10268E00000000000000000000000000000000003C
+:10269E00000000000000000000000000000000002C
+:1026AE00000000000000000000000000000000001C
+:1026BE00000000000000000000000000000000000C
+:1026CE0000000000000000000000000000000000FC
+:1026DE0000000000000000000000000000000000EC
+:0E26EE000000000000000000000000000000DE
+:1026FC0000000000000000000000000000000000CE
+:10270C0000000000000000000000000000000000BD
+:10271C0000000000000000000000000000000000AD
+:10272C00000000000000000000000000000000009D
+:10273C00000000000000000000000000000000008D
+:10274C00000000000000000000000000000000007D
+:10275C00000000000000000000000000000000006D
+:10276C00000000000000000000000000000000005D
+:10277C00000000000000000000000000000000004D
+:10278C00000000000000000000000000000000003D
+:10279C00000000000000000000000000000000002D
+:1027AC00000000000000000000000000000000001D
+:1027BC00000000000000000000000000000000000D
+:1027CC0000000000000000000000000000000000FD
+:1027DC0000000000000000000000000000000000ED
+:1027EC0000000000000000000000000000000000DD
+:0527FC000000000022B6
+:07174A00907FC57402F0223C
+:10175100907EC0E0907645F0907EC1E0907644F0B6
+:10176100907EC2E0907643F0B40003021778907641
+:10177100197403F002178E907644E0B4BB09907699
+:10178100197402F002178E9076197401F090764266
+:03179100E4F0225F
+:030000000246B9FC
+:0C46B900787FE4F6D8FD758138024700D8
+:10369200BB010689828A83E0225002E722BBFE0236
+:0936A200E32289828A83E4932269
+:1036AB00BB010CE58229F582E5833AF583E02250D4
+:1036BB0006E92582F8E622BBFE06E92582F8E2221E
+:0D36CB00E58229F582E5833AF583E4932238
+:1036D800C2D5EC30E709B2D5E4C39DFDE49CFCEE0D
+:1036E80030E715B2D5E4C39FFFE49EFE12381FC32E
+:1036F800E49DFDE49CFC800312381F30D507C3E429
+:063708009FFFE49EFE227B
+:10370E00BB0110E58229F582E5833AF583E0F5F0F9
+:10371E00A3E0225009E92582F886F008E622BBFED6
+:10372E000AE92582F8E2F5F008E222E5832AF5831C
+:08373E00E993F5F0A3E99322E1
+:10374600E88FF0A4CC8BF0A42CFCE98EF0A42CFC22
+:103756008AF0EDA42CFCEA8EF0A4CDA8F08BF0A4A0
+:103766002DCC3825F0FDE98FF0A42CCD35F0FCEBFF
+:103776008EF0A4FEA9F0EB8FF0A4CFC5F02ECD39C4
+:0F378600FEE43CFCEAA42DCE35F0FDE43CFC2231
+:10379500EB9FF5F0EA9E42F0E99D42F0EC6480C8AB
+:0637A50064809845F0224B
+:1037AB00EB9FF5F0EA9E42F0E99D42F0E89C45F074
+:0137BB0022EB
+:0C37BC00ECF0A3EDF0A3EEF0A3EFF02280
+:1037C800A8828583F0D083D0821237DF1237DF12C8
+:1037D80037DF1237DFE473E493A3C583C5F0C583ED
+:1037E800C8C582C8F0A3C583C5F0C583C8C582C84B
+:0137F80022AE
+:1037F900D083D082F8E4937012740193700DA3A35F
+:1038090093F8740193F5828883E473740293686072
+:06381900EFA3A3A380DF72
+:1046C5000207A6E493A3F8E493A34003F68001F25E
+:1046D50008DFF48029E493A3F85407240CC8C333F6
+:1046E500C4540F4420C8834004F456800146F6DFC5
+:1046F500E4800B0102040810204080900C8FE47EBA
+:10470500019360BCA3FF543F30E509541FFEE493B9
+:10471500A360010ECF54C025E060A840B8E493A380
+:10472500FAE493A3F8E493A3C8C582C8CAC583CAAB
+:10473500F0A3C8C582C8CAC583CADFE9DEE780BE63
+:010FC500002B
+:10381F00BC000BBE0029EF8DF084FFADF022E4CC8D
+:10382F00F875F008EF2FFFEE33FEEC33FCEE9DEC56
+:10383F00984005FCEE9DFE0FD5F0E9E4CEFD22ED9C
+:10384F00F8F5F0EE8420D21CFEADF075F008EF2FE6
+:10385F00FFED33FD4007985006D5F0F222C398FDD7
+:05386F000FD5F0EA2274
+:00000001FF
+/*
+VERSION=1.04.062
+DATE=16.10.2002  
+*/INTEL_HEX_RECORD g_emi62_loader[] = {
+   3,0x0000,0,{0x02,0x02,0x87},
+   3,0x0043,0,{0x02,0x04,0x00},
+  16,0x0100,0,{0xe4,0xff,0xfe,0xc2,0x20,0xd2,0xe8,0x43,0xd8,0x20,0x90,0x7f,0xab,0x74,0xff,0xf0},
+  16,0x0110,0,{0x90,0x7f,0xa9,0xf0,0x90,0x7f,0xaa,0xf0,0x53,0x91,0xef,0x90,0x7f,0x95,0x74,0xc0},
+  16,0x0120,0,{0xf0,0x90,0x7f,0x9e,0xf0,0x90,0x7f,0x98,0xf0,0xe4,0x90,0x7f,0x94,0xf0,0x90,0x7f},
+  16,0x0130,0,{0x9d,0x74,0xff,0xf0,0x90,0x7f,0x97,0x74,0xa0,0xf0,0x90,0x7f,0x93,0xe0,0x54,0xfc},
+  16,0x0140,0,{0xf0,0x90,0x7f,0x9c,0x74,0x03,0xf0,0xe4,0x90,0x7f,0x96,0xf0,0x90,0x7f,0xaf,0xe0},
+  16,0x0150,0,{0x44,0x01,0xf0,0x90,0x7f,0xae,0xe0,0x44,0x0d,0xf0,0xd2,0xaf,0x0f,0xbf,0x00,0x01},
+  16,0x0160,0,{0x0e,0xbe,0x07,0xf8,0xbf,0x08,0xf5,0x20,0x20,0x42,0x75,0x14,0x00,0x75,0x13,0x00},
+  16,0x0170,0,{0x75,0x12,0x00,0x75,0x11,0x00,0x7f,0x48,0x7e,0x92,0x7d,0x00,0x7c,0x00,0xab,0x14},
+  16,0x0180,0,{0xaa,0x13,0xa9,0x12,0xa8,0x11,0xc3,0x12,0x03,0xed,0x50,0xdb,0x20,0x20,0xd8,0x7a},
+  16,0x0190,0,{0x00,0x79,0x00,0x78,0x00,0xe5,0x14,0x24,0x01,0xf5,0x14,0xea,0x35,0x13,0xf5,0x13},
+  16,0x01a0,0,{0xe9,0x35,0x12,0xf5,0x12,0xe8,0x35,0x11,0xf5,0x11,0x80,0xca,0x30,0x20,0xfd,0x12},
+  16,0x01b0,0,{0x01,0xc7,0x50,0x07,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x90,0x7f,0xb4,0xe0,0x44},
+   6,0x01c0,0,{0x02,0xf0,0xc2,0x20,0x80,0xe6},
+   1,0x01c6,0,{0x22},
+  16,0x01c7,0,{0x90,0x7f,0xe9,0xe0,0x24,0x5b,0x60,0x60,0x24,0x02,0x60,0x03,0x02,0x02,0x85,0x90},
+  16,0x01d7,0,{0x7f,0xea,0xe0,0x75,0x0a,0x00,0xf5,0x0b,0xa3,0xe0,0xfe,0xe4,0xee,0x42,0x0a,0x90},
+  16,0x01e7,0,{0x7f,0xee,0xe0,0x75,0x15,0x00,0xf5,0x16,0xa3,0xe0,0xfe,0xe4,0xee,0x42,0x15,0xe5},
+  16,0x01f7,0,{0x16,0x45,0x15,0x70,0x03,0x02,0x02,0x85,0xe4,0x90,0x7f,0xc5,0xf0,0x90,0x7f,0xb4},
+  16,0x0207,0,{0xe0,0x20,0xe3,0xf9,0x90,0x7f,0xc5,0xe0,0xf5,0x0c,0x12,0x03,0x13,0xaf,0x0c,0x7e},
+  16,0x0217,0,{0x00,0xef,0x25,0x0b,0xf5,0x0b,0xee,0x35,0x0a,0xf5,0x0a,0xc3,0xe5,0x16,0x9f,0xf5},
+  16,0x0227,0,{0x16,0xe5,0x15,0x9e,0xf5,0x15,0x80,0xc7,0x90,0x7f,0xea,0xe0,0x75,0x0a,0x00,0xf5},
+  16,0x0237,0,{0x0b,0xa3,0xe0,0xfe,0xe4,0xee,0x42,0x0a,0x90,0x7f,0xee,0xe0,0x75,0x15,0x00,0xf5},
+  16,0x0247,0,{0x16,0xa3,0xe0,0xfe,0xe4,0xee,0x42,0x15,0xe5,0x16,0x45,0x15,0x60,0x30,0xe4,0x90},
+  16,0x0257,0,{0x7f,0xc5,0xf0,0x90,0x7f,0xb4,0xe0,0x20,0xe3,0xf9,0x90,0x7f,0xc5,0xe0,0xf5,0x0c},
+  16,0x0267,0,{0x12,0x03,0x2b,0xaf,0x0c,0x7e,0x00,0xef,0x25,0x0b,0xf5,0x0b,0xee,0x35,0x0a,0xf5},
+  15,0x0277,0,{0x0a,0xc3,0xe5,0x16,0x9f,0xf5,0x16,0xe5,0x15,0x9e,0xf5,0x15,0x80,0xca,0xc3},
+   1,0x0286,0,{0x22},
+  12,0x0287,0,{0x78,0x7f,0xe4,0xf6,0xd8,0xfd,0x75,0x81,0x29,0x02,0x02,0xce},
+  16,0x0293,0,{0x02,0x01,0x00,0xe4,0x93,0xa3,0xf8,0xe4,0x93,0xa3,0x40,0x03,0xf6,0x80,0x01,0xf2},
+  16,0x02a3,0,{0x08,0xdf,0xf4,0x80,0x29,0xe4,0x93,0xa3,0xf8,0x54,0x07,0x24,0x0c,0xc8,0xc3,0x33},
+  16,0x02b3,0,{0xc4,0x54,0x0f,0x44,0x20,0xc8,0x83,0x40,0x04,0xf4,0x56,0x80,0x01,0x46,0xf6,0xdf},
+  16,0x02c3,0,{0xe4,0x80,0x0b,0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x90,0x04,0x6e,0xe4,0x7e},
+  16,0x02d3,0,{0x01,0x93,0x60,0xbc,0xa3,0xff,0x54,0x3f,0x30,0xe5,0x09,0x54,0x1f,0xfe,0xe4,0x93},
+  16,0x02e3,0,{0xa3,0x60,0x01,0x0e,0xcf,0x54,0xc0,0x25,0xe0,0x60,0xa8,0x40,0xb8,0xe4,0x93,0xa3},
+  16,0x02f3,0,{0xfa,0xe4,0x93,0xa3,0xf8,0xe4,0x93,0xa3,0xc8,0xc5,0x82,0xc8,0xca,0xc5,0x83,0xca},
+  16,0x0303,0,{0xf0,0xa3,0xc8,0xc5,0x82,0xc8,0xca,0xc5,0x83,0xca,0xdf,0xe9,0xde,0xe7,0x80,0xbe},
+  16,0x0313,0,{0xe5,0x0c,0xff,0xe5,0x0b,0xf5,0x82,0xe5,0x0a,0xf5,0x83,0x75,0x92,0x7e,0x74,0xc0},
+   8,0x0323,0,{0xf8,0xe2,0x08,0xf0,0xa3,0xdf,0xfa,0x22},
+  16,0x032b,0,{0x90,0x7f,0x96,0x85,0x83,0x92,0xa8,0x82,0x79,0x02,0x90,0x00,0x00,0xe0,0xb4,0x00},
+  16,0x033b,0,{0x0d,0x74,0x01,0xf0,0x90,0x7f,0x97,0xe0,0x54,0x7f,0xf0,0x44,0x80,0xf0,0xe5,0x0c},
+  16,0x034b,0,{0xff,0x90,0x7e,0xc0,0xe0,0xf5,0x28,0xe4,0xa2,0x47,0x33,0xf2,0x69,0xf2,0xe4,0xa2},
+  16,0x035b,0,{0x46,0x33,0xf2,0x69,0xf2,0xe4,0xa2,0x45,0x33,0xf2,0x69,0xf2,0xe4,0xa2,0x44,0x33},
+  16,0x036b,0,{0xf2,0x69,0xf2,0xe4,0xa2,0x43,0x33,0xf2,0x69,0xf2,0xe4,0xa2,0x42,0x33,0xf2,0x69},
+  16,0x037b,0,{0xf2,0xe4,0xa2,0x41,0x33,0xf2,0x69,0xf2,0xe4,0xa2,0x40,0x33,0xf2,0x69,0xf2,0xa3},
+   3,0x038b,0,{0xdf,0xc2,0x22},
+  16,0x038e,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x90,0x7f,0xc4,0xe4,0xf0,0x53,0x91,0xef,0x90,0x7f},
+  11,0x039e,0,{0xab,0x74,0x04,0xf0,0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x03a9,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0xd2,0x20,0x53,0x91,0xef,0x90,0x7f,0xab,0x74,0x01},
+   8,0x03b9,0,{0xf0,0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x03c1,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xab,0x74,0x02,0xf0,0xd0},
+   6,0x03d1,0,{0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x03d7,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xab,0x74,0x10,0xf0,0xd0},
+   6,0x03e7,0,{0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x03ed,0,{0xeb,0x9f,0xf5,0xf0,0xea,0x9e,0x42,0xf0,0xe9,0x9d,0x42,0xf0,0xe8,0x9c,0x45,0xf0},
+   1,0x03fd,0,{0x22},
+   1,0x03fe,0,{0x32},
+   1,0x03ff,0,{0x32},
+  16,0x0400,0,{0x02,0x03,0xa9,0x00,0x02,0x03,0xc1,0x00,0x02,0x03,0x8e,0x00,0x02,0x04,0x58,0x00},
+  16,0x0410,0,{0x02,0x03,0xd7,0x00,0x02,0x03,0xfe,0x00,0x02,0x03,0xff,0x00,0x02,0x04,0x84,0x00},
+  16,0x0420,0,{0x02,0x04,0x85,0x00,0x02,0x04,0x86,0x00,0x02,0x04,0x87,0x00,0x02,0x04,0x88,0x00},
+  16,0x0430,0,{0x02,0x04,0x89,0x00,0x02,0x04,0x8a,0x00,0x02,0x04,0x8b,0x00,0x02,0x04,0x8c,0x00},
+  16,0x0440,0,{0x02,0x04,0x8d,0x00,0x02,0x04,0x8e,0x00,0x02,0x04,0x8f,0x00,0x02,0x04,0x90,0x00},
+   8,0x0450,0,{0x02,0x04,0x91,0x00,0x02,0x04,0x92,0x00},
+  16,0x0458,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xab,0x74,0x08,0xf0,0xd0},
+   6,0x0468,0,{0x82,0xd0,0x83,0xd0,0xe0,0x32},
+  16,0x046e,0,{0x02,0x0a,0x00,0x0f,0x01,0x0c,0x11,0x04,0x0d,0x00,0x00,0x00,0x00,0x41,0x00,0x00},
+   1,0x047e,0,{0x00},
+   4,0x047f,0,{0x02,0x17,0x00,0x00},
+   1,0x0483,0,{0x00},
+   1,0x0484,0,{0x32},
+   1,0x0485,0,{0x32},
+   1,0x0486,0,{0x32},
+   1,0x0487,0,{0x32},
+   1,0x0488,0,{0x32},
+   1,0x0489,0,{0x32},
+   1,0x048a,0,{0x32},
+   1,0x048b,0,{0x32},
+   1,0x048c,0,{0x32},
+   1,0x048d,0,{0x32},
+   1,0x048e,0,{0x32},
+   1,0x048f,0,{0x32},
+   1,0x0490,0,{0x32},
+   1,0x0491,0,{0x32},
+   1,0x0492,0,{0x32},
+  16,0x1100,0,{0x12,0x01,0x10,0x01,0x00,0x00,0x00,0x40,0x6a,0x08,0x01,0x01,0x00,0x01,0x01,0x02},
+  16,0x1110,0,{0x00,0x01,0x09,0x02,0x20,0x00,0x01,0x01,0x03,0xa0,0x00,0x09,0x04,0x00,0x00,0x02},
+  16,0x1120,0,{0xff,0x00,0x00,0x04,0x07,0x05,0x82,0x02,0x40,0x00,0x00,0x07,0x05,0x02,0x02,0x40},
+  16,0x1130,0,{0x00,0x00,0x04,0x03,0x09,0x04,0x26,0x03,0x41,0x00,0x6e,0x00,0x63,0x00,0x68,0x00},
+  16,0x1140,0,{0x6f,0x00,0x72,0x00,0x20,0x00,0x43,0x00,0x68,0x00,0x69,0x00,0x70,0x00,0x73,0x00},
+  16,0x1150,0,{0x2c,0x00,0x20,0x00,0x49,0x00,0x6e,0x00,0x63,0x00,0x2e,0x00,0x28,0x03,0x46,0x00},
+  16,0x1160,0,{0x69,0x00,0x72,0x00,0x6d,0x00,0x77,0x00,0x61,0x00,0x72,0x00,0x65,0x00,0x20,0x00},
+  16,0x1170,0,{0x46,0x00,0x72,0x00,0x61,0x00,0x6d,0x00,0x65,0x00,0x57,0x00,0x6f,0x00,0x72,0x00},
+  16,0x1180,0,{0x6b,0x00,0x73,0x00,0x2a,0x03,0x43,0x00,0x6f,0x00,0x6e,0x00,0x66,0x00,0x69,0x00},
+  16,0x1190,0,{0x67,0x00,0x75,0x00,0x72,0x00,0x61,0x00,0x74,0x00,0x69,0x00,0x6f,0x00,0x6e,0x00},
+  16,0x11a0,0,{0x20,0x00,0x53,0x00,0x74,0x00,0x72,0x00,0x69,0x00,0x6e,0x00,0x67,0x00,0x22,0x03},
+  16,0x11b0,0,{0x49,0x00,0x6e,0x00,0x74,0x00,0x65,0x00,0x72,0x00,0x66,0x00,0x61,0x00,0x63,0x00},
+  16,0x11c0,0,{0x65,0x00,0x20,0x00,0x53,0x00,0x74,0x00,0x72,0x00,0x69,0x00,0x6e,0x00,0x67,0x00},
+   2,0x11d0,0,{0x00,0x00},
+   0,0x0000,1,{0}
+};
+/* Source: EMILOAD.HEX 
+:10046E00020A000F010C11040D00000000410000F3
+:01047E00007D
+:1001C700907FE9E0245B606024026003020285906F
+:1001D7007FEAE0750A00F50BA3E0FEE4EE420A9021
+:1001E7007FEEE0751500F516A3E0FEE4EE4215E597
+:1001F7001645157003020285E4907FC5F0907FB421
+:10020700E020E3F9907FC5E0F50C120313AF0C7EF5
+:1002170000EF250BF50BEE350AF50AC3E5169FF53A
+:1002270016E5159EF51580C7907FEAE0750A00F57B
+:100237000BA3E0FEE4EE420A907FEEE0751500F5B1
+:1002470016A3E0FEE4EE4215E51645156030E4908E
+:100257007FC5F0907FB4E020E3F9907FC5E0F50C0F
+:1002670012032BAF0C7E00EF250BF50BEE350AF5CD
+:0F0277000AC3E5169FF516E5159EF51580CAC357
+:010286002255
+:1003A900C0E0C083C082D2205391EF907FAB74012B
+:0803B900F0D082D083D0E032C5
+:10038E00C0E0C083C082907FC4E4F05391EF907FB1
+:0B039E00AB7404F0D082D083D0E032BA
+:1003C100C0E0C083C0825391EF907FAB7402F0D044
+:0603D10082D083D0E0326F
+:1003D700C0E0C083C0825391EF907FAB7410F0D020
+:0603E70082D083D0E03259
+:0103FE0032CC
+:10045800C0E0C083C0825391EF907FAB7408F0D0A6
+:0604680082D083D0E032D7
+:0103FF0032CB
+:010484003245
+:010485003244
+:010486003243
+:010487003242
+:010488003241
+:010489003240
+:01048A00323F
+:01048B00323E
+:01048C00323D
+:01048D00323C
+:01048E00323B
+:01048F00323A
+:010490003239
+:010491003238
+:010492003237
+:04047F000217000060
+:10010000E4FFFEC220D2E843D820907FAB74FFF01A
+:10011000907FA9F0907FAAF05391EF907F9574C0E3
+:10012000F0907F9EF0907F98F0E4907F94F0907F25
+:100130009D74FFF0907F9774A0F0907F93E054FC43
+:10014000F0907F9C7403F0E4907F96F0907FAFE096
+:100150004401F0907FAEE0440DF0D2AF0FBF00013C
+:100160000EBE07F8BF08F520204275140075130075
+:100170007512007511007F487E927D007C00AB14E3
+:10018000AA13A912A811C31203ED50DB2020D87ABC
+:100190000079007800E5142401F514EA3513F5130D
+:1001A000E93512F512E83511F51180CA3020FD123B
+:1001B00001C75007907FB4E04401F0907FB4E04461
+:0601C00002F0C22080E6FF
+:0101C6002216
+:1011000012011001000000406A0801010001010203
+:10111000000109022000010103A0000904000002EF
+:10112000FF0000040705820240000007050202409C
+:10113000000004030904260341006E0063006800F8
+:101140006F007200200043006800690070007300A7
+:101150002C00200049006E0063002E00280346008A
+:10116000690072006D007700610072006500200068
+:101170004600720061006D00650057006F0072004C
+:101180006B0073002A0343006F006E006600690065
+:101190006700750072006100740069006F006E00E6
+:1011A000200053007400720069006E006700220383
+:1011B00049006E0074006500720066006100630003
+:1011C0006500200053007400720069006E00670023
+:0211D00000001D
+:10031300E50CFFE50BF582E50AF58375927E74C063
+:08032300F8E208F0A3DFFA2262
+:10032B00907F96858392A8827902900000E0B400BA
+:10033B000D7401F0907F97E0547FF04480F0E50C52
+:10034B00FF907EC0E0F528E4A24733F269F2E4A205
+:10035B004633F269F2E4A24533F269F2E4A2443384
+:10036B00F269F2E4A24333F269F2E4A24233F26996
+:10037B00F2E4A24133F269F2E4A24033F269F2A350
+:03038B00DFC222AC
+:03004300020400B4
+:100400000203A9000203C10002038E000204580087
+:100410000203D7000203FE000203FF00020484006F
+:10042000020485000204860002048700020488009A
+:100430000204890002048A0002048B0002048C007A
+:1004400002048D0002048E0002048F00020490005A
+:08045000020491000204920075
+:0300000002028772
+:0C028700787FE4F6D8FD7581290202CED4
+:1003ED00EB9FF5F0EA9E42F0E99D42F0E89C45F066
+:0103FD0022DD
+:10029300020100E493A3F8E493A34003F68001F280
+:1002A30008DFF48029E493A3F85407240CC8C3336C
+:1002B300C4540F4420C8834004F456800146F6DF3B
+:1002C300E4800B010204081020408090046EE47E59
+:1002D300019360BCA3FF543F30E509541FFEE49330
+:1002E300A360010ECF54C025E060A840B8E493A3F7
+:1002F300FAE493A3F8E493A3C8C582C8CAC583CA22
+:10030300F0A3C8C582C8CAC583CADFE9DEE780BED9
+:010483000078
+:00000001FF
+/*
+VERSION=1.0.2.002
+DATE=10.01.2002
+EMI26_62
+*/
diff -Nru a/drivers/usb/misc/emi62_fw_s.h b/drivers/usb/misc/emi62_fw_s.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/usb/misc/emi62_fw_s.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,8836 @@
+/*
+ * This file is generated from three different files, provided by Emagic.
+ */
+/* generated Tue Apr 15 21:59:42 EEST 2003 */
+
+INTEL_HEX_RECORD g_emi62bs[]={
+ {16, 0x8010, 0, {0xff,0xff,0xff,0xff,0xaa,0x99,0x55,0x66,0x30,0x00,0x80,0x01,0x00,0x00,0x00,0x07 }},
+ {16, 0x8020, 0, {0x30,0x01,0x60,0x01,0x00,0x00,0x00,0x0d,0x30,0x01,0x20,0x01,0x00,0x80,0x3f,0x2d }},
+ {16, 0x8030, 0, {0x30,0x00,0xc0,0x01,0x00,0x00,0x00,0x00,0x30,0x00,0x80,0x01,0x00,0x00,0x00,0x09 }},
+ {16, 0x8040, 0, {0x30,0x00,0x20,0x01,0x00,0x00,0x00,0x00,0x30,0x00,0x80,0x01,0x00,0x00,0x00,0x01 }},
+ {16, 0x8050, 0, {0x30,0x00,0x40,0x00,0x50,0x00,0x58,0x1a,0x80,0x12,0x10,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8060, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8070, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8080, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x40,0x04,0x80,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8090, 0, {0x00,0x12,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x80a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x80b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x48 }},
+ {16, 0x80c0, 0, {0x04,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x80d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x80e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x80f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8100, 0, {0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8110, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8120, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8130, 0, {0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8140, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8150, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8160, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x80,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8170, 0, {0x80,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8180, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8190, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x81a0, 0, {0x00,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x81b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x81c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x81d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x04,0x90,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x81e0, 0, {0x7f,0x10,0x00,0x34,0x00,0x0d,0x00,0x03,0x40,0x00,0xd0,0x00,0x34,0x00,0x05,0x00 }},
+ {16, 0x81f0, 0, {0x07,0x40,0x01,0xd0,0x00,0x74,0x00,0x1d,0x00,0x07,0x40,0x01,0xd0,0x00,0x74,0x00 }},
+ {16, 0x8200, 0, {0x1d,0x80,0x07,0xe0,0x01,0xb8,0x00,0x6e,0x00,0x1b,0x80,0x06,0xe0,0x01,0x38,0x37 }},
+ {16, 0x8210, 0, {0xc4,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0xfc,0x80,0xfb,0x30,0x36,0xc8 }},
+ {16, 0x8220, 0, {0x4e,0x09,0x03,0xfc,0x84,0xff,0x10,0x3b,0xc0,0x0e,0xc8,0x07,0x22,0x80,0xff,0x22 }},
+ {16, 0x8230, 0, {0x33,0xc0,0x0f,0xc8,0x33,0x6e,0x00,0xfb,0x80,0x3f,0x20,0x0d,0xc2,0x53,0xd4,0x80 }},
+ {16, 0x8240, 0, {0xcc,0x3a,0x3f,0x00,0x0c,0xf1,0x03,0xf0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8250, 0, {0x80,0x00,0xed,0x60,0xbf,0x60,0x23,0xf0,0x0d,0x82,0x12,0x3c,0x60,0x8f,0x70,0x23 }},
+ {16, 0x8260, 0, {0xf0,0x08,0x88,0x02,0xa5,0x40,0xbf,0xd0,0x63,0xd6,0x0b,0x88,0x02,0x2e,0x0c,0xbb }},
+ {16, 0x8270, 0, {0x80,0x2e,0x20,0x88,0x8d,0x02,0xe6,0x40,0x80,0x60,0x2e,0x30,0x0a,0xb1,0x12,0x20 }},
+ {16, 0x8280, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x80,0xa3,0x40,0x2c,0xc4 }},
+ {16, 0x8290, 0, {0x4a,0x00,0x12,0x8c,0x88,0xa3,0x22,0x20,0xc4,0x0a,0x90,0x42,0x04,0xa9,0xa3,0x00 }},
+ {16, 0x82a0, 0, {0x24,0xc8,0x8b,0x80,0x02,0xcc,0x00,0xb3,0x00,0x2e,0x01,0x09,0x08,0x02,0x84,0x00 }},
+ {16, 0x82b0, 0, {0x80,0x20,0x2c,0x10,0x0a,0x32,0x42,0x22,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x82c0, 0, {0xc0,0x15,0xac,0x04,0xb3,0x00,0x2a,0xc0,0x08,0x08,0xa2,0x8c,0x00,0x8b,0x00,0xa2 }},
+ {16, 0x82d0, 0, {0xc1,0x10,0x98,0x42,0xa7,0x00,0xbb,0x01,0x66,0xc1,0x0b,0x80,0x02,0xac,0x04,0xbb }},
+ {16, 0x82e0, 0, {0x00,0x2e,0x00,0x0b,0xb8,0x12,0xe4,0x02,0x89,0x08,0x0e,0x40,0x0a,0xb0,0x02,0x30 }},
+ {16, 0x82f0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xac,0x00,0xeb,0x00,0x3e,0xc0 }},
+ {16, 0x8300, 0, {0x4a,0xb8,0x23,0xec,0x18,0xeb,0x00,0x32,0xc0,0x0e,0x2c,0x12,0x22,0x10,0xeb,0x00 }},
+ {16, 0x8310, 0, {0x26,0xc0,0x4f,0x00,0x43,0xed,0x00,0xfb,0x00,0x2e,0x24,0x0d,0x80,0x13,0xe4,0x00 }},
+ {16, 0x8320, 0, {0xc8,0xd0,0x7c,0x12,0x0e,0xb0,0x03,0x40,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8330, 0, {0xe1,0x00,0xbc,0x00,0xff,0x00,0x35,0xc0,0x4f,0xe0,0x03,0x7c,0x08,0xff,0x01,0x17 }},
+ {16, 0x8340, 0, {0xc2,0x4d,0xc0,0x03,0xf4,0x08,0xf7,0x00,0x3b,0xc0,0x07,0xc0,0x03,0x7c,0x80,0xff }},
+ {16, 0x8350, 0, {0x24,0x3f,0x40,0x0c,0xf0,0x01,0xf4,0x04,0xbc,0x08,0x3f,0x28,0x0f,0xf0,0x03,0x78 }},
+ {16, 0x8360, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x08,0xfb,0x04,0x3a,0xc8 }},
+ {16, 0x8370, 0, {0x0f,0x94,0x03,0xec,0x10,0xf3,0x00,0x34,0xc0,0x0e,0xb0,0x03,0x61,0x04,0xfb,0x00 }},
+ {16, 0x8380, 0, {0x36,0xc0,0x0e,0xa3,0x03,0x2c,0x80,0xfb,0x72,0x3e,0x02,0x0f,0x8a,0x03,0xe4,0x02 }},
+ {16, 0x8390, 0, {0xc9,0x80,0x2a,0x50,0x0f,0xb0,0x03,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x83a0, 0, {0xca,0x44,0x3c,0x00,0xbf,0x00,0x03,0xc0,0x08,0x80,0x03,0x7c,0x00,0xbf,0x00,0x3f }},
+ {16, 0x83b0, 0, {0xe2,0x08,0x90,0x43,0x60,0x00,0xbf,0x00,0x37,0xc0,0x08,0x90,0x01,0x6d,0x00,0xbb }},
+ {16, 0x83c0, 0, {0x40,0x2c,0x10,0x0b,0xb0,0x42,0xd7,0xc0,0x89,0x00,0x2a,0x7c,0x0b,0xf0,0x02,0xf2 }},
+ {16, 0x83d0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe2,0x05,0x4c,0x00,0xb3,0x00,0x20,0xd5 }},
+ {16, 0x83e0, 0, {0x4a,0x00,0x00,0x0c,0x04,0x93,0x00,0x0c,0xf0,0x0b,0x09,0x02,0x08,0x01,0xb3,0x20 }},
+ {16, 0x83f0, 0, {0x28,0xc0,0x0a,0x0c,0x0a,0x0e,0x00,0xb3,0x00,0x24,0x30,0x09,0x00,0x02,0xc6,0x10 }},
+ {16, 0x8400, 0, {0x80,0x42,0x20,0x00,0x8b,0xb0,0x02,0xf8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8410, 0, {0x22,0x01,0x1e,0x00,0xb7,0x94,0x21,0xe4,0x48,0xd9,0x12,0x5e,0x40,0xb7,0x90,0x29 }},
+ {16, 0x8420, 0, {0xe0,0x8b,0x69,0x12,0xd6,0x80,0x37,0x82,0x2c,0xe8,0x08,0x4a,0x02,0x5e,0x00,0xb7 }},
+ {16, 0x8430, 0, {0xa4,0x2d,0x20,0x0b,0x79,0x02,0xd6,0x08,0x86,0x90,0x29,0xa0,0x0b,0x79,0x02,0xd8 }},
+ {16, 0x8440, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x0c,0x00,0xfb,0xa0,0x28,0xe8 }},
+ {16, 0x8450, 0, {0x0e,0x2a,0x02,0x8c,0x00,0xd3,0x00,0x64,0xc0,0x0f,0x00,0x43,0x0e,0xc4,0xf3,0x00 }},
+ {16, 0x8460, 0, {0x78,0xec,0x0e,0x0a,0x43,0x0e,0x20,0x73,0xe0,0x3c,0x02,0x4f,0x00,0x03,0xc4,0x40 }},
+ {16, 0x8470, 0, {0xc3,0x00,0x38,0xc0,0x0f,0x30,0x03,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8480, 0, {0x40,0x1d,0xbc,0x00,0xff,0x00,0xbc,0xcc,0x0e,0xb0,0x03,0xec,0x20,0xfb,0x00,0x3c }},
+ {16, 0x8490, 0, {0xc2,0x0c,0x20,0x03,0x6c,0x50,0xf3,0x00,0x36,0xc4,0x0f,0x40,0x03,0xfc,0x08,0xff }},
+ {16, 0x84a0, 0, {0x1a,0x3f,0x80,0x0f,0xf0,0x01,0xe4,0x30,0xff,0x02,0x3f,0xc0,0x0f,0xf0,0x63,0xd0 }},
+ {16, 0x84b0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xec,0x40,0xfb,0x00,0xb2,0xd8 }},
+ {16, 0x84c0, 0, {0x0c,0xb0,0x01,0x2d,0x20,0xdb,0x01,0x3a,0xc8,0x8c,0x38,0x03,0xa8,0x00,0xfb,0x48 }},
+ {16, 0x84d0, 0, {0x3e,0xc9,0x0f,0x80,0x03,0xec,0x40,0xfb,0x01,0x3e,0x00,0x0f,0x08,0x03,0xa4,0x08 }},
+ {16, 0x84e0, 0, {0xfa,0x80,0xb2,0x80,0x0f,0xb1,0x02,0x6a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x84f0, 0, {0x48,0x19,0x1c,0x80,0xbf,0x30,0x21,0xca,0x08,0xf0,0x0a,0x0c,0x80,0x8f,0x50,0x21 }},
+ {16, 0x8500, 0, {0xc2,0x08,0x70,0x50,0x9c,0x00,0xb7,0x00,0x39,0xc4,0x0b,0x40,0x02,0x9c,0x04,0xb7 }},
+ {16, 0x8510, 0, {0x20,0x25,0x40,0x0b,0x70,0x02,0x14,0x80,0xb6,0x00,0x21,0x80,0x0b,0xf8,0x02,0x12 }},
+ {16, 0x8520, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x00,0xb7,0xb0,0x21,0xec }},
+ {16, 0x8530, 0, {0x0b,0x78,0x12,0xde,0x84,0x97,0x80,0x0d,0xe0,0x28,0xf8,0x02,0xde,0x00,0xb7,0x90 }},
+ {16, 0x8540, 0, {0x2d,0xe4,0x0b,0x68,0x82,0x5e,0x80,0xb7,0xa0,0x29,0x20,0x0b,0x48,0x02,0x96,0x00 }},
+ {16, 0x8550, 0, {0xb7,0x80,0x21,0xe1,0x0b,0x7a,0x02,0x70,0x40,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8560, 0, {0x48,0x04,0xcc,0x00,0xb3,0x00,0x20,0xc0,0x0b,0x38,0x02,0x8c,0x04,0x83,0x00,0x28 }},
+ {16, 0x8570, 0, {0xc0,0x88,0x39,0x02,0x4c,0x40,0xb3,0x04,0x28,0xc0,0x1b,0x10,0x02,0x8c,0x01,0xb3 }},
+ {16, 0x8580, 0, {0x04,0x24,0x88,0x4b,0x31,0x02,0x04,0x00,0xb3,0x80,0x20,0xf2,0x0b,0x30,0x02,0x02 }},
+ {16, 0x8590, 0, {0x24,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x05,0xa8,0x00,0xfa,0x00,0x32,0x80 }},
+ {16, 0x85a0, 0, {0x0f,0xe8,0x03,0xe8,0x00,0xda,0x01,0x3a,0x80,0x8c,0xed,0x03,0xfb,0x04,0xfa,0x00 }},
+ {16, 0x85b0, 0, {0x3e,0x80,0x0f,0x6c,0x03,0xfb,0xc8,0xbe,0xc2,0x1f,0x80,0x0f,0xe5,0x03,0xa8,0x00 }},
+ {16, 0x85c0, 0, {0xfe,0x48,0x33,0x80,0x4f,0xa0,0x03,0x7a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x85d0, 0, {0x48,0x00,0xe0,0x00,0xf8,0x00,0x3c,0x00,0x0c,0x81,0x93,0x60,0x00,0xf8,0x01,0x36 }},
+ {16, 0x85e0, 0, {0x10,0x0f,0x80,0x03,0xa0,0x20,0xf8,0x00,0x2a,0x01,0x8f,0x84,0x13,0xe1,0x00,0xf8 }},
+ {16, 0x85f0, 0, {0x18,0x36,0x00,0x0f,0x80,0x13,0xe0,0x00,0xf8,0x20,0x3e,0x14,0x0f,0x80,0x03,0xd2 }},
+ {16, 0x8600, 0, {0x80,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0xe4,0x00,0xf1,0x00,0xaa,0x40 }},
+ {16, 0x8610, 0, {0x0c,0x90,0x03,0x24,0x00,0xe1,0x00,0x38,0x40,0x1c,0x90,0x03,0xe4,0x00,0xf9,0xa0 }},
+ {16, 0x8620, 0, {0x3a,0x40,0x47,0x9a,0x93,0xa2,0x80,0xf8,0x10,0x3e,0x40,0x0b,0x94,0x03,0xe6,0x40 }},
+ {16, 0x8630, 0, {0xf9,0xc0,0x3e,0x68,0x0b,0x10,0x03,0x02,0x84,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8640, 0, {0x80,0x04,0xe4,0x04,0xb9,0x00,0x22,0x40,0x08,0x90,0x02,0x24,0x04,0x89,0x00,0x36 }},
+ {16, 0x8650, 0, {0x40,0x08,0x90,0x02,0xe4,0x04,0xb9,0x80,0x2e,0x40,0x4f,0x94,0x03,0x61,0x10,0xe8 }},
+ {16, 0x8660, 0, {0x40,0x2e,0x40,0x0b,0x90,0x42,0xe6,0x04,0xb9,0x00,0x2e,0x40,0x0b,0x90,0x02,0x20 }},
+ {16, 0x8670, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x04,0x24,0x00,0xb9,0x00,0x22,0x40 }},
+ {16, 0x8680, 0, {0x0a,0x10,0x52,0x04,0x04,0xa9,0x04,0x2a,0x40,0x08,0xb0,0x02,0xe4,0x01,0xb9,0x00 }},
+ {16, 0x8690, 0, {0x2e,0x40,0x0b,0x90,0x02,0xa8,0x0d,0xb8,0x40,0x2e,0x40,0x09,0x94,0x02,0xe5,0x00 }},
+ {16, 0x86a0, 0, {0xb9,0x04,0x2e,0x40,0x0b,0x90,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x86b0, 0, {0x08,0x04,0x04,0x80,0xb1,0x20,0x20,0xc8,0x0a,0x10,0x42,0x04,0x90,0x81,0x20,0x04 }},
+ {16, 0x86c0, 0, {0xc8,0x08,0x30,0x26,0xc4,0x00,0xb1,0x20,0x2c,0x48,0x0b,0x90,0x02,0x45,0x01,0xb1 }},
+ {16, 0x86d0, 0, {0x40,0x2c,0x40,0x0b,0x12,0x82,0xc4,0x00,0xb1,0x2b,0x2c,0x4a,0x0b,0x12,0x82,0x02 }},
+ {16, 0x86e0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x08,0x21,0x48,0xf8,0x50,0x32,0x00 }},
+ {16, 0x86f0, 0, {0x4e,0x85,0x0b,0x21,0x40,0xa8,0x52,0x2a,0x00,0x08,0x80,0x23,0xe1,0x40,0xf8,0x00 }},
+ {16, 0x8700, 0, {0x3a,0x14,0x0f,0xa0,0x43,0xa8,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x82,0x03,0xe0,0x00 }},
+ {16, 0x8710, 0, {0xf0,0x20,0x3e,0x88,0x4f,0x82,0x0b,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8720, 0, {0x98,0x19,0xe4,0x40,0xf9,0x11,0x34,0x44,0x2d,0xd0,0x03,0xe4,0x50,0x79,0x10,0x38 }},
+ {16, 0x8730, 0, {0x44,0x2f,0xd0,0x03,0xf5,0x10,0xf9,0x10,0x3e,0x45,0x06,0x50,0x03,0xe5,0x00,0xe9 }},
+ {16, 0x8740, 0, {0x40,0x3f,0x40,0x0f,0xd0,0x43,0xf5,0x00,0xfd,0x28,0x3f,0x40,0x0f,0x92,0x83,0xe6 }},
+ {16, 0x8750, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x01,0xe6,0x00,0xd9,0x90,0x37,0x69 }},
+ {16, 0x8760, 0, {0x4d,0x90,0x23,0x67,0x80,0xd9,0xe0,0x37,0x68,0x0e,0xd0,0x07,0xa4,0x00,0x05,0x86 }},
+ {16, 0x8770, 0, {0x3e,0x66,0x0d,0x50,0x23,0x26,0x00,0xc9,0x82,0x3d,0x40,0x0d,0xd8,0x07,0x36,0x02 }},
+ {16, 0x8780, 0, {0xcd,0xc0,0x33,0x60,0x0c,0x9c,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8790, 0, {0x38,0x10,0xe2,0x80,0x88,0xa2,0x22,0x10,0x28,0x8a,0x82,0x23,0x84,0x88,0xa0,0x22 }},
+ {16, 0x87a0, 0, {0x14,0x48,0x80,0x42,0x82,0x00,0x88,0x40,0x2e,0x30,0x08,0x80,0x02,0xa2,0x00,0xd8 }},
+ {16, 0x87b0, 0, {0x90,0x26,0x00,0x08,0x84,0x0a,0x21,0x00,0xc8,0xa0,0xa2,0x14,0x28,0x8c,0x02,0x0e }},
+ {16, 0x87c0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc5,0x20,0x91,0x40,0x2c,0x44 }},
+ {16, 0x87d0, 0, {0x18,0x10,0x02,0x85,0x04,0xb1,0x40,0x0c,0x40,0x0a,0x10,0x06,0x84,0x30,0x81,0x40 }},
+ {16, 0x87e0, 0, {0x2c,0x48,0x59,0x10,0x1a,0x04,0x60,0x81,0x09,0x2e,0x40,0x1b,0x14,0x02,0x25,0x00 }},
+ {16, 0x87f0, 0, {0x91,0xe0,0x20,0x60,0x08,0x16,0x02,0x00,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8800, 0, {0x18,0x15,0xa4,0x00,0x81,0x00,0x2a,0x41,0x08,0x90,0x02,0xa4,0x00,0xa1,0x00,0x2a }},
+ {16, 0x8810, 0, {0x41,0x08,0xb0,0x82,0x24,0x11,0x8b,0x00,0x2e,0x40,0x18,0x91,0x02,0xa0,0x04,0x98 }},
+ {16, 0x8820, 0, {0x20,0x2e,0x54,0x1b,0x90,0x82,0x2c,0x00,0x89,0x10,0x22,0x44,0x88,0x90,0x02,0x06 }},
+ {16, 0x8830, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x00,0xd9,0x00,0x3e,0x40 }},
+ {16, 0x8840, 0, {0x4c,0x90,0x03,0xa4,0x10,0xf9,0x00,0x3e,0x40,0x8e,0x10,0x02,0xa4,0xc2,0xc9,0x00 }},
+ {16, 0x8850, 0, {0x3e,0x40,0x0d,0x16,0x13,0x01,0x84,0xc8,0x20,0x3c,0x60,0x0f,0x90,0x12,0x04,0x00 }},
+ {16, 0x8860, 0, {0xd9,0x40,0x32,0x50,0x0c,0x90,0x03,0x28,0x84,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8870, 0, {0x28,0x01,0x84,0x00,0xf9,0x00,0x36,0x40,0x4f,0x99,0x4a,0x44,0x00,0x99,0x00,0xb4 }},
+ {16, 0x8880, 0, {0x40,0x0f,0x90,0x13,0xe6,0x00,0xf9,0x00,0x3c,0x40,0x0f,0x90,0x03,0xe3,0x00,0xf8 }},
+ {16, 0x8890, 0, {0x01,0x36,0x40,0x0c,0x99,0x03,0xe4,0x02,0xf9,0x80,0x3e,0x60,0x4f,0x90,0x0b,0xca }},
+ {16, 0x88a0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xd8,0x00,0x3c,0x00 }},
+ {16, 0x88b0, 0, {0x1d,0x80,0x03,0x20,0x00,0xe8,0x00,0x32,0x00,0x0c,0x84,0x83,0xe0,0x10,0xe8,0x20 }},
+ {16, 0x88c0, 0, {0x32,0x00,0x8e,0x84,0x03,0x21,0x80,0xc8,0x00,0x3a,0x19,0x0f,0x04,0x03,0xe0,0x24 }},
+ {16, 0x88d0, 0, {0xf0,0x02,0x3c,0x00,0x0f,0x80,0x13,0x8a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x88e0, 0, {0x28,0x05,0x28,0x02,0x8a,0x01,0x0f,0xa2,0x68,0xa0,0x00,0x28,0x00,0x8a,0x00,0x77 }},
+ {16, 0x88f0, 0, {0x80,0x68,0xe0,0x12,0xe8,0x00,0xde,0x00,0x36,0x81,0x08,0xe0,0x03,0x7a,0x08,0xae }},
+ {16, 0x8900, 0, {0xc4,0x2f,0x80,0x08,0xed,0x02,0xfa,0x00,0xbe,0xa0,0x3b,0x80,0x0b,0xa0,0x42,0x0a }},
+ {16, 0x8910, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x85,0x4c,0x00,0x93,0x00,0x2c,0xc0 }},
+ {16, 0x8920, 0, {0x88,0xb0,0x02,0x0c,0x14,0xa3,0x04,0x20,0xc4,0x18,0x38,0x02,0xec,0x10,0x93,0x54 }},
+ {16, 0x8930, 0, {0x28,0xc0,0x0a,0x00,0x02,0x4e,0x00,0x83,0x49,0x68,0xc0,0x02,0x39,0x42,0xce,0x40 }},
+ {16, 0x8940, 0, {0xb3,0x00,0x2c,0xe6,0x0b,0xb0,0x02,0x8b,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8950, 0, {0x20,0x01,0x1c,0x08,0x87,0x20,0x2c,0x80,0x18,0xf2,0x22,0x1c,0x00,0x87,0x10,0x21 }},
+ {16, 0x8960, 0, {0xc0,0x08,0x70,0x82,0xdc,0x80,0x96,0x80,0x2d,0xc0,0x0a,0x40,0x02,0x7d,0x40,0x27 }},
+ {16, 0x8970, 0, {0x64,0x6d,0xd0,0x48,0x60,0x42,0xd8,0x05,0xb6,0x04,0x29,0xc0,0x4b,0x72,0x02,0x28 }},
+ {16, 0x8980, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x08,0x3e,0x88,0xd7,0xe0,0x3d,0xe0 }},
+ {16, 0x8990, 0, {0x08,0x7c,0x42,0x3e,0x00,0xe3,0x82,0x20,0xe0,0x0c,0x68,0x03,0xdf,0x04,0xd7,0x80 }},
+ {16, 0x89a0, 0, {0x3b,0xe0,0x4e,0x48,0x0a,0x5e,0x80,0xc7,0xc2,0x19,0xe0,0x0e,0x78,0x03,0xd6,0x08 }},
+ {16, 0x89b0, 0, {0xf7,0x80,0x3d,0xe0,0x0f,0xf8,0x03,0xaa,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x89c0, 0, {0x08,0x1d,0xac,0x40,0xfb,0x40,0x7e,0x80,0x0e,0x36,0x83,0xed,0x40,0xdb,0x60,0x3e }},
+ {16, 0x89d0, 0, {0x80,0x0f,0xa0,0x03,0xed,0x28,0xda,0x00,0x32,0xc4,0x0c,0xb0,0x0b,0xcc,0x00,0xfb }},
+ {16, 0x89e0, 0, {0x00,0x3e,0xc0,0x0e,0x80,0x13,0xe0,0x10,0xf8,0x00,0x3e,0x00,0x0f,0xb1,0x53,0xc2 }},
+ {16, 0x89f0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xfe,0x00,0xff,0xc0,0x33,0xe0 }},
+ {16, 0x8a00, 0, {0x0c,0xf9,0x03,0x7f,0x04,0xcf,0xd0,0x3f,0xe4,0x0f,0xb8,0x03,0xfe,0x00,0xff,0x94 }},
+ {16, 0x8a10, 0, {0x3f,0xe0,0x0f,0xc8,0x03,0x7e,0x10,0xf3,0x80,0x3b,0xe0,0x0f,0xf8,0x03,0xfe,0x48 }},
+ {16, 0x8a20, 0, {0xed,0x80,0x33,0x24,0x04,0xf8,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8a30, 0, {0xa8,0x11,0x9c,0x80,0xbf,0x04,0x21,0x28,0x08,0xf8,0x02,0x1e,0xc0,0xcf,0x90,0x21 }},
+ {16, 0x8a40, 0, {0x4c,0x0b,0x5a,0x42,0xde,0x00,0xb7,0x80,0x2c,0xe8,0x0b,0x04,0x02,0x1c,0x00,0xb7 }},
+ {16, 0x8a50, 0, {0xa0,0x35,0x10,0x8f,0x71,0x13,0xde,0xc0,0x84,0x10,0x21,0x80,0x0d,0x71,0x02,0x2a }},
+ {16, 0x8a60, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x40,0x9c,0x08,0xb7,0x00,0x25,0xc8 }},
+ {16, 0x8a70, 0, {0x08,0x71,0x02,0xcc,0x80,0x97,0x00,0x29,0xc0,0x8b,0x72,0x06,0xdc,0x08,0xb5,0x00 }},
+ {16, 0x8a80, 0, {0x2d,0xc8,0x0b,0x40,0x02,0x1c,0x40,0xbf,0x10,0x21,0xc0,0x0b,0x74,0x02,0xd4,0x80 }},
+ {16, 0x8a90, 0, {0xa7,0x40,0x21,0x41,0x08,0x70,0x02,0x04,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8aa0, 0, {0x60,0x14,0xcc,0x00,0xb3,0x00,0x24,0x00,0x08,0x34,0x82,0xac,0x11,0x83,0x00,0x20 }},
+ {16, 0x8ab0, 0, {0x00,0x4b,0x18,0x26,0xcf,0x20,0xb1,0x06,0x2c,0xc1,0x0b,0x32,0x02,0x0e,0x08,0xb3 }},
+ {16, 0x8ac0, 0, {0x88,0x24,0x32,0x0a,0x30,0x12,0x84,0x08,0x80,0x00,0xa0,0x34,0x28,0x30,0x02,0x18 }},
+ {16, 0x8ad0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x11,0xbc,0x00,0xff,0x00,0xb6,0x40 }},
+ {16, 0x8ae0, 0, {0x2c,0xf4,0x43,0xfc,0x01,0xdf,0x00,0x3a,0x00,0x03,0x92,0x03,0xff,0x88,0xf9,0x00 }},
+ {16, 0x8af0, 0, {0x2f,0xc0,0x1b,0x0e,0x4b,0x2e,0x90,0xfb,0xe0,0x30,0x32,0x0b,0x98,0x02,0xec,0x08 }},
+ {16, 0x8b00, 0, {0x6b,0xc0,0x32,0xc0,0x08,0xf0,0x09,0x3e,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8b10, 0, {0x80,0x00,0xec,0x00,0xf3,0x00,0x3a,0xc0,0x0f,0xb0,0x01,0x6c,0x00,0xfb,0x00,0x3a }},
+ {16, 0x8b20, 0, {0x10,0x0f,0xb4,0x03,0xec,0x00,0xf0,0x00,0x3c,0xc0,0x0f,0x80,0x0b,0xad,0x20,0xfb }},
+ {16, 0x8b30, 0, {0x40,0x3e,0x10,0x07,0xa8,0x63,0xe0,0x00,0xfb,0x80,0x3e,0xd8,0x0f,0xb0,0x03,0xe0 }},
+ {16, 0x8b40, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x00,0xff,0x00,0x72,0x00 }},
+ {16, 0x8b50, 0, {0x0f,0xf0,0x23,0xfc,0x00,0xdf,0x00,0x3f,0x40,0x0f,0xc0,0x03,0xdc,0x00,0x8f,0x00 }},
+ {16, 0x8b60, 0, {0x33,0xc1,0x0c,0xc0,0x03,0xbe,0x00,0xff,0x90,0x3b,0x28,0x0e,0x59,0x03,0x2e,0x00 }},
+ {16, 0x8b70, 0, {0x7b,0x00,0x32,0xc4,0x0f,0xb0,0x03,0xd0,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8b80, 0, {0xc1,0x04,0x6c,0x00,0xbb,0x00,0x62,0xa0,0x0f,0xb0,0x02,0xec,0x09,0x8b,0x00,0x2e }},
+ {16, 0x8b90, 0, {0x30,0x0b,0xa8,0x03,0xac,0x00,0xfa,0xc1,0x22,0xc1,0x08,0x8c,0x02,0x2c,0x00,0xb3 }},
+ {16, 0x8ba0, 0, {0x81,0x2a,0x00,0x0d,0x88,0xb2,0x22,0x00,0xb3,0xc0,0x22,0xc8,0x0b,0xb0,0x42,0x61 }},
+ {16, 0x8bb0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x6c,0x00,0xbb,0x01,0x22,0x62 }},
+ {16, 0x8bc0, 0, {0x0b,0xb0,0x02,0xec,0x04,0x8b,0x00,0x2e,0xa2,0x49,0x88,0x26,0xec,0x00,0xa8,0x80 }},
+ {16, 0x8bd0, 0, {0x22,0xc0,0x28,0x82,0x0a,0xac,0xa0,0xbb,0x08,0x22,0xc0,0x08,0x80,0x0a,0x28,0x84 }},
+ {16, 0x8be0, 0, {0xb9,0xc0,0xa2,0x00,0x0b,0xb0,0x02,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8bf0, 0, {0x08,0x04,0x0c,0x00,0xb3,0x10,0x20,0x48,0x0a,0x32,0x02,0xcc,0x80,0x83,0x01,0x24 }},
+ {16, 0x8c00, 0, {0x00,0x0b,0x02,0x06,0x8c,0x60,0xa0,0x20,0x20,0xc8,0x08,0x01,0x02,0x0c,0x00,0xb3 }},
+ {16, 0x8c10, 0, {0x00,0x28,0x00,0x09,0x20,0x02,0x08,0x80,0xb1,0x00,0xa0,0x80,0x0b,0x30,0x02,0x42 }},
+ {16, 0x8c20, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x6c,0x00,0xff,0x00,0xa2,0x0e }},
+ {16, 0x8c30, 0, {0x0b,0xf1,0x03,0xfc,0x08,0xcf,0x20,0x3e,0xc0,0x0f,0x80,0x03,0xfc,0x84,0xa8,0x20 }},
+ {16, 0x8c40, 0, {0xb2,0xc8,0x8c,0x80,0x03,0xac,0x44,0xfb,0x70,0x3a,0xc0,0x0e,0x90,0x03,0x2c,0xa4 }},
+ {16, 0x8c50, 0, {0xfb,0x00,0xb2,0x40,0x0f,0xb0,0x03,0xc0,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8c60, 0, {0xa0,0x1d,0xfc,0x00,0xff,0x26,0x3e,0x00,0x0f,0xb6,0x13,0xed,0x00,0xfb,0x10,0x3f }},
+ {16, 0x8c70, 0, {0x00,0x0f,0xc1,0x13,0xac,0x80,0xf8,0x12,0x3e,0xc6,0x4f,0x42,0x43,0xfc,0x04,0xff }},
+ {16, 0x8c80, 0, {0x31,0x3f,0x00,0x0f,0xf0,0x03,0xec,0x00,0xff,0x00,0xbf,0xc0,0x8f,0xf0,0x03,0xe8 }},
+ {16, 0x8c90, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0xfc,0x40,0xfc,0x80,0x36,0xc8 }},
+ {16, 0x8ca0, 0, {0x0f,0x09,0x03,0xc2,0x00,0xf8,0xc0,0x33,0xcc,0x2c,0x4c,0x03,0x63,0x90,0xe0,0x90 }},
+ {16, 0x8cb0, 0, {0x3a,0xc0,0x0d,0x50,0x0b,0x3c,0x04,0xdf,0x64,0x3f,0xc8,0x8d,0xf1,0x43,0x2c,0x00 }},
+ {16, 0x8cc0, 0, {0xd5,0x00,0x33,0xc0,0x45,0xf2,0x23,0x70,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8cd0, 0, {0x80,0x10,0xed,0x80,0xba,0x02,0x21,0xde,0x8b,0x82,0x22,0xe0,0x20,0xb0,0x00,0x2b }},
+ {16, 0x8ce0, 0, {0xec,0x09,0x80,0x02,0xe3,0x40,0xba,0x20,0x2f,0xdc,0x08,0x98,0x12,0x2c,0x00,0x8b }},
+ {16, 0x8cf0, 0, {0x51,0x2a,0xd0,0x08,0x72,0x22,0x2e,0x00,0x8d,0x80,0x21,0xd0,0x08,0xb6,0x82,0x20 }},
+ {16, 0x8d00, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x40,0xb9,0x28,0x24,0xc0 }},
+ {16, 0x8d10, 0, {0x4a,0x12,0x12,0x88,0x85,0xa8,0x20,0x20,0xc0,0x0b,0x22,0x02,0xc0,0x91,0xa1,0x00 }},
+ {16, 0x8d20, 0, {0x28,0xc2,0x0b,0x00,0x12,0x8c,0x40,0xa3,0x20,0x20,0xc4,0x0b,0x30,0x0a,0x0c,0x11 }},
+ {16, 0x8d30, 0, {0x99,0x00,0x20,0xc5,0x09,0x01,0x02,0x62,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8d40, 0, {0xc0,0x11,0xac,0x00,0xb8,0x80,0x22,0xc0,0x0b,0x88,0x02,0xee,0x01,0xb8,0xc1,0x2a }},
+ {16, 0x8d50, 0, {0xc0,0x1b,0xa8,0x06,0xe2,0x00,0xbb,0x80,0x2e,0xc0,0x8a,0x80,0x02,0xac,0x00,0xab }},
+ {16, 0x8d60, 0, {0x00,0x2e,0xc0,0x0a,0xb0,0x02,0x2c,0x00,0x99,0x00,0x24,0xc0,0x08,0x80,0x02,0x30 }},
+ {16, 0x8d70, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xec,0x00,0xb0,0x80,0x36,0xc0 }},
+ {16, 0x8d80, 0, {0x0e,0xa8,0x13,0xe2,0x85,0xf3,0xc0,0x32,0xc0,0x0e,0x9c,0x23,0xe7,0x24,0xe8,0x82 }},
+ {16, 0x8d90, 0, {0x3a,0xc1,0x0f,0x94,0x03,0xac,0x02,0xeb,0x00,0x3e,0xc0,0x0f,0xb0,0x03,0x2e,0x10 }},
+ {16, 0x8da0, 0, {0x51,0x00,0xb2,0xc0,0x0d,0xb0,0x03,0x50,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8db0, 0, {0xe0,0x01,0xbc,0x00,0xff,0x00,0x3f,0xc0,0x8f,0xd0,0x03,0xf0,0x04,0xfd,0x04,0x3f }},
+ {16, 0x8dc0, 0, {0xc0,0x4c,0xc0,0x03,0xf0,0x10,0xfc,0x00,0x1f,0xc0,0x0d,0xd1,0x23,0x1c,0x00,0xc7 }},
+ {16, 0x8dd0, 0, {0x00,0x39,0xc0,0x0d,0xf0,0x83,0xfe,0x44,0xed,0x00,0x3b,0xc0,0x0f,0x74,0x03,0xf8 }},
+ {16, 0x8de0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xf9,0x01,0xba,0xc1 }},
+ {16, 0x8df0, 0, {0x0c,0xb0,0x03,0xa1,0x08,0xfa,0x00,0x30,0xc8,0x8f,0x94,0x03,0x25,0x00,0xf9,0x00 }},
+ {16, 0x8e00, 0, {0x3c,0xc0,0x0f,0x04,0x83,0xec,0x00,0xfb,0x00,0x3e,0xe0,0x0f,0x71,0x0b,0x2c,0x40 }},
+ {16, 0x8e10, 0, {0xfd,0x08,0x37,0xc0,0x4e,0x91,0x03,0x90,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8e20, 0, {0xc8,0x05,0x3c,0x00,0xb9,0x00,0x23,0xc0,0x08,0x90,0x02,0x24,0x00,0xc8,0x00,0x37 }},
+ {16, 0x8e30, 0, {0xf0,0x0b,0x80,0x01,0x64,0x00,0x49,0x02,0x33,0xc0,0x84,0x9c,0x03,0x3c,0x00,0xbf }},
+ {16, 0x8e40, 0, {0x02,0x0f,0xd0,0x08,0xf4,0x02,0x0e,0x10,0xbd,0x80,0x33,0xe0,0x08,0x90,0x0a,0x32 }},
+ {16, 0x8e50, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x00,0xb0,0x06,0x20,0xc0 }},
+ {16, 0x8e60, 0, {0x08,0x00,0x42,0x84,0x00,0xa0,0x00,0x20,0xf0,0x0b,0x00,0x22,0xcc,0x00,0x90,0x00 }},
+ {16, 0x8e70, 0, {0x28,0xc0,0x02,0x3d,0x02,0x8c,0x00,0xb3,0x00,0x2c,0xc2,0x9a,0x38,0x02,0x06,0x04 }},
+ {16, 0x8e80, 0, {0xb1,0x12,0x20,0xe0,0x08,0x30,0x02,0x38,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8e90, 0, {0x20,0x01,0x1e,0x00,0xb6,0x80,0x21,0xe0,0x28,0xea,0x02,0x36,0x80,0x86,0x90,0x65 }},
+ {16, 0x8ea0, 0, {0xe0,0x1b,0xda,0x06,0x5e,0x01,0x9e,0x84,0x25,0xec,0x0a,0x78,0x02,0x5e,0x00,0xb7 }},
+ {16, 0x8eb0, 0, {0x80,0x2d,0xe0,0x08,0x79,0x4a,0x16,0x40,0xbd,0x80,0x25,0xe0,0x08,0x38,0x02,0x08 }},
+ {16, 0x8ec0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0xfb,0x00,0x28,0xe0 }},
+ {16, 0x8ed0, 0, {0x08,0x18,0x02,0x8a,0x88,0xa1,0xa0,0x20,0xc2,0x1f,0x2a,0x23,0xe6,0xc8,0xf0,0xc0 }},
+ {16, 0x8ee0, 0, {0x3a,0xed,0x4e,0x34,0x02,0x8c,0x08,0xf3,0x81,0x1e,0xc0,0x0e,0x30,0x03,0x0e,0xc0 }},
+ {16, 0x8ef0, 0, {0xf1,0x00,0xb0,0xca,0x0e,0x21,0x03,0x92,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8f00, 0, {0x40,0x1d,0xbc,0x08,0xfe,0x10,0x3f,0xd2,0x0f,0xe0,0x03,0xec,0x04,0xff,0x14,0x7e }},
+ {16, 0x8f10, 0, {0xc0,0x0f,0xb1,0x23,0xfc,0x01,0xee,0x00,0x3a,0xc4,0x0d,0xb0,0x13,0xbc,0x00,0xff }},
+ {16, 0x8f20, 0, {0x00,0x3f,0xc0,0x0e,0xf0,0x83,0xfc,0x0c,0xfd,0x10,0x3b,0xc0,0x2f,0xe1,0x03,0xd0 }},
+ {16, 0x8f30, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x40,0xf0,0x80,0x32,0xd0 }},
+ {16, 0x8f40, 0, {0x0c,0xa0,0x03,0x6c,0x00,0xf3,0x80,0x32,0xda,0x0f,0xb0,0x03,0xec,0x00,0xfb,0x00 }},
+ {16, 0x8f50, 0, {0x3e,0xcc,0x4c,0x98,0x13,0x2c,0x10,0xfb,0x04,0x3e,0xc4,0x0c,0xf2,0x83,0xa6,0x10 }},
+ {16, 0x8f60, 0, {0xdd,0x20,0x3f,0xd1,0x0c,0xb0,0x03,0xea,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8f70, 0, {0x48,0x11,0x9c,0x80,0xb7,0x00,0x21,0xc8,0x0c,0x70,0x02,0xdc,0x08,0xb7,0x00,0x21 }},
+ {16, 0x8f80, 0, {0xc8,0x0e,0x70,0x22,0xd8,0x00,0xb7,0x00,0x2c,0xc2,0x0a,0x70,0x0a,0x1f,0x08,0xb7 }},
+ {16, 0x8f90, 0, {0x00,0x39,0xc8,0x0a,0x70,0x02,0x14,0x00,0xc5,0x69,0x2c,0xca,0x2a,0x70,0x02,0xd2 }},
+ {16, 0x8fa0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x00,0xbf,0x81,0x64,0xe1 }},
+ {16, 0x8fb0, 0, {0x08,0x78,0x02,0x5a,0x01,0xbf,0x80,0x21,0xec,0x4b,0x78,0x46,0x9f,0x08,0x37,0x80 }},
+ {16, 0x8fc0, 0, {0x2d,0xe8,0x88,0x18,0x02,0x1e,0x81,0xb7,0xb0,0x2d,0xe0,0x09,0x7a,0x02,0x8e,0x00 }},
+ {16, 0x8fd0, 0, {0x95,0xa0,0x2d,0xe4,0x08,0x78,0x02,0xf0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8fe0, 0, {0x48,0x14,0xec,0x00,0xb3,0x60,0x20,0xc0,0x08,0xb6,0x02,0xcc,0x00,0xb3,0x01,0x20 }},
+ {16, 0x8ff0, 0, {0xc0,0x8a,0xb0,0x86,0xcf,0x00,0xbb,0x10,0x6c,0xc1,0x0a,0x38,0x02,0x0c,0x01,0xb3 }},
+ {16, 0x9000, 0, {0x02,0x28,0xc0,0x0b,0xb0,0x0a,0x0c,0x00,0x81,0x00,0x2e,0xc0,0x0a,0xb4,0x82,0xd2 }},
+ {16, 0x9010, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x00,0xfe,0x40,0xb6,0x80 }},
+ {16, 0x9020, 0, {0x0c,0xe4,0x03,0x78,0x80,0xfe,0x74,0x32,0x80,0x0b,0xe6,0x03,0xf9,0x00,0xfe,0x00 }},
+ {16, 0x9030, 0, {0x3e,0x80,0x0c,0xe0,0x03,0x28,0x00,0xfa,0x00,0x3e,0x80,0x4d,0xa0,0x03,0xa8,0x00 }},
+ {16, 0x9040, 0, {0xda,0x04,0x3e,0x80,0x0c,0xe4,0x03,0xfa,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9050, 0, {0x48,0x00,0xe0,0x00,0xf8,0x00,0x3e,0x00,0x2e,0x80,0x23,0xe0,0x00,0xf8,0x01,0x3c }},
+ {16, 0x9060, 0, {0x00,0x0e,0x80,0x03,0xe0,0x20,0xf8,0x20,0x3e,0x01,0x8f,0x89,0x03,0xe0,0x00,0xf8 }},
+ {16, 0x9070, 0, {0x00,0x3a,0x10,0x0e,0x80,0x01,0xe0,0x00,0xe8,0x40,0x7e,0x00,0x4f,0x80,0x03,0xd2 }},
+ {16, 0x9080, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x02,0xc9,0x01,0x7e,0x40 }},
+ {16, 0x9090, 0, {0x2c,0x90,0x0b,0x24,0x00,0xf9,0x00,0x3e,0x68,0x05,0x90,0x13,0xa4,0x04,0xd9,0x00 }},
+ {16, 0x90a0, 0, {0x32,0x41,0x0e,0x91,0x03,0xe4,0x00,0xf9,0x00,0x3e,0x60,0x0e,0x90,0x03,0x24,0x00 }},
+ {16, 0x90b0, 0, {0xf1,0x00,0x32,0x40,0x68,0x90,0x43,0x82,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x90c0, 0, {0x80,0x04,0x64,0x00,0x89,0x00,0x6e,0x40,0x08,0x90,0x42,0x24,0x00,0xb9,0x00,0x2e }},
+ {16, 0x90d0, 0, {0x70,0x88,0x90,0x03,0x24,0x00,0xb9,0x00,0x22,0x40,0x08,0x98,0x12,0xe4,0x00,0xb9 }},
+ {16, 0x90e0, 0, {0x00,0x2e,0x40,0x0a,0x90,0x0a,0x26,0x00,0xb9,0x80,0xa2,0x40,0x08,0x90,0x12,0x20 }},
+ {16, 0x90f0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0x89,0x04,0x2c,0x40 }},
+ {16, 0x9100, 0, {0x08,0x90,0x02,0x24,0x01,0xb9,0x00,0x2a,0x40,0x0b,0xb0,0x02,0xa4,0x01,0xb9,0x00 }},
+ {16, 0x9110, 0, {0xe0,0x40,0x0a,0x90,0x82,0xa4,0x00,0xb9,0x00,0x2c,0x48,0x0a,0x98,0x02,0x24,0x80 }},
+ {16, 0x9120, 0, {0x39,0x20,0x22,0x40,0x2a,0x90,0x02,0x86,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9130, 0, {0x08,0x04,0x04,0x80,0x81,0x00,0x2c,0x48,0x08,0x10,0x12,0x04,0x10,0xb1,0x04,0x2c }},
+ {16, 0x9140, 0, {0xd8,0x0a,0x10,0x02,0x04,0x00,0xb1,0x00,0x20,0x48,0x08,0x10,0x02,0xc4,0x80,0xb1 }},
+ {16, 0x9150, 0, {0x22,0x2c,0x50,0x8a,0x32,0x82,0x05,0xa0,0xb1,0x2a,0x20,0x4a,0x0a,0x12,0x82,0x02 }},
+ {16, 0x9160, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x61,0x50,0xc8,0x52,0x2e,0x14 }},
+ {16, 0x9170, 0, {0x0c,0x85,0x03,0x21,0x40,0xf8,0x50,0x3a,0x00,0x1f,0x85,0x03,0xa1,0x40,0xf8,0x50 }},
+ {16, 0x9180, 0, {0x32,0x14,0x0e,0x80,0x03,0xa1,0x40,0xf8,0x50,0x3c,0x80,0x0e,0x02,0x03,0x20,0x80 }},
+ {16, 0x9190, 0, {0xfa,0x20,0x32,0x08,0x0e,0x82,0x13,0xae,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x91a0, 0, {0x98,0x1d,0xe4,0x50,0xfd,0x00,0x3e,0x44,0x0f,0xd0,0x03,0xf4,0x00,0xfd,0x00,0x3e }},
+ {16, 0x91b0, 0, {0x44,0x8d,0xd0,0x01,0xbd,0x00,0xfd,0x02,0x3e,0x44,0x0f,0xd4,0x00,0xe4,0x48,0x79 }},
+ {16, 0x91c0, 0, {0x14,0x3e,0x50,0x0f,0x92,0xa2,0xf4,0x08,0xfd,0x00,0x3e,0x4a,0x0d,0xd2,0x83,0xe6 }},
+ {16, 0x91d0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xe7,0x00,0xf9,0x10,0x3a,0x6e }},
+ {16, 0x91e0, 0, {0x0c,0xb1,0x03,0xe4,0x40,0xf9,0x44,0x3b,0x61,0x8e,0x94,0x03,0xe4,0x00,0xe9,0x40 }},
+ {16, 0x91f0, 0, {0x32,0x66,0x0f,0xda,0x0b,0xa7,0x28,0xc9,0xe0,0x3f,0x68,0x0c,0xda,0x83,0xb3,0x20 }},
+ {16, 0x9200, 0, {0xed,0xa0,0x33,0x79,0x08,0xd8,0x03,0x46,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9210, 0, {0x38,0x10,0xe2,0x00,0xb8,0xa0,0x2e,0x38,0x08,0x8a,0x02,0xe2,0x88,0xe8,0x81,0x2e }},
+ {16, 0x9220, 0, {0x14,0x09,0x0a,0x03,0xe2,0x80,0xb8,0x80,0x32,0x30,0x0b,0x85,0x02,0x21,0x01,0xa8 }},
+ {16, 0x9230, 0, {0xf4,0x38,0x2a,0x08,0x0e,0xca,0x23,0x90,0xc8,0x54,0x34,0x38,0x08,0x8a,0x92,0x0e }},
+ {16, 0x9240, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc5,0x00,0xb1,0x00,0x28,0x40 }},
+ {16, 0x9250, 0, {0x19,0x10,0x02,0xc4,0x00,0xb1,0x20,0x28,0x40,0x0b,0x10,0x06,0xc4,0x20,0xa1,0xa2 }},
+ {16, 0x9260, 0, {0x6c,0x48,0x0b,0x10,0x02,0x84,0x08,0x81,0x20,0x2c,0x50,0x09,0x10,0x02,0xc4,0x04 }},
+ {16, 0x9270, 0, {0xb1,0x00,0x24,0x58,0x08,0x3c,0x02,0x42,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9280, 0, {0x18,0x15,0xa4,0x01,0xb9,0x20,0x2c,0x40,0x09,0x90,0x02,0xe4,0x10,0xa9,0x40,0x2e }},
+ {16, 0x9290, 0, {0x40,0x0b,0x90,0x02,0xa4,0x00,0xb1,0x01,0x2a,0x40,0x0b,0x94,0x02,0x24,0x00,0xa9 }},
+ {16, 0x92a0, 0, {0x00,0x2a,0x40,0x01,0x10,0x52,0x64,0x00,0x89,0x00,0x26,0x40,0x00,0x98,0x02,0x46 }},
+ {16, 0x92b0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x00,0xf9,0x61,0x3a,0x40 }},
+ {16, 0x92c0, 0, {0x0d,0x90,0x83,0xe5,0x20,0xf9,0x01,0x3a,0x40,0x2e,0x90,0x02,0xe4,0x40,0xe9,0x01 }},
+ {16, 0x92d0, 0, {0x9e,0x40,0x0f,0x94,0x03,0xa4,0x00,0x89,0x00,0x3e,0x40,0x2d,0x90,0x02,0xe6,0x08 }},
+ {16, 0x92e0, 0, {0xb9,0x01,0x36,0x40,0x2c,0x90,0x01,0x68,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x92f0, 0, {0x28,0x01,0xa4,0x00,0xf9,0x00,0x3e,0x40,0x2e,0x90,0x03,0xe4,0x80,0xf9,0x00,0x3c }},
+ {16, 0x9300, 0, {0x40,0x0c,0x9c,0x23,0xe4,0x00,0xf9,0x00,0x36,0x40,0x0f,0x10,0x43,0x84,0x00,0xf9 }},
+ {16, 0x9310, 0, {0x02,0x3e,0x40,0x0e,0x90,0x03,0x80,0x80,0xf9,0x00,0x3c,0x40,0x2f,0x90,0x03,0x8a }},
+ {16, 0x9320, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xc8,0x40,0x36,0x01 }},
+ {16, 0x9330, 0, {0x0d,0x84,0x03,0xe1,0x00,0xe8,0x40,0x3e,0x08,0x0c,0x80,0x03,0xe1,0x00,0xf8,0x00 }},
+ {16, 0x9340, 0, {0x32,0x00,0x8f,0x80,0x03,0xa0,0x10,0xf8,0x00,0x32,0x04,0x0e,0x80,0x83,0x60,0x00 }},
+ {16, 0x9350, 0, {0xf8,0x00,0x3e,0x00,0x0c,0x00,0x03,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9360, 0, {0x28,0x05,0x28,0x00,0x8a,0x01,0x22,0x80,0x08,0xa0,0x24,0xe8,0x00,0x0a,0x00,0x2f }},
+ {16, 0x9370, 0, {0x80,0x1a,0xa0,0x02,0x28,0x00,0xba,0x00,0x16,0x80,0x0b,0xe0,0x03,0x28,0x08,0xea }},
+ {16, 0x9380, 0, {0x00,0x33,0x90,0x08,0xec,0x1b,0x22,0x80,0xc6,0x14,0x2f,0x91,0x08,0xa0,0x43,0x4a }},
+ {16, 0x9390, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0x93,0x00,0x24,0xc0 }},
+ {16, 0x93a0, 0, {0x09,0x30,0x12,0xcc,0x04,0xa3,0x04,0x6c,0xc0,0x09,0x30,0x02,0x8c,0x00,0xb3,0x00 }},
+ {16, 0x93b0, 0, {0x2c,0xc0,0x13,0x30,0x02,0x8c,0x00,0xb3,0x00,0xe6,0xb8,0x0a,0x38,0x02,0x44,0x08 }},
+ {16, 0x93c0, 0, {0x82,0x50,0x2c,0xd2,0x3a,0x30,0x02,0x8a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x93d0, 0, {0xa0,0x01,0x0e,0x80,0x97,0xb4,0x21,0xc4,0x49,0x71,0x02,0xde,0x81,0x87,0x21,0x2d }},
+ {16, 0x93e0, 0, {0xd0,0x0b,0x7b,0x02,0x1c,0x01,0xbf,0x20,0x29,0xc4,0x0b,0x30,0x02,0x5c,0x00,0xa7 }},
+ {16, 0x93f0, 0, {0xa1,0x21,0xc0,0x4a,0x70,0x8a,0x0c,0x81,0x84,0x00,0x2d,0xd0,0x0a,0x50,0x02,0xe8 }},
+ {16, 0x9400, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0x82,0xdf,0xa0,0x34,0xec }},
+ {16, 0x9410, 0, {0x0d,0x79,0x02,0xfe,0x80,0xe7,0xe8,0x2f,0xa0,0x09,0x7a,0x02,0x9e,0x00,0xf7,0xa2 }},
+ {16, 0x9420, 0, {0x25,0xea,0x0b,0x48,0x03,0x9e,0x04,0xff,0xc0,0x65,0xe4,0x0e,0x68,0x03,0x5f,0x00 }},
+ {16, 0x9430, 0, {0xe4,0x80,0x3d,0xe0,0x0e,0xf8,0x03,0xaa,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9440, 0, {0x08,0x1d,0xac,0x48,0xeb,0x05,0x3e,0xd9,0x0e,0xb2,0x03,0xec,0x00,0xfb,0x60,0x3e }},
+ {16, 0x9450, 0, {0xc0,0x0e,0xb2,0x83,0xac,0x00,0xf3,0x50,0xa6,0xc0,0x4f,0xb0,0x03,0xac,0x00,0xfb }},
+ {16, 0x9460, 0, {0x80,0x3f,0xd8,0x0d,0xa0,0x03,0xec,0x0a,0xf9,0x00,0x3e,0xc0,0x0d,0x90,0x03,0x42 }},
+ {16, 0x9470, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xfe,0x00,0xbb,0x90,0x3e,0xe0 }},
+ {16, 0x9480, 0, {0x08,0x39,0x03,0x9e,0x20,0xcf,0x82,0x77,0xe0,0x1f,0xf8,0x03,0xee,0x00,0xff,0xc0 }},
+ {16, 0x9490, 0, {0x3f,0xe5,0x0d,0xf9,0x03,0xee,0x00,0xfb,0x90,0x37,0xa0,0x08,0xf8,0x0f,0x1e,0x00 }},
+ {16, 0x94a0, 0, {0xcc,0x94,0x33,0x60,0x0d,0xf8,0x03,0xc0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x94b0, 0, {0xa8,0x11,0x9c,0x00,0xb7,0x90,0x2f,0xe4,0x08,0x7a,0x02,0x1e,0x00,0x8f,0x12,0x25 }},
+ {16, 0x94c0, 0, {0xd8,0x0b,0xbb,0x02,0x1e,0x00,0xb7,0x00,0x2d,0xe8,0x08,0x7d,0x82,0xde,0x40,0xbb }},
+ {16, 0x94d0, 0, {0xa0,0x27,0x90,0x0a,0x76,0x02,0x5c,0x80,0x85,0x00,0x37,0xc4,0x4d,0x71,0x03,0xea }},
+ {16, 0x94e0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x00,0xb7,0x20,0x2d,0xc0 }},
+ {16, 0x94f0, 0, {0x29,0xf2,0x22,0xbc,0x80,0x97,0x00,0x25,0x41,0x0b,0x70,0x12,0x9c,0x00,0xb7,0x08 }},
+ {16, 0x9500, 0, {0x29,0xc0,0x08,0x42,0x12,0xdc,0x40,0xb7,0x00,0x29,0xc0,0x09,0x60,0x22,0xdc,0x10 }},
+ {16, 0x9510, 0, {0x80,0x00,0x21,0x40,0x09,0x70,0x02,0xc0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9520, 0, {0x20,0x14,0xcc,0x00,0xb3,0xc0,0x2e,0xc0,0x08,0x34,0x82,0x2d,0x00,0x93,0x00,0x24 }},
+ {16, 0x9530, 0, {0xc0,0x0b,0x30,0x02,0x0f,0x80,0x13,0x00,0x2c,0xc0,0x0a,0x34,0xa2,0xec,0x00,0xb3 }},
+ {16, 0x9540, 0, {0x00,0x28,0xc0,0x0b,0x00,0x02,0xcc,0x00,0x81,0x00,0x20,0xc0,0x09,0x30,0x02,0x89 }},
+ {16, 0x9550, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x11,0xbc,0x00,0xff,0xe0,0x3f,0xc0 }},
+ {16, 0x9560, 0, {0x0c,0xf4,0x83,0xbd,0x00,0xdf,0x08,0x36,0x40,0x0b,0x75,0x42,0xfc,0x20,0xff,0x80 }},
+ {16, 0x9570, 0, {0x3b,0xc0,0x2c,0x3c,0x03,0xfc,0x00,0xbf,0x00,0xbe,0xc0,0x8d,0x90,0x0b,0xac,0x02 }},
+ {16, 0x9580, 0, {0xca,0x00,0x22,0x80,0x0d,0xb0,0x02,0xea,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9590, 0, {0x80,0x00,0xec,0x00,0xfb,0x08,0x1e,0xc0,0x0f,0xb0,0x13,0xec,0x00,0xeb,0x00,0x3a }},
+ {16, 0x95a0, 0, {0x10,0x0f,0xb0,0x23,0xac,0x01,0xfb,0x00,0x3e,0xc0,0x3c,0x84,0x03,0xec,0x00,0xfb }},
+ {16, 0x95b0, 0, {0x00,0x26,0x40,0x0e,0x94,0x0b,0x2c,0x00,0xf9,0x40,0x3e,0x90,0x0e,0x90,0x13,0xe0 }},
+ {16, 0x95c0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xdc,0x02,0xcf,0x00,0x3f,0xc0 }},
+ {16, 0x95d0, 0, {0x0d,0xf0,0x0b,0x3c,0x20,0xcf,0x00,0x3d,0x00,0x0e,0xf0,0x07,0x9c,0x01,0xcf,0x02 }},
+ {16, 0x95e0, 0, {0x3e,0xc0,0x0f,0xc4,0x03,0x3c,0x00,0xcf,0x00,0x0f,0xc0,0x0e,0x44,0x03,0x1f,0x02 }},
+ {16, 0x95f0, 0, {0xcc,0x00,0x3f,0x80,0x2c,0x70,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9600, 0, {0x81,0x04,0x6c,0x00,0x8b,0x02,0x2e,0xc0,0x0d,0xb0,0x02,0x2c,0x00,0xab,0x00,0x06 }},
+ {16, 0x9610, 0, {0x20,0x08,0xb0,0x03,0xfc,0x00,0xab,0x00,0x2e,0xc0,0x0f,0x80,0x06,0xbc,0x00,0xab }},
+ {16, 0x9620, 0, {0x04,0x3a,0xf0,0x0c,0x88,0x02,0x2c,0x00,0xc9,0x80,0x3a,0x92,0x08,0x90,0x0a,0xa0 }},
+ {16, 0x9630, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0xab,0x00,0x2e,0xc0 }},
+ {16, 0x9640, 0, {0x09,0x30,0x02,0x2c,0x00,0x8b,0x00,0x26,0x60,0x0b,0xb0,0x02,0xac,0x00,0x8b,0x00 }},
+ {16, 0x9650, 0, {0x6e,0xc0,0x0b,0xb0,0x42,0x2c,0x00,0x9b,0x00,0x4c,0xe0,0x0a,0x90,0x22,0x2c,0x00 }},
+ {16, 0x9660, 0, {0x8a,0xc2,0x2c,0x40,0x08,0xb0,0x42,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9670, 0, {0x08,0x04,0x0c,0x00,0x83,0x0d,0x2c,0xc6,0x09,0x31,0x02,0x0d,0x81,0xa3,0x11,0x24 }},
+ {16, 0x9680, 0, {0x00,0x8a,0xb1,0xe2,0x4c,0x80,0xa3,0x00,0x2c,0xcc,0x0b,0x02,0x02,0x8c,0x80,0xa3 }},
+ {16, 0x9690, 0, {0x48,0x08,0xc0,0x08,0x00,0x0a,0x0d,0x00,0x81,0x00,0x28,0xc0,0x08,0x30,0x02,0x82 }},
+ {16, 0x96a0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x6c,0x00,0xcb,0x20,0x2f,0xc8 }},
+ {16, 0x96b0, 0, {0x8d,0xf6,0x13,0x2d,0xb0,0x8f,0x00,0x36,0x40,0x0f,0xf0,0x02,0xad,0xa8,0x8f,0x10 }},
+ {16, 0x96c0, 0, {0x3f,0xca,0x0b,0x80,0x92,0x2c,0x10,0xdb,0x40,0x3f,0xc0,0x0e,0x00,0x03,0x2d,0x04 }},
+ {16, 0x96d0, 0, {0xc8,0x02,0x3e,0x40,0x0c,0xb0,0x03,0x00,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x96e0, 0, {0xa0,0x1d,0xfc,0x00,0xff,0x00,0x3f,0xc8,0x0e,0xf1,0x03,0xec,0x84,0xff,0x20,0x37 }},
+ {16, 0x96f0, 0, {0x00,0x0d,0xb2,0x03,0xbc,0xa0,0xff,0x00,0x3e,0xc9,0x0e,0x80,0x03,0xfd,0x11,0xff }},
+ {16, 0x9700, 0, {0x00,0x3b,0xc0,0x0e,0xc0,0x03,0xfc,0x80,0xed,0x00,0x3b,0xc0,0x0f,0xf0,0x43,0x68 }},
+ {16, 0x9710, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0xfc,0x90,0xcc,0x92,0x3b,0xc8 }},
+ {16, 0x9720, 0, {0x0d,0xf0,0x83,0x73,0x10,0xff,0x28,0x37,0xca,0x4f,0xb2,0x03,0xfc,0x00,0xdf,0x20 }},
+ {16, 0x9730, 0, {0xb3,0xc4,0x0d,0x68,0x43,0xfe,0x14,0xcb,0x84,0x33,0xe0,0x0d,0x78,0x03,0xbe,0x00 }},
+ {16, 0x9740, 0, {0xff,0x80,0x37,0xa0,0x0c,0xf3,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9750, 0, {0x80,0x00,0xfc,0x48,0x82,0x21,0x03,0xf4,0x0f,0xf6,0x42,0x20,0x04,0x8a,0x60,0x2b }},
+ {16, 0x9760, 0, {0xda,0x0b,0xf9,0x02,0x3f,0x04,0x8f,0x52,0x23,0xd5,0x4d,0x88,0x02,0xae,0x00,0xdb }},
+ {16, 0x9770, 0, {0x80,0x36,0xc0,0x08,0x80,0x02,0x20,0x04,0xb8,0x00,0x22,0x60,0x0d,0x74,0x03,0xe0 }},
+ {16, 0x9780, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0xa0,0x80,0x01,0x08,0xc0 }},
+ {16, 0x9790, 0, {0x4b,0x30,0x82,0x42,0x90,0xa3,0x08,0x2c,0xc8,0x1a,0x30,0x22,0x8d,0x00,0x93,0x00 }},
+ {16, 0x97a0, 0, {0x24,0xc8,0x09,0xa0,0x12,0x0c,0x04,0xab,0x00,0x62,0xc0,0x09,0xb0,0x02,0xcc,0x00 }},
+ {16, 0x97b0, 0, {0xb3,0x00,0x28,0x80,0x08,0x36,0x06,0xa2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x97c0, 0, {0xc0,0x15,0xac,0x00,0x88,0x08,0x22,0xc0,0x0a,0x30,0x1a,0x00,0x11,0x82,0x00,0x0a }},
+ {16, 0x97d0, 0, {0xc0,0x0b,0xb0,0x42,0x2c,0x00,0x8b,0x00,0x26,0xc0,0x09,0x91,0x02,0xec,0x20,0xbb }},
+ {16, 0x97e0, 0, {0x28,0x66,0xc0,0x08,0x80,0x02,0x60,0x00,0xb8,0x00,0x2a,0x40,0x81,0xb0,0x06,0xf8 }},
+ {16, 0x97f0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0xec,0x02,0xc8,0x04,0x3a,0xc0 }},
+ {16, 0x9800, 0, {0x89,0xb0,0x03,0x68,0x00,0xe9,0xc1,0x1e,0xc1,0x0e,0x30,0x03,0xec,0x00,0xdb,0x00 }},
+ {16, 0x9810, 0, {0x36,0xc1,0x0d,0x00,0x23,0x0e,0x00,0xeb,0x80,0x32,0xc8,0xcd,0x30,0x32,0xec,0x08 }},
+ {16, 0x9820, 0, {0xf3,0x00,0x3c,0x80,0x0c,0xb0,0x06,0x80,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9830, 0, {0xe0,0x01,0x9c,0x00,0x7c,0x00,0x3f,0xc0,0x0b,0xb0,0x43,0xfd,0x00,0xbe,0xc4,0x37 }},
+ {16, 0x9840, 0, {0xc0,0x1f,0xf0,0x03,0x5c,0x00,0xff,0x01,0x3b,0xc0,0x0e,0xc8,0x03,0xbf,0x20,0xdf }},
+ {16, 0x9850, 0, {0x00,0x3f,0xd0,0x0f,0xc0,0x13,0xb0,0x00,0x7c,0x00,0xb7,0x40,0x0f,0xf0,0x1b,0xb0 }},
+ {16, 0x9860, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x0c,0xd8,0x41,0x32,0xc0 }},
+ {16, 0x9870, 0, {0x0e,0xb0,0x07,0xa8,0x01,0x69,0x40,0xb2,0xc0,0x8d,0xb0,0xa3,0xec,0x08,0xf3,0x00 }},
+ {16, 0x9880, 0, {0x32,0xc0,0x0f,0x80,0x03,0xed,0x00,0xfb,0x48,0x3a,0xc0,0x0d,0xb0,0x83,0x2c,0x00 }},
+ {16, 0x9890, 0, {0xfb,0x20,0x3e,0x80,0x0f,0x70,0x23,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x98a0, 0, {0xc8,0x05,0x3c,0x00,0x88,0x00,0x23,0xc0,0x08,0xf0,0x06,0x2c,0x10,0x88,0x51,0x37 }},
+ {16, 0x98b0, 0, {0xc0,0x08,0xf0,0x07,0x7d,0x60,0x8f,0x02,0x37,0xc0,0x0b,0x8c,0x00,0x2d,0x00,0xb3 }},
+ {16, 0x98c0, 0, {0x00,0x38,0xc0,0x08,0x80,0x82,0x20,0x00,0xb8,0x00,0x2e,0x50,0x0b,0xf0,0x00,0x32 }},
+ {16, 0x98d0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x00,0x98,0x00,0x28,0xc0 }},
+ {16, 0x98e0, 0, {0x0a,0x30,0x02,0x84,0x04,0xa3,0x00,0x00,0xc0,0x68,0x39,0x06,0x0c,0x10,0x93,0x20 }},
+ {16, 0x98f0, 0, {0x22,0xc0,0x9b,0x01,0xa0,0x8f,0x14,0x33,0x14,0x28,0xc0,0x09,0x3c,0x02,0x0c,0x01 }},
+ {16, 0x9900, 0, {0x93,0x40,0x2c,0x88,0x0b,0x30,0x02,0xb8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9910, 0, {0x60,0x01,0x1e,0x10,0x87,0x80,0x29,0xe0,0x08,0x78,0x02,0x3e,0x00,0x83,0x90,0x24 }},
+ {16, 0x9920, 0, {0xe0,0x08,0x78,0x10,0xce,0x04,0x07,0x91,0x25,0xe0,0x83,0xc9,0x02,0x1e,0x04,0xb7 }},
+ {16, 0x9930, 0, {0x84,0x2b,0xa4,0x08,0x48,0x42,0x12,0xcc,0xb4,0x80,0x2d,0x64,0x0b,0x78,0x02,0x19 }},
+ {16, 0x9940, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x2c,0x00,0xd0,0x10,0x28,0xc8 }},
+ {16, 0x9950, 0, {0x0e,0x3b,0x02,0x84,0x00,0xe3,0x40,0x30,0xc8,0x0c,0x38,0x62,0x8c,0x00,0x53,0x00 }},
+ {16, 0x9960, 0, {0x30,0xc4,0x1f,0x00,0x23,0x8c,0x3c,0xf3,0x80,0x18,0xc0,0x0d,0x30,0x03,0x0e,0x80 }},
+ {16, 0x9970, 0, {0xd3,0x10,0x3c,0x80,0x0f,0x30,0x03,0x92,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9980, 0, {0x40,0x1d,0xbd,0x00,0xf9,0x12,0xb4,0xc0,0x07,0xb0,0x03,0xcc,0x00,0x4a,0x00,0x77 }},
+ {16, 0x9990, 0, {0xc0,0x0e,0x71,0x43,0x6c,0x00,0xf3,0x00,0x3f,0xd0,0x1f,0xd0,0x53,0xac,0x68,0xfb }},
+ {16, 0x99a0, 0, {0x18,0x3d,0xc0,0x0f,0xc0,0x13,0xf0,0x50,0xfc,0x04,0x3f,0x40,0x0f,0xf4,0x03,0x90 }},
+ {16, 0x99b0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xed,0x40,0xf8,0x04,0x3e,0xd2 }},
+ {16, 0x99c0, 0, {0x0f,0xb3,0x13,0xe0,0x10,0xf9,0x00,0xb2,0xcc,0x0e,0xba,0x03,0x6d,0x80,0xdb,0x02 }},
+ {16, 0x99d0, 0, {0x32,0xdc,0x4f,0x00,0x03,0x6c,0x04,0xf3,0x02,0x36,0x40,0x0e,0xb0,0x03,0xcc,0x00 }},
+ {16, 0x99e0, 0, {0x4b,0x00,0x3c,0x80,0x0c,0xf1,0x03,0x62,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x99f0, 0, {0x48,0x11,0x9c,0x00,0xb4,0x00,0x2d,0xc9,0x0b,0x70,0x82,0xdc,0x00,0xbc,0x04,0x21 }},
+ {16, 0x9a00, 0, {0xc4,0x4b,0x37,0x02,0x0c,0xa0,0x8f,0x74,0x21,0xc0,0x0b,0x40,0x02,0x1c,0x81,0xb7 }},
+ {16, 0x9a10, 0, {0x20,0x2b,0xc0,0x08,0x40,0x02,0xd0,0x02,0x84,0x00,0x2d,0x40,0x0a,0xf2,0x02,0x12 }},
+ {16, 0x9a20, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x80,0xb4,0xc0,0x2d,0xe4 }},
+ {16, 0x9a30, 0, {0x0b,0x7a,0x02,0xd2,0x00,0xb5,0x88,0x21,0xe8,0x0a,0x78,0x02,0xde,0x40,0x97,0x00 }},
+ {16, 0x9a40, 0, {0x21,0xe8,0x0b,0xcc,0x46,0x5e,0x28,0xb7,0xc4,0x21,0xf0,0x0a,0x78,0x02,0xfe,0x08 }},
+ {16, 0x9a50, 0, {0x97,0x84,0x2d,0xa0,0x08,0x78,0x02,0x70,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9a60, 0, {0x08,0x14,0xcc,0x00,0xb0,0xc0,0x2c,0xc0,0x9b,0xb0,0x02,0xcc,0x20,0xb3,0x60,0x22 }},
+ {16, 0x9a70, 0, {0xc0,0x0b,0x30,0x02,0x8c,0x00,0x83,0x01,0x20,0xc0,0x1b,0x06,0x16,0x4f,0x00,0xb3 }},
+ {16, 0x9a80, 0, {0xa0,0x2a,0xf0,0x08,0x00,0x02,0xe0,0x00,0x90,0x00,0x2c,0x40,0x0a,0x30,0x02,0x02 }},
+ {16, 0x9a90, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x10,0xfe,0xc0,0x3e,0x80 }},
+ {16, 0x9aa0, 0, {0x0f,0xa0,0x03,0xf9,0x08,0xfe,0x40,0x22,0x80,0x0e,0xa0,0x03,0xe8,0x00,0xd2,0x00 }},
+ {16, 0x9ab0, 0, {0x32,0x80,0x8f,0xe0,0x03,0x58,0x00,0xf6,0x00,0x33,0xb0,0x0e,0x20,0x02,0xe8,0x0c }},
+ {16, 0x9ac0, 0, {0xd2,0x02,0x3c,0x80,0x0c,0xa0,0x03,0x7a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9ad0, 0, {0x48,0x00,0xe0,0x00,0xf8,0x20,0x3e,0x01,0x0b,0x80,0x03,0xe0,0x00,0xf0,0x40,0x3e }},
+ {16, 0x9ae0, 0, {0x00,0x57,0x80,0x23,0x00,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x84,0x03,0xa0,0x30,0x38 }},
+ {16, 0x9af0, 0, {0x00,0x3a,0x08,0x0f,0xc4,0x03,0xf0,0x00,0xec,0x00,0x3f,0x10,0x0f,0x80,0x03,0xd2 }},
+ {16, 0x9b00, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xd9,0x01,0x3c,0x48 }},
+ {16, 0x9b10, 0, {0x4c,0x90,0x0b,0x24,0x01,0xc9,0xc0,0x32,0x40,0xac,0x90,0x03,0xe4,0x00,0xd9,0x40 }},
+ {16, 0x9b20, 0, {0x30,0x40,0x0d,0x9a,0x03,0x22,0x84,0xc8,0x14,0x32,0x40,0x0e,0x90,0x03,0x24,0x00 }},
+ {16, 0x9b30, 0, {0xc9,0x00,0x82,0x68,0x2c,0x90,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9b40, 0, {0x80,0x04,0x64,0x00,0x89,0x00,0x2e,0x40,0x08,0x90,0x22,0x24,0x00,0x89,0x02,0x82 }},
+ {16, 0x9b50, 0, {0x40,0x08,0x90,0x02,0xe7,0x40,0x89,0x80,0x36,0x41,0x8d,0x18,0x02,0xa0,0x24,0xa8 }},
+ {16, 0x9b60, 0, {0x04,0x62,0x40,0x08,0x94,0x83,0x24,0x00,0x89,0x01,0x22,0x72,0x08,0x90,0x0b,0x20 }},
+ {16, 0x9b70, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x04,0x00,0x99,0x00,0x2a,0x40 }},
+ {16, 0x9b80, 0, {0x28,0x90,0x12,0x04,0x00,0x89,0x00,0x22,0x40,0x08,0x90,0x02,0xa4,0x20,0x99,0x00 }},
+ {16, 0x9b90, 0, {0x22,0x40,0x18,0x90,0x06,0x20,0x01,0x88,0x08,0x62,0x40,0x0a,0x90,0x02,0x34,0x10 }},
+ {16, 0x9ba0, 0, {0x8d,0x81,0x23,0x41,0x08,0x10,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9bb0, 0, {0x08,0x04,0x04,0x80,0x81,0x04,0x2c,0x48,0x08,0x12,0x02,0x04,0x02,0x83,0x20,0x20 }},
+ {16, 0x9bc0, 0, {0x48,0x08,0x12,0x02,0xc4,0x80,0x83,0x60,0x24,0x48,0x19,0x34,0x62,0xa5,0x04,0xa1 }},
+ {16, 0x9bd0, 0, {0x02,0x60,0x40,0x08,0xd0,0x02,0x54,0x00,0x8d,0x00,0x29,0x40,0x08,0x12,0x82,0x02 }},
+ {16, 0x9be0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x61,0x40,0xd8,0x50,0x3a,0x80 }},
+ {16, 0x9bf0, 0, {0x0c,0x85,0x02,0x21,0x44,0x88,0x50,0x32,0x14,0x4c,0x80,0x43,0xe0,0x00,0xd8,0x00 }},
+ {16, 0x9c00, 0, {0x22,0x14,0x0c,0x80,0x03,0x20,0x00,0xc8,0x00,0xa2,0x00,0x0e,0x80,0x03,0x20,0x00 }},
+ {16, 0x9c10, 0, {0xc8,0x00,0x33,0x00,0x0c,0x82,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9c20, 0, {0x98,0x1d,0xe4,0x44,0xfd,0x00,0x3e,0x44,0x0f,0x91,0x03,0xf4,0x10,0xff,0x10,0x3e }},
+ {16, 0x9c30, 0, {0x44,0x0f,0x91,0x03,0xe4,0x40,0xf9,0x10,0x3e,0x44,0x0b,0xf0,0x13,0xe5,0x10,0xf9 }},
+ {16, 0x9c40, 0, {0x40,0x3f,0x4a,0x2f,0x92,0x8a,0xa4,0xa2,0xf9,0x28,0x36,0x40,0x0f,0x92,0x83,0xa6 }},
+ {16, 0x9c50, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x11,0xe6,0xc0,0xc1,0x00,0x3f,0x69 }},
+ {16, 0x9c60, 0, {0x0c,0x9a,0x43,0x6c,0x00,0xfd,0xa0,0x3e,0x78,0x2c,0xd8,0x07,0xd6,0x02,0xd5,0x96 }},
+ {16, 0x9c70, 0, {0x32,0x78,0x0d,0x90,0x03,0x27,0x00,0xfd,0xa0,0x35,0x50,0x06,0xd4,0x03,0xe5,0x00 }},
+ {16, 0x9c80, 0, {0xfd,0x40,0xb3,0x40,0x0f,0x98,0xa3,0x46,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9c90, 0, {0x38,0x10,0xe3,0xc2,0x88,0x88,0x2e,0x14,0xa8,0x8a,0xc2,0x22,0xa0,0xb8,0xc0,0x2c }},
+ {16, 0x9ca0, 0, {0x24,0x48,0x84,0x02,0xe1,0x00,0x98,0xc4,0x20,0x3c,0x08,0x8a,0x82,0x23,0x80,0xb8 }},
+ {16, 0x9cb0, 0, {0x04,0x22,0x20,0x08,0x88,0x03,0xa2,0x00,0xb8,0xa0,0x22,0x00,0x0b,0x88,0x02,0x0e }},
+ {16, 0x9cc0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x80,0xa1,0x20,0x6c,0x40 }},
+ {16, 0x9cd0, 0, {0x0a,0x14,0x02,0x44,0x04,0xa1,0x68,0x2c,0x48,0x08,0x14,0x02,0xc5,0x00,0x81,0x60 }},
+ {16, 0x9ce0, 0, {0x20,0x48,0x19,0x90,0x02,0x85,0x81,0xb1,0x40,0x24,0x68,0x0a,0x12,0x42,0xc4,0x80 }},
+ {16, 0x9cf0, 0, {0xb9,0x20,0x20,0x40,0x8b,0x10,0x82,0x42,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9d00, 0, {0x18,0x05,0xa4,0x10,0xa9,0x00,0x6e,0xc0,0x0a,0x10,0x02,0x24,0x14,0xb9,0x00,0x2e }},
+ {16, 0x9d10, 0, {0x40,0x08,0x90,0x12,0xe4,0x00,0x99,0x00,0x22,0x40,0x08,0x80,0x06,0xa0,0x60,0xb9 }},
+ {16, 0x9d20, 0, {0x09,0x22,0x60,0x08,0x90,0x02,0xa4,0x00,0xb9,0x00,0x02,0x40,0x0b,0x10,0x06,0x06 }},
+ {16, 0x9d30, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x05,0xe4,0x00,0xe9,0x80,0x3e,0x41 }},
+ {16, 0x9d40, 0, {0x0e,0x90,0x03,0x64,0x00,0xe9,0xc0,0x3e,0x40,0x0c,0x90,0x02,0xe4,0x00,0xc9,0x00 }},
+ {16, 0x9d50, 0, {0x22,0x41,0x0d,0x80,0x02,0xa3,0x04,0xf1,0x40,0x36,0x40,0x0e,0x90,0x02,0xe4,0x00 }},
+ {16, 0x9d60, 0, {0xf1,0x00,0x12,0x40,0x0f,0x90,0x03,0x68,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9d70, 0, {0x28,0x01,0xa4,0x00,0xd9,0x22,0x3e,0x42,0x0d,0x90,0x03,0xe4,0x00,0xb9,0xc4,0x3c }},
+ {16, 0x9d80, 0, {0x40,0x0f,0x90,0x03,0xe4,0x00,0xe9,0x02,0xae,0x40,0x0f,0x80,0x4b,0x62,0x10,0xf9 }},
+ {16, 0x9d90, 0, {0x20,0x3e,0x40,0x0f,0x90,0x03,0xe4,0x00,0xf9,0x02,0x7e,0x41,0x0f,0x90,0x13,0xca }},
+ {16, 0x9da0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x00,0x80,0x00,0xc8,0x00,0x38,0x00 }},
+ {16, 0x9db0, 0, {0x0f,0x80,0x20,0xe0,0x00,0xa8,0x20,0x32,0x00,0x0c,0x80,0x07,0xe0,0x80,0xc8,0x00 }},
+ {16, 0x9dc0, 0, {0x38,0x00,0x0d,0x80,0x83,0x21,0x10,0xf8,0x60,0x32,0x00,0x8e,0x80,0xb3,0x20,0x08 }},
+ {16, 0x9dd0, 0, {0xf8,0x00,0x3e,0x00,0x0c,0x80,0x03,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9de0, 0, {0x28,0x05,0x28,0x04,0x8a,0x00,0x33,0x90,0x43,0xa0,0x22,0x28,0x00,0x8e,0x80,0x76 }},
+ {16, 0x9df0, 0, {0x80,0x08,0xe1,0x03,0x19,0x00,0x86,0x80,0x22,0x80,0x0d,0x60,0x01,0x78,0x00,0xbe }},
+ {16, 0x9e00, 0, {0x00,0x36,0x80,0x0c,0xe4,0x02,0xa8,0x10,0xbe,0xa0,0x2f,0x80,0x0d,0xa0,0x02,0x0a }},
+ {16, 0x9e10, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x11,0x4c,0x04,0x03,0x04,0x2c,0xd4 }},
+ {16, 0x9e20, 0, {0x0b,0x30,0x02,0x4c,0x01,0xa3,0xc4,0x20,0xc0,0x28,0x35,0x02,0x86,0x00,0x83,0x80 }},
+ {16, 0x9e30, 0, {0x28,0xc0,0x08,0x38,0x06,0x0e,0x94,0x30,0xc0,0xa2,0xc0,0x0b,0x3c,0x02,0x0c,0x00 }},
+ {16, 0x9e40, 0, {0xb3,0x80,0x2c,0x48,0x08,0x30,0x02,0x8a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9e50, 0, {0xa0,0x01,0x0c,0x04,0x8f,0x80,0x21,0xc1,0x1b,0x72,0x42,0x1e,0xc0,0x83,0x88,0x21 }},
+ {16, 0x9e60, 0, {0xc0,0x18,0x28,0x06,0x10,0x21,0x86,0x38,0x21,0xc0,0x19,0xf7,0x02,0x5d,0xc0,0xb4 }},
+ {16, 0x9e70, 0, {0x41,0x27,0xd0,0x08,0x78,0xc6,0x9c,0x00,0xb7,0x00,0x2f,0x60,0x09,0x72,0x02,0x28 }},
+ {16, 0x9e80, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0x02,0xc7,0x80,0x2d,0xa0 }},
+ {16, 0x9e90, 0, {0x0f,0x3e,0x03,0xfe,0x80,0xa7,0x80,0xa1,0xe0,0x0c,0x78,0x02,0x94,0x00,0x85,0xa0 }},
+ {16, 0x9ea0, 0, {0x39,0xe4,0x0c,0x78,0x13,0x1e,0x90,0xb5,0x84,0x31,0xe0,0x0f,0xf8,0x87,0x1e,0x04 }},
+ {16, 0x9eb0, 0, {0xf7,0x80,0x3d,0x60,0x0c,0x3b,0x03,0xaa,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9ec0, 0, {0x08,0x1d,0xad,0xe4,0xfb,0x54,0x3e,0x80,0x0f,0xb4,0x23,0xec,0x32,0xfb,0x00,0x3e }},
+ {16, 0x9ed0, 0, {0xd8,0x4f,0xa0,0x03,0xe4,0x00,0xf9,0x00,0x3e,0xc0,0x0f,0x30,0x33,0xec,0x04,0xf2 }},
+ {16, 0x9ee0, 0, {0x01,0x3e,0xc0,0x0f,0xb2,0x03,0xfe,0x10,0xfb,0x68,0x3c,0x41,0x0f,0xf0,0x43,0x82 }},
+ {16, 0x9ef0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xfe,0x00,0xcf,0xe4,0x3f,0xe4 }},
+ {16, 0x9f00, 0, {0x0c,0xfc,0x03,0x7e,0x80,0xcf,0x81,0x33,0xfa,0x0f,0xf8,0x03,0xf6,0x00,0xff,0x80 }},
+ {16, 0x9f10, 0, {0x3f,0xe2,0x0f,0x79,0x03,0x3e,0x40,0xf4,0x80,0x33,0x60,0x0c,0xe8,0x03,0x3e,0x00 }},
+ {16, 0x9f20, 0, {0xff,0x80,0x33,0x60,0x0c,0xf8,0x83,0x50,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9f30, 0, {0xa8,0x11,0x9c,0x00,0xd7,0xa0,0x2d,0xc4,0x08,0xba,0x02,0x3c,0xa0,0x87,0x20,0x21 }},
+ {16, 0x9f40, 0, {0xc0,0x0f,0x52,0x03,0xd4,0x00,0xb6,0x10,0x2d,0xc0,0x8b,0x73,0x03,0x5c,0x40,0xb4 }},
+ {16, 0x9f50, 0, {0xb0,0x2b,0x48,0x28,0x41,0x02,0x0c,0x00,0xbf,0x18,0x35,0x46,0x28,0x72,0x42,0x2a }},
+ {16, 0x9f60, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x9c,0x00,0x87,0x41,0x2d,0x44 }},
+ {16, 0x9f70, 0, {0x0a,0x73,0x02,0x9c,0xc4,0x81,0x00,0x6d,0xc8,0x8b,0x70,0x02,0xd4,0x00,0xb7,0x00 }},
+ {16, 0x9f80, 0, {0x2d,0xc0,0x0b,0xf0,0x46,0x9c,0x55,0xb4,0x20,0x25,0x40,0x18,0x60,0x82,0x1c,0x00 }},
+ {16, 0x9f90, 0, {0xb7,0x00,0x23,0x40,0x08,0x70,0x46,0x44,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9fa0, 0, {0x60,0x14,0xcc,0x00,0x93,0x00,0x2c,0x40,0x0b,0xb0,0x02,0x0c,0x82,0x80,0xc0,0x20 }},
+ {16, 0x9fb0, 0, {0xc0,0x0a,0x10,0x02,0x04,0x00,0xb3,0x00,0x2c,0xc0,0x1b,0x30,0x00,0xcd,0x01,0xb0 }},
+ {16, 0x9fc0, 0, {0x40,0xac,0x78,0x88,0x8c,0x06,0x0d,0x60,0xb3,0x4c,0x24,0x12,0x08,0x30,0x0a,0x18 }},
+ {16, 0x9fd0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x15,0xbc,0x00,0xc7,0x00,0x2e,0x40 }},
+ {16, 0x9fe0, 0, {0x0e,0xf0,0x2a,0xbf,0x00,0xc8,0xc8,0xbf,0xc0,0x0b,0x90,0x02,0xe4,0x04,0xbf,0x00 }},
+ {16, 0x9ff0, 0, {0x3f,0xc0,0x0f,0xb2,0x0a,0xac,0x00,0xf8,0x80,0x34,0x49,0x0c,0xb9,0x0b,0x3f,0x00 }},
+ {16, 0xa000, 0, {0xfb,0xc0,0x30,0xf0,0x0c,0xf0,0x03,0x6e,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa010, 0, {0x80,0x00,0xcc,0x00,0xfb,0x80,0x3e,0x41,0x2c,0xb0,0x13,0xac,0x00,0xf8,0x00,0x3e }},
+ {16, 0xa020, 0, {0xc1,0x0f,0xa0,0x03,0xe8,0x00,0xfa,0x40,0x3e,0xc0,0x0f,0xb0,0x0b,0x6d,0x40,0xf8 }},
+ {16, 0xa030, 0, {0x10,0x3a,0x40,0x0f,0xb0,0x03,0xec,0x10,0xfe,0x40,0x3e,0xc0,0x0f,0xf0,0x03,0xe1 }},
+ {16, 0xa040, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xec,0x0c,0xdf,0x00,0x3b,0x80 }},
+ {16, 0xa050, 0, {0x0f,0xf0,0x0b,0x3c,0x08,0xe7,0x08,0x33,0xc0,0x0b,0xd0,0x23,0x74,0x00,0x54,0x00 }},
+ {16, 0xa060, 0, {0x33,0xc0,0x0f,0xf0,0x83,0xbe,0x20,0xfd,0x0c,0x3b,0x60,0x2c,0xe0,0x03,0x3c,0x00 }},
+ {16, 0xa070, 0, {0xcf,0x12,0x33,0x50,0x0c,0x30,0x03,0x80,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa080, 0, {0x81,0x04,0x6c,0x04,0xab,0x00,0x22,0xa0,0x0b,0xb0,0x06,0x0c,0x00,0xab,0x40,0x36 }},
+ {16, 0xa090, 0, {0xc0,0x0b,0xa8,0x02,0x66,0x00,0xb8,0x00,0x36,0xc1,0x0b,0x34,0x43,0xee,0x00,0xb2 }},
+ {16, 0xa0a0, 0, {0x00,0x22,0x60,0x08,0xb4,0x82,0x8c,0x04,0x8a,0x21,0x22,0x40,0x08,0xb0,0x02,0x20 }},
+ {16, 0xa0b0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0x9b,0x00,0x2a,0x20 }},
+ {16, 0xa0c0, 0, {0x0b,0xb0,0x02,0x2c,0x00,0x88,0xc5,0x22,0xc0,0x0b,0x88,0x82,0xe6,0x01,0xbb,0x08 }},
+ {16, 0xa0d0, 0, {0x22,0xc0,0x0a,0xb2,0x82,0xac,0x60,0xb8,0x02,0x4a,0xc4,0x08,0xb1,0x02,0x2c,0x00 }},
+ {16, 0xa0e0, 0, {0x83,0x00,0x22,0xc0,0x08,0xb0,0x02,0xa0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa0f0, 0, {0x08,0x04,0x0c,0x00,0xab,0x20,0x20,0x01,0x0b,0x32,0x06,0x2c,0x00,0xa0,0x00,0x20 }},
+ {16, 0xa100, 0, {0xc0,0x09,0x04,0x22,0xc4,0x00,0xb2,0x00,0x24,0xc1,0x8b,0xb0,0x02,0x4c,0x00,0xb0 }},
+ {16, 0xa110, 0, {0x00,0x62,0xc0,0x48,0x30,0x02,0xac,0x10,0x82,0x00,0x20,0xc0,0x08,0x30,0x02,0x02 }},
+ {16, 0xa120, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x7c,0x08,0xdf,0x2a,0x3a,0x00 }},
+ {16, 0xa130, 0, {0x0f,0xf5,0x12,0x3c,0x10,0xc9,0x00,0xa3,0xc0,0x0f,0x80,0x53,0xec,0x01,0xda,0x00 }},
+ {16, 0xa140, 0, {0x33,0xc0,0x0e,0xb0,0x03,0xac,0x04,0xf8,0x70,0x3a,0xc0,0x0c,0x60,0x43,0x2c,0x42 }},
+ {16, 0xa150, 0, {0xcd,0x00,0xb2,0x40,0x2c,0xf0,0x03,0x80,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa160, 0, {0xa0,0x19,0xfc,0x00,0xfb,0x01,0x3d,0x00,0x0f,0xb4,0x17,0xfc,0x00,0x3c,0x00,0x3f }},
+ {16, 0xa170, 0, {0xc0,0x4f,0xc0,0x03,0x74,0x08,0xfe,0x00,0x3f,0xc0,0x4f,0xf0,0x03,0xfc,0x08,0xf8 }},
+ {16, 0xa180, 0, {0x30,0x3f,0xc0,0x0f,0xf0,0x03,0xfc,0x04,0xfc,0x00,0x3d,0x00,0x0f,0xf0,0x03,0xe8 }},
+ {16, 0xa190, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xf4,0x90,0xef,0x00,0x3f,0xd8 }},
+ {16, 0xa1a0, 0, {0x0e,0xf3,0x03,0x2c,0x01,0xd4,0x80,0x37,0xcc,0x0d,0x89,0x43,0x12,0x50,0xec,0x2c }},
+ {16, 0xa1b0, 0, {0x32,0x05,0x0d,0xb0,0x53,0x3c,0xd4,0xc5,0x94,0x7f,0xa0,0x8f,0xf0,0x43,0x30,0x00 }},
+ {16, 0xa1c0, 0, {0xdc,0x00,0x33,0x00,0x0c,0x48,0x07,0xf0,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa1d0, 0, {0x80,0x10,0xe6,0x40,0x8b,0x70,0x2f,0xdc,0x08,0xf7,0x02,0x0c,0x80,0x8a,0x20,0x00 }},
+ {16, 0xa1e0, 0, {0xc8,0x4a,0x22,0x02,0xa0,0x00,0x8a,0x48,0x22,0x58,0x88,0xfd,0x02,0xad,0x02,0xa9 }},
+ {16, 0xa1f0, 0, {0x20,0x1e,0xa0,0x03,0x80,0x02,0x2c,0x04,0x8b,0x00,0x22,0xc0,0x4c,0x88,0x07,0x60 }},
+ {16, 0xa200, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xc0,0x00,0x23,0x2c,0x2c,0xc9 }},
+ {16, 0xa210, 0, {0x02,0x30,0x02,0x0c,0x68,0xa0,0x28,0x2c,0xd0,0x09,0x12,0x02,0x84,0x00,0xa0,0x21 }},
+ {16, 0xa220, 0, {0x20,0x18,0x19,0x30,0x22,0x80,0xd0,0x83,0x06,0x0c,0xa0,0x0b,0xb0,0x06,0x00,0x12 }},
+ {16, 0xa230, 0, {0xa0,0x00,0x20,0x00,0x29,0x00,0x0e,0xa2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa240, 0, {0xc0,0x11,0xa8,0x30,0x8b,0x00,0x2e,0xc0,0x4a,0x30,0x0a,0x2c,0x14,0xa0,0x80,0x0a }},
+ {16, 0xa250, 0, {0xc1,0x08,0x88,0x86,0x87,0x00,0x83,0x00,0x22,0x49,0x08,0xb0,0x06,0xa0,0x40,0xab }},
+ {16, 0xa260, 0, {0x20,0x22,0x20,0x0b,0x80,0x0a,0x0c,0x04,0xab,0x02,0x22,0xc0,0x88,0x80,0x02,0xf0 }},
+ {16, 0xa270, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xef,0x40,0xeb,0x06,0x3e,0xc0 }},
+ {16, 0xa280, 0, {0x0e,0xb0,0x03,0x2c,0x02,0xf9,0xa0,0x3e,0xc0,0x0d,0x8c,0x03,0xaa,0x10,0xe9,0x40 }},
+ {16, 0xa290, 0, {0xb2,0x48,0x0d,0xb0,0x43,0xad,0x00,0xcb,0x86,0x2e,0x20,0x0f,0x30,0x03,0x24,0x00 }},
+ {16, 0xa2a0, 0, {0xf9,0x80,0x32,0xc0,0x0d,0x0c,0xc2,0x90,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa2b0, 0, {0xe0,0x01,0x94,0x00,0xff,0x00,0x3d,0xc0,0x0d,0xf0,0x03,0x7c,0x00,0xdf,0x00,0x37 }},
+ {16, 0xa2c0, 0, {0xc0,0x0f,0xe0,0x03,0xf0,0x00,0xfe,0x20,0x3f,0x40,0x0f,0x70,0x03,0xfe,0x00,0xff }},
+ {16, 0xa2d0, 0, {0x82,0x7f,0x00,0x0f,0xc0,0x03,0xf9,0x04,0xde,0x20,0xbd,0x00,0x0f,0xd9,0x0b,0x7c }},
+ {16, 0xa2e0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x01,0xcb,0x00,0x3e,0xc0 }},
+ {16, 0xa2f0, 0, {0x2c,0xb0,0x0b,0x2c,0x00,0xe8,0x40,0x3e,0xc0,0x0f,0x94,0x07,0x29,0x00,0xc9,0x40 }},
+ {16, 0xa300, 0, {0xb2,0xc0,0x0f,0xb0,0x03,0x01,0x02,0xcb,0x00,0x32,0x04,0x4f,0xf0,0x43,0x34,0xc0 }},
+ {16, 0xa310, 0, {0xb5,0x1a,0x3f,0xc1,0x0f,0x80,0x93,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa320, 0, {0xc8,0x05,0x28,0x00,0x8f,0x00,0x2f,0xc0,0x08,0xf0,0x02,0x3c,0x04,0xd8,0x00,0x2b }},
+ {16, 0xa330, 0, {0xc0,0x0c,0x80,0x45,0x60,0x00,0x7b,0x58,0x22,0xc8,0x0b,0xfa,0x01,0x61,0x40,0x8b }},
+ {16, 0xa340, 0, {0x00,0x32,0x04,0x4b,0xce,0x02,0x28,0x00,0x3a,0x40,0x2e,0x07,0x0b,0x90,0x02,0x26 }},
+ {16, 0xa350, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x00,0x83,0x01,0x4c,0xc0 }},
+ {16, 0xa360, 0, {0x0b,0x30,0x02,0xec,0x10,0x90,0x00,0x2a,0xc0,0x0a,0x80,0x06,0xc0,0x04,0x83,0x04 }},
+ {16, 0xa370, 0, {0xa2,0x89,0x19,0x30,0x06,0xcc,0x00,0x83,0x00,0x20,0x90,0x0b,0x30,0xc2,0x48,0x00 }},
+ {16, 0xa380, 0, {0xb2,0x40,0x24,0x20,0x0b,0x09,0x00,0xb8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa390, 0, {0x20,0x01,0x06,0x04,0x87,0xa4,0x2d,0xe0,0x09,0x38,0x02,0xde,0x00,0x9e,0x81,0x29 }},
+ {16, 0xa3a0, 0, {0xe0,0x08,0x78,0x52,0xfa,0xc0,0x96,0x80,0x01,0xa0,0x8b,0x3a,0x22,0xce,0x40,0x8f }},
+ {16, 0xa3b0, 0, {0xb0,0x25,0xa0,0x0b,0x08,0x02,0x56,0x08,0xb5,0x90,0x2d,0xe4,0x4b,0xd8,0x22,0x0c }},
+ {16, 0xa3c0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x08,0x02,0x83,0x80,0x2e,0xe8 }},
+ {16, 0xa3d0, 0, {0x0b,0x38,0x13,0xce,0x41,0xd3,0x10,0x28,0xc0,0x0e,0x3a,0x02,0xc6,0x08,0x4b,0x40 }},
+ {16, 0xa3e0, 0, {0x30,0x60,0x0d,0x3b,0x27,0xcf,0xc4,0xc3,0xa0,0x30,0x00,0x0f,0x30,0x43,0x48,0x40 }},
+ {16, 0xa3f0, 0, {0xf2,0x00,0x3c,0x04,0x0f,0x02,0x03,0x92,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa400, 0, {0x40,0x1d,0xb8,0x00,0xff,0x00,0x3f,0xc4,0x0e,0xf1,0x03,0x3c,0x00,0xff,0x01,0x33 }},
+ {16, 0xa410, 0, {0xc0,0x4d,0xb1,0x07,0x7c,0x90,0xff,0x00,0x3f,0x40,0x03,0xf1,0x03,0x70,0x00,0xfb }},
+ {16, 0xa420, 0, {0x10,0x3b,0x00,0x0f,0xc0,0x0b,0xb4,0x00,0xfd,0x00,0x3f,0xc4,0x0f,0xd0,0x03,0x90 }},
+ {16, 0xa430, 0, {0x02,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x04,0xfb,0x84,0x3a,0xc2 }},
+ {16, 0xa440, 0, {0x4c,0xb4,0x93,0x2c,0x04,0xe9,0x00,0x3a,0xc4,0x8d,0x08,0x03,0x2e,0x00,0xcb,0x01 }},
+ {16, 0xa450, 0, {0x32,0x80,0x8f,0xb2,0x83,0xec,0x00,0xcb,0x80,0x32,0x00,0x0f,0xf9,0x03,0x3c,0x10 }},
+ {16, 0xa460, 0, {0xdf,0x81,0xb3,0xe0,0x8c,0xa0,0x03,0xea,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa470, 0, {0x48,0x11,0x94,0x08,0xb7,0x04,0x24,0xc8,0x1a,0x30,0x4a,0x1d,0x00,0xb7,0x01,0x2d }},
+ {16, 0xa480, 0, {0xc0,0x88,0x70,0x06,0x1c,0x00,0x82,0x00,0x21,0x80,0x4b,0x76,0x12,0xdc,0x00,0x87 }},
+ {16, 0xa490, 0, {0x00,0x29,0x40,0x8b,0x40,0x02,0x10,0x00,0xbc,0x00,0x20,0x01,0x28,0x70,0x03,0xb2 }},
+ {16, 0xa4a0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9a,0x00,0xb3,0x90,0x2d,0xe4 }},
+ {16, 0xa4b0, 0, {0x09,0x79,0x02,0x1e,0x80,0xa7,0x80,0x2c,0xe8,0x19,0xf8,0x12,0x5e,0x01,0x87,0x80 }},
+ {16, 0xa4c0, 0, {0x25,0xe0,0x4b,0x78,0x06,0xd2,0x00,0x97,0x80,0x21,0x62,0x0b,0x3a,0x02,0x1e,0x00 }},
+ {16, 0xa4d0, 0, {0xb7,0x86,0x29,0xf0,0x08,0x68,0x06,0xe0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa4e0, 0, {0x48,0x14,0xcf,0xc0,0xb3,0x00,0x24,0xc0,0x8a,0x30,0x32,0x0c,0x00,0xb3,0x08,0x2c }},
+ {16, 0xa4f0, 0, {0xc0,0x08,0x30,0x12,0x0e,0x20,0x83,0x00,0x24,0xf1,0x0b,0x30,0x06,0xce,0x00,0x83 }},
+ {16, 0xa500, 0, {0x90,0x28,0x60,0x0b,0x00,0x2a,0x21,0x80,0xb0,0x08,0x28,0x00,0x08,0x37,0x02,0x92 }},
+ {16, 0xa510, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xb9,0x00,0xfa,0x00,0x3e,0x80 }},
+ {16, 0xa520, 0, {0x4d,0xa0,0x03,0x28,0x00,0xee,0x41,0x3e,0x80,0x0d,0xe0,0x03,0x78,0x00,0x8e,0x40 }},
+ {16, 0xa530, 0, {0x27,0xa8,0x0b,0xa0,0x03,0xfb,0x02,0xca,0x82,0x33,0xa0,0x0f,0xa0,0x13,0x29,0x00 }},
+ {16, 0xa540, 0, {0xfa,0x40,0x3a,0x80,0x0c,0x6c,0x03,0xfa,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa550, 0, {0x48,0x00,0xc0,0x00,0xf8,0x00,0x3a,0x00,0x0c,0x80,0x03,0xe0,0x08,0xf8,0x00,0x3e }},
+ {16, 0xa560, 0, {0x00,0x8f,0x80,0x23,0xa0,0x42,0xf8,0x09,0xba,0x10,0x4f,0x80,0x03,0xe0,0x60,0xf8 }},
+ {16, 0xa570, 0, {0x00,0x3e,0x20,0x0f,0xc0,0x03,0xf0,0x00,0xfc,0x00,0x27,0x00,0x8f,0x80,0x03,0x92 }},
+ {16, 0xa580, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe5,0x00,0x89,0x00,0x3e,0x40 }},
+ {16, 0xa590, 0, {0x6e,0x90,0x03,0xa4,0x08,0xc9,0x00,0x3c,0x40,0x0d,0x90,0x03,0x24,0x10,0xf9,0xa0 }},
+ {16, 0xa5a0, 0, {0x32,0x42,0x0c,0x90,0x13,0xc4,0x00,0xc9,0x00,0x3e,0x40,0x0f,0x90,0x03,0xe4,0x40 }},
+ {16, 0xa5b0, 0, {0xc9,0x20,0x3e,0x52,0xcf,0x90,0x09,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa5c0, 0, {0x80,0x04,0x66,0x00,0x89,0x04,0x2e,0x40,0x08,0x90,0x02,0x24,0x00,0xd9,0x00,0x3a }},
+ {16, 0xa5d0, 0, {0x41,0x08,0x90,0x05,0xa4,0x00,0xb9,0x40,0xa2,0x40,0x0d,0x90,0x02,0xe5,0x46,0x89 }},
+ {16, 0xa5e0, 0, {0x00,0x2e,0x40,0x0b,0x90,0x12,0xe5,0x00,0xa9,0xc8,0x2e,0x61,0x8b,0x94,0x42,0x20 }},
+ {16, 0xa5f0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0x24,0x00,0xa9,0x00,0x6c,0x40 }},
+ {16, 0xa600, 0, {0x48,0x10,0x22,0x84,0x03,0xa9,0x00,0x2e,0x40,0x09,0x90,0x02,0xe4,0x04,0xb1,0x08 }},
+ {16, 0xa610, 0, {0x28,0x40,0x18,0x98,0x02,0xe5,0x00,0x89,0x00,0x2e,0x40,0x0b,0x90,0x02,0xf4,0x20 }},
+ {16, 0xa620, 0, {0x8d,0x00,0x2f,0x40,0x0b,0x94,0x42,0x86,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa630, 0, {0x08,0x04,0x04,0x80,0xa1,0x24,0x2c,0x48,0x18,0x12,0x02,0x04,0x80,0xa1,0x00,0x28 }},
+ {16, 0xa640, 0, {0x48,0x08,0x10,0x02,0x84,0x00,0x91,0x20,0x20,0x48,0x09,0x12,0x02,0xc4,0x94,0x81 }},
+ {16, 0xa650, 0, {0x00,0x2c,0x61,0x0b,0x5a,0x82,0xd4,0xa0,0xa5,0x28,0x2d,0x4a,0x0b,0x90,0x02,0x82 }},
+ {16, 0xa660, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x02,0xe8,0x50,0x2e,0x14 }},
+ {16, 0xa670, 0, {0x0e,0x85,0x03,0xa1,0x40,0xa8,0x50,0x3e,0x14,0x0d,0x85,0x01,0x81,0x40,0xf8,0x52 }},
+ {16, 0xa680, 0, {0x32,0x94,0x0c,0x80,0x13,0xc1,0x42,0xc0,0x51,0x3e,0x00,0x8f,0x82,0x03,0xe0,0x80 }},
+ {16, 0xa690, 0, {0xc8,0x20,0x3f,0x08,0x0f,0x80,0x03,0xae,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa6a0, 0, {0x98,0x19,0xf4,0x50,0xd9,0x11,0x3e,0x44,0x8f,0x91,0x43,0xe4,0x40,0xdd,0x00,0x3a }},
+ {16, 0xa6b0, 0, {0x44,0x4f,0xd0,0x27,0xb4,0x00,0xfd,0x12,0x3f,0x44,0x4f,0x91,0x43,0xf4,0x40,0xfd }},
+ {16, 0xa6c0, 0, {0x00,0x3f,0x41,0x0f,0x92,0x83,0xe4,0xa0,0xf9,0x28,0x3e,0x4a,0x0f,0xd0,0x03,0x66 }},
+ {16, 0xa6d0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x11,0xf6,0x80,0xe9,0xc0,0x3e,0x78 }},
+ {16, 0xa6e0, 0, {0x8f,0x9b,0x03,0xa7,0x80,0xc9,0x40,0x36,0x78,0x0f,0x10,0x23,0xe5,0x04,0xdd,0xa4 }},
+ {16, 0xa6f0, 0, {0x33,0x62,0x0f,0xda,0x03,0xf6,0x60,0xc9,0x10,0x33,0x40,0x0e,0x98,0x93,0xe6,0x30 }},
+ {16, 0xa700, 0, {0xc9,0xc9,0x32,0x78,0x8c,0xd0,0x0b,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa710, 0, {0x38,0x10,0xe0,0x00,0x88,0xe2,0x2e,0x30,0x0b,0x88,0x42,0x23,0x40,0xa0,0xa1,0x22 }},
+ {16, 0xa720, 0, {0x38,0x0b,0x8a,0x02,0xe2,0x80,0xaa,0xe0,0x22,0x30,0x0b,0x80,0x23,0xab,0x02,0x88 }},
+ {16, 0xa730, 0, {0xa0,0x2a,0x00,0x0b,0x8c,0x02,0xe3,0x00,0x88,0xe0,0x23,0x38,0x08,0x80,0x02,0x0e }},
+ {16, 0xa740, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc5,0x00,0xa1,0x44,0x28,0x58 }},
+ {16, 0xa750, 0, {0x43,0x16,0x22,0x84,0x81,0x81,0x20,0x2c,0x58,0x49,0x10,0x80,0xc4,0x81,0x91,0x48 }},
+ {16, 0xa760, 0, {0x6c,0x4a,0x0b,0x14,0x02,0x44,0x84,0x81,0x01,0x60,0x40,0x0a,0x52,0x86,0xd4,0xa0 }},
+ {16, 0xa770, 0, {0x85,0x00,0xa1,0x50,0x68,0x90,0x06,0xd2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa780, 0, {0x18,0x05,0xa6,0x00,0x89,0x00,0x2e,0x40,0x0b,0x90,0x02,0x04,0x00,0xa9,0x60,0x22 }},
+ {16, 0xa790, 0, {0x40,0x0b,0x95,0x02,0xe4,0x10,0xb1,0x00,0x4e,0x40,0x0b,0x90,0x66,0xac,0x80,0x89 }},
+ {16, 0xa7a0, 0, {0x00,0x2a,0x60,0x0b,0x90,0x52,0xf4,0x00,0x85,0x00,0x21,0x40,0x08,0x90,0x02,0xc6 }},
+ {16, 0xa7b0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x05,0xe6,0x20,0xe9,0x00,0x3e,0x40 }},
+ {16, 0xa7c0, 0, {0x0f,0x90,0x03,0xa4,0x10,0xc9,0x00,0x36,0x40,0x0f,0x94,0x01,0xe5,0x20,0xd9,0x40 }},
+ {16, 0xa7d0, 0, {0xba,0x68,0x8f,0x90,0x07,0xe6,0x00,0xc9,0x10,0x32,0x62,0x0e,0x90,0x02,0xe4,0x18 }},
+ {16, 0xa7e0, 0, {0xc9,0x00,0x32,0x40,0x0c,0x90,0x03,0xe8,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa7f0, 0, {0x28,0x01,0xa4,0x00,0xf9,0x04,0x3e,0x40,0x0b,0x90,0x03,0x64,0x00,0xf9,0x00,0x3e }},
+ {16, 0xa800, 0, {0x40,0x8f,0x90,0x03,0xe4,0x00,0xe9,0x02,0x72,0x68,0x0f,0x90,0x03,0xe6,0x00,0xf9 }},
+ {16, 0xa810, 0, {0x01,0x3e,0x42,0x0f,0x90,0x03,0xc4,0x02,0xf9,0x04,0x3e,0x40,0x4f,0x90,0x03,0x1a }},
+ {16, 0xa820, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x00,0x80,0x02,0xc8,0x00,0x32,0x00 }},
+ {16, 0xa830, 0, {0x0c,0x80,0x03,0x60,0x00,0xc8,0x40,0x36,0x00,0x0f,0x84,0x03,0xa0,0x00,0xd8,0x50 }},
+ {16, 0xa840, 0, {0xb2,0x10,0x8c,0x81,0x03,0xc1,0x20,0xc8,0x00,0x3e,0x00,0x0f,0xc0,0x13,0xf0,0x04 }},
+ {16, 0xa850, 0, {0x4c,0x00,0x3f,0x00,0x0f,0x80,0x03,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa860, 0, {0x28,0x15,0x2a,0x00,0x8a,0x04,0x22,0x81,0x28,0xa0,0x12,0x28,0x00,0x8a,0x01,0x36 }},
+ {16, 0xa870, 0, {0x80,0x0b,0xa0,0x10,0x28,0x10,0xce,0x01,0x23,0x81,0x0c,0xa8,0x12,0xfb,0x00,0x8a }},
+ {16, 0xa880, 0, {0x01,0x3b,0x80,0x83,0xa0,0x42,0xe8,0x10,0x8a,0x00,0x2f,0x80,0x0b,0x60,0x42,0x0a }},
+ {16, 0xa890, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0x83,0x00,0xa0,0xc0 }},
+ {16, 0xa8a0, 0, {0x18,0xb0,0x00,0xcc,0x00,0x9b,0x00,0x24,0xc0,0x0b,0x30,0x06,0x6c,0x00,0xa3,0x08 }},
+ {16, 0xa8b0, 0, {0x28,0xc8,0x09,0x30,0x02,0xcc,0x43,0x8b,0x00,0x2c,0x80,0x0b,0x30,0x02,0xcc,0x02 }},
+ {16, 0xa8c0, 0, {0x83,0x01,0x2c,0xc0,0x4b,0x30,0x00,0x4a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa8d0, 0, {0xa0,0x01,0x0c,0x24,0x87,0x94,0x21,0xe4,0x18,0x31,0x02,0xdc,0x80,0x97,0x10,0x25 }},
+ {16, 0xa8e0, 0, {0xcd,0x0b,0xf2,0x02,0x7c,0x00,0xa0,0x00,0x28,0xe0,0x18,0x70,0x02,0xdc,0x01,0x87 }},
+ {16, 0xa8f0, 0, {0x34,0x29,0x40,0x09,0x40,0x02,0xd0,0x04,0x84,0x04,0x2d,0x00,0x4b,0xd0,0x22,0x68 }},
+ {16, 0xa900, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x16,0x00,0xcf,0xa0,0x70,0xe9 }},
+ {16, 0xa910, 0, {0x18,0x7b,0x03,0xff,0x40,0x97,0xa0,0x35,0xe8,0x0f,0x74,0x02,0x5e,0x20,0xe4,0x80 }},
+ {16, 0xa920, 0, {0x39,0xa0,0x2d,0x78,0x03,0xfe,0x00,0xc7,0x80,0x3d,0xe0,0x5f,0x68,0x43,0xc2,0x00 }},
+ {16, 0xa930, 0, {0xc4,0x84,0x1d,0x60,0x0f,0x78,0x03,0x6a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa940, 0, {0x08,0x0d,0xa4,0x00,0x3b,0x00,0x2e,0xd8,0x0f,0xb4,0x03,0x2d,0x8a,0xeb,0x62,0x3a }},
+ {16, 0xa950, 0, {0xd0,0x0f,0xb2,0x87,0x0c,0xd0,0xd8,0x00,0x32,0xc0,0x4f,0x90,0x43,0xec,0x00,0xfb }},
+ {16, 0xa960, 0, {0x08,0x3e,0x40,0x8f,0x90,0x03,0xfc,0x00,0xff,0x04,0x3f,0x80,0x0f,0x00,0x2b,0x82 }},
+ {16, 0xa970, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xf6,0x00,0xff,0xa0,0x3e,0xf4 }},
+ {16, 0xa980, 0, {0x0e,0xb8,0x03,0xee,0x08,0x4b,0xf0,0x7f,0xf4,0x0c,0xf9,0x23,0xee,0x48,0x78,0x90 }},
+ {16, 0xa990, 0, {0x32,0xe4,0x0c,0xf9,0x03,0xfe,0x00,0xff,0x80,0x3f,0xe4,0x1c,0x79,0x03,0x2e,0x40 }},
+ {16, 0xa9a0, 0, {0xff,0x80,0x33,0xe0,0x2c,0x78,0x07,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa9b0, 0, {0xa8,0x11,0x94,0x00,0xb3,0x00,0x0c,0xe5,0x0b,0x38,0x02,0xfe,0x80,0x8f,0x80,0x61 }},
+ {16, 0xa9c0, 0, {0xc4,0x28,0x78,0x00,0x4e,0x00,0xf4,0x84,0x25,0xa8,0x0c,0x70,0x02,0xcc,0x04,0xb3 }},
+ {16, 0xa9d0, 0, {0x90,0x25,0x40,0x0c,0x41,0x83,0x52,0x40,0xb4,0x10,0xa3,0x00,0x0c,0x52,0x03,0x6a }},
+ {16, 0xa9e0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0x00,0xb7,0x21,0x6d,0xc8 }},
+ {16, 0xa9f0, 0, {0x4b,0x70,0x02,0xdc,0x42,0xa7,0x31,0x29,0xc4,0x08,0x72,0x02,0xdc,0x00,0xb7,0x28 }},
+ {16, 0xaa00, 0, {0x24,0x80,0x08,0x70,0x06,0xd4,0x20,0xb7,0x01,0x2d,0xc1,0x08,0x60,0x02,0x50,0x80 }},
+ {16, 0xaa10, 0, {0xb4,0x08,0x21,0x62,0x09,0x74,0x06,0x80,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xaa20, 0, {0x20,0x14,0xc7,0x04,0xb3,0x00,0x2c,0xc0,0x0b,0xb0,0x02,0xcc,0x00,0xa3,0x02,0x60 }},
+ {16, 0xaa30, 0, {0xc0,0x08,0x38,0x02,0x4e,0x44,0xa0,0xc0,0x24,0x91,0x08,0x30,0x02,0xc0,0x00,0xb3 }},
+ {16, 0xaa40, 0, {0x00,0x24,0x60,0x08,0x1c,0x02,0x4c,0x88,0xb3,0xc0,0x20,0xa0,0x08,0x00,0x0a,0x88 }},
+ {16, 0xaa50, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xac,0x00,0xff,0x00,0x2f,0xc0 }},
+ {16, 0xaa60, 0, {0x4f,0xf0,0x13,0xfc,0x08,0xe7,0x8a,0x3f,0xc0,0x0c,0xf5,0xc2,0xfe,0x10,0xbb,0xc0 }},
+ {16, 0xaa70, 0, {0x32,0xd4,0x0c,0x30,0x13,0xe3,0x04,0xbf,0x00,0x2e,0x62,0x08,0xb9,0x02,0x6e,0x00 }},
+ {16, 0xaa80, 0, {0xfb,0x01,0x32,0xa4,0x4d,0x94,0x02,0xab,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xaa90, 0, {0x80,0x00,0xec,0x60,0xfb,0x00,0x1e,0xc0,0x0f,0xb0,0x13,0xec,0x00,0x5b,0x00,0x3a }},
+ {16, 0xaaa0, 0, {0xc0,0x0f,0xb0,0x41,0xec,0x00,0x7b,0x45,0xba,0x40,0x2e,0xb0,0x15,0xe0,0x01,0xfb }},
+ {16, 0xaab0, 0, {0x00,0x3e,0x50,0x0e,0xc0,0x03,0xf0,0x40,0xfc,0x20,0x3f,0x50,0x8f,0x90,0x01,0x60 }},
+ {16, 0xaac0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xf4,0x00,0xff,0x00,0x3f,0xc0 }},
+ {16, 0xaad0, 0, {0x8f,0xf0,0x03,0x1c,0x02,0xcf,0x00,0x36,0xc0,0x0d,0xf0,0x03,0x7c,0x00,0x7f,0x2a }},
+ {16, 0xaae0, 0, {0x3f,0x80,0x0f,0xf8,0x13,0x90,0x21,0xcf,0x00,0x3f,0x62,0x0c,0xe0,0x03,0x30,0x00 }},
+ {16, 0xaaf0, 0, {0xf8,0x00,0x3f,0x00,0x0f,0xd0,0x03,0x80,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xab00, 0, {0x81,0x04,0x64,0x11,0xbb,0x00,0x2e,0xc0,0x0b,0xb0,0x02,0x2c,0x00,0xdb,0x04,0x32 }},
+ {16, 0xab10, 0, {0xc0,0x0e,0xb0,0x02,0xec,0x00,0xbb,0x84,0x2e,0x40,0x0b,0xb9,0x42,0x22,0x42,0x8b }},
+ {16, 0xab20, 0, {0x01,0x2c,0x72,0x0a,0x90,0x42,0x2c,0x00,0xbb,0x00,0x2e,0xc2,0x8f,0x88,0x06,0xe0 }},
+ {16, 0xab30, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x24,0x00,0xbb,0x00,0x6e,0xc0 }},
+ {16, 0xab40, 0, {0x48,0xb0,0x42,0x2c,0x00,0x8b,0x00,0x26,0xc0,0x0a,0xb0,0x12,0xec,0x00,0xbb,0x40 }},
+ {16, 0xab50, 0, {0x2e,0xc8,0x0b,0xb0,0x12,0x2c,0x00,0x8b,0x00,0x2e,0x48,0x0a,0x30,0x02,0x6c,0x00 }},
+ {16, 0xab60, 0, {0xbb,0x00,0x2e,0x80,0x4b,0x98,0x02,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xab70, 0, {0x08,0x04,0x04,0x00,0xb3,0x00,0x6c,0xc2,0x4b,0x31,0x02,0x0c,0x50,0x9b,0x20,0x20 }},
+ {16, 0xab80, 0, {0xc0,0x0a,0x32,0x12,0xcc,0x80,0xb3,0x00,0x6c,0x0c,0x0b,0x31,0x02,0x0c,0x42,0x83 }},
+ {16, 0xab90, 0, {0x08,0x2e,0x40,0x0a,0x00,0x02,0x00,0x80,0xb0,0x00,0x2c,0x41,0x0b,0x10,0x02,0x42 }},
+ {16, 0xaba0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x64,0x00,0xbb,0x40,0x3f,0xcc }},
+ {16, 0xabb0, 0, {0x0e,0xf0,0x83,0x3d,0xa0,0xcf,0x20,0x37,0xc0,0x0c,0xf7,0xc3,0xfd,0x48,0xf3,0x00 }},
+ {16, 0xabc0, 0, {0x3e,0x88,0x0f,0xb4,0x13,0xa5,0x00,0x8f,0x30,0x3e,0x40,0x0c,0xa0,0x03,0x60,0x80 }},
+ {16, 0xabd0, 0, {0xf8,0x00,0x3e,0x00,0x0f,0x90,0x23,0xc0,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xabe0, 0, {0xa0,0x19,0xf4,0x00,0xff,0x29,0x3f,0xc9,0x0f,0xf0,0x13,0xfc,0x94,0xef,0x12,0x3b }},
+ {16, 0xabf0, 0, {0xc0,0x8e,0xb2,0x07,0xfd,0x04,0xff,0x10,0x3f,0x0c,0x0f,0xf0,0x03,0xf0,0x00,0xfb }},
+ {16, 0xac00, 0, {0x20,0x3d,0x40,0x0f,0xd0,0x43,0xfc,0x40,0xff,0x04,0x3f,0xc0,0x0e,0xc0,0x43,0xe8 }},
+ {16, 0xac10, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfc,0xa2,0xc7,0x20,0x3f,0x24 }},
+ {16, 0xac20, 0, {0x0c,0xf0,0x03,0x3c,0x80,0xcc,0x09,0x33,0xd1,0x0c,0xf1,0x23,0xfc,0x20,0xdf,0x36 }},
+ {16, 0xac30, 0, {0x3f,0xc0,0x0e,0x48,0x03,0xfe,0x00,0xff,0x80,0x37,0xe4,0x0d,0x78,0x03,0x11,0xa0 }},
+ {16, 0xac40, 0, {0xcf,0x00,0x37,0xc8,0x0c,0xf0,0x03,0x30,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xac50, 0, {0x80,0x10,0xff,0x00,0x8f,0xd1,0x2e,0x08,0x0d,0xb6,0x12,0x3d,0x45,0xf9,0x64,0x27 }},
+ {16, 0xac60, 0, {0xd0,0x88,0xba,0x14,0xcc,0x04,0x8f,0x40,0x23,0xf0,0x0b,0x88,0x02,0x2e,0x04,0xbb }},
+ {16, 0xac70, 0, {0x80,0xae,0xc0,0x08,0xb8,0x0a,0x21,0x00,0x88,0xd0,0x22,0x20,0x28,0xb0,0x02,0x20 }},
+ {16, 0xac80, 0, {0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x00,0x93,0x00,0x2e,0x00 }},
+ {16, 0xac90, 0, {0x0a,0x34,0x82,0x8c,0xa0,0xa0,0x08,0x24,0xd8,0x09,0x31,0x02,0xcc,0x20,0xb3,0x32 }},
+ {16, 0xaca0, 0, {0x28,0xd0,0x4a,0x80,0x02,0xcc,0x0c,0xbb,0x00,0x22,0x40,0x89,0xb0,0x02,0x60,0x80 }},
+ {16, 0xacb0, 0, {0x93,0x00,0x24,0xd0,0x0b,0x30,0x02,0xa2,0x01,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xacc0, 0, {0xc0,0x11,0xac,0x00,0x9b,0x00,0x2e,0x20,0x09,0xb0,0x4a,0x2c,0x02,0xa0,0x00,0x06 }},
+ {16, 0xacd0, 0, {0xc0,0x09,0xb0,0x00,0xec,0x00,0xab,0x00,0x2a,0xc0,0x0b,0x88,0x02,0x6c,0x00,0xbb }},
+ {16, 0xace0, 0, {0x20,0x2a,0xe2,0x41,0xb8,0x2a,0x60,0x0a,0x98,0x00,0x26,0x00,0x0b,0xb0,0x02,0xb8 }},
+ {16, 0xacf0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xec,0x08,0xdb,0x02,0x3e,0x20 }},
+ {16, 0xad00, 0, {0x4c,0xb0,0x03,0x2c,0x02,0x8b,0x20,0x12,0xc0,0x29,0xb0,0x12,0xec,0x00,0xfb,0x00 }},
+ {16, 0xad10, 0, {0x3a,0xc0,0x0e,0x88,0x03,0xed,0x20,0xfb,0xc8,0x34,0xf0,0x0d,0xba,0x03,0x47,0x60 }},
+ {16, 0xad20, 0, {0xc9,0x00,0x36,0x40,0x0f,0xb0,0x0b,0x90,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xad30, 0, {0xe0,0x01,0x9c,0x00,0xef,0x00,0x0f,0x00,0x0f,0x30,0x00,0xfc,0x00,0xdf,0x90,0xbb }},
+ {16, 0xad40, 0, {0xc0,0xce,0xf0,0x03,0xfc,0x04,0xcb,0x00,0x17,0xc0,0x0f,0xc0,0x03,0xbc,0x84,0xff }},
+ {16, 0xad50, 0, {0x00,0x37,0xc0,0x0e,0xd0,0x63,0xb8,0x00,0xea,0x00,0x3a,0x80,0x0c,0x30,0x03,0x70 }},
+ {16, 0xad60, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xfb,0x02,0x32,0x00 }},
+ {16, 0xad70, 0, {0x0f,0xb0,0x53,0x2c,0x00,0xfa,0x00,0x32,0xc0,0x8f,0xb0,0x07,0x2c,0x00,0xfb,0x00 }},
+ {16, 0xad80, 0, {0xb2,0xc0,0x0f,0x80,0x07,0xac,0x80,0xdb,0x24,0x7e,0xd0,0x0e,0xb0,0x23,0x74,0x04 }},
+ {16, 0xad90, 0, {0xdd,0x08,0xb5,0x40,0x0c,0xb0,0x03,0x10,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xada0, 0, {0xc8,0x05,0x3c,0x00,0xbf,0xc0,0xa0,0x00,0x1b,0xf0,0x02,0x3f,0x60,0xea,0x50,0x23 }},
+ {16, 0xadb0, 0, {0xc0,0x08,0xfa,0x07,0xfc,0x00,0xdf,0x00,0x63,0xc0,0x48,0x18,0x02,0x2d,0x00,0xb3 }},
+ {16, 0xadc0, 0, {0x00,0x6e,0xc0,0x0d,0x3a,0x03,0x24,0x00,0x82,0x80,0x32,0x80,0x0d,0xf0,0x03,0x32 }},
+ {16, 0xadd0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x14,0xb3,0x59,0x20,0x80 }},
+ {16, 0xade0, 0, {0x09,0x30,0x02,0x2e,0x05,0xb0,0x44,0x2e,0xc0,0x09,0x34,0x82,0xec,0x00,0xab,0x04 }},
+ {16, 0xadf0, 0, {0x20,0xc0,0x09,0x21,0xb2,0x8e,0x04,0x93,0xc0,0x24,0xc0,0x0a,0x18,0x06,0x4c,0x00 }},
+ {16, 0xae00, 0, {0x92,0x50,0x20,0xc0,0x08,0x30,0x02,0x70,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xae10, 0, {0x20,0x01,0x1e,0x00,0xb7,0x80,0x61,0xe0,0x0b,0x78,0x0a,0x5e,0x01,0xb1,0xa0,0x2d }},
+ {16, 0xae20, 0, {0xe0,0x0a,0x78,0x02,0x5e,0x00,0x07,0x90,0x21,0xe0,0x18,0xc8,0x02,0x1e,0x00,0xb7 }},
+ {16, 0xae30, 0, {0x80,0x2d,0xe0,0x8a,0xd8,0x02,0x3e,0xc0,0x85,0x80,0x21,0x20,0x19,0x78,0x22,0x00 }},
+ {16, 0xae40, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0xf3,0x94,0x20,0x10 }},
+ {16, 0xae50, 0, {0x4b,0x30,0x07,0x0c,0x00,0xf3,0x00,0x3e,0xc8,0x0f,0x30,0x03,0xcc,0x00,0x23,0x10 }},
+ {16, 0xae60, 0, {0x00,0xcb,0x05,0x20,0x02,0x8c,0x60,0x93,0x0a,0x2e,0xc4,0x0a,0x01,0x07,0x4c,0x80 }},
+ {16, 0xae70, 0, {0xd2,0x01,0x30,0xc0,0x2c,0x30,0x0b,0x5a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xae80, 0, {0x40,0x1d,0xbc,0x00,0xff,0x01,0x0f,0x40,0x0f,0xf0,0x13,0xbc,0x00,0xef,0x26,0x73 }},
+ {16, 0xae90, 0, {0xc2,0x0c,0xb0,0x83,0xbc,0x40,0xff,0x18,0x3d,0xc0,0x4a,0xc1,0x03,0xfc,0x00,0xfb }},
+ {16, 0xaea0, 0, {0x12,0x3f,0xc4,0x4d,0xc1,0x0b,0xfc,0x81,0xfd,0x00,0x3f,0x20,0x0f,0xf0,0x03,0xd0 }},
+ {16, 0xaeb0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x20,0xcb,0x48,0x3e,0x00 }},
+ {16, 0xaec0, 0, {0x0c,0xb0,0x03,0x2d,0x20,0xe9,0x80,0xfa,0xc8,0x0d,0xb0,0x03,0xee,0x00,0xdb,0x24 }},
+ {16, 0xaed0, 0, {0x76,0xf3,0x8e,0x80,0x33,0xec,0x44,0xeb,0x10,0x3e,0xc0,0x0f,0x90,0x03,0xe8,0x04 }},
+ {16, 0xaee0, 0, {0xdc,0x00,0xb3,0x61,0x0c,0xb0,0x03,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xaef0, 0, {0x48,0x11,0x8d,0x00,0x87,0x20,0x2f,0x01,0x28,0x70,0x02,0x0c,0x84,0x8d,0x04,0x31 }},
+ {16, 0xaf00, 0, {0xcc,0xc9,0x72,0x02,0xdd,0x00,0x37,0x33,0x21,0xd8,0x08,0x40,0x02,0xdc,0x00,0xb7 }},
+ {16, 0xaf10, 0, {0x20,0x3d,0xc0,0x09,0x50,0x22,0xf0,0x00,0x97,0x00,0x21,0x80,0x0a,0xfc,0x02,0x92 }},
+ {16, 0xaf20, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x1e,0x82,0x87,0xb0,0x2d,0x20 }},
+ {16, 0xaf30, 0, {0x08,0x39,0x02,0x1e,0x41,0xa7,0x80,0x24,0xe0,0x09,0x7a,0x32,0x8e,0x82,0x07,0xa0 }},
+ {16, 0xaf40, 0, {0x25,0xe0,0x8b,0x48,0x02,0x1e,0x00,0xa7,0xe1,0x2d,0xe0,0x4b,0x58,0x00,0xda,0x00 }},
+ {16, 0xaf50, 0, {0xa0,0x80,0x24,0x60,0x08,0x7a,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xaf60, 0, {0x48,0x14,0xcc,0x00,0x83,0x00,0x2c,0x00,0x08,0x30,0x02,0x8c,0x00,0x93,0x00,0x22 }},
+ {16, 0xaf70, 0, {0xc1,0x09,0x30,0x42,0xcc,0x00,0x83,0x00,0x60,0xc0,0x08,0x1a,0x02,0xce,0x04,0xb3 }},
+ {16, 0xaf80, 0, {0xe0,0x28,0xa0,0x09,0x1c,0x82,0x4b,0x08,0xa3,0x80,0x24,0xa0,0x2a,0x30,0x02,0x9a }},
+ {16, 0xaf90, 0, {0x04,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x00,0xca,0x00,0x2f,0x88 }},
+ {16, 0xafa0, 0, {0x0c,0xa0,0x13,0x28,0x00,0xee,0x00,0x2e,0x80,0x2d,0xa0,0x03,0xe8,0x00,0xda,0x00 }},
+ {16, 0xafb0, 0, {0x76,0x80,0x0e,0xe8,0x03,0xbb,0x80,0xee,0x40,0x2f,0xa2,0x8f,0xe6,0x03,0xeb,0x86 }},
+ {16, 0xafc0, 0, {0xfa,0x80,0x37,0x82,0x0c,0x20,0x07,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xafd0, 0, {0x48,0x00,0xe0,0x00,0xf8,0x40,0x1e,0x00,0x0f,0x80,0x0b,0x61,0x00,0xe8,0xc0,0x3a }},
+ {16, 0xafe0, 0, {0x00,0x0e,0x80,0x03,0xe0,0x01,0xf8,0x00,0x7e,0x10,0x1e,0x81,0x03,0xe0,0x08,0xf8 }},
+ {16, 0xaff0, 0, {0x00,0x3e,0x00,0x0d,0x80,0x03,0xc0,0x28,0xdc,0x50,0x3b,0x00,0x0f,0x80,0x03,0xd2 }},
+ {16, 0xb000, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xc4,0x02,0xc9,0x00,0x3e,0x42 }},
+ {16, 0xb010, 0, {0x0f,0x10,0x03,0xa6,0x00,0xc9,0x01,0x3a,0x40,0x0e,0x94,0x01,0xe4,0x10,0xf1,0x04 }},
+ {16, 0xb020, 0, {0x32,0x40,0x0f,0x9a,0x23,0x20,0x60,0xf8,0x04,0x0a,0x42,0x0e,0x90,0x13,0x24,0x00 }},
+ {16, 0xb030, 0, {0xc1,0x00,0x32,0x40,0x0f,0x90,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb040, 0, {0x80,0x04,0x67,0x08,0xa9,0x00,0x6e,0x40,0x08,0x90,0x02,0x27,0x82,0x89,0x00,0x26 }},
+ {16, 0xb050, 0, {0x40,0x08,0x9c,0x03,0xa4,0x10,0xb9,0x00,0x36,0x40,0x9b,0x1c,0x1a,0x23,0x04,0xb8 }},
+ {16, 0xb060, 0, {0x00,0x3a,0x40,0x0e,0x10,0x02,0x24,0x02,0xc9,0xa0,0xa2,0x40,0x0b,0x90,0x0a,0x20 }},
+ {16, 0xb070, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x25,0x80,0x89,0x04,0x2c,0x40 }},
+ {16, 0xb080, 0, {0x08,0x90,0x02,0x84,0x81,0x99,0x40,0x2e,0x40,0x1a,0x90,0x06,0xe4,0x01,0xb9,0x00 }},
+ {16, 0xb090, 0, {0xa6,0x41,0x1b,0x90,0x82,0x21,0x00,0xb8,0x10,0x2e,0x40,0x0a,0x92,0x0a,0xa4,0x01 }},
+ {16, 0xb0a0, 0, {0x8f,0x22,0x23,0x40,0x0b,0x90,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb0b0, 0, {0x08,0x04,0x04,0x80,0xa3,0x20,0x2c,0x41,0x09,0x12,0x02,0x04,0x80,0x81,0x20,0x24 }},
+ {16, 0xb0c0, 0, {0x48,0x0a,0x36,0x02,0xc4,0x80,0xb1,0x20,0x04,0xc8,0x4b,0x14,0x02,0x05,0x00,0xb1 }},
+ {16, 0xb0d0, 0, {0x05,0x28,0x50,0x0a,0x90,0x02,0x05,0x02,0x85,0x00,0x21,0x40,0x0b,0x12,0x02,0x02 }},
+ {16, 0xb0e0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xc8,0x00,0x6e,0x14 }},
+ {16, 0xb0f0, 0, {0x2c,0x85,0x02,0xa1,0x40,0xc8,0x50,0x3a,0x14,0x0e,0x80,0x02,0xe1,0x40,0xb0,0x50 }},
+ {16, 0xb100, 0, {0x32,0x00,0x0b,0x80,0x03,0x20,0x00,0xfa,0x00,0x3e,0x00,0x0e,0x80,0x03,0xa0,0x02 }},
+ {16, 0xb110, 0, {0xc8,0x00,0x13,0x00,0x0f,0x82,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb120, 0, {0x98,0x1d,0xe4,0x48,0xf9,0x14,0x3f,0x40,0x0c,0x91,0x03,0xe4,0x42,0xfd,0x10,0x36 }},
+ {16, 0xb130, 0, {0x44,0x0d,0x91,0x23,0xa4,0x48,0xf9,0x11,0x38,0x44,0x0f,0xd0,0x03,0xe5,0x14,0x39 }},
+ {16, 0xb140, 0, {0x42,0x7b,0x40,0x8e,0xd0,0x01,0xf5,0x00,0xa9,0x40,0x3e,0x50,0x07,0x96,0x83,0xe6 }},
+ {16, 0xb150, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0xf6,0x80,0xdd,0xae,0x3a,0x50 }},
+ {16, 0xb160, 0, {0x0d,0x9a,0x0b,0x76,0x80,0xcf,0x88,0x32,0x70,0x2d,0xda,0x03,0xa7,0x01,0xe9,0x92 }},
+ {16, 0xb170, 0, {0x37,0x68,0x0d,0x94,0x03,0xe7,0x00,0xed,0xa0,0x3a,0x50,0x0f,0xd0,0x03,0xe7,0x02 }},
+ {16, 0xb180, 0, {0xcd,0x80,0x33,0x68,0x0c,0xd8,0x83,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb190, 0, {0x38,0x10,0xe1,0x00,0x88,0x40,0x20,0x20,0x0c,0x8c,0x02,0x23,0x00,0x88,0xe0,0x22 }},
+ {16, 0xb1a0, 0, {0x30,0x08,0x84,0x02,0xe3,0x00,0xb8,0xe0,0x22,0x14,0x8d,0x88,0x02,0xe3,0x00,0xb8 }},
+ {16, 0xb1b0, 0, {0x50,0x2e,0xa8,0x8b,0x80,0x22,0xe3,0x48,0x88,0x50,0x22,0x00,0x08,0x8c,0x02,0x0e }},
+ {16, 0xb1c0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x40,0x91,0x00,0x2a,0x48 }},
+ {16, 0xb1d0, 0, {0x09,0x14,0x82,0x05,0x20,0x81,0x08,0x20,0x58,0x09,0x11,0x02,0x85,0x88,0xb1,0x40 }},
+ {16, 0xb1e0, 0, {0xa0,0x40,0x08,0x12,0x02,0xc5,0x80,0xa1,0x00,0x28,0x40,0x0b,0x18,0x02,0xc4,0x84 }},
+ {16, 0xb1f0, 0, {0xa1,0x00,0x24,0x50,0x08,0x10,0x92,0x03,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb200, 0, {0x18,0x15,0xac,0x10,0x9b,0x00,0x22,0x40,0x08,0x90,0x02,0x04,0x06,0x89,0x04,0x20 }},
+ {16, 0xb210, 0, {0x40,0x09,0x90,0x02,0xe4,0x01,0xb9,0x02,0x22,0x41,0x89,0xa0,0x82,0xe0,0xa0,0xb9 }},
+ {16, 0xb220, 0, {0x28,0x2e,0x44,0x0b,0xb0,0x02,0xe4,0x02,0xb9,0x00,0x26,0x40,0x28,0x10,0x02,0x06 }},
+ {16, 0xb230, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x00,0xd9,0x00,0x38,0x40 }},
+ {16, 0xb240, 0, {0x0d,0x90,0x03,0x24,0x00,0xc9,0xa0,0xa2,0x40,0x8d,0x90,0x03,0xa4,0x00,0xf9,0x00 }},
+ {16, 0xb250, 0, {0x36,0x40,0x0c,0x84,0x13,0xe2,0x00,0xe9,0x00,0x3a,0x50,0x0f,0x9c,0x02,0xe6,0x84 }},
+ {16, 0xb260, 0, {0xe9,0x00,0xb6,0x40,0x0c,0x90,0x03,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb270, 0, {0x28,0x01,0xa4,0x00,0xe1,0x00,0x3e,0x68,0x0e,0x10,0x03,0xa4,0x00,0xf1,0x28,0x3a }},
+ {16, 0xb280, 0, {0x40,0x0e,0x90,0x03,0xe4,0x00,0xf9,0x00,0x3e,0x42,0x0f,0x80,0x23,0xe2,0x00,0xf9 }},
+ {16, 0xb290, 0, {0x00,0x3e,0x40,0x0f,0x91,0x23,0xe4,0x40,0xc1,0x00,0x3a,0x40,0x0f,0x90,0x0b,0xca }},
+ {16, 0xb2a0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0x80,0x00,0xc8,0x00,0x32,0x00 }},
+ {16, 0xb2b0, 0, {0x0c,0x80,0x03,0xa0,0x20,0xc8,0x40,0x3e,0x00,0x0e,0x81,0x63,0x60,0x00,0xf0,0x04 }},
+ {16, 0xb2c0, 0, {0x3c,0x01,0x0c,0x84,0x03,0xe0,0x00,0xc8,0x00,0x3e,0x00,0x0e,0x80,0x03,0xc1,0x00 }},
+ {16, 0xb2d0, 0, {0xd8,0x10,0x32,0x00,0x0c,0x80,0x23,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb2e0, 0, {0x28,0x05,0x38,0x60,0x8e,0x00,0x22,0x80,0x0a,0xa0,0x02,0x38,0x80,0xbe,0x00,0x3a }},
+ {16, 0xb2f0, 0, {0x80,0x08,0xe0,0x02,0x28,0x00,0xba,0x00,0x23,0x98,0x18,0xec,0x02,0xf8,0x20,0xae }},
+ {16, 0xb300, 0, {0x00,0x22,0x80,0x0b,0xe4,0x82,0xe8,0x02,0xce,0x44,0x28,0x80,0x0d,0xa0,0x0a,0x0a }},
+ {16, 0xb310, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x40,0x00,0x82,0x04,0xa0,0xc0 }},
+ {16, 0xb320, 0, {0x09,0x30,0x02,0x8e,0x04,0x83,0x50,0x6c,0xc0,0x0a,0x30,0x86,0x0c,0x00,0xb3,0x00 }},
+ {16, 0xb330, 0, {0x28,0x30,0x0a,0x36,0x12,0xcc,0x80,0x81,0x00,0x24,0xc0,0x0b,0x32,0x06,0xcc,0x00 }},
+ {16, 0xb340, 0, {0x80,0x88,0x64,0x60,0x28,0x10,0x02,0x02,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb350, 0, {0xa0,0x01,0x10,0x12,0x84,0x40,0x21,0xc8,0x0a,0x72,0x02,0x10,0x00,0xb7,0x00,0x2d }},
+ {16, 0xb360, 0, {0xcc,0x08,0x38,0x12,0x1c,0x00,0xb3,0x30,0x20,0x00,0x08,0x71,0x82,0xfe,0x00,0xa4 }},
+ {16, 0xb370, 0, {0x80,0x21,0xc8,0x0b,0x70,0x02,0xdc,0x01,0x87,0x00,0x2c,0x42,0x09,0x51,0x02,0x20 }},
+ {16, 0xb380, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x12,0x00,0xc2,0x80,0x31,0xf8 }},
+ {16, 0xb390, 0, {0x4c,0xfc,0x13,0x92,0x09,0xc7,0x80,0x3c,0xed,0x1e,0x78,0x27,0x1e,0x00,0xf7,0x8c }},
+ {16, 0xb3a0, 0, {0x79,0x20,0x08,0x7a,0x03,0xde,0x81,0x84,0x80,0x3d,0xe0,0x0e,0x78,0x03,0xfe,0x20 }},
+ {16, 0xb3b0, 0, {0xc5,0x81,0x35,0x60,0x2c,0x58,0x03,0x2a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb3c0, 0, {0x08,0x1d,0x80,0x00,0xf8,0x04,0x3e,0xd0,0x0f,0xb0,0x13,0xe0,0x00,0xfb,0x02,0x3a }},
+ {16, 0xb3d0, 0, {0xd0,0x0f,0xa0,0x0b,0xac,0x40,0xfb,0x00,0x3a,0x00,0x2f,0xb0,0x03,0xcc,0x00,0xf0 }},
+ {16, 0xb3e0, 0, {0x00,0x3a,0xc4,0x0f,0xb0,0x03,0xfc,0x41,0xf3,0x00,0x3a,0x40,0x0f,0x50,0x93,0xc2 }},
+ {16, 0xb3f0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xf6,0x00,0xcc,0x81,0x3f,0xfc }},
+ {16, 0xb400, 0, {0x1c,0xf8,0x03,0x76,0x40,0xef,0x92,0x3f,0xe4,0x8c,0xf8,0x03,0xbf,0x10,0xff,0x80 }},
+ {16, 0xb410, 0, {0xb3,0x20,0x0e,0xf9,0x13,0xfe,0x24,0xfd,0x94,0x37,0xe0,0x1c,0xf9,0x03,0xee,0x00 }},
+ {16, 0xb420, 0, {0xcd,0x80,0xb3,0xe0,0x0c,0x58,0x02,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb430, 0, {0xa8,0x11,0x94,0x40,0x80,0x00,0x2f,0xc4,0x08,0x72,0x02,0xdd,0x08,0xd7,0x00,0x2d }},
+ {16, 0xb440, 0, {0xcc,0x08,0xde,0x03,0x5c,0x00,0xb7,0x04,0x21,0x80,0xc8,0x70,0x83,0xdc,0x00,0xb4 }},
+ {16, 0xb450, 0, {0xa0,0x2f,0xc0,0x0c,0x70,0x02,0xde,0x80,0x87,0x00,0x21,0xc2,0x0a,0x51,0x42,0x2a }},
+ {16, 0xb460, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x00,0x84,0x00,0x2d,0xc8 }},
+ {16, 0xb470, 0, {0x48,0x70,0x02,0x54,0x0c,0xa7,0x00,0x2c,0xc0,0x89,0x72,0x02,0x5c,0x00,0xb3,0x10 }},
+ {16, 0xb480, 0, {0x20,0x00,0x0a,0x70,0x06,0xdc,0x00,0xb4,0x20,0x2d,0xc0,0x08,0x70,0x02,0xdc,0x80 }},
+ {16, 0xb490, 0, {0x93,0x00,0x20,0xc0,0x08,0x50,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb4a0, 0, {0x20,0x14,0xc0,0x00,0x80,0x00,0x2e,0xc0,0x08,0x30,0x02,0xc4,0x08,0xa2,0x42,0x2c }},
+ {16, 0xb4b0, 0, {0xc1,0x09,0x20,0x02,0x4c,0x00,0xb3,0x00,0x20,0x80,0x08,0x3c,0x22,0x8c,0x20,0xb0 }},
+ {16, 0xb4c0, 0, {0x08,0x2e,0xe0,0x08,0x38,0x10,0xcf,0x0a,0x93,0x40,0xa0,0xf0,0x0a,0x10,0x02,0x08 }},
+ {16, 0xb4d0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xa8,0x00,0xc1,0x00,0x3f,0xc0 }},
+ {16, 0xb4e0, 0, {0x2c,0xf0,0x03,0x68,0x00,0xaa,0x00,0x3f,0xc0,0x2d,0x80,0x03,0x7c,0x00,0xff,0x00 }},
+ {16, 0xb4f0, 0, {0x32,0x00,0x0e,0xb0,0x12,0xed,0x24,0xfa,0x08,0x27,0xc8,0x10,0xb8,0xa2,0xff,0x60 }},
+ {16, 0xb500, 0, {0x98,0xa0,0xa2,0xe0,0x0c,0x50,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb510, 0, {0x80,0x00,0xc9,0x06,0xf8,0x41,0x3e,0xc0,0x0f,0xb0,0x03,0xe9,0x10,0x5a,0x20,0x3e }},
+ {16, 0xb520, 0, {0xc0,0x0e,0x80,0x03,0xec,0x00,0xf3,0x00,0x7e,0x01,0x0f,0xb0,0x93,0xed,0x00,0xf8 }},
+ {16, 0xb530, 0, {0x40,0x3e,0xc0,0x0e,0xb0,0x03,0xfc,0x00,0xe3,0x08,0x3c,0xc2,0x0f,0xd0,0x13,0xe0 }},
+ {16, 0xb540, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xf3,0x02,0xcc,0x00,0x3b,0xc2 }},
+ {16, 0xb550, 0, {0x0c,0xf0,0x23,0xae,0x40,0xdf,0x81,0x39,0xc0,0x06,0xd0,0x03,0xfc,0x00,0xff,0x04 }},
+ {16, 0xb560, 0, {0x31,0x41,0x0c,0xf0,0x03,0xfc,0x00,0xcc,0xa0,0x37,0xc2,0x0c,0xf0,0x03,0x7c,0x04 }},
+ {16, 0xb570, 0, {0xcd,0x00,0x33,0xf0,0x0c,0xd0,0x03,0x08,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb580, 0, {0x81,0x04,0x60,0x00,0x88,0x80,0x22,0xc0,0x0a,0xb0,0x02,0xe9,0x00,0xab,0x44,0x2e }},
+ {16, 0xb590, 0, {0xc0,0x08,0x88,0x02,0xec,0x00,0xbb,0x00,0xa2,0x70,0x0a,0xb4,0x02,0xcc,0x00,0xa0 }},
+ {16, 0xb5a0, 0, {0x20,0x22,0xc0,0x0f,0xbc,0x02,0xcc,0x0a,0x8b,0x80,0xa2,0xc0,0x0d,0x90,0x02,0x20 }},
+ {16, 0xb5b0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x20,0x00,0x89,0x80,0x2a,0xc0 }},
+ {16, 0xb5c0, 0, {0x08,0xb0,0x02,0xcc,0x06,0x88,0x60,0x2e,0xc0,0x0a,0x98,0x06,0xec,0x01,0xbb,0x00 }},
+ {16, 0xb5d0, 0, {0x22,0x31,0x02,0xb2,0x02,0xec,0xa0,0x8a,0x00,0x26,0xc0,0x48,0xa8,0x02,0xec,0x04 }},
+ {16, 0xb5e0, 0, {0xa9,0x80,0x22,0x40,0x08,0x90,0x02,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb5f0, 0, {0x08,0x04,0x00,0x00,0x80,0x00,0x20,0xc0,0x0a,0x30,0x42,0xcc,0x00,0x80,0x01,0x2c }},
+ {16, 0xb600, 0, {0xc0,0x1a,0x12,0x02,0xcc,0x00,0xb3,0x00,0x20,0x00,0x4a,0x30,0x02,0xcc,0x00,0xa0 }},
+ {16, 0xb610, 0, {0x00,0x08,0xc0,0x0b,0x20,0x06,0xec,0xa0,0xa3,0x00,0xa0,0x40,0x29,0x10,0x00,0x02 }},
+ {16, 0xb620, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x60,0x00,0xc8,0x50,0x3b,0xc0 }},
+ {16, 0xb630, 0, {0x0c,0xb0,0x03,0xac,0x00,0xc9,0x00,0x3b,0xc0,0x0e,0x92,0x83,0xfc,0x00,0xbf,0x00 }},
+ {16, 0xb640, 0, {0x12,0x00,0x0c,0xb0,0x03,0xec,0x00,0x88,0x26,0x16,0xc0,0x0c,0x80,0x17,0x5c,0x80 }},
+ {16, 0xb650, 0, {0xe9,0x01,0x32,0x40,0x2c,0xd0,0x03,0x00,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb660, 0, {0xa0,0x1d,0xd0,0x00,0xfc,0x20,0x3f,0xc0,0x0f,0xf0,0x03,0xfc,0x00,0xfc,0x00,0x3f }},
+ {16, 0xb670, 0, {0xc0,0x0d,0x80,0x03,0xfc,0x08,0xff,0x00,0x3f,0x00,0x0f,0xf0,0x03,0xfc,0x10,0xf8 }},
+ {16, 0xb680, 0, {0x40,0x37,0xc0,0x0e,0xe0,0x21,0xfc,0x08,0xdf,0x00,0x3f,0x40,0x0f,0xd0,0x03,0xe0 }},
+ {16, 0xb690, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfc,0xc0,0xff,0x21,0x71,0x24 }},
+ {16, 0xb6a0, 0, {0x0f,0xf1,0x83,0xf2,0x40,0xff,0x00,0x37,0xc4,0x9f,0xf2,0x47,0x3d,0x04,0xc7,0x20 }},
+ {16, 0xb6b0, 0, {0x33,0xc0,0x0c,0x78,0x23,0xfe,0x40,0xe8,0x10,0x27,0xc4,0x0f,0xf2,0x13,0x3c,0x84 }},
+ {16, 0xb6c0, 0, {0xc4,0x81,0x33,0x20,0x4c,0xf0,0x23,0x70,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb6d0, 0, {0x80,0x10,0xed,0x40,0xbf,0x54,0x62,0xc8,0x0b,0xf6,0x02,0xe0,0x00,0xbb,0xd0,0x22 }},
+ {16, 0xb6e0, 0, {0xf0,0x1f,0xf9,0x12,0x3d,0x80,0x9f,0x81,0x2b,0xe0,0x0a,0xb8,0x12,0xe8,0x00,0x8f }},
+ {16, 0xb6f0, 0, {0x04,0x22,0xd0,0x08,0xb3,0x8a,0xbf,0x42,0x8b,0x82,0x22,0xe0,0x28,0x8c,0x02,0x20 }},
+ {16, 0xb700, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x00,0xb3,0x28,0x28,0x08 }},
+ {16, 0xb710, 0, {0x0b,0x30,0x06,0x80,0x80,0xb3,0x02,0x24,0xd1,0x0b,0x30,0x02,0x8d,0x80,0x93,0x10 }},
+ {16, 0xb720, 0, {0x20,0xce,0x8b,0x30,0x02,0xcc,0x84,0xa1,0x21,0x2c,0xcc,0x0a,0x30,0x0a,0x4c,0x00 }},
+ {16, 0xb730, 0, {0x93,0x00,0x28,0xc0,0x08,0x3c,0x02,0x22,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb740, 0, {0xc0,0x15,0xac,0x10,0xbb,0x02,0x6a,0xe0,0x0b,0xb0,0x02,0xe1,0x08,0xbb,0x04,0x2a }},
+ {16, 0xb750, 0, {0xc0,0x0a,0xb0,0x12,0x8c,0x00,0x9b,0x00,0x2a,0xc0,0x0b,0xb1,0x06,0xc8,0x80,0x8b }},
+ {16, 0xb760, 0, {0x82,0x6a,0xc1,0x0a,0x30,0x02,0xac,0x18,0x88,0x10,0x2a,0x48,0x08,0x80,0x02,0x30 }},
+ {16, 0xb770, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xec,0x00,0xfb,0x00,0xaa,0x30 }},
+ {16, 0xb780, 0, {0x0f,0xb0,0x03,0xa8,0x00,0xf3,0x01,0xb6,0xc1,0x0b,0xb0,0x02,0xac,0x08,0x4b,0x00 }},
+ {16, 0xb790, 0, {0xb2,0xc0,0x0f,0xb8,0x02,0xec,0x10,0xa9,0x81,0x3e,0xc0,0x0f,0xb0,0x03,0x0c,0x00 }},
+ {16, 0xb7a0, 0, {0xcb,0xa0,0x18,0xd0,0x0c,0xb0,0x03,0x10,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb7b0, 0, {0xe0,0x01,0xbc,0x08,0xf7,0x00,0x37,0x00,0x0f,0xf0,0x03,0xfd,0x00,0xff,0x00,0x37 }},
+ {16, 0xb7c0, 0, {0xc0,0x0f,0xb0,0x07,0x7c,0x00,0xe7,0x00,0x3e,0xc0,0x0a,0xf0,0x03,0xfe,0x00,0xf7 }},
+ {16, 0xb7d0, 0, {0x00,0x36,0xc0,0x0c,0xf0,0x03,0xfc,0x00,0xff,0x80,0x37,0xe0,0x0f,0xa0,0x03,0xb8 }},
+ {16, 0xb7e0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xdb,0x00,0x36,0x00 }},
+ {16, 0xb7f0, 0, {0x0e,0xb0,0x03,0x69,0x00,0xdb,0x09,0x3a,0xc0,0x1f,0x30,0x23,0xec,0x08,0xcb,0x20 }},
+ {16, 0xb800, 0, {0x34,0xc0,0x2f,0xb0,0x03,0xec,0x40,0xeb,0x48,0x3e,0xc4,0x4d,0xb0,0x8b,0x6c,0x00 }},
+ {16, 0xb810, 0, {0xcb,0x00,0x32,0x90,0x0f,0x30,0x03,0x90,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb820, 0, {0xc8,0x05,0x3c,0x00,0x8f,0x00,0x22,0x00,0x48,0xf0,0x22,0x2c,0x00,0x8f,0x00,0x23 }},
+ {16, 0xb830, 0, {0xe0,0x8b,0xf5,0x10,0x3c,0x00,0x8f,0x80,0x23,0xf0,0x80,0x98,0x03,0x2d,0x44,0xdb }},
+ {16, 0xb840, 0, {0x00,0x23,0xd4,0x08,0xf8,0x02,0x3c,0x00,0x83,0x00,0x22,0xc0,0x0b,0xa4,0x82,0x32 }},
+ {16, 0xb850, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x00,0x93,0x00,0x24,0x00 }},
+ {16, 0xb860, 0, {0x0b,0x30,0x02,0x84,0x00,0xb3,0x01,0x28,0xf6,0x09,0x34,0x32,0x8c,0x01,0xb3,0xd0 }},
+ {16, 0xb870, 0, {0x24,0xe8,0x0a,0x31,0x0a,0x86,0x00,0x83,0x00,0x2a,0xe0,0x00,0x30,0x02,0x8c,0x00 }},
+ {16, 0xb880, 0, {0x83,0x00,0x28,0xc0,0x89,0x38,0xa2,0x78,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb890, 0, {0x20,0x01,0x1e,0x00,0x97,0x94,0x23,0xe0,0x09,0x38,0x02,0x32,0x00,0x97,0xa1,0x21 }},
+ {16, 0xb8a0, 0, {0xe4,0x0b,0x78,0x02,0x1e,0x40,0xb7,0xa0,0x25,0xec,0x08,0xfc,0x02,0x3a,0x00,0x93 }},
+ {16, 0xb8b0, 0, {0xb8,0x21,0xe0,0x08,0x78,0x82,0x9e,0x40,0x87,0xc0,0x29,0xa0,0x0b,0x58,0x02,0x48 }},
+ {16, 0xb8c0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x2c,0x00,0xdb,0x00,0x34,0x20 }},
+ {16, 0xb8d0, 0, {0x0f,0x3a,0x03,0x8e,0x00,0xf3,0xb0,0x28,0xc4,0x0b,0x3a,0x03,0xae,0x40,0xf3,0xa0 }},
+ {16, 0xb8e0, 0, {0x34,0xee,0x0f,0x30,0x23,0x84,0x00,0xe3,0xf0,0x38,0xc0,0x0c,0xb0,0x0b,0x8e,0x42 }},
+ {16, 0xb8f0, 0, {0xc3,0x00,0x38,0xc0,0x0f,0x30,0x63,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb900, 0, {0x40,0x1d,0xbc,0x00,0xeb,0x42,0x3a,0xc4,0x1e,0xb1,0x07,0x88,0xd1,0xe3,0x00,0x3f }},
+ {16, 0xb910, 0, {0xc5,0x8f,0xf1,0x63,0xac,0x10,0xcb,0x50,0x3b,0xc3,0x0f,0xd1,0x03,0xc8,0x00,0xbb }},
+ {16, 0xb920, 0, {0x20,0x3b,0xc0,0x2e,0xf1,0x03,0x1c,0x00,0xff,0x00,0x37,0xc0,0x4f,0xd1,0x03,0x90 }},
+ {16, 0xb930, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x40,0xfb,0x44,0xb2,0xc0 }},
+ {16, 0xb940, 0, {0x4f,0xb3,0x43,0x24,0x00,0xdb,0x10,0x36,0xc0,0x4c,0xbe,0x22,0x6d,0x20,0xcb,0x50 }},
+ {16, 0xb950, 0, {0x3e,0xc9,0x4c,0xb0,0x13,0x24,0x00,0xcf,0x20,0x33,0xc0,0x3d,0xf0,0x23,0x2c,0xc0 }},
+ {16, 0xb960, 0, {0xd8,0x00,0x3e,0x40,0x8f,0x30,0x03,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb970, 0, {0x48,0x11,0x9c,0x04,0xb7,0x60,0x21,0xc1,0x8b,0xf0,0xa2,0x14,0x10,0x87,0x00,0x0f }},
+ {16, 0xb980, 0, {0xc8,0x0d,0x71,0x0a,0x1d,0x00,0x87,0x00,0x2c,0xcc,0x48,0x70,0x2a,0x9c,0x00,0x87 }},
+ {16, 0xb990, 0, {0x0c,0x21,0xc0,0x0c,0x72,0x02,0x0c,0xa2,0x87,0x00,0x2d,0xc0,0x0b,0x70,0x02,0x12 }},
+ {16, 0xb9a0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x00,0xb3,0x80,0x21,0xe0 }},
+ {16, 0xb9b0, 0, {0x0b,0x7a,0x02,0xde,0x00,0xb7,0x81,0x05,0xe4,0x08,0x79,0x02,0x5c,0x80,0x87,0xa0 }},
+ {16, 0xb9c0, 0, {0x2d,0xe0,0x08,0xf8,0x06,0xb6,0x00,0x87,0x80,0x20,0xe4,0x0a,0x7b,0x12,0x1e,0x90 }},
+ {16, 0xb9d0, 0, {0x97,0x88,0x2d,0xe0,0x0b,0x78,0x0e,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb9e0, 0, {0x48,0x14,0xcc,0x00,0xb3,0x00,0x20,0xd0,0x0b,0xb0,0x02,0x6e,0x34,0xa3,0x00,0x2c }},
+ {16, 0xb9f0, 0, {0xc1,0x09,0x30,0x02,0x4c,0x00,0x83,0x00,0x2c,0xc0,0x48,0x10,0x02,0x8d,0x80,0x83 }},
+ {16, 0xba00, 0, {0xc0,0x00,0xc0,0x8a,0x30,0x12,0x0c,0x00,0x80,0x00,0x2c,0x16,0x0b,0x38,0x02,0x12 }},
+ {16, 0xba10, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x00,0xfa,0x00,0x33,0x88 }},
+ {16, 0xba20, 0, {0x0f,0xa0,0x03,0x79,0x90,0xfa,0x01,0x36,0x80,0x1c,0xa0,0x03,0x68,0x00,0xca,0x00 }},
+ {16, 0xba30, 0, {0x3e,0x81,0x2c,0xa0,0x0b,0xb9,0x0c,0xce,0xe2,0xb2,0x80,0x8e,0xa0,0x0b,0x28,0x00 }},
+ {16, 0xba40, 0, {0xda,0x80,0x3c,0xb0,0x0f,0xe0,0x83,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xba50, 0, {0x48,0x00,0xe0,0x00,0xf0,0x00,0x3e,0x00,0x0f,0x80,0x03,0xa0,0x00,0xc8,0x00,0x2e }},
+ {16, 0xba60, 0, {0x00,0x0f,0x84,0x23,0xa0,0x00,0xf0,0x40,0x3e,0x10,0x0f,0x84,0x03,0xe1,0x02,0xf8 }},
+ {16, 0xba70, 0, {0x48,0x3e,0x10,0x0c,0x80,0x03,0xc0,0x10,0xf8,0x80,0x3e,0x00,0x0f,0x00,0x03,0xd2 }},
+ {16, 0xba80, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xd9,0x00,0x36,0x42 }},
+ {16, 0xba90, 0, {0x0f,0x90,0x03,0x24,0x18,0xf9,0x10,0x3c,0x48,0x68,0x92,0x13,0xe4,0x00,0xa9,0x11 }},
+ {16, 0xbaa0, 0, {0xb2,0x60,0x0e,0x91,0x03,0x26,0x00,0xc9,0x00,0x32,0x60,0x0c,0x10,0x03,0x24,0x08 }},
+ {16, 0xbab0, 0, {0xc9,0x00,0x3e,0x40,0x0c,0x90,0x23,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbac0, 0, {0x80,0x04,0x64,0x00,0x89,0x00,0x22,0x40,0x0b,0x90,0x02,0xa4,0x08,0x89,0x00,0x2e }},
+ {16, 0xbad0, 0, {0x42,0x48,0x94,0x02,0xe4,0x00,0x89,0x80,0x22,0x70,0x08,0x14,0x22,0xa4,0x02,0x89 }},
+ {16, 0xbae0, 0, {0x42,0x2a,0x70,0x28,0x90,0x0a,0x24,0x00,0xa9,0x00,0x2e,0x40,0x28,0x90,0x02,0xa0 }},
+ {16, 0xbaf0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x04,0x00,0x99,0x00,0x26,0xc0 }},
+ {16, 0xbb00, 0, {0x03,0x90,0x02,0x24,0x01,0xa9,0x00,0x0e,0x40,0x0a,0x90,0x46,0xc4,0x0a,0x89,0x00 }},
+ {16, 0xbb10, 0, {0x20,0x48,0x0a,0x90,0x02,0x05,0x80,0x81,0x41,0xa0,0x58,0x88,0x90,0x02,0x24,0x08 }},
+ {16, 0xbb20, 0, {0x8d,0x80,0x2f,0xc0,0x08,0x98,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbb30, 0, {0x08,0x04,0x04,0x80,0x81,0x20,0x20,0x40,0x0b,0x12,0x02,0x84,0x00,0x81,0x24,0x2c }},
+ {16, 0xbb40, 0, {0x58,0x0a,0x32,0x22,0xc5,0x84,0xa1,0x00,0x20,0x50,0x08,0xb0,0x02,0x85,0x08,0x81 }},
+ {16, 0xbb50, 0, {0x40,0x20,0x5a,0x08,0x16,0x82,0x04,0x00,0xa5,0x00,0x2d,0x40,0x08,0x12,0x82,0x82 }},
+ {16, 0xbb60, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x61,0x40,0xd8,0x50,0x36,0x14 }},
+ {16, 0xbb70, 0, {0x0f,0x85,0x23,0x01,0x40,0xe8,0x00,0x3e,0x00,0x0e,0x80,0x43,0xc0,0x08,0xca,0x00 }},
+ {16, 0xbb80, 0, {0x32,0x80,0x0e,0x80,0x03,0x20,0x00,0xc0,0x00,0x32,0x08,0x2c,0x02,0x03,0x20,0x08 }},
+ {16, 0xbb90, 0, {0xc8,0x00,0x3f,0x00,0x0c,0x82,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbba0, 0, {0x98,0x1d,0xe4,0x40,0xf9,0x10,0x3f,0x40,0x0f,0x91,0x43,0xf4,0x04,0xf9,0x10,0x3e }},
+ {16, 0xbbb0, 0, {0x44,0x0d,0x11,0x03,0xe4,0x44,0x59,0x40,0x3e,0x50,0x4f,0x50,0x43,0xd4,0x02,0xfd }},
+ {16, 0xbbc0, 0, {0x40,0x3e,0x40,0x0f,0x90,0x0b,0xe5,0x00,0xf9,0x00,0x3e,0x40,0x4f,0xd0,0x03,0xe6 }},
+ {16, 0xbbd0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x66,0x60,0xc9,0xe0,0x32,0x44 }},
+ {16, 0xbbe0, 0, {0x0f,0x9c,0x03,0xe4,0x00,0xdd,0x84,0x3f,0x68,0x8f,0xd8,0x42,0xe6,0xa0,0xdd,0xa4 }},
+ {16, 0xbbf0, 0, {0x33,0x68,0x0d,0x70,0x03,0x25,0x00,0xc9,0xe0,0xb2,0x68,0x0c,0x9a,0xc3,0x26,0x00 }},
+ {16, 0xbc00, 0, {0x99,0x00,0x3e,0x40,0x0f,0x9a,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbc10, 0, {0x38,0x10,0xe3,0x00,0x88,0x80,0xaa,0x20,0x8b,0x88,0x02,0xe2,0x88,0xb8,0x01,0x2e }},
+ {16, 0xbc20, 0, {0x00,0x0b,0x84,0x02,0xe2,0xb0,0x88,0x50,0x22,0x14,0x08,0x80,0x02,0x82,0x80,0x88 }},
+ {16, 0xbc30, 0, {0xe0,0xb6,0x3a,0x08,0xce,0xa2,0x21,0x08,0x88,0x00,0x2e,0x00,0x0b,0xc4,0x02,0x0e }},
+ {16, 0xbc40, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x80,0x81,0x60,0x68,0x48 }},
+ {16, 0xbc50, 0, {0x5b,0x16,0x02,0xc4,0x20,0xa1,0x40,0x6c,0x50,0x0b,0x14,0x02,0xc4,0x00,0xa1,0x00 }},
+ {16, 0xbc60, 0, {0x24,0x40,0x0b,0x90,0x22,0x14,0x90,0x85,0x42,0x21,0x50,0x5b,0x50,0x1a,0x15,0x00 }},
+ {16, 0xbc70, 0, {0x95,0x00,0x2d,0x40,0x0b,0x51,0x0a,0x82,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbc80, 0, {0x18,0x15,0xa4,0x01,0x89,0x00,0x2a,0x40,0x0b,0x90,0x46,0xe4,0x00,0xb9,0x01,0x2e }},
+ {16, 0xbc90, 0, {0x40,0x0b,0x90,0x20,0xe4,0x00,0xb9,0x00,0x26,0x40,0x18,0xb8,0x02,0xa4,0x02,0x8d }},
+ {16, 0xbca0, 0, {0x08,0x2f,0x40,0x8b,0xd0,0x02,0x24,0x00,0x8d,0x20,0x2f,0x48,0x0b,0xd0,0x02,0x86 }},
+ {16, 0xbcb0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x00,0xc9,0x00,0x32,0x40 }},
+ {16, 0xbcc0, 0, {0x0f,0x90,0x02,0xe4,0x10,0x49,0x00,0x3e,0x40,0x0f,0x90,0x02,0xe4,0x00,0xe9,0x01 }},
+ {16, 0xbcd0, 0, {0x36,0x40,0x0f,0x18,0x13,0x24,0x10,0xc9,0x82,0x32,0x40,0x7f,0x90,0x23,0x24,0x00 }},
+ {16, 0xbce0, 0, {0xd9,0x20,0x3e,0x72,0x0f,0x90,0x03,0xa8,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbcf0, 0, {0x28,0x01,0x84,0x02,0xf1,0x01,0x16,0x40,0x4f,0x90,0x03,0xe5,0x10,0xf9,0x08,0x2e }},
+ {16, 0xbd00, 0, {0x40,0x0f,0x90,0x13,0xe4,0x00,0xc9,0x01,0x3a,0x40,0x1f,0x90,0x03,0xe4,0x00,0xf9 }},
+ {16, 0xbd10, 0, {0x20,0x34,0x40,0x8c,0x90,0x03,0xc4,0x08,0xf9,0x00,0x3e,0x60,0x0f,0x10,0x03,0x4a }},
+ {16, 0xbd20, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x08,0xf8,0x00,0x3e,0x00 }},
+ {16, 0xbd30, 0, {0x0c,0x80,0x03,0x60,0x00,0xe8,0x00,0x3e,0x02,0x4f,0x80,0x13,0xe0,0x00,0xd0,0x00 }},
+ {16, 0xbd40, 0, {0x3e,0x00,0x0e,0x81,0x03,0x30,0x00,0xcc,0x40,0x33,0x00,0x0c,0xc0,0x0b,0x20,0x20 }},
+ {16, 0xbd50, 0, {0xe8,0x00,0x3e,0x10,0x0f,0xc0,0x03,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbd60, 0, {0x28,0x05,0x28,0x04,0xba,0x00,0x22,0x80,0x08,0xa0,0x02,0x28,0x00,0xbe,0xc8,0x6f }},
+ {16, 0xbd70, 0, {0x80,0x0b,0xe1,0x22,0xa8,0x00,0x8e,0x20,0x2f,0x80,0x0b,0xe0,0x23,0x68,0x00,0x8a }},
+ {16, 0xbd80, 0, {0x00,0x22,0x80,0x08,0xe0,0x02,0x29,0x00,0x8a,0x00,0x2e,0xa8,0x0b,0xa0,0x00,0xca }},
+ {16, 0xbd90, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0xb3,0x00,0x24,0xc0 }},
+ {16, 0xbda0, 0, {0x09,0x30,0x02,0x0c,0x00,0xb3,0xc1,0x2c,0xe0,0x0b,0x38,0x56,0x2c,0x10,0x13,0x00 }},
+ {16, 0xbdb0, 0, {0x2e,0xc0,0x0a,0x38,0x6a,0x20,0x00,0x88,0x00,0x20,0x00,0x09,0x80,0x22,0x4c,0x42 }},
+ {16, 0xbdc0, 0, {0xa3,0x00,0x2c,0xe0,0x0b,0x24,0x80,0xca,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbdd0, 0, {0xa0,0x01,0x1c,0x08,0xb7,0x24,0x2f,0xe0,0x09,0x39,0x02,0x1c,0x01,0xb6,0x00,0x2d }},
+ {16, 0xbde0, 0, {0x90,0x0b,0x60,0x92,0x8e,0x00,0x86,0x82,0x2d,0xc2,0x0b,0xf0,0x02,0x5c,0x06,0x87 }},
+ {16, 0xbdf0, 0, {0x00,0x60,0xc0,0x29,0x70,0x02,0x5c,0x00,0x86,0x00,0x2d,0xc0,0x0b,0x60,0x02,0xe8 }},
+ {16, 0xbe00, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1f,0x40,0xf3,0xe4,0x3d,0xe8 }},
+ {16, 0xbe10, 0, {0x0d,0x79,0x0b,0x1e,0xc0,0x67,0x80,0x2d,0xe0,0x0f,0x70,0x43,0x1d,0x80,0xd5,0x00 }},
+ {16, 0xbe20, 0, {0x3d,0x60,0x0e,0x78,0x03,0x1e,0x00,0xcd,0x80,0x31,0xe0,0x0d,0xc8,0x03,0x4e,0x00 }},
+ {16, 0xbe30, 0, {0xe5,0x80,0x3d,0xe0,0x0f,0x48,0x03,0xea,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbe40, 0, {0x08,0x1d,0xac,0x80,0xfb,0x00,0x70,0xc0,0x6e,0xb6,0x13,0xad,0x40,0xfa,0x00,0x3e }},
+ {16, 0xbe50, 0, {0xc0,0x0f,0x20,0x43,0x2d,0x18,0x59,0x00,0x3e,0x00,0x03,0xb0,0x0b,0xe0,0x00,0xfa }},
+ {16, 0xbe60, 0, {0x00,0xbe,0x00,0x0e,0xb0,0x13,0xac,0x00,0xf8,0x00,0x3e,0xc0,0x0f,0x80,0x03,0xc2 }},
+ {16, 0xbe70, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xfe,0x40,0xff,0x80,0x3f,0xe6 }},
+ {16, 0xbe80, 0, {0x0f,0xf8,0x23,0x2e,0x04,0xff,0x90,0x3f,0xe4,0x0d,0xba,0x03,0xff,0x40,0xcf,0x80 }},
+ {16, 0xbe90, 0, {0x22,0xe1,0x0c,0x39,0x43,0x32,0x10,0xec,0x90,0x33,0x20,0x8e,0xc8,0x03,0xf2,0x00 }},
+ {16, 0xbea0, 0, {0xdf,0x80,0x3f,0x60,0x0f,0xf8,0x03,0xc0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbeb0, 0, {0xa8,0x11,0x9c,0x40,0xb7,0x90,0x3c,0xe0,0x0b,0x3a,0x03,0x4e,0x80,0xf3,0xb1,0x2d }},
+ {16, 0xbec0, 0, {0x04,0x4c,0x38,0x23,0xae,0x00,0x80,0x80,0x34,0xe8,0x4d,0x78,0x02,0x3e,0x80,0x87 }},
+ {16, 0xbed0, 0, {0xa0,0x29,0xc0,0x08,0x70,0x02,0xc0,0x80,0x86,0x02,0x2d,0x41,0x0b,0x70,0x02,0xea }},
+ {16, 0xbee0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x48,0x37,0x01,0x2d,0xc9 }},
+ {16, 0xbef0, 0, {0x0b,0x72,0x22,0x1c,0x84,0xb5,0x16,0x0d,0xc4,0x19,0x40,0x42,0xdc,0x80,0x87,0x00 }},
+ {16, 0xbf00, 0, {0x20,0xc8,0x88,0x73,0x0a,0x9c,0x80,0xb5,0x00,0x29,0xc0,0x0a,0x48,0x02,0xc0,0x02 }},
+ {16, 0xbf10, 0, {0x95,0x00,0x2d,0x42,0x0b,0x58,0x02,0xc0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbf20, 0, {0x20,0x14,0xcc,0x00,0xb3,0x00,0x2a,0xe0,0x0b,0x30,0x02,0x4c,0x20,0xa1,0x01,0x24 }},
+ {16, 0xbf30, 0, {0xc1,0x08,0x00,0x02,0x8c,0x00,0x81,0x00,0x24,0x80,0x09,0x38,0x0a,0x60,0x80,0x92 }},
+ {16, 0xbf40, 0, {0x40,0x2a,0x00,0x0a,0x30,0x02,0xc0,0x00,0x80,0xc8,0x2c,0x72,0x0b,0x14,0x02,0xc8 }},
+ {16, 0xbf50, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xbc,0x00,0xff,0x00,0x2f,0xf4 }},
+ {16, 0xbf60, 0, {0x8f,0xf0,0x03,0x3c,0x00,0xb9,0x00,0x3e,0x40,0x09,0x90,0x03,0xfc,0x02,0xc3,0x01 }},
+ {16, 0xbf70, 0, {0x32,0xc0,0x48,0xb8,0x13,0xa1,0x00,0xba,0x00,0x2a,0x00,0x0a,0xa0,0x07,0xec,0x00 }},
+ {16, 0xbf80, 0, {0xdb,0xc8,0x3e,0x90,0x0f,0xa2,0x02,0xea,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbf90, 0, {0x80,0x00,0xec,0x00,0xfb,0x02,0x3e,0xc4,0x0f,0xb0,0x63,0xec,0x01,0xf8,0x40,0x3e }},
+ {16, 0xbfa0, 0, {0x40,0x0b,0x80,0x03,0xcc,0x00,0xfa,0x42,0x3e,0xc0,0x0f,0xb5,0x00,0xac,0x58,0xe9 }},
+ {16, 0xbfb0, 0, {0x82,0x3e,0xc0,0x1d,0x90,0x03,0xec,0x04,0xfa,0x00,0x3e,0x80,0x0f,0xa0,0x03,0xe0 }},
+ {16, 0xbfc0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x0c,0xdf,0x00,0x7f,0xc0 }},
+ {16, 0xbfd0, 0, {0x2c,0xf0,0x03,0x7c,0x01,0xc7,0x00,0x33,0x40,0x8f,0xd0,0x03,0xfc,0x00,0xd8,0x00 }},
+ {16, 0xbfe0, 0, {0x15,0x44,0x0c,0xe0,0x1b,0x3c,0x00,0xcb,0x0e,0x33,0xc0,0x5c,0x62,0x02,0x1c,0x02 }},
+ {16, 0xbff0, 0, {0xc5,0x00,0x2b,0x80,0x0f,0xc0,0x87,0x80,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc000, 0, {0x81,0x44,0x6c,0x10,0xbb,0x00,0x2e,0xc0,0x08,0xb0,0x52,0x0c,0x01,0xfa,0xc4,0x22 }},
+ {16, 0xc010, 0, {0x61,0x0b,0x88,0x03,0x6c,0x00,0x88,0x47,0x2a,0x00,0x0e,0x1c,0x02,0x20,0x02,0x88 }},
+ {16, 0xc020, 0, {0x00,0xaa,0x00,0x28,0x90,0x0a,0x2c,0x04,0xa8,0x00,0x22,0x90,0x0b,0x80,0x02,0xe0 }},
+ {16, 0xc030, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x2c,0x00,0xbb,0x00,0x2e,0xc1 }},
+ {16, 0xc040, 0, {0x08,0x30,0x12,0x6c,0x00,0x88,0x88,0x2a,0x30,0x0b,0xb8,0x02,0xec,0x00,0x9b,0x08 }},
+ {16, 0xc050, 0, {0x2a,0x40,0x08,0xb8,0x02,0x20,0x00,0x82,0x10,0x22,0x00,0x08,0xa0,0x22,0xa0,0x00 }},
+ {16, 0xc060, 0, {0x8b,0x00,0x2a,0x02,0x0b,0xb0,0x02,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc070, 0, {0x08,0x00,0x0c,0x00,0xb3,0x20,0x2c,0xc2,0x08,0x36,0x02,0x2c,0xc0,0xa0,0x08,0x20 }},
+ {16, 0xc080, 0, {0x00,0x0b,0x33,0x46,0xcd,0x28,0x80,0x20,0x28,0xc0,0x0b,0x32,0x02,0x0c,0x20,0x81 }},
+ {16, 0xc090, 0, {0x30,0x28,0xc0,0x08,0x10,0x02,0x81,0x00,0xaa,0x00,0x28,0x00,0x03,0x30,0x02,0xc2 }},
+ {16, 0xc0a0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x7c,0x00,0xfb,0x28,0x2e,0xcc }},
+ {16, 0xc0b0, 0, {0x0c,0x70,0x53,0x7d,0x09,0x88,0x00,0xba,0x00,0x0f,0x80,0x03,0xfd,0x80,0xda,0x60 }},
+ {16, 0xc0c0, 0, {0x3a,0x50,0x8c,0xa2,0x83,0x2c,0x80,0x4b,0x20,0x30,0xc0,0x28,0xa0,0x03,0xa1,0x00 }},
+ {16, 0xc0d0, 0, {0xc9,0x00,0x3a,0x00,0x0f,0x90,0x03,0xc0,0x03,0x10,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc0e0, 0, {0xa0,0x1d,0xfc,0x04,0xfb,0x00,0x7e,0xc9,0x0b,0xb6,0x03,0xfc,0xc0,0xf8,0x0c,0x3f }},
+ {16, 0xc0f0, 0, {0x00,0x4f,0xc3,0x43,0x2c,0x00,0xb8,0x38,0x3f,0x8e,0x5e,0xf0,0x43,0xe0,0x10,0xf8 }},
+ {16, 0xc100, 0, {0x30,0x3f,0x01,0x0f,0xd0,0x03,0x70,0x00,0xfc,0x00,0x37,0x00,0x0d,0xd0,0x07,0xe9 }},
+ {16, 0xc110, 0, {0x03,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfc,0xe0,0xcc,0x80,0x33,0xc0 }},
+ {16, 0xc120, 0, {0x0d,0xf0,0x83,0xfc,0x80,0xdc,0x94,0x33,0xc0,0x1c,0xf1,0x03,0x7d,0x8c,0xff,0x30 }},
+ {16, 0xc130, 0, {0x3f,0x30,0x8f,0xc8,0x03,0x7e,0x10,0xcf,0x90,0x39,0xa0,0x8d,0xf8,0x03,0xae,0x00 }},
+ {16, 0xc140, 0, {0xd5,0x80,0x13,0xe0,0x0c,0x58,0x03,0xf0,0x01,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc150, 0, {0x80,0x10,0xdd,0x08,0x88,0x00,0x23,0xc4,0x08,0xfc,0x02,0xec,0xa8,0xcb,0x20,0x21 }},
+ {16, 0xc160, 0, {0xc2,0x0d,0xf7,0x12,0x1c,0x40,0xdf,0x30,0x22,0xa0,0x0b,0x88,0x02,0x2e,0x04,0xdb }},
+ {16, 0xc170, 0, {0x21,0x22,0xc0,0x08,0xb8,0x22,0x2e,0x00,0xb9,0x80,0x2a,0x60,0x0a,0x88,0x02,0xe0 }},
+ {16, 0xc180, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x45,0xcc,0x10,0x80,0x2c,0x28,0xca }},
+ {16, 0xc190, 0, {0x68,0x30,0x02,0x8d,0x00,0x9b,0x20,0x28,0xc4,0x08,0x32,0x02,0xcc,0x10,0xb3,0x00 }},
+ {16, 0xc1a0, 0, {0x24,0x08,0x0b,0x80,0x42,0x6c,0x00,0x83,0x00,0x2a,0xca,0x3a,0xb0,0x02,0x8c,0x04 }},
+ {16, 0xc1b0, 0, {0xb0,0x04,0x28,0xc0,0x08,0x10,0x02,0xe3,0x01,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc1c0, 0, {0xc0,0x15,0x8c,0x02,0x80,0x40,0xaa,0xc0,0x08,0xb0,0x02,0xec,0x00,0x9b,0x20,0x2a }},
+ {16, 0xc1d0, 0, {0xc0,0x88,0xb0,0x02,0xac,0x00,0x9b,0x00,0x26,0xe0,0x03,0x80,0x82,0x2c,0x28,0x9b }},
+ {16, 0xc1e0, 0, {0x20,0x22,0xe1,0x0b,0xb2,0x02,0xac,0x80,0xb8,0x80,0x2a,0xc1,0x0a,0x98,0x02,0xf0 }},
+ {16, 0xc1f0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xec,0x00,0xc8,0x50,0x3a,0xc0 }},
+ {16, 0xc200, 0, {0x0d,0xb0,0x03,0xec,0x00,0xdb,0x88,0xba,0xc0,0x08,0xb0,0x03,0x6c,0x08,0xfb,0x00 }},
+ {16, 0xc210, 0, {0x36,0x60,0x0f,0x8c,0x63,0x6c,0x00,0xcb,0xc0,0x3a,0x80,0x0e,0xbe,0x03,0xaf,0x84 }},
+ {16, 0xc220, 0, {0x79,0x80,0x3a,0x88,0x04,0x98,0x01,0xd0,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc230, 0, {0xe0,0x01,0xbc,0x00,0xfc,0x80,0x35,0xc0,0x4f,0xf0,0x03,0xdc,0x00,0xef,0x00,0x37 }},
+ {16, 0xc240, 0, {0xc0,0xaf,0xf0,0x03,0x1c,0x01,0x6f,0x00,0x13,0x00,0x0f,0xc1,0x23,0xfc,0xb8,0xff }},
+ {16, 0xc250, 0, {0x04,0x37,0xc0,0x0c,0xf8,0x43,0x7e,0x04,0xfd,0x00,0x3f,0x04,0x0f,0xd0,0x03,0xf8 }},
+ {16, 0xc260, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xc8,0x40,0x3a,0xc0 }},
+ {16, 0xc270, 0, {0x0c,0xb0,0x03,0xec,0x00,0xfb,0x40,0x38,0xc1,0x0e,0xb0,0x43,0x2c,0x08,0xc3,0x00 }},
+ {16, 0xc280, 0, {0x3e,0x40,0x0e,0x82,0x03,0x6d,0x00,0xdb,0x40,0x32,0xc1,0x5f,0xb4,0xa3,0xed,0x20 }},
+ {16, 0xc290, 0, {0xc9,0x40,0x32,0xe0,0x8f,0x98,0x43,0x90,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc2a0, 0, {0xc8,0x05,0x3c,0x00,0x88,0x00,0x23,0xc0,0x28,0xf5,0xc2,0xfc,0x00,0xb3,0x04,0x23 }},
+ {16, 0xc2b0, 0, {0xc1,0x48,0xf0,0x22,0xbc,0x06,0xaf,0x00,0x0e,0x40,0x08,0x00,0x02,0xcd,0x00,0xbb }},
+ {16, 0xc2c0, 0, {0x01,0x20,0xc0,0x08,0x30,0x02,0xee,0x00,0x81,0xe0,0x34,0xa0,0x0b,0x90,0x02,0x32 }},
+ {16, 0xc2d0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x02,0x80,0x00,0x28,0xc0 }},
+ {16, 0xc2e0, 0, {0x09,0x3c,0x02,0x4c,0x00,0xb3,0x00,0x2c,0xc0,0x0a,0xb0,0x02,0x0c,0x00,0x83,0x01 }},
+ {16, 0xc2f0, 0, {0x2c,0x00,0x0a,0x05,0x02,0xcd,0x58,0xbb,0x00,0x20,0x00,0x0a,0x3d,0x02,0xcf,0x40 }},
+ {16, 0xc300, 0, {0x21,0x20,0x60,0xc0,0x09,0x10,0x02,0xf8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc310, 0, {0x20,0x01,0x1e,0x00,0x84,0x80,0x28,0xe4,0x88,0x78,0x42,0xde,0x00,0xb7,0x90,0x65 }},
+ {16, 0xc320, 0, {0xe4,0x88,0x7a,0x42,0x9e,0x40,0xa7,0x90,0x2d,0xa0,0x0a,0x48,0x22,0xde,0x04,0xb7 }},
+ {16, 0xc330, 0, {0x80,0x23,0x60,0x48,0x78,0x42,0xfe,0x80,0xaf,0x90,0x65,0xe0,0x0b,0xe8,0x02,0xc8 }},
+ {16, 0xc340, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0xc8,0x00,0x38,0xc0 }},
+ {16, 0xc350, 0, {0x0c,0x30,0x03,0xcc,0x00,0xfb,0x00,0x3c,0xc0,0x0e,0xba,0x03,0x0c,0x00,0xc3,0x00 }},
+ {16, 0xc360, 0, {0x3e,0x00,0x4e,0x22,0x02,0xcc,0xc0,0xfb,0x40,0x30,0xc0,0x0a,0x30,0x03,0xce,0x80 }},
+ {16, 0xc370, 0, {0xe1,0x41,0x30,0xc9,0x0f,0x30,0x03,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc380, 0, {0x40,0x1d,0xbc,0x20,0xfc,0x00,0x37,0xc2,0x0e,0xf1,0x23,0xec,0x40,0xff,0x04,0x3a }},
+ {16, 0xc390, 0, {0xc0,0x0f,0xb0,0x23,0xfc,0x00,0xff,0x04,0x3e,0xc0,0x0d,0xa0,0x03,0xfc,0x58,0xff }},
+ {16, 0xc3a0, 0, {0x00,0xbf,0xc0,0x06,0xf0,0x83,0xdc,0x62,0xdf,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0x10 }},
+ {16, 0xc3b0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xed,0x80,0xc9,0x01,0x3e,0xc0 }},
+ {16, 0xc3c0, 0, {0x8c,0xb2,0x07,0xae,0x04,0xcb,0x80,0x3a,0xc8,0x4c,0xb2,0x03,0x2c,0x84,0xcb,0x30 }},
+ {16, 0xc3d0, 0, {0xb0,0xe0,0x0d,0x88,0x0b,0x2c,0x00,0xeb,0x00,0x30,0x00,0x0c,0xbc,0x83,0x2d,0x80 }},
+ {16, 0xc3e0, 0, {0xfb,0x00,0x32,0xc0,0x0c,0x90,0x03,0xea,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc3f0, 0, {0x48,0x11,0x9c,0x40,0x87,0x00,0x2c,0xcc,0x08,0x76,0x82,0x3c,0x82,0x87,0x00,0x21 }},
+ {16, 0xc400, 0, {0xc2,0x8d,0x32,0x82,0x0d,0x4c,0xa7,0x28,0x21,0x80,0x08,0x40,0x02,0x1d,0x80,0xbf }},
+ {16, 0xc410, 0, {0x20,0x35,0x40,0x09,0x72,0x43,0x5c,0xa0,0xb7,0x00,0x29,0xc0,0x08,0x70,0x02,0xd2 }},
+ {16, 0xc420, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x8e,0x00,0x84,0x80,0x2d,0xe0 }},
+ {16, 0xc430, 0, {0x08,0x78,0x02,0xde,0xc0,0x8f,0x80,0x28,0xec,0x28,0x7b,0x0a,0x9e,0x94,0x83,0x84 }},
+ {16, 0xc440, 0, {0x23,0xe0,0x09,0x58,0x50,0x9e,0x10,0xa7,0xb0,0x23,0xe0,0x0b,0x78,0x02,0x1e,0x20 }},
+ {16, 0xc450, 0, {0xb7,0x80,0x21,0xe0,0x09,0x78,0x02,0xf0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc460, 0, {0x48,0x14,0xcc,0x02,0x82,0x1c,0x2c,0xc0,0x28,0x30,0x02,0x4c,0x00,0x83,0xc0,0x20 }},
+ {16, 0xc470, 0, {0xc0,0x08,0x30,0x02,0x0c,0x00,0xa3,0x00,0x60,0xd2,0x08,0x1d,0x02,0x0f,0x20,0xbb }},
+ {16, 0xc480, 0, {0x24,0x24,0xc0,0x0b,0x3c,0x02,0x4f,0x00,0xb3,0x80,0x28,0xd8,0x09,0x32,0x02,0xd2 }},
+ {16, 0xc490, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x11,0xa8,0x00,0xce,0x84,0x3e,0x80 }},
+ {16, 0xc4a0, 0, {0x0c,0xa0,0x03,0xe8,0x00,0xce,0xc0,0x3a,0x80,0x08,0xa0,0x03,0xa8,0x00,0xca,0x00 }},
+ {16, 0xc4b0, 0, {0x33,0x80,0x0d,0xec,0x03,0x3b,0x80,0xee,0x82,0x33,0x80,0x0a,0xc0,0x87,0x10,0x40 }},
+ {16, 0xc4c0, 0, {0xf6,0xc0,0x33,0x90,0xad,0x64,0x03,0xfa,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc4d0, 0, {0x48,0x00,0xc0,0x02,0xf8,0x00,0x3c,0x00,0x1f,0x04,0x03,0xa0,0x04,0xf8,0x30,0x3e }},
+ {16, 0xc4e0, 0, {0x00,0x0f,0x80,0x03,0xe0,0x00,0xf8,0x00,0x3e,0x04,0x0f,0x80,0x93,0xe0,0x00,0xf8 }},
+ {16, 0xc4f0, 0, {0x10,0x3e,0x00,0x2c,0x84,0x03,0xe0,0x00,0xf8,0x18,0x3e,0x10,0x0e,0x80,0x03,0xd2 }},
+ {16, 0xc500, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xd9,0x00,0x3e,0x40 }},
+ {16, 0xc510, 0, {0x0e,0x90,0x03,0xa4,0x10,0xf9,0x00,0x3e,0x40,0x04,0x90,0x03,0x24,0x00,0x41,0x00 }},
+ {16, 0xc520, 0, {0x3e,0x40,0x0f,0x91,0x13,0xe1,0x08,0xf8,0x00,0x32,0x40,0x08,0x89,0x83,0xa2,0x00 }},
+ {16, 0xc530, 0, {0xc9,0x80,0x32,0x40,0x0c,0x90,0x0b,0x02,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc540, 0, {0x80,0x04,0x64,0x02,0x89,0x00,0x2e,0x40,0x0d,0x90,0x02,0x24,0x00,0xb9,0x00,0x2e }},
+ {16, 0xc550, 0, {0x40,0x48,0x90,0x02,0xa4,0x00,0x89,0x00,0x22,0x40,0x8b,0x94,0x42,0xe2,0x20,0xb8 }},
+ {16, 0xc560, 0, {0x00,0xa2,0x40,0x08,0x94,0x02,0xe5,0x04,0xa9,0x90,0x34,0x60,0x08,0x90,0x02,0x20 }},
+ {16, 0xc570, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x10,0x99,0x00,0x2e,0x40 }},
+ {16, 0xc580, 0, {0x0a,0x90,0x02,0xe4,0x00,0xb9,0x00,0x24,0x40,0x0a,0x10,0x02,0x04,0x00,0xa9,0x00 }},
+ {16, 0xc590, 0, {0x2a,0x40,0x0b,0x90,0x82,0xe0,0x01,0xb8,0x00,0x20,0x40,0x3a,0x90,0x02,0xa4,0x44 }},
+ {16, 0xc5a0, 0, {0x89,0x04,0x22,0x62,0x08,0x98,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc5b0, 0, {0x08,0x04,0x04,0x8a,0x81,0x00,0x2c,0x48,0x09,0x32,0x06,0x44,0x80,0xb1,0x00,0x2c }},
+ {16, 0xc5c0, 0, {0x48,0x0a,0x12,0x02,0x84,0x80,0xa1,0x20,0x20,0x50,0x0b,0x14,0x02,0xc5,0x00,0xb1 }},
+ {16, 0xc5d0, 0, {0x40,0x20,0x50,0x0a,0x24,0x02,0xc9,0x00,0xa3,0x00,0x24,0x40,0x08,0x11,0x02,0x02 }},
+ {16, 0xc5e0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x61,0x40,0xd8,0x50,0x3e,0x14 }},
+ {16, 0xc5f0, 0, {0x0e,0x80,0x03,0xe1,0x40,0xf8,0x51,0x36,0x14,0x2e,0x85,0x43,0x21,0x42,0xe8,0x50 }},
+ {16, 0xc600, 0, {0x3a,0x00,0x0f,0x80,0x12,0xe0,0x00,0xf8,0x00,0x32,0x00,0x1e,0x80,0x43,0xa0,0x00 }},
+ {16, 0xc610, 0, {0xc8,0x01,0x32,0x00,0x0c,0x80,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc620, 0, {0x98,0x1d,0xe4,0x40,0xfd,0x00,0x3e,0x44,0x4e,0x11,0x03,0xa4,0x40,0xb5,0x00,0x3e }},
+ {16, 0xc630, 0, {0x44,0x0d,0x91,0x03,0xe4,0x40,0xd9,0x10,0x3f,0x40,0x0f,0x50,0x03,0xe5,0x00,0xf9 }},
+ {16, 0xc640, 0, {0x40,0x3f,0x40,0x0d,0x44,0x03,0xf1,0x00,0xf5,0x02,0x3d,0xc0,0x2f,0xd2,0x03,0xe6 }},
+ {16, 0xc650, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xe7,0x00,0xe9,0x00,0x36,0x60 }},
+ {16, 0xc660, 0, {0x0d,0xda,0x03,0xe6,0x40,0xf9,0x40,0x3e,0x68,0x0c,0x9a,0x03,0x66,0x20,0x89,0xa0 }},
+ {16, 0xc670, 0, {0x33,0x40,0x0e,0x90,0x07,0xa6,0x00,0xf9,0x80,0x3e,0x50,0x0c,0xca,0x03,0xf3,0x80 }},
+ {16, 0xc680, 0, {0xc5,0x02,0x33,0x40,0x0c,0xc0,0x03,0xc6,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc690, 0, {0x38,0x10,0xe3,0x04,0x88,0xa2,0x20,0x38,0x08,0x80,0x02,0xe3,0x40,0xb0,0x80,0x2e }},
+ {16, 0xc6a0, 0, {0x28,0x08,0x8a,0x82,0x23,0x80,0x88,0x80,0x22,0x00,0xdb,0x88,0x02,0x62,0x04,0xb8 }},
+ {16, 0xc6b0, 0, {0xb0,0x2e,0xa8,0x88,0x8e,0xa2,0xea,0x80,0x88,0x00,0x2a,0x00,0x28,0x88,0x03,0x8e }},
+ {16, 0xc6c0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc5,0x82,0xa9,0x08,0x2c,0x52 }},
+ {16, 0xc6d0, 0, {0x0b,0x14,0x02,0xc4,0x80,0xb1,0x21,0x0c,0x52,0x88,0x14,0x02,0x44,0x20,0x91,0x69 }},
+ {16, 0xc6e0, 0, {0x20,0x40,0x0a,0x10,0x82,0xc6,0xe0,0xb1,0x0c,0x2c,0x48,0x08,0x01,0x02,0xe1,0x93 }},
+ {16, 0xc6f0, 0, {0xa1,0x01,0x24,0x41,0x0a,0x10,0x02,0xc2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc700, 0, {0x18,0x15,0xa4,0x00,0x89,0x04,0x22,0x40,0x08,0x90,0x00,0xe4,0x00,0x39,0x02,0x0e }},
+ {16, 0xc710, 0, {0x40,0x08,0x10,0x62,0x24,0x00,0x91,0x00,0x62,0x40,0x8b,0x80,0x02,0xe0,0x54,0xb9 }},
+ {16, 0xc720, 0, {0x0c,0x2e,0x40,0x09,0xb6,0x52,0xec,0x00,0xa9,0x00,0x2a,0x40,0x0a,0x92,0x80,0x86 }},
+ {16, 0xc730, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x11,0xe4,0x00,0xe1,0x60,0x36,0x40 }},
+ {16, 0xc740, 0, {0x0d,0x90,0x23,0xe4,0x00,0xf9,0x30,0x3e,0x40,0x2c,0x90,0x43,0x64,0x06,0xc9,0x00 }},
+ {16, 0xc750, 0, {0x32,0x49,0x0e,0x8d,0x93,0xe0,0x00,0xf9,0x00,0x2e,0x40,0x2c,0x94,0x03,0xc7,0x40 }},
+ {16, 0xc760, 0, {0xe9,0x20,0x30,0x55,0x0e,0x90,0x03,0xe8,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc770, 0, {0x28,0x01,0xa4,0x00,0xf9,0x00,0x1e,0x40,0x0f,0x90,0x03,0xe4,0x00,0xf9,0x80,0x3c }},
+ {16, 0xc780, 0, {0x40,0x4f,0x90,0x03,0xe4,0x00,0xe9,0x04,0xbe,0x40,0x0f,0x88,0x33,0x62,0x00,0xf9 }},
+ {16, 0xc790, 0, {0xc2,0x3e,0x48,0x2e,0x88,0x33,0xe2,0x00,0xd9,0x00,0x3e,0x60,0x0d,0x80,0x03,0xca }},
+ {16, 0xc7a0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xc8,0x00,0x3e,0x00 }},
+ {16, 0xc7b0, 0, {0x0d,0x80,0x03,0xa0,0x04,0xe8,0x40,0xba,0x00,0x0c,0x80,0x03,0xe0,0x04,0xc8,0x00 }},
+ {16, 0xc7c0, 0, {0x3a,0x00,0x0e,0x8c,0x03,0xe0,0x00,0xf8,0x02,0x32,0x00,0x0e,0x80,0x03,0x61,0x20 }},
+ {16, 0xc7d0, 0, {0xf8,0x00,0x32,0x16,0x0f,0x80,0x03,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc7e0, 0, {0x28,0x05,0x28,0x00,0x8a,0x00,0x2e,0x80,0x08,0xe2,0x03,0x28,0x00,0x8a,0x00,0x22 }},
+ {16, 0xc7f0, 0, {0x80,0x08,0xa0,0x02,0xe8,0x04,0x8a,0x00,0x2e,0xa2,0x09,0xe8,0x02,0xfa,0x04,0xbe }},
+ {16, 0xc800, 0, {0x00,0xa2,0x80,0x08,0xcd,0x82,0x33,0x20,0xb6,0xc0,0x37,0xa0,0x4b,0xc8,0x82,0xca }},
+ {16, 0xc810, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x6c,0x00,0x83,0x00,0x26,0xc0 }},
+ {16, 0xc820, 0, {0x09,0x38,0x02,0x4c,0x00,0xb3,0x00,0x24,0xc0,0x08,0x30,0x02,0xec,0x00,0x83,0x00 }},
+ {16, 0xc830, 0, {0x28,0xe0,0x0b,0x30,0x02,0xce,0x81,0xb3,0x00,0x62,0xc0,0x08,0x3c,0x02,0x4f,0x00 }},
+ {16, 0xc840, 0, {0xb3,0xa0,0x20,0xb0,0x03,0x30,0x02,0xca,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc850, 0, {0xa0,0x01,0x0c,0x41,0x87,0x34,0x2d,0xc0,0x08,0x60,0x02,0x9e,0x40,0xb7,0xa0,0x2d }},
+ {16, 0xc860, 0, {0xc0,0x08,0x73,0x02,0xdc,0x00,0x87,0x20,0x2d,0xc0,0x0b,0x70,0x82,0xdd,0x85,0xbf }},
+ {16, 0xc870, 0, {0x81,0x63,0xc8,0x88,0x7b,0x02,0x1c,0x00,0xb7,0x40,0x65,0x00,0x1b,0x72,0x02,0xe8 }},
+ {16, 0xc880, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0x00,0xc7,0x81,0x3d,0xe0 }},
+ {16, 0xc890, 0, {0xdd,0x70,0x03,0xfe,0x80,0xf7,0x90,0x3f,0xe0,0x2c,0x79,0x03,0xfe,0x80,0xc7,0xa0 }},
+ {16, 0xc8a0, 0, {0x39,0xe0,0x0f,0x7a,0x02,0xde,0x84,0xf7,0xc2,0x31,0xf2,0x0c,0x79,0x03,0x5e,0x04 }},
+ {16, 0xc8b0, 0, {0xf7,0x84,0x31,0x60,0x0f,0x7e,0x03,0xea,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc8c0, 0, {0x08,0x1d,0xad,0x0a,0xfb,0x60,0x7e,0xd4,0x0f,0x30,0x03,0x6c,0x00,0xcb,0x00,0x32 }},
+ {16, 0xc8d0, 0, {0xde,0x2f,0xb2,0x03,0xed,0x42,0x1b,0x60,0x3e,0xc1,0x0d,0xb1,0x03,0xec,0x50,0xf7 }},
+ {16, 0xc8e0, 0, {0x80,0x3d,0xd8,0x2e,0x32,0x03,0xec,0x30,0xfb,0x00,0x3e,0x40,0x0f,0xb0,0x03,0xc2 }},
+ {16, 0xc8f0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xff,0x00,0xcb,0xd0,0x3f,0xf0 }},
+ {16, 0xc900, 0, {0x4c,0xf8,0x13,0xfe,0x00,0xcf,0x88,0x3f,0xe0,0x0c,0xf8,0x43,0x3f,0x00,0xcf,0xc8 }},
+ {16, 0xc910, 0, {0x33,0xe0,0x0c,0xf8,0x03,0xfe,0x00,0xff,0x80,0x3f,0xe0,0x2c,0xf8,0x03,0xbe,0x20 }},
+ {16, 0xc920, 0, {0xc7,0x80,0x33,0xe0,0x0c,0xf8,0x01,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc930, 0, {0xa8,0x01,0xbc,0x40,0x87,0x90,0x3d,0xc0,0x08,0x40,0x02,0xdc,0x80,0xd7,0x00,0x2d }},
+ {16, 0xc940, 0, {0xc0,0x0c,0x30,0x03,0x7c,0x00,0x87,0x10,0x21,0xc4,0x1e,0x70,0x20,0xdc,0x44,0xb7 }},
+ {16, 0xc950, 0, {0x00,0x39,0xc0,0x0c,0x71,0x02,0x1c,0x40,0xd7,0x02,0x29,0x40,0x08,0x70,0x02,0x2a }},
+ {16, 0xc960, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x00,0x87,0x32,0x2d,0xc0 }},
+ {16, 0xc970, 0, {0x08,0x70,0x02,0xdc,0x01,0x87,0x00,0x2c,0xc0,0x2b,0x70,0x0a,0x5c,0x00,0x83,0x00 }},
+ {16, 0xc980, 0, {0x23,0xc0,0x08,0x70,0x02,0xdd,0x00,0xb7,0x00,0x2d,0xc4,0x0b,0xf0,0x02,0x9c,0x20 }},
+ {16, 0xc990, 0, {0x87,0x18,0x29,0x40,0x08,0x70,0x82,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc9a0, 0, {0x20,0x14,0xcc,0x00,0x83,0x02,0x28,0xc0,0x08,0x10,0x02,0xcc,0x08,0x83,0x40,0x2e }},
+ {16, 0xc9b0, 0, {0xc0,0x2a,0x30,0x02,0x0c,0x00,0x8b,0x00,0x20,0xf2,0x0a,0x30,0x02,0xce,0x00,0xb3 }},
+ {16, 0xc9c0, 0, {0x88,0x2a,0xd0,0x0a,0x30,0x06,0x0c,0x00,0x92,0x00,0x28,0x78,0x08,0x3c,0x42,0x08 }},
+ {16, 0xc9d0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xbc,0x02,0xc7,0x00,0x2f,0xc0 }},
+ {16, 0xc9e0, 0, {0x2c,0x90,0x02,0xfc,0x02,0x8f,0xd8,0x3f,0xc0,0x4b,0xf0,0x02,0x7c,0x02,0xcf,0x00 }},
+ {16, 0xc9f0, 0, {0x20,0xf2,0x08,0xb0,0x13,0xee,0x80,0xff,0x00,0x3f,0xd4,0x2e,0xbd,0x83,0xac,0x00 }},
+ {16, 0xca00, 0, {0xcb,0x80,0x3a,0xa0,0xac,0xb8,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xca10, 0, {0x80,0x00,0xec,0x00,0xfb,0x10,0x3e,0xc0,0x0f,0x84,0x03,0xec,0x10,0xfb,0x00,0x3e }},
+ {16, 0xca20, 0, {0xc0,0x01,0xb0,0x03,0xec,0x00,0xfb,0x00,0xbe,0xc0,0x0e,0xb0,0x23,0xec,0x08,0xfb }},
+ {16, 0xca30, 0, {0x10,0x3f,0xc0,0x0d,0xb4,0x03,0xed,0x04,0xf9,0x00,0x1e,0x14,0xcf,0xb0,0x83,0xe0 }},
+ {16, 0xca40, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x00,0xcf,0x00,0x30,0xc0 }},
+ {16, 0xca50, 0, {0x0c,0x40,0x03,0xac,0x00,0xff,0x00,0x3f,0xc0,0x2c,0xb0,0x03,0xbc,0x00,0xff,0x00 }},
+ {16, 0xca60, 0, {0xb3,0xe0,0x0d,0xfa,0x03,0x7e,0x80,0xcf,0x00,0x33,0xc0,0x0c,0xfc,0x43,0xff,0x20 }},
+ {16, 0xca70, 0, {0xff,0x00,0x3f,0x40,0x08,0xf8,0x03,0xc0,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xca80, 0, {0x81,0x04,0x6c,0x10,0xab,0x00,0x2a,0xc0,0x0a,0x8e,0x42,0x2c,0x04,0xbb,0x00,0x2e }},
+ {16, 0xca90, 0, {0xc0,0x08,0xb0,0x02,0x6c,0x00,0xbb,0x00,0x3a,0xc0,0x0e,0x30,0x02,0x0d,0x08,0x83 }},
+ {16, 0xcaa0, 0, {0x02,0x22,0xc0,0x0a,0xbc,0x02,0xef,0x00,0xbb,0xc0,0x2c,0x68,0x0a,0xb9,0x02,0xe0 }},
+ {16, 0xcab0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x0c,0x00,0x8b,0x00,0x22,0xc0 }},
+ {16, 0xcac0, 0, {0x08,0xb8,0x02,0xac,0x00,0xbb,0x02,0x2e,0xc0,0x08,0xb0,0x02,0xec,0x00,0xbb,0x00 }},
+ {16, 0xcad0, 0, {0x26,0x48,0x19,0xb0,0x02,0x6d,0x00,0x8b,0x00,0x22,0xc0,0x0a,0xb0,0x02,0xec,0x04 }},
+ {16, 0xcae0, 0, {0xbb,0x1c,0x2e,0x20,0x0a,0xb0,0x02,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcaf0, 0, {0x08,0x14,0x0c,0x00,0xab,0x20,0x28,0xc0,0x0a,0x00,0x02,0x0c,0x00,0x93,0x04,0x2c }},
+ {16, 0xcb00, 0, {0xc1,0x08,0x30,0x02,0x4c,0x00,0xb3,0x00,0x24,0x41,0x09,0xb8,0x02,0x0c,0x02,0x83 }},
+ {16, 0xcb10, 0, {0x01,0xa0,0xc0,0x0a,0x30,0x02,0xcc,0x10,0x93,0x00,0x2c,0x00,0x0a,0x30,0x02,0xc2 }},
+ {16, 0xcb20, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x7c,0x00,0xcf,0x28,0x33,0xc0 }},
+ {16, 0xcb30, 0, {0x0c,0xa0,0x46,0xac,0x11,0xbf,0x00,0x3f,0xc0,0x5c,0xf0,0x43,0xfc,0x00,0xff,0x04 }},
+ {16, 0xcb40, 0, {0x32,0x40,0x0d,0xb0,0x03,0x6c,0x08,0xcb,0x04,0x31,0xc0,0x0c,0xb0,0x33,0xed,0x40 }},
+ {16, 0xcb50, 0, {0xfb,0x04,0x3e,0x40,0x0e,0xb0,0x03,0xc0,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcb60, 0, {0xa0,0x15,0xfc,0x00,0xff,0x00,0x3f,0xc0,0x0f,0xc0,0x23,0xfc,0x01,0xff,0x00,0x3f }},
+ {16, 0xcb70, 0, {0xc0,0x4f,0xf0,0x87,0x7c,0x00,0xff,0x00,0x39,0x40,0x0e,0xf0,0x03,0xfc,0x00,0xff }},
+ {16, 0xcb80, 0, {0x00,0x3f,0xc0,0x0f,0x70,0x03,0xdc,0x80,0xff,0x00,0x3d,0x40,0x0f,0x70,0x03,0xe8 }},
+ {16, 0xcb90, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfc,0x40,0xeb,0x48,0x3e,0xc2 }},
+ {16, 0xcba0, 0, {0x0e,0x09,0x03,0xbc,0x60,0xc0,0x20,0x35,0x24,0x0e,0xd2,0x13,0x2c,0x60,0xfb,0x6a }},
+ {16, 0xcbb0, 0, {0x33,0xc0,0x0f,0xca,0x03,0x22,0x20,0xc0,0x80,0x37,0xc0,0x0d,0xf0,0x03,0x7c,0x00 }},
+ {16, 0xcbc0, 0, {0xef,0x00,0x33,0x24,0x0f,0xc8,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcbd0, 0, {0x80,0x10,0xdd,0x00,0x8f,0x60,0x2f,0xd8,0x08,0xa2,0x02,0xfd,0x80,0xc8,0x70,0x22 }},
+ {16, 0xcbe0, 0, {0x00,0x2c,0xfd,0x07,0xdc,0x84,0xbf,0x60,0x23,0xd2,0x0b,0xbd,0x02,0x23,0x00,0x88 }},
+ {16, 0xcbf0, 0, {0x80,0xa2,0x20,0x88,0xb0,0x22,0x34,0x00,0xbb,0x50,0x22,0xc8,0x0b,0xb0,0x02,0x20 }},
+ {16, 0xcc00, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x40,0xa3,0x03,0x2c,0xc2 }},
+ {16, 0xcc10, 0, {0x0a,0x00,0x42,0x8c,0x82,0xa3,0x0a,0x24,0x80,0x0b,0x30,0x02,0xcc,0x90,0xb3,0x00 }},
+ {16, 0xcc20, 0, {0x28,0xd8,0x0b,0x10,0x02,0x8c,0x02,0x90,0x00,0x20,0xc0,0x0b,0x10,0x42,0x4c,0x00 }},
+ {16, 0xcc30, 0, {0xb3,0x04,0x24,0xc0,0x0b,0x30,0x0e,0xa2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcc40, 0, {0xc0,0x15,0xac,0x10,0x9b,0x04,0x2c,0xc0,0xf8,0x98,0x06,0xec,0x00,0xab,0x80,0x26 }},
+ {16, 0xcc50, 0, {0x20,0x08,0x90,0x2a,0xac,0x10,0xbb,0x00,0x0a,0xc0,0x1b,0xb0,0x22,0xad,0x00,0x98 }},
+ {16, 0xcc60, 0, {0x40,0x2a,0x70,0x4b,0xb0,0x02,0x2c,0x00,0xb3,0x00,0xa6,0x86,0x1b,0xb0,0x82,0xb0 }},
+ {16, 0xcc70, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xec,0x00,0xeb,0x00,0x3e,0xc0 }},
+ {16, 0xcc80, 0, {0x8e,0x98,0x03,0xac,0x08,0xe8,0xc0,0x36,0x30,0x4f,0xb0,0x42,0xec,0x00,0xf9,0x80 }},
+ {16, 0xcc90, 0, {0x3a,0xc0,0x8f,0x88,0x42,0x20,0x10,0xc8,0x10,0x30,0xf0,0x0f,0x30,0x13,0x6c,0x10 }},
+ {16, 0xcca0, 0, {0xeb,0x00,0x36,0xf0,0x0f,0xbd,0x03,0x90,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xccb0, 0, {0xe0,0x01,0xbc,0x00,0xef,0x04,0x7f,0xc0,0x0f,0xf0,0x43,0xdc,0x00,0xc4,0x00,0x3b }},
+ {16, 0xccc0, 0, {0x40,0x8b,0xdc,0x03,0x7c,0x10,0xf9,0x90,0x36,0xc2,0x4f,0xf9,0x23,0x62,0x41,0xac }},
+ {16, 0xccd0, 0, {0x01,0x13,0x40,0x04,0xb0,0x03,0xe4,0x00,0xff,0x00,0x3b,0xc0,0x0f,0xc0,0x03,0x78 }},
+ {16, 0xcce0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0x8c,0x12,0xcb,0x00,0xf2,0xc0 }},
+ {16, 0xccf0, 0, {0x0f,0x80,0x03,0xac,0x08,0xd9,0x00,0x3a,0x80,0x0f,0x12,0x03,0xac,0x00,0xe1,0x00 }},
+ {16, 0xcd00, 0, {0x32,0xc0,0x0c,0x90,0x03,0xed,0x02,0xc8,0x40,0x3e,0xd0,0x0f,0x90,0x13,0x2c,0x02 }},
+ {16, 0xcd10, 0, {0xdb,0x00,0x3e,0x50,0x0c,0xb4,0x03,0x10,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcd20, 0, {0xc8,0x05,0x3c,0x00,0x8f,0x00,0x17,0xc0,0x08,0x90,0x02,0x3c,0x08,0x8d,0x00,0x22 }},
+ {16, 0xcd30, 0, {0x54,0x08,0xb4,0x03,0x3c,0x00,0x89,0x00,0x23,0xc0,0x40,0x35,0x02,0xcc,0x24,0x80 }},
+ {16, 0xcd40, 0, {0x00,0x22,0x74,0x4c,0xb0,0x02,0x2c,0x00,0x8f,0x00,0x2e,0xd4,0x0a,0xb0,0x0a,0x32 }},
+ {16, 0xcd50, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x01,0x4c,0x02,0x83,0x00,0x24,0xc0 }},
+ {16, 0xcd60, 0, {0x09,0x00,0x02,0x8c,0x01,0x90,0x00,0x6a,0x41,0x0a,0x30,0x20,0x4e,0x10,0x31,0x02 }},
+ {16, 0xcd70, 0, {0x2c,0xc0,0x09,0x20,0x06,0xce,0x00,0x80,0x00,0x60,0xe0,0x0a,0x30,0x82,0x0c,0x08 }},
+ {16, 0xcd80, 0, {0x83,0x08,0x2c,0xd0,0x09,0xb0,0x02,0x78,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcd90, 0, {0x20,0x01,0x1e,0x04,0x87,0xb0,0x20,0xec,0x09,0xe9,0x02,0x8e,0x58,0x9d,0xb0,0x2b }},
+ {16, 0xcda0, 0, {0xa5,0x40,0x5b,0x06,0xde,0x40,0x95,0x94,0x2d,0xe4,0x19,0x7b,0x06,0xde,0x00,0x84 }},
+ {16, 0xcdb0, 0, {0x80,0x60,0xe0,0x0a,0x78,0x0a,0x16,0x10,0x87,0x80,0x2d,0x68,0x0b,0x79,0x02,0x48 }},
+ {16, 0xcdc0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0xcb,0xa0,0x24,0xe0 }},
+ {16, 0xcdd0, 0, {0x0f,0x2a,0x03,0x8e,0x00,0xd2,0xd0,0x38,0xfa,0x0f,0x18,0xc3,0xce,0x24,0x31,0xb0 }},
+ {16, 0xcde0, 0, {0x3c,0xe5,0x0c,0x3b,0x17,0xce,0x04,0xc0,0x82,0x38,0xc2,0x9e,0x10,0x03,0x0c,0x00 }},
+ {16, 0xcdf0, 0, {0xc3,0x01,0x3e,0xc0,0x0d,0x81,0x03,0x52,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xce00, 0, {0x40,0x1d,0xbc,0x00,0xef,0x10,0x3e,0xc2,0x0e,0xb1,0x23,0x2c,0xc1,0xab,0x01,0x36 }},
+ {16, 0xce10, 0, {0x80,0x0f,0xb0,0x23,0x2d,0x90,0xe9,0x84,0x72,0xc8,0x62,0xf1,0x17,0xfc,0x00,0xfc }},
+ {16, 0xce20, 0, {0x00,0x3b,0xc4,0x1d,0xf0,0x03,0xec,0x00,0xef,0x08,0x3f,0xc8,0x0e,0xf1,0x03,0x90 }},
+ {16, 0xce30, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x80,0xfb,0xa4,0x3a,0xc8 }},
+ {16, 0xce40, 0, {0x0e,0x90,0x03,0x2c,0x04,0xca,0x00,0x30,0x60,0x2d,0x1a,0x27,0x6c,0x84,0xcb,0x60 }},
+ {16, 0xce50, 0, {0x32,0xd2,0x0c,0xa0,0x13,0x2d,0x84,0xcb,0x02,0x3e,0xc0,0x0d,0xb8,0x03,0xac,0x80 }},
+ {16, 0xce60, 0, {0xcb,0x81,0x32,0x80,0x0c,0xb0,0x03,0xaa,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xce70, 0, {0x48,0x11,0x9c,0xa4,0xb7,0x28,0x73,0xc2,0x08,0xf0,0x02,0x3c,0xc0,0x8f,0x00,0x31 }},
+ {16, 0xce80, 0, {0xc0,0x09,0x70,0x82,0x9c,0x80,0x87,0x0c,0x20,0xd8,0x09,0x70,0x22,0x1c,0x30,0x84 }},
+ {16, 0xce90, 0, {0x00,0x3d,0xc0,0x08,0x70,0x02,0x14,0x24,0x87,0xa0,0x21,0xc0,0x08,0x70,0x12,0x12 }},
+ {16, 0xcea0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x40,0xb3,0x95,0x29,0xe9 }},
+ {16, 0xceb0, 0, {0x0a,0x68,0x02,0x9e,0xd0,0x86,0xf0,0xa3,0xe0,0x08,0x78,0x12,0x9e,0x44,0xa3,0x82 }},
+ {16, 0xcec0, 0, {0x21,0xe8,0x0b,0x38,0x02,0x0e,0x10,0x87,0x80,0x2f,0xe0,0x0b,0x18,0x02,0x8e,0x02 }},
+ {16, 0xced0, 0, {0x87,0x00,0x21,0xe0,0x08,0x78,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcee0, 0, {0x48,0x14,0xcc,0x00,0xb3,0x00,0x24,0xc0,0x48,0x30,0x02,0x0c,0x04,0x83,0x80,0x20 }},
+ {16, 0xcef0, 0, {0xd0,0x09,0x10,0x02,0x8c,0x06,0xa3,0x80,0x20,0xc0,0x0b,0x30,0x02,0x0c,0x02,0x80 }},
+ {16, 0xcf00, 0, {0x40,0x28,0xd2,0x0a,0x30,0x02,0x0c,0x01,0x83,0x00,0x22,0x3c,0x08,0x87,0x02,0x12 }},
+ {16, 0xcf10, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x18,0xfa,0x00,0x3a,0x80 }},
+ {16, 0xcf20, 0, {0x8e,0xe4,0x42,0x28,0x02,0xce,0x80,0x33,0x80,0x4d,0xa0,0x83,0xe8,0x00,0xea,0xa0 }},
+ {16, 0xcf30, 0, {0xb2,0x80,0x0a,0xa0,0x0a,0x28,0x00,0xce,0x18,0x2f,0x80,0x0f,0xa0,0x13,0xa8,0x00 }},
+ {16, 0xcf40, 0, {0xca,0x00,0x32,0x90,0x2c,0xac,0x0b,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcf50, 0, {0x48,0x00,0xe0,0x00,0xf8,0x04,0x3a,0x00,0x0f,0x80,0x83,0xc0,0x08,0xe8,0x03,0x3a }},
+ {16, 0xcf60, 0, {0x00,0x0e,0x80,0x22,0xc0,0x00,0xd0,0x00,0x7e,0x10,0xa4,0x80,0x03,0xc0,0x00,0xf8 }},
+ {16, 0xcf70, 0, {0x00,0x3e,0x10,0x0d,0x84,0x03,0xc0,0x00,0xf8,0x00,0xbe,0x00,0x0f,0x80,0x01,0x52 }},
+ {16, 0xcf80, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xc4,0x02,0xc9,0x00,0x36,0x40 }},
+ {16, 0xcf90, 0, {0x0c,0x90,0x03,0x64,0x02,0x89,0x04,0x32,0x42,0x0d,0x92,0x03,0xe6,0x42,0xc9,0x00 }},
+ {16, 0xcfa0, 0, {0x32,0x70,0x0e,0x12,0x0b,0x24,0x08,0xc9,0x00,0x3e,0x45,0x0e,0x99,0x03,0xe4,0x02 }},
+ {16, 0xcfb0, 0, {0xc1,0x00,0x32,0x50,0x04,0x94,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcfc0, 0, {0x80,0x04,0x64,0x00,0x89,0x00,0x6e,0x40,0x08,0x90,0x02,0x24,0x00,0x89,0x00,0x22 }},
+ {16, 0xcfd0, 0, {0x54,0x0b,0x90,0x03,0xe6,0x00,0x89,0x00,0x22,0x40,0x08,0x90,0x0a,0x24,0x00,0x89 }},
+ {16, 0xcfe0, 0, {0x00,0x38,0x48,0x08,0x90,0x82,0xe4,0x04,0xd9,0x00,0x22,0x40,0x08,0x90,0x02,0x20 }},
+ {16, 0xcff0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0x89,0x01,0x2c,0x40 }},
+ {16, 0xd000, 0, {0x28,0x10,0x42,0x64,0x00,0xa1,0x04,0x22,0x50,0x01,0x90,0x42,0xe4,0x00,0x89,0x04 }},
+ {16, 0xd010, 0, {0x20,0x42,0x0a,0x90,0x42,0x34,0x00,0x89,0x00,0x6e,0x40,0x0a,0x90,0x00,0xe4,0x00 }},
+ {16, 0xd020, 0, {0x89,0x00,0x23,0x40,0x0a,0xd0,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd030, 0, {0x08,0x04,0x04,0x80,0x81,0x24,0x2c,0x48,0x08,0x10,0x02,0x04,0x80,0xa1,0x20,0x28 }},
+ {16, 0xd040, 0, {0x40,0x0b,0x10,0x02,0x85,0x80,0x81,0x20,0x20,0x48,0x08,0x50,0x62,0x14,0x02,0x81 }},
+ {16, 0xd050, 0, {0x03,0x2e,0x40,0x88,0x16,0x82,0xc4,0xa0,0x91,0x28,0x21,0x40,0x2a,0x50,0x02,0x02 }},
+ {16, 0xd060, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x61,0x40,0xc8,0x50,0x2e,0x14 }},
+ {16, 0xd070, 0, {0x0c,0x85,0x03,0x61,0x40,0xe8,0x50,0xb2,0x15,0x4d,0x80,0x02,0xc0,0x00,0x48,0x50 }},
+ {16, 0xd080, 0, {0xb2,0x15,0x1a,0x80,0x13,0x30,0x08,0xc8,0x00,0x3e,0x00,0x0e,0x82,0x03,0xe0,0x80 }},
+ {16, 0xd090, 0, {0xc0,0x20,0x30,0x00,0x0e,0x40,0x0b,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd0a0, 0, {0x98,0x1d,0xe4,0x40,0xf9,0x10,0x3e,0x44,0x0f,0xd0,0x03,0xe4,0x48,0xdd,0x10,0x37 }},
+ {16, 0xd0b0, 0, {0x40,0x0f,0xd4,0x07,0xe4,0x40,0xfd,0x10,0x3e,0x45,0x0f,0x94,0x03,0xe5,0x08,0xfd }},
+ {16, 0xd0c0, 0, {0x02,0x39,0xd0,0x0f,0xd0,0x43,0xf4,0xa0,0xf9,0x28,0x3e,0x4b,0x0d,0x92,0x83,0xe6 }},
+ {16, 0xd0d0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xe6,0x80,0xc9,0xa6,0x32,0x68 }},
+ {16, 0xd0e0, 0, {0x0c,0x90,0x03,0xa6,0x81,0xe9,0xe9,0x3b,0x40,0x0e,0x58,0x03,0x36,0x20,0xc9,0xa0 }},
+ {16, 0xd0f0, 0, {0x37,0x78,0x0d,0xda,0x03,0x36,0x26,0xc5,0x00,0x37,0x69,0x0e,0xde,0x03,0xa6,0x82 }},
+ {16, 0xd100, 0, {0xcd,0xc0,0x33,0x50,0x0f,0xd0,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd110, 0, {0x38,0x10,0xe3,0xa4,0x88,0xa9,0x22,0x3a,0x08,0x08,0x00,0x22,0xa0,0xb8,0xe5,0x30 }},
+ {16, 0xd120, 0, {0x20,0x28,0x80,0x22,0x43,0xa0,0x08,0xe8,0x2a,0x3d,0x08,0xa4,0x62,0x20,0x00,0x88 }},
+ {16, 0xd130, 0, {0x00,0x2e,0x10,0x08,0x8e,0x03,0x23,0xa0,0x88,0xa0,0x20,0x28,0x0b,0x8a,0x82,0x0e }},
+ {16, 0xd140, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x40,0x91,0x40,0x20,0x44 }},
+ {16, 0xd150, 0, {0x08,0x90,0xa2,0x85,0x10,0xa1,0x20,0x2c,0x42,0x0b,0x14,0x12,0x8c,0x01,0x91,0x10 }},
+ {16, 0xd160, 0, {0x2c,0x48,0x09,0x11,0x0a,0xc4,0x00,0x81,0x00,0x2c,0x50,0x0b,0x11,0x12,0xc5,0x01 }},
+ {16, 0xd170, 0, {0xb1,0x40,0x24,0x48,0x0b,0x18,0x0e,0x02,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd180, 0, {0x18,0x15,0xa4,0x00,0x91,0x00,0x22,0x41,0x08,0x94,0x42,0x24,0x00,0xb1,0x40,0x20 }},
+ {16, 0xd190, 0, {0x40,0x49,0xb2,0x62,0x24,0x00,0x99,0x00,0x0a,0x40,0x08,0x90,0x02,0xe5,0x80,0x89 }},
+ {16, 0xd1a0, 0, {0x00,0x2e,0x40,0x09,0xb0,0x02,0x24,0x80,0xb9,0x00,0x26,0x50,0x4b,0x90,0x02,0x06 }},
+ {16, 0xd1b0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x02,0xd9,0x00,0xb2,0x40 }},
+ {16, 0xd1c0, 0, {0x2c,0x95,0x13,0xa4,0x10,0xe9,0x00,0xbe,0x60,0x8f,0x90,0x0b,0xa4,0x10,0x59,0x00 }},
+ {16, 0xd1d0, 0, {0x1e,0x40,0x9d,0x94,0x23,0xe4,0x02,0x89,0x00,0x34,0x40,0x0f,0x90,0x03,0xe6,0x08 }},
+ {16, 0xd1e0, 0, {0x79,0x00,0xb6,0x40,0x07,0x98,0x03,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd1f0, 0, {0x28,0x01,0x84,0x00,0xe9,0x02,0x3c,0x40,0x2f,0x98,0x02,0xe4,0x00,0xf9,0x42,0x3a }},
+ {16, 0xd200, 0, {0x68,0x0a,0x10,0x03,0xe4,0x10,0xe9,0x00,0x3e,0x40,0x0e,0x90,0x0f,0x26,0x00,0xf9 }},
+ {16, 0xd210, 0, {0x04,0x3e,0x40,0x0e,0x1c,0x03,0xe6,0x00,0xc1,0x00,0x3a,0x50,0x0f,0x99,0x83,0xca }},
+ {16, 0xd220, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xe8,0x00,0x3a,0x00 }},
+ {16, 0xd230, 0, {0x0c,0x84,0x03,0x20,0x00,0xd8,0x42,0x32,0x04,0x0c,0x88,0x13,0xe0,0x00,0xc8,0x00 }},
+ {16, 0xd240, 0, {0x30,0x00,0x0c,0x04,0x0b,0x00,0x00,0xd8,0x00,0x36,0x00,0x0e,0x80,0x23,0x00,0x00 }},
+ {16, 0xd250, 0, {0xc8,0x80,0x32,0x00,0x0c,0x80,0x01,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd260, 0, {0x28,0x05,0x28,0x10,0x8a,0x00,0x2e,0x80,0x28,0x20,0x22,0x28,0x00,0x8a,0x00,0x23 }},
+ {16, 0xd270, 0, {0xb0,0x88,0xe0,0x02,0x28,0x10,0xda,0x00,0xa3,0xb4,0x08,0xe8,0x10,0x28,0x00,0x8e }},
+ {16, 0xd280, 0, {0x20,0x23,0xa0,0x48,0xed,0x1a,0x28,0x00,0xde,0x00,0x23,0x90,0x0a,0xe0,0x02,0x0a }},
+ {16, 0xd290, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0xa3,0x00,0x28,0xc0 }},
+ {16, 0xd2a0, 0, {0x08,0x30,0x0a,0x0c,0x00,0x93,0x00,0x20,0xc2,0x2a,0x30,0x22,0xa4,0x00,0xbb,0x00 }},
+ {16, 0xd2b0, 0, {0x08,0xe0,0x18,0x09,0x0a,0x4c,0x00,0x93,0x02,0x24,0xe8,0x02,0x08,0x06,0x4c,0x00 }},
+ {16, 0xd2c0, 0, {0x93,0x00,0x20,0xd8,0x0a,0x90,0x02,0x4a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd2d0, 0, {0xa0,0x01,0x1c,0x80,0x87,0x04,0x2d,0xc0,0x08,0x70,0x02,0x0e,0x00,0x87,0x10,0x25 }},
+ {16, 0xd2e0, 0, {0x00,0x0a,0x60,0x02,0x5e,0x00,0x97,0x00,0x29,0x82,0x08,0x50,0x12,0x54,0x00,0x8f }},
+ {16, 0xd2f0, 0, {0x80,0x61,0xd0,0x08,0x04,0x02,0x5c,0x01,0xb7,0x08,0xa9,0xa0,0x0a,0x50,0x82,0x68 }},
+ {16, 0xd300, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x3e,0x80,0xe7,0x80,0x38,0xe4 }},
+ {16, 0xd310, 0, {0x08,0x7e,0x03,0x1f,0x00,0xdf,0x80,0xb1,0x21,0x1e,0x78,0x03,0xdc,0x04,0xf3,0x80 }},
+ {16, 0xd320, 0, {0x5b,0xe1,0x08,0x28,0x03,0x5e,0x00,0xd7,0x80,0x35,0x60,0x0e,0x68,0x03,0x4e,0x00 }},
+ {16, 0xd330, 0, {0xdf,0x80,0x31,0xe0,0x0e,0xf8,0x0b,0x6a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd340, 0, {0x08,0x1d,0xad,0x02,0xfb,0x74,0x3e,0xd0,0x4f,0xb2,0x83,0xed,0x00,0x7b,0x68,0x3a }},
+ {16, 0xd350, 0, {0x00,0x8d,0x80,0x03,0xa4,0x20,0xdb,0x01,0x36,0x80,0x6f,0xb0,0x41,0x84,0x00,0xeb }},
+ {16, 0xd360, 0, {0x00,0x3c,0xc0,0x0f,0xe6,0x83,0xbc,0x40,0xdb,0x00,0xb6,0x80,0x0f,0xb0,0x03,0x82 }},
+ {16, 0xd370, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xff,0x20,0xdf,0xc0,0x3b,0xe6 }},
+ {16, 0xd380, 0, {0x0e,0xf8,0x13,0xff,0x44,0xc7,0x82,0x3b,0xe0,0x0f,0xf9,0x03,0xbe,0x10,0xcf,0xc8 }},
+ {16, 0xd390, 0, {0x33,0x60,0x8d,0xeb,0x03,0x3e,0x00,0xdb,0x82,0x3f,0xe0,0x0c,0xd8,0x03,0x3e,0x40 }},
+ {16, 0xd3a0, 0, {0xce,0x80,0x33,0xe4,0x0f,0xf8,0x03,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd3b0, 0, {0xa8,0x11,0xbc,0x40,0x87,0x00,0x21,0xe4,0x0b,0x78,0xa2,0xce,0x90,0xc7,0xb0,0x20 }},
+ {16, 0xd3c0, 0, {0xe8,0x0b,0x28,0x92,0xb6,0x88,0x87,0xa0,0x20,0x64,0x0b,0x35,0x03,0x14,0x00,0x87 }},
+ {16, 0xd3d0, 0, {0xb2,0x39,0xc0,0x2c,0xc0,0x03,0x5e,0x02,0xcf,0x00,0x31,0xce,0x0b,0x76,0x12,0x2a }},
+ {16, 0xd3e0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x00,0xa3,0x10,0x29,0xc8 }},
+ {16, 0xd3f0, 0, {0x0b,0x74,0x02,0xdc,0x80,0x8f,0x00,0x29,0xcc,0x0a,0x30,0x06,0x14,0x80,0x87,0x10 }},
+ {16, 0xd400, 0, {0x21,0xc0,0x0b,0x66,0x02,0x5c,0x00,0x87,0x00,0x2d,0xc0,0x0b,0x51,0x02,0x1c,0x80 }},
+ {16, 0xd410, 0, {0x96,0x00,0x21,0xc0,0x5b,0x74,0x82,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd420, 0, {0x20,0x14,0xcc,0x08,0xa3,0x00,0x20,0xc0,0x0b,0xb8,0x02,0xcc,0x00,0x8b,0x40,0xa8 }},
+ {16, 0xd430, 0, {0xc0,0x8b,0x08,0x22,0x8c,0x02,0x83,0x00,0x60,0xc0,0x0b,0x30,0x42,0x04,0x00,0x83 }},
+ {16, 0xd440, 0, {0x40,0x28,0xfc,0x8a,0x00,0x02,0x6e,0x00,0x83,0x00,0xa0,0xd0,0x8b,0x38,0x02,0x08 }},
+ {16, 0xd450, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x11,0xbc,0x02,0xef,0x00,0x3b,0xc0 }},
+ {16, 0xd460, 0, {0x4f,0xf8,0x02,0xfc,0x02,0xcf,0x00,0x38,0x12,0x0e,0x98,0x02,0x2c,0x00,0xcf,0x00 }},
+ {16, 0xd470, 0, {0x32,0xc0,0x09,0x90,0x03,0x64,0x02,0x81,0xc0,0x3e,0xd0,0x0f,0x90,0x07,0x3c,0x03 }},
+ {16, 0xd480, 0, {0xd9,0x00,0x32,0x60,0x0f,0x88,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd490, 0, {0x80,0x00,0xcc,0x00,0xdb,0x00,0x3e,0xc0,0x8f,0xb0,0x03,0xec,0x00,0xfb,0x02,0x36 }},
+ {16, 0xd4a0, 0, {0xc0,0x4f,0x90,0x02,0xe4,0x00,0xfb,0x00,0xbe,0x90,0x0f,0x9c,0x13,0xec,0x00,0xe9 }},
+ {16, 0xd4b0, 0, {0x18,0x3a,0xd0,0x04,0xd5,0x03,0xec,0x40,0xe9,0x00,0x3a,0x00,0x8f,0x80,0x03,0xe0 }},
+ {16, 0xd4c0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x00,0xcf,0x00,0x3d,0xc1 }},
+ {16, 0xd4d0, 0, {0x8c,0xf0,0x03,0x2c,0x00,0xef,0x0a,0xb3,0x12,0x2c,0x70,0x23,0x14,0x0a,0x4f,0x00 }},
+ {16, 0xd4e0, 0, {0x35,0x60,0x0d,0xb0,0x03,0x04,0x00,0xcd,0x80,0x07,0xe8,0x0c,0xc4,0x03,0x2c,0x00 }},
+ {16, 0xd4f0, 0, {0xcd,0x00,0x31,0xe2,0x2c,0xe0,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd500, 0, {0x81,0x04,0x6c,0x02,0xab,0x02,0x2e,0xc0,0x0e,0xb0,0x02,0x2c,0x00,0x8b,0x00,0x32 }},
+ {16, 0xd510, 0, {0x30,0x00,0x9c,0x03,0x6c,0x00,0x8b,0x04,0x22,0x36,0x08,0x34,0x4a,0x2c,0x08,0x89 }},
+ {16, 0xd520, 0, {0x90,0x20,0xb8,0x0f,0x84,0x00,0xac,0x02,0x89,0x00,0x36,0xa0,0x08,0xa4,0x02,0x20 }},
+ {16, 0xd530, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0x8b,0x00,0x2e,0xc0 }},
+ {16, 0xd540, 0, {0x08,0xb0,0x02,0x0c,0x00,0x8b,0x00,0x22,0xd1,0x08,0x88,0x12,0x26,0x00,0xa3,0x00 }},
+ {16, 0xd550, 0, {0x26,0x40,0x0b,0xb0,0x02,0x26,0x00,0x8b,0x00,0x26,0xc0,0x58,0x10,0x12,0x2c,0x04 }},
+ {16, 0xd560, 0, {0x82,0x80,0x2a,0x49,0x08,0x30,0x02,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd570, 0, {0x08,0x04,0x0c,0x00,0xa3,0x14,0x2c,0xc8,0x1a,0x34,0x8a,0x0c,0x84,0x83,0x40,0x22 }},
+ {16, 0xd580, 0, {0xc8,0x08,0x03,0x62,0x4c,0xc0,0xa3,0x60,0x20,0x40,0x0a,0x30,0x02,0x0c,0x00,0x8b }},
+ {16, 0xd590, 0, {0x45,0x08,0xc0,0x0b,0x10,0x02,0x8c,0xa0,0x83,0x00,0x26,0x40,0x08,0x30,0x0a,0x02 }},
+ {16, 0xd5a0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x7c,0x00,0xcf,0x40,0x2f,0xd2 }},
+ {16, 0xd5b0, 0, {0x8c,0xf6,0x03,0x3c,0x22,0xcf,0x40,0x32,0xd6,0x4c,0xa6,0xc1,0x3d,0xa0,0x87,0x48 }},
+ {16, 0xd5c0, 0, {0x36,0x0d,0x0f,0xb1,0x02,0x24,0x42,0xcb,0x60,0x16,0xc0,0x0c,0xd0,0x03,0x2c,0x80 }},
+ {16, 0xd5d0, 0, {0xca,0x00,0x32,0xc0,0x0c,0x30,0x03,0x00,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd5e0, 0, {0xa0,0x19,0xfc,0x00,0xff,0x20,0x3e,0xca,0x0e,0xb0,0x03,0xec,0x20,0xdb,0x34,0x3a }},
+ {16, 0xd5f0, 0, {0xc8,0x0f,0x80,0x03,0xe4,0x10,0xdb,0x21,0x3e,0x18,0x0d,0xf2,0x03,0xfc,0x80,0xff }},
+ {16, 0xd600, 0, {0x30,0x35,0xc0,0x0f,0xc0,0x13,0xec,0x00,0xff,0x00,0x3b,0xc0,0x0f,0xf0,0x03,0xe8 }},
+ {16, 0xd610, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x11,0xfc,0x00,0xfb,0x0b,0x2f,0xca }},
+ {16, 0xd620, 0, {0x8d,0xf2,0x03,0xfa,0x00,0x96,0x80,0x3b,0xc4,0x0d,0xf1,0x03,0x7c,0x80,0xec,0x80 }},
+ {16, 0xd630, 0, {0x3b,0x08,0x0c,0xc2,0x03,0x74,0x02,0xcc,0x80,0x3f,0x48,0x0e,0xf0,0x03,0x30,0xa0 }},
+ {16, 0xd640, 0, {0xd5,0x80,0x3f,0x40,0x0c,0xf8,0x03,0xf0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd650, 0, {0x80,0x08,0xee,0x40,0xbf,0x80,0x2f,0xf0,0x0b,0xf7,0x22,0xee,0x20,0x8a,0x80,0x23 }},
+ {16, 0xd660, 0, {0xfc,0x88,0x75,0x12,0x3d,0x00,0x88,0x00,0x22,0x00,0x28,0x80,0x02,0x24,0x08,0x88 }},
+ {16, 0xd670, 0, {0x00,0x6f,0x50,0x00,0xf5,0x02,0x29,0x00,0x89,0x00,0x2e,0x54,0x0d,0x90,0x11,0xa0 }},
+ {16, 0xd680, 0, {0x04,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x00,0xb3,0x00,0x2c,0xc1 }},
+ {16, 0xd690, 0, {0x09,0x30,0x82,0xcc,0x82,0xbb,0x00,0x28,0xc0,0x49,0x32,0x02,0xcd,0x00,0xb8,0x00 }},
+ {16, 0xd6a0, 0, {0x2c,0x50,0x09,0x01,0x02,0x0c,0x40,0x80,0x00,0x6c,0x44,0x09,0x30,0x02,0x20,0x00 }},
+ {16, 0xd6b0, 0, {0xb0,0x00,0x2c,0x40,0x18,0x30,0x06,0xe2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd6c0, 0, {0xc0,0x01,0xac,0x00,0xbb,0x01,0x2e,0xc0,0x0b,0xb0,0x02,0xee,0x00,0xaa,0x00,0x4a }},
+ {16, 0xd6d0, 0, {0xc0,0x08,0xb0,0x52,0xec,0x00,0x98,0x02,0x26,0x40,0x09,0x80,0x02,0x6c,0x01,0xaa }},
+ {16, 0xd6e0, 0, {0x04,0x2e,0x40,0x09,0xb0,0x02,0x22,0x00,0xa9,0x80,0x2e,0x41,0x09,0x90,0x02,0xf0 }},
+ {16, 0xd6f0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xec,0x00,0xfb,0x00,0x3e,0xc0 }},
+ {16, 0xd700, 0, {0x0d,0xb0,0x03,0xce,0x84,0xfa,0x00,0x1a,0xc0,0x8d,0xb0,0x43,0xec,0x00,0xf0,0x02 }},
+ {16, 0xd710, 0, {0x3f,0x00,0x0d,0xd1,0x03,0x35,0x00,0xcb,0x48,0x2e,0x40,0x2f,0xb0,0x09,0x22,0x80 }},
+ {16, 0xd720, 0, {0xf9,0xc8,0x1e,0xe0,0x08,0xb1,0xe2,0xd0,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd730, 0, {0xe0,0x01,0xbc,0x00,0x7b,0x00,0x3f,0xc0,0x0f,0xf0,0x23,0xfc,0x00,0xde,0x00,0x24 }},
+ {16, 0xd740, 0, {0xc0,0x4f,0xf0,0x03,0x2c,0x00,0xec,0x20,0x3b,0x00,0x0e,0x98,0x03,0x94,0x02,0xdd }},
+ {16, 0xd750, 0, {0x00,0x3f,0x40,0x4e,0xf0,0x01,0xf8,0x00,0xdd,0x00,0x3c,0xe4,0x0f,0xd8,0x03,0xb8 }},
+ {16, 0xd760, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0xac,0xc0,0xfb,0x20,0x32,0xc8 }},
+ {16, 0xd770, 0, {0x8d,0xb0,0x03,0xec,0x00,0xf9,0x00,0x3a,0xc2,0x2c,0x30,0x03,0x6c,0x04,0xd8,0x02 }},
+ {16, 0xd780, 0, {0x3c,0x44,0x8d,0x10,0x03,0xad,0x03,0xea,0x00,0x3c,0x40,0x0c,0x70,0x23,0xe4,0x00 }},
+ {16, 0xd790, 0, {0xc8,0x40,0x3a,0xc0,0x0d,0xbc,0x03,0x50,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd7a0, 0, {0xc8,0x01,0x3d,0x00,0xbf,0x42,0x23,0xf0,0x0d,0xf0,0x02,0xe5,0x00,0xe2,0x01,0x37 }},
+ {16, 0xd7b0, 0, {0xf1,0x08,0xf0,0x0e,0x3d,0xc0,0xa8,0x00,0x2e,0x54,0x28,0x90,0x02,0x2c,0x00,0x8a }},
+ {16, 0xd7c0, 0, {0x05,0x3b,0x41,0x48,0xf5,0x03,0x8c,0x00,0x89,0x00,0x22,0xd4,0x0e,0x95,0x02,0xf2 }},
+ {16, 0xd7d0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x00,0xb3,0x04,0x20,0xc0 }},
+ {16, 0xd7e0, 0, {0x89,0x30,0x02,0xcc,0x40,0xb2,0x00,0x2c,0xc4,0x48,0x30,0x02,0x2c,0x02,0xa2,0x00 }},
+ {16, 0xd7f0, 0, {0x2c,0x20,0x19,0x20,0x1a,0x80,0x08,0xb0,0x00,0x6c,0x40,0x08,0x30,0x02,0xc4,0x00 }},
+ {16, 0xd800, 0, {0x81,0x00,0x2c,0x40,0x08,0x30,0x02,0xf8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd810, 0, {0x20,0x01,0x1e,0x00,0xb7,0xa0,0xe1,0xe0,0x09,0x78,0x02,0xdf,0x04,0xae,0x80,0x2d }},
+ {16, 0xd820, 0, {0xe0,0x08,0x79,0x02,0x1e,0x10,0x87,0x90,0x2c,0x28,0x29,0x68,0x02,0x82,0x81,0xb4 }},
+ {16, 0xd830, 0, {0x80,0x2d,0x60,0x08,0x78,0x10,0xbc,0x00,0x8f,0x80,0x2d,0x60,0x0b,0x68,0x02,0xc8 }},
+ {16, 0xd840, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x0c,0x05,0xf3,0x92,0x30,0xca }},
+ {16, 0xd850, 0, {0x0d,0x30,0x03,0xcc,0x00,0xf3,0x00,0x3c,0xc0,0x0c,0x30,0x02,0x0c,0x80,0x70,0x00 }},
+ {16, 0xd860, 0, {0x2c,0x40,0x0d,0x20,0x03,0x89,0x00,0xb1,0x00,0x3e,0x40,0x2c,0x30,0x03,0xec,0x50 }},
+ {16, 0xd870, 0, {0xc3,0x20,0x3c,0x40,0x0c,0x30,0x03,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd880, 0, {0x40,0x1d,0xbc,0x00,0xff,0x00,0x3c,0xc0,0x0e,0xb0,0x83,0xec,0x40,0xea,0x00,0x36 }},
+ {16, 0xd890, 0, {0xc2,0x0f,0xb0,0x83,0xac,0x00,0xf8,0x00,0x3e,0x48,0x0e,0xe0,0x0b,0x7a,0x80,0xcf }},
+ {16, 0xd8a0, 0, {0x00,0x3b,0x44,0x0f,0xf0,0x03,0xec,0xc0,0xff,0x00,0x03,0x44,0x0e,0xe0,0x03,0xd0 }},
+ {16, 0xd8b0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x00,0xfb,0x23,0x3e,0xc8 }},
+ {16, 0xd8c0, 0, {0x1d,0xb0,0x03,0xee,0x00,0xca,0x00,0x3e,0xc8,0x0c,0xb2,0x03,0x2d,0x90,0xc8,0x84 }},
+ {16, 0xd8d0, 0, {0x36,0x00,0x2d,0xb0,0x03,0x60,0x18,0x9b,0x80,0x33,0x50,0x0c,0xf2,0x03,0xe2,0x00 }},
+ {16, 0xd8e0, 0, {0xc9,0x80,0x32,0x40,0x0c,0xb8,0x03,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd8f0, 0, {0x48,0x11,0x9c,0x00,0xb7,0x28,0x0c,0xd2,0x28,0x73,0x02,0xfc,0x00,0x86,0x04,0x2c }},
+ {16, 0xd900, 0, {0xcc,0x28,0x70,0x83,0x0c,0x20,0x95,0x01,0x20,0x00,0x09,0x30,0x12,0x10,0x04,0x85 }},
+ {16, 0xd910, 0, {0x00,0x21,0x52,0x08,0x75,0x02,0xd8,0x00,0x87,0x00,0x21,0x40,0x08,0x60,0x02,0x12 }},
+ {16, 0xd920, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0xd4,0xb7,0xb1,0x09,0xe1 }},
+ {16, 0xd930, 0, {0x08,0x78,0x22,0xde,0x00,0x95,0x80,0x2d,0xe0,0x08,0x78,0x0a,0x5e,0x42,0x94,0xc0 }},
+ {16, 0xd940, 0, {0x21,0x60,0x08,0x78,0x02,0x5a,0x00,0x87,0x80,0x2d,0x68,0x08,0x7a,0x02,0xd7,0x00 }},
+ {16, 0xd950, 0, {0x97,0x80,0x20,0x60,0x09,0x78,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd960, 0, {0x48,0x10,0xcc,0x00,0xb3,0x00,0x2c,0xc0,0x08,0xb0,0x02,0xcd,0x80,0x92,0x00,0x2c }},
+ {16, 0xd970, 0, {0xc0,0x08,0xb0,0x02,0xcc,0x00,0x90,0x80,0xa0,0x40,0x09,0x36,0x02,0x48,0x02,0x83 }},
+ {16, 0xd980, 0, {0xa0,0xac,0x40,0x2a,0x30,0x06,0xce,0x02,0x93,0x04,0xa0,0x40,0x09,0x20,0x0a,0x12 }},
+ {16, 0xd990, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x00,0xfa,0x00,0x3a,0x80 }},
+ {16, 0xd9a0, 0, {0x0d,0xa0,0x03,0xfb,0x02,0xde,0x80,0x3e,0x80,0x0c,0xa0,0x03,0x28,0x00,0xce,0x80 }},
+ {16, 0xd9b0, 0, {0x32,0x80,0x0c,0xa4,0x03,0x78,0x00,0xce,0xa4,0x3f,0x80,0x0c,0xa0,0x07,0xf9,0x00 }},
+ {16, 0xd9c0, 0, {0xde,0x00,0x32,0x80,0x2d,0xe0,0x02,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd9d0, 0, {0x48,0x00,0xe1,0x00,0xf8,0x00,0x7c,0x00,0x0f,0x80,0x03,0xe0,0x40,0xe8,0x10,0x3c }},
+ {16, 0xd9e0, 0, {0x01,0xcf,0x80,0x0f,0x20,0x00,0xe8,0x00,0x3e,0x00,0x0e,0x04,0x03,0x90,0x00,0xe8 }},
+ {16, 0xd9f0, 0, {0x00,0x20,0x00,0x0d,0x80,0x07,0xe0,0x00,0xe8,0x00,0x3e,0x04,0x0e,0x80,0x03,0xd2 }},
+ {16, 0xda00, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xf9,0x10,0x7e,0x41 }},
+ {16, 0xda10, 0, {0x0e,0x90,0x03,0x24,0x00,0xf9,0x00,0x36,0x68,0x0e,0x90,0x0f,0xa4,0x08,0xc9,0x00 }},
+ {16, 0xda20, 0, {0x3a,0x40,0x0c,0x90,0x0b,0x24,0x12,0xe9,0x00,0x3e,0x44,0x2c,0x90,0x03,0x64,0x24 }},
+ {16, 0xda30, 0, {0xf9,0x02,0x2e,0x40,0x0c,0x90,0x03,0xc2,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xda40, 0, {0x80,0x04,0x65,0x10,0xb9,0x80,0x3e,0x40,0x08,0x90,0x0a,0x26,0x00,0xb1,0x10,0x2a }},
+ {16, 0xda50, 0, {0x72,0x08,0x90,0x07,0x64,0x02,0x89,0x40,0x2e,0x40,0x28,0x90,0x12,0x25,0x00,0x89 }},
+ {16, 0xda60, 0, {0x45,0x3e,0x50,0x0d,0x90,0x0a,0x25,0x00,0xb9,0x40,0x2e,0x40,0x28,0x94,0x03,0xe0 }},
+ {16, 0xda70, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0xb9,0x00,0x2e,0x40 }},
+ {16, 0xda80, 0, {0x48,0x90,0x42,0x26,0x01,0xb9,0x40,0x26,0x40,0x0a,0x90,0x42,0x84,0x01,0x8b,0x08 }},
+ {16, 0xda90, 0, {0x2c,0x40,0x09,0xd0,0x82,0x34,0x32,0xa9,0x08,0x6e,0x42,0x08,0x10,0x02,0x24,0x20 }},
+ {16, 0xdaa0, 0, {0xb9,0x08,0x2c,0x40,0x18,0x90,0x82,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdab0, 0, {0x08,0x04,0x04,0x80,0xb3,0x20,0x28,0x48,0x08,0x12,0x02,0x04,0x01,0xb1,0x00,0x28 }},
+ {16, 0xdac0, 0, {0x58,0x08,0x12,0x02,0x05,0x89,0x81,0x40,0x2c,0x58,0x08,0x56,0x06,0x15,0x80,0x81 }},
+ {16, 0xdad0, 0, {0x40,0x28,0x50,0x09,0x14,0x02,0x05,0x80,0xb1,0x40,0x2c,0x5a,0x08,0x14,0x02,0xc2 }},
+ {16, 0xdae0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x68,0x00,0xf8,0x00,0x2e,0x00 }},
+ {16, 0xdaf0, 0, {0x2e,0x85,0x03,0x21,0x48,0xf8,0x00,0x36,0x00,0x8e,0x05,0x02,0xa0,0x08,0x80,0x00 }},
+ {16, 0xdb00, 0, {0x3e,0x00,0x0d,0x80,0x0b,0x10,0x04,0xe0,0x00,0x2c,0x00,0x4c,0x80,0x03,0x40,0x00 }},
+ {16, 0xdb10, 0, {0xf0,0x00,0x3e,0x08,0x0c,0x00,0x03,0xee,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdb20, 0, {0x98,0x1d,0xe4,0x40,0xf9,0x10,0x3e,0x44,0x0f,0x91,0x03,0xf4,0x00,0xfd,0x00,0x3e }},
+ {16, 0xdb30, 0, {0x44,0x0f,0x91,0x03,0xe4,0x40,0xfd,0x03,0x3f,0x44,0x1f,0x91,0x1b,0xe4,0x40,0xfd }},
+ {16, 0xdb40, 0, {0x01,0x3f,0x50,0x0e,0x94,0x03,0xf4,0x40,0xfd,0x00,0x3f,0x40,0x0f,0xd0,0x03,0xa6 }},
+ {16, 0xdb50, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x15,0xf4,0x00,0xcd,0xa0,0x71,0x68 }},
+ {16, 0xdb60, 0, {0x8d,0x98,0x03,0xd4,0x00,0xcd,0x00,0x33,0x60,0x0c,0x98,0x8f,0x27,0x20,0xc9,0x40 }},
+ {16, 0xdb70, 0, {0x3e,0x78,0x0c,0x9e,0x8b,0x27,0x20,0xd1,0x11,0x30,0x60,0x8c,0x9c,0x03,0x25,0x00 }},
+ {16, 0xdb80, 0, {0xf9,0x40,0x3e,0x78,0x0f,0x90,0x03,0x46,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdb90, 0, {0x38,0x10,0xe0,0x10,0x88,0x01,0x22,0x01,0x08,0x8c,0x22,0xe8,0x00,0x88,0x02,0x2a }},
+ {16, 0xdba0, 0, {0x14,0x08,0x8c,0x0b,0x23,0x90,0x88,0xa0,0x2e,0xb0,0x08,0x8c,0x42,0x23,0x00,0x88 }},
+ {16, 0xdbb0, 0, {0xa0,0x36,0x2a,0x18,0x8a,0x02,0x22,0x00,0xb8,0xa0,0x2e,0x34,0x0b,0xca,0x82,0x0e }},
+ {16, 0xdbc0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x00,0x81,0x40,0x24,0x50 }},
+ {16, 0xdbd0, 0, {0x09,0x16,0x82,0xc4,0x00,0xa9,0x00,0x20,0x40,0x08,0x12,0x92,0x54,0x08,0x85,0x00 }},
+ {16, 0xdbe0, 0, {0x2f,0x4c,0x09,0x52,0x12,0x14,0x80,0x9d,0x00,0x21,0x50,0x08,0x54,0x22,0x14,0x80 }},
+ {16, 0xdbf0, 0, {0xb5,0x00,0x2d,0x48,0x0b,0xd0,0x02,0x42,0x05,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdc00, 0, {0x18,0x05,0xa4,0x02,0x89,0x01,0xa2,0x40,0x48,0x90,0x02,0xe4,0x02,0xa9,0x00,0x2a }},
+ {16, 0xdc10, 0, {0x40,0x68,0x90,0x02,0x64,0x10,0xad,0x00,0x2f,0x41,0x28,0x50,0x02,0x34,0x00,0x8d }},
+ {16, 0xdc20, 0, {0x44,0x27,0x40,0x39,0xd0,0x02,0x35,0x00,0xbd,0x14,0x2f,0x40,0x0b,0xd0,0x02,0x46 }},
+ {16, 0xdc30, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x05,0xc4,0x00,0xc9,0x00,0x36,0x40 }},
+ {16, 0xdc40, 0, {0x2d,0x90,0x03,0xe7,0x00,0xe1,0xe0,0x32,0x40,0x0c,0x90,0x0b,0x64,0x02,0xc9,0x08 }},
+ {16, 0xdc50, 0, {0x3c,0x50,0x0c,0x90,0x02,0x26,0x02,0xd9,0xc0,0x32,0x40,0x0c,0x90,0x13,0x27,0x00 }},
+ {16, 0xdc60, 0, {0xf9,0x20,0x3e,0x40,0x0f,0x90,0x03,0x68,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdc70, 0, {0x28,0x01,0xa4,0x02,0xf9,0x00,0x38,0x40,0x0f,0x90,0x03,0xe6,0x80,0xd9,0xa0,0x3c }},
+ {16, 0xdc80, 0, {0x40,0x0f,0x10,0x03,0xa4,0x00,0xd9,0x10,0x3e,0x40,0x0f,0x90,0x03,0xc4,0x92,0xf9 }},
+ {16, 0xdc90, 0, {0x21,0x3c,0x40,0x2e,0x90,0x0f,0xe6,0x80,0xf9,0x80,0x3e,0x40,0x0f,0x90,0x03,0x8a }},
+ {16, 0xdca0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x00,0xa0,0x40,0xe8,0x10,0x3e,0x04 }},
+ {16, 0xdcb0, 0, {0x4e,0x80,0x03,0x20,0x80,0xd8,0x60,0x3a,0x02,0x0c,0x80,0x13,0x20,0x00,0xf8,0x40 }},
+ {16, 0xdcc0, 0, {0x36,0x10,0x2d,0x80,0x03,0xa0,0x08,0xe8,0x40,0x32,0x00,0x0d,0x00,0x03,0x21,0x02 }},
+ {16, 0xdcd0, 0, {0xc8,0x40,0xb2,0x00,0x0f,0xc0,0x03,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdce0, 0, {0x28,0x11,0x3b,0x10,0x86,0x01,0x2f,0xa0,0x0d,0xa0,0x02,0x38,0x00,0x8e,0xe0,0x23 }},
+ {16, 0xdcf0, 0, {0xa2,0x08,0xa0,0x02,0x28,0x00,0xba,0x80,0x22,0x80,0x08,0xa0,0x02,0x28,0x00,0x82 }},
+ {16, 0xdd00, 0, {0x00,0x2a,0x80,0x28,0xa0,0x02,0x2a,0x04,0x8a,0x80,0x22,0xa0,0x0b,0x60,0x02,0xca }},
+ {16, 0xdd10, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x43,0x80,0xa2,0x00,0x2c,0xa0 }},
+ {16, 0xdd20, 0, {0x08,0x30,0x02,0x2e,0x00,0x92,0x00,0x28,0xc0,0x28,0x30,0x02,0x2c,0x00,0xb3,0x80 }},
+ {16, 0xdd30, 0, {0x24,0xc0,0x09,0x30,0x0a,0x8c,0x00,0xa3,0x00,0x60,0xc0,0x08,0x30,0x0a,0x4c,0x00 }},
+ {16, 0xdd40, 0, {0x83,0x00,0x20,0xe0,0x0b,0x20,0x02,0xca,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdd50, 0, {0xa0,0x01,0x10,0x00,0x86,0x00,0x2d,0xc0,0x09,0x3a,0x02,0x35,0x00,0x86,0x00,0x21 }},
+ {16, 0xdd60, 0, {0xc0,0x08,0x73,0x02,0x10,0x00,0xbf,0x88,0x21,0x00,0x08,0x70,0x02,0x1c,0x08,0x8f }},
+ {16, 0xdd70, 0, {0x00,0x2b,0xc0,0x08,0x20,0x12,0x5e,0x20,0x87,0x88,0x21,0x83,0x0b,0x60,0x02,0xe8 }},
+ {16, 0xdd80, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x12,0x00,0xe5,0x81,0x3d,0xa0 }},
+ {16, 0xdd90, 0, {0x2c,0x7a,0x0b,0x1e,0x00,0xd4,0x80,0x38,0xe0,0x0c,0xfa,0x0b,0x1e,0x00,0xf6,0x80 }},
+ {16, 0xdda0, 0, {0x34,0xe0,0x0d,0x28,0x03,0x8a,0x00,0xe6,0x80,0x31,0x20,0x0c,0x78,0x03,0x7a,0x04 }},
+ {16, 0xddb0, 0, {0xce,0x84,0x31,0xe0,0x4f,0x78,0x43,0xea,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xddc0, 0, {0x08,0x0d,0x80,0x00,0xf8,0x00,0x3e,0xc0,0x0f,0xb5,0x23,0xe4,0x00,0xf0,0x04,0x36 }},
+ {16, 0xddd0, 0, {0x40,0x0f,0xb6,0x87,0xe0,0x00,0xf2,0x00,0x3e,0x00,0x1f,0xa0,0x0b,0xe8,0x00,0xfa }},
+ {16, 0xdde0, 0, {0x00,0x3e,0x00,0x0e,0xa0,0x03,0xa8,0x00,0xfa,0x00,0x3e,0x80,0x0f,0xb0,0x03,0xc2 }},
+ {16, 0xddf0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xf6,0x00,0xcc,0x80,0x33,0xa0 }},
+ {16, 0xde00, 0, {0x0c,0xfc,0x03,0x3e,0x00,0xfc,0x80,0x37,0xe0,0x0f,0xb9,0x21,0x3e,0x00,0xfd,0x82 }},
+ {16, 0xde10, 0, {0x33,0xe0,0x2c,0xf8,0x03,0x7e,0x10,0xdf,0x84,0x3d,0xe0,0x0c,0xf8,0x03,0xf6,0x00 }},
+ {16, 0xde20, 0, {0xfd,0x80,0x3f,0x60,0x0c,0xe8,0x23,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xde30, 0, {0xa8,0x11,0x98,0x40,0x84,0x10,0x21,0xc0,0x08,0x70,0x02,0x10,0x80,0xb4,0x00,0x21 }},
+ {16, 0xde40, 0, {0xc8,0x0b,0x7a,0x02,0x10,0x00,0xfd,0x00,0x21,0x04,0x08,0x70,0x02,0x1c,0x42,0x87 }},
+ {16, 0xde50, 0, {0x00,0x2d,0xc4,0x48,0x61,0x02,0xd6,0x80,0xb5,0x00,0x2f,0x04,0x08,0x61,0x82,0x2a }},
+ {16, 0xde60, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x00,0x81,0x00,0x21,0x80 }},
+ {16, 0xde70, 0, {0x08,0x30,0x02,0x1c,0x10,0xbc,0x08,0x25,0x80,0x4b,0x30,0x0e,0x1c,0x00,0xb4,0x00 }},
+ {16, 0xde80, 0, {0x20,0xc0,0x08,0x20,0x02,0x58,0x00,0x96,0x00,0x2f,0x00,0x0a,0x70,0x02,0xd0,0x80 }},
+ {16, 0xde90, 0, {0xb4,0x18,0x2d,0x40,0x09,0xf8,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdea0, 0, {0x20,0x14,0xc8,0x02,0x80,0x00,0xa0,0xc0,0x08,0x30,0x22,0x0b,0xc0,0xb0,0xc0,0x22 }},
+ {16, 0xdeb0, 0, {0x80,0x0b,0x30,0x02,0x00,0x00,0xa0,0x04,0x22,0x00,0x28,0xa0,0x02,0x2b,0x00,0x8a }},
+ {16, 0xdec0, 0, {0x00,0x2c,0x00,0x08,0xa0,0x06,0xc0,0x00,0xb0,0xc2,0x2c,0x00,0x09,0xbc,0x1a,0x08 }},
+ {16, 0xded0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xa0,0x00,0xc8,0x00,0x32,0xc0 }},
+ {16, 0xdee0, 0, {0x0c,0xf0,0x0b,0x26,0x00,0xf9,0xc0,0x36,0x00,0x0f,0xf0,0x13,0x2c,0x10,0xbb,0x40 }},
+ {16, 0xdef0, 0, {0xf2,0xc0,0x08,0x90,0x03,0x67,0x00,0xd9,0x80,0x3e,0xc0,0x08,0x90,0x02,0xec,0x00 }},
+ {16, 0xdf00, 0, {0xfb,0xd0,0x3e,0xc0,0x29,0x8c,0x00,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdf10, 0, {0x80,0x00,0xe0,0x00,0xf8,0x44,0x3c,0xd0,0x2f,0xb0,0x03,0xe4,0x00,0xf9,0x20,0x3e }},
+ {16, 0xdf20, 0, {0x40,0x0f,0x30,0x03,0xe0,0x00,0xfb,0x08,0x3e,0x00,0x0f,0x90,0x13,0xe4,0x42,0xf9 }},
+ {16, 0xdf30, 0, {0x10,0x3e,0xc0,0x0f,0x80,0x03,0xee,0x00,0xfb,0x00,0x3e,0x80,0x0e,0x82,0x03,0xe0 }},
+ {16, 0xdf40, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xe0,0x08,0xfc,0x80,0x32,0xe4 }},
+ {16, 0xdf50, 0, {0x0e,0xf0,0x03,0x74,0x00,0xfc,0x00,0x3f,0x40,0x0c,0xf0,0x0b,0x3c,0x00,0xfe,0x00 }},
+ {16, 0xdf60, 0, {0x3f,0xc0,0x0d,0xc1,0x03,0x20,0x20,0xcc,0x10,0x33,0x00,0x0c,0xd1,0x03,0x58,0x00 }},
+ {16, 0xdf70, 0, {0xce,0x00,0x2f,0xc0,0x0f,0xd1,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdf80, 0, {0x81,0x44,0x62,0x00,0xb0,0x40,0x2a,0xf1,0x08,0xb0,0x12,0x26,0x08,0xb8,0xc8,0x2e }},
+ {16, 0xdf90, 0, {0x70,0x0a,0xb0,0x02,0x20,0x00,0xba,0x00,0x2e,0x00,0x28,0x80,0x03,0x22,0x40,0x88 }},
+ {16, 0xdfa0, 0, {0x01,0x20,0x00,0x0a,0x80,0x02,0x28,0x00,0x8a,0x01,0x2e,0x80,0x8b,0x90,0x02,0x20 }},
+ {16, 0xdfb0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x26,0x00,0xb8,0x28,0x22,0x42 }},
+ {16, 0xdfc0, 0, {0x08,0x30,0x02,0x66,0x00,0xb8,0x80,0x2e,0x30,0x88,0xb0,0x02,0x2c,0x00,0xb9,0x01 }},
+ {16, 0xdfd0, 0, {0x2e,0xc0,0x88,0x90,0x02,0xa4,0x00,0x89,0x00,0x22,0xc0,0x08,0x90,0x02,0x24,0x0c }},
+ {16, 0xdfe0, 0, {0x89,0x01,0x2e,0x40,0x1b,0x80,0x02,0x60,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdff0, 0, {0x08,0x04,0x00,0x00,0xb0,0x00,0x28,0xc0,0x28,0x30,0x02,0x00,0x00,0xb0,0x00,0x2c }},
+ {16, 0xe000, 0, {0x40,0x0a,0x30,0x02,0x00,0x00,0xb1,0x00,0x2c,0x00,0x08,0x10,0x0a,0x04,0x00,0x81 }},
+ {16, 0xe010, 0, {0x01,0xa2,0xc0,0x08,0x00,0x0a,0x04,0x80,0x81,0x00,0x2c,0x00,0x1b,0x00,0x0a,0x02 }},
+ {16, 0xe020, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x60,0x00,0xf8,0x00,0x32,0x40 }},
+ {16, 0xe030, 0, {0x0e,0xf0,0x23,0x64,0x08,0xf8,0x00,0x2e,0x00,0x0c,0xf0,0x03,0x2c,0x00,0xf8,0x00 }},
+ {16, 0xe040, 0, {0x3e,0xc0,0x0c,0x80,0x03,0x20,0x02,0xc8,0x04,0x32,0x00,0x1c,0x90,0x03,0x20,0x00 }},
+ {16, 0xe050, 0, {0xc8,0x01,0x3e,0x41,0x9f,0x90,0x43,0x40,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe060, 0, {0xa0,0x1d,0xf0,0x00,0xfc,0x0c,0x3f,0xc0,0x0f,0xf0,0x03,0xf0,0x10,0xf4,0x00,0x3f }},
+ {16, 0xe070, 0, {0x00,0x0f,0xf4,0x23,0xf0,0x00,0xfc,0x00,0x3f,0x00,0x0e,0xc0,0x03,0xb0,0x00,0xfc }},
+ {16, 0xe080, 0, {0x00,0x3f,0x00,0x0f,0xc0,0x03,0xe1,0x00,0xfc,0x00,0x3f,0x01,0x1f,0x50,0x03,0xe8 }},
+ {16, 0xe090, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x0d,0xf0,0xd0,0xff,0x20,0x3e,0xd0 }},
+ {16, 0xe0a0, 0, {0x8e,0xb0,0x03,0xec,0xa0,0xdb,0x28,0x3e,0xcc,0x0c,0xb3,0x03,0xad,0x08,0xf8,0x3c }},
+ {16, 0xe0b0, 0, {0x32,0x23,0x0e,0x48,0x23,0x7a,0x00,0xfd,0x94,0x3f,0xe0,0x0f,0x78,0x33,0xee,0x08 }},
+ {16, 0xe0c0, 0, {0xbf,0x80,0x3f,0xe4,0x0f,0xf9,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe0d0, 0, {0xa0,0x00,0xec,0xc8,0xbf,0xd1,0x0f,0xc8,0x0c,0x26,0x82,0xfd,0x24,0x8f,0x00,0x2e }},
+ {16, 0xe0e0, 0, {0x99,0x0a,0xf2,0x62,0x1d,0xd0,0x99,0x61,0x22,0x71,0x88,0x88,0x02,0xac,0x00,0xb8 }},
+ {16, 0xe0f0, 0, {0x22,0x2e,0x20,0x4b,0x88,0x03,0xa0,0x00,0x80,0x00,0x2e,0x08,0x0b,0x80,0x23,0x60 }},
+ {16, 0xe100, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x04,0xb3,0x03,0x0c,0xcc }},
+ {16, 0xe110, 0, {0x0a,0x13,0x12,0xcc,0x14,0xa3,0x0e,0x0c,0x58,0x0a,0x33,0x02,0x8c,0x10,0xa3,0x20 }},
+ {16, 0xe120, 0, {0xa0,0x0a,0x18,0x90,0x02,0x48,0xa0,0xb0,0x20,0x24,0x80,0x0a,0x20,0x02,0xcc,0x09 }},
+ {16, 0xe130, 0, {0xa1,0x00,0x2c,0x80,0x0b,0x32,0x42,0xa2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe140, 0, {0xe0,0x11,0xac,0x20,0xbb,0x00,0x2e,0xc0,0x4b,0x80,0xa2,0xec,0x00,0xab,0x00,0x4e }},
+ {16, 0xe150, 0, {0x46,0x2a,0xb0,0x02,0x2c,0x04,0x9b,0x80,0x2a,0x60,0x8a,0x9c,0x02,0xac,0x00,0xb9 }},
+ {16, 0xe160, 0, {0x81,0x2e,0x40,0x0b,0x98,0x02,0xa3,0x00,0x8a,0x00,0x2e,0x40,0x0b,0x80,0x04,0xf0 }},
+ {16, 0xe170, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xe1,0x00,0xfb,0x04,0x3e,0xc0 }},
+ {16, 0xe180, 0, {0x0e,0xb4,0x03,0xec,0x0a,0xdb,0x02,0x2e,0xd1,0x0e,0xb0,0x03,0xac,0x00,0xfb,0x82 }},
+ {16, 0xe190, 0, {0x32,0x28,0x1e,0x0c,0x03,0x68,0x00,0xb9,0x00,0x3e,0x40,0x4f,0xb0,0x43,0xed,0x00 }},
+ {16, 0xe1a0, 0, {0xea,0x00,0x3e,0x40,0x0f,0x80,0x03,0x90,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe1b0, 0, {0xc0,0x01,0xb8,0x18,0xff,0x02,0x1f,0xc0,0x0c,0xe2,0x03,0xfc,0x00,0xdf,0x03,0x2f }},
+ {16, 0xe1c0, 0, {0xa1,0x0f,0x70,0x03,0xfc,0x04,0xab,0x04,0x37,0x42,0x2d,0xd0,0x02,0x7c,0x00,0xfc }},
+ {16, 0xe1d0, 0, {0x00,0x3f,0x80,0x0f,0xc0,0x03,0xb0,0x00,0xfd,0x00,0x3f,0x80,0x0f,0xf0,0x03,0x78 }},
+ {16, 0xe1e0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xa9,0x00,0xdb,0x00,0x3c,0xc0 }},
+ {16, 0xe1f0, 0, {0x2e,0x94,0x01,0x6c,0x11,0xcb,0x00,0xb8,0xc0,0x0c,0xb0,0x03,0x6c,0x00,0xeb,0x01 }},
+ {16, 0xe200, 0, {0x32,0x10,0x07,0x92,0x03,0xa8,0x00,0xf8,0x00,0x3e,0x0c,0x07,0xa2,0x03,0xad,0x00 }},
+ {16, 0xe210, 0, {0xd8,0x00,0x32,0x00,0x0c,0x80,0x03,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe220, 0, {0xc8,0x05,0x28,0x08,0xbf,0x00,0x2f,0xc0,0x88,0x80,0x02,0x3c,0x08,0xef,0x03,0x22 }},
+ {16, 0xe230, 0, {0x00,0x0d,0xf5,0x00,0x3c,0x00,0x8b,0x82,0x22,0x60,0x03,0x9c,0x02,0x2c,0x10,0xb9 }},
+ {16, 0xe240, 0, {0xb0,0x22,0xf0,0x0b,0x90,0x02,0x20,0x00,0xbb,0x00,0x22,0xe2,0x0d,0xb0,0x02,0xf2 }},
+ {16, 0xe250, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x40,0x00,0xb3,0x02,0x2c,0xc0 }},
+ {16, 0xe260, 0, {0x08,0x30,0x02,0x6c,0x00,0x83,0x00,0x20,0xc0,0x09,0x34,0x04,0xec,0x00,0xa8,0x00 }},
+ {16, 0xe270, 0, {0x22,0xf0,0x0b,0x00,0x02,0x88,0x00,0xb3,0x00,0x28,0xe0,0x0b,0x14,0x02,0xa0,0x00 }},
+ {16, 0xe280, 0, {0x93,0x00,0x20,0xc0,0x08,0xb0,0x02,0xf8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe290, 0, {0x20,0x01,0x1e,0x04,0xb7,0x80,0x2d,0xe8,0x08,0x78,0x02,0x0e,0xc8,0xa7,0x90,0x21 }},
+ {16, 0xe2a0, 0, {0xa8,0x19,0x38,0x52,0x9e,0xc1,0x87,0x80,0x21,0xe2,0x0b,0xd9,0x82,0x9e,0x00,0xb6 }},
+ {16, 0xe2b0, 0, {0xa0,0x2d,0x20,0x0b,0x68,0x02,0x1e,0x00,0xb4,0xc1,0x21,0x20,0x09,0x48,0x02,0xc8 }},
+ {16, 0xe2c0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x0c,0x80,0xb3,0x10,0x3e,0xe0 }},
+ {16, 0xe2d0, 0, {0x0e,0x3a,0x07,0x4e,0x00,0xcb,0x90,0x3a,0x61,0x0d,0x38,0x03,0xce,0xd1,0xe1,0x98 }},
+ {16, 0xe2e0, 0, {0x30,0xa4,0x8f,0x10,0x03,0x88,0x00,0xba,0xa1,0x3c,0x84,0x07,0x00,0x03,0x82,0xd4 }},
+ {16, 0xe2f0, 0, {0xd1,0x00,0x72,0x80,0x0c,0x30,0x03,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe300, 0, {0x40,0x15,0xbc,0x04,0xff,0x00,0x3f,0xc0,0x0f,0xc2,0x23,0xec,0xb0,0xff,0x00,0x32 }},
+ {16, 0xe310, 0, {0x04,0x06,0xb4,0x23,0x7c,0x10,0xbf,0x00,0x3e,0x84,0x0f,0xb0,0x03,0x7c,0x40,0xff }},
+ {16, 0xe320, 0, {0x00,0x33,0x40,0x0f,0xf0,0x03,0xfc,0x00,0xfe,0x00,0xbf,0x40,0x0f,0xc8,0x03,0xd0 }},
+ {16, 0xe330, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xe4,0x00,0xcb,0x33,0x3e,0xc8 }},
+ {16, 0xe340, 0, {0x4c,0xb0,0x03,0xac,0x90,0xdb,0xa0,0x36,0xc0,0x0e,0xba,0x43,0x6c,0x00,0xc9,0x00 }},
+ {16, 0xe350, 0, {0x3e,0x40,0x0f,0x00,0x0f,0x28,0x00,0xfb,0x00,0x3e,0x40,0x0f,0x18,0x43,0x60,0x00 }},
+ {16, 0xe360, 0, {0xfa,0x00,0x3e,0x40,0x4f,0x08,0x0b,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe370, 0, {0x48,0x11,0x9c,0x10,0x07,0x08,0x2c,0xca,0x08,0x20,0x02,0x1c,0x20,0x87,0x28,0x3f }},
+ {16, 0xe380, 0, {0x80,0x8a,0xf0,0x02,0x1d,0x40,0x87,0x04,0x2d,0xc0,0x0b,0x70,0x02,0x1c,0x00,0xb6 }},
+ {16, 0xe390, 0, {0x00,0x2d,0x80,0x0b,0x60,0x03,0x1c,0x00,0xb5,0x00,0x2d,0x80,0x0b,0x70,0x02,0x12 }},
+ {16, 0xe3a0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x8e,0x00,0x87,0xa0,0x2d,0xe4 }},
+ {16, 0xe3b0, 0, {0x0a,0x58,0x02,0x1e,0x01,0x83,0x90,0x21,0x70,0x0b,0x79,0x02,0x9e,0x01,0x85,0xc0 }},
+ {16, 0xe3c0, 0, {0x2d,0xe0,0x4b,0x58,0x12,0x1a,0x00,0xb6,0x80,0x2d,0x20,0x0b,0x48,0x02,0x52,0x00 }},
+ {16, 0xe3d0, 0, {0xb4,0x80,0x2d,0x20,0x0b,0x48,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe3e0, 0, {0x48,0x14,0xec,0x00,0x83,0x00,0x2c,0xc0,0x88,0x36,0x02,0x0c,0x02,0x83,0x00,0x6c }},
+ {16, 0xe3f0, 0, {0xc0,0x0b,0x30,0x0a,0xac,0x00,0x9b,0xe0,0x6c,0xc8,0x0b,0x32,0x02,0x0c,0x01,0xb3 }},
+ {16, 0xe400, 0, {0x00,0x2c,0xc0,0x0b,0x30,0x02,0x0c,0x10,0xb3,0x40,0x2c,0xc0,0x0b,0x3c,0x82,0x12 }},
+ {16, 0xe410, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xb8,0x02,0xca,0x00,0x3e,0x80 }},
+ {16, 0xe420, 0, {0x0e,0xe4,0x8b,0x28,0x00,0xca,0x00,0x33,0x95,0x0f,0xa0,0x07,0xa8,0x02,0xce,0x40 }},
+ {16, 0xe430, 0, {0x3f,0xb0,0x0f,0xe4,0x82,0x28,0x00,0xfa,0x00,0x3e,0x80,0x0f,0xa0,0x23,0x68,0x00 }},
+ {16, 0xe440, 0, {0xfa,0x40,0x3e,0x81,0x4f,0xa4,0xe3,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe450, 0, {0x48,0x00,0xe0,0x80,0xf0,0x00,0x3c,0x00,0x2f,0x00,0x02,0x60,0x00,0xe8,0x00,0x3c }},
+ {16, 0xe460, 0, {0x00,0x0e,0x80,0x01,0x20,0x00,0xe8,0x04,0x5e,0x04,0x0f,0x80,0x03,0xe0,0x00,0xfc }},
+ {16, 0xe470, 0, {0x01,0x3f,0x10,0x0f,0xc4,0x03,0xb0,0x00,0xfc,0x09,0x3f,0x00,0x0f,0xc0,0x03,0xd2 }},
+ {16, 0xe480, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xa9,0x20,0x36,0x40 }},
+ {16, 0xe490, 0, {0x0e,0x90,0x03,0x44,0x04,0xd9,0x00,0x3e,0x40,0x0d,0x90,0x03,0xe4,0x04,0xc9,0x00 }},
+ {16, 0xe4a0, 0, {0x32,0x40,0x8f,0x90,0x0b,0xe4,0x08,0xf9,0x00,0x3e,0x44,0x0e,0x98,0x03,0xe6,0x00 }},
+ {16, 0xe4b0, 0, {0xf9,0x00,0x3e,0x40,0x0f,0x90,0x03,0xc2,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe4c0, 0, {0x80,0x04,0x64,0x00,0x89,0x00,0x22,0x40,0x18,0x90,0x02,0x24,0x00,0x89,0x00,0x2e }},
+ {16, 0xe4d0, 0, {0x40,0x08,0x94,0x02,0xe4,0x00,0xd9,0x04,0x22,0x40,0x0b,0x1c,0x0b,0x64,0x00,0xb9 }},
+ {16, 0xe4e0, 0, {0x94,0x2c,0x50,0x08,0x9c,0x02,0xe4,0x14,0xb9,0x90,0x0e,0x40,0x0b,0x90,0x02,0xe0 }},
+ {16, 0xe4f0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x02,0x89,0x00,0x26,0x40 }},
+ {16, 0xe500, 0, {0x4a,0x90,0x02,0x64,0x00,0x99,0x04,0x2e,0x40,0x08,0x98,0x82,0xe4,0x00,0x89,0x00 }},
+ {16, 0xe510, 0, {0x6a,0x40,0x0a,0x92,0x82,0xe4,0x00,0xbd,0x01,0x2f,0x50,0x12,0xd6,0x02,0xf4,0x40 }},
+ {16, 0xe520, 0, {0xbd,0x00,0x0f,0x40,0x0b,0xd0,0x02,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe530, 0, {0x08,0x04,0x04,0x80,0x81,0x20,0x20,0x48,0x08,0x12,0x02,0x04,0x80,0x81,0x22,0x2c }},
+ {16, 0xe540, 0, {0x48,0xa8,0x12,0x06,0xc4,0x90,0x91,0x20,0x28,0x50,0x0b,0x90,0x02,0x45,0x00,0xb5 }},
+ {16, 0xe550, 0, {0x40,0x6d,0x40,0x08,0x50,0x12,0xd4,0x04,0xb5,0x02,0x2d,0x40,0x0b,0x50,0x02,0xc2 }},
+ {16, 0xe560, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x61,0x40,0xc8,0x00,0x36,0x14 }},
+ {16, 0xe570, 0, {0x0a,0x85,0x03,0x41,0x40,0xd8,0x50,0x2e,0x14,0x0c,0x85,0x03,0xc1,0x40,0xc8,0x50 }},
+ {16, 0xe580, 0, {0xba,0x00,0x0e,0x80,0x23,0xe0,0x00,0x78,0x00,0x3e,0x00,0x0e,0x80,0x03,0xe0,0x04 }},
+ {16, 0xe590, 0, {0xf8,0x00,0x3e,0x00,0x0f,0xc0,0x03,0xee,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe5a0, 0, {0x98,0x1d,0xf4,0x40,0xd9,0x10,0x3e,0x44,0x07,0xf1,0x03,0xe4,0x40,0xf9,0x10,0x3f }},
+ {16, 0xe5b0, 0, {0x44,0xaf,0x91,0x03,0xe4,0x40,0xfd,0x10,0x37,0x50,0x0f,0xd0,0x03,0xe4,0x00,0xf9 }},
+ {16, 0xe5c0, 0, {0x00,0x3e,0x40,0x0f,0x90,0x03,0xe4,0xa0,0xf9,0x28,0x3e,0x4a,0x0f,0x92,0x83,0xe6 }},
+ {16, 0xe5d0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xe6,0xd4,0xfd,0xa2,0x3a,0x70 }},
+ {16, 0xe5e0, 0, {0x8c,0x9e,0x03,0x26,0x80,0xc9,0xa0,0x32,0x68,0x0c,0xdb,0x43,0x27,0x80,0x9d,0xa2 }},
+ {16, 0xe5f0, 0, {0xb7,0x40,0x0f,0x50,0x03,0x65,0x00,0xfd,0x00,0x3f,0xc1,0x07,0xd0,0x03,0xf5,0x04 }},
+ {16, 0xe600, 0, {0xfd,0x40,0x2f,0xc0,0x0c,0xd0,0x03,0xc6,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe610, 0, {0x38,0x10,0xe3,0x88,0xb8,0x50,0x22,0x38,0x08,0x8e,0x00,0xa2,0xa0,0x88,0xe8,0x22 }},
+ {16, 0xe620, 0, {0x38,0x48,0x88,0x03,0x62,0x10,0xa8,0xe8,0x3c,0x00,0x0b,0x80,0x03,0x62,0x80,0xb8 }},
+ {16, 0xe630, 0, {0x01,0x2e,0x80,0x0b,0x80,0x21,0xa2,0x00,0xb0,0x84,0x2e,0x2a,0x28,0x8a,0x82,0xce }},
+ {16, 0xe640, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x40,0xb1,0x00,0x28,0x58 }},
+ {16, 0xe650, 0, {0x80,0x13,0x40,0x05,0x00,0x81,0x40,0x20,0x52,0x28,0x16,0x02,0x85,0x80,0x9b,0xc2 }},
+ {16, 0xe660, 0, {0x64,0x41,0x8b,0x98,0x02,0x04,0x00,0xb1,0x09,0x2c,0x40,0x1b,0x10,0x20,0xc4,0x00 }},
+ {16, 0xe670, 0, {0xb1,0x00,0x2c,0x40,0x48,0x10,0x02,0xc2,0x05,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe680, 0, {0x18,0x15,0xa5,0x84,0xb9,0x00,0x20,0x40,0x08,0x90,0x02,0x24,0x00,0x01,0x00,0x20 }},
+ {16, 0xe690, 0, {0x50,0x08,0x90,0x42,0x64,0x00,0xa9,0x10,0xae,0x58,0x03,0x98,0x02,0x64,0x00,0xb9 }},
+ {16, 0xe6a0, 0, {0x00,0x2e,0x40,0x0b,0x90,0x46,0xa4,0x10,0xb9,0x00,0x2e,0x41,0x08,0x90,0x02,0xc6 }},
+ {16, 0xe6b0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x11,0xe7,0x00,0xf9,0x00,0x2a,0x40 }},
+ {16, 0xe6c0, 0, {0x2c,0x94,0x0b,0x24,0x02,0xc9,0x00,0xb2,0x44,0x0c,0x90,0x03,0x24,0x04,0xd9,0x80 }},
+ {16, 0xe6d0, 0, {0xb6,0x41,0x8f,0x18,0x03,0x24,0x00,0xf9,0x60,0x3e,0x40,0x0f,0x96,0x03,0xe4,0x00 }},
+ {16, 0xe6e0, 0, {0xf9,0x80,0x3e,0x42,0x8c,0x90,0x03,0xe8,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe6f0, 0, {0x28,0x01,0xa6,0x00,0xf1,0x00,0x3e,0x40,0x0f,0x1c,0x03,0xc4,0x00,0xf9,0x00,0x3e }},
+ {16, 0xe700, 0, {0x40,0x8f,0x90,0x23,0xc4,0x10,0xf9,0x00,0xbe,0x40,0x0f,0x90,0x0b,0xe4,0x00,0xf9 }},
+ {16, 0xe710, 0, {0x00,0x3e,0x40,0x07,0x90,0x23,0xe4,0x00,0xf9,0x20,0x3e,0x40,0x8f,0x90,0x03,0xca }},
+ {16, 0xe720, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa1,0x00,0xf8,0x00,0xbe,0x00 }},
+ {16, 0xe730, 0, {0x0e,0x84,0x03,0x20,0x00,0xc8,0x00,0x32,0x00,0x0c,0x00,0x83,0x20,0x00,0xf8,0x00 }},
+ {16, 0xe740, 0, {0x3e,0x00,0x0c,0x80,0x03,0xa0,0x00,0xf8,0x00,0x36,0x10,0x0f,0x80,0x43,0xe0,0x08 }},
+ {16, 0xe750, 0, {0xf8,0x00,0x32,0x00,0x0f,0x80,0x03,0xca,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe760, 0, {0x28,0x05,0x28,0x00,0xba,0x00,0x22,0x80,0x48,0xa0,0x03,0x68,0x00,0xaa,0x00,0x2a }},
+ {16, 0xe770, 0, {0x80,0x08,0xe0,0x03,0x68,0x00,0x82,0x00,0x2f,0x80,0x08,0xe6,0x02,0x28,0x04,0xbe }},
+ {16, 0xe780, 0, {0x40,0x23,0x80,0x0b,0xe8,0x02,0xea,0x00,0xbe,0x01,0x22,0x80,0x0b,0xe0,0x02,0xca }},
+ {16, 0xe790, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x01,0x93,0x01,0x20,0xc1 }},
+ {16, 0xe7a0, 0, {0x0a,0x30,0x02,0x0c,0x00,0xa3,0x00,0x20,0xc0,0x88,0x38,0x42,0x0c,0x00,0xa3,0x00 }},
+ {16, 0xe7b0, 0, {0x24,0xc0,0x0a,0x3e,0x42,0x8c,0x00,0xb2,0x4c,0x24,0xe0,0x4b,0x38,0x02,0xc4,0x41 }},
+ {16, 0xe7c0, 0, {0xb3,0x00,0x22,0xc0,0x0b,0x10,0x02,0xca,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe7d0, 0, {0xa0,0x01,0x1c,0x00,0xb7,0x00,0x20,0xc9,0x48,0x70,0x02,0xdc,0x40,0xa7,0x14,0x2c }},
+ {16, 0xe7e0, 0, {0xc8,0x28,0x30,0x82,0x5c,0xc1,0x85,0x00,0x2d,0xe0,0x2a,0xf0,0x12,0x1c,0x80,0xb7 }},
+ {16, 0xe7f0, 0, {0xa0,0x21,0x82,0x0b,0x70,0x82,0xd4,0x11,0xb6,0x80,0x21,0x40,0x4b,0x50,0x02,0xe8 }},
+ {16, 0xe800, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0x80,0xd5,0x80,0x29,0xea }},
+ {16, 0xe810, 0, {0x4e,0x3a,0x07,0x0e,0x80,0xe3,0xb0,0x31,0xfc,0x0c,0x48,0x03,0x0e,0x41,0xe7,0x80 }},
+ {16, 0xe820, 0, {0x3d,0xe0,0x0e,0x78,0x03,0x9e,0x80,0xf4,0xc4,0x35,0xe0,0x0f,0x78,0x27,0xde,0x00 }},
+ {16, 0xe830, 0, {0xf5,0x80,0xb1,0xe0,0x0f,0x58,0x03,0xea,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe840, 0, {0x08,0x1d,0xac,0x00,0x31,0x04,0x3a,0xc4,0x0f,0xb5,0x93,0x6d,0x08,0xfb,0x40,0x3a }},
+ {16, 0xe850, 0, {0xc8,0x63,0x80,0x23,0xec,0x98,0xe9,0x00,0x3e,0xc0,0x0d,0xb0,0x43,0xec,0x00,0xf3 }},
+ {16, 0xe860, 0, {0x80,0x3e,0x40,0x4f,0xa0,0x03,0xec,0x00,0xf8,0x68,0x3e,0x40,0x8f,0x98,0x03,0xc2 }},
+ {16, 0xe870, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xfe,0x60,0xeb,0x90,0x3e,0xe4 }},
+ {16, 0xe880, 0, {0x0f,0xb8,0x00,0x3f,0x40,0xcb,0x80,0x7f,0xe0,0x0e,0xfb,0x03,0x2e,0x40,0xcb,0x80 }},
+ {16, 0xe890, 0, {0x3f,0xe0,0x0f,0x79,0x43,0x2e,0x60,0xca,0x81,0x33,0x64,0x8f,0xd9,0x03,0xfe,0x00 }},
+ {16, 0xe8a0, 0, {0xff,0x81,0x33,0xe0,0x0f,0xd9,0x8b,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe8b0, 0, {0xa8,0x01,0x9c,0x00,0x87,0x81,0x19,0xe4,0x0b,0xfa,0x13,0x5e,0x80,0x87,0xb2,0x2d }},
+ {16, 0xe8c0, 0, {0xec,0x0d,0x79,0x01,0x9e,0x00,0xd5,0x90,0x2d,0xf8,0x0b,0x78,0x03,0x7e,0x08,0xab }},
+ {16, 0xe8d0, 0, {0x91,0x29,0x85,0x0b,0x51,0x02,0xdc,0x48,0xb6,0x40,0x21,0x40,0x0b,0x50,0x02,0x2a }},
+ {16, 0xe8e0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8c,0x14,0xb5,0x20,0x6d,0xc8 }},
+ {16, 0xe8f0, 0, {0x0b,0x72,0x02,0x5c,0x80,0x87,0x20,0x69,0xc0,0x88,0x53,0x02,0xcc,0x81,0x97,0x50 }},
+ {16, 0xe900, 0, {0x2d,0xc8,0x0b,0xf7,0x0a,0xdc,0xc0,0x84,0x01,0x21,0x44,0x1b,0x70,0x22,0xdc,0x00 }},
+ {16, 0xe910, 0, {0xb5,0x00,0x21,0xc4,0x0b,0x50,0x86,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe920, 0, {0x20,0x14,0xcf,0x30,0x91,0x00,0x2c,0xc0,0x0b,0x34,0x02,0x4c,0x00,0x83,0x00,0x2c }},
+ {16, 0xe930, 0, {0xf2,0x0b,0x10,0x22,0x0c,0x00,0x91,0x00,0x2c,0xc8,0x0b,0x18,0x0a,0xcd,0x01,0xa3 }},
+ {16, 0xe940, 0, {0x00,0x28,0x60,0x0b,0x21,0x02,0xce,0x20,0xb8,0x40,0xa0,0x54,0x0b,0x18,0x02,0x08 }},
+ {16, 0xe950, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x11,0xbd,0x00,0xf9,0x00,0x2f,0xc0 }},
+ {16, 0xe960, 0, {0x0f,0xf4,0x02,0x7c,0x12,0xcf,0x03,0x3f,0xc2,0x0e,0xb0,0x03,0xfc,0x04,0x9b,0x02 }},
+ {16, 0xe970, 0, {0x2e,0xf2,0x0f,0xa4,0x0b,0xdc,0x00,0xce,0x00,0xb0,0xc8,0x8f,0xa4,0x03,0xef,0x00 }},
+ {16, 0xe980, 0, {0xf8,0x80,0x32,0xf5,0x1f,0xdd,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe990, 0, {0x80,0x00,0xec,0x40,0xe9,0x00,0x3a,0xc0,0x0f,0xb1,0x03,0xcc,0x00,0xf3,0x00,0x3e }},
+ {16, 0xe9a0, 0, {0xc0,0x0d,0xb4,0x09,0xec,0x18,0xf9,0x10,0x3e,0x10,0x4f,0xb1,0x0a,0x6c,0x80,0xf9 }},
+ {16, 0xe9b0, 0, {0x89,0x36,0x82,0x0b,0xa6,0x03,0xec,0x50,0xf9,0x50,0x3e,0xc0,0x1f,0x90,0x03,0x60 }},
+ {16, 0xe9c0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x00,0xfd,0xa0,0x3d,0xc0 }},
+ {16, 0xe9d0, 0, {0x0c,0x70,0x83,0x2c,0x00,0xef,0x02,0x35,0xc0,0x0d,0xe2,0x03,0xfc,0x04,0xff,0x02 }},
+ {16, 0xe9e0, 0, {0x2d,0xe0,0x8e,0xf0,0x03,0x3c,0x10,0xdc,0x00,0x3f,0x80,0x0c,0xd8,0x03,0xfc,0x00 }},
+ {16, 0xe9f0, 0, {0xde,0x18,0x33,0xf0,0x4f,0xd0,0x03,0xc0,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xea00, 0, {0x81,0x00,0x6c,0x00,0xb9,0x00,0x2e,0xc0,0x4c,0xb0,0x03,0x6c,0x00,0x8b,0x02,0x36 }},
+ {16, 0xea10, 0, {0xc0,0x0d,0xac,0x12,0xec,0x00,0x79,0x00,0x2e,0x30,0x0d,0x3d,0x42,0xac,0x00,0x89 }},
+ {16, 0xea20, 0, {0x88,0x1a,0x10,0x0d,0x86,0x02,0xee,0x04,0xbb,0x40,0x22,0xe0,0x0b,0x90,0x02,0xe0 }},
+ {16, 0xea30, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x01,0xb9,0x00,0x2e,0xc0 }},
+ {16, 0xea40, 0, {0x08,0xb0,0x42,0xac,0x00,0x0b,0x05,0x26,0xc0,0x09,0x94,0x20,0xec,0x00,0xb9,0x80 }},
+ {16, 0xea50, 0, {0x6e,0xc4,0x88,0xb0,0x82,0x2c,0x00,0x9b,0x82,0x2e,0x42,0x08,0x81,0x02,0xe4,0x80 }},
+ {16, 0xea60, 0, {0xb8,0x00,0x22,0xc1,0x0b,0x90,0x02,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xea70, 0, {0x08,0x04,0x0c,0x10,0xb1,0x25,0x2c,0xca,0x08,0x34,0x46,0xcc,0x08,0x83,0x00,0x24 }},
+ {16, 0xea80, 0, {0xc2,0x0b,0x02,0x52,0xcc,0x81,0x83,0x00,0x2c,0x00,0x19,0xb2,0x42,0xac,0x80,0x81 }},
+ {16, 0xea90, 0, {0x08,0x28,0x80,0x09,0x00,0x02,0xc4,0x40,0xb1,0x00,0x20,0xc0,0x0b,0x10,0x02,0xc2 }},
+ {16, 0xeaa0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x6c,0x00,0xb9,0x00,0x3f,0xd0 }},
+ {16, 0xeab0, 0, {0x08,0xf6,0x07,0xbc,0xc2,0xaf,0x30,0x75,0xdc,0x0d,0x16,0x02,0xfc,0xe0,0xb9,0x50 }},
+ {16, 0xeac0, 0, {0x3e,0xcc,0x0c,0xb0,0x23,0x2c,0x10,0xd9,0x00,0x3e,0x00,0x0c,0x90,0x03,0xec,0x00 }},
+ {16, 0xead0, 0, {0xde,0x01,0x32,0xc0,0x0f,0x90,0x03,0xc0,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeae0, 0, {0xa0,0x19,0xfc,0x00,0xfd,0x10,0x3f,0xca,0x2e,0xf6,0x03,0x6d,0x94,0x9f,0x30,0x3a }},
+ {16, 0xeaf0, 0, {0xc9,0x0c,0x83,0x93,0xfc,0x80,0xff,0x11,0x7e,0x19,0x0b,0xb1,0x03,0xfc,0x40,0xfd }},
+ {16, 0xeb00, 0, {0x08,0x3b,0x00,0x0f,0xc0,0x03,0xfc,0x80,0x77,0x00,0xbf,0xc0,0x0f,0x50,0x03,0xe8 }},
+ {16, 0xeb10, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0xfc,0x00,0xf4,0x94,0x37,0xc8 }},
+ {16, 0xeb20, 0, {0x0d,0x69,0x63,0x7c,0x10,0xff,0x62,0x37,0xc0,0x0d,0xb4,0x03,0x7c,0x60,0xd4,0x80 }},
+ {16, 0xeb30, 0, {0x3f,0x40,0x0f,0x48,0x23,0x32,0x00,0xce,0x00,0xbf,0x40,0x8f,0xd1,0x03,0x30,0xe0 }},
+ {16, 0xeb40, 0, {0xff,0x30,0x3b,0x60,0x0f,0xd8,0x03,0xb0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeb50, 0, {0x80,0x10,0xed,0x20,0xb8,0x24,0x23,0xf4,0x49,0xa2,0x02,0x3f,0x40,0x8f,0x51,0x23 }},
+ {16, 0xeb60, 0, {0xda,0x08,0xf6,0x12,0x3d,0x80,0x9b,0x80,0x2e,0x49,0x4b,0x80,0x03,0x40,0x00,0xd9 }},
+ {16, 0xeb70, 0, {0x01,0x22,0x74,0x0b,0xd5,0x02,0x21,0x00,0xbf,0x42,0x2e,0x49,0x0b,0x9c,0x02,0xe0 }},
+ {16, 0xeb80, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcd,0x80,0xb8,0x20,0x28,0xc1 }},
+ {16, 0xeb90, 0, {0x1b,0xa0,0x02,0x4c,0x00,0x93,0x20,0x2c,0xd8,0x0b,0x34,0x02,0xcc,0x00,0x90,0x01 }},
+ {16, 0xeba0, 0, {0x2c,0xc6,0x1a,0xa0,0x02,0x68,0x08,0x83,0x00,0xa4,0x40,0x0b,0x10,0x02,0x00,0x00 }},
+ {16, 0xebb0, 0, {0xb3,0x10,0x28,0x42,0x0b,0x14,0x02,0xa2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xebc0, 0, {0xc0,0x15,0xac,0x00,0xb8,0x60,0x2a,0xc0,0x1b,0xa0,0x8e,0xac,0x01,0x9b,0x05,0x26 }},
+ {16, 0xebd0, 0, {0xc0,0x03,0xb0,0x42,0x6c,0x00,0x9b,0x80,0x2e,0xc0,0x03,0xa0,0x06,0x69,0x00,0x99 }},
+ {16, 0xebe0, 0, {0x80,0xaa,0xc0,0x0b,0x90,0x02,0x63,0x00,0x3b,0x00,0x2e,0x58,0x4b,0x90,0x02,0xf0 }},
+ {16, 0xebf0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x11,0xec,0x04,0xf8,0x80,0xba,0xc0 }},
+ {16, 0xec00, 0, {0x0f,0x30,0x03,0x6c,0x10,0xdb,0x03,0x36,0xc0,0x8f,0xb0,0x03,0xec,0x08,0xd8,0x80 }},
+ {16, 0xec10, 0, {0x7e,0xe0,0x06,0x88,0x03,0x41,0x08,0xcb,0xa0,0x3e,0x64,0x0f,0x90,0x0b,0x2a,0x00 }},
+ {16, 0xec20, 0, {0x7b,0x00,0x3a,0x01,0x0f,0x90,0x03,0x90,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xec30, 0, {0xe0,0x01,0xbc,0x00,0xfc,0x84,0x32,0xc0,0x0c,0xf9,0x03,0x5c,0x10,0xef,0x00,0x3b }},
+ {16, 0xec40, 0, {0xc0,0x0c,0x70,0x03,0x9c,0x00,0xec,0x01,0x3f,0xe4,0x4f,0xd1,0x03,0xf1,0x00,0xf3 }},
+ {16, 0xec50, 0, {0x05,0x33,0x60,0x0f,0xd0,0x03,0xbc,0x04,0xff,0x00,0x3f,0x21,0x0f,0xd0,0x03,0xf8 }},
+ {16, 0xec60, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xc8,0x40,0x3a,0xc6 }},
+ {16, 0xec70, 0, {0x0d,0xb4,0x03,0x6c,0x00,0xf3,0x00,0x34,0xc0,0x0e,0xb0,0x03,0x6c,0x00,0xe9,0x10 }},
+ {16, 0xec80, 0, {0x3a,0xc0,0x0f,0x84,0x03,0x2c,0x60,0xcb,0x00,0x32,0x60,0x0c,0x50,0x03,0x61,0x00 }},
+ {16, 0xec90, 0, {0xcb,0x00,0x3e,0x90,0x0e,0x90,0xa3,0x90,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeca0, 0, {0xc8,0x05,0x3c,0x02,0x88,0x01,0x01,0xf0,0x20,0xb0,0x01,0x3e,0x00,0x3f,0x00,0x33 }},
+ {16, 0xecb0, 0, {0xc0,0x0b,0xf0,0x32,0x3c,0x08,0x89,0x80,0x22,0xc0,0x01,0x15,0x12,0xac,0x00,0x8b }},
+ {16, 0xecc0, 0, {0x00,0x22,0xc0,0x48,0xdb,0x02,0x2f,0x40,0x8f,0x00,0x2e,0x01,0x08,0xd4,0x80,0x32 }},
+ {16, 0xecd0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x00,0x08,0x00,0x08,0xf0 }},
+ {16, 0xece0, 0, {0x08,0x00,0x12,0x4c,0x00,0x33,0x01,0x24,0xc0,0x4a,0x30,0x02,0x4c,0x00,0xa0,0x20 }},
+ {16, 0xecf0, 0, {0x28,0xc0,0x0b,0x10,0x02,0x46,0x04,0x83,0x04,0x20,0xc0,0x29,0x18,0x02,0x04,0x40 }},
+ {16, 0xed00, 0, {0xb3,0x00,0x2c,0x40,0x0a,0x1c,0x42,0xb1,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xed10, 0, {0x20,0x01,0x1e,0x01,0x8d,0x80,0x21,0xe0,0x18,0xc8,0x02,0x1e,0x00,0xb3,0xa0,0x21 }},
+ {16, 0xed20, 0, {0xe0,0x1b,0x38,0x02,0x0e,0x01,0xa7,0x80,0x21,0xe0,0x09,0xd8,0x40,0xd6,0x40,0x87 }},
+ {16, 0xed30, 0, {0x80,0x01,0xe0,0x09,0x59,0x02,0x16,0x00,0x97,0x84,0x2d,0x60,0x08,0x58,0x40,0x00 }},
+ {16, 0xed40, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x2c,0x40,0xc0,0x00,0x38,0xc4 }},
+ {16, 0xed50, 0, {0x0c,0x30,0x27,0x4c,0x20,0xf3,0x01,0x34,0xc1,0x0e,0x3a,0x03,0x4c,0xc4,0xe0,0x00 }},
+ {16, 0xed60, 0, {0x18,0xc8,0x0f,0x34,0x03,0x44,0x40,0xc3,0x00,0x30,0xc0,0x0d,0x90,0x03,0x2e,0x00 }},
+ {16, 0xed70, 0, {0xf3,0x00,0x3e,0x40,0x0e,0x10,0x01,0x9a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xed80, 0, {0x40,0x1d,0xbc,0x00,0xf9,0x00,0x0e,0xd4,0x0e,0xb0,0x03,0xec,0x20,0xfb,0x20,0x3f }},
+ {16, 0xed90, 0, {0xc4,0x0f,0xf1,0x03,0xec,0x60,0xdb,0x10,0x3f,0xc0,0x4f,0xf0,0x03,0xa4,0x46,0xfb }},
+ {16, 0xeda0, 0, {0x00,0xbd,0xc0,0x0e,0xd0,0x0b,0xb4,0x00,0xef,0x48,0x3f,0x40,0x0f,0x50,0x03,0xd0 }},
+ {16, 0xedb0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x00,0xf8,0x00,0x32,0xd4 }},
+ {16, 0xedc0, 0, {0x0f,0x80,0x03,0xad,0x00,0xeb,0x08,0x22,0xd2,0x0c,0xb6,0x03,0x6c,0x00,0xf2,0x80 }},
+ {16, 0xedd0, 0, {0x36,0xc0,0x0e,0xa0,0x03,0x28,0x10,0xcb,0x00,0xb2,0xc0,0x0f,0xd6,0x03,0x28,0x10 }},
+ {16, 0xede0, 0, {0xfb,0x20,0x3e,0x40,0x4f,0x99,0x13,0x2b,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xedf0, 0, {0x48,0x11,0x9d,0x10,0xb4,0x01,0x21,0xc1,0x8b,0xc0,0x02,0x1c,0xa0,0xbf,0x04,0x27 }},
+ {16, 0xee00, 0, {0xc8,0x08,0x75,0x02,0x1c,0xc0,0xb6,0x00,0x21,0xc0,0x08,0xf0,0x42,0x18,0x10,0x8f }},
+ {16, 0xee10, 0, {0x00,0x21,0xc0,0x0b,0x54,0xa2,0x1c,0x00,0xb7,0x04,0x2d,0x41,0x0b,0x52,0x02,0x12 }},
+ {16, 0xee20, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x80,0xb6,0x88,0xa5,0xe0 }},
+ {16, 0xee30, 0, {0x0b,0x78,0x12,0x9e,0x81,0xa7,0x90,0x25,0xe4,0x88,0x78,0x02,0x1e,0x80,0xbf,0x80 }},
+ {16, 0xee40, 0, {0x24,0x60,0x0b,0x68,0x02,0x1e,0x00,0x87,0x84,0x61,0xe0,0x0a,0x1a,0x0a,0x1a,0x00 }},
+ {16, 0xee50, 0, {0xb7,0xa0,0x2d,0xe0,0x0b,0xda,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xee60, 0, {0x48,0x14,0xcc,0x00,0xba,0xc0,0xa4,0xc0,0x0b,0x34,0x02,0x0c,0x00,0xb3,0x00,0x24 }},
+ {16, 0xee70, 0, {0xc0,0x08,0xb0,0x0e,0x2c,0x00,0xb3,0x98,0x20,0x60,0x09,0x33,0x02,0x2c,0x00,0xa3 }},
+ {16, 0xee80, 0, {0xc8,0x20,0xc0,0x0b,0x10,0x02,0x0c,0x00,0xb3,0x00,0x2c,0xf0,0x0b,0x10,0x02,0x12 }},
+ {16, 0xee90, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x00,0xfe,0x80,0x36,0x81 }},
+ {16, 0xeea0, 0, {0x0b,0xe0,0x03,0xa8,0x00,0xea,0x00,0xb2,0x80,0x08,0xa0,0x03,0x68,0x00,0xfe,0x00 }},
+ {16, 0xeeb0, 0, {0x36,0xa0,0x1f,0xe8,0x13,0x3b,0x82,0xce,0xe0,0x22,0x80,0x8e,0xa0,0x03,0x38,0x00 }},
+ {16, 0xeec0, 0, {0xba,0x00,0x3f,0xa2,0x0f,0xa0,0x03,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeed0, 0, {0x48,0x00,0xe0,0x00,0xf8,0x20,0x3a,0x10,0x07,0x80,0x03,0xc1,0x00,0xf8,0x00,0x38 }},
+ {16, 0xeee0, 0, {0x00,0x2f,0x80,0x03,0xa0,0x01,0xf8,0x42,0x3e,0x05,0x0e,0x80,0x0b,0xe0,0x80,0xd8 }},
+ {16, 0xeef0, 0, {0x00,0x3e,0x00,0x0f,0x84,0x03,0xe1,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x84,0x0b,0xd2 }},
+ {16, 0xef00, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xc9,0x00,0x3a,0x50 }},
+ {16, 0xef10, 0, {0x8f,0x90,0x83,0xa4,0x02,0xd1,0x00,0xb2,0x40,0x4c,0x90,0x23,0x24,0x08,0xc9,0x01 }},
+ {16, 0xef20, 0, {0x3e,0x40,0x0c,0x90,0x03,0x24,0x00,0xc1,0x00,0x32,0x40,0x0f,0x14,0x0a,0x25,0x20 }},
+ {16, 0xef30, 0, {0xe9,0x00,0x3e,0x42,0x0f,0x90,0x03,0xc2,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xef40, 0, {0x80,0x04,0x64,0x0a,0x89,0x00,0x22,0x70,0x0b,0x90,0x12,0x25,0x80,0xc9,0x00,0x22 }},
+ {16, 0xef50, 0, {0x40,0x0a,0x90,0x03,0x64,0x00,0x89,0x20,0x2c,0x40,0x0a,0x90,0x0a,0x24,0x00,0x89 }},
+ {16, 0xef60, 0, {0xc1,0x32,0x40,0x0b,0x98,0x02,0x06,0x00,0x89,0x90,0x2e,0x40,0x0b,0x94,0x12,0xe0 }},
+ {16, 0xef70, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0x04,0x00,0x89,0x00,0x6a,0x42 }},
+ {16, 0xef80, 0, {0x0a,0x10,0x02,0xa4,0x00,0x89,0x00,0xa2,0x40,0x0a,0x90,0x02,0x24,0x00,0x09,0x00 }},
+ {16, 0xef90, 0, {0x2e,0x40,0x58,0x10,0x02,0x24,0x00,0x89,0x80,0xaa,0x60,0x0b,0x90,0x02,0xa4,0x04 }},
+ {16, 0xefa0, 0, {0xa9,0x00,0x2e,0x40,0x0b,0x94,0x02,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xefb0, 0, {0x08,0x04,0x04,0x80,0x81,0x00,0x60,0x48,0x0b,0x10,0x02,0x04,0x81,0x81,0x20,0x60 }},
+ {16, 0xefc0, 0, {0x48,0x0a,0x12,0x02,0x44,0x88,0x81,0x00,0x0e,0x59,0x0a,0x14,0x02,0x05,0x00,0x81 }},
+ {16, 0xefd0, 0, {0xc0,0x28,0x50,0x49,0x30,0x02,0x8c,0x84,0x01,0x60,0x2c,0x50,0x0b,0x10,0x02,0xc2 }},
+ {16, 0xefe0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x61,0x40,0xc0,0x54,0x2a,0x00 }},
+ {16, 0xeff0, 0, {0x0e,0x85,0x03,0xa0,0x00,0xc8,0x50,0x32,0x15,0x1e,0x05,0x22,0x21,0x42,0xc8,0x00 }},
+ {16, 0xf000, 0, {0x3e,0x00,0x0c,0x80,0x03,0x00,0x04,0xc8,0x00,0x3a,0x00,0x4f,0x85,0x03,0xa1,0x40 }},
+ {16, 0xf010, 0, {0x68,0x00,0x3e,0x00,0x0f,0x80,0x03,0xee,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf020, 0, {0x98,0x1d,0xe4,0x40,0xfd,0x03,0x3e,0x44,0x0f,0xd0,0x03,0xe4,0x48,0xe9,0x10,0x3e }},
+ {16, 0xf030, 0, {0x45,0x0f,0x91,0x13,0xe4,0x40,0xfd,0x00,0x3f,0x44,0x0f,0xd0,0x03,0xf4,0x02,0xfd }},
+ {16, 0xf040, 0, {0x40,0x33,0x50,0x0f,0xd4,0x23,0x74,0x40,0xf9,0x10,0x3f,0x40,0x0f,0x54,0x03,0xe6 }},
+ {16, 0xf050, 0, {0x02,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xe4,0x00,0xf9,0x01,0x33,0x6a }},
+ {16, 0xf060, 0, {0x09,0x90,0x03,0xb6,0x34,0xf9,0xc8,0x32,0x64,0x0c,0x9a,0x03,0xe6,0xa0,0xdd,0x00 }},
+ {16, 0xf070, 0, {0x3c,0x70,0x0f,0x90,0x03,0xa5,0x00,0x89,0x80,0x33,0x32,0x0f,0xd8,0x13,0x3c,0x00 }},
+ {16, 0xf080, 0, {0xfd,0x00,0x70,0x50,0x0f,0xd0,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf090, 0, {0x38,0x10,0xe2,0x80,0xb8,0xa8,0x22,0x10,0x08,0x88,0x02,0x21,0x00,0xb8,0xc0,0x20 }},
+ {16, 0xf0a0, 0, {0x30,0x0d,0x8e,0x87,0x83,0x88,0x88,0x00,0x2e,0x34,0x0b,0x8a,0x82,0x22,0x80,0xdc }},
+ {16, 0xf0b0, 0, {0xe0,0x22,0x38,0x0b,0x80,0x02,0x20,0x00,0xf8,0xa8,0x2a,0x28,0x0b,0x80,0x02,0x0e }},
+ {16, 0xf0c0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x20,0xb1,0x00,0x20,0x40 }},
+ {16, 0xf0d0, 0, {0x0a,0x92,0x92,0x84,0x11,0xb1,0x24,0x68,0x58,0x09,0x11,0x02,0xc4,0x20,0x91,0x01 }},
+ {16, 0xf0e0, 0, {0x2c,0x48,0x1b,0x50,0x02,0x74,0x84,0x95,0x48,0xac,0x48,0x0b,0x94,0x02,0x04,0x04 }},
+ {16, 0xf0f0, 0, {0xb1,0x02,0x24,0x48,0x0b,0x10,0x02,0x02,0x05,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf100, 0, {0x18,0x11,0xa4,0x00,0xb1,0x20,0x22,0x40,0x0a,0x90,0x06,0x2c,0x01,0xb9,0x00,0x2a }},
+ {16, 0xf110, 0, {0x40,0x09,0x90,0x02,0xa4,0x00,0x9b,0x08,0x2e,0x48,0x0b,0x12,0x1a,0x74,0x00,0x95 }},
+ {16, 0xf120, 0, {0x45,0x2e,0x60,0x03,0x90,0x02,0x24,0x00,0xb9,0x00,0x2e,0x40,0x0b,0x90,0x02,0x06 }},
+ {16, 0xf130, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x00,0xf9,0x80,0x30,0x40 }},
+ {16, 0xf140, 0, {0x0e,0x16,0x03,0xa4,0x00,0xb9,0x04,0x32,0x40,0x0d,0x90,0x02,0xe4,0x00,0xd9,0x40 }},
+ {16, 0xf150, 0, {0x2e,0x40,0x1f,0x98,0x03,0xe5,0x80,0xd9,0x00,0xae,0x60,0x07,0x10,0x0b,0x26,0x01 }},
+ {16, 0xf160, 0, {0xb9,0x00,0xa6,0x40,0x0f,0x90,0x0b,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf170, 0, {0x28,0x01,0xa4,0x00,0xf9,0x00,0xbe,0x40,0xac,0x92,0x03,0xe4,0x00,0xf9,0x00,0xb4 }},
+ {16, 0xf180, 0, {0x40,0x0f,0x90,0x03,0xe4,0x00,0xe9,0x00,0x3e,0x60,0x0f,0x90,0x03,0xa4,0x80,0xf9 }},
+ {16, 0xf190, 0, {0x00,0x32,0x00,0x0f,0x90,0x83,0xe6,0x85,0xe1,0x00,0x32,0x44,0x0f,0x10,0x03,0xca }},
+ {16, 0xf1a0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xf8,0x00,0x32,0x00 }},
+ {16, 0xf1b0, 0, {0x0f,0x80,0x13,0xe0,0x94,0xe0,0x00,0x32,0x00,0x0c,0x80,0x03,0x60,0x00,0xc8,0x00 }},
+ {16, 0xf1c0, 0, {0x3e,0x00,0x0d,0x80,0x43,0x20,0x08,0xf8,0x00,0x32,0x00,0x0f,0x80,0x03,0xe0,0x40 }},
+ {16, 0xf1d0, 0, {0xf8,0x00,0x32,0x00,0x4c,0x80,0x23,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf1e0, 0, {0x28,0x05,0x28,0x00,0xba,0x00,0x23,0x80,0x0b,0xa0,0x02,0xfb,0x04,0x6a,0x00,0x22 }},
+ {16, 0xf1f0, 0, {0x80,0x0a,0xa0,0x03,0x68,0x0a,0x8e,0x88,0x3a,0x80,0x08,0xa0,0x02,0x08,0x00,0xba }},
+ {16, 0xf200, 0, {0x00,0xb7,0x22,0x03,0xe4,0x02,0xfa,0x00,0x8a,0x00,0x22,0x80,0x08,0xe8,0x02,0xca }},
+ {16, 0xf210, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0xb3,0x00,0x60,0x41 }},
+ {16, 0xf220, 0, {0x03,0x30,0x02,0xcc,0x41,0xa3,0x00,0x04,0xc0,0x0b,0x30,0x02,0x2c,0x00,0xa3,0x80 }},
+ {16, 0xf230, 0, {0x2c,0xc0,0x09,0x38,0x02,0x0c,0x00,0xb3,0x00,0xa0,0xc0,0x0b,0x34,0x02,0xcc,0x80 }},
+ {16, 0xf240, 0, {0xa1,0x00,0x20,0xc0,0x08,0x38,0x02,0xca,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf250, 0, {0xa0,0x01,0x1c,0x40,0xb7,0x00,0x61,0x00,0x0b,0x71,0x02,0xdc,0x00,0xa3,0x00,0x25 }},
+ {16, 0xf260, 0, {0xc8,0x19,0x38,0x02,0x5c,0x80,0xa7,0x00,0x0f,0xe8,0x09,0x64,0x22,0x10,0x00,0xb3 }},
+ {16, 0xf270, 0, {0x00,0x25,0xc8,0x0b,0x60,0x02,0xf2,0x00,0x85,0x01,0x23,0xe8,0x08,0x70,0x82,0xe8 }},
+ {16, 0xf280, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0x20,0xff,0x80,0xa1,0xa0 }},
+ {16, 0xf290, 0, {0x0f,0x7a,0x42,0xda,0x00,0xe7,0xe8,0x35,0xf0,0x2f,0x7b,0x62,0x1e,0x82,0xe6,0x80 }},
+ {16, 0xf2a0, 0, {0x1d,0xe0,0x0d,0xf8,0x0b,0x1e,0x00,0xf7,0x80,0x31,0xf0,0x0f,0x78,0x03,0xde,0x0c }},
+ {16, 0xf2b0, 0, {0xef,0x80,0x31,0xf8,0x2c,0x78,0x03,0xea,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf2c0, 0, {0x08,0x1d,0xad,0x84,0xfb,0x68,0x3e,0x00,0x0f,0xb0,0x03,0xe8,0x00,0xfb,0x00,0xfa }},
+ {16, 0xf2d0, 0, {0xd8,0x0e,0xb5,0x03,0xed,0x00,0xdb,0x00,0x3a,0xc0,0x8e,0xa0,0x03,0xe0,0x00,0xfb }},
+ {16, 0xf2e0, 0, {0x40,0x3e,0xc0,0x0b,0xb0,0x43,0xc4,0x04,0xef,0x02,0xbf,0xc0,0x0f,0xb0,0x03,0xc2 }},
+ {16, 0xf2f0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xfe,0x42,0xc7,0x38,0x33,0x64 }},
+ {16, 0xf300, 0, {0x0e,0x7c,0x03,0x5e,0x00,0xdf,0xa0,0x37,0xf0,0x0d,0xf8,0x03,0xff,0x20,0xcf,0x81 }},
+ {16, 0xf310, 0, {0x33,0xe2,0x0c,0xd8,0x03,0xbe,0x00,0x7f,0xc0,0x33,0xe0,0x0c,0xf9,0x03,0x7e,0x00 }},
+ {16, 0xf320, 0, {0xfd,0x80,0x3f,0xe0,0x0f,0xf8,0x03,0xc0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf330, 0, {0xa8,0x11,0x9c,0x00,0x87,0xa0,0x21,0x14,0x08,0x71,0x02,0x14,0x10,0xd7,0x20,0x35 }},
+ {16, 0xf340, 0, {0xc0,0x0c,0x70,0x03,0xbc,0x00,0x85,0x08,0x2b,0xc0,0x4d,0x46,0x02,0xd1,0x00,0xb7 }},
+ {16, 0xf350, 0, {0x00,0x21,0xc0,0x08,0x60,0x02,0x08,0x80,0xf5,0x20,0x3d,0xca,0x0f,0x54,0x03,0xea }},
+ {16, 0xf360, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x11,0x8f,0x01,0x20,0x84 }},
+ {16, 0xf370, 0, {0x1a,0xf0,0x02,0x18,0x00,0xa7,0x34,0x65,0xc0,0x09,0x71,0x02,0xdc,0x00,0x8e,0x00 }},
+ {16, 0xf380, 0, {0x29,0xc0,0x08,0x50,0x06,0x9c,0x00,0xbf,0x88,0x2d,0xc4,0x0a,0x60,0x26,0x58,0x24 }},
+ {16, 0xf390, 0, {0x97,0x00,0x6d,0xc0,0x9b,0x70,0x02,0xc0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf3a0, 0, {0x20,0x14,0xcc,0x00,0x8b,0x40,0x20,0x00,0x18,0x30,0x02,0x00,0x00,0xbb,0x02,0x24 }},
+ {16, 0xf3b0, 0, {0xc0,0x08,0x30,0x20,0xcc,0x00,0x81,0xc0,0x28,0xc0,0x0b,0x04,0x82,0xe0,0x10,0xbb }},
+ {16, 0xf3c0, 0, {0xa0,0x2c,0xe0,0x0a,0x20,0x06,0x00,0x00,0xb3,0x00,0x28,0xc0,0x0a,0x10,0x02,0x88 }},
+ {16, 0xf3d0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xbc,0x00,0xcf,0x10,0x32,0x00 }},
+ {16, 0xf3e0, 0, {0x0e,0xf0,0x0b,0x24,0x00,0xef,0x00,0x37,0xc0,0x0d,0xf0,0x03,0xfc,0x06,0xc1,0x50 }},
+ {16, 0xf3f0, 0, {0x3b,0xc0,0x0c,0xb4,0x03,0xac,0x00,0xf8,0xc0,0xbe,0xc8,0x2e,0xb0,0x03,0x6e,0x01 }},
+ {16, 0xf400, 0, {0xfb,0x00,0x2d,0xc0,0x4b,0x90,0x02,0xea,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf410, 0, {0x80,0x00,0xec,0x04,0xfb,0x00,0x3e,0x00,0x0f,0xb0,0x03,0xad,0x00,0x9b,0x00,0x3e }},
+ {16, 0xf420, 0, {0xc0,0x0f,0x30,0x03,0xac,0x00,0xf8,0x00,0x2e,0xc0,0x05,0xb4,0x03,0xed,0x00,0xf8 }},
+ {16, 0xf430, 0, {0x40,0x32,0xc0,0x09,0x00,0x03,0xe0,0x91,0xe3,0x00,0x3e,0xc0,0x0f,0x90,0x11,0xe0 }},
+ {16, 0xf440, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xec,0x00,0xef,0x00,0x33,0x20 }},
+ {16, 0xf450, 0, {0x4f,0xf0,0x03,0xb4,0x00,0xef,0x03,0x3a,0xc0,0x0f,0xf0,0x03,0x3c,0x00,0xdc,0x00 }},
+ {16, 0xf460, 0, {0x31,0xc0,0x8d,0xf8,0x03,0xfe,0x04,0xcf,0x00,0x32,0xc8,0x0c,0xf0,0x0b,0x1c,0x00 }},
+ {16, 0xf470, 0, {0xcf,0x93,0x33,0xc0,0x8c,0x40,0x02,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf480, 0, {0x81,0x04,0x6c,0x00,0xbb,0x00,0xa2,0x04,0x0b,0x30,0x02,0x0e,0x00,0xab,0x00,0x2a }},
+ {16, 0xf490, 0, {0xc0,0x09,0xb0,0x03,0x6c,0x08,0xa8,0xc0,0x36,0xc0,0x08,0xbc,0x02,0xef,0x02,0xab }},
+ {16, 0xf4a0, 0, {0xd0,0x20,0xe0,0x08,0xb8,0x22,0x26,0x10,0x8b,0x00,0x22,0xc0,0x20,0x9c,0x02,0x20 }},
+ {16, 0xf4b0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0xbb,0x00,0x26,0x00 }},
+ {16, 0xf4c0, 0, {0x0a,0xb0,0x02,0xa2,0x08,0xab,0x00,0x6a,0xc0,0x0b,0xb0,0x0a,0x0c,0x00,0x8b,0x80 }},
+ {16, 0xf4d0, 0, {0x22,0xc0,0x09,0xb1,0x02,0xec,0x40,0x88,0x08,0x22,0xc0,0x08,0xb8,0x02,0x26,0x00 }},
+ {16, 0xf4e0, 0, {0x8b,0x00,0x22,0xc0,0x08,0x98,0x02,0xa0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf4f0, 0, {0x08,0x04,0x0c,0x00,0xb3,0x00,0x24,0x00,0x0b,0xb0,0x02,0x00,0x01,0x83,0x00,0x20 }},
+ {16, 0xf500, 0, {0xc0,0x09,0x30,0x02,0x4c,0x00,0x00,0x04,0x24,0xc0,0x08,0x30,0x06,0x4c,0x00,0x80 }},
+ {16, 0xf510, 0, {0x00,0x2c,0xc0,0x08,0x00,0x02,0x00,0x41,0x83,0x00,0xa2,0xc0,0x08,0x10,0x0a,0x82 }},
+ {16, 0xf520, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x7c,0x00,0xef,0x08,0x26,0x00 }},
+ {16, 0xf530, 0, {0x0e,0xf0,0x02,0xa0,0x00,0xe7,0x00,0x3b,0xc0,0x0f,0xf5,0x43,0x3c,0x02,0xda,0x00 }},
+ {16, 0xf540, 0, {0x32,0xc0,0x0d,0xb0,0x03,0xec,0x00,0xcb,0x00,0xb2,0xc0,0x0c,0xa0,0x03,0x28,0x10 }},
+ {16, 0xf550, 0, {0xcb,0x00,0x32,0xc0,0x0c,0x80,0x03,0x80,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf560, 0, {0xa0,0x0d,0xfc,0x00,0xfb,0x00,0x3b,0x00,0x0f,0xf0,0x03,0xf0,0x00,0xff,0x02,0x3f }},
+ {16, 0xf570, 0, {0xc0,0x0d,0xf2,0x03,0xbc,0x00,0xf4,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0xfc,0x00,0xf7 }},
+ {16, 0xf580, 0, {0x00,0x33,0xc0,0x0f,0x60,0x03,0xf0,0x88,0xff,0x00,0x3f,0xc0,0x4f,0xd0,0x03,0x68 }},
+ {16, 0xf590, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfc,0x40,0xfc,0x31,0x3b,0x08 }},
+ {16, 0xf5a0, 0, {0x4f,0xf9,0x43,0xef,0x00,0xdf,0x30,0x32,0x21,0x0f,0x94,0x07,0x7d,0x80,0xef,0x38 }},
+ {16, 0xf5b0, 0, {0x32,0x09,0x1c,0x38,0x03,0xf2,0x21,0xfd,0x00,0x33,0xc4,0x0c,0xf0,0x02,0xfc,0x00 }},
+ {16, 0xf5c0, 0, {0xdf,0x00,0x33,0xc0,0x0f,0xf0,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf5d0, 0, {0x80,0x10,0xec,0x88,0x8b,0x60,0x22,0xe5,0x0e,0xb2,0x22,0xec,0x80,0xaf,0x11,0x2a }},
+ {16, 0xf5e0, 0, {0x20,0x0b,0xb1,0x13,0xac,0x48,0x8b,0x45,0x34,0xcc,0x48,0xb0,0x02,0x6b,0x00,0xba }},
+ {16, 0xf5f0, 0, {0x82,0x36,0x00,0x08,0x88,0x22,0xc0,0x04,0x88,0x00,0xa2,0x08,0x8b,0x88,0x62,0x20 }},
+ {16, 0xf600, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x00,0xa1,0x30,0x28,0x00 }},
+ {16, 0xf610, 0, {0x0b,0x32,0x02,0xcc,0x00,0xa3,0x22,0x2c,0x00,0x8b,0x12,0x06,0xc8,0x80,0xa3,0x00 }},
+ {16, 0xf620, 0, {0x20,0x02,0xca,0x30,0x06,0xc4,0x01,0xb1,0x00,0x68,0x80,0x09,0x20,0x02,0x88,0x00 }},
+ {16, 0xf630, 0, {0x83,0x00,0x20,0xc2,0x0b,0x00,0x0a,0xa2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf640, 0, {0xc0,0x15,0xac,0x00,0x8b,0x61,0x62,0xc0,0x0b,0xb2,0x02,0xe8,0x00,0xab,0x02,0x2a }},
+ {16, 0xf650, 0, {0x61,0x1b,0x90,0x02,0xa8,0x00,0xab,0x00,0x20,0xc0,0x0a,0xb0,0x02,0x6c,0x04,0xba }},
+ {16, 0xf660, 0, {0x00,0x2e,0x40,0x89,0x90,0x02,0xe6,0x08,0x98,0x00,0x22,0x00,0x0b,0xb0,0x02,0xb0 }},
+ {16, 0xf670, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xee,0x00,0xf8,0x01,0x3a,0x04 }},
+ {16, 0xf680, 0, {0x0f,0xac,0x03,0xec,0x90,0xfb,0x02,0x3e,0xe0,0x0b,0x90,0x42,0x67,0x80,0xa8,0xc4 }},
+ {16, 0xf690, 0, {0x22,0x48,0x22,0x86,0x03,0xe1,0x40,0xb8,0x02,0x2a,0x40,0x29,0x90,0x03,0xec,0x02 }},
+ {16, 0xf6a0, 0, {0xc9,0x48,0x32,0x40,0x0f,0xb0,0x13,0x90,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf6b0, 0, {0xe0,0x01,0xac,0x40,0xfb,0x00,0x1f,0xa2,0x0e,0xf8,0x82,0xfc,0x08,0xff,0x00,0x3f }},
+ {16, 0xf6c0, 0, {0xc0,0x0f,0xfa,0x43,0x96,0x44,0xd4,0x91,0x3f,0x40,0x0d,0xc0,0x03,0xfa,0x00,0xff }},
+ {16, 0xf6d0, 0, {0x08,0x25,0x80,0x0e,0xe0,0x03,0xd0,0x00,0xea,0x00,0x3f,0x80,0x0f,0xc0,0x03,0x78 }},
+ {16, 0xf6e0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xe1,0x20,0x3a,0x50 }},
+ {16, 0xf6f0, 0, {0x0f,0x90,0x03,0x2c,0x00,0xeb,0x08,0x76,0x05,0x0e,0xb0,0x27,0xe0,0x10,0xea,0x40 }},
+ {16, 0xf700, 0, {0xb2,0xc0,0x0c,0xa4,0x43,0x25,0x00,0xf8,0x00,0x32,0x08,0x0f,0x80,0x43,0xe8,0x00 }},
+ {16, 0xf710, 0, {0xd1,0x08,0xee,0x40,0x0f,0x00,0x03,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf720, 0, {0xc8,0x05,0x2c,0x00,0x8b,0x00,0x22,0xd0,0x0b,0x90,0x82,0x2c,0x00,0x87,0x40,0x22 }},
+ {16, 0xf730, 0, {0x60,0x8b,0xb0,0x02,0xe0,0x00,0xd8,0x50,0x22,0xd0,0x0c,0xa0,0x03,0x6c,0x00,0xb3 }},
+ {16, 0xf740, 0, {0xc8,0x3e,0xd0,0x0b,0xb8,0x02,0x25,0x08,0x8a,0x20,0x2a,0x80,0x8b,0xb8,0x82,0xf2 }},
+ {16, 0xf750, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x64,0x00,0xa0,0xc0,0x24,0xc0 }},
+ {16, 0xf760, 0, {0x09,0x38,0x02,0x2c,0x00,0x83,0x03,0x20,0x00,0x10,0x30,0x22,0xcc,0x00,0x83,0x00 }},
+ {16, 0xf770, 0, {0x60,0x08,0x0a,0x30,0x82,0x4c,0x00,0xb1,0xc0,0x00,0xd1,0x0b,0x38,0x02,0x84,0x80 }},
+ {16, 0xf780, 0, {0x82,0x01,0x20,0x80,0x03,0x38,0x02,0xf8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf790, 0, {0x20,0x01,0x16,0x40,0x84,0x98,0x25,0xe0,0x0b,0x7a,0x02,0xfa,0x48,0xa3,0x20,0x61 }},
+ {16, 0xf7a0, 0, {0x24,0x0b,0x79,0x00,0xce,0xc0,0x93,0xa4,0x21,0xa6,0x0b,0x78,0x12,0xde,0x80,0xb6 }},
+ {16, 0xf7b0, 0, {0x80,0x2d,0x24,0x0b,0x4b,0x02,0x1a,0x40,0x85,0x81,0x21,0x60,0x0b,0x48,0x02,0xc8 }},
+ {16, 0xf7c0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0xe2,0xa0,0xb4,0xfe }},
+ {16, 0xf7d0, 0, {0x4b,0xb8,0x0b,0x0e,0x00,0xa3,0xb0,0x24,0xa8,0x0e,0x1b,0x02,0xce,0xc1,0xc3,0xc0 }},
+ {16, 0xf7e0, 0, {0x30,0x68,0x2e,0x3a,0x47,0x4e,0x80,0xf1,0x80,0x30,0x80,0x0f,0x22,0x83,0x80,0x00 }},
+ {16, 0xf7f0, 0, {0xc2,0x10,0x38,0x80,0x4f,0x00,0x07,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf800, 0, {0x40,0x0d,0xbc,0x10,0xfe,0x04,0x3b,0xc1,0x07,0xf0,0x03,0x1c,0xc8,0xdf,0x2a,0x0b }},
+ {16, 0xf810, 0, {0xc4,0x8f,0xd1,0x43,0xf8,0x02,0x7f,0x00,0x3f,0xc0,0x0c,0xf1,0x0f,0x3c,0x00,0xf2 }},
+ {16, 0xf820, 0, {0x11,0x3f,0x41,0x1f,0x52,0x03,0xbc,0x0e,0xed,0x14,0x3f,0x40,0x0f,0xf8,0x03,0xd0 }},
+ {16, 0xf830, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xe4,0x00,0xe9,0x00,0x32,0x80 }},
+ {16, 0xf840, 0, {0x0e,0xbe,0x4b,0x6f,0x00,0xcb,0x82,0x7a,0xc0,0x2c,0xb0,0x03,0x2c,0x00,0xc9,0x00 }},
+ {16, 0xf850, 0, {0x32,0x00,0x2c,0x10,0x03,0x2c,0x08,0xc0,0x00,0x26,0x40,0x6c,0x90,0x13,0x24,0x12 }},
+ {16, 0xf860, 0, {0xc8,0x01,0x3e,0x00,0x0f,0xb8,0x0b,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf870, 0, {0x48,0x11,0x94,0x00,0x8d,0x00,0x21,0x80,0x0b,0x70,0x82,0x3c,0x20,0x83,0x32,0x29 }},
+ {16, 0xf880, 0, {0xc0,0x08,0xf0,0x20,0x14,0x00,0x80,0x00,0x23,0x00,0x08,0x50,0x06,0x9c,0x04,0xd7 }},
+ {16, 0xf890, 0, {0x02,0x28,0x80,0x08,0x60,0x02,0x08,0x10,0x87,0x00,0x2d,0xc0,0x0b,0x40,0x02,0x12 }},
+ {16, 0xf8a0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x00,0xa7,0x80,0x21,0xe0 }},
+ {16, 0xf8b0, 0, {0x0b,0x5c,0x12,0x1e,0x04,0x87,0x82,0x0d,0xa0,0x09,0x78,0x16,0x02,0x00,0xb4,0x80 }},
+ {16, 0xf8c0, 0, {0x25,0xe0,0x0b,0x78,0x02,0x9e,0x00,0x84,0x80,0x21,0x22,0x08,0x08,0x02,0x12,0x01 }},
+ {16, 0xf8d0, 0, {0x84,0xc0,0x2d,0x20,0x0b,0x08,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf8e0, 0, {0x48,0x14,0xcc,0x00,0x83,0x42,0xa0,0xd8,0x0b,0x34,0x82,0x0c,0x00,0xa3,0x02,0x20 }},
+ {16, 0xf8f0, 0, {0xe0,0x08,0xb0,0x02,0x0c,0x88,0xb3,0x21,0x24,0xd8,0x0b,0x3e,0x02,0x8c,0x00,0x93 }},
+ {16, 0xf900, 0, {0x08,0x28,0xc0,0x08,0x38,0x02,0x2c,0x05,0x8b,0x01,0x2c,0xe0,0x0b,0x30,0x02,0x12 }},
+ {16, 0xf910, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x00,0xee,0x00,0x33,0x90 }},
+ {16, 0xf920, 0, {0x0f,0xa0,0x0b,0x68,0x00,0xca,0x01,0x7f,0xa8,0x0c,0xaa,0x03,0x3a,0x12,0xfe,0xe2 }},
+ {16, 0xf930, 0, {0x37,0xb0,0x0f,0xee,0x02,0x18,0x00,0xca,0x40,0x36,0xa0,0x08,0xa0,0x8b,0x28,0x00 }},
+ {16, 0xf940, 0, {0xca,0x81,0x2e,0xa0,0x0f,0xe0,0x03,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf950, 0, {0x48,0x00,0xe0,0x00,0xf8,0x08,0x3e,0x00,0x0f,0x80,0x03,0xa2,0x02,0xd8,0x40,0x3e }},
+ {16, 0xf960, 0, {0x08,0x0f,0x80,0x13,0xe0,0x40,0x48,0x40,0xb8,0x04,0x08,0x84,0x03,0x61,0x00,0xfc }},
+ {16, 0xf970, 0, {0x00,0x3f,0x00,0x4f,0xc0,0x03,0xf1,0x00,0xfc,0x00,0x3f,0x04,0x0f,0xc0,0x03,0xd2 }},
+ {16, 0xf980, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xc4,0x00,0xf9,0x00,0x30,0x50 }},
+ {16, 0xf990, 0, {0x4c,0xb9,0x03,0x6c,0x18,0xf9,0x00,0x36,0x40,0x0e,0x9c,0x23,0xa4,0x02,0x41,0x00 }},
+ {16, 0xf9a0, 0, {0xb2,0x44,0x0e,0x9a,0x03,0xa6,0x80,0xc9,0x00,0x3a,0x60,0x0a,0x90,0x03,0xa4,0x80 }},
+ {16, 0xf9b0, 0, {0xc9,0x00,0x34,0x40,0x0c,0x90,0x03,0xc2,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf9c0, 0, {0x80,0x04,0x64,0x00,0x89,0x40,0x22,0x78,0x08,0x94,0x02,0xe4,0x10,0xb9,0x00,0x3c }},
+ {16, 0xf9d0, 0, {0x62,0x18,0x94,0x82,0xa4,0x00,0x89,0xc8,0x22,0x70,0x48,0x1e,0x01,0x67,0x80,0xd1 }},
+ {16, 0xf9e0, 0, {0x00,0xbc,0x42,0x08,0x10,0x02,0x25,0x20,0x89,0x02,0x22,0x40,0x08,0x90,0x02,0xe0 }},
+ {16, 0xf9f0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0xb1,0x28,0x22,0x40 }},
+ {16, 0xfa00, 0, {0x08,0xb0,0x82,0x64,0x04,0x39,0x41,0x2e,0x48,0x0a,0x90,0x02,0x04,0x18,0xa9,0x20 }},
+ {16, 0xfa10, 0, {0x22,0x42,0x4a,0x90,0x02,0x2c,0x04,0x89,0x04,0x2b,0x48,0x02,0xd0,0x02,0xb4,0x0a }},
+ {16, 0xfa20, 0, {0x8d,0x80,0x23,0xc0,0x48,0xd0,0x02,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfa30, 0, {0x08,0x04,0x04,0x80,0x81,0x20,0xa0,0x48,0x28,0x10,0x02,0xc4,0x00,0xb1,0x24,0x2a }},
+ {16, 0xfa40, 0, {0x40,0x08,0x12,0x42,0x85,0x80,0xa1,0x20,0xa0,0x48,0x08,0x90,0x02,0x44,0x00,0x95 }},
+ {16, 0xfa50, 0, {0x2c,0x2d,0x5a,0x0a,0x72,0x82,0x14,0xa0,0x85,0xa8,0x21,0x4a,0x08,0x52,0x82,0xc2 }},
+ {16, 0xfa60, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x41,0x40,0xf8,0x50,0x32,0x00 }},
+ {16, 0xfa70, 0, {0x8c,0x05,0x03,0x61,0x40,0xf8,0x51,0x2e,0x00,0x0a,0x85,0x02,0x20,0x00,0xe8,0x50 }},
+ {16, 0xfa80, 0, {0x32,0x14,0x06,0x85,0x17,0xa0,0x00,0xc8,0x20,0x3a,0x08,0x0e,0x82,0x03,0xa0,0x80 }},
+ {16, 0xfa90, 0, {0xc8,0x20,0x32,0x08,0x2c,0xc2,0x03,0xee,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfaa0, 0, {0x98,0x19,0xf4,0x40,0xff,0x10,0x3f,0x44,0x0b,0xb0,0x03,0xe4,0x00,0xf9,0x10,0x3d }},
+ {16, 0xfab0, 0, {0x40,0x0f,0xd1,0x03,0xf4,0x58,0x9d,0x10,0x3f,0x44,0x4f,0xd0,0x03,0xd5,0x00,0xf9 }},
+ {16, 0xfac0, 0, {0x00,0x3e,0x40,0x8d,0x90,0x03,0xe4,0xb8,0xf9,0x28,0xba,0x6a,0x0f,0x90,0x03,0xe6 }},
+ {16, 0xfad0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0xe7,0x00,0xfd,0x88,0x3e,0x60 }},
+ {16, 0xfae0, 0, {0x8f,0xd0,0x03,0x24,0x01,0xdd,0x80,0x73,0x40,0x0f,0xd8,0x03,0xa6,0x04,0xcd,0xa2 }},
+ {16, 0xfaf0, 0, {0x33,0x78,0x1c,0xd0,0x03,0x34,0x01,0xf5,0x88,0x3b,0x68,0x0c,0xda,0x47,0x37,0x80 }},
+ {16, 0xfb00, 0, {0xcd,0x88,0x32,0x62,0x0c,0xda,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfb10, 0, {0x38,0x10,0xe3,0x80,0xb8,0x80,0x2e,0x14,0x0b,0x0a,0x82,0x22,0x80,0xb8,0xf8,0xa2 }},
+ {16, 0xfb20, 0, {0x00,0x0b,0x8f,0xa3,0x83,0xe0,0x88,0xeb,0x22,0xa9,0x08,0x88,0x12,0xa0,0x05,0xb8 }},
+ {16, 0xfb30, 0, {0x00,0x2a,0xaa,0x88,0x80,0x13,0x62,0x82,0x88,0x80,0x22,0x28,0x88,0xa4,0x02,0x0e }},
+ {16, 0xfb40, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc5,0x00,0xb1,0x0a,0x2c,0x41 }},
+ {16, 0xfb50, 0, {0x0b,0x10,0x06,0x04,0x20,0xa1,0x00,0x00,0x40,0x8b,0x10,0x46,0xc4,0x01,0x91,0x11 }},
+ {16, 0xfb60, 0, {0x24,0x58,0x68,0x90,0xc2,0x04,0x00,0xb1,0x00,0xa8,0x50,0x09,0x14,0x0a,0x05,0x95 }},
+ {16, 0xfb70, 0, {0xa1,0x08,0xa0,0x42,0x28,0x11,0x0a,0x02,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfb80, 0, {0x18,0x15,0xa4,0x18,0xb9,0x20,0x2e,0x50,0x0b,0x90,0x06,0x24,0x09,0xb9,0x00,0x22 }},
+ {16, 0xfb90, 0, {0x40,0x8b,0x91,0x02,0x84,0x00,0x99,0x64,0x24,0x40,0x58,0x90,0x02,0xa4,0x20,0xbb }},
+ {16, 0xfba0, 0, {0x00,0x2a,0x40,0x09,0xb0,0x02,0x05,0x01,0xa9,0x00,0x22,0x40,0x88,0x92,0x02,0x06 }},
+ {16, 0xfbb0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe6,0x00,0xf9,0x40,0x3e,0x40 }},
+ {16, 0xfbc0, 0, {0x4f,0x98,0x0b,0x24,0x80,0xd9,0x00,0x22,0x72,0x0b,0x98,0x03,0xe4,0x84,0xd9,0x00 }},
+ {16, 0xfbd0, 0, {0xb6,0x70,0x08,0x99,0x02,0x24,0x00,0xb9,0x00,0x2a,0x40,0x0d,0x94,0xc2,0x25,0x00 }},
+ {16, 0xfbe0, 0, {0xa9,0x00,0x22,0x40,0x0c,0x94,0x03,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfbf0, 0, {0x28,0x01,0xa6,0x80,0xf9,0x08,0x3e,0xc0,0x0f,0x91,0x43,0xe4,0x00,0xf9,0x00,0x3e }},
+ {16, 0xfc00, 0, {0x50,0x0f,0x98,0x03,0xa5,0x00,0xe9,0x00,0x3a,0x64,0x0f,0x90,0x03,0xe4,0x00,0xf9 }},
+ {16, 0xfc10, 0, {0x00,0x3c,0x40,0x6e,0x90,0x03,0xe4,0x20,0xd9,0x00,0x3c,0x40,0x0f,0x90,0x82,0xca }},
+ {16, 0xfc20, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xe8,0x00,0x3e,0x00 }},
+ {16, 0xfc30, 0, {0x4f,0x84,0x0b,0x20,0x00,0xf8,0x00,0x36,0x01,0x0e,0x80,0x03,0xe0,0x00,0xc8,0x40 }},
+ {16, 0xfc40, 0, {0x32,0x10,0x2d,0x80,0x03,0xe0,0x54,0xc8,0x00,0x36,0x10,0x0f,0x04,0x83,0xe0,0x50 }},
+ {16, 0xfc50, 0, {0xd8,0x04,0x12,0x00,0x0c,0x00,0x0b,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfc60, 0, {0x28,0x05,0x28,0x00,0x8e,0x42,0x2e,0xa2,0x8b,0xea,0x02,0x28,0x08,0xbe,0x89,0x37 }},
+ {16, 0xfc70, 0, {0x84,0x48,0xe0,0x12,0x28,0x02,0x8e,0xc0,0x23,0xb0,0x4d,0x60,0x62,0xf8,0x00,0x86 }},
+ {16, 0xfc80, 0, {0x00,0x23,0x80,0x0b,0xe0,0x02,0xf8,0x00,0x0e,0x00,0x22,0x80,0x08,0xe4,0x02,0x0a }},
+ {16, 0xfc90, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0xa3,0x00,0x2c,0x80 }},
+ {16, 0xfca0, 0, {0x1b,0xb0,0x9a,0x4c,0x10,0x9b,0x80,0x24,0xc0,0x0a,0x30,0x00,0x0c,0x04,0x9b,0x20 }},
+ {16, 0xfcb0, 0, {0x20,0xd6,0x08,0x30,0x02,0x8e,0x08,0xa3,0x04,0x24,0xc0,0x19,0x34,0x02,0xc7,0x07 }},
+ {16, 0xfcc0, 0, {0xaa,0xa4,0xa0,0xc0,0x48,0x34,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfcd0, 0, {0xa0,0x01,0x0e,0x00,0x87,0x00,0x2d,0xc0,0x0b,0x40,0x02,0x5c,0x40,0xb3,0x14,0x25 }},
+ {16, 0xfce0, 0, {0xe0,0x08,0x7a,0x02,0x9e,0xc0,0x92,0x40,0xa0,0x00,0x49,0x60,0x02,0xce,0x02,0x8e }},
+ {16, 0xfcf0, 0, {0x01,0x21,0xc0,0x8b,0x54,0x02,0xc4,0x08,0x86,0x40,0x21,0xc8,0x88,0x10,0x02,0x28 }},
+ {16, 0xfd00, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0xc0,0xe4,0x80,0x3d,0xe2 }},
+ {16, 0xfd10, 0, {0x0f,0x58,0x03,0x5e,0x90,0xb6,0xa2,0x35,0xe0,0x0e,0x7c,0x23,0x1c,0x00,0xd6,0x80 }},
+ {16, 0xfd20, 0, {0x31,0xe0,0x84,0x78,0x03,0xde,0x00,0xc7,0x80,0x35,0xe0,0x0f,0x68,0x03,0xde,0x00 }},
+ {16, 0xfd30, 0, {0xe3,0x80,0x33,0xe8,0x2c,0x78,0x03,0x2a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfd40, 0, {0x08,0x1d,0xac,0x90,0xfa,0x00,0x7e,0x40,0x0f,0x90,0x03,0xac,0x01,0xfb,0x00,0x3c }},
+ {16, 0xfd50, 0, {0x41,0x0f,0x30,0x0b,0x2d,0x04,0xeb,0x01,0x3e,0xc0,0x0e,0xb0,0x03,0xec,0x00,0xfa }},
+ {16, 0xfd60, 0, {0x00,0x3f,0xc0,0x0f,0x80,0x03,0xec,0x00,0xe9,0x60,0x3e,0xe4,0x0f,0x90,0x03,0xc2 }},
+ {16, 0xfd70, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xfe,0x20,0xff,0x90,0x3e,0x20 }},
+ {16, 0xfd80, 0, {0x0c,0xa9,0x07,0x2e,0x44,0xc9,0x91,0x30,0xa0,0x0c,0xb8,0x63,0x2f,0x44,0xcb,0xa1 }},
+ {16, 0xfd90, 0, {0x36,0x20,0x8c,0xf8,0x03,0x36,0x00,0xcf,0x82,0x33,0xe0,0x0c,0xf8,0x23,0x2e,0x00 }},
+ {16, 0xfda0, 0, {0xce,0xc0,0x3b,0xe0,0x0c,0x68,0x03,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfdb0, 0, {0xa8,0x11,0x9c,0x84,0xb3,0x54,0x2c,0xf4,0x28,0xba,0x8a,0x3e,0x40,0x81,0xa0,0x29 }},
+ {16, 0xfdc0, 0, {0xb0,0x0f,0x78,0x42,0xae,0x00,0x83,0x90,0x33,0xe8,0x0d,0xe1,0x00,0x85,0x40,0x82 }},
+ {16, 0xfdd0, 0, {0x24,0x23,0xc6,0x0d,0x71,0x03,0x5e,0xe0,0x87,0x00,0x2b,0xc1,0x0d,0x44,0x02,0x2a }},
+ {16, 0xfde0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x08,0x35,0x14,0x6d,0xc0 }},
+ {16, 0xfdf0, 0, {0x88,0x72,0x32,0x5c,0x80,0x84,0x30,0x2b,0x88,0x0a,0x70,0x42,0x5c,0xa8,0x91,0x08 }},
+ {16, 0xfe00, 0, {0x25,0xc8,0x09,0x70,0x02,0x4c,0x22,0x83,0x0a,0x61,0xc0,0x09,0x20,0x02,0x04,0x00 }},
+ {16, 0xfe10, 0, {0x87,0x00,0x21,0xc0,0x08,0x60,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfe20, 0, {0x20,0x14,0xcc,0x10,0xb3,0x85,0x6c,0xdc,0x08,0x34,0x02,0x4d,0x21,0x81,0x00,0x28 }},
+ {16, 0xfe30, 0, {0x02,0x4a,0x31,0x12,0xef,0x0c,0x91,0xc2,0x20,0xf0,0x08,0x30,0x42,0x8e,0x00,0x82 }},
+ {16, 0xfe40, 0, {0x40,0x20,0xc8,0x19,0x28,0x02,0x22,0x81,0x83,0xc0,0x28,0xd4,0x09,0x00,0x0a,0x08 }},
+ {16, 0xfe50, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xbc,0x00,0xfb,0xa0,0x3e,0xc0 }},
+ {16, 0xfe60, 0, {0x8c,0x04,0x12,0x7d,0x10,0xcf,0x02,0x3a,0x50,0x08,0xc0,0x42,0x7d,0x52,0x58,0x01 }},
+ {16, 0xfe70, 0, {0x36,0x22,0x69,0xd0,0x13,0x2a,0x00,0x88,0x82,0x32,0xf0,0x09,0xb8,0x82,0x2f,0x00 }},
+ {16, 0xfe80, 0, {0xc9,0xc8,0x23,0xc0,0x0c,0x8a,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfe90, 0, {0x80,0x00,0xec,0x00,0xb9,0x40,0x3c,0x50,0x4f,0x80,0x23,0xac,0x12,0xfb,0x00,0x2a }},
+ {16, 0xfea0, 0, {0xc0,0x6d,0x80,0x13,0xac,0x00,0xe8,0x04,0xba,0x10,0x0f,0x80,0x03,0xe8,0x00,0xf3 }},
+ {16, 0xfeb0, 0, {0x08,0x3c,0x80,0x0f,0x90,0x83,0xec,0x04,0xf9,0x60,0x2c,0xc2,0x0f,0x80,0x83,0xe0 }},
+ {16, 0xfec0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xdc,0x00,0xec,0x2c,0x3f,0xf0 }},
+ {16, 0xfed0, 0, {0x8c,0xfa,0x8b,0xbc,0x00,0xfe,0x00,0x3f,0x00,0x0f,0x79,0x03,0x3c,0x00,0xce,0x08 }},
+ {16, 0xfee0, 0, {0x0b,0xc2,0x0c,0xf0,0x03,0xbc,0x00,0xfc,0x00,0x33,0x40,0x8c,0x7a,0x03,0x3a,0x00 }},
+ {16, 0xfef0, 0, {0xc5,0x00,0x33,0xc0,0x4c,0xc8,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xff00, 0, {0x81,0x04,0x6c,0x00,0x88,0xc0,0x2e,0xe0,0x08,0x94,0x02,0x2c,0x00,0xbb,0x80,0x66 }},
+ {16, 0xff10, 0, {0x30,0x16,0xb0,0x02,0x2c,0x00,0xda,0x4c,0x22,0xf0,0x08,0xf0,0x03,0xec,0x00,0xeb }},
+ {16, 0xff20, 0, {0xc0,0x22,0x68,0x00,0x94,0x02,0x2c,0x02,0xa9,0x80,0x22,0xc0,0x08,0x0c,0x02,0xa0 }},
+ {16, 0xff30, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0xab,0x04,0x2e,0xc0 }},
+ {16, 0xff40, 0, {0x08,0xa4,0x06,0x2c,0x04,0xab,0x10,0x2e,0x60,0x43,0x80,0x82,0x6c,0x01,0x81,0x80 }},
+ {16, 0xff50, 0, {0x28,0x0a,0x08,0x91,0x00,0xe0,0x00,0xb8,0x80,0x02,0xe0,0x08,0x80,0x02,0x2d,0x80 }},
+ {16, 0xff60, 0, {0x88,0xc0,0x22,0xc0,0x08,0x82,0x02,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xff70, 0, {0x08,0x04,0x0c,0x00,0x80,0x44,0x2c,0xc8,0x28,0xa0,0x22,0x0c,0x04,0xb3,0x26,0x2c }},
+ {16, 0xff80, 0, {0xc8,0x88,0x01,0x06,0x0c,0xe0,0x91,0x20,0x20,0x0c,0x38,0x04,0x22,0xc0,0x48,0xa3 }},
+ {16, 0xff90, 0, {0x42,0xa0,0x81,0x08,0x00,0x02,0x0c,0x80,0x81,0x00,0x20,0xc0,0x28,0x00,0x02,0x82 }},
+ {16, 0xffa0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x7c,0x00,0xa9,0x40,0x3e,0x44 }},
+ {16, 0xffb0, 0, {0x08,0xb1,0x03,0x2c,0x40,0xea,0x49,0x2e,0x0d,0x0b,0xb6,0x13,0x7d,0x80,0xc9,0x40 }},
+ {16, 0xffc0, 0, {0xba,0xd0,0x0c,0xb4,0x03,0xac,0x00,0xf8,0x00,0x32,0x40,0x0c,0x80,0x0b,0x20,0x00 }},
+ {16, 0xffd0, 0, {0xc5,0x00,0xb2,0xc0,0x0c,0x80,0x03,0x00,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xffe0, 0, {0xa0,0x1d,0xfc,0x04,0xfc,0x00,0x3d,0xc5,0x0b,0xf1,0x00,0xfc,0xd0,0x77,0x29,0x37 }},
+ {16, 0xfff0, 0, {0x0c,0x8e,0x74,0x03,0xfc,0x08,0xfd,0x69,0x3f,0xd8,0x0f,0xf0,0x03,0xbc,0x00,0xef }},
+ {16, 0x8010, 0, {0x00,0x3f,0x40,0x07,0xc0,0x03,0xf0,0x40,0xfd,0x00,0x3f,0xc0,0x0f,0xc0,0x03,0xe8 }},
+ {16, 0x8020, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x0d,0xfc,0xc0,0xdc,0x80,0x3f,0xc8 }},
+ {16, 0x8030, 0, {0x0f,0x48,0x03,0x7c,0x20,0xff,0x68,0x37,0xe0,0x0e,0xf1,0x03,0x9c,0x00,0xbf,0x20 }},
+ {16, 0x8040, 0, {0x37,0xe0,0x0c,0xc8,0x13,0x3c,0x40,0xed,0x60,0xbb,0xe4,0x2c,0x43,0x4b,0x70,0xa0 }},
+ {16, 0x8050, 0, {0xcc,0x2c,0x3f,0x09,0x0f,0xd8,0x43,0x70,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8060, 0, {0x80,0x00,0xed,0xc0,0xb8,0x80,0x2f,0xf4,0x0f,0x98,0x02,0x3f,0x00,0xbf,0x42,0x22 }},
+ {16, 0x8070, 0, {0xca,0x08,0xf4,0x02,0x3e,0x00,0xbf,0xd0,0x22,0x60,0x28,0x88,0x0a,0x3d,0x80,0x8d }},
+ {16, 0x8080, 0, {0x40,0x22,0xc8,0x08,0x81,0x02,0x21,0x80,0xdb,0xc0,0x2e,0xa5,0x0b,0x98,0x42,0x20 }},
+ {16, 0x8090, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x10,0xb0,0x00,0x2c,0xc0 }},
+ {16, 0x80a0, 0, {0x0b,0x20,0x02,0xcc,0x00,0xb3,0x20,0x26,0xc0,0x8a,0x36,0x12,0x8c,0x41,0xb3,0x00 }},
+ {16, 0x80b0, 0, {0x2e,0x40,0x08,0x00,0x02,0x0d,0x81,0xa1,0x30,0x22,0xc8,0x89,0xa2,0x42,0x08,0x20 }},
+ {16, 0x80c0, 0, {0xb0,0x00,0x2c,0x40,0x0b,0x90,0x26,0x62,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x80d0, 0, {0xc0,0x15,0xac,0x00,0xb8,0x50,0x2e,0xc0,0x0a,0x90,0x02,0xac,0x00,0xbb,0x00,0x22 }},
+ {16, 0x80e0, 0, {0xc0,0x08,0xb0,0x62,0x2c,0x10,0xbb,0x04,0x2a,0xf0,0x4a,0x88,0x02,0x0c,0x00,0x81 }},
+ {16, 0x80f0, 0, {0x00,0x22,0xc0,0x09,0xb8,0x80,0x26,0x00,0xb8,0x80,0x2e,0x21,0x0b,0x90,0x02,0x30 }},
+ {16, 0x8100, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x15,0xec,0x00,0xd8,0xc0,0x3e,0xc0 }},
+ {16, 0x8110, 0, {0x0b,0x80,0x03,0xec,0x00,0xfb,0x00,0x36,0x80,0x0e,0xb0,0x03,0xac,0x00,0xfb,0x00 }},
+ {16, 0x8120, 0, {0x3c,0xe0,0x0c,0x0c,0x03,0x2c,0x00,0xe9,0x00,0x10,0xc0,0x0c,0x8c,0x03,0x06,0x00 }},
+ {16, 0x8130, 0, {0xf8,0xcd,0x3e,0x22,0x0f,0x18,0x03,0x40,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8140, 0, {0xe0,0x01,0xbc,0x00,0xff,0x00,0x3e,0xc0,0x0f,0xf0,0x03,0x7c,0x00,0xf7,0x02,0x3f }},
+ {16, 0x8150, 0, {0xe4,0x0f,0x70,0x03,0x7c,0x04,0xb7,0x00,0x37,0x40,0x0d,0xc0,0x03,0xfc,0x00,0xfd }},
+ {16, 0x8160, 0, {0x00,0x37,0xd0,0x0e,0xc0,0x43,0xf4,0x00,0xdf,0x00,0x3f,0x80,0x8f,0xda,0x03,0xf8 }},
+ {16, 0x8170, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xf8,0x10,0x3a,0xc0 }},
+ {16, 0x8180, 0, {0x6d,0xa6,0x13,0xec,0x00,0xcb,0x00,0x3a,0xd0,0x0f,0xb0,0x03,0x2c,0x10,0xdb,0x10 }},
+ {16, 0x8190, 0, {0x36,0xd8,0x0d,0x84,0x03,0xec,0x06,0xc9,0x08,0x3a,0xc0,0x0e,0x86,0x03,0xa8,0x60 }},
+ {16, 0x81a0, 0, {0xf8,0x20,0x3a,0x40,0x0c,0x90,0x03,0x54,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x81b0, 0, {0x98,0x05,0x3c,0x00,0xbb,0x40,0x23,0xd0,0x08,0x30,0x02,0x3e,0x10,0xaf,0x00,0x20 }},
+ {16, 0x81c0, 0, {0xc0,0x0b,0xf0,0x02,0x3c,0x00,0x8f,0x50,0x2e,0xc8,0x06,0x8a,0x02,0xfc,0x00,0x8d }},
+ {16, 0x81d0, 0, {0x24,0x82,0xd6,0x08,0x32,0x02,0x2d,0x08,0x3a,0x40,0x22,0x80,0x0d,0x90,0x03,0x62 }},
+ {16, 0x81e0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x05,0x4c,0x00,0xb0,0x20,0x28,0xc2 }},
+ {16, 0x81f0, 0, {0x08,0x04,0x02,0x8c,0x00,0x13,0x02,0x28,0xc0,0x0b,0x30,0x02,0x0c,0x30,0x93,0x80 }},
+ {16, 0x8200, 0, {0x24,0xd0,0x09,0x20,0x02,0xcc,0x00,0x91,0x40,0x08,0xc0,0x2a,0x14,0x02,0x81,0x00 }},
+ {16, 0x8210, 0, {0x90,0x00,0x68,0x00,0x08,0x18,0x02,0x3a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8220, 0, {0x70,0x01,0x1e,0x00,0xb4,0xa0,0x21,0xe0,0x08,0xc8,0x12,0x9e,0x00,0xb3,0x82,0x21 }},
+ {16, 0x8230, 0, {0xe0,0x0b,0x7a,0x0a,0x1e,0x00,0x97,0x80,0x2d,0xe1,0x0a,0x48,0x02,0xce,0x40,0x95 }},
+ {16, 0x8240, 0, {0x90,0x29,0xe4,0x08,0x58,0x02,0x9a,0x00,0xb7,0x88,0x21,0xe0,0x09,0x58,0x02,0x5c }},
+ {16, 0x8250, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x4a,0x00,0x0c,0x00,0xf0,0x80,0x38,0xc4 }},
+ {16, 0x8260, 0, {0x0c,0x25,0x03,0x8c,0x20,0x93,0x00,0x38,0xc4,0x0f,0xb0,0x03,0x0c,0x80,0xd3,0x00 }},
+ {16, 0x8270, 0, {0x34,0xc0,0x0d,0x04,0x13,0xcc,0x08,0x99,0x00,0x2a,0xc0,0x0e,0x21,0x03,0x88,0x04 }},
+ {16, 0x8280, 0, {0xf3,0x00,0x38,0xc0,0x0c,0x11,0x83,0x12,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8290, 0, {0x42,0x15,0xbc,0x00,0xf4,0x00,0x3f,0xc3,0x0e,0xc0,0x03,0x1c,0x00,0xaf,0x4a,0x7f }},
+ {16, 0x82a0, 0, {0xc4,0x0f,0xb2,0x03,0xfd,0x01,0xef,0x10,0x3f,0x84,0x0f,0xc0,0x03,0xfc,0x00,0xe9 }},
+ {16, 0x82b0, 0, {0x00,0x37,0xc2,0x0e,0xf1,0x47,0x7c,0x00,0xf7,0x00,0x3d,0xc0,0x0f,0x50,0x03,0xd0 }},
+ {16, 0x82c0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xaa,0x15,0xec,0x08,0xf8,0x00,0x3e,0xca }},
+ {16, 0x82d0, 0, {0x0f,0x90,0x03,0xef,0x21,0xfb,0x80,0x7a,0x40,0x8f,0xb2,0xa1,0x2f,0x00,0xcb,0x60 }},
+ {16, 0x82e0, 0, {0x3e,0xc0,0x0f,0xb0,0x03,0xed,0xa0,0xe9,0x30,0x32,0xc0,0x2d,0xb0,0x03,0xe4,0x00 }},
+ {16, 0x82f0, 0, {0xf8,0x00,0x3e,0x00,0x0f,0xb0,0x03,0xea,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8300, 0, {0xc8,0x91,0x9d,0x00,0xb4,0x01,0x2d,0xc8,0x0b,0x70,0x02,0xcc,0x80,0x8f,0x20,0x21 }},
+ {16, 0x8310, 0, {0xc0,0x8b,0x76,0x03,0x5d,0x00,0x87,0x0a,0x2d,0xc0,0x0b,0x40,0x22,0xfd,0x00,0x8d }},
+ {16, 0x8320, 0, {0x10,0x23,0xc8,0x08,0x50,0x12,0xd4,0x00,0xb7,0x00,0x2d,0xc0,0x0b,0x70,0x02,0xf2 }},
+ {16, 0x8330, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x81,0x00,0x9e,0x00,0xb4,0x80,0x2d,0xe0 }},
+ {16, 0x8340, 0, {0x0b,0x7c,0x02,0xde,0x40,0xa7,0x82,0x2d,0xe0,0x0b,0x3a,0x02,0x8e,0x00,0x87,0x90 }},
+ {16, 0x8350, 0, {0x2d,0xe0,0x0b,0x58,0x02,0x5e,0x00,0xa5,0xa2,0x65,0xe0,0x08,0x68,0x82,0xda,0x00 }},
+ {16, 0x8360, 0, {0x95,0x80,0x2d,0x60,0x0b,0x78,0x02,0xe0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8370, 0, {0x08,0x84,0xcc,0x00,0xb0,0x09,0x2c,0xc0,0x0b,0x38,0x02,0xcc,0x00,0x83,0x00,0x2e }},
+ {16, 0x8380, 0, {0xc0,0x0b,0x30,0x42,0x4c,0x00,0x83,0x00,0x2c,0xa0,0x0b,0x04,0x02,0xcc,0x00,0x81 }},
+ {16, 0x8390, 0, {0x00,0xa0,0xc0,0x08,0xb0,0x06,0xcf,0x80,0xb3,0x10,0x2c,0xc4,0x0b,0x31,0x02,0xc3 }},
+ {16, 0x83a0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x05,0xa8,0x00,0xfe,0x80,0x3e,0x80 }},
+ {16, 0x83b0, 0, {0x0f,0xe8,0x13,0xe8,0x00,0xea,0x00,0x3f,0xb0,0x0f,0xa0,0x03,0xa8,0x02,0xc2,0x00 }},
+ {16, 0x83c0, 0, {0x2f,0x88,0x0f,0xe0,0x03,0xe8,0x00,0xea,0x00,0x36,0x00,0x0c,0xe0,0x03,0xf9,0x20 }},
+ {16, 0x83d0, 0, {0xde,0x80,0x3f,0xa0,0x4f,0xa8,0x03,0xfa,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x83e0, 0, {0x48,0x00,0xe0,0x00,0xf8,0x10,0x3c,0x10,0x0f,0x80,0x83,0xe1,0x00,0xe8,0x00,0x22 }},
+ {16, 0x83f0, 0, {0x06,0x0f,0x00,0x13,0xe0,0x01,0xf8,0x00,0x3e,0x00,0x0f,0x80,0x83,0xe0,0x00,0xf8 }},
+ {16, 0x8400, 0, {0x00,0x3e,0x00,0x0f,0x84,0x23,0xe0,0x00,0xf8,0x00,0x3e,0x10,0x0f,0x80,0x03,0xd2 }},
+ {16, 0x8410, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0xe4,0x00,0xf9,0x10,0x3e,0x44 }},
+ {16, 0x8420, 0, {0x0d,0x90,0x03,0xe4,0x00,0xf9,0x00,0x3e,0x40,0x0c,0x90,0x12,0x24,0x00,0xf9,0x10 }},
+ {16, 0x8430, 0, {0x32,0x40,0x8f,0x90,0x03,0xc4,0x00,0xc9,0x00,0x32,0x10,0x0c,0x9c,0x01,0x24,0x00 }},
+ {16, 0x8440, 0, {0xf9,0x10,0x3e,0x70,0x0f,0x90,0x02,0xc2,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8450, 0, {0x80,0x14,0x64,0x00,0xb9,0xc0,0x2e,0x48,0x08,0x91,0x02,0xe4,0x00,0xb9,0x00,0x2e }},
+ {16, 0x8460, 0, {0x40,0x0d,0x90,0x03,0x67,0x00,0xb9,0x80,0x2a,0x60,0x0b,0x99,0x02,0xe4,0x00,0x81 }},
+ {16, 0x8470, 0, {0x00,0x22,0x40,0x2c,0x90,0x12,0x25,0x20,0xb9,0x48,0x2e,0x52,0x0b,0x94,0x02,0xe0 }},
+ {16, 0x8480, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0xb9,0x00,0x2e,0x40 }},
+ {16, 0x8490, 0, {0x68,0x90,0x46,0xe4,0x00,0xb9,0x00,0x2e,0xc0,0x08,0x90,0x02,0xa4,0x60,0xb9,0x00 }},
+ {16, 0x84a0, 0, {0x22,0x48,0x0b,0x90,0x06,0xe4,0x02,0x89,0x00,0xa0,0x40,0x08,0x90,0x02,0xa6,0x10 }},
+ {16, 0x84b0, 0, {0xb9,0x00,0x0e,0x40,0x0b,0x90,0x02,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x84c0, 0, {0x08,0x04,0x04,0x80,0xb1,0x00,0x2c,0x48,0x08,0x10,0x02,0xc4,0x84,0xb1,0x20,0x2c }},
+ {16, 0x84d0, 0, {0x40,0x09,0x12,0x02,0xc4,0x80,0xb1,0x20,0x28,0x40,0x0b,0x10,0x02,0xc4,0x80,0x89 }},
+ {16, 0x84e0, 0, {0x20,0x20,0x40,0x4b,0x12,0x0a,0x84,0x84,0xb1,0x20,0x2c,0x48,0x8b,0x10,0x02,0xc2 }},
+ {16, 0x84f0, 0, {0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x61,0x40,0xba,0x00,0x2e,0x00 }},
+ {16, 0x8500, 0, {0x0c,0x80,0x03,0xe8,0x08,0xf8,0x50,0x3e,0x14,0x0c,0x85,0x03,0x20,0x00,0xb8,0x00 }},
+ {16, 0x8510, 0, {0x32,0x00,0x0f,0xa0,0x03,0xe1,0x40,0xc8,0x50,0x32,0x14,0x0c,0xa5,0x03,0xa1,0x40 }},
+ {16, 0x8520, 0, {0xf8,0x00,0x3e,0x00,0x0f,0xa0,0x03,0xee,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8530, 0, {0x88,0x0d,0xe4,0x40,0xfd,0x00,0x3e,0x44,0x0f,0xd0,0x03,0xe4,0x40,0xb9,0x11,0x3f }},
+ {16, 0x8540, 0, {0x40,0x0f,0x91,0x03,0x64,0x44,0xf9,0x10,0x3f,0x40,0x0f,0xd0,0x03,0xe4,0x40,0xfd }},
+ {16, 0x8550, 0, {0x10,0x3f,0x10,0x8c,0xd1,0x03,0x74,0x40,0xff,0x10,0x3f,0x44,0x0f,0xd0,0x03,0xe6 }},
+ {16, 0x8560, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0x66,0x20,0xed,0x00,0x33,0x69 }},
+ {16, 0x8570, 0, {0x4d,0x50,0x43,0x56,0x00,0xf9,0xa0,0x34,0x40,0x0f,0x9a,0x0b,0x34,0x00,0xdd,0x80 }},
+ {16, 0x8580, 0, {0x3b,0x40,0x0b,0x50,0x03,0xe4,0x00,0xf9,0x00,0x32,0xe0,0x0e,0xd0,0x03,0xf4,0x00 }},
+ {16, 0x8590, 0, {0xfd,0x00,0x3f,0x40,0x0c,0xd0,0x03,0xc6,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x85a0, 0, {0x78,0x10,0xe2,0x80,0x88,0x04,0x22,0x10,0x0b,0x80,0x02,0x20,0x09,0xb8,0xf0,0x22 }},
+ {16, 0x85b0, 0, {0x00,0x0b,0x8e,0x12,0xa0,0x00,0xb8,0x52,0x2e,0x00,0x0b,0x80,0x02,0xe0,0x05,0xb8 }},
+ {16, 0x85c0, 0, {0xaa,0x23,0x3e,0x0d,0x80,0x02,0xe0,0x00,0xb8,0x00,0x3a,0x00,0x08,0x80,0x02,0xce }},
+ {16, 0x85d0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x05,0xc4,0x20,0xa9,0x00,0xa4,0x44 }},
+ {16, 0x85e0, 0, {0x09,0x90,0x02,0xc5,0x00,0xa1,0x08,0x2c,0x40,0x0b,0x11,0x82,0x04,0x00,0xb1,0x00 }},
+ {16, 0x85f0, 0, {0x28,0x40,0x0a,0x10,0x42,0xc4,0x00,0xb5,0x00,0xa1,0x40,0x08,0x10,0x02,0xc4,0x00 }},
+ {16, 0x8600, 0, {0xb1,0x01,0x2c,0x40,0x08,0x10,0x20,0xd2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8610, 0, {0x18,0x15,0xa4,0x00,0x89,0x04,0x22,0x40,0x0b,0x90,0x00,0xac,0x00,0x39,0x00,0x2a }},
+ {16, 0x8620, 0, {0x40,0x0b,0x10,0x02,0xa4,0x00,0xb9,0x00,0x2e,0x48,0x0b,0x90,0x12,0xe4,0x00,0xb9 }},
+ {16, 0x8630, 0, {0x00,0x21,0x60,0x09,0x92,0x22,0xe4,0x28,0xb9,0x00,0x0a,0x50,0x08,0x90,0x06,0xc6 }},
+ {16, 0x8640, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x00,0xe9,0x00,0x36,0x40 }},
+ {16, 0x8650, 0, {0x0d,0x90,0x03,0xe4,0x00,0xf9,0x00,0x3e,0x48,0x0f,0x90,0x03,0x24,0x00,0xd9,0x00 }},
+ {16, 0x8660, 0, {0x3a,0x78,0x0e,0x98,0x03,0xe4,0x00,0xb9,0x00,0xb2,0x40,0x0e,0x92,0x23,0xe6,0x00 }},
+ {16, 0x8670, 0, {0xb9,0x50,0x3e,0x70,0x2c,0x90,0x03,0xe8,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8680, 0, {0x68,0x01,0x84,0x00,0xf9,0x00,0x3e,0x40,0x4f,0x9c,0x23,0x64,0x00,0xf9,0x04,0x36 }},
+ {16, 0x8690, 0, {0x48,0x0f,0x90,0x03,0xe4,0x00,0xf9,0x00,0x3e,0x60,0x0f,0x92,0x03,0xe4,0x00,0xf9 }},
+ {16, 0x86a0, 0, {0x00,0x3e,0x40,0x8f,0x90,0x83,0xe4,0x44,0xf9,0x00,0x78,0x64,0x0f,0x90,0x03,0xda }},
+ {16, 0x86b0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xf8,0x00,0x3e,0x00 }},
+ {16, 0x86c0, 0, {0x0f,0x82,0x03,0xa0,0x40,0xe8,0x00,0x3e,0x00,0x0d,0x80,0x03,0x20,0xc0,0xc8,0x80 }},
+ {16, 0x86d0, 0, {0x3e,0x12,0x0f,0x80,0x03,0x60,0x00,0x7c,0x00,0x33,0x00,0x0d,0x80,0x13,0xe0,0x10 }},
+ {16, 0x86e0, 0, {0xc8,0x64,0x3e,0x08,0x0c,0x82,0x03,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x86f0, 0, {0x28,0x05,0x28,0x00,0xb6,0xe0,0x0f,0xa0,0x0b,0x60,0x82,0x38,0x00,0xaa,0x00,0x2e }},
+ {16, 0x8700, 0, {0x80,0x08,0xa0,0x42,0xba,0x00,0xae,0x20,0x2f,0x88,0x0b,0xe5,0x02,0x28,0x00,0xba }},
+ {16, 0x8710, 0, {0xd8,0x37,0x80,0x08,0xec,0x02,0xf8,0x04,0x8e,0x00,0x2f,0x90,0x0d,0xe0,0x02,0xca }},
+ {16, 0x8720, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0xb0,0x24,0x2c,0x60 }},
+ {16, 0x8730, 0, {0x0b,0x38,0x02,0x8e,0x80,0xab,0x00,0x2c,0xc0,0x09,0x30,0x02,0x0d,0x08,0x00,0x80 }},
+ {16, 0x8740, 0, {0x6c,0xd0,0x0b,0x34,0x02,0xcc,0x00,0xb8,0xc0,0x20,0x00,0x48,0x34,0x12,0xcc,0x40 }},
+ {16, 0x8750, 0, {0x83,0x00,0x2c,0xe0,0x0a,0x35,0x02,0xca,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8760, 0, {0xa0,0x01,0x1c,0x40,0xb7,0x00,0x2d,0x02,0x8b,0x60,0x02,0x9e,0x00,0x87,0x20,0x2f }},
+ {16, 0x8770, 0, {0xe0,0x08,0x72,0x02,0x9e,0x00,0xa4,0x00,0x2d,0xc0,0x0b,0xf8,0x02,0x9c,0xc0,0xb3 }},
+ {16, 0x8780, 0, {0x02,0xa5,0xc0,0x08,0x50,0x86,0xfe,0x00,0x87,0x00,0x2f,0xd0,0x09,0x70,0x02,0xe8 }},
+ {16, 0x8790, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0x00,0xf4,0x80,0x3d,0x20 }},
+ {16, 0x87a0, 0, {0x0f,0x58,0x03,0x9e,0x00,0x67,0x80,0x3d,0xf8,0x0d,0x38,0x02,0x1a,0x10,0x44,0x80 }},
+ {16, 0x87b0, 0, {0x3d,0xe0,0x0f,0x58,0x03,0xde,0x20,0xb4,0x80,0x33,0xa0,0x2c,0x68,0x03,0xd6,0x00 }},
+ {16, 0x87c0, 0, {0xc7,0x81,0x3d,0xe0,0x0c,0x78,0x03,0xea,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x87d0, 0, {0x08,0x1d,0xac,0x08,0xf8,0x00,0x3e,0x00,0x8f,0x80,0x03,0x6c,0x00,0x3b,0x12,0x3e }},
+ {16, 0x87e0, 0, {0xca,0x0f,0xb5,0x03,0xc8,0x00,0xf8,0x04,0x7e,0xc0,0x0f,0x90,0x03,0x6c,0x80,0xfb }},
+ {16, 0x87f0, 0, {0x04,0x3a,0x40,0x0f,0x90,0x23,0xc8,0x00,0xf9,0x01,0x3c,0xc0,0x0f,0xb0,0x03,0xc2 }},
+ {16, 0x8800, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfe,0x00,0xac,0x90,0x31,0x48 }},
+ {16, 0x8810, 0, {0x08,0xf8,0x03,0xfa,0x00,0xcf,0x80,0x3f,0xe0,0x0c,0xfc,0x13,0x3e,0x04,0xfc,0x80 }},
+ {16, 0x8820, 0, {0x35,0xa0,0x0c,0x78,0x03,0xbe,0x00,0xdf,0x80,0x3b,0x20,0x24,0xf8,0x03,0x2e,0x40 }},
+ {16, 0x8830, 0, {0xcf,0x80,0x33,0xe0,0x03,0xf9,0x03,0xd0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8840, 0, {0xa8,0x11,0xbc,0x00,0x80,0x00,0x01,0x00,0x08,0x72,0x02,0xd0,0x00,0x87,0x00,0x2d }},
+ {16, 0x8850, 0, {0xc8,0x0a,0xf0,0x02,0x98,0x40,0xf5,0x00,0x61,0x41,0x00,0x74,0x02,0x1c,0x00,0xb4 }},
+ {16, 0x8860, 0, {0x00,0x21,0xc8,0x08,0x60,0x02,0x3e,0x20,0x86,0x08,0x21,0xd8,0x0f,0x50,0x02,0xea }},
+ {16, 0x8870, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x9c,0x00,0xa4,0x00,0x21,0x00 }},
+ {16, 0x8880, 0, {0x08,0x50,0x02,0xd8,0x00,0x97,0x00,0x2d,0xc0,0x88,0x71,0x02,0x14,0x00,0xb0,0x00 }},
+ {16, 0x8890, 0, {0x25,0x90,0x08,0xc0,0x82,0x9c,0x40,0x93,0x00,0x29,0xa1,0x88,0x60,0x02,0x14,0x12 }},
+ {16, 0x88a0, 0, {0x87,0x40,0x29,0x40,0x0b,0x60,0x02,0xc4,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x88b0, 0, {0x60,0x14,0xcc,0x00,0x80,0xd0,0xa0,0x00,0x08,0x1c,0x02,0xc0,0x00,0x93,0x00,0x2c }},
+ {16, 0x88c0, 0, {0xd0,0x0a,0xb0,0x26,0x80,0x00,0xb3,0x00,0x24,0xe4,0x08,0x08,0x02,0x8c,0x00,0xb0 }},
+ {16, 0x88d0, 0, {0x02,0x02,0x41,0x08,0x08,0x02,0x03,0x01,0x81,0x00,0x28,0x42,0x1a,0x00,0x42,0xd8 }},
+ {16, 0x88e0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x15,0xbc,0x00,0xe8,0xc0,0x32,0x80 }},
+ {16, 0x88f0, 0, {0x0c,0xb5,0x03,0xe4,0x00,0x9f,0x00,0x3d,0xe0,0x0c,0xf0,0x0b,0x24,0x00,0xf8,0x00 }},
+ {16, 0x8900, 0, {0x36,0xe0,0x0c,0x25,0x03,0xbc,0x05,0xd8,0x02,0x2a,0x00,0x08,0xba,0x02,0x2a,0x00 }},
+ {16, 0x8910, 0, {0xc1,0x02,0x3a,0x50,0x8b,0x90,0x03,0xee,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8920, 0, {0x80,0x00,0xec,0x00,0xfb,0x08,0x3e,0x80,0x0f,0xa1,0x03,0xec,0x04,0xeb,0x02,0x2e }},
+ {16, 0x8930, 0, {0xc6,0x0f,0xb0,0x17,0x44,0x00,0xe8,0x00,0x3a,0x40,0x0f,0x80,0x02,0x6c,0x00,0xfb }},
+ {16, 0x8940, 0, {0x00,0x3e,0xe0,0x0f,0x90,0x93,0xe1,0x00,0xd9,0x00,0x26,0x70,0x8f,0x90,0x01,0xe1 }},
+ {16, 0x8950, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xfc,0x00,0xfc,0x03,0x37,0x24 }},
+ {16, 0x8960, 0, {0x0d,0xf8,0x03,0xe0,0x00,0xff,0x00,0x3f,0xc1,0x8d,0xf0,0x0b,0x38,0x00,0xcc,0x00 }},
+ {16, 0x8970, 0, {0x3f,0xc0,0x0f,0xfa,0x03,0x3c,0x0c,0xfc,0x04,0x3b,0x80,0x0c,0xa0,0x03,0x94,0x20 }},
+ {16, 0x8980, 0, {0x89,0x05,0x3b,0x00,0x4f,0xd0,0x23,0xc0,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8990, 0, {0x80,0x04,0x6c,0x00,0xb0,0x06,0x20,0x13,0x88,0xa8,0x02,0xeb,0x00,0xbb,0x00,0x2e }},
+ {16, 0x89a0, 0, {0xc0,0x08,0xb0,0x02,0x2a,0x00,0xa8,0x80,0x2e,0xe0,0x0b,0x94,0x1a,0x2c,0x00,0xbb }},
+ {16, 0x89b0, 0, {0x00,0xa2,0x40,0x29,0x98,0x02,0xe2,0x00,0xa9,0x84,0x22,0x20,0x0b,0x98,0x02,0xe0 }},
+ {16, 0x89c0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0xb8,0x00,0x22,0x00 }},
+ {16, 0x89d0, 0, {0x09,0x82,0x02,0xe6,0x00,0xbb,0x00,0x2e,0xc0,0x0b,0xb0,0x02,0x26,0x00,0x88,0x80 }},
+ {16, 0x89e0, 0, {0x2e,0xa0,0x0b,0xa0,0x02,0x2c,0x00,0xb3,0x00,0x2a,0x00,0x09,0x98,0x02,0xea,0x20 }},
+ {16, 0x89f0, 0, {0xa9,0x80,0x2a,0x60,0x9b,0x98,0x82,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8a00, 0, {0x08,0x04,0x0c,0x00,0xb8,0x00,0x20,0x00,0x09,0x08,0x02,0xc4,0x00,0xb3,0x00,0x26 }},
+ {16, 0x8a10, 0, {0xc0,0x00,0x30,0x02,0x00,0x00,0x81,0x00,0x2c,0x41,0x0b,0x00,0x02,0x0c,0x00,0xb0 }},
+ {16, 0x8a20, 0, {0x00,0x20,0xc0,0x0b,0x00,0x02,0xc8,0x80,0xa8,0x00,0x20,0x41,0x0b,0x10,0x02,0xc2 }},
+ {16, 0x8a30, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x6c,0x10,0xf8,0x50,0xb2,0x00 }},
+ {16, 0x8a40, 0, {0x0d,0x80,0x03,0xe0,0x00,0xfb,0x00,0x3d,0xc0,0x0d,0xf0,0x13,0x24,0x02,0xc8,0x06 }},
+ {16, 0x8a50, 0, {0x3e,0x80,0x0f,0xa0,0x03,0x3c,0x04,0xfb,0x00,0x78,0x80,0x0c,0xa0,0x03,0xe4,0x00 }},
+ {16, 0x8a60, 0, {0xe9,0x00,0x1a,0x40,0x0f,0x90,0x03,0xc0,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8a70, 0, {0xa0,0x1d,0xfc,0x00,0xf4,0x20,0x3f,0x00,0x0e,0xc0,0x02,0xf0,0x01,0xff,0x00,0x3f }},
+ {16, 0x8a80, 0, {0xc0,0x0f,0xf0,0x23,0xf0,0x00,0xfd,0x00,0x3f,0xc0,0x0f,0xc0,0x03,0xfc,0x00,0xfc }},
+ {16, 0x8a90, 0, {0x00,0x3f,0x40,0x9c,0xc0,0x03,0xf0,0x40,0xfd,0x00,0x3f,0x40,0x0f,0xd0,0x43,0xe8 }},
+ {16, 0x8aa0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xf0,0x00,0xed,0x23,0xb7,0x48 }},
+ {16, 0x8ab0, 0, {0x0c,0xe1,0xc3,0x7c,0xc0,0xdd,0x80,0x37,0xe0,0x0f,0xcb,0x03,0xfe,0x08,0xfc,0x28 }},
+ {16, 0x8ac0, 0, {0x3f,0xf0,0x1c,0xfb,0x23,0x7c,0x01,0xff,0x14,0x77,0xe2,0x4f,0xe8,0x23,0x7c,0x00 }},
+ {16, 0x8ad0, 0, {0xc4,0x80,0x33,0x48,0x2c,0xf8,0x22,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8ae0, 0, {0x80,0x10,0xe0,0xe0,0xc9,0xc0,0x22,0x5b,0x88,0x96,0x22,0x2d,0x00,0x89,0x22,0x22 }},
+ {16, 0x8af0, 0, {0xca,0x0b,0x9e,0x22,0xe2,0xa0,0xb9,0x61,0x2c,0xe0,0x88,0x9f,0x02,0x3d,0x85,0xbf }},
+ {16, 0x8b00, 0, {0x60,0x26,0x50,0x48,0xa0,0x02,0x3c,0x00,0x88,0x00,0x22,0x50,0x08,0xb0,0x02,0x20 }},
+ {16, 0x8b10, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xc0,0x80,0xb1,0x10,0x20,0x44 }},
+ {16, 0x8b20, 0, {0x0b,0xb2,0x02,0xce,0xd0,0x81,0x08,0x2c,0xc0,0x0b,0x01,0x02,0x8c,0x08,0xb3,0x08 }},
+ {16, 0x8b30, 0, {0x2c,0xc9,0x08,0x10,0x62,0x8c,0x60,0xb3,0x32,0x24,0x80,0x0a,0xa0,0x02,0x6c,0x03 }},
+ {16, 0x8b40, 0, {0x9a,0x01,0x26,0x44,0x48,0xb0,0x42,0x62,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8b50, 0, {0xc0,0x15,0xa4,0xa0,0x8b,0x02,0x22,0xe0,0x0b,0xb0,0x62,0xac,0x98,0x99,0x00,0x2a }},
+ {16, 0x8b60, 0, {0xc2,0x0b,0x98,0x06,0xe4,0x00,0xbb,0x02,0x2e,0xc0,0x08,0x91,0x42,0x2c,0x10,0xbb }},
+ {16, 0x8b70, 0, {0x00,0x6e,0x80,0x0a,0x80,0x02,0x6c,0x00,0x1b,0x00,0x06,0x40,0x48,0xb8,0x0a,0x70 }},
+ {16, 0x8b80, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0xe7,0x00,0xa1,0x00,0x76,0x78 }},
+ {16, 0x8b90, 0, {0x0f,0xb0,0x03,0xe8,0x10,0xd9,0x00,0x3e,0xd0,0x4b,0x9e,0x13,0xac,0x08,0xb8,0xa0 }},
+ {16, 0x8ba0, 0, {0x7e,0xc6,0x08,0xa8,0x02,0x2c,0x01,0xbb,0x00,0x26,0x30,0x4e,0x20,0x03,0x4c,0x18 }},
+ {16, 0x8bb0, 0, {0x99,0x80,0xb4,0x40,0x4c,0x3a,0x03,0x40,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8bc0, 0, {0xe0,0x01,0xb2,0x00,0xfd,0xc5,0x3b,0xc0,0x4c,0xd0,0x03,0x6a,0x02,0xed,0x06,0x33 }},
+ {16, 0x8bd0, 0, {0xc4,0x0f,0xd0,0x53,0xf8,0x00,0xfc,0x90,0x7f,0xc1,0x0f,0x78,0x03,0xbc,0x04,0xff }},
+ {16, 0x8be0, 0, {0x00,0x37,0x64,0x0c,0xf1,0x03,0xa4,0x00,0xed,0xa1,0x3b,0x40,0x0b,0xf0,0x83,0xb8 }},
+ {16, 0x8bf0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0x8c,0x00,0xcb,0x20,0x3e,0x71 }},
+ {16, 0x8c00, 0, {0x0f,0xb3,0x03,0x98,0x02,0xfb,0x02,0x36,0x48,0x0f,0x90,0x03,0xec,0x20,0xf8,0x00 }},
+ {16, 0x8c10, 0, {0x3e,0xcc,0x04,0x84,0x03,0x2c,0x00,0xdb,0x04,0x3c,0x10,0x0f,0xa0,0x03,0xec,0x00 }},
+ {16, 0x8c20, 0, {0x9b,0x00,0x32,0x40,0x0c,0x90,0x03,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8c30, 0, {0x88,0x05,0x2c,0x02,0x8b,0x48,0x2e,0xe0,0x0b,0x34,0x03,0x6b,0x00,0x8b,0xf5,0x22 }},
+ {16, 0x8c40, 0, {0xf2,0x0b,0x9c,0x03,0xaf,0x00,0xb8,0x50,0x2e,0xc0,0x08,0xb0,0x02,0x7c,0x00,0x8f }},
+ {16, 0x8c50, 0, {0x00,0x0e,0x5d,0x0b,0x80,0x02,0xf5,0x40,0x83,0x50,0x23,0x54,0x08,0x9c,0x02,0xe6 }},
+ {16, 0x8c60, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x04,0x4c,0x00,0x81,0x81,0x2e,0x40 }},
+ {16, 0x8c70, 0, {0x03,0x2c,0x02,0x04,0x33,0x99,0x00,0x20,0xf0,0x4a,0x28,0x80,0xcc,0x40,0xb0,0x00 }},
+ {16, 0x8c80, 0, {0x26,0x10,0x08,0x20,0x02,0x4c,0x00,0x83,0x00,0x2c,0xc0,0x09,0x20,0x02,0xcc,0x00 }},
+ {16, 0x8c90, 0, {0xa0,0x02,0x28,0x40,0x08,0x08,0x02,0x7a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8ca0, 0, {0x20,0x01,0x0a,0x00,0x85,0x80,0x2d,0xf8,0x0b,0xda,0x02,0xd6,0x40,0x85,0xa0,0x21 }},
+ {16, 0x8cb0, 0, {0xe0,0x0b,0x48,0x06,0x92,0x04,0xb5,0x80,0x2d,0x21,0x08,0x00,0x02,0x4e,0x00,0x87 }},
+ {16, 0x8cc0, 0, {0xa4,0x2d,0x60,0x0b,0x68,0x02,0xde,0xc2,0xad,0x90,0x2b,0x60,0x28,0x58,0x82,0xdc }},
+ {16, 0x8cd0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x4c,0x40,0xc3,0x10,0x2c,0x6c }},
+ {16, 0x8ce0, 0, {0x0f,0x30,0x03,0x86,0xa2,0xf9,0xb0,0xb0,0xe0,0x0f,0x29,0x83,0xce,0x44,0xf3,0x80 }},
+ {16, 0x8cf0, 0, {0x3c,0xac,0x0c,0x30,0x03,0x0c,0x00,0xc3,0x00,0x3c,0xd5,0x0f,0x20,0x03,0xce,0xc1 }},
+ {16, 0x8d00, 0, {0xe0,0x10,0xb8,0x40,0x0c,0x00,0x03,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8d10, 0, {0xc0,0x1d,0xbc,0x00,0xeb,0x00,0x3e,0xcc,0x0f,0x32,0x03,0x64,0x08,0xf9,0x00,0x3b }},
+ {16, 0x8d20, 0, {0x90,0x0f,0xf0,0x43,0xe4,0x40,0xfb,0x34,0x3f,0x81,0x07,0xd1,0x03,0xad,0x20,0xeb }},
+ {16, 0x8d30, 0, {0x20,0x7f,0xc4,0x0f,0xe1,0x03,0xfc,0x50,0xcd,0x10,0x35,0x40,0x0f,0xd0,0x03,0xd0 }},
+ {16, 0x8d40, 0, {0x02,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xe4,0x04,0xfd,0x04,0x3d,0x40 }},
+ {16, 0x8d50, 0, {0x2d,0x30,0x02,0x3c,0x00,0xc9,0x01,0x3e,0xc0,0x4f,0xb8,0x43,0xec,0x10,0xfb,0x00 }},
+ {16, 0x8d60, 0, {0x32,0x40,0x0f,0xa0,0x23,0xec,0x80,0xcb,0x36,0x32,0x80,0x4d,0xa8,0x03,0x2c,0x10 }},
+ {16, 0x8d70, 0, {0xcb,0x00,0x32,0x40,0x0c,0x90,0x03,0x6a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8d80, 0, {0xc8,0x11,0x90,0x08,0xb5,0x00,0x2d,0xc0,0x08,0x50,0x02,0xbc,0x02,0x85,0x04,0x2d }},
+ {16, 0x8d90, 0, {0xc0,0x8e,0x60,0x06,0xd8,0x04,0xb7,0x04,0x21,0x40,0x0b,0x70,0x02,0xfc,0x80,0xaf }},
+ {16, 0x8da0, 0, {0x28,0x21,0xc0,0x0b,0x70,0x02,0x06,0x40,0x87,0x00,0x21,0x50,0x08,0x50,0x02,0x32 }},
+ {16, 0x8db0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x9e,0x20,0xb7,0x80,0x2b,0x70 }},
+ {16, 0x8dc0, 0, {0x08,0xf8,0x06,0x1e,0x00,0x87,0x80,0x2d,0xe0,0x0b,0x70,0x32,0xde,0x04,0x37,0x84 }},
+ {16, 0x8dd0, 0, {0x25,0xe0,0x0b,0x68,0x06,0xde,0x80,0x87,0x80,0x21,0xa1,0x1b,0x68,0x02,0x1e,0x40 }},
+ {16, 0x8de0, 0, {0x9f,0x80,0x20,0x60,0x08,0x58,0x02,0x20,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8df0, 0, {0x48,0x14,0xcc,0x20,0xb3,0x00,0x2c,0x80,0x88,0xb4,0x22,0x8d,0x00,0x83,0x90,0x2c }},
+ {16, 0x8e00, 0, {0xc0,0x0a,0x38,0x02,0xce,0x08,0xbb,0x20,0x24,0xd0,0x0b,0xb3,0x02,0xcc,0x00,0xa3 }},
+ {16, 0x8e10, 0, {0x00,0x60,0xd2,0x0b,0x20,0x2a,0x04,0x08,0x93,0x50,0x20,0x40,0x08,0x17,0x0a,0x02 }},
+ {16, 0x8e20, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xba,0x00,0xba,0xa0,0x3f,0x84 }},
+ {16, 0x8e30, 0, {0x1c,0xe0,0x0b,0x38,0x40,0x8e,0x06,0x2e,0x80,0x0b,0xe3,0x03,0xf8,0x80,0xfe,0xe4 }},
+ {16, 0x8e40, 0, {0xb7,0x90,0x0f,0xec,0x02,0xe8,0x00,0x8a,0x00,0xa3,0xa0,0x09,0xe4,0x03,0x2a,0x02 }},
+ {16, 0x8e50, 0, {0xde,0xc0,0xf3,0x80,0x0c,0x6c,0x03,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8e60, 0, {0x48,0x01,0xe0,0x00,0xf8,0x40,0x3e,0x00,0x0f,0x84,0x13,0xe0,0x00,0xf8,0x00,0x2e }},
+ {16, 0x8e70, 0, {0x30,0x0a,0x84,0x03,0xe0,0x04,0xf8,0x00,0x3a,0x02,0x0f,0x80,0x13,0xe0,0x00,0xf8 }},
+ {16, 0x8e80, 0, {0x00,0x3e,0x04,0x0d,0x80,0x83,0xe0,0x40,0xe8,0x20,0x3e,0x00,0x2f,0x80,0x03,0xd2 }},
+ {16, 0x8e90, 0, {0x10,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xa4,0x00,0xf9,0x00,0x3c,0x64 }},
+ {16, 0x8ea0, 0, {0x4e,0x90,0x83,0x24,0x80,0xc9,0x00,0x32,0xe0,0x0f,0x10,0x03,0x25,0x00,0xf9,0x00 }},
+ {16, 0x8eb0, 0, {0x32,0x44,0x0f,0x92,0x23,0x64,0x00,0xc1,0x00,0x32,0x40,0x0c,0x90,0x13,0xe4,0x00 }},
+ {16, 0x8ec0, 0, {0xc9,0x00,0x22,0x40,0x0c,0x90,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8ed0, 0, {0x80,0x04,0x64,0x00,0xb9,0x20,0x2e,0x40,0x48,0x96,0x22,0x25,0x00,0xd9,0xc0,0xa2 }},
+ {16, 0x8ee0, 0, {0x70,0x0b,0x98,0x02,0x24,0x00,0xb9,0x40,0xa2,0x70,0x4b,0x90,0x02,0x24,0x00,0xd9 }},
+ {16, 0x8ef0, 0, {0x00,0xa2,0x40,0x2c,0x94,0x22,0xe4,0x02,0x89,0x00,0xa2,0x40,0x28,0x94,0x13,0x20 }},
+ {16, 0x8f00, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0x24,0x00,0xb9,0x00,0x2e,0x40 }},
+ {16, 0x8f10, 0, {0x0a,0x90,0x02,0x04,0x00,0x81,0x80,0xa2,0x44,0x0b,0x91,0x02,0x25,0x00,0x19,0x40 }},
+ {16, 0x8f20, 0, {0x62,0x40,0x0b,0xb4,0x02,0x44,0x00,0x89,0x00,0x20,0x40,0x08,0x90,0x82,0xc4,0x01 }},
+ {16, 0x8f30, 0, {0x83,0x02,0x28,0x40,0x48,0x90,0x82,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8f40, 0, {0x00,0x04,0x05,0x80,0xb1,0x00,0x6c,0x51,0x08,0x14,0x1a,0x05,0x00,0x93,0x00,0x20 }},
+ {16, 0x8f50, 0, {0x40,0x8b,0x14,0x02,0x05,0x00,0xb1,0x20,0x20,0x50,0x0b,0x14,0x06,0x04,0x80,0x91 }},
+ {16, 0x8f60, 0, {0x20,0x20,0x40,0x09,0x10,0x02,0xc4,0xa8,0x81,0x00,0x28,0x4a,0x08,0x90,0x4a,0x42 }},
+ {16, 0x8f70, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xf8,0x00,0x3e,0x00 }},
+ {16, 0x8f80, 0, {0x0e,0x80,0x03,0x28,0x01,0xc8,0x50,0x32,0x94,0x8b,0xa0,0x03,0x20,0x00,0xb0,0x50 }},
+ {16, 0x8f90, 0, {0x32,0x80,0x0f,0x80,0x07,0x61,0x51,0xc8,0x50,0x22,0x00,0x0c,0x00,0x03,0xe0,0x84 }},
+ {16, 0x8fa0, 0, {0xc8,0x04,0x3a,0x08,0x0c,0x00,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8fb0, 0, {0x98,0x9d,0xf4,0x40,0xbd,0x41,0x3f,0x50,0x0f,0xf4,0x03,0xf5,0x10,0xfd,0x00,0x3e }},
+ {16, 0x8fc0, 0, {0x40,0x0f,0xd4,0x03,0xf4,0x00,0xff,0x10,0x2f,0x40,0x4f,0xd4,0x40,0xa4,0x48,0xf9 }},
+ {16, 0x8fd0, 0, {0x12,0x3f,0x5a,0x8e,0xd2,0x83,0xf4,0xa8,0xf5,0x2c,0x37,0x4a,0x0f,0xd2,0x83,0xa6 }},
+ {16, 0x8fe0, 0, {0x12,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xe6,0x80,0xfd,0x28,0x3f,0x4c }},
+ {16, 0x8ff0, 0, {0x0f,0x50,0x03,0x3c,0x44,0xcd,0x40,0x3f,0xd0,0x0d,0xd0,0x02,0x14,0x01,0xfd,0xa0 }},
+ {16, 0x9000, 0, {0x31,0x40,0x03,0xd0,0x03,0xe7,0x89,0xf9,0x90,0x7e,0x50,0x0c,0x94,0x03,0xe6,0xc0 }},
+ {16, 0x9010, 0, {0xc9,0x10,0x32,0x6d,0x0f,0x91,0x02,0xc6,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9020, 0, {0x38,0x10,0xe0,0x80,0xb8,0x01,0x2e,0x0c,0x8b,0x84,0x82,0x20,0x42,0x88,0xa0,0x6e }},
+ {16, 0x9030, 0, {0x20,0x08,0x80,0x03,0x60,0x00,0x98,0xe8,0x22,0x00,0x09,0x80,0x02,0xe3,0xc0,0xe8 }},
+ {16, 0x9040, 0, {0xd0,0x2e,0x28,0x08,0x8a,0x23,0xe2,0x84,0xd8,0xa0,0x22,0x3d,0x0b,0xc8,0x02,0xce }},
+ {16, 0x9050, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x05,0xc5,0xb0,0xb1,0x00,0x2c,0x48 }},
+ {16, 0x9060, 0, {0x0b,0x13,0x02,0x04,0x02,0xb1,0x20,0x2e,0x40,0x88,0x10,0x22,0xc4,0x00,0xb1,0x14 }},
+ {16, 0x9070, 0, {0x24,0x40,0x0b,0x10,0x52,0xc4,0x00,0xb1,0x21,0x2d,0x48,0x0a,0x52,0x02,0xd5,0x00 }},
+ {16, 0x9080, 0, {0xbd,0x00,0xad,0x40,0x0b,0x52,0x02,0xd2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9090, 0, {0x18,0x55,0xa5,0x00,0xb9,0x82,0x2e,0x49,0x8b,0xb0,0x12,0x24,0x10,0x99,0x02,0x2e }},
+ {16, 0x90a0, 0, {0x40,0x08,0xb2,0x00,0x65,0x00,0x99,0x80,0x26,0x44,0x09,0x91,0x02,0xe4,0x09,0xa9 }},
+ {16, 0x90b0, 0, {0x04,0x2e,0x46,0x0a,0xd4,0x02,0xb4,0x00,0xbd,0x40,0x2f,0x40,0x0b,0xd0,0x02,0xc6 }},
+ {16, 0x90c0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe7,0x40,0xf9,0x80,0x2e,0x62 }},
+ {16, 0x90d0, 0, {0x0f,0x9c,0x42,0x24,0x00,0x99,0x01,0x2e,0x68,0x2c,0x92,0x02,0x64,0x00,0xb9,0x40 }},
+ {16, 0x90e0, 0, {0xb6,0x60,0x0f,0x9a,0x03,0xe4,0x00,0xb9,0x00,0x2e,0x70,0x3e,0x99,0x06,0xe4,0x02 }},
+ {16, 0x90f0, 0, {0xf9,0x00,0x3e,0x40,0x0f,0x98,0x03,0xe8,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9100, 0, {0x68,0x01,0xa6,0x00,0xf9,0x00,0x3e,0x40,0x1f,0x12,0xab,0xe4,0x00,0xe9,0x90,0x3e }},
+ {16, 0x9110, 0, {0x49,0x0e,0x98,0x03,0xe4,0x00,0xf1,0x00,0x3a,0x40,0x0d,0x98,0x03,0xe4,0x00,0xf9 }},
+ {16, 0x9120, 0, {0x01,0x3e,0x60,0x05,0x90,0x13,0xe4,0x00,0x59,0x20,0x32,0x40,0x8f,0x91,0x03,0xda }},
+ {16, 0x9130, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x68,0x10,0xa0,0x00,0xc8,0x08,0x3e,0x01 }},
+ {16, 0x9140, 0, {0x0f,0x84,0x63,0x00,0x22,0xe8,0x20,0x3e,0x13,0x0f,0x84,0x03,0xe1,0xc0,0xd8,0x4c }},
+ {16, 0x9150, 0, {0x32,0x00,0x0c,0x84,0x43,0xe0,0x00,0xf8,0x00,0x22,0x10,0x0f,0x84,0x03,0x00,0x00 }},
+ {16, 0x9160, 0, {0xc8,0x00,0xb2,0x00,0x0c,0xc0,0x03,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9170, 0, {0x28,0x05,0x28,0x00,0x8e,0x00,0x2f,0x86,0x4b,0xe0,0x02,0x39,0x08,0x8e,0x20,0x2d }},
+ {16, 0x9180, 0, {0x90,0x0b,0xed,0x92,0xf8,0x02,0x8e,0xe0,0xa3,0x98,0x08,0xe0,0x02,0xe8,0x08,0xba }},
+ {16, 0x9190, 0, {0x00,0x62,0x80,0x08,0xa0,0x02,0x28,0x00,0x02,0x80,0x02,0x80,0x48,0xe0,0x03,0x4a }},
+ {16, 0x91a0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x68,0x05,0x4c,0x00,0x83,0x10,0x2c,0xf0 }},
+ {16, 0x91b0, 0, {0x0a,0x14,0x2a,0x0d,0x1a,0xb3,0x01,0x24,0xd0,0x0b,0xbc,0x32,0xcc,0x08,0x03,0x00 }},
+ {16, 0x91c0, 0, {0x20,0xc8,0x0b,0x30,0x02,0xcc,0x00,0xb3,0x02,0x22,0xc0,0x09,0x30,0x02,0x0c,0x11 }},
+ {16, 0x91d0, 0, {0x83,0x00,0x20,0xc0,0x28,0x20,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x91e0, 0, {0x20,0x01,0x1e,0x01,0x85,0x00,0x2d,0x00,0x0b,0x70,0x02,0x18,0x32,0x86,0x00,0x2d }},
+ {16, 0x91f0, 0, {0xc0,0x0b,0x60,0x16,0xfe,0x04,0x86,0x00,0x27,0xa0,0x8b,0x70,0x42,0xdc,0x80,0xb7 }},
+ {16, 0x9200, 0, {0x80,0x21,0x01,0x08,0xf8,0x0a,0x18,0x00,0x86,0x08,0x20,0xa0,0x08,0xe8,0x0a,0x68 }},
+ {16, 0x9210, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x08,0x3e,0x02,0xc6,0x80,0x3d,0xe0 }},
+ {16, 0x9220, 0, {0x0f,0x48,0x03,0x06,0x04,0xf5,0x82,0x35,0xe0,0x0f,0x78,0x03,0xda,0x00,0xd3,0x80 }},
+ {16, 0x9230, 0, {0x31,0x60,0x07,0x78,0x03,0xde,0x20,0xf3,0xb0,0x81,0xe0,0x4f,0x68,0x07,0x0e,0x02 }},
+ {16, 0x9240, 0, {0xcf,0x80,0x31,0xe0,0x0c,0x78,0x13,0x2a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9250, 0, {0x08,0x1d,0xad,0xa0,0xf9,0x00,0x3f,0x00,0x0f,0xb0,0x53,0xf8,0x10,0xa9,0x00,0x3e }},
+ {16, 0x9260, 0, {0x00,0x0f,0x80,0x01,0xec,0x00,0xfb,0x02,0x3a,0xc0,0x0c,0xb0,0x03,0xec,0x00,0xfb }},
+ {16, 0x9270, 0, {0x74,0x3c,0x00,0x0f,0x20,0x03,0xe8,0x00,0xfa,0x00,0x3e,0x80,0x0f,0x30,0x03,0xc2 }},
+ {16, 0x9280, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xfe,0x02,0x8f,0x80,0x35,0xe0 }},
+ {16, 0x9290, 0, {0x8d,0xd9,0x03,0x2e,0xc4,0xf6,0x80,0x32,0xa4,0x0c,0xb8,0x03,0xde,0x00,0xcf,0x90 }},
+ {16, 0x92a0, 0, {0x3c,0xe4,0x0c,0xb8,0x03,0xfe,0x65,0xff,0x80,0x0f,0xec,0x8f,0xf8,0x03,0xfe,0x00 }},
+ {16, 0x92b0, 0, {0xc5,0x80,0x33,0xe0,0x0f,0x68,0x03,0x10,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x92c0, 0, {0xaa,0x11,0x9c,0x80,0x84,0xb0,0x20,0x20,0x29,0x73,0x0a,0x0e,0x82,0xa2,0xa0,0xa2 }},
+ {16, 0x92d0, 0, {0xa0,0x4f,0x3b,0x03,0x87,0x84,0xb2,0x80,0x2c,0xa0,0x0a,0x7d,0x02,0xde,0x80,0xf7 }},
+ {16, 0x92e0, 0, {0x20,0x25,0x06,0x08,0x70,0x02,0xc8,0x40,0x84,0x00,0x35,0x80,0x0b,0x60,0x03,0x6a }},
+ {16, 0x92f0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x10,0x86,0x38,0x27,0xc0 }},
+ {16, 0x9300, 0, {0x49,0x54,0x06,0x54,0x40,0x1d,0x20,0x21,0xca,0x09,0x61,0x40,0xf8,0x80,0xb7,0x20 }},
+ {16, 0x9310, 0, {0x2f,0x00,0x89,0x70,0x12,0xdc,0x81,0xb7,0x04,0x2d,0xc9,0x0a,0x60,0x02,0xcc,0x00 }},
+ {16, 0x9320, 0, {0x8d,0x00,0x2d,0xc0,0x0b,0xf8,0x02,0x04,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9330, 0, {0x60,0x14,0xcd,0x28,0x80,0x00,0x24,0x00,0x09,0xb0,0x22,0x4c,0x02,0xa1,0x01,0x20 }},
+ {16, 0x9340, 0, {0x30,0x1b,0x23,0x02,0xaf,0x20,0xb3,0x08,0x2c,0x80,0x1b,0x30,0x00,0xcc,0x04,0xa3 }},
+ {16, 0x9350, 0, {0x01,0x26,0x30,0x08,0xac,0x22,0xe8,0x02,0x80,0x08,0x2e,0x80,0x4b,0xb4,0x02,0x58 }},
+ {16, 0x9360, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xbc,0x10,0x8b,0x80,0x36,0xf0 }},
+ {16, 0x9370, 0, {0x2d,0xbc,0x0b,0x6c,0x01,0xda,0x04,0x22,0x40,0x7d,0x94,0x22,0xe4,0x00,0xab,0x44 }},
+ {16, 0x9380, 0, {0x2e,0xc0,0x09,0xb8,0x02,0xfc,0x00,0xbf,0x00,0x3e,0xf0,0xca,0x92,0x02,0xe4,0x02 }},
+ {16, 0x9390, 0, {0xcb,0x00,0x6e,0x40,0x0f,0x84,0x01,0x2e,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x93a0, 0, {0x80,0x00,0xec,0x00,0xfb,0x00,0x3a,0xe0,0x2e,0xbc,0x03,0x98,0x08,0xea,0x40,0x36 }},
+ {16, 0x93b0, 0, {0x43,0x8c,0x90,0x03,0xa4,0x44,0x2a,0x40,0x3e,0x10,0x0e,0xb5,0x83,0xec,0x14,0xfb }},
+ {16, 0x93c0, 0, {0x00,0x26,0x00,0x0e,0x92,0x03,0xe0,0x40,0xfa,0x00,0x16,0x00,0x0f,0x80,0x13,0xe0 }},
+ {16, 0x93d0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xec,0x02,0xfa,0x80,0x3f,0xe2 }},
+ {16, 0x93e0, 0, {0x0f,0xb0,0x0b,0x24,0x00,0xef,0x92,0xbb,0xe0,0x1c,0xd0,0x03,0x74,0x00,0xcf,0x05 }},
+ {16, 0x93f0, 0, {0x3b,0x40,0x0f,0xc8,0x03,0x5c,0x00,0xcf,0x00,0x32,0xc2,0x4d,0xc1,0x23,0x34,0x40 }},
+ {16, 0x9400, 0, {0xcf,0x00,0x17,0x44,0x0c,0xd1,0x83,0x00,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9410, 0, {0x81,0x04,0x6c,0x00,0x8b,0x84,0x2e,0x54,0x0b,0xbc,0x0a,0x29,0x80,0x8b,0x80,0x32 }},
+ {16, 0x9420, 0, {0x00,0x08,0x9c,0x03,0xa7,0x00,0xab,0x84,0x2e,0x7c,0x0b,0x80,0x02,0x2c,0x10,0xdb }},
+ {16, 0x9430, 0, {0x01,0x36,0x00,0x08,0x80,0x02,0x20,0x00,0x82,0x00,0x22,0x00,0x08,0x90,0x02,0x24 }},
+ {16, 0x9440, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x0c,0x00,0x89,0x10,0x66,0x90 }},
+ {16, 0x9450, 0, {0x0b,0xb8,0x02,0x6e,0x12,0xa3,0x41,0x20,0x04,0x0a,0x98,0x22,0xe2,0x00,0x89,0x19 }},
+ {16, 0x9460, 0, {0x2e,0xc0,0x4b,0x31,0x22,0x6c,0x08,0x83,0x00,0x22,0xc0,0x09,0x90,0x02,0x24,0x00 }},
+ {16, 0x9470, 0, {0x89,0x00,0x2a,0x40,0x08,0x80,0x02,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9480, 0, {0x08,0x10,0x0c,0x00,0x80,0x20,0x2c,0x0e,0x1b,0x30,0x02,0x04,0x41,0x80,0x20,0x20 }},
+ {16, 0x9490, 0, {0x12,0x18,0x16,0x42,0x00,0x50,0xa0,0x40,0x2c,0x88,0x1b,0x30,0x02,0x0c,0x81,0x93 }},
+ {16, 0x94a0, 0, {0x00,0x24,0x00,0x08,0x10,0x2a,0x00,0x0a,0x88,0x00,0x28,0x00,0x28,0x00,0x0a,0x02 }},
+ {16, 0x94b0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x7c,0x11,0xe8,0x00,0x26,0x98 }},
+ {16, 0x94c0, 0, {0x0f,0xb0,0x13,0x21,0x0c,0xeb,0x60,0x3a,0xd8,0x28,0x84,0xa2,0xe1,0x80,0xc8,0x20 }},
+ {16, 0x94d0, 0, {0x3e,0x5e,0x1f,0x82,0x03,0x7c,0x00,0xcf,0x00,0x32,0xc0,0x4d,0x80,0x07,0x25,0x00 }},
+ {16, 0x94e0, 0, {0xc9,0x00,0x32,0x40,0x0c,0x90,0x03,0x00,0x01,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x94f0, 0, {0xa1,0x11,0xfc,0x00,0xf8,0x13,0x1e,0x00,0x0b,0xf0,0x01,0xf0,0xd0,0xf9,0x19,0x1f }},
+ {16, 0x9500, 0, {0x08,0x4f,0xc0,0x13,0xa1,0x00,0xf8,0x62,0x3f,0xc0,0x0b,0xc4,0x07,0xed,0x00,0xff }},
+ {16, 0x9510, 0, {0x00,0x3f,0x00,0x0f,0xc0,0x23,0xf0,0xa0,0xfc,0x00,0x33,0x00,0x0f,0xd0,0x03,0xe8 }},
+ {16, 0x9520, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfc,0x00,0xff,0x0c,0x3f,0x20 }},
+ {16, 0x9530, 0, {0x0c,0xc9,0x03,0x32,0x00,0xcf,0x38,0x3f,0xd0,0x0f,0x48,0x03,0xfc,0xa0,0xce,0x22 }},
+ {16, 0x9540, 0, {0x33,0x00,0x0f,0xc1,0x03,0x3c,0x00,0xff,0x00,0x3d,0xc4,0x4c,0xc0,0x23,0x8c,0xe4 }},
+ {16, 0x9550, 0, {0xff,0x10,0x37,0x20,0x08,0xf1,0x03,0xf0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9560, 0, {0x80,0x10,0xfe,0x00,0xbf,0x80,0x2e,0x74,0x05,0x22,0x02,0xa2,0x10,0xdf,0x61,0x2f }},
+ {16, 0x9570, 0, {0xd0,0x8b,0x90,0x02,0x3d,0xa4,0xaa,0x90,0x22,0xf4,0x0b,0x07,0x12,0x1d,0x20,0xbb }},
+ {16, 0x9580, 0, {0xc0,0x2f,0xd8,0x88,0x97,0x82,0xfd,0x80,0xef,0x72,0x22,0x08,0x28,0xf6,0x23,0xe0 }},
+ {16, 0x9590, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x40,0xb3,0x00,0x2c,0x00 }},
+ {16, 0x95a0, 0, {0x08,0x82,0x02,0x22,0x00,0x83,0x01,0x08,0xcc,0x8b,0x20,0x82,0xcc,0x00,0x90,0x00 }},
+ {16, 0x95b0, 0, {0x20,0x00,0x4b,0x12,0x02,0x0d,0x80,0xb3,0x40,0x2c,0xd8,0x08,0x20,0x42,0x8c,0x80 }},
+ {16, 0x95c0, 0, {0xb3,0x20,0x26,0x02,0x18,0x33,0x26,0xe2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x95d0, 0, {0xc0,0x15,0xac,0x09,0xbb,0x00,0x2e,0x60,0x08,0x80,0x02,0xa2,0x00,0x9b,0x00,0x2e }},
+ {16, 0x95e0, 0, {0xc0,0x0b,0xac,0x02,0x2c,0x00,0xba,0x06,0x22,0xc2,0x0b,0x94,0x02,0xac,0x10,0xbb }},
+ {16, 0x95f0, 0, {0x00,0x2e,0xc1,0x08,0xa8,0x02,0xec,0x00,0xab,0x00,0x22,0x00,0x08,0xb0,0x06,0xf0 }},
+ {16, 0x9600, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x15,0xec,0x00,0xfb,0x04,0x3e,0x60 }},
+ {16, 0x9610, 0, {0x28,0x82,0x13,0x0e,0x08,0xcb,0x00,0x3a,0xc0,0x0f,0x8c,0x03,0xec,0x11,0xdb,0x20 }},
+ {16, 0x9620, 0, {0xb2,0x90,0x4b,0xa8,0x0b,0x2c,0x00,0xbb,0x00,0x2c,0xc0,0x0c,0x88,0x13,0xac,0x00 }},
+ {16, 0x9630, 0, {0xf3,0x00,0x36,0x06,0x48,0xb0,0x12,0xc4,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9640, 0, {0xe0,0x01,0xbc,0x00,0xfb,0x08,0x3d,0x40,0x8f,0xea,0x01,0xf4,0x00,0xff,0x01,0x2f }},
+ {16, 0x9650, 0, {0xc0,0x0f,0xd0,0x22,0xfc,0x04,0xaf,0x00,0x3f,0xc0,0x8f,0xe9,0x03,0x7c,0x00,0xff }},
+ {16, 0x9660, 0, {0x00,0x3f,0xc0,0x0f,0x90,0x43,0xfc,0x20,0xef,0x02,0x3f,0x00,0x8f,0xf0,0x03,0xb8 }},
+ {16, 0x9670, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x10,0xac,0x08,0xeb,0x00,0x12,0x40 }},
+ {16, 0x9680, 0, {0x0f,0x90,0x03,0x28,0x20,0xab,0x00,0x3a,0xc0,0x8f,0x85,0x83,0xac,0x10,0xf3,0x50 }},
+ {16, 0x9690, 0, {0x32,0x90,0x4c,0x34,0x13,0x6c,0x00,0xfb,0x00,0x3e,0xc0,0x0c,0x98,0x03,0x2c,0x40 }},
+ {16, 0x96a0, 0, {0xeb,0x80,0x32,0x12,0x0d,0xb0,0x0b,0x50,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x96b0, 0, {0x88,0x01,0x3c,0x10,0x0f,0x05,0xa2,0x50,0x0c,0x10,0x02,0x22,0x10,0x8f,0x00,0x23 }},
+ {16, 0x96c0, 0, {0xc0,0x0b,0x88,0x12,0x3c,0x00,0x9b,0x82,0x22,0xc0,0x08,0xb0,0x02,0x3c,0x00,0x8f }},
+ {16, 0x96d0, 0, {0xa0,0x2f,0xc0,0x08,0xb0,0x02,0x3c,0x08,0x8f,0x02,0x20,0x00,0x08,0xf0,0x03,0x26 }},
+ {16, 0x96e0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4d,0x20,0x93,0x00,0x20,0xb2 }},
+ {16, 0x96f0, 0, {0x0b,0x10,0x02,0x01,0x00,0xa3,0x00,0x68,0xc0,0x0b,0x84,0x02,0xac,0x00,0xb3,0x80 }},
+ {16, 0x9700, 0, {0x20,0x40,0x0a,0x30,0x02,0x4c,0x00,0xa3,0x04,0x2c,0xc0,0x08,0x00,0x02,0x0d,0x00 }},
+ {16, 0x9710, 0, {0xa3,0x00,0x20,0x24,0x08,0x30,0x02,0x38,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9720, 0, {0x70,0x01,0x1c,0x20,0x97,0x80,0x23,0x60,0x08,0x78,0x12,0x3a,0x00,0x83,0x91,0x29 }},
+ {16, 0x9730, 0, {0xe4,0x0b,0x59,0x02,0x1e,0x00,0x97,0x90,0x20,0xfc,0x0a,0x78,0x02,0x1e,0x00,0x87 }},
+ {16, 0x9740, 0, {0x90,0x2d,0xe0,0x19,0x59,0x02,0x1e,0x80,0x83,0x80,0x61,0xa0,0x08,0x78,0x02,0x18 }},
+ {16, 0x9750, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x40,0xd3,0x32,0x30,0x06 }},
+ {16, 0x9760, 0, {0x0f,0x30,0x03,0x04,0x64,0xe3,0x01,0x38,0xc4,0x1f,0x30,0x07,0x8c,0x18,0xf1,0x00 }},
+ {16, 0x9770, 0, {0x30,0x4c,0x0e,0x30,0x03,0x4c,0x00,0xe3,0x00,0x2c,0xc0,0x0c,0x20,0x03,0x0e,0x00 }},
+ {16, 0x9780, 0, {0xe3,0x00,0x32,0x08,0x0c,0xb1,0x03,0x12,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9790, 0, {0x40,0x1d,0x9c,0x80,0xef,0x10,0x3d,0x44,0x4f,0xf1,0x07,0xcc,0x00,0xff,0x08,0x36 }},
+ {16, 0x97a0, 0, {0xc6,0xcf,0xb0,0x03,0xfc,0x00,0x97,0x00,0xbe,0xcc,0x0d,0xb1,0x03,0xfd,0x04,0xff }},
+ {16, 0x97b0, 0, {0x0c,0x3f,0xd2,0x9e,0xe0,0x4b,0xfd,0x20,0xff,0x02,0x3f,0x80,0x0e,0xf0,0x13,0xd0 }},
+ {16, 0x97c0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xec,0xc0,0xcb,0x28,0x3e,0xc0 }},
+ {16, 0x97d0, 0, {0x0f,0x80,0x03,0xec,0x00,0xfb,0x01,0x32,0xe9,0x0c,0x28,0x03,0x2c,0x00,0xfb,0x00 }},
+ {16, 0x97e0, 0, {0x32,0xc0,0x0c,0xb4,0x83,0x2c,0x01,0xef,0x00,0xb2,0xc8,0x0c,0x20,0x03,0x6d,0x00 }},
+ {16, 0x97f0, 0, {0xcb,0x10,0x3e,0x00,0x0f,0xb2,0x03,0xea,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9800, 0, {0xc8,0x91,0x9c,0xc4,0x87,0x60,0x2d,0xc0,0x0b,0x60,0x02,0xdc,0x00,0xb7,0x12,0x20 }},
+ {16, 0x9810, 0, {0xcc,0x0a,0x70,0x02,0x1c,0xc0,0xb3,0x00,0xa0,0xc0,0xc8,0x70,0x22,0x1c,0x80,0xb7 }},
+ {16, 0x9820, 0, {0x24,0x21,0xc8,0x48,0x50,0x02,0x0c,0x80,0x87,0x10,0x2d,0x40,0x0b,0x72,0x82,0xf2 }},
+ {16, 0x9830, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x81,0x00,0x8e,0x02,0x87,0x80,0x2d,0xe0 }},
+ {16, 0x9840, 0, {0x0b,0x78,0x12,0xde,0x00,0xb7,0xa0,0x21,0xe0,0x08,0xf8,0x8e,0x1e,0x40,0xb7,0x88 }},
+ {16, 0x9850, 0, {0x21,0xe0,0x08,0x38,0x02,0x1e,0x40,0xb3,0xa1,0x20,0xe8,0x48,0xf8,0x82,0x5e,0x02 }},
+ {16, 0x9860, 0, {0x87,0x80,0x2d,0x22,0x0b,0x79,0x02,0xe0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9870, 0, {0x08,0x04,0xcc,0x04,0x83,0x02,0x2c,0xd4,0x0b,0x30,0x02,0xcc,0x00,0xb3,0x00,0xa0 }},
+ {16, 0x9880, 0, {0xc0,0x8a,0x38,0x06,0x0c,0x00,0xb3,0x80,0x20,0xe1,0x48,0x39,0x12,0x2c,0x00,0xb3 }},
+ {16, 0x9890, 0, {0x00,0x22,0xc0,0x08,0xb0,0x82,0x6c,0x00,0x83,0x00,0x2c,0x48,0x0b,0x30,0x02,0xc2 }},
+ {16, 0x98a0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x05,0xa8,0x00,0xca,0x00,0x3f,0xa0 }},
+ {16, 0x98b0, 0, {0x0f,0xe4,0x03,0xd8,0x00,0xfa,0x00,0x32,0x80,0x0c,0xe8,0x03,0x28,0x00,0xfa,0x40 }},
+ {16, 0x98c0, 0, {0x32,0xa8,0x2c,0xa0,0x09,0x28,0x08,0xf2,0x00,0x32,0x80,0x0c,0xe4,0x03,0x68,0x00 }},
+ {16, 0x98d0, 0, {0xca,0x00,0x3f,0x80,0x0f,0xa0,0x03,0xfb,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x98e0, 0, {0x48,0x00,0xc0,0x00,0xf8,0x01,0x3e,0x12,0x0b,0x80,0x03,0xe0,0x40,0xf8,0x00,0x3e }},
+ {16, 0x98f0, 0, {0x00,0x4f,0x84,0x03,0xe0,0x04,0xf0,0x08,0x3e,0x00,0x4f,0x00,0x03,0xe0,0x00,0xf8 }},
+ {16, 0x9900, 0, {0x41,0x3e,0x00,0x2f,0x84,0x03,0xa0,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x80,0x03,0xd2 }},
+ {16, 0x9910, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0xe6,0x00,0xc9,0x12,0x3e,0x50 }},
+ {16, 0x9920, 0, {0x8f,0x90,0x83,0xe4,0x20,0xc1,0x00,0x3a,0x41,0x0f,0x90,0x03,0xe4,0x00,0xf9,0x00 }},
+ {16, 0x9930, 0, {0x30,0x68,0x0c,0x90,0x03,0x24,0x00,0xd9,0x00,0x3a,0x40,0x0e,0x98,0x03,0x24,0x00 }},
+ {16, 0x9940, 0, {0xc9,0x90,0x3e,0x69,0x0c,0x10,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9950, 0, {0x80,0x04,0x67,0x4a,0x89,0x80,0x2e,0x50,0x0b,0x90,0x02,0xe4,0x80,0xa9,0x00,0x22 }},
+ {16, 0x9960, 0, {0x40,0x0b,0x90,0x02,0xe4,0x00,0xb9,0x01,0x22,0x40,0x08,0x90,0x02,0x24,0x10,0x89 }},
+ {16, 0x9970, 0, {0x00,0x22,0x40,0x08,0x93,0x02,0x24,0x22,0x89,0x42,0x2c,0x60,0x48,0x90,0x02,0x20 }},
+ {16, 0x9980, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x15,0x24,0x00,0x99,0x00,0x2e,0x40 }},
+ {16, 0x9990, 0, {0x0b,0x90,0x02,0xe4,0x00,0x89,0x00,0x2a,0x40,0x0b,0x90,0x02,0xe4,0x00,0xb9,0x00 }},
+ {16, 0x99a0, 0, {0x23,0x40,0x08,0xd0,0x02,0x24,0x00,0x99,0x00,0x2a,0x40,0x0a,0x90,0x06,0x24,0x40 }},
+ {16, 0x99b0, 0, {0x89,0x41,0x2e,0x40,0x08,0x90,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x99c0, 0, {0x08,0x04,0x0c,0x80,0x91,0x20,0x2c,0x48,0x0b,0x10,0x02,0xc4,0x00,0xa1,0x20,0x20 }},
+ {16, 0x99d0, 0, {0x48,0x0b,0x10,0x02,0xc4,0x80,0xb1,0x20,0xa1,0x49,0x08,0x52,0x4a,0x04,0x80,0x81 }},
+ {16, 0x99e0, 0, {0x00,0x20,0x48,0x48,0x12,0x0a,0x04,0x80,0x81,0x20,0x2c,0x40,0x28,0x12,0x02,0x02 }},
+ {16, 0x99f0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x08,0xd8,0x04,0x3e,0x80 }},
+ {16, 0x9a00, 0, {0x0f,0x85,0x03,0xe0,0x00,0xc0,0x50,0x3a,0x14,0x0f,0xa5,0x03,0xe1,0x40,0xf8,0x02 }},
+ {16, 0x9a10, 0, {0x32,0x80,0x2c,0xc5,0x03,0x21,0x40,0xda,0x00,0x3a,0x14,0x0e,0x85,0x43,0x21,0x40 }},
+ {16, 0x9a20, 0, {0xc8,0x52,0x3e,0x14,0x0c,0x85,0x0b,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9a30, 0, {0x88,0x1d,0xe4,0x44,0xe9,0x10,0x3f,0x44,0x4f,0xd0,0x02,0xfc,0x00,0xf9,0x12,0x3e }},
+ {16, 0x9a40, 0, {0x44,0x0f,0xd0,0x03,0xe4,0x40,0xfd,0x10,0x3e,0x44,0x4f,0x91,0x03,0xe4,0x40,0xe9 }},
+ {16, 0x9a50, 0, {0x40,0x3e,0x44,0x0f,0xd1,0x03,0xe4,0x40,0xf9,0x12,0x3f,0x40,0x0f,0x91,0x03,0xe6 }},
+ {16, 0x9a60, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xf6,0xa0,0xfd,0x80,0xb3,0x40 }},
+ {16, 0x9a70, 0, {0x0c,0x10,0x03,0x14,0x00,0xfd,0xa0,0x32,0x40,0x0f,0xd1,0x03,0xe4,0x00,0xf5,0x86 }},
+ {16, 0x9a80, 0, {0x33,0x60,0x2c,0x9a,0x83,0x24,0x04,0xfd,0xa8,0x22,0x40,0x0d,0x50,0x43,0xf4,0x00 }},
+ {16, 0x9a90, 0, {0xfd,0x00,0x33,0x40,0x0f,0x90,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9aa0, 0, {0x78,0x10,0xe1,0x00,0xb8,0x00,0x22,0x00,0x28,0x80,0x02,0x20,0x00,0xb8,0x00,0xa2 }},
+ {16, 0x9ab0, 0, {0x00,0x0b,0x8a,0x12,0xe0,0x00,0xb8,0x04,0x22,0x14,0x08,0x84,0x02,0x20,0x00,0xb8 }},
+ {16, 0x9ac0, 0, {0x40,0x20,0x00,0x88,0x80,0x02,0xe0,0x00,0xb8,0x00,0xa2,0x00,0x0b,0x80,0x02,0x0e }},
+ {16, 0x9ad0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x05,0xc4,0x00,0xb1,0x42,0x20,0x40 }},
+ {16, 0x9ae0, 0, {0x08,0x10,0x02,0x04,0x00,0xb1,0x40,0x20,0x40,0x0b,0x10,0x06,0xc4,0x00,0xb1,0x40 }},
+ {16, 0x9af0, 0, {0x24,0x40,0x08,0x10,0x02,0x44,0x04,0xb1,0x00,0x60,0x40,0x09,0x10,0x02,0xc4,0x00 }},
+ {16, 0x9b00, 0, {0xb1,0x00,0x20,0x40,0x0b,0x10,0x02,0x12,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9b10, 0, {0x18,0x15,0xa4,0x00,0xb9,0x02,0x22,0x60,0x08,0x94,0x02,0x24,0x00,0xb9,0x01,0x22 }},
+ {16, 0x9b20, 0, {0x40,0x0b,0x90,0x06,0xe4,0x00,0xb9,0x20,0x26,0x40,0x08,0x94,0x02,0x64,0x08,0xb9 }},
+ {16, 0x9b30, 0, {0x00,0x22,0x40,0x08,0x92,0x02,0xec,0x08,0xb9,0x04,0x22,0x41,0x0b,0x10,0x02,0x06 }},
+ {16, 0x9b40, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x10,0xf1,0x00,0x32,0x60 }},
+ {16, 0x9b50, 0, {0x0c,0x94,0x0b,0x25,0x00,0xf9,0x00,0x32,0x40,0x8f,0x94,0xd3,0xe4,0x00,0xf9,0x00 }},
+ {16, 0x9b60, 0, {0x36,0x40,0x4c,0x90,0x0b,0x64,0x00,0xf1,0x00,0x32,0x40,0x0d,0x92,0x12,0xe4,0x00 }},
+ {16, 0x9b70, 0, {0xf9,0x00,0x32,0x40,0x0f,0x90,0x0b,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9b80, 0, {0x68,0x41,0xa4,0x00,0xf9,0x00,0x3c,0x40,0x8f,0x92,0x03,0xe4,0x00,0xf9,0x00,0x3e }},
+ {16, 0x9b90, 0, {0x40,0x0f,0x9c,0x03,0xe4,0x00,0xf9,0x00,0xba,0x40,0x2f,0x90,0x23,0xa4,0x00,0xf9 }},
+ {16, 0x9ba0, 0, {0x08,0xbe,0x40,0xcf,0x90,0x03,0xe4,0x10,0xf1,0x01,0x3e,0x41,0x0f,0x90,0x03,0xda }},
+ {16, 0x9bb0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0xc8,0xf8,0x00,0x3e,0x03 }},
+ {16, 0x9bc0, 0, {0x0c,0x84,0x03,0xa1,0x10,0xe8,0x00,0x32,0x00,0x8c,0x85,0x83,0xe0,0x00,0xc0,0x00 }},
+ {16, 0x9bd0, 0, {0x38,0x0c,0x2c,0x00,0x03,0x60,0x00,0xc8,0x00,0x3c,0x00,0x0d,0x80,0x02,0x20,0x10 }},
+ {16, 0x9be0, 0, {0xc8,0x20,0xb2,0x02,0x0f,0x80,0x03,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9bf0, 0, {0x28,0x05,0x39,0x10,0xbe,0x04,0x6f,0xa0,0x08,0xa0,0x02,0x3a,0x00,0x82,0x00,0xa2 }},
+ {16, 0x9c00, 0, {0x80,0x8d,0xec,0x03,0xa8,0x00,0x8a,0x00,0x23,0x80,0x08,0xa0,0x22,0x28,0x00,0x8e }},
+ {16, 0x9c10, 0, {0xcc,0x2f,0x80,0x08,0xe8,0xc2,0xb8,0x00,0x8e,0x60,0x23,0x90,0x0b,0xa0,0x02,0xca }},
+ {16, 0x9c20, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4e,0x08,0xb0,0x72,0x2c,0xd0 }},
+ {16, 0x9c30, 0, {0x28,0xb0,0x06,0x8c,0x01,0xa1,0x02,0x20,0xc0,0x08,0x38,0x02,0xcc,0x00,0x83,0x00 }},
+ {16, 0x9c40, 0, {0x20,0xc0,0x29,0x30,0x02,0x4c,0x00,0x81,0x00,0x2c,0xc0,0x08,0x32,0x02,0x0c,0x40 }},
+ {16, 0x9c50, 0, {0x83,0x00,0x20,0xf4,0x0b,0x30,0x02,0xca,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9c60, 0, {0xa0,0x01,0x1c,0x00,0xb4,0x00,0x2d,0xd0,0x48,0xf2,0x02,0x1e,0x21,0x85,0x20,0x20 }},
+ {16, 0x9c70, 0, {0xe8,0x09,0x72,0x02,0x8e,0x80,0x8f,0x01,0x20,0xc0,0x09,0x72,0x02,0x0e,0x80,0x87 }},
+ {16, 0x9c80, 0, {0x00,0x2d,0xcc,0x18,0x58,0x02,0x8e,0x00,0x85,0x00,0x21,0xc0,0x0b,0x72,0x02,0xe8 }},
+ {16, 0x9c90, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0x00,0xb4,0x80,0x2d,0xe0 }},
+ {16, 0x9ca0, 0, {0x0c,0x78,0x83,0x9a,0x00,0xed,0xd0,0x31,0xf4,0x0c,0x6a,0x03,0xde,0x82,0xc7,0x80 }},
+ {16, 0x9cb0, 0, {0x39,0xe0,0x0d,0xf8,0x83,0x5e,0xc2,0xc5,0x80,0x3d,0xe8,0x0c,0x68,0x03,0x12,0x00 }},
+ {16, 0x9cc0, 0, {0xcf,0x80,0x31,0xe0,0x0f,0x7e,0x83,0xea,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9cd0, 0, {0x08,0x0d,0xac,0x08,0xf8,0x00,0x3c,0xc0,0x0f,0xb3,0x03,0xec,0x00,0xf9,0x02,0x3e }},
+ {16, 0x9ce0, 0, {0xc8,0x0f,0xb0,0x03,0xed,0x40,0xfb,0x00,0xbe,0x80,0x0e,0xb3,0x03,0xed,0xc0,0xfb }},
+ {16, 0x9cf0, 0, {0x00,0x3e,0xd2,0x2e,0x80,0x03,0xec,0x02,0xf9,0x00,0x3e,0xc0,0x0f,0xb0,0x03,0xc2 }},
+ {16, 0x9d00, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfe,0x00,0xf0,0x91,0x33,0xe0 }},
+ {16, 0x9d10, 0, {0x8f,0xf8,0x03,0xfe,0x00,0xfd,0x80,0x3f,0xe0,0x0c,0x78,0x83,0x3f,0x00,0xcf,0x80 }},
+ {16, 0x9d20, 0, {0x3f,0xa0,0x0c,0xf8,0x03,0x3e,0x00,0xcd,0x80,0x3f,0xe0,0x0f,0xf8,0x13,0xfe,0x10 }},
+ {16, 0x9d30, 0, {0xff,0x80,0x3f,0x20,0x0f,0xf9,0x43,0xd0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9d40, 0, {0xa8,0x11,0x9c,0x00,0xb4,0xc1,0x31,0xc0,0x0b,0x70,0x02,0xd4,0x10,0xe5,0x20,0x2f }},
+ {16, 0x9d50, 0, {0xc8,0x0f,0x40,0x03,0x5c,0x00,0x87,0x00,0x2d,0x80,0x08,0x70,0x02,0x1c,0x40,0x87 }},
+ {16, 0x9d60, 0, {0x10,0x2d,0xc0,0x0b,0x76,0x02,0xdc,0x80,0xb7,0x00,0x2d,0xc0,0x0b,0x70,0x02,0xea }},
+ {16, 0x9d70, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x9c,0x00,0xb6,0x22,0x21,0xd0 }},
+ {16, 0x9d80, 0, {0x0b,0x70,0x82,0xd8,0x40,0xb5,0x02,0x2d,0xc0,0x88,0x65,0x02,0x0c,0x00,0x87,0x18 }},
+ {16, 0x9d90, 0, {0x2c,0x04,0x08,0x30,0x02,0x8c,0x02,0x85,0x00,0x2d,0xc0,0x0b,0x70,0x46,0x90,0x10 }},
+ {16, 0x9da0, 0, {0xb6,0x00,0x2d,0x00,0x0b,0x70,0x22,0xc4,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9db0, 0, {0x60,0x14,0xcc,0x08,0xb2,0x00,0xa4,0xc0,0x0b,0x30,0x42,0xc6,0x10,0xa1,0x00,0x2c }},
+ {16, 0x9dc0, 0, {0xc0,0x0a,0x00,0x02,0x4c,0x00,0x83,0x00,0x2c,0x08,0x08,0x30,0x02,0x8c,0x00,0x83 }},
+ {16, 0x9dd0, 0, {0x00,0x2c,0xc0,0x0b,0x18,0x82,0xc4,0x00,0xb0,0x00,0x2c,0x40,0x0b,0x30,0x12,0xd8 }},
+ {16, 0x9de0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x15,0xac,0x00,0x38,0x00,0x32,0x50 }},
+ {16, 0x9df0, 0, {0x0f,0xf0,0x03,0xe6,0x20,0xfd,0x00,0x3f,0xc0,0x08,0xd0,0x02,0x3c,0x02,0xcb,0x80 }},
+ {16, 0x9e00, 0, {0x3c,0x50,0x2c,0xf0,0x0a,0xbc,0x00,0xc9,0x00,0x3f,0xc0,0x0f,0xbe,0x03,0xac,0x00 }},
+ {16, 0x9e10, 0, {0xfa,0x02,0x2e,0xf7,0x4f,0xf0,0x03,0xee,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9e20, 0, {0x80,0x00,0xec,0x00,0xf1,0x00,0x3a,0xf0,0x0f,0xb0,0x03,0xe9,0x00,0xf9,0x01,0x3e }},
+ {16, 0x9e30, 0, {0xc0,0x0f,0x90,0x13,0xec,0x00,0xf9,0x00,0x3e,0x55,0x0f,0xb0,0x01,0x6c,0x00,0xfb }},
+ {16, 0x9e40, 0, {0x02,0x3e,0xc0,0x0f,0x90,0x73,0xe0,0x00,0xf8,0x41,0x3e,0x00,0x0f,0x30,0x01,0xe0 }},
+ {16, 0x9e50, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xfc,0x00,0xfc,0x00,0x33,0xc0 }},
+ {16, 0x9e60, 0, {0x1f,0xf0,0x13,0xf0,0x08,0xfd,0x02,0x3f,0xc0,0x8d,0xc0,0x03,0x3c,0x00,0xcf,0xa0 }},
+ {16, 0x9e70, 0, {0x3f,0x80,0x0c,0x70,0x03,0x3c,0x10,0xfc,0x00,0x37,0xc0,0x0f,0xe0,0x03,0xb0,0x00 }},
+ {16, 0x9e80, 0, {0xfe,0x00,0x3f,0xc0,0x0c,0xf0,0x03,0x04,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9e90, 0, {0x84,0x04,0x6e,0x00,0xb9,0xc2,0xa2,0xf0,0x0b,0xb0,0x42,0xeb,0x00,0xb9,0x00,0x2e }},
+ {16, 0x9ea0, 0, {0xc0,0x0f,0x18,0x03,0x6c,0x00,0xd9,0x81,0x2e,0xb0,0x0a,0xb0,0x42,0x2c,0x00,0xba }},
+ {16, 0x9eb0, 0, {0xc6,0x2e,0xc0,0x0b,0x8c,0x02,0xe3,0x00,0xb8,0xc0,0x3c,0xa0,0x0d,0xb0,0x02,0x20 }},
+ {16, 0x9ec0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2f,0x00,0xb8,0x80,0x22,0xe2 }},
+ {16, 0x9ed0, 0, {0x0b,0xb0,0x02,0xe6,0x20,0xb9,0x00,0x2c,0xc0,0x08,0xb8,0x02,0x0c,0x00,0x8b,0x00 }},
+ {16, 0x9ee0, 0, {0x2e,0x30,0x48,0xb0,0x02,0x2c,0x00,0xb9,0xc0,0x2e,0xc1,0x0b,0x88,0x02,0xee,0x10 }},
+ {16, 0x9ef0, 0, {0xb9,0xc0,0x2e,0x20,0x19,0xb0,0x02,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9f00, 0, {0x08,0x04,0x0c,0x00,0xb0,0x00,0x20,0xc0,0x0b,0x30,0x06,0xc0,0x00,0x91,0x00,0x2c }},
+ {16, 0x9f10, 0, {0xc0,0x49,0x80,0x02,0x4c,0x04,0x91,0x00,0x2c,0x00,0x8a,0x30,0x0a,0x0c,0x04,0xb1 }},
+ {16, 0x9f20, 0, {0x00,0x2c,0xc0,0x1b,0x00,0x12,0x49,0x10,0xb1,0x00,0x2e,0x20,0x09,0x30,0x02,0x02 }},
+ {16, 0x9f30, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x6c,0x00,0xb8,0x20,0x22,0xc0 }},
+ {16, 0x9f40, 0, {0x8b,0xf0,0x03,0xe0,0x08,0xfd,0x00,0x3f,0xc0,0x0c,0xa0,0x03,0x3c,0x00,0xcb,0x00 }},
+ {16, 0x9f50, 0, {0x3e,0x00,0x4c,0xf0,0x0a,0x3c,0x00,0xb9,0x00,0x37,0xc1,0x0f,0xa0,0x03,0xe0,0x00 }},
+ {16, 0x9f60, 0, {0xfa,0x00,0x3e,0x00,0x0d,0xf0,0x0b,0x00,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9f70, 0, {0xa0,0x1d,0xf0,0x01,0xfc,0x40,0x3f,0x80,0x4f,0xf0,0x02,0xf0,0x00,0xfd,0x00,0x3f }},
+ {16, 0x9f80, 0, {0xc1,0x0f,0xc0,0x03,0xfc,0x00,0xfd,0x00,0x3f,0x00,0x4f,0xf0,0x63,0xfc,0x00,0xfd }},
+ {16, 0x9f90, 0, {0x04,0x3f,0xc0,0x0f,0xc0,0x03,0xf0,0x80,0xfc,0x00,0x7b,0x00,0x0f,0xf0,0x43,0xe8 }},
+ {16, 0x9fa0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xf8,0x00,0xc8,0x10,0x33,0x04 }},
+ {16, 0x9fb0, 0, {0x0c,0x40,0x02,0x34,0x00,0xc8,0x85,0x1f,0xc0,0x2d,0xd9,0x03,0xfc,0xc0,0xdb,0x28 }},
+ {16, 0x9fc0, 0, {0x37,0x64,0x0f,0xdb,0x03,0x3e,0x00,0xff,0x25,0x3f,0xc8,0x0e,0xf2,0x03,0xfe,0x20 }},
+ {16, 0x9fd0, 0, {0xff,0xa4,0x37,0xc4,0x0c,0xc8,0x03,0x30,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9fe0, 0, {0x80,0x10,0xe8,0x00,0x88,0x20,0x22,0x00,0x08,0x88,0x12,0x26,0x04,0x89,0x82,0x2e }},
+ {16, 0x9ff0, 0, {0xf4,0x48,0xb8,0x02,0xfc,0xc4,0x98,0xc2,0x22,0x7c,0x4b,0x9d,0x42,0x26,0x08,0xbf }},
+ {16, 0xa000, 0, {0x18,0x77,0xe4,0x08,0xf1,0x82,0xef,0x00,0xbb,0xd0,0x22,0xd8,0x08,0x90,0x83,0x60 }},
+ {16, 0xa010, 0, {0x02,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x45,0xc8,0x04,0xa0,0x00,0x24,0x00 }},
+ {16, 0xa020, 0, {0x0a,0x00,0x02,0x0c,0x00,0x82,0x04,0x2c,0xe0,0x08,0x10,0x02,0xcc,0x80,0x83,0x00 }},
+ {16, 0xa030, 0, {0x24,0x00,0x0b,0x10,0x06,0xc8,0x01,0xb3,0x20,0x2c,0xc0,0x29,0x32,0x02,0xc8,0x08 }},
+ {16, 0xa040, 0, {0xb1,0x00,0x24,0xd0,0x08,0x82,0x02,0x62,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa050, 0, {0xc0,0x15,0xa8,0x00,0xa8,0x0c,0x26,0x00,0x0a,0x80,0x02,0x2c,0x14,0x8a,0x02,0x6e }},
+ {16, 0xa060, 0, {0xe0,0x08,0xb0,0x02,0x4c,0x08,0xa8,0x00,0x26,0x20,0x0b,0x9c,0x02,0xe4,0x00,0xbb }},
+ {16, 0xa070, 0, {0x04,0x22,0xc0,0x19,0xb0,0x02,0xe8,0x01,0xbb,0x11,0x02,0xc0,0x88,0x90,0x02,0xf0 }},
+ {16, 0xa080, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0xec,0x02,0xea,0x40,0xb6,0x60 }},
+ {16, 0xa090, 0, {0x2e,0x98,0x0b,0x20,0x02,0xc8,0x02,0x3e,0xc0,0x0d,0x98,0x03,0xec,0x02,0xdb,0x88 }},
+ {16, 0xa0a0, 0, {0xb6,0x21,0x0f,0x88,0x03,0xac,0x08,0xfb,0x00,0x2c,0xc0,0x0e,0xb0,0x43,0xe5,0x80 }},
+ {16, 0xa0b0, 0, {0xf0,0x60,0x36,0xc0,0x0c,0x01,0x43,0x48,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa0c0, 0, {0xe0,0x01,0xbc,0x00,0xd6,0x01,0x3b,0x64,0x85,0xd9,0x03,0xf0,0x0c,0xff,0x00,0x3e }},
+ {16, 0xa0d0, 0, {0xc1,0x0f,0xfc,0x21,0xec,0x00,0xd7,0x90,0x3b,0x40,0x0f,0x50,0x03,0x3c,0x00,0xff }},
+ {16, 0xa0e0, 0, {0x00,0x3f,0xc0,0x8e,0xf0,0x03,0xf4,0x40,0xfd,0x88,0x3f,0xc0,0x2f,0xd0,0x02,0x78 }},
+ {16, 0xa0f0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0x8c,0x00,0xda,0x40,0x3c,0x40 }},
+ {16, 0xa100, 0, {0x0f,0x10,0x03,0x48,0x00,0xf9,0x22,0x3c,0xc2,0x0e,0x90,0x83,0xec,0x02,0xdb,0x04 }},
+ {16, 0xa110, 0, {0x3a,0x08,0x0f,0x84,0x87,0xe8,0x00,0xcb,0x00,0x3e,0xc4,0x0e,0xb0,0x03,0xed,0x00 }},
+ {16, 0xa120, 0, {0xe8,0x42,0x3a,0xc0,0x0f,0x80,0x0b,0x10,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa130, 0, {0x88,0x05,0x2c,0x08,0x8a,0x00,0x2e,0x42,0x8b,0x90,0x02,0x28,0x18,0xbb,0x49,0x22 }},
+ {16, 0xa140, 0, {0xd0,0x38,0xbc,0x82,0xfc,0x00,0xe8,0x02,0x22,0x62,0xcb,0x9c,0x00,0xef,0x60,0xdf }},
+ {16, 0xa150, 0, {0x00,0x2f,0xc0,0x0b,0xf0,0x02,0xec,0x00,0x09,0x40,0x37,0xc0,0x0b,0x90,0x02,0x32 }},
+ {16, 0xa160, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x48,0x10,0x11,0x00,0x2c,0xa0 }},
+ {16, 0xa170, 0, {0x0b,0x20,0x02,0x44,0x00,0x90,0xc0,0x64,0x34,0x28,0x34,0x02,0xcc,0x00,0x93,0x84 }},
+ {16, 0xa180, 0, {0x28,0x40,0x0b,0x08,0x00,0xce,0x00,0x93,0x00,0x2c,0xc2,0x0a,0x30,0x02,0xc0,0x00 }},
+ {16, 0xa190, 0, {0xb2,0x40,0x22,0xc0,0x0b,0x20,0x02,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa1a0, 0, {0x70,0x01,0x1a,0x40,0x85,0x80,0x2d,0xa0,0x0b,0x68,0x06,0x16,0x80,0xbd,0x90,0x25 }},
+ {16, 0xa1b0, 0, {0x24,0x18,0x7b,0x42,0xde,0x40,0xa0,0x80,0x21,0xe0,0x0b,0x68,0x02,0xd6,0x00,0x97 }},
+ {16, 0xa1c0, 0, {0x90,0x2d,0xe0,0x0b,0x78,0x02,0xce,0x40,0x92,0x80,0x6d,0xe4,0x0b,0x78,0x02,0x08 }},
+ {16, 0xa1d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x28,0x00,0xd1,0x80,0x3c,0x88 }},
+ {16, 0xa1e0, 0, {0x0b,0x22,0x03,0x4e,0x80,0xf2,0xa1,0x3c,0x24,0x2a,0x39,0x03,0xcc,0x40,0xd3,0xac }},
+ {16, 0xa1f0, 0, {0x38,0xc5,0x0f,0x30,0x82,0xc8,0x00,0xd3,0x00,0x3c,0xc0,0x0e,0x30,0x13,0xc0,0x00 }},
+ {16, 0xa200, 0, {0xf1,0x00,0x38,0xc0,0x0f,0xa0,0x03,0x1a,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa210, 0, {0x40,0x1d,0xb8,0x10,0xfd,0x34,0x3e,0x80,0x0f,0xe0,0x03,0xee,0x00,0x72,0x00,0x3a }},
+ {16, 0xa220, 0, {0x00,0x0f,0xb0,0x63,0xec,0x40,0xf8,0x22,0x3e,0xc0,0x0f,0xf0,0x03,0xd4,0x40,0xff }},
+ {16, 0xa230, 0, {0x00,0x3f,0xd2,0x0f,0xf0,0x03,0xec,0x00,0xcf,0x00,0x37,0xc0,0x0f,0xf0,0x03,0xd0 }},
+ {16, 0xa240, 0, {0x06,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xee,0x00,0xeb,0x00,0x36,0xe0 }},
+ {16, 0xa250, 0, {0x0d,0xb0,0x03,0x20,0x00,0xf0,0x80,0x33,0xc0,0x08,0xb8,0x03,0x2c,0x80,0xcb,0x00 }},
+ {16, 0xa260, 0, {0x32,0x80,0x0f,0xa0,0x13,0x6e,0x08,0xcb,0x28,0x32,0xe0,0x0d,0xb4,0x83,0xe2,0x00 }},
+ {16, 0xa270, 0, {0xca,0x00,0x3e,0xe0,0x0c,0xa8,0x03,0x02,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa280, 0, {0xc8,0x11,0x8c,0x04,0x83,0x00,0x21,0xc0,0x48,0x70,0x02,0x10,0x00,0xb7,0x02,0x21 }},
+ {16, 0xa290, 0, {0xc0,0x4a,0x70,0x02,0x0d,0x48,0xd4,0x00,0x35,0xc0,0x0e,0x60,0x02,0xdc,0x00,0xa7 }},
+ {16, 0xa2a0, 0, {0x40,0x29,0xc0,0x09,0x72,0x02,0xd4,0x10,0xa6,0x02,0x2f,0xc8,0x08,0x70,0x02,0x12 }},
+ {16, 0xa2b0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x9e,0x00,0xa7,0x80,0x20,0xe0 }},
+ {16, 0xa2c0, 0, {0x0a,0x38,0x02,0x1a,0x00,0xb5,0x80,0x21,0xe0,0x08,0xf8,0x22,0x5c,0x81,0x83,0x80 }},
+ {16, 0xa2d0, 0, {0x21,0xa1,0x0b,0x78,0x82,0x5a,0x10,0x83,0xa0,0x20,0xe8,0x0a,0x7b,0x02,0xda,0x00 }},
+ {16, 0xa2e0, 0, {0x97,0xc0,0x2d,0xe4,0x08,0xe8,0x02,0x08,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa2f0, 0, {0x08,0x14,0xcc,0x00,0x83,0x10,0x20,0xc0,0x0a,0x30,0x02,0x08,0x08,0xb3,0x70,0x20 }},
+ {16, 0xa300, 0, {0xf8,0x0a,0x30,0x42,0x4c,0x04,0x93,0x14,0x26,0xc4,0x0a,0x38,0x02,0xcc,0x00,0xa3 }},
+ {16, 0xa310, 0, {0x00,0x28,0xc0,0xaa,0x30,0x02,0xce,0x40,0xb3,0x88,0x2c,0xc0,0x28,0x30,0x0a,0x12 }},
+ {16, 0xa320, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa9,0x00,0xea,0x80,0xb6,0x90 }},
+ {16, 0xa330, 0, {0x2f,0x24,0x0b,0x39,0x04,0xbe,0xc0,0x33,0x92,0x0c,0xa0,0x0b,0x68,0x18,0xce,0xc0 }},
+ {16, 0xa340, 0, {0x33,0x80,0x0f,0xe9,0x43,0x78,0x00,0xca,0x00,0x32,0x80,0x0f,0xa0,0x13,0xf8,0x48 }},
+ {16, 0xa350, 0, {0xde,0x00,0x3e,0x80,0x0c,0xe0,0x02,0x3a,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa360, 0, {0x48,0x00,0xe0,0x24,0xf8,0x00,0x3e,0x12,0x0d,0x80,0x93,0xb0,0x28,0xf8,0x00,0xbc }},
+ {16, 0xa370, 0, {0x00,0x0f,0x84,0x03,0xa0,0x00,0xf0,0x00,0x3e,0x02,0x0e,0x80,0x00,0xe0,0x00,0xf8 }},
+ {16, 0xa380, 0, {0x01,0x3e,0x00,0x0d,0x80,0x03,0xe0,0x00,0xe8,0x00,0x3e,0x00,0x0f,0x80,0x03,0xd2 }},
+ {16, 0xa390, 0, {0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xf9,0x00,0xb2,0x70 }},
+ {16, 0xa3a0, 0, {0x0f,0x90,0x01,0x04,0x00,0xc9,0x00,0x3e,0x40,0x0c,0x98,0x03,0xe4,0x04,0xe9,0x08 }},
+ {16, 0xa3b0, 0, {0x3a,0x48,0x0c,0x9a,0x03,0xe4,0x00,0xf9,0x00,0x36,0x40,0x0b,0x10,0x0b,0x26,0x80 }},
+ {16, 0xa3c0, 0, {0xf1,0x80,0x32,0x40,0x0f,0x90,0x03,0xc2,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa3d0, 0, {0x80,0x04,0x64,0x00,0xb9,0x00,0x22,0x61,0x0b,0x90,0x02,0x24,0x08,0x89,0x00,0x2e }},
+ {16, 0xa3e0, 0, {0x40,0x0d,0x9a,0x02,0xe4,0x08,0xa9,0x00,0x22,0x78,0x0d,0x94,0x06,0xe4,0x10,0xb9 }},
+ {16, 0xa3f0, 0, {0x00,0x22,0x50,0x0b,0x90,0x02,0x25,0x80,0xb9,0x80,0x36,0x40,0x0b,0x90,0x02,0xe0 }},
+ {16, 0xa400, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0xb5,0x00,0x23,0x42 }},
+ {16, 0xa410, 0, {0x0b,0xd0,0x0e,0xb4,0x00,0x89,0x04,0x2e,0x60,0x08,0x91,0x02,0xc4,0x04,0xb9,0x04 }},
+ {16, 0xa420, 0, {0x2a,0xc0,0x08,0x94,0x02,0xe4,0x10,0xb1,0x00,0x26,0x42,0x0a,0x90,0x02,0x24,0x00 }},
+ {16, 0xa430, 0, {0xb9,0x21,0x62,0x40,0x0b,0x90,0x02,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa440, 0, {0x08,0x04,0x05,0x00,0xb5,0x40,0x21,0x50,0x4b,0x50,0x06,0x94,0x02,0x81,0x00,0x2c }},
+ {16, 0xa450, 0, {0x60,0x29,0x14,0x06,0xc5,0x00,0xa1,0x22,0x20,0x51,0x89,0x14,0x02,0xc4,0x00,0xb1 }},
+ {16, 0xa460, 0, {0x20,0x20,0x48,0x0b,0x14,0x02,0x04,0x01,0xb1,0x00,0x04,0x50,0x0b,0x10,0x02,0xc2 }},
+ {16, 0xa470, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x08,0xb8,0x00,0x32,0x00 }},
+ {16, 0xa480, 0, {0x8f,0x80,0x03,0xb0,0x00,0x88,0x00,0x3e,0x00,0x0c,0x80,0x03,0xe0,0x00,0xe8,0x04 }},
+ {16, 0xa490, 0, {0x3a,0x00,0x0c,0x80,0x02,0xe0,0x00,0xf8,0x50,0x36,0x00,0x0f,0x80,0x03,0x20,0x04 }},
+ {16, 0xa4a0, 0, {0xf8,0x01,0x12,0x00,0x4f,0x80,0x07,0xee,0x07,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa4b0, 0, {0x98,0x1d,0xe5,0x10,0xf9,0x40,0x3e,0x50,0x0f,0x94,0x02,0x65,0x01,0xfd,0x01,0x3d }},
+ {16, 0xa4c0, 0, {0x50,0x4f,0x50,0x13,0xe5,0x00,0xfd,0x10,0x1f,0x50,0x07,0xd4,0x43,0xd4,0x00,0xf9 }},
+ {16, 0xa4d0, 0, {0x10,0x1e,0x44,0x0f,0x94,0x03,0xd5,0x00,0xfd,0x40,0x3e,0x50,0x0f,0x52,0x83,0xee }},
+ {16, 0xa4e0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x15,0xe4,0x40,0xf9,0x60,0x3f,0x44 }},
+ {16, 0xa4f0, 0, {0x0f,0xd0,0xc3,0xe4,0x30,0xf9,0x01,0x3e,0x42,0x0c,0xd0,0x03,0xe7,0x80,0xdd,0xa0 }},
+ {16, 0xa500, 0, {0x33,0x40,0x0c,0xd0,0x03,0xfc,0x00,0xc9,0x90,0x3f,0x68,0x1e,0x91,0x03,0x34,0x00 }},
+ {16, 0xa510, 0, {0xfd,0x00,0x3e,0x68,0x0c,0x94,0x03,0x0e,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa520, 0, {0x39,0x10,0xe0,0x00,0xb8,0x42,0x2e,0x09,0x0b,0x84,0x02,0xe1,0x04,0xbe,0x00,0x2e }},
+ {16, 0xa530, 0, {0x10,0x08,0x80,0x22,0xc2,0x80,0x88,0x40,0x22,0x00,0x0a,0x80,0x02,0xe0,0x00,0xa8 }},
+ {16, 0xa540, 0, {0xd0,0x2e,0x10,0x4b,0x8a,0x03,0x60,0x00,0xba,0x00,0x2e,0x30,0x08,0x8a,0x02,0x86 }},
+ {16, 0xa550, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xc5,0x80,0xb1,0x60,0x6c,0xd0 }},
+ {16, 0xa560, 0, {0x0b,0x10,0x00,0xdc,0x0c,0xb5,0x00,0x2c,0x41,0x08,0x10,0x02,0xc5,0x80,0x91,0x10 }},
+ {16, 0xa570, 0, {0x68,0xc0,0x08,0x30,0x02,0xe4,0x0c,0x81,0x22,0x2c,0x50,0x08,0x10,0x42,0x04,0x00 }},
+ {16, 0xa580, 0, {0xa1,0x00,0x2c,0x5a,0x28,0x90,0x02,0x52,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa590, 0, {0x18,0x15,0xa4,0x00,0xb9,0x00,0x2e,0x41,0x0b,0x90,0x12,0xf4,0x80,0xbf,0x00,0x2e }},
+ {16, 0xa5a0, 0, {0x40,0x08,0x90,0x02,0xe4,0x00,0xa9,0x60,0x60,0x42,0x0a,0x94,0x12,0xe5,0x00,0xa9 }},
+ {16, 0xa5b0, 0, {0x00,0x2e,0x40,0x0b,0x90,0x02,0x64,0x20,0xb9,0x00,0x0e,0x40,0x09,0x90,0x02,0xc6 }},
+ {16, 0xa5c0, 0, {0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x05,0xe4,0x00,0xf9,0x00,0x3e,0x41 }},
+ {16, 0xa5d0, 0, {0x0f,0x90,0x23,0xe4,0x00,0xf9,0x00,0x3e,0x40,0x0c,0x90,0x03,0xe4,0x04,0xd1,0xc0 }},
+ {16, 0xa5e0, 0, {0xba,0x70,0x0c,0x98,0x03,0xc4,0x00,0xc9,0x00,0x3e,0x40,0x0e,0x90,0x03,0x25,0x40 }},
+ {16, 0xa5f0, 0, {0xe9,0x40,0x3e,0x40,0x0c,0x10,0x03,0x68,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa600, 0, {0x68,0x01,0xa4,0x14,0xf9,0x00,0x3e,0x40,0x0f,0x90,0x23,0xe4,0x08,0xf9,0xa0,0x3c }},
+ {16, 0xa610, 0, {0xc2,0x2f,0x90,0x03,0xc4,0x00,0xd9,0x80,0x3e,0x70,0x0f,0x91,0x43,0xe4,0x00,0xf9 }},
+ {16, 0xa620, 0, {0x00,0x3e,0x40,0x1f,0x90,0x13,0xe6,0x20,0xf9,0xa0,0x3c,0x40,0x4e,0x90,0x03,0x9a }},
+ {16, 0xa630, 0, {0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x00,0xa0,0x00,0xf8,0x00,0x3e,0x02 }},
+ {16, 0xa640, 0, {0x0f,0x80,0x13,0x20,0x0c,0xfc,0x01,0x3e,0x00,0x0c,0x80,0x03,0xe0,0x00,0xc8,0x50 }},
+ {16, 0xa650, 0, {0x32,0x00,0x0f,0x80,0x0b,0x20,0x08,0xf8,0x00,0x32,0x00,0x2c,0x80,0x43,0xe0,0x40 }},
+ {16, 0xa660, 0, {0xf8,0x02,0x3a,0x00,0x8f,0x80,0x03,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa670, 0, {0xa8,0x85,0x28,0x08,0x3a,0x00,0x0f,0x80,0x4b,0xa1,0x02,0x28,0x00,0xba,0x82,0x2e }},
+ {16, 0xa680, 0, {0x88,0x48,0xe4,0x02,0xe8,0x00,0xae,0x90,0xa3,0x90,0x0b,0xe0,0x00,0x38,0x00,0xba }},
+ {16, 0xa690, 0, {0x00,0x37,0xa0,0x08,0xa0,0x02,0xf8,0x00,0x9e,0xe0,0x22,0x80,0x0b,0xa0,0x23,0x42 }},
+ {16, 0xa6a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x10,0x33,0x00,0x2c,0xd0 }},
+ {16, 0xa6b0, 0, {0x0b,0x14,0x02,0x0c,0x00,0xb2,0x91,0x2c,0xd0,0x08,0x3e,0x02,0x4c,0x00,0x83,0x40 }},
+ {16, 0xa6c0, 0, {0x24,0xc2,0x0b,0x36,0x00,0x8c,0x00,0xb3,0x00,0x20,0xc0,0x09,0xb0,0x02,0xce,0x00 }},
+ {16, 0xa6d0, 0, {0xb3,0xcc,0x68,0xc0,0x0b,0x30,0x02,0x02,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa6e0, 0, {0xe0,0x01,0x1c,0x88,0xb7,0x25,0x2d,0xc0,0x8b,0x58,0x1a,0x1c,0x08,0xb6,0x00,0x2d }},
+ {16, 0xa6f0, 0, {0xc0,0x08,0x74,0x02,0xdc,0x40,0xa5,0x00,0x25,0xc0,0x1b,0x78,0x02,0x94,0x08,0xb7 }},
+ {16, 0xa700, 0, {0x80,0x25,0xe3,0x0a,0x71,0x02,0xdc,0x00,0x97,0x83,0x21,0xc8,0x8b,0xf1,0x02,0x48 }},
+ {16, 0xa710, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1f,0x00,0xf7,0xe2,0x7d,0xe0 }},
+ {16, 0xa720, 0, {0x0f,0x58,0x43,0x1e,0x18,0xf6,0x80,0x7c,0xe0,0x2c,0x68,0x02,0x5e,0x90,0xc3,0x80 }},
+ {16, 0xa730, 0, {0x35,0xe0,0x0f,0xf8,0x03,0x9e,0x04,0xff,0xa1,0x20,0xa1,0x0d,0x78,0x03,0xd6,0x00 }},
+ {16, 0xa740, 0, {0xf7,0x80,0x39,0xf8,0x0f,0x78,0x03,0x0a,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa750, 0, {0x48,0x1d,0xac,0x00,0xfb,0x40,0x7f,0x41,0x0f,0x10,0x03,0xec,0x04,0xfa,0x00,0x3e }},
+ {16, 0xa760, 0, {0xd0,0x0f,0xa0,0x03,0xed,0x00,0xe9,0x00,0x2a,0x00,0x0f,0xb0,0x03,0x64,0x00,0xfb }},
+ {16, 0xa770, 0, {0x40,0x3e,0xc0,0x0d,0xb0,0x03,0xe4,0x00,0xd3,0x00,0x36,0xc0,0x0f,0x38,0x03,0xc2 }},
+ {16, 0xa780, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xfe,0x48,0xcf,0xc0,0x33,0x60 }},
+ {16, 0xa790, 0, {0x8c,0xc8,0x43,0xd6,0x00,0xcc,0x94,0x3f,0xb0,0x0d,0xf8,0x03,0x7f,0x00,0xdf,0x80 }},
+ {16, 0xa7a0, 0, {0x3f,0x60,0x0f,0xd8,0x03,0xde,0x00,0xcf,0xca,0x3d,0x60,0x0c,0xf8,0x13,0x3a,0x44 }},
+ {16, 0xa7b0, 0, {0xdd,0x80,0x3f,0xe0,0x0f,0xf8,0x43,0x18,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa7c0, 0, {0xa8,0x11,0x9c,0x00,0x8f,0x11,0x33,0xc0,0x48,0x41,0x12,0xc4,0x48,0x84,0x11,0x2c }},
+ {16, 0xa7d0, 0, {0xec,0x2a,0xba,0x03,0x3c,0x40,0xd7,0x48,0x2d,0x41,0x0b,0x60,0x02,0xd4,0x00,0xd7 }},
+ {16, 0xa7e0, 0, {0x01,0x3d,0xc0,0x0d,0xf0,0x03,0x5a,0x00,0x84,0x18,0x2d,0xc0,0x0b,0x70,0x03,0x6a }},
+ {16, 0xa7f0, 0, {0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x8c,0x08,0x87,0x00,0x21,0x40 }},
+ {16, 0xa800, 0, {0x09,0x40,0x02,0xd4,0x00,0xa4,0x92,0x2d,0xc8,0x09,0x62,0x82,0x5c,0x00,0x87,0x00 }},
+ {16, 0xa810, 0, {0x2d,0xc0,0x0b,0x50,0x02,0xfc,0x00,0x87,0x00,0x2d,0x04,0x08,0x70,0x02,0x1c,0x80 }},
+ {16, 0xa820, 0, {0xb5,0x00,0x2d,0xc0,0x0b,0xf0,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa830, 0, {0x60,0x10,0xcc,0x00,0x83,0x00,0x20,0x40,0x09,0x00,0x22,0xc7,0x00,0xa0,0x41,0x2c }},
+ {16, 0xa840, 0, {0xc1,0x4b,0x08,0x02,0x2c,0x00,0x93,0x40,0x2c,0x7c,0x0b,0x38,0x02,0xc7,0x20,0x93 }},
+ {16, 0xa850, 0, {0x00,0x2c,0xc0,0x09,0x30,0x02,0x4f,0x84,0xb0,0x80,0x2c,0xc0,0x0b,0x32,0x10,0x50 }},
+ {16, 0xa860, 0, {0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xaa,0x15,0xbc,0x02,0xcf,0x00,0xb2,0x40 }},
+ {16, 0xa870, 0, {0x0d,0x10,0x03,0xe8,0x24,0xeb,0xc1,0x3e,0xc0,0x2d,0x98,0x13,0x7c,0x0a,0xc2,0x43 }},
+ {16, 0xa880, 0, {0x3e,0xb0,0x0f,0xa9,0x03,0xe9,0x20,0xcf,0x00,0x3e,0xc0,0x8c,0xf0,0x03,0x0d,0x20 }},
+ {16, 0xa890, 0, {0xfa,0xc0,0x3f,0xc0,0x0f,0x74,0x01,0x2a,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa8a0, 0, {0x80,0x00,0xec,0x00,0xfb,0x02,0x3a,0x40,0x8e,0x90,0x03,0xe8,0x14,0x5b,0x50,0x3c }},
+ {16, 0xa8b0, 0, {0x50,0x4e,0x84,0x03,0xec,0x00,0xf8,0x40,0x3e,0x80,0x07,0x81,0x03,0xec,0x08,0xf3 }},
+ {16, 0xa8c0, 0, {0x00,0x3a,0xc0,0x9f,0x30,0x03,0xec,0x00,0xcb,0x20,0x3e,0xc0,0x0f,0xb0,0x23,0xe8 }},
+ {16, 0xa8d0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x90,0xfc,0x00,0xff,0x00,0x3f,0x40 }},
+ {16, 0xa8e0, 0, {0x0f,0xd0,0x03,0x38,0x20,0xcf,0x08,0x32,0xc1,0x0e,0xd0,0x03,0xfc,0x00,0xfe,0x08 }},
+ {16, 0xa8f0, 0, {0x31,0xe5,0x0e,0xe4,0x03,0x3a,0x00,0xff,0x00,0x33,0x80,0x0f,0xf0,0x2b,0x24,0x00 }},
+ {16, 0xa900, 0, {0xcc,0xa0,0x3f,0xc0,0x0f,0xf0,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa910, 0, {0x80,0x04,0x6c,0x00,0xbb,0x00,0x3a,0x69,0x0b,0x90,0x6e,0x08,0x00,0x83,0x41,0x36 }},
+ {16, 0xa920, 0, {0x40,0xc8,0x88,0xc6,0xec,0x00,0x88,0x40,0x36,0x80,0x0d,0xa8,0x03,0x6e,0x50,0xbb }},
+ {16, 0xa930, 0, {0x00,0x36,0xc0,0x0b,0xb0,0x02,0x24,0x00,0xd9,0x08,0x2e,0xc0,0x0b,0xb0,0x03,0xe0 }},
+ {16, 0xa940, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0xbb,0x00,0x2e,0x60 }},
+ {16, 0xa950, 0, {0x03,0x80,0x02,0x20,0x00,0x89,0x01,0x22,0x58,0x08,0x98,0x22,0xec,0x01,0xab,0x00 }},
+ {16, 0xa960, 0, {0x22,0x00,0x0a,0x10,0x02,0x28,0x00,0xbb,0x00,0x22,0x40,0x0b,0xb0,0x02,0x28,0x00 }},
+ {16, 0xa970, 0, {0x8a,0x00,0x2e,0xc0,0x0b,0xb0,0x42,0x20,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa980, 0, {0x08,0x04,0x0c,0x00,0xb3,0x00,0x28,0x40,0x8b,0x00,0x02,0x02,0x40,0x89,0x01,0x24 }},
+ {16, 0xa990, 0, {0xd2,0x28,0x10,0x02,0xcc,0x00,0x83,0x10,0x24,0x20,0x08,0x08,0x02,0x4e,0x00,0xb3 }},
+ {16, 0xa9a0, 0, {0x04,0xa0,0xc0,0x0b,0x30,0x02,0x08,0x88,0x92,0x00,0x2c,0xc0,0x0b,0xb0,0x02,0xc2 }},
+ {16, 0xa9b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x6c,0x00,0xff,0x00,0x3e,0x00 }},
+ {16, 0xa9c0, 0, {0x0f,0x80,0x02,0x20,0x10,0x89,0x50,0x22,0xd8,0x2e,0x96,0x22,0xfc,0x00,0xeb,0x40 }},
+ {16, 0xa9d0, 0, {0x32,0xc0,0x0a,0x90,0x03,0x28,0x00,0xff,0x00,0x22,0x00,0x0f,0xb0,0x03,0x2c,0xa0 }},
+ {16, 0xa9e0, 0, {0xc8,0x00,0x3e,0xc0,0x0f,0xb0,0x03,0x00,0x06,0x10,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa9f0, 0, {0xa0,0x19,0xfc,0x00,0xff,0x0c,0x3b,0x00,0x0f,0xc0,0x02,0x70,0x90,0xfd,0x00,0x3e }},
+ {16, 0xaa00, 0, {0xc9,0x0f,0x96,0xc3,0xfc,0x00,0xff,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0xfc,0x04,0xff }},
+ {16, 0xaa10, 0, {0x04,0x3f,0xc0,0x0f,0xf0,0x03,0xec,0x00,0xfc,0x00,0x3f,0xc0,0x0f,0x70,0x03,0xe8 }},
+ {16, 0xaa20, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xdc,0x80,0xfb,0x28,0x3f,0x00 }},
+ {16, 0xaa30, 0, {0x0c,0xc1,0x0b,0xf1,0x02,0xed,0x00,0x37,0x30,0x2c,0xf1,0x03,0xb2,0x40,0xff,0x00 }},
+ {16, 0xaa40, 0, {0xbb,0xc0,0x0f,0x48,0x06,0xb2,0x00,0xfc,0x80,0x3b,0xcc,0x0c,0xf0,0x03,0x70,0x80 }},
+ {16, 0xaa50, 0, {0xdf,0x28,0x33,0x04,0x0f,0xf4,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xaa60, 0, {0x80,0x10,0xff,0x40,0xbf,0x60,0x2e,0x21,0x08,0x82,0x02,0x20,0x00,0xa9,0x28,0x2a }},
+ {16, 0xaa70, 0, {0x00,0x09,0xfa,0x02,0x20,0x00,0xbf,0x51,0x23,0xd8,0x09,0x98,0x02,0xe4,0x30,0xb0 }},
+ {16, 0xaa80, 0, {0x00,0x23,0xd0,0x08,0xf5,0xa2,0x25,0xa4,0x8f,0x42,0x3c,0x10,0x0b,0xb0,0x0a,0x20 }},
+ {16, 0xaa90, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x00,0xb3,0x08,0x2c,0x00 }},
+ {16, 0xaaa0, 0, {0x28,0x00,0x1a,0xc0,0x84,0x20,0x00,0x24,0xc8,0x4b,0x31,0x42,0xc0,0x00,0x93,0x02 }},
+ {16, 0xaab0, 0, {0x20,0xc6,0x08,0x00,0x06,0xc0,0x81,0xb3,0x00,0x2c,0xd8,0x09,0x32,0x02,0xa0,0x40 }},
+ {16, 0xaac0, 0, {0x93,0x01,0x24,0x4c,0x0b,0x32,0x02,0x22,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xaad0, 0, {0xc0,0x11,0xac,0x00,0xbb,0x02,0x2e,0x0a,0x08,0x80,0x82,0x60,0x00,0xa8,0x00,0x2e }},
+ {16, 0xaae0, 0, {0xe0,0x1b,0xb0,0x02,0x62,0x01,0x3b,0x00,0x22,0xc1,0x09,0x90,0x02,0xe2,0x00,0xbb }},
+ {16, 0xaaf0, 0, {0x60,0x26,0xc1,0x08,0xb0,0x2a,0x26,0x00,0x9b,0x04,0x2e,0x21,0x0b,0xb0,0x02,0x30 }},
+ {16, 0xab00, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x11,0xec,0x10,0xfb,0x00,0x3e,0x10 }},
+ {16, 0xab10, 0, {0x08,0x84,0x13,0xec,0x02,0xa9,0x04,0x36,0x20,0x0f,0xb0,0x03,0xee,0x80,0xfb,0x00 }},
+ {16, 0xab20, 0, {0x3a,0xc0,0x0c,0xa0,0x03,0xa2,0x80,0x79,0x40,0x1e,0xc0,0x8c,0xb0,0x63,0x6a,0x10 }},
+ {16, 0xab30, 0, {0xd3,0x00,0x36,0xa2,0x07,0xb0,0x03,0x00,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xab40, 0, {0xe0,0x01,0xbc,0x00,0xff,0x00,0x3e,0x20,0x4d,0x41,0x03,0x9c,0x00,0xfd,0x20,0xab }},
+ {16, 0xab50, 0, {0x00,0x0c,0xf0,0x03,0xb8,0x00,0xf7,0x00,0x3f,0xc0,0x4d,0xc9,0x03,0xf4,0x00,0xff }},
+ {16, 0xab60, 0, {0x00,0x3b,0xc0,0x2e,0xf0,0x00,0xf0,0x00,0xef,0x00,0x3f,0x00,0x4b,0x70,0x03,0xf8 }},
+ {16, 0xab70, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x80,0xeb,0x00,0x7e,0x10 }},
+ {16, 0xab80, 0, {0x2e,0x84,0x03,0xec,0x00,0xe0,0x00,0x32,0x50,0x0f,0xb0,0x86,0x25,0x00,0xdb,0x20 }},
+ {16, 0xab90, 0, {0x3a,0xc0,0x0d,0xb0,0x63,0xe1,0x10,0xfb,0x48,0x38,0xc1,0x0f,0x30,0x03,0x2c,0x04 }},
+ {16, 0xaba0, 0, {0xfb,0x08,0x32,0xc0,0x0c,0xb0,0x0b,0x90,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xabb0, 0, {0xc8,0x05,0x3c,0x00,0x8f,0x00,0x64,0x29,0x28,0x80,0x03,0xec,0x02,0xe8,0x04,0xa8 }},
+ {16, 0xabc0, 0, {0x56,0x08,0xfc,0x07,0xe0,0x00,0x0f,0xa0,0xbf,0xc0,0x0b,0x95,0x02,0xa0,0x00,0xbb }},
+ {16, 0xabd0, 0, {0x05,0x37,0xc0,0x89,0xf0,0x0a,0x0d,0xc8,0xbf,0x08,0x2a,0x80,0x08,0xf0,0x02,0x32 }},
+ {16, 0xabe0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x01,0xb3,0x02,0x24,0xe0 }},
+ {16, 0xabf0, 0, {0x0a,0x30,0x12,0x80,0x03,0xa3,0x00,0xa8,0x00,0x02,0xb8,0x22,0xc0,0x00,0xb3,0x00 }},
+ {16, 0xac00, 0, {0x28,0xc1,0x0b,0x04,0x02,0x08,0x00,0xb9,0x40,0x28,0xc0,0x0b,0x30,0x02,0x03,0x04 }},
+ {16, 0xac10, 0, {0xb3,0x44,0x20,0x00,0x4a,0x30,0x02,0x38,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xac20, 0, {0x20,0x01,0x1e,0x20,0x17,0xa0,0x65,0xec,0x08,0x38,0x02,0xc2,0x41,0xb3,0x92,0x2b }},
+ {16, 0xac30, 0, {0x64,0x0a,0x38,0x02,0x36,0x01,0xb7,0x90,0x2d,0xe0,0x03,0xf8,0x00,0x9a,0x00,0xb5 }},
+ {16, 0xac40, 0, {0x80,0x2d,0xe0,0x89,0x78,0x12,0x1e,0x00,0xb7,0x80,0x29,0xe0,0x0a,0x78,0x02,0x08 }},
+ {16, 0xac50, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0x73,0xb0,0x24,0xc8 }},
+ {16, 0xac60, 0, {0x4e,0x30,0x0a,0x80,0x02,0xe2,0x00,0x38,0x94,0x0e,0x31,0xa2,0xc8,0x00,0x73,0x00 }},
+ {16, 0xac70, 0, {0x18,0xc4,0x05,0x00,0x03,0x00,0x00,0xf3,0x00,0x38,0xc0,0x07,0xb1,0x03,0x00,0x00 }},
+ {16, 0xac80, 0, {0xf3,0x01,0x30,0x41,0x0e,0xb0,0x03,0x92,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xac90, 0, {0x40,0x1d,0xbd,0x00,0xef,0x10,0x26,0xc8,0x03,0xb1,0x03,0xe0,0x00,0xea,0x81,0x78 }},
+ {16, 0xaca0, 0, {0xc5,0x0c,0xb5,0xe3,0xdc,0x00,0xc3,0x00,0x3e,0xc1,0x0f,0xf0,0x83,0xb0,0x00,0xff }},
+ {16, 0xacb0, 0, {0x00,0x37,0xc0,0x0d,0xf4,0x03,0xe4,0x00,0xf7,0x00,0x3f,0x40,0x0d,0xf0,0x03,0xd0 }},
+ {16, 0xacc0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xed,0x10,0xcb,0x28,0x3e,0xc0 }},
+ {16, 0xacd0, 0, {0x0d,0xb0,0x13,0xac,0x10,0xfb,0x00,0x3a,0x80,0x04,0xb4,0x03,0xac,0x00,0xfb,0x04 }},
+ {16, 0xace0, 0, {0x3e,0xc0,0x0f,0xa4,0xb3,0xe0,0x00,0xfb,0x80,0x32,0xc0,0x0f,0xb0,0x03,0xe8,0x00 }},
+ {16, 0xacf0, 0, {0xfb,0x48,0xb2,0x80,0x0f,0xb0,0x43,0xea,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xad00, 0, {0x48,0x11,0x9c,0x02,0x87,0x44,0x38,0xc0,0x8d,0x30,0x02,0x4c,0x00,0xff,0x00,0x21 }},
+ {16, 0xad10, 0, {0xc0,0x08,0x70,0x03,0x9c,0x00,0xb3,0x50,0x21,0xd4,0x4e,0x62,0x02,0xd0,0x00,0xbf }},
+ {16, 0xad20, 0, {0x00,0x35,0xd4,0x09,0x70,0x22,0xd8,0x00,0xbf,0x22,0x21,0xc0,0x0b,0x72,0x02,0xd2 }},
+ {16, 0xad30, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x40,0x87,0x80,0x2d,0xe0 }},
+ {16, 0xad40, 0, {0x09,0x78,0x02,0xde,0x00,0xb6,0x80,0x29,0xa1,0x28,0x7a,0x32,0xde,0x00,0x37,0xa0 }},
+ {16, 0xad50, 0, {0x25,0xe0,0x09,0x78,0x06,0xd2,0x00,0xb7,0x80,0x21,0xe8,0x0b,0x79,0x02,0xde,0x00 }},
+ {16, 0xad60, 0, {0xb7,0x90,0x21,0xe0,0x0b,0x79,0x02,0xf0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xad70, 0, {0x48,0x14,0xcc,0x04,0x83,0x01,0x28,0xc0,0x89,0xb0,0x0a,0x4f,0x00,0xb2,0x00,0x20 }},
+ {16, 0xad80, 0, {0xc4,0x88,0x30,0x16,0xcf,0x00,0xbb,0x04,0x20,0xc1,0x0a,0x32,0x06,0xc2,0x00,0xb3 }},
+ {16, 0xad90, 0, {0x00,0x24,0xc0,0x09,0x30,0x42,0xef,0x10,0xb3,0x00,0x20,0xc0,0x0b,0x30,0x02,0xd2 }},
+ {16, 0xada0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x00,0x4a,0x00,0x3e,0x80 }},
+ {16, 0xadb0, 0, {0x2d,0xa0,0x0b,0xaa,0x80,0xfe,0x00,0x2b,0x80,0x0c,0xa0,0x43,0xfb,0x30,0xfa,0x00 }},
+ {16, 0xadc0, 0, {0x3e,0x80,0x0f,0xa0,0x83,0xfa,0x04,0xfe,0x18,0x22,0x80,0x0f,0xa0,0x03,0xfa,0x84 }},
+ {16, 0xadd0, 0, {0xf2,0x00,0x33,0xa2,0x0f,0xa0,0x03,0xf2,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xade0, 0, {0x48,0x00,0xe0,0x00,0xf0,0x00,0x3e,0x00,0x2f,0x80,0x03,0xa0,0x20,0xfc,0x02,0x3e }},
+ {16, 0xadf0, 0, {0x00,0x1f,0x84,0x03,0xa0,0x00,0xf8,0x40,0x3e,0x00,0x4f,0x80,0x01,0xe0,0x40,0xf8 }},
+ {16, 0xae00, 0, {0x40,0x3e,0x00,0x0d,0x80,0x13,0xe0,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x80,0x03,0xd2 }},
+ {16, 0xae10, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xc6,0x00,0xd9,0x00,0x36,0x40 }},
+ {16, 0xae20, 0, {0x0f,0x90,0x0b,0x04,0x00,0xc9,0x00,0x36,0x68,0x6c,0x94,0x03,0xe4,0x20,0xb9,0x90 }},
+ {16, 0xae30, 0, {0x36,0x40,0x0c,0x94,0x03,0xe4,0x00,0x29,0x80,0x3e,0x40,0x0f,0x90,0x03,0x24,0x20 }},
+ {16, 0xae40, 0, {0xc9,0x00,0x36,0x40,0x0f,0x90,0x03,0xc2,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xae50, 0, {0x80,0x04,0x66,0x50,0x89,0x00,0x20,0x50,0x08,0x90,0x02,0x24,0x09,0xd9,0x00,0x20 }},
+ {16, 0xae60, 0, {0x48,0x48,0x90,0x06,0xe4,0x04,0x99,0xa0,0x22,0x40,0x0d,0xb8,0x22,0x64,0x00,0x09 }},
+ {16, 0xae70, 0, {0x50,0x32,0x40,0x0b,0x90,0x02,0x27,0x90,0x89,0x40,0x2a,0x40,0x0b,0x90,0x02,0xe0 }},
+ {16, 0xae80, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0x24,0x00,0x99,0x00,0x66,0x42 }},
+ {16, 0xae90, 0, {0x0a,0xd0,0x12,0x34,0x00,0x85,0x00,0x26,0x40,0x4a,0x90,0x02,0xe4,0x01,0xb9,0x01 }},
+ {16, 0xaea0, 0, {0x24,0x40,0x58,0x90,0x12,0xc4,0x00,0x29,0x40,0x2e,0x40,0x0b,0x10,0x0a,0x24,0x80 }},
+ {16, 0xaeb0, 0, {0x89,0x05,0x26,0x41,0x0b,0x90,0x02,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xaec0, 0, {0x08,0x04,0x04,0x80,0x81,0x20,0x61,0x48,0x08,0x52,0x02,0x14,0x81,0x95,0x20,0x20 }},
+ {16, 0xaed0, 0, {0x40,0x0a,0x36,0x02,0xc4,0x00,0xb1,0x20,0x00,0x48,0x41,0x10,0x42,0x44,0x01,0xa1 }},
+ {16, 0xaee0, 0, {0x00,0x24,0x48,0x0b,0x12,0x12,0x04,0x80,0x81,0x20,0x28,0x48,0x0b,0x12,0x02,0xca }},
+ {16, 0xaef0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xd8,0x50,0x36,0x00 }},
+ {16, 0xaf00, 0, {0x0e,0x85,0x23,0x21,0x42,0x8c,0x54,0x34,0x14,0x0e,0x80,0x02,0xe1,0x40,0xf8,0x50 }},
+ {16, 0xaf10, 0, {0x36,0x14,0x04,0x80,0x03,0xe1,0x44,0xe8,0x50,0x7e,0x15,0x0f,0x85,0x03,0x21,0x42 }},
+ {16, 0xaf20, 0, {0x4a,0x00,0x36,0x14,0x0f,0x80,0x03,0xee,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xaf30, 0, {0x98,0x1d,0xc4,0x40,0xf9,0x10,0x1e,0x44,0x4e,0x91,0x03,0xe4,0x40,0xf9,0x10,0x3f }},
+ {16, 0xaf40, 0, {0xc0,0x0d,0x91,0x03,0xf4,0x00,0xd9,0x14,0x3e,0x44,0x0f,0x90,0x03,0x74,0x00,0xdd }},
+ {16, 0xaf50, 0, {0x00,0x7a,0x44,0x0f,0x91,0x03,0xf4,0x40,0xf9,0x38,0x3f,0x44,0x0f,0x93,0x83,0xe7 }},
+ {16, 0xaf60, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0xf6,0x80,0xf9,0xa4,0x3f,0x68 }},
+ {16, 0xaf70, 0, {0x0e,0x9e,0x43,0x67,0x80,0xd9,0xe4,0x3f,0x41,0x0f,0xd8,0x43,0x04,0x00,0xed,0xc0 }},
+ {16, 0xaf80, 0, {0x36,0x40,0x0c,0x90,0x03,0xe4,0x00,0xd5,0x40,0x32,0x40,0x0c,0x90,0x03,0xf4,0x00 }},
+ {16, 0xaf90, 0, {0xdd,0x00,0x32,0x40,0x2c,0x9a,0x03,0xc6,0x01,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xafa0, 0, {0x38,0x10,0xe0,0x00,0xe8,0xc0,0x2e,0x14,0x4d,0x8f,0x22,0x23,0xc0,0xf8,0xf0,0xaa }},
+ {16, 0xafb0, 0, {0x00,0x0c,0x80,0x03,0xa2,0xa0,0xd8,0x82,0x22,0x00,0x08,0x80,0x02,0xe8,0x00,0xd8 }},
+ {16, 0xafc0, 0, {0x80,0x2a,0x00,0x08,0x80,0x02,0xe8,0x08,0x88,0xa8,0x36,0x00,0x48,0x8a,0x82,0xce }},
+ {16, 0xafd0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc5,0x00,0xb1,0x48,0x2e,0x40 }},
+ {16, 0xafe0, 0, {0x0a,0x12,0x22,0x44,0x00,0x91,0x04,0xa4,0x41,0x0a,0x94,0x06,0x24,0x00,0x91,0x42 }},
+ {16, 0xaff0, 0, {0x24,0x41,0x09,0x10,0x02,0xe4,0x01,0x91,0x20,0x24,0x40,0x09,0x10,0x02,0xc4,0x01 }},
+ {16, 0xb000, 0, {0x91,0x00,0x2c,0x40,0x09,0x14,0x02,0xc2,0x01,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb010, 0, {0x18,0x15,0xa4,0x00,0xa9,0x00,0x2e,0x40,0x48,0x10,0x02,0x24,0x00,0xb9,0x40,0xaa }},
+ {16, 0xb020, 0, {0x40,0x18,0xb0,0x02,0xe4,0x08,0x99,0x00,0x22,0x40,0x19,0x90,0x46,0xe4,0x80,0x99 }},
+ {16, 0xb030, 0, {0x04,0x2e,0x40,0x09,0x90,0x02,0xe4,0x01,0x99,0x04,0x26,0x50,0x09,0x90,0x02,0xc6 }},
+ {16, 0xb040, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x11,0xe4,0x00,0xf9,0x06,0x3c,0x40 }},
+ {16, 0xb050, 0, {0x0a,0x90,0x03,0x64,0x02,0xd9,0x00,0xb6,0x50,0x0e,0x90,0x23,0x26,0x01,0xf9,0x00 }},
+ {16, 0xb060, 0, {0x36,0x40,0x29,0x94,0x83,0xe4,0x00,0xd9,0x48,0x36,0x40,0x0d,0x90,0x03,0xc7,0x00 }},
+ {16, 0xb070, 0, {0xd1,0x07,0x3a,0x50,0xcd,0x90,0x03,0xe8,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb080, 0, {0x28,0x01,0xa4,0x08,0xe9,0x00,0x3e,0x40,0x8f,0x90,0x03,0xc4,0x08,0xf1,0x00,0x3a }},
+ {16, 0xb090, 0, {0x68,0x8f,0x90,0x03,0xa4,0x41,0xf9,0x00,0xbe,0x40,0x0e,0x90,0x03,0xe4,0x00,0xf9 }},
+ {16, 0xb0a0, 0, {0xc0,0x38,0x40,0x2e,0x90,0x03,0xe6,0x40,0xe9,0x00,0x3e,0x68,0x06,0x90,0x03,0xca }},
+ {16, 0xb0b0, 0, {0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xd8,0x05,0x3e,0x00 }},
+ {16, 0xb0c0, 0, {0x07,0x80,0x0b,0x20,0x00,0xe8,0x40,0x3e,0x10,0x0d,0x82,0x03,0x60,0x00,0xc8,0x00 }},
+ {16, 0xb0d0, 0, {0xb2,0x00,0x8d,0x83,0x03,0xe0,0x00,0xd8,0x50,0x3a,0x00,0x1e,0x80,0x03,0xe1,0x24 }},
+ {16, 0xb0e0, 0, {0xf8,0x00,0xb2,0x00,0x0f,0x80,0x03,0x02,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb0f0, 0, {0x28,0x05,0x38,0x00,0x8a,0x04,0x2f,0x84,0x6a,0xa0,0x0b,0xe8,0x08,0x8e,0x00,0x3d }},
+ {16, 0xb100, 0, {0x80,0x88,0xec,0x03,0x68,0x10,0xa6,0x01,0x36,0x80,0x08,0xa8,0x00,0xc8,0x10,0x8e }},
+ {16, 0xb110, 0, {0x10,0x22,0x80,0x08,0xa0,0x02,0xfb,0x20,0xbe,0x51,0x2a,0x80,0x0b,0xa0,0x02,0x82 }},
+ {16, 0xb120, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x41,0x21,0x93,0x00,0x2c,0xf0 }},
+ {16, 0xb130, 0, {0x39,0x30,0x06,0x0c,0x00,0xa3,0x00,0x28,0x08,0x28,0xbc,0x02,0x2c,0x00,0x83,0x80 }},
+ {16, 0xb140, 0, {0x2a,0xc0,0x08,0x30,0x00,0xcc,0x00,0x9a,0x80,0x28,0xc0,0x0a,0x30,0x02,0xcd,0x00 }},
+ {16, 0xb150, 0, {0xb3,0x04,0x62,0xc1,0x0b,0x30,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb160, 0, {0xa0,0x01,0x1e,0x04,0x07,0x11,0x2c,0xd0,0x0a,0x32,0x22,0xdc,0xc1,0x87,0x00,0x6d }},
+ {16, 0xb170, 0, {0xd0,0x08,0x34,0x02,0x7c,0x00,0xa7,0x08,0x24,0xc8,0x08,0x70,0x02,0xdc,0x80,0x0f }},
+ {16, 0xb180, 0, {0x00,0x21,0xc4,0x08,0x73,0x06,0xdc,0x00,0xb2,0x00,0x61,0xc8,0x0b,0x3a,0x02,0x88 }},
+ {16, 0xb190, 0, {0x04,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x0a,0x00,0x57,0x81,0x2d,0xa0 }},
+ {16, 0xb1a0, 0, {0x2d,0x7c,0x02,0x3e,0x82,0xe3,0xe0,0x3b,0xe0,0x0c,0x78,0x03,0x1e,0x20,0xc7,0x80 }},
+ {16, 0xb1b0, 0, {0xb9,0xe8,0x2c,0x78,0x03,0xff,0x80,0xd6,0x80,0x3b,0xec,0x02,0x7a,0x03,0xde,0x00 }},
+ {16, 0xb1c0, 0, {0xf7,0x81,0x31,0xec,0x8f,0x7c,0x03,0x0a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb1d0, 0, {0x08,0x1d,0xac,0x00,0xfb,0x00,0x1e,0x80,0x23,0xb6,0x83,0xed,0xa0,0xdb,0x64,0x3e }},
+ {16, 0xb1e0, 0, {0xc0,0x0e,0xb0,0x03,0xed,0xc0,0xf2,0x00,0x3e,0xd4,0x0a,0xb0,0x03,0xec,0x30,0xee }},
+ {16, 0xb1f0, 0, {0x64,0x3e,0xc0,0x07,0xb0,0xc3,0xe8,0x00,0xfb,0x01,0x3e,0xc8,0x0f,0xb8,0x03,0xc2 }},
+ {16, 0xb200, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xf6,0x00,0xef,0x80,0x3b,0xe0 }},
+ {16, 0xb210, 0, {0x0f,0xf8,0x63,0x7e,0x04,0xcf,0xc0,0xb7,0x20,0x0e,0xf8,0x03,0xfc,0x00,0xc7,0x80 }},
+ {16, 0xb220, 0, {0x33,0xf0,0x0c,0xcc,0x03,0xfe,0x08,0xf7,0xc1,0x33,0xe0,0x4f,0xf8,0x03,0xb2,0x40 }},
+ {16, 0xb230, 0, {0xff,0xa0,0x31,0xe6,0x0c,0xf8,0x03,0x10,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb240, 0, {0xa8,0x11,0x9c,0x00,0xef,0x02,0x21,0x40,0x2d,0x70,0x02,0x1c,0x00,0xf7,0x10,0x29 }},
+ {16, 0xb250, 0, {0x40,0x08,0x70,0x22,0xfc,0xc0,0xa7,0x00,0x3d,0xc0,0x08,0x40,0x02,0xdc,0x00,0xb7 }},
+ {16, 0xb260, 0, {0x40,0x21,0xc0,0x0b,0x70,0x02,0xda,0x80,0xb7,0x24,0x29,0xc6,0x48,0xf0,0x02,0x2a }},
+ {16, 0xb270, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x00,0xa7,0x00,0x28,0x84 }},
+ {16, 0xb280, 0, {0x0b,0x30,0x02,0x0c,0x00,0x93,0x00,0x25,0x80,0x0a,0x61,0x02,0xdc,0x01,0xa7,0x10 }},
+ {16, 0xb290, 0, {0x24,0xc0,0x08,0x40,0x82,0xdc,0x00,0x9f,0x00,0x25,0xc4,0x0b,0x70,0x02,0x94,0x25 }},
+ {16, 0xb2a0, 0, {0xb7,0x32,0x23,0xc4,0x1b,0x70,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb2b0, 0, {0x20,0x14,0xcc,0x0c,0xa3,0x00,0x20,0x00,0x29,0x30,0x0a,0x0c,0x00,0xa3,0x00,0x6c }},
+ {16, 0xb2c0, 0, {0x00,0x08,0x10,0x42,0xcd,0x10,0xaa,0x00,0xac,0xc0,0x00,0x04,0x02,0xcd,0x00,0xbb }},
+ {16, 0xb2d0, 0, {0x10,0x24,0xc0,0x03,0x30,0x42,0xc3,0x09,0xb3,0x00,0x2c,0xd0,0x0a,0x30,0x02,0x18 }},
+ {16, 0xb2e0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0x80,0x00,0xef,0x00,0x3a,0x40 }},
+ {16, 0xb2f0, 0, {0x07,0xf0,0x43,0x3c,0x00,0x9f,0xc0,0xb6,0x14,0x0e,0x80,0x06,0xfc,0x01,0xcb,0x01 }},
+ {16, 0xb300, 0, {0x37,0xc0,0xac,0xb4,0x02,0xfc,0x00,0xd9,0x01,0x37,0xc0,0x4b,0xf0,0x13,0xae,0x08 }},
+ {16, 0xb310, 0, {0xfb,0x00,0x33,0xd0,0x2e,0xf0,0x0b,0x2a,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb320, 0, {0x80,0x00,0xec,0x00,0xfb,0x05,0x3e,0x40,0x0f,0x30,0x03,0xac,0x14,0xfb,0xa0,0x3a }},
+ {16, 0xb330, 0, {0xc0,0x0f,0x84,0x43,0xec,0x01,0xf9,0x40,0x3e,0xc0,0x0f,0xa2,0x03,0xec,0x21,0xf9 }},
+ {16, 0xb340, 0, {0x00,0x3a,0xc0,0x0f,0xb0,0x03,0xe4,0x20,0xf0,0x00,0xba,0xc0,0x0d,0xb0,0x03,0xe0 }},
+ {16, 0xb350, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xf8,0x00,0xd7,0x01,0x35,0x68 }},
+ {16, 0xb360, 0, {0x6d,0xf0,0x03,0x3c,0x01,0xe7,0x00,0x33,0xc0,0x0d,0xc0,0x03,0xfc,0x24,0xcf,0x02 }},
+ {16, 0xb370, 0, {0x37,0xc0,0x0d,0xd2,0x02,0xfc,0x00,0xdf,0x01,0x33,0xc0,0x5e,0x70,0x33,0x1c,0x18 }},
+ {16, 0xb380, 0, {0xcf,0x41,0x31,0xc2,0x0c,0xf0,0x03,0x40,0x40,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb390, 0, {0x81,0x00,0x6c,0x00,0x8b,0x00,0x22,0x52,0x2a,0xb0,0x03,0x6c,0x00,0xab,0x00,0x28 }},
+ {16, 0xb3a0, 0, {0xc0,0x0a,0x8c,0x02,0xec,0x10,0x8b,0xe0,0x22,0xc0,0x0f,0x80,0x02,0xcc,0x00,0x8b }},
+ {16, 0xb3b0, 0, {0x80,0x22,0xc0,0x08,0xb0,0x02,0x2a,0x10,0xd9,0x80,0x22,0xc0,0xc8,0xb0,0x02,0xe0 }},
+ {16, 0xb3c0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x24,0x01,0x9b,0x00,0x26,0x80 }},
+ {16, 0xb3d0, 0, {0x29,0xb0,0x62,0x0c,0x00,0xab,0x01,0x6a,0x00,0x08,0x98,0x02,0xcc,0x00,0x9b,0x83 }},
+ {16, 0xb3e0, 0, {0x2e,0xc0,0xcb,0xb4,0x12,0xec,0x03,0x8b,0x80,0x28,0xc0,0x0a,0xb0,0x06,0xa2,0x00 }},
+ {16, 0xb3f0, 0, {0x8b,0x02,0x62,0xc0,0x08,0xb0,0x02,0xe0,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb400, 0, {0x08,0x04,0x0c,0x01,0x83,0x14,0x20,0x00,0x0a,0x30,0x02,0x4c,0x00,0x83,0x00,0x2a }},
+ {16, 0xb410, 0, {0x40,0x0a,0x10,0x00,0xcc,0x02,0x93,0x00,0x28,0xc0,0x0a,0x20,0x02,0xec,0x00,0x03 }},
+ {16, 0xb420, 0, {0x00,0x20,0xc0,0x08,0x30,0x16,0x00,0x80,0x91,0x00,0x60,0xc0,0x08,0x30,0x02,0xc2 }},
+ {16, 0xb430, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x6c,0x00,0xdb,0x00,0x36,0x80 }},
+ {16, 0xb440, 0, {0x2d,0xf0,0x03,0x3c,0x00,0xaf,0x00,0x3a,0x80,0x0d,0x80,0x03,0xfc,0x00,0x5b,0x00 }},
+ {16, 0xb450, 0, {0x37,0xc0,0x09,0x90,0x03,0xfc,0x00,0xdf,0x00,0x33,0xc0,0x0a,0xf0,0x03,0xa4,0x20 }},
+ {16, 0xb460, 0, {0xcb,0x00,0xb3,0xc0,0x8c,0xb0,0x03,0x40,0x02,0x10,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb470, 0, {0xa0,0x1d,0xfc,0x04,0xff,0x20,0x0f,0x00,0x27,0xf0,0x03,0xfc,0x00,0xff,0x00,0x2d }},
+ {16, 0xb480, 0, {0x00,0x0b,0xd0,0x27,0xfc,0x00,0xef,0x00,0x37,0xc0,0x0f,0xc0,0x43,0xfc,0x00,0xff }},
+ {16, 0xb490, 0, {0x00,0x3f,0xc0,0x0d,0xf0,0x0b,0xe0,0x00,0xf5,0x00,0x3f,0xc0,0x1f,0xf0,0x03,0xe8 }},
+ {16, 0xb4a0, 0, {0x07,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0xf4,0xc0,0xfc,0x22,0x7f,0xc0 }},
+ {16, 0xb4b0, 0, {0x0c,0xd0,0x43,0x36,0x00,0xc4,0x81,0x34,0xc0,0x1c,0x89,0x07,0xf2,0x80,0xcf,0x80 }},
+ {16, 0xb4c0, 0, {0x33,0x60,0x0f,0x79,0x03,0x3c,0xe0,0xcf,0x08,0x33,0x48,0x0d,0xc4,0x03,0xf0,0x50 }},
+ {16, 0xb4d0, 0, {0xdc,0x90,0x37,0xcc,0x0f,0xf8,0x03,0xf0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb4e0, 0, {0x80,0x10,0xe9,0x90,0xb8,0x80,0x7e,0xe4,0x88,0x99,0x0a,0x26,0x08,0xa9,0x80,0x22 }},
+ {16, 0xb4f0, 0, {0xf4,0x2c,0x99,0x03,0xa7,0x02,0x89,0x80,0x22,0x34,0x0b,0x9a,0x03,0x7d,0x00,0xdf }},
+ {16, 0xb500, 0, {0x48,0x2b,0x60,0x08,0x05,0x02,0xe5,0x00,0x82,0x20,0x22,0xc4,0x8b,0xb0,0x02,0xe0 }},
+ {16, 0xb510, 0, {0x06,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xc5,0x00,0xb0,0x10,0x2c,0xc0 }},
+ {16, 0xb520, 0, {0x2a,0x00,0x02,0xa4,0x08,0xa8,0x04,0xe0,0x80,0x0b,0x00,0x02,0xc4,0x41,0xb2,0x04 }},
+ {16, 0xb530, 0, {0xa4,0x0a,0x0b,0xb0,0x02,0x8c,0x81,0x83,0x20,0x60,0x50,0x98,0x12,0x12,0x8b,0x80 }},
+ {16, 0xb540, 0, {0x89,0x00,0x2c,0xc8,0x0b,0x30,0x02,0xe2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb550, 0, {0xc0,0x11,0xac,0x20,0xbb,0x02,0x2a,0xc0,0x0a,0x88,0x02,0xa4,0x08,0xa9,0x80,0xa2 }},
+ {16, 0xb560, 0, {0xe1,0x1b,0x9c,0x22,0xe6,0x00,0xb8,0x40,0x26,0x30,0x0b,0x90,0x02,0xcc,0x01,0x93 }},
+ {16, 0xb570, 0, {0x04,0x2a,0x40,0x39,0x98,0x82,0xec,0x14,0x8b,0x65,0x2a,0xc0,0x0b,0xb2,0x02,0xf8 }},
+ {16, 0xb580, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xe7,0x00,0xb8,0x48,0x2e,0x00 }},
+ {16, 0xb590, 0, {0x0e,0x88,0x43,0x84,0x00,0xe3,0xc1,0x36,0xe8,0x0f,0x9c,0x12,0xe2,0x80,0xf3,0xc0 }},
+ {16, 0xb5a0, 0, {0x36,0x70,0x5f,0xa8,0x23,0xac,0x01,0xcb,0x04,0x22,0x40,0x4d,0x84,0x03,0xe2,0x00 }},
+ {16, 0xb5b0, 0, {0xd8,0x00,0x3e,0xc0,0x0f,0x90,0x03,0xd0,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb5c0, 0, {0xe0,0x01,0xb3,0x09,0xfe,0x10,0x3e,0x81,0x0d,0xc0,0x03,0x74,0x0c,0xff,0x00,0x3d }},
+ {16, 0xb5d0, 0, {0xc1,0x8c,0xd0,0x83,0x14,0x00,0xcd,0x20,0x3a,0x40,0x0d,0xca,0x01,0x7c,0x00,0xff }},
+ {16, 0xb5e0, 0, {0x00,0x1f,0x40,0x0e,0xc0,0x23,0xf2,0x46,0xfe,0x84,0x37,0xc0,0x0f,0xd8,0x03,0xf8 }},
+ {16, 0xb5f0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xdd,0x02,0x3d,0x40 }},
+ {16, 0xb600, 0, {0x0e,0x90,0x03,0xac,0x00,0xeb,0x48,0x3e,0xd0,0x0c,0x80,0x63,0xa2,0x08,0xca,0x00 }},
+ {16, 0xb610, 0, {0x32,0x08,0x0c,0xb0,0x03,0xac,0x08,0xeb,0x00,0x3e,0x40,0x0c,0xd4,0x83,0x58,0x20 }},
+ {16, 0xb620, 0, {0xf9,0x42,0x32,0xc0,0x0c,0xb0,0x03,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb630, 0, {0xc8,0x05,0x28,0x02,0xdb,0x00,0x2e,0xe0,0x28,0x3a,0x02,0x2e,0x00,0xdb,0x60,0x76 }},
+ {16, 0xb640, 0, {0xe0,0x0d,0x8c,0x02,0xe0,0x00,0x88,0x02,0x36,0x58,0x68,0x15,0x83,0x7c,0x08,0xbf }},
+ {16, 0xb650, 0, {0x00,0x2d,0x60,0x08,0x90,0x02,0xa9,0x00,0xb3,0x05,0x23,0xc0,0x08,0xb0,0x02,0xf2 }},
+ {16, 0xb660, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x10,0x80,0x00,0x0c,0xc1 }},
+ {16, 0xb670, 0, {0x08,0x1c,0x82,0x06,0x00,0x93,0xc0,0x20,0xf6,0x0a,0x20,0x02,0x08,0x00,0x93,0x00 }},
+ {16, 0xb680, 0, {0x24,0x60,0x09,0x3c,0x02,0x0c,0x00,0x83,0x00,0x2c,0x60,0x09,0x01,0x12,0x00,0x40 }},
+ {16, 0xb690, 0, {0xb0,0x00,0xe0,0xc0,0x08,0x30,0x02,0x70,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb6a0, 0, {0x20,0x41,0x0a,0x40,0x86,0x81,0x2d,0xe0,0x58,0x18,0x0a,0x16,0xa0,0x97,0x80,0x25 }},
+ {16, 0xb6b0, 0, {0xe9,0x19,0x78,0x82,0xd6,0x00,0x97,0x80,0x25,0xa0,0x19,0xf8,0x02,0x5e,0x00,0xb7 }},
+ {16, 0xb6c0, 0, {0x80,0x2d,0x60,0x28,0x48,0x12,0x96,0x00,0xb4,0x80,0x21,0xe0,0x28,0x78,0x02,0xc8 }},
+ {16, 0xb6d0, 0, {0x04,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0x81,0x30,0x3c,0xc2 }},
+ {16, 0xb6e0, 0, {0x0e,0x00,0x02,0x84,0x00,0xe3,0x40,0x28,0xe8,0x4c,0x29,0x03,0x0c,0x00,0xd3,0x00 }},
+ {16, 0xb6f0, 0, {0x34,0xc4,0x0d,0x31,0x03,0x8c,0x08,0xe3,0x00,0x3c,0x46,0x0c,0x20,0x03,0x00,0x80 }},
+ {16, 0xb700, 0, {0xf2,0x00,0x32,0xc0,0x0c,0x30,0x03,0xd2,0x02,0x10,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb710, 0, {0x40,0x19,0xb8,0x00,0xff,0x10,0x2f,0xc0,0x0f,0xc0,0x23,0xc4,0x80,0x7f,0x10,0x3e }},
+ {16, 0xb720, 0, {0xc0,0x0f,0xb1,0x03,0xdc,0x00,0xe7,0x00,0x3f,0x80,0x06,0xf1,0x43,0xfc,0x00,0xff }},
+ {16, 0xb730, 0, {0x08,0x7d,0x50,0x0e,0xe1,0x23,0xb4,0x08,0xfe,0x10,0x3f,0xc4,0x0f,0xf0,0x03,0xd0 }},
+ {16, 0xb740, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xe4,0x02,0xcc,0x00,0x3e,0x00 }},
+ {16, 0xb750, 0, {0x2c,0xc0,0x03,0x04,0x01,0xcb,0x00,0x33,0x60,0x2c,0x90,0x13,0xe8,0x00,0x73,0x00 }},
+ {16, 0xb760, 0, {0xb2,0xc1,0x0f,0xa0,0x03,0xec,0x80,0xfb,0x28,0x3e,0x54,0x1f,0xd0,0x03,0xfe,0x02 }},
+ {16, 0xb770, 0, {0xc9,0x80,0x32,0xc0,0x0f,0xb0,0x03,0xca,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb780, 0, {0x48,0x11,0x80,0x00,0x86,0x00,0x2d,0x80,0x08,0x20,0x02,0x14,0x08,0x87,0x00,0x29 }},
+ {16, 0xb790, 0, {0x40,0x08,0x70,0x02,0xdc,0x00,0xb7,0x00,0x21,0xc0,0x0b,0x60,0x02,0x5c,0xa0,0x97 }},
+ {16, 0xb7a0, 0, {0x20,0x2d,0x48,0x0b,0x50,0x02,0xdc,0x10,0x8d,0x00,0x21,0xc8,0x0b,0x70,0x02,0xd2 }},
+ {16, 0xb7b0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9f,0x00,0x85,0x81,0x2c,0x60 }},
+ {16, 0xb7c0, 0, {0x18,0x58,0x02,0xde,0x20,0xb7,0x82,0x28,0x60,0x5a,0x78,0x52,0xde,0x10,0xbf,0x80 }},
+ {16, 0xb7d0, 0, {0x21,0xe0,0x4b,0x78,0x06,0xde,0x40,0xb7,0xa0,0x2d,0x69,0x9b,0x78,0x12,0xce,0x00 }},
+ {16, 0xb7e0, 0, {0x87,0x80,0xe1,0xe4,0x0b,0x78,0x02,0xc0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb7f0, 0, {0x48,0x14,0xee,0x00,0x83,0x00,0x2c,0xc2,0x08,0x36,0x02,0x8c,0x08,0x83,0xf0,0x68 }},
+ {16, 0xb800, 0, {0x40,0x0a,0x3e,0x02,0xcd,0x40,0xb3,0x00,0x20,0xe0,0x0b,0x32,0x06,0x4c,0x00,0x9b }},
+ {16, 0xb810, 0, {0x00,0x0c,0x40,0x0b,0x30,0x02,0xcd,0x80,0x83,0x08,0x20,0xc0,0x0b,0xb1,0x02,0xda }},
+ {16, 0xb820, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xb8,0x00,0xce,0x08,0x3f,0xb0 }},
+ {16, 0xb830, 0, {0x0c,0xe4,0x23,0xda,0x02,0xde,0x40,0xbb,0xb2,0x0e,0xe2,0x43,0xfa,0x00,0xfe,0x00 }},
+ {16, 0xb840, 0, {0x33,0x90,0x0b,0xe0,0x03,0xe8,0x00,0xfa,0x00,0x3e,0x81,0x0b,0xe0,0x13,0xf9,0x08 }},
+ {16, 0xb850, 0, {0xce,0x40,0x32,0x80,0x0f,0xa8,0x03,0xfa,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb860, 0, {0x48,0x00,0xe0,0x24,0x98,0x08,0x3c,0x04,0x0f,0x00,0x0b,0x60,0x00,0xf8,0x40,0x2e }},
+ {16, 0xb870, 0, {0x03,0x0d,0x80,0x03,0xe0,0x00,0xf8,0x00,0x3e,0x06,0x0b,0x80,0x03,0xe0,0x00,0xd8 }},
+ {16, 0xb880, 0, {0x00,0x3c,0x00,0x03,0x8c,0x23,0xe1,0x00,0xf8,0x00,0x7e,0x00,0x0f,0x80,0x03,0xd2 }},
+ {16, 0xb890, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x02,0xc9,0x00,0x3e,0x40 }},
+ {16, 0xb8a0, 0, {0x8c,0x90,0x03,0x25,0x00,0xe9,0x80,0x32,0x44,0x0f,0x94,0x02,0xe4,0x20,0xf9,0x00 }},
+ {16, 0xb8b0, 0, {0x32,0x70,0x0f,0x9a,0x43,0xe4,0x00,0xf9,0x00,0x32,0x40,0x0c,0x10,0x33,0x24,0x10 }},
+ {16, 0xb8c0, 0, {0xf9,0x01,0x3e,0x40,0x0f,0x90,0x03,0x02,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb8d0, 0, {0x80,0x04,0x64,0x00,0x89,0x82,0x2e,0x40,0x28,0x90,0x02,0x24,0x82,0x81,0xc0,0xa2 }},
+ {16, 0xb8e0, 0, {0x70,0x0b,0x9c,0x02,0xe4,0x00,0x31,0x42,0xa2,0x60,0x0b,0x94,0x82,0xe4,0x00,0xb9 }},
+ {16, 0xb8f0, 0, {0x00,0x2a,0x40,0x08,0x94,0xa2,0x25,0x00,0xb9,0x00,0x2e,0x40,0x0b,0x90,0x0a,0x20 }},
+ {16, 0xb900, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0x89,0x64,0x2e,0x40 }},
+ {16, 0xb910, 0, {0x08,0x90,0x42,0xa4,0x00,0x89,0x60,0x22,0x42,0x0b,0x90,0x02,0xe6,0x00,0xb9,0x80 }},
+ {16, 0xb920, 0, {0x22,0x40,0x0b,0x90,0x02,0xa4,0x04,0xb9,0x00,0x22,0x40,0x28,0x90,0x02,0x24,0x04 }},
+ {16, 0xb930, 0, {0xb9,0x00,0x2e,0x40,0x0b,0x90,0x02,0x0e,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb940, 0, {0x08,0x04,0x05,0x80,0x81,0x00,0x2c,0xc1,0x48,0x10,0x02,0xa4,0x02,0x81,0x00,0x20 }},
+ {16, 0xb950, 0, {0x40,0x83,0x34,0x02,0xc4,0x00,0xbb,0x00,0x20,0xd0,0x0b,0x14,0x02,0xc4,0x80,0xb1 }},
+ {16, 0xb960, 0, {0x20,0xa0,0x68,0x18,0x14,0x1a,0x0d,0x00,0xb1,0x40,0x2c,0x50,0x0b,0x10,0x02,0x0a }},
+ {16, 0xb970, 0, {0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xc8,0x00,0x3e,0x00 }},
+ {16, 0xb980, 0, {0x8c,0x80,0x0b,0xa0,0x04,0xe8,0x00,0x32,0x00,0x07,0x80,0x03,0xe0,0x00,0xf8,0x00 }},
+ {16, 0xb990, 0, {0x32,0x00,0x1f,0x80,0x03,0xa1,0x40,0xf8,0x50,0x32,0x00,0x0c,0x80,0x03,0x20,0x00 }},
+ {16, 0xb9a0, 0, {0xf8,0x00,0x3e,0x00,0x0f,0x80,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb9b0, 0, {0x98,0x1d,0xf4,0x46,0xfd,0x40,0x3f,0x50,0x23,0xd4,0x13,0x74,0x04,0xf5,0x02,0x3f }},
+ {16, 0xb9c0, 0, {0x50,0x0f,0xd4,0x03,0xfd,0x00,0xbd,0x00,0x2f,0x50,0x0f,0xd0,0x03,0xe4,0x40,0xf9 }},
+ {16, 0xb9d0, 0, {0x10,0x3f,0x44,0x0f,0xd4,0x03,0xf5,0x08,0xfd,0x06,0x3e,0x50,0x0f,0xd2,0x83,0xe6 }},
+ {16, 0xb9e0, 0, {0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xe6,0x40,0xed,0x04,0x3e,0x48 }},
+ {16, 0xb9f0, 0, {0x0c,0xb2,0x83,0xf4,0x00,0xc1,0x00,0x32,0x40,0x8c,0xd0,0x03,0x34,0x00,0xfd,0x00 }},
+ {16, 0xba00, 0, {0x37,0x40,0x0f,0xd0,0x03,0xe6,0x20,0xf9,0x88,0x3d,0x62,0x0c,0xd8,0x03,0xfe,0x24 }},
+ {16, 0xba10, 0, {0xc1,0x00,0x3e,0x78,0x0f,0xd0,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xba20, 0, {0x38,0x10,0xe1,0x00,0x88,0x40,0x2e,0x10,0x08,0xc4,0x23,0xa0,0x08,0x88,0x06,0x2a }},
+ {16, 0xba30, 0, {0x14,0x08,0x80,0x03,0x60,0x04,0xb8,0x00,0x22,0x00,0x0b,0x80,0x02,0xe2,0x00,0xb8 }},
+ {16, 0xba40, 0, {0x80,0x2e,0x00,0x08,0x8c,0x02,0xe3,0x80,0x88,0x02,0x2e,0x38,0x0b,0x88,0x02,0x0e }},
+ {16, 0xba50, 0, {0x06,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc5,0x80,0xa1,0xc0,0x2d,0x70 }},
+ {16, 0xba60, 0, {0x08,0x50,0x42,0xc4,0x00,0xa9,0x00,0x20,0xe0,0x2a,0x10,0x0a,0x04,0x10,0xb1,0x00 }},
+ {16, 0xba70, 0, {0x24,0x40,0x4b,0x10,0x06,0xc4,0x20,0xb1,0x08,0x6e,0x40,0x0b,0x16,0x82,0xc4,0x20 }},
+ {16, 0xba80, 0, {0x81,0x00,0x2c,0x50,0x0b,0x92,0x82,0x52,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xba90, 0, {0x18,0x11,0xa4,0x00,0xa9,0x01,0x2e,0x40,0x28,0xd0,0x20,0xa4,0x04,0xa9,0x00,0x2a }},
+ {16, 0xbaa0, 0, {0x40,0x1a,0xb0,0x12,0x24,0x00,0xb9,0x0c,0x22,0x42,0x0b,0x94,0x02,0xe4,0x00,0xb9 }},
+ {16, 0xbab0, 0, {0x00,0x6e,0x40,0x0b,0x96,0x02,0xe4,0x11,0x89,0x20,0x6e,0x40,0x0b,0x90,0x02,0x46 }},
+ {16, 0xbac0, 0, {0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0xc0,0xa9,0xc0,0x3e,0x50 }},
+ {16, 0xbad0, 0, {0x08,0x9c,0x83,0xe4,0x02,0xe9,0x00,0xb2,0x40,0x2a,0x92,0x12,0x26,0x40,0xf9,0x40 }},
+ {16, 0xbae0, 0, {0x36,0x70,0x0f,0x94,0x03,0xe4,0x04,0xf9,0x01,0x3c,0x40,0x0f,0x98,0x03,0xe6,0x02 }},
+ {16, 0xbaf0, 0, {0xc9,0x22,0x3e,0x40,0x0f,0x10,0x02,0x68,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbb00, 0, {0x28,0x01,0x86,0x04,0xd9,0x40,0x1c,0x40,0x0f,0x92,0x23,0xa4,0xb0,0xdb,0x04,0x3c }},
+ {16, 0xbb10, 0, {0xc0,0x0d,0x9a,0x03,0xe4,0x00,0xf9,0x00,0x3e,0x44,0x0f,0x90,0x03,0xe4,0x00,0xf9 }},
+ {16, 0xbb20, 0, {0x00,0x3e,0x42,0x2c,0x90,0x23,0xe4,0x80,0xf9,0x00,0x3e,0x40,0x8f,0x92,0x03,0x92 }},
+ {16, 0xbb30, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa1,0x00,0xc8,0x20,0x32,0x00 }},
+ {16, 0xbb40, 0, {0x4c,0xc0,0x8b,0x20,0x02,0xc8,0x31,0x32,0x20,0x2d,0x84,0x03,0xe1,0x04,0xf8,0x48 }},
+ {16, 0xbb50, 0, {0xba,0x00,0x0f,0x89,0x03,0xe0,0x00,0xc8,0x00,0x32,0x00,0x0d,0x81,0x13,0x20,0x10 }},
+ {16, 0xbb60, 0, {0xf8,0x00,0x3a,0x00,0x0f,0x81,0x23,0x02,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbb70, 0, {0x28,0x05,0x28,0x00,0x0e,0x40,0x22,0x80,0x28,0xa4,0x02,0x19,0x00,0x52,0x80,0xa2 }},
+ {16, 0xbb80, 0, {0x80,0x4d,0xed,0x82,0xe8,0x00,0xb6,0x42,0x23,0xbd,0x0b,0xe8,0x02,0xe8,0x04,0xda }},
+ {16, 0xbb90, 0, {0x00,0x37,0x80,0x08,0xe0,0x02,0x3a,0x20,0xba,0x00,0x22,0x80,0x0b,0xa8,0x0a,0x0a }},
+ {16, 0xbba0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0x83,0x80,0x60,0xc0 }},
+ {16, 0xbbb0, 0, {0x08,0x29,0x02,0x0d,0x00,0x92,0x40,0x24,0xc0,0x08,0xb4,0x02,0xcc,0x00,0xb3,0x00 }},
+ {16, 0xbbc0, 0, {0x68,0xe0,0x1b,0x30,0x02,0xcc,0x00,0x93,0x01,0x24,0xc0,0x69,0x38,0x02,0x6c,0x00 }},
+ {16, 0xbbd0, 0, {0xb3,0x00,0x2c,0xc0,0x0b,0x30,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbbe0, 0, {0xa0,0x01,0x1c,0x40,0x83,0xc0,0x20,0x40,0x08,0x28,0x06,0x9c,0x18,0x9c,0x02,0x24 }},
+ {16, 0xbbf0, 0, {0xc0,0x09,0x70,0x02,0xd4,0x00,0xb7,0x00,0x21,0xc0,0x0b,0x70,0x02,0xce,0x40,0x97 }},
+ {16, 0xbc00, 0, {0xb0,0x25,0x40,0x08,0x78,0x1a,0x58,0x00,0xbf,0xa2,0x65,0xc8,0x0b,0x78,0x02,0x20 }},
+ {16, 0xbc10, 0, {0x04,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x0e,0x02,0x87,0x80,0xb1,0xa0 }},
+ {16, 0xbc20, 0, {0x0c,0x68,0x03,0x1a,0x08,0xd6,0x92,0x35,0xe4,0x28,0x78,0x42,0xd6,0x10,0xf5,0x80 }},
+ {16, 0xbc30, 0, {0x39,0xa0,0x0f,0x78,0x23,0xde,0x30,0xd3,0xa2,0x35,0xa0,0x4d,0xe8,0x03,0x5e,0x00 }},
+ {16, 0xbc40, 0, {0xf7,0xd0,0x3d,0xf8,0x0f,0xf0,0x03,0x22,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbc50, 0, {0x08,0x1d,0xac,0x00,0xfb,0x04,0x3e,0x00,0x0b,0xa0,0x03,0x48,0x04,0xfa,0x41,0x3a }},
+ {16, 0xbc60, 0, {0x50,0x0f,0xb0,0x03,0xe4,0x00,0xf1,0x00,0x3e,0xc0,0x0f,0xb0,0x03,0xed,0x88,0xfb }},
+ {16, 0xbc70, 0, {0x4d,0x3e,0x00,0x0f,0xf0,0x03,0xbc,0x08,0xfb,0x20,0x3a,0xc0,0x0f,0xb0,0x03,0xc2 }},
+ {16, 0xbc80, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xfe,0x00,0xdc,0x80,0xb3,0xe0 }},
+ {16, 0xbc90, 0, {0x0c,0xd8,0x03,0xce,0x00,0xc8,0xa0,0x31,0xa0,0x8d,0xe9,0x03,0xbe,0x00,0xb2,0x80 }},
+ {16, 0xbca0, 0, {0x33,0xe0,0x0c,0xe8,0x43,0x7e,0x04,0x0f,0x81,0x31,0xe4,0x0c,0xd8,0x03,0xf6,0x00 }},
+ {16, 0xbcb0, 0, {0xff,0x80,0x3f,0xe0,0x0f,0xf8,0x03,0x00,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbcc0, 0, {0xa8,0x11,0x9c,0x00,0xb4,0x40,0x35,0x40,0x08,0x50,0x82,0xde,0x80,0xd4,0x90,0x21 }},
+ {16, 0xbcd0, 0, {0xe0,0x0d,0x51,0x02,0xd4,0x40,0xb6,0xb0,0x2b,0x90,0x0e,0xe5,0x02,0x9c,0x40,0xd7 }},
+ {16, 0xbce0, 0, {0x22,0x19,0x5c,0x0d,0x70,0x02,0xd8,0x00,0xb7,0x20,0x2d,0xc0,0x0b,0xf0,0x03,0x6a }},
+ {16, 0xbcf0, 0, {0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x00,0x93,0x10,0x21,0x80 }},
+ {16, 0xbd00, 0, {0x08,0x58,0x02,0xdc,0xc0,0x94,0x00,0x23,0xd0,0x08,0x70,0xa0,0xd4,0x20,0xb5,0x02 }},
+ {16, 0xbd10, 0, {0x29,0x80,0x09,0x60,0x82,0x0c,0x00,0x87,0x02,0x25,0xc0,0x19,0x40,0x02,0xd4,0x00 }},
+ {16, 0xbd20, 0, {0xb7,0x00,0x6d,0xc0,0x0b,0x70,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbd30, 0, {0x20,0x14,0xec,0x00,0xb3,0xc0,0x20,0x01,0x48,0x18,0x02,0xcc,0x02,0x81,0x44,0xa0 }},
+ {16, 0xbd40, 0, {0xc0,0x89,0x38,0x02,0xc7,0x80,0xb1,0x00,0x2c,0x09,0x4a,0x00,0x62,0xac,0x09,0x93 }},
+ {16, 0xbd50, 0, {0x01,0x28,0x40,0x19,0x30,0x02,0xcd,0x10,0xb3,0x90,0x2c,0xc0,0x0b,0x30,0x02,0xc8 }},
+ {16, 0xbd60, 0, {0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xbc,0x20,0xdb,0x62,0x22,0xe0 }},
+ {16, 0xbd70, 0, {0x6c,0xa0,0x03,0xe4,0x00,0x98,0x00,0x32,0xc0,0xec,0x98,0x23,0xae,0x08,0xfb,0x08 }},
+ {16, 0xbd80, 0, {0x3a,0x78,0x09,0x90,0x03,0x7c,0x10,0xcf,0x00,0x26,0x40,0x0c,0xb0,0x03,0xec,0x00 }},
+ {16, 0xbd90, 0, {0xff,0x80,0x3f,0xc0,0x0f,0x90,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbda0, 0, {0x80,0x00,0xec,0x20,0xfb,0x48,0x3c,0x61,0x0f,0xa0,0x43,0xed,0x00,0xf8,0x24,0x3e }},
+ {16, 0xbdb0, 0, {0x50,0x0f,0x90,0x83,0xe4,0x00,0xfb,0x00,0x3a,0x50,0x0f,0x80,0x43,0xec,0x08,0xfb }},
+ {16, 0xbdc0, 0, {0x00,0x3e,0x40,0x0f,0x40,0x03,0xf0,0x00,0xfb,0x00,0x3e,0xc1,0x0f,0x90,0x03,0x60 }},
+ {16, 0xbdd0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x00,0xdd,0xa0,0x32,0x80 }},
+ {16, 0xbde0, 0, {0x0c,0xe0,0x01,0xfc,0x00,0xdc,0x91,0x39,0xc0,0x3c,0x40,0x03,0x34,0x00,0xff,0x80 }},
+ {16, 0xbdf0, 0, {0x3f,0x00,0x0f,0xd0,0x07,0xfc,0x00,0xcb,0x00,0x3d,0x40,0x0c,0xe0,0x03,0x38,0x20 }},
+ {16, 0xbe00, 0, {0xcf,0x02,0x3d,0xc0,0x0c,0xd0,0x03,0x08,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbe10, 0, {0x81,0x04,0x6c,0x00,0x01,0x40,0x22,0x00,0x28,0xa0,0x02,0xce,0x86,0x83,0x64,0x22 }},
+ {16, 0xbe20, 0, {0xf4,0x08,0x8c,0x0f,0x64,0x00,0xbb,0x10,0x2e,0x60,0x0b,0x9c,0x03,0xac,0x01,0xdb }},
+ {16, 0xbe30, 0, {0x00,0x3e,0x60,0x08,0x8f,0x02,0x23,0x40,0x8b,0x00,0x3a,0xc0,0x0d,0x10,0x43,0x68 }},
+ {16, 0xbe40, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0x99,0x00,0xa2,0xc0 }},
+ {16, 0xbe50, 0, {0x08,0x90,0x02,0xa6,0x07,0x98,0x00,0x02,0xc2,0x48,0x88,0x02,0x2c,0x00,0xba,0x02 }},
+ {16, 0xbe60, 0, {0x6e,0x60,0x0a,0x98,0x02,0xec,0x00,0x8b,0x01,0x2e,0x60,0x08,0x90,0x02,0x05,0x00 }},
+ {16, 0xbe70, 0, {0x8b,0x00,0x2e,0xc0,0x08,0xb1,0x02,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbe80, 0, {0x08,0x04,0x0c,0x10,0x81,0x00,0x20,0x40,0x28,0x10,0x26,0xcc,0x80,0x80,0x20,0xa0 }},
+ {16, 0xbe90, 0, {0xcc,0x18,0x14,0x42,0x04,0x00,0xb2,0x20,0x6c,0x40,0x0b,0x00,0x02,0x8c,0x00,0x83 }},
+ {16, 0xbea0, 0, {0x00,0x28,0x40,0x28,0x00,0x02,0x00,0x00,0x83,0x00,0x28,0xc0,0x09,0xb0,0x02,0x42 }},
+ {16, 0xbeb0, 0, {0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x6c,0x00,0xd9,0x00,0x22,0x80 }},
+ {16, 0xbec0, 0, {0x0c,0x90,0x03,0xac,0x80,0xda,0x29,0x2a,0xd2,0x28,0x80,0x02,0x24,0x00,0xfb,0x20 }},
+ {16, 0xbed0, 0, {0x3e,0x00,0x0f,0x90,0x02,0xfc,0x00,0x8f,0x00,0x2e,0x40,0x0c,0x80,0x0b,0x20,0x02 }},
+ {16, 0xbee0, 0, {0xcf,0x00,0x3e,0xc0,0x0c,0xb0,0x03,0x00,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbef0, 0, {0xa0,0x1d,0xfc,0x00,0xfd,0x00,0x3f,0x00,0x0f,0xd0,0x63,0xfc,0x49,0xf5,0x00,0x3e }},
+ {16, 0xbf00, 0, {0xc0,0x0b,0xc0,0x01,0xf4,0x00,0x7f,0x40,0x3f,0x40,0x1f,0xd0,0x03,0xbc,0x00,0xff }},
+ {16, 0xbf10, 0, {0x00,0x3f,0x40,0x0f,0xc0,0x03,0xf0,0x00,0xff,0x00,0x3b,0xc0,0x0f,0xf0,0x03,0xe8 }},
+ {16, 0xbf20, 0, {0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0xf2,0x40,0xec,0xa0,0x3f,0xe0 }},
+ {16, 0xbf30, 0, {0x0d,0x48,0x03,0x7d,0x80,0xf4,0x80,0x33,0x6c,0x0e,0xc8,0x03,0x32,0x00,0xdd,0x90 }},
+ {16, 0xbf40, 0, {0x3b,0xa0,0x2d,0xf0,0x03,0xfc,0xc0,0xff,0x00,0x3b,0xe0,0x8e,0xf0,0x03,0x3c,0x04 }},
+ {16, 0xbf50, 0, {0xec,0x60,0x31,0x00,0x0c,0xf0,0x03,0xb0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbf60, 0, {0x80,0x10,0xec,0x00,0xd9,0xc1,0x2e,0xe1,0x0d,0x88,0x02,0x3c,0x80,0xf8,0x80,0x36 }},
+ {16, 0xbf70, 0, {0x7d,0x18,0xa0,0x02,0x28,0xb0,0xea,0x20,0x22,0x20,0x08,0x77,0x02,0xfd,0x50,0xbb }},
+ {16, 0xbf80, 0, {0x80,0x22,0x40,0x0b,0xf4,0x42,0x3d,0x80,0x88,0x31,0x22,0x12,0x08,0xf6,0x02,0xe0 }},
+ {16, 0xbf90, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x00,0x80,0x11,0x2e,0xc1 }},
+ {16, 0xbfa0, 0, {0x08,0x00,0x02,0x4d,0x80,0xb8,0x00,0x20,0x00,0x0a,0x02,0x82,0x00,0x00,0x99,0x20 }},
+ {16, 0xbfb0, 0, {0x22,0xc0,0x09,0x30,0x82,0xcc,0x00,0xb3,0x00,0x28,0xca,0x0b,0x34,0x82,0x0d,0x20 }},
+ {16, 0xbfc0, 0, {0x80,0x00,0xa0,0x8c,0x08,0x34,0x82,0xa2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbfd0, 0, {0xc0,0x15,0xac,0x40,0x99,0x80,0x2e,0xc2,0x09,0x94,0x02,0x2c,0x00,0xa9,0x80,0x26 }},
+ {16, 0xbfe0, 0, {0x60,0x08,0x38,0x42,0x22,0x20,0xba,0x41,0x62,0x46,0x3b,0xb0,0x02,0xec,0x01,0xbb }},
+ {16, 0xbff0, 0, {0x80,0x22,0x40,0x0b,0xb0,0x46,0x0c,0x18,0x88,0xc0,0x22,0x22,0x08,0xb0,0x06,0xf0 }},
+ {16, 0xc000, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xcc,0x00,0xc9,0x81,0x3c,0xc1 }},
+ {16, 0xc010, 0, {0x0c,0xa9,0x23,0x6c,0x00,0xb2,0x80,0x32,0x78,0x0a,0x8a,0x0b,0x26,0x00,0x99,0x01 }},
+ {16, 0xc020, 0, {0x30,0xe0,0x0d,0xb0,0x03,0xec,0x00,0xb9,0x00,0x3a,0xc0,0x1e,0xb0,0x03,0x2c,0x00 }},
+ {16, 0xc030, 0, {0xcb,0x80,0x32,0x61,0x0c,0xb0,0x13,0x90,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc040, 0, {0xe0,0x01,0xbc,0x10,0xdd,0x00,0x3f,0xc2,0x0f,0xe8,0x03,0xac,0x00,0xfe,0x00,0x3d }},
+ {16, 0xc050, 0, {0x40,0x0f,0xc0,0x43,0xf8,0x10,0xef,0x14,0xb7,0xe0,0x0c,0xf0,0x03,0xfc,0x00,0xf5 }},
+ {16, 0xc060, 0, {0x02,0x3f,0x44,0x4f,0xb0,0x4b,0xfc,0x02,0xd4,0x04,0x3d,0x40,0x2f,0xf0,0x03,0xf8 }},
+ {16, 0xc070, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xf9,0x08,0x3e,0x60 }},
+ {16, 0xc080, 0, {0x0d,0xa0,0x03,0xac,0x00,0xe8,0x50,0x32,0x00,0x0c,0x84,0x03,0xa5,0x00,0xe9,0x00 }},
+ {16, 0xc090, 0, {0x3a,0xd8,0x0f,0xb0,0x03,0x2c,0x00,0xf9,0x00,0x3a,0xc0,0x0f,0x30,0x03,0x2c,0x00 }},
+ {16, 0xc0a0, 0, {0xcb,0x44,0x3e,0xd4,0x0e,0xb0,0x03,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc0b0, 0, {0xc8,0x05,0x2c,0x08,0xb9,0x80,0x2e,0xc0,0x0a,0x30,0x42,0x3c,0x00,0x89,0x04,0x76 }},
+ {16, 0xc0c0, 0, {0x60,0x08,0x90,0x62,0x20,0x00,0x82,0x04,0x22,0xd0,0x08,0xf0,0x43,0x7c,0x00,0xbb }},
+ {16, 0xc0d0, 0, {0x82,0x22,0x40,0x0b,0xf0,0x42,0x3c,0x00,0x8a,0xc0,0x2e,0xc1,0x08,0xf0,0x02,0xf2 }},
+ {16, 0xc0e0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x10,0xb2,0xd0,0x2c,0xc0 }},
+ {16, 0xc0f0, 0, {0x29,0x18,0x02,0x8c,0x04,0xa1,0x00,0x24,0x9c,0x08,0x10,0x02,0x80,0x00,0xa1,0x01 }},
+ {16, 0xc100, 0, {0x0c,0xc1,0x2b,0x30,0x52,0x8c,0x04,0xb3,0x01,0x28,0x40,0x4b,0x30,0x02,0x4c,0x00 }},
+ {16, 0xc110, 0, {0x90,0x20,0x2c,0x20,0x0a,0x30,0x02,0xf8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc120, 0, {0x20,0x41,0x1e,0x00,0xb7,0xa2,0x25,0xe8,0x8a,0x68,0x02,0x1e,0x00,0x85,0x80,0x25 }},
+ {16, 0xc130, 0, {0x80,0x88,0xe8,0x02,0x3e,0x00,0x85,0x80,0x2f,0xe4,0x28,0x78,0x02,0xde,0x00,0xb7 }},
+ {16, 0xc140, 0, {0x80,0x61,0xe0,0x03,0x78,0x02,0x5e,0x82,0xb7,0x82,0x2d,0xe0,0x08,0x78,0x02,0xc8 }},
+ {16, 0xc150, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0d,0x00,0xf0,0x10,0x3c,0x80 }},
+ {16, 0xc160, 0, {0x0d,0x10,0x83,0x8c,0x00,0xe2,0x50,0x26,0x04,0x0c,0x11,0x03,0x88,0x40,0xeb,0x00 }},
+ {16, 0xc170, 0, {0x3c,0xc4,0x0f,0x30,0x03,0x8c,0x00,0xf3,0x08,0x38,0x40,0x07,0x30,0x03,0x6e,0x40 }},
+ {16, 0xc180, 0, {0xd0,0x08,0x3c,0x88,0x0e,0x30,0x43,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc190, 0, {0x40,0x1d,0xbc,0x00,0xfb,0x34,0x3c,0xc9,0x4e,0xb0,0x23,0xed,0x20,0xfb,0x04,0x3f }},
+ {16, 0xc1a0, 0, {0xc8,0x8f,0x70,0x53,0x4c,0x00,0xeb,0x10,0x31,0xc5,0x0e,0xf4,0x03,0x6d,0x00,0xf3 }},
+ {16, 0xc1b0, 0, {0x00,0x3f,0xc0,0x0f,0xf4,0x0b,0xbc,0x00,0xcd,0x00,0x3f,0xc0,0x0f,0xf4,0x83,0xd0 }},
+ {16, 0xc1c0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xce,0x04,0xc9,0x04,0xb0,0xc1 }},
+ {16, 0xc1d0, 0, {0x0f,0x98,0x13,0x6c,0x90,0xcb,0x02,0x3e,0xc0,0x4f,0xb0,0x63,0xe4,0x00,0xf1,0x80 }},
+ {16, 0xc1e0, 0, {0x12,0xc0,0x0c,0xb5,0x03,0xec,0xc0,0xcf,0x83,0x32,0x40,0x0f,0xb3,0x23,0x2d,0xa4 }},
+ {16, 0xc1f0, 0, {0xfb,0x00,0x3e,0x00,0x0f,0xb4,0x03,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc200, 0, {0x48,0x11,0x9c,0x00,0x87,0x00,0x21,0xc0,0x2d,0x60,0x02,0x1c,0x00,0xd7,0x00,0x39 }},
+ {16, 0xc210, 0, {0xc0,0x0b,0x60,0x02,0xdc,0x00,0xb5,0x00,0x21,0xc0,0x2a,0x70,0x12,0xcc,0x80,0x87 }},
+ {16, 0xc220, 0, {0x00,0x35,0xc0,0x0b,0x72,0x52,0x1c,0x00,0xb7,0x00,0x2d,0x41,0x0b,0x32,0x02,0x12 }},
+ {16, 0xc230, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0xbe,0x00,0x81,0xc0,0x23,0x20 }},
+ {16, 0xc240, 0, {0x0b,0xd8,0x02,0x5e,0x00,0x06,0xc0,0x2d,0xa0,0x0b,0x7c,0x12,0xde,0x08,0xbf,0x80 }},
+ {16, 0xc250, 0, {0xa1,0xe2,0x2a,0x7a,0x02,0xde,0x00,0x93,0x80,0x25,0x60,0x0b,0x78,0x1e,0x5e,0x50 }},
+ {16, 0xc260, 0, {0xb7,0x80,0x2d,0xa0,0x0b,0x78,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc270, 0, {0x48,0x14,0xce,0x00,0x83,0x60,0x20,0xc0,0x09,0x31,0x02,0x2c,0x00,0x93,0x00,0x28 }},
+ {16, 0xc280, 0, {0xc0,0x1b,0xb0,0x06,0xcc,0x80,0xb3,0x48,0x20,0xf0,0x0a,0x30,0x02,0xec,0x00,0x93 }},
+ {16, 0xc290, 0, {0x80,0x24,0xc0,0x0b,0xb0,0x02,0x4c,0x10,0xb3,0xc8,0x2c,0xd2,0x8b,0x30,0x02,0x12 }},
+ {16, 0xc2a0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xbb,0x00,0xc6,0xc4,0x31,0x81 }},
+ {16, 0xc2b0, 0, {0x0f,0xe0,0x03,0x68,0x00,0xce,0x80,0x3f,0xa2,0x0b,0xe8,0x03,0xf9,0x00,0xfe,0x40 }},
+ {16, 0xc2c0, 0, {0x31,0x80,0x6e,0xa0,0x07,0xe8,0x00,0xda,0x00,0x26,0x81,0x0f,0xa0,0x02,0x68,0x01 }},
+ {16, 0xc2d0, 0, {0xf6,0xe0,0x3d,0x92,0x0f,0xa0,0x03,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc2e0, 0, {0x48,0x00,0xe0,0xc2,0xf8,0x04,0x3e,0x14,0x0f,0x80,0x13,0xe0,0x10,0xf8,0x01,0x3e }},
+ {16, 0xc2f0, 0, {0x10,0x0f,0x80,0x43,0xe0,0x00,0xb8,0x00,0x3e,0x00,0x47,0x80,0x03,0xe0,0x02,0xe8 }},
+ {16, 0xc300, 0, {0x10,0x3e,0x00,0x0f,0x80,0x07,0xa0,0x00,0xf8,0x00,0x2e,0x00,0x0f,0x80,0x0b,0xd2 }},
+ {16, 0xc310, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xf9,0x01,0x32,0x40 }},
+ {16, 0xc320, 0, {0x8c,0x90,0x03,0xe4,0x00,0xc9,0x00,0x36,0x42,0x0f,0x90,0x03,0xa4,0x00,0xc9,0x00 }},
+ {16, 0xc330, 0, {0x3e,0x42,0x0d,0x90,0x03,0x64,0x00,0xd9,0x00,0x3e,0x40,0x0f,0x90,0x0b,0x64,0x00 }},
+ {16, 0xc340, 0, {0xf9,0x90,0x32,0x41,0x0c,0x90,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc350, 0, {0x80,0x04,0x64,0x00,0xb9,0xc8,0xa2,0x60,0x0a,0x92,0x02,0xe4,0x00,0x89,0x40,0x2e }},
+ {16, 0xc360, 0, {0x58,0x0b,0x90,0x02,0x04,0x00,0xd9,0x00,0x2e,0x42,0x08,0x90,0x02,0xe4,0x04,0x89 }},
+ {16, 0xc370, 0, {0x00,0x2e,0x40,0x0b,0x90,0x06,0x24,0x04,0xb9,0x08,0x2a,0x40,0x48,0x90,0x12,0x20 }},
+ {16, 0xc380, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0xb9,0x10,0x22,0x44 }},
+ {16, 0xc390, 0, {0x08,0x90,0x02,0xe4,0x00,0x89,0x00,0x22,0x45,0x8b,0x90,0x02,0xa4,0x00,0x89,0x00 }},
+ {16, 0xc3a0, 0, {0x2a,0x40,0x09,0x90,0x02,0xe4,0x00,0x99,0x80,0x2e,0x40,0x0b,0x90,0x26,0x24,0x00 }},
+ {16, 0xc3b0, 0, {0xb9,0x01,0x22,0x70,0x09,0x10,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc3c0, 0, {0x08,0x04,0x04,0x08,0xb1,0x20,0x20,0x40,0x0a,0x10,0x02,0xc4,0x80,0x83,0x00,0x2c }},
+ {16, 0xc3d0, 0, {0x50,0x4b,0x10,0x02,0x24,0x00,0x91,0x00,0x2e,0x40,0x08,0x12,0x02,0xc4,0x81,0x81 }},
+ {16, 0xc3e0, 0, {0xa2,0x6c,0x40,0x0b,0x12,0x02,0x04,0x80,0xb9,0x20,0x2a,0x48,0x29,0x12,0x02,0x02 }},
+ {16, 0xc3f0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x61,0x40,0xf8,0x00,0x32,0x80 }},
+ {16, 0xc400, 0, {0x08,0x80,0x03,0xe1,0x42,0xc8,0x00,0x32,0x00,0x1f,0x85,0x03,0xa1,0x40,0xc8,0x50 }},
+ {16, 0xc410, 0, {0x3a,0x00,0x8d,0x85,0x03,0x61,0x40,0xd8,0x00,0x3e,0x00,0x0f,0x05,0x03,0x21,0x40 }},
+ {16, 0xc420, 0, {0xf8,0x50,0x32,0x14,0x0d,0x85,0x0b,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc430, 0, {0x98,0x1d,0xf4,0x04,0xfd,0x10,0x3f,0x40,0x0f,0x50,0x03,0xc4,0x40,0xfd,0x00,0x3f }},
+ {16, 0xc440, 0, {0x51,0x0f,0xd0,0x03,0xf4,0x00,0xff,0x01,0x3d,0x40,0x0f,0x91,0x03,0xe4,0x40,0xfd }},
+ {16, 0xc450, 0, {0x10,0x3f,0x4a,0x0f,0x91,0x03,0xe4,0x40,0xfd,0x10,0x3f,0x44,0x0e,0x91,0x03,0xe6 }},
+ {16, 0xc460, 0, {0x02,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xc5,0x00,0xcd,0x00,0x31,0x40 }},
+ {16, 0xc470, 0, {0x0d,0xd0,0x43,0xe4,0x00,0xcd,0x00,0x33,0x40,0x4f,0x11,0x02,0xe4,0x04,0xc1,0x00 }},
+ {16, 0xc480, 0, {0x3d,0x40,0x0c,0x90,0x03,0xe4,0x00,0xed,0xa4,0x32,0x50,0x0f,0x90,0x03,0xe4,0x00 }},
+ {16, 0xc490, 0, {0xfd,0x00,0x3f,0x40,0x0f,0x90,0x03,0xc6,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc4a0, 0, {0x38,0x10,0xe2,0x08,0xd8,0x00,0x32,0x01,0x00,0x80,0x12,0xc0,0x00,0x48,0x00,0x36 }},
+ {16, 0xc4b0, 0, {0x80,0x0b,0x8a,0x02,0xe0,0x00,0xa8,0x00,0x2e,0x00,0x0f,0x80,0x02,0xe0,0x00,0x88 }},
+ {16, 0xc4c0, 0, {0x50,0x34,0x28,0x0b,0x80,0x02,0xe0,0x00,0xb8,0x00,0x2e,0x00,0x0b,0x80,0x02,0xce }},
+ {16, 0xc4d0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x80,0x81,0x00,0x26,0x40 }},
+ {16, 0xc4e0, 0, {0x09,0x18,0x02,0xc4,0x08,0x21,0x00,0x28,0x40,0x8b,0x10,0x02,0xc4,0x00,0xb1,0x01 }},
+ {16, 0xc4f0, 0, {0x2e,0x40,0x18,0x10,0x02,0xc4,0x00,0xa1,0x01,0x20,0x48,0x1b,0x10,0x02,0xc4,0x00 }},
+ {16, 0xc500, 0, {0xb1,0x00,0x6c,0x40,0x0b,0x10,0x12,0xc2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc510, 0, {0x18,0x11,0xa4,0x00,0x99,0x80,0xa2,0x42,0x48,0x90,0x02,0xe4,0x00,0xa9,0x2a,0x26 }},
+ {16, 0xc520, 0, {0x44,0x0b,0x90,0x82,0xc4,0x81,0xb9,0x00,0x2e,0x40,0x0b,0x90,0x42,0xc4,0x00,0x89 }},
+ {16, 0xc530, 0, {0x00,0x26,0x40,0x0b,0x90,0x02,0xe4,0x00,0xb9,0x01,0x2e,0x41,0x0b,0x90,0x02,0xc6 }},
+ {16, 0xc540, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xc5,0x20,0xc9,0x84,0x30,0x70 }},
+ {16, 0xc550, 0, {0x0d,0x90,0x13,0xe4,0x02,0xe9,0x00,0x32,0x70,0x0f,0x94,0x03,0xe4,0x00,0xf9,0x40 }},
+ {16, 0xc560, 0, {0x3c,0x48,0x0c,0x90,0x03,0xe4,0x00,0xe1,0x00,0x32,0x40,0x0f,0x90,0x01,0xe4,0x00 }},
+ {16, 0xc570, 0, {0xf9,0x90,0x3e,0x60,0x0f,0x90,0x26,0xe8,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc580, 0, {0x28,0x01,0xa5,0x00,0xf1,0x04,0x3a,0x44,0x8f,0x90,0x03,0xe4,0x10,0xc9,0x04,0x3e }},
+ {16, 0xc590, 0, {0x60,0x0f,0x90,0x03,0xe4,0x00,0xe9,0x20,0x3e,0x40,0x0f,0x90,0x03,0xe4,0x10,0xf9 }},
+ {16, 0xc5a0, 0, {0x90,0x3e,0x40,0x0f,0x90,0x03,0xe4,0x00,0xf9,0x80,0x3e,0x64,0x0f,0x90,0x07,0xca }},
+ {16, 0xc5b0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa1,0x00,0xc8,0x04,0x3a,0x00 }},
+ {16, 0xc5c0, 0, {0x1e,0x80,0x03,0x80,0x03,0xc8,0x40,0x2a,0x04,0x1f,0x80,0x03,0x20,0x00,0x88,0x00 }},
+ {16, 0xc5d0, 0, {0x32,0x30,0x0c,0x80,0x03,0x20,0x00,0xf8,0x00,0x3e,0x00,0x0c,0x80,0x03,0xe0,0x00 }},
+ {16, 0xc5e0, 0, {0xc8,0x80,0x3e,0x20,0x0f,0x80,0x03,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc5f0, 0, {0x28,0x05,0x38,0x00,0xae,0xd0,0x37,0x80,0x08,0xec,0x46,0x38,0x00,0xd6,0x04,0x23 }},
+ {16, 0xc600, 0, {0xa0,0x0b,0xa0,0x41,0x78,0x04,0xfa,0x00,0x37,0x80,0x0d,0xa0,0x02,0xa8,0x10,0xee }},
+ {16, 0xc610, 0, {0x21,0x2e,0x80,0x08,0xa0,0x02,0xe8,0x08,0x8e,0x80,0x2f,0xa0,0x8b,0xa0,0x02,0xca }},
+ {16, 0xc620, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x01,0x4c,0x02,0x83,0xc0,0xa8,0xe8 }},
+ {16, 0xc630, 0, {0x4a,0x36,0x02,0x8c,0x00,0x13,0xa0,0x28,0xc2,0x0b,0x30,0x06,0x0c,0x00,0xb3,0x00 }},
+ {16, 0xc640, 0, {0x24,0x84,0x09,0x30,0x02,0x0c,0x00,0xb3,0x20,0x28,0xc0,0x09,0x30,0x02,0xcc,0x00 }},
+ {16, 0xc650, 0, {0x83,0x80,0x2c,0xc0,0x0b,0x30,0x02,0xca,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc660, 0, {0xa0,0x01,0x3c,0x44,0xaf,0x40,0x25,0xc2,0x48,0xf8,0x82,0x1c,0xc8,0x9f,0x08,0x21 }},
+ {16, 0xc670, 0, {0xc0,0x8b,0xf8,0x02,0x5c,0x00,0xbf,0xb0,0x27,0x80,0x09,0x3a,0x02,0x9c,0x00,0xa5 }},
+ {16, 0xc680, 0, {0x02,0x2d,0xe8,0x09,0x70,0x02,0xce,0x80,0x85,0x08,0x2d,0xc2,0x0b,0x73,0x02,0xe8 }},
+ {16, 0xc690, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0x00,0xc7,0x82,0xa9,0xe0 }},
+ {16, 0xc6a0, 0, {0x0a,0x78,0x02,0x9e,0x40,0x97,0x84,0x39,0xa0,0x0b,0x7a,0x83,0x3f,0x80,0xd7,0x91 }},
+ {16, 0xc6b0, 0, {0x35,0xa0,0x0d,0x7a,0x09,0x1e,0x44,0xf7,0x80,0x3d,0xe8,0x2d,0x7a,0x03,0xde,0x82 }},
+ {16, 0xc6c0, 0, {0xc6,0x80,0x3d,0x20,0x4b,0x7b,0x23,0xea,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc6d0, 0, {0x08,0x1d,0xac,0x00,0xd3,0x00,0x3e,0xc1,0x0f,0x30,0x03,0xed,0x80,0xe3,0x00,0x3e }},
+ {16, 0xc6e0, 0, {0x80,0x0f,0xb6,0x21,0xec,0x08,0xdb,0x21,0x3e,0x80,0x0f,0xb5,0x03,0x6c,0x40,0xf9 }},
+ {16, 0xc6f0, 0, {0x00,0x3e,0xdc,0x0e,0xb2,0x03,0xed,0x40,0xf9,0x02,0x3e,0x80,0x0f,0xb0,0x03,0xc2 }},
+ {16, 0xc700, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xfe,0x00,0xcf,0x80,0x3d,0xe0 }},
+ {16, 0xc710, 0, {0x0f,0xc8,0x43,0xfe,0x00,0xfe,0x84,0x3f,0xe0,0x0d,0xf8,0xc3,0xff,0x10,0xaf,0x90 }},
+ {16, 0xc720, 0, {0x35,0xa0,0x0c,0xfc,0x03,0x3e,0x14,0xec,0x84,0x3f,0xf0,0x0e,0xfc,0xc3,0xff,0x08 }},
+ {16, 0xc730, 0, {0x4f,0x80,0x33,0xe4,0x0c,0xf8,0x03,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc740, 0, {0xa8,0x11,0x9c,0x00,0xd7,0xa2,0x2d,0xc4,0x0c,0x41,0xc2,0xdc,0x00,0x74,0x00,0x25 }},
+ {16, 0xc750, 0, {0x80,0x0f,0x72,0x42,0xdc,0x90,0xd7,0x38,0x2d,0x98,0x0a,0x70,0x02,0x1c,0x04,0x86 }},
+ {16, 0xc760, 0, {0x00,0x3f,0xc0,0x0d,0x70,0x02,0xcc,0x00,0x86,0x08,0x37,0xc6,0x28,0x70,0x02,0x2a }},
+ {16, 0xc770, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x00,0x87,0x60,0x2d,0xc2 }},
+ {16, 0xc780, 0, {0x0a,0x50,0x02,0xdc,0x00,0xb6,0x10,0x25,0xc2,0x09,0x70,0x86,0xdc,0x30,0x97,0x00 }},
+ {16, 0xc790, 0, {0x25,0x80,0x08,0x30,0x02,0x5c,0x00,0x87,0x08,0x2d,0xc0,0x08,0x70,0x02,0xcc,0x40 }},
+ {16, 0xc7a0, 0, {0x86,0x00,0x21,0x00,0x09,0x70,0x0a,0x00,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc7b0, 0, {0x20,0x14,0xed,0x80,0x93,0x00,0x0c,0xe1,0x28,0x18,0x02,0xcc,0x08,0xa0,0x00,0x24 }},
+ {16, 0xc7c0, 0, {0x12,0x1a,0x34,0x02,0xcf,0x04,0x93,0x40,0x2c,0x80,0x0a,0xb0,0x22,0x4c,0x02,0x81 }},
+ {16, 0xc7d0, 0, {0x80,0x28,0xe0,0x28,0x30,0x02,0xcc,0x00,0x88,0x82,0x24,0x20,0x08,0xb0,0x02,0x08 }},
+ {16, 0xc7e0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xbf,0x20,0xc9,0xe0,0x2c,0xf1 }},
+ {16, 0xc7f0, 0, {0x0e,0xbd,0x03,0xfc,0x00,0xb9,0x40,0x36,0x40,0x09,0xf5,0x02,0xfd,0x40,0xff,0x80 }},
+ {16, 0xc800, 0, {0x36,0xa2,0x08,0xf0,0x0b,0x7c,0x00,0xeb,0x80,0x2f,0xe0,0x0a,0xf0,0x43,0xfc,0x02 }},
+ {16, 0xc810, 0, {0x8b,0xd0,0x32,0xf0,0x0d,0xf0,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc820, 0, {0x80,0x00,0xec,0x10,0xfb,0x00,0x3e,0xc8,0x0f,0x94,0x13,0xec,0x00,0xf9,0x40,0x36 }},
+ {16, 0xc830, 0, {0x40,0x1f,0xb0,0x03,0xec,0x10,0xfb,0x01,0x3e,0xd0,0x0f,0xb0,0x03,0xac,0x00,0xf9 }},
+ {16, 0xc840, 0, {0x00,0x3e,0xc4,0x0f,0xb0,0x01,0xec,0x00,0xf9,0x04,0x3e,0x48,0x0f,0xb0,0x03,0xe0 }},
+ {16, 0xc850, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x00,0xdf,0x00,0x3f,0xc0 }},
+ {16, 0xc860, 0, {0x0c,0xe0,0x07,0xfc,0x00,0xfc,0x0a,0x27,0x00,0x4f,0xf0,0x03,0xfc,0x00,0xff,0x08 }},
+ {16, 0xc870, 0, {0x33,0x80,0x0c,0xf0,0x00,0x2c,0x00,0x5f,0x00,0x33,0xc0,0x0c,0xf0,0x01,0xfc,0x00 }},
+ {16, 0xc880, 0, {0xfe,0x00,0x23,0x40,0x0f,0xb0,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc890, 0, {0x81,0x04,0x6c,0x00,0x8b,0x86,0x2e,0xe0,0x48,0x8f,0x02,0xec,0x08,0xb8,0xa0,0x36 }},
+ {16, 0xc8a0, 0, {0x30,0x4b,0xb0,0x03,0xac,0x0c,0x9b,0x02,0x3c,0xa0,0x0c,0xb0,0x43,0x6c,0x00,0xb1 }},
+ {16, 0xc8b0, 0, {0x00,0x28,0xc0,0x0d,0xb0,0x12,0xec,0x10,0xb9,0x80,0xa2,0x61,0x0b,0xb0,0x02,0x20 }},
+ {16, 0xc8c0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0x9b,0x88,0x2e,0xe0 }},
+ {16, 0xc8d0, 0, {0x08,0xa0,0x02,0xec,0x01,0xbb,0x80,0x26,0x62,0x0b,0xb0,0x02,0xec,0x00,0xb3,0x01 }},
+ {16, 0xc8e0, 0, {0x2a,0x21,0x08,0xb0,0x12,0x2c,0x00,0xb8,0x00,0x22,0xc0,0x08,0xb0,0x12,0xec,0x14 }},
+ {16, 0xc8f0, 0, {0xb9,0x84,0x22,0xa2,0x0b,0xb0,0x02,0xa0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc900, 0, {0x08,0x04,0x0c,0x04,0x93,0x00,0x2c,0xe0,0x08,0x00,0x02,0xcc,0x09,0x91,0x00,0x20 }},
+ {16, 0xc910, 0, {0x40,0x0b,0x30,0x06,0x4c,0x04,0x13,0x00,0x26,0x00,0x08,0x30,0x02,0xcc,0x04,0xb2 }},
+ {16, 0xc920, 0, {0x00,0x2a,0xc0,0x01,0x30,0x00,0xcd,0x00,0xb0,0x00,0x20,0x80,0x0b,0x30,0x0a,0x02 }},
+ {16, 0xc930, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x6c,0x00,0xdb,0x24,0x6e,0xc0 }},
+ {16, 0xc940, 0, {0x2c,0xa0,0x02,0xfc,0x00,0xba,0x04,0x26,0x40,0x4f,0xf0,0x57,0xfc,0x00,0x3f,0x01 }},
+ {16, 0xc950, 0, {0x3a,0x00,0x2c,0xf0,0x01,0x3c,0x00,0xdb,0x00,0x33,0xc0,0x84,0xf0,0x03,0xfd,0x08 }},
+ {16, 0xc960, 0, {0xfa,0x00,0x32,0x00,0x0f,0xf0,0x03,0x00,0x01,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc970, 0, {0xa0,0x19,0xdc,0x00,0xea,0x40,0x3f,0x00,0x07,0xc0,0x03,0xfc,0x04,0xfc,0x00,0x3f }},
+ {16, 0xc980, 0, {0x40,0x0f,0xf0,0x03,0x9c,0x00,0xff,0x00,0x3f,0x00,0x0e,0xf0,0x03,0x7c,0x00,0xfd }},
+ {16, 0xc990, 0, {0x00,0x3f,0xc1,0x0f,0xf0,0x03,0xfc,0x84,0xf4,0x00,0x3f,0x00,0x0f,0xf0,0x03,0xe8 }},
+ {16, 0xc9a0, 0, {0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0xf0,0x80,0xff,0x00,0x03,0xc2 }},
+ {16, 0xc9b0, 0, {0x0f,0xc2,0x03,0x3e,0x00,0xdf,0xc0,0x3e,0xc0,0x4d,0xdb,0x02,0xb0,0xc0,0xdc,0x30 }},
+ {16, 0xc9c0, 0, {0x3f,0xe0,0x0f,0xdb,0x23,0xf6,0x20,0xff,0x26,0x33,0xe0,0x0f,0x52,0x03,0x5e,0x00 }},
+ {16, 0xc9d0, 0, {0xff,0x80,0x33,0xc0,0x4c,0x49,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc9e0, 0, {0x80,0x10,0xe1,0xe0,0xb7,0x08,0x23,0xf0,0x0b,0xad,0x0a,0x2e,0x00,0x9a,0x04,0x2e }},
+ {16, 0xc9f0, 0, {0xb0,0x09,0x8f,0x03,0xa0,0x40,0xb9,0x30,0x2e,0xa0,0x0b,0x9f,0x03,0xa7,0x00,0xbb }},
+ {16, 0xca00, 0, {0x80,0x26,0xe0,0x0b,0xdd,0x02,0x2e,0x00,0xbb,0x80,0x22,0xf4,0x0a,0x92,0x02,0xa0 }},
+ {16, 0xca10, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xc8,0x80,0xb3,0x10,0x24,0xc0 }},
+ {16, 0xca20, 0, {0x0b,0x80,0x02,0xac,0x00,0xa3,0x24,0x2c,0xd0,0x08,0x10,0x06,0xc0,0x80,0xb2,0x01 }},
+ {16, 0xca30, 0, {0x2c,0xea,0x4b,0x00,0x12,0xc2,0x04,0xb3,0x10,0x08,0xc0,0x0a,0x90,0x02,0x0c,0x00 }},
+ {16, 0xca40, 0, {0x93,0x04,0x24,0xc0,0x09,0x82,0x02,0xa2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xca50, 0, {0xc0,0x15,0xa5,0x00,0xbb,0x00,0x22,0xc0,0x0b,0x80,0x02,0xac,0x08,0xbb,0x18,0x2e }},
+ {16, 0xca60, 0, {0xe0,0x18,0x88,0x02,0xec,0x01,0xba,0x00,0x2e,0x80,0x0b,0x98,0x86,0xe2,0x00,0xbb }},
+ {16, 0xca70, 0, {0x00,0x22,0xc4,0x0b,0x90,0x02,0x6c,0x00,0xbb,0x00,0xa6,0xc0,0x0b,0x90,0x00,0xb0 }},
+ {16, 0xca80, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x11,0xe7,0x00,0xfb,0x00,0xb2,0xc0 }},
+ {16, 0xca90, 0, {0x0f,0xa8,0x03,0xac,0x02,0xeb,0x00,0x3e,0x60,0x0d,0x9e,0x03,0xec,0x00,0xd8,0x40 }},
+ {16, 0xcaa0, 0, {0x3e,0x40,0x0f,0x88,0x43,0xe2,0x00,0xfb,0x20,0x32,0xc0,0x0f,0x10,0x0b,0x6f,0x90 }},
+ {16, 0xcab0, 0, {0x5b,0x82,0x36,0xc0,0x2d,0x08,0x01,0x90,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcac0, 0, {0xe0,0x01,0xb7,0x08,0xf7,0x00,0x3f,0xc0,0x0f,0xf9,0x03,0x7c,0x08,0xcf,0x82,0x3c }},
+ {16, 0xcad0, 0, {0x00,0xaf,0xd0,0x21,0xbc,0x08,0xfd,0x10,0x3f,0x80,0x8f,0xc0,0x03,0xa4,0x00,0xf7 }},
+ {16, 0xcae0, 0, {0x01,0xbf,0xc0,0x07,0xd0,0x03,0xbd,0x30,0xff,0xa4,0x38,0xc0,0x0e,0xda,0x03,0xf8 }},
+ {16, 0xcaf0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xa8,0x00,0xfb,0x00,0xb2,0xc1 }},
+ {16, 0xcb00, 0, {0x0e,0x81,0x03,0xec,0x40,0xfb,0x44,0x3a,0xc1,0x0e,0x95,0x03,0xe0,0x00,0xcb,0x41 }},
+ {16, 0xcb10, 0, {0x32,0x4d,0x0f,0x81,0x03,0xe0,0x20,0xc9,0x00,0x72,0xe8,0x44,0x91,0x03,0x6d,0x00 }},
+ {16, 0xcb20, 0, {0xcb,0x02,0x3e,0xc0,0x0c,0x80,0x03,0x90,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcb30, 0, {0xc8,0x05,0x24,0x00,0xbf,0x00,0x33,0xc4,0x08,0x1d,0x03,0x8c,0x00,0xbb,0x98,0x36 }},
+ {16, 0xcb40, 0, {0x48,0x4d,0x98,0x22,0xed,0x40,0xdb,0x00,0x36,0xb0,0x0b,0x98,0x02,0xe3,0x00,0xdb }},
+ {16, 0xcb50, 0, {0x00,0x32,0xe0,0x88,0xd8,0x02,0x2c,0x02,0xc3,0x80,0x2f,0xc0,0x08,0x90,0x03,0x72 }},
+ {16, 0xcb60, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x01,0x44,0x00,0xb3,0x00,0x20,0xf0 }},
+ {16, 0xcb70, 0, {0x18,0x08,0x02,0x4f,0x84,0xb1,0xc0,0x24,0xc0,0x89,0x06,0x02,0xc4,0x00,0x91,0x00 }},
+ {16, 0xcb80, 0, {0x20,0xf0,0x1b,0x18,0x82,0xc6,0x00,0x93,0x00,0x2c,0xd1,0x08,0x1e,0x02,0x0e,0x44 }},
+ {16, 0xcb90, 0, {0x93,0x94,0x2c,0xc0,0x08,0x20,0x02,0xb8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcba0, 0, {0x20,0x01,0x1e,0x04,0xb7,0x80,0x20,0xe2,0x08,0x68,0x06,0x9e,0x80,0xbf,0x84,0x25 }},
+ {16, 0xcbb0, 0, {0xa8,0x09,0x68,0x02,0xc6,0x00,0x93,0xa0,0x65,0xe4,0x0b,0x78,0x12,0xde,0x00,0x93 }},
+ {16, 0xcbc0, 0, {0x00,0xa1,0xe0,0x08,0xd8,0x02,0x1e,0xd0,0xa7,0x80,0x2d,0xe0,0x08,0xf8,0x02,0x48 }},
+ {16, 0xcbd0, 0, {0x10,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x08,0x00,0xb3,0x20,0x30,0xc0 }},
+ {16, 0xcbe0, 0, {0x0a,0x22,0x02,0xce,0x40,0xf3,0xa0,0x3c,0xe8,0x0b,0x30,0x02,0xc1,0x00,0xd0,0xc1 }},
+ {16, 0xcbf0, 0, {0x30,0xc0,0x0b,0x21,0x13,0xcc,0x21,0xd3,0x00,0x2c,0xc0,0x2c,0x10,0x0b,0x0c,0x80 }},
+ {16, 0xcc00, 0, {0xd3,0x61,0x3c,0xc8,0x2c,0x20,0x03,0x92,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcc10, 0, {0x40,0x1d,0xbc,0x00,0xff,0x40,0x3b,0xc0,0x0f,0xe0,0x03,0xfc,0x00,0xf7,0x50,0x7f }},
+ {16, 0xcc20, 0, {0xc4,0x2e,0xf0,0x03,0xfc,0x40,0xfe,0x00,0x3f,0xc0,0x0f,0xf0,0x47,0xfc,0x00,0xff }},
+ {16, 0xcc30, 0, {0x00,0x7d,0xc2,0x0f,0xd0,0x01,0xbc,0x80,0x5f,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0xd0 }},
+ {16, 0xcc40, 0, {0x02,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xe4,0x00,0xfb,0xc0,0x32,0xc8 }},
+ {16, 0xcc50, 0, {0x0e,0xe0,0x03,0xac,0xa0,0xeb,0x20,0x32,0x40,0x8c,0xa0,0x13,0x2c,0x00,0xd9,0x00 }},
+ {16, 0xcc60, 0, {0x3e,0x60,0x0c,0xb0,0x03,0xe8,0x00,0xfa,0x80,0x30,0xc0,0x3c,0x92,0x03,0xef,0x60 }},
+ {16, 0xcc70, 0, {0xc3,0x20,0x31,0xc4,0x0c,0xa0,0x03,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcc80, 0, {0x48,0x11,0x9c,0x00,0x33,0x20,0x21,0xda,0x0b,0x70,0x43,0x9c,0x01,0xb5,0x00,0x21 }},
+ {16, 0xcc90, 0, {0x00,0x0a,0xe0,0x02,0x1c,0x00,0xb7,0x00,0x2f,0xc0,0x0d,0x70,0x03,0x9c,0x00,0xb6 }},
+ {16, 0xcca0, 0, {0x00,0x31,0xc8,0x08,0x57,0x02,0xdc,0x00,0x87,0x50,0x21,0xc0,0x0a,0x70,0x42,0x92 }},
+ {16, 0xccb0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9a,0x11,0xb7,0x90,0x21,0xe0 }},
+ {16, 0xccc0, 0, {0x0b,0x68,0x82,0xde,0x08,0xa7,0x80,0x24,0x60,0x08,0x70,0x12,0x12,0x08,0x95,0x80 }},
+ {16, 0xccd0, 0, {0x2d,0x60,0x09,0x6c,0x02,0xde,0x00,0xb1,0x80,0x23,0xe0,0x0a,0x58,0x62,0xfe,0x00 }},
+ {16, 0xcce0, 0, {0x97,0xa0,0x21,0xe8,0x09,0xe8,0x02,0x30,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xccf0, 0, {0x48,0x14,0xcd,0x00,0xb3,0x00,0x20,0xc0,0x8b,0x3c,0x02,0x8c,0x00,0xbb,0x00,0x24 }},
+ {16, 0xcd00, 0, {0xc4,0x1a,0x3d,0x02,0x2f,0x88,0xb3,0x48,0x2c,0xe0,0x89,0x3e,0x02,0x8d,0x80,0x93 }},
+ {16, 0xcd10, 0, {0xd9,0xa4,0x40,0x88,0x10,0x02,0xcc,0x04,0x93,0xc8,0x20,0xc0,0x0b,0x30,0x02,0x92 }},
+ {16, 0xcd20, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xb9,0x40,0xfa,0x00,0xb2,0x80 }},
+ {16, 0xcd30, 0, {0x0f,0xe0,0x03,0xe8,0x00,0xea,0x80,0x37,0xa0,0x0c,0xe8,0x13,0x3b,0x08,0xde,0x01 }},
+ {16, 0xcd40, 0, {0x3f,0x82,0x0c,0xe0,0x43,0xfa,0x80,0xfe,0x80,0x31,0x28,0x0c,0xa0,0x03,0xf0,0x02 }},
+ {16, 0xcd50, 0, {0xc4,0xc0,0xb2,0x80,0x0d,0xe0,0x03,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcd60, 0, {0x48,0x00,0xe0,0x00,0xf8,0x00,0x3e,0x10,0x0b,0x80,0x83,0xe0,0x00,0xf8,0x30,0x3a }},
+ {16, 0xcd70, 0, {0x00,0x6d,0x80,0x83,0xe1,0x44,0xb8,0x04,0x3e,0x10,0x0f,0x80,0x13,0xe0,0x00,0xf8 }},
+ {16, 0xcd80, 0, {0x00,0x3a,0x10,0x4f,0x04,0x03,0xe3,0x00,0xe8,0x10,0x3e,0x00,0x0e,0x80,0x03,0xd2 }},
+ {16, 0xcd90, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xc9,0x00,0x38,0x40 }},
+ {16, 0xcda0, 0, {0x0f,0x1a,0x03,0x2e,0x00,0xfb,0xa0,0x36,0x60,0x0c,0x98,0x03,0xe6,0x04,0xd1,0x00 }},
+ {16, 0xcdb0, 0, {0x36,0x48,0x0e,0x91,0x02,0xe6,0x00,0xf9,0x00,0x3e,0x00,0x0c,0x99,0x03,0x62,0x40 }},
+ {16, 0xcdc0, 0, {0xf8,0x00,0xa0,0x68,0x0c,0x90,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcdd0, 0, {0x80,0x04,0x64,0x02,0x89,0x04,0x2e,0x64,0x88,0x94,0x02,0xa5,0x00,0xb9,0x80,0x20 }},
+ {16, 0xcde0, 0, {0x64,0x0d,0x9c,0x02,0xe6,0x42,0x89,0x00,0x22,0x60,0x0b,0x9c,0x02,0xe4,0x10,0xb9 }},
+ {16, 0xcdf0, 0, {0x40,0x3a,0x50,0x08,0x9c,0x02,0x27,0x20,0xb9,0x00,0x22,0x40,0x08,0x10,0x03,0x60 }},
+ {16, 0xce00, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x04,0x00,0x89,0x00,0x22,0x40 }},
+ {16, 0xce10, 0, {0x0a,0x90,0x82,0x25,0x4c,0xb9,0x00,0x02,0x40,0x08,0x96,0x02,0xe4,0x10,0x89,0x00 }},
+ {16, 0xce20, 0, {0x26,0x50,0x13,0x94,0x02,0xe4,0x40,0xb9,0x08,0x2e,0x40,0x08,0x90,0x8a,0x24,0x00 }},
+ {16, 0xce30, 0, {0xb9,0x01,0x2a,0x40,0x08,0x90,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xce40, 0, {0x08,0x04,0x05,0x80,0x81,0x40,0x2c,0xc8,0x08,0x10,0x06,0x84,0x00,0xb1,0x04,0x20 }},
+ {16, 0xce50, 0, {0x49,0x09,0x14,0x42,0xcc,0x89,0x81,0x20,0x20,0x50,0x0b,0x14,0x46,0xc4,0x00,0xb1 }},
+ {16, 0xce60, 0, {0x00,0x2a,0xc0,0x28,0x14,0x02,0x01,0x01,0xb0,0x04,0x28,0x40,0x38,0x94,0x02,0x42 }},
+ {16, 0xce70, 0, {0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0x88,0x00,0x3a,0x00 }},
+ {16, 0xce80, 0, {0x0e,0x80,0x23,0x20,0x00,0xf8,0x50,0xb2,0x00,0x0c,0x80,0x12,0xe1,0x40,0xd8,0x50 }},
+ {16, 0xce90, 0, {0x36,0x00,0x0e,0x80,0x03,0xe0,0x00,0xf8,0x00,0x2e,0x00,0x0c,0x80,0x53,0x60,0x04 }},
+ {16, 0xcea0, 0, {0xf8,0x00,0x3a,0x00,0x0c,0x80,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xceb0, 0, {0x98,0x1d,0xf4,0x40,0xf9,0x44,0x3e,0x44,0x0f,0xd4,0x03,0xe4,0x00,0xf1,0x00,0x3f }},
+ {16, 0xcec0, 0, {0x44,0x0f,0xd4,0x53,0xf4,0x44,0xfd,0x10,0x2f,0x40,0x0f,0xf4,0x03,0xfd,0x00,0xfd }},
+ {16, 0xced0, 0, {0x40,0x3b,0x10,0x0f,0xd4,0x23,0xd1,0x04,0x7c,0x43,0x36,0x50,0x0f,0x50,0x03,0xe6 }},
+ {16, 0xcee0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xa6,0x00,0xf9,0x10,0x2e,0x62 }},
+ {16, 0xcef0, 0, {0x0f,0xd2,0x83,0xe4,0x00,0xbd,0x42,0x3e,0x61,0x0f,0xd0,0x03,0xf6,0xc0,0xc9,0xa2 }},
+ {16, 0xcf00, 0, {0x2b,0x40,0x0c,0xd0,0x03,0x34,0x00,0xf9,0x81,0x3e,0x68,0x08,0xc1,0x43,0xfa,0x00 }},
+ {16, 0xcf10, 0, {0xf5,0x80,0x3f,0x62,0x0c,0x14,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcf20, 0, {0x38,0x10,0xe1,0x20,0x88,0x11,0x2e,0x10,0x0b,0x80,0x02,0xe0,0x00,0xb8,0x82,0x2e }},
+ {16, 0xcf30, 0, {0x10,0x0b,0x80,0x00,0xe3,0xc4,0x88,0xf0,0x22,0x00,0x0b,0x80,0x0a,0x20,0x00,0xe8 }},
+ {16, 0xcf40, 0, {0x40,0x2f,0x14,0x08,0x88,0x02,0xe2,0x00,0xb8,0x00,0x2e,0x00,0x08,0x88,0x02,0x8e }},
+ {16, 0xcf50, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x04,0xc5,0x00,0xa1,0x00,0x2c,0x40 }},
+ {16, 0xcf60, 0, {0x0b,0x10,0x02,0xc4,0x18,0xb1,0x22,0x6c,0xd1,0x0b,0x10,0x26,0xc4,0x00,0x81,0x08 }},
+ {16, 0xcf70, 0, {0x2a,0x40,0x88,0x10,0x02,0x04,0x04,0xb5,0xc0,0x0f,0x40,0x0b,0x02,0x02,0x41,0xa0 }},
+ {16, 0xcf80, 0, {0xb1,0x40,0x2c,0x40,0x08,0x12,0x02,0x02,0x11,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcf90, 0, {0x18,0x15,0xa4,0x00,0x89,0x06,0x2e,0x40,0x0b,0x90,0x12,0xe4,0x00,0xb9,0x40,0x2e }},
+ {16, 0xcfa0, 0, {0x40,0x0b,0xb0,0x82,0xc4,0x02,0x89,0x44,0x22,0x40,0x0a,0x90,0x02,0x24,0x00,0xa9 }},
+ {16, 0xcfb0, 0, {0x00,0x27,0x48,0x09,0xb0,0x12,0xec,0x18,0xb9,0x01,0x2e,0x40,0x40,0x90,0x02,0x86 }},
+ {16, 0xcfc0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe7,0x84,0xe9,0x01,0x3e,0x40 }},
+ {16, 0xcfd0, 0, {0x0f,0x90,0x03,0xe4,0x00,0xf9,0x00,0x3e,0x72,0x0f,0x90,0x03,0xe7,0x60,0x89,0x10 }},
+ {16, 0xcfe0, 0, {0x3a,0x40,0x0c,0x90,0x03,0x24,0x00,0xf9,0x44,0x3c,0x40,0x2d,0x90,0x03,0xe7,0x60 }},
+ {16, 0xcff0, 0, {0xf9,0x71,0x3e,0x40,0x28,0x90,0x03,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd000, 0, {0x28,0x01,0xa4,0x48,0xa9,0x00,0x3e,0xc0,0x0f,0x9a,0x43,0xec,0x00,0xf9,0x20,0x7e }},
+ {16, 0xd010, 0, {0xc8,0x0f,0x9a,0x07,0x66,0x00,0x79,0x80,0x7e,0x40,0x0f,0x1c,0x03,0xe7,0x00,0xe9 }},
+ {16, 0xd020, 0, {0xa0,0x3e,0x40,0x46,0x80,0x03,0xe0,0x20,0xf9,0x00,0x3c,0x40,0x0f,0x90,0x03,0xca }},
+ {16, 0xd030, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0x80,0x00,0xf8,0x00,0x3a,0x00 }},
+ {16, 0xd040, 0, {0x0f,0x80,0x03,0xa0,0x08,0xe8,0x40,0x3a,0x10,0x0c,0x83,0x03,0xa1,0xc0,0xf0,0x40 }},
+ {16, 0xd050, 0, {0x3e,0x06,0x0f,0x84,0x03,0xe1,0x00,0xf8,0x00,0x3b,0x00,0x0f,0x81,0x03,0x20,0x00 }},
+ {16, 0xd060, 0, {0xf8,0x10,0xb2,0x00,0x4c,0x80,0x0b,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd070, 0, {0x28,0x05,0x28,0x00,0xba,0x00,0x2e,0xb0,0x0b,0xe8,0x02,0xe9,0x00,0x3e,0x90,0x02 }},
+ {16, 0xd080, 0, {0x81,0x08,0xe4,0x12,0x78,0x00,0xba,0x00,0x2d,0xb0,0x89,0xe8,0x22,0xf8,0x0c,0xba }},
+ {16, 0xd090, 0, {0x00,0x6e,0x80,0x03,0xc5,0x03,0x30,0x00,0xba,0x00,0x22,0xa8,0x08,0xa0,0x22,0x8a }},
+ {16, 0xd0a0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0xb3,0x00,0x28,0xe8 }},
+ {16, 0xd0b0, 0, {0x1b,0x31,0x12,0x8c,0xc4,0xa3,0x92,0x2c,0x40,0x88,0x34,0x06,0x8e,0x00,0x93,0x00 }},
+ {16, 0xd0c0, 0, {0x2c,0xf0,0x19,0x31,0xa2,0xcc,0x04,0xb3,0x00,0x28,0x80,0x01,0x38,0x02,0x4c,0x00 }},
+ {16, 0xd0d0, 0, {0xb3,0x80,0x20,0xe0,0x0a,0xb0,0x12,0x02,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd0e0, 0, {0xa0,0x01,0x1c,0x00,0xb7,0x14,0x2d,0x42,0x0b,0x60,0x02,0xdc,0x00,0xb7,0x81,0x27 }},
+ {16, 0xd0f0, 0, {0xe0,0x18,0x60,0x02,0x58,0x18,0xb7,0x22,0x2d,0x80,0x09,0x70,0x22,0xdc,0x00,0xb7 }},
+ {16, 0xd100, 0, {0x00,0x2d,0x80,0x0b,0x3b,0x02,0x1d,0xd0,0xbf,0x80,0x28,0xc0,0x8a,0xf2,0x02,0xa0 }},
+ {16, 0xd110, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1f,0x80,0xf7,0xa0,0x39,0xe2 }},
+ {16, 0xd120, 0, {0x0f,0x68,0x03,0x9e,0x00,0xed,0x84,0x3d,0xe2,0x44,0x78,0x03,0x9e,0x00,0xf7,0xb4 }},
+ {16, 0xd130, 0, {0x2d,0xe0,0x0d,0x68,0x03,0xd6,0x00,0xf6,0x80,0x39,0xe0,0x0f,0x79,0x03,0x5e,0x90 }},
+ {16, 0xd140, 0, {0xf7,0x81,0x31,0x60,0x2e,0x7c,0x03,0x2a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd150, 0, {0x08,0x1d,0xad,0x00,0xfb,0x42,0x3e,0xc8,0x0f,0xa0,0x03,0xed,0xa0,0xbb,0x00,0x38 }},
+ {16, 0xd160, 0, {0xc8,0x0f,0xb0,0x03,0x68,0x00,0xfb,0x11,0x3e,0x40,0x09,0xb0,0x41,0xec,0x00,0xfa }},
+ {16, 0xd170, 0, {0x02,0x3e,0xc0,0x0f,0xb2,0x0b,0xed,0x80,0x3b,0x00,0x36,0x40,0x0d,0xb0,0x23,0x42 }},
+ {16, 0xd180, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xff,0x00,0xcf,0xd0,0x33,0xe4 }},
+ {16, 0xd190, 0, {0x4f,0xf9,0x03,0xde,0x40,0xdc,0x80,0x36,0xe4,0x0c,0xb9,0x13,0xfe,0x00,0xcf,0x90 }},
+ {16, 0xd1a0, 0, {0x37,0xe5,0x0f,0xf8,0x43,0xfe,0x00,0xcf,0x92,0x3f,0xa4,0x0f,0x78,0x03,0x1f,0x00 }},
+ {16, 0xd1b0, 0, {0xc5,0x80,0x33,0x60,0x0c,0xf8,0x20,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd1c0, 0, {0xa8,0x11,0xbc,0x00,0x0f,0x10,0x21,0x81,0x0b,0x60,0x03,0x84,0x00,0x8b,0x08,0x21 }},
+ {16, 0xd1d0, 0, {0x60,0x0a,0x7b,0x03,0x98,0x00,0x8b,0x10,0x29,0x84,0x0e,0x64,0x22,0xdc,0x40,0xd7 }},
+ {16, 0xd1e0, 0, {0x02,0x2d,0x84,0x0b,0x70,0x02,0x1c,0x00,0x85,0x18,0x21,0x40,0x0a,0xf0,0x22,0xaa }},
+ {16, 0xd1f0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x00,0xa7,0x14,0x69,0xc0 }},
+ {16, 0xd200, 0, {0x1a,0x60,0x12,0xfc,0x01,0xa4,0x10,0x2d,0xc0,0x0a,0x52,0x02,0x45,0x40,0x87,0x0c }},
+ {16, 0xd210, 0, {0x21,0x80,0x1b,0x60,0x82,0xd4,0x00,0x86,0x03,0x25,0xe0,0x1b,0x70,0x02,0x5c,0x40 }},
+ {16, 0xd220, 0, {0x9d,0x00,0x29,0x40,0x08,0x70,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd230, 0, {0x20,0x14,0xcd,0x00,0xa3,0x00,0x28,0xc0,0x1b,0x20,0x22,0x8c,0x11,0xa3,0x00,0x68 }},
+ {16, 0xd240, 0, {0xf6,0x0a,0x3c,0x06,0x82,0x00,0x83,0x80,0x28,0x84,0x0a,0x8c,0x82,0xcc,0x44,0x92 }},
+ {16, 0xd250, 0, {0x00,0x2c,0xc0,0x0b,0x30,0x02,0x4e,0x00,0x91,0x00,0x28,0x40,0x0a,0x30,0x02,0x88 }},
+ {16, 0xd260, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xbe,0x22,0xef,0x04,0xba,0xc0 }},
+ {16, 0xd270, 0, {0x0f,0x14,0x93,0xec,0x02,0xf1,0xc3,0x3e,0xf0,0x0e,0x90,0x83,0x66,0x00,0xcf,0xd2 }},
+ {16, 0xd280, 0, {0x32,0x50,0x0f,0x9c,0x03,0xcb,0x00,0xc9,0x80,0x3e,0x28,0x0f,0xb0,0x03,0x4f,0x00 }},
+ {16, 0xd290, 0, {0xd1,0xc0,0xaa,0xc0,0x0c,0x71,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd2a0, 0, {0x80,0x00,0xec,0x20,0xdb,0x00,0x26,0x80,0x0f,0xa0,0x03,0xec,0x08,0x1b,0x00,0x36 }},
+ {16, 0xd2b0, 0, {0xc0,0x0f,0x86,0x01,0xe5,0x40,0xfb,0x02,0x3a,0x48,0x0e,0x94,0x03,0xec,0x80,0xf1 }},
+ {16, 0xd2c0, 0, {0x84,0x3e,0x00,0x4f,0xb0,0x03,0xad,0xc0,0xeb,0x20,0x36,0xc0,0x0f,0xb0,0x23,0xe0 }},
+ {16, 0xd2d0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xdc,0x00,0xcf,0x00,0x3f,0x60 }},
+ {16, 0xd2e0, 0, {0x0c,0xe0,0x83,0x3e,0x80,0xed,0x08,0x33,0xd0,0x8f,0x50,0x03,0x9e,0x00,0xdf,0x00 }},
+ {16, 0xd2f0, 0, {0x33,0x40,0x0c,0xc0,0x03,0x30,0x00,0xcc,0x10,0x33,0x68,0x0c,0xf0,0x03,0x3c,0x84 }},
+ {16, 0xd300, 0, {0x8d,0x90,0x30,0x40,0x0c,0xf0,0x03,0x08,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd310, 0, {0x81,0x04,0x6c,0x00,0x8b,0x02,0x2c,0xf4,0x08,0xa8,0x62,0x0c,0x80,0x8b,0x80,0x2a }},
+ {16, 0xd320, 0, {0x60,0x0f,0x9c,0x02,0x2e,0x00,0x8b,0x00,0x20,0x60,0x0d,0x98,0x02,0x2c,0x80,0xd8 }},
+ {16, 0xd330, 0, {0x00,0x14,0x40,0x08,0x34,0x12,0x2e,0x00,0x8b,0x82,0x32,0x40,0x0d,0xb0,0x03,0x60 }},
+ {16, 0xd340, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0x8b,0x00,0x2e,0xd0 }},
+ {16, 0xd350, 0, {0x08,0xb8,0x02,0x2c,0x00,0x8a,0x84,0x22,0xc0,0x0b,0x88,0x02,0xe4,0xa0,0x83,0x00 }},
+ {16, 0xd360, 0, {0x22,0x62,0x0a,0x98,0x02,0x28,0x00,0x89,0x00,0x22,0x00,0x0a,0xb1,0x06,0x2c,0x00 }},
+ {16, 0xd370, 0, {0xab,0x00,0x22,0x40,0x08,0xb0,0x02,0x60,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd380, 0, {0x08,0x04,0x0c,0x02,0xa3,0x00,0x2c,0xc1,0x08,0x20,0x02,0x0c,0x02,0x8b,0x00,0x28 }},
+ {16, 0xd390, 0, {0xc2,0x0a,0x00,0x02,0x44,0x10,0x83,0x10,0x22,0x40,0x0b,0x10,0x06,0x0c,0x00,0x91 }},
+ {16, 0xd3a0, 0, {0x04,0xaa,0x00,0x28,0x30,0x02,0x2c,0x00,0xa1,0x01,0x20,0x40,0x09,0xb0,0x02,0x42 }},
+ {16, 0xd3b0, 0, {0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x7c,0x00,0x8f,0x00,0x3e,0xc0 }},
+ {16, 0xd3c0, 0, {0x2c,0xa0,0x03,0x29,0x40,0xa8,0x40,0x32,0xcc,0x8b,0x80,0x02,0xe0,0x00,0xcf,0x40 }},
+ {16, 0xd3d0, 0, {0x32,0x00,0x0e,0x80,0x0a,0x20,0x00,0x88,0x00,0x22,0x40,0x0c,0xb0,0x03,0x2c,0x04 }},
+ {16, 0xd3e0, 0, {0xeb,0x00,0xb2,0x40,0x8c,0xb0,0x03,0x40,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd3f0, 0, {0xa0,0x1d,0xfc,0x00,0xdf,0x00,0x3f,0x40,0x0f,0xe0,0x03,0xfc,0x80,0xff,0x28,0x3d }},
+ {16, 0xd400, 0, {0xc0,0x0b,0xc1,0x03,0xb0,0x14,0xff,0x00,0x3f,0x00,0x0d,0xd0,0x03,0xdc,0x00,0xfc }},
+ {16, 0xd410, 0, {0x00,0x37,0x40,0x0f,0xf0,0x21,0xfc,0x00,0x1d,0x00,0x7b,0x40,0x8f,0xf0,0x03,0xe0 }},
+ {16, 0xd420, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xd2,0x00,0xdf,0x00,0x31,0xa0 }},
+ {16, 0xd430, 0, {0x4d,0xf0,0x43,0x32,0x00,0xce,0x14,0x1b,0x68,0x0e,0xda,0x23,0xb2,0xc0,0x2f,0x00 }},
+ {16, 0xd440, 0, {0x3f,0xc2,0x2c,0xe8,0x03,0x3c,0x40,0xfd,0x08,0x3b,0xc8,0x4c,0xf0,0x83,0x3c,0xa0 }},
+ {16, 0xd450, 0, {0xcf,0x00,0x33,0xc4,0x0c,0xf3,0x07,0xf0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd460, 0, {0x80,0x10,0xe2,0x00,0x8f,0xc0,0x22,0xa0,0x08,0xfd,0x42,0x2f,0x00,0x8b,0x70,0x22 }},
+ {16, 0xd470, 0, {0x1e,0x48,0x89,0x02,0x27,0xc0,0x8f,0x5a,0x2e,0x50,0x48,0x30,0x02,0xbd,0xc0,0xbd }},
+ {16, 0xd480, 0, {0x40,0x23,0xc5,0x48,0xf4,0x82,0x3d,0x2c,0x87,0x70,0x22,0xc0,0x08,0xf1,0x03,0xe0 }},
+ {16, 0xd490, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xe0,0x00,0x93,0x10,0x26,0x81 }},
+ {16, 0xd4a0, 0, {0x49,0x30,0x02,0x80,0x40,0x83,0x20,0x28,0x40,0x0a,0x10,0x02,0x80,0x00,0xa3,0x24 }},
+ {16, 0xd4b0, 0, {0x2c,0xca,0x08,0x32,0x82,0x0c,0x00,0x91,0x28,0x20,0xca,0x1b,0x32,0x02,0x0c,0x88 }},
+ {16, 0xd4c0, 0, {0x83,0x09,0x20,0xc8,0x09,0x32,0x02,0xe2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd4d0, 0, {0xc0,0x15,0xa3,0x14,0x8b,0x04,0x26,0x89,0x08,0xb0,0x02,0xac,0x22,0x8b,0x88,0x2a }},
+ {16, 0xd4e0, 0, {0x20,0x08,0x98,0x82,0xa6,0x10,0xab,0x00,0x2e,0xca,0x08,0xb0,0x82,0xac,0x00,0xb9 }},
+ {16, 0xd4f0, 0, {0x00,0x22,0xc0,0x29,0xb0,0x0a,0x2c,0x01,0x8b,0x00,0x22,0xc0,0x09,0xb0,0x22,0xf0 }},
+ {16, 0xd500, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xe3,0x00,0xdb,0x00,0x34,0xe2 }},
+ {16, 0xd510, 0, {0x0d,0xb0,0x03,0xa3,0x00,0xca,0x80,0xba,0x70,0x0e,0x88,0x03,0xa6,0x00,0xeb,0x00 }},
+ {16, 0xd520, 0, {0x3e,0x90,0x0c,0xb5,0x03,0x2c,0x00,0xfb,0x10,0xba,0xc0,0x0e,0xb0,0x03,0x2c,0x02 }},
+ {16, 0xd530, 0, {0xcb,0x02,0x32,0xc0,0x09,0xb0,0x02,0xd0,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd540, 0, {0xe0,0x01,0xb0,0x08,0xff,0x00,0xbb,0xe0,0x0f,0x70,0x03,0x65,0x00,0xf4,0x00,0x35 }},
+ {16, 0xd550, 0, {0x40,0x0f,0x40,0x03,0x54,0x00,0xdf,0x00,0x3e,0x40,0x0f,0xf8,0x03,0xec,0x00,0xf7 }},
+ {16, 0xd560, 0, {0x01,0x3d,0xc1,0x0e,0x30,0x03,0xec,0x00,0xff,0x00,0x3f,0xc0,0x8e,0xf0,0x03,0xb8 }},
+ {16, 0xd570, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xa0,0x40,0xeb,0x08,0x3e,0x80 }},
+ {16, 0xd580, 0, {0x0d,0xb0,0x03,0xe0,0x00,0xc8,0x00,0x3a,0x51,0x0f,0x82,0x03,0x64,0x20,0xdb,0x00 }},
+ {16, 0xd590, 0, {0x3d,0x82,0x0c,0xbc,0x03,0x2c,0x10,0xdb,0x00,0x72,0xc0,0x0d,0xb1,0x03,0x0c,0x20 }},
+ {16, 0xd5a0, 0, {0xd3,0x00,0x32,0xc0,0x0f,0xb0,0x0b,0x50,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd5b0, 0, {0xc8,0x05,0x01,0x00,0x87,0xc0,0x2e,0xa8,0x08,0xf1,0x12,0xc5,0x40,0x88,0x00,0x22 }},
+ {16, 0xd5c0, 0, {0x40,0x0b,0x84,0x02,0x27,0x00,0xaf,0x00,0x2e,0xc0,0x08,0xbc,0x12,0x3c,0x00,0x8b }},
+ {16, 0xd5d0, 0, {0x01,0x23,0xc0,0x28,0xf5,0x4a,0x3d,0x28,0xdf,0x00,0x33,0xc0,0x4b,0xf0,0x03,0x32 }},
+ {16, 0xd5e0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x48,0x80,0xa3,0x90,0x2c,0x00 }},
+ {16, 0xd5f0, 0, {0x08,0x30,0x02,0xc1,0x00,0x92,0x04,0x28,0x00,0x0b,0x14,0x12,0x43,0x00,0xb3,0x04 }},
+ {16, 0xd600, 0, {0x2c,0x30,0x0a,0xb0,0x0a,0x8c,0x00,0x93,0x00,0x60,0xc0,0x08,0x3c,0x06,0x0e,0x01 }},
+ {16, 0xd610, 0, {0xb3,0x00,0x2e,0xc0,0x8b,0x30,0x06,0x38,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd620, 0, {0x20,0x01,0x12,0x00,0x87,0x80,0x2d,0x24,0x08,0x78,0x02,0xd2,0x00,0x95,0x80,0x21 }},
+ {16, 0xd630, 0, {0xa0,0x0b,0x68,0x02,0x5a,0x20,0x87,0x80,0x2d,0x66,0x1a,0x7c,0x02,0x9e,0x00,0x87 }},
+ {16, 0xd640, 0, {0x80,0x21,0xe1,0x18,0x79,0x02,0x9e,0x40,0xb7,0x80,0xa1,0xe0,0x0b,0x78,0x02,0x48 }},
+ {16, 0xd650, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x00,0x00,0xe3,0xa0,0x3c,0x40 }},
+ {16, 0xd660, 0, {0x0c,0x30,0x03,0xc4,0x22,0xd9,0x00,0x38,0xd4,0x0f,0x30,0x83,0x68,0x40,0xf3,0x00 }},
+ {16, 0xd670, 0, {0x3c,0x80,0x0a,0x32,0x02,0x8c,0x00,0xdb,0x00,0xa2,0xc4,0x0c,0x30,0x03,0x0c,0x00 }},
+ {16, 0xd680, 0, {0xf3,0x00,0x3c,0xc0,0x0f,0xb1,0x03,0x12,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd690, 0, {0x40,0x0d,0xb0,0x00,0xff,0x10,0x3f,0x40,0x0e,0xf0,0x03,0xfc,0x00,0xed,0x00,0x3f }},
+ {16, 0xd6a0, 0, {0xc0,0x0f,0x30,0x13,0xbc,0x40,0x7f,0x10,0x3f,0xc1,0x2d,0xf0,0x03,0x7c,0x00,0xfb }},
+ {16, 0xd6b0, 0, {0x40,0x3f,0xc2,0x0e,0xf4,0x83,0x7c,0x00,0xdf,0x00,0x3f,0xc2,0x0f,0xf0,0x03,0x90 }},
+ {16, 0xd6c0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x00,0xdb,0xa0,0x32,0xc0 }},
+ {16, 0xd6d0, 0, {0x0d,0xb7,0x03,0xe0,0x00,0xca,0x04,0x3e,0x80,0x0f,0xb8,0x03,0x2c,0x10,0xfb,0x00 }},
+ {16, 0xd6e0, 0, {0x33,0x00,0x8d,0xb0,0x03,0x2c,0x80,0xe9,0x40,0x3e,0xd2,0x0f,0xb4,0x03,0x2d,0x80 }},
+ {16, 0xd6f0, 0, {0xeb,0x20,0xb2,0xc0,0x0f,0xb2,0x03,0xea,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd700, 0, {0x48,0x11,0x90,0x00,0xb7,0x10,0x11,0xc0,0x08,0x70,0x82,0xd8,0x0a,0x87,0x01,0x2d }},
+ {16, 0xd710, 0, {0x80,0x89,0x70,0x03,0xd8,0x08,0xb7,0x0a,0x21,0x40,0x2c,0x70,0x02,0x0d,0xc0,0x85 }},
+ {16, 0xd720, 0, {0x01,0x79,0xc8,0x0b,0x32,0x02,0x0d,0x20,0x8f,0x28,0x21,0xc0,0x0b,0x72,0x82,0xd2 }},
+ {16, 0xd730, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x40,0x96,0x10,0x97,0x90,0x23,0xe0 }},
+ {16, 0xd740, 0, {0x09,0x7a,0x02,0xd6,0x00,0x97,0x80,0x2d,0xf0,0x0b,0x78,0x82,0x1e,0x00,0xb3,0xb0 }},
+ {16, 0xd750, 0, {0x21,0xa0,0x08,0x78,0x02,0x1e,0x00,0xa5,0x80,0x2d,0xe0,0x0b,0x7a,0x02,0x1e,0x80 }},
+ {16, 0xd760, 0, {0xa7,0xb0,0x21,0xe8,0x0b,0x79,0x02,0xf0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd770, 0, {0x48,0x14,0xc0,0x00,0xb3,0x00,0x20,0xe2,0x08,0x30,0x02,0xc6,0x40,0x93,0x70,0x2c }},
+ {16, 0xd780, 0, {0xc0,0x09,0x3c,0x02,0x8e,0x00,0xb3,0x00,0x20,0xd8,0x08,0x18,0x02,0x0c,0x00,0x81 }},
+ {16, 0xd790, 0, {0x90,0x2e,0xc0,0x0b,0x30,0x2a,0x2c,0x10,0x83,0x00,0xa0,0xc0,0x0b,0x30,0x02,0xd2 }},
+ {16, 0xd7a0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x11,0xb9,0x00,0xda,0x02,0x33,0xb8 }},
+ {16, 0xd7b0, 0, {0x0d,0xa0,0x03,0xf8,0x00,0xde,0xc0,0x3f,0xb0,0x4f,0xec,0x06,0x38,0x40,0xfa,0x00 }},
+ {16, 0xd7c0, 0, {0xb3,0x90,0x0c,0x6c,0x0b,0x28,0x08,0xea,0x01,0x7e,0x80,0x0f,0xa0,0x03,0x28,0x00 }},
+ {16, 0xd7d0, 0, {0xea,0x00,0x32,0x80,0x0f,0xa0,0x03,0xfa,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd7e0, 0, {0x48,0x00,0xe0,0x00,0xf8,0x40,0x3a,0x00,0x0f,0x84,0x03,0xe1,0x00,0xe8,0x02,0x3e }},
+ {16, 0xd7f0, 0, {0x00,0x0f,0x84,0x03,0xe1,0x40,0xf8,0x00,0x3e,0x00,0x0f,0x81,0x03,0xe0,0x00,0xf8 }},
+ {16, 0xd800, 0, {0x00,0x3a,0x00,0x0f,0x80,0x03,0xe0,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x80,0x03,0xd2 }},
+ {16, 0xd810, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x20,0xf9,0xc0,0x3e,0x70 }},
+ {16, 0xd820, 0, {0x0e,0x90,0x02,0xe4,0x80,0xc9,0x00,0x32,0x42,0x0c,0x98,0x83,0xa4,0x84,0xf9,0x00 }},
+ {16, 0xd830, 0, {0xb2,0x60,0x0c,0x90,0x83,0x24,0x00,0xc9,0x00,0x3e,0x40,0x0c,0x1a,0x02,0x24,0x00 }},
+ {16, 0xd840, 0, {0xc1,0x00,0xb2,0x40,0x0f,0x90,0x01,0xc2,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd850, 0, {0x80,0x04,0x65,0x00,0xb9,0x81,0x2c,0x60,0x0d,0x94,0xc2,0xc7,0x08,0x89,0x00,0x22 }},
+ {16, 0xd860, 0, {0x40,0x08,0x95,0xc7,0xa4,0x00,0xb9,0x00,0x28,0x70,0xa8,0x94,0x0a,0x24,0x00,0x89 }},
+ {16, 0xd870, 0, {0x04,0x2e,0x40,0x28,0x90,0x2a,0x26,0x00,0x89,0x00,0x22,0x40,0x0b,0x90,0x02,0xe0 }},
+ {16, 0xd880, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0xb9,0x40,0x2e,0x40 }},
+ {16, 0xd890, 0, {0x0a,0x90,0x02,0xe5,0x00,0x81,0x00,0xa0,0x40,0x09,0x90,0x42,0xec,0x00,0xb1,0x00 }},
+ {16, 0xd8a0, 0, {0x22,0x58,0x08,0x90,0xa2,0x04,0x02,0x89,0x00,0x2e,0x40,0x08,0x90,0x02,0xa4,0xa0 }},
+ {16, 0xd8b0, 0, {0x89,0x00,0x22,0x40,0x0b,0x90,0x02,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd8c0, 0, {0x08,0x04,0x04,0x00,0xb1,0x20,0x2e,0xc0,0x89,0x12,0x02,0xc4,0x80,0x81,0x20,0x20 }},
+ {16, 0xd8d0, 0, {0x40,0x61,0x10,0x42,0xc5,0x00,0xb1,0x20,0x28,0x48,0x18,0x90,0x42,0x04,0x80,0x81 }},
+ {16, 0xd8e0, 0, {0x28,0x2c,0x48,0x08,0x12,0x82,0x84,0xa0,0x81,0x20,0x20,0x48,0x0b,0x12,0x82,0xc2 }},
+ {16, 0xd8f0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x68,0x00,0xf8,0x00,0x2e,0x00 }},
+ {16, 0xd900, 0, {0x0e,0x80,0x03,0xe0,0x08,0xc8,0x50,0x32,0x14,0x0d,0x80,0x17,0xe8,0x04,0xf8,0x50 }},
+ {16, 0xd910, 0, {0x32,0x14,0x4c,0x05,0x0b,0x21,0x40,0xc8,0x20,0x3e,0x00,0x0c,0x87,0x03,0xa1,0xc2 }},
+ {16, 0xd920, 0, {0xc8,0x00,0x32,0x14,0x8f,0x82,0x03,0xee,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd930, 0, {0x98,0x1d,0xf4,0x00,0xf1,0x10,0x3d,0x40,0x0f,0x91,0x02,0xd4,0x42,0xfd,0x10,0x3f }},
+ {16, 0xd940, 0, {0x51,0x0e,0x54,0x13,0xb5,0x00,0xf9,0x10,0x35,0x44,0x2f,0xd0,0x03,0xe4,0x50,0xfd }},
+ {16, 0xd950, 0, {0x28,0x3e,0x4e,0x0f,0x90,0x03,0x64,0x00,0xf9,0x38,0x3e,0x44,0x0f,0x92,0x83,0xe6 }},
+ {16, 0xd960, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x15,0xf4,0x00,0xfd,0x00,0x3d,0x40 }},
+ {16, 0xd970, 0, {0x2c,0xd0,0x03,0xb6,0x00,0xf9,0x82,0x3e,0x40,0x0c,0xd0,0x03,0xf4,0x00,0xf9,0x80 }},
+ {16, 0xd980, 0, {0x33,0x70,0x0c,0x50,0x03,0x34,0x00,0xc9,0xc0,0x3e,0x40,0x0c,0xda,0x03,0x16,0x80 }},
+ {16, 0xd990, 0, {0xc9,0x40,0x3e,0x62,0x2c,0x98,0x83,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd9a0, 0, {0x38,0x10,0xe0,0x00,0xb8,0x00,0x2e,0x00,0x08,0x80,0x02,0x28,0x00,0xb8,0x50,0x26 }},
+ {16, 0xd9b0, 0, {0x00,0x08,0xa0,0x02,0xe8,0x00,0xb8,0x00,0x2a,0x34,0x2a,0xaa,0x0a,0x20,0x00,0x88 }},
+ {16, 0xd9c0, 0, {0xc0,0x2e,0x2a,0x08,0x80,0x22,0x21,0x00,0xa8,0x80,0x2e,0x00,0x08,0x80,0x02,0x0e }},
+ {16, 0xd9d0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x00,0xb1,0x00,0x2e,0x40 }},
+ {16, 0xd9e0, 0, {0x48,0x10,0x06,0x8d,0x00,0xb1,0x00,0x2c,0x40,0x28,0x10,0x02,0xc4,0x00,0xb1,0x40 }},
+ {16, 0xd9f0, 0, {0x2c,0x48,0x08,0x10,0x82,0x44,0x00,0x81,0x60,0x2c,0x40,0x28,0x14,0x0a,0x04,0x40 }},
+ {16, 0xda00, 0, {0x81,0x20,0x2c,0x40,0x08,0x10,0x02,0x02,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xda10, 0, {0x18,0x05,0xa4,0x40,0xb9,0x00,0x2e,0x40,0x08,0xb0,0x02,0x24,0x00,0xb9,0x28,0x2e }},
+ {16, 0xda20, 0, {0x50,0x08,0x90,0x22,0xe4,0x00,0xb9,0x00,0x2e,0x60,0x0b,0x12,0x42,0x64,0x00,0x89 }},
+ {16, 0xda30, 0, {0x00,0x2c,0x40,0x09,0x90,0x02,0x24,0x00,0xa9,0x00,0x2c,0x40,0x08,0x10,0x02,0x46 }},
+ {16, 0xda40, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x05,0xe6,0x00,0xf9,0x00,0x3c,0x42 }},
+ {16, 0xda50, 0, {0x0c,0x90,0x03,0xa7,0x40,0xf9,0x40,0x3e,0x70,0x0c,0x98,0x02,0xe5,0x40,0xf9,0x00 }},
+ {16, 0xda60, 0, {0x3e,0x40,0x0c,0x98,0x03,0x64,0x06,0xc9,0x01,0x2e,0x40,0x0c,0x90,0x03,0x24,0x04 }},
+ {16, 0xda70, 0, {0xc9,0x00,0x3e,0x40,0x0c,0x90,0x0b,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xda80, 0, {0x28,0x01,0xa4,0x00,0xf9,0x00,0x3e,0x40,0x0f,0x90,0x83,0xe6,0x10,0xf9,0x00,0x36 }},
+ {16, 0xda90, 0, {0x68,0x0f,0x9c,0x03,0xe6,0x00,0xf9,0x00,0x3a,0x40,0x0e,0x98,0x93,0xa4,0x00,0xf9 }},
+ {16, 0xdaa0, 0, {0x00,0x3e,0x40,0x0e,0x90,0x83,0xc4,0x00,0xf9,0x00,0x3e,0x40,0x0f,0x90,0x03,0x8a }},
+ {16, 0xdab0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x00,0xa0,0x00,0xf8,0x00,0x3e,0x04 }},
+ {16, 0xdac0, 0, {0x0c,0x80,0x03,0x21,0x02,0xc8,0x40,0x32,0x00,0x0f,0x80,0x03,0xe1,0x00,0xf0,0x00 }},
+ {16, 0xdad0, 0, {0x3e,0x02,0x0c,0x80,0x03,0x20,0x00,0xf8,0x00,0x3e,0x00,0x0c,0x00,0x03,0x20,0x00 }},
+ {16, 0xdae0, 0, {0xc8,0x00,0x32,0x00,0x0f,0x80,0x03,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdaf0, 0, {0x28,0x15,0x3a,0x00,0xbe,0x02,0x2f,0xb0,0x08,0x68,0x12,0x38,0x00,0x8a,0x04,0x2a }},
+ {16, 0xdb00, 0, {0x80,0x0b,0xe0,0x42,0xfb,0x20,0xba,0x00,0x2f,0x91,0x08,0xe0,0x02,0x28,0x00,0xba }},
+ {16, 0xdb10, 0, {0x00,0x26,0x80,0x08,0xee,0x0a,0x38,0x00,0x8a,0x00,0x22,0x80,0x0b,0xa0,0x02,0x8a }},
+ {16, 0xdb20, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x42,0x00,0xb3,0x00,0x2c,0xc2 }},
+ {16, 0xdb30, 0, {0x28,0x38,0x0a,0x48,0x00,0x83,0x04,0x22,0xc0,0x0b,0x10,0x02,0xcd,0x80,0xb3,0x00 }},
+ {16, 0xdb40, 0, {0x2e,0xc0,0x08,0x1c,0x02,0x24,0x00,0xb3,0x00,0x2c,0xc0,0x08,0x34,0x12,0x0e,0x40 }},
+ {16, 0xdb50, 0, {0x83,0x00,0x20,0xc0,0x0b,0x30,0x12,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdb60, 0, {0xa0,0x01,0x11,0x00,0xb7,0x00,0x2f,0xc0,0x08,0x70,0xa2,0x4e,0x00,0x8f,0xb0,0x21 }},
+ {16, 0xdb70, 0, {0xcc,0x0b,0x60,0x12,0xdc,0x10,0xb7,0x30,0x2d,0xc0,0x08,0xd0,0x82,0x14,0x80,0xb7 }},
+ {16, 0xdb80, 0, {0x12,0x25,0xc8,0x28,0x60,0x02,0x14,0x00,0x87,0xb2,0x21,0xcc,0x0b,0x31,0x02,0xa8 }},
+ {16, 0xdb90, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x12,0x00,0xf7,0x80,0x3d,0xe0 }},
+ {16, 0xdba0, 0, {0x0c,0x38,0x03,0x56,0x00,0xc7,0x90,0xb1,0xe4,0x0f,0x78,0x03,0xde,0x00,0xf7,0x90 }},
+ {16, 0xdbb0, 0, {0x1f,0x60,0x2c,0x48,0x0b,0x16,0xa0,0xf7,0x80,0x3c,0xf4,0x0c,0x38,0x03,0x1e,0x00 }},
+ {16, 0xdbc0, 0, {0xcf,0xa0,0xb1,0xe8,0x0f,0x7b,0x03,0x2a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdbd0, 0, {0x08,0x0d,0xa0,0x00,0xf8,0x00,0x3e,0xc0,0x0b,0xb0,0x03,0xac,0x00,0xf3,0x21,0x3e }},
+ {16, 0xdbe0, 0, {0xc8,0x07,0xb0,0x02,0xe4,0x00,0xfb,0x20,0x3f,0x40,0x0f,0x80,0x03,0xe4,0x80,0xfb }},
+ {16, 0xdbf0, 0, {0x00,0x36,0xd0,0x0f,0xa0,0x03,0xe0,0x08,0xfb,0x42,0x3e,0xd8,0x0f,0xb0,0x03,0xc2 }},
+ {16, 0xdc00, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xf0,0x80,0xcf,0x80,0x31,0xe1 }},
+ {16, 0xdc10, 0, {0x0c,0xf8,0x03,0xda,0x10,0xef,0x80,0x3f,0xe4,0x0f,0xd8,0x03,0xfe,0x10,0xff,0x82 }},
+ {16, 0xdc20, 0, {0x3f,0xe0,0x4c,0xd8,0x1b,0x16,0x20,0xcf,0x80,0x3f,0xe0,0x4c,0xd8,0x30,0xee,0x40 }},
+ {16, 0xdc30, 0, {0xff,0xc0,0xb3,0xf4,0x0f,0xf8,0x03,0xc0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdc40, 0, {0xa8,0x01,0x98,0x20,0x83,0x40,0x21,0xc0,0x08,0x71,0x02,0xdc,0x84,0x87,0x20,0x2d }},
+ {16, 0xdc50, 0, {0xc0,0x0b,0x60,0x02,0xd9,0x60,0xf7,0x00,0x2d,0xc0,0x08,0xf0,0x82,0x14,0x04,0x87 }},
+ {16, 0xdc60, 0, {0x00,0x2d,0xc0,0x08,0xf0,0x03,0x1e,0x00,0xb7,0x20,0x21,0xc0,0x8b,0x70,0x02,0xea }},
+ {16, 0xdc70, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x00,0x87,0x00,0x21,0x80 }},
+ {16, 0xdc80, 0, {0x08,0x70,0x02,0xf5,0x04,0x27,0x00,0x2d,0xc0,0x8b,0x70,0x02,0xdc,0x00,0xb7,0x00 }},
+ {16, 0xdc90, 0, {0x2c,0x50,0x08,0x40,0x02,0x14,0x00,0x87,0x00,0x2d,0xc0,0x08,0x50,0x02,0x5c,0x04 }},
+ {16, 0xdca0, 0, {0xb7,0x00,0xa1,0xc0,0x8b,0x70,0x02,0xc0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdcb0, 0, {0x20,0x14,0xc8,0x00,0x80,0x00,0x00,0x80,0x08,0x30,0x02,0xce,0x00,0x83,0xc0,0x2c }},
+ {16, 0xdcc0, 0, {0xd0,0x4b,0x30,0x02,0xce,0x00,0xab,0x02,0x2c,0x40,0x48,0xbc,0x02,0x04,0x00,0x83 }},
+ {16, 0xdcd0, 0, {0x00,0x2c,0xc0,0x08,0x10,0x02,0x00,0x08,0xb3,0x00,0x20,0xc0,0x09,0x30,0x02,0xc8 }},
+ {16, 0xdce0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0x83,0x40,0xc8,0x00,0x30,0xc0 }},
+ {16, 0xdcf0, 0, {0x2c,0xb0,0x03,0xec,0x00,0xef,0x88,0x3f,0xe6,0x07,0xb1,0x83,0xe1,0x00,0xbf,0x00 }},
+ {16, 0xdd00, 0, {0x3e,0xe0,0x0c,0xb8,0x03,0x34,0x00,0xcf,0x00,0x3f,0xc0,0x2c,0xb0,0x03,0x68,0x10 }},
+ {16, 0xdd10, 0, {0xff,0x00,0x33,0xc0,0x0f,0xf0,0x03,0xea,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdd20, 0, {0x80,0x00,0xe4,0x00,0xf1,0x40,0x3e,0xc0,0x0f,0xb4,0x03,0xed,0x40,0xfb,0x08,0x3e }},
+ {16, 0xdd30, 0, {0xc0,0x0f,0xa0,0x03,0xe5,0x20,0xfb,0x00,0x3e,0xe0,0x0d,0xb0,0x83,0xe4,0x00,0xf3 }},
+ {16, 0xdd40, 0, {0x00,0x3e,0xc0,0x0f,0x80,0x03,0xc4,0x00,0xfb,0x00,0x3e,0xc0,0x0f,0x30,0x03,0xe0 }},
+ {16, 0xdd50, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xf0,0x00,0xca,0x00,0x33,0xe0 }},
+ {16, 0xdd60, 0, {0x4e,0xf0,0x03,0x34,0x00,0xff,0x00,0x3f,0xc0,0x8f,0xe8,0x03,0xf0,0x00,0xff,0x00 }},
+ {16, 0xdd70, 0, {0xb1,0x40,0x0c,0xe0,0x03,0x34,0x00,0xef,0x00,0xb3,0xc0,0x0c,0xf0,0x03,0x38,0x00 }},
+ {16, 0xdd80, 0, {0xcf,0x00,0x3d,0xc0,0x0a,0xf0,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdd90, 0, {0x81,0x04,0x62,0x22,0x88,0x90,0x22,0xe0,0x08,0x3c,0x02,0x2e,0x08,0xbb,0x01,0x2e }},
+ {16, 0xdda0, 0, {0xc0,0x0b,0xa0,0x02,0x66,0x00,0xbb,0x00,0x22,0xa0,0x08,0xa9,0x02,0x24,0x00,0xbb }},
+ {16, 0xddb0, 0, {0x00,0x22,0xc0,0x28,0x2c,0x02,0xa2,0x00,0xdb,0x00,0x2e,0xc0,0x0a,0xb0,0x02,0xa0 }},
+ {16, 0xddc0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x22,0x00,0x98,0x00,0x22,0xc8 }},
+ {16, 0xddd0, 0, {0x0a,0x98,0x02,0x27,0x04,0xbb,0x00,0x2e,0xc0,0x0b,0xb1,0x02,0xe2,0x00,0xbb,0x00 }},
+ {16, 0xdde0, 0, {0x22,0xe2,0x08,0xb0,0x02,0xa4,0x00,0xab,0x00,0x20,0xc0,0x0a,0x88,0x82,0x23,0x00 }},
+ {16, 0xddf0, 0, {0x8b,0x00,0x2e,0xc0,0x08,0xb0,0x02,0xa0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xde00, 0, {0x08,0x14,0x04,0x00,0x91,0x40,0x22,0xc0,0x08,0x10,0x02,0x0c,0x00,0xb3,0x00,0x2c }},
+ {16, 0xde10, 0, {0xc0,0x4b,0x28,0x22,0x40,0x04,0xb3,0x00,0x20,0xc0,0x28,0x30,0x0a,0x04,0x04,0xb3 }},
+ {16, 0xde20, 0, {0x00,0x60,0xc0,0x08,0x00,0x02,0x84,0x20,0x93,0x00,0x2c,0xc0,0x0a,0x30,0x02,0x82 }},
+ {16, 0xde30, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x60,0x00,0xda,0x40,0xb2,0x80 }},
+ {16, 0xde40, 0, {0x0e,0x90,0x03,0x24,0x00,0xff,0x00,0x3f,0xc0,0x8f,0xa0,0x03,0xe0,0x09,0xff,0x00 }},
+ {16, 0xde50, 0, {0x32,0x40,0x08,0xa0,0x0b,0x34,0x00,0xeb,0x00,0x31,0xc0,0x0c,0x80,0x03,0x28,0x80 }},
+ {16, 0xde60, 0, {0xc7,0x00,0x3f,0xc0,0x0c,0xf0,0x03,0x00,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xde70, 0, {0xa0,0x15,0xd0,0x00,0xec,0x20,0x3f,0x00,0x0f,0xc0,0x0b,0xfc,0x10,0xff,0x01,0x3f }},
+ {16, 0xde80, 0, {0xc0,0x0f,0xe0,0x03,0xf4,0x00,0xff,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0xf4,0x00,0xff }},
+ {16, 0xde90, 0, {0x00,0x3f,0xc0,0x4f,0xc0,0x01,0xf0,0x08,0xff,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0xe8 }},
+ {16, 0xdea0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfc,0x00,0xcc,0x90,0x37,0x20 }},
+ {16, 0xdeb0, 0, {0x0e,0xf0,0x13,0xbd,0x04,0xd4,0xc1,0x33,0x2c,0x4c,0xd9,0x23,0x32,0x60,0xff,0x20 }},
+ {16, 0xdec0, 0, {0x3d,0xe0,0x4f,0xc1,0x03,0xb6,0x40,0xcd,0x00,0x37,0xe0,0x0c,0xe2,0x8b,0x10,0xc0 }},
+ {16, 0xded0, 0, {0xcd,0x00,0x33,0xc6,0x0f,0xd8,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdee0, 0, {0x80,0x10,0xee,0x08,0x8a,0x20,0x22,0x00,0x08,0xb7,0x02,0x2d,0x00,0x8a,0x00,0xb6 }},
+ {16, 0xdef0, 0, {0x3c,0x08,0x99,0x02,0x27,0x84,0xbf,0x68,0x2e,0x82,0x0b,0x01,0x02,0x24,0x40,0xd9 }},
+ {16, 0xdf00, 0, {0x42,0x20,0xc0,0x8a,0xac,0x02,0x2d,0xc2,0x82,0x48,0xa2,0xd0,0x0b,0x82,0x02,0x20 }},
+ {16, 0xdf10, 0, {0x06,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x00,0x88,0x04,0x26,0x80 }},
+ {16, 0xdf20, 0, {0x2a,0x30,0xc2,0xa5,0x80,0xa9,0x21,0x28,0x00,0x8a,0x00,0x02,0x00,0x00,0xa3,0x10 }},
+ {16, 0xdf30, 0, {0x2c,0xc8,0x0b,0x00,0x02,0xc4,0x90,0x83,0x42,0x24,0xc1,0x08,0x00,0x02,0x40,0x88 }},
+ {16, 0xdf40, 0, {0xa3,0x60,0xa8,0xc0,0x0b,0x00,0xc2,0x22,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdf50, 0, {0xc0,0x15,0xac,0x06,0x8a,0x00,0x22,0xe0,0x48,0xb0,0x02,0x2e,0x02,0xab,0x80,0x2e }},
+ {16, 0xdf60, 0, {0x20,0x4a,0x8c,0x02,0x26,0x20,0xbb,0x00,0x6e,0x80,0x0b,0x30,0xc2,0x46,0x04,0x9b }},
+ {16, 0xdf70, 0, {0x0a,0xa2,0xc0,0x0a,0x80,0x12,0x6c,0x40,0xa8,0x00,0x2a,0xc0,0x0b,0x8c,0x02,0x30 }},
+ {16, 0xdf80, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xec,0x00,0xc1,0x09,0x36,0x61 }},
+ {16, 0xdf90, 0, {0x0e,0x32,0x03,0xab,0x20,0xf8,0x84,0x3a,0x78,0x2e,0x98,0x03,0x26,0x00,0xeb,0x00 }},
+ {16, 0xdfa0, 0, {0x3e,0x40,0x4f,0x90,0x03,0xe2,0x00,0xc9,0x40,0x36,0xe0,0x0c,0xb4,0x03,0x6e,0x00 }},
+ {16, 0xdfb0, 0, {0xeb,0x00,0x3a,0xc0,0x0f,0x88,0x03,0x10,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdfc0, 0, {0xe0,0x01,0xbc,0x00,0xfd,0x00,0x3f,0x40,0x0f,0xfa,0x13,0xf8,0x10,0xdc,0x04,0x27 }},
+ {16, 0xdfd0, 0, {0x40,0x0d,0x50,0x43,0xf4,0x00,0xff,0x00,0x3f,0x40,0x0f,0xd9,0x03,0xb0,0x00,0xf9 }},
+ {16, 0xdfe0, 0, {0x01,0x3f,0xf0,0x0f,0xf0,0x23,0xb2,0x00,0xd4,0xa0,0x37,0xc0,0x0f,0xc0,0x0b,0xf8 }},
+ {16, 0xdff0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x20,0xeb,0x10,0xf2,0x00 }},
+ {16, 0xe000, 0, {0x0e,0xb4,0x03,0x21,0x80,0xc9,0x40,0x3a,0x48,0x0f,0x90,0x13,0xe1,0x20,0xfb,0x00 }},
+ {16, 0xe010, 0, {0x3e,0xc0,0x0c,0x84,0x03,0x24,0x00,0xfb,0x01,0x36,0xe0,0x0c,0x74,0x0b,0x9c,0x00 }},
+ {16, 0xe020, 0, {0xcf,0x00,0x32,0xe0,0x0f,0x84,0x03,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe030, 0, {0xc8,0x05,0x1e,0x00,0x8b,0x80,0x20,0x40,0x08,0xb8,0x02,0x83,0x80,0x81,0xa0,0x22 }},
+ {16, 0xe040, 0, {0x78,0x0b,0x91,0x83,0xe3,0x00,0xbf,0x00,0x0e,0xc1,0x0a,0xb4,0x03,0x64,0x04,0xb9 }},
+ {16, 0xe050, 0, {0x50,0x32,0xc0,0x0a,0xb2,0x02,0x20,0x00,0x88,0x00,0x23,0xd4,0x0b,0x88,0x02,0xf2 }},
+ {16, 0xe060, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x42,0xa0,0x80,0x20,0x00 }},
+ {16, 0xe070, 0, {0x48,0x00,0x02,0x0d,0x06,0x80,0x80,0x2a,0xd0,0x03,0x00,0x02,0xc8,0x00,0xb3,0x00 }},
+ {16, 0xe080, 0, {0x2c,0xc0,0x08,0x36,0x02,0x40,0x00,0xb9,0x02,0x22,0xc2,0x8b,0x26,0x02,0x0c,0x10 }},
+ {16, 0xe090, 0, {0x01,0x02,0x24,0xc0,0x4b,0xa1,0x02,0xf8,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe0a0, 0, {0x20,0x01,0x1e,0x08,0x8e,0x80,0x21,0x21,0x08,0x28,0xc2,0x9e,0x00,0x8e,0x80,0x21 }},
+ {16, 0xe0b0, 0, {0x60,0x0b,0x78,0x02,0x9e,0x20,0xb7,0x82,0x2f,0xa1,0x0a,0x78,0x02,0x5e,0x00,0xb5 }},
+ {16, 0xe0c0, 0, {0x91,0xa1,0xe0,0x0b,0x29,0x02,0x32,0x44,0x86,0x80,0xa5,0xe0,0x0b,0x4c,0x02,0xc8 }},
+ {16, 0xe0d0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0xe1,0x00,0x22,0x80 }},
+ {16, 0xe0e0, 0, {0x0e,0x00,0x0b,0x24,0x00,0xc0,0x44,0x28,0xad,0x0f,0x20,0x02,0xc8,0x00,0xf3,0x00 }},
+ {16, 0xe0f0, 0, {0x1c,0xc0,0x0c,0x01,0x03,0x48,0x4c,0xf2,0x04,0x30,0xc0,0x0f,0x15,0x03,0x80,0x40 }},
+ {16, 0xe100, 0, {0xc1,0x00,0x14,0xc8,0x0f,0x00,0x03,0xda,0x02,0x10,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe110, 0, {0x40,0x1d,0x9c,0x40,0xf7,0x00,0x3f,0xc0,0x8f,0xc0,0x03,0xe4,0x00,0xfa,0x01,0x3f }},
+ {16, 0xe120, 0, {0xc0,0x0f,0xf0,0x23,0xfc,0x08,0xfb,0x00,0x3f,0x80,0x0f,0xf0,0x01,0xfc,0x10,0xff }},
+ {16, 0xe130, 0, {0x00,0x3f,0xc0,0x0e,0xd1,0x03,0xfc,0x42,0xfe,0x80,0x3b,0xc0,0x0f,0xc0,0x03,0xd0 }},
+ {16, 0xe140, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x40,0xc8,0x00,0x3e,0xc0 }},
+ {16, 0xe150, 0, {0x0f,0x90,0x03,0xee,0x08,0xcb,0x00,0x32,0xc0,0x0f,0xa0,0x23,0xe6,0x03,0xcb,0x4c }},
+ {16, 0xe160, 0, {0x32,0x40,0x0f,0xb0,0x07,0xe8,0x00,0xf9,0x00,0x16,0x40,0x0c,0xa0,0x0b,0x6c,0x00 }},
+ {16, 0xe170, 0, {0xcf,0x02,0x32,0xc5,0x0c,0x80,0x03,0x02,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe180, 0, {0x48,0x11,0x9c,0x80,0x84,0x04,0x2d,0xc1,0x0b,0x40,0x40,0xdc,0x00,0x87,0x04,0x21 }},
+ {16, 0xe190, 0, {0xc0,0x4b,0x70,0x12,0xfc,0x01,0x8f,0x60,0x29,0x40,0x0b,0x70,0x13,0x9c,0x00,0xb5 }},
+ {16, 0xe1a0, 0, {0x00,0xa3,0x40,0x0a,0x60,0x02,0x00,0x00,0x84,0x00,0x21,0xc0,0x08,0x40,0x02,0x12 }},
+ {16, 0xe1b0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x8e,0x00,0x87,0x80,0x2d,0xa2 }},
+ {16, 0xe1c0, 0, {0x0b,0x4c,0x16,0xd6,0x08,0x97,0x88,0x21,0xa0,0x4b,0x68,0x02,0xde,0x04,0xa7,0x80 }},
+ {16, 0xe1d0, 0, {0x21,0xe0,0x0b,0x48,0x02,0xda,0x04,0xb6,0x82,0x25,0x60,0x0a,0xe8,0x62,0x1e,0x00 }},
+ {16, 0xe1e0, 0, {0x87,0x80,0x20,0xe8,0x08,0x48,0x02,0x08,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe1f0, 0, {0x48,0x14,0xcc,0x00,0x8b,0x80,0x6c,0xf0,0x0b,0x3c,0x02,0xce,0x46,0x9b,0xc0,0x20 }},
+ {16, 0xe200, 0, {0xe4,0x0b,0x3c,0x02,0xcc,0x20,0xa3,0x00,0x28,0xe0,0x0b,0x30,0x02,0x8d,0x80,0xb1 }},
+ {16, 0xe210, 0, {0x80,0x22,0x44,0x0a,0x21,0x0a,0x03,0x82,0x80,0x80,0xa0,0xc0,0x08,0x06,0x0a,0x12 }},
+ {16, 0xe220, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x02,0xce,0x80,0x3f,0xa0 }},
+ {16, 0xe230, 0, {0x0f,0xe0,0x03,0xfa,0x40,0xde,0xc0,0xb3,0x90,0x0f,0xea,0x13,0xf9,0x08,0xea,0x04 }},
+ {16, 0xe240, 0, {0x33,0x82,0x8f,0xe4,0x03,0xfb,0x08,0xfe,0xa0,0x36,0xa0,0x0c,0xac,0x0b,0x6b,0x82 }},
+ {16, 0xe250, 0, {0xc6,0xa0,0x32,0x80,0x2c,0xe4,0x03,0x3a,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe260, 0, {0x48,0x00,0xe0,0x00,0xf8,0x90,0x3e,0x02,0x0f,0x80,0x83,0xe1,0x00,0xe8,0x20,0x3e }},
+ {16, 0xe270, 0, {0x03,0x0f,0x82,0x03,0xe1,0x40,0xd8,0x00,0x3e,0x20,0x0f,0x00,0x93,0xa0,0x40,0xf8 }},
+ {16, 0xe280, 0, {0x00,0x3e,0x10,0x8f,0x08,0x0b,0xf0,0x00,0xfc,0x00,0x3e,0x00,0x0f,0x80,0x03,0xd2 }},
+ {16, 0xe290, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xe9,0x00,0x36,0x40 }},
+ {16, 0xe2a0, 0, {0x0f,0x94,0x07,0xe6,0x00,0xf9,0x80,0xb0,0x40,0x0c,0x94,0x03,0xe4,0x40,0xf9,0x00 }},
+ {16, 0xe2b0, 0, {0x32,0x40,0x0f,0x94,0x0b,0xa4,0x00,0x71,0xc0,0x32,0x40,0x2c,0x94,0x23,0x24,0x02 }},
+ {16, 0xe2c0, 0, {0xc9,0x00,0x32,0x40,0x0c,0x90,0x03,0x02,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe2d0, 0, {0x80,0x04,0x44,0x00,0x89,0x00,0x22,0x40,0x0b,0x98,0x02,0xe6,0x60,0xb9,0x00,0x22 }},
+ {16, 0xe2e0, 0, {0x60,0x0a,0x9c,0x02,0xe6,0x24,0xb9,0x04,0x36,0x40,0x0b,0x98,0x00,0x24,0x00,0xb9 }},
+ {16, 0xe2f0, 0, {0x80,0xa2,0x52,0x08,0x90,0x02,0x24,0x00,0x89,0x40,0x22,0x40,0x68,0x94,0x02,0x20 }},
+ {16, 0xe300, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x00,0xa9,0x00,0x26,0x40 }},
+ {16, 0xe310, 0, {0x03,0x94,0x02,0xe4,0x01,0xb9,0x10,0x22,0x55,0x08,0x90,0x22,0xe4,0x00,0xb1,0x00 }},
+ {16, 0xe320, 0, {0x26,0x40,0x0b,0x90,0x00,0x2c,0x09,0xb9,0x00,0x22,0x60,0x08,0x90,0x0a,0x1c,0x04 }},
+ {16, 0xe330, 0, {0x8d,0x08,0xa0,0x40,0x08,0x10,0x82,0x0e,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe340, 0, {0x08,0x04,0x06,0x00,0x81,0x00,0x20,0x50,0x0b,0x12,0x42,0xc4,0x80,0xb1,0x04,0x20 }},
+ {16, 0xe350, 0, {0x50,0x0a,0x14,0x02,0xc5,0x00,0xb1,0x22,0x24,0x40,0x0b,0x12,0x22,0x04,0x01,0xb1 }},
+ {16, 0xe360, 0, {0x40,0x20,0x50,0x08,0x10,0x0a,0x15,0x00,0x85,0x40,0x28,0x50,0x08,0x14,0x0a,0x0a }},
+ {16, 0xe370, 0, {0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xe8,0x50,0x36,0x00 }},
+ {16, 0xe380, 0, {0x0f,0x85,0x02,0xe1,0x40,0xf8,0x50,0x32,0x00,0x0c,0xa0,0x23,0xe0,0x10,0xf8,0x50 }},
+ {16, 0xe390, 0, {0xb2,0x14,0x0f,0xa5,0x03,0xa1,0x48,0xfa,0x00,0xb2,0x00,0x0c,0x80,0x03,0x20,0x04 }},
+ {16, 0xe3a0, 0, {0xc4,0x02,0x32,0x00,0x0c,0x00,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe3b0, 0, {0x98,0x1d,0xe5,0x00,0xfd,0x00,0x3f,0x40,0x0f,0xd1,0x03,0xd4,0x44,0xf5,0x00,0x3f }},
+ {16, 0xe3c0, 0, {0x51,0x0f,0xd4,0x03,0xf5,0x00,0xf9,0x10,0x3b,0x40,0x0f,0xd1,0x00,0xf5,0x10,0xf5 }},
+ {16, 0xe3d0, 0, {0x40,0x7f,0x40,0x0f,0x54,0x2b,0xe5,0x00,0xf9,0x40,0x36,0x50,0x0f,0xd0,0x03,0xe6 }},
+ {16, 0xe3e0, 0, {0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xf6,0x10,0xbd,0x40,0x33,0x40 }},
+ {16, 0xe3f0, 0, {0x0f,0xda,0x03,0x37,0x80,0xcd,0x00,0x3f,0x40,0x0f,0xd0,0x03,0xf4,0x00,0xe9,0xa0 }},
+ {16, 0xe400, 0, {0x3e,0x40,0x0c,0xde,0x17,0xa4,0x08,0xfd,0xc0,0x33,0x41,0x8d,0xda,0x13,0x26,0xa0 }},
+ {16, 0xe410, 0, {0xf9,0xa8,0x32,0x78,0x0c,0xb4,0x0b,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe420, 0, {0x38,0x10,0xe1,0x00,0xb8,0xa0,0x36,0x20,0x0b,0x8a,0x82,0xa2,0x80,0x2a,0xa8,0x2e }},
+ {16, 0xe430, 0, {0x00,0x0b,0x80,0x12,0xe0,0x04,0xb8,0xa1,0x2e,0x28,0x4a,0x8e,0x02,0x2a,0xa0,0xba }},
+ {16, 0xe440, 0, {0xc0,0x22,0x28,0x08,0x85,0x02,0x21,0x08,0xb8,0xe8,0xa2,0x3c,0x08,0xc8,0x02,0x0e }},
+ {16, 0xe450, 0, {0x06,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc5,0x00,0xb9,0x00,0x20,0x4a }},
+ {16, 0xe460, 0, {0x0b,0x14,0x02,0x05,0x80,0x01,0x00,0x2c,0x41,0x0b,0x10,0x02,0xc4,0x04,0xa1,0x4a }},
+ {16, 0xe470, 0, {0x2e,0x42,0x08,0x14,0x02,0x84,0x10,0xb1,0x60,0xa0,0x4a,0x09,0x10,0x02,0x44,0x00 }},
+ {16, 0xe480, 0, {0xb5,0x01,0x29,0x40,0x18,0xd2,0x02,0x12,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe490, 0, {0x18,0x15,0xa4,0x00,0xb9,0x21,0x26,0x40,0x0b,0x96,0x02,0xa4,0x10,0xa9,0x00,0x2e }},
+ {16, 0xe4a0, 0, {0x40,0x0b,0x96,0x12,0xe4,0x20,0xb9,0x00,0x2e,0x41,0x0a,0x90,0x42,0x24,0x00,0xb9 }},
+ {16, 0xe4b0, 0, {0x00,0x22,0x41,0x08,0x98,0x22,0x64,0x00,0xb9,0x20,0x2b,0x41,0x28,0xd4,0x02,0x06 }},
+ {16, 0xe4c0, 0, {0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x11,0xe4,0x00,0xf9,0xe0,0x32,0x58 }},
+ {16, 0xe4d0, 0, {0x0f,0x98,0x03,0x26,0x40,0xc9,0x40,0x3e,0x58,0x0f,0x9c,0x03,0xe4,0x00,0xe9,0x00 }},
+ {16, 0xe4e0, 0, {0x6e,0x40,0x0c,0x9a,0x02,0xa6,0x00,0xf9,0x44,0x32,0x40,0x0d,0x9a,0x0b,0x64,0x84 }},
+ {16, 0xe4f0, 0, {0xf9,0x00,0xba,0x40,0x0c,0x18,0x03,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe500, 0, {0x28,0x01,0xa4,0x00,0xf9,0x00,0x3e,0x50,0x0f,0x90,0x03,0xe6,0x00,0xf9,0x04,0x3e }},
+ {16, 0xe510, 0, {0x48,0x0f,0x90,0x03,0xe4,0x40,0xf9,0x00,0x3e,0x65,0x0f,0x99,0x81,0xe4,0x50,0xf9 }},
+ {16, 0xe520, 0, {0x20,0x3e,0x40,0x8f,0x90,0x03,0xa4,0x80,0xf9,0x00,0x34,0x40,0x0f,0x92,0x03,0xd2 }},
+ {16, 0xe530, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xf8,0x40,0x3e,0x10 }},
+ {16, 0xe540, 0, {0x0e,0x84,0x03,0x60,0x08,0xc8,0x00,0x3e,0x08,0x0f,0x80,0x83,0xe0,0x28,0xe8,0x04 }},
+ {16, 0xe550, 0, {0x3e,0x00,0x0c,0x84,0x03,0x21,0x1c,0xf0,0x48,0x32,0x00,0x0b,0x00,0x03,0xe0,0x02 }},
+ {16, 0xe560, 0, {0xc0,0x00,0x32,0x00,0x0c,0xc0,0x0b,0x02,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe570, 0, {0x28,0x05,0x38,0x00,0xb2,0x88,0x2e,0x80,0x08,0xe0,0x03,0x7a,0x80,0x8e,0x00,0x2f }},
+ {16, 0xe580, 0, {0xa0,0x0b,0xe8,0x02,0xf9,0x10,0xba,0x00,0x2c,0x80,0x28,0xe4,0x02,0x28,0x00,0xbe }},
+ {16, 0xe590, 0, {0x40,0x23,0xb8,0x08,0xe8,0x02,0xe8,0x04,0xca,0x20,0xa2,0x80,0x08,0xe8,0x02,0x0a }},
+ {16, 0xe5a0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x01,0xb3,0x00,0x2c,0x40 }},
+ {16, 0xe5b0, 0, {0x08,0xb8,0x42,0x6c,0x02,0x83,0x00,0x2c,0xe0,0x0b,0x38,0x00,0xcf,0x40,0xb3,0x00 }},
+ {16, 0xe5c0, 0, {0x2c,0xc0,0x08,0xb4,0x0a,0x0c,0x00,0xb3,0x40,0xa2,0x82,0x0a,0x39,0x02,0xcc,0x00 }},
+ {16, 0xe5d0, 0, {0x93,0x80,0xa0,0xc0,0x29,0x20,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe5e0, 0, {0xa0,0x01,0x1d,0x00,0xb7,0x00,0x2d,0x64,0x28,0x74,0x02,0x40,0x00,0x87,0x05,0x2d }},
+ {16, 0xe5f0, 0, {0x90,0x0b,0x74,0x02,0xdc,0x10,0xb7,0x30,0x2d,0xc8,0x08,0x34,0x06,0x1c,0x80,0xb7 }},
+ {16, 0xe600, 0, {0x00,0xa1,0xc0,0x0a,0x70,0x02,0xde,0x80,0x83,0x00,0x01,0x00,0x09,0x60,0x82,0x20 }},
+ {16, 0xe610, 0, {0x04,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1a,0x00,0xf7,0x80,0x3d,0x60 }},
+ {16, 0xe620, 0, {0x0e,0xd8,0x0b,0x5e,0x00,0xc7,0x80,0x3d,0xe0,0x0f,0x68,0x03,0xde,0x10,0xf7,0xa9 }},
+ {16, 0xe630, 0, {0x7f,0xe8,0x48,0x78,0x03,0x1f,0x30,0xff,0x94,0x33,0xa0,0x0e,0x78,0x03,0xcf,0x24 }},
+ {16, 0xe640, 0, {0xd6,0x80,0xb1,0xe0,0x0d,0xf8,0x43,0x22,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe650, 0, {0x08,0x1d,0xac,0x00,0xbb,0x00,0x0c,0x40,0x0f,0xb0,0x03,0xec,0x08,0xf9,0x00,0x3e }},
+ {16, 0xe660, 0, {0x00,0x0f,0x90,0x41,0xec,0x00,0xfb,0x61,0x7e,0xd0,0x0f,0xb0,0x03,0xec,0x80,0xfb }},
+ {16, 0xe670, 0, {0x40,0x3f,0x9b,0x0c,0xb0,0x03,0xed,0x90,0xfa,0x00,0x3c,0x00,0x0e,0xb0,0x03,0xc2 }},
+ {16, 0xe680, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xde,0x00,0xef,0x80,0x33,0x60 }},
+ {16, 0xe690, 0, {0x0d,0xd8,0x03,0x36,0x40,0xef,0x90,0x3e,0xe0,0x0f,0xf9,0x03,0xfe,0x00,0xff,0x80 }},
+ {16, 0xe6a0, 0, {0x33,0xfe,0x0c,0xfa,0x03,0xfe,0x00,0xcf,0x80,0xb3,0xe0,0x0f,0xf8,0x03,0xfe,0x00 }},
+ {16, 0xe6b0, 0, {0xcd,0x80,0x33,0xe0,0x0f,0xc8,0x43,0xc0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe6c0, 0, {0xa8,0x11,0x9c,0x00,0x85,0x08,0x35,0x40,0x08,0x70,0x03,0x52,0x20,0x87,0x11,0x2c }},
+ {16, 0xe6d0, 0, {0xec,0x0b,0x71,0x02,0xd0,0x00,0xe7,0x00,0x35,0xc4,0x08,0x74,0x02,0xdc,0x40,0x87 }},
+ {16, 0xe6e0, 0, {0x10,0x21,0xc0,0x0b,0x70,0x02,0xfc,0x80,0x85,0x08,0x21,0x00,0x0b,0x41,0x82,0xea }},
+ {16, 0xe6f0, 0, {0x06,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x00,0xaf,0x00,0x23,0x50 }},
+ {16, 0xe700, 0, {0x09,0x50,0x02,0x1c,0x80,0xa7,0x01,0x29,0xc0,0x1b,0x60,0x06,0xdc,0x40,0xb7,0x10 }},
+ {16, 0xe710, 0, {0x21,0xc8,0x4a,0x52,0x02,0xdc,0x00,0x83,0x00,0x21,0xc0,0x0b,0x70,0x02,0xdc,0x13 }},
+ {16, 0xe720, 0, {0x84,0x00,0x25,0xc0,0x0b,0x58,0x02,0xc0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe730, 0, {0x20,0x14,0xcc,0x00,0x81,0x80,0x24,0x40,0x08,0x3e,0x02,0x6e,0x00,0x89,0x00,0x2c }},
+ {16, 0xe740, 0, {0xc0,0x0b,0xb4,0x02,0xca,0x80,0xa3,0x00,0x24,0xc0,0x0a,0x04,0x02,0xec,0x40,0x82 }},
+ {16, 0xe750, 0, {0x0a,0x20,0xc0,0x0b,0x30,0x02,0xcd,0x10,0x80,0xc0,0xa4,0x00,0x0b,0x1c,0x02,0xc8 }},
+ {16, 0xe760, 0, {0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0x84,0x00,0xeb,0x80,0x33,0x40 }},
+ {16, 0xe770, 0, {0x0d,0x8c,0x83,0x26,0x00,0xe9,0xa0,0x3e,0x78,0x8f,0x90,0x83,0xe1,0x00,0xff,0x00 }},
+ {16, 0xe780, 0, {0x31,0xd1,0x0e,0x84,0x23,0xfc,0x00,0xcb,0x82,0x32,0xc0,0x8f,0xb0,0x02,0xfd,0x40 }},
+ {16, 0xe790, 0, {0xcb,0x80,0xb6,0xc0,0x0f,0xa4,0x03,0xea,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe7a0, 0, {0x80,0x00,0xec,0x00,0xfb,0x00,0x3e,0x40,0x0f,0xa0,0x03,0xe0,0x00,0xf9,0x01,0x3e }},
+ {16, 0xe7b0, 0, {0x42,0x0f,0x90,0x03,0xe5,0x54,0xe3,0x00,0x3e,0xc8,0x05,0x93,0x03,0xec,0x80,0xfb }},
+ {16, 0xe7c0, 0, {0xc1,0x3e,0xc0,0x0f,0x20,0x03,0xcc,0x48,0xf3,0x08,0x3a,0x00,0x0f,0xa0,0x43,0xe0 }},
+ {16, 0xe7d0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xf0,0x00,0xcf,0x00,0x3f,0x40 }},
+ {16, 0xe7e0, 0, {0x0f,0x30,0x01,0x2c,0x0a,0xcd,0x10,0x33,0x00,0x0f,0xd0,0x83,0x14,0x00,0xcb,0x02 }},
+ {16, 0xe7f0, 0, {0x33,0xc0,0x0c,0xe1,0x03,0xec,0x10,0xcd,0x00,0x33,0xc0,0x0c,0xf0,0x33,0x3c,0x00 }},
+ {16, 0xe800, 0, {0xea,0x00,0x33,0xc0,0x0c,0xf0,0x83,0xc8,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe810, 0, {0x81,0x04,0x6e,0x00,0x8b,0x00,0x2e,0x40,0x0b,0xbc,0x02,0x2e,0x00,0x0b,0x00,0x22 }},
+ {16, 0xe820, 0, {0x30,0x0b,0x9c,0x02,0x27,0x80,0xab,0x00,0x2a,0xc0,0x08,0xb8,0x02,0xec,0x00,0x89 }},
+ {16, 0xe830, 0, {0xc0,0x20,0xe0,0x08,0xae,0x02,0x2c,0x08,0x8a,0x00,0x22,0x00,0x08,0xb0,0x42,0xe8 }},
+ {16, 0xe840, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2e,0x00,0x8b,0x04,0x2e,0x40 }},
+ {16, 0xe850, 0, {0x8b,0x8c,0x02,0xae,0x10,0x89,0x00,0x22,0x70,0x0b,0x8c,0x02,0xa2,0x00,0x8b,0x01 }},
+ {16, 0xe860, 0, {0x22,0xc0,0x08,0x80,0x02,0xec,0x10,0x82,0x88,0xa2,0x70,0x09,0xb8,0x02,0x2c,0x08 }},
+ {16, 0xe870, 0, {0x89,0x00,0x20,0xc0,0x28,0x80,0x22,0xe0,0x10,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe880, 0, {0x08,0x04,0x0c,0x04,0x81,0x00,0x2c,0x40,0x0b,0x20,0x02,0x80,0x00,0x81,0x04,0xa0 }},
+ {16, 0xe890, 0, {0x50,0x4b,0x00,0x0a,0x80,0x00,0xa3,0x01,0x2a,0xc1,0x20,0x10,0x02,0xcc,0x14,0x83 }},
+ {16, 0xe8a0, 0, {0x00,0x22,0xc0,0x08,0x20,0x02,0x0c,0x00,0x81,0x00,0xe0,0x00,0x08,0x00,0x02,0xc2 }},
+ {16, 0xe8b0, 0, {0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x68,0x00,0xcb,0x00,0x3e,0x40 }},
+ {16, 0xe8c0, 0, {0x0f,0x90,0x0b,0xac,0x80,0xc9,0x00,0x32,0x10,0x0f,0x80,0x03,0xa4,0x00,0xcf,0x02 }},
+ {16, 0xe8d0, 0, {0x31,0xc0,0x0c,0x80,0x13,0xfc,0x02,0xcd,0x00,0x33,0xc0,0x2c,0x90,0x03,0x3c,0x02 }},
+ {16, 0xe8e0, 0, {0xe8,0x00,0xb2,0xc0,0x0c,0x90,0x03,0xc0,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe8f0, 0, {0xa0,0x1d,0xfc,0x02,0xf5,0x00,0x3d,0x40,0x8f,0xf0,0x23,0x6d,0x00,0xff,0x00,0x3f }},
+ {16, 0xe900, 0, {0x04,0x0f,0xc0,0x03,0x70,0x1c,0xff,0x01,0x3f,0xc0,0x4f,0xc0,0x03,0xfc,0x00,0xfd }},
+ {16, 0xe910, 0, {0x00,0x3f,0xc0,0x0f,0xe0,0x0f,0xfc,0x18,0xfc,0x00,0x3f,0x00,0x0f,0xd0,0x03,0xe8 }},
+ {16, 0xe920, 0, {0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfe,0x00,0xd7,0x02,0x0f,0x30 }},
+ {16, 0xe930, 0, {0x0c,0xf2,0x01,0x7e,0x06,0x44,0x30,0x3f,0x20,0x0e,0xf0,0x02,0x7c,0x84,0xfd,0x20 }},
+ {16, 0xe940, 0, {0x27,0x08,0x0c,0xd0,0x01,0x36,0x00,0xff,0x60,0x33,0xcc,0x0b,0xf1,0x13,0x2c,0xc4 }},
+ {16, 0xe950, 0, {0xff,0x30,0x0f,0xcd,0x0c,0xf4,0x03,0xf0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe960, 0, {0x80,0x10,0xee,0x00,0x8f,0xc0,0x2e,0x00,0x08,0xfc,0x02,0x2e,0x00,0x8a,0x30,0x28 }},
+ {16, 0xe970, 0, {0x52,0x08,0xf6,0x82,0x3c,0x68,0xbd,0x90,0x32,0x34,0x48,0x9c,0x12,0x26,0x00,0xcf }},
+ {16, 0xe980, 0, {0x40,0x23,0xcc,0x0b,0xf6,0x02,0x3d,0x00,0xbf,0x10,0x2f,0xcc,0x88,0xf6,0x02,0xe0 }},
+ {16, 0xe990, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x00,0x93,0x10,0x2c,0x08 }},
+ {16, 0xe9a0, 0, {0x09,0x31,0x02,0x4c,0x00,0x9b,0x20,0x64,0x58,0x03,0x31,0x62,0x4c,0x81,0xa1,0x00 }},
+ {16, 0xe9b0, 0, {0x20,0x00,0x48,0x14,0x02,0x44,0x00,0x93,0x30,0x24,0xc0,0x0b,0x33,0x02,0x8d,0x84 }},
+ {16, 0xe9c0, 0, {0xb3,0x20,0x6c,0xc0,0x2a,0x36,0x02,0xe2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe9d0, 0, {0xc0,0x15,0xac,0x10,0x9b,0x02,0x2e,0x41,0x0b,0xb0,0x02,0xa4,0x00,0x9a,0x00,0x4a }},
+ {16, 0xe9e0, 0, {0x60,0x88,0xb0,0x52,0x6c,0x01,0xb9,0x00,0x26,0x00,0x08,0x91,0x22,0xec,0x08,0xbb }},
+ {16, 0xe9f0, 0, {0x00,0x26,0xc0,0x0b,0xb0,0x02,0xac,0x00,0xbb,0x05,0x6e,0xc1,0x0a,0xb0,0x02,0xf0 }},
+ {16, 0xea00, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xec,0x00,0xdb,0x01,0x3e,0x30 }},
+ {16, 0xea10, 0, {0x2d,0x30,0x03,0x47,0x60,0xd8,0xa0,0x16,0x38,0x8f,0xb0,0x03,0x6c,0x00,0x79,0x02 }},
+ {16, 0xea20, 0, {0x31,0x60,0x0c,0xc8,0x0a,0x66,0x00,0xbb,0x00,0xb6,0xc0,0x0f,0xb0,0x0b,0xac,0x00 }},
+ {16, 0xea30, 0, {0xfb,0x01,0x3e,0xc1,0x0e,0xb0,0x03,0xd0,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xea40, 0, {0xe0,0x01,0xbc,0x10,0xef,0x08,0x3f,0x24,0x0c,0xf0,0x03,0x76,0x20,0xee,0x90,0x35 }},
+ {16, 0xea50, 0, {0x40,0x0e,0x70,0x03,0xac,0x00,0xfd,0x00,0xbb,0x64,0x0f,0x88,0x13,0x34,0x80,0xcb }},
+ {16, 0xea60, 0, {0x00,0x3b,0xc0,0x0f,0xb0,0x03,0x6c,0x08,0xff,0x00,0x3e,0xc0,0x0d,0xf0,0x03,0xf8 }},
+ {16, 0xea70, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x01,0xfb,0x80,0x32,0x10 }},
+ {16, 0xea80, 0, {0x0e,0xb0,0x03,0xed,0x00,0xcb,0x50,0x3e,0x40,0x8c,0xb0,0x43,0x2c,0x10,0xf9,0x00 }},
+ {16, 0xea90, 0, {0x32,0x60,0x0c,0x40,0x0b,0x26,0x00,0xc3,0x04,0x36,0xc0,0x0c,0x30,0x03,0x2c,0x00 }},
+ {16, 0xeaa0, 0, {0x9b,0x00,0xb0,0xc0,0x0c,0xb0,0x03,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeab0, 0, {0xc8,0x05,0x0e,0x80,0xbf,0x04,0x2a,0x40,0x00,0xf5,0x00,0xe6,0x00,0x82,0xd2,0x22 }},
+ {16, 0xeac0, 0, {0x40,0x0d,0xf0,0x22,0x3c,0x00,0x95,0x02,0x36,0x40,0x0a,0x80,0x02,0x2e,0x00,0x8f }},
+ {16, 0xead0, 0, {0x00,0x37,0xc0,0x0a,0xf0,0x42,0x3c,0x00,0x8f,0x00,0x23,0xc0,0x28,0xf0,0x02,0xf2 }},
+ {16, 0xeae0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4e,0x00,0xb3,0x00,0x22,0x20 }},
+ {16, 0xeaf0, 0, {0x4a,0x30,0x00,0xcc,0x00,0x81,0xc0,0x28,0x00,0x08,0x30,0x02,0x0c,0x10,0xa1,0x00 }},
+ {16, 0xeb00, 0, {0x28,0x80,0x18,0x30,0x22,0x04,0x04,0x83,0x00,0x24,0xc0,0x08,0x30,0x02,0xcc,0x08 }},
+ {16, 0xeb10, 0, {0x93,0x00,0x20,0xc0,0x08,0x30,0x06,0xf8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeb20, 0, {0x20,0x01,0x1e,0x00,0xb7,0x80,0x29,0xa0,0x08,0x78,0x02,0xfe,0x20,0x8d,0x80,0x29 }},
+ {16, 0xeb30, 0, {0xe5,0x5b,0x38,0x42,0x1e,0x40,0xa1,0x81,0x25,0xa8,0x08,0x79,0x02,0x37,0x00,0x87 }},
+ {16, 0xeb40, 0, {0x80,0x25,0xe0,0x0a,0x78,0x0a,0xde,0x81,0x87,0x80,0x25,0xe5,0x48,0x78,0x02,0xc8 }},
+ {16, 0xeb50, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0xb3,0x10,0x30,0x12 }},
+ {16, 0xeb60, 0, {0x0e,0x30,0x12,0xcc,0xc0,0xc3,0x00,0x38,0x80,0x0c,0x31,0x06,0x0c,0x40,0xf1,0x00 }},
+ {16, 0xeb70, 0, {0x38,0x80,0x0c,0x30,0x43,0x04,0x42,0xc3,0x00,0x36,0xc0,0x0c,0x32,0x03,0xce,0xc0 }},
+ {16, 0xeb80, 0, {0xdb,0x00,0x30,0xc0,0x0c,0x30,0x03,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeb90, 0, {0x40,0x1d,0xbc,0x00,0xff,0x10,0x3d,0x84,0x4f,0xf1,0x03,0xd0,0x40,0xfc,0x10,0x33 }},
+ {16, 0xeba0, 0, {0x80,0x5d,0xb1,0x83,0xfc,0x50,0xdd,0x0a,0x25,0x89,0x0f,0xb8,0x03,0xd4,0x00,0xff }},
+ {16, 0xebb0, 0, {0x10,0x3f,0xc0,0x0f,0xf4,0x03,0x3c,0x40,0xff,0x00,0x3b,0xc0,0x0f,0xf0,0x03,0xd0 }},
+ {16, 0xebc0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x00,0xfb,0x20,0x3e,0x00 }},
+ {16, 0xebd0, 0, {0x0f,0xb5,0x03,0x29,0x20,0xf9,0x00,0x32,0xa0,0x0c,0xb0,0x83,0xec,0x00,0x49,0xc8 }},
+ {16, 0xebe0, 0, {0xb2,0xc0,0x8c,0xa0,0x03,0x64,0x00,0xfb,0x08,0x12,0xea,0x0c,0xb0,0x0b,0x2c,0x80 }},
+ {16, 0xebf0, 0, {0xfb,0x20,0x2e,0xd2,0x6c,0xb6,0x43,0xea,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xec00, 0, {0x48,0x11,0x9c,0x00,0xb7,0x49,0x2d,0x00,0x0b,0x30,0x82,0x10,0x01,0xb5,0x02,0x83 }},
+ {16, 0xec10, 0, {0xc0,0x1a,0x72,0x22,0xdd,0x41,0x85,0x00,0x61,0xc0,0x18,0x20,0x20,0x14,0x00,0xbf }},
+ {16, 0xec20, 0, {0x40,0x35,0xd0,0x0d,0x34,0x02,0x1d,0x20,0xb7,0x28,0x25,0xc1,0x08,0x74,0x82,0xd2 }},
+ {16, 0xec30, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x04,0x37,0xa0,0x2d,0x20 }},
+ {16, 0xec40, 0, {0x0b,0x7a,0x12,0x16,0x01,0xb3,0x80,0x21,0xe2,0x08,0x78,0x42,0x9e,0x00,0x85,0x80 }},
+ {16, 0xec50, 0, {0x20,0xe1,0x18,0x68,0x02,0x56,0x00,0xb7,0xa0,0x25,0xe0,0x08,0x7a,0x02,0x1e,0x00 }},
+ {16, 0xec60, 0, {0xb7,0x90,0x2c,0xe5,0x88,0x7a,0x02,0xf0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xec70, 0, {0x48,0x14,0xcc,0x00,0xb3,0x00,0x6c,0x24,0x1b,0x30,0x02,0x00,0x00,0xb0,0x00,0x20 }},
+ {16, 0xec80, 0, {0xf8,0x0a,0x30,0x02,0xcc,0x00,0x81,0x00,0x20,0xd8,0x18,0x20,0x02,0x04,0x00,0xb3 }},
+ {16, 0xec90, 0, {0x00,0x24,0xc0,0x09,0x30,0x02,0x0c,0x00,0xb3,0x00,0x26,0xc0,0x08,0x30,0x02,0xd2 }},
+ {16, 0xeca0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x00,0xfa,0x00,0x3d,0x80 }},
+ {16, 0xecb0, 0, {0x0f,0x20,0x0b,0x28,0x80,0xfe,0x00,0x33,0xa0,0x0c,0xa0,0x03,0xe8,0x02,0xca,0x02 }},
+ {16, 0xecc0, 0, {0x32,0x90,0x2c,0xe4,0x03,0x78,0x00,0xfa,0x00,0x32,0x80,0x0c,0xa0,0x03,0x28,0x00 }},
+ {16, 0xecd0, 0, {0xfa,0x00,0x3e,0x80,0x0c,0xa0,0x03,0xfa,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xece0, 0, {0x48,0x00,0xe1,0x00,0xf0,0x00,0x3e,0x00,0x4f,0x80,0x03,0xe0,0x80,0xf8,0x00,0x3e }},
+ {16, 0xecf0, 0, {0x00,0x0f,0x80,0x23,0xc0,0x00,0xf8,0x02,0x3c,0x00,0x0f,0xc0,0x83,0x60,0x00,0xb8 }},
+ {16, 0xed00, 0, {0x00,0x3e,0x00,0x0f,0x80,0x23,0xe0,0x18,0xf8,0x01,0x36,0x00,0x0f,0x80,0x03,0xd2 }},
+ {16, 0xed10, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe6,0x00,0xf9,0x21,0x32,0x60 }},
+ {16, 0xed20, 0, {0x0c,0x90,0x03,0x2c,0x44,0xf9,0x00,0xb2,0x40,0x0f,0x90,0x1b,0x24,0x00,0xe9,0x00 }},
+ {16, 0xed30, 0, {0x3e,0x40,0x0c,0x10,0x03,0xa4,0x00,0xf9,0x00,0x32,0x40,0x0f,0x10,0x33,0x24,0x10 }},
+ {16, 0xed40, 0, {0xf1,0x00,0x32,0x40,0x0c,0x90,0x03,0x02,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xed50, 0, {0x80,0x04,0x64,0x00,0xb9,0x40,0xa2,0x41,0x08,0x90,0x02,0x24,0x80,0xe9,0x00,0x22 }},
+ {16, 0xed60, 0, {0x40,0x0b,0x90,0x12,0x24,0x00,0x89,0x00,0x6e,0x41,0x18,0x90,0x42,0x24,0x00,0xb9 }},
+ {16, 0xed70, 0, {0x04,0x2a,0x41,0x0b,0x90,0x03,0x64,0x00,0xf9,0x00,0x2a,0x40,0x0a,0x90,0x0a,0x20 }},
+ {16, 0xed80, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0x24,0x80,0xb9,0x42,0x62,0x48 }},
+ {16, 0xed90, 0, {0x28,0x90,0x0a,0x24,0x00,0xb1,0x00,0x22,0x40,0x0b,0x10,0x02,0x24,0x10,0xb9,0x02 }},
+ {16, 0xeda0, 0, {0x2e,0x40,0x08,0xd0,0x02,0xa4,0x00,0xb1,0x00,0x22,0x40,0x0b,0x90,0x02,0x24,0x04 }},
+ {16, 0xedb0, 0, {0xb9,0x00,0x22,0x40,0x08,0x10,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xedc0, 0, {0x08,0x04,0x0c,0x00,0xb1,0x20,0x60,0x40,0x08,0x12,0x02,0x04,0x00,0xa1,0x20,0x20 }},
+ {16, 0xedd0, 0, {0x40,0x0b,0x12,0x02,0x04,0x80,0x91,0x20,0x2d,0x68,0x08,0x52,0x12,0x04,0x00,0xb1 }},
+ {16, 0xede0, 0, {0x28,0x28,0x4a,0x09,0x12,0x82,0x44,0xa0,0xb1,0x2c,0x28,0x4a,0x0a,0x12,0x82,0x02 }},
+ {16, 0xedf0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xf8,0x00,0x32,0x14 }},
+ {16, 0xee00, 0, {0x0c,0x80,0x03,0x20,0x00,0xf8,0x50,0x32,0x14,0x0f,0x85,0x03,0x01,0x40,0xf8,0x00 }},
+ {16, 0xee10, 0, {0x2e,0x00,0x28,0xc0,0x03,0xa0,0x00,0xf8,0x24,0x30,0x08,0x0f,0x82,0x23,0x20,0x80 }},
+ {16, 0xee20, 0, {0xf8,0x20,0x32,0x08,0x0c,0x82,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xee30, 0, {0x98,0x1d,0xe4,0x08,0xf9,0x10,0x3f,0x40,0x8f,0x91,0x13,0xe4,0x00,0xed,0x10,0x3f }},
+ {16, 0xee40, 0, {0x50,0x0f,0x91,0x03,0xe4,0x40,0xa5,0x10,0x3e,0x44,0x0f,0x91,0x03,0xf4,0x04,0xf9 }},
+ {16, 0xee50, 0, {0x28,0x3e,0x4b,0x0b,0x92,0xa3,0xe4,0xa0,0xe9,0x28,0x3e,0x4a,0x0f,0x92,0x83,0xe6 }},
+ {16, 0xee60, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xf4,0x00,0xcd,0x00,0x33,0x40 }},
+ {16, 0xee70, 0, {0x80,0xd0,0x01,0xf4,0x00,0xa5,0x00,0x26,0x40,0x0f,0x90,0x03,0x26,0x00,0xf1,0x88 }},
+ {16, 0xee80, 0, {0x3e,0x68,0x0d,0x98,0x83,0x44,0x00,0xc9,0xc0,0x3a,0x40,0x0c,0x98,0x03,0x24,0x08 }},
+ {16, 0xee90, 0, {0xf9,0xa0,0x32,0x78,0x0f,0x9a,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeea0, 0, {0x38,0x10,0xe0,0x02,0x88,0x00,0xa2,0x00,0x08,0x80,0x02,0xe0,0x00,0x0a,0x00,0x22 }},
+ {16, 0xeeb0, 0, {0x00,0x0b,0x80,0x02,0x20,0x00,0xb8,0x40,0x2e,0x14,0x08,0x80,0x43,0x30,0x00,0x88 }},
+ {16, 0xeec0, 0, {0xa0,0x22,0x2a,0x0a,0x8a,0x42,0xa0,0x05,0xb8,0x42,0x32,0x38,0x0b,0x80,0x02,0x0e }},
+ {16, 0xeed0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x03,0x91,0x00,0x24,0x40 }},
+ {16, 0xeee0, 0, {0x0b,0x10,0x02,0xc4,0x11,0xb1,0x04,0x20,0x41,0x1b,0x10,0x22,0x45,0x00,0xb5,0x00 }},
+ {16, 0xeef0, 0, {0x25,0x40,0x09,0x50,0x02,0x54,0x01,0x81,0x40,0x2c,0x40,0x09,0x14,0x92,0x44,0x00 }},
+ {16, 0xef00, 0, {0xb1,0x40,0x24,0x4c,0x0b,0x14,0x0a,0x42,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xef10, 0, {0x18,0x15,0xa4,0x00,0x99,0x00,0x24,0x42,0x0b,0x90,0x02,0xe4,0x01,0x99,0x20,0x26 }},
+ {16, 0xef20, 0, {0x40,0xcb,0x90,0x02,0x64,0x00,0xbb,0x00,0x2f,0x41,0x0a,0xd0,0x02,0x34,0x00,0x89 }},
+ {16, 0xef30, 0, {0x00,0x26,0x40,0x0b,0x10,0x02,0xe4,0x00,0x31,0x00,0x62,0x40,0x0b,0x90,0x02,0x46 }},
+ {16, 0xef40, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xc4,0x00,0xd9,0x01,0x36,0x50 }},
+ {16, 0xef50, 0, {0x2f,0x90,0x03,0xe6,0x60,0xf9,0x80,0x36,0x52,0x0b,0x90,0x0a,0x64,0x00,0xf9,0x00 }},
+ {16, 0xef60, 0, {0x36,0x40,0x0d,0x90,0x03,0x64,0x02,0x09,0x00,0x3e,0x40,0x0d,0x90,0x03,0x64,0x00 }},
+ {16, 0xef70, 0, {0xb9,0x00,0xb6,0x40,0x0f,0x90,0x03,0x68,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xef80, 0, {0x28,0x01,0xa4,0x00,0xe1,0x00,0x3a,0x41,0x0c,0x90,0x23,0xe6,0x20,0xe9,0x00,0xba }},
+ {16, 0xef90, 0, {0x70,0x0f,0x90,0x03,0xa4,0x00,0xf9,0x00,0x3e,0x40,0x0d,0x10,0x13,0xa7,0x00,0xf9 }},
+ {16, 0xefa0, 0, {0x00,0x3a,0x40,0x0e,0x90,0x43,0xa4,0x08,0xf9,0x00,0x3a,0x40,0x0f,0x90,0x03,0x8a }},
+ {16, 0xefb0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x20,0xf8,0x00,0x32,0x00 }},
+ {16, 0xefc0, 0, {0x0f,0x80,0x83,0x21,0x00,0xf0,0x00,0x3a,0x11,0x09,0x80,0x03,0xe0,0x00,0xc8,0x01 }},
+ {16, 0xefd0, 0, {0x30,0x01,0x0c,0x80,0x03,0xb0,0x00,0xd0,0x00,0x34,0x00,0x0d,0x80,0x03,0x20,0x00 }},
+ {16, 0xefe0, 0, {0xc8,0x00,0x32,0x00,0x0c,0x80,0x03,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeff0, 0, {0x28,0x05,0x38,0x00,0xbe,0x00,0x22,0x80,0x03,0xe8,0x02,0x1a,0x08,0xbe,0x48,0x22 }},
+ {16, 0xf000, 0, {0x80,0x0a,0xa0,0x03,0xb8,0x00,0xca,0x08,0x22,0x80,0x0f,0xa4,0x02,0x08,0x00,0x8a }},
+ {16, 0xf010, 0, {0x00,0x22,0x80,0x8d,0xa0,0x02,0x28,0x00,0xda,0x00,0x2a,0x81,0x08,0xa0,0x02,0x8a }},
+ {16, 0xf020, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x44,0x00,0xb3,0x00,0x20,0x40 }},
+ {16, 0xf030, 0, {0x0b,0x30,0x02,0x08,0x00,0xb0,0x64,0x68,0xc1,0x08,0xb0,0x22,0xcc,0x0c,0x93,0x80 }},
+ {16, 0xf040, 0, {0x00,0xc0,0x48,0x36,0x02,0x88,0x00,0xb3,0x00,0x24,0xc0,0x08,0x30,0x06,0x0c,0x01 }},
+ {16, 0xf050, 0, {0xa3,0x02,0x2c,0xc0,0x08,0xb0,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf060, 0, {0xa0,0x01,0x14,0x08,0xb5,0x00,0x21,0x40,0x0b,0x38,0x82,0x1c,0x21,0xb7,0x00,0x23 }},
+ {16, 0xf070, 0, {0xe8,0x4a,0x72,0x26,0x9e,0x40,0x8f,0x81,0xab,0x40,0x42,0x70,0x52,0x38,0x00,0xa3 }},
+ {16, 0xf080, 0, {0x22,0x20,0xc4,0x49,0x31,0x02,0x1e,0x0a,0xb7,0x22,0x2d,0xe8,0x08,0x72,0x02,0xa8 }},
+ {16, 0xf090, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x12,0x00,0xf6,0x80,0x21,0xe0 }},
+ {16, 0xf0a0, 0, {0x0b,0x78,0x0b,0x1e,0x00,0xb4,0x82,0x3b,0xe8,0x4c,0x7c,0x13,0xfe,0x02,0x97,0x80 }},
+ {16, 0xf0b0, 0, {0x33,0xa0,0x08,0x38,0x03,0x9a,0x00,0xf7,0x88,0x35,0xe2,0x0c,0x78,0xe3,0x0e,0x00 }},
+ {16, 0xf0c0, 0, {0xe3,0xe8,0x34,0xf8,0x0c,0x3c,0x23,0x2a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf0d0, 0, {0x08,0x1d,0xa8,0x04,0xf1,0x00,0x3e,0x42,0x0f,0xb0,0x13,0xec,0x00,0xfb,0x00,0xbe }},
+ {16, 0xf0e0, 0, {0xcc,0x1e,0xb6,0x07,0xed,0x80,0xfb,0x00,0x36,0x00,0x0f,0xb0,0x43,0x68,0x00,0xcb }},
+ {16, 0xf0f0, 0, {0x30,0x3e,0xd8,0x0f,0xb6,0x0b,0xed,0x40,0xcb,0x00,0x3a,0xc0,0x2f,0xb6,0x03,0xc2 }},
+ {16, 0xf100, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xf2,0x40,0xfb,0x91,0x3d,0x4c }},
+ {16, 0xf110, 0, {0x80,0xf8,0x03,0xde,0x40,0xc6,0x80,0x1b,0xf0,0x4f,0xfd,0x07,0xff,0x00,0xcd,0x80 }},
+ {16, 0xf120, 0, {0x33,0xe0,0x0c,0x68,0x03,0xba,0x00,0xff,0x80,0x33,0xe0,0x07,0xf8,0x03,0x3f,0x10 }},
+ {16, 0xf130, 0, {0xcf,0x80,0x3f,0xe0,0x0c,0xfc,0x03,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf140, 0, {0xa8,0x11,0x90,0x00,0xb5,0xc0,0x2d,0x40,0x08,0x62,0x02,0xdc,0x20,0xd6,0x02,0x21 }},
+ {16, 0xf150, 0, {0xc8,0x8f,0x70,0x02,0xdc,0x81,0xb5,0x00,0x81,0x44,0x0d,0x61,0x22,0x18,0x04,0xb7 }},
+ {16, 0xf160, 0, {0x00,0x35,0xc0,0x0b,0x70,0x02,0xbc,0x00,0xa7,0x01,0x2d,0xc0,0x08,0x70,0x03,0xea }},
+ {16, 0xf170, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x01,0xb6,0x01,0x2f,0xc0 }},
+ {16, 0xf180, 0, {0x18,0x70,0x02,0xdc,0x0a,0x96,0x10,0x29,0xc1,0x4b,0x70,0x06,0xdc,0x10,0x85,0x00 }},
+ {16, 0xf190, 0, {0x25,0x80,0x08,0x60,0x82,0x1a,0x20,0xa3,0x00,0x25,0xc0,0x0b,0x31,0x02,0x5c,0x40 }},
+ {16, 0xf1a0, 0, {0x87,0x00,0x2d,0xc0,0x08,0x70,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf1b0, 0, {0x20,0x14,0xc8,0x00,0xb1,0x00,0x2c,0x40,0x88,0x20,0x02,0xed,0x00,0x8a,0x60,0x20 }},
+ {16, 0xf1c0, 0, {0xc0,0x0a,0x30,0x02,0xcc,0x04,0xb1,0x00,0x24,0x00,0x28,0x24,0x02,0x0a,0x00,0x33 }},
+ {16, 0xf1d0, 0, {0x00,0x24,0xc0,0x0b,0xb0,0x02,0xcc,0x00,0xa3,0x00,0x2c,0xc0,0x88,0x30,0x02,0x88 }},
+ {16, 0xf1e0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xa0,0x00,0xfb,0x00,0x3e,0xc6 }},
+ {16, 0xf1f0, 0, {0x0c,0x80,0x03,0xe5,0x00,0x09,0xc8,0xab,0xe2,0x0b,0xf0,0x02,0xfc,0x00,0x4a,0x00 }},
+ {16, 0xf200, 0, {0x36,0xc0,0x08,0x90,0x03,0xa6,0x00,0xff,0x00,0x33,0xc0,0x0f,0xf0,0x03,0x7c,0x00 }},
+ {16, 0xf210, 0, {0x8f,0x00,0x2f,0xc0,0x28,0xf0,0x02,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf220, 0, {0x80,0x00,0xe1,0x00,0xfa,0x01,0x3e,0xc0,0x0f,0x80,0x03,0xec,0x00,0xf9,0x40,0x3e }},
+ {16, 0xf230, 0, {0xc0,0x07,0xb0,0x03,0xec,0x00,0xfa,0x00,0x3a,0x40,0x0f,0x90,0x23,0xe5,0x00,0xfb }},
+ {16, 0xf240, 0, {0x00,0x3e,0xc0,0x0f,0xb0,0x03,0xac,0x00,0xfb,0x00,0x3c,0xc0,0x0f,0xb0,0x23,0xe0 }},
+ {16, 0xf250, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xf0,0x00,0xfc,0x20,0x3f,0xc0 }},
+ {16, 0xf260, 0, {0x0c,0xc8,0x03,0xfc,0x20,0xcd,0x81,0xb3,0xc2,0x4f,0xf0,0x03,0xfc,0x00,0xca,0x00 }},
+ {16, 0xf270, 0, {0x3c,0x80,0x0c,0xd0,0x82,0x36,0x01,0xff,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0x3c,0x08 }},
+ {16, 0xf280, 0, {0xcf,0x04,0x3a,0xc0,0x5c,0xb0,0x03,0xc0,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf290, 0, {0x81,0x04,0x62,0x04,0xb8,0x40,0x2c,0x60,0x08,0x89,0x02,0xee,0x80,0xa9,0x60,0x2a }},
+ {16, 0xf2a0, 0, {0xc0,0x0b,0xb0,0x03,0x8c,0x00,0xaa,0x40,0x2e,0x00,0x08,0x10,0x02,0x26,0x81,0xeb }},
+ {16, 0xf2b0, 0, {0x00,0x26,0xc0,0x8b,0xb0,0x13,0x6c,0x00,0xdb,0x00,0x2e,0xc0,0x3d,0xb0,0x02,0xe0 }},
+ {16, 0xf2c0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x23,0x00,0xbb,0x03,0x2e,0xc8 }},
+ {16, 0xf2d0, 0, {0x09,0xb0,0x02,0xee,0x00,0x8b,0x10,0x26,0xc0,0x0b,0xb0,0x02,0xec,0x00,0xa8,0x00 }},
+ {16, 0xf2e0, 0, {0x2e,0xc0,0x08,0x88,0x22,0xa4,0x80,0xbb,0x00,0x2e,0xc0,0x4b,0xb0,0x22,0x0c,0x00 }},
+ {16, 0xf2f0, 0, {0x8b,0x00,0x2e,0xc0,0x0b,0xb0,0x02,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf300, 0, {0x08,0x04,0x00,0x00,0xb2,0x00,0x2e,0xc0,0x29,0x28,0x02,0xec,0x01,0xa0,0x02,0x20 }},
+ {16, 0xf310, 0, {0xc0,0x09,0x30,0x02,0xcc,0x00,0xa0,0x00,0x2c,0x40,0x08,0x00,0x42,0x84,0x00,0x93 }},
+ {16, 0xf320, 0, {0x00,0x6c,0xc0,0x0b,0x30,0x06,0x4d,0x00,0x93,0x00,0x2c,0xc0,0x08,0x30,0x02,0xc2 }},
+ {16, 0xf330, 0, {0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x60,0x00,0xf8,0x20,0x2f,0xc0 }},
+ {16, 0xf340, 0, {0x0d,0xb0,0x03,0xec,0x00,0xcb,0x00,0x33,0xc0,0x0b,0xf0,0x03,0xfc,0x18,0xe8,0x00 }},
+ {16, 0xf350, 0, {0x2e,0x80,0x08,0x80,0x03,0xa4,0x00,0xbf,0x00,0x3f,0xc0,0x0f,0xf0,0x43,0x3d,0x11 }},
+ {16, 0xf360, 0, {0xcf,0x03,0x3e,0xc1,0x5d,0xf0,0x23,0xc0,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf370, 0, {0xa0,0x1d,0xf0,0x00,0xfc,0x10,0x3f,0x40,0x0e,0xe0,0x03,0xfc,0x00,0xfc,0x00,0x3f }},
+ {16, 0xf380, 0, {0xc0,0x0f,0xf0,0x03,0xbc,0x00,0xfc,0x00,0x3f,0x00,0x2f,0xc0,0x03,0x74,0x00,0xef }},
+ {16, 0xf390, 0, {0x00,0x27,0xc0,0x0f,0xf0,0x03,0xfc,0x18,0xff,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0xe8 }},
+ {16, 0xf3a0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x15,0xfc,0x88,0x9c,0x29,0x3f,0x08 }},
+ {16, 0xf3b0, 0, {0x0f,0xd2,0x83,0xec,0x00,0xff,0x08,0x3f,0x28,0x0f,0xca,0x03,0x3c,0x41,0xcf,0x20 }},
+ {16, 0xf3c0, 0, {0x73,0x2c,0x0c,0xc0,0x03,0x30,0x20,0xcf,0x60,0x33,0xd8,0x0f,0x78,0x03,0x3f,0x80 }},
+ {16, 0xf3d0, 0, {0xdd,0x92,0x33,0xc8,0x0f,0x50,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf3e0, 0, {0x80,0x10,0xe5,0x40,0x88,0x40,0x2e,0x04,0x8b,0x94,0x02,0xe4,0x00,0xb9,0x00,0x0e }},
+ {16, 0xf3f0, 0, {0x7f,0x8f,0x9e,0x83,0x65,0x82,0xcf,0x68,0x3e,0x50,0x8d,0x04,0x92,0x2f,0x04,0xd3 }},
+ {16, 0xf400, 0, {0x40,0x74,0xdc,0x0d,0xa2,0x02,0x20,0x40,0x89,0x00,0x22,0xf0,0x0b,0x98,0x02,0x20 }},
+ {16, 0xf410, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xc8,0x09,0xa0,0x85,0x2c,0x01 }},
+ {16, 0xf420, 0, {0x0b,0x00,0x10,0xcc,0x40,0xa2,0x08,0x2c,0x00,0xdb,0x11,0x02,0x89,0x00,0x93,0x30 }},
+ {16, 0xf430, 0, {0x20,0x05,0x08,0x13,0x02,0x80,0x08,0xa3,0x60,0x60,0xc0,0x0a,0xb0,0x82,0x08,0x84 }},
+ {16, 0xf440, 0, {0x81,0x20,0x20,0xd0,0x0b,0x10,0x02,0xa2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf450, 0, {0xc0,0x15,0xa4,0x12,0x88,0x80,0x6e,0x20,0x0b,0x88,0x82,0xee,0x00,0xba,0x81,0x2e }},
+ {16, 0xf460, 0, {0x60,0x5a,0x98,0x02,0xa2,0x00,0x8b,0x00,0x2a,0x60,0x08,0x11,0x1a,0x2c,0x00,0xbb }},
+ {16, 0xf470, 0, {0x00,0x22,0xc0,0x08,0xb8,0x0a,0x28,0x00,0x81,0x20,0x02,0xc0,0x0b,0x90,0x02,0xb0 }},
+ {16, 0xf480, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xed,0x00,0xd9,0x80,0x3e,0x20 }},
+ {16, 0xf490, 0, {0x4f,0x98,0x00,0xeb,0x20,0xfb,0xe0,0x2e,0x60,0x0b,0x8c,0x62,0xae,0x20,0x8b,0x00 }},
+ {16, 0xf4a0, 0, {0x22,0x60,0x08,0xbc,0x03,0xa0,0x20,0xeb,0x00,0x22,0xc1,0x0a,0x18,0x0b,0x25,0x00 }},
+ {16, 0xf4b0, 0, {0xd9,0x00,0xb2,0xc0,0x0f,0x90,0x0b,0x90,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf4c0, 0, {0xe0,0x01,0x94,0x88,0xff,0x00,0x3f,0x01,0x0f,0xd0,0x01,0xf0,0x08,0xdd,0x01,0x3f }},
+ {16, 0xf4d0, 0, {0x42,0x07,0x40,0x03,0x5c,0x00,0xaf,0x00,0x3f,0x40,0x0f,0xf8,0x00,0xf0,0x00,0xdf }},
+ {16, 0xf4e0, 0, {0x00,0x3f,0xc0,0x0f,0xc0,0x23,0xf4,0x50,0xfd,0x80,0x3f,0xc0,0x0f,0xd0,0x03,0x78 }},
+ {16, 0xf4f0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0xac,0x00,0xd9,0x00,0x3e,0x40 }},
+ {16, 0xf500, 0, {0x0f,0x94,0x03,0xa8,0x20,0xca,0x40,0x3a,0x40,0x0f,0x94,0x03,0xea,0x08,0xfb,0x00 }},
+ {16, 0xf510, 0, {0x3a,0x00,0x4c,0xf6,0x23,0x2c,0x30,0xcb,0x00,0x36,0xc0,0x0d,0x90,0x03,0xa1,0x02 }},
+ {16, 0xf520, 0, {0xd9,0x00,0xba,0xc0,0x0f,0x98,0x03,0x10,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf530, 0, {0xc8,0x05,0x24,0x00,0x8a,0x00,0x2e,0x40,0x0b,0x95,0x02,0xe0,0x08,0x88,0x80,0x22 }},
+ {16, 0xf540, 0, {0x70,0x8f,0x8c,0x02,0xe0,0x00,0xbf,0x02,0x20,0x00,0x08,0xb8,0x02,0x0e,0x00,0xdf }},
+ {16, 0xf550, 0, {0x00,0x23,0xdd,0x08,0x98,0x82,0x2a,0x00,0x89,0x80,0x23,0xc0,0x0b,0x50,0x1a,0x32 }},
+ {16, 0xf560, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x44,0x00,0x83,0x05,0x24,0x41 }},
+ {16, 0xf570, 0, {0x09,0x10,0x02,0xce,0x00,0x83,0x90,0x2c,0x80,0x1b,0x24,0x82,0xcc,0x00,0xbb,0x00 }},
+ {16, 0xf580, 0, {0x2c,0x80,0x08,0x04,0x08,0x04,0x01,0x8b,0x00,0x22,0xc0,0x28,0x12,0x02,0x6c,0x80 }},
+ {16, 0xf590, 0, {0x81,0x48,0x24,0xc4,0x0b,0x10,0x02,0x38,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf5a0, 0, {0x20,0x01,0x3e,0x42,0x86,0x80,0x2d,0x60,0x0b,0x68,0x02,0xf6,0x90,0x8d,0x80,0x21 }},
+ {16, 0xf5b0, 0, {0x22,0x0b,0x58,0x02,0xd7,0x40,0xb7,0x90,0x21,0xe0,0x08,0x49,0x92,0x1e,0x53,0x97 }},
+ {16, 0xf5c0, 0, {0x81,0x21,0xe0,0x48,0xc8,0x0a,0x52,0x22,0x85,0x88,0x25,0xe0,0x0b,0x58,0x02,0x08 }},
+ {16, 0xf5d0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0x83,0x00,0x34,0xc0 }},
+ {16, 0xf5e0, 0, {0x0f,0x00,0x03,0xce,0x20,0xc3,0x30,0x7c,0x94,0x0b,0x34,0x83,0xcc,0x14,0xf3,0x02 }},
+ {16, 0xf5f0, 0, {0x3c,0x80,0x0c,0x04,0x03,0x04,0x60,0xc3,0x00,0xb0,0xc0,0x0c,0x10,0x03,0xec,0x00 }},
+ {16, 0xf600, 0, {0xc9,0x00,0x3c,0xc4,0x0f,0x11,0x03,0x12,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf610, 0, {0x40,0x1d,0x9c,0x00,0xee,0x01,0x3f,0xc0,0x4f,0xe1,0x03,0xd4,0x40,0xf5,0x16,0x7a }},
+ {16, 0xf620, 0, {0xc0,0x4e,0xf0,0x03,0xf4,0x10,0x37,0x05,0x3d,0xc0,0x0f,0xc0,0x0b,0xdc,0x40,0xff }},
+ {16, 0xf630, 0, {0x00,0x3b,0xc2,0x0e,0xd0,0x07,0xbc,0x02,0xef,0x00,0x3b,0xc6,0x0f,0xd0,0x03,0xd0 }},
+ {16, 0xf640, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xf4,0x00,0xdd,0x84,0x33,0x80 }},
+ {16, 0xf650, 0, {0x04,0xf0,0x03,0x6c,0x02,0xcb,0x02,0x7e,0xc0,0x1f,0xa0,0x53,0xec,0x00,0xcb,0x20 }},
+ {16, 0xf660, 0, {0x34,0x40,0x0c,0xd0,0x0b,0x20,0x10,0xeb,0x00,0x1e,0xe0,0x0f,0x30,0x0b,0x2c,0x00 }},
+ {16, 0xf670, 0, {0xc1,0x00,0x32,0xc0,0x0f,0x91,0x03,0xea,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf680, 0, {0x48,0x11,0x9c,0x00,0x87,0x00,0x21,0x80,0x08,0x60,0x00,0x14,0x00,0x85,0x00,0x2d }},
+ {16, 0xf690, 0, {0x80,0x0b,0x70,0x52,0xd4,0x04,0x83,0x28,0x29,0xc0,0x28,0x50,0x03,0x50,0x00,0x87 }},
+ {16, 0xf6a0, 0, {0x40,0x25,0xc8,0x0f,0x60,0x02,0x04,0x00,0xa7,0x00,0x3d,0xc8,0x0b,0x52,0x02,0xd2 }},
+ {16, 0xf6b0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x8e,0x00,0x95,0x80,0x21,0xe0 }},
+ {16, 0xf6c0, 0, {0x09,0x38,0x02,0x1e,0x11,0xa7,0x80,0x2d,0xf0,0x0b,0x78,0x52,0xce,0x0a,0x97,0x95 }},
+ {16, 0xf6d0, 0, {0x21,0xe0,0x19,0x5c,0x02,0x0e,0x00,0xa7,0x80,0x29,0xc8,0x0b,0xf8,0x02,0x1e,0x20 }},
+ {16, 0xf6e0, 0, {0x8d,0x80,0x21,0xe0,0x0b,0x58,0x02,0xf0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf6f0, 0, {0x48,0x14,0xcc,0x00,0x82,0xe0,0xa0,0xe8,0x29,0x30,0x06,0x0e,0x50,0xab,0x80,0x2c }},
+ {16, 0xf700, 0, {0xf0,0x0b,0x31,0x42,0xcc,0x00,0x93,0x00,0x28,0xc4,0x09,0x98,0x02,0x4c,0x28,0x83 }},
+ {16, 0xf710, 0, {0x00,0x24,0xc0,0x0a,0xb0,0x02,0x0d,0x00,0xa2,0x58,0x28,0xc0,0x0b,0x10,0x02,0xd2 }},
+ {16, 0xf720, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xb9,0x00,0xde,0x80,0x31,0xa0 }},
+ {16, 0xf730, 0, {0x09,0xe2,0x0b,0x78,0x04,0xee,0xa4,0x2f,0xa4,0x8b,0xec,0x02,0xd8,0x00,0xda,0x00 }},
+ {16, 0xf740, 0, {0x27,0x81,0x0d,0xec,0x06,0x1b,0x00,0xea,0x04,0x3e,0x80,0x0b,0xe0,0x03,0x3b,0x00 }},
+ {16, 0xf750, 0, {0xce,0xc0,0x22,0x80,0x0f,0xa0,0x03,0xfa,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf760, 0, {0x48,0x00,0xe0,0x80,0xf8,0x10,0x3e,0x05,0x0e,0x88,0x03,0xe0,0x08,0x98,0x40,0x3e }},
+ {16, 0xf770, 0, {0x00,0x0f,0x84,0x83,0xe1,0x40,0xe8,0x00,0x3a,0x02,0x0e,0x80,0x43,0xe1,0x40,0xf8 }},
+ {16, 0xf780, 0, {0x00,0x36,0x00,0x0f,0x80,0x03,0xe0,0x20,0xf8,0x00,0x3e,0x00,0x0f,0x80,0x03,0xd2 }},
+ {16, 0xf790, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xc4,0x00,0xe9,0x00,0x3e,0x40 }},
+ {16, 0xf7a0, 0, {0x0c,0x90,0x03,0x04,0x20,0xe9,0x90,0x32,0x68,0x0e,0x98,0x03,0xa4,0x00,0xc1,0x00 }},
+ {16, 0xf7b0, 0, {0x30,0x40,0x0c,0x94,0x83,0x24,0x08,0xc9,0x00,0x3e,0x40,0x0c,0x90,0x03,0xa4,0x00 }},
+ {16, 0xf7c0, 0, {0xc9,0x00,0x30,0x50,0x0c,0x1a,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf7d0, 0, {0x80,0x04,0x64,0x00,0x89,0x40,0x2e,0x50,0x28,0x90,0x0a,0x24,0x08,0x89,0x06,0x16 }},
+ {16, 0xf7e0, 0, {0x61,0x0b,0x9c,0x02,0xe4,0x20,0xa9,0x00,0x36,0x40,0x0d,0x90,0x02,0x27,0x60,0xa9 }},
+ {16, 0xf7f0, 0, {0x00,0x2e,0x40,0x28,0x90,0x1a,0x24,0x00,0x89,0x00,0x36,0x40,0x28,0x98,0x02,0x20 }},
+ {16, 0xf800, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x2c,0x00,0xa9,0x08,0x2e,0xc2 }},
+ {16, 0xf810, 0, {0x09,0x10,0x00,0x24,0x00,0xa9,0x00,0x06,0x40,0x89,0x96,0x06,0xe6,0x00,0x89,0x00 }},
+ {16, 0xf820, 0, {0x22,0xc0,0x08,0x90,0x02,0x24,0x02,0x89,0x00,0x24,0x40,0x08,0x90,0x02,0x0c,0x06 }},
+ {16, 0xf830, 0, {0x83,0x00,0x22,0x40,0x08,0x90,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf840, 0, {0x08,0x04,0x05,0x00,0x81,0x44,0x2c,0x50,0x08,0x14,0x02,0x05,0x80,0x81,0x20,0x64 }},
+ {16, 0xf850, 0, {0x70,0x1b,0x14,0x02,0xe4,0x80,0xa1,0x20,0x64,0x40,0x19,0x12,0x0a,0x04,0x80,0xa1 }},
+ {16, 0xf860, 0, {0x00,0x2c,0x50,0x18,0x14,0x02,0x85,0x00,0x81,0x40,0x24,0x40,0x40,0x10,0x02,0x02 }},
+ {16, 0xf870, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xe0,0x00,0x3c,0x00 }},
+ {16, 0xf880, 0, {0x0d,0x80,0x02,0x00,0x00,0xaa,0x50,0x36,0x00,0x0f,0x80,0x03,0xe1,0x40,0xc8,0x52 }},
+ {16, 0xf890, 0, {0x72,0x14,0x0c,0x05,0x16,0x20,0x08,0xc8,0x50,0x3e,0x01,0x0c,0x80,0x03,0xa0,0x04 }},
+ {16, 0xf8a0, 0, {0xc8,0x00,0xb2,0x00,0x0c,0x80,0x0b,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf8b0, 0, {0x98,0x19,0xf5,0x02,0xfd,0x40,0x3f,0xd0,0x0f,0xd4,0x23,0xf4,0x44,0xfd,0x14,0x7f }},
+ {16, 0xf8c0, 0, {0x50,0x0f,0xd4,0x07,0xf4,0x40,0xf9,0x10,0x3f,0x50,0x07,0xd1,0x23,0xf4,0x40,0xf9 }},
+ {16, 0xf8d0, 0, {0x40,0x1e,0x50,0x07,0xd0,0x0b,0x75,0x00,0xfd,0x02,0x3e,0x50,0x0f,0xd4,0x03,0xe6 }},
+ {16, 0xf8e0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xf6,0x00,0xc9,0xa8,0x3e,0x72 }},
+ {16, 0xf8f0, 0, {0x0f,0x98,0x03,0xe6,0xc0,0xfd,0xa0,0xb3,0x40,0x0f,0xd0,0x03,0x77,0x80,0xcd,0x90 }},
+ {16, 0xf900, 0, {0x7f,0x40,0x0f,0xda,0xa3,0x16,0x90,0xa9,0xc0,0x32,0x60,0x4c,0xb1,0x03,0x24,0x00 }},
+ {16, 0xf910, 0, {0xc1,0x00,0x33,0x6a,0x0b,0xda,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf920, 0, {0x38,0x10,0xe3,0x40,0x88,0xe0,0x2e,0x30,0x0b,0x8d,0x02,0xf3,0x40,0xb8,0xe8,0x76 }},
+ {16, 0xf930, 0, {0x00,0x4f,0x80,0x0a,0x22,0x80,0x88,0x90,0x6e,0x28,0x8f,0x8a,0x03,0x61,0x44,0xf8 }},
+ {16, 0xf940, 0, {0xe1,0x3e,0x2a,0x08,0x88,0x03,0x42,0xa0,0xdc,0xa0,0x3e,0x10,0x0b,0x85,0x0a,0x0e }},
+ {16, 0xf950, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0xa0,0x85,0x08,0x2d,0x48 }},
+ {16, 0xf960, 0, {0x1b,0x52,0x82,0xd4,0x80,0xb1,0x14,0x20,0x40,0x0b,0x18,0x02,0x05,0x82,0x81,0x00 }},
+ {16, 0xf970, 0, {0x6c,0x42,0x0b,0x12,0x82,0x04,0x00,0xa1,0x60,0x21,0x50,0x0b,0x50,0x02,0x14,0x90 }},
+ {16, 0xf980, 0, {0x95,0x2c,0x28,0x40,0x0b,0x10,0x02,0x02,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf990, 0, {0x18,0x15,0xa4,0x01,0x8d,0x44,0x2f,0x40,0x0b,0xd4,0x02,0xf4,0x04,0xb9,0x08,0x22 }},
+ {16, 0xf9a0, 0, {0x40,0x0a,0x92,0x02,0x2c,0x84,0x89,0x00,0x2e,0x40,0x0a,0x14,0x02,0x6c,0x80,0xa9 }},
+ {16, 0xf9b0, 0, {0x01,0x2a,0x40,0x09,0x50,0x0a,0x5c,0x02,0x8d,0x60,0x2a,0x40,0x0b,0x90,0x42,0x06 }},
+ {16, 0xf9c0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe6,0x62,0xc9,0x02,0x3e,0x54 }},
+ {16, 0xf9d0, 0, {0x0f,0x90,0x03,0xe4,0x00,0xf9,0x40,0x22,0x46,0x0b,0x98,0x03,0x67,0x20,0xc9,0x01 }},
+ {16, 0xf9e0, 0, {0x2e,0x69,0x0b,0x94,0x0b,0x25,0x20,0xa9,0x00,0x22,0x40,0x2d,0x92,0x0a,0x26,0x22 }},
+ {16, 0xf9f0, 0, {0x99,0x00,0x2a,0x40,0x8f,0x90,0x03,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfa00, 0, {0x28,0x01,0x86,0x02,0xf9,0x00,0x3e,0x40,0x0f,0x90,0x03,0xe6,0x80,0xf1,0xa0,0x3e }},
+ {16, 0xfa10, 0, {0x62,0x0f,0x98,0x83,0xc6,0x20,0xf9,0x00,0x3e,0x49,0x0f,0x90,0x83,0xe4,0x00,0x71 }},
+ {16, 0xfa20, 0, {0x02,0x3e,0x40,0x0e,0x90,0x0b,0xe6,0x80,0xf9,0x80,0x3e,0x40,0x0f,0x90,0x03,0xca }},
+ {16, 0xfa30, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x10,0xc8,0x00,0x3e,0x00 }},
+ {16, 0xfa40, 0, {0x4f,0x80,0x43,0xb0,0x00,0xc8,0x41,0x32,0x00,0x0f,0x80,0x03,0x21,0x02,0xc8,0x02 }},
+ {16, 0xfa50, 0, {0x3e,0x10,0x4c,0x80,0x03,0x01,0x20,0xc8,0x00,0x3b,0x00,0x0c,0xc0,0x03,0xb0,0x00 }},
+ {16, 0xfa60, 0, {0xcc,0x04,0x32,0x00,0x0f,0x80,0x03,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfa70, 0, {0x28,0x05,0x28,0x00,0x8a,0x80,0x2e,0x80,0x0b,0xa0,0x02,0xf8,0x04,0x8e,0x00,0x23 }},
+ {16, 0xfa80, 0, {0xb2,0x0e,0xe0,0x82,0xf9,0x04,0x8a,0x00,0x2e,0x81,0x0c,0xe0,0x0a,0x3a,0x80,0xda }},
+ {16, 0xfa90, 0, {0x00,0x22,0xb6,0x08,0xa0,0x02,0x28,0x00,0x8e,0x00,0x2a,0x80,0x0b,0x60,0x0b,0x0a }},
+ {16, 0xfaa0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x44,0x02,0x93,0x81,0x2c,0xc0 }},
+ {16, 0xfab0, 0, {0x4b,0x30,0x02,0xc8,0x00,0x83,0xca,0x20,0xe0,0x19,0xb0,0x06,0x8c,0x00,0x81,0x04 }},
+ {16, 0xfac0, 0, {0x44,0x40,0x08,0x34,0x02,0x0d,0x00,0x83,0x00,0x2a,0x00,0x08,0x00,0x0a,0x80,0x40 }},
+ {16, 0xfad0, 0, {0x88,0x00,0x20,0xc0,0x0b,0x30,0x02,0x4b,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfae0, 0, {0xa0,0x01,0x04,0x02,0x97,0x08,0x2d,0xc0,0x0b,0x60,0x06,0xca,0x00,0x83,0x09,0x21 }},
+ {16, 0xfaf0, 0, {0xc0,0x0a,0x70,0x02,0xdc,0x00,0x85,0x31,0x2d,0x68,0x09,0x30,0x02,0x1c,0x14,0x93 }},
+ {16, 0xfb00, 0, {0x20,0x20,0xc0,0x08,0xf0,0x42,0x9c,0x02,0x8f,0x00,0x29,0x40,0x03,0x70,0x12,0x28 }},
+ {16, 0xfb10, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x16,0x00,0x96,0x84,0x3d,0xa0 }},
+ {16, 0xfb20, 0, {0x0f,0x78,0x03,0x9a,0x02,0x87,0x80,0xb1,0xe0,0x0b,0x78,0x03,0xb6,0x00,0xc5,0xa0 }},
+ {16, 0xfb30, 0, {0x35,0x61,0x0c,0x78,0x13,0x1e,0x02,0xc7,0x80,0x29,0x00,0x0c,0x48,0x03,0x90,0x00 }},
+ {16, 0xfb40, 0, {0xc4,0x80,0x31,0x60,0x0f,0x58,0x03,0x6a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfb50, 0, {0x08,0x1d,0xa4,0x00,0xea,0x00,0x3e,0x80,0x0f,0xa0,0x03,0xe8,0x08,0xfb,0x00,0x3e }},
+ {16, 0xfb60, 0, {0x80,0x0f,0x90,0x13,0xe4,0x08,0xf9,0x00,0x3c,0x50,0x2e,0xf0,0x03,0xe8,0x08,0xfb }},
+ {16, 0xfb70, 0, {0x40,0x3e,0xc0,0x0b,0x30,0x13,0x6c,0x00,0xfb,0x00,0x3e,0x40,0x0f,0x30,0x03,0xc2 }},
+ {16, 0xfb80, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xd6,0x00,0xcd,0x80,0x33,0xe0 }},
+ {16, 0xfb90, 0, {0x0c,0xf8,0x03,0xfa,0x00,0xfd,0x80,0x3f,0xa0,0x0d,0xf8,0x03,0xfa,0x40,0xcd,0xd0 }},
+ {16, 0xfba0, 0, {0x77,0x7e,0x0c,0xe8,0x43,0x1e,0x00,0xcf,0xd8,0x3f,0xe0,0x0c,0xc8,0x03,0x3a,0xc4 }},
+ {16, 0xfbb0, 0, {0xcc,0x80,0x33,0xe0,0x0c,0xf8,0x03,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfbc0, 0, {0xa8,0x11,0x94,0x02,0x8d,0x00,0x21,0xc0,0x08,0x60,0x03,0xd8,0x10,0x35,0x20,0x8b }},
+ {16, 0xfbd0, 0, {0xd4,0x0d,0x64,0x03,0xd8,0xc0,0x85,0x00,0x2f,0x4e,0x07,0x64,0x02,0x9c,0x02,0xd7 }},
+ {16, 0xfbe0, 0, {0x30,0x2f,0x04,0x0d,0xf1,0x0b,0x54,0x40,0xaf,0x00,0x35,0x40,0x08,0x70,0x02,0x2a }},
+ {16, 0xfbf0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0x40,0x84,0x18,0x21,0x80 }},
+ {16, 0xfc00, 0, {0x08,0x70,0x02,0xda,0x20,0xb5,0x00,0x09,0x00,0x08,0x70,0x02,0xd4,0x04,0x85,0x00 }},
+ {16, 0xfc10, 0, {0x6d,0x4c,0x89,0x60,0x02,0x5c,0x40,0x97,0x00,0x6d,0xc0,0x09,0x40,0x02,0x58,0x80 }},
+ {16, 0xfc20, 0, {0x84,0x88,0x25,0x40,0x08,0xd0,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfc30, 0, {0x20,0x14,0xc6,0x48,0x80,0x00,0x20,0x80,0x08,0xac,0x02,0xa8,0x00,0xb1,0x00,0xa8 }},
+ {16, 0xfc40, 0, {0x88,0x09,0x22,0x02,0x86,0x42,0x81,0x00,0x6c,0x52,0x0b,0x20,0x02,0xc7,0x52,0x83 }},
+ {16, 0xfc50, 0, {0x00,0x2c,0x00,0x08,0x34,0x82,0x67,0x00,0xa3,0x80,0x20,0x40,0x08,0x30,0x02,0x08 }},
+ {16, 0xfc60, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xa3,0x00,0xcb,0xc0,0xb2,0x40 }},
+ {16, 0xfc70, 0, {0x2c,0x90,0x82,0xe6,0x00,0xbb,0x80,0xbe,0x78,0x08,0x8e,0x02,0xee,0x00,0x8d,0x00 }},
+ {16, 0xfc80, 0, {0x27,0x60,0x0d,0x90,0x0a,0x6f,0x00,0x9f,0x02,0x2e,0x00,0x09,0xb4,0x03,0x67,0x80 }},
+ {16, 0xfc90, 0, {0xca,0x40,0xe4,0xc0,0x0c,0x30,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfca0, 0, {0x80,0x00,0xe0,0x80,0xfb,0x22,0x3e,0x40,0x0f,0x80,0x13,0xe4,0x00,0xfb,0x80,0x3e }},
+ {16, 0xfcb0, 0, {0x40,0x0f,0x90,0x03,0xe5,0x00,0xf9,0x00,0x3e,0x40,0x0e,0x70,0x23,0xac,0x20,0xfb }},
+ {16, 0xfcc0, 0, {0x00,0x3e,0xc0,0x8f,0x80,0x03,0xe9,0x20,0xf9,0x08,0x3e,0x40,0x0f,0xb0,0x13,0xe0 }},
+ {16, 0xfcd0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xf0,0x00,0xc6,0x00,0x32,0x00 }},
+ {16, 0xfce0, 0, {0x0f,0xd1,0x83,0x34,0x40,0xcf,0x00,0x3d,0x40,0x0c,0xd0,0x03,0xde,0x50,0x0d,0x00 }},
+ {16, 0xfcf0, 0, {0x73,0x40,0x0c,0xd1,0x03,0x7c,0x40,0x87,0x02,0xb3,0x00,0x0d,0xf4,0x03,0x24,0x00 }},
+ {16, 0xfd00, 0, {0xce,0x20,0x32,0x40,0x0c,0xd0,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfd10, 0, {0x81,0x04,0x61,0x22,0x8a,0x00,0x22,0x00,0x0b,0x80,0x40,0x25,0x00,0x89,0xc3,0x2e }},
+ {16, 0xfd20, 0, {0x20,0x0a,0x98,0x03,0xa1,0x00,0x89,0x00,0x36,0x40,0x88,0x94,0x02,0x0f,0x01,0xab }},
+ {16, 0xfd30, 0, {0x00,0x32,0xc0,0x08,0x04,0x0a,0x29,0x00,0xa9,0x02,0xa2,0x40,0x0d,0xb0,0x0a,0x20 }},
+ {16, 0xfd40, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x00,0x00,0x89,0x00,0x22,0x61 }},
+ {16, 0xfd50, 0, {0x0b,0x90,0x02,0x25,0x01,0x9b,0x88,0x2e,0x60,0x08,0x88,0x02,0xe8,0x00,0xb1,0x02 }},
+ {16, 0xfd60, 0, {0x24,0x40,0x18,0x90,0x02,0x2c,0x00,0xab,0x01,0x20,0xc1,0x08,0xb4,0x42,0x2c,0x00 }},
+ {16, 0xfd70, 0, {0x82,0x00,0x22,0xc0,0x08,0xb0,0x02,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfd80, 0, {0x08,0x04,0x00,0x00,0x01,0x00,0x20,0x40,0x0b,0x00,0x0a,0x04,0x46,0x83,0x01,0x2c }},
+ {16, 0xfd90, 0, {0x40,0x1a,0x00,0x06,0x80,0x00,0x81,0x00,0x24,0x40,0x08,0x20,0x0a,0x0c,0x01,0xa3 }},
+ {16, 0xfda0, 0, {0x00,0x24,0x00,0x08,0x80,0x02,0x00,0x00,0xa1,0x00,0x20,0x40,0x09,0x30,0x02,0x02 }},
+ {16, 0xfdb0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x60,0x02,0xc8,0x00,0x22,0x00 }},
+ {16, 0xfdc0, 0, {0x0f,0x90,0x02,0x25,0x00,0xda,0x00,0x3e,0x40,0x0c,0x90,0x02,0xcc,0x00,0xfd,0x00 }},
+ {16, 0xfdd0, 0, {0x37,0x40,0x0c,0x10,0x13,0x2c,0x02,0xaf,0x00,0x32,0xc0,0x0d,0xb0,0x03,0x2c,0x00 }},
+ {16, 0xfde0, 0, {0xca,0x00,0x32,0x40,0x4c,0x90,0x0b,0x00,0x01,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfdf0, 0, {0xa0,0x1d,0xf0,0x00,0xfc,0x00,0x3f,0x00,0x07,0xc0,0x03,0xf4,0x1c,0xf4,0x00,0x3f }},
+ {16, 0xfe00, 0, {0x00,0x1f,0xc0,0x23,0xb0,0x02,0x9d,0x01,0x3f,0x40,0x8f,0xc0,0x07,0xfc,0x02,0xff }},
+ {16, 0xfe10, 0, {0x00,0x7b,0x00,0x0f,0xc0,0x03,0xf0,0x00,0xfd,0x00,0x3f,0x40,0x0f,0x70,0x03,0xe8 }},
+ {16, 0xfe20, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfa,0x00,0xcb,0x80,0x3f,0x24 }},
+ {16, 0xfe30, 0, {0x0a,0xc1,0x03,0xfc,0x24,0xcd,0x20,0x37,0x0a,0x0c,0xc2,0x83,0x30,0x80,0xdc,0x02 }},
+ {16, 0xfe40, 0, {0x3f,0xcc,0x0d,0xd9,0x03,0x3c,0x58,0xdf,0x30,0x33,0xc8,0x0d,0xf4,0x23,0x3c,0x40 }},
+ {16, 0xfe50, 0, {0xff,0x00,0x3f,0xc5,0x4f,0xf0,0x23,0xb0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfe60, 0, {0x80,0x00,0xec,0x02,0x0b,0x82,0x2e,0x08,0x0d,0xb7,0x02,0xfd,0x00,0x83,0x18,0x0a }},
+ {16, 0xfe70, 0, {0x58,0x0a,0x84,0xa2,0xa5,0xa0,0x89,0x30,0x22,0x55,0x08,0x12,0x62,0xbd,0x90,0x8f }},
+ {16, 0xfe80, 0, {0x62,0x21,0xd6,0x48,0xf3,0x02,0x3c,0xc5,0xbf,0x48,0x2f,0xd8,0x4b,0xb7,0x02,0xe0 }},
+ {16, 0xfe90, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xec,0x00,0x83,0x00,0x2e,0x89 }},
+ {16, 0xfea0, 0, {0x28,0x00,0x02,0xec,0xa0,0x89,0x22,0x28,0x82,0x08,0x12,0x02,0x28,0x40,0x9a,0x08 }},
+ {16, 0xfeb0, 0, {0x28,0xc8,0x88,0xb2,0x0a,0x0d,0x10,0x93,0x10,0xa0,0xc8,0x28,0x30,0x02,0x4c,0x00 }},
+ {16, 0xfec0, 0, {0xb3,0x60,0x2c,0xc4,0x0b,0x30,0xc2,0xe2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfed0, 0, {0xc0,0x15,0xac,0x40,0x8b,0x00,0x2e,0x80,0x08,0xb1,0x02,0xec,0x02,0x8b,0x00,0x20 }},
+ {16, 0xfee0, 0, {0xd0,0x0a,0x90,0x02,0xac,0x00,0x0b,0x01,0x26,0x40,0x08,0x94,0x02,0x8c,0x00,0x8b }},
+ {16, 0xfef0, 0, {0x00,0x22,0xc0,0x08,0xb0,0x02,0x2c,0x10,0xbb,0x00,0x2e,0xc0,0x0b,0xb0,0x02,0xf0 }},
+ {16, 0xff00, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x8c,0x20,0xcb,0x02,0x3e,0x2d }},
+ {16, 0xff10, 0, {0x08,0x80,0x03,0xec,0x08,0xc9,0x80,0x1e,0x04,0x0c,0xb0,0x03,0x01,0x08,0x50,0x18 }},
+ {16, 0xff20, 0, {0x3e,0x40,0x0c,0x04,0x03,0x2c,0x00,0xdb,0x01,0x32,0xc0,0x0c,0xb0,0x0b,0x2c,0x08 }},
+ {16, 0xff30, 0, {0xbb,0x00,0x3e,0xc0,0x0f,0xb0,0x03,0x80,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xff40, 0, {0xe1,0x00,0xbc,0x00,0xff,0x00,0x3f,0x60,0x0f,0xc0,0x23,0xec,0x00,0xff,0xc0,0xbe }},
+ {16, 0xff50, 0, {0x60,0x8f,0xc9,0x23,0xf6,0x50,0xed,0x80,0xb8,0x50,0xaf,0xc0,0x03,0xfc,0x00,0xff }},
+ {16, 0xff60, 0, {0x00,0x3f,0xc1,0x0e,0xb0,0x03,0xfc,0x04,0xff,0x02,0x3f,0xc0,0x0f,0xf0,0x03,0xf8 }},
+ {16, 0xff70, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x00,0xeb,0x00,0x32,0x80 }},
+ {16, 0xff80, 0, {0x0d,0x90,0x03,0x2c,0x00,0x89,0x00,0x3e,0x98,0x8c,0x30,0x03,0x61,0x80,0xfa,0x40 }},
+ {16, 0xff90, 0, {0x3e,0x40,0x2c,0xa5,0x03,0x2c,0x00,0xfb,0x01,0x3c,0xc0,0x2c,0x30,0x03,0x2c,0x00 }},
+ {16, 0xffa0, 0, {0xdb,0x02,0x32,0xc0,0x0f,0xb0,0x03,0xd0,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xffb0, 0, {0xca,0x00,0x2e,0x80,0x8b,0x82,0xa0,0xc0,0x8c,0x90,0x02,0x3c,0x00,0x8b,0xf0,0x22 }},
+ {16, 0xffc0, 0, {0xc2,0x0d,0x80,0x02,0x27,0x00,0x8b,0x10,0x22,0x40,0x08,0x80,0x22,0x3c,0x00,0xbf }},
+ {16, 0xffd0, 0, {0x00,0x2f,0xc0,0x08,0xf0,0x02,0x3c,0x00,0xbf,0x01,0xa3,0xc0,0x0b,0xf0,0x12,0xf2 }},
+ {16, 0xffe0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4c,0x00,0xb3,0x1c,0x20,0x40 }},
+ {16, 0xfff0, 0, {0x08,0x00,0x06,0x2c,0x00,0x9b,0x00,0x20,0xd0,0x08,0x20,0x02,0x4c,0x00,0xa3,0x00 }},
+ {16, 0x8010, 0, {0x2c,0xc0,0x08,0x10,0x0a,0x0c,0x00,0xbb,0x00,0x28,0xc0,0x09,0x30,0x02,0x0c,0x00 }},
+ {16, 0x8020, 0, {0xb3,0x00,0x20,0xc0,0x0b,0x30,0x02,0xf8,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8030, 0, {0x22,0x11,0x1e,0x00,0x97,0xa0,0x21,0xa0,0x08,0x79,0x02,0x1e,0x00,0x97,0x90,0x21 }},
+ {16, 0x8040, 0, {0x60,0x09,0xe8,0x22,0x3e,0x00,0xaf,0x84,0x21,0xe4,0x48,0x5c,0x02,0x1e,0x00,0xb7 }},
+ {16, 0x8050, 0, {0x90,0x2d,0xe0,0x09,0x78,0x00,0x1e,0x09,0xb3,0x90,0x21,0xe4,0x0b,0x78,0x02,0xd8 }},
+ {16, 0x8060, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x18,0x2c,0x40,0xb3,0xb0,0x32,0x40 }},
+ {16, 0x8070, 0, {0x2c,0x81,0x13,0x0c,0x42,0xd1,0x00,0xb0,0xc0,0x8c,0x30,0x03,0x48,0x20,0xe3,0x01 }},
+ {16, 0x8080, 0, {0x3c,0xc0,0x0c,0x30,0x03,0x0c,0x00,0xf3,0x10,0x3c,0xc0,0xcd,0x32,0x0b,0x0c,0x40 }},
+ {16, 0x8090, 0, {0xd3,0x00,0x30,0xc0,0x0f,0x30,0x03,0xd2,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x80a0, 0, {0x40,0x15,0xbc,0x00,0xe7,0x00,0x3f,0x80,0x0b,0xf1,0x03,0xfd,0x00,0x6d,0x00,0x32 }},
+ {16, 0x80b0, 0, {0x40,0x1f,0x70,0x07,0xd8,0x41,0xc3,0x10,0x3b,0xc0,0x0f,0xd1,0x03,0xfd,0x00,0xff }},
+ {16, 0x80c0, 0, {0x10,0x3f,0xc0,0x0e,0xf0,0x03,0xec,0x10,0xff,0x08,0x3f,0xc3,0x0f,0xf0,0x03,0xd0 }},
+ {16, 0x80d0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xec,0x04,0xfb,0x02,0x3e,0x40 }},
+ {16, 0x80e0, 0, {0x0b,0xa0,0x03,0xac,0x00,0xdb,0x00,0x36,0x80,0x0d,0xb0,0x03,0xac,0x00,0xe8,0x00 }},
+ {16, 0x80f0, 0, {0x36,0xc1,0x2e,0x90,0x03,0x2c,0x00,0xcb,0xa0,0x36,0xdc,0x0f,0xb0,0x03,0x2d,0x68 }},
+ {16, 0x8100, 0, {0xfb,0xa0,0x92,0xc2,0x0c,0xb1,0x03,0xea,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8110, 0, {0x48,0x11,0x9c,0x08,0x37,0x00,0x2d,0xc0,0x0b,0xe0,0x02,0x1d,0x80,0xb7,0x04,0x23 }},
+ {16, 0x8120, 0, {0x00,0x0a,0x40,0x02,0x1c,0x18,0x84,0x00,0x25,0xc0,0x18,0x50,0x32,0x0d,0x80,0xa3 }},
+ {16, 0x8130, 0, {0x30,0x21,0xcc,0x0b,0x34,0x82,0x1c,0x10,0xb7,0x30,0x21,0xc8,0x08,0x70,0x02,0xd2 }},
+ {16, 0x8140, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x20,0xb7,0x80,0x2d,0x60 }},
+ {16, 0x8150, 0, {0x0b,0xfc,0x22,0x9e,0x00,0x8d,0x80,0x25,0xa0,0x08,0xf8,0x22,0x92,0x00,0xb4,0x80 }},
+ {16, 0x8160, 0, {0x25,0xe0,0x08,0xf8,0x02,0x1e,0x00,0x87,0xb0,0x21,0xe0,0x09,0x7a,0x02,0x1e,0x18 }},
+ {16, 0x8170, 0, {0xb3,0x80,0x21,0xe0,0x08,0x78,0x02,0xf0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8180, 0, {0x48,0x04,0xc5,0x20,0xb3,0x01,0x2c,0xd8,0x0b,0x3c,0x02,0x2c,0x08,0xb9,0x00,0x20 }},
+ {16, 0x8190, 0, {0x03,0x0a,0x00,0x82,0x22,0x08,0x90,0x0d,0x26,0xe4,0x08,0x10,0x02,0x0c,0x00,0xa3 }},
+ {16, 0x81a0, 0, {0x00,0x22,0xc0,0x0b,0x30,0x02,0x6c,0x00,0xb3,0x00,0x22,0xc0,0x28,0x30,0x02,0xc2 }},
+ {16, 0x81b0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x05,0x99,0x00,0xfa,0x02,0x3f,0x90 }},
+ {16, 0x81c0, 0, {0x0f,0xec,0x23,0xa8,0x00,0xda,0x00,0x35,0x80,0x0d,0xe0,0x02,0xba,0x02,0xfe,0xc2 }},
+ {16, 0x81d0, 0, {0xb6,0xa0,0x0e,0xe4,0x0b,0x28,0x00,0xca,0x00,0xb2,0x80,0x0f,0xa0,0x0b,0x28,0x00 }},
+ {16, 0x81e0, 0, {0xfa,0x00,0x32,0x80,0x0c,0xa0,0x03,0xfa,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x81f0, 0, {0x48,0x00,0xe0,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x82,0x03,0xe0,0x00,0xf8,0x00,0x3e }},
+ {16, 0x8200, 0, {0x00,0x0f,0x81,0x03,0xe0,0x40,0xe8,0x10,0x3a,0x00,0x4f,0x84,0x83,0xe0,0x00,0xf8 }},
+ {16, 0x8210, 0, {0x00,0x3a,0x00,0x0f,0x00,0x03,0xa0,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x80,0x03,0xd2 }},
+ {16, 0x8220, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0xe5,0x00,0xc9,0x02,0x3e,0x40 }},
+ {16, 0x8230, 0, {0x0f,0x90,0x23,0x24,0x00,0xc9,0x00,0x32,0x68,0x2f,0x10,0x03,0x24,0x00,0xe9,0x14 }},
+ {16, 0x8240, 0, {0x32,0x40,0x0d,0x90,0x0b,0x04,0x00,0xd9,0x00,0x1e,0x40,0x0c,0x90,0x03,0x24,0x00 }},
+ {16, 0x8250, 0, {0xc9,0x00,0x36,0x40,0x0c,0x90,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8260, 0, {0x80,0x14,0x64,0x00,0x89,0x01,0x2e,0x40,0x4b,0x90,0x12,0x24,0x00,0x89,0xc2,0xa2 }},
+ {16, 0x8270, 0, {0x60,0x88,0x90,0x03,0x64,0x00,0x89,0xc1,0xa2,0x40,0x48,0x16,0x03,0x64,0x02,0x89 }},
+ {16, 0x8280, 0, {0x00,0x2e,0x40,0x08,0x90,0x22,0x24,0x00,0x89,0x00,0x3e,0x40,0x28,0x90,0x0a,0x20 }},
+ {16, 0x8290, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x04,0x24,0x00,0x89,0x02,0x2e,0x40 }},
+ {16, 0x82a0, 0, {0x0b,0x10,0x02,0x24,0x00,0x89,0x10,0x22,0x40,0x89,0x90,0x02,0xac,0x00,0xa1,0x08 }},
+ {16, 0x82b0, 0, {0x22,0x40,0x09,0x98,0x02,0xa4,0x00,0x89,0x00,0x2a,0x40,0x08,0x90,0x02,0x24,0x00 }},
+ {16, 0x82c0, 0, {0x89,0x00,0x26,0x40,0x08,0x10,0x02,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x82d0, 0, {0x08,0x00,0x24,0x00,0x81,0x00,0x2c,0x41,0x0b,0x12,0x02,0x04,0x81,0x81,0x20,0x22 }},
+ {16, 0x82e0, 0, {0x48,0x08,0x12,0x02,0xc4,0x81,0x81,0x24,0x02,0x48,0x0a,0x90,0x02,0x84,0xa0,0x81 }},
+ {16, 0x82f0, 0, {0x28,0x6c,0x4a,0x08,0x12,0xd2,0x04,0xa1,0x81,0x28,0x2c,0x4a,0x08,0x12,0x82,0x02 }},
+ {16, 0x8300, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x08,0x61,0x40,0xc8,0x00,0x2e,0x14 }},
+ {16, 0x8310, 0, {0x0f,0x85,0x0b,0x21,0x42,0xca,0x50,0x22,0x14,0x0d,0x85,0x43,0xa1,0x40,0xe8,0x50 }},
+ {16, 0x8320, 0, {0x30,0x00,0x0d,0x85,0x02,0xa1,0xc0,0xd8,0x20,0x3a,0x08,0x2c,0x82,0x0b,0x20,0x82 }},
+ {16, 0x8330, 0, {0xc8,0x20,0x34,0x09,0x8c,0x82,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8340, 0, {0x98,0x0d,0xfc,0x02,0xf9,0x00,0x3f,0x40,0x4f,0xd1,0x03,0xe4,0x40,0xf5,0x14,0xbf }},
+ {16, 0x8350, 0, {0x44,0x0d,0x51,0x23,0x5c,0x40,0xf5,0x10,0x1f,0x4e,0x4d,0x50,0x03,0x64,0x08,0xf9 }},
+ {16, 0x8360, 0, {0x28,0x3e,0x4a,0x8f,0x92,0x83,0xe4,0xa0,0xf9,0x28,0x3a,0x4b,0x0f,0x92,0x83,0xe6 }},
+ {16, 0x8370, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xf4,0x40,0xfd,0x00,0x30,0x40 }},
+ {16, 0x8380, 0, {0x0c,0x90,0x03,0x24,0x00,0xdd,0x00,0x3b,0x40,0x0e,0x90,0x03,0x74,0x00,0x5d,0x00 }},
+ {16, 0x8390, 0, {0x36,0x64,0x0d,0xd0,0x00,0xa6,0x00,0xf9,0x40,0x32,0x78,0x0c,0x99,0x03,0x24,0x40 }},
+ {16, 0x83a0, 0, {0xc9,0x90,0x32,0x50,0x0f,0x9b,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x83b0, 0, {0x38,0x10,0xe2,0x80,0xb8,0x00,0x22,0x01,0x08,0x80,0x0a,0x20,0x00,0x88,0x00,0x2a }},
+ {16, 0x83c0, 0, {0x00,0x08,0x80,0x02,0x20,0x00,0x88,0x00,0x22,0x20,0x08,0x8a,0x8b,0xe1,0x00,0xb8 }},
+ {16, 0x83d0, 0, {0x80,0x22,0x30,0x28,0x0d,0x02,0x22,0x00,0xd8,0xe4,0x22,0x28,0x0b,0x8f,0x0a,0x0e }},
+ {16, 0x83e0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0x80,0xb1,0x00,0xa0,0x40 }},
+ {16, 0x83f0, 0, {0x08,0x10,0x02,0x04,0x00,0x89,0x00,0x08,0x40,0x0a,0x90,0x42,0x44,0x00,0x91,0x00 }},
+ {16, 0x8400, 0, {0x20,0x58,0x28,0x90,0x02,0x85,0x00,0x81,0x20,0xa0,0x4c,0x09,0x12,0x0a,0x04,0x80 }},
+ {16, 0x8410, 0, {0x91,0x40,0xa0,0x40,0x0b,0x10,0x02,0x02,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8420, 0, {0x18,0x15,0xa4,0x00,0xb9,0x02,0x20,0x40,0x08,0x90,0x02,0x04,0x00,0x89,0x01,0x22 }},
+ {16, 0x8430, 0, {0x40,0x28,0x90,0x22,0x04,0x00,0x89,0x10,0x22,0x40,0x08,0x90,0x02,0xe4,0x00,0xb1 }},
+ {16, 0x8440, 0, {0x00,0x22,0x40,0x81,0x90,0x02,0x04,0x00,0x91,0x00,0x22,0x40,0x0b,0x90,0x02,0x06 }},
+ {16, 0x8450, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe5,0x00,0xf1,0x00,0x32,0x60 }},
+ {16, 0x8460, 0, {0x2c,0x92,0x13,0x24,0x02,0xd1,0x10,0x3a,0x40,0x0e,0x12,0x03,0x66,0x04,0xd9,0x00 }},
+ {16, 0x8470, 0, {0xb6,0x40,0x0d,0x19,0x03,0xa4,0x00,0xf9,0x00,0x32,0x40,0x09,0x90,0x01,0x24,0x00 }},
+ {16, 0x8480, 0, {0xd9,0x02,0x22,0x40,0x0f,0x90,0x03,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8490, 0, {0x2a,0x01,0xa5,0x00,0xf9,0x00,0x3e,0x64,0x0f,0x10,0x03,0xe4,0x00,0xf9,0x81,0x3e }},
+ {16, 0x84a0, 0, {0x66,0x8f,0x90,0x23,0xe4,0x80,0xf9,0x04,0x3e,0x40,0x8f,0x90,0x03,0xe4,0x04,0xf9 }},
+ {16, 0x84b0, 0, {0x00,0x3c,0x40,0x0e,0x90,0x03,0xe4,0x00,0xf9,0x00,0x3e,0x40,0x0f,0x10,0x03,0xca }},
+ {16, 0x84c0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x2a,0x10,0xa0,0x00,0xf8,0x24,0x3e,0x00 }},
+ {16, 0x84d0, 0, {0x2c,0x84,0x03,0x20,0x00,0xb8,0x20,0x3e,0x00,0x8c,0x80,0x03,0xa0,0x00,0x70,0x82 }},
+ {16, 0x84e0, 0, {0x32,0x00,0x0f,0x80,0x03,0x20,0x08,0xf8,0x00,0x32,0x00,0x2c,0x80,0x0b,0x20,0x08 }},
+ {16, 0x84f0, 0, {0xc8,0x00,0x3e,0x00,0x0c,0x80,0x03,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8500, 0, {0x28,0x05,0x28,0x04,0xbe,0x80,0x3a,0x80,0x08,0xa0,0x02,0x28,0x04,0x8e,0x00,0x6d }},
+ {16, 0x8510, 0, {0x90,0x0d,0xa0,0x02,0x3a,0x00,0x8e,0x80,0xa2,0x80,0x0e,0xe0,0x0b,0x68,0x00,0xba }},
+ {16, 0x8520, 0, {0x00,0x22,0x80,0x08,0xa0,0x02,0x28,0x00,0xda,0x00,0x2e,0x80,0x08,0xa0,0x02,0xca }},
+ {16, 0x8530, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x81,0x4c,0x00,0xb1,0x00,0x2c,0xc0 }},
+ {16, 0x8540, 0, {0x08,0x30,0x02,0x0c,0x18,0xa3,0x02,0x2c,0x10,0x88,0x30,0x06,0x82,0x81,0xa0,0x00 }},
+ {16, 0x8550, 0, {0x2a,0xc0,0x0b,0x30,0x0a,0x4c,0x00,0xb3,0x00,0x20,0xc0,0x1a,0xb0,0x02,0x8c,0x01 }},
+ {16, 0x8560, 0, {0x83,0x00,0x2c,0xc0,0x08,0x30,0x02,0xca,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8570, 0, {0x20,0x01,0x1c,0x10,0xb4,0x0a,0x2b,0xc8,0x08,0x31,0x26,0x1c,0x00,0x86,0x00,0x2d }},
+ {16, 0x8580, 0, {0xc0,0x09,0x72,0x02,0x1d,0x00,0xa5,0x40,0x29,0xc0,0x0a,0x60,0x02,0x5c,0x88,0xb3 }},
+ {16, 0x8590, 0, {0x20,0x25,0xc8,0x0a,0x72,0x02,0x9c,0x80,0x97,0x20,0x2c,0xe8,0x80,0x72,0x02,0xe8 }},
+ {16, 0x85a0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x08,0x16,0x00,0xb5,0x80,0x3d,0xe2 }},
+ {16, 0x85b0, 0, {0x0c,0x7a,0x8b,0x0e,0xc0,0xa7,0x81,0x2c,0x20,0x0c,0xfc,0x03,0x92,0x02,0xef,0x80 }},
+ {16, 0x85c0, 0, {0x39,0xe4,0x0b,0xd8,0x01,0x1f,0x00,0xf7,0x80,0xb3,0xf4,0x8e,0x79,0x03,0x8e,0x00 }},
+ {16, 0x85d0, 0, {0xc7,0xc4,0x3d,0xe8,0x2c,0x7b,0x03,0xea,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x85e0, 0, {0x08,0x1d,0xac,0x00,0xf8,0x00,0x3e,0xdd,0x87,0xb6,0x03,0xed,0xcc,0xe9,0x00,0x3e }},
+ {16, 0x85f0, 0, {0x40,0x0f,0xb0,0x07,0xcc,0x10,0x0b,0x00,0x36,0xd8,0x0f,0x80,0x43,0xad,0x80,0xfb }},
+ {16, 0x8600, 0, {0x28,0x3a,0xc0,0x0d,0xb4,0x03,0x6c,0xe2,0xeb,0x60,0x3e,0xd4,0x0f,0xb0,0x03,0xc2 }},
+ {16, 0x8610, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xfe,0x00,0xfe,0x90,0x3f,0xe5 }},
+ {16, 0x8620, 0, {0x0e,0xf8,0x03,0x3e,0x10,0xff,0x90,0x17,0x60,0x0f,0xfc,0x03,0x7a,0x00,0xee,0x80 }},
+ {16, 0x8630, 0, {0x37,0xe2,0x0e,0x78,0x0f,0xff,0x40,0xef,0x88,0x1f,0xe0,0x0c,0xf8,0x83,0xfe,0x80 }},
+ {16, 0x8640, 0, {0xcf,0xd0,0xb3,0xf0,0x0c,0xf8,0xc3,0x10,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8650, 0, {0xa8,0x11,0x9c,0x40,0xb4,0x10,0x0f,0xcc,0x00,0x72,0x02,0x1c,0x00,0xb6,0x02,0x09 }},
+ {16, 0x8660, 0, {0xc0,0x28,0xf0,0x02,0x98,0x00,0xa6,0x00,0x21,0xc0,0x0b,0x60,0x03,0xfc,0x02,0x87 }},
+ {16, 0x8670, 0, {0x00,0x2d,0xc0,0x08,0x70,0x02,0xde,0x00,0x8f,0x10,0x21,0xc0,0x08,0xf0,0x03,0x6a }},
+ {16, 0x8680, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x94,0x00,0xb6,0x02,0x2f,0xc2 }},
+ {16, 0x8690, 0, {0x1a,0x30,0x80,0x1c,0x00,0xb6,0x08,0x01,0x40,0x0a,0xf0,0x02,0x18,0x00,0x87,0x00 }},
+ {16, 0x86a0, 0, {0x21,0xc0,0x0b,0xd0,0x02,0x9c,0x10,0x87,0x00,0x29,0xc0,0x08,0x70,0x02,0xdc,0x44 }},
+ {16, 0x86b0, 0, {0x87,0x10,0x64,0xc0,0x08,0x70,0x02,0x06,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x86c0, 0, {0x60,0x14,0xce,0x60,0xb0,0x00,0x2c,0xc0,0x08,0x34,0x0a,0x0c,0x08,0xb0,0x04,0x00 }},
+ {16, 0x86d0, 0, {0x40,0x08,0x30,0xa2,0x89,0x80,0xa2,0x62,0x20,0xe0,0x0b,0x00,0x0a,0xcc,0x08,0x83 }},
+ {16, 0x86e0, 0, {0x00,0x6c,0xc0,0x08,0x30,0x52,0xcc,0x00,0x83,0x00,0x24,0xc0,0x08,0x30,0x02,0x58 }},
+ {16, 0x86f0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xae,0x00,0xf8,0x00,0x3f,0xd0 }},
+ {16, 0x8700, 0, {0x0e,0xfc,0x03,0x3c,0x00,0xf9,0x00,0x92,0x84,0x0f,0xfc,0x03,0x64,0x00,0x80,0x00 }},
+ {16, 0x8710, 0, {0xb7,0xc3,0x0f,0xb8,0x83,0xbc,0x04,0xef,0x00,0x3f,0xc0,0x3c,0xf0,0x03,0xfc,0x02 }},
+ {16, 0x8720, 0, {0xcf,0x00,0x37,0xc0,0x28,0xf0,0x13,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8730, 0, {0x80,0x00,0xec,0x00,0xf8,0x41,0x3e,0xc8,0x0f,0x32,0x03,0xec,0x00,0xf8,0x00,0x3a }},
+ {16, 0x8740, 0, {0xc4,0x0f,0xb1,0x03,0xc4,0x00,0xf9,0x00,0x36,0xc0,0x0f,0xe4,0x0b,0xec,0x04,0xfb }},
+ {16, 0x8750, 0, {0x00,0x3e,0xc1,0x0f,0xb0,0x43,0xec,0x04,0xfb,0x00,0x3a,0xc0,0x0f,0xb0,0x03,0xe4 }},
+ {16, 0x8760, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xf4,0x00,0xfc,0x80,0x3f,0xc0 }},
+ {16, 0x8770, 0, {0x1f,0xf0,0x03,0x3c,0x08,0xfb,0x00,0x33,0x80,0x2e,0xf0,0x13,0xa4,0x04,0xcb,0x00 }},
+ {16, 0x8780, 0, {0xb9,0xc0,0x2c,0xd8,0x0b,0x3c,0x00,0xff,0x00,0x3f,0xc0,0x09,0x70,0x00,0x2c,0x04 }},
+ {16, 0x8790, 0, {0xff,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0xc0,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x87a0, 0, {0xc1,0x00,0x6c,0x00,0xb8,0x80,0x2e,0xc0,0x0b,0xb0,0x03,0x6c,0x00,0xb9,0x16,0x28 }},
+ {16, 0x87b0, 0, {0x72,0x08,0xb0,0x22,0x27,0x40,0xdb,0x00,0x22,0xc0,0x08,0xbd,0x82,0x2c,0x08,0xbb }},
+ {16, 0x87c0, 0, {0x00,0x2e,0xc0,0x48,0xb0,0x02,0x2c,0x00,0xbb,0x00,0x2e,0xc1,0x0b,0xb0,0x02,0xe0 }},
+ {16, 0x87d0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0xb8,0x60,0x2e,0xc0 }},
+ {16, 0x87e0, 0, {0x0b,0xb0,0x02,0x2c,0x00,0xb1,0x00,0x2a,0x84,0x4a,0x30,0x22,0xac,0x20,0x98,0x80 }},
+ {16, 0x87f0, 0, {0x2a,0xc0,0x08,0x30,0x02,0xac,0x00,0x3b,0x00,0x2c,0xc0,0x0a,0xb0,0x02,0xac,0x08 }},
+ {16, 0x8800, 0, {0xbb,0x00,0x2e,0xc0,0x0b,0xb0,0x42,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8810, 0, {0x08,0x04,0x0c,0x01,0xb0,0x00,0x2c,0xc0,0x0b,0x30,0x02,0x4c,0x04,0xb0,0x00,0x2a }},
+ {16, 0x8820, 0, {0x80,0x08,0x30,0x02,0x00,0x00,0x10,0x04,0x28,0xc0,0x08,0x20,0x42,0x8c,0x00,0xb3 }},
+ {16, 0x8830, 0, {0x00,0x2c,0xc0,0x42,0x30,0x0a,0x8c,0x00,0xb3,0x00,0x2c,0xc0,0x8b,0x30,0x02,0xc2 }},
+ {16, 0x8840, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x64,0x00,0xf8,0x50,0x3f,0xc0 }},
+ {16, 0x8850, 0, {0x0b,0xf0,0x03,0x3c,0x00,0xfa,0x04,0x32,0x80,0x0e,0xf0,0x23,0xac,0x00,0xd9,0x00 }},
+ {16, 0x8860, 0, {0x3b,0xc0,0x0c,0x90,0x03,0xbc,0x04,0xff,0x00,0x3d,0xc0,0x2e,0xf0,0x0b,0x3c,0x00 }},
+ {16, 0x8870, 0, {0xff,0x04,0x3f,0xc0,0x0f,0xf0,0x03,0xc0,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8880, 0, {0xa0,0x1d,0xfc,0x00,0xfc,0x00,0x3f,0xc0,0x07,0xf0,0x03,0xfc,0x04,0x7c,0x02,0xb5 }},
+ {16, 0x8890, 0, {0x00,0x0f,0xf0,0x03,0xf0,0x00,0xfc,0x00,0x37,0xc0,0x0f,0xf0,0x13,0x7c,0x00,0xff }},
+ {16, 0x88a0, 0, {0x00,0x3f,0xc0,0x0d,0xf0,0x03,0x6d,0x00,0xff,0x00,0x3f,0xc0,0x1f,0xf0,0x03,0xe8 }},
+ {16, 0x88b0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xd2,0x00,0xd5,0x80,0x33,0x0a }},
+ {16, 0x88c0, 0, {0x4c,0xf8,0x03,0xf2,0x00,0xfc,0x00,0x37,0x26,0x1f,0xca,0x03,0xbc,0xc4,0xcf,0x20 }},
+ {16, 0x88d0, 0, {0x33,0xe4,0x0f,0x78,0x03,0x3e,0x44,0xcf,0x00,0x3b,0xce,0x9f,0x68,0x13,0xd0,0x00 }},
+ {16, 0x88e0, 0, {0xcd,0x80,0xb3,0x60,0x0f,0xfa,0x83,0xf0,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x88f0, 0, {0x80,0x10,0xe0,0x80,0xc9,0x28,0x22,0x30,0x08,0xb2,0x22,0xea,0x01,0xb8,0x82,0x20 }},
+ {16, 0x8900, 0, {0x50,0x4f,0x9c,0x00,0xa8,0xd1,0xdb,0x10,0xa6,0xe0,0x17,0xb8,0x03,0xec,0x80,0xdb }},
+ {16, 0x8910, 0, {0x08,0x1f,0xd0,0x0b,0xb8,0x02,0xf6,0x00,0xfb,0x80,0x22,0x40,0x0b,0xb0,0x02,0x60 }},
+ {16, 0x8920, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xc4,0x20,0x81,0x80,0x20,0x00 }},
+ {16, 0x8930, 0, {0x8b,0x30,0x82,0xc0,0x00,0xb0,0x10,0x28,0x08,0x8b,0x11,0x30,0xc4,0x84,0x90,0x28 }},
+ {16, 0x8940, 0, {0x24,0xc8,0x0b,0x30,0x02,0x4c,0x00,0x83,0x10,0x04,0xc8,0x0b,0x30,0x02,0xcc,0x00 }},
+ {16, 0x8950, 0, {0xb3,0x00,0x24,0x40,0x0b,0x30,0x02,0xe2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8960, 0, {0xc0,0x15,0xa6,0x00,0x81,0x00,0x22,0x10,0x0b,0xb0,0x12,0xea,0x20,0xbb,0x00,0x2a }},
+ {16, 0x8970, 0, {0x70,0x0a,0x9c,0x02,0x62,0x00,0x98,0x88,0x26,0xc8,0x02,0xb2,0x02,0x8e,0x08,0x8b }},
+ {16, 0x8980, 0, {0x18,0x22,0xc0,0x0b,0xa0,0x02,0xee,0x20,0x3b,0x00,0x26,0x40,0x0b,0xb0,0x02,0x70 }},
+ {16, 0x8990, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xe0,0x00,0xcb,0x00,0x32,0x80 }},
+ {16, 0x89a0, 0, {0x0f,0xb0,0x03,0xe7,0x00,0xb8,0x52,0x3e,0x20,0x4b,0x0c,0x43,0xef,0x82,0x9b,0xc0 }},
+ {16, 0x89b0, 0, {0x32,0xc0,0x0b,0xb0,0x02,0x6c,0x01,0x8b,0x80,0x2e,0xc0,0x0b,0xa0,0x83,0xe6,0x00 }},
+ {16, 0x89c0, 0, {0xfb,0x00,0x36,0x40,0x0f,0xf0,0x03,0xd0,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x89d0, 0, {0xe0,0x01,0xb0,0x02,0xff,0x04,0x3f,0x90,0x0c,0xf1,0x01,0xf4,0x08,0x7d,0x80,0x37 }},
+ {16, 0x89e0, 0, {0x00,0x0f,0xc0,0x23,0x98,0x00,0xf7,0x00,0x2b,0xe0,0x0f,0xf8,0x23,0xfc,0x06,0xfb }},
+ {16, 0x89f0, 0, {0x83,0xbf,0xc0,0x87,0xd0,0x03,0xdc,0x00,0xef,0x00,0x3b,0xc0,0x0f,0xb0,0x01,0xf8 }},
+ {16, 0x8a00, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xa6,0x00,0xcb,0x00,0x33,0x80 }},
+ {16, 0x8a10, 0, {0x0f,0xb0,0x03,0xe1,0x10,0xf2,0x40,0xb2,0x00,0x3d,0x94,0x17,0x2d,0x44,0xfa,0x41 }},
+ {16, 0x8a20, 0, {0x32,0xc0,0x9f,0xb0,0x23,0x2c,0x02,0xcb,0x40,0x32,0xc0,0x4f,0x90,0x03,0x3d,0x00 }},
+ {16, 0x8a30, 0, {0xcb,0x00,0x3e,0x40,0x0f,0xb0,0x03,0x10,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8a40, 0, {0x88,0x05,0x26,0x00,0x8b,0x71,0x20,0xd5,0x03,0x99,0x02,0xe0,0x00,0xbb,0x80,0x22 }},
+ {16, 0x8a50, 0, {0x60,0x1c,0x80,0x03,0x60,0x00,0xb8,0x02,0x22,0xc2,0x0b,0x32,0x02,0x2c,0x01,0x8f }},
+ {16, 0x8a60, 0, {0x02,0xd7,0xc0,0x0b,0xa0,0x03,0x6d,0x40,0x53,0x80,0x2e,0xc0,0x0e,0xf0,0x43,0x72 }},
+ {16, 0x8a70, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x68,0x02,0x80,0x00,0x24,0x00 }},
+ {16, 0x8a80, 0, {0x0b,0x35,0x26,0xc2,0x00,0xb0,0x90,0x20,0xc0,0x88,0x00,0x02,0x4f,0x20,0xb3,0x02 }},
+ {16, 0x8a90, 0, {0x60,0xe2,0x1b,0x38,0x02,0x0c,0x00,0x88,0x00,0x60,0xc0,0x0b,0x34,0x82,0x4c,0x02 }},
+ {16, 0x8aa0, 0, {0xa1,0x90,0x2c,0x40,0x0b,0x30,0x02,0x30,0x01,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8ab0, 0, {0x20,0x01,0x3a,0x08,0x8c,0xa0,0x2d,0x20,0x4b,0x78,0x02,0xda,0x00,0xb2,0x90,0x21 }},
+ {16, 0x8ac0, 0, {0x66,0x48,0x79,0x02,0xde,0x40,0xb7,0x91,0xa1,0xe0,0xdb,0xf8,0x02,0x1e,0x40,0x84 }},
+ {16, 0x8ad0, 0, {0x90,0x01,0xe0,0x8b,0xf9,0x02,0x5e,0x01,0x97,0x80,0x2d,0x60,0x0a,0x78,0x00,0x48 }},
+ {16, 0x8ae0, 0, {0x04,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0x80,0x00,0x24,0x04 }},
+ {16, 0x8af0, 0, {0x0f,0x32,0x03,0xc4,0xa0,0xf1,0x42,0x30,0xc4,0x2c,0x31,0x02,0x44,0x00,0xf1,0x11 }},
+ {16, 0x8b00, 0, {0xa0,0xc0,0x0b,0x30,0x0b,0x0c,0x42,0x83,0x00,0x00,0xc0,0x0f,0x30,0x03,0x4c,0x02 }},
+ {16, 0x8b10, 0, {0xe3,0x00,0x3c,0x40,0x0b,0x30,0x01,0x12,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8b20, 0, {0xc0,0x1d,0xbc,0x00,0xfc,0xa5,0x33,0xc0,0x0f,0xd0,0x03,0xfc,0x01,0xbf,0x00,0x3f }},
+ {16, 0x8b30, 0, {0xc4,0x0e,0x71,0x03,0x74,0x00,0x75,0x10,0x3f,0xc0,0x05,0xf0,0x03,0xdc,0x40,0xff }},
+ {16, 0x8b40, 0, {0x04,0x3f,0xc0,0x0f,0xf0,0x43,0xfc,0x00,0x7f,0x00,0x3f,0x40,0x0e,0xf0,0x03,0xd0 }},
+ {16, 0x8b50, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x04,0xe8,0x00,0xf2,0x04,0xb3,0x80 }},
+ {16, 0x8b60, 0, {0x0f,0xb8,0x0b,0x2c,0x00,0xeb,0x80,0x32,0xc0,0x0c,0x20,0x13,0x2e,0x08,0xcb,0x01 }},
+ {16, 0x8b70, 0, {0x32,0xc5,0x0f,0xb1,0x03,0xec,0x48,0xc8,0x10,0x32,0xfa,0x8c,0x38,0x03,0x3c,0x90 }},
+ {16, 0x8b80, 0, {0xcb,0x00,0x3e,0x40,0x0f,0xb0,0x13,0xc2,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8b90, 0, {0xc8,0x10,0x98,0x00,0xf6,0x00,0x61,0x81,0x0b,0xf0,0x02,0x1c,0x00,0xd7,0x00,0xb7 }},
+ {16, 0x8ba0, 0, {0x80,0x0c,0x70,0x02,0xbc,0x10,0x8f,0x00,0x21,0xc8,0x8b,0x72,0x43,0xfc,0x88,0xdc }},
+ {16, 0x8bb0, 0, {0x00,0x37,0xc8,0x0d,0x50,0x02,0x1c,0x22,0x87,0x00,0x2d,0xc0,0x0b,0x70,0x02,0xd3 }},
+ {16, 0x8bc0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x9e,0x00,0xb6,0x80,0xa9,0xa0 }},
+ {16, 0x8bd0, 0, {0x4b,0x7c,0x02,0x5e,0x30,0xa3,0x88,0x21,0xf0,0x08,0x78,0x02,0x16,0x00,0x85,0x80 }},
+ {16, 0x8be0, 0, {0x21,0xe0,0x0b,0x78,0x02,0xde,0x00,0x87,0x80,0xa1,0xe4,0x08,0xd8,0x02,0x4e,0x00 }},
+ {16, 0x8bf0, 0, {0x97,0x80,0x2d,0x70,0x0b,0x78,0x02,0xc8,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8c00, 0, {0x48,0x14,0xec,0x00,0xb2,0x00,0x28,0xc0,0x0b,0x10,0x02,0x4e,0x90,0x93,0x02,0x22 }},
+ {16, 0x8c10, 0, {0xf0,0x08,0x38,0x42,0x8c,0x42,0x83,0x04,0x22,0xe4,0x4b,0x38,0x02,0x8e,0x40,0x83 }},
+ {16, 0x8c20, 0, {0x00,0x20,0xc0,0x09,0x38,0x22,0x4e,0x21,0x93,0x00,0x2e,0xe0,0x0b,0x30,0x02,0xdb }},
+ {16, 0x8c30, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xa8,0x01,0xfa,0x00,0x3b,0x89 }},
+ {16, 0x8c40, 0, {0x0f,0xa0,0x02,0x78,0x08,0xae,0x40,0x23,0x80,0x2c,0x6c,0x0b,0x3a,0x00,0x8e,0x8c }},
+ {16, 0x8c50, 0, {0xb2,0x00,0x0b,0x80,0x82,0xe0,0x02,0x8e,0x00,0x22,0x80,0x0c,0xe8,0x02,0x7b,0x80 }},
+ {16, 0x8c60, 0, {0x9a,0x80,0x3e,0x80,0x0f,0xa0,0x03,0xfa,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8c70, 0, {0x48,0x00,0xe0,0x09,0xec,0x00,0x36,0x21,0x0b,0x80,0x13,0xa1,0x00,0xf8,0x60,0x3e }},
+ {16, 0x8c80, 0, {0x00,0x0f,0x81,0x03,0xe0,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x80,0x43,0xe0,0x10,0xf8 }},
+ {16, 0x8c90, 0, {0x00,0xbe,0x00,0x0f,0x85,0x0b,0x80,0x00,0xe8,0x10,0x3e,0x00,0x0f,0x80,0x03,0xd2 }},
+ {16, 0x8ca0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x02,0xc9,0x02,0x30,0x48 }},
+ {16, 0x8cb0, 0, {0x0c,0x99,0x13,0xa4,0x02,0xc9,0x00,0x3e,0x42,0x0c,0x90,0x8f,0x24,0x00,0xf9,0x00 }},
+ {16, 0x8cc0, 0, {0x32,0x28,0x0c,0x88,0x03,0xe0,0x00,0xc9,0x00,0xb2,0x40,0x0f,0x90,0x03,0xe7,0x00 }},
+ {16, 0x8cd0, 0, {0xc9,0x10,0x3e,0x40,0x0c,0x10,0x03,0x02,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8ce0, 0, {0x80,0x04,0x64,0x01,0x89,0x80,0xa2,0x48,0x28,0x92,0x42,0xc5,0x00,0x89,0x40,0x2e }},
+ {16, 0x8cf0, 0, {0x40,0x2c,0x90,0x06,0x25,0x00,0xb9,0x00,0x22,0x50,0x08,0x98,0x02,0xc4,0x00,0x89 }},
+ {16, 0x8d00, 0, {0x01,0x76,0x40,0x4b,0x92,0x02,0xe5,0x02,0x89,0x00,0x2e,0x40,0x0d,0x90,0x03,0x60 }},
+ {16, 0x8d10, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x0c,0x85,0x20,0xa2,0x40 }},
+ {16, 0x8d20, 0, {0x08,0x90,0x06,0xe5,0x00,0x89,0x40,0x2e,0x40,0x09,0x90,0x42,0xa4,0xa0,0x31,0x00 }},
+ {16, 0x8d30, 0, {0x22,0x50,0x18,0x91,0x02,0xe4,0x00,0x81,0x00,0x22,0x40,0x0b,0x90,0x06,0xe4,0x00 }},
+ {16, 0x8d40, 0, {0x89,0x00,0x2e,0x40,0x09,0x90,0x02,0x0e,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8d50, 0, {0x00,0x04,0x15,0x00,0x85,0x40,0x20,0x40,0x08,0x14,0x26,0xe4,0x00,0x81,0x00,0x2c }},
+ {16, 0x8d60, 0, {0x40,0x18,0x10,0x02,0x84,0x80,0xb1,0x20,0xa0,0x50,0x08,0x14,0x02,0xe5,0x02,0x81 }},
+ {16, 0x8d70, 0, {0x40,0x20,0x48,0x0b,0x10,0x06,0xcc,0x00,0x81,0x01,0x2c,0x50,0x09,0x14,0x02,0x4a }},
+ {16, 0x8d80, 0, {0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0x8c,0x00,0x32,0x00 }},
+ {16, 0x8d90, 0, {0x0c,0x80,0x23,0xe0,0x00,0xc8,0x00,0x3e,0x14,0x0d,0x80,0x12,0xa1,0x44,0xf8,0x51 }},
+ {16, 0x8da0, 0, {0x32,0x00,0x2c,0x80,0x03,0xe0,0x00,0x88,0x04,0x22,0x14,0x0f,0x80,0x07,0xe0,0x00 }},
+ {16, 0x8db0, 0, {0xc8,0x00,0x3e,0x00,0x0d,0x80,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8dc0, 0, {0x98,0x9d,0xe4,0x00,0xf9,0x00,0x3f,0x50,0x0f,0xd0,0x03,0xdc,0x01,0xbd,0x42,0x3f }},
+ {16, 0x8dd0, 0, {0x50,0x4f,0xd4,0x43,0x74,0x41,0xfd,0x10,0x3f,0x10,0x1f,0xc4,0x13,0xf1,0x00,0xfd }},
+ {16, 0x8de0, 0, {0x40,0x7e,0x44,0x0f,0xd0,0x43,0xf5,0x01,0xfd,0x00,0x3f,0x40,0x0f,0x94,0x03,0xe6 }},
+ {16, 0x8df0, 0, {0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xf4,0x00,0xdf,0x05,0x33,0x61 }},
+ {16, 0x8e00, 0, {0x0f,0x50,0x53,0x34,0x10,0xfd,0x04,0x33,0x44,0x4f,0x50,0x03,0x76,0xc1,0xcd,0xe0 }},
+ {16, 0x8e10, 0, {0x33,0x60,0x0c,0xce,0x03,0xf6,0xc0,0xe1,0xc0,0xb6,0x64,0x8f,0x50,0x0b,0x36,0x82 }},
+ {16, 0x8e20, 0, {0xcd,0x00,0x3e,0x44,0x4c,0x9e,0xc3,0xc6,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8e30, 0, {0x38,0x10,0xea,0x28,0x80,0xa0,0xb2,0x04,0x0b,0x8a,0x83,0x60,0x00,0xfa,0x00,0x36 }},
+ {16, 0x8e40, 0, {0x28,0x8b,0x80,0x03,0xe3,0xc8,0xc8,0x84,0x22,0x14,0x08,0x8a,0x02,0xe2,0x80,0xd8 }},
+ {16, 0x8e50, 0, {0x82,0x34,0x34,0x1b,0x80,0x03,0x60,0x04,0x88,0x00,0x2e,0x20,0x0a,0x8e,0x42,0xce }},
+ {16, 0x8e60, 0, {0x06,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x05,0xc4,0x80,0x81,0x08,0x04,0x41 }},
+ {16, 0x8e70, 0, {0x0b,0x92,0x02,0x04,0x00,0xb1,0x00,0x2c,0x40,0x0b,0x18,0x02,0x24,0x00,0xb1,0x60 }},
+ {16, 0x8e80, 0, {0x26,0x40,0x0a,0x16,0x02,0xc5,0x00,0xa1,0xc0,0x20,0x48,0x0b,0x90,0x02,0x47,0x00 }},
+ {16, 0x8e90, 0, {0x91,0x01,0x2c,0x48,0x18,0x12,0x02,0xd2,0x01,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8ea0, 0, {0x18,0x15,0xa4,0x0c,0x8b,0x04,0xa2,0x50,0x0b,0x91,0x02,0x24,0x04,0xa9,0x01,0x2e }},
+ {16, 0x8eb0, 0, {0x42,0x0b,0x90,0x02,0xa4,0x00,0xa9,0x00,0x26,0x60,0x0a,0x90,0x02,0xe6,0x00,0x81 }},
+ {16, 0x8ec0, 0, {0x00,0x22,0x40,0x8b,0xb0,0x02,0x24,0x08,0x99,0x10,0x2e,0x40,0x1a,0x90,0x02,0xc6 }},
+ {16, 0x8ed0, 0, {0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe5,0x00,0xc9,0x00,0x36,0x40 }},
+ {16, 0x8ee0, 0, {0x0f,0x10,0x02,0x25,0x00,0xb1,0x00,0x2e,0x60,0x0f,0x10,0x12,0x24,0x02,0xb9,0xa0 }},
+ {16, 0x8ef0, 0, {0xa4,0x40,0x2e,0x91,0x03,0xe6,0x00,0xa9,0x00,0x22,0x40,0x0b,0x19,0x80,0x64,0x04 }},
+ {16, 0x8f00, 0, {0xd9,0x81,0x2e,0x40,0x4c,0x90,0x03,0xe8,0x14,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8f10, 0, {0x68,0x01,0xa4,0x0a,0xe9,0x00,0xbe,0x48,0x0f,0x98,0x0b,0xe4,0x00,0xf9,0xc4,0x36 }},
+ {16, 0x8f20, 0, {0x70,0x1f,0x92,0x03,0xe6,0x90,0xc1,0x90,0x3a,0x40,0x8d,0x88,0x03,0xe4,0x00,0xf9 }},
+ {16, 0x8f30, 0, {0x90,0x3e,0x40,0x0b,0x98,0x03,0xe6,0x40,0xe9,0x00,0x3e,0x40,0x0f,0x90,0x03,0xd2 }},
+ {16, 0x8f40, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x68,0x10,0xa1,0x02,0xd8,0x20,0xb2,0x10 }},
+ {16, 0x8f50, 0, {0x0c,0x80,0x83,0x21,0x40,0xc8,0x58,0xb2,0x10,0x4c,0x80,0x0b,0x20,0x00,0xf8,0x42 }},
+ {16, 0x8f60, 0, {0x32,0x00,0x0f,0x80,0x03,0xe0,0x02,0xd8,0x00,0x72,0x00,0x1c,0x80,0x00,0x20,0x00 }},
+ {16, 0x8f70, 0, {0xf8,0x04,0x3e,0x00,0x0f,0x80,0x03,0x02,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8f80, 0, {0x28,0x05,0x38,0x04,0xce,0x41,0x23,0x80,0x08,0xe0,0x02,0x39,0x10,0xae,0x40,0x22 }},
+ {16, 0x8f90, 0, {0x80,0x08,0xe0,0x02,0x1a,0x00,0xba,0x00,0x2b,0xad,0x03,0x80,0x02,0xe8,0x00,0xca }},
+ {16, 0x8fa0, 0, {0x00,0x2a,0x80,0x0a,0xe0,0x02,0x18,0x00,0xba,0x00,0x1a,0x80,0x0b,0xa0,0x03,0x4a }},
+ {16, 0x8fb0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x68,0x05,0x6c,0x12,0x89,0x00,0xa0,0xe0 }},
+ {16, 0x8fc0, 0, {0x08,0x38,0x02,0x0d,0x88,0x83,0x00,0x04,0xe0,0x08,0x38,0x32,0x0e,0x25,0x31,0x01 }},
+ {16, 0x8fd0, 0, {0x24,0xe0,0x8b,0x38,0x02,0xe4,0x01,0x83,0x00,0x20,0xc0,0x08,0x30,0x02,0x8c,0x00 }},
+ {16, 0x8fe0, 0, {0xb3,0x00,0x2e,0xc0,0x0b,0x30,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x8ff0, 0, {0xa0,0x01,0x14,0x20,0x86,0x20,0x29,0xb0,0x08,0xf0,0x82,0x3e,0x04,0xa7,0x00,0x21 }},
+ {16, 0x9000, 0, {0x70,0x88,0x70,0x92,0x1c,0x20,0xbd,0x00,0x69,0xc0,0x0b,0x76,0x02,0xd4,0x80,0x8f }},
+ {16, 0x9010, 0, {0x21,0x29,0xe0,0x0a,0x60,0x86,0x98,0x01,0xb7,0x00,0x2d,0xc8,0x0b,0x3b,0x02,0x60 }},
+ {16, 0x9020, 0, {0x04,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x3e,0x00,0xc7,0xa0,0xb0,0xe0 }},
+ {16, 0x9030, 0, {0x2c,0x78,0x0b,0x1a,0x00,0xc3,0x80,0x37,0xe0,0x28,0x78,0x03,0x1a,0x08,0xf5,0x90 }},
+ {16, 0x9040, 0, {0x35,0xe0,0x0f,0x7c,0x12,0xd6,0x82,0xc7,0x90,0x21,0xe4,0x08,0x78,0x03,0x9e,0x00 }},
+ {16, 0x9050, 0, {0xf5,0x80,0x3d,0xf1,0x0f,0x78,0x03,0x22,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9060, 0, {0x08,0x19,0xa4,0x00,0xee,0x80,0x36,0xc1,0x4f,0xd0,0x03,0xc8,0x00,0xfb,0x00,0x3e }},
+ {16, 0x9070, 0, {0x51,0x0f,0xb0,0x03,0xe4,0x08,0xf1,0x60,0x3e,0xc0,0x0f,0xb0,0x03,0xc5,0x00,0xeb }},
+ {16, 0x9080, 0, {0x10,0x3e,0xc0,0x0f,0xb0,0x09,0x6c,0x00,0xfb,0x00,0x3a,0xc0,0x0f,0xb0,0x03,0xc2 }},
+ {16, 0x9090, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xfe,0x00,0xfd,0x88,0x33,0x60 }},
+ {16, 0x90a0, 0, {0x0f,0xf9,0x03,0xce,0x40,0xd7,0x84,0x37,0x70,0x0c,0xd8,0x23,0x36,0x00,0xc5,0x88 }},
+ {16, 0x90b0, 0, {0x33,0xe0,0x4f,0xf8,0x13,0xf7,0x28,0xdf,0x80,0x37,0xe2,0x0c,0x58,0x03,0x3e,0x00 }},
+ {16, 0x90c0, 0, {0xff,0x90,0x3f,0xe0,0x0c,0xf8,0x03,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x90d0, 0, {0xa9,0x11,0x9c,0x08,0xf6,0x00,0xa1,0x00,0x0b,0x63,0x02,0xd6,0x30,0x85,0x41,0x31 }},
+ {16, 0x90e0, 0, {0xc8,0x08,0x50,0x23,0x1c,0x00,0xd5,0x20,0xb1,0x80,0x0f,0x70,0x03,0xb4,0x00,0xc7 }},
+ {16, 0x90f0, 0, {0x00,0x21,0xc0,0x0f,0x40,0xa3,0x58,0x40,0xb7,0x00,0x3f,0xc4,0x0a,0xf0,0x02,0x2a }},
+ {16, 0x9100, 0, {0x06,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x40,0xb7,0x10,0x21,0xd2 }},
+ {16, 0x9110, 0, {0x0b,0x70,0x02,0xdc,0x42,0x86,0x00,0x25,0x61,0x08,0x51,0x02,0x50,0x00,0x95,0x00 }},
+ {16, 0x9120, 0, {0x25,0xc0,0x09,0x70,0x82,0xd4,0x00,0x87,0x00,0x24,0xc0,0x08,0x50,0x02,0x5c,0x00 }},
+ {16, 0x9130, 0, {0x95,0x04,0x2d,0xc0,0x08,0x70,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9140, 0, {0x20,0x14,0xcc,0x08,0xb2,0xd0,0x20,0xe0,0x4b,0x08,0x02,0xc4,0x00,0x80,0x80,0x20 }},
+ {16, 0x9150, 0, {0xf0,0x08,0x1a,0x02,0x85,0x48,0x81,0x10,0x20,0x40,0x0a,0x30,0x02,0xc6,0x10,0x93 }},
+ {16, 0x9160, 0, {0x00,0x20,0xc0,0x0a,0x1c,0x02,0x0d,0x40,0xb3,0x00,0x68,0xc4,0x0a,0xb0,0x02,0x09 }},
+ {16, 0x9170, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xac,0x01,0xfe,0x00,0x32,0xf0 }},
+ {16, 0x9180, 0, {0x0f,0x88,0x03,0xe6,0x00,0xc8,0xc8,0x36,0xf6,0x28,0xa6,0x0a,0x6d,0x00,0x9d,0x00 }},
+ {16, 0x9190, 0, {0x32,0x00,0x0b,0xb0,0x03,0xf6,0x03,0xc7,0x00,0x37,0xc0,0x08,0x9c,0x0a,0x6e,0x00 }},
+ {16, 0x91a0, 0, {0xbb,0x00,0x2f,0xc0,0x0c,0xf0,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x91b0, 0, {0x80,0x00,0xe4,0x01,0xeb,0x40,0x3e,0x80,0x4f,0xc1,0x03,0xe4,0x00,0xb8,0x08,0x3a }},
+ {16, 0x91c0, 0, {0x40,0x8f,0xa4,0x13,0x6c,0x20,0xf9,0x00,0x3e,0x70,0x0f,0xb0,0x03,0xa4,0x40,0xeb }},
+ {16, 0x91d0, 0, {0x00,0x3e,0xc0,0x0f,0x92,0x23,0xe8,0x00,0xf9,0x80,0x3e,0xc0,0x0f,0xb0,0x63,0xe0 }},
+ {16, 0x91e0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x08,0xce,0x08,0x33,0xc0 }},
+ {16, 0x91f0, 0, {0x0f,0xda,0x03,0x30,0x00,0xe4,0x04,0x35,0xc0,0x0d,0xa0,0x03,0x28,0x00,0xc5,0x00 }},
+ {16, 0x9200, 0, {0x33,0x00,0x0b,0xfa,0x03,0xf4,0x03,0xcb,0x00,0x31,0xc0,0x0c,0xd4,0x03,0x14,0x20 }},
+ {16, 0x9210, 0, {0xcd,0x80,0x23,0xc1,0x0c,0xf0,0x02,0x08,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9220, 0, {0x81,0x04,0x44,0x10,0xcb,0xd0,0x22,0xc0,0x0b,0x94,0x02,0x22,0x84,0xb8,0xc6,0x02 }},
+ {16, 0x9230, 0, {0x40,0x08,0x28,0x02,0xa5,0x80,0x89,0x00,0x22,0x60,0x0b,0xb8,0x02,0x64,0x00,0x8b }},
+ {16, 0x9240, 0, {0x00,0x2a,0xc0,0xc8,0x00,0x03,0x66,0x00,0x81,0x00,0x00,0xc0,0x0d,0xb0,0x0a,0xa8 }},
+ {16, 0x9250, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2c,0x00,0x13,0x00,0x22,0x40 }},
+ {16, 0x9260, 0, {0x8b,0x24,0x02,0x2a,0x00,0xbb,0x82,0x22,0x40,0x00,0xac,0x02,0x84,0x00,0x89,0x00 }},
+ {16, 0x9270, 0, {0x22,0x22,0x0b,0xb0,0x02,0xc4,0x00,0x9b,0x00,0x2a,0xc0,0x08,0xb0,0x02,0x2e,0x00 }},
+ {16, 0x9280, 0, {0x8b,0x10,0x2a,0xc0,0x08,0xb0,0x02,0xa0,0x10,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9290, 0, {0x08,0x04,0x0c,0x10,0x83,0x00,0x20,0x01,0x0b,0x20,0x02,0x00,0x80,0xb1,0x00,0x20 }},
+ {16, 0x92a0, 0, {0xc1,0x08,0x20,0x02,0x88,0x01,0x81,0x00,0xa0,0x00,0x0b,0x30,0x02,0x44,0x01,0x9b }},
+ {16, 0x92b0, 0, {0x00,0x28,0xc0,0x08,0xb0,0x02,0x48,0x06,0x89,0x00,0x2a,0xc0,0x09,0x30,0x02,0x82 }},
+ {16, 0x92c0, 0, {0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8d,0x6c,0x00,0xc3,0x00,0xb2,0xc0 }},
+ {16, 0x92d0, 0, {0x0f,0xb0,0x03,0x28,0x20,0xfa,0x00,0xb1,0x40,0x0d,0xa0,0x07,0xa0,0x00,0xcd,0x00 }},
+ {16, 0x92e0, 0, {0x22,0x00,0x0f,0xb0,0x03,0xf4,0x00,0x9f,0x00,0x3b,0xc0,0x2c,0xb0,0x0b,0x24,0x00 }},
+ {16, 0x92f0, 0, {0xc9,0x00,0xba,0xc0,0x0c,0xb0,0x03,0x80,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9300, 0, {0xa0,0x1d,0xfc,0x06,0xff,0x02,0xaf,0xc0,0x0f,0xc0,0x03,0xf0,0x10,0xfc,0x00,0x3f }},
+ {16, 0x9310, 0, {0xc0,0x9f,0xe0,0x13,0xf0,0x00,0xfd,0x04,0x3f,0x40,0x4f,0xf0,0x03,0x74,0x00,0xef }},
+ {16, 0x9320, 0, {0x00,0x3f,0xc0,0x8f,0xe0,0x02,0xb4,0x01,0xfd,0x04,0x37,0xc0,0x0f,0xf0,0x43,0x68 }},
+ {16, 0x9330, 0, {0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfc,0x00,0xc7,0x20,0xb3,0xc8 }},
+ {16, 0x9340, 0, {0x1c,0xf1,0x03,0x7c,0x20,0xcf,0x0a,0x3f,0xd0,0x0d,0xf0,0x03,0x7c,0x80,0x8f,0x32 }},
+ {16, 0x9350, 0, {0x33,0xc4,0x0f,0xf1,0x83,0x3c,0xe0,0xcf,0x10,0x33,0xc4,0x0d,0xf2,0x83,0x3c,0xe2 }},
+ {16, 0x9360, 0, {0xc7,0x80,0x17,0xcc,0x4c,0xf3,0x83,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9370, 0, {0x80,0x10,0xe3,0x40,0x88,0x68,0x22,0x30,0x08,0x06,0x02,0x01,0xa1,0x88,0xc4,0x0e }},
+ {16, 0x9380, 0, {0x14,0x08,0x87,0x80,0x01,0xc0,0x28,0x50,0x02,0x04,0x8b,0x86,0x02,0xa1,0x98,0x88 }},
+ {16, 0x9390, 0, {0x41,0x2a,0x04,0x0a,0x84,0x82,0xbd,0x80,0x8b,0x08,0x2b,0xc4,0x88,0xf4,0x03,0x60 }},
+ {16, 0x93a0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcc,0x08,0x82,0x40,0x20,0x10 }},
+ {16, 0x93b0, 0, {0x08,0x21,0x12,0x44,0x04,0x82,0x04,0x2c,0x08,0x89,0x90,0x02,0x44,0x21,0x8b,0x00 }},
+ {16, 0x93c0, 0, {0x24,0x88,0x8b,0xa0,0x00,0x40,0x84,0x89,0x30,0x22,0x48,0x88,0xb0,0x02,0xcc,0x08 }},
+ {16, 0x93d0, 0, {0x88,0x20,0xa4,0xc8,0x00,0x32,0x0a,0x22,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x93e0, 0, {0xc0,0x15,0xa0,0x00,0x89,0x00,0x22,0xc1,0x88,0x90,0x62,0x28,0x08,0x89,0x08,0x2e }},
+ {16, 0x93f0, 0, {0xc0,0x08,0xa0,0x02,0x28,0x08,0xa8,0x00,0x26,0x42,0x0b,0x90,0x02,0xcc,0x50,0x8a }},
+ {16, 0x9400, 0, {0x22,0x2a,0x86,0x0a,0x80,0x02,0xec,0x00,0x88,0x84,0x2a,0xc1,0x08,0xb0,0x26,0x30 }},
+ {16, 0x9410, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xf0,0x02,0xcf,0x00,0x33,0xc0 }},
+ {16, 0x9420, 0, {0x48,0xf8,0x43,0x79,0x00,0x8d,0xc0,0x3f,0x30,0x8d,0x60,0x83,0x78,0x60,0xc4,0x58 }},
+ {16, 0x9430, 0, {0x37,0x20,0x0f,0x58,0x13,0x7b,0x02,0xcc,0xc4,0x31,0x20,0x0c,0x44,0x03,0xec,0x02 }},
+ {16, 0x9440, 0, {0x8b,0x80,0x36,0xc0,0x24,0xb0,0x12,0x10,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9450, 0, {0xe0,0x01,0x9c,0x00,0xf4,0x10,0x3d,0x00,0x6f,0xc9,0x13,0xd4,0x12,0xfe,0x90,0x3f }},
+ {16, 0x9460, 0, {0xf0,0x0f,0xda,0x23,0xf4,0x14,0xff,0x02,0x3b,0xf0,0x0f,0xea,0x23,0xb6,0x00,0xff }},
+ {16, 0x9470, 0, {0x82,0x3f,0xe1,0x8f,0xf4,0x03,0xbc,0x00,0xff,0x00,0x3f,0xc0,0xaf,0x70,0x03,0xf8 }},
+ {16, 0x9480, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xa0,0x00,0xca,0x00,0x32,0x08 }},
+ {16, 0x9490, 0, {0x1c,0xa0,0x03,0xa5,0x20,0xcb,0x40,0xba,0x10,0x1f,0xb0,0x03,0xac,0x00,0xeb,0x00 }},
+ {16, 0x94a0, 0, {0x72,0x90,0x0c,0xb4,0x03,0x29,0x04,0xc9,0x52,0x32,0x50,0x0c,0xb4,0x03,0x0c,0x00 }},
+ {16, 0x94b0, 0, {0xf8,0x40,0x32,0xc1,0x0e,0xb0,0x0b,0x50,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x94c0, 0, {0xc8,0x05,0x2d,0x80,0x89,0x80,0x22,0xd9,0x08,0x90,0x22,0x2a,0x00,0x88,0x54,0x22 }},
+ {16, 0x94d0, 0, {0xc0,0x8b,0x80,0x22,0x20,0x19,0xc8,0x00,0x22,0x40,0x8d,0x80,0x1a,0x24,0x10,0xd2 }},
+ {16, 0x94e0, 0, {0x44,0x22,0x81,0x0d,0x80,0x03,0x7c,0x00,0xb0,0x00,0x37,0xc0,0x88,0xf0,0x02,0x32 }},
+ {16, 0x94f0, 0, {0x10,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x4e,0x00,0x81,0x00,0xa0,0xf0 }},
+ {16, 0x9500, 0, {0x08,0x90,0x02,0x89,0x02,0x80,0x00,0x22,0xc0,0x0b,0x00,0x22,0xa0,0x00,0xb0,0x00 }},
+ {16, 0x9510, 0, {0x20,0x40,0x08,0x00,0x02,0x04,0x00,0x82,0x60,0x20,0x80,0x08,0x00,0x02,0x0c,0x08 }},
+ {16, 0x9520, 0, {0xb2,0x00,0x22,0xc0,0x08,0x30,0x02,0x38,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9530, 0, {0x20,0x01,0x03,0x10,0x8e,0x90,0x23,0x24,0x08,0x6b,0x02,0x16,0x60,0x8f,0x80,0x21 }},
+ {16, 0x9540, 0, {0x28,0x0b,0xf9,0x06,0x1e,0x40,0x8f,0x80,0x23,0xa4,0x49,0x79,0x02,0x3a,0x40,0x9d }},
+ {16, 0x9550, 0, {0x90,0x23,0x64,0x09,0xf8,0x02,0x5e,0x40,0xbe,0x90,0x24,0xe4,0x28,0x79,0x02,0x08 }},
+ {16, 0x9560, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x42,0xc0,0x09,0x30,0x00 }},
+ {16, 0x9570, 0, {0x28,0x02,0x03,0x84,0x00,0x8a,0x20,0x30,0xc4,0x8b,0x11,0x03,0x84,0x50,0xb3,0x00 }},
+ {16, 0x9580, 0, {0x20,0xc0,0x0c,0xa4,0x22,0x04,0x00,0xcb,0x40,0x30,0xc5,0x0c,0x30,0x03,0x0e,0x40 }},
+ {16, 0x9590, 0, {0xf3,0x10,0x30,0xc4,0x0c,0xb0,0x03,0x12,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x95a0, 0, {0x40,0x1d,0xb0,0x04,0xfb,0x04,0x3d,0xc0,0x0f,0xf2,0x43,0xf8,0x04,0xfd,0x01,0x3f }},
+ {16, 0x95b0, 0, {0x0c,0x0f,0x61,0x03,0xf8,0x48,0xf4,0x00,0x3d,0x01,0x0f,0xd0,0x03,0xc8,0x00,0xfc }},
+ {16, 0x95c0, 0, {0x04,0xbd,0x04,0x0b,0x48,0x03,0xfc,0x18,0xff,0x14,0x3f,0xd5,0x0d,0xf0,0x03,0x90 }},
+ {16, 0x95d0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xe0,0x00,0xf9,0x01,0x32,0xc0 }},
+ {16, 0x95e0, 0, {0x8e,0x90,0x03,0x28,0x02,0xd1,0x00,0x32,0xc0,0x0d,0xa8,0x0b,0x08,0x00,0xe8,0x00 }},
+ {16, 0x95f0, 0, {0x2e,0x40,0x0c,0x98,0x0b,0x2e,0x02,0xca,0x00,0xb2,0xa0,0x6c,0x80,0x23,0x2d,0x80 }},
+ {16, 0x9600, 0, {0xca,0x80,0x32,0xd0,0x0c,0xba,0x03,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9610, 0, {0x48,0x11,0x9c,0x00,0xb6,0x00,0xa3,0x00,0x08,0x60,0x02,0x04,0x00,0x86,0x04,0x29 }},
+ {16, 0x9620, 0, {0x00,0x08,0x50,0x42,0x14,0x04,0xa7,0x00,0x0d,0x80,0x4a,0x60,0x02,0x00,0x00,0x81 }},
+ {16, 0x9630, 0, {0x00,0x21,0x40,0x08,0x70,0x02,0x9d,0x42,0x86,0x01,0x20,0xc0,0x08,0x32,0x82,0x12 }},
+ {16, 0x9640, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x92,0x00,0xbc,0x80,0x63,0x20 }},
+ {16, 0x9650, 0, {0x82,0x08,0x02,0x52,0x00,0x84,0xc2,0x23,0x20,0x88,0x0c,0x02,0x33,0x00,0x84,0x80 }},
+ {16, 0x9660, 0, {0x2f,0x21,0x89,0x4c,0x02,0x12,0x14,0x94,0xc5,0x64,0x21,0x08,0x4c,0x02,0x0e,0x80 }},
+ {16, 0x9670, 0, {0x97,0x82,0xa1,0xec,0x08,0x79,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9680, 0, {0x48,0x14,0xcd,0x44,0xb3,0x00,0x20,0xc0,0x08,0x30,0x02,0x4d,0x80,0x03,0x88,0x28 }},
+ {16, 0x9690, 0, {0xc0,0x08,0x3c,0x06,0x0f,0x00,0xa3,0x43,0x2c,0xc2,0x1b,0x38,0x02,0x0f,0x00,0x9b }},
+ {16, 0x96a0, 0, {0x88,0x64,0xd0,0x08,0xb8,0x02,0x8c,0x10,0x93,0x00,0x20,0xc0,0x08,0x30,0x0a,0x12 }},
+ {16, 0x96b0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xaa,0x00,0xfa,0x05,0x32,0x80 }},
+ {16, 0x96c0, 0, {0x8e,0xa0,0x0b,0x69,0x00,0xca,0x40,0x32,0xa0,0x3c,0xa8,0x03,0x2a,0x00,0xea,0x26 }},
+ {16, 0x96d0, 0, {0x3e,0xb0,0x0d,0xa1,0x63,0x28,0x20,0xca,0x40,0x36,0xa0,0x0c,0xe0,0x13,0x28,0x09 }},
+ {16, 0x96e0, 0, {0xde,0x00,0x32,0x80,0x2c,0xa0,0x03,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x96f0, 0, {0x48,0x00,0xf0,0x20,0xf4,0x00,0x3f,0x00,0x0f,0x40,0x23,0xb0,0x00,0xec,0x00,0x3f }},
+ {16, 0x9700, 0, {0x06,0x1e,0xc2,0x13,0xf0,0x88,0xfc,0x20,0x3f,0x04,0x8e,0xc0,0x03,0xf0,0x80,0xec }},
+ {16, 0x9710, 0, {0x40,0x3b,0x0c,0x0f,0xc0,0xa3,0xe0,0x00,0xe8,0x00,0x3e,0x00,0x4f,0x80,0x03,0xd2 }},
+ {16, 0x9720, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x00,0xf9,0x00,0x32,0x40 }},
+ {16, 0x9730, 0, {0x0c,0x90,0x03,0x24,0x00,0xc9,0x80,0x32,0x40,0x0f,0x90,0x53,0xe4,0x10,0xc9,0x00 }},
+ {16, 0x9740, 0, {0x32,0x40,0x0d,0x90,0x03,0xe4,0x00,0xf9,0x00,0x36,0x40,0x8f,0x90,0x03,0x24,0x10 }},
+ {16, 0x9750, 0, {0xc9,0x01,0x3c,0x40,0x0c,0x90,0x03,0xc2,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9760, 0, {0x80,0x04,0x47,0x44,0x89,0x00,0x20,0x40,0x08,0x90,0x02,0x25,0x0a,0x81,0x10,0x22 }},
+ {16, 0x9770, 0, {0x40,0x48,0x90,0x03,0xc4,0x00,0x89,0x00,0x76,0x40,0x28,0x90,0x02,0xe4,0x10,0xb9 }},
+ {16, 0x9780, 0, {0x40,0xb2,0x40,0x0b,0x90,0x03,0x64,0x00,0x89,0x00,0x2e,0x41,0x08,0x90,0x42,0xe0 }},
+ {16, 0x9790, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x24,0x02,0xbd,0x00,0x23,0x48 }},
+ {16, 0x97a0, 0, {0x08,0xd0,0x06,0x1d,0x04,0x8d,0x00,0x29,0xc0,0x4a,0xd0,0x22,0xf4,0x00,0x85,0x00 }},
+ {16, 0x97b0, 0, {0x61,0x40,0x18,0xd0,0x12,0xfc,0x00,0xbd,0x40,0xa3,0x40,0x4b,0xf0,0x02,0x04,0x01 }},
+ {16, 0x97c0, 0, {0x8b,0x00,0x2e,0x40,0x08,0x90,0x02,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x97d0, 0, {0x08,0x04,0x36,0x80,0x85,0x20,0xa3,0x48,0x08,0x52,0x0a,0x14,0x81,0x85,0x20,0x29 }},
+ {16, 0x97e0, 0, {0x48,0x08,0x52,0x02,0xb4,0x80,0x85,0x20,0x25,0x48,0x88,0x52,0x02,0xd4,0x80,0xb5 }},
+ {16, 0x97f0, 0, {0x20,0x21,0x48,0x0b,0x52,0x02,0x44,0xa2,0x81,0x00,0x2c,0x4a,0x08,0x12,0x82,0xc2 }},
+ {16, 0x9800, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xf8,0x51,0x22,0x00 }},
+ {16, 0x9810, 0, {0x2c,0x85,0x02,0x21,0x48,0xc8,0x00,0xba,0x14,0x0f,0x85,0x12,0xe1,0x42,0xc8,0x50 }},
+ {16, 0x9820, 0, {0x22,0x00,0x0c,0x00,0x03,0xe0,0x00,0xf8,0x50,0x32,0x00,0x07,0x45,0x03,0x20,0x80 }},
+ {16, 0x9830, 0, {0xc0,0x01,0x3e,0x08,0x2c,0x82,0x03,0xee,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9840, 0, {0x98,0x0d,0xe4,0x40,0xf1,0x10,0x3e,0x44,0x07,0x91,0x43,0xe4,0x58,0xf9,0x11,0x34 }},
+ {16, 0x9850, 0, {0x44,0x4f,0x91,0x02,0xe4,0x50,0xf9,0x10,0x3c,0x4f,0x0f,0x93,0x83,0xe4,0xf0,0xf9 }},
+ {16, 0x9860, 0, {0x11,0x3a,0x4f,0x0f,0x91,0x03,0xe4,0xa0,0xfd,0x28,0x3e,0x4a,0x0f,0x92,0x83,0xe6 }},
+ {16, 0x9870, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xf6,0xa0,0xcd,0xa0,0xb3,0x68 }},
+ {16, 0x9880, 0, {0x8c,0x9a,0x03,0x36,0x80,0xc5,0xa0,0x22,0x60,0x0c,0x9a,0x23,0x26,0x04,0xf9,0xa0 }},
+ {16, 0x9890, 0, {0x32,0x66,0x0c,0x9a,0x83,0x06,0x20,0xc5,0xa0,0x22,0x60,0x0c,0x9b,0x03,0x26,0x48 }},
+ {16, 0x98a0, 0, {0xc9,0x00,0x3e,0x78,0x0c,0x9a,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x98b0, 0, {0x38,0x00,0xe1,0x00,0x88,0x44,0x22,0x95,0x08,0x85,0x12,0xa1,0x42,0x88,0x40,0x02 }},
+ {16, 0x98c0, 0, {0x90,0x08,0x84,0x02,0x23,0xa0,0xba,0x40,0x22,0xa0,0x08,0x8e,0x92,0xa3,0xa0,0xa8 }},
+ {16, 0x98d0, 0, {0x40,0x2a,0x10,0x08,0xae,0x02,0x23,0x40,0x88,0x00,0x2e,0x38,0x08,0x84,0x12,0x0e }},
+ {16, 0x98e0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x15,0xc4,0x00,0x8b,0x12,0x22,0x40 }},
+ {16, 0x98f0, 0, {0x08,0x90,0x02,0x44,0x00,0x81,0x40,0xa0,0x50,0x08,0x11,0x0a,0x05,0x00,0xb1,0x10 }},
+ {16, 0x9900, 0, {0xa0,0x48,0x08,0x90,0x02,0x04,0x00,0x81,0x40,0x20,0x50,0x28,0x11,0x02,0x44,0x82 }},
+ {16, 0x9910, 0, {0x81,0x00,0x2c,0x50,0x08,0x11,0x02,0x02,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9920, 0, {0x18,0x15,0xa4,0x02,0x89,0x40,0x22,0x40,0x08,0x94,0x12,0xa5,0x00,0x89,0x28,0x22 }},
+ {16, 0x9930, 0, {0x49,0x08,0x94,0x02,0x24,0x48,0xb9,0x14,0x22,0x40,0x08,0x94,0x02,0xa4,0x40,0xa1 }},
+ {16, 0x9940, 0, {0x50,0x2a,0x50,0x08,0x91,0x42,0x64,0x00,0x89,0x40,0x2e,0x40,0x08,0x10,0x02,0x06 }},
+ {16, 0x9950, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x00,0xc9,0x00,0x30,0x70 }},
+ {16, 0x9960, 0, {0x2c,0x10,0x0b,0x66,0x00,0xc9,0x40,0x32,0x50,0x0c,0x90,0x03,0x26,0x20,0xf9,0xc0 }},
+ {16, 0x9970, 0, {0x32,0x70,0x0c,0x90,0x03,0x26,0x20,0xc9,0x00,0x32,0x40,0x0c,0x9c,0x03,0x64,0x00 }},
+ {16, 0x9980, 0, {0xc9,0x41,0x3e,0x40,0x2c,0x90,0x0b,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9990, 0, {0x28,0x01,0xa4,0x00,0xf9,0x04,0x3e,0x48,0x0f,0x90,0x03,0xe4,0x88,0xf9,0x00,0x34 }},
+ {16, 0x99a0, 0, {0x41,0x2f,0x9c,0x03,0xe4,0x10,0xf9,0x00,0x3e,0x44,0x2f,0x99,0x03,0xe4,0x10,0xf9 }},
+ {16, 0x99b0, 0, {0x00,0x3e,0x50,0x0f,0x10,0x4b,0xa4,0x10,0xf9,0x20,0x3c,0x40,0x0f,0x90,0x03,0x4a }},
+ {16, 0x99c0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x00,0xc8,0x00,0x3e,0x10 }},
+ {16, 0x99d0, 0, {0x2c,0x80,0x03,0x20,0x02,0xc0,0x40,0x32,0x00,0x1c,0x04,0x0f,0x21,0x00,0xc0,0x04 }},
+ {16, 0x99e0, 0, {0x38,0x00,0x0f,0x80,0x03,0x21,0x08,0xc8,0x60,0x30,0x10,0x0f,0x80,0x02,0x20,0x00 }},
+ {16, 0x99f0, 0, {0xf8,0x00,0x32,0x00,0x0c,0x80,0x03,0xca,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9a00, 0, {0x28,0x05,0x1a,0x20,0x82,0x04,0x2f,0x80,0x08,0xa0,0x02,0x38,0x00,0x8e,0x80,0x22 }},
+ {16, 0x9a10, 0, {0x80,0x08,0xe0,0x02,0x28,0x00,0x8a,0x00,0x22,0x81,0x0b,0x20,0x02,0x28,0x00,0xde }},
+ {16, 0x9a20, 0, {0xe4,0x36,0x80,0x0b,0xa0,0x42,0x28,0x00,0xba,0x04,0x22,0x80,0x08,0xa0,0x02,0xca }},
+ {16, 0x9a30, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0x83,0x01,0x2c,0x80 }},
+ {16, 0x9a40, 0, {0x08,0x30,0x02,0x2e,0x60,0x82,0x90,0xa0,0xc0,0x48,0x30,0x02,0x0c,0x02,0x83,0x00 }},
+ {16, 0x9a50, 0, {0x28,0xc0,0x0b,0x30,0x0a,0x2c,0x00,0x83,0xc2,0x20,0xc0,0x0b,0x30,0x2a,0x2c,0x00 }},
+ {16, 0x9a60, 0, {0xb3,0x00,0xa0,0xc0,0x08,0x30,0x02,0xca,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9a70, 0, {0xa0,0x01,0x3c,0x00,0x87,0x01,0x2d,0xc2,0x08,0xf3,0x12,0x3c,0x00,0x8f,0x01,0x21 }},
+ {16, 0x9a80, 0, {0xc8,0x68,0x72,0x22,0x1e,0x04,0x87,0x20,0x21,0xc4,0x0b,0x70,0x02,0x3c,0x84,0x9f }},
+ {16, 0x9a90, 0, {0x00,0x25,0xc4,0x4b,0x70,0x02,0x1c,0x04,0xb7,0x81,0x21,0xc8,0x08,0x72,0x02,0xe8 }},
+ {16, 0x9aa0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x00,0x1e,0x00,0xc7,0x81,0x3c,0xa0 }},
+ {16, 0x9ab0, 0, {0x4c,0x7a,0x0b,0x1a,0x00,0xc6,0x80,0x30,0xe0,0x08,0xf8,0x82,0x0e,0x40,0xcf,0xf0 }},
+ {16, 0x9ac0, 0, {0x39,0xe8,0x0f,0x3a,0x03,0x1e,0x20,0xc7,0x80,0x31,0xe3,0x0f,0x38,0x23,0x1f,0x08 }},
+ {16, 0x9ad0, 0, {0xff,0xc0,0x33,0xf2,0x0c,0x7e,0x03,0xea,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9ae0, 0, {0x08,0x15,0x88,0x0a,0x7b,0x00,0x3e,0xc1,0x0b,0x34,0x23,0xc8,0x10,0xfb,0x02,0x3e }},
+ {16, 0x9af0, 0, {0xca,0x0f,0xb7,0x43,0xec,0x80,0xfb,0x00,0x2e,0xc2,0x0b,0xb4,0x83,0xed,0xd0,0xfa }},
+ {16, 0x9b00, 0, {0x00,0x3e,0xd9,0x0f,0xb3,0x83,0xec,0x80,0xbb,0x20,0x3e,0xd8,0x2f,0xb4,0x03,0xc2 }},
+ {16, 0x9b10, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xfe,0x00,0xf5,0x91,0x31,0xa0 }},
+ {16, 0x9b20, 0, {0x0c,0xfc,0x03,0xfe,0x00,0xc4,0x81,0x31,0xee,0x8d,0xf8,0x0a,0x3e,0x30,0xcf,0x84 }},
+ {16, 0x9b30, 0, {0x33,0xe0,0x2c,0xf8,0x83,0xfe,0x10,0xfe,0x80,0x33,0xe0,0x0c,0xf9,0x19,0x3f,0x48 }},
+ {16, 0x9b40, 0, {0xcf,0xc0,0x33,0xe0,0x04,0xfc,0x03,0xc0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9b50, 0, {0xa8,0x11,0x9c,0x08,0xb7,0xa1,0x21,0xc8,0x08,0x71,0x02,0xf0,0xa0,0x85,0x20,0x21 }},
+ {16, 0x9b60, 0, {0xce,0x08,0x70,0x02,0x3c,0x80,0x8f,0x00,0x2b,0xc5,0x08,0x71,0x02,0xdc,0x10,0xb4 }},
+ {16, 0x9b70, 0, {0x00,0x21,0xc1,0x0a,0xf3,0x82,0x0c,0x00,0x87,0x01,0x29,0xc0,0x08,0x71,0x02,0x6a }},
+ {16, 0x9b80, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9d,0x00,0xbd,0x21,0x27,0x82 }},
+ {16, 0x9b90, 0, {0x00,0x70,0x02,0xfc,0x04,0x8c,0x00,0xa7,0xcc,0xa8,0x70,0x02,0x3c,0x08,0xaf,0x00 }},
+ {16, 0x9ba0, 0, {0x21,0xc0,0x08,0x70,0x02,0xdc,0x00,0xb7,0x00,0x21,0xc4,0x08,0x70,0x16,0x1c,0x0a }},
+ {16, 0x9bb0, 0, {0x8f,0x00,0x21,0xc0,0x08,0x70,0x02,0xc0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9bc0, 0, {0x20,0x10,0xc8,0x00,0xbb,0x44,0x24,0xe2,0x08,0xb1,0x02,0xc2,0x80,0x01,0x80,0x24 }},
+ {16, 0x9bd0, 0, {0xd0,0x88,0x30,0x02,0x0f,0x52,0x83,0x91,0x28,0xe4,0x88,0x3d,0x02,0xce,0xd0,0xb0 }},
+ {16, 0x9be0, 0, {0xb2,0xa2,0xc0,0x0a,0x34,0x12,0x0c,0x02,0x83,0x00,0x28,0xc0,0x08,0x30,0x02,0x48 }},
+ {16, 0x9bf0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xac,0x00,0xfb,0x01,0xe4,0x40 }},
+ {16, 0x9c00, 0, {0x2c,0xf0,0x43,0xe5,0x00,0x8a,0x88,0x37,0xe0,0x00,0xfa,0x02,0x3d,0x00,0xef,0x00 }},
+ {16, 0x9c10, 0, {0x33,0xd1,0x0c,0xf4,0x03,0xfd,0x00,0xf9,0x40,0x33,0xe8,0x0c,0xfc,0x01,0x3c,0x04 }},
+ {16, 0x9c20, 0, {0xcf,0x02,0x33,0xc0,0x2c,0xf0,0x03,0xea,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9c30, 0, {0x80,0x00,0xee,0x08,0xf9,0x10,0x3a,0xd0,0x0f,0xb0,0x93,0xec,0x00,0xfb,0x0b,0x3a }},
+ {16, 0x9c40, 0, {0xc0,0x8e,0xb0,0x83,0xec,0x80,0xfb,0x09,0x7e,0xc8,0x0f,0xb2,0x13,0xec,0x00,0xf9 }},
+ {16, 0x9c50, 0, {0x00,0x3e,0xc2,0x8f,0xb2,0x4b,0xcc,0x04,0xfb,0x00,0x3e,0xc0,0x0f,0xb0,0x03,0x60 }},
+ {16, 0x9c60, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x00,0xff,0x08,0x33,0xc0 }},
+ {16, 0x9c70, 0, {0x1c,0xf0,0x03,0x70,0x40,0xc4,0xc0,0x33,0xc2,0x0f,0xf0,0x03,0x1c,0x10,0xc7,0x00 }},
+ {16, 0x9c80, 0, {0x31,0xc0,0x0c,0x70,0x03,0x1c,0x00,0xc5,0x41,0x33,0xc0,0x0c,0xf0,0x23,0x2c,0x00 }},
+ {16, 0x9c90, 0, {0xcf,0x00,0xb3,0xc0,0x6c,0xf0,0x03,0x80,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9ca0, 0, {0x81,0x04,0x6a,0x00,0xb9,0x90,0x32,0xf1,0x08,0xb0,0x02,0x0a,0x10,0xd9,0x00,0x22 }},
+ {16, 0x9cb0, 0, {0xc1,0x0b,0xb0,0x02,0x2c,0x00,0xcb,0x06,0x22,0xc0,0x88,0xb0,0x12,0x2c,0x00,0x88 }},
+ {16, 0x9cc0, 0, {0x80,0x22,0xc1,0x0d,0xb0,0x02,0x2c,0x00,0x83,0x00,0x22,0xc1,0x08,0xb0,0x46,0xe0 }},
+ {16, 0x9cd0, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x2e,0x00,0xb9,0x00,0x22,0xf0 }},
+ {16, 0x9ce0, 0, {0x08,0xb0,0x12,0x64,0x00,0x8a,0x00,0x22,0xc0,0x0b,0x30,0x42,0x2c,0x00,0x8b,0x00 }},
+ {16, 0x9cf0, 0, {0x22,0xc0,0x08,0xb0,0x02,0x2c,0x00,0x8a,0x00,0x22,0xc0,0x88,0x30,0x0a,0x2c,0x00 }},
+ {16, 0x9d00, 0, {0x8b,0x00,0x20,0xc0,0x08,0xb0,0x02,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9d10, 0, {0x08,0x04,0x0c,0x04,0xb1,0x02,0xe4,0xc1,0x08,0xb0,0x22,0x20,0x02,0x93,0x00,0x20 }},
+ {16, 0x9d20, 0, {0xc0,0x0b,0x30,0x12,0x0c,0x02,0x83,0x02,0xa0,0xc0,0x28,0x30,0x0e,0x0c,0x02,0x80 }},
+ {16, 0x9d30, 0, {0x00,0xa0,0xc0,0x49,0x30,0x0a,0x0c,0x02,0x8b,0x00,0x20,0xc0,0x08,0x30,0x02,0xc2 }},
+ {16, 0x9d40, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x6c,0x00,0xf9,0x24,0x32,0xc0 }},
+ {16, 0x9d50, 0, {0x08,0xf0,0x03,0x64,0x00,0xc8,0x00,0xb3,0xc0,0x1f,0xf0,0x0b,0x3c,0x00,0x8f,0x00 }},
+ {16, 0x9d60, 0, {0x33,0xc0,0x4c,0xf0,0x43,0x3c,0x08,0xc3,0x00,0x31,0xc0,0x0c,0xf0,0x03,0x3d,0x48 }},
+ {16, 0x9d70, 0, {0xcf,0x00,0x31,0xc0,0x0c,0xf0,0x03,0x80,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9d80, 0, {0xa0,0x1d,0xf0,0x04,0xf9,0x41,0x3b,0xc0,0x4f,0xf0,0x03,0xf0,0x11,0xfd,0x00,0x3f }},
+ {16, 0x9d90, 0, {0xc0,0x87,0x70,0x27,0xfc,0x00,0xef,0x06,0x3f,0xc0,0x0f,0xf0,0x02,0xfc,0x08,0xfc }},
+ {16, 0x9da0, 0, {0x00,0x3f,0xc0,0x47,0xf0,0x43,0xfc,0x00,0x77,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0xe8 }},
+ {16, 0x9db0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xd2,0x00,0xc7,0x01,0x37,0x0c }},
+ {16, 0x9dc0, 0, {0x0f,0xe8,0x23,0x10,0x4a,0xc4,0xc0,0x31,0x30,0x0c,0xc9,0x03,0x34,0x46,0xcf,0x10 }},
+ {16, 0x9dd0, 0, {0x33,0xd0,0x0c,0xf4,0x03,0x3c,0x58,0xcf,0x00,0x33,0xc0,0x2d,0xf1,0x03,0x3e,0x02 }},
+ {16, 0x9de0, 0, {0xcf,0x21,0x3f,0xe4,0x0f,0xf2,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9df0, 0, {0x80,0x10,0xe4,0x84,0x0b,0x40,0x22,0x4c,0x0b,0xa8,0x02,0x2c,0xc0,0x8b,0x20,0x22 }},
+ {16, 0x9e00, 0, {0xc8,0x4a,0x32,0x02,0x24,0x80,0x83,0x20,0x20,0xc0,0x08,0x30,0x02,0x20,0x00,0x8b }},
+ {16, 0x9e10, 0, {0x21,0x32,0xca,0x48,0x32,0x02,0x2c,0x30,0x8f,0x90,0x2e,0x88,0x0b,0xbd,0x12,0x20 }},
+ {16, 0x9e20, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xce,0x20,0xa3,0x40,0xe0,0x48 }},
+ {16, 0x9e30, 0, {0x4b,0x20,0x22,0x0c,0x02,0x82,0x00,0x2a,0x00,0x08,0x20,0x02,0x04,0x80,0x80,0x20 }},
+ {16, 0x9e40, 0, {0x20,0xc8,0x08,0x02,0x02,0x0c,0x00,0x80,0x0c,0x60,0x00,0x08,0x20,0x12,0x2c,0x88 }},
+ {16, 0x9e50, 0, {0x83,0x00,0x2c,0xe8,0x0b,0x30,0x02,0x62,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9e60, 0, {0xc0,0x15,0xae,0x00,0xab,0x01,0xa2,0x60,0x0b,0xa0,0x02,0x20,0x01,0x81,0x00,0x22 }},
+ {16, 0x9e70, 0, {0xc0,0x0a,0x90,0x12,0x04,0x20,0x8a,0x08,0x22,0xc1,0x08,0xa0,0x02,0x28,0x00,0x88 }},
+ {16, 0x9e80, 0, {0x00,0x24,0x44,0x08,0xa2,0x02,0xac,0x00,0x8b,0x04,0x2e,0x88,0x03,0xb0,0x02,0x70 }},
+ {16, 0x9e90, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x15,0xec,0x00,0xea,0x90,0x32,0x28 }},
+ {16, 0x9ea0, 0, {0x0f,0xb6,0x03,0x20,0x08,0xc9,0x04,0x3a,0xc0,0x4c,0x90,0x22,0x24,0x00,0xcb,0x40 }},
+ {16, 0x9eb0, 0, {0x32,0xa8,0x0c,0xb2,0x03,0x2c,0x00,0xcb,0x80,0xb2,0xe0,0x0c,0xb0,0x0b,0x04,0x00 }},
+ {16, 0x9ec0, 0, {0xcb,0x00,0x3e,0xc0,0x4f,0xb0,0x0b,0x50,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9ed0, 0, {0xe0,0x01,0xbc,0x00,0xdf,0x80,0x3b,0x81,0x0f,0xf0,0xc3,0xfc,0x00,0xbe,0x01,0x1f }},
+ {16, 0x9ee0, 0, {0x00,0x0f,0xe0,0x23,0xf4,0x00,0xff,0x00,0x3f,0xb0,0x4f,0xf0,0x43,0xd4,0x02,0xff }},
+ {16, 0x9ef0, 0, {0x91,0x3a,0xe0,0x4e,0xf0,0x03,0x7c,0x0c,0xff,0x00,0x2f,0x80,0x0f,0x30,0x03,0xb8 }},
+ {16, 0x9f00, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xac,0x01,0xca,0x00,0x72,0x50 }},
+ {16, 0x9f10, 0, {0x04,0xb4,0x03,0x2c,0x82,0xcb,0x00,0x32,0xe0,0x0c,0xb8,0x03,0x27,0x04,0xc8,0xc8 }},
+ {16, 0x9f20, 0, {0xb2,0xa2,0x0c,0x88,0x03,0x2c,0x00,0xc1,0x00,0x3e,0x00,0x2c,0x30,0x1b,0x2c,0x04 }},
+ {16, 0x9f30, 0, {0xfb,0x10,0x3e,0xc0,0x0f,0xb0,0x03,0x10,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9f40, 0, {0xc8,0x05,0x2c,0x04,0x03,0x50,0xa2,0xe0,0x08,0x34,0x42,0x33,0x00,0x88,0x00,0x20 }},
+ {16, 0x9f50, 0, {0x10,0x0d,0x84,0x03,0x25,0x00,0x8a,0x40,0x22,0x90,0x08,0xa5,0x02,0x2c,0x00,0x89 }},
+ {16, 0x9f60, 0, {0xa4,0x3a,0x40,0x08,0xb0,0x02,0x2c,0x00,0xbf,0x84,0x2e,0x80,0x0b,0xf0,0x52,0x32 }},
+ {16, 0x9f70, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x6c,0x80,0x81,0x80,0x24,0x88 }},
+ {16, 0x9f80, 0, {0x89,0x3c,0x26,0x21,0x00,0x90,0x00,0x20,0x02,0x08,0x80,0x82,0x00,0x20,0x9b,0x00 }},
+ {16, 0x9f90, 0, {0x22,0x40,0x88,0xb0,0x12,0x0c,0x08,0x83,0x80,0x2c,0xc0,0x08,0x10,0x02,0x0c,0x00 }},
+ {16, 0x9fa0, 0, {0xb3,0x80,0x2c,0x40,0x0b,0x30,0x02,0x38,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0x9fb0, 0, {0x20,0x01,0x3e,0x0a,0x85,0xa0,0xa5,0x60,0x08,0xfb,0x82,0x3e,0x84,0x9f,0x81,0x63 }},
+ {16, 0x9fc0, 0, {0xe0,0x89,0x79,0x12,0x52,0x80,0x97,0x82,0x21,0x6c,0x18,0x78,0x02,0x12,0x00,0x87 }},
+ {16, 0x9fd0, 0, {0xa1,0x29,0xe0,0x08,0x5b,0x02,0x1e,0x00,0xb7,0xc0,0x2d,0x60,0x0b,0x78,0x02,0x08 }},
+ {16, 0x9fe0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x0c,0x00,0x81,0x08,0x26,0xc2 }},
+ {16, 0x9ff0, 0, {0x2c,0x32,0x13,0x0e,0xa4,0xd2,0x00,0xb0,0x00,0x1c,0x21,0x12,0x24,0x02,0xd1,0x20 }},
+ {16, 0xa000, 0, {0x30,0xc8,0x0c,0x10,0x03,0x0c,0x00,0xc2,0x10,0x3c,0x80,0x0c,0x23,0x03,0x0c,0x40 }},
+ {16, 0xa010, 0, {0xf3,0x00,0x3c,0x48,0x0f,0x30,0x0b,0x12,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa020, 0, {0x40,0x1d,0xbc,0x00,0xfd,0x20,0xbb,0x40,0x07,0x72,0x02,0xf0,0x10,0xed,0x10,0x3f }},
+ {16, 0xa030, 0, {0xc4,0x0f,0xd1,0x63,0xb4,0x80,0xef,0x00,0x3f,0xc8,0x0f,0xf0,0x03,0xd8,0x00,0xfe }},
+ {16, 0xa040, 0, {0x34,0x3f,0xc4,0x0f,0xeb,0x43,0xfc,0x00,0xff,0x08,0x7f,0x40,0x0f,0xf1,0x83,0xd0 }},
+ {16, 0xa050, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xec,0x00,0xc8,0x00,0x33,0x80 }},
+ {16, 0xa060, 0, {0x8f,0x28,0x03,0x20,0x00,0x49,0x02,0x32,0xc0,0x0f,0x90,0x03,0x20,0x00,0xcb,0x00 }},
+ {16, 0xa070, 0, {0x32,0x40,0x4c,0xb0,0x0b,0x2c,0x00,0xcb,0x80,0x32,0xc0,0x0e,0x9e,0x03,0x24,0x00 }},
+ {16, 0xa080, 0, {0xfb,0x20,0x3e,0xc0,0x0f,0xb0,0x03,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa090, 0, {0x48,0x11,0x9c,0x00,0x8d,0x01,0x21,0xc0,0x0b,0x60,0x02,0x1d,0x00,0xd6,0x00,0x21 }},
+ {16, 0xa0a0, 0, {0x00,0x0b,0xe0,0x02,0x00,0x00,0x83,0x04,0x20,0x40,0x08,0x70,0x42,0x34,0x02,0x87 }},
+ {16, 0xa0b0, 0, {0x01,0x23,0xc0,0x28,0x51,0x0a,0x1c,0x04,0xb7,0x30,0x2d,0xc0,0x0b,0x72,0x03,0x92 }},
+ {16, 0xa0c0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x9e,0x00,0xa6,0x40,0x21,0xa0 }},
+ {16, 0xa0d0, 0, {0x0b,0x68,0x02,0x0e,0x00,0x8f,0x80,0x21,0xe0,0x0b,0x78,0x02,0x16,0x10,0xa5,0x80 }},
+ {16, 0xa0e0, 0, {0x21,0xe0,0x08,0x18,0x02,0x1e,0x00,0x83,0x80,0x21,0xa0,0x08,0x78,0x02,0x1f,0x00 }},
+ {16, 0xa0f0, 0, {0xb7,0x80,0x2d,0xe0,0x0b,0x38,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa100, 0, {0x48,0x14,0xec,0x12,0xa1,0x64,0x20,0xe6,0x0b,0x20,0x02,0x00,0x10,0x90,0x4a,0x20 }},
+ {16, 0xa110, 0, {0x20,0x4b,0x00,0x42,0x04,0x00,0x83,0x00,0x20,0xc2,0x08,0x30,0x02,0x8c,0x00,0x83 }},
+ {16, 0xa120, 0, {0x04,0x20,0xc0,0x08,0x30,0x02,0x0e,0x00,0xb3,0x00,0x2c,0xe0,0x4b,0x30,0x02,0x92 }},
+ {16, 0xa130, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xb8,0x00,0xee,0xc0,0x33,0x90 }},
+ {16, 0xa140, 0, {0x0f,0xa0,0x1b,0x08,0x00,0xca,0x40,0xb2,0x82,0x0f,0xa0,0x0b,0x28,0x02,0xca,0x00 }},
+ {16, 0xa150, 0, {0xb2,0x90,0xac,0xa0,0x03,0x29,0x00,0xca,0x40,0xb2,0x80,0x8e,0xa4,0x03,0x2a,0x00 }},
+ {16, 0xa160, 0, {0xfa,0x00,0x3f,0xa8,0x0f,0xa0,0x0b,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa170, 0, {0x48,0x00,0xe2,0x02,0x90,0x00,0x3e,0x00,0x0f,0x88,0x03,0xf1,0x00,0xfc,0x02,0x3f }},
+ {16, 0xa180, 0, {0x20,0x0f,0xc8,0x03,0xc1,0x00,0xf0,0x00,0x3e,0x00,0x8f,0x00,0x01,0x60,0x02,0xf8 }},
+ {16, 0xa190, 0, {0x08,0x3e,0x00,0x0f,0x80,0x83,0xe0,0x00,0xf8,0x00,0x2e,0x00,0x8f,0x80,0x13,0x92 }},
+ {16, 0xa1a0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x02,0xc9,0x00,0xb2,0x64 }},
+ {16, 0xa1b0, 0, {0x0f,0x91,0x03,0xe4,0x04,0xc9,0x00,0x32,0x40,0x6c,0x90,0x03,0x25,0x02,0xc9,0x90 }},
+ {16, 0xa1c0, 0, {0xb0,0x40,0x0c,0x90,0x03,0x24,0x20,0xc9,0xa0,0x3e,0x40,0x4c,0x90,0x23,0xe4,0x00 }},
+ {16, 0xa1d0, 0, {0xf1,0x00,0x92,0x40,0x0c,0x10,0x03,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa1e0, 0, {0x80,0x04,0x64,0x00,0x89,0x80,0xa2,0x40,0x0b,0x96,0x42,0xe5,0x04,0x89,0x00,0x22 }},
+ {16, 0xa1f0, 0, {0x40,0x08,0x90,0x02,0x24,0x08,0x09,0x41,0x22,0x40,0x48,0x90,0x42,0x24,0x04,0x89 }},
+ {16, 0xa200, 0, {0x80,0x26,0x40,0x08,0x90,0x02,0xe4,0x00,0xb9,0x00,0x22,0x40,0x08,0x94,0x02,0x20 }},
+ {16, 0xa210, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x25,0x00,0x89,0x20,0x22,0x40 }},
+ {16, 0xa220, 0, {0x0b,0x90,0x02,0xf4,0x84,0x85,0x00,0x21,0x40,0x48,0x50,0x02,0x24,0x20,0x8d,0x08 }},
+ {16, 0xa230, 0, {0x23,0x40,0x08,0xd0,0x02,0x94,0x00,0x8d,0x00,0x29,0x40,0x0a,0xd0,0x02,0xa4,0x08 }},
+ {16, 0xa240, 0, {0xb9,0x00,0x28,0x40,0x18,0x90,0xc2,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa250, 0, {0x08,0x04,0x05,0x00,0x81,0x00,0x20,0x51,0x0b,0x10,0x02,0xf5,0x80,0x85,0xc1,0xa1 }},
+ {16, 0xa260, 0, {0x50,0x08,0x54,0x0a,0x05,0x06,0x85,0x40,0x21,0x50,0x88,0x54,0x02,0x95,0x00,0x85 }},
+ {16, 0xa270, 0, {0x44,0x2d,0x50,0x2a,0x54,0x12,0xc5,0x01,0xb1,0x00,0x08,0x50,0x08,0x10,0x02,0x02 }},
+ {16, 0xa280, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xca,0x50,0x32,0x80 }},
+ {16, 0xa290, 0, {0x0f,0x80,0x03,0xe8,0x02,0xc8,0x01,0x32,0x00,0x2c,0xc0,0x03,0x20,0x00,0xc8,0x02 }},
+ {16, 0xa2a0, 0, {0x32,0x00,0x2c,0x80,0x0b,0xa0,0x00,0xc8,0x00,0x3a,0x00,0x4e,0x40,0x23,0xa0,0x08 }},
+ {16, 0xa2b0, 0, {0xf8,0x00,0x3a,0x00,0x2c,0x80,0x0b,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa2c0, 0, {0x98,0x1d,0xdc,0x04,0xfd,0x40,0x3f,0x50,0x4f,0x90,0x63,0xe4,0x40,0xf1,0x02,0x3e }},
+ {16, 0xa2d0, 0, {0x41,0x0f,0x90,0x13,0xf5,0x04,0xf9,0x41,0x3e,0x50,0x0f,0x94,0x43,0x65,0x02,0xf9 }},
+ {16, 0xa2e0, 0, {0x41,0x36,0x50,0x4d,0x94,0x03,0xf4,0x00,0xf9,0x41,0x37,0x40,0x4f,0x94,0x03,0xe6 }},
+ {16, 0xa2f0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0xfc,0x00,0xcd,0xa8,0x33,0x70 }},
+ {16, 0xa300, 0, {0x0f,0xd0,0x13,0xf6,0x88,0xcd,0x00,0x32,0x50,0x4f,0x14,0x23,0x07,0xa0,0xc9,0xc0 }},
+ {16, 0xa310, 0, {0x32,0x78,0x0c,0x9e,0x03,0x37,0x02,0xcd,0xc0,0x32,0x64,0x0f,0x98,0x03,0x24,0x00 }},
+ {16, 0xa320, 0, {0xcd,0x00,0x32,0x40,0x2c,0xda,0x03,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa330, 0, {0x38,0x10,0xe2,0x08,0x88,0xeb,0x22,0x30,0x0b,0x80,0x12,0xe8,0x04,0xa0,0xa0,0x2a }},
+ {16, 0xa340, 0, {0x20,0x0b,0x8a,0x0a,0x23,0x00,0x88,0x80,0x22,0x28,0x00,0xc8,0x42,0x23,0x80,0x80 }},
+ {16, 0xa350, 0, {0xd4,0x20,0x28,0x09,0x80,0x02,0x22,0x94,0xa8,0x00,0x2a,0x00,0x88,0x85,0x02,0x0e }},
+ {16, 0xa360, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xc4,0xa0,0x83,0x00,0x24,0xd8 }},
+ {16, 0xa370, 0, {0x8b,0x10,0x02,0xe5,0x14,0x89,0x0a,0x21,0x48,0x0b,0x52,0x02,0x54,0x80,0x85,0x40 }},
+ {16, 0xa380, 0, {0x25,0x58,0x09,0x56,0x02,0x45,0x02,0x81,0x20,0x20,0x50,0x0b,0x14,0x02,0x04,0x30 }},
+ {16, 0xa390, 0, {0x81,0x00,0x20,0x40,0x08,0x10,0x02,0x42,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa3a0, 0, {0x18,0x15,0xa4,0x12,0x89,0x00,0xa6,0x40,0x0b,0x90,0x42,0xe4,0x98,0xa9,0x80,0x2b }},
+ {16, 0xa3b0, 0, {0x40,0x0b,0x51,0x02,0x55,0x00,0x9d,0x08,0x27,0x48,0x09,0xf6,0x02,0x44,0x00,0x81 }},
+ {16, 0xa3c0, 0, {0x04,0x22,0x40,0x19,0x91,0x8a,0x24,0x80,0xa9,0x00,0x2a,0x40,0x08,0x90,0x02,0x46 }},
+ {16, 0xa3d0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe7,0x02,0xc9,0x04,0x36,0x58 }},
+ {16, 0xa3e0, 0, {0x0f,0x90,0x03,0xc5,0x00,0xc9,0x00,0x32,0x40,0x0f,0x90,0x13,0x64,0x02,0xc9,0x00 }},
+ {16, 0xa3f0, 0, {0x36,0x40,0x2d,0x90,0x0b,0x66,0x04,0xc9,0xe0,0xb2,0x48,0x8f,0x98,0x47,0x24,0x00 }},
+ {16, 0xa400, 0, {0xc9,0x00,0x72,0x40,0x0c,0x10,0x03,0x68,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa410, 0, {0x28,0x01,0xa5,0x08,0xf9,0x21,0x3a,0x40,0x0f,0x90,0x03,0xe6,0x04,0xf9,0x00,0x3e }},
+ {16, 0xa420, 0, {0x40,0x4f,0x98,0x83,0xa4,0x00,0xe9,0x40,0xba,0x60,0x0e,0x90,0x03,0xa4,0x80,0xf9 }},
+ {16, 0xa430, 0, {0xa3,0x3e,0x48,0x0f,0x98,0x0b,0xe4,0x00,0xf9,0x00,0x1e,0x40,0x0f,0x90,0x03,0x8a }},
+ {16, 0xa440, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa2,0x48,0xc8,0x20,0x32,0x08 }},
+ {16, 0xa450, 0, {0x1f,0x80,0x83,0xe1,0x22,0xc8,0x01,0x33,0x00,0x2c,0xc0,0x03,0x30,0x04,0xcc,0x40 }},
+ {16, 0xa460, 0, {0xb1,0x00,0x0c,0x44,0x03,0x20,0x12,0xc8,0x41,0x32,0x00,0x2d,0x84,0x0b,0x60,0x00 }},
+ {16, 0xa470, 0, {0xf8,0x00,0xb2,0x00,0x4c,0x80,0x0b,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa480, 0, {0x28,0x05,0x3a,0x00,0xa6,0x00,0x23,0x90,0x03,0xe4,0x92,0xf8,0x00,0x82,0x00,0x36 }},
+ {16, 0xa490, 0, {0x80,0x08,0xa0,0x03,0x68,0x00,0xca,0x00,0x22,0x83,0x08,0xa0,0x02,0x28,0x03,0x8a }},
+ {16, 0xa4a0, 0, {0x00,0x22,0x80,0x08,0xa0,0x02,0x28,0x00,0xb6,0x80,0x22,0x80,0x0d,0xe8,0x02,0x0a }},
+ {16, 0xa4b0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x6e,0x00,0x82,0x42,0x20,0xc0 }},
+ {16, 0xa4c0, 0, {0x0b,0x34,0x02,0xcd,0x09,0x80,0x00,0x20,0x00,0x08,0x00,0x02,0x00,0x02,0x98,0x00 }},
+ {16, 0xa4d0, 0, {0x20,0x20,0x28,0x00,0x0a,0x04,0x10,0x81,0x80,0x20,0xc0,0x08,0xb0,0x02,0x2c,0x00 }},
+ {16, 0xa4e0, 0, {0xb3,0x00,0x22,0xc0,0x18,0x31,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa4f0, 0, {0xa0,0x01,0x38,0x02,0xa3,0x00,0x21,0x40,0x1b,0x70,0x02,0xdc,0x20,0x84,0x05,0x65 }},
+ {16, 0xa500, 0, {0xe0,0x08,0xf0,0x02,0x7c,0x10,0x97,0x00,0x24,0xc0,0x08,0x30,0x02,0x54,0x88,0x87 }},
+ {16, 0xa510, 0, {0x09,0x21,0xe8,0x09,0x33,0x02,0x1c,0x80,0xb6,0x08,0x63,0xc8,0x09,0x38,0x12,0x28 }},
+ {16, 0xa520, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x1e,0x00,0xc7,0xa0,0xa1,0xe0 }},
+ {16, 0xa530, 0, {0x0b,0x78,0x03,0xfe,0x00,0xc5,0x82,0x33,0x20,0x0c,0x48,0x03,0x1e,0x01,0xdf,0x80 }},
+ {16, 0xa540, 0, {0x31,0x20,0x0c,0x48,0x03,0x06,0x40,0x87,0x82,0x31,0xf8,0x0d,0x7b,0x03,0x5f,0x00 }},
+ {16, 0xa550, 0, {0xf3,0x80,0x31,0xf2,0x0c,0x60,0x03,0x2a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa560, 0, {0x08,0x1d,0x9c,0x00,0xfb,0x01,0x2f,0x40,0x07,0xb0,0x03,0xe8,0x04,0xf9,0x00,0x3e }},
+ {16, 0xa570, 0, {0xc1,0x0f,0xb0,0x03,0xe0,0x06,0xe8,0x02,0x3a,0xc0,0x0f,0xb0,0x01,0xa4,0x10,0xf9 }},
+ {16, 0xa580, 0, {0x40,0xbe,0xd0,0x06,0xb0,0x03,0xee,0x00,0xfa,0x00,0x3c,0xd8,0x0f,0xa0,0x03,0xc2 }},
+ {16, 0xa590, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xf6,0x00,0xcf,0x88,0x33,0x64 }},
+ {16, 0xa5a0, 0, {0x2c,0xf8,0x03,0xfe,0x02,0xc4,0xb0,0x33,0x20,0x8c,0xd8,0x03,0x32,0x00,0xcc,0xb4 }},
+ {16, 0xa5b0, 0, {0x33,0xa0,0x0c,0xc8,0x03,0x16,0x20,0xcf,0xc0,0x33,0xf0,0x0c,0xf8,0x03,0xfe,0x00 }},
+ {16, 0xa5c0, 0, {0xcd,0x80,0x3f,0xe0,0x0f,0xd8,0x03,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa5d0, 0, {0xa8,0x11,0xb5,0x04,0x87,0x12,0xa1,0x50,0x0a,0x74,0x12,0xc4,0x40,0x84,0x11,0x23 }},
+ {16, 0xa5e0, 0, {0xc0,0x28,0xe0,0x02,0x1c,0x02,0xa7,0x11,0x21,0x58,0x48,0x70,0x0a,0x14,0x00,0x8d }},
+ {16, 0xa5f0, 0, {0x00,0x23,0xc0,0x0b,0x70,0x02,0xfc,0x40,0x86,0x00,0x2d,0xc0,0x0b,0x50,0x02,0x2a }},
+ {16, 0xa600, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x95,0x00,0x87,0x40,0x21,0x00 }},
+ {16, 0xa610, 0, {0x18,0x71,0x02,0xdc,0x00,0x95,0x28,0xe1,0x02,0x08,0x50,0x02,0x3c,0x42,0xa7,0x22 }},
+ {16, 0xa620, 0, {0x21,0x80,0x88,0x41,0x02,0x14,0x00,0x85,0x00,0xa1,0xc0,0x09,0x71,0x02,0xdc,0x00 }},
+ {16, 0xa630, 0, {0xb5,0x10,0x2d,0xc0,0x0b,0x40,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa640, 0, {0x20,0x14,0xc4,0x10,0x83,0x84,0x20,0x11,0x08,0x30,0x02,0xc3,0x10,0x91,0x20,0x20 }},
+ {16, 0xa650, 0, {0xc0,0x08,0x28,0x12,0x00,0x00,0xa0,0x84,0x20,0x40,0x08,0x30,0x02,0x04,0x26,0x83 }},
+ {16, 0xa660, 0, {0x00,0x20,0xd0,0x0b,0x30,0x02,0xcc,0x00,0xb2,0x00,0x2c,0xc0,0x0b,0x00,0x02,0x08 }},
+ {16, 0xa670, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xad,0x00,0xcf,0x88,0xb2,0xe8 }},
+ {16, 0xa680, 0, {0x0c,0x30,0x13,0xce,0xc2,0xd0,0x82,0x32,0x00,0x0c,0x0e,0x0b,0x20,0x00,0xc8,0x88 }},
+ {16, 0xa690, 0, {0xb2,0x40,0x2c,0xba,0x43,0x37,0x02,0xcb,0x00,0xb3,0xc0,0x2c,0xf0,0x03,0xfc,0x12 }},
+ {16, 0xa6a0, 0, {0xfb,0x00,0x7f,0xd1,0x0f,0x30,0x0b,0x2b,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa6b0, 0, {0x80,0x00,0xed,0x02,0xf1,0x40,0x3e,0x41,0x0f,0xb0,0x23,0xed,0x00,0xe8,0x01,0x3e }},
+ {16, 0xa6c0, 0, {0xc8,0x0f,0xb0,0x13,0xec,0x04,0xdb,0x00,0x3c,0x80,0x0f,0x04,0x03,0xe4,0x40,0xf9 }},
+ {16, 0xa6d0, 0, {0x00,0x3c,0xc2,0x0e,0xb0,0x03,0xee,0x00,0x4b,0x41,0x3e,0xc0,0x0f,0xb0,0x03,0xe0 }},
+ {16, 0xa6e0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xfc,0x00,0x4b,0x00,0x32,0x42 }},
+ {16, 0xa6f0, 0, {0x0c,0xf0,0x03,0x36,0x80,0xcd,0x00,0x33,0x00,0x4c,0xc0,0x83,0x3c,0x04,0xf7,0x00 }},
+ {16, 0xa700, 0, {0x32,0x40,0x0c,0xb1,0x43,0x14,0x00,0xcd,0x80,0x33,0xc0,0x0c,0xf0,0x03,0xfc,0x00 }},
+ {16, 0xa710, 0, {0xff,0x00,0xb3,0xc2,0x0c,0xa0,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa720, 0, {0x81,0x04,0x4f,0x02,0x8b,0x80,0x20,0x30,0x08,0xbc,0x02,0x20,0x10,0x89,0x00,0x22 }},
+ {16, 0xa730, 0, {0xc0,0x00,0xb0,0x03,0x60,0x04,0xb8,0x00,0xa2,0x90,0x28,0x8c,0x1a,0x24,0x02,0x8b }},
+ {16, 0xa740, 0, {0x83,0x22,0xc1,0x08,0xb0,0x02,0xfc,0x00,0xb3,0x60,0x20,0xc0,0x0d,0xa0,0x03,0xe0 }},
+ {16, 0xa750, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x2e,0x00,0xab,0xc0,0x22,0x60 }},
+ {16, 0xa760, 0, {0x08,0xb8,0x02,0x29,0x00,0x88,0x01,0x20,0x00,0x08,0x90,0x02,0x20,0x00,0xb8,0x00 }},
+ {16, 0xa770, 0, {0x22,0xc0,0x08,0xb0,0x02,0xe4,0x00,0x81,0x24,0xa2,0xc0,0x09,0xb0,0x46,0xec,0x00 }},
+ {16, 0xa780, 0, {0xb9,0x00,0x22,0xc0,0x08,0x90,0x02,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa790, 0, {0x08,0x04,0x2c,0x00,0xa1,0x00,0xa0,0x41,0x08,0xb0,0x0a,0x20,0x53,0x88,0x00,0x20 }},
+ {16, 0xa7a0, 0, {0xc0,0x28,0xa0,0x02,0x4c,0x00,0xb3,0x00,0x20,0x00,0x88,0x00,0x02,0x84,0x00,0x83 }},
+ {16, 0xa7b0, 0, {0x04,0x20,0xc0,0x28,0x30,0x02,0xcc,0x00,0xb3,0x02,0x62,0xc0,0x09,0x10,0x02,0xc2 }},
+ {16, 0xa7c0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x6c,0x00,0xe9,0x00,0x22,0x00 }},
+ {16, 0xa7d0, 0, {0x0c,0xb0,0x03,0x00,0x04,0xc9,0x00,0xb2,0x00,0x0c,0x90,0x03,0x2c,0x00,0xf3,0x00 }},
+ {16, 0xa7e0, 0, {0xb2,0xc0,0x8c,0xb0,0x03,0xb4,0x02,0x8f,0x00,0x23,0xc0,0x04,0xf0,0x03,0xec,0x08 }},
+ {16, 0xa7f0, 0, {0xf9,0x00,0x33,0xc0,0x0c,0x80,0x03,0x00,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa800, 0, {0xa0,0x1d,0xfc,0x10,0xdd,0x04,0x3f,0x00,0x0f,0xc0,0x23,0xf0,0x90,0xfd,0x00,0x2f }},
+ {16, 0xa810, 0, {0xc0,0x0f,0xe0,0x43,0xd0,0x00,0xfc,0x00,0x3f,0x00,0x8f,0xc0,0x22,0x74,0x00,0xfd }},
+ {16, 0xa820, 0, {0x04,0x3f,0xc0,0x0f,0xf0,0x03,0xfc,0x00,0xff,0x06,0x3f,0xc0,0x0f,0xc0,0x43,0xe8 }},
+ {16, 0xa830, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xfc,0x80,0xef,0x20,0x11,0xc0 }},
+ {16, 0xa840, 0, {0x0e,0x72,0x03,0xbd,0xb0,0xcf,0x31,0xbf,0xcc,0x02,0xf0,0x03,0xfc,0xc6,0xcf,0x01 }},
+ {16, 0xa850, 0, {0x0b,0xc5,0x0f,0xf1,0x03,0x3c,0x04,0xef,0x61,0x33,0xd8,0x07,0xf0,0x03,0x34,0x80 }},
+ {16, 0xa860, 0, {0xcd,0x30,0x73,0xcc,0x0f,0xe8,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa870, 0, {0x80,0x18,0xe9,0x00,0x88,0x69,0x22,0x10,0x08,0x8c,0x00,0x21,0x84,0x88,0x41,0x22 }},
+ {16, 0xa880, 0, {0x10,0x88,0x86,0x92,0x01,0x00,0x88,0x62,0x22,0x10,0x4b,0x87,0x02,0x21,0xa0,0x88 }},
+ {16, 0xa890, 0, {0x60,0x20,0x10,0x0b,0x86,0xa2,0x35,0xa0,0xab,0x60,0xa1,0xc4,0x0b,0xb8,0x02,0x20 }},
+ {16, 0xa8a0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xcd,0xa8,0x33,0x41,0x20,0xc6 }},
+ {16, 0xa8b0, 0, {0x4a,0x31,0x00,0x8c,0x10,0x93,0x33,0x28,0xcc,0x29,0x34,0x12,0x8c,0x50,0x93,0x1c }},
+ {16, 0xa8c0, 0, {0x28,0x84,0x01,0x20,0x4a,0x4c,0x41,0x83,0x10,0x24,0xcc,0x4b,0x31,0x42,0x4c,0x40 }},
+ {16, 0xa8d0, 0, {0x91,0x10,0x24,0xc0,0x0b,0x80,0x02,0x22,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa8e0, 0, {0xc0,0x05,0xa8,0x20,0x90,0x02,0x22,0x00,0x08,0x80,0x00,0x20,0x30,0xb8,0x08,0x26 }},
+ {16, 0xa8f0, 0, {0x00,0x01,0x80,0x82,0x20,0x20,0x18,0x08,0x42,0x40,0x03,0x91,0x02,0x60,0x00,0x08 }},
+ {16, 0xa900, 0, {0x01,0xa6,0x00,0x0b,0x80,0x00,0x6c,0x10,0xbb,0x01,0x26,0xc0,0x4b,0x90,0x0a,0x30 }},
+ {16, 0xa910, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0xfd,0x00,0xfd,0x41,0x33,0xa1 }},
+ {16, 0xa920, 0, {0x0e,0xd2,0x03,0xb5,0x02,0xdf,0x42,0x3b,0x01,0x0f,0xd4,0x43,0xb5,0x00,0xcd,0x40 }},
+ {16, 0xa930, 0, {0x1b,0xc4,0x0d,0x78,0x03,0x70,0x02,0xec,0x00,0x17,0xa1,0x0f,0xe8,0x0b,0x2c,0x02 }},
+ {16, 0xa940, 0, {0xd9,0x90,0x26,0xc0,0x0f,0xac,0x03,0x00,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa950, 0, {0xe0,0x01,0xb8,0x00,0xee,0x00,0x1f,0x64,0x4f,0xe0,0x03,0xd8,0x10,0xc4,0x18,0x33 }},
+ {16, 0xa960, 0, {0xc0,0x0c,0xa0,0xa1,0xb8,0x09,0xe6,0x09,0x36,0x22,0x0f,0x88,0x23,0xbc,0x00,0xfb }},
+ {16, 0xa970, 0, {0x00,0x3b,0x64,0x0f,0xd9,0x03,0x9c,0x00,0xe3,0x04,0x3b,0xc0,0x0f,0xf4,0x03,0xf8 }},
+ {16, 0xa980, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0x8d,0x00,0xc9,0x40,0xb6,0x80 }},
+ {16, 0xa990, 0, {0x0f,0x10,0x03,0xa7,0x20,0xfb,0x50,0xb6,0x08,0x4c,0x14,0x03,0x65,0x22,0xd9,0x40 }},
+ {16, 0xa9a0, 0, {0xb6,0x80,0x0e,0xa0,0x0b,0x00,0x00,0xd8,0x00,0x76,0x82,0x28,0xa0,0x23,0x64,0x00 }},
+ {16, 0xa9b0, 0, {0xc9,0x04,0x12,0xc0,0x8e,0x80,0x03,0x90,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xa9c0, 0, {0xc8,0x05,0x2b,0x60,0x8a,0x09,0x20,0x50,0x08,0xa0,0x23,0xe9,0x00,0xb8,0xc0,0x22 }},
+ {16, 0xa9d0, 0, {0xf0,0x08,0xac,0x02,0x28,0x04,0x8a,0xc2,0x22,0x50,0x08,0x90,0x06,0x2c,0x00,0x8b }},
+ {16, 0xa9e0, 0, {0x04,0x22,0x51,0x08,0x94,0x02,0xe4,0x04,0x8b,0x04,0x37,0xc0,0x08,0x18,0x42,0x26 }},
+ {16, 0xa9f0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x04,0x4b,0x00,0x82,0xc8,0x24,0x43 }},
+ {16, 0xaa00, 0, {0x0b,0x26,0x0a,0x88,0x00,0xb0,0x80,0x22,0xe4,0x0b,0x20,0x42,0x69,0x00,0xa2,0x90 }},
+ {16, 0xaa10, 0, {0x28,0x40,0xe8,0x10,0x02,0x0c,0x00,0xbb,0x00,0x28,0x50,0x88,0x90,0x82,0xc4,0x01 }},
+ {16, 0xaa20, 0, {0x83,0x00,0x20,0xc0,0x0a,0x10,0x02,0xba,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xaa30, 0, {0x20,0x10,0x4e,0x80,0x81,0x00,0x21,0xa8,0x08,0x58,0x02,0xd6,0x01,0xb7,0x90,0x68 }},
+ {16, 0xaa40, 0, {0x20,0x03,0x59,0x82,0x56,0x00,0xa5,0x84,0x2d,0xa2,0x18,0x69,0x22,0x02,0x00,0x34 }},
+ {16, 0xaa50, 0, {0x80,0x29,0xa8,0x08,0x68,0x06,0xc6,0x14,0x85,0x82,0x25,0xe0,0x08,0x58,0x82,0x1c }},
+ {16, 0xaa60, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x48,0x00,0xc2,0xf0,0x34,0x40 }},
+ {16, 0xaa70, 0, {0x0f,0x20,0x03,0x88,0x80,0xf8,0x10,0x30,0xc0,0x27,0x21,0x0b,0x48,0x80,0xea,0x20 }},
+ {16, 0xaa80, 0, {0x38,0x00,0x0c,0x00,0x12,0x0c,0x08,0x73,0x00,0xb8,0x40,0x0c,0x12,0x23,0x4c,0x02 }},
+ {16, 0xaa90, 0, {0x43,0x34,0x30,0xc0,0x0e,0x11,0x03,0x92,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xaaa0, 0, {0x40,0x15,0xac,0x90,0xf9,0x01,0x2e,0x88,0x4b,0x90,0x11,0x64,0x00,0xfb,0x10,0x32 }},
+ {16, 0xaab0, 0, {0x00,0x00,0x91,0x03,0xa4,0x00,0xc9,0x00,0x32,0xc4,0x4d,0xb0,0x43,0xe0,0x04,0xc8 }},
+ {16, 0xaac0, 0, {0x00,0x36,0x89,0x0f,0xa8,0x03,0xed,0x00,0xf9,0x14,0x3e,0xc0,0x0f,0x10,0x43,0xd0 }},
+ {16, 0xaad0, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0xe8,0x00,0xc8,0x00,0x3a,0x00 }},
+ {16, 0xaae0, 0, {0x0c,0x00,0x53,0xa0,0x00,0xe8,0x01,0x32,0x01,0x0e,0x80,0x53,0x20,0x10,0xc8,0x00 }},
+ {16, 0xaaf0, 0, {0x3a,0x40,0x0c,0x90,0x03,0x20,0x10,0xe8,0x04,0xb6,0x00,0x84,0x80,0x03,0x2d,0x12 }},
+ {16, 0xab00, 0, {0xcb,0x00,0x2e,0xca,0x04,0x90,0x03,0xea,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xab10, 0, {0x4c,0x19,0x8c,0x00,0x87,0x02,0x21,0xc0,0x08,0x70,0x02,0x0c,0x00,0x83,0x00,0x21 }},
+ {16, 0xab20, 0, {0xc0,0x08,0x30,0x62,0x4c,0x04,0x83,0x00,0x21,0x80,0x48,0xe0,0x12,0x3c,0x00,0x87 }},
+ {16, 0xab30, 0, {0x00,0x21,0xc0,0x08,0x70,0x02,0x1c,0x00,0x85,0x01,0x24,0xd0,0x0a,0x50,0x02,0xf2 }},
+ {16, 0xab40, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x9a,0x00,0x80,0x80,0x28,0x20 }},
+ {16, 0xab50, 0, {0x08,0x4c,0x22,0xd2,0x00,0xa4,0x80,0x24,0x30,0x0b,0x48,0x02,0x52,0x00,0x84,0xc0 }},
+ {16, 0xab60, 0, {0x21,0x20,0x09,0x48,0x68,0x13,0x00,0xa4,0x80,0x60,0x20,0x09,0x08,0x02,0x56,0x00 }},
+ {16, 0xab70, 0, {0x97,0x80,0x2d,0xe0,0x88,0x58,0x02,0xe0,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xab80, 0, {0x6c,0x04,0xcc,0x00,0x83,0x80,0x20,0xd8,0x08,0x30,0x02,0x4c,0x40,0x83,0x00,0x24 }},
+ {16, 0xab90, 0, {0xd1,0x09,0xb9,0x42,0x4e,0x00,0x83,0x00,0x20,0xc1,0x89,0x30,0x42,0x0c,0x00,0x83 }},
+ {16, 0xaba0, 0, {0xf0,0xa0,0xd9,0x19,0x36,0x22,0x66,0x06,0x91,0x00,0x0c,0xc1,0x0a,0x10,0x02,0xc2 }},
+ {16, 0xabb0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xe8,0x02,0xca,0xa5,0x2a,0x91 }},
+ {16, 0xabc0, 0, {0x28,0xa8,0x03,0xea,0x02,0xaa,0x00,0xb6,0xa0,0x0f,0xa0,0x0a,0x2a,0x92,0xca,0x83 }},
+ {16, 0xabd0, 0, {0xba,0x80,0x29,0xa0,0x03,0x2b,0x00,0xea,0x40,0x66,0x90,0x2d,0xe4,0x0b,0x6a,0x80 }},
+ {16, 0xabe0, 0, {0xda,0x00,0x3e,0x80,0x0c,0xe0,0x03,0xfa,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xabf0, 0, {0x48,0x01,0x80,0x00,0xfc,0x00,0x3d,0x00,0x0f,0xc0,0x03,0xb0,0x14,0xfc,0x00,0x3b }},
+ {16, 0xac00, 0, {0x12,0x0e,0xc0,0x43,0xb1,0x14,0xfc,0x00,0x3d,0x00,0x0e,0xc0,0x03,0xf0,0x20,0xf4 }},
+ {16, 0xac10, 0, {0x00,0x31,0x00,0x0e,0x44,0x13,0xa0,0x00,0xe8,0x06,0x36,0x00,0x4f,0x80,0x13,0xd2 }},
+ {16, 0xac20, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xa4,0x00,0xd1,0x00,0x36,0x60 }},
+ {16, 0xac30, 0, {0x1c,0x18,0x0b,0x46,0x00,0xd9,0x80,0x30,0x40,0x2c,0x98,0x05,0x86,0x00,0xc1,0x80 }},
+ {16, 0xac40, 0, {0x92,0x40,0x0d,0x10,0x03,0x44,0x02,0x89,0x00,0x32,0x70,0x0c,0x98,0x01,0x24,0x00 }},
+ {16, 0xac50, 0, {0xc9,0x04,0x30,0x40,0x0c,0x90,0x03,0xc2,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xac60, 0, {0x80,0x04,0x64,0x00,0x89,0x00,0x22,0x40,0x08,0x94,0x02,0x24,0x80,0x89,0x01,0x22 }},
+ {16, 0xac70, 0, {0x40,0x48,0x91,0x02,0x24,0x00,0xd9,0x90,0x22,0x41,0x08,0x90,0x12,0x24,0x10,0x89 }},
+ {16, 0xac80, 0, {0x00,0x32,0x40,0x08,0x95,0x12,0x24,0x02,0x81,0x00,0xa2,0x41,0x0d,0x90,0x42,0xe0 }},
+ {16, 0xac90, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x05,0x24,0x02,0x9d,0x00,0x23,0x44 }},
+ {16, 0xaca0, 0, {0x08,0xd2,0x06,0x74,0x80,0xb5,0x20,0x23,0x40,0x1a,0xd0,0x06,0x35,0x90,0x8d,0x02 }},
+ {16, 0xacb0, 0, {0x2f,0x44,0x19,0xd0,0x02,0x74,0x00,0x8d,0x00,0x63,0x40,0x18,0xd4,0x02,0xa4,0x11 }},
+ {16, 0xacc0, 0, {0x89,0x00,0x22,0x40,0x08,0xb0,0x02,0xc6,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xacd0, 0, {0x28,0x14,0x04,0x80,0x85,0x20,0x21,0x68,0x08,0x52,0x02,0x14,0x80,0xa5,0x20,0xa1 }},
+ {16, 0xace0, 0, {0x48,0x0a,0x72,0x38,0x14,0x80,0x95,0x24,0x2d,0x48,0x28,0x52,0x02,0x14,0x80,0x85 }},
+ {16, 0xacf0, 0, {0x20,0x21,0x48,0x08,0x52,0x06,0x84,0x80,0x81,0x20,0x20,0x4a,0x09,0x10,0x02,0xc2 }},
+ {16, 0xad00, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x0d,0x61,0x40,0xd8,0x50,0xb2,0x14 }},
+ {16, 0xad10, 0, {0x28,0xa0,0x03,0x61,0x40,0xf8,0x50,0x32,0x94,0x4e,0x85,0x04,0x21,0x42,0xc8,0x50 }},
+ {16, 0xad20, 0, {0x3c,0x14,0x0d,0x80,0x03,0x61,0x40,0x88,0x50,0xb2,0x14,0x2c,0xc5,0x09,0xa1,0x40 }},
+ {16, 0xad30, 0, {0xc8,0x50,0x32,0x1c,0x0c,0x80,0x03,0xee,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xad40, 0, {0x98,0x15,0xe4,0x40,0xf9,0x10,0x3a,0x44,0x0f,0x91,0x03,0xe4,0x40,0xd9,0x14,0x3e }},
+ {16, 0xad50, 0, {0x44,0x0d,0x91,0x43,0x64,0x40,0xe9,0x10,0x32,0x44,0x07,0x93,0xc3,0xe4,0x50,0xd1 }},
+ {16, 0xad60, 0, {0x10,0x7e,0x44,0x03,0x91,0x01,0x54,0x44,0xfd,0x14,0x3e,0x40,0x0f,0xd0,0x03,0xe6 }},
+ {16, 0xad70, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xf6,0x80,0xdd,0xa0,0x33,0x68 }},
+ {16, 0xad80, 0, {0x1e,0xda,0x03,0x36,0x90,0xcd,0xa0,0x3b,0x68,0x0a,0xd8,0x23,0x76,0x0c,0xed,0x80 }},
+ {16, 0xad90, 0, {0x2b,0x62,0x0b,0x99,0x02,0xa7,0x80,0xf9,0xe1,0x37,0x68,0x0c,0xda,0x03,0x27,0x80 }},
+ {16, 0xada0, 0, {0xc9,0xa2,0x22,0x68,0x4c,0x50,0x03,0xc6,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xadb0, 0, {0x38,0x18,0xe1,0x40,0x88,0x50,0x22,0x14,0x08,0x80,0x22,0x60,0x00,0x88,0x04,0x22 }},
+ {16, 0xadc0, 0, {0x00,0x08,0x04,0x26,0x01,0x00,0x88,0x50,0x22,0x10,0x08,0xaf,0x02,0x23,0x00,0x88 }},
+ {16, 0xadd0, 0, {0xc0,0xa0,0x10,0x88,0x84,0x02,0x23,0x80,0xa0,0x40,0x2a,0x10,0x08,0x80,0x12,0x4e }},
+ {16, 0xade0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x84,0x00,0x81,0x01,0x20,0x40 }},
+ {16, 0xadf0, 0, {0x0a,0x14,0x02,0x45,0x00,0x81,0x41,0x2c,0x50,0x0b,0x14,0x02,0x05,0x04,0xa1,0x00 }},
+ {16, 0xae00, 0, {0x28,0x40,0x82,0x10,0x02,0x84,0x40,0xa1,0x32,0x80,0x50,0x09,0x14,0x02,0x04,0xc4 }},
+ {16, 0xae10, 0, {0x91,0x10,0x64,0x44,0x28,0x10,0x02,0xd2,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xae20, 0, {0x18,0x04,0xac,0x02,0x81,0x00,0x22,0xc1,0x08,0x90,0x02,0x44,0x02,0x89,0x02,0x26 }},
+ {16, 0xae30, 0, {0x41,0x09,0x90,0x0a,0x24,0x0c,0x89,0x04,0x22,0x50,0x08,0x90,0x26,0x24,0x00,0x89 }},
+ {16, 0xae40, 0, {0x00,0x22,0x41,0x09,0x10,0x22,0x24,0x40,0xb9,0x01,0x2e,0x40,0x08,0x90,0x02,0x46 }},
+ {16, 0xae50, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x15,0xe4,0x10,0x89,0x00,0x32,0x40 }},
+ {16, 0xae60, 0, {0x0a,0x90,0x0b,0x24,0x10,0x89,0x00,0x1e,0x40,0x9b,0x90,0x02,0x24,0x10,0x29,0x00 }},
+ {16, 0xae70, 0, {0x1a,0x40,0x0e,0x94,0x41,0xa4,0x00,0x29,0x00,0x12,0x40,0x05,0x90,0x41,0x26,0x00 }},
+ {16, 0xae80, 0, {0xd9,0x00,0x24,0x40,0x0c,0x90,0x03,0xe8,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xae90, 0, {0x48,0x01,0xa4,0x02,0xa9,0x00,0xbc,0x40,0x0f,0x90,0x03,0xa4,0x04,0xf9,0x00,0x3a }},
+ {16, 0xaea0, 0, {0x41,0x0e,0x90,0x83,0x84,0x00,0xf9,0x00,0x3c,0x40,0x0e,0x90,0x02,0xc4,0x08,0xe9 }},
+ {16, 0xaeb0, 0, {0x00,0x3a,0x40,0x2e,0x90,0x0b,0xe6,0x00,0xe1,0x04,0x3a,0x40,0x0f,0x92,0x03,0x5a }},
+ {16, 0xaec0, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xa0,0x20,0xd8,0x00,0x36,0x02 }},
+ {16, 0xaed0, 0, {0x0e,0x00,0xa3,0xe0,0x18,0xc0,0x00,0x30,0x03,0x0f,0x80,0x33,0x20,0x00,0x40,0x00 }},
+ {16, 0xaee0, 0, {0x32,0x0d,0x0f,0x04,0x0b,0xa0,0x02,0xc8,0x02,0x32,0x02,0x8c,0x82,0x03,0x20,0x02 }},
+ {16, 0xaef0, 0, {0xc8,0x04,0x16,0x00,0x4e,0x80,0x01,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xaf00, 0, {0x28,0x05,0x3b,0x00,0x8e,0xd8,0x23,0x80,0x08,0xe0,0x02,0xf8,0x80,0x8e,0x10,0x23 }},
+ {16, 0xaf10, 0, {0xa2,0x0b,0xe0,0x82,0x7a,0x20,0x8e,0x30,0x23,0xa1,0x0b,0xe0,0x02,0x28,0x00,0x8e }},
+ {16, 0xaf20, 0, {0x00,0x2b,0x88,0x08,0xe4,0x42,0x38,0x00,0x8e,0x04,0x23,0x80,0x08,0xa0,0x02,0x0a }},
+ {16, 0xaf30, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x6f,0x40,0x93,0xc6,0x24,0x40 }},
+ {16, 0xaf40, 0, {0x0a,0x38,0x02,0xcc,0x00,0x83,0x01,0xac,0xf0,0x0b,0xb4,0x02,0x4c,0x04,0xa3,0x80 }},
+ {16, 0xaf50, 0, {0x28,0xd0,0x4b,0x30,0x02,0x4c,0x00,0xab,0x04,0x2a,0xc0,0x2a,0x30,0x0a,0xac,0x10 }},
+ {16, 0xaf60, 0, {0x93,0x00,0x20,0xc1,0x0a,0x31,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xaf70, 0, {0x80,0x11,0x1c,0x00,0x82,0x00,0x21,0x42,0x88,0x74,0x06,0xdc,0x0b,0x86,0x02,0x2d }},
+ {16, 0xaf80, 0, {0x80,0x0b,0x70,0x2a,0x58,0x00,0xa6,0x00,0xa9,0xc0,0x0b,0x70,0x02,0x5c,0x88,0xa7 }},
+ {16, 0xaf90, 0, {0x20,0x29,0xc0,0x0a,0x70,0x02,0x9c,0x10,0x97,0x20,0xa1,0xc8,0x08,0xd8,0x02,0x28 }},
+ {16, 0xafa0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x08,0x0e,0x00,0xd7,0x80,0x37,0x60 }},
+ {16, 0xafb0, 0, {0x0e,0x68,0x13,0xfe,0x00,0xcf,0x80,0x3d,0xe0,0x0f,0x78,0x23,0x1e,0x00,0xef,0x82 }},
+ {16, 0xafc0, 0, {0x31,0xe0,0x0f,0x3c,0xc3,0x7e,0x04,0xef,0x80,0xb1,0xe0,0x0e,0xe8,0x03,0xbe,0x80 }},
+ {16, 0xafd0, 0, {0xd7,0xe0,0x33,0xea,0x0e,0x78,0x03,0x2a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xafe0, 0, {0x08,0x15,0xac,0x00,0xfa,0x01,0x3e,0x00,0x0f,0xb0,0x03,0xe0,0x04,0xf8,0x00,0x32 }},
+ {16, 0xaff0, 0, {0x80,0x0f,0x80,0x43,0xac,0x0a,0xd8,0x00,0x36,0x40,0x0f,0xb0,0x03,0x2c,0x0c,0xdb }},
+ {16, 0xb000, 0, {0x00,0x26,0xc1,0x09,0xa0,0x13,0x6c,0x40,0xeb,0x40,0x3a,0xdc,0x0f,0x90,0x0b,0xc2 }},
+ {16, 0xb010, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x04,0xbe,0x00,0xcf,0x81,0x33,0xe9 }},
+ {16, 0xb020, 0, {0x1f,0xf9,0x13,0xb6,0x50,0xef,0x80,0x1f,0xe4,0x04,0xc8,0x03,0x7e,0x00,0x6d,0x81 }},
+ {16, 0xb030, 0, {0x33,0x64,0x0c,0xf8,0x1b,0x3e,0x20,0x2f,0x88,0x93,0xe8,0x0f,0xfb,0x03,0x2e,0x80 }},
+ {16, 0xb040, 0, {0xcf,0xc0,0x73,0xe0,0x2c,0xd9,0x03,0xd0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb050, 0, {0xa8,0x18,0x90,0x42,0x89,0x18,0x21,0xc0,0x1f,0x71,0x02,0x14,0xc0,0xf7,0x20,0x27 }},
+ {16, 0xb060, 0, {0x40,0x40,0x71,0x12,0x18,0x00,0x87,0x20,0x21,0x80,0x48,0x71,0x02,0x3c,0x08,0x87 }},
+ {16, 0xb070, 0, {0x20,0x21,0x82,0x0b,0x61,0xa2,0x1e,0x44,0xdf,0x01,0x31,0xc8,0x08,0x73,0x02,0xea }},
+ {16, 0xb080, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x8c,0x00,0x87,0x00,0x21,0xc8 }},
+ {16, 0xb090, 0, {0x0b,0x70,0x02,0x9c,0x09,0x87,0x02,0x2d,0x82,0x99,0x40,0x02,0x04,0x00,0xa5,0x09 }},
+ {16, 0xb0a0, 0, {0x21,0x40,0x19,0x70,0x02,0x1c,0x00,0x87,0x05,0x25,0x48,0x4b,0x72,0x02,0x0c,0x40 }},
+ {16, 0xb0b0, 0, {0x87,0x00,0xa1,0xc0,0x48,0x50,0x02,0xc4,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb0c0, 0, {0x68,0x04,0xc1,0x20,0x89,0x4c,0xa0,0xb4,0x0a,0x38,0x02,0x22,0x00,0xa1,0xd0,0x24 }},
+ {16, 0xb0d0, 0, {0x30,0x09,0x80,0x02,0x27,0x44,0x81,0xc6,0x22,0x14,0x09,0x3d,0x2a,0x0f,0x02,0x8b }},
+ {16, 0xb0e0, 0, {0xc0,0xa6,0x20,0x0b,0x24,0x00,0x0c,0x10,0x93,0x81,0x20,0xc0,0x48,0x30,0x06,0xd8 }},
+ {16, 0xb0f0, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x15,0xa1,0x00,0x89,0xc1,0x32,0xd1 }},
+ {16, 0xb100, 0, {0x03,0xbc,0x03,0xa9,0x20,0x89,0x41,0x3e,0x60,0x85,0xbc,0x8b,0x25,0x40,0xeb,0x41 }},
+ {16, 0xb110, 0, {0xa2,0xa0,0x0d,0xf0,0x13,0x3e,0x20,0xcf,0x90,0x36,0x30,0x4f,0xbc,0x0b,0x3c,0x00 }},
+ {16, 0xb120, 0, {0xcf,0x80,0x33,0xc1,0x0c,0xb1,0x03,0xea,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb130, 0, {0x80,0x00,0xed,0x00,0xf8,0x01,0x3c,0xd0,0x0f,0xb3,0x03,0xe8,0x82,0xd8,0x20,0x36 }},
+ {16, 0xb140, 0, {0x80,0x2e,0xb2,0x13,0xe1,0x00,0xfa,0x00,0x7e,0xc8,0x2e,0xb0,0x03,0xec,0x80,0xdb }},
+ {16, 0xb150, 0, {0x10,0x3a,0x08,0x4f,0xb2,0x23,0xcc,0x02,0xfb,0x10,0x3a,0xc0,0x0f,0x90,0x03,0xe4 }},
+ {16, 0xb160, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x10,0xf0,0x00,0xcd,0x10,0x33,0x42 }},
+ {16, 0xb170, 0, {0x0c,0xca,0x23,0x7c,0x00,0xcf,0x00,0x33,0x62,0x06,0xf0,0x01,0x3a,0x00,0xcf,0x08 }},
+ {16, 0xb180, 0, {0x33,0x80,0x1c,0xf0,0x81,0x3c,0x00,0xff,0x00,0x33,0xa0,0x0c,0xca,0x01,0xfc,0x04 }},
+ {16, 0xb190, 0, {0xcf,0x00,0x3f,0xc0,0x0f,0xf0,0x03,0xc0,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb1a0, 0, {0xa1,0x04,0x6d,0x40,0x88,0x48,0xa2,0x31,0x08,0x10,0x02,0x20,0x10,0x88,0xb4,0x22 }},
+ {16, 0xb1b0, 0, {0xa0,0x08,0x80,0x00,0x6a,0x84,0x88,0x20,0x22,0x52,0x08,0xb0,0x0a,0x2c,0x10,0xbb }},
+ {16, 0xb1c0, 0, {0x00,0x32,0xb3,0x88,0x80,0x02,0xec,0x00,0xdb,0x00,0x2e,0xc0,0x0b,0x90,0x12,0xe1 }},
+ {16, 0xb1d0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x10,0x8a,0x01,0x22,0xa0 }},
+ {16, 0xb1e0, 0, {0x08,0xb0,0x42,0x60,0x20,0x80,0x00,0x20,0x44,0x1a,0x80,0x1a,0xe4,0x42,0xa0,0x06 }},
+ {16, 0xb1f0, 0, {0x22,0x00,0x78,0x30,0x02,0xac,0x00,0xbb,0x00,0xa2,0x44,0x08,0xb0,0x12,0xec,0x00 }},
+ {16, 0xb200, 0, {0x8b,0x00,0x0e,0xc0,0x0b,0x90,0x02,0xe0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb210, 0, {0x08,0x14,0x00,0x08,0x80,0x00,0x20,0x81,0x08,0x30,0x02,0x40,0x12,0x80,0x00,0xa0 }},
+ {16, 0xb220, 0, {0x40,0x08,0xb0,0x02,0xc0,0x00,0x82,0x00,0x00,0x80,0x08,0x30,0x02,0x8c,0x00,0xbb }},
+ {16, 0xb230, 0, {0x00,0x20,0x00,0x08,0x20,0x02,0xcc,0x80,0x93,0x00,0x2c,0xc0,0x0b,0x30,0x02,0xc2 }},
+ {16, 0xb240, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x60,0x00,0xca,0x14,0x32,0x00 }},
+ {16, 0xb250, 0, {0x0c,0xb0,0x03,0x4c,0x00,0xca,0x00,0x32,0x00,0x0e,0x00,0x12,0xa0,0x00,0xc0,0x00 }},
+ {16, 0xb260, 0, {0x70,0x00,0x28,0xf0,0x13,0xac,0x00,0xfb,0x00,0x32,0x40,0x2c,0x10,0x43,0xec,0x00 }},
+ {16, 0xb270, 0, {0xcf,0x00,0x3f,0xc0,0x0f,0x90,0x03,0xc0,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb280, 0, {0x20,0x15,0xf0,0x02,0xfc,0x00,0x1f,0x00,0x67,0x70,0x03,0xb0,0x00,0xfc,0x00,0x3f }},
+ {16, 0xb290, 0, {0x00,0x2d,0xc0,0x03,0x30,0x10,0xfc,0x01,0xbf,0x00,0x0f,0x70,0x03,0x7c,0x00,0xf7 }},
+ {16, 0xb2a0, 0, {0x04,0x3b,0x00,0x0f,0xc0,0x13,0xfd,0x10,0xff,0x00,0x3d,0xc0,0x0f,0xf0,0x03,0xe8 }},
+ {16, 0xb2b0, 0, {0x12,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x05,0xf4,0xc0,0xcf,0x80,0x33,0x60 }},
+ {16, 0xb2c0, 0, {0x0e,0xc9,0x13,0x36,0x50,0xce,0x86,0x3f,0x08,0x0c,0xc0,0x03,0x3e,0x02,0xd7,0x80 }},
+ {16, 0xb2d0, 0, {0x39,0xe0,0x0f,0xf8,0x13,0x3e,0x40,0xc7,0x30,0x3b,0xce,0x0d,0xf6,0x03,0x3d,0x88 }},
+ {16, 0xb2e0, 0, {0xcf,0x31,0x33,0xe4,0x0f,0x78,0x03,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb2f0, 0, {0x80,0x10,0xe5,0xd0,0xdb,0x80,0x72,0x60,0x88,0x92,0x02,0xe4,0x10,0x8a,0x80,0x2e }},
+ {16, 0xb300, 0, {0x34,0x4a,0x8c,0x03,0x2e,0x00,0xab,0x80,0x02,0xe0,0x0b,0xb8,0x02,0x2c,0x80,0x8f }},
+ {16, 0xb310, 0, {0x60,0x13,0xd8,0x4a,0x76,0x02,0x9d,0x84,0xaf,0x30,0x22,0x48,0x0b,0x88,0x12,0xa0 }},
+ {16, 0xb320, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x05,0xc4,0x00,0x8b,0x00,0x24,0x00 }},
+ {16, 0xb330, 0, {0x4a,0x00,0x02,0xac,0x80,0x83,0x00,0x2c,0x01,0x28,0x04,0x02,0xac,0x00,0x8b,0x01 }},
+ {16, 0xb340, 0, {0x20,0xc0,0x03,0xb0,0x02,0x0c,0x80,0x83,0x40,0x20,0xc1,0xa8,0x34,0x22,0x8d,0x13 }},
+ {16, 0xb350, 0, {0x83,0x20,0xac,0xc8,0x0b,0xb0,0x02,0x62,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb360, 0, {0xc0,0x15,0x86,0x00,0x9b,0x04,0xae,0x00,0x0a,0x90,0x02,0xec,0x00,0x0b,0x14,0x2e }},
+ {16, 0xb370, 0, {0xc6,0x02,0xb1,0x12,0x6c,0x00,0xab,0x20,0x2a,0xc1,0x0b,0xb0,0x42,0x2c,0x00,0x8b }},
+ {16, 0xb380, 0, {0x02,0x26,0xc1,0x0a,0xb0,0x02,0xac,0x00,0xab,0x04,0x2a,0x40,0x0b,0x90,0x02,0xf0 }},
+ {16, 0xb390, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0xe7,0x00,0xc3,0x01,0x36,0x40 }},
+ {16, 0xb3a0, 0, {0x0e,0x88,0x13,0x24,0x02,0xca,0x00,0x1e,0x20,0x2c,0x8e,0x0b,0x2c,0x00,0xcb,0x00 }},
+ {16, 0xb3b0, 0, {0x2a,0xc0,0x0f,0xb8,0x03,0x2e,0x06,0xcb,0x00,0x3a,0xc0,0x4c,0xb0,0x13,0xac,0x0c }},
+ {16, 0xb3c0, 0, {0xcb,0x00,0x3e,0xc8,0x0f,0xb0,0x43,0x50,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb3d0, 0, {0xe0,0x01,0xb4,0x08,0xff,0x91,0x33,0x40,0x09,0xdc,0x01,0xf4,0x20,0x7e,0x02,0x2e }},
+ {16, 0xb3e0, 0, {0x40,0x0d,0x98,0x01,0xbc,0x80,0xef,0x80,0xb7,0xe4,0x8f,0xf4,0x0b,0xfe,0x40,0x7f }},
+ {16, 0xb3f0, 0, {0x00,0xb9,0xc0,0x4e,0xf0,0x03,0xfc,0x08,0xf7,0x00,0x37,0xc0,0x0f,0xe0,0x02,0xb8 }},
+ {16, 0xb400, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0xa1,0x44,0xcb,0x02,0x32,0x00 }},
+ {16, 0xb410, 0, {0x0d,0x80,0x0a,0x6d,0x00,0xeb,0x04,0x10,0x90,0x28,0x22,0x0b,0x2c,0xc2,0xcb,0x20 }},
+ {16, 0xb420, 0, {0x76,0xc0,0x0e,0xb1,0x03,0xec,0x01,0xcb,0x06,0x32,0xc1,0x0c,0x30,0x03,0x2c,0x02 }},
+ {16, 0xb430, 0, {0xcb,0x00,0x3e,0xd0,0x0c,0xb0,0x03,0x10,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb440, 0, {0xc8,0x05,0x21,0x48,0xab,0x00,0x20,0x00,0x00,0x95,0x23,0x4c,0x08,0xbb,0x01,0x22 }},
+ {16, 0xb450, 0, {0xc0,0x08,0xb2,0x02,0x0c,0x08,0x83,0x88,0x92,0xd5,0x28,0x34,0x02,0xec,0x02,0x8f }},
+ {16, 0xb460, 0, {0x20,0x23,0xc0,0x4d,0xf0,0x01,0x7c,0x00,0xdf,0x00,0x2e,0xc0,0x0d,0x30,0x03,0x72 }},
+ {16, 0xb470, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x05,0x44,0x00,0x83,0x10,0x20,0x60 }},
+ {16, 0xb480, 0, {0x09,0x25,0x02,0x00,0x08,0xa0,0x00,0x4c,0x00,0x0b,0x0c,0x22,0x4f,0x12,0x93,0x40 }},
+ {16, 0xb490, 0, {0x00,0xc0,0x09,0x3e,0x02,0xec,0x00,0xab,0x80,0xa4,0xc0,0x09,0x30,0x22,0x2c,0x08 }},
+ {16, 0xb4a0, 0, {0xb3,0x01,0x0c,0x81,0x08,0x30,0x02,0x38,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb4b0, 0, {0x60,0x01,0x16,0x09,0xb7,0x80,0x21,0x64,0x08,0x78,0x06,0x12,0x00,0xb4,0x82,0x2d }},
+ {16, 0xb4c0, 0, {0xa4,0x1b,0x69,0x06,0x7e,0x04,0x17,0x92,0x25,0xe6,0x09,0x78,0x06,0xde,0x80,0xa7 }},
+ {16, 0xb4d0, 0, {0x90,0x25,0xe0,0x09,0x79,0x50,0x5e,0x04,0xb7,0x92,0x2f,0x61,0x09,0xc8,0x02,0x48 }},
+ {16, 0xb4e0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x08,0x25,0x00,0xc3,0x00,0xb0,0x03 }},
+ {16, 0xb4f0, 0, {0x0d,0xa3,0x42,0x09,0x40,0xe1,0x00,0xbc,0x40,0x0f,0x11,0x03,0x4c,0x00,0x13,0x00 }},
+ {16, 0xb500, 0, {0x20,0xc0,0x09,0x32,0x03,0xcc,0x10,0xa3,0x00,0x26,0xc4,0x8d,0x30,0x2b,0x0c,0x80 }},
+ {16, 0xb510, 0, {0xf3,0x00,0x7c,0x80,0x0c,0x30,0x01,0x12,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb520, 0, {0x40,0x1d,0xbc,0x00,0xe7,0x10,0x3d,0x01,0x2f,0xf1,0x42,0xe8,0x00,0xf5,0x90,0x03 }},
+ {16, 0xb530, 0, {0xc1,0x0c,0xf1,0x43,0x9c,0x04,0xef,0x08,0x3b,0xc2,0x0c,0xf0,0x81,0xdc,0xa0,0xdf }},
+ {16, 0xb540, 0, {0x00,0x3b,0xc3,0x3f,0xf0,0x83,0xfc,0x05,0xdf,0x0c,0x3d,0x40,0x0f,0xd1,0x03,0xd0 }},
+ {16, 0xb550, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x05,0xf4,0x00,0xcb,0x80,0x30,0x40 }},
+ {16, 0xb560, 0, {0x2c,0xa0,0x03,0xe0,0x00,0xf8,0x80,0x32,0xc0,0x2e,0xb8,0x0b,0x2c,0x46,0xd3,0x00 }},
+ {16, 0xb570, 0, {0x30,0xc0,0x0c,0x30,0x03,0x0c,0x00,0xdb,0x48,0x32,0xc0,0x1f,0xb4,0x03,0x2c,0x88 }},
+ {16, 0xb580, 0, {0xcb,0x48,0x32,0x80,0x0c,0x30,0x13,0x2a,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb590, 0, {0x48,0x11,0xb4,0x00,0x87,0x01,0x21,0x40,0x08,0x70,0x42,0xd0,0x08,0xb4,0x00,0x29 }},
+ {16, 0xb5a0, 0, {0xc0,0x08,0x70,0x02,0x1c,0x00,0x87,0x00,0x21,0xc8,0x0c,0x72,0x0a,0x1c,0x84,0x8f }},
+ {16, 0xb5b0, 0, {0x40,0x09,0xc4,0x8f,0x73,0x12,0x9c,0x40,0x83,0x20,0x21,0xc0,0x08,0x60,0x02,0x92 }},
+ {16, 0xb5c0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x96,0x01,0xaf,0x80,0x21,0x20 }},
+ {16, 0xb5d0, 0, {0x08,0x68,0x02,0xda,0x00,0xbd,0x80,0x21,0xe0,0x09,0x78,0x02,0x1e,0x00,0x8f,0x88 }},
+ {16, 0xb5e0, 0, {0x83,0xe2,0x29,0xf8,0x82,0x5f,0x80,0x87,0xa0,0x25,0xe0,0x0b,0x3a,0x12,0x0e,0x50 }},
+ {16, 0xb5f0, 0, {0x97,0xa4,0x21,0xa0,0x29,0x78,0x02,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb600, 0, {0x08,0x14,0xcc,0x02,0xa1,0x81,0x00,0x00,0x48,0x70,0x02,0xc8,0x00,0xb1,0x00,0x2c }},
+ {16, 0xb610, 0, {0xf8,0x09,0x31,0x42,0x0c,0x10,0x83,0x00,0x20,0xe0,0x08,0x38,0x12,0x4e,0x00,0x83 }},
+ {16, 0xb620, 0, {0x00,0x6a,0xc0,0x0b,0x30,0x02,0x8c,0x04,0x93,0x00,0x20,0xe0,0x09,0x38,0x02,0x92 }},
+ {16, 0xb630, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x15,0xb9,0x40,0xee,0x20,0x30,0x80 }},
+ {16, 0xb640, 0, {0x0c,0xa0,0x03,0xe8,0x00,0xfa,0x00,0x33,0xb0,0x0d,0xe4,0x03,0x32,0x88,0xcc,0x80 }},
+ {16, 0xb650, 0, {0x23,0x00,0x0d,0xc0,0x03,0x62,0x02,0xca,0x00,0x36,0x80,0x0f,0xa0,0x43,0x28,0x06 }},
+ {16, 0xb660, 0, {0xda,0x00,0x33,0xa0,0x0d,0x6a,0x03,0x3a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb670, 0, {0x48,0x00,0xe0,0x00,0x98,0x01,0xbe,0x00,0x0f,0x80,0x03,0xf0,0x00,0xbc,0x00,0x38 }},
+ {16, 0xb680, 0, {0x04,0x08,0x80,0xa3,0xe0,0x00,0xf8,0x00,0x3e,0x00,0x0f,0x80,0x13,0xa0,0x00,0xe0 }},
+ {16, 0xb690, 0, {0x00,0x3e,0x00,0x0e,0x00,0x03,0xc0,0x00,0xe8,0x00,0xbe,0x04,0x4e,0x80,0x07,0xd2 }},
+ {16, 0xb6a0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0xe4,0x80,0xc9,0x00,0x3e,0x68 }},
+ {16, 0xb6b0, 0, {0x0c,0x90,0x03,0x64,0x00,0xc9,0x00,0x3e,0x40,0x0c,0x90,0x43,0xe0,0x00,0xc8,0x00 }},
+ {16, 0xb6c0, 0, {0x32,0x00,0x0c,0x80,0x13,0x20,0x00,0xc9,0x00,0x36,0x40,0x0c,0x90,0x03,0x64,0x00 }},
+ {16, 0xb6d0, 0, {0x81,0x00,0x32,0x40,0x04,0x90,0x13,0x02,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb6e0, 0, {0x80,0x04,0x65,0x06,0x89,0x40,0x2e,0x60,0x1a,0x14,0x2a,0x05,0x20,0x89,0x00,0x2e }},
+ {16, 0xb6f0, 0, {0x40,0x08,0x90,0x02,0xc4,0x08,0xc1,0x02,0x20,0x40,0x08,0x10,0x1a,0x24,0x00,0x89 }},
+ {16, 0xb700, 0, {0x10,0x32,0x41,0x08,0x90,0x12,0x24,0x00,0x89,0x04,0x36,0x40,0x88,0x94,0x0a,0x20 }},
+ {16, 0xb710, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0x04,0x20,0x89,0x55,0x2e,0x40 }},
+ {16, 0xb720, 0, {0x08,0xd5,0x02,0x34,0x00,0x8d,0x00,0x2e,0x40,0x18,0x90,0x02,0xe4,0x00,0x99,0x00 }},
+ {16, 0xb730, 0, {0x26,0x40,0x08,0x90,0x02,0x04,0x0a,0x89,0x00,0x26,0x40,0x38,0x90,0x0a,0x24,0x00 }},
+ {16, 0xb740, 0, {0xa9,0x00,0x20,0x40,0x0a,0x90,0x82,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb750, 0, {0x08,0x04,0x05,0x00,0x81,0x00,0x2f,0x40,0x0a,0xd4,0x02,0x34,0x00,0x85,0x01,0x2c }},
+ {16, 0xb760, 0, {0x40,0x08,0x10,0x42,0xe4,0x06,0x99,0x00,0x22,0x40,0x08,0x10,0x02,0x05,0x00,0x81 }},
+ {16, 0xb770, 0, {0x40,0x28,0x50,0x08,0x14,0x12,0x05,0x00,0xa1,0x40,0x24,0x50,0x5a,0x10,0x02,0x02 }},
+ {16, 0xb780, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x0d,0x60,0x00,0xc8,0x04,0x3e,0x00 }},
+ {16, 0xb790, 0, {0x08,0x80,0x03,0x21,0x42,0xcc,0x00,0x3e,0x00,0x2c,0x80,0x02,0xe0,0x00,0xd8,0x00 }},
+ {16, 0xb7a0, 0, {0xb6,0x00,0x2c,0x80,0x02,0x20,0x02,0xc8,0x00,0x36,0x00,0x0c,0x80,0x03,0x60,0x02 }},
+ {16, 0xb7b0, 0, {0xe8,0x00,0x32,0x00,0x8e,0x80,0x03,0x2e,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb7c0, 0, {0x98,0x1d,0xf5,0x00,0xf5,0x00,0x3e,0x40,0x87,0x90,0x03,0xe4,0x00,0xf1,0x00,0x3d }},
+ {16, 0xb7d0, 0, {0x50,0x0f,0x54,0x03,0xd1,0x00,0xec,0x40,0x3f,0x10,0x0b,0xc4,0x43,0xf1,0x00,0xf9 }},
+ {16, 0xb7e0, 0, {0x40,0x36,0x50,0x0f,0x94,0x13,0xe5,0x10,0xd9,0x44,0x3d,0x40,0x2d,0xd0,0x03,0xe6 }},
+ {16, 0xb7f0, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x05,0xf6,0x60,0xcd,0x02,0x3b,0x40 }},
+ {16, 0xb800, 0, {0x0c,0xd0,0x03,0xb4,0x40,0xfd,0x06,0x3e,0x40,0x0c,0x90,0x03,0x66,0x04,0xc9,0x82 }},
+ {16, 0xb810, 0, {0xb6,0x62,0x0f,0x18,0x0b,0x36,0x00,0xcd,0x40,0x32,0x61,0x0c,0x90,0x23,0x24,0x0a }},
+ {16, 0xb820, 0, {0xc9,0x00,0x32,0x40,0x4c,0xd0,0x43,0x06,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb830, 0, {0x39,0x10,0xe3,0x80,0xd8,0x00,0x22,0x00,0x0d,0x80,0x02,0x22,0x94,0xb8,0x00,0x2e }},
+ {16, 0xb840, 0, {0x00,0x0d,0x80,0x03,0x21,0x00,0x88,0x40,0x22,0x00,0x0b,0xc4,0x22,0x21,0x50,0x88 }},
+ {16, 0xb850, 0, {0x80,0x22,0x22,0x08,0x80,0x02,0x20,0x10,0x80,0x01,0x2a,0x00,0x0a,0x80,0x03,0x4e }},
+ {16, 0xb860, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xc6,0x00,0x89,0x00,0x2a,0x40 }},
+ {16, 0xb870, 0, {0x88,0x10,0x0a,0x84,0x08,0xb1,0x00,0x29,0x40,0x0a,0x70,0x0a,0xb5,0x00,0x8f,0x40 }},
+ {16, 0xb880, 0, {0x29,0xc0,0x0b,0xf4,0x02,0x24,0x00,0x81,0x20,0x28,0x44,0x89,0x10,0x02,0x04,0x04 }},
+ {16, 0xb890, 0, {0x81,0x02,0x2a,0x40,0x08,0x10,0x02,0x02,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb8a0, 0, {0x18,0x15,0xa6,0x00,0x99,0x20,0x22,0x40,0x09,0x90,0x12,0x24,0x80,0xb9,0x00,0x2f }},
+ {16, 0xb8b0, 0, {0x44,0x03,0xd0,0x02,0xf4,0x00,0x8d,0x00,0x2b,0x41,0x0b,0xd0,0x02,0x26,0x10,0x89 }},
+ {16, 0xb8c0, 0, {0x04,0x2a,0x40,0x09,0x90,0x6e,0x24,0x00,0x89,0x00,0x2a,0x40,0x0a,0x94,0x02,0x46 }},
+ {16, 0xb8d0, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xa2,0x15,0xe6,0x00,0xc9,0x00,0x38,0x42 }},
+ {16, 0xb8e0, 0, {0x0c,0x10,0x13,0xa6,0x04,0x79,0x08,0x3a,0x78,0x06,0x92,0x03,0xa4,0x08,0xc9,0x00 }},
+ {16, 0xb8f0, 0, {0x3a,0x60,0x8f,0x98,0x23,0x06,0x02,0xc9,0x02,0x3a,0x40,0x0d,0x90,0x03,0x04,0x00 }},
+ {16, 0xb900, 0, {0xc9,0x00,0x38,0x40,0x0c,0x90,0x03,0x28,0x04,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb910, 0, {0x28,0x01,0x84,0x10,0xf9,0x80,0xbe,0x40,0x4f,0x90,0x02,0xe4,0x00,0xf9,0x00,0x3c }},
+ {16, 0xb920, 0, {0x60,0x8d,0x92,0x03,0x24,0x42,0xe9,0x10,0x32,0x50,0x0f,0x94,0x03,0xe4,0x00,0xf9 }},
+ {16, 0xb930, 0, {0x00,0xb6,0x41,0x2e,0x10,0x03,0xe4,0x00,0xf9,0x00,0x2e,0x40,0x0f,0x90,0x03,0xca }},
+ {16, 0xb940, 0, {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0xa0,0x08,0xc8,0x00,0x3e,0x10 }},
+ {16, 0xb950, 0, {0x0f,0x88,0x03,0x20,0x08,0xf8,0xc0,0x1e,0x10,0x2c,0x40,0x03,0xf2,0x00,0xcc,0x00 }},
+ {16, 0xb960, 0, {0x3f,0x00,0x0c,0xc0,0x13,0x20,0x02,0xc0,0x00,0x30,0x00,0x0c,0x80,0x2b,0x20,0x10 }},
+ {16, 0xb970, 0, {0xc0,0x04,0x32,0x00,0x0f,0x80,0x03,0x0a,0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb980, 0, {0xa8,0x05,0x3a,0x80,0x86,0xe0,0x2f,0xa0,0x1b,0xe0,0x02,0x3a,0x80,0xba,0x04,0x2e }},
+ {16, 0xb990, 0, {0x80,0x08,0xa0,0x03,0x88,0x08,0xc2,0x00,0x2e,0x81,0x08,0x60,0x02,0x28,0x10,0x8e }},
+ {16, 0xb9a0, 0, {0x81,0x03,0x80,0x08,0xe0,0x01,0x78,0x00,0x8e,0x04,0x03,0x80,0x09,0x68,0x03,0xca }},
+ {16, 0xb9b0, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x05,0x4c,0x00,0x83,0x60,0x2c,0x44 }},
+ {16, 0xb9c0, 0, {0x0b,0x38,0x02,0x0f,0x80,0xb1,0x00,0x2c,0xe5,0x03,0x30,0x10,0xcc,0x10,0x83,0x00 }},
+ {16, 0xb9d0, 0, {0x0c,0xc0,0x29,0x30,0x22,0x04,0x09,0x91,0x10,0x24,0xc0,0xc8,0x30,0x00,0x4c,0x04 }},
+ {16, 0xb9e0, 0, {0x93,0x02,0x24,0xc0,0x0b,0x31,0x02,0x0a,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xb9f0, 0, {0xe0,0x01,0x18,0x80,0x87,0x00,0x2d,0x40,0x0b,0x74,0x42,0x1c,0x01,0xb5,0x01,0x2c }},
+ {16, 0xba00, 0, {0xc0,0x0b,0x60,0x02,0xb0,0x00,0x94,0x04,0x2f,0x20,0x09,0xc0,0x02,0x14,0x90,0x97 }},
+ {16, 0xba10, 0, {0x00,0x25,0xc8,0x08,0x70,0x02,0x4c,0x80,0x97,0x20,0x25,0xc0,0x09,0x70,0x02,0xe8 }},
+ {16, 0xba20, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x08,0x3a,0x82,0xc6,0x80,0x2d,0x60 }},
+ {16, 0xba30, 0, {0x0b,0xf8,0x0b,0x1a,0x00,0xf5,0x80,0x3d,0xe0,0x8f,0x78,0x03,0xde,0x02,0xc7,0x80 }},
+ {16, 0xba40, 0, {0x2d,0xe0,0x0d,0x78,0x0b,0x17,0x02,0xdf,0x80,0x24,0xf8,0x2c,0xfd,0x03,0x5e,0x0c }},
+ {16, 0xba50, 0, {0xd7,0xe0,0x35,0xe0,0x0f,0x68,0x03,0x2a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xba60, 0, {0x48,0x1d,0xae,0x40,0xfa,0x04,0x3e,0x40,0x0f,0x80,0x13,0xec,0x04,0xf9,0x00,0x3e }},
+ {16, 0xba70, 0, {0xc1,0x0c,0xa0,0x13,0xc0,0x10,0xe8,0x00,0x3c,0x00,0x4e,0x80,0x43,0xc4,0x20,0x89 }},
+ {16, 0xba80, 0, {0x00,0xba,0xc0,0x07,0xb6,0x21,0xed,0x06,0xeb,0x68,0xba,0xcc,0x0f,0x20,0x13,0xc2 }},
+ {16, 0xba90, 0, {0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xbe,0x00,0xc6,0x80,0x31,0x60 }},
+ {16, 0xbaa0, 0, {0x2d,0x78,0x0b,0x3e,0x48,0xec,0x92,0x3d,0x60,0x0c,0x58,0x03,0x5a,0x40,0xd5,0x80 }},
+ {16, 0xbab0, 0, {0x31,0x61,0x0c,0x58,0x23,0x36,0x00,0xcf,0x82,0x3f,0xe0,0x0c,0xf8,0x03,0xff,0x60 }},
+ {16, 0xbac0, 0, {0xcf,0x90,0x33,0xf0,0x0c,0x52,0x03,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbad0, 0, {0xa8,0x11,0xb8,0x84,0x86,0x14,0xb5,0xc0,0x08,0x70,0x02,0x1e,0xc0,0xc4,0x00,0x2d }},
+ {16, 0xbae0, 0, {0x40,0x08,0x40,0x02,0x14,0xd0,0x86,0x10,0x21,0x80,0x4c,0x62,0x42,0x34,0x40,0xa5 }},
+ {16, 0xbaf0, 0, {0x00,0x35,0xc0,0x28,0x70,0x42,0xdc,0xc2,0x8f,0x30,0x23,0xc0,0x08,0x50,0x02,0x2a }},
+ {16, 0xbb00, 0, {0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x98,0x28,0x8e,0x00,0xa5,0x40 }},
+ {16, 0xbb10, 0, {0x08,0xf1,0x02,0x18,0x64,0xb4,0x00,0x6d,0x42,0x08,0x50,0x02,0x18,0x01,0x85,0x08 }},
+ {16, 0xbb20, 0, {0x21,0x40,0x09,0x58,0x22,0x54,0x00,0x85,0x10,0x2d,0xc4,0x09,0x70,0x02,0xdc,0x04 }},
+ {16, 0xbb30, 0, {0x97,0x00,0x25,0xc0,0x08,0x44,0x02,0x00,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbb40, 0, {0x60,0x14,0x8c,0x00,0x82,0x80,0x24,0xc0,0x08,0x80,0x02,0x2d,0x00,0x80,0x4a,0x2c }},
+ {16, 0xbb50, 0, {0x42,0x08,0x0a,0x42,0x06,0x00,0x92,0x84,0x20,0xa0,0x88,0x28,0x42,0x44,0x00,0xa3 }},
+ {16, 0xbb60, 0, {0x06,0x24,0xc0,0x0b,0x30,0x02,0xcc,0x10,0x93,0x04,0x24,0xc1,0x09,0x00,0x02,0x08 }},
+ {16, 0xbb70, 0, {0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x15,0xbc,0x00,0xcb,0x00,0x36,0x40 }},
+ {16, 0xbb80, 0, {0x0c,0xb4,0x13,0x2c,0x00,0xf9,0x00,0x3e,0xa0,0x0c,0xa2,0x03,0x04,0x08,0xc2,0x80 }},
+ {16, 0xbb90, 0, {0x30,0xa8,0x0d,0x2a,0x03,0x54,0x00,0xcb,0x00,0x3f,0xc0,0x0d,0xf0,0x03,0xfc,0x08 }},
+ {16, 0xbba0, 0, {0xdf,0x00,0x37,0xd0,0x0c,0xb0,0x03,0x2a,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbbb0, 0, {0x80,0x00,0xe0,0x00,0xfb,0x10,0x3a,0x40,0x0e,0xb0,0x03,0xed,0x90,0xf9,0x11,0x7e }},
+ {16, 0xbbc0, 0, {0x80,0x4f,0xb0,0x53,0xe8,0x40,0xe9,0x00,0x3e,0x40,0x0f,0x90,0x03,0xa6,0x08,0xf9 }},
+ {16, 0xbbd0, 0, {0x01,0x3a,0xc0,0x0c,0xb0,0x13,0xcc,0x00,0xeb,0x02,0x3a,0xc6,0x8e,0xb8,0x03,0xe0 }},
+ {16, 0xbbe0, 0, {0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0xf0,0x0c,0xce,0x00,0x3f,0xe0 }},
+ {16, 0xbbf0, 0, {0x2c,0xf0,0x83,0x3a,0x48,0xcd,0x01,0x35,0x80,0x0c,0x60,0x12,0x34,0x0a,0xce,0x00 }},
+ {16, 0xbc00, 0, {0xb3,0x80,0x2c,0xe0,0x0b,0x74,0x00,0xc9,0x10,0xb3,0xc1,0x0f,0xf0,0x1b,0x3c,0x00 }},
+ {16, 0xbc10, 0, {0xcf,0x00,0xb7,0xc0,0x2c,0xe0,0x03,0x00,0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbc20, 0, {0x81,0x04,0x6e,0x10,0x88,0x80,0x2c,0xc0,0x18,0x98,0x02,0x2d,0x80,0x81,0x00,0x36 }},
+ {16, 0xbc30, 0, {0x91,0x08,0xb0,0x03,0x68,0x00,0xc9,0x00,0x22,0x40,0x08,0x90,0x02,0x24,0x00,0x83 }},
+ {16, 0xbc40, 0, {0x80,0x36,0xc0,0x0b,0x30,0x02,0x2c,0x02,0x83,0x00,0x20,0xc0,0x08,0x20,0x03,0x60 }},
+ {16, 0xbc50, 0, {0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x06,0x00,0x8a,0x80,0x2e,0x45 }},
+ {16, 0xbc60, 0, {0x28,0x88,0x02,0x24,0x02,0x88,0x02,0x02,0x02,0x08,0x80,0x02,0xa2,0x00,0x98,0x00 }},
+ {16, 0xbc70, 0, {0x22,0x00,0x08,0x80,0x12,0x24,0x00,0x89,0x01,0x22,0xc1,0x0a,0xb0,0x02,0x6c,0x00 }},
+ {16, 0xbc80, 0, {0xab,0x00,0x22,0xc1,0x08,0x90,0x12,0x60,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbc90, 0, {0x08,0x04,0x00,0x00,0x80,0x00,0x2c,0xc0,0x48,0x08,0x12,0x00,0x80,0x80,0x02,0x24 }},
+ {16, 0xbca0, 0, {0x00,0x08,0x18,0x42,0xac,0x02,0x8b,0x80,0x22,0xe0,0x08,0xb8,0x12,0x04,0x02,0x83 }},
+ {16, 0xbcb0, 0, {0x00,0x20,0xc0,0x0b,0x30,0x42,0x0c,0x00,0xa3,0x01,0x60,0xc0,0x48,0x10,0x02,0x42 }},
+ {16, 0xbcc0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x68,0x08,0xca,0x00,0x2e,0x40 }},
+ {16, 0xbcd0, 0, {0x08,0x80,0x03,0x00,0x00,0xc8,0x06,0x32,0x00,0x0c,0x80,0x02,0xa0,0x00,0xd8,0x00 }},
+ {16, 0xbce0, 0, {0x32,0x00,0x0c,0x80,0x03,0x74,0x00,0xcb,0x00,0x22,0xc0,0x0f,0xf0,0x03,0x3c,0x00 }},
+ {16, 0xbcf0, 0, {0xef,0x00,0x37,0xc0,0x0c,0x80,0x01,0x40,0x03,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbd00, 0, {0xa0,0x19,0xfc,0x00,0xfc,0x04,0x3f,0xc0,0x0f,0xc0,0x03,0xe1,0x00,0xfc,0x00,0x3b }},
+ {16, 0xbd10, 0, {0x00,0x0f,0xd0,0x03,0x7c,0x00,0xef,0x00,0x2f,0xc0,0x0f,0xf0,0x11,0xf4,0x10,0xfd }},
+ {16, 0xbd20, 0, {0x02,0x3d,0xc0,0x4f,0xf0,0x03,0xdc,0x00,0xdf,0x04,0x3f,0xc0,0x0f,0xc0,0x43,0xe9 }},
+ {16, 0xbd30, 0, {0x06,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x41,0x02,0x70,0x20,0xdc,0x10 }},
+ {16, 0xbd40, 0, {0x67,0x04,0x0d,0xc1,0x02,0x70,0x20,0x9c,0x10,0x37,0x04,0x0d,0xc1,0x06,0x70,0x40 }},
+ {16, 0xbd50, 0, {0x4c,0x10,0x37,0x14,0x15,0xc1,0x03,0x70,0x40,0xdc,0x10,0x13,0x04,0x0d,0xc1,0x07 }},
+ {16, 0xbd60, 0, {0x70,0x40,0xdc,0x10,0x37,0x04,0x0d,0xc0,0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbd70, 0, {0x00,0xc5,0x44,0x05,0x71,0x21,0x5c,0x40,0x57,0x10,0x15,0xc4,0x05,0x71,0x05,0x5c }},
+ {16, 0xbd80, 0, {0x40,0x57,0x10,0x15,0xc4,0x06,0x71,0x01,0x4c,0x40,0x57,0x10,0x0d,0xc4,0x05,0x71 }},
+ {16, 0xbd90, 0, {0x05,0x5c,0x40,0x53,0x10,0x15,0xc4,0x07,0x71,0x01,0x5c,0x40,0x57,0x10,0x15,0xc0 }},
+ {16, 0xbda0, 0, {0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x02,0x01,0x20,0x80,0x48,0x20 }},
+ {16, 0xbdb0, 0, {0x12,0x08,0x04,0x82,0x01,0x20,0x80,0x48,0x20,0x12,0x08,0x04,0x82,0x01,0x20,0x80 }},
+ {16, 0xbdc0, 0, {0x48,0x20,0x12,0x08,0x04,0x82,0x01,0x20,0x80,0x48,0x20,0x12,0x08,0x04,0x82,0x01 }},
+ {16, 0xbdd0, 0, {0x20,0x80,0x48,0x20,0x12,0x08,0x04,0x80,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbde0, 0, {0x00,0x84,0x00,0x01,0x60,0x00,0x58,0x00,0x56,0x00,0x05,0x80,0x01,0x60,0x04,0x58 }},
+ {16, 0xbdf0, 0, {0x00,0x16,0x00,0x05,0x80,0x01,0x20,0x01,0x58,0x00,0x16,0x00,0x05,0x80,0x01,0x60 }},
+ {16, 0xbe00, 0, {0x00,0x58,0x00,0x56,0x00,0x05,0x80,0x01,0x60,0x00,0x58,0x00,0x16,0x00,0x01,0x80 }},
+ {16, 0xbe10, 0, {0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x48,0x05,0x72,0x11,0x5c,0x80 }},
+ {16, 0xbe20, 0, {0x17,0x20,0x15,0xd8,0x05,0x32,0x11,0x1c,0x80,0x47,0x20,0x14,0x88,0x00,0x72,0x01 }},
+ {16, 0xbe30, 0, {0x1c,0x80,0x57,0x20,0x05,0xc8,0x04,0x72,0x01,0x5c,0x80,0x57,0x20,0x15,0xc8,0x01 }},
+ {16, 0xbe40, 0, {0x72,0x01,0x5c,0x80,0x57,0x24,0x15,0xc0,0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbe50, 0, {0x00,0xc1,0x40,0x00,0x60,0x00,0x18,0x00,0x06,0x00,0x01,0x80,0x40,0x20,0x00,0x18 }},
+ {16, 0xbe60, 0, {0x00,0x06,0x00,0x01,0x90,0x00,0x60,0x00,0x18,0x00,0x06,0x00,0x41,0x80,0x00,0x60 }},
+ {16, 0xbe70, 0, {0x00,0x18,0x00,0x06,0x00,0x01,0x80,0x00,0x60,0x00,0x18,0x10,0x06,0x00,0x01,0x80 }},
+ {16, 0xbe80, 0, {0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x48,0x04,0x22,0x01,0x08,0x80 }},
+ {16, 0xbe90, 0, {0x02,0x20,0x10,0x88,0x04,0x62,0x01,0x08,0x80,0x42,0x20,0x10,0x88,0x00,0x20,0x01 }},
+ {16, 0xbea0, 0, {0x08,0x80,0x42,0x20,0x00,0x88,0x04,0x22,0x01,0x08,0x00,0x42,0x20,0x10,0x88,0x00 }},
+ {16, 0xbeb0, 0, {0x22,0x01,0x08,0x80,0x42,0x30,0x10,0x80,0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbec0, 0, {0x00,0xc5,0x4a,0x05,0x42,0x81,0x50,0xa0,0x04,0x28,0x15,0x0a,0x05,0x52,0x81,0x10 }},
+ {16, 0xbed0, 0, {0xa0,0x44,0x28,0x11,0x1a,0x00,0x40,0x80,0x10,0xa0,0x54,0x28,0x05,0x0a,0x05,0x42 }},
+ {16, 0xbee0, 0, {0x81,0x51,0x20,0x14,0x28,0x15,0x0a,0x01,0x42,0x81,0x50,0xa0,0x54,0x28,0x15,0x00 }},
+ {16, 0xbef0, 0, {0x31,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0c,0x01,0x53,0x40,0x54,0xc0 }},
+ {16, 0xbf00, 0, {0x15,0x30,0x05,0x5c,0x01,0x57,0x40,0x54,0xc0,0x15,0x30,0x05,0x5c,0x01,0x53,0x00 }},
+ {16, 0xbf10, 0, {0x55,0xc0,0x15,0x74,0x05,0x4c,0x01,0x53,0x00,0x55,0xc0,0x15,0x74,0x05,0x4c,0x01 }},
+ {16, 0xbf20, 0, {0x53,0x00,0x54,0xc0,0x11,0x30,0x01,0x40,0x21,0x10,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbf30, 0, {0x00,0x80,0x00,0x00,0x40,0x00,0x10,0x00,0x04,0x00,0x01,0x00,0x00,0x40,0x00,0x10 }},
+ {16, 0xbf40, 0, {0x00,0x04,0x00,0x01,0x00,0x00,0x42,0x00,0x10,0x00,0x04,0x00,0x11,0x00,0x00,0x40 }},
+ {16, 0xbf50, 0, {0x00,0x10,0xc1,0x04,0x00,0x01,0x00,0x00,0x40,0x00,0x10,0x00,0x01,0x10,0x01,0x01 }},
+ {16, 0xbf60, 0, {0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x60,0x02,0x08,0x00,0x82,0x00 }},
+ {16, 0xbf70, 0, {0x20,0x80,0x08,0x20,0x02,0x08,0x00,0x82,0x00,0x20,0x80,0x08,0x20,0x02,0x08,0x00 }},
+ {16, 0xbf80, 0, {0x82,0x00,0x20,0x84,0x00,0x20,0x02,0x08,0x00,0x82,0x00,0x20,0x84,0x08,0x20,0x02 }},
+ {16, 0xbf90, 0, {0x08,0x00,0x82,0x00,0x21,0x80,0x08,0x01,0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xbfa0, 0, {0x00,0xc5,0x40,0x05,0x60,0x01,0x58,0x00,0x96,0x00,0x15,0x90,0x05,0x64,0x02,0x58 }},
+ {16, 0xbfb0, 0, {0x00,0x56,0x00,0x55,0x90,0x05,0x60,0x01,0xd9,0x00,0x16,0x40,0x15,0x80,0x05,0x60 }},
+ {16, 0xbfc0, 0, {0x01,0x59,0x00,0x76,0x40,0x15,0x80,0x05,0x60,0x01,0x58,0x00,0x56,0x00,0x15,0x80 }},
+ {16, 0xbfd0, 0, {0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0x40,0x03,0x60,0x00,0xd8,0x00 }},
+ {16, 0xbfe0, 0, {0x36,0x00,0x4d,0x80,0x03,0x60,0x00,0xd8,0x00,0x36,0x00,0x0d,0x80,0x07,0x62,0x00 }},
+ {16, 0xbff0, 0, {0x58,0x00,0x36,0x00,0x0d,0x80,0x07,0x60,0x00,0xd8,0x80,0x16,0x00,0x0d,0x80,0x03 }},
+ {16, 0xc000, 0, {0x60,0x00,0xd8,0x00,0x36,0x00,0x1d,0x80,0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc010, 0, {0x00,0xc5,0x42,0x04,0x30,0x81,0x0c,0x20,0x43,0x08,0x10,0xc2,0x04,0x30,0x81,0x0c }},
+ {16, 0xc020, 0, {0x20,0x43,0x08,0x10,0xc2,0x04,0x30,0xc1,0x0c,0x20,0x43,0x08,0x10,0xc2,0x06,0x30 }},
+ {16, 0xc030, 0, {0x81,0x0c,0x20,0x43,0x08,0x10,0xc2,0x04,0x30,0x81,0x0c,0x20,0x43,0x08,0x18,0xc0 }},
+ {16, 0xc040, 0, {0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x30,0x00,0x0c,0x00 }},
+ {16, 0xc050, 0, {0x03,0x00,0x00,0xc0,0x00,0x30,0x00,0x0c,0x00,0x03,0x00,0x00,0xc0,0x40,0x30,0x00 }},
+ {16, 0xc060, 0, {0x0c,0x00,0x03,0x00,0x00,0xc0,0x00,0x30,0x00,0x0c,0x00,0x03,0x00,0x00,0xc0,0x00 }},
+ {16, 0xc070, 0, {0x30,0x00,0x0c,0x00,0x03,0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc080, 0, {0x00,0x80,0x02,0x01,0x30,0x80,0x4c,0x20,0x13,0x08,0x04,0xc2,0x01,0x30,0x80,0x4c }},
+ {16, 0xc090, 0, {0x20,0x13,0x08,0x04,0xc2,0x25,0x30,0x81,0x4c,0x20,0x13,0x08,0x04,0xc2,0x01,0x30 }},
+ {16, 0xc0a0, 0, {0x80,0x4c,0x32,0x53,0x08,0x04,0xc2,0x01,0x30,0x80,0x4c,0x20,0x13,0x08,0x04,0xc0 }},
+ {16, 0xc0b0, 0, {0x20,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x42,0x05,0x62,0x81,0x58,0x20 }},
+ {16, 0xc0c0, 0, {0x56,0x08,0x15,0x82,0x04,0x60,0x81,0x58,0x20,0x46,0x08,0x15,0x82,0x01,0x60,0xc1 }},
+ {16, 0xc0d0, 0, {0x58,0x20,0x46,0x08,0x15,0x82,0x01,0x60,0x81,0x58,0x30,0x56,0x08,0x15,0x82,0x05 }},
+ {16, 0xc0e0, 0, {0x60,0x81,0x58,0x20,0x56,0x08,0x05,0x80,0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc0f0, 0, {0x00,0xc5,0x42,0x00,0x20,0x80,0x08,0x20,0x02,0x08,0x00,0x82,0x00,0x20,0x80,0x08 }},
+ {16, 0xc100, 0, {0x20,0x02,0x08,0x00,0x82,0x00,0x20,0x80,0x0c,0x20,0x02,0x08,0x00,0x82,0x00,0x20 }},
+ {16, 0xc110, 0, {0x80,0x08,0x20,0x03,0x08,0x00,0x82,0x00,0x20,0x80,0x08,0x20,0x02,0x08,0x00,0x80 }},
+ {16, 0xc120, 0, {0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x42,0x04,0x66,0x81,0x18,0x20 }},
+ {16, 0xc130, 0, {0x46,0x08,0x11,0x82,0x04,0x64,0x81,0x18,0x20,0x46,0x08,0x11,0x82,0x00,0x60,0x81 }},
+ {16, 0xc140, 0, {0x0c,0x20,0x46,0x08,0x11,0x82,0x00,0x60,0x81,0x19,0x20,0x43,0x08,0x11,0x82,0x04 }},
+ {16, 0xc150, 0, {0x60,0x81,0x19,0x20,0x46,0x48,0x01,0x80,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc160, 0, {0x00,0xc5,0x60,0x05,0x58,0x01,0x56,0x00,0x55,0x80,0x15,0x60,0x04,0x58,0x01,0x56 }},
+ {16, 0xc170, 0, {0x00,0x45,0x80,0x11,0x60,0x00,0x58,0x00,0x06,0x00,0x45,0x80,0x15,0x60,0x01,0x58 }},
+ {16, 0xc180, 0, {0x01,0x16,0x00,0x01,0x80,0x15,0x60,0x05,0x58,0x01,0x56,0x00,0x55,0x80,0x05,0x40 }},
+ {16, 0xc190, 0, {0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x06,0x01,0x49,0x80,0x10,0x60 }},
+ {16, 0xc1a0, 0, {0x14,0x18,0x05,0x06,0x01,0x79,0x80,0x50,0x60,0x14,0x18,0x01,0x06,0x01,0x41,0x80 }},
+ {16, 0xc1b0, 0, {0x50,0x60,0x04,0x18,0x05,0x06,0x01,0x41,0x80,0x10,0x60,0x14,0x18,0x05,0x06,0x01 }},
+ {16, 0xc1c0, 0, {0x41,0x80,0x50,0x60,0x14,0x18,0x05,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc1d0, 0, {0x00,0x80,0x02,0x01,0x04,0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x00,0x04,0x04,0x40 }},
+ {16, 0xc1e0, 0, {0x20,0x10,0x08,0x04,0x02,0x01,0x00,0x84,0x40,0x20,0x10,0x08,0x04,0x02,0x01,0x00 }},
+ {16, 0xc1f0, 0, {0x80,0x41,0x20,0x10,0x08,0x04,0x02,0x11,0x00,0x80,0x41,0x20,0x10,0x48,0x04,0x00 }},
+ {16, 0xc200, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x46,0x03,0x51,0x80,0xd4,0x60 }},
+ {16, 0xc210, 0, {0x35,0x18,0x0d,0x46,0x02,0x11,0x80,0xd4,0x60,0x35,0x18,0x0d,0x46,0x03,0x11,0x80 }},
+ {16, 0xc220, 0, {0xd4,0x60,0x35,0x18,0x0d,0x46,0x03,0x51,0x80,0xd4,0x60,0x35,0x18,0x0d,0x46,0x03 }},
+ {16, 0xc230, 0, {0x51,0x80,0xd4,0x60,0x35,0x18,0x0d,0x40,0x31,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc240, 0, {0x00,0xc5,0x46,0x05,0x70,0x81,0x5c,0x60,0x07,0x18,0x15,0xc6,0x04,0x71,0x81,0x1c }},
+ {16, 0xc250, 0, {0x60,0x17,0x18,0x15,0xc6,0x05,0x31,0x81,0xdc,0x60,0x57,0x18,0x15,0xc6,0x05,0x71 }},
+ {16, 0xc260, 0, {0x80,0x1c,0x60,0x77,0x18,0x15,0xce,0x05,0x71,0x81,0x5c,0x60,0x57,0x18,0x15,0xc0 }},
+ {16, 0xc270, 0, {0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x46,0x02,0x71,0x80,0x9c,0x61 }},
+ {16, 0xc280, 0, {0x77,0x18,0x0d,0xc6,0x02,0x71,0x80,0x9c,0x60,0x37,0x18,0x0d,0xc2,0x03,0x31,0x80 }},
+ {16, 0xc290, 0, {0x5c,0x60,0x27,0x18,0x0d,0xc6,0x03,0x71,0x80,0x9c,0x60,0x17,0x18,0x0d,0xce,0x03 }},
+ {16, 0xc2a0, 0, {0x71,0x80,0xdc,0x60,0x37,0x18,0x0d,0xc0,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc2b0, 0, {0x00,0x45,0x46,0x05,0x75,0x81,0x5c,0x60,0x77,0x18,0x15,0xc6,0x05,0x75,0x81,0x5c }},
+ {16, 0xc2c0, 0, {0x60,0x57,0x18,0x15,0xc6,0x05,0x31,0x81,0x0c,0x60,0x57,0x18,0x15,0xc6,0x05,0x71 }},
+ {16, 0xc2d0, 0, {0x81,0x5c,0x60,0x43,0x18,0x15,0xc6,0x05,0x71,0x81,0x5c,0x60,0x57,0x18,0x15,0xc0 }},
+ {16, 0xc2e0, 0, {0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x02,0x01,0x20,0x80,0x48,0x20 }},
+ {16, 0xc2f0, 0, {0x12,0x08,0x04,0x82,0x01,0x20,0x80,0x48,0x20,0x12,0x08,0x04,0x82,0x01,0x20,0x80 }},
+ {16, 0xc300, 0, {0x5c,0x20,0x12,0x08,0x04,0x82,0x01,0x20,0x80,0x48,0x00,0x17,0x08,0x04,0x82,0x01 }},
+ {16, 0xc310, 0, {0x20,0x80,0x48,0x20,0x12,0x08,0x04,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc320, 0, {0x00,0x00,0x06,0x01,0x63,0x80,0x58,0x60,0x16,0x18,0x05,0x86,0x01,0x61,0x80,0x58 }},
+ {16, 0xc330, 0, {0x60,0x16,0x18,0x05,0x86,0x01,0x61,0x81,0x58,0x60,0x16,0x18,0x05,0x86,0x01,0x61 }},
+ {16, 0xc340, 0, {0x80,0x58,0x60,0x56,0x18,0x05,0x86,0x01,0x61,0x80,0x58,0x60,0x16,0x18,0x05,0x80 }},
+ {16, 0xc350, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x45,0x40,0x05,0x70,0x01,0x5c,0x00 }},
+ {16, 0xc360, 0, {0x17,0x00,0x15,0xc0,0x85,0x74,0x01,0x1c,0x00,0x47,0x00,0x11,0xc0,0x05,0x70,0x01 }},
+ {16, 0xc370, 0, {0x5c,0x00,0x53,0x00,0x10,0xc0,0x05,0x70,0x01,0x5c,0x00,0x57,0x00,0x14,0xc9,0x04 }},
+ {16, 0xc380, 0, {0x70,0x01,0x1c,0x00,0x57,0x00,0x15,0xc0,0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc390, 0, {0x00,0x45,0x42,0x00,0x60,0xc0,0x18,0x20,0x06,0x08,0x01,0x82,0x00,0x60,0x80,0x18 }},
+ {16, 0xc3a0, 0, {0x20,0x06,0x08,0x01,0x82,0x00,0x20,0x80,0x18,0x30,0x02,0x08,0x00,0x82,0x10,0x60 }},
+ {16, 0xc3b0, 0, {0x80,0x18,0x20,0x06,0x08,0x00,0x82,0x00,0x60,0x80,0x18,0x20,0x06,0x08,0x01,0x80 }},
+ {16, 0xc3c0, 0, {0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x42,0x04,0x20,0x81,0x08,0x20 }},
+ {16, 0xc3d0, 0, {0x02,0x08,0x10,0x82,0x04,0x20,0x81,0x08,0x20,0x42,0x08,0x10,0x82,0x04,0x20,0x81 }},
+ {16, 0xc3e0, 0, {0x08,0x20,0x46,0x08,0x11,0x82,0x04,0x20,0x81,0x08,0x20,0x42,0x08,0x11,0x82,0x04 }},
+ {16, 0xc3f0, 0, {0x20,0x81,0x08,0x20,0x42,0x08,0x10,0x80,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc400, 0, {0x00,0x45,0x42,0x05,0x40,0xc5,0x50,0x20,0x14,0x08,0x15,0x00,0x04,0x40,0x81,0x50 }},
+ {16, 0xc410, 0, {0x20,0x54,0x08,0x11,0x02,0x05,0x00,0x80,0x10,0x20,0x45,0x0c,0x11,0x42,0x04,0x40 }},
+ {16, 0xc420, 0, {0x81,0x50,0x20,0x14,0x0c,0x15,0x42,0x04,0x40,0x81,0x10,0x20,0x54,0x08,0x15,0x00 }},
+ {16, 0xc430, 0, {0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x03,0x01,0x50,0xc0,0x44,0x30 }},
+ {16, 0xc440, 0, {0x15,0x0c,0x05,0x43,0x01,0x50,0xc0,0x4c,0x30,0x15,0x0c,0x05,0x43,0x21,0x50,0xc0 }},
+ {16, 0xc450, 0, {0x54,0x30,0x15,0x0c,0x05,0x43,0x01,0x50,0xc0,0x54,0x30,0x15,0x0c,0x05,0x43,0x01 }},
+ {16, 0xc460, 0, {0x50,0xc0,0x54,0x20,0x15,0x0c,0x05,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc470, 0, {0x00,0x00,0x08,0x00,0x42,0x00,0x04,0x80,0x04,0x20,0x01,0x08,0x00,0x42,0x00,0x04 }},
+ {16, 0xc480, 0, {0x80,0x04,0x20,0x01,0x08,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0x01,0x08,0x00,0x42 }},
+ {16, 0xc490, 0, {0x00,0x10,0x80,0x04,0x00,0x01,0x08,0x00,0x42,0x00,0x10,0x80,0x04,0x20,0x01,0x00 }},
+ {16, 0xc4a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x45,0x42,0x02,0x00,0x80,0x84,0x20 }},
+ {16, 0xc4b0, 0, {0x20,0x08,0x08,0x02,0x02,0x00,0x80,0x84,0x20,0x20,0x08,0x08,0x02,0x02,0x00,0x80 }},
+ {16, 0xc4c0, 0, {0x80,0xa0,0x20,0x28,0x08,0x02,0x02,0x00,0x80,0x80,0x20,0x20,0x28,0x08,0x02,0x02 }},
+ {16, 0xc4d0, 0, {0x00,0x80,0x80,0x20,0x20,0x08,0x08,0x00,0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc4e0, 0, {0x00,0x45,0x40,0x05,0x60,0x41,0x58,0x00,0x56,0x00,0x15,0x80,0x05,0x60,0x01,0x58 }},
+ {16, 0xc4f0, 0, {0x00,0x56,0x00,0x15,0x80,0x05,0x20,0x01,0xd8,0x00,0x56,0x00,0x15,0x80,0x05,0x60 }},
+ {16, 0xc500, 0, {0x01,0x58,0x00,0x76,0x00,0x15,0x80,0x05,0x60,0x01,0x58,0x00,0x56,0x00,0x15,0x80 }},
+ {16, 0xc510, 0, {0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x40,0x03,0x60,0x00,0xd8,0x00 }},
+ {16, 0xc520, 0, {0x26,0x00,0x0d,0x80,0x02,0x60,0x00,0xd8,0x00,0x36,0x00,0x0d,0x80,0x07,0x60,0x01 }},
+ {16, 0xc530, 0, {0x5c,0x00,0x36,0x00,0x0d,0x80,0x03,0x60,0x00,0xd8,0x00,0x57,0x00,0x0d,0x80,0x02 }},
+ {16, 0xc540, 0, {0x60,0x00,0x98,0x00,0x36,0x00,0x0d,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc550, 0, {0x00,0x00,0x00,0x04,0x30,0x21,0x0c,0x00,0x43,0x00,0x10,0xc0,0x04,0x30,0x01,0x0c }},
+ {16, 0xc560, 0, {0x00,0x43,0x00,0x10,0xc0,0x04,0x30,0x01,0x18,0x00,0x43,0x00,0x10,0xc0,0x04,0x30 }},
+ {16, 0xc570, 0, {0x01,0x0c,0x00,0x46,0x00,0x10,0xc0,0x04,0x30,0x01,0x0c,0x00,0x43,0x00,0x10,0xc0 }},
+ {16, 0xc580, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x0c,0x00 }},
+ {16, 0xc590, 0, {0x03,0x00,0x00,0xc0,0x00,0x35,0x08,0x0c,0x00,0x03,0x00,0x00,0xc6,0x00,0x14,0x00 }},
+ {16, 0xc5a0, 0, {0x08,0x00,0x03,0x40,0x00,0xc0,0x00,0x30,0x00,0x0d,0x40,0x02,0x00,0x00,0xc0,0x00 }},
+ {16, 0xc5b0, 0, {0x30,0x00,0x0c,0x00,0x03,0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc5c0, 0, {0x00,0x00,0x05,0x01,0x31,0x40,0x4c,0x50,0x13,0x14,0x04,0xc5,0x01,0x31,0xc0,0x4c }},
+ {16, 0xc5d0, 0, {0x50,0x13,0x14,0x04,0xc5,0x05,0x31,0x41,0x4c,0x50,0x13,0x14,0x04,0xc5,0x01,0x31 }},
+ {16, 0xc5e0, 0, {0x40,0x4c,0x70,0x53,0x14,0x04,0xc5,0x01,0x31,0x40,0x4c,0x40,0x13,0x14,0x04,0xc0 }},
+ {16, 0xc5f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x05,0x68,0xc1,0x5a,0x30 }},
+ {16, 0xc600, 0, {0x56,0x8c,0x15,0xa3,0x05,0x69,0xc1,0x5a,0x30,0x46,0x8c,0x11,0xa7,0x01,0x68,0xc0 }},
+ {16, 0xc610, 0, {0x1a,0x30,0x56,0x8c,0x11,0xa3,0x04,0x68,0xc1,0x1a,0x30,0x16,0x8c,0x15,0xa3,0x04 }},
+ {16, 0xc620, 0, {0x68,0xc1,0x5a,0x30,0x56,0x8c,0x11,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc630, 0, {0x00,0x00,0x00,0x00,0x20,0x00,0x08,0x00,0x02,0x00,0x00,0x80,0x00,0x24,0x00,0x08 }},
+ {16, 0xc640, 0, {0x01,0x02,0x00,0x00,0x80,0x00,0x24,0x00,0x08,0x80,0x02,0x60,0x00,0x80,0x00,0x20 }},
+ {16, 0xc650, 0, {0x00,0x09,0x40,0x02,0x20,0x00,0x80,0x00,0x20,0x00,0x08,0x00,0x02,0x00,0x00,0x80 }},
+ {16, 0xc660, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x44,0x62,0x11,0x18,0x84 }},
+ {16, 0xc670, 0, {0x46,0x21,0x11,0x88,0x44,0x62,0x09,0x18,0x84,0x46,0x21,0x11,0x88,0x60,0x62,0x10 }},
+ {16, 0xc680, 0, {0x18,0x04,0x46,0x01,0x11,0x88,0x44,0x62,0x11,0x18,0x80,0x06,0x01,0x11,0x88,0x44 }},
+ {16, 0xc690, 0, {0x62,0x11,0x18,0x84,0x46,0x21,0x11,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc6a0, 0, {0x00,0x00,0x00,0x45,0x50,0x11,0x54,0x04,0x55,0x01,0x15,0x40,0x44,0x50,0x11,0x54 }},
+ {16, 0xc6b0, 0, {0x04,0x45,0x01,0x11,0x40,0x40,0x50,0x10,0x54,0x04,0x45,0x01,0x15,0x40,0x44,0x50 }},
+ {16, 0xc6c0, 0, {0x11,0x14,0x00,0x15,0x01,0x15,0x40,0x44,0x50,0x11,0x54,0x04,0x55,0x00,0x11,0x40 }},
+ {16, 0xc6d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x21,0x42,0x08,0x50,0x82 }},
+ {16, 0xc6e0, 0, {0x14,0x20,0x85,0x08,0x21,0x42,0x00,0x50,0x82,0x14,0x20,0x85,0x08,0x20,0x42,0x08 }},
+ {16, 0xc6f0, 0, {0x50,0x82,0x15,0x20,0x05,0x48,0x21,0x42,0x08,0x50,0x82,0x14,0x20,0x81,0x40,0x21 }},
+ {16, 0xc700, 0, {0x42,0x08,0x50,0x82,0x14,0x20,0x85,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc710, 0, {0x00,0x00,0x0a,0x01,0x02,0x80,0x40,0xa0,0x10,0x28,0x04,0x0a,0x01,0x02,0x84,0x40 }},
+ {16, 0xc720, 0, {0xa1,0x10,0x28,0x04,0x0a,0x01,0x02,0x80,0x40,0xa0,0x00,0x28,0x00,0x0a,0x01,0x02 }},
+ {16, 0xc730, 0, {0x80,0x40,0xb0,0x10,0x28,0x00,0x0a,0x01,0x02,0x80,0x40,0xa0,0x10,0x28,0x04,0x00 }},
+ {16, 0xc740, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x03,0x53,0x00,0xd4,0xc0 }},
+ {16, 0xc750, 0, {0x35,0x30,0x0d,0x4c,0x03,0x53,0x00,0xd4,0xc0,0x35,0x30,0x0d,0x4c,0x03,0x53,0x00 }},
+ {16, 0xc760, 0, {0xd4,0xc0,0x21,0x30,0x08,0x4c,0x03,0x53,0x00,0xd4,0xc0,0x35,0x30,0x08,0x4c,0x03 }},
+ {16, 0xc770, 0, {0x53,0x00,0xd4,0xc0,0x35,0x30,0x0d,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc780, 0, {0x00,0x00,0x08,0x04,0x70,0x01,0x5c,0x80,0x07,0x20,0x25,0xc9,0x04,0x72,0x01,0x5c }},
+ {16, 0xc790, 0, {0x80,0x47,0x20,0x15,0xc8,0x00,0x72,0x05,0xdc,0x80,0x57,0x20,0x15,0xc8,0x05,0x72 }},
+ {16, 0xc7a0, 0, {0x01,0x1c,0x90,0x67,0x20,0x15,0xc8,0x05,0x72,0x01,0x1c,0x80,0x57,0x20,0x15,0xc0 }},
+ {16, 0xc7b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x18,0x48,0xc2,0x12,0x31 }},
+ {16, 0xc7c0, 0, {0x84,0x8c,0x61,0x03,0x18,0x40,0xc8,0x12,0x31,0x84,0x8c,0x61,0x03,0x18,0x48,0xc4 }},
+ {16, 0xc7d0, 0, {0x10,0x31,0x84,0x0c,0x41,0x23,0x18,0x48,0xc6,0x10,0x30,0x04,0x0c,0x61,0x23,0x18 }},
+ {16, 0xc7e0, 0, {0x48,0xc6,0x12,0x30,0x84,0x8c,0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc7f0, 0, {0x00,0x00,0x3f,0xff,0x4f,0xff,0xd3,0xff,0xf4,0xff,0xfd,0x3f,0xff,0x4f,0xff,0xd3 }},
+ {16, 0xc800, 0, {0xff,0xf4,0xff,0xfd,0x3f,0xff,0x4f,0xff,0xd3,0xff,0xf4,0xff,0xfd,0x3f,0xff,0x4f }},
+ {16, 0xc810, 0, {0xff,0xd3,0xff,0xf4,0xff,0xfd,0x3f,0xff,0x4f,0xff,0xd3,0xff,0xf4,0xff,0xbd,0x00 }},
+ {16, 0xc820, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc830, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc840, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc850, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc860, 0, {0x00,0x00,0x2c,0xdb,0x0b,0x36,0xc2,0xcd,0xb0,0xb3,0x6c,0x2c,0xdb,0x09,0x36,0xc2 }},
+ {16, 0xc870, 0, {0xcd,0xb0,0xb3,0x6c,0x2c,0xdb,0x0b,0x36,0xc2,0xcd,0xb0,0xb3,0x6c,0x2c,0xdb,0x0b }},
+ {16, 0xc880, 0, {0x36,0xc2,0xcd,0xb0,0xb3,0x6c,0x2c,0xdb,0x0b,0x36,0xc2,0xcd,0xb0,0xb3,0x2c,0x00 }},
+ {16, 0xc890, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x3c,0x4c,0xcf,0x13,0x33 }},
+ {16, 0xc8a0, 0, {0xc4,0xcc,0xf1,0x33,0x3c,0x4d,0x4e,0x93,0x33,0xc4,0xcc,0xf1,0x2b,0x3c,0x4c,0xcf }},
+ {16, 0xc8b0, 0, {0x13,0x33,0xc4,0xcc,0xe9,0x33,0x3c,0x4c,0xcf,0x12,0xb5,0xc4,0xcc,0xf1,0x33,0x3c }},
+ {16, 0xc8c0, 0, {0x4c,0xcf,0x13,0x33,0xc4,0xcd,0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc8d0, 0, {0x00,0x00,0x3b,0x7e,0x4e,0xc7,0x93,0xb7,0xe4,0xed,0xf9,0x23,0x7e,0x4e,0x47,0x93 }},
+ {16, 0xc8e0, 0, {0xb7,0xe4,0xed,0xf9,0x3f,0x7e,0x4e,0xde,0x12,0x37,0xe4,0x8d,0xf9,0x3b,0x7e,0x4e }},
+ {16, 0xc8f0, 0, {0xdf,0x93,0xf7,0x84,0x8d,0xf9,0x3b,0x7e,0x4e,0xdf,0x93,0xb1,0xe4,0xed,0xb9,0x00 }},
+ {16, 0xc900, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x70,0x40,0x9c,0x11 }},
+ {16, 0xc910, 0, {0x67,0x04,0x19,0xc3,0x02,0x70,0x40,0x9c,0x10,0x27,0x04,0x09,0xc1,0x02,0x70,0x40 }},
+ {16, 0xc920, 0, {0x1c,0x10,0x27,0x14,0x01,0xc1,0x02,0x70,0x40,0x9c,0x50,0x07,0x04,0x09,0xc1,0x02 }},
+ {16, 0xc930, 0, {0x70,0x40,0x9c,0x10,0x67,0x14,0x11,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc940, 0, {0x00,0x00,0x04,0x05,0x71,0x01,0x5c,0x40,0x57,0x10,0x15,0xc4,0x05,0x71,0x01,0x5c }},
+ {16, 0xc950, 0, {0x40,0x57,0x10,0x15,0xc6,0x05,0x71,0x01,0x5c,0x40,0x57,0x10,0x10,0xc4,0x05,0x71 }},
+ {16, 0xc960, 0, {0x01,0x5c,0x64,0x03,0x10,0x55,0xc4,0x05,0x71,0x01,0x5c,0x40,0x57,0x10,0x15,0xc0 }},
+ {16, 0xc970, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x20,0x80,0x48,0x20 }},
+ {16, 0xc980, 0, {0x12,0x08,0x04,0x82,0x01,0x21,0x80,0x48,0x20,0x12,0x08,0x04,0x80,0x01,0x20,0x80 }},
+ {16, 0xc990, 0, {0x48,0x20,0x12,0x08,0x05,0xc2,0x01,0x20,0x80,0x48,0x24,0x17,0x08,0x04,0x82,0x01 }},
+ {16, 0xc9a0, 0, {0x20,0x80,0x48,0x20,0x12,0x08,0x04,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xc9b0, 0, {0x00,0x00,0x00,0x00,0x60,0x00,0x18,0x00,0x46,0x00,0x11,0x84,0x00,0x60,0x00,0x18 }},
+ {16, 0xc9c0, 0, {0x00,0x06,0x00,0x01,0x80,0x00,0x60,0x01,0x18,0x00,0x06,0x10,0x91,0x80,0x00,0x60 }},
+ {16, 0xc9d0, 0, {0x00,0x18,0x46,0x46,0x18,0x01,0x80,0x00,0x60,0x00,0x18,0x00,0x06,0x10,0x01,0x80 }},
+ {16, 0xc9e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x04,0x73,0x01,0x1c,0x80 }},
+ {16, 0xc9f0, 0, {0x07,0x20,0x01,0xc8,0x04,0x72,0x01,0x1c,0x80,0x47,0x20,0x11,0xc8,0x04,0x72,0x01 }},
+ {16, 0xca00, 0, {0x1c,0x80,0x47,0x22,0x11,0xc8,0x04,0x72,0x01,0x1c,0x80,0x07,0x20,0x11,0xc8,0x04 }},
+ {16, 0xca10, 0, {0x72,0x01,0x1c,0x80,0x07,0x28,0x11,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xca20, 0, {0x00,0x00,0x00,0x00,0x60,0x00,0x18,0x00,0x06,0x00,0x01,0x80,0x00,0x60,0x00,0x18 }},
+ {16, 0xca30, 0, {0x00,0x06,0x00,0x01,0x80,0x00,0x60,0x00,0x18,0x00,0x06,0x00,0x01,0x80,0x00,0x60 }},
+ {16, 0xca40, 0, {0x00,0x18,0x00,0x46,0x04,0x01,0x80,0x00,0x60,0x00,0x18,0x00,0x06,0x00,0x01,0x80 }},
+ {16, 0xca50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x04,0x22,0x01,0x08,0x80 }},
+ {16, 0xca60, 0, {0x02,0x20,0x00,0x90,0x04,0x27,0x81,0x08,0x80,0x42,0x20,0x10,0x98,0x04,0x24,0x01 }},
+ {16, 0xca70, 0, {0x08,0x80,0x42,0x48,0x10,0x88,0x04,0x22,0x01,0x09,0x40,0x42,0x60,0x10,0x88,0x04 }},
+ {16, 0xca80, 0, {0x22,0x01,0x08,0xc0,0x02,0x40,0x10,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xca90, 0, {0x00,0x00,0x2a,0x04,0x4b,0x81,0x12,0xa0,0x04,0xa8,0x01,0x2a,0x04,0x4a,0x81,0x12 }},
+ {16, 0xcaa0, 0, {0xa0,0x44,0xa8,0x11,0x2a,0x04,0x48,0x80,0x12,0xa0,0x44,0x88,0x01,0x2a,0x04,0x4a }},
+ {16, 0xcab0, 0, {0x81,0x12,0x20,0x04,0xac,0x11,0x2a,0x04,0x4a,0x81,0x12,0xb0,0x44,0x9c,0x11,0x00 }},
+ {16, 0xcac0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xc0,0x0c,0x00,0x53,0x00,0x14,0xc0 }},
+ {16, 0xcad0, 0, {0x05,0x30,0x01,0x44,0x00,0x53,0x00,0x14,0xc0,0x05,0x30,0x04,0x0c,0x00,0x53,0x00 }},
+ {16, 0xcae0, 0, {0x14,0xc0,0x05,0xb0,0x01,0x4c,0x00,0x53,0x00,0x16,0xc0,0x01,0x30,0x01,0x4c,0x00 }},
+ {16, 0xcaf0, 0, {0x53,0x00,0x14,0xc0,0x01,0x38,0x00,0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcb00, 0, {0x08,0xc0,0x00,0x10,0x40,0x00,0x10,0x00,0x04,0x00,0x01,0x10,0x00,0x44,0x80,0x10 }},
+ {16, 0xcb10, 0, {0x00,0x04,0x00,0x01,0x10,0x00,0x46,0x00,0x00,0x00,0x04,0x60,0x01,0x00,0x00,0x40 }},
+ {16, 0xcb20, 0, {0x00,0x11,0x60,0x02,0x40,0x01,0x00,0x10,0x40,0x00,0x10,0x60,0x01,0x50,0x10,0x40 }},
+ {16, 0xcb30, 0, {0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xc0,0x40,0x02,0x00,0x00,0x80,0x00 }},
+ {16, 0xcb40, 0, {0x20,0x00,0x08,0x08,0x02,0x00,0x00,0x80,0x00,0x20,0x00,0x08,0x00,0x02,0x00,0x00 }},
+ {16, 0xcb50, 0, {0x80,0x00,0x20,0x00,0x08,0x00,0x02,0x00,0x00,0x80,0x00,0x00,0x00,0x08,0x00,0x02 }},
+ {16, 0xcb60, 0, {0x00,0x00,0x80,0x00,0x21,0x00,0x08,0x40,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcb70, 0, {0x08,0xc0,0x40,0x04,0x60,0x01,0x18,0x00,0x46,0x00,0x11,0x80,0x04,0x60,0x01,0x18 }},
+ {16, 0xcb80, 0, {0x00,0x46,0x00,0x11,0x80,0x04,0x60,0x01,0xc8,0x00,0x46,0x00,0x19,0x80,0x00,0x60 }},
+ {16, 0xcb90, 0, {0x00,0x18,0x00,0x66,0x00,0x11,0x80,0x04,0x60,0x01,0x18,0x00,0x06,0x00,0x11,0x80 }},
+ {16, 0xcba0, 0, {0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x01,0x00,0x02,0x60,0x00,0x98,0x00 }},
+ {16, 0xcbb0, 0, {0x26,0x00,0x09,0x81,0x02,0x60,0x01,0x98,0x00,0x26,0x00,0x09,0x80,0x06,0x62,0x00 }},
+ {16, 0xcbc0, 0, {0x48,0x00,0x26,0x20,0x01,0xc0,0x02,0x60,0x01,0x98,0x00,0x07,0x00,0x09,0x80,0x02 }},
+ {16, 0xcbd0, 0, {0x60,0x00,0x98,0x00,0x26,0x00,0x11,0x82,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcbe0, 0, {0x40,0x45,0x42,0x04,0x30,0x81,0x0c,0x20,0x43,0x08,0x10,0xc2,0x04,0x30,0x85,0x8c }},
+ {16, 0xcbf0, 0, {0x20,0x43,0x08,0x10,0xc2,0x04,0x30,0x81,0x0c,0x20,0x43,0x48,0x11,0x82,0x04,0x30 }},
+ {16, 0xcc00, 0, {0x81,0x8d,0x20,0x46,0x08,0x10,0xc2,0x04,0x30,0x81,0x0c,0x20,0x43,0x0c,0x10,0xc0 }},
+ {16, 0xcc10, 0, {0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x04,0x00,0x00,0x30,0x00,0x0c,0x00 }},
+ {16, 0xcc20, 0, {0x03,0x00,0x00,0xc0,0x00,0x10,0x00,0x0c,0x00,0x03,0x00,0x00,0xc0,0x00,0x30,0x00 }},
+ {16, 0xcc30, 0, {0x08,0x00,0x03,0x00,0x00,0x80,0x00,0x30,0x00,0x0c,0x80,0x02,0x00,0x00,0xc0,0x00 }},
+ {16, 0xcc40, 0, {0x30,0x00,0x0c,0x00,0x03,0x20,0x00,0xc0,0x10,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcc50, 0, {0x40,0x00,0x02,0x00,0x30,0x80,0x0c,0x21,0x03,0x08,0x00,0xc2,0x00,0x30,0x80,0x0c }},
+ {16, 0xcc60, 0, {0x20,0x03,0x08,0x00,0xc2,0x04,0x30,0xc1,0x0c,0x20,0x03,0x0c,0x10,0xc2,0x00,0x30 }},
+ {16, 0xcc70, 0, {0x80,0x0c,0xb0,0x43,0x08,0x00,0xc2,0x00,0x30,0x80,0x0c,0x20,0x03,0x28,0x10,0xc0 }},
+ {16, 0xcc80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x45,0x42,0x04,0x60,0x81,0x18,0x20 }},
+ {16, 0xcc90, 0, {0x46,0x08,0x11,0x82,0x04,0x60,0x80,0x18,0x20,0x46,0x08,0x11,0x82,0x00,0x60,0x81 }},
+ {16, 0xcca0, 0, {0x18,0x20,0x46,0x08,0x11,0x82,0x04,0x60,0x80,0x18,0x20,0x06,0x08,0x11,0x82,0x04 }},
+ {16, 0xccb0, 0, {0x60,0x81,0x18,0x20,0x46,0x0c,0x11,0xc0,0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xccc0, 0, {0x40,0x01,0x42,0x00,0x20,0x80,0x08,0x20,0x02,0x08,0x00,0x82,0x00,0x20,0x80,0x08 }},
+ {16, 0xccd0, 0, {0x20,0x02,0x08,0x00,0x82,0x00,0x20,0x80,0x0c,0x20,0x02,0x08,0x00,0xc2,0x00,0x20 }},
+ {16, 0xcce0, 0, {0x80,0x08,0x20,0x42,0x08,0x00,0x82,0x00,0x20,0x80,0x08,0x20,0x02,0x08,0x01,0x80 }},
+ {16, 0xccf0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x01,0x42,0x04,0x60,0x81,0x18,0x20 }},
+ {16, 0xcd00, 0, {0x46,0x08,0x11,0x82,0x04,0x60,0x80,0x18,0x20,0x46,0x08,0x11,0x82,0x00,0x60,0xc1 }},
+ {16, 0xcd10, 0, {0x0c,0x20,0x46,0x0c,0x10,0xc2,0x04,0x60,0x80,0x18,0x30,0x42,0x08,0x11,0x82,0x04 }},
+ {16, 0xcd20, 0, {0x60,0x81,0x18,0x20,0x46,0x08,0x10,0x80,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcd30, 0, {0x40,0x45,0x40,0x04,0x50,0x01,0x14,0x00,0x45,0x00,0x11,0x40,0x04,0x50,0x00,0x14 }},
+ {16, 0xcd40, 0, {0x00,0x45,0x00,0x11,0x40,0x00,0x50,0x00,0x04,0x00,0x45,0x00,0x00,0x40,0x04,0x50 }},
+ {16, 0xcd50, 0, {0x00,0x14,0x00,0x01,0x00,0x11,0x40,0x04,0x50,0x01,0x14,0x00,0x45,0x00,0x00,0x42 }},
+ {16, 0xcd60, 0, {0x01,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x06,0x00,0x41,0x80,0x10,0x60 }},
+ {16, 0xcd70, 0, {0x04,0x18,0x01,0x06,0x00,0x41,0x80,0x10,0x60,0x04,0x18,0x01,0x06,0x00,0x41,0x80 }},
+ {16, 0xcd80, 0, {0x10,0x60,0x04,0x18,0x01,0x06,0x00,0x41,0x80,0x10,0x60,0x04,0x18,0x01,0x06,0x00 }},
+ {16, 0xcd90, 0, {0x41,0x80,0x10,0x60,0x04,0x18,0x01,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcda0, 0, {0x48,0x00,0x02,0x01,0x00,0x80,0x40,0x21,0x10,0x08,0x04,0x02,0x01,0x00,0x80,0x40 }},
+ {16, 0xcdb0, 0, {0x20,0x10,0x08,0x04,0x02,0x01,0x00,0x80,0x40,0x21,0x10,0x08,0x04,0x02,0x01,0x00 }},
+ {16, 0xcdc0, 0, {0x80,0x40,0x30,0x10,0x08,0x04,0x02,0x11,0x00,0x84,0x40,0x20,0x10,0x08,0x14,0x00 }},
+ {16, 0xcdd0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x45,0x46,0x03,0x51,0x80,0xd4,0x60 }},
+ {16, 0xcde0, 0, {0x35,0x18,0x0d,0x46,0x03,0x51,0x80,0xd4,0x60,0x35,0x18,0x0d,0x46,0x03,0x51,0x80 }},
+ {16, 0xcdf0, 0, {0xd4,0x60,0x35,0x10,0x0d,0x46,0x03,0x51,0x80,0xd4,0x40,0x35,0x18,0x0d,0x46,0x03 }},
+ {16, 0xce00, 0, {0x51,0x80,0xd4,0x60,0x35,0x18,0x0d,0x40,0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xce10, 0, {0x00,0x01,0x46,0x04,0x71,0x81,0x1c,0x60,0x07,0x18,0x11,0xce,0x04,0x71,0x81,0x1c }},
+ {16, 0xce20, 0, {0x60,0x47,0x18,0x01,0xc6,0x04,0x71,0x81,0x9c,0x60,0x47,0x18,0x19,0xc6,0x04,0x71 }},
+ {16, 0xce30, 0, {0x80,0x1c,0x60,0x67,0x18,0x11,0xc6,0x04,0x71,0x81,0x1c,0x60,0x47,0x18,0x11,0xc0 }},
+ {16, 0xce40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x46,0x02,0x71,0x80,0x9c,0x60 }},
+ {16, 0xce50, 0, {0x27,0x18,0x09,0xc6,0x06,0x71,0x80,0x1c,0x60,0x27,0x18,0x09,0xc6,0x01,0x31,0x80 }},
+ {16, 0xce60, 0, {0x1c,0x60,0x07,0x18,0x09,0xc6,0x02,0x71,0x80,0x9c,0x60,0x07,0x18,0x09,0xc6,0x12 }},
+ {16, 0xce70, 0, {0x71,0x80,0x9c,0x60,0x33,0x18,0x01,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xce80, 0, {0x50,0x45,0x46,0x05,0x71,0x81,0x5c,0x60,0x57,0x18,0x15,0xc6,0x05,0x71,0x80,0x5c }},
+ {16, 0xce90, 0, {0x60,0x57,0x18,0x15,0xc6,0x01,0x31,0x81,0x0c,0x60,0x17,0x18,0x10,0xc6,0x05,0x71 }},
+ {16, 0xcea0, 0, {0x81,0x5c,0x60,0x03,0x18,0x15,0xc6,0x05,0x71,0x81,0x5c,0x60,0x53,0x18,0x18,0x82 }},
+ {16, 0xceb0, 0, {0x10,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x12,0x01,0x24,0x80,0x48,0x20 }},
+ {16, 0xcec0, 0, {0x12,0x08,0x04,0x82,0x01,0x24,0x80,0x48,0x20,0x12,0x08,0x04,0x82,0x01,0x20,0x80 }},
+ {16, 0xced0, 0, {0x58,0x20,0x52,0x0c,0x05,0x82,0x01,0x20,0x80,0x49,0x20,0x02,0x08,0x04,0x82,0x01 }},
+ {16, 0xcee0, 0, {0x20,0x80,0x49,0x20,0x12,0x48,0x04,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcef0, 0, {0x40,0x04,0x06,0x00,0x61,0x80,0x18,0x60,0x06,0x18,0x01,0x86,0x04,0x61,0x80,0x18 }},
+ {16, 0xcf00, 0, {0x60,0x06,0x18,0x01,0x86,0x00,0x61,0x81,0x48,0x60,0x06,0x18,0x14,0x86,0x00,0x61 }},
+ {16, 0xcf10, 0, {0x80,0x18,0x60,0x42,0x18,0x01,0x86,0x00,0x61,0x80,0x18,0x60,0x06,0x18,0x00,0x80 }},
+ {16, 0xcf20, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x45,0x60,0x04,0x78,0x01,0x1e,0x00 }},
+ {16, 0xcf30, 0, {0x47,0x80,0x11,0xe8,0x00,0x78,0x01,0x1e,0x00,0x47,0x80,0x11,0xe0,0x04,0x78,0x01 }},
+ {16, 0xcf40, 0, {0x1e,0x00,0x43,0x80,0x11,0xe0,0x04,0x78,0x01,0x1e,0x00,0x03,0x80,0x15,0xe0,0x04 }},
+ {16, 0xcf50, 0, {0x78,0x01,0x1e,0x00,0x47,0x80,0x11,0xc0,0x10,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcf60, 0, {0x40,0x01,0x12,0x00,0x64,0x80,0x18,0x20,0x06,0x08,0x01,0x82,0x00,0x64,0x80,0x18 }},
+ {16, 0xcf70, 0, {0x20,0x06,0x08,0x01,0x82,0x00,0x60,0x80,0x18,0x30,0x02,0x08,0x01,0x82,0x00,0x60 }},
+ {16, 0xcf80, 0, {0x80,0x19,0x30,0x42,0x08,0x00,0x82,0x00,0x60,0x80,0x19,0x20,0x06,0x48,0x01,0x80 }},
+ {16, 0xcf90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x01,0x42,0x04,0x20,0x81,0x08,0x20 }},
+ {16, 0xcfa0, 0, {0x42,0x08,0x10,0x82,0x00,0x20,0x81,0x08,0x20,0x42,0x08,0x10,0x82,0x04,0x20,0x81 }},
+ {16, 0xcfb0, 0, {0x08,0x20,0x46,0x08,0x10,0x82,0x04,0x20,0x81,0x08,0x20,0x42,0x08,0x11,0x82,0x04 }},
+ {16, 0xcfc0, 0, {0x20,0x81,0x08,0x20,0x42,0x08,0x10,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xcfd0, 0, {0x40,0x45,0x42,0x04,0x40,0x81,0x10,0x20,0x44,0x08,0x11,0x02,0x00,0x40,0x81,0x10 }},
+ {16, 0xcfe0, 0, {0x20,0x44,0x08,0x11,0x02,0x04,0x40,0x80,0x10,0x20,0x45,0x08,0x01,0x02,0x04,0x40 }},
+ {16, 0xcff0, 0, {0x81,0x10,0x21,0x00,0x0c,0x11,0x02,0x04,0x40,0x81,0x10,0x20,0x44,0x08,0x01,0x00 }},
+ {16, 0xd000, 0, {0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x03,0x00,0x50,0xc0,0x14,0x30 }},
+ {16, 0xd010, 0, {0x05,0x0c,0x01,0x43,0x00,0x50,0xc0,0x14,0x30,0x05,0x0c,0x01,0x43,0x00,0x50,0xc0 }},
+ {16, 0xd020, 0, {0x14,0x30,0x05,0x0c,0x01,0x43,0x00,0x50,0xc0,0x14,0x30,0x05,0x0c,0x01,0x43,0x00 }},
+ {16, 0xd030, 0, {0x50,0xc0,0x14,0x30,0x05,0x0c,0x01,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd040, 0, {0x40,0x00,0x08,0x00,0x42,0x04,0x10,0x80,0x04,0x20,0x01,0x09,0x00,0x42,0x01,0x10 }},
+ {16, 0xd050, 0, {0x80,0x04,0x20,0x01,0x08,0x00,0x42,0x00,0x10,0x00,0x04,0x20,0x01,0x08,0x00,0x42 }},
+ {16, 0xd060, 0, {0x00,0x10,0x00,0x04,0x00,0x01,0x08,0x00,0x42,0x00,0x10,0x80,0x04,0x20,0x11,0x00 }},
+ {16, 0xd070, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x45,0x42,0x02,0x00,0x80,0x80,0x20 }},
+ {16, 0xd080, 0, {0x20,0x08,0x08,0x02,0x02,0x00,0x80,0x00,0x20,0x20,0x08,0x08,0x02,0x00,0x00,0x80 }},
+ {16, 0xd090, 0, {0x80,0xa0,0x00,0x0a,0x08,0x02,0x02,0x00,0x80,0x80,0x34,0x62,0x28,0x08,0x02,0x02 }},
+ {16, 0xd0a0, 0, {0x00,0x80,0x80,0x30,0x20,0x0c,0x08,0x00,0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd0b0, 0, {0x40,0x01,0x40,0x04,0x60,0x01,0x18,0x00,0x46,0x00,0x11,0x80,0x04,0x60,0x03,0x18 }},
+ {16, 0xd0c0, 0, {0x00,0x46,0x00,0x11,0x80,0x06,0x60,0x01,0x98,0x00,0x46,0x00,0x11,0x80,0x04,0x60 }},
+ {16, 0xd0d0, 0, {0x01,0x18,0x00,0x66,0x00,0x11,0x80,0x04,0x60,0x01,0x18,0x00,0x46,0x00,0x11,0x80 }},
+ {16, 0xd0e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x01,0x00,0x02,0x60,0x00,0x98,0x00 }},
+ {16, 0xd0f0, 0, {0x26,0x00,0x09,0x80,0x02,0x64,0x00,0x98,0x00,0x26,0x00,0x19,0x90,0x02,0x60,0x00 }},
+ {16, 0xd100, 0, {0x1d,0x00,0x26,0x00,0x01,0xc0,0x02,0x60,0x00,0x99,0x00,0x06,0x40,0x19,0x80,0x02 }},
+ {16, 0xd110, 0, {0x60,0x00,0x98,0x00,0x66,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd120, 0, {0x40,0x45,0x60,0x04,0x38,0x01,0x0e,0x00,0x43,0x80,0x10,0xe0,0x04,0x38,0x01,0x0e }},
+ {16, 0xd130, 0, {0x00,0x43,0x80,0x10,0xe0,0x04,0x38,0x01,0x1a,0x00,0x43,0x80,0x11,0xa0,0x04,0x38 }},
+ {16, 0xd140, 0, {0x01,0x0e,0x00,0x02,0x80,0x40,0xe0,0x04,0x38,0x01,0x0e,0x00,0x43,0x80,0x18,0x80 }},
+ {16, 0xd150, 0, {0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x04,0x01,0x00,0x30,0x40,0x0c,0x10 }},
+ {16, 0xd160, 0, {0x03,0x04,0x00,0xc9,0x00,0x30,0x40,0x0c,0x10,0x03,0x04,0x00,0xc1,0x00,0x30,0x40 }},
+ {16, 0xd170, 0, {0x08,0x10,0x03,0x04,0x00,0x81,0x00,0x30,0x40,0x0c,0x78,0x02,0x14,0x00,0xc1,0x00 }},
+ {16, 0xd180, 0, {0x30,0x40,0x0c,0x10,0x03,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd190, 0, {0x40,0x00,0x05,0x00,0x31,0x40,0x0c,0x50,0x03,0x14,0x00,0xc5,0x00,0x35,0x40,0x0c }},
+ {16, 0xd1a0, 0, {0x50,0x03,0x14,0x10,0xd5,0x00,0x31,0x41,0x0d,0x50,0x03,0x14,0x10,0xc5,0x00,0x31 }},
+ {16, 0xd1b0, 0, {0x40,0x0d,0x48,0x43,0x54,0x10,0xc5,0x00,0x31,0x40,0x0c,0x40,0x43,0x10,0x00,0xc2 }},
+ {16, 0xd1c0, 0, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x45,0x43,0x04,0x60,0xc1,0x18,0x30 }},
+ {16, 0xd1d0, 0, {0x46,0x0c,0x11,0x83,0x04,0x61,0xc1,0x18,0x30,0x46,0x0c,0x01,0x87,0x04,0x60,0xc1 }},
+ {16, 0xd1e0, 0, {0x18,0x30,0x46,0x08,0x11,0x83,0x04,0x60,0xc1,0x18,0x20,0x06,0x0c,0x01,0x83,0x04 }},
+ {16, 0xd1f0, 0, {0x60,0xc1,0x18,0x30,0x46,0x0c,0x11,0x80,0x10,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd200, 0, {0x40,0x01,0x40,0x00,0x20,0x00,0x08,0x00,0x02,0x00,0x00,0x80,0x00,0x20,0x00,0x08 }},
+ {16, 0xd210, 0, {0x00,0x02,0x00,0x00,0x81,0x00,0x20,0x00,0x08,0x80,0x02,0x00,0x00,0xc0,0x00,0x20 }},
+ {16, 0xd220, 0, {0x00,0x08,0x40,0x43,0x30,0x00,0x80,0x00,0x20,0x00,0x08,0x00,0x02,0x00,0x00,0x80 }},
+ {16, 0xd230, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x01,0x48,0x44,0x62,0x11,0x18,0x84 }},
+ {16, 0xd240, 0, {0x46,0x21,0x11,0x88,0x44,0x63,0x01,0x18,0x84,0x46,0x21,0x01,0x88,0x04,0x62,0x11 }},
+ {16, 0xd250, 0, {0x18,0x04,0x46,0x21,0x10,0xc8,0x44,0x62,0x11,0x18,0x05,0x43,0x01,0x81,0x88,0x44 }},
+ {16, 0xd260, 0, {0x62,0x11,0x18,0x84,0x46,0x21,0x11,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd270, 0, {0x40,0x45,0x40,0x04,0x50,0x01,0x14,0x04,0x45,0x01,0x11,0x40,0x44,0x50,0x01,0x14 }},
+ {16, 0xd280, 0, {0x04,0x45,0x01,0x01,0x40,0x45,0x00,0x10,0x14,0x04,0x45,0x03,0x00,0x40,0x44,0x50 }},
+ {16, 0xd290, 0, {0x11,0x14,0x04,0x01,0x05,0x41,0x40,0x44,0x50,0x11,0x14,0x04,0x05,0x01,0x01,0x40 }},
+ {16, 0xd2a0, 0, {0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x08,0x20,0x42,0x08,0x10,0x82 }},
+ {16, 0xd2b0, 0, {0x04,0x20,0x81,0x08,0x00,0x42,0x00,0x10,0x82,0x04,0x20,0x81,0x08,0x00,0x42,0x08 }},
+ {16, 0xd2c0, 0, {0x10,0x82,0x05,0x20,0x81,0x08,0x20,0x42,0x08,0x10,0x8a,0x05,0x20,0x05,0x08,0x20 }},
+ {16, 0xd2d0, 0, {0x42,0x08,0x10,0x82,0x04,0x22,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd2e0, 0, {0x00,0x00,0x0a,0x01,0x02,0x80,0x40,0xa0,0x10,0x28,0x04,0x02,0x01,0x02,0x80,0x40 }},
+ {16, 0xd2f0, 0, {0xa0,0x10,0x28,0x04,0x0a,0x01,0x02,0x80,0x40,0xa0,0x00,0x29,0x04,0x0a,0x01,0x02 }},
+ {16, 0xd300, 0, {0x80,0x40,0xa4,0x00,0x28,0x04,0x0a,0x01,0x02,0x80,0x40,0xa8,0x10,0x2b,0x14,0x00 }},
+ {16, 0xd310, 0, {0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x45,0x4d,0x03,0x53,0x40,0xd4,0xd0 }},
+ {16, 0xd320, 0, {0x35,0x34,0x0d,0x4d,0x03,0x53,0x40,0xd4,0xd0,0x35,0x34,0x0d,0x4d,0x03,0x53,0x40 }},
+ {16, 0xd330, 0, {0xd4,0xd0,0x21,0x34,0x4d,0x4d,0x03,0x53,0x40,0xd4,0xd9,0x61,0x34,0x04,0x0d,0x03 }},
+ {16, 0xd340, 0, {0x53,0x40,0xc0,0xd8,0x35,0x37,0x0d,0x40,0x11,0x50,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd350, 0, {0x40,0x01,0x48,0x04,0x72,0x00,0x1c,0x80,0x47,0x20,0x11,0xc8,0x04,0x72,0x01,0x1c }},
+ {16, 0xd360, 0, {0x80,0x47,0x20,0x11,0xc8,0x04,0x72,0x00,0x9c,0x80,0x47,0x20,0x19,0xc8,0x00,0x72 }},
+ {16, 0xd370, 0, {0x01,0x1c,0x88,0x67,0x20,0x11,0xc8,0x04,0x72,0x01,0x5c,0x82,0x47,0x22,0x11,0xc0 }},
+ {16, 0xd380, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x08,0x48,0xc2,0x12,0x31 }},
+ {16, 0xd390, 0, {0x84,0x8c,0x61,0x23,0x10,0x40,0xc0,0x12,0x31,0x84,0x8c,0x61,0x03,0x10,0x48,0xc4 }},
+ {16, 0xd3a0, 0, {0x10,0x31,0x84,0x8c,0x41,0x23,0x18,0x48,0xc6,0x10,0x30,0x04,0x0c,0x41,0x23,0x18 }},
+ {16, 0xd3b0, 0, {0x48,0xc6,0x12,0x30,0x84,0x8c,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd3c0, 0, {0x00,0x00,0x3f,0xff,0x4f,0xff,0xd3,0xff,0xf4,0xff,0xfd,0x3f,0xff,0x4f,0xff,0xd3 }},
+ {16, 0xd3d0, 0, {0xff,0xf4,0xff,0xfd,0x3f,0xff,0x4f,0xff,0xd3,0xff,0xf4,0xff,0xfd,0x3f,0xff,0x4f }},
+ {16, 0xd3e0, 0, {0xff,0xd3,0xff,0xf4,0xff,0xdd,0x3f,0xff,0x4f,0xff,0xd3,0xff,0xf4,0xff,0xfd,0x00 }},
+ {16, 0xd3f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd400, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd410, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd420, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd430, 0, {0x00,0x00,0x2c,0xdb,0x0b,0x36,0xc2,0xcd,0xb0,0xb3,0x6c,0x2c,0xdb,0x0b,0x36,0xc2 }},
+ {16, 0xd440, 0, {0xcd,0xb0,0xb3,0x6c,0x2c,0xdb,0x0b,0x36,0xc2,0xcd,0xb0,0xb3,0x6c,0x2c,0xdb,0x0b }},
+ {16, 0xd450, 0, {0x36,0xc2,0xcd,0xb0,0xb3,0x4c,0x2c,0xdb,0x0b,0x36,0xc2,0xcd,0xb0,0xb3,0x6c,0x00 }},
+ {16, 0xd460, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x5c,0x4c,0xd7,0x13,0x33 }},
+ {16, 0xd470, 0, {0xc4,0xcc,0xf1,0x33,0x3a,0x4a,0xd6,0x93,0x33,0xc4,0xcc,0xf1,0x2b,0x3a,0x4c,0xcf }},
+ {16, 0xd480, 0, {0x13,0x33,0xc4,0xcc,0xe9,0x33,0x3c,0x4c,0xcf,0x12,0xb5,0xa4,0xac,0xc9,0x33,0x3c }},
+ {16, 0xd490, 0, {0x4c,0xcf,0x13,0x35,0xc4,0xcd,0x69,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd4a0, 0, {0x00,0x00,0x3b,0x7e,0x4e,0xdf,0x93,0xb7,0xe4,0xed,0xf9,0x3b,0x7e,0x4e,0xdf,0x93 }},
+ {16, 0xd4b0, 0, {0xb7,0xe4,0xed,0xf9,0x3b,0x7e,0x4e,0xde,0x12,0x37,0xe4,0xed,0xe1,0x3b,0x7e,0x4e }},
+ {16, 0xd4c0, 0, {0xdf,0x92,0x31,0x84,0x8d,0xd9,0x3b,0x7e,0x4e,0xdf,0x93,0xb1,0xe4,0xec,0x61,0x00 }},
+ {16, 0xd4d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0x04,0xa1,0x83,0x2c }},
+ {16, 0xd4e0, 0, {0x03,0x0a,0x10,0x82,0xc1,0x34,0x10,0x8f,0x00,0x40,0x09,0x14,0x02,0x03,0x14,0x91 }},
+ {16, 0xd4f0, 0, {0x00,0x08,0x42,0x0b,0x18,0x82,0xc4,0x00,0x31,0xca,0x0c,0x52,0x02,0x10,0x80,0x85 }},
+ {16, 0xd500, 0, {0x00,0x21,0x82,0x28,0x40,0x0a,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd510, 0, {0x00,0x00,0x0a,0x04,0x02,0x01,0x40,0x80,0x73,0x28,0x10,0x48,0x07,0x06,0x01,0x04 }},
+ {16, 0xd520, 0, {0xa4,0x41,0x21,0x14,0x08,0x44,0x06,0x11,0x40,0x80,0x70,0x20,0x14,0x0a,0x04,0x02 }},
+ {16, 0xd530, 0, {0x00,0xc8,0x84,0x41,0x21,0x1c,0x08,0x06,0x12,0x01,0xc0,0x80,0x60,0x20,0x14,0x00 }},
+ {16, 0xd540, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x84,0x04,0x21,0x82,0x08 }},
+ {16, 0xd550, 0, {0x53,0x02,0x10,0x80,0xc5,0x00,0x81,0x4a,0x04,0x42,0x02,0x14,0x00,0x04,0x20,0x21 }},
+ {16, 0xd560, 0, {0x80,0xa8,0x72,0x22,0x1c,0x88,0xc4,0x06,0xa1,0x42,0x8c,0x52,0x22,0x1c,0x88,0x85 }},
+ {16, 0xd570, 0, {0x26,0x21,0xc0,0x88,0x50,0x22,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd580, 0, {0x00,0x00,0x02,0x44,0x00,0x01,0x01,0x00,0x62,0x00,0x10,0x00,0x04,0x00,0x01,0x01 }},
+ {16, 0xd590, 0, {0x20,0x40,0x00,0x1c,0x00,0x44,0x04,0x01,0x02,0x20,0x62,0x00,0x1c,0x80,0x04,0x04 }},
+ {16, 0xd5a0, 0, {0x80,0x89,0x20,0x50,0x08,0x14,0x80,0x04,0x24,0x01,0xc1,0x00,0x50,0x00,0x18,0x00 }},
+ {16, 0xd5b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x80,0x38,0x20,0x04,0x0c }},
+ {16, 0xd5c0, 0, {0x31,0x0a,0x00,0x00,0x02,0x18,0x20,0x8c,0xa8,0x10,0x28,0x08,0x88,0xc1,0x14,0x10 }},
+ {16, 0xd5d0, 0, {0xc6,0x00,0x22,0x03,0x08,0x02,0x01,0x08,0xb0,0x00,0x0c,0x21,0x02,0x00,0x82,0x80 }},
+ {16, 0xd5e0, 0, {0x08,0x00,0x49,0x08,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd5f0, 0, {0x00,0x00,0x00,0x01,0x00,0x80,0x08,0x20,0x03,0x00,0x04,0x02,0x43,0x20,0x00,0x40 }},
+ {16, 0xd600, 0, {0x00,0x20,0x00,0x04,0x42,0x01,0x10,0x80,0x84,0x20,0x11,0x08,0x04,0x00,0x00,0x00 }},
+ {16, 0xd610, 0, {0x00,0x44,0x24,0x20,0x09,0x08,0x40,0x03,0x00,0x90,0xc4,0x20,0x20,0x08,0x0c,0x02 }},
+ {16, 0xd620, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x81,0x08,0x20,0x04,0x88 }},
+ {16, 0xd630, 0, {0x02,0x22,0x08,0x08,0xc3,0x2a,0x90,0x40,0x84,0x10,0x20,0x04,0x80,0xc2,0x26,0x20 }},
+ {16, 0xd640, 0, {0x49,0x88,0x22,0x22,0x0c,0x08,0xc1,0x26,0xa0,0xc9,0x8c,0x12,0x2a,0x04,0x88,0x43 }},
+ {16, 0xd650, 0, {0x0e,0xa0,0xcb,0x88,0x10,0x22,0x0c,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd660, 0, {0x08,0x00,0x0a,0x40,0x32,0x00,0x01,0x80,0x31,0x28,0x00,0x00,0x01,0x12,0x80,0x8d }},
+ {16, 0xd670, 0, {0x84,0x00,0x28,0x0c,0x08,0x01,0x32,0x00,0x8c,0x80,0x02,0x20,0x0c,0x08,0x01,0x2e }},
+ {16, 0xd680, 0, {0x00,0xc3,0x80,0x02,0x20,0x04,0x08,0x43,0x02,0x00,0x40,0x80,0x10,0x20,0x04,0x02 }},
+ {16, 0xd690, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x87,0x0a,0x21,0x04,0x88 }},
+ {16, 0xd6a0, 0, {0x11,0x2a,0x1c,0x0a,0x06,0x22,0x21,0x40,0xa0,0x42,0x2a,0x10,0x88,0x85,0x0a,0xa1 }},
+ {16, 0xd6b0, 0, {0x06,0xa4,0x62,0x22,0x1c,0x0a,0xc4,0x02,0x21,0x80,0x8c,0x52,0x22,0x14,0x48,0x86 }},
+ {16, 0xd6c0, 0, {0x22,0x20,0x08,0xa8,0x60,0x2a,0x14,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd6d0, 0, {0x00,0x00,0x08,0x45,0x06,0x01,0x89,0x80,0x63,0x20,0x1c,0x88,0x40,0x34,0x11,0x01 }},
+ {16, 0xd6e0, 0, {0xa4,0x50,0x28,0x18,0x48,0x04,0x0e,0x01,0x4b,0x80,0x73,0x28,0x1c,0x8a,0x04,0x06 }},
+ {16, 0xd6f0, 0, {0x91,0x49,0x04,0x63,0x20,0x1c,0x8a,0x06,0x26,0x01,0x85,0x80,0x70,0x20,0x18,0x02 }},
+ {16, 0xd700, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x85,0x00,0xb1,0x45,0x2c }},
+ {16, 0xd710, 0, {0x70,0x02,0x14,0xc0,0x07,0x08,0x21,0x49,0x00,0x42,0x01,0x14,0x82,0x05,0x00,0x11 }},
+ {16, 0xd720, 0, {0x84,0x00,0x52,0x02,0x1c,0x00,0xc4,0x00,0x21,0xc4,0x2c,0x53,0x02,0x1c,0x02,0x81 }},
+ {16, 0xd730, 0, {0x04,0xa1,0xcd,0x08,0x50,0x02,0x14,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd740, 0, {0x08,0x10,0x12,0x04,0x34,0x01,0xcc,0x00,0x73,0x40,0x1c,0x90,0x45,0x04,0x01,0x48 }},
+ {16, 0xd750, 0, {0x04,0x60,0x41,0x18,0xc0,0x44,0x04,0x01,0x05,0x04,0x73,0x48,0x14,0x50,0x47,0x34 }},
+ {16, 0xd760, 0, {0x01,0x45,0x20,0x62,0x08,0x1c,0xc2,0x04,0x0c,0x81,0xc7,0x00,0x73,0x80,0x18,0xc2 }},
+ {16, 0xd770, 0, {0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x10,0x84,0x10,0x21,0xcc,0x28 }},
+ {16, 0xd780, 0, {0x42,0x02,0x14,0x12,0xc5,0x10,0x21,0x84,0x04,0x40,0x00,0x1c,0x80,0x84,0x00,0x91 }},
+ {16, 0xd790, 0, {0x00,0x08,0x73,0x82,0x1c,0x90,0x05,0x0c,0x01,0xcf,0x0c,0x40,0x02,0x14,0x30,0x45 }},
+ {16, 0xd7a0, 0, {0x20,0xa1,0xc0,0x08,0x50,0x02,0x10,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd7b0, 0, {0x00,0x00,0x00,0x45,0x0c,0x81,0x00,0x00,0x01,0x08,0x08,0x00,0x05,0x18,0x91,0x05 }},
+ {16, 0xd7c0, 0, {0x04,0x00,0x01,0x04,0x40,0x06,0x18,0x00,0x02,0x24,0x70,0x40,0x04,0x00,0x40,0x00 }},
+ {16, 0xd7d0, 0, {0x01,0xc4,0x24,0x00,0x88,0x04,0x00,0x43,0x10,0x00,0x40,0x20,0x00,0x88,0x00,0x00 }},
+ {16, 0xd7e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x85,0x24,0x31,0x02,0x0c }},
+ {16, 0xd7f0, 0, {0x02,0xc2,0x04,0x10,0xc4,0x28,0x21,0x49,0x0c,0x02,0xc0,0x04,0xb2,0x06,0x1c,0x20 }},
+ {16, 0xd800, 0, {0x03,0x08,0x50,0x42,0x0c,0x80,0x01,0x04,0xa1,0x49,0x0c,0x00,0xc2,0x0c,0x10,0x43 }},
+ {16, 0xd810, 0, {0x24,0xa0,0xc1,0x08,0x10,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd820, 0, {0x00,0x10,0xa2,0x00,0x20,0x00,0xcd,0x00,0x00,0x40,0x04,0x20,0x01,0x10,0x00,0x09 }},
+ {16, 0xd830, 0, {0x04,0x02,0x49,0x0c,0x92,0x07,0x30,0x00,0x00,0x00,0x33,0x08,0x0c,0x92,0x41,0x00 }},
+ {16, 0xd840, 0, {0x80,0xcc,0x00,0x00,0x00,0x0c,0x00,0x43,0x28,0x80,0xc2,0x00,0x10,0x00,0x00,0x00 }},
+ {16, 0xd850, 0, {0x04,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x10,0x50,0x80,0x00,0x00 }},
+ {16, 0xd860, 0, {0x10,0x00,0x00,0xf0,0x00,0x10,0x80,0x00,0x00,0x00,0x80,0x00,0xd0,0x80,0x80,0x00 }},
+ {16, 0xd870, 0, {0x00,0x00,0x00,0x80,0x10,0x90,0x80,0x80,0x00,0x00,0x00,0x00,0x80,0x10,0x90,0x80 }},
+ {16, 0xd880, 0, {0x00,0x00,0x00,0x00,0x00,0xc0,0x10,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd890, 0, {0x3c,0x3c,0x10,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x10,0x90,0xa0,0x80,0x00,0x00 }},
+ {16, 0xd8a0, 0, {0x00,0x00,0x40,0x10,0x90,0x80,0xa0,0x00,0x00,0x00,0x00,0xc0,0x10,0x90,0x80,0xa0 }},
+ {16, 0xd8b0, 0, {0x00,0x00,0x00,0x20,0x80,0x10,0x90,0xa0,0xa0,0x00,0x00,0x00,0x00,0x80,0x10,0x8f }},
+ {16, 0xd8c0, 0, {0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xc2,0xe4,0x81,0x80,0x3f }},
+ {16, 0xd8d0, 0, {0xd9,0xbf,0xd9,0x98,0x71,0x9d,0x42,0x80,0x00,0x26,0x7f,0xe6,0x72,0xab,0x7c,0x3a }},
+ {16, 0xd8e0, 0, {0x40,0x00,0x19,0x80,0x26,0x48,0xdd,0x3c,0x91,0xc0,0x26,0x40,0x26,0x40,0x38,0x31 }},
+ {16, 0xd8f0, 0, {0xdb,0x61,0xc0,0x19,0x99,0xbf,0xc9,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd900, 0, {0x00,0x00,0x10,0x80,0x10,0x14,0x80,0x06,0x84,0x97,0x96,0x86,0x96,0x06,0x90,0x00 }},
+ {16, 0xd910, 0, {0x3f,0xa1,0x28,0x01,0x02,0x90,0x12,0x00,0x80,0x17,0x88,0x16,0x9e,0x90,0x90,0x04 }},
+ {16, 0xd920, 0, {0x10,0x00,0x36,0xbe,0xbe,0x9e,0x86,0x16,0x12,0x84,0x80,0x13,0xbe,0x97,0xae,0x80 }},
+ {16, 0xd930, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x82 }},
+ {16, 0xd940, 0, {0x81,0x84,0x21,0x40,0x00,0x00,0x00,0x08,0xa1,0x38,0x01,0x78,0x00,0x00,0x00,0x00 }},
+ {16, 0xd950, 0, {0x08,0xb8,0x21,0x72,0x68,0x80,0x00,0x00,0x00,0x08,0x98,0x44,0x88,0x68,0x80,0x00 }},
+ {16, 0xd960, 0, {0x00,0x00,0x08,0xb8,0x01,0x78,0x01,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd970, 0, {0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xf7,0xaf,0xff,0xc0 }},
+ {16, 0xd980, 0, {0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff }},
+ {16, 0xd990, 0, {0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xbf,0xff,0xc0,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd9a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00 }},
+ {16, 0xd9b0, 0, {0x00,0x00,0x00,0x3f,0xff,0xff,0x7f,0x40,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff }},
+ {16, 0xd9c0, 0, {0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff }},
+ {16, 0xd9d0, 0, {0x2f,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xd9e0, 0, {0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0x7f,0xc0 }},
+ {16, 0xd9f0, 0, {0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff }},
+ {16, 0xda00, 0, {0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0x7f,0x80,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xda10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00 }},
+ {16, 0xda20, 0, {0x00,0x00,0x00,0x3f,0xff,0xbf,0xbf,0xc0,0x00,0x00,0x00,0x00,0x3f,0xdf,0xbf,0xdf }},
+ {16, 0xda30, 0, {0xc0,0x00,0x00,0x00,0x00,0x3f,0xef,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x3f,0xdf }},
+ {16, 0xda40, 0, {0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xda50, 0, {0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0x3e,0xaf,0xff,0xc0 }},
+ {16, 0xda60, 0, {0x00,0x00,0x00,0x00,0x1f,0xff,0xdf,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xe7,0xfe }},
+ {16, 0xda70, 0, {0xef,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xdf,0xc0,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xda80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00 }},
+ {16, 0xda90, 0, {0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x2f,0xf7,0xff,0xff }},
+ {16, 0xdaa0, 0, {0xc0,0x00,0x00,0x00,0x00,0x2f,0xff,0xff,0xdf,0xc0,0x00,0x00,0x00,0x00,0x3f,0xf7 }},
+ {16, 0xdab0, 0, {0xdf,0xf7,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdac0, 0, {0x00,0x00,0x02,0xc4,0x00,0xb1,0xc3,0x2c,0x50,0x09,0x14,0x82,0xc4,0x30,0x91,0xc7 }},
+ {16, 0xdad0, 0, {0x24,0x60,0x08,0x1c,0x82,0x07,0x34,0x91,0x4c,0x04,0x43,0x0a,0x10,0xc2,0x84,0x04 }},
+ {16, 0xdae0, 0, {0x91,0x84,0x24,0x52,0x0b,0x18,0x02,0xc4,0x24,0xb1,0xc3,0x2c,0x40,0x0a,0x10,0x80 }},
+ {16, 0xdaf0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0x02,0x01,0xc4,0x80 }},
+ {16, 0xdb00, 0, {0x60,0x20,0x1c,0x08,0x44,0x22,0x01,0xc0,0x84,0x50,0x01,0x9c,0x08,0x07,0x0a,0x01 }},
+ {16, 0xdb10, 0, {0xc0,0x84,0x72,0x20,0x1c,0xc8,0x04,0x12,0x11,0x44,0x80,0x41,0x01,0x1c,0x80,0x07 }},
+ {16, 0xdb20, 0, {0x08,0x11,0xc4,0x00,0x70,0x00,0x10,0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdb30, 0, {0x00,0x00,0x00,0x86,0x2c,0x21,0x4a,0x0c,0x52,0x02,0x1c,0x80,0x04,0x20,0x21,0xca }},
+ {16, 0xdb40, 0, {0x10,0x62,0x02,0x1c,0x81,0x47,0x04,0x21,0xc3,0x20,0x51,0x01,0x1c,0x80,0x04,0x2c }},
+ {16, 0xdb50, 0, {0x01,0xcb,0x04,0x52,0x03,0x14,0x40,0xc7,0x20,0x31,0xc8,0x0c,0x50,0x22,0x10,0x80 }},
+ {16, 0xdb60, 0, {0x01,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x20,0x01,0x89,0x00 }},
+ {16, 0xdb70, 0, {0x52,0x00,0x14,0x80,0x04,0x28,0x01,0x45,0x04,0x62,0x00,0x10,0x80,0x46,0x30,0x11 }},
+ {16, 0xdb80, 0, {0x0d,0x00,0x42,0x01,0x14,0xc0,0x44,0x00,0x11,0x05,0x00,0x50,0x00,0x1c,0x00,0x44 }},
+ {16, 0xdb90, 0, {0x28,0x01,0x49,0x00,0x70,0x00,0x10,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdba0, 0, {0x00,0x00,0x08,0xc0,0x02,0x30,0x0c,0x8c,0x30,0x22,0x08,0x88,0xc2,0x26,0x00,0x08 }},
+ {16, 0xdbb0, 0, {0x80,0x20,0x22,0x0c,0x88,0x81,0x02,0x10,0xc4,0x80,0x10,0x22,0x0c,0x08,0x40,0x02 }},
+ {16, 0xdbc0, 0, {0x10,0x48,0x88,0x01,0x23,0x04,0xc8,0x42,0x02,0x10,0x46,0x8c,0x12,0x22,0x00,0x00 }},
+ {16, 0xdbd0, 0, {0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x02,0x00,0x00,0x80,0xc8,0x20 }},
+ {16, 0xdbe0, 0, {0x11,0x09,0x00,0x80,0x41,0x10,0x90,0x08,0x24,0x30,0x08,0x04,0x42,0x41,0x00,0x90 }},
+ {16, 0xdbf0, 0, {0xc4,0x20,0x00,0x08,0x04,0x42,0x00,0x10,0x80,0x4c,0x20,0x23,0x09,0x04,0xc2,0x43 }},
+ {16, 0xdc00, 0, {0x30,0x80,0x40,0x20,0x11,0x08,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdc10, 0, {0x08,0x00,0x08,0x81,0x02,0x20,0xc9,0x8c,0x12,0x20,0x04,0x48,0x41,0x22,0x00,0x09 }},
+ {16, 0xdc20, 0, {0x88,0x30,0x20,0x0c,0x88,0x03,0x0e,0x00,0x49,0x8c,0x10,0x22,0x0c,0x88,0x40,0x2e }},
+ {16, 0xdc30, 0, {0x00,0xc9,0x84,0x13,0x21,0x04,0xc8,0xc3,0x22,0x00,0xcb,0x8c,0x32,0x22,0x00,0x00 }},
+ {16, 0xdc40, 0, {0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x01,0x02,0x00,0x4b,0x80 }},
+ {16, 0xdc50, 0, {0x32,0x21,0x08,0x88,0x41,0x02,0x10,0x0f,0x80,0x10,0x21,0x8c,0x08,0x41,0x02,0x00 }},
+ {16, 0xdc60, 0, {0x87,0x84,0x10,0x20,0x04,0x88,0x00,0x02,0x00,0x47,0x80,0x10,0x21,0x0c,0x88,0x41 }},
+ {16, 0xdc70, 0, {0x16,0x10,0x46,0x80,0x30,0x20,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdc80, 0, {0x00,0x00,0x0a,0xc4,0x22,0xa1,0x08,0xa4,0x72,0x2a,0x14,0x0a,0x85,0x02,0x81,0x84 }},
+ {16, 0xdc90, 0, {0xa0,0x42,0x28,0x1c,0x0a,0xc5,0x02,0x91,0x40,0xb8,0x73,0x29,0x10,0xca,0xc4,0x02 }},
+ {16, 0xdca0, 0, {0xa1,0x80,0xa4,0x42,0x2a,0x14,0xca,0x85,0x22,0x91,0x80,0xa8,0x70,0x2a,0x18,0x02 }},
+ {16, 0xdcb0, 0, {0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x04,0x1e,0x01,0xc8,0x80 }},
+ {16, 0xdcc0, 0, {0x43,0x20,0x18,0x08,0x45,0x3e,0x01,0x0c,0x80,0x61,0x20,0x9c,0x48,0x06,0x12,0x81 }},
+ {16, 0xdcd0, 0, {0xc0,0x80,0x73,0x00,0x10,0x88,0x06,0x02,0x01,0xc8,0x00,0x42,0x20,0x10,0xc8,0x07 }},
+ {16, 0xdce0, 0, {0x02,0x11,0xcd,0x80,0x51,0x20,0x14,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdcf0, 0, {0x08,0x00,0x00,0xc4,0x24,0x21,0xc8,0x0c,0x42,0x01,0x14,0x00,0x00,0x28,0x10,0x4c }},
+ {16, 0xdd00, 0, {0x08,0x52,0x02,0x14,0x80,0x45,0x24,0x29,0x40,0x04,0x72,0x00,0x10,0xc0,0x05,0x24 }},
+ {16, 0xdd10, 0, {0x11,0x44,0x08,0x43,0x01,0x14,0xc0,0x47,0x24,0x20,0x48,0x08,0x72,0x02,0x10,0x00 }},
+ {16, 0xdd20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x07,0x10,0x11,0x06,0x00 }},
+ {16, 0xdd30, 0, {0x72,0x00,0x18,0xd0,0x46,0x20,0x01,0x4d,0x00,0x71,0x40,0x10,0x50,0x07,0x30,0x11 }},
+ {16, 0xdd40, 0, {0xc3,0x00,0x71,0x41,0x10,0xb0,0x05,0x2c,0x01,0x49,0x00,0x43,0x00,0x1c,0x50,0x45 }},
+ {16, 0xdd50, 0, {0x30,0x01,0x8c,0x00,0x61,0x40,0x18,0x42,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdd60, 0, {0x00,0x00,0x30,0xc5,0x00,0x21,0xc0,0x0c,0x40,0x01,0x14,0x12,0x44,0x04,0x31,0x84 }},
+ {16, 0xdd70, 0, {0x24,0x40,0x80,0x14,0xa1,0xc7,0x00,0x01,0x40,0x08,0x40,0x01,0x14,0x20,0x05,0x20 }},
+ {16, 0xdd80, 0, {0x11,0xc0,0x02,0x60,0x82,0x18,0x00,0x87,0x24,0x11,0x40,0x08,0x40,0x42,0x10,0x02 }},
+ {16, 0xdd90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x0c,0x80,0xc4,0x24 }},
+ {16, 0xdda0, 0, {0x31,0x48,0x0c,0x00,0x01,0x08,0xc1,0x41,0x00,0x00,0x49,0x00,0x42,0x03,0x08,0x10 }},
+ {16, 0xddb0, 0, {0x80,0x20,0x21,0x09,0x0c,0x02,0x02,0x18,0x80,0xc1,0x24,0x30,0x08,0x0c,0x42,0x01 }},
+ {16, 0xddc0, 0, {0x10,0x80,0x83,0x20,0x11,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xddd0, 0, {0x00,0x00,0x10,0xc1,0x04,0x20,0x48,0x0c,0x12,0x42,0x04,0x00,0x83,0x00,0x31,0x48 }},
+ {16, 0xdde0, 0, {0x00,0x02,0x41,0x04,0xa0,0x07,0x0c,0x20,0x40,0x00,0x12,0xc2,0x0c,0x80,0xc1,0x20 }},
+ {16, 0xddf0, 0, {0x20,0xc8,0x00,0x12,0xc1,0x0c,0xb0,0x41,0x20,0x00,0x49,0x08,0x02,0x42,0x00,0x00 }},
+ {16, 0xde00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x80,0x01,0x00,0x10,0x81,0x00 }},
+ {16, 0xde10, 0, {0x30,0x40,0x08,0x20,0x03,0x00,0x10,0xc1,0x20,0x02,0x00,0x04,0x80,0x40,0x30,0x90 }},
+ {16, 0xde20, 0, {0x01,0x14,0x02,0x40,0x04,0x80,0x40,0x20,0x00,0x09,0x04,0x32,0x01,0x08,0xa0,0x03 }},
+ {16, 0xde30, 0, {0x04,0x10,0x08,0x00,0x22,0x40,0x00,0x00,0x04,0x30,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xde40, 0, {0x00,0x00,0x30,0x00,0x10,0x80,0x00,0x00,0x00,0x40,0x00,0xf0,0x00,0x00,0x00,0x00 }},
+ {16, 0xde50, 0, {0x00,0x10,0x80,0x00,0xf0,0x00,0x80,0x80,0x00,0x00,0x20,0x00,0x00,0xf0,0x10,0xa0 }},
+ {16, 0xde60, 0, {0x00,0x00,0x00,0x20,0x00,0x00,0xf0,0x00,0x10,0x00,0x00,0x00,0x20,0x80,0x00,0xcc }},
+ {16, 0xde70, 0, {0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x3c,0x10,0xa0,0x80,0x00,0x00,0x00 }},
+ {16, 0xde80, 0, {0x00,0x00,0x10,0x90,0x80,0xc0,0x40,0x00,0x00,0x00,0x00,0x10,0x90,0x80,0x80,0x00 }},
+ {16, 0xde90, 0, {0x00,0x00,0x00,0x00,0x10,0x90,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x10,0x90,0x80 }},
+ {16, 0xdea0, 0, {0xe0,0x00,0x00,0x00,0x00,0x00,0x10,0x8c,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdeb0, 0, {0x00,0x00,0x09,0x4d,0xb1,0xe9,0x00,0x26,0x40,0x2a,0x7f,0xe3,0xf2,0x54,0x98,0xc0 }},
+ {16, 0xdec0, 0, {0x3f,0xe6,0x40,0x00,0x01,0x42,0x91,0xd0,0xc0,0x13,0xe5,0x87,0x63,0x83,0xb8,0xcd }},
+ {16, 0xded0, 0, {0xf9,0x00,0x26,0x7f,0x00,0x00,0x35,0x2e,0xd5,0x03,0x40,0x3f,0xd9,0xbf,0xb1,0x80 }},
+ {16, 0xdee0, 0, {0x01,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x02,0x16,0x14,0x00,0x1c }},
+ {16, 0xdef0, 0, {0xa8,0x3f,0x88,0x16,0x00,0x80,0x84,0x80,0x37,0x9e,0xba,0xa0,0x50,0x10,0x02,0x12 }},
+ {16, 0xdf00, 0, {0x00,0x17,0x96,0x97,0x26,0x50,0x10,0x10,0x82,0x80,0x1e,0x80,0xde,0xbe,0x94,0x14 }},
+ {16, 0xdf10, 0, {0x02,0x10,0x80,0x17,0xbe,0x81,0x94,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdf20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xa8,0x44,0x94,0x28,0x80,0x00,0x00,0x00,0x08 }},
+ {16, 0xdf30, 0, {0x94,0x21,0x44,0x51,0x00,0x00,0x00,0x00,0x08,0x84,0x42,0x41,0x01,0x00,0x00,0x00 }},
+ {16, 0xdf40, 0, {0x00,0x08,0xa1,0x72,0x23,0x41,0x40,0x00,0x00,0x00,0x08,0xb8,0x01,0x78,0x32,0x40 }},
+ {16, 0xdf50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00 }},
+ {16, 0xdf60, 0, {0x00,0x00,0x00,0x3f,0xf7,0xfe,0xd7,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xd7,0xdf }},
+ {16, 0xdf70, 0, {0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0x7f,0xff,0xc0,0x00,0x00,0x00,0x00,0x37,0x7f }},
+ {16, 0xdf80, 0, {0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdf90, 0, {0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x1e,0xff,0xde,0x77,0xc0 }},
+ {16, 0xdfa0, 0, {0x00,0x00,0x00,0x00,0x1f,0xef,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff }},
+ {16, 0xdfb0, 0, {0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0x7f,0xc0,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xdfc0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00 }},
+ {16, 0xdfd0, 0, {0x00,0x00,0x00,0x1f,0xcf,0xdf,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xbf }},
+ {16, 0xdfe0, 0, {0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xbf,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff }},
+ {16, 0xdff0, 0, {0xff,0xbf,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe000, 0, {0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0 }},
+ {16, 0xe010, 0, {0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x1f,0xff,0x1f }},
+ {16, 0xe020, 0, {0x7f,0xc0,0x00,0x00,0x00,0x00,0x2f,0xdf,0xff,0xcf,0xc0,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe030, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00 }},
+ {16, 0xe040, 0, {0x00,0x00,0x00,0x3f,0xbf,0xaf,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff }},
+ {16, 0xe050, 0, {0xc0,0x00,0x00,0x00,0x00,0x3e,0xde,0x7f,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff }},
+ {16, 0xe060, 0, {0xff,0xf7,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe070, 0, {0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0x7f,0xff,0xff,0xc0 }},
+ {16, 0xe080, 0, {0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xfe,0xbe }},
+ {16, 0xe090, 0, {0x7f,0xc0,0x00,0x00,0x00,0x00,0x3e,0xff,0xd7,0x7f,0xc0,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe0a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe0b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe0c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe0d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe0e0, 0, {0x30,0x00,0x20,0x01,0x02,0x00,0x00,0x00,0x30,0x00,0x43,0x8e,0x00,0x00,0x00,0x00 }},
+ {16, 0xe0f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe100, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe110, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe120, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe130, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe140, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe150, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe160, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe170, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe180, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe190, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe1a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe1b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe1c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe1d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe1e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe1f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe200, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe210, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe220, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe230, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe240, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe250, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe260, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe270, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe280, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe290, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe2a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe2b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe2c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe2d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe2e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe2f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe300, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe310, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe320, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe330, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe340, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe350, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe360, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe370, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe380, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe390, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe3a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe3b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe3c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe3d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe3e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe3f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe400, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe410, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe420, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe430, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe440, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe450, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe460, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe470, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe480, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe490, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe4a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe4b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe4c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe4d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe4e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe4f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe500, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe510, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe520, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe530, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe540, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe550, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe560, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe570, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe580, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe590, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe5a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe5b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe5c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe5d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe5e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe5f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe600, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe610, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe620, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe630, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe640, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe650, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe660, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe670, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe680, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe690, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe6a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe6b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe6c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe6d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe6e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe6f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe700, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe710, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe720, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe730, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe740, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe750, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe760, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe770, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe780, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe790, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe7a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe7b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe7c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe7d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe7e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe7f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe800, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe810, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe820, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe830, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe840, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe850, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe860, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe870, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe880, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe890, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe8a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe8b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe8c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe8d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe8e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe8f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe900, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe910, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe920, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe930, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe940, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe950, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe960, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe970, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe980, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe990, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe9a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe9b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe9c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe9d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe9e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xe9f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xea00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xea10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xea20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xea30, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xea40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xea50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xea60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xea70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xea80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xea90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeaa0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeab0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeac0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xead0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeae0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeaf0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeb00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeb10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeb20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeb30, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeb40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeb50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeb60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeb70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeb80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeb90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeba0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xebb0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xebc0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xebd0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xebe0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xebf0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xec00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xec10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xec20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xec30, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xec40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xec50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xec60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xec70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xec80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xec90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeca0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xecb0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xecc0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xecd0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xece0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xecf0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xed00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xed10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xed20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xed30, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xed40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xed50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xed60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xed70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xed80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xed90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeda0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xedb0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xedc0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xedd0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xede0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xedf0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xee00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xee10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xee20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xee30, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xee40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xee50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xee60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xee70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xee80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xee90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeea0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeeb0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeec0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeed0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeee0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeef0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xef00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xef10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xef20, 0, {0x00,0x00,0x00,0x00,0x30,0x00,0x20,0x01,0x02,0x02,0x00,0x00,0x30,0x00,0x43,0x80 }},
+ {16, 0xef30, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xef40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xef50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xef60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xef70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xef80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xef90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xefa0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xefb0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xefc0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xefd0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xefe0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xeff0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf000, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf010, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf020, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf030, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf040, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf050, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf060, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf070, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf080, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf090, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf0a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf0b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf0c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf0d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf0e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf0f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf100, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf110, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf120, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf130, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf140, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf150, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf160, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf170, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf180, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf190, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf1a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf1b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf1c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf1d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf1e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf1f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf200, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf210, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf220, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf230, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf240, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf250, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf260, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf270, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf280, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf290, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf2a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf2b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf2c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf2d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf2e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf2f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf300, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf310, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf320, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf330, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf340, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf350, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf360, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf370, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf380, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf390, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf3a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf3b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf3c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf3d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf3e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf3f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf400, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf410, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf420, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf430, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf440, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf450, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf460, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf470, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf480, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf490, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf4a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf4b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf4c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf4d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf4e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf4f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf500, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf510, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf520, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf530, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf540, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf550, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf560, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf570, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf580, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf590, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf5a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf5b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf5c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf5d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf5e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf5f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf600, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf610, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf620, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf630, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf640, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf650, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf660, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf670, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf680, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf690, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf6a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf6b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf6c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf6d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf6e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf6f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf700, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf710, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf720, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf730, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf740, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf750, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf760, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf770, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf780, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf790, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf7a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf7b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf7c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf7d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf7e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf7f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf800, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf810, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf820, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf830, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf840, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf850, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf860, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf870, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf880, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf890, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf8a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf8b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf8c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf8d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf8e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf8f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf900, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf910, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf920, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf930, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf940, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf950, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf960, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf970, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf980, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf990, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf9a0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf9b0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf9c0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf9d0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf9e0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xf9f0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfa00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfa10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfa20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfa30, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfa40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfa50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfa60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfa70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfa80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfa90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfaa0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfab0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfac0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfad0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfae0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfaf0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfb00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfb10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfb20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfb30, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfb40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfb50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfb60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfb70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfb80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfb90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfba0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfbb0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfbc0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfbd0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfbe0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfbf0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfc00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfc10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfc20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfc30, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfc40, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfc50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfc60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfc70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfc80, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfc90, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfca0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfcb0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfcc0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfcd0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfce0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfcf0, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfd00, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfd10, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfd20, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfd30, 0, {0x30,0x00,0x00,0x01,0x00,0x00,0x5f,0xa7,0x30,0x00,0x80,0x01,0x00,0x00,0x00,0x03 }},
+ {16, 0xfd40, 0, {0x30,0x00,0x40,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfd50, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfd60, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {16, 0xfd70, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x80,0x01 }},
+ {16, 0xfd80, 0, {0x00,0x00,0x00,0x05,0x30,0x00,0xa0,0x01,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x01 }},
+ {16, 0xfd90, 0, {0x00,0x00,0x6b,0x97,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }},
+ {4, 0xfda0, 0, {0x00,0x00,0x00,0x00 }},
+ {0 , 0x0000, 1, {0}}
+};
+// VERSION= 1.0.0.191
+// DATE= 2002oct28
+INTEL_HEX_RECORD g_HexSpdifFw62[] = {
+  {3,0x0000,0,{0x02,0x45,0xf9}},
+ { 3,0x0003,0,{0x02,0x0f,0xfd}},
+ { 3,0x000b,0,{0x02,0x4d,0x9b}},
+ { 3,0x0013,0,{0x02,0x17,0xfd}},
+ { 3,0x001b,0,{0x02,0x4d,0x9e}},
+ { 3,0x0023,0,{0x02,0x4d,0x75}},
+ { 3,0x002b,0,{0x02,0x46,0xf7}},
+ { 3,0x0033,0,{0x02,0x4d,0x6c}},
+ { 3,0x003b,0,{0x02,0x4d,0x7c}},
+ { 3,0x0043,0,{0x02,0x49,0x00}},
+ { 3,0x004b,0,{0x02,0x4d,0x8f}},
+ { 3,0x0053,0,{0x02,0x4d,0x83}},
+ { 3,0x005b,0,{0x02,0x4d,0x89}},
+ { 3,0x0063,0,{0x02,0x4d,0x93}},
+ {16,0x0500,0,{0x12,0x01,0x10,0x01,0x00,0x00,0x00,0x40,0x6a,0x08,0x11,0x01,0x00,0x01,0x01,0x02}},
+ {16,0x0510,0,{0x00,0x01,0x09,0x02,0xac,0x01,0x03,0x01,0x00,0x80,0x32,0x09,0x04,0x00,0x00,0x00}},
+ {16,0x0520,0,{0x01,0x01,0x00,0x00,0x0a,0x24,0x01,0x00,0x01,0x56,0x00,0x02,0x01,0x02,0x0c,0x24}},
+ {16,0x0530,0,{0x02,0x01,0x01,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x0d,0x24,0x06,0x05,0x01,0x02}},
+ {16,0x0540,0,{0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x24,0x03,0x02,0x04,0x03,0x00,0x05,0x00}},
+ {16,0x0550,0,{0x0c,0x24,0x02,0x03,0x05,0x02,0x00,0x06,0x00,0x00,0x00,0x00,0x15,0x24,0x06,0x06}},
+ {16,0x0560,0,{0x03,0x02,0x00,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00}},
+ {16,0x0570,0,{0x00,0x09,0x24,0x03,0x04,0x01,0x01,0x00,0x06,0x00,0x09,0x04,0x01,0x00,0x00,0x01}},
+ {16,0x0580,0,{0x02,0x00,0x00,0x09,0x04,0x01,0x01,0x02,0x01,0x02,0x00,0x00,0x07,0x24,0x01,0x01}},
+ {16,0x0590,0,{0x00,0x01,0x00,0x11,0x24,0x02,0x01,0x02,0x02,0x10,0x03,0x44,0xac,0x00,0x80,0xbb}},
+ {16,0x05a0,0,{0x00,0x00,0x77,0x01,0x09,0x05,0x0a,0x05,0x84,0x01,0x01,0x00,0x8f,0x07,0x25,0x01}},
+ {16,0x05b0,0,{0x01,0x00,0x00,0x00,0x09,0x05,0x8f,0x01,0x03,0x00,0x01,0x05,0x00,0x09,0x04,0x01}},
+ {16,0x05c0,0,{0x02,0x02,0x01,0x02,0x00,0x00,0x07,0x24,0x01,0x01,0x00,0x01,0x00,0x11,0x24,0x02}},
+ {16,0x05d0,0,{0x01,0x02,0x03,0x18,0x03,0x44,0xac,0x00,0x80,0xbb,0x00,0x00,0x77,0x01,0x09,0x05}},
+ {16,0x05e0,0,{0x0a,0x05,0x46,0x02,0x01,0x00,0x8f,0x07,0x25,0x01,0x01,0x00,0x00,0x00,0x09,0x05}},
+ {16,0x05f0,0,{0x8f,0x01,0x03,0x00,0x01,0x05,0x00,0x09,0x04,0x02,0x00,0x00,0x01,0x02,0x00,0x00}},
+ {16,0x0600,0,{0x09,0x04,0x02,0x01,0x01,0x01,0x02,0x00,0x00,0x07,0x24,0x01,0x04,0x00,0x01,0x00}},
+ {16,0x0610,0,{0x0e,0x24,0x02,0x01,0x06,0x02,0x10,0x02,0x44,0xac,0x00,0x80,0xbb,0x00,0x09,0x05}},
+ {16,0x0620,0,{0x8c,0x05,0x4c,0x02,0x01,0x00,0x00,0x07,0x25,0x01,0x00,0x02,0x00,0x00,0x09,0x04}},
+ {16,0x0630,0,{0x02,0x02,0x01,0x01,0x02,0x00,0x00,0x07,0x24,0x01,0x04,0x00,0x01,0x00,0x0e,0x24}},
+ {16,0x0640,0,{0x02,0x01,0x06,0x03,0x18,0x02,0x44,0xac,0x00,0x80,0xbb,0x00,0x09,0x05,0x8c,0x05}},
+ {16,0x0650,0,{0x72,0x03,0x01,0x00,0x00,0x07,0x25,0x01,0x00,0x02,0x00,0x00,0x09,0x04,0x02,0x03}},
+ {16,0x0660,0,{0x01,0x01,0x02,0x00,0x00,0x07,0x24,0x01,0x04,0x00,0x01,0x00,0x11,0x24,0x02,0x01}},
+ {16,0x0670,0,{0x02,0x02,0x10,0x03,0x44,0xac,0x00,0x80,0xbb,0x00,0x00,0x77,0x01,0x09,0x05,0x8c}},
+ {16,0x0680,0,{0x05,0x84,0x01,0x01,0x00,0x00,0x07,0x25,0x01,0x00,0x02,0x00,0x00,0x09,0x04,0x02}},
+ {16,0x0690,0,{0x04,0x01,0x01,0x02,0x00,0x00,0x07,0x24,0x01,0x04,0x00,0x01,0x00,0x11,0x24,0x02}},
+ {16,0x06a0,0,{0x01,0x02,0x03,0x18,0x03,0x44,0xac,0x00,0x80,0xbb,0x00,0x00,0x77,0x01,0x09,0x05}},
+ {16,0x06b0,0,{0x8c,0x05,0x46,0x02,0x01,0x00,0x00,0x07,0x25,0x01,0x00,0x02,0x00,0x00,0x04,0x03}},
+ {16,0x06c0,0,{0x09,0x04,0x18,0x03,0x45,0x00,0x6d,0x00,0x61,0x00,0x67,0x00,0x69,0x00,0x63,0x00}},
+ {16,0x06d0,0,{0x20,0x00,0x47,0x00,0x6d,0x00,0x62,0x00,0x48,0x00,0x22,0x03,0x45,0x00,0x6d,0x00}},
+ {16,0x06e0,0,{0x61,0x00,0x67,0x00,0x69,0x00,0x63,0x00,0x20,0x00,0x45,0x00,0x4d,0x00,0x49,0x00}},
+ {16,0x06f0,0,{0x20,0x00,0x36,0x00,0x7c,0x00,0x32,0x00,0x20,0x00,0x6d,0x00,0x2a,0x03,0x43,0x00}},
+ {16,0x0700,0,{0x6f,0x00,0x6e,0x00,0x66,0x00,0x69,0x00,0x67,0x00,0x75,0x00,0x72,0x00,0x61,0x00}},
+ {16,0x0710,0,{0x74,0x00,0x69,0x00,0x6f,0x00,0x6e,0x00,0x20,0x00,0x53,0x00,0x74,0x00,0x72,0x00}},
+ {16,0x0720,0,{0x69,0x00,0x6e,0x00,0x67,0x00,0x22,0x03,0x49,0x00,0x6e,0x00,0x74,0x00,0x65,0x00}},
+ {16,0x0730,0,{0x72,0x00,0x66,0x00,0x61,0x00,0x63,0x00,0x65,0x00,0x20,0x00,0x53,0x00,0x74,0x00}},
+ {10,0x0740,0,{0x72,0x00,0x69,0x00,0x6e,0x00,0x67,0x00,0x00,0x00}},
+ {16,0x074a,0,{0x90,0x76,0x9a,0x74,0x02,0xf0,0xe4,0x90,0x76,0x91,0xf0,0xa3,0xf0,0x90,0x76,0x90}},
+ {16,0x075a,0,{0xf0,0x90,0x76,0x93,0xf0,0x90,0x76,0x96,0x74,0x03,0xf0,0x90,0x80,0x03,0xf0,0xe4}},
+ {16,0x076a,0,{0x90,0x76,0x97,0xf0,0x90,0x80,0x02,0xf0,0x90,0x76,0x94,0x04,0xf0,0x90,0x80,0x00}},
+ {16,0x077a,0,{0xf0,0xe4,0x90,0x76,0x8e,0xf0,0x90,0x76,0x1a,0xf0,0x90,0x76,0x95,0x04,0xf0,0xc2}},
+ {16,0x078a,0,{0x2e,0x90,0x7f,0x9b,0xe0,0xff,0x54,0x10,0xff,0x70,0x02,0xc2,0x3f,0x90,0x7f,0x9b}},
+ {16,0x079a,0,{0xe0,0xff,0x54,0x10,0xfe,0xff,0xbe,0x10,0x02,0xd2,0x3f,0x90,0x7f,0x9b,0xe0,0xff}},
+ {16,0x07aa,0,{0x54,0x20,0xff,0x70,0x02,0xc2,0x3e,0x90,0x7f,0x9b,0xe0,0xff,0x54,0x20,0xfe,0xff}},
+ {16,0x07ba,0,{0xbe,0x20,0x02,0xd2,0x3e,0x30,0x3f,0x09,0x90,0x76,0x97,0xe0,0x54,0xfe,0xf0,0x80}},
+ {16,0x07ca,0,{0x07,0x90,0x76,0x97,0xe0,0x44,0x01,0xf0,0x90,0x76,0x97,0xe0,0x90,0x80,0x02,0xf0}},
+ {16,0x07da,0,{0x30,0x3e,0x09,0x90,0x76,0x95,0xe0,0x44,0x04,0xf0,0x80,0x07,0x90,0x76,0x95,0xe0}},
+ {16,0x07ea,0,{0x54,0xfb,0xf0,0x90,0x76,0x95,0xe0,0x90,0x80,0x01,0xf0,0xa2,0x3e,0x92,0x40,0xa2}},
+ { 3,0x07fa,0,{0x3f,0x92,0x41}},
+ { 1,0x07fd,0,{0x22}},
+ { 2,0x07fe,0,{0xd3,0x22}},
+ {16,0x0800,0,{0xe4,0x90,0x76,0x31,0xf0,0x90,0x76,0x31,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x0f}},
+ {16,0x0810,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xed,0xe0,0xfd,0xee,0x6d}},
+ {16,0x0820,0,{0x60,0x0e,0xef,0xc3,0x94,0x0b,0x50,0x08,0x90,0x76,0x31,0xe0,0x04,0xf0,0x80,0xd5}},
+ {16,0x0830,0,{0xef,0xb4,0x0b,0x08,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0xef,0x75,0xf0,0x03}},
+ {16,0x0840,0,{0xa4,0x24,0x0e,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x76,0x33,0xf0,0x24}},
+ {16,0x0850,0,{0xf0,0x60,0x0a,0x24,0x0e,0x60,0x02,0x81,0x87,0x12,0x4b,0x3e,0x22,0x90,0x7f,0xed}},
+ {16,0x0860,0,{0xe0,0x64,0x05,0x70,0x51,0x90,0x76,0x18,0x74,0x05,0xf0,0x90,0x76,0x37,0x74,0x01}},
+ {16,0x0870,0,{0xf0,0x90,0x76,0x39,0x74,0x03,0xf0,0x90,0x76,0x21,0xf0,0xe4,0x90,0x76,0x20,0xf0}},
+ {16,0x0880,0,{0x90,0x7f,0xea,0xe0,0xf4,0x60,0x2f,0x90,0x76,0x20,0xe0,0xff,0x75,0xf0,0x0a,0xa4}},
+ {16,0x0890,0,{0x24,0xaa,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xea,0xe0,0xfd}},
+ {16,0x08a0,0,{0xee,0x6d,0x60,0x12,0x90,0x76,0x21,0xe0,0xfe,0xef,0xc3,0x9e,0x50,0x08,0x90,0x76}},
+ {16,0x08b0,0,{0x20,0xe0,0x04,0xf0,0x80,0xd1,0x90,0x7f,0xed,0xe0,0x64,0x06,0x70,0x52,0x90,0x76}},
+ {16,0x08c0,0,{0x18,0x74,0x06,0xf0,0x90,0x76,0x37,0x74,0x04,0xf0,0x90,0x76,0x39,0x74,0x0a,0xf0}},
+ {16,0x08d0,0,{0x90,0x76,0x21,0xf0,0x90,0x76,0x20,0x74,0x03,0xf0,0x90,0x7f,0xea,0xe0,0xf4,0x60}},
+ {16,0x08e0,0,{0x2f,0x90,0x76,0x20,0xe0,0xff,0x75,0xf0,0x0a,0xa4,0x24,0xaa,0xf5,0x82,0xe4,0x34}},
+ {16,0x08f0,0,{0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xea,0xe0,0xfd,0xee,0x6d,0x60,0x12,0x90,0x76}},
+ {16,0x0900,0,{0x21,0xe0,0xfe,0xef,0xc3,0x9e,0x50,0x08,0x90,0x76,0x20,0xe0,0x04,0xf0,0x80,0xd1}},
+ {16,0x0910,0,{0x90,0x76,0x20,0xe0,0xff,0x75,0xf0,0x0a,0xa4,0x24,0xaa,0xf5,0x82,0xe4,0x34,0x75}},
+ {16,0x0920,0,{0xf5,0x83,0xe0,0x90,0x72,0x29,0xf0,0xe4,0x90,0x76,0x3b,0xf0,0x90,0x76,0x21,0xe0}},
+ {16,0x0930,0,{0xfe,0xef,0x6e,0x70,0x08,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xeb}},
+ {16,0x0940,0,{0xe0,0x14,0x60,0x13,0x14,0x70,0x02,0x21,0xe2,0x24,0x02,0x60,0x02,0x81,0x7f,0x90}},
+ {16,0x0950,0,{0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xe9,0xe0,0x14,0x70,0x7c,0x90,0x7f}},
+ {16,0x0960,0,{0xea,0xe0,0xf4,0x70,0x48,0x90,0x76,0x37,0xe0,0x90,0x76,0x20,0xf0,0x90,0x76,0x39}},
+ {16,0x0970,0,{0xe0,0xfe,0x90,0x76,0x20,0xe0,0xfd,0xc3,0x9e,0x50,0x2b,0x90,0x76,0x3b,0xe0,0xfe}},
+ {16,0x0980,0,{0x04,0xf0,0x74,0xc0,0x2e,0xf5,0x82,0xe4,0x34,0x7e,0xf5,0x83,0xe0,0xfe,0xed,0x75}},
+ {16,0x0990,0,{0xf0,0x0a,0xa4,0x24,0xab,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xee,0xf0,0x90,0x76}},
+ {16,0x09a0,0,{0x20,0xe0,0x04,0xf0,0x80,0xc7,0x90,0x76,0x3f,0x74,0x01,0xf0,0x22,0x90,0x7e,0xc0}},
+ {16,0x09b0,0,{0xe0,0xfe,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xab,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83}},
+ {16,0x09c0,0,{0xee,0xf0,0xe0,0xb4,0x01,0x08,0x90,0x76,0x3e,0x74,0x01,0xf0,0x80,0x05,0xe4,0x90}},
+ {16,0x09d0,0,{0x76,0x3e,0xf0,0x90,0x76,0x3f,0x74,0x01,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01}},
+ {16,0x09e0,0,{0xf0,0x22,0x90,0x7f,0xe9,0xe0,0x24,0xfe,0x70,0x02,0x41,0xa3,0x14,0x70,0x02,0x61}},
+ {16,0x09f0,0,{0x3f,0x14,0x70,0x02,0x61,0xdb,0x24,0x03,0x60,0x02,0x81,0x77,0x90,0x7f,0xea,0xe0}},
+ {16,0x0a00,0,{0xf4,0x70,0x6b,0x90,0x76,0x37,0xe0,0x90,0x76,0x20,0xf0,0x90,0x76,0x39,0xe0,0xff}},
+ {16,0x0a10,0,{0x90,0x76,0x20,0xe0,0xfe,0xc3,0x9f,0x50,0x4e,0x90,0x76,0x3b,0xe0,0xff,0x04,0xf0}},
+ {16,0x0a20,0,{0x74,0xc0,0x2f,0xf5,0x82,0xe4,0x34,0x7e,0xf5,0x83,0xe0,0xff,0xee,0x75,0xf0,0x0a}},
+ {16,0x0a30,0,{0xa4,0x24,0xac,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x90,0x76,0x3b,0xe0}},
+ {16,0x0a40,0,{0xff,0x04,0xf0,0x74,0xc0,0x2f,0xf5,0x82,0xe4,0x34,0x7e,0xf5,0x83,0xe0,0xff,0xee}},
+ {16,0x0a50,0,{0x75,0xf0,0x0a,0xa4,0x24,0xad,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x90}},
+ {16,0x0a60,0,{0x76,0x20,0xe0,0x04,0xf0,0x80,0xa4,0x90,0x76,0x40,0x74,0x01,0xf0,0x22,0x90,0x7e}},
+ {16,0x0a70,0,{0xc0,0xe0,0xff,0x90,0x76,0x20,0xe0,0xfe,0x75,0xf0,0x0a,0xa4,0x24,0xac,0xf5,0x82}},
+ {16,0x0a80,0,{0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x90,0x7e,0xc1,0xe0,0xff,0xee,0x75,0xf0,0x0a}},
+ {16,0x0a90,0,{0xa4,0x24,0xad,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x90,0x76,0x41,0x74}},
+ {16,0x0aa0,0,{0x01,0xf0,0x22,0x90,0x7f,0xea,0xe0,0xf4,0x70,0x66,0x90,0x76,0x37,0xe0,0x90,0x76}},
+ {16,0x0ab0,0,{0x20,0xf0,0x90,0x76,0x39,0xe0,0xff,0x90,0x76,0x20,0xe0,0xfe,0xc3,0x9f,0x40,0x02}},
+ {16,0x0ac0,0,{0x81,0x8e,0x90,0x76,0x3b,0xe0,0xff,0x04,0xf0,0x74,0xc0,0x2f,0xf5,0x82,0xe4,0x34}},
+ {16,0x0ad0,0,{0x7e,0xf5,0x83,0xe0,0xff,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xae,0xf5,0x82,0xe4,0x34}},
+ {16,0x0ae0,0,{0x75,0xf5,0x83,0xef,0xf0,0x90,0x76,0x3b,0xe0,0xff,0x04,0xf0,0x74,0xc0,0x2f,0xf5}},
+ {16,0x0af0,0,{0x82,0xe4,0x34,0x7e,0xf5,0x83,0xe0,0xff,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xaf,0xf5}},
+ {16,0x0b00,0,{0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x90,0x76,0x20,0xe0,0x04,0xf0,0x80,0xa2}},
+ {16,0x0b10,0,{0x90,0x7e,0xc0,0xe0,0xff,0x90,0x76,0x20,0xe0,0xfe,0x75,0xf0,0x0a,0xa4,0x24,0xae}},
+ {16,0x0b20,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x90,0x7e,0xc1,0xe0,0xff,0xee,0x75}},
+ {16,0x0b30,0,{0xf0,0x0a,0xa4,0x24,0xaf,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x22,0x90}},
+ {16,0x0b40,0,{0x7f,0xea,0xe0,0xf4,0x70,0x66,0x90,0x76,0x37,0xe0,0x90,0x76,0x20,0xf0,0x90,0x76}},
+ {16,0x0b50,0,{0x39,0xe0,0xff,0x90,0x76,0x20,0xe0,0xfe,0xc3,0x9f,0x40,0x02,0x81,0x8e,0x90,0x76}},
+ {16,0x0b60,0,{0x3b,0xe0,0xff,0x04,0xf0,0x74,0xc0,0x2f,0xf5,0x82,0xe4,0x34,0x7e,0xf5,0x83,0xe0}},
+ {16,0x0b70,0,{0xff,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xb0,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef}},
+ {16,0x0b80,0,{0xf0,0x90,0x76,0x3b,0xe0,0xff,0x04,0xf0,0x74,0xc0,0x2f,0xf5,0x82,0xe4,0x34,0x7e}},
+ {16,0x0b90,0,{0xf5,0x83,0xe0,0xff,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xb1,0xf5,0x82,0xe4,0x34,0x75}},
+ {16,0x0ba0,0,{0xf5,0x83,0xef,0xf0,0x90,0x76,0x20,0xe0,0x04,0xf0,0x80,0xa2,0x90,0x7e,0xc0,0xe0}},
+ {16,0x0bb0,0,{0xff,0x90,0x76,0x20,0xe0,0xfe,0x75,0xf0,0x0a,0xa4,0x24,0xb0,0xf5,0x82,0xe4,0x34}},
+ {16,0x0bc0,0,{0x75,0xf5,0x83,0xef,0xf0,0x90,0x7e,0xc1,0xe0,0xff,0xee,0x75,0xf0,0x0a,0xa4,0x24}},
+ {16,0x0bd0,0,{0xb1,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x22,0x90,0x7f,0xea,0xe0,0xf4}},
+ {16,0x0be0,0,{0x70,0x66,0x90,0x76,0x37,0xe0,0x90,0x76,0x20,0xf0,0x90,0x76,0x39,0xe0,0xff,0x90}},
+ {16,0x0bf0,0,{0x76,0x20,0xe0,0xfe,0xc3,0x9f,0x40,0x02,0x81,0x8e,0x90,0x76,0x3b,0xe0,0xff,0x04}},
+ {16,0x0c00,0,{0xf0,0x74,0xc0,0x2f,0xf5,0x82,0xe4,0x34,0x7e,0xf5,0x83,0xe0,0xff,0xee,0x75,0xf0}},
+ {16,0x0c10,0,{0x0a,0xa4,0x24,0xb2,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x90,0x76,0x3b}},
+ {16,0x0c20,0,{0xe0,0xff,0x04,0xf0,0x74,0xc0,0x2f,0xf5,0x82,0xe4,0x34,0x7e,0xf5,0x83,0xe0,0xff}},
+ {16,0x0c30,0,{0xee,0x75,0xf0,0x0a,0xa4,0x24,0xb3,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0}},
+ {16,0x0c40,0,{0x90,0x76,0x20,0xe0,0x04,0xf0,0x80,0xa2,0x90,0x7e,0xc0,0xe0,0xff,0x90,0x76,0x20}},
+ {16,0x0c50,0,{0xe0,0xfe,0x75,0xf0,0x0a,0xa4,0x24,0xb2,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef}},
+ {16,0x0c60,0,{0xf0,0x90,0x7e,0xc1,0xe0,0xff,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xb3,0xf5,0x82,0xe4}},
+ {16,0x0c70,0,{0x34,0x75,0xf5,0x83,0xef,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90}},
+ {15,0x0c80,0,{0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22}},
+ {16,0x0c8f,0,{0x41,0x76,0x68,0x01,0x41,0x76,0x6a,0x02,0x41,0x76,0x6b,0x0a,0xc1,0x20,0xc1,0x21}},
+ { 2,0x0c9f,0,{0xc1,0x2f}},
+ { 4,0x0ca1,0,{0x41,0x76,0x23,0x00}},
+ {16,0x0ca5,0,{0x41,0x72,0x01,0x01,0x45,0x72,0x05,0x00,0x02,0xc9,0x00,0x00,0x45,0x72,0x0a,0x00}},
+ {16,0x0cb5,0,{0x01,0x02,0x03,0x04,0x4d,0x72,0x0f,0xd1,0x00,0xd1,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x0cc5,0,{0x28,0x28,0x09,0x00,0x4d,0x72,0x1c,0x01,0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07}},
+ {16,0x0cd5,0,{0x08,0x09,0x0a,0x0b,0x41,0x72,0x2e,0x22,0x41,0x72,0x2f,0x23,0x41,0x72,0x30,0x20}},
+ {16,0x0ce5,0,{0x41,0x72,0x31,0x21,0x62,0xd2,0x72,0x3a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x0cf5,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x0d05,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x0d15,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x0d25,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x0d35,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x0d45,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x0d55,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x0d65,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x0d75,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01}},
+ {16,0x0d85,0,{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01}},
+ {16,0x0d95,0,{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01}},
+ {16,0x0da5,0,{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01}},
+ {16,0x0db5,0,{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02}},
+ {16,0x0dc5,0,{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02}},
+ {16,0x0dd5,0,{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02}},
+ {16,0x0de5,0,{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02}},
+ {16,0x0df5,0,{0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03}},
+ {16,0x0e05,0,{0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03}},
+ {16,0x0e15,0,{0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03}},
+ {16,0x0e25,0,{0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03}},
+ {16,0x0e35,0,{0x03,0x03,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04}},
+ {16,0x0e45,0,{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04}},
+ {16,0x0e55,0,{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04}},
+ {16,0x0e65,0,{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04}},
+ {16,0x0e75,0,{0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05}},
+ {16,0x0e85,0,{0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05}},
+ {16,0x0e95,0,{0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05}},
+ {16,0x0ea5,0,{0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x06,0x06}},
+ {16,0x0eb5,0,{0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06}},
+ {16,0x0ec5,0,{0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06}},
+ {16,0x0ed5,0,{0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06}},
+ {16,0x0ee5,0,{0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x07,0x07,0x07,0x08,0x08}},
+ {16,0x0ef5,0,{0x08,0x09,0x09,0x09,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0c,0x0c,0x0c,0x0d,0x0d,0x0d}},
+ {16,0x0f05,0,{0x0e,0x0e,0x0e,0x0f,0x0f,0x0f,0x10,0x10,0x10,0x11,0x11,0x11,0x12,0x12,0x12,0x13}},
+ {16,0x0f15,0,{0x13,0x13,0x14,0x14,0x14,0x15,0x15,0x15,0x16,0x16,0x16,0x17,0x17,0x17,0x18,0x18}},
+ {16,0x0f25,0,{0x18,0x19,0x19,0x19,0x19,0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b,0x1c,0x1c,0x1c}},
+ {16,0x0f35,0,{0x1c,0x1d,0x1d,0x1d,0x1d,0x1e,0x1e,0x1e,0x1e,0x1f,0x1f,0x1f,0x1f,0x20,0x20,0x20}},
+ {16,0x0f45,0,{0x21,0x21,0x21,0x22,0x22,0x22,0x23,0x23,0x24,0x24,0x25,0x25,0x26,0x26,0x27,0x27}},
+ {16,0x0f55,0,{0x28,0x28,0x29,0x29,0x2a,0x2a,0x2b,0x2b,0x2c,0x2c,0x2d,0x2d,0x2e,0x2e,0x2f,0x2f}},
+ {16,0x0f65,0,{0x30,0x30,0x31,0x31,0x32,0x32,0x33,0x33,0x34,0x34,0x35,0x35,0x36,0x36,0x37,0x37}},
+ {16,0x0f75,0,{0x38,0x38,0x39,0x39,0x3a,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,0x40,0x41,0x42,0x43,0x44}},
+ {16,0x0f85,0,{0x45,0x46,0x47,0x48,0x49,0x49,0x4a,0x4b,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52}},
+ {16,0x0f95,0,{0x53,0x54,0x55,0x55,0x56,0x56,0x57,0x57,0x58,0x5a,0x5b,0x5d,0x5e,0x5f,0x61,0x62}},
+ {16,0x0fa5,0,{0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6f,0x71,0x72,0x73,0x74}},
+ {16,0x0fb5,0,{0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7e,0x80,0x01,0x37,0x01,0x01,0x38,0x00}},
+ { 1,0x0fc5,0,{0x00}},
+ {16,0x0fc6,0,{0xe4,0xff,0x74,0x46,0x2f,0xf5,0x82,0xe4,0x34,0x76,0xf5,0x83,0xe0,0xfe,0x74,0x20}},
+ {16,0x0fd6,0,{0x2f,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xee,0xf0,0x74,0x4e,0x2f,0xf5,0x82,0xe4}},
+ {16,0x0fe6,0,{0x34,0x76,0xf5,0x83,0xe0,0xfe,0x74,0x30,0x2f,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83}},
+ { 6,0x0ff6,0,{0xee,0xf0,0x0f,0xbf,0x08,0xcc}},
+ { 1,0x0ffc,0,{0x22}},
+ { 3,0x0ffd,0,{0xc2,0x89,0x32}},
+ {16,0x1000,0,{0xe4,0x90,0x76,0x2c,0xf0,0x90,0x76,0x2c,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x0f}},
+ {16,0x1010,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xed,0xe0,0xfd,0xee,0x6d}},
+ {16,0x1020,0,{0x60,0x0e,0xef,0xc3,0x94,0x0b,0x50,0x08,0x90,0x76,0x2c,0xe0,0x04,0xf0,0x80,0xd5}},
+ {16,0x1030,0,{0xef,0xb4,0x0b,0x08,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0xef,0x75,0xf0,0x03}},
+ {16,0x1040,0,{0xa4,0x24,0x0e,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x76,0x2e,0xf0,0x24}},
+ {16,0x1050,0,{0xf0,0x60,0x0a,0x24,0x0f,0x60,0x02,0x81,0x7d,0x12,0x4b,0x1b,0x22,0x90,0x7f,0xed}},
+ {16,0x1060,0,{0xe0,0x64,0x05,0x70,0x51,0x90,0x76,0x18,0x74,0x05,0xf0,0x90,0x76,0x38,0x74,0x01}},
+ {16,0x1070,0,{0xf0,0x90,0x76,0x3a,0x74,0x03,0xf0,0x90,0x76,0x1c,0xf0,0xe4,0x90,0x76,0x1b,0xf0}},
+ {16,0x1080,0,{0x90,0x7f,0xea,0xe0,0xf4,0x60,0x2f,0x90,0x76,0x1b,0xe0,0xff,0x75,0xf0,0x0a,0xa4}},
+ {16,0x1090,0,{0x24,0xaa,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xea,0xe0,0xfd}},
+ {16,0x10a0,0,{0xee,0x6d,0x60,0x12,0x90,0x76,0x1c,0xe0,0xfe,0xef,0xc3,0x9e,0x50,0x08,0x90,0x76}},
+ {16,0x10b0,0,{0x1b,0xe0,0x04,0xf0,0x80,0xd1,0x90,0x7f,0xed,0xe0,0x64,0x06,0x70,0x52,0x90,0x76}},
+ {16,0x10c0,0,{0x18,0x74,0x06,0xf0,0x90,0x76,0x38,0x74,0x04,0xf0,0x90,0x76,0x3a,0x74,0x0a,0xf0}},
+ {16,0x10d0,0,{0x90,0x76,0x1c,0xf0,0x90,0x76,0x1b,0x74,0x03,0xf0,0x90,0x7f,0xea,0xe0,0xf4,0x60}},
+ {16,0x10e0,0,{0x2f,0x90,0x76,0x1b,0xe0,0xff,0x75,0xf0,0x0a,0xa4,0x24,0xaa,0xf5,0x82,0xe4,0x34}},
+ {16,0x10f0,0,{0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xea,0xe0,0xfd,0xee,0x6d,0x60,0x12,0x90,0x76}},
+ {16,0x1100,0,{0x1c,0xe0,0xfe,0xef,0xc3,0x9e,0x50,0x08,0x90,0x76,0x1b,0xe0,0x04,0xf0,0x80,0xd1}},
+ {16,0x1110,0,{0xe4,0x90,0x76,0x1e,0xf0,0x90,0x76,0x1c,0xe0,0xff,0x90,0x76,0x1b,0xe0,0xfe,0x6f}},
+ {16,0x1120,0,{0x70,0x08,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xeb,0xe0,0x14,0x60}},
+ {16,0x1130,0,{0x13,0x14,0x70,0x02,0x21,0xbf,0x24,0x02,0x60,0x02,0x81,0x75,0x90,0x7f,0xb4,0xe0}},
+ {16,0x1140,0,{0x44,0x01,0xf0,0x22,0x90,0x7f,0xe9,0xe0,0x24,0x7f,0x70,0x6b,0x90,0x7f,0xea,0xe0}},
+ {16,0x1150,0,{0xf4,0x70,0x4a,0x90,0x76,0x38,0xe0,0x90,0x76,0x1b,0xf0,0x90,0x76,0x3a,0xe0,0xff}},
+ {16,0x1160,0,{0x90,0x76,0x1b,0xe0,0xfd,0xc3,0x9f,0x50,0x2b,0xed,0x75,0xf0,0x0a,0xa4,0x24,0xab}},
+ {16,0x1170,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xff,0x90,0x76,0x1e,0xe0,0xfd,0x04,0xf0}},
+ {16,0x1180,0,{0x74,0x00,0x2d,0xf5,0x82,0xe4,0x34,0x7f,0xf5,0x83,0xef,0xf0,0x90,0x76,0x1b,0xe0}},
+ {16,0x1190,0,{0x04,0xf0,0x80,0xc7,0x90,0x76,0x1e,0xe0,0x90,0x7f,0xb5,0xf0,0x22,0xee,0x75,0xf0}},
+ {16,0x11a0,0,{0x0a,0xa4,0x24,0xab,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x7f,0x00,0xf0}},
+ {16,0x11b0,0,{0x90,0x7f,0xb5,0x74,0x01,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90}},
+ {16,0x11c0,0,{0x7f,0xe9,0xe0,0x24,0x7e,0x70,0x02,0x41,0x7e,0x14,0x70,0x02,0x61,0x23,0x14,0x70}},
+ {16,0x11d0,0,{0x02,0x61,0xc8,0x24,0x03,0x60,0x02,0x81,0x6d,0x90,0x7f,0xea,0xe0,0xf4,0x70,0x6d}},
+ {16,0x11e0,0,{0x90,0x76,0x38,0xe0,0x90,0x76,0x1b,0xf0,0x90,0x76,0x3a,0xe0,0xff,0x90,0x76,0x1b}},
+ {16,0x11f0,0,{0xe0,0xc3,0x9f,0x50,0x4f,0xe0,0xff,0x75,0xf0,0x0a,0xa4,0x24,0xac,0xf5,0x82,0xe4}},
+ {16,0x1200,0,{0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x76,0x1e,0xe0,0xfd,0x04,0xf0,0x74,0x00,0x2d}},
+ {16,0x1210,0,{0xf5,0x82,0xe4,0x34,0x7f,0xf5,0x83,0xee,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xad}},
+ {16,0x1220,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xff,0x90,0x76,0x1e,0xe0,0xfe,0x04,0xf0}},
+ {16,0x1230,0,{0x74,0x00,0x2e,0xf5,0x82,0xe4,0x34,0x7f,0xf5,0x83,0xef,0xf0,0x90,0x76,0x1b,0xe0}},
+ {16,0x1240,0,{0x04,0xf0,0x80,0xa4,0x90,0x76,0x1e,0xe0,0x90,0x7f,0xb5,0xf0,0x22,0x90,0x76,0x1b}},
+ {16,0x1250,0,{0xe0,0xff,0x75,0xf0,0x0a,0xa4,0x24,0xac,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0}},
+ {16,0x1260,0,{0x90,0x7f,0x00,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xad,0xf5,0x82,0xe4,0x34,0x75}},
+ {16,0x1270,0,{0xf5,0x83,0xe0,0x90,0x7f,0x01,0xf0,0x90,0x7f,0xb5,0x74,0x02,0xf0,0x22,0x90,0x7f}},
+ {16,0x1280,0,{0xea,0xe0,0xf4,0x70,0x6d,0x90,0x76,0x38,0xe0,0x90,0x76,0x1b,0xf0,0x90,0x76,0x3a}},
+ {16,0x1290,0,{0xe0,0xff,0x90,0x76,0x1b,0xe0,0xc3,0x9f,0x50,0x4f,0xe0,0xff,0x75,0xf0,0x0a,0xa4}},
+ {16,0x12a0,0,{0x24,0xae,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x76,0x1e,0xe0,0xfd}},
+ {16,0x12b0,0,{0x04,0xf0,0x74,0x00,0x2d,0xf5,0x82,0xe4,0x34,0x7f,0xf5,0x83,0xee,0xf0,0xef,0x75}},
+ {16,0x12c0,0,{0xf0,0x0a,0xa4,0x24,0xaf,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xff,0x90,0x76}},
+ {16,0x12d0,0,{0x1e,0xe0,0xfe,0x04,0xf0,0x74,0x00,0x2e,0xf5,0x82,0xe4,0x34,0x7f,0xf5,0x83,0xef}},
+ {16,0x12e0,0,{0xf0,0x90,0x76,0x1b,0xe0,0x04,0xf0,0x80,0xa4,0x90,0x76,0x1e,0xe0,0x90,0x7f,0xb5}},
+ {16,0x12f0,0,{0xf0,0x22,0x90,0x76,0x1b,0xe0,0xff,0x75,0xf0,0x0a,0xa4,0x24,0xae,0xf5,0x82,0xe4}},
+ {16,0x1300,0,{0x34,0x75,0xf5,0x83,0xe0,0x90,0x7f,0x00,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xaf}},
+ {16,0x1310,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x7f,0x01,0xf0,0x90,0x7f,0xb5,0x74}},
+ {16,0x1320,0,{0x02,0xf0,0x22,0x90,0x7f,0xea,0xe0,0xf4,0x70,0x6d,0x90,0x76,0x38,0xe0,0x90,0x76}},
+ {16,0x1330,0,{0x1b,0xf0,0x90,0x76,0x3a,0xe0,0xff,0x90,0x76,0x1b,0xe0,0xc3,0x9f,0x50,0x4f,0xe0}},
+ {16,0x1340,0,{0xff,0x75,0xf0,0x0a,0xa4,0x24,0xb0,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe}},
+ {16,0x1350,0,{0x90,0x76,0x1e,0xe0,0xfd,0x04,0xf0,0x74,0x00,0x2d,0xf5,0x82,0xe4,0x34,0x7f,0xf5}},
+ {16,0x1360,0,{0x83,0xee,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xb1,0xf5,0x82,0xe4,0x34,0x75,0xf5}},
+ {16,0x1370,0,{0x83,0xe0,0xff,0x90,0x76,0x1e,0xe0,0xfe,0x04,0xf0,0x74,0x00,0x2e,0xf5,0x82,0xe4}},
+ {16,0x1380,0,{0x34,0x7f,0xf5,0x83,0xef,0xf0,0x90,0x76,0x1b,0xe0,0x04,0xf0,0x80,0xa4,0x90,0x76}},
+ {16,0x1390,0,{0x1e,0xe0,0x90,0x7f,0xb5,0xf0,0x22,0x90,0x76,0x1b,0xe0,0xff,0x75,0xf0,0x0a,0xa4}},
+ {16,0x13a0,0,{0x24,0xb0,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x7f,0x00,0xf0,0xef,0x75}},
+ {16,0x13b0,0,{0xf0,0x0a,0xa4,0x24,0xb1,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x7f,0x01}},
+ {16,0x13c0,0,{0xf0,0x90,0x7f,0xb5,0x74,0x02,0xf0,0x22,0x90,0x7f,0xea,0xe0,0xf4,0x70,0x6d,0x90}},
+ {16,0x13d0,0,{0x76,0x38,0xe0,0x90,0x76,0x1b,0xf0,0x90,0x76,0x3a,0xe0,0xff,0x90,0x76,0x1b,0xe0}},
+ {16,0x13e0,0,{0xc3,0x9f,0x50,0x4f,0xe0,0xff,0x75,0xf0,0x0a,0xa4,0x24,0xb2,0xf5,0x82,0xe4,0x34}},
+ {16,0x13f0,0,{0x75,0xf5,0x83,0xe0,0xfe,0x90,0x76,0x1e,0xe0,0xfd,0x04,0xf0,0x74,0x00,0x2d,0xf5}},
+ {16,0x1400,0,{0x82,0xe4,0x34,0x7f,0xf5,0x83,0xee,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xb3,0xf5}},
+ {16,0x1410,0,{0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xff,0x90,0x76,0x1e,0xe0,0xfe,0x04,0xf0,0x74}},
+ {16,0x1420,0,{0x00,0x2e,0xf5,0x82,0xe4,0x34,0x7f,0xf5,0x83,0xef,0xf0,0x90,0x76,0x1b,0xe0,0x04}},
+ {16,0x1430,0,{0xf0,0x80,0xa4,0x90,0x76,0x1e,0xe0,0x90,0x7f,0xb5,0xf0,0x22,0x90,0x76,0x1b,0xe0}},
+ {16,0x1440,0,{0xff,0x75,0xf0,0x0a,0xa4,0x24,0xb2,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90}},
+ {16,0x1450,0,{0x7f,0x00,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xb3,0xf5,0x82,0xe4,0x34,0x75,0xf5}},
+ {16,0x1460,0,{0x83,0xe0,0x90,0x7f,0x01,0xf0,0x90,0x7f,0xb5,0x74,0x02,0xf0,0x22,0x90,0x7f,0xb4}},
+ {16,0x1470,0,{0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xb4}},
+ { 5,0x1480,0,{0xe0,0x44,0x01,0xf0,0x22}},
+ {16,0x1485,0,{0x74,0x00,0xf5,0x86,0x90,0xfd,0xa5,0x7c,0x05,0xa3,0xe5,0x82,0x45,0x83,0x70,0xf9}},
+ { 1,0x1495,0,{0x22}},
+ {16,0x1496,0,{0x90,0x7f,0xd6,0xe0,0x44,0x80,0xf0,0x43,0x87,0x01,0x00,0x00,0x00,0x00,0x00,0x22}},
+ {16,0x14a6,0,{0xc0,0xd0,0xc0,0xe0,0x8f,0xe0,0xc0,0xe0,0x8e,0xe0,0xc0,0xe0,0x8d,0xe0,0xc0,0xe0}},
+ {16,0x14b6,0,{0x8c,0xe0,0xc0,0xe0,0xc0,0x82,0xc0,0x83,0x05,0x86,0xc0,0x84,0xc0,0x85,0x7d,0x00}},
+ {16,0x14c6,0,{0x90,0x7f,0xe3,0x74,0x7b,0xf0,0xa3,0x74,0x80,0xf0,0x7c,0x11,0x90,0x7f,0x99,0xe0}},
+ {16,0x14d6,0,{0x54,0x40,0xdc,0x03,0x02,0x14,0xf3,0xb4,0x00,0x13,0x90,0x7f,0xe2,0x74,0x40,0xf0}},
+ {16,0x14e6,0,{0x90,0x7f,0xe5,0xf0,0x90,0x7f,0xe2,0x74,0x00,0xf0,0x02,0x14,0xd2,0x90,0x76,0x90}},
+ {16,0x14f6,0,{0xe0,0xb4,0x01,0x12,0x90,0x76,0x8f,0xe0,0x2d,0xfd,0x90,0x7f,0xe2,0x74,0x80,0xf0}},
+ {16,0x1506,0,{0x90,0x7f,0x6c,0x02,0x15,0x57,0xb4,0x02,0x12,0x90,0x76,0x8f,0xe0,0x2d,0xfd,0x90}},
+ {16,0x1516,0,{0x7f,0xe2,0x74,0x80,0xf0,0x90,0x7f,0x6c,0x02,0x15,0x96,0xb4,0x03,0x12,0x90,0x76}},
+ {16,0x1526,0,{0x8f,0xe0,0x2d,0xfd,0x90,0x7f,0xe2,0x74,0x80,0xf0,0x90,0x7f,0x6c,0x02,0x15,0xe1}},
+ {16,0x1536,0,{0xb4,0x04,0x12,0x90,0x76,0x8f,0xe0,0x2d,0xfd,0x90,0x7f,0xe2,0x74,0x80,0xf0,0x90}},
+ {16,0x1546,0,{0x7f,0x6c,0x02,0x16,0x10,0x90,0x7f,0xe2,0x74,0x80,0xf0,0x90,0x7f,0x6c,0x02,0x16}},
+ {16,0x1556,0,{0x40,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xdd,0xf2,0x7d}},
+ {16,0x1566,0,{0x02,0x05,0x86,0x90,0x7f,0xe2,0x74,0x00,0xf0,0x90,0x7f,0x9b,0xe0,0x54,0x04,0xb4}},
+ {16,0x1576,0,{0x00,0x05,0x05,0x86,0x02,0x16,0x40,0x90,0x7f,0xe2,0x74,0x80,0xf0,0x05,0x86,0xf0}},
+ {16,0x1586,0,{0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xdd,0xd4,0x02,0x16,0x40}},
+ {16,0x1596,0,{0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0}},
+ {16,0x15a6,0,{0xf0,0xf0,0xdd,0xec,0x7d,0x02,0x05,0x86,0x90,0x7f,0xe2,0x74,0x00,0xf0,0x90,0x7f}},
+ {16,0x15b6,0,{0x9b,0xe0,0x54,0x04,0xb4,0x00,0x05,0x05,0x86,0x02,0x16,0x40,0x90,0x7f,0xe2,0x74}},
+ {16,0x15c6,0,{0x80,0xf0,0x05,0x86,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0}},
+ { 6,0x15d6,0,{0xf0,0xf0,0xf0,0xf0,0xf0,0xf0}},
+ {16,0x15dc,0,{0xdd,0xce,0x02,0x16,0x40,0xf0,0xf0,0xf0,0xf0,0xdd,0xfa,0x7d,0x02,0x05,0x86,0x90}},
+ {16,0x15ec,0,{0x7f,0xe2,0x74,0x00,0xf0,0x90,0x7f,0x9b,0xe0,0x54,0x04,0xb4,0x00,0x05,0x05,0x86}},
+ {16,0x15fc,0,{0x02,0x16,0x40,0x90,0x7f,0xe2,0x74,0x80,0xf0,0x05,0x86,0xf0,0xf0,0xf0,0xf0,0xdd}},
+ {16,0x160c,0,{0xdc,0x02,0x16,0x40,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xdd,0xf8,0x7d,0x02,0x05,0x86}},
+ {16,0x161c,0,{0x90,0x7f,0xe2,0x74,0x00,0xf0,0x90,0x7f,0x9b,0xe0,0x54,0x04,0xb4,0x00,0x05,0x05}},
+ {16,0x162c,0,{0x86,0x02,0x16,0x40,0x90,0x7f,0xe2,0x74,0x80,0xf0,0x05,0x86,0xf0,0xf0,0xf0,0xf0}},
+ {16,0x163c,0,{0xf0,0xf0,0xdd,0xda,0x90,0x7f,0xe2,0x74,0x00,0xf0,0xd0,0x85,0xd0,0x84,0x05,0x86}},
+ {16,0x164c,0,{0xd0,0x83,0xd0,0x82,0xd0,0xe0,0xfc,0xd0,0xe0,0xfd,0xd0,0xe0,0xfe,0xd0,0xe0,0xff}},
+ { 5,0x165c,0,{0xd0,0xe0,0xd0,0xd0,0x22}},
+ {16,0x1661,0,{0xc0,0xd0,0xc0,0xe0,0xc0,0x82,0xc0,0x83,0x90,0x76,0x7c,0xe0,0x90,0x7f,0x6f,0xf0}},
+ {16,0x1671,0,{0x90,0x76,0x7d,0xe0,0x90,0x7f,0x6f,0xf0,0x90,0x76,0x7e,0xe0,0x90,0x7f,0x6f,0xf0}},
+ { 9,0x1681,0,{0xd0,0x83,0xd0,0x82,0xd0,0xe0,0xd0,0xd0,0x22}},
+ {16,0x168a,0,{0xc0,0xd0,0xc0,0xe0,0x8f,0xe0,0xc0,0xe0,0x8e,0xe0,0xc0,0xe0,0xc0,0x82,0xc0,0x83}},
+ {16,0x169a,0,{0x05,0x86,0xc0,0x84,0xc0,0x85,0x90,0x76,0x87,0xe0,0xff,0xbf,0x00,0x03,0x02,0x17}},
+ {16,0x16aa,0,{0x01,0x90,0x7f,0x96,0xe0,0x44,0x80,0xf0,0x90,0x7f,0xe2,0x74,0x80,0xf0,0x90,0x7f}},
+ {16,0x16ba,0,{0x62,0xe0,0x05,0x86,0x90,0x7f,0xe2,0x74,0x00,0xf0,0x90,0x7f,0x96,0xe0,0x54,0x7f}},
+ {16,0x16ca,0,{0xf0,0x90,0x7f,0xe2,0x74,0x80,0xf0,0x90,0x76,0x8e,0xe0,0xb4,0x01,0x05,0x05,0x86}},
+ {16,0x16da,0,{0x02,0x16,0xf6,0xb4,0x02,0x05,0x05,0x86,0x02,0x16,0xeb,0x05,0x86,0x02,0x16,0xfb}},
+ {16,0x16ea,0,{0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xdf,0xf8,0x02,0x16,0xfb,0xe0,0xe0,0xe0,0xe0,0xdf}},
+ {16,0x16fa,0,{0xfa,0x90,0x7f,0xe2,0x74,0x00,0xf0,0xd0,0x85,0xd0,0x84,0x05,0x86,0xd0,0x83,0xd0}},
+ {12,0x170a,0,{0x82,0xd0,0xe0,0xfe,0xd0,0xe0,0xff,0xd0,0xe0,0xd0,0xd0,0x22}},
+ {16,0x1716,0,{0xc0,0x82,0xc0,0x83,0xc0,0xe0,0xe8,0xc0,0xe0,0x78,0xd1,0xe8,0x14,0xf8,0x70,0xfb}},
+ {10,0x1726,0,{0xd0,0xe0,0xf8,0xd0,0xe0,0xd0,0x83,0xd0,0x82,0x22}},
+ {16,0x1730,0,{0xc0,0x82,0xc0,0x83,0xc0,0xe0,0xe8,0xc0,0xe0,0x78,0x78,0xe8,0x14,0xf8,0x70,0xfb}},
+ {10,0x1740,0,{0xd0,0xe0,0xf8,0xd0,0xe0,0xd0,0x83,0xd0,0x82,0x22}},
+ { 7,0x174a,0,{0x90,0x7f,0xc5,0x74,0x02,0xf0,0x22}},
+ {16,0x1751,0,{0x90,0x7e,0xc0,0xe0,0x90,0x76,0x45,0xf0,0x90,0x7e,0xc1,0xe0,0x90,0x76,0x44,0xf0}},
+ {16,0x1761,0,{0x90,0x7e,0xc2,0xe0,0x90,0x76,0x43,0xf0,0xb4,0x00,0x03,0x02,0x17,0x78,0x90,0x76}},
+ {16,0x1771,0,{0x19,0x74,0x03,0xf0,0x02,0x17,0x8e,0x90,0x76,0x44,0xe0,0xb4,0xbb,0x09,0x90,0x76}},
+ {16,0x1781,0,{0x19,0x74,0x02,0xf0,0x02,0x17,0x8e,0x90,0x76,0x19,0x74,0x01,0xf0,0x90,0x76,0x42}},
+ { 3,0x1791,0,{0xe4,0xf0,0x22}},
+ { 4,0x1794,0,{0x8d,0x29,0x8b,0x2a}},
+ {16,0x1798,0,{0x12,0x49,0xff,0xea,0x49,0x60,0x57,0x12,0x36,0x92,0x7e,0x00,0x29,0xff,0xee,0x3a}},
+ {16,0x17a8,0,{0xc9,0xef,0xc9,0x75,0x2b,0xff,0xf5,0x2c,0x89,0x2d,0xab,0x2b,0xaa,0x2c,0xa9,0x2d}},
+ {16,0x17b8,0,{0x90,0x00,0x01,0x12,0x36,0xab,0xff,0x64,0x04,0x60,0x05,0xef,0x64,0x05,0x70,0x2e}},
+ {16,0x17c8,0,{0xef,0xb4,0x04,0x15,0x90,0x00,0x02,0x12,0x36,0xab,0x65,0x29,0x70,0x0b,0x90,0x00}},
+ {16,0x17d8,0,{0x03,0x12,0x36,0xab,0x65,0x2a,0x70,0x01,0x22,0x12,0x36,0x92,0x7e,0x00,0x29,0xff}},
+ {16,0x17e8,0,{0xee,0x3a,0xc9,0xef,0xc9,0x75,0x2b,0xff,0xf5,0x2c,0x89,0x2d,0x80,0xbc,0x7b,0x00}},
+ { 4,0x17f8,0,{0x7a,0x00,0x79,0x00}},
+ { 1,0x17fc,0,{0x22}},
+ { 3,0x17fd,0,{0xc2,0x8b,0x32}},
+ {16,0x1800,0,{0x90,0x76,0x90,0xe0,0x14,0x60,0x37,0x14,0x70,0x02,0x01,0xd8,0x14,0x70,0x02,0x21}},
+ {16,0x1810,0,{0x72,0x14,0x70,0x02,0x41,0x3b,0x24,0x04,0x60,0x02,0x61,0x03,0x90,0x7f,0xfc,0x74}},
+ {16,0x1820,0,{0xcc,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x95,0xe0,0x44,0x01,0xf0,0x54}},
+ {16,0x1830,0,{0x05,0xf0,0x90,0x80,0x01,0xf0,0xe4,0x90,0x76,0x1a,0xf0,0xc2,0x2e,0x22,0x90,0x76}},
+ {16,0x1840,0,{0x95,0xe0,0x44,0x01,0xf0,0x44,0x02,0xf0,0x30,0x3e,0x06,0xe0,0x44,0x04,0xf0,0x80}},
+ {16,0x1850,0,{0x07,0x90,0x76,0x95,0xe0,0x54,0xfb,0xf0,0x90,0x76,0x1a,0xe0,0xb4,0x01,0x08,0x90}},
+ {16,0x1860,0,{0x76,0x95,0xe0,0x90,0x80,0x01,0xf0,0x90,0x76,0x19,0xe0,0xff,0xb4,0x01,0x22,0x90}},
+ {16,0x1870,0,{0x7f,0xfc,0x74,0x74,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x8f,0x74,0x2b}},
+ {16,0x1880,0,{0xf0,0x90,0x76,0x97,0xe0,0x54,0xfd,0xf0,0xe4,0x90,0x76,0x81,0xf0,0x90,0x76,0x80}},
+ {16,0x1890,0,{0xf0,0xef,0xb4,0x02,0x22,0x90,0x7f,0xfc,0x74,0x68,0xf0,0x90,0x7f,0xff,0x74,0xfc}},
+ {16,0x18a0,0,{0xf0,0x90,0x76,0x8f,0x74,0x2f,0xf0,0x90,0x76,0x97,0xe0,0x44,0x02,0xf0,0xe4,0x90}},
+ {16,0x18b0,0,{0x76,0x81,0xf0,0x90,0x76,0x80,0xf0,0x30,0x3f,0x09,0x90,0x76,0x97,0xe0,0x54,0xfe}},
+ {16,0x18c0,0,{0xf0,0x80,0x07,0x90,0x76,0x97,0xe0,0x44,0x01,0xf0,0x90,0x76,0x97,0xe0,0x54,0xfb}},
+ {16,0x18d0,0,{0xf0,0x90,0x80,0x02,0xf0,0xd2,0x2e,0x22,0x90,0x76,0x95,0xe0,0x54,0xfe,0xf0,0x44}},
+ {16,0x18e0,0,{0x02,0xf0,0x30,0x3e,0x06,0xe0,0x44,0x04,0xf0,0x80,0x07,0x90,0x76,0x95,0xe0,0x54}},
+ {16,0x18f0,0,{0xfb,0xf0,0x90,0x76,0x1a,0xe0,0xb4,0x01,0x08,0x90,0x76,0x95,0xe0,0x90,0x80,0x01}},
+ {16,0x1900,0,{0xf0,0x90,0x76,0x19,0xe0,0xff,0xb4,0x01,0x22,0x90,0x7f,0xfc,0x74,0x30,0xf0,0x90}},
+ {16,0x1910,0,{0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x8f,0x74,0x2b,0xf0,0x90,0x76,0x97,0xe0,0x54}},
+ {16,0x1920,0,{0xfd,0xf0,0xe4,0x90,0x76,0x81,0xf0,0x90,0x76,0x80,0xf0,0xef,0xb4,0x02,0x22,0x90}},
+ {16,0x1930,0,{0x7f,0xfc,0x74,0x1c,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x8f,0x74,0x2f}},
+ {16,0x1940,0,{0xf0,0x90,0x76,0x97,0xe0,0x44,0x02,0xf0,0xe4,0x90,0x76,0x81,0xf0,0x90,0x76,0x80}},
+ {16,0x1950,0,{0xf0,0x30,0x3f,0x09,0x90,0x76,0x97,0xe0,0x54,0xfe,0xf0,0x80,0x07,0x90,0x76,0x97}},
+ {16,0x1960,0,{0xe0,0x44,0x01,0xf0,0x90,0x76,0x97,0xe0,0x54,0xfb,0xf0,0x90,0x80,0x02,0xf0,0xd2}},
+ {16,0x1970,0,{0x2e,0x22,0x90,0x76,0x95,0xe0,0x44,0x01,0xf0,0x44,0x02,0xf0,0x44,0x08,0xf0,0x30}},
+ {16,0x1980,0,{0x3e,0x06,0xe0,0x44,0x04,0xf0,0x80,0x07,0x90,0x76,0x95,0xe0,0x54,0xfb,0xf0,0x90}},
+ {16,0x1990,0,{0x76,0x1a,0xe0,0xb4,0x01,0x08,0x90,0x76,0x95,0xe0,0x90,0x80,0x01,0xf0,0x90,0x76}},
+ {16,0x19a0,0,{0x19,0xe0,0xff,0xb4,0x01,0x25,0x90,0x7f,0xfc,0x74,0xcc,0xf0,0x90,0x7f,0xff,0x74}},
+ {16,0x19b0,0,{0xfc,0xf0,0x90,0x76,0x8f,0x74,0x2b,0xf0,0x90,0x76,0x97,0xe0,0x54,0xfd,0xf0,0x54}},
+ {16,0x19c0,0,{0xfb,0xf0,0xe4,0x90,0x76,0x81,0xf0,0x90,0x76,0x80,0xf0,0xef,0xb4,0x02,0x25,0x90}},
+ {16,0x19d0,0,{0x7f,0xfc,0x74,0xc8,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x8f,0x74,0x2f}},
+ {16,0x19e0,0,{0xf0,0x90,0x76,0x97,0xe0,0x44,0x02,0xf0,0x54,0xfb,0xf0,0xe4,0x90,0x76,0x81,0xf0}},
+ {16,0x19f0,0,{0x90,0x76,0x80,0xf0,0xef,0xb4,0x03,0x25,0x90,0x7f,0xfc,0x74,0x98,0xf0,0x90,0x7f}},
+ {16,0x1a00,0,{0xff,0x74,0xfc,0xf0,0x90,0x76,0x8f,0x74,0x5f,0xf0,0x90,0x76,0x97,0xe0,0x54,0xfd}},
+ {16,0x1a10,0,{0xf0,0x44,0x04,0xf0,0xe4,0x90,0x76,0x81,0xf0,0x90,0x76,0x80,0xf0,0x30,0x3f,0x09}},
+ {16,0x1a20,0,{0x90,0x76,0x97,0xe0,0x54,0xfe,0xf0,0x80,0x07,0x90,0x76,0x97,0xe0,0x44,0x01,0xf0}},
+ {16,0x1a30,0,{0x90,0x76,0x97,0xe0,0x90,0x80,0x02,0xf0,0xd2,0x2e,0x22,0x90,0x76,0x95,0xe0,0x54}},
+ {16,0x1a40,0,{0xfe,0xf0,0x44,0x02,0xf0,0x44,0x08,0xf0,0x30,0x3e,0x06,0xe0,0x44,0x04,0xf0,0x80}},
+ {16,0x1a50,0,{0x07,0x90,0x76,0x95,0xe0,0x54,0xfb,0xf0,0x90,0x76,0x1a,0xe0,0xb4,0x01,0x08,0x90}},
+ {16,0x1a60,0,{0x76,0x95,0xe0,0x90,0x80,0x01,0xf0,0x90,0x76,0x19,0xe0,0xff,0xb4,0x01,0x25,0x90}},
+ {16,0x1a70,0,{0x7f,0xfc,0x74,0xb4,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x8f,0x74,0x2b}},
+ {16,0x1a80,0,{0xf0,0x90,0x76,0x97,0xe0,0x54,0xfd,0xf0,0x54,0xfb,0xf0,0xe4,0x90,0x76,0x81,0xf0}},
+ {16,0x1a90,0,{0x90,0x76,0x80,0xf0,0xef,0xb4,0x02,0x25,0x90,0x7f,0xfc,0x74,0xb0,0xf0,0x90,0x7f}},
+ {16,0x1aa0,0,{0xff,0x74,0xfc,0xf0,0x90,0x76,0x8f,0x74,0x2f,0xf0,0x90,0x76,0x97,0xe0,0x44,0x02}},
+ {16,0x1ab0,0,{0xf0,0x54,0xfb,0xf0,0xe4,0x90,0x76,0x81,0xf0,0x90,0x76,0x80,0xf0,0xef,0xb4,0x03}},
+ {16,0x1ac0,0,{0x25,0x90,0x7f,0xfc,0x74,0x68,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x8f}},
+ {16,0x1ad0,0,{0x74,0x5f,0xf0,0x90,0x76,0x97,0xe0,0x54,0xfd,0xf0,0x44,0x04,0xf0,0xe4,0x90,0x76}},
+ {16,0x1ae0,0,{0x81,0xf0,0x90,0x76,0x80,0xf0,0x30,0x3f,0x09,0x90,0x76,0x97,0xe0,0x54,0xfe,0xf0}},
+ {16,0x1af0,0,{0x80,0x07,0x90,0x76,0x97,0xe0,0x44,0x01,0xf0,0x90,0x76,0x97,0xe0,0x90,0x80,0x02}},
+ { 4,0x1b00,0,{0xf0,0xd2,0x2e,0x22}},
+ {16,0x1b04,0,{0x30,0x2c,0x38,0xc2,0x2c,0x90,0x76,0x19,0xe0,0xff,0xb4,0x01,0x0e,0x90,0x76,0x7c}},
+ {16,0x1b14,0,{0x74,0xc0,0xf0,0xa3,0x74,0x14,0xf0,0xa3,0x74,0x0b,0xf0,0xef,0xb4,0x02,0x0d,0xe4}},
+ {16,0x1b24,0,{0x90,0x76,0x7c,0xf0,0xa3,0x74,0x10,0xf0,0xa3,0x74,0x0c,0xf0,0xef,0xb4,0x03,0x0b}},
+ {12,0x1b34,0,{0xe4,0x90,0x76,0x7c,0xf0,0xa3,0x74,0x18,0xf0,0xa3,0xf0,0x22}},
+ {16,0x1b40,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1b50,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1b60,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1b70,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1b80,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1b90,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1ba0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1bb0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1bc0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1bd0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1be0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1bf0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1c00,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1c10,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1c20,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1c30,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1c40,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1c50,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1c60,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1c70,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1c80,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1c90,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1ca0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1cb0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1cc0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1cd0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1ce0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1cf0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1d00,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1d10,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1d20,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1d30,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1d40,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1d50,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1d60,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1d70,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1d80,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1d90,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1da0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1db0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1dc0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1dd0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1de0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1df0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1e00,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1e10,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1e20,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1e30,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1e40,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1e50,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1e60,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1e70,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1e80,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1e90,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1ea0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {14,0x1eb0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1ebe,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1ece,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1ede,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1eee,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1efe,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1f0e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1f1e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1f2e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ { 2,0x1f3e,0,{0x00,0x00}},
+ {16,0x1f40,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1f50,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1f60,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1f70,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1f80,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1f90,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1fa0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1fb0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1fc0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1fd0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1fe0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x1ff0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2000,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2010,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2020,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2030,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2040,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2050,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2060,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2070,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2080,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2090,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x20a0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x20b0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x20c0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x20d0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x20e0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x20f0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2100,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2110,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2120,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2130,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2140,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2150,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2160,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2170,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2180,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2190,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x21a0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x21b0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x21c0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x21d0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x21e0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x21f0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2200,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2210,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2220,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2230,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2240,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2250,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2260,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2270,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2280,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2290,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x22a0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x22b0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x22c0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x22d0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x22e0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x22f0,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2300,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2310,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2320,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2330,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2340,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2350,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x2360,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {14,0x2370,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x237e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x238e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x239e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x23ae,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x23be,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x23ce,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x23de,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x23ee,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x23fe,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x240e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x241e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x242e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x243e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x244e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x245e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x246e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x247e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x248e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x249e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x24ae,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x24be,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x24ce,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x24de,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x24ee,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x24fe,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x250e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x251e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x252e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x253e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x254e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x255e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x256e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x257e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x258e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x259e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x25ae,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x25be,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x25ce,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x25de,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x25ee,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x25fe,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x260e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x261e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x262e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x263e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x264e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x265e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x266e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x267e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x268e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x269e,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x26ae,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x26be,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x26ce,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x26de,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {14,0x26ee,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x26fc,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x270c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x271c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x272c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x273c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x274c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x275c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x276c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x277c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x278c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x279c,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x27ac,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x27bc,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x27cc,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x27dc,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {16,0x27ec,0,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ { 5,0x27fc,0,{0x00,0x00,0x00,0x00,0x22}},
+ {16,0x2801,0,{0xc2,0x20,0xc2,0x21,0xc2,0x2a,0x90,0x7f,0xe8,0xe0,0x12,0x37,0xf9,0x28,0x30,0x00}},
+ {16,0x2811,0,{0x28,0x8c,0x01,0x28,0xa2,0x02,0x2a,0x1f,0x21,0x2a,0x6a,0x22,0x29,0x3d,0x80,0x29}},
+ {16,0x2821,0,{0x7d,0x81,0x29,0xd1,0x82,0x2a,0x84,0xa1,0x2a,0xba,0xa2,0x00,0x00,0x2a,0xbf,0x90}},
+ {16,0x2831,0,{0x7f,0xe9,0xe0,0x14,0x60,0x11,0x24,0xfe,0x60,0x28,0x24,0xfe,0x60,0x3b,0x24,0xfc}},
+ {16,0x2841,0,{0x70,0x40,0x12,0x4b,0xa0,0x41,0xcb,0x12,0x4d,0xa7,0x40,0x02,0x41,0xcb,0x90,0x7f}},
+ {16,0x2851,0,{0xea,0xe0,0xb4,0x01,0x04,0xc2,0x22,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0}},
+ {16,0x2861,0,{0x41,0xcb,0x12,0x4d,0xa9,0x90,0x7f,0xea,0xe0,0xb4,0x01,0x04,0xd2,0x22,0x41,0xcb}},
+ {16,0x2871,0,{0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0}},
+ {16,0x2881,0,{0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb,0x90,0x7f,0xe9,0xe0,0x24}},
+ {16,0x2891,0,{0xf5,0x70,0x05,0x12,0x48,0x00,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41}},
+ {16,0x28a1,0,{0xcb,0x90,0x7f,0xe9,0xe0,0x24,0xfd,0x60,0x54,0x24,0x02,0x60,0x02,0x21,0x34,0x12}},
+ {16,0x28b1,0,{0x4d,0xa7,0x40,0x02,0x41,0xcb,0x90,0x7f,0xea,0xe0,0x70,0x38,0x90,0x7f,0xec,0xe0}},
+ {16,0x28c1,0,{0xf4,0x54,0x80,0xff,0xc4,0x54,0x0f,0xff,0xe0,0x54,0x07,0x2f,0x25,0xe0,0x24,0xb4}},
+ {16,0x28d1,0,{0xf5,0x82,0xe4,0x34,0x7f,0xf5,0x83,0xe4,0xf0,0x90,0x7f,0xec,0xe0,0x54,0x80,0xff}},
+ {16,0x28e1,0,{0x13,0x13,0x13,0x54,0x1f,0xff,0xe0,0x54,0x07,0x2f,0x90,0x7f,0xd7,0xf0,0xe0,0x44}},
+ {16,0x28f1,0,{0x20,0xf0,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb,0x12,0x4d,0xa9}},
+ {16,0x2901,0,{0x40,0x02,0x41,0xcb,0x90,0x7f,0xea,0xe0,0x70,0x20,0x90,0x7f,0xec,0xe0,0xf4,0x54}},
+ {16,0x2911,0,{0x80,0xff,0xc4,0x54,0x0f,0xff,0xe0,0x54,0x07,0x2f,0x25,0xe0,0x24,0xb4,0xf5,0x82}},
+ {16,0x2921,0,{0xe4,0x34,0x7f,0xf5,0x83,0x74,0x01,0xf0,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01}},
+ {16,0x2931,0,{0xf0,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb,0x90,0x7f,0xe9,0xe0}},
+ {16,0x2941,0,{0x60,0x12,0x24,0xf8,0x60,0x09,0x24,0x02,0x70,0x29,0x12,0x43,0xdb,0x41,0xcb,0x12}},
+ {16,0x2951,0,{0x4d,0x5c,0x41,0xcb,0x12,0x4d,0xa5,0xa2,0x22,0xe4,0x33,0xff,0x25,0xe0,0xff,0xa2}},
+ {16,0x2961,0,{0x23,0xe4,0x33,0x4f,0x90,0x7f,0x00,0xf0,0xe4,0xa3,0xf0,0x90,0x7f,0xb5,0x74,0x02}},
+ {16,0x2971,0,{0xf0,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb,0x90,0x7f,0xe9,0xe0}},
+ {16,0x2981,0,{0x60,0x33,0x24,0xf6,0x60,0x2a,0x24,0x04,0x70,0x3d,0x90,0x7f,0xeb,0xe0,0x24,0xde}},
+ {16,0x2991,0,{0x60,0x0c,0x04,0x70,0x12,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb,0x90,0x7f}},
+ {16,0x29a1,0,{0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb}},
+ {16,0x29b1,0,{0x12,0x46,0x85,0x41,0xcb,0x12,0x4d,0xa5,0xe4,0x90,0x7f,0x00,0xf0,0xa3,0xf0,0x90}},
+ {16,0x29c1,0,{0x7f,0xb5,0x74,0x02,0xf0,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb}},
+ {16,0x29d1,0,{0x90,0x7f,0xe9,0xe0,0x24,0xf4,0x60,0x34,0x24,0x0c,0x70,0x39,0x12,0x4d,0xa5,0x90}},
+ {16,0x29e1,0,{0x7f,0xec,0xe0,0xf4,0x54,0x80,0xff,0xc4,0x54,0x0f,0xff,0xe0,0x54,0x07,0x2f,0x25}},
+ {16,0x29f1,0,{0xe0,0x24,0xb4,0xf5,0x82,0xe4,0x34,0x7f,0xf5,0x83,0xe0,0x54,0xfd,0x90,0x7f,0x00}},
+ {16,0x2a01,0,{0xf0,0xe4,0xa3,0xf0,0x90,0x7f,0xb5,0x74,0x02,0xf0,0x41,0xcb,0x90,0x7f,0xb4,0xe0}},
+ {16,0x2a11,0,{0x44,0x01,0xf0,0x41,0xcb,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x41,0xcb,0x90,0x7f}},
+ {16,0x2a21,0,{0xe9,0xe0,0x24,0xf6,0x60,0x12,0x14,0x60,0x1a,0x24,0x02,0x70,0x1d,0xd2,0x20,0x90}},
+ {16,0x2a31,0,{0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x80,0x12,0xd2,0x20,0x90,0x7f,0xb4,0xe0,0x44,0x01}},
+ {16,0x2a41,0,{0xf0,0x80,0x07,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x20,0x20,0x18,0x90,0x7f,0xee}},
+ {16,0x2a51,0,{0xe0,0x70,0x04,0xa3,0xe0,0x60,0x0b,0xd2,0x29,0xd2,0x27,0x12,0x17,0x4a,0xd2,0x2a}},
+ {16,0x2a61,0,{0x80,0x03,0x12,0x08,0x00,0xc2,0x20,0x80,0x61,0x90,0x7f,0xee,0xe0,0x70,0x04,0xa3}},
+ {16,0x2a71,0,{0xe0,0x60,0x0b,0xd2,0x29,0xd2,0x28,0x12,0x17,0x4a,0xd2,0x2a,0x80,0x4c,0x12,0x38}},
+ {16,0x2a81,0,{0x74,0x80,0x47,0x90,0x7f,0xe9,0xe0,0x24,0xfe,0x60,0x12,0x14,0x60,0x1a,0x24,0x02}},
+ {16,0x2a91,0,{0x70,0x1d,0xd2,0x21,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x80,0x12,0xd2,0x21,0x90}},
+ {16,0x2aa1,0,{0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x80,0x07,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x20}},
+ {16,0x2ab1,0,{0x21,0x03,0x12,0x10,0x00,0xc2,0x21,0x80,0x11,0x12,0x2a,0xd6,0x80,0x0c,0x12,0x4d}},
+ {16,0x2ac1,0,{0xab,0x50,0x07,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x20,0x2a,0x07,0x90,0x7f,0xb4}},
+ { 5,0x2ad1,0,{0xe0,0x44,0x02,0xf0,0x22}},
+ {16,0x2ad6,0,{0xe4,0x90,0x76,0x27,0xf0,0x90,0x76,0x27,0xe0,0xff,0x75,0xf0,0x0f,0xa4,0x24,0x42}},
+ {16,0x2ae6,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xec,0xe0,0xfd,0xee,0x6d}},
+ {16,0x2af6,0,{0x60,0x0e,0xef,0xc3,0x94,0x06,0x50,0x08,0x90,0x76,0x27,0xe0,0x04,0xf0,0x80,0xd5}},
+ {16,0x2b06,0,{0xef,0xb4,0x06,0x08,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0xef,0x75,0xf0,0x0f}},
+ {16,0x2b16,0,{0xa4,0x24,0x41,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x76,0x28,0xf0,0x24}},
+ {16,0x2b26,0,{0x9f,0x70,0x02,0xa1,0x74,0x24,0x21,0x60,0x02,0xa1,0xa1,0x90,0x7f,0xe9,0xe0,0x24}},
+ {16,0x2b36,0,{0x7e,0x70,0x02,0x61,0xfc,0x14,0x70,0x02,0x81,0xb5,0x24,0x02,0x60,0x02,0xa1,0x6c}},
+ {16,0x2b46,0,{0xef,0x75,0xf0,0x0f,0xa4,0x24,0x43,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfc}},
+ {16,0x2b56,0,{0xa3,0xe0,0xfd,0xa3,0xe0,0xfe,0xa3,0xe0,0xff,0x7b,0x44,0x7a,0xac,0x79,0x00,0x78}},
+ {16,0x2b66,0,{0x00,0xc3,0x12,0x37,0xab,0x70,0x13,0x90,0x7f,0x00,0x74,0x44,0xf0,0xa3,0x74,0xac}},
+ {16,0x2b76,0,{0xf0,0xe4,0xa3,0xf0,0x90,0x7f,0xb5,0x74,0x03,0xf0,0x90,0x76,0x27,0xe0,0x75,0xf0}},
+ {16,0x2b86,0,{0x0f,0xa4,0x24,0x43,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfc,0xa3,0xe0,0xfd}},
+ {16,0x2b96,0,{0xa3,0xe0,0xfe,0xa3,0xe0,0xff,0x7b,0x80,0x7a,0xbb,0x79,0x00,0x78,0x00,0xc3,0x12}},
+ {16,0x2ba6,0,{0x37,0xab,0x70,0x13,0x90,0x7f,0x00,0x74,0x80,0xf0,0xa3,0x74,0xbb,0xf0,0xe4,0xa3}},
+ {16,0x2bb6,0,{0xf0,0x90,0x7f,0xb5,0x74,0x03,0xf0,0x90,0x76,0x27,0xe0,0x75,0xf0,0x0f,0xa4,0x24}},
+ {16,0x2bc6,0,{0x43,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfc,0xa3,0xe0,0xfd,0xa3,0xe0,0xfe}},
+ {16,0x2bd6,0,{0xa3,0xe0,0xff,0x7b,0x00,0x7a,0x77,0x79,0x01,0x78,0x00,0xc3,0x12,0x37,0xab,0x60}},
+ {16,0x2be6,0,{0x02,0xa1,0xa8,0x90,0x7f,0x00,0xf0,0xa3,0x74,0x77,0xf0,0xa3,0x74,0x01,0xf0,0x90}},
+ {16,0x2bf6,0,{0x7f,0xb5,0x74,0x03,0xf0,0x22,0x90,0x76,0x27,0xe0,0x75,0xf0,0x0f,0xa4,0x24,0x47}},
+ {16,0x2c06,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfc,0xa3,0xe0,0xfd,0xa3,0xe0,0xfe,0xa3}},
+ {16,0x2c16,0,{0xe0,0xff,0x7b,0x44,0x7a,0xac,0x79,0x00,0x78,0x00,0xc3,0x12,0x37,0xab,0x70,0x13}},
+ {16,0x2c26,0,{0x90,0x7f,0x00,0x74,0x44,0xf0,0xa3,0x74,0xac,0xf0,0xe4,0xa3,0xf0,0x90,0x7f,0xb5}},
+ {16,0x2c36,0,{0x74,0x03,0xf0,0x90,0x76,0x27,0xe0,0x75,0xf0,0x0f,0xa4,0x24,0x47,0xf5,0x82,0xe4}},
+ {16,0x2c46,0,{0x34,0x75,0xf5,0x83,0xe0,0xfc,0xa3,0xe0,0xfd,0xa3,0xe0,0xfe,0xa3,0xe0,0xff,0x7b}},
+ {16,0x2c56,0,{0x80,0x7a,0xbb,0x79,0x00,0x78,0x00,0xc3,0x12,0x37,0xab,0x70,0x13,0x90,0x7f,0x00}},
+ {16,0x2c66,0,{0x74,0x80,0xf0,0xa3,0x74,0xbb,0xf0,0xe4,0xa3,0xf0,0x90,0x7f,0xb5,0x74,0x03,0xf0}},
+ {16,0x2c76,0,{0x90,0x76,0x27,0xe0,0x75,0xf0,0x0f,0xa4,0x24,0x47,0xf5,0x82,0xe4,0x34,0x75,0xf5}},
+ {16,0x2c86,0,{0x83,0xe0,0xfc,0xa3,0xe0,0xfd,0xa3,0xe0,0xfe,0xa3,0xe0,0xff,0x7b,0x00,0x7a,0x77}},
+ {16,0x2c96,0,{0x79,0x01,0x78,0x00,0xc3,0x12,0x37,0xab,0x60,0x02,0xa1,0xa8,0x90,0x7f,0x00,0xf0}},
+ {16,0x2ca6,0,{0xa3,0x74,0x77,0xf0,0xa3,0x74,0x01,0xf0,0x90,0x7f,0xb5,0x74,0x03,0xf0,0x22,0x90}},
+ {16,0x2cb6,0,{0x76,0x27,0xe0,0x75,0xf0,0x0f,0xa4,0x24,0x4b,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83}},
+ {16,0x2cc6,0,{0xe0,0xfc,0xa3,0xe0,0xfd,0xa3,0xe0,0xfe,0xa3,0xe0,0xff,0x7b,0x44,0x7a,0xac,0x79}},
+ {16,0x2cd6,0,{0x00,0x78,0x00,0xc3,0x12,0x37,0xab,0x70,0x13,0x90,0x7f,0x00,0x74,0x44,0xf0,0xa3}},
+ {16,0x2ce6,0,{0x74,0xac,0xf0,0xe4,0xa3,0xf0,0x90,0x7f,0xb5,0x74,0x03,0xf0,0x90,0x76,0x27,0xe0}},
+ {16,0x2cf6,0,{0x75,0xf0,0x0f,0xa4,0x24,0x4b,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfc,0xa3}},
+ {16,0x2d06,0,{0xe0,0xfd,0xa3,0xe0,0xfe,0xa3,0xe0,0xff,0x7b,0x80,0x7a,0xbb,0x79,0x00,0x78,0x00}},
+ {16,0x2d16,0,{0xc3,0x12,0x37,0xab,0x70,0x13,0x90,0x7f,0x00,0x74,0x80,0xf0,0xa3,0x74,0xbb,0xf0}},
+ {16,0x2d26,0,{0xe4,0xa3,0xf0,0x90,0x7f,0xb5,0x74,0x03,0xf0,0x90,0x76,0x27,0xe0,0x75,0xf0,0x0f}},
+ {16,0x2d36,0,{0xa4,0x24,0x4b,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfc,0xa3,0xe0,0xfd,0xa3}},
+ {16,0x2d46,0,{0xe0,0xfe,0xa3,0xe0,0xff,0x7b,0x00,0x7a,0x77,0x79,0x01,0x78,0x00,0xc3,0x12,0x37}},
+ {16,0x2d56,0,{0xab,0x70,0x4f,0x90,0x7f,0x00,0xf0,0xa3,0x74,0x77,0xf0,0xa3,0x74,0x01,0xf0,0x90}},
+ {16,0x2d66,0,{0x7f,0xb5,0x74,0x03,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f}},
+ {16,0x2d76,0,{0xe9,0xe0,0x24,0x7f,0x70,0x1e,0x90,0x76,0x27,0xe0,0x75,0xf0,0x0f,0xa4,0x24,0x4f}},
+ {16,0x2d86,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x7f,0x00,0xf0,0x90,0x7f,0xb5,0x74}},
+ {16,0x2d96,0,{0x01,0xf0,0x80,0x07,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x90,0x7f,0xb4,0xe0,0x44}},
+ { 3,0x2da6,0,{0x01,0xf0,0x22}},
+ {16,0x2da9,0,{0xe4,0x90,0x76,0x36,0xf0,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x0e,0xf5,0x82,0xe4}},
+ {16,0x2db9,0,{0x34,0x75,0xf5,0x83,0x74,0x01,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x0f,0xf5,0x82}},
+ {16,0x2dc9,0,{0xe4,0x34,0x75,0xf5,0x83,0x74,0x01,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x10,0xf5}},
+ {16,0x2dd9,0,{0x82,0xe4,0x34,0x75,0xf5,0x83,0xe4,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff}},
+ {16,0x2de9,0,{0x75,0xf0,0x03,0xa4,0x24,0x0e,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x10,0xf0}},
+ {16,0x2df9,0,{0xef,0x75,0xf0,0x03,0xa4,0x24,0x0f,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x05}},
+ {16,0x2e09,0,{0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x10,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe4}},
+ {16,0x2e19,0,{0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x0e,0xf5}},
+ {16,0x2e29,0,{0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x02,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x0f}},
+ {16,0x2e39,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x02,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24}},
+ {16,0x2e49,0,{0x10,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe4,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0}},
+ {16,0x2e59,0,{0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x0e,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74}},
+ {16,0x2e69,0,{0x01,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x0f,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83}},
+ {16,0x2e79,0,{0x74,0x03,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x10,0xf5,0x82,0xe4,0x34,0x75,0xf5}},
+ {16,0x2e89,0,{0x83,0xe4,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24}},
+ {16,0x2e99,0,{0x0e,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x10,0xf0,0xef,0x75,0xf0,0x03,0xa4}},
+ {16,0x2ea9,0,{0x24,0x0f,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x06,0xf0,0xef,0x75,0xf0,0x03}},
+ {16,0x2eb9,0,{0xa4,0x24,0x10,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe4,0xf0,0x90,0x76,0x36,0xe0}},
+ {16,0x2ec9,0,{0x04,0xf0,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x0e,0xf5,0x82,0xe4,0x34,0x75,0xf5}},
+ {16,0x2ed9,0,{0x83,0x74,0x02,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x0f,0xf5,0x82,0xe4,0x34,0x75}},
+ {16,0x2ee9,0,{0xf5,0x83,0x74,0x04,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x10,0xf5,0x82,0xe4,0x34}},
+ {16,0x2ef9,0,{0x75,0xf5,0x83,0xe4,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75,0xf0,0x03}},
+ {16,0x2f09,0,{0xa4,0x24,0x0e,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x02,0xf0,0xef,0x75,0xf0}},
+ {16,0x2f19,0,{0x03,0xa4,0x24,0x0f,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x08,0xf0,0xef,0x75}},
+ {16,0x2f29,0,{0xf0,0x03,0xa4,0x24,0x10,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x04,0xf0,0x90}},
+ {16,0x2f39,0,{0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x0e,0xf5,0x82,0xe4}},
+ {16,0x2f49,0,{0x34,0x75,0xf5,0x83,0x74,0x02,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x0f,0xf5,0x82}},
+ {16,0x2f59,0,{0xe4,0x34,0x75,0xf5,0x83,0x74,0x0a,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x10,0xf5}},
+ {16,0x2f69,0,{0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x04,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0}},
+ {16,0x2f79,0,{0xff,0x75,0xf0,0x03,0xa4,0x24,0x0e,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x02}},
+ {16,0x2f89,0,{0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x0f,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74}},
+ {16,0x2f99,0,{0x09,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x10,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83}},
+ {16,0x2fa9,0,{0x74,0x04,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24}},
+ {16,0x2fb9,0,{0x0e,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x02,0xf0,0xef,0x75,0xf0,0x03,0xa4}},
+ {16,0x2fc9,0,{0x24,0x0f,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x07,0xf0,0xef,0x75,0xf0,0x03}},
+ {14,0x2fd9,0,{0xa4,0x24,0x10,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x04,0xf0,0x22}},
+ {16,0x2fe7,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0xd2,0x26,0x53,0x91,0xef,0x90,0x7f,0xab,0x74,0x01}},
+ { 8,0x2ff7,0,{0xf0,0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ { 1,0x2fff,0,{0x32}},
+ {16,0x3000,0,{0x90,0x7f,0xb6,0xe0,0x20,0xe1,0x02,0xc2,0x3d,0xd2,0x36,0x20,0x36,0x02,0x41,0x6e}},
+ {16,0x3010,0,{0x30,0x3d,0x02,0x41,0x6e,0x90,0x80,0x07,0xe0,0x60,0x04,0xd2,0x36,0x80,0x02,0xc2}},
+ {16,0x3020,0,{0x36,0x20,0x36,0x02,0x41,0x2e,0xd2,0x35,0xe4,0xf5,0x1a,0x90,0x80,0x04,0xe0,0xf5}},
+ {16,0x3030,0,{0x19,0x74,0x08,0x25,0x0e,0xf8,0xa6,0x19,0x85,0x19,0x18,0xe5,0x18,0x20,0xe7,0x04}},
+ {16,0x3040,0,{0xd2,0x38,0x80,0x02,0xc2,0x38,0x30,0x38,0x02,0x21,0xd4,0xe4,0xf5,0x16,0xe5,0x19}},
+ {16,0x3050,0,{0xb4,0xf0,0x0c,0xd2,0x39,0x75,0x08,0x04,0x75,0x09,0xf0,0x05,0x0e,0x80,0x02,0x05}},
+ {16,0x3060,0,{0x16,0xe5,0x19,0x64,0xf7,0x70,0x3d,0xc2,0x39,0xe5,0x0e,0x24,0xfe,0x60,0x17,0x14}},
+ {16,0x3070,0,{0x60,0x22,0x24,0x03,0x70,0x29,0x75,0x08,0x05,0x75,0x09,0xf7,0xe4,0xf5,0x0a,0xf5}},
+ {16,0x3080,0,{0x0b,0x75,0x0e,0x04,0x80,0x20,0x75,0x08,0x06,0x75,0x0a,0xf7,0xe4,0xf5,0x0b,0x75}},
+ {16,0x3090,0,{0x0e,0x04,0x80,0x12,0x75,0x08,0x07,0x75,0x0b,0xf7,0x75,0x0e,0x04,0x80,0x07,0x12}},
+ {16,0x30a0,0,{0x48,0xf3,0x80,0x02,0x05,0x16,0xe5,0x19,0x54,0xf8,0x64,0xf8,0x70,0x3b,0xc2,0x35}},
+ {16,0x30b0,0,{0xe5,0x19,0x24,0x07,0x60,0x0c,0x24,0xfc,0x60,0x08,0x24,0x05,0x24,0xf8,0x50,0x06}},
+ {16,0x30c0,0,{0x80,0x08,0xd2,0x3a,0x80,0x06,0xc2,0x3a,0x80,0x02,0xd2,0x3a,0x75,0x1a,0x01,0x20}},
+ {16,0x30d0,0,{0x3a,0x19,0x90,0x7e,0x80,0x74,0x0f,0xf0,0xa3,0xe5,0x19,0xf0,0xe4,0xa3,0xf0,0xa3}},
+ {16,0x30e0,0,{0xf0,0x90,0x7f,0xb7,0x74,0x04,0xf0,0x80,0x02,0x05,0x16,0x20,0x39,0x6d,0xe5,0x19}},
+ {16,0x30f0,0,{0x64,0xf7,0x60,0x67,0xe5,0x1a,0x70,0x63,0xe5,0x18,0x54,0xf0,0x64,0xf0,0x70,0x59}},
+ {16,0x3100,0,{0x85,0x18,0x19,0xf5,0x0e,0xe5,0x19,0x24,0x0f,0x60,0x1b,0x24,0xfe,0x60,0x17,0x24}},
+ {16,0x3110,0,{0xfd,0x60,0x22,0x14,0x60,0x1f,0x24,0x05,0x70,0x2f,0x75,0x08,0x03,0x05,0x0e,0x85}},
+ {16,0x3120,0,{0x18,0x09,0xd2,0x37,0x80,0x28,0x75,0x08,0x02,0x05,0x0e,0x85,0x18,0x09,0x75,0x14}},
+ {16,0x3130,0,{0x01,0xd2,0x37,0x80,0x19,0x75,0x08,0x05,0x05,0x0e,0x85,0x18,0x09,0xe4,0xf5,0x0a}},
+ {16,0x3140,0,{0xf5,0x0b,0x75,0x0e,0x03,0xd2,0x37,0x80,0x05,0x12,0x48,0xf3,0xc2,0x35,0x30,0x35}},
+ {16,0x3150,0,{0x0a,0x85,0x08,0x13,0x85,0x18,0x12,0x80,0x02,0x05,0x16,0x85,0x18,0x19,0xe5,0x16}},
+ {16,0x3160,0,{0x64,0x04,0x70,0x62,0xf5,0x0e,0xe5,0x19,0x54,0xf0,0xf5,0x19,0xf5,0x15,0x85,0x18}},
+ {16,0x3170,0,{0x19,0xe5,0x15,0x24,0x70,0x60,0x18,0x24,0xf0,0x60,0x14,0x24,0xf0,0x60,0x10,0x24}},
+ {16,0x3180,0,{0xf0,0x60,0x1e,0x24,0xf0,0x60,0x1a,0x24,0xf0,0x60,0x04,0x24,0x60,0x70,0x27,0xe5}},
+ {16,0x3190,0,{0x15,0xc4,0x54,0x0f,0xf5,0x19,0xf5,0x08,0x05,0x0e,0x85,0x18,0x09,0xd2,0x37,0x80}},
+ {16,0x31a0,0,{0x1a,0xe5,0x15,0xc4,0x54,0x0f,0xf5,0x19,0xf5,0x08,0x05,0x0e,0x85,0x18,0x09,0x75}},
+ {16,0x31b0,0,{0x14,0x01,0xd2,0x37,0x80,0x05,0x12,0x48,0xf3,0xc2,0x35,0x30,0x35,0x0a,0x85,0x19}},
+ {16,0x31c0,0,{0x13,0x85,0x18,0x12,0x80,0x02,0x05,0x16,0xe5,0x16,0xd3,0x94,0x05,0x40,0x57,0x12}},
+ {16,0x31d0,0,{0x48,0xf3,0x80,0x52,0x30,0x39,0x17,0xe5,0x0e,0x70,0x0a,0x85,0x08,0x09,0x75,0x08}},
+ {16,0x31e0,0,{0x04,0x05,0x0e,0x80,0x41,0x74,0x08,0x25,0x0e,0xf8,0xa6,0x19,0x80,0x38,0x20,0x37}},
+ {16,0x31f0,0,{0x2a,0xe5,0x0e,0xb4,0x01,0x0f,0x85,0x08,0x0a,0x85,0x09,0x0b,0x85,0x13,0x08,0x85}},
+ {16,0x3200,0,{0x12,0x09,0x75,0x0e,0x04,0xe5,0x14,0xb4,0x01,0x1c,0x85,0x08,0x0a,0xe4,0xf5,0x0b}},
+ {16,0x3210,0,{0x85,0x13,0x08,0x85,0x12,0x09,0x75,0x0e,0x04,0x80,0x0b,0xe5,0x14,0xb4,0x01,0x06}},
+ {16,0x3220,0,{0xe4,0xf5,0x0b,0x75,0x0e,0x04,0xe4,0xf5,0x1a,0x30,0x35,0x02,0x05,0x0e,0xe5,0x0e}},
+ {16,0x3230,0,{0xd3,0x94,0x03,0x50,0x02,0x01,0x0b,0xc2,0x37,0xe4,0xf5,0x0e,0xf5,0x10,0xc2,0x36}},
+ {16,0x3240,0,{0xd2,0x3d,0xf5,0x14,0x74,0x08,0x25,0x10,0xf8,0xe6,0xff,0x74,0x80,0x25,0x10,0xf5}},
+ {16,0x3250,0,{0x82,0xe4,0x34,0x7e,0xf5,0x83,0xef,0xf0,0x74,0x08,0x25,0x10,0xf8,0xe4,0xf6,0x05}},
+ {15,0x3260,0,{0x10,0xe5,0x10,0xb4,0x04,0xde,0x90,0x7f,0xb7,0x74,0x04,0xf0,0x01,0x0b,0x22}},
+ {16,0x326f,0,{0x90,0x76,0x18,0xe0,0xff,0x64,0x05,0x70,0x42,0x90,0x75,0xab,0xe0,0xb4,0x01,0x19}},
+ {16,0x327f,0,{0x90,0x72,0x37,0x74,0x01,0xf0,0xe4,0x90,0x80,0x20,0xf0,0x90,0x80,0x31,0xf0,0x90}},
+ {16,0x328f,0,{0x80,0x28,0xf0,0x90,0x80,0x39,0xf0,0x80,0x22,0xe4,0x90,0x72,0x37,0xf0,0x90,0x75}},
+ {16,0x329f,0,{0xad,0xe0,0x90,0x72,0x2b,0xf0,0xe0,0x24,0x80,0xf0,0xe0,0x90,0x80,0x20,0xf0,0x90}},
+ {16,0x32af,0,{0x80,0x31,0xf0,0x90,0x80,0x28,0xf0,0x90,0x80,0x39,0xf0,0xef,0x64,0x06,0x60,0x02}},
+ {16,0x32bf,0,{0x81,0x99,0x90,0x72,0x39,0x74,0x04,0xf0,0x90,0x72,0x39,0xe0,0xff,0x24,0xfe,0x90}},
+ {16,0x32cf,0,{0x72,0x04,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xab,0xf5,0x82,0xe4,0x34,0x75,0xf5}},
+ {16,0x32df,0,{0x83,0xe0,0x64,0x01,0x70,0x54,0x90,0x72,0x36,0x04,0xf0,0x90,0x72,0x04,0xe0,0xff}},
+ {16,0x32ef,0,{0x24,0xfd,0x60,0x28,0x24,0xfe,0x60,0x24,0x24,0x03,0x24,0xfb,0x50,0x04,0x60,0x1c}},
+ {16,0x32ff,0,{0x81,0x8c,0x74,0x20,0x2f,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xe4,0xf0,0x74,0x28}},
+ {16,0x330f,0,{0x2f,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xe4,0xf0,0x81,0x8c,0x90,0x72,0x04,0xe0}},
+ {16,0x331f,0,{0xff,0x24,0x30,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xe4,0xf0,0x74,0x38,0x2f,0xf5}},
+ {16,0x332f,0,{0x82,0xe4,0x34,0x80,0xf5,0x83,0xe4,0xf0,0x81,0x8c,0xe4,0x90,0x72,0x36,0xf0,0x90}},
+ {16,0x333f,0,{0x72,0x39,0xe0,0x75,0xf0,0x0a,0xa4,0x24,0xad,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83}},
+ {16,0x334f,0,{0xe0,0xff,0x7e,0x00,0x90,0x75,0x0c,0xee,0xf0,0xa3,0xef,0xf0,0x70,0x06,0x90,0x72}},
+ {16,0x335f,0,{0x02,0x74,0x3b,0xf0,0x90,0x75,0x0c,0xe0,0xfe,0xa3,0xe0,0xff,0x64,0x80,0x4e,0x70}},
+ {16,0x336f,0,{0x04,0x90,0x72,0x02,0xf0,0xef,0x4e,0x70,0x02,0x81,0x35,0xef,0x64,0x80,0x4e,0x70}},
+ {16,0x337f,0,{0x02,0x81,0x35,0xef,0xf8,0xe4,0x90,0x75,0x0d,0xf0,0xe8,0x90,0x75,0x0c,0xf0,0x90}},
+ {16,0x338f,0,{0x72,0x34,0xe0,0x75,0xf0,0x0a,0xa4,0x24,0xac,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83}},
+ {16,0x339f,0,{0xe0,0xff,0x90,0x72,0x02,0xf0,0x90,0x75,0x0d,0xe0,0x2f,0xf0,0x90,0x75,0x0c,0xe0}},
+ {16,0x33af,0,{0x34,0x00,0xf0,0xe0,0xfe,0xa3,0xe0,0xff,0xe4,0xfc,0xfd,0x7b,0xd6,0x7a,0xa5,0xf9}},
+ {16,0x33bf,0,{0xf8,0xd3,0x12,0x37,0x95,0x40,0x0a,0x90,0x75,0x0c,0x74,0xa5,0xf0,0xa3,0x74,0xd6}},
+ {16,0x33cf,0,{0xf0,0x90,0x75,0x0d,0xe0,0x24,0x2a,0xf0,0x90,0x75,0x0c,0xe0,0x34,0x5a,0xf0,0xe0}},
+ {16,0x33df,0,{0xfe,0xa3,0xe0,0x78,0x05,0xce,0xa2,0xe7,0x13,0xce,0x13,0xd8,0xf8,0xff,0x90,0x75}},
+ {16,0x33ef,0,{0x0c,0xee,0xf0,0xa3,0xef,0xf0,0x90,0x72,0x2c,0xee,0xf0,0xa3,0xef,0xf0,0xd3,0x94}},
+ {16,0x33ff,0,{0xd2,0xee,0x64,0x80,0x94,0x82,0x40,0x0a,0x90,0x72,0x2c,0x74,0x02,0xf0,0xa3,0x74}},
+ {16,0x340f,0,{0xd2,0xf0,0xc3,0x90,0x72,0x2c,0xe0,0x64,0x80,0x94,0x80,0x50,0x04,0xe4,0xf0,0xa3}},
+ {16,0x341f,0,{0xf0,0x90,0x72,0x2c,0xe0,0xfe,0xa3,0xe0,0x24,0x3a,0xf5,0x82,0xee,0x34,0x72,0xf5}},
+ {16,0x342f,0,{0x83,0xe0,0x90,0x72,0x02,0xf0,0x90,0x72,0x04,0xe0,0xff,0x24,0xfd,0x60,0x2d,0x24}},
+ {16,0x343f,0,{0xfe,0x60,0x29,0x24,0x03,0x24,0xfb,0x50,0x04,0x60,0x21,0x80,0x40,0x90,0x72,0x02}},
+ {16,0x344f,0,{0xe0,0xfe,0x74,0x20,0x2f,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xee,0xf0,0x74,0x28}},
+ {16,0x345f,0,{0x2f,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xee,0xf0,0x80,0x21,0x90,0x72,0x02,0xe0}},
+ {16,0x346f,0,{0xff,0x90,0x72,0x04,0xe0,0xfe,0x24,0x30,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xef}},
+ {16,0x347f,0,{0xf0,0x74,0x38,0x2e,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xef,0xf0,0x90,0x72,0x39}},
+ {11,0x348f,0,{0xe0,0x04,0xf0,0xe0,0x64,0x0a,0x60,0x02,0x41,0xc7,0x22}},
+ {16,0x349a,0,{0x90,0x76,0x18,0xe0,0xff,0xb4,0x05,0x23,0x90,0x72,0x37,0xe0,0x70,0x1d,0x90,0x75}},
+ {16,0x34aa,0,{0xad,0xe0,0x90,0x72,0x2b,0xf0,0xe0,0x24,0x80,0xf0,0xe0,0x90,0x80,0x20,0xf0,0x90}},
+ {16,0x34ba,0,{0x80,0x31,0xf0,0x90,0x80,0x28,0xf0,0x90,0x80,0x39,0xf0,0xef,0x64,0x06,0x60,0x02}},
+ {16,0x34ca,0,{0xc1,0x91,0x90,0x72,0x36,0xe0,0x60,0x02,0xc1,0x91,0x90,0x76,0x40,0xe0,0x70,0x31}},
+ {16,0x34da,0,{0x90,0x72,0x03,0x74,0x03,0xf0,0x90,0x72,0x03,0xe0,0xff,0x75,0xf0,0x0a,0xa4,0x24}},
+ {16,0x34ea,0,{0xaa,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x72,0x29,0xe0,0xfd,0xee}},
+ {16,0x34fa,0,{0x6d,0x60,0x0e,0xef,0xc3,0x94,0x0a,0x50,0x08,0x90,0x72,0x03,0xe0,0x04,0xf0,0x80}},
+ {16,0x350a,0,{0xd5,0x90,0x72,0x39,0x74,0x04,0xf0,0x90,0x76,0x40,0xe0,0x70,0x08,0x90,0x72,0x03}},
+ {16,0x351a,0,{0xe0,0x90,0x72,0x39,0xf0,0x90,0x72,0x39,0xe0,0xfd,0x24,0xfe,0x90,0x72,0x2a,0xf0}},
+ {16,0x352a,0,{0xed,0x75,0xf0,0x0a,0xa4,0x24,0xad,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xff}},
+ {16,0x353a,0,{0x7e,0x00,0x90,0x75,0x0c,0xee,0xf0,0xa3,0xef,0xf0,0x70,0x06,0x90,0x72,0x02,0x74}},
+ {16,0x354a,0,{0x80,0xf0,0x90,0x75,0x0c,0xe0,0xfe,0xa3,0xe0,0xff,0x64,0x80,0x4e,0x70,0x04,0x90}},
+ {16,0x355a,0,{0x72,0x02,0xf0,0xef,0x4e,0x70,0x02,0xc1,0x1b,0xef,0x64,0x80,0x4e,0x70,0x02,0xc1}},
+ {16,0x356a,0,{0x1b,0xef,0xf8,0xe4,0x90,0x75,0x0d,0xf0,0xe8,0x90,0x75,0x0c,0xf0,0xed,0x75,0xf0}},
+ {16,0x357a,0,{0x0a,0xa4,0x24,0xac,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xff,0x90,0x72,0x02}},
+ {16,0x358a,0,{0xf0,0x90,0x75,0x0d,0xe0,0x2f,0xf0,0x90,0x75,0x0c,0xe0,0x34,0x00,0xf0,0xe0,0xfe}},
+ {16,0x359a,0,{0xa3,0xe0,0xff,0xe4,0xfc,0xfd,0x7b,0xd6,0x7a,0xa5,0xf9,0xf8,0xd3,0x12,0x37,0x95}},
+ {16,0x35aa,0,{0x40,0x0a,0x90,0x75,0x0c,0x74,0xa5,0xf0,0xa3,0x74,0xd6,0xf0,0x90,0x75,0x0d,0xe0}},
+ {16,0x35ba,0,{0x24,0x2a,0xf0,0x90,0x75,0x0c,0xe0,0x34,0x5a,0xf0,0xe0,0xfe,0xa3,0xe0,0x78,0x05}},
+ {16,0x35ca,0,{0xce,0xa2,0xe7,0x13,0xce,0x13,0xd8,0xf8,0xff,0x90,0x75,0x0c,0xee,0xf0,0xa3,0xef}},
+ {16,0x35da,0,{0xf0,0x90,0x72,0x2c,0xee,0xf0,0xa3,0xef,0xf0,0xd3,0x94,0xd2,0xee,0x64,0x80,0x94}},
+ {16,0x35ea,0,{0x82,0x40,0x0a,0x90,0x72,0x2c,0x74,0x02,0xf0,0xa3,0x74,0xd2,0xf0,0xc3,0x90,0x72}},
+ {16,0x35fa,0,{0x2c,0xe0,0x64,0x80,0x94,0x80,0x50,0x04,0xe4,0xf0,0xa3,0xf0,0x90,0x72,0x2c,0xe0}},
+ {16,0x360a,0,{0xfe,0xa3,0xe0,0x24,0x3a,0xf5,0x82,0xee,0x34,0x72,0xf5,0x83,0xe0,0x90,0x72,0x02}},
+ {16,0x361a,0,{0xf0,0x90,0x72,0x2a,0xe0,0xff,0x24,0xfd,0x60,0x2d,0x24,0xfe,0x60,0x29,0x24,0x03}},
+ {16,0x362a,0,{0x24,0xfb,0x50,0x04,0x60,0x21,0x80,0x40,0x90,0x72,0x02,0xe0,0xfe,0x74,0x20,0x2f}},
+ {16,0x363a,0,{0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xee,0xf0,0x74,0x28,0x2f,0xf5,0x82,0xe4,0x34}},
+ {16,0x364a,0,{0x80,0xf5,0x83,0xee,0xf0,0x80,0x21,0x90,0x72,0x02,0xe0,0xff,0x90,0x72,0x2a,0xe0}},
+ {16,0x365a,0,{0xfe,0x24,0x30,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xef,0xf0,0x74,0x38,0x2e,0xf5}},
+ {16,0x366a,0,{0x82,0xe4,0x34,0x80,0xf5,0x83,0xef,0xf0,0x90,0x76,0x40,0xe0,0x70,0x06,0x90,0x72}},
+ {16,0x367a,0,{0x39,0x74,0x0a,0xf0,0x90,0x72,0x39,0xe0,0x04,0xf0,0xe0,0xc3,0x94,0x0a,0x50,0x02}},
+ { 8,0x368a,0,{0xa1,0x11,0xe4,0x90,0x76,0x40,0xf0,0x22}},
+ {16,0x3692,0,{0xbb,0x01,0x06,0x89,0x82,0x8a,0x83,0xe0,0x22,0x50,0x02,0xe7,0x22,0xbb,0xfe,0x02}},
+ { 9,0x36a2,0,{0xe3,0x22,0x89,0x82,0x8a,0x83,0xe4,0x93,0x22}},
+ {16,0x36ab,0,{0xbb,0x01,0x0c,0xe5,0x82,0x29,0xf5,0x82,0xe5,0x83,0x3a,0xf5,0x83,0xe0,0x22,0x50}},
+ {16,0x36bb,0,{0x06,0xe9,0x25,0x82,0xf8,0xe6,0x22,0xbb,0xfe,0x06,0xe9,0x25,0x82,0xf8,0xe2,0x22}},
+ {13,0x36cb,0,{0xe5,0x82,0x29,0xf5,0x82,0xe5,0x83,0x3a,0xf5,0x83,0xe4,0x93,0x22}},
+ {16,0x36d8,0,{0xc2,0xd5,0xec,0x30,0xe7,0x09,0xb2,0xd5,0xe4,0xc3,0x9d,0xfd,0xe4,0x9c,0xfc,0xee}},
+ {16,0x36e8,0,{0x30,0xe7,0x15,0xb2,0xd5,0xe4,0xc3,0x9f,0xff,0xe4,0x9e,0xfe,0x12,0x38,0x1f,0xc3}},
+ {16,0x36f8,0,{0xe4,0x9d,0xfd,0xe4,0x9c,0xfc,0x80,0x03,0x12,0x38,0x1f,0x30,0xd5,0x07,0xc3,0xe4}},
+ { 6,0x3708,0,{0x9f,0xff,0xe4,0x9e,0xfe,0x22}},
+ {16,0x370e,0,{0xbb,0x01,0x10,0xe5,0x82,0x29,0xf5,0x82,0xe5,0x83,0x3a,0xf5,0x83,0xe0,0xf5,0xf0}},
+ {16,0x371e,0,{0xa3,0xe0,0x22,0x50,0x09,0xe9,0x25,0x82,0xf8,0x86,0xf0,0x08,0xe6,0x22,0xbb,0xfe}},
+ {16,0x372e,0,{0x0a,0xe9,0x25,0x82,0xf8,0xe2,0xf5,0xf0,0x08,0xe2,0x22,0xe5,0x83,0x2a,0xf5,0x83}},
+ { 8,0x373e,0,{0xe9,0x93,0xf5,0xf0,0xa3,0xe9,0x93,0x22}},
+ {16,0x3746,0,{0xe8,0x8f,0xf0,0xa4,0xcc,0x8b,0xf0,0xa4,0x2c,0xfc,0xe9,0x8e,0xf0,0xa4,0x2c,0xfc}},
+ {16,0x3756,0,{0x8a,0xf0,0xed,0xa4,0x2c,0xfc,0xea,0x8e,0xf0,0xa4,0xcd,0xa8,0xf0,0x8b,0xf0,0xa4}},
+ {16,0x3766,0,{0x2d,0xcc,0x38,0x25,0xf0,0xfd,0xe9,0x8f,0xf0,0xa4,0x2c,0xcd,0x35,0xf0,0xfc,0xeb}},
+ {16,0x3776,0,{0x8e,0xf0,0xa4,0xfe,0xa9,0xf0,0xeb,0x8f,0xf0,0xa4,0xcf,0xc5,0xf0,0x2e,0xcd,0x39}},
+ {15,0x3786,0,{0xfe,0xe4,0x3c,0xfc,0xea,0xa4,0x2d,0xce,0x35,0xf0,0xfd,0xe4,0x3c,0xfc,0x22}},
+ {16,0x3795,0,{0xeb,0x9f,0xf5,0xf0,0xea,0x9e,0x42,0xf0,0xe9,0x9d,0x42,0xf0,0xec,0x64,0x80,0xc8}},
+ { 6,0x37a5,0,{0x64,0x80,0x98,0x45,0xf0,0x22}},
+ {16,0x37ab,0,{0xeb,0x9f,0xf5,0xf0,0xea,0x9e,0x42,0xf0,0xe9,0x9d,0x42,0xf0,0xe8,0x9c,0x45,0xf0}},
+ { 1,0x37bb,0,{0x22}},
+ {12,0x37bc,0,{0xec,0xf0,0xa3,0xed,0xf0,0xa3,0xee,0xf0,0xa3,0xef,0xf0,0x22}},
+ {16,0x37c8,0,{0xa8,0x82,0x85,0x83,0xf0,0xd0,0x83,0xd0,0x82,0x12,0x37,0xdf,0x12,0x37,0xdf,0x12}},
+ {16,0x37d8,0,{0x37,0xdf,0x12,0x37,0xdf,0xe4,0x73,0xe4,0x93,0xa3,0xc5,0x83,0xc5,0xf0,0xc5,0x83}},
+ {16,0x37e8,0,{0xc8,0xc5,0x82,0xc8,0xf0,0xa3,0xc5,0x83,0xc5,0xf0,0xc5,0x83,0xc8,0xc5,0x82,0xc8}},
+ { 1,0x37f8,0,{0x22}},
+ {16,0x37f9,0,{0xd0,0x83,0xd0,0x82,0xf8,0xe4,0x93,0x70,0x12,0x74,0x01,0x93,0x70,0x0d,0xa3,0xa3}},
+ {16,0x3809,0,{0x93,0xf8,0x74,0x01,0x93,0xf5,0x82,0x88,0x83,0xe4,0x73,0x74,0x02,0x93,0x68,0x60}},
+ { 6,0x3819,0,{0xef,0xa3,0xa3,0xa3,0x80,0xdf}},
+ {16,0x381f,0,{0xbc,0x00,0x0b,0xbe,0x00,0x29,0xef,0x8d,0xf0,0x84,0xff,0xad,0xf0,0x22,0xe4,0xcc}},
+ {16,0x382f,0,{0xf8,0x75,0xf0,0x08,0xef,0x2f,0xff,0xee,0x33,0xfe,0xec,0x33,0xfc,0xee,0x9d,0xec}},
+ {16,0x383f,0,{0x98,0x40,0x05,0xfc,0xee,0x9d,0xfe,0x0f,0xd5,0xf0,0xe9,0xe4,0xce,0xfd,0x22,0xed}},
+ {16,0x384f,0,{0xf8,0xf5,0xf0,0xee,0x84,0x20,0xd2,0x1c,0xfe,0xad,0xf0,0x75,0xf0,0x08,0xef,0x2f}},
+ {16,0x385f,0,{0xff,0xed,0x33,0xfd,0x40,0x07,0x98,0x50,0x06,0xd5,0xf0,0xf2,0x22,0xc3,0x98,0xfd}},
+ { 5,0x386f,0,{0x0f,0xd5,0xf0,0xea,0x22}},
+ {16,0x3874,0,{0xe4,0x90,0x76,0x29,0xf0,0x90,0x76,0x29,0xe0,0xff,0x75,0xf0,0x0f,0xa4,0x24,0x42}},
+ {16,0x3884,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xec,0xe0,0xfd,0xee,0x6d}},
+ {16,0x3894,0,{0x60,0x0e,0xef,0xc3,0x94,0x06,0x50,0x08,0x90,0x76,0x29,0xe0,0x04,0xf0,0x80,0xd5}},
+ {16,0x38a4,0,{0xef,0xb4,0x06,0x08,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0xef,0x75,0xf0,0x0f}},
+ {16,0x38b4,0,{0xa4,0x24,0x41,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x76,0x2a,0xf0,0x24}},
+ {16,0x38c4,0,{0xbf,0x70,0x02,0x41,0x41,0x24,0xe0,0x70,0x02,0x41,0x12,0x24,0x21,0x60,0x02,0x41}},
+ {16,0x38d4,0,{0x3a,0x90,0x7f,0xe9,0xe0,0x24,0xfe,0x60,0x7d,0x14,0x70,0x02,0x21,0xb2,0x24,0x02}},
+ {16,0x38e4,0,{0x60,0x02,0x41,0x0a,0x12,0x17,0x51,0x90,0x76,0x42,0xe0,0xfc,0xa3,0xe0,0xfd,0xa3}},
+ {16,0x38f4,0,{0xe0,0xfe,0xa3,0xe0,0xff,0x90,0x76,0x29,0xe0,0x75,0xf0,0x0f,0xa4,0x24,0x43,0xf5}},
+ {16,0x3904,0,{0x82,0xe4,0x34,0x75,0xf5,0x83,0x12,0x37,0xbc,0x90,0x76,0x19,0xe0,0xff,0xb4,0x01}},
+ {16,0x3914,0,{0x12,0x90,0x76,0x7c,0x74,0x67,0xf0,0x90,0x76,0x7d,0x74,0x06,0xf0,0x90,0x76,0x7e}},
+ {16,0x3924,0,{0x74,0x0b,0xf0,0xef,0xb4,0x02,0x0f,0xe4,0x90,0x76,0x7c,0xf0,0x90,0x76,0x7d,0xf0}},
+ {16,0x3934,0,{0x90,0x76,0x7e,0x74,0x0c,0xf0,0xef,0xb4,0x03,0x0f,0xe4,0x90,0x76,0x7c,0xf0,0x90}},
+ {16,0x3944,0,{0x76,0x7d,0xf0,0x90,0x76,0x7e,0x74,0x18,0xf0,0x90,0x76,0x1a,0x74,0x01,0xf0,0x12}},
+ {16,0x3954,0,{0x3e,0x8f,0x12,0x18,0x00,0x22,0x90,0x7e,0xc2,0xe0,0xff,0xe4,0xfc,0xfd,0xfe,0xfb}},
+ {16,0x3964,0,{0xfa,0x79,0x01,0xf8,0x12,0x37,0x46,0xc8,0xec,0xc8,0xc9,0xed,0xc9,0xca,0xee,0xca}},
+ {16,0x3974,0,{0xcb,0xef,0xcb,0x90,0x7e,0xc1,0xe0,0xfe,0xe4,0xfc,0xfd,0x2b,0xfb,0xea,0x3e,0xfa}},
+ {16,0x3984,0,{0xed,0x39,0xf9,0xec,0x38,0xf8,0x90,0x7e,0xc0,0xe0,0xff,0xe4,0xfe,0xeb,0x2f,0xff}},
+ {16,0x3994,0,{0xee,0x3a,0xfe,0xed,0x39,0xfd,0xec,0x38,0xfc,0x90,0x76,0x29,0xe0,0x75,0xf0,0x0f}},
+ {16,0x39a4,0,{0xa4,0x24,0x47,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x12,0x37,0xbc,0x22,0x90,0x7e}},
+ {16,0x39b4,0,{0xc2,0xe0,0xff,0xe4,0xfc,0xfd,0xfe,0xfb,0xfa,0x79,0x01,0xf8,0x12,0x37,0x46,0xc8}},
+ {16,0x39c4,0,{0xec,0xc8,0xc9,0xed,0xc9,0xca,0xee,0xca,0xcb,0xef,0xcb,0x90,0x7e,0xc1,0xe0,0xfe}},
+ {16,0x39d4,0,{0xe4,0xfc,0xfd,0x2b,0xfb,0xea,0x3e,0xfa,0xed,0x39,0xf9,0xec,0x38,0xf8,0x90,0x7e}},
+ {16,0x39e4,0,{0xc0,0xe0,0xff,0xe4,0xfe,0xeb,0x2f,0xff,0xee,0x3a,0xfe,0xed,0x39,0xfd,0xec,0x38}},
+ {16,0x39f4,0,{0xfc,0x90,0x76,0x29,0xe0,0x75,0xf0,0x0f,0xa4,0x24,0x4b,0xf5,0x82,0xe4,0x34,0x75}},
+ {16,0x3a04,0,{0xf5,0x83,0x12,0x37,0xbc,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f}},
+ {16,0x3a14,0,{0xe9,0xe0,0x14,0x70,0x19,0x90,0x7e,0xc0,0xe0,0xff,0x90,0x76,0x29,0xe0,0x75,0xf0}},
+ {16,0x3a24,0,{0x0f,0xa4,0x24,0x4f,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef,0xf0,0x22,0x90,0x7f}},
+ {14,0x3a34,0,{0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22}},
+ {16,0x3a42,0,{0xe4,0x90,0x76,0x35,0xf0,0x90,0x76,0x35,0xe0,0xff,0xc3,0x94,0x03,0x40,0x02,0x41}},
+ {16,0x3a52,0,{0xff,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xaa,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xef}},
+ {16,0x3a62,0,{0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xab,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe4}},
+ {16,0x3a72,0,{0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xac,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74}},
+ {16,0x3a82,0,{0xf0,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xad,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83}},
+ {16,0x3a92,0,{0x74,0xff,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xae,0xf5,0x82,0xe4,0x34,0x75,0xf5}},
+ {16,0x3aa2,0,{0x83,0xe4,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xaf,0xf5,0x82,0xe4,0x34,0x75,0xf5}},
+ {16,0x3ab2,0,{0x83,0x74,0x80,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xb0,0xf5,0x82,0xe4,0x34,0x75}},
+ {16,0x3ac2,0,{0xf5,0x83,0xe4,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xb1,0xf5,0x82,0xe4,0x34,0x75}},
+ {16,0x3ad2,0,{0xf5,0x83,0xe4,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xb2,0xf5,0x82,0xe4,0x34,0x75}},
+ {16,0x3ae2,0,{0xf5,0x83,0xe4,0xf0,0xef,0x75,0xf0,0x0a,0xa4,0x24,0xb3,0xf5,0x82,0xe4,0x34,0x75}},
+ {16,0x3af2,0,{0xf5,0x83,0x74,0x01,0xf0,0x90,0x76,0x35,0xe0,0x04,0xf0,0x41,0x47,0x90,0x76,0x3c}},
+ {16,0x3b02,0,{0x74,0x0a,0xf0,0xe4,0xa3,0xf0,0x90,0x76,0x35,0x74,0x03,0xf0,0x90,0x76,0x3c,0xe0}},
+ {16,0x3b12,0,{0xff,0x90,0x76,0x35,0xe0,0xfe,0xc3,0x9f,0x40,0x02,0x61,0xd2,0x90,0x76,0x3d,0xe0}},
+ {16,0x3b22,0,{0xff,0x04,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xaa,0xf5,0x82,0xe4,0x34,0x75,0xf5}},
+ {16,0x3b32,0,{0x83,0xef,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xab,0xf5,0x82,0xe4,0x34,0x75,0xf5}},
+ {16,0x3b42,0,{0x83,0xe4,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xac,0xf5,0x82,0xe4,0x34,0x75,0xf5}},
+ {16,0x3b52,0,{0x83,0x74,0x5e,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xad,0xf5,0x82,0xe4,0x34,0x75}},
+ {16,0x3b62,0,{0xf5,0x83,0x74,0xba,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xae,0xf5,0x82,0xe4,0x34}},
+ {16,0x3b72,0,{0x75,0xf5,0x83,0x74,0x05,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xaf,0xf5,0x82,0xe4}},
+ {16,0x3b82,0,{0x34,0x75,0xf5,0x83,0x74,0x80,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xb0,0xf5,0x82}},
+ {16,0x3b92,0,{0xe4,0x34,0x75,0xf5,0x83,0xe4,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xb1,0xf5,0x82}},
+ {16,0x3ba2,0,{0xe4,0x34,0x75,0xf5,0x83,0xe4,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xb2,0xf5,0x82}},
+ {16,0x3bb2,0,{0xe4,0x34,0x75,0xf5,0x83,0x74,0x15,0xf0,0xee,0x75,0xf0,0x0a,0xa4,0x24,0xb3,0xf5}},
+ {16,0x3bc2,0,{0x82,0xe4,0x34,0x75,0xf5,0x83,0xe4,0xf0,0x90,0x76,0x35,0xe0,0x04,0xf0,0x61,0x0e}},
+ { 1,0x3bd2,0,{0x22}},
+ {16,0x3bd3,0,{0xe4,0x90,0x76,0x36,0xf0,0xe0,0xfb,0x75,0xf0,0x0f,0xa4,0x24,0x41,0xf5,0x82,0xe4}},
+ {16,0x3be3,0,{0x34,0x75,0xf5,0x83,0x74,0x40,0xf0,0xeb,0x75,0xf0,0x0f,0xa4,0x24,0x42,0xf5,0x82}},
+ {16,0x3bf3,0,{0xe4,0x34,0x75,0xf5,0x83,0x74,0x0a,0xf0,0xeb,0x75,0xf0,0x0f,0xa4,0x24,0x43,0xf5}},
+ {16,0x3c03,0,{0x82,0xe4,0x34,0x75,0xf5,0x83,0x12,0x37,0xc8,0x00,0x00,0xac,0x44,0xeb,0x75,0xf0}},
+ {16,0x3c13,0,{0x0f,0xa4,0x24,0x47,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x12,0x37,0xc8,0x00,0x00}},
+ {16,0x3c23,0,{0xac,0x44,0xeb,0x75,0xf0,0x0f,0xa4,0x24,0x4b,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83}},
+ {16,0x3c33,0,{0x12,0x37,0xc8,0x00,0x01,0x77,0x00,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xfb,0x75}},
+ {16,0x3c43,0,{0xf0,0x0f,0xa4,0x24,0x41,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x40,0xf0,0xeb}},
+ {16,0x3c53,0,{0x75,0xf0,0x0f,0xa4,0x24,0x42,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x8c,0xf0}},
+ {16,0x3c63,0,{0xeb,0x75,0xf0,0x0f,0xa4,0x24,0x43,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x12,0x37}},
+ {16,0x3c73,0,{0xc8,0x00,0x00,0xac,0x44,0xeb,0x75,0xf0,0x0f,0xa4,0x24,0x47,0xf5,0x82,0xe4,0x34}},
+ {16,0x3c83,0,{0x75,0xf5,0x83,0x12,0x37,0xc8,0x00,0x00,0xac,0x44,0xeb,0x75,0xf0,0x0f,0xa4,0x24}},
+ {16,0x3c93,0,{0x4b,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x12,0x37,0xc8,0x00,0x01,0x77,0x00,0x90}},
+ {16,0x3ca3,0,{0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75,0xf0,0x0f,0xa4,0x24,0x41,0xf5,0x82,0xe4}},
+ {16,0x3cb3,0,{0x34,0x75,0xf5,0x83,0x74,0x40,0xf0,0xef,0x75,0xf0,0x0f,0xa4,0x24,0x42,0xf5,0x82}},
+ {16,0x3cc3,0,{0xe4,0x34,0x75,0xf5,0x83,0x74,0x8f,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff}},
+ {16,0x3cd3,0,{0x75,0xf0,0x0f,0xa4,0x24,0x41,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x41,0xf0}},
+ {16,0x3ce3,0,{0xef,0x75,0xf0,0x0f,0xa4,0x24,0x42,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x84}},
+ {16,0x3cf3,0,{0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75,0xf0,0x0f,0xa4,0x24,0x41,0xf5}},
+ {16,0x3d03,0,{0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x61,0xf0,0xef,0x75,0xf0,0x0f,0xa4,0x24,0x42}},
+ {16,0x3d13,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x81,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0}},
+ {16,0x3d23,0,{0xe0,0xff,0x75,0xf0,0x0f,0xa4,0x24,0x41,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74}},
+ {16,0x3d33,0,{0x61,0xf0,0xef,0x75,0xf0,0x0f,0xa4,0x24,0x42,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83}},
+ { 4,0x3d43,0,{0x74,0x01,0xf0,0x22}},
+ {16,0x3d47,0,{0xc0,0xe0,0xc0,0xf0,0xc0,0x83,0xc0,0x82,0xc0,0xd0,0xe8,0xc0,0xe0,0xe9,0xc0,0xe0}},
+ {16,0x3d57,0,{0xea,0xc0,0xe0,0xeb,0xc0,0xe0,0xec,0xc0,0xe0,0xed,0xc0,0xe0,0xee,0xc0,0xe0,0xef}},
+ {16,0x3d67,0,{0xc0,0xe0,0x90,0x7f,0xa2,0xe0,0x90,0x76,0x7f,0xf0,0x90,0x7f,0x74,0xe0,0x90,0x76}},
+ {16,0x3d77,0,{0x87,0xf0,0x90,0x7f,0x75,0xe0,0x90,0x76,0x88,0xf0,0x90,0x7f,0x98,0xe0,0x44,0x02}},
+ {16,0x3d87,0,{0xf0,0x90,0x76,0x96,0xe0,0xff,0x20,0xe1,0x0c,0x44,0x02,0xf0,0x90,0x80,0x03,0xf0}},
+ {16,0x3d97,0,{0xd2,0x32,0x12,0x4a,0xc4,0x90,0x76,0x7f,0xe0,0x20,0xe2,0x50,0x90,0x76,0x87,0xe0}},
+ {16,0x3da7,0,{0xfe,0xa3,0xe0,0x7c,0x00,0x24,0x00,0xf5,0x34,0xec,0x3e,0xf5,0x33,0x90,0x76,0x98}},
+ {16,0x3db7,0,{0xe0,0xfd,0xae,0x33,0xaf,0x34,0x12,0x36,0xd8,0x90,0x76,0x87,0xef,0xf0,0xd2,0x2f}},
+ {16,0x3dc7,0,{0x30,0x31,0x29,0x20,0x3f,0x26,0xc2,0x31,0x90,0x7f,0x94,0xe0,0x54,0xcf,0xf0,0x90}},
+ {16,0x3dd7,0,{0x7f,0x9a,0xe0,0x30,0xe4,0x04,0xd2,0x2d,0xc2,0x2c,0x90,0x7f,0x9a,0xe0,0x20,0xe5}},
+ {16,0x3de7,0,{0x04,0xc2,0x2d,0xd2,0x2c,0x90,0x7f,0x94,0xe0,0x44,0x30,0xf0,0x12,0x4a,0x50,0x12}},
+ {16,0x3df7,0,{0x1b,0x04,0x30,0x2f,0x12,0x12,0x42,0x16,0xc2,0x2f,0x75,0xe8,0x01,0x12,0x16,0x8a}},
+ {16,0x3e07,0,{0x75,0xe8,0x0d,0xd2,0x2b,0x80,0x05,0x75,0xe8,0x01,0xc2,0x2b,0x20,0x2b,0x34,0x90}},
+ {16,0x3e17,0,{0x76,0x19,0xe0,0xff,0xb4,0x01,0x0e,0x90,0x76,0x7c,0x74,0x67,0xf0,0xa3,0x74,0x06}},
+ {16,0x3e27,0,{0xf0,0xa3,0x74,0x0b,0xf0,0xef,0xb4,0x02,0x0b,0x90,0x76,0x7c,0xe4,0xf0,0xa3,0xf0}},
+ {16,0x3e37,0,{0xa3,0x74,0x0c,0xf0,0xef,0xb4,0x03,0x0b,0x90,0x76,0x7c,0xe4,0xf0,0xa3,0xf0,0xa3}},
+ {16,0x3e47,0,{0x74,0x18,0xf0,0x75,0xca,0xd3,0x75,0xcb,0xfe,0xd2,0xca,0x30,0x34,0x04,0xc2,0x34}},
+ {16,0x3e57,0,{0x80,0x02,0xd2,0x34,0x53,0x91,0xef,0x90,0x7f,0xab,0x74,0x02,0xf0,0xf0,0x90,0x7f}},
+ {16,0x3e67,0,{0x98,0xe0,0x54,0xfd,0xf0,0xd0,0xe0,0xff,0xd0,0xe0,0xfe,0xd0,0xe0,0xfd,0xd0,0xe0}},
+ {16,0x3e77,0,{0xfc,0xd0,0xe0,0xfb,0xd0,0xe0,0xfa,0xd0,0xe0,0xf9,0xd0,0xe0,0xf8,0xd0,0xd0,0xd0}},
+ { 8,0x3e87,0,{0x82,0xd0,0x83,0xd0,0xf0,0xd0,0xe0,0x32}},
+ {16,0x3e8f,0,{0x90,0x76,0x92,0xe0,0x14,0x60,0x1d,0x14,0x70,0x02,0xe1,0x44,0x24,0x02,0x60,0x02}},
+ {16,0x3e9f,0,{0xe1,0xd4,0x90,0x76,0x94,0x74,0x01,0xf0,0x90,0x80,0x00,0xf0,0xe4,0x90,0x76,0x8e}},
+ {16,0x3eaf,0,{0xf0,0xd2,0x31,0x22,0x90,0x76,0x19,0xe0,0xff,0xb4,0x01,0x1b,0xe4,0x90,0x7f,0xf2}},
+ {16,0x3ebf,0,{0xf0,0x90,0x7f,0xf3,0x74,0x30,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x97}},
+ {16,0x3ecf,0,{0xe0,0x54,0xfd,0xf0,0x54,0xfb,0xf0,0xef,0xb4,0x02,0x1b,0xe4,0x90,0x7f,0xf2,0xf0}},
+ {16,0x3edf,0,{0x90,0x7f,0xf3,0x74,0x34,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x97,0xe0}},
+ {16,0x3eef,0,{0x44,0x02,0xf0,0x54,0xfb,0xf0,0xef,0xb4,0x03,0x18,0xe4,0x90,0x7f,0xf2,0xf0,0x90}},
+ {16,0x3eff,0,{0x7f,0xf3,0x74,0x64,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x97,0xe0,0x44}},
+ {16,0x3f0f,0,{0x04,0xf0,0x90,0x76,0x94,0xe0,0x44,0x01,0xf0,0x90,0x80,0x00,0xf0,0x30,0x3f,0x09}},
+ {16,0x3f1f,0,{0x90,0x76,0x97,0xe0,0x54,0xfe,0xf0,0x80,0x07,0x90,0x76,0x97,0xe0,0x44,0x01,0xf0}},
+ {16,0x3f2f,0,{0x90,0x76,0x97,0xe0,0x90,0x80,0x02,0xf0,0x90,0x76,0x98,0x74,0x04,0xf0,0x90,0x76}},
+ {16,0x3f3f,0,{0x8e,0x74,0x01,0xf0,0x22,0x90,0x76,0x19,0xe0,0xff,0xb4,0x01,0x1b,0xe4,0x90,0x7f}},
+ {16,0x3f4f,0,{0xf2,0xf0,0x90,0x7f,0xf3,0x74,0x44,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76}},
+ {16,0x3f5f,0,{0x97,0xe0,0x54,0xfd,0xf0,0x54,0xfb,0xf0,0xef,0xb4,0x02,0x1b,0xe4,0x90,0x7f,0xf2}},
+ {16,0x3f6f,0,{0xf0,0x90,0x7f,0xf3,0x74,0x4c,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x97}},
+ {16,0x3f7f,0,{0xe0,0x44,0x02,0xf0,0x54,0xfb,0xf0,0xef,0xb4,0x03,0x18,0xe4,0x90,0x7f,0xf2,0xf0}},
+ {16,0x3f8f,0,{0x90,0x7f,0xf3,0x74,0x94,0xf0,0x90,0x7f,0xff,0x74,0xfc,0xf0,0x90,0x76,0x97,0xe0}},
+ {16,0x3f9f,0,{0x44,0x04,0xf0,0x90,0x76,0x94,0xe0,0x54,0xfe,0xf0,0x90,0x80,0x00,0xf0,0x30,0x3f}},
+ {16,0x3faf,0,{0x09,0x90,0x76,0x97,0xe0,0x54,0xfe,0xf0,0x80,0x07,0x90,0x76,0x97,0xe0,0x44,0x01}},
+ {16,0x3fbf,0,{0xf0,0x90,0x76,0x97,0xe0,0x90,0x80,0x02,0xf0,0x90,0x76,0x98,0x74,0x06,0xf0,0x90}},
+ { 6,0x3fcf,0,{0x76,0x8e,0x74,0x02,0xf0,0x22}},
+ {16,0x3fd5,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xaa,0xe0,0x44,0x02,0xf0}},
+ {16,0x3fe5,0,{0x90,0x7f,0xc7,0xe0,0xf5,0x11,0x75,0x0f,0x00,0x75,0x0d,0x00,0xd2,0x33,0xd0,0x82}},
+ { 5,0x3ff5,0,{0xd0,0x83,0xd0,0xe0,0x32}},
+ { 6,0x3ffa,0,{0x12,0x4a,0xc4,0xc2,0x31,0x22}},
+ {16,0x4000,0,{0xe5,0x11,0xd3,0x94,0x00,0x50,0x02,0x21,0x06,0x90,0x76,0x89,0xe0,0xc3,0x94,0x08}},
+ {16,0x4010,0,{0x40,0x02,0x21,0x06,0x74,0x40,0x25,0x0f,0xf5,0x82,0xe4,0x34,0x7e,0xf5,0x83,0xe0}},
+ {16,0x4020,0,{0xf5,0x17,0xe5,0x0d,0x60,0x0e,0x90,0x80,0x05,0xe5,0x17,0xf0,0x90,0x76,0x89,0xe0}},
+ {16,0x4030,0,{0x04,0xf0,0x01,0xda,0xe5,0x17,0x12,0x37,0xf9,0x40,0xc1,0x02,0x40,0x67,0x05,0x40}},
+ {16,0x4040,0,{0x7a,0x06,0x40,0x98,0x07,0x40,0xc1,0x0c,0x40,0xc1,0x0d,0x40,0xc7,0x0f,0x40,0xcb}},
+ {16,0x4050,0,{0xf6,0x40,0xcb,0xf8,0x40,0xcb,0xfa,0x40,0xcb,0xfb,0x40,0xcb,0xfc,0x40,0xcb,0xfe}},
+ {16,0x4060,0,{0x40,0xcb,0xff,0x00,0x00,0x40,0xda,0x90,0x7e,0x41,0xe0,0x90,0x80,0x05,0xf0,0x90}},
+ {16,0x4070,0,{0x76,0x89,0xe0,0x04,0xf0,0x75,0x11,0x01,0x80,0x60,0x90,0x7e,0x41,0xe0,0x90,0x80}},
+ {16,0x4080,0,{0x05,0xf0,0x90,0x7e,0x42,0xe0,0x90,0x80,0x05,0xf0,0x90,0x76,0x89,0xe0,0x04,0xf0}},
+ {16,0x4090,0,{0xe0,0x04,0xf0,0x75,0x11,0x01,0x80,0x42,0x90,0x7e,0x41,0xe0,0x90,0x80,0x05,0xf0}},
+ {16,0x40a0,0,{0x90,0x7e,0x42,0xe0,0x90,0x80,0x05,0xf0,0x90,0x7e,0x43,0xe0,0x90,0x80,0x05,0xf0}},
+ {16,0x40b0,0,{0x90,0x76,0x89,0xe0,0x04,0xf0,0xe0,0x04,0xf0,0xe0,0x04,0xf0,0x75,0x11,0x01,0x80}},
+ {16,0x40c0,0,{0x19,0xd2,0x3b,0xd2,0x3c,0x80,0x13,0xd2,0x3b,0x80,0x0f,0x90,0x80,0x05,0xe5,0x17}},
+ {16,0x40d0,0,{0xf0,0x90,0x76,0x89,0xe0,0x04,0xf0,0x75,0x11,0x01,0x20,0x3b,0x04,0x05,0x0d,0x80}},
+ {16,0x40e0,0,{0x1f,0x30,0x3c,0x1c,0x90,0x7e,0x41,0xe0,0x90,0x80,0x05,0xf0,0x90,0x7e,0x42,0xe0}},
+ {16,0x40f0,0,{0x90,0x80,0x05,0xf0,0x90,0x76,0x89,0xe0,0x04,0xf0,0xe0,0x04,0xf0,0x75,0x11,0x01}},
+ {16,0x4100,0,{0x05,0x0f,0x15,0x11,0x01,0x00,0xe5,0x11,0x70,0x10,0xc2,0x33,0xf5,0x0d,0xf5,0x0f}},
+ {11,0x4110,0,{0x90,0x7f,0xc7,0x74,0x04,0xf0,0xc2,0x3b,0xc2,0x3c,0x22}},
+ {16,0x411b,0,{0x90,0x76,0x8d,0xe0,0x64,0x01,0x70,0x27,0x30,0x27,0x08,0xc2,0x27,0x12,0x08,0x00}},
+ {16,0x412b,0,{0x12,0x17,0x4a,0x30,0x28,0x08,0xc2,0x28,0x12,0x38,0x74,0x12,0x17,0x4a,0x30,0x2a}},
+ {16,0x413b,0,{0x0e,0xe4,0x90,0x76,0x8d,0xf0,0xc2,0x2a,0x90,0x7f,0xb4,0xe0,0x44,0x02,0xf0,0x90}},
+ {16,0x414b,0,{0x76,0x3f,0xe0,0xb4,0x01,0x05,0xe4,0xf0,0x12,0x32,0x6f,0x90,0x76,0x41,0xe0,0xb4}},
+ {16,0x415b,0,{0x01,0x05,0xe4,0xf0,0x12,0x34,0x9a,0x90,0x76,0x40,0xe0,0xb4,0x01,0x03,0x12,0x34}},
+ {16,0x416b,0,{0x9a,0x90,0x7f,0x9b,0xe0,0x20,0xe4,0x02,0xc2,0x3f,0x90,0x7f,0x9b,0xe0,0x30,0xe4}},
+ {16,0x417b,0,{0x02,0xd2,0x3f,0x90,0x7f,0x9b,0xe0,0x20,0xe5,0x02,0xc2,0x3e,0x90,0x7f,0x9b,0xe0}},
+ {16,0x418b,0,{0x30,0xe5,0x02,0xd2,0x3e,0xa2,0x41,0x30,0x3f,0x01,0xb3,0x50,0x1f,0xa2,0x3f,0x92}},
+ {16,0x419b,0,{0x41,0x30,0x3f,0x09,0x90,0x76,0x97,0xe0,0x54,0xfe,0xf0,0x80,0x07,0x90,0x76,0x97}},
+ {16,0x41ab,0,{0xe0,0x44,0x01,0xf0,0x90,0x76,0x97,0xe0,0x90,0x80,0x02,0xf0,0x30,0x3f,0x34,0x90}},
+ {16,0x41bb,0,{0x76,0x19,0xe0,0xff,0xb4,0x01,0x0e,0x90,0x76,0x7c,0x74,0x67,0xf0,0xa3,0x74,0x06}},
+ {16,0x41cb,0,{0xf0,0xa3,0x74,0x0b,0xf0,0xef,0xb4,0x02,0x0b,0xe4,0x90,0x76,0x7c,0xf0,0xa3,0xf0}},
+ {16,0x41db,0,{0xa3,0x74,0x0c,0xf0,0xef,0xb4,0x03,0x0b,0xe4,0x90,0x76,0x7c,0xf0,0xa3,0xf0,0xa3}},
+ {16,0x41eb,0,{0x74,0x18,0xf0,0xa2,0x40,0x30,0x3e,0x01,0xb3,0x50,0x1f,0xa2,0x3e,0x92,0x40,0x30}},
+ {16,0x41fb,0,{0x3e,0x09,0x90,0x76,0x95,0xe0,0x44,0x04,0xf0,0x80,0x07,0x90,0x76,0x95,0xe0,0x54}},
+ {11,0x420b,0,{0xfb,0xf0,0x90,0x76,0x95,0xe0,0x90,0x80,0x01,0xf0,0x22}},
+ {16,0x4216,0,{0x90,0x76,0x19,0xe0,0x64,0x01,0x70,0x35,0x90,0x76,0x87,0xe0,0xff,0xd3,0x94,0x2d}},
+ {16,0x4226,0,{0x40,0x2b,0x90,0x76,0x86,0x74,0x01,0xf0,0x90,0x76,0x85,0xe0,0x04,0xf0,0xe0,0xd3}},
+ {16,0x4236,0,{0x94,0x0f,0x40,0x19,0xe4,0xf0,0xef,0xd3,0x94,0x31,0x40,0x08,0x90,0x76,0x19,0x74}},
+ {16,0x4246,0,{0x03,0xf0,0x80,0x06,0x90,0x76,0x19,0x74,0x02,0xf0,0x12,0x3e,0x8f,0x90,0x76,0x19}},
+ {16,0x4256,0,{0xe0,0xb4,0x02,0x2c,0x90,0x76,0x87,0xe0,0xff,0xc3,0x94,0x2f,0x50,0x22,0xef,0xd3}},
+ {16,0x4266,0,{0x94,0x2a,0x40,0x1c,0x90,0x76,0x86,0x74,0x01,0xf0,0x90,0x76,0x85,0xe0,0x04,0xf0}},
+ {16,0x4276,0,{0xe0,0xd3,0x94,0x0f,0x40,0x0a,0xe4,0xf0,0x90,0x76,0x19,0x04,0xf0,0x12,0x3e,0x8f}},
+ {16,0x4286,0,{0x90,0x76,0x19,0xe0,0xb4,0x02,0x26,0x90,0x76,0x87,0xe0,0xd3,0x94,0x31,0x40,0x1d}},
+ {16,0x4296,0,{0x90,0x76,0x86,0x74,0x01,0xf0,0x90,0x76,0x85,0xe0,0x04,0xf0,0xe0,0xd3,0x94,0x0f}},
+ {16,0x42a6,0,{0x40,0x0b,0xe4,0xf0,0x90,0x76,0x19,0x74,0x03,0xf0,0x12,0x3e,0x8f,0x90,0x76,0x19}},
+ {16,0x42b6,0,{0xe0,0x64,0x03,0x70,0x3f,0x90,0x76,0x87,0xe0,0xff,0xc3,0x94,0x5f,0x50,0x35,0x90}},
+ {16,0x42c6,0,{0x76,0x86,0x74,0x01,0xf0,0x90,0x76,0x85,0xe0,0x04,0xf0,0xe0,0xd3,0x94,0x0f,0x40}},
+ {16,0x42d6,0,{0x23,0xe4,0xf0,0xef,0xc3,0x94,0x2f,0x50,0x0c,0xef,0xd3,0x94,0x2a,0x40,0x06,0x90}},
+ {16,0x42e6,0,{0x76,0x19,0x74,0x01,0xf0,0xef,0xd3,0x94,0x2f,0x40,0x06,0x90,0x76,0x19,0x74,0x02}},
+ {16,0x42f6,0,{0xf0,0x12,0x3e,0x8f,0x90,0x76,0x86,0xe0,0x70,0x05,0x90,0x76,0x85,0xf0,0x22,0xe4}},
+ { 5,0x4306,0,{0x90,0x76,0x86,0xf0,0x22}},
+ {16,0x430b,0,{0xe4,0x90,0x76,0x96,0xf0,0x90,0x80,0x03,0xf0,0x90,0x7f,0xe0,0x74,0x90,0xf0,0x90}},
+ {16,0x431b,0,{0x7f,0xe1,0x74,0x04,0xf0,0xe4,0x90,0x7f,0xdd,0xf0,0x90,0x7f,0xa1,0xf0,0x53,0x8e}},
+ {16,0x432b,0,{0xf8,0x75,0x88,0x05,0x75,0xb8,0x20,0x75,0xf8,0x01,0x43,0x8e,0x30,0xf5,0xc8,0x75}},
+ {16,0x433b,0,{0xca,0x7f,0x75,0xcb,0xf8,0x43,0xa8,0x20,0x12,0x07,0x4a,0xc2,0x2c,0xc2,0x2d,0xc2}},
+ {16,0x434b,0,{0x2b,0xc2,0x2f,0x90,0x7f,0xfc,0x74,0xdd,0xf0,0x90,0x7f,0xff,0x74,0xff,0xf0,0x90}},
+ {16,0x435b,0,{0x7f,0x97,0xe0,0x44,0x01,0xf0,0x90,0x76,0x19,0x74,0x01,0xf0,0xe4,0x90,0x76,0x85}},
+ {16,0x436b,0,{0xf0,0xa3,0xf0,0x90,0x76,0x81,0xf0,0x90,0x76,0x80,0xf0,0x12,0x49,0x58,0x12,0x0f}},
+ {16,0x437b,0,{0xc6,0x12,0x4a,0x8d,0x90,0x7f,0x97,0xe0,0x44,0x08,0xf0,0xe0,0x54,0xb9,0xf0,0xd2}},
+ {16,0x438b,0,{0x30,0x20,0x30,0x18,0x12,0x47,0xb4,0x12,0x30,0x00,0x12,0x40,0x00,0x12,0x42,0x16}},
+ {16,0x439b,0,{0x12,0x4a,0x50,0x12,0x1b,0x04,0x12,0x16,0x61,0x12,0x42,0x16,0xc2,0x2f,0xc2,0x31}},
+ {16,0x43ab,0,{0xc2,0x32,0xc2,0x34,0xc2,0x33,0xc2,0x29,0xc2,0x27,0xc2,0x28,0xe4,0xf5,0x11,0x90}},
+ {16,0x43bb,0,{0x76,0x89,0xf0,0x90,0x76,0x3f,0xf0,0x90,0x76,0x41,0xf0,0x90,0x76,0x40,0xf0,0x90}},
+ {16,0x43cb,0,{0x76,0x8a,0xf0,0xa3,0xf0,0xa3,0x04,0xf0,0xe4,0xa3,0xf0,0x90,0x76,0x99,0xf0,0x22}},
+ {16,0x43db,0,{0x12,0x4d,0xa3,0x40,0x02,0x81,0xa0,0x90,0x7f,0xeb,0xe0,0x24,0xfe,0x60,0x1e,0x14}},
+ {16,0x43eb,0,{0x60,0x46,0x14,0x60,0x6e,0x14,0x70,0x02,0x81,0x91,0x24,0x04,0x60,0x02,0x81,0x99}},
+ {16,0x43fb,0,{0x74,0x05,0x90,0x7f,0xd4,0xf0,0x74,0x00,0x90,0x7f,0xd5,0xf0,0x22,0x90,0x7f,0xea}},
+ {16,0x440b,0,{0xe0,0xff,0x12,0x49,0xff,0x8b,0x20,0x8a,0x21,0x89,0x22,0xea,0x49,0x60,0x11,0xce}},
+ {16,0x441b,0,{0xea,0xce,0xee,0x90,0x7f,0xd4,0xf0,0xcf,0xe9,0xcf,0xef,0x90,0x7f,0xd5,0xf0,0x22}},
+ {16,0x442b,0,{0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xea,0xe0,0xff,0x12,0x48,0xb0}},
+ {16,0x443b,0,{0x8b,0x20,0x8a,0x21,0x89,0x22,0xea,0x49,0x60,0x11,0xce,0xea,0xce,0xee,0x90,0x7f}},
+ {16,0x444b,0,{0xd4,0xf0,0xcf,0xe9,0xcf,0xef,0x90,0x7f,0xd5,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44}},
+ {16,0x445b,0,{0x01,0xf0,0x22,0x90,0x7f,0xea,0xe0,0xff,0x90,0x7e,0xc0,0xe0,0xfd,0xa3,0xe0,0xfb}},
+ {16,0x446b,0,{0x12,0x17,0x94,0x8b,0x20,0x8a,0x21,0x89,0x22,0xea,0x49,0x60,0x11,0xce,0xea,0xce}},
+ {16,0x447b,0,{0xee,0x90,0x7f,0xd4,0xf0,0xcf,0xe9,0xcf,0xef,0x90,0x7f,0xd5,0xf0,0x22,0x90,0x7f}},
+ {16,0x448b,0,{0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f}},
+ { 5,0x449b,0,{0xb4,0xe0,0x44,0x01,0xf0}},
+ { 1,0x44a0,0,{0x22}},
+ {16,0x44a1,0,{0xc2,0xaf,0xd2,0x24,0x90,0x7f,0x93,0x74,0x30,0xf0,0x90,0x7f,0x9c,0x74,0xbb,0xf0}},
+ {16,0x44b1,0,{0x90,0x7f,0x96,0xe0,0x44,0x30,0xf0,0xe0,0x54,0x30,0xf0,0x90,0x7f,0x94,0x74,0x30}},
+ {16,0x44c1,0,{0xf0,0x90,0x7f,0x9d,0x74,0xcf,0xf0,0x90,0x7f,0x97,0x74,0xa0,0xf0,0x90,0x7f,0x95}},
+ {16,0x44d1,0,{0x74,0xc0,0xf0,0x90,0x7f,0x9e,0x74,0x03,0xf0,0x90,0x7f,0x99,0xe0,0x30,0xe2,0x09}},
+ {16,0x44e1,0,{0x90,0x05,0x19,0x74,0xa0,0xf0,0xe4,0xa3,0xf0,0xc2,0x25,0xc2,0x22,0xc2,0x23,0xc2}},
+ {16,0x44f1,0,{0x26,0x12,0x4a,0xc4,0x12,0x2d,0xa9,0x12,0x3b,0xd3,0x12,0x45,0x59,0x12,0x3a,0x42}},
+ {16,0x4501,0,{0x90,0x76,0x68,0x74,0x01,0xf0,0x70,0x0f,0x12,0x4b,0xbb,0x12,0x07,0xfe,0x12,0x4d}},
+ {16,0x4511,0,{0xa1,0x12,0x1b,0x40,0x12,0x14,0x96,0x12,0x43,0x0b,0x90,0x7f,0xaf,0xe0,0x44,0x01}},
+ {16,0x4521,0,{0xf0,0x90,0x7f,0xae,0xe0,0x44,0x1f,0xf0,0x90,0x7f,0xac,0x74,0xff,0xf0,0x90,0x7f}},
+ {16,0x4531,0,{0xad,0xf0,0x90,0x7f,0xde,0xf0,0x90,0x7f,0xdf,0xf0,0x90,0x7f,0xab,0xf0,0x90,0x7f}},
+ {16,0x4541,0,{0xa9,0xf0,0x90,0x7f,0xaa,0xf0,0x53,0x91,0xef,0x43,0xd8,0x20,0xd2,0xe8,0x43,0xd8}},
+ { 8,0x4551,0,{0x20,0x53,0xa8,0xa0,0x43,0xa8,0x80,0x22}},
+ {16,0x4559,0,{0xe4,0x90,0x76,0x36,0xf0,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x32,0xf5,0x82,0xe4}},
+ {16,0x4569,0,{0x34,0x75,0xf5,0x83,0xe4,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x33,0xf5,0x82,0xe4}},
+ {16,0x4579,0,{0x34,0x75,0xf5,0x83,0x74,0x01,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75}},
+ {16,0x4589,0,{0xf0,0x03,0xa4,0x24,0x32,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe4,0xf0,0xef,0x75}},
+ {16,0x4599,0,{0xf0,0x03,0xa4,0x24,0x33,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x02,0xf0,0x90}},
+ {16,0x45a9,0,{0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x32,0xf5,0x82,0xe4}},
+ {16,0x45b9,0,{0x34,0x75,0xf5,0x83,0xe4,0xf0,0xef,0x75,0xf0,0x03,0xa4,0x24,0x33,0xf5,0x82,0xe4}},
+ {16,0x45c9,0,{0x34,0x75,0xf5,0x83,0x74,0x03,0xf0,0x90,0x76,0x36,0xe0,0x04,0xf0,0xe0,0xff,0x75}},
+ {16,0x45d9,0,{0xf0,0x03,0xa4,0x24,0x32,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe4,0xf0,0xef,0x75}},
+ {16,0x45e9,0,{0xf0,0x03,0xa4,0x24,0x33,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0x74,0x04,0xf0,0x22}},
+ {12,0x45f9,0,{0x78,0x7f,0xe4,0xf6,0xd8,0xfd,0x75,0x81,0x38,0x02,0x46,0x40}},
+ {16,0x4605,0,{0x02,0x47,0x5a,0xe4,0x93,0xa3,0xf8,0xe4,0x93,0xa3,0x40,0x03,0xf6,0x80,0x01,0xf2}},
+ {16,0x4615,0,{0x08,0xdf,0xf4,0x80,0x29,0xe4,0x93,0xa3,0xf8,0x54,0x07,0x24,0x0c,0xc8,0xc3,0x33}},
+ {16,0x4625,0,{0xc4,0x54,0x0f,0x44,0x20,0xc8,0x83,0x40,0x04,0xf4,0x56,0x80,0x01,0x46,0xf6,0xdf}},
+ {16,0x4635,0,{0xe4,0x80,0x0b,0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x90,0x0c,0x8f,0xe4,0x7e}},
+ {16,0x4645,0,{0x01,0x93,0x60,0xbc,0xa3,0xff,0x54,0x3f,0x30,0xe5,0x09,0x54,0x1f,0xfe,0xe4,0x93}},
+ {16,0x4655,0,{0xa3,0x60,0x01,0x0e,0xcf,0x54,0xc0,0x25,0xe0,0x60,0xa8,0x40,0xb8,0xe4,0x93,0xa3}},
+ {16,0x4665,0,{0xfa,0xe4,0x93,0xa3,0xf8,0xe4,0x93,0xa3,0xc8,0xc5,0x82,0xc8,0xca,0xc5,0x83,0xca}},
+ {16,0x4675,0,{0xf0,0xa3,0xc8,0xc5,0x82,0xc8,0xca,0xc5,0x83,0xca,0xdf,0xe9,0xde,0xe7,0x80,0xbe}},
+ {16,0x4685,0,{0x90,0x7f,0xec,0xe0,0x90,0x76,0x83,0xf0,0xe0,0x14,0x60,0x1d,0x14,0x60,0x2a,0x14}},
+ {16,0x4695,0,{0x60,0x37,0x14,0x60,0x44,0x24,0x04,0x70,0x50,0x90,0x76,0x91,0xe0,0x90,0x7f,0x00}},
+ {16,0x46a5,0,{0xf0,0x90,0x7f,0xb5,0x74,0x01,0xf0,0x80,0x47,0x90,0x76,0x92,0xe0,0x90,0x7f,0x00}},
+ {16,0x46b5,0,{0xf0,0x90,0x7f,0xb5,0x74,0x01,0xf0,0x80,0x37,0x90,0x76,0x90,0xe0,0x90,0x7f,0x00}},
+ {16,0x46c5,0,{0xf0,0x90,0x7f,0xb5,0x74,0x01,0xf0,0x80,0x27,0x90,0x76,0x84,0xe0,0x90,0x7f,0x00}},
+ {16,0x46d5,0,{0xf0,0x90,0x7f,0xb5,0x74,0x01,0xf0,0x80,0x17,0x90,0x76,0x93,0xe0,0x90,0x7f,0x00}},
+ {16,0x46e5,0,{0xf0,0x90,0x7f,0xb5,0x74,0x01,0xf0,0x80,0x07,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0}},
+ { 2,0x46f5,0,{0xd3,0x22}},
+ {16,0x46f7,0,{0xc0,0xe0,0xc0,0xf0,0xc0,0x83,0xc0,0x82,0xc0,0xd0,0xe8,0xc0,0xe0,0xe9,0xc0,0xe0}},
+ {16,0x4707,0,{0xea,0xc0,0xe0,0xeb,0xc0,0xe0,0xec,0xc0,0xe0,0xed,0xc0,0xe0,0xee,0xc0,0xe0,0xef}},
+ {16,0x4717,0,{0xc0,0xe0,0xc2,0xca,0xc2,0xcf,0x90,0x7f,0x98,0xe0,0x44,0x01,0xf0,0x30,0x2e,0x03}},
+ {16,0x4727,0,{0x12,0x14,0xa6,0x90,0x7f,0x98,0xe0,0x54,0xfe,0xf0,0x53,0xa8,0xfa,0x12,0x16,0x61}},
+ {16,0x4737,0,{0xd0,0xe0,0xff,0xd0,0xe0,0xfe,0xd0,0xe0,0xfd,0xd0,0xe0,0xfc,0xd0,0xe0,0xfb,0xd0}},
+ {16,0x4747,0,{0xe0,0xfa,0xd0,0xe0,0xf9,0xd0,0xe0,0xf8,0xd0,0xd0,0xd0,0x82,0xd0,0x83,0xd0,0xf0}},
+ { 3,0x4757,0,{0xd0,0xe0,0x32}},
+ {16,0x475a,0,{0xe4,0x90,0x76,0x66,0xf0,0x12,0x44,0xa1,0x20,0x26,0x13,0x90,0x76,0x66,0xe0,0xc3}},
+ {16,0x476a,0,{0x94,0x02,0x50,0x0a,0xe0,0x04,0xf0,0xd2,0x42,0x12,0x4a,0xf6,0x80,0xea,0x30,0x26}},
+ {16,0x477a,0,{0x05,0x12,0x28,0x01,0xc2,0x26,0x30,0x25,0x2b,0x90,0x76,0x96,0xe0,0x54,0xfc,0xf0}},
+ {16,0x478a,0,{0x90,0x80,0x03,0xf0,0x12,0x14,0x96,0x90,0x76,0x96,0xe0,0x44,0x03,0xf0,0x90,0x80}},
+ {16,0x479a,0,{0x03,0xf0,0xe4,0x90,0x76,0x67,0xf0,0x90,0x76,0x67,0xe0,0x04,0xf0,0xe0,0xb4,0x4b}},
+ {10,0x47aa,0,{0xf6,0x12,0x3f,0xfa,0x12,0x41,0x1b,0x80,0xc5,0x22}},
+ {16,0x47b4,0,{0xe4,0x90,0x76,0x9b,0xf0,0x90,0x76,0x9b,0xe0,0xff,0x04,0xf0,0xef,0x60,0x08,0xe0}},
+ {16,0x47c4,0,{0x24,0x08,0xf8,0xe4,0xf6,0x80,0xee,0x90,0x76,0x96,0xe0,0x54,0xfb,0xf0,0x54,0xf7}},
+ {16,0x47d4,0,{0xf0,0x90,0x80,0x03,0xf0,0xe4,0xf5,0x18,0xd2,0x35,0xf5,0x0e,0xf5,0x10,0xd2,0x36}},
+ {16,0x47e4,0,{0x75,0x12,0x11,0x75,0x13,0x22,0xc2,0x37,0xc2,0x39,0xc2,0x38,0xf5,0x16,0xf5,0x14}},
+ {11,0x47f4,0,{0xf5,0x1a,0xf5,0x0d,0xc2,0x3b,0xc2,0x3c,0xc2,0x3d,0x22}},
+ {16,0x4800,0,{0x90,0x7f,0xec,0xe0,0x90,0x76,0x83,0xf0,0xe0,0x14,0x60,0x17,0x14,0x60,0x21,0x14}},
+ {16,0x4810,0,{0x60,0x2b,0x14,0x60,0x32,0x24,0x04,0x70,0x38,0x90,0x7f,0xea,0xe0,0x90,0x76,0x91}},
+ {16,0x4820,0,{0xf0,0x80,0x35,0x90,0x7f,0xea,0xe0,0x90,0x76,0x92,0xf0,0x12,0x3e,0x8f,0x80,0x28}},
+ {16,0x4830,0,{0x90,0x7f,0xea,0xe0,0x90,0x76,0x90,0xf0,0x12,0x18,0x00,0x80,0x1b,0x90,0x7f,0xea}},
+ {16,0x4840,0,{0xe0,0x90,0x76,0x84,0xf0,0x80,0x11,0x90,0x7f,0xea,0xe0,0x90,0x76,0x93,0xf0,0x80}},
+ {10,0x4850,0,{0x07,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0xd3,0x22}},
+ {16,0x485a,0,{0xe4,0x90,0x76,0x26,0xf0,0x90,0x76,0x26,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x34}},
+ {16,0x486a,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xec,0xe0,0xfd,0xee,0x6d}},
+ {16,0x487a,0,{0x60,0x0e,0xef,0xc3,0x94,0x04,0x50,0x08,0x90,0x76,0x26,0xe0,0x04,0xf0,0x80,0xd5}},
+ {16,0x488a,0,{0xef,0xb4,0x04,0x08,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0xef,0x75,0xf0,0x03}},
+ {16,0x489a,0,{0xa4,0x24,0x32,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0x90,0x7f,0x00,0xf0,0x90}},
+ { 6,0x48aa,0,{0x7f,0xb5,0x74,0x01,0xf0,0x22}},
+ { 2,0x48b0,0,{0x8f,0x2e}},
+ {16,0x48b2,0,{0xe4,0xf5,0x2f,0x75,0x30,0xff,0x75,0x31,0x06,0x75,0x32,0xbe,0xab,0x30,0xaa,0x31}},
+ {16,0x48c2,0,{0xa9,0x32,0x90,0x00,0x01,0x12,0x36,0xab,0xb4,0x03,0x1f,0xaf,0x2f,0x05,0x2f,0xef}},
+ {16,0x48d2,0,{0x65,0x2e,0x70,0x01,0x22,0x12,0x36,0x92,0x7e,0x00,0x29,0xff,0xee,0x3a,0xc9,0xef}},
+ {16,0x48e2,0,{0xc9,0x75,0x30,0xff,0xf5,0x31,0x89,0x32,0x80,0xd2,0x7b,0x00,0x7a,0x00,0x79,0x00}},
+ { 1,0x48f2,0,{0x22}},
+ {12,0x48f3,0,{0xc2,0x37,0xe4,0xf5,0x0e,0xf5,0x10,0xc2,0x36,0xf5,0x14,0x22}},
+ {16,0x4900,0,{0x02,0x2f,0xe7,0x00,0x02,0x3d,0x47,0x00,0x02,0x4d,0x46,0x00,0x02,0x4b,0xd5,0x00}},
+ {16,0x4910,0,{0x02,0x4b,0x60,0x00,0x02,0x2f,0xff,0x00,0x02,0x4b,0xed,0x00,0x02,0x4b,0x81,0x00}},
+ {16,0x4920,0,{0x02,0x4c,0x04,0x00,0x02,0x3f,0xd5,0x00,0x02,0x4c,0x1b,0x00,0x02,0x4c,0x32,0x00}},
+ {16,0x4930,0,{0x02,0x4c,0x49,0x00,0x02,0x4c,0x60,0x00,0x02,0x4c,0x77,0x00,0x02,0x4c,0x8e,0x00}},
+ {16,0x4940,0,{0x02,0x4c,0xa5,0x00,0x02,0x4c,0xbc,0x00,0x02,0x4c,0xd3,0x00,0x02,0x4c,0xea,0x00}},
+ { 8,0x4950,0,{0x02,0x4d,0x01,0x00,0x02,0x4d,0x18,0x00}},
+ {16,0x4958,0,{0x90,0x76,0x46,0x74,0x80,0xf0,0xe4,0xa3,0xf0,0xa3,0xf0,0xa3,0xf0,0xa3,0xf0,0xa3}},
+ {16,0x4968,0,{0xf0,0xa3,0xf0,0xa3,0xf0,0xa3,0xf0,0xa3,0x74,0x80,0xf0,0xe4,0xa3,0xf0,0xa3,0xf0}},
+ {16,0x4978,0,{0xa3,0xf0,0xa3,0xf0,0xa3,0xf0,0xa3,0xf0,0xa3,0x74,0x40,0xf0,0xe4,0xa3,0xf0,0xa3}},
+ {16,0x4988,0,{0x74,0x40,0xf0,0xe4,0xa3,0xf0,0xa3,0xf0,0xa3,0xf0,0xa3,0xf0,0xa3,0xf0,0xa3,0xf0}},
+ {16,0x4998,0,{0xa3,0x74,0x40,0xf0,0xe4,0xa3,0xf0,0xa3,0x74,0x40,0xf0,0xe4,0xa3,0xf0,0xa3,0xf0}},
+ { 5,0x49a8,0,{0xa3,0xf0,0xa3,0xf0,0x22}},
+ {16,0x49ad,0,{0xe4,0x90,0x76,0x25,0xf0,0x90,0x76,0x25,0xe0,0xff,0x75,0xf0,0x03,0xa4,0x24,0x34}},
+ {16,0x49bd,0,{0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xe0,0xfe,0x90,0x7f,0xec,0xe0,0xfd,0xee,0x6d}},
+ {16,0x49cd,0,{0x60,0x0e,0xef,0xc3,0x94,0x04,0x50,0x08,0x90,0x76,0x25,0xe0,0x04,0xf0,0x80,0xd5}},
+ {16,0x49dd,0,{0xef,0xb4,0x04,0x08,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7e,0xc0,0xe0}},
+ {16,0x49ed,0,{0xfe,0xef,0x75,0xf0,0x03,0xa4,0x24,0x32,0xf5,0x82,0xe4,0x34,0x75,0xf5,0x83,0xee}},
+ { 2,0x49fd,0,{0xf0,0x22}},
+ {16,0x49ff,0,{0xe4,0xfe,0x75,0x1d,0xff,0x75,0x1e,0x05,0x75,0x1f,0x12,0xab,0x1d,0xaa,0x1e,0xa9}},
+ {16,0x4a0f,0,{0x1f,0x90,0x00,0x01,0x12,0x36,0xab,0x64,0x02,0x70,0x2f,0xcd,0xee,0xcd,0x0e,0xed}},
+ {16,0x4a1f,0,{0x6f,0x70,0x01,0x22,0x90,0x00,0x02,0x12,0x37,0x0e,0x85,0xf0,0x1b,0xf5,0x1c,0x62}},
+ {16,0x4a2f,0,{0x1b,0xe5,0x1b,0x62,0x1c,0xe5,0x1c,0x62,0x1b,0x29,0xfd,0xe5,0x1b,0x3a,0xc9,0xed}},
+ {16,0x4a3f,0,{0xc9,0x75,0x1d,0xff,0xf5,0x1e,0x89,0x1f,0x80,0xc1,0x7b,0x00,0x7a,0x00,0x79,0x00}},
+ { 1,0x4a4f,0,{0x22}},
+ {16,0x4a50,0,{0x30,0x2d,0x39,0xc2,0x2d,0x90,0x76,0x19,0xe0,0xff,0xb4,0x01,0x0d,0xe4,0x90,0x76}},
+ {16,0x4a60,0,{0x7c,0xf0,0xa3,0x74,0xf8,0xf0,0xa3,0x74,0x0a,0xf0,0xef,0xb4,0x02,0x0d,0xe4,0x90}},
+ {16,0x4a70,0,{0x76,0x7c,0xf0,0xa3,0x74,0xf0,0xf0,0xa3,0x74,0x0b,0xf0,0xef,0xb4,0x03,0x0d,0xe4}},
+ {13,0x4a80,0,{0x90,0x76,0x7c,0xf0,0xa3,0x74,0xf8,0xf0,0xa3,0x74,0x17,0xf0,0x22}},
+ {16,0x4a8d,0,{0xe4,0xff,0x74,0x56,0x2f,0xf5,0x82,0xe4,0x34,0x76,0xf5,0x83,0xe0,0xfe,0x74,0x28}},
+ {16,0x4a9d,0,{0x2f,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83,0xee,0xf0,0x74,0x5e,0x2f,0xf5,0x82,0xe4}},
+ {16,0x4aad,0,{0x34,0x76,0xf5,0x83,0xe0,0xfe,0x74,0x38,0x2f,0xf5,0x82,0xe4,0x34,0x80,0xf5,0x83}},
+ { 6,0x4abd,0,{0xee,0xf0,0x0f,0xbf,0x08,0xcc}},
+ { 1,0x4ac3,0,{0x22}},
+ {16,0x4ac4,0,{0xe4,0x90,0x72,0x36,0xf0,0xa3,0xf0,0x90,0x7f,0x97,0xe0,0x54,0xfb,0xf0,0xe4,0x90}},
+ {16,0x4ad4,0,{0x72,0x33,0xf0,0x90,0x72,0x32,0xf0,0x90,0x72,0x01,0x04,0xf0,0xe4,0x90,0x72,0x33}},
+ {16,0x4ae4,0,{0xf0,0x90,0x72,0x32,0xf0,0x90,0x72,0x01,0x04,0xf0,0x90,0x7f,0x97,0xe0,0x44,0x04}},
+ { 2,0x4af4,0,{0xf0,0x22}},
+ {16,0x4af6,0,{0x90,0x7f,0xd6,0xe0,0x54,0xfb,0xf0,0xe0,0x44,0x08,0xf0,0x30,0x42,0x04,0xe0,0x44}},
+ {16,0x4b06,0,{0x02,0xf0,0x7f,0xdc,0x7e,0x05,0x12,0x4d,0x2f,0x90,0x7f,0xd6,0xe0,0x54,0xf7,0xf0}},
+ { 5,0x4b16,0,{0xe0,0x44,0x04,0xf0,0x22}},
+ {16,0x4b1b,0,{0x90,0x7f,0xeb,0xe0,0x14,0x70,0x14,0x90,0x7f,0xe9,0xe0,0x24,0x7f,0x70,0x04,0x12}},
+ {16,0x4b2b,0,{0x48,0x5a,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44}},
+ { 3,0x4b3b,0,{0x01,0xf0,0x22}},
+ {16,0x4b3e,0,{0x90,0x7f,0xeb,0xe0,0x14,0x70,0x13,0x90,0x7f,0xe9,0xe0,0x14,0x70,0x04,0x12,0x49}},
+ {16,0x4b4e,0,{0xad,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x22,0x90,0x7f,0xb4,0xe0,0x44,0x01}},
+ { 2,0x4b5e,0,{0xf0,0x22}},
+ {16,0x4b60,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xab,0x74,0x10,0xf0,0x90}},
+ {16,0x4b70,0,{0x76,0x96,0xe0,0x54,0xfd,0xf0,0x90,0x80,0x03,0xf0,0xd0,0x82,0xd0,0x83,0xd0,0xe0}},
+ { 1,0x4b80,0,{0x32}},
+ {16,0x4b81,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xaa,0xe0,0x44,0x01,0xf0}},
+ {15,0x4b91,0,{0xc2,0x29,0x90,0x76,0x8d,0x74,0x01,0xf0,0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x4ba0,0,{0x90,0x7f,0xea,0xe0,0x90,0x76,0x82,0xf0,0xe4,0x90,0x76,0x91,0xf0,0x90,0x76,0x92}},
+ {11,0x4bb0,0,{0xf0,0x90,0x76,0x90,0xf0,0x90,0x76,0x93,0xf0,0xd3,0x22}},
+ {16,0x4bbb,0,{0x90,0x7f,0xd6,0xe0,0x30,0xe7,0x12,0xe0,0x44,0x01,0xf0,0x7f,0x14,0x7e,0x00,0x12}},
+ {10,0x4bcb,0,{0x4d,0x2f,0x90,0x7f,0xd6,0xe0,0x54,0xfe,0xf0,0x22}},
+ {16,0x4bd5,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0xd2,0x25,0x53,0x91,0xef,0x90,0x7f,0xab,0x74,0x08}},
+ { 8,0x4be5,0,{0xf0,0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x4bed,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xa9,0xe0,0x44,0x01,0xf0}},
+ { 7,0x4bfd,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x4c04,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xa9,0xe0,0x44,0x02,0xf0}},
+ { 7,0x4c14,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x4c1b,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xa9,0xe0,0x44,0x04,0xf0}},
+ { 7,0x4c2b,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x4c32,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xaa,0xe0,0x44,0x04,0xf0}},
+ { 7,0x4c42,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x4c49,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xa9,0xe0,0x44,0x08,0xf0}},
+ { 7,0x4c59,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x4c60,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xaa,0xe0,0x44,0x08,0xf0}},
+ { 7,0x4c70,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x4c77,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xa9,0xe0,0x44,0x10,0xf0}},
+ { 7,0x4c87,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x4c8e,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xaa,0xe0,0x44,0x10,0xf0}},
+ { 7,0x4c9e,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x4ca5,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xa9,0xe0,0x44,0x20,0xf0}},
+ { 7,0x4cb5,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x4cbc,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xaa,0xe0,0x44,0x20,0xf0}},
+ { 7,0x4ccc,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x4cd3,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xa9,0xe0,0x44,0x40,0xf0}},
+ { 7,0x4ce3,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x4cea,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xaa,0xe0,0x44,0x40,0xf0}},
+ { 7,0x4cfa,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x4d01,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xa9,0xe0,0x44,0x80,0xf0}},
+ { 7,0x4d11,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x4d18,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xaa,0xe0,0x44,0x80,0xf0}},
+ { 7,0x4d28,0,{0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x4d2f,0,{0x8e,0x35,0x8f,0x36,0xe5,0x36,0x15,0x36,0xae,0x35,0x70,0x02,0x15,0x35,0x4e,0x60}},
+ { 7,0x4d3f,0,{0x05,0x12,0x14,0x85,0x80,0xee,0x22}},
+ {16,0x4d46,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xab,0x74,0x04,0xf0,0xd0}},
+ { 6,0x4d56,0,{0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x4d5c,0,{0x90,0x76,0x82,0xe0,0x90,0x7f,0x00,0xf0,0x90,0x7f,0xb5,0x74,0x01,0xf0,0xd3,0x22}},
+ { 9,0x4d6c,0,{0xc2,0x25,0x53,0xd8,0xef,0x43,0xd8,0x20,0x32}},
+ { 7,0x4d75,0,{0x53,0x98,0xfe,0x53,0x98,0xfd,0x32}},
+ { 7,0x4d7c,0,{0x53,0xc0,0xfe,0x53,0xc0,0xfd,0x32}},
+ { 6,0x4d83,0,{0x53,0x91,0xbf,0xd2,0x2d,0x32}},
+ { 6,0x4d89,0,{0x53,0x91,0x7f,0xd2,0x2c,0x32}},
+ { 4,0x4d8f,0,{0x53,0x91,0xdf,0x32}},
+ { 4,0x4d93,0,{0x53,0xd8,0xf7,0x32}},
+ { 4,0x4d97,0,{0x12,0x17,0x30,0x22}},
+ { 3,0x4d9b,0,{0xc2,0x8d,0x32}},
+ { 3,0x4d9e,0,{0xc2,0x8f,0x32}},
+ { 2,0x4da1,0,{0xd3,0x22}},
+ { 2,0x4da3,0,{0xd3,0x22}},
+ { 2,0x4da5,0,{0xd3,0x22}},
+ { 2,0x4da7,0,{0xd3,0x22}},
+ { 2,0x4da9,0,{0xd3,0x22}},
+ { 2,0x4dab,0,{0xc3,0x22}},
+ { 0,0x0000,1,{0}}
+};
+/* Source: EMI62SFW.HEX 
+:100C8F004176680141766A0241766B0AC120C12123
+:1044A100C2AFD224907F937430F0907F9C74BBF0A4
+:1044B100907F96E04430F0E05430F0907F94743077
+:1044C100F0907F9D74CFF0907F9774A0F0907F95CE
+:1044D10074C0F0907F9E7403F0907F99E030E20900
+:1044E10090051974A0F0E4A3F0C225C222C223C230
+:1044F10026124AC4122DA9123BD3124559123A422F
+:104501009076687401F0700F124BBB1207FE124DCA
+:10451100A1121B4012149612430B907FAFE044018D
+:10452100F0907FAEE0441FF0907FAC74FFF0907F7D
+:10453100ADF0907FDEF0907FDFF0907FABF0907F69
+:10454100A9F0907FAAF05391EF43D820D2E843D845
+:084551002053A8A043A880221A
+:10475A00E4907666F01244A1202613907666E0C3B0
+:10476A009402500AE004F0D242124AF680EA302655
+:10477A0005122801C22630252B907696E054FCF0CB
+:10478A00908003F0121496907696E04403F090809D
+:10479A0003F0E4907667F0907667E004F0E0B44BBB
+:0A47AA00F6123FFA12411B80C522EF
+:10280100C220C221C22A907FE8E01237F9283000A5
+:10281100288C0128A2022A1F212A6A22293D802907
+:102821007D8129D1822A84A12ABAA200002ABF90DF
+:102831007FE9E014601124FE602824FE603B24FC43
+:102841007040124BA041CB124DA7400241CB907F6B
+:10285100EAE0B40104C22241CB907FB4E04401F02C
+:1028610041CB124DA9907FEAE0B40104D22241CBC1
+:10287100907FB4E04401F041CB907FB4E04401F09B
+:1028810041CB907FB4E04401F041CB907FE9E0245B
+:10289100F5700512480041CB907FB4E04401F0414E
+:1028A100CB907FE9E024FD605424026002213412C0
+:1028B1004DA7400241CB907FEAE07038907FECE079
+:1028C100F45480FFC4540FFFE054072F25E024B4D3
+:1028D100F582E4347FF583E4F0907FECE05480FFEF
+:1028E100131313541FFFE054072F907FD7F0E044D8
+:1028F10020F041CB907FB4E04401F041CB124DA9CF
+:10290100400241CB907FEAE07020907FECE0F454EC
+:1029110080FFC4540FFFE054072F25E024B4F58253
+:10292100E4347FF5837401F041CB907FB4E044013E
+:10293100F041CB907FB4E04401F041CB907FE9E0DE
+:10294100601224F86009240270291243DB41CB1282
+:102951004D5C41CB124DA5A222E433FF25E0FFA23D
+:1029610023E4334F907F00F0E4A3F0907FB574022D
+:10297100F041CB907FB4E04401F041CB907FE9E09E
+:10298100603324F6602A2404703D907FEBE024DE5E
+:10299100600C047012907FB4E04401F041CB907F51
+:1029A100B4E04401F041CB907FB4E04401F041CB6D
+:1029B10012468541CB124DA5E4907F00F0A3F09023
+:1029C1007FB57402F041CB907FB4E04401F041CB7C
+:1029D100907FE9E024F46034240C7039124DA59005
+:1029E1007FECE0F45480FFC4540FFFE054072F251F
+:1029F100E024B4F582E4347FF583E054FD907F0058
+:102A0100F0E4A3F0907FB57402F041CB907FB4E085
+:102A11004401F041CB907FB4E04401F041CB907F81
+:102A2100E9E024F6601214601A2402701DD220908D
+:102A31007FB4E04401F08012D220907FB4E04401E1
+:102A4100F08007907FB4E04401F0202018907FEEE1
+:102A5100E07004A3E0600BD229D22712174AD22AD0
+:102A61008003120800C2208061907FEEE07004A311
+:102A7100E0600BD229D22812174AD22A804C123890
+:102A8100748047907FE9E024FE601214601A2402EA
+:102A9100701DD221907FB4E04401F08012D22190C8
+:102AA1007FB4E04401F08007907FB4E04401F0205E
+:102AB1002103121000C2218011122AD6800C124D5E
+:102AC100AB5007907FB4E04401F0202A07907FB417
+:052AD100E04402F022C8
+:1043DB00124DA3400281A0907FEBE024FE601E14DF
+:1043EB00604614606E1470028191240460028199FE
+:1043FB007405907FD4F07400907FD5F022907FEA03
+:10440B00E0FF1249FF8B208A218922EA496011CEF5
+:10441B00EACEEE907FD4F0CFE9CFEF907FD5F022AC
+:10442B00907FB4E04401F022907FEAE0FF1248B0A5
+:10443B008B208A218922EA496011CEEACEEE907F49
+:10444B00D4F0CFE9CFEF907FD5F022907FB4E0444A
+:10445B0001F022907FEAE0FF907EC0E0FDA3E0FB3D
+:10446B001217948B208A218922EA496011CEEACE59
+:10447B00EE907FD4F0CFE9CFEF907FD5F022907FF5
+:10448B00B4E04401F022907FB4E04401F022907F2D
+:05449B00B4E04401F053
+:0144A00022F9
+:03003300024D6C0F
+:094D6C00C22553D8EF43D82032D0
+:020C9F00C12F63
+:063FFA00124AC4C231228C
+:10430B00E4907696F0908003F0907FE07490F090BC
+:10431B007FE17404F0E4907FDDF0907FA1F0538E89
+:10432B00F875880575B82075F801438E30F5C8759A
+:10433B00CA7F75CBF843A82012074AC22CC22DC2E4
+:10434B002BC22F907FFC74DDF0907FFF74FFF090F9
+:10435B007F97E04401F09076197401F0E490768534
+:10436B00F0A3F0907681F0907680F0124958120FFE
+:10437B00C6124A8D907F97E04408F0E054B9F0D212
+:10438B00302030181247B41230001240001242167F
+:10439B00124A50121B04121661124216C22FC2315E
+:1043AB00C232C234C233C229C227C228E4F51190EB
+:1043BB007689F090763FF0907641F0907640F090D1
+:1043CB00768AF0A3F0A304F0E4A3F0907699F022A0
+:104A5000302D39C22D907619E0FFB4010DE4907627
+:104A60007CF0A374F8F0A3740AF0EFB4020DE490A4
+:104A7000767CF0A374F0F0A3740BF0EFB4030DE4B4
+:0D4A800090767CF0A374F8F0A37417F02278
+:101B0400302C38C22C907619E0FFB4010E90767C0C
+:101B140074C0F0A37414F0A3740BF0EFB4020DE4DA
+:101B240090767CF0A37410F0A3740CF0EFB4030B64
+:0C1B3400E490767CF0A37418F0A3F0227B
+:10411B0090768DE064017027302708C227120800C3
+:10412B0012174A302808C22812387412174A302A3C
+:10413B000EE490768DF0C22A907FB4E04402F090AA
+:10414B00763FE0B40105E4F012326F907641E0B4B3
+:10415B000105E4F012349A907640E0B40103123476
+:10416B009A907F9BE020E402C23F907F9BE030E47B
+:10417B0002D23F907F9BE020E502C23E907F9BE006
+:10418B0030E502D23EA241303F01B3501FA23F9215
+:10419B0041303F09907697E054FEF0800790769778
+:1041AB00E04401F0907697E0908002F0303F34903D
+:1041BB007619E0FFB4010E90767C7467F0A3740659
+:1041CB00F0A3740BF0EFB4020BE490767CF0A3F049
+:1041DB00A3740CF0EFB4030BE490767CF0A3F0A384
+:1041EB007418F0A240303E01B3501FA23E924030F3
+:1041FB003E09907695E04404F08007907695E05464
+:0B420B00FBF0907695E0908001F0221F
+:0207FE00D32204
+:024DA100D3221B
+:024DA300D32219
+:104BA000907FEAE0907682F0E4907691F0907692B1
+:0B4BB000F0907690F0907693F0D32206
+:104D5C00907682E0907F00F0907FB57401F0D322C2
+:10480000907FECE0907683F0E01460171460211440
+:10481000602B14603224047038907FEAE090769127
+:10482000F08035907FEAE0907692F0123E8F8028FB
+:10483000907FEAE0907690F0121800801B907FEA5B
+:10484000E0907684F08011907FEAE0907693F0809B
+:0A48500007907FB4E04401F0D3228A
+:10468500907FECE0907683F0E014601D14602A14AE
+:10469500603714604424047050907691E0907F0058
+:1046A500F0907FB57401F08047907692E0907F009E
+:1046B500F0907FB57401F08037907690E0907F00A0
+:1046C500F0907FB57401F08027907684E0907F00AC
+:1046D500F0907FB57401F08017907693E0907F009D
+:1046E500F0907FB57401F08007907FB4E04401F04D
+:0246F500D322CE
+:024DA500D32217
+:024DA700D32215
+:024DA900D32213
+:024DAB00C32221
+:102FE700C0E0C083C082D2265391EF907FAB7401BB
+:082FF700F0D082D083D0E0325B
+:104D4600C0E0C083C0825391EF907FAB7404F0D073
+:064D560082D083D0E032A0
+:103D4700C0E0C0F0C083C082C0D0E8C0E0E9C0E0F6
+:103D5700EAC0E0EBC0E0ECC0E0EDC0E0EEC0E0EFB1
+:103D6700C0E0907FA2E090767FF0907F74E090763D
+:103D770087F0907F75E0907688F0907F98E0440216
+:103D8700F0907696E0FF20E10C4402F0908003F07B
+:103D9700D232124AC490767FE020E250907687E0D4
+:103DA700FEA3E07C002400F534EC3EF533907698D2
+:103DB700E0FDAE33AF341236D8907687EFF0D22FCE
+:103DC700303129203F26C231907F94E054CFF090C4
+:103DD7007F9AE030E404D22DC22C907F9AE020E550
+:103DE70004C22DD22C907F94E04430F0124A501236
+:103DF7001B04302F12124216C22F75E80112168AC1
+:103E070075E80DD22B800575E801C22B202B349065
+:103E17007619E0FFB4010E90767C7467F0A3740600
+:103E2700F0A3740BF0EFB4020B90767CE4F0A3F0F0
+:103E3700A3740CF0EFB4030B90767CE4F0A3F0A32B
+:103E47007418F075CAD375CBFED2CA303404C234A5
+:103E57008002D2345391EF907FAB7402F0F0907FE1
+:103E670098E054FDF0D0E0FFD0E0FED0E0FDD0E0D8
+:103E7700FCD0E0FBD0E0FAD0E0F9D0E0F8D0D0D029
+:083E870082D083D0F0D0E032BC
+:104B6000C0E0C083C0825391EF907FAB7410F0908F
+:104B70007696E054FDF0908003F0D082D083D0E0B0
+:014B80003202
+:012FFF00329F
+:104BD500C0E0C083C082D2255391EF907FAB7408AB
+:084BE500F0D082D083D0E03251
+:104BED00C0E0C083C0825391EF907FA9E04401F0F3
+:074BFD00D082D083D0E0322A
+:104B8100C0E0C083C0825391EF907FAAE04401F05E
+:0F4B9100C22990768D7401F0D082D083D0E032AB
+:104C0400C0E0C083C0825391EF907FA9E04402F0DA
+:074C1400D082D083D0E03212
+:103FD500C0E0C083C0825391EF907FAAE04402F015
+:103FE500907FC7E0F511750F00750D00D233D082B3
+:053FF500D083D0E03292
+:104C1B00C0E0C083C0825391EF907FA9E04404F0C1
+:074C2B00D082D083D0E032FB
+:104C3200C0E0C083C0825391EF907FAAE04404F0A9
+:074C4200D082D083D0E032E4
+:104C4900C0E0C083C0825391EF907FA9E04408F08F
+:074C5900D082D083D0E032CD
+:104C6000C0E0C083C0825391EF907FAAE04408F077
+:074C7000D082D083D0E032B6
+:104C7700C0E0C083C0825391EF907FA9E04410F059
+:074C8700D082D083D0E0329F
+:104C8E00C0E0C083C0825391EF907FAAE04410F041
+:074C9E00D082D083D0E03288
+:104CA500C0E0C083C0825391EF907FA9E04420F01B
+:074CB500D082D083D0E03271
+:104CBC00C0E0C083C0825391EF907FAAE04420F003
+:074CCC00D082D083D0E0325A
+:104CD300C0E0C083C0825391EF907FA9E04440F0CD
+:074CE300D082D083D0E03243
+:104CEA00C0E0C083C0825391EF907FAAE04440F0B5
+:074CFA00D082D083D0E0322C
+:104D0100C0E0C083C0825391EF907FA9E04480F05E
+:074D1100D082D083D0E03214
+:104D1800C0E0C083C0825391EF907FAAE04480F046
+:074D2800D082D083D0E032FD
+:10421600907619E064017035907687E0FFD3942D8F
+:10422600402B9076867401F0907685E004F0E0D31A
+:10423600940F4019E4F0EFD3943140089076197446
+:1042460003F080069076197402F0123E8F9076196C
+:10425600E0B4022C907687E0FFC3942F5022EFD370
+:10426600942A401C9076867401F0907685E004F0DE
+:10427600E0D3940F400AE4F090761904F0123E8FD2
+:10428600907619E0B40226907687E0D39431401DEB
+:104296009076867401F0907685E004F0E0D3940F72
+:1042A600400BE4F09076197403F0123E8F90761965
+:1042B600E06403703F907687E0FFC3945F503590CB
+:1042C60076867401F0907685E004F0E0D3940F4092
+:1042D60023E4F0EFC3942F500CEFD3942A400690BA
+:1042E60076197401F0EFD3942F4006907619740274
+:1042F600F0123E8F907686E07005907685F022E487
+:05430600907686F02214
+:10074A0090769A7402F0E4907691F0A3F090769005
+:10075A00F0907693F09076967403F0908003F0E42C
+:10076A00907697F0908002F090769404F090800052
+:10077A00F0E490768EF090761AF090769504F0C2B6
+:10078A002E907F9BE0FF5410FF7002C23F907F9B28
+:10079A00E0FF5410FEFFBE1002D23F907F9BE0FFA5
+:1007AA005420FF7002C23E907F9BE0FF5420FEFF60
+:1007BA00BE2002D23E303F09907697E054FEF08088
+:1007CA0007907697E04401F0907697E0908002F0E7
+:1007DA00303E09907695E04404F08007907695E0E3
+:1007EA0054FBF0907695E0908001F0A23E9240A2F0
+:0307FA003F9241EA
+:0107FD0022D9
+:103E8F00907692E014601D147002E14424026002E7
+:103E9F00E1D49076947401F0908000F0E490768EE7
+:103EAF00F0D23122907619E0FFB4011BE4907FF23B
+:103EBF00F0907FF37430F0907FFF74FCF090769762
+:103ECF00E054FDF054FBF0EFB4021BE4907FF2F0EE
+:103EDF00907FF37434F0907FFF74FCF0907697E04E
+:103EEF004402F054FBF0EFB40318E4907FF2F0902B
+:103EFF007FF37464F0907FFF74FCF0907697E0444A
+:103F0F0004F0907694E04401F0908000F0303F0987
+:103F1F00907697E054FEF08007907697E04401F09A
+:103F2F00907697E0908002F09076987404F09076F7
+:103F3F008E7401F022907619E0FFB4011BE4907F9C
+:103F4F00F2F0907FF37444F0907FFF74FCF0907662
+:103F5F0097E054FDF054FBF0EFB4021BE4907FF2B6
+:103F6F00F0907FF3744CF0907FFF74FCF090769795
+:103F7F00E04402F054FBF0EFB40318E4907FF2F04A
+:103F8F00907FF37494F0907FFF74FCF0907697E03D
+:103F9F004404F0907694E054FEF0908000F0303FAF
+:103FAF0009907697E054FEF08007907697E04401F1
+:103FBF00F0907697E0908002F09076987406F090EB
+:063FCF00768E7402F02260
+:10180000907690E014603714700201D814700221B1
+:1018100072147002413B240460026103907FFC74E7
+:10182000CCF0907FFF74FCF0907695E04401F0548A
+:1018300005F0908001F0E490761AF0C22E229076A6
+:1018400095E04401F04402F0303E06E04404F080AC
+:1018500007907695E054FBF090761AE0B40108907A
+:101860007695E0908001F0907619E0FFB401229027
+:101870007FFC7474F0907FFF74FCF090768F742B73
+:10188000F0907697E054FDF0E4907681F0907680C9
+:10189000F0EFB40222907FFC7468F0907FFF74FC3C
+:1018A000F090768F742FF0907697E04402F0E490F9
+:1018B0007681F0907680F0303F09907697E054FE84
+:1018C000F08007907697E04401F0907697E054FB23
+:1018D000F0908002F0D22E22907695E054FEF044F3
+:1018E00002F0303E06E04404F08007907695E05424
+:1018F000FBF090761AE0B40108907695E0908001B4
+:10190000F0907619E0FFB40122907FFC7430F090E3
+:101910007FFF74FCF090768F742BF0907697E054F4
+:10192000FDF0E4907681F0907680F0EFB4022290A2
+:101930007FFC741CF0907FFF74FCF090768F742F06
+:10194000F0907697E04402F0E4907681F090768013
+:10195000F0303F09907697E054FEF080079076973C
+:10196000E04401F0907697E054FBF0908002F0D2D2
+:101970002E22907695E04401F04402F04408F030C5
+:101980003E06E04404F08007907695E054FBF0902A
+:10199000761AE0B40108907695E0908001F0907698
+:1019A00019E0FFB40125907FFC74CCF0907FFF74A8
+:1019B000FCF090768F742BF0907697E054FDF05405
+:1019C000FBF0E4907681F0907680F0EFB402259001
+:1019D0007FFC74C8F0907FFF74FCF090768F742FBA
+:1019E000F0907697E04402F054FBF0E4907681F0BA
+:1019F000907680F0EFB40325907FFC7498F0907F90
+:101A0000FF74FCF090768F745FF0907697E054FD51
+:101A1000F04404F0E4907681F0907680F0303F0955
+:101A2000907697E054FEF08007907697E04401F0BE
+:101A3000907697E0908002F0D22E22907695E05436
+:101A4000FEF04402F04408F0303E06E04404F0802A
+:101A500007907695E054FBF090761AE0B401089078
+:101A60007695E0908001F0907619E0FFB401259022
+:101A70007FFC74B4F0907FFF74FCF090768F742B31
+:101A8000F0907697E054FDF054FBF0E4907681F00E
+:101A9000907680F0EFB40225907FFC74B0F0907FD8
+:101AA000FF74FCF090768F742FF0907697E04402EC
+:101AB000F054FBF0E4907681F0907680F0EFB40380
+:101AC00025907FFC7468F0907FFF74FCF090768F17
+:101AD000745FF0907697E054FDF04404F0E4907663
+:101AE00081F0907680F0303F09907697E054FEF0D8
+:101AF0008007907697E04401F0907697E09080021E
+:041B0000F0D22E22CF
+:040CA1004176230075
+:102DA900E4907636F0E0FF75F003A4240EF582E492
+:102DB9003475F5837401F0EF75F003A4240FF582DF
+:102DC900E43475F5837401F0EF75F003A42410F56C
+:102DD90082E43475F583E4F0907636E004F0E0FFA0
+:102DE90075F003A4240EF582E43475F5837410F0AC
+:102DF900EF75F003A4240FF582E43475F5837405A7
+:102E0900F0EF75F003A42410F582E43475F583E43A
+:102E1900F0907636E004F0E0FF75F003A4240EF597
+:102E290082E43475F5837402F0EF75F003A4240F7E
+:102E3900F582E43475F5837402F0EF75F003A42488
+:102E490010F582E43475F583E4F0907636E004F009
+:102E5900E0FF75F003A4240EF582E43475F583745C
+:102E690001F0EF75F003A4240FF582E43475F583BE
+:102E79007403F0EF75F003A42410F582E43475F5BA
+:102E890083E4F0907636E004F0E0FF75F003A424C3
+:102E99000EF582E43475F5837410F0EF75F003A430
+:102EA900240FF582E43475F5837406F0EF75F003A9
+:102EB900A42410F582E43475F583E4F0907636E0C5
+:102EC90004F0E0FF75F003A4240EF582E43475F5EF
+:102ED900837402F0EF75F003A4240FF582E43475CE
+:102EE900F5837404F0EF75F003A42410F582E4343B
+:102EF90075F583E4F0907636E004F0E0FF75F003B1
+:102F0900A4240EF582E43475F5837402F0EF75F0AC
+:102F190003A4240FF582E43475F5837408F0EF7582
+:102F2900F003A42410F582E43475F5837404F09059
+:102F39007636E004F0E0FF75F003A4240EF582E490
+:102F49003475F5837402F0EF75F003A4240FF5824C
+:102F5900E43475F583740AF0EF75F003A42410F5D1
+:102F690082E43475F5837404F0907636E004F0E079
+:102F7900FF75F003A4240EF582E43475F583740219
+:102F8900F0EF75F003A4240FF582E43475F583742A
+:102F990009F0EF75F003A42410F582E43475F58384
+:102FA9007404F0907636E004F0E0FF75F003A42491
+:102FB9000EF582E43475F5837402F0EF75F003A41D
+:102FC900240FF582E43475F5837407F0EF75F00387
+:0E2FD900A42410F582E43475F5837404F0220C
+:103BD300E4907636F0E0FB75F00FA42441F582E41F
+:103BE3003475F5837440F0EB75F00FA42442F5822D
+:103BF300E43475F583740AF0EB75F00FA42443F5F0
+:103C030082E43475F5831237C80000AC44EB75F0D9
+:103C13000FA42447F582E43475F5831237C80000F6
+:103C2300AC44EB75F00FA4244BF582E43475F583B3
+:103C33001237C800017700907636E004F0E0FB7598
+:103C4300F00FA42441F582E43475F5837440F0EB5E
+:103C530075F00FA42442F582E43475F583748CF077
+:103C6300EB75F00FA42443F582E43475F583123722
+:103C7300C80000AC44EB75F00FA42447F582E4348C
+:103C830075F5831237C80000AC44EB75F00FA4241C
+:103C93004BF582E43475F5831237C8000177009041
+:103CA3007636E004F0E0FF75F00FA42441F582E4DA
+:103CB3003475F5837440F0EF75F00FA42442F58258
+:103CC300E43475F583748FF0907636E004F0E0FF0A
+:103CD30075F00FA42441F582E43475F5837441F043
+:103CE300EF75F00FA42442F582E43475F5837484F0
+:103CF300F0907636E004F0E0FF75F00FA42441F570
+:103D030082E43475F5837461F0EF75F00FA42442F7
+:103D1300F582E43475F5837481F0907636E004F02F
+:103D2300E0FF75F00FA42441F582E43475F5837444
+:103D330061F0EF75F00FA42442F582E43475F58346
+:043D43007401F022F5
+:10455900E4907636F0E0FF75F003A42432F582E4A6
+:104569003475F583E4F0EF75F003A42433F582E4A0
+:104579003475F5837401F0907636E004F0E0FF7548
+:10458900F003A42432F582E43475F583E4F0EF7581
+:10459900F003A42433F582E43475F5837402F090B2
+:1045A9007636E004F0E0FF75F003A42432F582E4E6
+:1045B9003475F583E4F0EF75F003A42433F582E450
+:1045C9003475F5837403F0907636E004F0E0FF75F6
+:1045D900F003A42432F582E43475F583E4F0EF7531
+:1045E900F003A42433F582E43475F5837404F022CE
+:103A4200E4907635F0907635E0FFC394034002416E
+:103A5200FFEF75F00AA424AAF582E43475F583EF2A
+:103A6200F0EF75F00AA424ABF582E43475F583E433
+:103A7200F0EF75F00AA424ACF582E43475F5837492
+:103A8200F0F0EF75F00AA424ADF582E43475F58305
+:103A920074FFF0EF75F00AA424AEF582E43475F5F4
+:103AA20083E4F0EF75F00AA424AFF582E43475F5EF
+:103AB200837480F0EF75F00AA424B0F582E43475C3
+:103AC200F583E4F0EF75F00AA424B1F582E43475CD
+:103AD200F583E4F0EF75F00AA424B2F582E43475BC
+:103AE200F583E4F0EF75F00AA424B3F582E43475AB
+:103AF200F5837401F0907635E004F0414790763C0E
+:103B0200740AF0E4A3F09076357403F090763CE00A
+:103B1200FF907635E0FEC39F400261D290763DE091
+:103B2200FF04F0EE75F00AA424AAF582E43475F5D8
+:103B320083EFF0EE75F00AA424ABF582E43475F558
+:103B420083E4F0EE75F00AA424ACF582E43475F552
+:103B520083745EF0EE75F00AA424ADF582E4347548
+:103B6200F58374BAF0EE75F00AA424AEF582E4345B
+:103B720075F5837405F0EE75F00AA424AFF582E4BE
+:103B82003475F5837480F0EE75F00AA424B0F582E2
+:103B9200E43475F583E4F0EE75F00AA424B1F582FD
+:103BA200E43475F583E4F0EE75F00AA424B2F582EC
+:103BB200E43475F5837415F0EE75F00AA424B3F5B8
+:103BC20082E43475F583E4F0907635E004F0610E1A
+:013BD20022D0
+:10080000E4907631F0907631E0FF75F003A4240F88
+:10081000F582E43475F583E0FE907FEDE0FDEE6D4A
+:10082000600EEFC3940B5008907631E004F080D551
+:10083000EFB40B08907FB4E04401F022EF75F003B1
+:10084000A4240EF582E43475F583E0907633F02429
+:10085000F0600A240E60028187124B3E22907FEDE9
+:10086000E0640570519076187405F0907637740145
+:10087000F09076397403F0907621F0E4907620F0D1
+:10088000907FEAE0F4602F907620E0FF75F00AA4F4
+:1008900024AAF582E43475F583E0FE907FEAE0FD5A
+:1008A000EE6D6012907621E0FEEFC39E50089076C8
+:1008B00020E004F080D1907FEDE0640670529076E5
+:1008C000187406F09076377404F0907639740AF054
+:1008D000907621F09076207403F0907FEAE0F46047
+:1008E0002F907620E0FF75F00AA424AAF582E43464
+:1008F00075F583E0FE907FEAE0FDEE6D6012907684
+:1009000021E0FEEFC39E5008907620E004F080D1F5
+:10091000907620E0FF75F00AA424AAF582E43475ED
+:10092000F583E0907229F0E490763BF0907621E038
+:10093000FEEF6E7008907FB4E04401F022907FEBF0
+:10094000E014601314700221E224026002817F909F
+:100950007FB4E04401F022907FE9E014707C907F46
+:10096000EAE0F47048907637E0907620F09076399F
+:10097000E0FE907620E0FDC39E502B90763BE0FE9B
+:1009800004F074C02EF582E4347EF583E0FEED754C
+:10099000F00AA424ABF582E43475F583EEF090768A
+:1009A00020E004F080C790763F7401F022907EC072
+:1009B000E0FEEF75F00AA424ABF582E43475F5830C
+:1009C000EEF0E0B4010890763E7401F08005E4900A
+:1009D000763EF090763F7401F022907FB4E04401BF
+:1009E000F022907FE9E024FE700241A314700261BE
+:1009F0003F14700261DB240360028177907FEAE09C
+:100A0000F4706B907637E0907620F0907639E0FFC6
+:100A1000907620E0FEC39F504E90763BE0FF04F0BE
+:100A200074C02FF582E4347EF583E0FFEE75F00AA2
+:100A3000A424ACF582E43475F583EFF090763BE0C6
+:100A4000FF04F074C02FF582E4347EF583E0FFEEFE
+:100A500075F00AA424ADF582E43475F583EFF090C7
+:100A60007620E004F080A49076407401F022907E1D
+:100A7000C0E0FF907620E0FE75F00AA424ACF58279
+:100A8000E43475F583EFF0907EC1E0FFEE75F00A77
+:100A9000A424ADF582E43475F583EFF090764174CB
+:100AA00001F022907FEAE0F47066907637E090766D
+:100AB00020F0907639E0FF907620E0FEC39F400260
+:100AC000818E90763BE0FF04F074C02FF582E43411
+:100AD0007EF583E0FFEE75F00AA424AEF582E434DF
+:100AE00075F583EFF090763BE0FF04F074C02FF5CE
+:100AF00082E4347EF583E0FFEE75F00AA424AFF5BE
+:100B000082E43475F583EFF0907620E004F080A263
+:100B1000907EC0E0FF907620E0FE75F00AA424AE3F
+:100B2000F582E43475F583EFF0907EC1E0FFEE7559
+:100B3000F00AA424AFF582E43475F583EFF0229037
+:100B40007FEAE0F47066907637E0907620F0907659
+:100B500039E0FF907620E0FEC39F4002818E9076C0
+:100B60003BE0FF04F074C02FF582E4347EF583E0AF
+:100B7000FFEE75F00AA424B0F582E43475F583EF36
+:100B8000F090763BE0FF04F074C02FF582E4347EF1
+:100B9000F583E0FFEE75F00AA424B1F582E4347524
+:100BA000F583EFF0907620E004F080A2907EC0E024
+:100BB000FF907620E0FE75F00AA424B0F582E434BC
+:100BC00075F583EFF0907EC1E0FFEE75F00AA42486
+:100BD000B1F582E43475F583EFF022907FEAE0F41A
+:100BE0007066907637E0907620F0907639E0FF904E
+:100BF0007620E0FEC39F4002818E90763BE0FF04AA
+:100C0000F074C02FF582E4347EF583E0FFEE75F0DA
+:100C10000AA424B2F582E43475F583EFF090763BB4
+:100C2000E0FF04F074C02FF582E4347EF583E0FF2A
+:100C3000EE75F00AA424B3F582E43475F583EFF081
+:100C4000907620E004F080A2907EC0E0FF907620B5
+:100C5000E0FE75F00AA424B2F582E43475F583EF62
+:100C6000F0907EC1E0FFEE75F00AA424B3F582E4B3
+:100C70003475F583EFF022907FB4E04401F02290C8
+:0F0C80007FB4E04401F022907FB4E04401F02201
+:10100000E490762CF090762CE0FF75F003A4240F8A
+:10101000F582E43475F583E0FE907FEDE0FDEE6D42
+:10102000600EEFC3940B500890762CE004F080D54E
+:10103000EFB40B08907FB4E04401F022EF75F003A9
+:10104000A4240EF582E43475F583E090762EF02426
+:10105000F0600A240F6002817D124B1B22907FED0D
+:10106000E0640570519076187405F090763874013C
+:10107000F090763A7403F090761CF0E490761BF0D2
+:10108000907FEAE0F4602F90761BE0FF75F00AA4F1
+:1010900024AAF582E43475F583E0FE907FEAE0FD52
+:1010A000EE6D601290761CE0FEEFC39E50089076C5
+:1010B0001BE004F080D1907FEDE0640670529076E2
+:1010C000187406F09076387404F090763A740AF04A
+:1010D00090761CF090761B7403F0907FEAE0F46049
+:1010E0002F90761BE0FF75F00AA424AAF582E43461
+:1010F00075F583E0FE907FEAE0FDEE6D601290767C
+:101100001CE0FEEFC39E500890761BE004F080D1F7
+:10111000E490761EF090761CE0FF90761BE0FE6F68
+:101120007008907FB4E04401F022907FEBE01460FF
+:101130001314700221BF240260028175907FB4E015
+:101140004401F022907FE9E0247F706B907FEAE019
+:10115000F4704A907638E090761BF090763AE0FF93
+:1011600090761BE0FDC39F502BED75F00AA424ABD5
+:10117000F582E43475F583E0FF90761EE0FD04F01F
+:1011800074002DF582E4347FF583EFF090761BE058
+:1011900004F080C790761EE0907FB5F022EE75F0E7
+:1011A0000AA424ABF582E43475F583E0907F00F067
+:1011B000907FB57401F022907FB4E04401F022905A
+:1011C0007FE9E0247E7002417E1470026123147076
+:1011D0000261C824036002816D907FEAE0F4706DC3
+:1011E000907638E090761BF090763AE0FF90761B90
+:1011F000E0C39F504FE0FF75F00AA424ACF582E4F1
+:101200003475F583E0FE90761EE0FD04F074002D49
+:10121000F582E4347FF583EEF0EF75F00AA424AD97
+:10122000F582E43475F583E0FF90761EE0FE04F06D
+:1012300074002EF582E4347FF583EFF090761BE0A6
+:1012400004F080A490761EE0907FB5F02290761B8B
+:10125000E0FF75F00AA424ACF582E43475F583E070
+:10126000907F00F0EF75F00AA424ADF582E43475A8
+:10127000F583E0907F01F0907FB57402F022907FBB
+:10128000EAE0F4706D907638E090761BF090763A54
+:10129000E0FF90761BE0C39F504FE0FF75F00AA47B
+:1012A00024AEF582E43475F583E0FE90761EE0FD11
+:1012B00004F074002DF582E4347FF583EEF0EF75D1
+:1012C000F00AA424AFF582E43475F583E0FF90764C
+:1012D0001EE0FE04F074002EF582E4347FF583EF07
+:1012E000F090761BE004F080A490761EE0907FB52D
+:1012F000F02290761BE0FF75F00AA424AEF582E49C
+:101300003475F583E0907F00F0EF75F00AA424AF08
+:10131000F582E43475F583E0907F01F0907FB57439
+:1013200002F022907FEAE0F4706D907638E09076DB
+:101330001BF090763AE0FF90761BE0C39F504FE0A1
+:10134000FF75F00AA424B0F582E43475F583E0FE5D
+:1013500090761EE0FD04F074002DF582E4347FF5F4
+:1013600083EEF0EF75F00AA424B1F582E43475F54C
+:1013700083E0FF90761EE0FE04F074002EF582E418
+:10138000347FF583EFF090761BE004F080A4907634
+:101390001EE0907FB5F02290761BE0FF75F00AA466
+:1013A00024B0F582E43475F583E0907F00F0EF75AA
+:1013B000F00AA424B1F582E43475F583E0907F014E
+:1013C000F0907FB57402F022907FEAE0F4706D90A7
+:1013D0007638E090761BF090763AE0FF90761BE04E
+:1013E000C39F504FE0FF75F00AA424B2F582E434A5
+:1013F00075F583E0FE90761EE0FD04F074002DF597
+:1014000082E4347FF583EEF0EF75F00AA424B3F59F
+:1014100082E43475F583E0FF90761EE0FE04F074FC
+:10142000002EF582E4347FF583EFF090761BE00424
+:10143000F080A490761EE0907FB5F02290761BE0BD
+:10144000FF75F00AA424B2F582E43475F583E090C8
+:101450007F00F0EF75F00AA424B3F582E43475F54B
+:1014600083E0907F01F0907FB57402F022907FB40A
+:10147000E04401F022907FB4E04401F022907FB478
+:05148000E04401F02230
+:10387400E4907629F0907629E0FF75F00FA42442B5
+:10388400F582E43475F583E0FE907FECE0FDEE6DA7
+:10389400600EEFC394065008907629E004F080D5BA
+:1038A400EFB40608907FB4E04401F022EF75F00F06
+:1038B400A42441F582E43475F583E090762AF0245B
+:1038C400BF7002414124E070024112242160024190
+:1038D4003A907FE9E024FE607D14700221B2240254
+:1038E4006002410A121751907642E0FCA3E0FDA366
+:1038F400E0FEA3E0FF907629E075F00FA42443F5E1
+:1039040082E43475F5831237BC907619E0FFB40174
+:103914001290767C7467F090767D7406F090767ED3
+:10392400740BF0EFB4020FE490767CF090767DF0A7
+:1039340090767E740CF0EFB4030FE490767CF090F4
+:10394400767DF090767E7418F090761A7401F012F9
+:103954003E8F12180022907EC2E0FFE4FCFDFEFBC5
+:10396400FA7901F8123746C8ECC8C9EDC9CAEECADB
+:10397400CBEFCB907EC1E0FEE4FCFD2BFBEA3EFAEC
+:10398400ED39F9EC38F8907EC0E0FFE4FEEB2FFF50
+:10399400EE3AFEED39FDEC38FC907629E075F00F37
+:1039A400A42447F582E43475F5831237BC22907E53
+:1039B400C2E0FFE4FCFDFEFBFA7901F8123746C8C9
+:1039C400ECC8C9EDC9CAEECACBEFCB907EC1E0FE0C
+:1039D400E4FCFD2BFBEA3EFAED39F9EC38F8907E75
+:1039E400C0E0FFE4FEEB2FFFEE3AFEED39FDEC38CC
+:1039F400FC907629E075F00FA4244BF582E434752D
+:103A0400F5831237BC22907FB4E04401F022907F0A
+:103A1400E9E0147019907EC0E0FF907629E075F01B
+:103A24000FA4244FF582E43475F583EFF022907FE0
+:0E3A3400B4E04401F022907FB4E04401F0229F
+:102AD600E4907627F0907627E0FF75F00FA4244265
+:102AE600F582E43475F583E0FE907FECE0FDEE6D53
+:102AF600600EEFC394065008907627E004F080D568
+:102B0600EFB40608907FB4E04401F022EF75F00FB1
+:102B1600A42441F582E43475F583E0907628F02408
+:102B26009F7002A17424216002A1A1907FE9E02494
+:102B36007E700261FC14700281B524026002A16CF1
+:102B4600EF75F00FA42443F582E43475F583E0FCB9
+:102B5600A3E0FDA3E0FEA3E0FF7B447AAC79007816
+:102B660000C31237AB7013907F007444F0A374ACAB
+:102B7600F0E4A3F0907FB57403F0907627E075F04B
+:102B86000FA42443F582E43475F583E0FCA3E0FD4D
+:102B9600A3E0FEA3E0FF7B807ABB79007800C31236
+:102BA60037AB7013907F007480F0A374BBF0E4A37E
+:102BB600F0907FB57403F0907627E075F00FA424AB
+:102BC60043F582E43475F583E0FCA3E0FDA3E0FE63
+:102BD600A3E0FF7B007A7779017800C31237AB60F8
+:102BE60002A1A8907F00F0A37477F0A37401F0907F
+:102BF6007FB57403F022907627E075F00FA4244782
+:102C0600F582E43475F583E0FCA3E0FDA3E0FEA3C2
+:102C1600E0FF7B447AAC79007800C31237AB7013BF
+:102C2600907F007444F0A374ACF0E4A3F0907FB5F9
+:102C36007403F0907627E075F00FA42447F582E43C
+:102C46003475F583E0FCA3E0FDA3E0FEA3E0FF7B83
+:102C5600807ABB79007800C31237AB7013907F007F
+:102C66007480F0A374BBF0E4A3F0907FB57403F016
+:102C7600907627E075F00FA42447F582E43475F5C5
+:102C860083E0FCA3E0FDA3E0FEA3E0FF7B007A77F0
+:102C960079017800C31237AB6002A1A8907F00F0DB
+:102CA600A37477F0A37401F0907FB57403F02290BB
+:102CB6007627E075F00FA4244BF582E43475F5838E
+:102CC600E0FCA3E0FDA3E0FEA3E0FF7B447AAC7941
+:102CD600007800C31237AB7013907F007444F0A3E2
+:102CE60074ACF0E4A3F0907FB57403F0907627E01F
+:102CF60075F00FA4244BF582E43475F583E0FCA34C
+:102D0600E0FDA3E0FEA3E0FF7B807ABB79007800BC
+:102D1600C31237AB7013907F007480F0A374BBF0BE
+:102D2600E4A3F0907FB57403F0907627E075F00F7A
+:102D3600A4244BF582E43475F583E0FCA3E0FDA3FF
+:102D4600E0FEA3E0FF7B007A7779017800C31237B3
+:102D5600AB704F907F00F0A37477F0A37401F090EE
+:102D66007FB57403F022907FB4E04401F022907F97
+:102D7600E9E0247F701E907627E075F00FA4244FBB
+:102D8600F582E43475F583E0907F00F0907FB574AA
+:102D960001F08007907FB4E04401F0907FB4E044F6
+:032DA60001F02217
+:104B1B00907FEBE0147014907FE9E0247F70041217
+:104B2B00485A22907FB4E04401F022907FB4E044D5
+:034B3B0001F02264
+:104B3E00907FEBE0147013907FE9E014700412493B
+:104B4E00AD22907FB4E04401F022907FB4E04401A6
+:024B5E00F02243
+:10485A00E4907626F0907626E0FF75F003A42434DF
+:10486A00F582E43475F583E0FE907FECE0FDEE6DB1
+:10487A00600EEFC394045008907626E004F080D5C9
+:10488A00EFB40408907FB4E04401F022EF75F0031E
+:10489A00A42432F582E43475F583E0907F00F09029
+:0648AA007FB57401F0224D
+:1049AD00E4907625F0907625E0FF75F003A424348D
+:1049BD00F582E43475F583E0FE907FECE0FDEE6D5D
+:1049CD00600EEFC394045008907625E004F080D576
+:1049DD00EFB40408907FB4E04401F022907EC0E073
+:1049ED00FEEF75F003A42432F582E43475F583EE01
+:0249FD00F022A6
+:03000300020FFDEC
+:030FFD00C2893274
+:030013000217FDD4
+:0317FD00C28B326A
+:03004B00024D8FD4
+:044D8F005391DF322B
+:03005300024D83D8
+:064D83005391BFD22D3256
+:03005B00024D89CA
+:064D890053917FD22C3291
+:03006300024D93B8
+:044D930053D8F732C8
+:03000B00024D9B08
+:034D9B00C28D3294
+:03001B00024D9EF5
+:034D9E00C28F328F
+:03002300024D7516
+:074D75005398FE5398FD3234
+:03003B00024D7CF7
+:074D7C0053C0FE53C0FD32DD
+:03002B000246F793
+:1046F700C0E0C0F0C083C082C0D0E8C0E0E9C0E03D
+:10470700EAC0E0EBC0E0ECC0E0EDC0E0EEC0E0EFF7
+:10471700C0E0C2CAC2CF907F98E04401F0302E03B8
+:104727001214A6907F98E054FEF053A8FA1216616F
+:10473700D0E0FFD0E0FED0E0FDD0E0FCD0E0FBD041
+:10474700E0FAD0E0F9D0E0F8D0D0D082D083D0F032
+:03475700D0E0327D
+:1047B400E490769BF090769BE0FF04F0EF6008E0D5
+:1047C4002408F8E4F680EE907696E054FBF054F773
+:1047D400F0908003F0E4F518D235F50EF510D236DA
+:1047E400751211751322C237C239C238F516F51481
+:0B47F400F51AF50DC23BC23CC23D228D
+:10300000907FB6E020E102C23DD236203602416E0A
+:10301000303D02416E908007E06004D2368002C2EB
+:1030200036203602412ED235E4F51A908004E0F5C0
+:10303000197408250EF8A619851918E51820E70453
+:10304000D2388002C23830380221D4E4F516E519AE
+:10305000B4F00CD2397508047509F0050E8002052C
+:1030600016E51964F7703DC239E50E24FE601714A9
+:103070006022240370297508057509F7E4F50AF53F
+:103080000B750E048020750806750AF7E4F50B75BC
+:103090000E048012750807750BF7750E0480071271
+:1030A00048F380020516E51954F864F8703BC23500
+:1030B000E5192407600C24FC6008240524F8500658
+:1030C0008008D23A8006C23A8002D23A751A0120AC
+:1030D0003A19907E80740FF0A3E519F0E4A3F0A3F1
+:1030E000F0907FB77404F08002051620396DE51961
+:1030F00064F76067E51A7063E51854F064F070597E
+:10310000851819F50EE519240F601B24FE6017249D
+:10311000FD602214601F2405702F750803050E85BD
+:103120001809D2378028750802050E85180975140C
+:1031300001D2378019750805050E851809E4F50ACE
+:10314000F50B750E03D23780051248F3C2353035C2
+:103150000A85081385181280020516851819E516C8
+:1031600064047062F50EE51954F0F519F51585182B
+:1031700019E5152470601824F0601424F060102400
+:10318000F0601E24F0601A24F0600424607027E5CB
+:1031900015C4540FF519F508050E851809D23780A6
+:1031A0001AE515C4540FF519F508050E85180975AB
+:1031B0001401D23780051248F3C23530350A85191B
+:1031C0001385181280020516E516D3940540571290
+:1031D00048F38052303917E50E700A8508097508E2
+:1031E00004050E80417408250EF8A6198038203792
+:1031F0002AE50EB4010F85080A85090B8513088599
+:103200001209750E04E514B4011C85080AE4F50BD7
+:10321000851308851209750E04800BE514B40106A8
+:10322000E4F50B750E04E4F51A303502050EE50ED3
+:10323000D394035002010BC237E4F50EF510C236E9
+:10324000D23DF51474082510F8E6FF74802510F5BA
+:1032500082E4347EF583EFF074082510F8E4F60577
+:0F32600010E510B404DE907FB77404F0010B2268
+:0C48F300C237E4F50EF510C236F51422B1
+:10400000E511D3940050022106907689E0C394080C
+:10401000400221067440250FF582E4347EF583E0EA
+:10402000F517E50D600E908005E517F0907689E0B4
+:1040300004F001DAE5171237F940C1024067054084
+:104040007A0640980740C10C40C10D40C70F40CBD5
+:10405000F640CBF840CBFA40CBFB40CBFC40CBFE4C
+:1040600040CBFF000040DA907E41E0908005F09068
+:104070007689E004F07511018060907E41E09080C7
+:1040800005F0907E42E0908005F0907689E004F0A3
+:10409000E004F07511018042907E41E0908005F0CF
+:1040A000907E42E0908005F0907E43E0908005F0A5
+:1040B000907689E004F0E004F0E004F075110180EE
+:1040C00019D23BD23C8013D23B800F908005E5177C
+:1040D000F0907689E004F0751101203B04050D8015
+:1040E0001F303C1C907E41E0908005F0907E42E0C5
+:1040F000908005F0907689E004F0E004F0751101FD
+:10410000050F15110100E5117010C233F50DF50F03
+:0B411000907FC77404F0C23BC23C2249
+:104BBB00907FD6E030E712E04401F07F147E0012C4
+:0A4BCB004D2F907FD6E054FEF0223B
+:104AF600907FD6E054FBF0E04408F0304204E044F6
+:104B060002F07FDC7E05124D2F907FD6E054F7F041
+:054B1600E04404F02260
+:104D2F008E358F36E5361536AE35700215354E6039
+:074D3F000512148580EE222D
+:1049FF00E4FE751DFF751E05751F12AB1DAA1EA9BE
+:104A0F001F9000011236AB6402702FCDEECD0EED6C
+:104A1F006F70012290000212370E85F01BF51C6299
+:104A2F001BE51B621CE51C621B29FDE51B3AC9ED4A
+:104A3F00C9751DFFF51E891F80C17B007A007900A3
+:014A4F002244
+:041794008D298B2AE6
+:101798001249FFEA4960571236927E0029FFEE3A55
+:1017A800C9EFC9752BFFF52C892DAB2BAA2CA92DB8
+:1017B8009000011236ABFF64046005EF6405702EDB
+:1017C800EFB404159000021236AB6529700B900037
+:1017D800031236AB652A7001221236927E0029FF69
+:1017E800EE3AC9EFC9752BFFF52C892D80BC7B001B
+:0417F8007A007900FA
+:0117FC0022CA
+:0248B0008F2E49
+:1048B200E4F52F7530FF7531067532BEAB30AA3183
+:1048C200A9329000011236ABB4031FAF2F052FEFB0
+:1048D200652E7001221236927E0029FFEE3AC9EF50
+:1048E200C97530FFF531893280D27B007A007900B8
+:0148F20022A3
+:1005000012011001000000406A08110100010102FF
+:1005100000010902AC01030100803209040000005F
+:10052000010100000A2401000156000201020C240E
+:10053000020101010002000000000D240605010275
+:10054000030000000000000924030204030005006A
+:100550000C24020305020006000000001524060614
+:100560000302000003000300030003000300030074
+:100570000009240304010100060009040100000130
+:100580000200000904010102010200000724010128
+:10059000000100112402010202100344AC0080BBE0
+:1005A0000000770109050A05840101008F07250174
+:1005B0000100000009058F01030001050009040185
+:1005C00002020102000007240101000100112402BF
+:1005D000010203180344AC0080BB00007701090549
+:1005E0000A05460201008F072501010000000905E8
+:1005F0008F01030001050009040200000102000050
+:1006000009040201010102000007240104000100A5
+:100610000E2402010602100244AC0080BB00090552
+:100620008C054C02010000072501000200000904AE
+:1006300002020101020000072401040001000E244F
+:1006400002010603180244AC0080BB0009058C05BA
+:1006500072030100000725010002000009040203E3
+:10066000010102000007240104000100112402011D
+:100670000202100344AC0080BB0000770109058C26
+:1006800005840101000007250100020000090402A1
+:1006900004010102000007240104000100112402EA
+:1006A000010203180344AC0080BB00007701090578
+:1006B0008C0546020100000725010002000004032A
+:1006C0000904180345006D006100670069006300BC
+:1006D000200047006D0062004800220345006D00C5
+:1006E0006100670069006300200045004D0049007B
+:1006F000200036007C00320020006D002A034300F9
+:100700006F006E006600690067007500720061008E
+:10071000740069006F006E002000530074007200C6
+:1007200069006E006700220349006E0074006500D6
+:1007300072006600610063006500200053007400D1
+:0A074000720069006E0067000000FF
+:101485007400F58690FDA57C05A3E582458370F97A
+:011495002234
+:10149600907FD6E04480F0438701000000000022E0
+:1014A600C0D0C0E08FE0C0E08EE0C0E08DE0C0E0DC
+:1014B6008CE0C0E0C082C0830586C084C0857D0004
+:1014C600907FE3747BF0A37480F07C11907F99E0A9
+:1014D6005440DC030214F3B40013907FE27440F02E
+:1014E600907FE5F0907FE27400F00214D29076903F
+:1014F600E0B4011290768FE02DFD907FE27480F0CB
+:10150600907F6C021557B4021290768FE02DFD90F5
+:101516007FE27480F0907F6C021596B40312907689
+:101526008FE02DFD907FE27480F0907F6C0215E1D4
+:10153600B4041290768FE02DFD907FE27480F090D7
+:101546007F6C021610907FE27480F0907F6C02161A
+:1015560040F0F0F0F0F0F0F0F0F0F0F0F0DDF27DB9
+:10156600020586907FE27400F0907F9BE05404B4FD
+:1015760000050586021640907FE27480F00586F02D
+:10158600F0F0F0F0F0F0F0F0F0F0F0DDD4021640FC
+:10159600F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F045
+:1015A600F0F0DDEC7D020586907FE27400F0907F1E
+:1015B6009BE05404B400050586021640907FE27451
+:1015C60080F00586F0F0F0F0F0F0F0F0F0F0F0F0DA
+:0615D600F0F0F0F0F0F06F
+:1015DC00DDCE021640F0F0F0F0DDFA7D02058690CB
+:1015EC007FE27400F0907F9BE05404B40005058604
+:1015FC00021640907FE27480F00586F0F0F0F0DD8A
+:10160C00DC021640F0F0F0F0F0F0DDF87D0205861B
+:10161C00907FE27400F0907F9BE05404B4000505C9
+:10162C0086021640907FE27480F00586F0F0F0F0B0
+:10163C00F0F0DDDA907FE27400F0D085D08405867E
+:10164C00D083D082D0E0FCD0E0FDD0E0FED0E0FF33
+:05165C00D0E0D0D02217
+:10166100C0D0C0E0C082C08390767CE0907F6FF0F4
+:1016710090767DE0907F6FF090767EE0907F6FF0C6
+:09168100D083D082D0E0D0D02249
+:10168A00C0D0C0E08FE0C0E08EE0C0E0C082C0837E
+:10169A000586C084C085907687E0FFBF00030217E5
+:1016AA0001907F96E04480F0907FE27480F0907F12
+:1016BA0062E00586907FE27400F0907F96E0547FA6
+:1016CA00F0907FE27480F090768EE0B40105058692
+:1016DA000216F6B4020505860216EB05860216FB0B
+:1016EA00E0E0E0E0E0E0DFF80216FBE0E0E0E0DF67
+:1016FA00FA907FE27400F0D085D0840586D083D03A
+:0C170A0082D0E0FED0E0FFD0E0D0D02282
+:10171600C082C083C0E0E8C0E078D1E814F870FB6E
+:0A172600D0E0F8D0E0D083D082229A
+:100CA500417201014572050002C9000045720A0042
+:100CB500010203044D720FD100D1000000000000B5
+:100CC500282809004D721C010001020304050607CE
+:100CD50008090A0B41722E2241722F2341723020DE
+:100CE5004172312162D2723A00000000000000001A
+:100CF50000000000000000000000000000000000EF
+:100D050000000000000000000000000000000000DE
+:100D150000000000000000000000000000000000CE
+:100D250000000000000000000000000000000000BE
+:100D350000000000000000000000000000000000AE
+:100D4500000000000000000000000000000000009E
+:100D5500000000000000000000000000000000008E
+:100D6500000000000000000000000000000000007E
+:100D75000000000000000000000001010101010168
+:100D8500010101010101010101010101010101014E
+:100D9500010101010101010101010101010101013E
+:100DA500010101010101010101010101010101012E
+:100DB5000101010101010101020202020202020216
+:100DC50002020202020202020202020202020202FE
+:100DD50002020202020202020202020202020202EE
+:100DE50002020202020202020202020202020202DE
+:100DF50002020202020303030303030303030303C3
+:100E050003030303030303030303030303030303AD
+:100E1500030303030303030303030303030303039D
+:100E2500030303030303030303030303030303038D
+:100E3500030304040404040404040404040404046F
+:100E4500040404040404040404040404040404045D
+:100E5500040404040404040404040404040404044D
+:100E6500040404040404040404040404040404043D
+:100E7500050505050505050505050505050505051D
+:100E8500050505050505050505050505050505050D
+:100E950005050505050505050505050505050505FD
+:100EA50005050505050505050505050505050606EB
+:100EB50006060606060606060606060606060606CD
+:100EC50006060606060606060606060606060606BD
+:100ED50006060606060606060606060606060606AD
+:100EE5000606060606060606060606070707080896
+:100EF500080909090A0A0A0B0B0B0C0C0C0D0D0D40
+:100F05000E0E0E0F0F0F10101011111112121213D9
+:100F15001313141414151515161616171717181874
+:100F250018191919191A1A1A1A1B1B1B1B1C1C1C18
+:100F35001C1D1D1D1D1E1E1E1E1F1F1F1F202020C8
+:100F45002121212222222323242425252626272761
+:100F5500282829292A2A2B2B2C2C2D2D2E2E2F2FD4
+:100F65003030313132323333343435353636373744
+:100F7500383839393A3A3B3C3D3E3F40414243449B
+:100F85004546474849494A4B4B4C4D4E4F505152A7
+:100F95005354555556565757585A5B5D5E5F6162B7
+:100FA500636465666768696A6B6C6D6F717273748B
+:100FB50075767778797A7B7C7E80013701013800F8
+:104AC400E4907236F0A3F0907F97E054FBF0E4900A
+:104AD4007233F0907232F090720104F0E490723309
+:104AE400F0907232F090720104F0907F97E04404E9
+:024AF400F022AE
+:10326F00907618E0FF640570429075ABE0B40119D9
+:10327F009072377401F0E4908020F0908031F090DC
+:10328F008028F0908039F08022E4907237F09075AA
+:10329F00ADE090722BF0E02480F0E0908020F09071
+:1032AF008031F0908028F0908039F0EF6406600252
+:1032BF0081999072397404F0907239E0FF24FE9076
+:1032CF007204F0EF75F00AA424ABF582E43475F5BF
+:1032DF0083E06401705490723604F0907204E0FF42
+:1032EF0024FD602824FE6024240324FB5004601C6A
+:1032FF00818C74202FF582E43480F583E4F07428F8
+:10330F002FF582E43480F583E4F0818C907204E031
+:10331F00FF2430F582E43480F583E4F074382FF520
+:10332F0082E43480F583E4F0818CE4907236F0907F
+:10333F007239E075F00AA424ADF582E43475F58393
+:10334F00E0FF7E0090750CEEF0A3EFF07006907228
+:10335F0002743BF090750CE0FEA3E0FF64804E70AA
+:10336F0004907202F0EF4E70028135EF64804E7060
+:10337F00028135EFF8E490750DF0E890750CF09040
+:10338F007234E075F00AA424ACF582E43475F58349
+:10339F00E0FF907202F090750DE02FF090750CE049
+:1033AF003400F0E0FEA3E0FFE4FCFD7BD67AA5F944
+:1033BF00F8D3123795400A90750C74A5F0A374D604
+:1033CF00F090750DE0242AF090750CE0345AF0E07F
+:1033DF00FEA3E07805CEA2E713CE13D8F8FF9075C1
+:1033EF000CEEF0A3EFF090722CEEF0A3EFF0D3946D
+:1033FF00D2EE64809482400A90722C7402F0A3740F
+:10340F00D2F0C390722CE0648094805004E4F0A357
+:10341F00F090722CE0FEA3E0243AF582EE3472F5C0
+:10342F0083E0907202F0907204E0FF24FD602D247F
+:10343F00FE6029240324FB50046021804090720217
+:10344F00E0FE74202FF582E43480F583EEF07428CB
+:10345F002FF582E43480F583EEF08021907202E044
+:10346F00FF907204E0FE2430F582E43480F583EFA0
+:10347F00F074382EF582E43480F583EFF0907239D2
+:0B348F00E004F0E0640A600241C72284
+:10349A00907618E0FFB40523907237E0701D90759E
+:1034AA00ADE090722BF0E02480F0E0908020F09064
+:1034BA008031F0908028F0908039F0EF6406600245
+:1034CA00C191907236E06002C191907640E070310D
+:1034DA009072037403F0907203E0FF75F00AA4245B
+:1034EA00AAF582E43475F583E0FE907229E0FDEED8
+:1034FA006D600EEFC3940A5008907203E004F080E6
+:10350A00D59072397404F0907640E0700890720396
+:10351A00E0907239F0907239E0FD24FE90722AF040
+:10352A00ED75F00AA424ADF582E43475F583E0FF65
+:10353A007E0090750CEEF0A3EFF0700690720274A4
+:10354A0080F090750CE0FEA3E0FF64804E7004905A
+:10355A007202F0EF4E7002C11BEF64804E7002C11E
+:10356A001BEFF8E490750DF0E890750CF0ED75F02E
+:10357A000AA424ACF582E43475F583E0FF90720264
+:10358A00F090750DE02FF090750CE03400F0E0FE3D
+:10359A00A3E0FFE4FCFD7BD67AA5F9F8D3123795B0
+:1035AA00400A90750C74A5F0A374D6F090750DE0DE
+:1035BA00242AF090750CE0345AF0E0FEA3E0780576
+:1035CA00CEA2E713CE13D8F8FF90750CEEF0A3EF56
+:1035DA00F090722CEEF0A3EFF0D394D2EE648094C4
+:1035EA0082400A90722C7402F0A374D2F0C39072D3
+:1035FA002CE0648094805004E4F0A3F090722CE0F4
+:10360A00FEA3E0243AF582EE3472F583E09072026A
+:10361A00F090722AE0FF24FD602D24FE6029240325
+:10362A0024FB500460218040907202E0FE74202F37
+:10363A00F582E43480F583EEF074282FF582E434C1
+:10364A0080F583EEF08021907202E0FF90722AE00A
+:10365A00FE2430F582E43480F583EFF074382EF5D9
+:10366A0082E43480F583EFF0907640E07006907241
+:10367A0039740AF0907239E004F0E0C3940A5002F7
+:08368A00A111E4907640F0224A
+:044D9700121730229D
+:104958009076467480F0E4A3F0A3F0A3F0A3F0A34C
+:10496800F0A3F0A3F0A3F0A37480F0E4A3F0A3F005
+:10497800A3F0A3F0A3F0A3F0A37440F0E4A3F0A382
+:104988007440F0E4A3F0A3F0A3F0A3F0A3F0A3F025
+:10499800A37440F0E4A3F0A37440F0E4A3F0A3F000
+:0549A800A3F0A3F022C2
+:100FC600E4FF74462FF582E43476F583E0FE742060
+:100FD6002FF582E43480F583EEF0744E2FF582E42B
+:100FE6003476F583E0FE74302FF582E43480F583A1
+:060FF600EEF00FBF08CC75
+:010FFC0022D2
+:104A8D00E4FF74562FF582E43476F583E0FE742846
+:104A9D002FF582E43480F583EEF0745E2FF582E419
+:104AAD003476F583E0FE74382FF582E43480F58397
+:064ABD00EEF00FBF08CC73
+:014AC30022D0
+:10173000C082C083C0E0E8C0E07878E814F870FBAD
+:0A174000D0E0F8D0E0D083D0822280
+:030043000249006F
+:10490000022FE700023D4700024D4600024BD50052
+:10491000024B6000022FFF00024BED00024B8100B2
+:10492000024C0400023FD500024C1B00024C320036
+:10493000024C4900024C6000024C7700024C8E0091
+:10494000024CA500024CBC00024CD300024CEA0011
+:08495000024D0100024D1800A8
+:101B40000000000000000000000000000000000095
+:101B50000000000000000000000000000000000085
+:101B60000000000000000000000000000000000075
+:101B70000000000000000000000000000000000065
+:101B80000000000000000000000000000000000055
+:101B90000000000000000000000000000000000045
+:101BA0000000000000000000000000000000000035
+:101BB0000000000000000000000000000000000025
+:101BC0000000000000000000000000000000000015
+:101BD0000000000000000000000000000000000005
+:101BE00000000000000000000000000000000000F5
+:101BF00000000000000000000000000000000000E5
+:101C000000000000000000000000000000000000D4
+:101C100000000000000000000000000000000000C4
+:101C200000000000000000000000000000000000B4
+:101C300000000000000000000000000000000000A4
+:101C40000000000000000000000000000000000094
+:101C50000000000000000000000000000000000084
+:101C60000000000000000000000000000000000074
+:101C70000000000000000000000000000000000064
+:101C80000000000000000000000000000000000054
+:101C90000000000000000000000000000000000044
+:101CA0000000000000000000000000000000000034
+:101CB0000000000000000000000000000000000024
+:101CC0000000000000000000000000000000000014
+:101CD0000000000000000000000000000000000004
+:101CE00000000000000000000000000000000000F4
+:101CF00000000000000000000000000000000000E4
+:101D000000000000000000000000000000000000D3
+:101D100000000000000000000000000000000000C3
+:101D200000000000000000000000000000000000B3
+:101D300000000000000000000000000000000000A3
+:101D40000000000000000000000000000000000093
+:101D50000000000000000000000000000000000083
+:101D60000000000000000000000000000000000073
+:101D70000000000000000000000000000000000063
+:101D80000000000000000000000000000000000053
+:101D90000000000000000000000000000000000043
+:101DA0000000000000000000000000000000000033
+:101DB0000000000000000000000000000000000023
+:101DC0000000000000000000000000000000000013
+:101DD0000000000000000000000000000000000003
+:101DE00000000000000000000000000000000000F3
+:101DF00000000000000000000000000000000000E3
+:101E000000000000000000000000000000000000D2
+:101E100000000000000000000000000000000000C2
+:101E200000000000000000000000000000000000B2
+:101E300000000000000000000000000000000000A2
+:101E40000000000000000000000000000000000092
+:101E50000000000000000000000000000000000082
+:101E60000000000000000000000000000000000072
+:101E70000000000000000000000000000000000062
+:101E80000000000000000000000000000000000052
+:101E90000000000000000000000000000000000042
+:101EA0000000000000000000000000000000000032
+:0E1EB000000000000000000000000000000024
+:101EBE000000000000000000000000000000000014
+:101ECE000000000000000000000000000000000004
+:101EDE0000000000000000000000000000000000F4
+:101EEE0000000000000000000000000000000000E4
+:101EFE0000000000000000000000000000000000D4
+:101F0E0000000000000000000000000000000000C3
+:101F1E0000000000000000000000000000000000B3
+:101F2E0000000000000000000000000000000000A3
+:021F3E000000A1
+:101F40000000000000000000000000000000000091
+:101F50000000000000000000000000000000000081
+:101F60000000000000000000000000000000000071
+:101F70000000000000000000000000000000000061
+:101F80000000000000000000000000000000000051
+:101F90000000000000000000000000000000000041
+:101FA0000000000000000000000000000000000031
+:101FB0000000000000000000000000000000000021
+:101FC0000000000000000000000000000000000011
+:101FD0000000000000000000000000000000000001
+:101FE00000000000000000000000000000000000F1
+:101FF00000000000000000000000000000000000E1
+:1020000000000000000000000000000000000000D0
+:1020100000000000000000000000000000000000C0
+:1020200000000000000000000000000000000000B0
+:1020300000000000000000000000000000000000A0
+:102040000000000000000000000000000000000090
+:102050000000000000000000000000000000000080
+:102060000000000000000000000000000000000070
+:102070000000000000000000000000000000000060
+:102080000000000000000000000000000000000050
+:102090000000000000000000000000000000000040
+:1020A0000000000000000000000000000000000030
+:1020B0000000000000000000000000000000000020
+:1020C0000000000000000000000000000000000010
+:1020D0000000000000000000000000000000000000
+:1020E00000000000000000000000000000000000F0
+:1020F00000000000000000000000000000000000E0
+:1021000000000000000000000000000000000000CF
+:1021100000000000000000000000000000000000BF
+:1021200000000000000000000000000000000000AF
+:10213000000000000000000000000000000000009F
+:10214000000000000000000000000000000000008F
+:10215000000000000000000000000000000000007F
+:10216000000000000000000000000000000000006F
+:10217000000000000000000000000000000000005F
+:10218000000000000000000000000000000000004F
+:10219000000000000000000000000000000000003F
+:1021A000000000000000000000000000000000002F
+:1021B000000000000000000000000000000000001F
+:1021C000000000000000000000000000000000000F
+:1021D00000000000000000000000000000000000FF
+:1021E00000000000000000000000000000000000EF
+:1021F00000000000000000000000000000000000DF
+:1022000000000000000000000000000000000000CE
+:1022100000000000000000000000000000000000BE
+:1022200000000000000000000000000000000000AE
+:10223000000000000000000000000000000000009E
+:10224000000000000000000000000000000000008E
+:10225000000000000000000000000000000000007E
+:10226000000000000000000000000000000000006E
+:10227000000000000000000000000000000000005E
+:10228000000000000000000000000000000000004E
+:10229000000000000000000000000000000000003E
+:1022A000000000000000000000000000000000002E
+:1022B000000000000000000000000000000000001E
+:1022C000000000000000000000000000000000000E
+:1022D00000000000000000000000000000000000FE
+:1022E00000000000000000000000000000000000EE
+:1022F00000000000000000000000000000000000DE
+:1023000000000000000000000000000000000000CD
+:1023100000000000000000000000000000000000BD
+:1023200000000000000000000000000000000000AD
+:10233000000000000000000000000000000000009D
+:10234000000000000000000000000000000000008D
+:10235000000000000000000000000000000000007D
+:10236000000000000000000000000000000000006D
+:0E23700000000000000000000000000000005F
+:10237E00000000000000000000000000000000004F
+:10238E00000000000000000000000000000000003F
+:10239E00000000000000000000000000000000002F
+:1023AE00000000000000000000000000000000001F
+:1023BE00000000000000000000000000000000000F
+:1023CE0000000000000000000000000000000000FF
+:1023DE0000000000000000000000000000000000EF
+:1023EE0000000000000000000000000000000000DF
+:1023FE0000000000000000000000000000000000CF
+:10240E0000000000000000000000000000000000BE
+:10241E0000000000000000000000000000000000AE
+:10242E00000000000000000000000000000000009E
+:10243E00000000000000000000000000000000008E
+:10244E00000000000000000000000000000000007E
+:10245E00000000000000000000000000000000006E
+:10246E00000000000000000000000000000000005E
+:10247E00000000000000000000000000000000004E
+:10248E00000000000000000000000000000000003E
+:10249E00000000000000000000000000000000002E
+:1024AE00000000000000000000000000000000001E
+:1024BE00000000000000000000000000000000000E
+:1024CE0000000000000000000000000000000000FE
+:1024DE0000000000000000000000000000000000EE
+:1024EE0000000000000000000000000000000000DE
+:1024FE0000000000000000000000000000000000CE
+:10250E0000000000000000000000000000000000BD
+:10251E0000000000000000000000000000000000AD
+:10252E00000000000000000000000000000000009D
+:10253E00000000000000000000000000000000008D
+:10254E00000000000000000000000000000000007D
+:10255E00000000000000000000000000000000006D
+:10256E00000000000000000000000000000000005D
+:10257E00000000000000000000000000000000004D
+:10258E00000000000000000000000000000000003D
+:10259E00000000000000000000000000000000002D
+:1025AE00000000000000000000000000000000001D
+:1025BE00000000000000000000000000000000000D
+:1025CE0000000000000000000000000000000000FD
+:1025DE0000000000000000000000000000000000ED
+:1025EE0000000000000000000000000000000000DD
+:1025FE0000000000000000000000000000000000CD
+:10260E0000000000000000000000000000000000BC
+:10261E0000000000000000000000000000000000AC
+:10262E00000000000000000000000000000000009C
+:10263E00000000000000000000000000000000008C
+:10264E00000000000000000000000000000000007C
+:10265E00000000000000000000000000000000006C
+:10266E00000000000000000000000000000000005C
+:10267E00000000000000000000000000000000004C
+:10268E00000000000000000000000000000000003C
+:10269E00000000000000000000000000000000002C
+:1026AE00000000000000000000000000000000001C
+:1026BE00000000000000000000000000000000000C
+:1026CE0000000000000000000000000000000000FC
+:1026DE0000000000000000000000000000000000EC
+:0E26EE000000000000000000000000000000DE
+:1026FC0000000000000000000000000000000000CE
+:10270C0000000000000000000000000000000000BD
+:10271C0000000000000000000000000000000000AD
+:10272C00000000000000000000000000000000009D
+:10273C00000000000000000000000000000000008D
+:10274C00000000000000000000000000000000007D
+:10275C00000000000000000000000000000000006D
+:10276C00000000000000000000000000000000005D
+:10277C00000000000000000000000000000000004D
+:10278C00000000000000000000000000000000003D
+:10279C00000000000000000000000000000000002D
+:1027AC00000000000000000000000000000000001D
+:1027BC00000000000000000000000000000000000D
+:1027CC0000000000000000000000000000000000FD
+:1027DC0000000000000000000000000000000000ED
+:1027EC0000000000000000000000000000000000DD
+:0527FC000000000022B6
+:07174A00907FC57402F0223C
+:10175100907EC0E0907645F0907EC1E0907644F0B6
+:10176100907EC2E0907643F0B40003021778907641
+:10177100197403F002178E907644E0B4BB09907699
+:10178100197402F002178E9076197401F090764266
+:03179100E4F0225F
+:030000000245F9BD
+:0C45F900787FE4F6D8FD7581380246405A
+:10369200BB010689828A83E0225002E722BBFE0236
+:0936A200E32289828A83E4932269
+:1036AB00BB010CE58229F582E5833AF583E02250D4
+:1036BB0006E92582F8E622BBFE06E92582F8E2221E
+:0D36CB00E58229F582E5833AF583E4932238
+:1036D800C2D5EC30E709B2D5E4C39DFDE49CFCEE0D
+:1036E80030E715B2D5E4C39FFFE49EFE12381FC32E
+:1036F800E49DFDE49CFC800312381F30D507C3E429
+:063708009FFFE49EFE227B
+:10370E00BB0110E58229F582E5833AF583E0F5F0F9
+:10371E00A3E0225009E92582F886F008E622BBFED6
+:10372E000AE92582F8E2F5F008E222E5832AF5831C
+:08373E00E993F5F0A3E99322E1
+:10374600E88FF0A4CC8BF0A42CFCE98EF0A42CFC22
+:103756008AF0EDA42CFCEA8EF0A4CDA8F08BF0A4A0
+:103766002DCC3825F0FDE98FF0A42CCD35F0FCEBFF
+:103776008EF0A4FEA9F0EB8FF0A4CFC5F02ECD39C4
+:0F378600FEE43CFCEAA42DCE35F0FDE43CFC2231
+:10379500EB9FF5F0EA9E42F0E99D42F0EC6480C8AB
+:0637A50064809845F0224B
+:1037AB00EB9FF5F0EA9E42F0E99D42F0E89C45F074
+:0137BB0022EB
+:0C37BC00ECF0A3EDF0A3EEF0A3EFF02280
+:1037C800A8828583F0D083D0821237DF1237DF12C8
+:1037D80037DF1237DFE473E493A3C583C5F0C583ED
+:1037E800C8C582C8F0A3C583C5F0C583C8C582C84B
+:0137F80022AE
+:1037F900D083D082F8E4937012740193700DA3A35F
+:1038090093F8740193F5828883E473740293686072
+:06381900EFA3A3A380DF72
+:1046050002475AE493A3F8E493A34003F68001F22A
+:1046150008DFF48029E493A3F85407240CC8C333B6
+:10462500C4540F4420C8834004F456800146F6DF85
+:10463500E4800B0102040810204080900C8FE47E7A
+:10464500019360BCA3FF543F30E509541FFEE4937A
+:10465500A360010ECF54C025E060A840B8E493A341
+:10466500FAE493A3F8E493A3C8C582C8CAC583CA6C
+:10467500F0A3C8C582C8CAC583CADFE9DEE780BE24
+:010FC500002B
+:10381F00BC000BBE0029EF8DF084FFADF022E4CC8D
+:10382F00F875F008EF2FFFEE33FEEC33FCEE9DEC56
+:10383F00984005FCEE9DFE0FD5F0E9E4CEFD22ED9C
+:10384F00F8F5F0EE8420D21CFEADF075F008EF2FE6
+:10385F00FFED33FD4007985006D5F0F222C398FDD7
+:05386F000FD5F0EA2274
+:00000001FF
+*/
+/*
+VERSION=1.04.062
+DATE=16.10.2002  
+*/INTEL_HEX_RECORD g_emi62_loader[] = {
+ { 3,0x0000,0,{0x02,0x02,0x87}},
+ { 3,0x0043,0,{0x02,0x04,0x00}},
+ {16,0x0100,0,{0xe4,0xff,0xfe,0xc2,0x20,0xd2,0xe8,0x43,0xd8,0x20,0x90,0x7f,0xab,0x74,0xff,0xf0}},
+ {16,0x0110,0,{0x90,0x7f,0xa9,0xf0,0x90,0x7f,0xaa,0xf0,0x53,0x91,0xef,0x90,0x7f,0x95,0x74,0xc0}},
+ {16,0x0120,0,{0xf0,0x90,0x7f,0x9e,0xf0,0x90,0x7f,0x98,0xf0,0xe4,0x90,0x7f,0x94,0xf0,0x90,0x7f}},
+ {16,0x0130,0,{0x9d,0x74,0xff,0xf0,0x90,0x7f,0x97,0x74,0xa0,0xf0,0x90,0x7f,0x93,0xe0,0x54,0xfc}},
+ {16,0x0140,0,{0xf0,0x90,0x7f,0x9c,0x74,0x03,0xf0,0xe4,0x90,0x7f,0x96,0xf0,0x90,0x7f,0xaf,0xe0}},
+ {16,0x0150,0,{0x44,0x01,0xf0,0x90,0x7f,0xae,0xe0,0x44,0x0d,0xf0,0xd2,0xaf,0x0f,0xbf,0x00,0x01}},
+ {16,0x0160,0,{0x0e,0xbe,0x07,0xf8,0xbf,0x08,0xf5,0x20,0x20,0x42,0x75,0x14,0x00,0x75,0x13,0x00}},
+ {16,0x0170,0,{0x75,0x12,0x00,0x75,0x11,0x00,0x7f,0x48,0x7e,0x92,0x7d,0x00,0x7c,0x00,0xab,0x14}},
+ {16,0x0180,0,{0xaa,0x13,0xa9,0x12,0xa8,0x11,0xc3,0x12,0x03,0xed,0x50,0xdb,0x20,0x20,0xd8,0x7a}},
+ {16,0x0190,0,{0x00,0x79,0x00,0x78,0x00,0xe5,0x14,0x24,0x01,0xf5,0x14,0xea,0x35,0x13,0xf5,0x13}},
+ {16,0x01a0,0,{0xe9,0x35,0x12,0xf5,0x12,0xe8,0x35,0x11,0xf5,0x11,0x80,0xca,0x30,0x20,0xfd,0x12}},
+ {16,0x01b0,0,{0x01,0xc7,0x50,0x07,0x90,0x7f,0xb4,0xe0,0x44,0x01,0xf0,0x90,0x7f,0xb4,0xe0,0x44}},
+ { 6,0x01c0,0,{0x02,0xf0,0xc2,0x20,0x80,0xe6}},
+ { 1,0x01c6,0,{0x22}},
+ {16,0x01c7,0,{0x90,0x7f,0xe9,0xe0,0x24,0x5b,0x60,0x60,0x24,0x02,0x60,0x03,0x02,0x02,0x85,0x90}},
+ {16,0x01d7,0,{0x7f,0xea,0xe0,0x75,0x0a,0x00,0xf5,0x0b,0xa3,0xe0,0xfe,0xe4,0xee,0x42,0x0a,0x90}},
+ {16,0x01e7,0,{0x7f,0xee,0xe0,0x75,0x15,0x00,0xf5,0x16,0xa3,0xe0,0xfe,0xe4,0xee,0x42,0x15,0xe5}},
+ {16,0x01f7,0,{0x16,0x45,0x15,0x70,0x03,0x02,0x02,0x85,0xe4,0x90,0x7f,0xc5,0xf0,0x90,0x7f,0xb4}},
+ {16,0x0207,0,{0xe0,0x20,0xe3,0xf9,0x90,0x7f,0xc5,0xe0,0xf5,0x0c,0x12,0x03,0x13,0xaf,0x0c,0x7e}},
+ {16,0x0217,0,{0x00,0xef,0x25,0x0b,0xf5,0x0b,0xee,0x35,0x0a,0xf5,0x0a,0xc3,0xe5,0x16,0x9f,0xf5}},
+ {16,0x0227,0,{0x16,0xe5,0x15,0x9e,0xf5,0x15,0x80,0xc7,0x90,0x7f,0xea,0xe0,0x75,0x0a,0x00,0xf5}},
+ {16,0x0237,0,{0x0b,0xa3,0xe0,0xfe,0xe4,0xee,0x42,0x0a,0x90,0x7f,0xee,0xe0,0x75,0x15,0x00,0xf5}},
+ {16,0x0247,0,{0x16,0xa3,0xe0,0xfe,0xe4,0xee,0x42,0x15,0xe5,0x16,0x45,0x15,0x60,0x30,0xe4,0x90}},
+ {16,0x0257,0,{0x7f,0xc5,0xf0,0x90,0x7f,0xb4,0xe0,0x20,0xe3,0xf9,0x90,0x7f,0xc5,0xe0,0xf5,0x0c}},
+ {16,0x0267,0,{0x12,0x03,0x2b,0xaf,0x0c,0x7e,0x00,0xef,0x25,0x0b,0xf5,0x0b,0xee,0x35,0x0a,0xf5}},
+ {15,0x0277,0,{0x0a,0xc3,0xe5,0x16,0x9f,0xf5,0x16,0xe5,0x15,0x9e,0xf5,0x15,0x80,0xca,0xc3}},
+ { 1,0x0286,0,{0x22}},
+ {12,0x0287,0,{0x78,0x7f,0xe4,0xf6,0xd8,0xfd,0x75,0x81,0x29,0x02,0x02,0xce}},
+ {16,0x0293,0,{0x02,0x01,0x00,0xe4,0x93,0xa3,0xf8,0xe4,0x93,0xa3,0x40,0x03,0xf6,0x80,0x01,0xf2}},
+ {16,0x02a3,0,{0x08,0xdf,0xf4,0x80,0x29,0xe4,0x93,0xa3,0xf8,0x54,0x07,0x24,0x0c,0xc8,0xc3,0x33}},
+ {16,0x02b3,0,{0xc4,0x54,0x0f,0x44,0x20,0xc8,0x83,0x40,0x04,0xf4,0x56,0x80,0x01,0x46,0xf6,0xdf}},
+ {16,0x02c3,0,{0xe4,0x80,0x0b,0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x90,0x04,0x6e,0xe4,0x7e}},
+ {16,0x02d3,0,{0x01,0x93,0x60,0xbc,0xa3,0xff,0x54,0x3f,0x30,0xe5,0x09,0x54,0x1f,0xfe,0xe4,0x93}},
+ {16,0x02e3,0,{0xa3,0x60,0x01,0x0e,0xcf,0x54,0xc0,0x25,0xe0,0x60,0xa8,0x40,0xb8,0xe4,0x93,0xa3}},
+ {16,0x02f3,0,{0xfa,0xe4,0x93,0xa3,0xf8,0xe4,0x93,0xa3,0xc8,0xc5,0x82,0xc8,0xca,0xc5,0x83,0xca}},
+ {16,0x0303,0,{0xf0,0xa3,0xc8,0xc5,0x82,0xc8,0xca,0xc5,0x83,0xca,0xdf,0xe9,0xde,0xe7,0x80,0xbe}},
+ {16,0x0313,0,{0xe5,0x0c,0xff,0xe5,0x0b,0xf5,0x82,0xe5,0x0a,0xf5,0x83,0x75,0x92,0x7e,0x74,0xc0}},
+ { 8,0x0323,0,{0xf8,0xe2,0x08,0xf0,0xa3,0xdf,0xfa,0x22}},
+ {16,0x032b,0,{0x90,0x7f,0x96,0x85,0x83,0x92,0xa8,0x82,0x79,0x02,0x90,0x00,0x00,0xe0,0xb4,0x00}},
+ {16,0x033b,0,{0x0d,0x74,0x01,0xf0,0x90,0x7f,0x97,0xe0,0x54,0x7f,0xf0,0x44,0x80,0xf0,0xe5,0x0c}},
+ {16,0x034b,0,{0xff,0x90,0x7e,0xc0,0xe0,0xf5,0x28,0xe4,0xa2,0x47,0x33,0xf2,0x69,0xf2,0xe4,0xa2}},
+ {16,0x035b,0,{0x46,0x33,0xf2,0x69,0xf2,0xe4,0xa2,0x45,0x33,0xf2,0x69,0xf2,0xe4,0xa2,0x44,0x33}},
+ {16,0x036b,0,{0xf2,0x69,0xf2,0xe4,0xa2,0x43,0x33,0xf2,0x69,0xf2,0xe4,0xa2,0x42,0x33,0xf2,0x69}},
+ {16,0x037b,0,{0xf2,0xe4,0xa2,0x41,0x33,0xf2,0x69,0xf2,0xe4,0xa2,0x40,0x33,0xf2,0x69,0xf2,0xa3}},
+ { 3,0x038b,0,{0xdf,0xc2,0x22}},
+ {16,0x038e,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x90,0x7f,0xc4,0xe4,0xf0,0x53,0x91,0xef,0x90,0x7f}},
+ {11,0x039e,0,{0xab,0x74,0x04,0xf0,0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x03a9,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0xd2,0x20,0x53,0x91,0xef,0x90,0x7f,0xab,0x74,0x01}},
+ { 8,0x03b9,0,{0xf0,0xd0,0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x03c1,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xab,0x74,0x02,0xf0,0xd0}},
+ { 6,0x03d1,0,{0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x03d7,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xab,0x74,0x10,0xf0,0xd0}},
+ { 6,0x03e7,0,{0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x03ed,0,{0xeb,0x9f,0xf5,0xf0,0xea,0x9e,0x42,0xf0,0xe9,0x9d,0x42,0xf0,0xe8,0x9c,0x45,0xf0}},
+ { 1,0x03fd,0,{0x22}},
+ { 1,0x03fe,0,{0x32}},
+ { 1,0x03ff,0,{0x32}},
+ {16,0x0400,0,{0x02,0x03,0xa9,0x00,0x02,0x03,0xc1,0x00,0x02,0x03,0x8e,0x00,0x02,0x04,0x58,0x00}},
+ {16,0x0410,0,{0x02,0x03,0xd7,0x00,0x02,0x03,0xfe,0x00,0x02,0x03,0xff,0x00,0x02,0x04,0x84,0x00}},
+ {16,0x0420,0,{0x02,0x04,0x85,0x00,0x02,0x04,0x86,0x00,0x02,0x04,0x87,0x00,0x02,0x04,0x88,0x00}},
+ {16,0x0430,0,{0x02,0x04,0x89,0x00,0x02,0x04,0x8a,0x00,0x02,0x04,0x8b,0x00,0x02,0x04,0x8c,0x00}},
+ {16,0x0440,0,{0x02,0x04,0x8d,0x00,0x02,0x04,0x8e,0x00,0x02,0x04,0x8f,0x00,0x02,0x04,0x90,0x00}},
+ { 8,0x0450,0,{0x02,0x04,0x91,0x00,0x02,0x04,0x92,0x00}},
+ {16,0x0458,0,{0xc0,0xe0,0xc0,0x83,0xc0,0x82,0x53,0x91,0xef,0x90,0x7f,0xab,0x74,0x08,0xf0,0xd0}},
+ { 6,0x0468,0,{0x82,0xd0,0x83,0xd0,0xe0,0x32}},
+ {16,0x046e,0,{0x02,0x0a,0x00,0x0f,0x01,0x0c,0x11,0x04,0x0d,0x00,0x00,0x00,0x00,0x41,0x00,0x00}},
+ { 1,0x047e,0,{0x00}},
+ { 4,0x047f,0,{0x02,0x17,0x00,0x00}},
+ { 1,0x0483,0,{0x00}},
+ { 1,0x0484,0,{0x32}},
+ { 1,0x0485,0,{0x32}},
+ { 1,0x0486,0,{0x32}},
+ { 1,0x0487,0,{0x32}},
+ { 1,0x0488,0,{0x32}},
+ { 1,0x0489,0,{0x32}},
+ { 1,0x048a,0,{0x32}},
+ { 1,0x048b,0,{0x32}},
+ { 1,0x048c,0,{0x32}},
+ { 1,0x048d,0,{0x32}},
+ { 1,0x048e,0,{0x32}},
+ { 1,0x048f,0,{0x32}},
+ { 1,0x0490,0,{0x32}},
+ { 1,0x0491,0,{0x32}},
+ { 1,0x0492,0,{0x32}},
+ {16,0x1100,0,{0x12,0x01,0x10,0x01,0x00,0x00,0x00,0x40,0x6a,0x08,0x01,0x01,0x00,0x01,0x01,0x02}},
+ {16,0x1110,0,{0x00,0x01,0x09,0x02,0x20,0x00,0x01,0x01,0x03,0xa0,0x00,0x09,0x04,0x00,0x00,0x02}},
+ {16,0x1120,0,{0xff,0x00,0x00,0x04,0x07,0x05,0x82,0x02,0x40,0x00,0x00,0x07,0x05,0x02,0x02,0x40}},
+ {16,0x1130,0,{0x00,0x00,0x04,0x03,0x09,0x04,0x26,0x03,0x41,0x00,0x6e,0x00,0x63,0x00,0x68,0x00}},
+ {16,0x1140,0,{0x6f,0x00,0x72,0x00,0x20,0x00,0x43,0x00,0x68,0x00,0x69,0x00,0x70,0x00,0x73,0x00}},
+ {16,0x1150,0,{0x2c,0x00,0x20,0x00,0x49,0x00,0x6e,0x00,0x63,0x00,0x2e,0x00,0x28,0x03,0x46,0x00}},
+ {16,0x1160,0,{0x69,0x00,0x72,0x00,0x6d,0x00,0x77,0x00,0x61,0x00,0x72,0x00,0x65,0x00,0x20,0x00}},
+ {16,0x1170,0,{0x46,0x00,0x72,0x00,0x61,0x00,0x6d,0x00,0x65,0x00,0x57,0x00,0x6f,0x00,0x72,0x00}},
+ {16,0x1180,0,{0x6b,0x00,0x73,0x00,0x2a,0x03,0x43,0x00,0x6f,0x00,0x6e,0x00,0x66,0x00,0x69,0x00}},
+ {16,0x1190,0,{0x67,0x00,0x75,0x00,0x72,0x00,0x61,0x00,0x74,0x00,0x69,0x00,0x6f,0x00,0x6e,0x00}},
+ {16,0x11a0,0,{0x20,0x00,0x53,0x00,0x74,0x00,0x72,0x00,0x69,0x00,0x6e,0x00,0x67,0x00,0x22,0x03}},
+ {16,0x11b0,0,{0x49,0x00,0x6e,0x00,0x74,0x00,0x65,0x00,0x72,0x00,0x66,0x00,0x61,0x00,0x63,0x00}},
+ {16,0x11c0,0,{0x65,0x00,0x20,0x00,0x53,0x00,0x74,0x00,0x72,0x00,0x69,0x00,0x6e,0x00,0x67,0x00}},
+ { 2,0x11d0,0,{0x00,0x00}},
+ { 0,0x0000,1,{0}}
+};
+/* Source: EMILOAD.HEX 
+:10046E00020A000F010C11040D00000000410000F3
+:01047E00007D
+:1001C700907FE9E0245B606024026003020285906F
+:1001D7007FEAE0750A00F50BA3E0FEE4EE420A9021
+:1001E7007FEEE0751500F516A3E0FEE4EE4215E597
+:1001F7001645157003020285E4907FC5F0907FB421
+:10020700E020E3F9907FC5E0F50C120313AF0C7EF5
+:1002170000EF250BF50BEE350AF50AC3E5169FF53A
+:1002270016E5159EF51580C7907FEAE0750A00F57B
+:100237000BA3E0FEE4EE420A907FEEE0751500F5B1
+:1002470016A3E0FEE4EE4215E51645156030E4908E
+:100257007FC5F0907FB4E020E3F9907FC5E0F50C0F
+:1002670012032BAF0C7E00EF250BF50BEE350AF5CD
+:0F0277000AC3E5169FF516E5159EF51580CAC357
+:010286002255
+:1003A900C0E0C083C082D2205391EF907FAB74012B
+:0803B900F0D082D083D0E032C5
+:10038E00C0E0C083C082907FC4E4F05391EF907FB1
+:0B039E00AB7404F0D082D083D0E032BA
+:1003C100C0E0C083C0825391EF907FAB7402F0D044
+:0603D10082D083D0E0326F
+:1003D700C0E0C083C0825391EF907FAB7410F0D020
+:0603E70082D083D0E03259
+:0103FE0032CC
+:10045800C0E0C083C0825391EF907FAB7408F0D0A6
+:0604680082D083D0E032D7
+:0103FF0032CB
+:010484003245
+:010485003244
+:010486003243
+:010487003242
+:010488003241
+:010489003240
+:01048A00323F
+:01048B00323E
+:01048C00323D
+:01048D00323C
+:01048E00323B
+:01048F00323A
+:010490003239
+:010491003238
+:010492003237
+:04047F000217000060
+:10010000E4FFFEC220D2E843D820907FAB74FFF01A
+:10011000907FA9F0907FAAF05391EF907F9574C0E3
+:10012000F0907F9EF0907F98F0E4907F94F0907F25
+:100130009D74FFF0907F9774A0F0907F93E054FC43
+:10014000F0907F9C7403F0E4907F96F0907FAFE096
+:100150004401F0907FAEE0440DF0D2AF0FBF00013C
+:100160000EBE07F8BF08F520204275140075130075
+:100170007512007511007F487E927D007C00AB14E3
+:10018000AA13A912A811C31203ED50DB2020D87ABC
+:100190000079007800E5142401F514EA3513F5130D
+:1001A000E93512F512E83511F51180CA3020FD123B
+:1001B00001C75007907FB4E04401F0907FB4E04461
+:0601C00002F0C22080E6FF
+:0101C6002216
+:1011000012011001000000406A0801010001010203
+:10111000000109022000010103A0000904000002EF
+:10112000FF0000040705820240000007050202409C
+:10113000000004030904260341006E0063006800F8
+:101140006F007200200043006800690070007300A7
+:101150002C00200049006E0063002E00280346008A
+:10116000690072006D007700610072006500200068
+:101170004600720061006D00650057006F0072004C
+:101180006B0073002A0343006F006E006600690065
+:101190006700750072006100740069006F006E00E6
+:1011A000200053007400720069006E006700220383
+:1011B00049006E0074006500720066006100630003
+:1011C0006500200053007400720069006E00670023
+:0211D00000001D
+:10031300E50CFFE50BF582E50AF58375927E74C063
+:08032300F8E208F0A3DFFA2262
+:10032B00907F96858392A8827902900000E0B400BA
+:10033B000D7401F0907F97E0547FF04480F0E50C52
+:10034B00FF907EC0E0F528E4A24733F269F2E4A205
+:10035B004633F269F2E4A24533F269F2E4A2443384
+:10036B00F269F2E4A24333F269F2E4A24233F26996
+:10037B00F2E4A24133F269F2E4A24033F269F2A350
+:03038B00DFC222AC
+:03004300020400B4
+:100400000203A9000203C10002038E000204580087
+:100410000203D7000203FE000203FF00020484006F
+:10042000020485000204860002048700020488009A
+:100430000204890002048A0002048B0002048C007A
+:1004400002048D0002048E0002048F00020490005A
+:08045000020491000204920075
+:0300000002028772
+:0C028700787FE4F6D8FD7581290202CED4
+:1003ED00EB9FF5F0EA9E42F0E99D42F0E89C45F066
+:0103FD0022DD
+:10029300020100E493A3F8E493A34003F68001F280
+:1002A30008DFF48029E493A3F85407240CC8C3336C
+:1002B300C4540F4420C8834004F456800146F6DF3B
+:1002C300E4800B010204081020408090046EE47E59
+:1002D300019360BCA3FF543F30E509541FFEE49330
+:1002E300A360010ECF54C025E060A840B8E493A3F7
+:1002F300FAE493A3F8E493A3C8C582C8CAC583CA22
+:10030300F0A3C8C582C8CAC583CADFE9DEE780BED9
+:010483000078
+:00000001FF
+*/
+/*
+VERSION=1.0.2.002
+DATE=10.01.2002
+EMI26_62
+*/
diff -Nru a/drivers/usb/misc/tiglusb.c b/drivers/usb/misc/tiglusb.c
--- a/drivers/usb/misc/tiglusb.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/usb/misc/tiglusb.c	Tue Feb  3 19:45:16 2004
@@ -161,7 +161,7 @@
 	int bytes_to_read = 0;
 	int bytes_read = 0;
 	int result = 0;
-	char buffer[BULK_RCV_MAX];
+	char *buffer;
 	unsigned int pipe;
 
 	if (*f_pos)
@@ -173,6 +173,10 @@
 	if (!s->dev)
 		return -EIO;
 
+	buffer = kmalloc(BULK_RCV_MAX, GFP_KERNEL);
+	if (!buffer)
+		return -ENOMEM;
+
 	bytes_to_read = (count >= BULK_RCV_MAX) ? BULK_RCV_MAX : count;
 
 	pipe = usb_rcvbulkpipe (s->dev, 1);
@@ -203,6 +207,7 @@
 	}
 
       out:
+	kfree(buffer);
 	return ret ? ret : bytes_read;
 }
 
@@ -214,7 +219,7 @@
 	int bytes_to_write = 0;
 	int bytes_written = 0;
 	int result = 0;
-	char buffer[BULK_SND_MAX];
+	char *buffer;
 	unsigned int pipe;
 
 	if (*f_pos)
@@ -226,6 +231,10 @@
 	if (!s->dev)
 		return -EIO;
 
+	buffer = kmalloc(BULK_SND_MAX, GFP_KERNEL);
+	if (!buffer)
+		return -ENOMEM;
+
 	bytes_to_write = (count >= BULK_SND_MAX) ? BULK_SND_MAX : count;
 	if (copy_from_user (buffer, buf, bytes_to_write)) {
 		ret = -EFAULT;
@@ -258,6 +267,7 @@
 	}
 
       out:
+	kfree(buffer);
 	return ret ? ret : bytes_written;
 }
 
@@ -387,7 +397,11 @@
 static void
 tiglusb_disconnect (struct usb_interface *intf)
 {
+	wait_queue_t __wait;
 	ptiglusb_t s = usb_get_intfdata (intf);
+	
+	init_waitqueue_entry(&__wait, current);
+	
 
 	usb_set_intfdata (intf, NULL);
 	if (!s || !s->dev) {
@@ -397,8 +411,12 @@
 
 	s->remove_pending = 1;
 	wake_up (&s->wait);
+	add_wait_queue(&s->wait, &__wait);
+	set_current_state(TASK_UNINTERRUPTIBLE);
 	if (s->state == _started)
-		sleep_on (&s->remove_ok);
+		schedule();
+	current->state = TASK_RUNNING;
+	remove_wait_queue(&s->wait, &__wait);
 	down (&s->mutex);
 	s->dev = NULL;
 	s->opened = 0;
diff -Nru a/drivers/usb/misc/usbled.c b/drivers/usb/misc/usbled.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/usb/misc/usbled.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,181 @@
+/*
+ * USB LED driver - 1.1
+ *
+ * Copyright (C) 2004 Greg Kroah-Hartman (greg@kroah.com)
+ *
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License as
+ *	published by the Free Software Foundation, version 2.
+ *
+ */
+
+#include <linux/config.h>
+#ifdef CONFIG_USB_DEBUG
+	#define DEBUG	1
+#endif
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/module.h>
+#include <linux/usb.h>
+
+
+#define DRIVER_AUTHOR "Greg Kroah-Hartman, greg@kroah.com"
+#define DRIVER_DESC "USB LED Driver"
+
+#define VENDOR_ID	0x0fc5
+#define PRODUCT_ID	0x1223
+
+/* table of devices that work with this driver */
+static struct usb_device_id id_table [] = {
+	{ USB_DEVICE(VENDOR_ID, PRODUCT_ID) },
+	{ },
+};
+MODULE_DEVICE_TABLE (usb, id_table);
+
+struct usb_led {
+	struct usb_device *	udev;
+	unsigned char		blue;
+	unsigned char		red;
+	unsigned char		green;
+};
+
+#define BLUE	0x04
+#define RED	0x02
+#define GREEN	0x01
+static void change_color(struct usb_led *led)
+{
+	int retval;
+	unsigned char color = 0x07;
+	unsigned char *buffer;
+
+	buffer = kmalloc(8, GFP_KERNEL);
+	if (!buffer) {
+		dev_err(&led->udev->dev, "out of memory\n");
+		return;
+	}
+
+	if (led->blue)
+		color &= ~(BLUE);
+	if (led->red)
+		color &= ~(RED);
+	if (led->green)
+		color &= ~(GREEN);
+	dev_dbg(&led->udev->dev,
+		"blue = %d, red = %d, green = %d, color = %.2x\n",
+		led->blue, led->red, led->green, color);
+
+	retval = usb_control_msg(led->udev,
+				usb_sndctrlpipe(led->udev, 0),
+				0x12,
+				0xc8,
+				(0x02 * 0x100) + 0x0a,
+				(0x00 * 0x100) + color,
+				buffer,	
+				8,
+				2 * HZ);
+	if (retval)
+		dev_dbg(&led->udev->dev, "retval = %d\n", retval);
+	kfree(buffer);
+}
+
+#define show_set(value)	\
+static ssize_t show_##value(struct device *dev, char *buf)		\
+{									\
+	struct usb_interface *intf = to_usb_interface(dev);		\
+	struct usb_led *led = usb_get_intfdata(intf);			\
+									\
+	return sprintf(buf, "%d\n", led->value);			\
+}									\
+static ssize_t set_##value(struct device *dev, const char *buf, size_t count)	\
+{									\
+	struct usb_interface *intf = to_usb_interface(dev);		\
+	struct usb_led *led = usb_get_intfdata(intf);			\
+	int temp = simple_strtoul(buf, NULL, 10);			\
+									\
+	led->value = temp;						\
+	change_color(led);						\
+	return count;							\
+}									\
+static DEVICE_ATTR(value, S_IWUGO | S_IRUGO, show_##value, set_##value);
+show_set(blue);
+show_set(red);
+show_set(green);
+
+static int led_probe(struct usb_interface *interface, const struct usb_device_id *id)
+{
+	struct usb_device *udev = interface_to_usbdev(interface);
+	struct usb_led *dev = NULL;
+	int retval = -ENOMEM;
+
+	dev = kmalloc(sizeof(struct usb_led), GFP_KERNEL);
+	if (dev == NULL) {
+		dev_err(&interface->dev, "Out of memory\n");
+		goto error;
+	}
+	memset (dev, 0x00, sizeof (*dev));
+
+	dev->udev = usb_get_dev(udev);
+
+	usb_set_intfdata (interface, dev);
+
+	device_create_file(&interface->dev, &dev_attr_blue);
+	device_create_file(&interface->dev, &dev_attr_red);
+	device_create_file(&interface->dev, &dev_attr_green);
+
+	dev_info(&interface->dev, "USB LED device now attached\n");
+	return 0;
+
+error:
+	kfree(dev);
+	return retval;
+}
+
+static void led_disconnect(struct usb_interface *interface)
+{
+	struct usb_led *dev;
+
+	dev = usb_get_intfdata (interface);
+	usb_set_intfdata (interface, NULL);
+
+	device_remove_file(&interface->dev, &dev_attr_blue);
+	device_remove_file(&interface->dev, &dev_attr_red);
+	device_remove_file(&interface->dev, &dev_attr_green);
+
+	usb_put_dev(dev->udev);
+
+	kfree(dev);
+
+	dev_info(&interface->dev, "USB LED now disconnected\n");
+}
+
+static struct usb_driver led_driver = {
+	.owner =	THIS_MODULE,
+	.name =		"usbled",
+	.probe =	led_probe,
+	.disconnect =	led_disconnect,
+	.id_table =	id_table,
+};
+
+static int __init usb_led_init(void)
+{
+	int retval = 0;
+
+	retval = usb_register(&led_driver);
+	if (retval)
+		err("usb_register failed. Error number %d", retval);
+	return retval;
+}
+
+static void __exit usb_led_exit(void)
+{
+	usb_deregister(&led_driver);
+}
+
+module_init (usb_led_init);
+module_exit (usb_led_exit);
+
+MODULE_AUTHOR(DRIVER_AUTHOR);
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_LICENSE("GPL");
diff -Nru a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c
--- a/drivers/usb/net/usbnet.c	Tue Feb  3 19:45:28 2004
+++ b/drivers/usb/net/usbnet.c	Tue Feb  3 19:45:28 2004
@@ -302,6 +302,9 @@
 
 static struct ethtool_ops usbnet_ethtool_ops;
 static void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *);
+static u32 usbnet_get_link (struct net_device *);
+static u32 usbnet_get_msglevel (struct net_device *);
+static void usbnet_set_msglevel (struct net_device *, u32);
 
 /* mostly for PDA style devices, which are always connected if present */
 static int always_connected (struct usbnet *dev)
@@ -658,6 +661,21 @@
 	return mii_ethtool_sset(&dev->mii,cmd);
 }
 
+/* We need to override some ethtool_ops so we require our
+   own structure so we don't interfere with other usbnet
+   devices that may be connected at the same time. */
+static struct ethtool_ops ax8817x_ethtool_ops = {
+	.get_drvinfo		= ax8817x_get_drvinfo,
+	.get_link		= ax8817x_get_link,
+	.get_msglevel		= usbnet_get_msglevel,
+	.set_msglevel		= usbnet_set_msglevel,
+	.get_wol		= ax8817x_get_wol,
+	.set_wol		= ax8817x_set_wol,
+	.get_eeprom		= ax8817x_get_eeprom,
+	.get_settings		= ax8817x_get_settings,
+	.set_settings		= ax8817x_set_settings,
+};
+
 static int ax8817x_bind(struct usbnet *dev, struct usb_interface *intf)
 {
 	int ret;
@@ -744,14 +762,7 @@
 	}
 
 	dev->net->set_multicast_list = ax8817x_set_multicast;
-
-	usbnet_ethtool_ops.get_drvinfo = &ax8817x_get_drvinfo;
-	usbnet_ethtool_ops.get_link = &ax8817x_get_link;
-	usbnet_ethtool_ops.get_wol = &ax8817x_get_wol;
-	usbnet_ethtool_ops.set_wol = &ax8817x_set_wol;
-	usbnet_ethtool_ops.get_eeprom = &ax8817x_get_eeprom;
-	usbnet_ethtool_ops.get_settings = &ax8817x_get_settings;
-	usbnet_ethtool_ops.set_settings = &ax8817x_set_settings;
+	dev->net->ethtool_ops = &ax8817x_ethtool_ops;
 
 	return 0;
 }
diff -Nru a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
--- a/drivers/usb/serial/cyberjack.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/usb/serial/cyberjack.c	Tue Feb  3 19:45:42 2004
@@ -36,6 +36,8 @@
 #include <asm/uaccess.h>
 #include <linux/usb.h>
 
+#define CYBERJACK_LOCAL_BUF_SIZE 32
+
 #ifdef CONFIG_USB_SERIAL_DEBUG
 	static int debug = 1;
 #else
@@ -62,6 +64,7 @@
 static void cyberjack_close (struct usb_serial_port *port, struct file *filp);
 static int cyberjack_write (struct usb_serial_port *port, int from_user,
 	const unsigned char *buf, int count);
+static int cyberjack_write_room( struct usb_serial_port *port );
 static void cyberjack_read_int_callback (struct urb *urb, struct pt_regs *regs);
 static void cyberjack_read_bulk_callback (struct urb *urb, struct pt_regs *regs);
 static void cyberjack_write_bulk_callback (struct urb *urb, struct pt_regs *regs);
@@ -95,6 +98,7 @@
 	.open =			cyberjack_open,
 	.close =		cyberjack_close,
 	.write =		cyberjack_write,
+	.write_room =	cyberjack_write_room,
 	.read_int_callback =	cyberjack_read_int_callback,
 	.read_bulk_callback =	cyberjack_read_bulk_callback,
 	.write_bulk_callback =	cyberjack_write_bulk_callback,
@@ -156,6 +160,11 @@
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
+	dbg("%s - usb_clear_halt", __FUNCTION__ );
+	usb_clear_halt(port->serial->dev, port->write_urb->pipe);
+	usb_clear_halt(port->serial->dev, port->read_urb->pipe);
+	usb_clear_halt(port->serial->dev, port->interrupt_in_urb->pipe);
+
 	/* force low_latency on so that our tty_push actually forces
 	 * the data through, otherwise it is scheduled, and with high
 	 * data rates (like with OHCI) data can get lost.
@@ -192,6 +201,10 @@
 		usb_unlink_urb (port->write_urb);
 		usb_unlink_urb (port->read_urb);
 		usb_unlink_urb (port->interrupt_in_urb);
+		dbg("%s - usb_clear_halt", __FUNCTION__ );
+		usb_clear_halt(port->serial->dev, port->write_urb->pipe);
+		usb_clear_halt(port->serial->dev, port->read_urb->pipe);
+		usb_clear_halt(port->serial->dev, port->interrupt_in_urb->pipe);
 	}
 }
 
@@ -202,6 +215,7 @@
 	unsigned long flags;
 	int result;
 	int wrexpected;
+	unsigned char localbuf[CYBERJACK_LOCAL_BUF_SIZE];	/* Buffer for collecting data to write */
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 	dbg("%s - from_user %d", __FUNCTION__, from_user);
@@ -218,22 +232,29 @@
 
 	spin_lock_irqsave(&priv->lock, flags);
 
-	if( (count+priv->wrfilled)>sizeof(priv->wrbuf) ) {
+	if( (count+priv->wrfilled)>sizeof(priv->wrbuf) ||
+		(count>sizeof(localbuf)) ) {
 		/* To much data  for buffer. Reset buffer. */
 		priv->wrfilled=0;
 		spin_unlock_irqrestore(&priv->lock, flags);
 		return (0);
 	}
 
+	spin_unlock_irqrestore(&priv->lock, flags);
+
 	/* Copy data */
 	if (from_user) {
-		if (copy_from_user(priv->wrbuf+priv->wrfilled, buf, count)) {
-			spin_unlock_irqrestore(&priv->lock, flags);
+		if (copy_from_user(localbuf, buf, count)) {
 			return -EFAULT;
 		}
 	} else {
-		memcpy (priv->wrbuf+priv->wrfilled, buf, count);
+		memcpy (localbuf, buf, count);
 	}  
+
+	spin_lock_irqsave(&priv->lock, flags);
+
+	memcpy (priv->wrbuf+priv->wrfilled, localbuf, count);
+
 	usb_serial_debug_data (__FILE__, __FUNCTION__, count,
 		priv->wrbuf+priv->wrfilled);
 	priv->wrfilled += count;
@@ -290,6 +311,11 @@
 
 	return (count);
 } 
+
+static int cyberjack_write_room( struct usb_serial_port *port )
+{
+	return CYBERJACK_LOCAL_BUF_SIZE;
+}
 
 static void cyberjack_read_int_callback( struct urb *urb, struct pt_regs *regs )
 {
diff -Nru a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
--- a/drivers/usb/serial/ftdi_sio.c	Tue Feb  3 19:45:37 2004
+++ b/drivers/usb/serial/ftdi_sio.c	Tue Feb  3 19:45:37 2004
@@ -372,6 +372,7 @@
 	{ USB_DEVICE_VER(FTDI_VID, FTDI_MTXORB_5_PID, 0x400, 0xffff) },
 	{ USB_DEVICE_VER(FTDI_VID, FTDI_MTXORB_6_PID, 0x400, 0xffff) },
 	{ USB_DEVICE_VER(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID, 0x400, 0xffff) },
+	{ USB_DEVICE_VER(FTDI_VID, FTDI_PIEGROUP_PID, 0x400, 0xffff) },
 	{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2101_PID, 0x400, 0xffff) },
 	{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2102_PID, 0x400, 0xffff) },
 	{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2103_PID, 0x400, 0xffff) },
@@ -576,6 +577,8 @@
 static void ftdi_write_bulk_callback	(struct urb *urb, struct pt_regs *regs);
 static void ftdi_read_bulk_callback	(struct urb *urb, struct pt_regs *regs);
 static void ftdi_set_termios		(struct usb_serial_port *port, struct termios * old);
+static int  ftdi_tiocmget               (struct usb_serial_port *port, struct file *file);
+static int  ftdi_tiocmset		(struct usb_serial_port *port, struct file * file, unsigned int set, unsigned int clear);
 static int  ftdi_ioctl			(struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg);
 static void ftdi_break_ctl		(struct usb_serial_port *port, int break_state );
 static void ftdi_throttle		(struct usb_serial_port *port);
@@ -603,6 +606,8 @@
 	.chars_in_buffer =	ftdi_chars_in_buffer,
 	.read_bulk_callback =	ftdi_read_bulk_callback,
 	.write_bulk_callback =	ftdi_write_bulk_callback,
+	.tiocmget =             ftdi_tiocmget,
+	.tiocmset =             ftdi_tiocmset,
 	.ioctl =		ftdi_ioctl,
 	.set_termios =		ftdi_set_termios,
 	.break_ctl =		ftdi_break_ctl,
@@ -627,6 +632,8 @@
 	.chars_in_buffer =	ftdi_chars_in_buffer,
 	.read_bulk_callback =	ftdi_read_bulk_callback,
 	.write_bulk_callback =	ftdi_write_bulk_callback,
+	.tiocmget =             ftdi_tiocmget,
+	.tiocmset =             ftdi_tiocmset,
 	.ioctl =		ftdi_ioctl,
 	.set_termios =		ftdi_set_termios,
 	.break_ctl =		ftdi_break_ctl,
@@ -651,6 +658,8 @@
 	.chars_in_buffer =	ftdi_chars_in_buffer,
 	.read_bulk_callback =	ftdi_read_bulk_callback,
 	.write_bulk_callback =	ftdi_write_bulk_callback,
+	.tiocmget =             ftdi_tiocmget,
+	.tiocmset =             ftdi_tiocmset,
 	.ioctl =		ftdi_ioctl,
 	.set_termios =		ftdi_set_termios,
 	.break_ctl =		ftdi_break_ctl,
@@ -675,6 +684,8 @@
 	.chars_in_buffer =	ftdi_chars_in_buffer,
 	.read_bulk_callback =	ftdi_read_bulk_callback,
 	.write_bulk_callback =	ftdi_write_bulk_callback,
+	.tiocmget =             ftdi_tiocmget,
+	.tiocmset =             ftdi_tiocmset,
 	.ioctl =		ftdi_ioctl,
 	.set_termios =		ftdi_set_termios,
 	.break_ctl =		ftdi_break_ctl,
@@ -701,6 +712,8 @@
 	.chars_in_buffer =	ftdi_chars_in_buffer,
 	.read_bulk_callback =	ftdi_read_bulk_callback,
 	.write_bulk_callback =	ftdi_write_bulk_callback,
+	.tiocmget =             ftdi_tiocmget,
+	.tiocmset =             ftdi_tiocmset,
 	.ioctl =		ftdi_ioctl,
 	.set_termios =		ftdi_set_termios,
 	.break_ctl =		ftdi_break_ctl,
@@ -1808,81 +1821,99 @@
 } /* ftdi_termios */
 
 
-static int ftdi_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg)
+static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file)
 {
 	struct usb_serial *serial = port->serial;
 	struct ftdi_private *priv = usb_get_serial_port_data(port);
+	unsigned char buf[2];
+	int ret;
 
-	__u16 urb_value=0; /* Will hold the new flags */
-	char buf[2];
-	int  ret, mask;
-	
-	dbg("%s cmd 0x%04x", __FUNCTION__, cmd);
-
-	/* Based on code from acm.c and others */
-	switch (cmd) {
-
-	case TIOCMGET:
-		dbg("%s TIOCMGET", __FUNCTION__);
-		switch (priv->chip_type) {
-		case SIO:
-			/* Request the status from the device */
-			if ((ret = usb_control_msg(serial->dev, 
-						   usb_rcvctrlpipe(serial->dev, 0),
-						   FTDI_SIO_GET_MODEM_STATUS_REQUEST, 
-						   FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
-						   0, 0, 
-						   buf, 1, WDR_TIMEOUT)) < 0 ) {
-				err("%s Could not get modem status of device - err: %d", __FUNCTION__,
-				    ret);
-				return(ret);
-			}
-			break;
-		case FT8U232AM:
-		case FT232BM:
-			/* the 8U232AM returns a two byte value (the sio is a 1 byte value) - in the same
-			   format as the data returned from the in point */
-			if ((ret = usb_control_msg(serial->dev, 
-						   usb_rcvctrlpipe(serial->dev, 0),
-						   FTDI_SIO_GET_MODEM_STATUS_REQUEST, 
-						   FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
-						   0, 0, 
-						   buf, 2, WDR_TIMEOUT)) < 0 ) {
-				err("%s Could not get modem status of device - err: %d", __FUNCTION__,
-				    ret);
-				return(ret);
-			}
-			break;
-		default:
-			return -EFAULT;
-			break;
+	dbg("%s TIOCMGET", __FUNCTION__);
+	switch (priv->chip_type) {
+	case SIO:
+		/* Request the status from the device */
+		if ((ret = usb_control_msg(serial->dev, 
+					   usb_rcvctrlpipe(serial->dev, 0),
+					   FTDI_SIO_GET_MODEM_STATUS_REQUEST, 
+					   FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
+					   0, 0, 
+					   buf, 1, WDR_TIMEOUT)) < 0 ) {
+			err("%s Could not get modem status of device - err: %d", __FUNCTION__,
+			    ret);
+			return(ret);
 		}
-
-		return put_user((buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) |
-				(buf[0] & FTDI_SIO_CTS_MASK ? TIOCM_CTS : 0) |
-				(buf[0]  & FTDI_SIO_RI_MASK  ? TIOCM_RI  : 0) |
-				(buf[0]  & FTDI_SIO_RLSD_MASK ? TIOCM_CD  : 0) |
-				priv->last_dtr_rts,
-				(unsigned long *) arg);
 		break;
+	case FT8U232AM:
+	case FT232BM:
+		/* the 8U232AM returns a two byte value (the sio is a 1 byte value) - in the same
+		   format as the data returned from the in point */
+		if ((ret = usb_control_msg(serial->dev, 
+					   usb_rcvctrlpipe(serial->dev, 0),
+					   FTDI_SIO_GET_MODEM_STATUS_REQUEST, 
+					   FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
+					   0, 0, 
+					   buf, 2, WDR_TIMEOUT)) < 0 ) {
+			err("%s Could not get modem status of device - err: %d", __FUNCTION__,
+			    ret);
+			return(ret);
+		}
+		break;
+	default:
+		return -EFAULT;
+		break;
+	}
+	
+	return  (buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) |
+		(buf[0] & FTDI_SIO_CTS_MASK ? TIOCM_CTS : 0) |
+		(buf[0]  & FTDI_SIO_RI_MASK  ? TIOCM_RI  : 0) |
+		(buf[0]  & FTDI_SIO_RLSD_MASK ? TIOCM_CD  : 0) |
+		priv->last_dtr_rts;			
+}
 
-	case TIOCMSET: /* Turns on and off the lines as specified by the mask */
-		dbg("%s TIOCMSET", __FUNCTION__);
-		if (get_user(mask, (unsigned long *) arg))
-			return -EFAULT;
-		urb_value = ((mask & TIOCM_DTR) ? HIGH : LOW);
-		if ((ret = set_dtr(port, urb_value)) < 0){
-			err("Error from DTR set urb (TIOCMSET)");
+static int ftdi_tiocmset(struct usb_serial_port *port, struct file * file, unsigned int set, unsigned int clear)
+{
+	int ret;
+	
+	if (set & TIOCM_DTR){
+		if ((ret = set_dtr(port, HIGH)) < 0) {
+			err("Urb to set DTR failed");
 			return(ret);
 		}
-		urb_value = ((mask & TIOCM_RTS) ? HIGH : LOW);
-		if ((ret = set_rts(port, urb_value)) < 0){
-			err("Error from RTS set urb (TIOCMSET)");
+	}
+	if (set & TIOCM_RTS) {
+		if ((ret = set_rts(port, HIGH)) < 0){
+			err("Urb to set RTS failed");
 			return(ret);
 		}
-		return(0);
-		break;
-					
+	}
+	
+	if (clear & TIOCM_DTR){
+		if ((ret = set_dtr(port, LOW)) < 0){
+			err("Urb to unset DTR failed");
+			return(ret);
+		}
+	}	
+	if (clear & TIOCM_RTS) {
+		if ((ret = set_rts(port, LOW)) < 0){
+			err("Urb to unset RTS failed");
+			return(ret);
+		}
+	}
+	return(0);
+}
+
+
+static int ftdi_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg)
+{
+	struct ftdi_private *priv = usb_get_serial_port_data(port);
+
+	int  ret, mask;
+	
+	dbg("%s cmd 0x%04x", __FUNCTION__, cmd);
+
+	/* Based on code from acm.c and others */
+	switch (cmd) {
+
 	case TIOCMBIS: /* turns on (Sets) the lines as specified by the mask */
 		dbg("%s TIOCMBIS", __FUNCTION__);
  	        if (get_user(mask, (unsigned long *) arg))
diff -Nru a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
--- a/drivers/usb/serial/ftdi_sio.h	Tue Feb  3 19:45:41 2004
+++ b/drivers/usb/serial/ftdi_sio.h	Tue Feb  3 19:45:41 2004
@@ -145,6 +145,9 @@
 /* Note: OCT US101 is also rebadged as Dick Smith Electronics (NZ) XH6381 */
 #define OCT_US101_PID		0x0421	/* OCT US101 USB to RS-232 */
 
+/* an infrared receiver for user access control with IR tags */
+#define FTDI_PIEGROUP_PID	0xF208	/* Product Id */
+
 /*
  * Protego product ids
  */
diff -Nru a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
--- a/drivers/usb/serial/ir-usb.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/serial/ir-usb.c	Tue Feb  3 19:45:17 2004
@@ -567,7 +567,9 @@
 			case B115200:  ir_baud = SPEED_115200;  break;
 			case B576000:  ir_baud = SPEED_576000;  break;
 			case B1152000: ir_baud = SPEED_1152000; break;
+#ifdef B4000000
 			case B4000000: ir_baud = SPEED_4000000; break;
+#endif
 		}
 
 		if (xbof == -1) {
diff -Nru a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
--- a/drivers/usb/serial/kobil_sct.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/usb/serial/kobil_sct.c	Tue Feb  3 19:45:41 2004
@@ -651,7 +651,7 @@
 		return 0;
 
 	case TCSETS:   // 0x5402
-		if (! &port->tty->termios) {
+		if (!(port->tty->termios)) {
 			dbg("%s - port %d Error: port->tty->termios is NULL", __FUNCTION__, port->number);
 			return -ENOTTY;
 		}
diff -Nru a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
--- a/drivers/usb/serial/mct_u232.c	Tue Feb  3 19:45:33 2004
+++ b/drivers/usb/serial/mct_u232.c	Tue Feb  3 19:45:33 2004
@@ -184,7 +184,7 @@
 
 struct mct_u232_private {
 	spinlock_t lock;
-	unsigned long	     control_state; /* Modem Line Setting (TIOCM) */
+	unsigned int	     control_state; /* Modem Line Setting (TIOCM) */
 	unsigned char        last_lcr;      /* Line Control Register */
 	unsigned char	     last_lsr;      /* Line Status Register */
 	unsigned char	     last_msr;      /* Modem Status Register */
@@ -196,25 +196,49 @@
 
 #define WDR_TIMEOUT (HZ * 5 ) /* default urb timeout */
 
+/*
+ * Later day 2.6.0-test kernels have new baud rates like B230400 which
+ * we do not know how to support. We ignore them for the moment.
+ * XXX Rate-limit the error message, it's user triggerable.
+ */
 static int mct_u232_calculate_baud_rate(struct usb_serial *serial, int value) {
 	if (serial->dev->descriptor.idProduct == MCT_U232_SITECOM_PID
 	  || serial->dev->descriptor.idProduct == MCT_U232_BELKIN_F5U109_PID) {
 		switch (value) {
-			case    300: return 0x01;
-			case    600: return 0x02; /* this one not tested */
-			case   1200: return 0x03;
-			case   2400: return 0x04;
-			case   4800: return 0x06;
-			case   9600: return 0x08;
-			case  19200: return 0x09;
-			case  38400: return 0x0a;
-			case  57600: return 0x0b;
-			case 115200: return 0x0c;
-			default:     return -1; /* normally not reached */
+		case    B300: return 0x01;
+		case    B600: return 0x02; /* this one not tested */
+		case   B1200: return 0x03;
+		case   B2400: return 0x04;
+		case   B4800: return 0x06;
+		case   B9600: return 0x08;
+		case  B19200: return 0x09;
+		case  B38400: return 0x0a;
+		case  B57600: return 0x0b;
+		case B115200: return 0x0c;
+		default:
+			err("MCT USB-RS232: unsupported baudrate request 0x%x,"
+			    " using default of B9600", value);
+			return 0x08;
+		}
+	} else {
+		switch (value) {
+		case    B300: value =     300;
+		case    B600: value =     600;
+		case   B1200: value =    1200;
+		case   B2400: value =    2400;
+		case   B4800: value =    4800;
+		case   B9600: value =    9600;
+		case  B19200: value =   19200;
+		case  B38400: value =   38400;
+		case  B57600: value =   57600;
+		case B115200: value =  115200;
+		default:
+			err("MCT USB-RS232: unsupported baudrate request 0x%x,"
+			    " using default of B9600", value);
+			value = 9600;
 		}
+		return 115200/value;
 	}
-	else
-		return MCT_U232_BAUD_RATE(value);
 }
 
 static int mct_u232_set_baud_rate(struct usb_serial *serial, int value)
@@ -222,7 +246,9 @@
 	unsigned int divisor;
         int rc;
         unsigned char zero_byte = 0;
+
 	divisor = cpu_to_le32(mct_u232_calculate_baud_rate(serial, value));
+
         rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
                              MCT_U232_SET_BAUD_RATE_REQUEST,
 			     MCT_U232_SET_REQUEST_TYPE,
@@ -230,7 +256,7 @@
 			     WDR_TIMEOUT);
 	if (rc < 0)
 		err("Set BAUD RATE %d failed (error = %d)", value, rc);
-	dbg("set_baud_rate: value: %d, divisor: 0x%x", value, divisor);
+	dbg("set_baud_rate: value: 0x%x, divisor: 0x%x", value, divisor);
 
 	/* Mimic the MCT-supplied Windows driver (version 1.21P.0104), which
 	   always sends two extra USB 'device request' messages after the
@@ -278,7 +304,7 @@
 } /* mct_u232_set_line_ctrl */
 
 static int mct_u232_set_modem_ctrl(struct usb_serial *serial,
-				   unsigned long control_state)
+				   unsigned int control_state)
 {
         int rc;
 	unsigned char mcr = MCT_U232_MCR_NONE;
@@ -295,7 +321,7 @@
 			     WDR_TIMEOUT);
 	if (rc < 0)
 		err("Set MODEM CTRL 0x%x failed (error = %d)", mcr, rc);
-	dbg("set_modem_ctrl: state=0x%lx ==> mcr=0x%x", control_state, mcr);
+	dbg("set_modem_ctrl: state=0x%x ==> mcr=0x%x", control_state, mcr);
 
         return rc;
 } /* mct_u232_set_modem_ctrl */
@@ -316,7 +342,7 @@
         return rc;
 } /* mct_u232_get_modem_stat */
 
-static void mct_u232_msr_to_state(unsigned long *control_state, unsigned char msr)
+static void mct_u232_msr_to_state(unsigned int *control_state, unsigned char msr)
 {
  	/* Translate Control Line states */
 	if (msr & MCT_U232_MSR_DSR)
@@ -335,7 +361,7 @@
 		*control_state |=  TIOCM_CD;
 	else
 		*control_state &= ~TIOCM_CD;
- 	dbg("msr_to_state: msr=0x%x ==> state=0x%lx", msr, *control_state);
+ 	dbg("msr_to_state: msr=0x%x ==> state=0x%x", msr, *control_state);
 } /* mct_u232_msr_to_state */
 
 /*
@@ -345,6 +371,7 @@
 static int mct_u232_startup (struct usb_serial *serial)
 {
 	struct mct_u232_private *priv;
+	struct usb_serial_port *port, *rport;
 
 	/* allocate the private data structure */
 	priv = kmalloc(sizeof(struct mct_u232_private), GFP_KERNEL);
@@ -359,6 +386,17 @@
 
 	init_waitqueue_head(&serial->port[0]->write_wait);
 
+	/* Puh, that's dirty */
+	port = serial->port[0];
+	rport = serial->port[1];
+	if (port->read_urb) {
+		/* No unlinking, it wasn't submitted yet. */
+		usb_free_urb(port->read_urb);
+	}
+	port->read_urb = rport->interrupt_in_urb;
+	rport->interrupt_in_urb = NULL;
+	port->read_urb->context = port;
+
 	return (0);
 } /* mct_u232_startup */
 
@@ -383,7 +421,7 @@
 	struct usb_serial *serial = port->serial;
 	struct mct_u232_private *priv = usb_get_serial_port_data(port);
 	int retval = 0;
-	unsigned long control_state;
+	unsigned int control_state;
 	unsigned long flags;
 	unsigned char last_lcr;
 	unsigned char last_msr;
@@ -425,15 +463,6 @@
 	mct_u232_msr_to_state(&priv->control_state, priv->last_msr);
 	spin_unlock_irqrestore(&priv->lock, flags);
 
-	{
-		/* Puh, that's dirty */
-		struct usb_serial_port *rport;	
-		rport = serial->port[1];
-		rport->tty = port->tty;
-		usb_set_serial_port_data(rport, usb_get_serial_port_data(port));
-		port->read_urb = rport->interrupt_in_urb;
-	}
-
 	port->read_urb->dev = port->serial->dev;
 	retval = usb_submit_urb(port->read_urb, GFP_KERNEL);
 	if (retval) {
@@ -662,129 +691,97 @@
 		     __FUNCTION__, status);
 } /* mct_u232_read_int_callback */
 
-
 static void mct_u232_set_termios (struct usb_serial_port *port,
 				  struct termios *old_termios)
 {
 	struct usb_serial *serial = port->serial;
 	struct mct_u232_private *priv = usb_get_serial_port_data(port);
 	unsigned int iflag = port->tty->termios->c_iflag;
-	unsigned int old_iflag = old_termios->c_iflag;
 	unsigned int cflag = port->tty->termios->c_cflag;
 	unsigned int old_cflag = old_termios->c_cflag;
 	unsigned long flags;
-	unsigned long control_state;
+	unsigned int control_state, new_state;
 	unsigned char last_lcr;
-	
+
 	/* get a local copy of the current port settings */
 	spin_lock_irqsave(&priv->lock, flags);
 	control_state = priv->control_state;
-	last_lcr = priv->last_lcr;
 	spin_unlock_irqrestore(&priv->lock, flags);
+	last_lcr = 0;
 
 	/*
-	 * Update baud rate
+	 * Update baud rate.
+	 * Do not attempt to cache old rates and skip settings,
+	 * disconnects screw such tricks up completely.
+	 * Premature optimization is the root of all evil.
 	 */
-	if( (cflag & CBAUD) != (old_cflag & CBAUD) ) {
-	        /* reassert DTR and (maybe) RTS on transition from B0 */
-		if( (old_cflag & CBAUD) == B0 ) {
-			dbg("%s: baud was B0", __FUNCTION__);
-			control_state |= TIOCM_DTR;
-			/* don't set RTS if using hardware flow control */
-			if (!(old_cflag & CRTSCTS)) {
-				control_state |= TIOCM_RTS;
-			}
-			mct_u232_set_modem_ctrl(serial, control_state);
-		}
-		
-		switch(cflag & CBAUD) {
-		case B0: /* handled below */
-			break;
-		case B300: mct_u232_set_baud_rate(serial, 300);
-			break;
-		case B600: mct_u232_set_baud_rate(serial, 600);
-			break;
-		case B1200: mct_u232_set_baud_rate(serial, 1200);
-			break;
-		case B2400: mct_u232_set_baud_rate(serial, 2400);
-			break;
-		case B4800: mct_u232_set_baud_rate(serial, 4800);
-			break;
-		case B9600: mct_u232_set_baud_rate(serial, 9600);
-			break;
-		case B19200: mct_u232_set_baud_rate(serial, 19200);
-			break;
-		case B38400: mct_u232_set_baud_rate(serial, 38400);
-			break;
-		case B57600: mct_u232_set_baud_rate(serial, 57600);
-			break;
-		case B115200: mct_u232_set_baud_rate(serial, 115200);
-			break;
-		default: err("MCT USB-RS232 converter: unsupported baudrate request, using default of 9600");
-			mct_u232_set_baud_rate(serial, 9600); break;
-		}
-		if ((cflag & CBAUD) == B0 ) {
-			dbg("%s: baud is B0", __FUNCTION__);
-			/* Drop RTS and DTR */
-			control_state &= ~(TIOCM_DTR | TIOCM_RTS);
-        		mct_u232_set_modem_ctrl(serial, control_state);
+
+        /* reassert DTR and (maybe) RTS on transition from B0 */
+	if ((old_cflag & CBAUD) == B0) {
+		dbg("%s: baud was B0", __FUNCTION__);
+		control_state |= TIOCM_DTR;
+		/* don't set RTS if using hardware flow control */
+		if (!(old_cflag & CRTSCTS)) {
+			control_state |= TIOCM_RTS;
 		}
+		mct_u232_set_modem_ctrl(serial, control_state);
+	}
+
+	mct_u232_set_baud_rate(serial, cflag & CBAUD);
+
+	if ((cflag & CBAUD) == B0 ) {
+		dbg("%s: baud is B0", __FUNCTION__);
+		/* Drop RTS and DTR */
+		control_state &= ~(TIOCM_DTR | TIOCM_RTS);
+       		mct_u232_set_modem_ctrl(serial, control_state);
 	}
 
 	/*
 	 * Update line control register (LCR)
 	 */
-	if ((cflag & (PARENB|PARODD)) != (old_cflag & (PARENB|PARODD))
-	    || (cflag & CSIZE) != (old_cflag & CSIZE)
-	    || (cflag & CSTOPB) != (old_cflag & CSTOPB) ) {
-		
 
-		last_lcr = 0;
+	/* set the parity */
+	if (cflag & PARENB)
+		last_lcr |= (cflag & PARODD) ?
+			MCT_U232_PARITY_ODD : MCT_U232_PARITY_EVEN;
+	else
+		last_lcr |= MCT_U232_PARITY_NONE;
 
-		/* set the parity */
-		if (cflag & PARENB)
-			last_lcr |= (cflag & PARODD) ?
-				MCT_U232_PARITY_ODD : MCT_U232_PARITY_EVEN;
-		else
-			last_lcr |= MCT_U232_PARITY_NONE;
+	/* set the number of data bits */
+	switch (cflag & CSIZE) {
+	case CS5:
+		last_lcr |= MCT_U232_DATA_BITS_5; break;
+	case CS6:
+		last_lcr |= MCT_U232_DATA_BITS_6; break;
+	case CS7:
+		last_lcr |= MCT_U232_DATA_BITS_7; break;
+	case CS8:
+		last_lcr |= MCT_U232_DATA_BITS_8; break;
+	default:
+		err("CSIZE was not CS5-CS8, using default of 8");
+		last_lcr |= MCT_U232_DATA_BITS_8;
+		break;
+	}
 
-		/* set the number of data bits */
-		switch (cflag & CSIZE) {
-		case CS5:
-			last_lcr |= MCT_U232_DATA_BITS_5; break;
-		case CS6:
-			last_lcr |= MCT_U232_DATA_BITS_6; break;
-		case CS7:
-			last_lcr |= MCT_U232_DATA_BITS_7; break;
-		case CS8:
-			last_lcr |= MCT_U232_DATA_BITS_8; break;
-		default:
-			err("CSIZE was not CS5-CS8, using default of 8");
-			last_lcr |= MCT_U232_DATA_BITS_8;
-			break;
-		}
+	/* set the number of stop bits */
+	last_lcr |= (cflag & CSTOPB) ?
+		MCT_U232_STOP_BITS_2 : MCT_U232_STOP_BITS_1;
 
-		/* set the number of stop bits */
-		last_lcr |= (cflag & CSTOPB) ?
-			MCT_U232_STOP_BITS_2 : MCT_U232_STOP_BITS_1;
+	mct_u232_set_line_ctrl(serial, last_lcr);
 
-		mct_u232_set_line_ctrl(serial, last_lcr);
-	}
-	
 	/*
 	 * Set flow control: well, I do not really now how to handle DTR/RTS.
 	 * Just do what we have seen with SniffUSB on Win98.
 	 */
-	if( (iflag & IXOFF) != (old_iflag & IXOFF)
-	    || (iflag & IXON) != (old_iflag & IXON)
-	    ||  (cflag & CRTSCTS) != (old_cflag & CRTSCTS) ) {
-		
-		/* Drop DTR/RTS if no flow control otherwise assert */
-		if ((iflag & IXOFF) || (iflag & IXON) || (cflag & CRTSCTS) )
-			control_state |= TIOCM_DTR | TIOCM_RTS;
-		else
-			control_state &= ~(TIOCM_DTR | TIOCM_RTS);
+	/* Drop DTR/RTS if no flow control otherwise assert */
+	new_state = control_state;
+	if ((iflag & IXOFF) || (iflag & IXON) || (cflag & CRTSCTS))
+		new_state |= TIOCM_DTR | TIOCM_RTS;
+	else
+		new_state &= ~(TIOCM_DTR | TIOCM_RTS);
+	if (new_state != control_state) {
 		mct_u232_set_modem_ctrl(serial, control_state);
+		control_state = new_state;
 	}
 
 	/* save off the modified port settings */
@@ -794,7 +791,6 @@
 	spin_unlock_irqrestore(&priv->lock, flags);
 } /* mct_u232_set_termios */
 
-
 static void mct_u232_break_ctl( struct usb_serial_port *port, int break_state )
 {
 	struct usb_serial *serial = port->serial;
@@ -818,7 +814,7 @@
 static int mct_u232_tiocmget (struct usb_serial_port *port, struct file *file)
 {
 	struct mct_u232_private *priv = usb_get_serial_port_data(port);
-	unsigned long control_state;
+	unsigned int control_state;
 	unsigned long flags;
 	
 	dbg("%s", __FUNCTION__);
@@ -835,7 +831,7 @@
 {
 	struct usb_serial *serial = port->serial;
 	struct mct_u232_private *priv = usb_get_serial_port_data(port);
-	unsigned long control_state;
+	unsigned int control_state;
 	unsigned long flags;
 	
 	dbg("%s", __FUNCTION__);
diff -Nru a/drivers/usb/serial/mct_u232.h b/drivers/usb/serial/mct_u232.h
--- a/drivers/usb/serial/mct_u232.h	Tue Feb  3 19:45:42 2004
+++ b/drivers/usb/serial/mct_u232.h	Tue Feb  3 19:45:42 2004
@@ -74,8 +74,11 @@
 
 /*
  * Baud rate (divisor)
+ * Actually, there are two of them, MCT website calls them "Philips solution"
+ * and "Intel solution". They are the regular MCT and "Sitecom" for us.
+ * This is pointless to document in the header, see the code for the bits.
  */
-#define MCT_U232_BAUD_RATE(b)		(115200/b)
+static int mct_u232_calculate_baud_rate(struct usb_serial *serial, int value);
 
 /*
  * Line Control Register (LCR)
diff -Nru a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
--- a/drivers/usb/serial/pl2303.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/serial/pl2303.c	Tue Feb  3 19:45:17 2004
@@ -79,6 +79,7 @@
 	{ USB_DEVICE(TRIPP_VENDOR_ID, TRIPP_PRODUCT_ID) },
 	{ USB_DEVICE(RADIOSHACK_VENDOR_ID, RADIOSHACK_PRODUCT_ID) },
 	{ USB_DEVICE(DCU10_VENDOR_ID, DCU10_PRODUCT_ID) },
+	{ USB_DEVICE(SITECOM_VENDOR_ID, SITECOM_PRODUCT_ID) },
 	{ }					/* Terminating entry */
 };
 
diff -Nru a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
--- a/drivers/usb/serial/pl2303.h	Tue Feb  3 19:45:28 2004
+++ b/drivers/usb/serial/pl2303.h	Tue Feb  3 19:45:28 2004
@@ -38,3 +38,6 @@
 
 #define DCU10_VENDOR_ID		0x0731
 #define DCU10_PRODUCT_ID	0x0528
+
+#define SITECOM_VENDOR_ID	0x6189
+#define SITECOM_PRODUCT_ID	0x2068
diff -Nru a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
--- a/drivers/usb/serial/visor.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/serial/visor.c	Tue Feb  3 19:45:17 2004
@@ -235,6 +235,8 @@
 		.driver_info = (kernel_ulong_t)&palm_os_4_probe },
 	{ USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_NZ90V_ID),
 		.driver_info = (kernel_ulong_t)&palm_os_4_probe },
+	{ USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_TJ25_ID),
+		.driver_info = (kernel_ulong_t)&palm_os_4_probe },
 	{ USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SCH_I330_ID), 
 		.driver_info = (kernel_ulong_t)&palm_os_4_probe },
 	{ USB_DEVICE(GARMIN_VENDOR_ID, GARMIN_IQUE_3600_ID), 
@@ -269,6 +271,7 @@
 	{ USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_NX60_ID) },
 	{ USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_NZ90V_ID) },
 	{ USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_UX50_ID) },
+	{ USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_TJ25_ID) },
 	{ USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SCH_I330_ID) },
 	{ USB_DEVICE(GARMIN_VENDOR_ID, GARMIN_IQUE_3600_ID) },
 	{ },					/* optional parameter entry */
diff -Nru a/drivers/usb/serial/visor.h b/drivers/usb/serial/visor.h
--- a/drivers/usb/serial/visor.h	Tue Feb  3 19:45:41 2004
+++ b/drivers/usb/serial/visor.h	Tue Feb  3 19:45:41 2004
@@ -42,6 +42,7 @@
 #define SONY_CLIE_NX60_ID		0x00DA
 #define SONY_CLIE_NZ90V_ID		0x00E9
 #define SONY_CLIE_UX50_ID		0x0144
+#define SONY_CLIE_TJ25_ID		0x0169
 
 #define SAMSUNG_VENDOR_ID		0x04E8
 #define SAMSUNG_SCH_I330_ID		0x8001
diff -Nru a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
--- a/drivers/usb/serial/whiteheat.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/serial/whiteheat.c	Tue Feb  3 19:45:17 2004
@@ -76,6 +76,7 @@
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
+#include <asm/termbits.h>
 #include <linux/usb.h>
 #include <linux/serial_reg.h>
 #include <linux/serial.h>
@@ -352,8 +353,8 @@
 	int pipe;
 	int ret;
 	int alen;
-	__u8 command[2] = { WHITEHEAT_GET_HW_INFO, 0 };
-	__u8 result[sizeof(*hw_info) + 1];
+	__u8 *command;
+	__u8 *result;
 	int i;
 	int j;
 	struct urb *urb;
@@ -364,13 +365,22 @@
 	command_port = serial->port[COMMAND_PORT];
 
 	pipe = usb_sndbulkpipe (serial->dev, command_port->bulk_out_endpointAddress);
+	command = kmalloc(2, GFP_KERNEL);
+	if (!command)
+		goto no_command_buffer;
+	command[0] = WHITEHEAT_GET_HW_INFO;
+	command[1] = 0;
+	
+	result = kmalloc(sizeof(*hw_info) + 1, GFP_KERNEL);
+	if (!result)
+		goto no_result_buffer;
 	/*
 	 * When the module is reloaded the firmware is still there and
 	 * the endpoints are still in the usb core unchanged. This is the
          * unlinking bug in disguise. Same for the call below.
          */
 	usb_clear_halt(serial->dev, pipe);
-	ret = usb_bulk_msg (serial->dev, pipe, command, sizeof(command), &alen, COMMAND_TIMEOUT);
+	ret = usb_bulk_msg (serial->dev, pipe, command, 2, &alen, COMMAND_TIMEOUT);
 	if (ret) {
 		err("%s: Couldn't send command [%d]", serial->type->name, ret);
 		goto no_firmware;
@@ -382,7 +392,7 @@
 	pipe = usb_rcvbulkpipe (serial->dev, command_port->bulk_in_endpointAddress);
 	/* See the comment on the usb_clear_halt() above */
 	usb_clear_halt(serial->dev, pipe);
-	ret = usb_bulk_msg (serial->dev, pipe, result, sizeof(result), &alen, COMMAND_TIMEOUT);
+	ret = usb_bulk_msg (serial->dev, pipe, result, sizeof(*hw_info) + 1, &alen, COMMAND_TIMEOUT);
 	if (ret) {
 		err("%s: Couldn't get results [%d]", serial->type->name, ret);
 		goto no_firmware;
@@ -484,6 +494,8 @@
 	usb_set_serial_port_data(command_port, command_info);
 	command_port->write_urb->complete = command_port_write_callback;
 	command_port->read_urb->complete = command_port_read_callback;
+	kfree(result);
+	kfree(command);
 
 	return 0;
 
@@ -525,6 +537,10 @@
 no_private:
 		;
 	}
+	kfree(result);
+no_result_buffer:
+	kfree(command);
+no_command_buffer:
 	return -ENOMEM;
 }
 
diff -Nru a/drivers/usb/storage/datafab.c b/drivers/usb/storage/datafab.c
--- a/drivers/usb/storage/datafab.c	Tue Feb  3 19:45:43 2004
+++ b/drivers/usb/storage/datafab.c	Tue Feb  3 19:45:43 2004
@@ -46,8 +46,8 @@
  *
  * This driver supports reading and writing.  If you're truly paranoid,
  * however, you can force the driver into a write-protected state by setting
- * the WP enable bits in datafab_handle_mode_sense().  Basically this means
- * setting mode_param_header[3] = 0x80.
+ * the WP enable bits in datafab_handle_mode_sense().  See the comments
+ * in that routine.
  */
 
 #include "transport.h"
@@ -89,11 +89,10 @@
 static int datafab_read_data(struct us_data *us,
 			     struct datafab_info *info,
 			     u32 sector,
-			     u32 sectors, 
-			     unsigned char *buffer, 
-			     int use_sg)
+			     u32 sectors)
 {
 	unsigned char *command = us->iobuf;
+	unsigned char *buffer;
 	unsigned char  thistime;
 	unsigned int totallen, alloclen;
 	int len, result;
@@ -116,18 +115,13 @@
 	totallen = sectors * info->ssize;
 
 	// Since we don't read more than 64 KB at a time, we have to create
-	// a bounce buffer if the transfer uses scatter-gather.  We will
-	// move the data a piece at a time between the bounce buffer and
-	// the actual transfer buffer.  If we're not using scatter-gather,
-	// we can simply update the transfer buffer pointer to get the
-	// same effect.
+	// a bounce buffer and move the data a piece at a time between the
+	// bounce buffer and the actual transfer buffer.
 
 	alloclen = min(totallen, 65536u);
-	if (use_sg) {
-		buffer = kmalloc(alloclen, GFP_NOIO);
-		if (buffer == NULL)
-			return USB_STOR_TRANSPORT_ERROR;
-	}
+	buffer = kmalloc(alloclen, GFP_NOIO);
+	if (buffer == NULL)
+		return USB_STOR_TRANSPORT_ERROR;
 
 	do {
 		// loop, never allocate or transfer more than 64k at once
@@ -157,24 +151,19 @@
 		if (result != USB_STOR_XFER_GOOD)
 			goto leave;
 
-		// Store the data (s-g) or update the pointer (!s-g)
-		if (use_sg)
-			usb_stor_access_xfer_buf(buffer, len, us->srb,
-					 &sg_idx, &sg_offset, TO_XFER_BUF);
-		else
-			buffer += len;
+		// Store the data in the transfer buffer
+		usb_stor_access_xfer_buf(buffer, len, us->srb,
+				 &sg_idx, &sg_offset, TO_XFER_BUF);
 
 		sector += thistime;
 		totallen -= len;
 	} while (totallen > 0);
 
-	if (use_sg)
-		kfree(buffer);
+	kfree(buffer);
 	return USB_STOR_TRANSPORT_GOOD;
 
  leave:
-	if (use_sg)
-		kfree(buffer);
+	kfree(buffer);
 	return USB_STOR_TRANSPORT_ERROR;
 }
 
@@ -182,12 +171,11 @@
 static int datafab_write_data(struct us_data *us,
 			      struct datafab_info *info,
 			      u32 sector,
-			      u32 sectors, 
-			      unsigned char *buffer, 
-			      int use_sg)
+			      u32 sectors)
 {
 	unsigned char *command = us->iobuf;
 	unsigned char *reply = us->iobuf;
+	unsigned char *buffer;
 	unsigned char thistime;
 	unsigned int totallen, alloclen;
 	int len, result;
@@ -210,18 +198,13 @@
 	totallen = sectors * info->ssize;
 
 	// Since we don't write more than 64 KB at a time, we have to create
-	// a bounce buffer if the transfer uses scatter-gather.  We will
-	// move the data a piece at a time between the bounce buffer and
-	// the actual transfer buffer.  If we're not using scatter-gather,
-	// we can simply update the transfer buffer pointer to get the
-	// same effect.
+	// a bounce buffer and move the data a piece at a time between the
+	// bounce buffer and the actual transfer buffer.
 
 	alloclen = min(totallen, 65536u);
-	if (use_sg) {
-		buffer = kmalloc(alloclen, GFP_NOIO);
-		if (buffer == NULL)
-			return USB_STOR_TRANSPORT_ERROR;
-	}
+	buffer = kmalloc(alloclen, GFP_NOIO);
+	if (buffer == NULL)
+		return USB_STOR_TRANSPORT_ERROR;
 
 	do {
 		// loop, never allocate or transfer more than 64k at once
@@ -230,10 +213,9 @@
 		len = min(totallen, alloclen);
 		thistime = (len / info->ssize) & 0xff;
 
-		// Get the data from the transfer buffer (s-g)
-		if (use_sg)
-			usb_stor_access_xfer_buf(buffer, len, us->srb,
-					&sg_idx, &sg_offset, FROM_XFER_BUF);
+		// Get the data from the transfer buffer
+		usb_stor_access_xfer_buf(buffer, len, us->srb,
+				&sg_idx, &sg_offset, FROM_XFER_BUF);
 
 		command[0] = 0;
 		command[1] = thistime;
@@ -269,21 +251,15 @@
 			goto leave;
 		}
 
-		// Update the transfer buffer pointer (!s-g)
-		if (!use_sg)
-			buffer += len;
-
 		sector += thistime;
 		totallen -= len;
 	} while (totallen > 0);
 
-	if (use_sg)
-		kfree(buffer);
+	kfree(buffer);
 	return USB_STOR_TRANSPORT_GOOD;
 
  leave:
-	if (use_sg)
-		kfree(buffer);
+	kfree(buffer);
 	return USB_STOR_TRANSPORT_ERROR;
 }
 
@@ -413,38 +389,30 @@
 
 static int datafab_handle_mode_sense(struct us_data *us,
 				     Scsi_Cmnd * srb, 
-				     unsigned char *ptr,
 				     int sense_6)
 {
-	unsigned char mode_param_header[8] = {
-		0, 0, 0, 0, 0, 0, 0, 0
-	};
-	unsigned char rw_err_page[12] = {
+	static unsigned char rw_err_page[12] = {
 		0x1, 0xA, 0x21, 1, 0, 0, 0, 0, 1, 0, 0, 0
 	};
-	unsigned char cache_page[12] = {
+	static unsigned char cache_page[12] = {
 		0x8, 0xA, 0x1, 0, 0, 0, 0, 0, 0, 0, 0, 0
 	};
-	unsigned char rbac_page[12] = {
+	static unsigned char rbac_page[12] = {
 		0x1B, 0xA, 0, 0x81, 0, 0, 0, 0, 0, 0, 0, 0
 	};
-	unsigned char timer_page[8] = {
+	static unsigned char timer_page[8] = {
 		0x1C, 0x6, 0, 0, 0, 0
 	};
 	unsigned char pc, page_code;
-	unsigned short total_len = 0;
-	unsigned short param_len, i = 0;
+	unsigned int i = 0;
+	struct datafab_info *info = (struct datafab_info *) (us->extra);
+	unsigned char *ptr = us->iobuf;
 
 	// most of this stuff is just a hack to get things working.  the
 	// datafab reader doesn't present a SCSI interface so we
 	// fudge the SCSI commands...
 	//
 
-	if (sense_6)
-		param_len = srb->cmnd[4];
-	else
-		param_len = ((u16) (srb->cmnd[7]) >> 8) | ((u16) (srb->cmnd[8]));
-
 	pc = srb->cmnd[2] >> 6;
 	page_code = srb->cmnd[2] & 0x3F;
 
@@ -463,66 +431,44 @@
 		break;
 	}
 
-	mode_param_header[3] = 0x80;	// write enable
+	memset(ptr, 0, 8);
+	if (sense_6) {
+		ptr[2] = 0x00;		// WP enable: 0x80
+		i = 4;
+	} else {
+		ptr[3] = 0x00;		// WP enable: 0x80
+		i = 8;
+	}
 
 	switch (page_code) {
-	   case 0x0:
+	   default:
 		// vendor-specific mode
-		return USB_STOR_TRANSPORT_ERROR;
+		info->sense_key = 0x05;
+		info->sense_asc = 0x24;
+		info->sense_ascq = 0x00;
+		return USB_STOR_TRANSPORT_FAILED;
 
 	   case 0x1:
-		total_len = sizeof(rw_err_page);
-		mode_param_header[0] = total_len >> 8;
-		mode_param_header[1] = total_len & 0xFF;
-		mode_param_header[3] = 0x00;	// WP enable: 0x80
-
-		memcpy(ptr, mode_param_header, sizeof(mode_param_header));
-		i += sizeof(mode_param_header);
 		memcpy(ptr + i, rw_err_page, sizeof(rw_err_page));
+		i += sizeof(rw_err_page);
 		break;
 
 	   case 0x8:
-		total_len = sizeof(cache_page);
-		mode_param_header[0] = total_len >> 8;
-		mode_param_header[1] = total_len & 0xFF;
-		mode_param_header[3] = 0x00;	// WP enable: 0x80
-
-		memcpy(ptr, mode_param_header, sizeof(mode_param_header));
-		i += sizeof(mode_param_header);
 		memcpy(ptr + i, cache_page, sizeof(cache_page));
+		i += sizeof(cache_page);
 		break;
 
 	   case 0x1B:
-		total_len = sizeof(rbac_page);
-		mode_param_header[0] = total_len >> 8;
-		mode_param_header[1] = total_len & 0xFF;
-		mode_param_header[3] = 0x00;	// WP enable: 0x80
-
-		memcpy(ptr, mode_param_header, sizeof(mode_param_header));
-		i += sizeof(mode_param_header);
 		memcpy(ptr + i, rbac_page, sizeof(rbac_page));
+		i += sizeof(rbac_page);
 		break;
 
 	   case 0x1C:
-		total_len = sizeof(timer_page);
-		mode_param_header[0] = total_len >> 8;
-		mode_param_header[1] = total_len & 0xFF;
-		mode_param_header[3] = 0x00;	// WP enable: 0x80
-
-		memcpy(ptr, mode_param_header, sizeof(mode_param_header));
-		i += sizeof(mode_param_header);
 		memcpy(ptr + i, timer_page, sizeof(timer_page));
+		i += sizeof(timer_page);
 		break;
 
 	   case 0x3F:		// retrieve all pages
-		total_len = sizeof(timer_page) + sizeof(rbac_page) +
-		    sizeof(cache_page) + sizeof(rw_err_page);
-		mode_param_header[0] = total_len >> 8;
-		mode_param_header[1] = total_len & 0xFF;
-		mode_param_header[3] = 0x00;	// WP enable
-
-		memcpy(ptr, mode_param_header, sizeof(mode_param_header));
-		i += sizeof(mode_param_header);
 		memcpy(ptr + i, timer_page, sizeof(timer_page));
 		i += sizeof(timer_page);
 		memcpy(ptr + i, rbac_page, sizeof(rbac_page));
@@ -530,9 +476,16 @@
 		memcpy(ptr + i, cache_page, sizeof(cache_page));
 		i += sizeof(cache_page);
 		memcpy(ptr + i, rw_err_page, sizeof(rw_err_page));
+		i += sizeof(rw_err_page);
 		break;
 	}
 
+	if (sense_6)
+		ptr[0] = i - 1;
+	else
+		((u16 *) ptr)[0] = cpu_to_be16(i - 2);
+	usb_stor_set_xfer_buf(ptr, i, srb);
+
 	return USB_STOR_TRANSPORT_GOOD;
 }
 
@@ -550,8 +503,8 @@
 	struct datafab_info *info;
 	int rc;
 	unsigned long block, blocks;
-	unsigned char *ptr = NULL;
-	unsigned char inquiry_reply[36] = {
+	unsigned char *ptr = us->iobuf;
+	static unsigned char inquiry_reply[8] = {
 		0x00, 0x80, 0x00, 0x01, 0x1F, 0x00, 0x00, 0x00
 	};
 
@@ -568,12 +521,11 @@
 	}
 
 	info = (struct datafab_info *) (us->extra);
-	ptr = (unsigned char *) srb->request_buffer;
 
 	if (srb->cmnd[0] == INQUIRY) {
 		US_DEBUGP("datafab_transport:  INQUIRY.  Returning bogus response");
-		memset( inquiry_reply + 8, 0, 28 );
-		fill_inquiry_response(us, inquiry_reply, 36);
+		memcpy(ptr, inquiry_reply, sizeof(inquiry_reply));
+		fill_inquiry_response(us, ptr, 36);
 		return USB_STOR_TRANSPORT_GOOD;
 	}
 
@@ -588,15 +540,9 @@
 
 		// build the reply
 		//
-		ptr[0] = (info->sectors >> 24) & 0xFF;
-		ptr[1] = (info->sectors >> 16) & 0xFF;
-		ptr[2] = (info->sectors >> 8) & 0xFF;
-		ptr[3] = (info->sectors) & 0xFF;
-
-		ptr[4] = (info->ssize >> 24) & 0xFF;
-		ptr[5] = (info->ssize >> 16) & 0xFF;
-		ptr[6] = (info->ssize >> 8) & 0xFF;
-		ptr[7] = (info->ssize) & 0xFF;
+		((u32 *) ptr)[0] = cpu_to_be32(info->sectors);
+		((u32 *) ptr)[1] = cpu_to_be32(info->ssize);
+		usb_stor_set_xfer_buf(ptr, 8, srb);
 
 		return USB_STOR_TRANSPORT_GOOD;
 	}
@@ -615,7 +561,7 @@
 		blocks = ((u32)(srb->cmnd[7]) << 8) | ((u32)(srb->cmnd[8]));
 
 		US_DEBUGP("datafab_transport:  READ_10: read block 0x%04lx  count %ld\n", block, blocks);
-		return datafab_read_data(us, info, block, blocks, ptr, srb->use_sg);
+		return datafab_read_data(us, info, block, blocks);
 	}
 
 	if (srb->cmnd[0] == READ_12) {
@@ -628,7 +574,7 @@
 			 ((u32)(srb->cmnd[8]) <<  8) | ((u32)(srb->cmnd[9]));
 
 		US_DEBUGP("datafab_transport:  READ_12: read block 0x%04lx  count %ld\n", block, blocks);
-		return datafab_read_data(us, info, block, blocks, ptr, srb->use_sg);
+		return datafab_read_data(us, info, block, blocks);
 	}
 
 	if (srb->cmnd[0] == WRITE_10) {
@@ -638,7 +584,7 @@
 		blocks = ((u32)(srb->cmnd[7]) << 8) | ((u32)(srb->cmnd[8]));
 
 		US_DEBUGP("datafab_transport:  WRITE_10: write block 0x%04lx  count %ld\n", block, blocks);
-		return datafab_write_data(us, info, block, blocks, ptr, srb->use_sg);
+		return datafab_write_data(us, info, block, blocks);
 	}
 
 	if (srb->cmnd[0] == WRITE_12) {
@@ -651,7 +597,7 @@
 			 ((u32)(srb->cmnd[8]) <<  8) | ((u32)(srb->cmnd[9]));
 
 		US_DEBUGP("datafab_transport:  WRITE_12: write block 0x%04lx  count %ld\n", block, blocks);
-		return datafab_write_data(us, info, block, blocks, ptr, srb->use_sg);
+		return datafab_write_data(us, info, block, blocks);
 	}
 
 	if (srb->cmnd[0] == TEST_UNIT_READY) {
@@ -666,23 +612,25 @@
 		// we can set the correct sense data.  so far though it hasn't been
 		// necessary
 		//
+		memset(ptr, 0, 18);
 		ptr[0] = 0xF0;
 		ptr[2] = info->sense_key;
 		ptr[7] = 11;
 		ptr[12] = info->sense_asc;
 		ptr[13] = info->sense_ascq;
+		usb_stor_set_xfer_buf(ptr, 18, srb);
 
 		return USB_STOR_TRANSPORT_GOOD;
 	}
 
 	if (srb->cmnd[0] == MODE_SENSE) {
 		US_DEBUGP("datafab_transport:  MODE_SENSE_6 detected\n");
-		return datafab_handle_mode_sense(us, srb, ptr, TRUE);
+		return datafab_handle_mode_sense(us, srb, TRUE);
 	}
 
 	if (srb->cmnd[0] == MODE_SENSE_10) {
 		US_DEBUGP("datafab_transport:  MODE_SENSE_10 detected\n");
-		return datafab_handle_mode_sense(us, srb, ptr, FALSE);
+		return datafab_handle_mode_sense(us, srb, FALSE);
 	}
 
 	if (srb->cmnd[0] == ALLOW_MEDIUM_REMOVAL) {
@@ -711,5 +659,8 @@
 
 	US_DEBUGP("datafab_transport:  Gah! Unknown command: %d (0x%x)\n",
 		  srb->cmnd[0], srb->cmnd[0]);
-	return USB_STOR_TRANSPORT_ERROR;
+	info->sense_key = 0x05;
+	info->sense_asc = 0x20;
+	info->sense_ascq = 0x00;
+	return USB_STOR_TRANSPORT_FAILED;
 }
diff -Nru a/drivers/usb/storage/jumpshot.c b/drivers/usb/storage/jumpshot.c
--- a/drivers/usb/storage/jumpshot.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/usb/storage/jumpshot.c	Tue Feb  3 19:45:16 2004
@@ -43,8 +43,8 @@
   *
   * This driver supports reading and writing.  If you're truly paranoid,
   * however, you can force the driver into a write-protected state by setting
-  * the WP enable bits in jumpshot_handle_mode_sense.  Basically this means
-  * setting mode_param_header[3] = 0x80.  
+  * the WP enable bits in jumpshot_handle_mode_sense.  See the comments
+  * in that routine.
   */
 
 #include "transport.h"
@@ -109,11 +109,10 @@
 static int jumpshot_read_data(struct us_data *us,
 			      struct jumpshot_info *info,
 			      u32 sector,
-			      u32 sectors, 
-			      unsigned char *buffer, 
-			      int use_sg)
+			      u32 sectors)
 {
 	unsigned char *command = us->iobuf;
+	unsigned char *buffer;
 	unsigned char  thistime;
 	unsigned int totallen, alloclen;
 	int len, result;
@@ -130,18 +129,13 @@
 	totallen = sectors * info->ssize;
 
 	// Since we don't read more than 64 KB at a time, we have to create
-	// a bounce buffer if the transfer uses scatter-gather.  We will
-	// move the data a piece at a time between the bounce buffer and
-	// the actual transfer buffer.  If we're not using scatter-gather,
-	// we can simply update the transfer buffer pointer to get the
-	// same effect.
+	// a bounce buffer and move the data a piece at a time between the
+	// bounce buffer and the actual transfer buffer.
 
 	alloclen = min(totallen, 65536u);
-	if (use_sg) {
-		buffer = kmalloc(alloclen, GFP_NOIO);
-		if (buffer == NULL)
-			return USB_STOR_TRANSPORT_ERROR;
-	}
+	buffer = kmalloc(alloclen, GFP_NOIO);
+	if (buffer == NULL)
+		return USB_STOR_TRANSPORT_ERROR;
 
 	do {
 		// loop, never allocate or transfer more than 64k at once
@@ -171,24 +165,19 @@
 
 		US_DEBUGP("jumpshot_read_data:  %d bytes\n", len);
 
-		// Store the data (s-g) or update the pointer (!s-g)
-		if (use_sg)
-			usb_stor_access_xfer_buf(buffer, len, us->srb,
-					 &sg_idx, &sg_offset, TO_XFER_BUF);
-		else
-			buffer += len;
+		// Store the data in the transfer buffer
+		usb_stor_access_xfer_buf(buffer, len, us->srb,
+				 &sg_idx, &sg_offset, TO_XFER_BUF);
 
 		sector += thistime;
 		totallen -= len;
 	} while (totallen > 0);
 
-	if (use_sg)
-		kfree(buffer);
+	kfree(buffer);
 	return USB_STOR_TRANSPORT_GOOD;
 
  leave:
-	if (use_sg)
-		kfree(buffer);
+	kfree(buffer);
 	return USB_STOR_TRANSPORT_ERROR;
 }
 
@@ -196,11 +185,10 @@
 static int jumpshot_write_data(struct us_data *us,
 			       struct jumpshot_info *info,
 			       u32 sector,
-			       u32 sectors, 
-			       unsigned char *buffer, 
-			       int use_sg)
+			       u32 sectors)
 {
 	unsigned char *command = us->iobuf;
+	unsigned char *buffer;
 	unsigned char  thistime;
 	unsigned int totallen, alloclen;
 	int len, result, waitcount;
@@ -217,18 +205,13 @@
 	totallen = sectors * info->ssize;
 
 	// Since we don't write more than 64 KB at a time, we have to create
-	// a bounce buffer if the transfer uses scatter-gather.  We will
-	// move the data a piece at a time between the bounce buffer and
-	// the actual transfer buffer.  If we're not using scatter-gather,
-	// we can simply update the transfer buffer pointer to get the
-	// same effect.
+	// a bounce buffer and move the data a piece at a time between the
+	// bounce buffer and the actual transfer buffer.
 
 	alloclen = min(totallen, 65536u);
-	if (use_sg) {
-		buffer = kmalloc(alloclen, GFP_NOIO);
-		if (buffer == NULL)
-			return USB_STOR_TRANSPORT_ERROR;
-	}
+	buffer = kmalloc(alloclen, GFP_NOIO);
+	if (buffer == NULL)
+		return USB_STOR_TRANSPORT_ERROR;
 
 	do {
 		// loop, never allocate or transfer more than 64k at once
@@ -237,10 +220,9 @@
 		len = min(totallen, alloclen);
 		thistime = (len / info->ssize) & 0xff;
 
-		// Get the data from the transfer buffer (s-g)
-		if (use_sg)
-			usb_stor_access_xfer_buf(buffer, len, us->srb,
-					&sg_idx, &sg_offset, FROM_XFER_BUF);
+		// Get the data from the transfer buffer
+		usb_stor_access_xfer_buf(buffer, len, us->srb,
+				&sg_idx, &sg_offset, FROM_XFER_BUF);
 
 		command[0] = 0;
 		command[1] = thistime;
@@ -278,21 +260,15 @@
 		if (result != USB_STOR_TRANSPORT_GOOD)
 			US_DEBUGP("jumpshot_write_data:  Gah!  Waitcount = 10.  Bad write!?\n");
 
-		// Update the transfer buffer pointer (!s-g)
-		if (!use_sg)
-			buffer += len;
-
 		sector += thistime;
 		totallen -= len;
 	} while (totallen > 0);
 
-	if (use_sg)
-		kfree(buffer);
+	kfree(buffer);
 	return result;
 
  leave:
-	if (use_sg)
-		kfree(buffer);
+	kfree(buffer);
 	return USB_STOR_TRANSPORT_ERROR;
 }
 
@@ -344,34 +320,24 @@
 
 static int jumpshot_handle_mode_sense(struct us_data *us,
 				      Scsi_Cmnd * srb, 
-				      unsigned char *ptr,
 				      int sense_6)
 {
-	unsigned char mode_param_header[8] = {
-		0, 0, 0, 0, 0, 0, 0, 0
-	};
-	unsigned char rw_err_page[12] = {
+	static unsigned char rw_err_page[12] = {
 		0x1, 0xA, 0x21, 1, 0, 0, 0, 0, 1, 0, 0, 0
 	};
-	unsigned char cache_page[12] = {
+	static unsigned char cache_page[12] = {
 		0x8, 0xA, 0x1, 0, 0, 0, 0, 0, 0, 0, 0, 0
 	};
-	unsigned char rbac_page[12] = {
+	static unsigned char rbac_page[12] = {
 		0x1B, 0xA, 0, 0x81, 0, 0, 0, 0, 0, 0, 0, 0
 	};
-	unsigned char timer_page[8] = {
+	static unsigned char timer_page[8] = {
 		0x1C, 0x6, 0, 0, 0, 0
 	};
 	unsigned char pc, page_code;
-	unsigned short total_len = 0;
-	unsigned short param_len, i = 0;
-
-
-	if (sense_6)
-		param_len = srb->cmnd[4];
-	else
-		param_len = ((u32) (srb->cmnd[7]) >> 8) | ((u32) (srb->cmnd[8]));
-
+	unsigned int i = 0;
+	struct jumpshot_info *info = (struct jumpshot_info *) (us->extra);
+	unsigned char *ptr = us->iobuf;
 
 	pc = srb->cmnd[2] >> 6;
 	page_code = srb->cmnd[2] & 0x3F;
@@ -391,66 +357,44 @@
 		break;
 	}
 
-	mode_param_header[3] = 0x80;	// write enable
+	memset(ptr, 0, 8);
+	if (sense_6) {
+		ptr[2] = 0x00;		// WP enable: 0x80
+		i = 4;
+	} else {
+		ptr[3] = 0x00;		// WP enable: 0x80
+		i = 8;
+	}
 
 	switch (page_code) {
 	   case 0x0:
 		// vendor-specific mode
-		return USB_STOR_TRANSPORT_ERROR;
+		info->sense_key = 0x05;
+		info->sense_asc = 0x24;
+		info->sense_ascq = 0x00;
+		return USB_STOR_TRANSPORT_FAILED;
 
 	   case 0x1:
-		total_len = sizeof(rw_err_page);
-		mode_param_header[0] = total_len >> 8;
-		mode_param_header[1] = total_len & 0xFF;
-		mode_param_header[3] = 0x00;	// WP enable: 0x80
-
-		memcpy(ptr, mode_param_header, sizeof(mode_param_header));
-		i += sizeof(mode_param_header);
 		memcpy(ptr + i, rw_err_page, sizeof(rw_err_page));
+		i += sizeof(rw_err_page);
 		break;
 
 	   case 0x8:
-		total_len = sizeof(cache_page);
-		mode_param_header[0] = total_len >> 8;
-		mode_param_header[1] = total_len & 0xFF;
-		mode_param_header[3] = 0x00;	// WP enable: 0x80
-
-		memcpy(ptr, mode_param_header, sizeof(mode_param_header));
-		i += sizeof(mode_param_header);
 		memcpy(ptr + i, cache_page, sizeof(cache_page));
+		i += sizeof(cache_page);
 		break;
 
 	   case 0x1B:
-		total_len = sizeof(rbac_page);
-		mode_param_header[0] = total_len >> 8;
-		mode_param_header[1] = total_len & 0xFF;
-		mode_param_header[3] = 0x00;	// WP enable: 0x80
-
-		memcpy(ptr, mode_param_header, sizeof(mode_param_header));
-		i += sizeof(mode_param_header);
 		memcpy(ptr + i, rbac_page, sizeof(rbac_page));
+		i += sizeof(rbac_page);
 		break;
 
 	   case 0x1C:
-		total_len = sizeof(timer_page);
-		mode_param_header[0] = total_len >> 8;
-		mode_param_header[1] = total_len & 0xFF;
-		mode_param_header[3] = 0x00;	// WP enable: 0x80
-
-		memcpy(ptr, mode_param_header, sizeof(mode_param_header));
-		i += sizeof(mode_param_header);
 		memcpy(ptr + i, timer_page, sizeof(timer_page));
+		i += sizeof(timer_page);
 		break;
 
 	   case 0x3F:
-		total_len = sizeof(timer_page) + sizeof(rbac_page) +
-		    sizeof(cache_page) + sizeof(rw_err_page);
-		mode_param_header[0] = total_len >> 8;
-		mode_param_header[1] = total_len & 0xFF;
-		mode_param_header[3] = 0x00;	// WP enable: 0x80
-
-		memcpy(ptr, mode_param_header, sizeof(mode_param_header));
-		i += sizeof(mode_param_header);
 		memcpy(ptr + i, timer_page, sizeof(timer_page));
 		i += sizeof(timer_page);
 		memcpy(ptr + i, rbac_page, sizeof(rbac_page));
@@ -458,9 +402,16 @@
 		memcpy(ptr + i, cache_page, sizeof(cache_page));
 		i += sizeof(cache_page);
 		memcpy(ptr + i, rw_err_page, sizeof(rw_err_page));
+		i += sizeof(rw_err_page);
 		break;
 	}
 
+	if (sense_6)
+		ptr[0] = i - 1;
+	else
+		((u16 *) ptr)[0] = cpu_to_be16(i - 2);
+	usb_stor_set_xfer_buf(ptr, i, srb);
+
 	return USB_STOR_TRANSPORT_GOOD;
 }
 
@@ -480,8 +431,8 @@
 	struct jumpshot_info *info;
 	int rc;
 	unsigned long block, blocks;
-	unsigned char *ptr = NULL;
-	unsigned char inquiry_response[36] = {
+	unsigned char *ptr = us->iobuf;
+	static unsigned char inquiry_response[8] = {
 		0x00, 0x80, 0x00, 0x01, 0x1F, 0x00, 0x00, 0x00
 	};
 
@@ -496,12 +447,11 @@
 	}
 
 	info = (struct jumpshot_info *) (us->extra);
-	ptr = (unsigned char *) srb->request_buffer;
 
 	if (srb->cmnd[0] == INQUIRY) {
 		US_DEBUGP("jumpshot_transport:  INQUIRY.  Returning bogus response.\n");
-		memset(inquiry_response + 8, 0, 28);
-		fill_inquiry_response(us, inquiry_response, 36);
+		memcpy(ptr, inquiry_response, sizeof(inquiry_response));
+		fill_inquiry_response(us, ptr, 36);
 		return USB_STOR_TRANSPORT_GOOD;
 	}
 
@@ -521,15 +471,9 @@
 
 		// build the reply
 		//
-		ptr[0] = (info->sectors >> 24) & 0xFF;
-		ptr[1] = (info->sectors >> 16) & 0xFF;
-		ptr[2] = (info->sectors >> 8) & 0xFF;
-		ptr[3] = (info->sectors) & 0xFF;
-
-		ptr[4] = (info->ssize >> 24) & 0xFF;
-		ptr[5] = (info->ssize >> 16) & 0xFF;
-		ptr[6] = (info->ssize >> 8) & 0xFF;
-		ptr[7] = (info->ssize) & 0xFF;
+		((u32 *) ptr)[0] = cpu_to_be32(info->sectors);
+		((u32 *) ptr)[1] = cpu_to_be32(info->ssize);
+		usb_stor_set_xfer_buf(ptr, 8, srb);
 
 		return USB_STOR_TRANSPORT_GOOD;
 	}
@@ -546,7 +490,7 @@
 		blocks = ((u32)(srb->cmnd[7]) << 8) | ((u32)(srb->cmnd[8]));
 
 		US_DEBUGP("jumpshot_transport:  READ_10: read block 0x%04lx  count %ld\n", block, blocks);
-		return jumpshot_read_data(us, info, block, blocks, ptr, srb->use_sg);
+		return jumpshot_read_data(us, info, block, blocks);
 	}
 
 	if (srb->cmnd[0] == READ_12) {
@@ -559,7 +503,7 @@
 			 ((u32)(srb->cmnd[8]) <<  8) | ((u32)(srb->cmnd[9]));
 
 		US_DEBUGP("jumpshot_transport:  READ_12: read block 0x%04lx  count %ld\n", block, blocks);
-		return jumpshot_read_data(us, info, block, blocks, ptr, srb->use_sg);
+		return jumpshot_read_data(us, info, block, blocks);
 	}
 
 	if (srb->cmnd[0] == WRITE_10) {
@@ -569,7 +513,7 @@
 		blocks = ((u32)(srb->cmnd[7]) << 8) | ((u32)(srb->cmnd[8]));
 
 		US_DEBUGP("jumpshot_transport:  WRITE_10: write block 0x%04lx  count %ld\n", block, blocks);
-		return jumpshot_write_data(us, info, block, blocks, ptr, srb->use_sg);
+		return jumpshot_write_data(us, info, block, blocks);
 	}
 
 	if (srb->cmnd[0] == WRITE_12) {
@@ -582,7 +526,7 @@
 			 ((u32)(srb->cmnd[8]) <<  8) | ((u32)(srb->cmnd[9]));
 
 		US_DEBUGP("jumpshot_transport:  WRITE_12: write block 0x%04lx  count %ld\n", block, blocks);
-		return jumpshot_write_data(us, info, block, blocks, ptr, srb->use_sg);
+		return jumpshot_write_data(us, info, block, blocks);
 	}
 
 
@@ -592,25 +536,27 @@
 	}
 
 	if (srb->cmnd[0] == REQUEST_SENSE) {
-		US_DEBUGP("jumpshot_transport:  REQUEST_SENSE.  Returning NO SENSE for now\n");
+		US_DEBUGP("jumpshot_transport:  REQUEST_SENSE.\n");
 
+		memset(ptr, 0, 18);
 		ptr[0] = 0xF0;
 		ptr[2] = info->sense_key;
 		ptr[7] = 11;
 		ptr[12] = info->sense_asc;
 		ptr[13] = info->sense_ascq;
+		usb_stor_set_xfer_buf(ptr, 18, srb);
 
 		return USB_STOR_TRANSPORT_GOOD;
 	}
 
 	if (srb->cmnd[0] == MODE_SENSE) {
 		US_DEBUGP("jumpshot_transport:  MODE_SENSE_6 detected\n");
-		return jumpshot_handle_mode_sense(us, srb, ptr, TRUE);
+		return jumpshot_handle_mode_sense(us, srb, TRUE);
 	}
 
 	if (srb->cmnd[0] == MODE_SENSE_10) {
 		US_DEBUGP("jumpshot_transport:  MODE_SENSE_10 detected\n");
-		return jumpshot_handle_mode_sense(us, srb, ptr, FALSE);
+		return jumpshot_handle_mode_sense(us, srb, FALSE);
 	}
 
 	if (srb->cmnd[0] == ALLOW_MEDIUM_REMOVAL) {
@@ -639,5 +585,8 @@
 
 	US_DEBUGP("jumpshot_transport:  Gah! Unknown command: %d (0x%x)\n",
 		  srb->cmnd[0], srb->cmnd[0]);
-	return USB_STOR_TRANSPORT_ERROR;
+	info->sense_key = 0x05;
+	info->sense_asc = 0x20;
+	info->sense_ascq = 0x00;
+	return USB_STOR_TRANSPORT_FAILED;
 }
diff -Nru a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
--- a/drivers/usb/storage/scsiglue.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/usb/storage/scsiglue.c	Tue Feb  3 19:45:18 2004
@@ -52,6 +52,7 @@
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <scsi/scsi_devinfo.h>
+#include <scsi/scsi_host.h>
 
 
 /***********************************************************************
@@ -65,6 +66,16 @@
 
 static int slave_configure (struct scsi_device *sdev)
 {
+	/* Scatter-gather buffers (all but the last) must have a length
+	 * divisible by the bulk maxpacket size.  Otherwise a data packet
+	 * would end up being short, causing a premature end to the data
+	 * transfer.  Since high-speed bulk pipes have a maxpacket size
+	 * of 512, we'll use that as the scsi device queue's DMA alignment
+	 * mask.  Guaranteeing proper alignment of the first buffer will
+	 * have the desired effect because, except at the beginning and
+	 * the end, scatter-gather buffers follow page boundaries. */
+	blk_queue_dma_alignment(sdev->request_queue, (512 - 1));
+
 	/* this is to satisify the compiler, tho I don't think the 
 	 * return code is ever checked anywhere. */
 	return 0;
@@ -219,6 +230,21 @@
 	return result < 0 ? FAILED : SUCCESS;
 }
 
+/* Report a driver-initiated device reset to the SCSI layer.
+ * Calling this for a SCSI-initiated reset is unnecessary but harmless. */
+void usb_stor_report_device_reset(struct us_data *us)
+{
+	int i;
+
+	scsi_lock(us->host);
+	scsi_report_device_reset(us->host, 0, 0);
+	if (us->flags & US_FL_SCM_MULT_TARG) {
+		for (i = 1; i < us->host->max_id; ++i)
+			scsi_report_device_reset(us->host, 0, i);
+	}
+	scsi_unlock(us->host);
+}
+
 /***********************************************************************
  * /proc/scsi/ functions
  ***********************************************************************/
@@ -227,13 +253,14 @@
 #undef SPRINTF
 #define SPRINTF(args...) \
 	do { if (pos < buffer+length) pos += sprintf(pos, ## args); } while (0)
+#define DO_FLAG(a) \
+	do { if (us->flags & US_FL_##a) pos += sprintf(pos, " " #a); } while(0)
 
 static int proc_info (struct Scsi_Host *hostptr, char *buffer, char **start, off_t offset,
 		int length, int inout)
 {
 	struct us_data *us;
 	char *pos = buffer;
-	unsigned long f;
 
 	/* if someone is sending us data, just throw it away */
 	if (inout)
@@ -256,17 +283,14 @@
 	/* show the device flags */
 	if (pos < buffer + length) {
 		pos += sprintf(pos, "       Quirks:");
-		f = us->flags;
 
-#define DO_FLAG(a)  	if (f & US_FL_##a)  pos += sprintf(pos, " " #a)
 		DO_FLAG(SINGLE_LUN);
 		DO_FLAG(SCM_MULT_TARG);
 		DO_FLAG(FIX_INQUIRY);
 		DO_FLAG(FIX_CAPACITY);
-#undef DO_FLAG
 
 		*(pos++) = '\n';
-		}
+	}
 
 	/*
 	 * Calculate start of next buffer, and return value.
@@ -281,6 +305,40 @@
 		return (length);
 }
 
+/***********************************************************************
+ * Sysfs interface
+ ***********************************************************************/
+
+/* Output routine for the sysfs max_sectors file */
+static ssize_t show_max_sectors(struct device *dev, char *buf)
+{
+	struct scsi_device *sdev = to_scsi_device(dev);
+
+	return sprintf(buf, "%u\n", sdev->request_queue->max_sectors);
+}
+
+/* Input routine for the sysfs max_sectors file */
+static ssize_t store_max_sectors(struct device *dev, const char *buf,
+		size_t count)
+{
+	struct scsi_device *sdev = to_scsi_device(dev);
+	unsigned short ms;
+
+	if (sscanf(buf, "%hu", &ms) > 0 && ms <= SCSI_DEFAULT_MAX_SECTORS) {
+		blk_queue_max_sectors(sdev->request_queue, ms);
+		return strlen(buf);
+	}
+	return -EINVAL;	
+}
+
+static DEVICE_ATTR(max_sectors, S_IRUGO | S_IWUSR, show_max_sectors,
+		store_max_sectors);
+
+static struct device_attribute *sysfs_device_attr_list[] = {
+		&dev_attr_max_sectors,
+		NULL,
+		};
+
 /*
  * this defines our host template, with which we'll allocate hosts
  */
@@ -323,6 +381,9 @@
 
 	/* emulated HBA */
 	.emulated =			TRUE,
+
+	/* sysfs device attributes */
+	.sdev_attrs =			sysfs_device_attr_list,
 
 	/* modify scsi_device bits on probe */
 	.flags = (BLIST_MS_SKIP_PAGE_08 | BLIST_MS_SKIP_PAGE_3F |
diff -Nru a/drivers/usb/storage/scsiglue.h b/drivers/usb/storage/scsiglue.h
--- a/drivers/usb/storage/scsiglue.h	Tue Feb  3 19:45:28 2004
+++ b/drivers/usb/storage/scsiglue.h	Tue Feb  3 19:45:28 2004
@@ -44,6 +44,9 @@
 #include <linux/blkdev.h>
 #include "scsi.h"
 #include "hosts.h"
+#include "usb.h"
+
+extern void usb_stor_report_device_reset(struct us_data *us);
 
 extern unsigned char usb_stor_sense_notready[18];
 extern unsigned char usb_stor_sense_invalidCDB[18];
diff -Nru a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c
--- a/drivers/usb/storage/sddr09.c	Tue Feb  3 19:45:41 2004
+++ b/drivers/usb/storage/sddr09.c	Tue Feb  3 19:45:41 2004
@@ -662,31 +662,24 @@
 static int
 sddr09_read_data(struct us_data *us,
 		 unsigned long address,
-		 unsigned int sectors,
-		 unsigned char *buffer,
-		 int use_sg) {
+		 unsigned int sectors) {
 
 	struct sddr09_card_info *info = (struct sddr09_card_info *) us->extra;
+	unsigned char *buffer;
 	unsigned int lba, maxlba, pba;
 	unsigned int page, pages;
 	unsigned int len, index, offset;
 	int result;
 
 	// Since we only read in one block at a time, we have to create
-	// a bounce buffer if the transfer uses scatter-gather.  We will
-	// move the data a piece at a time between the bounce buffer and
-	// the actual transfer buffer.  If we're not using scatter-gather,
-	// we can simply update the transfer buffer pointer to get the
-	// same effect.
-
-	if (use_sg) {
-		len = min(sectors, (unsigned int) info->blocksize) *
-				info->pagesize;
-		buffer = kmalloc(len, GFP_NOIO);
-		if (buffer == NULL) {
-			printk("sddr09_read_data: Out of memory\n");
-			return USB_STOR_TRANSPORT_ERROR;
-		}
+	// a bounce buffer and move the data a piece at a time between the
+	// bounce buffer and the actual transfer buffer.
+
+	len = min(sectors, (unsigned int) info->blocksize) * info->pagesize;
+	buffer = kmalloc(len, GFP_NOIO);
+	if (buffer == NULL) {
+		printk("sddr09_read_data: Out of memory\n");
+		return USB_STOR_TRANSPORT_ERROR;
 	}
 
 	// Figure out the initial LBA and page
@@ -743,21 +736,16 @@
 				break;
 		}
 
-		// Store the data (s-g) or update the pointer (!s-g)
-		if (use_sg)
-			usb_stor_access_xfer_buf(buffer, len, us->srb,
-					&index, &offset, TO_XFER_BUF);
-		else
-			buffer += len;
+		// Store the data in the transfer buffer
+		usb_stor_access_xfer_buf(buffer, len, us->srb,
+				&index, &offset, TO_XFER_BUF);
 
 		page = 0;
 		lba++;
 		sectors -= pages;
 	}
 
-	if (use_sg)
-		kfree(buffer);
-
+	kfree(buffer);
 	return result;
 }
 
@@ -897,14 +885,13 @@
 static int
 sddr09_write_data(struct us_data *us,
 		  unsigned long address,
-		  unsigned int sectors,
-		  unsigned char *buffer,
-		  int use_sg) {
+		  unsigned int sectors) {
 
 	struct sddr09_card_info *info = (struct sddr09_card_info *) us->extra;
 	unsigned int lba, page, pages;
 	unsigned int pagelen, blocklen;
 	unsigned char *blockbuffer;
+	unsigned char *buffer;
 	unsigned int len, index, offset;
 	int result;
 
@@ -923,21 +910,15 @@
 	}
 
 	// Since we don't write the user data directly to the device,
-	// we have to create a bounce buffer if the transfer uses
-	// scatter-gather.  We will move the data a piece at a time
-	// between the bounce buffer and the actual transfer buffer.
-	// If we're not using scatter-gather, we can simply update
-	// the transfer buffer pointer to get the same effect.
-
-	if (use_sg) {
-		len = min(sectors, (unsigned int) info->blocksize) *
-				info->pagesize;
-		buffer = kmalloc(len, GFP_NOIO);
-		if (buffer == NULL) {
-			printk("sddr09_write_data: Out of memory\n");
-			kfree(blockbuffer);
-			return USB_STOR_TRANSPORT_ERROR;
-		}
+	// we have to create a bounce buffer and move the data a piece
+	// at a time between the bounce buffer and the actual transfer buffer.
+
+	len = min(sectors, (unsigned int) info->blocksize) * info->pagesize;
+	buffer = kmalloc(len, GFP_NOIO);
+	if (buffer == NULL) {
+		printk("sddr09_write_data: Out of memory\n");
+		kfree(blockbuffer);
+		return USB_STOR_TRANSPORT_ERROR;
 	}
 
 	// Figure out the initial LBA and page
@@ -954,27 +935,21 @@
 		pages = min(sectors, info->blocksize - page);
 		len = (pages << info->pageshift);
 
-		// Get the data from the transfer buffer (s-g)
-		if (use_sg)
-			usb_stor_access_xfer_buf(buffer, len, us->srb,
-					&index, &offset, FROM_XFER_BUF);
+		// Get the data from the transfer buffer
+		usb_stor_access_xfer_buf(buffer, len, us->srb,
+				&index, &offset, FROM_XFER_BUF);
 
 		result = sddr09_write_lba(us, lba, page, pages,
 				buffer, blockbuffer);
 		if (result != USB_STOR_TRANSPORT_GOOD)
 			break;
 
-		// Update the transfer buffer pointer (!s-g)
-		if (!use_sg)
-			buffer += len;
-
 		page = 0;
 		lba++;
 		sectors -= pages;
 	}
 
-	if (use_sg)
-		kfree(buffer);
+	kfree(buffer);
 	kfree(blockbuffer);
 
 	return result;
@@ -1402,19 +1377,19 @@
 	static unsigned char sensekey = 0, sensecode = 0;
 	static unsigned char havefakesense = 0;
 	int result, i;
-	unsigned char *ptr;
+	unsigned char *ptr = us->iobuf;
 	unsigned long capacity;
 	unsigned int page, pages;
-	char string[64];
 
 	struct sddr09_card_info *info;
 
-	unsigned char inquiry_response[36] = {
+	static unsigned char inquiry_response[8] = {
 		0x00, 0x80, 0x00, 0x02, 0x1F, 0x00, 0x00, 0x00
 	};
 
-	unsigned char mode_page_01[16] = {
-		0x0F, 0x00, 0, 0x00,
+	/* note: no block descriptor support */
+	static unsigned char mode_page_01[19] = {
+		0x00, 0x0F, 0x00, 0x0, 0x0, 0x0, 0x00,
 		0x01, 0x0A,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 	};
@@ -1428,18 +1403,14 @@
 			return USB_STOR_TRANSPORT_ERROR;
 	}
 
-	ptr = (unsigned char *)srb->request_buffer;
-
 	if (srb->cmnd[0] == REQUEST_SENSE && havefakesense) {
 		/* for a faked command, we have to follow with a faked sense */
-		memset(ptr, 0, srb->request_bufflen);
-		if (srb->request_bufflen > 7) {
-			ptr[0] = 0x70;
-			ptr[2] = sensekey;
-			ptr[7] = srb->request_bufflen - 7;
-		}
-		if (srb->request_bufflen > 12)
-			ptr[12] = sensecode;
+		memset(ptr, 0, 18);
+		ptr[0] = 0x70;
+		ptr[2] = sensekey;
+		ptr[7] = 11;
+		ptr[12] = sensecode;
+		usb_stor_set_xfer_buf(ptr, 18, srb);
 		sensekey = sensecode = havefakesense = 0;
 		return USB_STOR_TRANSPORT_GOOD;
 	}
@@ -1450,8 +1421,8 @@
 	   respond to INQUIRY commands */
 
 	if (srb->cmnd[0] == INQUIRY) {
-		memset(inquiry_response+8, 0, 28);
-		fill_inquiry_response(us, inquiry_response, 36);
+		memcpy(ptr, inquiry_response, 8);
+		fill_inquiry_response(us, ptr, 36);
 		return USB_STOR_TRANSPORT_GOOD;
 	}
 
@@ -1486,43 +1457,30 @@
 
 		capacity = (info->lbact << info->blockshift) - 1;
 
-		ptr[0] = MSB_of(capacity>>16);
-		ptr[1] = LSB_of(capacity>>16);
-		ptr[2] = MSB_of(capacity&0xFFFF);
-		ptr[3] = LSB_of(capacity&0xFFFF);
+		((u32 *) ptr)[0] = cpu_to_be32(capacity);
 
 		// Report page size
 
-		ptr[4] = MSB_of(info->pagesize>>16);
-		ptr[5] = LSB_of(info->pagesize>>16);
-		ptr[6] = MSB_of(info->pagesize&0xFFFF);
-		ptr[7] = LSB_of(info->pagesize&0xFFFF);
+		((u32 *) ptr)[1] = cpu_to_be32(info->pagesize);
+		usb_stor_set_xfer_buf(ptr, 8, srb);
 
 		return USB_STOR_TRANSPORT_GOOD;
 	}
 
-	if (srb->cmnd[0] == MODE_SENSE || srb->cmnd[0] == MODE_SENSE_10) {
+	if (srb->cmnd[0] == MODE_SENSE_10) {
 		int modepage = (srb->cmnd[2] & 0x3F);
-		int len;
 
 		/* They ask for the Read/Write error recovery page,
-		   or for all pages. Give as much as they have room for. */
+		   or for all pages. */
 		/* %% We should check DBD %% */
 		if (modepage == 0x01 || modepage == 0x3F) {
-
 			US_DEBUGP("SDDR09: Dummy up request for "
 				  "mode page 0x%x\n", modepage);
 
-			if (ptr == NULL)
-				return USB_STOR_TRANSPORT_ERROR;
-
-			len = srb->request_bufflen;
-			if (len > sizeof(mode_page_01))
-				len = sizeof(mode_page_01);
-
-			mode_page_01[0] = sizeof(mode_page_01) - 1;
-			mode_page_01[2] = (info->flags & SDDR09_WP) ? 0x80 : 0;
-			memcpy(ptr, mode_page_01, len);
+			memcpy(ptr, mode_page_01, sizeof(mode_page_01));
+			((u16*)ptr)[0] = sizeof(mode_page_01) - 2;
+			ptr[3] = (info->flags & SDDR09_WP) ? 0x80 : 0;
+			usb_stor_set_xfer_buf(ptr, sizeof(mode_page_01), srb);
 			return USB_STOR_TRANSPORT_GOOD;
 		}
 
@@ -1546,7 +1504,7 @@
 		US_DEBUGP("READ_10: read page %d pagect %d\n",
 			  page, pages);
 
-		return sddr09_read_data(us, page, pages, ptr, srb->use_sg);
+		return sddr09_read_data(us, page, pages);
 	}
 
 	if (srb->cmnd[0] == WRITE_10) {
@@ -1559,11 +1517,12 @@
 		US_DEBUGP("WRITE_10: write page %d pagect %d\n",
 			  page, pages);
 
-		return sddr09_write_data(us, page, pages, ptr, srb->use_sg);
+		return sddr09_write_data(us, page, pages);
 	}
 
-	// Pass TEST_UNIT_READY and REQUEST_SENSE through
-
+	/* catch-all for all other commands, except
+	 * pass TEST_UNIT_READY and REQUEST_SENSE through
+	 */
 	if (srb->cmnd[0] != TEST_UNIT_READY &&
 	    srb->cmnd[0] != REQUEST_SENSE) {
 		sensekey = 0x05;	/* illegal request */
@@ -1577,11 +1536,11 @@
 
 	srb->cmnd[1] = LUNBITS;
 
-	string[0] = 0;
+	ptr[0] = 0;
 	for (i=0; i<12; i++)
-		sprintf(string+strlen(string), "%02X ", srb->cmnd[i]);
+		sprintf(ptr+strlen(ptr), "%02X ", srb->cmnd[i]);
 
-	US_DEBUGP("SDDR09: Send control for command %s\n", string);
+	US_DEBUGP("SDDR09: Send control for command %s\n", ptr);
 
 	result = sddr09_send_scsi_command(us, srb->cmnd, 12);
 	if (result != USB_STOR_TRANSPORT_GOOD) {
diff -Nru a/drivers/usb/storage/sddr55.c b/drivers/usb/storage/sddr55.c
--- a/drivers/usb/storage/sddr55.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/storage/sddr55.c	Tue Feb  3 19:45:17 2004
@@ -153,14 +153,13 @@
 static int sddr55_read_data(struct us_data *us,
 		unsigned int lba,
 		unsigned int page,
-		unsigned short sectors,
-		unsigned char *buffer,
-		int use_sg) {
+		unsigned short sectors) {
 
 	int result = USB_STOR_TRANSPORT_GOOD;
 	unsigned char *command = us->iobuf;
 	unsigned char *status = us->iobuf;
 	struct sddr55_card_info *info = (struct sddr55_card_info *)us->extra;
+	unsigned char *buffer;
 
 	unsigned int pba;
 	unsigned long address;
@@ -169,20 +168,14 @@
 	unsigned int len, index, offset;
 
 	// Since we only read in one block at a time, we have to create
-	// a bounce buffer if the transfer uses scatter-gather.  We will
-	// move the data a piece at a time between the bounce buffer and
-	// the actual transfer buffer.  If we're not using scatter-gather,
-	// we can simply update the transfer buffer pointer to get the
-	// same effect.
-
-	if (use_sg) {
-		len = min((unsigned int) sectors,
-				(unsigned int) info->blocksize >>
-					info->smallpageshift) * PAGESIZE;
-		buffer = kmalloc(len, GFP_NOIO);
-		if (buffer == NULL)
-			return USB_STOR_TRANSPORT_ERROR; /* out of memory */
-	}
+	// a bounce buffer and move the data a piece at a time between the
+	// bounce buffer and the actual transfer buffer.
+
+	len = min((unsigned int) sectors, (unsigned int) info->blocksize >>
+			info->smallpageshift) * PAGESIZE;
+	buffer = kmalloc(len, GFP_NOIO);
+	if (buffer == NULL)
+		return USB_STOR_TRANSPORT_ERROR; /* out of memory */
 	index = offset = 0;
 
 	while (sectors>0) {
@@ -258,12 +251,9 @@
 			}
 		}
 
-		// Store the data (s-g) or update the pointer (!s-g)
-		if (use_sg)
-			usb_stor_access_xfer_buf(buffer, len, us->srb,
-					&index, &offset, TO_XFER_BUF);
-		else
-			buffer += len;
+		// Store the data in the transfer buffer
+		usb_stor_access_xfer_buf(buffer, len, us->srb,
+				&index, &offset, TO_XFER_BUF);
 
 		page = 0;
 		lba++;
@@ -273,8 +263,7 @@
 	result = USB_STOR_TRANSPORT_GOOD;
 
 leave:
-	if (use_sg)
-		kfree(buffer);
+	kfree(buffer);
 
 	return result;
 }
@@ -282,14 +271,13 @@
 static int sddr55_write_data(struct us_data *us,
 		unsigned int lba,
 		unsigned int page,
-		unsigned short sectors,
-		unsigned char *buffer,
-		int use_sg) {
+		unsigned short sectors) {
 
 	int result = USB_STOR_TRANSPORT_GOOD;
 	unsigned char *command = us->iobuf;
 	unsigned char *status = us->iobuf;
 	struct sddr55_card_info *info = (struct sddr55_card_info *)us->extra;
+	unsigned char *buffer;
 
 	unsigned int pba;
 	unsigned int new_pba;
@@ -306,20 +294,14 @@
 	}
 
 	// Since we only write one block at a time, we have to create
-	// a bounce buffer if the transfer uses scatter-gather.  We will
-	// move the data a piece at a time between the bounce buffer and
-	// the actual transfer buffer.  If we're not using scatter-gather,
-	// we can simply update the transfer buffer pointer to get the
-	// same effect.
-
-	if (use_sg) {
-		len = min((unsigned int) sectors,
-				(unsigned int) info->blocksize >>
-					info->smallpageshift) * PAGESIZE;
-		buffer = kmalloc(len, GFP_NOIO);
-		if (buffer == NULL)
-			return USB_STOR_TRANSPORT_ERROR;
-	}
+	// a bounce buffer and move the data a piece at a time between the
+	// bounce buffer and the actual transfer buffer.
+
+	len = min((unsigned int) sectors, (unsigned int) info->blocksize >>
+			info->smallpageshift) * PAGESIZE;
+	buffer = kmalloc(len, GFP_NOIO);
+	if (buffer == NULL)
+		return USB_STOR_TRANSPORT_ERROR;
 	index = offset = 0;
 
 	while (sectors > 0) {
@@ -336,10 +318,9 @@
 				info->blocksize - page);
 		len = pages << info->pageshift;
 
-		// Get the data from the transfer buffer (s-g)
-		if (use_sg)
-			usb_stor_access_xfer_buf(buffer, len, us->srb,
-					&index, &offset, FROM_XFER_BUF);
+		// Get the data from the transfer buffer
+		usb_stor_access_xfer_buf(buffer, len, us->srb,
+				&index, &offset, FROM_XFER_BUF);
 
 		US_DEBUGP("Write %02X pages, to PBA %04X"
 			" (LBA %04X) page %02X\n",
@@ -480,9 +461,6 @@
 		/* update the pba<->lba maps for new_pba */
 		info->pba_to_lba[new_pba] = lba % 1000;
 
-		// Update the transfer buffer pointer (!s-g)
-		if (!use_sg)
-			buffer += len;
 		page = 0;
 		lba++;
 		sectors -= pages >> info->smallpageshift;
@@ -490,8 +468,7 @@
 	result = USB_STOR_TRANSPORT_GOOD;
 
  leave:
-	if (use_sg)
-		kfree(buffer);
+	kfree(buffer);
 	return result;
 }
 
@@ -760,16 +737,16 @@
 int sddr55_transport(Scsi_Cmnd *srb, struct us_data *us)
 {
 	int result;
-	int i;
-	unsigned char inquiry_response[36] = {
+	static unsigned char inquiry_response[8] = {
 		0x00, 0x80, 0x00, 0x02, 0x1F, 0x00, 0x00, 0x00
 	};
-	unsigned char mode_page_01[16] = { // write-protected for now
-		0x03, 0x00, 0x80, 0x00,
+ 	// write-protected for now, no block descriptor support
+	static unsigned char mode_page_01[20] = {
+		0x0, 0x12, 0x00, 0x80, 0x0, 0x0, 0x0, 0x0,
 		0x01, 0x0A,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 	};
-	unsigned char *ptr;
+	unsigned char *ptr = us->iobuf;
 	unsigned long capacity;
 	unsigned int lba;
 	unsigned int pba;
@@ -788,21 +765,13 @@
 
 	info = (struct sddr55_card_info *)(us->extra);
 
-	ptr = (unsigned char *)srb->request_buffer;
-
 	if (srb->cmnd[0] == REQUEST_SENSE) {
-		i = srb->cmnd[4];
-
-		if (i > sizeof info->sense_data)
-			i = sizeof info->sense_data;
-
-
 		US_DEBUGP("SDDR55: request sense %02x/%02x/%02x\n", info->sense_data[2], info->sense_data[12], info->sense_data[13]);
 
-		info->sense_data[0] = 0x70;
-		info->sense_data[7] = 10;
-
-		memcpy (ptr, info->sense_data, i);
+		memcpy (ptr, info->sense_data, sizeof info->sense_data);
+		ptr[0] = 0x70;
+		ptr[7] = 11;
+		usb_stor_set_xfer_buf (ptr, sizeof info->sense_data, srb);
 		memset (info->sense_data, 0, sizeof info->sense_data);
 
 		return USB_STOR_TRANSPORT_GOOD;
@@ -814,8 +783,8 @@
 	   respond to INQUIRY commands */
 
 	if (srb->cmnd[0] == INQUIRY) {
-		memset(inquiry_response+8, 0, 28);
-		fill_inquiry_response(us, inquiry_response, 36);
+		memcpy(ptr, inquiry_response, 8);
+		fill_inquiry_response(us, ptr, 36);
 		return USB_STOR_TRANSPORT_GOOD;
 	}
 
@@ -858,64 +827,40 @@
 		 * the fact that only 250 out of every 256 are used */
 		info->max_log_blks = ((info->capacity >> (info->pageshift + info->blockshift)) / 256) * 250;
 
-		/* Last page in the card, adjust as we only use 250 out of every 256 pages */
+		/* Last page in the card, adjust as we only use 250 out of
+		 * every 256 pages */
 		capacity = (capacity / 256) * 250;
 
 		capacity /= PAGESIZE;
 		capacity--;
 
-		ptr[0] = MSB_of(capacity>>16);
-		ptr[1] = LSB_of(capacity>>16);
-		ptr[2] = MSB_of(capacity&0xFFFF);
-		ptr[3] = LSB_of(capacity&0xFFFF);
-
-		// The page size
-
-		ptr[4] = MSB_of(PAGESIZE>>16);
-		ptr[5] = LSB_of(PAGESIZE>>16);
-		ptr[6] = MSB_of(PAGESIZE&0xFFFF);
-		ptr[7] = LSB_of(PAGESIZE&0xFFFF);
+		((u32 *) ptr)[0] = cpu_to_be32(capacity);
+		((u32 *) ptr)[1] = cpu_to_be32(PAGESIZE);
+		usb_stor_set_xfer_buf(ptr, 8, srb);
 
 		sddr55_read_map(us);
 
 		return USB_STOR_TRANSPORT_GOOD;
 	}
 
-	if (srb->cmnd[0] == MODE_SENSE) {
+	if (srb->cmnd[0] == MODE_SENSE_10) {
 
-		mode_page_01[2] = (info->read_only || info->force_read_only) ? 0x80 : 0;
+		memcpy(ptr, mode_page_01, sizeof mode_page_01);
+		ptr[3] = (info->read_only || info->force_read_only) ? 0x80 : 0;
+		usb_stor_set_xfer_buf(ptr, sizeof(mode_page_01), srb);
 
 		if ( (srb->cmnd[2] & 0x3F) == 0x01 ) {
-
 			US_DEBUGP(
 			  "SDDR55: Dummy up request for mode page 1\n");
-
-			if (ptr==NULL || 
-			  srb->request_bufflen<sizeof(mode_page_01)) {
-				set_sense_info (5, 0x24, 0);	/* invalid field in command */
-				return USB_STOR_TRANSPORT_FAILED;
-			}
-
-			memcpy(ptr, mode_page_01, sizeof(mode_page_01));
 			return USB_STOR_TRANSPORT_GOOD;
 
 		} else if ( (srb->cmnd[2] & 0x3F) == 0x3F ) {
-
 			US_DEBUGP(
 			  "SDDR55: Dummy up request for all mode pages\n");
-
-			if (ptr==NULL || 
-			  srb->request_bufflen<sizeof(mode_page_01)) {
-				set_sense_info (5, 0x24, 0);	/* invalid field in command */
-				return USB_STOR_TRANSPORT_FAILED;
-			}
-
-			memcpy(ptr, mode_page_01, sizeof(mode_page_01));
 			return USB_STOR_TRANSPORT_GOOD;
 		}
 
 		set_sense_info (5, 0x24, 0);	/* invalid field in command */
-
 		return USB_STOR_TRANSPORT_FAILED;
 	}
 
@@ -963,13 +908,13 @@
 				" pages %d\n",
 				pba, lba, page, pages);
 
-			return sddr55_write_data(us, lba, page, pages, ptr, srb->use_sg);
+			return sddr55_write_data(us, lba, page, pages);
 		} else {
 			US_DEBUGP("READ_10: read block %04X (LBA %04X) page %01X"
 				" pages %d\n",
 				pba, lba, page, pages);
 
-			return sddr55_read_data(us, lba, page, pages, ptr, srb->use_sg);
+			return sddr55_read_data(us, lba, page, pages);
 		}
 	}
 
diff -Nru a/drivers/usb/storage/shuttle_usbat.c b/drivers/usb/storage/shuttle_usbat.c
--- a/drivers/usb/storage/shuttle_usbat.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/usb/storage/shuttle_usbat.c	Tue Feb  3 19:45:16 2004
@@ -569,21 +569,15 @@
 	}
 
 	// Since we only read in one block at a time, we have to create
-	// a bounce buffer if the transfer uses scatter-gather.  We will
-	// move the data a piece at a time between the bounce buffer and
-	// the actual transfer buffer.  If we're not using scatter-gather,
-	// we can simply update the transfer buffer pointer to get the
-	// same effect.
+	// a bounce buffer and move the data a piece at a time between the
+	// bounce buffer and the actual transfer buffer.
 
 	len = (65535/srb->transfersize) * srb->transfersize;
 	US_DEBUGP("Max read is %d bytes\n", len);
 	len = min(len, srb->request_bufflen);
-	if (srb->use_sg) {
-		buffer = kmalloc(len, GFP_NOIO);
-		if (buffer == NULL) // bloody hell!
-			return USB_STOR_TRANSPORT_FAILED;
-	} else
-		buffer = srb->request_buffer;
+	buffer = kmalloc(len, GFP_NOIO);
+	if (buffer == NULL) // bloody hell!
+		return USB_STOR_TRANSPORT_FAILED;
 	sector = short_pack(data[7+3], data[7+2]);
 	sector <<= 16;
 	sector |= short_pack(data[7+5], data[7+4]);
@@ -621,12 +615,9 @@
 		if (result != USB_STOR_TRANSPORT_GOOD)
 			break;
 
-		// Store the data (s-g) or update the pointer (!s-g)
-		if (srb->use_sg)
-			usb_stor_access_xfer_buf(buffer, len, srb,
-					 &sg_segment, &sg_offset, TO_XFER_BUF);
-		else
-			buffer += len;
+		// Store the data in the transfer buffer
+		usb_stor_access_xfer_buf(buffer, len, srb,
+				 &sg_segment, &sg_offset, TO_XFER_BUF);
 
 		// Update the amount transferred and the sector number
 
@@ -635,8 +626,7 @@
 
 	} // while transferred != srb->request_bufflen
 
-	if (srb->use_sg)
-		kfree(buffer);
+	kfree(buffer);
 	return result;
 }
 
diff -Nru a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
--- a/drivers/usb/storage/transport.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/storage/transport.c	Tue Feb  3 19:45:17 2004
@@ -1067,6 +1067,9 @@
 	int result;
 	int result2;
 
+	/* Let the SCSI layer know we are doing a reset */
+	usb_stor_report_device_reset(us);
+
 	/* A 20-second timeout may seem rather long, but a LaCie
 	 *  StudioDrive USB2 device takes 16+ seconds to get going
 	 *  following a powerup or USB attach event. */
@@ -1088,6 +1091,9 @@
 		US_DEBUGP("Reset interrupted by disconnect\n");
 		return FAILED;
 	}
+
+	/* permit the clear-halt transfers to take place */
+	clear_bit(US_FLIDX_ABORTING, &us->flags);
 
 	US_DEBUGP("Soft reset: clearing bulk-in endpoint halt\n");
 	result = usb_stor_clear_halt(us, us->recv_bulk_pipe);
diff -Nru a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
--- a/drivers/usb/storage/unusual_devs.h	Tue Feb  3 19:45:36 2004
+++ b/drivers/usb/storage/unusual_devs.h	Tue Feb  3 19:45:36 2004
@@ -45,13 +45,6 @@
  *
  */
 
-/* Patch submitted by Martin Berentsen <berentsen at sent5 dot uni-duisburg dot de> */
-#define US_FL_START_STOP  0x00000004   /* ignore START_STOP commands     */
-UNUSUAL_DEV(  0x0686, 0x4014, 0x0001, 0x0001, 
-		"Minolta",
-		"Dimage S414",
-		US_SC_SCSI, US_PR_BULK, NULL, US_FL_START_STOP), 
-
 UNUSUAL_DEV(  0x03ee, 0x0000, 0x0000, 0x0245, 
 		"Mitsumi",
 		"CD-R/RW Drive",
@@ -122,6 +115,13 @@
 		"DVD-CAM DZ-MV100A Camcorder",
 		US_SC_SCSI, US_PR_CB, NULL, US_FL_SINGLE_LUN),
 
+/* Reported by Simon Levitt <simon@whattf.com>
+ * This entry needs Sub and Proto fields */
+UNUSUAL_DEV(  0x04b8, 0x0601, 0x0100, 0x0100,
+		"Epson",
+		"875DC Storage",
+		US_SC_SCSI, US_PR_CB, NULL, US_FL_FIX_INQUIRY),
+
 /* Reported by Khalid Aziz <khalid@gonehiking.org>
  * This entry is needed because the device reports Sub=ff */
 UNUSUAL_DEV(  0x04b8, 0x0602, 0x0110, 0x0110,
@@ -296,7 +296,7 @@
 UNUSUAL_DEV(  0x054c, 0x006d, 0x0000, 0x9999,
 		"Sony",
 		"PEG Mass Storage",
-		US_SC_8070, US_PR_CBI, NULL,
+		US_SC_DEVICE, US_PR_DEVICE, NULL,
 		US_FL_FIX_INQUIRY ),
 		
 UNUSUAL_DEV(  0x057b, 0x0000, 0x0000, 0x0299, 
@@ -377,7 +377,7 @@
 UNUSUAL_DEV(  0x05e3, 0x0701, 0x0000, 0xffff, 
 		"", 
 		"USB TO IDE",
-		US_SC_SCSI, US_PR_BULK, NULL,
+		US_SC_SCSI, US_PR_DEVICE, NULL,
 		US_FL_MODE_XLATE ), 
 
 /* Reported by Peter Marks <peter.marks@turner.com>
@@ -489,11 +489,6 @@
 		"Freecom",
 		"USB-IDE",
 		US_SC_QIC, US_PR_FREECOM, freecom_init, 0),
-
-UNUSUAL_DEV(  0x07ab, 0xfc84, 0x0000, 0x9999,
-		"Freecom",
-		"FX-5/FX-50",
-		US_SC_QIC, US_PR_FREECOM, freecom_init, 0),
 #endif
 
 UNUSUAL_DEV(  0x07af, 0x0004, 0x0100, 0x0133, 
@@ -639,11 +634,19 @@
 		"3MegaCam",
 		US_SC_DEVICE, US_PR_BULK, NULL,
 		US_FL_MODE_XLATE ),
+
+/* Trumpion Microelectronics MP3 player (felipe_alfaro@linuxmail.org) */
+UNUSUAL_DEV( 0x090a, 0x1200, 0x0000, 0x9999,
+		"Trumpion",
+		"MP3 player",
+		US_SC_RBC, US_PR_BULK, NULL,
+		US_FL_MODE_XLATE),
+
 /* aeb */
 UNUSUAL_DEV( 0x090c, 0x1132, 0x0000, 0xffff,
 		"Feiya",
 		"5-in-1 Card Reader",
-		US_SC_SCSI, US_PR_BULK, NULL,
+		US_SC_DEVICE, US_PR_DEVICE, NULL,
 		US_FL_FIX_CAPACITY ),
 
 UNUSUAL_DEV(  0x097a, 0x0001, 0x0000, 0x0001,
@@ -670,6 +673,13 @@
                 "Optio 2/3/400",
                 US_SC_DEVICE, US_PR_DEVICE, NULL,
                 US_FL_FIX_INQUIRY ),
+
+/* This entry from <matthias@ma-c.de> in the Debian mailing list */
+UNUSUAL_DEV( 0x0a17, 0x0006, 0x0000, 0xffff,
+		"Pentax",
+		"Optio 330GS",
+		US_SC_8070, US_PR_CB, NULL,
+		US_FL_MODE_XLATE | US_FL_FIX_INQUIRY ),
 
 /* Submitted by Per Winkvist <per.winkvist@uk.com> */
 UNUSUAL_DEV( 0x0a17, 0x006, 0x1000, 0x9009,
diff -Nru a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
--- a/drivers/usb/usb-skeleton.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/usb/usb-skeleton.c	Tue Feb  3 19:45:17 2004
@@ -205,14 +205,11 @@
  */
 static inline void skel_delete (struct usb_skel *dev)
 {
-	if (dev->bulk_in_buffer != NULL)
-		kfree (dev->bulk_in_buffer);
-	if (dev->bulk_out_buffer != NULL)
-		usb_buffer_free (dev->udev, dev->bulk_out_size,
+	kfree (dev->bulk_in_buffer);
+	usb_buffer_free (dev->udev, dev->bulk_out_size,
 				dev->bulk_out_buffer,
 				dev->write_urb->transfer_dma);
-	if (dev->write_urb != NULL)
-		usb_free_urb (dev->write_urb);
+	usb_free_urb (dev->write_urb);
 	kfree (dev);
 }
 
@@ -297,7 +294,7 @@
 
 	--dev->open;
 
-	if (!dev->present) {
+	if (!dev->present && !dev->open) {
 		/* the device was unplugged before the file was released */
 		up (&dev->sem);
 		skel_delete (dev);
diff -Nru a/drivers/video/Kconfig b/drivers/video/Kconfig
--- a/drivers/video/Kconfig	Tue Feb  3 19:45:16 2004
+++ b/drivers/video/Kconfig	Tue Feb  3 19:45:16 2004
@@ -109,29 +109,6 @@
 	  If you plan to use the LCD display with your SA-1100 system, say
 	  Y here.
 
-choice
-	prompt "CerfBoard LCD Display Size"
-	depends on FB_SA1100 && SA1100_CERF
-	default CERF_LCD_57_A
-
-config CERF_LCD_38_A
-	bool "3.8_Color"
-
-config CERF_LCD_38_B
-	bool "3.8_Mono"
-
-config CERF_LCD_57_A
-	bool "5.7"
-
-config CERF_LCD_72_A
-	bool "7.2"
-
-endchoice
-
-config SA1100_CERF_LCD_BACKLIGHT
-	bool "Cerfboard Backlight (CerfPDA)"
-	depends on FB_SA1100 && SA1100_CERF_CPLD
-
 config FB_CYBER2000
 	tristate "CyberPro 2000/2010/5000 support"
 	depends on FB && PCI
@@ -406,14 +383,6 @@
 	  (<file:drivers/video/pvr2fb.c>). Please see the file
 	  <file:Documentation/fb/pvr2fb.txt>.
 
-config FB_PVR2_DEBUG
-	bool "Debug pvr2fb"
-	depends on FB_PVR2=y
-	help
-	  Say Y here if you wish for the pvr2fb driver to print out debugging
-	  messages. Most people will want to say N here. If unsure, you will
-	  also want to say N.
-
 config FB_E1355
 	bool "Epson 1355 framebuffer support"
 	depends on FB && SUPERH
@@ -579,7 +548,8 @@
 
 config FB_MATROX_I2C
 	tristate "Matrox I2C support"
-	depends on FB_MATROX && I2C_ALGOBIT
+	depends on FB_MATROX && I2C
+	select I2C_ALGOBIT
 	---help---
 	  This drivers creates I2C buses which are needed for accessing the
 	  DDC (I2C) bus present on all Matroxes, an I2C bus which
@@ -733,6 +703,16 @@
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called neofb.
+
+config FB_KYRO
+	tristate "IMG Kyro support"
+	depends on FB && PCI
+	help
+	  Say Y here if you have a STG4000 / Kyro / PowerVR 3 based
+	  graphics board.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called kyrofb.
 
 config FB_3DFX
 	tristate "3Dfx Banshee/Voodoo3 display support"
diff -Nru a/drivers/video/Makefile b/drivers/video/Makefile
--- a/drivers/video/Makefile	Tue Feb  3 19:45:17 2004
+++ b/drivers/video/Makefile	Tue Feb  3 19:45:17 2004
@@ -70,6 +70,7 @@
 obj-$(CONFIG_FB_HIT)              += hitfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_E1355)            += epson1355fb.o
 obj-$(CONFIG_FB_PVR2)             += pvr2fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
+obj-$(CONFIG_FB_KYRO)             += kyro/ cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_VOODOO1)          += sstfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 
 obj-$(CONFIG_FB_FFB)               += ffb.o sbuslib.o cfbimgblt.o cfbcopyarea.o
diff -Nru a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
--- a/drivers/video/aty/aty128fb.c	Tue Feb  3 19:45:18 2004
+++ b/drivers/video/aty/aty128fb.c	Tue Feb  3 19:45:18 2004
@@ -2102,7 +2102,7 @@
 	reg |= LVDS_BL_MOD_EN | LVDS_BLON;
 	if (on && level > BACKLIGHT_OFF) {
 		reg |= LVDS_DIGION;
-		if (!reg & LVDS_ON) {
+		if (!(reg & LVDS_ON)) {
 			reg &= ~LVDS_BLON;
 			aty_st_le32(LVDS_GEN_CNTL, reg);
 			(void)aty_ld_le32(LVDS_GEN_CNTL);
diff -Nru a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
--- a/drivers/video/cirrusfb.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/video/cirrusfb.c	Tue Feb  3 19:45:42 2004
@@ -3089,7 +3089,7 @@
 *********************************************************************/
 
 /* FIXME: use interrupts instead */
-extern inline void clgen_WaitBLT (caddr_t regbase)
+static inline void clgen_WaitBLT (caddr_t regbase)
 {
 	/* now busy-wait until we're done */
 	while (vga_rgfx (regbase, CL_GR31) & 0x08)
diff -Nru a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
--- a/drivers/video/console/Kconfig	Tue Feb  3 19:45:17 2004
+++ b/drivers/video/console/Kconfig	Tue Feb  3 19:45:17 2004
@@ -6,7 +6,7 @@
 
 config VGA_CONSOLE
 	bool "VGA text console" if EMBEDDED || !X86
-	depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC32 && !SPARC64
+	depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC32 && !SPARC64 && !M68K
 	default y
 	help
 	  Saying Y here will allow you to use Linux in text mode through a
@@ -43,6 +43,7 @@
 	  about the Video mode selection support. If unsure, say N.
 
 config MDA_CONSOLE
+	depends on !M68K
 	tristate "MDA text console (dual-headed) (EXPERIMENTAL)"
 	---help---
 	  Say Y here if you have an old MDA or monochrome Hercules graphics
diff -Nru a/drivers/video/console/Makefile b/drivers/video/console/Makefile
--- a/drivers/video/console/Makefile	Tue Feb  3 19:45:17 2004
+++ b/drivers/video/console/Makefile	Tue Feb  3 19:45:17 2004
@@ -29,10 +29,12 @@
 obj-$(CONFIG_FB_STI)              += sticore.o
 
 # Files generated that shall be removed upon make clean
-clean-files := promcon_tbl.c
+targets := promcon_tbl.c
 
-$(obj)/promcon_tbl.c: $(src)/prom.uni
-	$(objtree)/scripts/conmakehash $< | \
-	sed -e '/#include <[^>]*>/p' -e 's/types/init/' \
-	    -e 's/dfont\(_uni.*\]\)/promfont\1 __initdata/' > $@
+quiet_cmd_conmakehash = CNMKHSH $@
+      cmd_conmakehash = $(objtree)/scripts/conmakehash $< | \
+		sed -e '/\#include <[^>]*>/p' -e 's/types/init/' \
+		-e 's/dfont\(_uni.*\]\)/promfont\1 __initdata/' > $@
 
+$(obj)/promcon_tbl.c: $(src)/prom.uni FORCE
+	$(call if_changed,conmakehash)
diff -Nru a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
--- a/drivers/video/console/fbcon.c	Tue Feb  3 19:45:34 2004
+++ b/drivers/video/console/fbcon.c	Tue Feb  3 19:45:34 2004
@@ -545,7 +545,7 @@
 		return display_desc;
 	done = 1;
 
-	info = registered_fb[num_registered_fb-1];	
+	info = registered_fb[0];	
 	if (!info)	return NULL;
 	info->currcon = -1;
 	
diff -Nru a/drivers/video/console/font_acorn_8x8.c b/drivers/video/console/font_acorn_8x8.c
--- a/drivers/video/console/font_acorn_8x8.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/video/console/font_acorn_8x8.c	Tue Feb  3 19:45:17 2004
@@ -10,33 +10,33 @@
 /* 03 */  0x6c, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, /* ^C */
 /* 04 */  0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, /* ^D */
 /* 05 */  0x00, 0x18, 0x3c, 0xe7, 0xe7, 0x3c, 0x18, 0x00, /* ^E */
-/* 06 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 07 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 08 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 09 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 0A */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 0B */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 0C */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 0D */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 0E */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 0F */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+/* 06 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 07 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 08 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 09 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 0A */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 0B */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 0C */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 0D */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 0E */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 0F */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
 /* 10 */  0x00, 0x60, 0x78, 0x7e, 0x7e, 0x78, 0x60, 0x00, /* |> */
 /* 11 */  0x00, 0x06, 0x1e, 0x7e, 0x7e, 0x1e, 0x06, 0x00, /* <| */
-/* 12 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 13 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 14 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 15 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 16 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 17 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 18 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 19 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 1A */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 1B */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 1C */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 1D */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+/* 12 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 13 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 14 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 15 */  0x3c, 0x60, 0x3c, 0x66, 0x3c, 0x06, 0x3c, 0x00,
+/* 16 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 17 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 18 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 19 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 1A */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 1B */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 1C */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 1D */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
 /* 1E */  0x00, 0x18, 0x18, 0x3c, 0x3c, 0x7e, 0x7e, 0x00, /* /\ */
 /* 1F */  0x00, 0x7e, 0x7e, 0x3c, 0x3c, 0x18, 0x18, 0x00, /* \/ */
-/* 20 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*	 */
+/* 20 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*   */
 /* 21 */  0x18, 0x3c, 0x3c, 0x18, 0x18, 0x00, 0x18, 0x00, /* ! */
 /* 22 */  0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, /* " */
 /* 23 */  0x36, 0x36, 0x7F, 0x36, 0x7F, 0x36, 0x36, 0x00, /* # */
@@ -131,55 +131,55 @@
 /* 7C */  0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, /* | */
 /* 7D */  0x30, 0x18, 0x18, 0x0E, 0x18, 0x18, 0x30, 0x00, /* } */
 /* 7E */  0x31, 0x6B, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, /* ~ */
-/* 7F */  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,  /*  */
-/* 80 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 81 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 82 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 83 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 84 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 85 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 86 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 87 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 88 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 89 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 8A */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 8B */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 8C */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 8D */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 8E */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 8F */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 90 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 91 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 92 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 93 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 94 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 95 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 96 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 97 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 98 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 99 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 9A */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 9B */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 9C */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 9D */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 9E */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* 9F */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* A0 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* A1 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* A2 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* A3 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* A4 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* A5 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* A6 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* A7 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* A8 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* A9 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* AA */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* AB */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* AC */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* AD */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* AE */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* AF */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+/* 7F */  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*  */
+/* 80 */  0x3c, 0x66, 0x60, 0x60, 0x66, 0x3c, 0x30, 0x60,
+/* 81 */  0x66, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3e, 0x00,
+/* 82 */  0x0c, 0x18, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00,
+/* 83 */  0x18, 0x66, 0x3c, 0x06, 0x3e, 0x66, 0x3e, 0x00,
+/* 84 */  0x66, 0x00, 0x3c, 0x06, 0x3e, 0x66, 0x3e, 0x00,
+/* 85 */  0x30, 0x18, 0x3c, 0x06, 0x3e, 0x66, 0x3e, 0x00,
+/* 86 */  0x3c, 0x66, 0x3c, 0x06, 0x3e, 0x66, 0x3e, 0x00,
+/* 87 */  0x00, 0x00, 0x3c, 0x66, 0x60, 0x66, 0x3c, 0x60,
+/* 88 */  0x3c, 0x66, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00,
+/* 89 */  0x66, 0x00, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00,
+/* 8A */  0x30, 0x18, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00,
+/* 8B */  0x66, 0x00, 0x00, 0x38, 0x18, 0x18, 0x3c, 0x00,
+/* 8C */  0x3c, 0x66, 0x00, 0x38, 0x18, 0x18, 0x3c, 0x00,
+/* 8D */  0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x3c, 0x00,
+/* 8E */  0x66, 0x66, 0x00, 0x3c, 0x66, 0x7e, 0x66, 0x00,
+/* 8F */  0x18, 0x66, 0x00, 0x3c, 0x66, 0x7e, 0x66, 0x00,
+/* 90 */  0x0c, 0x18, 0x7e, 0x60, 0x7c, 0x60, 0x7e, 0x00,
+/* 91 */  0x00, 0x00, 0x3f, 0x0d, 0x3f, 0x6c, 0x3f, 0x00,
+/* 92 */  0x3f, 0x66, 0x66, 0x7f, 0x66, 0x66, 0x67, 0x00,
+/* 93 */  0x3c, 0x66, 0x00, 0x3c, 0x66, 0x66, 0x3c, 0x00,
+/* 94 */  0x66, 0x00, 0x00, 0x3c, 0x66, 0x66, 0x3c, 0x00,
+/* 95 */  0x30, 0x18, 0x00, 0x3c, 0x66, 0x66, 0x3c, 0x00,
+/* 96 */  0x3c, 0x66, 0x00, 0x66, 0x66, 0x66, 0x3e, 0x00,
+/* 97 */  0x30, 0x18, 0x00, 0x66, 0x66, 0x66, 0x3e, 0x00,
+/* 98 */  0x66, 0x00, 0x66, 0x66, 0x66, 0x3e, 0x06, 0x3c,
+/* 99 */  0x66, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x3c, 0x00,
+/* 9A */  0x66, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00,
+/* 9B */  0x08, 0x3e, 0x6b, 0x68, 0x6b, 0x3e, 0x08, 0x00,
+/* 9C */  0x1c, 0x36, 0x30, 0x7c, 0x30, 0x30, 0x7e, 0x00,
+/* 9D */  0x66, 0x3c, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00,
+/* 9E */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* 9F */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* A0 */  0x0c, 0x18, 0x3c, 0x06, 0x3e, 0x66, 0x3e, 0x00,
+/* A1 */  0x0c, 0x18, 0x00, 0x38, 0x18, 0x18, 0x3c, 0x00,
+/* A2 */  0x0c, 0x18, 0x00, 0x3c, 0x66, 0x66, 0x3c, 0x00,
+/* A3 */  0x0c, 0x18, 0x00, 0x66, 0x66, 0x66, 0x3e, 0x00,
+/* A4 */  0x36, 0x6c, 0x00, 0x7c, 0x66, 0x66, 0x66, 0x00,
+/* A5 */  0x36, 0x6c, 0x00, 0x66, 0x76, 0x6e, 0x66, 0x00,
+/* A6 */  0x1c, 0x06, 0x1e, 0x36, 0x1e, 0x00, 0x3e, 0x00,
+/* A7 */  0x1c, 0x36, 0x36, 0x36, 0x1c, 0x00, 0x3e, 0x00,
+/* A8 */  0x18, 0x00, 0x18, 0x18, 0x30, 0x66, 0x3c, 0x00,
+/* A9 */  0x7e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+/* AA */  0x7e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+/* AB */  0x40, 0xc0, 0x40, 0x4f, 0x41, 0x0f, 0x08, 0x0f,
+/* AC */  0x40, 0xc0, 0x40, 0x48, 0x48, 0x0a, 0x0f, 0x02,
+/* AD */  0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00,
+/* AE */  0x00, 0x33, 0x66, 0xcc, 0xcc, 0x66, 0x33, 0x00,
+/* AF */  0x00, 0xcc, 0x66, 0x33, 0x33, 0x66, 0xcc, 0x00,
 /* B0 */  0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88,
 /* B1 */  0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa,
 /* B2 */  0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77,
@@ -228,37 +228,37 @@
 /* DD */  0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
 /* DE */  0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
 /* DF */  0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
-/* E0 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* E1 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* E2 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* E3 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* E4 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* E5 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* E6 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* E7 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* E8 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* E9 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* EA */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* EB */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* EC */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* ED */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* EE */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* EF */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* F0 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* F1 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* F2 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* F3 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* F4 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* F5 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* F6 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* F7 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* F8 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* F9 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* FA */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* FB */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* FC */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* FD */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-/* FE */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+/* E0 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* E1 */  0x3c, 0x66, 0x66, 0x6c, 0x66, 0x66, 0x6c, 0xc0,
+/* E2 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* E3 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* E4 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* E5 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* E6 */  0x00, 0x00, 0x33, 0x33, 0x33, 0x33, 0x3e, 0x60,
+/* E7 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* E8 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* E9 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* EA */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* EB */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* EC */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* ED */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* EE */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* EF */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* F0 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* F1 */  0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x7e, 0x00,
+/* F2 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* F3 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* F4 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* F5 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* F6 */  0x00, 0x18, 0x00, 0xff, 0x00, 0x18, 0x00, 0x00,
+/* F7 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* F8 */  0x3c, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00,
+/* F9 */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* FA */  0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00,
+/* FB */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* FC */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
+/* FD */  0x38, 0x04, 0x18, 0x20, 0x3c, 0x00, 0x00, 0x00,
+/* FE */  0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
 /* FF */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
diff -Nru a/drivers/video/fbmem.c b/drivers/video/fbmem.c
--- a/drivers/video/fbmem.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/video/fbmem.c	Tue Feb  3 19:45:16 2004
@@ -159,6 +159,8 @@
 extern int tcx_setup(char*);
 extern int leo_init(void);
 extern int leo_setup(char*);
+extern int kyrofb_init(void);
+extern int kyrofb_setup(char*);
 
 static struct {
 	const char *name;
@@ -360,6 +362,10 @@
 #ifdef CONFIG_FB_VOODOO1
 	{ "sstfb", sstfb_init, sstfb_setup },
 #endif
+#ifdef CONFIG_FB_KYRO
+	{ "kyrofb", kyrofb_init, kyrofb_setup },
+#endif
+
 	/*
 	 * Generic drivers that don't use resource management (yet)
 	 */
diff -Nru a/drivers/video/kyro/Makefile b/drivers/video/kyro/Makefile
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/video/kyro/Makefile	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,13 @@
+#
+# Makefile for the Kyro framebuffer driver
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+# Note 2! The CFLAGS definitions are now in the main makefile...
+
+obj-$(CONFIG_FB_KYRO)	+= kyrofb.o
+
+kyrofb-objs	:= STG4000Ramdac.o STG4000VTG.o STG4000OverlayDevice.o \
+		   STG4000InitDevice.o fbdev.o
diff -Nru a/drivers/video/kyro/STG4000InitDevice.c b/drivers/video/kyro/STG4000InitDevice.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/video/kyro/STG4000InitDevice.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,326 @@
+/*
+ *  linux/drivers/video/kyro/STG4000InitDevice.c
+ *
+ *  Copyright (C) 2000 Imagination Technologies Ltd
+ *  Copyright (C) 2002 STMicroelectronics
+ *
+ * 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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+
+#include "STG4000Reg.h"
+
+/* SDRAM fixed settings */
+#define SDRAM_CFG_0   0x49A1
+#define SDRAM_CFG_1   0xA732
+#define SDRAM_CFG_2   0x31
+#define SDRAM_ARB_CFG 0xA0
+#define SDRAM_REFRESH 0x20
+
+/* Reset values */
+#define PMX2_SOFTRESET_DAC_RST		0x0001
+#define PMX2_SOFTRESET_C1_RST		0x0004
+#define PMX2_SOFTRESET_C2_RST		0x0008
+#define PMX2_SOFTRESET_3D_RST		0x0010
+#define PMX2_SOFTRESET_VIDIN_RST	0x0020
+#define PMX2_SOFTRESET_TLB_RST		0x0040
+#define PMX2_SOFTRESET_SD_RST		0x0080
+#define PMX2_SOFTRESET_VGA_RST		0x0100
+#define PMX2_SOFTRESET_ROM_RST		0x0200	/* reserved bit, do not reset */
+#define PMX2_SOFTRESET_TA_RST		0x0400
+#define PMX2_SOFTRESET_REG_RST		0x4000
+#define PMX2_SOFTRESET_ALL		0x7fff
+
+/* Core clock freq */
+#define CORE_PLL_FREQ 1000000
+
+/* Reference Clock freq */
+#define REF_FREQ 14318
+
+/* PCI Registers */
+static u16 CorePllControl = 0x70;
+
+#define	PCI_CONFIG_SUBSYS_ID	0x2e
+
+/* Misc */
+#define CORE_PLL_MODE_REG_0_7      3
+#define CORE_PLL_MODE_REG_8_15     2
+#define CORE_PLL_MODE_CONFIG_REG   1
+#define DAC_PLL_CONFIG_REG         0
+
+#define STG_MAX_VCO 500000
+#define STG_MIN_VCO 100000
+
+/* PLL Clock */
+#define    STG4K3_PLL_SCALER      8	/* scale numbers by 2^8 for fixed point calc */
+#define    STG4K3_PLL_MIN_R       2	/* Minimum multiplier */
+#define    STG4K3_PLL_MAX_R       33	/* Max */
+#define    STG4K3_PLL_MIN_F       2	/* Minimum divisor */
+#define    STG4K3_PLL_MAX_F       513	/* Max */
+#define    STG4K3_PLL_MIN_OD      0	/* Min output divider (shift) */
+#define    STG4K3_PLL_MAX_OD      2	/* Max */
+#define    STG4K3_PLL_MIN_VCO_SC  (100000000 >> STG4K3_PLL_SCALER)	/* Min VCO rate */
+#define    STG4K3_PLL_MAX_VCO_SC  (500000000 >> STG4K3_PLL_SCALER)	/* Max VCO rate */
+#define    STG4K3_PLL_MINR_VCO_SC (100000000 >> STG4K3_PLL_SCALER)	/* Min VCO rate (restricted) */
+#define    STG4K3_PLL_MAXR_VCO_SC (500000000 >> STG4K3_PLL_SCALER)	/* Max VCO rate (restricted) */
+#define    STG4K3_PLL_MINR_VCO    100000000	/* Min VCO rate (restricted) */
+#define    STG4K3_PLL_MAX_VCO     500000000	/* Max VCO rate */
+#define    STG4K3_PLL_MAXR_VCO    500000000	/* Max VCO rate (restricted) */
+
+#define OS_DELAY(X) \
+{ \
+volatile u32 i,count=0; \
+    for(i=0;i<X;i++) count++; \
+}
+
+u32 InitSDRAMRegisters(volatile STG4000REG * pSTGReg, u32 dwSubSysID,
+			 u32 dwRevID)
+{
+	u32 adwSDRAMArgCfg0[] = { 0xa0, 0x80, 0xa0, 0xa0, 0xa0 };
+	u32 adwSDRAMCfg1[] = { 0x8732, 0x8732, 0xa732, 0xa732, 0x8732 };
+	u32 adwSDRAMCfg2[] = { 0x87d2, 0x87d2, 0xa7d2, 0x87d2, 0xa7d2 };
+	u32 adwSDRAMRsh[] = { 36, 39, 40 };
+	u32 adwChipSpeed[] = { 110, 120, 125 };
+	u32 dwMemTypeIdx;
+	u32 dwChipSpeedIdx;
+
+	/* Get memory tpye and chip speed indexs from the SubSysDevID */
+	dwMemTypeIdx = (dwSubSysID & 0x70) >> 4;
+	dwChipSpeedIdx = (dwSubSysID & 0x180) >> 7;
+
+	if (dwMemTypeIdx > 4 || dwChipSpeedIdx > 2)
+		return 0;
+
+	/* Program SD-RAM interface */
+	STG_WRITE_REG(SDRAMArbiterConf, adwSDRAMArgCfg0[dwMemTypeIdx]);
+	if (dwRevID < 5) {
+		STG_WRITE_REG(SDRAMConf0, 0x49A1);
+		STG_WRITE_REG(SDRAMConf1, adwSDRAMCfg1[dwMemTypeIdx]);
+	} else {
+		STG_WRITE_REG(SDRAMConf0, 0x4DF1);
+		STG_WRITE_REG(SDRAMConf1, adwSDRAMCfg2[dwMemTypeIdx]);
+	}
+
+	STG_WRITE_REG(SDRAMConf2, 0x31);
+	STG_WRITE_REG(SDRAMRefresh, adwSDRAMRsh[dwChipSpeedIdx]);
+
+	return adwChipSpeed[dwChipSpeedIdx] * 10000;
+}
+
+u32 ProgramClock(u32 refClock,
+		   u32 coreClock,
+		   u32 * FOut, u32 * ROut, u32 * POut)
+{
+	u32 R = 0, F = 0, OD = 0, ODIndex = 0;
+	u32 ulBestR = 0, ulBestF = 0, ulBestOD = 0;
+	u32 ulBestVCO = 0, ulBestClk = 0, ulBestScore = 0;
+	u32 ulScore, ulPhaseScore, ulVcoScore;
+	u32 ulTmp = 0, ulVCO;
+	u32 ulScaleClockReq, ulMinClock, ulMaxClock;
+	u32 ODValues[] = { 1, 2, 0 };
+
+	/* Translate clock in Hz */
+	coreClock *= 100;	/* in Hz */
+	refClock *= 1000;	/* in Hz */
+
+	/* Work out acceptable clock
+	 * The method calculates ~ +- 0.4% (1/256)
+	 */
+	ulMinClock = coreClock - (coreClock >> 8);
+	ulMaxClock = coreClock + (coreClock >> 8);
+
+	/* Scale clock required for use in calculations */
+	ulScaleClockReq = coreClock >> STG4K3_PLL_SCALER;
+
+	/* Iterate through post divider values */
+	for (ODIndex = 0; ODIndex < 3; ODIndex++) {
+		OD = ODValues[ODIndex];
+		R = STG4K3_PLL_MIN_R;
+
+		/* loop for pre-divider from min to max  */
+		while (R <= STG4K3_PLL_MAX_R) {
+			/* estimate required feedback multiplier */
+			ulTmp = R * (ulScaleClockReq << OD);
+
+			/* F = ClkRequired * R * (2^OD) / Fref */
+			F = (u32)(ulTmp / (refClock >> STG4K3_PLL_SCALER));
+
+			/* compensate for accuracy */
+			if (F > STG4K3_PLL_MIN_F)
+				F--;
+
+
+			/*
+			 * We should be close to our target frequency (if it's
+			 * achievable with current OD & R) let's iterate
+			 * through F for best fit
+			 */
+			while ((F >= STG4K3_PLL_MIN_F) &&
+			       (F <= STG4K3_PLL_MAX_F)) {
+				/* Calc VCO at full accuracy */
+				ulVCO = refClock / R;
+				ulVCO = F * ulVCO;
+
+				/*
+				 * Check it's within restricted VCO range
+				 * unless of course the desired frequency is
+				 * above the restricted range, then test
+				 * against VCO limit
+				 */
+				if ((ulVCO >= STG4K3_PLL_MINR_VCO) &&
+				    ((ulVCO <= STG4K3_PLL_MAXR_VCO) ||
+				     ((coreClock > STG4K3_PLL_MAXR_VCO)
+				      && (ulVCO <= STG4K3_PLL_MAX_VCO)))) {
+					ulTmp = (ulVCO >> OD);	/* Clock = VCO / (2^OD) */
+
+					/* Is this clock good enough? */
+					if ((ulTmp >= ulMinClock)
+					    && (ulTmp <= ulMaxClock)) {
+						ulPhaseScore = (((refClock / R) - (refClock / STG4K3_PLL_MAX_R))) / ((refClock - (refClock / STG4K3_PLL_MAX_R)) >> 10);
+
+						ulVcoScore = ((ulVCO - STG4K3_PLL_MINR_VCO)) / ((STG4K3_PLL_MAXR_VCO - STG4K3_PLL_MINR_VCO) >> 10);
+						ulScore = ulPhaseScore + ulVcoScore;
+
+						if (!ulBestScore) {
+							ulBestVCO = ulVCO;
+							ulBestOD = OD;
+							ulBestF = F;
+							ulBestR = R;
+							ulBestClk = ulTmp;
+							ulBestScore =
+							    ulScore;
+						}
+						/* is this better, ( aim for highest Score) */
+			/*--------------------------------------------------------------------------
+                             Here we want to use a scoring system which will take account of both the
+                            value at the phase comparater and the VCO output
+                             to do this we will use a cumulative score between the two
+                          The way this ends up is that we choose the first value in the loop anyway
+                          but we shall keep this code in case new restrictions come into play
+                          --------------------------------------------------------------------------*/
+						if ((ulScore >= ulBestScore) && (OD > 0)) {
+							ulBestVCO = ulVCO;
+							ulBestOD = OD;
+							ulBestF = F;
+							ulBestR = R;
+							ulBestClk = ulTmp;
+							ulBestScore =
+							    ulScore;
+						}
+					}
+				}
+				F++;
+			}
+			R++;
+		}
+	}
+
+	/*
+	   did we find anything?
+	   Then return RFOD
+	 */
+	if (ulBestScore) {
+		*ROut = ulBestR;
+		*FOut = ulBestF;
+
+		if ((ulBestOD == 2) || (ulBestOD == 3)) {
+			*POut = 3;
+		} else
+			*POut = ulBestOD;
+
+	}
+
+	return (ulBestClk);
+}
+
+int SetCoreClockPLL(volatile STG4000REG * pSTGReg, struct pci_dev *pDev)
+{
+	u32 F, R, P;
+	u16 core_pll = 0, sub;
+	u32 ulCoreClock;
+	u32 tmp;
+	u32 ulChipSpeed;
+	u8 rev;
+
+	STG_WRITE_REG(IntMask, 0xFFFF);
+
+	/* Disable Primary Core Thread0 */
+	tmp = STG_READ_REG(Thread0Enable);
+	CLEAR_BIT(0);
+	STG_WRITE_REG(Thread0Enable, tmp);
+
+	/* Disable Primary Core Thread1 */
+	tmp = STG_READ_REG(Thread1Enable);
+	CLEAR_BIT(0);
+	STG_WRITE_REG(Thread1Enable, tmp);
+
+	STG_WRITE_REG(SoftwareReset,
+		      PMX2_SOFTRESET_REG_RST | PMX2_SOFTRESET_ROM_RST);
+	STG_WRITE_REG(SoftwareReset,
+		      PMX2_SOFTRESET_REG_RST | PMX2_SOFTRESET_TA_RST |
+		      PMX2_SOFTRESET_ROM_RST);
+
+	/* Need to play around to reset TA */
+	STG_WRITE_REG(TAConfiguration, 0);
+	STG_WRITE_REG(SoftwareReset,
+		      PMX2_SOFTRESET_REG_RST | PMX2_SOFTRESET_ROM_RST);
+	STG_WRITE_REG(SoftwareReset,
+		      PMX2_SOFTRESET_REG_RST | PMX2_SOFTRESET_TA_RST |
+		      PMX2_SOFTRESET_ROM_RST);
+
+	pci_read_config_word(pDev, PCI_CONFIG_SUBSYS_ID, &sub);
+	pci_read_config_byte(pDev, PCI_REVISION_ID, &rev);
+
+	ulChipSpeed = InitSDRAMRegisters(pSTGReg, (u32)sub, (u32)rev);
+
+	if (ulChipSpeed == 0)
+		return -EINVAL;
+
+	ulCoreClock = ProgramClock(REF_FREQ, CORE_PLL_FREQ, &F, &R, &P);
+
+	core_pll |= ((P) | ((F - 2) << 2) | ((R - 2) << 11));
+
+	/* Set Core PLL Control to Core PLL Mode  */
+
+	/* Send bits 0:7 of the Core PLL Mode register */
+	tmp = ((CORE_PLL_MODE_REG_0_7 << 8) | (core_pll & 0x00FF));
+	pci_write_config_word(pDev, CorePllControl, tmp);
+	/* Without some delay between the PCI config writes the clock does
+	   not reliably set when the code is compiled -O3
+	 */
+	OS_DELAY(1000000);
+
+	tmp |= SET_BIT(14);
+	pci_write_config_word(pDev, CorePllControl, tmp);
+	OS_DELAY(1000000);
+
+	/* Send bits 8:15 of the Core PLL Mode register */
+	tmp =
+	    ((CORE_PLL_MODE_REG_8_15 << 8) | ((core_pll & 0xFF00) >> 8));
+	pci_write_config_word(pDev, CorePllControl, tmp);
+	OS_DELAY(1000000);
+
+	tmp |= SET_BIT(14);
+	pci_write_config_word(pDev, CorePllControl, tmp);
+	OS_DELAY(1000000);
+
+	STG_WRITE_REG(SoftwareReset, PMX2_SOFTRESET_ALL);
+
+#if 0
+	/* Enable Primary Core Thread0 */
+	tmp = ((STG_READ_REG(Thread0Enable)) | SET_BIT(0));
+	STG_WRITE_REG(Thread0Enable, tmp);
+
+	/* Enable Primary Core Thread1 */
+	tmp = ((STG_READ_REG(Thread1Enable)) | SET_BIT(0));
+	STG_WRITE_REG(Thread1Enable, tmp);
+#endif
+
+	return 0;
+}
diff -Nru a/drivers/video/kyro/STG4000Interface.h b/drivers/video/kyro/STG4000Interface.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/video/kyro/STG4000Interface.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,60 @@
+/*
+ *  linux/drivers/video/kyro/STG4000Interface.h
+ *
+ *  Copyright (C) 2002 STMicroelectronics
+ *
+ * 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.
+ */
+
+#ifndef _STG4000INTERFACE_H
+#define _STG4000INTERFACE_H
+
+struct pci_dev;
+
+/*
+ * Ramdac Setup
+ */
+extern int InitialiseRamdac(volatile STG4000REG *pSTGReg, u32 displayDepth,
+			    u32 displayWidth, u32 displayHeight,
+			    s32 HSyncPolarity, s32 VSyncPolarity,
+			    u32 *pixelClock);
+
+extern void DisableRamdacOutput(volatile STG4000REG * pSTGReg);
+extern void EnableRamdacOutput(volatile STG4000REG * pSTGReg);
+
+/*
+ * Timing generator setup
+ */
+extern void DisableVGA(volatile STG4000REG * pSTGReg);
+extern void StopVTG(volatile STG4000REG * pSTGReg);
+extern void StartVTG(volatile STG4000REG * pSTGReg);
+extern void SetupVTG(volatile STG4000REG * pSTGReg,
+		     const struct kyrofb_info * pTiming);
+
+extern u32 ProgramClock(u32 refClock, u32 coreClock, u32 *FOut, u32 *ROut, u32 *POut);
+extern int SetCoreClockPLL(volatile STG4000REG * pSTGReg, struct pci_dev *pDev);
+
+/*
+ * Overlay setup
+ */
+extern void ResetOverlayRegisters(volatile STG4000REG * pSTGReg);
+
+extern int CreateOverlaySurface(volatile STG4000REG * pSTGReg,
+				u32 ulWidth, u32 ulHeight,
+				int bLinear,
+				u32 ulOverlayOffset,
+				u32 * retStride, u32 * retUVStride);
+
+extern int SetOverlayBlendMode(volatile STG4000REG * pSTGReg,
+			       OVRL_BLEND_MODE mode,
+			       u32 ulAlpha, u32 ulColorKey);
+
+extern int SetOverlayViewPort(volatile STG4000REG * pSTGReg,
+			      u32 left, u32 top,
+			      u32 right, u32 bottom);
+
+extern void EnableOverlayPlane(volatile STG4000REG * pSTGReg);
+
+#endif /* _STG4000INTERFACE_H */
diff -Nru a/drivers/video/kyro/STG4000OverlayDevice.c b/drivers/video/kyro/STG4000OverlayDevice.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/video/kyro/STG4000OverlayDevice.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,600 @@
+/*
+ *  linux/drivers/video/kyro/STG4000OverlayDevice.c
+ *
+ *  Copyright (C) 2000 Imagination Technologies Ltd
+ *  Copyright (C) 2002 STMicroelectronics
+ *
+ * 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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/types.h>
+
+#include "STG4000Reg.h"
+
+/* HW Defines */
+
+#define STG4000_NO_SCALING    0x800
+#define STG4000_NO_DECIMATION 0xFFFFFFFF
+
+/* Primary surface */
+#define STG4000_PRIM_NUM_PIX   5
+#define STG4000_PRIM_ALIGN     4
+#define STG4000_PRIM_ADDR_BITS 20
+
+#define STG4000_PRIM_MIN_WIDTH  640
+#define STG4000_PRIM_MAX_WIDTH  1600
+#define STG4000_PRIM_MIN_HEIGHT 480
+#define STG4000_PRIM_MAX_HEIGHT 1200
+
+/* Overlay surface */
+#define STG4000_OVRL_NUM_PIX   4
+#define STG4000_OVRL_ALIGN     2
+#define STG4000_OVRL_ADDR_BITS 20
+#define STG4000_OVRL_NUM_MODES 5
+
+#define STG4000_OVRL_MIN_WIDTH  0
+#define STG4000_OVRL_MAX_WIDTH  720
+#define STG4000_OVRL_MIN_HEIGHT 0
+#define STG4000_OVRL_MAX_HEIGHT 576
+
+/* Decimation and Scaling */
+u32 adwDecim8[33] = {
+	0xffffffff, 0xfffeffff, 0xffdffbff, 0xfefefeff, 0xfdf7efbf,
+	    0xfbdf7bdf, 0xf7bbddef, 0xeeeeeeef, 0xeeddbb77, 0xedb76db7,
+	    0xdb6db6db, 0xdb5b5b5b, 0xdab5ad6b, 0xd5ab55ab, 0xd555aaab,
+	    0xaaaaaaab, 0xaaaa5555, 0xaa952a55, 0xa94a5295, 0xa5252525,
+	    0xa4924925, 0x92491249, 0x91224489, 0x91111111, 0x90884211,
+	    0x88410821, 0x88102041, 0x81010101, 0x80800801, 0x80010001,
+	    0x80000001, 0x00000001, 0x00000000
+};
+
+typedef struct _OVRL_SRC_DEST {
+	/*clipped on-screen pixel position of overlay */
+	u32 ulDstX1;
+	u32 ulDstY1;
+	u32 ulDstX2;
+	u32 ulDstY2;
+
+	/*clipped pixel pos of source data within buffer thses need to be 128 bit word aligned */
+	u32 ulSrcX1;
+	u32 ulSrcY1;
+	u32 ulSrcX2;
+	u32 ulSrcY2;
+
+	/* on-screen pixel position of overlay */
+	s32 lDstX1;
+	s32 lDstY1;
+	s32 lDstX2;
+	s32 lDstY2;
+} OVRL_SRC_DEST;
+
+static u32 ovlWidth, ovlHeight, ovlStride;
+static int ovlLinear;
+
+void ResetOverlayRegisters(volatile STG4000REG * pSTGReg)
+{
+	u32 tmp;
+
+	/* Set Overlay address to default */
+	tmp = STG_READ_REG(DACOverlayAddr);
+	CLEAR_BITS_FRM_TO(0, 20);
+	CLEAR_BIT(31);
+	STG_WRITE_REG(DACOverlayAddr, tmp);
+
+	/* Set Overlay U address */
+	tmp = STG_READ_REG(DACOverlayUAddr);
+	CLEAR_BITS_FRM_TO(0, 20);
+	STG_WRITE_REG(DACOverlayUAddr, tmp);
+
+	/* Set Overlay V address */
+	tmp = STG_READ_REG(DACOverlayVAddr);
+	CLEAR_BITS_FRM_TO(0, 20);
+	STG_WRITE_REG(DACOverlayVAddr, tmp);
+
+	/* Set Overlay Size */
+	tmp = STG_READ_REG(DACOverlaySize);
+	CLEAR_BITS_FRM_TO(0, 10);
+	CLEAR_BITS_FRM_TO(12, 31);
+	STG_WRITE_REG(DACOverlaySize, tmp);
+
+	/* Set Overlay Vt Decimation */
+	tmp = STG4000_NO_DECIMATION;
+	STG_WRITE_REG(DACOverlayVtDec, tmp);
+
+	/* Set Overlay format to default value */
+	tmp = STG_READ_REG(DACPixelFormat);
+	CLEAR_BITS_FRM_TO(4, 7);
+	CLEAR_BITS_FRM_TO(16, 22);
+	STG_WRITE_REG(DACPixelFormat, tmp);
+
+	/* Set Vertical scaling to default */
+	tmp = STG_READ_REG(DACVerticalScal);
+	CLEAR_BITS_FRM_TO(0, 11);
+	CLEAR_BITS_FRM_TO(16, 22);
+	tmp |= STG4000_NO_SCALING;	/* Set to no scaling */
+	STG_WRITE_REG(DACVerticalScal, tmp);
+
+	/* Set Horizontal Scaling to default */
+	tmp = STG_READ_REG(DACHorizontalScal);
+	CLEAR_BITS_FRM_TO(0, 11);
+	CLEAR_BITS_FRM_TO(16, 17);
+	tmp |= STG4000_NO_SCALING;	/* Set to no scaling */
+	STG_WRITE_REG(DACHorizontalScal, tmp);
+
+	/* Set Blend mode to Alpha Blend */
+	/* ????? SG 08/11/2001 Surely this isn't the alpha blend mode,
+	   hopefully its overwrite
+	 */
+	tmp = STG_READ_REG(DACBlendCtrl);
+	CLEAR_BITS_FRM_TO(0, 30);
+	tmp = (GRAPHICS_MODE << 28);
+	STG_WRITE_REG(DACBlendCtrl, tmp);
+
+}
+
+int CreateOverlaySurface(volatile STG4000REG * pSTGReg,
+			 u32 inWidth,
+			 u32 inHeight,
+			 int bLinear,
+			 u32 ulOverlayOffset,
+			 u32 * retStride, u32 * retUVStride)
+{
+	u32 tmp;
+	u32 ulStride;
+
+	if (inWidth > STG4000_OVRL_MAX_WIDTH ||
+	    inHeight > STG4000_OVRL_MAX_HEIGHT) {
+		return -EINVAL;
+	}
+
+	/* Stride in 16 byte words - 16Bpp */
+	if (bLinear) {
+		/* Format is 16bits so num 16 byte words is width/8 */
+		if ((inWidth & 0x7) == 0) {	/* inWidth % 8 */
+			ulStride = (inWidth / 8);
+		} else {
+			/* Round up to next 16byte boundary */
+			ulStride = ((inWidth + 8) / 8);
+		}
+	} else {
+		/* Y component is 8bits so num 16 byte words is width/16 */
+		if ((inWidth & 0xf) == 0) {	/* inWidth % 16 */
+			ulStride = (inWidth / 16);
+		} else {
+			/* Round up to next 16byte boundary */
+			ulStride = ((inWidth + 16) / 16);
+		}
+	}
+
+
+	/* Set Overlay address and Format mode */
+	tmp = STG_READ_REG(DACOverlayAddr);
+	CLEAR_BITS_FRM_TO(0, 20);
+	if (bLinear) {
+		CLEAR_BIT(31);	/* Overlay format to Linear */
+	} else {
+		tmp |= SET_BIT(31);	/* Overlay format to Planer */
+	}
+
+	/* Only bits 24:4 of the Overlay address */
+	tmp |= (ulOverlayOffset >> 4);
+	STG_WRITE_REG(DACOverlayAddr, tmp);
+
+	if (!bLinear) {
+		u32 uvSize =
+		    (inWidth & 0x1) ? (inWidth + 1 / 2) : (inWidth / 2);
+		u32 uvStride;
+		u32 ulOffset;
+		/* Y component is 8bits so num 32 byte words is width/32 */
+		if ((uvSize & 0xf) == 0) {	/* inWidth % 16 */
+			uvStride = (uvSize / 16);
+		} else {
+			/* Round up to next 32byte boundary */
+			uvStride = ((uvSize + 16) / 16);
+		}
+
+		ulOffset = ulOverlayOffset + (inHeight * (ulStride * 16));
+		/* Align U,V data to 32byte boundary */
+		if ((ulOffset & 0x1f) != 0)
+			ulOffset = (ulOffset + 32L) & 0xffffffE0L;
+
+		tmp = STG_READ_REG(DACOverlayUAddr);
+		CLEAR_BITS_FRM_TO(0, 20);
+		tmp |= (ulOffset >> 4);
+		STG_WRITE_REG(DACOverlayUAddr, tmp);
+
+		ulOffset += (inHeight / 2) * (uvStride * 16);
+		/* Align U,V data to 32byte boundary */
+		if ((ulOffset & 0x1f) != 0)
+			ulOffset = (ulOffset + 32L) & 0xffffffE0L;
+
+		tmp = STG_READ_REG(DACOverlayVAddr);
+		CLEAR_BITS_FRM_TO(0, 20);
+		tmp |= (ulOffset >> 4);
+		STG_WRITE_REG(DACOverlayVAddr, tmp);
+
+		*retUVStride = uvStride * 16;
+	}
+
+
+	/* Set Overlay YUV pixel format
+	 * Make sure that LUT not used - ??????
+	 */
+	tmp = STG_READ_REG(DACPixelFormat);
+	/* Only support Planer or UYVY linear formats */
+	CLEAR_BITS_FRM_TO(4, 9);
+	STG_WRITE_REG(DACPixelFormat, tmp);
+
+	ovlWidth = inWidth;
+	ovlHeight = inHeight;
+	ovlStride = ulStride;
+	ovlLinear = bLinear;
+	*retStride = ulStride << 4;	/* In bytes */
+
+	return 0;
+}
+
+int SetOverlayBlendMode(volatile STG4000REG * pSTGReg,
+			OVRL_BLEND_MODE mode,
+			u32 ulAlpha, u32 ulColorKey)
+{
+	u32 tmp;
+
+	tmp = STG_READ_REG(DACBlendCtrl);
+	CLEAR_BITS_FRM_TO(28, 30);
+	tmp |= (mode << 28);
+
+	switch (mode) {
+	case COLOR_KEY:
+		CLEAR_BITS_FRM_TO(0, 23);
+		tmp |= (ulColorKey & 0x00FFFFFF);
+		break;
+
+	case GLOBAL_ALPHA:
+		CLEAR_BITS_FRM_TO(24, 27);
+		tmp |= ((ulAlpha & 0xF) << 24);
+		break;
+
+	case CK_PIXEL_ALPHA:
+		CLEAR_BITS_FRM_TO(0, 23);
+		tmp |= (ulColorKey & 0x00FFFFFF);
+		break;
+
+	case CK_GLOBAL_ALPHA:
+		CLEAR_BITS_FRM_TO(0, 23);
+		tmp |= (ulColorKey & 0x00FFFFFF);
+		CLEAR_BITS_FRM_TO(24, 27);
+		tmp |= ((ulAlpha & 0xF) << 24);
+		break;
+
+	case GRAPHICS_MODE:
+	case PER_PIXEL_ALPHA:
+		break;
+
+	default:
+		return -EINVAL;
+	}
+
+	STG_WRITE_REG(DACBlendCtrl, tmp);
+
+	return 0;
+}
+
+void EnableOverlayPlane(volatile STG4000REG * pSTGReg)
+{
+	u32 tmp;
+	/* Enable Overlay */
+	tmp = STG_READ_REG(DACPixelFormat);
+	tmp |= SET_BIT(7);
+	STG_WRITE_REG(DACPixelFormat, tmp);
+
+	/* Set video stream control */
+	tmp = STG_READ_REG(DACStreamCtrl);
+	tmp |= SET_BIT(1);	/* video stream */
+	STG_WRITE_REG(DACStreamCtrl, tmp);
+}
+
+static u32 Overlap(u32 ulBits, u32 ulPattern)
+{
+	u32 ulCount = 0;
+
+	while (ulBits) {
+		if (!(ulPattern & 1))
+			ulCount++;
+		ulBits--;
+		ulPattern = ulPattern >> 1;
+	}
+
+	return ulCount;
+
+}
+
+int SetOverlayViewPort(volatile STG4000REG * pSTGReg,
+		       u32 left, u32 top,
+		       u32 right, u32 bottom)
+{
+	OVRL_SRC_DEST srcDest;
+
+	u32 ulSrcTop, ulSrcBottom;
+	u32 ulSrc, ulDest;
+	u32 ulFxScale, ulFxOffset;
+	u32 ulHeight, ulWidth;
+	u32 ulPattern;
+	u32 ulDecimate, ulDecimated;
+	u32 ulApplied;
+	u32 ulDacXScale, ulDacYScale;
+	u32 ulScale;
+	u32 ulLeft, ulRight;
+	u32 ulSrcLeft, ulSrcRight;
+	u32 ulScaleLeft, ulScaleRight;
+	u32 ulhDecim;
+	u32 ulsVal;
+	u32 ulVertDecFactor;
+	int bResult;
+	u32 ulClipOff = 0;
+	u32 ulBits = 0;
+	u32 ulsAdd = 0;
+	u32 tmp, ulStride;
+	u32 ulExcessPixels, ulClip, ulExtraLines;
+
+
+	srcDest.ulSrcX1 = 0;
+	srcDest.ulSrcY1 = 0;
+	srcDest.ulSrcX2 = ovlWidth - 1;
+	srcDest.ulSrcY2 = ovlHeight - 1;
+
+	srcDest.ulDstX1 = left;
+	srcDest.ulDstY1 = top;
+	srcDest.ulDstX2 = right;
+	srcDest.ulDstY2 = bottom;
+
+	srcDest.lDstX1 = srcDest.ulDstX1;
+	srcDest.lDstY1 = srcDest.ulDstY1;
+	srcDest.lDstX2 = srcDest.ulDstX2;
+	srcDest.lDstY2 = srcDest.ulDstY2;
+
+    /************* Vertical decimation/scaling ******************/
+
+	/* Get Src Top and Bottom */
+	ulSrcTop = srcDest.ulSrcY1;
+	ulSrcBottom = srcDest.ulSrcY2;
+
+	ulSrc = ulSrcBottom - ulSrcTop;
+	ulDest = srcDest.lDstY2 - srcDest.lDstY1;	/* on-screen overlay */
+
+	if (ulSrc <= 1)
+		return -EINVAL;
+
+	/* First work out the position we are to display as offset from the
+	 * source of the buffer
+	 */
+	ulFxScale = (ulDest << 11) / ulSrc;	/* fixed point scale factor */
+	ulFxOffset = (srcDest.lDstY2 - srcDest.ulDstY2) << 11;
+
+	ulSrcBottom = ulSrcBottom - (ulFxOffset / ulFxScale);
+	ulSrc = ulSrcBottom - ulSrcTop;
+	ulHeight = ulSrc;
+
+	ulDest = srcDest.ulDstY2 - (srcDest.ulDstY1 - 1);
+	ulPattern = adwDecim8[ulBits];
+
+	/* At this point ulSrc represents the input decimator */
+	if (ulSrc > ulDest) {
+		ulDecimate = ulSrc - ulDest;
+		ulBits = 0;
+		ulApplied = ulSrc / 32;
+
+		while (((ulBits * ulApplied) +
+			Overlap((ulSrc % 32),
+				adwDecim8[ulBits])) < ulDecimate)
+			ulBits++;
+
+		ulPattern = adwDecim8[ulBits];
+		ulDecimated =
+		    (ulBits * ulApplied) + Overlap((ulSrc % 32),
+						   ulPattern);
+		ulSrc = ulSrc - ulDecimated;	/* the number number of lines that will go into the scaler */
+	}
+
+	if (ulBits && (ulBits != 32)) {
+		ulVertDecFactor = (63 - ulBits) / (32 - ulBits);	/* vertical decimation factor scaled up to nearest integer */
+	} else {
+		ulVertDecFactor = 1;
+	}
+
+	ulDacYScale = ((ulSrc - 1) * 2048) / (ulDest + 1);
+
+	tmp = STG_READ_REG(DACOverlayVtDec);	/* Decimation */
+	CLEAR_BITS_FRM_TO(0, 31);
+	tmp = ulPattern;
+	STG_WRITE_REG(DACOverlayVtDec, tmp);
+
+	/***************** Horizontal decimation/scaling ***************************/
+
+	/*
+	 * Now we handle the horizontal case, this is a simplified verison of
+	 * the vertical case in that we decimate by factors of 2.  as we are
+	 * working in words we should always be able to decimate by these
+	 * factors.  as we always have to have a buffer which is aligned to a
+	 * whole number of 128 bit words, we must align the left side to the
+	 * lowest to the next lowest 128 bit boundary, and the right hand edge
+	 * to the next largets boundary, (in a similar way to how we didi it in
+	 * PMX1) as the left and right hand edges are aligned to these
+	 * boundaries normally this only becomes an issue when we are chopping
+	 * of one of the sides We shall work out vertical stuff first
+	 */
+	ulSrc = srcDest.ulSrcX2 - srcDest.ulSrcX1;
+	ulDest = srcDest.lDstX2 - srcDest.lDstX1;
+#ifdef _OLDCODE
+	ulLeft = srcDest.ulDstX1;
+	ulRight = srcDest.ulDstX2;
+#else
+	if (srcDest.ulDstX1 > 2) {
+		ulLeft = srcDest.ulDstX1 + 2;
+		ulRight = srcDest.ulDstX2 + 1;
+	} else {
+		ulLeft = srcDest.ulDstX1;
+		ulRight = srcDest.ulDstX2 + 1;
+	}
+#endif
+	/* first work out the position we are to display as offset from the source of the buffer */
+	bResult = 1;
+
+	do {
+		if (ulDest == 0)
+			return -EINVAL;
+
+		/* source pixels per dest pixel <<11 */
+		ulFxScale = ((ulSrc - 1) << 11) / (ulDest);
+
+		/* then number of destination pixels out we are */
+		ulFxOffset = ulFxScale * ((srcDest.ulDstX1 - srcDest.lDstX1) + ulClipOff);
+		ulFxOffset >>= 11;
+
+		/* this replaces the code which was making a decision as to use either ulFxOffset or ulSrcX1 */
+		ulSrcLeft = srcDest.ulSrcX1 + ulFxOffset;
+
+		/* then number of destination pixels out we are */
+		ulFxOffset = ulFxScale * (srcDest.lDstX2 - srcDest.ulDstX2);
+		ulFxOffset >>= 11;
+
+		ulSrcRight = srcDest.ulSrcX2 - ulFxOffset;
+
+		/*
+		 * we must align these to our 128 bit boundaries. we shall
+		 * round down the pixel pos to the nearest 8 pixels.
+		 */
+		ulScaleLeft = ulSrcLeft;
+		ulScaleRight = ulSrcRight;
+
+		/* shift fxscale until it is in the range of the scaler */
+		ulhDecim = 0;
+		ulScale = (((ulSrcRight - ulSrcLeft) - 1) << (11 - ulhDecim)) / (ulRight - ulLeft + 2);
+
+		while (ulScale > 0x800) {
+			ulhDecim++;
+			ulScale = (((ulSrcRight - ulSrcLeft) - 1) << (11 - ulhDecim)) / (ulRight - ulLeft + 2);
+		}
+
+		/*
+		 * to try and get the best values We first try and use
+		 * src/dwdest for the scale factor, then we move onto src-1
+		 *
+		 * we want to check to see if we will need to clip data, if so
+		 * then we should clip our source so that we don't need to
+		 */
+		if (!ovlLinear) {
+			ulSrcLeft &= ~0x1f;
+
+			/*
+			 * we must align the right hand edge to the next 32
+			 * pixel` boundary, must be on a 256 boundary so u, and
+			 * v are 128 bit aligned
+			 */
+			ulSrcRight = (ulSrcRight + 0x1f) & ~0x1f;
+		} else {
+			ulSrcLeft &= ~0x7;
+
+			/*
+			 * we must align the right hand edge to the next
+			 * 8pixel` boundary
+			 */
+			ulSrcRight = (ulSrcRight + 0x7) & ~0x7;
+		}
+
+		/* this is the input size line store needs to cope with */
+		ulWidth = ulSrcRight - ulSrcLeft;
+
+		/*
+		 * use unclipped value to work out scale factror this is the
+		 * scale factor we want we shall now work out the horizonal
+		 * decimation and scaling
+		 */
+		ulsVal = ((ulWidth / 8) >> ulhDecim);
+
+		if ((ulWidth != (ulsVal << ulhDecim) * 8))
+			ulsAdd = 1;
+
+		/* input pixels to scaler; */
+		ulSrc = ulWidth >> ulhDecim;
+
+		if (ulSrc <= 2)
+			return -EINVAL;
+
+		ulExcessPixels = ((((ulScaleLeft - ulSrcLeft)) << (11 - ulhDecim)) / ulScale);
+
+		ulClip = (ulSrc << 11) / ulScale;
+		ulClip -= (ulRight - ulLeft);
+		ulClip += ulExcessPixels;
+
+		if (ulClip)
+			ulClip--;
+
+		/* We may need to do more here if we really have a HW rev < 5 */
+	} while (!bResult);
+
+	ulExtraLines = (1 << ulhDecim) * ulVertDecFactor;
+	ulExtraLines += 64;
+	ulHeight += ulExtraLines;
+
+	ulDacXScale = ulScale;
+
+
+	tmp = STG_READ_REG(DACVerticalScal);
+	CLEAR_BITS_FRM_TO(0, 11);
+	CLEAR_BITS_FRM_TO(16, 22);	/* Vertical Scaling */
+
+	/* Calculate new output line stride, this is always the number of 422
+	   words in the line buffer, so it doesn't matter if the
+	   mode is 420. Then set the vertical scale register.
+	 */
+	ulStride = (ulWidth >> (ulhDecim + 3)) + ulsAdd;
+	tmp |= ((ulStride << 16) | (ulDacYScale));	/* DAC_LS_CTRL = stride */
+	STG_WRITE_REG(DACVerticalScal, tmp);
+
+	/* Now set up the overlay size using the modified width and height
+	   from decimate and scaling calculations
+	 */
+	tmp = STG_READ_REG(DACOverlaySize);
+	CLEAR_BITS_FRM_TO(0, 10);
+	CLEAR_BITS_FRM_TO(12, 31);
+
+	if (ovlLinear) {
+		tmp |=
+		    (ovlStride | ((ulHeight + 1) << 12) |
+		     (((ulWidth / 8) - 1) << 23));
+	} else {
+		tmp |=
+		    (ovlStride | ((ulHeight + 1) << 12) |
+		     (((ulWidth / 32) - 1) << 23));
+	}
+
+	STG_WRITE_REG(DACOverlaySize, tmp);
+
+	/* Set Video Window Start */
+	tmp = ((ulLeft << 16)) | (srcDest.ulDstY1);
+	STG_WRITE_REG(DACVidWinStart, tmp);
+
+	/* Set Video Window End */
+	tmp = ((ulRight) << 16) | (srcDest.ulDstY2);
+	STG_WRITE_REG(DACVidWinEnd, tmp);
+
+	/* Finally set up the rest of the overlay regs in the order
+	   done in the IMG driver
+	 */
+	tmp = STG_READ_REG(DACPixelFormat);
+	tmp = ((ulExcessPixels << 16) | tmp) & 0x7fffffff;
+	STG_WRITE_REG(DACPixelFormat, tmp);
+
+	tmp = STG_READ_REG(DACHorizontalScal);
+	CLEAR_BITS_FRM_TO(0, 11);
+	CLEAR_BITS_FRM_TO(16, 17);
+	tmp |= ((ulhDecim << 16) | (ulDacXScale));
+	STG_WRITE_REG(DACHorizontalScal, tmp);
+
+	return 0;
+}
diff -Nru a/drivers/video/kyro/STG4000Ramdac.c b/drivers/video/kyro/STG4000Ramdac.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/video/kyro/STG4000Ramdac.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,164 @@
+/*
+ *  linux/drivers/video/kyro/STG4000Ramdac.c
+ *
+ *  Copyright (C) 2002 STMicroelectronics
+ *
+ * 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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/types.h>
+#include <video/kyro.h>
+
+#include "STG4000Reg.h"
+#include "STG4000Interface.h"
+
+static u32 STG_PIXEL_BUS_WIDTH = 128;	/* 128 bit bus width      */
+static u32 REF_CLOCK = 14318;
+STG4000REG *pSTGReg;
+
+int InitialiseRamdac(volatile STG4000REG * pSTGReg,
+		     u32 displayDepth,
+		     u32 displayWidth,
+		     u32 displayHeight,
+		     s32 HSyncPolarity,
+		     s32 VSyncPolarity, u32 * pixelClock)
+{
+	u32 tmp = 0;
+	u32 F = 0, R = 0, P = 0;
+	u32 stride = 0;
+	u32 ulPdiv = 0;
+	u32 physicalPixelDepth = 0;
+	/* Make sure DAC is in Reset */
+	tmp = STG_READ_REG(SoftwareReset);
+
+	if (tmp & 0x1) {
+		CLEAR_BIT(1);
+		STG_WRITE_REG(SoftwareReset, tmp);
+	}
+
+	/* Set Pixel Format */
+	tmp = STG_READ_REG(DACPixelFormat);
+	CLEAR_BITS_FRM_TO(0, 2);
+
+	/* Set LUT not used from 16bpp to 32 bpp ??? */
+	CLEAR_BITS_FRM_TO(8, 9);
+
+	switch (displayDepth) {
+	case 16:
+		{
+			physicalPixelDepth = 16;
+			tmp |= _16BPP;
+			break;
+		}
+	case 32:
+		{
+			/* Set for 32 bits per pixel */
+			physicalPixelDepth = 32;
+			tmp |= _32BPP;
+			break;
+		}
+	default:
+		return -EINVAL;
+	}
+
+	STG_WRITE_REG(DACPixelFormat, tmp);
+
+	/* Workout Bus transfer bandwidth according to pixel format */
+	ulPdiv = STG_PIXEL_BUS_WIDTH / physicalPixelDepth;
+
+	/* Get Screen Stride in pixels */
+	stride = displayWidth;
+
+	/* Set Primary size info */
+	tmp = STG_READ_REG(DACPrimSize);
+	CLEAR_BITS_FRM_TO(0, 10);
+	CLEAR_BITS_FRM_TO(12, 31);
+	tmp |=
+	    ((((displayHeight - 1) << 12) | (((displayWidth / ulPdiv) -
+					      1) << 23))
+	     | (stride / ulPdiv));
+	STG_WRITE_REG(DACPrimSize, tmp);
+
+
+	/* Set Pixel Clock */
+	*pixelClock = ProgramClock(REF_CLOCK, *pixelClock, &F, &R, &P);
+
+	/* Set DAC PLL Mode */
+	tmp = STG_READ_REG(DACPLLMode);
+	CLEAR_BITS_FRM_TO(0, 15);
+	/* tmp |= ((P-1) | ((F-2) << 2) | ((R-2) << 11)); */
+	tmp |= ((P) | ((F - 2) << 2) | ((R - 2) << 11));
+	STG_WRITE_REG(DACPLLMode, tmp);
+
+	/* Set Prim Address */
+	tmp = STG_READ_REG(DACPrimAddress);
+	CLEAR_BITS_FRM_TO(0, 20);
+	CLEAR_BITS_FRM_TO(20, 31);
+	STG_WRITE_REG(DACPrimAddress, tmp);
+
+	/* Set Cursor details with HW Cursor disabled */
+	tmp = STG_READ_REG(DACCursorCtrl);
+	tmp &= ~SET_BIT(31);
+	STG_WRITE_REG(DACCursorCtrl, tmp);
+
+	tmp = STG_READ_REG(DACCursorAddr);
+	CLEAR_BITS_FRM_TO(0, 20);
+	STG_WRITE_REG(DACCursorAddr, tmp);
+
+	/* Set Video Window */
+	tmp = STG_READ_REG(DACVidWinStart);
+	CLEAR_BITS_FRM_TO(0, 10);
+	CLEAR_BITS_FRM_TO(16, 26);
+	STG_WRITE_REG(DACVidWinStart, tmp);
+
+	tmp = STG_READ_REG(DACVidWinEnd);
+	CLEAR_BITS_FRM_TO(0, 10);
+	CLEAR_BITS_FRM_TO(16, 26);
+	STG_WRITE_REG(DACVidWinEnd, tmp);
+
+	/* Set DAC Border Color to default */
+	tmp = STG_READ_REG(DACBorderColor);
+	CLEAR_BITS_FRM_TO(0, 23);
+	STG_WRITE_REG(DACBorderColor, tmp);
+
+	/* Set Graphics and Overlay Burst Control */
+	STG_WRITE_REG(DACBurstCtrl, 0x0404);
+
+	/* Set CRC Trigger to default */
+	tmp = STG_READ_REG(DACCrcTrigger);
+	CLEAR_BIT(0);
+	STG_WRITE_REG(DACCrcTrigger, tmp);
+
+	/* Set Video Port Control to default */
+	tmp = STG_READ_REG(DigVidPortCtrl);
+	CLEAR_BIT(8);
+	CLEAR_BITS_FRM_TO(16, 27);
+	CLEAR_BITS_FRM_TO(1, 3);
+	CLEAR_BITS_FRM_TO(10, 11);
+	STG_WRITE_REG(DigVidPortCtrl, tmp);
+
+	return 0;
+}
+
+/* Ramdac control, turning output to the screen on and off */
+void DisableRamdacOutput(volatile STG4000REG * pSTGReg)
+{
+	u32 tmp;
+
+	/* Disable DAC for Graphics Stream Control */
+	tmp = (STG_READ_REG(DACStreamCtrl)) & ~SET_BIT(0);
+	STG_WRITE_REG(DACStreamCtrl, tmp);
+}
+
+void EnableRamdacOutput(volatile STG4000REG * pSTGReg)
+{
+	u32 tmp;
+
+	/* Enable DAC for Graphics Stream Control */
+	tmp = (STG_READ_REG(DACStreamCtrl)) | SET_BIT(0);
+	STG_WRITE_REG(DACStreamCtrl, tmp);
+}
diff -Nru a/drivers/video/kyro/STG4000Reg.h b/drivers/video/kyro/STG4000Reg.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/video/kyro/STG4000Reg.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,283 @@
+/*
+ *  linux/drivers/video/kyro/STG4000Reg.h
+ *
+ *  Copyright (C) 2002 STMicroelectronics
+ *
+ * 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.
+ */
+
+#ifndef _STG4000REG_H
+#define _STG4000REG_H
+
+#define DWFILL unsigned long :32
+#define WFILL unsigned short :16
+
+/*
+ * Macros that access memory mapped card registers in PCI space
+ * Add an appropraite section for your OS or processor architecture.
+ */
+#if defined(__KERNEL__)
+#include <asm/page.h>
+#include <asm/io.h>
+#define STG_WRITE_REG(reg,data) (writel(data,(unsigned long)&pSTGReg->reg))
+#define STG_READ_REG(reg)      (readl((unsigned long)&pSTGReg->reg))
+#else
+#define STG_WRITE_REG(reg,data) (pSTGReg->reg = data)
+#define STG_READ_REG(reg)      (pSTGReg->reg)
+#endif /* __KERNEL__ */
+
+#define SET_BIT(n) (1<<(n))
+#define CLEAR_BIT(n) (tmp &= ~(1<<n))
+#define CLEAR_BITS_FRM_TO(frm, to) \
+{\
+int i; \
+    for(i = frm; i<= to; i++) \
+	{ \
+	    tmp &= ~(1<<i); \
+	} \
+}
+
+#define CLEAR_BIT_2(n) (usTemp &= ~(1<<n))
+#define CLEAR_BITS_FRM_TO_2(frm, to) \
+{\
+int i; \
+    for(i = frm; i<= to; i++) \
+	{ \
+	    usTemp &= ~(1<<i); \
+	} \
+}
+
+/* LUT select */
+typedef enum _LUT_USES {
+	NO_LUT = 0, RESERVED, GRAPHICS, OVERLAY
+} LUT_USES;
+
+/* Primary surface pixel format select */
+typedef enum _PIXEL_FORMAT {
+	_8BPP = 0, _15BPP, _16BPP, _24BPP, _32BPP
+} PIXEL_FORMAT;
+
+/* Overlay blending mode select */
+typedef enum _BLEND_MODE {
+	GRAPHICS_MODE = 0, COLOR_KEY, PER_PIXEL_ALPHA, GLOBAL_ALPHA,
+	CK_PIXEL_ALPHA, CK_GLOBAL_ALPHA
+} OVRL_BLEND_MODE;
+
+/* Overlay Pixel format select */
+typedef enum _OVRL_PIX_FORMAT {
+	UYVY, VYUY, YUYV, YVYU
+} OVRL_PIX_FORMAT;
+
+/* Register Table */
+typedef struct {
+	/* 0h  */
+	volatile unsigned long Thread0Enable;	/* 0x0000 */
+	volatile unsigned long Thread1Enable;	/* 0x0004 */
+	volatile unsigned long Thread0Recover;	/* 0x0008 */
+	volatile unsigned long Thread1Recover;	/* 0x000C */
+	volatile unsigned long Thread0Step;	/* 0x0010 */
+	volatile unsigned long Thread1Step;	/* 0x0014 */
+	volatile unsigned long VideoInStatus;	/* 0x0018 */
+	volatile unsigned long Core2InSignStart;	/* 0x001C */
+	volatile unsigned long Core1ResetVector;	/* 0x0020 */
+	volatile unsigned long Core1ROMOffset;	/* 0x0024 */
+	volatile unsigned long Core1ArbiterPriority;	/* 0x0028 */
+	volatile unsigned long VideoInControl;	/* 0x002C */
+	volatile unsigned long VideoInReg0CtrlA;	/* 0x0030 */
+	volatile unsigned long VideoInReg0CtrlB;	/* 0x0034 */
+	volatile unsigned long VideoInReg1CtrlA;	/* 0x0038 */
+	volatile unsigned long VideoInReg1CtrlB;	/* 0x003C */
+	volatile unsigned long Thread0Kicker;	/* 0x0040 */
+	volatile unsigned long Core2InputSign;	/* 0x0044 */
+	volatile unsigned long Thread0ProgCtr;	/* 0x0048 */
+	volatile unsigned long Thread1ProgCtr;	/* 0x004C */
+	volatile unsigned long Thread1Kicker;	/* 0x0050 */
+	volatile unsigned long GPRegister1;	/* 0x0054 */
+	volatile unsigned long GPRegister2;	/* 0x0058 */
+	volatile unsigned long GPRegister3;	/* 0x005C */
+	volatile unsigned long GPRegister4;	/* 0x0060 */
+	volatile unsigned long SerialIntA;	/* 0x0064 */
+
+	volatile unsigned long Fill0[6];	/* GAP 0x0068 - 0x007C */
+
+	volatile unsigned long SoftwareReset;	/* 0x0080 */
+	volatile unsigned long SerialIntB;	/* 0x0084 */
+
+	volatile unsigned long Fill1[37];	/* GAP 0x0088 - 0x011C */
+
+	volatile unsigned long ROMELQV;	/* 0x011C */
+	volatile unsigned long WLWH;	/* 0x0120 */
+	volatile unsigned long ROMELWL;	/* 0x0124 */
+
+	volatile unsigned long dwFill_1;	/* GAP 0x0128 */
+
+	volatile unsigned long IntStatus;	/* 0x012C */
+	volatile unsigned long IntMask;	/* 0x0130 */
+	volatile unsigned long IntClear;	/* 0x0134 */
+
+	volatile unsigned long Fill2[6];	/* GAP 0x0138 - 0x014C */
+
+	volatile unsigned long ROMGPIOA;	/* 0x0150 */
+	volatile unsigned long ROMGPIOB;	/* 0x0154 */
+	volatile unsigned long ROMGPIOC;	/* 0x0158 */
+	volatile unsigned long ROMGPIOD;	/* 0x015C */
+
+	volatile unsigned long Fill3[2];	/* GAP 0x0160 - 0x0168 */
+
+	volatile unsigned long AGPIntID;	/* 0x0168 */
+	volatile unsigned long AGPIntClassCode;	/* 0x016C */
+	volatile unsigned long AGPIntBIST;	/* 0x0170 */
+	volatile unsigned long AGPIntSSID;	/* 0x0174 */
+	volatile unsigned long AGPIntPMCSR;	/* 0x0178 */
+	volatile unsigned long VGAFrameBufBase;	/* 0x017C */
+	volatile unsigned long VGANotify;	/* 0x0180 */
+	volatile unsigned long DACPLLMode;	/* 0x0184 */
+	volatile unsigned long Core1VideoClockDiv;	/* 0x0188 */
+	volatile unsigned long AGPIntStat;	/* 0x018C */
+
+	/*
+	   volatile unsigned long Fill4[0x0400/4 - 0x0190/4]; //GAP 0x0190 - 0x0400
+	   volatile unsigned long Fill5[0x05FC/4 - 0x0400/4]; //GAP 0x0400 - 0x05FC Fog Table
+	   volatile unsigned long Fill6[0x0604/4 - 0x0600/4]; //GAP 0x0600 - 0x0604
+	   volatile unsigned long Fill7[0x0680/4 - 0x0608/4]; //GAP 0x0608 - 0x0680
+	   volatile unsigned long Fill8[0x07FC/4 - 0x0684/4]; //GAP 0x0684 - 0x07FC
+	 */
+	volatile unsigned long Fill4[412];	/* 0x0190 - 0x07FC */
+
+	volatile unsigned long TACtrlStreamBase;	/* 0x0800 */
+	volatile unsigned long TAObjDataBase;	/* 0x0804 */
+	volatile unsigned long TAPtrDataBase;	/* 0x0808 */
+	volatile unsigned long TARegionDataBase;	/* 0x080C */
+	volatile unsigned long TATailPtrBase;	/* 0x0810 */
+	volatile unsigned long TAPtrRegionSize;	/* 0x0814 */
+	volatile unsigned long TAConfiguration;	/* 0x0818 */
+	volatile unsigned long TAObjDataStartAddr;	/* 0x081C */
+	volatile unsigned long TAObjDataEndAddr;	/* 0x0820 */
+	volatile unsigned long TAXScreenClip;	/* 0x0824 */
+	volatile unsigned long TAYScreenClip;	/* 0x0828 */
+	volatile unsigned long TARHWClamp;	/* 0x082C */
+	volatile unsigned long TARHWCompare;	/* 0x0830 */
+	volatile unsigned long TAStart;	/* 0x0834 */
+	volatile unsigned long TAObjReStart;	/* 0x0838 */
+	volatile unsigned long TAPtrReStart;	/* 0x083C */
+	volatile unsigned long TAStatus1;	/* 0x0840 */
+	volatile unsigned long TAStatus2;	/* 0x0844 */
+	volatile unsigned long TAIntStatus;	/* 0x0848 */
+	volatile unsigned long TAIntMask;	/* 0x084C */
+
+	volatile unsigned long Fill5[235];	/* GAP 0x0850 - 0x0BF8 */
+
+	volatile unsigned long TextureAddrThresh;	/* 0x0BFC */
+	volatile unsigned long Core1Translation;	/* 0x0C00 */
+	volatile unsigned long TextureAddrReMap;	/* 0x0C04 */
+	volatile unsigned long RenderOutAGPRemap;	/* 0x0C08 */
+	volatile unsigned long _3DRegionReadTrans;	/* 0x0C0C */
+	volatile unsigned long _3DPtrReadTrans;	/* 0x0C10 */
+	volatile unsigned long _3DParamReadTrans;	/* 0x0C14 */
+	volatile unsigned long _3DRegionReadThresh;	/* 0x0C18 */
+	volatile unsigned long _3DPtrReadThresh;	/* 0x0C1C */
+	volatile unsigned long _3DParamReadThresh;	/* 0x0C20 */
+	volatile unsigned long _3DRegionReadAGPRemap;	/* 0x0C24 */
+	volatile unsigned long _3DPtrReadAGPRemap;	/* 0x0C28 */
+	volatile unsigned long _3DParamReadAGPRemap;	/* 0x0C2C */
+	volatile unsigned long ZBufferAGPRemap;	/* 0x0C30 */
+	volatile unsigned long TAIndexAGPRemap;	/* 0x0C34 */
+	volatile unsigned long TAVertexAGPRemap;	/* 0x0C38 */
+	volatile unsigned long TAUVAddrTrans;	/* 0x0C3C */
+	volatile unsigned long TATailPtrCacheTrans;	/* 0x0C40 */
+	volatile unsigned long TAParamWriteTrans;	/* 0x0C44 */
+	volatile unsigned long TAPtrWriteTrans;	/* 0x0C48 */
+	volatile unsigned long TAParamWriteThresh;	/* 0x0C4C */
+	volatile unsigned long TAPtrWriteThresh;	/* 0x0C50 */
+	volatile unsigned long TATailPtrCacheAGPRe;	/* 0x0C54 */
+	volatile unsigned long TAParamWriteAGPRe;	/* 0x0C58 */
+	volatile unsigned long TAPtrWriteAGPRe;	/* 0x0C5C */
+	volatile unsigned long SDRAMArbiterConf;	/* 0x0C60 */
+	volatile unsigned long SDRAMConf0;	/* 0x0C64 */
+	volatile unsigned long SDRAMConf1;	/* 0x0C68 */
+	volatile unsigned long SDRAMConf2;	/* 0x0C6C */
+	volatile unsigned long SDRAMRefresh;	/* 0x0C70 */
+	volatile unsigned long SDRAMPowerStat;	/* 0x0C74 */
+
+	volatile unsigned long Fill6[2];	/* GAP 0x0C78 - 0x0C7C */
+
+	volatile unsigned long RAMBistData;	/* 0x0C80 */
+	volatile unsigned long RAMBistCtrl;	/* 0x0C84 */
+	volatile unsigned long FIFOBistKey;	/* 0x0C88 */
+	volatile unsigned long RAMBistResult;	/* 0x0C8C */
+	volatile unsigned long FIFOBistResult;	/* 0x0C90 */
+
+	/*
+	   volatile unsigned long Fill11[0x0CBC/4 - 0x0C94/4]; //GAP 0x0C94 - 0x0CBC
+	   volatile unsigned long Fill12[0x0CD0/4 - 0x0CC0/4]; //GAP 0x0CC0 - 0x0CD0 3DRegisters
+	 */
+
+	volatile unsigned long Fill7[16];	/* 0x0c94 - 0x0cd0 */
+
+	volatile unsigned long SDRAMAddrSign;	/* 0x0CD4 */
+	volatile unsigned long SDRAMDataSign;	/* 0x0CD8 */
+	volatile unsigned long SDRAMSignConf;	/* 0x0CDC */
+
+	/* DWFILL; //GAP 0x0CE0 */
+	volatile unsigned long dwFill_2;
+
+	volatile unsigned long ISPSignature;	/* 0x0CE4 */
+
+	volatile unsigned long Fill8[454];	/*GAP 0x0CE8 - 0x13FC */
+
+	volatile unsigned long DACPrimAddress;	/* 0x1400 */
+	volatile unsigned long DACPrimSize;	/* 0x1404 */
+	volatile unsigned long DACCursorAddr;	/* 0x1408 */
+	volatile unsigned long DACCursorCtrl;	/* 0x140C */
+	volatile unsigned long DACOverlayAddr;	/* 0x1410 */
+	volatile unsigned long DACOverlayUAddr;	/* 0x1414 */
+	volatile unsigned long DACOverlayVAddr;	/* 0x1418 */
+	volatile unsigned long DACOverlaySize;	/* 0x141C */
+	volatile unsigned long DACOverlayVtDec;	/* 0x1420 */
+
+	volatile unsigned long Fill9[9];	/* GAP 0x1424 - 0x1444 */
+
+	volatile unsigned long DACVerticalScal;	/* 0x1448 */
+	volatile unsigned long DACPixelFormat;	/* 0x144C */
+	volatile unsigned long DACHorizontalScal;	/* 0x1450 */
+	volatile unsigned long DACVidWinStart;	/* 0x1454 */
+	volatile unsigned long DACVidWinEnd;	/* 0x1458 */
+	volatile unsigned long DACBlendCtrl;	/* 0x145C */
+	volatile unsigned long DACHorTim1;	/* 0x1460 */
+	volatile unsigned long DACHorTim2;	/* 0x1464 */
+	volatile unsigned long DACHorTim3;	/* 0x1468 */
+	volatile unsigned long DACVerTim1;	/* 0x146C */
+	volatile unsigned long DACVerTim2;	/* 0x1470 */
+	volatile unsigned long DACVerTim3;	/* 0x1474 */
+	volatile unsigned long DACBorderColor;	/* 0x1478 */
+	volatile unsigned long DACSyncCtrl;	/* 0x147C */
+	volatile unsigned long DACStreamCtrl;	/* 0x1480 */
+	volatile unsigned long DACLUTAddress;	/* 0x1484 */
+	volatile unsigned long DACLUTData;	/* 0x1488 */
+	volatile unsigned long DACBurstCtrl;	/* 0x148C */
+	volatile unsigned long DACCrcTrigger;	/* 0x1490 */
+	volatile unsigned long DACCrcDone;	/* 0x1494 */
+	volatile unsigned long DACCrcResult1;	/* 0x1498 */
+	volatile unsigned long DACCrcResult2;	/* 0x149C */
+	volatile unsigned long DACLinecount;	/* 0x14A0 */
+
+	volatile unsigned long Fill10[151];	/*GAP 0x14A4 - 0x16FC */
+
+	volatile unsigned long DigVidPortCtrl;	/* 0x1700 */
+	volatile unsigned long DigVidPortStat;	/* 0x1704 */
+
+	/*
+	   volatile unsigned long Fill11[0x1FFC/4 - 0x1708/4]; //GAP 0x1708 - 0x1FFC
+	   volatile unsigned long Fill17[0x3000/4 - 0x2FFC/4]; //GAP 0x2000 - 0x2FFC ALUT
+	 */
+
+	volatile unsigned long Fill11[1598];
+
+	/* DWFILL; //GAP 0x3000          ALUT 256MB offset */
+	volatile unsigned long Fill_3;
+
+} STG4000REG;
+
+#endif /* _STG4000REG_H */
diff -Nru a/drivers/video/kyro/STG4000VTG.c b/drivers/video/kyro/STG4000VTG.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/video/kyro/STG4000VTG.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,170 @@
+/*
+ *  linux/drivers/video/kyro/STG4000VTG.c
+ *
+ *  Copyright (C) 2002 STMicroelectronics
+ *
+ * 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.
+ */
+
+#include <linux/types.h>
+#include <video/kyro.h>
+
+#include "STG4000Reg.h"
+#include "STG4000Interface.h"
+
+void DisableVGA(volatile STG4000REG * pSTGReg)
+{
+	u32 tmp;
+	volatile u32 count, i;
+
+	/* Reset the VGA registers */
+	tmp = STG_READ_REG(SoftwareReset);
+	CLEAR_BIT(8);
+	STG_WRITE_REG(SoftwareReset, tmp);
+
+	/* Just for Delay */
+	for (i = 0; i < 1000; i++) {
+		count++;
+	}
+
+	/* Pull-out the VGA registers from reset */
+	tmp = STG_READ_REG(SoftwareReset);
+	tmp |= SET_BIT(8);
+	STG_WRITE_REG(SoftwareReset, tmp);
+}
+
+void StopVTG(volatile STG4000REG * pSTGReg)
+{
+	u32 tmp = 0;
+
+	/* Stop Ver and Hor Sync Generator */
+	tmp = (STG_READ_REG(DACSyncCtrl)) | SET_BIT(0) | SET_BIT(2);
+	CLEAR_BIT(31);
+	STG_WRITE_REG(DACSyncCtrl, tmp);
+}
+
+void StartVTG(volatile STG4000REG * pSTGReg)
+{
+	u32 tmp = 0;
+
+	/* Start Ver and Hor Sync Generator */
+	tmp = ((STG_READ_REG(DACSyncCtrl)) | SET_BIT(31));
+	CLEAR_BIT(0);
+	CLEAR_BIT(2);
+	STG_WRITE_REG(DACSyncCtrl, tmp);
+}
+
+void SetupVTG(volatile STG4000REG * pSTGReg,
+	      const struct kyrofb_info * pTiming)
+{
+	u32 tmp = 0;
+	u32 margins = 0;
+	u32 ulBorder;
+	u32 xRes = pTiming->XRES;
+	u32 yRes = pTiming->YRES;
+
+	/* Horizontal */
+	u32 HAddrTime, HRightBorder, HLeftBorder;
+	u32 HBackPorcStrt, HFrontPorchStrt, HTotal,
+	    HLeftBorderStrt, HRightBorderStrt, HDisplayStrt;
+
+	/* Vertical */
+	u32 VDisplayStrt, VBottomBorder, VTopBorder;
+	u32 VBackPorchStrt, VTotal, VTopBorderStrt,
+	    VFrontPorchStrt, VBottomBorderStrt, VAddrTime;
+
+	/* Need to calculate the right border */
+	if ((xRes == 640) && (yRes == 480)) {
+		if ((pTiming->VFREQ == 60) || (pTiming->VFREQ == 72)) {
+			margins = 8;
+		}
+	}
+
+	/* Work out the Border */
+	ulBorder =
+	    (pTiming->HTot -
+	     (pTiming->HST + (pTiming->HBP - margins) + xRes +
+	      (pTiming->HFP - margins))) >> 1;
+
+	/* Border the same for Vertical and Horizontal */
+	VBottomBorder = HLeftBorder = VTopBorder = HRightBorder = ulBorder;
+
+    /************ Get Timing values for Horizontal ******************/
+	HAddrTime = xRes;
+	HBackPorcStrt = pTiming->HST;
+	HTotal = pTiming->HTot;
+	HDisplayStrt =
+	    pTiming->HST + (pTiming->HBP - margins) + HLeftBorder;
+	HLeftBorderStrt = HDisplayStrt - HLeftBorder;
+	HFrontPorchStrt =
+	    pTiming->HST + (pTiming->HBP - margins) + HLeftBorder +
+	    HAddrTime + HRightBorder;
+	HRightBorderStrt = HFrontPorchStrt - HRightBorder;
+
+    /************ Get Timing values for Vertical ******************/
+	VAddrTime = yRes;
+	VBackPorchStrt = pTiming->VST;
+	VTotal = pTiming->VTot;
+	VDisplayStrt =
+	    pTiming->VST + (pTiming->VBP - margins) + VTopBorder;
+	VTopBorderStrt = VDisplayStrt - VTopBorder;
+	VFrontPorchStrt =
+	    pTiming->VST + (pTiming->VBP - margins) + VTopBorder +
+	    VAddrTime + VBottomBorder;
+	VBottomBorderStrt = VFrontPorchStrt - VBottomBorder;
+
+	/* Set Hor Timing 1, 2, 3 */
+	tmp = STG_READ_REG(DACHorTim1);
+	CLEAR_BITS_FRM_TO(0, 11);
+	CLEAR_BITS_FRM_TO(16, 27);
+	tmp |= (HTotal) | (HBackPorcStrt << 16);
+	STG_WRITE_REG(DACHorTim1, tmp);
+
+	tmp = STG_READ_REG(DACHorTim2);
+	CLEAR_BITS_FRM_TO(0, 11);
+	CLEAR_BITS_FRM_TO(16, 27);
+	tmp |= (HDisplayStrt << 16) | HLeftBorderStrt;
+	STG_WRITE_REG(DACHorTim2, tmp);
+
+	tmp = STG_READ_REG(DACHorTim3);
+	CLEAR_BITS_FRM_TO(0, 11);
+	CLEAR_BITS_FRM_TO(16, 27);
+	tmp |= (HFrontPorchStrt << 16) | HRightBorderStrt;
+	STG_WRITE_REG(DACHorTim3, tmp);
+
+	/* Set Ver Timing 1, 2, 3 */
+	tmp = STG_READ_REG(DACVerTim1);
+	CLEAR_BITS_FRM_TO(0, 11);
+	CLEAR_BITS_FRM_TO(16, 27);
+	tmp |= (VBackPorchStrt << 16) | (VTotal);
+	STG_WRITE_REG(DACVerTim1, tmp);
+
+	tmp = STG_READ_REG(DACVerTim2);
+	CLEAR_BITS_FRM_TO(0, 11);
+	CLEAR_BITS_FRM_TO(16, 27);
+	tmp |= (VDisplayStrt << 16) | VTopBorderStrt;
+	STG_WRITE_REG(DACVerTim2, tmp);
+
+	tmp = STG_READ_REG(DACVerTim3);
+	CLEAR_BITS_FRM_TO(0, 11);
+	CLEAR_BITS_FRM_TO(16, 27);
+	tmp |= (VFrontPorchStrt << 16) | VBottomBorderStrt;
+	STG_WRITE_REG(DACVerTim3, tmp);
+
+	/* Set Verical and Horizontal Polarity */
+	tmp = STG_READ_REG(DACSyncCtrl) | SET_BIT(3) | SET_BIT(1);
+
+	if ((pTiming->HSP > 0) && (pTiming->VSP < 0)) {	/* +hsync -vsync */
+		tmp &= ~0x8;
+	} else if ((pTiming->HSP < 0) && (pTiming->VSP > 0)) {	/* -hsync +vsync */
+		tmp &= ~0x2;
+	} else if ((pTiming->HSP < 0) && (pTiming->VSP < 0)) {	/* -hsync -vsync */
+		tmp &= ~0xA;
+	} else if ((pTiming->HSP > 0) && (pTiming->VSP > 0)) {	/* +hsync -vsync */
+		tmp &= ~0x0;
+	}
+
+	STG_WRITE_REG(DACSyncCtrl, tmp);
+}
diff -Nru a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/video/kyro/fbdev.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,808 @@
+/*
+ *  linux/drivers/video/kyro/kyrofb.c
+ *
+ *  Copyright (C) 2002 STMicroelectronics
+ *  Copyright (C) 2003, 2004 Paul Mundt
+ *
+ * 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.
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/tty.h>
+#include <linux/delay.h>
+#include <linux/fb.h>
+#include <linux/ioctl.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#ifdef CONFIG_MTRR
+#include <asm/mtrr.h>
+#endif
+
+#include <video/kyro.h>
+
+#include "STG4000Reg.h"
+#include "STG4000Interface.h"
+
+/*
+ * PCI Definitions
+ */
+#define PCI_VENDOR_ID_ST	0x104a
+#define PCI_DEVICE_ID_STG4000	0x0010
+
+#define KHZ2PICOS(a) (1000000000UL/(a))
+
+/****************************************************************************/
+static struct fb_fix_screeninfo kyro_fix __initdata = {
+	.id		= "ST Kyro",
+	.type		= FB_TYPE_PACKED_PIXELS,
+	.visual		= FB_VISUAL_TRUECOLOR,
+	.accel		= FB_ACCEL_NONE,
+};
+
+static struct fb_var_screeninfo kyro_var __initdata = {
+	/* 640x480, 16bpp @ 60 Hz */
+	.xres		= 640,
+	.yres		= 480,
+	.xres_virtual	= 640,
+	.yres_virtual	= 480,
+	.bits_per_pixel	= 16,
+	.red		= { 11, 5, 0 },
+	.green		= {  5, 6, 0 },
+	.blue		= {  0, 5, 0 },
+	.activate	= FB_ACTIVATE_NOW,
+	.height		= -1,
+	.width		= -1,
+	.pixclock	= KHZ2PICOS(25175),
+	.left_margin	= 48,
+	.right_margin	= 16,
+	.upper_margin	= 33,
+	.lower_margin	= 10,
+	.hsync_len	= 96,
+	.vsync_len	= 2,
+	.vmode		= FB_VMODE_NONINTERLACED,
+};
+
+static struct kyrofb_info *currentpar;
+
+typedef struct {
+	STG4000REG *pSTGReg;	/* Virtual address of PCI register region */
+	u32 ulNextFreeVidMem;	/* Offset from start of vid mem to next free region */
+	u32 ulOverlayOffset;	/* Offset from start of vid mem to overlay */
+	u32 ulOverlayStride;	/* Interleaved YUV and 422 mode Y stride */
+	u32 ulOverlayUVStride;	/* 422 mode U & V stride */
+} device_info_t;
+
+/* global graphics card info structure (one per card) */
+static device_info_t deviceInfo = { 0 };
+
+static char *mode_option __initdata = NULL;
+static int nopan __initdata = 0;
+static int nowrap __initdata = 1;
+#ifdef CONFIG_MTRR
+static int nomtrr __initdata = 0;
+#endif
+
+/* PCI driver prototypes */
+static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
+static void kyrofb_remove(struct pci_dev *pdev);
+
+#ifndef MODULE
+static struct fb_videomode kyro_modedb[] __initdata = {
+	{
+		/* 640x350 @ 85Hz */
+		NULL, 85, 640, 350, KHZ2PICOS(31500),
+		96, 32, 60, 32, 64, 3,
+		FB_SYNC_HOR_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 640x400 @ 85Hz */
+		NULL, 85, 640, 400, KHZ2PICOS(31500),
+		96, 32, 41, 1, 64, 3,
+		FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 720x400 @ 85Hz */
+		NULL, 85, 720, 400, KHZ2PICOS(35500),
+		108, 36, 42, 1, 72, 3,
+		FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 640x480 @ 60Hz */
+		NULL, 60, 640, 480, KHZ2PICOS(25175),
+		48, 16, 33, 10, 96, 2,
+		0, FB_VMODE_NONINTERLACED
+	}, {
+		/* 640x480 @ 72Hz */
+		NULL, 72, 640, 480, KHZ2PICOS(31500),
+		128, 24, 28, 9, 40, 3,
+		0, FB_VMODE_NONINTERLACED
+	}, {
+		/* 640x480 @ 75Hz */
+		NULL, 75, 640, 480, KHZ2PICOS(31500),
+		120, 16, 16, 1, 64, 3,
+		0, FB_VMODE_NONINTERLACED
+	}, {
+		/* 640x480 @ 85Hz */
+		NULL, 85, 640, 480, KHZ2PICOS(36000),
+		80, 56, 25, 1, 56, 3,
+		0, FB_VMODE_NONINTERLACED
+	}, {
+		/* 800x600 @ 56Hz */
+		NULL, 56, 800, 600, KHZ2PICOS(36000),
+		128, 24, 22, 1, 72, 2,
+		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 800x600 @ 60Hz */
+		NULL, 60, 800, 600, KHZ2PICOS(40000),
+		88, 40, 23, 1, 128, 4,
+		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 800x600 @ 72Hz */
+		NULL, 72, 800, 600, KHZ2PICOS(50000),
+		64, 56, 23, 37, 120, 6,
+		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 800x600 @ 75Hz */
+		NULL, 75, 800, 600, KHZ2PICOS(49500),
+		160, 16, 21, 1, 80, 3,
+		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 800x600 @ 85Hz */
+		NULL, 85, 800, 600, KHZ2PICOS(56250),
+		152, 32, 27, 1, 64, 3,
+		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1024x768 @ 60Hz */
+		NULL, 60, 1024, 768, KHZ2PICOS(65000),
+		160, 24, 29, 3, 136, 6,
+		0, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1024x768 @ 70Hz */
+		NULL, 70, 1024, 768, KHZ2PICOS(75000),
+		144, 24, 29, 3, 136, 6,
+		0, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1024x768 @ 75Hz */
+		NULL, 75, 1024, 768, KHZ2PICOS(78750),
+		176, 16, 28, 1, 96, 3,
+		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1024x768 @ 85Hz */
+		NULL, 85, 1024, 768, KHZ2PICOS(94500),
+		208, 48, 36, 1, 96, 3,
+		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1152x864 @ 75Hz */
+		NULL, 75, 1152, 864, KHZ2PICOS(108000),
+		256, 64, 32, 1, 128, 3,
+		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1280x960 @ 60Hz */
+		NULL, 60, 1280, 960, KHZ2PICOS(108000),
+		312, 96, 36, 1, 112, 3,
+		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1280x960 @ 85Hz */
+		NULL, 85, 1280, 960, KHZ2PICOS(148500),
+		224, 64, 47, 1, 160, 3,
+		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1280x1024 @ 60Hz */
+		NULL, 60, 1280, 1024, KHZ2PICOS(108000),
+		248, 48, 38, 1, 112, 3,
+		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1280x1024 @ 75Hz */
+		NULL, 75, 1280, 1024, KHZ2PICOS(135000),
+		248, 16, 38, 1, 144, 3,
+		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1280x1024 @ 85Hz */
+		NULL, 85, 1280, 1024, KHZ2PICOS(157500),
+		224, 64, 44, 1, 160, 3,
+		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1600x1200 @ 60Hz */
+		NULL, 60, 1600, 1200, KHZ2PICOS(162000),
+		304, 64, 46, 1, 192, 3,
+		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1600x1200 @ 65Hz */
+		NULL, 65, 1600, 1200, KHZ2PICOS(175500),
+		304, 64, 46, 1, 192, 3,
+		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1600x1200 @ 70Hz */
+		NULL, 70, 1600, 1200, KHZ2PICOS(189000),
+		304, 64, 46, 1, 192, 3,
+		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1600x1200 @ 75Hz */
+		NULL, 75, 1600, 1200, KHZ2PICOS(202500),
+		304, 64, 46, 1, 192, 3,
+		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1600x1200 @ 85Hz */
+		NULL, 85, 1600, 1200, KHZ2PICOS(229500),
+		304, 64, 46, 1, 192, 3,
+		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1792x1344 @ 60Hz */
+		NULL, 60, 1792, 1344, KHZ2PICOS(204750),
+		328, 128, 46, 1, 200, 3,
+		FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1792x1344 @ 75Hz */
+		NULL, 75, 1792, 1344, KHZ2PICOS(261000),
+		352, 96, 69, 1, 216, 3,
+		FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1856x1392 @ 60Hz */
+		NULL, 60, 1856, 1392, KHZ2PICOS(218250),
+		352, 96, 43, 1, 224, 3,
+		FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1856x1392 @ 75Hz */
+		NULL, 75, 1856, 1392, KHZ2PICOS(288000),
+		352, 128, 104, 1, 224, 3,
+		FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1920x1440 @ 60Hz */
+		NULL, 60, 1920, 1440, KHZ2PICOS(234000),
+		344, 128, 56, 1, 208, 3,
+		FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
+		/* 1920x1440 @ 75Hz */
+		NULL, 75, 1920, 1440, KHZ2PICOS(297000),
+		352, 144, 56, 1, 224, 3,
+		FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	},
+};
+#define NUM_TOTAL_MODES	ARRAY_SIZE(kyro_modedb)
+
+/*
+ * This needs to be kept ordered corresponding to kyro_modedb.
+ */
+enum {
+	VMODE_640_350_85,
+	VMODE_640_400_85,
+	VMODE_720_400_85,
+	VMODE_640_480_60,
+	VMODE_640_480_72,
+	VMODE_640_480_75,
+	VMODE_640_480_85,
+	VMODE_800_600_56,
+	VMODE_800_600_60,
+	VMODE_800_600_72,
+	VMODE_800_600_75,
+	VMODE_800_600_85,
+	VMODE_1024_768_60,
+	VMODE_1024_768_70,
+	VMODE_1024_768_75,
+	VMODE_1024_768_85,
+	VMODE_1152_864_75,
+	VMODE_1280_960_60,
+	VMODE_1280_960_85,
+	VMODE_1280_1024_60,
+	VMODE_1280_1024_75,
+	VMODE_1280_1024_85,
+	VMODE_1600_1200_60,
+	VMODE_1600_1200_65,
+	VMODE_1600_1200_70,
+	VMODE_1600_1200_75,
+	VMODE_1600_1200_85,
+	VMODE_1792_1344_60,
+	VMODE_1792_1344_75,
+	VMODE_1856_1392_60,
+	VMODE_1856_1392_75,
+	VMODE_1920_1440_60,
+	VMODE_1920_1440_75,
+};
+#endif
+
+/* Accessors */
+int kyro_dev_video_mode_set(struct fb_info *info)
+{
+	struct kyrofb_info *par = (struct kyrofb_info *)info->par;
+
+	/* Turn off display */
+	StopVTG(deviceInfo.pSTGReg);
+	DisableRamdacOutput(deviceInfo.pSTGReg);
+
+	/* Bring us out of VGA and into Hi-Res mode, if not already. */
+	DisableVGA(deviceInfo.pSTGReg);
+
+	if (InitialiseRamdac(deviceInfo.pSTGReg,
+			     info->var.bits_per_pixel,
+			     info->var.xres, info->var.yres,
+			     par->HSP, par->VSP, &par->PIXCLK) < 0)
+		return -EINVAL;
+
+	SetupVTG(deviceInfo.pSTGReg, par);
+
+	ResetOverlayRegisters(deviceInfo.pSTGReg);
+
+	/* Turn on display in new mode */
+	EnableRamdacOutput(deviceInfo.pSTGReg);
+	StartVTG(deviceInfo.pSTGReg);
+
+	deviceInfo.ulNextFreeVidMem = info->var.xres * info->var.yres *
+				      info->var.bits_per_pixel;
+	deviceInfo.ulOverlayOffset = 0;
+
+	return 0;
+}
+
+int kyro_dev_overlay_create(u32 ulWidth,
+			    u32 ulHeight, int bLinear)
+{
+	u32 offset;
+	u32 stride, uvStride;
+
+	if (deviceInfo.ulOverlayOffset != 0)
+		/*
+		 * Can only create one overlay without resetting the card or
+		 * changing display mode
+		 */
+		return -EINVAL;
+
+	ResetOverlayRegisters(deviceInfo.pSTGReg);
+
+	/* Overlays are addressed in multiples of 16bytes or 32bytes, so make
+	 * sure the start offset is on an appropriate boundary.
+	 */
+	offset = deviceInfo.ulNextFreeVidMem;
+	if ((offset & 0x1f) != 0) {
+		offset = (offset + 32L) & 0xffffffE0L;
+	}
+
+	if (CreateOverlaySurface(deviceInfo.pSTGReg, ulWidth, ulHeight,
+				 bLinear, offset, &stride, &uvStride) < 0)
+		return -EINVAL;
+
+	deviceInfo.ulOverlayOffset = offset;
+	deviceInfo.ulOverlayStride = stride;
+	deviceInfo.ulOverlayUVStride = uvStride;
+	deviceInfo.ulNextFreeVidMem = offset + (ulHeight * stride) + (ulHeight * 2 * uvStride);
+
+	SetOverlayBlendMode(deviceInfo.pSTGReg, GLOBAL_ALPHA, 0xf, 0x0);
+
+	return 0;
+}
+
+int kyro_dev_overlay_viewport_set(u32 x, u32 y, u32 ulWidth, u32 ulHeight)
+{
+	if (deviceInfo.ulOverlayOffset == 0)
+		/* probably haven't called CreateOverlay yet */
+		return -EINVAL;
+
+	/* Stop Ramdac Output */
+	DisableRamdacOutput(deviceInfo.pSTGReg);
+
+	SetOverlayViewPort(deviceInfo.pSTGReg,
+			   x, y, x + ulWidth - 1, y + ulHeight - 1);
+
+	EnableOverlayPlane(deviceInfo.pSTGReg);
+	/* Start Ramdac Output */
+	EnableRamdacOutput(deviceInfo.pSTGReg);
+
+	return 0;
+}
+
+static inline unsigned long get_line_length(int x, int bpp)
+{
+	return (unsigned long)((((x*bpp)+31)&~31) >> 3);
+}
+
+static int kyrofb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
+{
+	struct kyrofb_info *par = (struct kyrofb_info *)info->par;
+
+	if (var->bits_per_pixel != 16 && var->bits_per_pixel != 32) {
+		printk(KERN_WARNING "kyrofb: depth not supported: %u\n", var->bits_per_pixel);
+		return -EINVAL;
+	}
+
+	switch (var->bits_per_pixel) {
+	case 16:
+		var->red.offset = 11;
+		var->red.length = 5;
+		var->green.offset = 5;
+		var->green.length = 6;
+		var->blue.length = 5;
+		break;
+	case 32:
+		var->transp.offset = 24;
+		var->red.offset = 16;
+		var->green.offset = 8;
+		var->blue.offset = 0;
+
+		var->red.length = 8;
+		var->green.length = 8;
+		var->blue.length = 8;
+		var->transp.length = 8;
+		break;
+	}
+
+	/* Height/Width of picture in mm */
+	var->height = var->width = -1;
+
+	/* Timing information. All values are in picoseconds */
+
+	/* par->PIXCLK is in 100Hz units. Convert to picoseconds -
+	 * ensuring we do not exceed 32 bit precision
+	 */
+	/*
+	 * XXX: Enabling this really screws over the pixclock value when we
+	 * read it back with fbset. As such, leaving this commented out appears
+	 * to do the right thing (at least for now) .. bearing in mind that we
+	 * have infact already done the KHZ2PICOS conversion in both the modedb
+	 * and kyro_var. -- PFM.
+	 */
+//	var->pixclock = 1000000000 / (par->PIXCLK / 10);
+
+	/* the header file claims we should use picoseconds
+	 * - nobody else does though, the all use pixels and lines
+	 * of h and v sizes. Both options here.
+	 */
+
+	/*
+	 * If we're being called by __fb_try_mode(), then we don't want to
+	 * override any of the var settings that we've already parsed
+	 * from our modedb. -- PFM.
+	 */
+	if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_TEST)
+		return 0;
+
+	var->left_margin = par->HBP;
+	var->hsync_len = par->HST;
+	var->right_margin = par->HFP;
+
+	var->upper_margin = par->VBP;
+	var->vsync_len = par->VST;
+	var->lower_margin = par->VFP;
+
+	if (par->HSP == 1)
+		var->sync |= FB_SYNC_HOR_HIGH_ACT;
+	if (par->VSP == 1)
+		var->sync |= FB_SYNC_VERT_HIGH_ACT;
+
+	return 0;
+}
+
+static int kyrofb_set_par(struct fb_info *info)
+{
+	struct kyrofb_info *par = (struct kyrofb_info *)info->par;
+	unsigned long lineclock;
+	unsigned long frameclock;
+
+	/* Actual resolution */
+	par->XRES = info->var.xres;
+	par->YRES = info->var.yres;
+
+	/* pixel depth */
+	par->PIXDEPTH = info->var.bits_per_pixel;
+
+	/* Refresh rate */
+	/* time for a line in ns */
+	lineclock = (info->var.pixclock * (info->var.xres +
+				    info->var.right_margin +
+				    info->var.hsync_len +
+				    info->var.left_margin)) / 1000;
+
+
+	/* time for a frame in ns (precision in 32bpp) */
+	frameclock = lineclock * (info->var.yres +
+				  info->var.lower_margin +
+				  info->var.vsync_len +
+				  info->var.upper_margin);
+
+	/* Calculate refresh rate and horrizontal clocks */
+	par->VFREQ = (1000000000 + (frameclock / 2)) / frameclock;
+	par->HCLK = (1000000000 + (lineclock / 2)) / lineclock;
+	par->PIXCLK = ((1000000000 + (info->var.pixclock / 2))
+					/ info->var.pixclock) * 10;
+
+	/* calculate horizontal timings */
+	par->HFP = info->var.right_margin;
+	par->HST = info->var.hsync_len;
+	par->HBP = info->var.left_margin;
+	par->HTot = par->XRES + par->HBP + par->HST + par->HFP;
+
+	/* calculate vertical timings */
+	par->VFP = info->var.lower_margin;
+	par->VST = info->var.vsync_len;
+	par->VBP = info->var.upper_margin;
+	par->VTot = par->YRES + par->VBP + par->VST + par->VFP;
+
+	par->HSP = (info->var.sync & FB_SYNC_HOR_HIGH_ACT) ? 1 : 0;
+	par->VSP = (info->var.sync & FB_SYNC_VERT_HIGH_ACT) ? 1 : 0;
+
+	kyro_dev_video_mode_set(info);
+
+	/* length of a line in bytes    */
+	info->fix.line_length = get_line_length(par->XRES, par->PIXDEPTH);
+	info->fix.visual = FB_VISUAL_TRUECOLOR;
+
+	return 0;
+}
+
+static int kyrofb_setcolreg(u_int regno, u_int red, u_int green,
+			    u_int blue, u_int transp, struct fb_info *info)
+{
+	if (regno > 255)
+		return 1;	/* Invalid register */
+
+	if (regno < 16) {
+		switch (info->var.bits_per_pixel) {
+		case 16:
+			((u16*)(info->pseudo_palette))[regno] =
+			     (red   & 0xf800) |
+			    ((green & 0xfc00) >> 5) |
+			    ((blue  & 0xf800) >> 11);
+			break;
+		case 32:
+			red >>= 8; green >>= 8; blue >>= 8; transp >>= 8;
+			((u32*)(info->pseudo_palette))[regno] =
+			    (transp << 24) | (red << 16) | (green << 8) | blue;
+			break;
+		}
+	}
+
+	return 0;
+}
+
+int __init kyrofb_setup(char *options)
+{
+	char *this_opt;
+
+	if (!options || !*options)
+		return 0;
+
+	while ((this_opt = strsep(&options, ","))) {
+		if (!*this_opt)
+			continue;
+		if (strcmp(this_opt, "nopan") == 0) {
+			nopan = 1;
+		} else if (strcmp(this_opt, "nowrap") == 0) {
+			nowrap = 1;
+#ifdef CONFIG_MTRR
+		} else if (strcmp(this_opt, "nomtrr") == 0) {
+			nomtrr = 1;
+#endif
+		} else {
+			mode_option = this_opt;
+		}
+	}
+
+	return 0;
+}
+
+static int kyrofb_ioctl(struct inode *inode, struct file *file,
+			unsigned int cmd, unsigned long arg,
+			struct fb_info *info)
+{
+	overlay_create ol_create;
+	overlay_viewport_set ol_viewport_set;
+
+	switch (cmd) {
+	case KYRO_IOCTL_OVERLAY_CREATE:
+		copy_from_user((void *) &ol_create, (void *) arg,
+			       sizeof(overlay_create));
+
+		if (kyro_dev_overlay_create(ol_create.ulWidth,
+					    ol_create.ulHeight, 0) < 0) {
+			printk(KERN_ERR "Kyro FB: failed to create overlay surface.\n");
+
+			return -EINVAL;
+		}
+		break;
+	case KYRO_IOCTL_OVERLAY_VIEWPORT_SET:
+		copy_from_user((void *) &ol_viewport_set, (void *) arg,
+			       sizeof(overlay_viewport_set));
+
+		if (kyro_dev_overlay_viewport_set(ol_viewport_set.xOrgin,
+						  ol_viewport_set.yOrgin,
+						  ol_viewport_set.xSize,
+						  ol_viewport_set.ySize) != 0)
+		{
+			printk(KERN_ERR "Kyro FB: failed to create overlay viewport.\n");
+			return -EINVAL;
+		}
+		break;
+	case KYRO_IOCTL_SET_VIDEO_MODE:
+		{
+			printk(KERN_ERR "Kyro FB: KYRO_IOCTL_SET_VIDEO_MODE is"
+				"obsolete, use the appropriate fb_ioctl()"
+				"command instead.\n");
+			return -EINVAL;
+		}
+		break;
+	case KYRO_IOCTL_UVSTRIDE:
+		copy_to_user((void *)arg, (void *)&deviceInfo.ulOverlayUVStride, sizeof(unsigned long));
+		break;
+	case KYRO_IOCTL_STRIDE:
+		copy_to_user((void *)arg, (void *)&deviceInfo.ulOverlayStride, sizeof(unsigned long));
+		break;
+	case KYRO_IOCTL_OVERLAY_OFFSET:
+		copy_to_user((void *)arg, (void *)&deviceInfo.ulOverlayOffset, sizeof(unsigned long));
+		break;
+	}
+
+	return 0;
+}
+
+static struct pci_device_id kyrofb_pci_tbl[] = {
+	{ PCI_VENDOR_ID_ST, PCI_DEVICE_ID_STG4000,
+	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+	{ 0, }
+};
+
+MODULE_DEVICE_TABLE(pci, kyrofb_pci_tbl);
+
+static struct pci_driver kyrofb_pci_driver = {
+	.name		= "kyrofb",
+	.id_table	= kyrofb_pci_tbl,
+	.probe		= kyrofb_probe,
+	.remove		= __devexit_p(kyrofb_remove),
+};
+
+static struct fb_ops kyrofb_ops = {
+	.owner		= THIS_MODULE,
+	.fb_check_var	= kyrofb_check_var,
+	.fb_set_par	= kyrofb_set_par,
+	.fb_setcolreg	= kyrofb_setcolreg,
+	.fb_ioctl	= kyrofb_ioctl,
+	.fb_fillrect	= cfb_fillrect,
+	.fb_copyarea	= cfb_copyarea,
+	.fb_imageblit	= cfb_imageblit,
+	.fb_cursor	= soft_cursor,
+};
+
+static int __devinit kyrofb_probe(struct pci_dev *pdev,
+				  const struct pci_device_id *ent)
+{
+	struct fb_info *info;
+	unsigned long size;
+	int err;
+
+	if ((err = pci_enable_device(pdev))) {
+		printk(KERN_WARNING "kyrofb: Can't enable pdev: %d\n", err);
+		return err;
+	}
+
+	size = sizeof(struct fb_info) + sizeof(struct kyrofb_info) + 16 * sizeof(u32);
+	info = kmalloc(size, GFP_KERNEL);
+	if (!info)
+		return -ENOMEM;
+
+	memset(info, 0, size);
+
+	currentpar = (struct kyrofb_info *)(info + 1);
+
+	kyro_fix.smem_start = pci_resource_start(pdev, 0);
+	kyro_fix.smem_len   = pci_resource_len(pdev, 0);
+	kyro_fix.mmio_start = pci_resource_start(pdev, 1);
+	kyro_fix.mmio_len   = pci_resource_len(pdev, 1);
+
+	currentpar->regbase = deviceInfo.pSTGReg =
+		ioremap_nocache(kyro_fix.mmio_start, kyro_fix.mmio_len);
+
+	info->screen_base = ioremap_nocache(kyro_fix.smem_start,
+					    kyro_fix.smem_len);
+
+#ifdef CONFIG_MTRR
+	if (!nomtrr)
+		currentpar->mtrr_handle =
+			mtrr_add(kyro_fix.smem_start,
+				 kyro_fix.smem_len,
+				 MTRR_TYPE_WRCOMB, 1);
+#endif
+
+	kyro_fix.ypanstep	= nopan ? 0 : 1;
+	kyro_fix.ywrapstep	= nowrap ? 0 : 1;
+
+	info->fbops		= &kyrofb_ops;
+	info->fix		= kyro_fix;
+	info->par		= currentpar;
+	info->pseudo_palette	= (void *)(currentpar + 1);
+	info->flags		= FBINFO_FLAG_DEFAULT;
+
+	SetCoreClockPLL(deviceInfo.pSTGReg, pdev);
+
+	deviceInfo.ulNextFreeVidMem = 0;
+	deviceInfo.ulOverlayOffset = 0;
+
+	/* This should give a reasonable default video mode */
+#ifndef MODULE
+	if (!fb_find_mode(&info->var, info, mode_option, kyro_modedb,
+			  NUM_TOTAL_MODES, &kyro_modedb[VMODE_1024_768_75], 32))
+#endif
+		info->var = kyro_var;
+
+	fb_alloc_cmap(&info->cmap, 256, 0);
+
+	kyrofb_set_par(info);
+	kyrofb_check_var(&info->var, info);
+
+	size = get_line_length(info->var.xres_virtual,
+			       info->var.bits_per_pixel);
+	size *= info->var.yres_virtual;
+
+	memset_io((unsigned long)info->screen_base, 0, size);
+
+	if (register_framebuffer(info) < 0)
+		goto out_unmap;
+
+	printk("fb%d: %s frame buffer device, at %dx%d@%d using %ldk/%ldk of VRAM\n",
+	       info->node, info->fix.id, info->var.xres,
+	       info->var.yres, info->var.bits_per_pixel, size >> 10,
+	       (unsigned long)info->fix.smem_len >> 10);
+
+	pci_set_drvdata(pdev, info);
+
+	return 0;
+
+out_unmap:
+	iounmap(currentpar->regbase);
+	iounmap(info->screen_base);
+	kfree(info);
+
+	return -EINVAL;
+}
+
+static void __devexit kyrofb_remove(struct pci_dev *pdev)
+{
+	struct fb_info *info = pci_get_drvdata(pdev);
+	struct kyrofb_info *par = (struct kyrofb_info *)info->par;
+
+	/* Reset the board */
+	StopVTG(deviceInfo.pSTGReg);
+	DisableRamdacOutput(deviceInfo.pSTGReg);
+
+	/* Sync up the PLL */
+	SetCoreClockPLL(deviceInfo.pSTGReg, pdev);
+
+	deviceInfo.ulNextFreeVidMem = 0;
+	deviceInfo.ulOverlayOffset = 0;
+
+	iounmap(info->screen_base);
+	iounmap(par->regbase);
+
+#ifdef CONFIG_MTRR
+	if (par->mtrr_handle)
+		mtrr_del(par->mtrr_handle,
+			 info->fix.smem_start,
+			 info->fix.smem_len);
+#endif
+
+	unregister_framebuffer(info);
+	pci_set_drvdata(pdev, NULL);
+	kfree(info);
+}
+
+int __init kyrofb_init(void)
+{
+	return pci_module_init(&kyrofb_pci_driver);
+}
+
+static void __exit kyrofb_exit(void)
+{
+	pci_unregister_driver(&kyrofb_pci_driver);
+}
+
+#ifdef MODULE
+module_init(kyrofb_init);
+module_exit(kyrofb_exit);
+#endif
+
+MODULE_AUTHOR("STMicroelectronics; Paul Mundt <lethal@linux-sh.org>");
+MODULE_LICENSE("GPL");
diff -Nru a/drivers/video/logo/Makefile b/drivers/video/logo/Makefile
--- a/drivers/video/logo/Makefile	Tue Feb  3 19:45:35 2004
+++ b/drivers/video/logo/Makefile	Tue Feb  3 19:45:35 2004
@@ -25,18 +25,31 @@
 
 # How to generate them
 
-$(obj)/%_mono.c:	$(src)/%_mono.pbm
-		$(objtree)/scripts/pnmtologo -t mono -n $*_mono -o $@ $<
+quiet_cmd_logo_mono    = MONO    $@
+      cmd_logo_mono    = $(objtree)/scripts/pnmtologo -t mono -n $*_mono -o $@ $<
 
-$(obj)/%_vga16.c:	$(src)/%_vga16.ppm
-		$(objtree)/scripts/pnmtologo -t vga16 -n $*_vga16 -o $@ $<
+quiet_cmd_logo_vga16   = VGA16   $@
+      cmd_logo_vga16   = $(objtree)/scripts/pnmtologo -t vga16 -n $*_vga16 -o $@ $<
 
-$(obj)/%_clut224.c:	$(src)/%_clut224.ppm
-		$(objtree)/scripts/pnmtologo -t clut224 -n $*_clut224 -o $@ $<
+quiet_cmd_logo_clut224 = CLUT224 $@
+      cmd_logo_clut224 = $(objtree)/scripts/pnmtologo -t clut224 -n $*_clut224 -o $@ $<
 
-$(obj)/%_gray256.c:	$(src)/%_gray256.pgm
-		$(objtree)/scripts/pnmtologo -t gray256 -n $*_gray256 -o $@ $<
+quiet_cmd_logo_gray256 = GRAY256 $@
+      cmd_logo_gray256 = $(objtree)/scripts/pnmtologo -t gray256 -n $*_gray256 -o $@ $<
+
+
+$(obj)/%_mono.c: $(src)/%_mono.pbm FORCE
+	$(call if_changed,logo_mono)
+
+$(obj)/%_vga16.c: $(src)/%_vga16.ppm FORCE
+	$(call if_changed,logo_vga16)
+
+$(obj)/%_clut224.c: $(src)/%_clut224.ppm FORCE
+	$(call if_changed,logo_clut224)
+
+$(obj)/%_gray256.c: $(src)/%_gray256.pgm FORCE
+	$(call if_changed,logo_gray256)
 
 
 # Files generated that shall be removed upon make clean
-clean-files := *_mono.c *_vga16.c *_clut224.c *_gray256.c
+targets := *_mono.c *_vga16.c *_clut224.c *_gray256.c
diff -Nru a/drivers/video/macfb.c b/drivers/video/macfb.c
--- a/drivers/video/macfb.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/video/macfb.c	Tue Feb  3 19:45:16 2004
@@ -592,7 +592,7 @@
 	.fb_cursor	= soft_cursor,
 };
 
-void __init macfb_setup(char *options, int *ints)
+void __init macfb_setup(char *options)
 {
 	char *this_opt;
 	
diff -Nru a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c
--- a/drivers/video/pvr2fb.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/video/pvr2fb.c	Tue Feb  3 19:45:16 2004
@@ -4,7 +4,7 @@
  * Dreamcast.
  *
  * Copyright (c) 2001 M. R. Brown <mrbrown@0xd6.org>
- * Copyright (c) 2001, 2002, 2003 Paul Mundt <lethal@linux-sh.org>
+ * Copyright (c) 2001, 2002, 2003, 2004 Paul Mundt <lethal@linux-sh.org>
  *
  * This file is part of the LinuxDC project (linuxdc.sourceforge.net).
  *
@@ -46,6 +46,8 @@
  *  the benefit of being fully researched, so some modes may be broken.
  */
 
+#undef DEBUG
+
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -58,26 +60,30 @@
 #include <linux/interrupt.h>
 #include <linux/fb.h>
 #include <linux/init.h>
+#include <linux/pci.h>
 
 #ifdef CONFIG_SH_DREAMCAST
-#include <asm/io.h>
 #include <asm/machvec.h>
-#include <asm/dc_sysasic.h>
+#include <asm/mach/sysasic.h>
 #endif
 
-#ifdef CONFIG_MTRR
-#include <asm/mtrr.h>
+#ifdef CONFIG_SH_DMA
+#include <linux/pagemap.h>
+#include <asm/mach/dma.h>
+#include <asm/dma.h>
 #endif
 
-#ifdef CONFIG_FB_PVR2_DEBUG
-#  define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
-#else
-#  define DPRINTK(fmt, args...)
+#ifdef CONFIG_SH_STORE_QUEUES
+#include <asm/uaccess.h>
+#include <asm/cpu/sq.h>
 #endif
 
-/* 2D video registers */
-#define DISP_BASE 0xa05f8000
+#ifndef PCI_DEVICE_ID_NEC_NEON250
+#  define PCI_DEVICE_ID_NEC_NEON250	0x0067
+#endif
 
+/* 2D video registers */
+#define DISP_BASE	par->mmio_base
 #define DISP_BRDRCOLR (DISP_BASE + 0x40)
 #define DISP_DIWMODE (DISP_BASE + 0x44)
 #define DISP_DIWADDRL (DISP_BASE + 0x50)
@@ -101,11 +107,16 @@
 #define NTSC_HTOTAL 857
 #define NTSC_VTOTAL 262
 
+/* Supported cable types */
 enum { CT_VGA, CT_NONE, CT_RGB, CT_COMPOSITE };
 
+/* Supported video output types */
 enum { VO_PAL, VO_NTSC, VO_VGA };
 
-struct pvr2_params { u_short val; char *name; };
+/* Supported palette types */
+enum { PAL_ARGB1555, PAL_RGB565, PAL_ARGB4444, PAL_ARGB8888 };
+
+struct pvr2_params { unsigned int val; char *name; };
 static struct pvr2_params cables[] __initdata = {
 	{ CT_VGA, "VGA" }, { CT_RGB, "RGB" }, { CT_COMPOSITE, "COMPOSITE" },
 };
@@ -119,23 +130,24 @@
  */
 
 static struct pvr2fb_par {
-	u_short hsync_total;	/* Clocks/line */
-	u_short vsync_total;	/* Lines/field */
-	u_short borderstart_h;
-	u_short borderstop_h;
-	u_short borderstart_v;
-	u_short borderstop_v;
-	u_short diwstart_h;	/* Horizontal offset of the display field */
-	u_short diwstart_v;	/* Vertical offset of the display field, for
+	unsigned int hsync_total;	/* Clocks/line */
+	unsigned int vsync_total;	/* Lines/field */
+	unsigned int borderstart_h;
+	unsigned int borderstop_h;
+	unsigned int borderstart_v;
+	unsigned int borderstop_v;
+	unsigned int diwstart_h;	/* Horizontal offset of the display field */
+	unsigned int diwstart_v;	/* Vertical offset of the display field, for
 				   interlaced modes, this is the long field */
-	u_long disp_start;	/* Address of image within VRAM */
-	u_char is_interlaced;	/* Is the display interlaced? */
-	u_char is_doublescan;	/* Are scanlines output twice? (doublescan) */
-	u_char is_lowres;	/* Is horizontal pixel-doubling enabled? */
+	unsigned long disp_start;	/* Address of image within VRAM */
+	unsigned char is_interlaced;	/* Is the display interlaced? */
+	unsigned char is_doublescan;	/* Are scanlines output twice? (doublescan) */
+	unsigned char is_lowres;	/* Is horizontal pixel-doubling enabled? */
+
+	unsigned long mmio_base;	/* MMIO base */
 } *currentpar;
 
 static struct fb_info *fb_info;
-static int pvr2fb_inverse = 0;
 
 static struct fb_fix_screeninfo pvr2_fix __initdata = {
 	.id =		"NEC PowerVR2",
@@ -161,10 +173,8 @@
 	.vmode =	FB_VMODE_NONINTERLACED,
 };
 
-#define VIDEOMEMSIZE (8*1024*1024)
-static u_long videomemory = 0xa5000000, videomemorysize = VIDEOMEMSIZE;
-static int cable_type = -1;
-static int video_output = -1;
+static int cable_type = CT_VGA;
+static int video_output = VO_VGA;
 
 static int nopan = 0;
 static int nowrap = 1;
@@ -172,20 +182,29 @@
 /*
  * We do all updating, blanking, etc. during the vertical retrace period
  */
-static u_short do_vmode_full = 0;	/* Change the video mode */
-static u_short do_vmode_pan = 0;	/* Update the video mode */
+static unsigned int do_vmode_full = 0;	/* Change the video mode */
+static unsigned int do_vmode_pan = 0;	/* Update the video mode */
 static short do_blank = 0;		/* (Un)Blank the screen */
 
-static u_short is_blanked = 0;		/* Is the screen blanked? */
+static unsigned int is_blanked = 0;		/* Is the screen blanked? */
+
+#ifdef CONFIG_SH_STORE_QUEUES
+static struct sq_mapping *pvr2fb_map;
+#endif
+
+#ifdef CONFIG_SH_DMA
+static unsigned int shdma = PVR2_CASCADE_CHAN;
+static unsigned int pvr2dma = ONCHIP_NR_DMA_CHANNELS;
+#endif
 
 /* Interface used by the world */
 
 int pvr2fb_setup(char*);
 
-static int pvr2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
-                            u_int transp, struct fb_info *info);
+static int pvr2fb_setcolreg(unsigned int regno, unsigned int red, unsigned int green, unsigned int blue,
+                            unsigned int transp, struct fb_info *info);
 static int pvr2fb_blank(int blank, struct fb_info *info);
-static u_long get_line_length(int xres_virtual, int bpp);
+static unsigned long get_line_length(int xres_virtual, int bpp);
 static void set_color_bitfields(struct fb_var_screeninfo *var);
 static int pvr2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info);
 static int pvr2fb_set_par(struct fb_info *info);
@@ -196,6 +215,8 @@
 static int pvr2_init_cable(void);
 static int pvr2_get_param(const struct pvr2_params *p, const char *s,
                             int val, int size);
+static ssize_t pvr2fb_write(struct file *file, const char *buf,
+			    size_t count, loff_t *ppos);
 
 static struct fb_ops pvr2fb_ops = {
 	.owner 		= THIS_MODULE,
@@ -203,6 +224,9 @@
 	.fb_blank 	= pvr2fb_blank,
 	.fb_check_var 	= pvr2fb_check_var,
 	.fb_set_par 	= pvr2fb_set_par,
+#ifdef CONFIG_SH_DMA
+	.fb_write	= pvr2fb_write,
+#endif
 	.fb_fillrect 	= cfb_fillrect,
 	.fb_copyarea	= cfb_copyarea,
 	.fb_imageblit	= cfb_imageblit,
@@ -241,21 +265,36 @@
 static int defmode = DEFMODE_NTSC;
 static char *mode_option __initdata = NULL;
 
+static inline void pvr2fb_set_pal_type(unsigned int type)
+{
+	struct pvr2fb_par *par = (struct pvr2fb_par *)fb_info->par;
+
+	fb_writel(type, par->mmio_base + 0x108);
+}
+
+static inline void pvr2fb_set_pal_entry(struct pvr2fb_par *par,
+					unsigned int regno,
+					unsigned int val)
+{
+	fb_writel(val, par->mmio_base + 0x1000 + (4 * regno));
+}
+
 static int pvr2fb_blank(int blank, struct fb_info *info)
 {
 	do_blank = blank ? blank : -1;
 	return 0;
 }
 
-static inline u_long get_line_length(int xres_virtual, int bpp)
+static inline unsigned long get_line_length(int xres_virtual, int bpp)
 {
-	return (u_long)((((xres_virtual*bpp)+31)&~31) >> 3);
+	return (unsigned long)((((xres_virtual*bpp)+31)&~31) >> 3);
 }
 
 static void set_color_bitfields(struct fb_var_screeninfo *var)
 {
 	switch (var->bits_per_pixel) {
 	    case 16:        /* RGB 565 */
+	    	pvr2fb_set_pal_type(PAL_RGB565);
 		var->red.offset = 11;    var->red.length = 5;
 		var->green.offset = 5;   var->green.length = 6;
 		var->blue.offset = 0;    var->blue.length = 5;
@@ -268,6 +307,7 @@
 		var->transp.offset = 0;  var->transp.length = 0;
 		break;
 	    case 32:        /* ARGB 8888 */
+	    	pvr2fb_set_pal_type(PAL_ARGB8888);
 		var->red.offset = 16;    var->red.length = 8;
 		var->green.offset = 8;   var->green.length = 8;
 		var->blue.offset = 0;    var->blue.length = 8;
@@ -276,31 +316,42 @@
 	}
 }
 
-static int pvr2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
-                            u_int transp, struct fb_info *info)
+static int pvr2fb_setcolreg(unsigned int regno, unsigned int red,
+			    unsigned int green, unsigned int blue,
+                            unsigned int transp, struct fb_info *info)
 {
-	if (regno > 255)
+	struct pvr2fb_par *par = (struct pvr2fb_par *)info->par;
+	unsigned int tmp;
+
+	if (regno > info->cmap.len)
 		return 1;
 
-	if (regno < 16) {
-		switch (info->var.bits_per_pixel) {
-		    case 16: /* RGB 565 */
-			((u16*)(info->pseudo_palette))[regno] = (red & 0xf800) |
-						((green & 0xfc00) >> 5) |
-						  ((blue & 0xf800) >> 11);
-			break;
-		    case 24: /* RGB 888 */
-			red >>= 8; green >>= 8; blue >>= 8;
-			((u32*)(info->pseudo_palette))[regno] = (red << 16) | (green << 8) | blue;
-			break;
-		    case 32: /* ARGB 8888 */
-			red >>= 8; green >>= 8; blue >>= 8;
-			((u32*)(info->pseudo_palette))[regno] = (transp << 24) |(red << 16) | (green << 8) | blue;
-			break;
-		    default:
-			DPRINTK("Invalid bit depth %d?!?\n", info->var.bits_per_pixel);
-			return 1;
-		}
+	/*
+	 * We only support the hardware palette for 16 and 32bpp. It's also
+	 * expected that the palette format has been set by the time we get
+	 * here, so we don't waste time setting it again.
+	 */
+	switch (info->var.bits_per_pixel) {
+	    case 16: /* RGB 565 */
+		tmp =  (red   & 0xf800)       |
+		      ((green & 0xfc00) >> 5) |
+		      ((blue  & 0xf800) >> 11);
+
+		pvr2fb_set_pal_entry(par, regno, tmp);
+		break;
+	    case 24: /* RGB 888 */
+		red >>= 8; green >>= 8; blue >>= 8;
+		((u32*)(info->pseudo_palette))[regno] = (red << 16) | (green << 8) | blue;
+		break;
+	    case 32: /* ARGB 8888 */
+		red >>= 8; green >>= 8; blue >>= 8;
+		tmp = (transp << 24) | (red << 16) | (green << 8) | blue;
+
+		pvr2fb_set_pal_entry(par, regno, tmp);
+		break;
+	    default:
+		pr_debug("Invalid bit depth %d?!?\n", info->var.bits_per_pixel);
+		return 1;
 	}
 
 	return 0;
@@ -310,8 +361,8 @@
 {
 	struct pvr2fb_par *par = (struct pvr2fb_par *)info->par;
 	struct fb_var_screeninfo *var = &info->var;
-	u_long line_length;
-	u_short vtotal;
+	unsigned long line_length;
+	unsigned int vtotal;
 
 	/*
 	 * XXX: It's possible that a user could use a VGA box, change the cable
@@ -378,18 +429,18 @@
 		par->is_lowres = 1;
 
 	line_length = get_line_length(var->xres_virtual, var->bits_per_pixel);
-	par->disp_start = videomemory + (line_length * var->yoffset) * line_length;
+	par->disp_start = info->fix.smem_start + (line_length * var->yoffset) * line_length;
 	info->fix.line_length = line_length;
 	return 0;
 }
 
 static int pvr2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 {
-	u_short vtotal, hsync_total;
-	u_long line_length;
+	unsigned int vtotal, hsync_total;
+	unsigned long line_length;
 
 	if (var->pixclock != TV_CLK || var->pixclock != VGA_CLK) {
-		DPRINTK("Invalid pixclock value %d\n", var->pixclock);
+		pr_debug("Invalid pixclock value %d\n", var->pixclock);
 		return -EINVAL;
 	}
 
@@ -447,21 +498,22 @@
 			/* PAL video output */
 			/* XXX: Should be using a range here ... ? */
 			if (hsync_total != PAL_HTOTAL) {
-				DPRINTK("invalid hsync total for PAL\n");
+				pr_debug("invalid hsync total for PAL\n");
 				return -EINVAL;
 			}
 		} else {
 			/* NTSC video output */
 			if (hsync_total != NTSC_HTOTAL) {
-				DPRINTK("invalid hsync total for NTSC\n");
+				pr_debug("invalid hsync total for NTSC\n");
 				return -EINVAL;
 			}
 		}
 	}
 	/* Check memory sizes */
 	line_length = get_line_length(var->xres_virtual, var->bits_per_pixel);
-	if (line_length * var->yres_virtual > videomemorysize)
+	if (line_length * var->yres_virtual > info->fix.smem_len)
 		return -ENOMEM;
+
 	return 0;
 }
 
@@ -471,8 +523,8 @@
 	struct fb_var_screeninfo *var = &info->var;
 
 	/* Update the start address of the display image */
-	ctrl_outl(par->disp_start, DISP_DIWADDRL);
-	ctrl_outl(par->disp_start +
+	fb_writel(par->disp_start, DISP_DIWADDRL);
+	fb_writel(par->disp_start +
 		  get_line_length(var->xoffset+var->xres, var->bits_per_pixel),
 	          DISP_DIWADDRS);
 }
@@ -487,11 +539,11 @@
 {
 	struct pvr2fb_par *par = (struct pvr2fb_par *) info->par;
 	struct fb_var_screeninfo *var = &info->var;
-	u_short diw_height, diw_width, diw_modulo = 1;
-	u_short bytesperpixel = var->bits_per_pixel >> 3;
+	unsigned int diw_height, diw_width, diw_modulo = 1;
+	unsigned int bytesperpixel = var->bits_per_pixel >> 3;
 
 	/* hsync and vsync totals */
-	ctrl_outl((par->vsync_total << 16) | par->hsync_total, DISP_SYNCSIZE);
+	fb_writel((par->vsync_total << 16) | par->hsync_total, DISP_SYNCSIZE);
 
 	/* column height, modulo, row width */
 	/* since we're "panning" within vram, we need to offset things based
@@ -500,37 +552,37 @@
 		diw_modulo += info->fix.line_length / 4;
 	diw_height = (par->is_interlaced ? var->yres / 2 : var->yres);
 	diw_width = get_line_length(var->xres, var->bits_per_pixel) / 4;
-	ctrl_outl((diw_modulo << 20) | (--diw_height << 10) | --diw_width,
+	fb_writel((diw_modulo << 20) | (--diw_height << 10) | --diw_width,
 	          DISP_DIWSIZE);
 
 	/* display address, long and short fields */
-	ctrl_outl(par->disp_start, DISP_DIWADDRL);
-	ctrl_outl(par->disp_start +
+	fb_writel(par->disp_start, DISP_DIWADDRL);
+	fb_writel(par->disp_start +
 	          get_line_length(var->xoffset+var->xres, var->bits_per_pixel),
 	          DISP_DIWADDRS);
 
 	/* border horizontal, border vertical, border color */
-	ctrl_outl((par->borderstart_h << 16) | par->borderstop_h, DISP_BRDRHORZ);
-	ctrl_outl((par->borderstart_v << 16) | par->borderstop_v, DISP_BRDRVERT);
-	ctrl_outl(0, DISP_BRDRCOLR);
+	fb_writel((par->borderstart_h << 16) | par->borderstop_h, DISP_BRDRHORZ);
+	fb_writel((par->borderstart_v << 16) | par->borderstop_v, DISP_BRDRVERT);
+	fb_writel(0, DISP_BRDRCOLR);
 
 	/* display window start position */
-	ctrl_outl(par->diwstart_h, DISP_DIWHSTRT);
-	ctrl_outl((par->diwstart_v << 16) | par->diwstart_v, DISP_DIWVSTRT);
+	fb_writel(par->diwstart_h, DISP_DIWHSTRT);
+	fb_writel((par->diwstart_v << 16) | par->diwstart_v, DISP_DIWVSTRT);
 	
 	/* misc. settings */
-	ctrl_outl((0x16 << 16) | par->is_lowres, DISP_DIWCONF);
+	fb_writel((0x16 << 16) | par->is_lowres, DISP_DIWCONF);
 
 	/* clock doubler (for VGA), scan doubler, display enable */
-	ctrl_outl(((video_output == VO_VGA) << 23) | 
+	fb_writel(((video_output == VO_VGA) << 23) | 
 	          (par->is_doublescan << 1) | 1, DISP_DIWMODE);
 
 	/* bits per pixel */
-	ctrl_outl(ctrl_inl(DISP_DIWMODE) | (--bytesperpixel << 2), DISP_DIWMODE);
+	fb_writel(fb_readl(DISP_DIWMODE) | (--bytesperpixel << 2), DISP_DIWMODE);
 
 	/* video enable, color sync, interlace, 
 	 * hsync and vsync polarity (currently unused) */
-	ctrl_outl(0x100 | ((par->is_interlaced /*|4*/) << 4), DISP_SYNCCONF);
+	fb_writel(0x100 | ((par->is_interlaced /*|4*/) << 4), DISP_SYNCCONF);
 }
 
 /* Simulate blanking by making the border cover the entire screen */
@@ -539,13 +591,14 @@
 
 static void pvr2_do_blank(void)
 {
-	u_long diwconf;
+	struct pvr2fb_par *par = currentpar;
+	unsigned long diwconf;
 
-	diwconf = ctrl_inl(DISP_DIWCONF);
+	diwconf = fb_readl(DISP_DIWCONF);
 	if (do_blank > 0)
-		ctrl_outl(diwconf | BLANK_BIT, DISP_DIWCONF);
+		fb_writel(diwconf | BLANK_BIT, DISP_DIWCONF);
 	else
-		ctrl_outl(diwconf & ~BLANK_BIT, DISP_DIWCONF);
+		fb_writel(diwconf & ~BLANK_BIT, DISP_DIWCONF);
 
 	is_blanked = do_blank > 0 ? do_blank : 0;
 }
@@ -581,76 +634,132 @@
 static int pvr2_init_cable(void)
 {
 	if (cable_type < 0) {
-		ctrl_outl((ctrl_inl(PCTRA) & 0xfff0ffff) | 0x000a0000, 
+		fb_writel((fb_readl(PCTRA) & 0xfff0ffff) | 0x000a0000, 
 	                  PCTRA);
-		cable_type = (ctrl_inw(PDTRA) >> 8) & 3;
+		cable_type = (fb_readw(PDTRA) >> 8) & 3;
 	}
 
 	/* Now select the output format (either composite or other) */
 	/* XXX: Save the previous val first, as this reg is also AICA
 	  related */
 	if (cable_type == CT_COMPOSITE)
-		ctrl_outl(3 << 8, VOUTC);
+		fb_writel(3 << 8, VOUTC);
 	else
-		ctrl_outl(0, VOUTC);
+		fb_writel(0, VOUTC);
 
 	return cable_type;
 }
 
-int __init pvr2fb_init(void)
+#ifdef CONFIG_SH_DMA
+static ssize_t pvr2fb_write(struct file *file, const char *buf,
+			    size_t count, loff_t *ppos)
 {
-	u_long modememused;
-	int err = -EINVAL;
+	unsigned long dst, start, end, len;
+	unsigned int nr_pages;
+	struct page **pages;
+	int ret, i;
 
-	if (!mach_is_dreamcast())
-		return -ENXIO;
+	nr_pages = (count + PAGE_SIZE - 1) >> PAGE_SHIFT;
 
-	fb_info = kmalloc(sizeof(struct fb_info) + sizeof(struct pvr2fb_par) +
-			  sizeof(u32) * 16, GFP_KERNEL);
-	
-	if (!fb_info) {
-		printk(KERN_ERR "Failed to allocate memory for fb_info\n");
+	pages = kmalloc(nr_pages * sizeof(struct page *), GFP_KERNEL);
+	if (!pages)
 		return -ENOMEM;
+	
+	down_read(&current->mm->mmap_sem);
+	ret = get_user_pages(current, current->mm, (unsigned long)buf,
+			     nr_pages, WRITE, 0, pages, NULL);
+	up_read(&current->mm->mmap_sem);
+
+	if (ret < nr_pages) {
+		nr_pages = ret;
+		ret = -EINVAL;
+		goto out_unmap;
 	}
 
-	memset(fb_info, 0, sizeof(fb_info) + sizeof(struct pvr2fb_par) + sizeof(u32) * 16);
+	dma_configure_channel(shdma, 0x12c1);
+	
+	dst   = (unsigned long)fb_info->screen_base + *ppos;
+	start = (unsigned long)page_address(pages[0]);
+	end   = (unsigned long)page_address(pages[nr_pages]);
+	len   = nr_pages << PAGE_SHIFT;
+
+	/* Half-assed contig check */
+	if (start + len == end) {
+		/* As we do this in one shot, it's either all or nothing.. */
+		if ((*ppos + len) > fb_info->fix.smem_len) {
+			ret = -ENOSPC;
+			goto out_unmap;
+		}
 
-	currentpar = (struct pvr2fb_par *)(fb_info + 1);
+		dma_write(shdma, start, 0, len);
+		dma_write(pvr2dma, 0, dst, len);
+		dma_wait_for_completion(pvr2dma);
 
-	/* Make a guess at the monitor based on the attached cable */
-	if (pvr2_init_cable() == CT_VGA) {
-		fb_info->monspecs.hfmin = 30000;
-		fb_info->monspecs.hfmax = 70000;
-		fb_info->monspecs.vfmin = 60;
-		fb_info->monspecs.vfmax = 60;
-	} else {
-		/* Not VGA, using a TV (taken from acornfb) */
-		fb_info->monspecs.hfmin = 15469;
-		fb_info->monspecs.hfmax = 15781;
-		fb_info->monspecs.vfmin = 49;
-		fb_info->monspecs.vfmax = 51;
+		goto out;
 	}
 
-	/*
-	 * XXX: This needs to pull default video output via BIOS or other means
-	 */
-	if (video_output < 0) {
-		if (cable_type == CT_VGA) {
-			video_output = VO_VGA;
-		} else {
-			video_output = VO_NTSC;
+	/* Not contiguous, writeout per-page instead.. */
+	for (i = 0; i < nr_pages; i++, dst += PAGE_SIZE) {
+		if ((*ppos + (i << PAGE_SHIFT)) > fb_info->fix.smem_len) {
+			ret = -ENOSPC;
+			goto out_unmap;
 		}
+
+		dma_write_page(shdma, (unsigned long)page_address(pages[i]), 0);
+		dma_write_page(pvr2dma, 0, dst);
+		dma_wait_for_completion(pvr2dma);
 	}
-	
-	pvr2_fix.smem_start = videomemory;
-	pvr2_fix.smem_len = videomemorysize;
+
+out:
+	*ppos += count;
+	ret = count;
+
+out_unmap:
+	for (i = 0; i < nr_pages; i++)
+		page_cache_release(pages[i]);
+
+	kfree(pages);
+
+	return ret;
+} 
+#endif /* CONFIG_SH_DMA */
+
+/**
+ * pvr2fb_common_init
+ *
+ * Common init code for the PVR2 chips.
+ *
+ * This mostly takes care of the common aspects of the fb setup and
+ * registration. It's expected that the board-specific init code has
+ * already setup pvr2_fix with something meaningful at this point.
+ *
+ * Device info reporting is also done here, as well as picking a sane
+ * default from the modedb. For board-specific modelines, simply define
+ * a per-board modedb.
+ *
+ * Also worth noting is that the cable and video output types are likely
+ * always going to be VGA for the PCI-based PVR2 boards, but we leave this
+ * in for flexibility anyways. Who knows, maybe someone has tv-out on a
+ * PCI-based version of these things ;-)
+ */
+static int __init pvr2fb_common_init(void)
+{
+	struct pvr2fb_par *par = currentpar;
+	unsigned long modememused, rev;
+	int size;
 
 	fb_info->screen_base = ioremap_nocache(pvr2_fix.smem_start,
 					       pvr2_fix.smem_len);
 	
 	if (!fb_info->screen_base) {
-		printk("Failed to remap MMIO space\n");
-		err = -ENXIO;
+		printk(KERN_ERR "pvr2fb: Failed to remap smem space\n");
+		goto out_err;
+	}
+
+	par->mmio_base = (unsigned long)ioremap_nocache(pvr2_fix.mmio_start,
+					 		pvr2_fix.mmio_len);
+	if (!par->mmio_base) {
+		printk(KERN_ERR "pvr2fb: Failed to remap mmio space\n");
 		goto out_err;
 	}
 
@@ -675,22 +784,21 @@
 	                  NUM_TOTAL_MODES, &pvr2_modedb[defmode], 16))
 		fb_info->var = pvr2_var;
 
-	if (request_irq(HW_EVENT_VSYNC, pvr2fb_interrupt, 0,
-	                "pvr2 VBL handler", fb_info)) {
-		err = -EBUSY;
-		goto out_err;
-	}
+	size = (fb_info->var.bits_per_pixel == 8) ? 256 : 16;
+	fb_alloc_cmap(&fb_info->cmap, size, 0);
 
 	if (register_framebuffer(fb_info) < 0)
-		goto reg_failed;
+		goto out_err;
 
 	modememused = get_line_length(fb_info->var.xres_virtual,
 				      fb_info->var.bits_per_pixel);
 	modememused *= fb_info->var.yres_virtual;
 
-	printk("fb%d: %s frame buffer device, using %ldk/%ldk of video memory\n",
-	       fb_info->node, fb_info->fix.id, modememused>>10,
-	       videomemorysize>>10);
+	rev = fb_readl(par->mmio_base + 0x04);
+
+	printk("fb%d: %s (rev %ld.%ld) frame buffer device, using %ldk/%ldk of video memory\n",
+	       fb_info->node, fb_info->fix.id, (rev >> 4) & 0x0f, rev & 0x0f,
+	       modememused >> 10, (unsigned long)(fb_info->fix.smem_len >> 10));
 	printk("fb%d: Mode %dx%d-%d pitch = %ld cable: %s video output: %s\n", 
 	       fb_info->node, fb_info->var.xres, fb_info->var.yres,
 	       fb_info->var.bits_per_pixel, 
@@ -698,23 +806,152 @@
 	       (char *)pvr2_get_param(cables, NULL, cable_type, 3),
 	       (char *)pvr2_get_param(outputs, NULL, video_output, 3));
 
+#ifdef CONFIG_SH_STORE_QUEUES
+	printk(KERN_NOTICE "fb%d: registering with SQ API\n", fb_info->node);
+
+	pvr2fb_map = sq_remap(fb_info->fix.smem_start, fb_info->fix.smem_len,
+			      fb_info->fix.id);
+
+	printk(KERN_NOTICE "fb%d: Mapped video memory to SQ addr 0x%lx\n",
+	       fb_info->node, pvr2fb_map->sq_addr);
+#endif
+
 	return 0;
 
-reg_failed:
-	free_irq(HW_EVENT_VSYNC, 0);
 out_err:
-	kfree(fb_info);
+	if (fb_info->screen_base)
+		iounmap(fb_info->screen_base);
+	if (par->mmio_base)
+		iounmap((void *)par->mmio_base);
 
-	return err;
+	return -ENXIO;
 }
 
-static void __exit pvr2fb_exit(void)
+#ifdef CONFIG_SH_DREAMCAST
+static int __init pvr2fb_dc_init(void)
+{
+	if (!mach_is_dreamcast())
+		return -ENXIO;
+
+	/* Make a guess at the monitor based on the attached cable */
+	if (pvr2_init_cable() == CT_VGA) {
+		fb_info->monspecs.hfmin = 30000;
+		fb_info->monspecs.hfmax = 70000;
+		fb_info->monspecs.vfmin = 60;
+		fb_info->monspecs.vfmax = 60;
+	} else {
+		/* Not VGA, using a TV (taken from acornfb) */
+		fb_info->monspecs.hfmin = 15469;
+		fb_info->monspecs.hfmax = 15781;
+		fb_info->monspecs.vfmin = 49;
+		fb_info->monspecs.vfmax = 51;
+	}
+
+	/*
+	 * XXX: This needs to pull default video output via BIOS or other means
+	 */
+	if (video_output < 0) {
+		if (cable_type == CT_VGA) {
+			video_output = VO_VGA;
+		} else {
+			video_output = VO_NTSC;
+		}
+	}
+	
+	/* 
+	 * Nothing exciting about the DC PVR2 .. only a measly 8MiB.
+	 */
+	pvr2_fix.smem_start	= 0xa5000000;	/* RAM starts here */
+	pvr2_fix.smem_len	= 8 << 20;
+
+	pvr2_fix.mmio_start	= 0xa05f8000;	/* registers start here */
+	pvr2_fix.mmio_len	= 0x2000;
+
+	if (request_irq(HW_EVENT_VSYNC, pvr2fb_interrupt, 0,
+	                "pvr2 VBL handler", fb_info)) {
+		return -EBUSY;
+	}
+
+#ifdef CONFIG_SH_DMA
+	if (request_dma(pvr2dma, "pvr2") != 0) {
+		free_irq(HW_EVENT_VSYNC, 0);
+		return -EBUSY;
+	}
+#endif
+
+	return pvr2fb_common_init();
+}
+
+static void pvr2fb_dc_exit(void)
 {
-	unregister_framebuffer(fb_info);
 	free_irq(HW_EVENT_VSYNC, 0);
-	kfree(fb_info);
+#ifdef CONFIG_SH_DMA
+	free_dma(pvr2dma);
+#endif
+}
+#endif /* CONFIG_SH_DREAMCAST */
+
+#ifdef CONFIG_PCI
+static int __devinit pvr2fb_pci_probe(struct pci_dev *pdev,
+				      const struct pci_device_id *ent)
+{
+	int ret;
+
+	ret = pci_enable_device(pdev);
+	if (ret) {
+		printk(KERN_ERR "pvr2fb: PCI enable failed\n");
+		return ret;
+	}
+
+	ret = pci_request_regions(pdev, "pvr2fb");
+	if (ret) {
+		printk(KERN_ERR "pvr2fb: PCI request regions failed\n");
+		return ret;
+	}
+
+	/*
+	 * Slightly more exciting than the DC PVR2 .. 16MiB!
+	 */
+	pvr2_fix.smem_start	= pci_resource_start(pdev, 0);
+	pvr2_fix.smem_len	= pci_resource_len(pdev, 0);
+
+	pvr2_fix.mmio_start	= pci_resource_start(pdev, 1);
+	pvr2_fix.mmio_len	= pci_resource_len(pdev, 1);
+
+	return pvr2fb_common_init();
+}
+
+static void __devexit pvr2fb_pci_remove(struct pci_dev *pdev)
+{
+	pci_release_regions(pdev);
+}
+
+static struct pci_device_id pvr2fb_pci_tbl[] __devinitdata = {
+	{ PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_NEON250,
+	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+	{ 0, },
+};
+
+MODULE_DEVICE_TABLE(pci, pvr2fb_pci_tbl);
+
+static struct pci_driver pvr2fb_pci_driver = {
+	.name		= "pvr2fb",
+	.id_table	= pvr2fb_pci_tbl,
+	.probe		= pvr2fb_pci_probe,
+	.remove		= __devexit_p(pvr2fb_pci_remove),
+};
+
+static int __init pvr2fb_pci_init(void)
+{
+	return pci_module_init(&pvr2fb_pci_driver);
 }
 
+static void pvr2fb_pci_exit(void)
+{
+	pci_unregister_driver(&pvr2fb_pci_driver);
+}
+#endif /* CONFIG_PCI */
+
 static int __init pvr2_get_param(const struct pvr2_params *p, const char *s,
                                    int val, int size)
 {
@@ -735,7 +972,6 @@
 /*
  * Parse command arguments.  Supported arguments are:
  *    inverse                             Use inverse color maps
- *    nomtrr                              Disable MTRR usage
  *    cable:composite|rgb|vga             Override the video cable type
  *    output:NTSC|PAL|VGA                 Override the video output format
  *
@@ -757,7 +993,6 @@
 		if (!*this_opt)
 			continue;
 		if (!strcmp(this_opt, "inverse")) {
-			pvr2fb_inverse = 1;
 			fb_invert_cmaps();
 		} else if (!strncmp(this_opt, "cable:", 6)) {
 			strcpy(cable_arg, this_opt + 6);
@@ -781,9 +1016,82 @@
 }
 #endif
 
+static struct pvr2_board {
+	int (*init)(void);
+	void (*exit)(void);
+	char name[16];
+} board_list[] = {
+#ifdef CONFIG_SH_DREAMCAST
+	{ pvr2fb_dc_init, pvr2fb_dc_exit, "Sega DC PVR2" },
+#endif
+#ifdef CONFIG_PCI
+	{ pvr2fb_pci_init, pvr2fb_pci_exit, "PCI PVR2" },
+#endif
+	{ 0, },
+};
+
+int __init pvr2fb_init(void)
+{
+	int i, ret = -ENODEV;
+	int size;
+
+	size = sizeof(struct fb_info) + sizeof(struct pvr2fb_par) + 16 * sizeof(u32);
+
+	fb_info = kmalloc(size, GFP_KERNEL);
+	
+	if (!fb_info) {
+		printk(KERN_ERR "Failed to allocate memory for fb_info\n");
+		return -ENOMEM;
+	}
+
+	memset(fb_info, 0, size);
+
+	currentpar = (struct pvr2fb_par *)(fb_info + 1);
+
+	for (i = 0; i < ARRAY_SIZE(board_list); i++) {
+		struct pvr2_board *pvr_board = board_list + i;
+
+		if (!pvr_board->init)
+			continue;
+
+		ret = pvr_board->init();
+
+		if (ret != 0) {
+			printk(KERN_ERR "pvr2fb: Failed init of %s device\n",
+				pvr_board->name);
+			kfree(fb_info);
+			break;
+		}
+	}
+
+	return ret;
+}
+
+static void __exit pvr2fb_exit(void)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(board_list); i++) {
+		struct pvr2_board *pvr_board = board_list + i;
+
+		if (pvr_board->exit)
+			pvr_board->exit();
+	}
+		
+#ifdef CONFIG_SH_STORE_QUEUES
+	sq_unmap(pvr2fb_map);
+#endif
+
+	unregister_framebuffer(fb_info);
+	kfree(fb_info);
+}
+
 #ifdef MODULE
-MODULE_LICENSE("GPL");
 module_init(pvr2fb_init);
 #endif
 module_exit(pvr2fb_exit);
+
+MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>, M. R. Brown <mrbrown@0xd6.org>");
+MODULE_DESCRIPTION("Framebuffer driver for NEC PowerVR 2 based graphics boards");
+MODULE_LICENSE("GPL");
 
diff -Nru a/drivers/video/radeonfb.c b/drivers/video/radeonfb.c
--- a/drivers/video/radeonfb.c	Tue Feb  3 19:45:42 2004
+++ b/drivers/video/radeonfb.c	Tue Feb  3 19:45:42 2004
@@ -114,6 +114,7 @@
 	RADEON_Ie,
 	RADEON_If,
 	RADEON_Ig,
+	RADEON_Yd,
 	RADEON_Ld,
 	RADEON_Le,
 	RADEON_Lf,
@@ -207,6 +208,7 @@
 	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Ie, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_Ie},
 	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_If, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_If},
 	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Ig, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_Ig},
+	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Yd, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_Yd},
 	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Ld, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_Ld},
 	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Le, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_Le},
 	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Lf, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_Lf},
@@ -679,7 +681,7 @@
  */
         
 static char *mode_option __initdata;
-static char noaccel = 1;
+static char noaccel = 0;
 static char mirror = 0;
 static int panel_yres __initdata = 0;
 static char force_dfp __initdata = 0;
@@ -1099,7 +1101,7 @@
 	printk("radeonfb: detected DFP panel size from BIOS: %dx%d\n",
 		rinfo->panel_xres, rinfo->panel_yres);
 
-	for(i=0; i<20; i++) {
+	for(i=0; i<32; i++) {
 		tmp0 = rinfo->bios_seg + readw(tmp+64+i*2);
 		if (tmp0 == 0)
 			break;
@@ -1241,9 +1243,6 @@
 	radeon_fifo_wait (1);
 	OUTREG(RB2D_DSTCACHE_MODE, 0);
 
-	/* XXX */
-	rinfo->pitch = ((rinfo->xres_virtual * (rinfo->bpp / 8) + 0x3f)) >> 6;
-
 	radeon_fifo_wait (1);
 	temp = INREG(DEFAULT_PITCH_OFFSET);
 	OUTREG(DEFAULT_PITCH_OFFSET, ((temp & 0xc0000000) | 
@@ -1782,6 +1781,7 @@
 	int hsync_start, hsync_fudge, bytpp, hsync_wid, vsync_wid;
 	int primary_mon = PRIMARY_MONITOR(rinfo);
 	int depth = var_to_depth(mode);
+        int accel = (mode->accel_flags & FB_ACCELF_TEXT) != 0;
 
 	rinfo->xres = mode->xres;
 	rinfo->yres = mode->yres;
@@ -1878,7 +1878,15 @@
 	newmode.crtc_v_sync_strt_wid = (((vSyncStart - 1) & 0xfff) |
 					 (vsync_wid << 16) | (v_sync_pol  << 23));
 
-	newmode.crtc_pitch = (mode->xres_virtual >> 3);
+	if (accel) {
+		/* We first calculate the engine pitch */
+		rinfo->pitch = ((mode->xres_virtual * ((mode->bits_per_pixel + 1) / 8) + 0x3f)
+ 				& ~(0x3f)) >> 6;
+
+		/* Then, re-multiply it to get the CRTC pitch */
+		newmode.crtc_pitch = (rinfo->pitch << 3) / ((mode->bits_per_pixel + 1) / 8);
+	} else
+		newmode.crtc_pitch = (mode->xres_virtual >> 3);
 	newmode.crtc_pitch |= (newmode.crtc_pitch << 16);
 
 #if defined(__BIG_ENDIAN)
@@ -2085,18 +2093,21 @@
 	if (!rinfo->asleep) {
 		radeon_write_mode (rinfo, &newmode);
 		/* (re)initialize the engine */
-		if (!noaccel)
+		if (noaccel)
 			radeon_engine_init (rinfo);
 	
 	}
 	/* Update fix */
-        info->fix.line_length = rinfo->pitch*64;
+	if (accel)
+        	info->fix.line_length = rinfo->pitch*64;
+        else
+		info->fix.line_length = mode->xres_virtual * ((mode->bits_per_pixel + 1) / 8);
         info->fix.visual = rinfo->depth == 8 ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR;
 
 #ifdef CONFIG_BOOTX_TEXT
 	/* Update debug text engine */
 	btext_update_display(rinfo->fb_base_phys, mode->xres, mode->yres,
-			     rinfo->depth, rinfo->pitch*64);
+			     rinfo->depth, info->fix.line_length);
 #endif
 
 	return 0;
@@ -2308,7 +2319,7 @@
 	lvds_gen_cntl |= (LVDS_BL_MOD_EN | LVDS_BLON);
 	if (on && (level > BACKLIGHT_OFF)) {
 		lvds_gen_cntl |= LVDS_DIGON;
-		if (!lvds_gen_cntl & LVDS_ON) {
+		if (!(lvds_gen_cntl & LVDS_ON)) {
 			lvds_gen_cntl &= ~LVDS_BLON;
 			OUTREG(LVDS_GEN_CNTL, lvds_gen_cntl);
 			(void)INREG(LVDS_GEN_CNTL);
@@ -3021,11 +3032,6 @@
 	 * so we can restore this upon __exit
 	 */
 	radeon_save_state (rinfo, &rinfo->init_state);
-
-	if (!noaccel) {
-		/* initialize the engine */
-		radeon_engine_init (rinfo);
-	}
 
 	/* set all the vital stuff */
 	radeon_set_fbinfo (rinfo);
diff -Nru a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
--- a/drivers/video/sa1100fb.c	Tue Feb  3 19:45:17 2004
+++ b/drivers/video/sa1100fb.c	Tue Feb  3 19:45:17 2004
@@ -326,54 +326,6 @@
 };
 #endif
 
-#ifdef CONFIG_SA1100_CERF
-static struct sa1100fb_mach_info cerf_info __initdata = {
-#if defined(CONFIG_CERF_LCD_72_A)
-	.pixclock	= 171521, 	.bpp		= 8,
-	.xres		= 640,		.yres		= 480,
-	.lccr0		= LCCR0_Color | LCCR0_Dual | LCCR0_Pas,
-	.lccr3		= LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2) |
-			  LCCR3_PixClkDiv(38),
-#elif defined(CONFIG_CERF_LCD_57_A)
-	.pixclock	= 171521, 	.bpp		= 8,
-	.xres		= 320,		.yres		= 240,
-	.lccr0		= LCCR0_Color | LCCR0_Sngl | LCCR0_Pas,
-	.lccr3		= LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2) |
-			  LCCR3_PixClkDiv(38),
-#elif defined(CONFIG_CERF_LCD_38_A)
-	.pixclock	= 171521, 	.bpp		= 8,
-	.xres		= 240,		.yres		= 320,
-	.lccr0		= LCCR0_Color | LCCR0_Sngl | LCCR0_Pas,
-	.lccr3		= LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(56) |
-			  LCCR3_PixClkDiv(38),
-#elif defined(CONFIG_CERF_LCD_38_B)
-	.pixclock	= 171521,	.bpp		= 4,
-	.xres		= 320,		.yres		= 240,
-	.lccr0		= LCCR0_Mono | LCCR0_4PixMono | LCCR0_Sngl | LCCR0_Pas,
-	.lccr3		= LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(56) |
-			  LCCR3_PixClkDiv(38),
-#else
-#error "Must have a CerfBoard LCD form factor selected"
-#endif
-
-	.hsync_len	= 5,		.vsync_len	= 1,
-	.left_margin	= 61,		.upper_margin	= 3,
-	.right_margin	= 9,		.lower_margin	= 0,
-
-	.sync		= FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
-
-};
-
-#if 0
-static struct sa1100fb_rgb cerf_rgb_16 = {
-	.red	= { .offset = 8,	.length = 4, },
-	.green	= { .offset = 4,	.length = 4, },
-	.blue	= { .offset = 0,	.length = 4, },
-	.transp	= { .offset = 0,	.length = 0, },
-};
-#endif
-#endif
-
 #ifdef CONFIG_SA1100_FREEBIRD
 #warning Please check this carefully
 static struct sa1100fb_mach_info freebird_info __initdata = {
@@ -683,11 +635,6 @@
 		inf = &brutus_info;
 	}
 #endif
-#ifdef CONFIG_SA1100_CERF
-	if (machine_is_cerf()) {
-		inf = &cerf_info;
-	}
-#endif
 #ifdef CONFIG_SA1100_FREEBIRD
 	if (machine_is_freebird()) {
 		inf = &freebird_info;
@@ -1293,10 +1240,6 @@
 			mask |= GPIO_LDD15 | GPIO_LDD14 | GPIO_LDD13 | GPIO_LDD12;
 
 	}
-
-	/* GPIO15 is used as a bypass for 3.8" displays */
-	if (machine_is_cerf())
-		mask |= GPIO_GPIO15;
 
 	if (mask) {
 		GPDR |= mask;
diff -Nru a/drivers/video/tridentfb.c b/drivers/video/tridentfb.c
--- a/drivers/video/tridentfb.c	Tue Feb  3 19:45:26 2004
+++ b/drivers/video/tridentfb.c	Tue Feb  3 19:45:26 2004
@@ -723,7 +723,7 @@
 	if (bpp == 24 )
 		bpp = var->bits_per_pixel = 32;
 	/* check whether resolution fits on panel and in memory*/
-	if (var->xres > nativex)
+	if (flatpanel && nativex && var->xres > nativex)
 		return -EINVAL;
 	if (var->xres * var->yres_virtual * bpp/8 > info->fix.smem_len)
 		return -EINVAL;
diff -Nru a/drivers/zorro/Makefile b/drivers/zorro/Makefile
--- a/drivers/zorro/Makefile	Tue Feb  3 19:45:17 2004
+++ b/drivers/zorro/Makefile	Tue Feb  3 19:45:17 2004
@@ -2,7 +2,7 @@
 # Makefile for the Zorro bus specific drivers.
 #
 
-obj-$(CONFIG_ZORRO)	+= zorro.o names.o
+obj-$(CONFIG_ZORRO)	+= zorro.o zorro-driver.o zorro-sysfs.o names.o
 obj-$(CONFIG_PROC_FS)	+= proc.o
 
 host-progs 		:= gen-devlist
diff -Nru a/drivers/zorro/proc.c b/drivers/zorro/proc.c
--- a/drivers/zorro/proc.c	Tue Feb  3 19:45:16 2004
+++ b/drivers/zorro/proc.c	Tue Feb  3 19:45:16 2004
@@ -3,7 +3,7 @@
  *
  *	Procfs interface for the Zorro bus.
  *
- *	Copyright (C) 1998-2000 Geert Uytterhoeven
+ *	Copyright (C) 1998-2003 Geert Uytterhoeven
  *
  *	Heavily based on the procfs interface for the PCI bus, which is
  *
@@ -49,7 +49,7 @@
 {
 	struct inode *ino = file->f_dentry->d_inode;
 	struct proc_dir_entry *dp = PDE(ino);
-	struct zorro_dev *dev = dp->data;
+	struct zorro_dev *z = dp->data;
 	struct ConfigDev cd;
 	loff_t pos = *ppos;
 
@@ -62,11 +62,11 @@
 
 	/* Construct a ConfigDev */
 	memset(&cd, 0, sizeof(cd));
-	cd.cd_Rom = dev->rom;
-	cd.cd_SlotAddr = dev->slotaddr;
-	cd.cd_SlotSize = dev->slotsize;
-	cd.cd_BoardAddr = (void *)dev->resource.start;
-	cd.cd_BoardSize = dev->resource.end-dev->resource.start+1;
+	cd.cd_Rom = z->rom;
+	cd.cd_SlotAddr = z->slotaddr;
+	cd.cd_SlotSize = z->slotsize;
+	cd.cd_BoardAddr = (void *)zorro_resource_start(z);
+	cd.cd_BoardSize = zorro_resource_len(z);
 
 	if (copy_to_user(buf, &cd, nbytes))
 		return -EFAULT;
@@ -88,11 +88,10 @@
 	int len, cnt;
 
 	for (slot = cnt = 0; slot < zorro_num_autocon && count > cnt; slot++) {
-		struct zorro_dev *dev = &zorro_autocon[slot];
+		struct zorro_dev *z = &zorro_autocon[slot];
 		len = sprintf(buf, "%02x\t%08x\t%08lx\t%08lx\t%02x\n", slot,
-			      dev->id, dev->resource.start,
-			      dev->resource.end-dev->resource.start+1,
-			      dev->rom.er_Type);
+			      z->id, zorro_resource_start(z),
+			      zorro_resource_len(z), z->rom.er_Type);
 		at += len;
 		if (at >= pos) {
 			if (!*start) {
diff -Nru a/drivers/zorro/zorro-driver.c b/drivers/zorro/zorro-driver.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/zorro/zorro-driver.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,150 @@
+/*
+ *  Zorro Driver Services
+ *
+ *  Copyright (C) 2003 Geert Uytterhoeven
+ *
+ *  Loosely based on drivers/pci/pci-driver.c
+ *
+ *  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.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/zorro.h>
+
+
+    /**
+     *  zorro_match_device - Tell if a Zorro device structure has a matching
+     *                       Zorro device id structure
+     *  @ids: array of Zorro device id structures to search in
+     *  @dev: the Zorro device structure to match against
+     *
+     *  Used by a driver to check whether a Zorro device present in the
+     *  system is in its list of supported devices. Returns the matching
+     *  zorro_device_id structure or %NULL if there is no match.
+     */
+
+const struct zorro_device_id *
+zorro_match_device(const struct zorro_device_id *ids,
+		   const struct zorro_dev *z)
+{
+	while (ids->id) {
+		if (ids->id == ZORRO_WILDCARD || ids->id == z->id)
+			return ids;
+		ids++;
+	}
+	return NULL;
+}
+
+
+static int zorro_device_probe(struct device *dev)
+{
+	int error = 0;
+	struct zorro_driver *drv = to_zorro_driver(dev->driver);
+	struct zorro_dev *z = to_zorro_dev(dev);
+
+	if (!z->driver && drv->probe) {
+		const struct zorro_device_id *id;
+
+		id = zorro_match_device(drv->id_table, z);
+		if (id)
+			error = drv->probe(z, id);
+		if (error >= 0) {
+			z->driver = drv;
+			error = 0;
+		}
+	}
+	return error;
+}
+
+
+    /**
+     *  zorro_register_driver - register a new Zorro driver
+     *  @drv: the driver structure to register
+     *
+     *  Adds the driver structure to the list of registered drivers
+     *  Returns the number of Zorro devices which were claimed by the driver
+     *  during registration.  The driver remains registered even if the
+     *  return value is zero.
+     */
+
+int zorro_register_driver(struct zorro_driver *drv)
+{
+	int count = 0;
+
+	/* initialize common driver fields */
+	drv->driver.name = drv->name;
+	drv->driver.bus = &zorro_bus_type;
+	drv->driver.probe = zorro_device_probe;
+
+	/* register with core */
+	count = driver_register(&drv->driver);
+	return count ? count : 1;
+}
+
+
+    /**
+     *  zorro_unregister_driver - unregister a zorro driver
+     *  @drv: the driver structure to unregister
+     *
+     *  Deletes the driver structure from the list of registered Zorro drivers,
+     *  gives it a chance to clean up by calling its remove() function for
+     *  each device it was responsible for, and marks those devices as
+     *  driverless.
+     */
+
+void zorro_unregister_driver(struct zorro_driver *drv)
+{
+	driver_unregister(&drv->driver);
+}
+
+
+    /**
+     *  zorro_bus_match - Tell if a Zorro device structure has a matching Zorro
+     *                    device id structure
+     *  @ids: array of Zorro device id structures to search in
+     *  @dev: the Zorro device structure to match against
+     *
+     *  Used by a driver to check whether a Zorro device present in the
+     *  system is in its list of supported devices.Returns the matching
+     *  zorro_device_id structure or %NULL if there is no match.
+     */
+
+static int zorro_bus_match(struct device *dev, struct device_driver *drv)
+{
+	struct zorro_dev *z = to_zorro_dev(dev);
+	struct zorro_driver *zorro_drv = to_zorro_driver(drv);
+	const struct zorro_device_id *ids = zorro_drv->id_table;
+
+	if (!ids)
+		return 0;
+
+	while (ids->id) {
+		if (ids->id == ZORRO_WILDCARD || ids->id == z->id)
+			return 1;
+		ids++;
+	}
+	return 0;
+}
+
+
+struct bus_type zorro_bus_type = {
+	.name	= "zorro",
+	.match	= zorro_bus_match
+};
+
+
+static int __init zorro_driver_init(void)
+{
+	return bus_register(&zorro_bus_type);
+}
+
+postcore_initcall(zorro_driver_init);
+
+EXPORT_SYMBOL(zorro_match_device);
+EXPORT_SYMBOL(zorro_register_driver);
+EXPORT_SYMBOL(zorro_unregister_driver);
+EXPORT_SYMBOL(zorro_dev_driver);
+EXPORT_SYMBOL(zorro_bus_type);
diff -Nru a/drivers/zorro/zorro-sysfs.c b/drivers/zorro/zorro-sysfs.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/zorro/zorro-sysfs.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,98 @@
+/*
+ *  File Attributes for Zorro Devices
+ *
+ *  Copyright (C) 2003 Geert Uytterhoeven
+ *
+ *  Loosely based on drivers/pci/pci-sysfs.c
+ *
+ *  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.
+ */
+
+
+#include <linux/kernel.h>
+#include <linux/zorro.h>
+#include <linux/stat.h>
+
+#include "zorro.h"
+
+
+/* show configuration fields */
+#define zorro_config_attr(name, field, format_string)			\
+static ssize_t								\
+show_##name(struct device *dev, char *buf)				\
+{									\
+	struct zorro_dev *z;						\
+									\
+	z = to_zorro_dev(dev);						\
+	return sprintf(buf, format_string, z->field);			\
+}									\
+static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL);
+
+zorro_config_attr(id, id, "0x%08x\n");
+zorro_config_attr(type, rom.er_Type, "0x%02x\n");
+zorro_config_attr(serial, rom.er_SerialNumber, "0x%08x\n");
+zorro_config_attr(slotaddr, slotaddr, "0x%04x\n");
+zorro_config_attr(slotsize, slotsize, "0x%04x\n");
+
+static ssize_t zorro_show_resource(struct device *dev, char *buf)
+{
+	struct zorro_dev *z = to_zorro_dev(dev);
+
+	return sprintf(buf, "0x%08lx 0x%08lx 0x%08lx\n",
+		       zorro_resource_start(z), zorro_resource_end(z),
+		       zorro_resource_flags(z));
+}
+
+static DEVICE_ATTR(resource, S_IRUGO, zorro_show_resource, NULL);
+
+static ssize_t zorro_read_config(struct kobject *kobj, char *buf, loff_t off,
+				 size_t count)
+{
+	struct zorro_dev *z = to_zorro_dev(container_of(kobj, struct device,
+					   kobj));
+	struct ConfigDev cd;
+	unsigned int size = sizeof(cd);
+
+	if (off > size)
+		return 0;
+	if (off+count > size)
+		count = size-off;
+
+	/* Construct a ConfigDev */
+	memset(&cd, 0, sizeof(cd));
+	cd.cd_Rom = z->rom;
+	cd.cd_SlotAddr = z->slotaddr;
+	cd.cd_SlotSize = z->slotsize;
+	cd.cd_BoardAddr = (void *)zorro_resource_start(z);
+	cd.cd_BoardSize = zorro_resource_len(z);
+
+	memcpy(buf, (void *)&cd+off, count);
+	return count;
+}
+
+static struct bin_attribute zorro_config_attr = {
+	.attr =	{
+		.name = "config",
+		.mode = S_IRUGO | S_IWUSR,
+		.owner = THIS_MODULE
+	},
+	.size = sizeof(struct ConfigDev),
+	.read = zorro_read_config,
+};
+
+void zorro_create_sysfs_dev_files(struct zorro_dev *z)
+{
+	struct device *dev = &z->dev;
+
+	/* current configuration's attributes */
+	device_create_file(dev, &dev_attr_id);
+	device_create_file(dev, &dev_attr_type);
+	device_create_file(dev, &dev_attr_serial);
+	device_create_file(dev, &dev_attr_slotaddr);
+	device_create_file(dev, &dev_attr_slotsize);
+	device_create_file(dev, &dev_attr_resource);
+	sysfs_create_bin_file(&dev->kobj, &zorro_config_attr);
+}
+
diff -Nru a/drivers/zorro/zorro.c b/drivers/zorro/zorro.c
--- a/drivers/zorro/zorro.c	Tue Feb  3 19:45:29 2004
+++ b/drivers/zorro/zorro.c	Tue Feb  3 19:45:29 2004
@@ -3,7 +3,7 @@
  *
  *    Zorro Bus Services
  *
- *    Copyright (C) 1995-2000 Geert Uytterhoeven
+ *    Copyright (C) 1995-2003 Geert Uytterhoeven
  *
  *    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
@@ -19,6 +19,8 @@
 #include <asm/bitops.h>
 #include <asm/amigahw.h>
 
+#include "zorro.h"
+
 
     /*
      *  Zorro Expansion Devices
@@ -29,21 +31,21 @@
 
 
     /*
-     *  Zorro Bus Resources
-     *  Order _does_ matter! (see code below)
+     *  Single Zorro bus
      */
 
-static struct resource zorro_res[4] = {
-    /* Zorro II regions (on Zorro II/III) */
-    { "Zorro II exp", 0x00e80000, 0x00efffff },
-    { "Zorro II mem", 0x00200000, 0x009fffff },
-    /* Zorro III regions (on Zorro III only) */
-    { "Zorro III exp", 0xff000000, 0xffffffff },
-    { "Zorro III cfg", 0x40000000, 0x7fffffff }
+struct zorro_bus zorro_bus = {\
+    .resources = {
+	/* Zorro II regions (on Zorro II/III) */
+	{ .name = "Zorro II exp", .start = 0x00e80000, .end = 0x00efffff },
+	{ .name = "Zorro II mem", .start = 0x00200000, .end = 0x009fffff },
+	/* Zorro III regions (on Zorro III only) */
+	{ .name = "Zorro III exp", .start = 0xff000000, .end = 0xffffffff },
+	{ .name = "Zorro III cfg", .start = 0x40000000, .end = 0x7fffffff }
+    },
+    .name = "Zorro bus"
 };
 
-static u_int zorro_num_res __initdata = 0;
-
 
     /*
      *  Find Zorro Devices
@@ -51,16 +53,16 @@
 
 struct zorro_dev *zorro_find_device(zorro_id id, struct zorro_dev *from)
 {
-    struct zorro_dev *dev;
+    struct zorro_dev *z;
 
     if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO))
 	return NULL;
 
-    for (dev = from ? from+1 : &zorro_autocon[0];
-	 dev < zorro_autocon+zorro_num_autocon;
-	 dev++)
-	if (id == ZORRO_WILDCARD || id == dev->id)
-	    return dev;
+    for (z = from ? from+1 : &zorro_autocon[0];
+	 z < zorro_autocon+zorro_num_autocon;
+	 z++)
+	if (id == ZORRO_WILDCARD || id == z->id)
+	    return z;
     return NULL;
 }
 
@@ -112,10 +114,10 @@
 {
     int i;
 
-    for (i = 0; i < zorro_num_res; i++)
-	if (z->resource.start >= zorro_res[i].start &&
-	    z->resource.end <= zorro_res[i].end)
-		return &zorro_res[i];
+    for (i = 0; i < zorro_bus.num_resources; i++)
+	if (zorro_resource_start(z) >= zorro_bus.resources[i].start &&
+	    zorro_resource_end(z) <= zorro_bus.resources[i].end)
+		return &zorro_bus.resources[i];
     return &iomem_resource;
 }
 
@@ -126,8 +128,8 @@
 
 static int __init zorro_init(void)
 {
-    struct zorro_dev *dev;
-    u_int i;
+    struct zorro_dev *z;
+    unsigned int i;
 
     if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO))
 	return 0;
@@ -135,32 +137,43 @@
     printk("Zorro: Probing AutoConfig expansion devices: %d device%s\n",
 	   zorro_num_autocon, zorro_num_autocon == 1 ? "" : "s");
 
+    /* Initialize the Zorro bus */
+    INIT_LIST_HEAD(&zorro_bus.devices);
+    strcpy(zorro_bus.dev.bus_id, "zorro");
+    device_register(&zorro_bus.dev);
+
     /* Request the resources */
-    zorro_num_res = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2;
-    for (i = 0; i < zorro_num_res; i++)
-	request_resource(&iomem_resource, &zorro_res[i]);
+    zorro_bus.num_resources = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2;
+    for (i = 0; i < zorro_bus.num_resources; i++)
+	request_resource(&iomem_resource, &zorro_bus.resources[i]);
+
+    /* Register all devices */
     for (i = 0; i < zorro_num_autocon; i++) {
-	dev = &zorro_autocon[i];
-	dev->id = (dev->rom.er_Manufacturer<<16) | (dev->rom.er_Product<<8);
-	if (dev->id == ZORRO_PROD_GVP_EPC_BASE) {
+	z = &zorro_autocon[i];
+	z->id = (z->rom.er_Manufacturer<<16) | (z->rom.er_Product<<8);
+	if (z->id == ZORRO_PROD_GVP_EPC_BASE) {
 	    /* GVP quirk */
-	    unsigned long magic = dev->resource.start+0x8000;
-	    dev->id |= *(u16 *)ZTWO_VADDR(magic) & GVP_PRODMASK;
+	    unsigned long magic = zorro_resource_start(z)+0x8000;
+	    z->id |= *(u16 *)ZTWO_VADDR(magic) & GVP_PRODMASK;
 	}
-	sprintf(dev->name, "Zorro device %08x", dev->id);
-	zorro_name_device(dev);
-	dev->resource.name = dev->name;
-	if (request_resource(zorro_find_parent_resource(dev), &dev->resource))
+	sprintf(z->name, "Zorro device %08x", z->id);
+	zorro_name_device(z);
+	z->resource.name = z->name;
+	if (request_resource(zorro_find_parent_resource(z), &z->resource))
 	    printk(KERN_ERR "Zorro: Address space collision on device %s "
 		   "[%lx:%lx]\n",
-		   dev->name, dev->resource.start, dev->resource.end);
+		   z->name, zorro_resource_start(z), zorro_resource_end(z));
+	sprintf(z->dev.bus_id, "%02x", i);
+	z->dev.parent = &zorro_bus.dev;
+	z->dev.bus = &zorro_bus_type;
+	device_register(&z->dev);
+	zorro_create_sysfs_dev_files(z);
     }
 
     /* Mark all available Zorro II memory */
-    for (i = 0; i < zorro_num_autocon; i++) {
-	dev = &zorro_autocon[i];
-	if (dev->rom.er_Type & ERTF_MEMLIST)
-	    mark_region(dev->resource.start, dev->resource.end+1, 1);
+    zorro_for_each_dev(z) {
+	if (z->rom.er_Type & ERTF_MEMLIST)
+	    mark_region(zorro_resource_start(z), zorro_resource_end(z)+1, 1);
     }
 
     /* Unmark all used Zorro II memory */
diff -Nru a/drivers/zorro/zorro.h b/drivers/zorro/zorro.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/zorro/zorro.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,4 @@
+
+extern void zorro_name_device(struct zorro_dev *z);
+extern void zorro_create_sysfs_dev_files(struct zorro_dev *z);
+
diff -Nru a/fs/afs/callback.c b/fs/afs/callback.c
--- a/fs/afs/callback.c	Tue Feb  3 19:45:29 2004
+++ b/fs/afs/callback.c	Tue Feb  3 19:45:29 2004
@@ -24,28 +24,28 @@
 /*
  * allow the fileserver to request callback state (re-)initialisation
  */
-int SRXAFSCM_InitCallBackState(afs_server_t *server)
+int SRXAFSCM_InitCallBackState(struct afs_server *server)
 {
 	struct list_head callbacks;
 
-	_enter("%p",server);
+	_enter("%p", server);
 
 	INIT_LIST_HEAD(&callbacks);
 
 	/* transfer the callback list from the server to a temp holding area */
 	spin_lock(&server->cb_lock);
 
-	list_add(&callbacks,&server->cb_promises);
+	list_add(&callbacks, &server->cb_promises);
 	list_del_init(&server->cb_promises);
 
-	/* munch our way through the list, grabbing the inode, dropping all the locks and regetting
-	 * them in the right order
+	/* munch our way through the list, grabbing the inode, dropping all the
+	 * locks and regetting them in the right order
 	 */
 	while (!list_empty(&callbacks)) {
+		struct afs_vnode *vnode;
 		struct inode *inode;
-		afs_vnode_t *vnode;
 
-		vnode = list_entry(callbacks.next,afs_vnode_t,cb_link);
+		vnode = list_entry(callbacks.next, struct afs_vnode, cb_link);
 		list_del_init(&vnode->cb_link);
 
 		/* try and grab the inode - may fail */
@@ -56,7 +56,7 @@
 			spin_unlock(&server->cb_lock);
 			spin_lock(&vnode->lock);
 
-			if (vnode->cb_server==server) {
+			if (vnode->cb_server == server) {
 				vnode->cb_server = NULL;
 				afs_kafstimod_del_timer(&vnode->cb_timeout);
 				spin_lock(&afs_cb_hash_lock);
@@ -84,15 +84,14 @@
 /*
  * allow the fileserver to break callback promises
  */
-int SRXAFSCM_CallBack(afs_server_t *server, size_t count, afs_callback_t callbacks[])
+int SRXAFSCM_CallBack(struct afs_server *server, size_t count,
+		      struct afs_callback callbacks[])
 {
-	struct list_head *_p;
+	_enter("%p,%u,", server, count);
 
-	_enter("%p,%u,",server,count);
-
-	for (; count>0; callbacks++, count--) {
+	for (; count > 0; callbacks++, count--) {
+		struct afs_vnode *vnode = NULL;
 		struct inode *inode = NULL;
-		afs_vnode_t *vnode = NULL;
 		int valid = 0;
 
 		_debug("- Fid { vl=%08x n=%u u=%u }  CB { v=%u x=%u t=%u }",
@@ -107,14 +106,15 @@
 		/* find the inode for this fid */
 		spin_lock(&afs_cb_hash_lock);
 
-		list_for_each(_p,&afs_cb_hash(server,&callbacks->fid)) {
-			vnode = list_entry(_p,afs_vnode_t,cb_hash_link);
-
-			if (memcmp(&vnode->fid,&callbacks->fid,sizeof(afs_fid_t))!=0)
+		list_for_each_entry(vnode,
+				    &afs_cb_hash(server, &callbacks->fid),
+				    cb_hash_link) {
+			if (memcmp(&vnode->fid, &callbacks->fid,
+				   sizeof(struct afs_fid)) != 0)
 				continue;
 
 			/* right vnode, but is it same server? */
-			if (vnode->cb_server!=server)
+			if (vnode->cb_server != server)
 				break; /* no */
 
 			/* try and nail the inode down */
@@ -127,7 +127,7 @@
 		if (inode) {
 			/* we've found the record for this vnode */
 			spin_lock(&vnode->lock);
-			if (vnode->cb_server==server) {
+			if (vnode->cb_server == server) {
 				/* the callback _is_ on the calling server */
 				vnode->cb_server = NULL;
 				valid = 1;
@@ -161,8 +161,8 @@
 /*
  * allow the fileserver to see if the cache manager is still alive
  */
-int SRXAFSCM_Probe(afs_server_t *server)
+int SRXAFSCM_Probe(struct afs_server *server)
 {
-	_debug("SRXAFSCM_Probe(%p)\n",server);
+	_debug("SRXAFSCM_Probe(%p)\n", server);
 	return 0;
 } /* end SRXAFSCM_Probe() */
diff -Nru a/fs/afs/cell.c b/fs/afs/cell.c
--- a/fs/afs/cell.c	Tue Feb  3 19:45:16 2004
+++ b/fs/afs/cell.c	Tue Feb  3 19:45:16 2004
@@ -29,20 +29,16 @@
 static struct list_head afs_cells = LIST_HEAD_INIT(afs_cells);
 static rwlock_t afs_cells_lock = RW_LOCK_UNLOCKED;
 static DECLARE_RWSEM(afs_cells_sem); /* add/remove serialisation */
-static afs_cell_t *afs_cell_root;
-
-static char *rootcell;
-
-MODULE_PARM(rootcell,"s");
-MODULE_PARM_DESC(rootcell,"root AFS cell name and VL server IP addr list");
+static struct afs_cell *afs_cell_root;
 
 #ifdef AFS_CACHING_SUPPORT
-static cachefs_match_val_t afs_cell_cache_match(void *target, const void *entry);
+static cachefs_match_val_t afs_cell_cache_match(void *target,
+						const void *entry);
 static void afs_cell_cache_update(void *source, void *entry);
 
 struct cachefs_index_def afs_cache_cell_index_def = {
 	.name			= "cell_ix",
-	.data_size		= sizeof(afs_cell_t),
+	.data_size		= sizeof(struct afs_cache_cell),
 	.keys[0]		= { CACHEFS_INDEX_KEYS_ASCIIZ, 64 },
 	.match			= afs_cell_cache_match,
 	.update			= afs_cell_cache_update,
@@ -55,27 +51,27 @@
  * - "name" is the name of the cell
  * - "vllist" is a colon separated list of IP addresses in "a.b.c.d" format
  */
-int afs_cell_create(const char *name, char *vllist, afs_cell_t **_cell)
+int afs_cell_create(const char *name, char *vllist, struct afs_cell **_cell)
 {
-	afs_cell_t *cell;
+	struct afs_cell *cell;
 	char *next;
 	int ret;
 
-	_enter("%s",name);
+	_enter("%s", name);
 
-	if (!name) BUG(); /* TODO: want to look up "this cell" in the cache */
-
-	down_write(&afs_cells_sem);
+	BUG_ON(!name); /* TODO: want to look up "this cell" in the cache */
 
 	/* allocate and initialise a cell record */
-	cell = kmalloc(sizeof(afs_cell_t) + strlen(name) + 1,GFP_KERNEL);
+	cell = kmalloc(sizeof(struct afs_cell) + strlen(name) + 1, GFP_KERNEL);
 	if (!cell) {
 		_leave(" = -ENOMEM");
 		return -ENOMEM;
 	}
 
-	memset(cell,0,sizeof(afs_cell_t));
-	atomic_set(&cell->usage,0);
+	down_write(&afs_cells_sem);
+
+	memset(cell, 0, sizeof(struct afs_cell));
+	atomic_set(&cell->usage, 0);
 
 	INIT_LIST_HEAD(&cell->link);
 
@@ -96,26 +92,27 @@
 	do {
 		unsigned a, b, c, d;
 
-		next = strchr(vllist,':');
-		if (next) *next++ = 0;
+		next = strchr(vllist, ':');
+		if (next)
+			*next++ = 0;
 
-		if (sscanf(vllist,"%u.%u.%u.%u",&a,&b,&c,&d)!=4)
+		if (sscanf(vllist, "%u.%u.%u.%u", &a, &b, &c, &d) != 4)
 			goto badaddr;
 
-		if (a>255 || b>255 || c>255 || d>255)
+		if (a > 255 || b > 255 || c > 255 || d > 255)
 			goto badaddr;
 
 		cell->vl_addrs[cell->vl_naddrs++].s_addr =
-			htonl((a<<24)|(b<<16)|(c<<8)|d);
+			htonl((a << 24) | (b << 16) | (c << 8) | d);
 
 		if (cell->vl_naddrs >= AFS_CELL_MAX_ADDRS)
 			break;
 
-	} while(vllist=next, vllist);
+	} while(vllist = next, vllist);
 
 	/* add a proc dir for this cell */
 	ret = afs_proc_cell_setup(cell);
-	if (ret<0)
+	if (ret < 0)
 		goto error;
 
 #ifdef AFS_CACHING_SUPPORT
@@ -128,24 +125,25 @@
 
 	/* add to the cell lists */
 	write_lock(&afs_cells_lock);
-	list_add_tail(&cell->link,&afs_cells);
+	list_add_tail(&cell->link, &afs_cells);
 	write_unlock(&afs_cells_lock);
 
 	down_write(&afs_proc_cells_sem);
-	list_add_tail(&cell->proc_link,&afs_proc_cells);
+	list_add_tail(&cell->proc_link, &afs_proc_cells);
 	up_write(&afs_proc_cells_sem);
 
 	*_cell = cell;
 	up_write(&afs_cells_sem);
 
-	_leave(" = 0 (%p)",cell);
+	_leave(" = 0 (%p)", cell);
 	return 0;
 
  badaddr:
-	printk("kAFS: bad VL server IP address: '%s'\n",vllist);
+	printk(KERN_ERR "kAFS: bad VL server IP address: '%s'\n", vllist);
  error:
 	up_write(&afs_cells_sem);
-	kfree(afs_cell_root);
+	kfree(cell);
+	_leave(" = %d", ret);
 	return ret;
 } /* end afs_cell_create() */
 
@@ -153,31 +151,54 @@
 /*
  * initialise the cell database from module parameters
  */
-int afs_cell_init(void)
+int afs_cell_init(char *rootcell)
 {
+	struct afs_cell *old_root, *new_root;
 	char *cp;
 	int ret;
 
 	_enter("");
 
 	if (!rootcell) {
-		printk("kAFS: no root cell specified\n");
-		return -EINVAL;
+		/* module is loaded with no parameters, or built statically.
+		 * - in the future we might initialize cell DB here.
+		 */
+		_leave(" = 0 (but no root)");
+		return 0;
 	}
 
-	cp = strchr(rootcell,':');
+	cp = strchr(rootcell, ':');
 	if (!cp) {
-		printk("kAFS: no VL server IP addresses specified\n");
+		printk(KERN_ERR "kAFS: no VL server IP addresses specified\n");
+		_leave(" = %d (no colon)", -EINVAL);
 		return -EINVAL;
 	}
 
 	/* allocate a cell record for the root cell */
 	*cp++ = 0;
-	ret = afs_cell_create(rootcell,cp,&afs_cell_root);
-	if (ret==0)
-		afs_get_cell(afs_cell_root);
+	ret = afs_cell_create(rootcell, cp, &new_root);
+	if (ret < 0) {
+		_leave(" = %d", ret);
+		return ret;
+	}
 
-	_leave(" = %d",ret);
+	/* as afs_put_cell() takes locks by itself, we have to do
+	 * a little gymnastics to be race-free.
+	 */
+	afs_get_cell(new_root);
+
+	write_lock(&afs_cells_lock);
+	while (afs_cell_root) {
+		old_root = afs_cell_root;
+		afs_cell_root = NULL;
+		write_unlock(&afs_cells_lock);
+		afs_put_cell(old_root);
+		write_lock(&afs_cells_lock);
+	}
+	afs_cell_root = new_root;
+	write_unlock(&afs_cells_lock);
+
+	_leave(" = %d", ret);
 	return ret;
 
 } /* end afs_cell_init() */
@@ -188,8 +209,7 @@
  */
 int afs_cell_lookup(const char *name, unsigned namesz, struct afs_cell **_cell)
 {
-	struct list_head *_p;
-	afs_cell_t *cell;
+	struct afs_cell *cell;
 	int ret;
 
 	_enter("\"%*.*s\",", namesz, namesz, name ? name : "");
@@ -202,14 +222,14 @@
 		cell = NULL;
 		read_lock(&afs_cells_lock);
 
-		list_for_each(_p,&afs_cells) {
-			cell = list_entry(_p, struct afs_cell, link);
+		list_for_each_entry(cell, &afs_cells, link) {
 			if (strncmp(cell->name, name, namesz) == 0) {
 				afs_get_cell(cell);
-				break;
+				goto found;
 			}
-			cell = NULL;
 		}
+		cell = NULL;
+	found:
 
 		read_unlock(&afs_cells_lock);
 
@@ -217,9 +237,24 @@
 			ret = 0;
 	}
 	else {
+		read_lock(&afs_cells_lock);
+
 		cell = afs_cell_root;
-		afs_get_cell(cell);
-		ret = 0;
+		if (!cell) {
+			/* this should not happen unless user tries to mount
+			 * when root cell is not set. Return an impossibly
+			 * bizzare errno to alert the user. Things like
+			 * ENOENT might be "more appropriate" but they happen
+			 * for other reasons.
+			 */
+			ret = -EDESTADDRREQ;
+		}
+		else {
+			afs_get_cell(cell);
+			ret = 0;
+		}
+
+		read_unlock(&afs_cells_lock);
 	}
 
 	*_cell = cell;
@@ -232,9 +267,9 @@
 /*
  * try and get a cell record
  */
-afs_cell_t *afs_get_cell_maybe(afs_cell_t **_cell)
+struct afs_cell *afs_get_cell_maybe(struct afs_cell **_cell)
 {
-	afs_cell_t *cell;
+	struct afs_cell *cell;
 
 	write_lock(&afs_cells_lock);
 
@@ -253,18 +288,18 @@
 /*
  * destroy a cell record
  */
-void afs_put_cell(afs_cell_t *cell)
+void afs_put_cell(struct afs_cell *cell)
 {
 	if (!cell)
 		return;
 
-	_enter("%p{%d,%s}",cell,atomic_read(&cell->usage),cell->name);
+	_enter("%p{%d,%s}", cell, atomic_read(&cell->usage), cell->name);
 
 	/* sanity check */
-	if (atomic_read(&cell->usage)<=0)
-		BUG();
+	BUG_ON(atomic_read(&cell->usage) <= 0);
 
-	/* to prevent a race, the decrement and the dequeue must be effectively atomic */
+	/* to prevent a race, the decrement and the dequeue must be effectively
+	 * atomic */
 	write_lock(&afs_cells_lock);
 
 	if (likely(!atomic_dec_and_test(&cell->usage))) {
@@ -275,10 +310,10 @@
 
 	write_unlock(&afs_cells_lock);
 
-	if (!list_empty(&cell->sv_list))	BUG();
-	if (!list_empty(&cell->sv_graveyard))	BUG();
-	if (!list_empty(&cell->vl_list))	BUG();
-	if (!list_empty(&cell->vl_graveyard))	BUG();
+	BUG_ON(!list_empty(&cell->sv_list));
+	BUG_ON(!list_empty(&cell->sv_graveyard));
+	BUG_ON(!list_empty(&cell->vl_list));
+	BUG_ON(!list_empty(&cell->vl_graveyard));
 
 	_leave(" [unused]");
 } /* end afs_put_cell() */
@@ -287,16 +322,16 @@
 /*
  * destroy a cell record
  */
-static void afs_cell_destroy(afs_cell_t *cell)
+static void afs_cell_destroy(struct afs_cell *cell)
 {
-	_enter("%p{%d,%s}",cell,atomic_read(&cell->usage),cell->name);
+	_enter("%p{%d,%s}", cell, atomic_read(&cell->usage), cell->name);
 
-	/* to prevent a race, the decrement and the dequeue must be effectively atomic */
+	/* to prevent a race, the decrement and the dequeue must be effectively
+	 * atomic */
 	write_lock(&afs_cells_lock);
 
 	/* sanity check */
-	if (atomic_read(&cell->usage)!=0)
-		BUG();
+	BUG_ON(atomic_read(&cell->usage) != 0);
 
 	list_del_init(&cell->link);
 
@@ -311,15 +346,15 @@
 	up_write(&afs_proc_cells_sem);
 
 #ifdef AFS_CACHING_SUPPORT
-	cachefs_relinquish_cookie(cell->cache,0);
+	cachefs_relinquish_cookie(cell->cache, 0);
 #endif
 
 	up_write(&afs_cells_sem);
 
-	if (!list_empty(&cell->sv_list))	BUG();
-	if (!list_empty(&cell->sv_graveyard))	BUG();
-	if (!list_empty(&cell->vl_list))	BUG();
-	if (!list_empty(&cell->vl_graveyard))	BUG();
+	BUG_ON(!list_empty(&cell->sv_list));
+	BUG_ON(!list_empty(&cell->sv_graveyard));
+	BUG_ON(!list_empty(&cell->vl_list));
+	BUG_ON(!list_empty(&cell->vl_graveyard));
 
 	/* finish cleaning up the cell */
 	kfree(cell);
@@ -331,42 +366,40 @@
 /*
  * lookup the server record corresponding to an Rx RPC peer
  */
-int afs_server_find_by_peer(const struct rxrpc_peer *peer, afs_server_t **_server)
+int afs_server_find_by_peer(const struct rxrpc_peer *peer,
+			    struct afs_server **_server)
 {
-	struct list_head *_pc, *_ps;
-	afs_server_t *server;
-	afs_cell_t *cell;
+	struct afs_server *server;
+	struct afs_cell *cell;
 
-	_enter("%p{a=%08x},",peer,ntohl(peer->addr.s_addr));
+	_enter("%p{a=%08x},", peer, ntohl(peer->addr.s_addr));
 
 	/* search the cell list */
 	read_lock(&afs_cells_lock);
 
-	list_for_each(_pc,&afs_cells) {
-		cell = list_entry(_pc,afs_cell_t,link);
+	list_for_each_entry(cell, &afs_cells, link) {
 
 		_debug("? cell %s",cell->name);
 
 		write_lock(&cell->sv_lock);
 
 		/* check the active list */
-		list_for_each(_ps,&cell->sv_list) {
-			server = list_entry(_ps,afs_server_t,link);
-
-			_debug("?? server %08x",ntohl(server->addr.s_addr));
+		list_for_each_entry(server, &cell->sv_list, link) {
+			_debug("?? server %08x", ntohl(server->addr.s_addr));
 
-			if (memcmp(&server->addr,&peer->addr,sizeof(struct in_addr))==0)
+			if (memcmp(&server->addr, &peer->addr,
+				   sizeof(struct in_addr)) == 0)
 				goto found_server;
 		}
 
 		/* check the inactive list */
 		spin_lock(&cell->sv_gylock);
-		list_for_each(_ps,&cell->sv_graveyard) {
-			server = list_entry(_ps,afs_server_t,link);
-
-			_debug("?? dead server %08x",ntohl(server->addr.s_addr));
+		list_for_each_entry(server, &cell->sv_graveyard, link) {
+			_debug("?? dead server %08x",
+			       ntohl(server->addr.s_addr));
 
-			if (memcmp(&server->addr,&peer->addr,sizeof(struct in_addr))==0)
+			if (memcmp(&server->addr, &peer->addr,
+				   sizeof(struct in_addr)) == 0)
 				goto found_dead_server;
 		}
 		spin_unlock(&cell->sv_gylock);
@@ -381,7 +414,7 @@
 	/* we found it in the graveyard - resurrect it */
  found_dead_server:
 	list_del(&server->link);
-	list_add_tail(&server->link,&cell->sv_list);
+	list_add_tail(&server->link, &cell->sv_list);
 	afs_get_server(server);
 	afs_kafstimod_del_timer(&server->timeout);
 	spin_unlock(&cell->sv_gylock);
@@ -396,20 +429,20 @@
 	read_unlock(&afs_cells_lock);
 
 	*_server = server;
-	_leave(" = 0 (s=%p c=%p)",server,cell);
+	_leave(" = 0 (s=%p c=%p)", server, cell);
 	return 0;
 
 } /* end afs_server_find_by_peer() */
 
 /*****************************************************************************/
 /*
- * purge in-memory cell database on module unload
+ * purge in-memory cell database on module unload or afs_init() failure
  * - the timeout daemon is stopped before calling this
  */
 void afs_cell_purge(void)
 {
-	afs_vlocation_t *vlocation;
-	afs_cell_t *cell;
+	struct afs_vlocation *vlocation;
+	struct afs_cell *cell;
 
 	_enter("");
 
@@ -422,17 +455,19 @@
 		write_lock(&afs_cells_lock);
 
 		if (!list_empty(&afs_cells)) {
-			cell = list_entry(afs_cells.next,afs_cell_t,link);
+			cell = list_entry(afs_cells.next,
+					  struct afs_cell, link);
 			list_del_init(&cell->link);
 		}
 
 		write_unlock(&afs_cells_lock);
 
 		if (cell) {
-			_debug("PURGING CELL %s (%d)",cell->name,atomic_read(&cell->usage));
+			_debug("PURGING CELL %s (%d)",
+			       cell->name, atomic_read(&cell->usage));
 
-			if (!list_empty(&cell->sv_list)) BUG();
-			if (!list_empty(&cell->vl_list)) BUG();
+			BUG_ON(!list_empty(&cell->sv_list));
+			BUG_ON(!list_empty(&cell->vl_list));
 
 			/* purge the cell's VL graveyard list */
 			_debug(" - clearing VL graveyard");
@@ -441,7 +476,8 @@
 
 			while (!list_empty(&cell->vl_graveyard)) {
 				vlocation = list_entry(cell->vl_graveyard.next,
-						       afs_vlocation_t,link);
+						       struct afs_vlocation,
+						       link);
 				list_del_init(&vlocation->link);
 
 				afs_kafstimod_del_timer(&vlocation->timeout);
@@ -449,7 +485,8 @@
 				spin_unlock(&cell->vl_gylock);
 
 				afs_vlocation_do_timeout(vlocation);
-				/* TODO: race if move to use krxtimod instead of kafstimod */
+				/* TODO: race if move to use krxtimod instead
+				 * of kafstimod */
 
 				spin_lock(&cell->vl_gylock);
 			}
@@ -462,9 +499,10 @@
 			spin_lock(&cell->sv_gylock);
 
 			while (!list_empty(&cell->sv_graveyard)) {
-				afs_server_t *server;
+				struct afs_server *server;
 
-				server = list_entry(cell->sv_graveyard.next,afs_server_t,link);
+				server = list_entry(cell->sv_graveyard.next,
+						    struct afs_server, link);
 				list_del_init(&server->link);
 
 				afs_kafstimod_del_timer(&server->timeout);
@@ -491,7 +529,8 @@
  * match a cell record obtained from the cache
  */
 #ifdef AFS_CACHING_SUPPORT
-static cachefs_match_val_t afs_cell_cache_match(void *target, const void *entry)
+static cachefs_match_val_t afs_cell_cache_match(void *target,
+						const void *entry)
 {
 	const struct afs_cache_cell *ccell = entry;
 	struct afs_cell *cell = target;
diff -Nru a/fs/afs/cell.h b/fs/afs/cell.h
--- a/fs/afs/cell.h	Tue Feb  3 19:45:42 2004
+++ b/fs/afs/cell.h	Tue Feb  3 19:45:42 2004
@@ -61,7 +61,7 @@
 	char			name[0];	/* cell name - must go last */
 };
 
-extern int afs_cell_init(void);
+extern int afs_cell_init(char *rootcell);
 
 extern int afs_cell_create(const char *name, char *vllist, struct afs_cell **_cell);
 
diff -Nru a/fs/afs/cmservice.c b/fs/afs/cmservice.c
--- a/fs/afs/cmservice.c	Tue Feb  3 19:45:17 2004
+++ b/fs/afs/cmservice.c	Tue Feb  3 19:45:17 2004
@@ -94,7 +94,7 @@
 	.error_func	= afscm_error,
 	.aemap_func	= afscm_aemap,
 	.ops_begin	= &AFSCM_ops[0],
-	.ops_end	= &AFSCM_ops[sizeof(AFSCM_ops)/sizeof(AFSCM_ops[0])],
+	.ops_end	= &AFSCM_ops[sizeof(AFSCM_ops) / sizeof(AFSCM_ops[0])],
 };
 
 static DECLARE_COMPLETION(kafscmd_alive);
@@ -112,13 +112,13 @@
  */
 static int kafscmd(void *arg)
 {
-	DECLARE_WAITQUEUE(myself,current);
+	DECLARE_WAITQUEUE(myself, current);
 
 	struct rxrpc_call *call;
 	_SRXAFSCM_xxxx_t func;
 	int die;
 
-	printk("kAFS: Started kafscmd %d\n",current->pid);
+	printk("kAFS: Started kafscmd %d\n", current->pid);
 
 	daemonize("kafscmd");
 
@@ -128,7 +128,7 @@
 	do {
 		if (list_empty(&kafscmd_attention_list)) {
 			set_current_state(TASK_INTERRUPTIBLE);
-			add_wait_queue(&kafscmd_sleepq,&myself);
+			add_wait_queue(&kafscmd_sleepq, &myself);
 
 			for (;;) {
 				set_current_state(TASK_INTERRUPTIBLE);
@@ -140,7 +140,7 @@
 				schedule();
 			}
 
-			remove_wait_queue(&kafscmd_sleepq,&myself);
+			remove_wait_queue(&kafscmd_sleepq, &myself);
 			set_current_state(TASK_RUNNING);
 		}
 
@@ -162,7 +162,7 @@
 
 		if (call) {
 			/* act upon it */
-			_debug("@@@ Begin Attend Call %p",call);
+			_debug("@@@ Begin Attend Call %p", call);
 
 			func = call->app_user;
 			if (func)
@@ -170,13 +170,13 @@
 
 			rxrpc_put_call(call);
 
-			_debug("@@@ End Attend Call %p",call);
+			_debug("@@@ End Attend Call %p", call);
 		}
 
 	} while(!die);
 
 	/* and that's all */
-	complete_and_exit(&kafscmd_dead,0);
+	complete_and_exit(&kafscmd_dead, 0);
 
 } /* end kafscmd() */
 
@@ -184,12 +184,14 @@
 /*
  * handle a call coming in to the cache manager
  * - if I want to keep the call, I must increment its usage count
- * - the return value will be negated and passed back in an abort packet if non-zero
+ * - the return value will be negated and passed back in an abort packet if
+ *   non-zero
  * - serialised by virtue of there only being one krxiod
  */
 static int afscm_new_call(struct rxrpc_call *call)
 {
-	_enter("%p{cid=%u u=%d}",call,ntohl(call->call_id),atomic_read(&call->usage));
+	_enter("%p{cid=%u u=%d}",
+	       call, ntohl(call->call_id), atomic_read(&call->usage));
 
 	rxrpc_get_call(call);
 
@@ -209,12 +211,13 @@
  */
 static void afscm_attention(struct rxrpc_call *call)
 {
-	_enter("%p{cid=%u u=%d}",call,ntohl(call->call_id),atomic_read(&call->usage));
+	_enter("%p{cid=%u u=%d}",
+	       call, ntohl(call->call_id), atomic_read(&call->usage));
 
 	spin_lock(&kafscmd_attention_lock);
 
 	if (list_empty(&call->app_attn_link)) {
-		list_add_tail(&call->app_attn_link,&kafscmd_attention_list);
+		list_add_tail(&call->app_attn_link, &kafscmd_attention_list);
 		rxrpc_get_call(call);
 	}
 
@@ -222,7 +225,7 @@
 
 	wake_up(&kafscmd_sleepq);
 
-	_leave(" {u=%d}",atomic_read(&call->usage));
+	_leave(" {u=%d}", atomic_read(&call->usage));
 } /* end afscm_attention() */
 
 /*****************************************************************************/
@@ -243,7 +246,7 @@
 	spin_lock(&kafscmd_attention_lock);
 
 	if (list_empty(&call->app_attn_link)) {
-		list_add_tail(&call->app_attn_link,&kafscmd_attention_list);
+		list_add_tail(&call->app_attn_link, &kafscmd_attention_list);
 		rxrpc_get_call(call);
 	}
 
@@ -301,7 +304,7 @@
 		wait_for_completion(&kafscmd_alive);
 
 		ret = rxrpc_add_service(afs_transport, &AFSCM_service);
-		if (ret<0)
+		if (ret < 0)
 			goto kill;
 
 #ifdef AFS_AUTOMOUNT_SUPPORT
@@ -336,14 +339,15 @@
 
 	down_write(&afscm_sem);
 
-	if (afscm_usage == 0) BUG();
+	BUG_ON(afscm_usage == 0);
 	afscm_usage--;
 
 	if (afscm_usage == 0) {
 		/* don't want more incoming calls */
 		rxrpc_del_service(afs_transport, &AFSCM_service);
 
-		/* abort any calls I've still got open (the afscm_error() will dequeue them) */
+		/* abort any calls I've still got open (the afscm_error() will
+		 * dequeue them) */
 		spin_lock(&afscm_calls_lock);
 		while (!list_empty(&afscm_calls)) {
 			call = list_entry(afscm_calls.next,
@@ -354,7 +358,8 @@
 			rxrpc_get_call(call);
 			spin_unlock(&afscm_calls_lock);
 
-			rxrpc_call_abort(call,-ESRCH); /* abort, dequeue and put */
+			rxrpc_call_abort(call, -ESRCH); /* abort, dequeue and
+							 * put */
 
 			_debug("nuking active call %08x.%d",
 			       ntohl(call->conn->conn_id),
@@ -402,11 +407,11 @@
  */
 static void _SRXAFSCM_CallBack(struct rxrpc_call *call)
 {
-	afs_server_t *server;
+	struct afs_server *server;
 	size_t count, qty, tmp;
 	int ret = 0, removed;
 
-	_enter("%p{acs=%s}",call,rxrpc_call_states[call->app_call_state]);
+	_enter("%p{acs=%s}", call, rxrpc_call_states[call->app_call_state]);
 
 	server = afs_server_get_from_peer(call->conn->peer);
 
@@ -417,38 +422,41 @@
 	case RXRPC_CSTATE_SRVR_GOT_ARGS:
 		ret = -EBADMSG;
 		qty = call->app_ready_qty;
-		if (qty<8 || qty>50*(6*4)+8)
+		if (qty < 8 || qty > 50 * (6 * 4) + 8)
 			break;
 
 		{
-			afs_callback_t *cb, *pcb;
+			struct afs_callback *cb, *pcb;
 			int loop;
 			u32 *fp, *bp;
 
-			fp = rxrpc_call_alloc_scratch(call,qty);
+			fp = rxrpc_call_alloc_scratch(call, qty);
 
-			/* drag the entire argument block out to the scratch space */
-			ret = rxrpc_call_read_data(call,fp,qty,0);
-			if (ret<0)
+			/* drag the entire argument block out to the scratch
+			 * space */
+			ret = rxrpc_call_read_data(call, fp, qty, 0);
+			if (ret < 0)
 				break;
 
 			/* and unmarshall the parameter block */
 			ret = -EBADMSG;
 			count = ntohl(*fp++);
 			if (count>AFSCBMAX ||
-			    (count*(3*4)+8 != qty && count*(6*4)+8 != qty))
+			    (count * (3 * 4) + 8 != qty &&
+			     count * (6 * 4) + 8 != qty))
 				break;
 
 			bp = fp + count*3;
 			tmp = ntohl(*bp++);
-			if (tmp>0 && tmp!=count)
+			if (tmp > 0 && tmp != count)
 				break;
-			if (tmp==0)
+			if (tmp == 0)
 				bp = NULL;
 
-			pcb = cb = rxrpc_call_alloc_scratch_s(call,afs_callback_t);
+			pcb = cb = rxrpc_call_alloc_scratch_s(
+				call, struct afs_callback);
 
-			for (loop=count-1; loop>=0; loop--) {
+			for (loop = count - 1; loop >= 0; loop--) {
 				pcb->fid.vid	= ntohl(*fp++);
 				pcb->fid.vnode	= ntohl(*fp++);
 				pcb->fid.unique	= ntohl(*fp++);
@@ -466,14 +474,15 @@
 			}
 
 			/* invoke the actual service routine */
-			ret = SRXAFSCM_CallBack(server,count,cb);
-			if (ret<0)
+			ret = SRXAFSCM_CallBack(server, count, cb);
+			if (ret < 0)
 				break;
 		}
 
 		/* send the reply */
-		ret = rxrpc_call_write_data(call,0,NULL,RXRPC_LAST_PACKET,GFP_KERNEL,0,&count);
-		if (ret<0)
+		ret = rxrpc_call_write_data(call, 0, NULL, RXRPC_LAST_PACKET,
+					    GFP_KERNEL, 0, &count);
+		if (ret < 0)
 			break;
 		break;
 
@@ -501,12 +510,12 @@
 		break;
 	}
 
-	if (ret<0)
-		rxrpc_call_abort(call,ret);
+	if (ret < 0)
+		rxrpc_call_abort(call, ret);
 
 	afs_put_server(server);
 
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 
 } /* end _SRXAFSCM_CallBack() */
 
@@ -516,16 +525,17 @@
  */
 static void _SRXAFSCM_InitCallBackState(struct rxrpc_call *call)
 {
-	afs_server_t *server;
+	struct afs_server *server;
 	size_t count;
 	int ret = 0, removed;
 
-	_enter("%p{acs=%s}",call,rxrpc_call_states[call->app_call_state]);
+	_enter("%p{acs=%s}", call, rxrpc_call_states[call->app_call_state]);
 
 	server = afs_server_get_from_peer(call->conn->peer);
 
 	switch (call->app_call_state) {
-		/* we've received the last packet - drain all the data from the call */
+		/* we've received the last packet - drain all the data from the
+		 * call */
 	case RXRPC_CSTATE_SRVR_GOT_ARGS:
 		/* shouldn't be any args */
 		ret = -EBADMSG;
@@ -535,11 +545,12 @@
 	case RXRPC_CSTATE_SRVR_SND_REPLY:
 		/* invoke the actual service routine */
 		ret = SRXAFSCM_InitCallBackState(server);
-		if (ret<0)
+		if (ret < 0)
 			break;
 
-		ret = rxrpc_call_write_data(call,0,NULL,RXRPC_LAST_PACKET,GFP_KERNEL,0,&count);
-		if (ret<0)
+		ret = rxrpc_call_write_data(call, 0, NULL, RXRPC_LAST_PACKET,
+					    GFP_KERNEL, 0, &count);
+		if (ret < 0)
 			break;
 		break;
 
@@ -567,12 +578,12 @@
 		break;
 	}
 
-	if (ret<0)
-		rxrpc_call_abort(call,ret);
+	if (ret < 0)
+		rxrpc_call_abort(call, ret);
 
 	afs_put_server(server);
 
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 
 } /* end _SRXAFSCM_InitCallBackState() */
 
@@ -582,16 +593,17 @@
  */
 static void _SRXAFSCM_Probe(struct rxrpc_call *call)
 {
-	afs_server_t *server;
+	struct afs_server *server;
 	size_t count;
 	int ret = 0, removed;
 
-	_enter("%p{acs=%s}",call,rxrpc_call_states[call->app_call_state]);
+	_enter("%p{acs=%s}", call, rxrpc_call_states[call->app_call_state]);
 
 	server = afs_server_get_from_peer(call->conn->peer);
 
 	switch (call->app_call_state) {
-		/* we've received the last packet - drain all the data from the call */
+		/* we've received the last packet - drain all the data from the
+		 * call */
 	case RXRPC_CSTATE_SRVR_GOT_ARGS:
 		/* shouldn't be any args */
 		ret = -EBADMSG;
@@ -601,11 +613,12 @@
 	case RXRPC_CSTATE_SRVR_SND_REPLY:
 		/* invoke the actual service routine */
 		ret = SRXAFSCM_Probe(server);
-		if (ret<0)
+		if (ret < 0)
 			break;
 
-		ret = rxrpc_call_write_data(call,0,NULL,RXRPC_LAST_PACKET,GFP_KERNEL,0,&count);
-		if (ret<0)
+		ret = rxrpc_call_write_data(call, 0, NULL, RXRPC_LAST_PACKET,
+					    GFP_KERNEL, 0, &count);
+		if (ret < 0)
 			break;
 		break;
 
@@ -633,11 +646,11 @@
 		break;
 	}
 
-	if (ret<0)
-		rxrpc_call_abort(call,ret);
+	if (ret < 0)
+		rxrpc_call_abort(call, ret);
 
 	afs_put_server(server);
 
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 
 } /* end _SRXAFSCM_Probe() */
diff -Nru a/fs/afs/cmservice.h b/fs/afs/cmservice.h
--- a/fs/afs/cmservice.h	Tue Feb  3 19:45:17 2004
+++ b/fs/afs/cmservice.h	Tue Feb  3 19:45:17 2004
@@ -20,8 +20,10 @@
 extern void afscm_stop(void);
 
 /* cache manager server functions */
-extern int SRXAFSCM_InitCallBackState(afs_server_t *server);
-extern int SRXAFSCM_CallBack(afs_server_t *server, size_t count, afs_callback_t callbacks[]);
-extern int SRXAFSCM_Probe(afs_server_t *server);
+extern int SRXAFSCM_InitCallBackState(struct afs_server *server);
+extern int SRXAFSCM_CallBack(struct afs_server *server,
+			     size_t count,
+			     struct afs_callback callbacks[]);
+extern int SRXAFSCM_Probe(struct afs_server *server);
 
 #endif /* _LINUX_AFS_CMSERVICE_H */
diff -Nru a/fs/afs/dir.c b/fs/afs/dir.c
--- a/fs/afs/dir.c	Tue Feb  3 19:45:17 2004
+++ b/fs/afs/dir.c	Tue Feb  3 19:45:17 2004
@@ -29,8 +29,8 @@
 static int afs_dir_readdir(struct file *file, void *dirent, filldir_t filldir);
 static int afs_d_revalidate(struct dentry *dentry, struct nameidata *nd);
 static int afs_d_delete(struct dentry *dentry);
-static int afs_dir_lookup_filldir(void *_cookie, const char *name, int nlen, loff_t fpos,
-				     ino_t ino, unsigned dtype);
+static int afs_dir_lookup_filldir(void *_cookie, const char *name, int nlen,
+				  loff_t fpos, ino_t ino, unsigned dtype);
 
 struct file_operations afs_dir_file_operations = {
 	.open		= afs_dir_open,
@@ -61,51 +61,53 @@
 #define AFS_DIR_DIRENT_SIZE	32
 #define AFS_DIRENT_PER_BLOCK	64
 
-typedef union afs_dirent {
+union afs_dirent {
 	struct {
-		u8	valid;
-		u8	unused[1];
-		u16	hash_next;
-		u32	vnode;
-		u32	unique;
-		u8	name[16];
-		u8	overflow[4];	/* if any char of the name (inc NUL) reaches here, consume
-					 * the next dirent too */
+		uint8_t		valid;
+		uint8_t		unused[1];
+		uint16_t	hash_next;
+		uint32_t	vnode;
+		uint32_t	unique;
+		uint8_t		name[16];
+		uint8_t		overflow[4];	/* if any char of the name (inc
+						 * NUL) reaches here, consume
+						 * the next dirent too */
 	} u;
-	u8	extended_name[32];
-} afs_dirent_t;
+	uint8_t	extended_name[32];
+};
 
 /* AFS directory page header (one at the beginning of every 2048-byte chunk) */
-typedef struct afs_dir_pagehdr {
-	u16	npages;
-	u16	magic;
+struct afs_dir_pagehdr {
+	uint16_t	npages;
+	uint16_t	magic;
 #define AFS_DIR_MAGIC htons(1234)
-	u8	nentries;
-	u8	bitmap[8];
-	u8	pad[19];
-} afs_dir_pagehdr_t;
+	uint8_t		nentries;
+	uint8_t		bitmap[8];
+	uint8_t		pad[19];
+};
 
 /* directory block layout */
-typedef union afs_dir_block {
+union afs_dir_block {
 
-	afs_dir_pagehdr_t pagehdr;
+	struct afs_dir_pagehdr pagehdr;
 
 	struct {
-		afs_dir_pagehdr_t pagehdr;
-		u8		alloc_ctrs[128];
-		u16		hashtable[AFS_DIR_HASHTBL_SIZE]; /* dir hash table */
+		struct afs_dir_pagehdr	pagehdr;
+		uint8_t			alloc_ctrs[128];
+		/* dir hash table */
+		uint16_t		hashtable[AFS_DIR_HASHTBL_SIZE];
 	} hdr;
 
-	afs_dirent_t dirents[AFS_DIRENT_PER_BLOCK];
-} afs_dir_block_t;
+	union afs_dirent dirents[AFS_DIRENT_PER_BLOCK];
+};
 
 /* layout on a linux VM page */
-typedef struct afs_dir_page {
-	afs_dir_block_t	blocks[PAGE_SIZE/sizeof(afs_dir_block_t)];
-} afs_dir_page_t;
+struct afs_dir_page {
+	union afs_dir_block blocks[PAGE_SIZE / sizeof(union afs_dir_block)];
+};
 
 struct afs_dir_lookup_cookie {
-	afs_fid_t	fid;
+	struct afs_fid	fid;
 	const char	*name;
 	size_t		nlen;
 	int		found;
@@ -117,14 +119,14 @@
  */
 static inline void afs_dir_check_page(struct inode *dir, struct page *page)
 {
-	afs_dir_page_t *dbuf;
+	struct afs_dir_page *dbuf;
 	loff_t latter;
 	int tmp, qty;
 
 #if 0
 	/* check the page count */
-	qty = desc.size/sizeof(dbuf->blocks[0]);
-	if (qty==0)
+	qty = desc.size / sizeof(dbuf->blocks[0]);
+	if (qty == 0)
 		goto error;
 
 	if (page->index==0 && qty!=ntohs(dbuf->blocks[0].pagehdr.npages)) {
@@ -140,15 +142,15 @@
 		qty = PAGE_SIZE;
 	else
 		qty = latter;
-	qty /= sizeof(afs_dir_block_t);
+	qty /= sizeof(union afs_dir_block);
 
 	/* check them */
 	dbuf = page_address(page);
-	for (tmp=0; tmp<qty; tmp++) {
+	for (tmp = 0; tmp < qty; tmp++) {
 		if (dbuf->blocks[tmp].pagehdr.magic != AFS_DIR_MAGIC) {
 			printk("kAFS: %s(%lu): bad magic %d/%d is %04hx\n",
-			       __FUNCTION__,dir->i_ino,tmp,
-			       qty,ntohs(dbuf->blocks[tmp].pagehdr.magic));
+			       __FUNCTION__, dir->i_ino, tmp, qty,
+			       ntohs(dbuf->blocks[tmp].pagehdr.magic));
 			goto error;
 		}
 	}
@@ -181,17 +183,18 @@
 {
 	struct page *page;
 
-	_enter("{%lu},%lu",dir->i_ino,index);
+	_enter("{%lu},%lu", dir->i_ino, index);
 
 	page = read_cache_page(dir->i_mapping,index,
-			       (filler_t*)dir->i_mapping->a_ops->readpage,NULL);
+			       (filler_t *) dir->i_mapping->a_ops->readpage,
+			       NULL);
 	if (!IS_ERR(page)) {
 		wait_on_page_locked(page);
 		kmap(page);
 		if (!PageUptodate(page))
 			goto fail;
 		if (!PageChecked(page))
-			afs_dir_check_page(dir,page);
+			afs_dir_check_page(dir, page);
 		if (PageError(page))
 			goto fail;
 	}
@@ -208,10 +211,10 @@
  */
 static int afs_dir_open(struct inode *inode, struct file *file)
 {
-	_enter("{%lu}",inode->i_ino);
+	_enter("{%lu}", inode->i_ino);
 
-	if (sizeof(afs_dir_block_t) != 2048) BUG();
-	if (sizeof(afs_dirent_t) != 32) BUG();
+	BUG_ON(sizeof(union afs_dir_block) != 2048);
+	BUG_ON(sizeof(union afs_dirent) != 32);
 
 	if (AFS_FS_I(inode)->flags & AFS_VNODE_DELETED)
 		return -ENOENT;
@@ -226,19 +229,19 @@
  * deal with one block in an AFS directory
  */
 static int afs_dir_iterate_block(unsigned *fpos,
-				    afs_dir_block_t *block,
-				    unsigned blkoff,
-				    void *cookie,
-				    filldir_t filldir)
+				 union afs_dir_block *block,
+				 unsigned blkoff,
+				 void *cookie,
+				 filldir_t filldir)
 {
-	afs_dirent_t *dire;
+	union afs_dirent *dire;
 	unsigned offset, next, curr;
 	size_t nlen;
 	int tmp, ret;
 
 	_enter("%u,%x,%p,,",*fpos,blkoff,block);
 
-	curr = (*fpos - blkoff) / sizeof(afs_dirent_t);
+	curr = (*fpos - blkoff) / sizeof(union afs_dirent);
 
 	/* walk through the block, an entry at a time */
 	for (offset = AFS_DIRENT_PER_BLOCK - block->pagehdr.nentries;
@@ -248,58 +251,70 @@
 		next = offset + 1;
 
 		/* skip entries marked unused in the bitmap */
-		if (!(block->pagehdr.bitmap[offset/8] & (1 << (offset % 8)))) {
-			_debug("ENT[%Zu.%u]: unused\n",blkoff/sizeof(afs_dir_block_t),offset);
-			if (offset>=curr)
-				*fpos = blkoff + next * sizeof(afs_dirent_t);
+		if (!(block->pagehdr.bitmap[offset / 8] &
+		      (1 << (offset % 8)))) {
+			_debug("ENT[%Zu.%u]: unused\n",
+			       blkoff / sizeof(union afs_dir_block), offset);
+			if (offset >= curr)
+				*fpos = blkoff +
+					next * sizeof(union afs_dirent);
 			continue;
 		}
 
 		/* got a valid entry */
 		dire = &block->dirents[offset];
-		nlen = strnlen(dire->u.name,sizeof(*block) - offset*sizeof(afs_dirent_t));
+		nlen = strnlen(dire->u.name,
+			       sizeof(*block) -
+			       offset * sizeof(union afs_dirent));
 
 		_debug("ENT[%Zu.%u]: %s %Zu \"%s\"\n",
-		       blkoff/sizeof(afs_dir_block_t),offset,
-		       (offset<curr ? "skip" : "fill"),
-		       nlen,dire->u.name);
+		       blkoff / sizeof(union afs_dir_block), offset,
+		       (offset < curr ? "skip" : "fill"),
+		       nlen, dire->u.name);
 
 		/* work out where the next possible entry is */
-		for (tmp=nlen; tmp>15; tmp-=sizeof(afs_dirent_t)) {
-			if (next>=AFS_DIRENT_PER_BLOCK) {
+		for (tmp = nlen; tmp > 15; tmp -= sizeof(union afs_dirent)) {
+			if (next >= AFS_DIRENT_PER_BLOCK) {
 				_debug("ENT[%Zu.%u]:"
-				       " %u travelled beyond end dir block (len %u/%Zu)\n",
-				       blkoff/sizeof(afs_dir_block_t),offset,next,tmp,nlen);
+				       " %u travelled beyond end dir block"
+				       " (len %u/%Zu)\n",
+				       blkoff / sizeof(union afs_dir_block),
+				       offset, next, tmp, nlen);
 				return -EIO;
 			}
-			if (!(block->pagehdr.bitmap[next/8] & (1 << (next % 8)))) {
-				_debug("ENT[%Zu.%u]: %u unmarked extension (len %u/%Zu)\n",
-				       blkoff/sizeof(afs_dir_block_t),offset,next,tmp,nlen);
+			if (!(block->pagehdr.bitmap[next / 8] &
+			      (1 << (next % 8)))) {
+				_debug("ENT[%Zu.%u]:"
+				       " %u unmarked extension (len %u/%Zu)\n",
+				       blkoff / sizeof(union afs_dir_block),
+				       offset, next, tmp, nlen);
 				return -EIO;
 			}
 
 			_debug("ENT[%Zu.%u]: ext %u/%Zu\n",
-			       blkoff/sizeof(afs_dir_block_t),next,tmp,nlen);
+			       blkoff / sizeof(union afs_dir_block),
+			       next, tmp, nlen);
 			next++;
 		}
 
 		/* skip if starts before the current position */
-		if (offset<curr)
+		if (offset < curr)
 			continue;
 
 		/* found the next entry */
 		ret = filldir(cookie,
 			      dire->u.name,
 			      nlen,
-			      blkoff + offset * sizeof(afs_dirent_t),
+			      blkoff + offset * sizeof(union afs_dirent),
 			      ntohl(dire->u.vnode),
-			      filldir==afs_dir_lookup_filldir ? dire->u.unique : DT_UNKNOWN);
-		if (ret<0) {
+			      filldir == afs_dir_lookup_filldir ?
+			      dire->u.unique : DT_UNKNOWN);
+		if (ret < 0) {
 			_leave(" = 0 [full]");
 			return 0;
 		}
 
-		*fpos = blkoff + next * sizeof(afs_dirent_t);
+		*fpos = blkoff + next * sizeof(union afs_dirent);
 	}
 
 	_leave(" = 1 [more]");
@@ -310,15 +325,16 @@
 /*
  * read an AFS directory
  */
-static int afs_dir_iterate(struct inode *dir, unsigned *fpos, void *cookie, filldir_t filldir)
+static int afs_dir_iterate(struct inode *dir, unsigned *fpos, void *cookie,
+			   filldir_t filldir)
 {
-	afs_dir_block_t	*dblock;
-	afs_dir_page_t *dbuf;
+	union afs_dir_block	*dblock;
+	struct afs_dir_page *dbuf;
 	struct page *page;
 	unsigned blkoff, limit;
 	int ret;
 
-	_enter("{%lu},%u,,",dir->i_ino,*fpos);
+	_enter("{%lu},%u,,", dir->i_ino, *fpos);
 
 	if (AFS_FS_I(dir)->flags & AFS_VNODE_DELETED) {
 		_leave(" = -ESTALE");
@@ -326,35 +342,37 @@
 	}
 
 	/* round the file position up to the next entry boundary */
-	*fpos += sizeof(afs_dirent_t) - 1;
-	*fpos &= ~(sizeof(afs_dirent_t) - 1);
+	*fpos += sizeof(union afs_dirent) - 1;
+	*fpos &= ~(sizeof(union afs_dirent) - 1);
 
 	/* walk through the blocks in sequence */
 	ret = 0;
 	while (*fpos < dir->i_size) {
-		blkoff = *fpos & ~(sizeof(afs_dir_block_t) - 1);
+		blkoff = *fpos & ~(sizeof(union afs_dir_block) - 1);
 
 		/* fetch the appropriate page from the directory */
-		page = afs_dir_get_page(dir,blkoff/PAGE_SIZE);
+		page = afs_dir_get_page(dir, blkoff / PAGE_SIZE);
 		if (IS_ERR(page)) {
 			ret = PTR_ERR(page);
 			break;
 		}
 
-		limit = blkoff & ~(PAGE_SIZE-1);
+		limit = blkoff & ~(PAGE_SIZE - 1);
 
 		dbuf = page_address(page);
 
 		/* deal with the individual blocks stashed on this page */
 		do {
-			dblock = &dbuf->blocks[(blkoff % PAGE_SIZE) / sizeof(afs_dir_block_t)];
-			ret = afs_dir_iterate_block(fpos,dblock,blkoff,cookie,filldir);
-			if (ret!=1) {
+			dblock = &dbuf->blocks[(blkoff % PAGE_SIZE) /
+					       sizeof(union afs_dir_block)];
+			ret = afs_dir_iterate_block(fpos, dblock, blkoff,
+						    cookie, filldir);
+			if (ret != 1) {
 				afs_dir_put_page(page);
 				goto out;
 			}
 
-			blkoff += sizeof(afs_dir_block_t);
+			blkoff += sizeof(union afs_dir_block);
 
 		} while (*fpos < dir->i_size && blkoff < limit);
 
@@ -363,7 +381,7 @@
 	}
 
  out:
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 } /* end afs_dir_iterate() */
 
@@ -376,29 +394,31 @@
 	unsigned fpos;
 	int ret;
 
-	_enter("{%Ld,{%lu}}",file->f_pos,file->f_dentry->d_inode->i_ino);
+	_enter("{%Ld,{%lu}}", file->f_pos, file->f_dentry->d_inode->i_ino);
 
 	fpos = file->f_pos;
-	ret = afs_dir_iterate(file->f_dentry->d_inode,&fpos,cookie,filldir);
+	ret = afs_dir_iterate(file->f_dentry->d_inode, &fpos, cookie, filldir);
 	file->f_pos = fpos;
 
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 } /* end afs_dir_readdir() */
 
 /*****************************************************************************/
 /*
  * search the directory for a name
- * - if afs_dir_iterate_block() spots this function, it'll pass the FID uniquifier through dtype
+ * - if afs_dir_iterate_block() spots this function, it'll pass the FID
+ *   uniquifier through dtype
  */
-static int afs_dir_lookup_filldir(void *_cookie, const char *name, int nlen, loff_t fpos,
-				  ino_t ino, unsigned dtype)
+static int afs_dir_lookup_filldir(void *_cookie, const char *name, int nlen,
+				  loff_t fpos, ino_t ino, unsigned dtype)
 {
 	struct afs_dir_lookup_cookie *cookie = _cookie;
 
-	_enter("{%s,%Zu},%s,%u,,%lu,%u",cookie->name,cookie->nlen,name,nlen,ino,ntohl(dtype));
+	_enter("{%s,%Zu},%s,%u,,%lu,%u",
+	       cookie->name, cookie->nlen, name, nlen, ino, ntohl(dtype));
 
-	if (cookie->nlen != nlen || memcmp(cookie->name,name,nlen)!=0) {
+	if (cookie->nlen != nlen || memcmp(cookie->name, name, nlen) != 0) {
 		_leave(" = 0 [no]");
 		return 0;
 	}
@@ -420,16 +440,16 @@
 {
 	struct afs_dir_lookup_cookie cookie;
 	struct afs_super_info *as;
+	struct afs_vnode *vnode;
 	struct inode *inode;
-	afs_vnode_t *vnode;
 	unsigned fpos;
 	int ret;
 
-	_enter("{%lu},%p{%s}",dir->i_ino,dentry,dentry->d_name.name);
+	_enter("{%lu},%p{%s}", dir->i_ino, dentry, dentry->d_name.name);
 
 	/* insanity checks first */
-	BUG_ON(sizeof(afs_dir_block_t) != 2048);
-	BUG_ON(sizeof(afs_dirent_t) != 32);
+	BUG_ON(sizeof(union afs_dir_block) != 2048);
+	BUG_ON(sizeof(union afs_dirent) != 32);
 
 	if (dentry->d_name.len > 255) {
 		_leave(" = -ENAMETOOLONG");
@@ -451,29 +471,29 @@
 	cookie.found	= 0;
 
 	fpos = 0;
-	ret = afs_dir_iterate(dir,&fpos,&cookie,afs_dir_lookup_filldir);
-	if (ret<0) {
-		_leave(" = %d",ret);
+	ret = afs_dir_iterate(dir, &fpos, &cookie, afs_dir_lookup_filldir);
+	if (ret < 0) {
+		_leave(" = %d", ret);
 		return ERR_PTR(ret);
 	}
 
 	ret = -ENOENT;
 	if (!cookie.found) {
-		_leave(" = %d",ret);
+		_leave(" = %d", ret);
 		return ERR_PTR(ret);
 	}
 
 	/* instantiate the dentry */
-	ret = afs_iget(dir->i_sb,&cookie.fid,&inode);
-	if (ret<0) {
-		_leave(" = %d",ret);
+	ret = afs_iget(dir->i_sb, &cookie.fid, &inode);
+	if (ret < 0) {
+		_leave(" = %d", ret);
 		return ERR_PTR(ret);
 	}
 
 	dentry->d_op = &afs_fs_dentry_operations;
-	dentry->d_fsdata = (void*) (unsigned long) vnode->status.version;
+	dentry->d_fsdata = (void *) (unsigned long) vnode->status.version;
 
-	d_add(dentry,inode);
+	d_add(dentry, inode);
 	_leave(" = 0 { vn=%u u=%u } -> { ino=%lu v=%lu }",
 	       cookie.fid.vnode,
 	       cookie.fid.unique,
@@ -486,7 +506,8 @@
 /*****************************************************************************/
 /*
  * check that a dentry lookup hit has found a valid entry
- * - NOTE! the hit can be a negative hit too, so we can't assume we have an inode
+ * - NOTE! the hit can be a negative hit too, so we can't assume we have an
+ *   inode
  * (derived from nfs_lookup_revalidate)
  */
 static int afs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
@@ -497,7 +518,7 @@
 	unsigned fpos;
 	int ret;
 
-	_enter("{sb=%p n=%s},",dentry->d_sb,dentry->d_name.name);
+	_enter("{sb=%p n=%s},", dentry->d_sb, dentry->d_name.name);
 
 	/* lock down the parent dentry so we can peer at it */
 	parent = dget_parent(dentry->d_parent);
@@ -505,39 +526,41 @@
 	dir = parent->d_inode;
 	inode = dentry->d_inode;
 
-	/* handle a negative inode */
+	/* handle a negative dentry */
 	if (!inode)
 		goto out_bad;
 
 	/* handle a bad inode */
 	if (is_bad_inode(inode)) {
 		printk("kAFS: afs_d_revalidate: %s/%s has bad inode\n",
-		       dentry->d_parent->d_name.name,dentry->d_name.name);
+		       dentry->d_parent->d_name.name, dentry->d_name.name);
 		goto out_bad;
 	}
 
-	/* force a full look up if the parent directory changed since last the server was consulted
-	 * - otherwise this inode must still exist, even if the inode details themselves have
-	 *   changed
+	/* force a full look up if the parent directory changed since last the
+	 * server was consulted
+	 * - otherwise this inode must still exist, even if the inode details
+	 *   themselves have changed
 	 */
 	if (AFS_FS_I(dir)->flags & AFS_VNODE_CHANGED)
 		afs_vnode_fetch_status(AFS_FS_I(dir));
 
 	if (AFS_FS_I(dir)->flags & AFS_VNODE_DELETED) {
-		_debug("%s: parent dir deleted",dentry->d_name.name);
+		_debug("%s: parent dir deleted", dentry->d_name.name);
 		goto out_bad;
 	}
 
 	if (AFS_FS_I(inode)->flags & AFS_VNODE_DELETED) {
-		_debug("%s: file already deleted",dentry->d_name.name);
+		_debug("%s: file already deleted", dentry->d_name.name);
 		goto out_bad;
 	}
 
-	if ((unsigned long)dentry->d_fsdata != (unsigned long)AFS_FS_I(dir)->status.version) {
+	if ((unsigned long) dentry->d_fsdata !=
+	    (unsigned long) AFS_FS_I(dir)->status.version) {
 		_debug("%s: parent changed %lu -> %u",
 		       dentry->d_name.name,
-		       (unsigned long)dentry->d_fsdata,
-		       (unsigned)AFS_FS_I(dir)->status.version);
+		       (unsigned long) dentry->d_fsdata,
+		       (unsigned) AFS_FS_I(dir)->status.version);
 
 		/* search the directory for this vnode */
 		cookie.name	= dentry->d_name.name;
@@ -546,25 +569,29 @@
 		cookie.found	= 0;
 
 		fpos = 0;
-		ret = afs_dir_iterate(dir,&fpos,&cookie,afs_dir_lookup_filldir);
-		if (ret<0) {
-			_debug("failed to iterate dir %s: %d",parent->d_name.name,ret);
+		ret = afs_dir_iterate(dir, &fpos, &cookie,
+				      afs_dir_lookup_filldir);
+		if (ret < 0) {
+			_debug("failed to iterate dir %s: %d",
+			       parent->d_name.name, ret);
 			goto out_bad;
 		}
 
 		if (!cookie.found) {
-			_debug("%s: dirent not found",dentry->d_name.name);
+			_debug("%s: dirent not found", dentry->d_name.name);
 			goto not_found;
 		}
 
-		/* if the vnode ID has changed, then the dirent points to a different file */
-		if (cookie.fid.vnode!=AFS_FS_I(inode)->fid.vnode) {
-			_debug("%s: dirent changed",dentry->d_name.name);
+		/* if the vnode ID has changed, then the dirent points to a
+		 * different file */
+		if (cookie.fid.vnode != AFS_FS_I(inode)->fid.vnode) {
+			_debug("%s: dirent changed", dentry->d_name.name);
 			goto not_found;
 		}
 
-		/* if the vnode ID uniqifier has changed, then the file has been deleted */
-		if (cookie.fid.unique!=AFS_FS_I(inode)->fid.unique) {
+		/* if the vnode ID uniqifier has changed, then the file has
+		 * been deleted */
+		if (cookie.fid.unique != AFS_FS_I(inode)->fid.unique) {
 			_debug("%s: file deleted (uq %u -> %u I:%lu)",
 			       dentry->d_name.name,
 			       cookie.fid.unique,
@@ -577,7 +604,8 @@
 			goto out_bad;
 		}
 
-		dentry->d_fsdata = (void*) (unsigned long) AFS_FS_I(dir)->status.version;
+		dentry->d_fsdata =
+			(void *) (unsigned long) AFS_FS_I(dir)->status.version;
 	}
 
  out_valid:
@@ -598,7 +626,8 @@
 
 	shrink_dcache_parent(dentry);
 
-	_debug("dropping dentry %s/%s",dentry->d_parent->d_name.name,dentry->d_name.name);
+	_debug("dropping dentry %s/%s",
+	       dentry->d_parent->d_name.name, dentry->d_name.name);
 	d_drop(dentry);
 
 	dput(parent);
@@ -609,13 +638,14 @@
 
 /*****************************************************************************/
 /*
- * allow the VFS to enquire as to whether a dentry should be unhashed (mustn't sleep)
+ * allow the VFS to enquire as to whether a dentry should be unhashed (mustn't
+ * sleep)
  * - called from dput() when d_count is going to 0.
  * - return 1 to request dentry be unhashed, 0 otherwise
  */
 static int afs_d_delete(struct dentry *dentry)
 {
-	_enter("%s",dentry->d_name.name);
+	_enter("%s", dentry->d_name.name);
 
 	if (dentry->d_flags & DCACHE_NFSFS_RENAMED)
 		goto zap;
diff -Nru a/fs/afs/file.c b/fs/afs/file.c
--- a/fs/afs/file.c	Tue Feb  3 19:45:35 2004
+++ b/fs/afs/file.c	Tue Feb  3 19:45:35 2004
@@ -31,7 +31,8 @@
 static int afs_file_invalidatepage(struct page *page, unsigned long offset);
 static int afs_file_releasepage(struct page *page, int gfp_flags);
 
-static ssize_t afs_file_write(struct file *file, const char *buf, size_t size, loff_t *off);
+static ssize_t afs_file_write(struct file *file, const char *buf, size_t size,
+			      loff_t *off);
 
 struct inode_operations afs_file_inode_operations = {
 	.getattr	= afs_inode_getattr,
@@ -60,9 +61,10 @@
 /*
  * AFS file write
  */
-static ssize_t afs_file_write(struct file *file, const char *buf, size_t size, loff_t *off)
+static ssize_t afs_file_write(struct file *file, const char *buf, size_t size,
+			      loff_t *off)
 {
-	afs_vnode_t *vnode;
+	struct afs_vnode *vnode;
 
 	vnode = AFS_FS_I(file->f_dentry->d_inode);
 	if (vnode->flags & AFS_VNODE_DELETED)
@@ -76,10 +78,12 @@
  * deal with notification that a page was read from the cache
  */
 #ifdef AFS_CACHING_SUPPORT
-static void afs_file_readpage_read_complete(void *cookie_data, struct page *page, void *data,
+static void afs_file_readpage_read_complete(void *cookie_data,
+					    struct page *page,
+					    void *data,
 					    int error)
 {
-	_enter("%p,%p,%p,%d",cookie_data,page,data,error);
+	_enter("%p,%p,%p,%d", cookie_data, page, data, error);
 
 	if (error)
 		SetPageError(page);
@@ -95,10 +99,12 @@
  * deal with notification that a page was written to the cache
  */
 #ifdef AFS_CACHING_SUPPORT
-static void afs_file_readpage_write_complete(void *cookie_data, struct page *page, void *data,
+static void afs_file_readpage_write_complete(void *cookie_data,
+					     struct page *page,
+					     void *data,
 					     int error)
 {
-	_enter("%p,%p,%p,%d",cookie_data,page,data,error);
+	_enter("%p,%p,%p,%d", cookie_data, page, data, error);
 
 	unlock_page(page);
 
@@ -115,13 +121,13 @@
 #ifdef AFS_CACHING_SUPPORT
 	struct cachefs_page *pageio;
 #endif
+	struct afs_vnode *vnode;
 	struct inode *inode;
-	afs_vnode_t *vnode;
 	int ret;
 
 	inode = page->mapping->host;
 
-	_enter("{%lu},{%lu}",inode->i_ino,page->index);
+	_enter("{%lu},{%lu}", inode->i_ino, page->index);
 
 	vnode = AFS_FS_I(inode);
 
@@ -133,8 +139,8 @@
 		goto error;
 
 #ifdef AFS_CACHING_SUPPORT
-	ret = cachefs_page_get_private(page,&pageio,GFP_NOIO);
-	if (ret<0)
+	ret = cachefs_page_get_private(page, &pageio, GFP_NOIO);
+	if (ret < 0)
 		goto error;
 
 	/* is it cached? */
@@ -162,23 +168,26 @@
 	default:
 		desc.fid	= vnode->fid;
 		desc.offset	= page->index << PAGE_CACHE_SHIFT;
-		desc.size	= min((size_t)(inode->i_size - desc.offset),(size_t)PAGE_SIZE);
+		desc.size	= min((size_t) (inode->i_size - desc.offset),
+				      (size_t) PAGE_SIZE);
 		desc.buffer	= kmap(page);
 
 		clear_page(desc.buffer);
 
-		/* read the contents of the file from the server into the page */
-		ret = afs_vnode_fetch_data(vnode,&desc);
+		/* read the contents of the file from the server into the
+		 * page */
+		ret = afs_vnode_fetch_data(vnode, &desc);
 		kunmap(page);
-		if (ret<0) {
+		if (ret < 0) {
 			if (ret==-ENOENT) {
-				_debug("got NOENT from server - marking file deleted and stale");
+				_debug("got NOENT from server"
+				       " - marking file deleted and stale");
 				vnode->flags |= AFS_VNODE_DELETED;
 				ret = -ESTALE;
 			}
 
 #ifdef AFS_CACHING_SUPPORT
-			cachefs_uncache_page(vnode->cache,page);
+			cachefs_uncache_page(vnode->cache, page);
 #endif
 			goto error;
 		}
@@ -192,7 +201,7 @@
 				       NULL,
 				       GFP_KERNEL) != 0
 		    ) {
-			cachefs_uncache_page(vnode->cache,page);
+			cachefs_uncache_page(vnode->cache, page);
 			unlock_page(page);
 		}
 #else
@@ -207,7 +216,7 @@
 	SetPageError(page);
 	unlock_page(page);
 
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 
 } /* end afs_file_readpage() */
@@ -217,14 +226,15 @@
  * get a page cookie for the specified page
  */
 #ifdef AFS_CACHING_SUPPORT
-int afs_cache_get_page_cookie(struct page *page, struct cachefs_page **_page_cookie)
+int afs_cache_get_page_cookie(struct page *page,
+			      struct cachefs_page **_page_cookie)
 {
 	int ret;
 
 	_enter("");
-	ret = cachefs_page_get_private(page,_page_cookie,GFP_NOIO);
+	ret = cachefs_page_get_private(page,_page_cookie, GFP_NOIO);
 
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 } /* end afs_cache_get_page_cookie() */
 #endif
@@ -237,30 +247,32 @@
 {
 	int ret = 1;
 
-	_enter("{%lu},%lu",page->index,offset);
+	_enter("{%lu},%lu", page->index, offset);
 
 	BUG_ON(!PageLocked(page));
+
 	if (PagePrivate(page)) {
 #ifdef AFS_CACHING_SUPPORT
 		struct afs_vnode *vnode = AFS_FS_I(page->mapping->host);
 		cachefs_uncache_page(vnode->cache,page);
 #endif
 
-		/*
-		 * We release buffers only if the entire page is being invalidated.
-		 * The get_block cached value has been unconditionally invalidated,
-		 * so real IO is not possible anymore.
+		/* We release buffers only if the entire page is being
+		 * invalidated.
+		 * The get_block cached value has been unconditionally
+		 * invalidated, so real IO is not possible anymore.
 		 */
 		if (offset == 0) {
 			BUG_ON(!PageLocked(page));
 
 			ret = 0;
 			if (!PageWriteback(page))
-				ret = page->mapping->a_ops->releasepage(page, 0);
+				ret = page->mapping->a_ops->releasepage(page,
+									0);
 		}
 	}
 
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 } /* end afs_file_invalidatepage() */
 
@@ -272,12 +284,12 @@
 {
 	struct cachefs_page *pageio;
 
-	_enter("{%lu},%x",page->index,gfp_flags);
+	_enter("{%lu},%x", page->index, gfp_flags);
 
 	if (PagePrivate(page)) {
 #ifdef AFS_CACHING_SUPPORT
 		struct afs_vnode *vnode = AFS_FS_I(page->mapping->host);
-		cachefs_uncache_page(vnode->cache,page);
+		cachefs_uncache_page(vnode->cache, page);
 #endif
 
 		pageio = (struct cachefs_page *) page->private;
diff -Nru a/fs/afs/fsclient.c b/fs/afs/fsclient.c
--- a/fs/afs/fsclient.c	Tue Feb  3 19:45:42 2004
+++ b/fs/afs/fsclient.c	Tue Feb  3 19:45:42 2004
@@ -24,7 +24,7 @@
 
 #define FSFETCHSTATUS		132	/* AFS Fetch file status */
 #define FSFETCHDATA		130	/* AFS Fetch file data */
-#define FSGIVEUPCALLBACKS	147	/* AFS Discard server callback promises */
+#define FSGIVEUPCALLBACKS	147	/* AFS Discard callback promises */
 #define FSGETVOLUMEINFO		148	/* AFS Get root volume information */
 #define FSGETROOTVOLUME		151	/* AFS Get root volume name */
 #define FSLOOKUP		161	/* AFS lookup file in directory */
@@ -54,10 +54,9 @@
  * - this operation doesn't seem to work correctly in OpenAFS server 1.2.2
  */
 #if 0
-int afs_rxfs_get_root_volume(afs_server_t *server, char *buf, size_t *buflen)
+int afs_rxfs_get_root_volume(struct afs_server *server,
+			     char *buf, size_t *buflen)
 {
-	DECLARE_WAITQUEUE(myself,current);
-
 	struct rxrpc_connection *conn;
 	struct rxrpc_call *call;
 	struct iovec piov[2];
@@ -65,23 +64,25 @@
 	int ret;
 	u32 param[1];
 
-	kenter("%p,%p,%u",server,buf,*buflen);
+	DECLARE_WAITQUEUE(myself, current);
+
+	kenter("%p,%p,%u",server, buf, *buflen);
 
 	/* get hold of the fileserver connection */
-	ret = afs_server_get_fsconn(server,&conn);
-	if (ret<0)
+	ret = afs_server_get_fsconn(server, &conn);
+	if (ret < 0)
 		goto out;
 
 	/* create a call through that connection */
-	ret = rxrpc_create_call(conn,NULL,NULL,afs_rxfs_aemap,&call);
-	if (ret<0) {
-		printk("kAFS: Unable to create call: %d\n",ret);
+	ret = rxrpc_create_call(conn, NULL, NULL, afs_rxfs_aemap, &call);
+	if (ret < 0) {
+		printk("kAFS: Unable to create call: %d\n", ret);
 		goto out_put_conn;
 	}
 	call->app_opcode = FSGETROOTVOLUME;
 
 	/* we want to get event notifications from the call */
-	add_wait_queue(&call->waitq,&myself);
+	add_wait_queue(&call->waitq, &myself);
 
 	/* marshall the parameters */
 	param[0] = htonl(FSGETROOTVOLUME);
@@ -90,14 +91,15 @@
 	piov[0].iov_base = param;
 
 	/* send the parameters to the server */
-	ret = rxrpc_call_write_data(call,1,piov,RXRPC_LAST_PACKET,GFP_NOFS,0,&sent);
-	if (ret<0)
+	ret = rxrpc_call_write_data(call, 1, piov, RXRPC_LAST_PACKET, GFP_NOFS,
+				    0, &sent);
+	if (ret < 0)
 		goto abort;
 
 	/* wait for the reply to completely arrive */
 	for (;;) {
 		set_current_state(TASK_INTERRUPTIBLE);
-		if (call->app_call_state!=RXRPC_CSTATE_CLNT_RCV_REPLY ||
+		if (call->app_call_state != RXRPC_CSTATE_CLNT_RCV_REPLY ||
 		    signal_pending(current))
 			break;
 		schedule();
@@ -111,41 +113,41 @@
 	switch (call->app_call_state) {
 	case RXRPC_CSTATE_ERROR:
 		ret = call->app_errno;
-		kdebug("Got Error: %d",ret);
+		kdebug("Got Error: %d", ret);
 		goto out_unwait;
 
 	case RXRPC_CSTATE_CLNT_GOT_REPLY:
 		/* read the reply */
-		kdebug("Got Reply: qty=%d",call->app_ready_qty);
+		kdebug("Got Reply: qty=%d", call->app_ready_qty);
 
 		ret = -EBADMSG;
 		if (call->app_ready_qty <= 4)
 			goto abort;
 
-		ret = rxrpc_call_read_data(call,NULL,call->app_ready_qty,0);
-		if (ret<0)
+		ret = rxrpc_call_read_data(call, NULL, call->app_ready_qty, 0);
+		if (ret < 0)
 			goto abort;
 
 #if 0
 		/* unmarshall the reply */
 		bp = buffer;
-		for (loop=0; loop<65; loop++)
+		for (loop = 0; loop < 65; loop++)
 			entry->name[loop] = ntohl(*bp++);
 		entry->name[64] = 0;
 
 		entry->type = ntohl(*bp++);
 		entry->num_servers = ntohl(*bp++);
 
-		for (loop=0; loop<8; loop++)
+		for (loop = 0; loop < 8; loop++)
 			entry->servers[loop].addr.s_addr = *bp++;
 
-		for (loop=0; loop<8; loop++)
+		for (loop = 0; loop < 8; loop++)
 			entry->servers[loop].partition = ntohl(*bp++);
 
-		for (loop=0; loop<8; loop++)
+		for (loop = 0; loop < 8; loop++)
 			entry->servers[loop].flags = ntohl(*bp++);
 
-		for (loop=0; loop<3; loop++)
+		for (loop = 0; loop < 3; loop++)
 			entry->volume_ids[loop] = ntohl(*bp++);
 
 		entry->clone_id = ntohl(*bp++);
@@ -162,14 +164,14 @@
 
  abort:
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	rxrpc_call_abort(call,ret);
+	rxrpc_call_abort(call, ret);
 	schedule();
  out_unwait:
 	set_current_state(TASK_RUNNING);
-	remove_wait_queue(&call->waitq,&myself);
+	remove_wait_queue(&call->waitq, &myself);
 	rxrpc_put_call(call);
  out_put_conn:
-	afs_server_release_fsconn(server,conn);
+	afs_server_release_fsconn(server, conn);
  out:
 	kleave("");
 	return ret;
@@ -181,12 +183,10 @@
  * get information about a volume
  */
 #if 0
-int afs_rxfs_get_volume_info(afs_server_t *server,
+int afs_rxfs_get_volume_info(struct afs_server *server,
 			     const char *name,
-			     afs_volume_info_t *vinfo)
+			     struct afs_volume_info *vinfo)
 {
-	DECLARE_WAITQUEUE(myself,current);
-
 	struct rxrpc_connection *conn;
 	struct rxrpc_call *call;
 	struct iovec piov[3];
@@ -194,27 +194,29 @@
 	int ret;
 	u32 param[2], *bp, zero;
 
-	_enter("%p,%s,%p",server,name,vinfo);
+	DECLARE_WAITQUEUE(myself, current);
+
+	_enter("%p,%s,%p", server, name, vinfo);
 
 	/* get hold of the fileserver connection */
-	ret = afs_server_get_fsconn(server,&conn);
-	if (ret<0)
+	ret = afs_server_get_fsconn(server, &conn);
+	if (ret < 0)
 		goto out;
 
 	/* create a call through that connection */
-	ret = rxrpc_create_call(conn,NULL,NULL,afs_rxfs_aemap,&call);
-	if (ret<0) {
-		printk("kAFS: Unable to create call: %d\n",ret);
+	ret = rxrpc_create_call(conn, NULL, NULL, afs_rxfs_aemap, &call);
+	if (ret < 0) {
+		printk("kAFS: Unable to create call: %d\n", ret);
 		goto out_put_conn;
 	}
 	call->app_opcode = FSGETVOLUMEINFO;
 
 	/* we want to get event notifications from the call */
-	add_wait_queue(&call->waitq,&myself);
+	add_wait_queue(&call->waitq, &myself);
 
 	/* marshall the parameters */
 	piov[1].iov_len = strlen(name);
-	piov[1].iov_base = (char*)name;
+	piov[1].iov_base = (char *) name;
 
 	zero = 0;
 	piov[2].iov_len = (4 - (piov[1].iov_len & 3)) & 3;
@@ -227,16 +229,19 @@
 	piov[0].iov_base = param;
 
 	/* send the parameters to the server */
-	ret = rxrpc_call_write_data(call,3,piov,RXRPC_LAST_PACKET,GFP_NOFS,0,&sent);
-	if (ret<0)
+	ret = rxrpc_call_write_data(call, 3, piov, RXRPC_LAST_PACKET, GFP_NOFS,
+				    0, &sent);
+	if (ret < 0)
 		goto abort;
 
 	/* wait for the reply to completely arrive */
-	bp = rxrpc_call_alloc_scratch(call,64);
+	bp = rxrpc_call_alloc_scratch(call, 64);
 
-	ret = rxrpc_call_read_data(call,bp,64,RXRPC_CALL_READ_BLOCK|RXRPC_CALL_READ_ALL);
-	if (ret<0) {
-		if (ret==-ECONNABORTED) {
+	ret = rxrpc_call_read_data(call, bp, 64,
+				   RXRPC_CALL_READ_BLOCK |
+				   RXRPC_CALL_READ_ALL);
+	if (ret < 0) {
+		if (ret == -ECONNABORTED) {
 			ret = call->app_errno;
 			goto out_unwait;
 		}
@@ -264,7 +269,7 @@
 	vinfo->servers[7].addr.s_addr = *bp++;
 
 	ret = -EBADMSG;
-	if (vinfo->nservers>8)
+	if (vinfo->nservers > 8)
 		goto abort;
 
 	/* success */
@@ -272,17 +277,17 @@
 
  out_unwait:
 	set_current_state(TASK_RUNNING);
-	remove_wait_queue(&call->waitq,&myself);
+	remove_wait_queue(&call->waitq, &myself);
 	rxrpc_put_call(call);
  out_put_conn:
-	afs_server_release_fsconn(server,conn);
+	afs_server_release_fsconn(server, conn);
  out:
 	_leave("");
 	return ret;
 
  abort:
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	rxrpc_call_abort(call,ret);
+	rxrpc_call_abort(call, ret);
 	schedule();
 	goto out_unwait;
 
@@ -293,12 +298,10 @@
 /*
  * fetch the status information for a file
  */
-int afs_rxfs_fetch_file_status(afs_server_t *server,
-			       afs_vnode_t *vnode,
-			       afs_volsync_t *volsync)
+int afs_rxfs_fetch_file_status(struct afs_server *server,
+			       struct afs_vnode *vnode,
+			       struct afs_volsync *volsync)
 {
-	DECLARE_WAITQUEUE(myself,current);
-
 	struct afs_server_callslot callslot;
 	struct rxrpc_call *call;
 	struct iovec piov[1];
@@ -306,26 +309,30 @@
 	int ret;
 	u32 *bp;
 
-	_enter("%p,{%u,%u,%u}",server,vnode->fid.vid,vnode->fid.vnode,vnode->fid.unique);
+	DECLARE_WAITQUEUE(myself, current);
+
+	_enter("%p,{%u,%u,%u}",
+	       server, vnode->fid.vid, vnode->fid.vnode, vnode->fid.unique);
 
 	/* get hold of the fileserver connection */
-	ret = afs_server_request_callslot(server,&callslot);
-	if (ret<0)
+	ret = afs_server_request_callslot(server, &callslot);
+	if (ret < 0)
 		goto out;
 
 	/* create a call through that connection */
-	ret = rxrpc_create_call(callslot.conn,NULL,NULL,afs_rxfs_aemap,&call);
-	if (ret<0) {
-		printk("kAFS: Unable to create call: %d\n",ret);
+	ret = rxrpc_create_call(callslot.conn, NULL, NULL, afs_rxfs_aemap,
+				&call);
+	if (ret < 0) {
+		printk("kAFS: Unable to create call: %d\n", ret);
 		goto out_put_conn;
 	}
 	call->app_opcode = FSFETCHSTATUS;
 
 	/* we want to get event notifications from the call */
-	add_wait_queue(&call->waitq,&myself);
+	add_wait_queue(&call->waitq, &myself);
 
 	/* marshall the parameters */
-	bp = rxrpc_call_alloc_scratch(call,16);
+	bp = rxrpc_call_alloc_scratch(call, 16);
 	bp[0] = htonl(FSFETCHSTATUS);
 	bp[1] = htonl(vnode->fid.vid);
 	bp[2] = htonl(vnode->fid.vnode);
@@ -335,16 +342,19 @@
 	piov[0].iov_base = bp;
 
 	/* send the parameters to the server */
-	ret = rxrpc_call_write_data(call,1,piov,RXRPC_LAST_PACKET,GFP_NOFS,0,&sent);
-	if (ret<0)
+	ret = rxrpc_call_write_data(call, 1, piov, RXRPC_LAST_PACKET, GFP_NOFS,
+				    0, &sent);
+	if (ret < 0)
 		goto abort;
 
 	/* wait for the reply to completely arrive */
-	bp = rxrpc_call_alloc_scratch(call,120);
+	bp = rxrpc_call_alloc_scratch(call, 120);
 
-	ret = rxrpc_call_read_data(call,bp,120,RXRPC_CALL_READ_BLOCK|RXRPC_CALL_READ_ALL);
-	if (ret<0) {
-		if (ret==-ECONNABORTED) {
+	ret = rxrpc_call_read_data(call, bp, 120,
+				   RXRPC_CALL_READ_BLOCK |
+				   RXRPC_CALL_READ_ALL);
+	if (ret < 0) {
+		if (ret == -ECONNABORTED) {
 			ret = call->app_errno;
 			goto out_unwait;
 		}
@@ -370,7 +380,7 @@
 	vnode->status.mtime_server	= ntohl(*bp++);
 	bp++; /* group */
 	bp++; /* sync counter */
-	vnode->status.version		|= ((unsigned long long) ntohl(*bp++)) << 32;
+	vnode->status.version |= ((unsigned long long) ntohl(*bp++)) << 32;
 	bp++; /* spare2 */
 	bp++; /* spare3 */
 	bp++; /* spare4 */
@@ -393,17 +403,17 @@
 
  out_unwait:
 	set_current_state(TASK_RUNNING);
-	remove_wait_queue(&call->waitq,&myself);
+	remove_wait_queue(&call->waitq, &myself);
 	rxrpc_put_call(call);
  out_put_conn:
-	afs_server_release_callslot(server,&callslot);
+	afs_server_release_callslot(server, &callslot);
  out:
 	_leave("");
 	return ret;
 
  abort:
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	rxrpc_call_abort(call,ret);
+	rxrpc_call_abort(call, ret);
 	schedule();
 	goto out_unwait;
 } /* end afs_rxfs_fetch_file_status() */
@@ -412,13 +422,11 @@
 /*
  * fetch the contents of a file or directory
  */
-int afs_rxfs_fetch_file_data(afs_server_t *server,
-			     afs_vnode_t *vnode,
+int afs_rxfs_fetch_file_data(struct afs_server *server,
+			     struct afs_vnode *vnode,
 			     struct afs_rxfs_fetch_descriptor *desc,
-			     afs_volsync_t *volsync)
+			     struct afs_volsync *volsync)
 {
-	DECLARE_WAITQUEUE(myself,current);
-
 	struct afs_server_callslot callslot;
 	struct rxrpc_call *call;
 	struct iovec piov[1];
@@ -426,6 +434,8 @@
 	int ret;
 	u32 *bp;
 
+	DECLARE_WAITQUEUE(myself, current);
+
 	_enter("%p,{fid={%u,%u,%u},sz=%Zu,of=%lu}",
 	       server,
 	       desc->fid.vid,
@@ -435,23 +445,23 @@
 	       desc->offset);
 
 	/* get hold of the fileserver connection */
-	ret = afs_server_request_callslot(server,&callslot);
-	if (ret<0)
+	ret = afs_server_request_callslot(server, &callslot);
+	if (ret < 0)
 		goto out;
 
 	/* create a call through that connection */
-	ret = rxrpc_create_call(callslot.conn,NULL,NULL,afs_rxfs_aemap,&call);
-	if (ret<0) {
-		printk("kAFS: Unable to create call: %d\n",ret);
+	ret = rxrpc_create_call(callslot.conn, NULL, NULL, afs_rxfs_aemap, &call);
+	if (ret < 0) {
+		printk("kAFS: Unable to create call: %d\n", ret);
 		goto out_put_conn;
 	}
 	call->app_opcode = FSFETCHDATA;
 
 	/* we want to get event notifications from the call */
-	add_wait_queue(&call->waitq,&myself);
+	add_wait_queue(&call->waitq, &myself);
 
 	/* marshall the parameters */
-	bp = rxrpc_call_alloc_scratch(call,24);
+	bp = rxrpc_call_alloc_scratch(call, 24);
 	bp[0] = htonl(FSFETCHDATA);
 	bp[1] = htonl(desc->fid.vid);
 	bp[2] = htonl(desc->fid.vnode);
@@ -463,17 +473,18 @@
 	piov[0].iov_base = bp;
 
 	/* send the parameters to the server */
-	ret = rxrpc_call_write_data(call,1,piov,RXRPC_LAST_PACKET,GFP_NOFS,0,&sent);
-	if (ret<0)
+	ret = rxrpc_call_write_data(call, 1, piov, RXRPC_LAST_PACKET, GFP_NOFS,
+				    0, &sent);
+	if (ret < 0)
 		goto abort;
 
 	/* wait for the data count to arrive */
-	ret = rxrpc_call_read_data(call,bp,4,RXRPC_CALL_READ_BLOCK);
-	if (ret<0)
+	ret = rxrpc_call_read_data(call, bp, 4, RXRPC_CALL_READ_BLOCK);
+	if (ret < 0)
 		goto read_failed;
 
 	desc->actual = ntohl(bp[0]);
-	if (desc->actual!=desc->size) {
+	if (desc->actual != desc->size) {
 		ret = -EBADMSG;
 		goto abort;
 	}
@@ -481,16 +492,19 @@
 	/* call the app to read the actual data */
 	rxrpc_call_reset_scratch(call);
 
-	ret = rxrpc_call_read_data(call,desc->buffer,desc->actual,RXRPC_CALL_READ_BLOCK);
-	if (ret<0)
+	ret = rxrpc_call_read_data(call, desc->buffer, desc->actual,
+				   RXRPC_CALL_READ_BLOCK);
+	if (ret < 0)
 		goto read_failed;
 
 	/* wait for the rest of the reply to completely arrive */
 	rxrpc_call_reset_scratch(call);
-	bp = rxrpc_call_alloc_scratch(call,120);
+	bp = rxrpc_call_alloc_scratch(call, 120);
 
-	ret = rxrpc_call_read_data(call,bp,120,RXRPC_CALL_READ_BLOCK|RXRPC_CALL_READ_ALL);
-	if (ret<0)
+	ret = rxrpc_call_read_data(call, bp, 120,
+				   RXRPC_CALL_READ_BLOCK |
+				   RXRPC_CALL_READ_ALL);
+	if (ret < 0)
 		goto read_failed;
 
 	/* unmarshall the reply */
@@ -512,7 +526,7 @@
 	vnode->status.mtime_server	= ntohl(*bp++);
 	bp++; /* group */
 	bp++; /* sync counter */
-	vnode->status.version		|= ((unsigned long long) ntohl(*bp++)) << 32;
+	vnode->status.version |= ((unsigned long long) ntohl(*bp++)) << 32;
 	bp++; /* spare2 */
 	bp++; /* spare3 */
 	bp++; /* spare4 */
@@ -538,20 +552,20 @@
 	remove_wait_queue(&call->waitq,&myself);
 	rxrpc_put_call(call);
  out_put_conn:
-	afs_server_release_callslot(server,&callslot);
+	afs_server_release_callslot(server, &callslot);
  out:
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 
  read_failed:
-	if (ret==-ECONNABORTED) {
+	if (ret == -ECONNABORTED) {
 		ret = call->app_errno;
 		goto out_unwait;
 	}
 
  abort:
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	rxrpc_call_abort(call,ret);
+	rxrpc_call_abort(call, ret);
 	schedule();
 	goto out_unwait;
 
@@ -561,10 +575,9 @@
 /*
  * ask the AFS fileserver to discard a callback request on a file
  */
-int afs_rxfs_give_up_callback(afs_server_t *server, afs_vnode_t *vnode)
+int afs_rxfs_give_up_callback(struct afs_server *server,
+			      struct afs_vnode *vnode)
 {
-	DECLARE_WAITQUEUE(myself,current);
-
 	struct afs_server_callslot callslot;
 	struct rxrpc_call *call;
 	struct iovec piov[1];
@@ -572,28 +585,31 @@
 	int ret;
 	u32 *bp;
 
-	_enter("%p,{%u,%u,%u}",server,vnode->fid.vid,vnode->fid.vnode,vnode->fid.unique);
+	DECLARE_WAITQUEUE(myself, current);
+
+	_enter("%p,{%u,%u,%u}",
+	       server, vnode->fid.vid, vnode->fid.vnode, vnode->fid.unique);
 
 	/* get hold of the fileserver connection */
-	ret = afs_server_request_callslot(server,&callslot);
-	if (ret<0)
+	ret = afs_server_request_callslot(server, &callslot);
+	if (ret < 0)
 		goto out;
 
 	/* create a call through that connection */
-	ret = rxrpc_create_call(callslot.conn,NULL,NULL,afs_rxfs_aemap,&call);
-	if (ret<0) {
-		printk("kAFS: Unable to create call: %d\n",ret);
+	ret = rxrpc_create_call(callslot.conn, NULL, NULL, afs_rxfs_aemap, &call);
+	if (ret < 0) {
+		printk("kAFS: Unable to create call: %d\n", ret);
 		goto out_put_conn;
 	}
 	call->app_opcode = FSGIVEUPCALLBACKS;
 
 	/* we want to get event notifications from the call */
-	add_wait_queue(&call->waitq,&myself);
+	add_wait_queue(&call->waitq, &myself);
 
 	/* marshall the parameters */
-	bp = rxrpc_call_alloc_scratch(call,(1+4+4)*4);
+	bp = rxrpc_call_alloc_scratch(call, (1 + 4 + 4) * 4);
 
-	piov[0].iov_len = (1+4+4)*4;
+	piov[0].iov_len = (1 + 4 + 4) * 4;
 	piov[0].iov_base = bp;
 
 	*bp++ = htonl(FSGIVEUPCALLBACKS);
@@ -607,14 +623,15 @@
 	*bp++ = htonl(vnode->cb_type);
 
 	/* send the parameters to the server */
-	ret = rxrpc_call_write_data(call,1,piov,RXRPC_LAST_PACKET,GFP_NOFS,0,&sent);
-	if (ret<0)
+	ret = rxrpc_call_write_data(call, 1, piov, RXRPC_LAST_PACKET, GFP_NOFS,
+				    0, &sent);
+	if (ret < 0)
 		goto abort;
 
 	/* wait for the reply to completely arrive */
 	for (;;) {
 		set_current_state(TASK_INTERRUPTIBLE);
-		if (call->app_call_state!=RXRPC_CSTATE_CLNT_RCV_REPLY ||
+		if (call->app_call_state != RXRPC_CSTATE_CLNT_RCV_REPLY ||
 		    signal_pending(current))
 			break;
 		schedule();
@@ -640,17 +657,17 @@
 
  out_unwait:
 	set_current_state(TASK_RUNNING);
-	remove_wait_queue(&call->waitq,&myself);
+	remove_wait_queue(&call->waitq, &myself);
 	rxrpc_put_call(call);
  out_put_conn:
-	afs_server_release_callslot(server,&callslot);
+	afs_server_release_callslot(server, &callslot);
  out:
 	_leave("");
 	return ret;
 
  abort:
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	rxrpc_call_abort(call,ret);
+	rxrpc_call_abort(call, ret);
 	schedule();
 	goto out_unwait;
 } /* end afs_rxfs_give_up_callback() */
@@ -661,14 +678,12 @@
  * - this operation doesn't seem to work correctly in OpenAFS server 1.2.2
  */
 #if 0
-int afs_rxfs_lookup(afs_server_t *server,
-		    afs_vnode_t *dir,
+int afs_rxfs_lookup(struct afs_server *server,
+		    struct afs_vnode *dir,
 		    const char *filename,
-		    afs_vnode_t *vnode,
-		    afs_volsync_t *volsync)
+		    struct afs_vnode *vnode,
+		    struct afs_volsync *volsync)
 {
-	DECLARE_WAITQUEUE(myself,current);
-
 	struct rxrpc_connection *conn;
 	struct rxrpc_call *call;
 	struct iovec piov[3];
@@ -676,17 +691,20 @@
 	int ret;
 	u32 *bp, zero;
 
-	kenter("%p,{%u,%u,%u},%s",server,fid->vid,fid->vnode,fid->unique,filename);
+	DECLARE_WAITQUEUE(myself, current);
+
+	kenter("%p,{%u,%u,%u},%s",
+	       server, fid->vid, fid->vnode, fid->unique, filename);
 
 	/* get hold of the fileserver connection */
-	ret = afs_server_get_fsconn(server,&conn);
-	if (ret<0)
+	ret = afs_server_get_fsconn(server, &conn);
+	if (ret < 0)
 		goto out;
 
 	/* create a call through that connection */
-	ret = rxrpc_create_call(conn,NULL,NULL,afs_rxfs_aemap,&call);
-	if (ret<0) {
-		printk("kAFS: Unable to create call: %d\n",ret);
+	ret = rxrpc_create_call(conn, NULL, NULL, afs_rxfs_aemap, &call);
+	if (ret < 0) {
+		printk("kAFS: Unable to create call: %d\n", ret);
 		goto out_put_conn;
 	}
 	call->app_opcode = FSLOOKUP;
@@ -695,14 +713,14 @@
 	add_wait_queue(&call->waitq,&myself);
 
 	/* marshall the parameters */
-	bp = rxrpc_call_alloc_scratch(call,20);
+	bp = rxrpc_call_alloc_scratch(call, 20);
 
 	zero = 0;
 
 	piov[0].iov_len = 20;
 	piov[0].iov_base = bp;
 	piov[1].iov_len = strlen(filename);
-	piov[1].iov_base = (char*) filename;
+	piov[1].iov_base = (char *) filename;
 	piov[2].iov_len = (4 - (piov[1].iov_len & 3)) & 3;
 	piov[2].iov_base = &zero;
 
@@ -713,16 +731,19 @@
 	*bp++ = htonl(piov[1].iov_len);
 
 	/* send the parameters to the server */
-	ret = rxrpc_call_write_data(call,3,piov,RXRPC_LAST_PACKET,GFP_NOFS,0,&sent);
-	if (ret<0)
+	ret = rxrpc_call_write_data(call, 3, piov, RXRPC_LAST_PACKET, GFP_NOFS,
+				    0, &sent);
+	if (ret < 0)
 		goto abort;
 
 	/* wait for the reply to completely arrive */
-	bp = rxrpc_call_alloc_scratch(call,220);
+	bp = rxrpc_call_alloc_scratch(call, 220);
 
-	ret = rxrpc_call_read_data(call,bp,220,RXRPC_CALL_READ_BLOCK|RXRPC_CALL_READ_ALL);
-	if (ret<0) {
-		if (ret==-ECONNABORTED) {
+	ret = rxrpc_call_read_data(call, bp, 220,
+				   RXRPC_CALL_READ_BLOCK |
+				   RXRPC_CALL_READ_ALL);
+	if (ret < 0) {
+		if (ret == -ECONNABORTED) {
 			ret = call->app_errno;
 			goto out_unwait;
 		}
@@ -752,30 +773,30 @@
 	vnode->status.mtime_server	= ntohl(*bp++);
 	bp++; /* group */
 	bp++; /* sync counter */
-	vnode->status.version		|= ((unsigned long long) ntohl(*bp++)) << 32;
+	vnode->status.version |= ((unsigned long long) ntohl(*bp++)) << 32;
 	bp++; /* spare2 */
 	bp++; /* spare3 */
 	bp++; /* spare4 */
 
 	dir->status.if_version		= ntohl(*bp++);
-	dir->status.type			= ntohl(*bp++);
+	dir->status.type		= ntohl(*bp++);
 	dir->status.nlink		= ntohl(*bp++);
-	dir->status.size			= ntohl(*bp++);
+	dir->status.size		= ntohl(*bp++);
 	dir->status.version		= ntohl(*bp++);
 	dir->status.author		= ntohl(*bp++);
 	dir->status.owner		= ntohl(*bp++);
 	dir->status.caller_access	= ntohl(*bp++);
 	dir->status.anon_access		= ntohl(*bp++);
-	dir->status.mode			= ntohl(*bp++);
+	dir->status.mode		= ntohl(*bp++);
 	dir->status.parent.vid		= dirfid->vid;
-	dir->status.parent.vnode		= ntohl(*bp++);
+	dir->status.parent.vnode	= ntohl(*bp++);
 	dir->status.parent.unique	= ntohl(*bp++);
 	bp++; /* seg size */
-	dir->status.mtime_client		= ntohl(*bp++);
-	dir->status.mtime_server		= ntohl(*bp++);
+	dir->status.mtime_client	= ntohl(*bp++);
+	dir->status.mtime_server	= ntohl(*bp++);
 	bp++; /* group */
 	bp++; /* sync counter */
-	dir->status.version		|= ((unsigned long long) ntohl(*bp++)) << 32;
+	dir->status.version |= ((unsigned long long) ntohl(*bp++)) << 32;
 	bp++; /* spare2 */
 	bp++; /* spare3 */
 	bp++; /* spare4 */
@@ -799,17 +820,17 @@
 
  out_unwait:
 	set_current_state(TASK_RUNNING);
-	remove_wait_queue(&call->waitq,&myself);
+	remove_wait_queue(&call->waitq, &myself);
 	rxrpc_put_call(call);
  out_put_conn:
-	afs_server_release_fsconn(server,conn);
+	afs_server_release_fsconn(server, conn);
  out:
 	kleave("");
 	return ret;
 
  abort:
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	rxrpc_call_abort(call,ret);
+	rxrpc_call_abort(call, ret);
 	schedule();
 	goto out_unwait;
 } /* end afs_rxfs_lookup() */
diff -Nru a/fs/afs/fsclient.h b/fs/afs/fsclient.h
--- a/fs/afs/fsclient.h	Tue Feb  3 19:45:17 2004
+++ b/fs/afs/fsclient.h	Tue Feb  3 19:45:17 2004
@@ -14,38 +14,39 @@
 
 #include "server.h"
 
-extern int afs_rxfs_get_volume_info(afs_server_t *server,
+extern int afs_rxfs_get_volume_info(struct afs_server *server,
 				    const char *name,
-				    afs_volume_info_t *vinfo);
+				    struct afs_volume_info *vinfo);
 
-extern int afs_rxfs_fetch_file_status(afs_server_t *server,
-				      afs_vnode_t *vnode,
-				      afs_volsync_t *volsync);
+extern int afs_rxfs_fetch_file_status(struct afs_server *server,
+				      struct afs_vnode *vnode,
+				      struct afs_volsync *volsync);
 
 struct afs_rxfs_fetch_descriptor {
-	afs_fid_t	fid;		/* file ID to fetch */
+	struct afs_fid	fid;		/* file ID to fetch */
 	size_t		size;		/* total number of bytes to fetch */
 	off_t		offset;		/* offset in file to start from */
 	void		*buffer;	/* read buffer */
 	size_t		actual;		/* actual size sent back by server */
 };
 
-extern int afs_rxfs_fetch_file_data(afs_server_t *server,
-				    afs_vnode_t *vnode,
+extern int afs_rxfs_fetch_file_data(struct afs_server *server,
+				    struct afs_vnode *vnode,
 				    struct afs_rxfs_fetch_descriptor *desc,
-				    afs_volsync_t *volsync);
+				    struct afs_volsync *volsync);
 
-extern int afs_rxfs_give_up_callback(afs_server_t *server, afs_vnode_t *vnode);
+extern int afs_rxfs_give_up_callback(struct afs_server *server,
+				     struct afs_vnode *vnode);
 
 /* this doesn't appear to work in OpenAFS server */
-extern int afs_rxfs_lookup(afs_server_t *server,
-			   afs_vnode_t *dir,
+extern int afs_rxfs_lookup(struct afs_server *server,
+			   struct afs_vnode *dir,
 			   const char *filename,
-			   afs_vnode_t *vnode,
-			   afs_volsync_t *volsync);
+			   struct afs_vnode *vnode,
+			   struct afs_volsync *volsync);
 
 /* this is apparently mis-implemented in OpenAFS server */
-extern int afs_rxfs_get_root_volume(afs_server_t *server,
+extern int afs_rxfs_get_root_volume(struct afs_server *server,
 				    char *buf,
 				    size_t *buflen);
 
diff -Nru a/fs/afs/inode.c b/fs/afs/inode.c
--- a/fs/afs/inode.c	Tue Feb  3 19:45:17 2004
+++ b/fs/afs/inode.c	Tue Feb  3 19:45:17 2004
@@ -26,15 +26,15 @@
 #include "internal.h"
 
 struct afs_iget_data {
-	afs_fid_t		fid;
-	afs_volume_t		*volume;	/* volume on which resides */
+	struct afs_fid		fid;
+	struct afs_volume	*volume;	/* volume on which resides */
 };
 
 /*****************************************************************************/
 /*
  * map the AFS file status to the inode member variables
  */
-static int afs_inode_map_status(afs_vnode_t *vnode)
+static int afs_inode_map_status(struct afs_vnode *vnode)
 {
 	struct inode *inode = AFS_VNODE_TO_I(vnode);
 
@@ -97,7 +97,7 @@
  */
 int afs_inode_fetch_status(struct inode *inode)
 {
-	afs_vnode_t *vnode;
+	struct afs_vnode *vnode;
 	int ret;
 
 	vnode = AFS_FS_I(inode);
@@ -130,7 +130,7 @@
 static int afs_iget5_set(struct inode *inode, void *opaque)
 {
 	struct afs_iget_data *data = opaque;
-	afs_vnode_t *vnode = AFS_FS_I(inode);
+	struct afs_vnode *vnode = AFS_FS_I(inode);
 
 	inode->i_ino = data->fid.vnode;
 	inode->i_version = data->fid.unique;
@@ -144,7 +144,7 @@
 /*
  * inode retrieval
  */
-inline int afs_iget(struct super_block *sb, afs_fid_t *fid,
+inline int afs_iget(struct super_block *sb, struct afs_fid *fid,
 		    struct inode **_inode)
 {
 	struct afs_iget_data data = { fid: *fid };
@@ -197,12 +197,10 @@
 	unlock_new_inode(inode);
 
 	*_inode = inode;
-	_leave(" = 0 [CB { v=%u x=%lu t=%u } c=%p]",
+	_leave(" = 0 [CB { v=%u x=%lu t=%u }]",
 	       vnode->cb_version,
 	       vnode->cb_timeout.timo_jif,
-	       vnode->cb_type,
-	       vnode->cache
-	       );
+	       vnode->cb_type);
 	return 0;
 
 	/* failure */
@@ -222,8 +220,8 @@
 int afs_inode_getattr(struct vfsmount *mnt, struct dentry *dentry,
 		      struct kstat *stat)
 {
+	struct afs_vnode *vnode;
 	struct inode *inode;
-	afs_vnode_t *vnode;
 	int ret;
 
 	inode = dentry->d_inode;
@@ -262,7 +260,7 @@
  */
 void afs_clear_inode(struct inode *inode)
 {
-	afs_vnode_t *vnode;
+	struct afs_vnode *vnode;
 
 	vnode = AFS_FS_I(inode);
 
diff -Nru a/fs/afs/internal.h b/fs/afs/internal.h
--- a/fs/afs/internal.h	Tue Feb  3 19:45:17 2004
+++ b/fs/afs/internal.h	Tue Feb  3 19:45:17 2004
@@ -46,7 +46,7 @@
 		siginfo_t sinfo;
 
 		spin_lock_irq(&current->sighand->siglock);
-		dequeue_signal(current,&current->blocked,&sinfo);
+		dequeue_signal(current,&current->blocked, &sinfo);
 		spin_unlock_irq(&current->sighand->siglock);
 	}
 }
@@ -74,17 +74,28 @@
 extern struct file_operations afs_file_file_operations;
 
 #ifdef AFS_CACHING_SUPPORT
-extern int afs_cache_get_page_cookie(struct page *page, struct cachefs_page **_page_cookie);
+extern int afs_cache_get_page_cookie(struct page *page,
+				     struct cachefs_page **_page_cookie);
 #endif
 
 /*
  * inode.c
  */
-extern int afs_iget(struct super_block *sb, afs_fid_t *fid, struct inode **_inode);
-extern int afs_inode_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat);
+extern int afs_iget(struct super_block *sb, struct afs_fid *fid,
+		    struct inode **_inode);
+extern int afs_inode_getattr(struct vfsmount *mnt, struct dentry *dentry,
+			     struct kstat *stat);
 extern void afs_clear_inode(struct inode *inode);
 
 /*
+ * key_afs.c
+ */
+#ifdef CONFIG_KEYS
+extern int afs_key_register(void);
+extern void afs_key_unregister(void);
+#endif
+
+/*
  * main.c
  */
 #ifdef AFS_CACHING_SUPPORT
@@ -102,7 +113,7 @@
 extern unsigned long afs_mntpt_expiry_timeout;
 #endif
 
-extern int afs_mntpt_check_symlink(afs_vnode_t *vnode);
+extern int afs_mntpt_check_symlink(struct afs_vnode *vnode);
 
 /*
  * super.c
@@ -110,13 +121,14 @@
 extern int afs_fs_init(void);
 extern void afs_fs_exit(void);
 
-#define AFS_CB_HASH_COUNT (PAGE_SIZE/sizeof(struct list_head))
+#define AFS_CB_HASH_COUNT (PAGE_SIZE / sizeof(struct list_head))
 
 extern struct list_head afs_cb_hash_tbl[];
 extern spinlock_t afs_cb_hash_lock;
 
 #define afs_cb_hash(SRV,FID) \
-	afs_cb_hash_tbl[((unsigned long)(SRV) + (FID)->vid + (FID)->vnode + (FID)->unique) % \
+	afs_cb_hash_tbl[((unsigned long)(SRV) + \
+			(FID)->vid + (FID)->vnode + (FID)->unique) % \
 			AFS_CB_HASH_COUNT]
 
 /*
@@ -124,7 +136,7 @@
  */
 extern int afs_proc_init(void);
 extern void afs_proc_cleanup(void);
-extern int afs_proc_cell_setup(afs_cell_t *cell);
-extern void afs_proc_cell_remove(afs_cell_t *cell);
+extern int afs_proc_cell_setup(struct afs_cell *cell);
+extern void afs_proc_cell_remove(struct afs_cell *cell);
 
 #endif /* AFS_INTERNAL_H */
diff -Nru a/fs/afs/kafsasyncd.c b/fs/afs/kafsasyncd.c
--- a/fs/afs/kafsasyncd.c	Tue Feb  3 19:45:42 2004
+++ b/fs/afs/kafsasyncd.c	Tue Feb  3 19:45:42 2004
@@ -57,8 +57,8 @@
 {
 	int ret;
 
-	ret = kernel_thread(kafsasyncd,NULL,0);
-	if (ret<0)
+	ret = kernel_thread(kafsasyncd, NULL, 0);
+	if (ret < 0)
 		return ret;
 
 	wait_for_completion(&kafsasyncd_alive);
@@ -85,14 +85,14 @@
  */
 static int kafsasyncd(void *arg)
 {
-	DECLARE_WAITQUEUE(myself,current);
-
-	struct list_head *_p;
+	struct afs_async_op *op;
 	int die;
 
+	DECLARE_WAITQUEUE(myself, current);
+
 	kafsasyncd_task = current;
 
-	printk("kAFS: Started kafsasyncd %d\n",current->pid);
+	printk("kAFS: Started kafsasyncd %d\n", current->pid);
 
 	daemonize("kafsasyncd");
 
@@ -101,7 +101,7 @@
 	/* loop around looking for things to attend to */
 	do {
 		set_current_state(TASK_INTERRUPTIBLE);
-		add_wait_queue(&kafsasyncd_sleepq,&myself);
+		add_wait_queue(&kafsasyncd_sleepq, &myself);
 
 		for (;;) {
 			if (!list_empty(&kafsasyncd_async_attnq) ||
@@ -113,7 +113,7 @@
 			set_current_state(TASK_INTERRUPTIBLE);
 		}
 
-		remove_wait_queue(&kafsasyncd_sleepq,&myself);
+		remove_wait_queue(&kafsasyncd_sleepq, &myself);
 		set_current_state(TASK_RUNNING);
 
 		/* discard pending signals */
@@ -121,7 +121,8 @@
 
 		die = kafsasyncd_die;
 
-		/* deal with the next asynchronous operation requiring attention */
+		/* deal with the next asynchronous operation requiring
+		 * attention */
 		if (!list_empty(&kafsasyncd_async_attnq)) {
 			struct afs_async_op *op;
 
@@ -131,14 +132,17 @@
 			spin_lock(&kafsasyncd_async_lock);
 
 			if (!list_empty(&kafsasyncd_async_attnq)) {
-				op = list_entry(kafsasyncd_async_attnq.next,afs_async_op_t,link);
+				op = list_entry(kafsasyncd_async_attnq.next,
+						struct afs_async_op, link);
 				list_del(&op->link);
-				list_add_tail(&op->link,&kafsasyncd_async_busyq);
+				list_add_tail(&op->link,
+					      &kafsasyncd_async_busyq);
 			}
 
 			spin_unlock(&kafsasyncd_async_lock);
 
-			_debug("@@@ Operation %p {%p}\n",op,op?op->ops:NULL);
+			_debug("@@@ Operation %p {%p}\n",
+			       op, op ? op->ops : NULL);
 
 			if (op)
 				op->ops->attend(op);
@@ -148,30 +152,30 @@
 
 	} while(!die);
 
-	/* need to kill all outstanding asynchronous operations before exiting */
+	/* need to kill all outstanding asynchronous operations before
+	 * exiting */
 	kafsasyncd_task = NULL;
 	spin_lock(&kafsasyncd_async_lock);
 
 	/* fold the busy and attention queues together */
-	list_splice_init(&kafsasyncd_async_busyq,&kafsasyncd_async_attnq);
+	list_splice_init(&kafsasyncd_async_busyq,
+			 &kafsasyncd_async_attnq);
 
 	/* dequeue kafsasyncd from all their wait queues */
-	list_for_each(_p,&kafsasyncd_async_attnq) {
-		afs_async_op_t *op = list_entry(_p,afs_async_op_t,link);
-
+	list_for_each_entry(op, &kafsasyncd_async_attnq, link) {
 		op->call->app_attn_func = kafsasyncd_null_call_attn_func;
 		op->call->app_error_func = kafsasyncd_null_call_error_func;
-		remove_wait_queue(&op->call->waitq,&op->waiter);
+		remove_wait_queue(&op->call->waitq, &op->waiter);
 	}
 
 	spin_unlock(&kafsasyncd_async_lock);
 
 	/* abort all the operations */
 	while (!list_empty(&kafsasyncd_async_attnq)) {
-		afs_async_op_t *op = list_entry(_p,afs_async_op_t,link);
+		op = list_entry(kafsasyncd_async_attnq.next, struct afs_async_op, link);
 		list_del_init(&op->link);
 
-		rxrpc_call_abort(op->call,-EIO);
+		rxrpc_call_abort(op->call, -EIO);
 		rxrpc_put_call(op->call);
 		op->call = NULL;
 
@@ -180,7 +184,7 @@
 
 	/* and that's all */
 	_leave("");
-	complete_and_exit(&kafsasyncd_dead,0);
+	complete_and_exit(&kafsasyncd_dead, 0);
 
 } /* end kafsasyncd() */
 
@@ -189,17 +193,17 @@
  * begin an operation
  * - place operation on busy queue
  */
-void afs_kafsasyncd_begin_op(afs_async_op_t *op)
+void afs_kafsasyncd_begin_op(struct afs_async_op *op)
 {
 	_enter("");
 
 	spin_lock(&kafsasyncd_async_lock);
 
-	init_waitqueue_entry(&op->waiter,kafsasyncd_task);
-	add_wait_queue(&op->call->waitq,&op->waiter);
+	init_waitqueue_entry(&op->waiter, kafsasyncd_task);
+	add_wait_queue(&op->call->waitq, &op->waiter);
 
 	list_del(&op->link);
-	list_add_tail(&op->link,&kafsasyncd_async_busyq);
+	list_add_tail(&op->link, &kafsasyncd_async_busyq);
 
 	spin_unlock(&kafsasyncd_async_lock);
 
@@ -211,14 +215,14 @@
  * request attention for an operation
  * - move to attention queue
  */
-void afs_kafsasyncd_attend_op(afs_async_op_t *op)
+void afs_kafsasyncd_attend_op(struct afs_async_op *op)
 {
 	_enter("");
 
 	spin_lock(&kafsasyncd_async_lock);
 
 	list_del(&op->link);
-	list_add_tail(&op->link,&kafsasyncd_async_attnq);
+	list_add_tail(&op->link, &kafsasyncd_async_attnq);
 
 	spin_unlock(&kafsasyncd_async_lock);
 
@@ -232,7 +236,7 @@
  * terminate an operation
  * - remove from either queue
  */
-void afs_kafsasyncd_terminate_op(afs_async_op_t *op)
+void afs_kafsasyncd_terminate_op(struct afs_async_op *op)
 {
 	_enter("");
 
@@ -240,7 +244,7 @@
 
 	if (!list_empty(&op->link)) {
 		list_del_init(&op->link);
-		remove_wait_queue(&op->call->waitq,&op->waiter);
+		remove_wait_queue(&op->call->waitq, &op->waiter);
 	}
 
 	spin_unlock(&kafsasyncd_async_lock);
diff -Nru a/fs/afs/kafsasyncd.h b/fs/afs/kafsasyncd.h
--- a/fs/afs/kafsasyncd.h	Tue Feb  3 19:45:17 2004
+++ b/fs/afs/kafsasyncd.h	Tue Feb  3 19:45:17 2004
@@ -14,9 +14,11 @@
 
 #include "types.h"
 
+struct afs_async_op;
+
 struct afs_async_op_ops {
-	void (*attend)(afs_async_op_t *op);
-	void (*discard)(afs_async_op_t *op);
+	void (*attend)(struct afs_async_op *op);
+	void (*discard)(struct afs_async_op *op);
 };
 
 /*****************************************************************************/
@@ -26,13 +28,14 @@
 struct afs_async_op
 {
 	struct list_head		link;
-	afs_server_t			*server;	/* server being contacted */
+	struct afs_server		*server;	/* server being contacted */
 	struct rxrpc_call		*call;		/* RxRPC call performing op */
 	wait_queue_t			waiter;		/* wait queue for kafsasyncd */
 	const struct afs_async_op_ops	*ops;		/* operations */
 };
 
-static inline void afs_async_op_init(afs_async_op_t *op, const struct afs_async_op_ops *ops)
+static inline void afs_async_op_init(struct afs_async_op *op,
+				     const struct afs_async_op_ops *ops)
 {
 	INIT_LIST_HEAD(&op->link);
 	op->call = NULL;
@@ -42,8 +45,8 @@
 extern int afs_kafsasyncd_start(void);
 extern void afs_kafsasyncd_stop(void);
 
-extern void afs_kafsasyncd_begin_op(afs_async_op_t *op);
-extern void afs_kafsasyncd_attend_op(afs_async_op_t *op);
-extern void afs_kafsasyncd_terminate_op(afs_async_op_t *op);
+extern void afs_kafsasyncd_begin_op(struct afs_async_op *op);
+extern void afs_kafsasyncd_attend_op(struct afs_async_op *op);
+extern void afs_kafsasyncd_terminate_op(struct afs_async_op *op);
 
 #endif /* _LINUX_AFS_KAFSASYNCD_H */
diff -Nru a/fs/afs/kafstimod.c b/fs/afs/kafstimod.c
--- a/fs/afs/kafstimod.c	Tue Feb  3 19:45:29 2004
+++ b/fs/afs/kafstimod.c	Tue Feb  3 19:45:29 2004
@@ -37,8 +37,8 @@
 {
 	int ret;
 
-	ret = kernel_thread(kafstimod,NULL,0);
-	if (ret<0)
+	ret = kernel_thread(kafstimod, NULL, 0);
+	if (ret < 0)
 		return ret;
 
 	wait_for_completion(&kafstimod_alive);
@@ -65,11 +65,11 @@
  */
 static int kafstimod(void *arg)
 {
-	DECLARE_WAITQUEUE(myself,current);
+	struct afs_timer *timer;
 
-	afs_timer_t *timer;
+	DECLARE_WAITQUEUE(myself, current);
 
-	printk("kAFS: Started kafstimod %d\n",current->pid);
+	printk("kAFS: Started kafstimod %d\n", current->pid);
 
 	daemonize("kafstimod");
 
@@ -78,7 +78,7 @@
 	/* loop around looking for things to attend to */
  loop:
 	set_current_state(TASK_INTERRUPTIBLE);
-	add_wait_queue(&kafstimod_sleepq,&myself);
+	add_wait_queue(&kafstimod_sleepq, &myself);
 
 	for (;;) {
 		unsigned long jif;
@@ -86,9 +86,9 @@
 
 		/* deal with the server being asked to die */
 		if (kafstimod_die) {
-			remove_wait_queue(&kafstimod_sleepq,&myself);
+			remove_wait_queue(&kafstimod_sleepq, &myself);
 			_leave("");
-			complete_and_exit(&kafstimod_dead,0);
+			complete_and_exit(&kafstimod_dead, 0);
 		}
 
 		/* discard pending signals */
@@ -100,15 +100,16 @@
 			timeout = MAX_SCHEDULE_TIMEOUT;
 		}
 		else {
-			timer = list_entry(kafstimod_list.next,afs_timer_t,link);
+			timer = list_entry(kafstimod_list.next,
+					   struct afs_timer, link);
 			timeout = timer->timo_jif;
 			jif = jiffies;
 
-			if (time_before_eq((unsigned long)timeout,jif))
+			if (time_before_eq((unsigned long) timeout, jif))
 				goto immediate;
 
 			else {
-				timeout = (long)timeout - (long)jiffies;
+				timeout = (long) timeout - (long) jiffies;
 			}
 		}
 		spin_unlock(&kafstimod_lock);
@@ -119,13 +120,14 @@
 	}
 
 	/* the thing on the front of the queue needs processing
-	 * - we come here with the lock held and timer pointing to the expired entry
+	 * - we come here with the lock held and timer pointing to the expired
+	 *   entry
 	 */
  immediate:
-	remove_wait_queue(&kafstimod_sleepq,&myself);
+	remove_wait_queue(&kafstimod_sleepq, &myself);
 	set_current_state(TASK_RUNNING);
 
-	_debug("@@@ Begin Timeout of %p",timer);
+	_debug("@@@ Begin Timeout of %p", timer);
 
 	/* dequeue the timer */
 	list_del_init(&timer->link);
@@ -143,27 +145,28 @@
 /*
  * (re-)queue a timer
  */
-void afs_kafstimod_add_timer(afs_timer_t *timer, unsigned long timeout)
+void afs_kafstimod_add_timer(struct afs_timer *timer, unsigned long timeout)
 {
+	struct afs_timer *ptimer;
 	struct list_head *_p;
-	afs_timer_t *ptimer;
 
-	_enter("%p,%lu",timer,timeout);
+	_enter("%p,%lu", timer, timeout);
 
 	spin_lock(&kafstimod_lock);
 
 	list_del(&timer->link);
 
-	/* the timer was deferred or reset - put it back in the queue at the right place */
+	/* the timer was deferred or reset - put it back in the queue at the
+	 * right place */
 	timer->timo_jif = jiffies + timeout;
 
-	list_for_each(_p,&kafstimod_list) {
-		ptimer = list_entry(_p,afs_timer_t,link);
-		if (time_before(timer->timo_jif,ptimer->timo_jif))
+	list_for_each(_p, &kafstimod_list) {
+		ptimer = list_entry(_p, struct afs_timer, link);
+		if (time_before(timer->timo_jif, ptimer->timo_jif))
 			break;
 	}
 
-	list_add_tail(&timer->link,_p); /* insert before stopping point */
+	list_add_tail(&timer->link, _p); /* insert before stopping point */
 
 	spin_unlock(&kafstimod_lock);
 
@@ -177,11 +180,11 @@
  * dequeue a timer
  * - returns 0 if the timer was deleted or -ENOENT if it wasn't queued
  */
-int afs_kafstimod_del_timer(afs_timer_t *timer)
+int afs_kafstimod_del_timer(struct afs_timer *timer)
 {
 	int ret = 0;
 
-	_enter("%p",timer);
+	_enter("%p", timer);
 
 	spin_lock(&kafstimod_lock);
 
@@ -194,6 +197,6 @@
 
 	wake_up(&kafstimod_sleepq);
 
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 } /* end afs_kafstimod_del_timer() */
diff -Nru a/fs/afs/kafstimod.h b/fs/afs/kafstimod.h
--- a/fs/afs/kafstimod.h	Tue Feb  3 19:45:30 2004
+++ b/fs/afs/kafstimod.h	Tue Feb  3 19:45:30 2004
@@ -14,6 +14,8 @@
 
 #include "types.h"
 
+struct afs_timer;
+
 struct afs_timer_ops {
 	/* called when the front of the timer queue has timed out */
 	void (*timed_out)(struct afs_timer *timer);
@@ -30,7 +32,8 @@
 	const struct afs_timer_ops	*ops;		/* timeout expiry function */
 };
 
-static inline void afs_timer_init(afs_timer_t *timer, const struct afs_timer_ops *ops)
+static inline void afs_timer_init(struct afs_timer *timer,
+				  const struct afs_timer_ops *ops)
 {
 	INIT_LIST_HEAD(&timer->link);
 	timer->ops = ops;
@@ -39,7 +42,8 @@
 extern int afs_kafstimod_start(void);
 extern void afs_kafstimod_stop(void);
 
-extern void afs_kafstimod_add_timer(afs_timer_t *timer, unsigned long timeout);
-extern int afs_kafstimod_del_timer(afs_timer_t *timer);
+extern void afs_kafstimod_add_timer(struct afs_timer *timer,
+				    unsigned long timeout);
+extern int afs_kafstimod_del_timer(struct afs_timer *timer);
 
 #endif /* _LINUX_AFS_KAFSTIMOD_H */
diff -Nru a/fs/afs/main.c b/fs/afs/main.c
--- a/fs/afs/main.c	Tue Feb  3 19:45:17 2004
+++ b/fs/afs/main.c	Tue Feb  3 19:45:17 2004
@@ -33,13 +33,24 @@
 static int afs_adding_peer(struct rxrpc_peer *peer);
 static void afs_discarding_peer(struct rxrpc_peer *peer);
 
-module_init(afs_init);
+/* XXX late_initcall is kludgy, but the only alternative seems to create
+ * a transport upon the first mount, which is worse. Or is it?
+ */
+/* module_init(afs_init); */
+late_initcall(afs_init);	/* must be called after net/ to create socket */
+
 module_exit(afs_exit);
 
 MODULE_DESCRIPTION("AFS Client File System");
 MODULE_AUTHOR("Red Hat, Inc.");
 MODULE_LICENSE("GPL");
 
+static char *rootcell;
+
+MODULE_PARM(rootcell, "s");
+MODULE_PARM_DESC(rootcell, "root AFS cell name and VL server IP addr list");
+
+
 static struct rxrpc_peer_ops afs_peer_ops = {
 	.adding		= afs_adding_peer,
 	.discarding	= afs_discarding_peer,
@@ -72,7 +83,7 @@
 
 	/* initialise the callback hash table */
 	spin_lock_init(&afs_cb_hash_lock);
-	for (loop=AFS_CB_HASH_COUNT-1; loop>=0; loop--)
+	for (loop = AFS_CB_HASH_COUNT - 1; loop >= 0; loop--)
 		INIT_LIST_HEAD(&afs_cb_hash_tbl[loop]);
 
 	/* register the /proc stuff */
@@ -82,20 +93,27 @@
 
 #ifdef AFS_CACHING_SUPPORT
 	/* we want to be able to cache */
-	ret = cachefs_register_netfs(&afs_cache_netfs,&afs_cache_cell_index_def);
+	ret = cachefs_register_netfs(&afs_cache_netfs,
+				     &afs_cache_cell_index_def);
 	if (ret < 0)
 		goto error;
 #endif
 
-	/* initialise the cell DB */
-	ret = afs_cell_init();
+#ifdef CONFIG_KEYS
+	ret = afs_key_register();
 	if (ret < 0)
 		goto error_cache;
+#endif
+
+	/* initialise the cell DB */
+	ret = afs_cell_init(rootcell);
+	if (ret < 0)
+		goto error_keys;
 
 	/* start the timeout daemon */
 	ret = afs_kafstimod_start();
 	if (ret < 0)
-		goto error_cache;
+		goto error_keys;
 
 	/* start the async operation daemon */
 	ret = afs_kafsasyncd_start();
@@ -103,7 +121,7 @@
 		goto error_kafstimod;
 
 	/* create the RxRPC transport */
-	ret = rxrpc_create_transport(7001,&afs_transport);
+	ret = rxrpc_create_transport(7001, &afs_transport);
 	if (ret < 0)
 		goto error_kafsasyncd;
 
@@ -122,14 +140,18 @@
 	afs_kafsasyncd_stop();
  error_kafstimod:
 	afs_kafstimod_stop();
+ error_keys:
+#ifdef CONFIG_KEYS
+	afs_key_unregister();
  error_cache:
+#endif
 #ifdef AFS_CACHING_SUPPORT
 	cachefs_unregister_netfs(&afs_cache_netfs);
  error:
 #endif
 	afs_cell_purge();
 	afs_proc_cleanup();
-	printk(KERN_ERR "kAFS: failed to register: %d\n",ret);
+	printk(KERN_ERR "kAFS: failed to register: %d\n", ret);
 	return ret;
 } /* end afs_init() */
 
@@ -146,6 +168,9 @@
 	afs_kafstimod_stop();
 	afs_kafsasyncd_stop();
 	afs_cell_purge();
+#ifdef CONFIG_KEYS
+	afs_key_unregister();
+#endif
 #ifdef AFS_CACHING_SUPPORT
 	cachefs_unregister_netfs(&afs_cache_netfs);
 #endif
@@ -162,19 +187,20 @@
  */
 static int afs_adding_peer(struct rxrpc_peer *peer)
 {
-	afs_server_t *server;
+	struct afs_server *server;
 	int ret;
 
-	_debug("kAFS: Adding new peer %08x\n",ntohl(peer->addr.s_addr));
+	_debug("kAFS: Adding new peer %08x\n", ntohl(peer->addr.s_addr));
 
 	/* determine which server the peer resides in (if any) */
-	ret = afs_server_find_by_peer(peer,&server);
+	ret = afs_server_find_by_peer(peer, &server);
 	if (ret < 0)
 		return ret; /* none that we recognise, so abort */
 
-	_debug("Server %p{u=%d}\n",server,atomic_read(&server->usage));
+	_debug("Server %p{u=%d}\n", server, atomic_read(&server->usage));
 
-	_debug("Cell %p{u=%d}\n",server->cell,atomic_read(&server->cell->usage));
+	_debug("Cell %p{u=%d}\n",
+	       server->cell, atomic_read(&server->cell->usage));
 
 	/* cross-point the structs under a global lock */
 	spin_lock(&afs_server_peer_lock);
@@ -194,14 +220,14 @@
  */
 static void afs_discarding_peer(struct rxrpc_peer *peer)
 {
-	afs_server_t *server;
+	struct afs_server *server;
 
 	_enter("%p",peer);
 
 	_debug("Discarding peer %08x (rtt=%lu.%lumS)\n",
 	       ntohl(peer->addr.s_addr),
-	       (long)(peer->rtt/1000),
-	       (long)(peer->rtt%1000));
+	       (long) (peer->rtt / 1000),
+	       (long) (peer->rtt % 1000));
 
 	/* uncross-point the structs under a global lock */
 	spin_lock(&afs_server_peer_lock);
@@ -209,9 +235,6 @@
 	if (server) {
 		peer->user = NULL;
 		server->peer = NULL;
-
-		//_debug("Server %p{u=%d}\n",server,atomic_read(&server->usage));
-		//_debug("Cell %p{u=%d}\n",server->cell,atomic_read(&server->cell->usage));
 	}
 	spin_unlock(&afs_server_peer_lock);
 
@@ -239,7 +262,7 @@
                     "  movl    $0xedededed,%%eax     \n"
                     "  rep stosl               \n"
                     :
-                    : "i"(~(THREAD_SIZE-1)), "i"(sizeof(struct thread_info))
+                    : "i"(~(THREAD_SIZE - 1)), "i"(sizeof(struct thread_info))
                     : "eax", "ecx", "edi", "memory", "cc"
                     );
 }
@@ -258,7 +281,7 @@
                     "  movl    $0xdadadada,%%eax     \n"
                     "  rep stosl               \n"
                     :
-                    : "i"(~(THREAD_SIZE-1)), "i"(sizeof(struct thread_info))
+                    : "i"(~(THREAD_SIZE - 1)), "i"(sizeof(struct thread_info))
                     : "eax", "ecx", "edi", "memory", "cc"
                     );
 }
diff -Nru a/fs/afs/mntpt.c b/fs/afs/mntpt.c
--- a/fs/afs/mntpt.c	Tue Feb  3 19:45:17 2004
+++ b/fs/afs/mntpt.c	Tue Feb  3 19:45:17 2004
@@ -67,18 +67,21 @@
  * check a symbolic link to see whether it actually encodes a mountpoint
  * - sets the AFS_VNODE_MOUNTPOINT flag on the vnode appropriately
  */
-int afs_mntpt_check_symlink(afs_vnode_t *vnode)
+int afs_mntpt_check_symlink(struct afs_vnode *vnode)
 {
 	struct page *page;
+	filler_t *filler;
 	size_t size;
 	char *buf;
 	int ret;
 
-	_enter("{%u,%u}",vnode->fid.vnode,vnode->fid.unique);
+	_enter("{%u,%u}", vnode->fid.vnode, vnode->fid.unique);
 
 	/* read the contents of the symlink into the pagecache */
-	page = read_cache_page(AFS_VNODE_TO_I(vnode)->i_mapping,0,
-			       (filler_t*)AFS_VNODE_TO_I(vnode)->i_mapping->a_ops->readpage,NULL);
+	filler = (filler_t *) AFS_VNODE_TO_I(vnode)->i_mapping->a_ops->readpage;
+
+	page = read_cache_page(AFS_VNODE_TO_I(vnode)->i_mapping, 0,
+			       filler, NULL);
 	if (IS_ERR(page)) {
 		ret = PTR_ERR(page);
 		goto out;
@@ -94,11 +97,11 @@
 
 	/* examine the symlink's contents */
 	size = vnode->status.size;
-	_debug("symlink to %*.*s",size,(int)size,buf);
+	_debug("symlink to %*.*s", size, (int) size, buf);
 
-	if (size>2 &&
-	    (buf[0]=='%' || buf[0]=='#') &&
-	    buf[size-1]=='.'
+	if (size > 2 &&
+	    (buf[0] == '%' || buf[0] == '#') &&
+	    buf[size - 1] == '.'
 	    ) {
 		_debug("symlink is a mountpoint");
 		spin_lock(&vnode->lock);
@@ -112,7 +115,7 @@
 	kunmap(page);
 	page_cache_release(page);
  out:
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 
 } /* end afs_mntpt_check_symlink() */
@@ -129,7 +132,8 @@
 	       dir,
 	       dentry,
 	       dentry->d_parent,
-	       dentry->d_parent ? dentry->d_parent->d_name.name : (const unsigned char*)"",
+	       dentry->d_parent ?
+	       dentry->d_parent->d_name.name : (const unsigned char *) "",
 	       dentry->d_name.name);
 
 	return ERR_PTR(-EREMOTE);
@@ -144,7 +148,9 @@
 	kenter("%p,%p{%p{%s},%s}",
 	       inode, file,
 	       file->f_dentry->d_parent,
-	       file->f_dentry->d_parent ? file->f_dentry->d_parent->d_name.name : (const unsigned char*)"",
+	       file->f_dentry->d_parent ?
+	       file->f_dentry->d_parent->d_name.name :
+	       (const unsigned char *) "",
 	       file->f_dentry->d_name.name);
 
 	return -EREMOTE;
@@ -183,10 +189,9 @@
 		goto error;
 
 	/* read the contents of the AFS special symlink */
-	page = read_cache_page(mntpt->d_inode->i_mapping,
-			       0,
-			       (filler_t*)mntpt->d_inode->i_mapping->a_ops->readpage,
-			       NULL);
+	filler_t *filler = mntpt->d_inode->i_mapping->a_ops->readpage;
+
+	page = read_cache_page(mntpt->d_inode->i_mapping, 0, filler, NULL);
 	if (IS_ERR(page)) {
 		ret = PTR_ERR(page);
 		goto error;
@@ -208,26 +213,26 @@
 	memcpy(options, "cell=", 5);
 	strcpy(options + 5, super->volume->cell->name);
 	if (super->volume->type == AFSVL_RWVOL)
-		strcat(options,",rwpath");
+		strcat(options, ",rwpath");
 
 	/* try and do the mount */
 	kdebug("--- attempting mount %s -o %s ---", devname, options);
 	mnt = do_kern_mount("afs", 0, devname, options);
 	kdebug("--- mount result %p ---", mnt);
 
-	free_page((unsigned long)devname);
-	free_page((unsigned long)options);
-	kleave(" = %p",mnt);
+	free_page((unsigned long) devname);
+	free_page((unsigned long) options);
+	kleave(" = %p", mnt);
 	return mnt;
 
  error:
 	if (page)
 		page_cache_release(page);
 	if (devname)
-		free_page((unsigned long)devname);
+		free_page((unsigned long) devname);
 	if (options)
-		free_page((unsigned long)options);
-	kleave(" = %d",ret);
+		free_page((unsigned long) options);
+	kleave(" = %d", ret);
 	return ERR_PTR(ret);
 } /* end afs_mntpt_do_automount() */
 
@@ -252,7 +257,7 @@
 	if (IS_ERR(newmnt))
 		return PTR_ERR(newmnt);
 
-	struct_cpy(&newnd,nd);
+	struct_cpy(&newnd, nd);
 	newnd.dentry = dentry;
 	err = do_add_mount(newmnt, &newnd, 0, &afs_vfsmounts);
 
diff -Nru a/fs/afs/proc.c b/fs/afs/proc.c
--- a/fs/afs/proc.c	Tue Feb  3 19:45:17 2004
+++ b/fs/afs/proc.c	Tue Feb  3 19:45:17 2004
@@ -27,7 +27,8 @@
 static void *afs_proc_cells_next(struct seq_file *p, void *v, loff_t *pos);
 static void afs_proc_cells_stop(struct seq_file *p, void *v);
 static int afs_proc_cells_show(struct seq_file *m, void *v);
-static ssize_t afs_proc_cells_write(struct file *file, const char *buf, size_t size, loff_t *_pos);
+static ssize_t afs_proc_cells_write(struct file *file, const char *buf,
+				    size_t size, loff_t *_pos);
 
 static struct seq_operations afs_proc_cells_ops = {
 	.start	= afs_proc_cells_start,
@@ -44,10 +45,27 @@
 	.release	= seq_release,
 };
 
+static int afs_proc_rootcell_open(struct inode *inode, struct file *file);
+static int afs_proc_rootcell_release(struct inode *inode, struct file *file);
+static ssize_t afs_proc_rootcell_read(struct file *file, char *buf,
+				      size_t size, loff_t *_pos);
+static ssize_t afs_proc_rootcell_write(struct file *file, const char *buf,
+				       size_t size, loff_t *_pos);
+
+static struct file_operations afs_proc_rootcell_fops = {
+	.open		= afs_proc_rootcell_open,
+	.read		= afs_proc_rootcell_read,
+	.write		= afs_proc_rootcell_write,
+	.llseek		= no_llseek,
+	.release	= afs_proc_rootcell_release
+};
+
 static int afs_proc_cell_volumes_open(struct inode *inode, struct file *file);
-static int afs_proc_cell_volumes_release(struct inode *inode, struct file *file);
+static int afs_proc_cell_volumes_release(struct inode *inode,
+					 struct file *file);
 static void *afs_proc_cell_volumes_start(struct seq_file *p, loff_t *pos);
-static void *afs_proc_cell_volumes_next(struct seq_file *p, void *v, loff_t *pos);
+static void *afs_proc_cell_volumes_next(struct seq_file *p, void *v,
+					loff_t *pos);
 static void afs_proc_cell_volumes_stop(struct seq_file *p, void *v);
 static int afs_proc_cell_volumes_show(struct seq_file *m, void *v);
 
@@ -65,10 +83,13 @@
 	.release	= afs_proc_cell_volumes_release,
 };
 
-static int afs_proc_cell_vlservers_open(struct inode *inode, struct file *file);
-static int afs_proc_cell_vlservers_release(struct inode *inode, struct file *file);
+static int afs_proc_cell_vlservers_open(struct inode *inode,
+					struct file *file);
+static int afs_proc_cell_vlservers_release(struct inode *inode,
+					   struct file *file);
 static void *afs_proc_cell_vlservers_start(struct seq_file *p, loff_t *pos);
-static void *afs_proc_cell_vlservers_next(struct seq_file *p, void *v, loff_t *pos);
+static void *afs_proc_cell_vlservers_next(struct seq_file *p, void *v,
+					  loff_t *pos);
 static void afs_proc_cell_vlservers_stop(struct seq_file *p, void *v);
 static int afs_proc_cell_vlservers_show(struct seq_file *m, void *v);
 
@@ -87,9 +108,11 @@
 };
 
 static int afs_proc_cell_servers_open(struct inode *inode, struct file *file);
-static int afs_proc_cell_servers_release(struct inode *inode, struct file *file);
+static int afs_proc_cell_servers_release(struct inode *inode,
+					 struct file *file);
 static void *afs_proc_cell_servers_start(struct seq_file *p, loff_t *pos);
-static void *afs_proc_cell_servers_next(struct seq_file *p, void *v, loff_t *pos);
+static void *afs_proc_cell_servers_next(struct seq_file *p, void *v,
+					loff_t *pos);
 static void afs_proc_cell_servers_stop(struct seq_file *p, void *v);
 static int afs_proc_cell_servers_show(struct seq_file *m, void *v);
 
@@ -117,26 +140,30 @@
 
 	_enter("");
 
-	proc_afs = proc_mkdir("fs/afs",NULL);
+	proc_afs = proc_mkdir("fs/afs", NULL);
 	if (!proc_afs)
 		goto error;
 	proc_afs->owner = THIS_MODULE;
 
-	p = create_proc_entry("cells",0,proc_afs);
+	p = create_proc_entry("cells", 0, proc_afs);
 	if (!p)
 		goto error_proc;
 	p->proc_fops = &afs_proc_cells_fops;
 	p->owner = THIS_MODULE;
 
+	p = create_proc_entry("rootcell", 0, proc_afs);
+	if (!p)
+		goto error_cells;
+	p->proc_fops = &afs_proc_rootcell_fops;
+	p->owner = THIS_MODULE;
+
 	_leave(" = 0");
 	return 0;
 
-#if 0
  error_cells:
-	remove_proc_entry("cells",proc_afs);
-#endif
+ 	remove_proc_entry("cells", proc_afs);
  error_proc:
-	remove_proc_entry("fs/afs",NULL);
+	remove_proc_entry("fs/afs", NULL);
  error:
 	_leave(" = -ENOMEM");
 	return -ENOMEM;
@@ -149,9 +176,9 @@
  */
 void afs_proc_cleanup(void)
 {
-	remove_proc_entry("cells",proc_afs);
+	remove_proc_entry("cells", proc_afs);
 
-	remove_proc_entry("fs/afs",NULL);
+	remove_proc_entry("fs/afs", NULL);
 
 } /* end afs_proc_cleanup() */
 
@@ -164,8 +191,8 @@
 	struct seq_file *m;
 	int ret;
 
-	ret = seq_open(file,&afs_proc_cells_ops);
-	if (ret<0)
+	ret = seq_open(file, &afs_proc_cells_ops);
+	if (ret < 0)
 		return ret;
 
 	m = file->private_data;
@@ -176,7 +203,8 @@
 
 /*****************************************************************************/
 /*
- * set up the iterator to start reading from the cells list and return the first item
+ * set up the iterator to start reading from the cells list and return the
+ * first item
  */
 static void *afs_proc_cells_start(struct seq_file *m, loff_t *_pos)
 {
@@ -188,15 +216,15 @@
 
 	/* allow for the header line */
 	if (!pos)
-		return (void *)1;
+		return (void *) 1;
 	pos--;
 
 	/* find the n'th element in the list */
-	list_for_each(_p,&afs_proc_cells)
+	list_for_each(_p, &afs_proc_cells)
 		if (!pos--)
 			break;
 
-	return _p!=&afs_proc_cells ? _p : NULL;
+	return _p != &afs_proc_cells ? _p : NULL;
 } /* end afs_proc_cells_start() */
 
 /*****************************************************************************/
@@ -210,9 +238,9 @@
 	(*pos)++;
 
 	_p = v;
-	_p = v==(void*)1 ? afs_proc_cells.next : _p->next;
+	_p = v == (void *) 1 ? afs_proc_cells.next : _p->next;
 
-	return _p!=&afs_proc_cells ? _p : NULL;
+	return _p != &afs_proc_cells ? _p : NULL;
 } /* end afs_proc_cells_next() */
 
 /*****************************************************************************/
@@ -231,16 +259,16 @@
  */
 static int afs_proc_cells_show(struct seq_file *m, void *v)
 {
-	afs_cell_t *cell = list_entry(v,afs_cell_t,proc_link);
+	struct afs_cell *cell = list_entry(v, struct afs_cell, proc_link);
 
 	/* display header on line 1 */
-	if (v == (void *)1) {
+	if (v == (void *) 1) {
 		seq_puts(m, "USE NAME\n");
 		return 0;
 	}
 
 	/* display one cell per line on subsequent lines */
-	seq_printf(m,"%3d %s\n",atomic_read(&cell->usage),cell->name);
+	seq_printf(m, "%3d %s\n", atomic_read(&cell->usage), cell->name);
 
 	return 0;
 } /* end afs_proc_cells_show() */
@@ -248,51 +276,61 @@
 /*****************************************************************************/
 /*
  * handle writes to /proc/fs/afs/cells
- * - to add cells: echo "add <cellname> <IP>[:<IP>][:<IP>]*
+ * - to add cells: echo "add <cellname> <IP>[:<IP>][:<IP>]"
  */
-static ssize_t afs_proc_cells_write(struct file *file, const char *buf, size_t size, loff_t *_pos)
+static ssize_t afs_proc_cells_write(struct file *file, const char *buf,
+				    size_t size, loff_t *_pos)
 {
 	char *kbuf, *name, *args;
 	int ret;
 
 	/* start by dragging the command into memory */
-	if (size<=1 || size>=PAGE_SIZE)
+	if (size <= 1 || size >= PAGE_SIZE)
 		return -EINVAL;
 
-	kbuf = kmalloc(size+1,GFP_KERNEL);
+	kbuf = kmalloc(size + 1, GFP_KERNEL);
 	if (!kbuf)
 		return -ENOMEM;
 
 	ret = -EFAULT;
-	if (copy_from_user(kbuf,buf,size)!=0)
+	if (copy_from_user(kbuf, buf, size) != 0)
 		goto done;
 	kbuf[size] = 0;
 
 	/* trim to first NL */
-	name = memchr(kbuf,'\n',size);
-	if (name) *name = 0;
+	name = memchr(kbuf, '\n', size);
+	if (name)
+		*name = 0;
 
 	/* split into command, name and argslist */
-	name = strchr(kbuf,' ');
-	if (!name) goto inval;
-	do { *name++ = 0; } while(*name==' ');
-	if (!*name) goto inval;
-
-	args = strchr(name,' ');
-	if (!args) goto inval;
-	do { *args++ = 0; } while(*args==' ');
-	if (!*args) goto inval;
+	name = strchr(kbuf, ' ');
+	if (!name)
+		goto inval;
+	do {
+		*name++ = 0;
+	} while(*name == ' ');
+	if (!*name)
+		goto inval;
+
+	args = strchr(name, ' ');
+	if (!args)
+		goto inval;
+	do {
+		*args++ = 0;
+	} while(*args == ' ');
+	if (!*args)
+		goto inval;
 
 	/* determine command to perform */
-	_debug("cmd=%s name=%s args=%s",kbuf,name,args);
+	_debug("cmd=%s name=%s args=%s", kbuf, name, args);
 
-	if (strcmp(kbuf,"add")==0) {
-		afs_cell_t *cell;
-		ret = afs_cell_create(name,args,&cell);
-		if (ret<0)
+	if (strcmp(kbuf, "add") == 0) {
+		struct afs_cell *cell;
+		ret = afs_cell_create(name, args, &cell);
+		if (ret < 0)
 			goto done;
 
-		printk("kAFS: Added new cell '%s'\n",name);
+		printk("kAFS: Added new cell '%s'\n", name);
 	}
 	else {
 		goto inval;
@@ -302,7 +340,7 @@
 
  done:
 	kfree(kbuf);
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 
  inval:
@@ -313,33 +351,97 @@
 
 /*****************************************************************************/
 /*
+ * Stubs for /proc/fs/afs/rootcell
+ */
+static int afs_proc_rootcell_open(struct inode *inode, struct file *file)
+{
+	return 0;
+}
+
+static int afs_proc_rootcell_release(struct inode *inode, struct file *file)
+{
+	return 0;
+}
+
+static ssize_t afs_proc_rootcell_read(struct file *file, char *buf,
+				      size_t size, loff_t *_pos)
+{
+	return 0;
+}
+
+/*****************************************************************************/
+/*
+ * handle writes to /proc/fs/afs/rootcell
+ * - to initialize rootcell: echo "cell.name:192.168.231.14"
+ */
+static ssize_t afs_proc_rootcell_write(struct file *file, const char *buf,
+				       size_t size, loff_t *_pos)
+{
+	char *kbuf, *s;
+	int ret;
+
+	/* start by dragging the command into memory */
+	if (size <= 1 || size >= PAGE_SIZE)
+		return -EINVAL;
+
+	ret = -ENOMEM;
+	kbuf = kmalloc(size + 1, GFP_KERNEL);
+	if (!kbuf)
+		goto nomem;
+
+	ret = -EFAULT;
+	if (copy_from_user(kbuf, buf, size) != 0)
+		goto infault;
+	kbuf[size] = 0;
+
+	/* trim to first NL */
+	s = memchr(kbuf, '\n', size);
+	if (s)
+		*s = 0;
+
+	/* determine command to perform */
+	_debug("rootcell=%s", kbuf);
+
+	ret = afs_cell_init(kbuf);
+	if (ret >= 0)
+		ret = size;	/* consume everything, always */
+
+ infault:
+	kfree(kbuf);
+ nomem:
+	_leave(" = %d", ret);
+	return ret;
+} /* end afs_proc_rootcell_write() */
+
+/*****************************************************************************/
+/*
  * initialise /proc/fs/afs/<cell>/
  */
-int afs_proc_cell_setup(afs_cell_t *cell)
+int afs_proc_cell_setup(struct afs_cell *cell)
 {
 	struct proc_dir_entry *p;
 
-	_enter("%p{%s}",cell,cell->name);
+	_enter("%p{%s}", cell, cell->name);
 
-	cell->proc_dir = proc_mkdir(cell->name,proc_afs);
+	cell->proc_dir = proc_mkdir(cell->name, proc_afs);
 	if (!cell->proc_dir)
 		return -ENOMEM;
 
-	p = create_proc_entry("servers",0,cell->proc_dir);
+	p = create_proc_entry("servers", 0, cell->proc_dir);
 	if (!p)
 		goto error_proc;
 	p->proc_fops = &afs_proc_cell_servers_fops;
 	p->owner = THIS_MODULE;
 	p->data = cell;
 
-	p = create_proc_entry("vlservers",0,cell->proc_dir);
+	p = create_proc_entry("vlservers", 0, cell->proc_dir);
 	if (!p)
 		goto error_servers;
 	p->proc_fops = &afs_proc_cell_vlservers_fops;
 	p->owner = THIS_MODULE;
 	p->data = cell;
 
-	p = create_proc_entry("volumes",0,cell->proc_dir);
+	p = create_proc_entry("volumes", 0, cell->proc_dir);
 	if (!p)
 		goto error_vlservers;
 	p->proc_fops = &afs_proc_cell_volumes_fops;
@@ -350,11 +452,11 @@
 	return 0;
 
  error_vlservers:
-	remove_proc_entry("vlservers",cell->proc_dir);
+	remove_proc_entry("vlservers", cell->proc_dir);
  error_servers:
-	remove_proc_entry("servers",cell->proc_dir);
+	remove_proc_entry("servers", cell->proc_dir);
  error_proc:
-	remove_proc_entry(cell->name,proc_afs);
+	remove_proc_entry(cell->name, proc_afs);
 	_leave(" = -ENOMEM");
 	return -ENOMEM;
 } /* end afs_proc_cell_setup() */
@@ -363,14 +465,14 @@
 /*
  * remove /proc/fs/afs/<cell>/
  */
-void afs_proc_cell_remove(afs_cell_t *cell)
+void afs_proc_cell_remove(struct afs_cell *cell)
 {
 	_enter("");
 
-	remove_proc_entry("volumes",cell->proc_dir);
-	remove_proc_entry("vlservers",cell->proc_dir);
-	remove_proc_entry("servers",cell->proc_dir);
-	remove_proc_entry(cell->name,proc_afs);
+	remove_proc_entry("volumes", cell->proc_dir);
+	remove_proc_entry("vlservers", cell->proc_dir);
+	remove_proc_entry("servers", cell->proc_dir);
+	remove_proc_entry(cell->name, proc_afs);
 
 	_leave("");
 } /* end afs_proc_cell_remove() */
@@ -381,16 +483,16 @@
  */
 static int afs_proc_cell_volumes_open(struct inode *inode, struct file *file)
 {
+	struct afs_cell *cell;
 	struct seq_file *m;
-	afs_cell_t *cell;
 	int ret;
 
-	cell = afs_get_cell_maybe((afs_cell_t**)&PDE(inode)->data);
+	cell = afs_get_cell_maybe((struct afs_cell **) &PDE(inode)->data);
 	if (!cell)
 		return -ENOENT;
 
-	ret = seq_open(file,&afs_proc_cell_volumes_ops);
-	if (ret<0)
+	ret = seq_open(file, &afs_proc_cell_volumes_ops);
+	if (ret < 0)
 		return ret;
 
 	m = file->private_data;
@@ -405,7 +507,7 @@
  */
 static int afs_proc_cell_volumes_release(struct inode *inode, struct file *file)
 {
-	afs_cell_t *cell = PDE(inode)->data;
+	struct afs_cell *cell = PDE(inode)->data;
 	int ret;
 
 	ret = seq_release(inode,file);
@@ -417,49 +519,51 @@
 
 /*****************************************************************************/
 /*
- * set up the iterator to start reading from the cells list and return the first item
+ * set up the iterator to start reading from the cells list and return the
+ * first item
  */
 static void *afs_proc_cell_volumes_start(struct seq_file *m, loff_t *_pos)
 {
 	struct list_head *_p;
-	afs_cell_t *cell = m->private;
+	struct afs_cell *cell = m->private;
 	loff_t pos = *_pos;
 
-	_enter("cell=%p pos=%Ld",cell,*_pos);
+	_enter("cell=%p pos=%Ld", cell, *_pos);
 
 	/* lock the list against modification */
 	down_read(&cell->vl_sem);
 
 	/* allow for the header line */
 	if (!pos)
-		return (void *)1;
+		return (void *) 1;
 	pos--;
 
 	/* find the n'th element in the list */
-	list_for_each(_p,&cell->vl_list)
+	list_for_each(_p, &cell->vl_list)
 		if (!pos--)
 			break;
 
-	return _p!=&cell->vl_list ? _p : NULL;
+	return _p != &cell->vl_list ? _p : NULL;
 } /* end afs_proc_cell_volumes_start() */
 
 /*****************************************************************************/
 /*
  * move to next cell in cells list
  */
-static void *afs_proc_cell_volumes_next(struct seq_file *p, void *v, loff_t *_pos)
+static void *afs_proc_cell_volumes_next(struct seq_file *p, void *v,
+					loff_t *_pos)
 {
 	struct list_head *_p;
-	afs_cell_t *cell = p->private;
+	struct afs_cell *cell = p->private;
 
-	_enter("cell=%p pos=%Ld",cell,*_pos);
+	_enter("cell=%p pos=%Ld", cell, *_pos);
 
 	(*_pos)++;
 
 	_p = v;
-	_p = v==(void*)1 ? cell->vl_list.next : _p->next;
+	_p = v == (void *) 1 ? cell->vl_list.next : _p->next;
 
-	return _p!=&cell->vl_list ? _p : NULL;
+	return _p != &cell->vl_list ? _p : NULL;
 } /* end afs_proc_cell_volumes_next() */
 
 /*****************************************************************************/
@@ -468,7 +572,7 @@
  */
 static void afs_proc_cell_volumes_stop(struct seq_file *p, void *v)
 {
-	afs_cell_t *cell = p->private;
+	struct afs_cell *cell = p->private;
 
 	up_read(&cell->vl_sem);
 
@@ -480,16 +584,17 @@
  */
 static int afs_proc_cell_volumes_show(struct seq_file *m, void *v)
 {
-	afs_vlocation_t *vlocation = list_entry(v,afs_vlocation_t,link);
+	struct afs_vlocation *vlocation =
+		list_entry(v, struct afs_vlocation, link);
 
 	/* display header on line 1 */
-	if (v == (void *)1) {
+	if (v == (void *) 1) {
 		seq_puts(m, "USE VLID[0]  VLID[1]  VLID[2]  NAME\n");
 		return 0;
 	}
 
 	/* display one cell per line on subsequent lines */
-	seq_printf(m,"%3d %08x %08x %08x %s\n",
+	seq_printf(m, "%3d %08x %08x %08x %s\n",
 		   atomic_read(&vlocation->usage),
 		   vlocation->vldb.vid[0],
 		   vlocation->vldb.vid[1],
@@ -502,15 +607,16 @@
 
 /*****************************************************************************/
 /*
- * open "/proc/fs/afs/<cell>/vlservers" which provides a list of volume location server
+ * open "/proc/fs/afs/<cell>/vlservers" which provides a list of volume
+ * location server
  */
 static int afs_proc_cell_vlservers_open(struct inode *inode, struct file *file)
 {
+	struct afs_cell *cell;
 	struct seq_file *m;
-	afs_cell_t *cell;
 	int ret;
 
-	cell = afs_get_cell_maybe((afs_cell_t**)&PDE(inode)->data);
+	cell = afs_get_cell_maybe((struct afs_cell**)&PDE(inode)->data);
 	if (!cell)
 		return -ENOENT;
 
@@ -528,9 +634,10 @@
 /*
  * close the file and release the ref to the cell
  */
-static int afs_proc_cell_vlservers_release(struct inode *inode, struct file *file)
+static int afs_proc_cell_vlservers_release(struct inode *inode,
+					   struct file *file)
 {
-	afs_cell_t *cell = PDE(inode)->data;
+	struct afs_cell *cell = PDE(inode)->data;
 	int ret;
 
 	ret = seq_release(inode,file);
@@ -542,24 +649,25 @@
 
 /*****************************************************************************/
 /*
- * set up the iterator to start reading from the cells list and return the first item
+ * set up the iterator to start reading from the cells list and return the
+ * first item
  */
 static void *afs_proc_cell_vlservers_start(struct seq_file *m, loff_t *_pos)
 {
-	afs_cell_t *cell = m->private;
+	struct afs_cell *cell = m->private;
 	loff_t pos = *_pos;
 
-	_enter("cell=%p pos=%Ld",cell,*_pos);
+	_enter("cell=%p pos=%Ld", cell, *_pos);
 
 	/* lock the list against modification */
 	down_read(&cell->vl_sem);
 
 	/* allow for the header line */
 	if (!pos)
-		return (void *)1;
+		return (void *) 1;
 	pos--;
 
-	if (pos>=cell->vl_naddrs)
+	if (pos >= cell->vl_naddrs)
 		return NULL;
 
 	return &cell->vl_addrs[pos];
@@ -569,16 +677,17 @@
 /*
  * move to next cell in cells list
  */
-static void *afs_proc_cell_vlservers_next(struct seq_file *p, void *v, loff_t *_pos)
+static void *afs_proc_cell_vlservers_next(struct seq_file *p, void *v,
+					  loff_t *_pos)
 {
-	afs_cell_t *cell = p->private;
+	struct afs_cell *cell = p->private;
 	loff_t pos;
 
-	_enter("cell=%p{nad=%u} pos=%Ld",cell,cell->vl_naddrs,*_pos);
+	_enter("cell=%p{nad=%u} pos=%Ld", cell, cell->vl_naddrs, *_pos);
 
 	pos = *_pos;
 	(*_pos)++;
-	if (pos>=cell->vl_naddrs)
+	if (pos >= cell->vl_naddrs)
 		return NULL;
 
 	return &cell->vl_addrs[pos];
@@ -590,7 +699,7 @@
  */
 static void afs_proc_cell_vlservers_stop(struct seq_file *p, void *v)
 {
-	afs_cell_t *cell = p->private;
+	struct afs_cell *cell = p->private;
 
 	up_read(&cell->vl_sem);
 
@@ -605,33 +714,34 @@
 	struct in_addr *addr = v;
 
 	/* display header on line 1 */
-	if (v == (struct in_addr *)1) {
-		seq_puts(m,"ADDRESS\n");
+	if (v == (struct in_addr *) 1) {
+		seq_puts(m, "ADDRESS\n");
 		return 0;
 	}
 
 	/* display one cell per line on subsequent lines */
-	seq_printf(m,"%u.%u.%u.%u\n",NIPQUAD(addr->s_addr));
+	seq_printf(m, "%u.%u.%u.%u\n", NIPQUAD(addr->s_addr));
 
 	return 0;
 } /* end afs_proc_cell_vlservers_show() */
 
 /*****************************************************************************/
 /*
- * open "/proc/fs/afs/<cell>/servers" which provides a summary of active servers
+ * open "/proc/fs/afs/<cell>/servers" which provides a summary of active
+ * servers
  */
 static int afs_proc_cell_servers_open(struct inode *inode, struct file *file)
 {
+	struct afs_cell *cell;
 	struct seq_file *m;
-	afs_cell_t *cell;
 	int ret;
 
-	cell = afs_get_cell_maybe((afs_cell_t**)&PDE(inode)->data);
+	cell = afs_get_cell_maybe((struct afs_cell **) &PDE(inode)->data);
 	if (!cell)
 		return -ENOENT;
 
-	ret = seq_open(file,&afs_proc_cell_servers_ops);
-	if (ret<0)
+	ret = seq_open(file, &afs_proc_cell_servers_ops);
+	if (ret < 0)
 		return ret;
 
 	m = file->private_data;
@@ -644,12 +754,13 @@
 /*
  * close the file and release the ref to the cell
  */
-static int afs_proc_cell_servers_release(struct inode *inode, struct file *file)
+static int afs_proc_cell_servers_release(struct inode *inode,
+					 struct file *file)
 {
-	afs_cell_t *cell = PDE(inode)->data;
+	struct afs_cell *cell = PDE(inode)->data;
 	int ret;
 
-	ret = seq_release(inode,file);
+	ret = seq_release(inode, file);
 
 	afs_put_cell(cell);
 
@@ -658,49 +769,51 @@
 
 /*****************************************************************************/
 /*
- * set up the iterator to start reading from the cells list and return the first item
+ * set up the iterator to start reading from the cells list and return the
+ * first item
  */
 static void *afs_proc_cell_servers_start(struct seq_file *m, loff_t *_pos)
 {
 	struct list_head *_p;
-	afs_cell_t *cell = m->private;
+	struct afs_cell *cell = m->private;
 	loff_t pos = *_pos;
 
-	_enter("cell=%p pos=%Ld",cell,*_pos);
+	_enter("cell=%p pos=%Ld", cell, *_pos);
 
 	/* lock the list against modification */
 	read_lock(&cell->sv_lock);
 
 	/* allow for the header line */
 	if (!pos)
-		return (void *)1;
+		return (void *) 1;
 	pos--;
 
 	/* find the n'th element in the list */
-	list_for_each(_p,&cell->sv_list)
+	list_for_each(_p, &cell->sv_list)
 		if (!pos--)
 			break;
 
-	return _p!=&cell->sv_list ? _p : NULL;
+	return _p != &cell->sv_list ? _p : NULL;
 } /* end afs_proc_cell_servers_start() */
 
 /*****************************************************************************/
 /*
  * move to next cell in cells list
  */
-static void *afs_proc_cell_servers_next(struct seq_file *p, void *v, loff_t *_pos)
+static void *afs_proc_cell_servers_next(struct seq_file *p, void *v,
+					loff_t *_pos)
 {
 	struct list_head *_p;
-	afs_cell_t *cell = p->private;
+	struct afs_cell *cell = p->private;
 
-	_enter("cell=%p pos=%Ld",cell,*_pos);
+	_enter("cell=%p pos=%Ld", cell, *_pos);
 
 	(*_pos)++;
 
 	_p = v;
-	_p = v==(void*)1 ? cell->sv_list.next : _p->next;
+	_p = v == (void *) 1 ? cell->sv_list.next : _p->next;
 
-	return _p!=&cell->sv_list ? _p : NULL;
+	return _p != &cell->sv_list ? _p : NULL;
 } /* end afs_proc_cell_servers_next() */
 
 /*****************************************************************************/
@@ -709,7 +822,7 @@
  */
 static void afs_proc_cell_servers_stop(struct seq_file *p, void *v)
 {
-	afs_cell_t *cell = p->private;
+	struct afs_cell *cell = p->private;
 
 	read_unlock(&cell->sv_lock);
 
@@ -721,18 +834,18 @@
  */
 static int afs_proc_cell_servers_show(struct seq_file *m, void *v)
 {
-	afs_server_t *server = list_entry(v,afs_server_t,link);
+	struct afs_server *server = list_entry(v, struct afs_server, link);
 	char ipaddr[20];
 
 	/* display header on line 1 */
-	if (v == (void *)1) {
+	if (v == (void *) 1) {
 		seq_puts(m, "USE ADDR            STATE\n");
 		return 0;
 	}
 
 	/* display one cell per line on subsequent lines */
-	sprintf(ipaddr,"%u.%u.%u.%u",NIPQUAD(server->addr));
-	seq_printf(m,"%3d %-15.15s %5d\n",
+	sprintf(ipaddr, "%u.%u.%u.%u", NIPQUAD(server->addr));
+	seq_printf(m, "%3d %-15.15s %5d\n",
 		   atomic_read(&server->usage),
 		   ipaddr,
 		   server->fs_state
diff -Nru a/fs/afs/server.c b/fs/afs/server.c
--- a/fs/afs/server.c	Tue Feb  3 19:45:16 2004
+++ b/fs/afs/server.c	Tue Feb  3 19:45:16 2004
@@ -26,11 +26,13 @@
 #define FS_SERVICE_ID		1	/* AFS Volume Location Service ID */
 #define VL_SERVICE_ID		52	/* AFS Volume Location Service ID */
 
-static void __afs_server_timeout(afs_timer_t *timer)
+static void __afs_server_timeout(struct afs_timer *timer)
 {
-	afs_server_t *server = list_entry(timer,afs_server_t,timeout);
+	struct afs_server *server =
+		list_entry(timer, struct afs_server, timeout);
 
-	_debug("SERVER TIMEOUT [%p{u=%d}]",server,atomic_read(&server->usage));
+	_debug("SERVER TIMEOUT [%p{u=%d}]",
+	       server, atomic_read(&server->usage));
 
 	afs_server_do_timeout(server);
 }
@@ -44,23 +46,23 @@
  * lookup a server record in a cell
  * - TODO: search the cell's server list
  */
-int afs_server_lookup(afs_cell_t *cell, const struct in_addr *addr, afs_server_t **_server)
+int afs_server_lookup(struct afs_cell *cell, const struct in_addr *addr,
+		      struct afs_server **_server)
 {
-	struct list_head *_p;
-	afs_server_t *server, *active, *zombie;
+	struct afs_server *server, *active, *zombie;
 	int loop;
 
-	_enter("%p,%08x,",cell,ntohl(addr->s_addr));
+	_enter("%p,%08x,", cell, ntohl(addr->s_addr));
 
 	/* allocate and initialise a server record */
-	server = kmalloc(sizeof(afs_server_t),GFP_KERNEL);
+	server = kmalloc(sizeof(struct afs_server), GFP_KERNEL);
 	if (!server) {
 		_leave(" = -ENOMEM");
 		return -ENOMEM;
 	}
 
-	memset(server,0,sizeof(afs_server_t));
-	atomic_set(&server->usage,1);
+	memset(server, 0, sizeof(struct afs_server));
+	atomic_set(&server->usage, 1);
 
 	INIT_LIST_HEAD(&server->link);
 	init_rwsem(&server->sem);
@@ -69,43 +71,39 @@
 	INIT_LIST_HEAD(&server->cb_promises);
 	spin_lock_init(&server->cb_lock);
 
-	for (loop=0; loop<AFS_SERVER_CONN_LIST_SIZE; loop++)
+	for (loop = 0; loop < AFS_SERVER_CONN_LIST_SIZE; loop++)
 		server->fs_conn_cnt[loop] = 4;
 
-	memcpy(&server->addr,addr,sizeof(struct in_addr));
+	memcpy(&server->addr, addr, sizeof(struct in_addr));
 	server->addr.s_addr = addr->s_addr;
 
-	afs_timer_init(&server->timeout,&afs_server_timer_ops);
+	afs_timer_init(&server->timeout, &afs_server_timer_ops);
 
 	/* add to the cell */
 	write_lock(&cell->sv_lock);
 
 	/* check the active list */
-	list_for_each(_p,&cell->sv_list) {
-		active = list_entry(_p,afs_server_t,link);
-
-		if (active->addr.s_addr==addr->s_addr)
+	list_for_each_entry(active, &cell->sv_list, link) {
+		if (active->addr.s_addr == addr->s_addr)
 			goto use_active_server;
 	}
 
 	/* check the inactive list */
 	spin_lock(&cell->sv_gylock);
-	list_for_each(_p,&cell->sv_graveyard) {
-		zombie = list_entry(_p,afs_server_t,link);
-
-		if (zombie->addr.s_addr==addr->s_addr)
+	list_for_each_entry(zombie, &cell->sv_graveyard, link) {
+		if (zombie->addr.s_addr == addr->s_addr)
 			goto resurrect_server;
 	}
 	spin_unlock(&cell->sv_gylock);
 
 	afs_get_cell(cell);
 	server->cell = cell;
-	list_add_tail(&server->link,&cell->sv_list);
+	list_add_tail(&server->link, &cell->sv_list);
 
 	write_unlock(&cell->sv_lock);
 
 	*_server = server;
-	_leave(" = 0 (%p)",server);
+	_leave(" = 0 (%p)", server);
 	return 0;
 
 	/* found a matching active server */
@@ -117,15 +115,16 @@
 	kfree(server);
 
 	*_server = active;
-	_leave(" = 0 (%p)",active);
+	_leave(" = 0 (%p)", active);
 	return 0;
 
-	/* found a matching server in the graveyard, so resurrect it and dispose of the new rec */
+	/* found a matching server in the graveyard, so resurrect it and
+	 * dispose of the new record */
  resurrect_server:
 	_debug("resurrecting server");
 
 	list_del(&zombie->link);
-	list_add_tail(&zombie->link,&cell->sv_list);
+	list_add_tail(&zombie->link, &cell->sv_list);
 	afs_get_server(zombie);
 	afs_kafstimod_del_timer(&zombie->timeout);
 	spin_unlock(&cell->sv_gylock);
@@ -134,7 +133,7 @@
 	kfree(server);
 
 	*_server = zombie;
-	_leave(" = 0 (%p)",zombie);
+	_leave(" = 0 (%p)", zombie);
 	return 0;
 
 } /* end afs_server_lookup() */
@@ -144,22 +143,22 @@
  * destroy a server record
  * - removes from the cell list
  */
-void afs_put_server(afs_server_t *server)
+void afs_put_server(struct afs_server *server)
 {
-	afs_cell_t *cell;
+	struct afs_cell *cell;
 
 	if (!server)
 		return;
 
-	_enter("%p",server);
+	_enter("%p", server);
 
 	cell = server->cell;
 
 	/* sanity check */
-	if (atomic_read(&server->usage)<=0)
-		BUG();
+	BUG_ON(atomic_read(&server->usage) <= 0);
 
-	/* to prevent a race, the decrement and the dequeue must be effectively atomic */
+	/* to prevent a race, the decrement and the dequeue must be effectively
+	 * atomic */
 	write_lock(&cell->sv_lock);
 
 	if (likely(!atomic_dec_and_test(&server->usage))) {
@@ -170,10 +169,10 @@
 
 	spin_lock(&cell->sv_gylock);
 	list_del(&server->link);
-	list_add_tail(&server->link,&cell->sv_graveyard);
+	list_add_tail(&server->link, &cell->sv_graveyard);
 
 	/* time out in 10 secs */
-	afs_kafstimod_add_timer(&server->timeout,10*HZ);
+	afs_kafstimod_add_timer(&server->timeout, 10 * HZ);
 
 	spin_unlock(&cell->sv_gylock);
 	write_unlock(&cell->sv_lock);
@@ -186,21 +185,21 @@
  * timeout server record
  * - removes from the cell's graveyard if the usage count is zero
  */
-void afs_server_do_timeout(afs_server_t *server)
+void afs_server_do_timeout(struct afs_server *server)
 {
 	struct rxrpc_peer *peer;
-	afs_cell_t *cell;
+	struct afs_cell *cell;
 	int loop;
 
-	_enter("%p",server);
+	_enter("%p", server);
 
 	cell = server->cell;
 
-	if (atomic_read(&server->usage)<0) BUG();
+	BUG_ON(atomic_read(&server->usage) < 0);
 
 	/* remove from graveyard if still dead */
 	spin_lock(&cell->vl_gylock);
-	if (atomic_read(&server->usage)==0)
+	if (atomic_read(&server->usage) == 0)
 		list_del_init(&server->link);
 	else
 		server = NULL;
@@ -224,7 +223,7 @@
 	spin_unlock(&afs_server_peer_lock);
 
 	/* finish cleaning up the server */
-	for (loop=AFS_SERVER_CONN_LIST_SIZE-1; loop>=0; loop--)
+	for (loop = AFS_SERVER_CONN_LIST_SIZE - 1; loop >= 0; loop--)
 		if (server->fs_conn[loop])
 			rxrpc_put_connection(server->fs_conn[loop]);
 
@@ -240,7 +239,8 @@
 /*
  * get a callslot on a connection to the fileserver on the specified server
  */
-int afs_server_request_callslot(afs_server_t *server, struct afs_server_callslot *callslot)
+int afs_server_request_callslot(struct afs_server *server,
+				struct afs_server_callslot *callslot)
 {
 	struct afs_server_callslot *pcallslot;
 	struct rxrpc_connection *conn;
@@ -262,10 +262,10 @@
 
 	/* resurrect the server if it's death timeout has expired */
 	if (server->fs_state) {
-		if (time_before(jiffies,server->fs_dead_jif)) {
+		if (time_before(jiffies, server->fs_dead_jif)) {
 			ret = server->fs_state;
 			spin_unlock(&server->fs_lock);
-			_leave(" = %d [still dead]",ret);
+			_leave(" = %d [still dead]", ret);
 			return ret;
 		}
 
@@ -273,8 +273,8 @@
 	}
 
 	/* try and find a connection that has spare callslots */
-	for (nconn=0; nconn<AFS_SERVER_CONN_LIST_SIZE; nconn++) {
-		if (server->fs_conn_cnt[nconn]>0) {
+	for (nconn = 0; nconn < AFS_SERVER_CONN_LIST_SIZE; nconn++) {
+		if (server->fs_conn_cnt[nconn] > 0) {
 			server->fs_conn_cnt[nconn]--;
 			spin_unlock(&server->fs_lock);
 			callslot->nconn = nconn;
@@ -282,9 +282,10 @@
 		}
 	}
 
-	/* none were available - wait interruptibly for one to become available */
+	/* none were available - wait interruptibly for one to become
+	 * available */
 	set_current_state(TASK_INTERRUPTIBLE);
-	list_add_tail(&callslot->link,&server->fs_callq);
+	list_add_tail(&callslot->link, &server->fs_callq);
 	spin_unlock(&server->fs_lock);
 
 	while (!callslot->ready && !signal_pending(current)) {
@@ -303,22 +304,24 @@
 
 	nconn = callslot->nconn;
 
-	/* if interrupted, we must release any slot we also got before returning an error */
+	/* if interrupted, we must release any slot we also got before
+	 * returning an error */
 	if (signal_pending(current)) {
 		ret = -EINTR;
 		goto error_release;
 	}
 
-	/* if we were woken up with an error, then pass that error back to the called */
-	if (nconn<0) {
-		_leave(" = %d",callslot->errno);
+	/* if we were woken up with an error, then pass that error back to the
+	 * called */
+	if (nconn < 0) {
+		_leave(" = %d", callslot->errno);
 		return callslot->errno;
 	}
 
 	/* were we given a connection directly? */
 	if (callslot->conn) {
 		/* yes - use it */
-		_leave(" = 0 (nc=%d)",nconn);
+		_leave(" = 0 (nc=%d)", nconn);
 		return 0;
 	}
 
@@ -347,7 +350,7 @@
 					      NULL,
 					      &server->fs_conn[nconn]);
 
-		if (ret<0)
+		if (ret < 0)
 			goto error_release_upw;
 
 		callslot->conn = server->fs_conn[0];
@@ -364,10 +367,11 @@
 	up_write(&server->sem);
 
  error_release:
-	/* either release the callslot or pass it along to another deserving task */
+	/* either release the callslot or pass it along to another deserving
+	 * task */
 	spin_lock(&server->fs_lock);
 
-	if (nconn<0) {
+	if (nconn < 0) {
 		/* no callslot allocated */
 	}
 	else if (list_empty(&server->fs_callq)) {
@@ -377,13 +381,15 @@
 	}
 	else {
 		/* someone's waiting - dequeue them and wake them up */
-		pcallslot = list_entry(server->fs_callq.next,struct afs_server_callslot,link);
+		pcallslot = list_entry(server->fs_callq.next,
+				       struct afs_server_callslot, link);
 		list_del_init(&pcallslot->link);
 
 		pcallslot->errno = server->fs_state;
 		if (!pcallslot->errno) {
 			/* pass them out callslot details */
-			callslot->conn = xchg(&pcallslot->conn,callslot->conn);
+			callslot->conn = xchg(&pcallslot->conn,
+					      callslot->conn);
 			pcallslot->nconn = nconn;
 			callslot->nconn = nconn = -1;
 		}
@@ -392,10 +398,10 @@
 		spin_unlock(&server->fs_lock);
 	}
 
-	if (callslot->conn) rxrpc_put_connection(callslot->conn);
+	rxrpc_put_connection(callslot->conn);
 	callslot->conn = NULL;
 
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 
 } /* end afs_server_request_callslot() */
@@ -405,7 +411,8 @@
  * release a callslot back to the server
  * - transfers the RxRPC connection to the next pending callslot if possible
  */
-void afs_server_release_callslot(afs_server_t *server, struct afs_server_callslot *callslot)
+void afs_server_release_callslot(struct afs_server *server,
+				 struct afs_server_callslot *callslot)
 {
 	struct afs_server_callslot *pcallslot;
 
@@ -414,7 +421,7 @@
 	       server->fs_conn_cnt[callslot->nconn],
 	       callslot->nconn);
 
-	if (callslot->nconn<0) BUG();
+	BUG_ON(callslot->nconn < 0);
 
 	spin_lock(&server->fs_lock);
 
@@ -425,13 +432,14 @@
 	}
 	else {
 		/* someone's waiting - dequeue them and wake them up */
-		pcallslot = list_entry(server->fs_callq.next,struct afs_server_callslot,link);
+		pcallslot = list_entry(server->fs_callq.next,
+				       struct afs_server_callslot, link);
 		list_del_init(&pcallslot->link);
 
 		pcallslot->errno = server->fs_state;
 		if (!pcallslot->errno) {
 			/* pass them out callslot details */
-			callslot->conn = xchg(&pcallslot->conn,callslot->conn);
+			callslot->conn = xchg(&pcallslot->conn, callslot->conn);
 			pcallslot->nconn = callslot->nconn;
 			callslot->nconn = -1;
 		}
@@ -441,21 +449,23 @@
 		spin_unlock(&server->fs_lock);
 	}
 
-	if (callslot->conn) rxrpc_put_connection(callslot->conn);
+	rxrpc_put_connection(callslot->conn);
 
 	_leave("");
 } /* end afs_server_release_callslot() */
 
 /*****************************************************************************/
 /*
- * get a handle to a connection to the vlserver (volume location) on the specified server
+ * get a handle to a connection to the vlserver (volume location) on the
+ * specified server
  */
-int afs_server_get_vlconn(afs_server_t *server, struct rxrpc_connection **_conn)
+int afs_server_get_vlconn(struct afs_server *server,
+			  struct rxrpc_connection **_conn)
 {
 	struct rxrpc_connection *conn;
 	int ret;
 
-	_enter("%p,",server);
+	_enter("%p,", server);
 
 	ret = 0;
 	conn = NULL;
@@ -479,7 +489,7 @@
 						      NULL,
 						      &server->vlserver);
 		}
-		if (ret==0) {
+		if (ret == 0) {
 			rxrpc_get_connection(server->vlserver);
 			conn = server->vlserver;
 		}
@@ -487,6 +497,6 @@
 	}
 
 	*_conn = conn;
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 } /* end afs_server_get_vlconn() */
diff -Nru a/fs/afs/server.h b/fs/afs/server.h
--- a/fs/afs/server.h	Tue Feb  3 19:45:43 2004
+++ b/fs/afs/server.h	Tue Feb  3 19:45:43 2004
@@ -26,10 +26,10 @@
 struct afs_server
 {
 	atomic_t		usage;
-	afs_cell_t		*cell;		/* cell in which server resides */
+	struct afs_cell		*cell;		/* cell in which server resides */
 	struct list_head	link;		/* link in cell's server list */
 	struct rw_semaphore	sem;		/* access lock */
-	afs_timer_t		timeout;	/* graveyard timeout */
+	struct afs_timer	timeout;	/* graveyard timeout */
 	struct in_addr		addr;		/* server address */
 	struct rxrpc_peer	*peer;		/* peer record for this server */
 	struct rxrpc_connection	*vlserver;	/* connection to the volume location service */
@@ -50,20 +50,25 @@
 	spinlock_t		cb_lock;	/* access lock */
 };
 
-extern int afs_server_lookup(afs_cell_t *cell, const struct in_addr *addr, afs_server_t **_server);
+extern int afs_server_lookup(struct afs_cell *cell,
+			     const struct in_addr *addr,
+			     struct afs_server **_server);
 
 #define afs_get_server(S) do { atomic_inc(&(S)->usage); } while(0)
 
-extern void afs_put_server(afs_server_t *server);
-extern void afs_server_do_timeout(afs_server_t *server);
+extern void afs_put_server(struct afs_server *server);
+extern void afs_server_do_timeout(struct afs_server *server);
 
-extern int afs_server_find_by_peer(const struct rxrpc_peer *peer, afs_server_t **_server);
+extern int afs_server_find_by_peer(const struct rxrpc_peer *peer,
+				   struct afs_server **_server);
 
-extern int afs_server_get_vlconn(afs_server_t *server, struct rxrpc_connection **_conn);
+extern int afs_server_get_vlconn(struct afs_server *server,
+				 struct rxrpc_connection **_conn);
 
-static inline afs_server_t *afs_server_get_from_peer(struct rxrpc_peer *peer)
+static inline
+struct afs_server *afs_server_get_from_peer(struct rxrpc_peer *peer)
 {
-	afs_server_t *server;
+	struct afs_server *server;
 
 	spin_lock(&afs_server_peer_lock);
 	server = peer->user;
@@ -88,10 +93,10 @@
 	int			errno;		/* error number if nconn==-1 */
 };
 
-extern int afs_server_request_callslot(afs_server_t *server,
+extern int afs_server_request_callslot(struct afs_server *server,
 				       struct afs_server_callslot *callslot);
 
-extern void afs_server_release_callslot(afs_server_t *server,
+extern void afs_server_release_callslot(struct afs_server *server,
 					struct afs_server_callslot *callslot);
 
 #endif /* _LINUX_AFS_SERVER_H */
diff -Nru a/fs/afs/super.c b/fs/afs/super.c
--- a/fs/afs/super.c	Tue Feb  3 19:45:17 2004
+++ b/fs/afs/super.c	Tue Feb  3 19:45:17 2004
@@ -35,14 +35,6 @@
 	struct afs_volume	*volume;
 };
 
-static inline char *strdup(const char *s)
-{
-	char *ns = kmalloc(strlen(s) + 1, GFP_KERNEL);
-	if (ns)
-		strcpy(ns, s);
-	return ns;
-}
-
 static void afs_i_init_once(void *foo, kmem_cache_t *cachep,
 			    unsigned long flags);
 
@@ -94,7 +86,7 @@
 
 	ret = -ENOMEM;
 	afs_inode_cachep = kmem_cache_create("afs_inode_cache",
-					     sizeof(afs_vnode_t),
+					     sizeof(struct afs_vnode),
 					     0,
 					     SLAB_HWCACHE_ALIGN,
 					     afs_i_init_once,
@@ -164,8 +156,8 @@
 /*****************************************************************************/
 /*
  * parse the mount options
- * - this function has been shamelessly adapted from the ext3 fs which shamelessly adapted it from
- *   the msdos fs
+ * - this function has been shamelessly adapted from the ext3 fs which
+ *   shamelessly adapted it from the msdos fs
  */
 static int afs_super_parse_options(struct afs_mount_params *params,
 				   char *options,
@@ -243,9 +235,9 @@
 {
 	struct afs_mount_params *params = data;
 	struct afs_super_info *as = NULL;
+	struct afs_fid fid;
 	struct dentry *root = NULL;
 	struct inode *inode = NULL;
-	afs_fid_t fid;
 	int ret;
 
 	kenter("");
@@ -395,7 +387,7 @@
 static void afs_i_init_once(void *_vnode, kmem_cache_t *cachep,
 			    unsigned long flags)
 {
-	afs_vnode_t *vnode = (afs_vnode_t *) _vnode;
+	struct afs_vnode *vnode = (struct afs_vnode *) _vnode;
 
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 	    SLAB_CTOR_CONSTRUCTOR) {
@@ -417,9 +409,9 @@
  */
 static struct inode *afs_alloc_inode(struct super_block *sb)
 {
-	afs_vnode_t *vnode;
+	struct afs_vnode *vnode;
 
-	vnode = (afs_vnode_t *)
+	vnode = (struct afs_vnode *)
 		kmem_cache_alloc(afs_inode_cachep, SLAB_KERNEL);
 	if (!vnode)
 		return NULL;
diff -Nru a/fs/afs/types.h b/fs/afs/types.h
--- a/fs/afs/types.h	Tue Feb  3 19:45:26 2004
+++ b/fs/afs/types.h	Tue Feb  3 19:45:26 2004
@@ -20,21 +20,6 @@
 typedef unsigned			afs_vnodeid_t;
 typedef unsigned long long		afs_dataversion_t;
 
-typedef struct afs_async_op		afs_async_op_t;
-typedef struct afs_callback		afs_callback_t;
-typedef struct afs_cell			afs_cell_t;
-typedef struct afs_fid			afs_fid_t;
-typedef struct afs_file_status		afs_file_status_t;
-typedef struct afs_server		afs_server_t;
-typedef struct afs_timer		afs_timer_t;
-typedef struct afs_vlocation		afs_vlocation_t;
-typedef struct afs_vnode		afs_vnode_t;
-typedef struct afs_volsync		afs_volsync_t;
-typedef struct afs_volume		afs_volume_t;
-typedef struct afs_volume_info		afs_volume_info_t;
-
-typedef struct afsvl_dbentry		afsvl_dbentry_t;
-
 typedef enum {
 	AFSVL_RWVOL,			/* read/write volume */
 	AFSVL_ROVOL,			/* read-only volume */
@@ -52,6 +37,9 @@
 
 #ifdef __KERNEL__
 
+struct afs_cell;
+struct afs_vnode;
+
 /*****************************************************************************/
 /*
  * AFS file identifier
@@ -76,8 +64,8 @@
 
 struct afs_callback
 {
-	afs_server_t		*server;	/* server that made the promise */
-	afs_fid_t		fid;		/* file identifier */
+	struct afs_server	*server;	/* server that made the promise */
+	struct afs_fid		fid;		/* file identifier */
 	unsigned		version;	/* callback version */
 	unsigned		expiry;		/* time at which expires */
 	afs_callback_type_t	type;		/* type of callback */
@@ -120,7 +108,7 @@
 	unsigned		caller_access;	/* access rights for authenticated caller */
 	unsigned		anon_access;	/* access rights for unauthenticated caller */
 	umode_t			mode;		/* UNIX mode */
-	afs_fid_t		parent;		/* parent file ID */
+	struct afs_fid		parent;		/* parent file ID */
 	time_t			mtime_client;	/* last time client changed data */
 	time_t			mtime_server;	/* last time server changed data */
 };
diff -Nru a/fs/afs/vlclient.c b/fs/afs/vlclient.c
--- a/fs/afs/vlclient.c	Tue Feb  3 19:45:16 2004
+++ b/fs/afs/vlclient.c	Tue Feb  3 19:45:16 2004
@@ -39,7 +39,8 @@
 {
 	int err;
 
-	_enter("{%u,%u,%d}",call->app_err_state,call->app_abort_code,call->app_errno);
+	_enter("{%u,%u,%d}",
+	       call->app_err_state, call->app_abort_code, call->app_errno);
 
 	switch (call->app_err_state) {
 	case RXRPC_ESTATE_LOCAL_ABORT:
@@ -92,10 +93,8 @@
 /*
  * probe a volume location server to see if it is still alive
  */
-int afs_rxvl_probe(afs_server_t *server, int alloc_flags)
+int afs_rxvl_probe(struct afs_server *server, int alloc_flags)
 {
-	DECLARE_WAITQUEUE(myself,current);
-
 	struct rxrpc_connection *conn;
 	struct rxrpc_call *call;
 	struct iovec piov[1];
@@ -103,21 +102,23 @@
 	int ret;
 	u32 param[1];
 
+	DECLARE_WAITQUEUE(myself, current);
+
 	/* get hold of the vlserver connection */
-	ret = afs_server_get_vlconn(server,&conn);
-	if (ret<0)
+	ret = afs_server_get_vlconn(server, &conn);
+	if (ret < 0)
 		goto out;
 
 	/* create a call through that connection */
-	ret = rxrpc_create_call(conn,NULL,NULL,afs_rxvl_aemap,&call);
-	if (ret<0) {
-		printk("kAFS: Unable to create call: %d\n",ret);
+	ret = rxrpc_create_call(conn, NULL, NULL, afs_rxvl_aemap, &call);
+	if (ret < 0) {
+		printk("kAFS: Unable to create call: %d\n", ret);
 		goto out_put_conn;
 	}
 	call->app_opcode = VLPROBE;
 
 	/* we want to get event notifications from the call */
-	add_wait_queue(&call->waitq,&myself);
+	add_wait_queue(&call->waitq, &myself);
 
 	/* marshall the parameters */
 	param[0] = htonl(VLPROBE);
@@ -125,14 +126,15 @@
 	piov[0].iov_base = param;
 
 	/* send the parameters to the server */
-	ret = rxrpc_call_write_data(call,1,piov,RXRPC_LAST_PACKET,alloc_flags,0,&sent);
-	if (ret<0)
+	ret = rxrpc_call_write_data(call, 1, piov, RXRPC_LAST_PACKET,
+				    alloc_flags, 0, &sent);
+	if (ret < 0)
 		goto abort;
 
 	/* wait for the reply to completely arrive */
 	for (;;) {
 		set_current_state(TASK_INTERRUPTIBLE);
-		if (call->app_call_state!=RXRPC_CSTATE_CLNT_RCV_REPLY ||
+		if (call->app_call_state != RXRPC_CSTATE_CLNT_RCV_REPLY ||
 		    signal_pending(current))
 			break;
 		schedule();
@@ -158,12 +160,12 @@
 
  abort:
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	rxrpc_call_abort(call,ret);
+	rxrpc_call_abort(call, ret);
 	schedule();
 
  out_unwait:
 	set_current_state(TASK_RUNNING);
-	remove_wait_queue(&call->waitq,&myself);
+	remove_wait_queue(&call->waitq, &myself);
 	rxrpc_put_call(call);
  out_put_conn:
 	rxrpc_put_connection(conn);
@@ -176,10 +178,12 @@
 /*
  * look up a volume location database entry by name
  */
-int afs_rxvl_get_entry_by_name(afs_server_t *server, const char *volname, unsigned volnamesz,
+int afs_rxvl_get_entry_by_name(struct afs_server *server,
+			       const char *volname,
+			       unsigned volnamesz,
 			       struct afs_cache_vlocation *entry)
 {
-	DECLARE_WAITQUEUE(myself,current);
+	DECLARE_WAITQUEUE(myself, current);
 
 	struct rxrpc_connection *conn;
 	struct rxrpc_call *call;
@@ -195,7 +199,7 @@
 
 	/* get hold of the vlserver connection */
 	ret = afs_server_get_vlconn(server, &conn);
-	if (ret<0)
+	if (ret < 0)
 		goto out;
 
 	/* create a call through that connection */
@@ -211,7 +215,7 @@
 
 	/* marshall the parameters */
 	piov[1].iov_len = volnamesz;
-	piov[1].iov_base = (char*) volname;
+	piov[1].iov_base = (char *) volname;
 
 	zero = 0;
 	piov[2].iov_len = (4 - (piov[1].iov_len & 3)) & 3;
@@ -224,14 +228,17 @@
 	piov[0].iov_base = param;
 
 	/* send the parameters to the server */
-	ret = rxrpc_call_write_data(call, 3, piov, RXRPC_LAST_PACKET, GFP_NOFS, 0, &sent);
-	if (ret<0)
+	ret = rxrpc_call_write_data(call, 3, piov, RXRPC_LAST_PACKET, GFP_NOFS,
+				    0, &sent);
+	if (ret < 0)
 		goto abort;
 
 	/* wait for the reply to completely arrive */
 	bp = rxrpc_call_alloc_scratch(call, 384);
 
-	ret = rxrpc_call_read_data(call, bp, 384, RXRPC_CALL_READ_BLOCK|RXRPC_CALL_READ_ALL);
+	ret = rxrpc_call_read_data(call, bp, 384,
+				   RXRPC_CALL_READ_BLOCK |
+				   RXRPC_CALL_READ_ALL);
 	if (ret < 0) {
 		if (ret == -ECONNABORTED) {
 			ret = call->app_errno;
@@ -241,23 +248,26 @@
 	}
 
 	/* unmarshall the reply */
-	for (loop=0; loop<64; loop++)
+	for (loop = 0; loop < 64; loop++)
 		entry->name[loop] = ntohl(*bp++);
 	bp++; /* final NUL */
 
 	bp++; /* type */
 	entry->nservers = ntohl(*bp++);
 
-	for (loop=0; loop<8; loop++)
+	for (loop = 0; loop < 8; loop++)
 		entry->servers[loop].s_addr = *bp++;
 
 	bp += 8; /* partition IDs */
 
-	for (loop=0; loop<8; loop++) {
+	for (loop = 0; loop < 8; loop++) {
 		tmp = ntohl(*bp++);
-		if (tmp & AFS_VLSF_RWVOL  ) entry->srvtmask[loop] |= AFS_VOL_VTM_RW;
-		if (tmp & AFS_VLSF_ROVOL  ) entry->srvtmask[loop] |= AFS_VOL_VTM_RO;
-		if (tmp & AFS_VLSF_BACKVOL) entry->srvtmask[loop] |= AFS_VOL_VTM_BAK;
+		if (tmp & AFS_VLSF_RWVOL)
+			entry->srvtmask[loop] |= AFS_VOL_VTM_RW;
+		if (tmp & AFS_VLSF_ROVOL)
+			entry->srvtmask[loop] |= AFS_VOL_VTM_RO;
+		if (tmp & AFS_VLSF_BACKVOL)
+			entry->srvtmask[loop] |= AFS_VOL_VTM_BAK;
 	}
 
 	entry->vid[0] = ntohl(*bp++);
@@ -267,9 +277,12 @@
 	bp++; /* clone ID */
 
 	tmp = ntohl(*bp++); /* flags */
-	if (tmp & AFS_VLF_RWEXISTS  ) entry->vidmask |= AFS_VOL_VTM_RW;
-	if (tmp & AFS_VLF_ROEXISTS  ) entry->vidmask |= AFS_VOL_VTM_RO;
-	if (tmp & AFS_VLF_BACKEXISTS) entry->vidmask |= AFS_VOL_VTM_BAK;
+	if (tmp & AFS_VLF_RWEXISTS)
+		entry->vidmask |= AFS_VOL_VTM_RW;
+	if (tmp & AFS_VLF_ROEXISTS)
+		entry->vidmask |= AFS_VOL_VTM_RO;
+	if (tmp & AFS_VLF_BACKEXISTS)
+		entry->vidmask |= AFS_VOL_VTM_BAK;
 
 	ret = -ENOMEDIUM;
 	if (!entry->vidmask)
@@ -291,7 +304,7 @@
 
  abort:
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	rxrpc_call_abort(call,ret);
+	rxrpc_call_abort(call, ret);
 	schedule();
 	goto out_unwait;
 } /* end afs_rxvl_get_entry_by_name() */
@@ -300,12 +313,12 @@
 /*
  * look up a volume location database entry by ID
  */
-int afs_rxvl_get_entry_by_id(afs_server_t *server,
+int afs_rxvl_get_entry_by_id(struct afs_server *server,
 			     afs_volid_t volid,
 			     afs_voltype_t voltype,
 			     struct afs_cache_vlocation *entry)
 {
-	DECLARE_WAITQUEUE(myself,current);
+	DECLARE_WAITQUEUE(myself, current);
 
 	struct rxrpc_connection *conn;
 	struct rxrpc_call *call;
@@ -315,25 +328,25 @@
 	int ret, loop;
 	u32 *bp, param[3];
 
-	_enter(",%x,%d,",volid,voltype);
+	_enter(",%x,%d,", volid, voltype);
 
-	memset(entry,0,sizeof(*entry));
+	memset(entry, 0, sizeof(*entry));
 
 	/* get hold of the vlserver connection */
-	ret = afs_server_get_vlconn(server,&conn);
-	if (ret<0)
+	ret = afs_server_get_vlconn(server, &conn);
+	if (ret < 0)
 		goto out;
 
 	/* create a call through that connection */
-	ret = rxrpc_create_call(conn,NULL,NULL,afs_rxvl_aemap,&call);
-	if (ret<0) {
-		printk("kAFS: Unable to create call: %d\n",ret);
+	ret = rxrpc_create_call(conn, NULL, NULL, afs_rxvl_aemap, &call);
+	if (ret < 0) {
+		printk("kAFS: Unable to create call: %d\n", ret);
 		goto out_put_conn;
 	}
 	call->app_opcode = VLGETENTRYBYID;
 
 	/* we want to get event notifications from the call */
-	add_wait_queue(&call->waitq,&myself);
+	add_wait_queue(&call->waitq, &myself);
 
 	/* marshall the parameters */
 	param[0] = htonl(VLGETENTRYBYID);
@@ -344,16 +357,19 @@
 	piov[0].iov_base = param;
 
 	/* send the parameters to the server */
-	ret = rxrpc_call_write_data(call,1,piov,RXRPC_LAST_PACKET,GFP_NOFS,0,&sent);
-	if (ret<0)
+	ret = rxrpc_call_write_data(call, 1, piov, RXRPC_LAST_PACKET, GFP_NOFS,
+				    0, &sent);
+	if (ret < 0)
 		goto abort;
 
 	/* wait for the reply to completely arrive */
-	bp = rxrpc_call_alloc_scratch(call,384);
+	bp = rxrpc_call_alloc_scratch(call, 384);
 
-	ret = rxrpc_call_read_data(call,bp,384,RXRPC_CALL_READ_BLOCK|RXRPC_CALL_READ_ALL);
-	if (ret<0) {
-		if (ret==-ECONNABORTED) {
+	ret = rxrpc_call_read_data(call, bp, 384,
+				   RXRPC_CALL_READ_BLOCK |
+				   RXRPC_CALL_READ_ALL);
+	if (ret < 0) {
+		if (ret == -ECONNABORTED) {
 			ret = call->app_errno;
 			goto out_unwait;
 		}
@@ -361,23 +377,26 @@
 	}
 
 	/* unmarshall the reply */
-	for (loop=0; loop<64; loop++)
+	for (loop = 0; loop < 64; loop++)
 		entry->name[loop] = ntohl(*bp++);
 	bp++; /* final NUL */
 
 	bp++; /* type */
 	entry->nservers = ntohl(*bp++);
 
-	for (loop=0; loop<8; loop++)
+	for (loop = 0; loop < 8; loop++)
 		entry->servers[loop].s_addr = *bp++;
 
 	bp += 8; /* partition IDs */
 
-	for (loop=0; loop<8; loop++) {
+	for (loop = 0; loop < 8; loop++) {
 		tmp = ntohl(*bp++);
-		if (tmp & AFS_VLSF_RWVOL  ) entry->srvtmask[loop] |= AFS_VOL_VTM_RW;
-		if (tmp & AFS_VLSF_ROVOL  ) entry->srvtmask[loop] |= AFS_VOL_VTM_RO;
-		if (tmp & AFS_VLSF_BACKVOL) entry->srvtmask[loop] |= AFS_VOL_VTM_BAK;
+		if (tmp & AFS_VLSF_RWVOL)
+			entry->srvtmask[loop] |= AFS_VOL_VTM_RW;
+		if (tmp & AFS_VLSF_ROVOL)
+			entry->srvtmask[loop] |= AFS_VOL_VTM_RO;
+		if (tmp & AFS_VLSF_BACKVOL)
+			entry->srvtmask[loop] |= AFS_VOL_VTM_BAK;
 	}
 
 	entry->vid[0] = ntohl(*bp++);
@@ -387,9 +406,12 @@
 	bp++; /* clone ID */
 
 	tmp = ntohl(*bp++); /* flags */
-	if (tmp & AFS_VLF_RWEXISTS  ) entry->vidmask |= AFS_VOL_VTM_RW;
-	if (tmp & AFS_VLF_ROEXISTS  ) entry->vidmask |= AFS_VOL_VTM_RO;
-	if (tmp & AFS_VLF_BACKEXISTS) entry->vidmask |= AFS_VOL_VTM_BAK;
+	if (tmp & AFS_VLF_RWEXISTS)
+		entry->vidmask |= AFS_VOL_VTM_RW;
+	if (tmp & AFS_VLF_ROEXISTS)
+		entry->vidmask |= AFS_VOL_VTM_RO;
+	if (tmp & AFS_VLF_BACKEXISTS)
+		entry->vidmask |= AFS_VOL_VTM_BAK;
 
 	ret = -ENOMEDIUM;
 	if (!entry->vidmask)
@@ -412,17 +434,17 @@
 
  out_unwait:
 	set_current_state(TASK_RUNNING);
-	remove_wait_queue(&call->waitq,&myself);
+	remove_wait_queue(&call->waitq, &myself);
 	rxrpc_put_call(call);
  out_put_conn:
 	rxrpc_put_connection(conn);
  out:
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 
  abort:
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	rxrpc_call_abort(call,ret);
+	rxrpc_call_abort(call, ret);
 	schedule();
 	goto out_unwait;
 } /* end afs_rxvl_get_entry_by_id() */
@@ -431,7 +453,7 @@
 /*
  * look up a volume location database entry by ID asynchronously
  */
-int afs_rxvl_get_entry_by_id_async(afs_async_op_t *op,
+int afs_rxvl_get_entry_by_id_async(struct afs_async_op *op,
 				   afs_volid_t volid,
 				   afs_voltype_t voltype)
 {
@@ -442,12 +464,12 @@
 	int ret;
 	u32 param[3];
 
-	_enter(",%x,%d,",volid,voltype);
+	_enter(",%x,%d,", volid, voltype);
 
 	/* get hold of the vlserver connection */
-	ret = afs_server_get_vlconn(op->server,&conn);
-	if (ret<0) {
-		_leave(" = %d",ret);
+	ret = afs_server_get_vlconn(op->server, &conn);
+	if (ret < 0) {
+		_leave(" = %d", ret);
 		return ret;
 	}
 
@@ -459,9 +481,9 @@
 				&op->call);
 	rxrpc_put_connection(conn);
 
-	if (ret<0) {
-		printk("kAFS: Unable to create call: %d\n",ret);
-		_leave(" = %d",ret);
+	if (ret < 0) {
+		printk("kAFS: Unable to create call: %d\n", ret);
+		_leave(" = %d", ret);
 		return ret;
 	}
 
@@ -483,18 +505,19 @@
 	piov[0].iov_base = param;
 
 	/* allocate result read buffer in scratch space */
-	call->app_scr_ptr = rxrpc_call_alloc_scratch(op->call,384);
+	call->app_scr_ptr = rxrpc_call_alloc_scratch(op->call, 384);
 
 	/* send the parameters to the server */
-	ret = rxrpc_call_write_data(call,1,piov,RXRPC_LAST_PACKET,GFP_NOFS,0,&sent);
-	if (ret<0) {
-		rxrpc_call_abort(call,ret); /* handle from kafsasyncd */
+	ret = rxrpc_call_write_data(call, 1, piov, RXRPC_LAST_PACKET, GFP_NOFS,
+				    0, &sent);
+	if (ret < 0) {
+		rxrpc_call_abort(call, ret); /* handle from kafsasyncd */
 		ret = 0;
 		goto out;
 	}
 
 	/* wait for the reply to completely arrive */
-	ret = rxrpc_call_read_data(call,call->app_scr_ptr,384,0);
+	ret = rxrpc_call_read_data(call, call->app_scr_ptr, 384, 0);
 	switch (ret) {
 	case 0:
 	case -EAGAIN:
@@ -503,14 +526,14 @@
 		break;	/* all handled by kafsasyncd */
 
 	default:
-		rxrpc_call_abort(call,ret); /* force kafsasyncd to handle it */
+		rxrpc_call_abort(call, ret); /* make kafsasyncd handle it */
 		ret = 0;
 		break;
 	}
 
  out:
 	rxrpc_put_call(call);
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 
 } /* end afs_rxvl_get_entry_by_id_async() */
@@ -519,40 +542,43 @@
 /*
  * attend to the asynchronous get VLDB entry by ID
  */
-int afs_rxvl_get_entry_by_id_async2(afs_async_op_t *op,
+int afs_rxvl_get_entry_by_id_async2(struct afs_async_op *op,
 				    struct afs_cache_vlocation *entry)
 {
 	unsigned *bp, tmp;
 	int loop, ret;
 
-	_enter("{op=%p cst=%u}",op,op->call->app_call_state);
+	_enter("{op=%p cst=%u}", op, op->call->app_call_state);
 
-	memset(entry,0,sizeof(*entry));
+	memset(entry, 0, sizeof(*entry));
 
-	if (op->call->app_call_state==RXRPC_CSTATE_COMPLETE) {
+	if (op->call->app_call_state == RXRPC_CSTATE_COMPLETE) {
 		/* operation finished */
 		afs_kafsasyncd_terminate_op(op);
 
 		bp = op->call->app_scr_ptr;
 
 		/* unmarshall the reply */
-		for (loop=0; loop<64; loop++)
+		for (loop = 0; loop < 64; loop++)
 			entry->name[loop] = ntohl(*bp++);
 		bp++; /* final NUL */
 
 		bp++; /* type */
 		entry->nservers = ntohl(*bp++);
 
-		for (loop=0; loop<8; loop++)
+		for (loop = 0; loop < 8; loop++)
 			entry->servers[loop].s_addr = *bp++;
 
 		bp += 8; /* partition IDs */
 
-		for (loop=0; loop<8; loop++) {
+		for (loop = 0; loop < 8; loop++) {
 			tmp = ntohl(*bp++);
-			if (tmp & AFS_VLSF_RWVOL  ) entry->srvtmask[loop] |= AFS_VOL_VTM_RW;
-			if (tmp & AFS_VLSF_ROVOL  ) entry->srvtmask[loop] |= AFS_VOL_VTM_RO;
-			if (tmp & AFS_VLSF_BACKVOL) entry->srvtmask[loop] |= AFS_VOL_VTM_BAK;
+			if (tmp & AFS_VLSF_RWVOL)
+				entry->srvtmask[loop] |= AFS_VOL_VTM_RW;
+			if (tmp & AFS_VLSF_ROVOL)
+				entry->srvtmask[loop] |= AFS_VOL_VTM_RO;
+			if (tmp & AFS_VLSF_BACKVOL)
+				entry->srvtmask[loop] |= AFS_VOL_VTM_BAK;
 		}
 
 		entry->vid[0] = ntohl(*bp++);
@@ -562,13 +588,16 @@
 		bp++; /* clone ID */
 
 		tmp = ntohl(*bp++); /* flags */
-		if (tmp & AFS_VLF_RWEXISTS  ) entry->vidmask |= AFS_VOL_VTM_RW;
-		if (tmp & AFS_VLF_ROEXISTS  ) entry->vidmask |= AFS_VOL_VTM_RO;
-		if (tmp & AFS_VLF_BACKEXISTS) entry->vidmask |= AFS_VOL_VTM_BAK;
+		if (tmp & AFS_VLF_RWEXISTS)
+			entry->vidmask |= AFS_VOL_VTM_RW;
+		if (tmp & AFS_VLF_ROEXISTS)
+			entry->vidmask |= AFS_VOL_VTM_RO;
+		if (tmp & AFS_VLF_BACKEXISTS)
+			entry->vidmask |= AFS_VOL_VTM_BAK;
 
 		ret = -ENOMEDIUM;
 		if (!entry->vidmask) {
-			rxrpc_call_abort(op->call,ret);
+			rxrpc_call_abort(op->call, ret);
 			goto done;
 		}
 
@@ -589,7 +618,7 @@
 		goto done;
 	}
 
-	if (op->call->app_call_state==RXRPC_CSTATE_ERROR) {
+	if (op->call->app_call_state == RXRPC_CSTATE_ERROR) {
 		/* operation error */
 		ret = op->call->app_errno;
 		goto done;
@@ -601,7 +630,7 @@
  done:
 	rxrpc_put_call(op->call);
 	op->call = NULL;
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 } /* end afs_rxvl_get_entry_by_id_async2() */
 
@@ -612,9 +641,9 @@
  */
 static void afs_rxvl_get_entry_by_id_attn(struct rxrpc_call *call)
 {
-	afs_async_op_t *op = call->app_user;
+	struct afs_async_op *op = call->app_user;
 
-	_enter("{op=%p cst=%u}",op,call->app_call_state);
+	_enter("{op=%p cst=%u}", op, call->app_call_state);
 
 	switch (call->app_call_state) {
 	case RXRPC_CSTATE_COMPLETE:
@@ -624,7 +653,7 @@
 		if (call->app_async_read)
 			break;
 	case RXRPC_CSTATE_CLNT_GOT_REPLY:
-		if (call->app_read_count==0)
+		if (call->app_read_count == 0)
 			break;
 		printk("kAFS: Reply bigger than expected"
 		       " {cst=%u asyn=%d mark=%Zu rdy=%Zu pr=%u%s}",
@@ -635,7 +664,7 @@
 		       call->pkt_rcv_count,
 		       call->app_last_rcv ? " last" : "");
 
-		rxrpc_call_abort(call,-EBADMSG);
+		rxrpc_call_abort(call, -EBADMSG);
 		break;
 	default:
 		BUG();
@@ -652,9 +681,9 @@
  */
 static void afs_rxvl_get_entry_by_id_error(struct rxrpc_call *call)
 {
-	afs_async_op_t *op = call->app_user;
+	struct afs_async_op *op = call->app_user;
 
-	_enter("{op=%p cst=%u}",op,call->app_call_state);
+	_enter("{op=%p cst=%u}", op, call->app_call_state);
 
 	afs_kafsasyncd_attend_op(op);
 
diff -Nru a/fs/afs/vlclient.h b/fs/afs/vlclient.h
--- a/fs/afs/vlclient.h	Tue Feb  3 19:45:16 2004
+++ b/fs/afs/vlclient.h	Tue Feb  3 19:45:16 2004
@@ -72,25 +72,25 @@
 };
 
 /* probe a volume location server to see if it is still alive */
-extern int afs_rxvl_probe(afs_server_t *server, int alloc_flags);
+extern int afs_rxvl_probe(struct afs_server *server, int alloc_flags);
 
 /* look up a volume location database entry by name */
-extern int afs_rxvl_get_entry_by_name(afs_server_t *server,
+extern int afs_rxvl_get_entry_by_name(struct afs_server *server,
 				      const char *volname,
 				      unsigned volnamesz,
 				      struct afs_cache_vlocation *entry);
 
 /* look up a volume location database entry by ID */
-extern int afs_rxvl_get_entry_by_id(afs_server_t *server,
+extern int afs_rxvl_get_entry_by_id(struct afs_server *server,
 				    afs_volid_t	volid,
 				    afs_voltype_t voltype,
 				    struct afs_cache_vlocation *entry);
 
-extern int afs_rxvl_get_entry_by_id_async(afs_async_op_t *op,
+extern int afs_rxvl_get_entry_by_id_async(struct afs_async_op *op,
 					  afs_volid_t volid,
 					  afs_voltype_t voltype);
 
-extern int afs_rxvl_get_entry_by_id_async2(afs_async_op_t *op,
+extern int afs_rxvl_get_entry_by_id_async2(struct afs_async_op *op,
 					   struct afs_cache_vlocation *entry);
 
 #endif /* _LINUX_AFS_VLCLIENT_H */
diff -Nru a/fs/afs/vlocation.c b/fs/afs/vlocation.c
--- a/fs/afs/vlocation.c	Tue Feb  3 19:45:17 2004
+++ b/fs/afs/vlocation.c	Tue Feb  3 19:45:17 2004
@@ -26,15 +26,17 @@
 
 #define AFS_VLDB_TIMEOUT HZ*1000
 
-static void afs_vlocation_update_timer(afs_timer_t *timer);
-static void afs_vlocation_update_attend(afs_async_op_t *op);
-static void afs_vlocation_update_discard(afs_async_op_t *op);
+static void afs_vlocation_update_timer(struct afs_timer *timer);
+static void afs_vlocation_update_attend(struct afs_async_op *op);
+static void afs_vlocation_update_discard(struct afs_async_op *op);
 
-static void __afs_vlocation_timeout(afs_timer_t *timer)
+static void __afs_vlocation_timeout(struct afs_timer *timer)
 {
-	afs_vlocation_t *vlocation = list_entry(timer,afs_vlocation_t,timeout);
+	struct afs_vlocation *vlocation =
+		list_entry(timer, struct afs_vlocation, timeout);
 
-	_debug("VL TIMEOUT [%s{u=%d}]",vlocation->vldb.name,atomic_read(&vlocation->usage));
+	_debug("VL TIMEOUT [%s{u=%d}]",
+	       vlocation->vldb.name, atomic_read(&vlocation->usage));
 
 	afs_vlocation_do_timeout(vlocation);
 }
@@ -53,11 +55,12 @@
 };
 
 static LIST_HEAD(afs_vlocation_update_pendq);	/* queue of VLs awaiting update */
-static afs_vlocation_t *afs_vlocation_update;	/* VL currently being updated */
+static struct afs_vlocation *afs_vlocation_update;	/* VL currently being updated */
 static spinlock_t afs_vlocation_update_lock = SPIN_LOCK_UNLOCKED; /* lock guarding update queue */
 
 #ifdef AFS_CACHING_SUPPORT
-static cachefs_match_val_t afs_vlocation_cache_match(void *target, const void *entry);
+static cachefs_match_val_t afs_vlocation_cache_match(void *target,
+						     const void *entry);
 static void afs_vlocation_cache_update(void *source, void *entry);
 
 struct cachefs_index_def afs_vlocation_cache_index_def = {
@@ -71,29 +74,31 @@
 
 /*****************************************************************************/
 /*
- * iterate through the VL servers in a cell until one of them admits knowing about the volume in
- * question
+ * iterate through the VL servers in a cell until one of them admits knowing
+ * about the volume in question
  * - caller must have cell->vl_sem write-locked
  */
-static int afs_vlocation_access_vl_by_name(afs_vlocation_t *vlocation,
+static int afs_vlocation_access_vl_by_name(struct afs_vlocation *vlocation,
 					   const char *name,
 					   unsigned namesz,
 					   struct afs_cache_vlocation *vldb)
 {
-	afs_server_t *server = NULL;
-	afs_cell_t *cell = vlocation->cell;
+	struct afs_server *server = NULL;
+	struct afs_cell *cell = vlocation->cell;
 	int count, ret;
 
 	_enter("%s,%*.*s,%u", cell->name, namesz, namesz, name, namesz);
 
 	ret = -ENOMEDIUM;
-	for (count=cell->vl_naddrs; count>0; count--) {
+	for (count = cell->vl_naddrs; count > 0; count--) {
 		_debug("CellServ[%hu]: %08x",
 		       cell->vl_curr_svix,
 		       cell->vl_addrs[cell->vl_curr_svix].s_addr);
 
 		/* try and create a server */
-		ret = afs_server_lookup(cell, &cell->vl_addrs[cell->vl_curr_svix], &server);
+		ret = afs_server_lookup(cell,
+					&cell->vl_addrs[cell->vl_curr_svix],
+					&server);
 		switch (ret) {
 		case 0:
 			break;
@@ -141,36 +146,38 @@
 	}
 
  out:
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 
 } /* end afs_vlocation_access_vl_by_name() */
 
 /*****************************************************************************/
 /*
- * iterate through the VL servers in a cell until one of them admits knowing about the volume in
- * question
+ * iterate through the VL servers in a cell until one of them admits knowing
+ * about the volume in question
  * - caller must have cell->vl_sem write-locked
  */
-static int afs_vlocation_access_vl_by_id(afs_vlocation_t *vlocation,
+static int afs_vlocation_access_vl_by_id(struct afs_vlocation *vlocation,
 					 afs_volid_t volid,
 					 afs_voltype_t voltype,
 					 struct afs_cache_vlocation *vldb)
 {
-	afs_server_t *server = NULL;
-	afs_cell_t *cell = vlocation->cell;
+	struct afs_server *server = NULL;
+	struct afs_cell *cell = vlocation->cell;
 	int count, ret;
 
 	_enter("%s,%x,%d,", cell->name, volid, voltype);
 
 	ret = -ENOMEDIUM;
-	for (count=cell->vl_naddrs; count>0; count--) {
+	for (count = cell->vl_naddrs; count > 0; count--) {
 		_debug("CellServ[%hu]: %08x",
 		       cell->vl_curr_svix,
 		       cell->vl_addrs[cell->vl_curr_svix].s_addr);
 
 		/* try and create a server */
-		ret = afs_server_lookup(cell, &cell->vl_addrs[cell->vl_curr_svix], &server);
+		ret = afs_server_lookup(cell,
+					&cell->vl_addrs[cell->vl_curr_svix],
+					&server);
 		switch (ret) {
 		case 0:
 			break;
@@ -218,7 +225,7 @@
 	}
 
  out:
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 
 } /* end afs_vlocation_access_vl_by_id() */
@@ -227,17 +234,18 @@
 /*
  * lookup volume location
  * - caller must have cell->vol_sem write-locked
- * - iterate through the VL servers in a cell until one of them admits knowing about the volume in
- *   question
+ * - iterate through the VL servers in a cell until one of them admits knowing
+ *   about the volume in question
  * - lookup in the local cache if not able to find on the VL server
  * - insert/update in the local cache if did get a VL response
  */
-int afs_vlocation_lookup(afs_cell_t *cell, const char *name, unsigned namesz,
-			 afs_vlocation_t **_vlocation)
+int afs_vlocation_lookup(struct afs_cell *cell,
+			 const char *name,
+			 unsigned namesz,
+			 struct afs_vlocation **_vlocation)
 {
 	struct afs_cache_vlocation vldb;
-	struct list_head *_p;
-	afs_vlocation_t *vlocation;
+	struct afs_vlocation *vlocation;
 	afs_voltype_t voltype;
 	afs_volid_t vid;
 	int active = 0, ret;
@@ -250,8 +258,7 @@
 	}
 
 	/* search the cell's active list first */
-	list_for_each(_p, &cell->vl_list) {
-		vlocation = list_entry(_p, afs_vlocation_t, link);
+	list_for_each_entry(vlocation, &cell->vl_list, link) {
 		if (namesz < sizeof(vlocation->vldb.name) &&
 		    vlocation->vldb.name[namesz] != '\0')
 			continue;
@@ -262,8 +269,7 @@
 
 	/* search the cell's graveyard list second */
 	spin_lock(&cell->vl_gylock);
-	list_for_each(_p, &cell->vl_graveyard) {
-		vlocation = list_entry(_p, afs_vlocation_t, link);
+	list_for_each_entry(vlocation, &cell->vl_graveyard, link) {
 		if (namesz < sizeof(vlocation->vldb.name) &&
 		    vlocation->vldb.name[namesz] != '\0')
 			continue;
@@ -274,11 +280,11 @@
 	spin_unlock(&cell->vl_gylock);
 
 	/* not in the cell's in-memory lists - create a new record */
-	vlocation = kmalloc(sizeof(afs_vlocation_t), GFP_KERNEL);
+	vlocation = kmalloc(sizeof(struct afs_vlocation), GFP_KERNEL);
 	if (!vlocation)
 		return -ENOMEM;
 
-	memset(vlocation, 0, sizeof(afs_vlocation_t));
+	memset(vlocation, 0, sizeof(struct afs_vlocation));
 	atomic_set(&vlocation->usage, 1);
 	INIT_LIST_HEAD(&vlocation->link);
 	rwlock_init(&vlocation->lock);
@@ -294,7 +300,8 @@
 	list_add_tail(&vlocation->link, &cell->vl_list);
 
 #ifdef AFS_CACHING_SUPPORT
-	/* we want to store it in the cache, plus it might already be encached */
+	/* we want to store it in the cache, plus it might already be
+	 * encached */
 	cachefs_acquire_cookie(cell->cache,
 			       &afs_volume_cache_index_def,
 			       vlocation,
@@ -306,7 +313,7 @@
 
 	/* try to look up an unknown volume in the cell VL databases by name */
 	ret = afs_vlocation_access_vl_by_name(vlocation, name, namesz, &vldb);
-	if (ret<0) {
+	if (ret < 0) {
 		printk("kAFS: failed to locate '%*.*s' in cell '%s'\n",
 		       namesz, namesz, name, cell->name);
 		goto error;
@@ -342,13 +349,18 @@
 	_debug("Locally Cached: %s %02x { %08x(%x) %08x(%x) %08x(%x) }",
 	       vlocation->vldb.name,
 	       vlocation->vldb.vidmask,
-	       ntohl(vlocation->vldb.servers[0].s_addr), vlocation->vldb.srvtmask[0],
-	       ntohl(vlocation->vldb.servers[1].s_addr), vlocation->vldb.srvtmask[1],
-	       ntohl(vlocation->vldb.servers[2].s_addr), vlocation->vldb.srvtmask[2]
+	       ntohl(vlocation->vldb.servers[0].s_addr),
+	       vlocation->vldb.srvtmask[0],
+	       ntohl(vlocation->vldb.servers[1].s_addr),
+	       vlocation->vldb.srvtmask[1],
+	       ntohl(vlocation->vldb.servers[2].s_addr),
+	       vlocation->vldb.srvtmask[2]
 	       );
 
 	_debug("Vids: %08x %08x %08x",
-	       vlocation->vldb.vid[0], vlocation->vldb.vid[1], vlocation->vldb.vid[2]);
+	       vlocation->vldb.vid[0],
+	       vlocation->vldb.vid[1],
+	       vlocation->vldb.vid[2]);
 
 	if (vlocation->vldb.vidmask & AFS_VOL_VTM_RW) {
 		vid = vlocation->vldb.vid[0];
@@ -400,21 +412,20 @@
 
 	_debug("Vids: %08x %08x %08x", vldb.vid[0], vldb.vid[1], vldb.vid[2]);
 
-	if ((namesz < sizeof(vlocation->vldb.name) && vlocation->vldb.name[namesz] != '\0') ||
+	if ((namesz < sizeof(vlocation->vldb.name) &&
+	     vlocation->vldb.name[namesz] != '\0') ||
 	    memcmp(vldb.name, name, namesz) != 0)
 		printk("kAFS: name of volume '%*.*s' changed to '%s' on server\n",
 		       namesz, namesz, name, vldb.name);
 
 	memcpy(&vlocation->vldb, &vldb, sizeof(vlocation->vldb));
 
-#if 0
-	/* add volume entry to local cache */
-	ret = afsc_update_vlocation(vlocation);
-	if (ret<0)
-		goto error;
-#endif
+	afs_kafstimod_add_timer(&vlocation->upd_timer, 10 * HZ);
 
-	afs_kafstimod_add_timer(&vlocation->upd_timer, 10*HZ);
+#ifdef AFS_CACHING_SUPPORT
+	/* update volume entry in local cache */
+	cachefs_update_cookie(vlocation->cache);
+#endif
 
 	*_vlocation = vlocation;
 	_leave(" = 0 (%p)",vlocation);
@@ -435,7 +446,7 @@
 		}
 	}
 
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 } /* end afs_vlocation_lookup() */
 
@@ -451,13 +462,12 @@
 	if (!vlocation)
 		return;
 
-	_enter("%s",vlocation->vldb.name);
+	_enter("%s", vlocation->vldb.name);
 
 	cell = vlocation->cell;
 
 	/* sanity check */
-	if (atomic_read(&vlocation->usage)<=0)
-		BUG();
+	BUG_ON(atomic_read(&vlocation->usage) <= 0);
 
 	spin_lock(&cell->vl_gylock);
 	if (likely(!atomic_dec_and_test(&vlocation->usage))) {
@@ -470,12 +480,13 @@
 	list_del(&vlocation->link);
 	list_add_tail(&vlocation->link,&cell->vl_graveyard);
 
-	/* remove from pending timeout queue (refcounted if actually being updated) */
+	/* remove from pending timeout queue (refcounted if actually being
+	 * updated) */
 	list_del_init(&vlocation->upd_op.link);
 
 	/* time out in 10 secs */
 	afs_kafstimod_del_timer(&vlocation->upd_timer);
-	afs_kafstimod_add_timer(&vlocation->timeout,10*HZ);
+	afs_kafstimod_add_timer(&vlocation->timeout, 10 * HZ);
 
 	spin_unlock(&cell->vl_gylock);
 
@@ -486,7 +497,7 @@
 /*
  * finish using a volume location record
  */
-void afs_put_vlocation(afs_vlocation_t *vlocation)
+void afs_put_vlocation(struct afs_vlocation *vlocation)
 {
 	if (vlocation) {
 		struct afs_cell *cell = vlocation->cell;
@@ -502,19 +513,19 @@
  * timeout vlocation record
  * - removes from the cell's graveyard if the usage count is zero
  */
-void afs_vlocation_do_timeout(afs_vlocation_t *vlocation)
+void afs_vlocation_do_timeout(struct afs_vlocation *vlocation)
 {
-	afs_cell_t *cell;
+	struct afs_cell *cell;
 
-	_enter("%s",vlocation->vldb.name);
+	_enter("%s", vlocation->vldb.name);
 
 	cell = vlocation->cell;
 
-	if (atomic_read(&vlocation->usage)<0) BUG();
+	BUG_ON(atomic_read(&vlocation->usage) < 0);
 
 	/* remove from graveyard if still dead */
 	spin_lock(&cell->vl_gylock);
-	if (atomic_read(&vlocation->usage)==0)
+	if (atomic_read(&vlocation->usage) == 0)
 		list_del_init(&vlocation->link);
 	else
 		vlocation = NULL;
@@ -527,7 +538,7 @@
 
 	/* we can now destroy it properly */
 #ifdef AFS_CACHING_SUPPORT
-	cachefs_relinquish_cookie(vlocation->cache,0);
+	cachefs_relinquish_cookie(vlocation->cache, 0);
 #endif
 	afs_put_cell(cell);
 
@@ -540,14 +551,16 @@
 /*
  * send an update operation to the currently selected server
  */
-static int afs_vlocation_update_begin(afs_vlocation_t *vlocation)
+static int afs_vlocation_update_begin(struct afs_vlocation *vlocation)
 {
 	afs_voltype_t voltype;
 	afs_volid_t vid;
 	int ret;
 
 	_enter("%s{ufs=%u ucs=%u}",
-	       vlocation->vldb.name,vlocation->upd_first_svix,vlocation->upd_curr_svix);
+	       vlocation->vldb.name,
+	       vlocation->upd_first_svix,
+	       vlocation->upd_curr_svix);
 
 	/* try to look up a cached volume in the cell VL databases by ID */
 	if (vlocation->vldb.vidmask & AFS_VOL_VTM_RW) {
@@ -569,27 +582,29 @@
 	}
 
 	/* contact the chosen server */
-	ret = afs_server_lookup(vlocation->cell,
-				&vlocation->cell->vl_addrs[vlocation->upd_curr_svix],
-				&vlocation->upd_op.server);
+	ret = afs_server_lookup(
+		vlocation->cell,
+		&vlocation->cell->vl_addrs[vlocation->upd_curr_svix],
+		&vlocation->upd_op.server);
+
 	switch (ret) {
 	case 0:
 		break;
 	case -ENOMEM:
 	case -ENONET:
 	default:
-		_leave(" = %d",ret);
+		_leave(" = %d", ret);
 		return ret;
 	}
 
 	/* initiate the update operation */
-	ret = afs_rxvl_get_entry_by_id_async(&vlocation->upd_op,vid,voltype);
-	if (ret<0) {
-		_leave(" = %d",ret);
+	ret = afs_rxvl_get_entry_by_id_async(&vlocation->upd_op, vid, voltype);
+	if (ret < 0) {
+		_leave(" = %d", ret);
 		return ret;
 	}
 
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 } /* end afs_vlocation_update_begin() */
 
@@ -598,14 +613,15 @@
  * abandon updating a VL record
  * - does not restart the update timer
  */
-static void afs_vlocation_update_abandon(afs_vlocation_t *vlocation,
+static void afs_vlocation_update_abandon(struct afs_vlocation *vlocation,
 					 afs_vlocation_upd_t state,
 					 int ret)
 {
-	_enter("%s,%u",vlocation->vldb.name,state);
+	_enter("%s,%u", vlocation->vldb.name, state);
 
-	if (ret<0)
-		printk("kAFS: Abandoning VL update '%s': %d\n",vlocation->vldb.name,ret);
+	if (ret < 0)
+		printk("kAFS: Abandoning VL update '%s': %d\n",
+		       vlocation->vldb.name, ret);
 
 	/* discard the server record */
 	afs_put_server(vlocation->upd_op.server);
@@ -627,12 +643,13 @@
  * handle periodic update timeouts and busy retry timeouts
  * - called from kafstimod
  */
-static void afs_vlocation_update_timer(afs_timer_t *timer)
+static void afs_vlocation_update_timer(struct afs_timer *timer)
 {
-	afs_vlocation_t *vlocation = list_entry(timer,afs_vlocation_t,upd_timer);
+	struct afs_vlocation *vlocation =
+		list_entry(timer, struct afs_vlocation, upd_timer);
 	int ret;
 
-	_enter("%s",vlocation->vldb.name);
+	_enter("%s", vlocation->vldb.name);
 
 	/* only update if not in the graveyard (defend against putting too) */
 	spin_lock(&vlocation->cell->vl_gylock);
@@ -642,11 +659,12 @@
 
 	spin_lock(&afs_vlocation_update_lock);
 
-	/* if we were woken up due to EBUSY sleep then restart immediately if possible or else jump
-	 * to front of pending queue */
-	if (vlocation->upd_state==AFS_VLUPD_BUSYSLEEP) {
+	/* if we were woken up due to EBUSY sleep then restart immediately if
+	 * possible or else jump to front of pending queue */
+	if (vlocation->upd_state == AFS_VLUPD_BUSYSLEEP) {
 		if (afs_vlocation_update) {
-			list_add(&vlocation->upd_op.link,&afs_vlocation_update_pendq);
+			list_add(&vlocation->upd_op.link,
+				 &afs_vlocation_update_pendq);
 		}
 		else {
 			afs_get_vlocation(vlocation);
@@ -659,7 +677,8 @@
 	/* put on pending queue if there's already another update in progress */
 	if (afs_vlocation_update) {
 		vlocation->upd_state = AFS_VLUPD_PENDING;
-		list_add_tail(&vlocation->upd_op.link,&afs_vlocation_update_pendq);
+		list_add_tail(&vlocation->upd_op.link,
+			      &afs_vlocation_update_pendq);
 		goto out_unlock2;
 	}
 
@@ -672,16 +691,17 @@
 	spin_unlock(&vlocation->cell->vl_gylock);
 
 	/* okay... we can start the update */
-	_debug("BEGIN VL UPDATE [%s]",vlocation->vldb.name);
+	_debug("BEGIN VL UPDATE [%s]", vlocation->vldb.name);
 	vlocation->upd_first_svix = vlocation->cell->vl_curr_svix;
 	vlocation->upd_curr_svix = vlocation->upd_first_svix;
 	vlocation->upd_rej_cnt = 0;
 	vlocation->upd_busy_cnt = 0;
 
 	ret = afs_vlocation_update_begin(vlocation);
-	if (ret<0) {
-		afs_vlocation_update_abandon(vlocation,AFS_VLUPD_SLEEP,ret);
-		afs_kafstimod_add_timer(&vlocation->upd_timer,AFS_VLDB_TIMEOUT);
+	if (ret < 0) {
+		afs_vlocation_update_abandon(vlocation, AFS_VLUPD_SLEEP, ret);
+		afs_kafstimod_add_timer(&vlocation->upd_timer,
+					AFS_VLDB_TIMEOUT);
 		afs_put_vlocation(vlocation);
 	}
 
@@ -702,56 +722,60 @@
  * attend to an update operation upon which an event happened
  * - called in kafsasyncd context
  */
-static void afs_vlocation_update_attend(afs_async_op_t *op)
+static void afs_vlocation_update_attend(struct afs_async_op *op)
 {
 	struct afs_cache_vlocation vldb;
-	afs_vlocation_t *vlocation = list_entry(op,afs_vlocation_t,upd_op);
+	struct afs_vlocation *vlocation =
+		list_entry(op, struct afs_vlocation, upd_op);
 	unsigned tmp;
 	int ret;
 
-	_enter("%s",vlocation->vldb.name);
+	_enter("%s", vlocation->vldb.name);
 
-	ret = afs_rxvl_get_entry_by_id_async2(op,&vldb);
+	ret = afs_rxvl_get_entry_by_id_async2(op, &vldb);
 	switch (ret) {
 	case -EAGAIN:
 		_leave(" [unfinished]");
 		return;
 
 	case 0:
-		_debug("END VL UPDATE: %d\n",ret);
+		_debug("END VL UPDATE: %d\n", ret);
 		vlocation->valid = 1;
 
 		_debug("Done VL Lookup: %02x { %08x(%x) %08x(%x) %08x(%x) }",
 		       vldb.vidmask,
-		       ntohl(vldb.servers[0].s_addr),vldb.srvtmask[0],
-		       ntohl(vldb.servers[1].s_addr),vldb.srvtmask[1],
-		       ntohl(vldb.servers[2].s_addr),vldb.srvtmask[2]
+		       ntohl(vldb.servers[0].s_addr), vldb.srvtmask[0],
+		       ntohl(vldb.servers[1].s_addr), vldb.srvtmask[1],
+		       ntohl(vldb.servers[2].s_addr), vldb.srvtmask[2]
 		       );
 
-		_debug("Vids: %08x %08x %08x",vldb.vid[0],vldb.vid[1],vldb.vid[2]);
+		_debug("Vids: %08x %08x %08x",
+		       vldb.vid[0], vldb.vid[1], vldb.vid[2]);
 
-		afs_vlocation_update_abandon(vlocation,AFS_VLUPD_SLEEP,0);
+		afs_vlocation_update_abandon(vlocation, AFS_VLUPD_SLEEP, 0);
 
 		down_write(&vlocation->cell->vl_sem);
 
 		/* actually update the cache */
-		if (strncmp(vldb.name,vlocation->vldb.name,sizeof(vlocation->vldb.name))!=0)
-			printk("kAFS: name of volume '%s' changed to '%s' on server\n",
-			       vlocation->vldb.name,vldb.name);
+		if (strncmp(vldb.name, vlocation->vldb.name,
+			    sizeof(vlocation->vldb.name)) != 0)
+			printk("kAFS: name of volume '%s'"
+			       " changed to '%s' on server\n",
+			       vlocation->vldb.name, vldb.name);
 
-		memcpy(&vlocation->vldb,&vldb,sizeof(vlocation->vldb));
+		memcpy(&vlocation->vldb, &vldb, sizeof(vlocation->vldb));
 
 #if 0
-		/* add volume entry to local cache */
-		ret = afsc_update_vlocation(vlocation);
+		/* TODO update volume entry in local cache */
 #endif
 
 		up_write(&vlocation->cell->vl_sem);
 
-		if (ret<0)
-			printk("kAFS: failed to update local cache: %d\n",ret);
+		if (ret < 0)
+			printk("kAFS: failed to update local cache: %d\n", ret);
 
-		afs_kafstimod_add_timer(&vlocation->upd_timer,AFS_VLDB_TIMEOUT);
+		afs_kafstimod_add_timer(&vlocation->upd_timer,
+					AFS_VLDB_TIMEOUT);
 		afs_put_vlocation(vlocation);
 		_leave(" [found]");
 		return;
@@ -763,11 +787,12 @@
 		/* the server is locked - retry in a very short while */
 	case -EBUSY:
 		vlocation->upd_busy_cnt++;
-		if (vlocation->upd_busy_cnt>3)
+		if (vlocation->upd_busy_cnt > 3)
 			goto try_next; /* too many retries */
 
-		afs_vlocation_update_abandon(vlocation,AFS_VLUPD_BUSYSLEEP,0);
-		afs_kafstimod_add_timer(&vlocation->upd_timer,HZ/2);
+		afs_vlocation_update_abandon(vlocation,
+					     AFS_VLUPD_BUSYSLEEP, 0);
+		afs_kafstimod_add_timer(&vlocation->upd_timer, HZ / 2);
 		afs_put_vlocation(vlocation);
 		_leave(" [busy]");
 		return;
@@ -781,7 +806,8 @@
 		 */
 		if (vlocation->upd_curr_svix == vlocation->cell->vl_curr_svix)
 			vlocation->cell->vl_curr_svix =
-				vlocation->cell->vl_curr_svix % vlocation->cell->vl_naddrs;
+				vlocation->cell->vl_curr_svix %
+				vlocation->cell->vl_naddrs;
 
 	case -EBADRQC:
 	case -EINVAL:
@@ -802,26 +828,30 @@
 	vlocation->upd_op.server = NULL;
 
 	tmp = vlocation->cell->vl_naddrs;
-	if (tmp==0)
+	if (tmp == 0)
 		goto abandon;
 
 	vlocation->upd_curr_svix++;
-	if (vlocation->upd_curr_svix >= tmp) vlocation->upd_curr_svix = 0;
-	if (vlocation->upd_first_svix >= tmp) vlocation->upd_first_svix = tmp - 1;
+	if (vlocation->upd_curr_svix >= tmp)
+		vlocation->upd_curr_svix = 0;
+	if (vlocation->upd_first_svix >= tmp)
+		vlocation->upd_first_svix = tmp - 1;
 
 	/* move to the next server */
-	if (vlocation->upd_curr_svix!=vlocation->upd_first_svix) {
+	if (vlocation->upd_curr_svix != vlocation->upd_first_svix) {
 		afs_vlocation_update_begin(vlocation);
 		_leave(" [next]");
 		return;
 	}
 
 	/* run out of servers to try - was the volume rejected? */
-	if (vlocation->upd_rej_cnt>0) {
-		printk("kAFS: Active volume no longer valid '%s'\n",vlocation->vldb.name);
+	if (vlocation->upd_rej_cnt > 0) {
+		printk("kAFS: Active volume no longer valid '%s'\n",
+		       vlocation->vldb.name);
 		vlocation->valid = 0;
-		afs_vlocation_update_abandon(vlocation,AFS_VLUPD_SLEEP,0);
-		afs_kafstimod_add_timer(&vlocation->upd_timer,AFS_VLDB_TIMEOUT);
+		afs_vlocation_update_abandon(vlocation, AFS_VLUPD_SLEEP, 0);
+		afs_kafstimod_add_timer(&vlocation->upd_timer,
+					AFS_VLDB_TIMEOUT);
 		afs_put_vlocation(vlocation);
 		_leave(" [invalidated]");
 		return;
@@ -829,8 +859,8 @@
 
 	/* abandon the update */
  abandon:
-	afs_vlocation_update_abandon(vlocation,AFS_VLUPD_SLEEP,ret);
-	afs_kafstimod_add_timer(&vlocation->upd_timer,HZ*10);
+	afs_vlocation_update_abandon(vlocation, AFS_VLUPD_SLEEP, ret);
+	afs_kafstimod_add_timer(&vlocation->upd_timer, HZ * 10);
 	afs_put_vlocation(vlocation);
 	_leave(" [abandoned]");
 
@@ -842,11 +872,12 @@
  * - called in kafsasyncd context when it's dying due to rmmod
  * - the call has already been aborted and put()'d
  */
-static void afs_vlocation_update_discard(afs_async_op_t *op)
+static void afs_vlocation_update_discard(struct afs_async_op *op)
 {
-	afs_vlocation_t *vlocation = list_entry(op,afs_vlocation_t,upd_op);
+	struct afs_vlocation *vlocation =
+		list_entry(op, struct afs_vlocation, upd_op);
 
-	_enter("%s",vlocation->vldb.name);
+	_enter("%s", vlocation->vldb.name);
 
 	afs_put_server(op->server);
 	op->server = NULL;
@@ -870,11 +901,11 @@
 
 	_enter("{%s},{%s}", vlocation->vldb.name, vldb->name);
 
-	if (strncmp(vlocation->vldb.name,
-		    vldb->name,
-		    sizeof(vldb->name)) == 0) {
+	if (strncmp(vlocation->vldb.name, vldb->name, sizeof(vldb->name)) == 0
+	    ) {
 		if (!vlocation->valid ||
-		    vlocation->vldb.rtime == vldb->rtime) {
+		    vlocation->vldb.rtime == vldb->rtime
+		    ) {
 			struct_cpy(&vlocation->vldb, vldb);
 			vlocation->valid = 1;
 			_leave(" = SUCCESS [c->m]");
diff -Nru a/fs/afs/vnode.c b/fs/afs/vnode.c
--- a/fs/afs/vnode.c	Tue Feb  3 19:45:17 2004
+++ b/fs/afs/vnode.c	Tue Feb  3 19:45:17 2004
@@ -30,7 +30,8 @@
 };
 
 #ifdef AFS_CACHING_SUPPORT
-static cachefs_match_val_t afs_vnode_cache_match(void *target, const void *entry);
+static cachefs_match_val_t afs_vnode_cache_match(void *target,
+						 const void *entry);
 static void afs_vnode_cache_update(void *source, void *entry);
 
 struct cachefs_index_def afs_vnode_cache_index_def = {
@@ -49,17 +50,17 @@
  */
 static void afs_vnode_cb_timed_out(struct afs_timer *timer)
 {
-	afs_server_t *oldserver;
-	afs_vnode_t *vnode;
+	struct afs_server *oldserver;
+	struct afs_vnode *vnode;
 
-	vnode = list_entry(timer,afs_vnode_t,cb_timeout);
+	vnode = list_entry(timer, struct afs_vnode, cb_timeout);
 
-	_enter("%p",vnode);
+	_enter("%p", vnode);
 
 	/* set the changed flag in the vnode and release the server */
 	spin_lock(&vnode->lock);
 
-	oldserver = xchg(&vnode->cb_server,NULL);
+	oldserver = xchg(&vnode->cb_server, NULL);
 	if (oldserver) {
 		vnode->flags |= AFS_VNODE_CHANGED;
 
@@ -85,28 +86,33 @@
  * - starts callback expiry timer
  * - adds to server's callback list
  */
-void afs_vnode_finalise_status_update(afs_vnode_t *vnode, afs_server_t *server, int ret)
+void afs_vnode_finalise_status_update(struct afs_vnode *vnode,
+				      struct afs_server *server,
+				      int ret)
 {
-	afs_server_t *oldserver = NULL;
+	struct afs_server *oldserver = NULL;
 
-	_enter("%p,%p,%d",vnode,server,ret);
+	_enter("%p,%p,%d", vnode, server, ret);
 
 	spin_lock(&vnode->lock);
 
 	vnode->flags &= ~AFS_VNODE_CHANGED;
 
-	if (ret==0) {
+	if (ret == 0) {
 		/* adjust the callback timeout appropriately */
-		afs_kafstimod_add_timer(&vnode->cb_timeout,vnode->cb_expiry*HZ);
+		afs_kafstimod_add_timer(&vnode->cb_timeout,
+					vnode->cb_expiry * HZ);
 
 		spin_lock(&afs_cb_hash_lock);
 		list_del(&vnode->cb_hash_link);
-		list_add_tail(&vnode->cb_hash_link,&afs_cb_hash(server,&vnode->fid));
+		list_add_tail(&vnode->cb_hash_link,
+			      &afs_cb_hash(server, &vnode->fid));
 		spin_unlock(&afs_cb_hash_lock);
 
-		/* swap ref to old callback server with that for new callback server */
-		oldserver = xchg(&vnode->cb_server,server);
-		if (oldserver!=server) {
+		/* swap ref to old callback server with that for new callback
+		 * server */
+		oldserver = xchg(&vnode->cb_server, server);
+		if (oldserver != server) {
 			if (oldserver) {
 				spin_lock(&oldserver->cb_lock);
 				list_del_init(&vnode->cb_link);
@@ -115,7 +121,7 @@
 
 			afs_get_server(server);
 			spin_lock(&server->cb_lock);
-			list_add_tail(&vnode->cb_link,&server->cb_promises);
+			list_add_tail(&vnode->cb_link, &server->cb_promises);
 			spin_unlock(&server->cb_lock);
 		}
 		else {
@@ -123,9 +129,9 @@
 			oldserver = NULL;
 		}
 	}
-	else if (ret==-ENOENT) {
+	else if (ret == -ENOENT) {
 		/* the file was deleted - clear the callback timeout */
-		oldserver = xchg(&vnode->cb_server,NULL);
+		oldserver = xchg(&vnode->cb_server, NULL);
 		afs_kafstimod_del_timer(&vnode->cb_timeout);
 
 		_debug("got NOENT from server - marking file deleted");
@@ -152,15 +158,16 @@
  *   - there are any outstanding ops that will fetch the status
  * - TODO implement local caching
  */
-int afs_vnode_fetch_status(afs_vnode_t *vnode)
+int afs_vnode_fetch_status(struct afs_vnode *vnode)
 {
-	afs_server_t *server;
+	struct afs_server *server;
 	int ret;
 
-	DECLARE_WAITQUEUE(myself,current);
+	DECLARE_WAITQUEUE(myself, current);
 
-	_enter("%s,{%u,%u,%u}",vnode->volume->vlocation->vldb.name,
-	       vnode->fid.vid,vnode->fid.vnode,vnode->fid.unique);
+	_enter("%s,{%u,%u,%u}",
+	       vnode->volume->vlocation->vldb.name,
+	       vnode->fid.vid, vnode->fid.vnode, vnode->fid.unique);
 
 	if (!(vnode->flags & AFS_VNODE_CHANGED) && vnode->cb_server) {
 		_leave(" [unchanged]");
@@ -180,19 +187,23 @@
 		return 0;
 	}
 
-	if (vnode->update_cnt>0) {
+	if (vnode->update_cnt > 0) {
 		/* someone else started a fetch */
 		set_current_state(TASK_UNINTERRUPTIBLE);
-		add_wait_queue(&vnode->update_waitq,&myself);
+		add_wait_queue(&vnode->update_waitq, &myself);
 
 		/* wait for the status to be updated */
 		for (;;) {
-			if (!(vnode->flags & AFS_VNODE_CHANGED))	break;
-			if (vnode->flags & AFS_VNODE_DELETED)		break;
-
-			/* it got updated and invalidated all before we saw it */
-			if (vnode->update_cnt==0) {
-				remove_wait_queue(&vnode->update_waitq,&myself);
+			if (!(vnode->flags & AFS_VNODE_CHANGED))
+				break;
+			if (vnode->flags & AFS_VNODE_DELETED)
+				break;
+
+			/* it got updated and invalidated all before we saw
+			 * it */
+			if (vnode->update_cnt == 0) {
+				remove_wait_queue(&vnode->update_waitq,
+						  &myself);
 				set_current_state(TASK_RUNNING);
 				goto get_anyway;
 			}
@@ -205,7 +216,7 @@
 			spin_lock(&vnode->lock);
 		}
 
-		remove_wait_queue(&vnode->update_waitq,&myself);
+		remove_wait_queue(&vnode->update_waitq, &myself);
 		spin_unlock(&vnode->lock);
 		set_current_state(TASK_RUNNING);
 
@@ -218,23 +229,24 @@
 
 	spin_unlock(&vnode->lock);
 
-	/* merge AFS status fetches and clear outstanding callback on this vnode */
+	/* merge AFS status fetches and clear outstanding callback on this
+	 * vnode */
 	do {
 		/* pick a server to query */
-		ret = afs_volume_pick_fileserver(vnode->volume,&server);
+		ret = afs_volume_pick_fileserver(vnode->volume, &server);
 		if (ret<0)
 			return ret;
 
-		_debug("USING SERVER: %08x\n",ntohl(server->addr.s_addr));
+		_debug("USING SERVER: %08x\n", ntohl(server->addr.s_addr));
 
-		ret = afs_rxfs_fetch_file_status(server,vnode,NULL);
+		ret = afs_rxfs_fetch_file_status(server, vnode, NULL);
 
-	} while (!afs_volume_release_fileserver(vnode->volume,server,ret));
+	} while (!afs_volume_release_fileserver(vnode->volume, server, ret));
 
 	/* adjust the flags */
-	afs_vnode_finalise_status_update(vnode,server,ret);
+	afs_vnode_finalise_status_update(vnode, server, ret);
 
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 } /* end afs_vnode_fetch_status() */
 
@@ -243,9 +255,10 @@
  * fetch file data from the volume
  * - TODO implement caching and server failover
  */
-int afs_vnode_fetch_data(afs_vnode_t *vnode, struct afs_rxfs_fetch_descriptor *desc)
+int afs_vnode_fetch_data(struct afs_vnode *vnode,
+			 struct afs_rxfs_fetch_descriptor *desc)
 {
-	afs_server_t *server;
+	struct afs_server *server;
 	int ret;
 
 	_enter("%s,{%u,%u,%u}",
@@ -259,23 +272,24 @@
 	vnode->update_cnt++;
 	spin_unlock(&vnode->lock);
 
-	/* merge in AFS status fetches and clear outstanding callback on this vnode */
+	/* merge in AFS status fetches and clear outstanding callback on this
+	 * vnode */
 	do {
 		/* pick a server to query */
-		ret = afs_volume_pick_fileserver(vnode->volume,&server);
-		if (ret<0)
+		ret = afs_volume_pick_fileserver(vnode->volume, &server);
+		if (ret < 0)
 			return ret;
 
-		_debug("USING SERVER: %08x\n",ntohl(server->addr.s_addr));
+		_debug("USING SERVER: %08x\n", ntohl(server->addr.s_addr));
 
-		ret = afs_rxfs_fetch_file_data(server,vnode,desc,NULL);
+		ret = afs_rxfs_fetch_file_data(server, vnode, desc, NULL);
 
-	} while (!afs_volume_release_fileserver(vnode->volume,server,ret));
+	} while (!afs_volume_release_fileserver(vnode->volume, server, ret));
 
 	/* adjust the flags */
-	afs_vnode_finalise_status_update(vnode,server,ret);
+	afs_vnode_finalise_status_update(vnode, server, ret);
 
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 
 } /* end afs_vnode_fetch_data() */
@@ -285,9 +299,9 @@
  * break any outstanding callback on a vnode
  * - only relevent to server that issued it
  */
-int afs_vnode_give_up_callback(afs_vnode_t *vnode)
+int afs_vnode_give_up_callback(struct afs_vnode *vnode)
 {
-	afs_server_t *server;
+	struct afs_server *server;
 	int ret;
 
 	_enter("%s,{%u,%u,%u}",
@@ -305,7 +319,7 @@
 
 	afs_kafstimod_del_timer(&vnode->cb_timeout);
 
-	server = xchg(&vnode->cb_server,NULL);
+	server = xchg(&vnode->cb_server, NULL);
 	if (server) {
 		vnode->flags |= AFS_VNODE_CHANGED;
 
@@ -318,11 +332,11 @@
 
 	ret = 0;
 	if (server) {
-		ret = afs_rxfs_give_up_callback(server,vnode);
+		ret = afs_rxfs_give_up_callback(server, vnode);
 		afs_put_server(server);
 	}
 
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 } /* end afs_vnode_give_up_callback() */
 
@@ -331,7 +345,8 @@
  * match a vnode record stored in the cache
  */
 #ifdef AFS_CACHING_SUPPORT
-static cachefs_match_val_t afs_vnode_cache_match(void *target, const void *entry)
+static cachefs_match_val_t afs_vnode_cache_match(void *target,
+						 const void *entry)
 {
 	const struct afs_cache_vnode *cvnode = entry;
 	struct afs_vnode *vnode = target;
diff -Nru a/fs/afs/vnode.h b/fs/afs/vnode.h
--- a/fs/afs/vnode.h	Tue Feb  3 19:45:16 2004
+++ b/fs/afs/vnode.h	Tue Feb  3 19:45:16 2004
@@ -70,21 +70,22 @@
 	afs_callback_type_t	cb_type;	/* type of callback */
 };
 
-static inline afs_vnode_t *AFS_FS_I(struct inode *inode)
+static inline struct afs_vnode *AFS_FS_I(struct inode *inode)
 {
-	return container_of(inode,afs_vnode_t,vfs_inode);
+	return container_of(inode,struct afs_vnode,vfs_inode);
 }
 
-static inline struct inode *AFS_VNODE_TO_I(afs_vnode_t *vnode)
+static inline struct inode *AFS_VNODE_TO_I(struct afs_vnode *vnode)
 {
 	return &vnode->vfs_inode;
 }
 
-extern int afs_vnode_fetch_status(afs_vnode_t *vnode);
+extern int afs_vnode_fetch_status(struct afs_vnode *vnode);
 
-extern int afs_vnode_fetch_data(afs_vnode_t *vnode, struct afs_rxfs_fetch_descriptor *desc);
+extern int afs_vnode_fetch_data(struct afs_vnode *vnode,
+				struct afs_rxfs_fetch_descriptor *desc);
 
-extern int afs_vnode_give_up_callback(afs_vnode_t *vnode);
+extern int afs_vnode_give_up_callback(struct afs_vnode *vnode);
 
 extern struct afs_timer_ops afs_vnode_cb_timed_out_ops;
 
diff -Nru a/fs/afs/volume.c b/fs/afs/volume.c
--- a/fs/afs/volume.c	Tue Feb  3 19:45:16 2004
+++ b/fs/afs/volume.c	Tue Feb  3 19:45:16 2004
@@ -27,7 +27,8 @@
 const char *afs_voltypes[] = { "R/W", "R/O", "BAK" };
 
 #ifdef AFS_CACHING_SUPPORT
-static cachefs_match_val_t afs_volume_cache_match(void *target, const void *entry);
+static cachefs_match_val_t afs_volume_cache_match(void *target,
+						  const void *entry);
 static void afs_volume_cache_update(void *source, void *entry);
 
 struct cachefs_index_def afs_volume_cache_index_def = {
@@ -45,7 +46,8 @@
  * lookup a volume by name
  * - this can be one of the following:
  *	"%[cell:]volume[.]"		R/W volume
- *	"#[cell:]volume[.]"		R/O or R/W volume (rwparent=0), or R/W (rwparent=1) volume
+ *	"#[cell:]volume[.]"		R/O or R/W volume (rwparent=0),
+ *					 or R/W (rwparent=1) volume
  *	"%[cell:]volume.readonly"	R/O volume
  *	"#[cell:]volume.readonly"	R/O volume
  *	"%[cell:]volume.backup"		Backup volume
@@ -53,14 +55,17 @@
  *
  * The cell name is optional, and defaults to the current cell.
  *
- * See "The Rules of Mount Point Traversal" in Chapter 5 of the AFS SysAdmin Guide
+ * See "The Rules of Mount Point Traversal" in Chapter 5 of the AFS SysAdmin
+ * Guide
  * - Rule 1: Explicit type suffix forces access of that type or nothing
  *           (no suffix, then use Rule 2 & 3)
- * - Rule 2: If parent volume is R/O, then mount R/O volume by preference, R/W if not available
- * - Rule 3: If parent volume is R/W, then only mount R/W volume unless explicitly told otherwise
+ * - Rule 2: If parent volume is R/O, then mount R/O volume by preference, R/W
+ *           if not available
+ * - Rule 3: If parent volume is R/W, then only mount R/W volume unless
+ *           explicitly told otherwise
  */
 int afs_volume_lookup(const char *name, struct afs_cell *cell, int rwpath,
-		      afs_volume_t **_volume)
+		      struct afs_volume **_volume)
 {
 	struct afs_vlocation *vlocation = NULL;
 	struct afs_volume *volume = NULL;
@@ -108,6 +113,7 @@
 	if (volname) {
 		cellname = name;
 		cellnamesz = volname - name;
+		volname++;
 	}
 	else {
 		volname = name;
@@ -127,7 +133,8 @@
 	if (cellname || !cell) {
 		ret = afs_cell_lookup(cellname, cellnamesz, &cell);
 		if (ret<0) {
-			printk("kAFS: unable to lookup cell '%s'\n", cellname ?: "");
+			printk("kAFS: unable to lookup cell '%s'\n",
+			       cellname ?: "");
 			goto error;
 		}
 	}
@@ -146,7 +153,7 @@
 		goto error;
 
 	srvtmask = 0;
-	for (loop=0; loop<vlocation->vldb.nservers; loop++)
+	for (loop = 0; loop < vlocation->vldb.nservers; loop++)
 		srvtmask |= vlocation->vldb.srvtmask[loop];
 
 	if (force) {
@@ -177,11 +184,11 @@
 	_debug("creating new volume record");
 
 	ret = -ENOMEM;
-	volume = kmalloc(sizeof(afs_volume_t), GFP_KERNEL);
+	volume = kmalloc(sizeof(struct afs_volume), GFP_KERNEL);
 	if (!volume)
 		goto error_up;
 
-	memset(volume, 0, sizeof(afs_volume_t));
+	memset(volume, 0, sizeof(struct afs_volume));
 	atomic_set(&volume->usage, 1);
 	volume->type		= type;
 	volume->type_force	= force;
@@ -191,12 +198,13 @@
 	init_rwsem(&volume->server_sem);
 
 	/* look up all the applicable server records */
-	for (loop=0; loop<8; loop++) {
+	for (loop = 0; loop < 8; loop++) {
 		if (vlocation->vldb.srvtmask[loop] & (1 << volume->type)) {
-			ret = afs_server_lookup(volume->cell,
-						&vlocation->vldb.servers[loop],
-						&volume->servers[volume->nservers]);
-			if (ret<0)
+			ret = afs_server_lookup(
+				volume->cell,
+				&vlocation->vldb.servers[loop],
+				&volume->servers[volume->nservers]);
+			if (ret < 0)
 				goto error_discard;
 
 			volume->nservers++;
@@ -217,7 +225,8 @@
 	vlocation->vols[type] = volume;
 
  success:
-	_debug("kAFS selected %s volume %08x", afs_voltypes[volume->type], volume->vid);
+	_debug("kAFS selected %s volume %08x",
+	       afs_voltypes[volume->type], volume->vid);
 	*_volume = volume;
 	ret = 0;
 
@@ -234,7 +243,7 @@
  error_discard:
 	up_write(&cell->vl_sem);
 
-	for (loop=volume->nservers-1; loop>=0; loop--)
+	for (loop = volume->nservers - 1; loop >= 0; loop--)
 		afs_put_server(volume->servers[loop]);
 
 	kfree(volume);
@@ -245,23 +254,23 @@
 /*
  * destroy a volume record
  */
-void afs_put_volume(afs_volume_t *volume)
+void afs_put_volume(struct afs_volume *volume)
 {
-	afs_vlocation_t *vlocation;
+	struct afs_vlocation *vlocation;
 	int loop;
 
 	if (!volume)
 		return;
 
-	_enter("%p",volume);
+	_enter("%p", volume);
 
 	vlocation = volume->vlocation;
 
 	/* sanity check */
-	if (atomic_read(&volume->usage)<=0)
-		BUG();
+	BUG_ON(atomic_read(&volume->usage) <= 0);
 
-	/* to prevent a race, the decrement and the dequeue must be effectively atomic */
+	/* to prevent a race, the decrement and the dequeue must be effectively
+	 * atomic */
 	down_write(&vlocation->cell->vl_sem);
 
 	if (likely(!atomic_dec_and_test(&volume->usage))) {
@@ -276,11 +285,11 @@
 
 	/* finish cleaning up the volume */
 #ifdef AFS_CACHING_SUPPORT
-	cachefs_relinquish_cookie(volume->cache,0);
+	cachefs_relinquish_cookie(volume->cache, 0);
 #endif
 	afs_put_vlocation(vlocation);
 
-	for (loop=volume->nservers-1; loop>=0; loop--)
+	for (loop = volume->nservers - 1; loop >= 0; loop--)
 		afs_put_server(volume->servers[loop]);
 
 	kfree(volume);
@@ -293,26 +302,28 @@
  * pick a server to use to try accessing this volume
  * - returns with an elevated usage count on the server chosen
  */
-int afs_volume_pick_fileserver(afs_volume_t *volume, afs_server_t **_server)
+int afs_volume_pick_fileserver(struct afs_volume *volume,
+			       struct afs_server **_server)
 {
-	afs_server_t *server;
+	struct afs_server *server;
 	int ret, state, loop;
 
-	_enter("%s",volume->vlocation->vldb.name);
+	_enter("%s", volume->vlocation->vldb.name);
 
 	down_read(&volume->server_sem);
 
 	/* handle the no-server case */
-	if (volume->nservers==0) {
+	if (volume->nservers == 0) {
 		ret = volume->rjservers ? -ENOMEDIUM : -ESTALE;
 		up_read(&volume->server_sem);
-		_leave(" = %d [no servers]",ret);
+		_leave(" = %d [no servers]", ret);
 		return ret;
 	}
 
-	/* basically, just search the list for the first live server and use that */
+	/* basically, just search the list for the first live server and use
+	 * that */
 	ret = 0;
-	for (loop=0; loop<volume->nservers; loop++) {
+	for (loop = 0; loop < volume->nservers; loop++) {
 		server = volume->servers[loop];
 		state = server->fs_state;
 
@@ -322,30 +333,34 @@
 			afs_get_server(server);
 			up_read(&volume->server_sem);
 			*_server = server;
-			_leave(" = 0 (picked %08x)",ntohl(server->addr.s_addr));
+			_leave(" = 0 (picked %08x)",
+			       ntohl(server->addr.s_addr));
 			return 0;
 
 		case -ENETUNREACH:
-			if (ret==0)
+			if (ret == 0)
 				ret = state;
 			break;
 
 		case -EHOSTUNREACH:
-			if (ret==0 || ret==-ENETUNREACH)
+			if (ret == 0 ||
+			    ret == -ENETUNREACH)
 				ret = state;
 			break;
 
 		case -ECONNREFUSED:
-			if (ret==0 || ret==-ENETUNREACH || ret==-EHOSTUNREACH)
+			if (ret == 0 ||
+			    ret == -ENETUNREACH ||
+			    ret == -EHOSTUNREACH)
 				ret = state;
 			break;
 
 		default:
 		case -EREMOTEIO:
-			if (ret==0 ||
-			    ret==-ENETUNREACH ||
-			    ret==-EHOSTUNREACH ||
-			    ret==-ECONNREFUSED)
+			if (ret == 0 ||
+			    ret == -ENETUNREACH ||
+			    ret == -EHOSTUNREACH ||
+			    ret == -ECONNREFUSED)
 				ret = state;
 			break;
 		}
@@ -355,7 +370,7 @@
 	 * - TODO: handle the no active servers case better
 	 */
 	up_read(&volume->server_sem);
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 } /* end afs_volume_pick_fileserver() */
 
@@ -366,11 +381,15 @@
  * - records result of using a particular server to access a volume
  * - return 0 to try again, 1 if okay or to issue error
  */
-int afs_volume_release_fileserver(afs_volume_t *volume, afs_server_t *server, int result)
+int afs_volume_release_fileserver(struct afs_volume *volume,
+				  struct afs_server *server,
+				  int result)
 {
 	unsigned loop;
 
-	_enter("%s,%08x,%d",volume->vlocation->vldb.name,ntohl(server->addr.s_addr),result);
+	_enter("%s,%08x,%d",
+	       volume->vlocation->vldb.name, ntohl(server->addr.s_addr),
+	       result);
 
 	switch (result) {
 		/* success */
@@ -383,9 +402,10 @@
 		server->fs_act_jif = jiffies;
 		down_write(&volume->server_sem);
 
-		/* first, find where the server is in the active list (if it is) */
-		for (loop=0; loop<volume->nservers; loop++)
-			if (volume->servers[loop]==server)
+		/* first, find where the server is in the active list (if it
+		 * is) */
+		for (loop = 0; loop < volume->nservers; loop++)
+			if (volume->servers[loop] == server)
 				goto present;
 
 		/* no longer there - may have been discarded by another op */
@@ -394,20 +414,22 @@
 	present:
 		volume->nservers--;
 		memmove(&volume->servers[loop],
-			&volume->servers[loop+1],
-			sizeof(volume->servers[loop]) * (volume->nservers - loop)
-			);
+			&volume->servers[loop + 1],
+			sizeof(volume->servers[loop]) *
+			(volume->nservers - loop));
 		volume->servers[volume->nservers] = NULL;
 		afs_put_server(server);
 		volume->rjservers++;
 
-		if (volume->nservers>0)
+		if (volume->nservers > 0)
 			/* another server might acknowledge its existence */
 			goto try_next_server_upw;
 
-		/* handle the case where all the fileservers have rejected the volume
+		/* handle the case where all the fileservers have rejected the
+		 * volume
 		 * - TODO: try asking the fileservers for volume information
-		 * - TODO: contact the VL server again to see if the volume is no longer registered
+		 * - TODO: contact the VL server again to see if the volume is
+		 *         no longer registered
 		 */
 		up_write(&volume->server_sem);
 		afs_put_server(server);
@@ -427,7 +449,7 @@
 		if (!server->fs_state) {
 			server->fs_dead_jif = jiffies + HZ * 10;
 			server->fs_state = result;
-			printk("kAFS: SERVER DEAD state=%d\n",result);
+			printk("kAFS: SERVER DEAD state=%d\n", result);
 		}
 		spin_unlock(&server->fs_lock);
 		goto try_next_server;
@@ -460,7 +482,8 @@
  * match a volume hash record stored in the cache
  */
 #ifdef AFS_CACHING_SUPPORT
-static cachefs_match_val_t afs_volume_cache_match(void *target, const void *entry)
+static cachefs_match_val_t afs_volume_cache_match(void *target,
+						  const void *entry)
 {
 	const struct afs_cache_vhash *vhash = entry;
 	struct afs_volume *volume = target;
diff -Nru a/fs/binfmt_elf.c b/fs/binfmt_elf.c
--- a/fs/binfmt_elf.c	Tue Feb  3 19:45:17 2004
+++ b/fs/binfmt_elf.c	Tue Feb  3 19:45:17 2004
@@ -349,6 +349,7 @@
 	    	elf_type |= MAP_FIXED;
 
 	    map_addr = elf_map(interpreter, load_addr + vaddr, eppnt, elf_prot, elf_type);
+	    error = map_addr;
 	    if (BAD_ADDR(map_addr))
 	    	goto out_close;
 
@@ -863,7 +864,8 @@
 	/* error cleanup */
 out_free_dentry:
 	allow_write_access(interpreter);
-	fput(interpreter);
+	if (interpreter)
+		fput(interpreter);
 out_free_interp:
 	if (elf_interpreter)
 		kfree(elf_interpreter);
diff -Nru a/fs/bio.c b/fs/bio.c
--- a/fs/bio.c	Tue Feb  3 19:45:30 2004
+++ b/fs/bio.c	Tue Feb  3 19:45:30 2004
@@ -290,7 +290,9 @@
  *
  *	Attempt to add a page to the bio_vec maplist. This can fail for a
  *	number of reasons, such as the bio being full or target block
- *	device limitations.
+ *	device limitations. The target block device must allow bio's
+ *      smaller than PAGE_SIZE, so it is always possible to add a single
+ *      page to an empty bio.
  */
 int bio_add_page(struct bio *bio, struct page *page, unsigned int len,
 		 unsigned int offset)
@@ -592,7 +594,7 @@
 
 static DECLARE_WORK(bio_dirty_work, bio_dirty_fn, NULL);
 static spinlock_t bio_dirty_lock = SPIN_LOCK_UNLOCKED;
-static struct bio *bio_dirty_list = NULL;
+static struct bio *bio_dirty_list;
 
 /*
  * This runs in process context
diff -Nru a/fs/block_dev.c b/fs/block_dev.c
--- a/fs/block_dev.c	Tue Feb  3 19:45:43 2004
+++ b/fs/block_dev.c	Tue Feb  3 19:45:43 2004
@@ -25,6 +25,22 @@
 #include <linux/namei.h>
 #include <asm/uaccess.h>
 
+struct bdev_inode {
+	struct block_device bdev;
+	struct inode vfs_inode;
+};
+
+static inline struct bdev_inode *BDEV_I(struct inode *inode)
+{
+	return container_of(inode, struct bdev_inode, vfs_inode);
+}
+
+inline struct block_device *I_BDEV(struct inode *inode)
+{
+	return &BDEV_I(inode)->bdev;
+}
+
+EXPORT_SYMBOL(I_BDEV);
 
 static sector_t max_block(struct block_device *bdev)
 {
@@ -100,10 +116,10 @@
 blkdev_get_block(struct inode *inode, sector_t iblock,
 		struct buffer_head *bh, int create)
 {
-	if (iblock >= max_block(inode->i_bdev))
+	if (iblock >= max_block(I_BDEV(inode)))
 		return -EIO;
 
-	bh->b_bdev = inode->i_bdev;
+	bh->b_bdev = I_BDEV(inode);
 	bh->b_blocknr = iblock;
 	set_buffer_mapped(bh);
 	return 0;
@@ -113,10 +129,10 @@
 blkdev_get_blocks(struct inode *inode, sector_t iblock,
 		unsigned long max_blocks, struct buffer_head *bh, int create)
 {
-	if ((iblock + max_blocks) > max_block(inode->i_bdev))
+	if ((iblock + max_blocks) > max_block(I_BDEV(inode)))
 		return -EIO;
 
-	bh->b_bdev = inode->i_bdev;
+	bh->b_bdev = I_BDEV(inode);
 	bh->b_blocknr = iblock;
 	bh->b_size = max_blocks << inode->i_blkbits;
 	set_buffer_mapped(bh);
@@ -128,9 +144,9 @@
 			loff_t offset, unsigned long nr_segs)
 {
 	struct file *file = iocb->ki_filp;
-	struct inode *inode = file->f_dentry->d_inode->i_mapping->host;
+	struct inode *inode = file->f_mapping->host;
 
-	return blockdev_direct_IO(rw, iocb, inode, inode->i_bdev, iov, offset,
+	return blockdev_direct_IO(rw, iocb, inode, I_BDEV(inode), iov, offset,
 				nr_segs, blkdev_get_blocks, NULL);
 }
 
@@ -161,11 +177,10 @@
  */
 static loff_t block_llseek(struct file *file, loff_t offset, int origin)
 {
-	struct inode *bd_inode;
+	struct inode *bd_inode = file->f_mapping->host;
 	loff_t size;
 	loff_t retval;
 
-	bd_inode = file->f_dentry->d_inode->i_bdev->bd_inode;
 	down(&bd_inode->i_sem);
 	size = i_size_read(bd_inode);
 
@@ -188,15 +203,13 @@
 }
 	
 /*
- *	Filp may be NULL when we are called by an msync of a vma
- *	since the vma has no handle.
+ *	Filp is never NULL; the only case when ->fsync() is called with
+ *	NULL first argument is nfsd_sync_dir() and that's not a directory.
  */
  
 static int block_fsync(struct file *filp, struct dentry *dentry, int datasync)
 {
-	struct inode * inode = dentry->d_inode;
-
-	return sync_blockdev(inode->i_bdev);
+	return sync_blockdev(I_BDEV(filp->f_mapping->host));
 }
 
 /*
@@ -206,16 +219,6 @@
 static spinlock_t bdev_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 static kmem_cache_t * bdev_cachep;
 
-struct bdev_inode {
-	struct block_device bdev;
-	struct inode vfs_inode;
-};
-
-static inline struct bdev_inode *BDEV_I(struct inode *inode)
-{
-	return container_of(inode, struct bdev_inode, vfs_inode);
-}
-
 static struct inode *bdev_alloc_inode(struct super_block *sb)
 {
 	struct bdev_inode *ei = kmem_cache_alloc(bdev_cachep, SLAB_KERNEL);
@@ -387,26 +390,27 @@
 
 EXPORT_SYMBOL(bdput);
  
-int bd_acquire(struct inode *inode)
+static struct block_device *bd_acquire(struct inode *inode)
 {
 	struct block_device *bdev;
 	spin_lock(&bdev_lock);
-	if (inode->i_bdev && igrab(inode->i_bdev->bd_inode)) {
+	bdev = inode->i_bdev;
+	if (bdev && igrab(bdev->bd_inode)) {
 		spin_unlock(&bdev_lock);
-		return 0;
+		return bdev;
 	}
 	spin_unlock(&bdev_lock);
 	bdev = bdget(inode->i_rdev);
-	if (!bdev)
-		return -ENOMEM;
-	spin_lock(&bdev_lock);
-	if (inode->i_bdev)
-		__bd_forget(inode);
-	inode->i_bdev = bdev;
-	inode->i_mapping = bdev->bd_inode->i_mapping;
-	list_add(&inode->i_devices, &bdev->bd_inodes);
-	spin_unlock(&bdev_lock);
-	return 0;
+	if (bdev) {
+		spin_lock(&bdev_lock);
+		if (inode->i_bdev)
+			__bd_forget(inode);
+		inode->i_bdev = bdev;
+		inode->i_mapping = bdev->bd_inode->i_mapping;
+		list_add(&inode->i_devices, &bdev->bd_inodes);
+		spin_unlock(&bdev_lock);
+	}
+	return bdev;
 }
 
 /* Call when you free inode */
@@ -531,13 +535,14 @@
 	bdev->bd_inode->i_blkbits = blksize_bits(bsize);
 }
 
-static int do_open(struct block_device *bdev, struct inode *inode, struct file *file)
+static int do_open(struct block_device *bdev, struct file *file)
 {
 	struct module *owner = NULL;
 	struct gendisk *disk;
 	int ret = -ENXIO;
 	int part;
 
+	file->f_mapping = bdev->bd_inode->i_mapping;
 	lock_kernel();
 	disk = get_gendisk(bdev->bd_dev, &part);
 	if (!disk) {
@@ -554,7 +559,7 @@
 		if (!part) {
 			struct backing_dev_info *bdi;
 			if (disk->fops->open) {
-				ret = disk->fops->open(inode, file);
+				ret = disk->fops->open(bdev->bd_inode, file);
 				if (ret)
 					goto out_first;
 			}
@@ -599,7 +604,7 @@
 		module_put(owner);
 		if (bdev->bd_contains == bdev) {
 			if (bdev->bd_disk->fops->open) {
-				ret = bdev->bd_disk->fops->open(inode, file);
+				ret = bdev->bd_disk->fops->open(bdev->bd_inode, file);
 				if (ret)
 					goto out;
 			}
@@ -647,7 +652,7 @@
 	fake_file.f_dentry = &fake_dentry;
 	fake_dentry.d_inode = bdev->bd_inode;
 
-	return do_open(bdev, bdev->bd_inode, &fake_file);
+	return do_open(bdev, &fake_file);
 }
 
 EXPORT_SYMBOL(blkdev_get);
@@ -665,10 +670,9 @@
 	 */
 	filp->f_flags |= O_LARGEFILE;
 
-	bd_acquire(inode);
-	bdev = inode->i_bdev;
+	bdev = bd_acquire(inode);
 
-	res = do_open(bdev, inode, filp);
+	res = do_open(bdev, filp);
 	if (res)
 		return res;
 
@@ -696,7 +700,7 @@
 		switch (kind) {
 		case BDEV_FILE:
 		case BDEV_FS:
-			sync_blockdev(bd_inode->i_bdev);
+			sync_blockdev(bdev);
 			break;
 		}
 		kill_bdev(bdev);
@@ -734,11 +738,12 @@
 
 EXPORT_SYMBOL(blkdev_put);
 
-int blkdev_close(struct inode * inode, struct file * filp)
+static int blkdev_close(struct inode * inode, struct file * filp)
 {
-	if (inode->i_bdev->bd_holder == filp)
-		bd_release(inode->i_bdev);
-	return blkdev_put(inode->i_bdev, BDEV_FILE);
+	struct block_device *bdev = I_BDEV(filp->f_mapping->host);
+	if (bdev->bd_holder == filp)
+		bd_release(bdev);
+	return blkdev_put(bdev, BDEV_FILE);
 }
 
 static ssize_t blkdev_file_write(struct file *file, const char __user *buf,
@@ -757,6 +762,11 @@
 	return generic_file_aio_write_nolock(iocb, &local_iov, 1, &iocb->ki_pos);
 }
 
+static int block_ioctl(struct inode *inode, struct file *file, unsigned cmd,
+			unsigned long arg)
+{
+	return blkdev_ioctl(file->f_mapping->host, file, cmd, arg);
+}
 
 struct address_space_operations def_blk_aops = {
 	.readpage	= blkdev_readpage,
@@ -778,7 +788,7 @@
   	.aio_write	= blkdev_file_aio_write, 
 	.mmap		= generic_file_mmap,
 	.fsync		= block_fsync,
-	.ioctl		= blkdev_ioctl,
+	.ioctl		= block_ioctl,
 	.readv		= generic_file_readv,
 	.writev		= generic_file_writev,
 	.sendfile	= generic_file_sendfile,
@@ -828,11 +838,10 @@
 	error = -EACCES;
 	if (nd.mnt->mnt_flags & MNT_NODEV)
 		goto fail;
-	error = bd_acquire(inode);
-	if (error)
+	error = -ENOMEM;
+	bdev = bd_acquire(inode);
+	if (!bdev)
 		goto fail;
-	bdev = inode->i_bdev;
-
 out:
 	path_release(&nd);
 	return bdev;
diff -Nru a/fs/buffer.c b/fs/buffer.c
--- a/fs/buffer.c	Tue Feb  3 19:45:29 2004
+++ b/fs/buffer.c	Tue Feb  3 19:45:29 2004
@@ -189,9 +189,12 @@
 	if (uptodate) {
 		set_buffer_uptodate(bh);
 	} else {
-		buffer_io_error(bh);
-		printk(KERN_WARNING "lost page write due to I/O error on %s\n",
-		       bdevname(bh->b_bdev, b));
+		if (printk_ratelimit()) {
+			buffer_io_error(bh);
+			printk(KERN_WARNING "lost page write due to "
+					"I/O error on %s\n",
+				       bdevname(bh->b_bdev, b));
+		}
 		set_buffer_write_io_error(bh);
 		clear_buffer_uptodate(bh);
 	}
@@ -314,8 +317,7 @@
 asmlinkage long sys_fsync(unsigned int fd)
 {
 	struct file * file;
-	struct dentry * dentry;
-	struct inode * inode;
+	struct address_space *mapping;
 	int ret, err;
 
 	ret = -EBADF;
@@ -323,8 +325,7 @@
 	if (!file)
 		goto out;
 
-	dentry = file->f_dentry;
-	inode = dentry->d_inode;
+	mapping = file->f_mapping;
 
 	ret = -EINVAL;
 	if (!file->f_op || !file->f_op->fsync) {
@@ -333,17 +334,17 @@
 	}
 
 	/* We need to protect against concurrent writers.. */
-	down(&inode->i_sem);
+	down(&mapping->host->i_sem);
 	current->flags |= PF_SYNCWRITE;
-	ret = filemap_fdatawrite(inode->i_mapping);
-	err = file->f_op->fsync(file, dentry, 0);
+	ret = filemap_fdatawrite(mapping);
+	err = file->f_op->fsync(file, file->f_dentry, 0);
 	if (!ret)
 		ret = err;
-	err = filemap_fdatawait(inode->i_mapping);
+	err = filemap_fdatawait(mapping);
 	if (!ret)
 		ret = err;
 	current->flags &= ~PF_SYNCWRITE;
-	up(&inode->i_sem);
+	up(&mapping->host->i_sem);
 
 out_putf:
 	fput(file);
@@ -354,8 +355,7 @@
 asmlinkage long sys_fdatasync(unsigned int fd)
 {
 	struct file * file;
-	struct dentry * dentry;
-	struct inode * inode;
+	struct address_space *mapping;
 	int ret, err;
 
 	ret = -EBADF;
@@ -363,24 +363,23 @@
 	if (!file)
 		goto out;
 
-	dentry = file->f_dentry;
-	inode = dentry->d_inode;
-
 	ret = -EINVAL;
 	if (!file->f_op || !file->f_op->fsync)
 		goto out_putf;
 
-	down(&inode->i_sem);
+	mapping = file->f_mapping;
+
+	down(&mapping->host->i_sem);
 	current->flags |= PF_SYNCWRITE;
-	ret = filemap_fdatawrite(inode->i_mapping);
-	err = file->f_op->fsync(file, dentry, 1);
+	ret = filemap_fdatawrite(mapping);
+	err = file->f_op->fsync(file, file->f_dentry, 1);
 	if (!ret)
 		ret = err;
-	err = filemap_fdatawait(inode->i_mapping);
+	err = filemap_fdatawait(mapping);
 	if (!ret)
 		ret = err;
 	current->flags &= ~PF_SYNCWRITE;
-	up(&inode->i_sem);
+	up(&mapping->host->i_sem);
 
 out_putf:
 	fput(file);
@@ -487,7 +486,7 @@
  */
 static void free_more_memory(void)
 {
-	struct zone *zone;
+	struct zone **zones;
 	pg_data_t *pgdat;
 
 	wakeup_bdflush(1024);
@@ -495,9 +494,9 @@
 	yield();
 
 	for_each_pgdat(pgdat) {
-		zone = pgdat->node_zonelists[GFP_NOFS&GFP_ZONEMASK].zones[0];
-		if (zone)
-			try_to_free_pages(zone, GFP_NOFS, 0);
+		zones = pgdat->node_zonelists[GFP_NOFS&GFP_ZONEMASK].zones;
+		if (*zones)
+			try_to_free_pages(zones, GFP_NOFS, 0);
 	}
 }
 
@@ -576,9 +575,12 @@
 	if (uptodate) {
 		set_buffer_uptodate(bh);
 	} else {
-		buffer_io_error(bh);
-		printk(KERN_WARNING "lost page write due to I/O error on %s\n",
-		       bdevname(bh->b_bdev, b));
+		if (printk_ratelimit()) {
+			buffer_io_error(bh);
+			printk(KERN_WARNING "lost page write due to "
+					"I/O error on %s\n",
+			       bdevname(bh->b_bdev, b));
+		}
 		set_bit(AS_EIO, &page->mapping->flags);
 		clear_buffer_uptodate(bh);
 		SetPageError(page);
@@ -2944,10 +2946,8 @@
 	if (__get_cpu_var(bh_accounting).ratelimit++ < 4096)
 		return;
 	__get_cpu_var(bh_accounting).ratelimit = 0;
-	for (i = 0; i < NR_CPUS; i++) {
-		if (cpu_online(i))
-			tot += per_cpu(bh_accounting, i).nr;
-	}
+	for_each_cpu(i)
+		tot += per_cpu(bh_accounting, i).nr;
 	buffer_heads_over_limit = (tot > max_buffer_heads);
 }
 	
diff -Nru a/fs/coda/file.c b/fs/coda/file.c
--- a/fs/coda/file.c	Tue Feb  3 19:45:17 2004
+++ b/fs/coda/file.c	Tue Feb  3 19:45:17 2004
@@ -89,6 +89,7 @@
 
 	coda_inode = coda_file->f_dentry->d_inode;
 	host_inode = host_file->f_dentry->d_inode;
+	coda_file->f_mapping = host_file->f_mapping;
 	if (coda_inode->i_mapping == &coda_inode->i_data)
 		coda_inode->i_mapping = host_inode->i_mapping;
 
diff -Nru a/fs/compat_ioctl.c b/fs/compat_ioctl.c
--- a/fs/compat_ioctl.c	Tue Feb  3 19:45:42 2004
+++ b/fs/compat_ioctl.c	Tue Feb  3 19:45:42 2004
@@ -65,6 +65,7 @@
 #include <linux/ncp_fs.h>
 #include <linux/i2c.h>
 #include <linux/i2c-dev.h>
+#include <linux/wireless.h>
 
 #include <net/sock.h>          /* siocdevprivate_ioctl */
 #include <net/bluetooth/bluetooth.h>
@@ -161,9 +162,9 @@
 	case EXT2_IOC32_GETVERSION: cmd = EXT2_IOC_GETVERSION; break;
 	case EXT2_IOC32_SETVERSION: cmd = EXT2_IOC_SETVERSION; break;
 	}
-	return sys_ioctl(fd, cmd, arg);
+	return sys_ioctl(fd, cmd, (unsigned long)compat_ptr(arg));
 }
- 
+
 struct video_tuner32 {
 	compat_int_t tuner;
 	char name[32];
@@ -215,7 +216,7 @@
 
 	if(get_user(tmp, &up->base))
 		return -EFAULT;
-	kp->base = (void *) ((unsigned long)tmp);
+	kp->base = compat_ptr(tmp);
 	__get_user(kp->height, &up->height);
 	__get_user(kp->width, &up->width);
 	__get_user(kp->depth, &up->depth);
@@ -339,7 +340,7 @@
 		unsigned long vx;
 	} karg;
 	mm_segment_t old_fs = get_fs();
-	void *up = (void *)arg;
+	void *up = compat_ptr(arg);
 	int err = 0;
 
 	/* First, convert the command. */
@@ -407,7 +408,7 @@
 
 static int do_siocgstamp(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct compat_timeval *up = (struct compat_timeval *)arg;
+	struct compat_timeval *up = compat_ptr(arg);
 	struct timeval ktv;
 	mm_segment_t old_fs = get_fs();
 	int err;
@@ -466,7 +467,7 @@
 	struct ifreq32 ifr32;
 	int err;
 
-	if (copy_from_user(&ifr32, (struct ifreq32 *)arg, sizeof(struct ifreq32)))
+	if (copy_from_user(&ifr32, compat_ptr(arg), sizeof(ifr32)))
 		return -EFAULT;
 
 	dev = dev_get_by_index(ifr32.ifr_ifindex);
@@ -476,7 +477,7 @@
 	strlcpy(ifr32.ifr_name, dev->name, sizeof(ifr32.ifr_name));
 	dev_put(dev);
 	
-	err = copy_to_user((struct ifreq32 *)arg, &ifr32, sizeof(struct ifreq32));
+	err = copy_to_user(compat_ptr(arg), &ifr32, sizeof(ifr32));
 	return (err ? -EFAULT : 0);
 }
 #endif
@@ -491,7 +492,7 @@
 	unsigned int i, j;
 	int err;
 
-	if (copy_from_user(&ifc32, (struct ifconf32 *)arg, sizeof(struct ifconf32)))
+	if (copy_from_user(&ifc32, compat_ptr(arg), sizeof(struct ifconf32)))
 		return -EFAULT;
 
 	if(ifc32.ifcbuf == 0) {
@@ -501,6 +502,7 @@
 	} else {
 		ifc.ifc_len = ((ifc32.ifc_len / sizeof (struct ifreq32)) + 1) *
 			sizeof (struct ifreq);
+		/* should the size be limited? -arnd */
 		ifc.ifc_buf = kmalloc (ifc.ifc_len, GFP_KERNEL);
 		if (!ifc.ifc_buf)
 			return -ENOMEM;
@@ -546,7 +548,7 @@
 				else
 					ifc32.ifc_len = i - sizeof (struct ifreq32);
 			}
-			if (copy_to_user((struct ifconf32 *)arg, &ifc32, sizeof(struct ifconf32)))
+			if (copy_to_user(compat_ptr(arg), &ifc32, sizeof(struct ifconf32)))
 				err = -EFAULT;
 		}
 	}
@@ -563,7 +565,7 @@
 	void *datap;
 	
 	ifr = compat_alloc_user_space(sizeof(*ifr));
-	ifr32 = (struct ifreq32 *) arg;
+	ifr32 = compat_ptr(arg);
 
 	if (copy_in_user(&ifr->ifr_name, &ifr32->ifr_name, IFNAMSIZ))
 		return -EFAULT;
@@ -571,18 +573,18 @@
 	if (get_user(data, &ifr32->ifr_ifru.ifru_data))
 		return -EFAULT;
 
-	datap = (void *) (unsigned long) data;
+	datap = compat_ptr(data);
 	if (put_user(datap, &ifr->ifr_ifru.ifru_data))
 		return -EFAULT;
 
 	return sys_ioctl(fd, cmd, (unsigned long) ifr);
 }
 
-static int bond_ioctl(unsigned long fd, unsigned int cmd, unsigned long arg)
+static int bond_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	struct ifreq kifr;
 	struct ifreq *uifr;
-	struct ifreq32 *ifr32 = (struct ifreq32 *) arg;
+	struct ifreq32 *ifr32 = compat_ptr(arg);
 	mm_segment_t old_fs;
 	int err;
 	u32 data;
@@ -624,7 +626,7 @@
 int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	struct ifreq *u_ifreq64;
-	struct ifreq32 *u_ifreq32 = (struct ifreq32 *) arg;
+	struct ifreq32 *u_ifreq32 = compat_ptr(arg);
 	char tmp_buf[IFNAMSIZ];
 	void *data64;
 	u32 data32;
@@ -650,23 +652,27 @@
 static int dev_ifsioc(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	struct ifreq ifr;
+	struct ifreq32 *uifr32;
+	struct ifmap32 *uifmap32;
 	mm_segment_t old_fs;
 	int err;
 	
+	uifr32 = compat_ptr(arg);
+	uifmap32 = &uifr32->ifr_ifru.ifru_map;
 	switch (cmd) {
 	case SIOCSIFMAP:
-		err = copy_from_user(&ifr, (struct ifreq32 *)arg, sizeof(ifr.ifr_name));
-		err |= __get_user(ifr.ifr_map.mem_start, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_map.mem_start));
-		err |= __get_user(ifr.ifr_map.mem_end, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_map.mem_end));
-		err |= __get_user(ifr.ifr_map.base_addr, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_map.base_addr));
-		err |= __get_user(ifr.ifr_map.irq, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_map.irq));
-		err |= __get_user(ifr.ifr_map.dma, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_map.dma));
-		err |= __get_user(ifr.ifr_map.port, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_map.port));
+		err = copy_from_user(&ifr, uifr32, sizeof(ifr.ifr_name));
+		err |= __get_user(ifr.ifr_map.mem_start, &uifmap32->mem_start);
+		err |= __get_user(ifr.ifr_map.mem_end, &uifmap32->mem_end);
+		err |= __get_user(ifr.ifr_map.base_addr, &uifmap32->base_addr);
+		err |= __get_user(ifr.ifr_map.irq, &uifmap32->irq);
+		err |= __get_user(ifr.ifr_map.dma, &uifmap32->dma);
+		err |= __get_user(ifr.ifr_map.port, &uifmap32->port);
 		if (err)
 			return -EFAULT;
 		break;
 	default:
-		if (copy_from_user(&ifr, (struct ifreq32 *)arg, sizeof(struct ifreq32)))
+		if (copy_from_user(&ifr, uifr32, sizeof(*uifr32)))
 			return -EFAULT;
 		break;
 	}
@@ -687,17 +693,17 @@
 		case SIOCGIFDSTADDR:
 		case SIOCGIFNETMASK:
 		case SIOCGIFTXQLEN:
-			if (copy_to_user((struct ifreq32 *)arg, &ifr, sizeof(struct ifreq32)))
+			if (copy_to_user(uifr32, &ifr, sizeof(*uifr32)))
 				return -EFAULT;
 			break;
 		case SIOCGIFMAP:
-			err = copy_to_user((struct ifreq32 *)arg, &ifr, sizeof(ifr.ifr_name));
-			err |= __put_user(ifr.ifr_map.mem_start, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_map.mem_start));
-			err |= __put_user(ifr.ifr_map.mem_end, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_map.mem_end));
-			err |= __put_user(ifr.ifr_map.base_addr, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_map.base_addr));
-			err |= __put_user(ifr.ifr_map.irq, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_map.irq));
-			err |= __put_user(ifr.ifr_map.dma, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_map.dma));
-			err |= __put_user(ifr.ifr_map.port, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_map.port));
+			err = copy_to_user(uifr32, &ifr, sizeof(ifr.ifr_name));
+			err |= __put_user(ifr.ifr_map.mem_start, &uifmap32->mem_start);
+			err |= __put_user(ifr.ifr_map.mem_end, &uifmap32->mem_end);
+			err |= __put_user(ifr.ifr_map.base_addr, &uifmap32->base_addr);
+			err |= __put_user(ifr.ifr_map.irq, &uifmap32->irq);
+			err |= __put_user(ifr.ifr_map.dma, &uifmap32->dma);
+			err |= __put_user(ifr.ifr_map.port, &uifmap32->port);
 			if (err)
 				err = -EFAULT;
 			break;
@@ -751,25 +757,28 @@
 	struct socket *mysock = sockfd_lookup(fd, &ret);
 
 	if (mysock && mysock->sk && mysock->sk->sk_family == AF_INET6) { /* ipv6 */
-		ret = copy_from_user (&r6.rtmsg_dst, &(((struct in6_rtmsg32 *)arg)->rtmsg_dst),
+		struct in6_rtmsg32 *ur6 = compat_ptr(arg);
+		ret = copy_from_user (&r6.rtmsg_dst, &(ur6->rtmsg_dst),
 			3 * sizeof(struct in6_addr));
-		ret |= __get_user (r6.rtmsg_type, &(((struct in6_rtmsg32 *)arg)->rtmsg_type));
-		ret |= __get_user (r6.rtmsg_dst_len, &(((struct in6_rtmsg32 *)arg)->rtmsg_dst_len));
-		ret |= __get_user (r6.rtmsg_src_len, &(((struct in6_rtmsg32 *)arg)->rtmsg_src_len));
-		ret |= __get_user (r6.rtmsg_metric, &(((struct in6_rtmsg32 *)arg)->rtmsg_metric));
-		ret |= __get_user (r6.rtmsg_info, &(((struct in6_rtmsg32 *)arg)->rtmsg_info));
-		ret |= __get_user (r6.rtmsg_flags, &(((struct in6_rtmsg32 *)arg)->rtmsg_flags));
-		ret |= __get_user (r6.rtmsg_ifindex, &(((struct in6_rtmsg32 *)arg)->rtmsg_ifindex));
+		ret |= __get_user (r6.rtmsg_type, &(ur6->rtmsg_type));
+		ret |= __get_user (r6.rtmsg_dst_len, &(ur6->rtmsg_dst_len));
+		ret |= __get_user (r6.rtmsg_src_len, &(ur6->rtmsg_src_len));
+		ret |= __get_user (r6.rtmsg_metric, &(ur6->rtmsg_metric));
+		ret |= __get_user (r6.rtmsg_info, &(ur6->rtmsg_info));
+		ret |= __get_user (r6.rtmsg_flags, &(ur6->rtmsg_flags));
+		ret |= __get_user (r6.rtmsg_ifindex, &(ur6->rtmsg_ifindex));
 		
 		r = (void *) &r6;
 	} else { /* ipv4 */
-		ret = copy_from_user (&r4.rt_dst, &(((struct rtentry32 *)arg)->rt_dst), 3 * sizeof(struct sockaddr));
-		ret |= __get_user (r4.rt_flags, &(((struct rtentry32 *)arg)->rt_flags));
-		ret |= __get_user (r4.rt_metric, &(((struct rtentry32 *)arg)->rt_metric));
-		ret |= __get_user (r4.rt_mtu, &(((struct rtentry32 *)arg)->rt_mtu));
-		ret |= __get_user (r4.rt_window, &(((struct rtentry32 *)arg)->rt_window));
-		ret |= __get_user (r4.rt_irtt, &(((struct rtentry32 *)arg)->rt_irtt));
-		ret |= __get_user (rtdev, &(((struct rtentry32 *)arg)->rt_dev));
+		struct rtentry32 *ur4 = compat_ptr(arg);
+		ret = copy_from_user (&r4.rt_dst, &(ur4->rt_dst),
+					3 * sizeof(struct sockaddr));
+		ret |= __get_user (r4.rt_flags, &(ur4->rt_flags));
+		ret |= __get_user (r4.rt_metric, &(ur4->rt_metric));
+		ret |= __get_user (r4.rt_mtu, &(ur4->rt_mtu));
+		ret |= __get_user (r4.rt_window, &(ur4->rt_window));
+		ret |= __get_user (r4.rt_irtt, &(ur4->rt_irtt));
+		ret |= __get_user (rtdev, &(ur4->rt_dev));
 		if (rtdev) {
 			ret |= copy_from_user (devname, compat_ptr(rtdev), 15);
 			r4.rt_dev = devname; devname[15] = 0;
@@ -783,7 +792,7 @@
 		return -EFAULT;
 
 	set_fs (KERNEL_DS);
-	ret = sys_ioctl (fd, cmd, (long) r);
+	ret = sys_ioctl (fd, cmd, (unsigned long) r);
 	set_fs (old_fs);
 
 	if (mysock)
@@ -803,14 +812,16 @@
 {
 	mm_segment_t old_fs = get_fs();
 	struct hd_geometry geo;
+	struct hd_geometry32 *ugeo;
 	int err;
 	
 	set_fs (KERNEL_DS);
 	err = sys_ioctl(fd, HDIO_GETGEO, (unsigned long)&geo);
 	set_fs (old_fs);
+	ugeo = compat_ptr(arg);
 	if (!err) {
-		err = copy_to_user ((struct hd_geometry32 *)arg, &geo, 4);
-		err |= __put_user (geo.start, &(((struct hd_geometry32 *)arg)->start));
+		err = copy_to_user (ugeo, &geo, 4);
+		err |= __put_user (geo.start, &ugeo->start);
 	}
 	return err ? -EFAULT : 0;
 }
@@ -848,7 +859,7 @@
 
 	if (get_user(data, ptr32))
 		return -EFAULT;
-	datap = (void *) (unsigned long) data;
+	datap = compat_ptr(data);
 	if (put_user(datap, ptr64))
 		return -EFAULT;
 	return 0;
@@ -861,7 +872,7 @@
 	int err;
 
 	cmap = compat_alloc_user_space(sizeof(*cmap));
-	cmap32 = (struct fb_cmap32 *) arg;
+	cmap32 = compat_ptr(arg);
 
 	if (copy_in_user(&cmap->start, &cmap32->start, 2 * sizeof(__u32)))
 		return -EFAULT;
@@ -921,7 +932,7 @@
 	struct fb_fix_screeninfo32 *fix32;
 	int err;
 
-	fix32 = (struct fb_fix_screeninfo32 *) arg;
+	fix32 = compat_ptr(arg);
 
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
@@ -975,7 +986,7 @@
 	set_fs(old_fs);
 
 	if(error == 0) {
-		uvp = (unsigned int *)arg;
+		uvp = compat_ptr(arg);
 		if(put_user(kval, uvp))
 			error = -EFAULT;
 	}
@@ -1025,12 +1036,12 @@
 
 		if (get_user(base, &iov32[i].iov_base) ||
 		    get_user(len, &iov32[i].iov_len) ||
-		    put_user((void *)(unsigned long)base, &iov[i].iov_base) ||
+		    put_user(compat_ptr(base), &iov[i].iov_base) ||
 		    put_user(len, &iov[i].iov_len))
 			return -EFAULT;
 	}
 
-	sgio->dxferp = iov;
+	sgio->dxferp = iov; /* FIXME: dereferencing user pointer? */
 	return 0;
 }
 
@@ -1043,7 +1054,7 @@
 	void *dxferp;
 	int err;
 
-	sgio32 = (sg_io_hdr32_t *) arg;
+	sgio32 = compat_ptr(arg);
 	if (get_user(iovec_count, &sgio32->iovec_count))
 		return -EFAULT;
 
@@ -1070,7 +1081,7 @@
 
 	if (get_user(data, &sgio32->dxferp))
 		return -EFAULT;
-	dxferp = (void *) (unsigned long) data;
+	dxferp = compat_ptr(data);
 	if (iovec_count) {
 		if (sg_build_iovec(sgio, dxferp, iovec_count))
 			return -EFAULT;
@@ -1084,11 +1095,11 @@
 
 		if (get_user(data, &sgio32->cmdp))
 			return -EFAULT;
-		cmdp = (unsigned char *) (unsigned long) data;
+		cmdp = compat_ptr(data);
 
 		if (get_user(data, &sgio32->sbp))
 			return -EFAULT;
-		sbp = (unsigned char *) (unsigned long) data;
+		sbp = compat_ptr(data);
 
 		if (put_user(cmdp, &sgio->cmdp) ||
 		    put_user(sbp, &sgio->sbp))
@@ -1101,7 +1112,7 @@
 
 	if (get_user(data, &sgio32->usr_ptr))
 		return -EFAULT;
-	if (put_user((void *)(unsigned long)data, &sgio->usr_ptr))
+	if (put_user(compat_ptr(data), &sgio->usr_ptr))
 		return -EFAULT;
 
 	if (copy_in_user(&sgio->status, &sgio32->status,
@@ -1140,7 +1151,7 @@
 
 static int ppp_sock_fprog_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct sock_fprog32 *u_fprog32 = (struct sock_fprog32 *) arg;
+	struct sock_fprog32 *u_fprog32 = compat_ptr(arg);
 	struct sock_fprog *u_fprog64 = compat_alloc_user_space(sizeof(struct sock_fprog));
 	void *fptr64;
 	u32 fptr32;
@@ -1185,7 +1196,7 @@
 	int err;
 
 	idle = compat_alloc_user_space(sizeof(*idle));
-	idle32 = (struct ppp_idle32 *) arg;
+	idle32 = compat_ptr(arg);
 
 	err = sys_ioctl(fd, PPPIOCGIDLE, (unsigned long) idle);
 
@@ -1207,12 +1218,12 @@
 	void *datap;
 
 	odata = compat_alloc_user_space(sizeof(*odata));
-	odata32 = (struct ppp_option_data32 *) arg;
+	odata32 = compat_ptr(arg);
 
 	if (get_user(data, &odata32->ptr))
 		return -EFAULT;
 
-	datap = (void *) (unsigned long) data;
+	datap = compat_ptr(data);
 	if (put_user(datap, &odata->ptr))
 		return -EFAULT;
 
@@ -1296,8 +1307,11 @@
 {
 	mm_segment_t old_fs = get_fs();
 	struct mtconfiginfo info;
+	struct mtconfiginfo32 *uinfo32;
 	struct mtget get;
+	struct mtget32 *umget32;
 	struct mtpos pos;
+	struct mtpos32 *upos32;
 	unsigned long kcmd;
 	void *karg;
 	int err = 0;
@@ -1318,15 +1332,17 @@
 	case MTIOCSETCONFIG32:
 		kcmd = MTIOCSETCONFIG;
 		karg = &info;
-		err = __get_user(info.mt_type, &((struct mtconfiginfo32 *)arg)->mt_type);
-		err |= __get_user(info.ifc_type, &((struct mtconfiginfo32 *)arg)->ifc_type);
-		err |= __get_user(info.irqnr, &((struct mtconfiginfo32 *)arg)->irqnr);
-		err |= __get_user(info.dmanr, &((struct mtconfiginfo32 *)arg)->dmanr);
-		err |= __get_user(info.port, &((struct mtconfiginfo32 *)arg)->port);
-		err |= __get_user(info.debug, &((struct mtconfiginfo32 *)arg)->debug);
-		err |= __copy_from_user((char *)&info.debug + sizeof(info.debug),
-				     (char *)&((struct mtconfiginfo32 *)arg)->debug
-				     + sizeof(((struct mtconfiginfo32 *)arg)->debug), sizeof(__u32));
+		uinfo32 = compat_ptr(arg);
+		err = __get_user(info.mt_type, &uinfo32->mt_type);
+		err |= __get_user(info.ifc_type, &uinfo32->ifc_type);
+		err |= __get_user(info.irqnr, &uinfo32->irqnr);
+		err |= __get_user(info.dmanr, &uinfo32->dmanr);
+		err |= __get_user(info.port, &uinfo32->port);
+		err |= __get_user(info.debug, &uinfo32->debug);
+		err |= __copy_from_user((char *)&info.debug
+				     + sizeof(info.debug),
+				     (char *)&uinfo32->debug
+				     + sizeof(uinfo32->debug), sizeof(__u32));
 		if (err)
 			return -EFAULT;
 		break;
@@ -1347,26 +1363,29 @@
 		return err;
 	switch (cmd) {
 	case MTIOCPOS32:
-		err = __put_user(pos.mt_blkno, &((struct mtpos32 *)arg)->mt_blkno);
+		upos32 = compat_ptr(arg);
+		err = __put_user(pos.mt_blkno, &upos32->mt_blkno);
 		break;
 	case MTIOCGET32:
-		err = __put_user(get.mt_type, &((struct mtget32 *)arg)->mt_type);
-		err |= __put_user(get.mt_resid, &((struct mtget32 *)arg)->mt_resid);
-		err |= __put_user(get.mt_dsreg, &((struct mtget32 *)arg)->mt_dsreg);
-		err |= __put_user(get.mt_gstat, &((struct mtget32 *)arg)->mt_gstat);
-		err |= __put_user(get.mt_erreg, &((struct mtget32 *)arg)->mt_erreg);
-		err |= __put_user(get.mt_fileno, &((struct mtget32 *)arg)->mt_fileno);
-		err |= __put_user(get.mt_blkno, &((struct mtget32 *)arg)->mt_blkno);
+		umget32 = compat_ptr(arg);
+		err = __put_user(get.mt_type, &umget32->mt_type);
+		err |= __put_user(get.mt_resid, &umget32->mt_resid);
+		err |= __put_user(get.mt_dsreg, &umget32->mt_dsreg);
+		err |= __put_user(get.mt_gstat, &umget32->mt_gstat);
+		err |= __put_user(get.mt_erreg, &umget32->mt_erreg);
+		err |= __put_user(get.mt_fileno, &umget32->mt_fileno);
+		err |= __put_user(get.mt_blkno, &umget32->mt_blkno);
 		break;
 	case MTIOCGETCONFIG32:
-		err = __put_user(info.mt_type, &((struct mtconfiginfo32 *)arg)->mt_type);
-		err |= __put_user(info.ifc_type, &((struct mtconfiginfo32 *)arg)->ifc_type);
-		err |= __put_user(info.irqnr, &((struct mtconfiginfo32 *)arg)->irqnr);
-		err |= __put_user(info.dmanr, &((struct mtconfiginfo32 *)arg)->dmanr);
-		err |= __put_user(info.port, &((struct mtconfiginfo32 *)arg)->port);
-		err |= __put_user(info.debug, &((struct mtconfiginfo32 *)arg)->debug);
-		err |= __copy_to_user((char *)&((struct mtconfiginfo32 *)arg)->debug
-			    		   + sizeof(((struct mtconfiginfo32 *)arg)->debug),
+		uinfo32 = compat_ptr(arg);
+		err = __put_user(info.mt_type, &uinfo32->mt_type);
+		err |= __put_user(info.ifc_type, &uinfo32->ifc_type);
+		err |= __put_user(info.irqnr, &uinfo32->irqnr);
+		err |= __put_user(info.dmanr, &uinfo32->dmanr);
+		err |= __put_user(info.port, &uinfo32->port);
+		err |= __put_user(info.debug, &uinfo32->debug);
+		err |= __copy_to_user((char *)&uinfo32->debug
+			    		   + sizeof(uinfo32->debug),
 					   (char *)&info.debug + sizeof(info.debug), sizeof(__u32));
 		break;
 	case MTIOCSETCONFIG32:
@@ -1402,7 +1421,7 @@
 	void *datap;
 
 	cdread_audio = compat_alloc_user_space(sizeof(*cdread_audio));
-	cdread_audio32 = (struct cdrom_read_audio32 *) arg;
+	cdread_audio32 = compat_ptr(arg);
 
 	if (copy_in_user(&cdread_audio->addr,
 			 &cdread_audio32->addr,
@@ -1412,7 +1431,7 @@
 
 	if (get_user(data, &cdread_audio32->buf))
 		return -EFAULT;
-	datap = (void *) (unsigned long) data;
+	datap = compat_ptr(data);
 	if (put_user(datap, &cdread_audio->buf))
 		return -EFAULT;
 
@@ -1426,7 +1445,7 @@
 
 	if (get_user(data, ptr32))
 		return -EFAULT;
-	datap = (void *) (unsigned long) data;
+	datap = compat_ptr(data);
 	if (put_user(datap, ptr64))
 		return -EFAULT;
 
@@ -1440,7 +1459,7 @@
 	unsigned char dir;
 
 	cgc = compat_alloc_user_space(sizeof(*cgc));
-	cgc32 = (struct cdrom_generic_command32 *) arg;
+	cgc32 = compat_ptr(arg);
 
 	if (copy_in_user(&cgc->cmd, &cgc32->cmd, sizeof(cgc->cmd)) ||
 	    __cgc_do_ptr((void **) &cgc->buffer, &cgc32->buffer) ||
@@ -1510,16 +1529,18 @@
 {
 	mm_segment_t old_fs = get_fs();
 	struct loop_info l;
+	struct loop_info32 *ul;
 	int err = -EINVAL;
 
+	ul = compat_ptr(arg);
 	switch(cmd) {
 	case LOOP_SET_STATUS:
-		err = get_user(l.lo_number, &((struct loop_info32 *)arg)->lo_number);
-		err |= __get_user(l.lo_device, &((struct loop_info32 *)arg)->lo_device);
-		err |= __get_user(l.lo_inode, &((struct loop_info32 *)arg)->lo_inode);
-		err |= __get_user(l.lo_rdevice, &((struct loop_info32 *)arg)->lo_rdevice);
-		err |= __copy_from_user((char *)&l.lo_offset, (char *)&((struct loop_info32 *)arg)->lo_offset,
-					   8 + (unsigned long)l.lo_init - (unsigned long)&l.lo_offset);
+		err = get_user(l.lo_number, &ul->lo_number);
+		err |= __get_user(l.lo_device, &ul->lo_device);
+		err |= __get_user(l.lo_inode, &ul->lo_inode);
+		err |= __get_user(l.lo_rdevice, &ul->lo_rdevice);
+		err |= __copy_from_user(&l.lo_offset, &ul->lo_offset,
+		        8 + (unsigned long)l.lo_init - (unsigned long)&l.lo_offset);
 		if (err) {
 			err = -EFAULT;
 		} else {
@@ -1533,12 +1554,12 @@
 		err = sys_ioctl (fd, cmd, (unsigned long)&l);
 		set_fs (old_fs);
 		if (!err) {
-			err = put_user(l.lo_number, &((struct loop_info32 *)arg)->lo_number);
-			err |= __put_user(l.lo_device, &((struct loop_info32 *)arg)->lo_device);
-			err |= __put_user(l.lo_inode, &((struct loop_info32 *)arg)->lo_inode);
-			err |= __put_user(l.lo_rdevice, &((struct loop_info32 *)arg)->lo_rdevice);
-			err |= __copy_to_user((char *)&((struct loop_info32 *)arg)->lo_offset,
-					   (char *)&l.lo_offset, (unsigned long)l.lo_init - (unsigned long)&l.lo_offset);
+			err = put_user(l.lo_number, &ul->lo_number);
+			err |= __put_user(l.lo_device, &ul->lo_device);
+			err |= __put_user(l.lo_inode, &ul->lo_inode);
+			err |= __put_user(l.lo_rdevice, &ul->lo_rdevice);
+			err |= __copy_to_user(&ul->lo_offset, &l.lo_offset,
+				(unsigned long)l.lo_init - (unsigned long)&l.lo_offset);
 			if (err)
 				err = -EFAULT;
 		}
@@ -1588,10 +1609,11 @@
 	compat_caddr_t chardata;	/* font data in expanded form */
 };
 
-static int do_fontx_ioctl(unsigned int fd, int cmd, struct consolefontdesc32 *user_cfd, struct file *file)
+static int do_fontx_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *file)
 {
 	struct consolefontdesc cfdarg;
 	struct console_font_op op;
+	struct consolefontdesc32 *user_cfd = compat_ptr(arg);
 	int i, perm;
 
 	perm = vt_check(file);
@@ -1643,9 +1665,10 @@
 	compat_caddr_t data;    /* font data with height fixed to 32 */
 };
                                         
-static int do_kdfontop_ioctl(unsigned int fd, unsigned int cmd, struct console_font_op32 *fontop, struct file *file)
+static int do_kdfontop_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *file)
 {
 	struct console_font_op op;
+	struct console_font_op32 *fontop = compat_ptr(arg);
 	int perm = vt_check(file), i;
 	struct vt_struct *vt;
 	
@@ -1671,9 +1694,10 @@
 	compat_caddr_t entries;
 };
 
-static int do_unimap_ioctl(unsigned int fd, unsigned int cmd, struct unimapdesc32 *user_ud, struct file *file)
+static int do_unimap_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *file)
 {
 	struct unimapdesc32 tmp;
+	struct unimapdesc32 *user_ud = compat_ptr(arg);
 	int perm = vt_check(file);
 	
 	if (perm < 0) return perm;
@@ -1704,7 +1728,7 @@
 	set_fs(old_fs);
 
 	if (err >= 0)
-		err = put_user(kuid, (compat_uid_t *)arg);
+		err = put_user(kuid, (compat_uid_t *)compat_ptr(arg));
 
 	return err;
 }
@@ -1773,12 +1797,12 @@
 	int len, err;
 
 	iobuf = compat_alloc_user_space(sizeof(*iobuf));
-	iobuf32 = (struct atm_iobuf32 *) arg;
+	iobuf32 = compat_ptr(arg);
 
 	if (get_user(len, &iobuf32->length) ||
 	    get_user(data, &iobuf32->buffer))
 		return -EFAULT;
-	datap = (void *) (unsigned long) data;
+	datap = compat_ptr(data);
 	if (put_user(len, &iobuf->length) ||
 	    put_user(datap, &iobuf->buffer))
 		return -EFAULT;
@@ -1803,12 +1827,12 @@
 	int err;
         
 	sioc = compat_alloc_user_space(sizeof(*sioc));
-	sioc32 = (struct atmif_sioc32 *) arg;
+	sioc32 = compat_ptr(arg);
 
 	if (copy_in_user(&sioc->number, &sioc32->number, 2 * sizeof(int)) ||
 	    get_user(data, &sioc32->arg))
 		return -EFAULT;
-	datap = (void *) (unsigned long) data;
+	datap = compat_ptr(data);
 	if (put_user(datap, &sioc->arg))
 		return -EFAULT;
 
@@ -1891,25 +1915,32 @@
 	compat_int_t datalen;
 	compat_caddr_t data;
 };
-                                
-static int blkpg_ioctl_trans(unsigned int fd, unsigned int cmd, struct blkpg_ioctl_arg32 *arg)
+
+static int blkpg_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	struct blkpg_ioctl_arg a;
+	struct blkpg_ioctl_arg32 *ua32;
 	struct blkpg_partition p;
+	struct blkpg_partition *up32;
+	compat_caddr_t udata;
 	int err;
 	mm_segment_t old_fs = get_fs();
 	
-	err = get_user(a.op, &arg->op);
-	err |= __get_user(a.flags, &arg->flags);
-	err |= __get_user(a.datalen, &arg->datalen);
-	err |= __get_user((long)a.data, &arg->data);
-	if (err) return err;
+	ua32 = compat_ptr(arg);
+	err = get_user(a.op, &ua32->op);
+	err |= __get_user(a.flags, &ua32->flags);
+	err |= __get_user(a.datalen, &ua32->datalen);
+	err |= __get_user(udata, &ua32->data);
+	up32 = compat_ptr(udata);
+	if (err)
+		return err;
+
 	switch (a.op) {
 	case BLKPG_ADD_PARTITION:
 	case BLKPG_DEL_PARTITION:
 		if (a.datalen < sizeof(struct blkpg_partition))
 			return -EINVAL;
-                if (copy_from_user(&p, a.data, sizeof(struct blkpg_partition)))
+                if (copy_from_user(&p, up32, sizeof(struct blkpg_partition)))
 			return -EFAULT;
 		a.data = &p;
 		set_fs (KERNEL_DS);
@@ -1933,18 +1964,18 @@
 
 static int do_blkbszget(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-       return sys_ioctl(fd, BLKBSZGET, arg);
+       return sys_ioctl(fd, BLKBSZGET, (unsigned long)compat_ptr(arg));
 }
 
 static int do_blkbszset(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-       return sys_ioctl(fd, BLKBSZSET, arg);
+       return sys_ioctl(fd, BLKBSZSET, (unsigned long)compat_ptr(arg));
 }
 
 static int do_blkgetsize64(unsigned int fd, unsigned int cmd,
                           unsigned long arg)
 {
-       return sys_ioctl(fd, BLKGETSIZE64, arg);
+       return sys_ioctl(fd, BLKGETSIZE64, (unsigned long)compat_ptr(arg));
 }
 
 /* Bluetooth ioctls */
@@ -2081,23 +2112,25 @@
 		case FDDEFPRM32:
 		case FDGETPRM32:
 		{
+			struct floppy_struct32 *uf;
 			struct floppy_struct *f;
 
+			uf = compat_ptr(arg);
 			f = karg = kmalloc(sizeof(struct floppy_struct), GFP_KERNEL);
 			if (!karg)
 				return -ENOMEM;
 			if (cmd == FDGETPRM32)
 				break;
-			err = __get_user(f->size, &((struct floppy_struct32 *)arg)->size);
-			err |= __get_user(f->sect, &((struct floppy_struct32 *)arg)->sect);
-			err |= __get_user(f->head, &((struct floppy_struct32 *)arg)->head);
-			err |= __get_user(f->track, &((struct floppy_struct32 *)arg)->track);
-			err |= __get_user(f->stretch, &((struct floppy_struct32 *)arg)->stretch);
-			err |= __get_user(f->gap, &((struct floppy_struct32 *)arg)->gap);
-			err |= __get_user(f->rate, &((struct floppy_struct32 *)arg)->rate);
-			err |= __get_user(f->spec1, &((struct floppy_struct32 *)arg)->spec1);
-			err |= __get_user(f->fmt_gap, &((struct floppy_struct32 *)arg)->fmt_gap);
-			err |= __get_user((u64)f->name, &((struct floppy_struct32 *)arg)->name);
+			err = __get_user(f->size, &uf->size);
+			err |= __get_user(f->sect, &uf->sect);
+			err |= __get_user(f->head, &uf->head);
+			err |= __get_user(f->track, &uf->track);
+			err |= __get_user(f->stretch, &uf->stretch);
+			err |= __get_user(f->gap, &uf->gap);
+			err |= __get_user(f->rate, &uf->rate);
+			err |= __get_user(f->spec1, &uf->spec1);
+			err |= __get_user(f->fmt_gap, &uf->fmt_gap);
+			err |= __get_user((u64)f->name, &uf->name);
 			if (err) {
 				err = -EFAULT;
 				goto out;
@@ -2107,32 +2140,34 @@
 		case FDSETDRVPRM32:
 		case FDGETDRVPRM32:
 		{
+			struct floppy_drive_params32 *uf;
 			struct floppy_drive_params *f;
 
+			uf = compat_ptr(arg);
 			f = karg = kmalloc(sizeof(struct floppy_drive_params), GFP_KERNEL);
 			if (!karg)
 				return -ENOMEM;
 			if (cmd == FDGETDRVPRM32)
 				break;
-			err = __get_user(f->cmos, &((struct floppy_drive_params32 *)arg)->cmos);
-			err |= __get_user(f->max_dtr, &((struct floppy_drive_params32 *)arg)->max_dtr);
-			err |= __get_user(f->hlt, &((struct floppy_drive_params32 *)arg)->hlt);
-			err |= __get_user(f->hut, &((struct floppy_drive_params32 *)arg)->hut);
-			err |= __get_user(f->srt, &((struct floppy_drive_params32 *)arg)->srt);
-			err |= __get_user(f->spinup, &((struct floppy_drive_params32 *)arg)->spinup);
-			err |= __get_user(f->spindown, &((struct floppy_drive_params32 *)arg)->spindown);
-			err |= __get_user(f->spindown_offset, &((struct floppy_drive_params32 *)arg)->spindown_offset);
-			err |= __get_user(f->select_delay, &((struct floppy_drive_params32 *)arg)->select_delay);
-			err |= __get_user(f->rps, &((struct floppy_drive_params32 *)arg)->rps);
-			err |= __get_user(f->tracks, &((struct floppy_drive_params32 *)arg)->tracks);
-			err |= __get_user(f->timeout, &((struct floppy_drive_params32 *)arg)->timeout);
-			err |= __get_user(f->interleave_sect, &((struct floppy_drive_params32 *)arg)->interleave_sect);
-			err |= __copy_from_user(&f->max_errors, &((struct floppy_drive_params32 *)arg)->max_errors, sizeof(f->max_errors));
-			err |= __get_user(f->flags, &((struct floppy_drive_params32 *)arg)->flags);
-			err |= __get_user(f->read_track, &((struct floppy_drive_params32 *)arg)->read_track);
-			err |= __copy_from_user(f->autodetect, ((struct floppy_drive_params32 *)arg)->autodetect, sizeof(f->autodetect));
-			err |= __get_user(f->checkfreq, &((struct floppy_drive_params32 *)arg)->checkfreq);
-			err |= __get_user(f->native_format, &((struct floppy_drive_params32 *)arg)->native_format);
+			err = __get_user(f->cmos, &uf->cmos);
+			err |= __get_user(f->max_dtr, &uf->max_dtr);
+			err |= __get_user(f->hlt, &uf->hlt);
+			err |= __get_user(f->hut, &uf->hut);
+			err |= __get_user(f->srt, &uf->srt);
+			err |= __get_user(f->spinup, &uf->spinup);
+			err |= __get_user(f->spindown, &uf->spindown);
+			err |= __get_user(f->spindown_offset, &uf->spindown_offset);
+			err |= __get_user(f->select_delay, &uf->select_delay);
+			err |= __get_user(f->rps, &uf->rps);
+			err |= __get_user(f->tracks, &uf->tracks);
+			err |= __get_user(f->timeout, &uf->timeout);
+			err |= __get_user(f->interleave_sect, &uf->interleave_sect);
+			err |= __copy_from_user(&f->max_errors, &uf->max_errors, sizeof(f->max_errors));
+			err |= __get_user(f->flags, &uf->flags);
+			err |= __get_user(f->read_track, &uf->read_track);
+			err |= __copy_from_user(f->autodetect, uf->autodetect, sizeof(f->autodetect));
+			err |= __get_user(f->checkfreq, &uf->checkfreq);
+			err |= __get_user(f->native_format, &uf->native_format);
 			if (err) {
 				err = -EFAULT;
 				goto out;
@@ -2177,83 +2212,90 @@
 			err |= __put_user(f->rate, &((struct floppy_struct32 *)arg)->rate);
 			err |= __put_user(f->spec1, &((struct floppy_struct32 *)arg)->spec1);
 			err |= __put_user(f->fmt_gap, &((struct floppy_struct32 *)arg)->fmt_gap);
-			err |= __put_user((u64)f->name, &((struct floppy_struct32 *)arg)->name);
+			err |= __put_user((u64)f->name, (compat_caddr_t*)&((struct floppy_struct32 *)arg)->name);
 			break;
 		}
 		case FDGETDRVPRM32:
 		{
+			struct floppy_drive_params32 *uf;
 			struct floppy_drive_params *f = karg;
 
-			err = __put_user(f->cmos, &((struct floppy_drive_params32 *)arg)->cmos);
-			err |= __put_user(f->max_dtr, &((struct floppy_drive_params32 *)arg)->max_dtr);
-			err |= __put_user(f->hlt, &((struct floppy_drive_params32 *)arg)->hlt);
-			err |= __put_user(f->hut, &((struct floppy_drive_params32 *)arg)->hut);
-			err |= __put_user(f->srt, &((struct floppy_drive_params32 *)arg)->srt);
-			err |= __put_user(f->spinup, &((struct floppy_drive_params32 *)arg)->spinup);
-			err |= __put_user(f->spindown, &((struct floppy_drive_params32 *)arg)->spindown);
-			err |= __put_user(f->spindown_offset, &((struct floppy_drive_params32 *)arg)->spindown_offset);
-			err |= __put_user(f->select_delay, &((struct floppy_drive_params32 *)arg)->select_delay);
-			err |= __put_user(f->rps, &((struct floppy_drive_params32 *)arg)->rps);
-			err |= __put_user(f->tracks, &((struct floppy_drive_params32 *)arg)->tracks);
-			err |= __put_user(f->timeout, &((struct floppy_drive_params32 *)arg)->timeout);
-			err |= __put_user(f->interleave_sect, &((struct floppy_drive_params32 *)arg)->interleave_sect);
-			err |= __copy_to_user(&((struct floppy_drive_params32 *)arg)->max_errors, &f->max_errors, sizeof(f->max_errors));
-			err |= __put_user(f->flags, &((struct floppy_drive_params32 *)arg)->flags);
-			err |= __put_user(f->read_track, &((struct floppy_drive_params32 *)arg)->read_track);
-			err |= __copy_to_user(((struct floppy_drive_params32 *)arg)->autodetect, f->autodetect, sizeof(f->autodetect));
-			err |= __put_user(f->checkfreq, &((struct floppy_drive_params32 *)arg)->checkfreq);
-			err |= __put_user(f->native_format, &((struct floppy_drive_params32 *)arg)->native_format);
+			uf = compat_ptr(arg);
+			err = __put_user(f->cmos, &uf->cmos);
+			err |= __put_user(f->max_dtr, &uf->max_dtr);
+			err |= __put_user(f->hlt, &uf->hlt);
+			err |= __put_user(f->hut, &uf->hut);
+			err |= __put_user(f->srt, &uf->srt);
+			err |= __put_user(f->spinup, &uf->spinup);
+			err |= __put_user(f->spindown, &uf->spindown);
+			err |= __put_user(f->spindown_offset, &uf->spindown_offset);
+			err |= __put_user(f->select_delay, &uf->select_delay);
+			err |= __put_user(f->rps, &uf->rps);
+			err |= __put_user(f->tracks, &uf->tracks);
+			err |= __put_user(f->timeout, &uf->timeout);
+			err |= __put_user(f->interleave_sect, &uf->interleave_sect);
+			err |= __copy_to_user(&uf->max_errors, &f->max_errors, sizeof(f->max_errors));
+			err |= __put_user(f->flags, &uf->flags);
+			err |= __put_user(f->read_track, &uf->read_track);
+			err |= __copy_to_user(uf->autodetect, f->autodetect, sizeof(f->autodetect));
+			err |= __put_user(f->checkfreq, &uf->checkfreq);
+			err |= __put_user(f->native_format, &uf->native_format);
 			break;
 		}
 		case FDGETDRVSTAT32:
 		case FDPOLLDRVSTAT32:
 		{
+			struct floppy_drive_struct32 *uf;
 			struct floppy_drive_struct *f = karg;
 
-			err = __put_user(f->flags, &((struct floppy_drive_struct32 *)arg)->flags);
-			err |= __put_user(f->spinup_date, &((struct floppy_drive_struct32 *)arg)->spinup_date);
-			err |= __put_user(f->select_date, &((struct floppy_drive_struct32 *)arg)->select_date);
-			err |= __put_user(f->first_read_date, &((struct floppy_drive_struct32 *)arg)->first_read_date);
-			err |= __put_user(f->probed_format, &((struct floppy_drive_struct32 *)arg)->probed_format);
-			err |= __put_user(f->track, &((struct floppy_drive_struct32 *)arg)->track);
-			err |= __put_user(f->maxblock, &((struct floppy_drive_struct32 *)arg)->maxblock);
-			err |= __put_user(f->maxtrack, &((struct floppy_drive_struct32 *)arg)->maxtrack);
-			err |= __put_user(f->generation, &((struct floppy_drive_struct32 *)arg)->generation);
-			err |= __put_user(f->keep_data, &((struct floppy_drive_struct32 *)arg)->keep_data);
-			err |= __put_user(f->fd_ref, &((struct floppy_drive_struct32 *)arg)->fd_ref);
-			err |= __put_user(f->fd_device, &((struct floppy_drive_struct32 *)arg)->fd_device);
-			err |= __put_user(f->last_checked, &((struct floppy_drive_struct32 *)arg)->last_checked);
-			err |= __put_user((u64)f->dmabuf, &((struct floppy_drive_struct32 *)arg)->dmabuf);
-			err |= __put_user((u64)f->bufblocks, &((struct floppy_drive_struct32 *)arg)->bufblocks);
+			uf = compat_ptr(arg);
+			err = __put_user(f->flags, &uf->flags);
+			err |= __put_user(f->spinup_date, &uf->spinup_date);
+			err |= __put_user(f->select_date, &uf->select_date);
+			err |= __put_user(f->first_read_date, &uf->first_read_date);
+			err |= __put_user(f->probed_format, &uf->probed_format);
+			err |= __put_user(f->track, &uf->track);
+			err |= __put_user(f->maxblock, &uf->maxblock);
+			err |= __put_user(f->maxtrack, &uf->maxtrack);
+			err |= __put_user(f->generation, &uf->generation);
+			err |= __put_user(f->keep_data, &uf->keep_data);
+			err |= __put_user(f->fd_ref, &uf->fd_ref);
+			err |= __put_user(f->fd_device, &uf->fd_device);
+			err |= __put_user(f->last_checked, &uf->last_checked);
+			err |= __put_user((u64)f->dmabuf, &uf->dmabuf);
+			err |= __put_user((u64)f->bufblocks, &uf->bufblocks);
 			break;
 		}
 		case FDGETFDCSTAT32:
 		{
+			struct floppy_fdc_state32 *uf;
 			struct floppy_fdc_state *f = karg;
 
-			err = __put_user(f->spec1, &((struct floppy_fdc_state32 *)arg)->spec1);
-			err |= __put_user(f->spec2, &((struct floppy_fdc_state32 *)arg)->spec2);
-			err |= __put_user(f->dtr, &((struct floppy_fdc_state32 *)arg)->dtr);
-			err |= __put_user(f->version, &((struct floppy_fdc_state32 *)arg)->version);
-			err |= __put_user(f->dor, &((struct floppy_fdc_state32 *)arg)->dor);
-			err |= __put_user(f->address, &((struct floppy_fdc_state32 *)arg)->address);
-			err |= __copy_to_user((char *)&((struct floppy_fdc_state32 *)arg)->address
-			    		   + sizeof(((struct floppy_fdc_state32 *)arg)->address),
+			uf = compat_ptr(arg);
+			err = __put_user(f->spec1, &uf->spec1);
+			err |= __put_user(f->spec2, &uf->spec2);
+			err |= __put_user(f->dtr, &uf->dtr);
+			err |= __put_user(f->version, &uf->version);
+			err |= __put_user(f->dor, &uf->dor);
+			err |= __put_user(f->address, &uf->address);
+			err |= __copy_to_user((char *)&uf->address + sizeof(uf->address),
 					   (char *)&f->address + sizeof(f->address), sizeof(int));
-			err |= __put_user(f->driver_version, &((struct floppy_fdc_state32 *)arg)->driver_version);
-			err |= __copy_to_user(((struct floppy_fdc_state32 *)arg)->track, f->track, sizeof(f->track));
+			err |= __put_user(f->driver_version, &uf->driver_version);
+			err |= __copy_to_user(uf->track, f->track, sizeof(f->track));
 			break;
 		}
 		case FDWERRORGET32:
 		{
+			struct floppy_write_errors32 *uf;
 			struct floppy_write_errors *f = karg;
 
-			err = __put_user(f->write_errors, &((struct floppy_write_errors32 *)arg)->write_errors);
-			err |= __put_user(f->first_error_sector, &((struct floppy_write_errors32 *)arg)->first_error_sector);
-			err |= __put_user(f->first_error_generation, &((struct floppy_write_errors32 *)arg)->first_error_generation);
-			err |= __put_user(f->last_error_sector, &((struct floppy_write_errors32 *)arg)->last_error_sector);
-			err |= __put_user(f->last_error_generation, &((struct floppy_write_errors32 *)arg)->last_error_generation);
-			err |= __put_user(f->badness, &((struct floppy_write_errors32 *)arg)->badness);
+			uf = compat_ptr(arg);
+			err = __put_user(f->write_errors, &uf->write_errors);
+			err |= __put_user(f->first_error_sector, &uf->first_error_sector);
+			err |= __put_user(f->first_error_generation, &uf->first_error_generation);
+			err |= __put_user(f->last_error_sector, &uf->last_error_sector);
+			err |= __put_user(f->last_error_generation, &uf->last_error_generation);
+			err |= __put_user(f->badness, &uf->badness);
 			break;
 		}
 		default:
@@ -2278,7 +2320,7 @@
 static int mtd_rw_oob(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	struct mtd_oob_buf	*buf = compat_alloc_user_space(sizeof(*buf));
-	struct mtd_oob_buf32	*buf32 = (struct mtd_oob_buf32 *) arg;
+	struct mtd_oob_buf32	*buf32 = compat_ptr(arg);
 	u32 data;
 	char *datap;
 	unsigned int real_cmd;
@@ -2291,7 +2333,7 @@
 			 2 * sizeof(u32)) ||
 	    get_user(data, &buf32->ptr))
 		return -EFAULT;
-	datap = (void *) (unsigned long) data;
+	datap = compat_ptr(data);
 	if (put_user(datap, &buf->ptr))
 		return -EFAULT;
 
@@ -2325,7 +2367,7 @@
         return ret;
 }
 
-static int vfat_ioctl32(unsigned fd, unsigned cmd,  void *ptr)
+static int vfat_ioctl32(unsigned fd, unsigned cmd, unsigned long arg)
 {
 	int ret;
 	mm_segment_t oldfs = get_fs();
@@ -2345,8 +2387,8 @@
 	ret = sys_ioctl(fd,cmd,(unsigned long)&d);
 	set_fs(oldfs);
 	if (ret >= 0) {
-		ret |= put_dirent32(&d[0], (struct compat_dirent *)ptr);
-		ret |= put_dirent32(&d[1], ((struct compat_dirent *)ptr) + 1);
+		ret |= put_dirent32(&d[0], (struct compat_dirent *)compat_ptr(arg));
+		ret |= put_dirent32(&d[1], ((struct compat_dirent *)compat_ptr(arg)) + 1);
 	}
 	return ret;
 }
@@ -2384,7 +2426,7 @@
         __get_user(hi_min, ((__u32*)(&user_req->block_minor) + 1));
 
         req->block_major = lo_maj | (((__u64)hi_maj) << 32);
-        req->block_minor = lo_min | (((__u64)lo_min) << 32);
+        req->block_minor = lo_min | (((__u64)hi_min) << 32);
 
         return ret;
 }
@@ -2406,7 +2448,7 @@
         return ret;
 }
 
-static int raw_ioctl(unsigned fd, unsigned cmd,  void *ptr)
+static int raw_ioctl(unsigned fd, unsigned cmd, unsigned long arg)
 {
         int ret;
 
@@ -2414,7 +2456,7 @@
         case RAW_SETBIND:
         case RAW_GETBIND: {
                 struct raw_config_request req;
-                struct raw32_config_request *user_req = ptr;
+                struct raw32_config_request *user_req = compat_ptr(arg);
                 mm_segment_t oldfs = get_fs();
 
                 if ((ret = get_raw32_request(&req, user_req)))
@@ -2430,7 +2472,7 @@
                 break;
         }
         default:
-                ret = sys_ioctl(fd,cmd,(unsigned long)ptr);
+                ret = sys_ioctl(fd, cmd, arg);
                 break;
         }
         return ret;
@@ -2454,14 +2496,15 @@
         compat_uint_t   iomem_base;
         unsigned short  iomem_reg_shift;
         unsigned int    port_high;
+     /* compat_ulong_t  iomap_base FIXME */
         compat_int_t    reserved[1];
 };
 
-static int serial_struct_ioctl(unsigned fd, unsigned cmd,  void *ptr)
+static int serial_struct_ioctl(unsigned fd, unsigned cmd, unsigned long arg)
 {
         typedef struct serial_struct SS;
         typedef struct serial_struct32 SS32;
-        struct serial_struct32 *ss32 = ptr;
+        struct serial_struct32 *ss32 = compat_ptr(arg);
         int err;
         struct serial_struct ss;
         mm_segment_t oldseg = get_fs();
@@ -2515,7 +2558,7 @@
         void *uptr, *kptr;
         int err;
 
-        uctrl = (struct usbdevfs_ctrltransfer32 *) arg;
+        uctrl = compat_ptr(arg);
 
         if (copy_from_user(&kctrl, uctrl,
                            (sizeof(struct usbdevfs_ctrltransfer32) -
@@ -2576,7 +2619,7 @@
         void *uptr, *kptr;
         int err;
 
-	ubulk = (struct usbdevfs_bulktransfer32 *) arg;
+	ubulk = compat_ptr(arg);
 
         if (get_user(kbulk.ep, &ubulk->ep) ||
             get_user(kbulk.len, &ubulk->len) ||
@@ -2771,7 +2814,7 @@
 	unsigned int buflen;
 	int err;
 
-	uurb = (struct usbdevfs_urb32 *) arg;
+	uurb = compat_ptr(arg);
 
 	err = -ENOMEM;
 	kurb = kmalloc(sizeof(struct usbdevfs_urb) +
@@ -2836,7 +2879,7 @@
         set_fs(old_fs);
 
         if (err >= 0 &&
-            put_user((u32)(u64)kptr, (u32 *)arg))
+            put_user((u32)(u64)kptr, (u32 *)compat_ptr(arg)))
                 err = -EFAULT;
 
         return err;
@@ -2857,13 +2900,13 @@
         u32 uctx;
         int err;
 
-        udis = (struct usbdevfs_disconnectsignal32 *) arg;
+        udis = compat_ptr(arg);
 
         if (get_user(kdis.signr, &udis->signr) ||
             __get_user(uctx, &udis->context))
                 return -EFAULT;
 
-        kdis.context = (void *) (long)uctx;
+        kdis.context = compat_ptr(uctx);
 
         old_fs = get_fs();
         set_fs(KERNEL_DS);
@@ -2970,6 +3013,48 @@
 	return sys_ioctl(fd, cmd, (unsigned long)tdata);
 }
 
+struct compat_iw_point {
+	compat_caddr_t pointer;
+	__u16 length;
+	__u16 flags;
+};
+
+static int do_wireless_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+	struct iwreq *iwr, *iwr_u;
+	struct iw_point *iwp;
+	struct compat_iw_point *iwp_u;
+	compat_caddr_t pointer;
+	__u16 length, flags;
+
+	iwr_u = (struct iwreq *) compat_ptr(arg);
+	iwp_u = (struct compat_iw_point *) &iwr_u->u.data;
+	iwr = compat_alloc_user_space(sizeof(*iwr));
+	if (iwr == NULL)
+		return -ENOMEM;
+
+	iwp = &iwr->u.data;
+
+	if (verify_area(VERIFY_WRITE, iwr, sizeof(*iwr)))
+		return -EFAULT;
+
+	if (__copy_in_user(&iwr->ifr_ifrn.ifrn_name[0],
+			   &iwr_u->ifr_ifrn.ifrn_name[0],
+			   sizeof(iwr->ifr_ifrn.ifrn_name)))
+		return -EFAULT;
+
+	if (__get_user(pointer, &iwp_u->pointer) ||
+	    __get_user(length, &iwp_u->length) ||
+	    __get_user(flags, &iwp_u->flags))
+		return -EFAULT;
+
+	if (__put_user(compat_ptr(pointer), &iwp->pointer) ||
+	    __put_user(length, &iwp->length) ||
+	    __put_user(flags, &iwp->flags))
+		return -EFAULT;
+
+	return sys_ioctl(fd, cmd, (unsigned long) iwr);
+}
 
 #undef CODE
 #endif
@@ -3008,6 +3093,7 @@
 HANDLE_IOCTL(SIOCGIFPFLAGS, dev_ifsioc)
 HANDLE_IOCTL(SIOCGIFTXQLEN, dev_ifsioc)
 HANDLE_IOCTL(SIOCSIFTXQLEN, dev_ifsioc)
+HANDLE_IOCTL(TUNSETIFF, dev_ifsioc)
 HANDLE_IOCTL(SIOCETHTOOL, ethtool_ioctl)
 HANDLE_IOCTL(SIOCBONDENSLAVE, bond_ioctl)
 HANDLE_IOCTL(SIOCBONDRELEASE, bond_ioctl)
@@ -3133,6 +3219,20 @@
 HANDLE_IOCTL(I2C_FUNCS, w_long)
 HANDLE_IOCTL(I2C_RDWR, do_i2c_rdwr_ioctl)
 HANDLE_IOCTL(I2C_SMBUS, do_i2c_smbus_ioctl)
+/* wireless */
+HANDLE_IOCTL(SIOCGIWRANGE, do_wireless_ioctl)
+HANDLE_IOCTL(SIOCSIWSPY, do_wireless_ioctl)
+HANDLE_IOCTL(SIOCGIWSPY, do_wireless_ioctl)
+HANDLE_IOCTL(SIOCSIWTHRSPY, do_wireless_ioctl)
+HANDLE_IOCTL(SIOCGIWTHRSPY, do_wireless_ioctl)
+HANDLE_IOCTL(SIOCGIWAPLIST, do_wireless_ioctl)
+HANDLE_IOCTL(SIOCGIWSCAN, do_wireless_ioctl)
+HANDLE_IOCTL(SIOCSIWESSID, do_wireless_ioctl)
+HANDLE_IOCTL(SIOCGIWESSID, do_wireless_ioctl)
+HANDLE_IOCTL(SIOCSIWNICKN, do_wireless_ioctl)
+HANDLE_IOCTL(SIOCGIWNICKN, do_wireless_ioctl)
+HANDLE_IOCTL(SIOCSIWENCODE, do_wireless_ioctl)
+HANDLE_IOCTL(SIOCGIWENCODE, do_wireless_ioctl)
 
 #undef DECLARES
 #endif
diff -Nru a/fs/cramfs/inode.c b/fs/cramfs/inode.c
--- a/fs/cramfs/inode.c	Tue Feb  3 19:45:16 2004
+++ b/fs/cramfs/inode.c	Tue Feb  3 19:45:16 2004
@@ -112,8 +112,8 @@
  */
 static void *cramfs_read(struct super_block *sb, unsigned int offset, unsigned int len)
 {
-	struct buffer_head * bh_array[BLKS_PER_BUF];
-	struct buffer_head * read_array[BLKS_PER_BUF];
+	struct address_space *mapping = sb->s_bdev->bd_inode->i_mapping;
+	struct page *pages[BLKS_PER_BUF];
 	unsigned i, blocknr, buffer, unread;
 	unsigned long devsize;
 	char *data;
@@ -138,33 +138,36 @@
 		return read_buffers[i] + blk_offset;
 	}
 
-	devsize = sb->s_bdev->bd_inode->i_size >> 12;
-	if (!devsize)
-		devsize = ~0UL;
+	devsize = mapping->host->i_size >> PAGE_CACHE_SHIFT;
 
 	/* Ok, read in BLKS_PER_BUF pages completely first. */
 	unread = 0;
 	for (i = 0; i < BLKS_PER_BUF; i++) {
-		struct buffer_head *bh;
+		struct page *page = NULL;
 
-		bh = NULL;
 		if (blocknr + i < devsize) {
-			bh = sb_getblk(sb, blocknr + i);
-			if (!buffer_uptodate(bh))
-				read_array[unread++] = bh;
+			page = read_cache_page(mapping, blocknr + i,
+				(filler_t *)mapping->a_ops->readpage,
+				NULL);
+			/* synchronous error? */
+			if (IS_ERR(page))
+				page = NULL;
 		}
-		bh_array[i] = bh;
+		pages[i] = page;
 	}
 
-	if (unread) {
-		ll_rw_block(READ, unread, read_array);
-		do {
-			unread--;
-			wait_on_buffer(read_array[unread]);
-		} while (unread);
+	for (i = 0; i < BLKS_PER_BUF; i++) {
+		struct page *page = pages[i];
+		if (page) {
+			wait_on_page_locked(page);
+			if (!PageUptodate(page)) {
+				/* asynchronous error */
+				page_cache_release(page);
+				pages[i] = NULL;
+			}
+		}
 	}
 
-	/* Ok, copy them to the staging area without sleeping. */
 	buffer = next_buffer;
 	next_buffer = NEXT_BUFFER(buffer);
 	buffer_blocknr[buffer] = blocknr;
@@ -172,10 +175,11 @@
 
 	data = read_buffers[buffer];
 	for (i = 0; i < BLKS_PER_BUF; i++) {
-		struct buffer_head * bh = bh_array[i];
-		if (bh) {
-			memcpy(data, bh->b_data, PAGE_CACHE_SIZE);
-			brelse(bh);
+		struct page *page = pages[i];
+		if (page) {
+			memcpy(data, kmap(page), PAGE_CACHE_SIZE);
+			kunmap(page);
+			page_cache_release(page);
 		} else
 			memset(data, 0, PAGE_CACHE_SIZE);
 		data += PAGE_CACHE_SIZE;
@@ -201,8 +205,6 @@
 		return -ENOMEM;
 	sb->s_fs_info = sbi;
 	memset(sbi, 0, sizeof(struct cramfs_sb_info));
-
-	sb_set_blocksize(sb, PAGE_CACHE_SIZE);
 
 	/* Invalidate the read buffers on mount: think disk change.. */
 	down(&read_mutex);
diff -Nru a/fs/devfs/base.c b/fs/devfs/base.c
--- a/fs/devfs/base.c	Tue Feb  3 19:45:17 2004
+++ b/fs/devfs/base.c	Tue Feb  3 19:45:17 2004
@@ -1955,15 +1955,9 @@
     return 0;
 }   /*  End Function devfs_notify_change  */
 
-static void devfs_clear_inode (struct inode *inode)
-{
-    if ( S_ISBLK (inode->i_mode) ) bdput (inode->i_bdev);
-}   /*  End Function devfs_clear_inode  */
-
 static struct super_operations devfs_sops =
 { 
     .drop_inode    = generic_delete_inode,
-    .clear_inode   = devfs_clear_inode,
     .statfs        = simple_statfs,
 };
 
@@ -2015,11 +2009,7 @@
 	inode->i_rdev = de->u.cdev.dev;
     }
     else if ( S_ISBLK (de->mode) )
-    {
-	inode->i_rdev = de->u.bdev.dev;
-	if (bd_acquire (inode) != 0)
-		PRINTK ("(%d): no block device from bdget()\n",(int)inode->i_ino);
-    }
+	init_special_inode(inode, de->mode, de->u.bdev.dev);
     else if ( S_ISFIFO (de->mode) )
     	inode->i_fop = &def_fifo_fops;
     else if ( S_ISDIR (de->mode) )
@@ -2118,11 +2108,7 @@
     if (de == NULL) return -ENODEV;
     if ( S_ISDIR (de->mode) ) return 0;
     file->private_data = de->info;
-    if ( S_ISBLK (inode->i_mode) )
-    {
-	file->f_op = &def_blk_fops;
-	err = def_blk_fops.open (inode, file); /* Module refcount unchanged */
-    } else if (S_ISCHR(inode->i_mode)) {
+    if (S_ISCHR(inode->i_mode)) {
 	ops = devfs_get_ops (de);  /*  Now have module refcount  */
 	file->f_op = ops;
 	if (file->f_op)
diff -Nru a/fs/devpts/xattr_security.c b/fs/devpts/xattr_security.c
--- a/fs/devpts/xattr_security.c	Tue Feb  3 19:45:18 2004
+++ b/fs/devpts/xattr_security.c	Tue Feb  3 19:45:18 2004
@@ -8,8 +8,6 @@
 #include <linux/security.h>
 #include "xattr.h"
 
-#define XATTR_SECURITY_PREFIX "security."
-
 static size_t
 devpts_xattr_security_list(struct dentry *dentry, char *buffer)
 {
diff -Nru a/fs/dnotify.c b/fs/dnotify.c
--- a/fs/dnotify.c	Tue Feb  3 19:45:17 2004
+++ b/fs/dnotify.c	Tue Feb  3 19:45:17 2004
@@ -165,6 +165,7 @@
 		spin_unlock(&dentry->d_lock);
 	}
 }
+EXPORT_SYMBOL_GPL(dnotify_parent);
 
 static int __init dnotify_init(void)
 {
diff -Nru a/fs/dquot.c b/fs/dquot.c
--- a/fs/dquot.c	Tue Feb  3 19:45:34 2004
+++ b/fs/dquot.c	Tue Feb  3 19:45:34 2004
@@ -889,11 +889,9 @@
 		warntype[cnt] = NOWARN;
 
 	down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
-	if (IS_NOQUOTA(inode)) {
-		up_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
-		return QUOTA_OK;
-	}
 	spin_lock(&dq_data_lock);
+	if (IS_NOQUOTA(inode))
+		goto add_bytes;
 	for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
 		if (inode->i_dquot[cnt] == NODQUOT)
 			continue;
@@ -905,6 +903,7 @@
 			continue;
 		dquot_incr_space(inode->i_dquot[cnt], number);
 	}
+add_bytes:
 	inode_add_bytes(inode, number);
 	ret = QUOTA_OK;
 warn_put_all:
@@ -958,16 +957,15 @@
 	unsigned int cnt;
 
 	down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
-	if (IS_NOQUOTA(inode)) {
-		up_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
-		return;
-	}
 	spin_lock(&dq_data_lock);
+	if (IS_NOQUOTA(inode))
+		goto sub_bytes;
 	for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
 		if (inode->i_dquot[cnt] == NODQUOT)
 			continue;
 		dquot_decr_space(inode->i_dquot[cnt], number);
 	}
+sub_bytes:
 	inode_sub_bytes(inode, number);
 	spin_unlock(&dq_data_lock);
 	up_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
@@ -1015,8 +1013,10 @@
 		warntype[cnt] = NOWARN;
 	}
 	down_write(&sb_dqopt(inode->i_sb)->dqptr_sem);
-	if (IS_NOQUOTA(inode))	/* File without quota accounting? */
-		goto warn_put_all;
+	if (IS_NOQUOTA(inode)) {	/* File without quota accounting? */
+		up_write(&sb_dqopt(inode->i_sb)->dqptr_sem);
+		return QUOTA_OK;
+	}
 	/* First build the transfer_to list - here we can block on reading of dquots... */
 	for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
 		switch (cnt) {
diff -Nru a/fs/eventpoll.c b/fs/eventpoll.c
--- a/fs/eventpoll.c	Tue Feb  3 19:45:17 2004
+++ b/fs/eventpoll.c	Tue Feb  3 19:45:17 2004
@@ -93,6 +93,8 @@
 #define EPI_SLAB_DEBUG 0
 #endif /* #if DEBUG_EPI != 0 */
 
+/* Epoll private bits inside the event mask */
+#define EP_PRIVATE_BITS (EPOLLONESHOT | EPOLLET)
 
 /* Maximum number of poll wake up nests we are allowing */
 #define EP_MAX_POLLWAKE_NESTS 4
@@ -740,6 +742,7 @@
 	d_add(dentry, inode);
 	file->f_vfsmnt = mntget(eventpoll_mnt);
 	file->f_dentry = dget(dentry);
+	file->f_mapping = inode->i_mapping;
 
 	file->f_pos = 0;
 	file->f_flags = O_RDONLY;
@@ -1305,6 +1308,15 @@
 
 	write_lock_irqsave(&ep->lock, flags);
 
+	/*
+	 * If the event mask does not contain any poll(2) event, we consider the
+	 * descriptor to be disabled. This condition is likely the effect of the
+	 * EPOLLONESHOT bit that disables the descriptor when an event is received,
+	 * until the next EPOLL_CTL_MOD will be issued.
+	 */
+	if (!(epi->event.events & ~EP_PRIVATE_BITS))
+		goto is_disabled;
+
 	/* If this file is already in the ready list we exit soon */
 	if (EP_IS_LINKED(&epi->rdllink))
 		goto is_linked;
@@ -1321,6 +1333,7 @@
 	if (waitqueue_active(&ep->poll_wait))
 		pwake++;
 
+is_disabled:
 	write_unlock_irqrestore(&ep->lock, flags);
 
 	/* We have to call this outside the lock */
@@ -1457,6 +1470,8 @@
 				eventcnt += eventbuf;
 				eventbuf = 0;
 			}
+			if (epi->event.events & EPOLLONESHOT)
+				epi->event.events &= EP_PRIVATE_BITS;
 		}
 	}
 
diff -Nru a/fs/exec.c b/fs/exec.c
--- a/fs/exec.c	Tue Feb  3 19:45:17 2004
+++ b/fs/exec.c	Tue Feb  3 19:45:17 2004
@@ -121,7 +121,7 @@
 	struct nameidata nd;
 	int error;
 
-	nd.intent.open.flags = O_RDONLY;
+	nd.intent.open.flags = FMODE_READ;
 	error = __user_walk(library, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd);
 	if (error)
 		goto out;
@@ -471,8 +471,12 @@
 struct file *open_exec(const char *name)
 {
 	struct nameidata nd;
-	int err = path_lookup(name, LOOKUP_FOLLOW, &nd);
-	struct file *file = ERR_PTR(err);
+	int err;
+	struct file *file;
+
+	nd.intent.open.flags = FMODE_READ;
+	err = path_lookup(name, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd);
+	file = ERR_PTR(err);
 
 	if (!err) {
 		struct inode *inode = nd.dentry->d_inode;
diff -Nru a/fs/ext2/balloc.c b/fs/ext2/balloc.c
--- a/fs/ext2/balloc.c	Tue Feb  3 19:45:17 2004
+++ b/fs/ext2/balloc.c	Tue Feb  3 19:45:17 2004
@@ -527,7 +527,8 @@
 	int i;
 #ifdef EXT2FS_DEBUG
 	unsigned long bitmap_count, x;
-	
+	struct ext2_super_block *es;
+
 	lock_super (sb);
 	es = EXT2_SB(sb)->s_es;
 	desc_count = 0;
@@ -550,7 +551,8 @@
 		brelse(bitmap_bh);
 	}
 	printk("ext2_count_free_blocks: stored = %lu, computed = %lu, %lu\n",
-	       le32_to_cpu(es->s_free_blocks_count), desc_count, bitmap_count);
+		(long)le32_to_cpu(es->s_free_blocks_count),
+		desc_count, bitmap_count);
 	unlock_super (sb);
 	return bitmap_count;
 #else
diff -Nru a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c
--- a/fs/ext2/ialloc.c	Tue Feb  3 19:45:27 2004
+++ b/fs/ext2/ialloc.c	Tue Feb  3 19:45:27 2004
@@ -507,7 +507,7 @@
 				group = 0;
 			continue;
 		}
-		if (ext2_set_bit_atomic(sb_bgl_lock(EXT2_SB(sb), group),
+		if (ext2_set_bit_atomic(sb_bgl_lock(sbi, group),
 						ino, bitmap_bh->b_data)) {
 			/* we lost this inode */
 			if (++ino >= EXT2_INODES_PER_GROUP(sb)) {
@@ -543,23 +543,23 @@
 		goto fail;
 	}
 
-	percpu_counter_mod(&EXT2_SB(sb)->s_freeinodes_counter, -1);
+	percpu_counter_mod(&sbi->s_freeinodes_counter, -1);
 	if (S_ISDIR(mode))
-		percpu_counter_inc(&EXT2_SB(sb)->s_dirs_counter);
+		percpu_counter_inc(&sbi->s_dirs_counter);
 
-	spin_lock(sb_bgl_lock(EXT2_SB(sb), group));
+	spin_lock(sb_bgl_lock(sbi, group));
 	gdp->bg_free_inodes_count =
                 cpu_to_le16(le16_to_cpu(gdp->bg_free_inodes_count) - 1);
 	if (S_ISDIR(mode)) {
-		if (EXT2_SB(sb)->s_debts[group] < 255)
-			EXT2_SB(sb)->s_debts[group]++;
+		if (sbi->s_debts[group] < 255)
+			sbi->s_debts[group]++;
 		gdp->bg_used_dirs_count =
 			cpu_to_le16(le16_to_cpu(gdp->bg_used_dirs_count) + 1);
 	} else {
-		if (EXT2_SB(sb)->s_debts[group])
-			EXT2_SB(sb)->s_debts[group]--;
+		if (sbi->s_debts[group])
+			sbi->s_debts[group]--;
 	}
-	spin_unlock(sb_bgl_lock(EXT2_SB(sb), group));
+	spin_unlock(sb_bgl_lock(sbi, group));
 
 	sb->s_dirt = 1;
 	mark_buffer_dirty(bh2);
@@ -599,7 +599,9 @@
 	ei->i_dir_start_lookup = 0;
 	ei->i_state = EXT2_STATE_NEW;
 	ext2_set_inode_flags(inode);
-	inode->i_generation = EXT2_SB(sb)->s_next_generation++;
+	spin_lock(&sbi->s_next_gen_lock);
+	inode->i_generation = sbi->s_next_generation++;
+	spin_unlock(&sbi->s_next_gen_lock);
 	insert_inode_hash(inode);
 
 	if (DQUOT_ALLOC_INODE(inode)) {
@@ -636,10 +638,9 @@
 	int i;	
 
 #ifdef EXT2FS_DEBUG
-	struct ext2_super_block * es;
+	struct ext2_super_block *es;
 	unsigned long bitmap_count = 0;
 	struct buffer_head *bitmap_bh = NULL;
-	int i;
 
 	lock_super (sb);
 	es = EXT2_SB(sb)->s_es;
@@ -656,7 +657,7 @@
 			continue;
 
 		x = ext2_count_free(bitmap_bh, EXT2_INODES_PER_GROUP(sb) / 8);
-		printk ("group %d: stored = %d, counted = %lu\n",
+		printk("group %d: stored = %d, counted = %u\n",
 			i, le16_to_cpu(desc->bg_free_inodes_count), x);
 		bitmap_count += x;
 	}
diff -Nru a/fs/ext2/inode.c b/fs/ext2/inode.c
--- a/fs/ext2/inode.c	Tue Feb  3 19:45:16 2004
+++ b/fs/ext2/inode.c	Tue Feb  3 19:45:16 2004
@@ -659,7 +659,7 @@
 			loff_t offset, unsigned long nr_segs)
 {
 	struct file *file = iocb->ki_filp;
-	struct inode *inode = file->f_dentry->d_inode->i_mapping->host;
+	struct inode *inode = file->f_mapping->host;
 
 	return blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov,
 				offset, nr_segs, ext2_get_blocks, NULL);
diff -Nru a/fs/ext2/super.c b/fs/ext2/super.c
--- a/fs/ext2/super.c	Tue Feb  3 19:45:33 2004
+++ b/fs/ext2/super.c	Tue Feb  3 19:45:33 2004
@@ -809,6 +809,7 @@
 	}
 	sbi->s_gdb_count = db_count;
 	get_random_bytes(&sbi->s_next_generation, sizeof(u32));
+	spin_lock_init(&sbi->s_next_gen_lock);
 	/*
 	 * set up enough so that it can read an inode
 	 */
diff -Nru a/fs/ext2/xattr_security.c b/fs/ext2/xattr_security.c
--- a/fs/ext2/xattr_security.c	Tue Feb  3 19:45:26 2004
+++ b/fs/ext2/xattr_security.c	Tue Feb  3 19:45:26 2004
@@ -10,8 +10,6 @@
 #include <linux/ext2_fs.h>
 #include "xattr.h"
 
-#define XATTR_SECURITY_PREFIX "security."
-
 static size_t
 ext2_xattr_security_list(char *list, struct inode *inode,
 			const char *name, int name_len)
diff -Nru a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c
--- a/fs/ext3/ialloc.c	Tue Feb  3 19:45:18 2004
+++ b/fs/ext3/ialloc.c	Tue Feb  3 19:45:18 2004
@@ -446,8 +446,8 @@
 		return ERR_PTR(-ENOMEM);
 	ei = EXT3_I(inode);
 
-	es = EXT3_SB(sb)->s_es;
 	sbi = EXT3_SB(sb);
+	es = sbi->s_es;
 	if (S_ISDIR(mode)) {
 		if (test_opt (sb, OLDALLOC))
 			group = find_group_dir(sb, dir);
@@ -591,7 +591,9 @@
 	if (IS_DIRSYNC(inode))
 		handle->h_sync = 1;
 	insert_inode_hash(inode);
-	inode->i_generation = EXT3_SB(sb)->s_next_generation++;
+	spin_lock(&sbi->s_next_gen_lock);
+	inode->i_generation = sbi->s_next_generation++;
+	spin_unlock(&sbi->s_next_gen_lock);
 
 	ei->i_state = EXT3_STATE_NEW;
 
diff -Nru a/fs/ext3/inode.c b/fs/ext3/inode.c
--- a/fs/ext3/inode.c	Tue Feb  3 19:45:33 2004
+++ b/fs/ext3/inode.c	Tue Feb  3 19:45:33 2004
@@ -1532,7 +1532,7 @@
 			unsigned long nr_segs)
 {
 	struct file *file = iocb->ki_filp;
-	struct inode *inode = file->f_dentry->d_inode->i_mapping->host;
+	struct inode *inode = file->f_mapping->host;
 	struct ext3_inode_info *ei = EXT3_I(inode);
 	handle_t *handle = NULL;
 	int ret;
@@ -3036,6 +3036,7 @@
 		EXT3_I(inode)->i_flags |= EXT3_JOURNAL_DATA_FL;
 	else
 		EXT3_I(inode)->i_flags &= ~EXT3_JOURNAL_DATA_FL;
+	ext3_set_aops(inode);
 
 	journal_unlock_updates(journal);
 
diff -Nru a/fs/ext3/super.c b/fs/ext3/super.c
--- a/fs/ext3/super.c	Tue Feb  3 19:45:42 2004
+++ b/fs/ext3/super.c	Tue Feb  3 19:45:42 2004
@@ -31,6 +31,7 @@
 #include <linux/smp_lock.h>
 #include <linux/buffer_head.h>
 #include <linux/vfs.h>
+#include <linux/random.h>
 #include <asm/uaccess.h>
 #include "xattr.h"
 #include "acl.h"
@@ -1287,6 +1288,8 @@
 		goto failed_mount2;
 	}
 	sbi->s_gdb_count = db_count;
+	get_random_bytes(&sbi->s_next_generation, sizeof(u32));
+	spin_lock_init(&sbi->s_next_gen_lock);
 	/*
 	 * set up enough so that it can read an inode
 	 */
diff -Nru a/fs/ext3/xattr_security.c b/fs/ext3/xattr_security.c
--- a/fs/ext3/xattr_security.c	Tue Feb  3 19:45:26 2004
+++ b/fs/ext3/xattr_security.c	Tue Feb  3 19:45:26 2004
@@ -11,8 +11,6 @@
 #include <linux/ext3_fs.h>
 #include "xattr.h"
 
-#define XATTR_SECURITY_PREFIX "security."
-
 static size_t
 ext3_xattr_security_list(char *list, struct inode *inode,
 		    const char *name, int name_len)
diff -Nru a/fs/fcntl.c b/fs/fcntl.c
--- a/fs/fcntl.c	Tue Feb  3 19:45:33 2004
+++ b/fs/fcntl.c	Tue Feb  3 19:45:33 2004
@@ -229,8 +229,8 @@
 		   arg |= O_NONBLOCK;
 
 	if (arg & O_DIRECT) {
-		if (!inode->i_mapping || !inode->i_mapping->a_ops ||
-			!inode->i_mapping->a_ops->direct_IO)
+		if (!filp->f_mapping || !filp->f_mapping->a_ops ||
+			!filp->f_mapping->a_ops->direct_IO)
 				return -EINVAL;
 	}
 
@@ -609,9 +609,15 @@
 
 void kill_fasync(struct fasync_struct **fp, int sig, int band)
 {
-	read_lock(&fasync_lock);
-	__kill_fasync(*fp, sig, band);
-	read_unlock(&fasync_lock);
+	/* First a quick test without locking: usually
+	 * the list is empty.
+	 */
+	if (*fp) {
+		read_lock(&fasync_lock);
+		/* reread *fp after obtaining the lock */
+		__kill_fasync(*fp, sig, band);
+		read_unlock(&fasync_lock);
+	}
 }
 
 EXPORT_SYMBOL(kill_fasync);
diff -Nru a/fs/file_table.c b/fs/file_table.c
--- a/fs/file_table.c	Tue Feb  3 19:45:16 2004
+++ b/fs/file_table.c	Tue Feb  3 19:45:16 2004
@@ -120,6 +120,7 @@
 	filp->f_mode   = (flags+1) & O_ACCMODE;
 	atomic_set(&filp->f_count, 1);
 	filp->f_dentry = dentry;
+	filp->f_mapping = dentry->d_inode->i_mapping;
 	filp->f_uid    = current->fsuid;
 	filp->f_gid    = current->fsgid;
 	filp->f_op     = dentry->d_inode->i_fop;
diff -Nru a/fs/freevxfs/vxfs_super.c b/fs/freevxfs/vxfs_super.c
--- a/fs/freevxfs/vxfs_super.c	Tue Feb  3 19:45:41 2004
+++ b/fs/freevxfs/vxfs_super.c	Tue Feb  3 19:45:41 2004
@@ -53,6 +53,8 @@
 MODULE_DESCRIPTION("Veritas Filesystem (VxFS) driver");
 MODULE_LICENSE("Dual BSD/GPL");
 
+MODULE_ALIAS("vxfs"); /* makes mount -t vxfs autoload the module */
+
 
 static void		vxfs_put_super(struct super_block *);
 static int		vxfs_statfs(struct super_block *, struct kstatfs *);
diff -Nru a/fs/fs-writeback.c b/fs/fs-writeback.c
--- a/fs/fs-writeback.c	Tue Feb  3 19:45:43 2004
+++ b/fs/fs-writeback.c	Tue Feb  3 19:45:43 2004
@@ -514,7 +514,7 @@
  *    OSYNC_INODE:    the inode itself
  */
 
-int generic_osync_inode(struct inode *inode, int what)
+int generic_osync_inode(struct inode *inode, struct address_space *mapping, int what)
 {
 	int err = 0;
 	int need_write_inode_now = 0;
@@ -522,14 +522,14 @@
 
 	current->flags |= PF_SYNCWRITE;
 	if (what & OSYNC_DATA)
-		err = filemap_fdatawrite(inode->i_mapping);
+		err = filemap_fdatawrite(mapping);
 	if (what & (OSYNC_METADATA|OSYNC_DATA)) {
-		err2 = sync_mapping_buffers(inode->i_mapping);
+		err2 = sync_mapping_buffers(mapping);
 		if (!err)
 			err = err2;
 	}
 	if (what & OSYNC_DATA) {
-		err2 = filemap_fdatawait(inode->i_mapping);
+		err2 = filemap_fdatawait(mapping);
 		if (!err)
 			err = err2;
 	}
diff -Nru a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
--- a/fs/hugetlbfs/inode.c	Tue Feb  3 19:45:42 2004
+++ b/fs/hugetlbfs/inode.c	Tue Feb  3 19:45:42 2004
@@ -788,6 +788,7 @@
 	inode->i_nlink = 0;
 	file->f_vfsmnt = mntget(hugetlbfs_vfsmount);
 	file->f_dentry = dentry;
+	file->f_mapping = inode->i_mapping;
 	file->f_op = &hugetlbfs_file_operations;
 	file->f_mode = FMODE_WRITE | FMODE_READ;
 	return file;
diff -Nru a/fs/intermezzo/file.c b/fs/intermezzo/file.c
--- a/fs/intermezzo/file.c	Tue Feb  3 19:45:30 2004
+++ b/fs/intermezzo/file.c	Tue Feb  3 19:45:30 2004
@@ -336,7 +336,7 @@
                                 unlock_kernel();
                                 return; 
                         }
-                        error = presto_journal_close(&rec, fset, file,
+                        error = presto_journal_close(&rec, fset, fdata,
                                                      file->f_dentry,
                                                      &fdata->fd_version,
                                                      &new_file_ver);
diff -Nru a/fs/intermezzo/intermezzo_fs.h b/fs/intermezzo/intermezzo_fs.h
--- a/fs/intermezzo/intermezzo_fs.h	Tue Feb  3 19:45:17 2004
+++ b/fs/intermezzo/intermezzo_fs.h	Tue Feb  3 19:45:17 2004
@@ -603,7 +603,7 @@
 int presto_journal_open(struct rec_info *, struct presto_file_set *,
                         struct dentry *, struct presto_version *old_ver);
 int presto_journal_close(struct rec_info *rec, struct presto_file_set *,
-                         struct file *, struct dentry *,
+                         struct presto_file_data *, struct dentry *,
                          struct presto_version *old_file_ver,
                          struct presto_version *new_file_ver);
 int presto_write_lml_close(struct rec_info *rec,
diff -Nru a/fs/intermezzo/journal.c b/fs/intermezzo/journal.c
--- a/fs/intermezzo/journal.c	Tue Feb  3 19:45:16 2004
+++ b/fs/intermezzo/journal.c	Tue Feb  3 19:45:16 2004
@@ -2103,12 +2103,11 @@
 
 int
 presto_journal_close(struct rec_info *rec, struct presto_file_set *fset,
-                     struct file *file, struct dentry *dentry,
+                     struct presto_file_data *fd, struct dentry *dentry,
                      struct presto_version *old_file_ver,
                      struct presto_version *new_file_ver)
 {
         int opcode = KML_OPCODE_CLOSE;
-        struct presto_file_data *fd;
         char *buffer, *path, *logrecord, record[316];
         struct dentry *root;
         int error, size, i;
@@ -2137,7 +2136,6 @@
 
         root = fset->fset_dentry;
 
-        fd = (struct presto_file_data *)file->private_data;
         if (fd) {
                 open_ngroups = fd->fd_ngroups;
                 for (i = 0; i < fd->fd_ngroups; i++)
diff -Nru a/fs/intermezzo/presto.c b/fs/intermezzo/presto.c
--- a/fs/intermezzo/presto.c	Tue Feb  3 19:45:29 2004
+++ b/fs/intermezzo/presto.c	Tue Feb  3 19:45:29 2004
@@ -259,11 +259,8 @@
 
 
         if (info->flags & LENTO_FL_WRITE_KML) {
-                struct file file;
-                file.private_data = NULL;
-                file.f_dentry = dentry; 
                 presto_getversion(&new_ver, dentry->d_inode);
-                error = presto_journal_close(&rec, fset, &file, dentry, 
+                error = presto_journal_close(&rec, fset, NULL, dentry,
                                              &new_ver);
                 if ( error ) {
                         EXIT; 
diff -Nru a/fs/intermezzo/vfs.c b/fs/intermezzo/vfs.c
--- a/fs/intermezzo/vfs.c	Tue Feb  3 19:45:17 2004
+++ b/fs/intermezzo/vfs.c	Tue Feb  3 19:45:17 2004
@@ -321,7 +321,7 @@
         }
 
         if (fdata->fd_info.flags & LENTO_FL_KML) 
-                rc = presto_journal_close(&rec, fset, file, file->f_dentry,
+                rc = presto_journal_close(&rec, fset, fdata, file->f_dentry,
                                           &fdata->fd_version, 
                                           &fdata->fd_info.remote_version);
         if (rc) { 
@@ -431,14 +431,11 @@
 
         if ( presto_do_kml(info, dentry) ) {
                 if ((iattr->ia_valid & ATTR_SIZE) && (old_size != inode->i_size)) {
-                        struct file file;
                         /* Journal a close whenever we see a potential truncate
                         * At the receiving end, lento should explicitly remove
                         * ATTR_SIZE from the list of valid attributes */
                         presto_getversion(&new_ver, inode);
-                        file.private_data = NULL;
-                        file.f_dentry = dentry;
-                        error = presto_journal_close(&rec, fset, &file, dentry,
+                        error = presto_journal_close(&rec, fset, NULL, dentry,
                                                      &old_ver, &new_ver);
                 }
 
@@ -2086,7 +2083,9 @@
                 }
         }
 
+	/* XXX: where the fuck is ->f_vfsmnt? */
         f->f_dentry = dentry;
+        f->f_mapping = dentry->d_inode->i_mapping;
         f->f_pos = 0;
         //f->f_reada = 0;
         f->f_op = NULL;
diff -Nru a/fs/ioctl.c b/fs/ioctl.c
--- a/fs/ioctl.c	Tue Feb  3 19:45:17 2004
+++ b/fs/ioctl.c	Tue Feb  3 19:45:17 2004
@@ -22,7 +22,7 @@
 	switch (cmd) {
 		case FIBMAP:
 		{
-			struct address_space *mapping = inode->i_mapping;
+			struct address_space *mapping = filp->f_mapping;
 			int res;
 			/* do we support this mess? */
 			if (!mapping->a_ops->bmap)
diff -Nru a/fs/jbd/transaction.c b/fs/jbd/transaction.c
--- a/fs/jbd/transaction.c	Tue Feb  3 19:45:17 2004
+++ b/fs/jbd/transaction.c	Tue Feb  3 19:45:17 2004
@@ -85,7 +85,7 @@
 	int needed;
 	int nblocks = handle->h_buffer_credits;
 	transaction_t *new_transaction = NULL;
-	int ret;
+	int ret = 0;
 
 	if (nblocks > journal->j_max_transaction_buffers) {
 		printk(KERN_ERR "JBD: %s wants too many credits (%d > %d)\n",
@@ -231,7 +231,7 @@
 out:
 	if (new_transaction)
 		kfree(new_transaction);
-	return 0;
+	return ret;
 }
 
 /* Allocate a new handle.  This should probably be in a slab... */
diff -Nru a/fs/jffs/intrep.c b/fs/jffs/intrep.c
--- a/fs/jffs/intrep.c	Tue Feb  3 19:45:29 2004
+++ b/fs/jffs/intrep.c	Tue Feb  3 19:45:29 2004
@@ -3337,18 +3337,16 @@
 	int result = 0;
 	D1(int i = 1);
 
+	daemonize("jffs_gcd");
+
 	c->gc_task = current;
 
 	lock_kernel();
-	exit_mm(c->gc_task);
-
-	set_special_pids(1, 1);
 	init_completion(&c->gc_thread_comp); /* barrier */ 
 	spin_lock_irq(&current->sighand->siglock);
 	siginitsetinv (&current->blocked, sigmask(SIGHUP) | sigmask(SIGKILL) | sigmask(SIGSTOP) | sigmask(SIGCONT));
 	recalc_sigpending();
 	spin_unlock_irq(&current->sighand->siglock);
-	strcpy(current->comm, "jffs_gcd");
 
 	D1(printk (KERN_NOTICE "jffs_garbage_collect_thread(): Starting infinite loop.\n"));
 
diff -Nru a/fs/jfs/inode.c b/fs/jfs/inode.c
--- a/fs/jfs/inode.c	Tue Feb  3 19:45:16 2004
+++ b/fs/jfs/inode.c	Tue Feb  3 19:45:16 2004
@@ -306,7 +306,7 @@
 			loff_t offset, unsigned long nr_segs)
 {
 	struct file *file = iocb->ki_filp;
-	struct inode *inode = file->f_dentry->d_inode->i_mapping->host;
+	struct inode *inode = file->f_mapping->host;
 
 	return blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov,
 				offset, nr_segs, jfs_get_blocks, NULL);
diff -Nru a/fs/jfs/super.c b/fs/jfs/super.c
--- a/fs/jfs/super.c	Tue Feb  3 19:45:17 2004
+++ b/fs/jfs/super.c	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,5 @@
 /*
- *   Copyright (C) International Business Machines Corp., 2000-2003
+ *   Copyright (C) International Business Machines Corp., 2000-2004
  *   Portions Copyright (C) Christoph Hellwig, 2001-2002
  *
  *   This program is free software;  you can redistribute it and/or modify
@@ -203,7 +203,7 @@
 
 enum {
 	Opt_integrity, Opt_nointegrity, Opt_iocharset, Opt_resize,
-	Opt_errors, Opt_ignore, Opt_err,
+	Opt_resize_nosize, Opt_errors, Opt_ignore, Opt_err,
 };
 
 static match_table_t tokens = {
@@ -211,6 +211,7 @@
 	{Opt_nointegrity, "nointegrity"},
 	{Opt_iocharset, "iocharset=%s"},
 	{Opt_resize, "resize=%u"},
+	{Opt_resize_nosize, "resize"},
 	{Opt_errors, "errors=%s"},
 	{Opt_ignore, "noquota"},
 	{Opt_ignore, "quota"},
@@ -261,14 +262,16 @@
 		case Opt_resize:
 		{
 			char *resize = args[0].from;
-			if (!resize || !*resize) {
-				*newLVSize = sb->s_bdev->bd_inode->i_size >>
-					sb->s_blocksize_bits;
-				if (*newLVSize == 0)
-					printk(KERN_ERR
-					"JFS: Cannot determine volume size\n");
-			} else
-				*newLVSize = simple_strtoull(resize, &resize, 0);
+			*newLVSize = simple_strtoull(resize, &resize, 0);
+			break;
+		}
+		case Opt_resize_nosize:
+		{
+			*newLVSize = sb->s_bdev->bd_inode->i_size >>
+				sb->s_blocksize_bits;
+			if (*newLVSize == 0)
+				printk(KERN_ERR
+				       "JFS: Cannot determine volume size\n");
 			break;
 		}
 		case Opt_errors:
diff -Nru a/fs/jfs/xattr.c b/fs/jfs/xattr.c
--- a/fs/jfs/xattr.c	Tue Feb  3 19:45:17 2004
+++ b/fs/jfs/xattr.c	Tue Feb  3 19:45:17 2004
@@ -499,7 +499,7 @@
 		if (ea_buf->xattr == NULL)
 			return -ENOMEM;
 
-		ea_buf->flag |= EA_MALLOC;
+		ea_buf->flag = EA_MALLOC;
 		ea_buf->max_size = (size + sb->s_blocksize - 1) &
 		    ~(sb->s_blocksize - 1);
 
@@ -668,12 +668,13 @@
 	 */
 	if (strcmp(name, XATTR_NAME_ACL_ACCESS) == 0) {
 		acl = posix_acl_from_xattr(value, value_len);
-		if (acl < 0) {
+		if (IS_ERR(acl)) {
+			rc = PTR_ERR(acl);
 			printk(KERN_ERR "posix_acl_from_xattr returned %d\n",
 			       rc);
 			return rc;
 		}
-		if (acl > 0) {
+		if (acl) {
 			mode_t mode = inode->i_mode;
 			rc = posix_acl_equiv_mode(acl, &mode);
 			posix_acl_release(acl);
diff -Nru a/fs/libfs.c b/fs/libfs.c
--- a/fs/libfs.c	Tue Feb  3 19:45:16 2004
+++ b/fs/libfs.c	Tue Feb  3 19:45:16 2004
@@ -155,6 +155,7 @@
 			}
 			spin_unlock(&dcache_lock);
 	}
+	update_atime(dentry->d_inode);
 	return 0;
 }
 
diff -Nru a/fs/locks.c b/fs/locks.c
--- a/fs/locks.c	Tue Feb  3 19:45:42 2004
+++ b/fs/locks.c	Tue Feb  3 19:45:42 2004
@@ -1454,7 +1454,7 @@
 	 */
 	if (IS_MANDLOCK(inode) &&
 	    (inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID) {
-		struct address_space *mapping = inode->i_mapping;
+		struct address_space *mapping = filp->f_mapping;
 
 		if (!list_empty(&mapping->i_mmap_shared)) {
 			error = -EAGAIN;
@@ -1592,7 +1592,7 @@
 	 */
 	if (IS_MANDLOCK(inode) &&
 	    (inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID) {
-		struct address_space *mapping = inode->i_mapping;
+		struct address_space *mapping = filp->f_mapping;
 
 		if (!list_empty(&mapping->i_mmap_shared)) {
 			error = -EAGAIN;
diff -Nru a/fs/nfs/dir.c b/fs/nfs/dir.c
--- a/fs/nfs/dir.c	Tue Feb  3 19:45:18 2004
+++ b/fs/nfs/dir.c	Tue Feb  3 19:45:18 2004
@@ -1281,13 +1281,8 @@
 	int mode = inode->i_mode;
 	int res;
 
-	/* Are we checking permissions on anything other than lookup? */
-	if (!(mask & MAY_EXEC)) {
-		/* We only need to check permissions on file open() and access() */
-		if (!nd || !(nd->flags & (LOOKUP_OPEN|LOOKUP_ACCESS)))
-			return 0;
-	}
-
+	if (mask == 0)
+		return 0;
 	if (mask & MAY_WRITE) {
 		/*
 		 *
@@ -1305,6 +1300,12 @@
 		 */
 		if (IS_IMMUTABLE(inode))
 			return -EACCES;
+	}
+	/* Are we checking permissions on anything other than lookup/execute? */
+	if ((mask & MAY_EXEC) == 0) {
+		/* We only need to check permissions on file open() and access() */
+		if (!nd || !(nd->flags & (LOOKUP_OPEN|LOOKUP_ACCESS)))
+			return 0;
 	}
 
 	lock_kernel();
diff -Nru a/fs/nfs/file.c b/fs/nfs/file.c
--- a/fs/nfs/file.c	Tue Feb  3 19:45:33 2004
+++ b/fs/nfs/file.c	Tue Feb  3 19:45:33 2004
@@ -266,7 +266,7 @@
 int
 nfs_lock(struct file *filp, int cmd, struct file_lock *fl)
 {
-	struct inode * inode = filp->f_dentry->d_inode;
+	struct inode * inode = filp->f_mapping->host;
 	int	status = 0;
 	int	status2;
 
@@ -309,13 +309,13 @@
 	 * Flush all pending writes before doing anything
 	 * with locks..
 	 */
-	status = filemap_fdatawrite(inode->i_mapping);
+	status = filemap_fdatawrite(filp->f_mapping);
 	down(&inode->i_sem);
 	status2 = nfs_wb_all(inode);
 	if (!status)
 		status = status2;
 	up(&inode->i_sem);
-	status2 = filemap_fdatawait(inode->i_mapping);
+	status2 = filemap_fdatawait(filp->f_mapping);
 	if (!status)
 		status = status2;
 	if (status < 0)
@@ -335,11 +335,11 @@
 	 */
  out_ok:
 	if ((IS_SETLK(cmd) || IS_SETLKW(cmd)) && fl->fl_type != F_UNLCK) {
-		filemap_fdatawrite(inode->i_mapping);
+		filemap_fdatawrite(filp->f_mapping);
 		down(&inode->i_sem);
 		nfs_wb_all(inode);      /* we may have slept */
 		up(&inode->i_sem);
-		filemap_fdatawait(inode->i_mapping);
+		filemap_fdatawait(filp->f_mapping);
 		nfs_zap_caches(inode);
 	}
 	return status;
diff -Nru a/fs/nfs/inode.c b/fs/nfs/inode.c
--- a/fs/nfs/inode.c	Tue Feb  3 19:45:37 2004
+++ b/fs/nfs/inode.c	Tue Feb  3 19:45:37 2004
@@ -791,6 +791,8 @@
 	goto out;
 }
 
+#define NFS_VALID_ATTRS (ATTR_MODE|ATTR_UID|ATTR_GID|ATTR_SIZE|ATTR_ATIME|ATTR_ATIME_SET|ATTR_MTIME|ATTR_MTIME_SET)
+
 int
 nfs_setattr(struct dentry *dentry, struct iattr *attr)
 {
@@ -798,6 +800,11 @@
 	struct nfs_fattr fattr;
 	int error;
 
+	/* Optimization: if the end result is no change, don't RPC */
+	attr->ia_valid &= NFS_VALID_ATTRS;
+	if (attr->ia_valid == 0)
+		return 0;
+
 	lock_kernel();
 
 	/*
@@ -813,6 +820,8 @@
 
 	if (!S_ISREG(inode->i_mode)) {
 		attr->ia_valid &= ~ATTR_SIZE;
+		if (attr->ia_valid == 0)
+			goto out;
 	} else {
 		filemap_fdatawrite(inode->i_mapping);
 		error = nfs_wb_all(inode);
diff -Nru a/fs/nfs/write.c b/fs/nfs/write.c
--- a/fs/nfs/write.c	Tue Feb  3 19:45:35 2004
+++ b/fs/nfs/write.c	Tue Feb  3 19:45:35 2004
@@ -228,8 +228,19 @@
 	unsigned long end_index;
 	unsigned offset = PAGE_CACHE_SIZE;
 	loff_t i_size = i_size_read(inode);
+	int inode_referenced = 0;
 	int err;
 
+	/*
+	 * Note: We need to ensure that we have a reference to the inode
+	 *       if we are to do asynchronous writes. If not, waiting
+	 *       in nfs_wait_on_request() may deadlock with clear_inode().
+	 *
+	 *       If igrab() fails here, then it is in any case safe to
+	 *       call nfs_wb_page(), since there will be no pending writes.
+	 */
+	if (igrab(inode) != 0)
+		inode_referenced = 1;
 	end_index = i_size >> PAGE_CACHE_SHIFT;
 
 	/* Ensure we've flushed out any previous writes */
@@ -247,7 +258,8 @@
 		goto out;
 do_it:
 	lock_kernel();
-	if (NFS_SERVER(inode)->wsize >= PAGE_CACHE_SIZE && !IS_SYNC(inode)) {
+	if (NFS_SERVER(inode)->wsize >= PAGE_CACHE_SIZE && !IS_SYNC(inode) &&
+			inode_referenced) {
 		err = nfs_writepage_async(NULL, inode, page, 0, offset);
 		if (err >= 0)
 			err = 0;
@@ -259,6 +271,8 @@
 	unlock_kernel();
 out:
 	unlock_page(page);
+	if (inode_referenced)
+		iput(inode);
 	return err; 
 }
 
@@ -1074,9 +1088,12 @@
 
 	spin_lock(&nfs_wreq_lock);
 	res = nfs_scan_commit(inode, &head, file, idx_start, npages);
-	spin_unlock(&nfs_wreq_lock);
-	if (res)
+	if (res) {
+		res += nfs_scan_commit(inode, &head, NULL, 0, 0);
+		spin_unlock(&nfs_wreq_lock);
 		error = nfs_commit_list(&head, how);
+	} else
+		spin_unlock(&nfs_wreq_lock);
 	if (error < 0)
 		return error;
 	return res;
diff -Nru a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
--- a/fs/nfsd/nfsfh.c	Tue Feb  3 19:45:17 2004
+++ b/fs/nfsd/nfsfh.c	Tue Feb  3 19:45:17 2004
@@ -164,6 +164,9 @@
 			goto out;
 		}
 
+		/* Set user creds for this exportpoint */
+		nfsd_setuser(rqstp, exp);
+
 		/*
 		 * Look up the dentry using the NFS file handle.
 		 */
@@ -224,9 +227,6 @@
 	inode = dentry->d_inode;
 
 
-	/* Set user creds for this exportpoint */
-	nfsd_setuser(rqstp, exp);
-
 	/* Type check. The correct error return for type mismatches
 	 * does not seem to be generally agreed upon. SunOS seems to
 	 * use EISDIR if file isn't S_IFREG; a comment in the NFSv3
@@ -489,3 +489,21 @@
 	return;
 }
 
+/*
+ * Shorthand for dprintk()'s
+ */
+char * SVCFH_fmt(struct svc_fh *fhp)
+{
+	struct knfsd_fh *fh = &fhp->fh_handle;
+
+	static char buf[80];
+	sprintf(buf, "%d: %08x %08x %08x %08x %08x %08x",
+		fh->fh_size,
+		fh->fh_base.fh_pad[0],
+		fh->fh_base.fh_pad[1],
+		fh->fh_base.fh_pad[2],
+		fh->fh_base.fh_pad[3],
+		fh->fh_base.fh_pad[4],
+		fh->fh_base.fh_pad[5]);
+	return buf;
+}
diff -Nru a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c
--- a/fs/nfsd/nfsxdr.c	Tue Feb  3 19:45:16 2004
+++ b/fs/nfsd/nfsxdr.c	Tue Feb  3 19:45:16 2004
@@ -130,6 +130,17 @@
 		iap->ia_valid |= ATTR_MTIME | ATTR_MTIME_SET;
 		iap->ia_mtime.tv_sec = tmp;
 		iap->ia_mtime.tv_nsec = tmp1 * 1000; 
+		/*
+		 * Passing the invalid value useconds=1000000 for mtime
+		 * is a Sun convention for "set both mtime and atime to
+		 * current server time".  It's needed to make permissions
+		 * checks for the "touch" program across v2 mounts to
+		 * Solaris and Irix boxes work correctly. See description of
+		 * sattr in section 6.1 of "NFS Illustrated" by
+		 * Brent Callaghan, Addison-Wesley, ISBN 0-201-32750-5
+		 */
+		if (tmp1 == 1000000)
+			iap->ia_valid &= ~(ATTR_ATIME_SET|ATTR_MTIME_SET);
 	}
 	return p;
 }
diff -Nru a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
--- a/fs/nfsd/vfs.c	Tue Feb  3 19:45:17 2004
+++ b/fs/nfsd/vfs.c	Tue Feb  3 19:45:17 2004
@@ -43,6 +43,7 @@
 #endif /* CONFIG_NFSD_V3 */
 #include <linux/nfsd/nfsfh.h>
 #include <linux/quotaops.h>
+#include <linux/dnotify.h>
 
 #include <asm/uaccess.h>
 
@@ -161,7 +162,7 @@
 			struct dentry *dp;
 			struct vfsmount *mnt = mntget(exp->ex_mnt);
 			dentry = dget(dparent);
-			while(follow_up(&mnt, &dentry))
+			while(dentry == mnt->mnt_root && follow_up(&mnt, &dentry))
 				;
 			dp = dget_parent(dentry);
 			dput(dentry);
@@ -173,7 +174,7 @@
 				err = PTR_ERR(exp2);
 				dput(dentry);
 				mntput(mnt);
-				goto out;
+				goto out_nfserr;
 			}
 			if (!exp2) {
 				dput(dentry);
@@ -680,6 +681,7 @@
 		nfsdstats.io_read += err;
 		*count = err;
 		err = 0;
+		dnotify_parent(file.f_dentry, DN_ACCESS);
 	} else 
 		err = nfserrno(err);
 out_close:
@@ -745,9 +747,11 @@
 	/* Write the data. */
 	oldfs = get_fs(); set_fs(KERNEL_DS);
 	err = vfs_writev(&file, vec, vlen, &offset);
-	if (err >= 0)
-		nfsdstats.io_write += cnt;
 	set_fs(oldfs);
+	if (err >= 0) {
+		nfsdstats.io_write += cnt;
+		dnotify_parent(file.f_dentry, DN_MODIFY);
+	}
 
 	/* clear setuid/setgid flag after write */
 	if (err >= 0 && (inode->i_mode & (S_ISUID | S_ISGID))) {
diff -Nru a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
--- a/fs/ntfs/ChangeLog	Tue Feb  3 19:45:17 2004
+++ b/fs/ntfs/ChangeLog	Tue Feb  3 19:45:17 2004
@@ -20,6 +20,14 @@
 	  sufficient for synchronisation here. We then just need to make sure
 	  ntfs_readpage/writepage/truncate interoperate properly with us.
 
+2.1.6 - Fix minor bug in handling of compressed directories.
+
+	- Fix bug in handling of compressed directories.  A compressed
+	  directory is not really compressed so when we set the ->i_blocks
+	  field of a compressed directory inode we were setting it from the
+	  non-existing field ni->itype.compressed.size which gave random
+	  results...  For directories we now always use ni->allocated_size.
+
 2.1.5 - Fix minor bug in attribute list attribute handling.
 
 	- Fix bug in attribute list handling.  Actually it is not as much a bug
diff -Nru a/fs/ntfs/Makefile b/fs/ntfs/Makefile
--- a/fs/ntfs/Makefile	Tue Feb  3 19:45:29 2004
+++ b/fs/ntfs/Makefile	Tue Feb  3 19:45:29 2004
@@ -5,7 +5,7 @@
 ntfs-objs := aops.o attrib.o compress.o debug.o dir.o file.o inode.o mft.o \
 	     mst.o namei.o super.o sysctl.o time.o unistr.o upcase.o
 
-EXTRA_CFLAGS = -DNTFS_VERSION=\"2.1.5\"
+EXTRA_CFLAGS = -DNTFS_VERSION=\"2.1.6\"
 
 ifeq ($(CONFIG_NTFS_DEBUG),y)
 EXTRA_CFLAGS += -DDEBUG
diff -Nru a/fs/ntfs/inode.c b/fs/ntfs/inode.c
--- a/fs/ntfs/inode.c	Tue Feb  3 19:45:42 2004
+++ b/fs/ntfs/inode.c	Tue Feb  3 19:45:42 2004
@@ -1,7 +1,7 @@
 /**
  * inode.c - NTFS kernel inode handling. Part of the Linux-NTFS project.
  *
- * Copyright (c) 2001-2003 Anton Altaparmakov
+ * Copyright (c) 2001-2004 Anton Altaparmakov
  *
  * This program/include file is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as published
@@ -1046,7 +1046,7 @@
 	 * sizes of all non-resident attributes present to give us the Linux
 	 * correct size that should go into i_blocks (after division by 512).
 	 */
-	if (!NInoCompressed(ni))
+	if (S_ISDIR(vi->i_mode) || !NInoCompressed(ni))
 		vi->i_blocks = ni->allocated_size >> 9;
 	else
 		vi->i_blocks = ni->itype.compressed.size >> 9;
diff -Nru a/fs/open.c b/fs/open.c
--- a/fs/open.c	Tue Feb  3 19:45:16 2004
+++ b/fs/open.c	Tue Feb  3 19:45:16 2004
@@ -776,7 +776,8 @@
 			goto cleanup_file;
 	}
 
-	file_ra_state_init(&f->f_ra, inode->i_mapping);
+	f->f_mapping = inode->i_mapping;
+	file_ra_state_init(&f->f_ra, f->f_mapping);
 	f->f_dentry = dentry;
 	f->f_vfsmnt = mnt;
 	f->f_pos = 0;
@@ -792,8 +793,8 @@
 
 	/* NB: we're sure to have correct a_ops only after f_op->open */
 	if (f->f_flags & O_DIRECT) {
-		if (!inode->i_mapping || !inode->i_mapping->a_ops ||
-			!inode->i_mapping->a_ops->direct_IO) {
+		if (!f->f_mapping || !f->f_mapping->a_ops ||
+			!f->f_mapping->a_ops->direct_IO) {
 				fput(f);
 				f = ERR_PTR(-EINVAL);
 		}
diff -Nru a/fs/pipe.c b/fs/pipe.c
--- a/fs/pipe.c	Tue Feb  3 19:45:28 2004
+++ b/fs/pipe.c	Tue Feb  3 19:45:28 2004
@@ -650,6 +650,7 @@
 	d_add(dentry, inode);
 	f1->f_vfsmnt = f2->f_vfsmnt = mntget(mntget(pipe_mnt));
 	f1->f_dentry = f2->f_dentry = dget(dentry);
+	f1->f_mapping = f2->f_mapping = inode->i_mapping;
 
 	/* read file */
 	f1->f_pos = f2->f_pos = 0;
diff -Nru a/fs/proc/base.c b/fs/proc/base.c
--- a/fs/proc/base.c	Tue Feb  3 19:45:30 2004
+++ b/fs/proc/base.c	Tue Feb  3 19:45:30 2004
@@ -1669,14 +1669,26 @@
  * tasklist lock while doing this, and we must release it before
  * we actually do the filldir itself, so we use a temp buffer..
  */
-static int get_tgid_list(int index, unsigned int *tgids)
+static int get_tgid_list(int index, unsigned long version, unsigned int *tgids)
 {
 	struct task_struct *p;
 	int nr_tgids = 0;
 
 	index--;
 	read_lock(&tasklist_lock);
-	for_each_process(p) {
+	p = NULL;
+	if (version) {
+		p = find_task_by_pid(version);
+		if (!thread_group_leader(p))
+			p = NULL;
+	}
+
+	if (p)
+		index = 0;
+	else
+		p = next_task(&init_task);
+
+	for ( ; p != &init_task; p = next_task(p)) {
 		int tgid = p->pid;
 		if (!pid_alive(p))
 			continue;
@@ -1739,7 +1751,10 @@
 		nr++;
 	}
 
-	nr_tgids = get_tgid_list(nr, tgid_array);
+	/*
+	 * f_version caches the last tgid which was returned from readdir
+	 */
+	nr_tgids = get_tgid_list(nr, filp->f_version, tgid_array);
 
 	for (i = 0; i < nr_tgids; i++) {
 		int tgid = tgid_array[i];
@@ -1748,8 +1763,10 @@
 
 		do buf[--j] = '0' + (tgid % 10); while (tgid/=10);
 
-		if (filldir(dirent, buf+j, PROC_NUMBUF-j, filp->f_pos, ino, DT_DIR) < 0)
+		if (filldir(dirent, buf+j, PROC_NUMBUF-j, filp->f_pos, ino, DT_DIR) < 0) {
+			filp->f_version = tgid;
 			break;
+		}
 		filp->f_pos++;
 	}
 	return 0;
diff -Nru a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c
--- a/fs/proc/proc_devtree.c	Tue Feb  3 19:45:35 2004
+++ b/fs/proc/proc_devtree.c	Tue Feb  3 19:45:35 2004
@@ -11,6 +11,20 @@
 #include <asm/prom.h>
 #include <asm/uaccess.h>
 
+#ifndef HAVE_ARCH_DEVTREE_FIXUPS
+static inline void set_node_proc_entry(struct device_node *np, struct proc_dir_entry *de)
+{
+}
+
+static void inline set_node_name_link(struct device_node *np, struct proc_dir_entry *de)
+{
+}
+
+static void inline set_node_addr_link(struct device_node *np, struct proc_dir_entry *de)
+{
+}
+#endif
+
 static struct proc_dir_entry *proc_device_tree;
 
 /*
@@ -44,7 +58,7 @@
 /*
  * Process a node, adding entries for its children and its properties.
  */
-static void add_node(struct device_node *np, struct proc_dir_entry *de)
+void proc_device_tree_add_node(struct device_node *np, struct proc_dir_entry *de)
 {
 	struct property *pp;
 	struct proc_dir_entry *ent;
@@ -53,6 +67,7 @@
 	int l;
 	struct proc_dir_entry *list, **lastp, *al;
 
+	set_node_proc_entry(np, de);
 	lastp = &list;
 	for (pp = np->properties; pp != 0; pp = pp->next) {
 		/*
@@ -70,7 +85,8 @@
 		*lastp = ent;
 		lastp = &ent->next;
 	}
-	for (child = np->child; child != 0; child = child->sibling) {
+	child = NULL;
+	while ((child = of_get_next_child(np, child))) {
 		p = strrchr(child->full_name, '/');
 		if (p == 0)
 			p = child->full_name;
@@ -85,7 +101,7 @@
 			break;
 		*lastp = ent;
 		lastp = &ent->next;
-		add_node(child, ent);
+		proc_device_tree_add_node(child, ent);
 
 		/*
 		 * If we left the address part on the name, consider
@@ -98,26 +114,32 @@
 		 * If this is the first node with a given name property,
 		 * add a symlink with the name property as its name.
 		 */
-		for (sib = np->child; sib != child; sib = sib->sibling)
+		sib = NULL;
+		while ((sib = of_get_next_child(np, sib)) && sib != child)
 			if (sib->name && strcmp(sib->name, child->name) == 0)
 				break;
 		if (sib == child && strncmp(p, child->name, l) != 0) {
 			al = proc_symlink(child->name, de, ent->name);
-			if (al == 0)
+			if (al == 0) {
+				of_node_put(sib);
 				break;
+			}
+			set_node_name_link(child, al);
 			*lastp = al;
 			lastp = &al->next;
 		}
-
+		of_node_put(sib);
 		/*
 		 * Add another directory with the @address part as its name.
 		 */
 		al = proc_symlink(at, de, ent->name);
 		if (al == 0)
 			break;
+		set_node_addr_link(child, al);
 		*lastp = al;
 		lastp = &al->next;
 	}
+	of_node_put(child);
 	*lastp = 0;
 	de->subdir = list;
 }
@@ -133,10 +155,11 @@
 	proc_device_tree = proc_mkdir("device-tree", 0);
 	if (proc_device_tree == 0)
 		return;
-	root = find_path_device("/");
+	root = of_find_node_by_path("/");
 	if (root == 0) {
 		printk(KERN_ERR "/proc/device-tree: can't find root\n");
 		return;
 	}
-	add_node(root, proc_device_tree);
+	proc_device_tree_add_node(root, proc_device_tree);
+	of_node_put(root);
 }
diff -Nru a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
--- a/fs/proc/proc_misc.c	Tue Feb  3 19:45:17 2004
+++ b/fs/proc/proc_misc.c	Tue Feb  3 19:45:17 2004
@@ -378,10 +378,9 @@
 	jif = ((u64)now.tv_sec * HZ) + (now.tv_usec/(1000000/HZ)) - jif;
 	do_div(jif, HZ);
 
-	for (i = 0; i < NR_CPUS; i++) {
+	for_each_cpu(i) {
 		int j;
 
-		if (!cpu_online(i)) continue;
 		user += kstat_cpu(i).cpustat.user;
 		nice += kstat_cpu(i).cpustat.nice;
 		system += kstat_cpu(i).cpustat.system;
@@ -401,8 +400,7 @@
 		jiffies_to_clock_t(iowait),
 		jiffies_to_clock_t(irq),
 		jiffies_to_clock_t(softirq));
-	for (i = 0; i < NR_CPUS; i++){
-		if (!cpu_online(i)) continue;
+	for_each_online_cpu(i) {
 		seq_printf(p, "cpu%d %u %u %u %u %u %u %u\n",
 			i,
 			jiffies_to_clock_t(kstat_cpu(i).cpustat.user),
diff -Nru a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
--- a/fs/proc/task_mmu.c	Tue Feb  3 19:45:17 2004
+++ b/fs/proc/task_mmu.c	Tue Feb  3 19:45:17 2004
@@ -76,22 +76,6 @@
 	return size;
 }
 
-#ifdef AT_SYSINFO_EHDR
-
-static struct vm_area_struct gate_vmarea = {
-	/* Do _not_ mark this area as readable, cuz not the entire range may be readable
-	   (e.g., due to execute-only pages or holes) and the tools that read
-	   /proc/PID/maps should read the interesting bits from the gate-DSO file
-	   instead.  */
-	.vm_start = FIXADDR_USER_START,
-	.vm_end = FIXADDR_USER_END
-};
-
-# define gate_map()	&gate_vmarea
-#else
-# define gate_map()	NULL
-#endif
-
 static int show_map(struct seq_file *m, void *v)
 {
 	struct vm_area_struct *map = v;
@@ -146,15 +130,16 @@
 		up_read(&mm->mmap_sem);
 		mmput(mm);
 		if (l == -1)
-			map = gate_map();
+			map = get_gate_vma(task);
 	}
 	return map;
 }
 
 static void m_stop(struct seq_file *m, void *v)
 {
+	struct task_struct *task = m->private;
 	struct vm_area_struct *map = v;
-	if (map && map != gate_map()) {
+	if (map && map != get_gate_vma(task)) {
 		struct mm_struct *mm = map->vm_mm;
 		up_read(&mm->mmap_sem);
 		mmput(mm);
@@ -163,13 +148,14 @@
 
 static void *m_next(struct seq_file *m, void *v, loff_t *pos)
 {
+	struct task_struct *task = m->private;
 	struct vm_area_struct *map = v;
 	(*pos)++;
 	if (map->vm_next)
 		return map->vm_next;
 	m_stop(m, v);
-	if (map != gate_map())
-		return gate_map();
+	if (map != get_gate_vma(task))
+		return get_gate_vma(task);
 	return NULL;
 }
 
diff -Nru a/fs/read_write.c b/fs/read_write.c
--- a/fs/read_write.c	Tue Feb  3 19:45:30 2004
+++ b/fs/read_write.c	Tue Feb  3 19:45:30 2004
@@ -28,7 +28,7 @@
 loff_t generic_file_llseek(struct file *file, loff_t offset, int origin)
 {
 	long long retval;
-	struct inode *inode = file->f_dentry->d_inode->i_mapping->host;
+	struct inode *inode = file->f_mapping->host;
 
 	down(&inode->i_sem);
 	switch (origin) {
@@ -559,7 +559,9 @@
 		goto fput_in;
 	if (!in_file->f_op || !in_file->f_op->sendfile)
 		goto fput_in;
-	retval = locks_verify_area(FLOCK_VERIFY_READ, in_inode, in_file, in_file->f_pos, count);
+	if (!ppos)
+		ppos = &in_file->f_pos;
+	retval = locks_verify_area(FLOCK_VERIFY_READ, in_inode, in_file, *ppos, count);
 	if (retval)
 		goto fput_in;
 
@@ -587,9 +589,6 @@
 	retval = security_file_permission (out_file, MAY_WRITE);
 	if (retval)
 		goto fput_out;
-
-	if (!ppos)
-		ppos = &in_file->f_pos;
 
 	if (!max)
 		max = min(in_inode->i_sb->s_maxbytes, out_inode->i_sb->s_maxbytes);
diff -Nru a/fs/reiserfs/file.c b/fs/reiserfs/file.c
--- a/fs/reiserfs/file.c	Tue Feb  3 19:45:16 2004
+++ b/fs/reiserfs/file.c	Tue Feb  3 19:45:16 2004
@@ -8,6 +8,7 @@
 #include <linux/smp_lock.h>
 #include <asm/uaccess.h>
 #include <linux/pagemap.h>
+#include <linux/writeback.h>
 
 /*
 ** We pack the tails of files on file close, not at the time they are written.
@@ -1052,7 +1053,7 @@
     /* Check if we can write to specified region of file, file
        is not overly big and this kind of stuff. Adjust pos and
        count, if needed */
-    res = generic_write_checks(inode, file, &pos, &count, 0);
+    res = generic_write_checks(file, &pos, &count, 0);
     if (res)
 	goto out;
 
@@ -1176,10 +1177,11 @@
 	buf += write_bytes;
 	*ppos = pos += write_bytes;
 	count -= write_bytes;
+	balance_dirty_pages_ratelimited(inode->i_mapping);
     }
 
     if ((file->f_flags & O_SYNC) || IS_SYNC(inode))
-	res = generic_osync_inode(inode, OSYNC_METADATA|OSYNC_DATA);
+	res = generic_osync_inode(inode, file->f_mapping, OSYNC_METADATA|OSYNC_DATA);
 
     up(&inode->i_sem);
     return (already_written != 0)?already_written:res;
diff -Nru a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
--- a/fs/reiserfs/inode.c	Tue Feb  3 19:45:17 2004
+++ b/fs/reiserfs/inode.c	Tue Feb  3 19:45:17 2004
@@ -2375,7 +2375,7 @@
 			      loff_t offset, unsigned long nr_segs)
 {
     struct file *file = iocb->ki_filp;
-    struct inode *inode = file->f_dentry->d_inode->i_mapping->host;
+    struct inode *inode = file->f_mapping->host;
 
     return blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov,
 			      offset, nr_segs, reiserfs_get_blocks_direct_io, NULL);
diff -Nru a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
--- a/fs/reiserfs/journal.c	Tue Feb  3 19:45:30 2004
+++ b/fs/reiserfs/journal.c	Tue Feb  3 19:45:30 2004
@@ -193,6 +193,9 @@
 static void cleanup_bitmap_list(struct super_block *p_s_sb,
                                 struct reiserfs_list_bitmap *jb) {
   int i;
+  if (jb->bitmaps == NULL)
+    return;
+
   for (i = 0 ; i < SB_BMAP_NR(p_s_sb) ; i++) {
     if (jb->bitmaps[i]) {
       free_bitmap_node(p_s_sb, jb->bitmaps[i]) ;
@@ -1937,18 +1940,13 @@
 
 	journal -> j_dev_file = filp_open( jdev_name, 0, 0 );
 	if( !IS_ERR( journal -> j_dev_file ) ) {
-		struct inode *jdev_inode;
-
-		jdev_inode = journal -> j_dev_file -> f_dentry -> d_inode;
-		journal -> j_dev_bd = jdev_inode -> i_bdev;
+		struct inode *jdev_inode = journal->j_dev_file->f_mapping->host;
 		if( !S_ISBLK( jdev_inode -> i_mode ) ) {
 			printk( "journal_init_dev: '%s' is not a block device\n", jdev_name );
 			result = -ENOTBLK;
-		} else if( jdev_inode -> i_bdev == NULL ) {
-			printk( "journal_init_dev: bdev uninitialized for '%s'\n", jdev_name );
-			result = -ENOMEM;
 		} else  {
 			/* ok */
+			journal->j_dev_bd = I_BDEV(jdev_inode);
 			set_blocksize(journal->j_dev_bd, super->s_blocksize);
 		}
 	} else {
diff -Nru a/fs/smbfs/file.c b/fs/smbfs/file.c
--- a/fs/smbfs/file.c	Tue Feb  3 19:45:42 2004
+++ b/fs/smbfs/file.c	Tue Feb  3 19:45:42 2004
@@ -64,11 +64,8 @@
 		DENTRY_PATH(dentry), count, offset, rsize);
 
 	result = smb_open(dentry, SMB_O_RDONLY);
-	if (result < 0) {
-		PARANOIA("%s/%s open failed, error=%d\n",
-			 DENTRY_PATH(dentry), result);
+	if (result < 0)
 		goto io_error;
-	}
 
 	do {
 		if (count < rsize)
diff -Nru a/fs/smbfs/proc.c b/fs/smbfs/proc.c
--- a/fs/smbfs/proc.c	Tue Feb  3 19:45:17 2004
+++ b/fs/smbfs/proc.c	Tue Feb  3 19:45:17 2004
@@ -1181,11 +1181,8 @@
 		result = 0;
 		if (!smb_is_open(inode))
 			result = smb_proc_open(server, dentry, wish);
-		if (result) {
-			PARANOIA("%s/%s open failed, result=%d\n",
-				 DENTRY_PATH(dentry), result);
+		if (result)
 			goto out;
-		}
 		/*
 		 * A successful open means the path is still valid ...
 		 */
diff -Nru a/fs/stat.c b/fs/stat.c
--- a/fs/stat.c	Tue Feb  3 19:45:17 2004
+++ b/fs/stat.c	Tue Feb  3 19:45:17 2004
@@ -320,7 +320,7 @@
 	return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
 }
 
-asmlinkage long sys_stat64(char __user * filename, struct stat64 __user * statbuf, long flags)
+asmlinkage long sys_stat64(char __user * filename, struct stat64 __user * statbuf)
 {
 	struct kstat stat;
 	int error = vfs_stat(filename, &stat);
@@ -330,7 +330,7 @@
 
 	return error;
 }
-asmlinkage long sys_lstat64(char __user * filename, struct stat64 __user * statbuf, long flags)
+asmlinkage long sys_lstat64(char __user * filename, struct stat64 __user * statbuf)
 {
 	struct kstat stat;
 	int error = vfs_lstat(filename, &stat);
@@ -340,7 +340,7 @@
 
 	return error;
 }
-asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf, long flags)
+asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf)
 {
 	struct kstat stat;
 	int error = vfs_fstat(fd, &stat);
diff -Nru a/fs/xfs/Makefile b/fs/xfs/Makefile
--- a/fs/xfs/Makefile	Tue Feb  3 19:45:34 2004
+++ b/fs/xfs/Makefile	Tue Feb  3 19:45:34 2004
@@ -30,17 +30,33 @@
 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
 #
 
-EXTRA_CFLAGS +=	 -Ifs/xfs -funsigned-char
+EXTRA_CFLAGS +=	 -Ifs/xfs -Ifs/xfs/linux -funsigned-char
 
 ifeq ($(CONFIG_XFS_DEBUG),y)
 	EXTRA_CFLAGS += -g -DSTATIC="" -DDEBUG -DXFSDEBUG
+	EXTRA_CFLAGS += -DPAGEBUF_LOCK_TRACKING
 endif
-ifeq ($(CONFIG_PAGEBUF_DEBUG),y)
+ifeq ($(CONFIG_XFS_TRACE),y)
+	EXTRA_CFLAGS += -DXFS_ALLOC_TRACE
+	EXTRA_CFLAGS += -DXFS_ATTR_TRACE
+	EXTRA_CFLAGS += -DXFS_BLI_TRACE
+	EXTRA_CFLAGS += -DXFS_BMAP_TRACE
+	EXTRA_CFLAGS += -DXFS_BMBT_TRACE
+	EXTRA_CFLAGS += -DXFS_DIR_TRACE
+	EXTRA_CFLAGS += -DXFS_DIR2_TRACE
+	EXTRA_CFLAGS += -DXFS_DQUOT_TRACE
+	EXTRA_CFLAGS += -DXFS_ILOCK_TRACE
+	EXTRA_CFLAGS += -DXFS_LOG_TRACE
+	EXTRA_CFLAGS += -DXFS_RW_TRACE
 	EXTRA_CFLAGS += -DPAGEBUF_TRACE
+	# EXTRA_CFLAGS += -DXFS_VNODE_TRACE
 endif
 
 obj-$(CONFIG_XFS_FS)		+= xfs.o
 
+ifneq ($(CONFIG_XFS_DMAPI),y)
+xfs-y				+= xfs_dmops.o
+endif
 
 xfs-$(CONFIG_XFS_QUOTA)		+= $(addprefix quota/, \
 				   xfs_dquot.o \
@@ -49,9 +65,10 @@
 				   xfs_qm_syscalls.o \
 				   xfs_qm_bhv.o \
 				   xfs_qm.o)
-
 ifeq ($(CONFIG_XFS_QUOTA),y)
 xfs-$(CONFIG_PROC_FS)		+= quota/xfs_qm_stats.o
+else
+xfs-y				+= xfs_qmops.o
 endif
 
 xfs-$(CONFIG_XFS_RT)		+= xfs_rtalloc.o
@@ -66,6 +83,7 @@
 				   xfs_alloc_btree.o \
 				   xfs_attr.o \
 				   xfs_attr_leaf.o \
+				   xfs_behavior.o \
 				   xfs_bit.o \
 				   xfs_bmap.o \
 				   xfs_bmap_btree.o \
@@ -79,7 +97,6 @@
 				   xfs_dir2_leaf.o \
 				   xfs_dir2_node.o \
 				   xfs_dir2_sf.o \
-				   xfs_dir2_trace.o \
 				   xfs_dir_leaf.o \
 				   xfs_error.o \
 				   xfs_extfree_item.o \
@@ -90,6 +107,7 @@
 				   xfs_inode.o \
 				   xfs_inode_item.o \
 				   xfs_iocore.o \
+				   xfs_iomap.o \
 				   xfs_itable.o \
 				   xfs_dfrag.o \
 				   xfs_log.o \
@@ -108,20 +126,17 @@
 				   xfs_vnodeops.o \
 				   xfs_rw.o
 
-# Objects in pagebuf/
-xfs-y				+= $(addprefix pagebuf/, \
-				   page_buf.o \
-				   page_buf_locking.o)
+xfs-$(CONFIG_XFS_TRACE)		+= xfs_dir2_trace.o
 
 # Objects in linux/
 xfs-y				+= $(addprefix linux/, \
+				   mrlock.o \
 				   xfs_aops.o \
-				   xfs_behavior.o \
+				   xfs_buf.o \
 				   xfs_file.o \
 				   xfs_fs_subr.o \
 				   xfs_globals.o \
 				   xfs_ioctl.o \
-				   xfs_iomap.o \
 				   xfs_iops.o \
 				   xfs_lrw.o \
 				   xfs_super.o \
@@ -131,27 +146,9 @@
 # Objects in support/
 xfs-y				+= $(addprefix support/, \
 				   debug.o \
-				   ktrace.o \
 				   move.o \
-				   mrlock.o \
 				   qsort.o \
 				   uuid.o)
 
-# Quota and DMAPI stubs
-xfs-y				+= xfs_dmops.o \
-				   xfs_qmops.o
-
-# If both xfs and kdb modules are built in then xfsidbg is built in.  If xfs is
-# a module and kdb modules are being compiled then xfsidbg must be a module, to
-# follow xfs.  If xfs is built in then xfsidbg tracks the kdb module state.
-# This must come after the main xfs code so xfs initialises before xfsidbg.
-# KAO
-ifneq ($(CONFIG_KDB_MODULES),)
-  ifeq ($(CONFIG_XFS_FS),y)
-    obj-$(CONFIG_KDB_MODULES)	+= xfsidbg.o
-  else
-    obj-$(CONFIG_XFS_FS)	+= xfsidbg.o
-  endif
-endif
+xfs-$(CONFIG_XFS_TRACE)		+= support/ktrace.o
 
-CFLAGS_xfsidbg.o += -Iarch/$(ARCH)/kdb
diff -Nru a/fs/xfs/linux/kmem.h b/fs/xfs/linux/kmem.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/fs/xfs/linux/kmem.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+#ifndef __XFS_SUPPORT_KMEM_H__
+#define __XFS_SUPPORT_KMEM_H__
+
+#include <linux/mm.h>
+#include <linux/highmem.h>
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
+
+/*
+ * Cutoff point to use vmalloc instead of kmalloc.
+ */
+#define MAX_SLAB_SIZE	0x10000
+
+/*
+ * XFS uses slightly different names for these due to the
+ * IRIX heritage.
+ */
+#define	kmem_zone	kmem_cache_s
+#define kmem_zone_t	kmem_cache_t
+
+#define KM_SLEEP	0x0001
+#define KM_NOSLEEP	0x0002
+#define KM_NOFS		0x0004
+
+typedef unsigned long xfs_pflags_t;
+
+#define PFLAGS_TEST_FSTRANS()		(current->flags & PF_FSTRANS)
+
+#define PFLAGS_SET_FSTRANS(STATEP) do {	\
+	*(STATEP) = current->flags;	\
+	current->flags |= PF_FSTRANS;	\
+} while (0)
+
+#define PFLAGS_RESTORE(STATEP) do {	\
+	current->flags = *(STATEP);	\
+} while (0)
+
+#define PFLAGS_DUP(OSTATEP, NSTATEP) do { \
+	*(NSTATEP) = *(OSTATEP);	\
+} while (0)
+
+/*
+ * XXX get rid of the unconditional  __GFP_NOFAIL by adding
+ * a KM_FAIL flag and using it where we're allowed to fail.
+ */
+static __inline unsigned int
+kmem_flags_convert(int flags)
+{
+	int lflags;
+
+#if DEBUG
+	if (unlikely(flags & ~(KM_SLEEP|KM_NOSLEEP|KM_NOFS))) {
+		printk(KERN_WARNING
+		    "XFS: memory allocation with wrong flags (%x)\n", flags);
+		BUG();
+	}
+#endif
+
+	lflags = (flags & KM_NOSLEEP) ? GFP_ATOMIC : (GFP_KERNEL|__GFP_NOFAIL);
+
+	/* avoid recusive callbacks to filesystem during transactions */
+	if (PFLAGS_TEST_FSTRANS() || (flags & KM_NOFS))
+		lflags &= ~__GFP_FS;
+
+	return lflags;
+}
+
+static __inline void *
+kmem_alloc(size_t size, int flags)
+{
+	if (unlikely(MAX_SLAB_SIZE < size))
+		/* Avoid doing filesystem sensitive stuff to get this */
+		return __vmalloc(size, kmem_flags_convert(flags), PAGE_KERNEL);
+	return kmalloc(size, kmem_flags_convert(flags));
+}
+
+static __inline void *
+kmem_zalloc(size_t size, int flags)
+{
+	void *ptr = kmem_alloc(size, flags);
+	if (likely(ptr != NULL))
+		memset(ptr, 0, size);
+	return ptr;
+}
+
+static __inline void
+kmem_free(void *ptr, size_t size)
+{
+	if (unlikely((unsigned long)ptr < VMALLOC_START ||
+		     (unsigned long)ptr >= VMALLOC_END))
+		kfree(ptr);
+	else
+		vfree(ptr);
+}
+
+static __inline void *
+kmem_realloc(void *ptr, size_t newsize, size_t oldsize, int flags)
+{
+	void *new = kmem_alloc(newsize, flags);
+
+	if (likely(ptr != NULL)) {
+		if (likely(new != NULL))
+			memcpy(new, ptr, min(oldsize, newsize));
+		kmem_free(ptr, oldsize);
+	}
+
+	return new;
+}
+
+static __inline kmem_zone_t *
+kmem_zone_init(int size, char *zone_name)
+{
+	return kmem_cache_create(zone_name, size, 0, 0, NULL, NULL);
+}
+
+static __inline void *
+kmem_zone_alloc(kmem_zone_t *zone, int flags)
+{
+	return kmem_cache_alloc(zone, kmem_flags_convert(flags));
+}
+
+static __inline void *
+kmem_zone_zalloc(kmem_zone_t *zone, int flags)
+{
+	void *ptr = kmem_zone_alloc(zone, flags);
+	if (likely(ptr != NULL))
+		memset(ptr, 0, kmem_cache_size(zone));
+	return ptr;
+}
+
+static __inline void
+kmem_zone_free(kmem_zone_t *zone, void *ptr)
+{
+	kmem_cache_free(zone, ptr);
+}
+
+typedef struct shrinker *kmem_shaker_t;
+typedef int (*kmem_shake_func_t)(int, unsigned int);
+
+static __inline kmem_shaker_t
+kmem_shake_register(kmem_shake_func_t sfunc)
+{
+	return set_shrinker(DEFAULT_SEEKS, sfunc);
+}
+
+static __inline void
+kmem_shake_deregister(kmem_shaker_t shrinker)
+{
+	remove_shrinker(shrinker);
+}
+
+static __inline int
+kmem_shake_allow(unsigned int gfp_mask)
+{
+	return (gfp_mask & __GFP_WAIT);
+}
+
+#endif /* __XFS_SUPPORT_KMEM_H__ */
diff -Nru a/fs/xfs/linux/mrlock.c b/fs/xfs/linux/mrlock.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/fs/xfs/linux/mrlock.c	Tue Feb  3 19:45:16 2004
@@ -0,0 +1,274 @@
+/*
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+
+#include <linux/time.h>
+#include <linux/sched.h>
+#include <asm/system.h>
+#include <linux/interrupt.h>
+#include <asm/current.h>
+
+#include "mrlock.h"
+
+
+#if USE_RW_WAIT_QUEUE_SPINLOCK
+# define wq_write_lock	write_lock
+#else
+# define wq_write_lock	spin_lock
+#endif
+
+/*
+ * We don't seem to need lock_type (only one supported), name, or
+ * sequence. But, XFS will pass it so let's leave them here for now.
+ */
+/* ARGSUSED */
+void
+mrlock_init(mrlock_t *mrp, int lock_type, char *name, long sequence)
+{
+	mrp->mr_count = 0;
+	mrp->mr_reads_waiting = 0;
+	mrp->mr_writes_waiting = 0;
+	init_waitqueue_head(&mrp->mr_readerq);
+	init_waitqueue_head(&mrp->mr_writerq);
+	mrp->mr_lock = SPIN_LOCK_UNLOCKED;
+}
+
+/*
+ * Macros to lock/unlock the mrlock_t.
+ */
+
+#define MRLOCK(m)		spin_lock(&(m)->mr_lock);
+#define MRUNLOCK(m)		spin_unlock(&(m)->mr_lock);
+
+
+/*
+ * lock_wait should never be called in an interrupt thread.
+ *
+ * mrlocks can sleep (i.e. call schedule) and so they can't ever
+ * be called from an interrupt thread.
+ *
+ * threads that wake-up should also never be invoked from interrupt threads.
+ *
+ * But, waitqueue_lock is locked from interrupt threads - and we are
+ * called with interrupts disabled, so it is all OK.
+ */
+
+/* ARGSUSED */
+void
+lock_wait(wait_queue_head_t *q, spinlock_t *lock, int rw)
+{
+	DECLARE_WAITQUEUE( wait, current );
+
+	__set_current_state(TASK_UNINTERRUPTIBLE);
+
+	spin_lock(&q->lock);
+	if (rw) {
+		__add_wait_queue_tail(q, &wait);
+	} else {
+		__add_wait_queue(q, &wait);
+	}
+
+	spin_unlock(&q->lock);
+	spin_unlock(lock);
+
+	schedule();
+
+	spin_lock(&q->lock);
+	__remove_wait_queue(q, &wait);
+	spin_unlock(&q->lock);
+
+	spin_lock(lock);
+
+	/* return with lock held */
+}
+
+/* ARGSUSED */
+void
+mrfree(mrlock_t *mrp)
+{
+}
+
+/* ARGSUSED */
+void
+mrlock(mrlock_t *mrp, int type, int flags)
+{
+	if (type == MR_ACCESS)
+		mraccess(mrp);
+	else
+		mrupdate(mrp);
+}
+
+/* ARGSUSED */
+void
+mraccessf(mrlock_t *mrp, int flags)
+{
+	MRLOCK(mrp);
+	if(mrp->mr_writes_waiting > 0) {
+		mrp->mr_reads_waiting++;
+		lock_wait(&mrp->mr_readerq, &mrp->mr_lock, 0);
+		mrp->mr_reads_waiting--;
+	}
+	while (mrp->mr_count < 0) {
+		mrp->mr_reads_waiting++;
+		lock_wait(&mrp->mr_readerq, &mrp->mr_lock, 0);
+		mrp->mr_reads_waiting--;
+	}
+	mrp->mr_count++;
+	MRUNLOCK(mrp);
+}
+
+/* ARGSUSED */
+void
+mrupdatef(mrlock_t *mrp, int flags)
+{
+	MRLOCK(mrp);
+	while(mrp->mr_count) {
+		mrp->mr_writes_waiting++;
+		lock_wait(&mrp->mr_writerq, &mrp->mr_lock, 1);
+		mrp->mr_writes_waiting--;
+	}
+
+	mrp->mr_count = -1; /* writer on it */
+	MRUNLOCK(mrp);
+}
+
+int
+mrtryaccess(mrlock_t *mrp)
+{
+	MRLOCK(mrp);
+	/*
+	 * If anyone is waiting for update access or the lock is held for update
+	 * fail the request.
+	 */
+	if(mrp->mr_writes_waiting > 0 || mrp->mr_count < 0) {
+		MRUNLOCK(mrp);
+		return 0;
+	}
+	mrp->mr_count++;
+	MRUNLOCK(mrp);
+	return 1;
+}
+
+int
+mrtrypromote(mrlock_t *mrp)
+{
+	MRLOCK(mrp);
+
+	if(mrp->mr_count == 1) { /* We are the only thread with the lock */
+		mrp->mr_count = -1; /* writer on it */
+		MRUNLOCK(mrp);
+		return 1;
+	}
+
+	MRUNLOCK(mrp);
+	return 0;
+}
+
+int
+mrtryupdate(mrlock_t *mrp)
+{
+	MRLOCK(mrp);
+
+	if(mrp->mr_count) {
+		MRUNLOCK(mrp);
+		return 0;
+	}
+
+	mrp->mr_count = -1; /* writer on it */
+	MRUNLOCK(mrp);
+	return 1;
+}
+
+static __inline__ void mrwake(mrlock_t *mrp)
+{
+	/*
+	 * First, if the count is now 0, we need to wake-up anyone waiting.
+	 */
+	if (!mrp->mr_count) {
+		if (mrp->mr_writes_waiting) {	/* Wake-up first writer waiting */
+			wake_up(&mrp->mr_writerq);
+		} else if (mrp->mr_reads_waiting) {	/* Wakeup any readers waiting */
+			wake_up(&mrp->mr_readerq);
+		}
+	}
+}
+
+void
+mraccunlock(mrlock_t *mrp)
+{
+	MRLOCK(mrp);
+	mrp->mr_count--;
+	mrwake(mrp);
+	MRUNLOCK(mrp);
+}
+
+void
+mrunlock(mrlock_t *mrp)
+{
+	MRLOCK(mrp);
+	if (mrp->mr_count < 0) {
+		mrp->mr_count = 0;
+	} else {
+		mrp->mr_count--;
+	}
+	mrwake(mrp);
+	MRUNLOCK(mrp);
+}
+
+int
+ismrlocked(mrlock_t *mrp, int type)	/* No need to lock since info can change */
+{
+	if (type == MR_ACCESS)
+		return (mrp->mr_count > 0); /* Read lock */
+	else if (type == MR_UPDATE)
+		return (mrp->mr_count < 0); /* Write lock */
+	else if (type == (MR_UPDATE | MR_ACCESS))
+		return (mrp->mr_count);	/* Any type of lock held */
+	else /* Any waiters */
+		return (mrp->mr_reads_waiting | mrp->mr_writes_waiting);
+}
+
+/*
+ * Demote from update to access. We better be the only thread with the
+ * lock in update mode so it should be easy to set to 1.
+ * Wake-up any readers waiting.
+ */
+
+void
+mrdemote(mrlock_t *mrp)
+{
+	MRLOCK(mrp);
+	mrp->mr_count = 1;
+	if (mrp->mr_reads_waiting) {	/* Wakeup all readers waiting */
+		wake_up(&mrp->mr_readerq);
+	}
+	MRUNLOCK(mrp);
+}
diff -Nru a/fs/xfs/linux/mrlock.h b/fs/xfs/linux/mrlock.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/fs/xfs/linux/mrlock.h	Tue Feb  3 19:45:30 2004
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+#ifndef __XFS_SUPPORT_MRLOCK_H__
+#define __XFS_SUPPORT_MRLOCK_H__
+
+#include <linux/time.h>
+#include <linux/wait.h>
+#include <asm/atomic.h>
+#include <asm/semaphore.h>
+
+/*
+ * Implement mrlocks on Linux that work for XFS.
+ *
+ * These are sleep locks and not spinlocks. If one wants read/write spinlocks,
+ * use read_lock, write_lock, ... see spinlock.h.
+ */
+
+typedef struct mrlock_s {
+	int			mr_count;
+	unsigned short		mr_reads_waiting;
+	unsigned short		mr_writes_waiting;
+	wait_queue_head_t	mr_readerq;
+	wait_queue_head_t	mr_writerq;
+	spinlock_t		mr_lock;
+} mrlock_t;
+
+#define MR_ACCESS	1
+#define MR_UPDATE	2
+
+#define MRLOCK_BARRIER		0x1
+#define MRLOCK_ALLOW_EQUAL_PRI	0x8
+
+/*
+ * mraccessf/mrupdatef take flags to be passed in while sleeping;
+ * only PLTWAIT is currently supported.
+ */
+
+extern void	mraccessf(mrlock_t *, int);
+extern void	mrupdatef(mrlock_t *, int);
+extern void     mrlock(mrlock_t *, int, int);
+extern void     mrunlock(mrlock_t *);
+extern void     mraccunlock(mrlock_t *);
+extern int      mrtryupdate(mrlock_t *);
+extern int      mrtryaccess(mrlock_t *);
+extern int	mrtrypromote(mrlock_t *);
+extern void     mrdemote(mrlock_t *);
+
+extern int	ismrlocked(mrlock_t *, int);
+extern void     mrlock_init(mrlock_t *, int type, char *name, long sequence);
+extern void     mrfree(mrlock_t *);
+
+#define mrinit(mrp, name)	mrlock_init(mrp, MRLOCK_BARRIER, name, -1)
+#define mraccess(mrp)		mraccessf(mrp, 0) /* grab for READ/ACCESS */
+#define mrupdate(mrp)		mrupdatef(mrp, 0) /* grab for WRITE/UPDATE */
+#define mrislocked_access(mrp)	((mrp)->mr_count > 0)
+#define mrislocked_update(mrp)	((mrp)->mr_count < 0)
+
+#endif /* __XFS_SUPPORT_MRLOCK_H__ */
diff -Nru a/fs/xfs/linux/mutex.h b/fs/xfs/linux/mutex.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/fs/xfs/linux/mutex.h	Tue Feb  3 19:45:16 2004
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+#ifndef __XFS_SUPPORT_MUTEX_H__
+#define __XFS_SUPPORT_MUTEX_H__
+
+#include <linux/spinlock.h>
+#include <asm/semaphore.h>
+
+/*
+ * Map the mutex'es from IRIX to Linux semaphores.
+ *
+ * Destroy just simply initializes to -99 which should block all other
+ * callers.
+ */
+#define MUTEX_DEFAULT		0x0
+typedef struct semaphore	mutex_t;
+
+#define mutex_init(lock, type, name)		sema_init(lock, 1)
+#define mutex_destroy(lock)			sema_init(lock, -99)
+#define mutex_lock(lock, num)			down(lock)
+#define mutex_trylock(lock)			(down_trylock(lock) ? 0 : 1)
+#define mutex_unlock(lock)			up(lock)
+
+#endif /* __XFS_SUPPORT_MUTEX_H__ */
diff -Nru a/fs/xfs/linux/sema.h b/fs/xfs/linux/sema.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/fs/xfs/linux/sema.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+#ifndef __XFS_SUPPORT_SEMA_H__
+#define __XFS_SUPPORT_SEMA_H__
+
+#include <linux/time.h>
+#include <linux/wait.h>
+#include <asm/atomic.h>
+#include <asm/semaphore.h>
+
+/*
+ * sema_t structure just maps to struct semaphore in Linux kernel.
+ */
+
+typedef struct semaphore sema_t;
+
+#define init_sema(sp, val, c, d)	sema_init(sp, val)
+#define initsema(sp, val)		sema_init(sp, val)
+#define initnsema(sp, val, name)	sema_init(sp, val)
+#define psema(sp, b)			down(sp)
+#define vsema(sp)			up(sp)
+#define valusema(sp)			(atomic_read(&(sp)->count))
+#define freesema(sema)
+
+/*
+ * Map cpsema (try to get the sema) to down_trylock. We need to switch
+ * the return values since cpsema returns 1 (acquired) 0 (failed) and
+ * down_trylock returns the reverse 0 (acquired) 1 (failed).
+ */
+
+#define cpsema(sp)			(down_trylock(sp) ? 0 : 1)
+
+/*
+ * Didn't do cvsema(sp). Not sure how to map this to up/down/...
+ * It does a vsema if the values is < 0 other wise nothing.
+ */
+
+#endif /* __XFS_SUPPORT_SEMA_H__ */
diff -Nru a/fs/xfs/linux/spin.h b/fs/xfs/linux/spin.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/fs/xfs/linux/spin.h	Tue Feb  3 19:45:28 2004
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+#ifndef __XFS_SUPPORT_SPIN_H__
+#define __XFS_SUPPORT_SPIN_H__
+
+#include <linux/sched.h>	/* preempt needs this */
+#include <linux/spinlock.h>
+
+/*
+ * Map lock_t from IRIX to Linux spinlocks.
+ *
+ * Note that linux turns on/off spinlocks depending on CONFIG_SMP.
+ * We don't need to worry about SMP or not here.
+ */
+
+#define SPLDECL(s)		unsigned long s
+
+typedef spinlock_t lock_t;
+
+#define spinlock_init(lock, name)	spin_lock_init(lock)
+#define	spinlock_destroy(lock)
+
+static inline unsigned long mutex_spinlock(lock_t *lock)
+{
+	spin_lock(lock);
+	return 0;
+}
+
+/*ARGSUSED*/
+static inline void mutex_spinunlock(lock_t *lock, unsigned long s)
+{
+	spin_unlock(lock);
+}
+
+static inline void nested_spinlock(lock_t *lock)
+{
+	spin_lock(lock);
+}
+
+static inline void nested_spinunlock(lock_t *lock)
+{
+	spin_unlock(lock);
+}
+
+#endif /* __XFS_SUPPORT_SPIN_H__ */
diff -Nru a/fs/xfs/linux/sv.h b/fs/xfs/linux/sv.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/fs/xfs/linux/sv.h	Tue Feb  3 19:45:17 2004
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+#ifndef __XFS_SUPPORT_SV_H__
+#define __XFS_SUPPORT_SV_H__
+
+#include <linux/wait.h>
+#include <linux/sched.h>
+#include <linux/spinlock.h>
+
+/*
+ * Synchronisation variables.
+ *
+ * (Parameters "pri", "svf" and "rts" are not implemented)
+ */
+
+typedef struct sv_s {
+	wait_queue_head_t waiters;
+} sv_t;
+
+#define SV_FIFO		0x0		/* sv_t is FIFO type */
+#define SV_LIFO		0x2		/* sv_t is LIFO type */
+#define SV_PRIO		0x4		/* sv_t is PRIO type */
+#define SV_KEYED	0x6		/* sv_t is KEYED type */
+#define SV_DEFAULT      SV_FIFO
+
+
+static inline void _sv_wait(sv_t *sv, spinlock_t *lock, int state,
+			     unsigned long timeout)
+{
+	DECLARE_WAITQUEUE(wait, current);
+
+	add_wait_queue_exclusive(&sv->waiters, &wait);
+	__set_current_state(state);
+	spin_unlock(lock);
+
+	schedule_timeout(timeout);
+
+	remove_wait_queue(&sv->waiters, &wait);
+}
+
+#define init_sv(sv,type,name,flag) \
+	init_waitqueue_head(&(sv)->waiters)
+#define sv_init(sv,flag,name) \
+	init_waitqueue_head(&(sv)->waiters)
+#define sv_destroy(sv) \
+	/*NOTHING*/
+#define sv_wait(sv, pri, lock, s) \
+	_sv_wait(sv, lock, TASK_UNINTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT)
+#define sv_wait_sig(sv, pri, lock, s)   \
+	_sv_wait(sv, lock, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT)
+#define sv_timedwait(sv, pri, lock, s, svf, ts, rts) \
+	_sv_wait(sv, lock, TASK_UNINTERRUPTIBLE, timespec_to_jiffies(ts))
+#define sv_timedwait_sig(sv, pri, lock, s, svf, ts, rts) \
+	_sv_wait(sv, lock, TASK_INTERRUPTIBLE, timespec_to_jiffies(ts))
+#define sv_signal(sv) \
+	wake_up(&(sv)->waiters)
+#define sv_broadcast(sv) \
+	wake_up_all(&(sv)->waiters)
+
+#endif /* __XFS_SUPPORT_SV_H__ */
diff -Nru a/fs/xfs/linux/time.h b/fs/xfs/linux/time.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/fs/xfs/linux/time.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+#ifndef __XFS_SUPPORT_TIME_H__
+#define __XFS_SUPPORT_TIME_H__
+
+#include <linux/sched.h>
+#include <linux/time.h>
+
+typedef struct timespec timespec_t;
+
+static inline void delay(long ticks)
+{
+	current->state = TASK_UNINTERRUPTIBLE;
+	schedule_timeout(ticks);
+}
+
+static inline void nanotime(struct timespec *tvp)
+{
+	*tvp = CURRENT_TIME;
+}
+
+#endif /* __XFS_SUPPORT_TIME_H__ */
diff -Nru a/fs/xfs/linux/xfs_aops.c b/fs/xfs/linux/xfs_aops.c
--- a/fs/xfs/linux/xfs_aops.c	Tue Feb  3 19:45:42 2004
+++ b/fs/xfs/linux/xfs_aops.c	Tue Feb  3 19:45:42 2004
@@ -51,10 +51,11 @@
 #include "xfs_inode.h"
 #include "xfs_error.h"
 #include "xfs_rw.h"
+#include "xfs_iomap.h"
 #include <linux/mpage.h>
 
 STATIC void convert_page(struct inode *, struct page *,
-			page_buf_bmap_t *, void *, int, int);
+			xfs_iomap_t *, void *, int, int);
 
 void
 linvfs_unwritten_done(
@@ -85,11 +86,9 @@
 	vnode_t		*vp = XFS_BUF_FSPRIVATE(bp, vnode_t *);
 	int		error;
 
-	if (atomic_read(&bp->pb_hold) < 1) 
-		BUG();
-
+	BUG_ON(atomic_read(&bp->pb_hold) < 1);
 	VOP_BMAP(vp, XFS_BUF_OFFSET(bp), XFS_BUF_SIZE(bp),
-			BMAP_UNWRITTEN, NULL, NULL, error);
+			BMAPI_UNWRITTEN, NULL, NULL, error);
 	XFS_BUF_SET_FSPRIVATE(bp, NULL);
 	XFS_BUF_CLR_IODONE_FUNC(bp);
 	XFS_BUF_UNDATAIO(bp);
@@ -117,7 +116,7 @@
 		vnode_t	*vp = LINVFS_GET_VP(inode);
 		int	error;
 
-		VOP_BMAP(vp, offset, size, BMAP_UNWRITTEN, NULL, NULL, error);
+		VOP_BMAP(vp, offset, size, BMAPI_UNWRITTEN, NULL, NULL, error);
 	}
 }
 
@@ -126,26 +125,26 @@
 	struct inode		*inode,
 	loff_t			offset,
 	ssize_t			count,
-	page_buf_bmap_t		*pbmapp,
+	xfs_iomap_t		*iomapp,
 	int			flags)
 {
 	vnode_t			*vp = LINVFS_GET_VP(inode);
-	int			error, nmaps = 1;
+	int			error, niomaps = 1;
 
-	if (((flags & (BMAP_DIRECT|BMAP_SYNC)) == BMAP_DIRECT) &&
+	if (((flags & (BMAPI_DIRECT|BMAPI_SYNC)) == BMAPI_DIRECT) &&
 	    (offset >= i_size_read(inode)))
 		count = max_t(ssize_t, count, XFS_WRITE_IO_LOG);
 retry:
-	VOP_BMAP(vp, offset, count, flags, pbmapp, &nmaps, error);
+	VOP_BMAP(vp, offset, count, flags, iomapp, &niomaps, error);
 	if ((error == EAGAIN) || (error == EIO))
 		return -error;
-	if (unlikely((flags & (BMAP_WRITE|BMAP_DIRECT)) ==
-					(BMAP_WRITE|BMAP_DIRECT) && nmaps &&
-					(pbmapp->pbm_flags & PBMF_DELAY))) {
-		flags = BMAP_ALLOCATE;
+	if (unlikely((flags & (BMAPI_WRITE|BMAPI_DIRECT)) ==
+					(BMAPI_WRITE|BMAPI_DIRECT) && niomaps &&
+					(iomapp->iomap_flags & IOMAP_DELAY))) {
+		flags = BMAPI_ALLOCATE;
 		goto retry;
 	}
-	if (flags & (BMAP_WRITE|BMAP_ALLOCATE)) {
+	if (flags & (BMAPI_WRITE|BMAPI_ALLOCATE)) {
 		VMODIFY(vp);
 	}
 	return -error;
@@ -156,10 +155,10 @@
  * Finds the corresponding mapping in block @map array of the
  * given @offset within a @page.
  */
-STATIC page_buf_bmap_t *
+STATIC xfs_iomap_t *
 match_offset_to_mapping(
 	struct page		*page,
-	page_buf_bmap_t		*map,
+	xfs_iomap_t		*iomapp,
 	unsigned long		offset)
 {
 	loff_t			full_offset;	/* offset from start of file */
@@ -170,10 +169,10 @@
 	full_offset <<= PAGE_CACHE_SHIFT;	/* offset from file start */
 	full_offset += offset;			/* offset from page start */
 
-	if (full_offset < map->pbm_offset)
+	if (full_offset < iomapp->iomap_offset)
 		return NULL;
-	if (map->pbm_offset + map->pbm_bsize > full_offset)
-		return map;
+	if (iomapp->iomap_offset + iomapp->iomap_bsize > full_offset)
+		return iomapp;
 	return NULL;
 }
 
@@ -183,30 +182,30 @@
 	struct buffer_head	*bh,
 	unsigned long		offset,
 	int			block_bits,
-	page_buf_bmap_t		*mp)
+	xfs_iomap_t		*iomapp)
 {
-	page_buf_daddr_t	bn;
+	xfs_daddr_t		bn;
 	loff_t			delta;
 	int			sector_shift;
 
-	ASSERT(!(mp->pbm_flags & PBMF_HOLE));
-	ASSERT(!(mp->pbm_flags & PBMF_DELAY));
-	ASSERT(mp->pbm_bn != PAGE_BUF_DADDR_NULL);
+	ASSERT(!(iomapp->iomap_flags & IOMAP_HOLE));
+	ASSERT(!(iomapp->iomap_flags & IOMAP_DELAY));
+	ASSERT(iomapp->iomap_bn != IOMAP_DADDR_NULL);
 
 	delta = page->index;
 	delta <<= PAGE_CACHE_SHIFT;
 	delta += offset;
-	delta -= mp->pbm_offset;
+	delta -= iomapp->iomap_offset;
 	delta >>= block_bits;
 
 	sector_shift = block_bits - BBSHIFT;
-	bn = mp->pbm_bn >> sector_shift;
+	bn = iomapp->iomap_bn >> sector_shift;
 	bn += delta;
-	ASSERT((bn << sector_shift) >= mp->pbm_bn);
+	ASSERT((bn << sector_shift) >= iomapp->iomap_bn);
 
 	lock_buffer(bh);
 	bh->b_blocknr = bn;
-	bh->b_bdev = mp->pbm_target->pbr_bdev;
+	bh->b_bdev = iomapp->iomap_target->pbr_bdev;
 	set_buffer_mapped(bh);
 	clear_buffer_delay(bh);
 }
@@ -222,7 +221,7 @@
 probe_unwritten_page(
 	struct address_space	*mapping,
 	unsigned long		index,
-	page_buf_bmap_t		*mp,
+	xfs_iomap_t		*iomapp,
 	page_buf_t		*pb,
 	unsigned long		max_offset,
 	unsigned long		*fsbs,
@@ -245,11 +244,11 @@
 		do {
 			if (!buffer_unwritten(bh))
 				break;
-			if (!match_offset_to_mapping(page, mp, p_offset))
+			if (!match_offset_to_mapping(page, iomapp, p_offset))
 				break;
 			if (p_offset >= max_offset)
 				break;
-			map_buffer_at_offset(page, bh, p_offset, bbits, mp);
+			map_buffer_at_offset(page, bh, p_offset, bbits, iomapp);
 			set_buffer_unwritten_io(bh);
 			bh->b_private = pb;
 			p_offset += bh->b_size;
@@ -394,11 +393,12 @@
 	struct buffer_head	*curr,
 	unsigned long		p_offset,
 	int			block_bits,
-	page_buf_bmap_t		*mp,
+	xfs_iomap_t		*iomapp,
+	int			startio,
 	int			all_bh)
 {
 	struct buffer_head	*bh = curr;
-	page_buf_bmap_t		*tmp;
+	xfs_iomap_t		*tmp;
 	page_buf_t		*pb;
 	loff_t			offset, size;
 	unsigned long		nblocks = 0;
@@ -407,8 +407,10 @@
 	offset <<= PAGE_CACHE_SHIFT;
 	offset += p_offset;
 
-	pb = pagebuf_lookup(mp->pbm_target,
-			    mp->pbm_offset, mp->pbm_bsize, 0);
+	/* get an "empty" pagebuf to manage IO completion
+	 * Proper values will be set before returning */
+	pb = pagebuf_lookup(iomapp->iomap_target, 0, 0, 0);
+
 	if (!pb)
 		return -EAGAIN;
 
@@ -433,10 +435,10 @@
 	do {
 		if (!buffer_unwritten(bh))
 			break;
-		tmp = match_offset_to_mapping(start_page, mp, p_offset);
+		tmp = match_offset_to_mapping(start_page, iomapp, p_offset);
 		if (!tmp)
 			break;
-		map_buffer_at_offset(start_page, bh, p_offset, block_bits, mp);
+		map_buffer_at_offset(start_page, bh, p_offset, block_bits, iomapp);
 		set_buffer_unwritten_io(bh);
 		bh->b_private = pb;
 		p_offset += bh->b_size;
@@ -444,8 +446,8 @@
 	} while ((bh = bh->b_this_page) != head);
 
 	if (unlikely(nblocks == 0)) {
-		printk("XFS: bad unwritten extent map: bh=0x%p, mp=0x%p\n",
-			curr, mp);
+		printk("XFS: bad unwritten extent map: bh=0x%p, iomapp=0x%p\n",
+		       curr, iomapp);
 		BUG();
 	}
 
@@ -461,36 +463,45 @@
 		struct page		*page;
 
 		tlast = i_size_read(inode) >> PAGE_CACHE_SHIFT;
-		tloff = (mp->pbm_offset + mp->pbm_bsize) >> PAGE_CACHE_SHIFT;
+		tloff = (iomapp->iomap_offset + iomapp->iomap_bsize) >> PAGE_CACHE_SHIFT;
 		tloff = min(tlast, tloff);
 		for (tindex = start_page->index + 1; tindex < tloff; tindex++) {
-			page = probe_unwritten_page(mapping, tindex, mp, pb,
+			page = probe_unwritten_page(mapping, tindex, iomapp, pb,
 						PAGE_CACHE_SIZE, &bs, bbits);
 			if (!page)
 				break;
 			nblocks += bs;
 			atomic_add(bs, &pb->pb_io_remaining);
-			convert_page(inode, page, mp, pb, 1, all_bh);
+			convert_page(inode, page, iomapp, pb, startio, all_bh);
+                        /* stop if converting the next page might add
+			 * enough blocks that the corresponding byte
+			 * count won't fit in our ulong page buf length */
+			if (nblocks >= ((ULONG_MAX - PAGE_SIZE) >> block_bits))
+				goto enough;
 		}
 
 		if (tindex == tlast &&
 		    (tloff = (i_size_read(inode) & (PAGE_CACHE_SIZE - 1)))) {
-			page = probe_unwritten_page(mapping, tindex, mp, pb,
+			page = probe_unwritten_page(mapping, tindex, iomapp, pb,
 							tloff, &bs, bbits);
 			if (page) {
 				nblocks += bs;
 				atomic_add(bs, &pb->pb_io_remaining);
-				convert_page(inode, page, mp, pb, 1, all_bh);
+				convert_page(inode, page, iomapp, pb, startio, all_bh);
+				if (nblocks >= ((ULONG_MAX - PAGE_SIZE) >> block_bits))
+					goto enough;
 			}
 		}
 	}
 
+enough:
 	size = nblocks;		/* NB: using 64bit number here */
 	size <<= block_bits;	/* convert fsb's to byte range */
 
 	XFS_BUF_DATAIO(pb);
 	XFS_BUF_ASYNC(pb);
 	XFS_BUF_SET_SIZE(pb, size);
+	XFS_BUF_SET_COUNT(pb, size);
 	XFS_BUF_SET_OFFSET(pb, offset);
 	XFS_BUF_SET_FSPRIVATE(pb, LINVFS_GET_VP(inode));
 	XFS_BUF_SET_IODONE_FUNC(pb, linvfs_unwritten_convert);
@@ -542,13 +553,13 @@
 convert_page(
 	struct inode		*inode,
 	struct page		*page,
-	page_buf_bmap_t		*maps,
+	xfs_iomap_t		*iomapp,
 	void			*private,
 	int			startio,
 	int			all_bh)
 {
 	struct buffer_head	*bh_arr[MAX_BUF_PER_PAGE], *bh, *head;
-	page_buf_bmap_t		*mp = maps, *tmp;
+	xfs_iomap_t		*mp = iomapp, *tmp;
 	unsigned long		end, offset, end_index;
 	int			i = 0, index = 0;
 	int			bbits = inode->i_blkbits;
@@ -575,17 +586,17 @@
 		tmp = match_offset_to_mapping(page, mp, offset);
 		if (!tmp)
 			continue;
-		ASSERT(!(tmp->pbm_flags & PBMF_HOLE));
-		ASSERT(!(tmp->pbm_flags & PBMF_DELAY));
+		ASSERT(!(tmp->iomap_flags & IOMAP_HOLE));
+		ASSERT(!(tmp->iomap_flags & IOMAP_DELAY));
 
 		/* If this is a new unwritten extent buffer (i.e. one
 		 * that we haven't passed in private data for, we must
 		 * now map this buffer too.
 		 */
 		if (buffer_unwritten(bh) && !bh->b_end_io) {
-			ASSERT(tmp->pbm_flags & PBMF_UNWRITTEN);
+			ASSERT(tmp->iomap_flags & IOMAP_UNWRITTEN);
 			map_unwritten(inode, page, head, bh,
-						offset, bbits, tmp, all_bh);
+					offset, bbits, tmp, startio, all_bh);
 		} else if (! (buffer_unwritten(bh) && buffer_locked(bh))) {
 			map_buffer_at_offset(page, bh, offset, bbits, tmp);
 			if (buffer_unwritten(bh)) {
@@ -618,19 +629,19 @@
 cluster_write(
 	struct inode		*inode,
 	unsigned long		tindex,
-	page_buf_bmap_t		*mp,
+	xfs_iomap_t		*iomapp,
 	int			startio,
 	int			all_bh)
 {
 	unsigned long		tlast;
 	struct page		*page;
 
-	tlast = (mp->pbm_offset + mp->pbm_bsize) >> PAGE_CACHE_SHIFT;
+	tlast = (iomapp->iomap_offset + iomapp->iomap_bsize) >> PAGE_CACHE_SHIFT;
 	for (; tindex < tlast; tindex++) {
 		page = probe_delalloc_page(inode, tindex);
 		if (!page)
 			break;
-		convert_page(inode, page, mp, NULL, startio, all_bh);
+		convert_page(inode, page, iomapp, NULL, startio, all_bh);
 	}
 }
 
@@ -661,20 +672,21 @@
 	int		unmapped) /* also implies page uptodate */
 {
 	struct buffer_head	*bh_arr[MAX_BUF_PER_PAGE], *bh, *head;
-	page_buf_bmap_t		*mp, map;
+	xfs_iomap_t		*iomp, iomap;
 	unsigned long		p_offset = 0, end_index;
 	loff_t			offset, end_offset;
 	int			len, err, i, cnt = 0, uptodate = 1;
-	int			flags = startio ? 0 : BMAP_TRYLOCK;
+	int			flags = startio ? 0 : BMAPI_TRYLOCK;
 	int			page_dirty = 1;
 
 
 	/* Are we off the end of the file ? */
 	end_index = i_size_read(inode) >> PAGE_CACHE_SHIFT;
 	if (page->index >= end_index) {
-		unsigned remaining = i_size_read(inode) & (PAGE_CACHE_SIZE-1);
-		if ((page->index >= end_index+1) || !remaining) {
-			return -EIO;
+		if ((page->index >= end_index + 1) ||
+		    !(i_size_read(inode) & (PAGE_CACHE_SIZE - 1))) {
+			err = -EIO;
+			goto error;
 		}
 	}
 
@@ -684,16 +696,19 @@
 		end_offset = i_size_read(inode);
 
 	bh = head = page_buffers(page);
-	mp = NULL;
+	iomp = NULL;
 
 	len = bh->b_size;
 	do {
-		if (!(PageUptodate(page) || buffer_uptodate(bh)) && !startio) {
-			goto next_bh;
-		}
+		if (offset >= end_offset)
+			break;
+		if (!buffer_uptodate(bh))
+			uptodate = 0;
+		if (!(PageUptodate(page) || buffer_uptodate(bh)) && !startio)
+			continue;
 
-		if (mp) {
-			mp = match_offset_to_mapping(page, &map, p_offset);
+		if (iomp) {
+			iomp = match_offset_to_mapping(page, &iomap, p_offset);
 		}
 
 		/*
@@ -701,21 +716,21 @@
 		 * extent state conversion transaction on completion.
 		 */
 		if (buffer_unwritten(bh)) {
-			if (!mp) {
-				err = map_blocks(inode, offset, len, &map,
-						BMAP_READ|BMAP_IGNSTATE);
+			if (!iomp) {
+				err = map_blocks(inode, offset, len, &iomap,
+						BMAPI_READ|BMAPI_IGNSTATE);
 				if (err) {
 					goto error;
 				}
-				mp = match_offset_to_mapping(page, &map,
+				iomp = match_offset_to_mapping(page, &iomap,
 								p_offset);
 			}
-			if (mp) {
+			if (iomp) {
 				if (!bh->b_end_io) {
 					err = map_unwritten(inode, page,
 							head, bh, p_offset,
-							inode->i_blkbits,
-							mp, unmapped);
+							inode->i_blkbits, iomp,
+							startio, unmapped);
 					if (err) {
 						goto error;
 					}
@@ -734,18 +749,18 @@
 		 * We can return EAGAIN here in the release page case.
 		 */
 		} else if (buffer_delay(bh)) {
-			if (!mp) {
-				err = map_blocks(inode, offset, len, &map,
-					BMAP_ALLOCATE | flags);
+			if (!iomp) {
+				err = map_blocks(inode, offset, len, &iomap,
+					BMAPI_ALLOCATE | flags);
 				if (err) {
 					goto error;
 				}
-				mp = match_offset_to_mapping(page, &map,
+				iomp = match_offset_to_mapping(page, &iomap,
 								p_offset);
 			}
-			if (mp) {
+			if (iomp) {
 				map_buffer_at_offset(page, bh, p_offset,
-					inode->i_blkbits, mp);
+					inode->i_blkbits, iomp);
 				if (startio) {
 					bh_arr[cnt++] = bh;
 				} else {
@@ -766,22 +781,22 @@
 				 * was found, and we are in a path where we
 				 * need to write the whole page out.
 				 */
-				if (!mp) {
+				if (!iomp) {
 					size = probe_unmapped_cluster(
 							inode, page, bh, head);
 					err = map_blocks(inode, offset,
-						size, &map,
-						BMAP_WRITE | BMAP_MMAP);
+						size, &iomap,
+						BMAPI_WRITE | BMAPI_MMAP);
 					if (err) {
 						goto error;
 					}
-					mp = match_offset_to_mapping(page, &map,
+					iomp = match_offset_to_mapping(page, &iomap,
 								     p_offset);
 				}
-				if (mp) {
+				if (iomp) {
 					map_buffer_at_offset(page,
 							bh, p_offset,
-							inode->i_blkbits, mp);
+							inode->i_blkbits, iomp);
 					if (startio) {
 						bh_arr[cnt++] = bh;
 					} else {
@@ -799,14 +814,8 @@
 				}
 			}
 		}
-
-next_bh:
-		if (!buffer_uptodate(bh))
-			uptodate = 0;
-		offset += len;
-		p_offset += len;
-		bh = bh->b_this_page;
-	} while (offset < end_offset);
+	} while (offset += len, p_offset += len,
+		((bh = bh->b_this_page) != head));
 
 	if (uptodate && bh == head)
 		SetPageUptodate(page);
@@ -814,8 +823,8 @@
 	if (startio)
 		submit_page(page, bh_arr, cnt);
 
-	if (mp)
-		cluster_write(inode, page->index + 1, mp, startio, unmapped);
+	if (iomp)
+		cluster_write(inode, page->index + 1, iomp, startio, unmapped);
 
 	return page_dirty;
 
@@ -849,7 +858,7 @@
 	bmapi_flags_t		flags)
 {
 	vnode_t			*vp = LINVFS_GET_VP(inode);
-	page_buf_bmap_t		pbmap;
+	xfs_iomap_t		iomap;
 	int			retpbbm = 1;
 	int			error;
 	ssize_t			size;
@@ -866,32 +875,32 @@
 		size = 1 << inode->i_blkbits;
 
 	VOP_BMAP(vp, offset, size,
-		create ? flags : BMAP_READ, &pbmap, &retpbbm, error);
+		create ? flags : BMAPI_READ, &iomap, &retpbbm, error);
 	if (error)
 		return -error;
 
 	if (retpbbm == 0)
 		return 0;
 
-	if (pbmap.pbm_bn != PAGE_BUF_DADDR_NULL) {
-		page_buf_daddr_t	bn;
+	if (iomap.iomap_bn != IOMAP_DADDR_NULL) {
+		xfs_daddr_t		bn;
 		loff_t			delta;
 
 		/* For unwritten extents do not report a disk address on
 		 * the read case.
 		 */
-		if (create || ((pbmap.pbm_flags & PBMF_UNWRITTEN) == 0)) {
-			delta = offset - pbmap.pbm_offset;
+		if (create || ((iomap.iomap_flags & IOMAP_UNWRITTEN) == 0)) {
+			delta = offset - iomap.iomap_offset;
 			delta >>= inode->i_blkbits;
 
-			bn = pbmap.pbm_bn >> (inode->i_blkbits - BBSHIFT);
+			bn = iomap.iomap_bn >> (inode->i_blkbits - BBSHIFT);
 			bn += delta;
 
 			bh_result->b_blocknr = bn;
-			bh_result->b_bdev = pbmap.pbm_target->pbr_bdev;
+			bh_result->b_bdev = iomap.iomap_target->pbr_bdev;
 			set_buffer_mapped(bh_result);
 		}
-		if (pbmap.pbm_flags & PBMF_UNWRITTEN) {
+		if (iomap.iomap_flags & IOMAP_UNWRITTEN) {
 			if (create) {
 				if (direct)
 					bh_result->b_private = inode;
@@ -902,30 +911,35 @@
 		}
 	}
 
+	/* If this is a realtime file, data might be on a new device */
+	bh_result->b_bdev = iomap.iomap_target->pbr_bdev;
+
 	/* If we previously allocated a block out beyond eof and
 	 * we are now coming back to use it then we will need to
 	 * flag it as new even if it has a disk address.
 	 */
 	if (create &&
 	    ((!buffer_mapped(bh_result) && !buffer_uptodate(bh_result)) ||
-	     (offset >= i_size_read(inode)) || (pbmap.pbm_flags & PBMF_NEW))) {
+	     (offset >= i_size_read(inode)) || (iomap.iomap_flags & IOMAP_NEW))) {
 		set_buffer_new(bh_result);
 	}
 
-	if (pbmap.pbm_flags & PBMF_DELAY) {
+	if (iomap.iomap_flags & IOMAP_DELAY) {
 		if (unlikely(direct))
 			BUG();
 		if (create) {
 			set_buffer_mapped(bh_result);
 			set_buffer_uptodate(bh_result);
 		}
-		bh_result->b_bdev = pbmap.pbm_target->pbr_bdev;
+		bh_result->b_bdev = iomap.iomap_target->pbr_bdev;
 		set_buffer_delay(bh_result);
 	}
 
 	if (blocks) {
-		size = (pbmap.pbm_bsize - pbmap.pbm_delta); 
-		bh_result->b_size = min_t(ssize_t, size, blocks << inode->i_blkbits);
+		loff_t iosize;
+		iosize = (iomap.iomap_bsize - iomap.iomap_delta);
+		bh_result->b_size =
+		    (ssize_t)min(iosize, (loff_t)(blocks << inode->i_blkbits));
 	}
 
 	return 0;
@@ -939,7 +953,7 @@
 	int			create)
 {
 	return linvfs_get_block_core(inode, iblock, 0, bh_result,
-					create, 0, BMAP_WRITE);
+					create, 0, BMAPI_WRITE);
 }
 
 STATIC int
@@ -950,7 +964,7 @@
 	int			create)
 {
 	return linvfs_get_block_core(inode, iblock, 0, bh_result,
-					create, 0, BMAP_SYNC|BMAP_WRITE);
+					create, 0, BMAPI_SYNC|BMAPI_WRITE);
 }
 
 STATIC int
@@ -962,7 +976,7 @@
 	int			create)
 {
 	return linvfs_get_block_core(inode, iblock, max_blocks, bh_result,
-					create, 1, BMAP_WRITE|BMAP_DIRECT);
+					create, 1, BMAPI_WRITE|BMAPI_DIRECT);
 }
 
 STATIC int
@@ -974,17 +988,17 @@
 	unsigned long		nr_segs)
 {
 	struct file	*file = iocb->ki_filp;
-	struct inode	*inode = file->f_dentry->d_inode->i_mapping->host;
+	struct inode	*inode = file->f_mapping->host;
 	vnode_t		*vp = LINVFS_GET_VP(inode);
-	page_buf_bmap_t	pbmap;
+	xfs_iomap_t	iomap;
 	int		maps = 1;
 	int		error;
 
-	VOP_BMAP(vp, offset, 0, BMAP_DEVICE, &pbmap, &maps, error);
+	VOP_BMAP(vp, offset, 0, BMAPI_DEVICE, &iomap, &maps, error);
 	if (error)
 		return -error;
 
-        return blockdev_direct_IO(rw, iocb, inode, pbmap.pbm_target->pbr_bdev,
+	return blockdev_direct_IO(rw, iocb, inode, iomap.iomap_target->pbr_bdev,
 		iov, offset, nr_segs,
 		linvfs_get_blocks_direct,
 		linvfs_unwritten_convert_direct);
diff -Nru a/fs/xfs/linux/xfs_behavior.c b/fs/xfs/linux/xfs_behavior.c
--- a/fs/xfs/linux/xfs_behavior.c	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,218 +0,0 @@
-/*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
- *
- */
-#include "xfs.h"
-
-/*
- * Source file used to associate/disassociate behaviors with virtualized
- * objects.  See xfs_behavior.h for more information about behaviors, etc.
- *
- * The implementation is split between functions in this file and macros
- * in xfs_behavior.h.
- */
-
-/*
- * Insert a new behavior descriptor into a behavior chain.
- *
- * The behavior chain is ordered based on the 'position' number which
- * lives in the first field of the ops vector (higher numbers first).
- *
- * Attemps to insert duplicate ops result in an EINVAL return code.
- * Otherwise, return 0 to indicate success.
- */
-int
-bhv_insert(bhv_head_t *bhp, bhv_desc_t *bdp)
-{
-	bhv_desc_t	*curdesc, *prev;
-	int		position;
-
-	/*
-	 * Validate the position value of the new behavior.
-	 */
-	position = BHV_POSITION(bdp);
-	ASSERT(position >= BHV_POSITION_BASE && position <= BHV_POSITION_TOP);
-
-	/*
-	 * Find location to insert behavior.  Check for duplicates.
-	 */
-	prev = NULL;
-	for (curdesc = bhp->bh_first;
-	     curdesc != NULL;
-	     curdesc = curdesc->bd_next) {
-
-		/* Check for duplication. */
-		if (curdesc->bd_ops == bdp->bd_ops) {
-			ASSERT(0);
-			return EINVAL;
-		}
-
-		/* Find correct position */
-		if (position >= BHV_POSITION(curdesc)) {
-			ASSERT(position != BHV_POSITION(curdesc));
-			break;		/* found it */
-		}
-
-		prev = curdesc;
-	}
-
-	if (prev == NULL) {
-		/* insert at front of chain */
-		bdp->bd_next = bhp->bh_first;
-		bhp->bh_first = bdp;
-	} else {
-		/* insert after prev */
-		bdp->bd_next = prev->bd_next;
-		prev->bd_next = bdp;
-	}
-
-	return 0;
-}
-
-/*
- * Remove a behavior descriptor from a position in a behavior chain;
- * the postition is guaranteed not to be the first position.
- * Should only be called by the bhv_remove() macro.
- */
-void
-bhv_remove_not_first(bhv_head_t *bhp, bhv_desc_t *bdp)
-{
-	bhv_desc_t	*curdesc, *prev;
-
-	ASSERT(bhp->bh_first != NULL);
-	ASSERT(bhp->bh_first->bd_next != NULL);
-
-	prev = bhp->bh_first;
-	for (curdesc = bhp->bh_first->bd_next;
-	     curdesc != NULL;
-	     curdesc = curdesc->bd_next) {
-
-		if (curdesc == bdp)
-			break;		/* found it */
-		prev = curdesc;
-	}
-
-	ASSERT(curdesc == bdp);
-	prev->bd_next = bdp->bd_next;	/* remove from after prev */
-}
-
-/*
- * Look for a specific ops vector on the specified behavior chain.
- * Return the associated behavior descriptor.  Or NULL, if not found.
- */
-bhv_desc_t *
-bhv_lookup(bhv_head_t *bhp, void *ops)
-{
-	bhv_desc_t	*curdesc;
-
-	for (curdesc = bhp->bh_first;
-	     curdesc != NULL;
-	     curdesc = curdesc->bd_next) {
-
-		if (curdesc->bd_ops == ops)
-			return curdesc;
-	}
-
-	return NULL;
-}
-
-/*
- * Looks for the first behavior within a specified range of positions.
- * Return the associated behavior descriptor.  Or NULL, if none found.
- */
-bhv_desc_t *
-bhv_lookup_range(bhv_head_t *bhp, int low, int high)
-{
-	bhv_desc_t	*curdesc;
-
-	for (curdesc = bhp->bh_first;
-	     curdesc != NULL;
-	     curdesc = curdesc->bd_next) {
-
-		int	position = BHV_POSITION(curdesc);
-
-		if (position <= high) {
-			if (position >= low)
-				return curdesc;
-			return NULL;
-		}
-	}
-
-	return NULL;
-}
-
-/*
- * Return the base behavior in the chain, or NULL if the chain
- * is empty.
- *
- * The caller has not read locked the behavior chain, so acquire the
- * lock before traversing the chain.
- */
-bhv_desc_t *
-bhv_base(bhv_head_t *bhp)
-{
-	bhv_desc_t	*curdesc;
-
-	for (curdesc = bhp->bh_first;
-	     curdesc != NULL;
-	     curdesc = curdesc->bd_next) {
-
-		if (curdesc->bd_next == NULL) {
-			return curdesc;
-		}
-	}
-
-	return NULL;
-}
-
-void
-bhv_head_init(
-	bhv_head_t *bhp,
-	char *name)
-{
-	bhp->bh_first = NULL;
-}
-
-void
-bhv_insert_initial(
-	bhv_head_t *bhp,
-	bhv_desc_t *bdp)
-{
-	ASSERT(bhp->bh_first == NULL);
-	(bhp)->bh_first = bdp;
-}
-
-void
-bhv_head_destroy(
-	bhv_head_t *bhp)
-{
-	ASSERT(bhp->bh_first == NULL);
-}
diff -Nru a/fs/xfs/linux/xfs_behavior.h b/fs/xfs/linux/xfs_behavior.h
--- a/fs/xfs/linux/xfs_behavior.h	Tue Feb  3 19:45:29 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,204 +0,0 @@
-/*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
- */
-#ifndef __XFS_BEHAVIOR_H__
-#define __XFS_BEHAVIOR_H__
-
-/*
- * Header file used to associate behaviors with virtualized objects.
- *
- * A virtualized object is an internal, virtualized representation of
- * OS entities such as persistent files, processes, or sockets.  Examples
- * of virtualized objects include vnodes, vprocs, and vsockets.  Often
- * a virtualized object is referred to simply as an "object."
- *
- * A behavior is essentially an implementation layer associated with
- * an object.  Multiple behaviors for an object are chained together,
- * the order of chaining determining the order of invocation.  Each
- * behavior of a given object implements the same set of interfaces
- * (e.g., the VOP interfaces).
- *
- * Behaviors may be dynamically inserted into an object's behavior chain,
- * such that the addition is transparent to consumers that already have
- * references to the object.  Typically, a given behavior will be inserted
- * at a particular location in the behavior chain.  Insertion of new
- * behaviors is synchronized with operations-in-progress (oip's) so that
- * the oip's always see a consistent view of the chain.
- *
- * The term "interpostion" is used to refer to the act of inserting
- * a behavior such that it interposes on (i.e., is inserted in front
- * of) a particular other behavior.  A key example of this is when a
- * system implementing distributed single system image wishes to
- * interpose a distribution layer (providing distributed coherency)
- * in front of an object that is otherwise only accessed locally.
- *
- * Note that the traditional vnode/inode combination is simply a virtualized
- * object that has exactly one associated behavior.
- *
- * Behavior synchronization is logic which is necessary under certain
- * circumstances that there is no conflict between ongoing operations
- * traversing the behavior chain and those dunamically modifying the
- * behavior chain.  Because behavior synchronization adds extra overhead
- * to virtual operation invocation, we want to restrict, as much as
- * we can, the requirement for this extra code, to those situations
- * in which it is truly necessary.
- *
- * Behavior synchronization is needed whenever there's at least one class
- * of object in the system for which:
- * 1) multiple behaviors for a given object are supported,
- * -- AND --
- * 2a) insertion of a new behavior can happen dynamically at any time during
- *     the life of an active object,
- *	-- AND --
- *	3a) insertion of a new behavior needs to synchronize with existing
- *	    ops-in-progress.
- *	-- OR --
- *	3b) multiple different behaviors can be dynamically inserted at
- *	    any time during the life of an active object
- *	-- OR --
- *	3c) removal of a behavior can occur at any time during the life of
- *	    an active object.
- * -- OR --
- * 2b) removal of a behavior can occur at any time during the life of an
- *     active object
- *
- */
-
-struct bhv_head_lock;
-
-/*
- * Behavior head.  Head of the chain of behaviors.
- * Contained within each virtualized object data structure.
- */
-typedef struct bhv_head {
-	struct bhv_desc *bh_first;	/* first behavior in chain */
-	struct bhv_head_lock *bh_lockp;	/* pointer to lock info struct */
-} bhv_head_t;
-
-/*
- * Behavior descriptor.	 Descriptor associated with each behavior.
- * Contained within the behavior's private data structure.
- */
-typedef struct bhv_desc {
-	void		*bd_pdata;	/* private data for this behavior */
-	void		*bd_vobj;	/* virtual object associated with */
-	void		*bd_ops;	/* ops for this behavior */
-	struct bhv_desc *bd_next;	/* next behavior in chain */
-} bhv_desc_t;
-
-/*
- * Behavior identity field.  A behavior's identity determines the position
- * where it lives within a behavior chain, and it's always the first field
- * of the behavior's ops vector. The optional id field further identifies the
- * subsystem responsible for the behavior.
- */
-typedef struct bhv_identity {
-	__u16	bi_id;		/* owning subsystem id */
-	__u16	bi_position;	/* position in chain */
-} bhv_identity_t;
-
-typedef bhv_identity_t bhv_position_t;
-
-#define BHV_IDENTITY_INIT(id,pos)	{id, pos}
-#define BHV_IDENTITY_INIT_POSITION(pos) BHV_IDENTITY_INIT(0, pos)
-
-/*
- * Define boundaries of position values.
- */
-#define BHV_POSITION_INVALID	0	/* invalid position number */
-#define BHV_POSITION_BASE	1	/* base (last) implementation layer */
-#define BHV_POSITION_TOP	63	/* top (first) implementation layer */
-
-/*
- * Plumbing macros.
- */
-#define BHV_HEAD_FIRST(bhp)	(ASSERT((bhp)->bh_first), (bhp)->bh_first)
-#define BHV_NEXT(bdp)		(ASSERT((bdp)->bd_next), (bdp)->bd_next)
-#define BHV_NEXTNULL(bdp)	((bdp)->bd_next)
-#define BHV_VOBJ(bdp)		(ASSERT((bdp)->bd_vobj), (bdp)->bd_vobj)
-#define BHV_VOBJNULL(bdp)	((bdp)->bd_vobj)
-#define BHV_PDATA(bdp)		(bdp)->bd_pdata
-#define BHV_OPS(bdp)		(bdp)->bd_ops
-#define BHV_IDENTITY(bdp)	((bhv_identity_t *)(bdp)->bd_ops)
-#define BHV_POSITION(bdp)	(BHV_IDENTITY(bdp)->bi_position)
-
-extern void bhv_head_init(bhv_head_t *, char *);
-extern void bhv_head_destroy(bhv_head_t *);
-extern int  bhv_insert(bhv_head_t *, bhv_desc_t *);
-extern void bhv_insert_initial(bhv_head_t *, bhv_desc_t *);
-
-/*
- * Initialize a new behavior descriptor.
- * Arguments:
- *   bdp - pointer to behavior descriptor
- *   pdata - pointer to behavior's private data
- *   vobj - pointer to associated virtual object
- *   ops - pointer to ops for this behavior
- */
-#define bhv_desc_init(bdp, pdata, vobj, ops)		\
- {							\
-	(bdp)->bd_pdata = pdata;			\
-	(bdp)->bd_vobj = vobj;				\
-	(bdp)->bd_ops = ops;				\
-	(bdp)->bd_next = NULL;				\
- }
-
-/*
- * Remove a behavior descriptor from a behavior chain.
- */
-#define bhv_remove(bhp, bdp)				\
- {							\
-	if ((bhp)->bh_first == (bdp)) {			\
-		/*					\
-		* Remove from front of chain.		\
-		* Atomic wrt oip's.			\
-		*/					\
-	       (bhp)->bh_first = (bdp)->bd_next;	\
-	} else {					\
-	       /* remove from non-front of chain */	\
-	       bhv_remove_not_first(bhp, bdp);		\
-	}						\
-	(bdp)->bd_vobj = NULL;				\
- }
-
-/*
- * Behavior module prototypes.
- */
-extern void		bhv_remove_not_first(bhv_head_t *bhp, bhv_desc_t *bdp);
-extern bhv_desc_t *	bhv_lookup(bhv_head_t *bhp, void *ops);
-extern bhv_desc_t *	bhv_lookup_range(bhv_head_t *bhp, int low, int high);
-extern bhv_desc_t *	bhv_base(bhv_head_t *bhp);
-
-/* No bhv locking on Linux */
-#define bhv_lookup_unlocked	bhv_lookup
-#define bhv_base_unlocked	bhv_base
-
-#endif /* __XFS_BEHAVIOR_H__ */
diff -Nru a/fs/xfs/linux/xfs_buf.c b/fs/xfs/linux/xfs_buf.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/fs/xfs/linux/xfs_buf.c	Tue Feb  3 19:45:16 2004
@@ -0,0 +1,2058 @@
+/*
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+
+/*
+ *	page_buf.c
+ *
+ *	The page_buf module provides an abstract buffer cache model on top of
+ *	the Linux page cache.  Cached metadata blocks for a file system are
+ *	hashed to the inode for the block device.  The page_buf module
+ *	assembles buffer (page_buf_t) objects on demand to aggregate such
+ *	cached pages for I/O.
+ *
+ *
+ *      Written by Steve Lord, Jim Mostek, Russell Cattelan
+ *		    and Rajagopal Ananthanarayanan ("ananth") at SGI.
+ *
+ */
+
+#include <linux/stddef.h>
+#include <linux/errno.h>
+#include <linux/slab.h>
+#include <linux/pagemap.h>
+#include <linux/init.h>
+#include <linux/vmalloc.h>
+#include <linux/blkdev.h>
+#include <linux/bio.h>
+#include <linux/sysctl.h>
+#include <linux/proc_fs.h>
+#include <linux/workqueue.h>
+#include <linux/suspend.h>
+#include <linux/percpu.h>
+
+#include <support/ktrace.h>
+#include <support/debug.h>
+#include "kmem.h"
+
+#include "xfs_types.h"
+#include "xfs_cred.h"
+#include "xfs_lrw.h"
+#include "xfs_buf.h"
+
+#define BBSHIFT		9
+#define BN_ALIGN_MASK	((1 << (PAGE_CACHE_SHIFT - BBSHIFT)) - 1)
+
+#ifndef GFP_READAHEAD
+#define GFP_READAHEAD	(__GFP_NOWARN|__GFP_NORETRY)
+#endif
+
+/*
+ * File wide globals
+ */
+
+STATIC kmem_cache_t *pagebuf_cache;
+STATIC void pagebuf_daemon_wakeup(void);
+STATIC void pagebuf_delwri_queue(page_buf_t *, int);
+STATIC struct workqueue_struct *pagebuf_logio_workqueue;
+STATIC struct workqueue_struct *pagebuf_dataio_workqueue;
+
+/*
+ * Pagebuf module configuration parameters, exported via
+ * /proc/sys/vm/pagebuf
+ */
+
+typedef struct pb_sysctl_val {
+	int	min;
+	int	val;
+	int	max;
+} pb_sysctl_val_t;
+
+struct {
+	pb_sysctl_val_t	flush_interval;	/* interval between runs of the
+					 * delwri flush daemon.  */
+	pb_sysctl_val_t	age_buffer;	/* time for buffer to age before
+					 * we flush it.  */
+	pb_sysctl_val_t	stats_clear;	/* clear the pagebuf stats */
+	pb_sysctl_val_t	debug;		/* debug tracing on or off */
+} pb_params = {
+			  /*	MIN	DFLT	MAX	*/
+	.flush_interval	= {	HZ/2,	HZ,	30*HZ	},
+	.age_buffer	= {	1*HZ,	15*HZ,	300*HZ	},
+	.stats_clear	= {	0,	0,	1	},
+	.debug		= {	0,	0,	1	},
+};
+
+enum {
+	PB_FLUSH_INT = 1,
+	PB_FLUSH_AGE = 2,
+	PB_STATS_CLEAR = 3,
+	PB_DEBUG = 4,
+};
+
+/*
+ * Pagebuf statistics variables
+ */
+
+struct pbstats {
+	u_int32_t	pb_get;
+	u_int32_t	pb_create;
+	u_int32_t	pb_get_locked;
+	u_int32_t	pb_get_locked_waited;
+	u_int32_t	pb_busy_locked;
+	u_int32_t	pb_miss_locked;
+	u_int32_t	pb_page_retries;
+	u_int32_t	pb_page_found;
+	u_int32_t	pb_get_read;
+} pbstats;
+DEFINE_PER_CPU(struct pbstats, pbstats);
+
+/* We don't disable preempt, not too worried about poking the
+ * wrong cpu's stat for now */
+#define PB_STATS_INC(count)	(__get_cpu_var(pbstats).count++)
+
+/*
+ * Pagebuf debugging
+ */
+
+#ifdef PAGEBUF_TRACE
+void
+pagebuf_trace(
+	page_buf_t	*pb,
+	char		*id,
+	void		*data,
+	void		*ra)
+{
+	if (!pb_params.debug.val)
+		return;
+	ktrace_enter(pagebuf_trace_buf,
+		pb, id,
+		(void *)(unsigned long)pb->pb_flags,
+		(void *)(unsigned long)pb->pb_hold.counter,
+		(void *)(unsigned long)pb->pb_sema.count.counter,
+		(void *)current,
+		data, ra,
+		(void *)(unsigned long)((pb->pb_file_offset>>32) & 0xffffffff),
+		(void *)(unsigned long)(pb->pb_file_offset & 0xffffffff),
+		(void *)(unsigned long)pb->pb_buffer_length,
+		NULL, NULL, NULL, NULL, NULL);
+}
+ktrace_t *pagebuf_trace_buf;
+#define PAGEBUF_TRACE_SIZE	4096
+#define PB_TRACE(pb, id, data)	\
+	pagebuf_trace(pb, id, (void *)data, (void *)__builtin_return_address(0))
+#else
+#define PB_TRACE(pb, id, data)	do { } while (0)
+#endif
+
+#ifdef PAGEBUF_LOCK_TRACKING
+# define PB_SET_OWNER(pb)	((pb)->pb_last_holder = current->pid)
+# define PB_CLEAR_OWNER(pb)	((pb)->pb_last_holder = -1)
+# define PB_GET_OWNER(pb)	((pb)->pb_last_holder)
+#else
+# define PB_SET_OWNER(pb)	do { } while (0)
+# define PB_CLEAR_OWNER(pb)	do { } while (0)
+# define PB_GET_OWNER(pb)	do { } while (0)
+#endif
+
+/*
+ * Pagebuf allocation / freeing.
+ */
+
+#define pb_to_gfp(flags) \
+	(((flags) & PBF_READ_AHEAD) ? GFP_READAHEAD : \
+	 ((flags) & PBF_DONT_BLOCK) ? GFP_NOFS : GFP_KERNEL)
+
+#define pb_to_km(flags) \
+	 (((flags) & PBF_DONT_BLOCK) ? KM_NOFS : KM_SLEEP)
+
+
+#define pagebuf_allocate(flags) \
+	kmem_zone_alloc(pagebuf_cache, pb_to_km(flags))
+#define pagebuf_deallocate(pb) \
+	kmem_zone_free(pagebuf_cache, (pb));
+
+/*
+ * Pagebuf hashing
+ */
+
+#define NBITS	8
+#define NHASH	(1<<NBITS)
+
+typedef struct {
+	struct list_head	pb_hash;
+	spinlock_t		pb_hash_lock;
+} pb_hash_t;
+
+STATIC pb_hash_t	pbhash[NHASH];
+#define pb_hash(pb)	&pbhash[pb->pb_hash_index]
+
+STATIC int
+_bhash(
+	struct block_device *bdev,
+	loff_t		base)
+{
+	int		bit, hval;
+
+	base >>= 9;
+	base ^= (unsigned long)bdev / L1_CACHE_BYTES;
+	for (bit = hval = 0; base && bit < sizeof(base) * 8; bit += NBITS) {
+		hval ^= (int)base & (NHASH-1);
+		base >>= NBITS;
+	}
+	return hval;
+}
+
+/*
+ * Mapping of multi-page buffers into contiguous virtual space
+ */
+
+STATIC void *pagebuf_mapout_locked(page_buf_t *);
+
+typedef struct a_list {
+	void		*vm_addr;
+	struct a_list	*next;
+} a_list_t;
+
+STATIC a_list_t		*as_free_head;
+STATIC int		as_list_len;
+STATIC spinlock_t	as_lock = SPIN_LOCK_UNLOCKED;
+
+/*
+ * Try to batch vunmaps because they are costly.
+ */
+STATIC void
+free_address(
+	void		*addr)
+{
+	a_list_t	*aentry;
+
+	aentry = kmalloc(sizeof(a_list_t), GFP_ATOMIC);
+	if (aentry) {
+		spin_lock(&as_lock);
+		aentry->next = as_free_head;
+		aentry->vm_addr = addr;
+		as_free_head = aentry;
+		as_list_len++;
+		spin_unlock(&as_lock);
+	} else {
+		vunmap(addr);
+	}
+}
+
+STATIC void
+purge_addresses(void)
+{
+	a_list_t	*aentry, *old;
+
+	if (as_free_head == NULL)
+		return;
+
+	spin_lock(&as_lock);
+	aentry = as_free_head;
+	as_free_head = NULL;
+	as_list_len = 0;
+	spin_unlock(&as_lock);
+
+	while ((old = aentry) != NULL) {
+		vunmap(aentry->vm_addr);
+		aentry = aentry->next;
+		kfree(old);
+	}
+}
+
+/*
+ *	Internal pagebuf object manipulation
+ */
+
+STATIC void
+_pagebuf_initialize(
+	page_buf_t		*pb,
+	pb_target_t		*target,
+	loff_t			range_base,
+	size_t			range_length,
+	page_buf_flags_t	flags)
+{
+	/*
+	 * We don't want certain flags to appear in pb->pb_flags.
+	 */
+	flags &= ~(PBF_LOCK|PBF_MAPPED|PBF_DONT_BLOCK|PBF_READ_AHEAD);
+
+	memset(pb, 0, sizeof(page_buf_t));
+	atomic_set(&pb->pb_hold, 1);
+	init_MUTEX_LOCKED(&pb->pb_iodonesema);
+	INIT_LIST_HEAD(&pb->pb_list);
+	INIT_LIST_HEAD(&pb->pb_hash_list);
+	init_MUTEX_LOCKED(&pb->pb_sema); /* held, no waiters */
+	PB_SET_OWNER(pb);
+	pb->pb_target = target;
+	pb->pb_file_offset = range_base;
+	/*
+	 * Set buffer_length and count_desired to the same value initially.
+	 * IO routines should use count_desired, which will be the same in
+	 * most cases but may be reset (e.g. XFS recovery).
+	 */
+	pb->pb_buffer_length = pb->pb_count_desired = range_length;
+	pb->pb_flags = flags | PBF_NONE;
+	pb->pb_bn = PAGE_BUF_DADDR_NULL;
+	atomic_set(&pb->pb_pin_count, 0);
+	init_waitqueue_head(&pb->pb_waiters);
+
+	PB_STATS_INC(pb_create);
+	PB_TRACE(pb, "initialize", target);
+}
+
+/*
+ * Allocate a page array capable of holding a specified number
+ * of pages, and point the page buf at it.
+ */
+STATIC int
+_pagebuf_get_pages(
+	page_buf_t		*pb,
+	int			page_count,
+	page_buf_flags_t	flags)
+{
+	int			gpf_mask = pb_to_gfp(flags);
+
+	/* Make sure that we have a page list */
+	if (pb->pb_pages == NULL) {
+		pb->pb_offset = page_buf_poff(pb->pb_file_offset);
+		pb->pb_page_count = page_count;
+		if (page_count <= PB_PAGES) {
+			pb->pb_pages = pb->pb_page_array;
+		} else {
+			pb->pb_pages = kmalloc(sizeof(struct page *) *
+					page_count, gpf_mask);
+			if (pb->pb_pages == NULL)
+				return -ENOMEM;
+		}
+		memset(pb->pb_pages, 0, sizeof(struct page *) * page_count);
+	}
+	return 0;
+}
+
+/*
+ * Walk a pagebuf releasing all the pages contained within it.
+ */
+STATIC inline void
+_pagebuf_freepages(
+	page_buf_t		*pb)
+{
+	int			buf_index;
+
+	for (buf_index = 0; buf_index < pb->pb_page_count; buf_index++) {
+		struct page	*page = pb->pb_pages[buf_index];
+
+		if (page) {
+			pb->pb_pages[buf_index] = NULL;
+			page_cache_release(page);
+		}
+	}
+}
+
+/*
+ *	pagebuf_free
+ *
+ *	pagebuf_free releases the specified buffer.  The modification
+ *	state of any associated pages is left unchanged.
+ */
+void
+pagebuf_free(
+	page_buf_t		*pb)
+{
+	PB_TRACE(pb, "free", 0);
+
+	if (pb->pb_flags & _PBF_LOCKABLE) {
+		 pb_hash_t	*hash = pb_hash(pb);
+
+		spin_lock(&hash->pb_hash_lock);
+		/*
+		 * Someone grabbed a reference while we weren't looking,
+		 * try again later.
+		 */
+		if (unlikely(atomic_read(&pb->pb_hold))) {
+			spin_unlock(&hash->pb_hash_lock);
+			return;
+		} else if (!list_empty(&pb->pb_hash_list))
+			list_del_init(&pb->pb_hash_list);
+		spin_unlock(&hash->pb_hash_lock);
+	}
+
+	/* release any virtual mapping */ ;
+	if (pb->pb_flags & _PBF_ADDR_ALLOCATED) {
+		void *vaddr = pagebuf_mapout_locked(pb);
+		if (vaddr) {
+			free_address(vaddr);
+		}
+	}
+
+	if (pb->pb_flags & _PBF_MEM_ALLOCATED) {
+		if (pb->pb_pages) {
+			/* release the pages in the address list */
+			if ((pb->pb_pages[0]) &&
+			    (pb->pb_flags & _PBF_MEM_SLAB)) {
+				kfree(pb->pb_addr);
+			} else {
+				_pagebuf_freepages(pb);
+			}
+			if (pb->pb_pages != pb->pb_page_array)
+				kfree(pb->pb_pages);
+			pb->pb_pages = NULL;
+		}
+		pb->pb_flags &= ~(_PBF_MEM_ALLOCATED|_PBF_MEM_SLAB);
+	}
+
+	pagebuf_deallocate(pb);
+}
+
+/*
+ *	_pagebuf_lookup_pages
+ *
+ *	_pagebuf_lookup_pages finds all pages which match the buffer
+ *	in question and the range of file offsets supplied,
+ *	and builds the page list for the buffer, if the
+ *	page list is not already formed or if not all of the pages are
+ *	already in the list. Invalid pages (pages which have not yet been
+ *	read in from disk) are assigned for any pages which are not found.
+ */
+STATIC int
+_pagebuf_lookup_pages(
+	page_buf_t		*pb,
+	struct address_space	*aspace,
+	page_buf_flags_t	flags)
+{
+	loff_t			next_buffer_offset;
+	unsigned long		page_count, pi, index;
+	struct page		*page;
+	int			gfp_mask, retry_count = 5, rval = 0;
+	int			all_mapped, good_pages, nbytes;
+	unsigned int		blocksize, sectorshift;
+	size_t			size, offset;
+
+
+	/* For pagebufs where we want to map an address, do not use
+	 * highmem pages - so that we do not need to use kmap resources
+	 * to access the data.
+	 *
+	 * For pages where the caller has indicated there may be resource
+	 * contention (e.g. called from a transaction) do not flush
+	 * delalloc pages to obtain memory.
+	 */
+
+	if (flags & PBF_READ_AHEAD) {
+		gfp_mask = GFP_READAHEAD;
+		retry_count = 0;
+	} else if (flags & PBF_DONT_BLOCK) {
+		gfp_mask = GFP_NOFS;
+	} else if (flags & PBF_MAPPABLE) {
+		gfp_mask = GFP_KERNEL;
+	} else {
+		gfp_mask = GFP_HIGHUSER;
+	}
+
+	next_buffer_offset = pb->pb_file_offset + pb->pb_buffer_length;
+
+	good_pages = page_count = (page_buf_btoc(next_buffer_offset) -
+				   page_buf_btoct(pb->pb_file_offset));
+
+	if (pb->pb_flags & _PBF_ALL_PAGES_MAPPED) {
+		/* Bring pages forward in cache */
+		for (pi = 0; pi < page_count; pi++) {
+			mark_page_accessed(pb->pb_pages[pi]);
+		}
+		if ((flags & PBF_MAPPED) && !(pb->pb_flags & PBF_MAPPED)) {
+			all_mapped = 1;
+			goto mapit;
+		}
+		return 0;
+	}
+
+	/* Ensure pb_pages field has been initialised */
+	rval = _pagebuf_get_pages(pb, page_count, flags);
+	if (rval)
+		return rval;
+
+	rval = pi = 0;
+	blocksize = pb->pb_target->pbr_bsize;
+	sectorshift = pb->pb_target->pbr_sshift;
+	size = pb->pb_count_desired;
+	offset = pb->pb_offset;
+
+	/* Enter the pages in the page list */
+	index = (pb->pb_file_offset - pb->pb_offset) >> PAGE_CACHE_SHIFT;
+	for (all_mapped = 1; pi < page_count; pi++, index++) {
+		if (pb->pb_pages[pi] == 0) {
+		      retry:
+			page = find_or_create_page(aspace, index, gfp_mask);
+			if (!page) {
+				if (--retry_count > 0) {
+					PB_STATS_INC(pb_page_retries);
+					pagebuf_daemon_wakeup();
+					current->state = TASK_UNINTERRUPTIBLE;
+					schedule_timeout(10);
+					goto retry;
+				}
+				rval = -ENOMEM;
+				all_mapped = 0;
+				continue;
+			}
+			PB_STATS_INC(pb_page_found);
+			mark_page_accessed(page);
+			pb->pb_pages[pi] = page;
+		} else {
+			page = pb->pb_pages[pi];
+			lock_page(page);
+		}
+
+		nbytes = PAGE_CACHE_SIZE - offset;
+		if (nbytes > size)
+			nbytes = size;
+		size -= nbytes;
+
+		if (!PageUptodate(page)) {
+			if (blocksize == PAGE_CACHE_SIZE) {
+				if (flags & PBF_READ)
+					pb->pb_locked = 1;
+				good_pages--;
+			} else if (!PagePrivate(page)) {
+				unsigned long	i, range;
+
+				/*
+				 * In this case page->private holds a bitmap
+				 * of uptodate sectors within the page
+				 */
+				ASSERT(blocksize < PAGE_CACHE_SIZE);
+				range = (offset + nbytes) >> sectorshift;
+				for (i = offset >> sectorshift; i < range; i++)
+					if (!test_bit(i, &page->private))
+						break;
+				if (i != range)
+					good_pages--;
+			} else {
+				good_pages--;
+			}
+		}
+		offset = 0;
+	}
+
+	if (!pb->pb_locked) {
+		for (pi = 0; pi < page_count; pi++) {
+			if (pb->pb_pages[pi])
+				unlock_page(pb->pb_pages[pi]);
+		}
+	}
+
+mapit:
+	pb->pb_flags |= _PBF_MEM_ALLOCATED;
+	if (all_mapped) {
+		pb->pb_flags |= _PBF_ALL_PAGES_MAPPED;
+
+		/* A single page buffer is always mappable */
+		if (page_count == 1) {
+			pb->pb_addr = (caddr_t)
+				page_address(pb->pb_pages[0]) + pb->pb_offset;
+			pb->pb_flags |= PBF_MAPPED;
+		} else if (flags & PBF_MAPPED) {
+			if (as_list_len > 64)
+				purge_addresses();
+			pb->pb_addr = vmap(pb->pb_pages, page_count,
+					VM_MAP, PAGE_KERNEL);
+			if (pb->pb_addr == NULL)
+				return -ENOMEM;
+			pb->pb_addr += pb->pb_offset;
+			pb->pb_flags |= PBF_MAPPED | _PBF_ADDR_ALLOCATED;
+		}
+	}
+	/* If some pages were found with data in them
+	 * we are not in PBF_NONE state.
+	 */
+	if (good_pages != 0) {
+		pb->pb_flags &= ~(PBF_NONE);
+		if (good_pages != page_count) {
+			pb->pb_flags |= PBF_PARTIAL;
+		}
+	}
+
+	PB_TRACE(pb, "lookup_pages", (long)good_pages);
+
+	return rval;
+}
+
+/*
+ *	Finding and Reading Buffers
+ */
+
+/*
+ *	_pagebuf_find
+ *
+ *	Looks up, and creates if absent, a lockable buffer for
+ *	a given range of an inode.  The buffer is returned
+ *	locked.	 If other overlapping buffers exist, they are
+ *	released before the new buffer is created and locked,
+ *	which may imply that this call will block until those buffers
+ *	are unlocked.  No I/O is implied by this call.
+ */
+STATIC page_buf_t *
+_pagebuf_find(				/* find buffer for block	*/
+	pb_target_t		*target,/* target for block		*/
+	loff_t			ioff,	/* starting offset of range	*/
+	size_t			isize,	/* length of range		*/
+	page_buf_flags_t	flags,	/* PBF_TRYLOCK			*/
+	page_buf_t		*new_pb)/* newly allocated buffer	*/
+{
+	loff_t			range_base;
+	size_t			range_length;
+	int			hval;
+	pb_hash_t		*h;
+	struct list_head	*p;
+	page_buf_t		*pb;
+	int			not_locked;
+
+	range_base = (ioff << BBSHIFT);
+	range_length = (isize << BBSHIFT);
+
+	/* Ensure we never do IOs smaller than the sector size */
+	BUG_ON(range_length < (1 << target->pbr_sshift));
+
+	/* Ensure we never do IOs that are not sector aligned */
+	BUG_ON(range_base & (loff_t)target->pbr_smask);
+
+	hval = _bhash(target->pbr_bdev, range_base);
+	h = &pbhash[hval];
+
+	spin_lock(&h->pb_hash_lock);
+	list_for_each(p, &h->pb_hash) {
+		pb = list_entry(p, page_buf_t, pb_hash_list);
+
+		if (pb->pb_target == target &&
+		    pb->pb_file_offset == range_base &&
+		    pb->pb_buffer_length == range_length &&
+		    atomic_read(&pb->pb_hold)) {
+			/* If we look at something bring it to the
+			 * front of the list for next time
+			 */
+			atomic_inc(&pb->pb_hold);
+			list_move(&pb->pb_hash_list, &h->pb_hash);
+			goto found;
+		}
+	}
+
+	/* No match found */
+	if (new_pb) {
+		_pagebuf_initialize(new_pb, target, range_base,
+				range_length, flags | _PBF_LOCKABLE);
+		new_pb->pb_hash_index = hval;
+		list_add(&new_pb->pb_hash_list, &h->pb_hash);
+	} else {
+		PB_STATS_INC(pb_miss_locked);
+	}
+
+	spin_unlock(&h->pb_hash_lock);
+	return (new_pb);
+
+found:
+	spin_unlock(&h->pb_hash_lock);
+
+	/* Attempt to get the semaphore without sleeping,
+	 * if this does not work then we need to drop the
+	 * spinlock and do a hard attempt on the semaphore.
+	 */
+	not_locked = down_trylock(&pb->pb_sema);
+	if (not_locked) {
+		if (!(flags & PBF_TRYLOCK)) {
+			/* wait for buffer ownership */
+			PB_TRACE(pb, "get_lock", 0);
+			pagebuf_lock(pb);
+			PB_STATS_INC(pb_get_locked_waited);
+		} else {
+			/* We asked for a trylock and failed, no need
+			 * to look at file offset and length here, we
+			 * know that this pagebuf at least overlaps our
+			 * pagebuf and is locked, therefore our buffer
+			 * either does not exist, or is this buffer
+			 */
+
+			pagebuf_rele(pb);
+			PB_STATS_INC(pb_busy_locked);
+			return (NULL);
+		}
+	} else {
+		/* trylock worked */
+		PB_SET_OWNER(pb);
+	}
+
+	if (pb->pb_flags & PBF_STALE)
+		pb->pb_flags &= PBF_MAPPABLE | \
+				PBF_MAPPED | \
+				_PBF_LOCKABLE | \
+				_PBF_ALL_PAGES_MAPPED | \
+				_PBF_ADDR_ALLOCATED | \
+				_PBF_MEM_ALLOCATED | \
+				_PBF_MEM_SLAB;
+	PB_TRACE(pb, "got_lock", 0);
+	PB_STATS_INC(pb_get_locked);
+	return (pb);
+}
+
+
+/*
+ *	pagebuf_find
+ *
+ *	pagebuf_find returns a buffer matching the specified range of
+ *	data for the specified target, if any of the relevant blocks
+ *	are in memory.  The buffer may have unallocated holes, if
+ *	some, but not all, of the blocks are in memory.  Even where
+ *	pages are present in the buffer, not all of every page may be
+ *	valid.
+ */
+page_buf_t *
+pagebuf_find(				/* find buffer for block	*/
+					/* if the block is in memory	*/
+	pb_target_t		*target,/* target for block		*/
+	loff_t			ioff,	/* starting offset of range	*/
+	size_t			isize,	/* length of range		*/
+	page_buf_flags_t	flags)	/* PBF_TRYLOCK			*/
+{
+	return _pagebuf_find(target, ioff, isize, flags, NULL);
+}
+
+/*
+ *	pagebuf_get
+ *
+ *	pagebuf_get assembles a buffer covering the specified range.
+ *	Some or all of the blocks in the range may be valid.  Storage
+ *	in memory for all portions of the buffer will be allocated,
+ *	although backing storage may not be.  If PBF_READ is set in
+ *	flags, pagebuf_iostart is called also.
+ */
+page_buf_t *
+pagebuf_get(				/* allocate a buffer		*/
+	pb_target_t		*target,/* target for buffer		*/
+	loff_t			ioff,	/* starting offset of range	*/
+	size_t			isize,	/* length of range		*/
+	page_buf_flags_t	flags)	/* PBF_TRYLOCK			*/
+{
+	page_buf_t		*pb, *new_pb;
+	int			error;
+
+	new_pb = pagebuf_allocate(flags);
+	if (unlikely(!new_pb))
+		return (NULL);
+
+	pb = _pagebuf_find(target, ioff, isize, flags, new_pb);
+	if (pb != new_pb) {
+		pagebuf_deallocate(new_pb);
+		if (unlikely(!pb))
+			return (NULL);
+	}
+
+	PB_STATS_INC(pb_get);
+
+	/* fill in any missing pages */
+	error = _pagebuf_lookup_pages(pb, pb->pb_target->pbr_mapping, flags);
+	if (unlikely(error)) {
+		pagebuf_free(pb);
+		return (NULL);
+	}
+
+	/*
+	 * Always fill in the block number now, the mapped cases can do
+	 * their own overlay of this later.
+	 */
+	pb->pb_bn = ioff;
+	pb->pb_count_desired = pb->pb_buffer_length;
+
+	if (flags & PBF_READ) {
+		if (PBF_NOT_DONE(pb)) {
+			PB_TRACE(pb, "get_read", (unsigned long)flags);
+			PB_STATS_INC(pb_get_read);
+			pagebuf_iostart(pb, flags);
+		} else if (flags & PBF_ASYNC) {
+			PB_TRACE(pb, "get_read_async", (unsigned long)flags);
+			/*
+			 * Read ahead call which is already satisfied,
+			 * drop the buffer
+			 */
+			if (flags & (PBF_LOCK | PBF_TRYLOCK))
+				pagebuf_unlock(pb);
+			pagebuf_rele(pb);
+			return NULL;
+		} else {
+			PB_TRACE(pb, "get_read_done", (unsigned long)flags);
+			/* We do not want read in the flags */
+			pb->pb_flags &= ~PBF_READ;
+		}
+	} else {
+		PB_TRACE(pb, "get_write", (unsigned long)flags);
+	}
+	return (pb);
+}
+
+/*
+ * Create a skeletal pagebuf (no pages associated with it).
+ */
+page_buf_t *
+pagebuf_lookup(
+	struct pb_target	*target,
+	loff_t			ioff,
+	size_t			isize,
+	page_buf_flags_t	flags)
+{
+	page_buf_t		*pb;
+
+	pb = pagebuf_allocate(flags);
+	if (pb) {
+		_pagebuf_initialize(pb, target, ioff, isize, flags);
+	}
+	return pb;
+}
+
+/*
+ * If we are not low on memory then do the readahead in a deadlock
+ * safe manner.
+ */
+void
+pagebuf_readahead(
+	pb_target_t		*target,
+	loff_t			ioff,
+	size_t			isize,
+	page_buf_flags_t	flags)
+{
+	struct backing_dev_info *bdi;
+
+	bdi = target->pbr_mapping->backing_dev_info;
+	if (bdi_read_congested(bdi))
+		return;
+	if (bdi_write_congested(bdi))
+		return;
+
+	flags |= (PBF_TRYLOCK|PBF_READ|PBF_ASYNC|PBF_MAPPABLE|PBF_READ_AHEAD);
+	pagebuf_get(target, ioff, isize, flags);
+}
+
+page_buf_t *
+pagebuf_get_empty(
+	size_t			len,
+	pb_target_t		*target)
+{
+	page_buf_t		*pb;
+
+	pb = pagebuf_allocate(_PBF_LOCKABLE);
+	if (pb)
+		_pagebuf_initialize(pb, target, 0, len, _PBF_LOCKABLE);
+	return pb;
+}
+
+static inline struct page *
+mem_to_page(
+	void			*addr)
+{
+	if (((unsigned long)addr < VMALLOC_START) ||
+	    ((unsigned long)addr >= VMALLOC_END)) {
+		return virt_to_page(addr);
+	} else {
+		return vmalloc_to_page(addr);
+	}
+}
+
+int
+pagebuf_associate_memory(
+	page_buf_t		*pb,
+	void			*mem,
+	size_t			len)
+{
+	int			rval;
+	int			i = 0;
+	size_t			ptr;
+	size_t			end, end_cur;
+	off_t			offset;
+	int			page_count;
+
+	page_count = PAGE_CACHE_ALIGN(len) >> PAGE_CACHE_SHIFT;
+	offset = (off_t) mem - ((off_t)mem & PAGE_CACHE_MASK);
+	if (offset && (len > PAGE_CACHE_SIZE))
+		page_count++;
+
+	/* Free any previous set of page pointers */
+	if (pb->pb_pages && (pb->pb_pages != pb->pb_page_array)) {
+		kfree(pb->pb_pages);
+	}
+	pb->pb_pages = NULL;
+	pb->pb_addr = mem;
+
+	rval = _pagebuf_get_pages(pb, page_count, 0);
+	if (rval)
+		return rval;
+
+	pb->pb_offset = offset;
+	ptr = (size_t) mem & PAGE_CACHE_MASK;
+	end = PAGE_CACHE_ALIGN((size_t) mem + len);
+	end_cur = end;
+	/* set up first page */
+	pb->pb_pages[0] = mem_to_page(mem);
+
+	ptr += PAGE_CACHE_SIZE;
+	pb->pb_page_count = ++i;
+	while (ptr < end) {
+		pb->pb_pages[i] = mem_to_page((void *)ptr);
+		pb->pb_page_count = ++i;
+		ptr += PAGE_CACHE_SIZE;
+	}
+	pb->pb_locked = 0;
+
+	pb->pb_count_desired = pb->pb_buffer_length = len;
+	pb->pb_flags |= PBF_MAPPED;
+
+	return 0;
+}
+
+page_buf_t *
+pagebuf_get_no_daddr(
+	size_t			len,
+	pb_target_t		*target)
+{
+	int			rval;
+	void			*rmem = NULL;
+	page_buf_flags_t	flags = _PBF_LOCKABLE | PBF_FORCEIO;
+	page_buf_t		*pb;
+	size_t			tlen = 0;
+
+	if (unlikely(len > 0x20000))
+		return NULL;
+
+	pb = pagebuf_allocate(flags);
+	if (!pb)
+		return NULL;
+
+	_pagebuf_initialize(pb, target, 0, len, flags);
+
+	do {
+		if (tlen == 0) {
+			tlen = len; /* first time */
+		} else {
+			kfree(rmem); /* free the mem from the previous try */
+			tlen <<= 1; /* double the size and try again */
+		}
+		if ((rmem = kmalloc(tlen, GFP_KERNEL)) == 0) {
+			pagebuf_free(pb);
+			return NULL;
+		}
+	} while ((size_t)rmem != ((size_t)rmem & ~target->pbr_smask));
+
+	if ((rval = pagebuf_associate_memory(pb, rmem, len)) != 0) {
+		kfree(rmem);
+		pagebuf_free(pb);
+		return NULL;
+	}
+	/* otherwise pagebuf_free just ignores it */
+	pb->pb_flags |= (_PBF_MEM_ALLOCATED | _PBF_MEM_SLAB);
+	PB_CLEAR_OWNER(pb);
+	up(&pb->pb_sema);	/* Return unlocked pagebuf */
+
+	PB_TRACE(pb, "no_daddr", rmem);
+
+	return pb;
+}
+
+
+/*
+ *	pagebuf_hold
+ *
+ *	Increment reference count on buffer, to hold the buffer concurrently
+ *	with another thread which may release (free) the buffer asynchronously.
+ *
+ *	Must hold the buffer already to call this function.
+ */
+void
+pagebuf_hold(
+	page_buf_t		*pb)
+{
+	atomic_inc(&pb->pb_hold);
+	PB_TRACE(pb, "hold", 0);
+}
+
+/*
+ *	pagebuf_rele
+ *
+ *	pagebuf_rele releases a hold on the specified buffer.  If the
+ *	the hold count is 1, pagebuf_rele calls pagebuf_free.
+ */
+void
+pagebuf_rele(
+	page_buf_t		*pb)
+{
+	PB_TRACE(pb, "rele", pb->pb_relse);
+
+	if (atomic_dec_and_test(&pb->pb_hold)) {
+		int		do_free = 1;
+
+		if (pb->pb_relse) {
+			atomic_inc(&pb->pb_hold);
+			(*(pb->pb_relse)) (pb);
+			do_free = 0;
+		}
+		if (pb->pb_flags & PBF_DELWRI) {
+			pb->pb_flags |= PBF_ASYNC;
+			atomic_inc(&pb->pb_hold);
+			pagebuf_delwri_queue(pb, 0);
+			do_free = 0;
+		} else if (pb->pb_flags & PBF_FS_MANAGED) {
+			do_free = 0;
+		}
+
+		if (do_free) {
+			pagebuf_free(pb);
+		}
+	}
+}
+
+
+/*
+ *	Mutual exclusion on buffers.  Locking model:
+ *
+ *	Buffers associated with inodes for which buffer locking
+ *	is not enabled are not protected by semaphores, and are
+ *	assumed to be exclusively owned by the caller.  There is a
+ *	spinlock in the buffer, used by the caller when concurrent
+ *	access is possible.
+ */
+
+/*
+ *	pagebuf_cond_lock
+ *
+ *	pagebuf_cond_lock locks a buffer object, if it is not already locked.
+ *	Note that this in no way
+ *	locks the underlying pages, so it is only useful for synchronizing
+ *	concurrent use of page buffer objects, not for synchronizing independent
+ *	access to the underlying pages.
+ */
+int
+pagebuf_cond_lock(			/* lock buffer, if not locked	*/
+					/* returns -EBUSY if locked)	*/
+	page_buf_t		*pb)
+{
+	int			locked;
+
+	ASSERT(pb->pb_flags & _PBF_LOCKABLE);
+	locked = down_trylock(&pb->pb_sema) == 0;
+	if (locked) {
+		PB_SET_OWNER(pb);
+	}
+	PB_TRACE(pb, "cond_lock", (long)locked);
+	return(locked ? 0 : -EBUSY);
+}
+
+/*
+ *	pagebuf_lock_value
+ *
+ *	Return lock value for a pagebuf
+ */
+int
+pagebuf_lock_value(
+	page_buf_t		*pb)
+{
+	ASSERT(pb->pb_flags & _PBF_LOCKABLE);
+	return(atomic_read(&pb->pb_sema.count));
+}
+
+/*
+ *	pagebuf_lock
+ *
+ *	pagebuf_lock locks a buffer object.  Note that this in no way
+ *	locks the underlying pages, so it is only useful for synchronizing
+ *	concurrent use of page buffer objects, not for synchronizing independent
+ *	access to the underlying pages.
+ */
+int
+pagebuf_lock(
+	page_buf_t		*pb)
+{
+	ASSERT(pb->pb_flags & _PBF_LOCKABLE);
+
+	PB_TRACE(pb, "lock", 0);
+	if (atomic_read(&pb->pb_io_remaining))
+		blk_run_queues();
+	down(&pb->pb_sema);
+	PB_SET_OWNER(pb);
+	PB_TRACE(pb, "locked", 0);
+	return 0;
+}
+
+/*
+ *	pagebuf_unlock
+ *
+ *	pagebuf_unlock releases the lock on the buffer object created by
+ *	pagebuf_lock or pagebuf_cond_lock (not any
+ *	pinning of underlying pages created by pagebuf_pin).
+ */
+void
+pagebuf_unlock(				/* unlock buffer		*/
+	page_buf_t		*pb)	/* buffer to unlock		*/
+{
+	ASSERT(pb->pb_flags & _PBF_LOCKABLE);
+	PB_CLEAR_OWNER(pb);
+	up(&pb->pb_sema);
+	PB_TRACE(pb, "unlock", 0);
+}
+
+
+/*
+ *	Pinning Buffer Storage in Memory
+ */
+
+/*
+ *	pagebuf_pin
+ *
+ *	pagebuf_pin locks all of the memory represented by a buffer in
+ *	memory.  Multiple calls to pagebuf_pin and pagebuf_unpin, for
+ *	the same or different buffers affecting a given page, will
+ *	properly count the number of outstanding "pin" requests.  The
+ *	buffer may be released after the pagebuf_pin and a different
+ *	buffer used when calling pagebuf_unpin, if desired.
+ *	pagebuf_pin should be used by the file system when it wants be
+ *	assured that no attempt will be made to force the affected
+ *	memory to disk.	 It does not assure that a given logical page
+ *	will not be moved to a different physical page.
+ */
+void
+pagebuf_pin(
+	page_buf_t		*pb)
+{
+	atomic_inc(&pb->pb_pin_count);
+	PB_TRACE(pb, "pin", (long)pb->pb_pin_count.counter);
+}
+
+/*
+ *	pagebuf_unpin
+ *
+ *	pagebuf_unpin reverses the locking of memory performed by
+ *	pagebuf_pin.  Note that both functions affected the logical
+ *	pages associated with the buffer, not the buffer itself.
+ */
+void
+pagebuf_unpin(
+	page_buf_t		*pb)
+{
+	if (atomic_dec_and_test(&pb->pb_pin_count)) {
+		wake_up_all(&pb->pb_waiters);
+	}
+	PB_TRACE(pb, "unpin", (long)pb->pb_pin_count.counter);
+}
+
+int
+pagebuf_ispin(
+	page_buf_t		*pb)
+{
+	return atomic_read(&pb->pb_pin_count);
+}
+
+/*
+ *	pagebuf_wait_unpin
+ *
+ *	pagebuf_wait_unpin waits until all of the memory associated
+ *	with the buffer is not longer locked in memory.  It returns
+ *	immediately if none of the affected pages are locked.
+ */
+static inline void
+_pagebuf_wait_unpin(
+	page_buf_t		*pb)
+{
+	DECLARE_WAITQUEUE	(wait, current);
+
+	if (atomic_read(&pb->pb_pin_count) == 0)
+		return;
+
+	add_wait_queue(&pb->pb_waiters, &wait);
+	for (;;) {
+		current->state = TASK_UNINTERRUPTIBLE;
+		if (atomic_read(&pb->pb_pin_count) == 0)
+			break;
+		if (atomic_read(&pb->pb_io_remaining))
+			blk_run_queues();
+		schedule();
+	}
+	remove_wait_queue(&pb->pb_waiters, &wait);
+	current->state = TASK_RUNNING;
+}
+
+/*
+ *	Buffer Utility Routines
+ */
+
+/*
+ *	pagebuf_iodone
+ *
+ *	pagebuf_iodone marks a buffer for which I/O is in progress
+ *	done with respect to that I/O.	The pb_iodone routine, if
+ *	present, will be called as a side-effect.
+ */
+void
+pagebuf_iodone_work(
+	void			*v)
+{
+	page_buf_t		*pb = (page_buf_t *)v;
+
+	if (pb->pb_iodone) {
+		(*(pb->pb_iodone)) (pb);
+		return;
+	}
+
+	if (pb->pb_flags & PBF_ASYNC) {
+		if ((pb->pb_flags & _PBF_LOCKABLE) && !pb->pb_relse)
+			pagebuf_unlock(pb);
+		pagebuf_rele(pb);
+	}
+}
+
+void
+pagebuf_iodone(
+	page_buf_t		*pb,
+	int			dataio,
+	int			schedule)
+{
+	pb->pb_flags &= ~(PBF_READ | PBF_WRITE);
+	if (pb->pb_error == 0) {
+		pb->pb_flags &= ~(PBF_PARTIAL | PBF_NONE);
+	}
+
+	PB_TRACE(pb, "iodone", pb->pb_iodone);
+
+	if ((pb->pb_iodone) || (pb->pb_flags & PBF_ASYNC)) {
+		if (schedule) {
+			INIT_WORK(&pb->pb_iodone_work, pagebuf_iodone_work, pb);
+			queue_work(dataio ? pagebuf_dataio_workqueue :
+				pagebuf_logio_workqueue, &pb->pb_iodone_work);
+		} else {
+			pagebuf_iodone_work(pb);
+		}
+	} else {
+		up(&pb->pb_iodonesema);
+	}
+}
+
+/*
+ *	pagebuf_ioerror
+ *
+ *	pagebuf_ioerror sets the error code for a buffer.
+ */
+void
+pagebuf_ioerror(			/* mark/clear buffer error flag */
+	page_buf_t		*pb,	/* buffer to mark		*/
+	unsigned int		error)	/* error to store (0 if none)	*/
+{
+	pb->pb_error = error;
+	PB_TRACE(pb, "ioerror", (unsigned long)error);
+}
+
+/*
+ *	pagebuf_iostart
+ *
+ *	pagebuf_iostart initiates I/O on a buffer, based on the flags supplied.
+ *	If necessary, it will arrange for any disk space allocation required,
+ *	and it will break up the request if the block mappings require it.
+ *	The pb_iodone routine in the buffer supplied will only be called
+ *	when all of the subsidiary I/O requests, if any, have been completed.
+ *	pagebuf_iostart calls the pagebuf_ioinitiate routine or
+ *	pagebuf_iorequest, if the former routine is not defined, to start
+ *	the I/O on a given low-level request.
+ */
+int
+pagebuf_iostart(			/* start I/O on a buffer	  */
+	page_buf_t		*pb,	/* buffer to start		  */
+	page_buf_flags_t	flags)	/* PBF_LOCK, PBF_ASYNC, PBF_READ, */
+					/* PBF_WRITE, PBF_DELWRI,	  */
+					/* PBF_SYNC, PBF_DONT_BLOCK	  */
+{
+	int			status = 0;
+
+	PB_TRACE(pb, "iostart", (unsigned long)flags);
+
+	if (flags & PBF_DELWRI) {
+		pb->pb_flags &= ~(PBF_READ | PBF_WRITE | PBF_ASYNC);
+		pb->pb_flags |= flags &
+				(PBF_DELWRI | PBF_ASYNC | PBF_SYNC);
+		pagebuf_delwri_queue(pb, 1);
+		return status;
+	}
+
+	pb->pb_flags &= ~(PBF_READ | PBF_WRITE | PBF_ASYNC | \
+			PBF_DELWRI | PBF_READ_AHEAD | PBF_RUN_QUEUES);
+	pb->pb_flags |= flags & (PBF_READ | PBF_WRITE | PBF_ASYNC | \
+			PBF_SYNC | PBF_READ_AHEAD | PBF_RUN_QUEUES);
+
+	BUG_ON(pb->pb_bn == PAGE_BUF_DADDR_NULL);
+
+	/* For writes allow an alternate strategy routine to precede
+	 * the actual I/O request (which may not be issued at all in
+	 * a shutdown situation, for example).
+	 */
+	status = (flags & PBF_WRITE) ?
+		pagebuf_iostrategy(pb) : pagebuf_iorequest(pb);
+
+	/* Wait for I/O if we are not an async request.
+	 * Note: async I/O request completion will release the buffer,
+	 * and that can already be done by this point.  So using the
+	 * buffer pointer from here on, after async I/O, is invalid.
+	 */
+	if (!status && !(flags & PBF_ASYNC))
+		status = pagebuf_iowait(pb);
+
+	return status;
+}
+
+/*
+ * Helper routine for pagebuf_iorequest
+ */
+
+STATIC __inline__ int
+_pagebuf_iolocked(
+	page_buf_t		*pb)
+{
+	ASSERT(pb->pb_flags & (PBF_READ|PBF_WRITE));
+	if (pb->pb_flags & PBF_READ)
+		return pb->pb_locked;
+	return ((pb->pb_flags & _PBF_LOCKABLE) == 0);
+}
+
+STATIC __inline__ void
+_pagebuf_iodone(
+	page_buf_t		*pb,
+	int			schedule)
+{
+	if (atomic_dec_and_test(&pb->pb_io_remaining) == 1) {
+		pb->pb_locked = 0;
+		pagebuf_iodone(pb, (pb->pb_flags & PBF_FS_DATAIOD), schedule);
+	}
+}
+
+STATIC int
+bio_end_io_pagebuf(
+	struct bio		*bio,
+	unsigned int		bytes_done,
+	int			error)
+{
+	page_buf_t		*pb = (page_buf_t *)bio->bi_private;
+	unsigned int		i, blocksize = pb->pb_target->pbr_bsize;
+	unsigned int		sectorshift = pb->pb_target->pbr_sshift;
+	struct bio_vec		*bvec = bio->bi_io_vec;
+
+	if (bio->bi_size)
+		return 1;
+
+	if (!test_bit(BIO_UPTODATE, &bio->bi_flags))
+		pb->pb_error = EIO;
+
+	for (i = 0; i < bio->bi_vcnt; i++, bvec++) {
+		struct page	*page = bvec->bv_page;
+
+		if (pb->pb_error) {
+			SetPageError(page);
+		} else if (blocksize == PAGE_CACHE_SIZE) {
+			SetPageUptodate(page);
+		} else if (!PagePrivate(page)) {
+			unsigned int	j, range;
+
+			ASSERT(blocksize < PAGE_CACHE_SIZE);
+			range = (bvec->bv_offset + bvec->bv_len) >> sectorshift;
+			for (j = bvec->bv_offset >> sectorshift; j < range; j++)
+				set_bit(j, &page->private);
+			if (page->private == (unsigned long)(PAGE_CACHE_SIZE-1))
+				SetPageUptodate(page);
+		}
+
+		if (_pagebuf_iolocked(pb)) {
+			unlock_page(page);
+		}
+	}
+
+	_pagebuf_iodone(pb, 1);
+	bio_put(bio);
+	return 0;
+}
+
+void
+_pagebuf_ioapply(
+	page_buf_t		*pb)
+{
+	int			i, map_i, total_nr_pages, nr_pages;
+	struct bio		*bio;
+	int			offset = pb->pb_offset;
+	int			size = pb->pb_count_desired;
+	sector_t		sector = pb->pb_bn;
+	unsigned int		blocksize = pb->pb_target->pbr_bsize;
+	int			locking = _pagebuf_iolocked(pb);
+
+	total_nr_pages = pb->pb_page_count;
+	map_i = 0;
+
+	/* Special code path for reading a sub page size pagebuf in --
+	 * we populate up the whole page, and hence the other metadata
+	 * in the same page.  This optimization is only valid when the
+	 * filesystem block size and the page size are equal.
+	 */
+	if ((pb->pb_buffer_length < PAGE_CACHE_SIZE) &&
+	    (pb->pb_flags & PBF_READ) && locking &&
+	    (blocksize == PAGE_CACHE_SIZE)) {
+		bio = bio_alloc(GFP_NOIO, 1);
+
+		bio->bi_bdev = pb->pb_target->pbr_bdev;
+		bio->bi_sector = sector - (offset >> BBSHIFT);
+		bio->bi_end_io = bio_end_io_pagebuf;
+		bio->bi_private = pb;
+
+		bio_add_page(bio, pb->pb_pages[0], PAGE_CACHE_SIZE, 0);
+		size = 0;
+
+		atomic_inc(&pb->pb_io_remaining);
+
+		goto submit_io;
+	}
+
+	/* Lock down the pages which we need to for the request */
+	if (locking && (pb->pb_flags & PBF_WRITE) && (pb->pb_locked == 0)) {
+		for (i = 0; size; i++) {
+			int		nbytes = PAGE_CACHE_SIZE - offset;
+			struct page	*page = pb->pb_pages[i];
+
+			if (nbytes > size)
+				nbytes = size;
+
+			lock_page(page);
+
+			size -= nbytes;
+			offset = 0;
+		}
+		offset = pb->pb_offset;
+		size = pb->pb_count_desired;
+	}
+
+next_chunk:
+	atomic_inc(&pb->pb_io_remaining);
+	nr_pages = BIO_MAX_SECTORS >> (PAGE_SHIFT - BBSHIFT);
+	if (nr_pages > total_nr_pages)
+		nr_pages = total_nr_pages;
+
+	bio = bio_alloc(GFP_NOIO, nr_pages);
+	bio->bi_bdev = pb->pb_target->pbr_bdev;
+	bio->bi_sector = sector;
+	bio->bi_end_io = bio_end_io_pagebuf;
+	bio->bi_private = pb;
+
+	for (; size && nr_pages; nr_pages--, map_i++) {
+		int	nbytes = PAGE_CACHE_SIZE - offset;
+
+		if (nbytes > size)
+			nbytes = size;
+
+		if (bio_add_page(bio, pb->pb_pages[map_i],
+					nbytes, offset) < nbytes)
+			break;
+
+		offset = 0;
+		sector += nbytes >> BBSHIFT;
+		size -= nbytes;
+		total_nr_pages--;
+	}
+
+submit_io:
+	if (likely(bio->bi_size)) {
+		submit_bio((pb->pb_flags & PBF_READ) ? READ : WRITE, bio);
+		if (size)
+			goto next_chunk;
+	} else {
+		bio_put(bio);
+		pagebuf_ioerror(pb, EIO);
+	}
+
+	if (pb->pb_flags & PBF_RUN_QUEUES) {
+		pb->pb_flags &= ~PBF_RUN_QUEUES;
+		if (atomic_read(&pb->pb_io_remaining) > 1)
+			blk_run_queues();
+	}
+}
+
+/*
+ *	pagebuf_iorequest
+ *
+ *	pagebuf_iorequest is the core I/O request routine.
+ *	It assumes that the buffer is well-formed and
+ *	mapped and ready for physical I/O, unlike
+ *	pagebuf_iostart() and pagebuf_iophysio().  Those
+ *	routines call the pagebuf_ioinitiate routine to start I/O,
+ *	if it is present, or else call pagebuf_iorequest()
+ *	directly if the pagebuf_ioinitiate routine is not present.
+ *
+ *	This function will be responsible for ensuring access to the
+ *	pages is restricted whilst I/O is in progress - for locking
+ *	pagebufs the pagebuf lock is the mediator, for non-locking
+ *	pagebufs the pages will be locked. In the locking case we
+ *	need to use the pagebuf lock as multiple meta-data buffers
+ *	will reference the same page.
+ */
+int
+pagebuf_iorequest(			/* start real I/O		*/
+	page_buf_t		*pb)	/* buffer to convey to device	*/
+{
+	PB_TRACE(pb, "iorequest", 0);
+
+	if (pb->pb_flags & PBF_DELWRI) {
+		pagebuf_delwri_queue(pb, 1);
+		return 0;
+	}
+
+	if (pb->pb_flags & PBF_WRITE) {
+		_pagebuf_wait_unpin(pb);
+	}
+
+	pagebuf_hold(pb);
+
+	/* Set the count to 1 initially, this will stop an I/O
+	 * completion callout which happens before we have started
+	 * all the I/O from calling pagebuf_iodone too early.
+	 */
+	atomic_set(&pb->pb_io_remaining, 1);
+	_pagebuf_ioapply(pb);
+	_pagebuf_iodone(pb, 0);
+
+	pagebuf_rele(pb);
+	return 0;
+}
+
+/*
+ *	pagebuf_iowait
+ *
+ *	pagebuf_iowait waits for I/O to complete on the buffer supplied.
+ *	It returns immediately if no I/O is pending.  In any case, it returns
+ *	the error code, if any, or 0 if there is no error.
+ */
+int
+pagebuf_iowait(
+	page_buf_t		*pb)
+{
+	PB_TRACE(pb, "iowait", 0);
+	if (atomic_read(&pb->pb_io_remaining))
+		blk_run_queues();
+	down(&pb->pb_iodonesema);
+	PB_TRACE(pb, "iowaited", (long)pb->pb_error);
+	return pb->pb_error;
+}
+
+STATIC void *
+pagebuf_mapout_locked(
+	page_buf_t		*pb)
+{
+	void			*old_addr = NULL;
+
+	if (pb->pb_flags & PBF_MAPPED) {
+		if (pb->pb_flags & _PBF_ADDR_ALLOCATED)
+			old_addr = pb->pb_addr - pb->pb_offset;
+		pb->pb_addr = NULL;
+		pb->pb_flags &= ~(PBF_MAPPED | _PBF_ADDR_ALLOCATED);
+	}
+
+	return old_addr;	/* Caller must free the address space,
+				 * we are under a spin lock, probably
+				 * not safe to do vfree here
+				 */
+}
+
+caddr_t
+pagebuf_offset(
+	page_buf_t		*pb,
+	size_t			offset)
+{
+	struct page		*page;
+
+	offset += pb->pb_offset;
+
+	page = pb->pb_pages[offset >> PAGE_CACHE_SHIFT];
+	return (caddr_t) page_address(page) + (offset & (PAGE_CACHE_SIZE - 1));
+}
+
+/*
+ *	pagebuf_iomove
+ *
+ *	Move data into or out of a buffer.
+ */
+void
+pagebuf_iomove(
+	page_buf_t		*pb,	/* buffer to process		*/
+	size_t			boff,	/* starting buffer offset	*/
+	size_t			bsize,	/* length to copy		*/
+	caddr_t			data,	/* data address			*/
+	page_buf_rw_t		mode)	/* read/write flag		*/
+{
+	size_t			bend, cpoff, csize;
+	struct page		*page;
+
+	bend = boff + bsize;
+	while (boff < bend) {
+		page = pb->pb_pages[page_buf_btoct(boff + pb->pb_offset)];
+		cpoff = page_buf_poff(boff + pb->pb_offset);
+		csize = min_t(size_t,
+			      PAGE_CACHE_SIZE-cpoff, pb->pb_count_desired-boff);
+
+		ASSERT(((csize + cpoff) <= PAGE_CACHE_SIZE));
+
+		switch (mode) {
+		case PBRW_ZERO:
+			memset(page_address(page) + cpoff, 0, csize);
+			break;
+		case PBRW_READ:
+			memcpy(data, page_address(page) + cpoff, csize);
+			break;
+		case PBRW_WRITE:
+			memcpy(page_address(page) + cpoff, data, csize);
+		}
+
+		boff += csize;
+		data += csize;
+	}
+}
+
+
+/*
+ * Pagebuf delayed write buffer handling
+ */
+
+STATIC LIST_HEAD(pbd_delwrite_queue);
+STATIC spinlock_t pbd_delwrite_lock = SPIN_LOCK_UNLOCKED;
+
+STATIC void
+pagebuf_delwri_queue(
+	page_buf_t		*pb,
+	int			unlock)
+{
+	PB_TRACE(pb, "delwri_q", (long)unlock);
+	spin_lock(&pbd_delwrite_lock);
+	/* If already in the queue, dequeue and place at tail */
+	if (!list_empty(&pb->pb_list)) {
+		if (unlock) {
+			atomic_dec(&pb->pb_hold);
+		}
+		list_del(&pb->pb_list);
+	}
+
+	list_add_tail(&pb->pb_list, &pbd_delwrite_queue);
+	pb->pb_flushtime = jiffies + pb_params.age_buffer.val;
+	spin_unlock(&pbd_delwrite_lock);
+
+	if (unlock && (pb->pb_flags & _PBF_LOCKABLE)) {
+		pagebuf_unlock(pb);
+	}
+}
+
+void
+pagebuf_delwri_dequeue(
+	page_buf_t		*pb)
+{
+	PB_TRACE(pb, "delwri_uq", 0);
+	spin_lock(&pbd_delwrite_lock);
+	list_del_init(&pb->pb_list);
+	pb->pb_flags &= ~PBF_DELWRI;
+	spin_unlock(&pbd_delwrite_lock);
+}
+
+STATIC void
+pagebuf_runall_queues(
+	struct workqueue_struct	*queue)
+{
+	flush_workqueue(queue);
+}
+
+/* Defines for pagebuf daemon */
+STATIC DECLARE_COMPLETION(pagebuf_daemon_done);
+STATIC struct task_struct *pagebuf_daemon_task;
+STATIC int pagebuf_daemon_active;
+STATIC int force_flush;
+
+STATIC void
+pagebuf_daemon_wakeup(void)
+{
+	force_flush = 1;
+	barrier();
+	wake_up_process(pagebuf_daemon_task);
+}
+
+STATIC int
+pagebuf_daemon(
+	void			*data)
+{
+	int			count;
+	page_buf_t		*pb;
+	struct list_head	*curr, *next, tmp;
+
+	/*  Set up the thread  */
+	daemonize("pagebufd");
+	current->flags |= PF_MEMALLOC;
+
+	pagebuf_daemon_task = current;
+	pagebuf_daemon_active = 1;
+	barrier();
+
+	INIT_LIST_HEAD(&tmp);
+	do {
+		/* swsusp */
+		if (current->flags & PF_FREEZE)
+			refrigerator(PF_IOTHREAD);
+
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(pb_params.flush_interval.val);
+
+		spin_lock(&pbd_delwrite_lock);
+
+		count = 0;
+		list_for_each_safe(curr, next, &pbd_delwrite_queue) {
+			pb = list_entry(curr, page_buf_t, pb_list);
+
+			PB_TRACE(pb, "walkq1", (long)pagebuf_ispin(pb));
+
+			if ((pb->pb_flags & PBF_DELWRI) && !pagebuf_ispin(pb) &&
+			    (((pb->pb_flags & _PBF_LOCKABLE) == 0) ||
+			     !pagebuf_cond_lock(pb))) {
+
+				if (!force_flush &&
+				    time_before(jiffies, pb->pb_flushtime)) {
+					pagebuf_unlock(pb);
+					break;
+				}
+
+				pb->pb_flags &= ~PBF_DELWRI;
+				pb->pb_flags |= PBF_WRITE;
+
+				list_del(&pb->pb_list);
+				list_add(&pb->pb_list, &tmp);
+
+				count++;
+			}
+		}
+
+		spin_unlock(&pbd_delwrite_lock);
+		while (!list_empty(&tmp)) {
+			pb = list_entry(tmp.next, page_buf_t, pb_list);
+			list_del_init(&pb->pb_list);
+
+			pagebuf_iostrategy(pb);
+		}
+
+		if (as_list_len > 0)
+			purge_addresses();
+		if (count)
+			blk_run_queues();
+
+		force_flush = 0;
+	} while (pagebuf_daemon_active);
+
+	complete_and_exit(&pagebuf_daemon_done, 0);
+}
+
+void
+pagebuf_delwri_flush(
+	pb_target_t		*target,
+	u_long			flags,
+	int			*pinptr)
+{
+	page_buf_t		*pb;
+	struct list_head	*curr, *next, tmp;
+	int			pincount = 0;
+	int			flush_cnt = 0;
+
+	pagebuf_runall_queues(pagebuf_dataio_workqueue);
+	pagebuf_runall_queues(pagebuf_logio_workqueue);
+
+	spin_lock(&pbd_delwrite_lock);
+	INIT_LIST_HEAD(&tmp);
+
+	list_for_each_safe(curr, next, &pbd_delwrite_queue) {
+		pb = list_entry(curr, page_buf_t, pb_list);
+
+		/*
+		 * Skip other targets, markers and in progress buffers
+		 */
+
+		if ((pb->pb_flags == 0) || (pb->pb_target != target) ||
+		    !(pb->pb_flags & PBF_DELWRI)) {
+			continue;
+		}
+
+		PB_TRACE(pb, "walkq2", (long)pagebuf_ispin(pb));
+		if (pagebuf_ispin(pb)) {
+			pincount++;
+			continue;
+		}
+
+		pb->pb_flags &= ~PBF_DELWRI;
+		pb->pb_flags |= PBF_WRITE;
+		list_move(&pb->pb_list, &tmp);
+	}
+	/* ok found all the items that can be worked on 
+	 * drop the lock and process the private list */
+	spin_unlock(&pbd_delwrite_lock);
+
+	list_for_each_safe(curr, next, &tmp) {
+		pb = list_entry(curr, page_buf_t, pb_list);
+
+		if (flags & PBDF_WAIT)
+			pb->pb_flags &= ~PBF_ASYNC;
+		else
+			list_del_init(curr);
+
+		pagebuf_lock(pb);
+		pagebuf_iostrategy(pb);
+		if (++flush_cnt > 32) {
+			blk_run_queues();
+			flush_cnt = 0;
+		}
+	}
+
+	blk_run_queues();
+
+	while (!list_empty(&tmp)) {
+		pb = list_entry(tmp.next, page_buf_t, pb_list);
+
+		list_del_init(&pb->pb_list);
+		pagebuf_iowait(pb);
+		if (!pb->pb_relse)
+			pagebuf_unlock(pb);
+		pagebuf_rele(pb);
+	}
+
+	if (pinptr)
+		*pinptr = pincount;
+}
+
+STATIC int
+pagebuf_daemon_start(void)
+{
+	int		rval;
+
+	pagebuf_logio_workqueue = create_workqueue("xfslogd");
+	if (!pagebuf_logio_workqueue)
+		return -ENOMEM;
+
+	pagebuf_dataio_workqueue = create_workqueue("xfsdatad");
+	if (!pagebuf_dataio_workqueue) {
+		destroy_workqueue(pagebuf_logio_workqueue);
+		return -ENOMEM;
+	}
+
+	rval = kernel_thread(pagebuf_daemon, NULL, CLONE_FS|CLONE_FILES);
+	if (rval < 0) {
+		destroy_workqueue(pagebuf_logio_workqueue);
+		destroy_workqueue(pagebuf_dataio_workqueue);
+	}
+
+	return rval;
+}
+
+/*
+ * pagebuf_daemon_stop
+ *
+ * Note: do not mark as __exit, it is called from pagebuf_terminate.
+ */
+STATIC void
+pagebuf_daemon_stop(void)
+{
+	pagebuf_daemon_active = 0;
+	barrier();
+	wait_for_completion(&pagebuf_daemon_done);
+
+	destroy_workqueue(pagebuf_logio_workqueue);
+	destroy_workqueue(pagebuf_dataio_workqueue);
+}
+
+
+/*
+ * Pagebuf sysctl interface
+ */
+
+STATIC int
+pb_stats_clear_handler(
+	ctl_table		*ctl,
+	int			write,
+	struct file		*filp,
+	void			*buffer,
+	size_t			*lenp)
+{
+	int			c, ret;
+	int			*valp = ctl->data;
+
+	ret = proc_dointvec_minmax(ctl, write, filp, buffer, lenp);
+
+	if (!ret && write && *valp) {
+		printk("XFS Clearing pbstats\n");
+		for (c = 0; c < NR_CPUS; c++) {
+			if (!cpu_possible(c)) continue;
+				memset(&per_cpu(pbstats, c), 0,
+				       sizeof(struct pbstats));
+		}
+		pb_params.stats_clear.val = 0;
+	}
+
+	return ret;
+}
+
+STATIC struct ctl_table_header *pagebuf_table_header;
+
+STATIC ctl_table pagebuf_table[] = {
+	{PB_FLUSH_INT, "flush_int", &pb_params.flush_interval.val,
+	sizeof(int), 0644, NULL, &proc_dointvec_minmax,
+	&sysctl_intvec, NULL,
+	&pb_params.flush_interval.min, &pb_params.flush_interval.max},
+
+	{PB_FLUSH_AGE, "flush_age", &pb_params.age_buffer.val,
+	sizeof(int), 0644, NULL, &proc_dointvec_minmax,
+	&sysctl_intvec, NULL, 
+	&pb_params.age_buffer.min, &pb_params.age_buffer.max},
+
+	{PB_STATS_CLEAR, "stats_clear", &pb_params.stats_clear.val,
+	sizeof(int), 0644, NULL, &pb_stats_clear_handler,
+	&sysctl_intvec, NULL, 
+	&pb_params.stats_clear.min, &pb_params.stats_clear.max},
+
+#ifdef PAGEBUF_TRACE
+	{PB_DEBUG, "debug", &pb_params.debug.val,
+	sizeof(int), 0644, NULL, &proc_dointvec_minmax,
+	&sysctl_intvec, NULL, 
+	&pb_params.debug.min, &pb_params.debug.max},
+#endif
+	{0}
+};
+
+STATIC ctl_table pagebuf_dir_table[] = {
+	{VM_PAGEBUF, "pagebuf", NULL, 0, 0555, pagebuf_table},
+	{0}
+};
+
+STATIC ctl_table pagebuf_root_table[] = {
+	{CTL_VM, "vm",  NULL, 0, 0555, pagebuf_dir_table},
+	{0}
+};
+
+#ifdef CONFIG_PROC_FS
+STATIC int
+pagebuf_readstats(
+	char			*buffer,
+	char			**start,
+	off_t			offset,
+	int			count,
+	int			*eof,
+	void			*data)
+{
+	int			c, i, len, val;
+
+	len = 0;
+	len += sprintf(buffer + len, "pagebuf");
+	for (i = 0; i < sizeof(struct pbstats) / sizeof(u_int32_t); i++) {
+		val = 0;
+		for (c = 0 ; c < NR_CPUS; c++) {
+			if (!cpu_possible(c)) continue;
+			val += *(((u_int32_t*)&per_cpu(pbstats, c) + i));
+		}
+		len += sprintf(buffer + len, " %u", val);
+	}
+	buffer[len++] = '\n';
+
+	if (offset >= len) {
+		*start = buffer;
+		*eof = 1;
+		return 0;
+	}
+	*start = buffer + offset;
+	if ((len -= offset) > count)
+		return count;
+	*eof = 1;
+
+	return len;
+}
+#endif  /* CONFIG_PROC_FS */
+
+/*
+ *	Initialization and Termination
+ */
+
+int __init
+pagebuf_init(void)
+{
+	int			i;
+
+	pagebuf_table_header = register_sysctl_table(pagebuf_root_table, 1);
+
+#ifdef CONFIG_PROC_FS
+	if (proc_mkdir("fs/pagebuf", 0))
+		create_proc_read_entry(
+			"fs/pagebuf/stat", 0, 0, pagebuf_readstats, NULL);
+#endif
+
+	pagebuf_cache = kmem_cache_create("page_buf_t", sizeof(page_buf_t), 0,
+			SLAB_HWCACHE_ALIGN, NULL, NULL);
+	if (pagebuf_cache == NULL) {
+		printk("pagebuf: couldn't init pagebuf cache\n");
+		pagebuf_terminate();
+		return -ENOMEM;
+	}
+
+	for (i = 0; i < NHASH; i++) {
+		spin_lock_init(&pbhash[i].pb_hash_lock);
+		INIT_LIST_HEAD(&pbhash[i].pb_hash);
+	}
+
+#ifdef PAGEBUF_TRACE
+	pagebuf_trace_buf = ktrace_alloc(PAGEBUF_TRACE_SIZE, KM_SLEEP);
+#endif
+
+	pagebuf_daemon_start();
+	return 0;
+}
+
+
+/*
+ *	pagebuf_terminate.
+ *
+ *	Note: do not mark as __exit, this is also called from the __init code.
+ */
+void
+pagebuf_terminate(void)
+{
+	pagebuf_daemon_stop();
+
+#ifdef PAGEBUF_TRACE
+	ktrace_free(pagebuf_trace_buf);
+#endif
+
+	kmem_cache_destroy(pagebuf_cache);
+
+	unregister_sysctl_table(pagebuf_table_header);
+#ifdef  CONFIG_PROC_FS
+	remove_proc_entry("fs/pagebuf/stat", NULL);
+	remove_proc_entry("fs/pagebuf", NULL);
+#endif
+}
diff -Nru a/fs/xfs/linux/xfs_buf.h b/fs/xfs/linux/xfs_buf.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/fs/xfs/linux/xfs_buf.h	Tue Feb  3 19:45:29 2004
@@ -0,0 +1,616 @@
+/*
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+
+/*
+ * Written by Steve Lord, Jim Mostek, Russell Cattelan at SGI
+ */
+
+#ifndef __XFS_BUF_H__
+#define __XFS_BUF_H__
+
+#include <linux/config.h>
+#include <linux/list.h>
+#include <linux/types.h>
+#include <linux/spinlock.h>
+#include <asm/system.h>
+#include <linux/mm.h>
+#include <linux/fs.h>
+#include <linux/buffer_head.h>
+#include <linux/uio.h>
+
+/*
+ *	Base types
+ */
+
+/* daddr must be signed since -1 is used for bmaps that are not yet allocated */
+typedef loff_t page_buf_daddr_t;
+
+#define PAGE_BUF_DADDR_NULL ((page_buf_daddr_t) (-1LL))
+
+#define page_buf_ctob(pp)	((pp) * PAGE_CACHE_SIZE)
+#define page_buf_btoc(dd)	(((dd) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT)
+#define page_buf_btoct(dd)	((dd) >> PAGE_CACHE_SHIFT)
+#define page_buf_poff(aa)	((aa) & ~PAGE_CACHE_MASK)
+
+typedef enum page_buf_rw_e {
+	PBRW_READ = 1,			/* transfer into target memory */
+	PBRW_WRITE = 2,			/* transfer from target memory */
+	PBRW_ZERO = 3			/* Zero target memory */
+} page_buf_rw_t;
+
+
+typedef enum page_buf_flags_e {		/* pb_flags values */
+	PBF_READ = (1 << 0),	/* buffer intended for reading from device */
+	PBF_WRITE = (1 << 1),	/* buffer intended for writing to device   */
+	PBF_MAPPED = (1 << 2),  /* buffer mapped (pb_addr valid)           */
+	PBF_PARTIAL = (1 << 3), /* buffer partially read                   */
+	PBF_ASYNC = (1 << 4),   /* initiator will not wait for completion  */
+	PBF_NONE = (1 << 5),    /* buffer not read at all                  */
+	PBF_DELWRI = (1 << 6),  /* buffer has dirty pages                  */
+	PBF_SYNC = (1 << 8),    /* force updates to disk                   */
+	PBF_MAPPABLE = (1 << 9),/* use directly-addressable pages          */
+	PBF_STALE = (1 << 10),	/* buffer has been staled, do not find it  */
+	PBF_FS_MANAGED = (1 << 11), /* filesystem controls freeing memory  */
+	PBF_FS_DATAIOD = (1 << 12), /* schedule IO completion on fs datad  */
+
+	/* flags used only as arguments to access routines */
+	PBF_LOCK = (1 << 13),	/* lock requested			   */
+	PBF_TRYLOCK = (1 << 14), /* lock requested, but do not wait	   */
+	PBF_DONT_BLOCK = (1 << 15), /* do not block in current thread	   */
+
+	/* flags used only internally */
+	_PBF_LOCKABLE = (1 << 16), /* page_buf_t may be locked		   */
+	_PBF_ALL_PAGES_MAPPED = (1 << 18), /* all pages in range mapped	   */
+	_PBF_ADDR_ALLOCATED = (1 << 19), /* pb_addr space was allocated	   */
+	_PBF_MEM_ALLOCATED = (1 << 20), /* underlying pages are allocated  */
+	_PBF_MEM_SLAB = (1 << 21), /* underlying pages are slab allocated  */
+
+	PBF_FORCEIO = (1 << 22), /* ignore any cache state		   */
+	PBF_FLUSH = (1 << 23),	/* flush disk write cache		   */
+	PBF_READ_AHEAD = (1 << 24), /* asynchronous read-ahead		   */
+	PBF_RUN_QUEUES = (1 << 25), /* run block device task queue	   */
+
+} page_buf_flags_t;
+
+#define PBF_UPDATE (PBF_READ | PBF_WRITE)
+#define PBF_NOT_DONE(pb) (((pb)->pb_flags & (PBF_PARTIAL|PBF_NONE)) != 0)
+#define PBF_DONE(pb) (((pb)->pb_flags & (PBF_PARTIAL|PBF_NONE)) == 0)
+
+typedef struct pb_target {
+	dev_t			pbr_dev;
+	struct block_device	*pbr_bdev;
+	struct address_space	*pbr_mapping;
+	unsigned int		pbr_bsize;
+	unsigned int		pbr_sshift;
+	size_t			pbr_smask;
+} pb_target_t;
+
+/*
+ *	page_buf_t:  Buffer structure for page cache-based buffers
+ *
+ * This buffer structure is used by the page cache buffer management routines
+ * to refer to an assembly of pages forming a logical buffer.  The actual
+ * I/O is performed with buffer_head or bio structures, as required by drivers,
+ * for drivers which do not understand this structure.  The buffer structure is
+ * used on temporary basis only, and discarded when released.
+ *
+ * The real data storage is recorded in the page cache.  Metadata is
+ * hashed to the inode for the block device on which the file system resides.
+ * File data is hashed to the inode for the file.  Pages which are only
+ * partially filled with data have bits set in their block_map entry
+ * to indicate which disk blocks in the page are not valid.
+ */
+
+struct page_buf_s;
+typedef void (*page_buf_iodone_t)(struct page_buf_s *);
+			/* call-back function on I/O completion */
+typedef void (*page_buf_relse_t)(struct page_buf_s *);
+			/* call-back function on I/O completion */
+typedef int (*page_buf_bdstrat_t)(struct page_buf_s *);
+
+#define PB_PAGES	4
+
+typedef struct page_buf_s {
+	struct semaphore	pb_sema;	/* semaphore for lockables  */
+	unsigned long		pb_flushtime;	/* time to flush pagebuf    */
+	atomic_t		pb_pin_count;	/* pin count		    */
+	wait_queue_head_t	pb_waiters;	/* unpin waiters	    */
+	struct list_head	pb_list;
+	page_buf_flags_t	pb_flags;	/* status flags */
+	struct list_head	pb_hash_list;
+	struct pb_target	*pb_target;	/* logical object */
+	atomic_t		pb_hold;	/* reference count */
+	page_buf_daddr_t	pb_bn;		/* block number for I/O */
+	loff_t			pb_file_offset;	/* offset in file */
+	size_t			pb_buffer_length; /* size of buffer in bytes */
+	size_t			pb_count_desired; /* desired transfer size */
+	void			*pb_addr;	/* virtual address of buffer */
+	struct work_struct	pb_iodone_work;
+	atomic_t		pb_io_remaining;/* #outstanding I/O requests */
+	page_buf_iodone_t	pb_iodone;	/* I/O completion function */
+	page_buf_relse_t	pb_relse;	/* releasing function */
+	page_buf_bdstrat_t	pb_strat;	/* pre-write function */
+	struct semaphore	pb_iodonesema;	/* Semaphore for I/O waiters */
+	void			*pb_fspriv;
+	void			*pb_fspriv2;
+	void			*pb_fspriv3;
+	unsigned short		pb_error;	/* error code on I/O */
+	unsigned short		pb_page_count;	/* size of page array */
+	unsigned short		pb_offset;	/* page offset in first page */
+	unsigned char		pb_locked;	/* page array is locked */
+	unsigned char		pb_hash_index;	/* hash table index	*/
+	struct page		**pb_pages;	/* array of page pointers */
+	struct page		*pb_page_array[PB_PAGES]; /* inline pages */
+#ifdef PAGEBUF_LOCK_TRACKING
+	int			pb_last_holder;
+#endif
+} page_buf_t;
+
+
+/* Finding and Reading Buffers */
+
+extern page_buf_t *pagebuf_find(	/* find buffer for block if	*/
+					/* the block is in memory	*/
+		struct pb_target *,	/* inode for block		*/
+		loff_t,			/* starting offset of range	*/
+		size_t,			/* length of range		*/
+		page_buf_flags_t);	/* PBF_LOCK			*/
+
+extern page_buf_t *pagebuf_get(		/* allocate a buffer		*/
+		struct pb_target *,	/* inode for buffer		*/
+		loff_t,			/* starting offset of range     */
+		size_t,			/* length of range              */
+		page_buf_flags_t);	/* PBF_LOCK, PBF_READ,		*/
+					/* PBF_ASYNC			*/
+
+extern page_buf_t *pagebuf_lookup(
+		struct pb_target *,
+		loff_t,			/* starting offset of range	*/
+		size_t,			/* length of range		*/
+		page_buf_flags_t);	/* PBF_READ, PBF_WRITE,		*/
+					/* PBF_FORCEIO, _PBF_LOCKABLE	*/
+
+extern page_buf_t *pagebuf_get_empty(	/* allocate pagebuf struct with	*/
+					/*  no memory or disk address	*/
+		size_t len,
+		struct pb_target *);	/* mount point "fake" inode	*/
+
+extern page_buf_t *pagebuf_get_no_daddr(/* allocate pagebuf struct	*/
+					/* without disk address		*/
+		size_t len,
+		struct pb_target *);	/* mount point "fake" inode	*/
+
+extern int pagebuf_associate_memory(
+		page_buf_t *,
+		void *,
+		size_t);
+
+extern void pagebuf_hold(		/* increment reference count	*/
+		page_buf_t *);		/* buffer to hold		*/
+
+extern void pagebuf_readahead(		/* read ahead into cache	*/
+		struct pb_target  *,	/* target for buffer (or NULL)	*/
+		loff_t,			/* starting offset of range     */
+		size_t,			/* length of range              */
+		page_buf_flags_t);	/* additional read flags	*/
+
+/* Releasing Buffers */
+
+extern void pagebuf_free(		/* deallocate a buffer		*/
+		page_buf_t *);		/* buffer to deallocate		*/
+
+extern void pagebuf_rele(		/* release hold on a buffer	*/
+		page_buf_t *);		/* buffer to release		*/
+
+/* Locking and Unlocking Buffers */
+
+extern int pagebuf_cond_lock(		/* lock buffer, if not locked	*/
+					/* (returns -EBUSY if locked)	*/
+		page_buf_t *);		/* buffer to lock		*/
+
+extern int pagebuf_lock_value(		/* return count on lock		*/
+		page_buf_t *);          /* buffer to check              */
+
+extern int pagebuf_lock(		/* lock buffer                  */
+		page_buf_t *);          /* buffer to lock               */
+
+extern void pagebuf_unlock(		/* unlock buffer		*/
+		page_buf_t *);		/* buffer to unlock		*/
+
+/* Buffer Read and Write Routines */
+
+extern void pagebuf_iodone(		/* mark buffer I/O complete	*/
+		page_buf_t *,		/* buffer to mark		*/
+		int,			/* use data/log helper thread.	*/
+		int);			/* run completion locally, or in
+					 * a helper thread.		*/
+
+extern void pagebuf_ioerror(		/* mark buffer in error	(or not) */
+		page_buf_t *,		/* buffer to mark		*/
+		unsigned int);		/* error to store (0 if none)	*/
+
+extern int pagebuf_iostart(		/* start I/O on a buffer	*/
+		page_buf_t *,		/* buffer to start		*/
+		page_buf_flags_t);	/* PBF_LOCK, PBF_ASYNC,		*/
+					/* PBF_READ, PBF_WRITE,		*/
+					/* PBF_DELWRI, PBF_SYNC		*/
+
+extern int pagebuf_iorequest(		/* start real I/O		*/
+		page_buf_t *);		/* buffer to convey to device	*/
+
+extern int pagebuf_iowait(		/* wait for buffer I/O done	*/
+		page_buf_t *);		/* buffer to wait on		*/
+
+extern void pagebuf_iomove(		/* move data in/out of pagebuf	*/
+		page_buf_t *,		/* buffer to manipulate		*/
+		size_t,			/* starting buffer offset	*/
+		size_t,			/* length in buffer		*/
+		caddr_t,		/* data pointer			*/
+		page_buf_rw_t);		/* direction			*/
+
+static inline int pagebuf_iostrategy(page_buf_t *pb)
+{
+	return pb->pb_strat ? pb->pb_strat(pb) : pagebuf_iorequest(pb);
+}
+
+static inline int pagebuf_geterror(page_buf_t *pb)
+{
+	return pb ? pb->pb_error : ENOMEM;
+}
+
+/* Buffer Utility Routines */
+
+extern caddr_t pagebuf_offset(		/* pointer at offset in buffer	*/
+		page_buf_t *,		/* buffer to offset into	*/
+		size_t);		/* offset			*/
+
+/* Pinning Buffer Storage in Memory */
+
+extern void pagebuf_pin(		/* pin buffer in memory		*/
+		page_buf_t *);		/* buffer to pin		*/
+
+extern void pagebuf_unpin(		/* unpin buffered data		*/
+		page_buf_t *);		/* buffer to unpin		*/
+
+extern int pagebuf_ispin(		/* check if buffer is pinned	*/
+		page_buf_t *);		/* buffer to check		*/
+
+/* Delayed Write Buffer Routines */
+
+#define PBDF_WAIT    0x01
+extern void pagebuf_delwri_flush(
+		pb_target_t *,
+		unsigned long,
+		int *);
+
+extern void pagebuf_delwri_dequeue(
+		page_buf_t *);
+
+/* Buffer Daemon Setup Routines */
+
+extern int pagebuf_init(void);
+extern void pagebuf_terminate(void);
+
+
+#ifdef PAGEBUF_TRACE
+extern ktrace_t *pagebuf_trace_buf;
+extern void pagebuf_trace(
+		page_buf_t *,		/* buffer being traced		*/
+		char *,			/* description of operation	*/
+		void *,			/* arbitrary diagnostic value	*/
+		void *);		/* return address		*/
+#else
+# define pagebuf_trace(pb, id, ptr, ra)	do { } while (0)
+#endif
+
+#define pagebuf_target_name(target)	\
+	({ char __b[BDEVNAME_SIZE]; bdevname((target)->pbr_bdev, __b); __b; })
+
+
+
+
+
+/* These are just for xfs_syncsub... it sets an internal variable
+ * then passes it to VOP_FLUSH_PAGES or adds the flags to a newly gotten buf_t
+ */
+#define XFS_B_ASYNC		PBF_ASYNC
+#define XFS_B_DELWRI		PBF_DELWRI
+#define XFS_B_READ		PBF_READ
+#define XFS_B_WRITE		PBF_WRITE
+#define XFS_B_STALE		PBF_STALE
+
+#define XFS_BUF_TRYLOCK		PBF_TRYLOCK
+#define XFS_INCORE_TRYLOCK	PBF_TRYLOCK
+#define XFS_BUF_LOCK		PBF_LOCK
+#define XFS_BUF_MAPPED		PBF_MAPPED
+
+#define BUF_BUSY		PBF_DONT_BLOCK
+
+#define XFS_BUF_BFLAGS(x)	((x)->pb_flags)
+#define XFS_BUF_ZEROFLAGS(x)	\
+	((x)->pb_flags &= ~(PBF_READ|PBF_WRITE|PBF_ASYNC|PBF_SYNC|PBF_DELWRI))
+
+#define XFS_BUF_STALE(x)	((x)->pb_flags |= XFS_B_STALE)
+#define XFS_BUF_UNSTALE(x)	((x)->pb_flags &= ~XFS_B_STALE)
+#define XFS_BUF_ISSTALE(x)	((x)->pb_flags & XFS_B_STALE)
+#define XFS_BUF_SUPER_STALE(x)	do {				\
+					XFS_BUF_STALE(x);	\
+					xfs_buf_undelay(x);	\
+					XFS_BUF_DONE(x);	\
+				} while (0)
+
+#define XFS_BUF_MANAGE		PBF_FS_MANAGED
+#define XFS_BUF_UNMANAGE(x)	((x)->pb_flags &= ~PBF_FS_MANAGED)
+
+static inline void xfs_buf_undelay(page_buf_t *pb)
+{
+	if (pb->pb_flags & PBF_DELWRI) {
+		if (pb->pb_list.next != &pb->pb_list) {
+			pagebuf_delwri_dequeue(pb);
+			pagebuf_rele(pb);
+		} else {
+			pb->pb_flags &= ~PBF_DELWRI;
+		}
+	}
+}
+
+#define XFS_BUF_DELAYWRITE(x)	 ((x)->pb_flags |= PBF_DELWRI)
+#define XFS_BUF_UNDELAYWRITE(x)	 xfs_buf_undelay(x)
+#define XFS_BUF_ISDELAYWRITE(x)	 ((x)->pb_flags & PBF_DELWRI)
+
+#define XFS_BUF_ERROR(x,no)	 pagebuf_ioerror(x,no)
+#define XFS_BUF_GETERROR(x)	 pagebuf_geterror(x)
+#define XFS_BUF_ISERROR(x)	 (pagebuf_geterror(x)?1:0)
+
+#define XFS_BUF_DONE(x)		 ((x)->pb_flags &= ~(PBF_PARTIAL|PBF_NONE))
+#define XFS_BUF_UNDONE(x)	 ((x)->pb_flags |= PBF_PARTIAL|PBF_NONE)
+#define XFS_BUF_ISDONE(x)	 (!(PBF_NOT_DONE(x)))
+
+#define XFS_BUF_BUSY(x)		 ((x)->pb_flags |= PBF_FORCEIO)
+#define XFS_BUF_UNBUSY(x)	 ((x)->pb_flags &= ~PBF_FORCEIO)
+#define XFS_BUF_ISBUSY(x)	 (1)
+
+#define XFS_BUF_ASYNC(x)	 ((x)->pb_flags |= PBF_ASYNC)
+#define XFS_BUF_UNASYNC(x)	 ((x)->pb_flags &= ~PBF_ASYNC)
+#define XFS_BUF_ISASYNC(x)	 ((x)->pb_flags & PBF_ASYNC)
+
+#define XFS_BUF_FLUSH(x)	 ((x)->pb_flags |= PBF_FLUSH)
+#define XFS_BUF_UNFLUSH(x)	 ((x)->pb_flags &= ~PBF_FLUSH)
+#define XFS_BUF_ISFLUSH(x)	 ((x)->pb_flags & PBF_FLUSH)
+
+#define XFS_BUF_SHUT(x)		 printk("XFS_BUF_SHUT not implemented yet\n")
+#define XFS_BUF_UNSHUT(x)	 printk("XFS_BUF_UNSHUT not implemented yet\n")
+#define XFS_BUF_ISSHUT(x)	 (0)
+
+#define XFS_BUF_HOLD(x)		pagebuf_hold(x)
+#define XFS_BUF_READ(x)		((x)->pb_flags |= PBF_READ)
+#define XFS_BUF_UNREAD(x)	((x)->pb_flags &= ~PBF_READ)
+#define XFS_BUF_ISREAD(x)	((x)->pb_flags & PBF_READ)
+
+#define XFS_BUF_WRITE(x)	((x)->pb_flags |= PBF_WRITE)
+#define XFS_BUF_UNWRITE(x)	((x)->pb_flags &= ~PBF_WRITE)
+#define XFS_BUF_ISWRITE(x)	((x)->pb_flags & PBF_WRITE)
+
+#define XFS_BUF_ISUNINITIAL(x)	 (0)
+#define XFS_BUF_UNUNINITIAL(x)	 (0)
+
+#define XFS_BUF_BP_ISMAPPED(bp)	 1
+
+typedef struct page_buf_s xfs_buf_t;
+#define xfs_buf page_buf_s
+
+typedef struct pb_target xfs_buftarg_t;
+#define xfs_buftarg pb_target
+
+#define XFS_BUF_DATAIO(x)	((x)->pb_flags |= PBF_FS_DATAIOD)
+#define XFS_BUF_UNDATAIO(x)	((x)->pb_flags &= ~PBF_FS_DATAIOD)
+
+#define XFS_BUF_IODONE_FUNC(buf)	(buf)->pb_iodone
+#define XFS_BUF_SET_IODONE_FUNC(buf, func)	\
+			(buf)->pb_iodone = (func)
+#define XFS_BUF_CLR_IODONE_FUNC(buf)		\
+			(buf)->pb_iodone = NULL
+#define XFS_BUF_SET_BDSTRAT_FUNC(buf, func)	\
+			(buf)->pb_strat = (func)
+#define XFS_BUF_CLR_BDSTRAT_FUNC(buf)		\
+			(buf)->pb_strat = NULL
+
+#define XFS_BUF_FSPRIVATE(buf, type)		\
+			((type)(buf)->pb_fspriv)
+#define XFS_BUF_SET_FSPRIVATE(buf, value)	\
+			(buf)->pb_fspriv = (void *)(value)
+#define XFS_BUF_FSPRIVATE2(buf, type)		\
+			((type)(buf)->pb_fspriv2)
+#define XFS_BUF_SET_FSPRIVATE2(buf, value)	\
+			(buf)->pb_fspriv2 = (void *)(value)
+#define XFS_BUF_FSPRIVATE3(buf, type)		\
+			((type)(buf)->pb_fspriv3)
+#define XFS_BUF_SET_FSPRIVATE3(buf, value)	\
+			(buf)->pb_fspriv3  = (void *)(value)
+#define XFS_BUF_SET_START(buf)
+
+#define XFS_BUF_SET_BRELSE_FUNC(buf, value) \
+			(buf)->pb_relse = (value)
+
+#define XFS_BUF_PTR(bp)		(xfs_caddr_t)((bp)->pb_addr)
+
+extern inline xfs_caddr_t xfs_buf_offset(page_buf_t *bp, size_t offset)
+{
+	if (bp->pb_flags & PBF_MAPPED)
+		return XFS_BUF_PTR(bp) + offset;
+	return (xfs_caddr_t) pagebuf_offset(bp, offset);
+}
+
+#define XFS_BUF_SET_PTR(bp, val, count)		\
+				pagebuf_associate_memory(bp, val, count)
+#define XFS_BUF_ADDR(bp)	((bp)->pb_bn)
+#define XFS_BUF_SET_ADDR(bp, blk)		\
+			((bp)->pb_bn = (page_buf_daddr_t)(blk))
+#define XFS_BUF_OFFSET(bp)	((bp)->pb_file_offset)
+#define XFS_BUF_SET_OFFSET(bp, off)		\
+			((bp)->pb_file_offset = (off))
+#define XFS_BUF_COUNT(bp)	((bp)->pb_count_desired)
+#define XFS_BUF_SET_COUNT(bp, cnt)		\
+			((bp)->pb_count_desired = (cnt))
+#define XFS_BUF_SIZE(bp)	((bp)->pb_buffer_length)
+#define XFS_BUF_SET_SIZE(bp, cnt)		\
+			((bp)->pb_buffer_length = (cnt))
+#define XFS_BUF_SET_VTYPE_REF(bp, type, ref)
+#define XFS_BUF_SET_VTYPE(bp, type)
+#define XFS_BUF_SET_REF(bp, ref)
+
+#define XFS_BUF_ISPINNED(bp)	pagebuf_ispin(bp)
+
+#define XFS_BUF_VALUSEMA(bp)	pagebuf_lock_value(bp)
+#define XFS_BUF_CPSEMA(bp)	(pagebuf_cond_lock(bp) == 0)
+#define XFS_BUF_VSEMA(bp)	pagebuf_unlock(bp)
+#define XFS_BUF_PSEMA(bp,x)	pagebuf_lock(bp)
+#define XFS_BUF_V_IODONESEMA(bp) up(&bp->pb_iodonesema);
+
+/* setup the buffer target from a buftarg structure */
+#define XFS_BUF_SET_TARGET(bp, target)	\
+		(bp)->pb_target = (target)
+#define XFS_BUF_TARGET(bp)	((bp)->pb_target)
+#define XFS_BUFTARG_NAME(target)	\
+		pagebuf_target_name(target)
+
+#define XFS_BUF_SET_VTYPE_REF(bp, type, ref)
+#define XFS_BUF_SET_VTYPE(bp, type)
+#define XFS_BUF_SET_REF(bp, ref)
+
+#define xfs_buf_read(target, blkno, len, flags) \
+		pagebuf_get((target), (blkno), (len), \
+			PBF_LOCK | PBF_READ | PBF_MAPPED | PBF_MAPPABLE)
+#define xfs_buf_get(target, blkno, len, flags) \
+		pagebuf_get((target), (blkno), (len), \
+			PBF_LOCK | PBF_MAPPED | PBF_MAPPABLE)
+
+#define xfs_buf_read_flags(target, blkno, len, flags) \
+		pagebuf_get((target), (blkno), (len), \
+			PBF_READ | PBF_MAPPABLE | flags)
+#define xfs_buf_get_flags(target, blkno, len, flags) \
+		pagebuf_get((target), (blkno), (len), \
+			PBF_MAPPABLE | flags)
+
+static inline int	xfs_bawrite(void *mp, page_buf_t *bp)
+{
+	bp->pb_fspriv3 = mp;
+	bp->pb_strat = xfs_bdstrat_cb;
+	xfs_buf_undelay(bp);
+	return pagebuf_iostart(bp, PBF_WRITE | PBF_ASYNC | PBF_RUN_QUEUES);
+}
+
+static inline void	xfs_buf_relse(page_buf_t *bp)
+{
+	if ((bp->pb_flags & _PBF_LOCKABLE) && !bp->pb_relse)
+		pagebuf_unlock(bp);
+	pagebuf_rele(bp);
+}
+
+#define xfs_bpin(bp)		pagebuf_pin(bp)
+#define xfs_bunpin(bp)		pagebuf_unpin(bp)
+
+#define xfs_buftrace(id, bp)	\
+	    pagebuf_trace(bp, id, NULL, (void *)__builtin_return_address(0))
+
+#define xfs_biodone(pb)		    \
+	    pagebuf_iodone(pb, (pb->pb_flags & PBF_FS_DATAIOD), 0)
+
+#define xfs_incore(buftarg,blkno,len,lockit) \
+	    pagebuf_find(buftarg, blkno ,len, lockit)
+
+
+#define xfs_biomove(pb, off, len, data, rw) \
+	    pagebuf_iomove((pb), (off), (len), (data), \
+		((rw) == XFS_B_WRITE) ? PBRW_WRITE : PBRW_READ)
+
+#define xfs_biozero(pb, off, len) \
+	    pagebuf_iomove((pb), (off), (len), NULL, PBRW_ZERO)
+
+
+static inline int	XFS_bwrite(page_buf_t *pb)
+{
+	int	iowait = (pb->pb_flags & PBF_ASYNC) == 0;
+	int	error = 0;
+
+	pb->pb_flags |= PBF_SYNC;
+	if (!iowait)
+		pb->pb_flags |= PBF_RUN_QUEUES;
+
+	xfs_buf_undelay(pb);
+	pagebuf_iostrategy(pb);
+	if (iowait) {
+		error = pagebuf_iowait(pb);
+		xfs_buf_relse(pb);
+	}
+	return error;
+}
+
+#define XFS_bdwrite(pb)		     \
+	    pagebuf_iostart(pb, PBF_DELWRI | PBF_ASYNC)
+
+static inline int xfs_bdwrite(void *mp, page_buf_t *bp)
+{
+	bp->pb_strat = xfs_bdstrat_cb;
+	bp->pb_fspriv3 = mp;
+
+	return pagebuf_iostart(bp, PBF_DELWRI | PBF_ASYNC);
+}
+
+#define XFS_bdstrat(bp) pagebuf_iorequest(bp)
+
+#define xfs_iowait(pb)	pagebuf_iowait(pb)
+
+
+/*
+ * Go through all incore buffers, and release buffers
+ * if they belong to the given device. This is used in
+ * filesystem error handling to preserve the consistency
+ * of its metadata.
+ */
+
+#define xfs_binval(buftarg)	xfs_flush_buftarg(buftarg)
+
+#define XFS_bflush(buftarg)	xfs_flush_buftarg(buftarg)
+
+#define xfs_incore_relse(buftarg,delwri_only,wait)	\
+	xfs_relse_buftarg(buftarg)
+
+#define xfs_baread(target, rablkno, ralen)  \
+	pagebuf_readahead((target), (rablkno), (ralen), PBF_DONT_BLOCK)
+
+#define xfs_buf_get_empty(len, target)	pagebuf_get_empty((len), (target))
+#define xfs_buf_get_noaddr(len, target)	pagebuf_get_no_daddr((len), (target))
+#define xfs_buf_free(bp)		pagebuf_free(bp)
+
+#endif	/* __XFS_BUF_H__ */
+
diff -Nru a/fs/xfs/linux/xfs_file.c b/fs/xfs/linux/xfs_file.c
--- a/fs/xfs/linux/xfs_file.c	Tue Feb  3 19:45:28 2004
+++ b/fs/xfs/linux/xfs_file.c	Tue Feb  3 19:45:28 2004
@@ -112,7 +112,7 @@
 {
 	struct iovec	iov = {(void *)buf, count};
 	struct file	*file = iocb->ki_filp;
-	struct inode	*inode = file->f_dentry->d_inode->i_mapping->host;
+	struct inode	*inode = file->f_mapping->host;
 	vnode_t		*vp = LINVFS_GET_VP(inode);
 	int		error;
 
@@ -160,7 +160,7 @@
 	unsigned long		nr_segs,
 	loff_t			*ppos)
 {
-	struct inode	*inode = file->f_dentry->d_inode->i_mapping->host;
+	struct inode	*inode = file->f_mapping->host;
 	vnode_t		*vp = LINVFS_GET_VP(inode);
 	struct		kiocb kiocb;
 	int		error;
@@ -207,7 +207,7 @@
 	unsigned long		nr_segs,
 	loff_t			*ppos)
 {
-	struct inode	*inode = file->f_dentry->d_inode->i_mapping->host;
+	struct inode	*inode = file->f_mapping->host;
 	vnode_t		*vp = LINVFS_GET_VP(inode);
 	struct		kiocb kiocb;
 	int		error;
diff -Nru a/fs/xfs/linux/xfs_globals.c b/fs/xfs/linux/xfs_globals.c
--- a/fs/xfs/linux/xfs_globals.c	Tue Feb  3 19:45:30 2004
+++ b/fs/xfs/linux/xfs_globals.c	Tue Feb  3 19:45:30 2004
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -36,9 +36,8 @@
  */
 
 #include "xfs.h"
-#include "xfs_bmap_btree.h"
-#include "xfs_bit.h"
-#include "xfs_rw.h"
+#include "xfs_cred.h"
+#include "xfs_sysctl.h"
 
 /*
  * System memory size - used to scale certain data structures in XFS.
@@ -69,10 +68,3 @@
  */
 cred_t sys_cred_val, *sys_cred = &sys_cred_val;
 
-/* Export XFS symbols used by xfsidbg */
-EXPORT_SYMBOL(xfs_next_bit);
-EXPORT_SYMBOL(xfs_contig_bits);
-EXPORT_SYMBOL(xfs_bmbt_get_all);
-#if ARCH_CONVERT != ARCH_NOCONVERT
-EXPORT_SYMBOL(xfs_bmbt_disk_get_all);
-#endif
diff -Nru a/fs/xfs/linux/xfs_ioctl.c b/fs/xfs/linux/xfs_ioctl.c
--- a/fs/xfs/linux/xfs_ioctl.c	Tue Feb  3 19:45:35 2004
+++ b/fs/xfs/linux/xfs_ioctl.c	Tue Feb  3 19:45:35 2004
@@ -943,7 +943,7 @@
 					bulkreq.ubuffer, &done);
 		} else {
 			error = xfs_bulkstat(mp, NULL, &inlast, &count,
-				(bulkstat_one_pf)xfs_bulkstat_one,
+				(bulkstat_one_pf)xfs_bulkstat_one, NULL,
 				sizeof(xfs_bstat_t), bulkreq.ubuffer,
 				BULKSTAT_FG_QUICK, &done);
 		}
diff -Nru a/fs/xfs/linux/xfs_iomap.c b/fs/xfs/linux/xfs_iomap.c
--- a/fs/xfs/linux/xfs_iomap.c	Tue Feb  3 19:45:28 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,801 +0,0 @@
-/*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
- */
-
-#include "xfs.h"
-
-#include "xfs_fs.h"
-#include "xfs_inum.h"
-#include "xfs_log.h"
-#include "xfs_trans.h"
-#include "xfs_sb.h"
-#include "xfs_ag.h"
-#include "xfs_dir.h"
-#include "xfs_dir2.h"
-#include "xfs_alloc.h"
-#include "xfs_dmapi.h"
-#include "xfs_quota.h"
-#include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
-#include "xfs_bmap_btree.h"
-#include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
-#include "xfs_dir_sf.h"
-#include "xfs_dir2_sf.h"
-#include "xfs_dinode.h"
-#include "xfs_inode.h"
-#include "xfs_bmap.h"
-#include "xfs_bit.h"
-#include "xfs_rtalloc.h"
-#include "xfs_error.h"
-#include "xfs_itable.h"
-#include "xfs_rw.h"
-#include "xfs_acl.h"
-#include "xfs_cap.h"
-#include "xfs_mac.h"
-#include "xfs_attr.h"
-#include "xfs_buf_item.h"
-#include "xfs_trans_space.h"
-#include "xfs_utils.h"
-
-#define XFS_WRITEIO_ALIGN(mp,off)	(((off) >> mp->m_writeio_log) \
-						<< mp->m_writeio_log)
-#define XFS_STRAT_WRITE_IMAPS	2
-#define XFS_WRITE_IMAPS		XFS_BMAP_MAX_NMAP
-
-STATIC int
-_xfs_imap_to_bmap(
-	xfs_iocore_t	*io,
-	xfs_off_t	offset,
-	int		new,
-	xfs_bmbt_irec_t *imap,
-	page_buf_bmap_t	*pbmapp,
-	int		imaps,			/* Number of imap entries */
-	int		pbmaps)			/* Number of pbmap entries */
-{
-	xfs_mount_t	*mp;
-	xfs_fsize_t	nisize;
-	int		pbm;
-	xfs_fsblock_t	start_block;
-
-	mp = io->io_mount;
-	nisize = XFS_SIZE(mp, io);
-	if (io->io_new_size > nisize)
-		nisize = io->io_new_size;
-
-	for (pbm = 0; imaps && pbm < pbmaps; imaps--, pbmapp++, imap++, pbm++) {
-		pbmapp->pbm_target = io->io_flags & XFS_IOCORE_RT ?
-			mp->m_rtdev_targp : mp->m_ddev_targp;
-		pbmapp->pbm_offset = XFS_FSB_TO_B(mp, imap->br_startoff);
-		pbmapp->pbm_delta = offset - pbmapp->pbm_offset;
-		pbmapp->pbm_bsize = XFS_FSB_TO_B(mp, imap->br_blockcount);
-		pbmapp->pbm_flags = 0;
-
-		start_block = imap->br_startblock;
-		if (start_block == HOLESTARTBLOCK) {
-			pbmapp->pbm_bn = PAGE_BUF_DADDR_NULL;
-			pbmapp->pbm_flags = PBMF_HOLE;
-		} else if (start_block == DELAYSTARTBLOCK) {
-			pbmapp->pbm_bn = PAGE_BUF_DADDR_NULL;
-			pbmapp->pbm_flags = PBMF_DELAY;
-		} else {
-			pbmapp->pbm_bn = XFS_FSB_TO_DB_IO(io, start_block);
-			if (ISUNWRITTEN(imap))
-				pbmapp->pbm_flags |= PBMF_UNWRITTEN;
-		}
-
-		if ((pbmapp->pbm_offset + pbmapp->pbm_bsize) >= nisize) {
-			pbmapp->pbm_flags |= PBMF_EOF;
-		}
-
-		if (new)
-			pbmapp->pbm_flags |= PBMF_NEW;
-
-		offset += pbmapp->pbm_bsize - pbmapp->pbm_delta;
-	}
-	return pbm;	/* Return the number filled */
-}
-
-int
-xfs_iomap(
-	xfs_iocore_t	*io,
-	xfs_off_t	offset,
-	ssize_t		count,
-	int		flags,
-	page_buf_bmap_t	*pbmapp,
-	int		*npbmaps)
-{
-	xfs_mount_t	*mp = io->io_mount;
-	xfs_fileoff_t	offset_fsb, end_fsb;
-	int		error = 0;
-	int		new = 0;
-	int		lockmode = 0;
-	xfs_bmbt_irec_t	imap;
-	int		nimaps = 1;
-	int		bmap_flags = 0;
-
-	if (XFS_FORCED_SHUTDOWN(mp))
-		return -XFS_ERROR(EIO);
-
-	switch (flags &
-		(BMAP_READ | BMAP_WRITE | BMAP_ALLOCATE |
-		 BMAP_UNWRITTEN | BMAP_DEVICE)) {
-	case BMAP_READ:
-		lockmode = XFS_LCK_MAP_SHARED(mp, io);
-		bmap_flags = XFS_BMAPI_ENTIRE;
-		if (flags & BMAP_IGNSTATE)
-			bmap_flags |= XFS_BMAPI_IGSTATE;
-		break;
-	case BMAP_WRITE:
-		lockmode = XFS_ILOCK_EXCL|XFS_EXTSIZE_WR;
-		bmap_flags = 0;
-		XFS_ILOCK(mp, io, lockmode);
-		break;
-	case BMAP_ALLOCATE:
-		lockmode = XFS_ILOCK_SHARED|XFS_EXTSIZE_RD;
-		bmap_flags = XFS_BMAPI_ENTIRE;
-		/* Attempt non-blocking lock */
-		if (flags & BMAP_TRYLOCK) {
-			if (!XFS_ILOCK_NOWAIT(mp, io, lockmode))
-				return XFS_ERROR(EAGAIN);
-		} else {
-			XFS_ILOCK(mp, io, lockmode);
-		}
-		break;
-	case BMAP_UNWRITTEN:
-		goto phase2;
-	case BMAP_DEVICE:
-		lockmode = XFS_LCK_MAP_SHARED(mp, io);
-		pbmapp->pbm_target = io->io_flags & XFS_IOCORE_RT ?
-			mp->m_rtdev_targp : mp->m_ddev_targp;
-		error = 0;
-		*npbmaps = 1;
-		goto out;
-	default:
-		BUG();
-	}
-
-	ASSERT(offset <= mp->m_maxioffset);
-	if ((xfs_fsize_t)offset + count > mp->m_maxioffset)
-		count = mp->m_maxioffset - offset;
-	end_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)offset + count);
-	offset_fsb = XFS_B_TO_FSBT(mp, offset);
-
-	error = XFS_BMAPI(mp, NULL, io, offset_fsb,
-			(xfs_filblks_t)(end_fsb - offset_fsb) ,
-			bmap_flags,  NULL, 0, &imap,
-			&nimaps, NULL);
-
-	if (error)
-		goto out;
-
-phase2:
-	switch (flags & (BMAP_WRITE|BMAP_ALLOCATE|BMAP_UNWRITTEN)) {
-	case BMAP_WRITE:
-		/* If we found an extent, return it */
-		if (nimaps && (imap.br_startblock != HOLESTARTBLOCK))
-			break;
-
-		if (flags & (BMAP_DIRECT|BMAP_MMAP)) {
-			error = XFS_IOMAP_WRITE_DIRECT(mp, io, offset,
-					count, flags, &imap, &nimaps, nimaps);
-		} else {
-			error = XFS_IOMAP_WRITE_DELAY(mp, io, offset, count,
-					flags, &imap, &nimaps);
-		}
-		new = 1;
-		break;
-	case BMAP_ALLOCATE:
-		/* If we found an extent, return it */
-		XFS_IUNLOCK(mp, io, lockmode);
-		lockmode = 0;
-
-		if (nimaps && !ISNULLSTARTBLOCK(imap.br_startblock))
-			break;
-
-		error = XFS_IOMAP_WRITE_ALLOCATE(mp, io, &imap, &nimaps);
-		break;
-	case BMAP_UNWRITTEN:
-		lockmode = 0;
-		error = XFS_IOMAP_WRITE_UNWRITTEN(mp, io, offset, count);
-		nimaps = 0;
-		break;
-	}
-
-	if (nimaps) {
-		*npbmaps = _xfs_imap_to_bmap(io, offset, new, &imap,
-					pbmapp, nimaps, *npbmaps);
-	} else if (npbmaps) {
-		*npbmaps = 0;
-	}
-
-out:
-	if (lockmode)
-		XFS_IUNLOCK(mp, io, lockmode);
-	return XFS_ERROR(error);
-}
-
-STATIC int
-xfs_flush_space(
-	xfs_inode_t	*ip,
-	int		*fsynced,
-	int		*ioflags)
-{
-	vnode_t		*vp = XFS_ITOV(ip);
-
-	switch (*fsynced) {
-	case 0:
-		if (ip->i_delayed_blks) {
-			xfs_iunlock(ip, XFS_ILOCK_EXCL);
-			filemap_fdatawrite(LINVFS_GET_IP(vp)->i_mapping);
-			xfs_ilock(ip, XFS_ILOCK_EXCL);
-			*fsynced = 1;
-		} else {
-			*ioflags |= BMAP_SYNC;
-			*fsynced = 2;
-		}
-		return 0;
-	case 1:
-		*fsynced = 2;
-		*ioflags |= BMAP_SYNC;
-		return 0;
-	case 2:
-		xfs_iunlock(ip, XFS_ILOCK_EXCL);
-		sync_blockdev(vp->v_vfsp->vfs_super->s_bdev);
-		xfs_log_force(ip->i_mount, (xfs_lsn_t)0,
-						XFS_LOG_FORCE|XFS_LOG_SYNC);
-		xfs_ilock(ip, XFS_ILOCK_EXCL);
-		*fsynced = 3;
-		return 0;
-	}
-	return 1;
-}
-
-int
-xfs_iomap_write_direct(
-	xfs_inode_t	*ip,
-	loff_t		offset,
-	size_t		count,
-	int		flags,
-	xfs_bmbt_irec_t *ret_imap,
-	int		*nmaps,
-	int		found)
-{
-	xfs_mount_t	*mp = ip->i_mount;
-	xfs_iocore_t	*io = &ip->i_iocore;
-	xfs_fileoff_t	offset_fsb;
-	xfs_fileoff_t	last_fsb;
-	xfs_filblks_t	count_fsb;
-	xfs_fsize_t	isize;
-	xfs_fsblock_t	firstfsb;
-	int		nimaps, maps;
-	int		error;
-	int		bmapi_flag;
-	int		rt;
-	xfs_trans_t	*tp;
-	xfs_bmbt_irec_t imap[XFS_WRITE_IMAPS], *imapp;
-	xfs_bmap_free_t free_list;
-	int		aeof;
-	xfs_filblks_t	datablocks;
-	int		committed;
-	int		numrtextents;
-	uint		resblks;
-
-	/*
-	 * Make sure that the dquots are there. This doesn't hold
-	 * the ilock across a disk read.
-	 */
-
-	error = XFS_QM_DQATTACH(ip->i_mount, ip, XFS_QMOPT_ILOCKED);
-	if (error)
-		return XFS_ERROR(error);
-
-	maps = min(XFS_WRITE_IMAPS, *nmaps);
-	nimaps = maps;
-
-	isize = ip->i_d.di_size;
-	aeof = (offset + count) > isize;
-
-	if (io->io_new_size > isize)
-		isize = io->io_new_size;
-
-	offset_fsb = XFS_B_TO_FSBT(mp, offset);
-	last_fsb = XFS_B_TO_FSB(mp, ((xfs_ufsize_t)(offset + count)));
-	count_fsb = last_fsb - offset_fsb;
-	if (found && (ret_imap->br_startblock == HOLESTARTBLOCK)) {
-		xfs_fileoff_t	map_last_fsb;
-
-		map_last_fsb = ret_imap->br_blockcount + ret_imap->br_startoff;
-
-		if (map_last_fsb < last_fsb) {
-			last_fsb = map_last_fsb;
-			count_fsb = last_fsb - offset_fsb;
-		}
-		ASSERT(count_fsb > 0);
-	}
-
-	/*
-	 * determine if reserving space on
-	 * the data or realtime partition.
-	 */
-	if ((rt = XFS_IS_REALTIME_INODE(ip))) {
-		int	sbrtextsize, iprtextsize;
-
-		sbrtextsize = mp->m_sb.sb_rextsize;
-		iprtextsize =
-			ip->i_d.di_extsize ? ip->i_d.di_extsize : sbrtextsize;
-		numrtextents = (count_fsb + iprtextsize - 1);
-		do_div(numrtextents, sbrtextsize);
-		datablocks = 0;
-	} else {
-		datablocks = count_fsb;
-		numrtextents = 0;
-	}
-
-	/*
-	 * allocate and setup the transaction
-	 */
-	xfs_iunlock(ip, XFS_ILOCK_EXCL);
-	tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT);
-
-	resblks = XFS_DIOSTRAT_SPACE_RES(mp, datablocks);
-
-	error = xfs_trans_reserve(tp, resblks,
-			XFS_WRITE_LOG_RES(mp), numrtextents,
-			XFS_TRANS_PERM_LOG_RES,
-			XFS_WRITE_LOG_COUNT);
-
-	/*
-	 * check for running out of space
-	 */
-	if (error)
-		/*
-		 * Free the transaction structure.
-		 */
-		xfs_trans_cancel(tp, 0);
-
-	xfs_ilock(ip, XFS_ILOCK_EXCL);
-
-	if (error)
-		goto error_out; /* Don't return in above if .. trans ..,
-					need lock to return */
-
-	if (XFS_TRANS_RESERVE_BLKQUOTA(mp, tp, ip, resblks)) {
-		error = (EDQUOT);
-		goto error1;
-	}
-	nimaps = 1;
-
-	bmapi_flag = XFS_BMAPI_WRITE;
-	xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
-	xfs_trans_ihold(tp, ip);
-
-	if (!(flags & BMAP_MMAP) && (offset < ip->i_d.di_size || rt))
-		bmapi_flag |= XFS_BMAPI_PREALLOC;
-
-	/*
-	 * issue the bmapi() call to allocate the blocks
-	 */
-	XFS_BMAP_INIT(&free_list, &firstfsb);
-	imapp = &imap[0];
-	error = xfs_bmapi(tp, ip, offset_fsb, count_fsb,
-		bmapi_flag, &firstfsb, 0, imapp, &nimaps, &free_list);
-	if (error) {
-		goto error0;
-	}
-
-	/*
-	 * complete the transaction
-	 */
-
-	error = xfs_bmap_finish(&tp, &free_list, firstfsb, &committed);
-	if (error) {
-		goto error0;
-	}
-
-	error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES, NULL);
-	if (error) {
-		goto error_out;
-	}
-
-	/* copy any maps to caller's array and return any error. */
-	if (nimaps == 0) {
-		error = (ENOSPC);
-		goto error_out;
-	}
-
-	*ret_imap = imap[0];
-	*nmaps = 1;
-	return 0;
-
- error0:	/* Cancel bmap, unlock inode, and cancel trans */
-	xfs_bmap_cancel(&free_list);
-
- error1:	/* Just cancel transaction */
-	xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT);
-	*nmaps = 0;	/* nothing set-up here */
-
-error_out:
-	return XFS_ERROR(error);
-}
-
-int
-xfs_iomap_write_delay(
-	xfs_inode_t	*ip,
-	loff_t		offset,
-	size_t		count,
-	int		ioflag,
-	xfs_bmbt_irec_t *ret_imap,
-	int		*nmaps)
-{
-	xfs_mount_t	*mp = ip->i_mount;
-	xfs_iocore_t	*io = &ip->i_iocore;
-	xfs_fileoff_t	offset_fsb;
-	xfs_fileoff_t	last_fsb;
-	xfs_fsize_t	isize;
-	xfs_fsblock_t	firstblock;
-	int		nimaps;
-	int		error;
-	xfs_bmbt_irec_t imap[XFS_WRITE_IMAPS];
-	int		aeof;
-	int		fsynced = 0;
-
-	ASSERT(ismrlocked(&ip->i_lock, MR_UPDATE) != 0);
-
-	/*
-	 * Make sure that the dquots are there. This doesn't hold
-	 * the ilock across a disk read.
-	 */
-
-	error = XFS_QM_DQATTACH(mp, ip, XFS_QMOPT_ILOCKED);
-	if (error)
-		return XFS_ERROR(error);
-
-retry:
-	isize = ip->i_d.di_size;
-	if (io->io_new_size > isize) {
-		isize = io->io_new_size;
-	}
-
-	aeof = 0;
-	offset_fsb = XFS_B_TO_FSBT(mp, offset);
-	last_fsb = XFS_B_TO_FSB(mp, ((xfs_ufsize_t)(offset + count)));
-	/*
-	 * If the caller is doing a write at the end of the file,
-	 * then extend the allocation (and the buffer used for the write)
-	 * out to the file system's write iosize.  We clean up any extra
-	 * space left over when the file is closed in xfs_inactive().
-	 *
-	 * We don't bother with this for sync writes, because we need
-	 * to minimize the amount we write for good performance.
-	 */
-	if (!(ioflag & BMAP_SYNC) && ((offset + count) > ip->i_d.di_size)) {
-		xfs_off_t	aligned_offset;
-		unsigned int	iosize;
-		xfs_fileoff_t	ioalign;
-
-		iosize = mp->m_writeio_blocks;
-		aligned_offset = XFS_WRITEIO_ALIGN(mp, (offset + count - 1));
-		ioalign = XFS_B_TO_FSBT(mp, aligned_offset);
-		last_fsb = ioalign + iosize;
-		aeof = 1;
-	}
-
-	nimaps = XFS_WRITE_IMAPS;
-	firstblock = NULLFSBLOCK;
-
-	/*
-	 * roundup the allocation request to m_dalign boundary if file size
-	 * is greater that 512K and we are allocating past the allocation eof
-	 */
-	if (mp->m_dalign && (isize >= mp->m_dalign) && aeof) {
-		int eof;
-		xfs_fileoff_t new_last_fsb;
-		new_last_fsb = roundup_64(last_fsb, mp->m_dalign);
-		error = xfs_bmap_eof(ip, new_last_fsb, XFS_DATA_FORK, &eof);
-		if (error) {
-			return error;
-		}
-		if (eof) {
-			last_fsb = new_last_fsb;
-		}
-	}
-
-	error = xfs_bmapi(NULL, ip, offset_fsb,
-			  (xfs_filblks_t)(last_fsb - offset_fsb),
-			  XFS_BMAPI_DELAY | XFS_BMAPI_WRITE |
-			  XFS_BMAPI_ENTIRE, &firstblock, 1, imap,
-			  &nimaps, NULL);
-	/*
-	 * This can be EDQUOT, if nimaps == 0
-	 */
-	if (error && (error != ENOSPC)) {
-		return XFS_ERROR(error);
-	}
-	/*
-	 * If bmapi returned us nothing, and if we didn't get back EDQUOT,
-	 * then we must have run out of space.
-	 */
-
-	if (nimaps == 0) {
-		if (xfs_flush_space(ip, &fsynced, &ioflag))
-			return XFS_ERROR(ENOSPC);
-
-		error = 0;
-		goto retry;
-	}
-
-	*ret_imap = imap[0];
-	*nmaps = 1;
-	return 0;
-}
-
-/*
- * Pass in a delayed allocate extent, convert it to real extents;
- * return to the caller the extent we create which maps on top of
- * the originating callers request.
- *
- * Called without a lock on the inode.
- */
-int
-xfs_iomap_write_allocate(
-	xfs_inode_t	*ip,
-	xfs_bmbt_irec_t *map,
-	int		*retmap)
-{
-	xfs_mount_t	*mp = ip->i_mount;
-	xfs_fileoff_t	offset_fsb, last_block;
-	xfs_fileoff_t	end_fsb, map_start_fsb;
-	xfs_fsblock_t	first_block;
-	xfs_bmap_free_t	free_list;
-	xfs_filblks_t	count_fsb;
-	xfs_bmbt_irec_t	imap[XFS_STRAT_WRITE_IMAPS];
-	xfs_trans_t	*tp;
-	int		i, nimaps, committed;
-	int		error = 0;
-	int		nres;
-
-	*retmap = 0;
-
-	/*
-	 * Make sure that the dquots are there.
-	 */
-
-	if ((error = XFS_QM_DQATTACH(mp, ip, 0)))
-		return XFS_ERROR(error);
-
-	offset_fsb = map->br_startoff;
-	count_fsb = map->br_blockcount;
-	map_start_fsb = offset_fsb;
-
-	XFS_STATS_ADD(xs_xstrat_bytes, XFS_FSB_TO_B(mp, count_fsb));
-
-	while (count_fsb != 0) {
-		/*
-		 * Set up a transaction with which to allocate the
-		 * backing store for the file.  Do allocations in a
-		 * loop until we get some space in the range we are
-		 * interested in.  The other space that might be allocated
-		 * is in the delayed allocation extent on which we sit
-		 * but before our buffer starts.
-		 */
-
-		nimaps = 0;
-		while (nimaps == 0) {
-			tp = xfs_trans_alloc(mp, XFS_TRANS_STRAT_WRITE);
-			nres = XFS_EXTENTADD_SPACE_RES(mp, XFS_DATA_FORK);
-			error = xfs_trans_reserve(tp, nres,
-					XFS_WRITE_LOG_RES(mp),
-					0, XFS_TRANS_PERM_LOG_RES,
-					XFS_WRITE_LOG_COUNT);
-
-			if (error == ENOSPC) {
-				error = xfs_trans_reserve(tp, 0,
-						XFS_WRITE_LOG_RES(mp),
-						0,
-						XFS_TRANS_PERM_LOG_RES,
-						XFS_WRITE_LOG_COUNT);
-			}
-			if (error) {
-				xfs_trans_cancel(tp, 0);
-				return XFS_ERROR(error);
-			}
-			xfs_ilock(ip, XFS_ILOCK_EXCL);
-			xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
-			xfs_trans_ihold(tp, ip);
-
-			XFS_BMAP_INIT(&free_list, &first_block);
-
-			nimaps = XFS_STRAT_WRITE_IMAPS;
-			/*
-			 * Ensure we don't go beyond eof - it is possible
-			 * the extents changed since we did the read call,
-			 * we dropped the ilock in the interim.
-			 */
-
-			end_fsb = XFS_B_TO_FSB(mp, ip->i_d.di_size);
-			xfs_bmap_last_offset(NULL, ip, &last_block,
-				XFS_DATA_FORK);
-			last_block = XFS_FILEOFF_MAX(last_block, end_fsb);
-			if ((map_start_fsb + count_fsb) > last_block) {
-				count_fsb = last_block - map_start_fsb;
-				if (count_fsb == 0) {
-					error = EAGAIN;
-					goto trans_cancel;
-				}
-			}
-
-			/* Go get the actual blocks */
-			error = xfs_bmapi(tp, ip, map_start_fsb, count_fsb,
-					XFS_BMAPI_WRITE, &first_block, 1,
-					imap, &nimaps, &free_list);
-
-			if (error)
-				goto trans_cancel;
-
-			error = xfs_bmap_finish(&tp, &free_list,
-					first_block, &committed);
-
-			if (error)
-				goto trans_cancel;
-
-			error = xfs_trans_commit(tp,
-					XFS_TRANS_RELEASE_LOG_RES, NULL);
-
-			if (error)
-				goto error0;
-
-			xfs_iunlock(ip, XFS_ILOCK_EXCL);
-		}
-
-		/*
-		 * See if we were able to allocate an extent that
-		 * covers at least part of the callers request
-		 */
-
-		for (i = 0; i < nimaps; i++) {
-			if ((map->br_startoff >= imap[i].br_startoff) &&
-			    (map->br_startoff < (imap[i].br_startoff +
-						 imap[i].br_blockcount))) {
-				*map = imap[i];
-				*retmap = 1;
-				XFS_STATS_INC(xs_xstrat_quick);
-				return 0;
-			}
-			count_fsb -= imap[i].br_blockcount;
-		}
-
-		/* So far we have not mapped the requested part of the
-		 * file, just surrounding data, try again.
-		 */
-		nimaps--;
-		offset_fsb = imap[nimaps].br_startoff +
-			     imap[nimaps].br_blockcount;
-		map_start_fsb = offset_fsb;
-	}
-
-trans_cancel:
-	xfs_bmap_cancel(&free_list);
-	xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT);
-error0:
-	xfs_iunlock(ip, XFS_ILOCK_EXCL);
-	return XFS_ERROR(error);
-}
-
-int
-xfs_iomap_write_unwritten(
-	xfs_inode_t	*ip,
-	loff_t		offset,
-	size_t		count)
-{
-	xfs_mount_t	*mp = ip->i_mount;
-	xfs_trans_t	*tp;
-	xfs_fileoff_t	offset_fsb;
-	xfs_filblks_t	count_fsb;
-	xfs_filblks_t	numblks_fsb;
-	xfs_bmbt_irec_t	imap;
-	int		committed;
-	int		error;
-	int		nres;
-	int		nimaps;
-	xfs_fsblock_t	firstfsb;
-	xfs_bmap_free_t	free_list;
-
-	offset_fsb = XFS_B_TO_FSBT(mp, offset);
-	count_fsb = XFS_B_TO_FSB(mp, count);
-
-	do {
-		nres = XFS_DIOSTRAT_SPACE_RES(mp, 0);
-
-		/*
-		 * set up a transaction to convert the range of extents
-		 * from unwritten to real. Do allocations in a loop until
-		 * we have covered the range passed in.
-		 */
-
-		tp = xfs_trans_alloc(mp, XFS_TRANS_STRAT_WRITE);
-		error = xfs_trans_reserve(tp, nres,
-				XFS_WRITE_LOG_RES(mp), 0,
-				XFS_TRANS_PERM_LOG_RES,
-				XFS_WRITE_LOG_COUNT);
-		if (error) {
-			xfs_trans_cancel(tp, 0);
-			goto error0;
-		}
-
-		xfs_ilock(ip, XFS_ILOCK_EXCL);
-		xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
-		xfs_trans_ihold(tp, ip);
-
-		/*
-		 * Modify the unwritten extent state of the buffer.
-		 */
-		XFS_BMAP_INIT(&free_list, &firstfsb);
-		nimaps = 1;
-		error = xfs_bmapi(tp, ip, offset_fsb, count_fsb,
-				  XFS_BMAPI_WRITE, &firstfsb,
-				  1, &imap, &nimaps, &free_list);
-		if (error)
-			goto error_on_bmapi_transaction;
-
-		error = xfs_bmap_finish(&(tp), &(free_list),
-				firstfsb, &committed);
-		if (error)
-			goto error_on_bmapi_transaction;
-
-		error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES, NULL);
-		xfs_iunlock(ip, XFS_ILOCK_EXCL);
-		if (error)
-			goto error0;
-
-		if ((numblks_fsb = imap.br_blockcount) == 0) {
-			/*
-			 * The numblks_fsb value should always get
-			 * smaller, otherwise the loop is stuck.
-			 */
-			ASSERT(imap.br_blockcount);
-			break;
-		}
-		offset_fsb += numblks_fsb;
-		count_fsb -= numblks_fsb;
-	} while (count_fsb > 0);
-
-	return 0;
-
-error_on_bmapi_transaction:
-	xfs_bmap_cancel(&free_list);
-	xfs_trans_cancel(tp, (XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT));
-	xfs_iunlock(ip, XFS_ILOCK_EXCL);
-error0:
-	return XFS_ERROR(error);
-}
diff -Nru a/fs/xfs/linux/xfs_iops.c b/fs/xfs/linux/xfs_iops.c
--- a/fs/xfs/linux/xfs_iops.c	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/linux/xfs_iops.c	Tue Feb  3 19:45:17 2004
@@ -110,7 +110,7 @@
 	vattr_t		va;
 	vnode_t		*vp = NULL, *dvp = LINVFS_GET_VP(dir);
 	xfs_acl_t	*default_acl = NULL;
-	xattr_exists_t	test_default_acl = _ACL_DEFAULT_EXISTS;
+	attrexists_t	test_default_acl = _ACL_DEFAULT_EXISTS;
 	int		error;
 
 	/*
@@ -552,61 +552,6 @@
 	block_truncate_page(inode->i_mapping, inode->i_size, linvfs_get_block);
 }
 
-
-
-/*
- * Extended attributes interfaces
- */
-
-#define SYSTEM_NAME	"system."	/* VFS shared names/values */
-#define ROOT_NAME	"trusted."	/* root's own names/values */
-#define USER_NAME	"user."		/* user's own names/values */
-STATIC xattr_namespace_t xfs_namespace_array[] = {
-	{ .name= SYSTEM_NAME,	.namelen= sizeof(SYSTEM_NAME)-1,.exists= NULL },
-	{ .name= ROOT_NAME,	.namelen= sizeof(ROOT_NAME)-1,	.exists= NULL },
-	{ .name= USER_NAME,	.namelen= sizeof(USER_NAME)-1,	.exists= NULL },
-	{ .name= NULL }
-};
-xattr_namespace_t *xfs_namespaces = &xfs_namespace_array[0];
-
-#define POSIXACL_ACCESS		"posix_acl_access"
-#define POSIXACL_ACCESS_SIZE	(sizeof(POSIXACL_ACCESS)-1)
-#define POSIXACL_DEFAULT	"posix_acl_default"
-#define POSIXACL_DEFAULT_SIZE	(sizeof(POSIXACL_DEFAULT)-1)
-#define POSIXCAP		"posix_capabilities"
-#define POSIXCAP_SIZE		(sizeof(POSIXCAP)-1)
-#define POSIXMAC		"posix_mac"
-#define POSIXMAC_SIZE		(sizeof(POSIXMAC)-1)
-STATIC xattr_namespace_t sys_namespace_array[] = {
-	{ .name= POSIXACL_ACCESS,
-		.namelen= POSIXACL_ACCESS_SIZE,	 .exists= _ACL_ACCESS_EXISTS },
-	{ .name= POSIXACL_DEFAULT,
-		.namelen= POSIXACL_DEFAULT_SIZE, .exists= _ACL_DEFAULT_EXISTS },
-	{ .name= POSIXCAP,
-		.namelen= POSIXCAP_SIZE,	 .exists= _CAP_EXISTS },
-	{ .name= POSIXMAC,
-		.namelen= POSIXMAC_SIZE,	 .exists= _MAC_EXISTS },
-	{ .name= NULL }
-};
-
-/*
- * Some checks to prevent people abusing EAs to get over quota:
- * - Don't allow modifying user EAs on devices/symlinks;
- * - Don't allow modifying user EAs if sticky bit set;
- */
-STATIC int
-capable_user_xattr(
-	struct inode	*inode)
-{
-	if (!S_ISREG(inode->i_mode) && !S_ISDIR(inode->i_mode) &&
-	    !capable(CAP_SYS_ADMIN))
-		return 0;
-	if (S_ISDIR(inode->i_mode) && (inode->i_mode & S_ISVTX) &&
-	    (current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
-		return 0;
-	return 1;
-}
-
 STATIC int
 linvfs_setxattr(
 	struct dentry	*dentry,
@@ -615,59 +560,27 @@
 	size_t		size,
 	int		flags)
 {
-	struct inode	*inode = dentry->d_inode;
-	vnode_t		*vp = LINVFS_GET_VP(inode);
-	char		*p = (char *)name;
+	vnode_t		*vp = LINVFS_GET_VP(dentry->d_inode);
+	char		*attr = (char *)name;
+	attrnames_t	*namesp;
 	int		xflags = 0;
 	int		error;
 
-	if (strncmp(name, xfs_namespaces[SYSTEM_NAMES].name,
-			xfs_namespaces[SYSTEM_NAMES].namelen) == 0) {
-		error = -EINVAL;
-		if (flags & XATTR_CREATE)
-			 return error;
-		error = -EOPNOTSUPP;
-		p += xfs_namespaces[SYSTEM_NAMES].namelen;
-		if (strcmp(p, POSIXACL_ACCESS) == 0)
-			error = xfs_acl_vset(vp, (void *) data, size,
-						_ACL_TYPE_ACCESS);
-		else if (strcmp(p, POSIXACL_DEFAULT) == 0)
-			error = xfs_acl_vset(vp, (void *) data, size,
-						_ACL_TYPE_DEFAULT);
-		else if (strcmp(p, POSIXCAP) == 0)
-			error = xfs_cap_vset(vp, (void *) data, size);
-		if (!error)
-			error = vn_revalidate(vp);
+	namesp = attr_lookup_namespace(attr, attr_namespaces, ATTR_NAMECOUNT);
+	if (!namesp)
+		return -EOPNOTSUPP;
+	attr += namesp->attr_namelen;
+	error = namesp->attr_capable(vp, NULL);
+	if (error)
 		return error;
-	}
-
-	if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
-		return -EPERM;
 
 	/* Convert Linux syscall to XFS internal ATTR flags */
 	if (flags & XATTR_CREATE)
 		xflags |= ATTR_CREATE;
 	if (flags & XATTR_REPLACE)
 		xflags |= ATTR_REPLACE;
-
-	if (strncmp(name, xfs_namespaces[ROOT_NAMES].name,
-			xfs_namespaces[ROOT_NAMES].namelen) == 0) {
-		if (!capable(CAP_SYS_ADMIN))
-			return -EPERM;
-		xflags |= ATTR_ROOT;
-		p += xfs_namespaces[ROOT_NAMES].namelen;
-		VOP_ATTR_SET(vp, p, (void *) data, size, xflags, NULL, error);
-		return -error;
-	}
-	if (strncmp(name, xfs_namespaces[USER_NAMES].name,
-			xfs_namespaces[USER_NAMES].namelen) == 0) {
-		if (!capable_user_xattr(inode))
-			return -EPERM;
-		p += xfs_namespaces[USER_NAMES].namelen;
-		VOP_ATTR_SET(vp, p, (void *) data, size, xflags, NULL, error);
-		return -error;
-	}
-	return -EOPNOTSUPP;
+	xflags |= namesp->attr_flag;
+	return namesp->attr_set(vp, attr, (void *)data, size, xflags);
 }
 
 STATIC ssize_t
@@ -677,53 +590,27 @@
 	void		*data,
 	size_t		size)
 {
-	struct inode	*inode = dentry->d_inode;
-	vnode_t		*vp = LINVFS_GET_VP(inode);
-	char		*p = (char *)name;
+	vnode_t		*vp = LINVFS_GET_VP(dentry->d_inode);
+	char		*attr = (char *)name;
+	attrnames_t	*namesp;
 	int		xflags = 0;
 	ssize_t		error;
 
-	if (strncmp(name, xfs_namespaces[SYSTEM_NAMES].name,
-			xfs_namespaces[SYSTEM_NAMES].namelen) == 0) {
-		error = -EOPNOTSUPP;
-		p += xfs_namespaces[SYSTEM_NAMES].namelen;
-		if (strcmp(p, POSIXACL_ACCESS) == 0)
-			error = xfs_acl_vget(vp, data, size, _ACL_TYPE_ACCESS);
-		else if (strcmp(p, POSIXACL_DEFAULT) == 0)
-			error = xfs_acl_vget(vp, data, size, _ACL_TYPE_DEFAULT);
-		else if (strcmp(p, POSIXCAP) == 0)
-			error = xfs_cap_vget(vp, data, size);
+	namesp = attr_lookup_namespace(attr, attr_namespaces, ATTR_NAMECOUNT);
+	if (!namesp)
+		return -EOPNOTSUPP;
+	attr += namesp->attr_namelen;
+	error = namesp->attr_capable(vp, NULL);
+	if (error)
 		return error;
-	}
 
 	/* Convert Linux syscall to XFS internal ATTR flags */
 	if (!size) {
 		xflags |= ATTR_KERNOVAL;
 		data = NULL;
 	}
-
-	if (strncmp(name, xfs_namespaces[ROOT_NAMES].name,
-			xfs_namespaces[ROOT_NAMES].namelen) == 0) {
-		if (!capable(CAP_SYS_ADMIN))
-			return -EPERM;
-		xflags |= ATTR_ROOT;
-		p += xfs_namespaces[ROOT_NAMES].namelen;
-		VOP_ATTR_GET(vp, p, data, (int *)&size, xflags, NULL, error);
-		if (!error)
-			error = -size;
-		return -error;
-	}
-	if (strncmp(name, xfs_namespaces[USER_NAMES].name,
-			xfs_namespaces[USER_NAMES].namelen) == 0) {
-		p += xfs_namespaces[USER_NAMES].namelen;
-		if (!capable_user_xattr(inode))
-			return -EPERM;
-		VOP_ATTR_GET(vp, p, data, (int *)&size, xflags, NULL, error);
-		if (!error)
-			error = -size;
-		return -error;
-	}
-	return -EOPNOTSUPP;
+	xflags |= namesp->attr_flag;
+	return namesp->attr_get(vp, attr, (void *)data, size, xflags);
 }
 
 STATIC ssize_t
@@ -732,40 +619,18 @@
 	char			*data,
 	size_t			size)
 {
-	attrlist_cursor_kern_t	cursor;
-	xattr_namespace_t	*sys;
 	vnode_t			*vp = LINVFS_GET_VP(dentry->d_inode);
-	char			*k = data;
-	int			xflags = ATTR_KERNAMELS;
-	int			result = 0;
-	ssize_t			error;
+	int			error, xflags = ATTR_KERNAMELS;
+	ssize_t			result;
 
 	if (!size)
 		xflags |= ATTR_KERNOVAL;
 	if (capable(CAP_SYS_ADMIN))
 		xflags |= ATTR_KERNFULLS;
 
-	memset(&cursor, 0, sizeof(cursor));
-	VOP_ATTR_LIST(vp, data, size, xflags, &cursor, NULL, error);
-	if (error > 0)
-		return -error;
-	result += -error;
-
-	k += result;		/* advance start of our buffer */
-	for (sys = &sys_namespace_array[0]; sys->name != NULL; sys++) {
-		if (sys->exists == NULL || !sys->exists(vp))
-			continue;
-		result += xfs_namespaces[SYSTEM_NAMES].namelen;
-		result += sys->namelen + 1;
-		if (size) {
-			if (result > size)
-				return -ERANGE;
-			strcpy(k, xfs_namespaces[SYSTEM_NAMES].name);
-			k += xfs_namespaces[SYSTEM_NAMES].namelen;
-			strcpy(k, sys->name);
-			k += sys->namelen + 1;
-		}
-	}
+	error = attr_generic_list(vp, data, size, xflags, &result);
+	if (error < 0)
+		return error;
 	return result;
 }
 
@@ -774,51 +639,25 @@
 	struct dentry	*dentry,
 	const char	*name)
 {
-	struct inode	*inode = dentry->d_inode;
-	vnode_t		*vp = LINVFS_GET_VP(inode);
-	char		*p = (char *)name;
+	vnode_t		*vp = LINVFS_GET_VP(dentry->d_inode);
+	char		*attr = (char *)name;
+	attrnames_t	*namesp;
 	int		xflags = 0;
 	int		error;
 
-	if (strncmp(name, xfs_namespaces[SYSTEM_NAMES].name,
-			xfs_namespaces[SYSTEM_NAMES].namelen) == 0) {
-		error = -EOPNOTSUPP;
-		p += xfs_namespaces[SYSTEM_NAMES].namelen;
-		if (strcmp(p, POSIXACL_ACCESS) == 0)
-			error = xfs_acl_vremove(vp, _ACL_TYPE_ACCESS);
-		else if (strcmp(p, POSIXACL_DEFAULT) == 0)
-			error = xfs_acl_vremove(vp, _ACL_TYPE_DEFAULT);
-		else if (strcmp(p, POSIXCAP) == 0)
-			error = xfs_cap_vremove(vp);
+	namesp = attr_lookup_namespace(attr, attr_namespaces, ATTR_NAMECOUNT);
+	if (!namesp)
+		return -EOPNOTSUPP;
+	attr += namesp->attr_namelen;
+	error = namesp->attr_capable(vp, NULL);
+	if (error)
 		return error;
-	}
-
-        if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
-		return -EPERM;
-
-	if (strncmp(name, xfs_namespaces[ROOT_NAMES].name,
-			xfs_namespaces[ROOT_NAMES].namelen) == 0) {
-		if (!capable(CAP_SYS_ADMIN))
-			return -EPERM;
-		xflags |= ATTR_ROOT;
-		p += xfs_namespaces[ROOT_NAMES].namelen;
-		VOP_ATTR_REMOVE(vp, p, xflags, NULL, error);
-		return -error;
-	}
-	if (strncmp(name, xfs_namespaces[USER_NAMES].name,
-			xfs_namespaces[USER_NAMES].namelen) == 0) {
-		p += xfs_namespaces[USER_NAMES].namelen;
-		if (!capable_user_xattr(inode))
-			return -EPERM;
-		VOP_ATTR_REMOVE(vp, p, xflags, NULL, error);
-		return -error;
-	}
-	return -EOPNOTSUPP;
+	xflags |= namesp->attr_flag;
+	return namesp->attr_remove(vp, attr, xflags);
 }
 
 
-struct inode_operations linvfs_file_inode_operations =
-{
+struct inode_operations linvfs_file_inode_operations = {
 	.permission		= linvfs_permission,
 	.truncate		= linvfs_truncate,
 	.getattr		= linvfs_getattr,
@@ -829,8 +668,7 @@
 	.removexattr		= linvfs_removexattr,
 };
 
-struct inode_operations linvfs_dir_inode_operations =
-{
+struct inode_operations linvfs_dir_inode_operations = {
 	.create			= linvfs_create,
 	.lookup			= linvfs_lookup,
 	.link			= linvfs_link,
@@ -849,8 +687,7 @@
 	.removexattr		= linvfs_removexattr,
 };
 
-struct inode_operations linvfs_symlink_inode_operations =
-{
+struct inode_operations linvfs_symlink_inode_operations = {
 	.readlink		= linvfs_readlink,
 	.follow_link		= linvfs_follow_link,
 	.permission		= linvfs_permission,
diff -Nru a/fs/xfs/linux/xfs_iops.h b/fs/xfs/linux/xfs_iops.h
--- a/fs/xfs/linux/xfs_iops.h	Tue Feb  3 19:45:28 2004
+++ b/fs/xfs/linux/xfs_iops.h	Tue Feb  3 19:45:28 2004
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -32,30 +32,6 @@
 #ifndef __XFS_IOPS_H__
 #define __XFS_IOPS_H__
 
-/*
- * Extended system attributes.
- * So far only POSIX ACLs are supported, but this will need to
- * grow in time (capabilities, mandatory access control, etc).
- */
-#define XFS_SYSTEM_NAMESPACE	SYSTEM_POSIXACL
-
-/*
- * Define a table of the namespaces XFS supports
- */
-typedef int (*xattr_exists_t)(vnode_t *);
-
-typedef struct xattr_namespace {
-	char		*name;
-	unsigned int	namelen;
-	xattr_exists_t	exists;
-} xattr_namespace_t;
-
-#define SYSTEM_NAMES	0
-#define ROOT_NAMES	1
-#define USER_NAMES	2
-extern struct xattr_namespace *xfs_namespaces;
-
-
 extern struct inode_operations linvfs_file_inode_operations;
 extern struct inode_operations linvfs_dir_inode_operations;
 extern struct inode_operations linvfs_symlink_inode_operations;
@@ -68,5 +44,8 @@
 
 extern int linvfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
 extern void linvfs_unwritten_done(struct buffer_head *, int);
+
+extern int xfs_ioctl(struct bhv_desc *, struct inode *, struct file *,
+                        int, unsigned int, unsigned long);
 
 #endif /* __XFS_IOPS_H__ */
diff -Nru a/fs/xfs/linux/xfs_linux.h b/fs/xfs/linux/xfs_linux.h
--- a/fs/xfs/linux/xfs_linux.h	Tue Feb  3 19:45:16 2004
+++ b/fs/xfs/linux/xfs_linux.h	Tue Feb  3 19:45:16 2004
@@ -32,6 +32,44 @@
 #ifndef __XFS_LINUX__
 #define __XFS_LINUX__
 
+#include <linux/types.h>
+#include <linux/config.h>
+
+/*
+ * Some types are conditional depending on the target system.
+ * XFS_BIG_BLKNOS needs block layer disk addresses to be 64 bits.
+ * XFS_BIG_INUMS needs the VFS inode number to be 64 bits, as well
+ * as requiring XFS_BIG_BLKNOS to be set.
+ */
+#if defined(CONFIG_LBD) || (BITS_PER_LONG == 64)
+# define XFS_BIG_BLKNOS	1
+# if BITS_PER_LONG == 64
+#  define XFS_BIG_INUMS	1
+# else
+#  define XFS_BIG_INUMS	0
+# endif
+#else
+# define XFS_BIG_BLKNOS	0
+# define XFS_BIG_INUMS	0
+#endif
+
+#include <xfs_types.h>
+#include <xfs_arch.h>
+
+#include <kmem.h>
+#include <mrlock.h>
+#include <spin.h>
+#include <sv.h>
+#include <mutex.h>
+#include <sema.h>
+#include <time.h>
+
+#include <support/qsort.h>
+#include <support/ktrace.h>
+#include <support/debug.h>
+#include <support/move.h>
+#include <support/uuid.h>
+
 #include <linux/mm.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
@@ -55,23 +93,24 @@
 #include <asm/byteorder.h>
 #include <asm/unaligned.h>
 
-#include <linux/xfs_behavior.h>
-#include <linux/xfs_vfs.h>
-#include <linux/xfs_cred.h>
-#include <linux/xfs_vnode.h>
-#include <linux/xfs_stats.h>
-#include <linux/xfs_sysctl.h>
-#include <linux/xfs_iops.h>
-#include <linux/xfs_super.h>
-#include <linux/xfs_globals.h>
-#include <linux/xfs_fs_subr.h>
-#include <linux/xfs_lrw.h>
-
-#include <pagebuf/page_buf.h>
+#include <xfs_behavior.h>
+#include <xfs_vfs.h>
+#include <xfs_cred.h>
+#include <xfs_vnode.h>
+#include <xfs_stats.h>
+#include <xfs_sysctl.h>
+#include <xfs_iops.h>
+#include <xfs_super.h>
+#include <xfs_globals.h>
+#include <xfs_fs_subr.h>
+#include <xfs_lrw.h>
+#include <xfs_buf.h>
 
-#ifndef STATIC
-#define STATIC static
-#endif
+/*
+ * Feature macros (disable/enable)
+ */
+#undef  HAVE_REFCACHE	/* reference cache not needed for NFS in 2.6 */
+#define HAVE_SENDFILE	/* sendfile(2) exists in 2.6, but not in 2.4 */
 
 /*
  * State flag for unwritten extent buffers.
@@ -100,6 +139,11 @@
 #define xfs_inherit_nodump	xfs_params.inherit_nodump.val
 #define xfs_inherit_noatime	xfs_params.inherit_noatim.val
 
+#define current_cpu()		smp_processor_id()
+#define current_pid()		(current->pid)
+#define current_fsuid(cred)	(current->fsuid)
+#define current_fsgid(cred)	(current->fsgid)
+
 #define NBPP		PAGE_SIZE
 #define DPPSHFT		(PAGE_SHIFT - 9)
 #define NDPP		(1 << (PAGE_SHIFT - 9))
@@ -199,6 +243,11 @@
 #define MAX(a,b)	(max(a,b))
 #define howmany(x, y)	(((x)+((y)-1))/(y))
 #define roundup(x, y)	((((x)+((y)-1))/(y))*(y))
+
+static inline void xfs_stack_trace(void)
+{
+	dump_stack();
+}
 
 /* Move the kernel do_div definition off to one side */
 
diff -Nru a/fs/xfs/linux/xfs_lrw.c b/fs/xfs/linux/xfs_lrw.c
--- a/fs/xfs/linux/xfs_lrw.c	Tue Feb  3 19:45:16 2004
+++ b/fs/xfs/linux/xfs_lrw.c	Tue Feb  3 19:45:16 2004
@@ -71,10 +71,76 @@
 #include "xfs_inode_item.h"
 #include "xfs_buf_item.h"
 #include "xfs_utils.h"
+#include "xfs_iomap.h"
 
 #include <linux/capability.h>
 
 
+#if defined(XFS_RW_TRACE)
+void
+xfs_rw_enter_trace(
+	int			tag,
+	xfs_iocore_t		*io,
+	const struct iovec	*iovp,
+	size_t			segs,
+	loff_t			offset,
+	int			ioflags)
+{
+	xfs_inode_t	*ip = XFS_IO_INODE(io);
+
+	if (ip->i_rwtrace == NULL)
+		return;
+	ktrace_enter(ip->i_rwtrace,
+		(void *)(unsigned long)tag,
+		(void *)ip,
+		(void *)((unsigned long)((ip->i_d.di_size >> 32) & 0xffffffff)),
+		(void *)((unsigned long)(ip->i_d.di_size & 0xffffffff)),
+		(void *)(__psint_t)iovp,
+		(void *)((unsigned long)segs),
+		(void *)((unsigned long)((offset >> 32) & 0xffffffff)),
+		(void *)((unsigned long)(offset & 0xffffffff)),
+		(void *)((unsigned long)ioflags),
+		(void *)((unsigned long)((io->io_new_size >> 32) & 0xffffffff)),
+		(void *)((unsigned long)(io->io_new_size & 0xffffffff)),
+		(void *)NULL,
+		(void *)NULL,
+		(void *)NULL,
+		(void *)NULL,
+		(void *)NULL);
+}
+
+void
+xfs_inval_cached_trace(
+	xfs_iocore_t	*io,
+	xfs_off_t	offset,
+	xfs_off_t	len,
+	xfs_off_t	first,
+	xfs_off_t	last)
+{
+	xfs_inode_t	*ip = XFS_IO_INODE(io);
+
+	if (ip->i_rwtrace == NULL)
+		return;
+	ktrace_enter(ip->i_rwtrace,
+		(void *)(__psint_t)XFS_INVAL_CACHED,
+		(void *)ip,
+		(void *)((unsigned long)((offset >> 32) & 0xffffffff)),
+		(void *)((unsigned long)(offset & 0xffffffff)),
+		(void *)((unsigned long)((len >> 32) & 0xffffffff)),
+		(void *)((unsigned long)(len & 0xffffffff)),
+		(void *)((unsigned long)((first >> 32) & 0xffffffff)),
+		(void *)((unsigned long)(first & 0xffffffff)),
+		(void *)((unsigned long)((last >> 32) & 0xffffffff)),
+		(void *)((unsigned long)(last & 0xffffffff)),
+		(void *)NULL,
+		(void *)NULL,
+		(void *)NULL,
+		(void *)NULL,
+		(void *)NULL,
+		(void *)NULL);
+}
+#endif
+
 /*
  *	xfs_iozero
  *
@@ -142,6 +208,59 @@
 	return (-status);
 }
 
+/*
+ * xfs_inval_cached_pages
+ * 
+ * This routine is responsible for keeping direct I/O and buffered I/O
+ * somewhat coherent.  From here we make sure that we're at least
+ * temporarily holding the inode I/O lock exclusively and then call
+ * the page cache to flush and invalidate any cached pages.  If there
+ * are no cached pages this routine will be very quick.
+ */
+void
+xfs_inval_cached_pages(
+	vnode_t		*vp,
+	xfs_iocore_t	*io,
+	xfs_off_t	offset,
+	int		write,
+	int		relock)
+{
+	xfs_mount_t	*mp;
+
+	if (!VN_CACHED(vp)) {
+		return;
+	}
+
+	mp = io->io_mount;
+
+	/*
+	 * We need to get the I/O lock exclusively in order
+	 * to safely invalidate pages and mappings.
+	 */
+	if (relock) {
+		XFS_IUNLOCK(mp, io, XFS_IOLOCK_SHARED);
+		XFS_ILOCK(mp, io, XFS_IOLOCK_EXCL);
+	}
+
+	/* Writing beyond EOF creates a hole that must be zeroed */
+	if (write && (offset > XFS_SIZE(mp, io))) {
+		xfs_fsize_t	isize;
+
+		XFS_ILOCK(mp, io, XFS_ILOCK_EXCL|XFS_EXTSIZE_RD);
+		isize = XFS_SIZE(mp, io);
+		if (offset > isize) {
+			xfs_zero_eof(vp, io, offset, isize, offset);
+		}
+		XFS_IUNLOCK(mp, io, XFS_ILOCK_EXCL|XFS_EXTSIZE_RD);
+	}
+
+	xfs_inval_cached_trace(io, offset, -1, ctooff(offtoct(offset)), -1);
+	VOP_FLUSHINVAL_PAGES(vp, ctooff(offtoct(offset)), -1, FI_REMAPF_LOCKED);
+	if (relock) {
+		XFS_ILOCK_DEMOTE(mp, io, XFS_IOLOCK_EXCL);
+	}
+}
+
 ssize_t			/* bytes read, or (-)  error */
 xfs_read(
 	bhv_desc_t		*bdp,
@@ -684,9 +803,13 @@
 
 retry:
 	if (ioflags & IO_ISDIRECT) {
-		xfs_inval_cached_pages(vp, &xip->i_iocore, *offset, 1, 1);
+		xfs_inval_cached_pages(vp, io, *offset, 1, 1);
+		xfs_rw_enter_trace(XFS_DIOWR_ENTER,
+				io, iovp, segs, *offset, ioflags);
+	} else {
+		xfs_rw_enter_trace(XFS_WRITE_ENTER,
+				io, iovp, segs, *offset, ioflags);
 	}
-
 	ret = generic_file_aio_write_nolock(iocb, iovp, segs, offset);
 
 	if ((ret == -ENOSPC) &&
@@ -702,7 +825,6 @@
 		xfs_rwlock(bdp, locktype);
 		*offset = xip->i_d.di_size;
 		goto retry;
-
 	}
 
 	if (*offset > xip->i_d.di_size) {
@@ -846,8 +968,8 @@
 	xfs_off_t	offset,
 	ssize_t		count,
 	int		flags,
-	page_buf_bmap_t	*pbmapp,
-	int		*npbmaps)
+	xfs_iomap_t	*iomapp,
+	int		*niomaps)
 {
 	xfs_inode_t	*ip = XFS_BHVTOI(bdp);
 	xfs_iocore_t	*io = &ip->i_iocore;
@@ -856,7 +978,7 @@
 	ASSERT(((ip->i_d.di_flags & XFS_DIFLAG_REALTIME) != 0) ==
 	       ((ip->i_iocore.io_flags & XFS_IOCORE_RT) != 0));
 
-	return xfs_iomap(io, offset, count, flags, pbmapp, npbmaps);
+	return xfs_iomap(io, offset, count, flags, iomapp, niomaps);
 }
 
 /*
diff -Nru a/fs/xfs/linux/xfs_lrw.h b/fs/xfs/linux/xfs_lrw.h
--- a/fs/xfs/linux/xfs_lrw.h	Tue Feb  3 19:45:16 2004
+++ b/fs/xfs/linux/xfs_lrw.h	Tue Feb  3 19:45:16 2004
@@ -39,21 +39,59 @@
 struct xfs_inode;
 struct xfs_bmbt_irec;
 struct page_buf_s;
-struct page_buf_bmap_s;
+struct xfs_iomap;
 
+#if defined(XFS_RW_TRACE)
+/*
+ * Defines for the trace mechanisms in xfs_lrw.c.
+ */
+#define	XFS_RW_KTRACE_SIZE	64
+#define	XFS_STRAT_KTRACE_SIZE	64
+#define	XFS_STRAT_GTRACE_SIZE	512
+
+#define	XFS_READ_ENTER		1
+#define	XFS_WRITE_ENTER		2
 #define XFS_IOMAP_READ_ENTER	3
+#define	XFS_IOMAP_WRITE_ENTER	4
+#define	XFS_IOMAP_READ_MAP	5
+#define	XFS_IOMAP_WRITE_MAP	6
+#define	XFS_IOMAP_WRITE_NOSPACE	7
+#define	XFS_ITRUNC_START	8
+#define	XFS_ITRUNC_FINISH1	9
+#define	XFS_ITRUNC_FINISH2	10
+#define	XFS_CTRUNC1		11
+#define	XFS_CTRUNC2		12
+#define	XFS_CTRUNC3		13
+#define	XFS_CTRUNC4		14
+#define	XFS_CTRUNC5		15
+#define	XFS_CTRUNC6		16
+#define	XFS_BUNMAPI		17
+#define	XFS_INVAL_CACHED	18
+#define	XFS_DIORD_ENTER		19
+#define	XFS_DIOWR_ENTER		20
+extern void xfs_rw_enter_trace(int, struct xfs_iocore *,
+			const struct iovec *, size_t, loff_t, int);
+extern void xfs_inval_cached_trace(struct xfs_iocore *,
+			xfs_off_t, xfs_off_t, xfs_off_t, xfs_off_t);
+#else
+#define xfs_rw_enter_trace(tag, io, iovec, segs, offset, ioflags)
+#define xfs_inval_cached_trace(io, offset, len, first, last)
+#endif
+
 /*
  * Maximum count of bmaps used by read and write paths.
  */
 #define	XFS_MAX_RW_NBMAPS	4
 
 extern int xfs_bmap(struct bhv_desc *, xfs_off_t, ssize_t, int,
-			struct page_buf_bmap_s *, int *);
+			struct xfs_iomap *, int *);
 extern int xfsbdstrat(struct xfs_mount *, struct page_buf_s *);
 extern int xfs_bdstrat_cb(struct page_buf_s *);
 
 extern int xfs_zero_eof(struct vnode *, struct xfs_iocore *, xfs_off_t,
 				xfs_fsize_t, xfs_fsize_t);
+extern void xfs_inval_cached_pages(struct vnode	*, struct xfs_iocore *,
+				xfs_off_t, int, int);
 extern ssize_t xfs_read(struct bhv_desc *, struct kiocb *,
 				const struct iovec *, unsigned int,
 				loff_t *, int, struct cred *);
@@ -63,16 +101,6 @@
 extern ssize_t xfs_sendfile(struct bhv_desc *, struct file *,
 				loff_t *, int, size_t, read_actor_t,
 				void *, struct cred *);
-
-extern int xfs_iomap(struct xfs_iocore *, xfs_off_t, ssize_t, int,
-				struct page_buf_bmap_s *, int *);
-extern int xfs_iomap_write_direct(struct xfs_inode *, loff_t, size_t,
-				int, struct xfs_bmbt_irec *, int *, int);
-extern int xfs_iomap_write_delay(struct xfs_inode *, loff_t, size_t,
-				int, struct xfs_bmbt_irec *, int *);
-extern int xfs_iomap_write_allocate(struct xfs_inode *,
-				struct xfs_bmbt_irec *, int *);
-extern int xfs_iomap_write_unwritten(struct xfs_inode *, loff_t, size_t);
 
 extern int xfs_dev_is_read_only(struct xfs_mount *, char *);
 
diff -Nru a/fs/xfs/linux/xfs_super.c b/fs/xfs/linux/xfs_super.c
--- a/fs/xfs/linux/xfs_super.c	Tue Feb  3 19:45:42 2004
+++ b/fs/xfs/linux/xfs_super.c	Tue Feb  3 19:45:42 2004
@@ -120,7 +120,7 @@
 	 */
 
 #if BITS_PER_LONG == 32
-# if defined(HAVE_SECTOR_T)
+# if defined(CONFIG_LBD)
 	ASSERT(sizeof(sector_t) == 8);
 	pagefactor = PAGE_CACHE_SIZE;
 	bitshift = BITS_PER_LONG;
@@ -241,6 +241,23 @@
 	}
 }
 
+void
+xfs_flush_inode(
+	xfs_inode_t	*ip)
+{
+	struct inode	*inode = LINVFS_GET_IP(XFS_ITOV(ip));
+
+	filemap_fdatawrite(inode->i_mapping);
+}
+
+void
+xfs_flush_device(
+	xfs_inode_t	*ip)
+{
+	sync_blockdev(XFS_ITOV(ip)->v_vfsp->vfs_super->s_bdev);
+	xfs_log_force(ip->i_mount, (xfs_lsn_t)0, XFS_LOG_FORCE|XFS_LOG_SYNC);
+}
+
 int
 xfs_blkdev_get(
 	xfs_mount_t		*mp,
@@ -860,15 +877,16 @@
 {
 	int			error;
 	struct sysinfo		si;
-	static char		message[] __initdata =
-		KERN_INFO "SGI XFS " XFS_VERSION_STRING " with "
-		XFS_BUILD_OPTIONS " enabled\n";
+	static char		message[] __initdata = KERN_INFO \
+		XFS_VERSION_STRING " with " XFS_BUILD_OPTIONS " enabled\n";
 
 	printk(message);
 
 	si_meminfo(&si);
 	xfs_physmem = si.totalram;
 
+	ktrace_init(64);
+
 	error = init_inodecache();
 	if (error < 0)
 		goto undo_inodecache;
@@ -907,12 +925,12 @@
 	vfs_exitdmapi();
 	pagebuf_terminate();
 	destroy_inodecache();
+	ktrace_uninit();
 }
 
 module_init(init_xfs_fs);
 module_exit(exit_xfs_fs);
 
 MODULE_AUTHOR("Silicon Graphics, Inc.");
-MODULE_DESCRIPTION(
-	"SGI XFS " XFS_VERSION_STRING " with " XFS_BUILD_OPTIONS " enabled");
+MODULE_DESCRIPTION(XFS_VERSION_STRING " with " XFS_BUILD_OPTIONS " enabled");
 MODULE_LICENSE("GPL");
diff -Nru a/fs/xfs/linux/xfs_super.h b/fs/xfs/linux/xfs_super.h
--- a/fs/xfs/linux/xfs_super.h	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/linux/xfs_super.h	Tue Feb  3 19:45:17 2004
@@ -60,6 +60,14 @@
 # define set_posix_acl_flag(sb)	do { } while (0)
 #endif
 
+#ifdef CONFIG_XFS_SECURITY
+# define XFS_SECURITY_STRING	"security attrs, "
+# define ENOSECURITY		0
+#else
+# define XFS_SECURITY_STRING
+# define ENOSECURITY		EOPNOTSUPP
+#endif
+
 #ifdef CONFIG_XFS_RT
 # define XFS_REALTIME_STRING	"realtime, "
 #else
@@ -76,10 +84,10 @@
 # define XFS_BIGFS_STRING
 #endif
 
-#ifdef CONFIG_XFS_VNODE_TRACING
-# define XFS_VNTRACE_STRING	"VN-trace, "
+#ifdef CONFIG_XFS_TRACE
+# define XFS_TRACE_STRING	"tracing, "
 #else
-# define XFS_VNTRACE_STRING
+# define XFS_TRACE_STRING
 #endif
 
 #ifdef XFSDEBUG
@@ -89,9 +97,10 @@
 #endif
 
 #define XFS_BUILD_OPTIONS	XFS_ACL_STRING \
+				XFS_SECURITY_STRING \
 				XFS_REALTIME_STRING \
 				XFS_BIGFS_STRING \
-				XFS_VNTRACE_STRING \
+				XFS_TRACE_STRING \
 				XFS_DBG_STRING /* DBG must be last */
 
 #define LINVFS_GET_VFS(s) \
@@ -99,6 +108,7 @@
 #define LINVFS_SET_VFS(s, vfsp) \
 	((s)->s_fs_info = vfsp)
 
+struct xfs_inode;
 struct xfs_mount;
 struct pb_target;
 struct block_device;
@@ -106,6 +116,9 @@
 extern __uint64_t xfs_max_file_offset(unsigned int);
 
 extern void xfs_initialize_vnode(bhv_desc_t *, vnode_t *, bhv_desc_t *, int);
+
+extern void xfs_flush_inode(struct xfs_inode *);
+extern void xfs_flush_device(struct xfs_inode *);
 
 extern int  xfs_blkdev_get(struct xfs_mount *, const char *,
 				struct block_device **);
diff -Nru a/fs/xfs/linux/xfs_sysctl.c b/fs/xfs/linux/xfs_sysctl.c
--- a/fs/xfs/linux/xfs_sysctl.c	Tue Feb  3 19:45:43 2004
+++ b/fs/xfs/linux/xfs_sysctl.c	Tue Feb  3 19:45:43 2004
@@ -51,7 +51,7 @@
 	int		c, ret, *valp = ctl->data;
 	__uint32_t	vn_active;
 
-	ret = proc_doulongvec_minmax(ctl, write, filp, buffer, lenp);
+	ret = proc_dointvec_minmax(ctl, write, filp, buffer, lenp);
 
 	if (!ret && write && *valp) {
 		printk("XFS Clearing xfsstats\n");
diff -Nru a/fs/xfs/linux/xfs_version.h b/fs/xfs/linux/xfs_version.h
--- a/fs/xfs/linux/xfs_version.h	Tue Feb  3 19:45:42 2004
+++ b/fs/xfs/linux/xfs_version.h	Tue Feb  3 19:45:42 2004
@@ -39,6 +39,6 @@
 #ifndef __XFS_VERSION_H__
 #define __XFS_VERSION_H__
 
-#define XFS_VERSION_STRING "for Linux"
+#define XFS_VERSION_STRING "SGI XFS"
 
 #endif /* __XFS_VERSION_H__ */
diff -Nru a/fs/xfs/linux/xfs_vfs.c b/fs/xfs/linux/xfs_vfs.c
--- a/fs/xfs/linux/xfs_vfs.c	Tue Feb  3 19:45:16 2004
+++ b/fs/xfs/linux/xfs_vfs.c	Tue Feb  3 19:45:16 2004
@@ -134,7 +134,7 @@
 int
 vfs_statvfs(
 	struct bhv_desc		*bdp,
-	struct kstatfs		*sp,
+	xfs_statfs_t		*sp,
 	struct vnode		*vp)
 {
 	struct bhv_desc		*next = bdp;
diff -Nru a/fs/xfs/linux/xfs_vfs.h b/fs/xfs/linux/xfs_vfs.h
--- a/fs/xfs/linux/xfs_vfs.h	Tue Feb  3 19:45:16 2004
+++ b/fs/xfs/linux/xfs_vfs.h	Tue Feb  3 19:45:16 2004
@@ -33,6 +33,7 @@
 #define __XFS_VFS_H__
 
 #include <linux/vfs.h>
+#include "xfs_fs.h"
 
 struct fid;
 struct cred;
@@ -42,10 +43,12 @@
 struct super_block;
 struct xfs_mount_args;
 
+typedef struct kstatfs xfs_statfs_t;
+
 typedef struct vfs {
 	u_int			vfs_flag;	/* flags */
-	fsid_t			vfs_fsid;	/* file system ID */
-	fsid_t			*vfs_altfsid;	/* An ID fixed for life of FS */
+	xfs_fsid_t		vfs_fsid;	/* file system ID */
+	xfs_fsid_t		*vfs_altfsid;	/* An ID fixed for life of FS */
 	bhv_head_t		vfs_bh;		/* head of vfs behavior chain */
 	struct super_block	*vfs_super;	/* Linux superblock structure */
 	struct task_struct	*vfs_sync_task;
@@ -101,7 +104,7 @@
 typedef int	(*vfs_mntupdate_t)(bhv_desc_t *, int *,
 				struct xfs_mount_args *);
 typedef int	(*vfs_root_t)(bhv_desc_t *, struct vnode **);
-typedef int	(*vfs_statvfs_t)(bhv_desc_t *, struct kstatfs *, struct vnode *);
+typedef int	(*vfs_statvfs_t)(bhv_desc_t *, xfs_statfs_t *, struct vnode *);
 typedef int	(*vfs_sync_t)(bhv_desc_t *, int, struct cred *);
 typedef int	(*vfs_vget_t)(bhv_desc_t *, struct vnode **, struct fid *);
 typedef int	(*vfs_dmapiops_t)(bhv_desc_t *, caddr_t);
@@ -168,7 +171,7 @@
 extern int vfs_unmount(bhv_desc_t *, int, struct cred *);
 extern int vfs_mntupdate(bhv_desc_t *, int *, struct xfs_mount_args *);
 extern int vfs_root(bhv_desc_t *, struct vnode **);
-extern int vfs_statvfs(bhv_desc_t *, struct kstatfs *, struct vnode *);
+extern int vfs_statvfs(bhv_desc_t *, xfs_statfs_t *, struct vnode *);
 extern int vfs_sync(bhv_desc_t *, int, struct cred *);
 extern int vfs_vget(bhv_desc_t *, struct vnode **, struct fid *);
 extern int vfs_dmapiops(bhv_desc_t *, caddr_t);
diff -Nru a/fs/xfs/linux/xfs_vnode.c b/fs/xfs/linux/xfs_vnode.c
--- a/fs/xfs/linux/xfs_vnode.c	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/linux/xfs_vnode.c	Tue Feb  3 19:45:17 2004
@@ -98,7 +98,7 @@
 	vp->v_type = VNON;
 	vp->v_fbhv = NULL;
 
-#ifdef CONFIG_XFS_VNODE_TRACING
+#ifdef XFS_VNODE_TRACE
 	ktrace_free(vp->v_trace);
 	vp->v_trace = NULL;
 #endif
@@ -154,9 +154,10 @@
 	/* Initialize the first behavior and the behavior chain head. */
 	vn_bhv_head_init(VN_BHV_HEAD(vp), "vnode");
 
-#ifdef	CONFIG_XFS_VNODE_TRACING
+#ifdef	XFS_VNODE_TRACE
 	vp->v_trace = ktrace_alloc(VNODE_TRACE_SIZE, KM_SLEEP);
-#endif	/* CONFIG_XFS_VNODE_TRACING */
+	printk("Allocated VNODE_TRACE at 0x%p\n", vp->v_trace);
+#endif	/* XFS_VNODE_TRACE */
 
 	vn_trace_exit(vp, "vn_initialize", (inst_t *)__return_address);
 	return vp;
@@ -392,7 +393,7 @@
 }
 
 
-#ifdef	CONFIG_XFS_VNODE_TRACING
+#ifdef	XFS_VNODE_TRACE
 
 #define KTRACE_ENTER(vp, vk, s, line, ra)			\
 	ktrace_enter(	(vp)->v_trace,				\
@@ -439,4 +440,4 @@
 {
 	KTRACE_ENTER(vp, VNODE_KTRACE_RELE, file, line, ra);
 }
-#endif	/* CONFIG_XFS_VNODE_TRACING */
+#endif	/* XFS_VNODE_TRACE */
diff -Nru a/fs/xfs/linux/xfs_vnode.h b/fs/xfs/linux/xfs_vnode.h
--- a/fs/xfs/linux/xfs_vnode.h	Tue Feb  3 19:45:43 2004
+++ b/fs/xfs/linux/xfs_vnode.h	Tue Feb  3 19:45:43 2004
@@ -62,7 +62,7 @@
 struct uio;
 struct file;
 struct vattr;
-struct page_buf_bmap_s;
+struct xfs_iomap;
 struct attrlist_cursor_kern;
 
 /*
@@ -87,7 +87,7 @@
 	vn_bhv_head_t	v_bh;			/* behavior head */
 	spinlock_t	v_lock;			/* VN_LOCK/VN_UNLOCK */
 	struct inode	v_inode;		/* Linux inode */
-#ifdef CONFIG_XFS_VNODE_TRACING
+#ifdef XFS_VNODE_TRACE
 	struct ktrace	*v_trace;		/* trace header structure    */
 #endif
 } vnode_t;
@@ -226,7 +226,7 @@
 typedef int	(*vop_rwlock_t)(bhv_desc_t *, vrwlock_t);
 typedef void	(*vop_rwunlock_t)(bhv_desc_t *, vrwlock_t);
 typedef int	(*vop_bmap_t)(bhv_desc_t *, xfs_off_t, ssize_t, int,
-				struct page_buf_bmap_s *, int *);
+				struct xfs_iomap *, int *);
 typedef int	(*vop_reclaim_t)(bhv_desc_t *);
 typedef int	(*vop_attr_get_t)(bhv_desc_t *, char *, char *, int *, int,
 				struct cred *);
@@ -545,21 +545,17 @@
 extern vnode_t	*vn_hold(struct vnode *);
 extern void	vn_rele(struct vnode *);
 
-#if defined(CONFIG_XFS_VNODE_TRACING)
-
+#if defined(XFS_VNODE_TRACE)
 #define VN_HOLD(vp)		\
-	((void)vn_hold(vp), \
+	((void)vn_hold(vp),	\
 	  vn_trace_hold(vp, __FILE__, __LINE__, (inst_t *)__return_address))
 #define VN_RELE(vp)		\
 	  (vn_trace_rele(vp, __FILE__, __LINE__, (inst_t *)__return_address), \
 	   iput(LINVFS_GET_IP(vp)))
-
-#else	/* ! (defined(CONFIG_XFS_VNODE_TRACING)) */
-
+#else
 #define VN_HOLD(vp)		((void)vn_hold(vp))
 #define VN_RELE(vp)		(iput(LINVFS_GET_IP(vp)))
-
-#endif	/* ! (defined(CONFIG_XFS_VNODE_TRACING)) */
+#endif
 
 /*
  * Vname handling macros.
@@ -591,6 +587,13 @@
 }
 
 /*
+ * Update modify/access/change times on the vnode
+ */
+#define VN_MTIMESET(vp, tvp)	(LINVFS_GET_IP(vp)->i_mtime = *(tvp))
+#define VN_ATIMESET(vp, tvp)	(LINVFS_GET_IP(vp)->i_atime = *(tvp))
+#define VN_CTIMESET(vp, tvp)	(LINVFS_GET_IP(vp)->i_ctime = *(tvp))
+
+/*
  * Some useful predicates.
  */
 #define VN_MAPPED(vp)	\
@@ -617,13 +620,12 @@
 #define FSYNC_INVAL	0x2	/* flush and invalidate cached data */
 #define FSYNC_DATA	0x4	/* synchronous fsync of data only */
 
-#if (defined(CONFIG_XFS_VNODE_TRACING))
-
-#define	VNODE_TRACE_SIZE	16		/* number of trace entries */
-
 /*
- * Tracing entries.
+ * Tracking vnode activity.
  */
+#if defined(XFS_VNODE_TRACE)
+
+#define	VNODE_TRACE_SIZE	16		/* number of trace entries */
 #define	VNODE_KTRACE_ENTRY	1
 #define	VNODE_KTRACE_EXIT	2
 #define	VNODE_KTRACE_HOLD	3
@@ -635,18 +637,16 @@
 extern void vn_trace_hold(struct vnode *, char *, int, inst_t *);
 extern void vn_trace_ref(struct vnode *, char *, int, inst_t *);
 extern void vn_trace_rele(struct vnode *, char *, int, inst_t *);
+
 #define	VN_TRACE(vp)		\
 	vn_trace_ref(vp, __FILE__, __LINE__, (inst_t *)__return_address)
-
-#else	/* ! (defined(CONFIG_XFS_VNODE_TRACING)) */
-
+#else
 #define	vn_trace_entry(a,b,c)
 #define	vn_trace_exit(a,b,c)
 #define	vn_trace_hold(a,b,c,d)
 #define	vn_trace_ref(a,b,c,d)
 #define	vn_trace_rele(a,b,c,d)
 #define	VN_TRACE(vp)
-
-#endif	/* ! (defined(CONFIG_XFS_VNODE_TRACING)) */
+#endif
 
 #endif	/* __XFS_VNODE_H__ */
diff -Nru a/fs/xfs/pagebuf/page_buf.c b/fs/xfs/pagebuf/page_buf.c
--- a/fs/xfs/pagebuf/page_buf.c	Tue Feb  3 19:45:16 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,1993 +0,0 @@
-/*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
- */
-
-/*
- *	page_buf.c
- *
- *	The page_buf module provides an abstract buffer cache model on top of
- *	the Linux page cache.  Cached metadata blocks for a file system are
- *	hashed to the inode for the block device.  The page_buf module
- *	assembles buffer (page_buf_t) objects on demand to aggregate such
- *	cached pages for I/O.
- *
- *
- *      Written by Steve Lord, Jim Mostek, Russell Cattelan
- *		    and Rajagopal Ananthanarayanan ("ananth") at SGI.
- *
- */
-
-#include <linux/module.h>
-#include <linux/stddef.h>
-#include <linux/errno.h>
-#include <linux/slab.h>
-#include <linux/pagemap.h>
-#include <linux/init.h>
-#include <linux/vmalloc.h>
-#include <linux/blkdev.h>
-#include <linux/bio.h>
-#include <linux/sysctl.h>
-#include <linux/proc_fs.h>
-#include <linux/workqueue.h>
-#include <linux/suspend.h>
-
-#include <support/debug.h>
-#include <support/kmem.h>
-
-#include "page_buf_internal.h"
-
-#define BBSHIFT		9
-#define BN_ALIGN_MASK	((1 << (PAGE_CACHE_SHIFT - BBSHIFT)) - 1)
-
-#ifndef GFP_READAHEAD
-#define GFP_READAHEAD	(__GFP_NOWARN|__GFP_NORETRY)
-#endif
-
-/*
- * Debug code
- */
-
-#ifdef PAGEBUF_TRACE
-static spinlock_t		pb_trace_lock = SPIN_LOCK_UNLOCKED;
-struct pagebuf_trace_buf	pb_trace;
-EXPORT_SYMBOL(pb_trace);
-EXPORT_SYMBOL(pb_trace_func);
-#define CIRC_INC(i)	(((i) + 1) & (PB_TRACE_BUFSIZE - 1))
-
-void
-pb_trace_func(
-	page_buf_t	*pb,
-	int		event,
-	void		*misc,
-	void		*ra)
-{
-	int		j;
-	unsigned long	flags;
-
-	if (!pb_params.debug.val) return;
-
-	if (ra == NULL) ra = (void *)__builtin_return_address(0);
-
-	spin_lock_irqsave(&pb_trace_lock, flags);
-	j = pb_trace.start;
-	pb_trace.start = CIRC_INC(j);
-	spin_unlock_irqrestore(&pb_trace_lock, flags);
-
-	pb_trace.buf[j].pb = (unsigned long) pb;
-	pb_trace.buf[j].event = event;
-	pb_trace.buf[j].flags = pb->pb_flags;
-	pb_trace.buf[j].hold = pb->pb_hold.counter;
-	pb_trace.buf[j].lock_value = pb->pb_sema.count.counter;
-	pb_trace.buf[j].task = (void *)current;
-	pb_trace.buf[j].misc = misc;
-	pb_trace.buf[j].ra = ra;
-	pb_trace.buf[j].offset = pb->pb_file_offset;
-	pb_trace.buf[j].size = pb->pb_buffer_length;
-}
-#endif	/* PAGEBUF_TRACE */
-
-/*
- *	File wide globals
- */
-
-STATIC kmem_cache_t *pagebuf_cache;
-STATIC void pagebuf_daemon_wakeup(int);
-STATIC void pagebuf_delwri_queue(page_buf_t *, int);
-STATIC struct workqueue_struct *pagebuf_logio_workqueue;
-STATIC struct workqueue_struct *pagebuf_dataio_workqueue;
-
-/*
- * Pagebuf module configuration parameters, exported via
- * /proc/sys/vm/pagebuf
- */
-
-pagebuf_param_t pb_params = {
-			  /*	MIN	DFLT	MAX	*/
-	.flush_interval	= {	HZ/2,	HZ,	30*HZ	},
-	.age_buffer	= {	1*HZ,	15*HZ,	300*HZ	},
-	.stats_clear	= {	0,	0,	1	},
-	.debug		= {	0,	0,	1	},
-};
-
-/*
- * Pagebuf statistics variables
- */
-
-DEFINE_PER_CPU(struct pbstats, pbstats);
-
-/*
- * Pagebuf allocation / freeing.
- */
-
-#define pb_to_gfp(flags) \
-	(((flags) & PBF_READ_AHEAD) ? GFP_READAHEAD : \
-	 ((flags) & PBF_DONT_BLOCK) ? GFP_NOFS : GFP_KERNEL)
-
-#define pagebuf_allocate(flags) \
-	kmem_cache_alloc(pagebuf_cache, pb_to_gfp(flags))
-#define pagebuf_deallocate(pb) \
-	kmem_cache_free(pagebuf_cache, (pb));
-
-/*
- * Pagebuf hashing
- */
-
-#define NBITS	8
-#define NHASH	(1<<NBITS)
-
-typedef struct {
-	struct list_head	pb_hash;
-	int			pb_count;
-	spinlock_t		pb_hash_lock;
-} pb_hash_t;
-
-STATIC pb_hash_t	pbhash[NHASH];
-#define pb_hash(pb)	&pbhash[pb->pb_hash_index]
-
-STATIC int
-_bhash(
-	struct block_device *bdev,
-	loff_t		base)
-{
-	int		bit, hval;
-
-	base >>= 9;
-	base ^= (unsigned long)bdev / L1_CACHE_BYTES;
-	for (bit = hval = 0; base && bit < sizeof(base) * 8; bit += NBITS) {
-		hval ^= (int)base & (NHASH-1);
-		base >>= NBITS;
-	}
-	return hval;
-}
-
-/*
- * Mapping of multi-page buffers into contiguous virtual space
- */
-
-STATIC void *pagebuf_mapout_locked(page_buf_t *);
-
-typedef struct a_list {
-	void		*vm_addr;
-	struct a_list	*next;
-} a_list_t;
-STATIC a_list_t		*as_free_head;
-STATIC int		as_list_len;
-STATIC spinlock_t	as_lock = SPIN_LOCK_UNLOCKED;
-
-
-/*
- * Try to batch vunmaps because they are costly.
- */
-STATIC void
-free_address(
-	void		*addr)
-{
-	a_list_t	*aentry;
-
-	aentry = kmalloc(sizeof(a_list_t), GFP_ATOMIC);
-	if (aentry) {
-		spin_lock(&as_lock);
-		aentry->next = as_free_head;
-		aentry->vm_addr = addr;
-		as_free_head = aentry;
-		as_list_len++;
-		spin_unlock(&as_lock);
-	} else {
-		vunmap(addr);
-	}
-}
-
-STATIC void
-purge_addresses(void)
-{
-	a_list_t	*aentry, *old;
-
-	if (as_free_head == NULL)
-		return;
-
-	spin_lock(&as_lock);
-	aentry = as_free_head;
-	as_free_head = NULL;
-	as_list_len = 0;
-	spin_unlock(&as_lock);
-
-	while ((old = aentry) != NULL) {
-		vunmap(aentry->vm_addr);
-		aentry = aentry->next;
-		kfree(old);
-	}
-}
-
-/*
- *	Locking model:
- *
- *	Buffers associated with inodes for which buffer locking
- *	is not enabled are not protected by semaphores, and are
- *	assumed to be exclusively owned by the caller.  There is
- *	spinlock in the buffer, for use by the caller when concurrent
- *	access is possible.
- */
-
-/*
- *	Internal pagebuf object manipulation
- */
-
-STATIC void
-_pagebuf_initialize(
-	page_buf_t		*pb,
-	pb_target_t		*target,
-	loff_t			range_base,
-	size_t			range_length,
-	page_buf_flags_t	flags)
-{
-	/*
-	 * We don't want certain flags to appear in pb->pb_flags.
-	 */
-	flags &= ~(PBF_LOCK|PBF_MAPPED|PBF_DONT_BLOCK|PBF_READ_AHEAD);
-
-	memset(pb, 0, sizeof(page_buf_t));
-	atomic_set(&pb->pb_hold, 1);
-	init_MUTEX_LOCKED(&pb->pb_iodonesema);
-	INIT_LIST_HEAD(&pb->pb_list);
-	INIT_LIST_HEAD(&pb->pb_hash_list);
-	init_MUTEX_LOCKED(&pb->pb_sema); /* held, no waiters */
-	PB_SET_OWNER(pb);
-	pb->pb_target = target;
-	pb->pb_file_offset = range_base;
-	/*
-	 * Set buffer_length and count_desired to the same value initially.
-	 * IO routines should use count_desired, which will be the same in
-	 * most cases but may be reset (e.g. XFS recovery).
-	 */
-	pb->pb_buffer_length = pb->pb_count_desired = range_length;
-	pb->pb_flags = flags | PBF_NONE;
-	pb->pb_bn = PAGE_BUF_DADDR_NULL;
-	atomic_set(&pb->pb_pin_count, 0);
-	init_waitqueue_head(&pb->pb_waiters);
-
-	PB_STATS_INC(pb_create);
-	PB_TRACE(pb, PB_TRACE_REC(get), target);
-}
-
-/*
- * Allocate a page array capable of holding a specified number
- * of pages, and point the page buf at it.
- */
-STATIC int
-_pagebuf_get_pages(
-	page_buf_t		*pb,
-	int			page_count,
-	page_buf_flags_t	flags)
-{
-	int			gpf_mask = pb_to_gfp(flags);
-
-	/* Make sure that we have a page list */
-	if (pb->pb_pages == NULL) {
-		pb->pb_offset = page_buf_poff(pb->pb_file_offset);
-		pb->pb_page_count = page_count;
-		if (page_count <= PB_PAGES) {
-			pb->pb_pages = pb->pb_page_array;
-		} else {
-			pb->pb_pages = kmalloc(sizeof(struct page *) *
-					page_count, gpf_mask);
-			if (pb->pb_pages == NULL)
-				return -ENOMEM;
-		}
-		memset(pb->pb_pages, 0, sizeof(struct page *) * page_count);
-	}
-	return 0;
-}
-
-/*
- * Walk a pagebuf releasing all the pages contained within it.
- */
-STATIC inline void
-_pagebuf_freepages(
-	page_buf_t		*pb)
-{
-	int			buf_index;
-
-	for (buf_index = 0; buf_index < pb->pb_page_count; buf_index++) {
-		struct page	*page = pb->pb_pages[buf_index];
-
-		if (page) {
-			pb->pb_pages[buf_index] = NULL;
-			page_cache_release(page);
-		}
-	}
-
-	if (pb->pb_pages != pb->pb_page_array)
-		kfree(pb->pb_pages);
-}
-
-/*
- *	_pagebuf_free_object
- *
- *	_pagebuf_free_object releases the contents specified buffer.
- *	The modification state of any associated pages is left unchanged.
- */
-void
-_pagebuf_free_object(
-	pb_hash_t		*hash,	/* hash bucket for buffer */
-	page_buf_t		*pb)	/* buffer to deallocate	*/
-{
-	page_buf_flags_t	pb_flags = pb->pb_flags;
-
-	PB_TRACE(pb, PB_TRACE_REC(free_obj), 0);
-	pb->pb_flags |= PBF_FREED;
-
-	if (hash) {
-		if (!list_empty(&pb->pb_hash_list)) {
-			hash->pb_count--;
-			list_del_init(&pb->pb_hash_list);
-		}
-		spin_unlock(&hash->pb_hash_lock);
-	}
-
-	if (!(pb_flags & PBF_FREED)) {
-		/* release any virtual mapping */ ;
-		if (pb->pb_flags & _PBF_ADDR_ALLOCATED) {
-			void *vaddr = pagebuf_mapout_locked(pb);
-			if (vaddr) {
-				free_address(vaddr);
-			}
-		}
-
-		if (pb->pb_flags & _PBF_MEM_ALLOCATED) {
-			if (pb->pb_pages) {
-				/* release the pages in the address list */
-				if (pb->pb_pages[0] &&
-				    PageSlab(pb->pb_pages[0])) {
-					/*
-					 * This came from the slab
-					 * allocator free it as such
-					 */
-					kfree(pb->pb_addr);
-				} else {
-					_pagebuf_freepages(pb);
-				}
-
-				pb->pb_pages = NULL;
-			}
-			pb->pb_flags &= ~_PBF_MEM_ALLOCATED;
-		}
-	}
-
-	pagebuf_deallocate(pb);
-}
-
-/*
- *	_pagebuf_lookup_pages
- *
- *	_pagebuf_lookup_pages finds all pages which match the buffer
- *	in question and the range of file offsets supplied,
- *	and builds the page list for the buffer, if the
- *	page list is not already formed or if not all of the pages are
- *	already in the list. Invalid pages (pages which have not yet been
- *	read in from disk) are assigned for any pages which are not found.
- */
-STATIC int
-_pagebuf_lookup_pages(
-	page_buf_t		*pb,
-	struct address_space	*aspace,
-	page_buf_flags_t	flags)
-{
-	loff_t			next_buffer_offset;
-	unsigned long		page_count, pi, index;
-	struct page		*page;
-	int			gfp_mask, retry_count = 5, rval = 0;
-	int			all_mapped, good_pages, nbytes;
-	unsigned int		blocksize, sectorshift;
-	size_t			size, offset;
-
-
-	/* For pagebufs where we want to map an address, do not use
-	 * highmem pages - so that we do not need to use kmap resources
-	 * to access the data.
-	 *
-	 * For pages where the caller has indicated there may be resource
-	 * contention (e.g. called from a transaction) do not flush
-	 * delalloc pages to obtain memory.
-	 */
-
-	if (flags & PBF_READ_AHEAD) {
-		gfp_mask = GFP_READAHEAD;
-		retry_count = 0;
-	} else if (flags & PBF_DONT_BLOCK) {
-		gfp_mask = GFP_NOFS;
-	} else if (flags & PBF_MAPPABLE) {
-		gfp_mask = GFP_KERNEL;
-	} else {
-		gfp_mask = GFP_HIGHUSER;
-	}
-
-	next_buffer_offset = pb->pb_file_offset + pb->pb_buffer_length;
-
-	good_pages = page_count = (page_buf_btoc(next_buffer_offset) -
-				   page_buf_btoct(pb->pb_file_offset));
-
-	if (pb->pb_flags & _PBF_ALL_PAGES_MAPPED) {
-		/* Bring pages forward in cache */
-		for (pi = 0; pi < page_count; pi++) {
-			mark_page_accessed(pb->pb_pages[pi]);
-		}
-		if ((flags & PBF_MAPPED) && !(pb->pb_flags & PBF_MAPPED)) {
-			all_mapped = 1;
-			goto mapit;
-		}
-		return 0;
-	}
-
-	/* Ensure pb_pages field has been initialised */
-	rval = _pagebuf_get_pages(pb, page_count, flags);
-	if (rval)
-		return rval;
-
-	rval = pi = 0;
-	blocksize = pb->pb_target->pbr_bsize;
-	sectorshift = pb->pb_target->pbr_sshift;
-	size = pb->pb_count_desired;
-	offset = pb->pb_offset;
-
-	/* Enter the pages in the page list */
-	index = (pb->pb_file_offset - pb->pb_offset) >> PAGE_CACHE_SHIFT;
-	for (all_mapped = 1; pi < page_count; pi++, index++) {
-		if (pb->pb_pages[pi] == 0) {
-		      retry:
-			page = find_or_create_page(aspace, index, gfp_mask);
-			if (!page) {
-				if (--retry_count > 0) {
-					PB_STATS_INC(pb_page_retries);
-					pagebuf_daemon_wakeup(1);
-					current->state = TASK_UNINTERRUPTIBLE;
-					schedule_timeout(10);
-					goto retry;
-				}
-				rval = -ENOMEM;
-				all_mapped = 0;
-				continue;
-			}
-			PB_STATS_INC(pb_page_found);
-			mark_page_accessed(page);
-			pb->pb_pages[pi] = page;
-		} else {
-			page = pb->pb_pages[pi];
-			lock_page(page);
-		}
-
-		nbytes = PAGE_CACHE_SIZE - offset;
-		if (nbytes > size)
-			nbytes = size;
-		size -= nbytes;
-
-		if (!PageUptodate(page)) {
-			if (blocksize == PAGE_CACHE_SIZE) {
-				if (flags & PBF_READ)
-					pb->pb_locked = 1;
-				good_pages--;
-			} else if (!PagePrivate(page)) {
-				unsigned long	i, range;
-
-				/*
-				 * In this case page->private holds a bitmap
-				 * of uptodate sectors within the page
-				 */
-				ASSERT(blocksize < PAGE_CACHE_SIZE);
-				range = (offset + nbytes) >> sectorshift;
-				for (i = offset >> sectorshift; i < range; i++)
-					if (!test_bit(i, &page->private))
-						break;
-				if (i != range)
-					good_pages--;
-			} else {
-				good_pages--;
-			}
-		}
-		offset = 0;
-	}
-
-	if (!pb->pb_locked) {
-		for (pi = 0; pi < page_count; pi++) {
-			if (pb->pb_pages[pi])
-				unlock_page(pb->pb_pages[pi]);
-		}
-	}
-
-mapit:
-	pb->pb_flags |= _PBF_MEM_ALLOCATED;
-	if (all_mapped) {
-		pb->pb_flags |= _PBF_ALL_PAGES_MAPPED;
-
-		/* A single page buffer is always mappable */
-		if (page_count == 1) {
-			pb->pb_addr = (caddr_t)
-				page_address(pb->pb_pages[0]) + pb->pb_offset;
-			pb->pb_flags |= PBF_MAPPED;
-		} else if (flags & PBF_MAPPED) {
-			if (as_list_len > 64)
-				purge_addresses();
-			pb->pb_addr = vmap(pb->pb_pages, page_count,
-					VM_MAP, PAGE_KERNEL);
-			if (pb->pb_addr == NULL)
-				return -ENOMEM;
-			pb->pb_addr += pb->pb_offset;
-			pb->pb_flags |= PBF_MAPPED | _PBF_ADDR_ALLOCATED;
-		}
-	}
-	/* If some pages were found with data in them
-	 * we are not in PBF_NONE state.
-	 */
-	if (good_pages != 0) {
-		pb->pb_flags &= ~(PBF_NONE);
-		if (good_pages != page_count) {
-			pb->pb_flags |= PBF_PARTIAL;
-		}
-	}
-
-	PB_TRACE(pb, PB_TRACE_REC(look_pg), good_pages);
-
-	return rval;
-}
-
-/*
- *	Finding and Reading Buffers
- */
-
-/*
- *	_pagebuf_find
- *
- *	Looks up, and creates if absent, a lockable buffer for
- *	a given range of an inode.  The buffer is returned
- *	locked.	 If other overlapping buffers exist, they are
- *	released before the new buffer is created and locked,
- *	which may imply that this call will block until those buffers
- *	are unlocked.  No I/O is implied by this call.
- */
-STATIC page_buf_t *
-_pagebuf_find(				/* find buffer for block	*/
-	pb_target_t		*target,/* target for block		*/
-	loff_t			ioff,	/* starting offset of range	*/
-	size_t			isize,	/* length of range		*/
-	page_buf_flags_t	flags,	/* PBF_TRYLOCK			*/
-	page_buf_t		*new_pb)/* newly allocated buffer	*/
-{
-	loff_t			range_base;
-	size_t			range_length;
-	int			hval;
-	pb_hash_t		*h;
-	struct list_head	*p;
-	page_buf_t		*pb;
-	int			not_locked;
-
-	range_base = (ioff << BBSHIFT);
-	range_length = (isize << BBSHIFT);
-
-	/* Ensure we never do IOs smaller than the sector size */
-	BUG_ON(range_length < (1 << target->pbr_sshift));
-
-	/* Ensure we never do IOs that are not sector aligned */
-	BUG_ON(range_base & (loff_t)target->pbr_smask);
-
-	hval = _bhash(target->pbr_bdev, range_base);
-	h = &pbhash[hval];
-
-	spin_lock(&h->pb_hash_lock);
-	list_for_each(p, &h->pb_hash) {
-		pb = list_entry(p, page_buf_t, pb_hash_list);
-
-		if ((target == pb->pb_target) &&
-		    (pb->pb_file_offset == range_base) &&
-		    (pb->pb_buffer_length == range_length)) {
-			if (pb->pb_flags & PBF_FREED)
-				break;
-			/* If we look at something bring it to the
-			 * front of the list for next time
-			 */
-			list_del(&pb->pb_hash_list);
-			list_add(&pb->pb_hash_list, &h->pb_hash);
-			goto found;
-		}
-	}
-
-	/* No match found */
-	if (new_pb) {
-		_pagebuf_initialize(new_pb, target, range_base,
-				range_length, flags | _PBF_LOCKABLE);
-		new_pb->pb_hash_index = hval;
-		h->pb_count++;
-		list_add(&new_pb->pb_hash_list, &h->pb_hash);
-	} else {
-		PB_STATS_INC(pb_miss_locked);
-	}
-
-	spin_unlock(&h->pb_hash_lock);
-	return (new_pb);
-
-found:
-	atomic_inc(&pb->pb_hold);
-	spin_unlock(&h->pb_hash_lock);
-
-	/* Attempt to get the semaphore without sleeping,
-	 * if this does not work then we need to drop the
-	 * spinlock and do a hard attempt on the semaphore.
-	 */
-	not_locked = down_trylock(&pb->pb_sema);
-	if (not_locked) {
-		if (!(flags & PBF_TRYLOCK)) {
-			/* wait for buffer ownership */
-			PB_TRACE(pb, PB_TRACE_REC(get_lk), 0);
-			pagebuf_lock(pb);
-			PB_STATS_INC(pb_get_locked_waited);
-		} else {
-			/* We asked for a trylock and failed, no need
-			 * to look at file offset and length here, we
-			 * know that this pagebuf at least overlaps our
-			 * pagebuf and is locked, therefore our buffer
-			 * either does not exist, or is this buffer
-			 */
-
-			pagebuf_rele(pb);
-			PB_STATS_INC(pb_busy_locked);
-			return (NULL);
-		}
-	} else {
-		/* trylock worked */
-		PB_SET_OWNER(pb);
-	}
-
-	if (pb->pb_flags & PBF_STALE)
-		pb->pb_flags &= PBF_MAPPABLE | \
-				PBF_MAPPED | \
-				_PBF_LOCKABLE | \
-				_PBF_ALL_PAGES_MAPPED | \
-				_PBF_ADDR_ALLOCATED | \
-				_PBF_MEM_ALLOCATED;
-	PB_TRACE(pb, PB_TRACE_REC(got_lk), 0);
-	PB_STATS_INC(pb_get_locked);
-	return (pb);
-}
-
-
-/*
- *	pagebuf_find
- *
- *	pagebuf_find returns a buffer matching the specified range of
- *	data for the specified target, if any of the relevant blocks
- *	are in memory.  The buffer may have unallocated holes, if
- *	some, but not all, of the blocks are in memory.  Even where
- *	pages are present in the buffer, not all of every page may be
- *	valid.
- */
-page_buf_t *
-pagebuf_find(				/* find buffer for block	*/
-					/* if the block is in memory	*/
-	pb_target_t		*target,/* target for block		*/
-	loff_t			ioff,	/* starting offset of range	*/
-	size_t			isize,	/* length of range		*/
-	page_buf_flags_t	flags)	/* PBF_TRYLOCK			*/
-{
-	return _pagebuf_find(target, ioff, isize, flags, NULL);
-}
-
-/*
- *	pagebuf_get
- *
- *	pagebuf_get assembles a buffer covering the specified range.
- *	Some or all of the blocks in the range may be valid.  Storage
- *	in memory for all portions of the buffer will be allocated,
- *	although backing storage may not be.  If PBF_READ is set in
- *	flags, pagebuf_iostart is called also.
- */
-page_buf_t *
-pagebuf_get(				/* allocate a buffer		*/
-	pb_target_t		*target,/* target for buffer		*/
-	loff_t			ioff,	/* starting offset of range	*/
-	size_t			isize,	/* length of range		*/
-	page_buf_flags_t	flags)	/* PBF_TRYLOCK			*/
-{
-	page_buf_t		*pb, *new_pb;
-	int			error;
-
-	new_pb = pagebuf_allocate(flags);
-	if (unlikely(!new_pb))
-		return (NULL);
-
-	pb = _pagebuf_find(target, ioff, isize, flags, new_pb);
-	if (pb != new_pb) {
-		pagebuf_deallocate(new_pb);
-		if (unlikely(!pb))
-			return (NULL);
-	}
-
-	PB_STATS_INC(pb_get);
-
-	/* fill in any missing pages */
-	error = _pagebuf_lookup_pages(pb, pb->pb_target->pbr_mapping, flags);
-	if (unlikely(error)) {
-		pagebuf_free(pb);
-		return (NULL);
-	}
-
-	/*
-	 * Always fill in the block number now, the mapped cases can do
-	 * their own overlay of this later.
-	 */
-	pb->pb_bn = ioff;
-	pb->pb_count_desired = pb->pb_buffer_length;
-
-	if (flags & PBF_READ) {
-		if (PBF_NOT_DONE(pb)) {
-			PB_TRACE(pb, PB_TRACE_REC(get_read), flags);
-			PB_STATS_INC(pb_get_read);
-			pagebuf_iostart(pb, flags);
-		} else if (flags & PBF_ASYNC) {
-			/*
-			 * Read ahead call which is already satisfied,
-			 * drop the buffer
-			 */
-			if (flags & (PBF_LOCK | PBF_TRYLOCK))
-				pagebuf_unlock(pb);
-			pagebuf_rele(pb);
-			return NULL;
-		} else {
-			/* We do not want read in the flags */
-			pb->pb_flags &= ~PBF_READ;
-		}
-	}
-
-	PB_TRACE(pb, PB_TRACE_REC(get_obj), flags);
-	return (pb);
-}
-
-/*
- * Create a skeletal pagebuf (no pages associated with it).
- */
-page_buf_t *
-pagebuf_lookup(
-	struct pb_target	*target,
-	loff_t			ioff,
-	size_t			isize,
-	page_buf_flags_t	flags)
-{
-	page_buf_t		*pb;
-
-	pb = pagebuf_allocate(flags);
-	if (pb) {
-		_pagebuf_initialize(pb, target, ioff, isize, flags);
-	}
-	return pb;
-}
-
-/*
- * If we are not low on memory then do the readahead in a deadlock
- * safe manner.
- */
-void
-pagebuf_readahead(
-	pb_target_t		*target,
-	loff_t			ioff,
-	size_t			isize,
-	page_buf_flags_t	flags)
-{
-	struct backing_dev_info *bdi;
-
-	bdi = target->pbr_mapping->backing_dev_info;
-	if (bdi_read_congested(bdi))
-		return;
-	if (bdi_write_congested(bdi))
-		return;
-
-	flags |= (PBF_TRYLOCK|PBF_READ|PBF_ASYNC|PBF_MAPPABLE|PBF_READ_AHEAD);
-	pagebuf_get(target, ioff, isize, flags);
-}
-
-page_buf_t *
-pagebuf_get_empty(
-	size_t			len,
-	pb_target_t		*target)
-{
-	page_buf_t		*pb;
-
-	pb = pagebuf_allocate(_PBF_LOCKABLE);
-	if (pb)
-		_pagebuf_initialize(pb, target, 0, len, _PBF_LOCKABLE);
-	return pb;
-}
-
-static inline struct page *
-mem_to_page(
-	void			*addr)
-{
-	if (((unsigned long)addr < VMALLOC_START) ||
-	    ((unsigned long)addr >= VMALLOC_END)) {
-		return virt_to_page(addr);
-	} else {
-		return vmalloc_to_page(addr);
-	}
-}
-
-int
-pagebuf_associate_memory(
-	page_buf_t		*pb,
-	void			*mem,
-	size_t			len)
-{
-	int			rval;
-	int			i = 0;
-	size_t			ptr;
-	size_t			end, end_cur;
-	off_t			offset;
-	int			page_count;
-
-	page_count = PAGE_CACHE_ALIGN(len) >> PAGE_CACHE_SHIFT;
-	offset = (off_t) mem - ((off_t)mem & PAGE_CACHE_MASK);
-	if (offset && (len > PAGE_CACHE_SIZE))
-		page_count++;
-
-	/* Free any previous set of page pointers */
-	if (pb->pb_pages && (pb->pb_pages != pb->pb_page_array)) {
-		kfree(pb->pb_pages);
-	}
-	pb->pb_pages = NULL;
-	pb->pb_addr = mem;
-
-	rval = _pagebuf_get_pages(pb, page_count, 0);
-	if (rval)
-		return rval;
-
-	pb->pb_offset = offset;
-	ptr = (size_t) mem & PAGE_CACHE_MASK;
-	end = PAGE_CACHE_ALIGN((size_t) mem + len);
-	end_cur = end;
-	/* set up first page */
-	pb->pb_pages[0] = mem_to_page(mem);
-
-	ptr += PAGE_CACHE_SIZE;
-	pb->pb_page_count = ++i;
-	while (ptr < end) {
-		pb->pb_pages[i] = mem_to_page((void *)ptr);
-		pb->pb_page_count = ++i;
-		ptr += PAGE_CACHE_SIZE;
-	}
-	pb->pb_locked = 0;
-
-	pb->pb_count_desired = pb->pb_buffer_length = len;
-	pb->pb_flags |= PBF_MAPPED;
-
-	return 0;
-}
-
-page_buf_t *
-pagebuf_get_no_daddr(
-	size_t			len,
-	pb_target_t		*target)
-{
-	int			rval;
-	void			*rmem = NULL;
-	page_buf_flags_t	flags = _PBF_LOCKABLE | PBF_FORCEIO;
-	page_buf_t		*pb;
-	size_t			tlen = 0;
-
-	if (len > 0x20000)
-		return(NULL);
-
-	pb = pagebuf_allocate(flags);
-	if (!pb)
-		return NULL;
-
-	_pagebuf_initialize(pb, target, 0, len, flags);
-
-	do {
-		if (tlen == 0) {
-			tlen = len; /* first time */
-		} else {
-			kfree(rmem); /* free the mem from the previous try */
-			tlen <<= 1; /* double the size and try again */
-		}
-		if ((rmem = kmalloc(tlen, GFP_KERNEL)) == 0) {
-			pagebuf_free(pb);
-			return NULL;
-		}
-	} while ((size_t)rmem != ((size_t)rmem & ~target->pbr_smask));
-
-	if ((rval = pagebuf_associate_memory(pb, rmem, len)) != 0) {
-		kfree(rmem);
-		pagebuf_free(pb);
-		return NULL;
-	}
-	/* otherwise pagebuf_free just ignores it */
-	pb->pb_flags |= _PBF_MEM_ALLOCATED;
-	PB_CLEAR_OWNER(pb);
-	up(&pb->pb_sema);	/* Return unlocked pagebuf */
-
-	PB_TRACE(pb, PB_TRACE_REC(no_daddr), rmem);
-
-	return pb;
-}
-
-
-/*
- *	pagebuf_hold
- *
- *	Increment reference count on buffer, to hold the buffer concurrently
- *	with another thread which may release (free) the buffer asynchronously.
- *
- *	Must hold the buffer already to call this function.
- */
-void
-pagebuf_hold(
-	page_buf_t		*pb)
-{
-	atomic_inc(&pb->pb_hold);
-	PB_TRACE(pb, PB_TRACE_REC(hold), 0);
-}
-
-/*
- *	pagebuf_free
- *
- *	pagebuf_free releases the specified buffer.  The modification
- *	state of any associated pages is left unchanged.
- */
-void
-pagebuf_free(
-	page_buf_t		*pb)
-{
-	if (pb->pb_flags & _PBF_LOCKABLE) {
-		pb_hash_t	*h = pb_hash(pb);
-
-		spin_lock(&h->pb_hash_lock);
-		_pagebuf_free_object(h, pb);
-	} else {
-		_pagebuf_free_object(NULL, pb);
-	}
-}
-
-/*
- *	pagebuf_rele
- *
- *	pagebuf_rele releases a hold on the specified buffer.  If the
- *	the hold count is 1, pagebuf_rele calls pagebuf_free.
- */
-void
-pagebuf_rele(
-	page_buf_t		*pb)
-{
-	pb_hash_t		*h;
-
-	PB_TRACE(pb, PB_TRACE_REC(rele), pb->pb_relse);
-	if (pb->pb_flags & _PBF_LOCKABLE) {
-		h = pb_hash(pb);
-		spin_lock(&h->pb_hash_lock);
-	} else {
-		h = NULL;
-	}
-
-	if (atomic_dec_and_test(&pb->pb_hold)) {
-		int		do_free = 1;
-
-		if (pb->pb_relse) {
-			atomic_inc(&pb->pb_hold);
-			if (h)
-				spin_unlock(&h->pb_hash_lock);
-			(*(pb->pb_relse)) (pb);
-			do_free = 0;
-		}
-		if (pb->pb_flags & PBF_DELWRI) {
-			pb->pb_flags |= PBF_ASYNC;
-			atomic_inc(&pb->pb_hold);
-			if (h && do_free)
-				spin_unlock(&h->pb_hash_lock);
-			pagebuf_delwri_queue(pb, 0);
-			do_free = 0;
-		} else if (pb->pb_flags & PBF_FS_MANAGED) {
-			if (h)
-				spin_unlock(&h->pb_hash_lock);
-			do_free = 0;
-		}
-
-		if (do_free) {
-			_pagebuf_free_object(h, pb);
-		}
-	} else if (h) {
-		spin_unlock(&h->pb_hash_lock);
-	}
-}
-
-
-/*
- *	Pinning Buffer Storage in Memory
- */
-
-/*
- *	pagebuf_pin
- *
- *	pagebuf_pin locks all of the memory represented by a buffer in
- *	memory.  Multiple calls to pagebuf_pin and pagebuf_unpin, for
- *	the same or different buffers affecting a given page, will
- *	properly count the number of outstanding "pin" requests.  The
- *	buffer may be released after the pagebuf_pin and a different
- *	buffer used when calling pagebuf_unpin, if desired.
- *	pagebuf_pin should be used by the file system when it wants be
- *	assured that no attempt will be made to force the affected
- *	memory to disk.	 It does not assure that a given logical page
- *	will not be moved to a different physical page.
- */
-void
-pagebuf_pin(
-	page_buf_t		*pb)
-{
-	atomic_inc(&pb->pb_pin_count);
-	PB_TRACE(pb, PB_TRACE_REC(pin), pb->pb_pin_count.counter);
-}
-
-/*
- *	pagebuf_unpin
- *
- *	pagebuf_unpin reverses the locking of memory performed by
- *	pagebuf_pin.  Note that both functions affected the logical
- *	pages associated with the buffer, not the buffer itself.
- */
-void
-pagebuf_unpin(
-	page_buf_t		*pb)
-{
-	if (atomic_dec_and_test(&pb->pb_pin_count)) {
-		wake_up_all(&pb->pb_waiters);
-	}
-	PB_TRACE(pb, PB_TRACE_REC(unpin), pb->pb_pin_count.counter);
-}
-
-int
-pagebuf_ispin(
-	page_buf_t		*pb)
-{
-	return atomic_read(&pb->pb_pin_count);
-}
-
-/*
- *	pagebuf_wait_unpin
- *
- *	pagebuf_wait_unpin waits until all of the memory associated
- *	with the buffer is not longer locked in memory.  It returns
- *	immediately if none of the affected pages are locked.
- */
-static inline void
-_pagebuf_wait_unpin(
-	page_buf_t		*pb)
-{
-	DECLARE_WAITQUEUE	(wait, current);
-
-	if (atomic_read(&pb->pb_pin_count) == 0)
-		return;
-
-	add_wait_queue(&pb->pb_waiters, &wait);
-	for (;;) {
-		current->state = TASK_UNINTERRUPTIBLE;
-		if (atomic_read(&pb->pb_pin_count) == 0)
-			break;
-		if (atomic_read(&pb->pb_io_remaining))
-			blk_run_queues();
-		schedule();
-	}
-	remove_wait_queue(&pb->pb_waiters, &wait);
-	current->state = TASK_RUNNING;
-}
-
-/*
- *	Buffer Utility Routines
- */
-
-/*
- *	pagebuf_iodone
- *
- *	pagebuf_iodone marks a buffer for which I/O is in progress
- *	done with respect to that I/O.	The pb_iodone routine, if
- *	present, will be called as a side-effect.
- */
-void
-pagebuf_iodone_work(
-	void			*v)
-{
-	page_buf_t		*pb = (page_buf_t *)v;
-
-	if (pb->pb_iodone) {
-		(*(pb->pb_iodone)) (pb);
-		return;
-	}
-
-	if (pb->pb_flags & PBF_ASYNC) {
-		if ((pb->pb_flags & _PBF_LOCKABLE) && !pb->pb_relse)
-			pagebuf_unlock(pb);
-		pagebuf_rele(pb);
-	}
-}
-
-void
-pagebuf_iodone(
-	page_buf_t		*pb,
-	int			dataio,
-	int			schedule)
-{
-	pb->pb_flags &= ~(PBF_READ | PBF_WRITE);
-	if (pb->pb_error == 0) {
-		pb->pb_flags &= ~(PBF_PARTIAL | PBF_NONE);
-	}
-
-	PB_TRACE(pb, PB_TRACE_REC(done), pb->pb_iodone);
-
-	if ((pb->pb_iodone) || (pb->pb_flags & PBF_ASYNC)) {
-		if (schedule) {
-			INIT_WORK(&pb->pb_iodone_work, pagebuf_iodone_work, pb);
-			queue_work(dataio ? pagebuf_dataio_workqueue :
-				pagebuf_logio_workqueue, &pb->pb_iodone_work);
-		} else {
-			pagebuf_iodone_work(pb);
-		}
-	} else {
-		up(&pb->pb_iodonesema);
-	}
-}
-
-/*
- *	pagebuf_ioerror
- *
- *	pagebuf_ioerror sets the error code for a buffer.
- */
-void
-pagebuf_ioerror(			/* mark/clear buffer error flag */
-	page_buf_t		*pb,	/* buffer to mark		*/
-	unsigned int		error)	/* error to store (0 if none)	*/
-{
-	pb->pb_error = error;
-	PB_TRACE(pb, PB_TRACE_REC(ioerror), error);
-}
-
-/*
- *	pagebuf_iostart
- *
- *	pagebuf_iostart initiates I/O on a buffer, based on the flags supplied.
- *	If necessary, it will arrange for any disk space allocation required,
- *	and it will break up the request if the block mappings require it.
- *	The pb_iodone routine in the buffer supplied will only be called
- *	when all of the subsidiary I/O requests, if any, have been completed.
- *	pagebuf_iostart calls the pagebuf_ioinitiate routine or
- *	pagebuf_iorequest, if the former routine is not defined, to start
- *	the I/O on a given low-level request.
- */
-int
-pagebuf_iostart(			/* start I/O on a buffer	  */
-	page_buf_t		*pb,	/* buffer to start		  */
-	page_buf_flags_t	flags)	/* PBF_LOCK, PBF_ASYNC, PBF_READ, */
-					/* PBF_WRITE, PBF_DELWRI,	  */
-					/* PBF_SYNC, PBF_DONT_BLOCK	  */
-{
-	int			status = 0;
-
-	PB_TRACE(pb, PB_TRACE_REC(iostart), flags);
-
-	if (flags & PBF_DELWRI) {
-		pb->pb_flags &= ~(PBF_READ | PBF_WRITE | PBF_ASYNC);
-		pb->pb_flags |= flags &
-				(PBF_DELWRI | PBF_ASYNC | PBF_SYNC);
-		pagebuf_delwri_queue(pb, 1);
-		return status;
-	}
-
-	pb->pb_flags &= ~(PBF_READ | PBF_WRITE | PBF_ASYNC | \
-			PBF_DELWRI | PBF_READ_AHEAD | PBF_RUN_QUEUES);
-	pb->pb_flags |= flags & (PBF_READ | PBF_WRITE | PBF_ASYNC | \
-			PBF_SYNC | PBF_READ_AHEAD | PBF_RUN_QUEUES);
-
-	BUG_ON(pb->pb_bn == PAGE_BUF_DADDR_NULL);
-
-	/* For writes allow an alternate strategy routine to precede
-	 * the actual I/O request (which may not be issued at all in
-	 * a shutdown situation, for example).
-	 */
-	status = (flags & PBF_WRITE) ?
-		pagebuf_iostrategy(pb) : pagebuf_iorequest(pb);
-
-	/* Wait for I/O if we are not an async request.
-	 * Note: async I/O request completion will release the buffer,
-	 * and that can already be done by this point.  So using the
-	 * buffer pointer from here on, after async I/O, is invalid.
-	 */
-	if (!status && !(flags & PBF_ASYNC))
-		status = pagebuf_iowait(pb);
-
-	return status;
-}
-
-/*
- * Helper routine for pagebuf_iorequest
- */
-
-STATIC __inline__ int
-_pagebuf_iolocked(
-	page_buf_t		*pb)
-{
-	ASSERT(pb->pb_flags & (PBF_READ|PBF_WRITE));
-	if (pb->pb_flags & PBF_READ)
-		return pb->pb_locked;
-	return ((pb->pb_flags & _PBF_LOCKABLE) == 0);
-}
-
-STATIC __inline__ void
-_pagebuf_iodone(
-	page_buf_t		*pb,
-	int			schedule)
-{
-	if (atomic_dec_and_test(&pb->pb_io_remaining) == 1) {
-		pb->pb_locked = 0;
-		pagebuf_iodone(pb, (pb->pb_flags & PBF_FS_DATAIOD), schedule);
-	}
-}
-
-STATIC int
-bio_end_io_pagebuf(
-	struct bio		*bio,
-	unsigned int		bytes_done,
-	int			error)
-{
-	page_buf_t		*pb = (page_buf_t *)bio->bi_private;
-	unsigned int		i, blocksize = pb->pb_target->pbr_bsize;
-	unsigned int		sectorshift = pb->pb_target->pbr_sshift;
-	struct bio_vec		*bvec = bio->bi_io_vec;
-
-	if (bio->bi_size)
-		return 1;
-
-	if (!test_bit(BIO_UPTODATE, &bio->bi_flags))
-		pb->pb_error = EIO;
-
-	for (i = 0; i < bio->bi_vcnt; i++, bvec++) {
-		struct page	*page = bvec->bv_page;
-
-		if (pb->pb_error) {
-			SetPageError(page);
-		} else if (blocksize == PAGE_CACHE_SIZE) {
-			SetPageUptodate(page);
-		} else if (!PagePrivate(page)) {
-			unsigned int	j, range;
-
-			ASSERT(blocksize < PAGE_CACHE_SIZE);
-			range = (bvec->bv_offset + bvec->bv_len) >> sectorshift;
-			for (j = bvec->bv_offset >> sectorshift; j < range; j++)
-				set_bit(j, &page->private);
-			if (page->private == (unsigned long)(PAGE_CACHE_SIZE-1))
-				SetPageUptodate(page);
-		}
-
-		if (_pagebuf_iolocked(pb)) {
-			unlock_page(page);
-		}
-	}
-
-	_pagebuf_iodone(pb, 1);
-	bio_put(bio);
-	return 0;
-}
-
-void
-_pagebuf_ioapply(
-	page_buf_t		*pb)
-{
-	int			i, map_i, total_nr_pages, nr_pages;
-	struct bio		*bio;
-	int			offset = pb->pb_offset;
-	int			size = pb->pb_count_desired;
-	sector_t		sector = pb->pb_bn;
-	unsigned int		blocksize = pb->pb_target->pbr_bsize;
-	int			locking = _pagebuf_iolocked(pb);
-
-	total_nr_pages = pb->pb_page_count;
-	map_i = 0;
-
-	/* Special code path for reading a sub page size pagebuf in --
-	 * we populate up the whole page, and hence the other metadata
-	 * in the same page.  This optimization is only valid when the
-	 * filesystem block size and the page size are equal.
-	 */
-	if ((pb->pb_buffer_length < PAGE_CACHE_SIZE) &&
-	    (pb->pb_flags & PBF_READ) && locking &&
-	    (blocksize == PAGE_CACHE_SIZE)) {
-		bio = bio_alloc(GFP_NOIO, 1);
-
-		bio->bi_bdev = pb->pb_target->pbr_bdev;
-		bio->bi_sector = sector - (offset >> BBSHIFT);
-		bio->bi_end_io = bio_end_io_pagebuf;
-		bio->bi_private = pb;
-
-		bio_add_page(bio, pb->pb_pages[0], PAGE_CACHE_SIZE, 0);
-		size = 0;
-
-		atomic_inc(&pb->pb_io_remaining);
-
-		goto submit_io;
-	}
-
-	/* Lock down the pages which we need to for the request */
-	if (locking && (pb->pb_flags & PBF_WRITE) && (pb->pb_locked == 0)) {
-		for (i = 0; size; i++) {
-			int		nbytes = PAGE_CACHE_SIZE - offset;
-			struct page	*page = pb->pb_pages[i];
-
-			if (nbytes > size)
-				nbytes = size;
-
-			lock_page(page);
-
-			size -= nbytes;
-			offset = 0;
-		}
-		offset = pb->pb_offset;
-		size = pb->pb_count_desired;
-	}
-
-next_chunk:
-	atomic_inc(&pb->pb_io_remaining);
-	nr_pages = BIO_MAX_SECTORS >> (PAGE_SHIFT - BBSHIFT);
-	if (nr_pages > total_nr_pages)
-		nr_pages = total_nr_pages;
-
-	bio = bio_alloc(GFP_NOIO, nr_pages);
-	bio->bi_bdev = pb->pb_target->pbr_bdev;
-	bio->bi_sector = sector;
-	bio->bi_end_io = bio_end_io_pagebuf;
-	bio->bi_private = pb;
-
-	for (; size && nr_pages; nr_pages--, map_i++) {
-		int	nbytes = PAGE_CACHE_SIZE - offset;
-
-		if (nbytes > size)
-			nbytes = size;
-
-		if (bio_add_page(bio, pb->pb_pages[map_i],
-					nbytes, offset) < nbytes)
-			break;
-
-		offset = 0;
-		sector += nbytes >> BBSHIFT;
-		size -= nbytes;
-		total_nr_pages--;
-	}
-
-submit_io:
-	if (likely(bio->bi_size)) {
-		submit_bio((pb->pb_flags & PBF_READ) ? READ : WRITE, bio);
-		if (size)
-			goto next_chunk;
-	} else {
-		bio_put(bio);
-		pagebuf_ioerror(pb, EIO);
-	}
-
-	if (pb->pb_flags & PBF_RUN_QUEUES) {
-		pb->pb_flags &= ~PBF_RUN_QUEUES;
-		if (atomic_read(&pb->pb_io_remaining) > 1)
-			blk_run_queues();
-	}
-}
-
-/*
- *	pagebuf_iorequest
- *
- *	pagebuf_iorequest is the core I/O request routine.
- *	It assumes that the buffer is well-formed and
- *	mapped and ready for physical I/O, unlike
- *	pagebuf_iostart() and pagebuf_iophysio().  Those
- *	routines call the pagebuf_ioinitiate routine to start I/O,
- *	if it is present, or else call pagebuf_iorequest()
- *	directly if the pagebuf_ioinitiate routine is not present.
- *
- *	This function will be responsible for ensuring access to the
- *	pages is restricted whilst I/O is in progress - for locking
- *	pagebufs the pagebuf lock is the mediator, for non-locking
- *	pagebufs the pages will be locked. In the locking case we
- *	need to use the pagebuf lock as multiple meta-data buffers
- *	will reference the same page.
- */
-int
-pagebuf_iorequest(			/* start real I/O		*/
-	page_buf_t		*pb)	/* buffer to convey to device	*/
-{
-	PB_TRACE(pb, PB_TRACE_REC(ioreq), 0);
-
-	if (pb->pb_flags & PBF_DELWRI) {
-		pagebuf_delwri_queue(pb, 1);
-		return 0;
-	}
-
-	if (pb->pb_flags & PBF_WRITE) {
-		_pagebuf_wait_unpin(pb);
-	}
-
-	pagebuf_hold(pb);
-
-	/* Set the count to 1 initially, this will stop an I/O
-	 * completion callout which happens before we have started
-	 * all the I/O from calling pagebuf_iodone too early.
-	 */
-	atomic_set(&pb->pb_io_remaining, 1);
-	_pagebuf_ioapply(pb);
-	_pagebuf_iodone(pb, 0);
-
-	pagebuf_rele(pb);
-	return 0;
-}
-
-/*
- *	pagebuf_iowait
- *
- *	pagebuf_iowait waits for I/O to complete on the buffer supplied.
- *	It returns immediately if no I/O is pending.  In any case, it returns
- *	the error code, if any, or 0 if there is no error.
- */
-int
-pagebuf_iowait(
-	page_buf_t		*pb)
-{
-	PB_TRACE(pb, PB_TRACE_REC(iowait), 0);
-	if (atomic_read(&pb->pb_io_remaining))
-		blk_run_queues();
-	down(&pb->pb_iodonesema);
-	PB_TRACE(pb, PB_TRACE_REC(iowaited), (int)pb->pb_error);
-	return pb->pb_error;
-}
-
-STATIC void *
-pagebuf_mapout_locked(
-	page_buf_t		*pb)
-{
-	void			*old_addr = NULL;
-
-	if (pb->pb_flags & PBF_MAPPED) {
-		if (pb->pb_flags & _PBF_ADDR_ALLOCATED)
-			old_addr = pb->pb_addr - pb->pb_offset;
-		pb->pb_addr = NULL;
-		pb->pb_flags &= ~(PBF_MAPPED | _PBF_ADDR_ALLOCATED);
-	}
-
-	return old_addr;	/* Caller must free the address space,
-				 * we are under a spin lock, probably
-				 * not safe to do vfree here
-				 */
-}
-
-caddr_t
-pagebuf_offset(
-	page_buf_t		*pb,
-	size_t			offset)
-{
-	struct page		*page;
-
-	offset += pb->pb_offset;
-
-	page = pb->pb_pages[offset >> PAGE_CACHE_SHIFT];
-	return (caddr_t) page_address(page) + (offset & (PAGE_CACHE_SIZE - 1));
-}
-
-/*
- *	pagebuf_iomove
- *
- *	Move data into or out of a buffer.
- */
-void
-pagebuf_iomove(
-	page_buf_t		*pb,	/* buffer to process		*/
-	size_t			boff,	/* starting buffer offset	*/
-	size_t			bsize,	/* length to copy		*/
-	caddr_t			data,	/* data address			*/
-	page_buf_rw_t		mode)	/* read/write flag		*/
-{
-	size_t			bend, cpoff, csize;
-	struct page		*page;
-
-	bend = boff + bsize;
-	while (boff < bend) {
-		page = pb->pb_pages[page_buf_btoct(boff + pb->pb_offset)];
-		cpoff = page_buf_poff(boff + pb->pb_offset);
-		csize = min_t(size_t,
-			      PAGE_CACHE_SIZE-cpoff, pb->pb_count_desired-boff);
-
-		ASSERT(((csize + cpoff) <= PAGE_CACHE_SIZE));
-
-		switch (mode) {
-		case PBRW_ZERO:
-			memset(page_address(page) + cpoff, 0, csize);
-			break;
-		case PBRW_READ:
-			memcpy(data, page_address(page) + cpoff, csize);
-			break;
-		case PBRW_WRITE:
-			memcpy(page_address(page) + cpoff, data, csize);
-		}
-
-		boff += csize;
-		data += csize;
-	}
-}
-
-
-/*
- * Pagebuf delayed write buffer handling
- */
-
-STATIC int pbd_active = 1;
-STATIC LIST_HEAD(pbd_delwrite_queue);
-STATIC spinlock_t pbd_delwrite_lock = SPIN_LOCK_UNLOCKED;
-
-STATIC void
-pagebuf_delwri_queue(
-	page_buf_t		*pb,
-	int			unlock)
-{
-	PB_TRACE(pb, PB_TRACE_REC(delwri_q), unlock);
-	spin_lock(&pbd_delwrite_lock);
-	/* If already in the queue, dequeue and place at tail */
-	if (!list_empty(&pb->pb_list)) {
-		if (unlock) {
-			atomic_dec(&pb->pb_hold);
-		}
-		list_del(&pb->pb_list);
-	}
-
-	list_add_tail(&pb->pb_list, &pbd_delwrite_queue);
-	pb->pb_flushtime = jiffies + pb_params.age_buffer.val;
-	spin_unlock(&pbd_delwrite_lock);
-
-	if (unlock && (pb->pb_flags & _PBF_LOCKABLE)) {
-		pagebuf_unlock(pb);
-	}
-}
-
-void
-pagebuf_delwri_dequeue(
-	page_buf_t		*pb)
-{
-	PB_TRACE(pb, PB_TRACE_REC(delwri_uq), 0);
-	spin_lock(&pbd_delwrite_lock);
-	list_del_init(&pb->pb_list);
-	pb->pb_flags &= ~PBF_DELWRI;
-	spin_unlock(&pbd_delwrite_lock);
-}
-
-STATIC void
-pagebuf_runall_queues(
-	struct workqueue_struct	*queue)
-{
-	flush_workqueue(queue);
-}
-
-/* Defines for pagebuf daemon */
-DECLARE_WAIT_QUEUE_HEAD(pbd_waitq);
-STATIC int force_flush;
-
-STATIC void
-pagebuf_daemon_wakeup(
-	int			flag)
-{
-	force_flush = flag;
-	if (waitqueue_active(&pbd_waitq)) {
-		wake_up_interruptible(&pbd_waitq);
-	}
-}
-
-typedef void (*timeout_fn)(unsigned long);
-
-STATIC int
-pagebuf_daemon(
-	void			*data)
-{
-	int			count;
-	page_buf_t		*pb;
-	struct list_head	*curr, *next, tmp;
-	struct timer_list	pb_daemon_timer =
-		TIMER_INITIALIZER((timeout_fn)pagebuf_daemon_wakeup, 0, 0);
-
-	/*  Set up the thread  */
-	daemonize("pagebufd");
-
-	current->flags |= PF_MEMALLOC;
-
-	INIT_LIST_HEAD(&tmp);
-	do {
-		/* swsusp */
-		if (current->flags & PF_FREEZE)
-			refrigerator(PF_IOTHREAD);
-
-		if (pbd_active == 1) {
-			mod_timer(&pb_daemon_timer,
-				  jiffies + pb_params.flush_interval.val);
-			interruptible_sleep_on(&pbd_waitq);
-		}
-
-		if (pbd_active == 0) {
-			del_timer_sync(&pb_daemon_timer);
-		}
-
-		spin_lock(&pbd_delwrite_lock);
-
-		count = 0;
-		list_for_each_safe(curr, next, &pbd_delwrite_queue) {
-			pb = list_entry(curr, page_buf_t, pb_list);
-
-			PB_TRACE(pb, PB_TRACE_REC(walkq1), pagebuf_ispin(pb));
-
-			if ((pb->pb_flags & PBF_DELWRI) && !pagebuf_ispin(pb) &&
-			    (((pb->pb_flags & _PBF_LOCKABLE) == 0) ||
-			     !pagebuf_cond_lock(pb))) {
-
-				if (!force_flush &&
-				    time_before(jiffies, pb->pb_flushtime)) {
-					pagebuf_unlock(pb);
-					break;
-				}
-
-				pb->pb_flags &= ~PBF_DELWRI;
-				pb->pb_flags |= PBF_WRITE;
-
-				list_del(&pb->pb_list);
-				list_add(&pb->pb_list, &tmp);
-
-				count++;
-			}
-		}
-
-		spin_unlock(&pbd_delwrite_lock);
-		while (!list_empty(&tmp)) {
-			pb = list_entry(tmp.next, page_buf_t, pb_list);
-			list_del_init(&pb->pb_list);
-
-			pagebuf_iostrategy(pb);
-		}
-
-		if (as_list_len > 0)
-			purge_addresses();
-		if (count)
-			blk_run_queues();
-
-		force_flush = 0;
-	} while (pbd_active == 1);
-
-	pbd_active = -1;
-	wake_up_interruptible(&pbd_waitq);
-
-	return 0;
-}
-
-void
-pagebuf_delwri_flush(
-	pb_target_t		*target,
-	u_long			flags,
-	int			*pinptr)
-{
-	page_buf_t		*pb;
-	struct list_head	*curr, *next, tmp;
-	int			pincount = 0;
-	int			flush_cnt = 0;
-
-	pagebuf_runall_queues(pagebuf_dataio_workqueue);
-	pagebuf_runall_queues(pagebuf_logio_workqueue);
-
-	spin_lock(&pbd_delwrite_lock);
-	INIT_LIST_HEAD(&tmp);
-
-	list_for_each_safe(curr, next, &pbd_delwrite_queue) {
-		pb = list_entry(curr, page_buf_t, pb_list);
-
-		/*
-		 * Skip other targets, markers and in progress buffers
-		 */
-
-		if ((pb->pb_flags == 0) || (pb->pb_target != target) ||
-		    !(pb->pb_flags & PBF_DELWRI)) {
-			continue;
-		}
-
-		PB_TRACE(pb, PB_TRACE_REC(walkq2), pagebuf_ispin(pb));
-		if (pagebuf_ispin(pb)) {
-			pincount++;
-			continue;
-		}
-
-		pb->pb_flags &= ~PBF_DELWRI;
-		pb->pb_flags |= PBF_WRITE;
-		list_move(&pb->pb_list, &tmp);
-	}
-	/* ok found all the items that can be worked on 
-	 * drop the lock and process the private list */
-	spin_unlock(&pbd_delwrite_lock);
-
-	list_for_each_safe(curr, next, &tmp) {
-		pb = list_entry(curr, page_buf_t, pb_list);
-
-		if (flags & PBDF_WAIT)
-			pb->pb_flags &= ~PBF_ASYNC;
-		else
-			list_del_init(curr);
-
-		pagebuf_lock(pb);
-		pagebuf_iostrategy(pb);
-		if (++flush_cnt > 32) {
-			blk_run_queues();
-			flush_cnt = 0;
-		}
-	}
-
-	blk_run_queues();
-
-	while (!list_empty(&tmp)) {
-		pb = list_entry(tmp.next, page_buf_t, pb_list);
-
-		list_del_init(&pb->pb_list);
-		pagebuf_iowait(pb);
-		if (!pb->pb_relse)
-			pagebuf_unlock(pb);
-		pagebuf_rele(pb);
-	}
-
-	if (pinptr)
-		*pinptr = pincount;
-}
-
-STATIC int
-pagebuf_daemon_start(void)
-{
-	int		rval;
-
-	pagebuf_logio_workqueue = create_workqueue("xfslogd");
-	if (!pagebuf_logio_workqueue)
-		return -ENOMEM;
-
-	pagebuf_dataio_workqueue = create_workqueue("xfsdatad");
-	if (!pagebuf_dataio_workqueue) {
-		destroy_workqueue(pagebuf_logio_workqueue);
-		return -ENOMEM;
-	}
-
-	rval = kernel_thread(pagebuf_daemon, NULL, CLONE_FS|CLONE_FILES);
-	if (rval < 0) {
-		destroy_workqueue(pagebuf_logio_workqueue);
-		destroy_workqueue(pagebuf_dataio_workqueue);
-	}
-
-	return rval;
-}
-
-/*
- * pagebuf_daemon_stop
- *
- * Note: do not mark as __exit, it is called from pagebuf_terminate.
- */
-STATIC void
-pagebuf_daemon_stop(void)
-{
-	pbd_active = 0;
-	wake_up_interruptible(&pbd_waitq);
-	wait_event_interruptible(pbd_waitq, pbd_active);
-	destroy_workqueue(pagebuf_logio_workqueue);
-	destroy_workqueue(pagebuf_dataio_workqueue);
-}
-
-
-/*
- * Pagebuf sysctl interface
- */
-
-STATIC int
-pb_stats_clear_handler(
-	ctl_table		*ctl,
-	int			write,
-	struct file		*filp,
-	void			*buffer,
-	size_t			*lenp)
-{
-	int			c, ret;
-	int			*valp = ctl->data;
-
-	ret = proc_doulongvec_minmax(ctl, write, filp, buffer, lenp);
-
-	if (!ret && write && *valp) {
-		printk("XFS Clearing pbstats\n");
-		for (c = 0; c < NR_CPUS; c++) {
-			if (!cpu_possible(c)) continue;
-				memset(&per_cpu(pbstats, c), 0,
-				       sizeof(struct pbstats));
-		}
-		pb_params.stats_clear.val = 0;
-	}
-
-	return ret;
-}
-
-STATIC struct ctl_table_header *pagebuf_table_header;
-
-STATIC ctl_table pagebuf_table[] = {
-	{PB_FLUSH_INT, "flush_int", &pb_params.flush_interval.val,
-	sizeof(int), 0644, NULL, &proc_dointvec_minmax,
-	&sysctl_intvec, NULL,
-	&pb_params.flush_interval.min, &pb_params.flush_interval.max},
-
-	{PB_FLUSH_AGE, "flush_age", &pb_params.age_buffer.val,
-	sizeof(int), 0644, NULL, &proc_dointvec_minmax,
-	&sysctl_intvec, NULL, 
-	&pb_params.age_buffer.min, &pb_params.age_buffer.max},
-
-	{PB_STATS_CLEAR, "stats_clear", &pb_params.stats_clear.val,
-	sizeof(int), 0644, NULL, &pb_stats_clear_handler,
-	&sysctl_intvec, NULL, 
-	&pb_params.stats_clear.min, &pb_params.stats_clear.max},
-
-#ifdef PAGEBUF_TRACE
-	{PB_DEBUG, "debug", &pb_params.debug.val,
-	sizeof(int), 0644, NULL, &proc_dointvec_minmax,
-	&sysctl_intvec, NULL, 
-	&pb_params.debug.min, &pb_params.debug.max},
-#endif
-	{0}
-};
-
-STATIC ctl_table pagebuf_dir_table[] = {
-	{VM_PAGEBUF, "pagebuf", NULL, 0, 0555, pagebuf_table},
-	{0}
-};
-
-STATIC ctl_table pagebuf_root_table[] = {
-	{CTL_VM, "vm",  NULL, 0, 0555, pagebuf_dir_table},
-	{0}
-};
-
-#ifdef CONFIG_PROC_FS
-STATIC int
-pagebuf_readstats(
-	char			*buffer,
-	char			**start,
-	off_t			offset,
-	int			count,
-	int			*eof,
-	void			*data)
-{
-	int			c, i, len, val;
-
-	len = 0;
-	len += sprintf(buffer + len, "pagebuf");
-	for (i = 0; i < sizeof(struct pbstats) / sizeof(u_int32_t); i++) {
-		val = 0;
-		for (c = 0 ; c < NR_CPUS; c++) {
-			if (!cpu_possible(c)) continue;
-			val += *(((u_int32_t*)&per_cpu(pbstats, c) + i));
-		}
-		len += sprintf(buffer + len, " %u", val);
-	}
-	buffer[len++] = '\n';
-
-	if (offset >= len) {
-		*start = buffer;
-		*eof = 1;
-		return 0;
-	}
-	*start = buffer + offset;
-	if ((len -= offset) > count)
-		return count;
-	*eof = 1;
-
-	return len;
-}
-#endif  /* CONFIG_PROC_FS */
-
-/*
- *	Initialization and Termination
- */
-
-int __init
-pagebuf_init(void)
-{
-	int			i;
-
-	pagebuf_table_header = register_sysctl_table(pagebuf_root_table, 1);
-
-#ifdef CONFIG_PROC_FS
-	if (proc_mkdir("fs/pagebuf", 0))
-		create_proc_read_entry(
-			"fs/pagebuf/stat", 0, 0, pagebuf_readstats, NULL);
-#endif
-
-	pagebuf_cache = kmem_cache_create("page_buf_t", sizeof(page_buf_t), 0,
-			SLAB_HWCACHE_ALIGN, NULL, NULL);
-	if (pagebuf_cache == NULL) {
-		printk("pagebuf: couldn't init pagebuf cache\n");
-		pagebuf_terminate();
-		return -ENOMEM;
-	}
-
-	for (i = 0; i < NHASH; i++) {
-		spin_lock_init(&pbhash[i].pb_hash_lock);
-		INIT_LIST_HEAD(&pbhash[i].pb_hash);
-	}
-
-#ifdef PAGEBUF_TRACE
-	pb_trace.buf = (pagebuf_trace_t *)kmalloc(
-			PB_TRACE_BUFSIZE * sizeof(pagebuf_trace_t), GFP_KERNEL);
-	memset(pb_trace.buf, 0, PB_TRACE_BUFSIZE * sizeof(pagebuf_trace_t));
-	pb_trace.start = 0;
-	pb_trace.end = PB_TRACE_BUFSIZE - 1;
-#endif
-
-	pagebuf_daemon_start();
-	return 0;
-}
-
-
-/*
- *	pagebuf_terminate.
- *
- *	Note: do not mark as __exit, this is also called from the __init code.
- */
-void
-pagebuf_terminate(void)
-{
-	pagebuf_daemon_stop();
-
-	kmem_cache_destroy(pagebuf_cache);
-
-	unregister_sysctl_table(pagebuf_table_header);
-#ifdef  CONFIG_PROC_FS
-	remove_proc_entry("fs/pagebuf/stat", NULL);
-	remove_proc_entry("fs/pagebuf", NULL);
-#endif
-}
-
-
-/*
- *	Module management (for kernel debugger module)
- */
-EXPORT_SYMBOL(pagebuf_offset);
diff -Nru a/fs/xfs/pagebuf/page_buf.h b/fs/xfs/pagebuf/page_buf.h
--- a/fs/xfs/pagebuf/page_buf.h	Tue Feb  3 19:45:29 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,384 +0,0 @@
-/*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
- */
-
-/*
- * Written by Steve Lord, Jim Mostek, Russell Cattelan at SGI
- */
-
-#ifndef __PAGE_BUF_H__
-#define __PAGE_BUF_H__
-
-#include <linux/config.h>
-#include <linux/list.h>
-#include <linux/types.h>
-#include <linux/spinlock.h>
-#include <asm/system.h>
-#include <linux/mm.h>
-#include <linux/fs.h>
-#include <linux/buffer_head.h>
-#include <linux/uio.h>
-
-/*
- * Turn this on to get pagebuf lock ownership
-#define PAGEBUF_LOCK_TRACKING
-*/
-
-/*
- *	Base types
- */
-
-/* daddr must be signed since -1 is used for bmaps that are not yet allocated */
-typedef loff_t page_buf_daddr_t;
-
-#define PAGE_BUF_DADDR_NULL ((page_buf_daddr_t) (-1LL))
-
-typedef size_t page_buf_dsize_t;		/* size of buffer in blocks */
-
-#define page_buf_ctob(pp)	((pp) * PAGE_CACHE_SIZE)
-#define page_buf_btoc(dd)	(((dd) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT)
-#define page_buf_btoct(dd)	((dd) >> PAGE_CACHE_SHIFT)
-#define page_buf_poff(aa)	((aa) & ~PAGE_CACHE_MASK)
-
-typedef enum page_buf_rw_e {
-	PBRW_READ = 1,			/* transfer into target memory */
-	PBRW_WRITE = 2,			/* transfer from target memory */
-	PBRW_ZERO = 3			/* Zero target memory */
-} page_buf_rw_t;
-
-typedef enum {				/* pbm_flags values */
-	PBMF_EOF =		0x01,	/* mapping contains EOF		*/
-	PBMF_HOLE =		0x02,	/* mapping covers a hole	*/
-	PBMF_DELAY =		0x04,	/* mapping covers delalloc region  */
-	PBMF_UNWRITTEN =	0x20,	/* mapping covers allocated	*/
-					/* but uninitialized file data	*/
-	PBMF_NEW =		0x40	/* just allocated		*/
-} bmap_flags_t;
-
-typedef enum {
-	/* base extent manipulation calls */
-	BMAP_READ = (1 << 0),		/* read extents */
-	BMAP_WRITE = (1 << 1),		/* create extents */
-	BMAP_ALLOCATE = (1 << 2),	/* delayed allocate to real extents */
-	BMAP_UNWRITTEN  = (1 << 3),	/* unwritten extents to real extents */
-	/* modifiers */
-	BMAP_IGNSTATE = (1 << 4),	/* ignore unwritten state on read */
-	BMAP_DIRECT = (1 << 5),		/* direct instead of buffered write */
-	BMAP_MMAP = (1 << 6),		/* allocate for mmap write */
-	BMAP_SYNC = (1 << 7),		/* sync write */
-	BMAP_TRYLOCK = (1 << 8),	/* non-blocking request */
-	BMAP_DEVICE = (1 << 9),		/* we only want to know the device */
-} bmapi_flags_t;
-
-typedef enum page_buf_flags_e {		/* pb_flags values */
-	PBF_READ = (1 << 0),	/* buffer intended for reading from device */
-	PBF_WRITE = (1 << 1),	/* buffer intended for writing to device   */
-	PBF_MAPPED = (1 << 2),  /* buffer mapped (pb_addr valid)           */
-	PBF_PARTIAL = (1 << 3), /* buffer partially read                   */
-	PBF_ASYNC = (1 << 4),   /* initiator will not wait for completion  */
-	PBF_NONE = (1 << 5),    /* buffer not read at all                  */
-	PBF_DELWRI = (1 << 6),  /* buffer has dirty pages                  */
-	PBF_FREED = (1 << 7),   /* buffer has been freed and is invalid    */
-	PBF_SYNC = (1 << 8),    /* force updates to disk                   */
-	PBF_MAPPABLE = (1 << 9),/* use directly-addressable pages          */
-	PBF_STALE = (1 << 10),	/* buffer has been staled, do not find it  */
-	PBF_FS_MANAGED = (1 << 11), /* filesystem controls freeing memory  */
-	PBF_FS_DATAIOD = (1 << 12), /* schedule IO completion on fs datad  */
-
-	/* flags used only as arguments to access routines */
-	PBF_LOCK = (1 << 13),	/* lock requested			   */
-	PBF_TRYLOCK = (1 << 14), /* lock requested, but do not wait	   */
-	PBF_DONT_BLOCK = (1 << 15), /* do not block in current thread	   */
-
-	/* flags used only internally */
-	_PBF_LOCKABLE = (1 << 16), /* page_buf_t may be locked		   */
-	_PBF_PRIVATE_BH = (1 << 17), /* do not use public buffer heads	   */
-	_PBF_ALL_PAGES_MAPPED = (1 << 18), /* all pages in range mapped	   */
-	_PBF_ADDR_ALLOCATED = (1 << 19), /* pb_addr space was allocated	   */
-	_PBF_MEM_ALLOCATED = (1 << 20), /* pb_mem+underlying pages alloc'd */
-
-	PBF_FORCEIO = (1 << 21),
-	PBF_FLUSH = (1 << 22),	/* flush disk write cache		   */
-	PBF_READ_AHEAD = (1 << 23),
-	PBF_RUN_QUEUES = (1 << 24), /* run block device task queue	   */
-
-} page_buf_flags_t;
-
-#define PBF_UPDATE (PBF_READ | PBF_WRITE)
-#define PBF_NOT_DONE(pb) (((pb)->pb_flags & (PBF_PARTIAL|PBF_NONE)) != 0)
-#define PBF_DONE(pb) (((pb)->pb_flags & (PBF_PARTIAL|PBF_NONE)) == 0)
-
-typedef struct pb_target {
-	dev_t			pbr_dev;
-	struct block_device	*pbr_bdev;
-	struct address_space	*pbr_mapping;
-	unsigned int		pbr_bsize;
-	unsigned int		pbr_sshift;
-	size_t			pbr_smask;
-} pb_target_t;
-
-/*
- *	page_buf_bmap_t:  File system I/O map
- *
- * The pbm_bn, pbm_offset and pbm_length fields are expressed in disk blocks.
- * The pbm_length field specifies the size of the underlying backing store
- * for the particular mapping.
- *
- * The pbm_bsize, pbm_size and pbm_delta fields are in bytes and indicate
- * the size of the mapping, the number of bytes that are valid to access
- * (read or write), and the offset into the mapping, given the offset
- * supplied to the file I/O map routine.  pbm_delta is the offset of the
- * desired data from the beginning of the mapping.
- *
- * When a request is made to read beyond the logical end of the object,
- * pbm_size may be set to 0, but pbm_offset and pbm_length should be set to
- * the actual amount of underlying storage that has been allocated, if any.
- */
-
-typedef struct page_buf_bmap_s {
-	page_buf_daddr_t pbm_bn;	/* block number in file system	    */
-	pb_target_t	*pbm_target;	/* device to do I/O to		    */
-	loff_t		pbm_offset;	/* byte offset of mapping in file   */
-	size_t		pbm_delta;	/* offset of request into bmap	    */
-	size_t		pbm_bsize;	/* size of this mapping in bytes    */
-	bmap_flags_t	pbm_flags;	/* options flags for mapping	    */
-} page_buf_bmap_t;
-
-typedef page_buf_bmap_t pb_bmap_t;
-
-
-/*
- *	page_buf_t:  Buffer structure for page cache-based buffers
- *
- * This buffer structure is used by the page cache buffer management routines
- * to refer to an assembly of pages forming a logical buffer.  The actual
- * I/O is performed with buffer_head or bio structures, as required by drivers,
- * for drivers which do not understand this structure.  The buffer structure is
- * used on temporary basis only, and discarded when released.
- *
- * The real data storage is recorded in the page cache.  Metadata is
- * hashed to the inode for the block device on which the file system resides.
- * File data is hashed to the inode for the file.  Pages which are only
- * partially filled with data have bits set in their block_map entry
- * to indicate which disk blocks in the page are not valid.
- */
-
-struct page_buf_s;
-typedef void (*page_buf_iodone_t)(struct page_buf_s *);
-			/* call-back function on I/O completion */
-typedef void (*page_buf_relse_t)(struct page_buf_s *);
-			/* call-back function on I/O completion */
-typedef int (*page_buf_bdstrat_t)(struct page_buf_s *);
-
-#define PB_PAGES	4
-
-typedef struct page_buf_s {
-	struct semaphore	pb_sema;	/* semaphore for lockables  */
-	unsigned long		pb_flushtime;	/* time to flush pagebuf    */
-	atomic_t		pb_pin_count;	/* pin count		    */
-	wait_queue_head_t	pb_waiters;	/* unpin waiters	    */
-	struct list_head	pb_list;
-	page_buf_flags_t	pb_flags;	/* status flags */
-	struct list_head	pb_hash_list;
-	struct pb_target	*pb_target;	/* logical object */
-	atomic_t		pb_hold;	/* reference count */
-	page_buf_daddr_t	pb_bn;		/* block number for I/O */
-	loff_t			pb_file_offset;	/* offset in file */
-	size_t			pb_buffer_length; /* size of buffer in bytes */
-	size_t			pb_count_desired; /* desired transfer size */
-	void			*pb_addr;	/* virtual address of buffer */
-	struct work_struct	pb_iodone_work;
-	atomic_t		pb_io_remaining;/* #outstanding I/O requests */
-	page_buf_iodone_t	pb_iodone;	/* I/O completion function */
-	page_buf_relse_t	pb_relse;	/* releasing function */
-	page_buf_bdstrat_t	pb_strat;	/* pre-write function */
-	struct semaphore	pb_iodonesema;	/* Semaphore for I/O waiters */
-	void			*pb_fspriv;
-	void			*pb_fspriv2;
-	void			*pb_fspriv3;
-	unsigned short		pb_error;	/* error code on I/O */
-	unsigned short		pb_page_count;	/* size of page array */
-	unsigned short		pb_offset;	/* page offset in first page */
-	unsigned char		pb_locked;	/* page array is locked */
-	unsigned char		pb_hash_index;	/* hash table index	*/
-	struct page		**pb_pages;	/* array of page pointers */
-	struct page		*pb_page_array[PB_PAGES]; /* inline pages */
-#ifdef PAGEBUF_LOCK_TRACKING
-	int			pb_last_holder;
-#endif
-} page_buf_t;
-
-
-/* Finding and Reading Buffers */
-
-extern page_buf_t *pagebuf_find(	/* find buffer for block if	*/
-					/* the block is in memory	*/
-		struct pb_target *,	/* inode for block		*/
-		loff_t,			/* starting offset of range	*/
-		size_t,			/* length of range		*/
-		page_buf_flags_t);	/* PBF_LOCK			*/
-
-extern page_buf_t *pagebuf_get(		/* allocate a buffer		*/
-		struct pb_target *,	/* inode for buffer		*/
-		loff_t,			/* starting offset of range     */
-		size_t,			/* length of range              */
-		page_buf_flags_t);	/* PBF_LOCK, PBF_READ,		*/
-					/* PBF_ASYNC			*/
-
-extern page_buf_t *pagebuf_lookup(
-		struct pb_target *,
-		loff_t,			/* starting offset of range	*/
-		size_t,			/* length of range		*/
-		page_buf_flags_t);	/* PBF_READ, PBF_WRITE,		*/
-					/* PBF_FORCEIO, _PBF_LOCKABLE	*/
-
-extern page_buf_t *pagebuf_get_empty(	/* allocate pagebuf struct with	*/
-					/*  no memory or disk address	*/
-		size_t len,
-		struct pb_target *);	/* mount point "fake" inode	*/
-
-extern page_buf_t *pagebuf_get_no_daddr(/* allocate pagebuf struct	*/
-					/* without disk address		*/
-		size_t len,
-		struct pb_target *);	/* mount point "fake" inode	*/
-
-extern int pagebuf_associate_memory(
-		page_buf_t *,
-		void *,
-		size_t);
-
-extern void pagebuf_hold(		/* increment reference count	*/
-		page_buf_t *);		/* buffer to hold		*/
-
-extern void pagebuf_readahead(		/* read ahead into cache	*/
-		struct pb_target  *,	/* target for buffer (or NULL)	*/
-		loff_t,			/* starting offset of range     */
-		size_t,			/* length of range              */
-		page_buf_flags_t);	/* additional read flags	*/
-
-/* Releasing Buffers */
-
-extern void pagebuf_free(		/* deallocate a buffer		*/
-		page_buf_t *);		/* buffer to deallocate		*/
-
-extern void pagebuf_rele(		/* release hold on a buffer	*/
-		page_buf_t *);		/* buffer to release		*/
-
-/* Locking and Unlocking Buffers */
-
-extern int pagebuf_cond_lock(		/* lock buffer, if not locked	*/
-					/* (returns -EBUSY if locked)	*/
-		page_buf_t *);		/* buffer to lock		*/
-
-extern int pagebuf_lock_value(		/* return count on lock		*/
-		page_buf_t *);          /* buffer to check              */
-
-extern int pagebuf_lock(		/* lock buffer                  */
-		page_buf_t *);          /* buffer to lock               */
-
-extern void pagebuf_unlock(		/* unlock buffer		*/
-		page_buf_t *);		/* buffer to unlock		*/
-
-/* Buffer Read and Write Routines */
-
-extern void pagebuf_iodone(		/* mark buffer I/O complete	*/
-		page_buf_t *,		/* buffer to mark		*/
-		int,			/* use data/log helper thread.	*/
-		int);			/* run completion locally, or in
-					 * a helper thread.		*/
-
-extern void pagebuf_ioerror(		/* mark buffer in error	(or not) */
-		page_buf_t *,		/* buffer to mark		*/
-		unsigned int);		/* error to store (0 if none)	*/
-
-extern int pagebuf_iostart(		/* start I/O on a buffer	*/
-		page_buf_t *,		/* buffer to start		*/
-		page_buf_flags_t);	/* PBF_LOCK, PBF_ASYNC,		*/
-					/* PBF_READ, PBF_WRITE,		*/
-					/* PBF_DELWRI, PBF_SYNC		*/
-
-extern int pagebuf_iorequest(		/* start real I/O		*/
-		page_buf_t *);		/* buffer to convey to device	*/
-
-extern int pagebuf_iowait(		/* wait for buffer I/O done	*/
-		page_buf_t *);		/* buffer to wait on		*/
-
-extern void pagebuf_iomove(		/* move data in/out of pagebuf	*/
-		page_buf_t *,		/* buffer to manipulate		*/
-		size_t,			/* starting buffer offset	*/
-		size_t,			/* length in buffer		*/
-		caddr_t,		/* data pointer			*/
-		page_buf_rw_t);		/* direction			*/
-
-static inline int pagebuf_iostrategy(page_buf_t *pb)
-{
-	return pb->pb_strat ? pb->pb_strat(pb) : pagebuf_iorequest(pb);
-}
-
-static inline int pagebuf_geterror(page_buf_t *pb)
-{
-	return pb ? pb->pb_error : ENOMEM;
-}
-
-/* Buffer Utility Routines */
-
-extern caddr_t pagebuf_offset(		/* pointer at offset in buffer	*/
-		page_buf_t *,		/* buffer to offset into	*/
-		size_t);		/* offset			*/
-
-/* Pinning Buffer Storage in Memory */
-
-extern void pagebuf_pin(		/* pin buffer in memory		*/
-		page_buf_t *);		/* buffer to pin		*/
-
-extern void pagebuf_unpin(		/* unpin buffered data		*/
-		page_buf_t *);		/* buffer to unpin		*/
-
-extern int pagebuf_ispin(		/* check if buffer is pinned	*/
-		page_buf_t *);		/* buffer to check		*/
-
-/* Delayed Write Buffer Routines */
-
-#define PBDF_WAIT    0x01
-extern void pagebuf_delwri_flush(
-		pb_target_t *,
-		unsigned long,
-		int *);
-
-extern void pagebuf_delwri_dequeue(
-		page_buf_t *);
-
-/* Buffer Daemon Setup Routines */
-
-extern int pagebuf_init(void);
-extern void pagebuf_terminate(void);
-
-#endif /* __PAGE_BUF_H__ */
diff -Nru a/fs/xfs/pagebuf/page_buf_internal.h b/fs/xfs/pagebuf/page_buf_internal.h
--- a/fs/xfs/pagebuf/page_buf_internal.h	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2002 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
- */
-
-/*
- * Written by Steve Lord at SGI
- */
-
-#ifndef __PAGE_BUF_PRIVATE_H__
-#define __PAGE_BUF_PRIVATE_H__
-
-#include <linux/percpu.h>
-#include "page_buf.h"
-
-#define _PAGE_BUF_INTERNAL_
-#define PB_DEFINE_TRACES
-#include "page_buf_trace.h"
-
-#ifdef PAGEBUF_LOCK_TRACKING
-#define PB_SET_OWNER(pb)	(pb->pb_last_holder = current->pid)
-#define PB_CLEAR_OWNER(pb)	(pb->pb_last_holder = -1)
-#define PB_GET_OWNER(pb)	(pb->pb_last_holder)
-#else
-#define PB_SET_OWNER(pb)
-#define PB_CLEAR_OWNER(pb)
-#define PB_GET_OWNER(pb)
-#endif /* PAGEBUF_LOCK_TRACKING */
-
-/* Tracing utilities for pagebuf */
-typedef struct {
-	int			event;
-	unsigned long		pb;
-	page_buf_flags_t	flags;
-	unsigned short		hold;
-	unsigned short		lock_value;
-	void			*task;
-	void			*misc;
-	void			*ra;
-	loff_t			offset;
-	size_t			size;
-} pagebuf_trace_t;
-
-struct pagebuf_trace_buf {
-	pagebuf_trace_t		*buf;
-	volatile int		start;
-	volatile int		end;
-};
-
-#define PB_TRACE_BUFSIZE	1024
-#define CIRC_INC(i)     (((i) + 1) & (PB_TRACE_BUFSIZE - 1))
-
-/*
- * Tunable pagebuf parameters
- */
-
-typedef struct pb_sysctl_val {
-	int min;
-	int val;
-	int max;
-} pb_sysctl_val_t;
-
-typedef struct pagebuf_param {
-	pb_sysctl_val_t	flush_interval;	/* interval between runs of the
-					 * delwri flush daemon.  */
-	pb_sysctl_val_t	age_buffer;	/* time for buffer to age before
-					 * we flush it.  */
-	pb_sysctl_val_t	stats_clear;	/* clear the pagebuf stats */
-	pb_sysctl_val_t	debug;		/* debug tracing on or off */
-} pagebuf_param_t;
-
-enum {
-	PB_FLUSH_INT = 1,
-	PB_FLUSH_AGE = 2,
-	PB_STATS_CLEAR = 3,
-	PB_DEBUG = 4
-};
-
-extern pagebuf_param_t	pb_params;
-
-/*
- * Pagebuf statistics
- */
-
-struct pbstats {
-	u_int32_t	pb_get;
-	u_int32_t	pb_create;
-	u_int32_t	pb_get_locked;
-	u_int32_t	pb_get_locked_waited;
-	u_int32_t	pb_busy_locked;
-	u_int32_t	pb_miss_locked;
-	u_int32_t	pb_page_retries;
-	u_int32_t	pb_page_found;
-	u_int32_t	pb_get_read;
-};
-
-DECLARE_PER_CPU(struct pbstats, pbstats);
-
-/* We don't disable preempt, not too worried about poking the
- * wrong cpu's stat for now */
-#define PB_STATS_INC(count)	(__get_cpu_var(pbstats).count++)
-
-#ifndef STATIC
-# define STATIC	static
-#endif
-
-#endif /* __PAGE_BUF_PRIVATE_H__ */
diff -Nru a/fs/xfs/pagebuf/page_buf_locking.c b/fs/xfs/pagebuf/page_buf_locking.c
--- a/fs/xfs/pagebuf/page_buf_locking.c	Tue Feb  3 19:45:28 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,139 +0,0 @@
-/*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
- */
-
-/*
- *	page_buf_locking.c
- *
- *	The page_buf module provides an abstract buffer cache model on top of
- *	the Linux page cache.  Cached metadata blocks for a file system are
- *	hashed to the inode for the block device.  The page_buf module
- *	assembles buffer (page_buf_t) objects on demand to aggregate such
- *	cached pages for I/O.  The page_buf_locking module adds support for
- *	locking such page buffers.
- *
- *      Written by Steve Lord at SGI
- *
- */
-
-#include <linux/stddef.h>
-#include <linux/errno.h>
-#include <linux/slab.h>
-#include <linux/bitops.h>
-#include <linux/string.h>
-#include <linux/pagemap.h>
-#include <linux/init.h>
-#include <linux/major.h>
-
-#include <support/debug.h>
-
-#include "page_buf_internal.h"
-
-/*
- *	pagebuf_cond_lock
- *
- *	pagebuf_cond_lock locks a buffer object, if it is not already locked.
- *	Note that this in no way
- *	locks the underlying pages, so it is only useful for synchronizing
- *	concurrent use of page buffer objects, not for synchronizing independent
- *	access to the underlying pages.
- */
-int
-pagebuf_cond_lock(			/* lock buffer, if not locked	*/
-					/* returns -EBUSY if locked)	*/
-	page_buf_t		*pb)
-{
-	int			locked;
-
-	ASSERT(pb->pb_flags & _PBF_LOCKABLE);
-
-	locked = down_trylock(&pb->pb_sema) == 0;
-	if (locked) {
-		PB_SET_OWNER(pb);
-	}
-
-	PB_TRACE(pb, PB_TRACE_REC(condlck), locked);
-
-	return(locked ? 0 : -EBUSY);
-}
-
-/*
- *	pagebuf_lock_value
- *
- *	Return lock value for a pagebuf
- */
-int
-pagebuf_lock_value(
-	page_buf_t		*pb)
-{
-	ASSERT(pb->pb_flags & _PBF_LOCKABLE);
-	return(atomic_read(&pb->pb_sema.count));
-}
-
-/*
- *	pagebuf_lock
- *
- *	pagebuf_lock locks a buffer object.  Note that this in no way
- *	locks the underlying pages, so it is only useful for synchronizing
- *	concurrent use of page buffer objects, not for synchronizing independent
- *	access to the underlying pages.
- */
-int
-pagebuf_lock(
-	page_buf_t		*pb)
-{
-	ASSERT(pb->pb_flags & _PBF_LOCKABLE);
-
-	PB_TRACE(pb, PB_TRACE_REC(lock), 0);
-	if (atomic_read(&pb->pb_io_remaining))
-		blk_run_queues();
-	down(&pb->pb_sema);
-	PB_SET_OWNER(pb);
-	PB_TRACE(pb, PB_TRACE_REC(locked), 0);
-	return 0;
-}
-
-/*
- *	pagebuf_unlock
- *
- *	pagebuf_unlock releases the lock on the buffer object created by
- *	pagebuf_lock or pagebuf_cond_lock (not any
- *	pinning of underlying pages created by pagebuf_pin).
- */
-void
-pagebuf_unlock(				/* unlock buffer		*/
-	page_buf_t		*pb)	/* buffer to unlock		*/
-{
-	ASSERT(pb->pb_flags & _PBF_LOCKABLE);
-	PB_CLEAR_OWNER(pb);
-	up(&pb->pb_sema);
-	PB_TRACE(pb, PB_TRACE_REC(unlock), 0);
-}
diff -Nru a/fs/xfs/pagebuf/page_buf_trace.h b/fs/xfs/pagebuf/page_buf_trace.h
--- a/fs/xfs/pagebuf/page_buf_trace.h	Tue Feb  3 19:45:29 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
- */
-
-#ifndef __PAGEBUF_TRACE__
-#define __PAGEBUF_TRACE__
-
-#ifdef PB_DEFINE_TRACES
-#define PB_TRACE_START	typedef enum {
-#define PB_TRACE_REC(x)	pb_trace_point_##x
-#define PB_TRACE_END	} pb_trace_var_t;
-#else
-#define PB_TRACE_START	static char	*event_names[] = {
-#define PB_TRACE_REC(x)	#x
-#define PB_TRACE_END	};
-#endif
-
-PB_TRACE_START
-PB_TRACE_REC(get),
-PB_TRACE_REC(get_obj),
-PB_TRACE_REC(free_obj),
-PB_TRACE_REC(look_pg),
-PB_TRACE_REC(get_read),
-PB_TRACE_REC(no_daddr),
-PB_TRACE_REC(hold),
-PB_TRACE_REC(rele),
-PB_TRACE_REC(done),
-PB_TRACE_REC(ioerror),
-PB_TRACE_REC(iostart),
-PB_TRACE_REC(end_io),
-PB_TRACE_REC(do_io),
-PB_TRACE_REC(ioreq),
-PB_TRACE_REC(iowait),
-PB_TRACE_REC(iowaited),
-PB_TRACE_REC(free_lk),
-PB_TRACE_REC(freed_l),
-PB_TRACE_REC(cmp),
-PB_TRACE_REC(get_lk),
-PB_TRACE_REC(got_lk),
-PB_TRACE_REC(skip),
-PB_TRACE_REC(lock),
-PB_TRACE_REC(locked),
-PB_TRACE_REC(unlock),
-PB_TRACE_REC(avl_ret),
-PB_TRACE_REC(condlck),
-PB_TRACE_REC(avl_ins),
-PB_TRACE_REC(walkq1),
-PB_TRACE_REC(walkq2),
-PB_TRACE_REC(walkq3),
-PB_TRACE_REC(delwri_q),
-PB_TRACE_REC(delwri_uq),
-PB_TRACE_REC(pin),
-PB_TRACE_REC(unpin),
-PB_TRACE_REC(file_write),
-PB_TRACE_REC(external),
-PB_TRACE_END
-
-extern void pb_trace_func(page_buf_t *, int, void *, void *);
-#ifdef PAGEBUF_TRACE
-# define PB_TRACE(pb, event, misc)		\
-	pb_trace_func(pb, event, (void *) misc,	\
-			(void *)__builtin_return_address(0))
-#else
-# define PB_TRACE(pb, event, misc)	do { } while (0)
-#endif
-
-#endif	/* __PAGEBUF_TRACE__ */
diff -Nru a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c
--- a/fs/xfs/quota/xfs_dquot.c	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/quota/xfs_dquot.c	Tue Feb  3 19:45:17 2004
@@ -124,7 +124,7 @@
 		initnsema(&dqp->q_flock, 1, "fdq");
 		sv_init(&dqp->q_pinwait, SV_DEFAULT, "pdq");
 
-#ifdef DQUOT_TRACING
+#ifdef XFS_DQUOT_TRACE
 		dqp->q_trace = ktrace_alloc(DQUOT_TRACE_SIZE, KM_SLEEP);
 		xfs_dqtrace_entry(dqp, "DQINIT");
 #endif
@@ -148,7 +148,7 @@
 		 dqp->q_hash = 0;
 		 ASSERT(dqp->dq_flnext == dqp->dq_flprev);
 
-#ifdef DQUOT_TRACING
+#ifdef XFS_DQUOT_TRACE
 		 ASSERT(dqp->q_trace);
 		 xfs_dqtrace_entry(dqp, "DQRECLAIMED_INIT");
 #endif
@@ -173,7 +173,7 @@
 	freesema(&dqp->q_flock);
 	sv_destroy(&dqp->q_pinwait);
 
-#ifdef DQUOT_TRACING
+#ifdef XFS_DQUOT_TRACE
 	if (dqp->q_trace)
 	     ktrace_free(dqp->q_trace);
 	dqp->q_trace = NULL;
@@ -201,20 +201,20 @@
 }
 
 
-#ifdef DQUOT_TRACING
+#ifdef XFS_DQUOT_TRACE
 /*
  * Dquot tracing for debugging.
  */
 /* ARGSUSED */
 void
-xfs_dqtrace_entry__(
-	xfs_dquot_t *dqp,
-	char *func,
-	void *retaddr,
-	xfs_inode_t *ip)
+__xfs_dqtrace_entry(
+	xfs_dquot_t	*dqp,
+	char		*func,
+	void		*retaddr,
+	xfs_inode_t	*ip)
 {
-	xfs_dquot_t *udqp = NULL;
-	int ino;
+	xfs_dquot_t	*udqp = NULL;
+	xfs_ino_t	ino = 0;
 
 	ASSERT(dqp->q_trace);
 	if (ip) {
@@ -227,13 +227,19 @@
 		     (void *)(__psint_t)dqp->q_nrefs,
 		     (void *)(__psint_t)dqp->dq_flags,
 		     (void *)(__psint_t)dqp->q_res_bcount,
-		     (void *)(__psint_t)INT_GET(dqp->q_core.d_bcount, ARCH_CONVERT),
-		     (void *)(__psint_t)INT_GET(dqp->q_core.d_icount, ARCH_CONVERT),
-		     (void *)(__psint_t)INT_GET(dqp->q_core.d_blk_hardlimit, ARCH_CONVERT),
-		     (void *)(__psint_t)INT_GET(dqp->q_core.d_blk_softlimit, ARCH_CONVERT),
-		     (void *)(__psint_t)INT_GET(dqp->q_core.d_ino_hardlimit, ARCH_CONVERT),
-		     (void *)(__psint_t)INT_GET(dqp->q_core.d_ino_softlimit, ARCH_CONVERT),
-		     (void *)(__psint_t)INT_GET(dqp->q_core.d_id, ARCH_CONVERT), /* 11 */
+		     (void *)(__psint_t)INT_GET(dqp->q_core.d_bcount,
+						ARCH_CONVERT),
+		     (void *)(__psint_t)INT_GET(dqp->q_core.d_icount,
+						ARCH_CONVERT),
+		     (void *)(__psint_t)INT_GET(dqp->q_core.d_blk_hardlimit,
+						ARCH_CONVERT),
+		     (void *)(__psint_t)INT_GET(dqp->q_core.d_blk_softlimit,
+						ARCH_CONVERT),
+		     (void *)(__psint_t)INT_GET(dqp->q_core.d_ino_hardlimit,
+						ARCH_CONVERT),
+		     (void *)(__psint_t)INT_GET(dqp->q_core.d_ino_softlimit,
+						ARCH_CONVERT),
+		     (void *)(__psint_t)INT_GET(dqp->q_core.d_id, ARCH_CONVERT),
 		     (void *)(__psint_t)current_pid(),
 		     (void *)(__psint_t)ino,
 		     (void *)(__psint_t)retaddr,
@@ -751,7 +757,6 @@
 	}
 
 	*O_dqpp = dqp;
-	ASSERT(! XFS_DQ_IS_LOCKED(dqp));
 	return (0);
 
  error0:
@@ -1000,7 +1005,6 @@
 	/*
 	 * Dquot lock comes after hashlock in the lock ordering
 	 */
-	ASSERT(! XFS_DQ_IS_LOCKED(dqp));
 	if (ip) {
 		xfs_ilock(ip, XFS_ILOCK_EXCL);
 		if (! XFS_IS_DQTYPE_ON(mp, type)) {
@@ -1504,7 +1508,7 @@
 	 */
 	ASSERT(XFS_DQ_IS_ON_FREELIST(dqp));
 
-	dqp->q_mount = NULL;;
+	dqp->q_mount = NULL;
 	dqp->q_hash = NULL;
 	dqp->dq_flags = XFS_DQ_INACTIVE;
 	memset(&dqp->q_core, 0, sizeof(dqp->q_core));
diff -Nru a/fs/xfs/quota/xfs_dquot.h b/fs/xfs/quota/xfs_dquot.h
--- a/fs/xfs/quota/xfs_dquot.h	Tue Feb  3 19:45:43 2004
+++ b/fs/xfs/quota/xfs_dquot.h	Tue Feb  3 19:45:43 2004
@@ -99,7 +99,7 @@
 	sema_t		 q_flock;	/* flush lock */
 	uint		 q_pincount;	/* pin count for this dquot */
 	sv_t		 q_pinwait;	/* sync var for pinning */
-#ifdef DQUOT_TRACING
+#ifdef XFS_DQUOT_TRACE
 	struct ktrace	*q_trace;	/* trace header structure */
 #endif
 } xfs_dquot_t;
@@ -175,23 +175,25 @@
 #define XFS_IS_THIS_QUOTA_OFF(d) (! (XFS_QM_ISUDQ(d) ? \
 				     (XFS_IS_UQUOTA_ON((d)->q_mount)) : \
 				     (XFS_IS_GQUOTA_ON((d)->q_mount))))
-#ifdef DQUOT_TRACING
+
+#ifdef XFS_DQUOT_TRACE
 /*
  * Dquot Tracing stuff.
  */
 #define DQUOT_TRACE_SIZE	64
 #define DQUOT_KTRACE_ENTRY	1
 
+extern void		__xfs_dqtrace_entry(xfs_dquot_t *dqp, char *func,
+					    void *, xfs_inode_t *);
 #define xfs_dqtrace_entry_ino(a,b,ip) \
-xfs_dqtrace_entry__((a), (b), (void*)__return_address, (ip))
+		__xfs_dqtrace_entry((a), (b), (void*)__return_address, (ip))
 #define xfs_dqtrace_entry(a,b) \
-xfs_dqtrace_entry__((a), (b), (void*)__return_address, NULL)
-extern void		xfs_dqtrace_entry__(xfs_dquot_t *dqp, char *func,
-					    void *, xfs_inode_t *);
+		__xfs_dqtrace_entry((a), (b), (void*)__return_address, NULL)
 #else
 #define xfs_dqtrace_entry(a,b)
 #define xfs_dqtrace_entry_ino(a,b,ip)
 #endif
+
 #ifdef QUOTADEBUG
 extern void		xfs_qm_dqprint(xfs_dquot_t *);
 #else
diff -Nru a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c
--- a/fs/xfs/quota/xfs_qm.c	Tue Feb  3 19:45:16 2004
+++ b/fs/xfs/quota/xfs_qm.c	Tue Feb  3 19:45:16 2004
@@ -78,10 +78,10 @@
  */
 mutex_t xfs_Gqm_lock;
 struct xfs_qm	*xfs_Gqm;
-EXPORT_SYMBOL(xfs_Gqm);	/* used by xfsidbg */
 
 kmem_zone_t	*qm_dqzone;
 kmem_zone_t	*qm_dqtrxzone;
+kmem_shaker_t	xfs_qm_shaker;
 
 STATIC void	xfs_qm_list_init(xfs_dqlist_t *, char *, int);
 STATIC void	xfs_qm_list_destroy(xfs_dqlist_t *);
@@ -112,8 +112,6 @@
 #define XQM_LIST_PRINT(l, NXT, title) do { } while (0)
 #endif
 
-struct shrinker *xfs_qm_shrinker;
-
 /*
  * Initialize the XQM structure.
  * Note that there is not one quota manager per file system.
@@ -163,7 +161,7 @@
 	} else
 		xqm->qm_dqzone = qm_dqzone;
 
-	xfs_qm_shrinker = set_shrinker(DEFAULT_SEEKS, xfs_qm_shake);
+	xfs_qm_shaker = kmem_shake_register(xfs_qm_shake);
 
 	/*
 	 * The t_dqinfo portion of transactions.
@@ -195,8 +193,7 @@
 
 	ASSERT(xqm != NULL);
 	ASSERT(xqm->qm_nrefs == 0);
-
-	remove_shrinker(xfs_qm_shrinker);
+	kmem_shake_deregister(xfs_qm_shaker);
 	hsize = xqm->qm_dqhashmask + 1;
 	for (i = 0; i < hsize; i++) {
 		xfs_qm_list_destroy(&(xqm->qm_usr_dqhtable[i]));
@@ -806,7 +803,6 @@
 	ASSERT(XFS_DQ_IS_LOCKED(dqp));
 	if (! dolock) {
 		xfs_dqunlock(dqp);
-		ASSERT(!udqhint || !XFS_DQ_IS_LOCKED(udqhint));
 		goto done;
 	}
 	if (! udqhint)
@@ -814,7 +810,6 @@
 
 	ASSERT(udqhint);
 	ASSERT(dolock);
-	ASSERT(! XFS_DQ_IS_LOCKED(udqhint));
 	ASSERT(XFS_DQ_IS_LOCKED(dqp));
 	if (! xfs_qm_dqlock_nowait(udqhint)) {
 		xfs_dqunlock(dqp);
@@ -826,14 +821,10 @@
 	if (udqhint) {
 		if (dolock)
 			ASSERT(XFS_DQ_IS_LOCKED(udqhint));
-		else
-			ASSERT(! XFS_DQ_IS_LOCKED(udqhint));
 	}
 	if (! error) {
 		if (dolock)
 			ASSERT(XFS_DQ_IS_LOCKED(dqp));
-		else
-			ASSERT(! XFS_DQ_IS_LOCKED(dqp));
 	}
 #endif
 	return (error);
@@ -860,9 +851,6 @@
 	if (locked) {
 		ASSERT(XFS_DQ_IS_LOCKED(udq));
 		ASSERT(XFS_DQ_IS_LOCKED(gdq));
-	} else {
-		ASSERT(! XFS_DQ_IS_LOCKED(udq));
-		ASSERT(! XFS_DQ_IS_LOCKED(gdq));
 	}
 #endif
 	if (! locked)
@@ -890,15 +878,12 @@
 		 */
 		xfs_qm_dqrele(tmp);
 
-		ASSERT(! XFS_DQ_IS_LOCKED(udq));
-		ASSERT(! XFS_DQ_IS_LOCKED(gdq));
 		xfs_dqlock(udq);
 		xfs_dqlock(gdq);
 
 	} else {
 		ASSERT(XFS_DQ_IS_LOCKED(udq));
 		if (! locked) {
-			ASSERT(! XFS_DQ_IS_LOCKED(gdq));
 			xfs_dqlock(gdq);
 		}
 	}
@@ -1006,14 +991,10 @@
 		if (ip->i_udquot) {
 			if (flags & XFS_QMOPT_DQLOCK)
 				ASSERT(XFS_DQ_IS_LOCKED(ip->i_udquot));
-			else
-				ASSERT(! XFS_DQ_IS_LOCKED(ip->i_udquot));
 		}
 		if (ip->i_gdquot) {
 			if (flags & XFS_QMOPT_DQLOCK)
 				ASSERT(XFS_DQ_IS_LOCKED(ip->i_gdquot));
-			else
-				ASSERT(! XFS_DQ_IS_LOCKED(ip->i_gdquot));
 		}
 		if (XFS_IS_UQUOTA_ON(mp))
 			ASSERT(ip->i_udquot);
@@ -1756,7 +1737,10 @@
 	xfs_trans_t	*tp,		/* transaction pointer - NULL */
 	xfs_ino_t	ino,		/* inode number to get data for */
 	void		*buffer,	/* not used */
+	int		ubsize,		/* not used */
+	void		*private_data,	/* not used */
 	xfs_daddr_t	bno,		/* starting block of inode cluster */
+	int		*ubused,	/* not used */
 	void		*dip,		/* on-disk inode pointer (not used) */
 	int		*res)		/* result code value */
 {
@@ -1920,7 +1904,7 @@
 		 * adjusting the corresponding dquot counters in core.
 		 */
 		if ((error = xfs_bulkstat(mp, NULL, &lastino, &count,
-				     xfs_qm_dqusage_adjust,
+				     xfs_qm_dqusage_adjust, NULL,
 				     structsz, NULL,
 				     BULKSTAT_FG_IGET|BULKSTAT_FG_VFSLOCKED,
 				     &done)))
@@ -2091,7 +2075,7 @@
 			xfs_dqunlock(dqp);
 			xfs_qm_freelist_unlock(xfs_Gqm);
 			if (++restarts >= XFS_QM_RECLAIM_MAX_RESTARTS)
-				goto out;
+				return (nreclaimed);
 			XQM_STATS_INC(xqmstats.xs_qm_dqwants);
 			goto tryagain;
 		}
@@ -2166,7 +2150,7 @@
 			XFS_DQ_HASH_UNLOCK(hash);
 			xfs_qm_freelist_unlock(xfs_Gqm);
 			if (++restarts >= XFS_QM_RECLAIM_MAX_RESTARTS)
-				goto out;
+				return (nreclaimed);
 			goto tryagain;
 		}
 		xfs_dqtrace_entry(dqp, "DQSHAKE: UNLINKING");
@@ -2191,14 +2175,12 @@
 		dqp = nextdqp;
 	}
 	xfs_qm_freelist_unlock(xfs_Gqm);
- out:
-	return nreclaimed;
+	return (nreclaimed);
 }
 
 
 /*
- * The shake manager routine called by shaked() when memory is
- * running low.
+ * The kmem_shake interface is invoked when memory is running low.
  */
 /* ARGSUSED */
 STATIC int
@@ -2206,10 +2188,10 @@
 {
 	int	ndqused, nfree, n;
 
-	if (!(gfp_mask & __GFP_WAIT))
-		return 0;
+	if (!kmem_shake_allow(gfp_mask))
+		return (0);
 	if (!xfs_Gqm)
-		return 0;
+		return (0);
 
 	nfree = xfs_Gqm->qm_dqfreelist.qh_nelems; /* free dquots */
 	/* incore dquots in all f/s's */
@@ -2218,7 +2200,7 @@
 	ASSERT(ndqused >= 0);
 
 	if (nfree <= ndqused && nfree < ndquot)
-		return 0;
+		return (0);
 
 	ndqused *= xfs_Gqm->qm_dqfree_ratio;	/* target # of free dquots */
 	n = nfree - ndqused - ndquot;		/* # over target */
diff -Nru a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c
--- a/fs/xfs/quota/xfs_qm_syscalls.c	Tue Feb  3 19:45:33 2004
+++ b/fs/xfs/quota/xfs_qm_syscalls.c	Tue Feb  3 19:45:33 2004
@@ -1301,7 +1301,10 @@
 	xfs_trans_t	*tp,		/* transaction pointer */
 	xfs_ino_t	ino,		/* inode number to get data for */
 	void		*buffer,	/* not used */
+	int		ubsize,		/* not used */
+	void		*private_data,	/* not used */
 	xfs_daddr_t	bno,		/* starting block of inode cluster */
+	int		*ubused,	/* not used */
 	void		*dip,		/* not used */
 	int		*res)		/* bulkstat result code */
 {
@@ -1403,7 +1406,7 @@
 		 * adjusting the corresponding dquot counters
 		 */
 		if ((error = xfs_bulkstat(mp, NULL, &lastino, &count,
-				 xfs_qm_internalqcheck_adjust,
+				 xfs_qm_internalqcheck_adjust, NULL,
 				 0, NULL, BULKSTAT_FG_IGET, &done))) {
 			break;
 		}
diff -Nru a/fs/xfs/quota/xfs_trans_dquot.c b/fs/xfs/quota/xfs_trans_dquot.c
--- a/fs/xfs/quota/xfs_trans_dquot.c	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/quota/xfs_trans_dquot.c	Tue Feb  3 19:45:17 2004
@@ -835,13 +835,6 @@
 	ASSERT(ip->i_ino != mp->m_sb.sb_uquotino);
 	ASSERT(ip->i_ino != mp->m_sb.sb_gquotino);
 
-#ifdef QUOTADEBUG
-	if (ip->i_udquot)
-		ASSERT(! XFS_DQ_IS_LOCKED(ip->i_udquot));
-	if (ip->i_gdquot)
-		ASSERT(! XFS_DQ_IS_LOCKED(ip->i_gdquot));
-#endif
-
 	ASSERT(XFS_ISLOCKED_INODE_EXCL(ip));
 	ASSERT(XFS_IS_QUOTA_RUNNING(ip->i_mount));
 	ASSERT((type & ~XFS_QMOPT_FORCE_RES) == XFS_TRANS_DQ_RES_RTBLKS ||
diff -Nru a/fs/xfs/support/debug.h b/fs/xfs/support/debug.h
--- a/fs/xfs/support/debug.h	Tue Feb  3 19:45:43 2004
+++ b/fs/xfs/support/debug.h	Tue Feb  3 19:45:43 2004
@@ -44,6 +44,10 @@
 extern void icmn_err(int, char *, va_list);
 extern void cmn_err(int, char *, ...);
 
+#ifndef STATIC
+# define STATIC static
+#endif
+
 #ifdef DEBUG
 # ifdef lint
 #  define ASSERT(EX)	((void)0) /* avoid "constant in conditional" babble */
diff -Nru a/fs/xfs/support/kmem.h b/fs/xfs/support/kmem.h
--- a/fs/xfs/support/kmem.h	Tue Feb  3 19:45:43 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,168 +0,0 @@
-/*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
- */
-#ifndef __XFS_SUPPORT_KMEM_H__
-#define __XFS_SUPPORT_KMEM_H__
-
-#include <linux/mm.h>
-#include <linux/highmem.h>
-#include <linux/slab.h>
-#include <linux/vmalloc.h>
-
-/*
- * Cutoff point to use vmalloc instead of kmalloc.
- */
-#define MAX_SLAB_SIZE	0x10000
-
-/*
- * XFS uses slightly different names for these due to the
- * IRIX heritage.
- */
-#define	kmem_zone	kmem_cache_s
-#define kmem_zone_t	kmem_cache_t
-
-#define KM_SLEEP	0x0001
-#define KM_NOSLEEP	0x0002
-#define KM_NOFS		0x0004
-
-typedef unsigned long xfs_pflags_t;
-
-#define PFLAGS_TEST_FSTRANS()		(current->flags & PF_FSTRANS)
-
-#define PFLAGS_SET_FSTRANS(STATEP) do {	\
-	*(STATEP) = current->flags;	\
-	current->flags |= PF_FSTRANS;	\
-} while (0)
-
-#define PFLAGS_RESTORE(STATEP) do {	\
-	current->flags = *(STATEP);	\
-} while (0)
-
-#define PFLAGS_DUP(OSTATEP, NSTATEP) do { \
-	*(NSTATEP) = *(OSTATEP);	\
-} while (0)
-
-/*
- * XXX get rid of the unconditional  __GFP_NOFAIL by adding
- * a KM_FAIL flag and using it where we're allowed to fail.
- */
-static __inline unsigned int
-kmem_flags_convert(int flags)
-{
-	int lflags;
-
-#if DEBUG
-	if (unlikely(flags & ~(KM_SLEEP|KM_NOSLEEP|KM_NOFS))) {
-		printk(KERN_WARNING
-		    "XFS: memory allocation with wrong flags (%x)\n", flags);
-		BUG();
-	}
-#endif
-
-	lflags = (flags & KM_NOSLEEP) ? GFP_ATOMIC : (GFP_KERNEL|__GFP_NOFAIL);
-
-	/* avoid recusive callbacks to filesystem during transactions */
-	if (PFLAGS_TEST_FSTRANS())
-		lflags &= ~__GFP_FS;
-
-	return lflags;
-}
-
-static __inline void *
-kmem_alloc(size_t size, int flags)
-{
-	if (unlikely(MAX_SLAB_SIZE < size))
-		/* Avoid doing filesystem sensitive stuff to get this */
-		return __vmalloc(size, kmem_flags_convert(flags), PAGE_KERNEL);
-	return kmalloc(size, kmem_flags_convert(flags));
-}
-
-static __inline void *
-kmem_zalloc(size_t size, int flags)
-{
-	void *ptr = kmem_alloc(size, flags);
-	if (likely(ptr != NULL))
-		memset(ptr, 0, size);
-	return ptr;
-}
-
-static __inline void
-kmem_free(void *ptr, size_t size)
-{
-	if (unlikely((unsigned long)ptr < VMALLOC_START ||
-		     (unsigned long)ptr >= VMALLOC_END))
-		kfree(ptr);
-	else
-		vfree(ptr);
-}
-
-static __inline void *
-kmem_realloc(void *ptr, size_t newsize, size_t oldsize, int flags)
-{
-	void *new = kmem_alloc(newsize, flags);
-
-	if (likely(ptr != NULL)) {
-		if (likely(new != NULL))
-			memcpy(new, ptr, min(oldsize, newsize));
-		kmem_free(ptr, oldsize);
-	}
-
-	return new;
-}
-
-static __inline kmem_zone_t *
-kmem_zone_init(int size, char *zone_name)
-{
-	return kmem_cache_create(zone_name, size, 0, 0, NULL, NULL);
-}
-
-static __inline void *
-kmem_zone_alloc(kmem_zone_t *zone, int flags)
-{
-	return kmem_cache_alloc(zone, kmem_flags_convert(flags));
-}
-
-static __inline void *
-kmem_zone_zalloc(kmem_zone_t *zone, int flags)
-{
-	void *ptr = kmem_zone_alloc(zone, flags);
-	if (likely(ptr != NULL))
-		memset(ptr, 0, kmem_cache_size(zone));
-	return ptr;
-}
-
-static __inline void
-kmem_zone_free(kmem_zone_t *zone, void *ptr)
-{
-	kmem_cache_free(zone, ptr);
-}
-
-#endif /* __XFS_SUPPORT_KMEM_H__ */
diff -Nru a/fs/xfs/support/ktrace.c b/fs/xfs/support/ktrace.c
--- a/fs/xfs/support/ktrace.c	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/support/ktrace.c	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -30,18 +30,15 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <linux/module.h>
 #include <linux/types.h>
 #include <linux/slab.h>
 
 #include <xfs_types.h>
-#include "kmem.h"
-#include "spin.h"
+#include <kmem.h>
+#include <spin.h>
 #include "debug.h"
 #include "ktrace.h"
 
-#if	(defined(DEBUG) || defined(CONFIG_XFS_VNODE_TRACING))
-
 static kmem_zone_t *ktrace_hdr_zone;
 static kmem_zone_t *ktrace_ent_zone;
 static int          ktrace_zentries;
@@ -121,7 +118,6 @@
 	ktp->kt_nentries = nentries;
 	ktp->kt_index    = 0;
 	ktp->kt_rollover = 0;
-
 	return ktp;
 }
 
@@ -182,6 +178,7 @@
 	void            *val15)
 {
 	static lock_t   wrap_lock = SPIN_LOCK_UNLOCKED;
+	unsigned long	flags;
 	int             index;
 	ktrace_entry_t  *ktep;
 
@@ -190,11 +187,11 @@
 	/*
 	 * Grab an entry by pushing the index up to the next one.
 	 */
-	spin_lock(&wrap_lock);
+	spin_lock_irqsave(&wrap_lock, flags);
 	index = ktp->kt_index;
 	if (++ktp->kt_index == ktp->kt_nentries)
 		ktp->kt_index = 0;
-	spin_unlock(&wrap_lock);
+	spin_unlock_irqrestore(&wrap_lock, flags);
 
 	if (!ktp->kt_rollover && index == ktp->kt_nentries - 1)
 		ktp->kt_rollover = 1;
@@ -235,7 +232,6 @@
 	return (ktp->kt_rollover ? ktp->kt_nentries : ktp->kt_index);
 }
 
-
 /*
  * ktrace_first()
  *
@@ -277,7 +273,6 @@
 	return ktep;
 }
 
-
 /*
  * ktrace_next()
  *
@@ -312,18 +307,12 @@
 	return ktep;
 }
 
-#if	(defined(DEBUG) || defined(CONFIG_XFS_VNODE_TRACING))
-EXPORT_SYMBOL(ktrace_first);
-EXPORT_SYMBOL(ktrace_next);
-#endif
-
 /*
  * ktrace_skip()
  *
  * Skip the next "count" entries and return the entry after that.
  * Return NULL if this causes us to iterate past the beginning again.
  */
-
 ktrace_entry_t *
 ktrace_skip(
 	ktrace_t        *ktp,
@@ -362,18 +351,3 @@
 	}
 	return ktep;
 }
-
-#else
-
-ktrace_t *
-ktrace_alloc(int nentries, int sleep)
-{
-	/*
-	 * KM_SLEEP callers don't expect failure.
-	 */
-	if (sleep & KM_SLEEP)
-		panic("ktrace_alloc: NULL memory on KM_SLEEP request!");
-
-	return NULL;
-}
-#endif
diff -Nru a/fs/xfs/support/ktrace.h b/fs/xfs/support/ktrace.h
--- a/fs/xfs/support/ktrace.h	Tue Feb  3 19:45:28 2004
+++ b/fs/xfs/support/ktrace.h	Tue Feb  3 19:45:28 2004
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -32,6 +32,7 @@
 #ifndef __XFS_SUPPORT_KTRACE_H__
 #define __XFS_SUPPORT_KTRACE_H__
 
+#include <spin.h>
 
 /*
  * Trace buffer entry structure.
@@ -59,16 +60,13 @@
 	int		ks_index;	/* current index */
 } ktrace_snap_t;
 
-/*
- * Exported interfaces.
- */
-extern ktrace_t *ktrace_alloc(int, int);
 
-#if	(defined(DEBUG) || defined(CONFIG_XFS_VNODE_TRACING))
+#ifdef CONFIG_XFS_TRACE
 
 extern void ktrace_init(int zentries);
 extern void ktrace_uninit(void);
 
+extern ktrace_t *ktrace_alloc(int, int);
 extern void ktrace_free(ktrace_t *);
 
 extern void ktrace_enter(
@@ -96,10 +94,8 @@
 extern ktrace_entry_t   *ktrace_skip(ktrace_t *, int, ktrace_snap_t *);
 
 #else
+#define ktrace_init(x)	do { } while (0)
+#define ktrace_uninit()	do { } while (0)
+#endif	/* CONFIG_XFS_TRACE */
 
-#define	ktrace_free(ktp)
-#define	ktrace_enter(ktp,v0,v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15)
-
-#endif
-
-#endif /* __XFS_SUPPORT_KTRACE_H__ */
+#endif	/* __XFS_SUPPORT_KTRACE_H__ */
diff -Nru a/fs/xfs/support/mrlock.c b/fs/xfs/support/mrlock.c
--- a/fs/xfs/support/mrlock.c	Tue Feb  3 19:45:16 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,274 +0,0 @@
-/*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
- */
-
-#include <linux/time.h>
-#include <linux/sched.h>
-#include <asm/system.h>
-#include <linux/interrupt.h>
-#include <asm/current.h>
-
-#include "mrlock.h"
-
-
-#if USE_RW_WAIT_QUEUE_SPINLOCK
-# define wq_write_lock	write_lock
-#else
-# define wq_write_lock	spin_lock
-#endif
-
-/*
- * We don't seem to need lock_type (only one supported), name, or
- * sequence. But, XFS will pass it so let's leave them here for now.
- */
-/* ARGSUSED */
-void
-mrlock_init(mrlock_t *mrp, int lock_type, char *name, long sequence)
-{
-	mrp->mr_count = 0;
-	mrp->mr_reads_waiting = 0;
-	mrp->mr_writes_waiting = 0;
-	init_waitqueue_head(&mrp->mr_readerq);
-	init_waitqueue_head(&mrp->mr_writerq);
-	mrp->mr_lock = SPIN_LOCK_UNLOCKED;
-}
-
-/*
- * Macros to lock/unlock the mrlock_t.
- */
-
-#define MRLOCK(m)		spin_lock(&(m)->mr_lock);
-#define MRUNLOCK(m)		spin_unlock(&(m)->mr_lock);
-
-
-/*
- * lock_wait should never be called in an interrupt thread.
- *
- * mrlocks can sleep (i.e. call schedule) and so they can't ever
- * be called from an interrupt thread.
- *
- * threads that wake-up should also never be invoked from interrupt threads.
- *
- * But, waitqueue_lock is locked from interrupt threads - and we are
- * called with interrupts disabled, so it is all OK.
- */
-
-/* ARGSUSED */
-void
-lock_wait(wait_queue_head_t *q, spinlock_t *lock, int rw)
-{
-	DECLARE_WAITQUEUE( wait, current );
-
-	__set_current_state(TASK_UNINTERRUPTIBLE);
-
-	spin_lock(&q->lock);
-	if (rw) {
-		__add_wait_queue_tail(q, &wait);
-	} else {
-		__add_wait_queue(q, &wait);
-	}
-
-	spin_unlock(&q->lock);
-	spin_unlock(lock);
-
-	schedule();
-
-	spin_lock(&q->lock);
-	__remove_wait_queue(q, &wait);
-	spin_unlock(&q->lock);
-
-	spin_lock(lock);
-
-	/* return with lock held */
-}
-
-/* ARGSUSED */
-void
-mrfree(mrlock_t *mrp)
-{
-}
-
-/* ARGSUSED */
-void
-mrlock(mrlock_t *mrp, int type, int flags)
-{
-	if (type == MR_ACCESS)
-		mraccess(mrp);
-	else
-		mrupdate(mrp);
-}
-
-/* ARGSUSED */
-void
-mraccessf(mrlock_t *mrp, int flags)
-{
-	MRLOCK(mrp);
-	if(mrp->mr_writes_waiting > 0) {
-		mrp->mr_reads_waiting++;
-		lock_wait(&mrp->mr_readerq, &mrp->mr_lock, 0);
-		mrp->mr_reads_waiting--;
-	}
-	while (mrp->mr_count < 0) {
-		mrp->mr_reads_waiting++;
-		lock_wait(&mrp->mr_readerq, &mrp->mr_lock, 0);
-		mrp->mr_reads_waiting--;
-	}
-	mrp->mr_count++;
-	MRUNLOCK(mrp);
-}
-
-/* ARGSUSED */
-void
-mrupdatef(mrlock_t *mrp, int flags)
-{
-	MRLOCK(mrp);
-	while(mrp->mr_count) {
-		mrp->mr_writes_waiting++;
-		lock_wait(&mrp->mr_writerq, &mrp->mr_lock, 1);
-		mrp->mr_writes_waiting--;
-	}
-
-	mrp->mr_count = -1; /* writer on it */
-	MRUNLOCK(mrp);
-}
-
-int
-mrtryaccess(mrlock_t *mrp)
-{
-	MRLOCK(mrp);
-	/*
-	 * If anyone is waiting for update access or the lock is held for update
-	 * fail the request.
-	 */
-	if(mrp->mr_writes_waiting > 0 || mrp->mr_count < 0) {
-		MRUNLOCK(mrp);
-		return 0;
-	}
-	mrp->mr_count++;
-	MRUNLOCK(mrp);
-	return 1;
-}
-
-int
-mrtrypromote(mrlock_t *mrp)
-{
-	MRLOCK(mrp);
-
-	if(mrp->mr_count == 1) { /* We are the only thread with the lock */
-		mrp->mr_count = -1; /* writer on it */
-		MRUNLOCK(mrp);
-		return 1;
-	}
-
-	MRUNLOCK(mrp);
-	return 0;
-}
-
-int
-mrtryupdate(mrlock_t *mrp)
-{
-	MRLOCK(mrp);
-
-	if(mrp->mr_count) {
-		MRUNLOCK(mrp);
-		return 0;
-	}
-
-	mrp->mr_count = -1; /* writer on it */
-	MRUNLOCK(mrp);
-	return 1;
-}
-
-static __inline__ void mrwake(mrlock_t *mrp)
-{
-	/*
-	 * First, if the count is now 0, we need to wake-up anyone waiting.
-	 */
-	if (!mrp->mr_count) {
-		if (mrp->mr_writes_waiting) {	/* Wake-up first writer waiting */
-			wake_up(&mrp->mr_writerq);
-		} else if (mrp->mr_reads_waiting) {	/* Wakeup any readers waiting */
-			wake_up(&mrp->mr_readerq);
-		}
-	}
-}
-
-void
-mraccunlock(mrlock_t *mrp)
-{
-	MRLOCK(mrp);
-	mrp->mr_count--;
-	mrwake(mrp);
-	MRUNLOCK(mrp);
-}
-
-void
-mrunlock(mrlock_t *mrp)
-{
-	MRLOCK(mrp);
-	if (mrp->mr_count < 0) {
-		mrp->mr_count = 0;
-	} else {
-		mrp->mr_count--;
-	}
-	mrwake(mrp);
-	MRUNLOCK(mrp);
-}
-
-int
-ismrlocked(mrlock_t *mrp, int type)	/* No need to lock since info can change */
-{
-	if (type == MR_ACCESS)
-		return (mrp->mr_count > 0); /* Read lock */
-	else if (type == MR_UPDATE)
-		return (mrp->mr_count < 0); /* Write lock */
-	else if (type == (MR_UPDATE | MR_ACCESS))
-		return (mrp->mr_count);	/* Any type of lock held */
-	else /* Any waiters */
-		return (mrp->mr_reads_waiting | mrp->mr_writes_waiting);
-}
-
-/*
- * Demote from update to access. We better be the only thread with the
- * lock in update mode so it should be easy to set to 1.
- * Wake-up any readers waiting.
- */
-
-void
-mrdemote(mrlock_t *mrp)
-{
-	MRLOCK(mrp);
-	mrp->mr_count = 1;
-	if (mrp->mr_reads_waiting) {	/* Wakeup all readers waiting */
-		wake_up(&mrp->mr_readerq);
-	}
-	MRUNLOCK(mrp);
-}
diff -Nru a/fs/xfs/support/mrlock.h b/fs/xfs/support/mrlock.h
--- a/fs/xfs/support/mrlock.h	Tue Feb  3 19:45:30 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
- */
-#ifndef __XFS_SUPPORT_MRLOCK_H__
-#define __XFS_SUPPORT_MRLOCK_H__
-
-#include <linux/time.h>
-#include <linux/wait.h>
-#include <asm/atomic.h>
-#include <asm/semaphore.h>
-
-/*
- * Implement mrlocks on Linux that work for XFS.
- *
- * These are sleep locks and not spinlocks. If one wants read/write spinlocks,
- * use read_lock, write_lock, ... see spinlock.h.
- */
-
-typedef struct mrlock_s {
-	int			mr_count;
-	unsigned short		mr_reads_waiting;
-	unsigned short		mr_writes_waiting;
-	wait_queue_head_t	mr_readerq;
-	wait_queue_head_t	mr_writerq;
-	spinlock_t		mr_lock;
-} mrlock_t;
-
-#define MR_ACCESS	1
-#define MR_UPDATE	2
-
-#define MRLOCK_BARRIER		0x1
-#define MRLOCK_ALLOW_EQUAL_PRI	0x8
-
-/*
- * mraccessf/mrupdatef take flags to be passed in while sleeping;
- * only PLTWAIT is currently supported.
- */
-
-extern void	mraccessf(mrlock_t *, int);
-extern void	mrupdatef(mrlock_t *, int);
-extern void     mrlock(mrlock_t *, int, int);
-extern void     mrunlock(mrlock_t *);
-extern void     mraccunlock(mrlock_t *);
-extern int      mrtryupdate(mrlock_t *);
-extern int      mrtryaccess(mrlock_t *);
-extern int	mrtrypromote(mrlock_t *);
-extern void     mrdemote(mrlock_t *);
-
-extern int	ismrlocked(mrlock_t *, int);
-extern void     mrlock_init(mrlock_t *, int type, char *name, long sequence);
-extern void     mrfree(mrlock_t *);
-
-#define mrinit(mrp, name)	mrlock_init(mrp, MRLOCK_BARRIER, name, -1)
-#define mraccess(mrp)		mraccessf(mrp, 0) /* grab for READ/ACCESS */
-#define mrupdate(mrp)		mrupdatef(mrp, 0) /* grab for WRITE/UPDATE */
-#define mrislocked_access(mrp)	((mrp)->mr_count > 0)
-#define mrislocked_update(mrp)	((mrp)->mr_count < 0)
-
-#endif /* __XFS_SUPPORT_MRLOCK_H__ */
diff -Nru a/fs/xfs/support/mutex.h b/fs/xfs/support/mutex.h
--- a/fs/xfs/support/mutex.h	Tue Feb  3 19:45:16 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
- * Portions Copyright (c) 2002 Christoph Hellwig.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
- */
-#ifndef __XFS_SUPPORT_MUTEX_H__
-#define __XFS_SUPPORT_MUTEX_H__
-
-#include <linux/spinlock.h>
-#include <asm/semaphore.h>
-
-/*
- * Map the mutex'es from IRIX to Linux semaphores.
- *
- * Destroy just simply initializes to -99 which should block all other
- * callers.
- */
-#define MUTEX_DEFAULT		0x0
-typedef struct semaphore	mutex_t;
-
-#define mutex_init(lock, type, name)		sema_init(lock, 1)
-#define mutex_destroy(lock)			sema_init(lock, -99)
-#define mutex_lock(lock, num)			down(lock)
-#define mutex_trylock(lock)			(down_trylock(lock) ? 0 : 1)
-#define mutex_unlock(lock)			up(lock)
-
-#endif /* __XFS_SUPPORT_MUTEX_H__ */
diff -Nru a/fs/xfs/support/qsort.c b/fs/xfs/support/qsort.c
--- a/fs/xfs/support/qsort.c	Tue Feb  3 19:45:42 2004
+++ b/fs/xfs/support/qsort.c	Tue Feb  3 19:45:42 2004
@@ -1,243 +1,155 @@
-/* Copyright (C) 1991, 1992, 1996, 1997, 1999 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Written by Douglas C. Schmidt (schmidt@ics.uci.edu).
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-/* If you consider tuning this algorithm, you should consult first:
-   Engineering a sort function; Jon Bentley and M. Douglas McIlroy;
-   Software - Practice and Experience; Vol. 23 (11), 1249-1265, 1993.  */
+/*
+ * Copyright (c) 1992, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
 
 #include <linux/kernel.h>
 #include <linux/string.h>
 
-/* Byte-wise swap two items of size SIZE. */
-#define SWAP(a, b, size)						      \
-  do									      \
-    {									      \
-      register size_t __size = (size);					      \
-      register char *__a = (a), *__b = (b);				      \
-      do								      \
-	{								      \
-	  char __tmp = *__a;						      \
-	  *__a++ = *__b;						      \
-	  *__b++ = __tmp;						      \
-	} while (--__size > 0);						      \
-    } while (0)
-
-/* Discontinue quicksort algorithm when partition gets below this size.
-   This particular magic number was chosen to work best on a Sun 4/260. */
-#define MAX_THRESH 4
-
-/* Stack node declarations used to store unfulfilled partition obligations. */
-typedef struct
-  {
-    char *lo;
-    char *hi;
-  } stack_node;
-
-/* The next 4 #defines implement a very fast in-line stack abstraction. */
-/* The stack needs log (total_elements) entries (we could even subtract
-   log(MAX_THRESH)).  Since total_elements has type size_t, we get as
-   upper bound for log (total_elements):
-   bits per byte (CHAR_BIT) * sizeof(size_t).  */
-#define STACK_SIZE	(8 * sizeof(unsigned long int))
-#define PUSH(low, high)	((void) ((top->lo = (low)), (top->hi = (high)), ++top))
-#define	POP(low, high)	((void) (--top, (low = top->lo), (high = top->hi)))
-#define	STACK_NOT_EMPTY	(stack < top)
-
-
-/* Order size using quicksort.  This implementation incorporates
-   four optimizations discussed in Sedgewick:
-
-   1. Non-recursive, using an explicit stack of pointer that store the
-      next array partition to sort.  To save time, this maximum amount
-      of space required to store an array of SIZE_MAX is allocated on the
-      stack.  Assuming a 32-bit (64 bit) integer for size_t, this needs
-      only 32 * sizeof(stack_node) == 256 bytes (for 64 bit: 1024 bytes).
-      Pretty cheap, actually.
-
-   2. Chose the pivot element using a median-of-three decision tree.
-      This reduces the probability of selecting a bad pivot value and
-      eliminates certain extraneous comparisons.
-
-   3. Only quicksorts TOTAL_ELEMS / MAX_THRESH partitions, leaving
-      insertion sort to order the MAX_THRESH items within each partition.
-      This is a big win, since insertion sort is faster for small, mostly
-      sorted array segments.
-
-   4. The larger of the two sub-partitions is always pushed onto the
-      stack first, with the algorithm then concentrating on the
-      smaller partition.  This *guarantees* no more than log (total_elems)
-      stack size is needed (actually O(1) in this case)!  */
+/*
+ * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
+ */
+#define swapcode(TYPE, parmi, parmj, n) { 		\
+	long i = (n) / sizeof (TYPE); 			\
+	register TYPE *pi = (TYPE *) (parmi); 		\
+	register TYPE *pj = (TYPE *) (parmj); 		\
+	do { 						\
+		register TYPE	t = *pi;		\
+		*pi++ = *pj;				\
+		*pj++ = t;				\
+        } while (--i > 0);				\
+}
 
-void
-qsort (void *const pbase, size_t total_elems, size_t size,
-       int (*cmp)(const void *, const void *))
+#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \
+	es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1;
+
+static __inline void
+swapfunc(char *a, char *b, int n, int swaptype)
 {
-  register char *base_ptr = (char *) pbase;
+	if (swaptype <= 1) 
+		swapcode(long, a, b, n)
+	else
+		swapcode(char, a, b, n)
+}
+
+#define swap(a, b)					\
+	if (swaptype == 0) {				\
+		long t = *(long *)(a);			\
+		*(long *)(a) = *(long *)(b);		\
+		*(long *)(b) = t;			\
+	} else						\
+		swapfunc(a, b, es, swaptype)
 
-  const size_t max_thresh = MAX_THRESH * size;
+#define vecswap(a, b, n) 	if ((n) > 0) swapfunc(a, b, n, swaptype)
 
-  if (total_elems == 0)
-    /* Avoid lossage with unsigned arithmetic below.  */
-    return;
-
-  if (total_elems > MAX_THRESH)
-    {
-      char *lo = base_ptr;
-      char *hi = &lo[size * (total_elems - 1)];
-      stack_node stack[STACK_SIZE];
-      stack_node *top = stack + 1;
-
-      while (STACK_NOT_EMPTY)
-	{
-	  char *left_ptr;
-	  char *right_ptr;
-
-	  /* Select median value from among LO, MID, and HI. Rearrange
-	     LO and HI so the three values are sorted. This lowers the
-	     probability of picking a pathological pivot value and
-	     skips a comparison for both the LEFT_PTR and RIGHT_PTR in
-	     the while loops. */
-
-	  char *mid = lo + size * ((hi - lo) / size >> 1);
-
-	  if ((*cmp) ((void *) mid, (void *) lo) < 0)
-	    SWAP (mid, lo, size);
-	  if ((*cmp) ((void *) hi, (void *) mid) < 0)
-	    SWAP (mid, hi, size);
-	  else
-	    goto jump_over;
-	  if ((*cmp) ((void *) mid, (void *) lo) < 0)
-	    SWAP (mid, lo, size);
-	jump_over:;
-
-	  left_ptr  = lo + size;
-	  right_ptr = hi - size;
-
-	  /* Here's the famous ``collapse the walls'' section of quicksort.
-	     Gotta like those tight inner loops!  They are the main reason
-	     that this algorithm runs much faster than others. */
-	  do
-	    {
-	      while ((*cmp) ((void *) left_ptr, (void *) mid) < 0)
-		left_ptr += size;
-
-	      while ((*cmp) ((void *) mid, (void *) right_ptr) < 0)
-		right_ptr -= size;
-
-	      if (left_ptr < right_ptr)
-		{
-		  SWAP (left_ptr, right_ptr, size);
-		  if (mid == left_ptr)
-		    mid = right_ptr;
-		  else if (mid == right_ptr)
-		    mid = left_ptr;
-		  left_ptr += size;
-		  right_ptr -= size;
-		}
-	      else if (left_ptr == right_ptr)
-		{
-		  left_ptr += size;
-		  right_ptr -= size;
-		  break;
+static __inline char *
+med3(char *a, char *b, char *c, int (*cmp)(const void *, const void *))
+{
+	return cmp(a, b) < 0 ?
+	       (cmp(b, c) < 0 ? b : (cmp(a, c) < 0 ? c : a ))
+              :(cmp(b, c) > 0 ? b : (cmp(a, c) < 0 ? a : c ));
+}
+
+void
+qsort(void *aa, size_t n, size_t es, int (*cmp)(const void *, const void *))
+{
+	char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
+	int d, r, swaptype, swap_cnt;
+	register char *a = aa;
+
+loop:	SWAPINIT(a, es);
+	swap_cnt = 0;
+	if (n < 7) {
+		for (pm = (char *)a + es; pm < (char *) a + n * es; pm += es)
+			for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
+			     pl -= es)
+				swap(pl, pl - es);
+		return;
+	}
+	pm = (char *)a + (n / 2) * es;
+	if (n > 7) {
+		pl = (char *)a;
+		pn = (char *)a + (n - 1) * es;
+		if (n > 40) {
+			d = (n / 8) * es;
+			pl = med3(pl, pl + d, pl + 2 * d, cmp);
+			pm = med3(pm - d, pm, pm + d, cmp);
+			pn = med3(pn - 2 * d, pn - d, pn, cmp);
 		}
-	    }
-	  while (left_ptr <= right_ptr);
+		pm = med3(pl, pm, pn, cmp);
+	}
+	swap(a, pm);
+	pa = pb = (char *)a + es;
 
-	  /* Set up pointers for next iteration.  First determine whether
-	     left and right partitions are below the threshold size.  If so,
-	     ignore one or both.  Otherwise, push the larger partition's
-	     bounds on the stack and continue sorting the smaller one. */
-
-	  if ((size_t) (right_ptr - lo) <= max_thresh)
-	    {
-	      if ((size_t) (hi - left_ptr) <= max_thresh)
-		/* Ignore both small partitions. */
-		POP (lo, hi);
-	      else
-		/* Ignore small left partition. */
-		lo = left_ptr;
-	    }
-	  else if ((size_t) (hi - left_ptr) <= max_thresh)
-	    /* Ignore small right partition. */
-	    hi = right_ptr;
-	  else if ((right_ptr - lo) > (hi - left_ptr))
-	    {
-	      /* Push larger left partition indices. */
-	      PUSH (lo, right_ptr);
-	      lo = left_ptr;
-	    }
-	  else
-	    {
-	      /* Push larger right partition indices. */
-	      PUSH (left_ptr, hi);
-	      hi = right_ptr;
-	    }
+	pc = pd = (char *)a + (n - 1) * es;
+	for (;;) {
+		while (pb <= pc && (r = cmp(pb, a)) <= 0) {
+			if (r == 0) {
+				swap_cnt = 1;
+				swap(pa, pb);
+				pa += es;
+			}
+			pb += es;
+		}
+		while (pb <= pc && (r = cmp(pc, a)) >= 0) {
+			if (r == 0) {
+				swap_cnt = 1;
+				swap(pc, pd);
+				pd -= es;
+			}
+			pc -= es;
+		}
+		if (pb > pc)
+			break;
+		swap(pb, pc);
+		swap_cnt = 1;
+		pb += es;
+		pc -= es;
+	}
+	if (swap_cnt == 0) {  /* Switch to insertion sort */
+		for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es)
+			for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0; 
+			     pl -= es)
+				swap(pl, pl - es);
+		return;
 	}
-    }
 
-  /* Once the BASE_PTR array is partially sorted by quicksort the rest
-     is completely sorted using insertion sort, since this is efficient
-     for partitions below MAX_THRESH size. BASE_PTR points to the beginning
-     of the array to sort, and END_PTR points at the very last element in
-     the array (*not* one beyond it!). */
-  {
-    char *const end_ptr = &base_ptr[size * (total_elems - 1)];
-    char *tmp_ptr = base_ptr;
-    char *const thresh = min_t(char *const, end_ptr, base_ptr + max_thresh);
-    register char *run_ptr;
-
-    /* Find smallest element in first threshold and place it at the
-       array's beginning.  This is the smallest array element,
-       and the operation speeds up insertion sort's inner loop. */
-
-    for (run_ptr = tmp_ptr + size; run_ptr <= thresh; run_ptr += size)
-      if ((*cmp) ((void *) run_ptr, (void *) tmp_ptr) < 0)
-	tmp_ptr = run_ptr;
-
-    if (tmp_ptr != base_ptr)
-      SWAP (tmp_ptr, base_ptr, size);
-
-    /* Insertion sort, running from left-hand-side up to right-hand-side.  */
-
-    run_ptr = base_ptr + size;
-    while ((run_ptr += size) <= end_ptr)
-      {
-	tmp_ptr = run_ptr - size;
-	while ((*cmp) ((void *) run_ptr, (void *) tmp_ptr) < 0)
-	  tmp_ptr -= size;
-
-	tmp_ptr += size;
-	if (tmp_ptr != run_ptr)
-	  {
-	    char *trav;
-
-	    trav = run_ptr + size;
-	    while (--trav >= run_ptr)
-	      {
-		char c = *trav;
-		char *hi, *lo;
-
-		for (hi = lo = trav; (lo -= size) >= tmp_ptr; hi = lo)
-		  *hi = *lo;
-		*hi = c;
-	      }
-	  }
-      }
-  }
+	pn = (char *)a + n * es;
+	r = min(pa - (char *)a, pb - pa);
+	vecswap(a, pb - r, r);
+	r = min((long)(pd - pc), (long)(pn - pd - es));
+	vecswap(pb, pn - r, r);
+	if ((r = pb - pa) > es)
+		qsort(a, r / es, es, cmp);
+	if ((r = pd - pc) > es) { 
+		/* Iterate rather than recurse to save stack space */
+		a = pn - r;
+		n = r / es;
+		goto loop;
+	}
+/*		qsort(pn - r, r / es, es, cmp);*/
 }
diff -Nru a/fs/xfs/support/sema.h b/fs/xfs/support/sema.h
--- a/fs/xfs/support/sema.h	Tue Feb  3 19:45:43 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
- */
-#ifndef __XFS_SUPPORT_SEMA_H__
-#define __XFS_SUPPORT_SEMA_H__
-
-#include <linux/time.h>
-#include <linux/wait.h>
-#include <asm/atomic.h>
-#include <asm/semaphore.h>
-
-/*
- * sema_t structure just maps to struct semaphore in Linux kernel.
- */
-
-typedef struct semaphore sema_t;
-
-#define init_sema(sp, val, c, d)	sema_init(sp, val)
-#define initsema(sp, val)		sema_init(sp, val)
-#define initnsema(sp, val, name)	sema_init(sp, val)
-#define psema(sp, b)			down(sp)
-#define vsema(sp)			up(sp)
-#define valusema(sp)			(atomic_read(&(sp)->count))
-#define freesema(sema)
-
-/*
- * Map cpsema (try to get the sema) to down_trylock. We need to switch
- * the return values since cpsema returns 1 (acquired) 0 (failed) and
- * down_trylock returns the reverse 0 (acquired) 1 (failed).
- */
-
-#define cpsema(sp)			(down_trylock(sp) ? 0 : 1)
-
-/*
- * Didn't do cvsema(sp). Not sure how to map this to up/down/...
- * It does a vsema if the values is < 0 other wise nothing.
- */
-
-#endif /* __XFS_SUPPORT_SEMA_H__ */
diff -Nru a/fs/xfs/support/spin.h b/fs/xfs/support/spin.h
--- a/fs/xfs/support/spin.h	Tue Feb  3 19:45:28 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
- * Portions Copyright (c) 2002 Christoph Hellwig.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
- */
-#ifndef __XFS_SUPPORT_SPIN_H__
-#define __XFS_SUPPORT_SPIN_H__
-
-#include <linux/sched.h>	/* preempt needs this */
-#include <linux/spinlock.h>
-
-/*
- * Map lock_t from IRIX to Linux spinlocks.
- *
- * Note that linux turns on/off spinlocks depending on CONFIG_SMP.
- * We don't need to worry about SMP or not here.
- */
-
-#define SPLDECL(s)		unsigned long s
-
-typedef spinlock_t lock_t;
-
-#define spinlock_init(lock, name)	spin_lock_init(lock)
-#define	spinlock_destroy(lock)
-
-static inline unsigned long mutex_spinlock(lock_t *lock)
-{
-	spin_lock(lock);
-	return 0;
-}
-
-/*ARGSUSED*/
-static inline void mutex_spinunlock(lock_t *lock, unsigned long s)
-{
-	spin_unlock(lock);
-}
-
-static inline void nested_spinlock(lock_t *lock)
-{
-	spin_lock(lock);
-}
-
-static inline void nested_spinunlock(lock_t *lock)
-{
-	spin_unlock(lock);
-}
-
-#endif /* __XFS_SUPPORT_SPIN_H__ */
diff -Nru a/fs/xfs/support/sv.h b/fs/xfs/support/sv.h
--- a/fs/xfs/support/sv.h	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
- * Portions Copyright (c) 2002 Christoph Hellwig.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
- */
-#ifndef __XFS_SUPPORT_SV_H__
-#define __XFS_SUPPORT_SV_H__
-
-#include <linux/wait.h>
-#include <linux/sched.h>
-#include <linux/spinlock.h>
-
-/*
- * Synchronisation variables.
- *
- * (Parameters "pri", "svf" and "rts" are not implemented)
- */
-
-typedef struct sv_s {
-	wait_queue_head_t waiters;
-} sv_t;
-
-#define SV_FIFO		0x0		/* sv_t is FIFO type */
-#define SV_LIFO		0x2		/* sv_t is LIFO type */
-#define SV_PRIO		0x4		/* sv_t is PRIO type */
-#define SV_KEYED	0x6		/* sv_t is KEYED type */
-#define SV_DEFAULT      SV_FIFO
-
-
-static inline void _sv_wait(sv_t *sv, spinlock_t *lock, int state,
-			     unsigned long timeout)
-{
-	DECLARE_WAITQUEUE(wait, current);
-
-	add_wait_queue_exclusive(&sv->waiters, &wait);
-	__set_current_state(state);
-	spin_unlock(lock);
-
-	schedule_timeout(timeout);
-
-	remove_wait_queue(&sv->waiters, &wait);
-}
-
-#define init_sv(sv,type,name,flag) \
-	init_waitqueue_head(&(sv)->waiters)
-#define sv_init(sv,flag,name) \
-	init_waitqueue_head(&(sv)->waiters)
-#define sv_destroy(sv) \
-	/*NOTHING*/
-#define sv_wait(sv, pri, lock, s) \
-	_sv_wait(sv, lock, TASK_UNINTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT)
-#define sv_wait_sig(sv, pri, lock, s)   \
-	_sv_wait(sv, lock, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT)
-#define sv_timedwait(sv, pri, lock, s, svf, ts, rts) \
-	_sv_wait(sv, lock, TASK_UNINTERRUPTIBLE, timespec_to_jiffies(ts))
-#define sv_timedwait_sig(sv, pri, lock, s, svf, ts, rts) \
-	_sv_wait(sv, lock, TASK_INTERRUPTIBLE, timespec_to_jiffies(ts))
-#define sv_signal(sv) \
-	wake_up(&(sv)->waiters)
-#define sv_broadcast(sv) \
-	wake_up_all(&(sv)->waiters)
-
-#endif /* __XFS_SUPPORT_SV_H__ */
diff -Nru a/fs/xfs/support/time.h b/fs/xfs/support/time.h
--- a/fs/xfs/support/time.h	Tue Feb  3 19:45:43 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
- */
-#ifndef __XFS_SUPPORT_TIME_H__
-#define __XFS_SUPPORT_TIME_H__
-
-#include <linux/sched.h>
-#include <linux/time.h>
-
-typedef struct timespec timespec_t;
-
-static inline void delay(long ticks)
-{
-	current->state = TASK_UNINTERRUPTIBLE;
-	schedule_timeout(ticks);
-}
-
-static inline void nanotime(struct timespec *tvp)
-{
-	*tvp = CURRENT_TIME;
-}
-
-#endif /* __XFS_SUPPORT_TIME_H__ */
diff -Nru a/fs/xfs/support/uuid.c b/fs/xfs/support/uuid.c
--- a/fs/xfs/support/uuid.c	Tue Feb  3 19:45:42 2004
+++ b/fs/xfs/support/uuid.c	Tue Feb  3 19:45:42 2004
@@ -30,14 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <linux/types.h>
-#include <xfs_types.h>
-#include <xfs_arch.h>
-#include "time.h"
-#include "uuid.h"
-#include "kmem.h"
-#include "debug.h"
-#include "mutex.h"
+#include <xfs.h>
 
 static mutex_t	uuid_monitor;
 static int	uuid_table_size;
diff -Nru a/fs/xfs/xfs.h b/fs/xfs/xfs.h
--- a/fs/xfs/xfs.h	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/xfs.h	Tue Feb  3 19:45:17 2004
@@ -32,28 +32,8 @@
 #ifndef __XFS_H__
 #define __XFS_H__
 
-#include <linux/types.h>
-#include <linux/config.h>
-#include <xfs_types.h>
-
-#include <xfs_arch.h>
-
-#include <support/kmem.h>
-#include <support/mrlock.h>
-#include <support/qsort.h>
-#include <support/spin.h>
-#include <support/sv.h>
-#include <support/ktrace.h>
-#include <support/mutex.h>
-#include <support/sema.h>
-#include <support/debug.h>
-#include <support/move.h>
-#include <support/uuid.h>
-#include <support/time.h>
-
 #include <linux/xfs_linux.h>
 
 #include <xfs_fs.h> 
-#include <xfs_buf.h>
 
 #endif	/* __XFS_H__ */
diff -Nru a/fs/xfs/xfs_acl.h b/fs/xfs/xfs_acl.h
--- a/fs/xfs/xfs_acl.h	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/xfs_acl.h	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2001-2003 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -102,6 +102,8 @@
 #define xfs_acl_vset(v,p,sz,t)	(-EOPNOTSUPP)
 #define xfs_acl_vget(v,p,sz,t)	(-EOPNOTSUPP)
 #define xfs_acl_vremove(v,t)	(-EOPNOTSUPP)
+#define xfs_acl_vhasacl_access(v)	(0)
+#define xfs_acl_vhasacl_default(v)	(0)
 #define _ACL_DECL(a)		((void)0)
 #define _ACL_ALLOC(a)		(1)	/* successfully allocate nothing */
 #define _ACL_FREE(a)		((void)0)
diff -Nru a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c
--- a/fs/xfs/xfs_alloc.c	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/xfs_alloc.c	Tue Feb  3 19:45:17 2004
@@ -54,13 +54,6 @@
 #include "xfs_error.h"
 
 
-#if defined(DEBUG)
-/*
- * Allocation tracing.
- */
-ktrace_t	*xfs_alloc_trace_buf;
-#endif
-
 #define XFS_ABSDIFF(a,b)	(((a) <= (b)) ? ((b) - (a)) : ((a) - (b)))
 
 #define	XFSA_FIXUP_BNO_OK	1
@@ -73,6 +66,8 @@
 		    xfs_extlen_t len);
 
 #if defined(XFS_ALLOC_TRACE)
+ktrace_t *xfs_alloc_trace_buf;
+
 #define	TRACE_ALLOC(s,a)	\
 	xfs_alloc_trace_alloc(fname, s, a, __LINE__)
 #define	TRACE_FREE(s,a,b,x,f)	\
@@ -85,8 +80,6 @@
 	xfs_alloc_trace_busy(fname, s, mp, ag, -1, -1, sl, tp, XFS_ALLOC_KTRACE_UNBUSY, __LINE__)
 #define	TRACE_BUSYSEARCH(fname,s,ag,agb,l,sl,tp)	\
 	xfs_alloc_trace_busy(fname, s, mp, ag, agb, l, sl, tp, XFS_ALLOC_KTRACE_BUSYSEARCH, __LINE__)
-
-
 #else
 #define	TRACE_ALLOC(s,a)
 #define	TRACE_FREE(s,a,b,x,f)
diff -Nru a/fs/xfs/xfs_alloc.h b/fs/xfs/xfs_alloc.h
--- a/fs/xfs/xfs_alloc.h	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/xfs_alloc.h	Tue Feb  3 19:45:17 2004
@@ -95,6 +95,13 @@
 
 #ifdef __KERNEL__
 
+#if defined(XFS_ALLOC_TRACE)
+/*
+ * Allocation tracing buffer size.
+ */
+#define	XFS_ALLOC_TRACE_SIZE	4096
+extern ktrace_t *xfs_alloc_trace_buf;
+
 /*
  * Types for alloc tracing.
  */
@@ -104,24 +111,7 @@
 #define	XFS_ALLOC_KTRACE_BUSY	4
 #define	XFS_ALLOC_KTRACE_UNBUSY	5
 #define	XFS_ALLOC_KTRACE_BUSYSEARCH	6
-
-
-/*
- * Allocation tracing buffer size.
- */
-#define	XFS_ALLOC_TRACE_SIZE	4096
-
-#ifdef	XFS_ALL_TRACE
-#define	XFS_ALLOC_TRACE
-#endif
-
-#if !defined(DEBUG)
-#undef	XFS_ALLOC_TRACE
 #endif
-
-/*
- * Prototypes for visible xfs_alloc.c routines
- */
 
 /*
  * Compute and fill in value of m_ag_maxlevels.
diff -Nru a/fs/xfs/xfs_arch.h b/fs/xfs/xfs_arch.h
--- a/fs/xfs/xfs_arch.h	Tue Feb  3 19:45:41 2004
+++ b/fs/xfs/xfs_arch.h	Tue Feb  3 19:45:41 2004
@@ -53,16 +53,18 @@
 
 #define ARCH_NOCONVERT 1
 #if __BYTE_ORDER == __LITTLE_ENDIAN
-#define ARCH_CONVERT   0
+# define ARCH_CONVERT	0
 #else
-#define ARCH_CONVERT   ARCH_NOCONVERT
+# define ARCH_CONVERT	ARCH_NOCONVERT
 #endif
 
 /* generic swapping macros */
 
+#ifndef HAVE_SWABMACROS
 #define INT_SWAP16(type,var) ((typeof(type))(__swab16((__u16)(var))))
 #define INT_SWAP32(type,var) ((typeof(type))(__swab32((__u32)(var))))
 #define INT_SWAP64(type,var) ((typeof(type))(__swab64((__u64)(var))))
+#endif
 
 #define INT_SWAP(type, var) \
     ((sizeof(type) == 8) ? INT_SWAP64(type,var) : \
diff -Nru a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c
--- a/fs/xfs/xfs_attr.c	Tue Feb  3 19:45:29 2004
+++ b/fs/xfs/xfs_attr.c	Tue Feb  3 19:45:29 2004
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -63,6 +63,7 @@
 #include "xfs_quota.h"
 #include "xfs_rw.h"
 #include "xfs_trans_space.h"
+#include "xfs_acl.h"
 
 /*
  * xfs_attr.c
@@ -105,12 +106,11 @@
 #define ATTR_RMTVALUE_MAPSIZE	1	/* # of map entries at once */
 #define ATTR_RMTVALUE_TRANSBLKS	8	/* max # of blks in a transaction */
 
-#if defined(DEBUG)
+#if defined(XFS_ATTR_TRACE)
 ktrace_t *xfs_attr_trace_buf;
 #endif
 
 
-
 /*========================================================================
  * Overall external interface routines.
  *========================================================================*/
@@ -2234,7 +2234,8 @@
 		(__psunsigned_t)context->count,
 		(__psunsigned_t)context->firstu,
 		(__psunsigned_t)
-			(context->count > 0)
+			((context->count > 0) &&
+			!(context->flags & (ATTR_KERNAMELS|ATTR_KERNOVAL)))
 				? (ATTR_ENTRY(context->alist,
 					      context->count-1)->a_valuelen)
 				: 0,
@@ -2262,7 +2263,8 @@
 		(__psunsigned_t)context->count,
 		(__psunsigned_t)context->firstu,
 		(__psunsigned_t)
-			(context->count > 0)
+			((context->count > 0) &&
+			!(context->flags & (ATTR_KERNAMELS|ATTR_KERNOVAL)))
 				? (ATTR_ENTRY(context->alist,
 					      context->count-1)->a_valuelen)
 				: 0,
@@ -2290,7 +2292,8 @@
 		(__psunsigned_t)context->count,
 		(__psunsigned_t)context->firstu,
 		(__psunsigned_t)
-			(context->count > 0)
+			((context->count > 0) &&
+			!(context->flags & (ATTR_KERNAMELS|ATTR_KERNOVAL)))
 				? (ATTR_ENTRY(context->alist,
 					      context->count-1)->a_valuelen)
 				: 0,
@@ -2318,7 +2321,8 @@
 		(__psunsigned_t)context->count,
 		(__psunsigned_t)context->firstu,
 		(__psunsigned_t)
-			(context->count > 0)
+			((context->count > 0) &&
+			!(context->flags & (ATTR_KERNAMELS|ATTR_KERNOVAL)))
 				? (ATTR_ENTRY(context->alist,
 					      context->count-1)->a_valuelen)
 				: 0,
@@ -2353,3 +2357,325 @@
 					 (void *)a14, (void *)a15);
 }
 #endif	/* XFS_ATTR_TRACE */
+
+
+/*========================================================================
+ * System (pseudo) namespace attribute interface routines.
+ *========================================================================*/
+
+STATIC int
+posix_acl_access_set(
+	vnode_t	*vp, char *name, void *data, size_t size, int xflags)
+{
+	return xfs_acl_vset(vp, data, size, _ACL_TYPE_ACCESS);
+}
+
+STATIC int
+posix_acl_access_remove(
+	struct vnode *vp, char *name, int xflags)
+{
+	return xfs_acl_vremove(vp, _ACL_TYPE_ACCESS);
+}
+
+STATIC int
+posix_acl_access_get(
+	vnode_t *vp, char *name, void *data, size_t size, int xflags)
+{
+	return xfs_acl_vget(vp, data, size, _ACL_TYPE_ACCESS);
+}
+
+STATIC int
+posix_acl_access_exists(
+	vnode_t *vp)
+{
+	return xfs_acl_vhasacl_access(vp);
+}
+
+STATIC int
+posix_acl_default_set(
+	vnode_t	*vp, char *name, void *data, size_t size, int xflags)
+{
+	return xfs_acl_vset(vp, data, size, _ACL_TYPE_DEFAULT);
+}
+
+STATIC int
+posix_acl_default_get(
+	vnode_t *vp, char *name, void *data, size_t size, int xflags)
+{
+	return xfs_acl_vget(vp, data, size, _ACL_TYPE_DEFAULT);
+}
+
+STATIC int
+posix_acl_default_remove(
+	struct vnode *vp, char *name, int xflags)
+{
+	return xfs_acl_vremove(vp, _ACL_TYPE_DEFAULT);
+}
+
+STATIC int
+posix_acl_default_exists(
+	vnode_t *vp)
+{
+	return xfs_acl_vhasacl_default(vp);
+}
+
+struct attrnames posix_acl_access = {
+	.attr_name	= "posix_acl_access",
+	.attr_namelen	= sizeof("posix_acl_access") - 1,
+	.attr_get	= posix_acl_access_get,
+	.attr_set	= posix_acl_access_set,
+	.attr_remove	= posix_acl_access_remove,
+	.attr_exists	= posix_acl_access_exists,
+};
+
+struct attrnames posix_acl_default = {
+	.attr_name	= "posix_acl_default",
+	.attr_namelen	= sizeof("posix_acl_default") - 1,
+	.attr_get	= posix_acl_default_get,
+	.attr_set	= posix_acl_default_set,
+	.attr_remove	= posix_acl_default_remove,
+	.attr_exists	= posix_acl_default_exists,
+};
+
+struct attrnames *attr_system_names[] =
+	{ &posix_acl_access, &posix_acl_default };
+
+
+/*========================================================================
+ * Namespace-prefix-style attribute name interface routines.
+ *========================================================================*/
+
+STATIC int
+attr_generic_set(
+	struct vnode *vp, char *name, void *data, size_t size, int xflags)
+{
+	int 	error;
+
+	VOP_ATTR_SET(vp, name, data, size, xflags, NULL, error);
+	return -error;
+}
+
+STATIC int
+attr_generic_get(
+	struct vnode *vp, char *name, void *data, size_t size, int xflags)
+{
+	int	error, asize = size;
+
+	VOP_ATTR_GET(vp, name, data, &asize, xflags, NULL, error);
+	if (!error)
+		return asize;
+	return -error;
+}
+
+STATIC int
+attr_generic_remove(
+	struct vnode *vp, char *name, int xflags)
+{
+	int	error;
+
+	VOP_ATTR_REMOVE(vp, name, xflags, NULL, error);
+	return -error;
+}
+
+STATIC int
+attr_generic_listadd(
+	attrnames_t		*prefix,
+	attrnames_t		*namesp,
+	void			*data,
+	size_t			size,
+	ssize_t			*result)
+{
+	char			*p = data + *result;
+
+	*result += prefix->attr_namelen;
+	*result += namesp->attr_namelen + 1;
+	if (!size)
+		return 0;
+	if (*result > size)
+		return -ERANGE;
+	strcpy(p, prefix->attr_name);
+	p += prefix->attr_namelen;
+	strcpy(p, namesp->attr_name);
+	p += namesp->attr_namelen + 1;
+	return 0;
+}
+
+STATIC int
+attr_system_list(
+	struct vnode		*vp,
+	void			*data,
+	size_t			size,
+	ssize_t			*result)
+{
+	attrnames_t		*namesp;
+	int			i, error = 0;
+
+	for (i = 0; i < ATTR_SYSCOUNT; i++) {
+		namesp = attr_system_names[i];
+		if (!namesp->attr_exists || !namesp->attr_exists(vp))
+			continue;
+		error = attr_generic_listadd(&attr_system, namesp,
+						data, size, result);
+		if (error)
+			break;
+	}
+	return error;
+}
+
+int
+attr_generic_list(
+	struct vnode *vp, void *data, size_t size, int xflags, ssize_t *result)
+{
+	attrlist_cursor_kern_t	cursor = { 0 };
+	int			error;
+
+	VOP_ATTR_LIST(vp, data, size, xflags, &cursor, NULL, error);
+	if (error > 0)
+		return -error;
+	*result = -error;
+	return attr_system_list(vp, data, size, result);
+}
+
+attrnames_t *
+attr_lookup_namespace(
+	char			*name,
+	struct attrnames	**names,
+	int			nnames)
+{
+	int			i;
+
+	for (i = 0; i < nnames; i++)
+		if (!strncmp(name, names[i]->attr_name, names[i]->attr_namelen))
+			return names[i];
+	return NULL;
+}
+
+/*
+ * Some checks to prevent people abusing EAs to get over quota:
+ * - Don't allow modifying user EAs on devices/symlinks;
+ * - Don't allow modifying user EAs if sticky bit set;
+ */
+STATIC int
+attr_user_capable(
+	struct vnode	*vp,
+	cred_t		*cred)
+{
+	struct inode	*inode = LINVFS_GET_IP(vp);
+
+	if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
+		return -EPERM;
+	if (!S_ISREG(inode->i_mode) && !S_ISDIR(inode->i_mode) &&
+	    !capable(CAP_SYS_ADMIN))
+		return -EPERM;
+	if (S_ISDIR(inode->i_mode) && (inode->i_mode & S_ISVTX) &&
+	    (current_fsuid(cred) != inode->i_uid) && !capable(CAP_FOWNER))
+		return -EPERM;
+	return 0;
+}
+
+STATIC int
+attr_trusted_capable(
+	struct vnode	*vp,
+	cred_t		*cred)
+{
+	struct inode	*inode = LINVFS_GET_IP(vp);
+
+	if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
+		return -EPERM;
+	if (!capable(CAP_SYS_ADMIN))
+		return -EPERM;
+	return 0;
+}
+
+STATIC int
+attr_secure_capable(
+	struct vnode	*vp,
+	cred_t		*cred)
+{
+	return -ENOSECURITY;
+}
+
+STATIC int
+attr_system_set(
+	struct vnode *vp, char *name, void *data, size_t size, int xflags)
+{
+	attrnames_t	*namesp;
+	int		error;
+
+	if (xflags & ATTR_CREATE)
+		return -EINVAL;
+
+	namesp = attr_lookup_namespace(name, attr_system_names, ATTR_SYSCOUNT);
+	if (!namesp)
+		return -EOPNOTSUPP;
+	error = namesp->attr_set(vp, name, data, size, xflags);
+	if (!error)
+		error = vn_revalidate(vp);
+	return error;
+}
+
+STATIC int
+attr_system_get(
+	struct vnode *vp, char *name, void *data, size_t size, int xflags)
+{
+	attrnames_t	*namesp;
+
+	namesp = attr_lookup_namespace(name, attr_system_names, ATTR_SYSCOUNT);
+	if (!namesp)
+		return -EOPNOTSUPP;
+	return namesp->attr_get(vp, name, data, size, xflags);
+}
+
+STATIC int
+attr_system_remove(
+	struct vnode *vp, char *name, int xflags)
+{
+	attrnames_t	*namesp;
+
+	namesp = attr_lookup_namespace(name, attr_system_names, ATTR_SYSCOUNT);
+	if (!namesp)
+		return -EOPNOTSUPP;
+	return namesp->attr_remove(vp, name, xflags);
+}
+
+struct attrnames attr_system = {
+	.attr_name	= "system.",
+	.attr_namelen	= sizeof("system.") - 1,
+	.attr_flag	= ATTR_SYSTEM,
+	.attr_get	= attr_system_get,
+	.attr_set	= attr_system_set,
+	.attr_remove	= attr_system_remove,
+	.attr_capable	= (attrcapable_t)fs_noerr,
+};
+
+struct attrnames attr_trusted = {
+	.attr_name	= "trusted.",
+	.attr_namelen	= sizeof("trusted.") - 1,
+	.attr_flag	= ATTR_ROOT,
+	.attr_get	= attr_generic_get,
+	.attr_set	= attr_generic_set,
+	.attr_remove	= attr_generic_remove,
+	.attr_capable	= attr_trusted_capable,
+};
+
+struct attrnames attr_secure = {
+	.attr_name	= "security.",
+	.attr_namelen	= sizeof("security.") - 1,
+	.attr_flag	= ATTR_SECURE,
+	.attr_get	= attr_generic_get,
+	.attr_set	= attr_generic_set,
+	.attr_remove	= attr_generic_remove,
+	.attr_capable	= attr_secure_capable,
+};
+
+struct attrnames attr_user = {
+	.attr_name	= "user.",
+	.attr_namelen	= sizeof("user.") - 1,
+	.attr_get	= attr_generic_get,
+	.attr_set	= attr_generic_set,
+	.attr_remove	= attr_generic_remove,
+	.attr_capable	= attr_user_capable,
+};
+
+struct attrnames *attr_namespaces[] =
+	{ &attr_system, &attr_trusted, &attr_secure, &attr_user };
diff -Nru a/fs/xfs/xfs_attr.h b/fs/xfs/xfs_attr.h
--- a/fs/xfs/xfs_attr.h	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/xfs_attr.h	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2002 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000, 2002-2003 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -45,22 +45,52 @@
  * as possible so as to fit into the literal area of the inode.
  */
 
-#ifdef XFS_ALL_TRACE
-#define	XFS_ATTR_TRACE
-#endif
-
-#if !defined(DEBUG)
-#undef XFS_ATTR_TRACE
-#endif
-
-
 /*========================================================================
  * External interfaces
  *========================================================================*/
 
-#define ATTR_ROOT	0x0002	/* use attrs in root namespace, not user */
+struct cred;
+struct vnode;
+
+typedef int (*attrset_t)(struct vnode *, char *, void *, size_t, int);
+typedef int (*attrget_t)(struct vnode *, char *, void *, size_t, int);
+typedef int (*attrremove_t)(struct vnode *, char *, int);
+typedef int (*attrexists_t)(struct vnode *);
+typedef int (*attrcapable_t)(struct vnode *, struct cred *);
+
+typedef struct attrnames {
+	char *		attr_name;
+	unsigned int	attr_namelen;
+	unsigned int	attr_flag;
+	attrget_t	attr_get;
+	attrset_t	attr_set;
+	attrremove_t	attr_remove;
+	attrexists_t	attr_exists;
+	attrcapable_t	attr_capable;
+} attrnames_t;
+
+#define ATTR_NAMECOUNT	4
+extern struct attrnames attr_user;
+extern struct attrnames attr_secure;
+extern struct attrnames attr_system;
+extern struct attrnames attr_trusted;
+extern struct attrnames *attr_namespaces[ATTR_NAMECOUNT];
+
+#define ATTR_SYSCOUNT	2
+extern struct attrnames posix_acl_access;
+extern struct attrnames posix_acl_default;
+extern struct attrnames *attr_system_names[ATTR_SYSCOUNT];
+
+extern attrnames_t *attr_lookup_namespace(char *, attrnames_t **, int);
+extern int attr_generic_list(struct vnode *, void *, size_t, int, ssize_t *);
+
+#define ATTR_DONTFOLLOW	0x0001	/* -- unused, from IRIX -- */
+#define ATTR_ROOT	0x0002	/* use attrs in root (trusted) namespace */
+#define ATTR_TRUST	0x0004	/* -- unused, from IRIX -- */
+#define ATTR_SECURE	0x0008	/* use attrs in security namespace */
 #define ATTR_CREATE	0x0010	/* pure create: fail if attr already exists */
 #define ATTR_REPLACE	0x0020	/* pure set: fail if attr does not exist */
+#define ATTR_SYSTEM	0x0100	/* use attrs in system (pseudo) namespace */
 #define ATTR_KERNOTIME	0x1000	/* [kernel] don't update inode timestamps */
 #define ATTR_KERNOVAL	0x2000	/* [kernel] get attr size only, not value */
 #define ATTR_KERNAMELS	0x4000	/* [kernel] list attr names (simple list) */
@@ -135,11 +165,8 @@
  * Function prototypes for the kernel.
  *========================================================================*/
 
-struct cred;
-struct vnode;
 struct xfs_inode;
 struct attrlist_cursor_kern;
-struct xfs_ext_attr;
 struct xfs_da_args;
 
 /*
diff -Nru a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c
--- a/fs/xfs/xfs_attr_leaf.c	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/xfs_attr_leaf.c	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -159,6 +159,9 @@
 			continue;
 		if (memcmp(args->name, sfe->nameval, args->namelen) != 0)
 			continue;
+		if (((args->flags & ATTR_SECURE) != 0) !=
+		    ((sfe->flags & XFS_ATTR_SECURE) != 0))
+			continue;
 		if (((args->flags & ATTR_ROOT) != 0) !=
 		    ((sfe->flags & XFS_ATTR_ROOT) != 0))
 			continue;
@@ -173,7 +176,8 @@
 
 	sfe->namelen = args->namelen;
 	INT_SET(sfe->valuelen, ARCH_CONVERT, args->valuelen);
-	sfe->flags = (args->flags & ATTR_ROOT) ? XFS_ATTR_ROOT : 0;
+	sfe->flags = (args->flags & ATTR_SECURE) ? XFS_ATTR_SECURE :
+			((args->flags & ATTR_ROOT) ? XFS_ATTR_ROOT : 0);
 	memcpy(sfe->nameval, args->name, args->namelen);
 	memcpy(&sfe->nameval[args->namelen], args->value, args->valuelen);
 	INT_MOD(sf->hdr.count, ARCH_CONVERT, 1);
@@ -209,6 +213,9 @@
 			continue;
 		if (memcmp(sfe->nameval, args->name, args->namelen) != 0)
 			continue;
+		if (((args->flags & ATTR_SECURE) != 0) !=
+		    ((sfe->flags & XFS_ATTR_SECURE) != 0))
+			continue;
 		if (((args->flags & ATTR_ROOT) != 0) !=
 		    ((sfe->flags & XFS_ATTR_ROOT) != 0))
 			continue;
@@ -253,6 +260,9 @@
 			continue;
 		if (memcmp(args->name, sfe->nameval, args->namelen) != 0)
 			continue;
+		if (((args->flags & ATTR_SECURE) != 0) !=
+		    ((sfe->flags & XFS_ATTR_SECURE) != 0))
+			continue;
 		if (((args->flags & ATTR_ROOT) != 0) !=
 		    ((sfe->flags & XFS_ATTR_ROOT) != 0))
 			continue;
@@ -281,6 +291,9 @@
 			continue;
 		if (memcmp(args->name, sfe->nameval, args->namelen) != 0)
 			continue;
+		if (((args->flags & ATTR_SECURE) != 0) !=
+		    ((sfe->flags & XFS_ATTR_SECURE) != 0))
+			continue;
 		if (((args->flags & ATTR_ROOT) != 0) !=
 		    ((sfe->flags & XFS_ATTR_ROOT) != 0))
 			continue;
@@ -369,7 +382,8 @@
 		nargs.valuelen = INT_GET(sfe->valuelen, ARCH_CONVERT);
 		nargs.hashval = xfs_da_hashname((char *)sfe->nameval,
 						sfe->namelen);
-		nargs.flags = (sfe->flags & XFS_ATTR_ROOT) ? ATTR_ROOT : 0;
+		nargs.flags = (sfe->flags & XFS_ATTR_SECURE) ? ATTR_SECURE :
+				((sfe->flags & XFS_ATTR_ROOT) ? ATTR_ROOT : 0);
 		error = xfs_attr_leaf_lookup_int(bp, &nargs); /* set a->index */
 		ASSERT(error == ENOATTR);
 		error = xfs_attr_leaf_add(bp, &nargs);
@@ -444,21 +458,24 @@
 							< context->bufsize) {
 		for (i = 0, sfe = &sf->list[0];
 				i < INT_GET(sf->hdr.count, ARCH_CONVERT); i++) {
-			int ns = (sfe->flags & XFS_ATTR_ROOT)?
-						ROOT_NAMES : USER_NAMES;
+			attrnames_t	*namesp;
+
 			if (((context->flags & ATTR_ROOT) != 0) !=
 			    ((sfe->flags & XFS_ATTR_ROOT) != 0) &&
 			    !(context->flags & ATTR_KERNFULLS)) {
 				sfe = XFS_ATTR_SF_NEXTENTRY(sfe);
 				continue;
 			}
+			namesp = (sfe->flags & XFS_ATTR_SECURE) ? &attr_secure:
+				((sfe->flags & XFS_ATTR_ROOT) ? &attr_trusted :
+				  &attr_user);
 			if (context->flags & ATTR_KERNOVAL) {
 				ASSERT(context->flags & ATTR_KERNAMELS);
-				context->count += xfs_namespaces[ns].namelen +
+				context->count += namesp->attr_namelen +
 					INT_GET(sfe->namelen, ARCH_CONVERT) + 1;
 			}
 			else {
-				if (xfs_attr_put_listent(context, ns,
+				if (xfs_attr_put_listent(context, namesp,
 						   (char *)sfe->nameval,
 						   (int)sfe->namelen,
 						   (int)INT_GET(sfe->valuelen,
@@ -544,18 +561,23 @@
 	 * Loop putting entries into the user buffer.
 	 */
 	for ( ; i < nsbuf; i++, sbp++) {
-		int ns = (sbp->flags & XFS_ATTR_ROOT)? ROOT_NAMES:USER_NAMES;
+		attrnames_t	*namesp;
+
+		namesp = (sfe->flags & XFS_ATTR_SECURE) ? &attr_secure :
+			((sfe->flags & XFS_ATTR_ROOT) ? &attr_trusted :
+			  &attr_user);
+
 		if (cursor->hashval != INT_GET(sbp->hash, ARCH_CONVERT)) {
 			cursor->hashval = INT_GET(sbp->hash, ARCH_CONVERT);
 			cursor->offset = 0;
 		}
 		if (context->flags & ATTR_KERNOVAL) {
 			ASSERT(context->flags & ATTR_KERNAMELS);
-			context->count += xfs_namespaces[ns].namelen
-					+ sbp->namelen + 1;
+			context->count += namesp->attr_namelen +
+						sbp->namelen + 1;
 		}
 		else {
-			if (xfs_attr_put_listent(context, ns,
+			if (xfs_attr_put_listent(context, namesp,
 					sbp->name, sbp->namelen,
 					INT_GET(sbp->valuelen, ARCH_CONVERT)))
 				break;
@@ -662,7 +684,8 @@
 		nargs.value = (char *)&name_loc->nameval[nargs.namelen];
 		nargs.valuelen = INT_GET(name_loc->valuelen, ARCH_CONVERT);
 		nargs.hashval = INT_GET(entry->hashval, ARCH_CONVERT);
-		nargs.flags = (entry->flags & XFS_ATTR_ROOT) ? ATTR_ROOT : 0;
+		nargs.flags = (entry->flags & XFS_ATTR_SECURE) ? ATTR_SECURE :
+			      ((entry->flags & XFS_ATTR_ROOT) ? ATTR_ROOT : 0);
 		xfs_attr_shortform_add(&nargs);
 	}
 	error = 0;
@@ -957,7 +980,8 @@
 				      + INT_GET(map->size, ARCH_CONVERT));
 	INT_SET(entry->hashval, ARCH_CONVERT, args->hashval);
 	entry->flags = tmp ? XFS_ATTR_LOCAL : 0;
-	entry->flags |= (args->flags & ATTR_ROOT) ? XFS_ATTR_ROOT : 0;
+	entry->flags |= (args->flags & ATTR_SECURE) ? XFS_ATTR_SECURE :
+			((args->flags & ATTR_ROOT) ? XFS_ATTR_ROOT : 0);
 	if (args->rename) {
 		entry->flags |= XFS_ATTR_INCOMPLETE;
 		if ((args->blkno2 == args->blkno) &&
@@ -1875,6 +1899,9 @@
 			if (memcmp(args->name, (char *)name_loc->nameval,
 					     args->namelen) != 0)
 				continue;
+			if (((args->flags & ATTR_SECURE) != 0) !=
+			    ((entry->flags & XFS_ATTR_SECURE) != 0))
+				continue;
 			if (((args->flags & ATTR_ROOT) != 0) !=
 			    ((entry->flags & XFS_ATTR_ROOT) != 0))
 				continue;
@@ -1887,6 +1914,9 @@
 			if (memcmp(args->name, (char *)name_rmt->name,
 					     args->namelen) != 0)
 				continue;
+			if (((args->flags & ATTR_SECURE) != 0) !=
+			    ((entry->flags & XFS_ATTR_SECURE) != 0))
+				continue;
 			if (((args->flags & ATTR_ROOT) != 0) !=
 			    ((entry->flags & XFS_ATTR_ROOT) != 0))
 				continue;
@@ -2270,7 +2300,7 @@
 	retval = 0;
 	for (  ; (i < INT_GET(leaf->hdr.count, ARCH_CONVERT))
 	     && (retval == 0); entry++, i++) {
-		int ns = (entry->flags & XFS_ATTR_ROOT)? ROOT_NAMES:USER_NAMES;
+		attrnames_t	*namesp;
 
 		if (INT_GET(entry->hashval, ARCH_CONVERT) != cursor->hashval) {
 			cursor->hashval = INT_GET(entry->hashval, ARCH_CONVERT);
@@ -2284,14 +2314,18 @@
 		    !(context->flags & ATTR_KERNFULLS))
 			continue;		/* skip non-matching entries */
 
+		namesp = (entry->flags & XFS_ATTR_SECURE) ? &attr_secure :
+			((entry->flags & XFS_ATTR_ROOT) ? &attr_trusted :
+			  &attr_user);
+
 		if (entry->flags & XFS_ATTR_LOCAL) {
 			name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, i);
 			if (context->flags & ATTR_KERNOVAL) {
 				ASSERT(context->flags & ATTR_KERNAMELS);
-				context->count += xfs_namespaces[ns].namelen
-						+ (int)name_loc->namelen + 1;
+				context->count += namesp->attr_namelen +
+						(int)name_loc->namelen + 1;
 			} else {
-				retval = xfs_attr_put_listent(context, ns,
+				retval = xfs_attr_put_listent(context, namesp,
 					(char *)name_loc->nameval,
 					(int)name_loc->namelen,
 					(int)INT_GET(name_loc->valuelen,
@@ -2301,10 +2335,10 @@
 			name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, i);
 			if (context->flags & ATTR_KERNOVAL) {
 				ASSERT(context->flags & ATTR_KERNAMELS);
-				context->count += xfs_namespaces[ns].namelen
-						+ (int)name_rmt->namelen + 1;
+				context->count += namesp->attr_namelen +
+						(int)name_rmt->namelen + 1;
 			} else {
-				retval = xfs_attr_put_listent(context, ns,
+				retval = xfs_attr_put_listent(context, namesp,
 					(char *)name_rmt->name,
 					(int)name_rmt->namelen,
 					(int)INT_GET(name_rmt->valuelen,
@@ -2333,7 +2367,7 @@
 /*ARGSUSED*/
 int
 xfs_attr_put_listent(xfs_attr_list_context_t *context,
-		     int ns, char *name, int namelen, int valuelen)
+		     attrnames_t *namesp, char *name, int namelen, int valuelen)
 {
 	attrlist_ent_t *aep;
 	int arraytop;
@@ -2341,23 +2375,21 @@
 	ASSERT(!(context->flags & ATTR_KERNOVAL));
 	if (context->flags & ATTR_KERNAMELS) {
 		char *offset;
-		xattr_namespace_t *nsp;
 
 		ASSERT(context->count >= 0);
 
-		nsp = &xfs_namespaces[ns];
-		arraytop = context->count + nsp->namelen + namelen+1;
+		arraytop = context->count + namesp->attr_namelen + namelen + 1;
 		if (arraytop > context->firstu) {
 			context->count = -1;	/* insufficient space */
 			return(1);
 		}
 		offset = (char *)context->alist + context->count;
-		strncpy(offset, nsp->name, nsp->namelen);	/* namespace */
-		offset += nsp->namelen;
+		strncpy(offset, namesp->attr_name, namesp->attr_namelen);
+		offset += namesp->attr_namelen;
 		strncpy(offset, name, namelen);			/* real name */
 		offset += namelen;
 		*offset = '\0';
-		context->count += nsp->namelen + namelen + 1;
+		context->count += namesp->attr_namelen + namelen + 1;
 		return(0);
 	}
 
diff -Nru a/fs/xfs/xfs_attr_leaf.h b/fs/xfs/xfs_attr_leaf.h
--- a/fs/xfs/xfs_attr_leaf.h	Tue Feb  3 19:45:16 2004
+++ b/fs/xfs/xfs_attr_leaf.h	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2002 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000, 2002-2003 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -44,6 +44,7 @@
 
 struct attrlist;
 struct attrlist_cursor_kern;
+struct attrnames;
 struct xfs_dabuf;
 struct xfs_da_args;
 struct xfs_da_state;
@@ -72,9 +73,9 @@
  * to work "forw"ard.  If none matches, continue with the "forw"ard leaf
  * nodes until the hash key changes or the attribute name is found.
  *
- * We store the fact that an attribute is a ROOT versus USER attribute in
+ * We store the fact that an attribute is a ROOT/USER/SECURE attribute in
  * the leaf_entry.  The namespaces are independent only because we also look
- * at the root/user bit when we are looking for a matching attribute name.
+ * at the namespace bit when we are looking for a matching attribute name.
  *
  * We also store a "incomplete" bit in the leaf_entry.  It shows that an
  * attribute is in the middle of being created and should not be shown to
@@ -101,7 +102,7 @@
 	struct xfs_attr_leaf_entry {	/* sorted on key, not name */
 		xfs_dahash_t hashval;	/* hash value of name */
 		__uint16_t nameidx;	/* index into buffer of name/value */
-		__uint8_t flags;	/* LOCAL, ROOT and INCOMPLETE flags */
+		__uint8_t flags;	/* LOCAL/ROOT/SECURE/INCOMPLETE flag */
 		__uint8_t pad2;		/* unused pad byte */
 	} entries[1];			/* variable sized array */
 	struct xfs_attr_leaf_name_local {
@@ -128,10 +129,12 @@
  * on the system call, they are "or"ed together for various operations.
  */
 #define	XFS_ATTR_LOCAL_BIT	0	/* attr is stored locally */
-#define	XFS_ATTR_ROOT_BIT	1	/* limit access to attr to userid 0 */
+#define	XFS_ATTR_ROOT_BIT	1	/* limit access to trusted attrs */
+#define	XFS_ATTR_SECURE_BIT	2	/* limit access to secure attrs */
 #define	XFS_ATTR_INCOMPLETE_BIT	7	/* attr in middle of create/delete */
 #define XFS_ATTR_LOCAL		(1 << XFS_ATTR_LOCAL_BIT)
 #define XFS_ATTR_ROOT		(1 << XFS_ATTR_ROOT_BIT)
+#define XFS_ATTR_SECURE		(1 << XFS_ATTR_SECURE_BIT)
 #define XFS_ATTR_INCOMPLETE	(1 << XFS_ATTR_INCOMPLETE_BIT)
 
 /*
@@ -299,7 +302,8 @@
 					int *local);
 int	xfs_attr_leaf_entsize(struct xfs_attr_leafblock *leaf, int index);
 int	xfs_attr_put_listent(struct xfs_attr_list_context *context,
-			     int ns, char *name, int namelen, int valuelen);
+			     struct attrnames *, char *name, int namelen,
+			     int valuelen);
 int	xfs_attr_rolltrans(struct xfs_trans **transp, struct xfs_inode *dp);
 
 #endif	/* __XFS_ATTR_LEAF_H__ */
diff -Nru a/fs/xfs/xfs_attr_sf.h b/fs/xfs/xfs_attr_sf.h
--- a/fs/xfs/xfs_attr_sf.h	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/xfs_attr_sf.h	Tue Feb  3 19:45:17 2004
@@ -104,14 +104,7 @@
 	(INT_GET(((xfs_attr_shortform_t *)((dp)->i_afp->if_u1.if_data))->hdr.totsize, ARCH_CONVERT))
 #endif
 
-#ifdef XFS_ALL_TRACE
-#define	XFS_ATTR_TRACE
-#endif
-
-#if !defined(DEBUG)
-#undef	XFS_ATTR_TRACE
-#endif
-
+#if defined(XFS_ATTR_TRACE)
 /*
  * Kernel tracing support for attribute lists
  */
@@ -121,6 +114,7 @@
 struct xfs_attr_leafblock;
 
 #define	XFS_ATTR_TRACE_SIZE	4096	/* size of global trace buffer */
+extern ktrace_t	*xfs_attr_trace_buf;
 
 /*
  * Trace record types.
@@ -129,8 +123,6 @@
 #define	XFS_ATTR_KTRACE_L_CN	2	/* context, node */
 #define	XFS_ATTR_KTRACE_L_CB	3	/* context, btree */
 #define	XFS_ATTR_KTRACE_L_CL	4	/* context, leaf */
-
-#if defined(XFS_ATTR_TRACE)
 
 void xfs_attr_trace_l_c(char *where, struct xfs_attr_list_context *context);
 void xfs_attr_trace_l_cn(char *where, struct xfs_attr_list_context *context,
diff -Nru a/fs/xfs/xfs_behavior.c b/fs/xfs/xfs_behavior.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/fs/xfs/xfs_behavior.c	Tue Feb  3 19:45:42 2004
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ *
+ */
+#include "xfs.h"
+
+/*
+ * Source file used to associate/disassociate behaviors with virtualized
+ * objects.  See xfs_behavior.h for more information about behaviors, etc.
+ *
+ * The implementation is split between functions in this file and macros
+ * in xfs_behavior.h.
+ */
+
+/*
+ * Insert a new behavior descriptor into a behavior chain.
+ *
+ * The behavior chain is ordered based on the 'position' number which
+ * lives in the first field of the ops vector (higher numbers first).
+ *
+ * Attemps to insert duplicate ops result in an EINVAL return code.
+ * Otherwise, return 0 to indicate success.
+ */
+int
+bhv_insert(bhv_head_t *bhp, bhv_desc_t *bdp)
+{
+	bhv_desc_t	*curdesc, *prev;
+	int		position;
+
+	/*
+	 * Validate the position value of the new behavior.
+	 */
+	position = BHV_POSITION(bdp);
+	ASSERT(position >= BHV_POSITION_BASE && position <= BHV_POSITION_TOP);
+
+	/*
+	 * Find location to insert behavior.  Check for duplicates.
+	 */
+	prev = NULL;
+	for (curdesc = bhp->bh_first;
+	     curdesc != NULL;
+	     curdesc = curdesc->bd_next) {
+
+		/* Check for duplication. */
+		if (curdesc->bd_ops == bdp->bd_ops) {
+			ASSERT(0);
+			return EINVAL;
+		}
+
+		/* Find correct position */
+		if (position >= BHV_POSITION(curdesc)) {
+			ASSERT(position != BHV_POSITION(curdesc));
+			break;		/* found it */
+		}
+
+		prev = curdesc;
+	}
+
+	if (prev == NULL) {
+		/* insert at front of chain */
+		bdp->bd_next = bhp->bh_first;
+		bhp->bh_first = bdp;
+	} else {
+		/* insert after prev */
+		bdp->bd_next = prev->bd_next;
+		prev->bd_next = bdp;
+	}
+
+	return 0;
+}
+
+/*
+ * Remove a behavior descriptor from a position in a behavior chain;
+ * the postition is guaranteed not to be the first position.
+ * Should only be called by the bhv_remove() macro.
+ */
+void
+bhv_remove_not_first(bhv_head_t *bhp, bhv_desc_t *bdp)
+{
+	bhv_desc_t	*curdesc, *prev;
+
+	ASSERT(bhp->bh_first != NULL);
+	ASSERT(bhp->bh_first->bd_next != NULL);
+
+	prev = bhp->bh_first;
+	for (curdesc = bhp->bh_first->bd_next;
+	     curdesc != NULL;
+	     curdesc = curdesc->bd_next) {
+
+		if (curdesc == bdp)
+			break;		/* found it */
+		prev = curdesc;
+	}
+
+	ASSERT(curdesc == bdp);
+	prev->bd_next = bdp->bd_next;	/* remove from after prev */
+}
+
+/*
+ * Look for a specific ops vector on the specified behavior chain.
+ * Return the associated behavior descriptor.  Or NULL, if not found.
+ */
+bhv_desc_t *
+bhv_lookup(bhv_head_t *bhp, void *ops)
+{
+	bhv_desc_t	*curdesc;
+
+	for (curdesc = bhp->bh_first;
+	     curdesc != NULL;
+	     curdesc = curdesc->bd_next) {
+
+		if (curdesc->bd_ops == ops)
+			return curdesc;
+	}
+
+	return NULL;
+}
+
+/*
+ * Looks for the first behavior within a specified range of positions.
+ * Return the associated behavior descriptor.  Or NULL, if none found.
+ */
+bhv_desc_t *
+bhv_lookup_range(bhv_head_t *bhp, int low, int high)
+{
+	bhv_desc_t	*curdesc;
+
+	for (curdesc = bhp->bh_first;
+	     curdesc != NULL;
+	     curdesc = curdesc->bd_next) {
+
+		int	position = BHV_POSITION(curdesc);
+
+		if (position <= high) {
+			if (position >= low)
+				return curdesc;
+			return NULL;
+		}
+	}
+
+	return NULL;
+}
+
+/*
+ * Return the base behavior in the chain, or NULL if the chain
+ * is empty.
+ *
+ * The caller has not read locked the behavior chain, so acquire the
+ * lock before traversing the chain.
+ */
+bhv_desc_t *
+bhv_base(bhv_head_t *bhp)
+{
+	bhv_desc_t	*curdesc;
+
+	for (curdesc = bhp->bh_first;
+	     curdesc != NULL;
+	     curdesc = curdesc->bd_next) {
+
+		if (curdesc->bd_next == NULL) {
+			return curdesc;
+		}
+	}
+
+	return NULL;
+}
+
+void
+bhv_head_init(
+	bhv_head_t *bhp,
+	char *name)
+{
+	bhp->bh_first = NULL;
+}
+
+void
+bhv_insert_initial(
+	bhv_head_t *bhp,
+	bhv_desc_t *bdp)
+{
+	ASSERT(bhp->bh_first == NULL);
+	(bhp)->bh_first = bdp;
+}
+
+void
+bhv_head_destroy(
+	bhv_head_t *bhp)
+{
+	ASSERT(bhp->bh_first == NULL);
+}
diff -Nru a/fs/xfs/xfs_behavior.h b/fs/xfs/xfs_behavior.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/fs/xfs/xfs_behavior.h	Tue Feb  3 19:45:29 2004
@@ -0,0 +1,204 @@
+/*
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+#ifndef __XFS_BEHAVIOR_H__
+#define __XFS_BEHAVIOR_H__
+
+/*
+ * Header file used to associate behaviors with virtualized objects.
+ *
+ * A virtualized object is an internal, virtualized representation of
+ * OS entities such as persistent files, processes, or sockets.  Examples
+ * of virtualized objects include vnodes, vprocs, and vsockets.  Often
+ * a virtualized object is referred to simply as an "object."
+ *
+ * A behavior is essentially an implementation layer associated with
+ * an object.  Multiple behaviors for an object are chained together,
+ * the order of chaining determining the order of invocation.  Each
+ * behavior of a given object implements the same set of interfaces
+ * (e.g., the VOP interfaces).
+ *
+ * Behaviors may be dynamically inserted into an object's behavior chain,
+ * such that the addition is transparent to consumers that already have
+ * references to the object.  Typically, a given behavior will be inserted
+ * at a particular location in the behavior chain.  Insertion of new
+ * behaviors is synchronized with operations-in-progress (oip's) so that
+ * the oip's always see a consistent view of the chain.
+ *
+ * The term "interpostion" is used to refer to the act of inserting
+ * a behavior such that it interposes on (i.e., is inserted in front
+ * of) a particular other behavior.  A key example of this is when a
+ * system implementing distributed single system image wishes to
+ * interpose a distribution layer (providing distributed coherency)
+ * in front of an object that is otherwise only accessed locally.
+ *
+ * Note that the traditional vnode/inode combination is simply a virtualized
+ * object that has exactly one associated behavior.
+ *
+ * Behavior synchronization is logic which is necessary under certain
+ * circumstances that there is no conflict between ongoing operations
+ * traversing the behavior chain and those dunamically modifying the
+ * behavior chain.  Because behavior synchronization adds extra overhead
+ * to virtual operation invocation, we want to restrict, as much as
+ * we can, the requirement for this extra code, to those situations
+ * in which it is truly necessary.
+ *
+ * Behavior synchronization is needed whenever there's at least one class
+ * of object in the system for which:
+ * 1) multiple behaviors for a given object are supported,
+ * -- AND --
+ * 2a) insertion of a new behavior can happen dynamically at any time during
+ *     the life of an active object,
+ *	-- AND --
+ *	3a) insertion of a new behavior needs to synchronize with existing
+ *	    ops-in-progress.
+ *	-- OR --
+ *	3b) multiple different behaviors can be dynamically inserted at
+ *	    any time during the life of an active object
+ *	-- OR --
+ *	3c) removal of a behavior can occur at any time during the life of
+ *	    an active object.
+ * -- OR --
+ * 2b) removal of a behavior can occur at any time during the life of an
+ *     active object
+ *
+ */
+
+struct bhv_head_lock;
+
+/*
+ * Behavior head.  Head of the chain of behaviors.
+ * Contained within each virtualized object data structure.
+ */
+typedef struct bhv_head {
+	struct bhv_desc *bh_first;	/* first behavior in chain */
+	struct bhv_head_lock *bh_lockp;	/* pointer to lock info struct */
+} bhv_head_t;
+
+/*
+ * Behavior descriptor.	 Descriptor associated with each behavior.
+ * Contained within the behavior's private data structure.
+ */
+typedef struct bhv_desc {
+	void		*bd_pdata;	/* private data for this behavior */
+	void		*bd_vobj;	/* virtual object associated with */
+	void		*bd_ops;	/* ops for this behavior */
+	struct bhv_desc *bd_next;	/* next behavior in chain */
+} bhv_desc_t;
+
+/*
+ * Behavior identity field.  A behavior's identity determines the position
+ * where it lives within a behavior chain, and it's always the first field
+ * of the behavior's ops vector. The optional id field further identifies the
+ * subsystem responsible for the behavior.
+ */
+typedef struct bhv_identity {
+	__u16	bi_id;		/* owning subsystem id */
+	__u16	bi_position;	/* position in chain */
+} bhv_identity_t;
+
+typedef bhv_identity_t bhv_position_t;
+
+#define BHV_IDENTITY_INIT(id,pos)	{id, pos}
+#define BHV_IDENTITY_INIT_POSITION(pos) BHV_IDENTITY_INIT(0, pos)
+
+/*
+ * Define boundaries of position values.
+ */
+#define BHV_POSITION_INVALID	0	/* invalid position number */
+#define BHV_POSITION_BASE	1	/* base (last) implementation layer */
+#define BHV_POSITION_TOP	63	/* top (first) implementation layer */
+
+/*
+ * Plumbing macros.
+ */
+#define BHV_HEAD_FIRST(bhp)	(ASSERT((bhp)->bh_first), (bhp)->bh_first)
+#define BHV_NEXT(bdp)		(ASSERT((bdp)->bd_next), (bdp)->bd_next)
+#define BHV_NEXTNULL(bdp)	((bdp)->bd_next)
+#define BHV_VOBJ(bdp)		(ASSERT((bdp)->bd_vobj), (bdp)->bd_vobj)
+#define BHV_VOBJNULL(bdp)	((bdp)->bd_vobj)
+#define BHV_PDATA(bdp)		(bdp)->bd_pdata
+#define BHV_OPS(bdp)		(bdp)->bd_ops
+#define BHV_IDENTITY(bdp)	((bhv_identity_t *)(bdp)->bd_ops)
+#define BHV_POSITION(bdp)	(BHV_IDENTITY(bdp)->bi_position)
+
+extern void bhv_head_init(bhv_head_t *, char *);
+extern void bhv_head_destroy(bhv_head_t *);
+extern int  bhv_insert(bhv_head_t *, bhv_desc_t *);
+extern void bhv_insert_initial(bhv_head_t *, bhv_desc_t *);
+
+/*
+ * Initialize a new behavior descriptor.
+ * Arguments:
+ *   bdp - pointer to behavior descriptor
+ *   pdata - pointer to behavior's private data
+ *   vobj - pointer to associated virtual object
+ *   ops - pointer to ops for this behavior
+ */
+#define bhv_desc_init(bdp, pdata, vobj, ops)		\
+ {							\
+	(bdp)->bd_pdata = pdata;			\
+	(bdp)->bd_vobj = vobj;				\
+	(bdp)->bd_ops = ops;				\
+	(bdp)->bd_next = NULL;				\
+ }
+
+/*
+ * Remove a behavior descriptor from a behavior chain.
+ */
+#define bhv_remove(bhp, bdp)				\
+ {							\
+	if ((bhp)->bh_first == (bdp)) {			\
+		/*					\
+		* Remove from front of chain.		\
+		* Atomic wrt oip's.			\
+		*/					\
+	       (bhp)->bh_first = (bdp)->bd_next;	\
+	} else {					\
+	       /* remove from non-front of chain */	\
+	       bhv_remove_not_first(bhp, bdp);		\
+	}						\
+	(bdp)->bd_vobj = NULL;				\
+ }
+
+/*
+ * Behavior module prototypes.
+ */
+extern void		bhv_remove_not_first(bhv_head_t *bhp, bhv_desc_t *bdp);
+extern bhv_desc_t *	bhv_lookup(bhv_head_t *bhp, void *ops);
+extern bhv_desc_t *	bhv_lookup_range(bhv_head_t *bhp, int low, int high);
+extern bhv_desc_t *	bhv_base(bhv_head_t *bhp);
+
+/* No bhv locking on Linux */
+#define bhv_lookup_unlocked	bhv_lookup
+#define bhv_base_unlocked	bhv_base
+
+#endif /* __XFS_BEHAVIOR_H__ */
diff -Nru a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
--- a/fs/xfs/xfs_bmap.c	Tue Feb  3 19:45:42 2004
+++ b/fs/xfs/xfs_bmap.c	Tue Feb  3 19:45:42 2004
@@ -68,9 +68,6 @@
 #include "xfs_trans_space.h"
 #include "xfs_buf_item.h"
 
-#ifdef DEBUG
-ktrace_t	*xfs_bmap_trace_buf;
-#endif
 
 #ifdef XFSDEBUG
 STATIC void
@@ -404,7 +401,7 @@
 #define	xfs_bmap_validate_ret(bno,len,flags,mval,onmap,nmap)
 #endif /* DEBUG */
 
-#if defined(DEBUG) && defined(XFS_RW_TRACE)
+#if defined(XFS_RW_TRACE)
 STATIC void
 xfs_bunmap_trace(
 	xfs_inode_t		*ip,
@@ -414,7 +411,7 @@
 	inst_t			*ra);
 #else
 #define	xfs_bunmap_trace(ip, bno, len, flags, ra)
-#endif	/* DEBUG && XFS_RW_TRACE */
+#endif	/* XFS_RW_TRACE */
 
 STATIC int
 xfs_bmap_count_tree(
@@ -3543,6 +3540,8 @@
 
 
 #ifdef XFS_BMAP_TRACE
+ktrace_t	*xfs_bmap_trace_buf;
+
 /*
  * Add a bmap trace buffer entry.  Base routine for the others.
  */
@@ -3575,14 +3574,14 @@
 		(void *)(__psint_t)cnt,
 		(void *)(__psunsigned_t)(ip->i_ino >> 32),
 		(void *)(__psunsigned_t)(unsigned)ip->i_ino,
-		(void *)(__psunsigned_t)(INT_GET(r1->l0, ARCH_CONVERT) >> 32),
-		(void *)(__psunsigned_t)(unsigned)(INT_GET(r1->l0, ARCH_CONVERT)),
-		(void *)(__psunsigned_t)(INT_GET(r1->l1, ARCH_CONVERT) >> 32),
-		(void *)(__psunsigned_t)(unsigned)(INT_GET(r1->l1, ARCH_CONVERT)),
-		(void *)(__psunsigned_t)(INT_GET(r2->l0, ARCH_CONVERT) >> 32),
-		(void *)(__psunsigned_t)(unsigned)(INT_GET(r2->l0, ARCH_CONVERT)),
-		(void *)(__psunsigned_t)(INT_GET(r2->l1, ARCH_CONVERT) >> 32),
-		(void *)(__psunsigned_t)(unsigned)(INT_GET(r2->l1, ARCH_CONVERT))
+		(void *)(__psunsigned_t)(r1->l0 >> 32),
+		(void *)(__psunsigned_t)(unsigned)(r1->l0),
+		(void *)(__psunsigned_t)(r1->l1 >> 32),
+		(void *)(__psunsigned_t)(unsigned)(r1->l1),
+		(void *)(__psunsigned_t)(r2->l0 >> 32),
+		(void *)(__psunsigned_t)(unsigned)(r2->l0),
+		(void *)(__psunsigned_t)(r2->l1 >> 32),
+		(void *)(__psunsigned_t)(unsigned)(r2->l1)
 		);
 	ASSERT(ip->i_xtrace);
 	ktrace_enter(ip->i_xtrace,
@@ -3592,14 +3591,14 @@
 		(void *)(__psint_t)cnt,
 		(void *)(__psunsigned_t)(ip->i_ino >> 32),
 		(void *)(__psunsigned_t)(unsigned)ip->i_ino,
-		(void *)(__psunsigned_t)(INT_GET(r1->l0, ARCH_CONVERT) >> 32),
-		(void *)(__psunsigned_t)(unsigned)(INT_GET(r1->l0, ARCH_CONVERT)),
-		(void *)(__psunsigned_t)(INT_GET(r1->l1, ARCH_CONVERT) >> 32),
-		(void *)(__psunsigned_t)(unsigned)(INT_GET(r1->l1, ARCH_CONVERT)),
-		(void *)(__psunsigned_t)(INT_GET(r2->l0, ARCH_CONVERT) >> 32),
-		(void *)(__psunsigned_t)(unsigned)(INT_GET(r2->l0, ARCH_CONVERT)),
-		(void *)(__psunsigned_t)(INT_GET(r2->l1, ARCH_CONVERT) >> 32),
-		(void *)(__psunsigned_t)(unsigned)(INT_GET(r2->l1, ARCH_CONVERT))
+		(void *)(__psunsigned_t)(r1->l0 >> 32),
+		(void *)(__psunsigned_t)(unsigned)(r1->l0),
+		(void *)(__psunsigned_t)(r1->l1 >> 32),
+		(void *)(__psunsigned_t)(unsigned)(r1->l1),
+		(void *)(__psunsigned_t)(r2->l0 >> 32),
+		(void *)(__psunsigned_t)(unsigned)(r2->l0),
+		(void *)(__psunsigned_t)(r2->l1 >> 32),
+		(void *)(__psunsigned_t)(unsigned)(r2->l1)
 		);
 }
 
@@ -3722,7 +3721,7 @@
 	return rval;
 }
 
-#if defined(DEBUG) && defined(XFS_RW_TRACE)
+#if defined(XFS_RW_TRACE)
 STATIC void
 xfs_bunmap_trace(
 	xfs_inode_t		*ip,
@@ -3742,7 +3741,7 @@
 		(void *)(__psint_t)((xfs_dfiloff_t)bno & 0xffffffff),
 		(void *)(__psint_t)len,
 		(void *)(__psint_t)flags,
-		(void *)(__psint_t)private.p_cpuid,
+		(void *)(unsigned long)current_cpu(),
 		(void *)ra,
 		(void *)0,
 		(void *)0,
diff -Nru a/fs/xfs/xfs_bmap.h b/fs/xfs/xfs_bmap.h
--- a/fs/xfs/xfs_bmap.h	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/xfs_bmap.h	Tue Feb  3 19:45:17 2004
@@ -90,26 +90,6 @@
 #define	DELAYSTARTBLOCK		((xfs_fsblock_t)-1LL)
 #define	HOLESTARTBLOCK		((xfs_fsblock_t)-2LL)
 
-/*
- * Trace operations for bmap extent tracing
- */
-#define	XFS_BMAP_KTRACE_DELETE	1
-#define	XFS_BMAP_KTRACE_INSERT	2
-#define	XFS_BMAP_KTRACE_PRE_UP	3
-#define	XFS_BMAP_KTRACE_POST_UP	4
-
-#define	XFS_BMAP_TRACE_SIZE	4096	/* size of global trace buffer */
-#define	XFS_BMAP_KTRACE_SIZE	32	/* size of per-inode trace buffer */
-
-#if defined(XFS_ALL_TRACE)
-#define	XFS_BMAP_TRACE
-#endif
-
-#if !defined(DEBUG)
-#undef	XFS_BMAP_TRACE
-#endif
-
-
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_INIT)
 void xfs_bmap_init(xfs_bmap_free_t *flp, xfs_fsblock_t *fbp);
 #define	XFS_BMAP_INIT(flp,fbp)	xfs_bmap_init(flp,fbp)
@@ -142,6 +122,33 @@
 } xfs_bmalloca_t;
 
 #ifdef __KERNEL__
+
+#if defined(XFS_BMAP_TRACE)
+/*
+ * Trace operations for bmap extent tracing
+ */
+#define	XFS_BMAP_KTRACE_DELETE	1
+#define	XFS_BMAP_KTRACE_INSERT	2
+#define	XFS_BMAP_KTRACE_PRE_UP	3
+#define	XFS_BMAP_KTRACE_POST_UP	4
+
+#define	XFS_BMAP_TRACE_SIZE	4096	/* size of global trace buffer */
+#define	XFS_BMAP_KTRACE_SIZE	32	/* size of per-inode trace buffer */
+extern ktrace_t	*xfs_bmap_trace_buf;
+
+/*
+ * Add bmap trace insert entries for all the contents of the extent list.
+ */
+void
+xfs_bmap_trace_exlist(
+	char			*fname,		/* function name */
+	struct xfs_inode	*ip,		/* incore inode pointer */
+	xfs_extnum_t		cnt,		/* count of entries in list */
+	int			whichfork);	/* data or attr fork */
+#else
+#define	xfs_bmap_trace_exlist(f,ip,c,w)
+#endif
+
 /*
  * Convert inode from non-attributed to attributed.
  * Must not be in a transaction, ip must not be locked.
@@ -260,20 +267,6 @@
 	struct xfs_inode	*ip,		/* incore inode */
 	int			whichfork);	/* data or attr fork */
 
-#if defined(XFS_BMAP_TRACE)
-/*
- * Add bmap trace insert entries for all the contents of the extent list.
- */
-void
-xfs_bmap_trace_exlist(
-	char			*fname,		/* function name */
-	struct xfs_inode	*ip,		/* incore inode pointer */
-	xfs_extnum_t		cnt,		/* count of entries in list */
-	int			whichfork);	/* data or attr fork */
-#else
-#define	xfs_bmap_trace_exlist(f,ip,c,w)
-#endif
-
 /*
  * Map file blocks to filesystem blocks.
  * File range is given by the bno/len pair.
@@ -375,7 +368,7 @@
 int
 xfs_bmap_count_blocks(
 	xfs_trans_t		*tp,
-	xfs_inode_t		*ip,
+	struct xfs_inode	*ip,
 	int			whichfork,
 	int			*count);
 
diff -Nru a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c
--- a/fs/xfs/xfs_bmap_btree.c	Tue Feb  3 19:45:28 2004
+++ b/fs/xfs/xfs_bmap_btree.c	Tue Feb  3 19:45:28 2004
@@ -61,7 +61,7 @@
 #include "xfs_error.h"
 #include "xfs_quota.h"
 
-#ifdef DEBUG
+#if defined(XFS_BMBT_TRACE)
 ktrace_t	*xfs_bmbt_trace_buf;
 #endif
 
@@ -81,6 +81,13 @@
 
 
 #if defined(XFS_BMBT_TRACE)
+
+static char	ARGS[] = "args";
+static char	ENTRY[] = "entry";
+static char	ERROR[] = "error";
+#undef EXIT
+static char	EXIT[] = "exit";
+
 /*
  * Add a trace buffer entry for the arguments given to the routine,
  * generic form.
@@ -305,11 +312,6 @@
 	xfs_bmbt_trace_argik(fname, c, i, k, __LINE__)
 #define	XFS_BMBT_TRACE_CURSOR(c,s)	\
 	xfs_bmbt_trace_cursor(fname, c, s, __LINE__)
-static char	ARGS[] = "args";
-static char	ENTRY[] = "entry";
-static char	ERROR[] = "error";
-#undef EXIT
-static char	EXIT[] = "exit";
 #else
 #define	XFS_BMBT_TRACE_ARGBI(c,b,i)
 #define	XFS_BMBT_TRACE_ARGBII(c,b,i,j)
diff -Nru a/fs/xfs/xfs_bmap_btree.h b/fs/xfs/xfs_bmap_btree.h
--- a/fs/xfs/xfs_bmap_btree.h	Tue Feb  3 19:45:26 2004
+++ b/fs/xfs/xfs_bmap_btree.h	Tue Feb  3 19:45:26 2004
@@ -435,6 +435,10 @@
 	 INT_GET((bb)->bb_numrecs, ARCH_CONVERT) <= (mp)->m_bmap_dmxr[(level) != 0])
 #endif
 
+
+#ifdef __KERNEL__
+
+#if defined(XFS_BMBT_TRACE)
 /*
  * Trace buffer entry types.
  */
@@ -449,17 +453,8 @@
 
 #define XFS_BMBT_TRACE_SIZE	4096	/* size of global trace buffer */
 #define XFS_BMBT_KTRACE_SIZE	32	/* size of per-inode trace buffer */
-
-#if defined(XFS_ALL_TRACE)
-#define XFS_BMBT_TRACE
+extern ktrace_t	*xfs_bmbt_trace_buf;
 #endif
-
-#if !defined(DEBUG)
-#undef XFS_BMBT_TRACE
-#endif
-
-
-#ifdef __KERNEL__
 
 /*
  * Prototypes for xfs_bmap.c to call.
diff -Nru a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h
--- a/fs/xfs/xfs_buf.h	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,317 +0,0 @@
-/*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
- */
-#ifndef __XFS_BUF_H__
-#define __XFS_BUF_H__
-
-/* These are just for xfs_syncsub... it sets an internal variable
- * then passes it to VOP_FLUSH_PAGES or adds the flags to a newly gotten buf_t
- */
-#define XFS_B_ASYNC		PBF_ASYNC
-#define XFS_B_DELWRI		PBF_DELWRI
-#define XFS_B_READ		PBF_READ
-#define XFS_B_WRITE		PBF_WRITE
-#define XFS_B_STALE		PBF_STALE
-
-#define XFS_BUF_TRYLOCK		PBF_TRYLOCK
-#define XFS_INCORE_TRYLOCK	PBF_TRYLOCK
-#define XFS_BUF_LOCK		PBF_LOCK
-#define XFS_BUF_MAPPED		PBF_MAPPED
-
-#define BUF_BUSY		PBF_DONT_BLOCK
-
-#define XFS_BUF_BFLAGS(x)	((x)->pb_flags)
-#define XFS_BUF_ZEROFLAGS(x)	\
-	((x)->pb_flags &= ~(PBF_READ|PBF_WRITE|PBF_ASYNC|PBF_SYNC|PBF_DELWRI))
-
-#define XFS_BUF_STALE(x)	((x)->pb_flags |= XFS_B_STALE)
-#define XFS_BUF_UNSTALE(x)	((x)->pb_flags &= ~XFS_B_STALE)
-#define XFS_BUF_ISSTALE(x)	((x)->pb_flags & XFS_B_STALE)
-#define XFS_BUF_SUPER_STALE(x)	do {				\
-					XFS_BUF_STALE(x);	\
-					xfs_buf_undelay(x);	\
-					XFS_BUF_DONE(x);	\
-				} while (0)
-
-#define XFS_BUF_MANAGE		PBF_FS_MANAGED
-#define XFS_BUF_UNMANAGE(x)	((x)->pb_flags &= ~PBF_FS_MANAGED)
-
-static inline void xfs_buf_undelay(page_buf_t *pb)
-{
-	if (pb->pb_flags & PBF_DELWRI) {
-		if (pb->pb_list.next != &pb->pb_list) {
-			pagebuf_delwri_dequeue(pb);
-			pagebuf_rele(pb);
-		} else {
-			pb->pb_flags &= ~PBF_DELWRI;
-		}
-	}
-}
-
-#define XFS_BUF_DELAYWRITE(x)	 ((x)->pb_flags |= PBF_DELWRI)
-#define XFS_BUF_UNDELAYWRITE(x)	 xfs_buf_undelay(x)
-#define XFS_BUF_ISDELAYWRITE(x)	 ((x)->pb_flags & PBF_DELWRI)
-
-#define XFS_BUF_ERROR(x,no)	 pagebuf_ioerror(x,no)
-#define XFS_BUF_GETERROR(x)	 pagebuf_geterror(x)
-#define XFS_BUF_ISERROR(x)	 (pagebuf_geterror(x)?1:0)
-
-#define XFS_BUF_DONE(x)		 ((x)->pb_flags &= ~(PBF_PARTIAL|PBF_NONE))
-#define XFS_BUF_UNDONE(x)	 ((x)->pb_flags |= PBF_PARTIAL|PBF_NONE)
-#define XFS_BUF_ISDONE(x)	 (!(PBF_NOT_DONE(x)))
-
-#define XFS_BUF_BUSY(x)		 ((x)->pb_flags |= PBF_FORCEIO)
-#define XFS_BUF_UNBUSY(x)	 ((x)->pb_flags &= ~PBF_FORCEIO)
-#define XFS_BUF_ISBUSY(x)	 (1)
-
-#define XFS_BUF_ASYNC(x)	 ((x)->pb_flags |= PBF_ASYNC)
-#define XFS_BUF_UNASYNC(x)	 ((x)->pb_flags &= ~PBF_ASYNC)
-#define XFS_BUF_ISASYNC(x)	 ((x)->pb_flags & PBF_ASYNC)
-
-#define XFS_BUF_FLUSH(x)	 ((x)->pb_flags |= PBF_FLUSH)
-#define XFS_BUF_UNFLUSH(x)	 ((x)->pb_flags &= ~PBF_FLUSH)
-#define XFS_BUF_ISFLUSH(x)	 ((x)->pb_flags & PBF_FLUSH)
-
-#define XFS_BUF_SHUT(x)		 printk("XFS_BUF_SHUT not implemented yet\n")
-#define XFS_BUF_UNSHUT(x)	 printk("XFS_BUF_UNSHUT not implemented yet\n")
-#define XFS_BUF_ISSHUT(x)	 (0)
-
-#define XFS_BUF_HOLD(x)		pagebuf_hold(x)
-#define XFS_BUF_READ(x)		((x)->pb_flags |= PBF_READ)
-#define XFS_BUF_UNREAD(x)	((x)->pb_flags &= ~PBF_READ)
-#define XFS_BUF_ISREAD(x)	((x)->pb_flags & PBF_READ)
-
-#define XFS_BUF_WRITE(x)	((x)->pb_flags |= PBF_WRITE)
-#define XFS_BUF_UNWRITE(x)	((x)->pb_flags &= ~PBF_WRITE)
-#define XFS_BUF_ISWRITE(x)	((x)->pb_flags & PBF_WRITE)
-
-#define XFS_BUF_ISUNINITIAL(x)	 (0)
-#define XFS_BUF_UNUNINITIAL(x)	 (0)
-
-#define XFS_BUF_BP_ISMAPPED(bp)	 1
-
-typedef struct page_buf_s xfs_buf_t;
-#define xfs_buf page_buf_s
-
-typedef struct pb_target xfs_buftarg_t;
-#define xfs_buftarg pb_target
-
-#define XFS_BUF_DATAIO(x)	((x)->pb_flags |= PBF_FS_DATAIOD)
-#define XFS_BUF_UNDATAIO(x)	((x)->pb_flags &= ~PBF_FS_DATAIOD)
-
-#define XFS_BUF_IODONE_FUNC(buf)	(buf)->pb_iodone
-#define XFS_BUF_SET_IODONE_FUNC(buf, func)	\
-			(buf)->pb_iodone = (func)
-#define XFS_BUF_CLR_IODONE_FUNC(buf)		\
-			(buf)->pb_iodone = NULL
-#define XFS_BUF_SET_BDSTRAT_FUNC(buf, func)	\
-			(buf)->pb_strat = (func)
-#define XFS_BUF_CLR_BDSTRAT_FUNC(buf)		\
-			(buf)->pb_strat = NULL
-
-#define XFS_BUF_FSPRIVATE(buf, type)		\
-			((type)(buf)->pb_fspriv)
-#define XFS_BUF_SET_FSPRIVATE(buf, value)	\
-			(buf)->pb_fspriv = (void *)(value)
-#define XFS_BUF_FSPRIVATE2(buf, type)		\
-			((type)(buf)->pb_fspriv2)
-#define XFS_BUF_SET_FSPRIVATE2(buf, value)	\
-			(buf)->pb_fspriv2 = (void *)(value)
-#define XFS_BUF_FSPRIVATE3(buf, type)		\
-			((type)(buf)->pb_fspriv3)
-#define XFS_BUF_SET_FSPRIVATE3(buf, value)	\
-			(buf)->pb_fspriv3  = (void *)(value)
-#define XFS_BUF_SET_START(buf)
-
-#define XFS_BUF_SET_BRELSE_FUNC(buf, value) \
-			(buf)->pb_relse = (value)
-
-#define XFS_BUF_PTR(bp)		(xfs_caddr_t)((bp)->pb_addr)
-
-extern inline xfs_caddr_t xfs_buf_offset(page_buf_t *bp, size_t offset)
-{
-	if (bp->pb_flags & PBF_MAPPED)
-		return XFS_BUF_PTR(bp) + offset;
-	return (xfs_caddr_t) pagebuf_offset(bp, offset);
-}
-
-#define XFS_BUF_SET_PTR(bp, val, count)		\
-				pagebuf_associate_memory(bp, val, count)
-#define XFS_BUF_ADDR(bp)	((bp)->pb_bn)
-#define XFS_BUF_SET_ADDR(bp, blk)		\
-			((bp)->pb_bn = (page_buf_daddr_t)(blk))
-#define XFS_BUF_OFFSET(bp)	((bp)->pb_file_offset)
-#define XFS_BUF_SET_OFFSET(bp, off)		\
-			((bp)->pb_file_offset = (off))
-#define XFS_BUF_COUNT(bp)	((bp)->pb_count_desired)
-#define XFS_BUF_SET_COUNT(bp, cnt)		\
-			((bp)->pb_count_desired = (cnt))
-#define XFS_BUF_SIZE(bp)	((bp)->pb_buffer_length)
-#define XFS_BUF_SET_SIZE(bp, cnt)		\
-			((bp)->pb_buffer_length = (cnt))
-#define XFS_BUF_SET_VTYPE_REF(bp, type, ref)
-#define XFS_BUF_SET_VTYPE(bp, type)
-#define XFS_BUF_SET_REF(bp, ref)
-
-#define XFS_BUF_ISPINNED(bp)   pagebuf_ispin(bp)
-
-#define XFS_BUF_VALUSEMA(bp)	pagebuf_lock_value(bp)
-#define XFS_BUF_CPSEMA(bp)	(pagebuf_cond_lock(bp) == 0)
-#define XFS_BUF_VSEMA(bp)	pagebuf_unlock(bp)
-#define XFS_BUF_PSEMA(bp,x)	pagebuf_lock(bp)
-#define XFS_BUF_V_IODONESEMA(bp) up(&bp->pb_iodonesema);
-
-/* setup the buffer target from a buftarg structure */
-#define XFS_BUF_SET_TARGET(bp, target)	\
-	(bp)->pb_target = (target)
-
-#define XFS_BUF_TARGET(bp)	((bp)->pb_target)
-
-#define XFS_BUFTARG_NAME(target) \
-	({ char __b[BDEVNAME_SIZE]; bdevname((target->pbr_bdev), __b); __b; })
-	
-#define XFS_BUF_SET_VTYPE_REF(bp, type, ref)
-#define XFS_BUF_SET_VTYPE(bp, type)
-#define XFS_BUF_SET_REF(bp, ref)
-
-#define xfs_buf_read(target, blkno, len, flags) \
-		pagebuf_get((target), (blkno), (len), \
-			PBF_LOCK | PBF_READ | PBF_MAPPED | PBF_MAPPABLE)
-#define xfs_buf_get(target, blkno, len, flags) \
-		pagebuf_get((target), (blkno), (len), \
-			PBF_LOCK | PBF_MAPPED | PBF_MAPPABLE)
-
-#define xfs_buf_read_flags(target, blkno, len, flags) \
-		pagebuf_get((target), (blkno), (len), \
-			PBF_READ | PBF_MAPPABLE | flags)
-#define xfs_buf_get_flags(target, blkno, len, flags) \
-		pagebuf_get((target), (blkno), (len), \
-			PBF_MAPPABLE | flags)
-
-static inline int	xfs_bawrite(void *mp, page_buf_t *bp)
-{
-	bp->pb_fspriv3 = mp;
-	bp->pb_strat = xfs_bdstrat_cb;
-	xfs_buf_undelay(bp);
-	return pagebuf_iostart(bp, PBF_WRITE | PBF_ASYNC | PBF_RUN_QUEUES);
-}
-
-static inline void	xfs_buf_relse(page_buf_t *bp)
-{
-	if ((bp->pb_flags & _PBF_LOCKABLE) && !bp->pb_relse)
-		pagebuf_unlock(bp);
-	pagebuf_rele(bp);
-}
-
-
-#define xfs_bpin(bp)		pagebuf_pin(bp)
-#define xfs_bunpin(bp)		pagebuf_unpin(bp)
-
-#ifdef PAGEBUF_TRACE
-# define PB_DEFINE_TRACES
-# include <pagebuf/page_buf_trace.h>
-# define xfs_buftrace(id, bp)	PB_TRACE(bp, PB_TRACE_REC(external), (void *)id)
-#else
-# define xfs_buftrace(id, bp)	do { } while (0)
-#endif
-
-
-#define xfs_biodone(pb)		    \
-	    pagebuf_iodone(pb, (pb->pb_flags & PBF_FS_DATAIOD), 0)
-
-#define xfs_incore(buftarg,blkno,len,lockit) \
-	    pagebuf_find(buftarg, blkno ,len, lockit)
-
-
-#define xfs_biomove(pb, off, len, data, rw) \
-	    pagebuf_iomove((pb), (off), (len), (data), \
-		((rw) == XFS_B_WRITE) ? PBRW_WRITE : PBRW_READ)
-
-#define xfs_biozero(pb, off, len) \
-	    pagebuf_iomove((pb), (off), (len), NULL, PBRW_ZERO)
-
-
-static inline int	XFS_bwrite(page_buf_t *pb)
-{
-	int	iowait = (pb->pb_flags & PBF_ASYNC) == 0;
-	int	error = 0;
-
-	pb->pb_flags |= PBF_SYNC;
-	if (!iowait)
-		pb->pb_flags |= PBF_RUN_QUEUES;
-
-	xfs_buf_undelay(pb);
-	pagebuf_iostrategy(pb);
-	if (iowait) {
-		error = pagebuf_iowait(pb);
-		xfs_buf_relse(pb);
-	}
-	return error;
-}
-
-#define XFS_bdwrite(pb)		     \
-	    pagebuf_iostart(pb, PBF_DELWRI | PBF_ASYNC)
-
-static inline int xfs_bdwrite(void *mp, page_buf_t *bp)
-{
-	bp->pb_strat = xfs_bdstrat_cb;
-	bp->pb_fspriv3 = mp;
-
-	return pagebuf_iostart(bp, PBF_DELWRI | PBF_ASYNC);
-}
-
-#define XFS_bdstrat(bp) pagebuf_iorequest(bp)
-
-#define xfs_iowait(pb)	pagebuf_iowait(pb)
-
-
-/*
- * Go through all incore buffers, and release buffers
- * if they belong to the given device. This is used in
- * filesystem error handling to preserve the consistency
- * of its metadata.
- */
-
-#define xfs_binval(buftarg)	xfs_flush_buftarg(buftarg)
-
-#define XFS_bflush(buftarg)	xfs_flush_buftarg(buftarg)
-
-#define xfs_incore_relse(buftarg,delwri_only,wait)	\
-	xfs_relse_buftarg(buftarg)
-
-#define xfs_baread(target, rablkno, ralen)  \
-	pagebuf_readahead((target), (rablkno), (ralen), PBF_DONT_BLOCK)
-
-#define xfs_buf_get_empty(len, target)	pagebuf_get_empty((len), (target))
-#define xfs_buf_get_noaddr(len, target)	pagebuf_get_no_daddr((len), (target))
-#define xfs_buf_free(bp)		pagebuf_free(bp)
-
-#endif	/* __XFS_BUF_H__ */
diff -Nru a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
--- a/fs/xfs/xfs_buf_item.c	Tue Feb  3 19:45:16 2004
+++ b/fs/xfs/xfs_buf_item.c	Tue Feb  3 19:45:16 2004
@@ -1207,13 +1207,14 @@
 		     (void *)((unsigned long)bip->bli_flags),
 		     (void *)((unsigned long)bip->bli_recur),
 		     (void *)((unsigned long)atomic_read(&bip->bli_refcount)),
-		     (void *)XFS_BUF_ADDR(bp),
+		     (void *)((unsigned long)
+				(0xFFFFFFFF & XFS_BUF_ADDR(bp) >> 32)),
+		     (void *)((unsigned long)(0xFFFFFFFF & XFS_BUF_ADDR(bp))),
 		     (void *)((unsigned long)XFS_BUF_COUNT(bp)),
-		     (void *)((unsigned long)(0xFFFFFFFF & (XFS_BFLAGS(bp) >> 32))),
-		     (void *)((unsigned long)(0xFFFFFFFF & XFS_BFLAGS(bp))),
+		     (void *)((unsigned long)XFS_BUF_BFLAGS(bp)),
 		     XFS_BUF_FSPRIVATE(bp, void *),
 		     XFS_BUF_FSPRIVATE2(bp, void *),
-		     (void *)((unsigned long)bp->b_pincount),
+		     (void *)(unsigned long)XFS_BUF_ISPINNED(bp),
 		     (void *)XFS_BUF_IODONE_FUNC(bp),
 		     (void *)((unsigned long)(XFS_BUF_VALUSEMA(bp))),
 		     (void *)bip->bli_item.li_desc,
diff -Nru a/fs/xfs/xfs_buf_item.h b/fs/xfs/xfs_buf_item.h
--- a/fs/xfs/xfs_buf_item.h	Tue Feb  3 19:45:34 2004
+++ b/fs/xfs/xfs_buf_item.h	Tue Feb  3 19:45:34 2004
@@ -104,6 +104,15 @@
 struct xfs_buf;
 struct ktrace;
 struct xfs_mount;
+struct xfs_buf_log_item;
+
+#if defined(XFS_BLI_TRACE)
+#define	XFS_BLI_TRACE_SIZE	32
+
+void	xfs_buf_item_trace(char *, struct xfs_buf_log_item *);
+#else
+#define	xfs_buf_item_trace(id, bip)
+#endif
 
 /*
  * This is the in core log item structure used to track information
@@ -116,7 +125,7 @@
 	unsigned int		bli_flags;	/* misc flags */
 	unsigned int		bli_recur;	/* lock recursion count */
 	atomic_t		bli_refcount;	/* cnt of tp refs */
-#ifdef DEBUG
+#ifdef XFS_BLI_TRACE
 	struct ktrace		*bli_trace;	/* event trace buf */
 #endif
 #ifdef XFS_TRANS_DEBUG
@@ -136,23 +145,6 @@
 	int			bc_refcount;
 	struct xfs_buf_cancel	*bc_next;
 } xfs_buf_cancel_t;
-
-#define	XFS_BLI_TRACE_SIZE	32
-
-
-#if defined(XFS_ALL_TRACE)
-#define	XFS_BLI_TRACE
-#endif
-
-#if !defined(DEBUG)
-#undef XFS_BLI_TRACE
-#endif
-
-#if defined(XFS_BLI_TRACE)
-void	xfs_buf_item_trace(char *, xfs_buf_log_item_t *);
-#else
-#define	xfs_buf_item_trace(id, bip)
-#endif
 
 void	xfs_buf_item_init(struct xfs_buf *, struct xfs_mount *);
 void	xfs_buf_item_relse(struct xfs_buf *);
diff -Nru a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c
--- a/fs/xfs/xfs_da_btree.c	Tue Feb  3 19:45:36 2004
+++ b/fs/xfs/xfs_da_btree.c	Tue Feb  3 19:45:36 2004
@@ -66,13 +66,6 @@
 #include "xfs_error.h"
 #include "xfs_bit.h"
 
-#if defined(XFSDEBUG) && defined(CONFIG_KDB)
-#undef xfs_buftrace
-#define xfs_buftrace(A,B) \
-	printk("    xfs_buftrace : %s (0x%p)\n", A, B); \
-	BUG();
-#endif
-
 /*
  * xfs_da_btree.c
  *
diff -Nru a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c
--- a/fs/xfs/xfs_dfrag.c	Tue Feb  3 19:45:16 2004
+++ b/fs/xfs/xfs_dfrag.c	Tue Feb  3 19:45:16 2004
@@ -153,12 +153,12 @@
 	if ((error = _MAC_XFS_IACCESS(tip, MACWRITE, NULL))) {
 		goto error0;
 	}
-	if ((current->fsuid != ip->i_d.di_uid) &&
+	if ((current_fsuid(cred) != ip->i_d.di_uid) &&
 	    (error = xfs_iaccess(ip, S_IWUSR, NULL)) &&
 	    !capable_cred(NULL, CAP_FOWNER)) {
 		goto error0;
 	}
-	if ((current->fsuid != tip->i_d.di_uid) &&
+	if ((current_fsuid(cred) != tip->i_d.di_uid) &&
 	    (error = xfs_iaccess(tip, S_IWUSR, NULL)) &&
 	    !capable_cred(NULL, CAP_FOWNER)) {
 		goto error0;
diff -Nru a/fs/xfs/xfs_dir.c b/fs/xfs/xfs_dir.c
--- a/fs/xfs/xfs_dir.c	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/xfs_dir.c	Tue Feb  3 19:45:17 2004
@@ -162,7 +162,7 @@
 					     xfs_dir_put_t put);
 STATIC int xfs_dir_node_replace(xfs_da_args_t *args);
 
-#if defined(DEBUG)
+#if defined(XFS_DIR_TRACE)
 ktrace_t *xfs_dir_trace_buf;
 #endif
 
@@ -1093,10 +1093,10 @@
 xfs_dir_trace_g_du(char *where, xfs_inode_t *dp, uio_t *uio)
 {
 	xfs_dir_trace_enter(XFS_DIR_KTRACE_G_DU, where,
-		     (__psunsigned_t)dp, (__psunsigned_t)dp->i_mount,
-		     (__psunsigned_t)(uio->uio_offset >> 32),
-		     (__psunsigned_t)(uio->uio_offset & 0xFFFFFFFF),
-		     (__psunsigned_t)uio->uio_resid,
+		     (void *)dp, (void *)dp->i_mount,
+		     (void *)((unsigned long)(uio->uio_offset >> 32)),
+		     (void *)((unsigned long)(uio->uio_offset & 0xFFFFFFFF)),
+		     (void *)(unsigned long)uio->uio_resid,
 		     NULL, NULL, NULL, NULL, NULL, NULL, NULL);
 }
 
@@ -1107,11 +1107,11 @@
 xfs_dir_trace_g_dub(char *where, xfs_inode_t *dp, uio_t *uio, xfs_dablk_t bno)
 {
 	xfs_dir_trace_enter(XFS_DIR_KTRACE_G_DUB, where,
-		     (__psunsigned_t)dp, (__psunsigned_t)dp->i_mount,
-		     (__psunsigned_t)(uio->uio_offset >> 32),
-		     (__psunsigned_t)(uio->uio_offset & 0xFFFFFFFF),
-		     (__psunsigned_t)uio->uio_resid,
-		     (__psunsigned_t)bno,
+		     (void *)dp, (void *)dp->i_mount,
+		     (void *)((unsigned long)(uio->uio_offset >> 32)),
+		     (void *)((unsigned long)(uio->uio_offset & 0xFFFFFFFF)),
+		     (void *)(unsigned long)uio->uio_resid,
+		     (void *)(unsigned long)bno,
 		     NULL, NULL, NULL, NULL, NULL, NULL);
 }
 
@@ -1122,15 +1122,21 @@
 xfs_dir_trace_g_dun(char *where, xfs_inode_t *dp, uio_t *uio,
 			xfs_da_intnode_t *node)
 {
+	int	last = INT_GET(node->hdr.count, ARCH_CONVERT) - 1;
+
 	xfs_dir_trace_enter(XFS_DIR_KTRACE_G_DUN, where,
-		     (__psunsigned_t)dp, (__psunsigned_t)dp->i_mount,
-		     (__psunsigned_t)(uio->uio_offset >> 32),
-		     (__psunsigned_t)(uio->uio_offset & 0xFFFFFFFF),
-		     (__psunsigned_t)uio->uio_resid,
-		     (__psunsigned_t)INT_GET(node->hdr.info.forw, ARCH_CONVERT),
-		     (__psunsigned_t)INT_GET(node->hdr.count, ARCH_CONVERT),
-		     (__psunsigned_t)INT_GET(node->btree[0].hashval, ARCH_CONVERT),
-		     (__psunsigned_t)INT_GET(node->btree[INT_GET(node->hdr.count, ARCH_CONVERT)-1].hashval, ARCH_CONVERT),
+		     (void *)dp, (void *)dp->i_mount,
+		     (void *)((unsigned long)(uio->uio_offset >> 32)),
+		     (void *)((unsigned long)(uio->uio_offset & 0xFFFFFFFF)),
+		     (void *)(unsigned long)uio->uio_resid,
+		     (void *)(unsigned long)
+			INT_GET(node->hdr.info.forw, ARCH_CONVERT),
+		     (void *)(unsigned long)
+			INT_GET(node->hdr.count, ARCH_CONVERT),
+		     (void *)(unsigned long)
+			INT_GET(node->btree[0].hashval, ARCH_CONVERT),
+		     (void *)(unsigned long)
+			INT_GET(node->btree[last].hashval, ARCH_CONVERT),
 		     NULL, NULL, NULL);
 }
 
@@ -1141,15 +1147,21 @@
 xfs_dir_trace_g_dul(char *where, xfs_inode_t *dp, uio_t *uio,
 			xfs_dir_leafblock_t *leaf)
 {
+	int	last = INT_GET(leaf->hdr.count, ARCH_CONVERT) - 1;
+
 	xfs_dir_trace_enter(XFS_DIR_KTRACE_G_DUL, where,
-		     (__psunsigned_t)dp, (__psunsigned_t)dp->i_mount,
-		     (__psunsigned_t)(uio->uio_offset >> 32),
-		     (__psunsigned_t)(uio->uio_offset & 0xFFFFFFFF),
-		     (__psunsigned_t)uio->uio_resid,
-		     (__psunsigned_t)INT_GET(leaf->hdr.info.forw, ARCH_CONVERT),
-		     (__psunsigned_t)INT_GET(leaf->hdr.count, ARCH_CONVERT),
-		     (__psunsigned_t)INT_GET(leaf->entries[0].hashval, ARCH_CONVERT),
-		     (__psunsigned_t)INT_GET(leaf->entries[ INT_GET(leaf->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT),
+		     (void *)dp, (void *)dp->i_mount,
+		     (void *)((unsigned long)(uio->uio_offset >> 32)),
+		     (void *)((unsigned long)(uio->uio_offset & 0xFFFFFFFF)),
+		     (void *)(unsigned long)uio->uio_resid,
+		     (void *)(unsigned long)
+			INT_GET(leaf->hdr.info.forw, ARCH_CONVERT),
+		     (void *)(unsigned long)
+			INT_GET(leaf->hdr.count, ARCH_CONVERT),
+		     (void *)(unsigned long)
+			INT_GET(leaf->entries[0].hashval, ARCH_CONVERT),
+		     (void *)(unsigned long)
+			INT_GET(leaf->entries[last].hashval, ARCH_CONVERT),
 		     NULL, NULL, NULL);
 }
 
@@ -1161,11 +1173,12 @@
 			xfs_dir_leaf_entry_t *entry)
 {
 	xfs_dir_trace_enter(XFS_DIR_KTRACE_G_DUE, where,
-		     (__psunsigned_t)dp, (__psunsigned_t)dp->i_mount,
-		     (__psunsigned_t)(uio->uio_offset >> 32),
-		     (__psunsigned_t)(uio->uio_offset & 0xFFFFFFFF),
-		     (__psunsigned_t)uio->uio_resid,
-		     (__psunsigned_t)INT_GET(entry->hashval, ARCH_CONVERT),
+		     (void *)dp, (void *)dp->i_mount,
+		     (void *)((unsigned long)(uio->uio_offset >> 32)),
+		     (void *)((unsigned long)(uio->uio_offset & 0xFFFFFFFF)),
+		     (void *)(unsigned long)uio->uio_resid,
+		     (void *)(unsigned long)
+			INT_GET(entry->hashval, ARCH_CONVERT),
 		     NULL, NULL, NULL, NULL, NULL, NULL);
 }
 
@@ -1176,12 +1189,12 @@
 xfs_dir_trace_g_duc(char *where, xfs_inode_t *dp, uio_t *uio, xfs_off_t cookie)
 {
 	xfs_dir_trace_enter(XFS_DIR_KTRACE_G_DUC, where,
-		     (__psunsigned_t)dp, (__psunsigned_t)dp->i_mount,
-		     (__psunsigned_t)(uio->uio_offset >> 32),
-		     (__psunsigned_t)(uio->uio_offset & 0xFFFFFFFF),
-		     (__psunsigned_t)uio->uio_resid,
-		     (__psunsigned_t)(cookie >> 32),
-		     (__psunsigned_t)(cookie & 0xFFFFFFFF),
+		     (void *)dp, (void *)dp->i_mount,
+		     (void *)((unsigned long)(uio->uio_offset >> 32)),
+		     (void *)((unsigned long)(uio->uio_offset & 0xFFFFFFFF)),
+		     (void *)(unsigned long)uio->uio_resid,
+		     (void *)((unsigned long)(cookie >> 32)),
+		     (void *)((unsigned long)(cookie & 0xFFFFFFFF)),
 		     NULL, NULL, NULL, NULL, NULL);
 }
 
@@ -1191,15 +1204,15 @@
  */
 void
 xfs_dir_trace_enter(int type, char *where,
-			__psunsigned_t a0, __psunsigned_t a1,
-			__psunsigned_t a2, __psunsigned_t a3,
-			__psunsigned_t a4, __psunsigned_t a5,
-			__psunsigned_t a6, __psunsigned_t a7,
-			__psunsigned_t a8, __psunsigned_t a9,
-			__psunsigned_t a10, __psunsigned_t a11)
+			void * a0, void * a1,
+			void * a2, void * a3,
+			void * a4, void * a5,
+			void * a6, void * a7,
+			void * a8, void * a9,
+			void * a10, void * a11)
 {
 	ASSERT(xfs_dir_trace_buf);
-	ktrace_enter(xfs_dir_trace_buf, (void *)((__psunsigned_t)type),
+	ktrace_enter(xfs_dir_trace_buf, (void *)(unsigned long)type,
 					(void *)where,
 					(void *)a0, (void *)a1, (void *)a2,
 					(void *)a3, (void *)a4, (void *)a5,
diff -Nru a/fs/xfs/xfs_dir.h b/fs/xfs/xfs_dir.h
--- a/fs/xfs/xfs_dir.h	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/xfs_dir.h	Tue Feb  3 19:45:17 2004
@@ -43,14 +43,6 @@
  * as possible so as to fit into the literal area of the inode.
  */
 
-#ifdef XFS_ALL_TRACE
-#define	XFS_DIR_TRACE
-#endif
-
-#if !defined(DEBUG)
-#undef XFS_DIR_TRACE
-#endif
-
 /*========================================================================
  * Function prototypes for the kernel.
  *========================================================================*/
diff -Nru a/fs/xfs/xfs_dir2_trace.c b/fs/xfs/xfs_dir2_trace.c
--- a/fs/xfs/xfs_dir2_trace.c	Tue Feb  3 19:45:40 2004
+++ b/fs/xfs/xfs_dir2_trace.c	Tue Feb  3 19:45:40 2004
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -49,11 +49,9 @@
 #include "xfs_da_btree.h"
 #include "xfs_dir2_trace.h"
 
-#ifdef DEBUG
+#ifdef XFS_DIR2_TRACE
 ktrace_t	*xfs_dir2_trace_buf;
-#endif /* DEBUG */
 
-#ifdef XFS_DIR2_TRACE
 /*
  * Enter something in the trace buffers.
  */
@@ -64,36 +62,37 @@
 	char		*where,
 	char		*name,
 	int		namelen,
-	__psunsigned_t	a0,
-	__psunsigned_t	a1,
-	__psunsigned_t	a2,
-	__psunsigned_t	a3,
-	__psunsigned_t	a4,
-	__psunsigned_t	a5,
-	__psunsigned_t	a6)
+	void		*a0,
+	void		*a1,
+	void		*a2,
+	void		*a3,
+	void		*a4,
+	void		*a5,
+	void		*a6,
+	void		*a7)
 {
-	__psunsigned_t	n[6];
+	void		*n[5];
 
 	ASSERT(xfs_dir2_trace_buf);
 	ASSERT(dp->i_dir_trace);
 	if (name)
-		memcpy(n, name, min(sizeof(n), namelen));
+		memcpy(n, name, min((int)sizeof(n), namelen));
 	else
 		memset((char *)n, 0, sizeof(n));
 	ktrace_enter(xfs_dir2_trace_buf,
-		(void *)(__psunsigned_t)type, (void *)where,
+		(void *)(long)type, (void *)where,
 		(void *)a0, (void *)a1, (void *)a2, (void *)a3,
-		(void *)a4, (void *)a5, (void *)a6,
-		(void *)(__psunsigned_t)namelen,
+		(void *)a4, (void *)a5, (void *)a6, (void *)a7,
+		(void *)(long)namelen,
 		(void *)n[0], (void *)n[1], (void *)n[2],
-		(void *)n[3], (void *)n[4], (void *)n[5]);
+		(void *)n[3], (void *)n[4]);
 	ktrace_enter(dp->i_dir_trace,
-		(void *)(__psunsigned_t)type, (void *)where,
+		(void *)(long)type, (void *)where,
 		(void *)a0, (void *)a1, (void *)a2, (void *)a3,
-		(void *)a4, (void *)a5, (void *)a6,
-		(void *)(__psunsigned_t)namelen,
+		(void *)a4, (void *)a5, (void *)a6, (void *)a7,
+		(void *)(long)namelen,
 		(void *)n[0], (void *)n[1], (void *)n[2],
-		(void *)n[3], (void *)n[4], (void *)n[5]);
+		(void *)n[3], (void *)n[4]);
 }
 
 void
@@ -103,9 +102,11 @@
 {
 	xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS, where,
 		(char *)args->name, (int)args->namelen,
-		(__psunsigned_t)args->hashval, (__psunsigned_t)args->inumber,
-		(__psunsigned_t)args->dp, (__psunsigned_t)args->trans,
-		(__psunsigned_t)args->justcheck, 0, 0);
+		(void *)(unsigned long)args->hashval,
+		(void *)((unsigned long)(args->inumber >> 32)),
+		(void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
+		(void *)args->dp, (void *)args->trans,
+		(void *)(unsigned long)args->justcheck, NULL, NULL);
 }
 
 void
@@ -116,10 +117,12 @@
 {
 	xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_B, where,
 		(char *)args->name, (int)args->namelen,
-		(__psunsigned_t)args->hashval, (__psunsigned_t)args->inumber,
-		(__psunsigned_t)args->dp, (__psunsigned_t)args->trans,
-		(__psunsigned_t)args->justcheck,
-		(__psunsigned_t)(bp ? bp->bps[0] : NULL), 0);
+		(void *)(unsigned long)args->hashval,
+		(void *)((unsigned long)(args->inumber >> 32)),
+		(void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
+		(void *)args->dp, (void *)args->trans,
+		(void *)(unsigned long)args->justcheck,
+		(void *)(bp ? bp->bps[0] : NULL), NULL);
 }
 
 void
@@ -131,11 +134,13 @@
 {
 	xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_BB, where,
 		(char *)args->name, (int)args->namelen,
-		(__psunsigned_t)args->hashval, (__psunsigned_t)args->inumber,
-		(__psunsigned_t)args->dp, (__psunsigned_t)args->trans,
-		(__psunsigned_t)args->justcheck,
-		(__psunsigned_t)(lbp ? lbp->bps[0] : NULL),
-		(__psunsigned_t)(dbp ? dbp->bps[0] : NULL));
+		(void *)(unsigned long)args->hashval,
+		(void *)((unsigned long)(args->inumber >> 32)),
+		(void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
+		(void *)args->dp, (void *)args->trans,
+		(void *)(unsigned long)args->justcheck,
+		(void *)(lbp ? lbp->bps[0] : NULL),
+		(void *)(dbp ? dbp->bps[0] : NULL));
 }
 
 void
@@ -148,12 +153,14 @@
 	int		sd,
 	int		c)
 {
+	xfs_buf_t	*bpbs = bs ? bs->bps[0] : NULL;
+	xfs_buf_t	*bpbd = bd ? bd->bps[0] : NULL;
+
 	xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_BIBII, where,
 		(char *)args->name, (int)args->namelen,
-		(__psunsigned_t)args->dp, (__psunsigned_t)args->trans,
-		(__psunsigned_t)(bs ? bs->bps[0] : NULL), (__psunsigned_t)ss,
-		(__psunsigned_t)(bd ? bd->bps[0] : NULL), (__psunsigned_t)sd,
-		(__psunsigned_t)c);
+		(void *)args->dp, (void *)args->trans,
+		(void *)bpbs, (void *)(long)ss, (void *)bpbd, (void *)(long)sd,
+		(void *)(long)c, NULL);
 }
 
 void
@@ -163,12 +170,16 @@
 	xfs_dir2_db_t	db,
 	xfs_dabuf_t	*bp)
 {
+	xfs_buf_t	*dbp = bp ? bp->bps[0] : NULL;
+
 	xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_DB, where,
 		(char *)args->name, (int)args->namelen,
-		(__psunsigned_t)args->hashval, (__psunsigned_t)args->inumber,
-		(__psunsigned_t)args->dp, (__psunsigned_t)args->trans,
-		(__psunsigned_t)args->justcheck, (__psunsigned_t)db,
-		(__psunsigned_t)(bp ? bp->bps[0] : NULL));
+		(void *)(unsigned long)args->hashval,
+		(void *)((unsigned long)(args->inumber >> 32)),
+		(void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
+		(void *)args->dp, (void *)args->trans,
+		(void *)(unsigned long)args->justcheck, (void *)(long)db,
+		(void *)dbp);
 }
 
 void
@@ -179,9 +190,13 @@
 {
 	xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_I, where,
 		(char *)args->name, (int)args->namelen,
-		(__psunsigned_t)args->hashval, (__psunsigned_t)args->inumber,
-		(__psunsigned_t)args->dp, (__psunsigned_t)args->trans,
-		(__psunsigned_t)args->justcheck, (__psunsigned_t)i, 0);
+		(void *)(unsigned long)args->hashval,
+		(void *)((unsigned long)(args->inumber >> 32)),
+		(void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
+		(void *)args->dp, (void *)args->trans,
+		(void *)(unsigned long)args->justcheck,
+		(void *)((unsigned long)(i >> 32)),
+		(void *)((unsigned long)(i & 0xFFFFFFFF)));
 }
 
 void
@@ -192,9 +207,11 @@
 {
 	xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_S, where,
 		(char *)args->name, (int)args->namelen,
-		(__psunsigned_t)args->hashval, (__psunsigned_t)args->inumber,
-		(__psunsigned_t)args->dp, (__psunsigned_t)args->trans,
-		(__psunsigned_t)args->justcheck, (__psunsigned_t)s, 0);
+		(void *)(unsigned long)args->hashval,
+		(void *)((unsigned long)(args->inumber >> 32)),
+		(void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
+		(void *)args->dp, (void *)args->trans,
+		(void *)(unsigned long)args->justcheck, (void *)(long)s, 0);
 }
 
 void
@@ -204,11 +221,15 @@
 	int		s,
 	xfs_dabuf_t	*bp)
 {
+	xfs_buf_t	*dbp = bp ? bp->bps[0] : NULL;
+
 	xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_SB, where,
 		(char *)args->name, (int)args->namelen,
-		(__psunsigned_t)args->hashval, (__psunsigned_t)args->inumber,
-		(__psunsigned_t)args->dp, (__psunsigned_t)args->trans,
-		(__psunsigned_t)args->justcheck, (__psunsigned_t)s,
-		(__psunsigned_t)(bp ? bp->bps[0] : NULL));
+		(void *)(unsigned long)args->hashval,
+		(void *)((unsigned long)(args->inumber >> 32)),
+		(void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
+		(void *)args->dp, (void *)args->trans,
+		(void *)(unsigned long)args->justcheck, (void *)(long)s,
+		(void *)dbp);
 }
 #endif	/* XFS_DIR2_TRACE */
diff -Nru a/fs/xfs/xfs_dir2_trace.h b/fs/xfs/xfs_dir2_trace.h
--- a/fs/xfs/xfs_dir2_trace.h	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/xfs_dir2_trace.h	Tue Feb  3 19:45:17 2004
@@ -36,20 +36,15 @@
  * Tracing for xfs v2 directories.
  */
 
+#if defined(XFS_DIR2_TRACE)
+
 struct ktrace;
 struct xfs_dabuf;
 struct xfs_da_args;
 
-#ifdef XFS_ALL_TRACE
-#define XFS_DIR2_TRACE
-#endif	/* XFS_ALL_TRACE */
-
-#if !defined(DEBUG)
-#undef XFS_DIR2_TRACE
-#endif	/* !DEBUG */
-
 #define	XFS_DIR2_GTRACE_SIZE		4096	/* global buffer */
 #define	XFS_DIR2_KTRACE_SIZE		32	/* per-inode buffer */
+extern struct ktrace *xfs_dir2_trace_buf;
 
 #define	XFS_DIR2_KTRACE_ARGS		1	/* args only */
 #define	XFS_DIR2_KTRACE_ARGS_B		2	/* args + buffer */
@@ -60,8 +55,6 @@
 #define	XFS_DIR2_KTRACE_ARGS_SB		7	/* args, int, buffer */
 #define	XFS_DIR2_KTRACE_ARGS_BIBII	8	/* args, buf/int/buf/int/int */
 
-#ifdef XFS_DIR2_TRACE
-
 void xfs_dir2_trace_args(char *where, struct xfs_da_args *args);
 void xfs_dir2_trace_args_b(char *where, struct xfs_da_args *args,
 			   struct xfs_dabuf *bp);
@@ -89,7 +82,5 @@
 #define	xfs_dir2_trace_args_sb(where, args, s, bp)
 
 #endif	/* XFS_DIR2_TRACE */
-
-extern struct ktrace *xfs_dir2_trace_buf;
 
 #endif	/* __XFS_DIR2_TRACE_H__ */
diff -Nru a/fs/xfs/xfs_dir_sf.h b/fs/xfs/xfs_dir_sf.h
--- a/fs/xfs/xfs_dir_sf.h	Tue Feb  3 19:45:33 2004
+++ b/fs/xfs/xfs_dir_sf.h	Tue Feb  3 19:45:33 2004
@@ -126,13 +126,7 @@
 	       ((uint)sizeof(xfs_dir_sf_entry_t)-1)*(count) + (totallen))
 #endif
 
-#ifdef XFS_ALL_TRACE
-#define	XFS_DIR_TRACE
-#endif
-
-#if !defined(DEBUG)
-#undef XFS_DIR_TRACE
-#endif
+#if defined(XFS_DIR_TRACE)
 
 /*
  * Kernel tracing support for directories.
@@ -145,6 +139,7 @@
 struct xfs_dir_leaf_entry;
 
 #define	XFS_DIR_TRACE_SIZE	4096	/* size of global trace buffer */
+extern ktrace_t	*xfs_dir_trace_buf;
 
 /*
  * Trace record types.
@@ -156,8 +151,6 @@
 #define	XFS_DIR_KTRACE_G_DUE	5	/* dp, uio, leaf entry */
 #define	XFS_DIR_KTRACE_G_DUC	6	/* dp, uio, cookie */
 
-#if defined(XFS_DIR_TRACE)
-
 void xfs_dir_trace_g_du(char *where, struct xfs_inode *dp, struct uio *uio);
 void xfs_dir_trace_g_dub(char *where, struct xfs_inode *dp, struct uio *uio,
 			      xfs_dablk_t bno);
@@ -170,12 +163,9 @@
 void xfs_dir_trace_g_duc(char *where, struct xfs_inode *dp, struct uio *uio,
 			      xfs_off_t cookie);
 void xfs_dir_trace_enter(int type, char *where,
-			     __psunsigned_t a0, __psunsigned_t a1,
-			     __psunsigned_t a2, __psunsigned_t a3,
-			     __psunsigned_t a4, __psunsigned_t a5,
-			     __psunsigned_t a6, __psunsigned_t a7,
-			     __psunsigned_t a8, __psunsigned_t a9,
-			     __psunsigned_t a10, __psunsigned_t a11);
+			     void *a0, void *a1, void *a2, void *a3,
+			     void *a4, void *a5, void *a6, void *a7,
+			     void *a8, void *a9, void *a10, void *a11);
 #else
 #define	xfs_dir_trace_g_du(w,d,u)
 #define	xfs_dir_trace_g_dub(w,d,u,b)
diff -Nru a/fs/xfs/xfs_dmapi.h b/fs/xfs/xfs_dmapi.h
--- a/fs/xfs/xfs_dmapi.h	Tue Feb  3 19:45:42 2004
+++ b/fs/xfs/xfs_dmapi.h	Tue Feb  3 19:45:42 2004
@@ -175,14 +175,6 @@
 			DM_FLAGS_NDELAY : 0)
 #define AT_DELAY_FLAG(f) ((f&ATTR_NONBLOCK) ? DM_FLAGS_NDELAY : 0)
 
-/*
- *	Macros to turn caller specified delay/block flags into
- *	dm_send_xxxx_event flag DM_FLAGS_NDELAY.
- */
-
-#define FILP_DELAY_FLAG(filp) ((filp->f_flags&(O_NDELAY|O_NONBLOCK)) ? \
-			DM_FLAGS_NDELAY : 0)
-
 
 extern struct bhv_vfsops xfs_dmops;
 
diff -Nru a/fs/xfs/xfs_dmops.c b/fs/xfs/xfs_dmops.c
--- a/fs/xfs/xfs_dmops.c	Tue Feb  3 19:45:42 2004
+++ b/fs/xfs/xfs_dmops.c	Tue Feb  3 19:45:42 2004
@@ -43,8 +43,6 @@
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
 
-
-#ifndef CONFIG_XFS_DMAPI
 xfs_dmops_t	xfs_dmcore_xfs = {
 	.xfs_send_data		= (xfs_send_data_t)fs_nosys,
 	.xfs_send_mmap		= (xfs_send_mmap_t)fs_noerr,
@@ -52,4 +50,3 @@
 	.xfs_send_namesp	= (xfs_send_namesp_t)fs_nosys,
 	.xfs_send_unmount	= (xfs_send_unmount_t)fs_noval,
 };
-#endif /* CONFIG_XFS_DMAPI */
diff -Nru a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c
--- a/fs/xfs/xfs_error.c	Tue Feb  3 19:45:42 2004
+++ b/fs/xfs/xfs_error.c	Tue Feb  3 19:45:42 2004
@@ -102,7 +102,7 @@
 	if (random() % randfactor)
 		return 0;
 
-	memcpy(&fsid, fsidp, sizeof(fsid_t));
+	memcpy(&fsid, fsidp, sizeof(xfs_fsid_t));
 
 	for (i = 0; i < XFS_NUM_INJECT_ERROR; i++)  {
 		if (xfs_etest[i] == error_tag && xfs_etest_fsid[i] == fsid) {
@@ -123,7 +123,7 @@
 	int len;
 	int64_t fsid;
 
-	memcpy(&fsid, mp->m_fixedfsid, sizeof(fsid_t));
+	memcpy(&fsid, mp->m_fixedfsid, sizeof(xfs_fsid_t));
 
 	for (i = 0; i < XFS_NUM_INJECT_ERROR; i++)  {
 		if (xfs_etest_fsid[i] == fsid && xfs_etest[i] == error_tag) {
@@ -156,7 +156,7 @@
 	int i;
 	int64_t fsid;
 
-	memcpy(&fsid, mp->m_fixedfsid, sizeof(fsid_t));
+	memcpy(&fsid, mp->m_fixedfsid, sizeof(xfs_fsid_t));
 
 	for (i = 0; i < XFS_NUM_INJECT_ERROR; i++) {
 		if (xfs_etest_fsid[i] == fsid && xfs_etest[i] == error_tag) {
@@ -209,7 +209,7 @@
 {
 	int64_t fsid;
 
-	memcpy(&fsid, mp->m_fixedfsid, sizeof(fsid_t));
+	memcpy(&fsid, mp->m_fixedfsid, sizeof(xfs_fsid_t));
 
 	return xfs_errortag_clearall_umount(fsid, mp->m_fsname, 1);
 }
@@ -255,12 +255,6 @@
 	va_start(ap, fmt);
 	xfs_fs_vcmn_err(level, mp, fmt, ap);
 	va_end(ap);
-}
-
-void
-xfs_stack_trace(void)
-{
-	dump_stack();
 }
 
 void
diff -Nru a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
--- a/fs/xfs/xfs_fsops.c	Tue Feb  3 19:45:42 2004
+++ b/fs/xfs/xfs_fsops.c	Tue Feb  3 19:45:42 2004
@@ -51,6 +51,7 @@
 #include "xfs_fsops.h"
 #include "xfs_itable.h"
 #include "xfs_rw.h"
+#include "xfs_refcache.h"
 #include "xfs_trans_space.h"
 #include "xfs_rtalloc.h"
 #include "xfs_dir2.h"
@@ -592,6 +593,9 @@
 
 	/* Stop new writers */
 	xfs_start_freeze(mp, XFS_FREEZE_WRITE);
+
+	/* Flush the refcache */
+	xfs_refcache_purge_mp(mp);
 
 	/* Flush delalloc and delwri data */
 	VFS_SYNC(vfsp, SYNC_DELWRI|SYNC_WAIT, NULL, error);
diff -Nru a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
--- a/fs/xfs/xfs_iget.c	Tue Feb  3 19:45:42 2004
+++ b/fs/xfs/xfs_iget.c	Tue Feb  3 19:45:42 2004
@@ -450,13 +450,12 @@
 		xfs_inode_t	*ip;
 		int		newnode;
 
-
 		vp = LINVFS_GET_VP(inode);
 		if (inode->i_state & I_NEW) {
 inode_allocate:
 			vn_initialize(inode);
 			error = xfs_iget_core(vp, mp, tp, ino,
-							lock_flags, ipp, bno);
+						lock_flags, ipp, bno);
 			if (error) {
 				make_bad_inode(inode);
 				if (inode->i_state & I_NEW)
@@ -506,9 +505,6 @@
 	mrlock_init(&ip->i_lock, MRLOCK_ALLOW_EQUAL_PRI|MRLOCK_BARRIER,
 		     "xfsino", (long)vp->v_number);
 	mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", vp->v_number);
-#ifdef NOTYET
-	mutex_init(&ip->i_range_lock.r_spinlock, MUTEX_SPIN, "xrange");
-#endif /* NOTYET */
 	init_waitqueue_head(&ip->i_ipin_wait);
 	atomic_set(&ip->i_pincount, 0);
 	init_sema(&ip->i_flock, 1, "xfsfino", vp->v_number);
@@ -830,9 +826,7 @@
 	} else if (lock_flags & XFS_ILOCK_SHARED) {
 		mraccess(&ip->i_lock);
 	}
-#ifdef XFS_ILOCK_TRACE
-	xfs_ilock_trace(ip, 1, lock_flags, (inst_t *)return_address);
-#endif
+	xfs_ilock_trace(ip, 1, lock_flags, (inst_t *)__return_address);
 }
 
 /*
@@ -895,9 +889,7 @@
 			return 0;
 		}
 	}
-#ifdef XFS_ILOCK_TRACE
 	xfs_ilock_trace(ip, 2, lock_flags, (inst_t *)__return_address);
-#endif
 	return 1;
 }
 
@@ -955,9 +947,7 @@
 						(xfs_log_item_t*)(ip->i_itemp));
 		}
 	}
-#ifdef XFS_ILOCK_TRACE
 	xfs_ilock_trace(ip, 3, lock_flags, (inst_t *)__return_address);
-#endif
 }
 
 /*
diff -Nru a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
--- a/fs/xfs/xfs_inode.c	Tue Feb  3 19:45:42 2004
+++ b/fs/xfs/xfs_inode.c	Tue Feb  3 19:45:42 2004
@@ -908,9 +908,6 @@
 #ifdef XFS_RW_TRACE
 	ip->i_rwtrace = ktrace_alloc(XFS_RW_KTRACE_SIZE, KM_SLEEP);
 #endif
-#ifdef XFS_STRAT_TRACE
-	ip->i_strat_trace = ktrace_alloc(XFS_STRAT_KTRACE_SIZE, KM_SLEEP);
-#endif
 #ifdef XFS_ILOCK_TRACE
 	ip->i_lock_trace = ktrace_alloc(XFS_ILOCK_KTRACE_SIZE, KM_SLEEP);
 #endif
@@ -1144,8 +1141,8 @@
 	ip->i_d.di_onlink = 0;
 	ip->i_d.di_nlink = nlink;
 	ASSERT(ip->i_d.di_nlink == nlink);
-	ip->i_d.di_uid = current->fsuid;
-	ip->i_d.di_gid = current->fsgid;
+	ip->i_d.di_uid = current_fsuid(cr);
+	ip->i_d.di_gid = current_fsgid(cr);
 	ip->i_d.di_projid = prid;
 	memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad));
 
@@ -1362,16 +1359,16 @@
 	ktrace_enter(ip->i_rwtrace,
 		     (void*)((long)tag),
 		     (void*)ip,
-		     (void*)((ip->i_d.di_size >> 32) & 0xffffffff),
-		     (void*)(ip->i_d.di_size & 0xffffffff),
+		     (void*)(unsigned long)((ip->i_d.di_size >> 32) & 0xffffffff),
+		     (void*)(unsigned long)(ip->i_d.di_size & 0xffffffff),
 		     (void*)((long)flag),
-		     (void*)((new_size >> 32) & 0xffffffff),
-		     (void*)(new_size & 0xffffffff),
-		     (void*)((toss_start >> 32) & 0xffffffff),
-		     (void*)(toss_start & 0xffffffff),
-		     (void*)((toss_finish >> 32) & 0xffffffff),
-		     (void*)(toss_finish & 0xffffffff),
-		     (void*)((long)private.p_cpuid),
+		     (void*)(unsigned long)((new_size >> 32) & 0xffffffff),
+		     (void*)(unsigned long)(new_size & 0xffffffff),
+		     (void*)(unsigned long)((toss_start >> 32) & 0xffffffff),
+		     (void*)(unsigned long)(toss_start & 0xffffffff),
+		     (void*)(unsigned long)((toss_finish >> 32) & 0xffffffff),
+		     (void*)(unsigned long)(toss_finish & 0xffffffff),
+		     (void*)(unsigned long)current_cpu(),
 		     (void*)0,
 		     (void*)0,
 		     (void*)0,
@@ -2755,17 +2752,8 @@
 	}
 	if (ip->i_afp)
 		xfs_idestroy_fork(ip, XFS_ATTR_FORK);
-#ifdef NOTYET
-	if (ip->i_range_lock.r_sleep != NULL) {
-		freesema(ip->i_range_lock.r_sleep);
-		kmem_free(ip->i_range_lock.r_sleep, sizeof(sema_t));
-	}
-#endif /* NOTYET */
 	mrfree(&ip->i_lock);
 	mrfree(&ip->i_iolock);
-#ifdef NOTYET
-	mutex_destroy(&ip->i_range_lock.r_spinlock);
-#endif /* NOTYET */
 	freesema(&ip->i_flock);
 #ifdef XFS_BMAP_TRACE
 	ktrace_free(ip->i_xtrace);
@@ -2776,9 +2764,6 @@
 #ifdef XFS_RW_TRACE
 	ktrace_free(ip->i_rwtrace);
 #endif
-#ifdef XFS_STRAT_TRACE
-	ktrace_free(ip->i_strat_trace);
-#endif
 #ifdef XFS_ILOCK_TRACE
 	ktrace_free(ip->i_lock_trace);
 #endif
@@ -3707,7 +3692,7 @@
 	if ((error = _ACL_XFS_IACCESS(ip, mode, cr)) != -1)
 		return error ? XFS_ERROR(error) : 0;
 
-	if (current->fsuid != ip->i_d.di_uid) {
+	if (current_fsuid(cr) != ip->i_d.di_uid) {
 		mode >>= 3;
 		if (!in_group_p((gid_t)ip->i_d.di_gid))
 			mode >>= 3;
@@ -3814,7 +3799,7 @@
 	 * We're not supposed to change timestamps in readonly-mounted
 	 * filesystems.  Throw it away if anyone asks us.
 	 */
-	if (vp->v_vfsp->vfs_flag & VFS_RDONLY)
+	if (unlikely(vp->v_vfsp->vfs_flag & VFS_RDONLY))
 		return;
 
 	/*
@@ -3828,17 +3813,17 @@
 
 	nanotime(&tv);
 	if (flags & XFS_ICHGTIME_MOD) {
-		inode->i_mtime = tv;
+		VN_MTIMESET(vp, &tv);
 		ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec;
 		ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec;
 	}
 	if (flags & XFS_ICHGTIME_ACC) {
-		inode->i_atime  = tv;
+		VN_ATIMESET(vp, &tv);
 		ip->i_d.di_atime.t_sec = (__int32_t)tv.tv_sec;
 		ip->i_d.di_atime.t_nsec = (__int32_t)tv.tv_nsec;
 	}
 	if (flags & XFS_ICHGTIME_CHG) {
-		inode->i_ctime  = tv;
+		VN_CTIMESET(vp, &tv);
 		ip->i_d.di_ctime.t_sec = (__int32_t)tv.tv_sec;
 		ip->i_d.di_ctime.t_nsec = (__int32_t)tv.tv_nsec;
 	}
@@ -3859,17 +3844,18 @@
 }
 
 #ifdef XFS_ILOCK_TRACE
+ktrace_t	*xfs_ilock_trace_buf;
+
 void
 xfs_ilock_trace(xfs_inode_t *ip, int lock, unsigned int lockflags, inst_t *ra)
 {
 	ktrace_enter(ip->i_lock_trace,
 		     (void *)ip,
-		      (void *)(__psint_t)lock,		/* 1 = LOCK, 3=UNLOCK, etc */
-		     (void *)(__psint_t)lockflags,	/* XFS_ILOCK_EXCL etc */
-		     (void *)ra,			/* caller of ilock */
-		     (void *)(__psint_t)cpuid(),
-		     (void *)(__psint_t)current_pid(),
+		     (void *)(unsigned long)lock, /* 1 = LOCK, 3=UNLOCK, etc */
+		     (void *)(unsigned long)lockflags, /* XFS_ILOCK_EXCL etc */
+		     (void *)ra,		/* caller of ilock */
+		     (void *)(unsigned long)current_cpu(),
+		     (void *)(unsigned long)current_pid(),
 		     0,0,0,0,0,0,0,0,0,0);
-
 }
-#endif /* ILOCK_TRACE */
+#endif
diff -Nru a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
--- a/fs/xfs/xfs_inode.h	Tue Feb  3 19:45:34 2004
+++ b/fs/xfs/xfs_inode.h	Tue Feb  3 19:45:34 2004
@@ -99,6 +99,13 @@
 struct xfs_trans;
 struct xfs_dquot;
 
+#if defined(XFS_ILOCK_TRACE)
+#define XFS_ILOCK_KTRACE_SIZE	32
+extern ktrace_t *xfs_ilock_trace_buf;
+extern void xfs_ilock_trace(struct xfs_inode *, int, unsigned int, inst_t *);
+#else
+#define	xfs_ilock_trace(i,n,f,ra)
+#endif
 
 /*
  * This structure is used to communicate which extents of a file
@@ -264,7 +271,10 @@
 	sema_t			i_flock;	/* inode flush lock */
 	atomic_t		i_pincount;	/* inode pin count */
 	wait_queue_head_t	i_ipin_wait;	/* inode pinning wait queue */
-
+#ifdef HAVE_REFCACHE
+	struct xfs_inode	**i_refcache;	/* ptr to entry in ref cache */
+	struct xfs_inode	*i_release;	/* inode to unref */
+#endif
 	/* I/O state */
 	xfs_iocore_t		i_iocore;	/* I/O core */
 
@@ -280,15 +290,22 @@
 	struct xfs_inode	*i_cnext;	/* cluster hash link forward */
 	struct xfs_inode	*i_cprev;	/* cluster hash link backward */
 
-#ifdef DEBUG
 	/* Trace buffers per inode. */
+#ifdef XFS_BMAP_TRACE
 	struct ktrace		*i_xtrace;	/* inode extent list trace */
+#endif
+#ifdef XFS_BMBT_TRACE
 	struct ktrace		*i_btrace;	/* inode bmap btree trace */
+#endif
+#ifdef XFS_RW_TRACE
 	struct ktrace		*i_rwtrace;	/* inode read/write trace */
-	struct ktrace		*i_strat_trace;	/* inode strat_write trace */
+#endif
+#ifdef XFS_ILOCK_TRACE
 	struct ktrace		*i_lock_trace;	/* inode lock/unlock trace */
+#endif
+#ifdef XFS_DIR2_TRACE
 	struct ktrace		*i_dir_trace;	/* inode directory trace */
-#endif /* DEBUG */
+#endif
 } xfs_inode_t;
 
 #endif	/* __KERNEL__ */
@@ -535,12 +552,6 @@
 extern struct kmem_zone	*xfs_inode_zone;
 extern struct kmem_zone	*xfs_ili_zone;
 extern struct vnodeops	xfs_vnodeops;
-
-#ifdef XFS_ILOCK_TRACE
-#define XFS_ILOCK_KTRACE_SIZE	32
-void	xfs_ilock_trace(xfs_inode_t *ip, int lock, unsigned int lockflags,
-			inst_t *ra);
-#endif
 
 #endif	/* __KERNEL__ */
 
diff -Nru a/fs/xfs/xfs_iocore.c b/fs/xfs/xfs_iocore.c
--- a/fs/xfs/xfs_iocore.c	Tue Feb  3 19:45:35 2004
+++ b/fs/xfs/xfs_iocore.c	Tue Feb  3 19:45:35 2004
@@ -61,6 +61,7 @@
 #include "xfs_rw.h"
 #include "xfs_quota.h"
 #include "xfs_trans_space.h"
+#include "xfs_iomap.h"
 
 
 STATIC xfs_fsize_t
diff -Nru a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/fs/xfs/xfs_iomap.c	Tue Feb  3 19:45:28 2004
@@ -0,0 +1,795 @@
+/*
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.	 Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+
+#include "xfs.h"
+
+#include "xfs_fs.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_alloc.h"
+#include "xfs_dmapi.h"
+#include "xfs_quota.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_bit.h"
+#include "xfs_rtalloc.h"
+#include "xfs_error.h"
+#include "xfs_itable.h"
+#include "xfs_rw.h"
+#include "xfs_acl.h"
+#include "xfs_cap.h"
+#include "xfs_mac.h"
+#include "xfs_attr.h"
+#include "xfs_buf_item.h"
+#include "xfs_trans_space.h"
+#include "xfs_utils.h"
+#include "xfs_iomap.h"
+
+#define XFS_WRITEIO_ALIGN(mp,off)	(((off) >> mp->m_writeio_log) \
+						<< mp->m_writeio_log)
+#define XFS_STRAT_WRITE_IMAPS	2
+#define XFS_WRITE_IMAPS		XFS_BMAP_MAX_NMAP
+
+STATIC int
+xfs_imap_to_bmap(
+	xfs_iocore_t	*io,
+	xfs_off_t	offset,
+	xfs_bmbt_irec_t *imap,
+	xfs_iomap_t	*iomapp,
+	int		imaps,			/* Number of imap entries */
+	int		iomaps,			/* Number of iomap entries */
+	int		flags)
+{
+	xfs_mount_t	*mp;
+	xfs_fsize_t	nisize;
+	int		pbm;
+	xfs_fsblock_t	start_block;
+
+	mp = io->io_mount;
+	nisize = XFS_SIZE(mp, io);
+	if (io->io_new_size > nisize)
+		nisize = io->io_new_size;
+
+	for (pbm = 0; imaps && pbm < iomaps; imaps--, iomapp++, imap++, pbm++) {
+		iomapp->iomap_target = io->io_flags & XFS_IOCORE_RT ?
+			mp->m_rtdev_targp : mp->m_ddev_targp;
+		iomapp->iomap_offset = XFS_FSB_TO_B(mp, imap->br_startoff);
+		iomapp->iomap_delta = offset - iomapp->iomap_offset;
+		iomapp->iomap_bsize = XFS_FSB_TO_B(mp, imap->br_blockcount);
+		iomapp->iomap_flags = flags;
+
+		start_block = imap->br_startblock;
+		if (start_block == HOLESTARTBLOCK) {
+			iomapp->iomap_bn = IOMAP_DADDR_NULL;
+			iomapp->iomap_flags = IOMAP_HOLE;
+		} else if (start_block == DELAYSTARTBLOCK) {
+			iomapp->iomap_bn = IOMAP_DADDR_NULL;
+			iomapp->iomap_flags = IOMAP_DELAY;
+		} else {
+			iomapp->iomap_bn = XFS_FSB_TO_DB_IO(io, start_block);
+			if (ISUNWRITTEN(imap))
+				iomapp->iomap_flags |= IOMAP_UNWRITTEN;
+		}
+
+		if ((iomapp->iomap_offset + iomapp->iomap_bsize) >= nisize) {
+			iomapp->iomap_flags |= IOMAP_EOF;
+		}
+
+		offset += iomapp->iomap_bsize - iomapp->iomap_delta;
+	}
+	return pbm;	/* Return the number filled */
+}
+
+int
+xfs_iomap(
+	xfs_iocore_t	*io,
+	xfs_off_t	offset,
+	ssize_t		count,
+	int		flags,
+	xfs_iomap_t	*iomapp,
+	int		*niomaps)
+{
+	xfs_mount_t	*mp = io->io_mount;
+	xfs_fileoff_t	offset_fsb, end_fsb;
+	int		error = 0;
+	int		lockmode = 0;
+	xfs_bmbt_irec_t	imap;
+	int		nimaps = 1;
+	int		bmapi_flags = 0;
+	int		iomap_flags = 0;
+
+	if (XFS_FORCED_SHUTDOWN(mp))
+		return XFS_ERROR(EIO);
+
+	switch (flags &
+		(BMAPI_READ | BMAPI_WRITE | BMAPI_ALLOCATE |
+		 BMAPI_UNWRITTEN | BMAPI_DEVICE)) {
+	case BMAPI_READ:
+		lockmode = XFS_LCK_MAP_SHARED(mp, io);
+		bmapi_flags = XFS_BMAPI_ENTIRE;
+		if (flags & BMAPI_IGNSTATE)
+			bmapi_flags |= XFS_BMAPI_IGSTATE;
+		break;
+	case BMAPI_WRITE:
+		lockmode = XFS_ILOCK_EXCL|XFS_EXTSIZE_WR;
+		bmapi_flags = 0;
+		XFS_ILOCK(mp, io, lockmode);
+		break;
+	case BMAPI_ALLOCATE:
+		lockmode = XFS_ILOCK_SHARED|XFS_EXTSIZE_RD;
+		bmapi_flags = XFS_BMAPI_ENTIRE;
+		/* Attempt non-blocking lock */
+		if (flags & BMAPI_TRYLOCK) {
+			if (!XFS_ILOCK_NOWAIT(mp, io, lockmode))
+				return XFS_ERROR(EAGAIN);
+		} else {
+			XFS_ILOCK(mp, io, lockmode);
+		}
+		break;
+	case BMAPI_UNWRITTEN:
+		goto phase2;
+	case BMAPI_DEVICE:
+		lockmode = XFS_LCK_MAP_SHARED(mp, io);
+		iomapp->iomap_target = io->io_flags & XFS_IOCORE_RT ?
+			mp->m_rtdev_targp : mp->m_ddev_targp;
+		error = 0;
+		*niomaps = 1;
+		goto out;
+	default:
+		BUG();
+	}
+
+	ASSERT(offset <= mp->m_maxioffset);
+	if ((xfs_fsize_t)offset + count > mp->m_maxioffset)
+		count = mp->m_maxioffset - offset;
+	end_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)offset + count);
+	offset_fsb = XFS_B_TO_FSBT(mp, offset);
+
+	error = XFS_BMAPI(mp, NULL, io, offset_fsb,
+			(xfs_filblks_t)(end_fsb - offset_fsb),
+			bmapi_flags,  NULL, 0, &imap,
+			&nimaps, NULL);
+
+	if (error)
+		goto out;
+
+phase2:
+	switch (flags & (BMAPI_WRITE|BMAPI_ALLOCATE|BMAPI_UNWRITTEN)) {
+	case BMAPI_WRITE:
+		/* If we found an extent, return it */
+		if (nimaps && (imap.br_startblock != HOLESTARTBLOCK))
+			break;
+
+		if (flags & (BMAPI_DIRECT|BMAPI_MMAP)) {
+			error = XFS_IOMAP_WRITE_DIRECT(mp, io, offset,
+					count, flags, &imap, &nimaps, nimaps);
+		} else {
+			error = XFS_IOMAP_WRITE_DELAY(mp, io, offset, count,
+					flags, &imap, &nimaps);
+		}
+		iomap_flags = IOMAP_NEW;
+		break;
+	case BMAPI_ALLOCATE:
+		/* If we found an extent, return it */
+		XFS_IUNLOCK(mp, io, lockmode);
+		lockmode = 0;
+
+		if (nimaps && !ISNULLSTARTBLOCK(imap.br_startblock))
+			break;
+
+		error = XFS_IOMAP_WRITE_ALLOCATE(mp, io, &imap, &nimaps);
+		break;
+	case BMAPI_UNWRITTEN:
+		lockmode = 0;
+		error = XFS_IOMAP_WRITE_UNWRITTEN(mp, io, offset, count);
+		nimaps = 0;
+		break;
+	}
+
+	if (nimaps) {
+		*niomaps = xfs_imap_to_bmap(io, offset, &imap,
+					iomapp, nimaps, *niomaps, iomap_flags);
+	} else if (niomaps) {
+		*niomaps = 0;
+	}
+
+out:
+	if (lockmode)
+		XFS_IUNLOCK(mp, io, lockmode);
+	return XFS_ERROR(error);
+}
+
+STATIC int
+xfs_flush_space(
+	xfs_inode_t	*ip,
+	int		*fsynced,
+	int		*ioflags)
+{
+	switch (*fsynced) {
+	case 0:
+		if (ip->i_delayed_blks) {
+			xfs_iunlock(ip, XFS_ILOCK_EXCL);
+			xfs_flush_inode(ip);
+			xfs_ilock(ip, XFS_ILOCK_EXCL);
+			*fsynced = 1;
+		} else {
+			*ioflags |= BMAPI_SYNC;
+			*fsynced = 2;
+		}
+		return 0;
+	case 1:
+		*fsynced = 2;
+		*ioflags |= BMAPI_SYNC;
+		return 0;
+	case 2:
+		xfs_iunlock(ip, XFS_ILOCK_EXCL);
+		xfs_flush_device(ip);
+		xfs_ilock(ip, XFS_ILOCK_EXCL);
+		*fsynced = 3;
+		return 0;
+	}
+	return 1;
+}
+
+int
+xfs_iomap_write_direct(
+	xfs_inode_t	*ip,
+	loff_t		offset,
+	size_t		count,
+	int		flags,
+	xfs_bmbt_irec_t *ret_imap,
+	int		*nmaps,
+	int		found)
+{
+	xfs_mount_t	*mp = ip->i_mount;
+	xfs_iocore_t	*io = &ip->i_iocore;
+	xfs_fileoff_t	offset_fsb;
+	xfs_fileoff_t	last_fsb;
+	xfs_filblks_t	count_fsb;
+	xfs_fsize_t	isize;
+	xfs_fsblock_t	firstfsb;
+	int		nimaps, maps;
+	int		error;
+	int		bmapi_flag;
+	int		rt;
+	xfs_trans_t	*tp;
+	xfs_bmbt_irec_t imap[XFS_WRITE_IMAPS], *imapp;
+	xfs_bmap_free_t free_list;
+	int		aeof;
+	xfs_filblks_t	datablocks;
+	int		committed;
+	int		numrtextents;
+	uint		resblks;
+
+	/*
+	 * Make sure that the dquots are there. This doesn't hold
+	 * the ilock across a disk read.
+	 */
+
+	error = XFS_QM_DQATTACH(ip->i_mount, ip, XFS_QMOPT_ILOCKED);
+	if (error)
+		return XFS_ERROR(error);
+
+	maps = min(XFS_WRITE_IMAPS, *nmaps);
+	nimaps = maps;
+
+	isize = ip->i_d.di_size;
+	aeof = (offset + count) > isize;
+
+	if (io->io_new_size > isize)
+		isize = io->io_new_size;
+
+	offset_fsb = XFS_B_TO_FSBT(mp, offset);
+	last_fsb = XFS_B_TO_FSB(mp, ((xfs_ufsize_t)(offset + count)));
+	count_fsb = last_fsb - offset_fsb;
+	if (found && (ret_imap->br_startblock == HOLESTARTBLOCK)) {
+		xfs_fileoff_t	map_last_fsb;
+
+		map_last_fsb = ret_imap->br_blockcount + ret_imap->br_startoff;
+
+		if (map_last_fsb < last_fsb) {
+			last_fsb = map_last_fsb;
+			count_fsb = last_fsb - offset_fsb;
+		}
+		ASSERT(count_fsb > 0);
+	}
+
+	/*
+	 * determine if reserving space on
+	 * the data or realtime partition.
+	 */
+	if ((rt = XFS_IS_REALTIME_INODE(ip))) {
+		int	sbrtextsize, iprtextsize;
+
+		sbrtextsize = mp->m_sb.sb_rextsize;
+		iprtextsize =
+			ip->i_d.di_extsize ? ip->i_d.di_extsize : sbrtextsize;
+		numrtextents = (count_fsb + iprtextsize - 1);
+		do_div(numrtextents, sbrtextsize);
+		datablocks = 0;
+	} else {
+		datablocks = count_fsb;
+		numrtextents = 0;
+	}
+
+	/*
+	 * allocate and setup the transaction
+	 */
+	xfs_iunlock(ip, XFS_ILOCK_EXCL);
+	tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT);
+
+	resblks = XFS_DIOSTRAT_SPACE_RES(mp, datablocks);
+
+	error = xfs_trans_reserve(tp, resblks,
+			XFS_WRITE_LOG_RES(mp), numrtextents,
+			XFS_TRANS_PERM_LOG_RES,
+			XFS_WRITE_LOG_COUNT);
+
+	/*
+	 * check for running out of space
+	 */
+	if (error)
+		/*
+		 * Free the transaction structure.
+		 */
+		xfs_trans_cancel(tp, 0);
+
+	xfs_ilock(ip, XFS_ILOCK_EXCL);
+
+	if (error)
+		goto error_out; /* Don't return in above if .. trans ..,
+					need lock to return */
+
+	if (XFS_TRANS_RESERVE_BLKQUOTA(mp, tp, ip, resblks)) {
+		error = (EDQUOT);
+		goto error1;
+	}
+	nimaps = 1;
+
+	bmapi_flag = XFS_BMAPI_WRITE;
+	xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
+	xfs_trans_ihold(tp, ip);
+
+	if (!(flags & BMAPI_MMAP) && (offset < ip->i_d.di_size || rt))
+		bmapi_flag |= XFS_BMAPI_PREALLOC;
+
+	/*
+	 * issue the bmapi() call to allocate the blocks
+	 */
+	XFS_BMAP_INIT(&free_list, &firstfsb);
+	imapp = &imap[0];
+	error = xfs_bmapi(tp, ip, offset_fsb, count_fsb,
+		bmapi_flag, &firstfsb, 0, imapp, &nimaps, &free_list);
+	if (error) {
+		goto error0;
+	}
+
+	/*
+	 * complete the transaction
+	 */
+
+	error = xfs_bmap_finish(&tp, &free_list, firstfsb, &committed);
+	if (error) {
+		goto error0;
+	}
+
+	error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES, NULL);
+	if (error) {
+		goto error_out;
+	}
+
+	/* copy any maps to caller's array and return any error. */
+	if (nimaps == 0) {
+		error = (ENOSPC);
+		goto error_out;
+	}
+
+	*ret_imap = imap[0];
+	*nmaps = 1;
+	return 0;
+
+ error0:	/* Cancel bmap, unlock inode, and cancel trans */
+	xfs_bmap_cancel(&free_list);
+
+ error1:	/* Just cancel transaction */
+	xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT);
+	*nmaps = 0;	/* nothing set-up here */
+
+error_out:
+	return XFS_ERROR(error);
+}
+
+int
+xfs_iomap_write_delay(
+	xfs_inode_t	*ip,
+	loff_t		offset,
+	size_t		count,
+	int		ioflag,
+	xfs_bmbt_irec_t *ret_imap,
+	int		*nmaps)
+{
+	xfs_mount_t	*mp = ip->i_mount;
+	xfs_iocore_t	*io = &ip->i_iocore;
+	xfs_fileoff_t	offset_fsb;
+	xfs_fileoff_t	last_fsb;
+	xfs_fsize_t	isize;
+	xfs_fsblock_t	firstblock;
+	int		nimaps;
+	int		error;
+	xfs_bmbt_irec_t imap[XFS_WRITE_IMAPS];
+	int		aeof;
+	int		fsynced = 0;
+
+	ASSERT(ismrlocked(&ip->i_lock, MR_UPDATE) != 0);
+
+	/*
+	 * Make sure that the dquots are there. This doesn't hold
+	 * the ilock across a disk read.
+	 */
+
+	error = XFS_QM_DQATTACH(mp, ip, XFS_QMOPT_ILOCKED);
+	if (error)
+		return XFS_ERROR(error);
+
+retry:
+	isize = ip->i_d.di_size;
+	if (io->io_new_size > isize) {
+		isize = io->io_new_size;
+	}
+
+	aeof = 0;
+	offset_fsb = XFS_B_TO_FSBT(mp, offset);
+	last_fsb = XFS_B_TO_FSB(mp, ((xfs_ufsize_t)(offset + count)));
+	/*
+	 * If the caller is doing a write at the end of the file,
+	 * then extend the allocation (and the buffer used for the write)
+	 * out to the file system's write iosize.  We clean up any extra
+	 * space left over when the file is closed in xfs_inactive().
+	 *
+	 * We don't bother with this for sync writes, because we need
+	 * to minimize the amount we write for good performance.
+	 */
+	if (!(ioflag & BMAPI_SYNC) && ((offset + count) > ip->i_d.di_size)) {
+		xfs_off_t	aligned_offset;
+		unsigned int	iosize;
+		xfs_fileoff_t	ioalign;
+
+		iosize = mp->m_writeio_blocks;
+		aligned_offset = XFS_WRITEIO_ALIGN(mp, (offset + count - 1));
+		ioalign = XFS_B_TO_FSBT(mp, aligned_offset);
+		last_fsb = ioalign + iosize;
+		aeof = 1;
+	}
+
+	nimaps = XFS_WRITE_IMAPS;
+	firstblock = NULLFSBLOCK;
+
+	/*
+	 * roundup the allocation request to m_dalign boundary if file size
+	 * is greater that 512K and we are allocating past the allocation eof
+	 */
+	if (mp->m_dalign && (isize >= mp->m_dalign) && aeof) {
+		int eof;
+		xfs_fileoff_t new_last_fsb;
+		new_last_fsb = roundup_64(last_fsb, mp->m_dalign);
+		error = xfs_bmap_eof(ip, new_last_fsb, XFS_DATA_FORK, &eof);
+		if (error) {
+			return error;
+		}
+		if (eof) {
+			last_fsb = new_last_fsb;
+		}
+	}
+
+	error = xfs_bmapi(NULL, ip, offset_fsb,
+			  (xfs_filblks_t)(last_fsb - offset_fsb),
+			  XFS_BMAPI_DELAY | XFS_BMAPI_WRITE |
+			  XFS_BMAPI_ENTIRE, &firstblock, 1, imap,
+			  &nimaps, NULL);
+	/*
+	 * This can be EDQUOT, if nimaps == 0
+	 */
+	if (error && (error != ENOSPC)) {
+		return XFS_ERROR(error);
+	}
+	/*
+	 * If bmapi returned us nothing, and if we didn't get back EDQUOT,
+	 * then we must have run out of space.
+	 */
+
+	if (nimaps == 0) {
+		if (xfs_flush_space(ip, &fsynced, &ioflag))
+			return XFS_ERROR(ENOSPC);
+
+		error = 0;
+		goto retry;
+	}
+
+	*ret_imap = imap[0];
+	*nmaps = 1;
+	return 0;
+}
+
+/*
+ * Pass in a delayed allocate extent, convert it to real extents;
+ * return to the caller the extent we create which maps on top of
+ * the originating callers request.
+ *
+ * Called without a lock on the inode.
+ */
+int
+xfs_iomap_write_allocate(
+	xfs_inode_t	*ip,
+	xfs_bmbt_irec_t *map,
+	int		*retmap)
+{
+	xfs_mount_t	*mp = ip->i_mount;
+	xfs_fileoff_t	offset_fsb, last_block;
+	xfs_fileoff_t	end_fsb, map_start_fsb;
+	xfs_fsblock_t	first_block;
+	xfs_bmap_free_t	free_list;
+	xfs_filblks_t	count_fsb;
+	xfs_bmbt_irec_t	imap[XFS_STRAT_WRITE_IMAPS];
+	xfs_trans_t	*tp;
+	int		i, nimaps, committed;
+	int		error = 0;
+	int		nres;
+
+	*retmap = 0;
+
+	/*
+	 * Make sure that the dquots are there.
+	 */
+
+	if ((error = XFS_QM_DQATTACH(mp, ip, 0)))
+		return XFS_ERROR(error);
+
+	offset_fsb = map->br_startoff;
+	count_fsb = map->br_blockcount;
+	map_start_fsb = offset_fsb;
+
+	XFS_STATS_ADD(xs_xstrat_bytes, XFS_FSB_TO_B(mp, count_fsb));
+
+	while (count_fsb != 0) {
+		/*
+		 * Set up a transaction with which to allocate the
+		 * backing store for the file.  Do allocations in a
+		 * loop until we get some space in the range we are
+		 * interested in.  The other space that might be allocated
+		 * is in the delayed allocation extent on which we sit
+		 * but before our buffer starts.
+		 */
+
+		nimaps = 0;
+		while (nimaps == 0) {
+			tp = xfs_trans_alloc(mp, XFS_TRANS_STRAT_WRITE);
+			nres = XFS_EXTENTADD_SPACE_RES(mp, XFS_DATA_FORK);
+			error = xfs_trans_reserve(tp, nres,
+					XFS_WRITE_LOG_RES(mp),
+					0, XFS_TRANS_PERM_LOG_RES,
+					XFS_WRITE_LOG_COUNT);
+
+			if (error == ENOSPC) {
+				error = xfs_trans_reserve(tp, 0,
+						XFS_WRITE_LOG_RES(mp),
+						0,
+						XFS_TRANS_PERM_LOG_RES,
+						XFS_WRITE_LOG_COUNT);
+			}
+			if (error) {
+				xfs_trans_cancel(tp, 0);
+				return XFS_ERROR(error);
+			}
+			xfs_ilock(ip, XFS_ILOCK_EXCL);
+			xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
+			xfs_trans_ihold(tp, ip);
+
+			XFS_BMAP_INIT(&free_list, &first_block);
+
+			nimaps = XFS_STRAT_WRITE_IMAPS;
+			/*
+			 * Ensure we don't go beyond eof - it is possible
+			 * the extents changed since we did the read call,
+			 * we dropped the ilock in the interim.
+			 */
+
+			end_fsb = XFS_B_TO_FSB(mp, ip->i_d.di_size);
+			xfs_bmap_last_offset(NULL, ip, &last_block,
+				XFS_DATA_FORK);
+			last_block = XFS_FILEOFF_MAX(last_block, end_fsb);
+			if ((map_start_fsb + count_fsb) > last_block) {
+				count_fsb = last_block - map_start_fsb;
+				if (count_fsb == 0) {
+					error = EAGAIN;
+					goto trans_cancel;
+				}
+			}
+
+			/* Go get the actual blocks */
+			error = xfs_bmapi(tp, ip, map_start_fsb, count_fsb,
+					XFS_BMAPI_WRITE, &first_block, 1,
+					imap, &nimaps, &free_list);
+
+			if (error)
+				goto trans_cancel;
+
+			error = xfs_bmap_finish(&tp, &free_list,
+					first_block, &committed);
+
+			if (error)
+				goto trans_cancel;
+
+			error = xfs_trans_commit(tp,
+					XFS_TRANS_RELEASE_LOG_RES, NULL);
+
+			if (error)
+				goto error0;
+
+			xfs_iunlock(ip, XFS_ILOCK_EXCL);
+		}
+
+		/*
+		 * See if we were able to allocate an extent that
+		 * covers at least part of the callers request
+		 */
+
+		for (i = 0; i < nimaps; i++) {
+			if ((map->br_startoff >= imap[i].br_startoff) &&
+			    (map->br_startoff < (imap[i].br_startoff +
+						 imap[i].br_blockcount))) {
+				*map = imap[i];
+				*retmap = 1;
+				XFS_STATS_INC(xs_xstrat_quick);
+				return 0;
+			}
+			count_fsb -= imap[i].br_blockcount;
+		}
+
+		/* So far we have not mapped the requested part of the
+		 * file, just surrounding data, try again.
+		 */
+		nimaps--;
+		offset_fsb = imap[nimaps].br_startoff +
+			     imap[nimaps].br_blockcount;
+		map_start_fsb = offset_fsb;
+	}
+
+trans_cancel:
+	xfs_bmap_cancel(&free_list);
+	xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT);
+error0:
+	xfs_iunlock(ip, XFS_ILOCK_EXCL);
+	return XFS_ERROR(error);
+}
+
+int
+xfs_iomap_write_unwritten(
+	xfs_inode_t	*ip,
+	loff_t		offset,
+	size_t		count)
+{
+	xfs_mount_t	*mp = ip->i_mount;
+	xfs_trans_t	*tp;
+	xfs_fileoff_t	offset_fsb;
+	xfs_filblks_t	count_fsb;
+	xfs_filblks_t	numblks_fsb;
+	xfs_bmbt_irec_t	imap;
+	int		committed;
+	int		error;
+	int		nres;
+	int		nimaps;
+	xfs_fsblock_t	firstfsb;
+	xfs_bmap_free_t	free_list;
+
+	offset_fsb = XFS_B_TO_FSBT(mp, offset);
+	count_fsb = XFS_B_TO_FSB(mp, count);
+
+	do {
+		nres = XFS_DIOSTRAT_SPACE_RES(mp, 0);
+
+		/*
+		 * set up a transaction to convert the range of extents
+		 * from unwritten to real. Do allocations in a loop until
+		 * we have covered the range passed in.
+		 */
+
+		tp = xfs_trans_alloc(mp, XFS_TRANS_STRAT_WRITE);
+		error = xfs_trans_reserve(tp, nres,
+				XFS_WRITE_LOG_RES(mp), 0,
+				XFS_TRANS_PERM_LOG_RES,
+				XFS_WRITE_LOG_COUNT);
+		if (error) {
+			xfs_trans_cancel(tp, 0);
+			goto error0;
+		}
+
+		xfs_ilock(ip, XFS_ILOCK_EXCL);
+		xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
+		xfs_trans_ihold(tp, ip);
+
+		/*
+		 * Modify the unwritten extent state of the buffer.
+		 */
+		XFS_BMAP_INIT(&free_list, &firstfsb);
+		nimaps = 1;
+		error = xfs_bmapi(tp, ip, offset_fsb, count_fsb,
+				  XFS_BMAPI_WRITE, &firstfsb,
+				  1, &imap, &nimaps, &free_list);
+		if (error)
+			goto error_on_bmapi_transaction;
+
+		error = xfs_bmap_finish(&(tp), &(free_list),
+				firstfsb, &committed);
+		if (error)
+			goto error_on_bmapi_transaction;
+
+		error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES, NULL);
+		xfs_iunlock(ip, XFS_ILOCK_EXCL);
+		if (error)
+			goto error0;
+
+		if ((numblks_fsb = imap.br_blockcount) == 0) {
+			/*
+			 * The numblks_fsb value should always get
+			 * smaller, otherwise the loop is stuck.
+			 */
+			ASSERT(imap.br_blockcount);
+			break;
+		}
+		offset_fsb += numblks_fsb;
+		count_fsb -= numblks_fsb;
+	} while (count_fsb > 0);
+
+	return 0;
+
+error_on_bmapi_transaction:
+	xfs_bmap_cancel(&free_list);
+	xfs_trans_cancel(tp, (XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT));
+	xfs_iunlock(ip, XFS_ILOCK_EXCL);
+error0:
+	return XFS_ERROR(error);
+}
diff -Nru a/fs/xfs/xfs_iomap.h b/fs/xfs/xfs_iomap.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/fs/xfs/xfs_iomap.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2003 Silicon Graphics, Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+
+
+
+#ifndef __XFS_IOMAP_H__
+#define __XFS_IOMAP_H__
+
+#define IOMAP_DADDR_NULL ((xfs_daddr_t) (-1LL))
+
+
+typedef enum {				/* iomap_flags values */
+	IOMAP_EOF =		0x01,	/* mapping contains EOF   */
+	IOMAP_HOLE =		0x02,	/* mapping covers a hole  */
+	IOMAP_DELAY =		0x04,	/* mapping covers delalloc region  */
+	IOMAP_UNWRITTEN =	0x20,	/* mapping covers allocated */
+					/* but uninitialized file data  */
+	IOMAP_NEW =		0x40	/* just allocate */
+} iomap_flags_t;
+
+typedef enum {
+	/* base extent manipulation calls */
+	BMAPI_READ = (1 << 0),		/* read extents */
+	BMAPI_WRITE = (1 << 1),		/* create extents */
+	BMAPI_ALLOCATE = (1 << 2),	/* delayed allocate to real extents */
+	BMAPI_UNWRITTEN  = (1 << 3),	/* unwritten extents to real extents */
+	/* modifiers */
+	BMAPI_IGNSTATE = (1 << 4),	/* ignore unwritten state on read */
+	BMAPI_DIRECT = (1 << 5),		/* direct instead of buffered write */
+	BMAPI_MMAP = (1 << 6),		/* allocate for mmap write */
+	BMAPI_SYNC = (1 << 7),		/* sync write */
+	BMAPI_TRYLOCK = (1 << 8),	/* non-blocking request */
+	BMAPI_DEVICE = (1 << 9),	/* we only want to know the device */
+} bmapi_flags_t;
+
+
+/*
+ * xfs_iomap_t:  File system I/O map
+ *
+ * The iomap_bn field is expressed in 512-byte blocks, and is where the 
+ * mapping starts on disk.
+ *
+ * The iomap_offset, iomap_bsize and iomap_delta fields are in bytes.
+ * iomap_offset is the offset of the mapping in the file itself.
+ * iomap_bsize is the size of the mapping,  iomap_delta is the 
+ * desired data's offset into the mapping, given the offset supplied 
+ * to the file I/O map routine.
+ *
+ * When a request is made to read beyond the logical end of the object,
+ * iomap_size may be set to 0, but iomap_offset and iomap_length should be set
+ * to the actual amount of underlying storage that has been allocated, if any.
+ */
+
+typedef struct xfs_iomap {
+	xfs_daddr_t		iomap_bn;	/* first 512b blk of mapping */
+	xfs_buftarg_t		*iomap_target;
+	loff_t			iomap_offset;	/* offset of mapping, bytes */
+	loff_t			iomap_bsize;	/* size of mapping, bytes */
+	size_t			iomap_delta;	/* offset into mapping, bytes */
+	iomap_flags_t		iomap_flags;
+} xfs_iomap_t;
+
+struct xfs_iocore;
+struct xfs_inode;
+struct xfs_bmbt_irec;
+
+extern int xfs_iomap(struct xfs_iocore *, xfs_off_t, ssize_t, int,
+		     struct xfs_iomap *, int *);
+extern int xfs_iomap_write_direct(struct xfs_inode *, loff_t, size_t,
+				  int, struct xfs_bmbt_irec *, int *, int);
+extern int xfs_iomap_write_delay(struct xfs_inode *, loff_t, size_t, int,
+				 struct xfs_bmbt_irec *, int *);
+extern int xfs_iomap_write_allocate(struct xfs_inode *,
+				struct xfs_bmbt_irec *, int *);
+extern int xfs_iomap_write_unwritten(struct xfs_inode *, loff_t, size_t);
+
+#endif /* __XFS_IOMAP_H__*/
diff -Nru a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
--- a/fs/xfs/xfs_itable.c	Tue Feb  3 19:45:16 2004
+++ b/fs/xfs/xfs_itable.c	Tue Feb  3 19:45:16 2004
@@ -65,7 +65,10 @@
 	xfs_trans_t	*tp,		/* transaction pointer */
 	xfs_ino_t	ino,		/* inode number to get data for */
 	void		*buffer,	/* buffer to place output in */
+	int		ubsize,		/* size of buffer */
+	void		*private_data,	/* my private data */
 	xfs_daddr_t	bno,		/* starting bno of inode cluster */
+	int		*ubused,	/* bytes used by me */
 	void		*dibuff,	/* on-disk inode buffer */
 	int		*stat)		/* BULKSTAT_RV_... */
 {
@@ -86,6 +89,10 @@
 		*stat = BULKSTAT_RV_NOTHING;
 		return XFS_ERROR(EINVAL);
 	}
+	if (ubsize < sizeof(*buf)) {
+		*stat = BULKSTAT_RV_NOTHING;
+		return XFS_ERROR(ENOMEM);
+	}
 
 	if (dip == NULL) {
 		/* We're not being passed a pointer to a dinode.  This happens
@@ -218,6 +225,8 @@
 	}
 
 	*stat = BULKSTAT_RV_DIDONE;
+	if (ubused)
+		*ubused = sizeof(*buf);
 	return 0;
 }
 
@@ -231,6 +240,7 @@
 	xfs_ino_t		*lastinop, /* last inode returned */
 	int			*ubcountp, /* size of buffer/count returned */
 	bulkstat_one_pf		formatter, /* func that'd fill a single buf */
+	void			*private_data,/* private data for formatter */
 	size_t			statstruct_size, /* sizeof struct filling */
 	xfs_caddr_t		ubuffer, /* buffer with inode stats */
 	int			flags,	/* defined in xfs_itable.h */
@@ -265,8 +275,10 @@
 	int			rval;	/* return value error code */
 	int			tmp;	/* result value from btree calls */
 	int			ubcount; /* size of user's buffer */
-	int			ubleft;	/* spaces left in user's buffer */
+	int			ubleft;	/* bytes left in user's buffer */
 	xfs_caddr_t		ubufp;	/* current pointer into user's buffer */
+	int			ubelem;	/* spaces used in user's buffer */
+	int			ubused;	/* bytes used by formatter */
 	xfs_buf_t		*bp;	/* ptr to on-disk inode cluster buf */
 	xfs_dinode_t		*dip;	/* ptr into bp for specific inode */
 	xfs_inode_t		*ip;	/* ptr to in-core inode struct */
@@ -284,8 +296,9 @@
 		*ubcountp = 0;
 		return 0;
 	}
-	ubcount = ubleft = *ubcountp;
-	*ubcountp = 0;
+	ubcount = *ubcountp; /* statstruct's */
+	ubleft = ubcount * statstruct_size; /* bytes */
+	*ubcountp = ubelem = 0;
 	*done = 0;
 	fmterror = 0;
 	ubufp = ubuffer;
@@ -317,7 +330,7 @@
 	 * inode returned; 0 means start of the allocation group.
 	 */
 	rval = 0;
-	while (ubleft > 0 && agno < mp->m_sb.sb_agcount) {
+	while (ubleft >= statstruct_size && agno < mp->m_sb.sb_agcount) {
 		bp = NULL;
 		down_read(&mp->m_peraglock);
 		error = xfs_ialloc_read_agi(mp, tp, agno, &agbp);
@@ -453,7 +466,8 @@
 		 * Now format all the good inodes into the user's buffer.
 		 */
 		irbufend = irbp;
-		for (irbp = irbuf; irbp < irbufend && ubleft > 0; irbp++) {
+		for (irbp = irbuf;
+		     irbp < irbufend && ubleft >= statstruct_size; irbp++) {
 			/*
 			 * Read-ahead the next chunk's worth of inodes.
 			 */
@@ -561,14 +575,19 @@
 				 * Get the inode and fill in a single buffer.
 				 * BULKSTAT_FG_QUICK uses dip to fill it in.
 				 * BULKSTAT_FG_IGET uses igets.
-				 * See: xfs_bulkstat_one & dm_bulkstat_one.
+				 * See: xfs_bulkstat_one & xfs_dm_bulkstat_one.
 				 * This is also used to count inodes/blks, etc
 				 * in xfs_qm_quotacheck.
 				 */
-				error = formatter(mp, tp, ino, ubufp, bno, dip,
-					&fmterror);
-				if (fmterror == BULKSTAT_RV_NOTHING)
+				ubused = statstruct_size;
+				error = formatter(mp, tp, ino, ubufp,
+						ubleft, private_data,
+						bno, &ubused, dip, &fmterror);
+				if (fmterror == BULKSTAT_RV_NOTHING) {
+					if (error == ENOMEM)
+						ubleft = 0;
 					continue;
+				}
 				if (fmterror == BULKSTAT_RV_GIVEUP) {
 					ubleft = 0;
 					ASSERT(error);
@@ -576,8 +595,9 @@
 					break;
 				}
 				if (ubufp)
-					ubufp += statstruct_size;
-				ubleft--;
+					ubufp += ubused;
+				ubleft -= ubused;
+				ubelem++;
 				lastino = ino;
 			}
 		}
@@ -605,7 +625,7 @@
 	if (ubuffer)
 		unuseracc(ubuffer, ubcount * statstruct_size, (B_READ|B_PHYS));
 #endif
-	*ubcountp = ubcount - ubleft;
+	*ubcountp = ubelem;
 	if (agno >= mp->m_sb.sb_agcount) {
 		/*
 		 * If we ran out of filesystem, mark lastino as off
@@ -647,7 +667,8 @@
 	 */
 
 	ino = (xfs_ino_t)*lastinop;
-	error = xfs_bulkstat_one(mp, NULL, ino, &bstat, 0, 0, &res);
+	error = xfs_bulkstat_one(mp, NULL, ino, &bstat, sizeof(bstat),
+				 NULL, 0, NULL, NULL, &res);
 	if (error) {
 		/*
 		 * Special case way failed, do it the "long" way
@@ -656,6 +677,7 @@
 		(*lastinop)--;
 		count = 1;
 		if (xfs_bulkstat(mp, NULL, lastinop, &count, xfs_bulkstat_one,
+				NULL,
 				sizeof(bstat), buffer, BULKSTAT_FG_IGET, done))
 			return error;
 		if (count == 0 || (xfs_ino_t)*lastinop != ino)
diff -Nru a/fs/xfs/xfs_itable.h b/fs/xfs/xfs_itable.h
--- a/fs/xfs/xfs_itable.h	Tue Feb  3 19:45:42 2004
+++ b/fs/xfs/xfs_itable.h	Tue Feb  3 19:45:42 2004
@@ -36,15 +36,19 @@
  * xfs_bulkstat() is used to fill in xfs_bstat structures as well as dm_stat
  * structures (by the dmi library). This is a pointer to a formatter function
  * that will iget the inode and fill in the appropriate structure.
- * see xfs_bulkstat_one() and dm_bulkstat_one() in dmi_xfs.c
+ * see xfs_bulkstat_one() and xfs_dm_bulkstat_one() in dmapi_xfs.c
  */
 typedef int (*bulkstat_one_pf)(struct xfs_mount	*mp,
 			       struct xfs_trans	*tp,
 			       xfs_ino_t	ino,
 			       void		*buffer,
+			       int		ubsize,
+			       void		*private_data,
 			       xfs_daddr_t	bno,
+			       int		*ubused,
 			       void		*dip,
 			       int		*stat);
+
 /*
  * Values for stat return value.
  */
@@ -69,6 +73,7 @@
 	xfs_ino_t	*lastino,	/* last inode returned */
 	int		*count,		/* size of buffer/count returned */
 	bulkstat_one_pf formatter,	/* func that'd fill a single buf */
+	void		*private_data,	/* private data for formatter */
 	size_t		statstruct_size,/* sizeof struct that we're filling */
 	xfs_caddr_t	ubuffer,	/* buffer with inode stats */
 	int		flags,		/* flag to control access method */
@@ -87,7 +92,10 @@
 	xfs_trans_t		*tp,
 	xfs_ino_t		ino,
 	void			*buffer,
+	int			ubsize,
+	void			*private_data,
 	xfs_daddr_t		bno,
+	int			*ubused,
 	void			*dibuff,
 	int			*stat);
 
diff -Nru a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
--- a/fs/xfs/xfs_log.c	Tue Feb  3 19:45:43 2004
+++ b/fs/xfs/xfs_log.c	Tue Feb  3 19:45:43 2004
@@ -159,11 +159,15 @@
 #endif
 
 #if defined(XFS_LOG_TRACE)
+
 void
 xlog_trace_loggrant(xlog_t *log, xlog_ticket_t *tic, xfs_caddr_t string)
 {
-	if (! log->l_grant_trace)
-		log->l_grant_trace = ktrace_alloc(1024, KM_SLEEP);
+	if (! log->l_grant_trace) {
+		log->l_grant_trace = ktrace_alloc(1024, KM_NOSLEEP);
+		if (! log->l_grant_trace)
+			return;
+	}
 
 	ktrace_enter(log->l_grant_trace,
 		     (void *)tic,
@@ -185,31 +189,6 @@
 }
 
 void
-xlog_trace_tic(xlog_t *log, xlog_ticket_t *tic)
-{
-	if (! log->l_trace)
-		log->l_trace = ktrace_alloc(256, KM_SLEEP);
-
-	ktrace_enter(log->l_trace,
-		     (void *)tic,
-		     (void *)((unsigned long)tic->t_curr_res),
-		     (void *)((unsigned long)tic->t_unit_res),
-		     (void *)((unsigned long)tic->t_ocnt),
-		     (void *)((unsigned long)tic->t_cnt),
-		     (void *)((unsigned long)tic->t_flags),
-		     (void *)((unsigned long)7),
-		     (void *)((unsigned long)8),
-		     (void *)((unsigned long)9),
-		     (void *)((unsigned long)10),
-		     (void *)((unsigned long)11),
-		     (void *)((unsigned long)12),
-		     (void *)((unsigned long)13),
-		     (void *)((unsigned long)14),
-		     (void *)((unsigned long)15),
-		     (void *)((unsigned long)16));
-}
-
-void
 xlog_trace_iclog(xlog_in_core_t *iclog, uint state)
 {
 	pid_t pid;
@@ -1044,7 +1023,6 @@
  *
  * If the filesystem blocksize is too large, we may need to choose a
  * larger size since the directory code currently logs entire blocks.
- * XXXmiken XXXcurtis
  */
 
 STATIC void
@@ -1059,7 +1037,7 @@
 	 * When logbufs == 0, someone has disabled the log from the FSTAB
 	 * file.  This is not a documented feature.  We need to set xlog_debug
 	 * to zero (this deactivates the log) and set xlog_target to the
-	 * appropriate dev_t.  Only one filesystem may be affected as such
+	 * appropriate device.  Only one filesystem may be affected as such
 	 * since this is just a performance hack to test what we might be able
 	 * to get if the log were not present.
 	 */
@@ -1078,7 +1056,7 @@
 			if (xfs_physmem <= btoc(128*1024*1024)) { 
 				log->l_iclog_bufs = XLOG_MIN_ICLOGS; 
 			} else if (xfs_physmem <= btoc(400*1024*1024)) { 
-				log->l_iclog_bufs = XLOG_MED_ICLOGS;; 
+				log->l_iclog_bufs = XLOG_MED_ICLOGS; 
 			} else {
 				/* 256K with 32K bufs */
 				log->l_iclog_bufs = XLOG_MAX_ICLOGS;
@@ -1087,9 +1065,9 @@
 			log->l_iclog_bufs = mp->m_logbufs;
 
 #if defined(DEBUG) || defined(XLOG_NOLOG)
-		/* We are reactivating a filesystem after it was active */
+		/* We are reactivating a filesystem after it was inactive */
 		if (log->l_targ == xlog_target) {
-			xlog_target = 1; /* XXX(hch): WTF? */
+			xlog_target = NULL;
 			xlog_debug = 1;
 		}
 #endif
@@ -1578,7 +1556,7 @@
 		sv_destroy(&iclog->ic_forcesema);
 		sv_destroy(&iclog->ic_writesema);
 		xfs_buf_free(iclog->ic_bp);
-#ifdef DEBUG
+#ifdef XFS_LOG_TRACE
 		if (iclog->ic_trace != NULL) {
 			ktrace_free(iclog->ic_trace);
 		}
@@ -1609,7 +1587,7 @@
 		}
 	}
 	xfs_buf_free(log->l_xbuf);
-#ifdef DEBUG
+#ifdef XFS_LOG_TRACE
 	if (log->l_trace != NULL) {
 		ktrace_free(log->l_trace);
 	}
diff -Nru a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h
--- a/fs/xfs/xfs_log.h	Tue Feb  3 19:45:43 2004
+++ b/fs/xfs/xfs_log.h	Tue Feb  3 19:45:43 2004
@@ -53,8 +53,8 @@
  * endian issues in treating two 32 bit numbers as one 64 bit number
  */
 static
-#if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 95)
-__attribute__((unused))	/* gcc 2.95 miscompiles this when inlined */
+#if defined(__GNUC__) && (__GNUC__ == 2) && ( (__GNUC_MINOR__ == 95) || (__GNUC_MINOR__ == 96))
+__attribute__((unused))	/* gcc 2.95, 2.96 miscompile this when inlined */
 #else
 __inline__
 #endif
diff -Nru a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
--- a/fs/xfs/xfs_log_priv.h	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/xfs_log_priv.h	Tue Feb  3 19:45:17 2004
@@ -32,14 +32,6 @@
 #ifndef	__XFS_LOG_PRIV_H__
 #define __XFS_LOG_PRIV_H__
 
-#if defined(XFS_ALL_TRACE)
-#define	XFS_LOG_TRACE
-#endif
-
-#if !defined(DEBUG)
-#undef XFS_LOG_TRACE
-#endif
-
 struct xfs_buf;
 struct ktrace;
 struct log;
@@ -109,6 +101,7 @@
 
 
 #ifdef __KERNEL__
+
 /*
  * get client id from packed copy.
  *
@@ -434,7 +427,7 @@
 	struct log		*ic_log;
 	xfs_log_callback_t	*ic_callback;
 	xfs_log_callback_t	**ic_callback_tail;
-#ifdef DEBUG
+#ifdef XFS_LOG_TRACE
 	struct ktrace		*ic_trace;
 #endif
 	int			ic_size;
@@ -531,7 +524,7 @@
 	int			l_grant_write_bytes;
 
 	/* The following fields don't need locking */
-#ifdef DEBUG
+#ifdef XFS_LOG_TRACE
 	struct ktrace		*l_trace;
 	struct ktrace		*l_grant_trace;
 #endif
diff -Nru a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
--- a/fs/xfs/xfs_log_recover.c	Tue Feb  3 19:45:28 2004
+++ b/fs/xfs/xfs_log_recover.c	Tue Feb  3 19:45:28 2004
@@ -1531,7 +1531,7 @@
 	xlog_recover_item_t	*first_item, *itemq, *itemq_next;
 	xfs_buf_log_format_t	*buf_f;
 	xfs_buf_log_format_v1_t	*obuf_f;
-	ushort			flags;
+	ushort			flags = 0;
 
 	first_item = itemq = trans->r_itemq;
 	trans->r_itemq = NULL;
@@ -1553,7 +1553,7 @@
 		case XFS_LI_BUF:
 		case XFS_LI_6_1_BUF:
 		case XFS_LI_5_3_BUF:
-			if ((!flags & XFS_BLI_CANCEL)) {
+			if (!(flags & XFS_BLI_CANCEL)) {
 				xlog_recover_insert_item_frontq(&trans->r_itemq,
 								itemq);
 				break;
diff -Nru a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
--- a/fs/xfs/xfs_mount.c	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/xfs_mount.c	Tue Feb  3 19:45:17 2004
@@ -903,7 +903,7 @@
 	 *  File systems that don't support user level file handles (i.e.
 	 *  all of them except for XFS) will leave vfs_altfsid as NULL.
 	 */
-	vfsp->vfs_altfsid = (fsid_t *)mp->m_fixedfsid;
+	vfsp->vfs_altfsid = (xfs_fsid_t *)mp->m_fixedfsid;
 	mp->m_dmevmask = 0;	/* not persistent; set after each mount */
 
 	/*
diff -Nru a/fs/xfs/xfs_qmops.c b/fs/xfs/xfs_qmops.c
--- a/fs/xfs/xfs_qmops.c	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/xfs_qmops.c	Tue Feb  3 19:45:17 2004
@@ -44,7 +44,6 @@
 #include "xfs_mount.h"
 
 
-#ifndef CONFIG_XFS_QUOTA
 STATIC struct xfs_dquot *
 xfs_dqvopchown_default(
 	struct xfs_trans	*tp,
@@ -70,4 +69,3 @@
 	.xfs_dqvopchown		= xfs_dqvopchown_default,
 	.xfs_dqvopchownresv	= (xfs_dqvopchownresv_t) fs_noerr,
 };
-#endif /* CONFIG_XFS_QUOTA */
diff -Nru a/fs/xfs/xfs_refcache.h b/fs/xfs/xfs_refcache.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/fs/xfs/xfs_refcache.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+#ifndef __XFS_REFCACHE_H__
+#define __XFS_REFCACHE_H__
+
+#ifdef HAVE_REFCACHE
+/*
+ * Maximum size (in inodes) for the NFS reference cache
+ */
+#define XFS_REFCACHE_SIZE_MAX	512
+
+struct xfs_inode;
+struct xfs_mount;
+
+extern void xfs_refcache_insert(struct xfs_inode *);
+extern void xfs_refcache_purge_ip(struct xfs_inode *);
+extern void xfs_refcache_purge_mp(struct xfs_mount *);
+extern void xfs_refcache_purge_some(struct xfs_mount *);
+extern void xfs_refcache_resize(int);
+extern void xfs_refcache_destroy(void);
+
+extern void xfs_refcache_iunlock(struct xfs_inode *, uint);
+
+#else
+
+#define xfs_refcache_insert(ip)		do { } while (0)
+#define xfs_refcache_purge_ip(ip)	do { } while (0)
+#define xfs_refcache_purge_mp(mp)	do { } while (0)
+#define xfs_refcache_purge_some(mp)	do { } while (0)
+#define xfs_refcache_resize(size)	do { } while (0)
+#define xfs_refcache_destroy()		do { } while (0)
+
+#define xfs_refcache_iunlock(ip, flags)	xfs_iunlock(ip, flags)
+
+#endif
+
+#endif	/* __XFS_REFCACHE_H__ */
diff -Nru a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c
--- a/fs/xfs/xfs_rename.c	Tue Feb  3 19:45:18 2004
+++ b/fs/xfs/xfs_rename.c	Tue Feb  3 19:45:18 2004
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -51,7 +51,7 @@
 #include "xfs_bmap.h"
 #include "xfs_error.h"
 #include "xfs_quota.h"
-#include "xfs_rw.h"
+#include "xfs_refcache.h"
 #include "xfs_utils.h"
 #include "xfs_trans_space.h"
 #include "xfs_da_btree.h"
@@ -343,8 +343,7 @@
 	src_is_directory = ((src_ip->i_d.di_mode & S_IFMT) == S_IFDIR);
 
 	/*
-	 * Drop the locks on our inodes so that we can do the ancestor
-	 * check if necessary and start the transaction.
+	 * Drop the locks on our inodes so that we can start the transaction.
 	 */
 	xfs_rename_unlock4(inodes, XFS_ILOCK_SHARED);
 
@@ -486,7 +485,7 @@
 		error = xfs_droplink(tp, target_ip);
 		if (error) {
 			rename_which_error_return = __LINE__;
-			goto abort_return;;
+			goto abort_return;
 		}
 		target_ip_dropped = 1;
 
@@ -627,6 +626,7 @@
 	 */
 	error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES, NULL);
 	if (target_ip != NULL) {
+		xfs_refcache_purge_ip(target_ip);
 		IRELE(target_ip);
 	}
 	/*
diff -Nru a/fs/xfs/xfs_rw.c b/fs/xfs/xfs_rw.c
--- a/fs/xfs/xfs_rw.c	Tue Feb  3 19:45:42 2004
+++ b/fs/xfs/xfs_rw.c	Tue Feb  3 19:45:42 2004
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -149,6 +149,9 @@
 		xfs_cmn_err(XFS_PTAG_SHUTDOWN_CORRUPT, CE_ALERT, mp,
     "Corruption of in-memory data detected.  Shutting down filesystem: %s",
 			mp->m_fsname);
+		if (XFS_ERRLEVEL_HIGH <= xfs_error_level) {
+			xfs_stack_trace();
+		}
 	} else if (!(flags & XFS_FORCE_UMOUNT)) {
 		if (logerror) {
 			xfs_cmn_err(XFS_PTAG_SHUTDOWN_LOGERROR, CE_ALERT, mp,
@@ -350,55 +353,4 @@
 		xfs_force_shutdown(mp, XFS_METADATA_IO_ERROR);
 	}
 	return (error);
-}
-
-/*
- * xfs_inval_cached_pages()
- * This routine is responsible for keeping direct I/O and buffered I/O
- * somewhat coherent.  From here we make sure that we're at least
- * temporarily holding the inode I/O lock exclusively and then call
- * the page cache to flush and invalidate any cached pages.  If there
- * are no cached pages this routine will be very quick.
- */
-void
-xfs_inval_cached_pages(
-	vnode_t		*vp,
-	xfs_iocore_t	*io,
-	xfs_off_t	offset,
-	int		write,
-	int		relock)
-{
-	xfs_mount_t	*mp;
-
-	if (!VN_CACHED(vp)) {
-		return;
-	}
-
-	mp = io->io_mount;
-
-	/*
-	 * We need to get the I/O lock exclusively in order
-	 * to safely invalidate pages and mappings.
-	 */
-	if (relock) {
-		XFS_IUNLOCK(mp, io, XFS_IOLOCK_SHARED);
-		XFS_ILOCK(mp, io, XFS_IOLOCK_EXCL);
-	}
-
-	/* Writing beyond EOF creates a hole that must be zeroed */
-	if (write && (offset > XFS_SIZE(mp, io))) {
-		xfs_fsize_t	isize;
-
-		XFS_ILOCK(mp, io, XFS_ILOCK_EXCL|XFS_EXTSIZE_RD);
-		isize = XFS_SIZE(mp, io);
-		if (offset > isize) {
-			xfs_zero_eof(vp, io, offset, isize, offset);
-		}
-		XFS_IUNLOCK(mp, io, XFS_ILOCK_EXCL|XFS_EXTSIZE_RD);
-	}
-
-	VOP_FLUSHINVAL_PAGES(vp, ctooff(offtoct(offset)), -1, FI_REMAPF_LOCKED);
-	if (relock) {
-		XFS_ILOCK_DEMOTE(mp, io, XFS_IOLOCK_EXCL);
-	}
 }
diff -Nru a/fs/xfs/xfs_rw.h b/fs/xfs/xfs_rw.h
--- a/fs/xfs/xfs_rw.h	Tue Feb  3 19:45:16 2004
+++ b/fs/xfs/xfs_rw.h	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -32,16 +32,9 @@
 #ifndef	__XFS_RW_H__
 #define	__XFS_RW_H__
 
-struct bhv_desc;
-struct bmapval;
 struct xfs_buf;
-struct cred;
-struct uio;
-struct vnode;
 struct xfs_inode;
-struct xfs_iocore;
 struct xfs_mount;
-struct xfs_trans;
 
 /*
  * Maximum count of bmaps used by read and write paths.
@@ -91,44 +84,6 @@
 		 XFS_FSB_TO_DADDR((io)->io_mount, (fsb)))
 
 /*
- * Defines for the trace mechanisms in xfs_rw.c.
- */
-#define	XFS_RW_KTRACE_SIZE	64
-#define	XFS_STRAT_KTRACE_SIZE	64
-#define	XFS_STRAT_GTRACE_SIZE	512
-
-#define	XFS_READ_ENTER		1
-#define	XFS_WRITE_ENTER		2
-#define XFS_IOMAP_READ_ENTER	3
-#define	XFS_IOMAP_WRITE_ENTER	4
-#define	XFS_IOMAP_READ_MAP	5
-#define	XFS_IOMAP_WRITE_MAP	6
-#define	XFS_IOMAP_WRITE_NOSPACE	7
-#define	XFS_ITRUNC_START	8
-#define	XFS_ITRUNC_FINISH1	9
-#define	XFS_ITRUNC_FINISH2	10
-#define	XFS_CTRUNC1		11
-#define	XFS_CTRUNC2		12
-#define	XFS_CTRUNC3		13
-#define	XFS_CTRUNC4		14
-#define	XFS_CTRUNC5		15
-#define	XFS_CTRUNC6		16
-#define	XFS_BUNMAPI		17
-#define	XFS_INVAL_CACHED	18
-#define	XFS_DIORD_ENTER		19
-#define	XFS_DIOWR_ENTER		20
-
-#if defined(XFS_ALL_TRACE)
-#define	XFS_RW_TRACE
-#define	XFS_STRAT_TRACE
-#endif
-
-#if !defined(DEBUG)
-#undef XFS_RW_TRACE
-#undef XFS_STRAT_TRACE
-#endif
-
-/*
  * Prototypes for functions in xfs_rw.c.
  */
 
@@ -140,14 +95,6 @@
 xfs_bwrite(
 	struct xfs_mount	*mp,
 	struct xfs_buf		*bp);
-
-void
-xfs_inval_cached_pages(
-	struct vnode		*vp,
-	struct xfs_iocore	*io,
-	xfs_off_t		offset,
-	int			write,
-	int			relock);
 
 int
 xfs_bioerror(
diff -Nru a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
--- a/fs/xfs/xfs_trans.c	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/xfs_trans.c	Tue Feb  3 19:45:17 2004
@@ -142,9 +142,9 @@
 	uint		type)
 {
 	xfs_trans_t	*tp;
+
 	ASSERT(xfs_trans_zone != NULL);
 	tp = kmem_zone_zalloc(xfs_trans_zone, KM_SLEEP);
-	tp->t_dqinfo = NULL;
 
 	/*
 	 * Initialize the transaction structure.
diff -Nru a/fs/xfs/xfs_types.h b/fs/xfs/xfs_types.h
--- a/fs/xfs/xfs_types.h	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/xfs_types.h	Tue Feb  3 19:45:17 2004
@@ -75,24 +75,6 @@
 #error BITS_PER_LONG must be 32 or 64
 #endif
 
-/*
- * Some types are conditional depending on the target system.
- * XFS_BIG_BLKNOS needs block layer disk addresses to be 64 bits.
- * XFS_BIG_INUMS needs the VFS inode number to be 64 bits, as well
- * as requiring XFS_BIG_BLKNOS to be set.
- */
-#if defined(CONFIG_LBD) || (BITS_PER_LONG == 64)
-# define XFS_BIG_BLKNOS	1
-# if BITS_PER_LONG == 64
-#  define XFS_BIG_INUMS	1
-# else
-#  define XFS_BIG_INUMS	0
-# endif
-#else
-# define XFS_BIG_BLKNOS	0
-# define XFS_BIG_INUMS	0
-#endif
-
 #endif	/* __KERNEL__ */
 
 typedef __uint32_t	xfs_agblock_t;	/* blockno in alloc. group */
diff -Nru a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
--- a/fs/xfs/xfs_vfsops.c	Tue Feb  3 19:45:17 2004
+++ b/fs/xfs/xfs_vfsops.c	Tue Feb  3 19:45:17 2004
@@ -60,6 +60,7 @@
 #include "xfs_bmap.h"
 #include "xfs_da_btree.h"
 #include "xfs_rw.h"
+#include "xfs_refcache.h"
 #include "xfs_buf_item.h"
 #include "xfs_extfree_item.h"
 #include "xfs_quota.h"
@@ -74,24 +75,11 @@
 int
 xfs_init(void)
 {
-	extern kmem_zone_t	*xfs_da_state_zone;
 	extern kmem_zone_t	*xfs_bmap_free_item_zone;
 	extern kmem_zone_t	*xfs_btree_cur_zone;
-	extern kmem_zone_t	*xfs_inode_zone;
-	extern kmem_zone_t	*xfs_chashlist_zone;
 	extern kmem_zone_t	*xfs_trans_zone;
 	extern kmem_zone_t	*xfs_buf_item_zone;
-	extern kmem_zone_t	*xfs_efd_zone;
-	extern kmem_zone_t	*xfs_efi_zone;
 	extern kmem_zone_t	*xfs_dabuf_zone;
-#ifdef DEBUG_NOT
-	extern ktrace_t	        *xfs_alloc_trace_buf;
-	extern ktrace_t	        *xfs_bmap_trace_buf;
-	extern ktrace_t	        *xfs_bmbt_trace_buf;
-	extern ktrace_t	        *xfs_dir_trace_buf;
-	extern ktrace_t	        *xfs_attr_trace_buf;
-	extern ktrace_t	        *xfs_dir2_trace_buf;
-#endif	/* DEBUG */
 #ifdef XFS_DABUF_DEBUG
 	extern lock_t	        xfs_dabuf_global_lock;
 	spinlock_init(&xfs_dabuf_global_lock, "xfsda");
@@ -132,14 +120,6 @@
 					    "xfs_chashlist");
 	_ACL_ZONE_INIT(xfs_acl_zone, "xfs_acl");
 
-#ifdef CONFIG_XFS_VNODE_TRACING
-	ktrace_init(VNODE_TRACE_SIZE);
-#else
-#ifdef DEBUG
-	ktrace_init(64);
-#endif
-#endif
-
 	/*
 	 * Allocate global trace buffers.
 	 */
@@ -189,6 +169,26 @@
 
 	xfs_cleanup_procfs();
 	xfs_sysctl_unregister();
+	xfs_refcache_destroy();
+
+#ifdef XFS_DIR2_TRACE
+	ktrace_free(xfs_dir2_trace_buf);
+#endif
+#ifdef XFS_ATTR_TRACE
+	ktrace_free(xfs_attr_trace_buf);
+#endif
+#ifdef XFS_DIR_TRACE
+	ktrace_free(xfs_dir_trace_buf);
+#endif
+#ifdef XFS_BMBT_TRACE
+	ktrace_free(xfs_bmbt_trace_buf);
+#endif
+#ifdef XFS_BMAP_TRACE
+	ktrace_free(xfs_bmap_trace_buf);
+#endif
+#ifdef XFS_ALLOC_TRACE
+	ktrace_free(xfs_alloc_trace_buf);
+#endif
 
 	kmem_cache_destroy(xfs_bmap_free_item_zone);
 	kmem_cache_destroy(xfs_btree_cur_zone);
@@ -203,9 +203,6 @@
 	kmem_cache_destroy(xfs_ili_zone);
 	kmem_cache_destroy(xfs_chashlist_zone);
 	_ACL_ZONE_DESTROY(xfs_acl_zone);
-#if  (defined(DEBUG) || defined(CONFIG_XFS_VNODE_TRACING))
-	ktrace_uninit();
-#endif
 }
 
 /*
@@ -547,6 +544,12 @@
 					0 : DM_FLAGS_UNWANTED;
 	}
 
+	/*
+	 * First blow any referenced inode from this file system
+	 * out of the reference cache, and delete the timer.
+	 */
+	xfs_refcache_purge_mp(mp);
+
 	XFS_bflush(mp->m_ddev_targp);
 	error = xfs_unmount_flush(mp, 0);
 	if (error)
@@ -617,6 +620,7 @@
 	}
 
 	if (*flags & MS_RDONLY) {
+		xfs_refcache_purge_mp(mp);
 		pagebuf_delwri_flush(mp->m_ddev_targp, 0, NULL);
 		xfs_finish_reclaim_all(mp, 0);
 
@@ -758,7 +762,7 @@
 STATIC int
 xfs_statvfs(
 	bhv_desc_t	*bdp,
-	struct kstatfs	*statp,
+	xfs_statfs_t	*statp,
 	vnode_t		*vp)
 {
 	__uint64_t	fakeinos;
@@ -1489,8 +1493,18 @@
 	}
 
 	/*
+	 * If this is the periodic sync, then kick some entries out of
+	 * the reference cache.  This ensures that idle entries are
+	 * eventually kicked out of the cache.
+	 */
+	if (flags & SYNC_REFCACHE) {
+		xfs_refcache_purge_some(mp);
+	}
+
+	/*
 	 * Now check to see if the log needs a "dummy" transaction.
 	 */
+
 	if (!(flags & SYNC_REMOUNT) && xfs_log_need_covered(mp)) {
 		xfs_trans_t *tp;
 		xfs_inode_t *ip;
@@ -1789,10 +1803,14 @@
 		char	*str;
 	} xfs_info[] = {
 		/* the few simple ones we can get from the mount struct */
+		{ XFS_MOUNT_WSYNC,		"," MNTOPT_WSYNC },
+		{ XFS_MOUNT_INO64,		"," MNTOPT_INO64 },
 		{ XFS_MOUNT_NOALIGN,		"," MNTOPT_NOALIGN },
+		{ XFS_MOUNT_NOUUID,		"," MNTOPT_NOUUID },
 		{ XFS_MOUNT_NORECOVERY,		"," MNTOPT_NORECOVERY },
 		{ XFS_MOUNT_OSYNCISOSYNC,	"," MNTOPT_OSYNCISOSYNC },
-		{ XFS_MOUNT_NOUUID,		"," MNTOPT_NOUUID },
+		{ XFS_MOUNT_NOLOGFLUSH,		"," MNTOPT_NOLOGFLUSH },
+		{ XFS_MOUNT_IDELETE,		"," MNTOPT_NOIKEEP },
 		{ 0, NULL }
 	};
 	struct proc_xfs_info	*xfs_infop;
@@ -1828,6 +1846,9 @@
 		seq_printf(m, "," MNTOPT_SWIDTH "=%d",
 				(int)XFS_FSB_TO_BB(mp, mp->m_swidth));
 
+	if (!(mp->m_flags & XFS_MOUNT_32BITINOOPT))
+		seq_printf(m, "," MNTOPT_64BITINODE);
+	
 	return 0;
 }
 
diff -Nru a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
--- a/fs/xfs/xfs_vnodeops.c	Tue Feb  3 19:45:43 2004
+++ b/fs/xfs/xfs_vnodeops.c	Tue Feb  3 19:45:43 2004
@@ -59,6 +59,7 @@
 #include "xfs_da_btree.h"
 #include "xfs_attr.h"
 #include "xfs_rw.h"
+#include "xfs_refcache.h"
 #include "xfs_error.h"
 #include "xfs_bit.h"
 #include "xfs_rtalloc.h"
@@ -77,10 +78,6 @@
  */
 #define SYMLINK_MAPS 2
 
-extern int xfs_ioctl(bhv_desc_t *, struct inode *, struct file *,
-			int, unsigned int, unsigned long);
-
-
 /*
  * For xfs, we check that the file isn't too big to be opened by this kernel.
  * No other open action is required for regular files.  Devices are handled
@@ -434,7 +431,7 @@
 	}
 
 	/* boolean: are we the file owner? */
-	file_owner = (current->fsuid == ip->i_d.di_uid);
+	file_owner = (current_fsuid(credp) == ip->i_d.di_uid);
 
 	/*
 	 * Change various properties of a file.
@@ -1660,6 +1657,12 @@
 	if (vp->v_vfsp->vfs_flag & VFS_RDONLY)
 		return 0;
 
+#ifdef HAVE_REFCACHE
+	/* If we are in the NFS reference cache then don't do this now */
+	if (ip->i_refcache)
+		return 0;
+#endif
+
 	mp = ip->i_mount;
 
 	if (ip->i_d.di_nlink != 0) {
@@ -2004,7 +2007,8 @@
 	/*
 	 * Make sure that we have allocated dquot(s) on disk.
 	 */
-	error = XFS_QM_DQVOPALLOC(mp, dp, current->fsuid, current->fsgid,
+	error = XFS_QM_DQVOPALLOC(mp, dp,
+			current_fsuid(credp), current_fsgid(credp),
 			XFS_QMOPT_QUOTALL|XFS_QMOPT_INHERIT, &udqp, &gdqp);
 	if (error)
 		goto std_return;
@@ -2613,6 +2617,14 @@
 		goto std_return;
 	}
 
+	/*
+	 * Before we drop our extra reference to the inode, purge it
+	 * from the refcache if it is there.  By waiting until afterwards
+	 * to do the IRELE, we ensure that we won't go inactive in the
+	 * xfs_refcache_purge_ip routine (although that would be OK).
+	 */
+	xfs_refcache_purge_ip(ip);
+
 	vn_trace_exit(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address);
 
 	/*
@@ -2652,6 +2664,14 @@
 	cancel_flags |= XFS_TRANS_ABORT;
 	xfs_trans_cancel(tp, cancel_flags);
 
+	/*
+	 * Before we drop our extra reference to the inode, purge it
+	 * from the refcache if it is there.  By waiting until afterwards
+	 * to do the IRELE, we ensure that we won't go inactive in the
+	 * xfs_refcache_purge_ip routine (although that would be OK).
+	 */
+	xfs_refcache_purge_ip(ip);
+
 	IRELE(ip);
 
 	goto std_return;
@@ -2899,7 +2919,8 @@
 	/*
 	 * Make sure that we have allocated dquot(s) on disk.
 	 */
-	error = XFS_QM_DQVOPALLOC(mp, dp, current->fsuid, current->fsgid,
+	error = XFS_QM_DQVOPALLOC(mp, dp,
+			current_fsuid(credp), current_fsgid(credp),
 			XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, &udqp, &gdqp);
 	if (error)
 		goto std_return;
@@ -3456,7 +3477,8 @@
 	/*
 	 * Make sure that we have allocated dquot(s) on disk.
 	 */
-	error = XFS_QM_DQVOPALLOC(mp, dp, current->fsuid, current->fsgid,
+	error = XFS_QM_DQVOPALLOC(mp, dp,
+			current_fsuid(credp), current_fsgid(credp),
 			XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, &udqp, &gdqp);
 	if (error)
 		goto std_return;
@@ -3743,7 +3765,14 @@
 		return;
 	ip = XFS_BHVTOI(bdp);
 	if (locktype == VRWLOCK_WRITE) {
-		xfs_iunlock (ip, XFS_IOLOCK_EXCL);
+		/*
+		 * In the write case, we may have added a new entry to
+		 * the reference cache.  This might store a pointer to
+		 * an inode to be released in this inode.  If it is there,
+		 * clear the pointer and release the inode after unlocking
+		 * this one.
+		 */
+		xfs_refcache_iunlock(ip, XFS_IOLOCK_EXCL);
 	} else {
 		ASSERT((locktype == VRWLOCK_READ) ||
 		       (locktype == VRWLOCK_WRITE_DIRECT));
@@ -4738,7 +4767,9 @@
 	BHV_IDENTITY_INIT(VN_BHV_XFS,VNODE_POSITION_XFS),
 	.vop_open		= xfs_open,
 	.vop_read		= xfs_read,
+#ifdef HAVE_SENDFILE
 	.vop_sendfile		= xfs_sendfile,
+#endif
 	.vop_write		= xfs_write,
 	.vop_ioctl		= xfs_ioctl,
 	.vop_getattr		= xfs_getattr,
diff -Nru a/fs/xfs/xfsidbg.c b/fs/xfs/xfsidbg.c
--- a/fs/xfs/xfsidbg.c	Tue Feb  3 19:45:37 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,5442 +0,0 @@
-/*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
- */
-
-#include "xfs.h"
-#include "pagebuf/page_buf_internal.h"
-
-#include <linux/ctype.h>
-#include <linux/kdb.h>
-#include <linux/kdbprivate.h>
-#include <linux/mm.h>
-#include <linux/init.h>
-
-#include "xfs_macros.h"
-#include "xfs_types.h"
-#include "xfs_inum.h"
-#include "xfs_log.h"
-#include "xfs_trans.h"
-#include "xfs_sb.h"
-#include "xfs_dir.h"
-#include "xfs_dir2.h"
-#include "xfs_dmapi.h"
-#include "xfs_mount.h"
-#include "xfs_alloc.h"
-#include "xfs_ag.h"
-#include "xfs_alloc_btree.h"
-#include "xfs_bmap_btree.h"
-#include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_buf_item.h"
-#include "xfs_extfree_item.h"
-#include "xfs_inode_item.h"
-#include "xfs_attr_sf.h"
-#include "xfs_dir_sf.h"
-#include "xfs_dir2_sf.h"
-#include "xfs_dinode.h"
-#include "xfs_inode.h"
-#include "xfs_bmap.h"
-#include "xfs_da_btree.h"
-#include "xfs_attr.h"
-#include "xfs_attr_leaf.h"
-#include "xfs_dir_leaf.h"
-#include "xfs_dir2_data.h"
-#include "xfs_dir2_leaf.h"
-#include "xfs_dir2_block.h"
-#include "xfs_dir2_node.h"
-#include "xfs_dir2_trace.h"
-#include "xfs_log_priv.h"
-#include "xfs_log_recover.h"
-#include "xfs_rw.h"
-#include "xfs_bit.h"
-#include "xfs_quota.h"
-#include "quota/xfs_qm.h"
-
-MODULE_AUTHOR("Silicon Graphics, Inc.");
-MODULE_DESCRIPTION("Additional kdb commands for debugging XFS");
-MODULE_LICENSE("GPL");
-
-/*
- * Command table functions.
- */
-static void	xfsidbg_xagf(xfs_agf_t *);
-static void	xfsidbg_xagi(xfs_agi_t *);
-static void	xfsidbg_xaildump(xfs_mount_t *);
-static void	xfsidbg_xalloc(xfs_alloc_arg_t *);
-#ifdef DEBUG
-static void	xfsidbg_xalmtrace(xfs_mount_t *);
-#endif
-static void	xfsidbg_xattrcontext(xfs_attr_list_context_t *);
-static void	xfsidbg_xattrleaf(xfs_attr_leafblock_t *);
-static void	xfsidbg_xattrsf(xfs_attr_shortform_t *);
-static void	xfsidbg_xbirec(xfs_bmbt_irec_t *r);
-static void	xfsidbg_xbmalla(xfs_bmalloca_t *);
-static void	xfsidbg_xbrec(xfs_bmbt_rec_64_t *);
-static void	xfsidbg_xbroot(xfs_inode_t *);
-static void	xfsidbg_xbroota(xfs_inode_t *);
-static void	xfsidbg_xbtcur(xfs_btree_cur_t *);
-static void	xfsidbg_xbuf(xfs_buf_t *);
-static void	xfsidbg_xbuf_real(xfs_buf_t *, int);
-static void	xfsidbg_xchash(xfs_mount_t *mp);
-static void	xfsidbg_xchashlist(xfs_chashlist_t *chl);
-static void	xfsidbg_xdaargs(xfs_da_args_t *);
-static void	xfsidbg_xdabuf(xfs_dabuf_t *);
-static void	xfsidbg_xdanode(xfs_da_intnode_t *);
-static void	xfsidbg_xdastate(xfs_da_state_t *);
-static void	xfsidbg_xdirleaf(xfs_dir_leafblock_t *);
-static void	xfsidbg_xdirsf(xfs_dir_shortform_t *);
-static void	xfsidbg_xdir2free(xfs_dir2_free_t *);
-static void	xfsidbg_xdir2sf(xfs_dir2_sf_t *);
-static void	xfsidbg_xexlist(xfs_inode_t *);
-static void	xfsidbg_xflist(xfs_bmap_free_t *);
-static void	xfsidbg_xhelp(void);
-static void	xfsidbg_xiclog(xlog_in_core_t *);
-static void	xfsidbg_xiclogall(xlog_in_core_t *);
-static void	xfsidbg_xiclogcb(xlog_in_core_t *);
-static void	xfsidbg_xihash(xfs_mount_t *mp);
-static void	xfsidbg_xinodes(xfs_mount_t *);
-static void	xfsidbg_delayed_blocks(xfs_mount_t *);
-static void	xfsidbg_xinodes_quiesce(xfs_mount_t *);
-static void	xfsidbg_xlog(xlog_t *);
-static void	xfsidbg_xlog_ritem(xlog_recover_item_t *);
-static void	xfsidbg_xlog_rtrans(xlog_recover_t *);
-static void	xfsidbg_xlog_rtrans_entire(xlog_recover_t *);
-static void	xfsidbg_xlog_tic(xlog_ticket_t *);
-static void	xfsidbg_xlogitem(xfs_log_item_t *);
-static void	xfsidbg_xmount(xfs_mount_t *);
-static void	xfsidbg_xnode(xfs_inode_t *ip);
-static void	xfsidbg_xcore(xfs_iocore_t *io);
-static void	xfsidbg_xperag(xfs_mount_t *);
-static void	xfsidbg_xqm_diskdq(xfs_disk_dquot_t *);
-static void	xfsidbg_xqm_dqattached_inos(xfs_mount_t *);
-static void	xfsidbg_xqm_dquot(xfs_dquot_t *);
-static void	xfsidbg_xqm_mplist(xfs_mount_t *);
-static void	xfsidbg_xqm_qinfo(xfs_mount_t *mp);
-static void	xfsidbg_xqm_tpdqinfo(xfs_trans_t *tp);
-static void	xfsidbg_xsb(xfs_sb_t *, int convert);
-static void	xfsidbg_xtp(xfs_trans_t *);
-static void	xfsidbg_xtrans_res(xfs_mount_t *);
-#ifdef	CONFIG_XFS_QUOTA
-static void	xfsidbg_xqm(void);
-static void	xfsidbg_xqm_htab(void);
-static void	xfsidbg_xqm_freelist_print(xfs_frlist_t *qlist, char *title);
-static void	xfsidbg_xqm_freelist(void);
-#endif
-
-/* kdb wrappers */
-
-static int	kdbm_xfs_xagf(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xagf((xfs_agf_t *)addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xagi(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xagi((xfs_agi_t *)addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xaildump(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xaildump((xfs_mount_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xalloc(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xalloc((xfs_alloc_arg_t *) addr);
-	return 0;
-}
-
-#ifdef DEBUG
-static int	kdbm_xfs_xalmtrace(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xalmtrace((xfs_mount_t *) addr);
-	return 0;
-}
-#endif /* DEBUG */
-
-static int	kdbm_xfs_xattrcontext(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xattrcontext((xfs_attr_list_context_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xattrleaf(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xattrleaf((xfs_attr_leafblock_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xattrsf(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xattrsf((xfs_attr_shortform_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xbirec(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xbirec((xfs_bmbt_irec_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xbmalla(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xbmalla((xfs_bmalloca_t *)addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xbrec(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xbrec((xfs_bmbt_rec_64_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xbroot(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xbroot((xfs_inode_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xbroota(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xbroota((xfs_inode_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xbtcur(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xbtcur((xfs_btree_cur_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xbuf(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xbuf((xfs_buf_t *) addr);
-	return 0;
-}
-
-
-static int	kdbm_xfs_xchash(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xchash((xfs_mount_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xchashlist(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xchashlist((xfs_chashlist_t *) addr);
-	return 0;
-}
-
-
-static int	kdbm_xfs_xdaargs(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xdaargs((xfs_da_args_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xdabuf(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xdabuf((xfs_dabuf_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xdanode(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xdanode((xfs_da_intnode_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xdastate(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xdastate((xfs_da_state_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xdirleaf(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xdirleaf((xfs_dir_leafblock_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xdirsf(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xdirsf((xfs_dir_shortform_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xdir2free(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xdir2free((xfs_dir2_free_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xdir2sf(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xdir2sf((xfs_dir2_sf_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xexlist(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xexlist((xfs_inode_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xflist(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xflist((xfs_bmap_free_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xhelp(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	if (argc != 0)
-		return KDB_ARGCOUNT;
-
-	xfsidbg_xhelp();
-	return 0;
-}
-
-static int	kdbm_xfs_xiclog(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xiclog((xlog_in_core_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xiclogall(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xiclogall((xlog_in_core_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xiclogcb(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xiclogcb((xlog_in_core_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xihash(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xihash((xfs_mount_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xinodes(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xinodes((xfs_mount_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_delayed_blocks(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_delayed_blocks((xfs_mount_t *) addr);
-	return 0;
-}
-
-
-static int	kdbm_xfs_xinodes_quiesce(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xinodes_quiesce((xfs_mount_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xlog(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xlog((xlog_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xlog_ritem(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xlog_ritem((xlog_recover_item_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xlog_rtrans(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xlog_rtrans((xlog_recover_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xlog_rtrans_entire(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xlog_rtrans_entire((xlog_recover_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xlog_tic(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xlog_tic((xlog_ticket_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xlogitem(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xlogitem((xfs_log_item_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xmount(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xmount((xfs_mount_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xnode(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xnode((xfs_inode_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xcore(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xcore((xfs_iocore_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xperag(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xperag((xfs_mount_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xqm_diskdq(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xqm_diskdq((xfs_disk_dquot_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xqm_dqattached_inos(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xqm_dqattached_inos((xfs_mount_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xqm_dquot(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xqm_dquot((xfs_dquot_t *) addr);
-	return 0;
-}
-
-#ifdef	CONFIG_XFS_QUOTA
-static int	kdbm_xfs_xqm(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	if (argc != 0)
-		return KDB_ARGCOUNT;
-
-	xfsidbg_xqm();
-	return 0;
-}
-
-static int	kdbm_xfs_xqm_freelist(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	if (argc != 0)
-		return KDB_ARGCOUNT;
-
-	xfsidbg_xqm_freelist();
-	return 0;
-}
-
-static int	kdbm_xfs_xqm_htab(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	if (argc != 0)
-		return KDB_ARGCOUNT;
-
-	xfsidbg_xqm_htab();
-	return 0;
-}
-#endif
-
-static int	kdbm_xfs_xqm_mplist(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xqm_mplist((xfs_mount_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xqm_qinfo(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xqm_qinfo((xfs_mount_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xqm_tpdqinfo(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xqm_tpdqinfo((xfs_trans_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xsb(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	unsigned long convert=0;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1 && argc!=2)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-	if (argc==2) {
-	    /* extra argument - conversion flag */
-	    diag = kdbgetaddrarg(argc, argv, &nextarg, &convert, &offset, NULL, regs);
-	    if (diag)
-		    return diag;
-	}
-
-	xfsidbg_xsb((xfs_sb_t *) addr, (int)convert);
-	return 0;
-}
-
-static int	kdbm_xfs_xtp(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xtp((xfs_trans_t *) addr);
-	return 0;
-}
-
-static int	kdbm_xfs_xtrans_res(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-	if (diag)
-		return diag;
-
-	xfsidbg_xtrans_res((xfs_mount_t *) addr);
-	return 0;
-}
-
-/*
- * Vnode descriptor dump.
- * This table is a string version of all the flags defined in vnode.h.
- */
-char *tab_vflags[] = {
-	/* local only flags */
-	"VINACT",		/*	 0x01 */
-	"VRECLM",		/*	 0x02 */
-	"VWAIT",		/*	 0x04 */
-	"VMODIFIED",		/*	 0x08 */
-	"INVALID0x10",		/*	 0x10 */
-	"INVALID0x20",		/*	 0x20 */
-	"INVALID0x40",		/*	 0x40 */
-	"INVALID0x80",		/*	 0x80 */
-	"INVALID0x100",		/*	0x100 */
-	"INVALID0x200",		/*	0x200 */
-	"INVALID0x400",		/*	0x400 */
-	"INVALID0x800",		/*	0x800 */
-	"INVALID0x1000",	/*     0x1000 */
-	"INVALID0x2000",	/*     0x2000 */
-	"INVALID0x4000",	/*     0x4000 */
-	"INVALID0x8000",	/*     0x8000 */
-	"INVALID0x10000",	/*    0x10000 */
-	"INVALID0x20000",	/*    0x20000 */
-	"INVALID0x40000",	/*    0x40000 */
-	"INVALID0x80000",	/*    0x80000 */
-	"VROOT",		/*   0x100000 */
-	"INVALID0x200000",	/*   0x200000 */
-	"INVALID00x400000",	/*   0x400000 */
-	"INVALID0x800000",	/*   0x800000 */
-	"INVALID0x1000000",	/*  0x1000000 */
-	"INVALID0x2000000",	/*  0x2000000 */
-	"VSHARE",		/*  0x4000000 */
-	"INVALID0x8000000",     /*  0x8000000 */
-	"VENF_LOCKING",		/* 0x10000000 */
-	"VOPLOCK",		/* 0x20000000 */
-	"VPURGE",		/* 0x40000000 */
-	"INVALID0x80000000",	/* 0x80000000 */
-	0
-};
-
-
-static char *vnode_type[] = {
-	"VNON", "VREG", "VDIR", "VBLK", "VLNK", "VFIFO", "VBAD", "VSOCK"
-};
-
-static void
-printflags(register uint64_t flags,
-	register char **strings,
-	register char *name)
-{
-	register uint64_t mask = 1;
-
-	if (name)
-		kdb_printf("%s 0x%llx <", name, (unsigned long long)flags);
-
-	while (flags != 0 && *strings) {
-		if (mask & flags) {
-			kdb_printf("%s ", *strings);
-			flags &= ~mask;
-		}
-		mask <<= 1;
-		strings++;
-	}
-
-	if (name)
-		kdb_printf("> ");
-
-	return;
-}
-
-
-static void	printvnode(vnode_t *vp)
-{
-	bhv_desc_t	*bh;
-	kdb_symtab_t	 symtab;
-
-
-	kdb_printf("vnode: 0x%p type ", vp);
-	if ((size_t)vp->v_type >= sizeof(vnode_type)/sizeof(vnode_type[0]))
-		kdb_printf("out of range 0x%x", vp->v_type);
-	else
-		kdb_printf("%s", vnode_type[vp->v_type]);
-	kdb_printf(" v_bh %p\n", &vp->v_bh);
-
-	if ((bh = vp->v_bh.bh_first)) {
-		kdb_printf("   v_inode 0x%p v_bh->bh_first 0x%p pobj 0x%p\n",
-					LINVFS_GET_IP(vp), bh, bh->bd_pdata);
-
-		if (kdbnearsym((unsigned long)bh->bd_ops, &symtab))
-			kdb_printf("   ops %s ", symtab.sym_name);
-		else
-			kdb_printf("   ops %s/0x%p ",
-						"???", (void *)bh->bd_ops);
-	} else {
-		kdb_printf("   v_inode 0x%p v_bh->bh_first = NULLBHV ",
-					LINVFS_GET_IP(vp));
-	}
-
-	printflags((__psunsigned_t)vp->v_flag, tab_vflags, "flag =");
-	kdb_printf("\n");
-
-#ifdef	CONFIG_XFS_VNODE_TRACING
-	kdb_printf("   v_trace 0x%p\n", vp->v_trace);
-#endif	/* CONFIG_XFS_VNODE_TRACING */
-
-	kdb_printf("   v_vfsp 0x%p v_number %Lx\n",
-		vp->v_vfsp, vp->v_number);
-}
-
-
-static int	kdbm_vnode(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr;
-	int nextarg = 1;
-	long offset = 0;
-	int diag;
-	vnode_t		*vp;
-/*	bhv_desc_t	*bh; */
-/*	kdb_symtab_t	 symtab;*/
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-
-	if (diag)
-		return diag;
-
-	vp = (vnode_t *)addr;
-
-	printvnode(vp);
-
-	return 0;
-}
-
-#ifdef	CONFIG_XFS_VNODE_TRACING
-/*
- * Print a vnode trace entry.
- */
-static int
-vn_trace_pr_entry(ktrace_entry_t *ktep)
-{
-	char		funcname[128];
-	kdb_symtab_t	symtab;
-
-
-	if ((__psint_t)ktep->val[0] == 0)
-		return 0;
-
-	if (kdbnearsym((unsigned int)ktep->val[8], &symtab)) {
-		unsigned long offval;
-
-		offval = (unsigned int)ktep->val[8] - symtab.sym_start;
-
-		if (offval)
-			sprintf(funcname, "%s+0x%lx", symtab.sym_name, offval);
-		else
-			sprintf(funcname, "%s", symtab.sym_name);
-	} else
-		funcname[0] = '\0';
-
-
-	switch ((__psint_t)ktep->val[0]) {
-	case VNODE_KTRACE_ENTRY:
-		kdb_printf("entry to %s i_count = %d",
-						(char *)ktep->val[1],
-						(__psint_t)ktep->val[3]);
-		break;
-
-	case VNODE_KTRACE_EXIT:
-		kdb_printf("exit from %s i_count = %d",
-						(char *)ktep->val[1],
-						(__psint_t)ktep->val[3]);
-		break;
-
-	case VNODE_KTRACE_HOLD:
-		if ((__psint_t)ktep->val[3] != 1)
-			kdb_printf("hold @%s:%d(%s) i_count %d => %d ",
-						(char *)ktep->val[1],
-						(__psint_t)ktep->val[2],
-						funcname,
-						(__psint_t)ktep->val[3] - 1,
-						(__psint_t)ktep->val[3]);
-		else
-			kdb_printf("get @%s:%d(%s) i_count = %d",
-						(char *)ktep->val[1],
-						(__psint_t)ktep->val[2],
-						funcname,
-						(__psint_t)ktep->val[3]);
-		break;
-
-	case VNODE_KTRACE_REF:
-		kdb_printf("ref @%s:%d(%s) i_count = %d",
-						(char *)ktep->val[1],
-						(__psint_t)ktep->val[2],
-						funcname,
-						(__psint_t)ktep->val[3]);
-		break;
-
-	case VNODE_KTRACE_RELE:
-		if ((__psint_t)ktep->val[3] != 1)
-			kdb_printf("rele @%s:%d(%s) i_count %d => %d ",
-						(char *)ktep->val[1],
-						(__psint_t)ktep->val[2],
-						funcname,
-						(__psint_t)ktep->val[3],
-						(__psint_t)ktep->val[3] - 1);
-		else
-			kdb_printf("free @%s:%d(%s) i_count = %d",
-						(char *)ktep->val[1],
-						(__psint_t)ktep->val[2],
-						funcname,
-						(__psint_t)ktep->val[3]);
-		break;
-
-	default:
-		kdb_printf("unknown vntrace record\n");
-		return 1;
-	}
-
-	kdb_printf("\n");
-
-	kdb_printf("  cpu = %d pid = %d ",
-			(__psint_t)ktep->val[6], (pid_t)ktep->val[7]);
-
-	printflags((__psunsigned_t)ktep->val[5], tab_vflags, "flag =");
-
-	if (kdbnearsym((unsigned int)ktep->val[4], &symtab)) {
-		unsigned long offval;
-
-		offval = (unsigned int)ktep->val[4] - symtab.sym_start;
-
-		if (offval)
-			kdb_printf("  ra = %s+0x%lx", symtab.sym_name, offval);
-		else
-			kdb_printf("  ra = %s", symtab.sym_name);
-	} else
-		kdb_printf("  ra = ?? 0x%p", (void *)ktep->val[4]);
-
-	return 1;
-}
-
-
-/*
- * Print out the trace buffer attached to the given vnode.
- */
-static int	kdbm_vntrace(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	int		diag;
-	int		nextarg = 1;
-	long		offset = 0;
-	unsigned long	addr;
-	vnode_t		*vp;
-	ktrace_entry_t	*ktep;
-	ktrace_snap_t	kts;
-
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-
-	if (diag)
-		return diag;
-
-	vp = (vnode_t *)addr;
-
-	if (vp->v_trace == NULL) {
-		kdb_printf("The vnode trace buffer is not initialized\n");
-
-		return 0;
-	}
-
-	kdb_printf("vntrace vp 0x%p\n", vp);
-
-	ktep = ktrace_first(vp->v_trace, &kts);
-
-	while (ktep != NULL) {
-		if (vn_trace_pr_entry(ktep))
-			kdb_printf("\n");
-
-		ktep = ktrace_next(vp->v_trace, &kts);
-	}
-
-	return 0;
-}
-/*
- * Print out the trace buffer attached to the given vnode.
- */
-static int	kdbm_vntraceaddr(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	int		diag;
-	int		nextarg = 1;
-	long		offset = 0;
-	unsigned long	addr;
-	struct ktrace	*kt;
-	ktrace_entry_t	*ktep;
-	ktrace_snap_t	kts;
-
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-
-	if (diag)
-		return diag;
-
-	kt = (struct ktrace *)addr;
-
-	kdb_printf("vntraceaddr kt 0x%p\n", kt);
-
-	ktep = ktrace_first(kt, &kts);
-
-	while (ktep != NULL) {
-		if (vn_trace_pr_entry(ktep))
-			kdb_printf("\n");
-
-		ktep = ktrace_next(kt, &kts);
-	}
-
-	return 0;
-}
-#endif	/* CONFIG_XFS_VNODE_TRACING */
-
-
-static void	printinode(struct inode *ip)
-{
-	unsigned long	addr;
-
-
-	if (ip == NULL)
-		return;
-
-	kdb_printf(" i_ino = %lu i_count = %u i_size %Ld\n",
-					ip->i_ino, atomic_read(&ip->i_count),
-					ip->i_size);
-
-	kdb_printf(
-		" i_mode = 0x%x  i_nlink = %d  i_rdev = %u:%u i_state = 0x%lx\n",
-					ip->i_mode, ip->i_nlink,
-					MAJOR(ip->i_rdev),
-					MINOR(ip->i_rdev),
-					ip->i_state);
-
-	kdb_printf(" i_hash.nxt = 0x%p i_hash.prv = 0x%p\n",
-					ip->i_hash.next, ip->i_hash.prev);
-	kdb_printf(" i_list.nxt = 0x%p i_list.prv = 0x%p\n",
-					ip->i_list.next, ip->i_list.prev);
-	kdb_printf(" i_dentry.nxt = 0x%p i_dentry.prv = 0x%p\n",
-					ip->i_dentry.next,
-					ip->i_dentry.prev);
-
-	addr = (unsigned long)ip;
-
-	kdb_printf(" i_sb = 0x%p i_op = 0x%p i_data = 0x%lx nrpages = %lu\n",
-					ip->i_sb, ip->i_op,
-					addr + offsetof(struct inode, i_data),
-					ip->i_data.nrpages);
-
-	kdb_printf("  vnode ptr 0x%p\n", LINVFS_GET_VP(ip));
-}
-
-
-static int	kdbm_vn(
-	int	argc,
-	const char **argv,
-	const char **envp,
-	struct pt_regs *regs)
-{
-	int		diag;
-	int		nextarg = 1;
-/*	char		*symname; */
-	long		offset = 0;
-	unsigned long	addr;
-	struct inode	*ip;
-/*	bhv_desc_t	*bh; */
-#ifdef	CONFIG_XFS_VNODE_TRACING
-	ktrace_entry_t	*ktep;
-	ktrace_snap_t	kts;
-#endif
-	vnode_t		*vp;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-
-	diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-
-	if (diag)
-		return diag;
-
-	vp = (vnode_t *)addr;
-
-	ip = LINVFS_GET_IP(vp);
-
-	kdb_printf("--> Inode @ 0x%p\n", ip);
-	printinode(ip);
-
-	kdb_printf("--> Vnode @ 0x%p\n", vp);
-	printvnode(vp);
-
-#ifdef	CONFIG_XFS_VNODE_TRACING
-
-	kdb_printf("--> Vntrace @ 0x%p/0x%p\n", vp, vp->v_trace);
-
-	if (vp->v_trace == NULL)
-		return 0;
-
-	ktep = ktrace_first(vp->v_trace, &kts);
-
-	while (ktep != NULL) {
-		if (vn_trace_pr_entry(ktep))
-			kdb_printf("\n");
-
-		ktep = ktrace_next(vp->v_trace, &kts);
-	}
-#endif	/* CONFIG_XFS_VNODE_TRACING */
-
-	return 0;
-}
-
-
-/* pagebuf stuff */
-
-static char	*pb_flag_vals[] = {
-/*  0 */ "READ", "WRITE", "MAPPED", "PARTIAL", "ASYNC",
-/*  5 */ "NONE", "DELWRI", "FREED", "SYNC", "MAPPABLE",
-/* 10 */ "STALE", "FS_MANAGED", "INVALID12", "LOCK", "TRYLOCK",
-/* 15 */ "DONT_BLOCK", "LOCKABLE", "PRIVATE_BH", "ALL_PAGES_MAPPED", 
-	 "ADDR_ALLOCATED",
-/* 20 */ "MEM_ALLOCATED", "FORCEIO", "FLUSH", "READ_AHEAD",
-	 NULL };
-
-static char	*pbm_flag_vals[] = {
-	"EOF", "HOLE", "DELAY", "INVALID0x08",
-	"INVALID0x10", "UNWRITTEN", "INVALID0x40", "INVALID0x80",
-	NULL };
-
-
-static char	*map_flags(unsigned long flags, char *mapping[])
-{
-	static	char	buffer[256];
-	int	index;
-	int	offset = 12;
-
-	buffer[0] = '\0';
-
-	for (index = 0; flags && mapping[index]; flags >>= 1, index++) {
-		if (flags & 1) {
-			if ((offset + strlen(mapping[index]) + 1) >= 80) {
-				strcat(buffer, "\n            ");
-				offset = 12;
-			} else if (offset > 12) {
-				strcat(buffer, " ");
-				offset++;
-			}
-			strcat(buffer, mapping[index]);
-			offset += strlen(mapping[index]);
-		}
-	}
-
-	return (buffer);
-}
-
-static char	*pb_flags(page_buf_flags_t pb_flag)
-{
-	return(map_flags((unsigned long) pb_flag, pb_flag_vals));
-}
-
-static int
-kdbm_pb_flags(int argc, const char **argv, const char **envp, struct pt_regs *regs)
-{
-	unsigned long flags;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-
-	diag = kdbgetularg(argv[1], &flags);
-	if (diag)
-		return diag;
-
-	kdb_printf("pb flags 0x%lx = %s\n", flags, pb_flags(flags));
-
-	return 0;
-}
-
-static int
-kdbm_pb(int argc, const char **argv, const char **envp, struct pt_regs *regs)
-{
-	page_buf_t bp;
-	unsigned long addr;
-	long	offset=0;
-	int nextarg;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-
-	nextarg = 1;
-	if ((diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs)) ||
-	    (diag = kdb_getarea(bp, addr)))
-		return diag;
-
-	kdb_printf("page_buf_t at 0x%lx\n", addr);
-	kdb_printf("  pb_flags %s\n", pb_flags(bp.pb_flags));
-	kdb_printf("  pb_target 0x%p pb_hold %d pb_next 0x%p pb_prev 0x%p\n",
-		   bp.pb_target, bp.pb_hold.counter,
-		   bp.pb_list.next, bp.pb_list.prev);
-	kdb_printf("  pb_hash_index %d pb_hash_next 0x%p pb_hash_prev 0x%p\n",
-		   bp.pb_hash_index,
-		   bp.pb_hash_list.next,
-		   bp.pb_hash_list.prev);
-	kdb_printf("  pb_file_offset 0x%llx pb_buffer_length 0x%llx pb_addr 0x%p\n",
-		   (unsigned long long) bp.pb_file_offset,
-		   (unsigned long long) bp.pb_buffer_length,
-		   bp.pb_addr);
-	kdb_printf("  pb_bn 0x%Lx pb_count_desired 0x%lx\n",
-		   bp.pb_bn,
-		   (unsigned long) bp.pb_count_desired);
-	kdb_printf("  pb_io_remaining %d pb_error %u\n",
-		   bp.pb_io_remaining.counter,
-		   bp.pb_error);
-	kdb_printf("  pb_page_count %u pb_offset 0x%x pb_pages 0x%p\n",
-		bp.pb_page_count, bp.pb_offset,
-		bp.pb_pages);
-#ifdef PAGEBUF_LOCK_TRACKING
-	kdb_printf("  pb_iodonesema (%d,%d) pb_sema (%d,%d) pincount (%d) last holder %d\n",
-		   bp.pb_iodonesema.count.counter,
-		   bp.pb_iodonesema.sleepers,
-		   bp.pb_sema.count.counter, bp.pb_sema.sleepers,
-		   bp.pb_pin_count.counter, bp.pb_last_holder);
-#else
-	kdb_printf("  pb_iodonesema (%d,%d) pb_sema (%d,%d) pincount (%d)\n",
-		   bp.pb_iodonesema.count.counter,
-		   bp.pb_iodonesema.sleepers,
-		   bp.pb_sema.count.counter, bp.pb_sema.sleepers,
-		   bp.pb_pin_count.counter);
-#endif
-	if (bp.pb_fspriv || bp.pb_fspriv2) {
-		kdb_printf(  "pb_fspriv 0x%p pb_fspriv2 0x%p\n",
-			   bp.pb_fspriv, bp.pb_fspriv2);
-	}
-
-	return 0;
-}
-
-/* XXXXXXXXXXXXXXXXXXXXXX */
-/* The start of this deliberately looks like a read_descriptor_t in layout */
-typedef struct {
-	read_descriptor_t io_rdesc;
-
-	/* 0x10 */
-	page_buf_rw_t io_dir;	/* read or write */
-	loff_t io_offset;	/* Starting offset of I/O */
-	int io_iovec_nr;	/* Number of entries in iovec */
-
-	/* 0x20 */
-	struct iovec **io_iovec;	/* iovec list indexed by iovec_index */
-	loff_t io_iovec_offset;	/* offset into current iovec. */
-	int io_iovec_index;	/* current iovec being processed */
-	unsigned int io_sshift;	/* sector bit shift */
-	loff_t io_i_size;	/* size of the file */
-} pb_io_desc_t;
-
-static int
-kdbm_pbiodesc(int argc, const char **argv, const char **envp,
-	struct pt_regs *regs)
-{
-	pb_io_desc_t	pbio;
-	unsigned long addr;
-	long	offset=0;
-	int nextarg;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-
-	nextarg = 1;
-	if ((diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs)) ||
-	    (diag = kdb_getarea(pbio, addr)))
-
-	kdb_printf("pb_io_desc_t at 0x%lx\n", addr);
-	kdb_printf("  io_rdesc [ written 0x%lx count 0x%lx buf 0x%p error %d ]\n",
-			(unsigned long) pbio.io_rdesc.written,
-			(unsigned long) pbio.io_rdesc.count,
-			pbio.io_rdesc.buf, pbio.io_rdesc.error);
-
-	kdb_printf("  io_dir %d io_offset 0x%Lx io_iovec_nr 0x%d\n",
-			pbio.io_dir, pbio.io_offset, pbio.io_iovec_nr);
-
-	kdb_printf("  io_iovec 0x%p io_iovec_offset 0x%Lx io_iovec_index 0x%d\n",
-		pbio.io_iovec, pbio.io_iovec_offset, pbio.io_iovec_index);
-
-	kdb_printf("  io_sshift 0x%d io_i_size 0x%Lx\n",
-		pbio.io_sshift, pbio.io_i_size);
-
-	return 0;
-}
-
-static int
-kdbm_pbmap(int argc, const char **argv, const char **envp,
-	struct pt_regs *regs)
-{
-	page_buf_bmap_t	pbm;
-	unsigned long addr;
-	long	offset=0;
-	int nextarg;
-	int diag;
-
-	if (argc != 1)
-		return KDB_ARGCOUNT;
-
-	nextarg = 1;
-	if ((diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs)) ||
-	    (diag = kdb_getarea(pbm, addr)))
-
-	kdb_printf("page_buf_bmap_t at 0x%lx\n", addr);
-	kdb_printf("  pbm_bn 0x%llx pbm_offset 0x%Lx pbm_delta 0x%lx pbm_bsize 0x%lx\n",
-		(long long) pbm.pbm_bn, pbm.pbm_offset,
-		(unsigned long) pbm.pbm_delta, (unsigned long) pbm.pbm_bsize);
-
-	kdb_printf("  pbm_flags %s\n", map_flags(pbm.pbm_flags, pbm_flag_vals));
-
-	return 0;
-}
-
-#ifdef PAGEBUF_TRACE
-# ifdef __PAGEBUF_TRACE__
-# undef __PAGEBUF_TRACE__
-# undef PB_DEFINE_TRACES
-# undef PB_TRACE_START
-# undef PB_TRACE_REC
-# undef PB_TRACE_END
-# endif
-#include "pagebuf/page_buf_trace.h"
-
-#define EV_SIZE	(sizeof(event_names)/sizeof(char *))
-
-void
-pb_trace_core(
-	unsigned long match,
-	char	*event_match,
-	unsigned long long offset,
-	long long mask)
-{
-	extern struct pagebuf_trace_buf pb_trace;
-	int i, total, end;
-	pagebuf_trace_t	*trace;
-	char	*event;
-	char	value[10];
-
-	end = pb_trace.start - 1;
-	if (end < 0)
-		end = PB_TRACE_BUFSIZE - 1;
-
-	if (match && (match < PB_TRACE_BUFSIZE)) {
-		for (i = pb_trace.start, total = 0; i != end; i = CIRC_INC(i)) {
-			trace = &pb_trace.buf[i];
-			if (trace->pb == 0)
-				continue;
-			total++;
-		}
-		total = total - match;
-		for (i = pb_trace.start; i != end && total; i = CIRC_INC(i)) {
-			trace = &pb_trace.buf[i];
-			if (trace->pb == 0)
-				continue;
-			total--;
-		}
-		match = 0;
-	} else
-		i = pb_trace.start;
-	for ( ; i != end; i = CIRC_INC(i)) {
-		trace = &pb_trace.buf[i];
-
-		if (offset) {
-			if ((trace->offset & ~mask) != offset)
-				continue;
-		}
-
-		if (trace->pb == 0)
-			continue;
-
-		if ((match != 0) && (trace->pb != match))
-			continue;
-
-		if ((trace->event < EV_SIZE-1) && event_names[trace->event]) {
-			event = event_names[trace->event];
-		} else if (trace->event == EV_SIZE-1) {
-			event = (char *)trace->misc;
-		} else {
-			event = value;
-			sprintf(value, "%8d", trace->event);
-		}
-
-		if (event_match && strcmp(event, event_match)) {
-			continue;
-		}
-
-
-		kdb_printf("pb 0x%lx [%s] (hold %u lock %d) misc 0x%p",
-			   trace->pb, event,
-			   trace->hold, trace->lock_value,
-			   trace->misc);
-		kdb_symbol_print((unsigned int)trace->ra, NULL,
-			KDB_SP_SPACEB|KDB_SP_PAREN|KDB_SP_NEWLINE);
-		kdb_printf("    offset 0x%Lx size 0x%x task 0x%p\n",
-			   trace->offset, trace->size, trace->task);
-		kdb_printf("    flags: %s\n",
-			   pb_flags(trace->flags));
-	}
-}
-
-
-static int
-kdbm_pbtrace_offset(int argc, const char **argv, const char **envp,
-	struct pt_regs *regs)
-{
-	long mask = 0;
-	unsigned long offset = 0;
-	int diag;
-
-	if (argc > 2)
-		return KDB_ARGCOUNT;
-
-	if (argc > 0) {
-		diag = kdbgetularg(argv[1], &offset);
-		if (diag)
-			return diag;
-	}
-
-	if (argc > 1) {
-		diag = kdbgetularg(argv[1], &mask);
-		if (diag)
-			return diag;
-	}
-
-	pb_trace_core(0, NULL, (unsigned long long)offset,
-			       (long long)mask);	/* sign extent mask */
-	return 0;
-}
-
-static int
-kdbm_pbtrace(int argc, const char **argv, const char **envp,
-	struct pt_regs *regs)
-{
-	unsigned long addr = 0;
-	int diag, nextarg;
-	long offset = 0;
-	char	*event_match = NULL;
-
-	if (argc > 1)
-		return KDB_ARGCOUNT;
-
-	if (argc == 1) {
-		if (isupper(argv[1][0]) || islower(argv[1][0])) {
-			event_match = (char *)argv[1];
-			printk("event match on \"%s\"\n", event_match);
-			argc = 0;
-		} else {
-			nextarg = 1;
-			diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs);
-			if (diag) {
-				printk("failed to parse %s as a number\n",
-								argv[1]);
-				return diag;
-			}
-		}
-	}
-
-	pb_trace_core(addr, event_match, 0LL, 0LL);
-	return 0;
-}
-
-#else	/* PAGEBUF_TRACE */
-static int
-kdbm_pbtrace(int argc, const char **argv, const char **envp,
-	struct pt_regs *regs)
-{
-	kdb_printf("pagebuf tracing not compiled in\n");
-
-	return 0;
-}
-#endif	/* PAGEBUF_TRACE */
-
-static struct xif {
-	char	*name;
-	int	(*func)(int, const char **, const char **, struct pt_regs *);
-	char	*args;
-	char	*help;
-} xfsidbg_funcs[] = {
-  {  "vn",	kdbm_vn,	"<vnode>", "Dump inode/vnode/trace"},
-  {  "vnode",	kdbm_vnode,	"<vnode>", "Dump vnode"},
-#ifdef	CONFIG_XFS_VNODE_TRACING
-  {  "vntrace",	kdbm_vntrace,	"<vntrace>", "Dump vnode Trace"},
-  {  "vntraceaddr",	kdbm_vntraceaddr, "<vntrace>", "Dump vnode Trace by Address"},
-#endif	/* CONFIG_XFS_VNODE_TRACING */
-  {  "xagf",	kdbm_xfs_xagf,	"<agf>",
-				"Dump XFS allocation group freespace" },
-  {  "xagi",	kdbm_xfs_xagi,	"<agi>",
-				"Dump XFS allocation group inode" },
-  {  "xail",	kdbm_xfs_xaildump,	"<xfs_mount_t>",
-				"Dump XFS AIL for a mountpoint" },
-  {  "xalloc",	kdbm_xfs_xalloc,	"<xfs_alloc_arg_t>",
-				"Dump XFS allocation args structure" },
-#ifdef DEBUG
-  {  "xalmtrc",	kdbm_xfs_xalmtrace,	"<xfs_mount_t>",
-				"Dump XFS alloc mount-point trace" },
-#endif
-  {  "xattrcx",	kdbm_xfs_xattrcontext,	"<xfs_attr_list_context_t>",
-				"Dump XFS attr_list context struct"},
-  {  "xattrlf",	kdbm_xfs_xattrleaf,	"<xfs_attr_leafblock_t>",
-				"Dump XFS attribute leaf block"},
-  {  "xattrsf",	kdbm_xfs_xattrsf,	"<xfs_attr_shortform_t>",
-				"Dump XFS attribute shortform"},
-  {  "xbirec",	kdbm_xfs_xbirec,	"<xfs_bmbt_irec_t",
-				"Dump XFS bmap incore record"},
-  {  "xbmalla",	kdbm_xfs_xbmalla,	"<xfs_bmalloca_t>",
-				"Dump XFS bmalloc args structure"},
-  {  "xbrec",	kdbm_xfs_xbrec,		"<xfs_bmbt_rec_64_t",
-				"Dump XFS bmap record"},
-  {  "xbroot",	kdbm_xfs_xbroot,	"<xfs_inode_t>",
-				"Dump XFS bmap btree root (data)"},
-  {  "xbroota",	kdbm_xfs_xbroota,	"<xfs_inode_t>",
-				"Dump XFS bmap btree root (attr)"},
-  {  "xbtcur",	kdbm_xfs_xbtcur,	"<xfs_btree_cur_t>",
-				"Dump XFS btree cursor"},
-  {  "xbuf",	kdbm_xfs_xbuf,		"<xfs_buf_t>",
-				"Dump XFS data from a buffer"},
-  {  "xchash",	kdbm_xfs_xchash,	"<xfs_mount_t>",
-				"Dump XFS cluster hash"},
-  {  "xchlist",	kdbm_xfs_xchashlist,	"<xfs_chashlist_t>",
-				"Dump XFS cluster hash list"},
-  {  "xd2free",	kdbm_xfs_xdir2free,	"<xfs_dir2_free_t>",
-				"Dump XFS directory v2 freemap"},
-  {  "xdaargs",	kdbm_xfs_xdaargs,	"<xfs_da_args_t>",
-				"Dump XFS dir/attr args structure"},
-  {  "xdabuf",	kdbm_xfs_xdabuf,	"<xfs_dabuf_t>",
-				"Dump XFS dir/attr buf structure"},
-  {  "xdanode",	kdbm_xfs_xdanode,	"<xfs_da_intnode_t>",
-				"Dump XFS dir/attr node block"},
-  {  "xdastat",	kdbm_xfs_xdastate,	"<xfs_da_state_t>",
-				"Dump XFS dir/attr state_blk struct"},
-  {  "xdelay",	kdbm_xfs_delayed_blocks,	"<xfs_mount_t>",
-				"Dump delayed block totals"},
-  {  "xdirlf",	kdbm_xfs_xdirleaf,	"<xfs_dir_leafblock_t>",
-				"Dump XFS directory leaf block"},
-  {  "xdirsf",	kdbm_xfs_xdirsf,	"<xfs_dir_shortform_t>",
-				"Dump XFS directory shortform"},
-  {  "xdir2sf",	kdbm_xfs_xdir2sf,	"<xfs_dir2_sf_t>",
-				"Dump XFS directory v2 shortform"},
-  {  "xdiskdq",	kdbm_xfs_xqm_diskdq,	"<xfs_disk_dquot_t>",
-				"Dump XFS ondisk dquot (quota) struct"},
-  {  "xdqatt",	kdbm_xfs_xqm_dqattached_inos,	"<xfs_mount_t>",
-				 "All incore inodes with dquots"},
-  {  "xdqinfo",	kdbm_xfs_xqm_tpdqinfo,	"<xfs_trans_t>",
-				"Dump dqinfo structure of a trans"},
-  {  "xdquot",	kdbm_xfs_xqm_dquot,	"<xfs_dquot_t>",
-				"Dump XFS dquot (quota) structure"},
-  {  "xexlist",	kdbm_xfs_xexlist,	"<xfs_inode_t>",
-				"Dump XFS bmap extents in inode"},
-  {  "xflist",	kdbm_xfs_xflist,	"<xfs_bmap_free_t>",
-				"Dump XFS to-be-freed extent list"},
-  {  "xhelp",	kdbm_xfs_xhelp,		"",
-				"Print idbg-xfs help"},
-  {  "xicall",	kdbm_xfs_xiclogall,	"<xlog_in_core_t>",
-				"Dump All XFS in-core logs"},
-  {  "xiclog",	kdbm_xfs_xiclog,	"<xlog_in_core_t>",
-				"Dump XFS in-core log"},
-  {  "xihash",	kdbm_xfs_xihash,	"<xfs_mount_t>",
-				"Dump XFS inode hash statistics"},
-  {  "xinodes",	kdbm_xfs_xinodes,	"<xfs_mount_t>",
-				"Dump XFS inodes per mount"},
-  {  "xquiesce",kdbm_xfs_xinodes_quiesce, "<xfs_mount_t>",
-				"Dump non-quiesced XFS inodes per mount"},
-  {  "xl_rcit",	kdbm_xfs_xlog_ritem,	"<xlog_recover_item_t>",
-				"Dump XFS recovery item"},
-  {  "xl_rctr",	kdbm_xfs_xlog_rtrans,	"<xlog_recover_t>",
-				"Dump XFS recovery transaction"},
-  {  "xl_rctr2",kdbm_xfs_xlog_rtrans_entire,	"<xlog_recover_t>",
-				"Dump entire recovery transaction"},
-  {  "xl_tic",	kdbm_xfs_xlog_tic,	"<xlog_ticket_t>",
-				"Dump XFS log ticket"},
-  {  "xlog",	kdbm_xfs_xlog,	"<xlog_t>",
-				"Dump XFS log"},
-  {  "xlogcb",	kdbm_xfs_xiclogcb,	"<xlog_in_core_t>",
-				"Dump XFS in-core log callbacks"},
-  {  "xlogitm",	kdbm_xfs_xlogitem,	"<xfs_log_item_t>",
-				"Dump XFS log item structure"},
-  {  "xmount",	kdbm_xfs_xmount,	"<xfs_mount_t>",
-				"Dump XFS mount structure"},
-  {  "xnode",	kdbm_xfs_xnode,		"<xfs_inode_t>",
-				"Dump XFS inode"},
-  {  "xiocore",	kdbm_xfs_xcore,		"<xfs_iocore_t>",
-				"Dump XFS iocore"},
-  {  "xperag",	kdbm_xfs_xperag,	"<xfs_mount_t>",
-				"Dump XFS per-allocation group data"},
-  {  "xqinfo",  kdbm_xfs_xqm_qinfo,	"<xfs_mount_t>",
-				"Dump mount->m_quotainfo structure"},
-#ifdef	CONFIG_XFS_QUOTA
-  {  "xqm",	kdbm_xfs_xqm,		"",
-				"Dump XFS quota manager structure"},
-  {  "xqmfree",	kdbm_xfs_xqm_freelist,	"",
-				"Dump XFS global freelist of dquots"},
-  {  "xqmhtab",	kdbm_xfs_xqm_htab,	"",
-				"Dump XFS hashtable of dquots"},
-#endif	/* CONFIG_XFS_QUOTA */
-  {  "xqmplist",kdbm_xfs_xqm_mplist,	"<xfs_mount_t>",
-				"Dump XFS all dquots of a f/s"},
-  {  "xsb",	kdbm_xfs_xsb,		"<xfs_sb_t> <cnv>",
-				"Dump XFS superblock"},
-  {  "xtp",	kdbm_xfs_xtp,		"<xfs_trans_t>",
-				"Dump XFS transaction structure"},
-  {  "xtrres",	kdbm_xfs_xtrans_res,	"<xfs_mount_t>",
-				"Dump XFS reservation values"},
-  {  0,		0,	0 }
-};
-
-static int
-__init xfsidbg_init(void)
-{
-	struct xif	*p;
-
-	for (p = xfsidbg_funcs; p->name; p++)
-		kdb_register(p->name, p->func, p->args, p->help, 0);
-
-	kdb_register("pb", kdbm_pb, "<vaddr>", "Display page_buf_t", 0);
-	kdb_register("pbflags", kdbm_pb_flags, "<flags>",
-					"Display page buf flags", 0);
-	kdb_register("pbiodesc", kdbm_pbiodesc, "<pb_io_desc_t *>",
-					"Display I/O Descriptor", 0);
-	kdb_register("pbmap", kdbm_pbmap, "<page_buf_bmap_t *>",
-					"Display Bmap", 0);
-	kdb_register("pbtrace", kdbm_pbtrace, "<vaddr>|<count>",
-					"page_buf_t trace", 0);
-#ifdef PAGEBUF_TRACE
-	kdb_register("pboffset", kdbm_pbtrace_offset, "<addr> [<mask>]",
-					"page_buf_t trace", 0);
-#endif
-	return 0;
-}
-
-static void
-__exit xfsidbg_exit(void)
-{
-	struct xif	*p;
-
-	for (p = xfsidbg_funcs; p->name; p++)
-		kdb_unregister(p->name);
-
-	kdb_unregister("pb");
-	kdb_unregister("pbflags");
-	kdb_unregister("pbmap");
-	kdb_unregister("pbiodesc");
-	kdb_unregister("pbtrace");
-#ifdef PAGEBUF_TRACE
-	kdb_unregister("pboffset");
-#endif
-
-}
-
-/*
- * Argument to xfs_alloc routines, for allocation type.
- */
-static char *xfs_alloctype[] = {
-	"any_ag", "first_ag", "start_ag", "this_ag",
-	"start_bno", "near_bno", "this_bno"
-};
-
-
-/*
- * Prototypes for static functions.
- */
-#ifdef DEBUG
-static int xfs_alloc_trace_entry(ktrace_entry_t *ktep);
-#endif
-static void xfs_broot(xfs_inode_t *ip, xfs_ifork_t *f);
-static void xfs_btalloc(xfs_alloc_block_t *bt, int bsz);
-static void xfs_btbmap(xfs_bmbt_block_t *bt, int bsz);
-static void xfs_btino(xfs_inobt_block_t *bt, int bsz);
-static void xfs_buf_item_print(xfs_buf_log_item_t *blip, int summary);
-static void xfs_dastate_path(xfs_da_state_path_t *p);
-static void xfs_dir2data(void *addr, int size);
-static void xfs_dir2leaf(xfs_dir2_leaf_t *leaf, int size);
-static void xfs_dquot_item_print(xfs_dq_logitem_t *lip, int summary);
-static void xfs_efd_item_print(xfs_efd_log_item_t *efdp, int summary);
-static void xfs_efi_item_print(xfs_efi_log_item_t *efip, int summary);
-static char *xfs_fmtformat(xfs_dinode_fmt_t f);
-static char *xfs_fmtfsblock(xfs_fsblock_t bno, xfs_mount_t *mp);
-static char *xfs_fmtino(xfs_ino_t ino, xfs_mount_t *mp);
-static char *xfs_fmtlsn(xfs_lsn_t *lsnp);
-static char *xfs_fmtmode(int m);
-static char *xfs_fmtsize(size_t i);
-static char *xfs_fmtuuid(uuid_t *);
-static void xfs_inode_item_print(xfs_inode_log_item_t *ilip, int summary);
-static void xfs_inodebuf(xfs_buf_t *bp);
-static void xfs_prdinode(xfs_dinode_t *di, int coreonly, int convert);
-static void xfs_prdinode_core(xfs_dinode_core_t *dip, int convert);
-static void xfs_qoff_item_print(xfs_qoff_logitem_t *lip, int summary);
-static void xfs_xexlist_fork(xfs_inode_t *ip, int whichfork);
-static void xfs_xnode_fork(char *name, xfs_ifork_t *f);
-
-/*
- * Static functions.
- */
-
-#ifdef DEBUG
-/*
- * Print xfs alloc trace buffer entry.
- */
-static int
-xfs_alloc_trace_entry(ktrace_entry_t *ktep)
-{
-	static char *modagf_flags[] = {
-		"magicnum",
-		"versionnum",
-		"seqno",
-		"length",
-		"roots",
-		"levels",
-		"flfirst",
-		"fllast",
-		"flcount",
-		"freeblks",
-		"longest",
-		NULL
-	};
-
-	if (((__psint_t)ktep->val[0] & 0xffff) == 0)
-		return 0;
-	switch ((long)ktep->val[0] & 0xffffL) {
-	case XFS_ALLOC_KTRACE_ALLOC:
-		kdb_printf("alloc %s[%s %d] mp 0x%p\n",
-			(char *)ktep->val[1],
-			ktep->val[2] ? (char *)ktep->val[2] : "",
-			(__psint_t)ktep->val[0] >> 16,
-			(xfs_mount_t *)ktep->val[3]);
-		kdb_printf(
-	"agno %d agbno %d minlen %d maxlen %d mod %d prod %d minleft %d\n",
-			(__psunsigned_t)ktep->val[4],
-			(__psunsigned_t)ktep->val[5],
-			(__psunsigned_t)ktep->val[6],
-			(__psunsigned_t)ktep->val[7],
-			(__psunsigned_t)ktep->val[8],
-			(__psunsigned_t)ktep->val[9],
-			(__psunsigned_t)ktep->val[10]);
-		kdb_printf("total %d alignment %d len %d type %s otype %s\n",
-			(__psunsigned_t)ktep->val[11],
-			(__psunsigned_t)ktep->val[12],
-			(__psunsigned_t)ktep->val[13],
-			xfs_alloctype[((__psint_t)ktep->val[14]) >> 16],
-			xfs_alloctype[((__psint_t)ktep->val[14]) & 0xffff]);
-		kdb_printf("wasdel %d wasfromfl %d isfl %d userdata %d\n",
-			((__psint_t)ktep->val[15] & (1 << 3)) != 0,
-			((__psint_t)ktep->val[15] & (1 << 2)) != 0,
-			((__psint_t)ktep->val[15] & (1 << 1)) != 0,
-			((__psint_t)ktep->val[15] & (1 << 0)) != 0);
-		break;
-	case XFS_ALLOC_KTRACE_FREE:
-		kdb_printf("free %s[%s %d] mp 0x%p\n",
-			(char *)ktep->val[1],
-			ktep->val[2] ? (char *)ktep->val[2] : "",
-			(__psint_t)ktep->val[0] >> 16,
-			(xfs_mount_t *)ktep->val[3]);
-		kdb_printf("agno %d agbno %d len %d isfl %d\n",
-			(__psunsigned_t)ktep->val[4],
-			(__psunsigned_t)ktep->val[5],
-			(__psunsigned_t)ktep->val[6],
-			(__psint_t)ktep->val[7]);
-		break;
-	case XFS_ALLOC_KTRACE_MODAGF:
-		kdb_printf("modagf %s[%s %d] mp 0x%p\n",
-			(char *)ktep->val[1],
-			ktep->val[2] ? (char *)ktep->val[2] : "",
-			(__psint_t)ktep->val[0] >> 16,
-			(xfs_mount_t *)ktep->val[3]);
-		printflags((__psint_t)ktep->val[4], modagf_flags, "modified");
-		kdb_printf("seqno %d length %d roots b %d c %d\n",
-			(__psunsigned_t)ktep->val[5],
-			(__psunsigned_t)ktep->val[6],
-			(__psunsigned_t)ktep->val[7],
-			(__psunsigned_t)ktep->val[8]);
-		kdb_printf("levels b %d c %d flfirst %d fllast %d flcount %d\n",
-			(__psunsigned_t)ktep->val[9],
-			(__psunsigned_t)ktep->val[10],
-			(__psunsigned_t)ktep->val[11],
-			(__psunsigned_t)ktep->val[12],
-			(__psunsigned_t)ktep->val[13]);
-		kdb_printf("freeblks %d longest %d\n",
-			(__psunsigned_t)ktep->val[14],
-			(__psunsigned_t)ktep->val[15]);
-		break;
-
-	case XFS_ALLOC_KTRACE_UNBUSY:
-		kdb_printf("unbusy %s [%s %d] mp 0x%p\n",
-			(char *)ktep->val[1],
-			ktep->val[2] ? (char *)ktep->val[2] : "",
-			(__psint_t)ktep->val[0] >> 16,
-			(xfs_mount_t *)ktep->val[3]);
-		kdb_printf("      agno %d slot %d tp 0x%x\n",
-			(__psunsigned_t)ktep->val[4],
-			(__psunsigned_t)ktep->val[7],
-			(__psunsigned_t)ktep->val[8]);
-		break;
-	case XFS_ALLOC_KTRACE_BUSY:
-		kdb_printf("busy %s [%s %d] mp 0x%p\n",
-			(char *)ktep->val[1],
-			ktep->val[2] ? (char *)ktep->val[2] : "",
-			(__psint_t)ktep->val[0] >> 16,
-			(xfs_mount_t *)ktep->val[3]);
-		kdb_printf("      agno %d agbno %d len %d slot %d tp 0x%x\n",
-			(__psunsigned_t)ktep->val[4],
-			(__psunsigned_t)ktep->val[5],
-			(__psunsigned_t)ktep->val[6],
-			(__psunsigned_t)ktep->val[7],
-			(__psunsigned_t)ktep->val[8]);
-		break;
-	case XFS_ALLOC_KTRACE_BUSYSEARCH:
-		kdb_printf("busy-search %s [%s %d] mp 0x%p\n",
-			(char *)ktep->val[1],
-			ktep->val[2] ? (char *)ktep->val[2] : "",
-			(__psint_t)ktep->val[0] >> 16,
-			(xfs_mount_t *)ktep->val[3]);
-		kdb_printf("      agno %d agbno %d len %d slot %d tp 0x%x\n",
-			(__psunsigned_t)ktep->val[4],
-			(__psunsigned_t)ktep->val[5],
-			(__psunsigned_t)ktep->val[6],
-			(__psunsigned_t)ktep->val[7],
-			(__psunsigned_t)ktep->val[8]);
-		break;
-	default:
-		kdb_printf("unknown alloc trace record\n");
-		break;
-	}
-	return 1;
-}
-#endif /* DEBUG */
-
-/*
- * Print an xfs in-inode bmap btree root.
- */
-static void
-xfs_broot(xfs_inode_t *ip, xfs_ifork_t *f)
-{
-	xfs_bmbt_block_t	*broot;
-	int			format;
-	int			i;
-	xfs_bmbt_key_t		*kp;
-	xfs_bmbt_ptr_t		*pp;
-
-	format = f == &ip->i_df ? ip->i_d.di_format : ip->i_d.di_aformat;
-	if ((f->if_flags & XFS_IFBROOT) == 0 ||
-	    format != XFS_DINODE_FMT_BTREE) {
-		kdb_printf("inode 0x%p not btree format\n", ip);
-		return;
-	}
-	broot = f->if_broot;
-	kdb_printf("block @0x%p magic %x level %d numrecs %d\n",
-		broot, INT_GET(broot->bb_magic, ARCH_CONVERT), INT_GET(broot->bb_level, ARCH_CONVERT), INT_GET(broot->bb_numrecs, ARCH_CONVERT));
-	kp = XFS_BMAP_BROOT_KEY_ADDR(broot, 1, f->if_broot_bytes);
-	pp = XFS_BMAP_BROOT_PTR_ADDR(broot, 1, f->if_broot_bytes);
-	for (i = 1; i <= INT_GET(broot->bb_numrecs, ARCH_CONVERT); i++)
-		kdb_printf("\t%d: startoff %Ld ptr %Lx %s\n",
-			i, INT_GET(kp[i - 1].br_startoff, ARCH_CONVERT), INT_GET(pp[i - 1], ARCH_CONVERT),
-			xfs_fmtfsblock(INT_GET(pp[i - 1], ARCH_CONVERT), ip->i_mount));
-}
-
-/*
- * Print allocation btree block.
- */
-static void
-xfs_btalloc(xfs_alloc_block_t *bt, int bsz)
-{
-	int i;
-
-	kdb_printf("magic 0x%x level %d numrecs %d leftsib 0x%x rightsib 0x%x\n",
-		INT_GET(bt->bb_magic, ARCH_CONVERT), INT_GET(bt->bb_level, ARCH_CONVERT), INT_GET(bt->bb_numrecs, ARCH_CONVERT),
-		INT_GET(bt->bb_leftsib, ARCH_CONVERT), INT_GET(bt->bb_rightsib, ARCH_CONVERT));
-	if (INT_ISZERO(bt->bb_level, ARCH_CONVERT)) {
-
-		for (i = 1; i <= INT_GET(bt->bb_numrecs, ARCH_CONVERT); i++) {
-			xfs_alloc_rec_t *r;
-
-			r = XFS_BTREE_REC_ADDR(bsz, xfs_alloc, bt, i, 0);
-			kdb_printf("rec %d startblock 0x%x blockcount %d\n",
-				i, INT_GET(r->ar_startblock, ARCH_CONVERT), INT_GET(r->ar_blockcount, ARCH_CONVERT));
-		}
-	} else {
-		int mxr;
-
-		mxr = XFS_BTREE_BLOCK_MAXRECS(bsz, xfs_alloc, 0);
-		for (i = 1; i <= INT_GET(bt->bb_numrecs, ARCH_CONVERT); i++) {
-			xfs_alloc_key_t *k;
-			xfs_alloc_ptr_t *p;
-
-			k = XFS_BTREE_KEY_ADDR(bsz, xfs_alloc, bt, i, mxr);
-			p = XFS_BTREE_PTR_ADDR(bsz, xfs_alloc, bt, i, mxr);
-			kdb_printf("key %d startblock 0x%x blockcount %d ptr 0x%x\n",
-				i, INT_GET(k->ar_startblock, ARCH_CONVERT), INT_GET(k->ar_blockcount, ARCH_CONVERT), *p);
-		}
-	}
-}
-
-/*
- * Print a bmap btree block.
- */
-static void
-xfs_btbmap(xfs_bmbt_block_t *bt, int bsz)
-{
-	int i;
-
-	kdb_printf("magic 0x%x level %d numrecs %d leftsib %Lx ",
-		INT_GET(bt->bb_magic, ARCH_CONVERT),
-		INT_GET(bt->bb_level, ARCH_CONVERT),
-		INT_GET(bt->bb_numrecs, ARCH_CONVERT),
-		INT_GET(bt->bb_leftsib, ARCH_CONVERT));
-	kdb_printf("rightsib %Lx\n", INT_GET(bt->bb_rightsib, ARCH_CONVERT));
-	if (INT_ISZERO(bt->bb_level, ARCH_CONVERT)) {
-		for (i = 1; i <= INT_GET(bt->bb_numrecs, ARCH_CONVERT); i++) {
-			xfs_bmbt_rec_t *r;
-			xfs_bmbt_irec_t	irec;
-
-			r = (xfs_bmbt_rec_t *)XFS_BTREE_REC_ADDR(bsz,
-				xfs_bmbt, bt, i, 0);
-
-			xfs_bmbt_disk_get_all((xfs_bmbt_rec_t *)r, &irec);
-			kdb_printf("rec %d startoff %Ld startblock %Lx blockcount %Ld flag %d\n",
-				i, irec.br_startoff,
-				(__uint64_t)irec.br_startblock,
-				irec.br_blockcount, irec.br_state);
-		}
-	} else {
-		int mxr;
-
-		mxr = XFS_BTREE_BLOCK_MAXRECS(bsz, xfs_bmbt, 0);
-		for (i = 1; i <= INT_GET(bt->bb_numrecs, ARCH_CONVERT); i++) {
-			xfs_bmbt_key_t *k;
-			xfs_bmbt_ptr_t *p;
-
-			k = XFS_BTREE_KEY_ADDR(bsz, xfs_bmbt, bt, i, mxr);
-			p = XFS_BTREE_PTR_ADDR(bsz, xfs_bmbt, bt, i, mxr);
-			kdb_printf("key %d startoff %Ld ",
-				i, INT_GET(k->br_startoff, ARCH_CONVERT));
-			kdb_printf("ptr %Lx\n", INT_GET(*p, ARCH_CONVERT));
-		}
-	}
-}
-
-/*
- * Print an inode btree block.
- */
-static void
-xfs_btino(xfs_inobt_block_t *bt, int bsz)
-{
-	int i;
-
-	kdb_printf("magic 0x%x level %d numrecs %d leftsib 0x%x rightsib 0x%x\n",
-		INT_GET(bt->bb_magic, ARCH_CONVERT), INT_GET(bt->bb_level, ARCH_CONVERT), INT_GET(bt->bb_numrecs, ARCH_CONVERT),
-		INT_GET(bt->bb_leftsib, ARCH_CONVERT), INT_GET(bt->bb_rightsib, ARCH_CONVERT));
-	if (INT_ISZERO(bt->bb_level, ARCH_CONVERT)) {
-
-		for (i = 1; i <= INT_GET(bt->bb_numrecs, ARCH_CONVERT); i++) {
-			xfs_inobt_rec_t *r;
-
-			r = XFS_BTREE_REC_ADDR(bsz, xfs_inobt, bt, i, 0);
-			kdb_printf("rec %d startino 0x%x freecount %d, free %Lx\n",
-				i, INT_GET(r->ir_startino, ARCH_CONVERT), INT_GET(r->ir_freecount, ARCH_CONVERT),
-				INT_GET(r->ir_free, ARCH_CONVERT));
-		}
-	} else {
-		int mxr;
-
-		mxr = XFS_BTREE_BLOCK_MAXRECS(bsz, xfs_inobt, 0);
-		for (i = 1; i <= INT_GET(bt->bb_numrecs, ARCH_CONVERT); i++) {
-			xfs_inobt_key_t *k;
-			xfs_inobt_ptr_t *p;
-
-			k = XFS_BTREE_KEY_ADDR(bsz, xfs_inobt, bt, i, mxr);
-			p = XFS_BTREE_PTR_ADDR(bsz, xfs_inobt, bt, i, mxr);
-			kdb_printf("key %d startino 0x%x ptr 0x%x\n",
-				i, INT_GET(k->ir_startino, ARCH_CONVERT), INT_GET(*p, ARCH_CONVERT));
-		}
-	}
-}
-
-/*
- * Print a buf log item.
- */
-static void
-xfs_buf_item_print(xfs_buf_log_item_t *blip, int summary)
-{
-	static char *bli_flags[] = {
-		"hold",		/* 0x1 */
-		"dirty",	/* 0x2 */
-		"stale",	/* 0x4 */
-		"logged",	/* 0x8 */
-		"ialloc",	/* 0x10 */
-		"inode_stale",  /* 0x20 */
-		0
-		};
-	static char *blf_flags[] = {
-		"inode",	/* 0x1 */
-		"cancel",	/* 0x2 */
-		0
-		};
-
-	if (summary) {
-		kdb_printf("buf 0x%p blkno 0x%Lx ", blip->bli_buf,
-			     blip->bli_format.blf_blkno);
-		printflags(blip->bli_flags, bli_flags, "flags:");
-		kdb_printf("\n   ");
-		xfsidbg_xbuf_real(blip->bli_buf, 1);
-		return;
-	}
-	kdb_printf("buf 0x%p recur %d refcount %d flags:",
-		blip->bli_buf, blip->bli_recur,
-		atomic_read(&blip->bli_refcount));
-	printflags(blip->bli_flags, bli_flags, NULL);
-	kdb_printf("\n");
-	kdb_printf("size %d blkno 0x%Lx len 0x%x map size %d map 0x%p\n",
-		blip->bli_format.blf_size, blip->bli_format.blf_blkno,
-		(uint) blip->bli_format.blf_len, blip->bli_format.blf_map_size,
-		&(blip->bli_format.blf_data_map[0]));
-	kdb_printf("blf flags: ");
-	printflags((uint)blip->bli_format.blf_flags, blf_flags, NULL);
-#ifdef XFS_TRANS_DEBUG
-	kdb_printf("orig 0x%x logged 0x%x",
-		blip->bli_orig, blip->bli_logged);
-#endif
-	kdb_printf("\n");
-}
-
-/*
- * Print an xfs_da_state_path structure.
- */
-static void
-xfs_dastate_path(xfs_da_state_path_t *p)
-{
-	int i;
-
-	kdb_printf("active %d\n", p->active);
-	for (i = 0; i < XFS_DA_NODE_MAXDEPTH; i++) {
-		kdb_printf(" blk %d bp 0x%p blkno 0x%x",
-			i, p->blk[i].bp, p->blk[i].blkno);
-		kdb_printf(" index %d hashval 0x%x ",
-			p->blk[i].index, (uint_t)p->blk[i].hashval);
-		switch(p->blk[i].magic) {
-		case XFS_DA_NODE_MAGIC:		kdb_printf("NODE\n");	break;
-		case XFS_DIR_LEAF_MAGIC:	kdb_printf("DIR\n");	break;
-		case XFS_ATTR_LEAF_MAGIC:	kdb_printf("ATTR\n");	break;
-		case XFS_DIR2_LEAFN_MAGIC:	kdb_printf("DIR2\n");	break;
-		default:			kdb_printf("type ??\n");	break;
-		}
-	}
-}
-
-
-/*
- * Print an efd log item.
- */
-static void
-xfs_efd_item_print(xfs_efd_log_item_t *efdp, int summary)
-{
-	int		i;
-	xfs_extent_t	*ep;
-
-	if (summary) {
-		kdb_printf("Extent Free Done: ID 0x%Lx nextents %d (at 0x%p)\n",
-				efdp->efd_format.efd_efi_id,
-				efdp->efd_format.efd_nextents, efdp);
-		return;
-	}
-	kdb_printf("size %d nextents %d next extent %d efip 0x%p\n",
-		efdp->efd_format.efd_size, efdp->efd_format.efd_nextents,
-		efdp->efd_next_extent, efdp->efd_efip);
-	kdb_printf("efi_id 0x%Lx\n", efdp->efd_format.efd_efi_id);
-	kdb_printf("efd extents:\n");
-	ep = &(efdp->efd_format.efd_extents[0]);
-	for (i = 0; i < efdp->efd_next_extent; i++, ep++) {
-		kdb_printf("    block %Lx len %d\n",
-			ep->ext_start, ep->ext_len);
-	}
-}
-
-/*
- * Print an efi log item.
- */
-static void
-xfs_efi_item_print(xfs_efi_log_item_t *efip, int summary)
-{
-	int		i;
-	xfs_extent_t	*ep;
-	static char *efi_flags[] = {
-		"recovered",	/* 0x1 */
-		"committed",	/* 0x2 */
-		"cancelled",	/* 0x4 */
-		0,
-		};
-
-	if (summary) {
-		kdb_printf("Extent Free Intention: ID 0x%Lx nextents %d (at 0x%p)\n",
-				efip->efi_format.efi_id,
-				efip->efi_format.efi_nextents, efip);
-		return;
-	}
-	kdb_printf("size %d nextents %d next extent %d\n",
-		efip->efi_format.efi_size, efip->efi_format.efi_nextents,
-		efip->efi_next_extent);
-	kdb_printf("id %Lx", efip->efi_format.efi_id);
-	printflags(efip->efi_flags, efi_flags, "flags :");
-	kdb_printf("\n");
-	kdb_printf("efi extents:\n");
-	ep = &(efip->efi_format.efi_extents[0]);
-	for (i = 0; i < efip->efi_next_extent; i++, ep++) {
-		kdb_printf("    block %Lx len %d\n",
-			ep->ext_start, ep->ext_len);
-	}
-}
-
-/*
- * Format inode "format" into a static buffer & return it.
- */
-static char *
-xfs_fmtformat(xfs_dinode_fmt_t f)
-{
-	static char *t[] = {
-		"dev",
-		"local",
-		"extents",
-		"btree",
-		"uuid"
-	};
-
-	return t[f];
-}
-
-/*
- * Format fsblock number into a static buffer & return it.
- */
-static char *
-xfs_fmtfsblock(xfs_fsblock_t bno, xfs_mount_t *mp)
-{
-	static char rval[50];
-
-	if (bno == NULLFSBLOCK)
-		sprintf(rval, "NULLFSBLOCK");
-	else if (ISNULLSTARTBLOCK(bno))
-		sprintf(rval, "NULLSTARTBLOCK(%Ld)", STARTBLOCKVAL(bno));
-	else if (mp)
-		sprintf(rval, "%Ld[%x:%x]", (xfs_dfsbno_t)bno,
-			XFS_FSB_TO_AGNO(mp, bno), XFS_FSB_TO_AGBNO(mp, bno));
-	else
-		sprintf(rval, "%Ld", (xfs_dfsbno_t)bno);
-	return rval;
-}
-
-/*
- * Format inode number into a static buffer & return it.
- */
-static char *
-xfs_fmtino(xfs_ino_t ino, xfs_mount_t *mp)
-{
-	static char rval[50];
-
-	if (mp)
-		sprintf(rval, "%llu[%x:%x:%x]",
-			(unsigned long long) ino,
-			XFS_INO_TO_AGNO(mp, ino),
-			XFS_INO_TO_AGBNO(mp, ino),
-			XFS_INO_TO_OFFSET(mp, ino));
-	else
-		sprintf(rval, "%llu", (unsigned long long) ino);
-	return rval;
-}
-
-/*
- * Format an lsn for printing into a static buffer & return it.
- */
-static char *
-xfs_fmtlsn(xfs_lsn_t *lsnp)
-{
-	uint		*wordp;
-	uint		*word2p;
-	static char	buf[20];
-
-	wordp = (uint *)lsnp;
-	word2p = wordp++;
-	sprintf(buf, "[%u:%u]", *wordp, *word2p);
-
-	return buf;
-}
-
-/*
- * Format file mode into a static buffer & return it.
- */
-static char *
-xfs_fmtmode(int m)
-{
-	static char rval[16];
-
-	sprintf(rval, "%c%c%c%c%c%c%c%c%c%c%c%c%c",
-		"?fc?dxb?r?l?S?m?"[(m & IFMT) >> 12],
-		m & ISUID ? 'u' : '-',
-		m & ISGID ? 'g' : '-',
-		m & ISVTX ? 'v' : '-',
-		m & IREAD ? 'r' : '-',
-		m & IWRITE ? 'w' : '-',
-		m & IEXEC ? 'x' : '-',
-		m & (IREAD >> 3) ? 'r' : '-',
-		m & (IWRITE >> 3) ? 'w' : '-',
-		m & (IEXEC >> 3) ? 'x' : '-',
-		m & (IREAD >> 6) ? 'r' : '-',
-		m & (IWRITE >> 6) ? 'w' : '-',
-		m & (IEXEC >> 6) ? 'x' : '-');
-	return rval;
-}
-
-/*
- * Format a size into a static buffer & return it.
- */
-static char *
-xfs_fmtsize(size_t i)
-{
-	static char rval[20];
-
-	/* size_t is 32 bits in 32-bit kernel, 64 bits in 64-bit kernel */
-	sprintf(rval, "0x%lx", (unsigned long) i);
-	return rval;
-}
-
-/*
- * Format a uuid into a static buffer & return it.
- */
-static char *
-xfs_fmtuuid(uuid_t *uu)
-{
-	static char rval[40];
-	char        *o          = rval;
-	char        *i          = (unsigned char*)uu;
-	int         b;
-
-	for (b=0;b<16;b++) {
-	    o+=sprintf(o, "%02x", *i++);
-	    if (b==3||b==5||b==7||b==9) *o++='-';
-	}
-	*o='\0';
-
-	return rval;
-}
-
-/*
- * Print an inode log item.
- */
-static void
-xfs_inode_item_print(xfs_inode_log_item_t *ilip, int summary)
-{
-	static char *ili_flags[] = {
-		"hold",		/* 0x1 */
-		"iolock excl",	/* 0x2 */
-		"iolock shrd",	/* 0x4 */
-		0
-		};
-	static char *ilf_fields[] = {
-		"core",		/* 0x001 */
-		"ddata",	/* 0x002 */
-		"dexts",	/* 0x004 */
-		"dbroot",	/* 0x008 */
-		"dev",		/* 0x010 */
-		"uuid",		/* 0x020 */
-		"adata",	/* 0x040 */
-		"aext",		/* 0x080 */
-		"abroot",	/* 0x100 */
-		0
-		};
-
-	if (summary) {
-		kdb_printf("inode 0x%p logged %d ",
-			ilip->ili_inode, ilip->ili_logged);
-		printflags(ilip->ili_flags, ili_flags, "flags:");
-		printflags(ilip->ili_format.ilf_fields, ilf_fields, "format:");
-		printflags(ilip->ili_last_fields, ilf_fields, "lastfield:");
-		kdb_printf("\n");
-		return;
-	}
-	kdb_printf("inode 0x%p ino 0x%llu logged %d flags: ",
-		ilip->ili_inode, (unsigned long long) ilip->ili_format.ilf_ino,
-		ilip->ili_logged);
-	printflags(ilip->ili_flags, ili_flags, NULL);
-	kdb_printf("\n");
-	kdb_printf("ilock recur %d iolock recur %d ext buf 0x%p\n",
-		ilip->ili_ilock_recur, ilip->ili_iolock_recur,
-		ilip->ili_extents_buf);
-#ifdef XFS_TRANS_DEBUG
-	kdb_printf("root bytes %d root orig 0x%x\n",
-		ilip->ili_root_size, ilip->ili_orig_root);
-#endif
-	kdb_printf("size %d fields: ", ilip->ili_format.ilf_size);
-	printflags(ilip->ili_format.ilf_fields, ilf_fields, "formatfield");
-	kdb_printf(" last fields: ");
-	printflags(ilip->ili_last_fields, ilf_fields, "lastfield");
-	kdb_printf("\n");
-	kdb_printf(" flush lsn %s last lsn %s\n",
-		xfs_fmtlsn(&(ilip->ili_flush_lsn)),
-		xfs_fmtlsn(&(ilip->ili_last_lsn)));
-	kdb_printf("dsize %d, asize %d, rdev 0x%x\n",
-		ilip->ili_format.ilf_dsize,
-		ilip->ili_format.ilf_asize,
-		ilip->ili_format.ilf_u.ilfu_rdev);
-	kdb_printf("blkno 0x%Lx len 0x%x boffset 0x%x\n",
-		ilip->ili_format.ilf_blkno,
-		ilip->ili_format.ilf_len,
-		ilip->ili_format.ilf_boffset);
-}
-
-/*
- * Print a dquot log item.
- */
-/* ARGSUSED */
-static void
-xfs_dquot_item_print(xfs_dq_logitem_t *lip, int summary)
-{
-	kdb_printf("dquot 0x%p\n",
-		lip->qli_dquot);
-
-}
-
-/*
- * Print a quotaoff log item.
- */
-/* ARGSUSED */
-static void
-xfs_qoff_item_print(xfs_qoff_logitem_t *lip, int summary)
-{
-	kdb_printf("start qoff item 0x%p flags 0x%x\n",
-		lip->qql_start_lip, lip->qql_format.qf_flags);
-
-}
-
-/*
- * Print buffer full of inodes.
- */
-static void
-xfs_inodebuf(xfs_buf_t *bp)
-{
-	xfs_dinode_t *di;
-	int n, i;
-
-	n = XFS_BUF_COUNT(bp) >> 8;
-	for (i = 0; i < n; i++) {
-		di = (xfs_dinode_t *)xfs_buf_offset(bp,
-					i * 256);
-		xfs_prdinode(di, 0, ARCH_CONVERT);
-	}
-}
-
-
-/*
- * Print disk inode.
- */
-static void
-xfs_prdinode(xfs_dinode_t *di, int coreonly, int convert)
-{
-	xfs_prdinode_core(&di->di_core, convert);
-	if (!coreonly)
-		kdb_printf("next_unlinked 0x%x u@0x%p\n",
-			INT_GET(di->di_next_unlinked, convert),
-			&di->di_u);
-}
-
-/*
- * Print disk inode core.
- */
-static void
-xfs_prdinode_core(xfs_dinode_core_t *dip, int convert)
-{
-	static char *diflags[] = {
-		"realtime",		/* XFS_DIFLAG_REALTIME */
-		"prealloc",		/* XFS_DIFLAG_PREALLOC */
-		"newrtbm",		/* XFS_DIFLAG_NEWRTBM */
-		"immutable",		/* XFS_DIFLAG_IMMUTABLE */
-		"append",		/* XFS_DIFLAG_APPEND */
-		"sync",			/* XFS_DIFLAG_SYNC */
-		"noatime",		/* XFS_DIFLAG_NOATIME */
-		"nodump",		/* XFS_DIFLAG_NODUMP */
-		NULL
-	};
-
-	kdb_printf("magic 0x%x mode 0%o (%s) version 0x%x format 0x%x (%s)\n",
-		INT_GET(dip->di_magic, convert),
-		INT_GET(dip->di_mode, convert),
-		xfs_fmtmode(INT_GET(dip->di_mode, convert)),
-		INT_GET(dip->di_version, convert),
-		INT_GET(dip->di_format, convert),
-		xfs_fmtformat(
-		    (xfs_dinode_fmt_t)INT_GET(dip->di_format, convert)));
-	kdb_printf("nlink %d uid %d gid %d projid %d flushiter %u\n",
-		INT_GET(dip->di_nlink, convert),
-		INT_GET(dip->di_uid, convert),
-		INT_GET(dip->di_gid, convert),
-		(uint)INT_GET(dip->di_projid, convert),
-		(uint)INT_GET(dip->di_flushiter, convert));
-	kdb_printf("atime 0x%x:%x mtime 0x%x:%x ctime 0x%x:%x\n",
-		INT_GET(dip->di_atime.t_sec, convert),
-		INT_GET(dip->di_atime.t_nsec, convert),
-		INT_GET(dip->di_mtime.t_sec, convert),
-		INT_GET(dip->di_mtime.t_nsec, convert),
-		INT_GET(dip->di_ctime.t_sec, convert),
-		INT_GET(dip->di_ctime.t_nsec, convert));
-	kdb_printf("size 0x%Lx ", INT_GET(dip->di_size, convert));
-	kdb_printf("nblocks %Ld extsize 0x%x nextents 0x%x anextents 0x%x\n",
-		INT_GET(dip->di_nblocks, convert),
-		INT_GET(dip->di_extsize, convert),
-		INT_GET(dip->di_nextents, convert),
-		INT_GET(dip->di_anextents, convert));
-	kdb_printf("forkoff %d aformat 0x%x (%s) dmevmask 0x%x dmstate 0x%x ",
-		INT_GET(dip->di_forkoff, convert),
-		INT_GET(dip->di_aformat, convert),
-		xfs_fmtformat(
-		    (xfs_dinode_fmt_t)INT_GET(dip->di_aformat, convert)),
-		INT_GET(dip->di_dmevmask, convert),
-		INT_GET(dip->di_dmstate, convert));
-	printflags(INT_GET(dip->di_flags, convert), diflags, "flags");
-	kdb_printf("gen 0x%x\n", INT_GET(dip->di_gen, convert));
-}
-
-/*
- * Print xfs extent list for a fork.
- */
-static void
-xfs_xexlist_fork(xfs_inode_t *ip, int whichfork)
-{
-	int nextents, i;
-	xfs_ifork_t *ifp;
-	xfs_bmbt_irec_t irec;
-
-	ifp = XFS_IFORK_PTR(ip, whichfork);
-	if (ifp->if_flags & XFS_IFEXTENTS) {
-		nextents = ifp->if_bytes / sizeof(xfs_bmbt_rec_64_t);
-		kdb_printf("inode 0x%p %cf extents 0x%p nextents 0x%x\n",
-			ip, "da"[whichfork], ifp->if_u1.if_extents, nextents);
-		for (i = 0; i < nextents; i++) {
-			xfs_bmbt_get_all(&ifp->if_u1.if_extents[i], &irec);
-			kdb_printf(
-		"%d: startoff %Ld startblock %s blockcount %Ld flag %d\n",
-			i, irec.br_startoff,
-			xfs_fmtfsblock(irec.br_startblock, ip->i_mount),
-			irec.br_blockcount, irec.br_state);
-		}
-	}
-}
-
-static void
-xfs_xnode_fork(char *name, xfs_ifork_t *f)
-{
-	static char *tab_flags[] = {
-		"inline",	/* XFS_IFINLINE */
-		"extents",	/* XFS_IFEXTENTS */
-		"broot",	/* XFS_IFBROOT */
-		NULL
-	};
-	int *p;
-
-	kdb_printf("%s fork", name);
-	if (f == NULL) {
-		kdb_printf(" empty\n");
-		return;
-	} else
-		kdb_printf("\n");
-	kdb_printf(" bytes %s ", xfs_fmtsize(f->if_bytes));
-	kdb_printf("real_bytes %s lastex 0x%x u1:%s 0x%p\n",
-		xfs_fmtsize(f->if_real_bytes), f->if_lastex,
-		f->if_flags & XFS_IFINLINE ? "data" : "extents",
-		f->if_flags & XFS_IFINLINE ?
-			f->if_u1.if_data :
-			(char *)f->if_u1.if_extents);
-	kdb_printf(" broot 0x%p broot_bytes %s ext_max %d ",
-		f->if_broot, xfs_fmtsize(f->if_broot_bytes), f->if_ext_max);
-	printflags(f->if_flags, tab_flags, "flags");
-	kdb_printf("\n");
-	kdb_printf(" u2");
-	for (p = (int *)&f->if_u2;
-	     p < (int *)((char *)&f->if_u2 + XFS_INLINE_DATA);
-	     p++)
-		kdb_printf(" 0x%x", *p);
-	kdb_printf("\n");
-}
-
-/*
- * Command-level xfs-idbg functions.
- */
-
-/*
- * Print xfs allocation group freespace header.
- */
-static void
-xfsidbg_xagf(xfs_agf_t *agf)
-{
-	kdb_printf("magicnum 0x%x versionnum 0x%x seqno 0x%x length 0x%x\n",
-		INT_GET(agf->agf_magicnum, ARCH_CONVERT),
-		INT_GET(agf->agf_versionnum, ARCH_CONVERT),
-		INT_GET(agf->agf_seqno, ARCH_CONVERT),
-		INT_GET(agf->agf_length, ARCH_CONVERT));
-	kdb_printf("roots b 0x%x c 0x%x levels b %d c %d\n",
-		INT_GET(agf->agf_roots[XFS_BTNUM_BNO], ARCH_CONVERT),
-		INT_GET(agf->agf_roots[XFS_BTNUM_CNT], ARCH_CONVERT),
-		INT_GET(agf->agf_levels[XFS_BTNUM_BNO], ARCH_CONVERT),
-		INT_GET(agf->agf_levels[XFS_BTNUM_CNT], ARCH_CONVERT));
-	kdb_printf("flfirst %d fllast %d flcount %d freeblks %d longest %d\n",
-		INT_GET(agf->agf_flfirst, ARCH_CONVERT),
-		INT_GET(agf->agf_fllast, ARCH_CONVERT),
-		INT_GET(agf->agf_flcount, ARCH_CONVERT),
-		INT_GET(agf->agf_freeblks, ARCH_CONVERT),
-		INT_GET(agf->agf_longest, ARCH_CONVERT));
-}
-
-/*
- * Print xfs allocation group inode header.
- */
-static void
-xfsidbg_xagi(xfs_agi_t *agi)
-{
-	int	i;
-	int	j;
-
-	kdb_printf("magicnum 0x%x versionnum 0x%x seqno 0x%x length 0x%x\n",
-		INT_GET(agi->agi_magicnum, ARCH_CONVERT),
-		INT_GET(agi->agi_versionnum, ARCH_CONVERT),
-		INT_GET(agi->agi_seqno, ARCH_CONVERT),
-		INT_GET(agi->agi_length, ARCH_CONVERT));
-	kdb_printf("count 0x%x root 0x%x level 0x%x\n",
-		INT_GET(agi->agi_count, ARCH_CONVERT),
-		INT_GET(agi->agi_root, ARCH_CONVERT),
-		INT_GET(agi->agi_level, ARCH_CONVERT));
-	kdb_printf("freecount 0x%x newino 0x%x dirino 0x%x\n",
-		INT_GET(agi->agi_freecount, ARCH_CONVERT),
-		INT_GET(agi->agi_newino, ARCH_CONVERT),
-		INT_GET(agi->agi_dirino, ARCH_CONVERT));
-
-	kdb_printf("unlinked buckets\n");
-	for (i = 0; i < XFS_AGI_UNLINKED_BUCKETS; i++) {
-		for (j = 0; j < 4; j++, i++) {
-			kdb_printf("0x%08x ",
-				INT_GET(agi->agi_unlinked[i], ARCH_CONVERT));
-		}
-		kdb_printf("\n");
-	}
-}
-
-
-/*
- * Print an allocation argument structure for XFS.
- */
-static void
-xfsidbg_xalloc(xfs_alloc_arg_t *args)
-{
-	kdb_printf("tp 0x%p mp 0x%p agbp 0x%p pag 0x%p fsbno %s\n",
-		args->tp, args->mp, args->agbp, args->pag,
-		xfs_fmtfsblock(args->fsbno, args->mp));
-	kdb_printf("agno 0x%x agbno 0x%x minlen 0x%x maxlen 0x%x mod 0x%x\n",
-		args->agno, args->agbno, args->minlen, args->maxlen, args->mod);
-	kdb_printf("prod 0x%x minleft 0x%x total 0x%x alignment 0x%x\n",
-		args->prod, args->minleft, args->total, args->alignment);
-	kdb_printf("minalignslop 0x%x len 0x%x type %s otype %s wasdel %d\n",
-		args->minalignslop, args->len, xfs_alloctype[args->type],
-		xfs_alloctype[args->otype], args->wasdel);
-	kdb_printf("wasfromfl %d isfl %d userdata %d\n",
-		args->wasfromfl, args->isfl, args->userdata);
-}
-
-#ifdef DEBUG
-/*
- * Print out all the entries in the alloc trace buf corresponding
- * to the given mount point.
- */
-static void
-xfsidbg_xalmtrace(xfs_mount_t *mp)
-{
-	ktrace_entry_t	*ktep;
-	ktrace_snap_t	kts;
-	extern ktrace_t	*xfs_alloc_trace_buf;
-
-	if (xfs_alloc_trace_buf == NULL) {
-		kdb_printf("The xfs alloc trace buffer is not initialized\n");
-		return;
-	}
-
-	ktep = ktrace_first(xfs_alloc_trace_buf, &kts);
-	while (ktep != NULL) {
-		if ((__psint_t)ktep->val[0] && (xfs_mount_t *)ktep->val[3] == mp) {
-			(void)xfs_alloc_trace_entry(ktep);
-			kdb_printf("\n");
-		}
-		ktep = ktrace_next(xfs_alloc_trace_buf, &kts);
-	}
-}
-#endif /* DEBUG */
-
-/*
- * Print an attr_list() context structure.
- */
-static void
-xfsidbg_xattrcontext(xfs_attr_list_context_t *context)
-{
-	static char *attr_arg_flags[] = {
-		"DONTFOLLOW",	/* 0x0001 */
-		"?",		/* 0x0002 */
-		"?",		/* 0x0004 */
-		"?",		/* 0x0008 */
-		"CREATE",	/* 0x0010 */
-		"?",		/* 0x0020 */
-		"?",		/* 0x0040 */
-		"?",		/* 0x0080 */
-		"?",		/* 0x0100 */
-		"?",		/* 0x0200 */
-		"?",		/* 0x0400 */
-		"?",		/* 0x0800 */
-		"KERNOTIME",	/* 0x1000 */
-		NULL
-	};
-
-	kdb_printf("dp 0x%p, dupcnt %d, resynch %d",
-		    context->dp, context->dupcnt, context->resynch);
-	printflags((__psunsigned_t)context->flags, attr_arg_flags, ", flags");
-	kdb_printf("\ncursor h/b/o 0x%x/0x%x/%d -- p/p/i 0x%x/0x%x/0x%x\n",
-			  context->cursor->hashval, context->cursor->blkno,
-			  context->cursor->offset, context->cursor->pad1,
-			  context->cursor->pad2, context->cursor->initted);
-	kdb_printf("alist 0x%p, bufsize 0x%x, count %d, firstu 0x%x\n",
-		       context->alist, context->bufsize, context->count,
-		       context->firstu);
-}
-
-/*
- * Print attribute leaf block.
- */
-static void
-xfsidbg_xattrleaf(xfs_attr_leafblock_t *leaf)
-{
-	xfs_attr_leaf_hdr_t *h;
-	xfs_da_blkinfo_t *i;
-	xfs_attr_leaf_map_t *m;
-	xfs_attr_leaf_entry_t *e;
-	xfs_attr_leaf_name_local_t *l;
-	xfs_attr_leaf_name_remote_t *r;
-	int j, k;
-
-	h = &leaf->hdr;
-	i = &h->info;
-	kdb_printf("hdr info forw 0x%x back 0x%x magic 0x%x\n",
-		i->forw, i->back, i->magic);
-	kdb_printf("hdr count %d usedbytes %d firstused %d holes %d\n",
-		INT_GET(h->count, ARCH_CONVERT),
-		INT_GET(h->usedbytes, ARCH_CONVERT),
-		INT_GET(h->firstused, ARCH_CONVERT), h->holes);
-	for (j = 0, m = h->freemap; j < XFS_ATTR_LEAF_MAPSIZE; j++, m++) {
-		kdb_printf("hdr freemap %d base %d size %d\n",
-			j, INT_GET(m->base, ARCH_CONVERT),
-			INT_GET(m->size, ARCH_CONVERT));
-	}
-	for (j = 0, e = leaf->entries; j < INT_GET(h->count, ARCH_CONVERT); j++, e++) {
-		kdb_printf("[%2d] hash 0x%x nameidx %d flags 0x%x",
-			j, INT_GET(e->hashval, ARCH_CONVERT),
-			INT_GET(e->nameidx, ARCH_CONVERT), e->flags);
-		if (e->flags & XFS_ATTR_LOCAL)
-			kdb_printf("LOCAL ");
-		if (e->flags & XFS_ATTR_ROOT)
-			kdb_printf("ROOT ");
-		if (e->flags & XFS_ATTR_INCOMPLETE)
-			kdb_printf("INCOMPLETE ");
-		k = ~(XFS_ATTR_LOCAL | XFS_ATTR_ROOT | XFS_ATTR_INCOMPLETE);
-		if ((e->flags & k) != 0)
-			kdb_printf("0x%x", e->flags & k);
-		kdb_printf(">\n     name \"");
-		if (e->flags & XFS_ATTR_LOCAL) {
-			l = XFS_ATTR_LEAF_NAME_LOCAL(leaf, j);
-			for (k = 0; k < l->namelen; k++)
-				kdb_printf("%c", l->nameval[k]);
-			kdb_printf("\"(%d) value \"", l->namelen);
-			for (k = 0; (k < INT_GET(l->valuelen, ARCH_CONVERT)) && (k < 32); k++)
-				kdb_printf("%c", l->nameval[l->namelen + k]);
-			if (k == 32)
-				kdb_printf("...");
-			kdb_printf("\"(%d)\n",
-				INT_GET(l->valuelen, ARCH_CONVERT));
-		} else {
-			r = XFS_ATTR_LEAF_NAME_REMOTE(leaf, j);
-			for (k = 0; k < r->namelen; k++)
-				kdb_printf("%c", r->name[k]);
-			kdb_printf("\"(%d) value blk 0x%x len %d\n",
-				    r->namelen,
-				    INT_GET(r->valueblk, ARCH_CONVERT),
-				    INT_GET(r->valuelen, ARCH_CONVERT));
-		}
-	}
-}
-
-/*
- * Print a shortform attribute list.
- */
-static void
-xfsidbg_xattrsf(xfs_attr_shortform_t *s)
-{
-	xfs_attr_sf_hdr_t *sfh;
-	xfs_attr_sf_entry_t *sfe;
-	int i, j;
-
-	sfh = &s->hdr;
-	kdb_printf("hdr count %d\n", INT_GET(sfh->count, ARCH_CONVERT));
-	for (i = 0, sfe = s->list; i < INT_GET(sfh->count, ARCH_CONVERT); i++) {
-		kdb_printf("entry %d namelen %d name \"", i, sfe->namelen);
-		for (j = 0; j < sfe->namelen; j++)
-			kdb_printf("%c", sfe->nameval[j]);
-		kdb_printf("\" valuelen %d value \"", INT_GET(sfe->valuelen, ARCH_CONVERT));
-		for (j = 0; (j < INT_GET(sfe->valuelen, ARCH_CONVERT)) && (j < 32); j++)
-			kdb_printf("%c", sfe->nameval[sfe->namelen + j]);
-		if (j == 32)
-			kdb_printf("...");
-		kdb_printf("\"\n");
-		sfe = XFS_ATTR_SF_NEXTENTRY(sfe);
-	}
-}
-
-
-/*
- * Print xfs bmap internal record
- */
-static void
-xfsidbg_xbirec(xfs_bmbt_irec_t *r)
-{
-	kdb_printf(
-	"startoff %Ld startblock %Lx blockcount %Ld state %Ld\n",
-		(__uint64_t)r->br_startoff,
-		(__uint64_t)r->br_startblock,
-		(__uint64_t)r->br_blockcount,
-		(__uint64_t)r->br_state);
-}
-
-
-/*
- * Print a bmap alloc argument structure for XFS.
- */
-static void
-xfsidbg_xbmalla(xfs_bmalloca_t *a)
-{
-	kdb_printf("tp 0x%p ip 0x%p eof %d prevp 0x%p\n",
-		a->tp, a->ip, a->eof, a->prevp);
-	kdb_printf("gotp 0x%p firstblock %s alen %d total %d\n",
-		a->gotp, xfs_fmtfsblock(a->firstblock, a->ip->i_mount),
-		a->alen, a->total);
-	kdb_printf("off %s wasdel %d userdata %d minlen %d\n",
-		xfs_fmtfsblock(a->off, a->ip->i_mount), a->wasdel,
-		a->userdata, a->minlen);
-	kdb_printf("minleft %d low %d rval %s aeof %d\n",
-		a->minleft, a->low, xfs_fmtfsblock(a->rval, a->ip->i_mount),
-		a->aeof);
-}
-
-
-/*
- * Print xfs bmap record
- */
-static void
-xfsidbg_xbrec(xfs_bmbt_rec_64_t *r)
-{
-	xfs_bmbt_irec_t	irec;
-
-	xfs_bmbt_get_all((xfs_bmbt_rec_t *)r, &irec);
-	kdb_printf("startoff %Ld startblock %Lx blockcount %Ld flag %d\n",
-		irec.br_startoff, (__uint64_t)irec.br_startblock,
-		irec.br_blockcount, irec.br_state);
-}
-
-/*
- * Print an xfs in-inode bmap btree root (data fork).
- */
-static void
-xfsidbg_xbroot(xfs_inode_t *ip)
-{
-	xfs_broot(ip, &ip->i_df);
-}
-
-/*
- * Print an xfs in-inode bmap btree root (attribute fork).
- */
-static void
-xfsidbg_xbroota(xfs_inode_t *ip)
-{
-	if (ip->i_afp)
-		xfs_broot(ip, ip->i_afp);
-}
-
-/*
- * Print xfs btree cursor.
- */
-static void
-xfsidbg_xbtcur(xfs_btree_cur_t *c)
-{
-	int l;
-
-	kdb_printf("tp 0x%p mp 0x%p\n",
-		c->bc_tp,
-		c->bc_mp);
-	if (c->bc_btnum == XFS_BTNUM_BMAP) {
-		kdb_printf("rec.b ");
-		xfsidbg_xbirec(&c->bc_rec.b);
-	} else if (c->bc_btnum == XFS_BTNUM_INO) {
-		kdb_printf("rec.i startino 0x%x freecount 0x%x free %Lx\n",
-			c->bc_rec.i.ir_startino, c->bc_rec.i.ir_freecount,
-			c->bc_rec.i.ir_free);
-	} else {
-		kdb_printf("rec.a startblock 0x%x blockcount 0x%x\n",
-			c->bc_rec.a.ar_startblock,
-			c->bc_rec.a.ar_blockcount);
-	}
-	kdb_printf("bufs");
-	for (l = 0; l < c->bc_nlevels; l++)
-		kdb_printf(" 0x%p", c->bc_bufs[l]);
-	kdb_printf("\n");
-	kdb_printf("ptrs");
-	for (l = 0; l < c->bc_nlevels; l++)
-		kdb_printf(" 0x%x", c->bc_ptrs[l]);
-	kdb_printf("  ra");
-	for (l = 0; l < c->bc_nlevels; l++)
-		kdb_printf(" %d", c->bc_ra[l]);
-	kdb_printf("\n");
-	kdb_printf("nlevels %d btnum %s blocklog %d\n",
-		c->bc_nlevels,
-		c->bc_btnum == XFS_BTNUM_BNO ? "bno" :
-		(c->bc_btnum == XFS_BTNUM_CNT ? "cnt" :
-		 (c->bc_btnum == XFS_BTNUM_BMAP ? "bmap" : "ino")),
-		c->bc_blocklog);
-	if (c->bc_btnum == XFS_BTNUM_BMAP) {
-		kdb_printf("private forksize 0x%x whichfork %d ip 0x%p flags %d\n",
-			c->bc_private.b.forksize,
-			c->bc_private.b.whichfork,
-			c->bc_private.b.ip,
-			c->bc_private.b.flags);
-		kdb_printf("private firstblock %s flist 0x%p allocated 0x%x\n",
-			xfs_fmtfsblock(c->bc_private.b.firstblock, c->bc_mp),
-			c->bc_private.b.flist,
-			c->bc_private.b.allocated);
-	} else if (c->bc_btnum == XFS_BTNUM_INO) {
-		kdb_printf("private agbp 0x%p agno 0x%x\n",
-			c->bc_private.i.agbp,
-			c->bc_private.i.agno);
-	} else {
-		kdb_printf("private agbp 0x%p agno 0x%x\n",
-			c->bc_private.a.agbp,
-			c->bc_private.a.agno);
-	}
-}
-
-/*
- * Figure out what kind of xfs block the buffer contains,
- * and invoke a print routine.
- */
-static void
-xfsidbg_xbuf(xfs_buf_t *bp)
-{
-	xfsidbg_xbuf_real(bp, 0);
-}
-
-/*
- * Figure out what kind of xfs block the buffer contains,
- * and invoke a print routine (if asked to).
- */
-static void
-xfsidbg_xbuf_real(xfs_buf_t *bp, int summary)
-{
-	void *d;
-	xfs_agf_t *agf;
-	xfs_agi_t *agi;
-	xfs_sb_t *sb;
-	xfs_alloc_block_t *bta;
-	xfs_bmbt_block_t *btb;
-	xfs_inobt_block_t *bti;
-	xfs_attr_leafblock_t *aleaf;
-	xfs_dir_leafblock_t *dleaf;
-	xfs_da_intnode_t *node;
-	xfs_dinode_t *di;
-	xfs_disk_dquot_t *dqb;
-	xfs_dir2_block_t *d2block;
-	xfs_dir2_data_t *d2data;
-	xfs_dir2_leaf_t *d2leaf;
-	xfs_dir2_free_t *d2free;
-
-	d = XFS_BUF_PTR(bp);
-	if (INT_GET((agf = d)->agf_magicnum, ARCH_CONVERT) == XFS_AGF_MAGIC) {
-		if (summary) {
-			kdb_printf("freespace hdr for AG %d (at 0x%p)\n",
-				INT_GET(agf->agf_seqno, ARCH_CONVERT), agf);
-		} else {
-			kdb_printf("buf 0x%p agf 0x%p\n", bp, agf);
-			xfsidbg_xagf(agf);
-		}
-	} else if (INT_GET((agi = d)->agi_magicnum, ARCH_CONVERT) == XFS_AGI_MAGIC) {
-		if (summary) {
-			kdb_printf("Inode hdr for AG %d (at 0x%p)\n",
-			       INT_GET(agi->agi_seqno, ARCH_CONVERT), agi);
-		} else {
-			kdb_printf("buf 0x%p agi 0x%p\n", bp, agi);
-			xfsidbg_xagi(agi);
-		}
-	} else if (INT_GET((bta = d)->bb_magic, ARCH_CONVERT) == XFS_ABTB_MAGIC) {
-		if (summary) {
-			kdb_printf("Alloc BNO Btree blk, level %d (at 0x%p)\n",
-				       INT_GET(bta->bb_level, ARCH_CONVERT), bta);
-		} else {
-			kdb_printf("buf 0x%p abtbno 0x%p\n", bp, bta);
-			xfs_btalloc(bta, XFS_BUF_COUNT(bp));
-		}
-	} else if (INT_GET((bta = d)->bb_magic, ARCH_CONVERT) == XFS_ABTC_MAGIC) {
-		if (summary) {
-			kdb_printf("Alloc COUNT Btree blk, level %d (at 0x%p)\n",
-				       INT_GET(bta->bb_level, ARCH_CONVERT), bta);
-		} else {
-			kdb_printf("buf 0x%p abtcnt 0x%p\n", bp, bta);
-			xfs_btalloc(bta, XFS_BUF_COUNT(bp));
-		}
-	} else if (INT_GET((btb = d)->bb_magic, ARCH_CONVERT) == XFS_BMAP_MAGIC) {
-		if (summary) {
-			kdb_printf("Bmap Btree blk, level %d (at 0x%p)\n",
-				      INT_GET(btb->bb_level, ARCH_CONVERT), btb);
-		} else {
-			kdb_printf("buf 0x%p bmapbt 0x%p\n", bp, btb);
-			xfs_btbmap(btb, XFS_BUF_COUNT(bp));
-		}
-	} else if (INT_GET((bti = d)->bb_magic, ARCH_CONVERT) == XFS_IBT_MAGIC) {
-		if (summary) {
-			kdb_printf("Inode Btree blk, level %d (at 0x%p)\n",
-				       INT_GET(bti->bb_level, ARCH_CONVERT), bti);
-		} else {
-			kdb_printf("buf 0x%p inobt 0x%p\n", bp, bti);
-			xfs_btino(bti, XFS_BUF_COUNT(bp));
-		}
-	} else if (INT_GET((aleaf = d)->hdr.info.magic, ARCH_CONVERT) == XFS_ATTR_LEAF_MAGIC) {
-		if (summary) {
-			kdb_printf("Attr Leaf, 1st hash 0x%x (at 0x%p)\n",
-				      INT_GET(aleaf->entries[0].hashval, ARCH_CONVERT), aleaf);
-		} else {
-			kdb_printf("buf 0x%p attr leaf 0x%p\n", bp, aleaf);
-			xfsidbg_xattrleaf(aleaf);
-		}
-	} else if (INT_GET((dleaf = d)->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC) {
-		if (summary) {
-			kdb_printf("Dir Leaf, 1st hash 0x%x (at 0x%p)\n",
-				     dleaf->entries[0].hashval, dleaf);
-		} else {
-			kdb_printf("buf 0x%p dir leaf 0x%p\n", bp, dleaf);
-			xfsidbg_xdirleaf(dleaf);
-		}
-	} else if (INT_GET((node = d)->hdr.info.magic, ARCH_CONVERT) == XFS_DA_NODE_MAGIC) {
-		if (summary) {
-			kdb_printf("Dir/Attr Node, level %d, 1st hash 0x%x (at 0x%p)\n",
-			      node->hdr.level, node->btree[0].hashval, node);
-		} else {
-			kdb_printf("buf 0x%p dir/attr node 0x%p\n", bp, node);
-			xfsidbg_xdanode(node);
-		}
-	} else if (INT_GET((di = d)->di_core.di_magic, ARCH_CONVERT) == XFS_DINODE_MAGIC) {
-		if (summary) {
-			kdb_printf("Disk Inode (at 0x%p)\n", di);
-		} else {
-			kdb_printf("buf 0x%p dinode 0x%p\n", bp, di);
-			xfs_inodebuf(bp);
-		}
-	} else if (INT_GET((sb = d)->sb_magicnum, ARCH_CONVERT) == XFS_SB_MAGIC) {
-		if (summary) {
-			kdb_printf("Superblock (at 0x%p)\n", sb);
-		} else {
-			kdb_printf("buf 0x%p sb 0x%p\n", bp, sb);
-			/* SB in a buffer - we need to convert */
-			xfsidbg_xsb(sb, 1);
-		}
-	} else if ((dqb = d)->d_magic == XFS_DQUOT_MAGIC) {
-#define XFSIDBG_DQTYPESTR(d)     \
-	((INT_GET((d)->d_flags, ARCH_CONVERT) & XFS_DQ_USER) ? "USR" : \
-	((INT_GET((d)->d_flags, ARCH_CONVERT) & XFS_DQ_GROUP) ? "GRP" : "???"))
-		kdb_printf("Quota blk starting ID [%d], type %s at 0x%p\n",
-			INT_GET(dqb->d_id, ARCH_CONVERT), XFSIDBG_DQTYPESTR(dqb), dqb);
-
-	} else if (INT_GET((d2block = d)->hdr.magic, ARCH_CONVERT) == XFS_DIR2_BLOCK_MAGIC) {
-		if (summary) {
-			kdb_printf("Dir2 block (at 0x%p)\n", d2block);
-		} else {
-			kdb_printf("buf 0x%p dir2 block 0x%p\n", bp, d2block);
-			xfs_dir2data((void *)d2block, XFS_BUF_COUNT(bp));
-		}
-	} else if (INT_GET((d2data = d)->hdr.magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC) {
-		if (summary) {
-			kdb_printf("Dir2 data (at 0x%p)\n", d2data);
-		} else {
-			kdb_printf("buf 0x%p dir2 data 0x%p\n", bp, d2data);
-			xfs_dir2data((void *)d2data, XFS_BUF_COUNT(bp));
-		}
-	} else if (INT_GET((d2leaf = d)->hdr.info.magic, ARCH_CONVERT) == XFS_DIR2_LEAF1_MAGIC) {
-		if (summary) {
-			kdb_printf("Dir2 leaf(1) (at 0x%p)\n", d2leaf);
-		} else {
-			kdb_printf("buf 0x%p dir2 leaf 0x%p\n", bp, d2leaf);
-			xfs_dir2leaf(d2leaf, XFS_BUF_COUNT(bp));
-		}
-	} else if (INT_GET(d2leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR2_LEAFN_MAGIC) {
-		if (summary) {
-			kdb_printf("Dir2 leaf(n) (at 0x%p)\n", d2leaf);
-		} else {
-			kdb_printf("buf 0x%p dir2 leaf 0x%p\n", bp, d2leaf);
-			xfs_dir2leaf(d2leaf, XFS_BUF_COUNT(bp));
-		}
-	} else if (INT_GET((d2free = d)->hdr.magic, ARCH_CONVERT) == XFS_DIR2_FREE_MAGIC) {
-		if (summary) {
-			kdb_printf("Dir2 free (at 0x%p)\n", d2free);
-		} else {
-			kdb_printf("buf 0x%p dir2 free 0x%p\n", bp, d2free);
-			xfsidbg_xdir2free(d2free);
-		}
-	} else {
-		kdb_printf("buf 0x%p unknown 0x%p\n", bp, d);
-	}
-}
-
-
-/*
- * Print an xfs_da_args structure.
- */
-static void
-xfsidbg_xdaargs(xfs_da_args_t *n)
-{
-	char *ch;
-	int i;
-
-	kdb_printf(" name \"");
-	for (i = 0; i < n->namelen; i++) {
-		kdb_printf("%c", n->name[i]);
-	}
-	kdb_printf("\"(%d) value ", n->namelen);
-	if (n->value) {
-		kdb_printf("\"");
-		ch = n->value;
-		for (i = 0; (i < n->valuelen) && (i < 32); ch++, i++) {
-			switch(*ch) {
-			case '\n':	kdb_printf("\n");		break;
-			case '\b':	kdb_printf("\b");		break;
-			case '\t':	kdb_printf("\t");		break;
-			default:	kdb_printf("%c", *ch);	break;
-			}
-		}
-		if (i == 32)
-			kdb_printf("...");
-		kdb_printf("\"(%d)\n", n->valuelen);
-	} else {
-		kdb_printf("(NULL)(%d)\n", n->valuelen);
-	}
-	kdb_printf(" hashval 0x%x whichfork %d flags <",
-		  (uint_t)n->hashval, n->whichfork);
-	if (n->flags & ATTR_ROOT)
-		kdb_printf("ROOT ");
-	if (n->flags & ATTR_CREATE)
-		kdb_printf("CREATE ");
-	if (n->flags & ATTR_REPLACE)
-		kdb_printf("REPLACE ");
-	if (n->flags & XFS_ATTR_INCOMPLETE)
-		kdb_printf("INCOMPLETE ");
-	i = ~(ATTR_ROOT | ATTR_CREATE | ATTR_REPLACE | XFS_ATTR_INCOMPLETE);
-	if ((n->flags & i) != 0)
-		kdb_printf("0x%x", n->flags & i);
-	kdb_printf(">\n");
-	kdb_printf(" rename %d justcheck %d addname %d oknoent %d\n",
-		  n->rename, n->justcheck, n->addname, n->oknoent);
-	kdb_printf(" leaf: blkno %d index %d rmtblkno %d rmtblkcnt %d\n",
-		  n->blkno, n->index, n->rmtblkno, n->rmtblkcnt);
-	kdb_printf(" leaf2: blkno %d index %d rmtblkno %d rmtblkcnt %d\n",
-		  n->blkno2, n->index2, n->rmtblkno2, n->rmtblkcnt2);
-	kdb_printf(" inumber %llu dp 0x%p firstblock 0x%p flist 0x%p\n",
-		  (unsigned long long) n->inumber,
-		  n->dp, n->firstblock, n->flist);
-	kdb_printf(" trans 0x%p total %d\n",
-		  n->trans, n->total);
-}
-
-/*
- * Print a da buffer structure.
- */
-static void
-xfsidbg_xdabuf(xfs_dabuf_t *dabuf)
-{
-	int	i;
-
-	kdb_printf("nbuf %d dirty %d bbcount %d data 0x%p bps",
-		dabuf->nbuf, dabuf->dirty, dabuf->bbcount, dabuf->data);
-	for (i = 0; i < dabuf->nbuf; i++)
-		kdb_printf(" %d:0x%p", i, dabuf->bps[i]);
-	kdb_printf("\n");
-#ifdef XFS_DABUF_DEBUG
-	kdb_printf(" ra 0x%x prev 0x%x next 0x%x dev %s blkno 0x%x\n",
-		dabuf->ra, dabuf->prev, dabuf->next,
-		XFS_BUFTARG_NAME(dabuf->dev), dabuf->blkno);
-#endif
-}
-
-/*
- * Print a directory/attribute internal node block.
- */
-static void
-xfsidbg_xdanode(xfs_da_intnode_t *node)
-{
-	xfs_da_node_hdr_t *h;
-	xfs_da_blkinfo_t *i;
-	xfs_da_node_entry_t *e;
-	int j;
-
-	h = &node->hdr;
-	i = &h->info;
-	kdb_printf("hdr info forw 0x%x back 0x%x magic 0x%x\n",
-		INT_GET(i->forw, ARCH_CONVERT), INT_GET(i->back, ARCH_CONVERT), INT_GET(i->magic, ARCH_CONVERT));
-	kdb_printf("hdr count %d level %d\n",
-		INT_GET(h->count, ARCH_CONVERT), INT_GET(h->level, ARCH_CONVERT));
-	for (j = 0, e = node->btree; j < INT_GET(h->count, ARCH_CONVERT); j++, e++) {
-		kdb_printf("btree %d hashval 0x%x before 0x%x\n",
-			j, (uint_t)INT_GET(e->hashval, ARCH_CONVERT), INT_GET(e->before, ARCH_CONVERT));
-	}
-}
-
-/*
- * Print an xfs_da_state_blk structure.
- */
-static void
-xfsidbg_xdastate(xfs_da_state_t *s)
-{
-	xfs_da_state_blk_t *eblk;
-
-	kdb_printf("args 0x%p mp 0x%p blocksize %u node_ents %u inleaf %u\n",
-		s->args, s->mp, s->blocksize, s->node_ents, s->inleaf);
-	if (s->args)
-		xfsidbg_xdaargs(s->args);
-
-	kdb_printf("path:  ");
-	xfs_dastate_path(&s->path);
-
-	kdb_printf("altpath:  ");
-	xfs_dastate_path(&s->altpath);
-
-	eblk = &s->extrablk;
-	kdb_printf("extra: valid %d, after %d\n", s->extravalid, s->extraafter);
-	kdb_printf(" bp 0x%p blkno 0x%x ", eblk->bp, eblk->blkno);
-	kdb_printf("index %d hashval 0x%x\n", eblk->index, (uint_t)eblk->hashval);
-}
-
-/*
- * Print a directory leaf block.
- */
-static void
-xfsidbg_xdirleaf(xfs_dir_leafblock_t *leaf)
-{
-	xfs_dir_leaf_hdr_t *h;
-	xfs_da_blkinfo_t *i;
-	xfs_dir_leaf_map_t *m;
-	xfs_dir_leaf_entry_t *e;
-	xfs_dir_leaf_name_t *n;
-	int j, k;
-	xfs_ino_t ino;
-
-	h = &leaf->hdr;
-	i = &h->info;
-	kdb_printf("hdr info forw 0x%x back 0x%x magic 0x%x\n",
-		INT_GET(i->forw, ARCH_CONVERT), INT_GET(i->back, ARCH_CONVERT), INT_GET(i->magic, ARCH_CONVERT));
-	kdb_printf("hdr count %d namebytes %d firstused %d holes %d\n",
-		INT_GET(h->count, ARCH_CONVERT), INT_GET(h->namebytes, ARCH_CONVERT), INT_GET(h->firstused, ARCH_CONVERT), h->holes);
-	for (j = 0, m = h->freemap; j < XFS_DIR_LEAF_MAPSIZE; j++, m++) {
-		kdb_printf("hdr freemap %d base %d size %d\n",
-			j, INT_GET(m->base, ARCH_CONVERT), INT_GET(m->size, ARCH_CONVERT));
-	}
-	for (j = 0, e = leaf->entries; j < INT_GET(h->count, ARCH_CONVERT); j++, e++) {
-		n = XFS_DIR_LEAF_NAMESTRUCT(leaf, INT_GET(e->nameidx, ARCH_CONVERT));
-		XFS_DIR_SF_GET_DIRINO_ARCH(&n->inumber, &ino, ARCH_CONVERT);
-		kdb_printf("leaf %d hashval 0x%x nameidx %d inumber %llu ",
-			j, (uint_t)INT_GET(e->hashval, ARCH_CONVERT),
-			INT_GET(e->nameidx, ARCH_CONVERT),
-			(unsigned long long)ino);
-		kdb_printf("namelen %d name \"", e->namelen);
-		for (k = 0; k < e->namelen; k++)
-			kdb_printf("%c", n->name[k]);
-		kdb_printf("\"\n");
-	}
-}
-
-/*
- * Print a directory v2 data block, single or multiple.
- */
-static void
-xfs_dir2data(void *addr, int size)
-{
-	xfs_dir2_data_t *db;
-	xfs_dir2_block_t *bb;
-	xfs_dir2_data_hdr_t *h;
-	xfs_dir2_data_free_t *m;
-	xfs_dir2_data_entry_t *e;
-	xfs_dir2_data_unused_t *u;
-	xfs_dir2_leaf_entry_t *l=NULL;
-	int j, k;
-	char *p;
-	char *t;
-	xfs_dir2_block_tail_t *tail=NULL;
-
-	db = (xfs_dir2_data_t *)addr;
-	bb = (xfs_dir2_block_t *)addr;
-	h = &db->hdr;
-	kdb_printf("hdr magic 0x%x (%s)\nhdr bestfree", INT_GET(h->magic, ARCH_CONVERT),
-		INT_GET(h->magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC ? "DATA" :
-			(INT_GET(h->magic, ARCH_CONVERT) == XFS_DIR2_BLOCK_MAGIC ? "BLOCK" : ""));
-	for (j = 0, m = h->bestfree; j < XFS_DIR2_DATA_FD_COUNT; j++, m++) {
-		kdb_printf(" %d: 0x%x@0x%x", j, INT_GET(m->length, ARCH_CONVERT), INT_GET(m->offset, ARCH_CONVERT));
-	}
-	kdb_printf("\n");
-	if (INT_GET(h->magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC)
-		t = (char *)db + size;
-	else {
-		/* XFS_DIR2_BLOCK_TAIL_P */
-		tail = (xfs_dir2_block_tail_t *)
-		       ((char *)bb + size - sizeof(xfs_dir2_block_tail_t));
-		l = XFS_DIR2_BLOCK_LEAF_P_ARCH(tail, ARCH_CONVERT);
-		t = (char *)l;
-	}
-	for (p = (char *)(h + 1); p < t; ) {
-		u = (xfs_dir2_data_unused_t *)p;
-		if (u->freetag == XFS_DIR2_DATA_FREE_TAG) {
-			kdb_printf("0x%lx unused freetag 0x%x length 0x%x tag 0x%x\n",
-				(unsigned long) (p - (char *)addr),
-				INT_GET(u->freetag, ARCH_CONVERT),
-				INT_GET(u->length, ARCH_CONVERT),
-				INT_GET(*XFS_DIR2_DATA_UNUSED_TAG_P_ARCH(u, ARCH_CONVERT), ARCH_CONVERT));
-			p += INT_GET(u->length, ARCH_CONVERT);
-			continue;
-		}
-		e = (xfs_dir2_data_entry_t *)p;
-		kdb_printf("0x%lx entry inumber %llu namelen %d name \"",
-			(unsigned long) (p - (char *)addr),
-			(unsigned long long) INT_GET(e->inumber, ARCH_CONVERT),
-			e->namelen);
-		for (k = 0; k < e->namelen; k++)
-			kdb_printf("%c", e->name[k]);
-		kdb_printf("\" tag 0x%x\n", INT_GET(*XFS_DIR2_DATA_ENTRY_TAG_P(e), ARCH_CONVERT));
-		p += XFS_DIR2_DATA_ENTSIZE(e->namelen);
-	}
-	if (INT_GET(h->magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC)
-		return;
-	for (j = 0; j < INT_GET(tail->count, ARCH_CONVERT); j++, l++) {
-		kdb_printf("0x%lx leaf %d hashval 0x%x address 0x%x (byte 0x%x)\n",
-			(unsigned long) ((char *)l - (char *)addr), j,
-			(uint_t)INT_GET(l->hashval, ARCH_CONVERT),
-			INT_GET(l->address, ARCH_CONVERT),
-			/* XFS_DIR2_DATAPTR_TO_BYTE */
-			INT_GET(l->address, ARCH_CONVERT) << XFS_DIR2_DATA_ALIGN_LOG);
-	}
-	kdb_printf("0x%lx tail count %d\n",
-		(unsigned long) ((char *)tail - (char *)addr),
-		INT_GET(tail->count, ARCH_CONVERT));
-}
-
-static void
-xfs_dir2leaf(xfs_dir2_leaf_t *leaf, int size)
-{
-	xfs_dir2_leaf_hdr_t *h;
-	xfs_da_blkinfo_t *i;
-	xfs_dir2_leaf_entry_t *e;
-	xfs_dir2_data_off_t *b;
-	xfs_dir2_leaf_tail_t *t;
-	int j;
-
-	h = &leaf->hdr;
-	i = &h->info;
-	e = leaf->ents;
-	kdb_printf("hdr info forw 0x%x back 0x%x magic 0x%x\n",
-		INT_GET(i->forw, ARCH_CONVERT), INT_GET(i->back, ARCH_CONVERT), INT_GET(i->magic, ARCH_CONVERT));
-	kdb_printf("hdr count %d stale %d\n", INT_GET(h->count, ARCH_CONVERT), INT_GET(h->stale, ARCH_CONVERT));
-	for (j = 0; j < INT_GET(h->count, ARCH_CONVERT); j++, e++) {
-		kdb_printf("0x%lx ent %d hashval 0x%x address 0x%x (byte 0x%x)\n",
-			(unsigned long) ((char *)e - (char *)leaf), j,
-			(uint_t)INT_GET(e->hashval, ARCH_CONVERT),
-			INT_GET(e->address, ARCH_CONVERT),
-			/* XFS_DIR2_DATAPTR_TO_BYTE */
-			INT_GET(e->address, ARCH_CONVERT) << XFS_DIR2_DATA_ALIGN_LOG);
-	}
-	if (INT_GET(i->magic, ARCH_CONVERT) == XFS_DIR2_LEAFN_MAGIC)
-		return;
-	/* XFS_DIR2_LEAF_TAIL_P */
-	t = (xfs_dir2_leaf_tail_t *)((char *)leaf + size - sizeof(*t));
-	b = XFS_DIR2_LEAF_BESTS_P_ARCH(t, ARCH_CONVERT);
-	for (j = 0; j < INT_GET(t->bestcount, ARCH_CONVERT); j++, b++) {
-		kdb_printf("0x%lx best %d 0x%x\n",
-			(unsigned long) ((char *)b - (char *)leaf), j,
-			INT_GET(*b, ARCH_CONVERT));
-	}
-	kdb_printf("tail bestcount %d\n", INT_GET(t->bestcount, ARCH_CONVERT));
-}
-
-/*
- * Print a shortform directory.
- */
-static void
-xfsidbg_xdirsf(xfs_dir_shortform_t *s)
-{
-	xfs_dir_sf_hdr_t *sfh;
-	xfs_dir_sf_entry_t *sfe;
-	xfs_ino_t ino;
-	int i, j;
-
-	sfh = &s->hdr;
-	XFS_DIR_SF_GET_DIRINO_ARCH(&sfh->parent, &ino, ARCH_CONVERT);
-	kdb_printf("hdr parent %llu", (unsigned long long)ino);
-	kdb_printf(" count %d\n", sfh->count);
-	for (i = 0, sfe = s->list; i < sfh->count; i++) {
-		XFS_DIR_SF_GET_DIRINO_ARCH(&sfe->inumber, &ino, ARCH_CONVERT);
-		kdb_printf("entry %d inumber %llu", i, (unsigned long long)ino);
-		kdb_printf(" namelen %d name \"", sfe->namelen);
-		for (j = 0; j < sfe->namelen; j++)
-			kdb_printf("%c", sfe->name[j]);
-		kdb_printf("\"\n");
-		sfe = XFS_DIR_SF_NEXTENTRY(sfe);
-	}
-}
-
-/*
- * Print a shortform v2 directory.
- */
-static void
-xfsidbg_xdir2sf(xfs_dir2_sf_t *s)
-{
-	xfs_dir2_sf_hdr_t *sfh;
-	xfs_dir2_sf_entry_t *sfe;
-	xfs_ino_t ino;
-	int i, j;
-
-	sfh = &s->hdr;
-	ino = XFS_DIR2_SF_GET_INUMBER_ARCH(s, &sfh->parent, ARCH_CONVERT);
-	kdb_printf("hdr count %d i8count %d parent %llu\n",
-		sfh->count, sfh->i8count, (unsigned long long) ino);
-	for (i = 0, sfe = XFS_DIR2_SF_FIRSTENTRY(s); i < sfh->count; i++) {
-		ino = XFS_DIR2_SF_GET_INUMBER_ARCH(s, XFS_DIR2_SF_INUMBERP(sfe), ARCH_CONVERT);
-		kdb_printf("entry %d inumber %llu offset 0x%x namelen %d name \"",
-			i, (unsigned long long) ino,
-			XFS_DIR2_SF_GET_OFFSET_ARCH(sfe, ARCH_CONVERT),
-			sfe->namelen);
-		for (j = 0; j < sfe->namelen; j++)
-			kdb_printf("%c", sfe->name[j]);
-		kdb_printf("\"\n");
-		sfe = XFS_DIR2_SF_NEXTENTRY(s, sfe);
-	}
-}
-
-/*
- * Print a node-form v2 directory freemap block.
- */
-static void
-xfsidbg_xdir2free(xfs_dir2_free_t *f)
-{
-	int	i;
-
-	kdb_printf("hdr magic 0x%x firstdb %d nvalid %d nused %d\n",
-		INT_GET(f->hdr.magic, ARCH_CONVERT), INT_GET(f->hdr.firstdb, ARCH_CONVERT), INT_GET(f->hdr.nvalid, ARCH_CONVERT), INT_GET(f->hdr.nused, ARCH_CONVERT));
-	for (i = 0; i < INT_GET(f->hdr.nvalid, ARCH_CONVERT); i++) {
-		kdb_printf("entry %d db %d count %d\n",
-			i, i + INT_GET(f->hdr.firstdb, ARCH_CONVERT), INT_GET(f->bests[i], ARCH_CONVERT));
-	}
-}
-
-
-/*
- * Print xfs extent list.
- */
-static void
-xfsidbg_xexlist(xfs_inode_t *ip)
-{
-	xfs_xexlist_fork(ip, XFS_DATA_FORK);
-	if (XFS_IFORK_Q(ip))
-		xfs_xexlist_fork(ip, XFS_ATTR_FORK);
-}
-
-/*
- * Print an xfs free-extent list.
- */
-static void
-xfsidbg_xflist(xfs_bmap_free_t *flist)
-{
-	xfs_bmap_free_item_t	*item;
-
-	kdb_printf("flist@0x%p: first 0x%p count %d low %d\n", flist,
-		flist->xbf_first, flist->xbf_count, flist->xbf_low);
-	for (item = flist->xbf_first; item; item = item->xbfi_next) {
-		kdb_printf("item@0x%p: startblock %Lx blockcount %d", item,
-			(xfs_dfsbno_t)item->xbfi_startblock,
-			item->xbfi_blockcount);
-	}
-}
-
-/*
- * Print out the help messages for these functions.
- */
-static void
-xfsidbg_xhelp(void)
-{
-	struct xif	*p;
-
-	for (p = xfsidbg_funcs; p->name; p++)
-		kdb_printf("%-16s %s %s\n", p->name, p->args, p->help);
-}
-
-/*
- * Print out an XFS in-core log structure.
- */
-static void
-xfsidbg_xiclog(xlog_in_core_t *iclog)
-{
-	int i;
-	static char *ic_flags[] = {
-		"ACTIVE",	/* 0x0001 */
-		"WANT_SYNC",	/* 0x0002 */
-		"SYNCING",	/* 0X0004 */
-		"DONE_SYNC",	/* 0X0008 */
-		"DO_CALLBACK",	/* 0X0010 */
-		"CALLBACK",	/* 0X0020 */
-		"DIRTY",	/* 0X0040 */
-		"IOERROR",	/* 0X0080 */
-		"NOTUSED",	/* 0X8000 */
-		0
-	};
-
-	kdb_printf("xlog_in_core/header at 0x%p/0x%p\n",
-		iclog, iclog->hic_data);
-	kdb_printf("magicno: %x  cycle: %d  version: %d  lsn: 0x%Lx\n",
-		INT_GET(iclog->ic_header.h_magicno, ARCH_CONVERT), INT_GET(iclog->ic_header.h_cycle, ARCH_CONVERT),
-		INT_GET(iclog->ic_header.h_version, ARCH_CONVERT), INT_GET(iclog->ic_header.h_lsn, ARCH_CONVERT));
-	kdb_printf("tail_lsn: 0x%Lx  len: %d  prev_block: %d  num_ops: %d\n",
-		INT_GET(iclog->ic_header.h_tail_lsn, ARCH_CONVERT), INT_GET(iclog->ic_header.h_len, ARCH_CONVERT),
-		INT_GET(iclog->ic_header.h_prev_block, ARCH_CONVERT), INT_GET(iclog->ic_header.h_num_logops, ARCH_CONVERT));
-	kdb_printf("cycle_data: ");
-	for (i=0; i<(iclog->ic_size>>BBSHIFT); i++) {
-		kdb_printf("%x  ", INT_GET(iclog->ic_header.h_cycle_data[i], ARCH_CONVERT));
-	}
-	kdb_printf("\n");
-	kdb_printf("size: %d\n", INT_GET(iclog->ic_header.h_size, ARCH_CONVERT));
-	kdb_printf("\n");
-	kdb_printf("--------------------------------------------------\n");
-	kdb_printf("data: 0x%p  &forcesema: 0x%p  next: 0x%p bp: 0x%p\n",
-		iclog->ic_datap, &iclog->ic_forcesema, iclog->ic_next,
-		iclog->ic_bp);
-	kdb_printf("log: 0x%p  callb: 0x%p  callb_tail: 0x%p  roundoff: %d\n",
-		iclog->ic_log, iclog->ic_callback, iclog->ic_callback_tail,
-		iclog->ic_roundoff);
-	kdb_printf("size: %d (OFFSET: %d) refcnt: %d  bwritecnt: %d",
-		iclog->ic_size, iclog->ic_offset,
-		iclog->ic_refcnt, iclog->ic_bwritecnt);
-	if (iclog->ic_state & XLOG_STATE_ALL)
-		printflags(iclog->ic_state, ic_flags, "state:");
-	else
-		kdb_printf("state: INVALID 0x%x", iclog->ic_state);
-	kdb_printf("\n");
-}	/* xfsidbg_xiclog */
-
-
-/*
- * Print all incore logs.
- */
-static void
-xfsidbg_xiclogall(xlog_in_core_t *iclog)
-{
-    xlog_in_core_t *first_iclog = iclog;
-
-    do {
-	xfsidbg_xiclog(iclog);
-	kdb_printf("=================================================\n");
-	iclog = iclog->ic_next;
-    } while (iclog != first_iclog);
-}	/* xfsidbg_xiclogall */
-
-/*
- * Print out the callback structures attached to an iclog.
- */
-static void
-xfsidbg_xiclogcb(xlog_in_core_t *iclog)
-{
-	xfs_log_callback_t	*cb;
-	kdb_symtab_t		 symtab;
-
-	for (cb = iclog->ic_callback; cb != NULL; cb = cb->cb_next) {
-
-		if (kdbnearsym((unsigned long)cb->cb_func, &symtab)) {
-			unsigned long offval;
-
-			offval = (unsigned long)cb->cb_func - symtab.sym_start;
-
-			if (offval)
-				kdb_printf("func = %s+0x%lx",
-							symtab.sym_name,
-							offval);
-			else
-				kdb_printf("func = %s", symtab.sym_name);
-		} else
-			kdb_printf("func = ?? 0x%p", (void *)cb->cb_func);
-
-		kdb_printf(" arg 0x%p next 0x%p\n", cb->cb_arg, cb->cb_next);
-	}
-}
-
-
-/*
- * Print all of the inodes attached to the given mount structure.
- */
-static void
-xfsidbg_xinodes(xfs_mount_t *mp)
-{
-	xfs_inode_t	*ip;
-
-	kdb_printf("xfs_mount at 0x%p\n", mp);
-	ip = mp->m_inodes;
-	if (ip != NULL) {
-		do {
-			if (ip->i_mount == NULL) {
-				ip = ip->i_mnext;
-				continue;
-			}
-			kdb_printf("\n");
-			xfsidbg_xnode(ip);
-			ip = ip->i_mnext;
-		} while (ip != mp->m_inodes);
-	}
-	kdb_printf("\nEnd of Inodes\n");
-}
-
-static void
-xfsidbg_delayed_blocks(xfs_mount_t *mp)
-{
-	xfs_inode_t	*ip;
-	unsigned int	total = 0;
-	unsigned int	icount = 0;
-
-	ip = mp->m_inodes;
-	if (ip != NULL) {
-		do {
-			if (ip->i_mount == NULL) {
-				ip = ip->i_mnext;
-				continue;
-			}
-			if (ip->i_delayed_blks) {
-				total += ip->i_delayed_blks;
-				icount++;
-			}
-			ip = ip->i_mnext;
-		} while (ip != mp->m_inodes);
-	}
-	kdb_printf("delayed blocks total: %d in %d inodes\n", total, icount);
-}
-
-static void
-xfsidbg_xinodes_quiesce(xfs_mount_t *mp)
-{
-	xfs_inode_t	*ip;
-
-	kdb_printf("xfs_mount at 0x%p\n", mp);
-	ip = mp->m_inodes;
-	if (ip != NULL) {
-		do {
-			if (ip->i_mount == NULL) {
-				ip = ip->i_mnext;
-				continue;
-			}
-			if (!(ip->i_flags & XFS_IQUIESCE)) {
-				kdb_printf("ip 0x%p not quiesced\n", ip);
-			}
-			ip = ip->i_mnext;
-		} while (ip != mp->m_inodes);
-	}
-	kdb_printf("\nEnd of Inodes\n");
-}
-
-static char *
-xfsidbg_get_cstate(int state)
-{
-	switch(state) {
-	case  XLOG_STATE_COVER_IDLE:
-		return("idle");
-	case  XLOG_STATE_COVER_NEED:
-		return("need");
-	case  XLOG_STATE_COVER_DONE:
-		return("done");
-	case  XLOG_STATE_COVER_NEED2:
-		return("need2");
-	case  XLOG_STATE_COVER_DONE2:
-		return("done2");
-	default:
-		return("unknown");
-	}
-}
-
-/*
- * Print out an XFS log structure.
- */
-static void
-xfsidbg_xlog(xlog_t *log)
-{
-	int rbytes;
-	int wbytes;
-	static char *t_flags[] = {
-		"CHKSUM_MISMATCH",	/* 0x01 */
-		"ACTIVE_RECOVERY",	/* 0x02 */
-		"RECOVERY_NEEDED",	/* 0x04 */
-		"IO_ERROR",		/* 0x08 */
-		0
-	};
-
-	kdb_printf("xlog at 0x%p\n", log);
-	kdb_printf("&flushsm: 0x%p  flushcnt: %d tic_cnt: %d	 tic_tcnt: %d  \n",
-		&log->l_flushsema, log->l_flushcnt,
-		log->l_ticket_cnt, log->l_ticket_tcnt);
-	kdb_printf("freelist: 0x%p  tail: 0x%p	ICLOG: 0x%p  \n",
-		log->l_freelist, log->l_tail, log->l_iclog);
-	kdb_printf("&icloglock: 0x%p  tail_lsn: %s  last_sync_lsn: %s \n",
-		&log->l_icloglock, xfs_fmtlsn(&log->l_tail_lsn),
-		xfs_fmtlsn(&log->l_last_sync_lsn));
-	kdb_printf("mp: 0x%p  xbuf: 0x%p  roundoff: %d  l_covered_state: %s \n",
-		log->l_mp, log->l_xbuf, log->l_roundoff,
-			xfsidbg_get_cstate(log->l_covered_state));
-	kdb_printf("flags: ");
-	printflags(log->l_flags, t_flags,"log");
-	kdb_printf("  dev: %s logBBstart: %lld logsize: %d logBBsize: %d\n",
-		XFS_BUFTARG_NAME(log->l_targ), (long long) log->l_logBBstart,
-		log->l_logsize,log->l_logBBsize);
-	kdb_printf("curr_cycle: %d  prev_cycle: %d  curr_block: %d  prev_block: %d\n",
-	     log->l_curr_cycle, log->l_prev_cycle, log->l_curr_block,
-	     log->l_prev_block);
-	kdb_printf("iclog_bak: 0x%p  iclog_size: 0x%x (%d)  num iclogs: %d\n",
-		log->l_iclog_bak, log->l_iclog_size, log->l_iclog_size,
-		log->l_iclog_bufs);
-	kdb_printf("l_stripemask %d l_iclog_hsize %d l_iclog_heads %d\n",
-		log->l_stripemask, log->l_iclog_hsize, log->l_iclog_heads);
-	kdb_printf("l_sectbb_log %u l_sectbb_mask %u\n",
-		log->l_sectbb_log, log->l_sectbb_mask);
-	kdb_printf("&grant_lock: 0x%p  resHeadQ: 0x%p  wrHeadQ: 0x%p\n",
-		&log->l_grant_lock, log->l_reserve_headq, log->l_write_headq);
-	kdb_printf("GResCycle: %d  GResBytes: %d  GWrCycle: %d  GWrBytes: %d\n",
-		log->l_grant_reserve_cycle, log->l_grant_reserve_bytes,
-		log->l_grant_write_cycle, log->l_grant_write_bytes);
-	rbytes = log->l_grant_reserve_bytes + log->l_roundoff;
-	wbytes = log->l_grant_write_bytes + log->l_roundoff;
-       kdb_printf("GResBlocks: %d  GResRemain: %d  GWrBlocks: %d  GWrRemain: %d\n",
-	       rbytes / BBSIZE, rbytes % BBSIZE,
-	       wbytes / BBSIZE, wbytes % BBSIZE);
-}	/* xfsidbg_xlog */
-
-
-/*
- * Print out an XFS recovery transaction
- */
-static void
-xfsidbg_xlog_ritem(xlog_recover_item_t *item)
-{
-	int i = XLOG_MAX_REGIONS_IN_ITEM;
-
-	kdb_printf("(xlog_recover_item 0x%p) ", item);
-	kdb_printf("next: 0x%p prev: 0x%p type: %d cnt: %d ttl: %d\n",
-		item->ri_next, item->ri_prev, ITEM_TYPE(item), item->ri_cnt,
-		item->ri_total);
-	for ( ; i > 0; i--) {
-		if (!item->ri_buf[XLOG_MAX_REGIONS_IN_ITEM-i].i_addr)
-			break;
-		kdb_printf("a: 0x%p l: %d ",
-			item->ri_buf[XLOG_MAX_REGIONS_IN_ITEM-i].i_addr,
-			item->ri_buf[XLOG_MAX_REGIONS_IN_ITEM-i].i_len);
-	}
-	kdb_printf("\n");
-}	/* xfsidbg_xlog_ritem */
-
-/*
- * Print out an XFS recovery transaction
- */
-static void
-xfsidbg_xlog_rtrans(xlog_recover_t *trans)
-{
-	xlog_recover_item_t *rip, *first_rip;
-
-	kdb_printf("(xlog_recover 0x%p) ", trans);
-	kdb_printf("tid: %x type: %d items: %d ttid: 0x%x  ",
-		trans->r_log_tid, trans->r_theader.th_type,
-		trans->r_theader.th_num_items, trans->r_theader.th_tid);
-	kdb_printf("itemq: 0x%p\n", trans->r_itemq);
-	if (trans->r_itemq) {
-		rip = first_rip = trans->r_itemq;
-		do {
-			kdb_printf("(recovery item: 0x%p) ", rip);
-			kdb_printf("type: %d cnt: %d total: %d\n",
-				ITEM_TYPE(rip), rip->ri_cnt, rip->ri_total);
-			rip = rip->ri_next;
-		} while (rip != first_rip);
-	}
-}	/* xfsidbg_xlog_rtrans */
-
-static void
-xfsidbg_xlog_buf_logitem(xlog_recover_item_t *item)
-{
-	xfs_buf_log_format_t	*buf_f;
-	int			i, j;
-	int			bit;
-	int			nbits;
-	unsigned int		*data_map;
-	unsigned int		map_size;
-	int			size;
-
-	buf_f = (xfs_buf_log_format_t *)item->ri_buf[0].i_addr;
-	if (buf_f->blf_flags & XFS_BLI_INODE_BUF) {
-		kdb_printf("\tINODE BUF <blkno=0x%Lx, len=0x%x>\n",
-			buf_f->blf_blkno, buf_f->blf_len);
-	} else if (buf_f->blf_flags & (XFS_BLI_UDQUOT_BUF | XFS_BLI_GDQUOT_BUF)) {
-		kdb_printf("\tDQUOT BUF <blkno=0x%Lx, len=0x%x>\n",
-			buf_f->blf_blkno, buf_f->blf_len);
-	} else {
-		data_map = buf_f->blf_data_map;
-		map_size = buf_f->blf_map_size;
-		kdb_printf("\tREG BUF <blkno=0x%Lx, len=0x%x map 0x%p size %d>\n",
-			buf_f->blf_blkno, buf_f->blf_len, data_map, map_size);
-		bit = 0;
-		i = 0;  /* 0 is the buf format structure */
-		while (1) {
-			bit = xfs_next_bit(data_map, map_size, bit);
-			if (bit == -1)
-				break;
-			nbits = xfs_contig_bits(data_map, map_size, bit);
-			size = ((uint)bit << XFS_BLI_SHIFT)+(nbits<<XFS_BLI_SHIFT);
-			kdb_printf("\t\tlogbuf.i_addr 0x%p, size 0x%x\n",
-				item->ri_buf[i].i_addr, size);
-			kdb_printf("\t\t\t\"");
-			for (j=0; j<8 && j<size; j++) {
-				kdb_printf("%02x", ((char *)item->ri_buf[i].i_addr)[j]);
-			}
-			kdb_printf("...\"\n");
-			i++;
-			bit += nbits;
-		}
-
-	}
-}
-
-/*
- * Print out an ENTIRE XFS recovery transaction
- */
-static void
-xfsidbg_xlog_rtrans_entire(xlog_recover_t *trans)
-{
-	xlog_recover_item_t *item, *first_rip;
-
-	kdb_printf("(Recovering Xact 0x%p) ", trans);
-	kdb_printf("tid: %x type: %d nitems: %d ttid: 0x%x  ",
-		trans->r_log_tid, trans->r_theader.th_type,
-		trans->r_theader.th_num_items, trans->r_theader.th_tid);
-	kdb_printf("itemq: 0x%p\n", trans->r_itemq);
-	if (trans->r_itemq) {
-		item = first_rip = trans->r_itemq;
-		do {
-			/*
-			   kdb_printf("(recovery item: 0x%x) ", item);
-			   kdb_printf("type: %d cnt: %d total: %d\n",
-				   item->ri_type, item->ri_cnt, item->ri_total);
-				   */
-			if ((ITEM_TYPE(item) == XFS_LI_BUF) ||
-			    (ITEM_TYPE(item) == XFS_LI_6_1_BUF) ||
-			    (ITEM_TYPE(item) == XFS_LI_5_3_BUF)) {
-				kdb_printf("BUF:");
-				xfsidbg_xlog_buf_logitem(item);
-			} else if ((ITEM_TYPE(item) == XFS_LI_INODE) ||
-				   (ITEM_TYPE(item) == XFS_LI_6_1_INODE) ||
-				   (ITEM_TYPE(item) == XFS_LI_5_3_INODE)) {
-				kdb_printf("INODE:\n");
-			} else if (ITEM_TYPE(item) == XFS_LI_EFI) {
-				kdb_printf("EFI:\n");
-			} else if (ITEM_TYPE(item) == XFS_LI_EFD) {
-				kdb_printf("EFD:\n");
-			} else if (ITEM_TYPE(item) == XFS_LI_DQUOT) {
-				kdb_printf("DQUOT:\n");
-			} else if ((ITEM_TYPE(item) == XFS_LI_QUOTAOFF)) {
-				kdb_printf("QUOTAOFF:\n");
-			} else {
-				kdb_printf("UNKNOWN LOGITEM 0x%x\n", ITEM_TYPE(item));
-			}
-			item = item->ri_next;
-		} while (item != first_rip);
-	}
-}	/* xfsidbg_xlog_rtrans */
-
-/*
- * Print out an XFS ticket structure.
- */
-static void
-xfsidbg_xlog_tic(xlog_ticket_t *tic)
-{
-	static char *t_flags[] = {
-		"INIT",		/* 0x1 */
-		"PERM_RES",	/* 0x2 */
-		"IN_Q",		/* 0x4 */
-		0
-	};
-
-	kdb_printf("xlog_ticket at 0x%p\n", tic);
-	kdb_printf("next: 0x%p  prev: 0x%p  tid: 0x%x  \n",
-		tic->t_next, tic->t_prev, tic->t_tid);
-	kdb_printf("curr_res: %d  unit_res: %d  ocnt: %d  cnt: %d\n",
-		tic->t_curr_res, tic->t_unit_res, (int)tic->t_ocnt,
-		(int)tic->t_cnt);
-	kdb_printf("clientid: %c  \n", tic->t_clientid);
-	printflags(tic->t_flags, t_flags,"ticket");
-	kdb_printf("\n");
-}	/* xfsidbg_xlog_tic */
-
-/*
- * Print out a single log item.
- */
-static void
-xfsidbg_xlogitem(xfs_log_item_t *lip)
-{
-	xfs_log_item_t	*bio_lip;
-	static char *lid_type[] = {
-		"???",		/* 0 */
-		"5-3-buf",	/* 1 */
-		"5-3-inode",	/* 2 */
-		"efi",		/* 3 */
-		"efd",		/* 4 */
-		"iunlink",	/* 5 */
-		"6-1-inode",	/* 6 */
-		"6-1-buf",	/* 7 */
-		"inode",	/* 8 */
-		"buf",		/* 9 */
-		"dquot",	/* 10 */
-		0
-		};
-	static char *li_flags[] = {
-		"in ail",	/* 0x1 */
-		0
-		};
-
-	kdb_printf("type %s mountp 0x%p flags ",
-		lid_type[lip->li_type - XFS_LI_5_3_BUF + 1],
-		lip->li_mountp);
-	printflags((uint)(lip->li_flags), li_flags,"log");
-	kdb_printf("\n");
-	kdb_printf("ail forw 0x%p ail back 0x%p lsn %s desc %p ops 0x%p\n",
-		lip->li_ail.ail_forw, lip->li_ail.ail_back,
-		xfs_fmtlsn(&(lip->li_lsn)), lip->li_desc, lip->li_ops);
-	kdb_printf("iodonefunc &0x%p\n", lip->li_cb);
-	if (lip->li_type == XFS_LI_BUF) {
-		bio_lip = lip->li_bio_list;
-		if (bio_lip != NULL) {
-			kdb_printf("iodone list:\n");
-		}
-		while (bio_lip != NULL) {
-			kdb_printf("item 0x%p func 0x%p\n",
-				bio_lip, bio_lip->li_cb);
-			bio_lip = bio_lip->li_bio_list;
-		}
-	}
-	switch (lip->li_type) {
-	case XFS_LI_BUF:
-		xfs_buf_item_print((xfs_buf_log_item_t *)lip, 0);
-		break;
-	case XFS_LI_INODE:
-		xfs_inode_item_print((xfs_inode_log_item_t *)lip, 0);
-		break;
-	case XFS_LI_EFI:
-		xfs_efi_item_print((xfs_efi_log_item_t *)lip, 0);
-		break;
-	case XFS_LI_EFD:
-		xfs_efd_item_print((xfs_efd_log_item_t *)lip, 0);
-		break;
-	case XFS_LI_DQUOT:
-		xfs_dquot_item_print((xfs_dq_logitem_t *)lip, 0);
-		break;
-	case XFS_LI_QUOTAOFF:
-		xfs_qoff_item_print((xfs_qoff_logitem_t *)lip, 0);
-		break;
-
-	default:
-		kdb_printf("Unknown item type %d\n", lip->li_type);
-		break;
-	}
-}
-
-/*
- * Print out a summary of the AIL hanging off of a mount struct.
- */
-static void
-xfsidbg_xaildump(xfs_mount_t *mp)
-{
-	xfs_log_item_t *lip;
-	static char *lid_type[] = {
-		"???",		/* 0 */
-		"5-3-buf",	/* 1 */
-		"5-3-inode",	/* 2 */
-		"efi",		/* 3 */
-		"efd",		/* 4 */
-		"iunlink",	/* 5 */
-		"6-1-inode",	/* 6 */
-		"6-1-buf",	/* 7 */
-		"inode",	/* 8 */
-		"buf",		/* 9 */
-		"dquot",        /* 10 */
-		0
-		};
-	static char *li_flags[] = {
-		"in ail",	/* 0x1 */
-		0
-		};
-	int count;
-
-	if ((mp->m_ail.ail_forw == NULL) ||
-	    (mp->m_ail.ail_forw == (xfs_log_item_t *)&mp->m_ail)) {
-		kdb_printf("AIL is empty\n");
-		return;
-	}
-	kdb_printf("AIL for mp 0x%p, oldest first\n", mp);
-	lip = (xfs_log_item_t*)mp->m_ail.ail_forw;
-	for (count = 0; lip; count++) {
-		kdb_printf("[%d] type %s ", count,
-			      lid_type[lip->li_type - XFS_LI_5_3_BUF + 1]);
-		printflags((uint)(lip->li_flags), li_flags, "flags:");
-		kdb_printf("  lsn %s\n   ", xfs_fmtlsn(&(lip->li_lsn)));
-		switch (lip->li_type) {
-		case XFS_LI_BUF:
-			xfs_buf_item_print((xfs_buf_log_item_t *)lip, 1);
-			break;
-		case XFS_LI_INODE:
-			xfs_inode_item_print((xfs_inode_log_item_t *)lip, 1);
-			break;
-		case XFS_LI_EFI:
-			xfs_efi_item_print((xfs_efi_log_item_t *)lip, 1);
-			break;
-		case XFS_LI_EFD:
-			xfs_efd_item_print((xfs_efd_log_item_t *)lip, 1);
-			break;
-		case XFS_LI_DQUOT:
-			xfs_dquot_item_print((xfs_dq_logitem_t *)lip, 1);
-			break;
-		case XFS_LI_QUOTAOFF:
-			xfs_qoff_item_print((xfs_qoff_logitem_t *)lip, 1);
-			break;
-		default:
-			kdb_printf("Unknown item type %d\n", lip->li_type);
-			break;
-		}
-
-		if (lip->li_ail.ail_forw == (xfs_log_item_t*)&mp->m_ail) {
-			lip = NULL;
-		} else {
-			lip = lip->li_ail.ail_forw;
-		}
-	}
-}
-
-/*
- * Print xfs mount structure.
- */
-static void
-xfsidbg_xmount(xfs_mount_t *mp)
-{
-	static char *xmount_flags[] = {
-		"WSYNC",	/* 0x0001 */
-		"INO64",	/* 0x0002 */
-		"RQCHK",        /* 0x0004 */
-		"FSCLEAN",	/* 0x0008 */
-		"FSSHUTDN",	/* 0x0010 */
-		"NOATIME",	/* 0x0020 */
-		"RETERR",	/* 0x0040 */
-		"NOALIGN",	/* 0x0080 */
-		"UNSHRD",	/* 0x0100 */
-		"RGSTRD",	/* 0x0200 */
-		"NORECVR",	/* 0x0400 */
-		"SHRD",		/* 0x0800 */
-		"IOSZ",		/* 0x1000 */
-		"OSYNC",	/* 0x2000 */
-		"NOUUID",	/* 0x4000 */
-		"32BIT",	/* 0x8000 */
-		"NOLOGFLUSH",	/* 0x10000 */
-		0
-	};
-
-	static char *quota_flags[] = {
-		"UQ",		/* 0x0001 */
-		"UQE",		/* 0x0002 */
-		"UQCHKD",	/* 0x0004 */
-		"PQ",		/* 0x0008 (IRIX ondisk) */
-		"GQE",		/* 0x0010 */
-		"GQCHKD",	/* 0x0020 */
-		"GQ",		/* 0x0040 */
-		"UQACTV",	/* 0x0080 */
-		"GQACTV",	/* 0x0100 */
-		"QMAYBE",	/* 0x0200 */
-		0
-	};
-
-	kdb_printf("xfs_mount at 0x%p\n", mp);
-	kdb_printf("vfsp 0x%p tid 0x%x ail_lock 0x%p &ail 0x%p\n",
-		XFS_MTOVFS(mp), mp->m_tid, &mp->m_ail_lock, &mp->m_ail);
-	kdb_printf("ail_gen 0x%x &sb 0x%p\n",
-		mp->m_ail_gen, &mp->m_sb);
-	kdb_printf("sb_lock 0x%p sb_bp 0x%p dev %s logdev %s rtdev %s\n",
-		&mp->m_sb_lock, mp->m_sb_bp,
-		mp->m_ddev_targp ?
-			XFS_BUFTARG_NAME(mp->m_ddev_targp) : "none",
-		mp->m_logdev_targp ?
-			XFS_BUFTARG_NAME(mp->m_logdev_targp) : "none",
-		mp->m_rtdev_targp ?
-			XFS_BUFTARG_NAME(mp->m_rtdev_targp) : "none");
-	kdb_printf("bsize %d agfrotor %d agirotor %d ihash 0x%p ihsize %d\n",
-		mp->m_bsize, mp->m_agfrotor, mp->m_agirotor,
-		mp->m_ihash, mp->m_ihsize);
-	kdb_printf("inodes 0x%p ilock 0x%p ireclaims 0x%x\n",
-		mp->m_inodes, &mp->m_ilock, mp->m_ireclaims);
-	kdb_printf("readio_log 0x%x readio_blocks 0x%x ",
-		mp->m_readio_log, mp->m_readio_blocks);
-	kdb_printf("writeio_log 0x%x writeio_blocks 0x%x\n",
-		mp->m_writeio_log, mp->m_writeio_blocks);
-	kdb_printf("logbufs %d logbsize %d LOG 0x%p\n", mp->m_logbufs,
-		mp->m_logbsize, mp->m_log);
-	kdb_printf("rsumlevels 0x%x rsumsize 0x%x rbmip 0x%p rsumip 0x%p\n",
-		mp->m_rsumlevels, mp->m_rsumsize, mp->m_rbmip, mp->m_rsumip);
-	kdb_printf("rootip 0x%p\n", mp->m_rootip);
-	kdb_printf("dircook_elog %d blkbit_log %d blkbb_log %d agno_log %d\n",
-		mp->m_dircook_elog, mp->m_blkbit_log, mp->m_blkbb_log,
-		mp->m_agno_log);
-	kdb_printf("agino_log %d nreadaheads %d inode cluster size %d\n",
-		mp->m_agino_log, mp->m_nreadaheads,
-		mp->m_inode_cluster_size);
-	kdb_printf("blockmask 0x%x blockwsize 0x%x blockwmask 0x%x\n",
-		mp->m_blockmask, mp->m_blockwsize, mp->m_blockwmask);
-	kdb_printf("alloc_mxr[lf,nd] %d %d alloc_mnr[lf,nd] %d %d\n",
-		mp->m_alloc_mxr[0], mp->m_alloc_mxr[1],
-		mp->m_alloc_mnr[0], mp->m_alloc_mnr[1]);
-	kdb_printf("bmap_dmxr[lfnr,ndnr] %d %d bmap_dmnr[lfnr,ndnr] %d %d\n",
-		mp->m_bmap_dmxr[0], mp->m_bmap_dmxr[1],
-		mp->m_bmap_dmnr[0], mp->m_bmap_dmnr[1]);
-	kdb_printf("inobt_mxr[lf,nd] %d %d inobt_mnr[lf,nd] %d %d\n",
-		mp->m_inobt_mxr[0], mp->m_inobt_mxr[1],
-		mp->m_inobt_mnr[0], mp->m_inobt_mnr[1]);
-	kdb_printf("ag_maxlevels %d bm_maxlevels[d,a] %d %d in_maxlevels %d\n",
-		mp->m_ag_maxlevels, mp->m_bm_maxlevels[0],
-		mp->m_bm_maxlevels[1], mp->m_in_maxlevels);
-	kdb_printf("perag 0x%p &peraglock 0x%p &growlock 0x%p\n",
-		mp->m_perag, &mp->m_peraglock, &mp->m_growlock);
-	printflags(mp->m_flags, xmount_flags,"flags");
-	kdb_printf("ialloc_inos %d ialloc_blks %d litino %d\n",
-		mp->m_ialloc_inos, mp->m_ialloc_blks, mp->m_litino);
-	kdb_printf("dir_node_ents %u attr_node_ents %u\n",
-		mp->m_dir_node_ents, mp->m_attr_node_ents);
-	kdb_printf("attroffset %d maxicount %Ld inoalign_mask %d\n",
-		mp->m_attroffset, mp->m_maxicount, mp->m_inoalign_mask);
-	kdb_printf("resblks %Ld resblks_avail %Ld\n", mp->m_resblks,
-		mp->m_resblks_avail);
-#if XFS_BIG_INUMS
-	kdb_printf(" inoadd %llx\n", (unsigned long long) mp->m_inoadd);
-#else
-	kdb_printf("\n");
-#endif
-	if (mp->m_quotainfo)
-		kdb_printf("quotainfo 0x%p (uqip = 0x%p, gqip = 0x%p)\n",
-			mp->m_quotainfo,
-			mp->m_quotainfo->qi_uquotaip,
-			mp->m_quotainfo->qi_gquotaip);
-	else
-		kdb_printf("quotainfo NULL\n");
-	printflags(mp->m_qflags, quota_flags,"quotaflags");
-	kdb_printf("\n");
-	kdb_printf("dalign %d swidth %d sinoalign %d attr_magicpct %d dir_magicpct %d\n",
-		mp->m_dalign, mp->m_swidth, mp->m_sinoalign,
-		mp->m_attr_magicpct, mp->m_dir_magicpct);
-	kdb_printf("mk_sharedro %d inode_quiesce %d sectbb_log %d\n",
-		mp->m_mk_sharedro, mp->m_inode_quiesce, mp->m_sectbb_log);
-	kdb_printf("dirversion %d dirblkfsbs %d &dirops 0x%p\n",
-		mp->m_dirversion, mp->m_dirblkfsbs, &mp->m_dirops);
-	kdb_printf("dirblksize %d dirdatablk 0x%Lx dirleafblk 0x%Lx dirfreeblk 0x%Lx\n",
-		mp->m_dirblksize,
-		(xfs_dfiloff_t)mp->m_dirdatablk,
-		(xfs_dfiloff_t)mp->m_dirleafblk,
-		(xfs_dfiloff_t)mp->m_dirfreeblk);
-	kdb_printf("chsize %d chash 0x%p\n",
-		mp->m_chsize, mp->m_chash);
-	kdb_printf("m_frozen %d m_active_trans %d\n",
-		mp->m_frozen, mp->m_active_trans.counter);
-	if (mp->m_fsname != NULL)
-		kdb_printf("mountpoint \"%s\"\n", mp->m_fsname);
-	else
-		kdb_printf("No name!!!\n");
-
-}
-
-static void
-xfsidbg_xihash(xfs_mount_t *mp)
-{
-	xfs_ihash_t	*ih;
-	int		i;
-	int		j;
-	int		total;
-	int		numzeros;
-	xfs_inode_t	*ip;
-	int		*hist;
-	int		hist_bytes = mp->m_ihsize * sizeof(int);
-	int		hist2[21];
-
-	hist = (int *) kmalloc(hist_bytes, GFP_KERNEL);
-
-	if (hist == NULL) {
-		kdb_printf("xfsidbg_xihash: kmalloc(%d) failed!\n",
-							hist_bytes);
-		return;
-	}
-
-	for (i = 0; i < mp->m_ihsize; i++) {
-		ih = mp->m_ihash + i;
-		j = 0;
-		for (ip = ih->ih_next; ip != NULL; ip = ip->i_next)
-			j++;
-		hist[i] = j;
-	}
-
-	numzeros = total = 0;
-
-	for (i = 0; i < 21; i++)
-		hist2[i] = 0;
-
-	for (i = 0; i < mp->m_ihsize; i++)  {
-		kdb_printf("%d ", hist[i]);
-		total += hist[i];
-		numzeros += hist[i] == 0 ? 1 : 0;
-		if (hist[i] > 20)
-			j = 20;
-		else
-			j = hist[i];
-
-		if (! (j <= 20)) {
-			kdb_printf("xfsidbg_xihash: (j > 20)/%d @ line # %d\n",
-							j, __LINE__);
-			return;
-		}
-
-		hist2[j]++;
-	}
-
-	kdb_printf("\n");
-
-	kdb_printf("total inodes = %d, average length = %d, adjusted average = %d \n",
-		total, total / mp->m_ihsize,
-		total / (mp->m_ihsize - numzeros));
-
-	for (i = 0; i < 21; i++)  {
-		kdb_printf("%d - %d , ", i, hist2[i]);
-	}
-	kdb_printf("\n");
-	kfree(hist);
-}
-
-/*
- * Command to print xfs inodes: kp xnode <addr>
- */
-static void
-xfsidbg_xnode(xfs_inode_t *ip)
-{
-	static char *tab_flags[] = {
-		"grio",		/* XFS_IGRIO */
-		"uiosize",	/* XFS_IUIOSZ */
-		"quiesce",	/* XFS_IQUIESCE */
-		"reclaim",	/* XFS_IRECLAIM */
-		"stale",	/* XFS_ISTALE */
-		NULL
-	};
-
-	kdb_printf("hash 0x%p next 0x%p prevp 0x%p mount 0x%p\n",
-		ip->i_hash,
-		ip->i_next,
-		ip->i_prevp,
-		ip->i_mount);
-	kdb_printf("mnext 0x%p mprev 0x%p vnode 0x%p \n",
-		ip->i_mnext,
-		ip->i_mprev,
-		XFS_ITOV_NULL(ip));
-	kdb_printf("dev %s ino %s\n",
-		XFS_BUFTARG_NAME(ip->i_mount->m_ddev_targp),
-		xfs_fmtino(ip->i_ino, ip->i_mount));
-	kdb_printf("blkno 0x%llx len 0x%x boffset 0x%x\n",
-		(long long) ip->i_blkno,
-		ip->i_len,
-		ip->i_boffset);
-	kdb_printf("transp 0x%p &itemp 0x%p\n",
-		ip->i_transp,
-		ip->i_itemp);
-	kdb_printf("&lock 0x%p &iolock 0x%p",
-		&ip->i_lock,
-		&ip->i_iolock);
-	kdb_printf("&flock 0x%p (%d) pincount 0x%x\n",
-		&ip->i_flock, valusema(&ip->i_flock),
-		xfs_ipincount(ip));
-	kdb_printf("udquotp 0x%p gdquotp 0x%p\n",
-		ip->i_udquot, ip->i_gdquot);
-	kdb_printf("new_size %Lx\n", ip->i_iocore.io_new_size);
-	printflags((int)ip->i_flags, tab_flags, "flags");
-	kdb_printf("\n");
-	kdb_printf("update_core 0x%x update size 0x%x\n",
-		(int)(ip->i_update_core), (int) ip->i_update_size);
-	kdb_printf("gen 0x%x delayed blks %d",
-		ip->i_gen,
-		ip->i_delayed_blks);
-	kdb_printf("\n");
-	kdb_printf("chash 0x%p cnext 0x%p cprev 0x%p\n",
-		ip->i_chash,
-		ip->i_cnext,
-		ip->i_cprev);
-	xfs_xnode_fork("data", &ip->i_df);
-	xfs_xnode_fork("attr", ip->i_afp);
-	kdb_printf("\n");
-	xfs_prdinode_core(&ip->i_d, ARCH_NOCONVERT);
-}
-
-static void
-xfsidbg_xcore(xfs_iocore_t *io)
-{
-	kdb_printf("io_obj 0x%p io_flags 0x%x io_mount 0x%p\n",
-			io->io_obj, io->io_flags, io->io_mount);
-	kdb_printf("new_size %Lx\n", io->io_new_size);
-}
-
-/*
- * Command to print xfs inode cluster hash table: kp xchash <addr>
- */
-static void
-xfsidbg_xchash(xfs_mount_t *mp)
-{
-	int		i;
-	xfs_chash_t	*ch;
-
-	kdb_printf("m_chash 0x%p size %d\n",
-		mp->m_chash, mp->m_chsize);
-	for (i = 0; i < mp->m_chsize; i++) {
-		ch = mp->m_chash + i;
-		kdb_printf("[%3d] ch 0x%p chashlist 0x%p\n", i, ch, ch->ch_list);
-		xfsidbg_xchashlist(ch->ch_list);
-	}
-}
-
-/*
- * Command to print xfs inode cluster hash list: kp xchashlist <addr>
- */
-static void
-xfsidbg_xchashlist(xfs_chashlist_t *chl)
-{
-	xfs_inode_t	*ip;
-
-	while (chl != NULL) {
-		kdb_printf("hashlist inode 0x%p blkno %lld buf 0x%p",
-		       chl->chl_ip, (long long) chl->chl_blkno, chl->chl_buf);
-
-		kdb_printf("\n");
-
-		/* print inodes on chashlist */
-		ip = chl->chl_ip;
-		do {
-			kdb_printf("0x%p ", ip);
-			ip = ip->i_cnext;
-		} while (ip != chl->chl_ip);
-		kdb_printf("\n");
-
-		chl=chl->chl_next;
-	}
-}
-
-/*
- * Print xfs per-ag data structures for filesystem.
- */
-static void
-xfsidbg_xperag(xfs_mount_t *mp)
-{
-	xfs_agnumber_t	agno;
-	xfs_perag_t	*pag;
-	int		busy;
-
-	pag = mp->m_perag;
-	for (agno = 0; agno < mp->m_sb.sb_agcount; agno++, pag++) {
-		kdb_printf("ag %d f_init %d i_init %d\n",
-			agno, pag->pagf_init, pag->pagi_init);
-		if (pag->pagf_init)
-			kdb_printf(
-	"    f_levels[b,c] %d,%d f_flcount %d f_freeblks %d f_longest %d\n"
-	"    f__metadata %d\n",
-				pag->pagf_levels[XFS_BTNUM_BNOi],
-				pag->pagf_levels[XFS_BTNUM_CNTi],
-				pag->pagf_flcount, pag->pagf_freeblks,
-				pag->pagf_longest, pag->pagf_metadata);
-		if (pag->pagi_init)
-			kdb_printf("    i_freecount %d i_inodeok %d\n",
-				pag->pagi_freecount, pag->pagi_inodeok);
-		if (pag->pagf_init) {
-			for (busy = 0; busy < XFS_PAGB_NUM_SLOTS; busy++) {
-				if (pag->pagb_list[busy].busy_length != 0) {
-					kdb_printf(
-		"	 %04d: start %d length %d tp 0x%p\n",
-					    busy,
-					    pag->pagb_list[busy].busy_start,
-					    pag->pagb_list[busy].busy_length,
-					    pag->pagb_list[busy].busy_tp);
-				}
-			}
-		}
-	}
-}
-
-#ifdef CONFIG_XFS_QUOTA
-static void
-xfsidbg_xqm()
-{
-	if (xfs_Gqm == NULL) {
-		kdb_printf("NULL XQM!!\n");
-		return;
-	}
-
-	kdb_printf("usrhtab 0x%p\tgrphtab 0x%p\tndqfree 0x%x\thashmask 0x%x\n",
-		xfs_Gqm->qm_usr_dqhtable,
-		xfs_Gqm->qm_grp_dqhtable,
-		xfs_Gqm->qm_dqfreelist.qh_nelems,
-		xfs_Gqm->qm_dqhashmask);
-	kdb_printf("&freelist 0x%p, totaldquots 0x%x nrefs 0x%x\n",
-		&xfs_Gqm->qm_dqfreelist,
-		atomic_read(&xfs_Gqm->qm_totaldquots),
-		xfs_Gqm->qm_nrefs);
-}
-#endif
-
-static void
-xfsidbg_xqm_diskdq(xfs_disk_dquot_t *d)
-{
-	kdb_printf("magic 0x%x\tversion 0x%x\tID 0x%x (%d)\t\n",
-		INT_GET(d->d_magic, ARCH_CONVERT),
-		INT_GET(d->d_version, ARCH_CONVERT),
-		INT_GET(d->d_id, ARCH_CONVERT),
-		INT_GET(d->d_id, ARCH_CONVERT));
-	kdb_printf("bhard 0x%llx\tbsoft 0x%llx\tihard 0x%llx\tisoft 0x%llx\n",
-		(unsigned long long)INT_GET(d->d_blk_hardlimit, ARCH_CONVERT),
-		(unsigned long long)INT_GET(d->d_blk_softlimit, ARCH_CONVERT),
-		(unsigned long long)INT_GET(d->d_ino_hardlimit, ARCH_CONVERT),
-		(unsigned long long)INT_GET(d->d_ino_softlimit, ARCH_CONVERT));
-	kdb_printf("bcount 0x%llx icount 0x%llx\n",
-		(unsigned long long)INT_GET(d->d_bcount, ARCH_CONVERT),
-		(unsigned long long)INT_GET(d->d_icount, ARCH_CONVERT));
-	kdb_printf("btimer 0x%x itimer 0x%x \n",
-		(int)INT_GET(d->d_btimer, ARCH_CONVERT),
-		(int)INT_GET(d->d_itimer, ARCH_CONVERT));
-}
-
-static void
-xfsidbg_xqm_dquot(xfs_dquot_t *dqp)
-{
-	static char *qflags[] = {
-		"USR",
-		"GRP",
-		"LCKD",
-		"FLKD",
-		"DIRTY",
-		"WANT",
-		"INACT",
-		"MARKER",
-		0
-	};
-	kdb_printf("mount 0x%p hash 0x%p gdquotp 0x%p HL_next 0x%p HL_prevp 0x%p\n",
-		dqp->q_mount,
-		dqp->q_hash,
-		dqp->q_gdquot,
-		dqp->HL_NEXT,
-		dqp->HL_PREVP);
-	kdb_printf("MPL_next 0x%p MPL_prevp 0x%p FL_next 0x%p FL_prev 0x%p\n",
-		dqp->MPL_NEXT,
-		dqp->MPL_PREVP,
-		dqp->dq_flnext,
-		dqp->dq_flprev);
-
-	kdb_printf("nrefs 0x%x, res_bcount %d, ",
-		dqp->q_nrefs, (int) dqp->q_res_bcount);
-	printflags(dqp->dq_flags, qflags, "flags:");
-	kdb_printf("\nblkno 0x%llx\tboffset 0x%x\n",
-		(unsigned long long) dqp->q_blkno, (int) dqp->q_bufoffset);
-	kdb_printf("qlock 0x%p  flock 0x%p (%s) pincount 0x%x\n",
-		&dqp->q_qlock,
-		&dqp->q_flock,
-		(valusema(&dqp->q_flock) <= 0) ? "LCK" : "UNLKD",
-		dqp->q_pincount);
-	kdb_printf("disk-dquot 0x%p\n", &dqp->q_core);
-	xfsidbg_xqm_diskdq(&dqp->q_core);
-
-}
-
-
-#define XQMIDBG_LIST_PRINT(l, NXT) \
-{ \
-	  xfs_dquot_t	*dqp;\
-	  int i = 0; \
-	  kdb_printf("[#%d dquots]\n", (int) (l)->qh_nelems); \
-	  for (dqp = (l)->qh_next; dqp != NULL; dqp = dqp->NXT) {\
-	   kdb_printf( \
-	      "\t%d. [0x%p] \"%d (%s)\"\t blks = %d, inos = %d refs = %d\n", \
-			 ++i, dqp, (int) INT_GET(dqp->q_core.d_id, ARCH_CONVERT), \
-			 DQFLAGTO_TYPESTR(dqp),      \
-			 (int) INT_GET(dqp->q_core.d_bcount, ARCH_CONVERT), \
-			 (int) INT_GET(dqp->q_core.d_icount, ARCH_CONVERT), \
-			 (int) dqp->q_nrefs); }\
-	  kdb_printf("\n"); \
-}
-
-static void
-xfsidbg_xqm_dqattached_inos(xfs_mount_t	*mp)
-{
-	xfs_inode_t	*ip;
-	int		n = 0;
-
-	ip = mp->m_inodes;
-	do {
-		if (ip->i_mount == NULL) {
-			ip = ip->i_mnext;
-			continue;
-		}
-		if (ip->i_udquot || ip->i_gdquot) {
-			n++;
-			kdb_printf("inode = 0x%p, ino %d: udq 0x%p, gdq 0x%p\n",
-				ip, (int)ip->i_ino, ip->i_udquot, ip->i_gdquot);
-		}
-		ip = ip->i_mnext;
-	} while (ip != mp->m_inodes);
-	kdb_printf("\nNumber of inodes with dquots attached: %d\n", n);
-}
-
-#ifdef	CONFIG_XFS_QUOTA
-static void
-xfsidbg_xqm_freelist_print(xfs_frlist_t *qlist, char *title)
-{
-	xfs_dquot_t *dq;
-	int i = 0;
-	kdb_printf("%s (#%d)\n", title, (int) qlist->qh_nelems);
-	FOREACH_DQUOT_IN_FREELIST(dq, qlist) {
-		kdb_printf("\t%d.\t\"%d (%s:0x%p)\"\t bcnt = %d, icnt = %d "
-		       "refs = %d\n",
-		       ++i, (int) INT_GET(dq->q_core.d_id, ARCH_CONVERT),
-		       DQFLAGTO_TYPESTR(dq), dq,
-		       (int) INT_GET(dq->q_core.d_bcount, ARCH_CONVERT),
-		       (int) INT_GET(dq->q_core.d_icount, ARCH_CONVERT),
-		       (int) dq->q_nrefs);
-	}
-}
-
-static void
-xfsidbg_xqm_freelist(void)
-{
-	if (xfs_Gqm) {
-		xfsidbg_xqm_freelist_print(&(xfs_Gqm->qm_dqfreelist), "Freelist");
-	} else
-		kdb_printf("NULL XQM!!\n");
-}
-
-static void
-xfsidbg_xqm_htab(void)
-{
-	int		i;
-	xfs_dqhash_t	*h;
-
-	if (xfs_Gqm == NULL) {
-		kdb_printf("NULL XQM!!\n");
-		return;
-	}
-	for (i = 0; i <= xfs_Gqm->qm_dqhashmask; i++) {
-		h = &xfs_Gqm->qm_usr_dqhtable[i];
-		if (h->qh_next) {
-			kdb_printf("USR %d: ", i);
-			XQMIDBG_LIST_PRINT(h, HL_NEXT);
-		}
-	}
-	for (i = 0; i <= xfs_Gqm->qm_dqhashmask; i++) {
-		h = &xfs_Gqm->qm_grp_dqhtable[i];
-		if (h->qh_next) {
-			kdb_printf("GRP %d: ", i);
-			XQMIDBG_LIST_PRINT(h, HL_NEXT);
-		}
-	}
-}
-#endif
-
-static void
-xfsidbg_xqm_mplist(xfs_mount_t *mp)
-{
-	if (mp->m_quotainfo == NULL) {
-		kdb_printf("NULL quotainfo\n");
-		return;
-	}
-
-	XQMIDBG_LIST_PRINT(&(mp->m_quotainfo->qi_dqlist), MPL_NEXT);
-
-}
-
-
-static void
-xfsidbg_xqm_qinfo(xfs_mount_t *mp)
-{
-	if (mp == NULL || mp->m_quotainfo == NULL) {
-		kdb_printf("NULL quotainfo\n");
-		return;
-	}
-
-	kdb_printf("uqip 0x%p, gqip 0x%p, &pinlock 0x%p &dqlist 0x%p\n",
-		mp->m_quotainfo->qi_uquotaip,
-		mp->m_quotainfo->qi_gquotaip,
-		&mp->m_quotainfo->qi_pinlock,
-		&mp->m_quotainfo->qi_dqlist);
-
-	kdb_printf("nreclaims %d, btmlimit 0x%x, itmlimit 0x%x, RTbtmlim 0x%x\n",
-		(int)mp->m_quotainfo->qi_dqreclaims,
-		(int)mp->m_quotainfo->qi_btimelimit,
-		(int)mp->m_quotainfo->qi_itimelimit,
-		(int)mp->m_quotainfo->qi_rtbtimelimit);
-
-	kdb_printf("bwarnlim 0x%x, iwarnlim 0x%x, &qofflock 0x%p, "
-		"chunklen 0x%x, dqperchunk 0x%x\n",
-		(int)mp->m_quotainfo->qi_bwarnlimit,
-		(int)mp->m_quotainfo->qi_iwarnlimit,
-		&mp->m_quotainfo->qi_quotaofflock,
-		(int)mp->m_quotainfo->qi_dqchunklen,
-		(int)mp->m_quotainfo->qi_dqperchunk);
-}
-
-static void
-xfsidbg_xqm_tpdqinfo(xfs_trans_t *tp)
-{
-	xfs_dqtrx_t	*qa, *q;
-	int		i,j;
-
-	kdb_printf("dqinfo 0x%p\n", tp->t_dqinfo);
-	if (! tp->t_dqinfo)
-		return;
-	kdb_printf("USR: \n");
-	qa = tp->t_dqinfo->dqa_usrdquots;
-	for (j = 0; j < 2; j++) {
-		for (i = 0; i < XFS_QM_TRANS_MAXDQS; i++) {
-			if (qa[i].qt_dquot == NULL)
-				break;
-			q = &qa[i];
-			kdb_printf(
-  "\"%d\"[0x%p]: bres %d, bres-used %d, bdelta %d, del-delta %d, icnt-delta %d\n",
-				(int) q->qt_dquot->q_core.d_id,
-				q->qt_dquot,
-				(int) q->qt_blk_res,
-				(int) q->qt_blk_res_used,
-				(int) q->qt_bcount_delta,
-				(int) q->qt_delbcnt_delta,
-				(int) q->qt_icount_delta);
-		}
-		if (j == 0) {
-			qa = tp->t_dqinfo->dqa_grpdquots;
-			kdb_printf("GRP: \n");
-		}
-	}
-
-}
-
-
-
-/*
- * Print xfs superblock.
- */
-static void
-xfsidbg_xsb(xfs_sb_t *sbp, int convert)
-{
-	xfs_arch_t arch=convert?ARCH_CONVERT:ARCH_NOCONVERT;
-
-	kdb_printf(convert?"<converted>\n":"<unconverted>\n");
-
-	kdb_printf("magicnum 0x%x blocksize 0x%x dblocks %Ld rblocks %Ld\n",
-		INT_GET(sbp->sb_magicnum, arch), INT_GET(sbp->sb_blocksize, arch),
-		INT_GET(sbp->sb_dblocks, arch), INT_GET(sbp->sb_rblocks, arch));
-	kdb_printf("rextents %Ld uuid %s logstart %s\n",
-		INT_GET(sbp->sb_rextents, arch),
-		xfs_fmtuuid(&sbp->sb_uuid),
-		xfs_fmtfsblock(INT_GET(sbp->sb_logstart, arch), NULL));
-	kdb_printf("rootino %s ",
-		xfs_fmtino(INT_GET(sbp->sb_rootino, arch), NULL));
-	kdb_printf("rbmino %s ",
-		xfs_fmtino(INT_GET(sbp->sb_rbmino, arch), NULL));
-	kdb_printf("rsumino %s\n",
-		xfs_fmtino(INT_GET(sbp->sb_rsumino, arch), NULL));
-	kdb_printf("rextsize 0x%x agblocks 0x%x agcount 0x%x rbmblocks 0x%x\n",
-		INT_GET(sbp->sb_rextsize, arch),
-		INT_GET(sbp->sb_agblocks, arch),
-		INT_GET(sbp->sb_agcount, arch),
-		INT_GET(sbp->sb_rbmblocks, arch));
-	kdb_printf("logblocks 0x%x versionnum 0x%x sectsize 0x%x inodesize 0x%x\n",
-		INT_GET(sbp->sb_logblocks, arch),
-		INT_GET(sbp->sb_versionnum, arch),
-		INT_GET(sbp->sb_sectsize, arch),
-		INT_GET(sbp->sb_inodesize, arch));
-	kdb_printf("inopblock 0x%x blocklog 0x%x sectlog 0x%x inodelog 0x%x\n",
-		INT_GET(sbp->sb_inopblock, arch),
-		INT_GET(sbp->sb_blocklog, arch),
-		INT_GET(sbp->sb_sectlog, arch),
-		INT_GET(sbp->sb_inodelog, arch));
-	kdb_printf("inopblog %d agblklog %d rextslog %d inprogress %d imax_pct %d\n",
-		INT_GET(sbp->sb_inopblog, arch),
-		INT_GET(sbp->sb_agblklog, arch),
-		INT_GET(sbp->sb_rextslog, arch),
-		INT_GET(sbp->sb_inprogress, arch),
-		INT_GET(sbp->sb_imax_pct, arch));
-	kdb_printf("icount %Lx ifree %Lx fdblocks %Lx frextents %Lx\n",
-		INT_GET(sbp->sb_icount, arch),
-		INT_GET(sbp->sb_ifree, arch),
-		INT_GET(sbp->sb_fdblocks, arch),
-		INT_GET(sbp->sb_frextents, arch));
-	kdb_printf("uquotino %s ", xfs_fmtino(INT_GET(sbp->sb_uquotino, arch), NULL));
-	kdb_printf("gquotino %s ", xfs_fmtino(INT_GET(sbp->sb_gquotino, arch), NULL));
-	kdb_printf("qflags 0x%x flags 0x%x shared_vn %d inoaligmt %d\n",
-		INT_GET(sbp->sb_qflags, arch), INT_GET(sbp->sb_flags, arch), INT_GET(sbp->sb_shared_vn, arch),
-		INT_GET(sbp->sb_inoalignmt, arch));
-	kdb_printf("unit %d width %d dirblklog %d\n",
-		INT_GET(sbp->sb_unit, arch), INT_GET(sbp->sb_width, arch), INT_GET(sbp->sb_dirblklog, arch));
-	kdb_printf("log sunit %d\n", INT_GET(sbp->sb_logsunit, arch));
-}
-
-
-/*
- * Print out an XFS transaction structure.  Print summaries for
- * each of the items.
- */
-static void
-xfsidbg_xtp(xfs_trans_t *tp)
-{
-	xfs_log_item_chunk_t	*licp;
-	xfs_log_item_desc_t	*lidp;
-	xfs_log_busy_chunk_t	*lbcp;
-	int			i;
-	int			chunk;
-	static char *xtp_flags[] = {
-		"dirty",	/* 0x1 */
-		"sb_dirty",	/* 0x2 */
-		"perm_log_res",	/* 0x4 */
-		"sync",         /* 0x08 */
-		"dq_dirty",     /* 0x10 */
-		0
-		};
-	static char *lid_flags[] = {
-		"dirty",	/* 0x1 */
-		"pinned",	/* 0x2 */
-		"sync unlock",	/* 0x4 */
-		"buf stale",	/* 0x8 */
-		0
-		};
-
-	kdb_printf("tp 0x%p type ", tp);
-	switch (tp->t_type) {
-	case XFS_TRANS_SETATTR_NOT_SIZE: kdb_printf("SETATTR_NOT_SIZE");	break;
-	case XFS_TRANS_SETATTR_SIZE:	kdb_printf("SETATTR_SIZE");	break;
-	case XFS_TRANS_INACTIVE:	kdb_printf("INACTIVE");		break;
-	case XFS_TRANS_CREATE:		kdb_printf("CREATE");		break;
-	case XFS_TRANS_CREATE_TRUNC:	kdb_printf("CREATE_TRUNC");	break;
-	case XFS_TRANS_TRUNCATE_FILE:	kdb_printf("TRUNCATE_FILE");	break;
-	case XFS_TRANS_REMOVE:		kdb_printf("REMOVE");		break;
-	case XFS_TRANS_LINK:		kdb_printf("LINK");		break;
-	case XFS_TRANS_RENAME:		kdb_printf("RENAME");		break;
-	case XFS_TRANS_MKDIR:		kdb_printf("MKDIR");		break;
-	case XFS_TRANS_RMDIR:		kdb_printf("RMDIR");		break;
-	case XFS_TRANS_SYMLINK:		kdb_printf("SYMLINK");		break;
-	case XFS_TRANS_SET_DMATTRS:	kdb_printf("SET_DMATTRS");		break;
-	case XFS_TRANS_GROWFS:		kdb_printf("GROWFS");		break;
-	case XFS_TRANS_STRAT_WRITE:	kdb_printf("STRAT_WRITE");		break;
-	case XFS_TRANS_DIOSTRAT:	kdb_printf("DIOSTRAT");		break;
-	case XFS_TRANS_WRITE_SYNC:	kdb_printf("WRITE_SYNC");		break;
-	case XFS_TRANS_WRITEID:		kdb_printf("WRITEID");		break;
-	case XFS_TRANS_ADDAFORK:	kdb_printf("ADDAFORK");		break;
-	case XFS_TRANS_ATTRINVAL:	kdb_printf("ATTRINVAL");		break;
-	case XFS_TRANS_ATRUNCATE:	kdb_printf("ATRUNCATE");		break;
-	case XFS_TRANS_ATTR_SET:	kdb_printf("ATTR_SET");		break;
-	case XFS_TRANS_ATTR_RM:		kdb_printf("ATTR_RM");		break;
-	case XFS_TRANS_ATTR_FLAG:	kdb_printf("ATTR_FLAG");		break;
-	case XFS_TRANS_CLEAR_AGI_BUCKET:  kdb_printf("CLEAR_AGI_BUCKET");	break;
-	case XFS_TRANS_QM_SBCHANGE:	kdb_printf("QM_SBCHANGE");	break;
-	case XFS_TRANS_QM_QUOTAOFF:	kdb_printf("QM_QUOTAOFF");	break;
-	case XFS_TRANS_QM_DQALLOC:	kdb_printf("QM_DQALLOC");		break;
-	case XFS_TRANS_QM_SETQLIM:	kdb_printf("QM_SETQLIM");		break;
-	case XFS_TRANS_QM_DQCLUSTER:	kdb_printf("QM_DQCLUSTER");	break;
-	case XFS_TRANS_QM_QINOCREATE:	kdb_printf("QM_QINOCREATE");	break;
-	case XFS_TRANS_QM_QUOTAOFF_END:	kdb_printf("QM_QOFF_END");		break;
-	case XFS_TRANS_SB_UNIT:		kdb_printf("SB_UNIT");		break;
-	case XFS_TRANS_FSYNC_TS:	kdb_printf("FSYNC_TS");		break;
-	case XFS_TRANS_GROWFSRT_ALLOC:	kdb_printf("GROWFSRT_ALLOC");	break;
-	case XFS_TRANS_GROWFSRT_ZERO:	kdb_printf("GROWFSRT_ZERO");	break;
-	case XFS_TRANS_GROWFSRT_FREE:	kdb_printf("GROWFSRT_FREE");	break;
-
-	default:			kdb_printf("0x%x", tp->t_type);	break;
-	}
-	kdb_printf(" mount 0x%p\n", tp->t_mountp);
-	kdb_printf("flags ");
-	printflags(tp->t_flags, xtp_flags,"xtp");
-	kdb_printf("\n");
-	kdb_printf("callback 0x%p forw 0x%p back 0x%p\n",
-		&tp->t_logcb, tp->t_forw, tp->t_back);
-	kdb_printf("log res %d block res %d block res used %d\n",
-		tp->t_log_res, tp->t_blk_res, tp->t_blk_res_used);
-	kdb_printf("rt res %d rt res used %d\n", tp->t_rtx_res,
-		tp->t_rtx_res_used);
-	kdb_printf("ticket 0x%lx lsn %s commit_lsn %s\n",
-		(unsigned long) tp->t_ticket,
-		xfs_fmtlsn(&tp->t_lsn),
-		xfs_fmtlsn(&tp->t_commit_lsn));
-	kdb_printf("callback 0x%p callarg 0x%p\n",
-		tp->t_callback, tp->t_callarg);
-	kdb_printf("icount delta %ld ifree delta %ld\n",
-		tp->t_icount_delta, tp->t_ifree_delta);
-	kdb_printf("blocks delta %ld res blocks delta %ld\n",
-		tp->t_fdblocks_delta, tp->t_res_fdblocks_delta);
-	kdb_printf("rt delta %ld res rt delta %ld\n",
-		tp->t_frextents_delta, tp->t_res_frextents_delta);
-	kdb_printf("ag freeblks delta %ld ag flist delta %ld ag btree delta %ld\n",
-		tp->t_ag_freeblks_delta, tp->t_ag_flist_delta,
-		tp->t_ag_btree_delta);
-	kdb_printf("dblocks delta %ld agcount delta %ld imaxpct delta %ld\n",
-		tp->t_dblocks_delta, tp->t_agcount_delta, tp->t_imaxpct_delta);
-	kdb_printf("rextsize delta %ld rbmblocks delta %ld\n",
-		tp->t_rextsize_delta, tp->t_rbmblocks_delta);
-	kdb_printf("rblocks delta %ld rextents delta %ld rextslog delta %ld\n",
-		tp->t_rblocks_delta, tp->t_rextents_delta,
-		tp->t_rextslog_delta);
-	kdb_printf("dqinfo 0x%p\n", tp->t_dqinfo);
-	kdb_printf("log items:\n");
-	licp = &tp->t_items;
-	chunk = 0;
-	while (licp != NULL) {
-		if (XFS_LIC_ARE_ALL_FREE(licp)) {
-			licp = licp->lic_next;
-			chunk++;
-			continue;
-		}
-		for (i = 0; i < licp->lic_unused; i++) {
-			if (XFS_LIC_ISFREE(licp, i)) {
-				continue;
-			}
-
-			lidp = XFS_LIC_SLOT(licp, i);
-			kdb_printf("\n");
-			kdb_printf("chunk %d index %d item 0x%p size %d\n",
-				chunk, i, lidp->lid_item, lidp->lid_size);
-			kdb_printf("flags ");
-			printflags(lidp->lid_flags, lid_flags,"lic");
-			kdb_printf("\n");
-			xfsidbg_xlogitem(lidp->lid_item);
-		}
-		chunk++;
-		licp = licp->lic_next;
-	}
-
-	kdb_printf("log busy free %d, list:\n", tp->t_busy_free);
-	lbcp = &tp->t_busy;
-	chunk = 0;
-	while (lbcp != NULL) {
-		kdb_printf("Chunk %d at 0x%p next 0x%p free 0x%08x unused %d\n",
-			chunk, lbcp, lbcp->lbc_next, lbcp->lbc_free,
-			lbcp->lbc_unused);
-		for (i = 0; i < XFS_LBC_NUM_SLOTS; i++) {
-			kdb_printf("  %02d: ag %d idx %d\n",
-				i,
-				lbcp->lbc_busy[i].lbc_ag,
-				lbcp->lbc_busy[i].lbc_idx);
-		}
-		lbcp = lbcp->lbc_next;
-	}
-}
-
-static void
-xfsidbg_xtrans_res(
-	xfs_mount_t	*mp)
-{
-	xfs_trans_reservations_t	*xtrp;
-
-	xtrp = &mp->m_reservations;
-	kdb_printf("write: %d\ttruncate: %d\trename: %d\n",
-		xtrp->tr_write, xtrp->tr_itruncate, xtrp->tr_rename);
-	kdb_printf("link: %d\tremove: %d\tsymlink: %d\n",
-		xtrp->tr_link, xtrp->tr_remove, xtrp->tr_symlink);
-	kdb_printf("create: %d\tmkdir: %d\tifree: %d\n",
-		xtrp->tr_create, xtrp->tr_mkdir, xtrp->tr_ifree);
-	kdb_printf("ichange: %d\tgrowdata: %d\tswrite: %d\n",
-		xtrp->tr_ichange, xtrp->tr_growdata, xtrp->tr_swrite);
-	kdb_printf("addafork: %d\twriteid: %d\tattrinval: %d\n",
-		xtrp->tr_addafork, xtrp->tr_writeid, xtrp->tr_attrinval);
-	kdb_printf("attrset: %d\tattrrm: %d\tclearagi: %d\n",
-		xtrp->tr_attrset, xtrp->tr_attrrm, xtrp->tr_clearagi);
-	kdb_printf("growrtalloc: %d\tgrowrtzero: %d\tgrowrtfree: %d\n",
-		xtrp->tr_growrtalloc, xtrp->tr_growrtzero, xtrp->tr_growrtfree);
-}
-
-module_init(xfsidbg_init)
-module_exit(xfsidbg_exit)
diff -Nru a/include/acpi/acconfig.h b/include/acpi/acconfig.h
--- a/include/acpi/acconfig.h	Tue Feb  3 19:45:35 2004
+++ b/include/acpi/acconfig.h	Tue Feb  3 19:45:35 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -64,7 +64,7 @@
 
 /* Version string */
 
-#define ACPI_CA_VERSION                 0x20031002
+#define ACPI_CA_VERSION                 0x20040116
 
 /* Maximum objects in the various object caches */
 
diff -Nru a/include/acpi/acdebug.h b/include/acpi/acdebug.h
--- a/include/acpi/acdebug.h	Tue Feb  3 19:45:17 2004
+++ b/include/acpi/acdebug.h	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
--- a/include/acpi/acdisasm.h	Tue Feb  3 19:45:28 2004
+++ b/include/acpi/acdisasm.h	Tue Feb  3 19:45:28 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/acdispat.h b/include/acpi/acdispat.h
--- a/include/acpi/acdispat.h	Tue Feb  3 19:45:34 2004
+++ b/include/acpi/acdispat.h	Tue Feb  3 19:45:34 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/acevents.h b/include/acpi/acevents.h
--- a/include/acpi/acevents.h	Tue Feb  3 19:45:29 2004
+++ b/include/acpi/acevents.h	Tue Feb  3 19:45:29 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -182,6 +182,17 @@
 	union acpi_operand_object      *region_obj,
 	u8                              acpi_ns_is_locked);
 
+acpi_status
+acpi_ev_execute_reg_method (
+	union acpi_operand_object      *region_obj,
+	u32                             function);
+
+acpi_status
+acpi_ev_reg_run (
+	acpi_handle                     obj_handle,
+	u32                             level,
+	void                            *context,
+	void                            **return_value);
 
 /*
  * Evregini - Region initialization and setup
diff -Nru a/include/acpi/acexcep.h b/include/acpi/acexcep.h
--- a/include/acpi/acexcep.h	Tue Feb  3 19:45:16 2004
+++ b/include/acpi/acexcep.h	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/acglobal.h b/include/acpi/acglobal.h
--- a/include/acpi/acglobal.h	Tue Feb  3 19:45:16 2004
+++ b/include/acpi/acglobal.h	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -106,6 +106,9 @@
 ACPI_EXTERN u8                                  acpi_gbl_integer_bit_width;
 ACPI_EXTERN u8                                  acpi_gbl_integer_byte_width;
 ACPI_EXTERN u8                                  acpi_gbl_integer_nybble_width;
+
+/* Keep local copies of these FADT-based registers */
+
 ACPI_EXTERN struct acpi_generic_address         acpi_gbl_xpm1a_enable;
 ACPI_EXTERN struct acpi_generic_address         acpi_gbl_xpm1b_enable;
 
diff -Nru a/include/acpi/achware.h b/include/acpi/achware.h
--- a/include/acpi/achware.h	Tue Feb  3 19:45:30 2004
+++ b/include/acpi/achware.h	Tue Feb  3 19:45:30 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/acinterp.h b/include/acpi/acinterp.h
--- a/include/acpi/acinterp.h	Tue Feb  3 19:45:42 2004
+++ b/include/acpi/acinterp.h	Tue Feb  3 19:45:42 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/aclocal.h b/include/acpi/aclocal.h
--- a/include/acpi/aclocal.h	Tue Feb  3 19:45:30 2004
+++ b/include/acpi/aclocal.h	Tue Feb  3 19:45:30 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/acmacros.h b/include/acpi/acmacros.h
--- a/include/acpi/acmacros.h	Tue Feb  3 19:45:28 2004
+++ b/include/acpi/acmacros.h	Tue Feb  3 19:45:28 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -48,7 +48,6 @@
 /*
  * Data manipulation macros
  */
-
 #define ACPI_LOWORD(l)                  ((u16)(u32)(l))
 #define ACPI_HIWORD(l)                  ((u16)((((u32)(l)) >> 16) & 0xFFFF))
 #define ACPI_LOBYTE(l)                  ((u8)(u16)(l))
@@ -94,10 +93,18 @@
 #endif
 #endif
 
- /*
-  * Extract a byte of data using a pointer.  Any more than a byte and we
-  * get into potential aligment issues -- see the STORE macros below
-  */
+/*
+ * printf() format helpers
+ */
+
+/* Split 64-bit integer into two 32-bit values. use with %8,8_x%8.8X */
+
+#define ACPI_FORMAT_UINT64(i)           ACPI_HIDWORD(i),ACPI_LODWORD(i)
+
+/*
+ * Extract a byte of data using a pointer.  Any more than a byte and we
+ * get into potential aligment issues -- see the STORE macros below
+ */
 #define ACPI_GET8(addr)                 (*(u8*)(addr))
 
 /* Pointer arithmetic */
@@ -129,7 +136,6 @@
  * If the hardware supports the transfer of unaligned data, just do the store.
  * Otherwise, we have to move one byte at a time.
  */
-
 #ifdef ACPI_BIG_ENDIAN
 /*
  * Macros for big-endian machines
@@ -299,7 +305,6 @@
 /*
  * Fast power-of-two math macros for non-optimized compilers
  */
-
 #define _ACPI_DIV(value,power_of2)      ((u32) ((value) >> (power_of2)))
 #define _ACPI_MUL(value,power_of2)      ((u32) ((value) << (power_of2)))
 #define _ACPI_MOD(value,divisor)        ((u32) ((value) & ((divisor) -1)))
@@ -443,7 +448,6 @@
 /*
  * Reporting macros that are never compiled out
  */
-
 #define ACPI_PARAM_LIST(pl)                 pl
 
 /*
@@ -451,7 +455,6 @@
  * _THIS_MODULE gets compiled out when ACPI_DEBUG_OUTPUT isn't defined, only
  * use it in debug mode.
  */
-
 #ifdef ACPI_DEBUG_OUTPUT
 
 #define ACPI_REPORT_INFO(fp)                {acpi_ut_report_info(_THIS_MODULE,__LINE__,_COMPONENT); \
@@ -490,7 +493,6 @@
 /*
  * Debug macros that are conditionally compiled
  */
-
 #ifdef ACPI_DEBUG_OUTPUT
 
 #define ACPI_MODULE_NAME(name)               static char ACPI_UNUSED_VAR *_THIS_MODULE = name;
@@ -500,7 +502,6 @@
  * The first parameter should be the procedure name as a quoted string.  This is declared
  * as a local string ("_proc_name) so that it can be also used by the function exit macros below.
  */
-
 #define ACPI_FUNCTION_NAME(a)               struct acpi_debug_print_info _dbg; \
 												_dbg.component_id = _COMPONENT; \
 												_dbg.proc_name   = a; \
@@ -562,7 +563,6 @@
 /*
  * Generate INT3 on ACPI_ERROR (Debug only!)
  */
-
 #define ACPI_ERROR_BREAK
 #ifdef  ACPI_ERROR_BREAK
 #define ACPI_BREAK_ON_ERROR(lvl)        if ((lvl)&ACPI_ERROR) \
@@ -577,7 +577,6 @@
  *    1) Debug print for the current component is enabled
  *    2) Debug error level or trace level for the print statement is enabled
  */
-
 #define ACPI_DEBUG_PRINT(pl)            acpi_ut_debug_print ACPI_PARAM_LIST(pl)
 #define ACPI_DEBUG_PRINT_RAW(pl)        acpi_ut_debug_print_raw ACPI_PARAM_LIST(pl)
 
@@ -587,7 +586,6 @@
  * This is the non-debug case -- make everything go away,
  * leaving no executable debug code!
  */
-
 #define ACPI_MODULE_NAME(name)
 #define _THIS_MODULE ""
 
@@ -662,7 +660,6 @@
 /*
  * Memory allocation tracking (DEBUG ONLY)
  */
-
 #ifndef ACPI_DBG_TRACK_ALLOCATIONS
 
 /* Memory allocation */
diff -Nru a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h
--- a/include/acpi/acnamesp.h	Tue Feb  3 19:45:17 2004
+++ b/include/acpi/acnamesp.h	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/acobject.h b/include/acpi/acobject.h
--- a/include/acpi/acobject.h	Tue Feb  3 19:45:17 2004
+++ b/include/acpi/acobject.h	Tue Feb  3 19:45:17 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -114,7 +114,7 @@
 #define ACPI_COMMON_NOTIFY_INFO \
 	union acpi_operand_object               *system_notify;     /* Handler for system notifies */\
 	union acpi_operand_object               *device_notify;     /* Handler for driver notifies */\
-	union acpi_operand_object               *address_space;     /* Handler for Address space */
+	union acpi_operand_object               *handler;           /* Handler for Address space */
 
 
 /******************************************************************************
@@ -214,7 +214,7 @@
 	ACPI_OBJECT_COMMON_HEADER
 
 	u8                                      space_id;
-	union acpi_operand_object               *address_space;     /* Handler for region access */
+	union acpi_operand_object               *handler;           /* Handler for region access */
 	struct acpi_namespace_node              *node;              /* containing object */
 	union acpi_operand_object               *next;
 	u32                                     length;
@@ -464,21 +464,22 @@
 
 /* Object descriptor types */
 
-#define ACPI_DESC_TYPE_CACHED           0x11        /* Used only when object is cached */
-#define ACPI_DESC_TYPE_STATE            0x20
-#define ACPI_DESC_TYPE_STATE_UPDATE     0x21
-#define ACPI_DESC_TYPE_STATE_PACKAGE    0x22
-#define ACPI_DESC_TYPE_STATE_CONTROL    0x23
-#define ACPI_DESC_TYPE_STATE_RPSCOPE    0x24
-#define ACPI_DESC_TYPE_STATE_PSCOPE     0x25
-#define ACPI_DESC_TYPE_STATE_WSCOPE     0x26
-#define ACPI_DESC_TYPE_STATE_RESULT     0x27
-#define ACPI_DESC_TYPE_STATE_NOTIFY     0x28
-#define ACPI_DESC_TYPE_STATE_THREAD     0x29
-#define ACPI_DESC_TYPE_WALK             0x44
-#define ACPI_DESC_TYPE_PARSER           0x66
-#define ACPI_DESC_TYPE_OPERAND          0x88
-#define ACPI_DESC_TYPE_NAMED            0xAA
+#define ACPI_DESC_TYPE_CACHED           0x01        /* Used only when object is cached */
+#define ACPI_DESC_TYPE_STATE            0x02
+#define ACPI_DESC_TYPE_STATE_UPDATE     0x03
+#define ACPI_DESC_TYPE_STATE_PACKAGE    0x04
+#define ACPI_DESC_TYPE_STATE_CONTROL    0x05
+#define ACPI_DESC_TYPE_STATE_RPSCOPE    0x06
+#define ACPI_DESC_TYPE_STATE_PSCOPE     0x07
+#define ACPI_DESC_TYPE_STATE_WSCOPE     0x08
+#define ACPI_DESC_TYPE_STATE_RESULT     0x09
+#define ACPI_DESC_TYPE_STATE_NOTIFY     0x0A
+#define ACPI_DESC_TYPE_STATE_THREAD     0x0B
+#define ACPI_DESC_TYPE_WALK             0x0C
+#define ACPI_DESC_TYPE_PARSER           0x0D
+#define ACPI_DESC_TYPE_OPERAND          0x0E
+#define ACPI_DESC_TYPE_NAMED            0x0F
+#define ACPI_DESC_TYPE_MAX              0x0F
 
 
 union acpi_descriptor
diff -Nru a/include/acpi/acoutput.h b/include/acpi/acoutput.h
--- a/include/acpi/acoutput.h	Tue Feb  3 19:45:17 2004
+++ b/include/acpi/acoutput.h	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/acparser.h b/include/acpi/acparser.h
--- a/include/acpi/acparser.h	Tue Feb  3 19:45:33 2004
+++ b/include/acpi/acparser.h	Tue Feb  3 19:45:33 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/acpi.h b/include/acpi/acpi.h
--- a/include/acpi/acpi.h	Tue Feb  3 19:45:26 2004
+++ b/include/acpi/acpi.h	Tue Feb  3 19:45:26 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
--- a/include/acpi/acpi_drivers.h	Tue Feb  3 19:45:34 2004
+++ b/include/acpi/acpi_drivers.h	Tue Feb  3 19:45:34 2004
@@ -53,10 +53,6 @@
 
 #define ACPI_PCI_COMPONENT		0x00400000
 
-/* ACPI PCI Root Bridge (pci_root.c) */
-
-void acpi_pci_get_translations (struct acpi_pci_id* id, u64* mem_tra, u64* io_tra);
-
 /* ACPI PCI Interrupt Link (pci_link.c) */
 
 int acpi_pci_link_check (void);
diff -Nru a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
--- a/include/acpi/acpiosxf.h	Tue Feb  3 19:45:16 2004
+++ b/include/acpi/acpiosxf.h	Tue Feb  3 19:45:16 2004
@@ -9,7 +9,7 @@
 
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/acpixf.h b/include/acpi/acpixf.h
--- a/include/acpi/acpixf.h	Tue Feb  3 19:45:16 2004
+++ b/include/acpi/acpixf.h	Tue Feb  3 19:45:16 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/acresrc.h b/include/acpi/acresrc.h
--- a/include/acpi/acresrc.h	Tue Feb  3 19:45:17 2004
+++ b/include/acpi/acresrc.h	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/acstruct.h b/include/acpi/acstruct.h
--- a/include/acpi/acstruct.h	Tue Feb  3 19:45:16 2004
+++ b/include/acpi/acstruct.h	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/actables.h b/include/acpi/actables.h
--- a/include/acpi/actables.h	Tue Feb  3 19:45:17 2004
+++ b/include/acpi/actables.h	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/actbl.h b/include/acpi/actbl.h
--- a/include/acpi/actbl.h	Tue Feb  3 19:45:26 2004
+++ b/include/acpi/actbl.h	Tue Feb  3 19:45:26 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -165,6 +165,11 @@
 	u8                              type; \
 	u8                              length;
 
+struct apic_header
+{
+	APIC_HEADER_DEF
+};
+
 /* Values for MPS INTI flags */
 
 #define POLARITY_CONFORMS       0
@@ -236,7 +241,7 @@
 {
 	APIC_HEADER_DEF
 	u16                             reserved;               /* Reserved - must be zero */
-	u32                             address;                /* APIC physical address */
+	u64                             address;                /* APIC physical address */
 };
 
 struct madt_io_sapic
diff -Nru a/include/acpi/actbl1.h b/include/acpi/actbl1.h
--- a/include/acpi/actbl1.h	Tue Feb  3 19:45:17 2004
+++ b/include/acpi/actbl1.h	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/actbl2.h b/include/acpi/actbl2.h
--- a/include/acpi/actbl2.h	Tue Feb  3 19:45:30 2004
+++ b/include/acpi/actbl2.h	Tue Feb  3 19:45:30 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/actypes.h b/include/acpi/actypes.h
--- a/include/acpi/actypes.h	Tue Feb  3 19:45:29 2004
+++ b/include/acpi/actypes.h	Tue Feb  3 19:45:29 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/acutils.h b/include/acpi/acutils.h
--- a/include/acpi/acutils.h	Tue Feb  3 19:45:16 2004
+++ b/include/acpi/acutils.h	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -123,6 +123,14 @@
 char *
 acpi_ut_get_type_name (
 	acpi_object_type                type);
+
+char *
+acpi_ut_get_node_name (
+	void                            *object);
+
+char *
+acpi_ut_get_descriptor_name (
+	void                            *object);
 
 char *
 acpi_ut_get_object_type_name (
diff -Nru a/include/acpi/amlcode.h b/include/acpi/amlcode.h
--- a/include/acpi/amlcode.h	Tue Feb  3 19:45:33 2004
+++ b/include/acpi/amlcode.h	Tue Feb  3 19:45:33 2004
@@ -7,7 +7,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h
--- a/include/acpi/amlresrc.h	Tue Feb  3 19:45:42 2004
+++ b/include/acpi/amlresrc.h	Tue Feb  3 19:45:42 2004
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
--- a/include/acpi/platform/acenv.h	Tue Feb  3 19:45:17 2004
+++ b/include/acpi/platform/acenv.h	Tue Feb  3 19:45:17 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
--- a/include/acpi/platform/acgcc.h	Tue Feb  3 19:45:42 2004
+++ b/include/acpi/platform/acgcc.h	Tue Feb  3 19:45:42 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
--- a/include/acpi/platform/aclinux.h	Tue Feb  3 19:45:37 2004
+++ b/include/acpi/platform/aclinux.h	Tue Feb  3 19:45:37 2004
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2003, R. Byron Moore
+ * Copyright (C) 2000 - 2004, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -Nru a/include/acpi/processor.h b/include/acpi/processor.h
--- a/include/acpi/processor.h	Tue Feb  3 19:45:17 2004
+++ b/include/acpi/processor.h	Tue Feb  3 19:45:17 2004
@@ -72,6 +72,8 @@
 	int			platform_limit;
 	u16			control_register;
 	u16			status_register;
+	u8			control_register_bit_width;
+	u8			status_register_bit_width;
 	int			state_count;
 	struct acpi_processor_px states[ACPI_PROCESSOR_MAX_PERFORMANCE];
 	struct cpufreq_frequency_table freq_table[ACPI_PROCESSOR_MAX_PERFORMANCE];
diff -Nru a/include/asm-alpha/elf.h b/include/asm-alpha/elf.h
--- a/include/asm-alpha/elf.h	Tue Feb  3 19:45:26 2004
+++ b/include/asm-alpha/elf.h	Tue Feb  3 19:45:26 2004
@@ -122,27 +122,19 @@
    instruction set this CPU supports.  This is trivial on Alpha, 
    but not so on other machines. */
 
-#define ELF_HWCAP							\
-({									\
-	/* Sadly, most folks don't yet have assemblers that know about	\
-	   amask.  This is "amask v0, v0" */				\
-	register long _v0 __asm("$0") = -1;				\
-	__asm(".long 0x47e00c20" : "=r"(_v0) : "0"(_v0));		\
-	~_v0;								\
-})
+#define ELF_HWCAP  (~amask(-1))
 
 /* This yields a string that ld.so will use to load implementation
    specific libraries for optimization.  This is more specific in
-   intent than poking at uname or /proc/cpuinfo.  
-
-   This might do with checking bwx simultaneously...  */
+   intent than poking at uname or /proc/cpuinfo.  */
 
 #define ELF_PLATFORM				\
 ({						\
-	/* Or "implver v0" ... */		\
-	register long _v0 __asm("$0");		\
-	__asm(".long 0x47e03d80" : "=r"(_v0));	\
-	_v0 == 0 ? "ev4" : "ev5";		\
+	enum implver_enum i_ = implver();	\
+	( i_ == IMPLVER_EV4 ? "ev4"		\
+	: i_ == IMPLVER_EV5			\
+	  ? (amask(AMASK_BWX) ? "ev5" : "ev56")	\
+	: amask (AMASK_CIX) ? "ev6" : "ev67");	\
 })
 
 #ifdef __KERNEL__
diff -Nru a/include/asm-alpha/floppy.h b/include/asm-alpha/floppy.h
--- a/include/asm-alpha/floppy.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-alpha/floppy.h	Tue Feb  3 19:45:42 2004
@@ -13,7 +13,7 @@
 #include <linux/config.h>
 
 #define fd_inb(port)			inb_p(port)
-#define fd_outb(port,value)		outb_p(port,value)
+#define fd_outb(value,port)		outb_p(value,port)
 
 #define fd_enable_dma()         enable_dma(FLOPPY_DMA)
 #define fd_disable_dma()        disable_dma(FLOPPY_DMA)
diff -Nru a/include/asm-alpha/processor.h b/include/asm-alpha/processor.h
--- a/include/asm-alpha/processor.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-alpha/processor.h	Tue Feb  3 19:45:43 2004
@@ -78,6 +78,11 @@
 #define ARCH_HAS_PREFETCHW
 #define ARCH_HAS_SPINLOCK_PREFETCH
 
+#ifndef CONFIG_SMP
+/* Nothing to prefetch. */
+#define spin_lock_prefetch(lock)  	do { } while (0)
+#endif
+
 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
 extern inline void prefetch(const void *ptr)  
 { 
@@ -89,10 +94,13 @@
 	__builtin_prefetch(ptr, 1, 3);
 }
 
+#ifdef CONFIG_SMP
 extern inline void spin_lock_prefetch(const void *ptr)  
 {
 	__builtin_prefetch(ptr, 1, 3);
 }
+#endif
+
 #else
 extern inline void prefetch(const void *ptr)  
 { 
@@ -104,10 +112,13 @@
 	__asm__ ("ldq $31,%0" : : "m"(*(char *)ptr)); 
 }
 
+#ifdef CONFIG_SMP
 extern inline void spin_lock_prefetch(const void *ptr)  
 {
 	__asm__ ("ldq $31,%0" : : "m"(*(char *)ptr)); 
 }
+#endif
+
 #endif /* GCC 3.1 */
 
 #endif /* __ASM_ALPHA_PROCESSOR_H */
diff -Nru a/include/asm-alpha/smp.h b/include/asm-alpha/smp.h
--- a/include/asm-alpha/smp.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-alpha/smp.h	Tue Feb  3 19:45:42 2004
@@ -48,8 +48,8 @@
 extern cpumask_t cpu_present_mask;
 extern cpumask_t cpu_online_map;
 extern int smp_num_cpus;
+#define cpu_possible_map	cpu_present_mask
 
-#define cpu_possible(cpu)	cpu_isset(cpu, cpu_present_mask)
 #define cpu_online(cpu)		cpu_isset(cpu, cpu_online_map)
 
 extern int smp_call_function_on_cpu(void (*func) (void *info), void *info,int retry, int wait, unsigned long cpu);
diff -Nru a/include/asm-alpha/socket.h b/include/asm-alpha/socket.h
--- a/include/asm-alpha/socket.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-alpha/socket.h	Tue Feb  3 19:45:42 2004
@@ -48,6 +48,8 @@
 #define SO_TIMESTAMP		29
 #define SCM_TIMESTAMP		SO_TIMESTAMP
 
+#define SO_PEERSEC		30
+
 /* Security levels - as per NRL IPv6 - don't actually do anything */
 #define SO_SECURITY_AUTHENTICATION		19
 #define SO_SECURITY_ENCRYPTION_TRANSPORT	20
diff -Nru a/include/asm-alpha/topology.h b/include/asm-alpha/topology.h
--- a/include/asm-alpha/topology.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-alpha/topology.h	Tue Feb  3 19:45:17 2004
@@ -16,8 +16,7 @@
 	node = alpha_mv.cpuid_to_nid(cpu);
 
 #ifdef DEBUG_NUMA
-	if (node < 0)
-		BUG();
+	BUG_ON(node < 0);
 #endif
 
 	return node;
diff -Nru a/include/asm-arm/arch-ebsa285/io.h b/include/asm-arm/arch-ebsa285/io.h
--- a/include/asm-arm/arch-ebsa285/io.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-arm/arch-ebsa285/io.h	Tue Feb  3 19:45:17 2004
@@ -27,15 +27,13 @@
 
 static inline unsigned long ___mem_pci(unsigned long a)
 {
-	if (a <= 0xc0000000 || a >= 0xe0000000)
-		BUG();
+	BUG_ON(a <= 0xc0000000 || a >= 0xe0000000);
 	return a;
 }
 
 static inline unsigned long ___mem_isa(unsigned long a)
 {
-	if (a >= 16*1048576)
-		BUG();
+	BUG_ON(a >= 16*1048576);
 	return PCIMEM_BASE + a;
 }
 #define __mem_pci(a)		___mem_pci((unsigned long)(a))
diff -Nru a/include/asm-arm/arch-nexuspci/io.h b/include/asm-arm/arch-nexuspci/io.h
--- a/include/asm-arm/arch-nexuspci/io.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-arm/arch-nexuspci/io.h	Tue Feb  3 19:45:42 2004
@@ -28,8 +28,7 @@
 
 static inline unsigned long ___mem_isa(unsigned long a)
 {
-	if (a >= 16*1048576)
-		BUG();
+	BUG_ON(a >= 16*1048576);
 	return PCIMEM_BASE + a;
 }
 #define __mem_pci(a)		___mem_pci((unsigned long)(a))
diff -Nru a/include/asm-arm/arch-pxa/udc.h b/include/asm-arm/arch-pxa/udc.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-arm/arch-pxa/udc.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,18 @@
+/*
+ * linux/include/asm-arm/arch-pxa/udc.h
+ *
+ * This supports machine-specific differences in how the PXA2xx
+ * USB Device Controller (UDC) is wired.
+ *
+ * It is set in linux/arch/arm/mach-pxa/<machine>.c and used in
+ * the probe routine of linux/drivers/usb/gadget/pxa2xx_udc.c
+ */
+struct pxa2xx_udc_mach_info {
+        int  (*udc_is_connected)(void);		/* do we see host? */
+        void (*udc_command)(int cmd);
+#define	PXA2XX_UDC_CMD_CONNECT		0	/* let host see us */
+#define	PXA2XX_UDC_CMD_DISCONNECT	1	/* so host won't see us */
+};
+
+extern void pxa_set_udc_info(struct pxa2xx_udc_mach_info *info);
+
diff -Nru a/include/asm-arm/arch-sa1100/cerf.h b/include/asm-arm/arch-sa1100/cerf.h
--- a/include/asm-arm/arch-sa1100/cerf.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-arm/arch-sa1100/cerf.h	Tue Feb  3 19:45:43 2004
@@ -1,110 +1,29 @@
+/*
+ * include/asm-arm/arch-sa1100/cerf.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Apr-2003 : Removed some old PDA crud [FB]
+ */
 #ifndef _INCLUDE_CERF_H_
 #define _INCLUDE_CERF_H_
 
 #include <linux/config.h>
 
-#ifdef CONFIG_SA1100_CERF_CPLD
+#define CERF_ETH_IO			0xf0000000
+#define CERF_ETH_IRQ IRQ_GPIO26
 
-
-// Map sa1100fb.c to sa1100_frontlight.c - Not pretty, but necessary.
-#define CERF_BACKLIGHT_ENABLE   sa1100_fl_enable
-#define CERF_BACKLIGHT_DISABLE  sa1100_fl_disable
-
-//
-// IO Pins for devices
-//
-
-#define CERF_PDA_CPLD             0xf1000000
-#define CERF_PDA_CPLD_WRCLRINT    (0x0)
-#define CERF_PDA_CPLD_BACKLIGHT   (0x2)
-#define CERF_PDA_CPLD_SOUND_FREQ  (0x4)
-#define CERF_PDA_CPLD_KEYPAD_A    (0x6)
-#define CERF_PDA_CPLD_BATTFAULT   (0x8)
-#define CERF_PDA_CPLD_KEYPAD_B    (0xa)
-#define CERF_PDA_CPLD_SOUND_ENA   (0xc)
-#define CERF_PDA_CPLD_SOUND_RESET (0xe)
-
-#define GPIO_CF_BVD2              GPIO_GPIO (5)
-#define GPIO_CF_BVD1              GPIO_GPIO (6)
-#define GPIO_CF_RESET             GPIO_GPIO (7)
-#define GPIO_CF_IRQ               GPIO_GPIO (8)
-#define GPIO_CF_CD                GPIO_GPIO (9)
-
-#define GPIO_PWR_SHUTDOWN         GPIO_GPIO (25)
-
-#define UCB1200_GPIO_CONT_CS      0x0001
-#define UCB1200_GPIO_CONT_DOWN    0x0002
-#define UCB1200_GPIO_CONT_INC     0x0004
-#define UCB1200_GPIO_CONT_ENA     0x0008
-#define UCB1200_GPIO_LCD_RESET    0x0010
-#define UCB1200_GPIO_IRDA_ENABLE  0x0020
-#define UCB1200_GPIO_BT_ENABLE    0x0040
-#define UCB1200_GPIO_L3_DATA      0x0080
-#define UCB1200_GPIO_L3_CLOCK     0x0100
-#define UCB1200_GPIO_L3_MODE      0x0200
-
-//
-// IRQ for devices
-//
-
-#define IRQ_UCB1200_CONT_CS     IRQ_UCB1200_IO0
-#define IRQ_UCB1200_CONT_DOWN   IRQ_UCB1200_IO1
-#define IRQ_UCB1200_CONT_INC    IRQ_UCB1200_IO2
-#define IRQ_UCB1200_CONT_ENA    IRQ_UCB1200_IO3
-#define IRQ_UCB1200_LCD_RESET   IRQ_UCB1200_IO4
-#define IRQ_UCB1200_IRDA_ENABLE IRQ_UCB1200_IO5
-#define IRQ_UCB1200_BT_ENABLE   IRQ_UCB1200_IO6
-#define IRQ_UCB1200_L3_DATA     IRQ_UCB1200_IO7
-#define IRQ_UCB1200_L3_CLOCK    IRQ_UCB1200_IO8
-#define IRQ_UCB1200_L3_MODE     IRQ_UCB1200_IO9
-
-#define IRQ_GPIO_CF_BVD2        IRQ_GPIO5
-#define IRQ_GPIO_CF_BVD1        IRQ_GPIO6
-#define IRQ_GPIO_CF_IRQ         IRQ_GPIO8
-#define IRQ_GPIO_CF_CD          IRQ_GPIO9
-
-//
-// Device parameters
-//
-
-#define CERF_PDA_CPLD_SOUND_FREQ_8000  (0x01)
-#define CERF_PDA_CPLD_SOUND_FREQ_11025 (0x05)
-#define CERF_PDA_CPLD_SOUND_FREQ_16000 (0x02)
-#define CERF_PDA_CPLD_SOUND_FREQ_22050 (0x06)
-#define CERF_PDA_CPLD_SOUND_FREQ_32000 (0x03)
-#define CERF_PDA_CPLD_SOUND_FREQ_44100 (0x07)
-#define CERF_PDA_CPLD_SOUND_FREQ_48000 (0x0b)
-
-//
-// General Functions
-//
-
-#define CERF_PDA_CPLD_Get(x, y)      (*((char*)(CERF_PDA_CPLD + (x))) & (y))
-#define CERF_PDA_CPLD_Set(x, y, z)   (*((char*)(CERF_PDA_CPLD + (x))) = (*((char*)(CERF_PDA_CPLD + (x))) & ~(z)) | (y))
-#define CERF_PDA_CPLD_UnSet(x, y, z) (*((char*)(CERF_PDA_CPLD + (x))) = (*((char*)(CERF_PDA_CPLD + (x))) & ~(z)) & ~(y))
-
-
-#else // CONFIG_SA1100_CERF_CPLD
-
-
-#define GPIO_CF_BVD2            GPIO_GPIO (19)
-#define GPIO_CF_BVD1            GPIO_GPIO (20)
-#define GPIO_CF_RESET           0
-#define GPIO_CF_IRQ             GPIO_GPIO (22)
-#define GPIO_CF_CD              GPIO_GPIO (23)
-
-#define GPIO_LCD_RESET          GPIO_GPIO (15)
-
-#define IRQ_GPIO_CF_BVD2        IRQ_GPIO19
-#define IRQ_GPIO_CF_BVD1        IRQ_GPIO20
-#define IRQ_GPIO_CF_IRQ         IRQ_GPIO22
-#define IRQ_GPIO_CF_CD          IRQ_GPIO23
-
-
-#endif // CONFIG_SA1100_CERF_CPLD
-
-
-#define GPIO_UCB1200_IRQ        GPIO_GPIO (18)
-#define IRQ_GPIO_UCB1200_IRQ    IRQ_GPIO18
+#define CERF_GPIO_CF_BVD2		GPIO_GPIO (19)
+#define CERF_GPIO_CF_BVD1		GPIO_GPIO (20)
+#define CERF_GPIO_CF_RESET		GPIO_GPIO (21)
+#define CERF_GPIO_CF_IRQ		GPIO_GPIO (22)
+#define CERF_GPIO_CF_CD			GPIO_GPIO (23)
+
+#define CERF_IRQ_GPIO_CF_BVD2		IRQ_GPIO19
+#define CERF_IRQ_GPIO_CF_BVD1		IRQ_GPIO20
+#define CERF_IRQ_GPIO_CF_IRQ		IRQ_GPIO22
+#define CERF_IRQ_GPIO_CF_CD		IRQ_GPIO23
 
 #endif // _INCLUDE_CERF_H_
diff -Nru a/include/asm-arm/arch-sa1100/keyboard.h b/include/asm-arm/arch-sa1100/keyboard.h
--- a/include/asm-arm/arch-sa1100/keyboard.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-arm/arch-sa1100/keyboard.h	Tue Feb  3 19:45:17 2004
@@ -11,7 +11,6 @@
 
 extern void gc_kbd_init_hw(void);
 extern void smartio_kbd_init_hw(void);
-extern void cerf_kbd_init_hw(void);
 
 static inline void kbd_init_hw(void)
 {
@@ -19,10 +18,6 @@
 		gc_kbd_init_hw();
 	if (machine_is_adsbitsy())
 		smartio_kbd_init_hw();
-#ifdef CONFIG_SA1100_CERF_CPLD
-	if (machine_is_cerf())
-		cerf_kbd_init_hw();
-#endif
 }
 
 #endif  /* _SA1100_KEYBOARD_H */
diff -Nru a/include/asm-arm/assembler.h b/include/asm-arm/assembler.h
--- a/include/asm-arm/assembler.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-arm/assembler.h	Tue Feb  3 19:45:16 2004
@@ -25,11 +25,25 @@
 #ifndef __ARMEB__
 #define pull            lsr
 #define push            lsl
-#define byte(x)         (x*8)
+#define get_byte_0      lsl #0
+#define get_byte_1	lsr #8
+#define get_byte_2	lsr #16
+#define get_byte_3	lsr #24
+#define put_byte_0      lsl #0
+#define put_byte_1	lsl #8
+#define put_byte_2	lsl #16
+#define put_byte_3	lsl #24
 #else
 #define pull            lsl
 #define push            lsr
-#define byte(x)         ((3-x)*8)
+#define get_byte_0	lsr #24
+#define get_byte_1	lsr #16
+#define get_byte_2	lsr #8
+#define get_byte_3      lsl #0
+#define put_byte_0	lsl #24
+#define put_byte_1	lsl #16
+#define put_byte_2	lsl #8
+#define put_byte_3      lsl #0
 #endif
 
 /*
diff -Nru a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h
--- a/include/asm-arm/bitops.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-arm/bitops.h	Tue Feb  3 19:45:16 2004
@@ -29,7 +29,7 @@
  *
  * First, the atomic bitops. These use native endian.
  */
-static inline void ____atomic_set_bit(unsigned int bit, unsigned long *p)
+static inline void ____atomic_set_bit(unsigned int bit, volatile unsigned long *p)
 {
 	unsigned long flags;
 	unsigned long mask = 1UL << (bit & 31);
@@ -41,7 +41,7 @@
 	local_irq_restore(flags);
 }
 
-static inline void ____atomic_clear_bit(unsigned int bit, unsigned long *p)
+static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long *p)
 {
 	unsigned long flags;
 	unsigned long mask = 1UL << (bit & 31);
@@ -53,7 +53,7 @@
 	local_irq_restore(flags);
 }
 
-static inline void ____atomic_change_bit(unsigned int bit, unsigned long *p)
+static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned long *p)
 {
 	unsigned long flags;
 	unsigned long mask = 1UL << (bit & 31);
@@ -66,7 +66,7 @@
 }
 
 static inline int
-____atomic_test_and_set_bit(unsigned int bit, unsigned long *p)
+____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p)
 {
 	unsigned long flags;
 	unsigned int res;
@@ -83,7 +83,7 @@
 }
 
 static inline int
-____atomic_test_and_clear_bit(unsigned int bit, unsigned long *p)
+____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
 {
 	unsigned long flags;
 	unsigned int res;
@@ -100,7 +100,7 @@
 }
 
 static inline int
-____atomic_test_and_change_bit(unsigned int bit, unsigned long *p)
+____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p)
 {
 	unsigned long flags;
 	unsigned int res;
@@ -171,7 +171,7 @@
 /*
  * This routine doesn't need to be atomic.
  */
-static inline int __test_bit(int nr, const unsigned long * p)
+static inline int __test_bit(int nr, const volatile unsigned long * p)
 {
 	return (p[nr >> 5] >> (nr & 31)) & 1UL;
 }
@@ -204,24 +204,24 @@
 /*
  * Little endian assembly bitops.  nr = 0 -> byte 0 bit 0.
  */
-extern void _set_bit_le(int nr, unsigned long * p);
-extern void _clear_bit_le(int nr, unsigned long * p);
-extern void _change_bit_le(int nr, unsigned long * p);
-extern int _test_and_set_bit_le(int nr, unsigned long * p);
-extern int _test_and_clear_bit_le(int nr, unsigned long * p);
-extern int _test_and_change_bit_le(int nr, unsigned long * p);
+extern void _set_bit_le(int nr, volatile unsigned long * p);
+extern void _clear_bit_le(int nr, volatile unsigned long * p);
+extern void _change_bit_le(int nr, volatile unsigned long * p);
+extern int _test_and_set_bit_le(int nr, volatile unsigned long * p);
+extern int _test_and_clear_bit_le(int nr, volatile unsigned long * p);
+extern int _test_and_change_bit_le(int nr, volatile unsigned long * p);
 extern int _find_first_zero_bit_le(void * p, unsigned size);
 extern int _find_next_zero_bit_le(void * p, int size, int offset);
 
 /*
  * Big endian assembly bitops.  nr = 0 -> byte 3 bit 0.
  */
-extern void _set_bit_be(int nr, unsigned long * p);
-extern void _clear_bit_be(int nr, unsigned long * p);
-extern void _change_bit_be(int nr, unsigned long * p);
-extern int _test_and_set_bit_be(int nr, unsigned long * p);
-extern int _test_and_clear_bit_be(int nr, unsigned long * p);
-extern int _test_and_change_bit_be(int nr, unsigned long * p);
+extern void _set_bit_be(int nr, volatile unsigned long * p);
+extern void _clear_bit_be(int nr, volatile unsigned long * p);
+extern void _change_bit_be(int nr, volatile unsigned long * p);
+extern int _test_and_set_bit_be(int nr, volatile unsigned long * p);
+extern int _test_and_clear_bit_be(int nr, volatile unsigned long * p);
+extern int _test_and_change_bit_be(int nr, volatile unsigned long * p);
 extern int _find_first_zero_bit_be(void * p, unsigned size);
 extern int _find_next_zero_bit_be(void * p, int size, int offset);
 
diff -Nru a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h
--- a/include/asm-arm/cacheflush.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-arm/cacheflush.h	Tue Feb  3 19:45:42 2004
@@ -209,8 +209,21 @@
 
 #endif
 
+/*
+ * flush_cache_vmap() is used when creating mappings (eg, via vmap,
+ * vmalloc, ioremap etc) in kernel space for pages.  Since the
+ * direct-mappings of these pages may contain cached data, we need
+ * to do a full cache flush to ensure that writebacks don't corrupt
+ * data placed into these pages via the new mappings.
+ */
 #define flush_cache_vmap(start, end)		flush_cache_all()
 #define flush_cache_vunmap(start, end)		flush_cache_all()
+
+/*
+ * Copy user data from/to a page which is mapped into a different
+ * processes address space.  Really, we want to allow our "user
+ * space" model to handle this.
+ */
 #define copy_to_user_page(vma, page, vaddr, dst, src, len) \
 do { memcpy(dst, src, len); \
      flush_icache_user_range(vma, page, vaddr, len); \
diff -Nru a/include/asm-arm/mach/arch.h b/include/asm-arm/mach/arch.h
--- a/include/asm-arm/mach/arch.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-arm/mach/arch.h	Tue Feb  3 19:45:42 2004
@@ -12,7 +12,7 @@
  * The size of struct machine_desc
  *   (for assembler code)
  */
-#define SIZEOF_MACHINE_DESC	48
+#define SIZEOF_MACHINE_DESC	52
 
 #ifndef __ASSEMBLY__
 
@@ -45,6 +45,7 @@
 					 struct meminfo *);
 	void			(*map_io)(void);/* IO mapping function	*/
 	void			(*init_irq)(void);
+	void			(*init_machine)(void);
 };
 
 /*
@@ -85,6 +86,9 @@
 
 #define INITIRQ(_func)				\
 	.init_irq	= _func,
+
+#define INIT_MACHINE(_func)			\
+	.init_machine	= _func,
 
 #define MACHINE_END				\
 };
diff -Nru a/include/asm-arm/socket.h b/include/asm-arm/socket.h
--- a/include/asm-arm/socket.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-arm/socket.h	Tue Feb  3 19:45:17 2004
@@ -45,6 +45,8 @@
 
 #define SO_ACCEPTCONN		30
 
+#define SO_PEERSEC		31
+
 /* Nast libc5 fixup - bletch */
 #if defined(__KERNEL__)
 /* Socket types. */
diff -Nru a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h
--- a/include/asm-arm/thread_info.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-arm/thread_info.h	Tue Feb  3 19:45:17 2004
@@ -51,8 +51,9 @@
 	__u32			cpu;		/* cpu */
 	__u32			cpu_domain;	/* cpu domain */
 	struct cpu_context_save	cpu_context;	/* cpu context */
-	struct restart_block    restart_block;
+	__u8			used_cp[16];	/* thread used copro */
 	union fp_state		fpstate;
+	struct restart_block    restart_block;
 };
 
 #define INIT_THREAD_INFO(tsk)						\
@@ -107,7 +108,8 @@
 #define TI_CPU		20
 #define TI_CPU_DOMAIN	24
 #define TI_CPU_SAVE	28
-#define TI_FPSTATE	76
+#define TI_USED_MATH	76
+#define TI_FPSTATE	(TI_USED_MATH+16)
 
 #endif
 
diff -Nru a/include/asm-arm26/socket.h b/include/asm-arm26/socket.h
--- a/include/asm-arm26/socket.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-arm26/socket.h	Tue Feb  3 19:45:43 2004
@@ -45,6 +45,8 @@
 
 #define SO_ACCEPTCONN		30
 
+#define SO_PEERSEC		31
+
 /* Nast libc5 fixup - bletch */
 #if defined(__KERNEL__)
 /* Socket types. */
diff -Nru a/include/asm-cris/arch-v10/byteorder.h b/include/asm-cris/arch-v10/byteorder.h
--- a/include/asm-cris/arch-v10/byteorder.h	Tue Feb  3 19:45:35 2004
+++ b/include/asm-cris/arch-v10/byteorder.h	Tue Feb  3 19:45:35 2004
@@ -2,20 +2,21 @@
 #define _CRIS_ARCH_BYTEORDER_H
 
 #include <asm/types.h>
+#include <linux/compiler.h>
 
 /* we just define these two (as we can do the swap in a single
  * asm instruction in CRIS) and the arch-independent files will put
  * them together into ntohl etc.
  */
 
-extern __inline__ __const__ __u32 ___arch__swab32(__u32 x)
+extern __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
 {
 	__asm__ ("swapwb %0" : "=r" (x) : "0" (x));
   
 	return(x);
 }
 
-extern __inline__ __const__ __u16 ___arch__swab16(__u16 x)
+extern __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 x)
 {
 	__asm__ ("swapb %0" : "=r" (x) : "0" (x));
 	
diff -Nru a/include/asm-cris/socket.h b/include/asm-cris/socket.h
--- a/include/asm-cris/socket.h	Tue Feb  3 19:45:41 2004
+++ b/include/asm-cris/socket.h	Tue Feb  3 19:45:41 2004
@@ -47,6 +47,8 @@
 
 #define SO_ACCEPTCONN          30
 
+#define SO_PEERSEC             31
+
 #if defined(__KERNEL__)
 /* Socket types. */
 #define SOCK_STREAM     1               /* stream (connection) socket   */
diff -Nru a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
--- a/include/asm-generic/percpu.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-generic/percpu.h	Tue Feb  3 19:45:17 2004
@@ -29,7 +29,7 @@
 #define DEFINE_PER_CPU(type, name) \
     __typeof__(type) per_cpu__##name
 
-#define per_cpu(var, cpu)			((void)cpu, per_cpu__##var)
+#define per_cpu(var, cpu)			(*((void)cpu, &per_cpu__##var))
 #define __get_cpu_var(var)			per_cpu__##var
 
 #endif	/* SMP */
diff -Nru a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
--- a/include/asm-generic/pgtable.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-generic/pgtable.h	Tue Feb  3 19:45:17 2004
@@ -1,6 +1,23 @@
 #ifndef _ASM_GENERIC_PGTABLE_H
 #define _ASM_GENERIC_PGTABLE_H
 
+#ifndef __HAVE_ARCH_PTEP_ESTABLISH
+/*
+ * Establish a new mapping:
+ *  - flush the old one
+ *  - update the page tables
+ *  - inform the TLB about the new one
+ *
+ * We hold the mm semaphore for reading and vma->vm_mm->page_table_lock
+ */
+#define ptep_establish(__vma, __address, __ptep, __entry)		\
+do {									\
+	set_pte(__ptep, __entry);					\
+	flush_tlb_page(__vma, __address);				\
+} while (0)
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
 static inline int ptep_test_and_clear_young(pte_t *ptep)
 {
 	pte_t pte = *ptep;
@@ -9,7 +26,19 @@
 	set_pte(ptep, pte_mkold(pte));
 	return 1;
 }
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
+#define ptep_clear_flush_young(__vma, __address, __ptep)		\
+({									\
+	int __young = ptep_test_and_clear_young(__ptep);		\
+	if (__young)							\
+		flush_tlb_page(__vma, __address);			\
+	__young;							\
+})
+#endif
 
+#ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
 static inline int ptep_test_and_clear_dirty(pte_t *ptep)
 {
 	pte_t pte = *ptep;
@@ -18,26 +47,62 @@
 	set_pte(ptep, pte_mkclean(pte));
 	return 1;
 }
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH
+#define ptep_clear_flush_dirty(__vma, __address, __ptep)		\
+({									\
+	int __dirty = ptep_test_and_clear_dirty(__ptep);		\
+	if (__dirty)							\
+		flush_tlb_page(__vma, __address);			\
+	__dirty;							\
+})
+#endif
 
+#ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR
 static inline pte_t ptep_get_and_clear(pte_t *ptep)
 {
 	pte_t pte = *ptep;
 	pte_clear(ptep);
 	return pte;
 }
+#endif
 
+#ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH
+#define ptep_clear_flush(__vma, __address, __ptep)			\
+({									\
+	pte_t __pte = ptep_get_and_clear(__ptep);			\
+	flush_tlb_page(__vma, __address);				\
+	__pte;								\
+})
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT
 static inline void ptep_set_wrprotect(pte_t *ptep)
 {
 	pte_t old_pte = *ptep;
 	set_pte(ptep, pte_wrprotect(old_pte));
 }
+#endif
 
+#ifndef __HAVE_ARCH_PTEP_MKDIRTY
 static inline void ptep_mkdirty(pte_t *ptep)
 {
 	pte_t old_pte = *ptep;
 	set_pte(ptep, pte_mkdirty(old_pte));
 }
+#endif
 
+#ifndef __HAVE_ARCH_PTE_SAME
 #define pte_same(A,B)	(pte_val(A) == pte_val(B))
+#endif
+
+#ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY
+#define page_test_and_clear_dirty(page) (0)
+#endif
+
+#ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG
+#define page_test_and_clear_young(page) (0)
+#endif
 
 #endif /* _ASM_GENERIC_PGTABLE_H */
diff -Nru a/include/asm-h8300/socket.h b/include/asm-h8300/socket.h
--- a/include/asm-h8300/socket.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-h8300/socket.h	Tue Feb  3 19:45:30 2004
@@ -45,6 +45,8 @@
 
 #define SO_ACCEPTCONN		30
 
+#define SO_PEERSEC		31
+
 /* Nast libc5 fixup - bletch */
 #if defined(__KERNEL__)
 /* Socket types. */
diff -Nru a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h
--- a/include/asm-i386/acpi.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-i386/acpi.h	Tue Feb  3 19:45:42 2004
@@ -109,7 +109,7 @@
 #ifdef CONFIG_ACPI_BOOT 
 extern int acpi_lapic;
 extern int acpi_ioapic;
-
+extern int acpi_noirq;
 
 /* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */
 #define FIX_ACPI_PAGES 4
@@ -137,6 +137,14 @@
 #  define acpi_lapic 0
 #  define acpi_ioapic 0
 
+#endif
+
+#ifdef CONFIG_ACPI_PCI
+static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
+extern int acpi_irq_balance_set(char *str);
+#else
+static inline void acpi_noirq_set(void) { }
+static inline int acpi_irq_balance_set(char *str) { return 0; }
 #endif
 
 #ifdef CONFIG_ACPI_SLEEP
diff -Nru a/include/asm-i386/byteorder.h b/include/asm-i386/byteorder.h
--- a/include/asm-i386/byteorder.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-i386/byteorder.h	Tue Feb  3 19:45:30 2004
@@ -2,6 +2,7 @@
 #define _I386_BYTEORDER_H
 
 #include <asm/types.h>
+#include <linux/compiler.h>
 
 #ifdef __GNUC__
 
@@ -10,7 +11,7 @@
 #include <linux/config.h>
 #endif
 
-static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
+static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
 {
 #ifdef CONFIG_X86_BSWAP
 	__asm__("bswap %0" : "=r" (x) : "0" (x));
@@ -24,18 +25,7 @@
 	return x;
 }
 
-/* gcc should generate this for open coded C now too. May be worth switching to 
-   it because inline assembly cannot be scheduled. -AK */
-static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
-{
-	__asm__("xchgb %b0,%h0"		/* swap bytes		*/
-		: "=q" (x)
-		:  "0" (x));
-		return x;
-}
-
-
-static inline __u64 ___arch__swab64(__u64 val) 
+static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 val)
 { 
 	union { 
 		struct { __u32 a,b; } s;
@@ -54,9 +44,11 @@
 	return v.u;	
 } 
 
+/* Do not define swab16.  Gcc is smart enough to recognize "C" version and
+   convert it into rotation or exhange.  */
+
 #define __arch__swab64(x) ___arch__swab64(x)
 #define __arch__swab32(x) ___arch__swab32(x)
-#define __arch__swab16(x) ___arch__swab16(x)
 
 #define __BYTEORDER_HAS_U64__
 
diff -Nru a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h
--- a/include/asm-i386/floppy.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-i386/floppy.h	Tue Feb  3 19:45:17 2004
@@ -32,7 +32,7 @@
 
 
 #define fd_inb(port)			inb_p(port)
-#define fd_outb(port,value)		outb_p(port,value)
+#define fd_outb(value,port)		outb_p(value,port)
 
 #define fd_request_dma()        CSW._request_dma(FLOPPY_DMA,"floppy")
 #define fd_free_dma()           CSW._free_dma(FLOPPY_DMA)
diff -Nru a/include/asm-i386/genapic.h b/include/asm-i386/genapic.h
--- a/include/asm-i386/genapic.h	Tue Feb  3 19:45:29 2004
+++ b/include/asm-i386/genapic.h	Tue Feb  3 19:45:29 2004
@@ -45,6 +45,7 @@
 	void (*setup_portio_remap)(void); 
 	int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
 	void (*enable_apic_mode)(void);
+	u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
 
 	/* mpparse */
 	void (*mpc_oem_bus_info)(struct mpc_config_bus *, char *, 
@@ -105,6 +106,7 @@
 	APICFUNC(send_IPI_allbutself), \
 	APICFUNC(send_IPI_all), \
 	APICFUNC(enable_apic_mode), \
+	APICFUNC(phys_pkg_id), \
 	}
 
 extern struct genapic *genapic;
diff -Nru a/include/asm-i386/hpet.h b/include/asm-i386/hpet.h
--- a/include/asm-i386/hpet.h	Tue Feb  3 19:45:29 2004
+++ b/include/asm-i386/hpet.h	Tue Feb  3 19:45:29 2004
@@ -54,13 +54,9 @@
 #define HPET_T2_CMP	0x148
 #define HPET_T2_ROUTE	0x150
 
-#define HPET_ID_VENDOR	0xffff0000
 #define HPET_ID_LEGSUP	0x00008000
 #define HPET_ID_NUMBER	0x00001f00
 #define HPET_ID_REV	0x000000ff
-
-#define HPET_ID_VENDOR_SHIFT	16
-#define HPET_ID_VENDOR_8086	0x8086
 
 #define HPET_CFG_ENABLE	0x001
 #define HPET_CFG_LEGACY	0x002
diff -Nru a/include/asm-i386/mach-bigsmp/mach_apic.h b/include/asm-i386/mach-bigsmp/mach_apic.h
--- a/include/asm-i386/mach-bigsmp/mach_apic.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-i386/mach-bigsmp/mach_apic.h	Tue Feb  3 19:45:42 2004
@@ -173,4 +173,9 @@
 	return apicid;
 }
 
+static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
+{
+	return cpuid_apic >> index_msb;
+}
+
 #endif /* __ASM_MACH_APIC_H */
diff -Nru a/include/asm-i386/mach-default/mach_apic.h b/include/asm-i386/mach-default/mach_apic.h
--- a/include/asm-i386/mach-default/mach_apic.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-i386/mach-default/mach_apic.h	Tue Feb  3 19:45:43 2004
@@ -127,4 +127,9 @@
 {
 }
 
+static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
+{
+	return cpuid_apic >> index_msb;
+}
+
 #endif /* __ASM_MACH_APIC_H */
diff -Nru a/include/asm-i386/mach-es7000/mach_apic.h b/include/asm-i386/mach-es7000/mach_apic.h
--- a/include/asm-i386/mach-es7000/mach_apic.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-i386/mach-es7000/mach_apic.h	Tue Feb  3 19:45:16 2004
@@ -192,4 +192,9 @@
 	return apicid;
 }
 
+static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
+{
+	return cpuid_apic >> index_msb;
+}
+
 #endif /* __ASM_MACH_APIC_H */
diff -Nru a/include/asm-i386/mach-generic/mach_apic.h b/include/asm-i386/mach-generic/mach_apic.h
--- a/include/asm-i386/mach-generic/mach_apic.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-i386/mach-generic/mach_apic.h	Tue Feb  3 19:45:17 2004
@@ -27,5 +27,6 @@
 #define check_apicid_used (genapic->check_apicid_used)
 #define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid)
 #define enable_apic_mode (genapic->enable_apic_mode)
+#define phys_pkg_id (genapic->phys_pkg_id)
 
 #endif /* __ASM_MACH_APIC_H */
diff -Nru a/include/asm-i386/mach-numaq/mach_apic.h b/include/asm-i386/mach-numaq/mach_apic.h
--- a/include/asm-i386/mach-numaq/mach_apic.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-i386/mach-numaq/mach_apic.h	Tue Feb  3 19:45:17 2004
@@ -141,4 +141,10 @@
 	return (int) 0xF;
 }
 
+/* No NUMA-Q box has a HT CPU, but it can't hurt to use the default code. */
+static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
+{
+	return cpuid_apic >> index_msb;
+}
+
 #endif /* __ASM_MACH_APIC_H */
diff -Nru a/include/asm-i386/mach-summit/mach_apic.h b/include/asm-i386/mach-summit/mach_apic.h
--- a/include/asm-i386/mach-summit/mach_apic.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-i386/mach-summit/mach_apic.h	Tue Feb  3 19:45:30 2004
@@ -173,4 +173,15 @@
 	return apicid;
 }
 
+/* cpuid returns the value latched in the HW at reset, not the APIC ID
+ * register's value.  For any box whose BIOS changes APIC IDs, like
+ * clustered APIC systems, we must use hard_smp_processor_id.
+ *
+ * See Intel's IA-32 SW Dev's Manual Vol2 under CPUID.
+ */
+static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
+{
+	return hard_smp_processor_id() >> index_msb;
+}
+
 #endif /* __ASM_MACH_APIC_H */
diff -Nru a/include/asm-i386/mach-visws/mach_apic.h b/include/asm-i386/mach-visws/mach_apic.h
--- a/include/asm-i386/mach-visws/mach_apic.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-i386/mach-visws/mach_apic.h	Tue Feb  3 19:45:16 2004
@@ -88,4 +88,10 @@
 {
 	return cpus_coerce_const(cpumask);
 }
+
+static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
+{
+	return cpuid_apic >> index_msb;
+}
+
 #endif /* __ASM_MACH_APIC_H */
diff -Nru a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
--- a/include/asm-i386/pgtable.h	Tue Feb  3 19:45:35 2004
+++ b/include/asm-i386/pgtable.h	Tue Feb  3 19:45:35 2004
@@ -341,4 +341,12 @@
 
 #define io_remap_page_range remap_page_range
 
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
+#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
+#define __HAVE_ARCH_PTEP_SET_WRPROTECT
+#define __HAVE_ARCH_PTEP_MKDIRTY
+#define __HAVE_ARCH_PTE_SAME
+#include <asm-generic/pgtable.h>
+
 #endif /* _I386_PGTABLE_H */
diff -Nru a/include/asm-i386/smp.h b/include/asm-i386/smp.h
--- a/include/asm-i386/smp.h	Tue Feb  3 19:45:29 2004
+++ b/include/asm-i386/smp.h	Tue Feb  3 19:45:29 2004
@@ -53,8 +53,7 @@
 #define smp_processor_id() (current_thread_info()->cpu)
 
 extern cpumask_t cpu_callout_map;
-
-#define cpu_possible(cpu) cpu_isset(cpu, cpu_callout_map)
+#define cpu_possible_map cpu_callout_map
 
 /* We don't mark CPUs online until __cpu_up(), so we need another measure */
 static inline int num_booting_cpus(void)
diff -Nru a/include/asm-i386/socket.h b/include/asm-i386/socket.h
--- a/include/asm-i386/socket.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-i386/socket.h	Tue Feb  3 19:45:17 2004
@@ -45,6 +45,8 @@
 
 #define SO_ACCEPTCONN		30
 
+#define SO_PEERSEC		31
+
 /* Nasty libc5 fixup - bletch */
 #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
 /* Socket types. */
diff -Nru a/include/asm-i386/system.h b/include/asm-i386/system.h
--- a/include/asm-i386/system.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-i386/system.h	Tue Feb  3 19:45:16 2004
@@ -470,6 +470,7 @@
 
 extern unsigned long dmi_broken;
 extern int is_sony_vaio_laptop;
+extern int es7000_plat;
 
 #define BROKEN_ACPI_Sx		0x0001
 #define BROKEN_INIT_AFTER_S1	0x0002
diff -Nru a/include/asm-ia64/a.out.h b/include/asm-ia64/a.out.h
--- a/include/asm-ia64/a.out.h	Tue Feb  3 19:45:41 2004
+++ b/include/asm-ia64/a.out.h	Tue Feb  3 19:45:41 2004
@@ -7,8 +7,8 @@
  * probably would be better to clean up binfmt_elf.c so it does not
  * necessarily depend on there being a.out support.
  *
- * Copyright (C) 1998-2002 Hewlett-Packard Co
- *	David Mosberger-Tang <davidm@hpl.hp.com>
+ * Modified 1998-2002
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
  */
 
 #include <linux/types.h>
diff -Nru a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h
--- a/include/asm-ia64/acpi.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ia64/acpi.h	Tue Feb  3 19:45:42 2004
@@ -30,6 +30,8 @@
 
 #ifdef __KERNEL__
 
+#include <linux/init.h>
+#include <linux/numa.h>
 #include <asm/system.h>
 
 #define COMPILER_DEPENDENT_INT64	long
@@ -92,7 +94,6 @@
 int acpi_irq_to_vector (u32 irq);
 
 #ifdef CONFIG_ACPI_NUMA
-#include <asm/numa.h>
 /* Proximity bitmap length; _PXM is at most 255 (8 bit)*/
 #define MAX_PXM_DOMAINS (256)
 extern int __initdata pxm_to_nid_map[MAX_PXM_DOMAINS];
diff -Nru a/include/asm-ia64/asmmacro.h b/include/asm-ia64/asmmacro.h
--- a/include/asm-ia64/asmmacro.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/asmmacro.h	Tue Feb  3 19:45:17 2004
@@ -2,7 +2,7 @@
 #define _ASM_IA64_ASMMACRO_H
 
 /*
- * Copyright (C) 2000-2001, 2003 Hewlett-Packard Co
+ * Copyright (C) 2000-2001, 2003-2004 Hewlett-Packard Co
  *	David Mosberger-Tang <davidm@hpl.hp.com>
  */
 
@@ -87,6 +87,17 @@
   }
 #else
 # define FSYS_RETURN	br.ret.sptk.many b6
+#endif
+
+/*
+ * Up until early 2004, use of .align within a function caused bad unwind info.
+ * TEXT_ALIGN(n) expands into ".align n" if a fixed GAS is available or into nothing
+ * otherwise.
+ */
+#ifdef HAVE_WORKING_TEXT_ALIGN
+# define TEXT_ALIGN(n)	.align n
+#else
+# define TEXT_ALIGN(n)
 #endif
 
 #endif /* _ASM_IA64_ASMMACRO_H */
diff -Nru a/include/asm-ia64/bugs.h b/include/asm-ia64/bugs.h
--- a/include/asm-ia64/bugs.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ia64/bugs.h	Tue Feb  3 19:45:42 2004
@@ -4,8 +4,10 @@
  * Needs:
  *	void check_bugs(void);
  *
- * Copyright (C) 1998, 1999, 2003 Hewlett-Packard Co
- *	David Mosberger-Tang <davidm@hpl.hp.com>
+ * Based on <asm-alpha/bugs.h>.
+ *
+ * Modified 1998, 1999, 2003
+ *	David Mosberger-Tang <davidm@hpl.hp.com>,  Hewlett-Packard Co.
  */
 #ifndef _ASM_IA64_BUGS_H
 #define _ASM_IA64_BUGS_H
diff -Nru a/include/asm-ia64/byteorder.h b/include/asm-ia64/byteorder.h
--- a/include/asm-ia64/byteorder.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/byteorder.h	Tue Feb  3 19:45:17 2004
@@ -2,14 +2,15 @@
 #define _ASM_IA64_BYTEORDER_H
 
 /*
- * Copyright (C) 1998, 1999 Hewlett-Packard Co
- * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Modified 1998, 1999
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
  */
 
 #include <asm/types.h>
 #include <asm/intrinsics.h>
+#include <linux/compiler.h>
 
-static __inline__ __const__ __u64
+static __inline__ __attribute_const__ __u64
 __ia64_swab64 (__u64 x)
 {
 	__u64 result;
@@ -18,13 +19,13 @@
 	return result;
 }
 
-static __inline__ __const__ __u32
+static __inline__ __attribute_const__ __u32
 __ia64_swab32 (__u32 x)
 {
 	return __ia64_swab64(x) >> 32;
 }
 
-static __inline__ __const__ __u16
+static __inline__ __attribute_const__ __u16
 __ia64_swab16(__u16 x)
 {
 	return __ia64_swab64(x) >> 48;
diff -Nru a/include/asm-ia64/checksum.h b/include/asm-ia64/checksum.h
--- a/include/asm-ia64/checksum.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ia64/checksum.h	Tue Feb  3 19:45:16 2004
@@ -2,8 +2,8 @@
 #define _ASM_IA64_CHECKSUM_H
 
 /*
- * Copyright (C) 1998, 1999 Hewlett-Packard Co
- * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Modified 1998, 1999
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
 /*
diff -Nru a/include/asm-ia64/current.h b/include/asm-ia64/current.h
--- a/include/asm-ia64/current.h	Tue Feb  3 19:45:40 2004
+++ b/include/asm-ia64/current.h	Tue Feb  3 19:45:40 2004
@@ -2,8 +2,8 @@
 #define _ASM_IA64_CURRENT_H
 
 /*
- * Copyright (C) 1998-2000 Hewlett-Packard Co
- *	David Mosberger-Tang <davidm@hpl.hp.com>
+ * Modified 1998-2000
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
 #include <asm/intrinsics.h>
diff -Nru a/include/asm-ia64/errno.h b/include/asm-ia64/errno.h
--- a/include/asm-ia64/errno.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/errno.h	Tue Feb  3 19:45:17 2004
@@ -1,13 +1 @@
-#ifndef _ASM_IA64_ERRNO_H
-#define _ASM_IA64_ERRNO_H
-
-/*
- * This is derived from the Linux/x86 version.
- *
- * Copyright (C) 1998, 1999, 2002 Hewlett-Packard Co
- *	David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
 #include <asm-generic/errno.h>
-
-#endif /* _ASM_IA64_ERRNO_H */
diff -Nru a/include/asm-ia64/fcntl.h b/include/asm-ia64/fcntl.h
--- a/include/asm-ia64/fcntl.h	Tue Feb  3 19:45:28 2004
+++ b/include/asm-ia64/fcntl.h	Tue Feb  3 19:45:28 2004
@@ -1,10 +1,10 @@
 #ifndef _ASM_IA64_FCNTL_H
 #define _ASM_IA64_FCNTL_H
 /*
- * This is mostly compatible with Linux/x86.
+ * Based on <asm-i386/fcntl.h>.
  *
- * Copyright (C) 1998-2000 Hewlett-Packard Co
- * Copyright (C) 1998-2000 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Modified 1998-2000
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
  */
 
 /*
diff -Nru a/include/asm-ia64/ioctl.h b/include/asm-ia64/ioctl.h
--- a/include/asm-ia64/ioctl.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/ioctl.h	Tue Feb  3 19:45:17 2004
@@ -2,10 +2,10 @@
 #define _ASM_IA64_IOCTL_H
 
 /*
- * This is mostly derived from the Linux/x86 version.
+ * Based on <asm-i386/ioctl.h>.
  *
- * Copyright (C) 1998, 1999 Hewlett-Packard Co
- * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Modified 1998, 1999
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
 /* ioctl command encoding: 32 bits total, command in lower 16 bits,
diff -Nru a/include/asm-ia64/ioctls.h b/include/asm-ia64/ioctls.h
--- a/include/asm-ia64/ioctls.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/ioctls.h	Tue Feb  3 19:45:17 2004
@@ -2,8 +2,10 @@
 #define _ASM_IA64_IOCTLS_H
 
 /*
- * Copyright (C) 1998, 1999, 2002 Hewlett-Packard Co
- *	David Mosberger-Tang <davidm@hpl.hp.com>
+ * Based on <asm-i386/ioctls.h>
+ *
+ * Modified 1998, 1999, 2002
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
 #include <asm/ioctl.h>
diff -Nru a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h
--- a/include/asm-ia64/machvec.h	Tue Feb  3 19:45:28 2004
+++ b/include/asm-ia64/machvec.h	Tue Feb  3 19:45:28 2004
@@ -28,6 +28,7 @@
 typedef void ia64_mv_cmci_handler_t (int, void *, struct pt_regs *);
 typedef void ia64_mv_log_print_t (void);
 typedef void ia64_mv_send_ipi_t (int, int, int, int);
+typedef void ia64_mv_timer_interrupt_t (int, void *, struct pt_regs *);
 typedef void ia64_mv_global_tlb_purge_t (unsigned long, unsigned long, unsigned long);
 typedef struct irq_desc *ia64_mv_irq_desc (unsigned int);
 typedef u8 ia64_mv_irq_to_vector (u8);
@@ -90,6 +91,7 @@
 #  define platform_cmci_handler	ia64_mv.cmci_handler
 #  define platform_log_print	ia64_mv.log_print
 #  define platform_send_ipi	ia64_mv.send_ipi
+#  define platform_timer_interrupt	ia64_mv.timer_interrupt
 #  define platform_global_tlb_purge	ia64_mv.global_tlb_purge
 #  define platform_dma_init		ia64_mv.dma_init
 #  define platform_dma_alloc_coherent	ia64_mv.dma_alloc_coherent
@@ -131,6 +133,7 @@
 	ia64_mv_cmci_handler_t *cmci_handler;
 	ia64_mv_log_print_t *log_print;
 	ia64_mv_send_ipi_t *send_ipi;
+	ia64_mv_timer_interrupt_t *timer_interrupt;
 	ia64_mv_global_tlb_purge_t *global_tlb_purge;
 	ia64_mv_dma_init *dma_init;
 	ia64_mv_dma_alloc_coherent *dma_alloc_coherent;
@@ -168,6 +171,7 @@
 	platform_cmci_handler,			\
 	platform_log_print,			\
 	platform_send_ipi,			\
+	platform_timer_interrupt,		\
 	platform_global_tlb_purge,		\
 	platform_dma_init,			\
 	platform_dma_alloc_coherent,		\
@@ -242,6 +246,9 @@
 #endif
 #ifndef platform_send_ipi
 # define platform_send_ipi	ia64_send_ipi	/* default to architected version */
+#endif
+#ifndef platform_timer_interrupt
+# define platform_timer_interrupt 	((ia64_mv_timer_interrupt_t *) machvec_noop)
 #endif
 #ifndef platform_global_tlb_purge
 # define platform_global_tlb_purge	ia64_global_tlb_purge /* default to architected version */
diff -Nru a/include/asm-ia64/machvec_sn1.h b/include/asm-ia64/machvec_sn1.h
--- a/include/asm-ia64/machvec_sn1.h	Tue Feb  3 19:45:33 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2002 Silicon Graphics, Inc.  All Rights Reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of version 2 of the GNU General Public License 
- * as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it would be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
- * 
- * Further, this software is distributed without any warranty that it is 
- * free of the rightful claim of any third person regarding infringement 
- * or the like.  Any license provided herein, whether implied or 
- * otherwise, applies only to this software file.  Patent licenses, if 
- * any, provided herein do not apply to combinations of this program with 
- * other software, or any other product whatsoever.
- * 
- * You should have received a copy of the GNU General Public 
- * License along with this program; if not, write the Free Software 
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- * 
- * Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 
- * Mountain View, CA  94043, or:
- * 
- * http://www.sgi.com 
- * 
- * For further information regarding this notice, see: 
- * 
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan
- */
-
-#ifndef _ASM_IA64_MACHVEC_SN1_h
-#define _ASM_IA64_MACHVEC_SN1_h
-
-extern ia64_mv_setup_t sn1_setup;
-extern ia64_mv_cpu_init_t sn_cpu_init;
-extern ia64_mv_irq_init_t sn1_irq_init;
-extern ia64_mv_send_ipi_t sn1_send_IPI;
-extern ia64_mv_global_tlb_purge_t sn1_global_tlb_purge;
-extern ia64_mv_inb_t sn1_inb;
-extern ia64_mv_inw_t sn1_inw;
-extern ia64_mv_inl_t sn1_inl;
-extern ia64_mv_outb_t sn1_outb;
-extern ia64_mv_outw_t sn1_outw;
-extern ia64_mv_outl_t sn1_outl;
-extern ia64_mv_dma_alloc_coherent	sn1_dma_alloc_coherent;
-extern ia64_mv_dma_free_coherent	sn1_dma_free_coherent;
-extern ia64_mv_dma_map_single		sn1_dma_map_single;
-extern ia64_mv_dma_unmap_single		sn1_dma_unmap_single;
-extern ia64_mv_dma_map_sg		sn1_dma_map_sg;
-extern ia64_mv_dma_unmap_sg		sn1_dma_unmap_sg;
-extern ia64_mv_dma_sync_single		sn1_dma_sync_single;
-extern ia64_mv_dma_sync_sg		sn1_dma_sync_sg;
-
-/*
- * This stuff has dual use!
- *
- * For a generic kernel, the macros are used to initialize the
- * platform's machvec structure.  When compiling a non-generic kernel,
- * the macros are used directly.
- */
-#define platform_name		"sn1"
-#define platform_setup		sn1_setup
-#define platform_cpu_init	sn_cpu_init
-#define platform_irq_init	sn1_irq_init
-#define platform_send_ipi	sn1_send_IPI
-#define platform_global_tlb_purge       sn1_global_tlb_purge
-#define platform_inb		sn1_inb
-#define platform_inw		sn1_inw
-#define platform_inl		sn1_inl
-#define platform_outb		sn1_outb
-#define platform_outw		sn1_outw
-#define platform_outl		sn1_outl
-#define platform_dma_init	machvec_noop
-#define platform_dma_alloc_coherent	sn1_dma_alloc_coherent
-#define platform_dma_free_coherent	sn1_dma_free_coherent
-#define platform_dma_map_single		sn1_dma_map_single
-#define platform_dma_unmap_single	sn1_dma_unmap_single
-#define platform_dma_map_sg		sn1_dma_map_sg
-#define platform_dma_unmap_sg		sn1_dma_unmap_sg
-#define platform_dma_sync_single	sn1_dma_sync_single
-#define platform_dma_sync_sg		sn1_dma_sync_sg
-
-#endif /* _ASM_IA64_MACHVEC_SN1_h */
diff -Nru a/include/asm-ia64/machvec_sn2.h b/include/asm-ia64/machvec_sn2.h
--- a/include/asm-ia64/machvec_sn2.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/machvec_sn2.h	Tue Feb  3 19:45:17 2004
@@ -37,6 +37,7 @@
 extern ia64_mv_cpu_init_t sn_cpu_init;
 extern ia64_mv_irq_init_t sn_irq_init;
 extern ia64_mv_send_ipi_t sn2_send_IPI;
+extern ia64_mv_timer_interrupt_t sn_timer_interrupt;
 extern ia64_mv_global_tlb_purge_t sn2_global_tlb_purge;
 extern ia64_mv_irq_desc sn_irq_desc;
 extern ia64_mv_irq_to_vector sn_irq_to_vector;
@@ -73,6 +74,7 @@
 #define platform_cpu_init		sn_cpu_init
 #define platform_irq_init		sn_irq_init
 #define platform_send_ipi		sn2_send_IPI
+#define platform_timer_interrupt	sn_timer_interrupt
 #define platform_global_tlb_purge       sn2_global_tlb_purge
 #define platform_pci_fixup		sn_pci_fixup
 #define platform_inb			__sn_inb
diff -Nru a/include/asm-ia64/mman.h b/include/asm-ia64/mman.h
--- a/include/asm-ia64/mman.h	Tue Feb  3 19:45:18 2004
+++ b/include/asm-ia64/mman.h	Tue Feb  3 19:45:18 2004
@@ -2,8 +2,10 @@
 #define _ASM_IA64_MMAN_H
 
 /*
- * Copyright (C) 1998-2000, 2002 Hewlett-Packard Co
- *	David Mosberger-Tang <davidm@hpl.hp.com>
+ * Based on <asm-i386/mman.h>.
+ *
+ * Modified 1998-2000, 2002
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
 #define PROT_READ	0x1		/* page can be read */
diff -Nru a/include/asm-ia64/mmzone.h b/include/asm-ia64/mmzone.h
--- a/include/asm-ia64/mmzone.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-ia64/mmzone.h	Tue Feb  3 19:45:43 2004
@@ -33,5 +33,7 @@
 #define page_to_pfn(page)	((unsigned long) (page - vmem_map))
 #define pfn_to_page(pfn)	(vmem_map + (pfn))
 
+#else /* CONFIG_DISCONTIGMEM */
+# define NR_MEMBLKS		1
 #endif /* CONFIG_DISCONTIGMEM */
 #endif /* _ASM_IA64_MMZONE_H */
diff -Nru a/include/asm-ia64/namei.h b/include/asm-ia64/namei.h
--- a/include/asm-ia64/namei.h	Tue Feb  3 19:45:37 2004
+++ b/include/asm-ia64/namei.h	Tue Feb  3 19:45:37 2004
@@ -2,8 +2,8 @@
 #define _ASM_IA64_NAMEI_H
 
 /*
- * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co
- *	David Mosberger-Tang <davidm@hpl.hp.com>
+ * Modified 1998, 1999, 2001
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
 #include <asm/ptrace.h>
diff -Nru a/include/asm-ia64/numa.h b/include/asm-ia64/numa.h
--- a/include/asm-ia64/numa.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/numa.h	Tue Feb  3 19:45:17 2004
@@ -16,7 +16,6 @@
 #ifdef CONFIG_NUMA
 
 #include <linux/cache.h>
-#include <linux/cache.h>
 #include <linux/cpumask.h>
 #include <linux/numa.h>
 #include <linux/smp.h>
@@ -24,8 +23,8 @@
 
 #include <asm/mmzone.h>
 
-extern volatile u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
-extern volatile cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
+extern u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
+extern cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
 
 /* Stuff below this line could be architecture independent */
 
diff -Nru a/include/asm-ia64/page.h b/include/asm-ia64/page.h
--- a/include/asm-ia64/page.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/page.h	Tue Feb  3 19:45:17 2004
@@ -145,7 +145,7 @@
 static __inline__ int
 get_order (unsigned long size)
 {
-	double d = size - 1;
+	long double d = size - 1;
 	long order;
 
 	order = ia64_getf_exp(d);
diff -Nru a/include/asm-ia64/param.h b/include/asm-ia64/param.h
--- a/include/asm-ia64/param.h	Tue Feb  3 19:45:18 2004
+++ b/include/asm-ia64/param.h	Tue Feb  3 19:45:18 2004
@@ -4,8 +4,10 @@
 /*
  * Fundamental kernel parameters.
  *
- * Copyright (C) 1998, 1999, 2002-2003 Hewlett-Packard Co
- *	David Mosberger-Tang <davidm@hpl.hp.com>
+ * Based on <asm-i386/param.h>.
+ *
+ * Modified 1998, 1999, 2002-2003
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
 #define EXEC_PAGESIZE	65536
diff -Nru a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h
--- a/include/asm-ia64/pgtable.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/pgtable.h	Tue Feb  3 19:45:17 2004
@@ -511,4 +511,12 @@
 #define FIXADDR_USER_START	GATE_ADDR
 #define FIXADDR_USER_END	(GATE_ADDR + 2*PERCPU_PAGE_SIZE)
 
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
+#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
+#define __HAVE_ARCH_PTEP_SET_WRPROTECT
+#define __HAVE_ARCH_PTEP_MKDIRTY
+#define __HAVE_ARCH_PTE_SAME
+#include <asm-generic/pgtable.h>
+
 #endif /* _ASM_IA64_PGTABLE_H */
diff -Nru a/include/asm-ia64/poll.h b/include/asm-ia64/poll.h
--- a/include/asm-ia64/poll.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-ia64/poll.h	Tue Feb  3 19:45:30 2004
@@ -2,10 +2,10 @@
 #define _ASM_IA64_POLL_H
 
 /*
- * poll(2) bit definitions.  Chosen to be compatible with Linux/x86.
+ * poll(2) bit definitions.  Based on <asm-i386/poll.h>.
  *
- * Copyright (C) 1998, 1999, 2002 Hewlett-Packard Co
- *	David Mosberger-Tang <davidm@hpl.hp.com>
+ * Modified 1998, 1999, 2002
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
 #define POLLIN		0x0001
diff -Nru a/include/asm-ia64/posix_types.h b/include/asm-ia64/posix_types.h
--- a/include/asm-ia64/posix_types.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/posix_types.h	Tue Feb  3 19:45:17 2004
@@ -6,8 +6,10 @@
  * be a little careful about namespace pollution etc.  Also, we cannot
  * assume GCC is being used.
  *
- * Copyright (C) 1998-2000, 2003 Hewlett-Packard Co
- *	David Mosberger-Tang <davidm@hpl.hp.com>
+ * Based on <asm-alpha/posix_types.h>.
+ *
+ * Modified 1998-2000, 2003
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
 typedef unsigned long	__kernel_ino_t;
diff -Nru a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
--- a/include/asm-ia64/processor.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/processor.h	Tue Feb  3 19:45:17 2004
@@ -53,12 +53,6 @@
  */
 #define TASK_UNMAPPED_BASE	(current->thread.map_base)
 
-/*
- * Bus types
- */
-#define MCA_bus 0
-#define MCA_bus__is_a_macro /* for versions in ksyms.c */
-
 #define IA64_THREAD_FPH_VALID	(__IA64_UL(1) << 0)	/* floating-point high state valid? */
 #define IA64_THREAD_DBG_VALID	(__IA64_UL(1) << 1)	/* debug registers valid? */
 #define IA64_THREAD_PM_VALID	(__IA64_UL(1) << 2)	/* performance registers valid? */
diff -Nru a/include/asm-ia64/resource.h b/include/asm-ia64/resource.h
--- a/include/asm-ia64/resource.h	Tue Feb  3 19:45:35 2004
+++ b/include/asm-ia64/resource.h	Tue Feb  3 19:45:35 2004
@@ -4,8 +4,10 @@
 /*
  * Resource limits
  *
- * Copyright (C) 1998, 1999 Hewlett-Packard Co
- * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Based on <asm-i386/resource.h>.
+ *
+ * Modified 1998, 1999
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
 #include <asm/ustack.h>
diff -Nru a/include/asm-ia64/scatterlist.h b/include/asm-ia64/scatterlist.h
--- a/include/asm-ia64/scatterlist.h	Tue Feb  3 19:45:28 2004
+++ b/include/asm-ia64/scatterlist.h	Tue Feb  3 19:45:28 2004
@@ -2,8 +2,8 @@
 #define _ASM_IA64_SCATTERLIST_H
 
 /*
- * Copyright (C) 1998-1999, 2001-2002 Hewlett-Packard Co
- *	David Mosberger-Tang <davidm@hpl.hp.com>
+ * Modified 1998-1999, 2001-2002
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
 struct scatterlist {
diff -Nru a/include/asm-ia64/siginfo.h b/include/asm-ia64/siginfo.h
--- a/include/asm-ia64/siginfo.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ia64/siginfo.h	Tue Feb  3 19:45:42 2004
@@ -2,8 +2,10 @@
 #define _ASM_IA64_SIGINFO_H
 
 /*
- * Copyright (C) 1998-2002 Hewlett-Packard Co
- *	David Mosberger-Tang <davidm@hpl.hp.com>
+ * Based on <asm-i386/siginfo.h>.
+ *
+ * Modified 1998-2002
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
 #define SI_PAD_SIZE	((SI_MAX_SIZE/sizeof(int)) - 4)
diff -Nru a/include/asm-ia64/signal.h b/include/asm-ia64/signal.h
--- a/include/asm-ia64/signal.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/signal.h	Tue Feb  3 19:45:17 2004
@@ -2,8 +2,8 @@
 #define _ASM_IA64_SIGNAL_H
 
 /*
- * Copyright (C) 1998-2001, 2003 Hewlett-Packard Co
- *	David Mosberger-Tang <davidm@hpl.hp.com>
+ * Modified 1998-2001, 2003
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  *
  * Unfortunately, this file is being included by bits/signal.h in
  * glibc-2.x.  Hence the #ifdef __KERNEL__ ugliness.
diff -Nru a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h
--- a/include/asm-ia64/smp.h	Tue Feb  3 19:45:18 2004
+++ b/include/asm-ia64/smp.h	Tue Feb  3 19:45:18 2004
@@ -48,7 +48,7 @@
 
 extern unsigned long ap_wakeup_vector;
 
-#define cpu_possible(cpu)	cpu_isset(cpu, phys_cpu_present_map)
+#define cpu_possible_map phys_cpu_present_map
 
 /*
  * Function to map hard smp processor id to logical id.  Slow, so don't use this in
diff -Nru a/include/asm-ia64/sn/addrs.h b/include/asm-ia64/sn/addrs.h
--- a/include/asm-ia64/sn/addrs.h	Tue Feb  3 19:45:35 2004
+++ b/include/asm-ia64/sn/addrs.h	Tue Feb  3 19:45:35 2004
@@ -17,29 +17,15 @@
 #include <asm/sn/types.h>
 #endif 
 
-#ifndef __ASSEMBLY__
-
-#define PS_UINT_CAST		(__psunsigned_t)
-#define UINT64_CAST		(uint64_t)
 #define HUBREG_CAST		(volatile mmr_t *)
 
-#elif __ASSEMBLY__
-
-#define PS_UINT_CAST
-#define UINT64_CAST
-#define HUBREG_CAST
-
-#endif
-
-
-
 
 /*
  * The following macros are used to index to the beginning of a specific
  * node's address space.
  */
 
-#define NODE_OFFSET(_n)		(UINT64_CAST (_n) << NASID_SHFT)
+#define NODE_OFFSET(_n)		((uint64_t) (_n) << NASID_SHFT)
 
 #define NODE_CAC_BASE(_n)	(CAC_BASE  + NODE_OFFSET(_n))
 #define NODE_HSPEC_BASE(_n)	(HSPEC_BASE + NODE_OFFSET(_n))
@@ -55,7 +41,7 @@
 
 
 #define RAW_NODE_SWIN_BASE(nasid, widget)				\
-	(NODE_IO_BASE(nasid) + (UINT64_CAST (widget) << SWIN_SIZE_BITS))
+	(NODE_IO_BASE(nasid) + ((uint64_t) (widget) << SWIN_SIZE_BITS))
 
 #define WIDGETID_GET(addr)	((unsigned char)((addr >> SWIN_SIZE_BITS) & 0xff))
 
@@ -66,7 +52,7 @@
  */
 
 #define SWIN_SIZE_BITS		24
-#define SWIN_SIZE		(1UL<<24)
+#define SWIN_SIZE		(1UL << 24)
 #define	SWIN_SIZEMASK		(SWIN_SIZE - 1)
 #define	SWIN_WIDGET_MASK	0xF
 
diff -Nru a/include/asm-ia64/sn/alenlist.h b/include/asm-ia64/sn/alenlist.h
--- a/include/asm-ia64/sn/alenlist.h	Tue Feb  3 19:45:28 2004
+++ b/include/asm-ia64/sn/alenlist.h	Tue Feb  3 19:45:28 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
diff -Nru a/include/asm-ia64/sn/arc/hinv.h b/include/asm-ia64/sn/arc/hinv.h
--- a/include/asm-ia64/sn/arc/hinv.h	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,183 +0,0 @@
-/*
- * 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) 2000-2003 Silicon Graphics, Inc. All rights reserved.
- */
-
-/* $Id$
- *
- * ARCS hardware/memory inventory/configuration and system ID definitions.
- */
-#ifndef _ASM_SN_ARC_HINV_H
-#define _ASM_SN_ARC_HINV_H
-
-#include <asm/sn/arc/types.h>
-
-/* configuration query defines */
-typedef enum configclass {
-	SystemClass,
-	ProcessorClass,
-	CacheClass,
-#ifndef	_NT_PROM
-	MemoryClass,
-	AdapterClass,
-	ControllerClass,
-	PeripheralClass
-#else	/* _NT_PROM */
-	AdapterClass,
-	ControllerClass,
-	PeripheralClass,
-	MemoryClass
-#endif	/* _NT_PROM */
-} CONFIGCLASS;
-
-typedef enum configtype {
-	ARC,
-	CPU,
-	FPU,
-	PrimaryICache,
-	PrimaryDCache,
-	SecondaryICache,
-	SecondaryDCache,
-	SecondaryCache,
-#ifndef	_NT_PROM
-	Memory,
-#endif
-	EISAAdapter,
-	TCAdapter,
-	SCSIAdapter,
-	DTIAdapter,
-	MultiFunctionAdapter,
-	DiskController,
-	TapeController,
-	CDROMController,
-	WORMController,
-	SerialController,
-	NetworkController,
-	DisplayController,
-	ParallelController,
-	PointerController,
-	KeyboardController,
-	AudioController,
-	OtherController,
-	DiskPeripheral,
-	FloppyDiskPeripheral,
-	TapePeripheral,
-	ModemPeripheral,
-	MonitorPeripheral,
-	PrinterPeripheral,
-	PointerPeripheral,
-	KeyboardPeripheral,
-	TerminalPeripheral,
-	LinePeripheral,
-	NetworkPeripheral,
-#ifdef	_NT_PROM
-	Memory,
-#endif
-	OtherPeripheral,
-
-	/* new stuff for IP30 */
-	/* added without moving anything */
-	/* except ANONYMOUS. */
-
-	XTalkAdapter,
-	PCIAdapter,
-	GIOAdapter,
-	TPUAdapter,
-	TernaryCache,
-	Anonymous
-} CONFIGTYPE;
-
-typedef enum {
-	Failed = 1,
-	ReadOnly = 2,
-	Removable = 4,
-	ConsoleIn = 8,
-	ConsoleOut = 16,
-	Input = 32,
-	Output = 64
-} IDENTIFIERFLAG;
-
-#ifndef NULL			/* for GetChild(NULL); */
-#define	NULL	0
-#endif
-
-union key_u {
-	struct {
-#ifdef	_MIPSEB
-		unsigned char  c_bsize;		/* block size in lines */
-		unsigned char  c_lsize;		/* line size in bytes/tag */
-		unsigned short c_size;		/* cache size in 4K pages */
-#else	/* _MIPSEL */
-		unsigned short c_size;		/* cache size in 4K pages */
-		unsigned char  c_lsize;		/* line size in bytes/tag */
-		unsigned char  c_bsize;		/* block size in lines */
-#endif	/* _MIPSEL */
-	} cache;
-	ULONG FullKey;
-};
-
-#if _MIPS_SIM == _ABI64
-#define SGI_ARCS_VERS	64			/* sgi 64-bit version */
-#define SGI_ARCS_REV	0			/* rev .00 */
-#else
-#define SGI_ARCS_VERS	1			/* first version */
-#define SGI_ARCS_REV	10			/* rev .10, 3/04/92 */
-#endif
-
-typedef struct component {
-	CONFIGCLASS	Class;
-	CONFIGTYPE	Type;
-	IDENTIFIERFLAG	Flags;
-	USHORT		Version;
-	USHORT		Revision;
-	ULONG 		Key;
-	ULONG		AffinityMask;
-	ULONG		ConfigurationDataSize;
-	ULONG		IdentifierLength;
-	char		*Identifier;
-} COMPONENT;
-
-/* internal structure that holds pathname parsing data */
-struct cfgdata {
-	char *name;			/* full name */
-	int minlen;			/* minimum length to match */
-	CONFIGTYPE type;		/* type of token */
-};
-
-/* System ID */
-typedef struct systemid {
-	CHAR VendorId[8];
-	CHAR ProductId[8];
-} SYSTEMID;
-
-/* memory query functions */
-typedef enum memorytype {
-	ExceptionBlock,
-	SPBPage,			/* ARCS == SystemParameterBlock */
-#ifndef	_NT_PROM
-	FreeContiguous,
-	FreeMemory,
-	BadMemory,
-	LoadedProgram,
-	FirmwareTemporary,
-	FirmwarePermanent
-#else	/* _NT_PROM */
-	FreeMemory,
-	BadMemory,
-	LoadedProgram,
-	FirmwareTemporary,
-	FirmwarePermanent,
-	FreeContiguous
-#endif	/* _NT_PROM */
-} MEMORYTYPE;
-
-typedef struct memorydescriptor {
-	MEMORYTYPE	Type;
-	LONG		BasePage;
-	LONG		PageCount;
-} MEMORYDESCRIPTOR;
-
-#endif /* _ASM_SN_ARC_HINV_H */
diff -Nru a/include/asm-ia64/sn/arc/types.h b/include/asm-ia64/sn/arc/types.h
--- a/include/asm-ia64/sn/arc/types.h	Tue Feb  3 19:45:41 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,41 +0,0 @@
-/*
- * 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) 1999,2001-2003 Silicon Graphics, Inc.  All Rights Reserved.
- * Copyright 1999 Ralf Baechle (ralf@gnu.org)
- */
-#ifndef _ASM_SN_ARC_TYPES_H
-#define _ASM_SN_ARC_TYPES_H
-
-typedef char		CHAR;
-typedef short		SHORT;
-typedef long		LARGE_INTEGER __attribute__ ((__mode__ (__DI__)));
-typedef	long		LONG __attribute__ ((__mode__ (__DI__)));
-typedef unsigned char	UCHAR;
-typedef unsigned short	USHORT;
-typedef unsigned long	ULONG __attribute__ ((__mode__ (__DI__)));
-typedef void		VOID;
-
-/* The pointer types.  We're 64-bit and the firmware is also 64-bit, so
-   live is sane ...  */
-typedef CHAR		*_PCHAR;
-typedef SHORT		*_PSHORT;
-typedef LARGE_INTEGER	*_PLARGE_INTEGER;
-typedef	LONG		*_PLONG;
-typedef UCHAR		*_PUCHAR;
-typedef USHORT		*_PUSHORT;
-typedef ULONG		*_PULONG;
-typedef VOID		*_PVOID;
-
-typedef CHAR		*PCHAR;
-typedef SHORT		*PSHORT;
-typedef LARGE_INTEGER	*PLARGE_INTEGER;
-typedef	LONG		*PLONG;
-typedef UCHAR		*PUCHAR;
-typedef USHORT		*PUSHORT;
-typedef ULONG		*PULONG;
-typedef VOID		*PVOID;
-
-#endif /* _ASM_SN_ARC_TYPES_H */
diff -Nru a/include/asm-ia64/sn/arch.h b/include/asm-ia64/sn/arch.h
--- a/include/asm-ia64/sn/arch.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/sn/arch.h	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
diff -Nru a/include/asm-ia64/sn/bte.h b/include/asm-ia64/sn/bte.h
--- a/include/asm-ia64/sn/bte.h	Tue Feb  3 19:45:26 2004
+++ b/include/asm-ia64/sn/bte.h	Tue Feb  3 19:45:26 2004
@@ -1,35 +1,9 @@
 /*
- *
+ * 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) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of version 2 of the GNU General Public License 
- * as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it would be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
- * 
- * Further, this software is distributed without any warranty that it is 
- * free of the rightful claim of any third person regarding infringement 
- * or the like.  Any license provided herein, whether implied or 
- * otherwise, applies only to this software file.  Patent licenses, if 
- * any, provided herein do not apply to combinations of this program with 
- * other software, or any other product whatsoever.
- * 
- * You should have received a copy of the GNU General Public 
- * License along with this program; if not, write the Free Software 
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- * 
- * Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 
- * Mountain View, CA  94043, or:
- * 
- * http://www.sgi.com 
- * 
- * For further information regarding this notice, see: 
- * 
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan
  */
 
 
@@ -107,16 +81,25 @@
 
 
 /* Possible results from bte_copy and bte_unaligned_copy */
+/* The following error codes map into the BTE hardware codes
+ * IIO_ICRB_ECODE_* (in shubio.h). The hardware uses
+ * an error code of 0 (IIO_ICRB_ECODE_DERR), but we want zero
+ * to mean BTE_SUCCESS, so add one (BTEFAIL_OFFSET) to the error
+ * codes to give the following error codes.
+ */
+#define BTEFAIL_OFFSET	1
+
 typedef enum {
 	BTE_SUCCESS,		/* 0 is success */
+	BTEFAIL_DIR,		/* Directory error due to IIO access*/
+	BTEFAIL_POISON,		/* poison error on IO access (write to poison page) */
+	BTEFAIL_WERR,		/* Write error (ie WINV to a Read only line) */
+	BTEFAIL_ACCESS,		/* access error (protection violation) */
+	BTEFAIL_PWERR,		/* Partial Write Error */
+	BTEFAIL_PRERR,		/* Partial Read Error */
+	BTEFAIL_TOUT,		/* CRB Time out */
+	BTEFAIL_XTERR,		/* Incoming xtalk pkt had error bit */
 	BTEFAIL_NOTAVAIL,	/* BTE not available */
-	BTEFAIL_POISON,		/* poison page */
-	BTEFAIL_PROT,		/* Protection violation */
-	BTEFAIL_ACCESS,		/* access error */
-	BTEFAIL_TOUT,		/* Time out */
-	BTEFAIL_XTERR,		/* Diretory error */
-	BTEFAIL_DIR,		/* Diretory error */
-	BTEFAIL_ERROR,		/* Generic error */
 } bte_result_t;
 
 
diff -Nru a/include/asm-ia64/sn/cdl.h b/include/asm-ia64/sn/cdl.h
--- a/include/asm-ia64/sn/cdl.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-ia64/sn/cdl.h	Tue Feb  3 19:45:30 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -9,7 +8,9 @@
 #ifndef _ASM_IA64_SN_CDL_H
 #define _ASM_IA64_SN_CDL_H
 
+#ifdef __KERNEL__
 #include <asm/sn/sgi.h>
+#endif
 
 struct cdl {
 	int part_num;			/* Part part number */
diff -Nru a/include/asm-ia64/sn/clksupport.h b/include/asm-ia64/sn/clksupport.h
--- a/include/asm-ia64/sn/clksupport.h	Tue Feb  3 19:45:33 2004
+++ b/include/asm-ia64/sn/clksupport.h	Tue Feb  3 19:45:33 2004
@@ -1,5 +1,4 @@
 /*
- *
  * 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.
@@ -31,9 +30,7 @@
 typedef long clkreg_t;
 
 extern unsigned long sn_rtc_cycles_per_second;
-extern unsigned long sn_rtc_usec_per_cyc;
 extern unsigned long sn_rtc_per_itc;
-extern unsigned long sn_rtc_delta;
 
 
 #include <asm/sn/addrs.h>
diff -Nru a/include/asm-ia64/sn/dmamap.h b/include/asm-ia64/sn/dmamap.h
--- a/include/asm-ia64/sn/dmamap.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ia64/sn/dmamap.h	Tue Feb  3 19:45:42 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -9,6 +8,8 @@
 #ifndef _ASM_IA64_SN_DMAMAP_H
 #define _ASM_IA64_SN_DMAMAP_H
 
+#include <asm/sn/types.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -39,30 +40,8 @@
 	int		dma_index;	/* Beginning map register to use */
 	int		dma_size;	/* Number of map registers to use */
 	paddr_t		dma_addr;	/* Corresponding bus addr for A24/A32 */
-	caddr_t		dma_virtaddr;	/* Beginning virtual address that is mapped */
+	unsigned long	dma_virtaddr;	/* Beginning virtual address that is mapped */
 } dmamap_t;
-
-struct alenlist_s;
-
-/*
- * Prototypes of exported functions
- */
-extern dmamap_t	*dma_mapalloc(int, int, int, int);
-extern void	dma_mapfree(dmamap_t *);
-extern int	dma_map(dmamap_t *, caddr_t, int);
-extern int	dma_map2(dmamap_t *, caddr_t, caddr_t, int);
-extern paddr_t	dma_mapaddr(dmamap_t *, caddr_t);
-extern int	dma_map_alenlist(dmamap_t *, struct alenlist_s *, size_t);
-extern uint	ev_kvtoiopnum(caddr_t);
-
-/*
- * These variables are defined in master.d/kernel
- */
-extern struct map *a24map[];
-extern struct map *a32map[];
-
-extern int a24_mapsize;
-extern int a32_mapsize;
 
 #ifdef __cplusplus
 }
diff -Nru a/include/asm-ia64/sn/driver.h b/include/asm-ia64/sn/driver.h
--- a/include/asm-ia64/sn/driver.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/sn/driver.h	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
diff -Nru a/include/asm-ia64/sn/geo.h b/include/asm-ia64/sn/geo.h
--- a/include/asm-ia64/sn/geo.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-ia64/sn/geo.h	Tue Feb  3 19:45:30 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -7,8 +6,8 @@
  * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
  */
 
-#ifndef __SYS_GEO_H__
-#define __SYS_GEO_H__
+#ifndef _ASM_IA64_SN_GEO_H
+#define _ASM_IA64_SN_GEO_H
 
 /* Include a platform-specific geo.h.  It must define at least:
  *   geoid_t:		Geographic identifier data type
@@ -43,4 +42,4 @@
 extern geoid_t hwcfg_geo_get_self(geo_type_t type);
 extern geoid_t hwcfg_geo_get_by_nasid(geo_type_t type, nasid_t nasid);
 
-#endif /* __SYS_GEO_H__ */
+#endif /* _ASM_IA64_SN_GEO_H */
diff -Nru a/include/asm-ia64/sn/hcl.h b/include/asm-ia64/sn/hcl.h
--- a/include/asm-ia64/sn/hcl.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/sn/hcl.h	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -10,20 +9,22 @@
 #define _ASM_IA64_SN_HCL_H
 
 #include <asm/sn/sgi.h>
-#include <asm/sn/invent.h>
 
 extern vertex_hdl_t hwgraph_root;
 extern vertex_hdl_t linux_busnum;
 
+void hwgraph_debug(char *, char *, int, vertex_hdl_t, vertex_hdl_t, char *, ...);
+
+#if 1
+#define HWGRAPH_DEBUG(args) hwgraph_debug args ;
+#else   
+#define HWGRAPH_DEBUG(args)
+#endif  
 
 typedef long            labelcl_info_place_t;
 typedef long            arbitrary_info_t;
 typedef long            arb_info_desc_t;
 
-/* Support for INVENTORY */
-struct inventory_s;
-struct invplace_s;
-
 
 /* 
  * Reserve room in every vertex for 2 pieces of fast access indexed information 
@@ -51,7 +52,14 @@
 #define HWGRAPH_EDGELBL_HW 	"hw"
 #define HWGRAPH_EDGELBL_DOT 	"."
 #define HWGRAPH_EDGELBL_DOTDOT 	".."
-#define graph_edge_place_t uint
+
+#include <asm/sn/labelcl.h>
+#define hwgraph_fastinfo_set(a,b) labelcl_info_replace_IDX(a, HWGRAPH_FASTINFO, b, NULL)
+#define hwgraph_connectpt_set labelcl_info_connectpt_set
+#define hwgraph_generate_path hwgfs_generate_path
+#define hwgraph_path_to_vertex(a) hwgfs_find_handle(NULL, a, 0, 0, 0, 1)
+#define hwgraph_edge_remove(a,b,c)
+#define hwgraph_vertex_unref(a)
 
 /*
  * External declarations of EXPORTED SYMBOLS in hcl.c
@@ -69,25 +77,16 @@
 extern int hwgraph_edge_get(vertex_hdl_t, char *, vertex_hdl_t *);
 
 extern arbitrary_info_t hwgraph_fastinfo_get(vertex_hdl_t);
-extern void hwgraph_fastinfo_set(vertex_hdl_t, arbitrary_info_t );
 extern vertex_hdl_t hwgraph_mk_dir(vertex_hdl_t, const char *, unsigned int, void *);
 
 extern int hwgraph_connectpt_set(vertex_hdl_t, vertex_hdl_t);
 extern vertex_hdl_t hwgraph_connectpt_get(vertex_hdl_t);
-extern int hwgraph_edge_get_next(vertex_hdl_t, char *, vertex_hdl_t *, uint *);
-extern graph_error_t hwgraph_edge_remove(vertex_hdl_t, char *, vertex_hdl_t *);
+extern int hwgraph_edge_get_next(vertex_hdl_t, char *, vertex_hdl_t *, unsigned int *);
 
 extern graph_error_t hwgraph_traverse(vertex_hdl_t, char *, vertex_hdl_t *);
 
 extern int hwgraph_vertex_get_next(vertex_hdl_t *, vertex_hdl_t *);
-extern int hwgraph_inventory_get_next(vertex_hdl_t, invplace_t *, 
-				      inventory_t **);
-extern int hwgraph_inventory_add(vertex_hdl_t, int, int, major_t, minor_t, int);
-extern int hwgraph_inventory_remove(vertex_hdl_t, int, int, major_t, minor_t, int);
-extern int hwgraph_controller_num_get(vertex_hdl_t);
-extern void hwgraph_controller_num_set(vertex_hdl_t, int);
-extern int hwgraph_path_ad(vertex_hdl_t, char *, vertex_hdl_t *);
-extern vertex_hdl_t hwgraph_path_to_vertex(char *);
+extern int hwgraph_path_add(vertex_hdl_t, char *, vertex_hdl_t *);
 extern vertex_hdl_t hwgraph_path_to_dev(char *);
 extern vertex_hdl_t hwgraph_block_device_get(vertex_hdl_t);
 extern vertex_hdl_t hwgraph_char_device_get(vertex_hdl_t);
@@ -103,9 +102,6 @@
 extern int hwgraph_info_export_LBL(vertex_hdl_t, char *, int);
 extern int hwgraph_info_unexport_LBL(vertex_hdl_t, char *);
 extern int hwgraph_info_remove_LBL(vertex_hdl_t, char *, arbitrary_info_t *);
-extern char * vertex_to_name(vertex_hdl_t, char *, uint);
-extern graph_error_t hwgraph_vertex_unref(vertex_hdl_t);
-
-extern int init_hcl(void);
+extern char *vertex_to_name(vertex_hdl_t, char *, unsigned int);
 
 #endif /* _ASM_IA64_SN_HCL_H */
diff -Nru a/include/asm-ia64/sn/hcl_util.h b/include/asm-ia64/sn/hcl_util.h
--- a/include/asm-ia64/sn/hcl_util.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ia64/sn/hcl_util.h	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -10,7 +9,7 @@
 #ifndef _ASM_IA64_SN_HCL_UTIL_H
 #define _ASM_IA64_SN_HCL_UTIL_H
 
-extern char * dev_to_name(vertex_hdl_t, char *, uint);
+extern char * dev_to_name(vertex_hdl_t, char *, unsigned int);
 extern int device_master_set(vertex_hdl_t, vertex_hdl_t);
 extern vertex_hdl_t device_master_get(vertex_hdl_t);
 extern cnodeid_t master_node_get(vertex_hdl_t);
diff -Nru a/include/asm-ia64/sn/hwgfs.h b/include/asm-ia64/sn/hwgfs.h
--- a/include/asm-ia64/sn/hwgfs.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/sn/hwgfs.h	Tue Feb  3 19:45:17 2004
@@ -1,15 +1,13 @@
 #ifndef _ASM_IA64_SN_HWGFS_H
 #define _ASM_IA64_SN_HWGFS_H
 
-/* $Id$
- *
+/*
  * 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) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
  */
-
 typedef struct dentry *hwgfs_handle_t;
 
 extern hwgfs_handle_t hwgfs_register(hwgfs_handle_t dir, const char *name,
@@ -32,4 +30,4 @@
 extern void *hwgfs_get_info(hwgfs_handle_t de);
 extern int hwgfs_set_info(hwgfs_handle_t de, void *info);
 
-#endif
+#endif	/* _ASM_IA64_SN_HWGFS_H */
diff -Nru a/include/asm-ia64/sn/intr.h b/include/asm-ia64/sn/intr.h
--- a/include/asm-ia64/sn/intr.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/sn/intr.h	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
diff -Nru a/include/asm-ia64/sn/invent.h b/include/asm-ia64/sn/invent.h
--- a/include/asm-ia64/sn/invent.h	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,733 +0,0 @@
-/* $Id$
- *
- * 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) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
- */
-#ifndef _ASM_IA64_SN_INVENT_H
-#define _ASM_IA64_SN_INVENT_H
-
-#include <linux/types.h>
-#include <asm/sn/sgi.h>
-/*
- * sys/sn/invent.h --  Kernel Hardware Inventory
- *
- * As the system boots, a list of recognized devices is assembled.
- * This list can then be accessed through syssgi() by user-level programs
- * so that they can learn about available peripherals and the system's
- * hardware configuration.
- *
- * The data is organized into a linked list of structures that are composed
- * of an inventory item class and a class-specific type.  Each instance may
- * also specify a 32-bit "state" which might be size, readiness, or
- * anything else that's relevant.
- *
- */
-
-#define major_t int
-#define minor_t int
-#define app32_ptr_t unsigned long
-#define graph_vertex_place_t long
-#define GRAPH_VERTEX_NONE ((vertex_hdl_t)-1)
-#define GRAPH_EDGE_PLACE_NONE ((graph_edge_place_t)0)
-#define GRAPH_INFO_PLACE_NONE ((graph_info_place_t)0)
-#define GRAPH_VERTEX_PLACE_NONE ((graph_vertex_place_t)0)
-
-
-typedef struct inventory_s {
-	struct	inventory_s *inv_next;	/* next inventory record in list */
-	int	inv_class;		/* class of object */
-	int	inv_type;		/* class sub-type of object */
-	major_t	inv_controller;		/* object major identifier */
-	minor_t	inv_unit;		/* object minor identifier */
-	int	inv_state;		/* information specific to object or
-					   class */
-} inventory_t;
-
-typedef struct cpu_inv_s {
-	int	cpuflavor;	/* differentiate processor */
-	int	cpufq;		/* cpu frequency */
-	int	sdsize;		/* secondary data cache size */
-	int	sdfreq;		/* speed of the secondary cache */
-} cpu_inv_t;
-
-
-typedef struct diag_inv_s{
-         char name[80];
-         int  diagval;
-         int  physid;
-         int  virtid;
-} diag_inv_t;
-
-
-typedef struct router_inv_s{
-  char portmap[80];             /* String indicating which ports int/ext */
-  char type[40];                /* String name: e.g. "star", "meta", etc. */
-  int  freq;                    /* From hub */
-  int  rev;                     /* From hub */
-} router_inv_t;
-
-
-/*
- * NOTE: This file is a central registry for inventory IDs for each
- *       class of inventory object.  It is important to keep the central copy
- *       of this file up-to-date with the work going on in various engineering
- *       projects.  When making changes to this file in an engineering project
- *       tree, please make those changes separately from any others and then
- *       merge the changes to this file into the main line trees in order to
- *       prevent other engineering projects from conflicting with your ID
- *       allocations.
- */
-
-
-/* Inventory Classes */
-/* when adding a new class, add also to classes[] in hinv.c */
-#define INV_PROCESSOR	1
-#define INV_DISK	2
-#define INV_MEMORY	3
-#define INV_SERIAL	4
-#define INV_PARALLEL	5
-#define INV_TAPE	6
-#define INV_GRAPHICS	7
-#define INV_NETWORK	8
-#define INV_SCSI	9	/* SCSI devices other than disk and tape */
-#define INV_AUDIO	10
-#define	INV_IOBD	11
-#define	INV_VIDEO	12
-#define	INV_BUS		13
-#define	INV_MISC	14	/* miscellaneous: a catchall */
-/*** add post-5.2 classes here for backward compatibility ***/
-#define	INV_COMPRESSION	15
-#define	INV_VSCSI	16	/* SCSI devices on jag other than disk and tape */
-#define	INV_DISPLAY     17
-#define	INV_UNC_SCSILUN	18	/* Unconnected SCSI lun */
-#define	INV_PCI		19	/* PCI Bus */
-#define	INV_PCI_NO_DRV	20	/* PCI Bus without any driver */
-#define	INV_PROM	21	/* Different proms in the system */
-#define INV_IEEE1394	22	/* IEEE1394 devices */
-#define INV_RPS		23      /* redundant power source */
-#define INV_TPU		24	/* Tensor Processing Unit */
-#define INV_FCNODE	25	/* Helper class for SCSI classes, not in classes[] */
-#define INV_USB		26	/* Universal Serial Bus */
-#define INV_1394NODE    27      /* helper class for 1394/SPB2 classes, not in classes[] */
-
-/* types for class processor */
-#define INV_CPUBOARD	1
-#define INV_CPUCHIP	2
-#define INV_FPUCHIP	3
-#define INV_CCSYNC	4	/* CC Rev 2+ sync join counter */
-
-/* states for cpu and fpu chips are revision numbers */
-
-/* cpuboard states */
-#define INV_IP20BOARD   10
-#define INV_IP19BOARD   11
-#define INV_IP22BOARD   12
-#define INV_IP21BOARD	13
-#define INV_IP26BOARD	14
-#define INV_IP25BOARD	15
-#define INV_IP30BOARD	16
-#define INV_IP28BOARD	17
-#define INV_IP32BOARD	18
-#define INV_IP27BOARD	19
-#define INV_IPMHSIMBOARD 20
-#define INV_IP33BOARD	21
-#define INV_IP35BOARD	22
-
-/* types for class INV_IOBD */
-#define INV_EVIO	2	/* EVEREST I/O board */
-#define INV_O200IO	3	/* Origin 200 base I/O */
-
-/* IO board types for origin2000  for class INV_IOBD*/
-
-#define INV_O2000BASEIO	0x21	
-#define INV_O2000MSCSI	0x22	
-#define INV_O2000MENET	0x23
-#define INV_O2000HIPPI	0x24
-#define INV_O2000GFX	0x25	
-#define INV_O2000HAROLD 0x26
-#define INV_O2000VME	0x27
-#define INV_O2000MIO	0x28
-#define INV_O2000FC	0x29
-#define INV_O2000LINC	0x2a
-
-#define INV_PCIADAP	4
-/* states for class INV_IOBD type INV_EVERESTIO -- value of eb_type field */
-#define INV_IO4_REV1	0x21	
-
-/* types for class disk */
-/* NB: types MUST be unique within a class.
-   Please check this if adding new types. */
-
-#define INV_SCSICONTROL	1
-#define INV_SCSIDRIVE	2
-#define INV_SCSIFLOPPY	5	/* also cdroms, optical disks, etc. */
-#define INV_JAGUAR	16	/* Interphase Jaguar */
-#define INV_VSCSIDRIVE	17	/* Disk connected to Jaguar */
-#define INV_GIO_SCSICONTROL 18	/* optional GIO SCSI controller */
-#define INV_SCSIRAID	19	/* SCSI attached RAID */
-#define INV_XLVGEN      20	/* Generic XLV disk device */
-#define INV_PCCARD	21	/* PC-card (PCMCIA) devices */
-#define INV_PCI_SCSICONTROL	22   /* optional PCI SCSI controller */
-
-/* states for INV_SCSICONTROL disk type; indicate which chip rev;
- * for 93A and B, unit field has microcode rev. */
-#define INV_WD93	0	/* WD 33C93  */
-#define INV_WD93A	1	/* WD 33C93A */
-#define INV_WD93B	2	/* WD 33C93B */
-#define INV_WD95A	3	/* WD 33C95A */
-#define INV_SCIP95	4       /* SCIP with a WD 33C95A */
-#define INV_ADP7880	5	/* Adaptec 7880 (single channel) */
-#define INV_QL_REV1     6       /* qlogic 1040  */
-#define INV_QL_REV2     7       /* qlogic 1040A */
-#define INV_QL_REV2_4   8       /* qlogic 1040A rev 4 */
-#define INV_QL_REV3     9       /* qlogic 1040B */
-#define INV_FCADP	10	/* Adaptec Emerald Fibrechannel */
-#define INV_QL_REV4     11      /* qlogic 1040B rev 2 */
-#define INV_QL		12	/* Unknown QL version */	
-#define INV_QL_1240     13      /* qlogic 1240 */
-#define INV_QL_1080     14      /* qlogic 1080 */
-#define INV_QL_1280     15      /* qlogic 1280 */
-#define INV_QL_10160    16      /* qlogic 10160 */
-#define INV_QL_12160    17      /* qlogic 12160 */
-#define INV_QL_2100	18	/* qLogic 2100 Fibrechannel */
-#define INV_QL_2200	19	/* qLogic 2200 Fibrechannel */
-#define INV_PR_HIO_D	20	/* Prisa HIO Dual channel */
-#define INV_PR_PCI64_D	21	/* Prisa PCI-64 Dual channel */
-#define INV_QL_2200A	22	/* qLogic 2200A Fibrechannel */
-#define INV_SBP2        23      /* SBP2 protocol over OHCI on 1394 */
-#define INV_QL_2300	24	/* qLogic 2300 Fibrechannel */
-
-
-/* states for INV_SCSIDRIVE type of class disk */
-#define INV_RAID5_LUN	0x100
-#define INV_PRIMARY	0x200	/* primary path */
-#define INV_ALTERNATE	0x400	/* alternate path */
-#define INV_FAILED	0x800	/* path has failed */
-#define INV_XVMVOL	0x1000	/* disk is managed by XVM */
-
-/* states for INV_SCSIFLOPPY type of class disk */
-#define INV_TEAC_FLOPPY 1       /* TEAC 3 1/2 inch floppy drive */
-#define INV_INSITE_FLOPPY 2     /* INSITE, IOMEGA  Io20S, SyQuest floppy drives */
-
-/* END OF CLASS DISK TYPES */
-
-/* types for class memory */
-/* NB. the states for class memory are sizes in bytes */
-#define INV_MAIN	1
-#define INV_DCACHE	3
-#define INV_ICACHE	4
-#define INV_WBUFFER	5
-#define INV_SDCACHE	6
-#define INV_SICACHE	7
-#define INV_SIDCACHE	8
-#define INV_MAIN_MB	9
-#define INV_HUBSPC      10      /* HUBSPC */
-#define INV_TIDCACHE	11
-
-/* types for class serial */
-#define INV_CDSIO	1	/* Central Data serial board */
-#define INV_T3270	2	/* T3270 emulation */
-#define INV_GSE		3	/* SpectraGraphics Gerbil coax cable */
-#define INV_SI		4	/* SNA SDLC controller */
-#define	INV_M333X25 	6	/* X.25 controller */
-#define INV_CDSIO_E	7	/* Central Data serial board on E space */
-#define INV_ONBOARD	8	/* Serial ports per CPU board */
-#define INV_EPC_SERIAL	9	/* EVEREST I/O EPC serial port */
-#define INV_ICA		10	/* IRIS (IBM) Channel Adapter card */
-#define INV_VSC		11	/* SBE VME Synch Comm board */
-#define INV_ISC		12	/* SBE ISA Synch Comm board */
-#define INV_GSC		13	/* SGI GIO Synch Comm board */
-#define INV_ASO_SERIAL	14	/* serial portion of SGI ASO board */
-#define INV_PSC		15	/* SBE PCI Synch Comm board */
-#define INV_IOC3_DMA	16	/* DMA mode IOC3 serial */
-#define INV_IOC3_PIO	17	/* PIO mode IOC3 serial */
-#define INV_INVISIBLE	18	/* invisible inventory entry for kernel use */
-#define INV_ISA_DMA	19	/* DMA mode ISA serial -- O2 */
-
-/* types for class parallel */
-#define INV_GPIB	2	/* National Instrument GPIB board */
-#define INV_GPIB_E	3	/* National Instrument GPIB board on E space*/
-#define INV_EPC_PLP	4	/* EVEREST I/O EPC Parallel Port */
-#define INV_ONBOARD_PLP	5	/* Integral parallel port,
-				      state = 0 -> output only
-				      state = 1 -> bi-directional */
-#define INV_EPP_ECP_PLP	6	/* Integral EPP/ECP parallel port */
-#define INV_EPP_PFD	7	/* External EPP parallel peripheral */
-
-/* types for class tape */
-#define INV_SCSIQIC	1	/* Any SCSI tape, not just QIC{24,150}... */
-#define INV_VSCSITAPE	4	/* SCSI tape connected to Jaguar */
-
-/* sub types for type INV_SCSIQIC and INV_VSCSITAPE (in state) */
-#define TPUNKNOWN	0	/* type not known */
-#define TPQIC24		1	/* QIC24 1/4" cartridge */
-#define TPDAT		2	/* 4mm Digital Audio Tape cartridge */
-#define TPQIC150	3	/* QIC150 1/4" cartridge */
-#define TP9TRACK	4	/* 9 track reel */
-#define TP8MM_8200	5	/* 8 mm video tape cartridge */
-#define TP8MM_8500	6	/* 8 mm video tape cartridge */
-#define TPQIC1000	7	/* QIC1000 1/4" cartridge */
-#define TPQIC1350	8	/* QIC1350 1/4" cartridge */
-#define TP3480		9	/* 3480 compatible cartridge */
-#define TPDLT		10	/* DEC Digital Linear Tape cartridge */
-#define TPD2		11	/* D2 tape cartridge */
-#define TPDLTSTACKER	12	/* DEC Digital Linear Tape stacker */
-#define TPNTP		13	/* IBM Magstar 3590 Tape Device cartridge */
-#define TPNTPSTACKER	14	/* IBM Magstar 3590 Tape Device stacker */
-#define TPSTK9490       15      /* StorageTeK 9490 */
-#define TPSTKSD3        16      /* StorageTeK SD3 */
-#define TPGY10	        17      /* Sony GY-10  */
-#define TP8MM_8900	18	/* 8 mm (AME) tape cartridge */
-#define TPMGSTRMP       19      /* IBM Magster MP 3570 cartridge */
-#define TPMGSTRMPSTCKR  20      /* IBM Magstar MP stacker */
-#define TPSTK4791       21      /* StorageTek 4791 */
-#define TPSTK4781       22      /* StorageTek 4781 */
-#define TPFUJDIANA1     23      /* Fujitsu Diana-1 (M1016/M1017) */
-#define TPFUJDIANA2     24      /* Fujitsu Diana-2 (M2483) */
-#define TPFUJDIANA3     25      /* Fujitsu Diana-3 (M2488) */
-#define TP8MM_AIT	26	/* Sony AIT format tape */
-#define TPTD3600        27      /* Philips TD3600  */
-#define TPTD3600STCKR   28      /* Philips TD3600  stacker */
-#define TPNCTP          29      /* Philips NCTP */
-#define TPGY2120        30      /* Sony GY-2120 (replaces GY-10)  */
-#define TPOVL490E       31      /* Overland Data L490E (3490E compatible) */
-#define TPSTK9840       32      /* StorageTeK 9840 (aka Eagle) */
-
-/* Diagnostics inventory */
-#define INV_CPUDIAGVAL  70
-
-
-/*
- *  GFX invent is a subset of gfxinfo
- */
-
-/* types for class graphics */
-#define INV_GR1BOARD	1	/* GR1 (Eclipse) graphics */
-#define INV_GR1BP	2	/* OBSOLETE - use INV_GR1BIT24 instead */
-#define INV_GR1ZBUFFER	3	/* OBSOLETE - use INV_GR1ZBUF24 instead */
-#define INV_GRODEV	4	/* Clover1 graphics */
-#define INV_GMDEV	5	/* GT graphics */
-#define INV_CG2		6	/* CG2 composite video/genlock board */
-#define INV_VMUXBOARD	7	/* VMUX video mux board */
-#define	INV_VGX		8	/* VGX (PowerVision) graphics */
-#define	INV_VGXT	9	/* VGXT (PowerVision) graphics with IMP5s. */
-#define	INV_LIGHT	10	/* LIGHT graphics */
-#define INV_GR2		11	/* EXPRESS graphics */
-#define INV_RE		12	/* RealityEngine graphics */
-#define INV_VTX		13	/* RealityEngine graphics - VTX variant */
-#define INV_NEWPORT	14	/* Newport graphics */
-#define INV_MGRAS	15	/* Mardigras graphics */
-#define INV_IR		16	/* InfiniteReality graphics */
-#define INV_CRIME	17	/* Moosehead on board CRIME graphics */
-#define INV_IR2		18	/* InfiniteReality2 graphics */
-#define INV_IR2LITE	19	/* Reality graphics */
-#define INV_IR2E	20	/* InfiniteReality2e graphics */
-#define INV_ODSY        21      /* Odyssey graphics */
-#define INV_IR3		22	/* InfiniteReality3 graphics */
-
-/* states for graphics class GR1 */
-#define INV_GR1REMASK	0x7	/* RE version */
-#define INV_GR1REUNK	0x0	/* RE version unknown */
-#define INV_GR1RE1	0x1	/* RE1 */
-#define INV_GR1RE2	0x2	/* RE2 */
-#define INV_GR1BUSMASK	0x38	/* GR1 bus architecture */
-#define INV_GR1PB	0x00	/* Eclipse private bus */
-#define INV_GR1PBVME	0x08	/* VGR2 board VME and private bus interfaces */
-#define INV_GR1TURBO	0x40	/* has turbo option */
-#define INV_GR1BIT24  	0x80    /* has bitplane option */
-#define INV_GR1ZBUF24 	0x100   /* has z-buffer option */
-#define INV_GR1SMALLMON 0x200   /* using 14" monitor */
-#define INV_GR1SMALLMAP 0x400   /* has 256 entry color map */
-#define INV_GR1AUX4 	0x800   /* has AUX/WID plane option */
-
-/* states for graphics class GR2 */
-		/* bitmasks */
-#define INV_GR2_Z	0x1	/* has z-buffer option */
-#define INV_GR2_24	0x2	/* has bitplane option */
-#define INV_GR2_4GE     0x4     /* has 4 GEs */
-#define INV_GR2_1GE	0x8	/* has 1 GEs */
-#define INV_GR2_2GE	0x10	/* has 2 GEs */
-#define INV_GR2_8GE	0x20	/* has 8 GEs */
-#define INV_GR2_GR3	0x40	/* board GR3 */
-#define INV_GR2_GU1	0x80	/* board GU1 */
-#define INV_GR2_INDY    0x100   /* board GR3 on Indy*/
-#define INV_GR2_GR5	0x200	/* board GR3 with 4 GEs, hinv prints GR5-XZ */
-
-		/* supported configurations */
-#define INV_GR2_XS	0x0     /* GR2-XS */
-#define INV_GR2_XSZ	0x1     /* GR2-XS with z-buffer */
-#define INV_GR2_XS24	0x2     /* GR2-XS24 */
-#define INV_GR2_XS24Z	0x3     /* GR2-XS24 with z-buffer */
-#define INV_GR2_XSM	0x4     /* GR2-XSM */
-#define INV_GR2_ELAN	0x7	/* GR2-Elan */
-#define	INV_GR2_XZ	0x13	/* GR2-XZ */
-#define	INV_GR3_XSM	0x44	/* GR3-XSM */
-#define	INV_GR3_ELAN	0x47	/* GR3-Elan */
-#define	INV_GU1_EXTREME	0xa3	/* GU1-Extreme */
-
-/* States for graphics class NEWPORT */
-#define	INV_NEWPORT_XL	0x01	/* Indigo2 XL model */
-#define INV_NEWPORT_24	0x02	/* board has 24 bitplanes */
-#define INV_NEWTON      0x04    /* Triton SUBGR tagging */
-
-/* States for graphics class MGRAS */
-#define INV_MGRAS_ARCHS 0xff000000      /* architectures */
-#define INV_MGRAS_HQ3   0x00000000   /*impact*/
-#define INV_MGRAS_HQ4	0x01000000   /*gamera*/
-#define INV_MGRAS_MOT   0x02000000   /*mothra*/
-#define INV_MGRAS_GES	0x00ff0000	/* number of GEs */
-#define INV_MGRAS_1GE	0x00010000
-#define INV_MGRAS_2GE	0x00020000
-#define INV_MGRAS_RES	0x0000ff00	/* number of REs */
-#define INV_MGRAS_1RE	0x00000100
-#define INV_MGRAS_2RE	0x00000200
-#define INV_MGRAS_TRS	0x000000ff	/* number of TRAMs */
-#define INV_MGRAS_0TR	0x00000000
-#define INV_MGRAS_1TR	0x00000001
-#define INV_MGRAS_2TR	0x00000002
-
-/* States for graphics class CRIME */
-#define INV_CRM_BASE    0x01            /* Moosehead basic model */
-
-/* States for graphics class ODSY */
-#define INV_ODSY_ARCHS      0xff000000 /* architectures */
-#define INV_ODSY_REVA_ARCH  0x01000000 /* Buzz Rev A */
-#define INV_ODSY_REVB_ARCH  0x02000000 /* Buzz Rev B */
-#define INV_ODSY_MEMCFG     0x00ff0000 /* memory configs */
-#define INV_ODSY_MEMCFG_32  0x00010000 /* 32MB memory */
-#define INV_ODSY_MEMCFG_64  0x00020000 /* 64MB memory */
-#define INV_ODSY_MEMCFG_128 0x00030000 /* 128MB memory */
-#define INV_ODSY_MEMCFG_256 0x00040000 /* 256MB memory */
-#define INV_ODSY_MEMCFG_512 0x00050000 /* 512MB memory */
-
-
-/* types for class network */
-#define INV_NET_ETHER		0	/* 10Mb Ethernet */
-#define INV_NET_HYPER		1	/* HyperNet */
-#define	INV_NET_CRAYIOS		2	/* Cray Input/Ouput Subsystem */
-#define	INV_NET_FDDI		3	/* FDDI */
-#define INV_NET_TOKEN		4	/* 16/4 Token Ring */
-#define INV_NET_HIPPI		5	/* HIPPI */
-#define INV_NET_ATM		6	/* ATM */
-#define INV_NET_ISDN_BRI	7	/* ISDN */
-#define INV_NET_ISDN_PRI	8	/* PRI ISDN */
-#define INV_NET_HIPPIS		9	/* HIPPI-Serial */
-#define	INV_NET_GSN		10	/* GSN (aka HIPPI-6400) */
-#define INV_NET_MYRINET		11	/* Myricom PCI network */
-
-/* controllers for network types, unique within class network */
-#define INV_ETHER_EC	0	/* IP6 integral controller */
-#define INV_ETHER_ENP	1	/* CMC board */
-#define INV_ETHER_ET	2	/* IP5 integral controller */
-#define INV_HYPER_HY	3	/* HyperNet controller */
-#define	INV_CRAYIOS_CFEI3 4	/* Cray Front End Interface, v3 */
-#define	INV_FDDI_IMF	5	/* Interphase/Martin 3211 FDDI */
-#define INV_ETHER_EGL	6	/* Interphase V/4207 Eagle */
-#define INV_ETHER_FXP	7	/* CMC C/130 FXP */
-#define INV_FDDI_IPG	8	/* Interphase/SGI 4211 Peregrine FDDI */
-#define INV_TOKEN_FV	9	/* Formation fv1600 Token-Ring board */
-#define INV_FDDI_XPI	10	/* XPI GIO bus FDDI */
-#define INV_TOKEN_GTR	11	/* GTR GIO bus TokenRing */
-#define INV_ETHER_GIO	12	/* IP12/20 optional GIO ethernet controller */
-#define INV_ETHER_EE	13	/* Everest IO4 EPC SEEQ/EDLC */
-#define INV_HIO_HIPPI	14	/* HIO HIPPI for Challenge/Onyx */
-#define INV_ATM_GIO64	15	/* ATM OC-3c Mez card */
-#define INV_ETHER_EP	16	/* 8-port E-Plex Ethernet */
-#define INV_ISDN_SM	17	/* Siemens PEB 2085 */
-#define INV_TOKEN_MTR	18	/* EISA TokenRing */
-#define INV_ETHER_EF	19	/* IOC3 Fast Ethernet */
-#define INV_ISDN_48XP	20	/* Xircom PRI-48XP */
-#define INV_FDDI_RNS	21	/* Rockwell Network Systems FDDI */
-#define INV_HIPPIS_XTK	22	/* Xtalk HIPPI-Serial */
-#define INV_ATM_QUADOC3	23	/* Xtalk Quad OC-3c ATM interface */
-#define INV_TOKEN_MTRPCI 24     /* PCI TokenRing */
-#define INV_ETHER_ECF	25	/* PCI Fast Ethernet */
-#define INV_GFE		26	/* GIO Fast Ethernet */
-#define INV_VFE		27	/* VME Fast Ethernet */
-#define	INV_ETHER_GE	28	/* Gigabit Ethernet */
-#define	INV_ETHER_EFP	INV_ETHER_EF	/* unused (same as IOC3 Fast Ethernet) */
-#define INV_GSN_XTK1	29	/* single xtalk version of GSN */
-#define INV_GSN_XTK2	30	/* dual xtalk version of GSN */
-#define INV_FORE_HE	31	/* FORE HE ATM Card */
-#define INV_FORE_PCA	32	/* FORE PCA ATM Card */
-#define INV_FORE_VMA    33      /* FORE VMA ATM Card */
-#define INV_FORE_ESA    34      /* FORE ESA ATM Card */
-#define INV_FORE_GIA    35      /* FORE GIA ATM Card */
-
-/* Types for class INV_SCSI and INV_VSCSI; The type code is the same as
- * the device type code returned by the Inquiry command, iff the Inquiry
- * command defines a type code for the device in question.  If it doesn't,
- * values over 31 will be used for the device type.
- * Note: the lun is encoded in bits 8-15 of the state.  The
- * state field low 3 bits contains the information from the inquiry
- * cmd that indicates ANSI SCSI 1,2, etc. compliance, and bit 7
- * contains the inquiry info that indicates whether the media is
- * removable.
- */
-#define INV_PRINTER	2	/* SCSI printer */
-#define INV_CPU		3	/* SCSI CPU device */
-#define INV_WORM	4	/* write-once-read-many (e.g. optical disks) */
-#define INV_CDROM	5	/* CD-ROM  */
-#define INV_SCANNER	6	/* scanners */
-#define INV_OPTICAL	7	/* optical disks (read-write) */
-#define INV_CHANGER	8	/* jukebox's for CDROMS, for example */
-#define INV_COMM	9	/* Communications device */
-#define INV_STARCTLR	12	/* Storage Array Controller */
-#define INV_RAIDCTLR	32	/* RAID ctlr actually gives type 0 */
-
-/* bit definitions for state field for class INV_SCSI */
-#define INV_REMOVE	0x80	/* has removable media */
-#define INV_SCSI_MASK	7	/* to which ANSI SCSI standard device conforms*/
-
-/* types for class INV_AUDIO */
-
-#define INV_AUDIO_HDSP		0	/* Indigo DSP system */
-#define INV_AUDIO_VIGRA110	1	/* ViGRA 110 audio board */
-#define INV_AUDIO_VIGRA210	2	/* ViGRA 210 audio board */
-#define INV_AUDIO_A2		3	/* HAL2 / Audio Module for Indigo 2 */
-#define INV_AUDIO_A3		4	/* Moosehead (IP32) AD1843 codec */
-#define INV_AUDIO_RAD		5	/* RAD PCI chip */
-
-/* types for class INV_VIDEO */
-
-#define	INV_VIDEO_LIGHT		0
-#define	INV_VIDEO_VS2		1	/* MultiChannel Option */
-#define	INV_VIDEO_EXPRESS	2	/* kaleidecope video */
-#define	INV_VIDEO_VINO		3
-#define	INV_VIDEO_VO2		4	/* Sirius Video */
-#define	INV_VIDEO_INDY		5	/* Indy Video - kal vid on Newport
-					  gfx on Indy */
-#define	INV_VIDEO_MVP		6	/* Moosehead Video Ports */
-#define	INV_VIDEO_INDY_601	7	/* Indy Video 601 */
-#define	INV_VIDEO_PMUX		8	/* PALMUX video w/ PGR gfx */
-#define	INV_VIDEO_MGRAS		9	/* Galileo 1.5 video */
-#define	INV_VIDEO_DIVO		10	/* DIVO video */
-#define	INV_VIDEO_RACER		11	/* SpeedRacer Pro Video */
-#define	INV_VIDEO_EVO		12	/* EVO Personal Video */
-#define INV_VIDEO_XTHD		13	/* XIO XT-HDTV video */
-#define INV_VIDEO_XTDIGVID      14      /* XIO XT-HDDIGVID video */
-
-/* states for video class INV_VIDEO_EXPRESS */
-
-#define INV_GALILEO_REV		0xF
-#define INV_GALILEO_JUNIOR	0x10
-#define INV_GALILEO_INDY_CAM	0x20
-#define INV_GALILEO_DBOB	0x40
-#define INV_GALILEO_ELANTEC	0x80
-
-/* states for video class VINO */
-
-#define INV_VINO_REV		0xF
-#define INV_VINO_INDY_CAM	0x10
-#define INV_VINO_INDY_NOSW	0x20	/* nebulous - means s/w not installed */
-
-/* states for video class MVP */
-
-#define INV_MVP_REV(x)		(((x)&0x0000000f))
-#define INV_MVP_REV_SW(x)	(((x)&0x000000f0)>>4)
-#define INV_MVP_AV_BOARD(x)	(((x)&0x00000f00)>>8)
-#define	INV_MVP_AV_REV(x)	(((x)&0x0000f000)>>12)
-#define	INV_MVP_CAMERA(x)	(((x)&0x000f0000)>>16)
-#define	INV_MVP_CAM_REV(x)	(((x)&0x00f00000)>>20)
-#define INV_MVP_SDIINF(x)       (((x)&0x0f000000)>>24)
-#define INV_MVP_SDI_REV(x)      (((x)&0xf0000000)>>28)
-
-/* types for class INV_BUS */
-
-#define INV_BUS_VME	0
-#define INV_BUS_EISA	1
-#define INV_BUS_GIO	2
-#define INV_BUS_BT3_PCI	3
-
-/* types for class INV_MISC */
-#define INV_MISC_EPC_EINT	0	/* EPC external interrupts */
-#define INV_MISC_PCKM		1	/* pc keyboard or mouse */
-#define INV_MISC_IOC3_EINT	2	/* IOC3 external interrupts */
-#define INV_MISC_OTHER		3	/* non-specific type */
-
-/*
- * The four components below do not actually have inventory information
- * associated with the vertex. These symbols are used by grio at the 
- * moment to figure out the device type from the vertex. If these get
- * inventory structures in the future, either the type values must
- * remain the same or grio code needs to change.
- */
-
-#define INV_XBOW        	3	/* cross bow */
-#define INV_HUB         	4	/* hub */
-#define INV_PCI_BRIDGE  	5	/* pci bridge */
-#define INV_ROUTER		6	/* router */
-
-/*  types for class INV_PROM */
-#define INV_IO6PROM	0
-#define INV_IP27PROM	1
-#define INV_IP35PROM	2
-
-/* types for class INV_COMPRESSION */
-
-#define	INV_COSMO		0
-#define	INV_INDYCOMP		1
-#define	INV_IMPACTCOMP		2	/* cosmo2, aka impact compression */
-#define	INV_VICE		3 	/* Video imaging & compression engine */
-
-/* types for class INV_DISPLAY */
-#define INV_PRESENTER_BOARD	0       /* Indy Presenter adapter board */
-#define INV_PRESENTER_PANEL	1       /* Indy Presenter board and panel */
-#define INV_ICO_BOARD		2	/* IMPACT channel option board */
-#define INV_DCD_BOARD		3	/* O2 dual channel option board */
-#define INV_7of9_BOARD          4       /* 7of9 flatpanel adapter board */
-#define INV_7of9_PANEL          5       /* 7of9 flatpanel board and panel */
-
-/* types for class INV_IEEE1394 */
-#define INV_OHCI	0	/* Ohci IEEE1394 pci card */
-
-/* state for class INV_IEEE1394 & type INV_OHCI */
-#define INV_IEEE1394_STATE_TI_REV_1 0
-
-/* O2 DVLink 1.1 controller static info */
-#define INV_IEEE1394_CTLR_O2_DVLINK_11 0x8009104c
-
-/* types for class INV_TPU */
-#define	INV_TPU_EXT		0	/* External XIO Tensor Processing Unit */
-#define	INV_TPU_XIO		1	/* Internal XIO Tensor Processing Unit */
-
-/*
- * USB Types.  The upper 8 bits contain general usb device class and are used to
- * qualify the lower 8 bits which contain device type within a usb class.
- * Use USB_INV_DEVCLASS and USB_INV_DEVTYPE to to decode an i_type, and
- * USB_INV_TYPE to set it.
- */
-
-#define USB_INV_DEVCLASS(invtype)	((invtype) >> 8)
-#define USB_INV_DEVTYPE(invtype)	((invtype) & 0xf)
-#define USB_INV_TYPE(usbclass, usbtype)	(((usbclass) << 8) | (usbtype))
-
-/*
- * USB device classes.  These classes might not match the classes as defined
- * by the usb spec, but where possible we will try.
- */
-
-#define USB_INV_CLASS_RH	0x00	/* root hub (ie. controller) */
-#define USB_INV_CLASS_HID	0x03	/* human interface device */
-#define USB_INV_CLASS_HUB	0x09	/* hub device */
-
-/*
- * USB device types within a class.  These will not match USB device types,
- * as the usb is not consistent on how specific types are defined (sometimes
- * they are found in the interface subclass, sometimes (as in HID devices) they
- * are found within data generated by the device (hid report descriptors for
- * example).
- */
-
-/*
- * RH types
- */
-
-#define USB_INV_RH_OHCI		0x01	/* ohci root hub */
-
-/*
- * HID types
- */
-
-#define USB_INV_HID_KEYBOARD	0x01	/* kbd (HID class) */
-#define USB_INV_HID_MOUSE	0x02	/* mouse (HID class) */
-
-/*
- * HUB types - none yet
- */
-
-typedef struct invent_generic_s {
-	unsigned short	ig_module;
-	unsigned short	ig_slot;
-	unsigned char	ig_flag;
-	int	ig_invclass;
-} invent_generic_t;
-
-#define INVENT_ENABLED	0x1
-
-typedef struct invent_membnkinfo {
-	unsigned short	imb_size;	/* bank size in MB */
-	unsigned short	imb_attr;	/* Mem attributes */
-	unsigned int	imb_flag;	/* bank flags */
-} invent_membnkinfo_t;
-
-
-typedef struct invent_meminfo {
-	invent_generic_t 	im_gen;
-	unsigned short	im_size;	/* memory size     */
-	unsigned short	im_banks;	/* number of banks */
-	/*
-	 * declare an array with one element. Each platform is expected to
-	 * allocate the size required based on the number of banks and set
-	 * the im_banks correctly for this array traversal.
-	 */
-	invent_membnkinfo_t im_bank_info[1]; 
-} invent_meminfo_t;
-
-#define INV_MEM_PREMIUM	 0x01
-
-typedef struct invent_cpuinfo {
-	invent_generic_t ic_gen;
-	cpu_inv_t     ic_cpu_info;
-	unsigned short	ic_cpuid;
-	unsigned short	ic_slice;
-	unsigned short  ic_cpumode;
-
-} invent_cpuinfo_t;
-
-typedef struct invent_rpsinfo {
-	invent_generic_t ir_gen;
-	int 		 ir_xbox;	/* is RPS connected to an xbox */
-} invent_rpsinfo_t;
-
-typedef struct invent_miscinfo {
-	invent_generic_t im_gen;
-	int       	 im_rev;
-	int		 im_version;
-	int	         im_type;
-	uint64_t	 im_speed;
-} invent_miscinfo_t;
-
-
-typedef struct invent_routerinfo{
-         invent_generic_t im_gen;
-         router_inv_t     rip;
-} invent_routerinfo_t;
-
-
-
-#ifdef __KERNEL__
-
-typedef struct irix5_inventory_s {
-	app32_ptr_t	inv_next;	/* next inventory record in list */
-	int	inv_class;		/* class of object */
-	int	inv_type;		/* class sub-type of object */
-	major_t	inv_controller;		/* object major identifier */
-	minor_t	inv_unit;		/* object minor identifier */
-	int	inv_state;		/* information specific to object or
-					   class */
-} irix5_inventory_t;
-
-typedef struct invplace_s {
-	vertex_hdl_t		invplace_vhdl;		/* current vertex */
-	vertex_hdl_t		invplace_vplace;	/* place in vertex list */
-	inventory_t		*invplace_inv;		/* place in inv list on vertex */
-} invplace_t; /* Magic cookie placeholder in inventory list */
-
-extern invplace_t invplace_none;
-#define INVPLACE_NONE invplace_none
-
-static inline void device_inventory_add(vertex_hdl_t device, 
-					int class, 
-					int type, 
-					major_t ctlr, 
-					minor_t unit, 
-					int state)
-{
-}
-
-#endif /* __KERNEL__ */
-#endif /* _ASM_IA64_SN_INVENT_H */
diff -Nru a/include/asm-ia64/sn/io.h b/include/asm-ia64/sn/io.h
--- a/include/asm-ia64/sn/io.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ia64/sn/io.h	Tue Feb  3 19:45:16 2004
@@ -41,8 +41,8 @@
 		(((widget) & IIO_ITTE_WIDGET_MASK) << IIO_ITTE_WIDGET_SHIFT)))
 
 #define IIO_ITTE_DISABLE(nasid, bigwin) \
-	IIO_ITTE_PUT((nasid), HUB_PIO_MAP_TO_MEM, \
-		     (bigwin), IIO_ITTE_INVALID_WIDGET, 0)
+	IIO_ITTE_PUT((nasid), (bigwin), HUB_PIO_MAP_TO_MEM, \
+		IIO_ITTE_INVALID_WIDGET, 0)
 
 #define IIO_ITTE_GET(nasid, bigwin) REMOTE_HUB_ADDR((nasid), IIO_ITTE(bigwin))
 
diff -Nru a/include/asm-ia64/sn/ioc4.h b/include/asm-ia64/sn/ioc4.h
--- a/include/asm-ia64/sn/ioc4.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/sn/ioc4.h	Tue Feb  3 19:45:17 2004
@@ -1,30 +1,9 @@
 /*
+ * 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) 2002-2003 Silicon Graphics, Inc.  All Rights Reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of version 2 of the GNU General Public License 
- * as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it would be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
- * 
- * Further, this software is distributed without any warranty that it is 
- * free of the rightful claim of any third person regarding infringement 
- * or the like.  Any license provided herein, whether implied or 
- * otherwise, applies only to this software file.  Patent licenses, if 
- * any, provided herein do not apply to combinations of this program with 
- * other software, or any other product whatsoever.
- * 
- * You should have received a copy of the GNU General Public 
- * License along with this program; if not, write the Free Software 
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- * 
- * Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 
- * Mountain View, CA  94043, or:
- * 
- * http://www.sgi.com 
- * 
  */
 
 #ifndef _ASM_IA64_SN_IOC4_H
diff -Nru a/include/asm-ia64/sn/ioconfig_bus.h b/include/asm-ia64/sn/ioconfig_bus.h
--- a/include/asm-ia64/sn/ioconfig_bus.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ia64/sn/ioconfig_bus.h	Tue Feb  3 19:45:42 2004
@@ -1,35 +1,14 @@
 /*
- * Copyright (c) 2003 Silicon Graphics, Inc.  All Rights Reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of version 2 of the GNU General Public License 
- * as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it would be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
- * 
- * Further, this software is distributed without any warranty that it is 
- * free of the rightful claim of any third person regarding infringement 
- * or the like.  Any license provided herein, whether implied or 
- * otherwise, applies only to this software file.  Patent licenses, if 
- * any, provided herein do not apply to combinations of this program with 
- * other software, or any other product whatsoever.
- * 
- * You should have received a copy of the GNU General Public 
- * License along with this program; if not, write the Free Software 
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- * 
- * Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 
- * Mountain View, CA  94043, or:
- * 
- * http://www.sgi.com 
- * 
- * For further information regarding this notice, see: 
- * 
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan
+ * 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) 2003 Silicon Graphics, Inc.  All Rights Reserved.
  */
 
+#ifndef _ASM_IA64_SN_IOCONFIG_BUS_H
+#define _ASM_IA64_SN_IOCONFIG_BUS_H
+
 #define IOCONFIG_PCIBUS "/boot/efi/ioconfig_pcibus"
 #define POUND_CHAR                   '#'
 #define MAX_LINE_LEN	128
@@ -44,3 +23,5 @@
 struct  ascii_moduleid{
                 unsigned char   io_moduleid[8]; /* pci path name */
 };
+
+#endif	/* _ASM_IA64_SN_IOCONFIG_BUS_H */
diff -Nru a/include/asm-ia64/sn/ioerror.h b/include/asm-ia64/sn/ioerror.h
--- a/include/asm-ia64/sn/ioerror.h	Tue Feb  3 19:45:41 2004
+++ b/include/asm-ia64/sn/ioerror.h	Tue Feb  3 19:45:41 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -185,13 +184,9 @@
 typedef int             error_handler_f(void *, int, ioerror_mode_t, ioerror_t *);
 typedef void           *error_handler_arg_t;
 
-extern void             ioerror_dump(char *, int, int, ioerror_t *);
-
 #ifdef	ERROR_DEBUG
-#define	IOERROR_DUMP(x, y, z, t)	ioerror_dump((x), (y), (z), (t))
 #define	IOERR_PRINTF(x)	(x)
 #else
-#define	IOERROR_DUMP(x, y, z, t)
 #define	IOERR_PRINTF(x)
 #endif				/* ERROR_DEBUG */
 
diff -Nru a/include/asm-ia64/sn/ioerror_handling.h b/include/asm-ia64/sn/ioerror_handling.h
--- a/include/asm-ia64/sn/ioerror_handling.h	Tue Feb  3 19:45:28 2004
+++ b/include/asm-ia64/sn/ioerror_handling.h	Tue Feb  3 19:45:28 2004
@@ -8,7 +8,6 @@
 #ifndef _ASM_IA64_SN_IOERROR_HANDLING_H
 #define _ASM_IA64_SN_IOERROR_HANDLING_H
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <asm/sn/sgi.h>
 
@@ -204,12 +203,6 @@
 
 typedef uint64_t  error_priority_t;
 
-/* Error state interfaces */
-#if defined(CONFIG_SGI_IO_ERROR_HANDLING)
-extern error_return_code_t	error_state_set(vertex_hdl_t,error_state_t);
-extern error_state_t		error_state_get(vertex_hdl_t);
-#endif
-
 /* Error action interfaces */
 
 extern error_return_code_t	error_action_set(vertex_hdl_t,
@@ -232,45 +225,6 @@
 #define v_error_skip_env_clear(v)		\
 hwgraph_info_remove_LBL(v, INFO_LBL_ERROR_SKIP_ENV, 0)
 
-/* Skip point interfaces */
-extern error_return_code_t	error_skip_point_jump(vertex_hdl_t, boolean_t);
-extern error_return_code_t	error_skip_point_clear(vertex_hdl_t);
-
-/* REFERENCED */
-#if defined(CONFIG_SGI_IO_ERROR_HANDLING)
-
-inline static int
-error_skip_point_mark(vertex_hdl_t  v)  			 
-{									
-	label_t		*error_env = NULL;	 			
-	int		code = 0;		
-
-	/* Check if we have a valid hwgraph vertex */
-#ifdef	LATER
-	if (!dev_is_vertex(v))
-		return(code);
-#endif
-				
-	/* There is no error jump buffer for this device vertex. Allocate
-	 * one.								 
-	 */								 
-	if (v_error_skip_env_get(v, error_env) != GRAPH_SUCCESS) {	 
-		error_env = snia_kmem_zalloc(sizeof(label_t), KM_NOSLEEP);	 
-		/* Unable to allocate memory for jum buffer. This should 
-		 * be a very rare occurrence.				 
-		 */							 
-		if (!error_env)						 
-			return(-1);					 
-		/* Store the jump buffer information on the vertex.*/	 
-		if (v_error_skip_env_set(v, error_env, 0) != GRAPH_SUCCESS)
-			return(-2);					   
-	}								   
-	ASSERT(v_error_skip_env_get(v, error_env) == GRAPH_SUCCESS);
-	code = setjmp(*error_env);					   
-	return(code);							     
-}
-#endif	/* CONFIG_SGI_IO_ERROR_HANDLING */
-
 typedef uint64_t		counter_t;
 
 extern counter_t		error_retry_count_get(vertex_hdl_t);
@@ -283,14 +237,6 @@
  */
 #define	IS_ERROR_INTR_CONTEXT(_ec)	((_ec & IOECODE_DMA) 		|| \
 					 (_ec == IOECODE_PIO_WRITE))
-
-/* Some convenience macros on device state. This state is accessed only 
- * thru the calls the io error handling layer.
- */
-#if defined(CONFIG_SGI_IO_ERROR_HANDLING)
-extern boolean_t		is_device_shutdown(vertex_hdl_t);
-#define IS_DEVICE_SHUTDOWN(_d) 	(is_device_shutdown(_d))
-#endif
 
 #endif /* __KERNEL__ */
 #endif /* _ASM_IA64_SN_IOERROR_HANDLING_H */
diff -Nru a/include/asm-ia64/sn/iograph.h b/include/asm-ia64/sn/iograph.h
--- a/include/asm-ia64/sn/iograph.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ia64/sn/iograph.h	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -19,13 +18,10 @@
 /* edges names */
 #define EDGE_LBL_BUS			"bus"
 #define EDGE_LBL_CONN			".connection"
-#define EDGE_LBL_ECP			"ecp"		/* EPP/ECP plp */
-#define EDGE_LBL_ECPP			"ecpp"
 #define EDGE_LBL_GUEST			".guest"	/* For IOC3 */
 #define EDGE_LBL_HOST			".host"		/* For IOC3 */
 #define EDGE_LBL_PERFMON		"mon"
 #define EDGE_LBL_USRPCI			"usrpci"
-#define EDGE_LBL_VME			"vmebus"
 #define EDGE_LBL_BLOCK			"block"
 #define EDGE_LBL_BOARD			"board"
 #define EDGE_LBL_CHAR			"char"
@@ -35,50 +31,13 @@
 #define EDGE_LBL_DIRECT			"direct"
 #define EDGE_LBL_DISABLED		"disabled"
 #define EDGE_LBL_DISK			"disk"
-#define EDGE_LBL_DMA_ENGINE             "dma_engine"    /* Only available on
-							   VMEbus now        */
-#define EDGE_LBL_NET			"net"		/* all nw. devs */
-#define EDGE_LBL_EF			"ef"		/* For if_ef ethernet */
-#define EDGE_LBL_ET			"et"		/* For if_ee ethernet */
-#define EDGE_LBL_EC			"ec"		/* For if_ec2 ether */
-#define EDGE_LBL_ECF			"ec"		/* For if_ecf enet */
-#define EDGE_LBL_EM			"ec"		/* For O2 ether */
-#define EDGE_LBL_IPG			"ipg"		/* For IPG FDDI */
-#define EDGE_LBL_XPI			"xpi"		/* For IPG FDDI */
-#define EDGE_LBL_HIP			"hip"		/* For HIPPI */
-#define EDGE_LBL_GSN                    "gsn"           /* For GSN */
-#define EDGE_LBL_ATM			"atm"		/* For ATM */
-#define EDGE_LBL_FXP			"fxp"		/* For FXP ether */
-#define EDGE_LBL_EP			"ep"		/* For eplex ether */
-#define EDGE_LBL_VFE			"vfe"		/* For VFE ether */
-#define EDGE_LBL_GFE			"gfe"		/* For GFE ether */
-#define EDGE_LBL_RNS			"rns"		/* RNS PCI FDDI card */
-#define EDGE_LBL_MTR			"mtr"		/* MTR PCI 802.5 card */
-#define EDGE_LBL_FV			"fv"		/* FV VME 802.5 card */
-#define EDGE_LBL_GTR			"gtr"		/* GTR GIO 802.5 card */
-#define EDGE_LBL_ISDN                   "isdn"		/* Digi PCI ISDN-BRI card */
-
-#define EDGE_LBL_EISA			"eisa"
-#define EDGE_LBL_ENET			"ethernet"
-#define EDGE_LBL_FLOPPY			"floppy"
-#define EDGE_LBL_PFD			"pfd"		/* For O2 pfd floppy */
-#define EDGE_LBL_FOP                    "fop"           /* Fetchop pseudo device */
-#define EDGE_LBL_GIO			"gio"
-#define EDGE_LBL_HEART			"heart"		/* For RACER */
-#define EDGE_LBL_HPC			"hpc"
-#define EDGE_LBL_GFX			"gfx"
 #define EDGE_LBL_HUB			"hub"		/* For SN0 */
 #define EDGE_LBL_HW			"hw"
-#define EDGE_LBL_SYNERGY		"synergy"	/* For SNIA only */
-#define EDGE_LBL_IBUS			"ibus"		/* For EVEREST */
 #define EDGE_LBL_INTERCONNECT		"link"
 #define EDGE_LBL_IO			"io"
-#define EDGE_LBL_IO4			"io4"		/* For EVEREST */
-#define EDGE_LBL_IOC3			"ioc3"
 #define EDGE_LBL_LUN                    "lun"
 #define EDGE_LBL_LINUX                  "linux"
 #define EDGE_LBL_LINUX_BUS              EDGE_LBL_LINUX "/bus/pci-x"
-#define EDGE_LBL_MACE                   "mace" 		/* O2 mace */
 #define EDGE_LBL_MACHDEP                "machdep"       /* Platform depedent devices */
 #define EDGE_LBL_MASTER			".master"
 #define EDGE_LBL_MEMORY			"memory"
@@ -93,6 +52,9 @@
 #define EDGE_LBL_PCIX			"pci-x"
 #define EDGE_LBL_PCIX_0			EDGE_LBL_PCIX "/0"
 #define EDGE_LBL_PCIX_1			EDGE_LBL_PCIX "/1"
+#define EDGE_LBL_AGP			"agp"
+#define EDGE_LBL_AGP_0			EDGE_LBL_AGP "/0"
+#define EDGE_LBL_AGP_1			EDGE_LBL_AGP "/1"
 #define EDGE_LBL_PORT			"port"
 #define EDGE_LBL_PROM			"prom"
 #define EDGE_LBL_RACK			"rack"
@@ -103,11 +65,8 @@
 #define EDGE_LBL_SCSI			"scsi"
 #define EDGE_LBL_SCSI_CTLR		"scsi_ctlr"
 #define EDGE_LBL_SLOT			"slot"
-#define EDGE_LBL_TAPE			"tape"
 #define EDGE_LBL_TARGET                 "target"
 #define EDGE_LBL_UNKNOWN		"unknown"
-#define EDGE_LBL_VOLUME			"volume"
-#define EDGE_LBL_VOLUME_HEADER		"volume_header"
 #define EDGE_LBL_XBOW			"xbow"
 #define	EDGE_LBL_XIO			"xio"
 #define EDGE_LBL_XSWITCH		".xswitch"
@@ -115,23 +74,16 @@
 #define EDGE_LBL_XWIDGET		"xwidget"
 #define EDGE_LBL_ELSC			"elsc"
 #define EDGE_LBL_L1			"L1"
-#define EDGE_LBL_MADGE_TR               "Madge-tokenring"
 #define EDGE_LBL_XPLINK			"xplink" 	/* Cross partition */
 #define	EDGE_LBL_XPLINK_NET		"net" 		/* XP network devs */
 #define	EDGE_LBL_XPLINK_RAW		"raw"		/* XP Raw devs */
 #define EDGE_LBL_SLAB			"slab"		/* Slab of a module */
 #define	EDGE_LBL_XPLINK_KERNEL		"kernel"	/* XP kernel devs */
 #define	EDGE_LBL_XPLINK_ADMIN		"admin"	   	/* Partition admin */
-#define	EDGE_LBL_KAIO			"kaio"	   	/* Kernel async i/o poll */
-#define EDGE_LBL_RPS                    "rps"           /* redundant power supply */ 
-#define EDGE_LBL_XBOX_RPS               "xbox_rps"      /* redundant power supply for xbox unit */ 
 #define EDGE_LBL_IOBRICK		"iobrick"
-#define EDGE_LBL_PBRICK			"Pbrick"
-#define EDGE_LBL_PEBRICK		"PEbrick"
 #define EDGE_LBL_PXBRICK		"PXbrick"
+#define EDGE_LBL_OPUSBRICK		"onboardio"
 #define EDGE_LBL_IXBRICK		"IXbrick"
-#define EDGE_LBL_IBRICK			"Ibrick"
-#define EDGE_LBL_XBRICK			"Xbrick"
 #define EDGE_LBL_CGBRICK		"CGbrick"
 #define EDGE_LBL_CPUBUS			"cpubus"	/* CPU Interfaces (SysAd) */
 
@@ -142,25 +94,15 @@
 #define INFO_LBL_CPUID			"_cpuid"
 #define INFO_LBL_CPU_INFO		"_cpu"
 #define INFO_LBL_DETAIL_INVENT		"_detail_invent" /* inventory data*/
-#define INFO_LBL_DEVICE_DESC		"_device_desc"
-#define INFO_LBL_DIAGVAL                "_diag_reason"   /* Reason disabled */
-#define INFO_LBL_DKIOTIME		"_dkiotime"
+#define INFO_LBL_DIAGVAL		"_diag_reason"   /* Reason disabled */
 #define INFO_LBL_DRIVER			"_driver"	/* points to attached device_driver_t */
 #define INFO_LBL_ELSC			"_elsc"
 #define	INFO_LBL_SUBCH			"_subch"	/* system controller subchannel */
-#define INFO_LBL_L1SCP			"_l1scp"	/* points to l1sc_t */
-#define INFO_LBL_FC_PORTNAME		"_fc_portname"
-#define INFO_LBL_GIOIO			"_gioio"
-#define INFO_LBL_GFUNCS			"_gioio_ops"	/* ops vector for gio providers */
 #define INFO_LBL_HUB_INFO		"_hubinfo"
 #define INFO_LBL_HWGFSLIST		"_hwgfs_list"
 #define INFO_LBL_TRAVERSE		"_hwg_traverse" /* hwgraph traverse function */
-#define INFO_LBL_INVENT 		"_invent"	/* inventory data */
-#define INFO_LBL_MLRESET		"_mlreset"	/* present if device preinitialized */
 #define INFO_LBL_MODULE_INFO		"_module"	/* module data ptr */
-#define INFO_LBL_MONDATA		"_mon"		/* monitor data ptr */
 #define INFO_LBL_MDPERF_DATA		"_mdperf"	/* mdperf monitoring*/
-#define INFO_LBL_NIC			"_nic"
 #define INFO_LBL_NODE_INFO		"_node"
 #define	INFO_LBL_PCIBR_HINTS		"_pcibr_hints"
 #define INFO_LBL_PCIIO			"_pciio"
@@ -168,15 +110,11 @@
 #define INFO_LBL_PERMISSIONS		"_permissions"	/* owner, uid, gid */
 #define INFO_LBL_ROUTER_INFO		"_router"
 #define INFO_LBL_SUBDEVS		"_subdevs"	/* subdevice enable bits */
-#define INFO_LBL_VME_FUNCS		"_vmeio_ops"	/* ops vector for VME providers */
 #define INFO_LBL_XSWITCH		"_xswitch"
 #define INFO_LBL_XSWITCH_ID		"_xswitch_id"
 #define INFO_LBL_XSWITCH_VOL		"_xswitch_volunteer"
 #define INFO_LBL_XFUNCS			"_xtalk_ops"	/* ops vector for gio providers */
 #define INFO_LBL_XWIDGET		"_xwidget"
-#define INFO_LBL_GRIO_DSK		"_grio_disk"	/* guaranteed rate I/O */
-#define INFO_LBL_ASYNC_ATTACH           "_async_attach"	/* parallel attachment */
-#define INFO_LBL_GFXID			"_gfxid"	/* gfx pipe ID #s */
 /* Device/Driver  Admin directive labels  */
 #define ADMIN_LBL_INTR_TARGET		"INTR_TARGET"	/* Target cpu for device interrupts*/
 #define ADMIN_LBL_INTR_SWLEVEL		"INTR_SWLEVEL"	/* Priority level of the ithread */
@@ -199,12 +137,6 @@
 							 * thread priority
 							 * default class
 							 */
-/* Special reserved info labels (also hwgfs attributes) */
-#define _DEVNAME_ATTR		"_devname"	/* device name */
-#define _DRIVERNAME_ATTR	"_drivername"	/* driver name */
-#define _INVENT_ATTR		"_inventory"	/* device inventory data */
-#define _MASTERNODE_ATTR	"_masternode"	/* node that "controls" device */
-
 /* Info labels that begin with '_' cannot be overwritten by an attr_set call */
 #define INFO_LBL_RESERVED(name) ((name)[0] == '_')
 
diff -Nru a/include/asm-ia64/sn/klconfig.h b/include/asm-ia64/sn/klconfig.h
--- a/include/asm-ia64/sn/klconfig.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/sn/klconfig.h	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -12,12 +11,6 @@
 #ifndef _ASM_IA64_SN_KLCONFIG_H
 #define _ASM_IA64_SN_KLCONFIG_H
 
-#include <linux/config.h>
-
-/*
- * klconfig.h
- */
-
 /*
  * The KLCONFIG structures store info about the various BOARDs found
  * during Hardware Discovery. In addition, it stores info about the
@@ -41,7 +34,6 @@
 #include <asm/sn/sgi.h>
 #include <asm/sn/addrs.h>
 #include <asm/sn/vector.h>
-#include <asm/sn/arc/hinv.h>
 #include <asm/sn/xtalk/xbow.h>
 #include <asm/sn/xtalk/xtalk.h>
 #include <asm/sn/kldir.h>
@@ -74,10 +66,8 @@
 #define DUPLICATE_BOARD 	0x04    /* Boards like midplanes/routers which
                                    	   are discovered twice. Use one of them */
 #define VISITED_BOARD		0x08	/* Used for compact hub numbering. */
-#define LOCAL_MASTER_IO6	0x10 	/* master io6 for that node */
-#define GLOBAL_MASTER_IO6	0x20
-#define GLOBAL_MASTER_EXT 	0x40  	/* extend master io6 to other bus on ibrick */
-#define SECOND_NIC_PRESENT 	0x80 	/* addons like MIO are present */
+#define LOCAL_MASTER_IO6	0x10    /* master io6 for that node */
+#define KLTYPE_IOBRICK_XBOW	(KLCLASS_MIDPLANE | 0x2)
 
 /* klinfo->flags fields */
 
@@ -88,11 +78,6 @@
 #define KLINFO_CONTROLLER   	0x10 	/* This component is a device controller */
 #define KLINFO_INSTALL   	0x20  	/* Install a driver */
 #define	KLINFO_HEADLESS		0x40	/* Headless (or hubless) component */
-#define IS_CONSOLE_IOC3(i)	((((klinfo_t *)i)->flags) & KLINFO_INSTALL)
-
-#define GB2		0x80000000
-
-#define MAX_RSV_PTRS	32
 
 /* Structures to manage various data storage areas */
 /* The numbers must be contiguous since the array index i
@@ -141,41 +126,13 @@
 
 
 #define KL_CONFIG_HDR(_nasid) 	((kl_config_hdr_t *)(KLCONFIG_ADDR(_nasid)))
-#define KL_CONFIG_INFO_OFFSET(_nasid)					\
-        (KL_CONFIG_HDR(_nasid)->ch_board_info)
-#define KL_CONFIG_INFO_SET_OFFSET(_nasid, _off)				\
-        (KL_CONFIG_HDR(_nasid)->ch_board_info = (_off))
-
-#ifndef __ia64
-#define KL_CONFIG_INFO(_nasid) 						\
-        (lboard_t *)((KL_CONFIG_HDR(_nasid)->ch_board_info) ?		\
-	 NODE_OFFSET_TO_K0((_nasid), KL_CONFIG_HDR(_nasid)->ch_board_info) : \
-	 0)
-#else
-#define NODE_OFFSET_TO_LBOARD(nasid,off)        (lboard_t*)(NODE_CAC_BASE(nasid) + (off))
-
-#define KL_CONFIG_INFO(_nasid)                                          \
-	(lboard_t *)((KL_CONFIG_HDR(_nasid)->ch_board_info) ?           \
-	 NODE_OFFSET_TO_LBOARD((_nasid), KL_CONFIG_HDR(_nasid)->ch_board_info) : \
-	 NULL)
-
-#endif	/* __ia64 */
 
-#define KL_CONFIG_MAGIC(_nasid)		(KL_CONFIG_HDR(_nasid)->ch_magic)
-
-#define KL_CONFIG_CHECK_MAGIC(_nasid)					\
-        (KL_CONFIG_HDR(_nasid)->ch_magic == KLCFGINFO_MAGIC)
+#define NODE_OFFSET_TO_LBOARD(nasid,off)        (lboard_t*)(NODE_CAC_BASE(nasid) + (off))
 
-#define KL_CONFIG_HDR_INIT_MAGIC(_nasid)	\
-                  (KL_CONFIG_HDR(_nasid)->ch_magic = KLCFGINFO_MAGIC)
+#define KL_CONFIG_INFO(_nasid) root_lboard[nasid_to_cnodeid(_nasid)]
 
 /* --- New Macros for the changed kl_config_hdr_t structure --- */
 
-#define PTR_CH_MALLOC_HDR(_k)   ((klc_malloc_hdr_t *)\
-			((__psunsigned_t)_k + (_k->ch_malloc_hdr_off)))
-
-#define KL_CONFIG_CH_MALLOC_HDR(_n)   PTR_CH_MALLOC_HDR(KL_CONFIG_HDR(_n))
-
 #define PTR_CH_CONS_INFO(_k)	((console_t *)\
 			((__psunsigned_t)_k + (_k->ch_cons_off)))
 
@@ -183,12 +140,6 @@
 
 /* ------------------------------------------------------------- */
 
-#define KL_CONFIG_INFO_START(_nasid)	\
-        (klconf_off_t)(KLCONFIG_OFFSET(_nasid) + sizeof(kl_config_hdr_t))
-
-#define KL_CONFIG_BOARD_NASID(_brd)	((_brd)->brd_nasid)
-#define KL_CONFIG_BOARD_SET_NEXT(_brd, _off)	((_brd)->brd_next = (_off))
-
 #define KL_CONFIG_DUPLICATE_BOARD(_brd)	((_brd)->brd_flags & DUPLICATE_BOARD)
 
 #define XBOW_PORT_TYPE_HUB(_xbowp, _link) 	\
@@ -205,9 +156,6 @@
 #define XBOW_PORT_HUB    0x2
 #define XBOW_PORT_ENABLE 0x4
 
-#define	SN0_PORT_FENCE_SHFT	0
-#define	SN0_PORT_FENCE_MASK	(1 << SN0_PORT_FENCE_SHFT)
-
 /*
  * The KLCONFIG area is organized as a LINKED LIST of BOARDs. A BOARD
  * can be either 'LOCAL' or 'REMOTE'. LOCAL means it is attached to 
@@ -301,15 +249,7 @@
  */
 
 /*
- * Values for CPU types
- */
-#define KL_CPU_R4000		0x1	/* Standard R4000 */
-#define KL_CPU_TFP		0x2	/* TFP processor */
-#define	KL_CPU_R10000		0x3	/* R10000 (T5) */
-#define KL_CPU_NONE		(-1)	/* no cpu present in slot */
-
-/*
- * IP27 BOARD classes
+ * BOARD classes
  */
 
 #define KLCLASS_MASK	0xf0   
@@ -347,70 +287,27 @@
 #define KLTYPE_WEIRDCPU (KLCLASS_CPU | 0x0)
 #define KLTYPE_SNIA	(KLCLASS_CPU | 0x1)
 
-#define KLTYPE_WEIRDIO	(KLCLASS_IOBRICK  | 0x0)
-#define KLTYPE_BASEIO	(KLCLASS_IO  | 0x1) /* IOC3, SuperIO, Bridge, SCSI */
-#define KLTYPE_IO6	KLTYPE_BASEIO       /* Additional name */
-#define KLTYPE_4CHSCSI	(KLCLASS_IO  | 0x2)
-#define KLTYPE_MSCSI	KLTYPE_4CHSCSI      /* Additional name */
-#define KLTYPE_ETHERNET	(KLCLASS_IO  | 0x3)
-#define KLTYPE_MENET	KLTYPE_ETHERNET     /* Additional name */
-#define KLTYPE_FDDI  	(KLCLASS_IO  | 0x4)
-#define KLTYPE_UNUSED	(KLCLASS_IO  | 0x5) /* XXX UNUSED */
-#define KLTYPE_HAROLD   (KLCLASS_IO  | 0x6) /* PCI SHOE BOX */
-#define KLTYPE_PCI	KLTYPE_HAROLD
-#define KLTYPE_VME      (KLCLASS_IO  | 0x7) /* Any 3rd party VME card */
-#define KLTYPE_MIO   	(KLCLASS_IO  | 0x8)
-#define KLTYPE_FC    	(KLCLASS_IO  | 0x9)
-#define KLTYPE_LINC    	(KLCLASS_IO  | 0xA)
-#define KLTYPE_TPU    	(KLCLASS_IO  | 0xB) /* Tensor Processing Unit */
-#define KLTYPE_GSN_A   	(KLCLASS_IO  | 0xC) /* Main GSN board */
-#define KLTYPE_GSN_B   	(KLCLASS_IO  | 0xD) /* Auxiliary GSN board */
-#define KLTYPE_SHOEHORN (KLCLASS_IO  | 0xE)
-#define KLTYPE_SERIAL_HIPPI (KLCLASS_IO  | 0xF)
-
-#define KLTYPE_GFX	(KLCLASS_GFX | 0x0) /* unknown graphics type */
-#define KLTYPE_GFX_KONA (KLCLASS_GFX | 0x1) /* KONA graphics on IP27 */
-#define KLTYPE_GFX_MGRA (KLCLASS_GFX | 0x3) /* MGRAS graphics on IP27 */
-
-#define KLTYPE_WEIRDROUTER (KLCLASS_ROUTER | 0x0)
 #define KLTYPE_ROUTER     (KLCLASS_ROUTER | 0x1)
-#define KLTYPE_ROUTER2    KLTYPE_ROUTER		/* Obsolete! */
-#define KLTYPE_NULL_ROUTER (KLCLASS_ROUTER | 0x2)
 #define KLTYPE_META_ROUTER (KLCLASS_ROUTER | 0x3)
 #define KLTYPE_REPEATER_ROUTER (KLCLASS_ROUTER | 0x4)
 
-#define KLTYPE_WEIRDMIDPLANE (KLCLASS_MIDPLANE | 0x0)
-#define KLTYPE_MIDPLANE8  (KLCLASS_MIDPLANE | 0x1) /* 8 slot backplane */
-#define KLTYPE_MIDPLANE    KLTYPE_MIDPLANE8
-#define KLTYPE_IOBRICK_XBOW	(KLCLASS_MIDPLANE | 0x2)
-
 #define KLTYPE_IOBRICK		(KLCLASS_IOBRICK | 0x0)
-#define KLTYPE_IBRICK		(KLCLASS_IOBRICK | 0x1)
-#define KLTYPE_PBRICK		(KLCLASS_IOBRICK | 0x2)
-#define KLTYPE_XBRICK		(KLCLASS_IOBRICK | 0x3)
 #define KLTYPE_NBRICK		(KLCLASS_IOBRICK | 0x4)
-#define KLTYPE_PEBRICK		(KLCLASS_IOBRICK | 0x5)
 #define KLTYPE_PXBRICK		(KLCLASS_IOBRICK | 0x6)
 #define KLTYPE_IXBRICK		(KLCLASS_IOBRICK | 0x7)
 #define KLTYPE_CGBRICK		(KLCLASS_IOBRICK | 0x8)
+#define KLTYPE_OPUSBRICK	(KLCLASS_IOBRICK | 0x9)
 
 
-#define KLTYPE_PBRICK_BRIDGE	KLTYPE_PBRICK
-
 /* The value of type should be more than 8 so that hinv prints
  * out the board name from the NIC string. For values less than
  * 8 the name of the board needs to be hard coded in a few places.
  * When bringup started nic names had not standardized and so we
  * had to hard code. (For people interested in history.) 
  */
-#define KLTYPE_XTHD   	(KLCLASS_PSEUDO_GFX | 0x9)
-
 #define KLTYPE_UNKNOWN	(KLCLASS_UNKNOWN | 0xf)
 
 #define KLTYPE(_x) 	((_x) & KLTYPE_MASK)
-#define IS_MIO_PRESENT(l)	((l->brd_type == KLTYPE_BASEIO) && \
-				 (l->brd_flags & SECOND_NIC_PRESENT))
-#define IS_MIO_IOC3(l,n)	(IS_MIO_PRESENT(l) && (n > 2))
 
 /* 
  * board structures
@@ -418,13 +315,8 @@
 
 #define MAX_COMPTS_PER_BRD 24
 
-#define LOCAL_BOARD 1
-#define REMOTE_BOARD 2
-
-#define LBOARD_STRUCT_VERSION 	2
-
 typedef struct lboard_s {
-	klconf_off_t 	brd_next;         /* Next BOARD */
+	klconf_off_t 	brd_next_any;     /* Next BOARD */
 	unsigned char 	struct_type;      /* type of structure, local or remote */
 	unsigned char 	brd_type;         /* type+class */
 	unsigned char 	brd_sversion;     /* version of this structure */
@@ -444,15 +336,16 @@
 	klconf_off_t 	brd_compts[MAX_COMPTS_PER_BRD]; /* pointers to COMPONENTS */
 	klconf_off_t 	brd_errinfo;      /* Board's error information */
 	struct lboard_s *brd_parent;	  /* Logical parent for this brd */
-	vertex_hdl_t	brd_graph_link;   /* vertex hdl to connect extern compts */
+	char            pad0[4];
 	confidence_t	brd_confidence;	  /* confidence that the board is bad */
 	nasid_t		brd_owner;        /* who owns this board */
 	unsigned char 	brd_nic_flags;    /* To handle 8 more NICs */
-	char		pad[32];	  /* future expansion */
+	char		pad1[24];	  /* future expansion */
 	char		brd_name[32];
+	nasid_t		brd_next_same_host; /* host of next brd w/same nasid */
+	klconf_off_t	brd_next_same;    /* Next BOARD with same nasid */
 } lboard_t;
 
-
 /*
  *	Make sure we pass back the calias space address for local boards.
  *	klconfig board traversal and error structure extraction defines.
@@ -462,33 +355,20 @@
 
 #define KLCF_CLASS(_brd)	KLCLASS((_brd)->brd_type)
 #define KLCF_TYPE(_brd)		KLTYPE((_brd)->brd_type)
-#define KLCF_REMOTE(_brd)  	(((_brd)->struct_type & LOCAL_BOARD) ? 0 : 1)
 #define KLCF_NUM_COMPS(_brd)	((_brd)->brd_numcompts)
 #define KLCF_MODULE_ID(_brd)	((_brd)->brd_module)
 
-#ifndef __ia64
-#define KLCF_NEXT(_brd) 		((_brd)->brd_next ? (lboard_t *)((_brd)->brd_next):  NULL)
-#define KLCF_COMP(_brd, _ndx)   \
-		(klinfo_t *)(NODE_OFFSET_TO_K0(NASID_GET(_brd), \
-						(_brd)->brd_compts[(_ndx)]))
-#define KLCF_COMP_ERROR(_brd, _comp)    \
-		(NODE_OFFSET_TO_K0(NASID_GET(_brd), (_comp)->errinfo))
-
-#else
-
 #define NODE_OFFSET_TO_KLINFO(n,off)    ((klinfo_t*) TO_NODE_CAC(n,off))
 #define KLCF_NEXT(_brd)         \
-        ((_brd)->brd_next ?     \
-         (NODE_OFFSET_TO_LBOARD(NASID_GET(_brd), (_brd)->brd_next)): NULL)
+        ((_brd)->brd_next_same ?     \
+         (NODE_OFFSET_TO_LBOARD((_brd)->brd_next_same_host, (_brd)->brd_next_same)): NULL)
+#define KLCF_NEXT_ANY(_brd)         \
+        ((_brd)->brd_next_any ?     \
+         (NODE_OFFSET_TO_LBOARD(NASID_GET(_brd), (_brd)->brd_next_any)): NULL)
 #define KLCF_COMP(_brd, _ndx)   \
                 ((((_brd)->brd_compts[(_ndx)]) == 0) ? 0 : \
 			(NODE_OFFSET_TO_KLINFO(NASID_GET(_brd), (_brd)->brd_compts[(_ndx)])))
 
-#define KLCF_COMP_ERROR(_brd, _comp)    \
-                (NODE_OFFSET_TO_K0(NASID_GET(_brd), (_comp)->errinfo))
-
-#endif /* __ia64 */
-
 #define KLCF_COMP_TYPE(_comp)	((_comp)->struct_type)
 #define KLCF_BRIDGE_W_ID(_comp)	((_comp)->physid)	/* Widget ID */
 
@@ -515,7 +395,7 @@
 	nasid_t		nasid;            /* node number - from parent */
 	char		pad1;		  /* pad out structure. */
 	char		pad2;		  /* pad out structure. */
-	COMPONENT	*arcs_compt;      /* ptr to the arcs struct for ease*/
+	void		*data;
         klconf_off_t	errinfo;          /* component specific errors */
         unsigned short  pad3;             /* pci fields have moved over to */
         unsigned short  pad4;             /* klbri_t */
@@ -537,36 +417,14 @@
 #define KLSTRUCT_MEMBNK 	3
 #define KLSTRUCT_XBOW 		4
 #define KLSTRUCT_BRI 		5
-#define KLSTRUCT_IOC3 		6
-#define KLSTRUCT_PCI 		7
-#define KLSTRUCT_VME 		8
 #define KLSTRUCT_ROU		9
 #define KLSTRUCT_GFX 		10
 #define KLSTRUCT_SCSI 		11
-#define KLSTRUCT_FDDI 		12
-#define KLSTRUCT_MIO 		13
 #define KLSTRUCT_DISK 		14
-#define KLSTRUCT_TAPE 		15
 #define KLSTRUCT_CDROM 		16
-#define KLSTRUCT_HUB_UART 	17
-#define KLSTRUCT_IOC3ENET 	18
-#define KLSTRUCT_IOC3UART 	19
-#define KLSTRUCT_UNUSED		20 /* XXX UNUSED */
-#define KLSTRUCT_IOC3PCKM       21
-#define KLSTRUCT_RAD        	22
-#define KLSTRUCT_HUB_TTY        23
-#define KLSTRUCT_IOC3_TTY 	24
-
-/* Early Access IO proms are compatible
-   only with KLSTRUCT values upto 24. */
 
 #define KLSTRUCT_FIBERCHANNEL 	25
 #define KLSTRUCT_MOD_SERIAL_NUM 26
-#define KLSTRUCT_IOC3MS         27
-#define KLSTRUCT_TPU            28
-#define KLSTRUCT_GSN_A          29
-#define KLSTRUCT_GSN_B          30
-#define KLSTRUCT_XTHD           31
 #define KLSTRUCT_QLFIBRE        32
 #define KLSTRUCT_1394           33
 #define KLSTRUCT_USB		34
@@ -576,36 +434,14 @@
 #define KLSTRUCT_PEBRICK	38
 #define KLSTRUCT_GIGE           39
 #define KLSTRUCT_IDE		40
+#define KLSTRUCT_IOC4		41
+#define KLSTRUCT_IOC4UART	42
+#define KLSTRUCT_IOC4_TTY	43
+#define KLSTRUCT_IOC4PCKM	44
+#define KLSTRUCT_IOC4MS		45
+#define KLSTRUCT_IOC4_ATA	46
+#define KLSTRUCT_PCIGFX		47
 
-/*
- * These are the indices of various components within a lboard structure.
- */
-
-#define IP27_CPU0_INDEX 0
-#define IP27_CPU1_INDEX 1
-#define IP27_HUB_INDEX 2
-#define IP27_MEM_INDEX 3
-
-#define BASEIO_BRIDGE_INDEX 0
-#define BASEIO_IOC3_INDEX 1
-#define BASEIO_SCSI1_INDEX 2
-#define BASEIO_SCSI2_INDEX 3
-
-#define MIDPLANE_XBOW_INDEX 0
-#define ROUTER_COMPONENT_INDEX 0
-
-#define CH4SCSI_BRIDGE_INDEX 0
-
-/* Info holders for various hardware components */
-
-typedef u64 *pci_t;
-typedef u64 *vmeb_t;
-typedef u64 *vmed_t;
-typedef u64 *fddi_t;
-typedef u64 *scsi_t;
-typedef u64 *mio_t;
-typedef u64 *graphics_t;
-typedef u64 *router_t;
 
 /*
  * The port info in ip27_cfg area translates to a lboart_t in the 
@@ -634,7 +470,7 @@
 
 typedef struct klhub_s {			/* HUB */
 	klinfo_t 	hub_info;
-	uint 		hub_flags;		/* PCFG_HUB_xxx flags */
+	unsigned int 	hub_flags;		/* PCFG_HUB_xxx flags */
 #define MAX_NI_PORTS                    2
 	klport_t	hub_port[MAX_NI_PORTS + 1];/* hub is connected to this */
 	nic_t		hub_box_nic;		/* nic of containing box */
@@ -646,7 +482,7 @@
 
 typedef struct klhub_uart_s {			/* HUB */
 	klinfo_t 	hubuart_info;
-	uint 		hubuart_flags;		/* PCFG_HUB_xxx flags */
+	unsigned int 	hubuart_flags;		/* PCFG_HUB_xxx flags */
 	nic_t		hubuart_box_nic;	/* nic of containing box */
 	unsigned long	pad;
 } klhub_uart_t ;
@@ -662,14 +498,6 @@
 	unsigned long	pad;
 } klmembnk_t ;
 
-#define KLCONFIG_MEMBNK_SIZE(_info, _bank)	\
-                            ((_info)->membnk_bnksz[(_bank)])
-
-
-#define MEMBNK_PREMIUM 1
-#define KLCONFIG_MEMBNK_PREMIUM(_info, _bank)	\
-                            ((_info)->membnk_attr & (MEMBNK_PREMIUM << (_bank)))
-
 #define MAX_SERIAL_NUM_SIZE 10
 
 typedef struct klmod_serial_num_s {
@@ -712,48 +540,18 @@
 	klinfo_t 	bri_info ;
     	unsigned char	bri_eprominfo ;    /* IO6prom connected to bridge */
     	unsigned char	bri_bustype ;      /* PCI/VME BUS bridge/GIO */
-    	pci_t    	pci_specific  ;    /* PCI Board config info */
+    	u64	    	*pci_specific  ;    /* PCI Board config info */
 	klpci_device_t	bri_devices[MAX_PCI_DEVS] ;	/* PCI IDs */
 	klconf_off_t	bri_mfg_nic ;
 	unsigned long	pad;
 } klbri_t ;
 
-#define MAX_IOC3_TTY	2
-
-typedef struct klioc3_s {                          /* IOC3 */
-	klinfo_t 	ioc3_info ;
-    	unsigned char	ioc3_ssram ;        /* Info about ssram */
-    	unsigned char	ioc3_nvram ;        /* Info about nvram */
-    	klinfo_t	ioc3_superio ;      /* Info about superio */
-	klconf_off_t	ioc3_tty_off ;
-	klinfo_t	ioc3_enet ;
-	klconf_off_t	ioc3_enet_off ;
-	klconf_off_t	ioc3_kbd_off ;
-	unsigned long	pad;
-} klioc3_t ;
-
-#define MAX_VME_SLOTS 8
-
-typedef struct klvmeb_s {                          /* VME BRIDGE - PCI CTLR */
-	klinfo_t 	vmeb_info ;
-	vmeb_t		vmeb_specific ;
-    	klconf_off_t   	vmeb_brdinfo[MAX_VME_SLOTS]   ;    /* VME Board config info */
-	unsigned long	pad;
-} klvmeb_t ;
-
-typedef struct klvmed_s {                          /* VME DEVICE - VME BOARD */
-	klinfo_t	vmed_info ;
-	vmed_t		vmed_specific ;
-    	klconf_off_t   	vmed_brdinfo[MAX_VME_SLOTS]   ;    /* VME Board config info */
-	unsigned long	pad;
-} klvmed_t ;
-
 #define ROUTER_VECTOR_VERS	2
 
 /* XXX - Don't we need the number of ports here?!? */
 typedef struct klrou_s {                          /* ROUTER */
 	klinfo_t 	rou_info ;
-	uint		rou_flags ;           /* PCFG_ROUTER_xxx flags */
+	unsigned int	rou_flags ;           /* PCFG_ROUTER_xxx flags */
 	nic_t		rou_box_nic ;         /* nic of the containing module */
     	klport_t 	rou_port[MAX_ROUTER_PORTS + 1] ; /* array index 1 to 6 */
 	klconf_off_t	rou_mfg_nic ;     /* MFG NIC string */
@@ -777,32 +575,15 @@
 	klinfo_t 	gfx_info;
 	klconf_off_t    old_gndevs;	/* for compatibility with older proms */
 	klconf_off_t    old_gdoff0;	/* for compatibility with older proms */
-	uint		cookie;		/* for compatibility with older proms */
-	uint		moduleslot;
+	unsigned int	cookie;		/* for compatibility with older proms */
+	unsigned int	moduleslot;
 	struct klgfx_s	*gfx_next_pipe;
-	graphics_t	gfx_specific;
+	u64		*gfx_specific;
 	klconf_off_t    pad0;		/* for compatibility with older proms */
 	klconf_off_t    gfx_mfg_nic;
 	unsigned long	pad;
 } klgfx_t;
 
-typedef struct klxthd_s {   
-	klinfo_t 	xthd_info ;
-	klconf_off_t	xthd_mfg_nic ;        /* MFG NIC string */
-	unsigned long	pad;
-} klxthd_t ;
-
-typedef struct kltpu_s {                     /* TPU board */
-	klinfo_t 	tpu_info ;
-	klconf_off_t	tpu_mfg_nic ;        /* MFG NIC string */
-	unsigned long	pad;
-} kltpu_t ;
-
-typedef struct klgsn_s {                     /* GSN board */
-	klinfo_t 	gsn_info ;
-	klconf_off_t	gsn_mfg_nic ;        /* MFG NIC string */
-} klgsn_t ;
-
 #define MAX_SCSI_DEVS 16
 
 /*
@@ -814,7 +595,7 @@
 
 typedef struct klscsi_s {                          /* SCSI Bus */
 	klinfo_t 	scsi_info ;
-    	scsi_t       	scsi_specific   ; 
+    	u64       	*scsi_specific   ; 
 	unsigned char 	scsi_numdevs ;
 	klconf_off_t	scsi_devinfo[MAX_SCSI_DEVS] ; 
 	unsigned long	pad;
@@ -822,8 +603,8 @@
 
 typedef struct klscctl_s {                          /* SCSI Controller */
 	klinfo_t 	scsi_info ;
-	uint		type;
-	uint		scsi_buscnt;                        /* # busses this cntlr */
+	unsigned int	type;
+	unsigned int	scsi_buscnt;                        /* # busses this cntlr */
 	void		*scsi_bus[2];                       /* Pointer to 2 klscsi_t's */
 	unsigned long	pad;
 } klscctl_t ;
@@ -840,11 +621,9 @@
 	unsigned long	pad;
 } klttydev_t ;
 
-typedef struct klenetdev_s {                          /* ENET device */
-	klinfo_t 	enetdev_info ;
-	struct net_data *enetdev_cfg ; /* driver fills up this */
-	unsigned long	pad;
-} klenetdev_t ;
+typedef struct klpcigfx_s {                          /* PCI GFX */
+        klinfo_t        gfx_info ;
+} klpcigfx_t ;
 
 typedef struct klkbddev_s {                          /* KBD device */
 	klinfo_t 	kbddev_info ;
@@ -858,21 +637,6 @@
 	unsigned long	pad;
 } klmsdev_t ;
 
-#define MAX_FDDI_DEVS 10 /* XXX Is this true */
-
-typedef struct klfddi_s {                          /* FDDI */
-	klinfo_t 	fddi_info ;
-    	fddi_t        	fddi_specific ;       
-	klconf_off_t	fddi_devinfo[MAX_FDDI_DEVS] ;
-	unsigned long	pad;
-} klfddi_t ;
-
-typedef struct klmio_s {                          /* MIO */
-	klinfo_t 	mio_info ;
-    	mio_t       	mio_specific   ; 
-	unsigned long	pad;
-} klmio_t ;
-
 /*
  * USB info
  */
@@ -890,16 +654,11 @@
 	klmembnk_t 	kc_mem;
 	klxbow_t  	kc_xbow;
 	klbri_t		kc_bri;
-	klioc3_t	kc_ioc3;
-	klvmeb_t	kc_vmeb;
-	klvmed_t	kc_vmed;
 	klrou_t		kc_rou;
 	klgfx_t		kc_gfx;
 	klscsi_t	kc_scsi;
 	klscctl_t	kc_scsi_ctl;
 	klscdev_t	kc_scsi_dev;
-	klfddi_t	kc_fddi;
-	klmio_t		kc_mio;
 	klmod_serial_num_t kc_snum ;
 	klusb_t		kc_usb;
 } klcomp_t;
@@ -907,58 +666,12 @@
 typedef union kldev_s {      /* for device structure allocation */
 	klscdev_t	kc_scsi_dev ;
 	klttydev_t	kc_tty_dev ;
-	klenetdev_t	kc_enet_dev ;
 	klkbddev_t 	kc_kbd_dev ;
 } kldev_t ;
 
-/* Data structure interface routines. TBD */
-
-/* Include launch info in this file itself? TBD */
-
-/*
- * TBD - Can the ARCS and device driver related info also be included in the
- * KLCONFIG area. On the IO4PROM, prom device driver info is part of cfgnode_t 
- * structure, viz private to the IO4prom.
- */
-
-/* 
- * TBD - Allocation issues. 
- *
- * Do we need to Mark off sepatate heaps for lboard_t, rboard_t, component, 
- * errinfo and allocate from them, or have a single heap and allocate all 
- * structures from it. Debug is easier in the former method since we can
- * dump all similar structs in one command, but there will be lots of holes, 
- * in memory and max limits are needed for number of structures.
- * Another way to make it organized, is to have a union of all components
- * and allocate a aligned chunk of memory greater than the biggest
- * component.
- */
-
-typedef union {
-	lboard_t *lbinfo ;
-} biptr_t ;
-
-
-#define BRI_PER_XBOW 6
-#define PCI_PER_BRI  8
-#define DEV_PER_PCI  16
-
-
-/* Virtual dipswitch values (starting from switch "7"): */
-
-#define VDS_NOGFX		0x8000	/* Don't enable gfx and autoboot */
-#define VDS_NOMP		0x100	/* Don't start slave processors */
-#define VDS_MANUMODE		0x80	/* Manufacturing mode */
-#define VDS_NOARB		0x40	/* No bootmaster arbitration */
-#define VDS_PODMODE		0x20	/* Go straight to POD mode */
-#define VDS_NO_DIAGS		0x10	/* Don't run any diags after BM arb */
-#define VDS_DEFAULTS		0x08	/* Use default environment values */
-#define VDS_NOMEMCLEAR		0x04	/* Don't run mem cfg code */
-#define VDS_2ND_IO4		0x02	/* Boot from the second IO4 */
-#define VDS_DEBUG_PROM		0x01	/* Print PROM debugging messages */
-
 /* external declarations of Linux kernel functions. */
 
+extern lboard_t *root_lboard[];
 extern lboard_t *find_lboard(lboard_t *start, unsigned char type);
 extern klinfo_t *find_component(lboard_t *brd, klinfo_t *kli, unsigned char type);
 extern klinfo_t *find_first_component(lboard_t *brd, unsigned char type);
@@ -976,7 +689,6 @@
 extern int	config_find_xbow(nasid_t, lboard_t **, klxbow_t**);
 extern int 	update_klcfg_cpuinfo(nasid_t, int);
 extern void 	board_to_path(lboard_t *brd, char *path);
-extern moduleid_t get_module_id(nasid_t nasid);
 extern void 	nic_name_convert(char *old_name, char *new_name);
 extern int 	module_brds(nasid_t nasid, lboard_t **module_brds, int n);
 extern lboard_t *brd_from_key(uint64_t key);
diff -Nru a/include/asm-ia64/sn/ksys/elsc.h b/include/asm-ia64/sn/ksys/elsc.h
--- a/include/asm-ia64/sn/ksys/elsc.h	Tue Feb  3 19:45:41 2004
+++ b/include/asm-ia64/sn/ksys/elsc.h	Tue Feb  3 19:45:41 2004
@@ -1,13 +1,12 @@
-/* $Id$
- *
+/*
  * 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) 1992-1997, 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  */
-#ifndef _ASM_SN_KSYS_ELSC_H
-#define _ASM_SN_KSYS_ELSC_H
+#ifndef _ASM_IA64_SN_KSYS_ELSC_H
+#define _ASM_IA64_SN_KSYS_ELSC_H
 
 /*
  * Error codes
@@ -37,4 +36,4 @@
 #define ELSC_ERROR_NVMAGIC	       (-124)	/* Bad magic no. in NVRAM   */
 #define ELSC_ERROR_MODULE	       (-125)	/* Moduleid processing err  */
 
-#endif /* _ASM_SN_KSYS_ELSC_H */
+#endif /* _ASM_IA64_SN_KSYS_ELSC_H */
diff -Nru a/include/asm-ia64/sn/ksys/l1.h b/include/asm-ia64/sn/ksys/l1.h
--- a/include/asm-ia64/sn/ksys/l1.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/sn/ksys/l1.h	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -7,8 +6,8 @@
  * Copyright (C) 1992-1997,2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  */
 
-#ifndef _ASM_SN_KSYS_L1_H
-#define _ASM_SN_KSYS_L1_H
+#ifndef _ASM_IA64_SN_KSYS_L1_H
+#define _ASM_IA64_SN_KSYS_L1_H
 
 #include <asm/sn/types.h>
 
@@ -88,17 +87,23 @@
 					   command string */
 
 /* brick type response codes */
+#define L1_BRICKTYPE_PX         0x23            /* # */
+#define L1_BRICKTYPE_PE         0x25            /* % */
+#define L1_BRICKTYPE_N_p0       0x26            /* & */
 #define L1_BRICKTYPE_IP45       0x34            /* 4 */
-#define L1_BRICKTYPE_C          0x43            /* C */
-#define L1_BRICKTYPE_I          0x49            /* I */
-#define L1_BRICKTYPE_P          0x50            /* P */
-#define L1_BRICKTYPE_R          0x52            /* R */
-#define L1_BRICKTYPE_X          0x58            /* X */
-#define L1_BRICKTYPE_X2         0x59            /* Y */
-#define L1_BRICKTYPE_N          0x4e            /* N */
-#define L1_BRICKTYPE_PE		0x25		/* % */
-#define L1_BRICKTYPE_PX		0x23		/* # */
-#define L1_BRICKTYPE_IX		0x3d		/* = */
+#define L1_BRICKTYPE_IP41       0x35            /* 5 */
+#define L1_BRICKTYPE_TWISTER    0x36            /* 6 */ /* IP53 & ROUTER */
+#define L1_BRICKTYPE_IX         0x3d            /* = */
+#define L1_BRICKTYPE_IP34       0x61            /* a */
+#define L1_BRICKTYPE_C          0x63            /* c */
+#define L1_BRICKTYPE_I          0x69            /* i */
+#define L1_BRICKTYPE_N          0x6e            /* n */
+#define L1_BRICKTYPE_OPUS       0x6f		/* o */
+#define L1_BRICKTYPE_P          0x70            /* p */
+#define L1_BRICKTYPE_R          0x72            /* r */
+#define L1_BRICKTYPE_CHI_CG     0x76            /* v */
+#define L1_BRICKTYPE_X          0x78            /* x */
+#define L1_BRICKTYPE_X2         0x79            /* y */
 
 /* EEPROM codes (for the "read EEPROM" request) */
 /* c brick */
@@ -130,7 +135,7 @@
 int	elsc_display_line(nasid_t nasid, char *line, int lnum);
 int	iobrick_rack_bay_type_get( nasid_t nasid, unsigned int *rack,
 				   unsigned int *bay, unsigned int *brick_type );
-int	iobrick_module_get( nasid_t nasid );
+int	iomoduleid_get( nasid_t nasid );
 
 
-#endif /* _ASM_SN_KSYS_L1_H */
+#endif /* _ASM_IA64_SN_KSYS_L1_H */
diff -Nru a/include/asm-ia64/sn/labelcl.h b/include/asm-ia64/sn/labelcl.h
--- a/include/asm-ia64/sn/labelcl.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-ia64/sn/labelcl.h	Tue Feb  3 19:45:34 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -13,20 +12,6 @@
 #define LABEL_LENGTH_MAX 256		/* Includes NULL char */
 #define INFO_DESC_PRIVATE (-1)      	/* default */
 #define INFO_DESC_EXPORT  0       	/* export info itself */
-
-/*
- * Internal Error codes.
- */
-typedef enum labelcl_error_e {  LABELCL_SUCCESS,          /* 0 */
-                                LABELCL_DUP,              /* 1 */
-                                LABELCL_NOT_FOUND,        /* 2 */
-                                LABELCL_BAD_PARAM,        /* 3 */
-                                LABELCL_HIT_LIMIT,        /* 4 */
-                                LABELCL_CANNOT_ALLOC,     /* 5 */
-                                LABELCL_ILLEGAL_REQUEST,  /* 6 */
-                                LABELCL_IN_USE            /* 7 */
-                                } labelcl_error_t;
-
 
 /*
  * Description of a label entry.
diff -Nru a/include/asm-ia64/sn/module.h b/include/asm-ia64/sn/module.h
--- a/include/asm-ia64/sn/module.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/sn/module.h	Tue Feb  3 19:45:17 2004
@@ -30,6 +30,7 @@
 /* parameter for format_module_id() */
 #define MODULE_FORMAT_BRIEF	1
 #define MODULE_FORMAT_LONG	2
+#define MODULE_FORMAT_LCD	3
 
 /*
  *	Module id format
@@ -138,6 +139,8 @@
 #define MODULE_PEBRICK          8
 #define MODULE_PXBRICK          9
 #define MODULE_IXBRICK          10
+#define MODULE_CGBRICK		11
+#define MODULE_OPUSBRICK        12
 
 /*
  * Moduleid_t comparison macros
@@ -164,7 +167,6 @@
     /* Fields for Module System Controller */
     int			mesgpend;	/* Message pending                 */
     int			shutdown;	/* Shutdown in progress            */
-    struct semaphore	thdcnt;		/* Threads finished counter        */
     time_t		intrhist[MODULE_HIST_CNT];
     int			histptr;
 
diff -Nru a/include/asm-ia64/sn/nag.h b/include/asm-ia64/sn/nag.h
--- a/include/asm-ia64/sn/nag.h	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,32 +0,0 @@
-/*
- *
- * 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) 2001-2003 Silicon Graphics, Inc.  All rights reserved.
-*/
-
-
-#ifndef _ASM_IA64_SN_NAG_H
-#define _ASM_IA64_SN_NAG_H
-
-
-#define NAG(mesg...) \
-do {										\
-	static unsigned int how_broken = 1;					\
-	static unsigned int threshold = 1;					\
-	if (how_broken == threshold) {						\
-		if (threshold < 10000)						\
-			threshold *= 10;					\
-		if (how_broken > 1)						\
-			printk(KERN_WARNING "%u times: ", how_broken);		\
-		else								\
-			printk(KERN_WARNING);					\
-		printk(mesg);							\
-	}									\
-	how_broken++;								\
-} while (0)
-
-
-#endif /* _ASM_IA64_SN_NAG_H */
diff -Nru a/include/asm-ia64/sn/nodepda.h b/include/asm-ia64/sn/nodepda.h
--- a/include/asm-ia64/sn/nodepda.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/sn/nodepda.h	Tue Feb  3 19:45:17 2004
@@ -12,7 +12,6 @@
 #include <linux/config.h>
 #include <asm/sn/sgi.h>
 #include <asm/irq.h>
-#include <asm/topology.h>
 #include <asm/sn/intr.h>
 #include <asm/sn/router.h>
 #include <asm/sn/pda.h>
@@ -65,6 +64,8 @@
 	nodepda_router_info_t	*npda_rip_first;
 	nodepda_router_info_t	**npda_rip_last;
 
+
+	spinlock_t		bist_lock;
 
 	/*
 	 * The BTEs on this node are shared by the local cpus
diff -Nru a/include/asm-ia64/sn/pci/bridge.h b/include/asm-ia64/sn/pci/bridge.h
--- a/include/asm-ia64/sn/pci/bridge.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/sn/pci/bridge.h	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -38,7 +37,6 @@
 #include <asm/sn/xtalk/xwidget.h>
 #include <asm/sn/pci/pic.h>
 
-extern int io_get_sh_swapper(nasid_t);
 #define BRIDGE_REG_GET32(reg) \
                 __swab32( *(volatile uint32_t *) (((uint64_t)reg)^4) )
 
@@ -47,11 +45,11 @@
 
 /* I/O page size */
 
-#if _PAGESZ == 4096
+#if PAGE_SIZE == 4096
 #define IOPFNSHIFT		12	/* 4K per mapped page */
 #else
 #define IOPFNSHIFT		14	/* 16K per mapped page */
-#endif				/* _PAGESZ */
+#endif				/* PAGE_SIZE */
 
 #define IOPGSIZE		(1 << IOPFNSHIFT)
 #define IOPG(x)			((x) >> IOPFNSHIFT)
@@ -917,12 +915,8 @@
 
 #define PCIBR_TYPE1_CFG(ps)         PCIBRIDGE_TYPE1_CFG((ps)->bs_busnum)
 #define PCIBR_BUS_TYPE0_CFG_DEV0(ps) PCIBR_TYPE0_CFG_DEV(ps, 0)
-#define PCIBR_TYPE0_CFG_DEV(ps, s) \
-    ((IS_PIC_SOFT(ps)) ? PCIBRIDGE_TYPE0_CFG_DEV((ps)->bs_busnum, s+1) : \
-		  	     PCIBRIDGE_TYPE0_CFG_DEV((ps)->bs_busnum, s))
-#define PCIBR_BUS_TYPE0_CFG_DEVF(ps,s,f) \
-    ((IS_PIC_SOFT(ps)) ? PCIBRIDGE_TYPE0_CFG_DEVF((ps)->bs_busnum,(s+1),f) : \
-			     PCIBRIDGE_TYPE0_CFG_DEVF((ps)->bs_busnum,s,f))
+#define PCIBR_TYPE0_CFG_DEV(ps, s) PCIBRIDGE_TYPE0_CFG_DEV((ps)->bs_busnum, s+1)
+#define PCIBR_BUS_TYPE0_CFG_DEVF(ps,s,f) PCIBRIDGE_TYPE0_CFG_DEVF((ps)->bs_busnum,(s+1),f)
 
 #endif				/* LANGUAGE_C */
 
diff -Nru a/include/asm-ia64/sn/pci/pci_bus_cvlink.h b/include/asm-ia64/sn/pci/pci_bus_cvlink.h
--- a/include/asm-ia64/sn/pci/pci_bus_cvlink.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ia64/sn/pci/pci_bus_cvlink.h	Tue Feb  3 19:45:42 2004
@@ -1,13 +1,12 @@
-/* $Id$
- *
+/*
  * 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) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
  */
-#ifndef _ASM_SN_PCI_CVLINK_H
-#define _ASM_SN_PCI_CVLINK_H
+#ifndef _ASM_IA64_SN_PCI_CVLINK_H
+#define _ASM_IA64_SN_PCI_CVLINK_H
 
 #include <asm/sn/types.h>
 #include <asm/sn/sgi.h>
@@ -18,7 +17,6 @@
 #include <asm/sn/xtalk/xwidget.h>
 #include <asm/sn/sn_private.h>
 #include <asm/sn/addrs.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/hcl_util.h>
 #include <asm/sn/intr.h>
@@ -40,8 +38,6 @@
 #define IS_PCI32G(dev)	((dev)->dma_mask >= 0xffffffff)
 #define IS_PCI32L(dev)	((dev)->dma_mask < 0xffffffff)
 
-#define IS_PIC_DEVICE(dev) ((struct sn_device_sysdata *)dev->sysdata)->isPIC
-
 #define PCIDEV_VERTEX(pci_dev) \
 	(((struct sn_device_sysdata *)((pci_dev)->sysdata))->vhdl)
 
@@ -55,9 +51,9 @@
 struct sn_device_sysdata {
         vertex_hdl_t  vhdl;
 	int		isa64;
-	int		isPIC;
 	volatile unsigned int *dma_buf_sync;
 	volatile unsigned int *xbow_buf_sync;
+	pciio_provider_t	*pci_provider;
 };
 
 struct ioports_to_tlbs_s {
@@ -74,4 +70,4 @@
 			ig:11;
 };
 
-#endif				/* _ASM_SN_PCI_CVLINK_H */
+#endif				/* _ASM_IA64_SN_PCI_CVLINK_H */
diff -Nru a/include/asm-ia64/sn/pci/pci_defs.h b/include/asm-ia64/sn/pci/pci_defs.h
--- a/include/asm-ia64/sn/pci/pci_defs.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/sn/pci/pci_defs.h	Tue Feb  3 19:45:17 2004
@@ -1,15 +1,12 @@
-/* $Id$
- *
+/*
  * 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) 1992-1997,2000-2003 Silicon Graphics, Inc. All rights reserved.
  */
-#ifndef _ASM_SN_PCI_PCI_DEFS_H
-#define _ASM_SN_PCI_PCI_DEFS_H
-
-#include <linux/config.h>
+#ifndef _ASM_IA64_SN_PCI_PCI_DEFS_H
+#define _ASM_IA64_SN_PCI_PCI_DEFS_H
 
 /* defines for the PCI bus architecture */
 
@@ -245,7 +242,7 @@
 
 #else
 
-extern uint pci_read(void * address, int type);
+extern unsigned int pci_read(void * address, int type);
 extern void pci_write(void * address, int data, int type);
 
 #define BYTE   1
@@ -278,16 +275,6 @@
 #define CFG1_DEVICE_SHIFT		11
 #define CFG1_BUS_SHIFT			16
 
-#ifdef CONFIG_SGI_IP32
- /* Definitions related to IP32 PCI Bridge policy
-  * XXX- should probaly be moved to a mace-specific header
-  */
-#define PCI_CONFIG_BITS			0xfe0085ff
-#define	PCI_CONTROL_MRMRA_ENABLE	0x00000800
-#define PCI_FIRST_IO_ADDR		0x1000
-#define PCI_IO_MAP_INCR			0x1000
-#endif /* CONFIG_SGI_IP32 */
-
 /*
  * Class codes
  */
@@ -321,8 +308,6 @@
 
 #ifndef __ASSEMBLY__
 
-#ifdef LITTLE_ENDIAN
-
 /*
  * PCI config space definition
  */
@@ -331,24 +316,24 @@
 	uint16_t	dev_id;
 	uint16_t	cmd;
 	uint16_t	status;
-	uchar_t		rev;
-        uchar_t         prog_if;
-	uchar_t		sub_class;
-	uchar_t		class;
-	uchar_t		line_size;
-	uchar_t		lt;
-	uchar_t		hdr_type;
-	uchar_t		bist;
+	uint8_t		rev;
+	uint8_t         prog_if;
+	uint8_t		sub_class;
+	uint8_t		class;
+	uint8_t		line_size;
+	uint8_t		lt;
+	uint8_t		hdr_type;
+	uint8_t		bist;
 	uint32_t	bar[6];
 	uint32_t	cardbus;
 	uint16_t	subsys_vendor_id;
 	uint16_t	subsys_dev_id;
 	uint32_t	exp_rom;
 	uint32_t	res[2];
-	uchar_t		int_line;
-	uchar_t		int_pin;
-	uchar_t		min_gnt;
-	uchar_t		max_lat;
+	uint8_t		int_line;
+	uint8_t		int_pin;
+	uint8_t		min_gnt;
+	uint8_t		max_lat;
 } pci_cfg_t;
 
 /*
@@ -359,21 +344,21 @@
 	uint16_t	dev_id;
 	uint16_t	cmd;
 	uint16_t	status;
-	uchar_t		rev;
-	uchar_t		prog_if;
-	uchar_t		sub_class;
-	uchar_t		class;
-	uchar_t		line_size;
-	uchar_t		lt;
-	uchar_t		hdr_type;
-	uchar_t		bist;
+	uint8_t		rev;
+	uint8_t		prog_if;
+	uint8_t		sub_class;
+	uint8_t		class;
+	uint8_t		line_size;
+	uint8_t		lt;
+	uint8_t		hdr_type;
+	uint8_t		bist;
 	uint32_t	bar[2];
-	uchar_t		pri_bus_num;
-	uchar_t		snd_bus_num;
-	uchar_t		sub_bus_num;
-	uchar_t		slt;
-	uchar_t		io_base;
-	uchar_t		io_limit;
+	uint8_t		pri_bus_num;
+	uint8_t		snd_bus_num;
+	uint8_t		sub_bus_num;
+	uint8_t		slt;
+	uint8_t		io_base;
+	uint8_t		io_limit;
 	uint16_t	snd_status;
 	uint16_t	mem_base;
 	uint16_t	mem_limit;
@@ -385,8 +370,8 @@
 	uint16_t	io_limit_upper;
 	uint32_t	res;
 	uint32_t	exp_rom;
-	uchar_t		int_line;
-	uchar_t		int_pin;
+	uint8_t		int_line;
+	uint8_t		int_pin;
 	uint16_t	ppb_control;
 
 } pci_cfg1_t;
@@ -419,117 +404,11 @@
 } cap_pcix_stat_reg_t;
 
 typedef volatile struct cap_pcix_type0_s {
-	uchar_t			pcix_cap_id;
-	uchar_t			pcix_cap_nxt;
-	cap_pcix_cmd_reg_t	pcix_type0_command;
-	cap_pcix_stat_reg_t	pcix_type0_status;
-} cap_pcix_type0_t;
-
-#else
-
-/*
- * PCI config space definition
- */
-typedef volatile struct pci_cfg_s {
-	uint16_t	dev_id;
-	uint16_t	vendor_id;
-	uint16_t	status;
-	uint16_t	cmd;
-	uchar_t		class;
-	uchar_t		sub_class;
-	uchar_t		prog_if;
-	uchar_t		rev;
-	uchar_t		bist;
-	uchar_t		hdr_type;
-	uchar_t		lt;
-	uchar_t		line_size;
-	uint32_t	bar[6];
-	uint32_t	cardbus;
-	uint16_t	subsys_dev_id;
-	uint16_t	subsys_vendor_id;
-	uint32_t	exp_rom;
-	uint32_t	res[2];
-	uchar_t		max_lat;
-	uchar_t		min_gnt;
-	uchar_t		int_pin;
-	uchar_t		int_line;
-} pci_cfg_t;
-
-/*
- * PCI Type 1 config space definition for PCI to PCI Bridges (PPBs)
- */
-typedef volatile struct pci_cfg1_s {
-	uint16_t	dev_id;
-	uint16_t	vendor_id;
-	uint16_t	status;
-	uint16_t	cmd;
-	uchar_t		class;
-	uchar_t		sub_class;
-	uchar_t		prog_if;
-	uchar_t		rev;
-	uchar_t		bist;
-	uchar_t		hdr_type;
-	uchar_t		lt;
-	uchar_t		line_size;
-	uint32_t	bar[2];
-	uchar_t		slt;
-	uchar_t		sub_bus_num;
-	uchar_t		snd_bus_num;
-	uchar_t		pri_bus_num;
-	uint16_t	snd_status;
-	uchar_t		io_limit;
-	uchar_t		io_base;
-	uint16_t	mem_limit;
-	uint16_t	mem_base;
-	uint16_t	pmem_limit;
-	uint16_t	pmem_base;
-	uint32_t	pmem_limit_upper;
-	uint32_t	pmem_base_upper;
-	uint16_t	io_limit_upper;
-	uint16_t	io_base_upper;
-	uint32_t	res;
-	uint32_t	exp_rom;
-	uint16_t	ppb_control;
-	uchar_t		int_pin;
-	uchar_t		int_line;
-} pci_cfg1_t;
-
-
-
-/*
- * PCI-X Capability
- */
-typedef volatile struct cap_pcix_cmd_reg_s {
-	uint16_t	reserved1:              9,
-			max_split:		3,
-			max_mem_read_cnt:	2,
-			enable_relaxed_order:	1,
-			data_parity_enable:	1;
-} cap_pcix_cmd_reg_t;
-
-typedef volatile struct cap_pcix_stat_reg_s {
-	uint32_t	reserved1:		2,
-			split_complt_err:	1,
-			max_cum_read:		3,
-			max_out_split:		3,
-			max_mem_read_cnt:	2,
-			device_complex:		1,
-			unexpect_split_complt:	1,
-			split_complt_discard:	1,
-			mhz133_capable:		1,
-			bit64_device:		1,
-			bus_num:		8,
-			dev_num:		5,
-			func_num:		3;
-} cap_pcix_stat_reg_t;
-
-typedef volatile struct cap_pcix_type0_s {
+	uint8_t			pcix_cap_id;
+	uint8_t			pcix_cap_nxt;
 	cap_pcix_cmd_reg_t	pcix_type0_command;
-	uchar_t			pcix_cap_nxt;
-	uchar_t			pcix_cap_id;
 	cap_pcix_stat_reg_t	pcix_type0_status;
 } cap_pcix_type0_t;
 
-#endif
 #endif	/* __ASSEMBLY__ */
-#endif /* _ASM_SN_PCI_PCI_DEFS_H */
+#endif /* _ASM_IA64_SN_PCI_PCI_DEFS_H */
diff -Nru a/include/asm-ia64/sn/pci/pcibr.h b/include/asm-ia64/sn/pci/pcibr.h
--- a/include/asm-ia64/sn/pci/pcibr.h	Tue Feb  3 19:45:41 2004
+++ b/include/asm-ia64/sn/pci/pcibr.h	Tue Feb  3 19:45:41 2004
@@ -1,13 +1,12 @@
-/* $Id$
- *
+/*
  * 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) 1992-1997,2000-2003 Silicon Graphics, Inc. All rights reserved.
  */
-#ifndef _ASM_SN_PCI_PCIBR_H
-#define _ASM_SN_PCI_PCIBR_H
+#ifndef _ASM_IA64_SN_PCI_PCIBR_H
+#define _ASM_IA64_SN_PCI_PCIBR_H
 
 #if defined(__KERNEL__)
 
@@ -212,9 +211,6 @@
 					 unsigned size,
 					 uint64_t value);
 
-extern int		pcibr_error_devenable(vertex_hdl_t pconn_vhdl,
-					      int error_code);
-
 extern int		pcibr_wrb_flush(vertex_hdl_t pconn_vhdl);
 extern int		pcibr_rrb_check(vertex_hdl_t pconn_vhdl,
 					int *count_vchan0,
@@ -238,7 +234,7 @@
 					       rrb_alloc_funct_f *func);
 
 extern int		pcibr_device_unregister(vertex_hdl_t);
-extern int		pcibr_dma_enabled(vertex_hdl_t);
+
 /*
  * Bridge-specific flags that can be set via pcibr_device_flags_set
  * and cleared via pcibr_device_flags_clear.  Other flags are
@@ -422,7 +418,7 @@
     int                     resp_bss_ninfo;
     char                    resp_bss_devio_bssd_space[16];
     iopaddr_t               resp_bss_devio_bssd_base; 
-    bridgereg_t             resp_bss_device;
+    uint64_t		    resp_bss_device;
     int                     resp_bss_pmu_uctr;
     int                     resp_bss_d32_uctr;
     int                     resp_bss_d64_uctr;
@@ -430,7 +426,7 @@
     unsigned                resp_bss_d64_flags;
     iopaddr_t               resp_bss_d32_base;
     unsigned                resp_bss_d32_flags;
-    atomic_t                resp_bss_ext_ates_active;
+    atomic_t		    resp_bss_ext_ates_active;
     volatile unsigned      *resp_bss_cmd_pointer;
     unsigned                resp_bss_cmd_shadow;
     int                     resp_bs_rrb_valid;
@@ -438,10 +434,10 @@
     int                     resp_bs_rrb_valid_v2;
     int                     resp_bs_rrb_valid_v3;
     int                     resp_bs_rrb_res;
-    bridgereg_t             resp_b_resp;
-    bridgereg_t             resp_b_int_device;
-    bridgereg_t             resp_b_int_enable;
-    bridgereg_t             resp_b_int_host;
+    uint64_t		    resp_b_resp;
+    uint64_t		    resp_b_int_device;
+    uint64_t		    resp_b_int_enable;
+    uint64_t		    resp_b_int_host;
     picreg_t		    resp_p_int_enable;
     picreg_t		    resp_p_int_host;
     struct pcibr_slot_func_info_resp_s {
@@ -508,4 +504,4 @@
 /* ERANGE                        34    */
 /* EUNATCH                       42    */
 
-#endif				/* _ASM_SN_PCI_PCIBR_H */
+#endif				/* _ASM_IA64_SN_PCI_PCIBR_H */
diff -Nru a/include/asm-ia64/sn/pci/pcibr_private.h b/include/asm-ia64/sn/pci/pcibr_private.h
--- a/include/asm-ia64/sn/pci/pcibr_private.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ia64/sn/pci/pcibr_private.h	Tue Feb  3 19:45:16 2004
@@ -1,13 +1,12 @@
-/* $Id$
- *
+/*
  * 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) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
  */
-#ifndef _ASM_SN_PCI_PCIBR_PRIVATE_H
-#define _ASM_SN_PCI_PCIBR_PRIVATE_H
+#ifndef _ASM_IA64_SN_PCI_PCIBR_PRIVATE_H
+#define _ASM_IA64_SN_PCI_PCIBR_PRIVATE_H
 
 /*
  * pcibr_private.h -- private definitions for pcibr
@@ -44,6 +43,10 @@
 cfg_p pcibr_func_config_addr(bridge_t *, pciio_bus_t bus, pciio_slot_t, pciio_function_t, int);
 unsigned pcibr_slot_config_get(bridge_t *, pciio_slot_t, int);
 unsigned pcibr_func_config_get(bridge_t *, pciio_slot_t, pciio_function_t, int);
+extern void pcireg_intr_enable_bit_clr(void *, uint64_t);
+extern void pcireg_intr_enable_bit_set(void *, uint64_t);
+extern void pcireg_intr_addr_addr_set(void *, int, uint64_t);
+extern void pcireg_force_intr_set(void *, int);
 void pcibr_debug(uint32_t, vertex_hdl_t, char *, ...);
 void pcibr_slot_config_set(bridge_t *, pciio_slot_t, int, unsigned);
 void pcibr_func_config_set(bridge_t *, pciio_slot_t, pciio_function_t, int, 
@@ -90,7 +93,7 @@
  * set, then the overhead for this macro is just an extra 'if' check.
  */
 /* For high frequency events (ie. map allocation, direct translation,...) */
-#if 1 || DEBUG
+#if DEBUG
 #define PCIBR_DEBUG(args) PCIBR_DEBUG_ALWAYS(args)
 #else	/* DEBUG */
 #define PCIBR_DEBUG(args)
@@ -163,8 +166,8 @@
 #define	bi_flags	bi_pi.pi_flags	/* PCIBR_INTR flags */
 #define	bi_dev		bi_pi.pi_dev	/* associated pci card */
 #define	bi_lines	bi_pi.pi_lines	/* which PCI interrupt line(s) */
-#define bi_func		bi_pi.pi_func	/* handler function (when connected) */
-#define bi_arg		bi_pi.pi_arg	/* handler parameter (when connected) */
+#define	bi_func		bi_pi.pi_func	/* handler function (when connected) */
+#define	bi_arg		bi_pi.pi_arg	/* handler parameter (when connected) */
 #define bi_mustruncpu	bi_pi.pi_mustruncpu /* Where we must run. */
 #define bi_irq		bi_pi.pi_irq	/* IRQ assigned. */
 #define bi_cpu		bi_pi.pi_cpu	/* cpu assigned. */
@@ -200,14 +203,10 @@
 #define PCIBR_INFO_SLOT_GET_INT(info)	    (((pcibr_info_t)info)->f_dev)
 
 #define PCIBR_DEVICE_TO_SLOT(pcibr_soft, dev_num) \
-	(((dev_num) != PCIIO_SLOT_NONE) ? \
-	    (IS_PIC_SOFT((pcibr_soft)) ? ((dev_num) + 1) : (dev_num)) : \
-	    PCIIO_SLOT_NONE)
+	(((dev_num) != PCIIO_SLOT_NONE) ? ((dev_num) + 1) : PCIIO_SLOT_NONE)
 
 #define PCIBR_SLOT_TO_DEVICE(pcibr_soft, slot) \
-        (((slot) != PCIIO_SLOT_NONE) ? \
-            (IS_PIC_SOFT((pcibr_soft)) ? ((slot) - 1) : (slot)) : \
-            PCIIO_SLOT_NONE)
+        (((slot) != PCIIO_SLOT_NONE) ? ((slot) - 1) : PCIIO_SLOT_NONE)
 
 /*
  * per-connect point pcibr data, including standard pciio data in-line:
@@ -225,11 +224,11 @@
 #define	f_pops		f_c.c_pops	/* cached provider from c_master */
 #define	f_efunc		f_c.c_efunc	/* error handling function */
 #define	f_einfo		f_c.c_einfo	/* first parameter for efunc */
-#define f_window        f_c.c_window    /* state of BASE regs */
+#define	f_window	f_c.c_window	/* state of BASE regs */
 #define	f_rwindow	f_c.c_rwindow	/* expansion ROM BASE regs */
 #define	f_rbase		f_c.c_rbase	/* expansion ROM base */
 #define	f_rsize		f_c.c_rsize	/* expansion ROM size */
-#define f_piospace      f_c.c_piospace  /* additional I/O spaces allocated */
+#define	f_piospace	f_c.c_piospace	/* additional I/O spaces allocated */
 
     /* pcibr-specific connection state */
     int			    f_ibit[4];	/* Bridge bit for each INTx */
@@ -276,9 +275,9 @@
 #define PCIBR_BUS_IO_MAX       0x0FFFFFFF
 #define PCIBR_BUS_IO_PAGE      0x100000
 
-#define PCIBR_BUS_SWIN_BASE    _PAGESZ
+#define PCIBR_BUS_SWIN_BASE    PAGE_SIZE
 #define PCIBR_BUS_SWIN_MAX     0x000FFFFF
-#define PCIBR_BUS_SWIN_PAGE    _PAGESZ
+#define PCIBR_BUS_SWIN_PAGE    PAGE_SIZE
 
 #define PCIBR_BUS_MEM_BASE     0x200000
 #define PCIBR_BUS_MEM_MAX      0x3FFFFFFF
@@ -288,12 +287,7 @@
 #define PCIBR_BRIDGETYPE_BRIDGE		0
 #define PCIBR_BRIDGETYPE_XBRIDGE	1
 #define PCIBR_BRIDGETYPE_PIC		2
-#define IS_XBRIDGE_SOFT(ps) (ps->bs_bridge_type == PCIBR_BRIDGETYPE_XBRIDGE)
-#define IS_PIC_SOFT(ps)     (ps->bs_bridge_type == PCIBR_BRIDGETYPE_PIC)
-#define IS_PIC_BUSNUM_SOFT(ps, bus)	\
-		(IS_PIC_SOFT(ps) && ((ps)->bs_busnum == (bus)))
-#define IS_BRIDGE_SOFT(ps)  (ps->bs_bridge_type == PCIBR_BRIDGETYPE_BRIDGE)
-#define IS_XBRIDGE_OR_PIC_SOFT(ps) (IS_XBRIDGE_SOFT(ps) || IS_PIC_SOFT(ps))
+#define IS_PIC_BUSNUM_SOFT(ps, bus)	((ps)->bs_busnum == (bus))
 
 /*
  * Runtime checks for workarounds.
@@ -302,11 +296,13 @@
 	((1 << XWIDGET_PART_REV_NUM_REV(pcibr_soft->bs_rev_num)) & pv)
 /*
  * Defines for individual WARs. Each is a bitmask of applicable
- * part revision numbers. (1 << 1) == rev A, (1 << 2) == rev B, etc.
+ * part revision numbers. (1 << 1) == rev A, (1 << 2) == rev B,
+ * (3 << 1) == (rev A or rev B), etc
  */
 #define PV854697 (~0)     /* PIC: write 64bit regs as 64bits. permanent */
 #define PV854827 (~0)     /* PIC: fake widget 0xf presence bit. permanent */
-#define PV855271 (1 << 1) /* PIC: PIC: use virt chan iff 64-bit device. */
+#define PV855271 (1 << 1) /* PIC: use virt chan iff 64-bit device. */
+#define PV878674 (~0)     /* PIC: Dont allow 64bit PIOs.  permanent */
 #define PV855272 (1 << 1) /* PIC: runaway interrupt WAR */
 #define PV856155 (1 << 1) /* PIC: arbitration WAR */
 #define PV856864 (1 << 1) /* PIC: lower timeout to free TNUMs quicker */
@@ -314,6 +310,9 @@
 #define PV862253 (1 << 1) /* PIC: don't enable write req RAM parity checking */
 #define PV867308 (3 << 1) /* PIC: make LLP error interrupts FATAL for PIC */
 
+/* Bridgetype macros given a pcibr_soft structure */
+#define IS_PIC_SOFT(ps)     (ps->bs_bridge_type == PCIBR_BRIDGETYPE_PIC)
+
 
 /* defines for pcibr_soft_s->bs_bridge_mode */
 #define PCIBR_BRIDGEMODE_PCI_33		0x0
@@ -372,13 +371,15 @@
     short		    bs_int_ate_size;	/* number of internal ates */
     short		    bs_bridge_type;	/* see defines above */
     short		    bs_bridge_mode;	/* see defines above */
-    int                     bs_rev_num;		/* revision number of Bridge */
+
+    int                     bs_rev_num;	/* revision number of Bridge */
 
     /* bs_dma_flags are the forced dma flags used on all DMAs. Used for
      * working around ASIC rev issues and protocol specific requirements
      */
     unsigned                bs_dma_flags;	/* forced DMA flags */
 
+    nasid_t		    bs_nasid;		/* nasid this bus is on */
     moduleid_t		    bs_moduleid;	/* io brick moduleid */
     short		    bs_bricktype;	/* io brick type */
 
@@ -445,7 +446,7 @@
 	/* Shadow value for Device(x) register,
 	 * so we don't have to go to the chip.
 	 */
-	bridgereg_t             bss_device;
+	uint64_t		bss_device;
 
 	/* Number of sets on GBR/REALTIME bit outstanding
 	 * Used by Priority I/O for tracking reservations
@@ -522,9 +523,9 @@
      *  time for the indexed slot/vchan number; array[slot][vchan]
      */
     int                     bs_rrb_fixed;
-    int                     bs_rrb_avail[2];
-    int                     bs_rrb_res[8];
-    int                     bs_rrb_res_dflt[8];
+    int			    bs_rrb_avail[2];
+    int			    bs_rrb_res[8];
+    int			    bs_rrb_res_dflt[8];
     int			    bs_rrb_valid[8][4];
     int			    bs_rrb_valid_dflt[8][4];
     struct {
@@ -537,6 +538,10 @@
 	 * Bridge interrupt bit.
 	 */
 	struct pcibr_intr_wrap_s  bsi_pcibr_intr_wrap;
+	/* The bus and interrupt bit, used for pcibr_setpciint().
+	 * The pci busnum is bit3, int_bits bit2:0
+	 */
+	uint32_t		bsi_int_bit;
 
     } bs_intr[8];
 
@@ -564,9 +569,6 @@
      */
     struct br_errintr_info {
 	int                     bserr_toutcnt;
-#ifdef LATER
-	toid_t                  bserr_toutid;	/* Timeout started by errintr */
-#endif	/* LATER */
 	iopaddr_t               bserr_addr;	/* Address where error occured */
 	uint64_t		bserr_intstat;	/* interrupts active at error dump */
     } bs_errinfo;
@@ -602,9 +604,9 @@
 #define PCIBR_BUS_ADDR_IO_FREED        2  /* Reserved PROM I/O addr freed */
 
     struct bs_errintr_stat_s {
-	uint32_t              bs_errcount_total;
-	uint32_t              bs_lasterr_timestamp;
-	uint32_t              bs_lasterr_snapshot;
+	uint32_t		bs_errcount_total;
+	uint32_t		bs_lasterr_timestamp;
+	uint32_t		bs_lasterr_snapshot;
     } bs_errintr_stat[PCIBR_ISR_MAX_ERRS];
 
     /*
@@ -660,17 +662,6 @@
 #define pcibr_soft_set(v,i)     (hwgraph_fastinfo_set((v), (arbitrary_info_t)(i)))
 
 /*
- * mem alloc/free macros
- */
-#define NEWAf(ptr,n,f)	(ptr = snia_kmem_zalloc((n)*sizeof (*(ptr)), (f&PCIIO_NOSLEEP)?KM_NOSLEEP:KM_SLEEP))
-#define NEWA(ptr,n)	(ptr = snia_kmem_zalloc((n)*sizeof (*(ptr)), KM_SLEEP))
-#define DELA(ptr,n)	(kfree(ptr))
-
-#define NEWf(ptr,f)	NEWAf(ptr,1,f)
-#define NEW(ptr)	NEWA(ptr,1)
-#define DEL(ptr)	DELA(ptr,1)
-
-/*
  * Additional PIO spaces per slot are
  * recorded in this structure.
  */
@@ -682,17 +673,17 @@
     size_t                  count;	/* size of PIO space */
 };
 
-/* Use io spin locks. This ensures that all the PIO writes from a particular
- * CPU to a particular IO device are synched before the start of the next
- * set of PIO operations to the same device.
- */
-#ifdef PCI_LATER
-#define pcibr_lock(pcibr_soft)		io_splock(pcibr_soft->bs_lock)
-#define pcibr_unlock(pcibr_soft, s)	io_spunlock(pcibr_soft->bs_lock,s)
-#else
-#define pcibr_lock(pcibr_soft)		1
-#define pcibr_unlock(pcibr_soft, s)	
-#endif	/* PCI_LATER */
+/* 
+ * pcibr_soft structure locking macros
+ */
+inline static unsigned long
+pcibr_lock(pcibr_soft_t pcibr_soft)
+{
+        unsigned long flag;
+        spin_lock_irqsave(&pcibr_soft->bs_lock, flag);
+        return(flag);
+}
+#define pcibr_unlock(pcibr_soft, flag)  spin_unlock_irqrestore(&pcibr_soft->bs_lock, flag)
 
 #define PCIBR_VALID_SLOT(ps, s)     (s < PCIBR_NUM_SLOTS(ps))
 #define PCIBR_D64_BASE_UNSET    (0xFFFFFFFFFFFFFFFF)
@@ -703,18 +694,18 @@
 #if PCIBR_SOFT_LIST
 typedef struct pcibr_list_s *pcibr_list_p;
 struct pcibr_list_s {
-	pcibr_list_p            bl_next;
-	pcibr_soft_t            bl_soft;
-	vertex_hdl_t          bl_vhdl;
+    pcibr_list_p            bl_next;
+    pcibr_soft_t            bl_soft;
+    vertex_hdl_t            bl_vhdl;
 };
 #endif /* PCIBR_SOFT_LIST */
 
-
-// Devices per widget: 2 buses, 2 slots per bus, 8 functions per slot.
+/* Devices per widget: 2 buses, 2 slots per bus, 8 functions per slot. */
 #define DEV_PER_WIDGET (2*2*8)
 
 struct sn_flush_device_list {
 	int bus;
+	int slot;
 	int pin;
 	struct bar_list {
 		unsigned long start;
@@ -727,13 +718,7 @@
 
 struct sn_flush_nasid_entry  {
         struct sn_flush_device_list **widget_p;
-        unsigned long        iio_itte1;
-        unsigned long        iio_itte2;
-        unsigned long        iio_itte3;
-        unsigned long        iio_itte4;
-        unsigned long        iio_itte5;
-        unsigned long        iio_itte6;
-        unsigned long        iio_itte7;
+        unsigned long        iio_itte[8];
 };
 
 #endif				/* _ASM_SN_PCI_PCIBR_PRIVATE_H */
diff -Nru a/include/asm-ia64/sn/pci/pciio.h b/include/asm-ia64/sn/pci/pciio.h
--- a/include/asm-ia64/sn/pci/pciio.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ia64/sn/pci/pciio.h	Tue Feb  3 19:45:16 2004
@@ -1,29 +1,38 @@
-/* $Id$
- *
+/*
  * 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) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
  */
-#ifndef _ASM_SN_PCI_PCIIO_H
-#define _ASM_SN_PCI_PCIIO_H
+#ifndef _ASM_IA64_SN_PCI_PCIIO_H
+#define _ASM_IA64_SN_PCI_PCIIO_H
 
 /*
  * pciio.h -- platform-independent PCI interface
  */
 
-#include <linux/config.h>
+#ifdef __KERNEL__
 #include <linux/ioport.h>
 #include <asm/sn/ioerror.h>
 #include <asm/sn/driver.h>
 #include <asm/sn/hcl.h>
-
+#else
+#include <linux/ioport.h>
+#include <ioerror.h>
+#include <driver.h>
+#include <hcl.h>
+#endif
 
 #ifndef __ASSEMBLY__
 
+#ifdef __KERNEL__
 #include <asm/sn/dmamap.h>
 #include <asm/sn/alenlist.h>
+#else
+#include <dmamap.h>
+#include <alenlist.h>
+#endif
 
 typedef int pciio_vendor_id_t;
 
@@ -188,6 +197,31 @@
 } pciio_endian_t;
 
 /*
+ * Generic PCI bus information
+ */
+typedef enum pciio_asic_type_e {
+    PCIIO_ASIC_TYPE_UNKNOWN, 
+    PCIIO_ASIC_TYPE_MACE,
+    PCIIO_ASIC_TYPE_BRIDGE, 
+    PCIIO_ASIC_TYPE_XBRIDGE,
+    PCIIO_ASIC_TYPE_PIC,
+} pciio_asic_type_t;
+
+typedef enum pciio_bus_type_e {
+    PCIIO_BUS_TYPE_UNKNOWN,
+    PCIIO_BUS_TYPE_PCI,
+    PCIIO_BUS_TYPE_PCIX 
+} pciio_bus_type_t; 
+
+typedef enum pciio_bus_speed_e {
+    PCIIO_BUS_SPEED_UNKNOWN,
+    PCIIO_BUS_SPEED_33,
+    PCIIO_BUS_SPEED_66,
+    PCIIO_BUS_SPEED_100,
+    PCIIO_BUS_SPEED_133
+} pciio_bus_speed_t;
+
+/*
  * Interface to set PCI arbitration priority for devices that require
  * realtime characteristics.  pciio_priority_set is used to switch a
  * device between the PCI high-priority arbitration ring and the low
@@ -212,6 +246,9 @@
 typedef struct pciio_win_info_s *pciio_win_info_t;
 typedef struct pciio_win_map_s *pciio_win_map_t;
 typedef struct pciio_win_alloc_s *pciio_win_alloc_t;
+typedef struct pciio_bus_map_s *pciio_bus_map_t;
+typedef struct pciio_businfo_s *pciio_businfo_t;
+
 
 /* PIO MANAGEMENT */
 
@@ -419,9 +456,6 @@
 			 unsigned size,		/* width in bytes (1..4) */
 			 uint64_t value);	/* value to store */
 
-typedef int
-pciio_error_devenable_f (vertex_hdl_t pconn_vhdl, int error_code);
-
 typedef pciio_slot_t
 pciio_error_extract_f	(vertex_hdl_t vhdl,
 			 pciio_space_t *spacep,
@@ -442,8 +476,8 @@
 typedef int
 pciio_device_unregister_f	(vertex_hdl_t conn);
 
-typedef int
-pciio_dma_enabled_f		(vertex_hdl_t conn);
+typedef pciio_businfo_t
+pciio_businfo_get_f		(vertex_hdl_t conn);
 
 /*
  * Adapters that provide a PCI interface adhere to this software interface.
@@ -486,14 +520,15 @@
     pciio_config_set_f	   *config_set;
 
     /* Error handling interface */
-    pciio_error_devenable_f *error_devenable;
     pciio_error_extract_f *error_extract;
 
     /* Callback support */
     pciio_driver_reg_callback_f *driver_reg_callback;
     pciio_driver_unreg_callback_f *driver_unreg_callback;
     pciio_device_unregister_f 	*device_unregister;
-    pciio_dma_enabled_f		*dma_enabled;
+
+    /* GENERIC BUS INFO */
+    pciio_businfo_get_f *businfo_get;
 } pciio_provider_t;
 
 /* PCI devices use these standard PCI provider interfaces */
@@ -526,7 +561,6 @@
 extern pciio_priority_set_f pciio_priority_set;
 extern pciio_config_get_f pciio_config_get;
 extern pciio_config_set_f pciio_config_set;
-extern pciio_error_devenable_f pciio_error_devenable;
 extern pciio_error_extract_f pciio_error_extract;
 
 /* Widgetdev in the IOERROR structure is encoded as follows.
@@ -693,7 +727,6 @@
 extern size_t		pciio_info_rom_size_get(pciio_info_t);
 extern int		pciio_info_type1_get(pciio_info_t);
 extern int              pciio_error_handler(vertex_hdl_t, int, ioerror_mode_t, ioerror_t *);
-extern int		pciio_dma_enabled(vertex_hdl_t);
 
 /**
  * sn_pci_set_vchan - Set the requested Virtual Channel bits into the mapped DMA
@@ -730,4 +763,13 @@
 }
 
 #endif				/* C or C++ */
-#endif				/* _ASM_SN_PCI_PCIIO_H */
+
+
+/*
+ * Prototypes
+ */
+
+int snia_badaddr_val(volatile void *addr, int len, volatile void *ptr);
+nasid_t snia_get_console_nasid(void);
+nasid_t snia_get_master_baseio_nasid(void);
+#endif				/* _ASM_IA64_SN_PCI_PCIIO_H */
diff -Nru a/include/asm-ia64/sn/pci/pciio_private.h b/include/asm-ia64/sn/pci/pciio_private.h
--- a/include/asm-ia64/sn/pci/pciio_private.h	Tue Feb  3 19:45:28 2004
+++ b/include/asm-ia64/sn/pci/pciio_private.h	Tue Feb  3 19:45:28 2004
@@ -1,13 +1,12 @@
-/* $Id$
- *
+/*
  * 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) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
  */
-#ifndef _ASM_SN_PCI_PCIIO_PRIVATE_H
-#define _ASM_SN_PCI_PCIIO_PRIVATE_H
+#ifndef _ASM_IA64_SN_PCI_PCIIO_PRIVATE_H
+#define _ASM_IA64_SN_PCI_PCIIO_PRIVATE_H
 
 #include <asm/sn/pci/pciio.h>
 #include <asm/sn/pci/pci_defs.h>
@@ -17,8 +16,6 @@
  * PCI drivers should NOT include this file.
  */
 
-#ident "sys/PCI/pciio_private: $Revision: 1.13 $"
-
 /*
  * All PCI providers set up PIO using this information.
  */
@@ -62,6 +59,20 @@
 #define PCIIO_INTR_NOTHREAD	2	/* interrupt handler wants to be called at interrupt level */
 
 /*
+ * Generic PCI bus information
+ */
+struct pciio_businfo_s {
+    int                 bi_multi_master;/* Bus provider supports multiple */
+                                        /* dma masters behind a single slot. */
+                                        /* Needed to work around a thrashing */
+                                        /* issue in SGI Bridge ASIC and */
+                                        /* its derivatives. */
+    pciio_asic_type_t   bi_asic_type;   /* PCI ASIC type */
+    pciio_bus_type_t    bi_bus_type;    /* PCI bus type */
+    pciio_bus_speed_t   bi_bus_speed;   /* PCI bus speed */
+}; 
+
+/*
  * Some PCI provider implementations keep track of PCI window Base Address
  * Register (BAR) address range assignment via the rmalloc()/rmfree() arena
  * management routines.  These implementations use the following data
@@ -101,6 +112,7 @@
 struct pciio_info_s {
     char                   *c_fingerprint;
     vertex_hdl_t            c_vertex;	/* back pointer to vertex */
+    vertex_hdl_t	    c_hostvertex;/* top most device in tree */
     pciio_bus_t             c_bus;	/* which bus the card is in */
     pciio_slot_t            c_slot;	/* which slot the card is in */
     pciio_function_t        c_func;	/* which func (on multi-func cards) */
@@ -114,6 +126,8 @@
 
     struct pciio_win_info_s {           /* state of BASE regs */
         pciio_space_t           w_space;
+        char                    w_code;		/* low 4 bits of MEM BAR */
+						/* low 2 bits of IO BAR */
         iopaddr_t               w_base;
         size_t                  w_size;
         int                     w_devio_index;   /* DevIO[] register used to
@@ -124,7 +138,8 @@
 #define c_rbase		c_rwindow.w_base		/* EXPANSION ROM base addr */
 #define c_rsize		c_rwindow.w_size		/* EXPANSION ROM size (bytes) */
     pciio_piospace_t	    c_piospace;	/* additional I/O spaces allocated */
+    int			    c_type1;	/* use type1 addressing */
 };
 
 extern char             pciio_info_fingerprint[];
-#endif				/* _ASM_SN_PCI_PCIIO_PRIVATE_H */
+#endif				/* _ASM_IA64_SN_PCI_PCIIO_PRIVATE_H */
diff -Nru a/include/asm-ia64/sn/pci/pic.h b/include/asm-ia64/sn/pci/pic.h
--- a/include/asm-ia64/sn/pci/pic.h	Tue Feb  3 19:45:18 2004
+++ b/include/asm-ia64/sn/pci/pic.h	Tue Feb  3 19:45:18 2004
@@ -1,22 +1,12 @@
-/* $Id$
- *
+/*
  * 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) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
  */
-#ifndef _ASM_SN_PCI_PIC_H
-#define _ASM_SN_PCI_PIC_H
-
-
-/*
- * The PIC ASIC is a follow-on to the Bridge and Xbridge ASICs.
- * It shares many of the same registers as those chips and therefore
- * the primary structure for the PIC will be bridge_s as defined
- * in irix/kern/sys/PCI/bridge.h.   This file is intended as a complement
- * to bridge.h, which includes this file.  
- */
+#ifndef _ASM_IA64_SN_PCI_PIC_H
+#define _ASM_IA64_SN_PCI_PIC_H
 
 /*
  * PIC AS DEVICE ZERO
@@ -66,13 +56,13 @@
  */
 
 
-#ifndef __ASSEMBLY__
-
-#ifdef __cplusplus
-extern "C" {
+#ifdef __KERNEL__
+#include <linux/types.h>
+#include <asm/sn/xtalk/xwidget.h>	/* generic widget header */
+#else
+#include <xtalk/xwidget.h>
 #endif
 
-// #include <sys/types.h>
 #include <asm/sn/pci/pciio.h>
 
 
@@ -785,1217 +775,204 @@
  *
  */
 typedef uint64_t picreg_t;
+typedef uint64_t picate_t;
 
-/*********************************************************************
- * PIC register structures
- *
- */
-
-/*
- * Identification Register
- *
- * The Identification register is a read only register used by the host CPU
- * during configuration to determine the type of the widget. The format is
- * the same as defined in IEEE 1149.1 JTAG Device Identification Register.
- */
-	typedef union pic_id_reg_u {
-		picreg_t	pic_id_reg_regval;
-		struct {
-			picreg_t          :	32; /* 63:32 */
-			picreg_t rev_num  :	4; /* 31:28 */
-			picreg_t part_num :	16; /* 27:12 */
-			picreg_t mfg_num  :	11; /* 11:1 */
-			picreg_t          :	1; /* 0:0 */
-		} pic_id_reg_fld_s;
-	} pic_id_reg_u_t;
-/*
- * Status Register
- *
- * The status register is a read register which holds status information of the
- * Bus Subsection.
- */
-	typedef union pic_stat_reg_u {
-		picreg_t	pic_stat_reg_regval;
-		struct {
-			picreg_t                :	28; /* 63:36 */
-			picreg_t pci_x_speed    :	2; /* 35:34 */
-			picreg_t pci_x_active   :	1; /* 33:33 */
-			picreg_t                :	1; /* 32:32 */
-			picreg_t llp_rec_cnt    :	8; /* 31:24 */
-			picreg_t llp_tx_cnt     :	8; /* 23:16 */
-			picreg_t rx_credit_cnt  :	4; /* 15:12 */
-			picreg_t tx_credit_cnt  :	4; /* 11:8 */
-			picreg_t pci_misc_input :	8; /* 7:0 */
-		} pic_stat_reg_fld_s;
-	} pic_stat_reg_u_t;
-/*
- * Upper Address Holding Register Bus Side Errors
- *
- * The upper address holding register is a read only register which contains
- * the upper 16-bits of the address when certain error occurs (see error cases
- * chapter). Subsequent errors are not logged until the error is cleared. The
- * last logged value is held until the group is cleared and enabled.
- */
-	typedef union pic_upper_bus_err_u {
-		picreg_t	pic_upper_bus_err_regval;
-		struct {
-			picreg_t          :	32; /* 63:32 */
-			picreg_t          :	16; /* 31:16 */
-			picreg_t upp_addr :	16; /* 15:0 */
-		} pic_upper_bus_err_fld_s;
-	} pic_upper_bus_err_u_t;
-/*
- * Lower Address Holding Register Bus Side Errors
- *
- * The lower address holding register is a read only register which contains
- * the address which either can be accessed as a word or double word. Sub-
- * sequent errors are not logged until the error is cleared. The last logged
- * value is held until the group is cleared and enabled.
- */
-	typedef union pic_lower_bus_err_u {
-		picreg_t	pic_lower_bus_err_regval;
-		struct {
-			picreg_t          :	16; /* 63:48 */
-			picreg_t upp_addr :	16; /* 47:32 */
-			picreg_t low_addr :	32; /* 31:0 */
-		} pic_lower_bus_err_fld_s;
-	} pic_lower_bus_err_u_t;
-/*
- * Control Register
- *
- * The control register is a read/write register which holds control informa-
- * tion for the bus subsection.
- */
-	typedef union pic_control_reg_u {
-		picreg_t	pic_control_reg_regval;
-		struct {
-			picreg_t                :	32; /* 63:32 */
-			picreg_t                :	4; /* 31:28 */
-			picreg_t rst_pin_n      :	4; /* 27:24 */
-			picreg_t                :	1; /* 23:23 */
-			picreg_t mem_swap       :	1; /* 22:22 */
-			picreg_t page_size      :	1; /* 21:21 */
-			picreg_t                :	4; /* 20:17 */
-			picreg_t f_bad_pkt      :	1; /* 16:16 */
-			picreg_t llp_xbar_crd   :	4; /* 15:12 */
-			picreg_t clr_rllp_cnt   :	1; /* 11:11 */
-			picreg_t clr_tllp_cnt   :	1; /* 10:10 */
-			picreg_t sys_end        :	1; /* 9:9 */
-			picreg_t                :	3; /* 8:6 */
-			picreg_t pci_speed      :	2; /* 5:4 */
-			picreg_t widget_id      :	4; /* 3:0 */
-		} pic_control_reg_fld_s;
-	} pic_control_reg_u_t;
-/*
- * PCI/PCI-X Request Time-out Value Register
- *
- * This register contains the reload value for the response timer. The request
- * timer counts every 960 nS (32 PCI clocks)
- */
-	typedef union pic_pci_req_to_u {
-		picreg_t	pic_pci_req_to_regval;
-		struct {
-			picreg_t          :	32; /* 63:32 */
-			picreg_t          :	12; /* 31:20 */
-			picreg_t time_out :	20; /* 19:0 */
-		} pic_pci_req_to_fld_s;
-	} pic_pci_req_to_u_t;
-/*
- * Interrupt Destination Upper Address Register
- *
- * The interrupt destination upper address register is a read/write register
- * containing the upper 16-bits of address of the host to which the interrupt
- * is targeted. In addition the target ID is also contained in this register for
- * use in Crosstalk mode.
- */
-	typedef union pic_int_desc_upper_u {
-		picreg_t	pic_int_desc_upper_regval;
-		struct {
-			picreg_t           :	32; /* 63:32 */
-			picreg_t           :	12; /* 31:20 */
-			picreg_t target_id :	4; /* 19:16 */
-			picreg_t upp_addr  :	16; /* 15:0 */
-		} pic_int_desc_upper_fld_s;
-	} pic_int_desc_upper_u_t;
-/*
- * Interrupt Destination Lower Address Register
- *
- * The interrupt destination lower address register is a read/write register
- * which contains the entire address of the host to which the interrupt is tar-
- * geted. In addition the target ID is also contained in this register for use in
- * Crosstalk mode.
- */
-	typedef union pic_int_desc_lower_u {
-		picreg_t	pic_int_desc_lower_regval;
-		struct {
-			picreg_t           :	12; /* 63:52 */
-			picreg_t target_id :	4; /* 51:48 */
-			picreg_t upp_addr  :	16; /* 47:32 */
-			picreg_t low_addr  :	32; /* 31:0 */
-		} pic_int_desc_lower_fld_s;
-	} pic_int_desc_lower_u_t;
-/*
- * Command Word Holding Register Bus Side Errors
- *
- * The command word holding is a read register that holds the command
- * word of a Crosstalk packet when errors occur on the link side (see error
- * chapter). Errors are indicated with error bits in the interrupt status regis-
- * ter. Subsequent errors are not logged until the interrupt is cleared..
- */
-	typedef union pic_cmd_word_bus_err_u {
-		picreg_t	pic_cmd_word_bus_err_regval;
-		struct {
-			picreg_t          :	32; /* 63:32 */
-			picreg_t didn     :	4; /* 31:28 */
-			picreg_t sidn     :	4; /* 27:24 */
-			picreg_t pactyp   :	4; /* 23:20 */
-			picreg_t tnum     :	5; /* 19:15 */
-			picreg_t coherent :	1; /* 14:14 */
-			picreg_t ds       :	2; /* 13:12 */
-			picreg_t gbr      :	1; /* 11:11 */
-			picreg_t vbpm     :	1; /* 10:10 */
-			picreg_t error    :	1; /* 9:9 */
-			picreg_t barrier  :	1; /* 8:8 */
-			picreg_t          :	8; /* 7:0 */
-		} pic_cmd_word_bus_err_fld_s;
-	} pic_cmd_word_bus_err_u_t;
-/*
- * LLP Configuration Register
- *
- * This register contains the configuration information for the LLP modules
- * and is only valid on bus 0 side.
- */
-	typedef union pic_llp_cfg_u {
-		picreg_t	pic_llp_cfg_regval;
-		struct {
-			picreg_t                 :	32; /* 63:32 */
-			picreg_t                 :	6; /* 31:26 */
-			picreg_t llp_maxretry    :	10; /* 25:16 */
-			picreg_t llp_nulltimeout :	6; /* 15:10 */
-			picreg_t llp_maxburst    :	10; /* 9:0 */
-		} pic_llp_cfg_fld_s;
-	} pic_llp_cfg_u_t;
-/*
- * PCI/PCI-X Target Flush Register
- *
- * When read, this register will return a 0x00 after all previous transfers to
- * the PCI bus subsection have completed.
- */
-
-/*
- * Command Word Holding Register Link Side Errors
- *
- * The command word holding is a read-only register that holds the com-
- * mand word of a Crosstalk packet when request fifo overflow or unexpect-
- * ed response errors occur. Errors are indicated with error bits in the
- * interrupt status register. Subsequent errors are not logged until this inter-
- * rupt is cleared.
- */
-	typedef union pic_cmd_word_link_err_u {
-		picreg_t	pic_cmd_word_link_err_regval;
-		struct {
-			picreg_t          :	32; /* 63:32 */
-			picreg_t didn     :	4; /* 31:28 */
-			picreg_t sidn     :	4; /* 27:24 */
-			picreg_t pactyp   :	4; /* 23:20 */
-			picreg_t tnum     :	5; /* 19:15 */
-			picreg_t coherent :	1; /* 14:14 */
-			picreg_t ds       :	2; /* 13:12 */
-			picreg_t gbr      :	1; /* 11:11 */
-			picreg_t vbpm     :	1; /* 10:10 */
-			picreg_t error    :	1; /* 9:9 */
-			picreg_t barrier  :	1; /* 8:8 */
-			picreg_t          :	8; /* 7:0 */
-		} pic_cmd_word_link_err_fld_s;
-	} pic_cmd_word_link_err_u_t;
-/*
- * PCI Response Buffer Error Upper Address Holding Reg
- *
- * The response buffer error upper address holding register is a read only
- * register which contains the upper 16-bits of the address when error asso-
- * ciated with response buffer entries occur. Subsequent errors are not
- * logged until the interrupt is cleared.
- */
-	typedef union pic_pci_rbuf_err_upper_u {
-		picreg_t	pic_pci_rbuf_err_upper_regval;
-		struct {
-			picreg_t          :	32; /* 63:32 */
-			picreg_t          :	9; /* 31:23 */
-			picreg_t dev_num  :	3; /* 22:20 */
-			picreg_t buff_num :	4; /* 19:16 */
-			picreg_t upp_addr :	16; /* 15:0 */
-		} pic_pci_rbuf_err_upper_fld_s;
-	} pic_pci_rbuf_err_upper_u_t;
-/*
- * PCI Response Buffer Error Lower Address Holding Reg
- *
- * The response buffer error lower address holding register is a read only
- * register which contains the address of the error associated with response
- * buffer entries. Subsequent errors are not logged until the interrupt is
- * cleared.
- */
-	typedef union pic_pci_rbuf_err_lower_u {
-		picreg_t	pic_pci_rbuf_err_lower_regval;
-		struct {
-			picreg_t          :	9; /* 63:55 */
-			picreg_t dev_num  :	3; /* 54:52 */
-			picreg_t buff_num :	4; /* 51:48 */
-			picreg_t upp_addr :	16; /* 47:32 */
-			picreg_t low_addr :	32; /* 31:0 */
-		} pic_pci_rbuf_err_lower_fld_s;
-	} pic_pci_rbuf_err_lower_u_t;
-/*
- * Test Pin Control Register
- *
- * This register selects the output function and value to the four test pins on
- * the PIC .
- */
-	typedef union pic_test_pin_cntl_u {
-		picreg_t	pic_test_pin_cntl_regval;
-		struct {
-			picreg_t            :	32; /* 63:32 */
-			picreg_t            :	8; /* 31:24 */
-			picreg_t tdata_out  :	8; /* 23:16 */
-			picreg_t sel_tpin_7 :	2; /* 15:14 */
-			picreg_t sel_tpin_6 :	2; /* 13:12 */
-			picreg_t sel_tpin_5 :	2; /* 11:10 */
-			picreg_t sel_tpin_4 :	2; /* 9:8 */
-			picreg_t sel_tpin_3 :	2; /* 7:6 */
-			picreg_t sel_tpin_2 :	2; /* 5:4 */
-			picreg_t sel_tpin_1 :	2; /* 3:2 */
-			picreg_t sel_tpin_0 :	2; /* 1:0 */
-		} pic_test_pin_cntl_fld_s;
-	} pic_test_pin_cntl_u_t;
-/*
- * Address Holding Register Link Side Errors
- *
- * The address holding register is a read only register which contains the ad-
- * dress which either can be accessed as a word or double word. Subsequent
- * errors are not logged until the error is cleared. The last logged value is
- * held until the group is cleared and enabled.
- */
-	typedef union pic_p_addr_lkerr_u {
-		picreg_t	pic_p_addr_lkerr_regval;
-		struct {
-			picreg_t          :	16; /* 63:48 */
-			picreg_t upp_addr :	16; /* 47:32 */
-			picreg_t low_addr :	32; /* 31:0 */
-		} pic_p_addr_lkerr_fld_s;
-	} pic_p_addr_lkerr_u_t;
-/*
- * PCI Direct Mapping Register
- *
- * This register is used to relocate a 2 GByte region for PCI to Crosstalk
- * transfers.
- */
-	typedef union pic_p_dir_map_u {
-		picreg_t	pic_p_dir_map_regval;
-		struct {
-			picreg_t            :	32; /* 63:32 */
-			picreg_t            :	8; /* 31:24 */
-			picreg_t dir_w_id   :	4; /* 23:20 */
-			picreg_t            :	2; /* 19:18 */
-			picreg_t dir_add512 :	1; /* 17:17 */
-			picreg_t dir_off    :	17; /* 16:0 */
-		} pic_p_dir_map_fld_s;
-	} pic_p_dir_map_u_t;
-/*
- * PCI Page Map Fault Address Register
- *
- * This register contains the address and device number when a page map
- * fault occurred.
- */
-	typedef union pic_p_map_fault_u {
-		picreg_t	pic_p_map_fault_regval;
-		struct {
-			picreg_t             :	32; /* 63:32 */
-			picreg_t             :	10; /* 31:22 */
-			picreg_t pci_addr    :	18; /* 21:4 */
-			picreg_t             :	1; /* 3:3 */
-			picreg_t pci_dev_num :	3; /* 2:0 */
-		} pic_p_map_fault_fld_s;
-	} pic_p_map_fault_u_t;
-/*
- * Arbitration Register
- *
- * This register defines the priority and bus time out timing in PCI bus arbi-
- * tration.
- */
-	typedef union pic_p_arb_u {
-		picreg_t	pic_p_arb_regval;
-		struct {
-			picreg_t               :	32; /* 63:32 */
-			picreg_t               :	8; /* 31:24 */
-			picreg_t dev_broke     :	4; /* 23:20 */
-			picreg_t               :	2; /* 19:18 */
-			picreg_t req_wait_tick :	2; /* 17:16 */
-			picreg_t               :	4; /* 15:12 */
-			picreg_t req_wait_en   :	4; /* 11:8 */
-			picreg_t disarb        :	1; /* 7:7 */
-			picreg_t freeze_gnt    :	1; /* 6:6 */
-			picreg_t               :	1; /* 5:5 */
-			picreg_t en_bridge_hi  :	2; /* 4:3 */
-			picreg_t               :	1; /* 2:2 */
-			picreg_t en_bridge_lo  :	2; /* 1:0 */
-		} pic_p_arb_fld_s;
-	} pic_p_arb_u_t;
-/*
- * Internal Ram Parity Error Register
- *
- * This register logs information about parity errors on internal ram access.
- */
-	typedef union pic_p_ram_perr_u {
-		picreg_t	pic_p_ram_perr_regval;
-		struct {
-			picreg_t         	     :	6; /* 63:58 */
-			picreg_t ate_err_addr        :	10; /* 57:48 */
-			picreg_t         	     :	7; /* 47:41 */
-			picreg_t rd_resp_err_addr    :	9; /* 40:32 */
-			picreg_t wrt_resp_err_addr   :	8; /* 31:24 */
-			picreg_t         	     :	2; /* 23:22 */
-			picreg_t ate_err 	     :	1; /* 21:21 */
-			picreg_t rd_resp_err         :	1; /* 20:20 */
-			picreg_t wrt_resp_err        :	1; /* 19:19 */
-			picreg_t dbe_ate 	     :	3; /* 18:16 */
-			picreg_t dbe_rd  	     :	8; /* 15:8 */
-			picreg_t dbe_wrt 	     :	8; /* 7:0 */
-		} pic_p_ram_perr_fld_s;
-	} pic_p_ram_perr_u_t;
-/*
- * Time-out Register
- *
- * This register determines retry hold off and max retries allowed for PIO
- * accesses to PCI/PCI-X.
- */
-	typedef union pic_p_bus_timeout_u {
-		picreg_t	pic_p_bus_timeout_regval;
-		struct {
-			picreg_t               :	32; /* 63:32 */
-			picreg_t               :	11; /* 31:21 */
-			picreg_t pci_retry_hld :	5; /* 20:16 */
-			picreg_t               :	6; /* 15:10 */
-			picreg_t pci_retry_cnt :	10; /* 9:0 */
-		} pic_p_bus_timeout_fld_s;
-	} pic_p_bus_timeout_u_t;
-/*
- * PCI/PCI-X Type 1 Configuration Register
- *
- * This register is use during accesses to the PCI/PCI-X type 1 configuration
- * space. The bits in this register are used to supplement the address during
- * the configuration cycle to select the correct secondary bus and device.
- */
-	typedef union pic_type1_cfg_u {
-		picreg_t	pic_type1_cfg_regval;
-		struct {
-			picreg_t         :	32; /* 63:32 */
-			picreg_t         :	8; /* 31:24 */
-			picreg_t bus_num :	8; /* 23:16 */
-			picreg_t dev_num :	5; /* 15:11 */
-			picreg_t         :	11; /* 10:0 */
-		} pic_type1_cfg_fld_s;
-	} pic_type1_cfg_u_t;
-/*
- * PCI Bus Error Upper Address Holding Register
- *
- * This register holds the value of the upper address on the PCI Bus when an
- * error occurs.
- */
-	typedef union pic_p_pci_err_upper_u {
-		picreg_t	pic_p_pci_err_upper_regval;
-		struct {
-			picreg_t                :	32; /* 63:32 */
-			picreg_t                :	4; /* 31:28 */
-			picreg_t pci_xtalk_did  :	4; /* 27:24 */
-			picreg_t                :	2; /* 23:22 */
-			picreg_t pci_dac        :	1; /* 21:21 */
-			picreg_t pci_dev_master :	1; /* 20:20 */
-			picreg_t pci_vdev       :	1; /* 19:19 */
-			picreg_t pci_dev_num    :	3; /* 18:16 */
-			picreg_t pci_uaddr_err  :	16; /* 15:0 */
-		} pic_p_pci_err_upper_fld_s;
-	} pic_p_pci_err_upper_u_t;
-/*
- * PCI Bus Error Lower Address Holding Register
- *
- * This register holds the value of the lower address on the PCI Bus when an
- * error occurs.
- */
-	typedef union pic_p_pci_err_lower_u {
-		picreg_t	pic_p_pci_err_lower_regval;
-		struct {
-			picreg_t                :	4; /* 63:60 */
-			picreg_t pci_xtalk_did  :	4; /* 59:56 */
-			picreg_t                :	2; /* 55:54 */
-			picreg_t pci_dac        :	1; /* 53:53 */
-			picreg_t pci_dev_master :	1; /* 52:52 */
-			picreg_t pci_vdev       :	1; /* 51:51 */
-			picreg_t pci_dev_num    :	3; /* 50:48 */
-			picreg_t pci_uaddr_err  :	16; /* 47:32 */
-			picreg_t pci_laddr_err  :	32; /* 31:0 */
-		} pic_p_pci_err_lower_fld_s;
-	} pic_p_pci_err_lower_u_t;
-/*
- * PCI-X Error Address Register
- *
- * This register contains the address on the PCI-X bus when an error oc-
- * curred.
- */
-	typedef union pic_p_pcix_err_addr_u {
-		picreg_t	pic_p_pcix_err_addr_regval;
-		struct {
-			picreg_t pcix_err_addr :	64; /* 63:0 */
-		} pic_p_pcix_err_addr_fld_s;
-	} pic_p_pcix_err_addr_u_t;
-/*
- * PCI-X Error Attribute Register
- *
- * This register contains the attribute data on the PCI-X bus when an error
- * occurred.
- */
-	typedef union pic_p_pcix_err_attr_u {
-		picreg_t	pic_p_pcix_err_attr_regval;
-		struct {
-			picreg_t            :	16; /* 63:48 */
-			picreg_t bus_cmd    :	4; /* 47:44 */
-			picreg_t byte_cnt   :	12; /* 43:32 */
-			picreg_t            :	1; /* 31:31 */
-			picreg_t ns         :	1; /* 30:30 */
-			picreg_t ro         :	1; /* 29:29 */
-			picreg_t tag        :	5; /* 28:24 */
-			picreg_t bus_num    :	8; /* 23:16 */
-			picreg_t dev_num    :	5; /* 15:11 */
-			picreg_t fun_num    :	3; /* 10:8 */
-			picreg_t l_byte_cnt :	8; /* 7:0 */
-		} pic_p_pcix_err_attr_fld_s;
-	} pic_p_pcix_err_attr_u_t;
-/*
- * PCI-X Error Data Register
- *
- * This register contains the Data on the PCI-X bus when an error occurred.
- */
-	typedef union pic_p_pcix_err_data_u {
-		picreg_t	pic_p_pcix_err_data_regval;
-		struct {
-			picreg_t pcix_err_data :	64; /* 63:0 */
-		} pic_p_pcix_err_data_fld_s;
-	} pic_p_pcix_err_data_u_t;
-/*
- * PCI-X Read Request Timeout Error Register
- *
- * This register contains a pointer into the PCI-X read data structure.
- */
-	typedef union pic_p_pcix_read_req_to_u {
-		picreg_t	pic_p_pcix_read_req_to_regval;
-		struct {
-			picreg_t                :	55; /* 63:9 */
-			picreg_t rd_buff_loc    :	5; /* 8:4 */
-			picreg_t rd_buff_struct :	4; /* 3:0 */
-		} pic_p_pcix_read_req_to_fld_s;
-	} pic_p_pcix_read_req_to_u_t;
-/*
- * INT_STATUS Register
- *
- * This is the current interrupt status register which maintains the current
- * status of all the interrupting devices which generated a n interrupt. This
- * register is read only and all the bits are active high. A high bit at
- * INT_STATE means the corresponding INT_N pin has been asserted
- * (low).
- */
-	typedef union pic_p_int_status_u {
-		picreg_t	pic_p_int_status_regval;
-		struct {
-			picreg_t                  :	22; /* 63:42 */
-			picreg_t int_ram_perr     :	1; /* 41:41 */
-			picreg_t bus_arb_broke    :	1; /* 40:40 */
-			picreg_t pci_x_req_tout   :	1; /* 39:39 */
-			picreg_t pci_x_tabort     :	1; /* 38:38 */
-			picreg_t pci_x_perr       :	1; /* 37:37 */
-			picreg_t pci_x_serr       :	1; /* 36:36 */
-			picreg_t pci_x_mretry     :	1; /* 35:35 */
-			picreg_t pci_x_mtout      :	1; /* 34:34 */
-			picreg_t pci_x_da_parity  :	1; /* 33:33 */
-			picreg_t pci_x_ad_parity  :	1; /* 32:32 */
-			picreg_t                  :	1; /* 31:31 */
-			picreg_t pmu_page_fault   :	1; /* 30:30 */
-			picreg_t unexpected_resp  :	1; /* 29:29 */
-			picreg_t bad_xresp_packet :	1; /* 28:28 */
-			picreg_t bad_xreq_packet  :	1; /* 27:27 */
-			picreg_t resp_xtalk_error :	1; /* 26:26 */
-			picreg_t req_xtalk_error  :	1; /* 25:25 */
-			picreg_t invalid_access   :	1; /* 24:24 */
-			picreg_t unsupported_xop  :	1; /* 23:23 */
-			picreg_t xreq_fifo_oflow  :	1; /* 22:22 */
-			picreg_t llp_rec_snerror  :	1; /* 21:21 */
-			picreg_t llp_rec_cberror  :	1; /* 20:20 */
-			picreg_t llp_rcty         :	1; /* 19:19 */
-			picreg_t llp_tx_retry     :	1; /* 18:18 */
-			picreg_t llp_tcty         :	1; /* 17:17 */
-			picreg_t                  :	1; /* 16:16 */
-			picreg_t pci_abort        :	1; /* 15:15 */
-			picreg_t pci_parity       :	1; /* 14:14 */
-			picreg_t pci_serr         :	1; /* 13:13 */
-			picreg_t pci_perr         :	1; /* 12:12 */
-			picreg_t pci_master_tout  :	1; /* 11:11 */
-			picreg_t pci_retry_cnt    :	1; /* 10:10 */
-			picreg_t xread_req_tout   :	1; /* 9:9 */
-			picreg_t                  :	1; /* 8:8 */
-			picreg_t int_state        :	8; /* 7:0 */
-		} pic_p_int_status_fld_s;
-	} pic_p_int_status_u_t;
-/*
- * Interrupt Enable Register
- *
- * This register enables the reporting of interrupt to the host. Each bit in this
- * register corresponds to the same bit in Interrupt Status register. All bits
- * are zero after reset.
- */
-	typedef union pic_p_int_enable_u {
-		picreg_t	pic_p_int_enable_regval;
-		struct {
-			picreg_t                     :	22; /* 63:42 */
-			picreg_t en_int_ram_perr     :	1; /* 41:41 */
-			picreg_t en_bus_arb_broke    :	1; /* 40:40 */
-			picreg_t en_pci_x_req_tout   :	1; /* 39:39 */
-			picreg_t en_pci_x_tabort     :	1; /* 38:38 */
-			picreg_t en_pci_x_perr       :	1; /* 37:37 */
-			picreg_t en_pci_x_serr       :	1; /* 36:36 */
-			picreg_t en_pci_x_mretry     :	1; /* 35:35 */
-			picreg_t en_pci_x_mtout      :	1; /* 34:34 */
-			picreg_t en_pci_x_da_parity  :	1; /* 33:33 */
-			picreg_t en_pci_x_ad_parity  :	1; /* 32:32 */
-			picreg_t                     :	1; /* 31:31 */
-			picreg_t en_pmu_page_fault   :	1; /* 30:30 */
-			picreg_t en_unexpected_resp  :	1; /* 29:29 */
-			picreg_t en_bad_xresp_packet :	1; /* 28:28 */
-			picreg_t en_bad_xreq_packet  :	1; /* 27:27 */
-			picreg_t en_resp_xtalk_error :	1; /* 26:26 */
-			picreg_t en_req_xtalk_error  :	1; /* 25:25 */
-			picreg_t en_invalid_access   :	1; /* 24:24 */
-			picreg_t en_unsupported_xop  :	1; /* 23:23 */
-			picreg_t en_xreq_fifo_oflow  :	1; /* 22:22 */
-			picreg_t en_llp_rec_snerror  :	1; /* 21:21 */
-			picreg_t en_llp_rec_cberror  :	1; /* 20:20 */
-			picreg_t en_llp_rcty         :	1; /* 19:19 */
-			picreg_t en_llp_tx_retry     :	1; /* 18:18 */
-			picreg_t en_llp_tcty         :	1; /* 17:17 */
-			picreg_t                     :	1; /* 16:16 */
-			picreg_t en_pci_abort        :	1; /* 15:15 */
-			picreg_t en_pci_parity       :	1; /* 14:14 */
-			picreg_t en_pci_serr         :	1; /* 13:13 */
-			picreg_t en_pci_perr         :	1; /* 12:12 */
-			picreg_t en_pci_master_tout  :	1; /* 11:11 */
-			picreg_t en_pci_retry_cnt    :	1; /* 10:10 */
-			picreg_t en_xread_req_tout   :	1; /* 9:9 */
-			picreg_t                     :	1; /* 8:8 */
-			picreg_t en_int_state        :	8; /* 7:0 */
-		} pic_p_int_enable_fld_s;
-	} pic_p_int_enable_u_t;
-/*
- * Reset Interrupt Register
- *
- * A write of a "1" clears the bit and rearms the error registers. Writes also
- * clear the error view register.
- */
-	typedef union pic_p_int_rst_u {
-		picreg_t	pic_p_int_rst_regval;
-		struct {
-			picreg_t                       :	22; /* 63:42 */
-			picreg_t logv_int_ram_perr     :	1; /* 41:41 */
-			picreg_t logv_bus_arb_broke    :	1; /* 40:40 */
-			picreg_t logv_pci_x_req_tout   :	1; /* 39:39 */
-			picreg_t logv_pci_x_tabort     :	1; /* 38:38 */
-			picreg_t logv_pci_x_perr       :	1; /* 37:37 */
-			picreg_t logv_pci_x_serr       :	1; /* 36:36 */
-			picreg_t logv_pci_x_mretry     :	1; /* 35:35 */
-			picreg_t logv_pci_x_mtout      :	1; /* 34:34 */
-			picreg_t logv_pci_x_da_parity  :	1; /* 33:33 */
-			picreg_t logv_pci_x_ad_parity  :	1; /* 32:32 */
-			picreg_t                       :	1; /* 31:31 */
-			picreg_t logv_pmu_page_fault   :	1; /* 30:30 */
-			picreg_t logv_unexpected_resp  :	1; /* 29:29 */
-			picreg_t logv_bad_xresp_packet :	1; /* 28:28 */
-			picreg_t logv_bad_xreq_packet  :	1; /* 27:27 */
-			picreg_t logv_resp_xtalk_error :	1; /* 26:26 */
-			picreg_t logv_req_xtalk_error  :	1; /* 25:25 */
-			picreg_t logv_invalid_access   :	1; /* 24:24 */
-			picreg_t logv_unsupported_xop  :	1; /* 23:23 */
-			picreg_t logv_xreq_fifo_oflow  :	1; /* 22:22 */
-			picreg_t logv_llp_rec_snerror  :	1; /* 21:21 */
-			picreg_t logv_llp_rec_cberror  :	1; /* 20:20 */
-			picreg_t logv_llp_rcty         :	1; /* 19:19 */
-			picreg_t logv_llp_tx_retry     :	1; /* 18:18 */
-			picreg_t logv_llp_tcty         :	1; /* 17:17 */
-			picreg_t                       :	1; /* 16:16 */
-			picreg_t logv_pci_abort        :	1; /* 15:15 */
-			picreg_t logv_pci_parity       :	1; /* 14:14 */
-			picreg_t logv_pci_serr         :	1; /* 13:13 */
-			picreg_t logv_pci_perr         :	1; /* 12:12 */
-			picreg_t logv_pci_master_tout  :	1; /* 11:11 */
-			picreg_t logv_pci_retry_cnt    :	1; /* 10:10 */
-			picreg_t logv_xread_req_tout   :	1; /* 9:9 */
-                        picreg_t                       :        2; /* 8:7 */
-			picreg_t multi_clr             :	1; /* 6:6 */
-			picreg_t                       :	6; /* 5:0 */
-		} pic_p_int_rst_fld_s;
-	} pic_p_int_rst_u_t;
-
-/*
- * Interrupt Mode Register
- *
- * This register defines the interrupting mode of the INT_N pins.
- */
-	typedef union pic_p_int_mode_u {
-		picreg_t	pic_p_int_mode_regval;
-		struct {
-			picreg_t            :	32; /* 63:32 */
-			picreg_t            :	24; /* 31:8 */
-			picreg_t en_clr_pkt :	8; /* 7:0 */
-		} pic_p_int_mode_fld_s;
-	} pic_p_int_mode_u_t;
-/*
- * Interrupt Device Select Register
- *
- * This register associates interrupt pins with devices thus allowing buffer
- * management (flushing) when a device interrupt occurs.
- */
-	typedef union pic_p_int_device_u {
-		picreg_t	pic_p_int_device_regval;
-		struct {
-			picreg_t          :	32; /* 63:32 */
-			picreg_t          :	8; /* 31:24 */
-			picreg_t int7_dev :	3; /* 23:21 */
-			picreg_t int6_dev :	3; /* 20:18 */
-			picreg_t int5_dev :	3; /* 17:15 */
-			picreg_t int4_dev :	3; /* 14:12 */
-			picreg_t int3_dev :	3; /* 11:9 */
-			picreg_t int2_dev :	3; /* 8:6 */
-			picreg_t int1_dev :	3; /* 5:3 */
-			picreg_t int0_dev :	3; /* 2:0 */
-		} pic_p_int_device_fld_s;
-	} pic_p_int_device_u_t;
-/*
- * Host Error Interrupt Field Register
- *
- * This register tells which bit location in the host's Interrupt Status register
- * to set or reset when any error condition happens.
- */
-	typedef union pic_p_int_host_err_u {
-		picreg_t	pic_p_int_host_err_regval;
-		struct {
-			picreg_t                :	32; /* 63:32 */
-			picreg_t                :	24; /* 31:8 */
-			picreg_t bridge_err_fld :	8; /* 7:0 */
-		} pic_p_int_host_err_fld_s;
-	} pic_p_int_host_err_u_t;
-/*
- * Interrupt (x) Host Address Register
- *
- * This register allow different host address to be assigned to each interrupt
- * pin and the bit in the host.
- */
-	typedef union pic_p_int_addr_u {
-		picreg_t	pic_p_int_addr_regval;
-		struct {
-			picreg_t          :	8; /* 63:56 */
-			picreg_t int_fld  :	8; /* 55:48 */
-			picreg_t int_addr :	48; /* 47:0 */
-		} pic_p_int_addr_fld_s;
-	} pic_p_int_addr_u_t;
-/*
- * Error Interrupt View Register
- *
- * This register contains the view of which interrupt occur even if they are
- * not currently enabled. The group clear is used to clear these bits just like
- * the interrupt status register bits.
- */
-	typedef union pic_p_err_int_view_u {
-		picreg_t	pic_p_err_int_view_regval;
-		struct {
-			picreg_t                  :	22; /* 63:42 */
-			picreg_t int_ram_perr     :	1; /* 41:41 */
-			picreg_t bus_arb_broke    :	1; /* 40:40 */
-			picreg_t pci_x_req_tout   :	1; /* 39:39 */
-			picreg_t pci_x_tabort     :	1; /* 38:38 */
-			picreg_t pci_x_perr       :	1; /* 37:37 */
-			picreg_t pci_x_serr       :	1; /* 36:36 */
-			picreg_t pci_x_mretry     :	1; /* 35:35 */
-			picreg_t pci_x_mtout      :	1; /* 34:34 */
-			picreg_t pci_x_da_parity  :	1; /* 33:33 */
-			picreg_t pci_x_ad_parity  :	1; /* 32:32 */
-			picreg_t                  :	1; /* 31:31 */
-			picreg_t pmu_page_fault   :	1; /* 30:30 */
-			picreg_t unexpected_resp  :	1; /* 29:29 */
-			picreg_t bad_xresp_packet :	1; /* 28:28 */
-			picreg_t bad_xreq_packet  :	1; /* 27:27 */
-			picreg_t resp_xtalk_error :	1; /* 26:26 */
-			picreg_t req_xtalk_error  :	1; /* 25:25 */
-			picreg_t invalid_access   :	1; /* 24:24 */
-			picreg_t unsupported_xop  :	1; /* 23:23 */
-			picreg_t xreq_fifo_oflow  :	1; /* 22:22 */
-			picreg_t llp_rec_snerror  :	1; /* 21:21 */
-			picreg_t llp_rec_cberror  :	1; /* 20:20 */
-			picreg_t llp_rcty         :	1; /* 19:19 */
-			picreg_t llp_tx_retry     :	1; /* 18:18 */
-			picreg_t llp_tcty         :	1; /* 17:17 */
-			picreg_t                  :	1; /* 16:16 */
-			picreg_t pci_abort        :	1; /* 15:15 */
-			picreg_t pci_parity       :	1; /* 14:14 */
-			picreg_t pci_serr         :	1; /* 13:13 */
-			picreg_t pci_perr         :	1; /* 12:12 */
-			picreg_t pci_master_tout  :	1; /* 11:11 */
-			picreg_t pci_retry_cnt    :	1; /* 10:10 */
-			picreg_t xread_req_tout   :	1; /* 9:9 */
-			picreg_t                  :	9; /* 8:0 */
-		} pic_p_err_int_view_fld_s;
-	} pic_p_err_int_view_u_t;
-
-
-/*
- * Multiple Interrupt Register
- *
- * This register indicates if any interrupt occurs more than once without be-
- * ing cleared.
- */
-	typedef union pic_p_mult_int_u {
-		picreg_t	pic_p_mult_int_regval;
-		struct {
-			picreg_t                  :	22; /* 63:42 */
-			picreg_t int_ram_perr     :	1; /* 41:41 */
-			picreg_t bus_arb_broke    :	1; /* 40:40 */
-			picreg_t pci_x_req_tout   :	1; /* 39:39 */
-			picreg_t pci_x_tabort     :	1; /* 38:38 */
-			picreg_t pci_x_perr       :	1; /* 37:37 */
-			picreg_t pci_x_serr       :	1; /* 36:36 */
-			picreg_t pci_x_mretry     :	1; /* 35:35 */
-			picreg_t pci_x_mtout      :	1; /* 34:34 */
-			picreg_t pci_x_da_parity  :	1; /* 33:33 */
-			picreg_t pci_x_ad_parity  :	1; /* 32:32 */
-			picreg_t                  :	1; /* 31:31 */
-			picreg_t pmu_page_fault   :	1; /* 30:30 */
-			picreg_t unexpected_resp  :	1; /* 29:29 */
-			picreg_t bad_xresp_packet :	1; /* 28:28 */
-			picreg_t bad_xreq_packet  :	1; /* 27:27 */
-			picreg_t resp_xtalk_error :	1; /* 26:26 */
-			picreg_t req_xtalk_error  :	1; /* 25:25 */
-			picreg_t invalid_access   :	1; /* 24:24 */
-			picreg_t unsupported_xop  :	1; /* 23:23 */
-			picreg_t xreq_fifo_oflow  :	1; /* 22:22 */
-			picreg_t llp_rec_snerror  :	1; /* 21:21 */
-			picreg_t llp_rec_cberror  :	1; /* 20:20 */
-			picreg_t llp_rcty         :	1; /* 19:19 */
-			picreg_t llp_tx_retry     :	1; /* 18:18 */
-			picreg_t llp_tcty         :	1; /* 17:17 */
-			picreg_t                  :	1; /* 16:16 */
-			picreg_t pci_abort        :	1; /* 15:15 */
-			picreg_t pci_parity       :	1; /* 14:14 */
-			picreg_t pci_serr         :	1; /* 13:13 */
-			picreg_t pci_perr         :	1; /* 12:12 */
-			picreg_t pci_master_tout  :	1; /* 11:11 */
-			picreg_t pci_retry_cnt    :	1; /* 10:10 */
-			picreg_t xread_req_tout   :	1; /* 9:9 */
-			picreg_t                  :	1; /* 8:8 */
-			picreg_t int_state        :	8; /* 7:0 */
-		} pic_p_mult_int_fld_s;
-	} pic_p_mult_int_u_t;
-/*
- * Force Always Interrupt (x) Register
- *
- * A write to this data independent write only register will force a set inter-
- * rupt to occur as if the interrupt line had transitioned. If the interrupt line
- * is already active an addition set interrupt packet is set. All buffer flush op-
- * erations also occur on this operation.
- */
-
-
-/*
- * Force Interrupt (x) Register
- *
- * A write to this data independent write only register in conjunction with
- * the assertion of the corresponding interrupt line will force a set interrupt
- * to occur as if the interrupt line had transitioned. The interrupt line must
- * be active for this operation to generate a set packet, otherwise the write
- * PIO is ignored. All buffer flush operations also occur when the set packet
- * is sent on this operation.
- */
-
-
-/*
- * Device Registers
- *
- * The Device registers contain device specific and mapping information.
- */
-	typedef union pic_device_reg_u {
-		picreg_t	pic_device_reg_regval;
-		struct {
-			picreg_t               :	32; /* 63:32 */
-			picreg_t               :	2; /* 31:30 */
-			picreg_t en_virtual1   :	1; /* 29:29 */
-			picreg_t en_error_lock :	1; /* 28:28 */
-			picreg_t en_page_chk   :	1; /* 27:27 */
-			picreg_t force_pci_par :	1; /* 26:26 */
-			picreg_t en_virtual0   :	1; /* 25:25 */
-			picreg_t               :	1; /* 24:24 */
-			picreg_t dir_wrt_gen   :	1; /* 23:23 */
-			picreg_t dev_size      :	1; /* 22:22 */
-			picreg_t real_time     :	1; /* 21:21 */
-			picreg_t               :	1; /* 20:20 */
-			picreg_t swap_direct   :	1; /* 19:19 */
-			picreg_t prefetch      :	1; /* 18:18 */
-			picreg_t precise       :	1; /* 17:17 */
-			picreg_t coherent      :	1; /* 16:16 */
-			picreg_t barrier       :	1; /* 15:15 */
-			picreg_t gbr           :	1; /* 14:14 */
-			picreg_t dev_swap      :	1; /* 13:13 */
-			picreg_t dev_io_mem    :	1; /* 12:12 */
-			picreg_t dev_off       :	12; /* 11:0 */
-		} pic_device_reg_fld_s;
-	} pic_device_reg_u_t;
-/*
- * Device (x) Write Request Buffer Flush
- *
- * When read, this register will return a 0x00 after the write buffer associat-
- * ed with the device has been flushed. (PCI Only)
- */
-
-
-/*
- * Even Device Read Response Buffer Register (PCI Only)
- *
- * This register is use to allocate the read response buffers for the even num-
- * bered devices. (0,2)
- */
-	typedef union pic_p_even_resp_u {
-		picreg_t	pic_p_even_resp_regval;
-		struct {
-			picreg_t              :	32; /* 63:32 */
-			picreg_t buff_14_en   :	1; /* 31:31 */
-			picreg_t buff_14_vdev :	2; /* 30:29 */
-			picreg_t buff_14_pdev :	1; /* 28:28 */
-			picreg_t buff_12_en   :	1; /* 27:27 */
-			picreg_t buff_12_vdev :	2; /* 26:25 */
-			picreg_t buff_12_pdev :	1; /* 24:24 */
-			picreg_t buff_10_en   :	1; /* 23:23 */
-			picreg_t buff_10_vdev :	2; /* 22:21 */
-			picreg_t buff_10_pdev :	1; /* 20:20 */
-			picreg_t buff_8_en    :	1; /* 19:19 */
-			picreg_t buff_8_vdev  :	2; /* 18:17 */
-			picreg_t buff_8_pdev  :	1; /* 16:16 */
-			picreg_t buff_6_en    :	1; /* 15:15 */
-			picreg_t buff_6_vdev  :	2; /* 14:13 */
-			picreg_t buff_6_pdev  :	1; /* 12:12 */
-			picreg_t buff_4_en    :	1; /* 11:11 */
-			picreg_t buff_4_vdev  :	2; /* 10:9 */
-			picreg_t buff_4_pdev  :	1; /* 8:8 */
-			picreg_t buff_2_en    :	1; /* 7:7 */
-			picreg_t buff_2_vdev  :	2; /* 6:5 */
-			picreg_t buff_2_pdev  :	1; /* 4:4 */
-			picreg_t buff_0_en    :	1; /* 3:3 */
-			picreg_t buff_0_vdev  :	2; /* 2:1 */
-			picreg_t buff_0_pdev  :	1; /* 0:0 */
-		} pic_p_even_resp_fld_s;
-	} pic_p_even_resp_u_t;
-/*
- * Odd Device Read Response Buffer Register (PCI Only)
- *
- * This register is use to allocate the read response buffers for the odd num-
- * bered devices. (1,3))
- */
-	typedef union pic_p_odd_resp_u {
-		picreg_t	pic_p_odd_resp_regval;
-		struct {
-			picreg_t              :	32; /* 63:32 */
-			picreg_t buff_15_en   :	1; /* 31:31 */
-			picreg_t buff_15_vdev :	2; /* 30:29 */
-			picreg_t buff_15_pdev :	1; /* 28:28 */
-			picreg_t buff_13_en   :	1; /* 27:27 */
-			picreg_t buff_13_vdev :	2; /* 26:25 */
-			picreg_t buff_13_pdev :	1; /* 24:24 */
-			picreg_t buff_11_en   :	1; /* 23:23 */
-			picreg_t buff_11_vdev :	2; /* 22:21 */
-			picreg_t buff_11_pdev :	1; /* 20:20 */
-			picreg_t buff_9_en    :	1; /* 19:19 */
-			picreg_t buff_9_vdev  :	2; /* 18:17 */
-			picreg_t buff_9_pdev  :	1; /* 16:16 */
-			picreg_t buff_7_en    :	1; /* 15:15 */
-			picreg_t buff_7_vdev  :	2; /* 14:13 */
-			picreg_t buff_7_pdev  :	1; /* 12:12 */
-			picreg_t buff_5_en    :	1; /* 11:11 */
-			picreg_t buff_5_vdev  :	2; /* 10:9 */
-			picreg_t buff_5_pdev  :	1; /* 8:8 */
-			picreg_t buff_3_en    :	1; /* 7:7 */
-			picreg_t buff_3_vdev  :	2; /* 6:5 */
-			picreg_t buff_3_pdev  :	1; /* 4:4 */
-			picreg_t buff_1_en    :	1; /* 3:3 */
-			picreg_t buff_1_vdev  :	2; /* 2:1 */
-			picreg_t buff_1_pdev  :	1; /* 0:0 */
-		} pic_p_odd_resp_fld_s;
-	} pic_p_odd_resp_u_t;
-/*
- * Read Response Buffer Status Register (PCI Only)
- *
- * This read only register contains the current response buffer status.
- */
-	typedef union pic_p_resp_status_u {
-		picreg_t	pic_p_resp_status_regval;
-		struct {
-			picreg_t           :	32; /* 63:32 */
-			picreg_t rrb_valid :	16; /* 31:16 */
-			picreg_t rrb_inuse :	16; /* 15:0 */
-		} pic_p_resp_status_fld_s;
-	} pic_p_resp_status_u_t;
-/*
- * Read Response Buffer Clear Register (PCI Only)
- *
- * A write to this register clears the current contents of the buffer.
- */
-	typedef union pic_p_resp_clear_u {
-		picreg_t	pic_p_resp_clear_regval;
-		struct {
-			picreg_t           :	32; /* 63:32 */
-			picreg_t           :	16; /* 31:16 */
-			picreg_t rrb_clear :	16; /* 15:0 */
-		} pic_p_resp_clear_fld_s;
-	} pic_p_resp_clear_u_t;
-/*
- * PCI Read Response Buffer (x) Upper Address Match
- *
- * The PCI Bridge read response buffer upper address register is a read only
- * register which contains the upper 16-bits of the address and status used to
- * select the buffer for a PCI transaction.
- */
-	typedef union pic_p_buf_upper_addr_match_u {
-		picreg_t	pic_p_buf_upper_addr_match_regval;
-		struct {
-			picreg_t          :	32; /* 63:32 */
-			picreg_t filled   :	1; /* 31:31 */
-			picreg_t armed    :	1; /* 30:30 */
-			picreg_t flush    :	1; /* 29:29 */
-			picreg_t xerr     :	1; /* 28:28 */
-			picreg_t pkterr   :	1; /* 27:27 */
-			picreg_t timeout  :	1; /* 26:26 */
-			picreg_t prefetch :	1; /* 25:25 */
-			picreg_t precise  :	1; /* 24:24 */
-			picreg_t dw_be    :	8; /* 23:16 */
-			picreg_t upp_addr :	16; /* 15:0 */
-		} pic_p_buf_upper_addr_match_fld_s;
-	} pic_p_buf_upper_addr_match_u_t;
-/*
- * PCI Read Response Buffer (x) Lower Address Match
- *
- * The PCI Bridge read response buffer lower address Match register is a
- * read only register which contains the address and status used to select the
- * buffer for a PCI transaction.
- */
-	typedef union pic_p_buf_lower_addr_match_u {
-		picreg_t	pic_p_buf_lower_addr_match_regval;
-		struct {
-			picreg_t filled   :	1; /* 63:63 */
-			picreg_t armed    :	1; /* 62:62 */
-			picreg_t flush    :	1; /* 61:61 */
-			picreg_t xerr     :	1; /* 60:60 */
-			picreg_t pkterr   :	1; /* 59:59 */
-			picreg_t timeout  :	1; /* 58:58 */
-			picreg_t prefetch :	1; /* 57:57 */
-			picreg_t precise  :	1; /* 56:56 */
-			picreg_t dw_be    :	8; /* 55:48 */
-			picreg_t upp_addr :	16; /* 47:32 */
-			picreg_t low_addr :	32; /* 31:0 */
-		} pic_p_buf_lower_addr_match_fld_s;
-	} pic_p_buf_lower_addr_match_u_t;
-/*
- * PCI Buffer (x) Flush Count with Data Touch Register
- *
- * This counter is incremented each time the corresponding response buffer
- * is flushed after at least a single data element in the buffer is used. A word
- * write to this address clears the count.
- */
-	typedef union pic_flush_w_touch_u {
-		picreg_t	pic_flush_w_touch_regval;
-		struct {
-			picreg_t           :	32; /* 63:32 */
-			picreg_t           :	16; /* 31:16 */
-			picreg_t touch_cnt :	16; /* 15:0 */
-		} pic_flush_w_touch_fld_s;
-	} pic_flush_w_touch_u_t;
-/*
- * PCI Buffer (x) Flush Count w/o Data Touch Register
- *
- * This counter is incremented each time the corresponding response buffer
- * is flushed without any data element in the buffer being used. A word
- * write to this address clears the count.
- */
-	typedef union pic_flush_wo_touch_u {
-		picreg_t	pic_flush_wo_touch_regval;
-		struct {
-			picreg_t             :	32; /* 63:32 */
-			picreg_t             :	16; /* 31:16 */
-			picreg_t notouch_cnt :	16; /* 15:0 */
-		} pic_flush_wo_touch_fld_s;
-	} pic_flush_wo_touch_u_t;
-/*
- * PCI Buffer (x) Request in Flight Count Register
- *
- * This counter is incremented on each bus clock while the request is in-
- * flight. A word write to this address clears the count. ]
- */
-	typedef union pic_inflight_u {
-		picreg_t	pic_inflight_regval;
-		struct {
-			picreg_t              :	32; /* 63:32 */
-			picreg_t              :	16; /* 31:16 */
-			picreg_t inflight_cnt :	16; /* 15:0 */
-		} pic_inflight_fld_s;
-	} pic_inflight_u_t;
-/*
- * PCI Buffer (x) Prefetch Request Count Register
- *
- * This counter is incremented each time the request using this buffer was
- * generated from the prefetcher. A word write to this address clears the
- * count.
- */
-	typedef union pic_prefetch_u {
-		picreg_t	pic_prefetch_regval;
-		struct {
-			picreg_t              :	32; /* 63:32 */
-			picreg_t              :	16; /* 31:16 */
-			picreg_t prefetch_cnt :	16; /* 15:0 */
-		} pic_prefetch_fld_s;
-	} pic_prefetch_u_t;
-/*
- * PCI Buffer (x) Total PCI Retry Count Register
- *
- * This counter is incremented each time a PCI bus retry occurs and the ad-
- * dress matches the tag for the selected buffer. The buffer must also has this
- * request in-flight. A word write to this address clears the count.
- */
-	typedef union pic_total_pci_retry_u {
-		picreg_t	pic_total_pci_retry_regval;
-		struct {
-			picreg_t           :	32; /* 63:32 */
-			picreg_t           :	16; /* 31:16 */
-			picreg_t retry_cnt :	16; /* 15:0 */
-		} pic_total_pci_retry_fld_s;
-	} pic_total_pci_retry_u_t;
-/*
- * PCI Buffer (x) Max PCI Retry Count Register
- *
- * This counter is contains the maximum retry count for a single request
- * which was in-flight for this buffer. A word write to this address clears the
- * count.
- */
-	typedef union pic_max_pci_retry_u {
-		picreg_t	pic_max_pci_retry_regval;
-		struct {
-			picreg_t               :	32; /* 63:32 */
-			picreg_t               :	16; /* 31:16 */
-			picreg_t max_retry_cnt :	16; /* 15:0 */
-		} pic_max_pci_retry_fld_s;
-	} pic_max_pci_retry_u_t;
-/*
- * PCI Buffer (x) Max Latency Count Register
- *
- * This counter is contains the maximum count (in bus clocks) for a single
- * request which was in-flight for this buffer. A word write to this address
- * clears the count.
- */
-	typedef union pic_max_latency_u {
-		picreg_t	pic_max_latency_regval;
-		struct {
-			picreg_t                 :	32; /* 63:32 */
-			picreg_t                 :	16; /* 31:16 */
-			picreg_t max_latency_cnt :	16; /* 15:0 */
-		} pic_max_latency_fld_s;
-	} pic_max_latency_u_t;
-/*
- * PCI Buffer (x) Clear All Register
- *
- * Any access to this register clears all the count values for the (x) registers.
- */
-
-
-/*
- * PCI-X Registers
- *
- * This register contains the address in the read buffer structure. There are
- * 16 read buffer structures.
- */
-	typedef union pic_rd_buf_addr_u {
-		picreg_t	pic_rd_buf_addr_regval;
-		struct {
-			picreg_t pcix_err_addr :	64; /* 63:0 */
-		} pic_rd_buf_addr_fld_s;
-	} pic_rd_buf_addr_u_t;
-/*
- * PCI-X Read Buffer (x) Attribute Register
- *
- * This register contains the attribute data in the read buffer structure. There
- * are  16 read buffer structures.
- */
-	typedef union pic_px_read_buf_attr_u {
-		picreg_t	pic_px_read_buf_attr_regval;
-		struct {
-			picreg_t                :	16; /* 63:48 */
-			picreg_t bus_cmd        :	4; /* 47:44 */
-			picreg_t byte_cnt       :	12; /* 43:32 */
-			picreg_t entry_valid    :	1; /* 31:31 */
-			picreg_t ns             :	1; /* 30:30 */
-			picreg_t ro             :	1; /* 29:29 */
-			picreg_t tag            :	5; /* 28:24 */
-			picreg_t bus_num        :	8; /* 23:16 */
-			picreg_t dev_num        :	5; /* 15:11 */
-			picreg_t fun_num        :	3; /* 10:8 */
-			picreg_t                :	2; /* 7:6 */
-			picreg_t f_buffer_index :	6; /* 5:0 */
-		} pic_px_read_buf_attr_fld_s;
-	} pic_px_read_buf_attr_u_t;
-/*
- * PCI-X Write Buffer (x) Address Register
- *
- * This register contains the address in the write buffer structure. There are
- * 8 write buffer structures.
- */
-	typedef union pic_px_write_buf_addr_u {
-		picreg_t	pic_px_write_buf_addr_regval;
-		struct {
-			picreg_t pcix_err_addr :	64; /* 63:0 */
-		} pic_px_write_buf_addr_fld_s;
-	} pic_px_write_buf_addr_u_t;
-/*
- * PCI-X Write Buffer (x) Attribute Register
- *
- * This register contains the attribute data in the write buffer structure.
- * There are 8 write buffer structures.
- */
-	typedef union pic_px_write_buf_attr_u {
-		picreg_t	pic_px_write_buf_attr_regval;
-		struct {
-			picreg_t                :	16; /* 63:48 */
-			picreg_t bus_cmd        :	4; /* 47:44 */
-			picreg_t byte_cnt       :	12; /* 43:32 */
-			picreg_t entry_valid    :	1; /* 31:31 */
-			picreg_t ns             :	1; /* 30:30 */
-			picreg_t ro             :	1; /* 29:29 */
-			picreg_t tag            :	5; /* 28:24 */
-			picreg_t bus_num        :	8; /* 23:16 */
-			picreg_t dev_num        :	5; /* 15:11 */
-			picreg_t fun_num        :	3; /* 10:8 */
-			picreg_t                :	2; /* 7:6 */
-			picreg_t f_buffer_index :	6; /* 5:0 */
-		} pic_px_write_buf_attr_fld_s;
-	} pic_px_write_buf_attr_u_t;
-/*
- * PCI-X Write Buffer (x) Valid Register
- *
- * This register contains the valid or inuse cache lines for this buffer struc-
- * ture.
- */
-	typedef union pic_px_write_buf_valid_u {
-		picreg_t	pic_px_write_buf_valid_regval;
-		struct {
-			picreg_t                :	32; /* 63:32 */
-			picreg_t wrt_valid_buff :	32; /* 31:0 */
-		} pic_px_write_buf_valid_fld_s;
-	} pic_px_write_buf_valid_u_t;
+/*****************************************************************************
+ *********************** PIC MMR structure mapping ***************************
+ *****************************************************************************/
+
+/* NOTE: PIC WAR. PV#854697.  PIC does not allow writes just to [31:0]
+ * of a 64-bit register.  When writing PIC registers, always write the 
+ * entire 64 bits.
+ */
+
+typedef volatile struct pic_s {
+
+    /* 0x000000-0x00FFFF -- Local Registers */
+
+    /* 0x000000-0x000057 -- Standard Widget Configuration */
+    picreg_t		p_wid_id;			/* 0x000000 */
+    picreg_t		p_wid_stat;			/* 0x000008 */
+    picreg_t		p_wid_err_upper;		/* 0x000010 */
+    picreg_t		p_wid_err_lower;		/* 0x000018 */
+    #define p_wid_err p_wid_err_lower
+    picreg_t		p_wid_control;			/* 0x000020 */
+    picreg_t		p_wid_req_timeout;		/* 0x000028 */
+    picreg_t		p_wid_int_upper;		/* 0x000030 */
+    picreg_t		p_wid_int_lower;		/* 0x000038 */
+    #define p_wid_int p_wid_int_lower
+    picreg_t		p_wid_err_cmdword;		/* 0x000040 */
+    picreg_t		p_wid_llp;			/* 0x000048 */
+    picreg_t		p_wid_tflush;			/* 0x000050 */
+
+    /* 0x000058-0x00007F -- Bridge-specific Widget Configuration */
+    picreg_t		p_wid_aux_err;			/* 0x000058 */
+    picreg_t		p_wid_resp_upper;		/* 0x000060 */
+    picreg_t		p_wid_resp_lower;		/* 0x000068 */
+    #define p_wid_resp p_wid_resp_lower
+    picreg_t		p_wid_tst_pin_ctrl;		/* 0x000070 */
+    picreg_t		p_wid_addr_lkerr;		/* 0x000078 */
+
+    /* 0x000080-0x00008F -- PMU & MAP */
+    picreg_t		p_dir_map;			/* 0x000080 */
+    picreg_t		_pad_000088;			/* 0x000088 */
+
+    /* 0x000090-0x00009F -- SSRAM */
+    picreg_t		p_map_fault;			/* 0x000090 */
+    picreg_t		_pad_000098;			/* 0x000098 */
+
+    /* 0x0000A0-0x0000AF -- Arbitration */
+    picreg_t		p_arb;				/* 0x0000A0 */
+    picreg_t		_pad_0000A8;			/* 0x0000A8 */
+
+    /* 0x0000B0-0x0000BF -- Number In A Can or ATE Parity Error */
+    picreg_t		p_ate_parity_err;		/* 0x0000B0 */
+    picreg_t		_pad_0000B8;			/* 0x0000B8 */
+
+    /* 0x0000C0-0x0000FF -- PCI/GIO */
+    picreg_t		p_bus_timeout;			/* 0x0000C0 */
+    picreg_t		p_pci_cfg;			/* 0x0000C8 */
+    picreg_t		p_pci_err_upper;		/* 0x0000D0 */
+    picreg_t		p_pci_err_lower;		/* 0x0000D8 */
+    #define p_pci_err p_pci_err_lower
+    picreg_t		_pad_0000E0[4];			/* 0x0000{E0..F8} */
+
+    /* 0x000100-0x0001FF -- Interrupt */
+    picreg_t		p_int_status;			/* 0x000100 */
+    picreg_t		p_int_enable;			/* 0x000108 */
+    picreg_t		p_int_rst_stat;			/* 0x000110 */
+    picreg_t		p_int_mode;			/* 0x000118 */
+    picreg_t		p_int_device;			/* 0x000120 */
+    picreg_t		p_int_host_err;			/* 0x000128 */
+    picreg_t		p_int_addr[8];			/* 0x0001{30,,,68} */
+    picreg_t		p_err_int_view;			/* 0x000170 */
+    picreg_t		p_mult_int;			/* 0x000178 */
+    picreg_t		p_force_always[8];		/* 0x0001{80,,,B8} */
+    picreg_t		p_force_pin[8];			/* 0x0001{C0,,,F8} */
+
+    /* 0x000200-0x000298 -- Device */
+    picreg_t		p_device[4];			/* 0x0002{00,,,18} */
+    picreg_t		_pad_000220[4];			/* 0x0002{20,,,38} */
+    picreg_t		p_wr_req_buf[4];		/* 0x0002{40,,,58} */
+    picreg_t		_pad_000260[4];			/* 0x0002{60,,,78} */
+    picreg_t		p_rrb_map[2];			/* 0x0002{80,,,88} */
+    #define p_even_resp p_rrb_map[0]			/* 0x000280 */
+    #define p_odd_resp  p_rrb_map[1]			/* 0x000288 */
+    picreg_t		p_resp_status;			/* 0x000290 */
+    picreg_t		p_resp_clear;			/* 0x000298 */
+
+    picreg_t		_pad_0002A0[12];		/* 0x0002{A0..F8} */
+
+    /* 0x000300-0x0003F8 -- Buffer Address Match Registers */
+    struct {
+	picreg_t	upper;				/* 0x0003{00,,,F0} */
+	picreg_t	lower;				/* 0x0003{08,,,F8} */
+    } p_buf_addr_match[16];
+
+    /* 0x000400-0x0005FF -- Performance Monitor Registers (even only) */
+    struct {
+	picreg_t	flush_w_touch;			/* 0x000{400,,,5C0} */
+	picreg_t	flush_wo_touch;			/* 0x000{408,,,5C8} */
+	picreg_t	inflight;			/* 0x000{410,,,5D0} */
+	picreg_t	prefetch;			/* 0x000{418,,,5D8} */
+	picreg_t	total_pci_retry;		/* 0x000{420,,,5E0} */
+	picreg_t	max_pci_retry;			/* 0x000{428,,,5E8} */
+	picreg_t	max_latency;			/* 0x000{430,,,5F0} */
+	picreg_t	clear_all;			/* 0x000{438,,,5F8} */
+    } p_buf_count[8];
+
+    
+    /* 0x000600-0x0009FF -- PCI/X registers */
+    picreg_t		p_pcix_bus_err_addr;		/* 0x000600 */
+    picreg_t		p_pcix_bus_err_attr;		/* 0x000608 */
+    picreg_t		p_pcix_bus_err_data;		/* 0x000610 */
+    picreg_t		p_pcix_pio_split_addr;		/* 0x000618 */
+    picreg_t		p_pcix_pio_split_attr;		/* 0x000620 */
+    picreg_t		p_pcix_dma_req_err_attr;	/* 0x000628 */
+    picreg_t		p_pcix_dma_req_err_addr;	/* 0x000630 */
+    picreg_t		p_pcix_timeout;			/* 0x000638 */
+
+    picreg_t		_pad_000640[120];		/* 0x000{640,,,9F8} */
+
+    /* 0x000A00-0x000BFF -- PCI/X Read&Write Buffer */
+    struct {
+	picreg_t	p_buf_addr;			/* 0x000{A00,,,AF0} */
+	picreg_t	p_buf_attr;			/* 0X000{A08,,,AF8} */
+    } p_pcix_read_buf_64[16];
+
+    struct {
+	picreg_t	p_buf_addr;			/* 0x000{B00,,,BE0} */
+	picreg_t	p_buf_attr;			/* 0x000{B08,,,BE8} */
+	picreg_t	p_buf_valid;			/* 0x000{B10,,,BF0} */
+	picreg_t	__pad1;				/* 0x000{B18,,,BF8} */
+    } p_pcix_write_buf_64[8];
+
+    /* End of Local Registers -- Start of Address Map space */
+
+    char		_pad_000c00[0x010000 - 0x000c00];
+
+    /* 0x010000-0x011fff -- Internal ATE RAM (Auto Parity Generation) */
+    picate_t		p_int_ate_ram[1024];		/* 0x010000-0x011fff */
+
+    /* 0x012000-0x013fff -- Internal ATE RAM (Manual Parity Generation) */
+    picate_t		p_int_ate_ram_mp[1024];		/* 0x012000-0x013fff */
+
+    char		_pad_014000[0x18000 - 0x014000];
+
+    /* 0x18000-0x197F8 -- PIC Write Request Ram */
+    picreg_t		p_wr_req_lower[256];		/* 0x18000 - 0x187F8 */
+    picreg_t		p_wr_req_upper[256];		/* 0x18800 - 0x18FF8 */
+    picreg_t		p_wr_req_parity[256];		/* 0x19000 - 0x197F8 */
+
+    char		_pad_019800[0x20000 - 0x019800];
+
+    /* 0x020000-0x027FFF -- PCI Device Configuration Spaces */
+    union {
+	uint8_t		c[0x1000 / 1];			/* 0x02{0000,,,7FFF} */
+	uint16_t	s[0x1000 / 2];			/* 0x02{0000,,,7FFF} */
+	uint32_t	l[0x1000 / 4];			/* 0x02{0000,,,7FFF} */
+	uint64_t	d[0x1000 / 8];			/* 0x02{0000,,,7FFF} */
+	union {
+	    uint8_t	c[0x100 / 1];
+	    uint16_t	s[0x100 / 2];
+	    uint32_t	l[0x100 / 4];
+	    uint64_t	d[0x100 / 8];
+	} f[8];
+    } p_type0_cfg_dev[8];				/* 0x02{0000,,,7FFF} */
+
+    /* 0x028000-0x028FFF -- PCI Type 1 Configuration Space */
+    union {
+	uint8_t		c[0x1000 / 1];			/* 0x028000-0x029000 */
+	uint16_t	s[0x1000 / 2];			/* 0x028000-0x029000 */
+	uint32_t	l[0x1000 / 4];			/* 0x028000-0x029000 */
+	uint64_t	d[0x1000 / 8];			/* 0x028000-0x029000 */
+	union {
+	    uint8_t	c[0x100 / 1];
+	    uint16_t	s[0x100 / 2];
+	    uint32_t	l[0x100 / 4];
+	    uint64_t	d[0x100 / 8];
+	} f[8];
+    } p_type1_cfg;					/* 0x028000-0x029000 */
+
+    char		_pad_029000[0x030000-0x029000];
+
+    /* 0x030000-0x030007 -- PCI Interrupt Acknowledge Cycle */
+    union {
+	uint8_t		c[8 / 1];
+	uint16_t	s[8 / 2];
+	uint32_t	l[8 / 4];
+	uint64_t	d[8 / 8];
+    } p_pci_iack;					/* 0x030000-0x030007 */
+
+    char		_pad_030007[0x040000-0x030008];
+
+    /* 0x040000-0x030007 -- PCIX Special Cycle */
+    union {
+	uint8_t		c[8 / 1];
+	uint16_t	s[8 / 2];
+	uint32_t	l[8 / 4];
+	uint64_t	d[8 / 8];
+    } p_pcix_cycle;					/* 0x040000-0x040007 */
+} pic_t;
 
-#endif				/* __ASSEMBLY__ */
-#endif                          /* _ASM_SN_PCI_PIC_H */
+#endif                          /* _ASM_IA64_SN_PCI_PIC_H */
diff -Nru a/include/asm-ia64/sn/pda.h b/include/asm-ia64/sn/pda.h
--- a/include/asm-ia64/sn/pda.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ia64/sn/pda.h	Tue Feb  3 19:45:42 2004
@@ -10,7 +10,6 @@
 
 #include <linux/config.h>
 #include <linux/cache.h>
-#include <linux/numa.h>
 #include <asm/percpu.h>
 #include <asm/system.h>
 #include <asm/processor.h>
@@ -61,6 +60,7 @@
 	int		sn_lb_int_war_ticks;
 	int		sn_last_irq;
 	int		sn_first_irq;
+	int		sn_num_irqs;			/* number of irqs targeted for this cpu */
 } pda_t;
 
 
diff -Nru a/include/asm-ia64/sn/pio.h b/include/asm-ia64/sn/pio.h
--- a/include/asm-ia64/sn/pio.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ia64/sn/pio.h	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -30,8 +29,8 @@
 
 
 typedef struct piomap {
-	uint		pio_bus;
-	uint		pio_adap;
+	unsigned int	pio_bus;
+	unsigned int	pio_adap;
 	int		pio_flag;
 	int		pio_reg;
 	char		pio_name[7];	/* to identify the mapped device */
diff -Nru a/include/asm-ia64/sn/prio.h b/include/asm-ia64/sn/prio.h
--- a/include/asm-ia64/sn/prio.h	Tue Feb  3 19:45:18 2004
+++ b/include/asm-ia64/sn/prio.h	Tue Feb  3 19:45:18 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
diff -Nru a/include/asm-ia64/sn/router.h b/include/asm-ia64/sn/router.h
--- a/include/asm-ia64/sn/router.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/sn/router.h	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,4 @@
-/* $id$
- *
+/*
  * 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.
diff -Nru a/include/asm-ia64/sn/sgi.h b/include/asm-ia64/sn/sgi.h
--- a/include/asm-ia64/sn/sgi.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ia64/sn/sgi.h	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,4 @@
 /*
- *
  * 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.
@@ -21,14 +20,15 @@
 
 typedef hwgfs_handle_t vertex_hdl_t;
 
-typedef int64_t  __psint_t;	/* needed by klgraph.c */
-
-typedef enum { B_FALSE, B_TRUE } boolean_t;
+/* Nice general name length that lots of people like to use */
+#ifndef MAXDEVNAME
+#define MAXDEVNAME 256
+#endif
 
 
 /*
-** Possible return values from graph routines.
-*/
+ * Possible return values from graph routines.
+ */
 typedef enum graph_error_e {
 	GRAPH_SUCCESS,		/* 0 */
 	GRAPH_DUP,		/* 1 */
@@ -40,67 +40,15 @@
 	GRAPH_IN_USE		/* 7 */
 } graph_error_t;
 
-#define KM_SLEEP   0x0000
-#define KM_NOSLEEP 0x0001		/* needed by kmem_alloc_node(), kmem_zalloc()
-					 * calls */
-#define VM_NOSLEEP 0x0001		/* needed kmem_alloc_node(), kmem_zalloc_node
-					 * calls */
-#define XG_WIDGET_PART_NUM      0xC102          /* KONA/xt_regs.h     XG_XT_PART_NUM_VALUE */
-
-typedef uint64_t vhandl_t;
-
-
-#define NBPP PAGE_SIZE
-#define _PAGESZ PAGE_SIZE
-
-#ifndef MAXDEVNAME
-#define MAXDEVNAME 256
-#endif
-
-#define HUB_PIO_CONVEYOR 0x1
 #define CNODEID_NONE ((cnodeid_t)-1)
-#define XTALK_PCI_PART_NUM "030-1275-"
-#define kdebug 0
-
-
-#define COPYIN(a, b, c)		copy_from_user(b,a,c)
-#define COPYOUT(a, b, c)	copy_to_user(b,a,c)
-
-#define BZERO(a,b)		memset(a, 0, b)
-
-#define kern_malloc(x)		kmalloc(x, GFP_KERNEL)
-#define kern_free(x)		kfree(x)
-
-typedef cpuid_t cpu_cookie_t;
 #define CPU_NONE		(-1)
+#define GRAPH_VERTEX_NONE ((vertex_hdl_t)-1)
+
 
 /*
- * mutext support mapping
+ * No code is complete without an Assertion macro
  */
 
-#define mutex_spinlock_init(s)	spin_lock_init(s)
-inline static unsigned long
-mutex_spinlock(spinlock_t *sem) {
-	unsigned long flags = 0;
-//	spin_lock_irqsave(sem, flags);
-	spin_lock(sem);
-	return(flags);
-}
-// #define mutex_spinunlock(s,t)	spin_unlock_irqrestore(s,t)
-#define mutex_spinunlock(s,t)	spin_unlock(s)
-
-
-#define mutex_t			struct semaphore
-#define mutex_init(s)		init_MUTEX(s)
-#define mutex_init_locked(s)	init_MUTEX_LOCKED(s)
-#define mutex_lock(s)		down(s)
-#define mutex_unlock(s)		up(s)
-
-#define io_splock(s)		mutex_spinlock(s)
-#define io_spunlock(s,t)	spin_unlock(s)
-
-#define spin_lock_destroy(s)
-
 #if defined(DISABLE_ASSERT)
 #define ASSERT(expr)
 #define ASSERT_ALWAYS(expr)
@@ -119,59 +67,5 @@
 		panic("Assertion always panic\n"); 	\
         } } while(0)
 #endif	/* DISABLE_ASSERT */
-
-#define PRINT_PANIC		panic
-
-/* print_register() defs */
-
-/*
- * register values
- * map between numeric values and symbolic values
- */
-struct reg_values {
-	unsigned long long rv_value;
-	char *rv_name;
-};
-
-/*
- * register descriptors are used for formatted prints of register values
- * rd_mask and rd_shift must be defined, other entries may be null
- */
-struct reg_desc {
-	unsigned long long rd_mask;	/* mask to extract field */
-	int rd_shift;		/* shift for extracted value, - >>, + << */
-	char *rd_name;		/* field name */
-	char *rd_format;	/* format to print field */
-	struct reg_values *rd_values;	/* symbolic names of values */
-};
-
-extern void print_register(unsigned long long, struct reg_desc *);
-
-/******************************************
- * Definitions that do not exist in linux *
- ******************************************/
-
-#define DELAY(a)
-
-/************************************************
- * Routines redefined to use linux equivalents. *
- ************************************************/
-
-/* #define FIXME(s) printk("FIXME: [ %s ] in %s at %s:%d\n", s, __FUNCTION__, __FILE__, __LINE__) */
-
-#define FIXME(s)
-
-/* move to stubs.c yet */
-#define dev_to_vhdl(dev) 0
-#define get_timestamp() 0
-#define us_delay(a)
-#define v_mapphys(a,b,c) 0    // printk("Fixme: v_mapphys - soft->base 0x%p\n", b);
-#define splhi()  0
-#define splx(s)
-
-extern void * snia_kmem_alloc_node(register size_t, register int, cnodeid_t);
-extern void * snia_kmem_zalloc(size_t, int);
-extern void * snia_kmem_zalloc_node(register size_t, register int, cnodeid_t );
-extern int is_specified(char *);
 
 #endif /* _ASM_IA64_SN_SGI_H */
diff -Nru a/include/asm-ia64/sn/slotnum.h b/include/asm-ia64/sn/slotnum.h
--- a/include/asm-ia64/sn/slotnum.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-ia64/sn/slotnum.h	Tue Feb  3 19:45:43 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
diff -Nru a/include/asm-ia64/sn/sn2/addrs.h b/include/asm-ia64/sn/sn2/addrs.h
--- a/include/asm-ia64/sn/sn2/addrs.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ia64/sn/sn2/addrs.h	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,4 @@
 /*
- *
  * 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.
@@ -107,9 +106,9 @@
 #define NASID_META_BITS		0	/* ???? */
 #define NASID_LOCAL_BITS	7	/* same router as SN1 */
 
-#define NODE_ADDRSPACE_SIZE     (UINT64_CAST 1 << NODE_SIZE_BITS)
-#define NASID_MASK              (UINT64_CAST NASID_BITMASK << NASID_SHFT)
-#define NASID_GET(_pa)          (int) ((UINT64_CAST (_pa) >>            \
+#define NODE_ADDRSPACE_SIZE     (1UL << NODE_SIZE_BITS)
+#define NASID_MASK              ((uint64_t) NASID_BITMASK << NASID_SHFT)
+#define NASID_GET(_pa)          (int) (((uint64_t) (_pa) >>            \
                                         NASID_SHFT) & NASID_BITMASK)
 #define PHYS_TO_DMA(x)          ( ((x & NASID_MASK) >> 2) |             \
                                   (x & (NODE_ADDRSPACE_SIZE - 1)) )
@@ -130,9 +129,9 @@
         : RAW_NODE_SWIN_BASE(nasid, widget))
 #else
 #define NODE_SWIN_BASE(nasid, widget) \
-     (NODE_IO_BASE(nasid) + (UINT64_CAST (widget) << SWIN_SIZE_BITS))
+     (NODE_IO_BASE(nasid) + ((uint64_t) (widget) << SWIN_SIZE_BITS))
 #define LOCAL_SWIN_BASE(widget) \
-	(UNCACHED | LOCAL_MMR_SPACE | ((UINT64_CAST (widget) << SWIN_SIZE_BITS)))
+	(UNCACHED | LOCAL_MMR_SPACE | (((uint64_t) (widget) << SWIN_SIZE_BITS)))
 #endif /* __ASSEMBLY__ */
 
 /*
@@ -142,12 +141,12 @@
  */
 
 #define BWIN_INDEX_BITS         3
-#define BWIN_SIZE               (UINT64_CAST 1 << BWIN_SIZE_BITS)
+#define BWIN_SIZE               (1UL << BWIN_SIZE_BITS)
 #define BWIN_SIZEMASK           (BWIN_SIZE - 1)
 #define BWIN_WIDGET_MASK        0x7
 #define NODE_BWIN_BASE0(nasid)  (NODE_IO_BASE(nasid) + BWIN_SIZE)
 #define NODE_BWIN_BASE(nasid, bigwin)   (NODE_BWIN_BASE0(nasid) +       \
-                        (UINT64_CAST (bigwin) << BWIN_SIZE_BITS))
+                        ((uint64_t) (bigwin) << BWIN_SIZE_BITS))
 
 #define BWIN_WIDGETADDR(addr)   ((addr) & BWIN_SIZEMASK)
 #define BWIN_WINDOWNUM(addr)    (((addr) >> BWIN_SIZE_BITS) & BWIN_WIDGET_MASK)
diff -Nru a/include/asm-ia64/sn/sn2/arch.h b/include/asm-ia64/sn/sn2/arch.h
--- a/include/asm-ia64/sn/sn2/arch.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/sn/sn2/arch.h	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,4 @@
-/* $Id: arch.h,v 1.1 2002/02/28 17:31:25 marcelo Exp $
- *
+/*
  * 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.
@@ -28,7 +27,7 @@
  * Effectively, it's the maximum number of compact node ids (cnodeid_t).
  * This is not necessarily the same as MAX_NASIDS.
  */
-#define MAX_COMPACT_NODES       128
+#define MAX_COMPACT_NODES       2048
 
 /*
  * MAX_REGIONS refers to the maximum number of hardware partitioned regions.
diff -Nru a/include/asm-ia64/sn/sn2/geo.h b/include/asm-ia64/sn/sn2/geo.h
--- a/include/asm-ia64/sn/sn2/geo.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-ia64/sn/sn2/geo.h	Tue Feb  3 19:45:43 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
@@ -7,8 +6,8 @@
  * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
  */
 
-#ifndef __SYS_SN_SN2_GEO_H__
-#define __SYS_SN_SN2_GEO_H__
+#ifndef _ASM_IA64_SN_SN2_GEO_H
+#define _ASM_IA64_SN_SN2_GEO_H
 
 /* Headers required by declarations in this file */
 
@@ -106,4 +105,4 @@
 
 #define GEO_INVALID_STR		"<invalid>"
 
-#endif /* __SYS_SN_SN2_GEO_H__ */
+#endif /* _ASM_IA64_SN_SN2_GEO_H */
diff -Nru a/include/asm-ia64/sn/sn2/intr.h b/include/asm-ia64/sn/sn2/intr.h
--- a/include/asm-ia64/sn/sn2/intr.h	Tue Feb  3 19:45:41 2004
+++ b/include/asm-ia64/sn/sn2/intr.h	Tue Feb  3 19:45:41 2004
@@ -1,5 +1,4 @@
-/* $Id: intr.h,v 1.1 2002/02/28 17:31:25 marcelo Exp $
- *
+/*
  * 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.
diff -Nru a/include/asm-ia64/sn/sn2/shub.h b/include/asm-ia64/sn/sn2/shub.h
--- a/include/asm-ia64/sn/sn2/shub.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ia64/sn/sn2/shub.h	Tue Feb  3 19:45:42 2004
@@ -1,5 +1,4 @@
 /*
- *
  * 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.
diff -Nru a/include/asm-ia64/sn/sn2/shub_md.h b/include/asm-ia64/sn/sn2/shub_md.h
--- a/include/asm-ia64/sn/sn2/shub_md.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ia64/sn/sn2/shub_md.h	Tue Feb  3 19:45:42 2004
@@ -1,5 +1,4 @@
 /*
- *
  * 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.
@@ -8,8 +7,8 @@
  */
 
 
-#ifndef _SHUB_MD_H
-#define _SHUB_MD_H
+#ifndef _ASM_IA64_SN_SN2_SHUB_MD_H
+#define _ASM_IA64_SN_SN2_SHUB_MD_H
 
 /* SN2 supports a mostly-flat address space with 4 CPU-visible, evenly spaced, 
    contiguous regions, or "software banks".  On SN2, software bank n begins at 
@@ -273,4 +272,4 @@
 #define MD_BIST_MISCOMPARE(_n) (REMOTE_HUB_L(_n, SH_MMRBIST_ERR) &	\
 		SH_MMRBIST_ERR_DETECTED_MASK)
 
-#endif	/* _SHUB_MD_H */
+#endif	/* _ASM_IA64_SN_SN2_SHUB_MD_H */
diff -Nru a/include/asm-ia64/sn/sn2/shubio.h b/include/asm-ia64/sn/sn2/shubio.h
--- a/include/asm-ia64/sn/sn2/shubio.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/sn/sn2/shubio.h	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,4 @@
-/* $Id: shubio.h,v 1.1 2002/02/28 17:31:25 marcelo Exp $
- *
+/*
  * 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.
@@ -220,8 +219,6 @@
 #define    IIO_IPPR                  0x00430008    /* IO Performance Profiling */
 
 
-#ifndef __ASSEMBLY__
-
 /************************************************************************
  *                                                                      *
  * Description:  This register echoes some information from the         *
@@ -2845,8 +2842,6 @@
 } ii_ippr_u_t;
 
 
-#endif /* __ASSEMBLY__ */
-
 /**************************************************************************
  *                                                                        *
  * The following defines which were not formed into structures are        *
@@ -3390,7 +3385,6 @@
 #define IO_PERF_SETS	32
 
 #if __KERNEL__
-#ifndef __ASSEMBLY__
 #include <asm/sn/alenlist.h>
 #include <asm/sn/dmamap.h>
 #include <asm/sn/driver.h>
@@ -3626,10 +3620,6 @@
 extern int hub_ioerror_handler(vertex_hdl_t, int, int, struct io_error_s *);
 extern int kl_ioerror_handler(cnodeid_t, cnodeid_t, cpuid_t,
                               int, paddr_t, caddr_t, ioerror_mode_t);
-extern int hub_error_devenable(vertex_hdl_t, int, int);
-extern int  hub_dma_enabled(vertex_hdl_t);
-
-#endif /* __ASSEMBLY__ */
 #endif /* _KERNEL */
 #endif /* _ASM_IA64_SN_SN2_SHUBIO_H */
 
diff -Nru a/include/asm-ia64/sn/sn2/sn_private.h b/include/asm-ia64/sn/sn2/sn_private.h
--- a/include/asm-ia64/sn/sn2/sn_private.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/sn/sn2/sn_private.h	Tue Feb  3 19:45:17 2004
@@ -1,5 +1,4 @@
-/* $Id: sn_private.h,v 1.1 2002/02/28 17:31:26 marcelo Exp $
- *
+/*
  * 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.
@@ -22,12 +21,11 @@
 extern void cpu_unenable(cpuid_t);
 extern nasid_t get_lowest_nasid(void);
 extern __psunsigned_t get_master_bridge_base(void);
-extern void set_master_bridge_base(void);
 extern int check_nasid_equiv(nasid_t, nasid_t);
-extern nasid_t get_console_nasid(void);
 extern char get_console_pcislot(void);
 
-extern int is_master_baseio_nasid_widget(nasid_t test_nasid, xwidgetnum_t test_wid);
+extern int is_master_baseio_nasid_widget(nasid_t test_nasid,
+					 xwidgetnum_t test_wid);
 
 /* memsupport.c */
 extern void poison_state_alter_range(__psunsigned_t start, int len, int poison);
@@ -45,7 +43,7 @@
 extern int is_UNOWNED_dir_state(paddr_t);
 #ifdef LATER
 extern void get_dir_ent(paddr_t paddr, int *state,
-			uint64_t *vec_ptr, hubreg_t *elo);
+			uint64_t * vec_ptr, hubreg_t * elo);
 #endif
 
 /* intr.c */
@@ -59,10 +57,11 @@
 extern void install_cpuintr(cpuid_t cpu);
 extern void install_dbgintr(cpuid_t cpu);
 extern void install_tlbintr(cpuid_t cpu);
-extern void hub_migrintr_init(cnodeid_t /*cnode*/);
-extern int cause_intr_connect(int level, intr_func_t handler, uint intr_spl_mask);
+extern void hub_migrintr_init(cnodeid_t /*cnode */ );
+extern int cause_intr_connect(int level, intr_func_t handler,
+			      unsigned int intr_spl_mask);
 extern int cause_intr_disconnect(int level);
-extern void intr_dumpvec(cnodeid_t cnode, void (*pf)(char *, ...));
+extern void intr_dumpvec(cnodeid_t cnode, void (*pf) (char *, ...));
 
 /* error_dump.c */
 extern char *hub_rrb_err_type[];
@@ -92,10 +91,10 @@
 
 /* init.c */
 extern cnodeid_t get_compact_nodeid(void);	/* get compact node id */
-extern void init_platform_nodepda(nodepda_t *npda, cnodeid_t node);
+extern void init_platform_nodepda(nodepda_t * npda, cnodeid_t node);
 extern int is_fine_dirmode(void);
 extern void update_node_information(cnodeid_t);
- 
+
 /* shubio.c */
 extern void hubio_init(void);
 extern void hub_merge_clean(nasid_t nasid);
@@ -103,14 +102,14 @@
 
 /* shuberror.c */
 extern void hub_error_init(cnodeid_t);
-extern void dump_error_spool(cpuid_t cpu, void (*pf)(char *, ...));
+extern void dump_error_spool(cpuid_t cpu, void (*pf) (char *, ...));
 extern void hubni_error_handler(char *, int);
 extern int check_ni_errors(void);
 
 /* Used for debugger to signal upper software a breakpoint has taken place */
 
-extern void		*debugger_update;
-extern __psunsigned_t	debugger_stopped;
+extern void *debugger_update;
+extern __psunsigned_t debugger_stopped;
 
 /* 
  * piomap, created by shub_pio_alloc.
@@ -118,11 +117,11 @@
  * xtalk_piomap_s by generic xtalk routines.
  */
 struct hub_piomap_s {
-	struct xtalk_piomap_s	hpio_xtalk_info;/* standard crosstalk pio info */
-	vertex_hdl_t		hpio_hub;	/* which shub's mapping registers are set up */
-	short			hpio_holdcnt;	/* count of current users of bigwin mapping */
-	char			hpio_bigwin_num;/* if big window map, which one */
-	int 			hpio_flags;	/* defined below */
+	struct xtalk_piomap_s hpio_xtalk_info;	/* standard crosstalk pio info */
+	vertex_hdl_t hpio_hub;	/* which shub's mapping registers are set up */
+	short hpio_holdcnt;	/* count of current users of bigwin mapping */
+	char hpio_bigwin_num;	/* if big window map, which one */
+	int hpio_flags;		/* defined below */
 };
 /* hub_piomap flags */
 #define HUB_PIOMAP_IS_VALID		0x1
@@ -139,9 +138,9 @@
  * xtalk_dmamap_s by generic xtalk routines.
  */
 struct hub_dmamap_s {
-	struct xtalk_dmamap_s	hdma_xtalk_info;/* standard crosstalk dma info */
-	vertex_hdl_t		hdma_hub;	/* which shub we go through */
-	int			hdma_flags;	/* defined below */
+	struct xtalk_dmamap_s hdma_xtalk_info;	/* standard crosstalk dma info */
+	vertex_hdl_t hdma_hub;	/* which shub we go through */
+	int hdma_flags;		/* defined below */
 };
 /* shub_dmamap flags */
 #define HUB_DMAMAP_IS_VALID		0x1
@@ -154,30 +153,29 @@
  * xtalk_intr_s by generic xtalk routines.
  */
 struct hub_intr_s {
-	struct xtalk_intr_s	i_xtalk_info;	/* standard crosstalk intr info */
-	ilvl_t			i_swlevel;	/* software level for blocking intr */
-	cpuid_t			i_cpuid;	/* which cpu */
-	int			i_bit;		/* which bit */
-	int			i_flags;
+	struct xtalk_intr_s i_xtalk_info;	/* standard crosstalk intr info */
+	cpuid_t i_cpuid;	/* which cpu */
+	int i_bit;		/* which bit */
+	int i_flags;
 };
 /* flag values */
 #define HUB_INTR_IS_ALLOCED	0x1	/* for debug: allocated */
 #define HUB_INTR_IS_CONNECTED	0x4	/* for debug: connected to a software driver */
 
 typedef struct hubinfo_s {
-	nodepda_t			*h_nodepda;	/* pointer to node's private data area */
-	cnodeid_t			h_cnodeid;	/* compact nodeid */
-	nasid_t				h_nasid;	/* nasid */
+	nodepda_t *h_nodepda;	/* pointer to node's private data area */
+	cnodeid_t h_cnodeid;	/* compact nodeid */
+	nasid_t h_nasid;	/* nasid */
 
 	/* structures for PIO management */
-	xwidgetnum_t			h_widgetid;	/* my widget # (as viewed from xbow) */
-	struct hub_piomap_s		h_small_window_piomap[HUB_WIDGET_ID_MAX+1];
-	wait_queue_head_t		h_bwwait;	/* wait for big window to free */
-	spinlock_t			h_bwlock;	/* guard big window piomap's */
-	spinlock_t			h_crblock;      /* gaurd CRB error handling */
-	int				h_num_big_window_fixed;	/* count number of FIXED maps */
-	struct hub_piomap_s		h_big_window_piomap[HUB_NUM_BIG_WINDOW];
-	hub_intr_t			hub_ii_errintr;
+	xwidgetnum_t h_widgetid;	/* my widget # (as viewed from xbow) */
+	struct hub_piomap_s h_small_window_piomap[HUB_WIDGET_ID_MAX + 1];
+	wait_queue_head_t h_bwwait;	/* wait for big window to free */
+	spinlock_t h_bwlock;		/* guard big window piomap's */
+	spinlock_t h_crblock;		/* gaurd CRB error handling */
+	int h_num_big_window_fixed;	/* count number of FIXED maps */
+	struct hub_piomap_s h_big_window_piomap[HUB_NUM_BIG_WINDOW];
+	hub_intr_t hub_ii_errintr;
 } *hubinfo_t;
 
 #define hubinfo_get(vhdl, infoptr) ((void)hwgraph_info_get_LBL \
@@ -195,10 +193,10 @@
 			(&hinfo->h_big_window_piomap[win])
 #define	hubinfo_swin_piomap_get(hinfo, win)	\
 			(&hinfo->h_small_window_piomap[win])
-	
+
 /* cpu-specific information stored under INFO_LBL_CPU_INFO */
 typedef struct cpuinfo_s {
-	cpuid_t		ci_cpuid;	/* CPU ID */
+	cpuid_t ci_cpuid;	/* CPU ID */
 } *cpuinfo_t;
 
 #define cpuinfo_get(vhdl, infoptr) ((void)hwgraph_info_get_LBL \
@@ -211,6 +209,7 @@
 extern void xswitch_vertex_init(vertex_hdl_t xswitch);
 
 extern xtalk_provider_t hub_provider;
+extern int numionodes;
 
 /* du.c */
 int ducons_write(char *buf, int len);
@@ -233,15 +232,15 @@
  */
 #define paddr_dimm(_pa)		((_pa & MD_BANK_MASK) >> MD_BANK_SHFT)
 #define paddr_cnode(_pa)	(NASID_TO_COMPACT_NODEID(NASID_GET(_pa)))
-extern void membank_pathname_get(paddr_t,char *);
+extern void membank_pathname_get(paddr_t, char *);
 
 /* To redirect the output into the error buffer */
 #define errbuf_print(_s)	printf("#%s",_s)
 
-extern void crbx(nasid_t nasid, void (*pf)(char *, ...));
+extern void crbx(nasid_t nasid, void (*pf) (char *, ...));
 void bootstrap(void);
 
 /* sndrv.c */
 extern int sndrv_attach(vertex_hdl_t vertex);
 
-#endif /* _ASM_IA64_SN_SN2_SN_PRIVATE_H */
+#endif				/* _ASM_IA64_SN_SN2_SN_PRIVATE_H */
diff -Nru a/include/asm-ia64/sn/sn_fru.h b/include/asm-ia64/sn/sn_fru.h
--- a/include/asm-ia64/sn/sn_fru.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ia64/sn/sn_fru.h	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
diff -Nru a/include/asm-ia64/sn/sn_private.h b/include/asm-ia64/sn/sn_private.h
--- a/include/asm-ia64/sn/sn_private.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ia64/sn/sn_private.h	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
diff -Nru a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h
--- a/include/asm-ia64/sn/sn_sal.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-ia64/sn/sn_sal.h	Tue Feb  3 19:45:43 2004
@@ -16,7 +16,9 @@
 #include <asm/sal.h>
 #include <asm/sn/sn_cpuid.h>
 #include <asm/sn/arch.h>
-
+#include <asm/sn/nodepda.h>
+#include <asm/sn/klconfig.h>
+        
 
 // SGI Specific Calls
 #define  SN_SAL_POD_MODE                           0x02000001
@@ -167,28 +169,23 @@
 ia64_sn_get_klconfig_addr(nasid_t nasid)
 {
 	struct ia64_sal_retval ret_stuff;
-	extern u64 klgraph_addr[];
 	int cnodeid;
 
 	cnodeid = nasid_to_cnodeid(nasid);
-	if (klgraph_addr[cnodeid] == 0) {
-		ret_stuff.status = 0;
-		ret_stuff.v0 = 0;
-		ret_stuff.v1 = 0;
-		ret_stuff.v2 = 0;
-		SAL_CALL(ret_stuff, SN_SAL_GET_KLCONFIG_ADDR, (u64)nasid, 0, 0, 0, 0, 0, 0);
-
-		/*
-	 	* We should panic if a valid cnode nasid does not produce
-	 	* a klconfig address.
-	 	*/
-		if (ret_stuff.status != 0) {
-			panic("ia64_sn_get_klconfig_addr: Returned error %lx\n", ret_stuff.status);
-		}
+	ret_stuff.status = 0;
+	ret_stuff.v0 = 0;
+	ret_stuff.v1 = 0;
+	ret_stuff.v2 = 0;
+	SAL_CALL(ret_stuff, SN_SAL_GET_KLCONFIG_ADDR, (u64)nasid, 0, 0, 0, 0, 0, 0);
 
-		klgraph_addr[cnodeid] = ret_stuff.v0;
+	/*
+	 * We should panic if a valid cnode nasid does not produce
+	 * a klconfig address.
+	 */
+	if (ret_stuff.status != 0) {
+		panic("ia64_sn_get_klconfig_addr: Returned error %lx\n", ret_stuff.status);
 	}
-	return(klgraph_addr[cnodeid]);
+	return(ret_stuff.v0);
 }
 
 /*
@@ -597,8 +594,16 @@
 sn_change_memprotect(u64 paddr, u64 len, u64 perms, u64 *nasid_array)
 {
 	struct ia64_sal_retval ret_stuff;
-	SAL_CALL(ret_stuff, SN_SAL_MEMPROTECT, paddr, len, nasid_array,
+	int cnodeid;
+	unsigned long irq_flags;
+
+	cnodeid = nasid_to_cnodeid(get_node_number(paddr));
+	spin_lock(&NODEPDA(cnodeid)->bist_lock);
+	local_irq_save(irq_flags);
+	SAL_CALL_NOLOCK(ret_stuff, SN_SAL_MEMPROTECT, paddr, len, nasid_array,
 		 perms, 0, 0, 0);
+	local_irq_restore(irq_flags);
+	spin_unlock(&NODEPDA(cnodeid)->bist_lock);
 	return ret_stuff.status;
 }
 #define SN_MEMPROT_ACCESS_CLASS_0		0x14a080
diff -Nru a/include/asm-ia64/sn/sndrv.h b/include/asm-ia64/sn/sndrv.h
--- a/include/asm-ia64/sn/sndrv.h	Tue Feb  3 19:45:28 2004
+++ b/include/asm-ia64/sn/sndrv.h	Tue Feb  3 19:45:28 2004
@@ -1,33 +1,9 @@
 /*
+ * 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) 2002-2003 Silicon Graphics, Inc.  All Rights Reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of version 2 of the GNU General Public License 
- * as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it would be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
- * 
- * Further, this software is distributed without any warranty that it is 
- * free of the rightful claim of any third person regarding infringement 
- * or the like.  Any license provided herein, whether implied or 
- * otherwise, applies only to this software file.  Patent licenses, if 
- * any, provided herein do not apply to combinations of this program with 
- * other software, or any other product whatsoever.
- * 
- * You should have received a copy of the GNU General Public 
- * License along with this program; if not, write the Free Software 
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- * 
- * Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 
- * Mountain View, CA  94043, or:
- * 
- * http://www.sgi.com 
- * 
- * For further information regarding this notice, see: 
- * 
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan
  */
 
 #ifndef _ASM_IA64_SN_SNDRV_H
diff -Nru a/include/asm-ia64/sn/vector.h b/include/asm-ia64/sn/vector.h
--- a/include/asm-ia64/sn/vector.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ia64/sn/vector.h	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * 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.
diff -Nru a/include/asm-ia64/sn/xtalk/xbow.h b/include/asm-ia64/sn/xtalk/xbow.h
--- a/include/asm-ia64/sn/xtalk/xbow.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/sn/xtalk/xbow.h	Tue Feb  3 19:45:17 2004
@@ -1,13 +1,12 @@
-/* $Id$
- *
+/*
  * 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) 1992-1997,2000-2003 Silicon Graphics, Inc. All Rights Reserved.
  */
-#ifndef _ASM_SN_SN_XTALK_XBOW_H
-#define _ASM_SN_SN_XTALK_XBOW_H
+#ifndef _ASM_IA64_SN_XTALK_XBOW_H
+#define _ASM_IA64_SN_XTALK_XBOW_H
 
 /*
  * xbow.h - header file for crossbow chip and xbow section of xbridge
@@ -64,7 +63,6 @@
 
 /* Register set for each xbow link */
 typedef volatile struct xb_linkregs_s {
-#ifdef LITTLE_ENDIAN
 /* 
  * we access these through synergy unswizzled space, so the address
  * gets twiddled (i.e. references to 0x4 actually go to 0x0 and vv.)
@@ -86,24 +84,6 @@
     xbowreg_t               filler6;
     xbowreg_t               link_aux_status;
     xbowreg_t               filler7;
-#else
-    xbowreg_t               filler0;	/* filler for proper alignment */
-    xbowreg_t               link_ibf;
-    xbowreg_t               filler1;
-    xbowreg_t               link_control;
-    xbowreg_t               filler2;
-    xbowreg_t               link_status;
-    xbowreg_t               filler3;
-    xbowreg_t               link_arb_upper;
-    xbowreg_t               filler4;
-    xbowreg_t               link_arb_lower;
-    xbowreg_t               filler5;
-    xbowreg_t               link_status_clr;
-    xbowreg_t               filler6;
-    xbowreg_t               link_reset;
-    xbowreg_t               filler7;
-    xbowreg_t               link_aux_status;
-#endif /* LITTLE_ENDIAN */
 } xb_linkregs_t;
 
 typedef volatile struct xbow_s {
@@ -124,7 +104,6 @@
 #define xb_wid_llp                      xb_widget.w_llp_cfg
 #define xb_wid_stat_clr                 xb_widget.w_tflush
 
-#ifdef LITTLE_ENDIAN
 /* 
  * we access these through synergy unswizzled space, so the address
  * gets twiddled (i.e. references to 0x4 actually go to 0x0 and vv.)
@@ -165,43 +144,6 @@
     xbowreg_t               _pad_0000c8;
     /* end of Xbridge only */
     xbowreg_t               _pad_0000d0[12];
-#else
-    /* xbow-specific widget configuration                  0x000058-0x0000FF */
-    xbowreg_t               _pad_000058;
-    xbowreg_t               xb_wid_arb_reload;  /* 0x00005C */
-    xbowreg_t               _pad_000060;
-    xbowreg_t               xb_perf_ctr_a;      /* 0x000064 */
-    xbowreg_t               _pad_000068;
-    xbowreg_t               xb_perf_ctr_b;      /* 0x00006c */
-    xbowreg_t               _pad_000070;
-    xbowreg_t               xb_nic;     /* 0x000074 */
-
-    /* Xbridge only */
-    xbowreg_t               _pad_000078;
-    xbowreg_t               xb_w0_rst_fnc;      /* 0x00007C */
-    xbowreg_t               _pad_000080;
-    xbowreg_t               xb_l8_rst_fnc;      /* 0x000084 */
-    xbowreg_t               _pad_000088;
-    xbowreg_t               xb_l9_rst_fnc;      /* 0x00008c */
-    xbowreg_t               _pad_000090;
-    xbowreg_t               xb_la_rst_fnc;      /* 0x000094 */
-    xbowreg_t               _pad_000098;
-    xbowreg_t               xb_lb_rst_fnc;      /* 0x00009c */
-    xbowreg_t               _pad_0000a0;
-    xbowreg_t               xb_lc_rst_fnc;      /* 0x0000a4 */
-    xbowreg_t               _pad_0000a8;
-    xbowreg_t               xb_ld_rst_fnc;      /* 0x0000ac */
-    xbowreg_t               _pad_0000b0;
-    xbowreg_t               xb_le_rst_fnc;      /* 0x0000b4 */
-    xbowreg_t               _pad_0000b8;
-    xbowreg_t               xb_lf_rst_fnc;      /* 0x0000bc */
-    xbowreg_t               _pad_0000c0;
-    xbowreg_t               xb_lock;            /* 0x0000c4 */
-    xbowreg_t               _pad_0000c8;
-    xbowreg_t               xb_lock_clr;        /* 0x0000cc */
-    /* end of Xbridge only */
-    xbowreg_t               _pad_0000d0[12];
-#endif /* LITTLE_ENDIAN */
 
     /* Link Specific Registers, port 8..15                 0x000100-0x000300 */
     xb_linkregs_t           xb_link_raw[MAX_XBOW_PORTS];
@@ -430,8 +372,6 @@
 /*
  * Xbow Widget 0 Command error word
  */
-#ifdef LITTLE_ENDIAN
-
 typedef union xbw0_cmdword_u {
     xbowreg_t               cmdword;
     struct {
@@ -450,27 +390,6 @@
     } xbw0_cmdfield;
 } xbw0_cmdword_t;
 
-#else
-
-typedef union xbw0_cmdword_u {
-    xbowreg_t		    cmdword;
-    struct {
-	uint32_t		destid:4,	/* Desination ID number */
-				srcid:4,	/* Source ID number */
-				pactyp:4,	/* Packet type: */
-				tnum:5,		/* Transaction Number */
-				ct:1,	/* Is it a coherent transaction */
-				ds:2,	/* Data size			*/
-				gbr:1,	/* GBR enable ?			*/
-				vbpm:1,		/* Virtual Backplane message */
-				error:1,	/* Error Occured */
-				barr:1,		/* Barrier operation */
-				rsvd:8;		/* Reserved */
-    } xbw0_cmdfield;
-} xbw0_cmdword_t;
-
-#endif
-
 #define	xbcmd_destid	xbw0_cmdfield.destid
 #define	xbcmd_srcid	xbw0_cmdfield.srcid
 #define	xbcmd_pactyp	xbw0_cmdfield.pactyp
@@ -505,7 +424,6 @@
 /*
  * Xbow widget 0 Status register format.
  */
-#ifdef LITTLE_ENDIAN
 
 typedef union xbw0_status_u {
     xbowreg_t               statusword;
@@ -524,28 +442,6 @@
     } xbw0_stfield;
 } xbw0_status_t;
 
-#else
-
-typedef union xbw0_status_u {
-    xbowreg_t		    statusword;
-    struct {
-	uint32_t		linkXintr:8,	/* link(x) error intr */
-				wid0intr:1,	/* Widget 0 err intr */
-				resvd1:13,
-				src_id:4,	/* source id. Xbridge only */
-				regacc_err:1,	/* Reg Access error	*/
-				/* Xbridge only */
-				w0_recv_tout,	/* receive timeout err */
-				w0_arb_tout,	/* arbiter timeout err */
-				/* End of Xbridge only */
-				xtalk_err:1,	/* Xtalk pkt with error bit */
-				connect_tout:1, /* Connection timeout	*/
-				mult_err:1;	/* Multiple error occurred */
-    } xbw0_stfield;
-} xbw0_status_t;
-
-#endif
-
 #define	xbst_linkXintr		xbw0_stfield.linkXintr
 #define	xbst_w0intr		xbw0_stfield.wid0intr
 #define	xbst_regacc_err		xbw0_stfield.regacc_err
@@ -559,7 +455,6 @@
 /*
  * Xbow widget 0 Control register format
  */
-#ifdef LITTLE_ENDIAN
 
 typedef union xbw0_ctrl_u {
     xbowreg_t               ctrlword;
@@ -577,28 +472,6 @@
     } xbw0_ctrlfield;
 } xbw0_ctrl_t;
 
-#else
-
-typedef union xbw0_ctrl_u {
-    xbowreg_t		    ctrlword;
-    struct {
-	uint32_t
-				resvd1:24,
-				enable_watchdog:1,	/* Xbridge only */
-				enable_w0_tout_cntr:1,	/* Xbridge only */
-				accerr_intr:1,
-				w0_recv_tout_intr:1,	/* Xbridge only */
-				w0_arg_tout_intr:1,	/* Xbridge only */
-				xtalkerr_intr:1,
-				conntout_intr:1,
-				resvd3:1;
-    } xbw0_ctrlfield;
-} xbw0_ctrl_t;
-
-#endif
-
-#ifdef LITTLE_ENDIAN
-
 typedef union xbow_linkctrl_u {
     xbowreg_t               xbl_ctrlword;
     struct {
@@ -625,36 +498,6 @@
     } xb_linkcontrol;
 } xbow_linkctrl_t;
 
-#else
-
-typedef union xbow_linkctrl_u {
-    xbowreg_t		    xbl_ctrlword;
-    struct {
-	uint32_t		alive_intr:1, 
-				rsvd1:1, 
-				perf_mode:2,
-				inbuf_level:3, 
-				send_bm8:1, 
-				force_badllp:1,
-				llp_credit:5, 
-				idest_intr:1, 
-				obuf_intr:1,
-				rsvd2:7, 
-				bwalloc_intr:1, 
-				rcvov_intr:1,
-				trxov_intr:1, 
-				trx_max_retry_intr:1,
-				rcv_err_intr:1, 
-				trx_retry_intr:1, 
-				rsvd3:1,
-				maxto_intr:1, 
-				srcto_intr:1;
-    } xb_linkcontrol;
-} xbow_linkctrl_t;
-
-#endif
-
-
 #define	xbctl_accerr_intr	(xbw0_ctrlfield.accerr_intr)
 #define	xbctl_xtalkerr_intr	(xbw0_ctrlfield.xtalkerr_intr)
 #define	xbctl_cnntout_intr	(xbw0_ctrlfield.conntout_intr)
@@ -667,8 +510,6 @@
  * Xbow Link specific Registers structure definitions.
  */
 
-#ifdef LITTLE_ENDIAN
-
 typedef union xbow_linkX_status_u {
     xbowreg_t               linkstatus;
     struct {
@@ -689,30 +530,6 @@
     } xb_linkstatus;
 } xbwX_stat_t;
 
-#else
-
-typedef union xbow_linkX_status_u {
-    xbowreg_t		    linkstatus;
-    struct {
-	uint32_t		alive:1,
-				resvd1:12,
-				merror:1,
-				illdest:1,
-				ioe:1,		/* Input overallocation error */
-				bw_errport:8,	/* BW allocation error port   */
-				llp_rxovflow:1,
-				llp_txovflow:1,
-				llp_maxtxretry:1,
-				llp_rcverror:1,
-				llp_xmitretry:1,
-				pkt_toutdest:1, /* reserved in Xbridge */
-				pkt_toutconn:1, /* max_req_tout in Xbridge */
-				pkt_toutsrc:1;
-    } xb_linkstatus;
-} xbwX_stat_t;
-
-#endif
-
 #define	link_alive		xb_linkstatus.alive
 #define	link_multierror		xb_linkstatus.merror
 #define	link_illegal_dest	xb_linkstatus.illdest
@@ -722,8 +539,6 @@
 #define link_pkt_toutdest	xb_linkstatus.pkt_toutdest
 #define	link_pkt_toutsrc	xb_linkstatus.pkt_toutsrc
 
-#ifdef LITTLE_ENDIAN
-
 typedef union xbow_aux_linkX_status_u {
     xbowreg_t               aux_linkstatus;
     struct {
@@ -738,27 +553,6 @@
     } xb_aux_linkstatus;
 } xbow_aux_link_status_t;
 
-#else
-
-typedef union xbow_aux_linkX_status_u {
-    xbowreg_t		    aux_linkstatus;
-    struct {
-	uint32_t		rx_err_cnt:8,
-				tx_retry_cnt:8,
-				to_src_loc:8,
-				rsvd1:1,
-				fail_mode:1,
-				wid_present:1,
-				bit_mode_8:1,
-				rsvd2:4;
-    } xb_aux_linkstatus;
-} xbow_aux_link_status_t;
-
-#endif
-
-
-#ifdef LITTLE_ENDIAN
-
 typedef union xbow_perf_count_u {
     xbowreg_t               xb_counter_val;
     struct {
@@ -768,19 +562,6 @@
     } xb_perf;
 } xbow_perfcount_t;
 
-#else
-
-typedef union xbow_perf_count_u {
-    xbowreg_t               xb_counter_val;
-    struct {
-	uint32_t              rsvd:9, 
-				link_select:3, 
-				count:20;
-    } xb_perf;
-} xbow_perfcount_t;
-
-#endif
-
 #define XBOW_COUNTER_MASK	0xFFFFF
 
 extern int              xbow_widget_present(xbow_t * xbow, int port);
@@ -908,4 +689,4 @@
 #endif				/* MACROFIELD_LINE */
 
 #endif				/* __ASSEMBLY__ */
-#endif                          /* _ASM_SN_SN_XTALK_XBOW_H */
+#endif                          /* _ASM_IA64_SN_XTALK_XBOW_H */
diff -Nru a/include/asm-ia64/sn/xtalk/xbow_info.h b/include/asm-ia64/sn/xtalk/xbow_info.h
--- a/include/asm-ia64/sn/xtalk/xbow_info.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-ia64/sn/xtalk/xbow_info.h	Tue Feb  3 19:45:30 2004
@@ -1,35 +1,16 @@
-/* $Id$
- *
+/*
  * 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) 1992-1997,2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  */
-#ifndef _ASM_SN_XTALK_XBOW_INFO_H
-#define _ASM_SN_XTALK_XBOW_INFO_H
+#ifndef _ASM_IA64_SN_XTALK_XBOW_INFO_H
+#define _ASM_IA64_SN_XTALK_XBOW_INFO_H
 
 #include <linux/types.h>
 
 #define XBOW_PERF_MODES	       0x03
-#define XBOW_PERF_COUNTERS     0x02
-
-#define XBOW_MONITOR_NONE      0x00
-#define XBOW_MONITOR_SRC_LINK  0x01
-#define XBOW_MONITOR_DEST_LINK 0x02
-#define XBOW_MONITOR_INP_PKT   0x03
-#define XBOW_MONITOR_MULTIPLEX 0x04
-
-#define XBOW_LINK_MULTIPLEX    0x20
-
-#define XBOW_PERF_TIMEOUT	4
-#define XBOW_STATS_TIMEOUT	HZ
-
-typedef struct xbow_perf_link {
-    uint64_t              xlp_cumulative[XBOW_PERF_MODES];
-    unsigned char           xlp_link_alive;
-} xbow_perf_link_t;
-
 
 typedef struct xbow_link_status {
     uint64_t              rx_err_count;
@@ -37,32 +18,4 @@
 } xbow_link_status_t;
 
 
-
-typedef struct xbow_perf {
-    uint32_t              xp_current;
-    unsigned char           xp_link;
-    unsigned char           xp_mode;
-    unsigned char           xp_curlink;
-    unsigned char           xp_curmode;
-    volatile uint32_t    *xp_perf_reg;
-} xbow_perf_t;
-
-extern void             xbow_update_perf_counters(vertex_hdl_t);
-extern xbow_perf_link_t *xbow_get_perf_counters(vertex_hdl_t);
-extern int              xbow_enable_perf_counter(vertex_hdl_t, int, int, int);
-
-#define XBOWIOC_PERF_ENABLE	  	1
-#define XBOWIOC_PERF_DISABLE	 	2
-#define XBOWIOC_PERF_GET	 	3
-#define XBOWIOC_LLP_ERROR_ENABLE 	4
-#define XBOWIOC_LLP_ERROR_DISABLE	5
-#define XBOWIOC_LLP_ERROR_GET	 	6
-
-
-struct xbow_perfarg_t {
-    int                     link;
-    int                     mode;
-    int                     counter;
-};
-
-#endif				/* _ASM_SN_XTALK_XBOW_INFO_H */
+#endif				/* _ASM_IA64_SN_XTALK_XBOW_INFO_H */
diff -Nru a/include/asm-ia64/sn/xtalk/xswitch.h b/include/asm-ia64/sn/xtalk/xswitch.h
--- a/include/asm-ia64/sn/xtalk/xswitch.h	Tue Feb  3 19:45:41 2004
+++ b/include/asm-ia64/sn/xtalk/xswitch.h	Tue Feb  3 19:45:41 2004
@@ -1,13 +1,12 @@
-/* $Id$
- *
+/*
  * 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) 1992-1997,2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  */
-#ifndef _ASM_SN_XTALK_XSWITCH_H
-#define _ASM_SN_XTALK_XSWITCH_H
+#ifndef _ASM_IA64_SN_XTALK_XSWITCH_H
+#define _ASM_IA64_SN_XTALK_XSWITCH_H
 
 /*
  * xswitch.h - controls the format of the data
@@ -54,4 +53,4 @@
 
 #endif				/* __ASSEMBLY__ */
 
-#endif				/* _ASM_SN_XTALK_XSWITCH_H */
+#endif				/* _ASM_IA64_SN_XTALK_XSWITCH_H */
diff -Nru a/include/asm-ia64/sn/xtalk/xtalk.h b/include/asm-ia64/sn/xtalk/xtalk.h
--- a/include/asm-ia64/sn/xtalk/xtalk.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-ia64/sn/xtalk/xtalk.h	Tue Feb  3 19:45:30 2004
@@ -1,16 +1,17 @@
-/* $Id$
- *
+/*
  * 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) 1992-1997, 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  */
-#ifndef _ASM_SN_XTALK_XTALK_H
-#define _ASM_SN_XTALK_XTALK_H
+#ifndef _ASM_IA64_SN_XTALK_XTALK_H
+#define _ASM_IA64_SN_XTALK_XTALK_H
 #include <linux/config.h>
 
+#ifdef __KERNEL__
 #include "asm/sn/sgi.h"
+#endif
 
 
 /*
@@ -19,7 +20,7 @@
 /*
  * User-level device driver visible types
  */
-typedef int            xwidgetnum_t;	/* xtalk widget number  (0..15) */
+typedef char            xwidgetnum_t;	/* xtalk widget number  (0..15) */
 
 #define XWIDGET_NONE		(-1)
 
@@ -233,16 +234,8 @@
 typedef void
 xtalk_widgetdev_shutdown_f (vertex_hdl_t, int);
 
-typedef int
-xtalk_dma_enabled_f (vertex_hdl_t);
-
 /* Error Management */
 
-typedef int
-xtalk_error_devenable_f (vertex_hdl_t xconn_vhdl,
-			 int devnum,
-			 int error_code);
-
 /* Early Action Support */
 typedef caddr_t
 xtalk_early_piotrans_addr_f (xwidget_part_num_t part_num,
@@ -285,9 +278,6 @@
     /* CONFIGURATION MANAGEMENT */
     xtalk_provider_startup_f *provider_startup;
     xtalk_provider_shutdown_f *provider_shutdown;
-
-    /* Error Management     */
-    xtalk_error_devenable_f *error_devenable;
 } xtalk_provider_t;
 
 /* Crosstalk devices use these standard Crosstalk provider interfaces */
@@ -316,8 +306,6 @@
 extern xtalk_provider_shutdown_f xtalk_provider_shutdown;
 extern xtalk_widgetdev_enable_f xtalk_widgetdev_enable;
 extern xtalk_widgetdev_shutdown_f xtalk_widgetdev_shutdown;
-extern xtalk_dma_enabled_f xtalk_dma_enabled;
-extern xtalk_error_devenable_f xtalk_error_devenable;
 extern xtalk_early_piotrans_addr_f xtalk_early_piotrans_addr;
 
 /* error management */
@@ -397,4 +385,4 @@
 extern void		xtalk_iterate(char *prefix, xtalk_iter_f *func);
 
 #endif				/* __KERNEL__ */
-#endif				/* _ASM_SN_XTALK_XTALK_H */
+#endif				/* _ASM_IA64_SN_XTALK_XTALK_H */
diff -Nru a/include/asm-ia64/sn/xtalk/xtalk_private.h b/include/asm-ia64/sn/xtalk/xtalk_private.h
--- a/include/asm-ia64/sn/xtalk/xtalk_private.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-ia64/sn/xtalk/xtalk_private.h	Tue Feb  3 19:45:34 2004
@@ -1,13 +1,12 @@
-/* $Id$
- *
+/*
  * 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) 1992-1997, 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  */
-#ifndef _ASM_SN_XTALK_XTALK_PRIVATE_H
-#define _ASM_SN_XTALK_XTALK_PRIVATE_H
+#ifndef _ASM_IA64_SN_XTALK_XTALK_PRIVATE_H
+#define _ASM_IA64_SN_XTALK_XTALK_PRIVATE_H
 
 #include <asm/sn/ioerror.h>        /* for error function and arg types */
 #include <asm/sn/xtalk/xwidget.h>
@@ -52,12 +51,6 @@
 /*
  * Xtalk interrupt handler structure access functions
  */
-#define	xtalk_intr_arg(xt)	((xt)->xi_sfarg)
-
-#define	xwidget_hwid_is_sn0_xswitch(_hwid)	\
-		(((_hwid)->part_num == XBOW_WIDGET_PART_NUM ) &&  	\
-		 ((_hwid)->mfg_num == XBOW_WIDGET_MFGR_NUM ))
-
 #define	xwidget_hwid_is_sn1_xswitch(_hwid)	\
 		(((_hwid)->part_num == XXBOW_WIDGET_PART_NUM ||		\
 		  (_hwid)->part_num == PXBOW_WIDGET_PART_NUM) &&  	\
@@ -83,4 +76,4 @@
 
 extern char             widget_info_fingerprint[];
 
-#endif				/* _ASM_SN_XTALK_XTALK_PRIVATE_H */
+#endif				/* _ASM_IA64_SN_XTALK_XTALK_PRIVATE_H */
diff -Nru a/include/asm-ia64/sn/xtalk/xtalkaddrs.h b/include/asm-ia64/sn/xtalk/xtalkaddrs.h
--- a/include/asm-ia64/sn/xtalk/xtalkaddrs.h	Tue Feb  3 19:45:35 2004
+++ b/include/asm-ia64/sn/xtalk/xtalkaddrs.h	Tue Feb  3 19:45:35 2004
@@ -1,13 +1,12 @@
-/* $Id$
- *
+/*
  * 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) 1992-1997,2000-2003 Silicon Graphics, Inc. All Rights Reserved.
  */
-#ifndef _ASM_SN_XTALK_XTALKADDRS_H
-#define _ASM_SN_XTALK_XTALKADDRS_H
+#ifndef _ASM_IA64_SN_XTALK_XTALKADDRS_H
+#define _ASM_IA64_SN_XTALK_XTALKADDRS_H
 
 
 /*
@@ -104,4 +103,4 @@
         (widgetreg_t)(*(volatile uint32_t *)(NODE_SWIN_BASE(nasid, widget) + WIDGET_ID))
 
 
-#endif /* _ASM_SN_XTALK_XTALKADDRS_H */
+#endif /* _ASM_IA64_SN_XTALK_XTALKADDRS_H */
diff -Nru a/include/asm-ia64/sn/xtalk/xwidget.h b/include/asm-ia64/sn/xtalk/xwidget.h
--- a/include/asm-ia64/sn/xtalk/xwidget.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ia64/sn/xtalk/xwidget.h	Tue Feb  3 19:45:16 2004
@@ -1,24 +1,26 @@
-/* $Id$
- *
+/*
  * 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) 1992-1997,2000-2003 Silicon Graphics, Inc. All Rights Reserved.
  */
-#ifndef __ASM_SN_XTALK_XWIDGET_H__
-#define __ASM_SN_XTALK_XWIDGET_H__
+#ifndef _ASM_IA64_SN_XTALK_XWIDGET_H
+#define _ASM_IA64_SN_XTALK_XWIDGET_H
 
 /*
  * xwidget.h - generic crosstalk widget header file
  */
 
+#ifdef __KERNEL__
 #include <asm/sn/xtalk/xtalk.h>
 #ifndef __ASSEMBLY__
 #include <asm/sn/cdl.h>
 #endif /* __ASSEMBLY__ */
+#else
+#include <xtalk/xtalk.h>
+#endif
 
-#ifdef LITTLE_ENDIAN
 #define WIDGET_ID			0x00
 #define WIDGET_STATUS			0x08
 #define WIDGET_ERR_UPPER_ADDR		0x10
@@ -30,19 +32,6 @@
 #define WIDGET_ERR_CMD_WORD		0x40
 #define WIDGET_LLP_CFG			0x48
 #define WIDGET_TFLUSH			0x50
-#else	/* !LITTLE_ENDIAN */
-#define WIDGET_ID                       0x04
-#define WIDGET_STATUS                   0x0c
-#define WIDGET_ERR_UPPER_ADDR           0x14
-#define WIDGET_ERR_LOWER_ADDR           0x1c
-#define WIDGET_CONTROL                  0x24
-#define WIDGET_REQ_TIMEOUT              0x2c
-#define WIDGET_INTDEST_UPPER_ADDR       0x34
-#define WIDGET_INTDEST_LOWER_ADDR       0x3c
-#define WIDGET_ERR_CMD_WORD             0x44
-#define WIDGET_LLP_CFG                  0x4c
-#define WIDGET_TFLUSH                   0x54
-#endif
 
 /* WIDGET_ID */
 #define WIDGET_REV_NUM			0xf0000000
@@ -120,7 +109,6 @@
 
 /* widget configuration registers */
 typedef volatile struct widget_cfg {
-#ifdef LITTLE_ENDIAN
 /*
  * we access these through synergy unswizzled space, so the address
  * gets twiddled (i.e. references to 0x4 actually go to 0x0 and vv.)
@@ -148,33 +136,8 @@
     widgetreg_t		    w_pad_9;	/* 0x48 */
     widgetreg_t		    w_tflush;	/* 0x54 */
     widgetreg_t		    w_pad_10;	/* 0x50 */
-#else
-    widgetreg_t		    w_pad_0;	/* 0x00 */
-    widgetreg_t		    w_id;	/* 0x04 */
-    widgetreg_t		    w_pad_1;	/* 0x08 */
-    widgetreg_t		    w_status;	/* 0x0c */
-    widgetreg_t		    w_pad_2;	/* 0x10 */
-    widgetreg_t		    w_err_upper_addr;	/* 0x14 */
-    widgetreg_t		    w_pad_3;	/* 0x18 */
-    widgetreg_t		    w_err_lower_addr;	/* 0x1c */
-    widgetreg_t		    w_pad_4;	/* 0x20 */
-    widgetreg_t		    w_control;	/* 0x24 */
-    widgetreg_t		    w_pad_5;	/* 0x28 */
-    widgetreg_t		    w_req_timeout;	/* 0x2c */
-    widgetreg_t		    w_pad_6;	/* 0x30 */
-    widgetreg_t		    w_intdest_upper_addr;	/* 0x34 */
-    widgetreg_t		    w_pad_7;	/* 0x38 */
-    widgetreg_t		    w_intdest_lower_addr;	/* 0x3c */
-    widgetreg_t		    w_pad_8;	/* 0x40 */
-    widgetreg_t		    w_err_cmd_word;	/* 0x44 */
-    widgetreg_t		    w_pad_9;	/* 0x48 */
-    widgetreg_t		    w_llp_cfg;	/* 0x4c */
-    widgetreg_t		    w_pad_10;	/* 0x50 */
-    widgetreg_t		    w_tflush;	/* 0x54 */
-#endif /* LITTLE_ENDIAN */
 } widget_cfg_t;
 
-#ifdef LITTLE_ENDIAN
 typedef struct {
     unsigned                other:8;
     unsigned                bo:1;
@@ -188,33 +151,11 @@
     unsigned                sidn:4;
     unsigned                didn:4;
 } w_err_cmd_word_f;
-#else
-typedef struct {
-    unsigned                didn:4;
-    unsigned                sidn:4;
-    unsigned                pactyp:4;
-    unsigned                tnum:5;
-    unsigned                ct:1;
-    unsigned                ds:2;
-    unsigned                gbr:1;
-    unsigned                vbpm:1;
-    unsigned                error:1;
-    unsigned                bo:1;
-    unsigned                other:8;
-} w_err_cmd_word_f;
-#endif
 
-#ifdef LITTLE_ENDIAN
 typedef union {
     w_err_cmd_word_f        f;
     widgetreg_t             r;
 } w_err_cmd_word_u;
-#else
-typedef union {
-    widgetreg_t             r;
-    w_err_cmd_word_f        f;
-} w_err_cmd_word_u;
-#endif
 
 /* IO widget initialization function */
 typedef struct xwidget_info_s *xwidget_info_t;
@@ -222,19 +163,11 @@
 /*
  * Crosstalk Widget Hardware Identification, as defined in the Crosstalk spec.
  */
-#ifdef LITTLE_ENDIAN
 typedef struct xwidget_hwid_s {
     xwidget_mfg_num_t       mfg_num;
     xwidget_rev_num_t       rev_num;
     xwidget_part_num_t      part_num;
 }                      *xwidget_hwid_t;
-#else
-typedef struct xwidget_hwid_s {
-    xwidget_part_num_t      part_num;
-    xwidget_rev_num_t       rev_num;
-    xwidget_mfg_num_t       mfg_num;
-}                      *xwidget_hwid_t;
-#endif
 
 
 /*
@@ -304,4 +237,4 @@
 
 #endif				/* __ASSEMBLY__ */
 
-#endif				/* __ASM_SN_XTALK_XWIDGET_H__ */
+#endif				/* _ASM_IA64_SN_XTALK_XWIDGET_H */
diff -Nru a/include/asm-ia64/socket.h b/include/asm-ia64/socket.h
--- a/include/asm-ia64/socket.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ia64/socket.h	Tue Feb  3 19:45:16 2004
@@ -2,10 +2,12 @@
 #define _ASM_IA64_SOCKET_H
 
 /*
- * Socket related defines.  This mostly mirrors the Linux/x86 version.
+ * Socket related defines.
  *
- * Copyright (C) 1998-2000 Hewlett-Packard Co
- * Copyright (C) 1998-2000 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Based on <asm-i386/socket.h>.
+ *
+ * Modified 1998-2000
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
 #include <asm/sockios.h>
@@ -51,6 +53,8 @@
 #define SCM_TIMESTAMP		SO_TIMESTAMP
 
 #define SO_ACCEPTCONN		30
+
+#define SO_PEERSEC             31
 
 /* Nast libc5 fixup - bletch */
 #if defined(__KERNEL__)
diff -Nru a/include/asm-ia64/sockios.h b/include/asm-ia64/sockios.h
--- a/include/asm-ia64/sockios.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-ia64/sockios.h	Tue Feb  3 19:45:30 2004
@@ -2,11 +2,12 @@
 #define _ASM_IA64_SOCKIOS_H
 
 /*
- * Socket-level I/O control calls.  This mostly mirrors the Linux/x86
- * version.
+ * Socket-level I/O control calls.
  *
- * Copyright (C) 1998, 1999 Hewlett-Packard Co
- * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Based on <asm-i386/sockios.h>.
+ *
+ * Modified 1998, 1999
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 #define FIOSETOWN 	0x8901
 #define SIOCSPGRP	0x8902
diff -Nru a/include/asm-ia64/stat.h b/include/asm-ia64/stat.h
--- a/include/asm-ia64/stat.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/stat.h	Tue Feb  3 19:45:17 2004
@@ -2,8 +2,8 @@
 #define _ASM_IA64_STAT_H
 
 /*
- * Copyright (C) 1998, 1999 Hewlett-Packard Co
- * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Modified 1998, 1999
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
 struct stat {
diff -Nru a/include/asm-ia64/statfs.h b/include/asm-ia64/statfs.h
--- a/include/asm-ia64/statfs.h	Tue Feb  3 19:45:28 2004
+++ b/include/asm-ia64/statfs.h	Tue Feb  3 19:45:28 2004
@@ -2,8 +2,10 @@
 #define _ASM_IA64_STATFS_H
 
 /*
- * Copyright (C) 1998, 1999, 2003 Hewlett-Packard Co
- *	David Mosberger-Tang <davidm@hpl.hp.com>
+ * Based on <asm-i386/statfs.h>.
+ *
+ * Modified 1998, 1999, 2003
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
 #ifndef __KERNEL_STRICT_NAMES
diff -Nru a/include/asm-ia64/termbits.h b/include/asm-ia64/termbits.h
--- a/include/asm-ia64/termbits.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-ia64/termbits.h	Tue Feb  3 19:45:30 2004
@@ -2,8 +2,10 @@
 #define _ASM_IA64_TERMBITS_H
 
 /*
- * Copyright (C) 1999 Hewlett-Packard Co
- * Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Based on <asm-i386/termbits.h>.
+ *
+ * Modified 1999
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  *
  * 99/01/28	Added new baudrates
  */
diff -Nru a/include/asm-ia64/termios.h b/include/asm-ia64/termios.h
--- a/include/asm-ia64/termios.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-ia64/termios.h	Tue Feb  3 19:45:30 2004
@@ -2,8 +2,8 @@
 #define _ASM_IA64_TERMIOS_H
 
 /*
- * Copyright (C) 1999 Hewlett-Packard Co
- * Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Modified 1999
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  *
  * 99/01/28	Added N_IRDA and N_SMSBLOCK
  */
diff -Nru a/include/asm-ia64/tlb.h b/include/asm-ia64/tlb.h
--- a/include/asm-ia64/tlb.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/tlb.h	Tue Feb  3 19:45:17 2004
@@ -1,10 +1,10 @@
 #ifndef _ASM_IA64_TLB_H
 #define _ASM_IA64_TLB_H
 /*
+ * Based on <asm-generic/tlb.h>.
+ *
  * Copyright (C) 2002-2003 Hewlett-Packard Co
  *	David Mosberger-Tang <davidm@hpl.hp.com>
- *
- * This file was derived from asm-generic/tlb.h.
  */
 /*
  * Removing a translation from a page table (including TLB-shootdown) is a four-step
diff -Nru a/include/asm-ia64/types.h b/include/asm-ia64/types.h
--- a/include/asm-ia64/types.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/types.h	Tue Feb  3 19:45:17 2004
@@ -7,8 +7,10 @@
  * space pollution is not a major issue.  However, for interoperability, libraries still
  * need to be careful to avoid a name clashes.
  *
- * Copyright (C) 1998-2000, 2002 Hewlett-Packard Co
- *	David Mosberger-Tang <davidm@hpl.hp.com>
+ * Based on <asm-alpha/types.h>.
+ *
+ * Modified 1998-2000, 2002
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
 #ifdef __ASSEMBLY__
diff -Nru a/include/asm-ia64/uaccess.h b/include/asm-ia64/uaccess.h
--- a/include/asm-ia64/uaccess.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ia64/uaccess.h	Tue Feb  3 19:45:17 2004
@@ -26,7 +26,9 @@
  * associated and, if so, sets r8 to -EFAULT and clears r9 to 0 and
  * then resumes execution at the continuation point.
  *
- * Copyright (C) 1998, 1999, 2001-2003 Hewlett-Packard Co
+ * Based on <asm-alpha/uaccess.h>.
+ *
+ * Copyright (C) 1998, 1999, 2001-2004 Hewlett-Packard Co
  *	David Mosberger-Tang <davidm@hpl.hp.com>
  */
 
@@ -281,21 +283,23 @@
 	__su_ret;						\
 })
 
+/* Generic code can't deal with the location-relative format that we use for compactness.  */
+#define ARCH_HAS_SORT_EXTABLE
+#define ARCH_HAS_SEARCH_EXTABLE
+
 struct exception_table_entry {
-	int addr;	/* gp-relative address of insn this fixup is for */
-	int cont;	/* gp-relative continuation address; if bit 2 is set, r9 is set to 0 */
+	int addr;	/* location-relative address of insn this fixup is for */
+	int cont;	/* location-relative continuation addr.; if bit 2 is set, r9 is set to 0 */
 };
 
 extern void handle_exception (struct pt_regs *regs, const struct exception_table_entry *e);
 extern const struct exception_table_entry *search_exception_tables (unsigned long addr);
 
-# define SEARCH_EXCEPTION_TABLE(regs) search_exception_tables(regs->cr_iip + ia64_psr(regs)->ri)
-
 static inline int
 done_with_exception (struct pt_regs *regs)
 {
 	const struct exception_table_entry *e;
-	e = SEARCH_EXCEPTION_TABLE(regs);
+	e = search_exception_tables(regs->cr_iip + ia64_psr(regs)->ri);
 	if (e) {
 		handle_exception(regs, e);
 		return 1;
diff -Nru a/include/asm-ia64/unaligned.h b/include/asm-ia64/unaligned.h
--- a/include/asm-ia64/unaligned.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ia64/unaligned.h	Tue Feb  3 19:45:42 2004
@@ -4,8 +4,9 @@
 #include <linux/types.h>
 
 /*
- * The main single-value unaligned transfer routines.  Derived from
- * the Linux/Alpha version.
+ * The main single-value unaligned transfer routines.
+ *
+ * Based on <asm-alpha/unaligned.h>.
  *
  * Copyright (C) 1998, 1999, 2003 Hewlett-Packard Co
  *	David Mosberger-Tang <davidm@hpl.hp.com>
diff -Nru a/include/asm-ia64/user.h b/include/asm-ia64/user.h
--- a/include/asm-ia64/user.h	Tue Feb  3 19:45:35 2004
+++ b/include/asm-ia64/user.h	Tue Feb  3 19:45:35 2004
@@ -24,8 +24,8 @@
  *	current->start_stack, so we round each of these in order to be able
  *	to write an integer number of pages.
  *
- * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co
- * Copyright (C) 1998, 1999, 2001 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Modified 1998, 1999, 2001
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
 #include <linux/ptrace.h>
diff -Nru a/include/asm-m68k/atariints.h b/include/asm-m68k/atariints.h
--- a/include/asm-m68k/atariints.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-m68k/atariints.h	Tue Feb  3 19:45:42 2004
@@ -180,14 +180,14 @@
  * "stored"
  */
 
-extern inline void atari_turnon_irq( unsigned irq )
+static inline void atari_turnon_irq( unsigned irq )
 
 {
 	if (irq < STMFP_SOURCE_BASE || irq >= SCC_SOURCE_BASE) return;
 	set_mfp_bit( irq, MFP_ENABLE );
 }
 
-extern inline void atari_turnoff_irq( unsigned irq )
+static inline void atari_turnoff_irq( unsigned irq )
 
 {
 	if (irq < STMFP_SOURCE_BASE || irq >= SCC_SOURCE_BASE) return;
@@ -195,14 +195,14 @@
 	clear_mfp_bit( irq, MFP_PENDING );
 }
 
-extern inline void atari_clear_pending_irq( unsigned irq )
+static inline void atari_clear_pending_irq( unsigned irq )
 
 {
 	if (irq < STMFP_SOURCE_BASE || irq >= SCC_SOURCE_BASE) return;
 	clear_mfp_bit( irq, MFP_PENDING );
 }
 
-extern inline int atari_irq_pending( unsigned irq )
+static inline int atari_irq_pending( unsigned irq )
 
 {
 	if (irq < STMFP_SOURCE_BASE || irq >= SCC_SOURCE_BASE) return( 0 );
diff -Nru a/include/asm-m68k/bitops.h b/include/asm-m68k/bitops.h
--- a/include/asm-m68k/bitops.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-m68k/bitops.h	Tue Feb  3 19:45:43 2004
@@ -21,7 +21,8 @@
    __constant_test_and_set_bit(nr, vaddr) : \
    __generic_test_and_set_bit(nr, vaddr))
 
-extern __inline__ int __constant_test_and_set_bit(int nr,volatile unsigned long * vaddr)
+static inline int __constant_test_and_set_bit(int nr,
+					      volatile unsigned long *vaddr)
 {
 	char retval;
 
@@ -32,7 +33,8 @@
 	return retval;
 }
 
-extern __inline__ int __generic_test_and_set_bit(int nr,volatile unsigned long * vaddr)
+static inline int __generic_test_and_set_bit(int nr,
+					     volatile unsigned long *vaddr)
 {
 	char retval;
 
@@ -49,13 +51,13 @@
 
 #define __set_bit(nr,vaddr) set_bit(nr,vaddr) 
 
-extern __inline__ void __constant_set_bit(int nr, volatile unsigned long * vaddr)
+static inline void __constant_set_bit(int nr, volatile unsigned long *vaddr)
 {
 	__asm__ __volatile__ ("bset %1,%0"
 	     : "+m" (((volatile char *)vaddr)[(nr^31) >> 3]) : "di" (nr & 7));
 }
 
-extern __inline__ void __generic_set_bit(int nr, volatile unsigned long * vaddr)
+static inline void __generic_set_bit(int nr, volatile unsigned long *vaddr)
 {
 	__asm__ __volatile__ ("bfset %1@{%0:#1}"
 	     : : "d" (nr^31), "a" (vaddr) : "memory");
@@ -68,7 +70,8 @@
 
 #define __test_and_clear_bit(nr,vaddr) test_and_clear_bit(nr,vaddr)
 
-extern __inline__ int __constant_test_and_clear_bit(int nr, volatile unsigned long * vaddr)
+static inline int __constant_test_and_clear_bit(int nr,
+						volatile unsigned long *vaddr)
 {
 	char retval;
 
@@ -79,7 +82,8 @@
 	return retval;
 }
 
-extern __inline__ int __generic_test_and_clear_bit(int nr, volatile unsigned long * vaddr)
+static inline int __generic_test_and_clear_bit(int nr,
+					       volatile unsigned long *vaddr)
 {
 	char retval;
 
@@ -101,13 +105,13 @@
    __generic_clear_bit(nr, vaddr))
 #define __clear_bit(nr,vaddr) clear_bit(nr,vaddr)
 
-extern __inline__ void __constant_clear_bit(int nr, volatile unsigned long * vaddr)
+static inline void __constant_clear_bit(int nr, volatile unsigned long *vaddr)
 {
 	__asm__ __volatile__ ("bclr %1,%0"
 	     : "+m" (((volatile char *)vaddr)[(nr^31) >> 3]) : "di" (nr & 7));
 }
 
-extern __inline__ void __generic_clear_bit(int nr, volatile unsigned long * vaddr)
+static inline void __generic_clear_bit(int nr, volatile unsigned long *vaddr)
 {
 	__asm__ __volatile__ ("bfclr %1@{%0:#1}"
 	     : : "d" (nr^31), "a" (vaddr) : "memory");
@@ -121,7 +125,8 @@
 #define __test_and_change_bit(nr,vaddr) test_and_change_bit(nr,vaddr)
 #define __change_bit(nr,vaddr) change_bit(nr,vaddr)
 
-extern __inline__ int __constant_test_and_change_bit(int nr, volatile unsigned long * vaddr)
+static inline int __constant_test_and_change_bit(int nr,
+						 volatile unsigned long *vaddr)
 {
 	char retval;
 
@@ -132,7 +137,8 @@
 	return retval;
 }
 
-extern __inline__ int __generic_test_and_change_bit(int nr, volatile unsigned long * vaddr)
+static inline int __generic_test_and_change_bit(int nr,
+						volatile unsigned long *vaddr)
 {
 	char retval;
 
@@ -147,25 +153,25 @@
    __constant_change_bit(nr, vaddr) : \
    __generic_change_bit(nr, vaddr))
 
-extern __inline__ void __constant_change_bit(int nr, volatile unsigned long * vaddr)
+static inline void __constant_change_bit(int nr, volatile unsigned long *vaddr)
 {
 	__asm__ __volatile__ ("bchg %1,%0"
 	     : "+m" (((volatile char *)vaddr)[(nr^31) >> 3]) : "di" (nr & 7));
 }
 
-extern __inline__ void __generic_change_bit(int nr, volatile unsigned long * vaddr)
+static inline void __generic_change_bit(int nr, volatile unsigned long *vaddr)
 {
 	__asm__ __volatile__ ("bfchg %1@{%0:#1}"
 	     : : "d" (nr^31), "a" (vaddr) : "memory");
 }
 
-extern __inline__ int test_bit(int nr, const volatile unsigned long * vaddr)
+static inline int test_bit(int nr, const volatile unsigned long *vaddr)
 {
 	return ((1UL << (nr & 31)) & (((const volatile unsigned long *) vaddr)[nr >> 5])) != 0;
 }
 
-extern __inline__ int find_first_zero_bit(const unsigned long *vaddr,
-					  unsigned size)
+static inline int find_first_zero_bit(const unsigned long *vaddr,
+				      unsigned size)
 {
 	const unsigned long *p = vaddr, *addr = vaddr;
 	unsigned long allones = ~0UL;
@@ -188,8 +194,8 @@
 	return ((p - addr) << 5) + (res ^ 31);
 }
 
-extern __inline__ int find_next_zero_bit (const unsigned long *vaddr, int size,
-				      int offset)
+static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
+				     int offset)
 {
 	const unsigned long *addr = vaddr;
 	const unsigned long *p = addr + (offset >> 5);
@@ -218,7 +224,7 @@
  * ffz = Find First Zero in word. Undefined if no zero exists,
  * so code should check against ~0UL first..
  */
-extern __inline__ unsigned long ffz(unsigned long word)
+static inline unsigned long ffz(unsigned long word)
 {
 	int res;
 
@@ -289,8 +295,7 @@
 
 /* Bitmap functions for the minix filesystem */
 
-extern __inline__ int
-minix_find_first_zero_bit (const void *vaddr, unsigned size)
+static inline int minix_find_first_zero_bit(const void *vaddr, unsigned size)
 {
 	const unsigned short *p = vaddr, *addr = vaddr;
 	int res;
@@ -312,8 +317,7 @@
 	return ((p - addr) << 4) + (res ^ 31);
 }
 
-extern __inline__ int
-minix_test_and_set_bit (int nr, volatile void *vaddr)
+static inline int minix_test_and_set_bit(int nr, volatile void *vaddr)
 {
 	char retval;
 
@@ -325,8 +329,7 @@
 
 #define minix_set_bit(nr,addr)	((void)minix_test_and_set_bit(nr,addr))
 
-extern __inline__ int
-minix_test_and_clear_bit (int nr, volatile void *vaddr)
+static inline int minix_test_and_clear_bit(int nr, volatile void *vaddr)
 {
 	char retval;
 
@@ -336,16 +339,14 @@
 	return retval;
 }
 
-extern __inline__ int
-minix_test_bit (int nr, const volatile void *vaddr)
+static inline int minix_test_bit(int nr, const volatile void *vaddr)
 {
 	return ((1U << (nr & 15)) & (((const volatile unsigned short *) vaddr)[nr >> 4])) != 0;
 }
 
 /* Bitmap functions for the ext2 filesystem. */
 
-extern __inline__ int
-ext2_set_bit (int nr, volatile void *vaddr)
+static inline int ext2_set_bit(int nr, volatile void *vaddr)
 {
 	char retval;
 
@@ -355,8 +356,7 @@
 	return retval;
 }
 
-extern __inline__ int
-ext2_clear_bit (int nr, volatile void *vaddr)
+static inline int ext2_clear_bit(int nr, volatile void *vaddr)
 {
 	char retval;
 
@@ -384,14 +384,12 @@
 		ret;					\
 	})
 
-extern __inline__ int
-ext2_test_bit (int nr, const volatile void *vaddr)
+static inline int ext2_test_bit(int nr, const volatile void *vaddr)
 {
 	return ((1U << (nr & 7)) & (((const volatile unsigned char *) vaddr)[nr >> 3])) != 0;
 }
 
-extern __inline__ int
-ext2_find_first_zero_bit (const void *vaddr, unsigned size)
+static inline int ext2_find_first_zero_bit(const void *vaddr, unsigned size)
 {
 	const unsigned long *p = vaddr, *addr = vaddr;
 	int res;
@@ -413,8 +411,8 @@
 	return (p - addr) * 32 + res;
 }
 
-extern __inline__ int
-ext2_find_next_zero_bit (const void *vaddr, unsigned size, unsigned offset)
+static inline int ext2_find_next_zero_bit(const void *vaddr, unsigned size,
+					  unsigned offset)
 {
 	const unsigned long *addr = vaddr;
 	const unsigned long *p = addr + (offset >> 5);
diff -Nru a/include/asm-m68k/byteorder.h b/include/asm-m68k/byteorder.h
--- a/include/asm-m68k/byteorder.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-m68k/byteorder.h	Tue Feb  3 19:45:17 2004
@@ -2,10 +2,11 @@
 #define _M68K_BYTEORDER_H
 
 #include <asm/types.h>
+#include <linux/compiler.h>
 
 #ifdef __GNUC__
 
-static __inline__ __const__ __u32 ___arch__swab32(__u32 val)
+static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 val)
 {
 	__asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val));
 	return val;
diff -Nru a/include/asm-m68k/cacheflush.h b/include/asm-m68k/cacheflush.h
--- a/include/asm-m68k/cacheflush.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-m68k/cacheflush.h	Tue Feb  3 19:45:30 2004
@@ -83,7 +83,7 @@
 #define flush_cache_vmap(start, end)		flush_cache_all()
 #define flush_cache_vunmap(start, end)		flush_cache_all()
 
-extern inline void flush_cache_mm(struct mm_struct *mm)
+static inline void flush_cache_mm(struct mm_struct *mm)
 {
 	if (mm == current->mm)
 		__flush_cache_030();
@@ -91,7 +91,7 @@
 
 /* flush_cache_range/flush_cache_page must be macros to avoid
    a dependency on linux/mm.h, which includes this file... */
-extern inline void flush_cache_range(struct vm_area_struct *vma,
+static inline void flush_cache_range(struct vm_area_struct *vma,
 				     unsigned long start,
 				     unsigned long end)
 {
@@ -99,7 +99,7 @@
 	        __flush_cache_030();
 }
 
-extern inline void flush_cache_page(struct vm_area_struct *vma,
+static inline void flush_cache_page(struct vm_area_struct *vma,
 				    unsigned long vmaddr)
 {
  	if (vma->vm_mm == current->mm)
@@ -109,7 +109,7 @@
 
 /* Push the page at kernel virtual address and clear the icache */
 /* RZ: use cpush %bc instead of cpush %dc, cinv %ic */
-extern inline void __flush_page_to_ram(void *vaddr)
+static inline void __flush_page_to_ram(void *vaddr)
 {
 	if (CPU_IS_040_OR_060) {
 		__asm__ __volatile__("nop\n\t"
diff -Nru a/include/asm-m68k/delay.h b/include/asm-m68k/delay.h
--- a/include/asm-m68k/delay.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-m68k/delay.h	Tue Feb  3 19:45:42 2004
@@ -9,7 +9,7 @@
  * Delay routines, using a pre-computed "loops_per_jiffy" value.
  */
 
-extern __inline__ void __delay(unsigned long loops)
+static inline void __delay(unsigned long loops)
 {
 	__asm__ __volatile__ ("1: subql #1,%0; jcc 1b"
 		: "=d" (loops) : "0" (loops));
@@ -43,7 +43,8 @@
 	((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 4295)) : \
 	__udelay(n))
 
-extern __inline__ unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
+static inline unsigned long muldiv(unsigned long a, unsigned long b,
+				   unsigned long c)
 {
 	unsigned long tmp;
 
diff -Nru a/include/asm-m68k/dvma.h b/include/asm-m68k/dvma.h
--- a/include/asm-m68k/dvma.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-m68k/dvma.h	Tue Feb  3 19:45:30 2004
@@ -58,7 +58,8 @@
 #define dvma_vtob(x) dvma_vtop(x)
 #define dvma_btov(x) dvma_ptov(x)
 
-extern inline int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len)
+static inline int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr,
+			       int len)
 {
 	return 0;
 }
diff -Nru a/include/asm-m68k/io.h b/include/asm-m68k/io.h
--- a/include/asm-m68k/io.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-m68k/io.h	Tue Feb  3 19:45:30 2004
@@ -285,20 +285,20 @@
 #endif /* CONFIG_PCI */
 
 
-extern inline void *ioremap(unsigned long physaddr, unsigned long size)
+static inline void *ioremap(unsigned long physaddr, unsigned long size)
 {
 	return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
 }
-extern inline void *ioremap_nocache(unsigned long physaddr, unsigned long size)
+static inline void *ioremap_nocache(unsigned long physaddr, unsigned long size)
 {
 	return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
 }
-extern inline void *ioremap_writethrough(unsigned long physaddr,
+static inline void *ioremap_writethrough(unsigned long physaddr,
 					 unsigned long size)
 {
 	return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
 }
-extern inline void *ioremap_fullcache(unsigned long physaddr,
+static inline void *ioremap_fullcache(unsigned long physaddr,
 				      unsigned long size)
 {
 	return __ioremap(physaddr, size, IOMAP_FULL_CACHING);
diff -Nru a/include/asm-m68k/mac_psc.h b/include/asm-m68k/mac_psc.h
--- a/include/asm-m68k/mac_psc.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-m68k/mac_psc.h	Tue Feb  3 19:45:17 2004
@@ -215,32 +215,32 @@
  *	Access functions
  */
  
-extern inline void psc_write_byte(int offset, __u8 data)
+static inline void psc_write_byte(int offset, __u8 data)
 {
 	*((volatile __u8 *)(psc + offset)) = data;
 }
 
-extern inline void psc_write_word(int offset, __u16 data)
+static inline void psc_write_word(int offset, __u16 data)
 {
 	*((volatile __u16 *)(psc + offset)) = data;
 }
 
-extern inline void psc_write_long(int offset, __u32 data)
+static inline void psc_write_long(int offset, __u32 data)
 {
 	*((volatile __u32 *)(psc + offset)) = data;
 }
 
-extern inline u8 psc_read_byte(int offset)
+static inline u8 psc_read_byte(int offset)
 {
 	return *((volatile __u8 *)(psc + offset));
 }
 
-extern inline u16 psc_read_word(int offset)
+static inline u16 psc_read_word(int offset)
 {
 	return *((volatile __u16 *)(psc + offset));
 }
 
-extern inline u32 psc_read_long(int offset)
+static inline u32 psc_read_long(int offset)
 {
 	return *((volatile __u32 *)(psc + offset));
 }
diff -Nru a/include/asm-m68k/mac_via.h b/include/asm-m68k/mac_via.h
--- a/include/asm-m68k/mac_via.h	Tue Feb  3 19:45:28 2004
+++ b/include/asm-m68k/mac_via.h	Tue Feb  3 19:45:28 2004
@@ -255,7 +255,8 @@
 extern int rbv_present,via_alt_mapping;
 extern __u8 rbv_clear;
 
-extern __inline__ int rbv_set_video_bpp(int bpp) {
+static inline int rbv_set_video_bpp(int bpp)
+{
 	char val = (bpp==1)?0:(bpp==2)?1:(bpp==4)?2:(bpp==8)?3:-1;
 	if (!rbv_present || val<0) return -1;
 	via2[rMonP] = (via2[rMonP] & ~RBV_DEPTH) | val;
diff -Nru a/include/asm-m68k/mmu_context.h b/include/asm-m68k/mmu_context.h
--- a/include/asm-m68k/mmu_context.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-m68k/mmu_context.h	Tue Feb  3 19:45:34 2004
@@ -13,8 +13,8 @@
 #include <asm/page.h>
 #include <asm/pgalloc.h>
 
-extern inline int
-init_new_context(struct task_struct *tsk, struct mm_struct *mm)
+static inline int init_new_context(struct task_struct *tsk,
+				   struct mm_struct *mm)
 {
 	mm->context = virt_to_phys(mm->pgd);
 	return 0;
@@ -22,7 +22,7 @@
 
 #define destroy_context(mm)		do { } while(0)
 
-extern inline void switch_mm_0230(struct mm_struct *mm)
+static inline void switch_mm_0230(struct mm_struct *mm)
 {
 	unsigned long crp[2] = {
 		0x80000000 | _PAGE_TABLE, mm->context
@@ -55,7 +55,7 @@
 	asm volatile (".chip 68k");
 }
 
-extern inline void switch_mm_0460(struct mm_struct *mm)
+static inline void switch_mm_0460(struct mm_struct *mm)
 {
 	asm volatile (".chip 68040");
 
@@ -91,7 +91,7 @@
 
 #define deactivate_mm(tsk,mm)	do { } while (0)
 
-extern inline void activate_mm(struct mm_struct *prev_mm,
+static inline void activate_mm(struct mm_struct *prev_mm,
 			       struct mm_struct *next_mm)
 {
 	next_mm->context = virt_to_phys(next_mm->pgd);
@@ -144,7 +144,7 @@
 
 #define deactivate_mm(tsk,mm)	do { } while (0)
 
-extern inline void activate_mm(struct mm_struct *prev_mm,
+static inline void activate_mm(struct mm_struct *prev_mm,
 			       struct mm_struct *next_mm)
 {
 	activate_context(next_mm);
diff -Nru a/include/asm-m68k/motorola_pgtable.h b/include/asm-m68k/motorola_pgtable.h
--- a/include/asm-m68k/motorola_pgtable.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-m68k/motorola_pgtable.h	Tue Feb  3 19:45:30 2004
@@ -41,10 +41,14 @@
  * processors >= '040. It is used in pte_mkcache(), and the variable is
  * defined and initialized in head.S */
 
-#if defined(CONFIG_060_WRITETHROUGH)
-extern int m68k_supervisor_cachemode;
-#else
+#if defined(CPU_M68060_ONLY) && defined(CONFIG_060_WRITETHROUGH)
+#define m68k_supervisor_cachemode _PAGE_CACHE040W
+#elif defined(CPU_M68040_OR_M68060_ONLY)
 #define m68k_supervisor_cachemode _PAGE_CACHE040
+#elif defined(CPU_M68020_OR_M68030_ONLY)
+#define m68k_supervisor_cachemode 0
+#else
+extern int m68k_supervisor_cachemode;
 #endif
 
 #if defined(CPU_M68040_OR_M68060_ONLY)
@@ -96,10 +100,13 @@
  */
 #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
 
-extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
-{ pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; }
+static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
+{
+	pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot);
+	return pte;
+}
 
-extern inline void pmd_set(pmd_t * pmdp, pte_t * ptep)
+static inline void pmd_set(pmd_t *pmdp, pte_t *ptep)
 {
 	unsigned long ptbl = virt_to_phys(ptep) | _PAGE_TABLE | _PAGE_ACCESSED;
 	unsigned long *ptr = pmdp->pmd;
@@ -110,8 +117,10 @@
 	}
 }
 
-extern inline void pgd_set(pgd_t * pgdp, pmd_t * pmdp)
-{ pgd_val(*pgdp) = _PAGE_TABLE | _PAGE_ACCESSED | __pa(pmdp); }
+static inline void pgd_set(pgd_t *pgdp, pmd_t *pmdp)
+{
+	pgd_val(*pgdp) = _PAGE_TABLE | _PAGE_ACCESSED | __pa(pmdp);
+}
 
 #define __pte_page(pte) ((unsigned long)__va(pte_val(pte) & PAGE_MASK))
 #define __pmd_page(pmd) ((unsigned long)__va(pmd_val(pmd) & _TABLE_MASK))
@@ -155,36 +164,40 @@
  * The following only work if pte_present() is true.
  * Undefined behaviour if not..
  */
-extern inline int pte_read(pte_t pte)		{ return 1; }
-extern inline int pte_write(pte_t pte)		{ return !(pte_val(pte) & _PAGE_RONLY); }
-extern inline int pte_exec(pte_t pte)		{ return 1; }
-extern inline int pte_dirty(pte_t pte)		{ return pte_val(pte) & _PAGE_DIRTY; }
-extern inline int pte_young(pte_t pte)		{ return pte_val(pte) & _PAGE_ACCESSED; }
+static inline int pte_read(pte_t pte)		{ return 1; }
+static inline int pte_write(pte_t pte)		{ return !(pte_val(pte) & _PAGE_RONLY); }
+static inline int pte_exec(pte_t pte)		{ return 1; }
+static inline int pte_dirty(pte_t pte)		{ return pte_val(pte) & _PAGE_DIRTY; }
+static inline int pte_young(pte_t pte)		{ return pte_val(pte) & _PAGE_ACCESSED; }
 static inline int pte_file(pte_t pte)		{ return pte_val(pte) & _PAGE_FILE; }
 
-extern inline pte_t pte_wrprotect(pte_t pte)	{ pte_val(pte) |= _PAGE_RONLY; return pte; }
-extern inline pte_t pte_rdprotect(pte_t pte)	{ return pte; }
-extern inline pte_t pte_exprotect(pte_t pte)	{ return pte; }
-extern inline pte_t pte_mkclean(pte_t pte)	{ pte_val(pte) &= ~_PAGE_DIRTY; return pte; }
-extern inline pte_t pte_mkold(pte_t pte)	{ pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
-extern inline pte_t pte_mkwrite(pte_t pte)	{ pte_val(pte) &= ~_PAGE_RONLY; return pte; }
-extern inline pte_t pte_mkread(pte_t pte)	{ return pte; }
-extern inline pte_t pte_mkexec(pte_t pte)	{ return pte; }
-extern inline pte_t pte_mkdirty(pte_t pte)	{ pte_val(pte) |= _PAGE_DIRTY; return pte; }
-extern inline pte_t pte_mkyoung(pte_t pte)	{ pte_val(pte) |= _PAGE_ACCESSED; return pte; }
-extern inline pte_t pte_mknocache(pte_t pte)
+static inline pte_t pte_wrprotect(pte_t pte)	{ pte_val(pte) |= _PAGE_RONLY; return pte; }
+static inline pte_t pte_rdprotect(pte_t pte)	{ return pte; }
+static inline pte_t pte_exprotect(pte_t pte)	{ return pte; }
+static inline pte_t pte_mkclean(pte_t pte)	{ pte_val(pte) &= ~_PAGE_DIRTY; return pte; }
+static inline pte_t pte_mkold(pte_t pte)	{ pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
+static inline pte_t pte_mkwrite(pte_t pte)	{ pte_val(pte) &= ~_PAGE_RONLY; return pte; }
+static inline pte_t pte_mkread(pte_t pte)	{ return pte; }
+static inline pte_t pte_mkexec(pte_t pte)	{ return pte; }
+static inline pte_t pte_mkdirty(pte_t pte)	{ pte_val(pte) |= _PAGE_DIRTY; return pte; }
+static inline pte_t pte_mkyoung(pte_t pte)	{ pte_val(pte) |= _PAGE_ACCESSED; return pte; }
+static inline pte_t pte_mknocache(pte_t pte)
 {
 	pte_val(pte) = (pte_val(pte) & _CACHEMASK040) | m68k_pgtable_cachemode;
 	return pte;
 }
-extern inline pte_t pte_mkcache(pte_t pte)	{ pte_val(pte) = (pte_val(pte) & _CACHEMASK040) | m68k_supervisor_cachemode; return pte; }
+static inline pte_t pte_mkcache(pte_t pte)
+{
+	pte_val(pte) = (pte_val(pte) & _CACHEMASK040) | m68k_supervisor_cachemode;
+	return pte;
+}
 
 #define PAGE_DIR_OFFSET(tsk,address) pgd_offset((tsk),(address))
 
 #define pgd_index(address)     ((address) >> PGDIR_SHIFT)
 
 /* to find an entry in a page-table-directory */
-extern inline pgd_t * pgd_offset(struct mm_struct * mm, unsigned long address)
+static inline pgd_t *pgd_offset(struct mm_struct *mm, unsigned long address)
 {
 	return mm->pgd + pgd_index(address);
 }
@@ -192,20 +205,20 @@
 #define swapper_pg_dir kernel_pg_dir
 extern pgd_t kernel_pg_dir[128];
 
-extern inline pgd_t * pgd_offset_k(unsigned long address)
+static inline pgd_t *pgd_offset_k(unsigned long address)
 {
 	return kernel_pg_dir + (address >> PGDIR_SHIFT);
 }
 
 
 /* Find an entry in the second-level page table.. */
-extern inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
+static inline pmd_t *pmd_offset(pgd_t *dir, unsigned long address)
 {
 	return (pmd_t *)__pgd_page(*dir) + ((address >> PMD_SHIFT) & (PTRS_PER_PMD-1));
 }
 
 /* Find an entry in the third-level page table.. */ 
-extern inline pte_t * pte_offset_kernel(pmd_t * pmdp, unsigned long address)
+static inline pte_t *pte_offset_kernel(pmd_t *pmdp, unsigned long address)
 {
 	return (pte_t *)__pmd_page(*pmdp) + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1));
 }
diff -Nru a/include/asm-m68k/nubus.h b/include/asm-m68k/nubus.h
--- a/include/asm-m68k/nubus.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-m68k/nubus.h	Tue Feb  3 19:45:43 2004
@@ -15,25 +15,25 @@
 #define nubus_memcpy_fromio(a,b,c)	memcpy((a),(void *)(b),(c))
 #define nubus_memcpy_toio(a,b,c)	memcpy((void *)(a),(b),(c))
 
-extern inline void *nubus_remap_nocache_ser(unsigned long physaddr,
+static inline void *nubus_remap_nocache_ser(unsigned long physaddr,
 					    unsigned long size)
 {
 	return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
 }
 
-extern inline void *nubus_remap_nocache_nonser(unsigned long physaddr,
+static inline void *nubus_remap_nocache_nonser(unsigned long physaddr,
 					       unsigned long size)
 {
 	return __ioremap(physaddr, size, IOMAP_NOCACHE_NONSER);
 }
 
-extern inline void *nbus_remap_writethrough(unsigned long physaddr,
+static inline void *nbus_remap_writethrough(unsigned long physaddr,
 					    unsigned long size)
 {
 	return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
 }
 
-extern inline void *nubus_remap_fullcache(unsigned long physaddr,
+static inline void *nubus_remap_fullcache(unsigned long physaddr,
 					  unsigned long size)
 {
 	return __ioremap(physaddr, size, IOMAP_FULL_CACHING);
diff -Nru a/include/asm-m68k/page.h b/include/asm-m68k/page.h
--- a/include/asm-m68k/page.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-m68k/page.h	Tue Feb  3 19:45:43 2004
@@ -110,7 +110,7 @@
 #define PAGE_ALIGN(addr)	(((addr)+PAGE_SIZE-1)&PAGE_MASK)
 
 /* Pure 2^n version of get_order */
-extern __inline__ int get_order(unsigned long size)
+static inline int get_order(unsigned long size)
 {
 	int order;
 
diff -Nru a/include/asm-m68k/pci.h b/include/asm-m68k/pci.h
--- a/include/asm-m68k/pci.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-m68k/pci.h	Tue Feb  3 19:45:17 2004
@@ -37,12 +37,12 @@
 
 #define pcibios_assign_all_busses()	0
 
-extern inline void pcibios_set_master(struct pci_dev *dev)
+static inline void pcibios_set_master(struct pci_dev *dev)
 {
 	/* No special bus mastering setup handling */
 }
 
-extern inline void pcibios_penalize_isa_irq(int irq)
+static inline void pcibios_penalize_isa_irq(int irq)
 {
 	/* We don't do dynamic PCI IRQ allocation */
 }
diff -Nru a/include/asm-m68k/pgtable.h b/include/asm-m68k/pgtable.h
--- a/include/asm-m68k/pgtable.h	Tue Feb  3 19:45:41 2004
+++ b/include/asm-m68k/pgtable.h	Tue Feb  3 19:45:41 2004
@@ -114,7 +114,7 @@
  * It makes no sense to consider whether we cross a memory boundary if
  * we support just one physical chunk of memory.
  */
-extern inline int mm_end_of_chunk (unsigned long addr, int len)
+static inline int mm_end_of_chunk(unsigned long addr, int len)
 {
 	return 0;
 }
@@ -129,8 +129,8 @@
  * tables contain all the necessary information.  The Sun3 does, but
  * they are updated on demand.
  */
-extern inline void update_mmu_cache(struct vm_area_struct * vma,
-	unsigned long address, pte_t pte)
+static inline void update_mmu_cache(struct vm_area_struct *vma,
+				    unsigned long address, pte_t pte)
 {
 }
 
diff -Nru a/include/asm-m68k/processor.h b/include/asm-m68k/processor.h
--- a/include/asm-m68k/processor.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-m68k/processor.h	Tue Feb  3 19:45:34 2004
@@ -18,14 +18,16 @@
 #include <asm/fpu.h>
 #include <asm/ptrace.h>
 
-extern inline unsigned long rdusp(void) {
-  	unsigned long usp;
+static inline unsigned long rdusp(void)
+{
+	unsigned long usp;
 
 	__asm__ __volatile__("move %/usp,%0" : "=a" (usp));
 	return usp;
 }
 
-extern inline void wrusp(unsigned long usp) {
+static inline void wrusp(unsigned long usp)
+{
 	__asm__ __volatile__("move %0,%/usp" : : "a" (usp));
 }
 
@@ -83,10 +85,11 @@
 	struct task_work work;
 };
 
-#define INIT_THREAD  {						\
-	ksp: sizeof(init_stack) + (unsigned long) init_stack,	\
-	sr: PS_S, 						\
-	fs: __KERNEL_DS,					\
+#define INIT_THREAD  {							\
+	ksp:	sizeof(init_stack) + (unsigned long) init_stack,	\
+	sr:	PS_S,							\
+	fs:	__KERNEL_DS,						\
+	info:	INIT_THREAD_INFO(init_task)				\
 }
 
 /*
diff -Nru a/include/asm-m68k/sbus.h b/include/asm-m68k/sbus.h
--- a/include/asm-m68k/sbus.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-m68k/sbus.h	Tue Feb  3 19:45:43 2004
@@ -20,17 +20,17 @@
 /* sbus IO functions stolen from include/asm-sparc/io.h for the serial driver */
 /* No SBUS on the Sun3, kludge -- sam */
 
-extern inline void _sbus_writeb(unsigned char val, unsigned long addr)
+static inline void _sbus_writeb(unsigned char val, unsigned long addr)
 {
 	*(volatile unsigned char *)addr = val;
 }
 
-extern inline unsigned char _sbus_readb(unsigned long addr)
+static inline unsigned char _sbus_readb(unsigned long addr)
 {
 	return *(volatile unsigned char *)addr;
 }
 
-extern inline void _sbus_writel(unsigned long val, unsigned long addr)
+static inline void _sbus_writel(unsigned long val, unsigned long addr)
 {
 	*(volatile unsigned long *)addr = val;
 
diff -Nru a/include/asm-m68k/semaphore.h b/include/asm-m68k/semaphore.h
--- a/include/asm-m68k/semaphore.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-m68k/semaphore.h	Tue Feb  3 19:45:43 2004
@@ -52,7 +52,7 @@
 #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
 #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
 
-extern inline void sema_init (struct semaphore *sem, int val)
+static inline void sema_init(struct semaphore *sem, int val)
 {
 	*sem = (struct semaphore)__SEMAPHORE_INITIALIZER(*sem, val);
 }
@@ -82,7 +82,7 @@
  * "down_failed" is a special asm handler that calls the C
  * routine that actually waits. See arch/m68k/lib/semaphore.S
  */
-extern inline void down(struct semaphore * sem)
+static inline void down(struct semaphore *sem)
 {
 	register struct semaphore *sem1 __asm__ ("%a1") = sem;
 
@@ -104,7 +104,7 @@
 		: "memory");
 }
 
-extern inline int down_interruptible(struct semaphore * sem)
+static inline int down_interruptible(struct semaphore *sem)
 {
 	register struct semaphore *sem1 __asm__ ("%a1") = sem;
 	register int result __asm__ ("%d0");
@@ -129,7 +129,7 @@
 	return result;
 }
 
-extern inline int down_trylock(struct semaphore * sem)
+static inline int down_trylock(struct semaphore *sem)
 {
 	register struct semaphore *sem1 __asm__ ("%a1") = sem;
 	register int result __asm__ ("%d0");
@@ -160,7 +160,7 @@
  * The default case (no contention) will result in NO
  * jumps for both down() and up().
  */
-extern inline void up(struct semaphore * sem)
+static inline void up(struct semaphore *sem)
 {
 	register struct semaphore *sem1 __asm__ ("%a1") = sem;
 
diff -Nru a/include/asm-m68k/signal.h b/include/asm-m68k/signal.h
--- a/include/asm-m68k/signal.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-m68k/signal.h	Tue Feb  3 19:45:17 2004
@@ -176,25 +176,25 @@
 
 #define __HAVE_ARCH_SIG_BITOPS
 
-extern __inline__ void sigaddset(sigset_t *set, int _sig)
+static inline void sigaddset(sigset_t *set, int _sig)
 {
 	__asm__("bfset %0{%1,#1}" : "=m" (*set) : "id" ((_sig - 1) ^ 31)
 		: "cc");
 }
 
-extern __inline__ void sigdelset(sigset_t *set, int _sig)
+static inline void sigdelset(sigset_t *set, int _sig)
 {
 	__asm__("bfclr %0{%1,#1}" : "=m"(*set) : "id"((_sig - 1) ^ 31)
 		: "cc");
 }
 
-extern __inline__ int __const_sigismember(sigset_t *set, int _sig)
+static inline int __const_sigismember(sigset_t *set, int _sig)
 {
 	unsigned long sig = _sig - 1;
 	return 1 & (set->sig[sig / _NSIG_BPW] >> (sig % _NSIG_BPW));
 }
 
-extern __inline__ int __gen_sigismember(sigset_t *set, int _sig)
+static inline int __gen_sigismember(sigset_t *set, int _sig)
 {
 	int ret;
 	__asm__("bfextu %1{%2,#1},%0"
@@ -207,7 +207,7 @@
 	 __const_sigismember(set,sig) :		\
 	 __gen_sigismember(set,sig))
 
-extern __inline__ int sigfindinword(unsigned long word)
+static inline int sigfindinword(unsigned long word)
 {
 	__asm__("bfffo %1{#0,#0},%0" : "=d"(word) : "d"(word & -word) : "cc");
 	return word ^ 31;
diff -Nru a/include/asm-m68k/socket.h b/include/asm-m68k/socket.h
--- a/include/asm-m68k/socket.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-m68k/socket.h	Tue Feb  3 19:45:17 2004
@@ -45,6 +45,8 @@
 
 #define SO_ACCEPTCONN		30
 
+#define SO_PEERSEC             31
+
 /* Nast libc5 fixup - bletch */
 #if defined(__KERNEL__)
 /* Socket types. */
diff -Nru a/include/asm-m68k/string.h b/include/asm-m68k/string.h
--- a/include/asm-m68k/string.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-m68k/string.h	Tue Feb  3 19:45:34 2004
@@ -82,7 +82,7 @@
 
 #if 0
 #define __HAVE_ARCH_STRPBRK
-extern inline char * strpbrk(const char * cs,const char * ct)
+static inline char *strpbrk(const char *cs,const char *ct)
 {
   const char *sc1,*sc2;
   
@@ -530,7 +530,8 @@
  memcmp((cs),(ct),(n)))
 
 #define __HAVE_ARCH_MEMCHR
-extern inline void * memchr(const void * cs, int c, size_t count) {
+static inline void *memchr(const void *cs, int c, size_t count)
+{
 	/* Someone else can optimize this, I don't care - tonym@mac.linux-m68k.org */
 	unsigned char *ret = (unsigned char *)cs;
 	for(;count>0;count--,ret++)
diff -Nru a/include/asm-m68k/sun3_pgtable.h b/include/asm-m68k/sun3_pgtable.h
--- a/include/asm-m68k/sun3_pgtable.h	Tue Feb  3 19:45:35 2004
+++ b/include/asm-m68k/sun3_pgtable.h	Tue Feb  3 19:45:35 2004
@@ -103,22 +103,27 @@
  */
 #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
 
-extern inline pte_t pte_modify (pte_t pte, pgprot_t newprot)
-{ pte_val(pte) = (pte_val(pte) & SUN3_PAGE_CHG_MASK) | pgprot_val(newprot); return pte; }
+static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
+{
+	pte_val(pte) = (pte_val(pte) & SUN3_PAGE_CHG_MASK) | pgprot_val(newprot);
+	return pte;
+}
 
 #define pmd_set(pmdp,ptep) do {} while (0)
 
-extern inline void pgd_set(pgd_t * pgdp, pmd_t * pmdp)
-{ pgd_val(*pgdp) = virt_to_phys(pmdp); }
+static inline void pgd_set(pgd_t *pgdp, pmd_t *pmdp)
+{
+	pgd_val(*pgdp) = virt_to_phys(pmdp);
+}
 
 #define __pte_page(pte) \
 ((unsigned long) __va ((pte_val (pte) & SUN3_PAGE_PGNUM_MASK) << PAGE_SHIFT))
 #define __pmd_page(pmd) \
 ((unsigned long) __va (pmd_val (pmd) & PAGE_MASK))
 
-extern inline int pte_none (pte_t pte) { return !pte_val (pte); }
-extern inline int pte_present (pte_t pte) { return pte_val (pte) & SUN3_PAGE_VALID; }
-extern inline void pte_clear (pte_t *ptep) { pte_val (*ptep) = 0; }
+static inline int pte_none (pte_t pte) { return !pte_val (pte); }
+static inline int pte_present (pte_t pte) { return pte_val (pte) & SUN3_PAGE_VALID; }
+static inline void pte_clear (pte_t *ptep) { pte_val (*ptep) = 0; }
 
 #define pte_pfn(pte)            (pte_val(pte) & SUN3_PAGE_PGNUM_MASK)
 #define pfn_pte(pfn, pgprot) \
@@ -128,20 +133,20 @@
 #define pmd_page(pmd)		(mem_map+((__pmd_page(pmd) - PAGE_OFFSET) >> PAGE_SHIFT))
 
 
-extern inline int pmd_none2 (pmd_t *pmd) { return !pmd_val (*pmd); }
+static inline int pmd_none2 (pmd_t *pmd) { return !pmd_val (*pmd); }
 #define pmd_none(pmd) pmd_none2(&(pmd))
-//extern inline int pmd_bad (pmd_t pmd) { return (pmd_val (pmd) & SUN3_PMD_MASK) != SUN3_PMD_MAGIC; }
-extern inline int pmd_bad2 (pmd_t *pmd) { return 0; }
+//static inline int pmd_bad (pmd_t pmd) { return (pmd_val (pmd) & SUN3_PMD_MASK) != SUN3_PMD_MAGIC; }
+static inline int pmd_bad2 (pmd_t *pmd) { return 0; }
 #define pmd_bad(pmd) pmd_bad2(&(pmd))
-extern inline int pmd_present2 (pmd_t *pmd) { return pmd_val (*pmd) & SUN3_PMD_VALID; }
+static inline int pmd_present2 (pmd_t *pmd) { return pmd_val (*pmd) & SUN3_PMD_VALID; }
 /* #define pmd_present(pmd) pmd_present2(&(pmd)) */
 #define pmd_present(pmd) (!pmd_none2(&(pmd)))
-extern inline void pmd_clear (pmd_t *pmdp) { pmd_val (*pmdp) = 0; }
+static inline void pmd_clear (pmd_t *pmdp) { pmd_val (*pmdp) = 0; }
 
-extern inline int pgd_none (pgd_t pgd) { return 0; }
-extern inline int pgd_bad (pgd_t pgd) { return 0; }
-extern inline int pgd_present (pgd_t pgd) { return 1; }
-extern inline void pgd_clear (pgd_t *pgdp) {}
+static inline int pgd_none (pgd_t pgd) { return 0; }
+static inline int pgd_bad (pgd_t pgd) { return 0; }
+static inline int pgd_present (pgd_t pgd) { return 1; }
+static inline void pgd_clear (pgd_t *pgdp) {}
 
 
 #define pte_ERROR(e) \
@@ -157,28 +162,28 @@
  * Undefined behaviour if not...
  * [we have the full set here even if they don't change from m68k]
  */
-extern inline int pte_read(pte_t pte)		{ return 1; }
-extern inline int pte_write(pte_t pte)		{ return pte_val(pte) & SUN3_PAGE_WRITEABLE; }
-extern inline int pte_exec(pte_t pte)		{ return 1; }
-extern inline int pte_dirty(pte_t pte)		{ return pte_val(pte) & SUN3_PAGE_MODIFIED; }
-extern inline int pte_young(pte_t pte)		{ return pte_val(pte) & SUN3_PAGE_ACCESSED; }
-extern inline int pte_file(pte_t pte)		{ return pte_val(pte) & SUN3_PAGE_ACCESSED; }
-
-extern inline pte_t pte_wrprotect(pte_t pte)	{ pte_val(pte) &= ~SUN3_PAGE_WRITEABLE; return pte; }
-extern inline pte_t pte_rdprotect(pte_t pte)	{ return pte; }
-extern inline pte_t pte_exprotect(pte_t pte)	{ return pte; }
-extern inline pte_t pte_mkclean(pte_t pte)	{ pte_val(pte) &= ~SUN3_PAGE_MODIFIED; return pte; }
-extern inline pte_t pte_mkold(pte_t pte)	{ pte_val(pte) &= ~SUN3_PAGE_ACCESSED; return pte; }
-extern inline pte_t pte_mkwrite(pte_t pte)	{ pte_val(pte) |= SUN3_PAGE_WRITEABLE; return pte; }
-extern inline pte_t pte_mkread(pte_t pte)	{ return pte; }
-extern inline pte_t pte_mkexec(pte_t pte)	{ return pte; }
-extern inline pte_t pte_mkdirty(pte_t pte)	{ pte_val(pte) |= SUN3_PAGE_MODIFIED; return pte; }
-extern inline pte_t pte_mkyoung(pte_t pte)	{ pte_val(pte) |= SUN3_PAGE_ACCESSED; return pte; }
-extern inline pte_t pte_mknocache(pte_t pte)	{ pte_val(pte) |= SUN3_PAGE_NOCACHE; return pte; }
+static inline int pte_read(pte_t pte)		{ return 1; }
+static inline int pte_write(pte_t pte)		{ return pte_val(pte) & SUN3_PAGE_WRITEABLE; }
+static inline int pte_exec(pte_t pte)		{ return 1; }
+static inline int pte_dirty(pte_t pte)		{ return pte_val(pte) & SUN3_PAGE_MODIFIED; }
+static inline int pte_young(pte_t pte)		{ return pte_val(pte) & SUN3_PAGE_ACCESSED; }
+static inline int pte_file(pte_t pte)		{ return pte_val(pte) & SUN3_PAGE_ACCESSED; }
+
+static inline pte_t pte_wrprotect(pte_t pte)	{ pte_val(pte) &= ~SUN3_PAGE_WRITEABLE; return pte; }
+static inline pte_t pte_rdprotect(pte_t pte)	{ return pte; }
+static inline pte_t pte_exprotect(pte_t pte)	{ return pte; }
+static inline pte_t pte_mkclean(pte_t pte)	{ pte_val(pte) &= ~SUN3_PAGE_MODIFIED; return pte; }
+static inline pte_t pte_mkold(pte_t pte)	{ pte_val(pte) &= ~SUN3_PAGE_ACCESSED; return pte; }
+static inline pte_t pte_mkwrite(pte_t pte)	{ pte_val(pte) |= SUN3_PAGE_WRITEABLE; return pte; }
+static inline pte_t pte_mkread(pte_t pte)	{ return pte; }
+static inline pte_t pte_mkexec(pte_t pte)	{ return pte; }
+static inline pte_t pte_mkdirty(pte_t pte)	{ pte_val(pte) |= SUN3_PAGE_MODIFIED; return pte; }
+static inline pte_t pte_mkyoung(pte_t pte)	{ pte_val(pte) |= SUN3_PAGE_ACCESSED; return pte; }
+static inline pte_t pte_mknocache(pte_t pte)	{ pte_val(pte) |= SUN3_PAGE_NOCACHE; return pte; }
 // use this version when caches work...
-//extern inline pte_t pte_mkcache(pte_t pte)	{ pte_val(pte) &= SUN3_PAGE_NOCACHE; return pte; }
+//static inline pte_t pte_mkcache(pte_t pte)	{ pte_val(pte) &= SUN3_PAGE_NOCACHE; return pte; }
 // until then, use:
-extern inline pte_t pte_mkcache(pte_t pte)	{ return pte; }
+static inline pte_t pte_mkcache(pte_t pte)	{ return pte; }
 
 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
 extern pgd_t kernel_pg_dir[PTRS_PER_PGD];
@@ -193,7 +198,7 @@
 #define pgd_offset_k(address) pgd_offset(&init_mm, address)
 
 /* Find an entry in the second-level pagetable. */
-extern inline pmd_t *pmd_offset (pgd_t *pgd, unsigned long address)
+static inline pmd_t *pmd_offset (pgd_t *pgd, unsigned long address)
 {
 	return (pmd_t *) pgd;
 }
diff -Nru a/include/asm-m68k/sun3mmu.h b/include/asm-m68k/sun3mmu.h
--- a/include/asm-m68k/sun3mmu.h	Tue Feb  3 19:45:18 2004
+++ b/include/asm-m68k/sun3mmu.h	Tue Feb  3 19:45:18 2004
@@ -69,7 +69,7 @@
 #ifndef __ASSEMBLY__
 
 /* Read bus error status register (implicitly clearing it). */
-extern __inline__ unsigned char sun3_get_buserr (void)
+static inline unsigned char sun3_get_buserr(void)
 {
 	unsigned char sfc, c;
 
@@ -82,7 +82,7 @@
 }
 
 /* Read segmap from hardware MMU. */
-extern __inline__ unsigned long sun3_get_segmap (unsigned long addr)
+static inline unsigned long sun3_get_segmap(unsigned long addr)
 {
         register unsigned long entry;
         unsigned char c, sfc;
@@ -97,7 +97,7 @@
 }
 
 /* Write segmap to hardware MMU. */
-extern __inline__ void sun3_put_segmap (unsigned long addr, unsigned long entry)
+static inline void sun3_put_segmap(unsigned long addr, unsigned long entry)
 {
         unsigned char sfc;
 
@@ -110,7 +110,7 @@
 }
 
 /* Read PTE from hardware MMU. */
-extern __inline__ unsigned long sun3_get_pte (unsigned long addr)
+static inline unsigned long sun3_get_pte(unsigned long addr)
 {
         register unsigned long entry;
         unsigned char sfc;
@@ -124,7 +124,7 @@
 }
 
 /* Write PTE to hardware MMU. */
-extern __inline__ void sun3_put_pte (unsigned long addr, unsigned long entry)
+static inline void sun3_put_pte(unsigned long addr, unsigned long entry)
 {
         unsigned char sfc;
 
@@ -137,7 +137,7 @@
 }
 
 /* get current context */
-extern __inline__ unsigned char sun3_get_context(void)
+static inline unsigned char sun3_get_context(void)
 {
 	unsigned char sfc, c;
 
@@ -150,7 +150,7 @@
 }
 
 /* set alternate context */
-extern __inline__ void sun3_put_context(unsigned char c)
+static inline void sun3_put_context(unsigned char c)
 {
 	unsigned char dfc;
 	GET_DFC(dfc);
diff -Nru a/include/asm-m68k/system.h b/include/asm-m68k/system.h
--- a/include/asm-m68k/system.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-m68k/system.h	Tue Feb  3 19:45:34 2004
@@ -7,6 +7,8 @@
 #include <asm/segment.h>
 #include <asm/entry.h>
 
+#ifdef __KERNEL__
+
 /*
  * switch_to(n) should switch tasks to task ptr, first checking that
  * ptr isn't the current task, in which case it does nothing.  This
@@ -155,5 +157,7 @@
 	return x;
 }
 #endif
+
+#endif /* __KERNEL__ */
 
 #endif /* _M68K_SYSTEM_H */
diff -Nru a/include/asm-m68k/thread_info.h b/include/asm-m68k/thread_info.h
--- a/include/asm-m68k/thread_info.h	Tue Feb  3 19:45:33 2004
+++ b/include/asm-m68k/thread_info.h	Tue Feb  3 19:45:33 2004
@@ -35,7 +35,7 @@
 #define free_thread_info(ti)  free_pages((unsigned long)(ti),1)
 #endif /* PAGE_SHIFT == 13 */
 
-#define init_thread_info	(init_thread_union.thread_info)
+//#define init_thread_info	(init_task.thread.info)
 #define init_stack		(init_thread_union.stack)
 
 #define current_thread_info()	(current->thread_info)
diff -Nru a/include/asm-m68k/tlbflush.h b/include/asm-m68k/tlbflush.h
--- a/include/asm-m68k/tlbflush.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-m68k/tlbflush.h	Tue Feb  3 19:45:34 2004
@@ -87,7 +87,7 @@
 	flush_tlb_all();
 }
 
-extern inline void flush_tlb_pgtables(struct mm_struct *mm,
+static inline void flush_tlb_pgtables(struct mm_struct *mm,
 				      unsigned long start, unsigned long end)
 {
 }
@@ -214,7 +214,7 @@
 	sun3_put_segmap (addr & ~(SUN3_PMEG_SIZE - 1), SUN3_INVALID_PMEG);
 }
 
-extern inline void flush_tlb_pgtables(struct mm_struct *mm,
+static inline void flush_tlb_pgtables(struct mm_struct *mm,
 				      unsigned long start, unsigned long end)
 {
 }
diff -Nru a/include/asm-m68k/uaccess.h b/include/asm-m68k/uaccess.h
--- a/include/asm-m68k/uaccess.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-m68k/uaccess.h	Tue Feb  3 19:45:17 2004
@@ -14,7 +14,7 @@
 /* We let the MMU do all checking */
 #define access_ok(type,addr,size) 1
 
-extern inline int verify_area(int type, const void * addr, unsigned long size)
+static inline int verify_area(int type, const void *addr, unsigned long size)
 {
 	return access_ok(type,addr,size)?0:-EFAULT;
 }
diff -Nru a/include/asm-m68k/virtconvert.h b/include/asm-m68k/virtconvert.h
--- a/include/asm-m68k/virtconvert.h	Tue Feb  3 19:45:35 2004
+++ b/include/asm-m68k/virtconvert.h	Tue Feb  3 19:45:35 2004
@@ -22,12 +22,12 @@
 extern unsigned long mm_vtop(unsigned long addr) __attribute__ ((const));
 extern unsigned long mm_ptov(unsigned long addr) __attribute__ ((const));
 #else
-extern inline unsigned long mm_vtop(unsigned long vaddr)
+static inline unsigned long mm_vtop(unsigned long vaddr)
 {
 	return __pa(vaddr);
 }
 
-extern inline unsigned long mm_ptov(unsigned long paddr)
+static inline unsigned long mm_ptov(unsigned long paddr)
 {
 	return (unsigned long)__va(paddr);
 }
diff -Nru a/include/asm-m68k/zorro.h b/include/asm-m68k/zorro.h
--- a/include/asm-m68k/zorro.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-m68k/zorro.h	Tue Feb  3 19:45:17 2004
@@ -15,25 +15,25 @@
 #define z_memcpy_fromio(a,b,c)	memcpy((a),(void *)(b),(c))
 #define z_memcpy_toio(a,b,c)	memcpy((void *)(a),(b),(c))
 
-extern inline void *z_remap_nocache_ser(unsigned long physaddr, 
-					  unsigned long size)
+static inline void *z_remap_nocache_ser(unsigned long physaddr,
+					unsigned long size)
 {
 	return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
 }
 
-extern inline void *z_remap_nocache_nonser(unsigned long physaddr, 
-					     unsigned long size)
+static inline void *z_remap_nocache_nonser(unsigned long physaddr,
+					   unsigned long size)
 {
 	return __ioremap(physaddr, size, IOMAP_NOCACHE_NONSER);
 }
 
-extern inline void *z_remap_writethrough(unsigned long physaddr,
-					   unsigned long size)
+static inline void *z_remap_writethrough(unsigned long physaddr,
+					 unsigned long size)
 {
 	return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
 }
-extern inline void *z_remap_fullcache(unsigned long physaddr,
-					unsigned long size)
+static inline void *z_remap_fullcache(unsigned long physaddr,
+				      unsigned long size)
 {
 	return __ioremap(physaddr, size, IOMAP_FULL_CACHING);
 }
diff -Nru a/include/asm-m68knommu/types.h b/include/asm-m68knommu/types.h
--- a/include/asm-m68knommu/types.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-m68knommu/types.h	Tue Feb  3 19:45:17 2004
@@ -1,66 +1 @@
-#ifndef _M68K_TYPES_H
-#define _M68K_TYPES_H
-
-/*
- * This file is never included by application software unless
- * explicitly requested (e.g., via linux/types.h) in which case the
- * application is Linux specific so (user-) name space pollution is
- * not a major issue.  However, for interoperability, libraries still
- * need to be careful to avoid a name clashes.
- */
-
-#ifndef __ASSEMBLY__
-
-typedef unsigned short umode_t;
-
-/*
- * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
- * header files exported to user space
- */
-
-typedef __signed__ char __s8;
-typedef unsigned char __u8;
-
-typedef __signed__ short __s16;
-typedef unsigned short __u16;
-
-typedef __signed__ int __s32;
-typedef unsigned int __u32;
-
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
-#endif
-
-#endif /* __ASSEMBLY__ */
-
-/*
- * These aren't exported outside the kernel to avoid name space clashes
- */
-#ifdef __KERNEL__
-
-#define BITS_PER_LONG 32
-
-#ifndef __ASSEMBLY__
-
-typedef signed char s8;
-typedef unsigned char u8;
-
-typedef signed short s16;
-typedef unsigned short u16;
-
-typedef signed int s32;
-typedef unsigned int u32;
-
-typedef signed long long s64;
-typedef unsigned long long u64;
-
-/* Dma addresses are 32-bits wide.  */
-
-typedef u32 dma_addr_t;
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* __KERNEL__ */
-
-#endif /* _M68K_TYPES_H */
+#include <asm-m68k/types.h>
diff -Nru a/include/asm-mips/dma-mapping.h b/include/asm-mips/dma-mapping.h
--- a/include/asm-mips/dma-mapping.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-mips/dma-mapping.h	Tue Feb  3 19:45:30 2004
@@ -124,8 +124,7 @@
 	for (i = 0; i < nhwentries; i++, sg++) {
 		unsigned long addr;
 
-		if (!sg->page)
-			BUG();
+		BUG_ON(!sg->page);
 
 		addr = (unsigned long) page_address(sg->page);
 		if (addr)
@@ -139,8 +138,7 @@
 {
 	unsigned long addr;
  
-	if (direction == DMA_NONE)
-		BUG();
+	BUG_ON(direction == DMA_NONE);
  
 	addr = baddr_to_bus(hwdev->bus, dma_handle) + PAGE_OFFSET;
 	dma_cache_wback_inv(addr, size);
@@ -153,8 +151,7 @@
 {
 	unsigned long addr;
 
-	if (direction == DMA_NONE)
-		BUG();
+	BUG_ON(direction == DMA_NONE);
 
 	addr = baddr_to_bus(hwdev->bus, dma_handle) + PAGE_OFFSET;
 	dma_cache_wback_inv(addr, size);
@@ -168,8 +165,7 @@
 	int i;
 #endif
  
-	if (direction == DMA_NONE)
-		BUG();
+	BUG_ON(direction == DMA_NONE);
  
 	/* Make sure that gcc doesn't leave the empty loop body.  */
 #ifdef CONFIG_NONCOHERENT_IO
diff -Nru a/include/asm-mips/pci.h b/include/asm-mips/pci.h
--- a/include/asm-mips/pci.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-mips/pci.h	Tue Feb  3 19:45:34 2004
@@ -113,8 +113,7 @@
 {
 	unsigned long addr;
 
-	if (direction == PCI_DMA_NONE)
-		BUG();
+	BUG_ON(direction == PCI_DMA_NONE);
 
 	addr = baddr_to_bus(pdev->bus, dma_addr) + PAGE_OFFSET;
 	dma_cache_wback_inv(addr, len);
diff -Nru a/include/asm-mips/smp.h b/include/asm-mips/smp.h
--- a/include/asm-mips/smp.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-mips/smp.h	Tue Feb  3 19:45:17 2004
@@ -48,8 +48,8 @@
 
 extern cpumask_t phys_cpu_present_map;
 extern cpumask_t cpu_online_map;
+#define cpu_possible_map	phys_cpu_present_map
 
-#define cpu_possible(cpu)	cpu_isset(cpu, phys_cpu_present_map)
 #define cpu_online(cpu)		cpu_isset(cpu, cpu_online_map)
 
 static inline unsigned int num_online_cpus(void)
diff -Nru a/include/asm-mips/socket.h b/include/asm-mips/socket.h
--- a/include/asm-mips/socket.h	Tue Feb  3 19:45:37 2004
+++ b/include/asm-mips/socket.h	Tue Feb  3 19:45:37 2004
@@ -66,6 +66,8 @@
 #define SO_TIMESTAMP		29
 #define SCM_TIMESTAMP		SO_TIMESTAMP
 
+#define SO_PEERSEC             30
+
 /* Nast libc5 fixup - bletch */
 #if defined(__KERNEL__)
 /* Socket types. */
diff -Nru a/include/asm-parisc/byteorder.h b/include/asm-parisc/byteorder.h
--- a/include/asm-parisc/byteorder.h	Tue Feb  3 19:45:41 2004
+++ b/include/asm-parisc/byteorder.h	Tue Feb  3 19:45:41 2004
@@ -2,10 +2,11 @@
 #define _PARISC_BYTEORDER_H
 
 #include <asm/types.h>
+#include <linux/compiler.h>
 
 #ifdef __GNUC__
 
-static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
+static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 x)
 {
 	__asm__("dep %0, 15, 8, %0\n\t"		/* deposit 00ab -> 0bab */
 		"shd %%r0, %0, 8, %0"		/* shift 000000ab -> 00ba */
@@ -14,7 +15,7 @@
 	return x;
 }
 
-static __inline__ __const__ __u32 ___arch__swab24(__u32 x)
+static __inline__ __attribute_const__ __u32 ___arch__swab24(__u32 x)
 {
 	__asm__("shd %0, %0, 8, %0\n\t"		/* shift xabcxabc -> cxab */
 		"dep %0, 15, 8, %0\n\t"		/* deposit cxab -> cbab */
@@ -24,7 +25,7 @@
 	return x;
 }
 
-static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
+static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
 {
 	unsigned int temp;
 	__asm__("shd %0, %0, 16, %1\n\t"	/* shift abcdabcd -> cdab */
@@ -47,7 +48,7 @@
 **      HSHR    67452301 -> *6*4*2*0 into %0
 **      OR      %0 | %1  -> 76543210 into %0 (all done!)
 */
-static __inline__ __const__ __u64 ___arch__swab64(__u64 x) {
+static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 x) {
 	__u64 temp;
 	__asm__("permh,3210 %0, %0\n\t"
 		"hshl %0, 8, %1\n\t"
@@ -60,7 +61,7 @@
 #define __arch__swab64(x) ___arch__swab64(x)
 #define __BYTEORDER_HAS_U64__
 #elif !defined(__STRICT_ANSI__)
-static __inline__ __const__ __u64 ___arch__swab64(__u64 x)
+static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 x)
 {
 	__u32 t1 = ___arch__swab32((__u32) x);
 	__u32 t2 = ___arch__swab32((__u32) (x >> 32));
diff -Nru a/include/asm-parisc/mmu_context.h b/include/asm-parisc/mmu_context.h
--- a/include/asm-parisc/mmu_context.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-parisc/mmu_context.h	Tue Feb  3 19:45:17 2004
@@ -19,8 +19,7 @@
 static inline int
 init_new_context(struct task_struct *tsk, struct mm_struct *mm)
 {
-	if (atomic_read(&mm->mm_users) != 1)
-	    BUG();
+	BUG_ON(atomic_read(&mm->mm_users) != 1);
 
 	mm->context = alloc_sid();
 	return 0;
@@ -64,7 +63,7 @@
 	 * already, so we should be OK.
 	 */
 
-	if (next == &init_mm) BUG(); /* Should never happen */
+	BUG_ON(next == &init_mm); /* Should never happen */
 
 	if (next->context == 0)
 	    next->context = alloc_sid();
diff -Nru a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h
--- a/include/asm-parisc/pgtable.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-parisc/pgtable.h	Tue Feb  3 19:45:42 2004
@@ -460,4 +460,12 @@
 
 #define HAVE_ARCH_UNMAPPED_AREA
 
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
+#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
+#define __HAVE_ARCH_PTEP_SET_WRPROTECT
+#define __HAVE_ARCH_PTEP_MKDIRTY
+#define __HAVE_ARCH_PTE_SAME
+#include <asm-generic/pgtable.h>
+
 #endif /* _PARISC_PGTABLE_H */
diff -Nru a/include/asm-parisc/smp.h b/include/asm-parisc/smp.h
--- a/include/asm-parisc/smp.h	Tue Feb  3 19:45:37 2004
+++ b/include/asm-parisc/smp.h	Tue Feb  3 19:45:37 2004
@@ -54,7 +54,7 @@
 #define smp_processor_id()	(current_thread_info()->cpu)
 #define cpu_online(cpu) cpu_isset(cpu, cpu_online_map)
 
-#define cpu_possible(cpu)       cpu_isset(cpu, cpu_present_mask)
+#define cpu_possible_map	cpu_present_map
 
 #endif /* CONFIG_SMP */
 
diff -Nru a/include/asm-parisc/socket.h b/include/asm-parisc/socket.h
--- a/include/asm-parisc/socket.h	Tue Feb  3 19:45:33 2004
+++ b/include/asm-parisc/socket.h	Tue Feb  3 19:45:33 2004
@@ -45,6 +45,8 @@
 
 #define SO_ACCEPTCONN		0x401c
 
+#define SO_PEERSEC		0x401d
+
 #if defined(__KERNEL__)
 #define SOCK_STREAM	1	/* stream (connection) socket	*/
 #define SOCK_DGRAM	2	/* datagram (conn.less) socket	*/
diff -Nru a/include/asm-parisc/tlbflush.h b/include/asm-parisc/tlbflush.h
--- a/include/asm-parisc/tlbflush.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-parisc/tlbflush.h	Tue Feb  3 19:45:43 2004
@@ -27,7 +27,7 @@
 
 static inline void flush_tlb_mm(struct mm_struct *mm)
 {
-	if (mm == &init_mm) BUG(); /* Should never happen */
+	BUG_ON(mm == &init_mm); /* Should never happen */
 
 #ifdef CONFIG_SMP
 	flush_tlb_all();
diff -Nru a/include/asm-ppc/byteorder.h b/include/asm-ppc/byteorder.h
--- a/include/asm-ppc/byteorder.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc/byteorder.h	Tue Feb  3 19:45:17 2004
@@ -2,6 +2,7 @@
 #define _PPC_BYTEORDER_H
 
 #include <asm/types.h>
+#include <linux/compiler.h>
 
 #ifdef __GNUC__
 #ifdef __KERNEL__
@@ -32,7 +33,7 @@
 	__asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr));
 }
 
-static __inline__ __const__ __u16 ___arch__swab16(__u16 value)
+static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 value)
 {
 	__u16 result;
 
@@ -40,7 +41,7 @@
 	return result;
 }
 
-static __inline__ __const__ __u32 ___arch__swab32(__u32 value)
+static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 value)
 {
 	__u32 result;
 
diff -Nru a/include/asm-ppc/floppy.h b/include/asm-ppc/floppy.h
--- a/include/asm-ppc/floppy.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc/floppy.h	Tue Feb  3 19:45:17 2004
@@ -12,7 +12,7 @@
 #define __ASM_PPC_FLOPPY_H
 
 #define fd_inb(port)			inb_p(port)
-#define fd_outb(port,value)		outb_p(port,value)
+#define fd_outb(value,port)		outb_p(value,port)
 
 #define fd_enable_dma()         enable_dma(FLOPPY_DMA)
 #define fd_disable_dma()        disable_dma(FLOPPY_DMA)
diff -Nru a/include/asm-ppc/highmem.h b/include/asm-ppc/highmem.h
--- a/include/asm-ppc/highmem.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ppc/highmem.h	Tue Feb  3 19:45:42 2004
@@ -63,8 +63,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);
@@ -89,8 +88,7 @@
 	idx = type + KM_TYPE_NR*smp_processor_id();
 	vaddr = KMAP_FIX_BEGIN + idx * PAGE_SIZE;
 #if HIGHMEM_DEBUG
-	if (!pte_none(*(kmap_pte+idx)))
-		BUG();
+	BUG_ON(!pte_none(*(kmap_pte+idx)));
 #endif
 	set_pte(kmap_pte+idx, mk_pte(page, kmap_prot));
 	flush_tlb_page(0, vaddr);
@@ -110,8 +108,7 @@
 		return;
 	}
 
-	if (vaddr != KMAP_FIX_BEGIN + idx * PAGE_SIZE)
-		BUG();
+	BUG_ON(vaddr != KMAP_FIX_BEGIN + idx * PAGE_SIZE);
 
 	/*
 	 * force other mappings to Oops if they'll try to access
diff -Nru a/include/asm-ppc/ibm4xx.h b/include/asm-ppc/ibm4xx.h
--- a/include/asm-ppc/ibm4xx.h	Tue Feb  3 19:45:27 2004
+++ b/include/asm-ppc/ibm4xx.h	Tue Feb  3 19:45:27 2004
@@ -90,8 +90,6 @@
 #include <platforms/4xx/ocotea.h>
 #endif
 
-#endif /* CONFIG_40x */
-
 #ifndef __ASSEMBLY__
 /*
  * The "residual" board information structure the boot loader passes
@@ -99,6 +97,7 @@
  */
 extern bd_t __res;
 #endif
+#endif /* CONFIG_40x */
 
 #endif /* __ASM_IBM4XX_H__ */
 #endif /* __KERNEL__ */
diff -Nru a/include/asm-ppc/mpc8260.h b/include/asm-ppc/mpc8260.h
--- a/include/asm-ppc/mpc8260.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ppc/mpc8260.h	Tue Feb  3 19:45:16 2004
@@ -1,15 +1,36 @@
-/* This is the single file included by all MPC8260 build options.
+/*
  * Since there are many different boards and no standard configuration,
  * we have a unique include file for each.  Rather than change every
  * file that has to include MPC8260 configuration, they all include
  * this one and the configuration switching is done here.
  */
 #ifdef __KERNEL__
-#ifndef __CONFIG_8260_DEFS
-#define __CONFIG_8260_DEFS
+#ifndef __ASM_PPC_MPC8260_H__
+#define __ASM_PPC_MPC8260_H__
 
 #include <linux/config.h>
-#include <platforms/mpc82xx.h>
+
+#ifdef CONFIG_8260
+
+#ifdef CONFIG_EST8260
+#include <platforms/est8260.h>
+#endif
+
+#ifdef CONFIG_SBS8260
+#include <platforms/sbs8260.h>
+#endif
+
+#ifdef CONFIG_RPX6
+#include <platforms/rpxsuper.h>
+#endif
+
+#ifdef CONFIG_WILLOW
+#include <platforms/willow.h>
+#endif
+
+#ifdef CONFIG_TQM8260
+#include <platforms/tqm8260.h>
+#endif
 
 /* Make sure the memory translation stuff is there if PCI not used.
  */
@@ -34,10 +55,13 @@
 #define IO_VIRT_ADDR	IO_PHYS_ADDR
 #endif
 
+#ifndef __ASSEMBLY__
 /* The "residual" data board information structure the boot loader
  * hands to us.
  */
 extern unsigned char __res[];
+#endif
 
-#endif /* !__CONFIG_8260_DEFS */
+#endif /* CONFIG_8260 */
+#endif /* !__ASM_PPC_MPC8260_H__ */
 #endif /* __KERNEL__ */
diff -Nru a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h
--- a/include/asm-ppc/pci.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-ppc/pci.h	Tue Feb  3 19:45:34 2004
@@ -105,8 +105,7 @@
 static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
 				    size_t size, int direction)
 {
-	if (direction == PCI_DMA_NONE)
-		BUG();
+	BUG_ON(direction == PCI_DMA_NONE);
 	/* nothing to do */
 }
 
@@ -134,8 +133,7 @@
 static inline void pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address,
 				  size_t size, int direction)
 {
-	if (direction == PCI_DMA_NONE)
-		BUG();
+	BUG_ON(direction == PCI_DMA_NONE);
 	/* Nothing to do */
 }
 
@@ -159,8 +157,7 @@
 {
 	int i;
 
-	if (direction == PCI_DMA_NONE)
-		BUG();
+	BUG_ON(direction == PCI_DMA_NONE);
 
 	/*
 	 * temporary 2.4 hack
diff -Nru a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h
--- a/include/asm-ppc/pgtable.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc/pgtable.h	Tue Feb  3 19:45:17 2004
@@ -661,5 +661,14 @@
 typedef pte_t *pte_addr_t;
 
 #endif /* !__ASSEMBLY__ */
+
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
+#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
+#define __HAVE_ARCH_PTEP_SET_WRPROTECT
+#define __HAVE_ARCH_PTEP_MKDIRTY
+#define __HAVE_ARCH_PTE_SAME
+#include <asm-generic/pgtable.h>
+
 #endif /* _PPC_PGTABLE_H */
 #endif /* __KERNEL__ */
diff -Nru a/include/asm-ppc/smp.h b/include/asm-ppc/smp.h
--- a/include/asm-ppc/smp.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc/smp.h	Tue Feb  3 19:45:17 2004
@@ -48,7 +48,6 @@
 #define smp_processor_id() (current_thread_info()->cpu)
 
 #define cpu_online(cpu) cpu_isset(cpu, cpu_online_map)
-#define cpu_possible(cpu) cpu_isset(cpu, cpu_possible_map)
 
 extern int __cpu_up(unsigned int cpu);
 
diff -Nru a/include/asm-ppc/socket.h b/include/asm-ppc/socket.h
--- a/include/asm-ppc/socket.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc/socket.h	Tue Feb  3 19:45:17 2004
@@ -51,6 +51,8 @@
 
 #define SO_ACCEPTCONN		30
 
+#define SO_PEERSEC		31
+
 /* Nast libc5 fixup - bletch */
 #if defined(__KERNEL__)
 /* Socket types. */
diff -Nru a/include/asm-ppc/todc.h b/include/asm-ppc/todc.h
--- a/include/asm-ppc/todc.h	Tue Feb  3 19:45:35 2004
+++ b/include/asm-ppc/todc.h	Tue Feb  3 19:45:35 2004
@@ -290,8 +290,8 @@
 #define	TODC_TYPE_MC146818_SECONDS		0x00
 #define	TODC_TYPE_MC146818_CNTL_B		0x0a
 #define	TODC_TYPE_MC146818_CNTL_A		0x0b	/* control_a R/W regs */
-#define	TODC_TYPE_MC146818_WATCHDOG		0x0c
-#define	TODC_TYPE_MC146818_INTERRUPTS		0x0d
+#define	TODC_TYPE_MC146818_WATCHDOG		0
+#define	TODC_TYPE_MC146818_INTERRUPTS		0x0c
 #define	TODC_TYPE_MC146818_ALARM_DATE		0xff
 #define	TODC_TYPE_MC146818_ALARM_HOUR		0x05
 #define	TODC_TYPE_MC146818_ALARM_MINUTES	0x03
diff -Nru a/include/asm-ppc/uaccess.h b/include/asm-ppc/uaccess.h
--- a/include/asm-ppc/uaccess.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ppc/uaccess.h	Tue Feb  3 19:45:16 2004
@@ -60,8 +60,6 @@
 	unsigned long insn, fixup;
 };
 
-extern void sort_exception_table(void);
-
 /*
  * These are the main single-value transfer routines.  They automatically
  * use the right size if we just have the right pointer type.
diff -Nru a/include/asm-ppc/unistd.h b/include/asm-ppc/unistd.h
--- a/include/asm-ppc/unistd.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc/unistd.h	Tue Feb  3 19:45:17 2004
@@ -259,8 +259,9 @@
 #define __NR_statfs64		252
 #define __NR_fstatfs64		253
 #define __NR_fadvise64_64	254
+#define __NR_rtas		255
 
-#define __NR_syscalls		255
+#define __NR_syscalls		256
 
 #define __NR(n)	#n
 
diff -Nru a/include/asm-ppc64/bugs.h b/include/asm-ppc64/bugs.h
--- a/include/asm-ppc64/bugs.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ppc64/bugs.h	Tue Feb  3 19:45:42 2004
@@ -3,6 +3,10 @@
  * bugs.
  *
  */
+#ifndef _ASM_PPC64_BUGS_H
+#define _ASM_PPC64_BUGS_H
 
 static void check_bugs(void) {
 }
+
+#endif /* _ASM_PPC64_BUGS_H */
diff -Nru a/include/asm-ppc64/byteorder.h b/include/asm-ppc64/byteorder.h
--- a/include/asm-ppc64/byteorder.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-ppc64/byteorder.h	Tue Feb  3 19:45:43 2004
@@ -9,6 +9,7 @@
  */
 
 #include <asm/types.h>
+#include <linux/compiler.h>
 
 #ifdef __GNUC__
 #ifdef __KERNEL__
@@ -40,7 +41,7 @@
 }
 
 #if 0
-static __inline__ __const__ __u16 ___arch__swab16(__u16 value)
+static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 value)
 {
 	__u16 result;
 
@@ -50,7 +51,7 @@
 	return result;
 }
 
-static __inline__ __const__ __u32 ___arch__swab32(__u32 value)
+static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 value)
 {
 	__u32 result;
 
@@ -62,7 +63,7 @@
 	return result;
 }
 
-static __inline__ __const__ __u64 ___arch__swab64(__u64 value)
+static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 value)
 {
 	__u64 result;
 #error implement me
diff -Nru a/include/asm-ppc64/compat.h b/include/asm-ppc64/compat.h
--- a/include/asm-ppc64/compat.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/compat.h	Tue Feb  3 19:45:17 2004
@@ -53,11 +53,11 @@
 	compat_off_t	st_blksize;
 	compat_off_t	st_blocks;
 	compat_time_t	st_atime;
-	u32		__unused1;
+	u32		st_atime_nsec;
 	compat_time_t	st_mtime;
-	u32		__unused2;
+	u32		st_mtime_nsec;
 	compat_time_t	st_ctime;
-	u32		__unused3;
+	u32		st_ctime_nsec;
 	u32		__unused4[2];
 };
 
diff -Nru a/include/asm-ppc64/cputable.h b/include/asm-ppc64/cputable.h
--- a/include/asm-ppc64/cputable.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-ppc64/cputable.h	Tue Feb  3 19:45:34 2004
@@ -15,6 +15,8 @@
 #ifndef __ASM_PPC_CPUTABLE_H
 #define __ASM_PPC_CPUTABLE_H
 
+#include <linux/config.h>
+
 /* Exposed to userland CPU features - Must match ppc32 definitions */
 #define PPC_FEATURE_32			0x80000000
 #define PPC_FEATURE_64			0x40000000
@@ -74,10 +76,20 @@
 #define FW_FEATURE_COPY		(1UL<<4)	
 #define FW_FEATURE_ASR		(1UL<<5)	
 #define FW_FEATURE_DEBUG	(1UL<<6)	
-#define FW_FEATURE_PERF		(1UL<<7)	
-#define FW_FEATURE_DUMP		(1UL<<8)	
-#define FW_FEATURE_INTERRUPT	(1UL<<9)	
-#define FW_FEATURE_MIGRATE	(1UL<<10)	
+#define FW_FEATURE_TERM		(1UL<<7)	
+#define FW_FEATURE_PERF		(1UL<<8)	
+#define FW_FEATURE_DUMP		(1UL<<9)	
+#define FW_FEATURE_INTERRUPT	(1UL<<10)	
+#define FW_FEATURE_MIGRATE	(1UL<<11)	
+#define FW_FEATURE_PERFMON	(1UL<<12)	
+#define FW_FEATURE_CRQ   	(1UL<<13)	
+#define FW_FEATURE_VIO   	(1UL<<14)	
+#define FW_FEATURE_RDMA   	(1UL<<15)	
+#define FW_FEATURE_LLAN   	(1UL<<16)	
+#define FW_FEATURE_BULK   	(1UL<<17)	
+#define FW_FEATURE_XDABR   	(1UL<<18)	
+#define FW_FEATURE_MULTITCE   	(1UL<<19)	
+#define FW_FEATURE_SPLPAR   	(1UL<<20)	
 
 typedef struct {
     unsigned long val;
@@ -123,10 +135,17 @@
 #define COMMON_USER_PPC64	(PPC_FEATURE_32 | PPC_FEATURE_64 | \
 			         PPC_FEATURE_HAS_FPU | PPC_FEATURE_HAS_MMU)
 
-#define CPU_FTR_PPCAS_ARCH_V2   (CPU_FTR_SLB | CPU_FTR_16M_PAGE | \
+#define CPU_FTR_PPCAS_ARCH_V2_BASE (CPU_FTR_SLB | \
                                  CPU_FTR_TLBIEL | CPU_FTR_NOEXECUTE | \
                                  CPU_FTR_NODSISRALIGN)
 
+/* iSeries doesn't support large pages */
+#ifdef CONFIG_PPC_ISERIES
+#define CPU_FTR_PPCAS_ARCH_V2	(CPU_FTR_PPCAS_ARCH_V2_BASE)
+#else
+#define CPU_FTR_PPCAS_ARCH_V2	(CPU_FTR_PPCAS_ARCH_V2_BASE | CPU_FTR_16M_PAGE)
+#endif
+
 #define COMMON_PPC64_FW	(0)
 #endif
 
@@ -144,10 +163,23 @@
 	.llong 99b;	 		        \
 	.previous
 
-#define END_FTR_SECTION_IFSET(msk)	END_FTR_SECTION((msk), (msk))
-#define END_FTR_SECTION_IFCLR(msk)	END_FTR_SECTION((msk), 0)
+#else
+
+#define BEGIN_FTR_SECTION		"98:\n"
+#define END_FTR_SECTION(msk, val)		\
+"99:\n"						\
+"	.section __ftr_fixup,\"a\";\n"		\
+"	.align 3;\n"				\
+"	.llong "#msk";\n"			\
+"	.llong "#val";\n"			\
+"	.llong 98b;\n"			        \
+"	.llong 99b;\n"	 		        \
+"	.previous\n"
 
 #endif /* __ASSEMBLY__ */
+
+#define END_FTR_SECTION_IFSET(msk)	END_FTR_SECTION((msk), (msk))
+#define END_FTR_SECTION_IFCLR(msk)	END_FTR_SECTION((msk), 0)
 
 #endif /* __ASM_PPC_CPUTABLE_H */
 #endif /* __KERNEL__ */
diff -Nru a/include/asm-ppc64/elf.h b/include/asm-ppc64/elf.h
--- a/include/asm-ppc64/elf.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-ppc64/elf.h	Tue Feb  3 19:45:34 2004
@@ -1,6 +1,10 @@
 #ifndef __PPC64_ELF_H
 #define __PPC64_ELF_H
 
+#include <asm/types.h>
+#include <asm/ptrace.h>
+#include <asm/cputable.h>
+
 /* PowerPC relocations defined by the ABIs */
 #define R_PPC_NONE		0
 #define R_PPC_ADDR32		1	/* 32bit absolute address */
@@ -39,8 +43,39 @@
 #define R_PPC_SECTOFF_LO	34
 #define R_PPC_SECTOFF_HI	35
 #define R_PPC_SECTOFF_HA	36
+
+/* PowerPC relocations defined for the TLS access ABI.  */
+#define R_PPC_TLS		67 /* none	(sym+add)@tls */
+#define R_PPC_DTPMOD32		68 /* word32	(sym+add)@dtpmod */
+#define R_PPC_TPREL16		69 /* half16*	(sym+add)@tprel */
+#define R_PPC_TPREL16_LO	70 /* half16	(sym+add)@tprel@l */
+#define R_PPC_TPREL16_HI	71 /* half16	(sym+add)@tprel@h */
+#define R_PPC_TPREL16_HA	72 /* half16	(sym+add)@tprel@ha */
+#define R_PPC_TPREL32		73 /* word32	(sym+add)@tprel */
+#define R_PPC_DTPREL16		74 /* half16*	(sym+add)@dtprel */
+#define R_PPC_DTPREL16_LO	75 /* half16	(sym+add)@dtprel@l */
+#define R_PPC_DTPREL16_HI	76 /* half16	(sym+add)@dtprel@h */
+#define R_PPC_DTPREL16_HA	77 /* half16	(sym+add)@dtprel@ha */
+#define R_PPC_DTPREL32		78 /* word32	(sym+add)@dtprel */
+#define R_PPC_GOT_TLSGD16	79 /* half16*	(sym+add)@got@tlsgd */
+#define R_PPC_GOT_TLSGD16_LO	80 /* half16	(sym+add)@got@tlsgd@l */
+#define R_PPC_GOT_TLSGD16_HI	81 /* half16	(sym+add)@got@tlsgd@h */
+#define R_PPC_GOT_TLSGD16_HA	82 /* half16	(sym+add)@got@tlsgd@ha */
+#define R_PPC_GOT_TLSLD16	83 /* half16*	(sym+add)@got@tlsld */
+#define R_PPC_GOT_TLSLD16_LO	84 /* half16	(sym+add)@got@tlsld@l */
+#define R_PPC_GOT_TLSLD16_HI	85 /* half16	(sym+add)@got@tlsld@h */
+#define R_PPC_GOT_TLSLD16_HA	86 /* half16	(sym+add)@got@tlsld@ha */
+#define R_PPC_GOT_TPREL16	87 /* half16*	(sym+add)@got@tprel */
+#define R_PPC_GOT_TPREL16_LO	88 /* half16	(sym+add)@got@tprel@l */
+#define R_PPC_GOT_TPREL16_HI	89 /* half16	(sym+add)@got@tprel@h */
+#define R_PPC_GOT_TPREL16_HA	90 /* half16	(sym+add)@got@tprel@ha */
+#define R_PPC_GOT_DTPREL16	91 /* half16*	(sym+add)@got@dtprel */
+#define R_PPC_GOT_DTPREL16_LO	92 /* half16*	(sym+add)@got@dtprel@l */
+#define R_PPC_GOT_DTPREL16_HI	93 /* half16*	(sym+add)@got@dtprel@h */
+#define R_PPC_GOT_DTPREL16_HA	94 /* half16*	(sym+add)@got@dtprel@ha */
+
 /* Keep this the last entry.  */
-#define R_PPC_NUM		37
+#define R_PPC_NUM		95
 
 /*
  * ELF register definitions..
@@ -54,7 +89,8 @@
 
 #define ELF_NGREG	48	/* includes nip, msr, lr, etc. */
 #define ELF_NFPREG	33	/* includes fpscr */
-#define ELF_NVRREG	33	/* includes vscr */
+#define ELF_NVRREG32	33	/* includes vscr & vrsave stuffed together */
+#define ELF_NVRREG	34	/* includes vscr & vrsave in split vectors */
 
 typedef unsigned long elf_greg_t64;
 typedef elf_greg_t64 elf_gregset_t64[ELF_NGREG];
@@ -82,6 +118,27 @@
 typedef double elf_fpreg_t;
 typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
 
+/* Altivec registers */
+/*
+ * The entries with indexes 0-31 contain the corresponding vector registers. 
+ * The entry with index 32 contains the vscr as the last word (offset 12) 
+ * within the quadword.  This allows the vscr to be stored as either a 
+ * quadword (since it must be copied via a vector register to/from storage) 
+ * or as a word.  The entry with index 33 contains the vrsave as the first 
+ * word (offset 0) within the quadword.
+ *
+ * This definition of the VMX state is compatible with the current PPC32 
+ * ptrace interface.  This allows signal handling and ptrace to use the same 
+ * structures.  This also simplifies the implementation of a bi-arch 
+ * (combined (32- and 64-bit) gdb.
+ *
+ * Note that it's _not_ compatible with 32 bits ucontext which stuffs the
+ * vrsave along with vscr and so only uses 33 vectors for the register set
+ */
+typedef __vector128 elf_vrreg_t;
+typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
+typedef elf_vrreg_t elf_vrregset_t32[ELF_NVRREG32];
+
 /*
  * This is used to ensure we don't load something for the wrong architecture.
  */
@@ -128,13 +185,15 @@
 extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); 
 #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
 
+/* XXX Should we define the XFPREGS using altivec ??? */
+
 #endif
 
 /* This yields a mask that user programs can use to figure out what
    instruction set this cpu supports.  This could be done in userspace,
    but it's not easy, and we've already done it here.  */
 
-#define ELF_HWCAP	(0)
+#define ELF_HWCAP	(cur_cpu_spec->cpu_user_features)
 
 /* This yields a string that ld.so will use to load implementation
    specific libraries for optimization.  This is more specific in
@@ -272,7 +331,50 @@
 #define R_PPC64_TOC16_LO_DS    64 /* half16ds  #lo(S + A - .TOC.) >> 2.  */
 #define R_PPC64_PLTGOT16_DS    65 /* half16ds* (M + A) >> 2.  */
 #define R_PPC64_PLTGOT16_LO_DS 66 /* half16ds  #lo(M + A) >> 2.  */
+
+/* PowerPC64 relocations defined for the TLS access ABI.  */
+#define R_PPC64_TLS		67 /* none	(sym+add)@tls */
+#define R_PPC64_DTPMOD64	68 /* doubleword64 (sym+add)@dtpmod */
+#define R_PPC64_TPREL16		69 /* half16*	(sym+add)@tprel */
+#define R_PPC64_TPREL16_LO	70 /* half16	(sym+add)@tprel@l */
+#define R_PPC64_TPREL16_HI	71 /* half16	(sym+add)@tprel@h */
+#define R_PPC64_TPREL16_HA	72 /* half16	(sym+add)@tprel@ha */
+#define R_PPC64_TPREL64		73 /* doubleword64 (sym+add)@tprel */
+#define R_PPC64_DTPREL16	74 /* half16*	(sym+add)@dtprel */
+#define R_PPC64_DTPREL16_LO	75 /* half16	(sym+add)@dtprel@l */
+#define R_PPC64_DTPREL16_HI	76 /* half16	(sym+add)@dtprel@h */
+#define R_PPC64_DTPREL16_HA	77 /* half16	(sym+add)@dtprel@ha */
+#define R_PPC64_DTPREL64	78 /* doubleword64 (sym+add)@dtprel */
+#define R_PPC64_GOT_TLSGD16	79 /* half16*	(sym+add)@got@tlsgd */
+#define R_PPC64_GOT_TLSGD16_LO	80 /* half16	(sym+add)@got@tlsgd@l */
+#define R_PPC64_GOT_TLSGD16_HI	81 /* half16	(sym+add)@got@tlsgd@h */
+#define R_PPC64_GOT_TLSGD16_HA	82 /* half16	(sym+add)@got@tlsgd@ha */
+#define R_PPC64_GOT_TLSLD16	83 /* half16*	(sym+add)@got@tlsld */
+#define R_PPC64_GOT_TLSLD16_LO	84 /* half16	(sym+add)@got@tlsld@l */
+#define R_PPC64_GOT_TLSLD16_HI	85 /* half16	(sym+add)@got@tlsld@h */
+#define R_PPC64_GOT_TLSLD16_HA	86 /* half16	(sym+add)@got@tlsld@ha */
+#define R_PPC64_GOT_TPREL16_DS	87 /* half16ds*	(sym+add)@got@tprel */
+#define R_PPC64_GOT_TPREL16_LO_DS 88 /* half16ds (sym+add)@got@tprel@l */
+#define R_PPC64_GOT_TPREL16_HI	89 /* half16	(sym+add)@got@tprel@h */
+#define R_PPC64_GOT_TPREL16_HA	90 /* half16	(sym+add)@got@tprel@ha */
+#define R_PPC64_GOT_DTPREL16_DS	91 /* half16ds*	(sym+add)@got@dtprel */
+#define R_PPC64_GOT_DTPREL16_LO_DS 92 /* half16ds (sym+add)@got@dtprel@l */
+#define R_PPC64_GOT_DTPREL16_HI	93 /* half16	(sym+add)@got@dtprel@h */
+#define R_PPC64_GOT_DTPREL16_HA	94 /* half16	(sym+add)@got@dtprel@ha */
+#define R_PPC64_TPREL16_DS	95 /* half16ds*	(sym+add)@tprel */
+#define R_PPC64_TPREL16_LO_DS	96 /* half16ds	(sym+add)@tprel@l */
+#define R_PPC64_TPREL16_HIGHER	97 /* half16	(sym+add)@tprel@higher */
+#define R_PPC64_TPREL16_HIGHERA	98 /* half16	(sym+add)@tprel@highera */
+#define R_PPC64_TPREL16_HIGHEST	99 /* half16	(sym+add)@tprel@highest */
+#define R_PPC64_TPREL16_HIGHESTA 100 /* half16	(sym+add)@tprel@highesta */
+#define R_PPC64_DTPREL16_DS	101 /* half16ds* (sym+add)@dtprel */
+#define R_PPC64_DTPREL16_LO_DS	102 /* half16ds	(sym+add)@dtprel@l */
+#define R_PPC64_DTPREL16_HIGHER	103 /* half16	(sym+add)@dtprel@higher */
+#define R_PPC64_DTPREL16_HIGHERA 104 /* half16	(sym+add)@dtprel@highera */
+#define R_PPC64_DTPREL16_HIGHEST 105 /* half16	(sym+add)@dtprel@highest */
+#define R_PPC64_DTPREL16_HIGHESTA 106 /* half16	(sym+add)@dtprel@highesta */
+
 /* Keep this the last entry.  */
-#define R_PPC64_NUM		67
+#define R_PPC64_NUM		107
 
 #endif /* __PPC64_ELF_H */
diff -Nru a/include/asm-ppc64/floppy.h b/include/asm-ppc64/floppy.h
--- a/include/asm-ppc64/floppy.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-ppc64/floppy.h	Tue Feb  3 19:45:34 2004
@@ -13,7 +13,7 @@
 #include <linux/config.h>
 
 #define fd_inb(port)			inb_p(port)
-#define fd_outb(port,value)		outb_p(port,value)
+#define fd_outb(value,port)		outb_p(value,port)
 
 #define fd_enable_dma()         enable_dma(FLOPPY_DMA)
 #define fd_disable_dma()        disable_dma(FLOPPY_DMA)
diff -Nru a/include/asm-ppc64/hvcall.h b/include/asm-ppc64/hvcall.h
--- a/include/asm-ppc64/hvcall.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ppc64/hvcall.h	Tue Feb  3 19:45:16 2004
@@ -1,6 +1,9 @@
+#ifndef _PPC64_HVCALL_H
+#define _PPC64_HVCALL_H
 
 #define H_Success	0
 #define H_Busy		1	/* Hardware busy -- retry later */
+#define H_Constrained	4	/* Resource request constrained to max allowed */
 #define H_Hardware	-1	/* Hardware error */
 #define H_Function	-2	/* Function not supported */
 #define H_Privilege	-3	/* Caller not privileged */
@@ -9,6 +12,14 @@
 #define H_PTEG_Full	-6	/* PTEG is full */
 #define H_Not_Found	-7	/* PTE was not found" */
 #define H_Reserved_DABR	-8	/* DABR address is reserved by the hypervisor on this processor" */
+#define H_NoMem                 -9
+#define H_Authority            -10
+#define H_Permission           -11
+#define H_Dropped              -12
+#define H_SourceParm           -13
+#define H_DestParm             -14
+#define H_RemoteParm           -15
+#define H_Resource             -16
 
 /* Flags */
 #define H_LARGE_PAGE		(1UL<<(63-16))
@@ -58,6 +69,21 @@
 #define H_IPOLL			0x70
 #define H_XIRR			0x74
 #define H_PERFMON		0x7c
+#define H_MIGRATE_DMA		0x78
+#define H_REGISTER_VPA		0xDC
+#define H_CEDE		        0xE0
+#define H_CONFER		0xE4
+#define H_PROD		        0xE8
+#define H_GET_PPP		0xEC
+#define H_SET_PPP		0xF0
+#define H_SET_PURR		0xF4
+#define H_PIC		        0xF8
+#define H_REG_CRQ		0xFC
+#define H_FREE_CRQ		0x100
+#define H_VIO_SIGNAL		0x104
+#define H_SEND_CRQ		0x108
+#define H_COPY_RDMA             0x110
+#define H_POLL_PENDING	        0x1D8
 
 /* plpar_hcall() -- Generic call interface using above opcodes
  *
@@ -80,3 +106,39 @@
  * other than status.  Slightly more efficient.
  */
 long plpar_hcall_norets(unsigned long opcode, ...);
+
+/* 
+ * Special hcall interface for ibmveth support.
+ * Takes 8 input parms. Returns a rc and stores the
+ * R4 return value in *out1.
+ */
+long plpar_hcall_8arg_2ret(unsigned long opcode,
+			   unsigned long arg1,
+		  	   unsigned long arg2,
+			   unsigned long arg3,
+			   unsigned long arg4,
+			   unsigned long arg5,
+			   unsigned long arg6,
+			   unsigned long arg7,
+			   unsigned long arg8,
+			   unsigned long *out1);
+
+
+ 
+ 
+/* plpar_hcall_4out()
+ *
+ * same as plpar_hcall except with 4 output arguments.  
+ * 
+ */
+long plpar_hcall_4out(unsigned long opcode,
+		      unsigned long arg1,
+		      unsigned long arg2,
+		      unsigned long arg3,
+		      unsigned long arg4,
+		      unsigned long *out1,
+		      unsigned long *out2,
+		      unsigned long *out3,
+		      unsigned long *out4);
+
+#endif /* _PPC64_HVCALL_H */
diff -Nru a/include/asm-ppc64/hw_irq.h b/include/asm-ppc64/hw_irq.h
--- a/include/asm-ppc64/hw_irq.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ppc64/hw_irq.h	Tue Feb  3 19:45:42 2004
@@ -21,18 +21,15 @@
 
 #ifdef CONFIG_PPC_ISERIES
 
-extern void __no_use_sti(void);
-extern void __no_use_cli(void);
-extern void __no_use_restore_flags(unsigned long);
-extern unsigned long __no_use_save_flags(void);
-extern void __no_use_set_lost(unsigned long);
-extern void __no_lpq_restore_flags(unsigned long);
-
-#define local_irq_disable()			__no_use_cli()
-#define local_irq_enable()			__no_use_sti()
-#define local_save_flags(flags)	((flags) = __no_use_save_flags())
-#define local_irq_restore(flags)	__no_use_restore_flags((unsigned long)flags)
-#define local_irq_save(flags)	({local_save_flags(flags);local_irq_disable();})
+extern unsigned long local_get_flags(void);
+extern unsigned long local_irq_disable(void);
+extern void local_irq_restore(unsigned long);
+
+#define local_irq_enable()	local_irq_restore(1)
+#define local_save_flags(flags)	((flags) = local_get_flags())
+#define local_irq_save(flags)	((flags) = local_irq_disable())
+
+#define irqs_disabled()		(local_get_flags() == 0)
 
 #else
 
@@ -68,6 +65,13 @@
 }
 
 #define local_irq_save(flags)          __do_save_and_cli(&flags)
+
+#define irqs_disabled()				\
+({						\
+	unsigned long flags;			\
+	local_save_flags(flags);		\
+	!(flags & MSR_EE);			\
+})
 
 #endif /* CONFIG_PPC_ISERIES */
 
diff -Nru a/include/asm-ppc64/iSeries/HvCall.h b/include/asm-ppc64/iSeries/HvCall.h
--- a/include/asm-ppc64/iSeries/HvCall.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/iSeries/HvCall.h	Tue Feb  3 19:45:17 2004
@@ -23,25 +23,16 @@
 //	drive the hypervisor from the OS.
 //
 //===========================================================================
+#ifndef _HVCALL_H
+#define _HVCALL_H
 
 //-------------------------------------------------------------------
 // Standard Includes
 //-------------------------------------------------------------------
-#ifndef  _HVCALLSC_H
-#include "HvCallSc.h"
-#endif
-
-#ifndef  _HVTYPES_H
+#include <asm/iSeries/HvCallSc.h>
 #include <asm/iSeries/HvTypes.h>
-#endif
-
 #include <asm/paca.h>
 
-//-------------------------------------------------------------------
-// Constants
-//-------------------------------------------------------------------
-#ifndef _HVCALL_H
-#define _HVCALL_H
 /*
 enum HvCall_ReturnCode
 {
@@ -211,5 +202,4 @@
 	HvCall1(HvCallBaseSetDebugBus, val);
 }
 
-#endif // _HVCALL_H
-
+#endif /* _HVCALL_H */
diff -Nru a/include/asm-ppc64/iSeries/HvCallCfg.h b/include/asm-ppc64/iSeries/HvCallCfg.h
--- a/include/asm-ppc64/iSeries/HvCallCfg.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-ppc64/iSeries/HvCallCfg.h	Tue Feb  3 19:45:34 2004
@@ -23,23 +23,18 @@
 //	drive the hypervisor from the OS.
 //
 //=====================================================================================
+#ifndef _HVCALLCFG_H
+#define _HVCALLCFG_H
 
 //-------------------------------------------------------------------
 // Standard Includes
 //-------------------------------------------------------------------
-#ifndef  _HVCALLSC_H
-#include "HvCallSc.h"
-#endif
-
-#ifndef  _HVTYPES_H
+#include <asm/iSeries/HvCallSc.h>
 #include <asm/iSeries/HvTypes.h>
-#endif
 
 //-------------------------------------------------------------------------------------
 // Constants
 //-------------------------------------------------------------------------------------
-#ifndef _HVCALLCFG_H
-#define _HVCALLCFG_H
 
 enum HvCallCfg_ReqQual
 {
@@ -215,5 +210,4 @@
 
 }
 
-#endif // _HVCALLCFG_H
-
+#endif /* _HVCALLCFG_H */
diff -Nru a/include/asm-ppc64/iSeries/HvCallEvent.h b/include/asm-ppc64/iSeries/HvCallEvent.h
--- a/include/asm-ppc64/iSeries/HvCallEvent.h	Tue Feb  3 19:45:35 2004
+++ b/include/asm-ppc64/iSeries/HvCallEvent.h	Tue Feb  3 19:45:35 2004
@@ -17,44 +17,27 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-//==================================================================
-//
-//	This file contains the "hypervisor call" interface which is used to
-//	drive the hypervisor from the OS.
-//
-//==================================================================
-
-//-------------------------------------------------------------------
-// Standard Includes
-//-------------------------------------------------------------------
-#ifndef  _HVCALLSC_H
-#include <asm/iSeries/HvCallSc.h>
-#endif
+/*
+ *	This file contains the "hypervisor call" interface which is used to
+ *	drive the hypervisor from the OS.
+ */
+#ifndef _HVCALLEVENT_H
+#define _HVCALLEVENT_H
 
-#ifndef  _HVTYPES_H
+/*
+ * Standard Includes
+ */
+#include <asm/iSeries/HvCallSc.h>
 #include <asm/iSeries/HvTypes.h>
-#endif
-
 #include <asm/abs_addr.h>
 
-//-------------------------------------------------------------------
-// Other Includes
-//-------------------------------------------------------------------
-
-//-------------------------------------------------------------------
-// Constants
-//-------------------------------------------------------------------
-#ifndef _HVCALLEVENT_H
-#define _HVCALLEVENT_H
-
 struct HvLpEvent;
 
 typedef u8 HvLpEvent_Type;
 typedef u8 HvLpEvent_AckInd;
 typedef u8 HvLpEvent_AckType;
 
-struct	HvCallEvent_PackedParms
-{
+struct	HvCallEvent_PackedParms {
 	u8		xAckType:1;
 	u8		xAckInd:1;
 	u8		xRsvd:1;
@@ -68,8 +51,7 @@
 typedef u8 HvLpDma_Direction;
 typedef u8 HvLpDma_AddressType;
 
-struct	HvCallEvent_PackedDmaParms
-{
+struct	HvCallEvent_PackedDmaParms {
 	u8		xDirection:1;
 	u8		xLocalAddrType:1;
 	u8		xRemoteAddrType:1;
@@ -101,69 +83,63 @@
 #define HvCallEventSetLpEventQueueInterruptProc		HvCallEvent + 14
 #define HvCallEventRouter15				HvCallEvent + 15
 
-//======================================================================
-static inline void		HvCallEvent_getOverflowLpEvents(u8 queueIndex)
+static inline void HvCallEvent_getOverflowLpEvents(u8 queueIndex)
 {
 	HvCall1(HvCallEventGetOverflowLpEvents,queueIndex);
 	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
 }
-//======================================================================
-static inline void		HvCallEvent_setInterLpQueueIndex(u8 queueIndex)
+
+static inline void HvCallEvent_setInterLpQueueIndex(u8 queueIndex)
 {
 	HvCall1(HvCallEventSetInterLpQueueIndex,queueIndex);
 	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
 }
-//======================================================================
-static inline void		HvCallEvent_setLpEventStack(u8 queueIndex,
-					     char * eventStackAddr,
-					     u32 eventStackSize)
+
+static inline void HvCallEvent_setLpEventStack(u8 queueIndex,
+		char *eventStackAddr, u32 eventStackSize)
 {
 	u64 abs_addr;
-	abs_addr = virt_to_absolute( (unsigned long) eventStackAddr );
 
-	HvCall3(HvCallEventSetLpEventStack, queueIndex, abs_addr, eventStackSize);
+	abs_addr = virt_to_absolute((unsigned long)eventStackAddr);
+	HvCall3(HvCallEventSetLpEventStack, queueIndex, abs_addr,
+			eventStackSize);
 	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
 }
-//======================================================================
-static inline void		HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex,
-							  u16 lpLogicalProcIndex)
+
+static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex,
+		u16 lpLogicalProcIndex)
 {
-	HvCall2(HvCallEventSetLpEventQueueInterruptProc,queueIndex,lpLogicalProcIndex);
+	HvCall2(HvCallEventSetLpEventQueueInterruptProc, queueIndex,
+			lpLogicalProcIndex);
 	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
 }
-//=====================================================================
-static inline HvLpEvent_Rc HvCallEvent_signalLpEvent(struct HvLpEvent* event)
+
+static inline HvLpEvent_Rc HvCallEvent_signalLpEvent(struct HvLpEvent *event)
 {
 	u64 abs_addr;
 	HvLpEvent_Rc retVal;
+
 #ifdef DEBUG_SENDEVENT
-	printk("HvCallEvent_signalLpEvent: *event = %016lx\n ", (unsigned long)event);
+	printk("HvCallEvent_signalLpEvent: *event = %016lx\n ",
+			(unsigned long)event);
 #endif
-	abs_addr = virt_to_absolute( (unsigned long) event );
+	abs_addr = virt_to_absolute((unsigned long)event);
 	retVal = (HvLpEvent_Rc)HvCall1(HvCallEventSignalLpEvent, abs_addr);
 	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
 	return retVal;
 }
-//=====================================================================
-static inline HvLpEvent_Rc  HvCallEvent_signalLpEventFast(HvLpIndex targetLp,
-					   HvLpEvent_Type type,
-					   u16 subtype,
-					   HvLpEvent_AckInd ackInd,
-					   HvLpEvent_AckType ackType,
-					   HvLpInstanceId sourceInstanceId,
-					   HvLpInstanceId targetInstanceId,
-					   u64 correlationToken,
-					   u64 eventData1,
-					   u64 eventData2,
-					   u64 eventData3,
-					   u64 eventData4,
-					   u64 eventData5)
+
+static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp,
+		HvLpEvent_Type type, u16 subtype, HvLpEvent_AckInd ackInd,
+		HvLpEvent_AckType ackType, HvLpInstanceId sourceInstanceId,
+		HvLpInstanceId targetInstanceId, u64 correlationToken,
+		u64 eventData1, u64 eventData2, u64 eventData3,
+		u64 eventData4, u64 eventData5)
 {
 	HvLpEvent_Rc retVal;
 
 	// Pack the misc bits into a single Dword to pass to PLIC
-	union
-	{
+	union {
 		struct HvCallEvent_PackedParms	parms;
 		u64		dword;
 	} packed;
@@ -177,88 +153,84 @@
 	packed.parms.xTargetInstId	= targetInstanceId;
 
 	retVal = (HvLpEvent_Rc)HvCall7(HvCallEventSignalLpEventParms,
-				       packed.dword,
-				       correlationToken,
-				       eventData1,eventData2,
-				       eventData3,eventData4,
-				       eventData5);
+			packed.dword, correlationToken, eventData1,eventData2,
+			eventData3,eventData4, eventData5);
 	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
 	return retVal;
 }
-//====================================================================
-static inline HvLpEvent_Rc	HvCallEvent_ackLpEvent(struct HvLpEvent* event)
+
+static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event)
 {
 	u64 abs_addr;
 	HvLpEvent_Rc retVal;
-	abs_addr = virt_to_absolute( (unsigned long) event );
 
+	abs_addr = virt_to_absolute((unsigned long)event);
 	retVal = (HvLpEvent_Rc)HvCall1(HvCallEventAckLpEvent, abs_addr);
 	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
 	return retVal;
 }
-//====================================================================
-static inline HvLpEvent_Rc   HvCallEvent_cancelLpEvent(struct HvLpEvent* event)
+
+static inline HvLpEvent_Rc HvCallEvent_cancelLpEvent(struct HvLpEvent *event)
 {
 	u64 abs_addr;
 	HvLpEvent_Rc retVal;
-	abs_addr = virt_to_absolute( (unsigned long) event );
 
+	abs_addr = virt_to_absolute((unsigned long)event);
 	retVal = (HvLpEvent_Rc)HvCall1(HvCallEventCancelLpEvent, abs_addr);
 	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
 	return retVal;
 }
-//===================================================================
-static inline HvLpInstanceId	HvCallEvent_getSourceLpInstanceId(HvLpIndex targetLp, HvLpEvent_Type type)
+
+static inline HvLpInstanceId HvCallEvent_getSourceLpInstanceId(
+		HvLpIndex targetLp, HvLpEvent_Type type)
 {
 	HvLpInstanceId retVal;	
-	retVal = HvCall2(HvCallEventGetSourceLpInstanceId,targetLp,type);
+
+	retVal = HvCall2(HvCallEventGetSourceLpInstanceId, targetLp, type);
 	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
 	return retVal;
 }
-//===================================================================
-static inline HvLpInstanceId	HvCallEvent_getTargetLpInstanceId(HvLpIndex targetLp, HvLpEvent_Type type)
+
+static inline HvLpInstanceId HvCallEvent_getTargetLpInstanceId(
+		HvLpIndex targetLp, HvLpEvent_Type type)
 {
 	HvLpInstanceId retVal;	
-	retVal = HvCall2(HvCallEventGetTargetLpInstanceId,targetLp,type);
+
+	retVal = HvCall2(HvCallEventGetTargetLpInstanceId, targetLp, type);
 	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
 	return retVal;
 }
-//===================================================================
-static inline void		HvCallEvent_openLpEventPath(HvLpIndex targetLp,
-					     HvLpEvent_Type type)
+
+static inline void HvCallEvent_openLpEventPath(HvLpIndex targetLp,
+		HvLpEvent_Type type)
 {
-	HvCall2(HvCallEventOpenLpEventPath,targetLp,type);
+	HvCall2(HvCallEventOpenLpEventPath, targetLp, type);
 	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
 }
-//===================================================================
-static inline void		HvCallEvent_closeLpEventPath(HvLpIndex targetLp,
-					      HvLpEvent_Type type)
+
+static inline void HvCallEvent_closeLpEventPath(HvLpIndex targetLp,
+		HvLpEvent_Type type)
 {
-	HvCall2(HvCallEventCloseLpEventPath,targetLp,type);
+	HvCall2(HvCallEventCloseLpEventPath, targetLp, type);
 	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
 }
-//===================================================================
-static inline HvLpDma_Rc	HvCallEvent_dmaBufList(HvLpEvent_Type type,
-					HvLpIndex remoteLp,
-					HvLpDma_Direction direction,
-					HvLpInstanceId localInstanceId,
-					HvLpInstanceId remoteInstanceId,
-					HvLpDma_AddressType localAddressType,
-					HvLpDma_AddressType remoteAddressType,
-					// Do these need to be converted to
-					// absolute addresses?
-					u64 localBufList,
-					u64 remoteBufList,
 
-					u32 transferLength)
+static inline HvLpDma_Rc HvCallEvent_dmaBufList(HvLpEvent_Type type,
+		HvLpIndex remoteLp, HvLpDma_Direction direction,
+		HvLpInstanceId localInstanceId,
+		HvLpInstanceId remoteInstanceId,
+		HvLpDma_AddressType localAddressType,
+		HvLpDma_AddressType remoteAddressType,
+		/* Do these need to be converted to absolute addresses? */
+		u64 localBufList, u64 remoteBufList, u32 transferLength)
 {
-	HvLpDma_Rc retVal;	
+	HvLpDma_Rc retVal;
 	// Pack the misc bits into a single Dword to pass to PLIC
-	union
-	{
+	union {
 		struct HvCallEvent_PackedDmaParms	parms;
 		u64		dword;
 	} packed;
+
 	packed.parms.xDirection		= direction;
 	packed.parms.xLocalAddrType	= localAddressType;
 	packed.parms.xRemoteAddrType	= remoteAddressType;
@@ -270,32 +242,27 @@
 	packed.parms.xRemoteInstId	= remoteInstanceId;
 
 	retVal = (HvLpDma_Rc)HvCall4(HvCallEventDmaBufList,
-				     packed.dword,
-				     localBufList,
-				     remoteBufList,
-				     transferLength);
+			packed.dword, localBufList, remoteBufList,
+			transferLength);
 	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
 	return retVal;
 }
-//=================================================================
-static inline HvLpDma_Rc	HvCallEvent_dmaSingle(HvLpEvent_Type type,
-				       HvLpIndex remoteLp,
-				       HvLpDma_Direction direction,
-				       HvLpInstanceId localInstanceId,
-				       HvLpInstanceId remoteInstanceId,
-				       HvLpDma_AddressType localAddressType,
-				       HvLpDma_AddressType remoteAddressType,
-				       u64 localAddrOrTce,
-				       u64 remoteAddrOrTce,
-				       u32 transferLength)
+
+static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type,
+		HvLpIndex remoteLp, HvLpDma_Direction direction,
+		HvLpInstanceId localInstanceId,
+		HvLpInstanceId remoteInstanceId,
+		HvLpDma_AddressType localAddressType,
+		HvLpDma_AddressType remoteAddressType,
+		u64 localAddrOrTce, u64 remoteAddrOrTce, u32 transferLength)
 {
-	HvLpDma_Rc retVal;	
+	HvLpDma_Rc retVal;
 	// Pack the misc bits into a single Dword to pass to PLIC
-	union
-	{
+	union {
 		struct HvCallEvent_PackedDmaParms	parms;
 		u64		dword;
 	} packed;
+
 	packed.parms.xDirection		= direction;
 	packed.parms.xLocalAddrType	= localAddressType;
 	packed.parms.xRemoteAddrType	= remoteAddressType;
@@ -307,29 +274,24 @@
 	packed.parms.xRemoteInstId	= remoteInstanceId;
 
 	retVal = (HvLpDma_Rc)HvCall4(HvCallEventDmaSingle,
-				     packed.dword,
-				     localAddrOrTce,
-				     remoteAddrOrTce,
-				     transferLength);
+			packed.dword, localAddrOrTce, remoteAddrOrTce,
+			transferLength);
 	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
 	return retVal;
 }
-//=================================================================
-static inline HvLpDma_Rc	HvCallEvent_dmaToSp(void* local, u32 remote, u32 length, HvLpDma_Direction dir)
+
+static inline HvLpDma_Rc HvCallEvent_dmaToSp(void* local, u32 remote,
+		u32 length, HvLpDma_Direction dir)
 {
 	u64 abs_addr;
 	HvLpDma_Rc retVal;
-	abs_addr = virt_to_absolute( (unsigned long) local );
-    
-	retVal = (HvLpDma_Rc)HvCall4(HvCallEventDmaToSp, 
-				     abs_addr,
-				     remote,
-				     length,
-				     dir);
+
+	abs_addr = virt_to_absolute((unsigned long)local);
+	retVal = (HvLpDma_Rc)HvCall4(HvCallEventDmaToSp, abs_addr, remote,
+			length, dir);
 	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
 	return retVal;
 }
-//================================================================
 
-#endif // _HVCALLEVENT_H
 
+#endif /* _HVCALLEVENT_H */
diff -Nru a/include/asm-ppc64/iSeries/HvCallHpt.h b/include/asm-ppc64/iSeries/HvCallHpt.h
--- a/include/asm-ppc64/iSeries/HvCallHpt.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ppc64/iSeries/HvCallHpt.h	Tue Feb  3 19:45:16 2004
@@ -16,6 +16,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
+#ifndef _HVCALLHPT_H
+#define _HVCALLHPT_H
 
 //============================================================================
 //
@@ -24,30 +26,13 @@
 //
 //============================================================================
 
-//-------------------------------------------------------------------
-// Standard Includes
-//-------------------------------------------------------------------
-#ifndef  _HVCALLSC_H
-#include "HvCallSc.h"
-#endif
-
-#ifndef  _HVTYPES_H
+#include <asm/iSeries/HvCallSc.h>
 #include <asm/iSeries/HvTypes.h>
-#endif
-
-//-------------------------------------------------------------------
-// Other Includes
-//-------------------------------------------------------------------
-
-#ifndef _PPC_MMU_H
 #include <asm/mmu.h>
-#endif
 
 //-----------------------------------------------------------------------------
 // Constants
 //-----------------------------------------------------------------------------
-#ifndef _HVCALLHPT_H
-#define _HVCALLHPT_H
 
 #define HvCallHptGetHptAddress		HvCallHpt +  0
 #define HvCallHptGetHptPages		HvCallHpt +  1
@@ -139,5 +124,4 @@
 
 //=============================================================================
 
-#endif // _HVCALLHPT_H
-
+#endif /* _HVCALLHPT_H */
diff -Nru a/include/asm-ppc64/iSeries/HvCallPci.h b/include/asm-ppc64/iSeries/HvCallPci.h
--- a/include/asm-ppc64/iSeries/HvCallPci.h	Tue Feb  3 19:45:29 2004
+++ b/include/asm-ppc64/iSeries/HvCallPci.h	Tue Feb  3 19:45:29 2004
@@ -1,6 +1,6 @@
 /************************************************************************/
 /* Provides the Hypervisor PCI calls for iSeries Linux Parition.        */
-/* Copyright (C) 20yy  <Wayne G Holm> <IBM Corporation>                 */
+/* Copyright (C) 2001  <Wayne G Holm> <IBM Corporation>                 */
 /*                                                                      */
 /* This program is free software; you can redistribute it and/or modify */
 /* it under the terms of the GNU General Public License as published by */
@@ -21,50 +21,25 @@
 /* Change Activity:                                                     */
 /*   Created, Jan 9, 2001                                               */
 /************************************************************************/
-//============================================================================
-//							 Header File Id
-// Name______________:	HvCallPci.H
-//
-// Description_______:
-//
-//	This file contains the "hypervisor call" interface which is used to
-//	drive the hypervisor from SLIC.
-//
-//============================================================================
-
-//-------------------------------------------------------------------
-// Forward declarations 
-//-------------------------------------------------------------------
-
-//-------------------------------------------------------------------
-// Standard Includes
-//-------------------------------------------------------------------
-#ifndef  _HVCALLSC_H
-#include "HvCallSc.h"
-#endif
-
-#ifndef  _HVTYPES_H
-#include <asm/iSeries/HvTypes.h>
-#endif
-
-//-------------------------------------------------------------------
-// Other Includes
-//-------------------------------------------------------------------
-
 
-//-----------------------------------------------------------------------------
-// Constants
-//-----------------------------------------------------------------------------
 #ifndef _HVCALLPCI_H
 #define _HVCALLPCI_H
 
-struct HvCallPci_DsaAddr { // make sure this struct size is 64-bits total
-	u16		busNumber;
-	u8		subBusNumber; 
-	u8		deviceId;     
+#include <asm/iSeries/HvCallSc.h>
+#include <asm/iSeries/HvTypes.h>
+
+/*
+ * DSA == Direct Select Address
+ * this struct must be 64 bits in total
+ */
+struct HvCallPci_DsaAddr {
+	u16		busNumber;		/* PHB index? */
+	u8		subBusNumber; 		/* PCI bus number? */
+	u8		deviceId;     		/* device and function? */
 	u8		barNumber;
 	u8		reserved[3];
 };
+
 union HvDsaMap {
 	u64	DsaAddr;
 	struct HvCallPci_DsaAddr Dsa;
@@ -75,12 +50,13 @@
 	u64		value;
 };
 
-enum HvCallPci_DeviceType {HvCallPci_NodeDevice	= 1,
-                        HvCallPci_SpDevice	= 2,	
-                        HvCallPci_IopDevice     = 3,	
-                        HvCallPci_BridgeDevice	= 4,	
-                        HvCallPci_MultiFunctionDevice = 5,	
-                        HvCallPci_IoaDevice	= 6	
+enum HvCallPci_DeviceType {
+	HvCallPci_NodeDevice	= 1,
+	HvCallPci_SpDevice	= 2,	
+	HvCallPci_IopDevice     = 3,	
+	HvCallPci_BridgeDevice	= 4,	
+	HvCallPci_MultiFunctionDevice = 5,	
+	HvCallPci_IoaDevice	= 6	
 };
 
 
@@ -148,9 +124,9 @@
 #define HvCallPciGetBusUnitInfo		HvCallPci + 50
 
 //============================================================================
-static inline u64	HvCallPci_configLoad8(u16 busNumber, u8 subBusNumber,
-					      u8 deviceId, u32 offset,
-					      u8 *value)
+static inline u64 HvCallPci_configLoad8(u16 busNumber, u8 subBusNumber,
+					u8 deviceId, u32 offset,
+					u8 *value)
 {
 	struct HvCallPci_DsaAddr dsa;
 	struct HvCallPci_LoadReturn retVal;
@@ -170,9 +146,9 @@
 	return retVal.rc;
 }
 //============================================================================
-static inline u64	HvCallPci_configLoad16(u16 busNumber, u8 subBusNumber,
-					      u8 deviceId, u32 offset,
-					      u16 *value)
+static inline u64 HvCallPci_configLoad16(u16 busNumber, u8 subBusNumber,
+					 u8 deviceId, u32 offset,
+					 u16 *value)
 {
 	struct HvCallPci_DsaAddr dsa;
 	struct HvCallPci_LoadReturn retVal;
@@ -694,4 +670,4 @@
 	return xRetSize;
 }
 //============================================================================
-#endif // _HVCALLPCI_H
+#endif /* _HVCALLPCI_H */
diff -Nru a/include/asm-ppc64/iSeries/HvCallSc.h b/include/asm-ppc64/iSeries/HvCallSc.h
--- a/include/asm-ppc64/iSeries/HvCallSc.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/iSeries/HvCallSc.h	Tue Feb  3 19:45:17 2004
@@ -16,13 +16,10 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
-
-#ifndef  _HVTYPES_H
-#include <asm/iSeries/HvTypes.h>
-#endif
-
 #ifndef _HVCALLSC_H
 #define _HVCALLSC_H
+
+#include <asm/iSeries/HvTypes.h>
 
 #define HvCallBase		0x8000000000000000
 #define HvCallCc		0x8001000000000000
diff -Nru a/include/asm-ppc64/iSeries/HvCallSm.h b/include/asm-ppc64/iSeries/HvCallSm.h
--- a/include/asm-ppc64/iSeries/HvCallSm.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/iSeries/HvCallSm.h	Tue Feb  3 19:45:17 2004
@@ -16,6 +16,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
+#ifndef _HVCALLSM_H
+#define _HVCALLSM_H
 
 //============================================================================
 //
@@ -27,19 +29,12 @@
 //-------------------------------------------------------------------
 // Standard Includes
 //-------------------------------------------------------------------
-#ifndef  _HVCALLSC_H
-#include "HvCallSc.h"
-#endif
-
-#ifndef  _HVTYPES_H
+#include <asm/iSeries/HvCallSc.h>
 #include <asm/iSeries/HvTypes.h>
-#endif
 
 //-----------------------------------------------------------------------------
 // Constants
 //-----------------------------------------------------------------------------
-#ifndef _HVCALLSM_H
-#define _HVCALLSM_H
 
 #define HvCallSmGet64BitsOfAccessMap	HvCallSm  + 11
 
@@ -54,5 +49,4 @@
 	return retval;
 }
 //============================================================================
-#endif // _HVCALLSM_H
-
+#endif /* _HVCALLSM_H */
diff -Nru a/include/asm-ppc64/iSeries/HvCallXm.h b/include/asm-ppc64/iSeries/HvCallXm.h
--- a/include/asm-ppc64/iSeries/HvCallXm.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ppc64/iSeries/HvCallXm.h	Tue Feb  3 19:45:16 2004
@@ -8,6 +8,8 @@
 //	drive the hypervisor from SLIC.
 //
 //============================================================================
+#ifndef _HVCALLXM_H
+#define _HVCALLXM_H
 
 //-------------------------------------------------------------------
 // Forward declarations 
@@ -16,24 +18,12 @@
 //-------------------------------------------------------------------
 // Standard Includes
 //-------------------------------------------------------------------
-#ifndef  _HVCALLSC_H
-#include "HvCallSc.h"
-#endif
-
-#ifndef  _HVTYPES_H
+#include <asm/iSeries/HvCallSc.h>
 #include <asm/iSeries/HvTypes.h>
-#endif
-
-//-------------------------------------------------------------------
-// Other Includes
-//-------------------------------------------------------------------
-
 
 //-----------------------------------------------------------------------------
 // Constants
 //-----------------------------------------------------------------------------
-#ifndef _HVCALLXM_H
-#define _HVCALLXM_H
 
 #define HvCallXmGetTceTableParms	HvCallXm +  0
 #define HvCallXmTestBus			HvCallXm +  1
@@ -102,5 +92,4 @@
 }
 //=====================================================================================
 
-#endif // _HVCALLXM_H
-
+#endif /* _HVCALLXM_H */
diff -Nru a/include/asm-ppc64/iSeries/HvLpConfig.h b/include/asm-ppc64/iSeries/HvLpConfig.h
--- a/include/asm-ppc64/iSeries/HvLpConfig.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-ppc64/iSeries/HvLpConfig.h	Tue Feb  3 19:45:34 2004
@@ -16,6 +16,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
+#ifndef _HVLPCONFIG_H
+#define _HVLPCONFIG_H
 
 //===========================================================================
 //
@@ -24,24 +26,10 @@
 //
 //===========================================================================
 
-#ifndef  _HVCALLCFG_H
-#include "HvCallCfg.h"
-#endif
-
-#ifndef  _HVTYPES_H
+#include <asm/iSeries/HvCallCfg.h>
 #include <asm/iSeries/HvTypes.h>
-#endif
-
-#ifndef  _ITLPNACA_H
 #include <asm/iSeries/ItLpNaca.h>
-#endif
-
-#ifndef  _LPARDATA_H
 #include <asm/iSeries/LparData.h>
-#endif
-
-#ifndef _HVLPCONFIG_H
-#define _HVLPCONFIG_H
 
 //-------------------------------------------------------------------
 // Constants
@@ -289,4 +277,4 @@
 }
 //================================================================
 
-#endif // _HVLPCONFIG_H
+#endif /* _HVLPCONFIG_H */
diff -Nru a/include/asm-ppc64/iSeries/HvLpEvent.h b/include/asm-ppc64/iSeries/HvLpEvent.h
--- a/include/asm-ppc64/iSeries/HvLpEvent.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-ppc64/iSeries/HvLpEvent.h	Tue Feb  3 19:45:34 2004
@@ -28,10 +28,7 @@
 #include <asm/types.h>
 #include <asm/ptrace.h>
 #include <asm/iSeries/HvTypes.h>
-#ifndef _HVCALLEVENT_H
 #include <asm/iSeries/HvCallEvent.h>
-#endif
-
 
 //=====================================================================
 //
diff -Nru a/include/asm-ppc64/iSeries/HvReleaseData.h b/include/asm-ppc64/iSeries/HvReleaseData.h
--- a/include/asm-ppc64/iSeries/HvReleaseData.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-ppc64/iSeries/HvReleaseData.h	Tue Feb  3 19:45:43 2004
@@ -16,6 +16,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
+#ifndef _HVRELEASEDATA_H
+#define _HVRELEASEDATA_H
 
 //=============================================================================
 //
@@ -23,15 +25,7 @@
 //   release so that it can be changed in the future (ie, the virtual 
 //   address of the OS's NACA).
 //
-//-----------------------------------------------------------------------------
-// Standard Includes
-//-----------------------------------------------------------------------------
-#ifndef	_PPC64_TYPES_H
-#include	<asm/types.h>
-#endif
-
-#ifndef _HVRELEASEDATA_H
-#define _HVRELEASEDATA_H
+#include <asm/types.h>
 
 //=============================================================================
 //
@@ -67,4 +61,4 @@
 	char	xRsvd3[20];		// Reserved			x2C-x3F
 };
 
-#endif // _HVRELEASEDATA_H
+#endif /* _HVRELEASEDATA_H */
diff -Nru a/include/asm-ppc64/iSeries/HvTypes.h b/include/asm-ppc64/iSeries/HvTypes.h
--- a/include/asm-ppc64/iSeries/HvTypes.h	Tue Feb  3 19:45:41 2004
+++ b/include/asm-ppc64/iSeries/HvTypes.h	Tue Feb  3 19:45:41 2004
@@ -16,6 +16,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
+#ifndef _HVTYPES_H
+#define _HVTYPES_H
 
 //===========================================================================
 //                                                             Header File Id
@@ -29,13 +31,7 @@
 //
 //===========================================================================
 
-#ifndef _PPC_TYPES_H
-#include        <asm/types.h>
-#endif
-
-
-#ifndef _HVTYPES_H
-#define _HVTYPES_H
+#include <asm/types.h>
 
 //-------------------------------------------------------------------
 // Typedefs
@@ -124,4 +120,4 @@
 	u64 len;
 };
 
-#endif // _HVTYPES_H
+#endif /* _HVTYPES_H */
diff -Nru a/include/asm-ppc64/iSeries/IoHriProcessorVpd.h b/include/asm-ppc64/iSeries/IoHriProcessorVpd.h
--- a/include/asm-ppc64/iSeries/IoHriProcessorVpd.h	Tue Feb  3 19:45:28 2004
+++ b/include/asm-ppc64/iSeries/IoHriProcessorVpd.h	Tue Feb  3 19:45:28 2004
@@ -16,18 +16,15 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
+#ifndef _IOHRIPROCESSORVPD_H
+#define _IOHRIPROCESSORVPD_H
 
 //===================================================================
 //
 //	This struct maps Processor Vpd that is DMAd to SLIC by CSP 
 //
 
-#ifndef	_TYPES_H
 #include <asm/types.h>
-#endif
-
-#ifndef _IOHRIPROCESSORVPD_H
-#define _IOHRIPROCESSORVPD_H
 
 struct IoHriProcessorVpd
 {
@@ -87,4 +84,5 @@
 
 	char xProcSrc[72];		// CSP format SRC		xB8-xFF
 };
-#endif // _IOHRIPROCESSORVPD_H
+
+#endif /* _IOHRIPROCESSORVPD_H */
diff -Nru a/include/asm-ppc64/iSeries/ItExtVpdPanel.h b/include/asm-ppc64/iSeries/ItExtVpdPanel.h
--- a/include/asm-ppc64/iSeries/ItExtVpdPanel.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/iSeries/ItExtVpdPanel.h	Tue Feb  3 19:45:17 2004
@@ -16,6 +16,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
+#ifndef _ITEXTVPDPANEL_H
+#define _ITEXTVPDPANEL_H
 
 /*
  *
@@ -31,12 +33,8 @@
  * Standard Includes
  *------------------------------------------------------------------- 
 */
-#ifndef	_PPC_TYPES_H
-#include	<asm/types.h>
-#endif
+#include <asm/types.h>
 
-#ifndef _ITEXTVPDPANEL_H
-#define _ITEXTVPDPANEL_H
 struct ItExtVpdPanel
 {
   // Definition of the Extended Vpd On Panel Data Area
diff -Nru a/include/asm-ppc64/iSeries/ItIplParmsReal.h b/include/asm-ppc64/iSeries/ItIplParmsReal.h
--- a/include/asm-ppc64/iSeries/ItIplParmsReal.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-ppc64/iSeries/ItIplParmsReal.h	Tue Feb  3 19:45:34 2004
@@ -16,6 +16,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
+#ifndef _ITIPLPARMSREAL_H
+#define _ITIPLPARMSREAL_H
 
 //==============================================================================
 //
@@ -31,12 +33,7 @@
 //-------------------------------------------------------------------
 // Standard Includes
 //-------------------------------------------------------------------
-#ifndef	_PPC_TYPES_H
-#include	<asm/types.h>
-#endif
-
-#ifndef _ITIPLPARMSREAL_H
-#define _ITIPLPARMSREAL_H
+#include <asm/types.h>
 
 struct ItIplParmsReal
 {
@@ -75,4 +72,5 @@
 	u64	xRsvd12;		// Reserved				x30-x37
 	u64	xRsvd13;		// Reserved				x38-x3F
 };
-#endif // _ITIPLPARMSREAL_H
+
+#endif /* _ITIPLPARMSREAL_H */
diff -Nru a/include/asm-ppc64/iSeries/ItLpNaca.h b/include/asm-ppc64/iSeries/ItLpNaca.h
--- a/include/asm-ppc64/iSeries/ItLpNaca.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ppc64/iSeries/ItLpNaca.h	Tue Feb  3 19:45:16 2004
@@ -16,6 +16,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
+#ifndef _ITLPNACA_H
+#define _ITLPNACA_H
 
 //=============================================================================
 //
@@ -24,10 +26,6 @@
 //
 //=============================================================================
 
-
-#ifndef _ITLPNACA_H
-#define _ITLPNACA_H
-
 struct ItLpNaca
 {
 //=============================================================================
@@ -87,4 +85,4 @@
 
 //=============================================================================
 
-#endif // _ITLPNACA_H
+#endif /* _ITLPNACA_H */
diff -Nru a/include/asm-ppc64/iSeries/ItLpPaca.h b/include/asm-ppc64/iSeries/ItLpPaca.h
--- a/include/asm-ppc64/iSeries/ItLpPaca.h	Tue Feb  3 19:45:41 2004
+++ b/include/asm-ppc64/iSeries/ItLpPaca.h	Tue Feb  3 19:45:41 2004
@@ -16,6 +16,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
+#ifndef _ITLPPACA_H
+#define _ITLPPACA_H
 
 //=============================================================================
 //                                   
@@ -24,13 +26,7 @@
 //    
 //
 //----------------------------------------------------------------------------
-#ifndef  _PPC_TYPES_H
 #include <asm/types.h>
-#endif
-
-#ifndef _ITLPPACA_H
-#define _ITLPPACA_H
-
 
 struct ItLpPaca
 {
@@ -110,7 +106,10 @@
 	u64     xPDCSavedSPRG1;         // Saved SPRG1 for PMC int      x68-x6F
 	u64     xPDCSavedSRR0;          // Saved SRR0 for PMC int       x70-x77
 	volatile u32 xVirtualDecr;	// Virtual DECR for shared procsx78-x7B
-	u32	    xRsvd2_2;		// Reserved			x7C-x7F
+	u16     xSLBCount;              // # of SLBs to maintain        x7C-x7D
+	u8      xIdle;                  // Indicate OS is idle          x7E
+	u8      xRsvd2_2;               // Reserved                     x7F
+
 
 //=============================================================================
 // CACHE_LINE_3 0x0100 - 0x007F: This line is shared with other processors
@@ -131,4 +130,5 @@
 
 
 };
-#endif // _ITLPPACA_H
+
+#endif /* _ITLPPACA_H */
diff -Nru a/include/asm-ppc64/iSeries/ItLpQueue.h b/include/asm-ppc64/iSeries/ItLpQueue.h
--- a/include/asm-ppc64/iSeries/ItLpQueue.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-ppc64/iSeries/ItLpQueue.h	Tue Feb  3 19:45:34 2004
@@ -16,6 +16,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
+#ifndef _ITLPQUEUE_H
+#define _ITLPQUEUE_H
 
 //=============================================================================
 //
@@ -24,18 +26,11 @@
 //	events to an LP.  
 //    
 
-#ifndef _PPC_TYPES_H
 #include <asm/types.h>
-#endif
 #include <asm/ptrace.h>
 
-
 struct HvLpEvent;
 
-
-#ifndef _ITLPQUEUE_H
-#define _ITLPQUEUE_H
-
 #define ITMaxLpQueues 8
 
 #define NotUsed		0	// Queue will not be used by PLIC
@@ -94,6 +89,4 @@
 	: : : "r0", "r3" );	
 }
 
-
-//=============================================================================
-#endif // _ITLPQUEUE_H
+#endif /* _ITLPQUEUE_H */
diff -Nru a/include/asm-ppc64/iSeries/ItLpRegSave.h b/include/asm-ppc64/iSeries/ItLpRegSave.h
--- a/include/asm-ppc64/iSeries/ItLpRegSave.h	Tue Feb  3 19:45:33 2004
+++ b/include/asm-ppc64/iSeries/ItLpRegSave.h	Tue Feb  3 19:45:33 2004
@@ -16,6 +16,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
+#ifndef _ITLPREGSAVE_H
+#define _ITLPREGSAVE_H
 
 //=====================================================================================
 //
@@ -24,9 +26,6 @@
 //    
 //
 
-#ifndef _ITLPREGSAVE_H
-#define _ITLPREGSAVE_H
-
 struct ItLpRegSave
 {
 	u32	xDesc;		// Eye catcher  "LpRS" ebcdic	000-003
@@ -84,4 +83,5 @@
 
 	u8	xRsvd3[176];	// Reserved			350-3FF
 };
-#endif // _ITLPREGSAVE_H
+
+#endif /* _ITLPREGSAVE_H */
diff -Nru a/include/asm-ppc64/iSeries/ItVpdAreas.h b/include/asm-ppc64/iSeries/ItVpdAreas.h
--- a/include/asm-ppc64/iSeries/ItVpdAreas.h	Tue Feb  3 19:45:28 2004
+++ b/include/asm-ppc64/iSeries/ItVpdAreas.h	Tue Feb  3 19:45:28 2004
@@ -16,6 +16,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
+#ifndef _ITVPDAREAS_H
+#define _ITVPDAREAS_H
 
 //=====================================================================================
 //
@@ -23,13 +25,7 @@
 //	the OS from PLIC (most of which start from the SP).
 //
 
-#ifndef _PPC_TYPES_H
-#include        <asm/types.h>
-#endif
-
-
-#ifndef _ITVPDAREAS_H
-#define _ITVPDAREAS_H
+#include <asm/types.h>
 
 // VPD Entry index is carved in stone - cannot be changed (easily).
 #define ItVpdCecVpd				   0
@@ -97,4 +93,4 @@
 	void * xSlicVpdAdrs[ItVpdMaxEntries];// Array of VPD buffers	130-1EF
 };
 
-#endif // _ITVPDAREAS_H
+#endif /* _ITVPDAREAS_H */
diff -Nru a/include/asm-ppc64/iSeries/LparMap.h b/include/asm-ppc64/iSeries/LparMap.h
--- a/include/asm-ppc64/iSeries/LparMap.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/iSeries/LparMap.h	Tue Feb  3 19:45:17 2004
@@ -16,13 +16,10 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
-
-#ifndef	_PPC_TYPES_H
-#include	<asm/types.h>
-#endif
-
 #ifndef _LPARMAP_H
 #define _LPARMAP_H
+
+#include <asm/types.h>
 
 /* The iSeries hypervisor will set up mapping for one or more 
  * ESID/VSID pairs (in SLB/segment registers) and will set up
diff -Nru a/include/asm-ppc64/iSeries/iSeries_dma.h b/include/asm-ppc64/iSeries/iSeries_dma.h
--- a/include/asm-ppc64/iSeries/iSeries_dma.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ppc64/iSeries/iSeries_dma.h	Tue Feb  3 19:45:42 2004
@@ -21,9 +21,7 @@
 #define _ISERIES_DMA_H
 
 #include <asm/types.h>
-#ifndef __LINUX_SPINLOCK_H
 #include <linux/spinlock.h>
-#endif
 
 // NUM_TCE_LEVELS defines the largest contiguous block
 // of dma (tce) space we can get.  NUM_TCE_LEVELS = 10 
@@ -94,4 +92,4 @@
 
 extern void		 create_pci_bus_tce_table( unsigned busNumber );
 
-#endif // _ISERIES_DMA_H
+#endif /* _ISERIES_DMA_H */
diff -Nru a/include/asm-ppc64/iSeries/iSeries_io.h b/include/asm-ppc64/iSeries/iSeries_io.h
--- a/include/asm-ppc64/iSeries/iSeries_io.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ppc64/iSeries/iSeries_io.h	Tue Feb  3 19:45:42 2004
@@ -1,8 +1,9 @@
+#ifndef _ISERIES_IO_H
+#define _ISERIES_IO_H
+
 #include <linux/config.h>
 
 #ifdef CONFIG_PPC_ISERIES
-#ifndef _ISERIES_IO_H
-#define _ISERIES_IO_H
 #include <linux/types.h>
 /************************************************************************/
 /* File iSeries_io.h created by Allan Trautman on Thu Dec 28 2000.      */
@@ -41,6 +42,5 @@
 extern void* iSeries_memcpy_toio(void *dest, void *source, size_t n);
 extern void* iSeries_memcpy_fromio(void *dest, void *source, size_t n);
 
-#endif /*  _ISERIES_IO_H         */
-#endif /*  CONFIG_PPC_ISERIES  */
-
+#endif /* CONFIG_PPC_ISERIES */
+#endif /* _ISERIES_IO_H */
diff -Nru a/include/asm-ppc64/iSeries/iSeries_irq.h b/include/asm-ppc64/iSeries/iSeries_irq.h
--- a/include/asm-ppc64/iSeries/iSeries_irq.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-ppc64/iSeries/iSeries_irq.h	Tue Feb  3 19:45:43 2004
@@ -1,19 +1,11 @@
-
 #ifndef	__ISERIES_IRQ_H__
 #define	__ISERIES_IRQ_H__
 
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-unsigned int iSeries_startup_IRQ(unsigned int);
-void iSeries_shutdown_IRQ(unsigned int);
-void iSeries_enable_IRQ(unsigned int);
-void iSeries_disable_IRQ(unsigned int);
-void iSeries_end_IRQ(unsigned int);
 void iSeries_init_IRQ(void);
-void iSeries_init_irqMap(int);
 int  iSeries_allocate_IRQ(HvBusNumber, HvSubBusNumber, HvAgentId);
 int  iSeries_assign_IRQ(int, HvBusNumber, HvSubBusNumber, HvAgentId);
 void iSeries_activate_IRQs(void);
diff -Nru a/include/asm-ppc64/iSeries/iSeries_pci.h b/include/asm-ppc64/iSeries/iSeries_pci.h
--- a/include/asm-ppc64/iSeries/iSeries_pci.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/iSeries/iSeries_pci.h	Tue Feb  3 19:45:17 2004
@@ -1,10 +1,11 @@
 #ifndef _ISERIES_64_PCI_H
 #define _ISERIES_64_PCI_H
+
 /************************************************************************/
 /* File iSeries_pci.h created by Allan Trautman on Tue Feb 20, 2001.    */
 /************************************************************************/
 /* Define some useful macros for the iSeries pci routines.              */
-/* Copyright (C) 20yy  Allan H Trautman, IBM Corporation                */
+/* Copyright (C) 2001  Allan H Trautman, IBM Corporation                */
 /*                                                                      */
 /* This program is free software; you can redistribute it and/or modify */
 /* it under the terms of the GNU General Public License as published by */
@@ -28,77 +29,81 @@
 /*   Ported to ppc64, May 25, 2001                                      */
 /* End Change Activity                                                  */
 /************************************************************************/
+
 #include <asm/iSeries/HvCallPci.h>
 
 struct pci_dev;				/* For Forward Reference        */
 struct iSeries_Device_Node;
+
 /************************************************************************/
-/* Gets iSeries Bus, SubBus, of DevFn using pci_dev* structure          */
+/* Gets iSeries Bus, SubBus, DevFn using iSeries_Device_Node structure */
 /************************************************************************/
-#define ISERIES_BUS(DevPtr)    DevPtr->DsaAddr.busNumber
-#define ISERIES_SUBBUS(DevPtr) DevPtr->DsaAddr.subBusNumber
-#define ISERIES_DEVICE(DevPtr) DevPtr->DsaAddr.deviceId
-#define ISERIES_DEVFUN(DevPtr) DevPtr->DevFn
-#define ISERIES_DSA(DevPtr)   (*(u64*)&DevPtr->DsaAddr)
+
+#define ISERIES_BUS(DevPtr)	DevPtr->DsaAddr.Dsa.busNumber
+#define ISERIES_SUBBUS(DevPtr)	DevPtr->DsaAddr.Dsa.subBusNumber
+#define ISERIES_DEVICE(DevPtr)	DevPtr->DsaAddr.Dsa.deviceId
+#define ISERIES_DSA(DevPtr)	DevPtr->DsaAddr.DsaAddr
+#define ISERIES_DEVFUN(DevPtr)	DevPtr->DevFn
 #define ISERIES_DEVNODE(PciDev) ((struct iSeries_Device_Node*)PciDev->sysdata)
 
 #define EADsMaxAgents 7
-/************************************************************************************/
-/* Decodes Linux DevFn to iSeries DevFn, bridge device, or function.                */
-/* For Linux, see PCI_SLOT and PCI_FUNC in include/linux/pci.h                      */
-/************************************************************************************/
-#define ISERIES_DECODE_DEVFN(linuxdevfn)  (((linuxdevfn & 0x71) << 1) | (linuxdevfn & 0x07))
-#define ISERIES_DECODE_DEVICE(linuxdevfn) (((linuxdevfn & 0x38) >> 3) |(((linuxdevfn & 0x40) >> 2) + 0x10))
-#define ISERIES_DECODE_FUNCTION(linuxdevfn) (linuxdevfn & 0x07)
+
+/************************************************************************/
+/* Decodes Linux DevFn to iSeries DevFn, bridge device, or function.    */
+/* For Linux, see PCI_SLOT and PCI_FUNC in include/linux/pci.h          */
+/************************************************************************/
+
 #define ISERIES_PCI_AGENTID(idsel,func)	((idsel & 0x0F) << 4) | (func  & 0x07)
+#define ISERIES_ENCODE_DEVICE(agentid)	((0x10) | ((agentid&0x20)>>2) | (agentid&07))
 
 #define ISERIES_GET_DEVICE_FROM_SUBBUS(subbus)   ((subbus >> 5) & 0x7)
 #define ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus) ((subbus >> 2) & 0x7)
 
-#define ISERIES_ENCODE_DEVICE(agentid)	((0x10) | ((agentid&0x20)>>2) | (agentid&07))
-/************************************************************************************/
-/* Converts Virtual Address to Real Address for Hypervisor calls                    */
-/************************************************************************************/
-#define REALADDR(virtaddr)  (0x8000000000000000 | (virt_to_absolute((u64)virtaddr) ))
+/*
+ * N.B. the ISERIES_DECODE_* macros are not used anywhere, and I think
+ * the 0x71 (at least) must be wrong - 0x78 maybe?  -- paulus.
+ */
+#define ISERIES_DECODE_DEVFN(linuxdevfn)  (((linuxdevfn & 0x71) << 1) | (linuxdevfn & 0x07))
+#define ISERIES_DECODE_DEVICE(linuxdevfn) (((linuxdevfn & 0x38) >> 3) |(((linuxdevfn & 0x40) >> 2) + 0x10))
+#define ISERIES_DECODE_FUNCTION(linuxdevfn) (linuxdevfn & 0x07)
 
-/************************************************************************************/
-/* Define TRUE and FALSE Values for Al                                              */
-/************************************************************************************/
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
+/************************************************************************/
+/* Converts Virtual Address to Real Address for Hypervisor calls        */
+/************************************************************************/
+
+#define REALADDR(virtaddr)  (0x8000000000000000 | (virt_to_absolute((u64)virtaddr) ))
 
 /************************************************************************/
 /* iSeries Device Information                                           */
 /************************************************************************/
+
 struct iSeries_Device_Node {
-	struct list_head Device_List;    /* Must be first for cast to wo*/
-	struct pci_dev*  PciDev;         /* Pointer to pci_dev structure*/
-        struct HvCallPci_DsaAddr DsaAddr;/* Direct Select Address       */
-                                         /* busNumber,subBusNumber,     */ 
-	                                 /* deviceId, barNumber         */
-	HvAgentId        AgentId;	 /* Hypervisor DevFn            */
-	int              DevFn;          /* Linux devfn                 */
-	int              BarOffset;
-	int              Irq;            /* Assigned IRQ                */
-	int              ReturnCode;	 /* Return Code Holder          */
-	int              IoRetry;        /* Current Retry Count         */
-	int              Flags;          /* Possible flags(disable/bist)*/
-	u16              Vendor;         /* Vendor ID                   */
-	u8               LogicalSlot;    /* Hv Slot Index for Tces      */
-	struct TceTable* DevTceTable;    /* Device TCE Table            */ 
-	u8               PhbId;          /* Phb Card is on.             */
-	u16              Board;          /* Board Number                */
-	u8               FrameId;	 /* iSeries spcn Frame Id       */
-	char             CardLocation[4];/* Char format of planar vpd   */
-	char             Location[20];   /* Frame  1, Card C10          */
+	struct list_head Device_List;
+	struct pci_dev* PciDev;         /* Pointer to pci_dev structure*/
+        union HvDsaMap	DsaAddr;	/* Direct Select Address       */
+                                        /* busNumber,subBusNumber,     */ 
+	                                /* deviceId, barNumber         */
+	HvAgentId       AgentId;	/* Hypervisor DevFn            */
+	int             DevFn;          /* Linux devfn                 */
+	int             BarOffset;
+	int             Irq;            /* Assigned IRQ                */
+	int             ReturnCode;	/* Return Code Holder          */
+	int             IoRetry;        /* Current Retry Count         */
+	int             Flags;          /* Possible flags(disable/bist)*/
+	u16             Vendor;         /* Vendor ID                   */
+	u8              LogicalSlot;    /* Hv Slot Index for Tces      */
+	struct TceTable* DevTceTable;   /* Device TCE Table            */ 
+	u8              PhbId;          /* Phb Card is on.             */
+	u16             Board;          /* Board Number                */
+	u8              FrameId;	/* iSeries spcn Frame Id       */
+	char            CardLocation[4];/* Char format of planar vpd   */
+	char            Location[20];   /* Frame  1, Card C10          */
 };
+
 /************************************************************************/
 /* Location Data extracted from the VPD list and device info.           */
 /************************************************************************/
+
 struct LocationDataStruct { 	/* Location data structure for device  */
 	u16  Bus;               /* iSeries Bus Number              0x00*/
 	u16  Board;             /* iSeries Board                   0x02*/
@@ -108,17 +113,14 @@
 	u8   Card;
 	char CardLocation[4];      
 };
+
 typedef struct LocationDataStruct  LocationData;
 #define LOCATION_DATA_SIZE      48
-/************************************************************************/
-/* Flight Recorder tracing                                              */
-/************************************************************************/
-extern int  iSeries_Set_PciTraceFlag(int TraceFlag);
-extern int  iSeries_Get_PciTraceFlag(void);
 
 /************************************************************************/
 /* Functions                                                            */
 /************************************************************************/
+
 extern LocationData* iSeries_GetLocationData(struct pci_dev* PciDev);
 extern int           iSeries_Device_Information(struct pci_dev*,char*, int);
 extern void          iSeries_Get_Location_Code(struct iSeries_Device_Node*);
diff -Nru a/include/asm-ppc64/iSeries/iSeries_proc.h b/include/asm-ppc64/iSeries/iSeries_proc.h
--- a/include/asm-ppc64/iSeries/iSeries_proc.h	Tue Feb  3 19:45:33 2004
+++ b/include/asm-ppc64/iSeries/iSeries_proc.h	Tue Feb  3 19:45:33 2004
@@ -16,22 +16,15 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
-
-
-/* Change Activity: */
-/* End Change Activity */
-
 #ifndef _ISERIES_PROC_H
 #define _ISERIES_PROC_H
 
 #include <linux/proc_fs.h>
 
 extern void iSeries_proc_early_init(void);
-extern void iSeries_proc_create(void);
 
 typedef void (*iSeriesProcFunction)(struct proc_dir_entry *iSeries_proc);
 
 extern void iSeries_proc_callback(iSeriesProcFunction initFunction);
 
 #endif /* _iSeries_PROC_H */
-
diff -Nru a/include/asm-ppc64/iSeries/mf.h b/include/asm-ppc64/iSeries/mf.h
--- a/include/asm-ppc64/iSeries/mf.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/iSeries/mf.h	Tue Feb  3 19:45:17 2004
@@ -23,61 +23,50 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
-
 #ifndef MF_H_INCLUDED
 #define MF_H_INCLUDED
 
+#include <linux/proc_fs.h>
+
 #include <asm/iSeries/HvTypes.h>
 #include <asm/iSeries/HvLpEvent.h>
 
 struct rtc_time;
 
-typedef void (*MFCompleteHandler)( void * clientToken, int returnCode );
-
-extern void mf_allocateLpEvents( HvLpIndex targetLp,
-				 HvLpEvent_Type type,
-				 unsigned size,
-				 unsigned amount,
-				 MFCompleteHandler hdlr,
-				 void * userToken );
-
-extern void mf_deallocateLpEvents( HvLpIndex targetLp,
-				   HvLpEvent_Type type,
-				   unsigned count,
-				   MFCompleteHandler hdlr,
-				   void * userToken );
-
-extern void mf_powerOff( void );
-
-extern void mf_reboot( void );
-
-extern void mf_displaySrc( u32 word );
-extern void mf_displayProgress( u16 value );
+typedef void (*MFCompleteHandler)(void *clientToken, int returnCode);
 
-extern void mf_clearSrc( void );
+extern void mf_allocateLpEvents(HvLpIndex targetLp, HvLpEvent_Type type,
+		unsigned size, unsigned amount, MFCompleteHandler hdlr,
+		void *userToken);
+extern void mf_deallocateLpEvents(HvLpIndex targetLp, HvLpEvent_Type type,
+		unsigned count, MFCompleteHandler hdlr, void *userToken);
+
+extern void mf_powerOff(void);
+extern void mf_reboot(void);
+
+extern void mf_displaySrc(u32 word);
+extern void mf_displayProgress(u16 value);
+extern void mf_clearSrc(void);
 
-extern void mf_init( void );
+extern void mf_init(void);
 
 extern void mf_setSide(char side);
-
 extern char mf_getSide(void);
 
 extern void mf_setCmdLine(const char *cmdline, int size, u64 side);
-
 extern int  mf_getCmdLine(char *cmdline, int *size, u64 side);
 
 extern void mf_getSrcHistory(char *buffer, int size);
 
-extern int mf_setVmlinuxChunk(const char *buffer, int size, int offset, u64 side);
-
+extern int mf_setVmlinuxChunk(const char *buffer, int size, int offset,
+		u64 side);
 extern int mf_getVmlinuxChunk(char *buffer, int *size, int offset, u64 side);
 
 extern int mf_setRtcTime(unsigned long time);
-
 extern int mf_getRtcTime(unsigned long *time);
-
 extern int mf_getRtc( struct rtc_time * tm );
-
 extern int mf_setRtc( struct rtc_time * tm );
+
+extern void mf_proc_init(struct proc_dir_entry *iSeries_proc);
 
 #endif /* MF_H_INCLUDED */
diff -Nru a/include/asm-ppc64/iSeries/mf_proc.h b/include/asm-ppc64/iSeries/mf_proc.h
--- a/include/asm-ppc64/iSeries/mf_proc.h	Tue Feb  3 19:45:29 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,33 +0,0 @@
-/*
- * mf_proc.h
- * Copyright (C) 2001  Kyle A. Lucke IBM Corporation
- * 
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
- */
-
-
-/* Change Activity: */
-/* End Change Activity */
-
-#ifndef _MF_PROC_H
-#define _MF_PROC_H
-
-#include <linux/proc_fs.h>
-
-void mf_proc_init(struct proc_dir_entry *iSeries_proc);
-
-
-#endif /* _MF_PROC_H */
-
diff -Nru a/include/asm-ppc64/iSeries/veth-proc.h b/include/asm-ppc64/iSeries/veth-proc.h
--- a/include/asm-ppc64/iSeries/veth-proc.h	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,32 +0,0 @@
-/*
- * veth-proc.h
- * Copyright (C) 2001  Kyle A. Lucke IBM Corporation
- * 
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
- */
-
-
-/* Change Activity: */
-/* End Change Activity */
-
-#ifndef _VETH_PROC_H
-#define _VETH_PROC_H
-
-#include <linux/proc_fs.h>
-
-void veth_proc_init(struct proc_dir_entry *iSeries_proc);
-
-#endif /* _VETH-PROC_H */
-
diff -Nru a/include/asm-ppc64/iSeries/vio.h b/include/asm-ppc64/iSeries/vio.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-ppc64/iSeries/vio.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,129 @@
+/* -*- linux-c -*-
+ *  drivers/char/vio.h
+ *
+ *  iSeries Virtual I/O Message Path header
+ *
+ *  Authors: Dave Boutcher <boutcher@us.ibm.com>
+ *           Ryan Arnold <ryanarn@us.ibm.com>
+ *           Colin Devilbiss <devilbis@us.ibm.com>
+ *
+ * (C) Copyright 2000 IBM Corporation
+ * 
+ * This header file is used by the iSeries virtual I/O device
+ * drivers.  It defines the interfaces to the common functions
+ * (implemented in drivers/char/viopath.h) as well as defining
+ * common functions and structures.  Currently (at the time I 
+ * wrote this comment) the iSeries virtual I/O device drivers
+ * that use this are 
+ *   drivers/block/viodasd.c 
+ *   drivers/char/viocons.c
+ *   drivers/char/viotape.c
+ *   drivers/cdrom/viocd.c
+ *
+ * The iSeries virtual ethernet support (veth.c) uses a whole
+ * different set of functions.
+ * 
+ * This program is free software;  you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) anyu later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of 
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.  
+ *
+ * You should have received a copy of the GNU General Public License 
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+#ifndef _VIO_H
+#define _VIO_H
+
+#include <asm/iSeries/HvTypes.h>
+#include <asm/iSeries/HvLpEvent.h>
+
+/* iSeries virtual I/O events use the subtype field in
+ * HvLpEvent to figure out what kind of vio event is coming
+ * in.  We use a table to route these, and this defines
+ * the maximum number of distinct subtypes
+ */
+#define VIO_MAX_SUBTYPES 7
+
+/* Each subtype can register a handler to process their events.
+ * The handler must have this interface.
+ */
+typedef void (vio_event_handler_t) (struct HvLpEvent * event);
+
+int viopath_open(HvLpIndex remoteLp, int subtype, int numReq);
+int viopath_close(HvLpIndex remoteLp, int subtype, int numReq);
+int vio_setHandler(int subtype, vio_event_handler_t * beh);
+int vio_clearHandler(int subtype);
+int viopath_isactive(HvLpIndex lp);
+HvLpInstanceId viopath_sourceinst(HvLpIndex lp);
+HvLpInstanceId viopath_targetinst(HvLpIndex lp);
+void vio_set_hostlp(void);
+void *vio_get_event_buffer(int subtype);
+void vio_free_event_buffer(int subtype, void *buffer);
+
+extern HvLpIndex viopath_hostLp;
+extern HvLpIndex viopath_ourLp;
+
+#define VIO_MESSAGE "iSeries virtual I/O: "
+#define KERN_DEBUG_VIO KERN_DEBUG VIO_MESSAGE
+#define KERN_INFO_VIO KERN_INFO VIO_MESSAGE
+#define KERN_WARNING_VIO KERN_WARNING VIO_MESSAGE
+
+#define VIOCHAR_MAX_DATA 200
+
+#define VIOMAJOR_SUBTYPE_MASK 0xff00
+#define VIOMINOR_SUBTYPE_MASK 0x00ff
+#define VIOMAJOR_SUBTYPE_SHIFT 8
+
+#define VIOVERSION            0x0101
+
+/*
+This is the general structure for VIO errors; each module should have a table
+of them, and each table should be terminated by an entry of { 0, 0, NULL }.
+Then, to find a specific error message, a module should pass its local table
+and the return code.
+*/
+struct vio_error_entry {
+	u16 rc;
+	int errno;
+	const char *msg;
+};
+const struct vio_error_entry *vio_lookup_rc(const struct vio_error_entry
+					    *local_table, u16 rc);
+
+enum viosubtypes {
+	viomajorsubtype_monitor = 0x0100,
+	viomajorsubtype_blockio = 0x0200,
+	viomajorsubtype_chario = 0x0300,
+	viomajorsubtype_config = 0x0400,
+	viomajorsubtype_cdio = 0x0500,
+	viomajorsubtype_tape = 0x0600
+};
+
+
+enum vioconfigsubtype {
+	vioconfigget = 0x0001,
+};
+
+enum viorc {
+	viorc_good = 0x0000,
+	viorc_noConnection = 0x0001,
+	viorc_noReceiver = 0x0002,
+	viorc_noBufferAvailable = 0x0003,
+	viorc_invalidMessageType = 0x0004,
+	viorc_invalidRange = 0x0201,
+	viorc_invalidToken = 0x0202,
+	viorc_DMAError = 0x0203,
+	viorc_useError = 0x0204,
+	viorc_releaseError = 0x0205,
+	viorc_invalidDisk = 0x0206,
+	viorc_openRejected = 0x0301
+};
+
+#endif /* _VIO_H */
diff -Nru a/include/asm-ppc64/io.h b/include/asm-ppc64/io.h
--- a/include/asm-ppc64/io.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ppc64/io.h	Tue Feb  3 19:45:42 2004
@@ -120,11 +120,15 @@
  * Map in an area of physical address space, for accessing
  * I/O devices etc.
  */
+extern int __ioremap_explicit(unsigned long p_addr, unsigned long v_addr,
+		     	      unsigned long size, unsigned long flags);
 extern void *__ioremap(unsigned long address, unsigned long size,
 		       unsigned long flags);
 extern void *ioremap(unsigned long address, unsigned long size);
 #define ioremap_nocache(addr, size)	ioremap((addr), (size))
+extern int iounmap_explicit(void *addr, unsigned long size);
 extern void iounmap(void *addr);
+extern void * reserve_phb_iospace(unsigned long size);
 
 /*
  * Change virtual addresses to physical addresses and vv, for
diff -Nru a/include/asm-ppc64/irq.h b/include/asm-ppc64/irq.h
--- a/include/asm-ppc64/irq.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-ppc64/irq.h	Tue Feb  3 19:45:43 2004
@@ -41,11 +41,6 @@
 	return virt_irq_to_real_map[virt_irq];
 }
 
-/*
- * This gets called from serial.c, which is now used on
- * powermacs as well as prep/chrp boxes.
- * Prep and chrp both have cascaded 8259 PICs.
- */
 static __inline__ int irq_canonicalize(int irq)
 {
 	return irq;
diff -Nru a/include/asm-ppc64/machdep.h b/include/asm-ppc64/machdep.h
--- a/include/asm-ppc64/machdep.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/machdep.h	Tue Feb  3 19:45:17 2004
@@ -89,6 +89,12 @@
 	unsigned char	(*udbg_getc)(void);
 	int		(*udbg_getc_poll)(void);
 
+	/* Interface for platform error logging */
+	void 		(*log_error)(char *buf, unsigned int err_type, int fatal);
+
+	ssize_t		(*nvram_write)(char *buf, size_t count, loff_t *index);
+	ssize_t		(*nvram_read)(char *buf, size_t count, loff_t *index);	
+
 #ifdef CONFIG_SMP
 	/* functions for dealing with other cpus */
 	struct smp_ops_t smp_ops;
@@ -112,6 +118,12 @@
 void ppc64_attention_msg(unsigned int src, const char *msg);
 /* Print a dump progress message. */
 void ppc64_dump_msg(unsigned int src, const char *msg);
+
+static inline void log_error(char *buf, unsigned int err_type, int fatal)
+{
+	if (ppc_md.log_error)
+		ppc_md.log_error(buf, err_type, fatal);
+}
 
 #endif /* _PPC64_MACHDEP_H */
 #endif /* __KERNEL__ */
diff -Nru a/include/asm-ppc64/memory.h b/include/asm-ppc64/memory.h
--- a/include/asm-ppc64/memory.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-ppc64/memory.h	Tue Feb  3 19:45:43 2004
@@ -42,23 +42,28 @@
 #endif
 
 /* Macros for adjusting thread priority (hardware multi-threading) */
-
-#if defined(CONFIG_PPC_ISERIES) || defined(CONFIG_HMT)
+#define HMT_very_low()    asm volatile("or 31,31,31   # very low priority")
 #define HMT_low()	asm volatile("or 1,1,1		# low priority")
+#define HMT_medium_low()  asm volatile("or 6,6,6      # medium low priority")
 #define HMT_medium()	asm volatile("or 2,2,2		# medium priority")
+#define HMT_medium_high() asm volatile("or 5,5,5      # medium high priority")
 #define HMT_high()	asm volatile("or 3,3,3		# high priority")
 
+#define HMT_VERY_LOW    "\tor   31,31,31        # very low priority\n"
 #define HMT_LOW		"\tor	1,1,1		# low priority\n"
+#define HMT_MEDIUM_LOW  "\tor   6,6,6           # medium low priority\n"
 #define HMT_MEDIUM	"\tor	2,2,2		# medium priority\n"
+#define HMT_MEDIUM_HIGH "\tor   5,5,5           # medium high priority\n"
 #define HMT_HIGH	"\tor	3,3,3		# high priority\n"
-#else
-#define HMT_low()	do { } while(0)
-#define HMT_medium()	do { } while(0)
-#define HMT_high()	do { } while(0)
 
-#define HMT_LOW
-#define HMT_MEDIUM
-#define HMT_HIGH
-#endif
+/* 
+ * Various operational modes for SMT
+ * Off    : never run threaded
+ * On     : always run threaded
+ * Dynamic: Allow the system to switch modes as needed
+ */
+#define SMT_OFF      0
+#define SMT_ON       1
+#define SMT_DYNAMIC  2
 
 #endif
diff -Nru a/include/asm-ppc64/mmu.h b/include/asm-ppc64/mmu.h
--- a/include/asm-ppc64/mmu.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-ppc64/mmu.h	Tue Feb  3 19:45:34 2004
@@ -13,6 +13,9 @@
 #ifndef _PPC64_MMU_H_
 #define _PPC64_MMU_H_
 
+#include <linux/config.h>
+#include <asm/page.h>
+
 #ifndef __ASSEMBLY__
 
 /* Default "unsigned long" context */
@@ -25,14 +28,6 @@
 #endif
 
 /*
- * Define the size of the cache used for segment table entries.  The first
- * entry is used as a cache pointer, therefore the actual number of entries
- * stored is one less than defined here.  Do not change this value without
- * considering the impact it will have on the layout of the paca in paca.h.
- */
-#define STAB_CACHE_SIZE 16
-
-/*
  * Hardware Segment Lookaside Buffer Entry
  * This structure has been padded out to two 64b doublewords (actual SLBE's are
  * 94 bits).  This padding facilites use by the segment management
@@ -202,28 +197,58 @@
 	return (vsid & 0x7fffffffff) ^ page;
 }
 
-static inline void _tlbie(unsigned long va, int large)
+static inline void __tlbie(unsigned long va, int large)
 {
-	asm volatile("ptesync": : :"memory");
+	/* clear top 16 bits, non SLS segment */
+	va &= ~(0xffffULL << 48);
 
-	if (large) {
-		asm volatile("clrldi	%0,%0,16\n\
-			      tlbie	%0,1" : : "r"(va) : "memory");
-	} else {
-		asm volatile("clrldi	%0,%0,16\n\
-			      tlbie	%0,0" : : "r"(va) : "memory");
-	}
+	if (large)
+		asm volatile("tlbie %0,1" : : "r"(va) : "memory");
+	else
+		asm volatile("tlbie %0,0" : : "r"(va) : "memory");
+}
 
+static inline void tlbie(unsigned long va, int large)
+{
+	asm volatile("ptesync": : :"memory");
+	__tlbie(va, large);
 	asm volatile("eieio; tlbsync; ptesync": : :"memory");
 }
 
-static inline void _tlbiel(unsigned long va)
+static inline void __tlbiel(unsigned long va)
+{
+	/* clear top 16 bits, non SLS segment */
+	va &= ~(0xffffULL << 48);
+
+	/* 
+	 * Thanks to Alan Modra we are now able to use machine specific 
+	 * assembly instructions (like tlbiel) by using the gas -many flag.
+	 * However we have to support older toolchains so for the moment 
+	 * we hardwire it.
+	 */
+#if 0
+	asm volatile("tlbiel %0" : : "r"(va) : "memory");
+#else
+	asm volatile(".long 0x7c000224 | (%0 << 11)" : : "r"(va) : "memory");
+#endif
+}
+
+static inline void tlbiel(unsigned long va)
 {
 	asm volatile("ptesync": : :"memory");
-	asm volatile("clrldi	%0,%0,16\n\
-		      tlbiel	%0" : : "r"(va) : "memory");
+	__tlbiel(va);
 	asm volatile("ptesync": : :"memory");
 }
+
+/*
+ * Handle a fault by adding an HPTE. If the address can't be determined
+ * to be valid via Linux page tables, return 1. If handled return 0
+ */
+extern int __hash_page(unsigned long ea, unsigned long access,
+		       unsigned long vsid, pte_t *ptep, unsigned long trap,
+		       int local);
+
+extern void htab_finish_init(void);
 
 #endif /* __ASSEMBLY__ */
 
diff -Nru a/include/asm-ppc64/mmu_context.h b/include/asm-ppc64/mmu_context.h
--- a/include/asm-ppc64/mmu_context.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/mmu_context.h	Tue Feb  3 19:45:17 2004
@@ -1,11 +1,13 @@
 #ifndef __PPC64_MMU_CONTEXT_H
 #define __PPC64_MMU_CONTEXT_H
 
+#include <linux/config.h>
 #include <linux/spinlock.h>	
 #include <linux/kernel.h>	
 #include <linux/mm.h>	
 #include <asm/mmu.h>	
 #include <asm/ppcdebug.h>	
+#include <asm/cputable.h>
 
 /*
  * Copyright (C) 2001 PPC 64 Team, IBM Corp
@@ -80,6 +82,8 @@
 {
 	long head;
 	unsigned long flags;
+	/* This does the right thing across a fork (I hope) */
+	unsigned long low_hpages = mm->context & CONTEXT_LOW_HPAGES;
 
 	spin_lock_irqsave(&mmu_context_queue.lock, flags);
 
@@ -90,6 +94,7 @@
 
 	head = mmu_context_queue.head;
 	mm->context = mmu_context_queue.elements[head];
+	mm->context |= low_hpages;
 
 	head = (head < LAST_USER_CONTEXT-1) ? head+1 : 0;
 	mmu_context_queue.head = head;
@@ -134,16 +139,31 @@
 }
 
 extern void flush_stab(struct task_struct *tsk, struct mm_struct *mm);
+extern void flush_slb(struct task_struct *tsk, struct mm_struct *mm);
 
 /*
  * switch_mm is the entry point called from the architecture independent
  * code in kernel/sched.c
  */
-static inline void
-switch_mm(struct mm_struct *prev, struct mm_struct *next,
-	  struct task_struct *tsk)
+static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
+			     struct task_struct *tsk)
 {
-	flush_stab(tsk, next);
+#ifdef CONFIG_ALTIVEC
+	asm volatile (
+ BEGIN_FTR_SECTION
+	"dssall;\n"
+ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
+	 : : );
+#endif /* CONFIG_ALTIVEC */
+
+	/* No need to flush userspace segments if the mm doesnt change */
+	if (prev == next)
+		return;
+
+	if (cur_cpu_spec->cpu_features & CPU_FTR_SLB)
+		flush_slb(tsk, next);
+	else
+		flush_stab(tsk, next);
 	cpu_set(smp_processor_id(), next->cpu_vm_mask);
 }
 
diff -Nru a/include/asm-ppc64/naca.h b/include/asm-ppc64/naca.h
--- a/include/asm-ppc64/naca.h	Tue Feb  3 19:45:18 2004
+++ b/include/asm-ppc64/naca.h	Tue Feb  3 19:45:18 2004
@@ -37,7 +37,12 @@
 	u32 dCacheL1LinesPerPage;	/* L1 d-cache lines / page   0x64 */
 	u32 iCacheL1LogLineSize;	/* L1 i-cache line size Log2 0x68 */
 	u32 iCacheL1LinesPerPage;	/* L1 i-cache lines / page   0x6c */
-	u64 resv0[2];                   /* Reserved           0x70 - 0x7F */
+	u64 smt_snooze_delay;           /* Delay (in usec) before    0x70 */
+                                        /* entering ST mode               */
+	u8  smt_state;                  /* 0 = SMT off               0x78 */
+	                                /* 1 = SMT on                     */
+	                                /* 2 = SMT dynamic                */
+	u8  resv0[7];                   /* Reserved           0x70 - 0x7F */
 };
 
 extern struct naca_struct *naca;
diff -Nru a/include/asm-ppc64/nvram.h b/include/asm-ppc64/nvram.h
--- a/include/asm-ppc64/nvram.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/nvram.h	Tue Feb  3 19:45:17 2004
@@ -11,6 +11,12 @@
 #ifndef _PPC64_NVRAM_H
 #define _PPC64_NVRAM_H
 
+#define NVRW_CNT 0x20
+#define NVRAM_HEADER_LEN 16 /* sizeof(struct nvram_header) */
+#define NVRAM_BLOCK_LEN 16
+#define NVRAM_MAX_REQ (2080/NVRAM_BLOCK_LEN)
+#define NVRAM_MIN_REQ (1056/NVRAM_BLOCK_LEN)
+
 #define NVRAM_AS0  0x74
 #define NVRAM_AS1  0x75
 #define NVRAM_DATA 0x77
@@ -27,5 +33,38 @@
 #define MOTO_RTC_YEAR		0x1FFF
 #define MOTO_RTC_CONTROLA       0x1FF8
 #define MOTO_RTC_CONTROLB       0x1FF9
+
+#define NVRAM_SIG_SP	0x02	/* support processor */
+#define NVRAM_SIG_OF	0x50	/* open firmware config */
+#define NVRAM_SIG_FW	0x51	/* general firmware */
+#define NVRAM_SIG_HW	0x52	/* hardware (VPD) */
+#define NVRAM_SIG_SYS	0x70	/* system env vars */
+#define NVRAM_SIG_CFG	0x71	/* config data */
+#define NVRAM_SIG_ELOG	0x72	/* error log */
+#define NVRAM_SIG_VEND	0x7e	/* vendor defined */
+#define NVRAM_SIG_FREE	0x7f	/* Free space */
+#define NVRAM_SIG_OS	0xa0	/* OS defined */
+
+/* If change this size, then change the size of NVNAME_LEN */
+struct nvram_header {
+	unsigned char signature;
+	unsigned char checksum;
+	unsigned short length;
+	char name[12];
+};
+
+struct nvram_partition {
+	struct list_head partition;
+	struct nvram_header header;
+	unsigned int index;
+};
+
+
+ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index);
+ssize_t pSeries_nvram_write(char *buf, size_t count, loff_t *index);
+int nvram_write_error_log(char * buff, int length, unsigned int err_type);
+int nvram_read_error_log(char * buff, int length, unsigned int * err_type);
+int nvram_clear_error_log(void);
+void nvram_print_partitions(char * label);
 
 #endif /* _PPC64_NVRAM_H */
diff -Nru a/include/asm-ppc64/paca.h b/include/asm-ppc64/paca.h
--- a/include/asm-ppc64/paca.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/paca.h	Tue Feb  3 19:45:17 2004
@@ -61,22 +61,17 @@
 	struct ItLpRegSave *xLpRegSavePtr; /* Pointer to LpRegSave for PLIC	0x08 */
 	u64 xCurrent;  		        /* Pointer to current			0x10 */
 	u16 xPacaIndex;			/* Logical processor number		0x18 */
-	u16 active;			/* Is this cpu active?			0x1a */
+        u16 xHwProcNum;                 /* Physical processor number            0x1A */
 	u32 default_decr;		/* Default decrementer value		0x1c */	
-	u64 unused1;
-	u64 xKsave;			/* Saved Kernel stack addr or zero	0x28 */
-	u64 pvr;			/* Processor version register		0x30 */
-	u8 *exception_sp;		/*					0x38 */
-
-	struct ItLpQueue *lpQueuePtr;	/* LpQueue handled by this processor    0x40 */
-	u64  xTOC;			/* Kernel TOC address			0x48 */
-	STAB xStab_data;		/* Segment table information		0x50,0x58,0x60 */
-	u8 xSegments[STAB_CACHE_SIZE];	/* Cache of used stab entries		0x68,0x70 */
-	u8 xProcEnabled;		/* 1=soft enabled			0x78 */
-	u8 unused2;
-	u8 prof_enabled;		/* 1=iSeries profiling enabled          0x7A */
-	u8 stab_cache_pointer;	
-	u8 resv1[4];			/*					0x7B-0x7F */
+	u64 xKsave;			/* Saved Kernel stack addr or zero	0x20 */
+	u64 pvr;			/* Processor version register		0x28 */
+	struct ItLpQueue *lpQueuePtr;	/* LpQueue handled by this processor    0x30 */
+	u64  xTOC;			/* Kernel TOC address			0x38 */
+	STAB xStab_data;		/* Segment table information		0x40,0x48,0x50 */
+	u8 *exception_sp;		/*                                      0x58 */
+	u8 xProcEnabled;		/*                                      0x59 */
+	u8 prof_enabled;		/* 1=iSeries profiling enabled          0x60 */
+	u8 resv1[30];			/*					0x61-0x7F */
 
 /*=====================================================================================
  * CACHE_LINE_2 0x0080 - 0x00FF
@@ -94,7 +89,9 @@
 	u32 *prof_buffer;		/* iSeries profiling buffer		0x38 */
 	u32 *prof_stext;		/* iSeries start of kernel text		0x40 */
 	u32 prof_len;			/* iSeries length of profile buffer -1	0x48 */
-	u8  rsvd2[128-76];		/*					0x4C */
+	u8  yielded;                    /* 0 = this processor is running        0x4c */
+	                                /* 1 = this processor is yielded             */
+	u8  rsvd2[128-77];		/*					0x49 */
 
 /*=====================================================================================
  * CACHE_LINE_3 0x0100 - 0x017F
@@ -117,7 +114,7 @@
 	struct ItLpRegSave xRegSav;	/* Register save for proc */
 
 /*=====================================================================================
- * CACHE_LINE_17-18 0x0800 - 0x0EFF Reserved
+ * CACHE_LINE_17-18 0x0800 - 0x08FF Reserved
  *=====================================================================================
  */
 	struct rtas_args xRtas;		/* Per processor RTAS struct */
@@ -126,10 +123,12 @@
 	u8 rsvd5[256-16-sizeof(struct rtas_args)];
 
 /*=====================================================================================
- * CACHE_LINE_19-30 0x0800 - 0x0EFF Reserved
+ * CACHE_LINE_19-30 0x0900 - 0x0EFF Reserved
  *=====================================================================================
  */
-	u8 rsvd6[0x600];
+	u64 slb_shadow[0x20];
+	u64 dispatch_log;
+	u8  rsvd6[0x500 - 0x8];
 
 /*=====================================================================================
  * CACHE_LINE_31 0x0F00 - 0x0F7F Exception stack
diff -Nru a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h
--- a/include/asm-ppc64/pci.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/pci.h	Tue Feb  3 19:45:17 2004
@@ -65,8 +65,7 @@
 				       dma_addr_t dma_handle,
 				       size_t size, int direction)
 {
-	if (direction == PCI_DMA_NONE)
-		BUG();
+	BUG_ON(direction == PCI_DMA_NONE);
 	/* nothing to do */
 }
 
@@ -74,8 +73,7 @@
 				   struct scatterlist *sg,
 				   int nelems, int direction)
 {
-	if (direction == PCI_DMA_NONE)
-		BUG();
+	BUG_ON(direction == PCI_DMA_NONE);
 	/* nothing to do */
 }
 
@@ -134,6 +132,17 @@
 extern void
 pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
 			struct resource *res);
+
+extern int
+unmap_bus_range(struct pci_bus *bus);
+
+extern int
+remap_bus_range(struct pci_bus *bus);
+
+extern void
+pcibios_fixup_device_resources(struct pci_dev *dev, struct pci_bus *bus);
+
+extern int pci_read_irq_line(struct pci_dev *dev);
 
 #endif	/* __KERNEL__ */
 
diff -Nru a/include/asm-ppc64/percpu.h b/include/asm-ppc64/percpu.h
--- a/include/asm-ppc64/percpu.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/percpu.h	Tue Feb  3 19:45:17 2004
@@ -1,6 +1,6 @@
-#ifndef __ARCH_I386_PERCPU__
-#define __ARCH_I386_PERCPU__
+#ifndef __ARCH_PPC64_PERCPU__
+#define __ARCH_PPC64_PERCPU__
 
 #include <asm-generic/percpu.h>
 
-#endif /* __ARCH_I386_PERCPU__ */
+#endif /* __ARCH_PPC64_PERCPU__ */
diff -Nru a/include/asm-ppc64/pgalloc.h b/include/asm-ppc64/pgalloc.h
--- a/include/asm-ppc64/pgalloc.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ppc64/pgalloc.h	Tue Feb  3 19:45:16 2004
@@ -3,7 +3,10 @@
 
 #include <linux/mm.h>
 #include <linux/slab.h>
+#include <linux/cpumask.h>
+#include <linux/percpu.h>
 #include <asm/processor.h>
+#include <asm/tlb.h>
 
 extern kmem_cache_t *zero_cache;
 
@@ -40,8 +43,6 @@
 	kmem_cache_free(zero_cache, pmd);
 }
 
-#define __pmd_free_tlb(tlb, pmd)	pmd_free(pmd)
-
 #define pmd_populate_kernel(mm, pmd, pte) pmd_set(pmd, pte)
 #define pmd_populate(mm, pmd, pte_page) \
 	pmd_populate_kernel(mm, pmd, page_address(pte_page))
@@ -62,15 +63,57 @@
 
 	return NULL;
 }
-
-static inline void
-pte_free_kernel(pte_t *pte)
+		
+static inline void pte_free_kernel(pte_t *pte)
 {
 	kmem_cache_free(zero_cache, pte);
 }
 
 #define pte_free(pte_page)	pte_free_kernel(page_address(pte_page))
-#define __pte_free_tlb(tlb, pte)	pte_free(pte)
+
+struct pte_freelist_batch
+{
+	struct rcu_head	rcu;
+	unsigned int	index;
+	struct page *	pages[0];
+};
+
+#define PTE_FREELIST_SIZE	((PAGE_SIZE - sizeof(struct pte_freelist_batch) / \
+				  sizeof(struct page *)))
+
+extern void pte_free_now(struct page *ptepage);
+extern void pte_free_submit(struct pte_freelist_batch *batch);
+
+DECLARE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur);
+
+static inline void __pte_free_tlb(struct mmu_gather *tlb, struct page *ptepage)
+{
+	/* This is safe as we are holding page_table_lock */
+        cpumask_t local_cpumask = cpumask_of_cpu(smp_processor_id());
+	struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur);
+
+	if (atomic_read(&tlb->mm->mm_users) < 2 ||
+	    cpus_equal(tlb->mm->cpu_vm_mask, local_cpumask)) {
+		pte_free(ptepage);
+		return;
+	}
+
+	if (*batchp == NULL) {
+		*batchp = (struct pte_freelist_batch *)__get_free_page(GFP_ATOMIC);
+		if (*batchp == NULL) {
+			pte_free_now(ptepage);
+			return;
+		}
+		(*batchp)->index = 0;
+	}
+	(*batchp)->pages[(*batchp)->index++] = ptepage;
+	if ((*batchp)->index == PTE_FREELIST_SIZE) {
+		pte_free_submit(*batchp);
+		*batchp = NULL;
+	}
+}
+
+#define __pmd_free_tlb(tlb, pmd)	__pte_free_tlb(tlb, virt_to_page(pmd))
 
 #define check_pgt_cache()	do { } while (0)
 
diff -Nru a/include/asm-ppc64/pgtable.h b/include/asm-ppc64/pgtable.h
--- a/include/asm-ppc64/pgtable.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ppc64/pgtable.h	Tue Feb  3 19:45:42 2004
@@ -7,6 +7,8 @@
  */
 
 #ifndef __ASSEMBLY__
+#include <linux/config.h>
+#include <linux/stddef.h>
 #include <asm/processor.h>		/* For TASK_SIZE */
 #include <asm/mmu.h>
 #include <asm/page.h>
@@ -51,10 +53,11 @@
  * Define the address range of the imalloc VM area.
  * (used for ioremap)
  */
-#define IMALLOC_START (ioremap_bot)
+#define IMALLOC_START     (ioremap_bot)
 #define IMALLOC_VMADDR(x) ((unsigned long)(x))
-#define IMALLOC_BASE  (0xE000000000000000)
-#define IMALLOC_END   (IMALLOC_BASE + VALID_EA_BITS)
+#define PHBS_IO_BASE  	  (0xE000000000000000)	/* Reserve 2 gigs for PHBs */
+#define IMALLOC_BASE      (0xE000000080000000)  
+#define IMALLOC_END       (IMALLOC_BASE + VALID_EA_BITS)
 
 /*
  * Define the address range mapped virt <-> physical
@@ -73,22 +76,23 @@
  * Bits in a linux-style PTE.  These match the bits in the
  * (hardware-defined) PowerPC PTE as closely as possible.
  */
-#define _PAGE_PRESENT	0x001UL	/* software: pte contains a translation */
-#define _PAGE_USER	0x002UL	/* matches one of the PP bits */
-#define _PAGE_RW	0x004UL	/* software: user write access allowed */
-#define _PAGE_GUARDED	0x008UL
-#define _PAGE_COHERENT	0x010UL	/* M: enforce memory coherence (SMP systems) */
-#define _PAGE_NO_CACHE	0x020UL	/* I: cache inhibit */
-#define _PAGE_WRITETHRU	0x040UL	/* W: cache write-through */
-#define _PAGE_DIRTY	0x080UL	/* C: page changed */
-#define _PAGE_ACCESSED	0x100UL	/* R: page referenced */
-#define _PAGE_FILE	0x200UL /* software: pte holds file offset */
-#define _PAGE_HASHPTE	0x400UL	/* software: pte has an associated HPTE */
-#define _PAGE_EXEC	0x800UL	/* software: i-cache coherence required */
-#define _PAGE_SECONDARY 0x8000UL /* software: HPTE is in secondary group */
-#define _PAGE_GROUP_IX  0x7000UL /* software: HPTE index within group */
+#define _PAGE_PRESENT	0x0001 /* software: pte contains a translation */
+#define _PAGE_USER	0x0002 /* matches one of the PP bits */
+#define _PAGE_FILE	0x0002 /* (!present only) software: pte holds file offset */
+#define _PAGE_RW	0x0004 /* software: user write access allowed */
+#define _PAGE_GUARDED	0x0008
+#define _PAGE_COHERENT	0x0010 /* M: enforce memory coherence (SMP systems) */
+#define _PAGE_NO_CACHE	0x0020 /* I: cache inhibit */
+#define _PAGE_WRITETHRU	0x0040 /* W: cache write-through */
+#define _PAGE_DIRTY	0x0080 /* C: page changed */
+#define _PAGE_ACCESSED	0x0100 /* R: page referenced */
+#define _PAGE_EXEC	0x0200 /* software: i-cache coherence required */
+#define _PAGE_HASHPTE	0x0400 /* software: pte has an associated HPTE */
+#define _PAGE_BUSY	0x0800 /* software: PTE & hash are busy */ 
+#define _PAGE_SECONDARY 0x8000 /* software: HPTE is in secondary group */
+#define _PAGE_GROUP_IX  0x7000 /* software: HPTE index within group */
 /* Bits 0x7000 identify the index within an HPT Group */
-#define _PAGE_HPTEFLAGS (_PAGE_HASHPTE | _PAGE_SECONDARY | _PAGE_GROUP_IX)
+#define _PAGE_HPTEFLAGS (_PAGE_BUSY | _PAGE_HASHPTE | _PAGE_SECONDARY | _PAGE_GROUP_IX)
 /* PAGE_MASK gives the right answer below, but only by accident */
 /* It should be preserving the high 48 bits and then specifically */
 /* preserving _PAGE_SECONDARY | _PAGE_GROUP_IX */
@@ -156,8 +160,10 @@
 #define _PMD_HUGEPAGE	0x00000001U
 #define HUGEPTE_BATCH_SIZE (1<<(HPAGE_SHIFT-PMD_SHIFT))
 
+#ifndef __ASSEMBLY__
 int hash_huge_page(struct mm_struct *mm, unsigned long access,
 		   unsigned long ea, unsigned long vsid, int local);
+#endif /* __ASSEMBLY__ */
 
 #define HAVE_ARCH_UNMAPPED_AREA
 #else
@@ -287,15 +293,17 @@
 					unsigned long set )
 {
 	unsigned long old, tmp;
-
+	
 	__asm__ __volatile__(
 	"1:	ldarx	%0,0,%3		# pte_update\n\
+	andi.	%1,%0,%7\n\
+	bne-	1b \n\
 	andc	%1,%0,%4 \n\
 	or	%1,%1,%5 \n\
 	stdcx.	%1,0,%3 \n\
 	bne-	1b"
 	: "=&r" (old), "=&r" (tmp), "=m" (*p)
-	: "r" (p), "r" (clr), "r" (set), "m" (*p)
+	: "r" (p), "r" (clr), "r" (set), "m" (*p), "i" (_PAGE_BUSY)
 	: "cc" );
 	return old;
 }
@@ -399,6 +407,17 @@
 extern void hpte_init_pSeries(void);
 extern void hpte_init_iSeries(void);
 
+/* imalloc region types */
+#define IM_REGION_UNUSED	0x1
+#define IM_REGION_SUBSET	0x2
+#define IM_REGION_EXISTS	0x4
+#define IM_REGION_OVERLAP	0x8
+
+extern struct vm_struct * im_get_free_area(unsigned long size);
+extern struct vm_struct * im_get_area(unsigned long v_addr, unsigned long size,
+			int region_type);
+unsigned long im_free(void *addr);
+
 typedef pte_t *pte_addr_t;
 
 long pSeries_lpar_hpte_insert(unsigned long hpte_group,
@@ -410,5 +429,40 @@
 			 unsigned long prpn, int secondary,
 			 unsigned long hpteflags, int bolted, int large);
 
+/*
+ * find_linux_pte returns the address of a linux pte for a given 
+ * effective address and directory.  If not found, it returns zero.
+ */
+static inline pte_t *find_linux_pte(pgd_t *pgdir, unsigned long ea)
+{
+	pgd_t *pg;
+	pmd_t *pm;
+	pte_t *pt = NULL;
+	pte_t pte;
+
+	pg = pgdir + pgd_index(ea);
+	if (!pgd_none(*pg)) {
+
+		pm = pmd_offset(pg, ea);
+		if (pmd_present(*pm)) { 
+			pt = pte_offset_kernel(pm, ea);
+			pte = *pt;
+			if (!pte_present(pte))
+				pt = NULL;
+		}
+	}
+
+	return pt;
+}
+
 #endif /* __ASSEMBLY__ */
+
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
+#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
+#define __HAVE_ARCH_PTEP_SET_WRPROTECT
+#define __HAVE_ARCH_PTEP_MKDIRTY
+#define __HAVE_ARCH_PTE_SAME
+#include <asm-generic/pgtable.h>
+
 #endif /* _PPC64_PGTABLE_H */
diff -Nru a/include/asm-ppc64/ppc32.h b/include/asm-ppc64/ppc32.h
--- a/include/asm-ppc64/ppc32.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/ppc32.h	Tue Feb  3 19:45:17 2004
@@ -40,12 +40,7 @@
 
 /* These are here to support 32-bit syscalls on a 64-bit kernel. */
 
-typedef union sigval32 {
-	int sival_int;
-	unsigned int sival_ptr;
-} sigval_t32;
-
-typedef struct siginfo32 {
+typedef struct compat_siginfo {
 	int si_signo;
 	int si_errno;
 	int si_code;
@@ -69,7 +64,7 @@
 		struct {
 			compat_pid_t _pid;		/* sender's pid */
 			compat_uid_t _uid;		/* sender's uid */
-			sigval_t32 _sigval;
+			compat_sigval_t _sigval;
 		} _rt;
 
 		/* SIGCHLD */
@@ -92,7 +87,7 @@
 			int _fd;
 		} _sigpoll;
 	} _sifields;
-} siginfo_t32;
+} compat_siginfo_t;
 
 #define __old_sigaction32	old_sigaction32
 
@@ -126,13 +121,39 @@
 	u32 regs;  /* 4 byte pointer to the pt_regs32 structure. */
 };
 
+struct mcontext32 {
+	elf_gregset_t32		mc_gregs;
+	elf_fpregset_t		mc_fregs;
+	unsigned int		mc_pad[2];
+	elf_vrregset_t32	mc_vregs __attribute__((__aligned__(16)));
+};
+
 struct ucontext32 { 
-	unsigned int	  uc_flags;
-	unsigned int 	  uc_link;
-	stack_32_t	  uc_stack;
-	struct sigcontext32 uc_mcontext;
-	sigset_t	  uc_sigmask;	/* mask last for extensibility */
+	unsigned int	  	uc_flags;
+	unsigned int 	  	uc_link;
+	stack_32_t	 	uc_stack;
+	int		 	uc_pad[7];
+	u32			uc_regs;	/* points to uc_mcontext field */
+	compat_sigset_t	 	uc_sigmask;	/* mask last for extensibility */
+	/* glibc has 1024-bit signal masks, ours are 64-bit */
+	int		 	uc_maskext[30];
+	int		 	uc_pad2[3];
+	struct mcontext32	uc_mcontext;
 };
+
+typedef struct compat_sigevent {
+	compat_sigval_t sigev_value;
+	int sigev_signo;
+	int sigev_notify;
+	union {
+		int _pad[SIGEV_PAD_SIZE];
+		int _tid;
+		struct {
+			compat_uptr_t _function;
+			compat_uptr_t _attribute;
+		} _sigev_thread;
+	} _sigev_un;
+} compat_sigevent_t;
 
 struct ipc_kludge_32 {
 	unsigned int msgp;
diff -Nru a/include/asm-ppc64/ppc_asm.h b/include/asm-ppc64/ppc_asm.h
--- a/include/asm-ppc64/ppc_asm.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/ppc_asm.h	Tue Feb  3 19:45:17 2004
@@ -11,6 +11,8 @@
  *  2 of the License, or (at your option) any later version.
  */
 
+#ifndef _PPC64_PPC_ASM_H
+#define _PPC64_PPC_ASM_H
 /*
  * Macros for storing registers into and loading registers from
  * exception frames.
@@ -39,6 +41,19 @@
 #define REST_16FPRS(n, base)	REST_8FPRS(n, base); REST_8FPRS(n+8, base)
 #define REST_32FPRS(n, base)	REST_16FPRS(n, base); REST_16FPRS(n+16, base)
 
+#define SAVE_VR(n,b,base)	li b,THREAD_VR0+(16*(n));  stvx n,b,base
+#define SAVE_2VRS(n,b,base)	SAVE_VR(n,b,base); SAVE_VR(n+1,b,base)
+#define SAVE_4VRS(n,b,base)	SAVE_2VRS(n,b,base); SAVE_2VRS(n+2,b,base)
+#define SAVE_8VRS(n,b,base)	SAVE_4VRS(n,b,base); SAVE_4VRS(n+4,b,base)
+#define SAVE_16VRS(n,b,base)	SAVE_8VRS(n,b,base); SAVE_8VRS(n+8,b,base)
+#define SAVE_32VRS(n,b,base)	SAVE_16VRS(n,b,base); SAVE_16VRS(n+16,b,base)
+#define REST_VR(n,b,base)	li b,THREAD_VR0+(16*(n)); lvx n,b,base
+#define REST_2VRS(n,b,base)	REST_VR(n,b,base); REST_VR(n+1,b,base)
+#define REST_4VRS(n,b,base)	REST_2VRS(n,b,base); REST_2VRS(n+2,b,base)
+#define REST_8VRS(n,b,base)	REST_4VRS(n,b,base); REST_4VRS(n+4,b,base)
+#define REST_16VRS(n,b,base)	REST_8VRS(n,b,base); REST_8VRS(n+8,b,base)
+#define REST_32VRS(n,b,base)	REST_16VRS(n,b,base); REST_16VRS(n+16,b,base)
+
 #define CHECKANYINT(ra,rb)			\
 	mfspr	rb,SPRG3;		/* Get Paca address */\
 	ld	ra,PACALPPACA+LPPACAANYINT(rb); /* Get pending interrupt flags */\
@@ -225,3 +240,5 @@
 #define	vr29	29
 #define	vr30	30
 #define	vr31	31
+
+#endif /* _PPC64_PPC_ASM_H */
diff -Nru a/include/asm-ppc64/proc_fs.h b/include/asm-ppc64/proc_fs.h
--- a/include/asm-ppc64/proc_fs.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/proc_fs.h	Tue Feb  3 19:45:17 2004
@@ -34,5 +34,6 @@
 };
 
 extern struct proc_ppc64_t proc_ppc64;
+extern int proc_ppc64_init(void);
 
 #endif /* _PPC64_PROC_FS_H */
diff -Nru a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h
--- a/include/asm-ppc64/processor.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ppc64/processor.h	Tue Feb  3 19:45:16 2004
@@ -12,6 +12,7 @@
 
 #include <linux/stringify.h>
 #ifndef __ASSEMBLY__
+#include <linux/config.h>
 #include <asm/atomic.h>
 #include <asm/ppcdebug.h>
 #include <asm/a.out.h>
@@ -311,6 +312,7 @@
 #define	SPRN_USIA	0x3AB	/* User Sampled Instruction Address Register */
 #define	SPRN_XER	0x001	/* Fixed Point Exception Register */
 #define	SPRN_ZPR	0x3B0	/* Zone Protection Register */
+#define SPRN_VRSAVE     0x100   /* Vector save */
 
 /* Short-hand versions for a number of the above SPRNs */
 
@@ -371,6 +373,7 @@
 #define	PV_ICESTAR	0x0036
 #define	PV_SSTAR	0x0037
 #define	PV_POWER4p	0x0038
+#define	PV_POWER5	0x003A
 #define	PV_630        	0x0040
 #define	PV_630p	        0x0041
 
@@ -378,6 +381,7 @@
 #define PLATFORM_PSERIES      0x0100
 #define PLATFORM_PSERIES_LPAR 0x0101
 #define PLATFORM_ISERIES_LPAR 0x0201
+#define PLATFORM_LPAR         0x0001
 	
 /*
  * List of interrupt controllers.
@@ -462,11 +466,9 @@
 void release_thread(struct task_struct *);
 
 /* Prepare to copy thread state - unlazy all lazy status */
-#define prepare_to_copy(tsk)	do { } while (0)
+extern void prepare_to_copy(struct task_struct *tsk);
 
-/*
- * Create a new kernel thread.
- */
+/* Create a new kernel thread. */
 extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
 
 /*
@@ -477,6 +479,7 @@
 
 /* Lazy FPU handling on uni-processor */
 extern struct task_struct *last_task_used_math;
+extern struct task_struct *last_task_used_altivec;
 
 
 #ifdef __KERNEL__
@@ -516,6 +519,14 @@
 	unsigned long	fpexc_mode;	/* Floating-point exception mode */
 	unsigned long	saved_msr;	/* Save MSR across signal handlers */
 	unsigned long	saved_softe;	/* Ditto for Soft Enable/Disable */
+#ifdef CONFIG_ALTIVEC
+	/* Complete AltiVec register set */
+	vector128	vr[32] __attribute((aligned(16)));
+	/* AltiVec status */
+	vector128	vscr __attribute((aligned(16)));
+	unsigned long	vrsave;
+	int		used_vr;	/* set if process has used altivec */
+#endif /* CONFIG_ALTIVEC */
 };
 
 #define INIT_SP		(sizeof(init_stack) + (unsigned long) &init_stack)
diff -Nru a/include/asm-ppc64/prom.h b/include/asm-ppc64/prom.h
--- a/include/asm-ppc64/prom.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-ppc64/prom.h	Tue Feb  3 19:45:43 2004
@@ -14,6 +14,8 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
+#include <linux/proc_fs.h>
+#include <asm/atomic.h>
 
 #define PTRRELOC(x)     ((typeof(x))((unsigned long)(x) - offset))
 #define PTRUNRELOC(x)   ((typeof(x))((unsigned long)(x) + offset))
@@ -47,6 +49,17 @@
 	u32 a_lo;
 };
 
+struct isa_address {
+	u32 a_hi;
+	u32 a_lo;
+};
+
+struct isa_range {
+	struct isa_address isa_addr;
+	struct pci_address pci_addr;
+	unsigned int size;
+};
+
 struct pci_range32 {
 	struct pci_address child_addr;
 	unsigned int  parent_addr;
@@ -120,6 +133,7 @@
 	char	*name;
 	char	*type;
 	phandle	node;
+	phandle linux_phandle;
 	int	n_addrs;
 	struct	address_range *addrs;
 	int	n_intrs;
@@ -143,7 +157,43 @@
 	struct	device_node *sibling;
 	struct	device_node *next;	/* next device of same type */
 	struct	device_node *allnext;	/* next in list of all nodes */
-};
+	struct  proc_dir_entry *pde;       /* this node's proc directory */
+	struct  proc_dir_entry *name_link; /* name symlink */
+	struct  proc_dir_entry *addr_link; /* addr symlink */
+	atomic_t _users;                 /* reference count */
+	unsigned long _flags;
+};
+
+/* flag descriptions */
+#define OF_STALE   0 /* node is slated for deletion */
+#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
+
+#define OF_IS_STALE(x) test_bit(OF_STALE, &x->_flags)
+#define OF_MARK_STALE(x) set_bit(OF_STALE, &x->_flags)
+#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
+#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
+
+/*
+ * Until 32-bit ppc can add proc_dir_entries to its device_node
+ * definition, we cannot refer to pde, name_link, and addr_link
+ * in arch-independent code.
+ */
+#define HAVE_ARCH_DEVTREE_FIXUPS
+
+static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
+{
+	dn->pde = de;
+}
+
+static void inline set_node_name_link(struct device_node *dn, struct proc_dir_entry *de)
+{
+	dn->name_link = de;
+}
+
+static void inline set_node_addr_link(struct device_node *dn, struct proc_dir_entry *de)
+{
+	dn->addr_link = de;
+}
 
 typedef u32 prom_arg_t;
 
@@ -168,22 +218,43 @@
 };
 
 extern struct prom_t prom;
+extern char *of_stdout_device;
 
 extern int boot_cpuid;
 
-/* Prototypes */
-extern void abort(void);
-extern unsigned long prom_init(unsigned long, unsigned long, unsigned long,
-    unsigned long, unsigned long);
-extern void prom_print(const char *msg);
-extern void relocate_nodes(void);
-extern void finish_device_tree(void);
+/* OBSOLETE: Old stlye node lookup */
 extern struct device_node *find_devices(const char *name);
 extern struct device_node *find_type_devices(const char *type);
 extern struct device_node *find_path_device(const char *path);
 extern struct device_node *find_compatible_devices(const char *type,
 						   const char *compat);
 extern struct device_node *find_all_nodes(void);
+
+/* New style node lookup */
+extern struct device_node *of_find_node_by_name(struct device_node *from,
+	const char *name);
+extern struct device_node *of_find_node_by_type(struct device_node *from,
+	const char *type);
+extern struct device_node *of_find_compatible_node(struct device_node *from,
+	const char *type, const char *compat);
+extern struct device_node *of_find_node_by_path(const char *path);
+extern struct device_node *of_find_all_nodes(struct device_node *prev);
+extern struct device_node *of_get_parent(const struct device_node *node);
+extern struct device_node *of_get_next_child(const struct device_node *node,
+					     struct device_node *prev);
+extern struct device_node *of_node_get(struct device_node *node);
+extern void of_node_put(struct device_node *node);
+
+/* For updating the device tree at runtime */
+extern int of_add_node(const char *path, struct property *proplist);
+extern int of_remove_node(struct device_node *np);
+
+/* Other Prototypes */
+extern unsigned long prom_init(unsigned long, unsigned long, unsigned long,
+	unsigned long, unsigned long);
+extern void prom_print(const char *msg);
+extern void relocate_nodes(void);
+extern void finish_device_tree(void);
 extern int device_is_compatible(struct device_node *device, const char *);
 extern int machine_is_compatible(const char *compat);
 extern unsigned char *get_property(struct device_node *node, const char *name,
diff -Nru a/include/asm-ppc64/ptrace-common.h b/include/asm-ppc64/ptrace-common.h
--- a/include/asm-ppc64/ptrace-common.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-ppc64/ptrace-common.h	Tue Feb  3 19:45:30 2004
@@ -9,6 +9,8 @@
  * this archive for more details.
  */
 
+#ifndef _PPC64_PTRACE_COMMON_H
+#define _PPC64_PTRACE_COMMON_H
 /*
  * Set of msr bits that gdb can change on behalf of a process.
  */
@@ -64,3 +66,5 @@
 	if (regs != NULL)
 		regs->msr &= ~MSR_SE;
 }
+
+#endif /* _PPC64_PTRACE_COMMON_H */
diff -Nru a/include/asm-ppc64/ptrace.h b/include/asm-ppc64/ptrace.h
--- a/include/asm-ppc64/ptrace.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-ppc64/ptrace.h	Tue Feb  3 19:45:34 2004
@@ -16,7 +16,7 @@
  * that the overall structure is a multiple of 16 bytes in length.
  *
  * Note that the offsets of the fields in this struct correspond with
- * the PT_* values below.  This simplifies arch/ppc/kernel/ptrace.c.
+ * the PT_* values below.  This simplifies arch/ppc64/kernel/ptrace.c.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -120,12 +120,40 @@
 #define PT_RESULT 43
 
 #define PT_FPR0	48
+
+/* Kernel and userspace will both use this PT_FPSCR value.  32-bit apps will have
+ * visibility to the asm-ppc/ptrace.h header instead of this one.
+ */
+#define PT_FPSCR (PT_FPR0 + 32 + 1)	  /* each FP reg occupies 1 slot in 64-bit space */
+
 #ifdef __KERNEL__
-#define PT_FPSCR (PT_FPR0 + 32 + 1)	  /* each FP reg occupies 1 slot in this space */
-#define PT_FPSCR32 (PT_FPR0 + 2*32 + 1)	  /* To the 32-bit user - each FP reg occupies 2 slots in this space */
-#else
-#define PT_FPSCR (PT_FPR0 + 2*32 + 1)	/* each FP reg occupies 2 slots in this space -- Fix when 64-bit apps. */
+#define PT_FPSCR32 (PT_FPR0 + 2*32 + 1)	  /* each FP reg occupies 2 32-bit userspace slots */
 #endif
+
+#define PT_VR0 82	/* each Vector reg occupies 2 slots in 64-bit */
+#define PT_VSCR (PT_VR0 + 32*2 + 1)
+#define PT_VRSAVE (PT_VR0 + 33*2)
+
+#ifdef __KERNEL__
+#define PT_VR0_32 164	/* each Vector reg occupies 4 slots in 32-bit */
+#define PT_VSCR_32 (PT_VR0 + 32*4 + 3)
+#define PT_VRSAVE_32 (PT_VR0 + 33*4)
+#endif
+
+/*
+ * Get/set all the altivec registers vr0..vr31, vscr, vrsave, in one go. 
+ * The transfer totals 34 quadword.  Quadwords 0-31 contain the 
+ * corresponding vector registers.  Quadword 32 contains the vscr as the 
+ * last word (offset 12) within that quadword.  Quadword 33 contains the 
+ * vrsave as the first word (offset 0) within the quadword.
+ *
+ * This definition of the VMX state is compatible with the current PPC32 
+ * ptrace interface.  This allows signal handling and ptrace to use the same 
+ * structures.  This also simplifies the implementation of a bi-arch 
+ * (combined (32- and 64-bit) gdb.
+ */
+#define PTRACE_GETVRREGS	18
+#define PTRACE_SETVRREGS	19
 
 /* Additional PTRACE requests implemented on PowerPC. */
 #define PPC_PTRACE_GETREGS	      0x99  /* Get GPRs 0 - 31 */
diff -Nru a/include/asm-ppc64/rtas.h b/include/asm-ppc64/rtas.h
--- a/include/asm-ppc64/rtas.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ppc64/rtas.h	Tue Feb  3 19:45:42 2004
@@ -19,6 +19,16 @@
 #define RTAS_UNKNOWN_SERVICE (-1)
 #define RTAS_INSTANTIATE_MAX (1UL<<30) /* Don't instantiate rtas at/above this value */
 
+/* Buffer size for ppc_rtas system call. */
+#define RTAS_RMOBUF_MAX (64 * 1024)
+
+/* RTAS return codes */
+#define RTAS_BUSY		-2	/* RTAS Return Status - Busy */
+#define RTAS_EXTENDED_DELAY_MIN 9900
+#define RTAS_EXTENDED_DELAY_MAX 9905
+
+#define RTAS_UNKNOWN_OP		-1099	/* Return Status - Unknown RTAS Token */
+
 /*
  * In general to call RTAS use rtas_token("string") to lookup
  * an RTAS token for the given string (e.g. "event-scan").
@@ -57,11 +67,11 @@
 };
 
 /* Event classes */
-#define INTERNAL_ERROR		0x80000000 /* set bit 0 */
-#define EPOW_WARNING		0x40000000 /* set bit 1 */
-#define POWERMGM_EVENTS		0x20000000 /* set bit 2 */
-#define HOTPLUG_EVENTS		0x10000000 /* set bit 3 */
-#define EVENT_SCAN_ALL_EVENTS	0xf0000000
+#define RTAS_INTERNAL_ERROR		0x80000000 /* set bit 0 */
+#define RTAS_EPOW_WARNING		0x40000000 /* set bit 1 */
+#define RTAS_POWERMGM_EVENTS		0x20000000 /* set bit 2 */
+#define RTAS_HOTPLUG_EVENTS		0x10000000 /* set bit 3 */
+#define RTAS_EVENT_SCAN_ALL_EVENTS	0xf0000000
 
 /* event-scan returns */
 #define SEVERITY_FATAL		0x5
@@ -165,6 +175,9 @@
 extern void rtas_restart(char *cmd);
 extern void rtas_power_off(void);
 extern void rtas_halt(void);
+extern int rtas_get_sensor(int sensor, int index, int *state);
+extern int rtas_get_power_level(int powerdomain, int *level);
+extern int rtas_set_indicator(int indicator, int index, int new_value);
 
 /* Given an RTAS status code of 9900..9905 compute the hinted delay */
 unsigned int rtas_extended_busy_delay_time(int status);
@@ -173,13 +186,39 @@
 	return status >= 9900 && status <= 9909;
 }
 
+extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal);
+
+/* Error types logged.  */
+#define ERR_FLAG_ALREADY_LOGGED	0x0
+#define ERR_FLAG_BOOT		0x1 	/* log was pulled from NVRAM on boot */
+#define ERR_TYPE_RTAS_LOG	0x2	/* from rtas event-scan */
+#define ERR_TYPE_KERNEL_PANIC	0x4	/* from panic() */
+
+/* All the types and not flags */
+#define ERR_TYPE_MASK	(ERR_TYPE_RTAS_LOG | ERR_TYPE_KERNEL_PANIC)
+
+#define RTAS_ERR KERN_ERR "RTAS: "
+ 
+#define RTAS_ERROR_LOG_MAX 2048
+ 
+ 
+/* Event Scan Parameters */
+#define EVENT_SCAN_ALL_EVENTS	0xf0000000
+#define SURVEILLANCE_TOKEN	9000
+#define LOG_NUMBER		64		/* must be a power of two */
+#define LOG_NUMBER_MASK		(LOG_NUMBER-1)
+
 /* Some RTAS ops require a data buffer and that buffer must be < 4G.
  * Rather than having a memory allocator, just use this buffer
  * (get the lock first), make the RTAS call.  Copy the data instead
  * of holding the buffer for long.
  */
-#define RTAS_DATA_BUF_SIZE 1024
+
+#define RTAS_DATA_BUF_SIZE 4096
 extern spinlock_t rtas_data_buf_lock;
 extern char rtas_data_buf[RTAS_DATA_BUF_SIZE];
+
+/* RMO buffer reserved for user-space RTAS use */
+extern unsigned long rtas_rmo_buf;
 
 #endif /* _PPC64_RTAS_H */
diff -Nru a/include/asm-ppc64/serial.h b/include/asm-ppc64/serial.h
--- a/include/asm-ppc64/serial.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-ppc64/serial.h	Tue Feb  3 19:45:34 2004
@@ -1,6 +1,8 @@
 /*
- * include/asm-ppc/serial.h
+ * include/asm-ppc64/serial.h
  */
+#ifndef _PPC64_SERIAL_H
+#define _PPC64_SERIAL_H
 
 #include <linux/config.h>
 
@@ -124,3 +126,5 @@
 	EXTRA_SERIAL_PORT_DEFNS		\
 	HUB6_SERIAL_PORT_DFNS		\
 	MCA_SERIAL_PORT_DFNS
+
+#endif /* _PPC64_SERIAL_H */
diff -Nru a/include/asm-ppc64/sigcontext.h b/include/asm-ppc64/sigcontext.h
--- a/include/asm-ppc64/sigcontext.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/sigcontext.h	Tue Feb  3 19:45:17 2004
@@ -21,6 +21,27 @@
 	struct pt_regs	*regs;
 	elf_gregset_t	gp_regs;
 	elf_fpregset_t	fp_regs;
+/*
+ * To maintain compatibility with current implementations the sigcontext is 
+ * extended by appending a pointer (v_regs) to a quadword type (elf_vrreg_t) 
+ * followed by an unstructured (vmx_reserve) field of 69 doublewords.  This 
+ * allows the array of vector registers to be quadword aligned independent of 
+ * the alignment of the containing sigcontext or ucontext. It is the 
+ * responsibility of the code setting the sigcontext to set this pointer to 
+ * either NULL (if this processor does not support the VMX feature) or the 
+ * address of the first quadword within the allocated (vmx_reserve) area.
+ *
+ * The pointer (v_regs) of vector type (elf_vrreg_t) is type compatible with 
+ * an array of 34 quadword entries (elf_vrregset_t).  The entries with 
+ * indexes 0-31 contain the corresponding vector registers.  The entry with 
+ * index 32 contains the vscr as the last word (offset 12) within the 
+ * quadword.  This allows the vscr to be stored as either a quadword (since 
+ * it must be copied via a vector register to/from storage) or as a word.  
+ * The entry with index 33 contains the vrsave as the first word (offset 0) 
+ * within the quadword.
+ */
+	elf_vrreg_t	*v_regs;
+	long		vmx_reserve[ELF_NVRREG+ELF_NVRREG+1];
 };
 
 #endif /* _ASM_PPC64_SIGCONTEXT_H */
diff -Nru a/include/asm-ppc64/smp.h b/include/asm-ppc64/smp.h
--- a/include/asm-ppc64/smp.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ppc64/smp.h	Tue Feb  3 19:45:16 2004
@@ -22,21 +22,40 @@
 #include <linux/cpumask.h>
 #include <linux/kernel.h>
 
-#ifdef CONFIG_SMP
-
 #ifndef __ASSEMBLY__
 
 #include <asm/paca.h>
 
+#ifdef CONFIG_SMP
+
 extern void smp_message_pass(int target, int msg, unsigned long data, int wait);
 extern void smp_send_tlb_invalidate(int);
 extern void smp_send_xmon_break(int cpu);
 struct pt_regs;
 extern void smp_message_recv(int, struct pt_regs *);
 
-#define cpu_possible(cpu)	paca[cpu].active
 
 #define smp_processor_id() (get_paca()->xPacaIndex)
+#define hard_smp_processor_id() (get_paca()->xHwProcNum)
+
+/*
+ * Retrieve the state of a CPU:
+ * online:          CPU is in a normal run state
+ * possible:        CPU is a candidate to be made online
+ * available:       CPU is candidate for the 'possible' pool
+ *                  Used to get SMT threads started at boot time.
+ * present_at_boot: CPU was available at boot time.  Used in DLPAR
+ *                  code to handle special cases for processor start up.
+ */
+extern cpumask_t cpu_present_at_boot;
+extern cpumask_t cpu_online_map;
+extern cpumask_t cpu_possible_map;
+extern cpumask_t cpu_available_map;
+
+#define cpu_present_at_boot(cpu) cpu_isset(cpu, cpu_present_at_boot)
+#define cpu_online(cpu)          cpu_isset(cpu, cpu_online_map) 
+#define cpu_possible(cpu)        cpu_isset(cpu, cpu_possible_map) 
+#define cpu_available(cpu)       cpu_isset(cpu, cpu_available_map) 
 
 /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
  *
@@ -50,7 +69,11 @@
 void smp_init_iSeries(void);
 void smp_init_pSeries(void);
 
-#endif /* __ASSEMBLY__ */
 #endif /* !(CONFIG_SMP) */
+#endif /* __ASSEMBLY__ */
+
+#define get_hard_smp_processor_id(CPU) (paca[(CPU)].xHwProcNum)
+#define set_hard_smp_processor_id(CPU, VAL) do { (paca[(CPU)].xHwProcNum = VAL); } while (0)
+
 #endif /* !(_PPC64_SMP_H) */
 #endif /* __KERNEL__ */
diff -Nru a/include/asm-ppc64/socket.h b/include/asm-ppc64/socket.h
--- a/include/asm-ppc64/socket.h	Tue Feb  3 19:45:28 2004
+++ b/include/asm-ppc64/socket.h	Tue Feb  3 19:45:28 2004
@@ -52,6 +52,8 @@
 
 #define SO_ACCEPTCONN           30
 
+#define SO_PEERSEC             31
+
 /* Nast libc5 fixup - bletch */
 #if defined(__KERNEL__)
 /* Socket types. */
diff -Nru a/include/asm-ppc64/system.h b/include/asm-ppc64/system.h
--- a/include/asm-ppc64/system.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-ppc64/system.h	Tue Feb  3 19:45:43 2004
@@ -85,6 +85,9 @@
 extern void giveup_fpu(struct task_struct *);
 extern void disable_kernel_fp(void);
 extern void enable_kernel_fp(void);
+extern void giveup_altivec(struct task_struct *);
+extern void disable_kernel_altivec(void);
+extern void enable_kernel_altivec(void);
 extern void cvt_fd(float *from, double *to, unsigned long *fpscr);
 extern void cvt_df(double *from, float *to, unsigned long *fpscr);
 extern int abs(int);
@@ -100,13 +103,6 @@
 
 struct pt_regs;
 extern void dump_regs(struct pt_regs *);
-
-#define irqs_disabled()				\
-({						\
-	unsigned long flags;			\
-	local_save_flags(flags);		\
-	!(flags & MSR_EE);			\
-})
 
 static inline int __is_processor(unsigned long pv)
 {
diff -Nru a/include/asm-ppc64/tlb.h b/include/asm-ppc64/tlb.h
--- a/include/asm-ppc64/tlb.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-ppc64/tlb.h	Tue Feb  3 19:45:17 2004
@@ -74,6 +74,8 @@
 	batch->index = i;
 }
 
+extern void pte_free_finish(void);
+
 static inline void tlb_flush(struct mmu_gather *tlb)
 {
 	int cpu = smp_processor_id();
@@ -86,6 +88,8 @@
 
 	flush_hash_range(tlb->mm->context, batch->index, local);
 	batch->index = 0;
+
+	pte_free_finish();
 }
 
 #endif /* _PPC64_TLB_H */
diff -Nru a/include/asm-ppc64/topology.h b/include/asm-ppc64/topology.h
--- a/include/asm-ppc64/topology.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-ppc64/topology.h	Tue Feb  3 19:45:42 2004
@@ -13,8 +13,7 @@
 	node = numa_cpu_lookup_table[cpu];
 
 #ifdef DEBUG_NUMA
-	if (node == -1)
-		BUG();
+	BUG_ON(node == -1);
 #endif
 
 	return node;
diff -Nru a/include/asm-ppc64/uaccess.h b/include/asm-ppc64/uaccess.h
--- a/include/asm-ppc64/uaccess.h	Tue Feb  3 19:45:28 2004
+++ b/include/asm-ppc64/uaccess.h	Tue Feb  3 19:45:28 2004
@@ -82,7 +82,6 @@
 
 /* Returns 0 if exception not found and fixup otherwise.  */
 extern unsigned long search_exception_table(unsigned long);
-extern void sort_exception_table(void);
 
 /*
  * These are the main single-value transfer routines.  They automatically
diff -Nru a/include/asm-ppc64/unistd.h b/include/asm-ppc64/unistd.h
--- a/include/asm-ppc64/unistd.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-ppc64/unistd.h	Tue Feb  3 19:45:16 2004
@@ -246,9 +246,9 @@
 #define __NR_fadvise64		233
 #define __NR_exit_group		234
 #define __NR_lookup_dcookie	235
-#define __NR_sys_epoll_create	236
-#define __NR_sys_epoll_ctl	237
-#define __NR_sys_epoll_wait	238
+#define __NR_epoll_create	236
+#define __NR_epoll_ctl		237
+#define __NR_epoll_wait		238
 #define __NR_remap_file_pages	239
 #define __NR_timer_create	240
 #define __NR_timer_settime	241
@@ -264,8 +264,10 @@
 #define __NR_utimes		251
 #define __NR_statfs64		252
 #define __NR_fstatfs64		253
+#define __NR_fadvise64_64	254
+#define __NR_rtas		255
 
-#define __NR_syscalls		254
+#define __NR_syscalls		256
 #ifdef __KERNEL__
 #define NR_syscalls	__NR_syscalls
 #endif
@@ -287,6 +289,7 @@
 		register unsigned long __sc_5  __asm__ ("r5");		\
 		register unsigned long __sc_6  __asm__ ("r6");		\
 		register unsigned long __sc_7  __asm__ ("r7");		\
+		register unsigned long __sc_8  __asm__ ("r8");		\
 									\
 		__sc_loadargs_##nr(name, args);				\
 		__asm__ __volatile__					\
@@ -295,10 +298,10 @@
 			: "=&r" (__sc_0),				\
 			  "=&r" (__sc_3),  "=&r" (__sc_4),		\
 			  "=&r" (__sc_5),  "=&r" (__sc_6),		\
-			  "=&r" (__sc_7)				\
+			  "=&r" (__sc_7),  "=&r" (__sc_8)		\
 			: __sc_asm_input_##nr				\
 			: "cr0", "ctr", "memory",			\
-			  "r8", "r9", "r10","r11", "r12");		\
+			        "r9", "r10","r11", "r12");		\
 		__sc_ret = __sc_3;					\
 		__sc_err = __sc_0;					\
 	}								\
@@ -326,6 +329,9 @@
 #define __sc_loadargs_5(name, arg1, arg2, arg3, arg4, arg5)		\
 	__sc_loadargs_4(name, arg1, arg2, arg3, arg4);			\
 	__sc_7 = (unsigned long) (arg5)
+#define __sc_loadargs_6(name, arg1, arg2, arg3, arg4, arg5, arg6)	\
+	__sc_loadargs_5(name, arg1, arg2, arg3, arg4, arg5);		\
+	__sc_8 = (unsigned long) (arg6)
 
 #define __sc_asm_input_0 "0" (__sc_0)
 #define __sc_asm_input_1 __sc_asm_input_0, "1" (__sc_3)
@@ -333,6 +339,7 @@
 #define __sc_asm_input_3 __sc_asm_input_2, "3" (__sc_5)
 #define __sc_asm_input_4 __sc_asm_input_3, "4" (__sc_6)
 #define __sc_asm_input_5 __sc_asm_input_4, "5" (__sc_7)
+#define __sc_asm_input_6 __sc_asm_input_5, "6" (__sc_8)
 
 #define _syscall0(type,name)						\
 type name(void)								\
@@ -368,6 +375,11 @@
 type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5)	\
 {									\
 	__syscall_nr(5, type, name, arg1, arg2, arg3, arg4, arg5);	\
+}
+#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \
+type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6)	\
+{									\
+	__syscall_nr(6, type, name, arg1, arg2, arg3, arg4, arg5, arg6);	\
 }
 
 #ifdef __KERNEL_SYSCALLS__
diff -Nru a/include/asm-ppc64/vio.h b/include/asm-ppc64/vio.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-ppc64/vio.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,130 @@
+/*
+ * IBM PowerPC Virtual I/O Infrastructure Support.
+ *
+ *    Copyright (c) 2003 IBM Corp.
+ *     Dave Engebretsen engebret@us.ibm.com
+ *     Santiago Leon santil@us.ibm.com
+ *
+ *      This program is free software; you can redistribute it and/or
+ *      modify it under the terms of the GNU General Public License
+ *      as published by the Free Software Foundation; either version
+ *      2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _VIO_H
+#define _VIO_H
+
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <asm/hvcall.h>
+#include <asm/prom.h>
+#include <asm/scatterlist.h>
+/* 
+ * Architecture-specific constants for drivers to
+ * extract attributes of the device using vio_get_attribute()
+*/
+#define VETH_MAC_ADDR "local-mac-address"
+#define VETH_MCAST_FILTER_SIZE "ibm,mac-address-filters"
+
+/* End architecture-specific constants */
+
+#define h_vio_signal(ua, mode) \
+  plpar_hcall_norets(H_VIO_SIGNAL, ua, mode)
+
+#define VIO_IRQ_DISABLE		0UL
+#define VIO_IRQ_ENABLE		1UL
+
+struct vio_dev;
+struct vio_driver;
+struct vio_device_id;
+struct TceTable;
+
+int vio_register_driver(struct vio_driver *drv);
+int vio_unregister_driver(struct vio_driver *drv);
+const struct vio_device_id * vio_match_device(const struct vio_device_id *ids, 
+						const struct vio_dev *dev);
+struct vio_dev * __devinit vio_register_device(struct device_node *node_vdev);
+int __devinit vio_unregister_device(struct vio_dev *dev);
+const void * vio_get_attribute(struct vio_dev *vdev, void* which, int* length);
+int vio_get_irq(struct vio_dev *dev);
+struct TceTable * vio_build_tce_table(struct vio_dev *dev);
+int vio_enable_interrupts(struct vio_dev *dev);
+int vio_disable_interrupts(struct vio_dev *dev);
+
+dma_addr_t vio_map_single(struct vio_dev *dev, void *vaddr, 
+			  size_t size, int direction);
+void vio_unmap_single(struct vio_dev *dev, dma_addr_t dma_handle, 
+		      size_t size, int direction);
+int vio_map_sg(struct vio_dev *vdev, struct scatterlist *sglist, 
+	       int nelems, int direction);
+void vio_unmap_sg(struct vio_dev *vdev, struct scatterlist *sglist, 
+		  int nelems, int direction);
+void *vio_alloc_consistent(struct vio_dev *dev, size_t size, 
+			   dma_addr_t *dma_handle);
+void vio_free_consistent(struct vio_dev *dev, size_t size, void *vaddr, 
+			 dma_addr_t dma_handle);
+
+struct vio_device_id {
+	char *type;
+	char *compat;
+/* I don't think we need this
+	unsigned long driver_data;	*/ /* Data private to the driver */
+};
+
+struct vio_driver {
+	struct list_head node;
+	char *name;
+	const struct vio_device_id *id_table;	/* NULL if wants all devices */
+	int  (*probe)  (struct vio_dev *dev, const struct vio_device_id *id);	/* New device inserted */
+	void (*remove) (struct vio_dev *dev);	/* Device removed (NULL if not a hot-plug capable driver) */
+	unsigned long driver_data;
+};
+
+struct vio_bus;
+/*
+ * The vio_dev structure is used to describe virtual I/O devices.
+ */
+struct vio_dev {
+	struct list_head devices_list;   /* node in list of all vio devices */
+	struct device_node *archdata;    /* Open Firmware node */
+	struct vio_bus *bus;            /* bus this device is on */
+	struct vio_driver *driver;      /* owning driver */
+	void *driver_data;              /* data private to the driver */
+	unsigned long unit_address;	
+
+	struct TceTable *tce_table; /* vio_map_* uses this */
+	unsigned int irq;
+	struct proc_dir_entry *procent; /* device entry in /proc/bus/vio */
+};
+
+struct vio_bus {
+	struct list_head devices;       /* list of virtual devices */
+};
+
+
+static inline int vio_module_init(struct vio_driver *drv)
+{
+        int rc = vio_register_driver (drv);
+
+        if (rc > 0)
+                return 0;
+
+        /* iff CONFIG_HOTPLUG and built into kernel, we should
+         * leave the driver around for future hotplug events.
+         * For the module case, a hotplug daemon of some sort
+         * should load a module in response to an insert event. */
+#if defined(CONFIG_HOTPLUG) && !defined(MODULE)
+        if (rc == 0)
+                return 0;
+#else
+        if (rc == 0)
+                rc = -ENODEV;
+#endif
+
+        /* if we get here, we need to clean up vio driver instance
+         * and return some sort of error */
+
+        return rc;
+}
+
+#endif /* _PHYP_H */
diff -Nru a/include/asm-s390/atomic.h b/include/asm-s390/atomic.h
--- a/include/asm-s390/atomic.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-s390/atomic.h	Tue Feb  3 19:45:16 2004
@@ -1,7 +1,6 @@
 #ifndef __ARCH_S390_ATOMIC__
 #define __ARCH_S390_ATOMIC__
 
-#ifdef __KERNEL__
 /*
  *  include/asm-s390/atomic.h
  *
@@ -27,6 +26,8 @@
 } __attribute__ ((aligned (4))) atomic_t;
 #define ATOMIC_INIT(i)  { (i) }
 
+#ifdef __KERNEL__
+
 #define __CS_LOOP(ptr, op_val, op_string) ({				\
 	typeof(ptr->counter) old_val, new_val;				\
         __asm__ __volatile__("   l     %0,0(%3)\n"			\
@@ -35,8 +36,10 @@
                              "   cs    %0,%1,0(%3)\n"			\
                              "   jl    0b"				\
                              : "=&d" (old_val), "=&d" (new_val),	\
-			       "+m" (((atomic_t *)(ptr))->counter)	\
-			     : "a" (ptr), "d" (op_val) : "cc" );	\
+			       "=m" (((atomic_t *)(ptr))->counter)	\
+			     : "a" (ptr), "d" (op_val),			\
+			       "m" (((atomic_t *)(ptr))->counter)	\
+			     : "cc", "memory" );			\
 	new_val;							\
 })
 #define atomic_read(v)          ((v)->counter)
@@ -106,8 +109,10 @@
                              "   csg   %0,%1,0(%3)\n"			\
                              "   jl    0b"				\
                              : "=&d" (old_val), "=&d" (new_val),	\
-			       "+m" (((atomic_t *)(ptr))->counter)	\
-			     : "a" (ptr), "d" (op_val) : "cc" );	\
+			       "=m" (((atomic_t *)(ptr))->counter)	\
+			     : "a" (ptr), "d" (op_val),			\
+			       "m" (((atomic_t *)(ptr))->counter)	\
+			     : "cc", "memory" );			\
 	new_val;							\
 })
 #define atomic64_read(v)          ((v)->counter)
@@ -182,9 +187,9 @@
                 "  ipm  %0\n"
                 "  srl  %0,28\n"
                 "0:"
-                : "=&d" (retval), "+m" (v->counter)
-                : "a" (v), "d" (expected_oldval) , "d" (new_val)
-                : "cc" );
+                : "=&d" (retval), "=m" (v->counter)
+                : "a" (v), "d" (expected_oldval) , "d" (new_val),
+		  "m" (v->counter) : "cc", "memory" );
         return retval;
 }
 
diff -Nru a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h
--- a/include/asm-s390/bitops.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-s390/bitops.h	Tue Feb  3 19:45:16 2004
@@ -13,6 +13,7 @@
  *
  */
 #include <linux/config.h>
+#include <linux/compiler.h>
 
 /*
  * 32 bit bitops format:
@@ -109,6 +110,8 @@
 
 #endif /* __s390x__ */
 
+#define __BITOPS_BARRIER() __asm__ __volatile__ ( "" : : : "memory" )
+
 #ifdef CONFIG_SMP
 /*
  * SMP safe set_bit routine based on compare and swap (CS)
@@ -189,6 +192,7 @@
 	mask = 1UL << (nr & (__BITOPS_WORDSIZE - 1));
 	/* Do the atomic update. */
 	__BITOPS_LOOP(old, new, addr, mask, __BITOPS_OR);
+	__BITOPS_BARRIER();
 	return (old & mask) != 0;
 }
 
@@ -211,6 +215,7 @@
 	mask = ~(1UL << (nr & (__BITOPS_WORDSIZE - 1)));
 	/* Do the atomic update. */
 	__BITOPS_LOOP(old, new, addr, mask, __BITOPS_AND);
+	__BITOPS_BARRIER();
 	return (old ^ new) != 0;
 }
 
@@ -233,6 +238,7 @@
 	mask = 1UL << (nr & (__BITOPS_WORDSIZE - 1));
 	/* Do the atomic update. */
 	__BITOPS_LOOP(old, new, addr, mask, __BITOPS_XOR);
+	__BITOPS_BARRIER();
 	return (old & mask) != 0;
 }
 #endif /* CONFIG_SMP */
@@ -435,7 +441,7 @@
         asm volatile("oc 0(1,%1),0(%2)"
 		     : "=m" (*(char *) addr)
 		     : "a" (addr), "a" (_oi_bitmap + (nr & 7)),
-		       "m" (*(char *) addr) : "cc" );
+		       "m" (*(char *) addr) : "cc", "memory" );
 	return (ch >> (nr & 7)) & 1;
 }
 #define __test_and_set_bit(X,Y)		test_and_set_bit_simple(X,Y)
@@ -454,7 +460,7 @@
         asm volatile("nc 0(1,%1),0(%2)"
 		     : "=m" (*(char *) addr)
 		     : "a" (addr), "a" (_ni_bitmap + (nr & 7)),
-		       "m" (*(char *) addr) : "cc" );
+		       "m" (*(char *) addr) : "cc", "memory" );
 	return (ch >> (nr & 7)) & 1;
 }
 #define __test_and_clear_bit(X,Y)	test_and_clear_bit_simple(X,Y)
@@ -473,7 +479,7 @@
         asm volatile("xc 0(1,%1),0(%2)"
 		     : "=m" (*(char *) addr)
 		     : "a" (addr), "a" (_oi_bitmap + (nr & 7)),
-		       "m" (*(char *) addr) : "cc" );
+		       "m" (*(char *) addr) : "cc", "memory" );
 	return (ch >> (nr & 7)) & 1;
 }
 #define __test_and_change_bit(X,Y)	test_and_change_bit_simple(X,Y)
@@ -526,10 +532,10 @@
  * Find-bit routines..
  */
 static inline int
-find_first_zero_bit(unsigned long * addr, unsigned size)
+find_first_zero_bit(unsigned long * addr, unsigned int size)
 {
 	unsigned long cmp, count;
-        int res;
+        unsigned int res;
 
         if (!size)
                 return 0;
@@ -565,10 +571,10 @@
 }
 
 static inline int
-find_first_bit(unsigned long * addr, unsigned size)
+find_first_bit(unsigned long * addr, unsigned int size)
 {
 	unsigned long cmp, count;
-        int res;
+        unsigned int res;
 
         if (!size)
                 return 0;
@@ -681,59 +687,6 @@
         return (offset + res);
 }
 
-/*
- * ffz = Find First Zero in word. Undefined if no zero exists,
- * so code should check against ~0UL first..
- */
-static inline unsigned long ffz(unsigned long word)
-{
-	unsigned long reg;
-        int result;
-
-        __asm__("   slr  %0,%0\n"
-                "   lhi  %2,0xff\n"
-                "   tml  %1,0xffff\n"
-                "   jno  0f\n"
-                "   ahi  %0,16\n"
-                "   srl  %1,16\n"
-                "0: tml  %1,0x00ff\n"
-                "   jno  1f\n"
-                "   ahi  %0,8\n"
-                "   srl  %1,8\n"
-                "1: nr   %1,%2\n"
-                "   ic   %1,0(%1,%3)\n"
-                "   alr  %0,%1"
-                : "=&d" (result), "+a" (word), "=&d" (reg)
-                : "a" (&_zb_findmap) : "cc" );
-        return result;
-}
-
-/*
- * __ffs = find first bit in word. Undefined if no bit exists,
- * so code should check against 0UL first..
- */
-static inline unsigned long __ffs (unsigned long word)
-{
-	unsigned long reg, result;
-
-        __asm__("   slr  %0,%0\n"
-                "   lhi  %2,0xff\n"
-                "   tml  %1,0xffff\n"
-                "   jnz  0f\n"
-                "   ahi  %0,16\n"
-                "   srl  %1,16\n"
-                "0: tml  %1,0x00ff\n"
-                "   jnz  1f\n"
-                "   ahi  %0,8\n"
-                "   srl  %1,8\n"
-                "1: nr   %1,%2\n"
-                "   ic   %1,0(%1,%3)\n"
-                "   alr  %0,%1"
-                : "=&d" (result), "+a" (word), "=&d" (reg)
-                : "a" (&_sb_findmap) : "cc" );
-        return result;
-}
-
 #else /* __s390x__ */
 
 /*
@@ -910,35 +863,31 @@
         return (offset + res);
 }
 
+#endif /* __s390x__ */
+
 /*
  * ffz = Find First Zero in word. Undefined if no zero exists,
  * so code should check against ~0UL first..
  */
 static inline unsigned long ffz(unsigned long word)
 {
-	unsigned long reg, result;
+        unsigned long bit = 0;
 
-        __asm__("   lhi  %2,-1\n"
-                "   slgr %0,%0\n"
-                "   clr  %1,%2\n"
-                "   jne  0f\n"
-                "   aghi %0,32\n"
-                "   srlg %1,%1,32\n"
-                "0: lghi %2,0xff\n"
-                "   tmll %1,0xffff\n"
-                "   jno  1f\n"
-                "   aghi %0,16\n"
-                "   srlg %1,%1,16\n"
-                "1: tmll %1,0x00ff\n"
-                "   jno  2f\n"
-                "   aghi %0,8\n"
-                "   srlg %1,%1,8\n"
-                "2: ngr  %1,%2\n"
-                "   ic   %1,0(%1,%3)\n"
-                "   algr %0,%1"
-                : "=&d" (result), "+a" (word), "=&d" (reg)
-                : "a" (&_zb_findmap) : "cc" );
-        return result;
+#ifdef __s390x__
+	if (likely((word & 0xffffffff) == 0xffffffff)) {
+		word >>= 32;
+		bit += 32;
+	}
+#endif
+	if (likely((word & 0xffff) == 0xffff)) {
+		word >>= 16;
+		bit += 16;
+	}
+	if (likely((word & 0xff) == 0xff)) {
+		word >>= 8;
+		bit += 8;
+	}
+	return bit + _zb_findmap[word & 0xff];
 }
 
 /*
@@ -947,32 +896,25 @@
  */
 static inline unsigned long __ffs (unsigned long word)
 {
-        unsigned long reg, result;
+	unsigned long bit = 0;
 
-        __asm__("   slgr %0,%0\n"
-                "   ltr  %1,%1\n"
-                "   jnz  0f\n"
-                "   aghi %0,32\n"
-                "   srlg %1,%1,32\n"
-                "0: lghi %2,0xff\n"
-                "   tmll %1,0xffff\n"
-                "   jnz  1f\n"
-                "   aghi %0,16\n"
-                "   srlg %1,%1,16\n"
-                "1: tmll %1,0x00ff\n"
-                "   jnz  2f\n"
-                "   aghi %0,8\n"
-                "   srlg %1,%1,8\n"
-                "2: ngr  %1,%2\n"
-                "   ic   %1,0(%1,%3)\n"
-                "   algr %0,%1"
-                : "=&d" (result), "+a" (word), "=&d" (reg)
-                : "a" (&_sb_findmap) : "cc" );
-        return result;
+#ifdef __s390x__
+	if (likely((word & 0xffffffff) == 0)) {
+		word >>= 32;
+		bit += 32;
+	}
+#endif
+	if (likely((word & 0xffff) == 0)) {
+		word >>= 16;
+		bit += 16;
+	}
+	if (likely((word & 0xff) == 0)) {
+		word >>= 8;
+		bit += 8;
+	}
+	return bit + _sb_findmap[word & 0xff];
 }
 
-#endif /* __s390x__ */
-
 /*
  * Every architecture must define this function. It's the fastest
  * way of searching a 140-bit bitmap where the first 100 bits are
@@ -989,68 +931,12 @@
  * the libc and compiler builtin ffs routines, therefore
  * differs in spirit from the above ffz (man ffs).
  */
-extern inline int ffs (int x)
-{
-        int r = 1;
-
-        if (x == 0)
-		return 0;
-        __asm__("    tml  %1,0xffff\n"
-                "    jnz  0f\n"
-                "    srl  %1,16\n"
-                "    ahi  %0,16\n"
-                "0:  tml  %1,0x00ff\n"
-                "    jnz  1f\n"
-                "    srl  %1,8\n"
-                "    ahi  %0,8\n"
-                "1:  tml  %1,0x000f\n"
-                "    jnz  2f\n"
-                "    srl  %1,4\n"
-                "    ahi  %0,4\n"
-                "2:  tml  %1,0x0003\n"
-                "    jnz  3f\n"
-                "    srl  %1,2\n"
-                "    ahi  %0,2\n"
-                "3:  tml  %1,0x0001\n"
-                "    jnz  4f\n"
-                "    ahi  %0,1\n"
-                "4:"
-                : "=&d" (r), "+d" (x) : : "cc" );
-        return r;
-}
+#define ffs(x) generic_ffs(x)
 
 /*
  * fls: find last bit set.
  */
-extern __inline__ int fls(int x)
-{
-	int r = 32;
-
-	if (x == 0)
-		return 0;
-	__asm__("    tmh  %1,0xffff\n"
-		"    jz   0f\n"
-		"    sll  %1,16\n"
-		"    ahi  %0,-16\n"
-		"0:  tmh  %1,0xff00\n"
-		"    jz   1f\n"
-		"    sll  %1,8\n"
-		"    ahi  %0,-8\n"
-		"1:  tmh  %1,0xf000\n"
-		"    jz   2f\n"
-		"    sll  %1,4\n"
-		"    ahi  %0,-4\n"
-		"2:  tmh  %1,0xc000\n"
-		"    jz   3f\n"
-		"    sll  %1,2\n"
-		"    ahi  %0,-2\n"
-		"3:  tmh  %1,0x8000\n"
-		"    jz   4f\n"
-		"    ahi  %0,-1\n"
-		"4:"
-		: "+d" (r), "+d" (x) : : "cc" );
-	return r;
-}
+#define fls(x) generic_fls(x)
 
 /*
  * hweightN: returns the hamming weight (i.e. the number
@@ -1095,10 +981,10 @@
 #ifndef __s390x__
 
 static inline int 
-ext2_find_first_zero_bit(void *vaddr, unsigned size)
+ext2_find_first_zero_bit(void *vaddr, unsigned int size)
 {
 	unsigned long cmp, count;
-        int res;
+        unsigned int res;
 
         if (!size)
                 return 0;
@@ -1135,12 +1021,12 @@
 }
 
 static inline int 
-ext2_find_next_zero_bit(void *vaddr, unsigned size, unsigned offset)
+ext2_find_next_zero_bit(void *vaddr, unsigned int size, unsigned offset)
 {
         unsigned long *addr = vaddr;
         unsigned long *p = addr + (offset >> 5);
         unsigned long word, reg;
-        int bit = offset & 31UL, res;
+        unsigned int bit = offset & 31UL, res;
 
         if (offset >= size)
                 return size;
@@ -1273,11 +1159,16 @@
 
 /* Bitmap functions for the minix filesystem.  */
 /* FIXME !!! */
-#define minix_test_and_set_bit(nr,addr) test_and_set_bit(nr,addr)
-#define minix_set_bit(nr,addr) set_bit(nr,addr)
-#define minix_test_and_clear_bit(nr,addr) test_and_clear_bit(nr,addr)
-#define minix_test_bit(nr,addr) test_bit(nr,addr)
-#define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size)
+#define minix_test_and_set_bit(nr,addr) \
+	test_and_set_bit(nr,(unsigned long *)addr)
+#define minix_set_bit(nr,addr) \
+	set_bit(nr,(unsigned long *)addr)
+#define minix_test_and_clear_bit(nr,addr) \
+	test_and_clear_bit(nr,(unsigned long *)addr)
+#define minix_test_bit(nr,addr) \
+	test_bit(nr,(unsigned long *)addr)
+#define minix_find_first_zero_bit(addr,size) \
+	find_first_zero_bit(addr,size)
 
 #endif /* __KERNEL__ */
 
diff -Nru a/include/asm-s390/bug.h b/include/asm-s390/bug.h
--- a/include/asm-s390/bug.h	Tue Feb  3 19:45:35 2004
+++ b/include/asm-s390/bug.h	Tue Feb  3 19:45:35 2004
@@ -1,6 +1,8 @@
 #ifndef _S390_BUG_H
 #define _S390_BUG_H
 
+#include <linux/kernel.h>
+
 #define BUG() do { \
         printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
         __asm__ __volatile__(".long 0"); \
diff -Nru a/include/asm-s390/byteorder.h b/include/asm-s390/byteorder.h
--- a/include/asm-s390/byteorder.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-s390/byteorder.h	Tue Feb  3 19:45:43 2004
@@ -14,7 +14,7 @@
 #ifdef __GNUC__
 
 #ifdef __s390x__
-static __inline__ __const__ __u64 ___arch__swab64p(__u64 *x)
+static __inline__ __u64 ___arch__swab64p(__u64 *x)
 {
 	__u64 result;
 
@@ -24,7 +24,7 @@
 	return result;
 }
 
-static __inline__ __const__ __u64 ___arch__swab64(__u64 x)
+static __inline__ __u64 ___arch__swab64(__u64 x)
 {
 	__u64 result;
 
@@ -40,7 +40,7 @@
 }
 #endif /* __s390x__ */
 
-static __inline__ __const__ __u32 ___arch__swab32p(__u32 *x)
+static __inline__ __u32 ___arch__swab32p(__u32 *x)
 {
 	__u32 result;
 	
@@ -50,7 +50,7 @@
 		"        icm   %0,4,2(%1)\n"
 		"        icm   %0,2,1(%1)\n"
 		"        ic    %0,0(%1)"
-		: "=&d" (result) : "a" (x) : "cc" );
+		: "=&d" (result) : "a" (x), "m" (*x) : "cc" );
 #else /* __s390x__ */
 		"   lrv  %0,%1"
 		: "=d" (result) : "m" (*x) );
@@ -58,7 +58,7 @@
 	return result;
 }
 
-static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
+static __inline__ __u32 ___arch__swab32(__u32 x)
 {
 #ifndef __s390x__
 	return ___arch__swab32p(&x);
@@ -67,7 +67,7 @@
 	
 	__asm__ __volatile__ (
 		"   lrvr  %0,%1"
-		: "=d" (result) : "d" (x) );
+		: "=d" (result) : "d" (x), "m" (x) );
 	return result;
 #endif /* __s390x__ */
 }
@@ -77,7 +77,7 @@
 	*x = ___arch__swab32p(x);
 }
 
-static __inline__ __const__ __u16 ___arch__swab16p(__u16 *x)
+static __inline__ __u16 ___arch__swab16p(__u16 *x)
 {
 	__u16 result;
 	
@@ -85,7 +85,7 @@
 #ifndef __s390x__
 		"        icm   %0,2,1(%1)\n"
 		"        ic    %0,0(%1)\n"
-		: "=&d" (result) : "a" (x) : "cc" );
+		: "=&d" (result) : "a" (x), "m" (*x) : "cc" );
 #else /* __s390x__ */
 		"   lrvh %0,%1"
 		: "=d" (result) : "m" (*x) );
@@ -93,7 +93,7 @@
 	return result;
 }
 
-static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
+static __inline__ __u16 ___arch__swab16(__u16 x)
 {
 	return ___arch__swab16p(&x);
 }
diff -Nru a/include/asm-s390/ccwdev.h b/include/asm-s390/ccwdev.h
--- a/include/asm-s390/ccwdev.h	Tue Feb  3 19:45:41 2004
+++ b/include/asm-s390/ccwdev.h	Tue Feb  3 19:45:41 2004
@@ -89,10 +89,11 @@
 	struct module *owner;		/* for automatic MOD_INC_USE_COUNT   */
 	struct ccw_device_id *ids;	/* probe driver with these devs      */
 	int (*probe) (struct ccw_device *); /* ask driver to probe dev 	     */
-	int (*remove) (struct ccw_device *);
+	void (*remove) (struct ccw_device *);
 					/* device is no longer available     */
 	int (*set_online) (struct ccw_device *);
 	int (*set_offline) (struct ccw_device *);
+	int (*notify) (struct ccw_device *, int);
 	struct device_driver driver;	/* higher level structure, don't init
 					   this from your driver	     */
 	char *name;
@@ -149,8 +150,8 @@
 extern int read_dev_chars(struct ccw_device *cdev, void **buffer, int length);
 extern int read_conf_data(struct ccw_device *cdev, void **buffer, int *length);
 
-extern void ccw_device_set_online(struct ccw_device *cdev);
-extern void ccw_device_set_offline(struct ccw_device *cdev);
+extern int ccw_device_set_online(struct ccw_device *cdev);
+extern int ccw_device_set_offline(struct ccw_device *cdev);
 
 
 extern struct ciw *ccw_device_get_ciw(struct ccw_device *, __u32 cmd);
@@ -166,5 +167,8 @@
 // FIXME: these have to go
 extern int _ccw_device_get_device_number(struct ccw_device *);
 extern int _ccw_device_get_subchannel_number(struct ccw_device *);
+
+extern struct device *s390_root_dev_register(const char *);
+extern void s390_root_dev_unregister(struct device *);
 
 #endif /* _S390_CCWDEV_H_ */
diff -Nru a/include/asm-s390/ccwgroup.h b/include/asm-s390/ccwgroup.h
--- a/include/asm-s390/ccwgroup.h	Tue Feb  3 19:45:28 2004
+++ b/include/asm-s390/ccwgroup.h	Tue Feb  3 19:45:28 2004
@@ -21,8 +21,7 @@
 	unsigned long driver_id;
 
 	int (*probe) (struct ccwgroup_device *);
-	int (*remove) (struct ccwgroup_device *);
-	int (*release) (struct ccwgroup_driver *);
+	void (*remove) (struct ccwgroup_device *);
 	int (*set_online) (struct ccwgroup_device *);
 	int (*set_offline) (struct ccwgroup_device *);
 
@@ -37,7 +36,7 @@
 			    int argc, char *argv[]);
 
 extern int ccwgroup_probe_ccwdev(struct ccw_device *cdev);
-extern int ccwgroup_remove_ccwdev(struct ccw_device *cdev);
+extern void ccwgroup_remove_ccwdev(struct ccw_device *cdev);
 
 #define to_ccwgroupdev(x) container_of((x), struct ccwgroup_device, dev)
 #define to_ccwgroupdrv(x) container_of((x), struct ccwgroup_driver, driver)
diff -Nru a/include/asm-s390/checksum.h b/include/asm-s390/checksum.h
--- a/include/asm-s390/checksum.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-s390/checksum.h	Tue Feb  3 19:45:16 2004
@@ -42,7 +42,7 @@
 	__asm__ __volatile__ (
 		"0:  cksm %0,%1\n"	/* do checksum on longs */
 		"    jo   0b\n"
-		: "+&d" (sum), "+&a" (rp) : : "cc" );
+		: "+&d" (sum), "+&a" (rp) : : "cc", "memory" );
 #else /* __s390x__ */
         __asm__ __volatile__ (
                 "    lgr  2,%1\n"    /* address in gpr 2 */
@@ -51,7 +51,7 @@
                 "    jo   0b\n"
                 : "+&d" (sum)
                 : "d" (buff), "d" (len)
-                : "cc", "2", "3" );
+                : "cc", "memory", "2", "3" );
 #endif /* __s390x__ */
 	return sum;
 }
@@ -70,7 +70,7 @@
 	__asm__ __volatile__ (
 		"0:  cksm %0,%1\n"    /* do checksum on longs */
 		"    jo   0b\n"
-                : "+&d" (sum), "+&a" (rp) : : "cc" );
+                : "+&d" (sum), "+&a" (rp) : : "cc", "memory" );
 #else /* __s390x__ */
 	__asm__ __volatile__ (
 		"    lgr  2,%1\n"    /* address in gpr 2 */
@@ -79,7 +79,7 @@
 		"    jo   0b\n"
                 : "+&d" (sum)
 		: "d" (buff), "d" (len)
-                : "cc", "2", "3" );
+                : "cc", "memory", "2", "3" );
 #endif /* __s390x__ */
 	return sum;
 }
@@ -165,7 +165,7 @@
 		"    sr   %0,%0\n"   /* set sum to zero */
                 "0:  cksm %0,%1\n"   /* do checksum on longs */
                 "    jo   0b\n"
-                : "=&d" (sum), "+&a" (rp) : : "cc" );
+                : "=&d" (sum), "+&a" (rp) : : "cc", "memory" );
 #else /* __s390x__ */
         __asm__ __volatile__ (
 		"    slgr %0,%0\n"   /* set sum to zero */
@@ -175,7 +175,7 @@
                 "    jo   0b\n"
                 : "=&d" (sum)
                 : "d" (iph), "d" (ihl*4)
-                : "cc", "2", "3" );
+                : "cc", "memory", "2", "3" );
 #endif /* __s390x__ */
         return csum_fold(sum);
 }
diff -Nru a/include/asm-s390/cio.h b/include/asm-s390/cio.h
--- a/include/asm-s390/cio.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-s390/cio.h	Tue Feb  3 19:45:42 2004
@@ -247,6 +247,14 @@
 #define DOIO_DENY_PREFETCH	 0x0002 /* don't allow for CCW prefetch */
 #define DOIO_SUPPRESS_INTER	 0x0004 /* suppress intermediate inter. */
 					/* ... for suspended CCWs */
+/* Device or subchannel gone. */
+#define CIO_GONE       0x0001
+/* No path to device. */
+#define CIO_NO_PATH    0x0002
+/* Device has appeared. */
+#define CIO_OPER       0x0004
+/* Sick revalidation of device. */
+#define CIO_REVALIDATE 0x0008
 
 struct diag210 {
 	__u16 vrdcdvno : 16;   /* device number (input) */
diff -Nru a/include/asm-s390/dasd.h b/include/asm-s390/dasd.h
--- a/include/asm-s390/dasd.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-s390/dasd.h	Tue Feb  3 19:45:17 2004
@@ -8,7 +8,7 @@
  * any future changes wrt the API will result in a change of the APIVERSION reported
  * to userspace by the DASDAPIVER-ioctl
  *
- * $Revision: 1.4 $
+ * $Revision: 1.6 $
  *
  */
 
@@ -69,9 +69,11 @@
  * values to be used for dasd_information_t.features
  * 0x00: default features
  * 0x01: readonly (ro)
+ * 0x02: use diag discipline (diag)
  */
 #define DASD_FEATURE_DEFAULT  0
 #define DASD_FEATURE_READONLY 1
+#define DASD_FEATURE_USEDIAG  2
 
 #define DASD_PARTN_BITS 2
 
@@ -234,6 +236,8 @@
 #define BIODASDINFO2   _IOR(DASD_IOCTL_LETTER,3,dasd_information2_t)
 /* Performance Statistics Read */
 #define BIODASDPSRD    _IOR(DASD_IOCTL_LETTER,4,dasd_rssd_perf_stats_t)
+/* Get Attributes (cache operations) */
+#define BIODASDGATTR   _IOR(DASD_IOCTL_LETTER,5,attrib_data_t) 
 
 
 /* #define BIODASDFORMAT  _IOW(IOCTL_LETTER,0,format_data_t) , deprecated */
diff -Nru a/include/asm-s390/div64.h b/include/asm-s390/div64.h
--- a/include/asm-s390/div64.h	Tue Feb  3 19:45:33 2004
+++ b/include/asm-s390/div64.h	Tue Feb  3 19:45:33 2004
@@ -36,8 +36,8 @@
 	     "   ahi  1,1\n"					\
 	     "1: st   1,4+%1\n"					\
              "   lr   %0,0"					\
-	     : "=d" (__r), "+m" (__n)				\
-	     : "d" (base) : "0", "1", "2", "cc" );		\
+	     : "=d" (__r), "=m" (__n)				\
+	     : "d" (base), "m" (__n) : "0", "1", "2", "cc" );	\
 	(n) = (__n);						\
         __r;                                                    \
 })
diff -Nru a/include/asm-s390/hardirq.h b/include/asm-s390/hardirq.h
--- a/include/asm-s390/hardirq.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-s390/hardirq.h	Tue Feb  3 19:45:43 2004
@@ -25,9 +25,17 @@
 	unsigned int __softirq_pending;
 } irq_cpustat_t;
 
-#define softirq_pending(cpu) (lowcore_ptr[(cpu)]->softirq_pending)
 #define local_softirq_pending() (S390_lowcore.softirq_pending)
 
+/* this is always called with cpu == smp_processor_id() at the moment */
+static inline __u32
+softirq_pending(unsigned int cpu)
+{
+	if (cpu == smp_processor_id())
+		return local_softirq_pending();
+	return lowcore_ptr[cpu]->softirq_pending;
+}
+
 #define __ARCH_IRQ_STAT
 
 /*
@@ -42,12 +50,12 @@
  *
  * PREEMPT_MASK: 0x000000ff
  * SOFTIRQ_MASK: 0x0000ff00
- * HARDIRQ_MASK: 0x00010000
+ * HARDIRQ_MASK: 0x00ff0000
  */
 
 #define PREEMPT_BITS	8
 #define SOFTIRQ_BITS	8
-#define HARDIRQ_BITS	1
+#define HARDIRQ_BITS	8
 
 #define PREEMPT_SHIFT	0
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
@@ -81,7 +89,6 @@
 
 #define irq_enter()							\
 do {									\
-	BUG_ON( hardirq_count() );					\
 	(preempt_count() += HARDIRQ_OFFSET);				\
 } while(0)
 	
diff -Nru a/include/asm-s390/idals.h b/include/asm-s390/idals.h
--- a/include/asm-s390/idals.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-s390/idals.h	Tue Feb  3 19:45:16 2004
@@ -223,8 +223,7 @@
 	size_t left;
 	int i;
 
-	if (count > ib->size)
-		BUG();
+	BUG_ON(count > ib->size);
 	for (i = 0; count > IDA_BLOCK_SIZE; i++) {
 		left = copy_to_user(to, ib->data[i], IDA_BLOCK_SIZE);
 		if (left)
@@ -244,8 +243,7 @@
 	size_t left;
 	int i;
 
-	if (count > ib->size)
-		BUG();
+	BUG_ON(count > ib->size);
 	for (i = 0; count > IDA_BLOCK_SIZE; i++) {
 		left = copy_from_user(ib->data[i], from, IDA_BLOCK_SIZE);
 		if (left)
diff -Nru a/include/asm-s390/ioctl.h b/include/asm-s390/ioctl.h
--- a/include/asm-s390/ioctl.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-s390/ioctl.h	Tue Feb  3 19:45:34 2004
@@ -55,11 +55,21 @@
 	 ((nr)   << _IOC_NRSHIFT) | \
 	 ((size) << _IOC_SIZESHIFT))
 
+/* provoke compile error for invalid uses of size argument */
+extern unsigned long __invalid_size_argument_for_IOC;
+#define _IOC_TYPECHECK(t) \
+	((sizeof(t) == sizeof(t[1]) && \
+	  sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
+	  sizeof(t) : __invalid_size_argument_for_IOC)
+
 /* used to create numbers */
 #define _IO(type,nr)		_IOC(_IOC_NONE,(type),(nr),0)
-#define _IOR(type,nr,size)	_IOC(_IOC_READ,(type),(nr),sizeof(size))
-#define _IOW(type,nr,size)	_IOC(_IOC_WRITE,(type),(nr),sizeof(size))
-#define _IOWR(type,nr,size)	_IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
+#define _IOR(type,nr,size)	_IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
+#define _IOW(type,nr,size)	_IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
+#define _IOWR(type,nr,size)	_IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
+#define _IOR_BAD(type,nr,size)	_IOC(_IOC_READ,(type),(nr),sizeof(size))
+#define _IOW_BAD(type,nr,size)	_IOC(_IOC_WRITE,(type),(nr),sizeof(size))
+#define _IOWR_BAD(type,nr,size)	_IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
 
 /* used to decode ioctl numbers.. */
 #define _IOC_DIR(nr)		(((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
diff -Nru a/include/asm-s390/mmu_context.h b/include/asm-s390/mmu_context.h
--- a/include/asm-s390/mmu_context.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-s390/mmu_context.h	Tue Feb  3 19:45:17 2004
@@ -14,7 +14,7 @@
  */
 #define init_new_context(tsk,mm)        0
 
-#define destroy_context(mm)             flush_tlb_mm(mm)
+#define destroy_context(mm)             do { } while (0)
 
 static inline void enter_lazy_tlb(struct mm_struct *mm,
                                   struct task_struct *tsk)
diff -Nru a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h
--- a/include/asm-s390/pgalloc.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-s390/pgalloc.h	Tue Feb  3 19:45:30 2004
@@ -84,7 +84,11 @@
 	free_pages((unsigned long) pmd, 2);
 }
 
-#define __pmd_free_tlb(tlb,pmd) pmd_free(pmd)
+#define __pmd_free_tlb(tlb,pmd)			\
+	do {					\
+		tlb_flush_mmu(tlb, 0, 0);	\
+		pmd_free(pmd);			\
+	 } while (0)
 
 static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd)
 {
@@ -146,7 +150,7 @@
         __free_page(pte);
 }
 
-#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
+#define __pte_free_tlb(tlb,pte) tlb_remove_page(tlb,pte)
 
 /*
  * This establishes kernel virtual mappings (e.g., as a result of a
@@ -154,30 +158,5 @@
  * there is nothing to do here... :)
  */
 #define set_pgdir(addr,entry) do { } while(0)
-
-static inline pte_t ptep_invalidate(struct vm_area_struct *vma, 
-                                    unsigned long address, pte_t *ptep)
-{
-	pte_t pte = *ptep;
-#ifndef __s390x__
-	if (!(pte_val(pte) & _PAGE_INVALID)) {
-		/* S390 has 1mb segments, we are emulating 4MB segments */
-		pte_t *pto = (pte_t *) (((unsigned long) ptep) & 0x7ffffc00);
-		__asm__ __volatile__ ("ipte %0,%1" : : "a" (pto), "a" (address));
-	}
-#else /* __s390x__ */
-	if (!(pte_val(pte) & _PAGE_INVALID)) 
-		__asm__ __volatile__ ("ipte %0,%1" : : "a" (ptep), "a" (address));
-#endif /* __s390x__ */
-	pte_clear(ptep);
-	return pte;
-}
-
-static inline void ptep_establish(struct vm_area_struct *vma, 
-                                  unsigned long address, pte_t *ptep, pte_t entry)
-{
-	ptep_invalidate(vma, address, ptep);
-	set_pte(ptep, entry);
-}
 
 #endif /* _S390_PGALLOC_H */
diff -Nru a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h
--- a/include/asm-s390/pgtable.h	Tue Feb  3 19:45:37 2004
+++ b/include/asm-s390/pgtable.h	Tue Feb  3 19:45:37 2004
@@ -29,9 +29,12 @@
  * the S390 page table tree.
  */
 #ifndef __ASSEMBLY__
+#include <asm/bug.h>
 #include <asm/processor.h>
 #include <linux/threads.h>
 
+struct vm_area_struct; /* forward declaration (include/linux/mm.h) */
+
 extern pgd_t swapper_pg_dir[] __attribute__ ((aligned (4096)));
 extern void paging_init(void);
 
@@ -210,9 +213,6 @@
 #define _PAGE_RO        0x200          /* HW read-only                     */
 #define _PAGE_INVALID   0x400          /* HW invalid                       */
 
-/* Software bits in the page table entry */
-#define _PAGE_ISCLEAN   0x002
-
 /* Mask and four different kinds of invalid pages. */
 #define _PAGE_INVALID_MASK	0x601
 #define _PAGE_INVALID_EMPTY	0x400
@@ -280,12 +280,12 @@
  * No mapping available
  */
 #define PAGE_NONE_SHARED  __pgprot(_PAGE_INVALID_NONE)
-#define PAGE_NONE_PRIVATE __pgprot(_PAGE_INVALID_NONE|_PAGE_ISCLEAN)
+#define PAGE_NONE_PRIVATE __pgprot(_PAGE_INVALID_NONE)
 #define PAGE_RO_SHARED	  __pgprot(_PAGE_RO)
-#define PAGE_RO_PRIVATE	  __pgprot(_PAGE_RO|_PAGE_ISCLEAN)
-#define PAGE_COPY	  __pgprot(_PAGE_RO|_PAGE_ISCLEAN)
+#define PAGE_RO_PRIVATE	  __pgprot(_PAGE_RO)
+#define PAGE_COPY	  __pgprot(_PAGE_RO)
 #define PAGE_SHARED	  __pgprot(0)
-#define PAGE_KERNEL	  __pgprot(_PAGE_ISCLEAN)
+#define PAGE_KERNEL	  __pgprot(0)
 
 /*
  * The S390 can't do page protection for execute, and considers that the
@@ -400,20 +400,20 @@
 
 extern inline int pte_dirty(pte_t pte)
 {
-	int skey;
-
-	if (pte_val(pte) & _PAGE_ISCLEAN)
-		return 0;
-	asm volatile ("iske %0,%1" : "=d" (skey) : "a" (pte_val(pte)));
-	return skey & _PAGE_CHANGED;
+	/* A pte is neither clean nor dirty on s/390. The dirty bit
+	 * is in the storage key. See page_test_and_clear_dirty for
+	 * details.
+	 */
+	return 0;
 }
 
 extern inline int pte_young(pte_t pte)
 {
-	int skey;
-
-	asm volatile ("iske %0,%1" : "=d" (skey) : "a" (pte_val(pte)));
-	return skey & _PAGE_REFERENCED;
+	/* A pte is neither young nor old on s/390. The young bit
+	 * is in the storage key. See page_test_and_clear_young for
+	 * details.
+	 */
+	return 0;
 }
 
 /*
@@ -458,20 +458,22 @@
  */
 extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 {
-	pte_val(pte) &= PAGE_MASK | _PAGE_ISCLEAN;
-	pte_val(pte) |= pgprot_val(newprot) & ~_PAGE_ISCLEAN;
+	pte_val(pte) &= PAGE_MASK;
+	pte_val(pte) |= pgprot_val(newprot);
 	return pte;
 }
 
 extern inline pte_t pte_wrprotect(pte_t pte)
 {
-	pte_val(pte) |= _PAGE_RO;
+	/* Do not clobber _PAGE_INVALID_NONE pages!  */
+	if (!(pte_val(pte) & _PAGE_INVALID))
+		pte_val(pte) |= _PAGE_RO;
 	return pte;
 }
 
 extern inline pte_t pte_mkwrite(pte_t pte) 
 {
-	pte_val(pte) &= ~(_PAGE_RO | _PAGE_ISCLEAN);
+	pte_val(pte) &= ~_PAGE_RO;
 	return pte;
 }
 
@@ -490,50 +492,49 @@
 	 * sske instruction is slow. It is faster to let the
 	 * next instruction set the dirty bit.
 	 */
-	pte_val(pte) &= ~ _PAGE_ISCLEAN;
 	return pte;
 }
 
 extern inline pte_t pte_mkold(pte_t pte)
 {
-	asm volatile ("rrbe 0,%0" : : "a" (pte_val(pte)) : "cc" );
+	/* S/390 doesn't keep its dirty/referenced bit in the pte.
+	 * There is no point in clearing the real referenced bit.
+	 */
 	return pte;
 }
 
 extern inline pte_t pte_mkyoung(pte_t pte)
 {
-	/* To set the referenced bit we read the first word from the real
-	 * page with a special instruction: load using real address (lura).
-	 * Isn't S/390 a nice architecture ?! */
-	asm volatile ("lura 0,%0" : : "a" (pte_val(pte) & PAGE_MASK) : "0" );
+	/* S/390 doesn't keep its dirty/referenced bit in the pte.
+	 * There is no point in setting the real referenced bit.
+	 */
 	return pte;
 }
 
 static inline int ptep_test_and_clear_young(pte_t *ptep)
 {
-	int ccode;
+	return 0;
+}
 
-	asm volatile ("rrbe 0,%1\n\t"
-		      "ipm  %0\n\t"
-		      "srl  %0,28\n\t" 
-                      : "=d" (ccode) : "a" (pte_val(*ptep)) : "cc" );
-	return ccode & 2;
+static inline int
+ptep_clear_flush_young(struct vm_area_struct *vma,
+			unsigned long address, pte_t *ptep)
+{
+	/* No need to flush TLB; bits are in storage key */
+	return ptep_test_and_clear_young(ptep);
 }
 
 static inline int ptep_test_and_clear_dirty(pte_t *ptep)
 {
-	int skey;
+	return 0;
+}
 
-	if (pte_val(*ptep) & _PAGE_ISCLEAN)
-		return 0;
-	asm volatile ("iske %0,%1" : "=d" (skey) : "a" (*ptep));
-	if ((skey & _PAGE_CHANGED) == 0)
-		return 0;
-	/* We can't clear the changed bit atomically. For now we
-         * clear (!) the page referenced bit. */
-	asm volatile ("sske %0,%1" 
-	              : : "d" (0), "a" (*ptep));
-	return 1;
+static inline int
+ptep_clear_flush_dirty(struct vm_area_struct *vma,
+			unsigned long address, pte_t *ptep)
+{
+	/* No need to flush TLB; bits are in storage key */
+	return ptep_test_and_clear_dirty(ptep);
 }
 
 static inline pte_t ptep_get_and_clear(pte_t *ptep)
@@ -543,6 +544,29 @@
 	return pte;
 }
 
+static inline pte_t
+ptep_clear_flush(struct vm_area_struct *vma,
+		 unsigned long address, pte_t *ptep)
+{
+	pte_t pte = *ptep;
+#ifndef __s390x__
+	if (!(pte_val(pte) & _PAGE_INVALID)) {
+		/* S390 has 1mb segments, we are emulating 4MB segments */
+		pte_t *pto = (pte_t *) (((unsigned long) ptep) & 0x7ffffc00);
+		__asm__ __volatile__ ("ipte %2,%3"
+				      : "=m" (*ptep) : "m" (*ptep),
+				        "a" (pto), "a" (address) );
+	}
+#else /* __s390x__ */
+	if (!(pte_val(pte) & _PAGE_INVALID)) 
+		__asm__ __volatile__ ("ipte %2,%3"
+				      : "=m" (*ptep) : "m" (*ptep),
+				        "a" (ptep), "a" (address) );
+#endif /* __s390x__ */
+	pte_clear(ptep);
+	return pte;
+}
+
 static inline void ptep_set_wrprotect(pte_t *ptep)
 {
 	pte_t old_pte = *ptep;
@@ -554,6 +578,50 @@
 	pte_mkdirty(*ptep);
 }
 
+static inline void
+ptep_establish(struct vm_area_struct *vma, 
+	       unsigned long address, pte_t *ptep, pte_t entry)
+{
+	ptep_clear_flush(vma, address, ptep);
+	set_pte(ptep, entry);
+}
+
+/*
+ * Test and clear dirty bit in storage key.
+ * We can't clear the changed bit atomically. This is a potential
+ * race against modification of the referenced bit. This function
+ * should therefore only be called if it is not mapped in any
+ * address space.
+ */
+#define page_test_and_clear_dirty(page)					  \
+({									  \
+	struct page *__page = (page);					  \
+	unsigned long __physpage = __pa((__page-mem_map) << PAGE_SHIFT);  \
+	int __skey;							  \
+	asm volatile ("iske %0,%1" : "=d" (__skey) : "a" (__physpage));   \
+	if (__skey & _PAGE_CHANGED) {					  \
+		asm volatile ("sske %0,%1"				  \
+			      : : "d" (__skey & ~_PAGE_CHANGED),	  \
+			          "a" (__physpage));			  \
+	}								  \
+	(__skey & _PAGE_CHANGED);					  \
+})
+
+/*
+ * Test and clear referenced bit in storage key.
+ */
+#define page_test_and_clear_young(page)					  \
+({									  \
+	struct page *__page = (page);					  \
+	unsigned long __physpage = __pa((__page-mem_map) << PAGE_SHIFT);  \
+	int __ccode;							  \
+	asm volatile ("rrbe 0,%1\n\t"					  \
+		      "ipm  %0\n\t"					  \
+		      "srl  %0,28\n\t" 					  \
+                      : "=d" (__ccode) : "a" (__physpage) : "cc" );	  \
+	(__ccode & 2);							  \
+})
+
 /*
  * Conversion functions: convert a page and protection to a page entry,
  * and a page entry and page directory to the page they refer to.
@@ -682,9 +750,9 @@
 	pte_t pte;
 	pte_val(pte) = (type << 1) | (offset << 12) | _PAGE_INVALID_SWAP;
 #ifndef __s390x__
-	pte_val(pte) &= 0x7ffff6fe;  /* better to be paranoid */
+	BUG_ON((pte_val(pte) & 0x80000901) != 0);
 #else /* __s390x__ */
-	pte_val(pte) &= 0xfffffffffffff6fe;  /* better to be paranoid */
+	BUG_ON((pte_val(pte) & 0x901) != 0);
 #endif /* __s390x__ */
 	return pte;
 }
@@ -723,6 +791,20 @@
 #ifdef __s390x__
 # define HAVE_ARCH_UNMAPPED_AREA
 #endif /* __s390x__ */
+
+#define __HAVE_ARCH_PTEP_ESTABLISH
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
+#define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
+#define __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH
+#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
+#define __HAVE_ARCH_PTEP_CLEAR_FLUSH
+#define __HAVE_ARCH_PTEP_SET_WRPROTECT
+#define __HAVE_ARCH_PTEP_MKDIRTY
+#define __HAVE_ARCH_PTE_SAME
+#define __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY
+#define __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG
+#include <asm-generic/pgtable.h>
 
 #endif /* _S390_PAGE_H */
 
diff -Nru a/include/asm-s390/processor.h b/include/asm-s390/processor.h
--- a/include/asm-s390/processor.h	Tue Feb  3 19:45:18 2004
+++ b/include/asm-s390/processor.h	Tue Feb  3 19:45:18 2004
@@ -66,7 +66,7 @@
 
 #else /* __s390x__ */
 
-# define TASK_SIZE		(0x20000000000UL)
+# define TASK_SIZE		(0x40000000000UL)
 # define TASK31_SIZE		(0x80000000UL)
 # define TASK_UNMAPPED_BASE	(test_thread_flag(TIF_31BIT) ? \
 					(TASK31_SIZE / 2) : (TASK_SIZE / 2))
@@ -200,14 +200,14 @@
 		"    st	  %0,4(%1)\n"
 		"    lpsw 0(%1)\n"
 		"1:"
-		: "=&d" (addr) : "a" (&psw) : "memory", "cc" );
+		: "=&d" (addr) : "a" (&psw), "m" (psw) : "memory", "cc" );
 #else /* __s390x__ */
 	asm volatile (
 		"    larl  %0,1f\n"
 		"    stg   %0,8(%1)\n"
 		"    lpswe 0(%1)\n"
 		"1:"
-		: "=&d" (addr) : "a" (&psw) : "memory", "cc" );
+		: "=&d" (addr) : "a" (&psw), "m" (psw) : "memory", "cc" );
 #endif /* __s390x__ */
 }
  
@@ -229,14 +229,16 @@
 		"    oi   4(%1),0x80\n"
 		"    lpsw 0(%1)\n"
 		"1:"
-		: "=&a" (reg) : "a" (&wait_psw) : "memory", "cc" );
+		: "=&a" (reg) : "a" (&wait_psw), "m" (wait_psw)
+		: "memory", "cc" );
 #else /* __s390x__ */
 	asm volatile (
 		"    larl  %0,0f\n"
 		"    stg   %0,8(%1)\n"
 		"    lpswe 0(%1)\n"
 		"0:"
-		: "=&a" (reg) : "a" (&wait_psw) : "memory", "cc" );
+		: "=&a" (reg) : "a" (&wait_psw), "m" (wait_psw)
+		: "memory", "cc" );
 #endif /* __s390x__ */
 }
 
@@ -247,7 +249,7 @@
 static inline void disabled_wait(unsigned long code)
 {
         char psw_buffer[2*sizeof(psw_t)];
-        char ctl_buf[4];
+        unsigned long ctl_buf;
         psw_t *dw_psw = (psw_t *)(((unsigned long) &psw_buffer+sizeof(psw_t)-1)
                                   & -sizeof(psw_t));
 
@@ -258,9 +260,9 @@
          * the processor is dead afterwards
          */
 #ifndef __s390x__
-        asm volatile ("    stctl 0,0,0(%1)\n"
-                      "    ni    0(%1),0xef\n" /* switch off protection */
-                      "    lctl  0,0,0(%1)\n"
+        asm volatile ("    stctl 0,0,0(%2)\n"
+                      "    ni    0(%2),0xef\n" /* switch off protection */
+                      "    lctl  0,0,0(%2)\n"
                       "    stpt  0xd8\n"       /* store timer */
                       "    stckc 0xe0\n"       /* store clock comparator */
                       "    stpx  0x108\n"      /* store prefix register */
@@ -271,13 +273,14 @@
                       "    std   6,0x178\n"    /* store f6 */
                       "    stm   0,15,0x180\n" /* store general registers */
                       "    stctl 0,15,0x1c0\n" /* store control registers */
-                      "    oi    0(%1),0x10\n" /* fake protection bit */
-                      "    lpsw 0(%0)"
-                      : : "a" (dw_psw), "a" (&ctl_buf) : "cc" );
-#else /* __s390x__ */
-        asm volatile ("    stctg 0,0,0(%1)\n"
-                      "    ni    4(%1),0xef\n" /* switch off protection */
-                      "    lctlg 0,0,0(%1)\n"
+                      "    oi    0x1c0,0x10\n" /* fake protection bit */
+                      "    lpsw 0(%1)"
+                      : "=m" (ctl_buf)
+		      : "a" (dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc" );
+#else /* __s390x__ */
+        asm volatile ("    stctg 0,0,0(%2)\n"
+                      "    ni    4(%2),0xef\n" /* switch off protection */
+                      "    lctlg 0,0,0(%2)\n"
                       "    lghi  1,0x1000\n"
                       "    stpt  0x328(1)\n"      /* store timer */
                       "    stckc 0x330(1)\n"      /* store clock comparator */
@@ -303,8 +306,10 @@
                       "    stmg  0,15,0x280(1)\n" /* store general registers */
                       "    stctg 0,15,0x380(1)\n" /* store control registers */
                       "    oi    0x384(1),0x10\n" /* fake protection bit */
-                      "    lpswe 0(%0)"
-                      : : "a" (dw_psw), "a" (&ctl_buf) : "cc", "0", "1");
+                      "    lpswe 0(%1)"
+                      : "=m" (ctl_buf)
+		      : "a" (dw_psw), "a" (&ctl_buf),
+		        "m" (dw_psw) : "cc", "0", "1");
 #endif /* __s390x__ */
 }
 
diff -Nru a/include/asm-s390/rwsem.h b/include/asm-s390/rwsem.h
--- a/include/asm-s390/rwsem.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-s390/rwsem.h	Tue Feb  3 19:45:17 2004
@@ -102,21 +102,21 @@
 
 	__asm__ __volatile__(
 #ifndef __s390x__
-		"   l    %0,0(%2)\n"
+		"   l    %0,0(%3)\n"
 		"0: lr   %1,%0\n"
-		"   ahi  %1,%3\n"
-		"   cs   %0,%1,0(%2)\n"
+		"   ahi  %1,%5\n"
+		"   cs   %0,%1,0(%3)\n"
 		"   jl   0b"
 #else /* __s390x__ */
-		"   lg   %0,0(%2)\n"
+		"   lg   %0,0(%3)\n"
 		"0: lgr  %1,%0\n"
-		"   aghi %1,%3\n"
-		"   csg  %0,%1,0(%2)\n"
+		"   aghi %1,%5\n"
+		"   csg  %0,%1,0(%3)\n"
 		"   jl   0b"
 #endif /* __s390x__ */
-                : "=&d" (old), "=&d" (new)
-		: "a" (&sem->count), "i" (RWSEM_ACTIVE_READ_BIAS)
-		: "cc", "memory" );
+                : "=&d" (old), "=&d" (new), "=m" (sem->count)
+		: "a" (&sem->count), "m" (sem->count),
+		  "i" (RWSEM_ACTIVE_READ_BIAS) : "cc", "memory" );
 	if (old < 0)
 		rwsem_down_read_failed(sem);
 }
@@ -130,25 +130,25 @@
 
 	__asm__ __volatile__(
 #ifndef __s390x__
-		"   l    %0,0(%2)\n"
+		"   l    %0,0(%3)\n"
 		"0: ltr  %1,%0\n"
 		"   jm   1f\n"
-		"   ahi  %1,%3\n"
-		"   cs   %0,%1,0(%2)\n"
+		"   ahi  %1,%5\n"
+		"   cs   %0,%1,0(%3)\n"
 		"   jl   0b\n"
 		"1:"
 #else /* __s390x__ */
-		"   lg   %0,0(%2)\n"
+		"   lg   %0,0(%3)\n"
 		"0: ltgr %1,%0\n"
 		"   jm   1f\n"
-		"   aghi %1,%3\n"
-		"   csg  %0,%1,0(%2)\n"
+		"   aghi %1,%5\n"
+		"   csg  %0,%1,0(%3)\n"
 		"   jl   0b\n"
 		"1:"
 #endif /* __s390x__ */
-                : "=&d" (old), "=&d" (new)
-		: "a" (&sem->count), "i" (RWSEM_ACTIVE_READ_BIAS)
-		: "cc", "memory" );
+                : "=&d" (old), "=&d" (new), "=m" (sem->count)
+		: "a" (&sem->count), "m" (sem->count),
+		  "i" (RWSEM_ACTIVE_READ_BIAS) : "cc", "memory" );
 	return old >= 0 ? 1 : 0;
 }
 
@@ -162,20 +162,20 @@
 	tmp = RWSEM_ACTIVE_WRITE_BIAS;
 	__asm__ __volatile__(
 #ifndef __s390x__
-		"   l    %0,0(%2)\n"
+		"   l    %0,0(%3)\n"
 		"0: lr   %1,%0\n"
-		"   a    %1,%3\n"
-		"   cs   %0,%1,0(%2)\n"
+		"   a    %1,%5\n"
+		"   cs   %0,%1,0(%3)\n"
 		"   jl   0b"
 #else /* __s390x__ */
-		"   lg   %0,0(%2)\n"
+		"   lg   %0,0(%3)\n"
 		"0: lgr  %1,%0\n"
-		"   ag   %1,%3\n"
-		"   csg  %0,%1,0(%2)\n"
+		"   ag   %1,%5\n"
+		"   csg  %0,%1,0(%3)\n"
 		"   jl   0b"
 #endif /* __s390x__ */
-                : "=&d" (old), "=&d" (new)
-		: "a" (&sem->count), "m" (tmp)
+                : "=&d" (old), "=&d" (new), "=m" (sem->count)
+		: "a" (&sem->count), "m" (sem->count), "m" (tmp)
 		: "cc", "memory" );
 	if (old != 0)
 		rwsem_down_write_failed(sem);
@@ -190,22 +190,22 @@
 
 	__asm__ __volatile__(
 #ifndef __s390x__
-		"   l    %0,0(%1)\n"
+		"   l    %0,0(%2)\n"
 		"0: ltr  %0,%0\n"
 		"   jnz  1f\n"
-		"   cs   %0,%2,0(%1)\n"
+		"   cs   %0,%4,0(%2)\n"
 		"   jl   0b\n"
 #else /* __s390x__ */
-		"   lg   %0,0(%1)\n"
+		"   lg   %0,0(%2)\n"
 		"0: ltgr %0,%0\n"
 		"   jnz  1f\n"
-		"   csg  %0,%2,0(%1)\n"
+		"   csg  %0,%4,0(%2)\n"
 		"   jl   0b\n"
 #endif /* __s390x__ */
 		"1:"
-                : "=&d" (old)
-		: "a" (&sem->count), "d" (RWSEM_ACTIVE_WRITE_BIAS)
-		: "cc", "memory" );
+                : "=&d" (old), "=m" (sem->count)
+		: "a" (&sem->count), "m" (sem->count),
+		  "d" (RWSEM_ACTIVE_WRITE_BIAS) : "cc", "memory" );
 	return (old == RWSEM_UNLOCKED_VALUE) ? 1 : 0;
 }
 
@@ -218,20 +218,21 @@
 
 	__asm__ __volatile__(
 #ifndef __s390x__
-		"   l    %0,0(%2)\n"
+		"   l    %0,0(%3)\n"
 		"0: lr   %1,%0\n"
-		"   ahi  %1,%3\n"
-		"   cs   %0,%1,0(%2)\n"
+		"   ahi  %1,%5\n"
+		"   cs   %0,%1,0(%3)\n"
 		"   jl   0b"
 #else /* __s390x__ */
-		"   lg   %0,0(%2)\n"
+		"   lg   %0,0(%3)\n"
 		"0: lgr  %1,%0\n"
-		"   aghi %1,%3\n"
-		"   csg  %0,%1,0(%2)\n"
+		"   aghi %1,%5\n"
+		"   csg  %0,%1,0(%3)\n"
 		"   jl   0b"
 #endif /* __s390x__ */
-                : "=&d" (old), "=&d" (new)
-		: "a" (&sem->count), "i" (-RWSEM_ACTIVE_READ_BIAS)
+                : "=&d" (old), "=&d" (new), "=m" (sem->count)
+		: "a" (&sem->count), "m" (sem->count),
+		  "i" (-RWSEM_ACTIVE_READ_BIAS)
 		: "cc", "memory" );
 	if (new < 0)
 		if ((new & RWSEM_ACTIVE_MASK) == 0)
@@ -248,20 +249,20 @@
 	tmp = -RWSEM_ACTIVE_WRITE_BIAS;
 	__asm__ __volatile__(
 #ifndef __s390x__
-		"   l    %0,0(%2)\n"
+		"   l    %0,0(%3)\n"
 		"0: lr   %1,%0\n"
-		"   a    %1,%3\n"
-		"   cs   %0,%1,0(%2)\n"
+		"   a    %1,%5\n"
+		"   cs   %0,%1,0(%3)\n"
 		"   jl   0b"
 #else /* __s390x__ */
-		"   lg   %0,0(%2)\n"
+		"   lg   %0,0(%3)\n"
 		"0: lgr  %1,%0\n"
-		"   ag   %1,%3\n"
-		"   csg  %0,%1,0(%2)\n"
+		"   ag   %1,%5\n"
+		"   csg  %0,%1,0(%3)\n"
 		"   jl   0b"
 #endif /* __s390x__ */
-                : "=&d" (old), "=&d" (new)
-		: "a" (&sem->count), "m" (tmp)
+                : "=&d" (old), "=&d" (new), "=m" (sem->count)
+		: "a" (&sem->count), "m" (sem->count), "m" (tmp)
 		: "cc", "memory" );
 	if (new < 0)
 		if ((new & RWSEM_ACTIVE_MASK) == 0)
@@ -278,20 +279,20 @@
 	tmp = -RWSEM_WAITING_BIAS;
 	__asm__ __volatile__(
 #ifndef __s390x__
-		"   l    %0,0(%2)\n"
+		"   l    %0,0(%3)\n"
 		"0: lr   %1,%0\n"
-		"   a    %1,%3\n"
-		"   cs   %0,%1,0(%2)\n"
+		"   a    %1,%5\n"
+		"   cs   %0,%1,0(%3)\n"
 		"   jl   0b"
 #else /* __s390x__ */
-		"   lg   %0,0(%2)\n"
+		"   lg   %0,0(%3)\n"
 		"0: lgr  %1,%0\n"
-		"   ag   %1,%3\n"
-		"   csg  %0,%1,0(%2)\n"
+		"   ag   %1,%5\n"
+		"   csg  %0,%1,0(%3)\n"
 		"   jl   0b"
 #endif /* __s390x__ */
-                : "=&d" (old), "=&d" (new)
-		: "a" (&sem->count), "m" (tmp)
+                : "=&d" (old), "=&d" (new), "=m" (sem->count)
+		: "a" (&sem->count), "m" (sem->count), "m" (tmp)
 		: "cc", "memory" );
 	if (new > 1)
 		rwsem_downgrade_wake(sem);
@@ -306,20 +307,20 @@
 
 	__asm__ __volatile__(
 #ifndef __s390x__
-		"   l    %0,0(%2)\n"
+		"   l    %0,0(%3)\n"
 		"0: lr   %1,%0\n"
-		"   ar   %1,%3\n"
-		"   cs   %0,%1,0(%2)\n"
+		"   ar   %1,%5\n"
+		"   cs   %0,%1,0(%3)\n"
 		"   jl   0b"
 #else /* __s390x__ */
-		"   lg   %0,0(%2)\n"
+		"   lg   %0,0(%3)\n"
 		"0: lgr  %1,%0\n"
-		"   agr  %1,%3\n"
-		"   csg  %0,%1,0(%2)\n"
+		"   agr  %1,%5\n"
+		"   csg  %0,%1,0(%3)\n"
 		"   jl   0b"
 #endif /* __s390x__ */
-                : "=&d" (old), "=&d" (new)
-		: "a" (&sem->count), "d" (delta)
+                : "=&d" (old), "=&d" (new), "=m" (sem->count)
+		: "a" (&sem->count), "m" (sem->count), "d" (delta)
 		: "cc", "memory" );
 }
 
@@ -332,20 +333,20 @@
 
 	__asm__ __volatile__(
 #ifndef __s390x__
-		"   l    %0,0(%2)\n"
+		"   l    %0,0(%3)\n"
 		"0: lr   %1,%0\n"
-		"   ar   %1,%3\n"
-		"   cs   %0,%1,0(%2)\n"
+		"   ar   %1,%5\n"
+		"   cs   %0,%1,0(%3)\n"
 		"   jl   0b"
 #else /* __s390x__ */
-		"   lg   %0,0(%2)\n"
+		"   lg   %0,0(%3)\n"
 		"0: lgr  %1,%0\n"
-		"   agr  %1,%3\n"
-		"   csg  %0,%1,0(%2)\n"
+		"   agr  %1,%5\n"
+		"   csg  %0,%1,0(%3)\n"
 		"   jl   0b"
 #endif /* __s390x__ */
-                : "=&d" (old), "=&d" (new)
-		: "a" (&sem->count), "d" (delta)
+                : "=&d" (old), "=&d" (new), "=m" (sem->count)
+		: "a" (&sem->count), "m" (sem->count), "d" (delta)
 		: "cc", "memory" );
 	return new;
 }
diff -Nru a/include/asm-s390/scatterlist.h b/include/asm-s390/scatterlist.h
--- a/include/asm-s390/scatterlist.h	Tue Feb  3 19:45:28 2004
+++ b/include/asm-s390/scatterlist.h	Tue Feb  3 19:45:28 2004
@@ -7,6 +7,10 @@
     unsigned int length;
 };
 
-#define ISA_DMA_THRESHOLD (0xffffffffffffffff)
+#ifdef __s390x__
+#define ISA_DMA_THRESHOLD (0xffffffffffffffffUL)
+#else
+#define ISA_DMA_THRESHOLD (0xffffffffUL)
+#endif
 
 #endif /* _ASMS390X_SCATTERLIST_H */
diff -Nru a/include/asm-s390/semaphore.h b/include/asm-s390/semaphore.h
--- a/include/asm-s390/semaphore.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-s390/semaphore.h	Tue Feb  3 19:45:16 2004
@@ -95,9 +95,9 @@
 		"   cs   %0,%1,0(%3)\n"
 		"   jl   0b\n"
 		"1:"
-		: "=&d" (old_val), "=&d" (new_val),
-		  "+m" (sem->count.counter)
-		: "a" (&sem->count.counter) : "cc" );
+		: "=&d" (old_val), "=&d" (new_val), "=m" (sem->count.counter)
+		: "a" (&sem->count.counter), "m" (sem->count.counter)
+		: "cc", "memory" );
 	return old_val <= 0;
 }
 
diff -Nru a/include/asm-s390/setup.h b/include/asm-s390/setup.h
--- a/include/asm-s390/setup.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-s390/setup.h	Tue Feb  3 19:45:42 2004
@@ -36,6 +36,7 @@
 #define MACHINE_HAS_MVPG	(machine_flags & 16)
 #define MACHINE_HAS_DIAG44	(machine_flags & 32)
 #define MACHINE_NEW_STIDP	(machine_flags & 64)
+#define MACHINE_HAS_IDTE	(machine_flags & 128)
 
 #ifndef __s390x__
 #define MACHINE_HAS_IEEE	(machine_flags & 2)
diff -Nru a/include/asm-s390/siginfo.h b/include/asm-s390/siginfo.h
--- a/include/asm-s390/siginfo.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-s390/siginfo.h	Tue Feb  3 19:45:42 2004
@@ -14,6 +14,12 @@
 #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
 #endif
 
+#ifdef CONFIG_ARCH_S390X
+#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
+#else
+#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
+#endif
+
 #include <asm-generic/siginfo.h>
 
 /*
diff -Nru a/include/asm-s390/smp.h b/include/asm-s390/smp.h
--- a/include/asm-s390/smp.h	Tue Feb  3 19:45:18 2004
+++ b/include/asm-s390/smp.h	Tue Feb  3 19:45:18 2004
@@ -49,7 +49,6 @@
 #define smp_processor_id() (S390_lowcore.cpu_data.cpu_nr)
 
 #define cpu_online(cpu) cpu_isset(cpu, cpu_online_map)
-#define cpu_possible(cpu) cpu_isset(cpu, cpu_possible_map)
 
 extern __inline__ __u16 hard_smp_processor_id(void)
 {
diff -Nru a/include/asm-s390/socket.h b/include/asm-s390/socket.h
--- a/include/asm-s390/socket.h	Tue Feb  3 19:45:29 2004
+++ b/include/asm-s390/socket.h	Tue Feb  3 19:45:29 2004
@@ -53,6 +53,8 @@
 
 #define SO_ACCEPTCONN		30
 
+#define SO_PEERSEC		31
+
 /* Nast libc5 fixup - bletch */
 #if defined(__KERNEL__)
 /* Socket types. */
diff -Nru a/include/asm-s390/spinlock.h b/include/asm-s390/spinlock.h
--- a/include/asm-s390/spinlock.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-s390/spinlock.h	Tue Feb  3 19:45:43 2004
@@ -57,8 +57,9 @@
                            "1:  slr   %1,%1\n"
                            "    cs    %1,%0,0(%3)\n"
                            "    jl    0b\n"
-                           : "=&d" (reg1), "=&d" (reg2), "+m" (lp->lock)
-			   : "a" (&lp->lock) : "cc" );
+                           : "=&d" (reg1), "=&d" (reg2), "=m" (lp->lock)
+			   : "a" (&lp->lock), "m" (lp->lock)
+			   : "cc", "memory" );
 #else /* __s390x__ */
 	unsigned long reg1, reg2;
         __asm__ __volatile("    bras  %1,1f\n"
@@ -66,9 +67,9 @@
                            "1:  slr   %0,%0\n"
                            "    cs    %0,%1,0(%3)\n"
                            "    jl    0b\n"
-                           : "=&d" (reg1), "=&d" (reg2), "+m" (lp->lock)
-                           : "a" (&lp->lock), "i" (__DIAG44_OPERAND)
-			   : "cc" );
+                           : "=&d" (reg1), "=&d" (reg2), "=m" (lp->lock)
+			   : "a" (&lp->lock), "i" (__DIAG44_OPERAND),
+			     "m" (lp->lock) : "cc", "memory" );
 #endif /* __s390x__ */
 }
 
@@ -82,8 +83,9 @@
 	__asm__ __volatile("    slr   %0,%0\n"
 			   "    basr  %1,0\n"
 			   "0:  cs    %0,%1,0(%3)"
-			   : "=&d" (result), "=&d" (reg), "+m" (lp->lock)
-			   : "a" (&lp->lock) : "cc" );
+			   : "=&d" (result), "=&d" (reg), "=m" (lp->lock)
+			   : "a" (&lp->lock), "m" (lp->lock)
+			   : "cc", "memory" );
 	return !result;
 }
 
@@ -93,7 +95,8 @@
 
 	__asm__ __volatile("cs %0,%3,0(%4)"
 			   : "=d" (old), "=m" (lp->lock)
-			   : "0" (lp->lock), "d" (0), "a" (lp) : "cc" );
+			   : "0" (lp->lock), "d" (0), "a" (lp)
+			   : "cc", "memory" );
 }
 		
 /*
@@ -126,8 +129,8 @@
                      "   la    3,1(2)\n"     /* one more reader */ \
                      "   cs    2,3,0(%1)\n"  /* try to write new value */ \
                      "   jl    0b"       \
-                     : "+m" ((rw)->lock) : "a" (&(rw)->lock) \
-		     : "2", "3", "cc" )
+                     : "=m" ((rw)->lock) : "a" (&(rw)->lock), \
+		       "m" ((rw)->lock) : "2", "3", "cc", "memory" )
 #else /* __s390x__ */
 #define _raw_read_lock(rw)   \
         asm volatile("   lg    2,0(%1)\n"   \
@@ -137,9 +140,9 @@
                      "   la    3,1(2)\n"   /* one more reader */  \
                      "   csg   2,3,0(%1)\n" /* try to write new value */ \
                      "   jl    0b"       \
-                     : "+m" ((rw)->lock) \
-		     : "a" (&(rw)->lock), "i" (__DIAG44_OPERAND) \
-		     : "2", "3", "cc" )
+                     : "=m" ((rw)->lock) \
+		     : "a" (&(rw)->lock), "i" (__DIAG44_OPERAND), \
+		       "m" ((rw)->lock) : "2", "3", "cc", "memory" )
 #endif /* __s390x__ */
 
 #ifndef __s390x__
@@ -151,8 +154,8 @@
                      "   ahi   3,-1\n"    /* one less reader */ \
                      "   cs    2,3,0(%1)\n" \
                      "   jl    0b"       \
-                     : "+m" ((rw)->lock) : "a" (&(rw)->lock) \
-		     : "2", "3", "cc" )
+                     : "=m" ((rw)->lock) : "a" (&(rw)->lock), \
+		       "m" ((rw)->lock) : "2", "3", "cc", "memory" )
 #else /* __s390x__ */
 #define _raw_read_unlock(rw) \
         asm volatile("   lg    2,0(%1)\n"   \
@@ -162,9 +165,9 @@
                      "   bctgr 3,0\n"    /* one less reader */ \
                      "   csg   2,3,0(%1)\n" \
                      "   jl    0b"       \
-                     : "+m" ((rw)->lock) \
-		     : "a" (&(rw)->lock), "i" (__DIAG44_OPERAND) \
-		     : "2", "3", "cc" )
+                     : "=m" ((rw)->lock) \
+		     : "a" (&(rw)->lock), "i" (__DIAG44_OPERAND), \
+		       "m" ((rw)->lock) : "2", "3", "cc", "memory" )
 #endif /* __s390x__ */
 
 #ifndef __s390x__
@@ -176,8 +179,8 @@
                      "1: slr   2,2\n"     /* old lock value must be 0 */ \
                      "   cs    2,3,0(%1)\n" \
                      "   jl    0b"       \
-                     : "+m" ((rw)->lock) : "a" (&(rw)->lock) \
-		     : "2", "3", "cc" )
+                     : "=m" ((rw)->lock) : "a" (&(rw)->lock), \
+		       "m" ((rw)->lock) : "2", "3", "cc", "memory" )
 #else /* __s390x__ */
 #define _raw_write_lock(rw) \
         asm volatile("   llihh 3,0x8000\n" /* new lock value = 0x80...0 */ \
@@ -186,9 +189,9 @@
                      "1: slgr  2,2\n"      /* old lock value must be 0 */ \
                      "   csg   2,3,0(%1)\n" \
                      "   jl    0b"         \
-                     : "+m" ((rw)->lock) \
-		     : "a" (&(rw)->lock), "i" (__DIAG44_OPERAND) \
-		     : "2", "3", "cc" )
+                     : "=m" ((rw)->lock) \
+		     : "a" (&(rw)->lock), "i" (__DIAG44_OPERAND), \
+		       "m" ((rw)->lock) : "2", "3", "cc", "memory" )
 #endif /* __s390x__ */
 
 #ifndef __s390x__
@@ -200,8 +203,8 @@
                      "   sll   2,31\n"    /* old lock value must be 0x80000000 */ \
                      "   cs    2,3,0(%1)\n" \
                      "   jl    0b"       \
-                     : "+m" ((rw)->lock) : "a" (&(rw)->lock) \
-		     : "2", "3", "cc" )
+                     : "=m" ((rw)->lock) : "a" (&(rw)->lock), \
+		       "m" ((rw)->lock) : "2", "3", "cc", "memory" )
 #else /* __s390x__ */
 #define _raw_write_unlock(rw) \
         asm volatile("   slgr  3,3\n"      /* new lock value = 0 */ \
@@ -210,14 +213,14 @@
                      "1: llihh 2,0x8000\n" /* old lock value must be 0x8..0 */\
                      "   csg   2,3,0(%1)\n"   \
                      "   jl    0b"         \
-                     : "+m" ((rw)->lock) \
-		     : "a" (&(rw)->lock), "i" (__DIAG44_OPERAND) \
-		     : "2", "3", "cc" )
+                     : "=m" ((rw)->lock) \
+		     : "a" (&(rw)->lock), "i" (__DIAG44_OPERAND), \
+		       "m" ((rw)->lock) : "2", "3", "cc", "memory" )
 #endif /* __s390x__ */
 
 extern inline int _raw_write_trylock(rwlock_t *rw)
 {
-	unsigned int result, reg;
+	unsigned long result, reg;
 	
 	__asm__ __volatile__(
 #ifndef __s390x__
@@ -230,8 +233,9 @@
 			     "   llihh %1,0x8000\n"
 			     "0: csg %0,%1,0(%3)\n"
 #endif /* __s390x__ */
-			     : "=&d" (result), "=&d" (reg), "+m" (rw->lock)
-			     : "a" (&rw->lock) : "cc" );
+			     : "=&d" (result), "=&d" (reg), "=m" (rw->lock)
+			     : "a" (&rw->lock), "m" (rw->lock)
+			     : "cc", "memory" );
 	return result == 0;
 }
 
diff -Nru a/include/asm-s390/system.h b/include/asm-s390/system.h
--- a/include/asm-s390/system.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-s390/system.h	Tue Feb  3 19:45:43 2004
@@ -32,28 +32,28 @@
 static inline void save_fp_regs(s390_fp_regs *fpregs)
 {
 	asm volatile (
-		"   std   0,8(%0)\n"
-		"   std   2,24(%0)\n"
-		"   std   4,40(%0)\n"
-		"   std   6,56(%0)"
-		: : "a" (fpregs) : "memory" );
+		"   std   0,8(%1)\n"
+		"   std   2,24(%1)\n"
+		"   std   4,40(%1)\n"
+		"   std   6,56(%1)"
+		: "=m" (*fpregs) : "a" (fpregs), "m" (*fpregs) : "memory" );
 	if (!MACHINE_HAS_IEEE)
 		return;
 	asm volatile(
-		"   stfpc 0(%0)\n"
-		"   std   1,16(%0)\n"
-		"   std   3,32(%0)\n"
-		"   std   5,48(%0)\n"
-		"   std   7,64(%0)\n"
-		"   std   8,72(%0)\n"
-		"   std   9,80(%0)\n"
-		"   std   10,88(%0)\n"
-		"   std   11,96(%0)\n"
-		"   std   12,104(%0)\n"
-		"   std   13,112(%0)\n"
-		"   std   14,120(%0)\n"
-		"   std   15,128(%0)\n"
-		: : "a" (fpregs) : "memory" );
+		"   stfpc 0(%1)\n"
+		"   std   1,16(%1)\n"
+		"   std   3,32(%1)\n"
+		"   std   5,48(%1)\n"
+		"   std   7,64(%1)\n"
+		"   std   8,72(%1)\n"
+		"   std   9,80(%1)\n"
+		"   std   10,88(%1)\n"
+		"   std   11,96(%1)\n"
+		"   std   12,104(%1)\n"
+		"   std   13,112(%1)\n"
+		"   std   14,120(%1)\n"
+		"   std   15,128(%1)\n"
+		: "=m" (*fpregs) : "a" (fpregs), "m" (*fpregs) : "memory" );
 }
 
 static inline void restore_fp_regs(s390_fp_regs *fpregs)
@@ -63,7 +63,7 @@
 		"   ld    2,24(%0)\n"
 		"   ld    4,40(%0)\n"
 		"   ld    6,56(%0)"
-		: : "a" (fpregs));
+		: : "a" (fpregs), "m" (*fpregs) );
 	if (!MACHINE_HAS_IEEE)
 		return;
 	asm volatile(
@@ -80,7 +80,7 @@
 		"   ld    13,112(%0)\n"
 		"   ld    14,120(%0)\n"
 		"   ld    15,128(%0)\n"
-		: : "a" (fpregs));
+		: : "a" (fpregs), "m" (*fpregs) );
 }
 
 #define switch_to(prev,next,last) do {					     \
@@ -107,15 +107,15 @@
 		shift = (3 ^ (addr & 3)) << 3;
 		addr ^= addr & 3;
 		asm volatile(
-			"    l   %0,0(%3)\n"
+			"    l   %0,0(%4)\n"
 			"0:  lr  0,%0\n"
-			"    nr  0,%2\n"
-			"    or  0,%1\n"
-			"    cs  %0,0,0(%3)\n"
+			"    nr  0,%3\n"
+			"    or  0,%2\n"
+			"    cs  %0,0,0(%4)\n"
 			"    jl  0b\n"
-			: "=&d" (old)
-			: "d" (x << shift), "d" (~(255 << shift)), "a" (addr)
-			: "memory", "cc", "0" );
+			: "=&d" (old), "=m" (*(int *) addr)
+			: "d" (x << shift), "d" (~(255 << shift)), "a" (addr),
+			  "m" (*(int *) addr) : "memory", "cc", "0" );
 		x = old >> shift;
 		break;
 	case 2:
@@ -123,34 +123,36 @@
 		shift = (2 ^ (addr & 2)) << 3;
 		addr ^= addr & 2;
 		asm volatile(
-			"    l   %0,0(%3)\n"
+			"    l   %0,0(%4)\n"
 			"0:  lr  0,%0\n"
-			"    nr  0,%2\n"
-			"    or  0,%1\n"
-			"    cs  %0,0,0(%3)\n"
+			"    nr  0,%3\n"
+			"    or  0,%2\n"
+			"    cs  %0,0,0(%4)\n"
 			"    jl  0b\n"
-			: "=&d" (old) 
-			: "d" (x << shift), "d" (~(65535 << shift)), "a" (addr)
-			: "memory", "cc", "0" );
+			: "=&d" (old), "=m" (*(int *) addr)
+			: "d" (x << shift), "d" (~(65535 << shift)), "a" (addr),
+			  "m" (*(int *) addr) : "memory", "cc", "0" );
 		x = old >> shift;
 		break;
 	case 4:
 		asm volatile (
-			"    l   %0,0(%2)\n"
-			"0:  cs  %0,%1,0(%2)\n"
+			"    l   %0,0(%3)\n"
+			"0:  cs  %0,%2,0(%3)\n"
 			"    jl  0b\n"
-			: "=&d" (old) : "d" (x), "a" (ptr)
-			: "memory", "cc", "0" );
+			: "=&d" (old), "=m" (*(int *) ptr)
+			: "d" (x), "a" (ptr), "m" (*(int *) ptr)
+			: "memory", "cc" );
 		x = old;
 		break;
 #ifdef __s390x__
 	case 8:
 		asm volatile (
-			"    lg  %0,0(%2)\n"
-			"0:  csg %0,%1,0(%2)\n"
+			"    lg  %0,0(%3)\n"
+			"0:  csg %0,%2,0(%3)\n"
 			"    jl  0b\n"
-			: "=&d" (old) : "d" (x), "a" (ptr)
-			: "memory", "cc", "0" );
+			: "=&d" (old), "=m" (*(long *) ptr)
+			: "d" (x), "a" (ptr), "m" (*(long *) ptr)
+			: "memory", "cc" );
 		x = old;
 		break;
 #endif /* __s390x__ */
@@ -268,7 +270,8 @@
 #define local_irq_enable() ({ \
         unsigned long  __dummy; \
         __asm__ __volatile__ ( \
-                "stosm 0(%1),0x03" : "=m" (__dummy) : "a" (&__dummy) ); \
+                "stosm 0(%1),0x03" \
+		: "=m" (__dummy) : "a" (&__dummy) : "memory" ); \
         })
 
 #define local_irq_disable() ({ \
@@ -279,10 +282,10 @@
         })
 
 #define local_save_flags(x) \
-        __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x) )
+        __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x), "m" (x) )
 
 #define local_irq_restore(x) \
-        __asm__ __volatile__("ssm   0(%0)" : : "a" (&x) : "memory")
+        __asm__ __volatile__("ssm   0(%0)" : : "a" (&x), "m" (x) : "memory")
 
 #define irqs_disabled()			\
 ({					\
@@ -294,7 +297,7 @@
 #ifdef __s390x__
 
 #define __load_psw(psw) \
-        __asm__ __volatile__("lpswe 0(%0)" : : "a" (&psw) : "cc" );
+        __asm__ __volatile__("lpswe 0(%0)" : : "a" (&psw), "m" (psw) : "cc" );
 
 #define __ctl_load(array, low, high) ({ \
 	__asm__ __volatile__ ( \
diff -Nru a/include/asm-s390/timex.h b/include/asm-s390/timex.h
--- a/include/asm-s390/timex.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-s390/timex.h	Tue Feb  3 19:45:16 2004
@@ -25,7 +25,7 @@
 {
 	cycles_t cycles;
 
-	__asm__("stck 0(%0)" : : "a" (&(cycles)) : "memory", "cc");
+	__asm__("stck 0(%1)" : "=m" (cycles) : "a" (&cycles) : "cc");
 	return cycles >> 2;
 }
 
@@ -33,7 +33,7 @@
 {
 	unsigned long long clk;
 
-	__asm__("stck 0(%0)" : : "a" (&(clk)) : "memory", "cc");
+	__asm__("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc");
 	return clk;
 }
 
diff -Nru a/include/asm-s390/tlbflush.h b/include/asm-s390/tlbflush.h
--- a/include/asm-s390/tlbflush.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-s390/tlbflush.h	Tue Feb  3 19:45:43 2004
@@ -85,7 +85,7 @@
 			"    slr  2,2\n"
 			"    slr  3,3\n"
 			"    csp  2,%0"
-			: : "a" (addr) : "cc", "2", "3" );
+			: : "a" (addr), "m" (dummy) : "cc", "2", "3" );
 	}
 }
 
@@ -99,17 +99,21 @@
 static inline void __flush_tlb_mm(struct mm_struct * mm)
 {
 	cpumask_t local_cpumask;
+
+	if (unlikely(cpus_empty(mm->cpu_vm_mask)))
+		return;
+	if (MACHINE_HAS_IDTE) {
+		asm volatile (".insn rrf,0xb98e0000,0,%0,%1,0"
+			      : : "a" (2048),
+			      "a" (__pa(mm->pgd)&PAGE_MASK) : "cc" );
+		return;
+	}
 	preempt_disable();
 	local_cpumask = cpumask_of_cpu(smp_processor_id());
-	if (cpus_equal(mm->cpu_vm_mask, local_cpumask)) {
-		/* mm was active on more than one cpu. */
-		if (mm == current->active_mm &&
-		    atomic_read(&mm->mm_users) == 1)
-			/* this cpu is the only one using the mm. */
-			mm->cpu_vm_mask = local_cpumask;
-		global_flush_tlb();
-	} else
+	if (cpus_equal(mm->cpu_vm_mask, local_cpumask))
 		local_flush_tlb();
+	else
+		global_flush_tlb();
 	preempt_enable();
 }
 
@@ -136,8 +140,7 @@
 	__flush_tlb_mm(vma->vm_mm); 
 }
 
-#define flush_tlb_kernel_range(start, end) \
-	__flush_tlb_mm(&init_mm)
+#define flush_tlb_kernel_range(start, end) global_flush_tlb()
 
 #endif
 
diff -Nru a/include/asm-s390/uaccess.h b/include/asm-s390/uaccess.h
--- a/include/asm-s390/uaccess.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-s390/uaccess.h	Tue Feb  3 19:45:17 2004
@@ -124,8 +124,8 @@
 		"1:\n"						\
 		__uaccess_fixup					\
 		: "=&d" (err)					\
-		: "a" (__to),"a" (__from),"K" (-EFAULT),"0" (0)	\
-		: "cc" );					\
+		: "a" (__to),"a" (__from),"K" (-EFAULT),"0" (0),\
+		  "m" (x) : "cc" );				\
 })
 
 #else /* __s390x__ */
@@ -389,6 +389,26 @@
         err;                                                    \
 })
 
+extern long __copy_in_user_asm(const void *from, long n, void *to);
+
+#define __copy_in_user(to, from, n)				\
+({								\
+	__copy_in_user_asm(from, n, to);			\
+})
+
+#define copy_in_user(to, from, n)				\
+({								\
+	long err = 0;						\
+	__typeof__(n) __n = (n);				\
+	might_sleep();						\
+	if (__access_ok(from,__n) && __access_ok(to,__n)) {	\
+		err = __copy_in_user_asm(from, __n, to);	\
+	}							\
+	else							\
+		err = __n;					\
+	err;							\
+})
+
 /*
  * Copy a null terminated string from userspace.
  */
@@ -594,5 +614,4 @@
 	return n;
 }
 
-
-#endif				       /* _S390_UACCESS_H		   */
+#endif /* __S390_UACCESS_H */
diff -Nru a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
--- a/include/asm-s390/unistd.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-s390/unistd.h	Tue Feb  3 19:45:43 2004
@@ -259,8 +259,9 @@
 /*
  * Number 263 is reserved for vserver
  */
+#define __NR_fadvise64_64	264
 
-#define NR_syscalls 264
+#define NR_syscalls 265
 
 /* 
  * There are some system calls that are not present on 64 bit, some
@@ -322,6 +323,7 @@
 #undef  __NR_getdents64
 #undef  __NR_fcntl64
 #undef  __NR_sendfile64
+#undef  __NR_fadvise64_64
 
 #define __NR_select		142
 #define __NR_getrlimit		191	/* SuS compliant getrlimit */
diff -Nru a/include/asm-sh/bigsur/io.h b/include/asm-sh/bigsur/io.h
--- a/include/asm-sh/bigsur/io.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-sh/bigsur/io.h	Tue Feb  3 19:45:17 2004
@@ -18,28 +18,9 @@
 #define _ASM_SH_IO_BIGSUR_H
 
 #include <linux/types.h>
-#include <asm/io_generic.h>
 
-extern unsigned char bigsur_inb(unsigned long port);
-extern unsigned short bigsur_inw(unsigned long port);
-extern unsigned int bigsur_inl(unsigned long port);
-
-extern void bigsur_outb(unsigned char value, unsigned long port);
-extern void bigsur_outw(unsigned short value, unsigned long port);
-extern void bigsur_outl(unsigned int value, unsigned long port);
-
-extern unsigned char bigsur_inb_p(unsigned long port);
-extern void bigsur_outb_p(unsigned char value, unsigned long port);
-
-extern void bigsur_insb(unsigned long port, void *addr, unsigned long count);
-extern void bigsur_insw(unsigned long port, void *addr, unsigned long count);
-extern void bigsur_insl(unsigned long port, void *addr, unsigned long count);
-extern void bigsur_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void bigsur_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void bigsur_outsl(unsigned long port, const void *addr, unsigned long count);
 extern unsigned long bigsur_isa_port2addr(unsigned long offset);
 extern int bigsur_irq_demux(int irq);
-extern void bigsur_init_pci(void);
 /* Provision for generic secondary demux step -- used by PCMCIA code */
 extern void bigsur_register_irq_demux(int irq,
 		int (*demux)(int irq, void *dev), void *dev);
@@ -52,38 +33,3 @@
 
 #endif /* _ASM_SH_IO_BIGSUR_H */
 
-#ifdef __WANT_IO_DEF
-
-# define __inb			bigsur_inb
-# define __inw			bigsur_inw
-# define __inl			bigsur_inl
-# define __outb			bigsur_outb
-# define __outw			bigsur_outw
-# define __outl			bigsur_outl
-
-# define __inb_p		bigsur_inb_p
-# define __inw_p		bigsur_inw
-# define __inl_p		bigsur_inl
-# define __outb_p		bigsur_outb_p
-# define __outw_p		bigsur_outw
-# define __outl_p		bigsur_outl
-
-# define __insb			bigsur_insb
-# define __insw			bigsur_insw
-# define __insl			bigsur_insl
-# define __outsb		bigsur_outsb
-# define __outsw		bigsur_outsw
-# define __outsl		bigsur_outsl
-
-# define __readb		generic_readb
-# define __readw		generic_readw
-# define __readl		generic_readl
-# define __writeb		generic_writeb
-# define __writew		generic_writew
-# define __writel		generic_writel
-
-# define __isa_port2addr	bigsur_isa_port2addr
-# define __ioremap		generic_ioremap
-# define __iounmap		generic_iounmap
-
-#endif
diff -Nru a/include/asm-sh/bigsur.h b/include/asm-sh/bigsur.h
--- a/include/asm-sh/bigsur.h	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,80 +0,0 @@
-/*
- *
- * Hitachi Big Sur Eval Board support
- *
- * Dustin McIntire (dustin@sensoria.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * Derived from Hitachi SH7751 reference manual
- * 
- */
-
-#ifndef _ASM_BIGSUR_H_
-#define _ASM_BIGSUR_H_
-
-#include <asm/irq.h>
-#include <asm/hd64465.h>
-
-/* 7751 Internal IRQ's used by external CPLD controller */
-#define BIGSUR_IRQ_LOW	0
-#define BIGSUR_IRQ_NUM  14         /* External CPLD level 1 IRQs */
-#define BIGSUR_IRQ_HIGH (BIGSUR_IRQ_LOW + BIGSUR_IRQ_NUM)
-#define BIGSUR_2NDLVL_IRQ_LOW   (HD64465_IRQ_BASE+HD64465_IRQ_NUM)  
-#define BIGSUR_2NDLVL_IRQ_NUM   32 /* Level 2 IRQs = 4 regs * 8 bits */
-#define BIGSUR_2NDLVL_IRQ_HIGH  (BIGSUR_2NDLVL_IRQ_LOW + \
-                                 BIGSUR_2NDLVL_IRQ_NUM)
-
-/* PCI interrupt base number (A_INTA-A_INTD) */
-#define BIGSUR_SH7751_PCI_IRQ_BASE  (BIGSUR_2NDLVL_IRQ_LOW+10)  
-
-/* CPLD registers and external chip addresses */
-#define BIGSUR_HD64464_ADDR	0xB2000000
-#define BIGSUR_DGDR	0xB1FFFE00
-#define BIGSUR_BIDR	0xB1FFFD00
-#define BIGSUR_CSLR	0xB1FFFC00
-#define BIGSUR_SW1R	0xB1FFFB00
-#define BIGSUR_DBGR	0xB1FFFA00
-#define BIGSUR_BDTR	0xB1FFF900
-#define BIGSUR_BDRR	0xB1FFF800
-#define BIGSUR_PPR1	0xB1FFF700
-#define BIGSUR_PPR2	0xB1FFF600
-#define BIGSUR_IDE2	0xB1FFF500
-#define BIGSUR_IDE3	0xB1FFF400
-#define BIGSUR_SPCR	0xB1FFF300
-#define BIGSUR_ETHR	0xB1FE0000
-#define BIGSUR_PPDR	0xB1FDFF00
-#define BIGSUR_ICTL	0xB1FDFE00
-#define BIGSUR_ICMD	0xB1FDFD00
-#define BIGSUR_DMA0	0xB1FDFC00
-#define BIGSUR_DMA1	0xB1FDFB00
-#define BIGSUR_IRQ0	0xB1FDFA00
-#define BIGSUR_IRQ1	0xB1FDF900
-#define BIGSUR_IRQ2	0xB1FDF800
-#define BIGSUR_IRQ3	0xB1FDF700
-#define BIGSUR_IMR0	0xB1FDF600
-#define BIGSUR_IMR1	0xB1FDF500
-#define BIGSUR_IMR2	0xB1FDF400
-#define BIGSUR_IMR3	0xB1FDF300
-#define BIGSUR_IRLMR0	0xB1FDF200
-#define BIGSUR_IRLMR1	0xB1FDF100
-#define BIGSUR_V320USC_ADDR  0xB1000000
-#define BIGSUR_HD64465_ADDR  0xB0000000
-#define BIGSUR_INTERNAL_BASE 0xB0000000
-
-/* SMC ethernet card parameters */
-#define BIGSUR_ETHER_IOPORT		0x220
-
-/* IDE register paramters */
-#define BIGSUR_IDECMD_IOPORT	0x1f0
-#define BIGSUR_IDECTL_IOPORT	0x1f8
-
-/* LED bit position in BIGSUR_CSLR */
-#define BIGSUR_LED  (1<<4)
-
-/* PCI: default LOCAL memory window sizes (seen from PCI bus) */
-#define BIGSUR_LSR0_SIZE    (64*(1<<20)) //64MB
-#define BIGSUR_LSR1_SIZE    (64*(1<<20)) //64MB
-
-#endif /* _ASM_BIGSUR_H_ */
diff -Nru a/include/asm-sh/byteorder.h b/include/asm-sh/byteorder.h
--- a/include/asm-sh/byteorder.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-sh/byteorder.h	Tue Feb  3 19:45:16 2004
@@ -6,8 +6,9 @@
  */
 
 #include <asm/types.h>
+#include <linux/compiler.h>
 
-static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
+static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
 {
 	__asm__("swap.b	%0, %0\n\t"
 		"swap.w %0, %0\n\t"
@@ -17,7 +18,7 @@
 	return x;
 }
 
-static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
+static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 x)
 {
 	__asm__("swap.b %0, %0"
 		: "=r" (x)
diff -Nru a/include/asm-sh/cache.h b/include/asm-sh/cache.h
--- a/include/asm-sh/cache.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-sh/cache.h	Tue Feb  3 19:45:34 2004
@@ -1,4 +1,4 @@
-/* $Id: cache.h,v 1.4 2003/05/06 23:28:50 lethal Exp $
+/* $Id: cache.h,v 1.5 2003/07/16 04:08:29 lethal Exp $
  *
  * include/asm-sh/cache.h
  *
@@ -16,7 +16,8 @@
 #define SH_CACHE_COMBINED	4
 #define SH_CACHE_ASSOC		8
 
-#define SMP_CACHE_BYTES L1_CACHE_BYTES
+#define L1_CACHE_BYTES		(1 << L1_CACHE_SHIFT)
+#define SMP_CACHE_BYTES		L1_CACHE_BYTES
 
 #define L1_CACHE_ALIGN(x)	(((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
 
@@ -28,7 +29,7 @@
 		 __section__(".data.cacheline_aligned")))
 #endif
 
-#define L1_CACHE_SHIFT_MAX 5	/* largest L1 which this arch supports */
+#define L1_CACHE_SHIFT_MAX 	5	/* largest L1 which this arch supports */
 
 struct cache_info {
 	unsigned int ways;
diff -Nru a/include/asm-sh/cat68701/io.h b/include/asm-sh/cat68701/io.h
--- a/include/asm-sh/cat68701/io.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-sh/cat68701/io.h	Tue Feb  3 19:45:43 2004
@@ -13,77 +13,10 @@
 #ifndef _ASM_SH_IO_CAT68701_H
 #define _ASM_SH_IO_CAT68701_H
 
-#include <asm/io_generic.h>
-
-extern unsigned char cat68701_inb(unsigned long port);
-extern unsigned short cat68701_inw(unsigned long port);
-extern unsigned int cat68701_inl(unsigned long port);
-
-extern void cat68701_outb(unsigned char value, unsigned long port);
-extern void cat68701_outw(unsigned short value, unsigned long port);
-extern void cat68701_outl(unsigned int value, unsigned long port);
-
-extern unsigned char cat68701_inb_p(unsigned long port);
-extern void cat68701_outb_p(unsigned char value, unsigned long port);
-
-extern void cat68701_insb(unsigned long port, void *addr, unsigned long count);
-extern void cat68701_insw(unsigned long port, void *addr, unsigned long count);
-extern void cat68701_insl(unsigned long port, void *addr, unsigned long count);
-extern void cat68701_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void cat68701_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void cat68701_outsl(unsigned long port, const void *addr, unsigned long count);
-
-extern unsigned char cat68701_readb(unsigned long addr);
-extern unsigned short cat68701_readw(unsigned long addr);
-extern unsigned int cat68701_readl(unsigned long addr);
-extern void cat68701_writeb(unsigned char b, unsigned long addr);
-extern void cat68701_writew(unsigned short b, unsigned long addr);
-extern void cat68701_writel(unsigned int b, unsigned long addr);
-
-extern void * cat68701_ioremap(unsigned long offset, unsigned long size);
-extern void cat68701_iounmap(void *addr);
-
 extern unsigned long cat68701_isa_port2addr(unsigned long offset);
 extern int cat68701_irq_demux(int irq);
 
-extern void setup_cat68701(void);
 extern void init_cat68701_IRQ(void);
 extern void heartbeat_cat68701(void);
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			cat68701_inb
-# define __inw			cat68701_inw
-# define __inl			cat68701_inl
-# define __outb			cat68701_outb
-# define __outw			cat68701_outw
-# define __outl			cat68701_outl
-
-# define __inb_p		cat68701_inb_p
-# define __inw_p		cat68701_inw
-# define __inl_p		cat68701_inl
-# define __outb_p		cat68701_outb_p
-# define __outw_p		cat68701_outw
-# define __outl_p		cat68701_outl
-
-# define __insb			cat68701_insb
-# define __insw			cat68701_insw
-# define __insl			cat68701_insl
-# define __outsb		cat68701_outsb
-# define __outsw		cat68701_outsw
-# define __outsl		cat68701_outsl
-
-# define __readb		cat68701_readb
-# define __readw		cat68701_readw
-# define __readl		cat68701_readl
-# define __writeb		cat68701_writeb
-# define __writew		cat68701_writew
-# define __writel		cat68701_writel
-
-# define __isa_port2addr	cat68701_isa_port2addr
-# define __ioremap		generic_ioremap
-# define __iounmap		generic_iounmap
-
-#endif
 
 #endif /* _ASM_SH_IO_CAT68701_H */
diff -Nru a/include/asm-sh/cpu-sh2/addrspace.h b/include/asm-sh/cpu-sh2/addrspace.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sh/cpu-sh2/addrspace.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,16 @@
+/*
+ * Definitions for the address spaces of the SH-2 CPUs.
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH2_ADDRSPACE_H
+#define __ASM_CPU_SH2_ADDRSPACE_H
+
+/* Should fill here */
+
+#endif /* __ASM_CPU_SH2_ADDRSPACE_H */
+
diff -Nru a/include/asm-sh/cpu-sh2/cache.h b/include/asm-sh/cpu-sh2/cache.h
--- a/include/asm-sh/cpu-sh2/cache.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-sh/cpu-sh2/cache.h	Tue Feb  3 19:45:43 2004
@@ -10,7 +10,7 @@
 #ifndef __ASM_CPU_SH2_CACHE_H
 #define __ASM_CPU_SH2_CACHE_H
 
-#define	L1_CACHE_BYTES	16
+#define L1_CACHE_SHIFT	4
 
 #define CCR		0xfffffe92	/* Address of Cache Control Register */
 
diff -Nru a/include/asm-sh/cpu-sh2/dma.h b/include/asm-sh/cpu-sh2/dma.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sh/cpu-sh2/dma.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,23 @@
+/*
+ * Definitions for the SH-2 DMAC.
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH2_DMA_H
+#define __ASM_CPU_SH2_DMA_H
+
+#define SH_MAX_DMA_CHANNELS	2
+
+#define SAR	((unsigned long[]){ 0xffffff80, 0xffffff90 })
+#define DAR	((unsigned long[]){ 0xffffff84, 0xffffff94 })
+#define DMATCR	((unsigned long[]){ 0xffffff88, 0xffffff98 })
+#define CHCR	((unsigned long[]){ 0xfffffffc, 0xffffff9c })
+
+#define DMAOR	0xffffffb0
+
+#endif /* __ASM_CPU_SH2_DMA_H */
+
diff -Nru a/include/asm-sh/cpu-sh2/shmparam.h b/include/asm-sh/cpu-sh2/shmparam.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sh/cpu-sh2/shmparam.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,16 @@
+/*
+ * include/asm-sh/cpu-sh2/shmparam.h
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH2_SHMPARAM_H
+#define __ASM_CPU_SH2_SHMPARAM_H
+
+#define	SHMLBA PAGE_SIZE		 /* attach addr a multiple of this */
+
+#endif /* __ASM_CPU_SH2_SHMPARAM_H */
+
diff -Nru a/include/asm-sh/cpu-sh2/sigcontext.h b/include/asm-sh/cpu-sh2/sigcontext.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sh/cpu-sh2/sigcontext.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,17 @@
+#ifndef __ASM_CPU_SH2_SIGCONTEXT_H
+#define __ASM_CPU_SH2_SIGCONTEXT_H
+
+struct sigcontext {
+	unsigned long	oldmask;
+
+	/* CPU registers */
+	unsigned long sc_regs[16];
+	unsigned long sc_pc;
+	unsigned long sc_pr;
+	unsigned long sc_sr;
+	unsigned long sc_gbr;
+	unsigned long sc_mach;
+	unsigned long sc_macl;
+};
+
+#endif /* __ASM_CPU_SH2_SIGCONTEXT_H */
diff -Nru a/include/asm-sh/cpu-sh2/ubc.h b/include/asm-sh/cpu-sh2/ubc.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sh/cpu-sh2/ubc.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,32 @@
+/*
+ * include/asm-sh/cpu-sh2/ubc.h
+ *
+ * Copyright (C) 2003 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH2_UBC_H
+#define __ASM_CPU_SH2_UBC_H
+
+#define UBC_BARA                0xffffff40
+#define UBC_BAMRA               0xffffff44
+#define UBC_BBRA                0xffffff48
+#define UBC_BARB                0xffffff60
+#define UBC_BAMRB               0xffffff64
+#define UBC_BBRB                0xffffff68
+#define UBC_BDRB                0xffffff70
+#define UBC_BDMRB               0xffffff74
+#define UBC_BRCR                0xffffff78
+
+/*
+ * We don't have any ASID changes to make in the UBC on the SH-2.
+ *
+ * Make these purposely invalid to track misuse.
+ */
+#define UBC_BASRA		0x00000000
+#define UBC_BASRB		0x00000000
+
+#endif /* __ASM_CPU_SH2_UBC_H */
+
diff -Nru a/include/asm-sh/cpu-sh3/cache.h b/include/asm-sh/cpu-sh3/cache.h
--- a/include/asm-sh/cpu-sh3/cache.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-sh/cpu-sh3/cache.h	Tue Feb  3 19:45:16 2004
@@ -10,7 +10,7 @@
 #ifndef __ASM_CPU_SH3_CACHE_H
 #define __ASM_CPU_SH3_CACHE_H
 
-#define        L1_CACHE_BYTES  16
+#define L1_CACHE_SHIFT	4
 
 #define CCR		0xffffffec	/* Address of Cache Control Register */
 
diff -Nru a/include/asm-sh/cpu-sh3/dma.h b/include/asm-sh/cpu-sh3/dma.h
--- a/include/asm-sh/cpu-sh3/dma.h	Tue Feb  3 19:45:37 2004
+++ b/include/asm-sh/cpu-sh3/dma.h	Tue Feb  3 19:45:37 2004
@@ -1,11 +1,7 @@
 #ifndef __ASM_CPU_SH3_DMA_H
 #define __ASM_CPU_SH3_DMA_H
 
-#define SAR ((unsigned long[]){0xa4000020,0xa4000030,0xa4000040,0xa4000050})
-#define DAR ((unsigned long[]){0xa4000024,0xa4000034,0xa4000044,0xa4000054})
-#define DMATCR ((unsigned long[]){0xa4000028,0xa4000038,0xa4000048,0xa4000058})
-#define CHCR ((unsigned long[]){0xa400002c,0xa400003c,0xa400004c,0xa400005c})
-#define DMAOR 0xa4000060UL
+#define SH_DMAC_BASE	0xa4000020
 
 #endif /* __ASM_CPU_SH3_DMA_H */
 
diff -Nru a/include/asm-sh/cpu-sh3/mmu_context.h b/include/asm-sh/cpu-sh3/mmu_context.h
--- a/include/asm-sh/cpu-sh3/mmu_context.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-sh/cpu-sh3/mmu_context.h	Tue Feb  3 19:45:43 2004
@@ -21,6 +21,7 @@
 #define MMU_PAGE_ASSOC_BIT	0x80
 
 #define MMU_NTLB_ENTRIES	128	/* for 7708 */
+#define MMU_NTLB_WAYS		4
 #define MMU_CONTROL_INIT	0x007	/* SV=0, TF=1, IX=1, AT=1 */
 
 #endif /* __ASM_CPU_SH3_MMU_CONTEXT_H */
diff -Nru a/include/asm-sh/cpu-sh3/sigcontext.h b/include/asm-sh/cpu-sh3/sigcontext.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sh/cpu-sh3/sigcontext.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,17 @@
+#ifndef __ASM_CPU_SH3_SIGCONTEXT_H
+#define __ASM_CPU_SH3_SIGCONTEXT_H
+
+struct sigcontext {
+	unsigned long	oldmask;
+
+	/* CPU registers */
+	unsigned long sc_regs[16];
+	unsigned long sc_pc;
+	unsigned long sc_pr;
+	unsigned long sc_sr;
+	unsigned long sc_gbr;
+	unsigned long sc_mach;
+	unsigned long sc_macl;
+};
+
+#endif /* __ASM_CPU_SH3_SIGCONTEXT_H */
diff -Nru a/include/asm-sh/cpu-sh4/cache.h b/include/asm-sh/cpu-sh4/cache.h
--- a/include/asm-sh/cpu-sh4/cache.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-sh/cpu-sh4/cache.h	Tue Feb  3 19:45:17 2004
@@ -10,7 +10,7 @@
 #ifndef __ASM_CPU_SH4_CACHE_H
 #define __ASM_CPU_SH4_CACHE_H
 
-#define        L1_CACHE_BYTES  32
+#define L1_CACHE_SHIFT	5
 
 #define CCR		0xff00001c	/* Address of Cache Control Register */
 #define CCR_CACHE_OCE	0x0001	/* Operand Cache Enable */
diff -Nru a/include/asm-sh/cpu-sh4/dma.h b/include/asm-sh/cpu-sh4/dma.h
--- a/include/asm-sh/cpu-sh4/dma.h	Tue Feb  3 19:45:33 2004
+++ b/include/asm-sh/cpu-sh4/dma.h	Tue Feb  3 19:45:33 2004
@@ -1,11 +1,7 @@
 #ifndef __ASM_CPU_SH4_DMA_H
 #define __ASM_CPU_SH4_DMA_H
 
-#define SAR ((unsigned long[]){0xbfa00000,0xbfa00010,0xbfa00020,0xbfa00030})
-#define DAR ((unsigned long[]){0xbfa00004,0xbfa00014,0xbfa00024,0xbfa00034})
-#define DMATCR ((unsigned long[]){0xbfa00008,0xbfa00018,0xbfa00028,0xbfa00038})
-#define CHCR ((unsigned long[]){0xbfa0000c,0xbfa0001c,0xbfa0002c,0xbfa0003c})
-#define DMAOR 0xbfa00040UL
+#define SH_DMAC_BASE	0xbfa00000
 
 #endif /* __ASM_CPU_SH4_DMA_H */
 
diff -Nru a/include/asm-sh/cpu-sh4/sigcontext.h b/include/asm-sh/cpu-sh4/sigcontext.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sh/cpu-sh4/sigcontext.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,24 @@
+#ifndef __ASM_CPU_SH4_SIGCONTEXT_H
+#define __ASM_CPU_SH4_SIGCONTEXT_H
+
+struct sigcontext {
+	unsigned long	oldmask;
+
+	/* CPU registers */
+	unsigned long sc_regs[16];
+	unsigned long sc_pc;
+	unsigned long sc_pr;
+	unsigned long sc_sr;
+	unsigned long sc_gbr;
+	unsigned long sc_mach;
+	unsigned long sc_macl;
+
+	/* FPU registers */
+	unsigned long sc_fpregs[16];
+	unsigned long sc_xfpregs[16];
+	unsigned int sc_fpscr;
+	unsigned int sc_fpul;
+	unsigned int sc_ownedfp;
+};
+
+#endif /* __ASM_CPU_SH4_SIGCONTEXT_H */
diff -Nru a/include/asm-sh/cpu-sh4/sq.h b/include/asm-sh/cpu-sh4/sq.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sh/cpu-sh4/sq.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,48 @@
+/*
+ * include/asm-sh/cpu-sh4/sq.h
+ *
+ * Copyright (C) 2001, 2002, 2003  Paul Mundt
+ * Copyright (C) 2001, 2002  M. R. Brown
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH4_SQ_H
+#define __ASM_CPU_SH4_SQ_H
+
+#include <asm/addrspace.h>
+
+/*
+ * Store queues range from e0000000-e3fffffc, allowing approx. 64MB to be
+ * mapped to any physical address space. Since data is written (and aligned)
+ * to 32-byte boundaries, we need to be sure that all allocations are aligned.
+ */ 
+#define SQ_SIZE                 32
+#define SQ_ALIGN_MASK           (~(SQ_SIZE - 1))
+#define SQ_ALIGN(addr)          (((addr)+SQ_SIZE-1) & SQ_ALIGN_MASK)
+
+#define SQ_QACR0		(P4SEG_REG_BASE  + 0x38)
+#define SQ_QACR1		(P4SEG_REG_BASE  + 0x3c)
+#define SQ_ADDRMAX              (P4SEG_STORE_QUE + 0x04000000)
+
+struct sq_mapping {
+	const char *name;
+
+	unsigned long sq_addr;
+	unsigned long addr;
+	unsigned int size;
+
+	struct list_head list;
+};
+
+/* arch/sh/kernel/cpu/sh4/sq.c */
+extern struct sq_mapping *sq_remap(unsigned long phys, unsigned int size, const char *name);
+extern void sq_unmap(struct sq_mapping *map);
+
+extern void sq_clear(unsigned long addr, unsigned int len);
+extern void sq_flush(void *addr);
+extern void sq_flush_range(unsigned long start, unsigned int len);
+
+#endif /* __ASM_CPU_SH4_SQ_H */
+
diff -Nru a/include/asm-sh/dc_sysasic.h b/include/asm-sh/dc_sysasic.h
--- a/include/asm-sh/dc_sysasic.h	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,35 +0,0 @@
-/* include/asm-sh/dc_sysasic.h
- *
- * Definitions for the Dreamcast System ASIC and related peripherals.
- *
- * Copyright (c) 2001 M. R. Brown <mrbrown@linuxdc.org>
- *
- * This file is part of the LinuxDC project (www.linuxdc.org)
- *
- * Released under the terms of the GNU GPL v2.0.
- *
- */
-
-#include <asm/irq.h>
-
-/* Hardware events -
-
-   Each of these events correspond to a bit within the Event Mask Registers/
-   Event Status Registers.  Because of the virtual IRQ numbering scheme, a
-   base offset must be used when calculating the virtual IRQ that each event
-   takes.
-*/
-
-#define HW_EVENT_IRQ_BASE  OFFCHIP_IRQ_BASE /* 48 */
-
-/* IRQ 13 */
-#define HW_EVENT_VSYNC     (HW_EVENT_IRQ_BASE +  5) /* VSync */
-#define HW_EVENT_MAPLE_DMA (HW_EVENT_IRQ_BASE + 12) /* Maple DMA complete */
-#define HW_EVENT_GDROM_DMA (HW_EVENT_IRQ_BASE + 14) /* GD-ROM DMA complete */
-
-/* IRQ 11 */
-#define HW_EVENT_GDROM_CMD (HW_EVENT_IRQ_BASE + 32) /* GD-ROM cmd. complete */
-#define HW_EVENT_AICA_SYS  (HW_EVENT_IRQ_BASE + 33) /* AICA-related */
-#define HW_EVENT_EXTERNAL  (HW_EVENT_IRQ_BASE + 35) /* Ext. (expansion) */
-
-#define HW_EVENT_IRQ_MAX (HW_EVENT_IRQ_BASE + 95)
diff -Nru a/include/asm-sh/dma.h b/include/asm-sh/dma.h
--- a/include/asm-sh/dma.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-sh/dma.h	Tue Feb  3 19:45:16 2004
@@ -1,87 +1,103 @@
+/*
+ * include/asm-sh/dma.h
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */
 #ifndef __ASM_SH_DMA_H
 #define __ASM_SH_DMA_H
 
-#ifdef CONFIG_SH_MPC1211
-#include <asm/mpc1211/dma.h>
-#else
-
 #include <linux/config.h>
+#include <linux/spinlock.h>
 #include <asm/cpu/dma.h>
-#include <asm/io.h>		/* need byte IO */
-
-#define MAX_DMA_CHANNELS 8
-#define SH_MAX_DMA_CHANNELS 4
+#include <asm/semaphore.h>
 
 /* The maximum address that we can perform a DMA transfer to on this platform */
 /* Don't define MAX_DMA_ADDRESS; it's useless on the SuperH and any
    occurrence should be flagged as an error.  */
 /* But... */
 /* XXX: This is not applicable to SuperH, just needed for alloc_bootmem */
-#define MAX_DMA_ADDRESS      (PAGE_OFFSET+0x10000000)
+#define MAX_DMA_ADDRESS		(PAGE_OFFSET+0x10000000)
 
-#define DMTE_IRQ ((int[]){DMTE0_IRQ,DMTE1_IRQ,DMTE2_IRQ,DMTE3_IRQ})
+#ifdef CONFIG_NR_DMA_CHANNELS
+#  define MAX_DMA_CHANNELS	(CONFIG_NR_DMA_CHANNELS)
+#else
+#  define MAX_DMA_CHANNELS	(CONFIG_NR_ONCHIP_DMA_CHANNELS)
+#endif
 
-#define DMA_MODE_READ	0x00	/* I/O to memory, no autoinit, increment, single mode */
-#define DMA_MODE_WRITE	0x01	/* memory to I/O, no autoinit, increment, single mode */
-#define DMA_AUTOINIT	0x10
-
-#define REQ_L	0x00000000
-#define REQ_E	0x00080000
-#define RACK_H	0x00000000
-#define RACK_L	0x00040000
-#define ACK_R	0x00000000
-#define ACK_W	0x00020000
-#define ACK_H	0x00000000
-#define ACK_L	0x00010000
-#define DM_INC	0x00004000
-#define DM_DEC	0x00008000
-#define SM_INC	0x00001000
-#define SM_DEC	0x00002000
-#define RS_DUAL	0x00000000
-#define RS_IN	0x00000200
-#define RS_OUT	0x00000300
-#define TM_BURST 0x0000080
-#define TS_8	0x00000010
-#define TS_16	0x00000020
-#define TS_32	0x00000030
-#define TS_64	0x00000000
-#define TS_BLK	0x00000040
-#define CHCR_DE 0x00000001
-#define CHCR_TE 0x00000002
-#define CHCR_IE 0x00000004
-
-#define DMAOR_COD	0x00000008
-#define DMAOR_AE	0x00000004
-#define DMAOR_NMIF	0x00000002
-#define DMAOR_DME	0x00000001
+/* 
+ * Read and write modes can mean drastically different things depending on the
+ * channel configuration. Consult your DMAC documentation and module
+ * implementation for further clues.
+ */
+#define DMA_MODE_READ		0x00
+#define DMA_MODE_WRITE		0x01
+#define DMA_MODE_MASK		0x01
+
+extern spinlock_t dma_spin_lock;
+
+struct dma_info;
+
+struct dma_ops {
+	const char *name;
+
+	int (*request)(struct dma_info *info);
+	void (*free)(struct dma_info *info);
+
+	int (*get_residue)(struct dma_info *info);
+	int (*xfer)(struct dma_info *info);
+	void (*configure)(struct dma_info *info, unsigned long flags);
+};
+
+struct dma_info {
+	const char *dev_id;
 
-struct dma_info_t {
 	unsigned int chan;
-	unsigned long dev_addr;
 	unsigned int mode;
-	unsigned long mem_addr;
 	unsigned int count;
-};
+	
+	unsigned long sar;
+	unsigned long dar;
+
+	unsigned int configured:1;
+	atomic_t busy;
+
+	struct semaphore sem;
+	struct dma_ops *ops;
+} __attribute__ ((packed));
+
+/* arch/sh/drivers/dma/dma-api.c */
+extern int dma_xfer(unsigned int chan, unsigned long from,
+		    unsigned long to, size_t size, unsigned int mode);
+
+#define dma_write(chan, from, to, size)	\
+	dma_xfer(chan, from, to, size, DMA_MODE_WRITE)
+#define dma_write_page(chan, from, to)	\
+	dma_write(chan, from, to, PAGE_SIZE)
+
+#define dma_read(chan, from, to, size)	\
+	dma_xfer(chan, from, to, size, DMA_MODE_READ)
+#define dma_read_page(chan, from, to)	\
+	dma_read(chan, from, to, PAGE_SIZE)
+
+extern int request_dma(unsigned int chan, const char *dev_id);
+extern void free_dma(unsigned int chan);
+extern int get_dma_residue(unsigned int chan);
+extern struct dma_info *get_dma_info(unsigned int chan);
+extern void dma_wait_for_completion(unsigned int chan);
+extern void dma_configure_channel(unsigned int chan, unsigned long flags);
 
-static __inline__ void clear_dma_ff(unsigned int dmanr){}
+extern int register_dmac(struct dma_ops *ops);
 
-/* These are in arch/sh/kernel/dma.c: */
-extern unsigned long claim_dma_lock(void);
-extern void release_dma_lock(unsigned long flags);
-extern void setup_dma(unsigned int dmanr, struct dma_info_t *info);
-extern void enable_dma(unsigned int dmanr);
-extern void disable_dma(unsigned int dmanr);
-extern void set_dma_mode(unsigned int dmanr, char mode);
-extern void set_dma_addr(unsigned int dmanr, unsigned int a);
-extern void set_dma_count(unsigned int dmanr, unsigned int count);
-extern int get_dma_residue(unsigned int dmanr);
+extern struct dma_info dma_info[];
 
 #ifdef CONFIG_PCI
 extern int isa_dma_bridge_buggy;
 #else
 #define isa_dma_bridge_buggy 	(0)
 #endif
-
-#endif /* CONFIG_SH_MPC1211 */
 
 #endif /* __ASM_SH_DMA_H */
diff -Nru a/include/asm-sh/dreamcast/dma.h b/include/asm-sh/dreamcast/dma.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sh/dreamcast/dma.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,34 @@
+/*
+ * include/asm-sh/dreamcast/dma.h
+ *
+ * Copyright (C) 2003 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_SH_DREAMCAST_DMA_H
+#define __ASM_SH_DREAMCAST_DMA_H
+
+/* Number of DMA channels */
+#define ONCHIP_NR_DMA_CHANNELS	4
+#define G2_NR_DMA_CHANNELS	4
+#define PVR2_NR_DMA_CHANNELS	1
+
+/* Channels for cascading */
+#define PVR2_CASCADE_CHAN	2
+#define G2_CASCADE_CHAN		3
+
+/* PVR2 DMA Registers */
+#define PVR2_DMA_BASE		0xa05f6800
+#define PVR2_DMA_ADDR		(PVR2_DMA_BASE + 0)
+#define PVR2_DMA_COUNT		(PVR2_DMA_BASE + 4)
+#define PVR2_DMA_MODE		(PVR2_DMA_BASE + 8)
+#define PVR2_DMA_LMMODE0	(PVR2_DMA_BASE + 132)
+#define PVR2_DMA_LMMODE1	(PVR2_DMA_BASE + 136)
+
+/* G2 DMA Register */
+#define G2_DMA_BASE		0xa05f7800
+
+#endif /* __ASM_SH_DREAMCAST_DMA_H */
+
diff -Nru a/include/asm-sh/dreamcast/pci.h b/include/asm-sh/dreamcast/pci.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sh/dreamcast/pci.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,25 @@
+/*
+ * include/asm-sh/dreamcast/pci.h
+ *
+ * Copyright (C) 2001, 2002  M. R. Brown
+ * Copyright (C) 2002, 2003  Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_SH_DREAMCAST_PCI_H
+#define __ASM_SH_DREAMCAST_PCI_H
+
+#include <asm/mach/sysasic.h>
+
+#define	GAPSPCI_REGS		0x01001400
+#define GAPSPCI_DMA_BASE	0x01840000
+#define GAPSPCI_DMA_SIZE	32768
+#define GAPSPCI_BBA_CONFIG	0x01001600
+#define GAPSPCI_BBA_CONFIG_SIZE	0x2000
+
+#define	GAPSPCI_IRQ		HW_EVENT_EXTERNAL
+
+#endif /* __ASM_SH_DREAMCAST_PCI_H */
+
diff -Nru a/include/asm-sh/dreamcast/sysasic.h b/include/asm-sh/dreamcast/sysasic.h
--- a/include/asm-sh/dreamcast/sysasic.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-sh/dreamcast/sysasic.h	Tue Feb  3 19:45:17 2004
@@ -3,12 +3,15 @@
  * Definitions for the Dreamcast System ASIC and related peripherals.
  *
  * Copyright (c) 2001 M. R. Brown <mrbrown@linuxdc.org>
+ * Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
  *
  * This file is part of the LinuxDC project (www.linuxdc.org)
  *
  * Released under the terms of the GNU GPL v2.0.
  *
  */
+#ifndef __ASM_SH_DREAMCAST_SYSASIC_H
+#define __ASM_SH_DREAMCAST_SYSASIC_H
 
 #include <asm/irq.h>
 
@@ -26,6 +29,8 @@
 #define HW_EVENT_VSYNC     (HW_EVENT_IRQ_BASE +  5) /* VSync */
 #define HW_EVENT_MAPLE_DMA (HW_EVENT_IRQ_BASE + 12) /* Maple DMA complete */
 #define HW_EVENT_GDROM_DMA (HW_EVENT_IRQ_BASE + 14) /* GD-ROM DMA complete */
+#define HW_EVENT_G2_DMA    (HW_EVENT_IRQ_BASE + 15) /* G2 DMA complete */
+#define HW_EVENT_PVR2_DMA  (HW_EVENT_IRQ_BASE + 19) /* PVR2 DMA complete */
 
 /* IRQ 11 */
 #define HW_EVENT_GDROM_CMD (HW_EVENT_IRQ_BASE + 32) /* GD-ROM cmd. complete */
@@ -33,3 +38,6 @@
 #define HW_EVENT_EXTERNAL  (HW_EVENT_IRQ_BASE + 35) /* Ext. (expansion) */
 
 #define HW_EVENT_IRQ_MAX (HW_EVENT_IRQ_BASE + 95)
+
+#endif /* __ASM_SH_DREAMCAST_SYSASIC_H */
+
diff -Nru a/include/asm-sh/ec3104/io.h b/include/asm-sh/ec3104/io.h
--- a/include/asm-sh/ec3104/io.h	Tue Feb  3 19:45:18 2004
+++ b/include/asm-sh/ec3104/io.h	Tue Feb  3 19:45:18 2004
@@ -1,7 +1,6 @@
 #ifndef _ASM_SH_IO_EC3104_H
 #define _ASM_SH_IO_EC3104_H
 
-#include <asm/io_generic.h>
 #include <linux/types.h>
 
 extern unsigned char ec3104_inb(unsigned long port);
@@ -13,42 +12,5 @@
 extern void ec3104_outl(unsigned long value, unsigned long port);
 
 extern int ec3104_irq_demux(int irq);
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			ec3104_inb
-# define __inw			ec3104_inw
-# define __inl			ec3104_inl
-# define __outb			ec3104_outb
-# define __outw			ec3104_outw
-# define __outl			ec3104_outl
-
-# define __inb_p		ec3104_inb
-# define __inw_p		ec3104_inw
-# define __inl_p		ec3104_inl
-# define __outb_p		ec3104_outb
-# define __outw_p		ec3104_outw
-# define __outl_p		ec3104_outl
-
-# define __insb			generic_insb
-# define __insw			generic_insw
-# define __insl			generic_insl
-# define __outsb		generic_outsb
-# define __outsw		generic_outsw
-# define __outsl		generic_outsl
-
-# define __readb		generic_readb
-# define __readw		generic_readw
-# define __readl		generic_readl
-# define __writeb		generic_writeb
-# define __writew		generic_writew
-# define __writel		generic_writel
-
-# define __isa_port2addr	generic_isa_port2addr
-# define __ioremap		generic_ioremap
-# define __ioremap_nocache	generic_ioremap_nocache
-# define __iounmap		generic_iounmap
-
-#endif
 
 #endif /* _ASM_SH_IO_EC3104_H */
diff -Nru a/include/asm-sh/ec3104.h b/include/asm-sh/ec3104.h
--- a/include/asm-sh/ec3104.h	Tue Feb  3 19:45:34 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,43 +0,0 @@
-#ifndef __ASM_EC3104_H
-#define __ASM_EC3104_H
-
-
-/*
- * Most of the register set is at 0xb0ec0000 - 0xb0ecffff.
- *
- * as far as I've figured it out the register map is:
- * 0xb0ec0000 - id string
- * 0xb0ec0XXX - power management
- * 0xb0ec1XXX - interrupt control
- * 0xb0ec3XXX - ps2 port (touch pad on aero 8000)
- * 0xb0ec6XXX - i2c
- * 0xb0ec7000 - first serial port (proprietary connector on aero 8000)
- * 0xb0ec8000 - second serial port
- * 0xb0ec9000 - third serial port
- * 0xb0eca000 - fourth serial port (keyboard controller on aero 8000)
- * 0xb0eccXXX - GPIO
- * 0xb0ecdXXX - GPIO
- */
-
-#define EC3104_BASE	0xb0ec0000
-
-#define EC3104_SER4_DATA	(EC3104_BASE+0xa000)
-#define EC3104_SER4_IIR		(EC3104_BASE+0xa008)
-#define EC3104_SER4_MCR		(EC3104_BASE+0xa010)
-#define EC3104_SER4_LSR		(EC3104_BASE+0xa014)
-#define EC3104_SER4_MSR		(EC3104_BASE+0xa018)
-
-/*
- * our ISA bus.  this seems to be real ISA.
- */
-#define EC3104_ISA_BASE	0xa5000000
-
-#define EC3104_IRQ	11
-#define EC3104_IRQBASE	64
-
-#define EC3104_IRQ_SER1	EC3104_IRQBASE + 7
-#define EC3104_IRQ_SER2	EC3104_IRQBASE + 8
-#define EC3104_IRQ_SER3	EC3104_IRQBASE + 9
-#define EC3104_IRQ_SER4	EC3104_IRQBASE + 10
-
-#endif /* __ASM_EC3104_H */
diff -Nru a/include/asm-sh/flat.h b/include/asm-sh/flat.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sh/flat.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,23 @@
+/*
+ * include/asm-sh/flat.h
+ *
+ * uClinux flat-format executables
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_SH_FLAT_H
+#define __ASM_SH_FLAT_H
+
+#define	flat_stack_align(sp)			/* nothing needed */
+#define	flat_argvp_envp_on_stack()		1
+#define	flat_old_ram_flag(flags)		(flags)
+#define	flat_reloc_valid(reloc, size)		((reloc) <= (size))
+#define	flat_get_addr_from_rp(rp, relval)	get_unaligned(rp)
+#define	flat_put_addr_at_rp(rp, val, relval)	put_unaligned(val,rp)
+#define	flat_get_relocate_addr(rel)		(rel)
+
+#endif /* __ASM_SH_FLAT_H */
diff -Nru a/include/asm-sh/floppy.h b/include/asm-sh/floppy.h
--- a/include/asm-sh/floppy.h	Tue Feb  3 19:45:41 2004
+++ b/include/asm-sh/floppy.h	Tue Feb  3 19:45:41 2004
@@ -33,7 +33,7 @@
 
 
 #define fd_inb(port)			inb_p(port)
-#define fd_outb(port,value)		outb_p(port,value)
+#define fd_outb(value,port)		outb_p(value,port)
 
 #define fd_request_dma()        CSW._request_dma(FLOPPY_DMA,"floppy")
 #define fd_free_dma()           CSW._free_dma(FLOPPY_DMA)
diff -Nru a/include/asm-sh/hardirq.h b/include/asm-sh/hardirq.h
--- a/include/asm-sh/hardirq.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-sh/hardirq.h	Tue Feb  3 19:45:17 2004
@@ -8,8 +8,6 @@
 /* entry.S is sensitive to the offsets of these fields */
 typedef struct {
 	unsigned int __softirq_pending;
-	unsigned int __syscall_count;
-	struct task_struct * __ksoftirqd_task;
 } ____cacheline_aligned irq_cpustat_t;
 
 #include <linux/irq_cpustat.h>	/* Standard mappings for irq_cpustat_t above */
@@ -96,28 +94,5 @@
 #else
 extern void synchronize_irq(unsigned int irq);
 #endif /* CONFIG_SMP */
-
-/* XXX: MRB-remove
-#define in_interrupt() ({ int __cpu = smp_processor_id(); \
-	(local_irq_count(__cpu) + local_bh_count(__cpu) != 0); })
-
-#define in_irq() (local_irq_count(smp_processor_id()) != 0)
-
-#ifndef CONFIG_SMP
-
-#define hardirq_trylock(cpu)	(local_irq_count(cpu) == 0)
-#define hardirq_endlock(cpu)	do { } while (0)
-
-#define irq_enter(cpu, irq)	(local_irq_count(cpu)++)
-#define irq_exit(cpu, irq)	(local_irq_count(cpu)--)
-
-#define synchronize_irq()	barrier()
-
-#else
-
-#error Super-H SMP is not available
-
-#endif
-*/
 
 #endif /* __ASM_SH_HARDIRQ_H */
diff -Nru a/include/asm-sh/hd64461/io.h b/include/asm-sh/hd64461/io.h
--- a/include/asm-sh/hd64461/io.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-sh/hd64461/io.h	Tue Feb  3 19:45:34 2004
@@ -12,8 +12,6 @@
 #ifndef _ASM_SH_IO_HD64461_H
 #define _ASM_SH_IO_HD64461_H
 
-#include <asm/io_generic.h>
-
 extern unsigned char hd64461_inb(unsigned long port);
 extern unsigned short hd64461_inw(unsigned long port);
 extern unsigned int hd64461_inl(unsigned long port);
@@ -25,49 +23,6 @@
 extern unsigned char hd64461_inb_p(unsigned long port);
 extern void hd64461_outb_p(unsigned char value, unsigned long port);
 
-extern void hd64461_insb(unsigned long port, void *addr, unsigned long count);
-extern void hd64461_insw(unsigned long port, void *addr, unsigned long count);
-extern void hd64461_insl(unsigned long port, void *addr, unsigned long count);
-extern void hd64461_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void hd64461_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void hd64461_outsl(unsigned long port, const void *addr, unsigned long count);
 extern int hd64461_irq_demux(int irq);
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			hd64461_inb
-# define __inw			hd64461_inw
-# define __inl			hd64461_inl
-# define __outb			hd64461_outb
-# define __outw			hd64461_outw
-# define __outl			hd64461_outl
-
-# define __inb_p		hd64461_inb_p
-# define __inw_p		hd64461_inw
-# define __inl_p		hd64461_inl
-# define __outb_p		hd64461_outb_p
-# define __outw_p		hd64461_outw
-# define __outl_p		hd64461_outl
-
-# define __insb			hd64461_insb
-# define __insw			hd64461_insw
-# define __insl			hd64461_insl
-# define __outsb		hd64461_outsb
-# define __outsw		hd64461_outsw
-# define __outsl		hd64461_outsl
-
-# define __readb		generic_readb
-# define __readw		generic_readw
-# define __readl		generic_readl
-# define __writeb		generic_writeb
-# define __writew		generic_writew
-# define __writel		generic_writel
-
-# define __isa_port2addr	generic_isa_port2addr
-# define __ioremap		generic_ioremap
-# define __ioremap_nocache	generic_ioremap_nocache
-# define __iounmap		generic_iounmap
-
-#endif
 
 #endif /* _ASM_SH_IO_HD64461_H */
diff -Nru a/include/asm-sh/hd64461.h b/include/asm-sh/hd64461.h
--- a/include/asm-sh/hd64461.h	Tue Feb  3 19:45:43 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,75 +0,0 @@
-#ifndef __ASM_SH_HD64461
-#define __ASM_SH_HD64461
-/*
- *	$Id: hd64461.h,v 1.7 2001/07/07 11:43:58 yaegashi Exp $
- *	Copyright (C) 2000 YAEGASHI Takeshi
- *	Hitachi HD64461 companion chip support
- */
-#include <linux/config.h>
-
-#define HD64461_STBCR	0x10000
-#define HD64461_SYSCR	0x10002
-#define HD64461_SCPUCR	0x10004
-
-#define HD64461_LCDCBAR		0x11000
-#define HD64461_LCDCLOR		0x11002
-#define HD64461_LCDCCRR		0x11004
-#define	HD64461_LDR1		0x11010
-#define	HD64461_LDR2		0x11012
-#define	HD64461_LDHNCR		0x11014
-#define	HD64461_LDHNSR		0x11016
-#define HD64461_LDVNTR		0x11018
-#define HD64461_LDVNDR		0x1101a
-#define HD64461_LDVSPR		0x1101c
-#define HD64461_LDR3		0x1101e
-
-#define HD64461_CPTWAR		0x11030	
-#define HD64461_CPTWDR		0x11032
-#define HD64461_CPTRAR		0x11034	
-#define HD64461_CPTRDR		0x11036
-
-#define HD64461_PCC0ISR         0x12000
-#define HD64461_PCC0GCR         0x12002
-#define HD64461_PCC0CSCR        0x12004
-#define HD64461_PCC0CSCIER      0x12006
-#define HD64461_PCC0SCR         0x12008
-#define HD64461_PCC1ISR         0x12010
-#define HD64461_PCC1GCR         0x12012
-#define HD64461_PCC1CSCR        0x12014
-#define HD64461_PCC1CSCIER      0x12016
-#define HD64461_PCC1SCR         0x12018
-#define HD64461_P0OCR           0x1202a
-#define HD64461_P1OCR           0x1202c
-#define HD64461_PGCR            0x1202e
-
-#define HD64461_GPACR		0x14000
-#define HD64461_GPBCR		0x14002
-#define HD64461_GPCCR		0x14004
-#define HD64461_GPDCR		0x14006
-#define HD64461_GPADR		0x14010
-#define HD64461_GPBDR		0x14012
-#define HD64461_GPCDR		0x14014
-#define HD64461_GPDDR		0x14016
-#define HD64461_GPAICR		0x14020
-#define HD64461_GPBICR		0x14022
-#define HD64461_GPCICR		0x14024
-#define HD64461_GPDICR		0x14026
-#define HD64461_GPAISR		0x14040
-#define HD64461_GPBISR		0x14042
-#define HD64461_GPCISR		0x14044
-#define HD64461_GPDISR		0x14046
-
-#define HD64461_NIRR		0x15000
-#define HD64461_NIMR		0x15002
-
-#ifndef CONFIG_HD64461_IOBASE
-#define CONFIG_HD64461_IOBASE	0xb0000000
-#endif
-#ifndef CONFIG_HD64461_IRQ
-#define CONFIG_HD64461_IRQ	36
-#endif
-
-#define HD64461_IRQBASE		OFFCHIP_IRQ_BASE
-#define HD64461_IRQ_NUM 	16
-
-#endif
diff -Nru a/include/asm-sh/hd64465/io.h b/include/asm-sh/hd64465/io.h
--- a/include/asm-sh/hd64465/io.h	Tue Feb  3 19:45:18 2004
+++ b/include/asm-sh/hd64465/io.h	Tue Feb  3 19:45:18 2004
@@ -16,8 +16,6 @@
 #ifndef _ASM_SH_IO_HD64465_H
 #define _ASM_SH_IO_HD64465_H
 
-#include <asm/io_generic.h>
-
 extern unsigned char hd64465_inb(unsigned long port);
 extern unsigned short hd64465_inw(unsigned long port);
 extern unsigned int hd64465_inl(unsigned long port);
@@ -29,12 +27,6 @@
 extern unsigned char hd64465_inb_p(unsigned long port);
 extern void hd64465_outb_p(unsigned char value, unsigned long port);
 
-extern void hd64465_insb(unsigned long port, void *addr, unsigned long count);
-extern void hd64465_insw(unsigned long port, void *addr, unsigned long count);
-extern void hd64465_insl(unsigned long port, void *addr, unsigned long count);
-extern void hd64465_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void hd64465_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void hd64465_outsl(unsigned long port, const void *addr, unsigned long count);
 extern unsigned long hd64465_isa_port2addr(unsigned long offset);
 extern int hd64465_irq_demux(int irq);
 /* Provision for generic secondary demux step -- used by PCMCIA code */
@@ -48,43 +40,5 @@
 extern void hd64465_port_map(unsigned short baseport, unsigned int nports,
 			     unsigned long addr, unsigned char shift);
 extern void hd64465_port_unmap(unsigned short baseport, unsigned int nports);
-
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			hd64465_inb
-# define __inw			hd64465_inw
-# define __inl			hd64465_inl
-# define __outb			hd64465_outb
-# define __outw			hd64465_outw
-# define __outl			hd64465_outl
-
-# define __inb_p		hd64465_inb_p
-# define __inw_p		hd64465_inw
-# define __inl_p		hd64465_inl
-# define __outb_p		hd64465_outb_p
-# define __outw_p		hd64465_outw
-# define __outl_p		hd64465_outl
-
-# define __insb			hd64465_insb
-# define __insw			hd64465_insw
-# define __insl			hd64465_insl
-# define __outsb		hd64465_outsb
-# define __outsw		hd64465_outsw
-# define __outsl		hd64465_outsl
-
-# define __readb		generic_readb
-# define __readw		generic_readw
-# define __readl		generic_readl
-# define __writeb		generic_writeb
-# define __writew		generic_writew
-# define __writel		generic_writel
-
-# define __isa_port2addr	hd64465_isa_port2addr
-# define __ioremap		generic_ioremap
-# define __iounmap		generic_iounmap
-
-
-#endif
 
 #endif /* _ASM_SH_IO_HD64465_H */
diff -Nru a/include/asm-sh/hd64465.h b/include/asm-sh/hd64465.h
--- a/include/asm-sh/hd64465.h	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,257 +0,0 @@
-#ifndef _ASM_SH_HD64465_
-#define _ASM_SH_HD64465_ 1
-/*
- * $Id: hd64465.h,v 1.3 2001/02/07 18:31:20 stuart_menefy Exp $
- *
- * Hitachi HD64465 companion chip support
- *
- * by Greg Banks <gbanks@pocketpenguins.com>
- * (c) 2000 PocketPenguins Inc.
- *
- * Derived from <asm/hd64461.h> which bore the message:
- * Copyright (C) 2000 YAEGASHI Takeshi
- */
-#include <linux/config.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-
-/*
- * Note that registers are defined here as virtual port numbers,
- * which have no meaning except to get translated by hd64465_isa_port2addr()
- * to an address in the range 0xb0000000-0xb3ffffff.  Note that
- * this translation happens to consist of adding the lower 16 bits
- * of the virtual port number to 0xb0000000.  Note also that the manual
- * shows addresses as absolute physical addresses starting at 0x10000000,
- * so e.g. the NIRR register is listed as 0x15000 here, 0x10005000 in the
- * manual, and accessed using address 0xb0005000 - Greg.
- */
-
-/* System registers */
-#define HD64465_REG_SRR     0x1000c 	/* System Revision Register */
-#define HD64465_REG_SDID    0x10010 	/* System Device ID Reg */
-#define     HD64465_SDID            0x8122  /* 64465 device ID */
-
-/* Power Management registers */
-#define HD64465_REG_SMSCR   0x10000 	/* System Module Standby Control Reg */
-#define	    HD64465_SMSCR_PS2ST     0x4000  /* PS/2 Standby */
-#define	    HD64465_SMSCR_ADCST     0x1000  /* ADC Standby */
-#define	    HD64465_SMSCR_UARTST    0x0800  /* UART Standby */
-#define	    HD64465_SMSCR_SCDIST    0x0200  /* Serial Codec Standby */
-#define	    HD64465_SMSCR_PPST	    0x0100  /* Parallel Port Standby */
-#define	    HD64465_SMSCR_PC0ST     0x0040  /* PCMCIA0 Standby */
-#define	    HD64465_SMSCR_PC1ST     0x0020  /* PCMCIA1 Standby */
-#define	    HD64465_SMSCR_AFEST     0x0010  /* AFE Standby */
-#define	    HD64465_SMSCR_TM0ST     0x0008  /* Timer0 Standby */
-#define	    HD64465_SMSCR_TM1ST     0x0004  /* Timer1 Standby */
-#define	    HD64465_SMSCR_IRDAST    0x0002  /* IRDA Standby */
-#define	    HD64465_SMSCR_KBCST     0x0001  /* Keyboard Controller Standby */
- 
-/* Interrupt Controller registers */
-#define HD64465_REG_NIRR    0x15000  	/* Interrupt Request Register */
-#define HD64465_REG_NIMR    0x15002  	/* Interrupt Mask Register */
-#define HD64465_REG_NITR    0x15004  	/* Interrupt Trigger Mode Register */
-
-/* Timer registers */
-#define HD64465_REG_TCVR1   0x16000  	/* Timer 1 constant value register  */
-#define HD64465_REG_TCVR0   0x16002	/* Timer 0 constant value register  */
-#define HD64465_REG_TRVR1   0x16004	/* Timer 1 read value register  */
-#define HD64465_REG_TRVR0   0x16006	/* Timer 0 read value register  */
-#define HD64465_REG_TCR1    0x16008	/* Timer 1 control register  */
-#define HD64465_REG_TCR0    0x1600A	/* Timer 0 control register  */
-#define	    HD64465_TCR_EADT 	0x10	    /* Enable ADTRIG# signal */
-#define	    HD64465_TCR_ETMO 	0x08	    /* Enable TMO signal */
-#define	    HD64465_TCR_PST_MASK 0x06	    /* Clock Prescale */
-#define	    HD64465_TCR_PST_1 	0x06	    /* 1:1 */
-#define	    HD64465_TCR_PST_4 	0x04	    /* 1:4 */
-#define	    HD64465_TCR_PST_8 	0x02	    /* 1:8 */
-#define	    HD64465_TCR_PST_16 	0x00	    /* 1:16 */
-#define	    HD64465_TCR_TSTP 	0x01	    /* Start/Stop timer */
-#define HD64465_REG_TIRR    0x1600C	/* Timer interrupt request register  */
-#define HD64465_REG_TIDR    0x1600E	/* Timer interrupt disable register  */
-#define HD64465_REG_PWM1CS  0x16010	/* PWM 1 clock scale register  */
-#define HD64465_REG_PWM1LPC 0x16012	/* PWM 1 low pulse width counter register  */
-#define HD64465_REG_PWM1HPC 0x16014	/* PWM 1 high pulse width counter register  */
-#define HD64465_REG_PWM0CS  0x16018	/* PWM 0 clock scale register  */
-#define HD64465_REG_PWM0LPC 0x1601A	/* PWM 0 low pulse width counter register  */
-#define HD64465_REG_PWM0HPC 0x1601C	/* PWM 0 high pulse width counter register  */
-
-/* Analog/Digital Converter registers */
-#define HD64465_REG_ADDRA   0x1E000	/* A/D data register A */
-#define HD64465_REG_ADDRB   0x1E002	/* A/D data register B */
-#define HD64465_REG_ADDRC   0x1E004	/* A/D data register C */
-#define HD64465_REG_ADDRD   0x1E006	/* A/D data register D */
-#define HD64465_REG_ADCSR   0x1E008	/* A/D control/status register */
-#define     HD64465_ADCSR_ADF	    0x80    /* A/D End Flag */
-#define     HD64465_ADCSR_ADST	    0x40    /* A/D Start Flag */
-#define     HD64465_ADCSR_ADIS	    0x20    /* A/D Interrupt Status */
-#define     HD64465_ADCSR_TRGE	    0x10    /* A/D Trigger Enable */
-#define     HD64465_ADCSR_ADIE	    0x08    /* A/D Interrupt Enable */
-#define     HD64465_ADCSR_SCAN	    0x04    /* A/D Scan Mode */
-#define     HD64465_ADCSR_CH_MASK   0x03    /* A/D Channel */
-#define HD64465_REG_ADCALCR 0x1E00A  	/* A/D calibration sample control */
-#define HD64465_REG_ADCAL   0x1E00C  	/* A/D calibration data register */
-
-
-/* General Purpose I/O ports registers */
-#define HD64465_REG_GPACR   0x14000  	/* Port A Control Register */
-#define HD64465_REG_GPBCR   0x14002  	/* Port B Control Register */
-#define HD64465_REG_GPCCR   0x14004  	/* Port C Control Register */
-#define HD64465_REG_GPDCR   0x14006  	/* Port D Control Register */
-#define HD64465_REG_GPECR   0x14008  	/* Port E Control Register */
-#define HD64465_REG_GPADR   0x14010  	/* Port A Data Register */
-#define HD64465_REG_GPBDR   0x14012  	/* Port B Data Register */
-#define HD64465_REG_GPCDR   0x14014  	/* Port C Data Register */
-#define HD64465_REG_GPDDR   0x14016  	/* Port D Data Register */
-#define HD64465_REG_GPEDR   0x14018  	/* Port E Data Register */
-#define HD64465_REG_GPAICR  0x14020  	/* Port A Interrupt Control Register */
-#define HD64465_REG_GPBICR  0x14022  	/* Port B Interrupt Control Register */
-#define HD64465_REG_GPCICR  0x14024  	/* Port C Interrupt Control Register */
-#define HD64465_REG_GPDICR  0x14026  	/* Port D Interrupt Control Register */
-#define HD64465_REG_GPEICR  0x14028  	/* Port E Interrupt Control Register */
-#define HD64465_REG_GPAISR  0x14040  	/* Port A Interrupt Status Register */
-#define HD64465_REG_GPBISR  0x14042  	/* Port B Interrupt Status Register */
-#define HD64465_REG_GPCISR  0x14044  	/* Port C Interrupt Status Register */
-#define HD64465_REG_GPDISR  0x14046  	/* Port D Interrupt Status Register */
-#define HD64465_REG_GPEISR  0x14048  	/* Port E Interrupt Status Register */
-
-/* PCMCIA bridge interface */
-#define HD64465_REG_PCC0ISR	0x12000	/* socket 0 interface status */ 
-#define     HD64465_PCCISR_PREADY   	 0x80    /* mem card ready / io card IREQ */
-#define     HD64465_PCCISR_PIREQ    	 0x80
-#define     HD64465_PCCISR_PMWP     	 0x40    /* mem card write-protected */
-#define     HD64465_PCCISR_PVS2 	 0x20    /* voltage select pin 2 */
-#define     HD64465_PCCISR_PVS1 	 0x10    /* voltage select pin 1 */
-#define     HD64465_PCCISR_PCD_MASK 	 0x0c    /* card detect */
-#define     HD64465_PCCISR_PBVD_MASK     0x03    /* battery voltage */
-#define     HD64465_PCCISR_PBVD_BATGOOD  0x03    /* battery good */
-#define     HD64465_PCCISR_PBVD_BATWARN  0x01    /* battery low warning */
-#define     HD64465_PCCISR_PBVD_BATDEAD1 0x02    /* battery dead */
-#define     HD64465_PCCISR_PBVD_BATDEAD2 0x00    /* battery dead */
-#define HD64465_REG_PCC0GCR	0x12002	/* socket 0 general control */ 
-#define     HD64465_PCCGCR_PDRV   	 0x80    /* output drive */
-#define     HD64465_PCCGCR_PCCR   	 0x40    /* PC card reset */
-#define     HD64465_PCCGCR_PCCT   	 0x20    /* PC card type, 1=IO&mem, 0=mem */
-#define     HD64465_PCCGCR_PVCC0   	 0x10    /* voltage control pin VCC0SEL0 */
-#define     HD64465_PCCGCR_PMMOD   	 0x08    /* memory mode */
-#define     HD64465_PCCGCR_PPA25   	 0x04    /* pin A25 */
-#define     HD64465_PCCGCR_PPA24   	 0x02    /* pin A24 */
-#define     HD64465_PCCGCR_PREG   	 0x01    /* ping PCC0REG# */
-#define HD64465_REG_PCC0CSCR	0x12004	/* socket 0 card status change */ 
-#define     HD64465_PCCCSCR_PSCDI   	 0x80    /* sw card detect intr */
-#define     HD64465_PCCCSCR_PSWSEL   	 0x40    /* power select */
-#define     HD64465_PCCCSCR_PIREQ   	 0x20    /* IREQ intr req */
-#define     HD64465_PCCCSCR_PSC   	 0x10    /* STSCHG (status change) pin */
-#define     HD64465_PCCCSCR_PCDC   	 0x08    /* CD (card detect) change */
-#define     HD64465_PCCCSCR_PRC   	 0x04    /* ready change */
-#define     HD64465_PCCCSCR_PBW   	 0x02    /* battery warning change */
-#define     HD64465_PCCCSCR_PBD   	 0x01    /* battery dead change */
-#define HD64465_REG_PCC0CSCIER	0x12006	/* socket 0 card status change interrupt enable */ 
-#define     HD64465_PCCCSCIER_PCRE   	 0x80    /* change reset enable */
-#define     HD64465_PCCCSCIER_PIREQE_MASK   	0x60   /* IREQ enable */
-#define     HD64465_PCCCSCIER_PIREQE_DISABLED	0x00   /* IREQ disabled */
-#define     HD64465_PCCCSCIER_PIREQE_LEVEL  	0x20   /* IREQ level-triggered */
-#define     HD64465_PCCCSCIER_PIREQE_FALLING	0x40   /* IREQ falling-edge-trig */
-#define     HD64465_PCCCSCIER_PIREQE_RISING 	0x60   /* IREQ rising-edge-trig */
-#define     HD64465_PCCCSCIER_PSCE   	 0x10    /* status change enable */
-#define     HD64465_PCCCSCIER_PCDE   	 0x08    /* card detect change enable */
-#define     HD64465_PCCCSCIER_PRE   	 0x04    /* ready change enable */
-#define     HD64465_PCCCSCIER_PBWE   	 0x02    /* battery warn change enable */
-#define     HD64465_PCCCSCIER_PBDE   	 0x01    /* battery dead change enable*/
-#define HD64465_REG_PCC0SCR	0x12008	/* socket 0 software control */ 
-#define     HD64465_PCCSCR_SHDN   	 0x10    /* TPS2206 SHutDowN pin */
-#define     HD64465_PCCSCR_SWP   	 0x01    /* write protect */
-#define HD64465_REG_PCCPSR	0x1200A	/* serial power switch control */ 
-#define HD64465_REG_PCC1ISR	0x12010	/* socket 1 interface status */ 
-#define HD64465_REG_PCC1GCR	0x12012	/* socket 1 general control */ 
-#define HD64465_REG_PCC1CSCR	0x12014	/* socket 1 card status change */ 
-#define HD64465_REG_PCC1CSCIER	0x12016	/* socket 1 card status change interrupt enable */ 
-#define HD64465_REG_PCC1SCR	0x12018	/* socket 1 software control */ 
-
-
-/* PS/2 Keyboard and mouse controller -- *not* register compatible */
-#define HD64465_REG_KBCSR   	0x1dc00 /* Keyboard Control/Status reg */
-#define     HD64465_KBCSR_KBCIE   	 0x8000    /* KBCK Input Enable */
-#define     HD64465_KBCSR_KBCOE   	 0x4000    /* KBCK Output Enable */
-#define     HD64465_KBCSR_KBDOE   	 0x2000    /* KB DATA Output Enable */
-#define     HD64465_KBCSR_KBCD   	 0x1000    /* KBCK Driven */
-#define     HD64465_KBCSR_KBDD   	 0x0800    /* KB DATA Driven */
-#define     HD64465_KBCSR_KBCS   	 0x0400    /* KBCK pin Status */
-#define     HD64465_KBCSR_KBDS   	 0x0200    /* KB DATA pin Status */
-#define     HD64465_KBCSR_KBDP   	 0x0100    /* KB DATA Parity bit */
-#define     HD64465_KBCSR_KBD_MASK   	 0x00ff    /* KD DATA shift reg */
-#define HD64465_REG_KBISR   	0x1dc04 /* Keyboard Interrupt Status reg */
-#define     HD64465_KBISR_KBRDF   	 0x0001    /* KB Received Data Full */
-#define HD64465_REG_MSCSR   	0x1dc10 /* Mouse Control/Status reg */
-#define HD64465_REG_MSISR   	0x1dc14 /* Mouse Interrupt Status reg */
-
-
-/*
- * Logical address at which the HD64465 is mapped.  Note that this
- * should always be in the P2 segment (uncached and untranslated).
- */
-#ifndef CONFIG_HD64465_IOBASE
-#define CONFIG_HD64465_IOBASE	0xb0000000
-#endif
-/*
- * The HD64465 multiplexes all its modules' interrupts onto
- * this single interrupt.
- */
-#ifndef CONFIG_HD64465_IRQ
-#define CONFIG_HD64465_IRQ	5
-#endif
-
-
-#define _HD64465_IO_MASK	0xf8000000
-#define is_hd64465_addr(addr) \
-	((addr & _HD64465_IO_MASK) == (CONFIG_HD64465_IOBASE & _HD64465_IO_MASK))
-
-/*
- * A range of 16 virtual interrupts generated by
- * demuxing the HD64465 muxed interrupt.
- */
-#define HD64465_IRQ_BASE	OFFCHIP_IRQ_BASE
-#define HD64465_IRQ_NUM 	16
-#define HD64465_IRQ_ADC     	(HD64465_IRQ_BASE+0)
-#define HD64465_IRQ_USB     	(HD64465_IRQ_BASE+1)
-#define HD64465_IRQ_SCDI    	(HD64465_IRQ_BASE+2)
-#define HD64465_IRQ_PARALLEL	(HD64465_IRQ_BASE+3)
-/* bit 4 is reserved */
-#define HD64465_IRQ_UART    	(HD64465_IRQ_BASE+5)
-#define HD64465_IRQ_IRDA    	(HD64465_IRQ_BASE+6)
-#define HD64465_IRQ_PS2MOUSE	(HD64465_IRQ_BASE+7)
-#define HD64465_IRQ_KBC     	(HD64465_IRQ_BASE+8)
-#define HD64465_IRQ_TIMER1   	(HD64465_IRQ_BASE+9)
-#define HD64465_IRQ_TIMER0  	(HD64465_IRQ_BASE+10)
-#define HD64465_IRQ_GPIO    	(HD64465_IRQ_BASE+11)
-#define HD64465_IRQ_AFE     	(HD64465_IRQ_BASE+12)
-#define HD64465_IRQ_PCMCIA1 	(HD64465_IRQ_BASE+13)
-#define HD64465_IRQ_PCMCIA0 	(HD64465_IRQ_BASE+14)
-#define HD64465_IRQ_PS2KBD     	(HD64465_IRQ_BASE+15)
-
-/* Constants for PCMCIA mappings */
-#define HD64465_PCC_WINDOW	0x01000000
-
-#define HD64465_PCC0_BASE	0xb8000000	/* area 6 */
-#define HD64465_PCC0_ATTR	(HD64465_PCC0_BASE)
-#define HD64465_PCC0_COMM	(HD64465_PCC0_BASE+HD64465_PCC_WINDOW)
-#define HD64465_PCC0_IO		(HD64465_PCC0_BASE+2*HD64465_PCC_WINDOW)
-
-#define HD64465_PCC1_BASE	0xb4000000	/* area 5 */
-#define HD64465_PCC1_ATTR	(HD64465_PCC1_BASE)
-#define HD64465_PCC1_COMM	(HD64465_PCC1_BASE+HD64465_PCC_WINDOW)
-#define HD64465_PCC1_IO		(HD64465_PCC1_BASE+2*HD64465_PCC_WINDOW)
-
-/*
- * Base of USB controller interface (as memory)
- */
-#define HD64465_USB_BASE    	(CONFIG_HD64465_IOBASE+0xb000)
-#define HD64465_USB_LEN    	0x1000
-/*
- * Base of embedded SRAM, used for USB controller.
- */
-#define HD64465_SRAM_BASE    	(CONFIG_HD64465_IOBASE+0x9000)
-#define HD64465_SRAM_LEN    	0x1000
-
-
-
-#endif /* _ASM_SH_HD64465_  */
diff -Nru a/include/asm-sh/hd64465_gpio.h b/include/asm-sh/hd64465_gpio.h
--- a/include/asm-sh/hd64465_gpio.h	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,46 +0,0 @@
-#ifndef _ASM_SH_HD64465_GPIO_
-#define _ASM_SH_HD64465_GPIO_ 1
-/*
- * $Id: hd64465_gpio.h,v 1.2 2001/05/24 00:14:13 gniibe Exp $
- *
- * Hitachi HD64465 companion chip: General Purpose IO pins support.
- * This layer enables other device drivers to configure GPIO
- * pins, get and set their values, and register an interrupt
- * routine for when input pins change in hardware.
- *
- * by Greg Banks <gbanks@pocketpenguins.com>
- * (c) 2000 PocketPenguins Inc.
- */
-#include <asm/hd64465.h>
-
-/* Macro to construct a portpin number (used in all
- * subsequent functions) from a port letter and a pin
- * number, e.g. HD64465_GPIO_PORTPIN('A', 5).
- */
-#define HD64465_GPIO_PORTPIN(port,pin)	(((port)-'A')<<3|(pin))
-
-/* Pin configuration constants for _configure() */
-#define HD64465_GPIO_FUNCTION2	0	/* use the pin's *other* function */
-#define HD64465_GPIO_OUT	1	/* output */
-#define HD64465_GPIO_IN_PULLUP	2	/* input, pull-up MOS on */
-#define HD64465_GPIO_IN		3	/* input */
-
-/* Configure a pin's direction */
-extern void hd64465_gpio_configure(int portpin, int direction);
-
-/* Get, set value */
-extern void hd64465_gpio_set_pin(int portpin, unsigned int value);
-extern unsigned int hd64465_gpio_get_pin(int portpin);
-extern void hd64465_gpio_set_port(int port, unsigned int value);
-extern unsigned int hd64465_gpio_get_port(int port);
-
-/* mode constants for _register_irq() */
-#define HD64465_GPIO_FALLING	0
-#define HD64465_GPIO_RISING	1
-
-/* Interrupt on external value change */
-extern void hd64465_gpio_register_irq(int portpin, int mode,
-	void (*handler)(int portpin, void *dev), void *dev);
-extern void hd64465_gpio_unregister_irq(int portpin);
-
-#endif /* _ASM_SH_HD64465_GPIO_  */
diff -Nru a/include/asm-sh/hitachi_7751se.h b/include/asm-sh/hitachi_7751se.h
--- a/include/asm-sh/hitachi_7751se.h	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,68 +0,0 @@
-#ifndef __ASM_SH_HITACHI_7751SE_H
-#define __ASM_SH_HITACHI_7751SE_H
-
-/*
- * linux/include/asm-sh/hitachi_7751se.h
- *
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * Hitachi SolutionEngine support
-
- * Modified for 7751 Solution Engine by
- * Ian da Silva and Jeremy Siegel, 2001.
- */
-
-/* Box specific addresses.  */
-
-#define PA_ROM		0x00000000	/* EPROM */
-#define PA_ROM_SIZE	0x00400000	/* EPROM size 4M byte */
-#define PA_FROM		0x01000000	/* EPROM */
-#define PA_FROM_SIZE	0x00400000	/* EPROM size 4M byte */
-#define PA_EXT1		0x04000000
-#define PA_EXT1_SIZE	0x04000000
-#define PA_EXT2		0x08000000
-#define PA_EXT2_SIZE	0x04000000
-#define PA_SDRAM	0x0c000000
-#define PA_SDRAM_SIZE	0x04000000
-
-#define PA_EXT4		0x12000000
-#define PA_EXT4_SIZE	0x02000000
-#define PA_EXT5		0x14000000
-#define PA_EXT5_SIZE	0x04000000
-#define PA_PCIC		0x18000000	/* MR-SHPC-01 PCMCIA */
-
-#define PA_DIPSW0	0xb9000000	/* Dip switch 5,6 */
-#define PA_DIPSW1	0xb9000002	/* Dip switch 7,8 */
-#define PA_LED		0xba000000	/* LED */
-#define	PA_BCR		0xbb000000	/* FPGA on the MS7751SE01 */
-
-#define PA_MRSHPC	0xb83fffe0	/* MR-SHPC-01 PCMCIA controler */
-#define PA_MRSHPC_MW1	0xb8400000	/* MR-SHPC-01 memory window base */
-#define PA_MRSHPC_MW2	0xb8500000	/* MR-SHPC-01 attribute window base */
-#define PA_MRSHPC_IO	0xb8600000	/* MR-SHPC-01 I/O window base */
-#define MRSHPC_MODE     (PA_MRSHPC + 4)
-#define MRSHPC_OPTION   (PA_MRSHPC + 6)
-#define MRSHPC_CSR      (PA_MRSHPC + 8)
-#define MRSHPC_ISR      (PA_MRSHPC + 10)
-#define MRSHPC_ICR      (PA_MRSHPC + 12)
-#define MRSHPC_CPWCR    (PA_MRSHPC + 14)
-#define MRSHPC_MW0CR1   (PA_MRSHPC + 16)
-#define MRSHPC_MW1CR1   (PA_MRSHPC + 18)
-#define MRSHPC_IOWCR1   (PA_MRSHPC + 20)
-#define MRSHPC_MW0CR2   (PA_MRSHPC + 22)
-#define MRSHPC_MW1CR2   (PA_MRSHPC + 24)
-#define MRSHPC_IOWCR2   (PA_MRSHPC + 26)
-#define MRSHPC_CDCR     (PA_MRSHPC + 28)
-#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
-
-#define BCR_ILCRA	(PA_BCR + 0)
-#define BCR_ILCRB	(PA_BCR + 2)
-#define BCR_ILCRC	(PA_BCR + 4)
-#define BCR_ILCRD	(PA_BCR + 6)
-#define BCR_ILCRE	(PA_BCR + 8)
-#define BCR_ILCRF	(PA_BCR + 10)
-#define BCR_ILCRG	(PA_BCR + 12)
-
-#define IRQ_79C973	13
-
-#endif  /* __ASM_SH_HITACHI_7751SE_H */
diff -Nru a/include/asm-sh/hitachi_se.h b/include/asm-sh/hitachi_se.h
--- a/include/asm-sh/hitachi_se.h	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,69 +0,0 @@
-#ifndef __ASM_SH_HITACHI_SE_H
-#define __ASM_SH_HITACHI_SE_H
-
-/*
- * linux/include/asm-sh/hitachi_se.h
- *
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * Hitachi SolutionEngine support
- */
-
-/* Box specific addresses.  */
-
-#define PA_ROM		0x00000000	/* EPROM */
-#define PA_ROM_SIZE	0x00400000	/* EPROM size 4M byte */
-#define PA_FROM		0x01000000	/* EPROM */
-#define PA_FROM_SIZE	0x00400000	/* EPROM size 4M byte */
-#define PA_EXT1		0x04000000
-#define PA_EXT1_SIZE	0x04000000
-#define PA_EXT2		0x08000000
-#define PA_EXT2_SIZE	0x04000000
-#define PA_SDRAM	0x0c000000
-#define PA_SDRAM_SIZE	0x04000000
-
-#define PA_EXT4		0x12000000
-#define PA_EXT4_SIZE	0x02000000
-#define PA_EXT5		0x14000000
-#define PA_EXT5_SIZE	0x04000000
-#define PA_PCIC		0x18000000	/* MR-SHPC-01 PCMCIA */
-
-#define PA_83902	0xb0000000	/* DP83902A */
-#define PA_83902_IF	0xb0040000	/* DP83902A remote io port */
-#define PA_83902_RST	0xb0080000	/* DP83902A reset port */
-
-#define PA_SUPERIO	0xb0400000	/* SMC37C935A super io chip */
-#define PA_DIPSW0	0xb0800000	/* Dip switch 5,6 */
-#define PA_DIPSW1	0xb0800002	/* Dip switch 7,8 */
-#define PA_LED		0xb0c00000	/* LED */
-#define PA_BCR		0xb1400000	/* FPGA */
-
-#define PA_MRSHPC	0xb83fffe0	/* MR-SHPC-01 PCMCIA controller */
-#define PA_MRSHPC_MW1	0xb8400000	/* MR-SHPC-01 memory window base */
-#define PA_MRSHPC_MW2	0xb8500000	/* MR-SHPC-01 attribute window base */
-#define PA_MRSHPC_IO	0xb8600000	/* MR-SHPC-01 I/O window base */
-#define MRSHPC_OPTION   (PA_MRSHPC + 6)
-#define MRSHPC_CSR      (PA_MRSHPC + 8)
-#define MRSHPC_ISR      (PA_MRSHPC + 10)
-#define MRSHPC_ICR      (PA_MRSHPC + 12)
-#define MRSHPC_CPWCR    (PA_MRSHPC + 14)
-#define MRSHPC_MW0CR1   (PA_MRSHPC + 16)
-#define MRSHPC_MW1CR1   (PA_MRSHPC + 18)
-#define MRSHPC_IOWCR1   (PA_MRSHPC + 20)
-#define MRSHPC_MW0CR2   (PA_MRSHPC + 22)
-#define MRSHPC_MW1CR2   (PA_MRSHPC + 24)
-#define MRSHPC_IOWCR2   (PA_MRSHPC + 26)
-#define MRSHPC_CDCR     (PA_MRSHPC + 28)
-#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
-
-#define BCR_ILCRA	(PA_BCR + 0)
-#define BCR_ILCRB	(PA_BCR + 2)
-#define BCR_ILCRC	(PA_BCR + 4)
-#define BCR_ILCRD	(PA_BCR + 6)
-#define BCR_ILCRE	(PA_BCR + 8)
-#define BCR_ILCRF	(PA_BCR + 10)
-#define BCR_ILCRG	(PA_BCR + 12)
-
-#define IRQ_STNIC	10
-
-#endif  /* __ASM_SH_HITACHI_SE_H */
diff -Nru a/include/asm-sh/io.h b/include/asm-sh/io.h
--- a/include/asm-sh/io.h	Tue Feb  3 19:45:29 2004
+++ b/include/asm-sh/io.h	Tue Feb  3 19:45:29 2004
@@ -18,8 +18,7 @@
 
 /*
  * We follow the Alpha convention here:
- *  __inb expands to an inline function call (which either calls via the
- *        mach_vec if generic, or a machine specific implementation)
+ *  __inb expands to an inline function call (which calls via the mv)
  *  _inb  is a real function call (note ___raw fns are _ version of __raw)
  *  inb   by default expands to _inb, but the machine specific code may
  *        define it to __inb if it chooses.
@@ -27,6 +26,8 @@
 
 #include <asm/cache.h>
 #include <asm/system.h>
+#include <asm/addrspace.h>
+#include <asm/machvec.h>
 #include <linux/config.h>
 
 /*
@@ -35,11 +36,13 @@
  */
 
 #ifdef __KERNEL__
-#if defined(CONFIG_SH_GENERIC) || defined(CONFIG_SH_CQREEK) || defined(CONFIG_SH_UNKNOWN)
-
-/* In a generic kernel, we always go through the machine vector.  */
-
-#include <asm/machvec.h>
+/*
+ * Since boards are able to define their own set of I/O routines through
+ * their respective machine vector, we always wrap through the mv.
+ *
+ * Also, in the event that a board hasn't provided its own definition for
+ * a given routine, it will be wrapped to generic code at run-time.
+ */
 
 # define __inb(p)	sh_mv.mv_inb((p))
 # define __inw(p)	sh_mv.mv_inw((p))
@@ -55,12 +58,12 @@
 # define __outw_p(x,p)	sh_mv.mv_outw_p((x),(p))
 # define __outl_p(x,p)	sh_mv.mv_outl_p((x),(p))
 
-#define __insb(p,b,c)	sh_mv.mv_insb((p), (b), (c))
-#define __insw(p,b,c)	sh_mv.mv_insw((p), (b), (c))
-#define __insl(p,b,c)	sh_mv.mv_insl((p), (b), (c))
-#define __outsb(p,b,c)	sh_mv.mv_outsb((p), (b), (c))
-#define __outsw(p,b,c)	sh_mv.mv_outsw((p), (b), (c))
-#define __outsl(p,b,c)	sh_mv.mv_outsl((p), (b), (c))
+# define __insb(p,b,c)	sh_mv.mv_insb((p), (b), (c))
+# define __insw(p,b,c)	sh_mv.mv_insw((p), (b), (c))
+# define __insl(p,b,c)	sh_mv.mv_insl((p), (b), (c))
+# define __outsb(p,b,c)	sh_mv.mv_outsb((p), (b), (c))
+# define __outsw(p,b,c)	sh_mv.mv_outsw((p), (b), (c))
+# define __outsl(p,b,c)	sh_mv.mv_outsl((p), (b), (c))
 
 # define __readb(a)	sh_mv.mv_readb((a))
 # define __readw(a)	sh_mv.mv_readw((a))
@@ -102,205 +105,31 @@
 # define __raw_writew	__writew
 # define __raw_writel	__writel
 
-#else
-
-/* Control operations through platform specific headers */
-# define __WANT_IO_DEF
-
-# include <asm/mach/io.h>
-
-#undef __WANT_IO_DEF
-
-#endif /* GENERIC */
-#endif /* __KERNEL__ */
-
-/* These are always function calls, in both kernel and user space */
-extern unsigned char	_inb (unsigned long port);
-extern unsigned short	_inw (unsigned long port);
-extern unsigned int	_inl (unsigned long port);
-extern void		_outb (unsigned char b, unsigned long port);
-extern void		_outw (unsigned short w, unsigned long port);
-extern void		_outl (unsigned int l, unsigned long port);
-extern unsigned char	_inb_p (unsigned long port);
-extern unsigned short	_inw_p (unsigned long port);
-extern unsigned int	_inl_p (unsigned long port);
-extern void		_outb_p (unsigned char b, unsigned long port);
-extern void		_outw_p (unsigned short w, unsigned long port);
-extern void		_outl_p (unsigned int l, unsigned long port);
-extern void		_insb (unsigned long port, void *dst, unsigned long count);
-extern void		_insw (unsigned long port, void *dst, unsigned long count);
-extern void		_insl (unsigned long port, void *dst, unsigned long count);
-extern void		_outsb (unsigned long port, const void *src, unsigned long count);
-extern void		_outsw (unsigned long port, const void *src, unsigned long count);
-extern void		_outsl (unsigned long port, const void *src, unsigned long count);
-extern unsigned char	_readb(unsigned long addr);
-extern unsigned short	_readw(unsigned long addr);
-extern unsigned int	_readl(unsigned long addr);
-extern void		_writeb(unsigned char b, unsigned long addr);
-extern void		_writew(unsigned short b, unsigned long addr);
-extern void		_writel(unsigned int b, unsigned long addr);
-
-#ifdef __KERNEL__
-extern unsigned char	___raw_readb(unsigned long addr);
-extern unsigned short	___raw_readw(unsigned long addr);
-extern unsigned int	___raw_readl(unsigned long addr);
-extern void		___raw_writeb(unsigned char b, unsigned long addr);
-extern void		___raw_writew(unsigned short b, unsigned long addr);
-extern void		___raw_writel(unsigned int b, unsigned long addr);
-#endif
-
-#ifdef __KERNEL__
 /*
  * The platform header files may define some of these macros to use
  * the inlined versions where appropriate.  These macros may also be
  * redefined by userlevel programs.
  */
-#ifndef inb
-# define inb(p)		_inb(p)
-#endif
-#ifndef inw
-# define inw(p)		_inw(p)
-#endif
-#ifndef inl
-# define inl(p)		_inl(p)
-#endif
-
-#ifndef outb
-# define outb(b,p)	_outb((b),(p))
-#endif
-#ifndef outw
-# define outw(w,p)	_outw((w),(p))
-#endif
-#ifndef outl
-# define outl(l,p)	_outl((l),(p))
-#endif
-
-#ifndef inb_p
-# define inb_p		_inb_p
-#endif
-#ifndef inw_p
-# define inw_p		_inw_p
-#endif
-#ifndef inl_p
-# define inl_p		_inl_p
-#endif
-
-#ifndef outb_p
-# define outb_p		_outb_p
-#endif
-#ifndef outw_p
-# define outw_p		_outw_p
-#endif
-#ifndef outl_p
-# define outl_p		_outl_p
-#endif
-
-#ifndef insb
-# define insb(p,d,c)	_insb((p),(d),(c))
-#endif
-#ifndef insw
-# define insw(p,d,c)	_insw((p),(d),(c))
-#endif
-#ifndef insl
-# define insl(p,d,c)	_insl((p),(d),(c))
-#endif
-#ifndef outsb
-# define outsb(p,s,c)	_outsb((p),(s),(c))
-#endif
-#ifndef outsw
-# define outsw(p,s,c)	_outsw((p),(s),(c))
-#endif
-#ifndef outsl
-# define outsl(p,s,c)	_outsl((p),(s),(c))
-#endif
-
 #ifdef __raw_readb
-# define readb(a)	({ unsigned long r_ = __raw_readb(a); mb(); r_; })
+# define readb(a)	({ unsigned long r_ = __raw_readb((unsigned long)a); mb(); r_; })
 #endif
 #ifdef __raw_readw
-# define readw(a)	({ unsigned long r_ = __raw_readw(a); mb(); r_; })
+# define readw(a)	({ unsigned long r_ = __raw_readw((unsigned long)a); mb(); r_; })
 #endif
 #ifdef __raw_readl
-# define readl(a)	({ unsigned long r_ = __raw_readl(a); mb(); r_; })
+# define readl(a)	({ unsigned long r_ = __raw_readl((unsigned long)a); mb(); r_; })
 #endif
 
 #ifdef __raw_writeb
-# define writeb(v,a)	({ __raw_writeb((v),(a)); mb(); })
+# define writeb(v,a)	({ __raw_writeb((v),(unsigned long)(a)); mb(); })
 #endif
 #ifdef __raw_writew
-# define writew(v,a)	({ __raw_writew((v),(a)); mb(); })
+# define writew(v,a)	({ __raw_writew((v),(unsigned long)(a)); mb(); })
 #endif
 #ifdef __raw_writel
-# define writel(v,a)	({ __raw_writel((v),(a)); mb(); })
-#endif
-
-#ifndef __raw_readb
-# define __raw_readb(a)	___raw_readb((unsigned long)(a))
-#endif
-#ifndef __raw_readw
-# define __raw_readw(a)	___raw_readw((unsigned long)(a))
-#endif
-#ifndef __raw_readl
-# define __raw_readl(a)	___raw_readl((unsigned long)(a))
+# define writel(v,a)	({ __raw_writel((v),(unsigned long)(a)); mb(); })
 #endif
 
-#ifndef __raw_writeb
-# define __raw_writeb(v,a)  ___raw_writeb((v),(unsigned long)(a))
-#endif
-#ifndef __raw_writew
-# define __raw_writew(v,a)  ___raw_writew((v),(unsigned long)(a))
-#endif
-#ifndef __raw_writel
-# define __raw_writel(v,a)  ___raw_writel((v),(unsigned long)(a))
-#endif
-
-#ifndef readb
-# define readb(a)	_readb((unsigned long)(a))
-#endif
-#ifndef readw
-# define readw(a)	_readw((unsigned long)(a))
-#endif
-#ifndef readl
-# define readl(a)	_readl((unsigned long)(a))
-#endif
-
-#ifndef writeb
-# define writeb(v,a)	_writeb((v),(unsigned long)(a))
-#endif
-#ifndef writew
-# define writew(v,a)	_writew((v),(unsigned long)(a))
-#endif
-#ifndef writel
-# define writel(v,a)	_writel((v),(unsigned long)(a))
-#endif
-
-#else 
-
-/* Userspace declarations.  */
-
-extern unsigned char	inb(unsigned long port);
-extern unsigned short	inw(unsigned long port);
-extern unsigned int	inl(unsigned long port);
-extern void		outb(unsigned char b, unsigned long port);
-extern void		outw(unsigned short w, unsigned long port);
-extern void		outl(unsigned int l, unsigned long port);
-extern void		insb(unsigned long port, void *dst, unsigned long count);
-extern void		insw(unsigned long port, void *dst, unsigned long count);
-extern void		insl(unsigned long port, void *dst, unsigned long count);
-extern void		outsb(unsigned long port, const void *src, unsigned long count);
-extern void		outsw(unsigned long port, const void *src, unsigned long count);
-extern void		outsl(unsigned long port, const void *src, unsigned long count);
-extern unsigned char	readb(unsigned long addr);
-extern unsigned short	readw(unsigned long addr);
-extern unsigned long	readl(unsigned long addr);
-extern void		writeb(unsigned char b, unsigned long addr);
-extern void		writew(unsigned short b, unsigned long addr);
-extern void		writel(unsigned int b, unsigned long addr);
-
-#endif /* __KERNEL__ */
-
-#ifdef __KERNEL__
-
 /*
  * If the platform has PC-like I/O, this function converts the offset into
  * an address.
@@ -310,6 +139,20 @@
 	return __isa_port2addr(offset);
 }
 
+/*
+ * This function provides a method for the generic case where a board-specific
+ * isa_port2addr simply needs to return the port + some arbitrary port base.
+ *
+ * We use this at board setup time to implicitly set the port base, and
+ * as a result, we can use the generic isa_port2addr.
+ */
+static inline void __set_io_port_base(unsigned long pbase)
+{
+	extern unsigned long generic_io_base;
+
+	generic_io_base = pbase;
+}
+
 #define isa_readb(a) readb(isa_port2addr(a))
 #define isa_readw(a) readw(isa_port2addr(a))
 #define isa_readl(a) readl(isa_port2addr(a))
@@ -361,8 +204,6 @@
 
 #define IO_SPACE_LIMIT 0xffffffff
 
-#include <asm/addrspace.h>
-
 /*
  * Change virtual addresses to physical addresses and vv.
  * These are trivial on the 1:1 Linux/SuperH mapping
@@ -449,4 +290,5 @@
     __flush_wback_region(_start,_size)
 
 #endif /* __KERNEL__ */
+
 #endif /* __ASM_SH_IO_H */
diff -Nru a/include/asm-sh/io_7751se.h b/include/asm-sh/io_7751se.h
--- a/include/asm-sh/io_7751se.h	Tue Feb  3 19:45:37 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,80 +0,0 @@
-/*
- * include/asm-sh/io_7751se.h
- *
- * Modified version of io_se.h for the 7751se-specific functions.
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * IO functions for an Hitachi SolutionEngine
- */
-
-#ifndef _ASM_SH_IO_7751SE_H
-#define _ASM_SH_IO_7751SE_H
-
-#include <asm/io_generic.h>
-
-extern unsigned char sh7751se_inb(unsigned long port);
-extern unsigned short sh7751se_inw(unsigned long port);
-extern unsigned int sh7751se_inl(unsigned long port);
-
-extern void sh7751se_outb(unsigned char value, unsigned long port);
-extern void sh7751se_outw(unsigned short value, unsigned long port);
-extern void sh7751se_outl(unsigned int value, unsigned long port);
-
-extern unsigned char sh7751se_inb_p(unsigned long port);
-extern void sh7751se_outb_p(unsigned char value, unsigned long port);
-
-extern void sh7751se_insb(unsigned long port, void *addr, unsigned long count);
-extern void sh7751se_insw(unsigned long port, void *addr, unsigned long count);
-extern void sh7751se_insl(unsigned long port, void *addr, unsigned long count);
-extern void sh7751se_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void sh7751se_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void sh7751se_outsl(unsigned long port, const void *addr, unsigned long count);
-
-extern unsigned char sh7751se_readb(unsigned long addr);
-extern unsigned short sh7751se_readw(unsigned long addr);
-extern unsigned int sh7751se_readl(unsigned long addr);
-extern void sh7751se_writeb(unsigned char b, unsigned long addr);
-extern void sh7751se_writew(unsigned short b, unsigned long addr);
-extern void sh7751se_writel(unsigned int b, unsigned long addr);
-
-extern unsigned long sh7751se_isa_port2addr(unsigned long offset);
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			sh7751se_inb
-# define __inw			sh7751se_inw
-# define __inl			sh7751se_inl
-# define __outb			sh7751se_outb
-# define __outw			sh7751se_outw
-# define __outl			sh7751se_outl
-
-# define __inb_p		sh7751se_inb_p
-# define __inw_p		sh7751se_inw
-# define __inl_p		sh7751se_inl
-# define __outb_p		sh7751se_outb_p
-# define __outw_p		sh7751se_outw
-# define __outl_p		sh7751se_outl
-
-# define __insb			sh7751se_insb
-# define __insw			sh7751se_insw
-# define __insl			sh7751se_insl
-# define __outsb		sh7751se_outsb
-# define __outsw		sh7751se_outsw
-# define __outsl		sh7751se_outsl
-
-# define __readb		sh7751se_readb
-# define __readw		sh7751se_readw
-# define __readl		sh7751se_readl
-# define __writeb		sh7751se_writeb
-# define __writew		sh7751se_writew
-# define __writel		sh7751se_writel
-
-# define __isa_port2addr	sh7751se_isa_port2addr
-# define __ioremap		generic_ioremap
-# define __iounmap		generic_iounmap
-
-#endif
-
-#endif /* _ASM_SH_IO_7751SE_H */
diff -Nru a/include/asm-sh/io_adx.h b/include/asm-sh/io_adx.h
--- a/include/asm-sh/io_adx.h	Tue Feb  3 19:45:35 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,86 +0,0 @@
-/*
- * include/asm-sh/io_adx.h
- *
- * Copyright (C) 2001 A&D Co., Ltd.
- *
- * This file may be copied or modified under the terms of the GNU
- * General Public License.  See linux/COPYING for more information.
- *
- * IO functions for an A&D ADX Board
- */
-
-#ifndef _ASM_SH_IO_ADX_H
-#define _ASM_SH_IO_ADX_H
-
-#include <asm/io_generic.h>
-
-extern unsigned char adx_inb(unsigned long port);
-extern unsigned short adx_inw(unsigned long port);
-extern unsigned int adx_inl(unsigned long port);
-
-extern void adx_outb(unsigned char value, unsigned long port);
-extern void adx_outw(unsigned short value, unsigned long port);
-extern void adx_outl(unsigned int value, unsigned long port);
-
-extern unsigned char adx_inb_p(unsigned long port);
-extern void adx_outb_p(unsigned char value, unsigned long port);
-
-extern void adx_insb(unsigned long port, void *addr, unsigned long count);
-extern void adx_insw(unsigned long port, void *addr, unsigned long count);
-extern void adx_insl(unsigned long port, void *addr, unsigned long count);
-extern void adx_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void adx_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void adx_outsl(unsigned long port, const void *addr, unsigned long count);
-
-extern unsigned char adx_readb(unsigned long addr);
-extern unsigned short adx_readw(unsigned long addr);
-extern unsigned int adx_readl(unsigned long addr);
-extern void adx_writeb(unsigned char b, unsigned long addr);
-extern void adx_writew(unsigned short b, unsigned long addr);
-extern void adx_writel(unsigned int b, unsigned long addr);
-
-extern void * adx_ioremap(unsigned long offset, unsigned long size);
-extern void adx_iounmap(void *addr);
-
-extern unsigned long adx_isa_port2addr(unsigned long offset);
-
-extern void setup_adx(void);
-extern void init_adx_IRQ(void);
-
-#ifdef __WANT_IO_DEF
-
-#define __inb		adx_inb
-#define __inw		adx_inw
-#define __inl		adx_inl
-#define __outb		adx_outb
-#define __outw		adx_outw
-#define __outl		adx_outl
-
-#define __inb_p		adx_inb_p
-#define __inw_p		adx_inw
-#define __inl_p		adx_inl
-#define __outb_p	adx_outb_p
-#define __outw_p	adx_outw
-#define __outl_p	adx_outl
-
-#define __insb		adx_insb
-#define __insw		adx_insw
-#define __insl		adx_insl
-#define __outsb		adx_outsb
-#define __outsw		adx_outsw
-#define __outsl		adx_outsl
-
-#define __readb		adx_readb
-#define __readw		adx_readw
-#define __readl		adx_readl
-#define __writeb	adx_writeb
-#define __writew	adx_writew
-#define __writel	adx_writel
-
-#define __isa_port2addr	adx_isa_port2addr
-#define __ioremap	adx_ioremap
-#define __iounmap	adx_iounmap
-
-#endif
-
-#endif /* _ASM_SH_IO_AANDD_H */
diff -Nru a/include/asm-sh/io_bigsur.h b/include/asm-sh/io_bigsur.h
--- a/include/asm-sh/io_bigsur.h	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,89 +0,0 @@
-/*
- * include/asm-sh/io_bigsur.h
- *
- * By Dustin McIntire (dustin@sensoria.com) (c)2001
- * Derived from io_hd64465.h, which bore the message:
- * By Greg Banks <gbanks@pocketpenguins.com>
- * (c) 2000 PocketPenguins Inc. 
- * and from io_hd64461.h, which bore the message:
- * Copyright 2000 Stuart Menefy (stuart.menefy@st.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * IO functions for a Hitachi Big Sur Evaluation Board.
- */
-
-#ifndef _ASM_SH_IO_BIGSUR_H
-#define _ASM_SH_IO_BIGSUR_H
-
-#include <linux/types.h>
-#include <asm/io_generic.h>
-
-extern unsigned char bigsur_inb(unsigned long port);
-extern unsigned short bigsur_inw(unsigned long port);
-extern unsigned int bigsur_inl(unsigned long port);
-
-extern void bigsur_outb(unsigned char value, unsigned long port);
-extern void bigsur_outw(unsigned short value, unsigned long port);
-extern void bigsur_outl(unsigned int value, unsigned long port);
-
-extern unsigned char bigsur_inb_p(unsigned long port);
-extern void bigsur_outb_p(unsigned char value, unsigned long port);
-
-extern void bigsur_insb(unsigned long port, void *addr, unsigned long count);
-extern void bigsur_insw(unsigned long port, void *addr, unsigned long count);
-extern void bigsur_insl(unsigned long port, void *addr, unsigned long count);
-extern void bigsur_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void bigsur_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void bigsur_outsl(unsigned long port, const void *addr, unsigned long count);
-extern unsigned long bigsur_isa_port2addr(unsigned long offset);
-extern int bigsur_irq_demux(int irq);
-extern void bigsur_init_pci(void);
-/* Provision for generic secondary demux step -- used by PCMCIA code */
-extern void bigsur_register_irq_demux(int irq,
-		int (*demux)(int irq, void *dev), void *dev);
-extern void bigsur_unregister_irq_demux(int irq);
-/* Set this variable to 1 to see port traffic */
-extern int bigsur_io_debug;
-/* Map a range of ports to a range of kernel virtual memory. */
-extern void bigsur_port_map(u32 baseport, u32 nports, u32 addr, u8 shift);
-extern void bigsur_port_unmap(u32 baseport, u32 nports);
-
-#endif /* _ASM_SH_IO_BIGSUR_H */
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			bigsur_inb
-# define __inw			bigsur_inw
-# define __inl			bigsur_inl
-# define __outb			bigsur_outb
-# define __outw			bigsur_outw
-# define __outl			bigsur_outl
-
-# define __inb_p		bigsur_inb_p
-# define __inw_p		bigsur_inw
-# define __inl_p		bigsur_inl
-# define __outb_p		bigsur_outb_p
-# define __outw_p		bigsur_outw
-# define __outl_p		bigsur_outl
-
-# define __insb			bigsur_insb
-# define __insw			bigsur_insw
-# define __insl			bigsur_insl
-# define __outsb		bigsur_outsb
-# define __outsw		bigsur_outsw
-# define __outsl		bigsur_outsl
-
-# define __readb		generic_readb
-# define __readw		generic_readw
-# define __readl		generic_readl
-# define __writeb		generic_writeb
-# define __writew		generic_writew
-# define __writel		generic_writel
-
-# define __isa_port2addr	bigsur_isa_port2addr
-# define __ioremap		generic_ioremap
-# define __iounmap		generic_iounmap
-
-#endif
diff -Nru a/include/asm-sh/io_cat68701.h b/include/asm-sh/io_cat68701.h
--- a/include/asm-sh/io_cat68701.h	Tue Feb  3 19:45:17 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,89 +0,0 @@
-/*
- * include/asm-sh/io_cat68701.h
- *
- * Copyright 2000 Stuart Menefy (stuart.menefy@st.com)
- *           2001 Yutarou Ebihar (ebihara@si-linux.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * IO functions for an AONE Corp. CAT-68701 SH7708 Borad
- */
-
-#ifndef _ASM_SH_IO_CAT68701_H
-#define _ASM_SH_IO_CAT68701_H
-
-#include <asm/io_generic.h>
-
-extern unsigned char cat68701_inb(unsigned long port);
-extern unsigned short cat68701_inw(unsigned long port);
-extern unsigned int cat68701_inl(unsigned long port);
-
-extern void cat68701_outb(unsigned char value, unsigned long port);
-extern void cat68701_outw(unsigned short value, unsigned long port);
-extern void cat68701_outl(unsigned int value, unsigned long port);
-
-extern unsigned char cat68701_inb_p(unsigned long port);
-extern void cat68701_outb_p(unsigned char value, unsigned long port);
-
-extern void cat68701_insb(unsigned long port, void *addr, unsigned long count);
-extern void cat68701_insw(unsigned long port, void *addr, unsigned long count);
-extern void cat68701_insl(unsigned long port, void *addr, unsigned long count);
-extern void cat68701_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void cat68701_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void cat68701_outsl(unsigned long port, const void *addr, unsigned long count);
-
-extern unsigned char cat68701_readb(unsigned long addr);
-extern unsigned short cat68701_readw(unsigned long addr);
-extern unsigned int cat68701_readl(unsigned long addr);
-extern void cat68701_writeb(unsigned char b, unsigned long addr);
-extern void cat68701_writew(unsigned short b, unsigned long addr);
-extern void cat68701_writel(unsigned int b, unsigned long addr);
-
-extern void * cat68701_ioremap(unsigned long offset, unsigned long size);
-extern void cat68701_iounmap(void *addr);
-
-extern unsigned long cat68701_isa_port2addr(unsigned long offset);
-extern int cat68701_irq_demux(int irq);
-
-extern void setup_cat68701(void);
-extern void init_cat68701_IRQ(void);
-extern void heartbeat_cat68701(void);
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			cat68701_inb
-# define __inw			cat68701_inw
-# define __inl			cat68701_inl
-# define __outb			cat68701_outb
-# define __outw			cat68701_outw
-# define __outl			cat68701_outl
-
-# define __inb_p		cat68701_inb_p
-# define __inw_p		cat68701_inw
-# define __inl_p		cat68701_inl
-# define __outb_p		cat68701_outb_p
-# define __outw_p		cat68701_outw
-# define __outl_p		cat68701_outl
-
-# define __insb			cat68701_insb
-# define __insw			cat68701_insw
-# define __insl			cat68701_insl
-# define __outsb		cat68701_outsb
-# define __outsw		cat68701_outsw
-# define __outsl		cat68701_outsl
-
-# define __readb		cat68701_readb
-# define __readw		cat68701_readw
-# define __readl		cat68701_readl
-# define __writeb		cat68701_writeb
-# define __writew		cat68701_writew
-# define __writel		cat68701_writel
-
-# define __isa_port2addr	cat68701_isa_port2addr
-# define __ioremap		generic_ioremap
-# define __iounmap		generic_iounmap
-
-#endif
-
-#endif /* _ASM_SH_IO_CAT68701_H */
diff -Nru a/include/asm-sh/io_dc.h b/include/asm-sh/io_dc.h
--- a/include/asm-sh/io_dc.h	Tue Feb  3 19:45:34 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,49 +0,0 @@
-/*
- *	$Id: io_dc.h,v 1.1 2001/04/01 15:02:56 yaegashi Exp $
- *	IO functions for SEGA Dreamcast
- */
-
-#ifndef _ASM_SH_IO_DREAMCAST_H
-#define _ASM_SH_IO_DREAMCAST_H
-
-#include <asm/io_generic.h>
-
-unsigned long dreamcast_isa_port2addr(unsigned long offset);
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			generic_inb
-# define __inw			generic_inw
-# define __inl			generic_inl
-# define __outb			generic_outb
-# define __outw			generic_outw
-# define __outl			generic_outl
-
-# define __inb_p		generic_inb_p
-# define __inw_p		generic_inw
-# define __inl_p		generic_inl
-# define __outb_p		generic_outb_p
-# define __outw_p		generic_outw
-# define __outl_p		generic_outl
-
-# define __insb			generic_insb
-# define __insw			generic_insw
-# define __insl			generic_insl
-# define __outsb		generic_outsb
-# define __outsw		generic_outsw
-# define __outsl		generic_outsl
-
-# define __readb		generic_readb
-# define __readw		generic_readw
-# define __readl		generic_readl
-# define __writeb		generic_writeb
-# define __writew		generic_writew
-# define __writel		generic_writel
-
-# define __isa_port2addr	dreamcast_isa_port2addr
-# define __ioremap		generic_ioremap
-# define __iounmap		generic_iounmap
-
-#endif
-
-#endif /* _ASM_SH_IO_DREAMCAST_H */
diff -Nru a/include/asm-sh/io_ec3104.h b/include/asm-sh/io_ec3104.h
--- a/include/asm-sh/io_ec3104.h	Tue Feb  3 19:45:16 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,54 +0,0 @@
-#ifndef _ASM_SH_IO_EC3104_H
-#define _ASM_SH_IO_EC3104_H
-
-#include <asm/io_generic.h>
-#include <linux/types.h>
-
-extern unsigned char ec3104_inb(unsigned long port);
-extern unsigned short ec3104_inw(unsigned long port);
-extern unsigned long ec3104_inl(unsigned long port);
-
-extern void ec3104_outb(unsigned char value, unsigned long port);
-extern void ec3104_outw(unsigned short value, unsigned long port);
-extern void ec3104_outl(unsigned long value, unsigned long port);
-
-extern int ec3104_irq_demux(int irq);
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			ec3104_inb
-# define __inw			ec3104_inw
-# define __inl			ec3104_inl
-# define __outb			ec3104_outb
-# define __outw			ec3104_outw
-# define __outl			ec3104_outl
-
-# define __inb_p		ec3104_inb
-# define __inw_p		ec3104_inw
-# define __inl_p		ec3104_inl
-# define __outb_p		ec3104_outb
-# define __outw_p		ec3104_outw
-# define __outl_p		ec3104_outl
-
-# define __insb			generic_insb
-# define __insw			generic_insw
-# define __insl			generic_insl
-# define __outsb		generic_outsb
-# define __outsw		generic_outsw
-# define __outsl		generic_outsl
-
-# define __readb		generic_readb
-# define __readw		generic_readw
-# define __readl		generic_readl
-# define __writeb		generic_writeb
-# define __writew		generic_writew
-# define __writel		generic_writel
-
-# define __isa_port2addr	generic_isa_port2addr
-# define __ioremap		generic_ioremap
-# define __ioremap_nocache	generic_ioremap_nocache
-# define __iounmap		generic_iounmap
-
-#endif
-
-#endif /* _ASM_SH_IO_EC3104_H */
diff -Nru a/include/asm-sh/io_generic.h b/include/asm-sh/io_generic.h
--- a/include/asm-sh/io_generic.h	Tue Feb  3 19:45:30 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,51 +0,0 @@
-/*
- * include/asm-sh/io_generic.h
- *
- * Copyright 2000 Stuart Menefy (stuart.menefy@st.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * Generic IO functions
- */
-
-#ifndef _ASM_SH_IO_GENERIC_H
-#define _ASM_SH_IO_GENERIC_H
-
-extern unsigned long generic_io_base;
-
-extern unsigned char generic_inb(unsigned long port);
-extern unsigned short generic_inw(unsigned long port);
-extern unsigned int generic_inl(unsigned long port);
-
-extern void generic_outb(unsigned char value, unsigned long port);
-extern void generic_outw(unsigned short value, unsigned long port);
-extern void generic_outl(unsigned int value, unsigned long port);
-
-extern unsigned char generic_inb_p(unsigned long port);
-extern unsigned short generic_inw_p(unsigned long port);
-extern unsigned int generic_inl_p(unsigned long port);
-extern void generic_outb_p(unsigned char value, unsigned long port);
-extern void generic_outw_p(unsigned short value, unsigned long port);
-extern void generic_outl_p(unsigned int value, unsigned long port);
-
-extern void generic_insb(unsigned long port, void *addr, unsigned long count);
-extern void generic_insw(unsigned long port, void *addr, unsigned long count);
-extern void generic_insl(unsigned long port, void *addr, unsigned long count);
-extern void generic_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void generic_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void generic_outsl(unsigned long port, const void *addr, unsigned long count);
-
-extern unsigned char generic_readb(unsigned long addr);
-extern unsigned short generic_readw(unsigned long addr);
-extern unsigned int generic_readl(unsigned long addr);
-extern void generic_writeb(unsigned char b, unsigned long addr);
-extern void generic_writew(unsigned short b, unsigned long addr);
-extern void generic_writel(unsigned int b, unsigned long addr);
-
-extern void *generic_ioremap(unsigned long offset, unsigned long size);
-extern void generic_iounmap(void *addr);
-
-extern unsigned long generic_isa_port2addr(unsigned long offset);
-
-#endif /* _ASM_SH_IO_GENERIC_H */
diff -Nru a/include/asm-sh/io_hd64461.h b/include/asm-sh/io_hd64461.h
--- a/include/asm-sh/io_hd64461.h	Tue Feb  3 19:45:28 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,73 +0,0 @@
-/*
- * include/asm-sh/io_hd64461.h
- *
- * Copyright 2000 Stuart Menefy (stuart.menefy@st.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * IO functions for an HD64461
- */
-
-#ifndef _ASM_SH_IO_HD64461_H
-#define _ASM_SH_IO_HD64461_H
-
-#include <asm/io_generic.h>
-
-extern unsigned char hd64461_inb(unsigned long port);
-extern unsigned short hd64461_inw(unsigned long port);
-extern unsigned int hd64461_inl(unsigned long port);
-
-extern void hd64461_outb(unsigned char value, unsigned long port);
-extern void hd64461_outw(unsigned short value, unsigned long port);
-extern void hd64461_outl(unsigned int value, unsigned long port);
-
-extern unsigned char hd64461_inb_p(unsigned long port);
-extern void hd64461_outb_p(unsigned char value, unsigned long port);
-
-extern void hd64461_insb(unsigned long port, void *addr, unsigned long count);
-extern void hd64461_insw(unsigned long port, void *addr, unsigned long count);
-extern void hd64461_insl(unsigned long port, void *addr, unsigned long count);
-extern void hd64461_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void hd64461_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void hd64461_outsl(unsigned long port, const void *addr, unsigned long count);
-extern int hd64461_irq_demux(int irq);
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			hd64461_inb
-# define __inw			hd64461_inw
-# define __inl			hd64461_inl
-# define __outb			hd64461_outb
-# define __outw			hd64461_outw
-# define __outl			hd64461_outl
-
-# define __inb_p		hd64461_inb_p
-# define __inw_p		hd64461_inw
-# define __inl_p		hd64461_inl
-# define __outb_p		hd64461_outb_p
-# define __outw_p		hd64461_outw
-# define __outl_p		hd64461_outl
-
-# define __insb			hd64461_insb
-# define __insw			hd64461_insw
-# define __insl			hd64461_insl
-# define __outsb		hd64461_outsb
-# define __outsw		hd64461_outsw
-# define __outsl		hd64461_outsl
-
-# define __readb		generic_readb
-# define __readw		generic_readw
-# define __readl		generic_readl
-# define __writeb		generic_writeb
-# define __writew		generic_writew
-# define __writel		generic_writel
-
-# define __isa_port2addr	generic_isa_port2addr
-# define __ioremap		generic_ioremap
-# define __ioremap_nocache	generic_ioremap_nocache
-# define __iounmap		generic_iounmap
-
-#endif
-
-#endif /* _ASM_SH_IO_HD64461_H */
diff -Nru a/include/asm-sh/io_hd64465.h b/include/asm-sh/io_hd64465.h
--- a/include/asm-sh/io_hd64465.h	Tue Feb  3 19:45:29 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,90 +0,0 @@
-/*
- * include/asm-sh/io_hd64465.h
- *
- * By Greg Banks <gbanks@pocketpenguins.com>
- * (c) 2000 PocketPenguins Inc.
- *
- * Derived from io_hd64461.h, which bore the message:
- * Copyright 2000 Stuart Menefy (stuart.menefy@st.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * IO functions for an HD64465 "Windows CE Intelligent Peripheral Controller".
- */
-
-#ifndef _ASM_SH_IO_HD64465_H
-#define _ASM_SH_IO_HD64465_H
-
-#include <asm/io_generic.h>
-
-extern unsigned char hd64465_inb(unsigned long port);
-extern unsigned short hd64465_inw(unsigned long port);
-extern unsigned int hd64465_inl(unsigned long port);
-
-extern void hd64465_outb(unsigned char value, unsigned long port);
-extern void hd64465_outw(unsigned short value, unsigned long port);
-extern void hd64465_outl(unsigned int value, unsigned long port);
-
-extern unsigned char hd64465_inb_p(unsigned long port);
-extern void hd64465_outb_p(unsigned char value, unsigned long port);
-
-extern void hd64465_insb(unsigned long port, void *addr, unsigned long count);
-extern void hd64465_insw(unsigned long port, void *addr, unsigned long count);
-extern void hd64465_insl(unsigned long port, void *addr, unsigned long count);
-extern void hd64465_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void hd64465_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void hd64465_outsl(unsigned long port, const void *addr, unsigned long count);
-extern unsigned long hd64465_isa_port2addr(unsigned long offset);
-extern int hd64465_irq_demux(int irq);
-/* Provision for generic secondary demux step -- used by PCMCIA code */
-extern void hd64465_register_irq_demux(int irq,
-		int (*demux)(int irq, void *dev), void *dev);
-extern void hd64465_unregister_irq_demux(int irq);
-/* Set this variable to 1 to see port traffic */
-extern int hd64465_io_debug;
-/* Map a range of ports to a range of kernel virtual memory.
- */
-extern void hd64465_port_map(unsigned short baseport, unsigned int nports,
-			     unsigned long addr, unsigned char shift);
-extern void hd64465_port_unmap(unsigned short baseport, unsigned int nports);
-
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			hd64465_inb
-# define __inw			hd64465_inw
-# define __inl			hd64465_inl
-# define __outb			hd64465_outb
-# define __outw			hd64465_outw
-# define __outl			hd64465_outl
-
-# define __inb_p		hd64465_inb_p
-# define __inw_p		hd64465_inw
-# define __inl_p		hd64465_inl
-# define __outb_p		hd64465_outb_p
-# define __outw_p		hd64465_outw
-# define __outl_p		hd64465_outl
-
-# define __insb			hd64465_insb
-# define __insw			hd64465_insw
-# define __insl			hd64465_insl
-# define __outsb		hd64465_outsb
-# define __outsw		hd64465_outsw
-# define __outsl		hd64465_outsl
-
-# define __readb		generic_readb
-# define __readw		generic_readw
-# define __readl		generic_readl
-# define __writeb		generic_writeb
-# define __writew		generic_writew
-# define __writel		generic_writel
-
-# define __isa_port2addr	hd64465_isa_port2addr
-# define __ioremap		generic_ioremap
-# define __iounmap		generic_iounmap
-
-
-#endif
-
-#endif /* _ASM_SH_IO_HD64465_H */
diff -Nru a/include/asm-sh/io_se.h b/include/asm-sh/io_se.h
--- a/include/asm-sh/io_se.h	Tue Feb  3 19:45:16 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,80 +0,0 @@
-/*
- * include/asm-sh/io_se.h
- *
- * Copyright 2000 Stuart Menefy (stuart.menefy@st.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * IO functions for an Hitachi SolutionEngine
- */
-
-#ifndef _ASM_SH_IO_SE_H
-#define _ASM_SH_IO_SE_H
-
-#include <asm/io_generic.h>
-
-extern unsigned char se_inb(unsigned long port);
-extern unsigned short se_inw(unsigned long port);
-extern unsigned int se_inl(unsigned long port);
-
-extern void se_outb(unsigned char value, unsigned long port);
-extern void se_outw(unsigned short value, unsigned long port);
-extern void se_outl(unsigned int value, unsigned long port);
-
-extern unsigned char se_inb_p(unsigned long port);
-extern void se_outb_p(unsigned char value, unsigned long port);
-
-extern void se_insb(unsigned long port, void *addr, unsigned long count);
-extern void se_insw(unsigned long port, void *addr, unsigned long count);
-extern void se_insl(unsigned long port, void *addr, unsigned long count);
-extern void se_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void se_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void se_outsl(unsigned long port, const void *addr, unsigned long count);
-
-extern unsigned char se_readb(unsigned long addr);
-extern unsigned short se_readw(unsigned long addr);
-extern unsigned int se_readl(unsigned long addr);
-extern void se_writeb(unsigned char b, unsigned long addr);
-extern void se_writew(unsigned short b, unsigned long addr);
-extern void se_writel(unsigned int b, unsigned long addr);
-
-extern unsigned long se_isa_port2addr(unsigned long offset);
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			se_inb
-# define __inw			se_inw
-# define __inl			se_inl
-# define __outb			se_outb
-# define __outw			se_outw
-# define __outl			se_outl
-
-# define __inb_p		se_inb_p
-# define __inw_p		se_inw
-# define __inl_p		se_inl
-# define __outb_p		se_outb_p
-# define __outw_p		se_outw
-# define __outl_p		se_outl
-
-# define __insb			se_insb
-# define __insw			se_insw
-# define __insl			se_insl
-# define __outsb		se_outsb
-# define __outsw		se_outsw
-# define __outsl		se_outsl
-
-# define __readb		se_readb
-# define __readw		se_readw
-# define __readl		se_readl
-# define __writeb		se_writeb
-# define __writew		se_writew
-# define __writel		se_writel
-
-# define __isa_port2addr	se_isa_port2addr
-# define __ioremap		generic_ioremap
-# define __iounmap		generic_iounmap
-
-#endif
-
-#endif /* _ASM_SH_IO_SE_H */
diff -Nru a/include/asm-sh/io_sh2000.h b/include/asm-sh/io_sh2000.h
--- a/include/asm-sh/io_sh2000.h	Tue Feb  3 19:45:41 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,56 +0,0 @@
-/*
- * include/asm-sh/io_sh2000.h
- *
- * Copyright 2000 Stuart Menefy (stuart.menefy@st.com)
- *           2001 SUGIOKA Toshinobu (sugioka@itonet.co.jp)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * IO functions for use when we don't know what machine we are on
- */
-
-#ifndef _ASM_SH_IO_SH2000_H
-#define _ASM_SH_IO_SH2000_H
-
-#include <asm/io_generic.h>
-
-unsigned long sh2000_isa_port2addr(unsigned long offset);
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			generic_inb
-# define __inw			generic_inw
-# define __inl			generic_inl
-# define __outb			generic_outb
-# define __outw			generic_outw
-# define __outl			generic_outl
-
-# define __inb_p		generic_inb_p
-# define __inw_p		generic_inw
-# define __inl_p		generic_inl
-# define __outb_p		generic_outb_p
-# define __outw_p		generic_outw
-# define __outl_p		generic_outl
-
-# define __insb			generic_insb
-# define __insw			generic_insw
-# define __insl			generic_insl
-# define __outsb		generic_outsb
-# define __outsw		generic_outsw
-# define __outsl		generic_outsl
-
-# define __readb		generic_readb
-# define __readw		generic_readw
-# define __readl		generic_readl
-# define __writeb		generic_writeb
-# define __writew		generic_writew
-# define __writel		generic_writel
-
-# define __isa_port2addr	sh2000_isa_port2addr
-# define __ioremap		generic_ioremap
-# define __iounmap		generic_iounmap
-
-#endif
-
-#endif /* _ASM_SH_IO_SH2000_H */
diff -Nru a/include/asm-sh/io_unknown.h b/include/asm-sh/io_unknown.h
--- a/include/asm-sh/io_unknown.h	Tue Feb  3 19:45:42 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,84 +0,0 @@
-/*
- * include/asm-sh/io_unknown.h
- *
- * Copyright 2000 Stuart Menefy (stuart.menefy@st.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * IO functions for use when we don't know what machine we are on
- */
-
-#ifndef _ASM_SH_IO_UNKNOWN_H
-#define _ASM_SH_IO_UNKNOWN_H
-
-extern unsigned char unknown_inb(unsigned long port);
-extern unsigned short unknown_inw(unsigned long port);
-extern unsigned int unknown_inl(unsigned long port);
-
-extern void unknown_outb(unsigned char value, unsigned long port);
-extern void unknown_outw(unsigned short value, unsigned long port);
-extern void unknown_outl(unsigned int value, unsigned long port);
-
-extern unsigned char unknown_inb_p(unsigned long port);
-extern unsigned short unknown_inw_p(unsigned long port);
-extern unsigned int unknown_inl_p(unsigned long port);
-extern void unknown_outb_p(unsigned char value, unsigned long port);
-extern void unknown_outw_p(unsigned short value, unsigned long port);
-extern void unknown_outl_p(unsigned int value, unsigned long port);
-
-extern void unknown_insb(unsigned long port, void *addr, unsigned long count);
-extern void unknown_insw(unsigned long port, void *addr, unsigned long count);
-extern void unknown_insl(unsigned long port, void *addr, unsigned long count);
-extern void unknown_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void unknown_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void unknown_outsl(unsigned long port, const void *addr, unsigned long count);
-
-extern unsigned char unknown_readb(unsigned long addr);
-extern unsigned short unknown_readw(unsigned long addr);
-extern unsigned int unknown_readl(unsigned long addr);
-extern void unknown_writeb(unsigned char b, unsigned long addr);
-extern void unknown_writew(unsigned short b, unsigned long addr);
-extern void unknown_writel(unsigned int b, unsigned long addr);
-
-extern unsigned long unknown_isa_port2addr(unsigned long offset);
-extern void *unknown_ioremap(unsigned long offset, unsigned long size);
-extern void unknown_iounmap(void *addr);
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			unknown_inb
-# define __inw			unknown_inw
-# define __inl			unknown_inl
-# define __outb			unknown_outb
-# define __outw			unknown_outw
-# define __outl			unknown_outl
-
-# define __inb_p		unknown_inb_p
-# define __inw_p		unknown_inw_p
-# define __inl_p		unknown_inl_p
-# define __outb_p		unknown_outb_p
-# define __outw_p		unknown_outw_p
-# define __outl_p		unknown_outl_p
-
-# define __insb			unknown_insb
-# define __insw			unknown_insw
-# define __insl			unknown_insl
-# define __outsb		unknown_outsb
-# define __outsw		unknown_outsw
-# define __outsl		unknown_outsl
-
-# define __readb		unknown_readb
-# define __readw		unknown_readw
-# define __readl		unknown_readl
-# define __writeb		unknown_writeb
-# define __writew		unknown_writew
-# define __writel		unknown_writel
-
-# define __isa_port2addr	unknown_isa_port2addr
-# define __ioremap		unknown_ioremap
-# define __iounmap		unknown_iounmap
-
-#endif
-
-#endif /* _ASM_SH_IO_UNKNOWN_H */
diff -Nru a/include/asm-sh/ipc.h b/include/asm-sh/ipc.h
--- a/include/asm-sh/ipc.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-sh/ipc.h	Tue Feb  3 19:45:42 2004
@@ -7,7 +7,7 @@
  * See arch/i386/kernel/sys_i386.c for ugly details..
  */
 struct ipc_kludge {
-	struct msgbuf *msgp;
+	struct msgbuf __user *msgp;
 	long msgtyp;
 };
 
diff -Nru a/include/asm-sh/irq.h b/include/asm-sh/irq.h
--- a/include/asm-sh/irq.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-sh/irq.h	Tue Feb  3 19:45:16 2004
@@ -7,6 +7,7 @@
  *
  * Copyright (C) 1999  Niibe Yutaka & Takeshi Yaegashi
  * Copyright (C) 2000  Kazumoto Kojima
+ * Copyright (C) 2003  Paul Mundt
  *
  */
 
@@ -21,6 +22,7 @@
 #define INTC_IPRA	0xffd00004UL
 #define INTC_IPRB	0xffd00008UL
 #define INTC_IPRC	0xffd0000cUL
+#define INTC_IPRD	0xffd00010UL
 #endif
 
 #define TIMER_IRQ	16
@@ -46,6 +48,10 @@
 #define DMTE1_IRQ	35
 #define DMTE2_IRQ	36
 #define DMTE3_IRQ	37
+#define DMTE4_IRQ	44	/* 7751R only */
+#define DMTE5_IRQ	45	/* 7751R only */
+#define DMTE6_IRQ	46	/* 7751R only */
+#define DMTE7_IRQ	47	/* 7751R only */
 #define DMAE_IRQ	38
 #define DMA_IPR_ADDR	INTC_IPRC
 #define DMA_IPR_POS	2
@@ -123,6 +129,8 @@
 #  define ONCHIP_NR_IRQS 48	// Actually 44
 # elif defined(CONFIG_CPU_SUBTYPE_SH7751)
 #  define ONCHIP_NR_IRQS 72
+# elif defined(CONFIG_CPU_SUBTYPE_SH7760)
+#  define ONCHIP_NR_IRQS 110
 # elif defined(CONFIG_CPU_SUBTYPE_ST40STB1)
 #  define ONCHIP_NR_IRQS 144
 # endif
@@ -194,7 +202,22 @@
 			 int pos,  int priority);
 extern void make_imask_irq(unsigned int irq);
 
-#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709)
+#if defined(CONFIG_CPU_SUBTYPE_SH7604)
+#define INTC_IPRA	0xfffffee2UL
+#define INTC_IPRB	0xfffffe60UL
+
+#define INTC_VCRA	0xfffffe62UL
+#define INTC_VCRB	0xfffffe64UL
+#define INTC_VCRC	0xfffffe66UL
+#define INTC_VCRD	0xfffffe68UL
+
+#define INTC_VCRWDT	0xfffffee4UL
+#define INTC_VCRDIV	0xffffff0cUL
+#define INTC_VCRDMA0	0xffffffa0UL
+#define INTC_VCRDMA1	0xffffffa8UL
+
+#define INTC_ICR	0xfffffee0UL
+#elif defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709)
 #define INTC_IRR0	0xa4000004UL
 #define INTC_IRR1	0xa4000006UL
 #define INTC_IRR2	0xa4000008UL
@@ -293,61 +316,12 @@
  
 #endif                                                                        
        
-#ifdef CONFIG_SH_GENERIC
-
-static __inline__ int irq_demux(int irq)
-{
-	if (sh_mv.mv_irq_demux) {
-		irq = sh_mv.mv_irq_demux(irq);
-	}
-	return __irq_demux(irq);
-}
-
-#elif defined(CONFIG_SH_BIGSUR)
-
-extern int bigsur_irq_demux(int irq);
-#define irq_demux(irq) bigsur_irq_demux(irq)
-
-#elif defined(CONFIG_HD64461)
-
-extern int hd64461_irq_demux(int irq);
-#define irq_demux(irq) hd64461_irq_demux(irq)
-
-#elif defined(CONFIG_HD64465)
-
-extern int hd64465_irq_demux(int irq);
-#define irq_demux(irq) hd64465_irq_demux(irq)
-
-#elif defined(CONFIG_SH_EC3104)
-
-extern int ec3104_irq_demux(int irq);
-#define irq_demux ec3104_irq_demux
-
-#elif defined(CONFIG_SH_CAT68701)
-
-extern int cat68701_irq_demux(int irq);
-#define irq_demux cat68701_irq_demux
-
-#elif defined(CONFIG_SH_DREAMCAST)
-
-extern int systemasic_irq_demux(int irq);
-#define irq_demux systemasic_irq_demux
-
-#elif defined(CONFIG_SH_MPC1211)
-
-extern int mpc1211_irq_demux(int irq);
-#define irq_demux mpc1211_irq_demux
-
-#else
-
-#define irq_demux(irq) __irq_demux(irq)
-
-#endif
-
-static __inline__ int irq_canonicalize(int irq)
+static inline int generic_irq_demux(int irq)
 {
 	return irq;
 }
 
+#define irq_canonicalize(irq)	(irq)
+#define irq_demux(irq)		__irq_demux(sh_mv.mv_irq_demux(irq))
 
 #endif /* __ASM_SH_IRQ_H */
diff -Nru a/include/asm-sh/keyboard-ec3104.h b/include/asm-sh/keyboard-ec3104.h
--- a/include/asm-sh/keyboard-ec3104.h	Tue Feb  3 19:45:16 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,17 +0,0 @@
-extern unsigned char ec3104_kbd_sysrq_xlate[];
-extern int ec3104_kbd_setkeycode(unsigned int scancode, unsigned int keycode);
-extern int ec3104_kbd_getkeycode(unsigned int scancode);
-extern int ec3104_kbd_translate(unsigned char, unsigned char *, char);
-extern char ec3104_kbd_unexpected_up(unsigned char);
-extern void ec3104_kbd_leds(unsigned char);
-extern void ec3104_kbd_init_hw(void);
-
-#define SYSRQ_KEY 0x54
-
-#define kbd_sysrq_xlate ec3104_kbd_sysrq_xlate
-#define kbd_setkeycode ec3104_kbd_setkeycode
-#define kbd_getkeycode ec3104_kbd_getkeycode
-#define kbd_translate ec3104_kbd_translate
-#define kbd_unexpected_up ec3104_kbd_unexpected_up
-#define kbd_leds ec3104_kbd_leds
-#define kbd_init_hw ec3104_kbd_init_hw
diff -Nru a/include/asm-sh/kgdb.h b/include/asm-sh/kgdb.h
--- a/include/asm-sh/kgdb.h	Tue Feb  3 19:45:33 2004
+++ b/include/asm-sh/kgdb.h	Tue Feb  3 19:45:33 2004
@@ -18,6 +18,8 @@
 
 #include <asm/ptrace.h>
 
+struct console;
+
 /* Same as pt_regs but has vbr in place of syscall_nr */
 struct kgdb_regs {
         unsigned long regs[16];
@@ -88,6 +90,18 @@
     asm volatile("trapa   #0xff");                            \
   }                                                           \
 } while (0)
+
+/* KGDB should be able to flush all kernel text space */
+#if defined(CONFIG_CPU_SH4)
+#define kgdb_flush_icache_range(start, end) \
+{									\
+	extern void __flush_purge_region(void *, int);			\
+	__flush_purge_region((void*)(start), (int)(end) - (int)(start));\
+	flush_icache_range((start), (end));				\
+}
+#else
+#define kgdb_flush_icache_range(start, end)	do { } while (0)
+#endif
 
 /* Kernel assert macros */
 #ifdef CONFIG_KGDB_KERNEL_ASSERTS
diff -Nru a/include/asm-sh/local.h b/include/asm-sh/local.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sh/local.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,7 @@
+#ifndef __ASM_SH_LOCAL_H
+#define __ASM_SH_LOCAL_H
+
+#include <asm-generic/local.h>
+
+#endif /* __ASM_SH_LOCAL_H */
+
diff -Nru a/include/asm-sh/machvec.h b/include/asm-sh/machvec.h
--- a/include/asm-sh/machvec.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-sh/machvec.h	Tue Feb  3 19:45:16 2004
@@ -15,13 +15,12 @@
 #include <linux/time.h>
 
 #include <asm/machtypes.h>
+#include <asm/machvec_init.h>
 
 struct timeval;
 
 struct sh_machine_vector
 {
-	const char *mv_name;
-
 	int mv_nr_irqs;
 
 	unsigned char (*mv_inb)(unsigned long);
@@ -59,15 +58,10 @@
 
 	int (*mv_irq_demux)(int irq);
 
-	void (*mv_init_arch)(void);
 	void (*mv_init_irq)(void);
 	void (*mv_init_pci)(void);
-	void (*mv_kill_arch)(int);
 
 	void (*mv_heartbeat)(void);
-
-	void (*mv_rtc_gettimeofday)(struct timespec *ts);
-	int (*mv_rtc_settimeofday)(const time_t secs);
 };
 
 extern struct sh_machine_vector sh_mv;
diff -Nru a/include/asm-sh/mc146818rtc.h b/include/asm-sh/mc146818rtc.h
--- a/include/asm-sh/mc146818rtc.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-sh/mc146818rtc.h	Tue Feb  3 19:45:42 2004
@@ -23,6 +23,15 @@
 #define CMOS_READ(addr)		__CMOS_READ(addr,b)
 #define CMOS_WRITE(val,addr)	__CMOS_WRITE(val,addr,b)
 
+#elif defined(CONFIG_SH_SECUREEDGE5410)
+#include <asm/snapgear/io.h>
+
+#define RTC_PORT(n)             SECUREEDGE_IOPORT_ADDR
+#define CMOS_READ(addr)         secureedge5410_cmos_read(addr)
+#define CMOS_WRITE(val,addr)    secureedge5410_cmos_write(val,addr)
+extern unsigned char secureedge5410_cmos_read(int addr);
+extern void secureedge5410_cmos_write(unsigned char val, int addr);
+
 #elif defined(CONFIG_CPU_SH4)
 #define RTC_PORT(n)		(R64CNT+(n)*4)
 #define CMOS_READ(addr)		__CMOS_READ(addr,w)
diff -Nru a/include/asm-sh/module.h b/include/asm-sh/module.h
--- a/include/asm-sh/module.h	Tue Feb  3 19:45:28 2004
+++ b/include/asm-sh/module.h	Tue Feb  3 19:45:28 2004
@@ -14,7 +14,9 @@
 #define Elf_Ehdr		Elf32_Ehdr
 
 #ifdef CONFIG_CPU_LITTLE_ENDIAN
-# ifdef CONFIG_CPU_SH3
+# ifdef CONFIG_CPU_SH2
+#  define MODULE_PROC_FAMILY "SH2LE "
+# elif defined  CONFIG_CPU_SH3
 #  define MODULE_PROC_FAMILY "SH3LE "
 # elif defined  CONFIG_CPU_SH4
 #  define MODULE_PROC_FAMILY "SH4LE "
@@ -22,7 +24,9 @@
 #  error unknown processor family
 # endif
 #else
-# ifdef CONFIG_CPU_SH3
+# ifdef CONFIG_CPU_SH2
+#  define MODULE_PROC_FAMILY "SH2BE "
+# elif defined  CONFIG_CPU_SH3
 #  define MODULE_PROC_FAMILY "SH3BE "
 # elif defined  CONFIG_CPU_SH4
 #  define MODULE_PROC_FAMILY "SH4BE "
diff -Nru a/include/asm-sh/mpc1211/io.h b/include/asm-sh/mpc1211/io.h
--- a/include/asm-sh/mpc1211/io.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-sh/mpc1211/io.h	Tue Feb  3 19:45:17 2004
@@ -10,77 +10,13 @@
 #define _ASM_SH_IO_MPC1211_H
 
 #include <linux/time.h>
-#include <asm/io_generic.h>
 
-extern unsigned char mpc1211_inb(unsigned long port);
-extern unsigned short mpc1211_inw(unsigned long port);
-extern unsigned int mpc1211_inl(unsigned long port);
-
-extern void mpc1211_outb(unsigned char value, unsigned long port);
-extern void mpc1211_outw(unsigned short value, unsigned long port);
-extern void mpc1211_outl(unsigned int value, unsigned long port);
-
-extern unsigned char mpc1211_inb_p(unsigned long port);
-extern void mpc1211_outb_p(unsigned char value, unsigned long port);
-
-extern void mpc1211_insb(unsigned long port, void *addr, unsigned long count);
-extern void mpc1211_insw(unsigned long port, void *addr, unsigned long count);
-extern void mpc1211_insl(unsigned long port, void *addr, unsigned long count);
-extern void mpc1211_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void mpc1211_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void mpc1211_outsl(unsigned long port, const void *addr, unsigned long count);
-
-extern unsigned char mpc1211_readb(unsigned long addr);
-extern unsigned short mpc1211_readw(unsigned long addr);
-extern unsigned int mpc1211_readl(unsigned long addr);
-extern void mpc1211_writeb(unsigned char b, unsigned long addr);
-extern void mpc1211_writew(unsigned short b, unsigned long addr);
-extern void mpc1211_writel(unsigned int b, unsigned long addr);
-
-extern unsigned long mpc1211_isa_port2addr(unsigned long offset);
 extern int mpc1211_irq_demux(int irq);
 
-extern void setup_mpc1211(void);
 extern void init_mpc1211_IRQ(void);
 extern void heartbeat_mpc1211(void);
 
 extern void mpc1211_rtc_gettimeofday(struct timeval *tv);
 extern int mpc1211_rtc_settimeofday(const struct timeval *tv);
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			mpc1211_inb
-# define __inw			mpc1211_inw
-# define __inl			mpc1211_inl
-# define __outb			mpc1211_outb
-# define __outw			mpc1211_outw
-# define __outl			mpc1211_outl
-
-# define __inb_p		mpc1211_inb_p
-# define __inw_p		mpc1211_inw
-# define __inl_p		mpc1211_inl
-# define __outb_p		mpc1211_outb_p
-# define __outw_p		mpc1211_outw
-# define __outl_p		mpc1211_outl
-
-# define __insb			mpc1211_insb
-# define __insw			mpc1211_insw
-# define __insl			mpc1211_insl
-# define __outsb		mpc1211_outsb
-# define __outsw		mpc1211_outsw
-# define __outsl		mpc1211_outsl
-
-# define __readb		mpc1211_readb
-# define __readw		mpc1211_readw
-# define __readl		mpc1211_readl
-# define __writeb		mpc1211_writeb
-# define __writew		mpc1211_writew
-# define __writel		mpc1211_writel
-
-# define __isa_port2addr	mpc1211_isa_port2addr
-# define __ioremap		generic_ioremap
-# define __iounmap		generic_iounmap
-
-#endif
 
 #endif /* _ASM_SH_IO_MPC1211_H */
diff -Nru a/include/asm-sh/overdrive/io.h b/include/asm-sh/overdrive/io.h
--- a/include/asm-sh/overdrive/io.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-sh/overdrive/io.h	Tue Feb  3 19:45:17 2004
@@ -12,8 +12,6 @@
 #ifndef _ASM_SH_IO_OD_H
 #define _ASM_SH_IO_OD_H
 
-#include <asm/io_generic.h>
-
 extern unsigned char od_inb(unsigned long port);
 extern unsigned short od_inw(unsigned long port);
 extern unsigned int od_inl(unsigned long port);
@@ -37,41 +35,5 @@
 extern void od_outsl(unsigned long port, const void *addr, unsigned long count);
 
 extern unsigned long od_isa_port2addr(unsigned long offset);
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			od_inb
-# define __inw			od_inw
-# define __inl			od_inl
-# define __outb			od_outb
-# define __outw			od_outw
-# define __outl			od_outl
-
-# define __inb_p		od_inb_p
-# define __inw_p		od_inw_p
-# define __inl_p		od_inl_p
-# define __outb_p		od_outb_p
-# define __outw_p		od_outw_p
-# define __outl_p		od_outl_p
-
-# define __insb			od_insb
-# define __insw			od_insw
-# define __insl			od_insl
-# define __outsb		od_outsb
-# define __outsw		od_outsw
-# define __outsl		od_outsl
-
-# define __readb		generic_readb
-# define __readw		generic_readw
-# define __readl		generic_readl
-# define __writeb		generic_writeb
-# define __writew		generic_writew
-# define __writel		generic_writel
-
-# define __isa_port2addr	od_isa_port2addr
-# define __ioremap		generic_ioremap
-# define __iounmap		generic_iounmap
-
-#endif
 
 #endif /* _ASM_SH_IO_OD_H */
diff -Nru a/include/asm-sh/page.h b/include/asm-sh/page.h
--- a/include/asm-sh/page.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-sh/page.h	Tue Feb  3 19:45:42 2004
@@ -24,10 +24,13 @@
 #ifdef __KERNEL__
 #ifndef __ASSEMBLY__
 
-extern void clear_page(void *to);
-extern void copy_page(void *to, void *from);
+extern void (*clear_page)(void *to);
+extern void (*copy_page)(void *to, void *from);
 
-#if defined(CONFIG_CPU_SH3)
+extern void clear_page_slow(void *to);
+extern void copy_page_slow(void *to, void *from);
+
+#if defined(CONFIG_CPU_SH2) || defined(CONFIG_CPU_SH3) || !defined(CONFIG_MMU)
 #define clear_user_page(page, vaddr, pg)	clear_page(page)
 #define copy_user_page(to, from, vaddr, pg)	copy_page(to, from)
 #elif defined(CONFIG_CPU_SH4)
@@ -64,7 +67,7 @@
 /*
  * IF YOU CHANGE THIS, PLEASE ALSO CHANGE
  *
- *	arch/sh/vmlinux.lds.S
+ *	arch/sh/kernel/vmlinux.lds.S
  *
  * which has the same constant encoded..
  */
diff -Nru a/include/asm-sh/pci-sh7751.h b/include/asm-sh/pci-sh7751.h
--- a/include/asm-sh/pci-sh7751.h	Tue Feb  3 19:45:43 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,281 +0,0 @@
-/*
- *	Low-Level PCI Support for SH7751 targets
- *
- *  Dustin McIntire (dustin@sensoria.com) (c) 2001
- *	
- *  May be copied or modified under the terms of the GNU General Public
- *  License.  See linux/COPYING for more information.
- *
- */
-
-#ifndef _PCI_SH7751_H_
-#define _PCI_SH7751_H_
-
-#include <linux/pci.h>
-
-/* set debug level 4=verbose...1=terse */
-//#define DEBUG_PCI 3
-#undef DEBUG_PCI
-
-#ifdef DEBUG_PCI
-#define PCIDBG(n, x...) { if(DEBUG_PCI>=n) printk(x); }
-#else
-#define PCIDBG(n, x...)
-#endif
-
-/* startup values */
-#define PCI_PROBE_BIOS 1
-#define PCI_PROBE_CONF1 2
-#define PCI_PROBE_CONF2 4
-#define PCI_NO_SORT 0x100
-#define PCI_BIOS_SORT 0x200
-#define PCI_NO_CHECKS 0x400
-#define PCI_ASSIGN_ROMS 0x1000
-#define PCI_BIOS_IRQ_SCAN 0x2000
-
-/* Platform Specific Values */
-#define SH7751_VENDOR_ID             0x1054
-#define SH7751_DEVICE_ID             0x3505
-
-/* SH7751 Specific Values */
-#define SH7751_PCI_CONFIG_BASE	     0xFD000000  /* Config space base addr */
-#define SH7751_PCI_CONFIG_SIZE       0x1000000   /* Config space size */
-#define SH7751_PCI_MEMORY_BASE	     0xFD000000  /* Memory space base addr */
-#define SH7751_PCI_MEM_SIZE          0x01000000  /* Size of Memory window */
-#define SH7751_PCI_IO_BASE           0xFE240000  /* IO space base address */
-#define SH7751_PCI_IO_SIZE           0x40000     /* Size of IO window */
-
-#define SH7751_PCIREG_BASE           0xFE200000  /* PCI regs base address */
-#define PCI_REG(n)                  (SH7751_PCIREG_BASE+ n)
-
-#define SH7751_PCICONF0            0x0           /* PCI Config Reg 0 */
-  #define SH7751_PCICONF0_DEVID      0xFFFF0000  /* Device ID */
-  #define SH7751_PCICONF0_VNDID      0x0000FFFF  /* Vendor ID */
-#define SH7751_PCICONF1            0x4           /* PCI Config Reg 1 */
-  #define SH7751_PCICONF1_DPE        0x80000000  /* Data Parity Error */
-  #define SH7751_PCICONF1_SSE        0x40000000  /* System Error Status */
-  #define SH7751_PCICONF1_RMA        0x20000000  /* Master Abort */
-  #define SH7751_PCICONF1_RTA        0x10000000  /* Target Abort Rx Status */
-  #define SH7751_PCICONF1_STA        0x08000000  /* Target Abort Exec Status */
-  #define SH7751_PCICONF1_DEV        0x06000000  /* Timing Status */
-  #define SH7751_PCICONF1_DPD        0x01000000  /* Data Parity Status */
-  #define SH7751_PCICONF1_FBBC       0x00800000  /* Back 2 Back Status */
-  #define SH7751_PCICONF1_UDF        0x00400000  /* User Defined Status */
-  #define SH7751_PCICONF1_66M        0x00200000  /* 66Mhz Operation Status */
-  #define SH7751_PCICONF1_PM         0x00100000  /* Power Management Status */
-  #define SH7751_PCICONF1_PBBE       0x00000200  /* Back 2 Back Control */
-  #define SH7751_PCICONF1_SER        0x00000100  /* SERR Output Control */
-  #define SH7751_PCICONF1_WCC        0x00000080  /* Wait Cycle Control */
-  #define SH7751_PCICONF1_PER        0x00000040  /* Parity Error Response */
-  #define SH7751_PCICONF1_VPS        0x00000020  /* VGA Pallet Snoop */
-  #define SH7751_PCICONF1_MWIE       0x00000010  /* Memory Write+Invalidate */
-  #define SH7751_PCICONF1_SPC        0x00000008  /* Special Cycle Control */
-  #define SH7751_PCICONF1_BUM        0x00000004  /* Bus Master Control */
-  #define SH7751_PCICONF1_MES        0x00000002  /* Memory Space Control */
-  #define SH7751_PCICONF1_IOS        0x00000001  /* I/O Space Control */
-#define SH7751_PCICONF2            0x8           /* PCI Config Reg 2 */
-  #define SH7751_PCICONF2_BCC        0xFF000000  /* Base Class Code */
-  #define SH7751_PCICONF2_SCC        0x00FF0000  /* Sub-Class Code */
-  #define SH7751_PCICONF2_RLPI       0x0000FF00  /* Programming Interface */
-  #define SH7751_PCICONF2_REV        0x000000FF  /* Revision ID */
-#define SH7751_PCICONF3            0xC           /* PCI Config Reg 3 */ 
-  #define SH7751_PCICONF3_BIST7      0x80000000  /* Bist Supported */
-  #define SH7751_PCICONF3_BIST6      0x40000000  /* Bist Executing */
-  #define SH7751_PCICONF3_BIST3_0    0x0F000000  /* Bist Passed */
-  #define SH7751_PCICONF3_HD7        0x00800000  /* Single Funtion device */
-  #define SH7751_PCICONF3_HD6_0      0x007F0000  /* Configuration Layout */
-  #define SH7751_PCICONF3_LAT        0x0000FF00  /* Latency Timer */
-  #define SH7751_PCICONF3_CLS        0x000000FF  /* Cache Line Size */
-#define SH7751_PCICONF4            0x10          /* PCI Config Reg 4 */
-  #define SH7751_PCICONF4_BASE       0xFFFFFFFC  /* I/O Space Base Addr */
-  #define SH7751_PCICONF4_ASI        0x00000001  /* Address Space Type */
-#define SH7751_PCICONF5            0x14          /* PCI Config Reg 5 */
-  #define SH7751_PCICONF5_BASE       0xFFFFFFF0  /* Mem Space Base Addr */
-  #define SH7751_PCICONF5_LAP        0x00000008  /* Prefetch Enabled */
-  #define SH7751_PCICONF5_LAT        0x00000006  /* Local Memory type */
-  #define SH7751_PCICONF5_ASI        0x00000001  /* Address Space Type */  
-#define SH7751_PCICONF6            0x18          /* PCI Config Reg 6 */
-  #define SH7751_PCICONF6_BASE       0xFFFFFFF0  /* Mem Space Base Addr */
-  #define SH7751_PCICONF6_LAP        0x00000008  /* Prefetch Enabled */
-  #define SH7751_PCICONF6_LAT        0x00000006  /* Local Memory type */
-  #define SH7751_PCICONF6_ASI        0x00000001  /* Address Space Type */  
-/* PCICONF7 - PCICONF10 are undefined */
-#define SH7751_PCICONF11           0x2C          /* PCI Config Reg 11 */
-  #define SH7751_PCICONF11_SSID      0xFFFF0000  /* Subsystem ID */
-  #define SH7751_PCICONF11_SVID      0x0000FFFF  /* Subsystem Vendor ID */
-/* PCICONF12 is undefined */
-#define SH7751_PCICONF13           0x34          /* PCI Config Reg 13 */
-  #define SH7751_PCICONF13_CPTR      0x000000FF  /* PM function pointer */
-/* PCICONF14 is undefined */
-#define SH7751_PCICONF15           0x3C          /* PCI Config Reg 15 */
-  #define SH7751_PCICONF15_IPIN      0x000000FF  /* Interrupt Pin */
-#define SH7751_PCICONF16           0x40          /* PCI Config Reg 16 */
-  #define SH7751_PCICONF16_PMES      0xF8000000  /* PME Support */
-  #define SH7751_PCICONF16_D2S       0x04000000  /* D2 Support */
-  #define SH7751_PCICONF16_D1S       0x02000000  /* D1 Support */
-  #define SH7751_PCICONF16_DSI       0x00200000  /* Bit Device Init. */
-  #define SH7751_PCICONF16_PMCK      0x00080000  /* Clock for PME req. */
-  #define SH7751_PCICONF16_VER       0x00070000  /* PM Version */
-  #define SH7751_PCICONF16_NIP       0x0000FF00  /* Next Item Pointer */
-  #define SH7751_PCICONF16_CID       0x000000FF  /* Capability Identifier */
-#define SH7751_PCICONF17           0x44          /* PCI Config Reg 17 */
-  #define SH7751_PCICONF17_DATA      0xFF000000  /* Data field for PM */
-  #define SH7751_PCICONF17_PMES      0x00800000  /* PME Status */
-  #define SH7751_PCICONF17_DSCL      0x00600000  /* Data Scaling Value */
-  #define SH7751_PCICONF17_DSEL      0x001E0000  /* Data Select */
-  #define SH7751_PCICONF17_PMEN      0x00010000  /* PME Enable */
-  #define SH7751_PCICONF17_PWST      0x00000003  /* Power State */
-/* SH7715 Internal PCI Registers */
-#define SH7751_PCICR               0x100         /* PCI Control Register */
-  #define SH7751_PCICR_PREFIX        0xA5000000  /* CR prefix for write */
-  #define SH7751_PCICR_TRSB          0x00000200  /* Target Read Single */
-  #define SH7751_PCICR_BSWP          0x00000100  /* Target Byte Swap */
-  #define SH7751_PCICR_PLUP          0x00000080  /* Enable PCI Pullup */
-  #define SH7751_PCICR_ARBM          0x00000040  /* PCI Arbitration Mode */
-  #define SH7751_PCICR_MD            0x00000030  /* MD9 and MD10 status */
-  #define SH7751_PCICR_SERR          0x00000008  /* SERR output assert */
-  #define SH7751_PCICR_INTA          0x00000004  /* INTA output assert */
-  #define SH7751_PCICR_PRST          0x00000002  /* PCI Reset Assert */
-  #define SH7751_PCICR_CFIN          0x00000001  /* Central Fun. Init Done */
-#define SH7751_PCILSR0             0x104         /* PCI Local Space Register0 */
-#define SH7751_PCILSR1             0x108         /* PCI Local Space Register1 */
-#define SH7751_PCILAR0             0x10C         /* PCI Local Address Register1 */
-#define SH7751_PCILAR1             0x110         /* PCI Local Address Register1 */
-#define SH7751_PCIINT              0x114         /* PCI Interrupt Register */
-  #define SH7751_PCIINT_MLCK         0x00008000  /* Master Lock Error */
-  #define SH7751_PCIINT_TABT         0x00004000  /* Target Abort Error */
-  #define SH7751_PCIINT_TRET         0x00000200  /* Target Retry Error */
-  #define SH7751_PCIINT_MFDE         0x00000100  /* Master Func. Disable Error */
-  #define SH7751_PCIINT_PRTY         0x00000080  /* Address Parity Error */
-  #define SH7751_PCIINT_SERR         0x00000040  /* SERR Detection Error */
-  #define SH7751_PCIINT_TWDP         0x00000020  /* Tgt. Write Parity Error */
-  #define SH7751_PCIINT_TRDP         0x00000010  /* Tgt. Read Parity Error Det. */
-  #define SH7751_PCIINT_MTABT        0x00000008  /* Master-Tgt. Abort Error */
-  #define SH7751_PCIINT_MMABT        0x00000004  /* Master-Master Abort Error */
-  #define SH7751_PCIINT_MWPD         0x00000002  /* Master Write PERR Detect */
-  #define SH7751_PCIINT_MRPD         0x00000002  /* Master Read PERR Detect */
-#define SH7751_PCIINTM             0x118         /* PCI Interrupt Mask Register */
-#define SH7751_PCIALR              0x11C         /* Error Address Register */
-#define SH7751_PCICLR              0x120         /* Error Command/Data Register */
-  #define SH7751_PCICLR_MPIO         0x80000000  /* Error Command/Data Register */
-  #define SH7751_PCICLR_MDMA0        0x40000000  /* DMA0 Transfer Error */
-  #define SH7751_PCICLR_MDMA1        0x20000000  /* DMA1 Transfer Error */
-  #define SH7751_PCICLR_MDMA2        0x10000000  /* DMA2 Transfer Error */
-  #define SH7751_PCICLR_MDMA3        0x08000000  /* DMA3 Transfer Error */
-  #define SH7751_PCICLR_TGT          0x04000000  /* Target Transfer Error */
-  #define SH7751_PCICLR_CMDL         0x0000000F  /* PCI Command at Error */
-#define SH7751_PCIAINT             0x130         /* Arbiter Interrupt Register */
-  #define SH7751_PCIAINT_MBKN        0x00002000  /* Master Broken Interrupt */
-  #define SH7751_PCIAINT_TBTO        0x00001000  /* Target Bus Time Out */
-  #define SH7751_PCIAINT_MBTO        0x00001000  /* Master Bus Time Out */
-  #define SH7751_PCIAINT_TABT        0x00000008  /* Target Abort */
-  #define SH7751_PCIAINT_MABT        0x00000004  /* Master Abort */
-  #define SH7751_PCIAINT_RDPE        0x00000002  /* Read Data Parity Error */
-  #define SH7751_PCIAINT_WDPE        0x00000002  /* Write Data Parity Error */
-#define SH7751_PCIAINTM            0x134         /* Arbiter Int. Mask Register */
-#define SH7751_PCIBMLR             0x138         /* Error Bus Master Register */
-  #define SH7751_PCIBMLR_REQ4        0x00000010  /* REQ4 bus master at error */
-  #define SH7751_PCIBMLR_REQ3        0x00000008  /* REQ3 bus master at error */
-  #define SH7751_PCIBMLR_REQ2        0x00000004  /* REQ2 bus master at error */
-  #define SH7751_PCIBMLR_REQ1        0x00000002  /* REQ1 bus master at error */
-  #define SH7751_PCIBMLR_REQ0        0x00000001  /* REQ0 bus master at error */
-#define SH7751_PCIDMABT            0x140         /* DMA Transfer Arb. Register */
-  #define SH7751_PCIDMABT_RRBN       0x00000001  /* DMA Arbitor Round-Robin */
-#define SH7751_PCIDPA0             0x180         /* DMA0 Transfer Addr. Register */
-#define SH7751_PCIDLA0             0x184         /* DMA0 Local Addr. Register */
-#define SH7751_PCIDTC0             0x188         /* DMA0 Transfer Cnt. Register */
-#define SH7751_PCIDCR0             0x18C         /* DMA0 Control Register */
-  #define SH7751_PCIDCR_ALGN         0x00000600  /* DMA Alignment Mode */
-  #define SH7751_PCIDCR_MAST         0x00000100  /* DMA Termination Type */
-  #define SH7751_PCIDCR_INTM         0x00000080  /* DMA Interrupt Done Mask*/
-  #define SH7751_PCIDCR_INTS         0x00000040  /* DMA Interrupt Done Status */
-  #define SH7751_PCIDCR_LHLD         0x00000020  /* Local Address Control */
-  #define SH7751_PCIDCR_PHLD         0x00000010  /* PCI Address Control*/
-  #define SH7751_PCIDCR_IOSEL        0x00000008  /* PCI Address Space Type */
-  #define SH7751_PCIDCR_DIR          0x00000004  /* DMA Transfer Direction */
-  #define SH7751_PCIDCR_STOP         0x00000002  /* Force DMA Stop */
-  #define SH7751_PCIDCR_STRT         0x00000001  /* DMA Start */
-#define SH7751_PCIDPA1             0x190         /* DMA1 Transfer Addr. Register */
-#define SH7751_PCIDLA1             0x194         /* DMA1 Local Addr. Register */
-#define SH7751_PCIDTC1             0x198         /* DMA1 Transfer Cnt. Register */
-#define SH7751_PCIDCR1             0x19C         /* DMA1 Control Register */
-#define SH7751_PCIDPA2             0x1A0         /* DMA2 Transfer Addr. Register */
-#define SH7751_PCIDLA2             0x1A4         /* DMA2 Local Addr. Register */
-#define SH7751_PCIDTC2             0x1A8         /* DMA2 Transfer Cnt. Register */
-#define SH7751_PCIDCR2             0x1AC         /* DMA2 Control Register */
-#define SH7751_PCIDPA3             0x1B0         /* DMA3 Transfer Addr. Register */
-#define SH7751_PCIDLA3             0x1B4         /* DMA3 Local Addr. Register */
-#define SH7751_PCIDTC3             0x1B8         /* DMA3 Transfer Cnt. Register */
-#define SH7751_PCIDCR3             0x1BC         /* DMA3 Control Register */
-#define SH7751_PCIPAR              0x1C0         /* PIO Address Register */
-  #define SH7751_PCIPAR_CFGEN        0x80000000  /* Configuration Enable */
-  #define SH7751_PCIPAR_BUSNO        0x00FF0000  /* Config. Bus Number */
-  #define SH7751_PCIPAR_DEVNO        0x0000FF00  /* Config. Device Number */
-  #define SH7751_PCIPAR_REGAD        0x000000FC  /* Register Address Number */
-#define SH7751_PCIMBR              0x1C4         /* Memory Base Address Register */
-  #define SH7751_PCIMBR_MASK         0xFF000000  /* Memory Space Mask */
-  #define SH7751_PCIMBR_LOCK         0x00000001  /* Lock Memory Space */
-#define SH7751_PCIIOBR             0x1C8         /* I/O Base Address Register */
-  #define SH7751_PCIIOBR_MASK         0xFFFC0000 /* IO Space Mask */
-  #define SH7751_PCIIOBR_LOCK         0x00000001 /* Lock IO Space */
-#define SH7751_PCIPINT             0x1CC         /* Power Mgmnt Int. Register */
-  #define SH7751_PCIPINT_D3           0x00000002 /* D3 Pwr Mgmt. Interrupt */
-  #define SH7751_PCIPINT_D0           0x00000001 /* D0 Pwr Mgmt. Interrupt */  
-#define SH7751_PCIPINTM            0x1D0         /* Power Mgmnt Mask Register */
-#define SH7751_PCICLKR             0x1D4         /* Clock Ctrl. Register */
-  #define SH7751_PCICLKR_PCSTP        0x00000002 /* PCI Clock Stop */
-  #define SH7751_PCICLKR_BCSTP        0x00000002 /* BCLK Clock Stop */
-/* For definitions of BCR, MCR see ... */
-#define SH7751_PCIBCR1             0x1E0         /* Memory BCR1 Register */
-#define SH7751_PCIBCR2             0x1E4         /* Memory BCR2 Register */
-#define SH7751_PCIWCR1             0x1E8         /* Wait Control 1 Register */
-#define SH7751_PCIWCR2             0x1EC         /* Wait Control 2 Register */
-#define SH7751_PCIWCR3             0x1F0         /* Wait Control 3 Register */
-#define SH7751_PCIMCR              0x1F4         /* Memory Control Register */
-#define SH7751_PCIPCTR             0x200         /* Port Control Register */
-  #define SH7751_PCIPCTR_P2EN        0x000400000 /* Port 2 Enable */
-  #define SH7751_PCIPCTR_P1EN        0x000200000 /* Port 1 Enable */
-  #define SH7751_PCIPCTR_P0EN        0x000100000 /* Port 0 Enable */
-  #define SH7751_PCIPCTR_P2UP        0x000000020 /* Port2 Pull Up Enable */
-  #define SH7751_PCIPCTR_P2IO        0x000000010 /* Port2 Output Enable */
-  #define SH7751_PCIPCTR_P1UP        0x000000008 /* Port1 Pull Up Enable */
-  #define SH7751_PCIPCTR_P1IO        0x000000004 /* Port1 Output Enable */
-  #define SH7751_PCIPCTR_P0UP        0x000000002 /* Port0 Pull Up Enable */
-  #define SH7751_PCIPCTR_P0IO        0x000000001 /* Port0 Output Enable */
-#define SH7751_PCIPDTR             0x204         /* Port Data Register */
-  #define SH7751_PCIPDTR_PB5         0x000000020 /* Port 5 Enable */
-  #define SH7751_PCIPDTR_PB4         0x000000010 /* Port 4 Enable */
-  #define SH7751_PCIPDTR_PB3         0x000000008 /* Port 3 Enable */
-  #define SH7751_PCIPDTR_PB2         0x000000004 /* Port 2 Enable */
-  #define SH7751_PCIPDTR_PB1         0x000000002 /* Port 1 Enable */
-  #define SH7751_PCIPDTR_PB0         0x000000001 /* Port 0 Enable */
-#define SH7751_PCIPDR              0x220         /* Port IO Data Register */
-
-/* Memory Control Registers */
-#define SH7751_BCR1                0xFF800000    /* Memory BCR1 Register */
-#define SH7751_BCR2                0xFF800004    /* Memory BCR2 Register */
-#define SH7751_WCR1                0xFF800008    /* Wait Control 1 Register */
-#define SH7751_WCR2                0xFF80000C    /* Wait Control 2 Register */
-#define SH7751_WCR3                0xFF800010    /* Wait Control 3 Register */
-#define SH7751_MCR                 0xFF800014    /* Memory Control Register */
-
-/* General Memory Config Addresses */
-#define SH7751_CS0_BASE_ADDR       0x0
-#define SH7751_MEM_REGION_SIZE     0x04000000
-#define SH7751_CS1_BASE_ADDR       (SH7751_CS0_BASE_ADDR + SH7751_MEM_REGION_SIZE)
-#define SH7751_CS2_BASE_ADDR       (SH7751_CS1_BASE_ADDR + SH7751_MEM_REGION_SIZE)
-#define SH7751_CS3_BASE_ADDR       (SH7751_CS2_BASE_ADDR + SH7751_MEM_REGION_SIZE)
-#define SH7751_CS4_BASE_ADDR       (SH7751_CS3_BASE_ADDR + SH7751_MEM_REGION_SIZE)
-#define SH7751_CS5_BASE_ADDR       (SH7751_CS4_BASE_ADDR + SH7751_MEM_REGION_SIZE)
-#define SH7751_CS6_BASE_ADDR       (SH7751_CS5_BASE_ADDR + SH7751_MEM_REGION_SIZE)
-
-/* General PCI values */
-#define SH7751_PCI_HOST_BRIDGE		0x6
-
-/* External functions defined per platform i.e. Big Sur, SE... (these could be routed 
- * through the machine vectors... */
-extern int pcibios_init_platform(void);
-extern int pcibios_map_platform_irq(u8 slot, u8 pin);
-
-#endif /* _PCI_SH7751_H_ */
-
diff -Nru a/include/asm-sh/pci.h b/include/asm-sh/pci.h
--- a/include/asm-sh/pci.h	Tue Feb  3 19:45:33 2004
+++ b/include/asm-sh/pci.h	Tue Feb  3 19:45:33 2004
@@ -13,29 +13,25 @@
 
 #define pcibios_assign_all_busses()	1
 
-#if defined(CONFIG_CPU_SUBTYPE_ST40STB1)
-/* These are currently the correct values for the STM overdrive board. 
- * We need some way of setting this on a board specific way, it will 
- * not be the same on other boards I think
- */
-#define PCIBIOS_MIN_IO		0x2000
-#define PCIBIOS_MIN_MEM		0x10000000
-
-#elif defined(CONFIG_SH_DREAMCAST)
-#define PCIBIOS_MIN_IO		0x2000
-#define PCIBIOS_MIN_MEM		0x10000000
-#elif defined(CONFIG_SH_BIGSUR) && defined(CONFIG_CPU_SUBTYPE_SH7751)
-#define PCIBIOS_MIN_IO		0x2000
-#define PCIBIOS_MIN_MEM		0xFD000000
-
-#elif defined(CONFIG_SH_7751_SOLUTION_ENGINE)
-#define PCIBIOS_MIN_IO          0x4000
-#define PCIBIOS_MIN_MEM         0xFD000000
-
-#elif defined(CONFIG_SH_MPC1211)
-#define PCIBIOS_MIN_IO          0x2000
-#define PCIBIOS_MIN_MEM         0xb0000000
-#endif
+/*
+ * A board can define one or more PCI channels that represent built-in (or
+ * external) PCI controllers.
+ */
+struct pci_channel {
+	struct pci_ops *pci_ops;
+	struct resource *io_resource;
+	struct resource *mem_resource;
+	int first_devfn;
+	int last_devfn;
+};
+
+/*
+ * Each board initializes this array and terminates it with a NULL entry.
+ */
+extern struct pci_channel board_pci_channels[];
+
+#define PCIBIOS_MIN_IO		board_pci_channels->io_resource->start
+#define PCIBIOS_MIN_MEM		board_pci_channels->mem_resource->start
 
 struct pci_dev;
 
@@ -250,23 +246,6 @@
  */
 #define sg_dma_address(sg)	(virt_to_bus((sg)->dma_address))
 #define sg_dma_len(sg)		((sg)->length)
-
-/*
- * A board can define one or more PCI channels that represent built-in (or
- * external) PCI controllers.
- */
-struct pci_channel {
-	struct pci_ops *pci_ops;
-	struct resource *io_resource;
-	struct resource *mem_resource;
-	int first_devfn;
-	int last_devfn;
-};
-
-/*
- * Each board initializes this array and terminates it with a NULL entry.
- */
-extern struct pci_channel board_pci_channels[];
 
 /* Board-specific fixup routines. */
 extern void pcibios_fixup(void);
diff -Nru a/include/asm-sh/pgalloc.h b/include/asm-sh/pgalloc.h
--- a/include/asm-sh/pgalloc.h	Tue Feb  3 19:45:26 2004
+++ b/include/asm-sh/pgalloc.h	Tue Feb  3 19:45:26 2004
@@ -42,18 +42,11 @@
 static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
 					  unsigned long address)
 {
-	int count = 0;
 	pte_t *pte;
 
-   	do {
-		pte = (pte_t *) __get_free_page(GFP_KERNEL | __GFP_REPEAT);
-		if (pte)
-			clear_page(pte);
-		else {
-			current->state = TASK_UNINTERRUPTIBLE;
-			schedule_timeout(HZ);
-		}
-	} while (!pte && (count++ < 10));
+	pte = (pte_t *) __get_free_page(GFP_KERNEL | __GFP_REPEAT);
+	if (pte)
+		clear_page(pte);
 
 	return pte;
 }
@@ -61,18 +54,11 @@
 static inline struct page *pte_alloc_one(struct mm_struct *mm,
 					 unsigned long address)
 {
-	int count = 0;
 	struct page *pte;
 
-   	do {
-		pte = alloc_pages(GFP_KERNEL, 0);
-		if (pte)
-			clear_page(page_address(pte));
-		else {
-			current->state = TASK_UNINTERRUPTIBLE;
-			schedule_timeout(HZ);
-		}
-	} while (!pte && (count++ < 10));
+   	pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0);
+	if (pte)
+		clear_page(page_address(pte));
 
 	return pte;
 }
diff -Nru a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h
--- a/include/asm-sh/pgtable.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-sh/pgtable.h	Tue Feb  3 19:45:43 2004
@@ -280,5 +280,13 @@
 extern unsigned int kobjsize(const void *objp);
 #endif /* !CONFIG_MMU */
 
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
+#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
+#define __HAVE_ARCH_PTEP_SET_WRPROTECT
+#define __HAVE_ARCH_PTEP_MKDIRTY
+#define __HAVE_ARCH_PTE_SAME
+#include <asm-generic/pgtable.h>
+
 #endif /* __ASM_SH_PAGE_H */
 
diff -Nru a/include/asm-sh/processor.h b/include/asm-sh/processor.h
--- a/include/asm-sh/processor.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-sh/processor.h	Tue Feb  3 19:45:17 2004
@@ -2,7 +2,7 @@
  * include/asm-sh/processor.h
  *
  * Copyright (C) 1999, 2000  Niibe Yutaka
- * Copyright (C) 2002 Paul Mundt
+ * Copyright (C) 2002, 2003  Paul Mundt
  */
 
 #ifndef __ASM_SH_PROCESSOR_H
@@ -22,20 +22,27 @@
 /* Core Processor Version Register */
 #define CCN_PVR		0xff000030
 #define CCN_PRR		0xff000044
+
 /*
  *  CPU type and hardware bug flags. Kept separately for each CPU.
+ *
+ *  Each one of these also needs a CONFIG_CPU_SUBTYPE_xxx entry
+ *  in arch/sh/Kconfig, as well as an entry in arch/sh/kernel/setup.c
+ *  for parsing the subtype in get_cpu_subtype().
  */
 enum cpu_type {
-	CPU_SH7604,		/* Represents 7604 */
-	CPU_SH7708,		/* Represents 7707, 7708, 7708S, 7708R, 7709 */
-	CPU_SH7729,		/* Represents 7709A, 7729 */
-	CPU_SH7750,     	/* Represents 7750 */
-	CPU_SH7750S,		/* Represents 7750S */
-	CPU_SH7750R,		/* Represents 7750R */
-	CPU_SH7751,		/* Represents 7751 */
-	CPU_SH7751R,		/* Represents 7751R */
-	CPU_ST40RA,		/* Represents ST40RA (formerly ST40STB1) */
-	CPU_ST40GX1,		/* Represents ST40GX1 */
+	/* SH-2 types */
+	CPU_SH7604,
+
+	/* SH-3 types */
+	CPU_SH7707,  CPU_SH7708, CPU_SH7708S, CPU_SH7708R, CPU_SH7709,
+	CPU_SH7709A, CPU_SH7729, CPU_SH7300,
+
+	/* SH-4 types */
+	CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R,
+	CPU_SH7760, CPU_ST40RA, CPU_ST40GX1, CPU_SH4_202, CPU_SH4_501,
+
+	/* Unknown subtype */
 	CPU_SH_NONE
 };
 
@@ -55,12 +62,12 @@
 	unsigned long flags;
 };
 
+extern struct sh_cpuinfo boot_cpu_data;
+
 #ifdef CONFIG_SMP
 extern struct sh_cpuinfo cpu_data[];
 #define current_cpu_data cpu_data[smp_processor_id()]
 #else
-extern struct sh_cpuinfo boot_cpu_data;
-
 #define cpu_data (&boot_cpu_data)
 #define current_cpu_data boot_cpu_data
 #endif
@@ -87,8 +94,9 @@
  * IMASK-bit:
  *     Interrupt level mask
  */
-#define SR_FD    0x00008000
-#define SR_IMASK 0x000000f0
+#define SR_FD		0x00008000
+#define SR_DSP		0x00001000
+#define SR_IMASK	0x000000f0
 
 /*
  * FPU structure and data
@@ -119,7 +127,14 @@
 	struct sh_fpu_soft_struct soft;
 };
 
-#define CPU_HAS_FPU	0x0001
+/* 
+ * Processor flags
+ */
+
+#define CPU_HAS_FPU		0x0001	/* Hardware FPU support */
+#define CPU_HAS_P2_FLUSH_BUG	0x0002	/* Need to flush the cache in P2 area */
+#define CPU_HAS_MMU_PAGE_ASSOC	0x0004	/* SH3: TLB way selection bit support */
+#define CPU_HAS_DSP		0x0008	/* SH-DSP: DSP support */
 
 struct thread_struct {
 	unsigned long sp;
@@ -128,16 +143,21 @@
 	unsigned long trap_no, error_code;
 	unsigned long address;
 	/* Hardware debugging registers may come here */
+	unsigned long ubc_pc;
 
 	/* floating point info */
 	union sh_fpu_union fpu;
 };
 
+/* Count of active tasks with UBC settings */
+extern int ubc_usercnt;
+
 #define INIT_THREAD  {						\
 	sizeof(init_stack) + (long) &init_stack, /* sp */	\
 	0,					 /* pc */	\
 	0, 0, 							\
 	0, 							\
+	0, 							\
 	{{{0,}},} 				/* fpu state */	\
 }
 
@@ -239,6 +259,6 @@
 #define KSTK_EIP(tsk)  ((tsk)->thread.pc)
 #define KSTK_ESP(tsk)  ((tsk)->thread.sp)
 
-#define cpu_relax()	barrier()
+#define cpu_relax()	__asm__ __volatile__ ("sleep" : : : "memory")
 
 #endif /* __ASM_SH_PROCESSOR_H */
diff -Nru a/include/asm-sh/ptrace.h b/include/asm-sh/ptrace.h
--- a/include/asm-sh/ptrace.h	Tue Feb  3 19:45:41 2004
+++ b/include/asm-sh/ptrace.h	Tue Feb  3 19:45:41 2004
@@ -37,13 +37,13 @@
 
 #define REG_SYSCALL	22
 
-#define REG_FPUL	23
+#define REG_FPREG0	23
+#define REG_FPREG15	38
+#define REG_XFREG0	39
+#define REG_XFREG15	54
 
-#define REG_FPREG0	24
-#define REG_FPREG15	39
-#define REG_XDREG0	40
-#define REG_XDREG14	47
-#define REG_FPSCR	48
+#define REG_FPSCR	55
+#define REG_FPUL	56
 
 /* options set using PTRACE_SETOPTIONS */
 #define PTRACE_O_TRACESYSGOOD     0x00000001
@@ -62,6 +62,30 @@
 	unsigned long macl;
 	long tra;
 };
+
+/*
+ * This struct defines the way the DSP registers are stored on the
+ * kernel stack during a system call or other kernel entry.
+ */
+struct pt_dspregs {
+	unsigned long	a1;
+	unsigned long	a0g;
+	unsigned long	a1g;
+	unsigned long	m0;
+	unsigned long	m1;
+	unsigned long	a0;
+	unsigned long	x0;
+	unsigned long	x1;
+	unsigned long	y0;
+	unsigned long	y1;
+	unsigned long	dsr;
+	unsigned long	rs;
+	unsigned long	re;
+	unsigned long	mod;
+};
+
+#define	PTRACE_GETDSPREGS	55
+#define	PTRACE_SETDSPREGS	56
 
 #ifdef __KERNEL__
 #define user_mode(regs) (((regs)->sr & 0x40000000)==0)
diff -Nru a/include/asm-sh/rtc.h b/include/asm-sh/rtc.h
--- a/include/asm-sh/rtc.h	Tue Feb  3 19:45:33 2004
+++ b/include/asm-sh/rtc.h	Tue Feb  3 19:45:33 2004
@@ -4,11 +4,11 @@
 #include <asm/machvec.h>
 #include <asm/cpu/rtc.h>
 
-#define rtc_gettimeofday sh_mv.mv_rtc_gettimeofday
-#define rtc_settimeofday sh_mv.mv_rtc_settimeofday
-
 extern void sh_rtc_gettimeofday(struct timespec *ts);
 extern int sh_rtc_settimeofday(const time_t secs);
+extern void (*board_time_init)(void);
+extern void (*rtc_get_time)(struct timespec *);
+extern int (*rtc_set_time)(const time_t);
 
 /* RCR1 Bits */
 #define RCR1_CF		0x80	/* Carry Flag             */
diff -Nru a/include/asm-sh/saturn/io.h b/include/asm-sh/saturn/io.h
--- a/include/asm-sh/saturn/io.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-sh/saturn/io.h	Tue Feb  3 19:45:17 2004
@@ -10,48 +10,10 @@
 #ifndef __ASM_SH_SATURN_IO_H
 #define __ASM_SH_SATURN_IO_H
 
-#include <asm/io_generic.h>
-
 /* arch/sh/boards/saturn/io.c */
 extern unsigned long saturn_isa_port2addr(unsigned long offset);
 extern void *saturn_ioremap(unsigned long offset, unsigned long size);
 extern void saturn_iounmap(void *addr);
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			generic_inb
-# define __inw			generic_inw
-# define __inl			generic_inl
-# define __outb			generic_outb
-# define __outw			generic_outw
-# define __outl			generic_outl
-
-# define __inb_p		generic_inb_p
-# define __inw_p		generic_inw
-# define __inl_p		generic_inl
-# define __outb_p		generic_outb_p
-# define __outw_p		generic_outw
-# define __outl_p		generic_outl
-
-# define __insb			generic_insb
-# define __insw			generic_insw
-# define __insl			generic_insl
-# define __outsb		generic_outsb
-# define __outsw		generic_outsw
-# define __outsl		generic_outsl
-
-# define __readb		generic_readb
-# define __readw		generic_readw
-# define __readl		generic_readl
-# define __writeb		generic_writeb
-# define __writew		generic_writew
-# define __writel		generic_writel
-
-# define __isa_port2addr	saturn_isa_port2addr
-# define __ioremap		saturn_ioremap
-# define __iounmap		saturn_iounmap
-
-#endif
 
 #endif /* __ASM_SH_SATURN_IO_H */
 
diff -Nru a/include/asm-sh/se/io.h b/include/asm-sh/se/io.h
--- a/include/asm-sh/se/io.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-sh/se/io.h	Tue Feb  3 19:45:17 2004
@@ -12,8 +12,6 @@
 #ifndef _ASM_SH_IO_SE_H
 #define _ASM_SH_IO_SE_H
 
-#include <asm/io_generic.h>
-
 extern unsigned char se_inb(unsigned long port);
 extern unsigned short se_inw(unsigned long port);
 extern unsigned int se_inl(unsigned long port);
@@ -32,49 +30,6 @@
 extern void se_outsw(unsigned long port, const void *addr, unsigned long count);
 extern void se_outsl(unsigned long port, const void *addr, unsigned long count);
 
-extern unsigned char se_readb(unsigned long addr);
-extern unsigned short se_readw(unsigned long addr);
-extern unsigned int se_readl(unsigned long addr);
-extern void se_writeb(unsigned char b, unsigned long addr);
-extern void se_writew(unsigned short b, unsigned long addr);
-extern void se_writel(unsigned int b, unsigned long addr);
-
 extern unsigned long se_isa_port2addr(unsigned long offset);
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			se_inb
-# define __inw			se_inw
-# define __inl			se_inl
-# define __outb			se_outb
-# define __outw			se_outw
-# define __outl			se_outl
-
-# define __inb_p		se_inb_p
-# define __inw_p		se_inw
-# define __inl_p		se_inl
-# define __outb_p		se_outb_p
-# define __outw_p		se_outw
-# define __outl_p		se_outl
-
-# define __insb			se_insb
-# define __insw			se_insw
-# define __insl			se_insl
-# define __outsb		se_outsb
-# define __outsw		se_outsw
-# define __outsl		se_outsl
-
-# define __readb		se_readb
-# define __readw		se_readw
-# define __readl		se_readl
-# define __writeb		se_writeb
-# define __writew		se_writew
-# define __writel		se_writel
-
-# define __isa_port2addr	se_isa_port2addr
-# define __ioremap		generic_ioremap
-# define __iounmap		generic_iounmap
-
-#endif
 
 #endif /* _ASM_SH_IO_SE_H */
diff -Nru a/include/asm-sh/se7751/io.h b/include/asm-sh/se7751/io.h
--- a/include/asm-sh/se7751/io.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-sh/se7751/io.h	Tue Feb  3 19:45:43 2004
@@ -12,8 +12,6 @@
 #ifndef _ASM_SH_IO_7751SE_H
 #define _ASM_SH_IO_7751SE_H
 
-#include <asm/io_generic.h>
-
 extern unsigned char sh7751se_inb(unsigned long port);
 extern unsigned short sh7751se_inw(unsigned long port);
 extern unsigned int sh7751se_inl(unsigned long port);
@@ -40,41 +38,5 @@
 extern void sh7751se_writel(unsigned int b, unsigned long addr);
 
 extern unsigned long sh7751se_isa_port2addr(unsigned long offset);
-
-#ifdef __WANT_IO_DEF
-
-# define __inb			sh7751se_inb
-# define __inw			sh7751se_inw
-# define __inl			sh7751se_inl
-# define __outb			sh7751se_outb
-# define __outw			sh7751se_outw
-# define __outl			sh7751se_outl
-
-# define __inb_p		sh7751se_inb_p
-# define __inw_p		sh7751se_inw
-# define __inl_p		sh7751se_inl
-# define __outb_p		sh7751se_outb_p
-# define __outw_p		sh7751se_outw
-# define __outl_p		sh7751se_outl
-
-# define __insb			sh7751se_insb
-# define __insw			sh7751se_insw
-# define __insl			sh7751se_insl
-# define __outsb		sh7751se_outsb
-# define __outsw		sh7751se_outsw
-# define __outsl		sh7751se_outsl
-
-# define __readb		sh7751se_readb
-# define __readw		sh7751se_readw
-# define __readl		sh7751se_readl
-# define __writeb		sh7751se_writeb
-# define __writew		sh7751se_writew
-# define __writel		sh7751se_writel
-
-# define __isa_port2addr	sh7751se_isa_port2addr
-# define __ioremap		generic_ioremap
-# define __iounmap		generic_iounmap
-
-#endif
 
 #endif /* _ASM_SH_IO_7751SE_H */
diff -Nru a/include/asm-sh/sections.h b/include/asm-sh/sections.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sh/sections.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,9 @@
+#ifndef __ASM_SH_SECTIONS_H
+#define __ASM_SH_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+extern char _end[];
+
+#endif /* __ASM_SH_SECTIONS_H */
+
diff -Nru a/include/asm-sh/segment.h b/include/asm-sh/segment.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sh/segment.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,6 @@
+#ifndef __ASM_SH_SEGMENT_H
+#define __ASM_SH_SEGMENT_H
+
+/* Only here because we have some old header files that expect it.. */
+
+#endif /* __ASM_SH_SEGMENT_H */
diff -Nru a/include/asm-sh/serial-bigsur.h b/include/asm-sh/serial-bigsur.h
--- a/include/asm-sh/serial-bigsur.h	Tue Feb  3 19:45:34 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,27 +0,0 @@
-/*
- * include/asm-sh/serial-bigsur.h
- *
- * Configuration details for Big Sur 16550 based serial ports 
- * i.e. HD64465, PCMCIA, etc.
- */
-
-#ifndef _ASM_SERIAL_BIGSUR_H
-#define _ASM_SERIAL_BIGSUR_H
-#include <asm/hd64465.h>
-
-#define BASE_BAUD (3379200 / 16)
-
-#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
-
-
-#define STD_SERIAL_PORT_DEFNS                   \
-        /* UART CLK   PORT IRQ     FLAGS        */                      \
-        { 0, BASE_BAUD, 0x3F8, HD64465_IRQ_UART, STD_COM_FLAGS } /* ttyS0 */ 
-
-
-#define SERIAL_PORT_DFNS STD_SERIAL_PORT_DEFNS
-
-/* XXX: This should be moved ino irq.h */
-#define irq_canonicalize(x) (x)
-
-#endif /* _ASM_SERIAL_BIGSUR_H */
diff -Nru a/include/asm-sh/serial-ec3104.h b/include/asm-sh/serial-ec3104.h
--- a/include/asm-sh/serial-ec3104.h	Tue Feb  3 19:45:18 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,22 +0,0 @@
-#include <asm/ec3104.h>
-/* Naturally we don't know the exact value but 115200 baud has a divisor
- * of 9 and 19200 baud has a divisor of 52, so this seems like a good
- * guess.  */
-#define BASE_BAUD (16800000 / 16)
-
-#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
-
-/* there is a fourth serial port with the expected values as well, but
- * it's got the keyboard controller behind it so we can't really use it
- * (without moving the keyboard driver to userspace, which doesn't sound
- * like a very good idea) */
-#define STD_SERIAL_PORT_DEFNS			\
-	/* UART CLK   PORT IRQ     FLAGS        */			\
-	{ 0, BASE_BAUD, 0x11C00, EC3104_IRQBASE+7, STD_COM_FLAGS }, /* ttyS0 */	\
-	{ 0, BASE_BAUD, 0x12000, EC3104_IRQBASE+8, STD_COM_FLAGS }, /* ttyS1 */	\
-	{ 0, BASE_BAUD, 0x12400, EC3104_IRQBASE+9, STD_COM_FLAGS }, /* ttyS2 */
-
-#define SERIAL_PORT_DFNS STD_SERIAL_PORT_DEFNS
-
-/* XXX: This should be moved ino irq.h */
-#define irq_canonicalize(x) (x)
diff -Nru a/include/asm-sh/sigcontext.h b/include/asm-sh/sigcontext.h
--- a/include/asm-sh/sigcontext.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-sh/sigcontext.h	Tue Feb  3 19:45:43 2004
@@ -1,26 +1,6 @@
 #ifndef __ASM_SH_SIGCONTEXT_H
 #define __ASM_SH_SIGCONTEXT_H
 
-struct sigcontext {
-	unsigned long	oldmask;
-
-	/* CPU registers */
-	unsigned long sc_regs[16];
-	unsigned long sc_pc;
-	unsigned long sc_pr;
-	unsigned long sc_sr;
-	unsigned long sc_gbr;
-	unsigned long sc_mach;
-	unsigned long sc_macl;
-
-#if defined(CONFIG_CPU_SH4)
-	/* FPU registers */
-	unsigned long sc_fpregs[16];
-	unsigned long sc_xfpregs[16];
-	unsigned int sc_fpscr;
-	unsigned int sc_fpul;
-	unsigned int sc_ownedfp;
-#endif
-};
+#include <asm/cpu/sigcontext.h>
 
 #endif /* __ASM_SH_SIGCONTEXT_H */
diff -Nru a/include/asm-sh/smc37c93x.h b/include/asm-sh/smc37c93x.h
--- a/include/asm-sh/smc37c93x.h	Tue Feb  3 19:45:33 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,190 +0,0 @@
-#ifndef __ASM_SH_SMC37C93X_H
-#define __ASM_SH_SMC37C93X_H
-
-/*
- * linux/include/asm-sh/smc37c93x.h
- *
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * SMSC 37C93x Super IO Chip support
- */
-
-/* Default base I/O address */
-#define FDC_PRIMARY_BASE	0x3f0
-#define IDE1_PRIMARY_BASE	0x1f0
-#define IDE1_SECONDARY_BASE	0x170
-#define PARPORT_PRIMARY_BASE	0x378
-#define COM1_PRIMARY_BASE	0x2f8
-#define COM2_PRIMARY_BASE	0x3f8
-#define RTC_PRIMARY_BASE	0x070
-#define KBC_PRIMARY_BASE	0x060
-#define AUXIO_PRIMARY_BASE	0x000	/* XXX */
-
-/* Logical device number */
-#define LDN_FDC			0
-#define LDN_IDE1		1
-#define LDN_IDE2		2
-#define LDN_PARPORT		3
-#define LDN_COM1		4
-#define LDN_COM2		5
-#define LDN_RTC			6
-#define LDN_KBC			7
-#define LDN_AUXIO		8
-
-/* Configuration port and key */
-#define CONFIG_PORT		0x3f0
-#define INDEX_PORT		CONFIG_PORT
-#define DATA_PORT		0x3f1
-#define CONFIG_ENTER		0x55
-#define CONFIG_EXIT		0xaa
-
-/* Configuration index */
-#define CURRENT_LDN_INDEX	0x07
-#define POWER_CONTROL_INDEX	0x22
-#define ACTIVATE_INDEX		0x30
-#define IO_BASE_HI_INDEX	0x60
-#define IO_BASE_LO_INDEX	0x61
-#define IRQ_SELECT_INDEX	0x70
-#define DMA_SELECT_INDEX	0x74
-
-#define GPIO46_INDEX		0xc6
-#define GPIO47_INDEX		0xc7
-
-/* UART stuff. Only for debugging.  */
-/* UART Register */
-
-#define UART_RBR	0x0	/* Receiver Buffer Register (Read Only) */
-#define UART_THR	0x0	/* Transmitter Holding Register (Write Only) */
-#define UART_IER	0x2	/* Interrupt Enable Register */
-#define UART_IIR	0x4	/* Interrupt Ident Register (Read Only) */
-#define UART_FCR	0x4	/* FIFO Control Register (Write Only) */
-#define UART_LCR	0x6	/* Line Control Register */
-#define UART_MCR	0x8	/* MODEM Control Register */
-#define UART_LSR	0xa	/* Line Status Register */
-#define UART_MSR	0xc	/* MODEM Status Register */
-#define UART_SCR	0xe	/* Scratch Register */
-#define UART_DLL	0x0	/* Divisor Latch (LS) */
-#define UART_DLM	0x2	/* Divisor Latch (MS) */
-
-#ifndef __ASSEMBLY__
-typedef struct uart_reg {
-	volatile __u16 rbr;
-	volatile __u16 ier;
-	volatile __u16 iir;
-	volatile __u16 lcr;
-	volatile __u16 mcr;
-	volatile __u16 lsr;
-	volatile __u16 msr;
-	volatile __u16 scr;
-} uart_reg;
-#endif /* ! __ASSEMBLY__ */
-
-/* Alias for Write Only Register */
-
-#define thr	rbr
-#define tcr	iir
-
-/* Alias for Divisor Latch Register */
-
-#define dll	rbr
-#define dlm	ier
-#define fcr	iir
-
-/* Interrupt Enable Register */
-
-#define IER_ERDAI	0x0100	/* Enable Received Data Available Interrupt */
-#define IER_ETHREI	0x0200	/* Enable Transmitter Holding Register Empty Interrupt */
-#define IER_ELSI	0x0400	/* Enable Receiver Line Status Interrupt */
-#define IER_EMSI	0x0800	/* Enable MODEM Status Interrupt */
-
-/* Interrupt Ident Register */
-
-#define IIR_IP		0x0100	/* "0" if Interrupt Pending */
-#define IIR_IIB0	0x0200	/* Interrupt ID Bit 0 */
-#define IIR_IIB1	0x0400	/* Interrupt ID Bit 1 */
-#define IIR_IIB2	0x0800	/* Interrupt ID Bit 2 */
-#define IIR_FIFO	0xc000	/* FIFOs enabled */
-
-/* FIFO Control Register */
-
-#define FCR_FEN		0x0100	/* FIFO enable */
-#define FCR_RFRES	0x0200	/* Receiver FIFO reset */
-#define FCR_TFRES	0x0400	/* Transmitter FIFO reset */
-#define FCR_DMA		0x0800	/* DMA mode select */
-#define FCR_RTL		0x4000	/* Receiver triger (LSB) */
-#define FCR_RTM		0x8000	/* Receiver triger (MSB) */
-
-/* Line Control Register */
-
-#define LCR_WLS0	0x0100	/* Word Length Select Bit 0 */
-#define LCR_WLS1	0x0200	/* Word Length Select Bit 1 */
-#define LCR_STB		0x0400	/* Number of Stop Bits */
-#define LCR_PEN		0x0800	/* Parity Enable */
-#define LCR_EPS		0x1000	/* Even Parity Select */
-#define LCR_SP		0x2000	/* Stick Parity */
-#define LCR_SB		0x4000	/* Set Break */
-#define LCR_DLAB	0x8000	/* Divisor Latch Access Bit */
-
-/* MODEM Control Register */
-
-#define MCR_DTR		0x0100	/* Data Terminal Ready */
-#define MCR_RTS		0x0200	/* Request to Send */
-#define MCR_OUT1	0x0400	/* Out 1 */
-#define MCR_IRQEN	0x0800	/* IRQ Enable */
-#define MCR_LOOP	0x1000	/* Loop */
-
-/* Line Status Register */
-
-#define LSR_DR		0x0100	/* Data Ready */
-#define LSR_OE		0x0200	/* Overrun Error */
-#define LSR_PE		0x0400	/* Parity Error */
-#define LSR_FE		0x0800	/* Framing Error */
-#define LSR_BI		0x1000	/* Break Interrupt */
-#define LSR_THRE	0x2000	/* Transmitter Holding Register Empty */
-#define LSR_TEMT	0x4000	/* Transmitter Empty */
-#define LSR_FIFOE	0x8000	/* Receiver FIFO error */
-
-/* MODEM Status Register */
-
-#define MSR_DCTS	0x0100	/* Delta Clear to Send */
-#define MSR_DDSR	0x0200	/* Delta Data Set Ready */
-#define MSR_TERI	0x0400	/* Trailing Edge Ring Indicator */
-#define MSR_DDCD	0x0800	/* Delta Data Carrier Detect */
-#define MSR_CTS		0x1000	/* Clear to Send */
-#define MSR_DSR		0x2000	/* Data Set Ready */
-#define MSR_RI		0x4000	/* Ring Indicator */
-#define MSR_DCD		0x8000	/* Data Carrier Detect */
-
-/* Baud Rate Divisor */
-
-#define UART_CLK	(1843200)	/* 1.8432 MHz */
-#define UART_BAUD(x)	(UART_CLK / (16 * (x)))
-
-/* RTC register definition */
-#define RTC_SECONDS             0
-#define RTC_SECONDS_ALARM       1
-#define RTC_MINUTES             2
-#define RTC_MINUTES_ALARM       3
-#define RTC_HOURS               4
-#define RTC_HOURS_ALARM         5
-#define RTC_DAY_OF_WEEK         6
-#define RTC_DAY_OF_MONTH        7
-#define RTC_MONTH               8
-#define RTC_YEAR                9
-#define RTC_FREQ_SELECT		10
-# define RTC_UIP 0x80
-# define RTC_DIV_CTL 0x70
-/* This RTC can work under 32.768KHz clock only.  */
-# define RTC_OSC_ENABLE 0x20
-# define RTC_OSC_DISABLE 0x00
-#define RTC_CONTROL     	11
-# define RTC_SET 0x80
-# define RTC_PIE 0x40
-# define RTC_AIE 0x20
-# define RTC_UIE 0x10
-# define RTC_SQWE 0x08
-# define RTC_DM_BINARY 0x04
-# define RTC_24H 0x02
-# define RTC_DST_EN 0x01
-
-#endif  /* __ASM_SH_SMC37C93X_H */
diff -Nru a/include/asm-sh/smp.h b/include/asm-sh/smp.h
--- a/include/asm-sh/smp.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-sh/smp.h	Tue Feb  3 19:45:30 2004
@@ -1,11 +1,18 @@
 /*
- * Copyright (C) 2002 Paul Mundt
+ * include/asm-sh/smp.h
+ *
+ * Copyright (C) 2002, 2003  Paul Mundt
+ *
+ * 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.
  */
 #ifndef __ASM_SH_SMP_H
 #define __ASM_SH_SMP_H
 
 #include <linux/config.h>
 #include <linux/bitops.h>
+#include <linux/cpumask.h>
 
 #ifdef CONFIG_SMP
 
@@ -13,17 +20,12 @@
 #include <asm/atomic.h>
 #include <asm/current.h>
 
-extern unsigned long cpu_online_map;
+extern cpumask_t cpu_online_map;
+extern cpumask_t cpu_possible_map;
 
-#define cpu_online(cpu)		(cpu_online_map & (1 << (cpu)))
-#define cpu_possible(cpu)	(cpu_online(cpu))
+#define cpu_online(cpu)		cpu_isset(cpu, cpu_online_map)
 
 #define smp_processor_id()	(current_thread_info()->cpu)
-
-extern inline unsigned int num_online_cpus(void)
-{
-	return hweight32(cpu_online_map);
-}
 
 /* I've no idea what the real meaning of this is */
 #define PROC_CHANGE_PENALTY	20
diff -Nru a/include/asm-sh/snapgear/io.h b/include/asm-sh/snapgear/io.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sh/snapgear/io.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,92 @@
+/*
+ * include/asm-sh/snapgear/io.h
+ *
+ * Modified version of io_se.h for the snapgear-specific functions.
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ *
+ * IO functions for a SnapGear
+ */
+
+#ifndef _ASM_SH_IO_SNAPGEAR_H
+#define _ASM_SH_IO_SNAPGEAR_H
+
+#if defined(CONFIG_CPU_SH4)
+/*
+ * The external interrupt lines, these take up ints 0 - 15 inclusive
+ * depending on the priority for the interrupt.  In fact the priority
+ * is the interrupt :-)
+ */
+
+#define IRL0_IRQ		2
+#define IRL0_IPR_ADDR	INTC_IPRD
+#define IRL0_IPR_POS	3
+#define IRL0_PRIORITY	13
+
+#define IRL1_IRQ		5
+#define IRL1_IPR_ADDR	INTC_IPRD
+#define IRL1_IPR_POS	2
+#define IRL1_PRIORITY	10
+
+#define IRL2_IRQ		8
+#define IRL2_IPR_ADDR	INTC_IPRD
+#define IRL2_IPR_POS	1
+#define IRL2_PRIORITY	7
+
+#define IRL3_IRQ		11
+#define IRL3_IPR_ADDR	INTC_IPRD
+#define IRL3_IPR_POS	0
+#define IRL3_PRIORITY	4
+#endif
+
+extern unsigned char snapgear_inb(unsigned long port);
+extern unsigned short snapgear_inw(unsigned long port);
+extern unsigned int snapgear_inl(unsigned long port);
+
+extern void snapgear_outb(unsigned char value, unsigned long port);
+extern void snapgear_outw(unsigned short value, unsigned long port);
+extern void snapgear_outl(unsigned int value, unsigned long port);
+
+extern unsigned char snapgear_inb_p(unsigned long port);
+extern void snapgear_outb_p(unsigned char value, unsigned long port);
+
+extern void snapgear_insl(unsigned long port, void *addr, unsigned long count);
+extern void snapgear_outsl(unsigned long port, const void *addr, unsigned long count);
+
+extern unsigned long snapgear_isa_port2addr(unsigned long offset);
+
+#ifdef CONFIG_SH_SECUREEDGE5410
+/*
+ * We need to remember what was written to the ioport as some bits
+ * are shared with other functions and you cannot read back what was
+ * written :-|
+ *
+ * Bit        Read                   Write
+ * -----------------------------------------------
+ * D0         DCD on ttySC1          power
+ * D1         Reset Switch           heatbeat
+ * D2         ttySC0 CTS (7100)      LAN
+ * D3         -                      WAN
+ * D4         ttySC0 DCD (7100)      CONSOLE
+ * D5         -                      ONLINE
+ * D6         -                      VPN
+ * D7         -                      DTR on ttySC1
+ * D8         -                      ttySC0 RTS (7100)
+ * D9         -                      ttySC0 DTR (7100)
+ * D10        -                      RTC SCLK
+ * D11        RTC DATA               RTC DATA
+ * D12        -                      RTS RESET
+ */
+
+ #define SECUREEDGE_IOPORT_ADDR ((volatile short *) 0xb0000000)
+ extern unsigned short secureedge5410_ioport;
+
+ #define SECUREEDGE_WRITE_IOPORT(val, mask) (*SECUREEDGE_IOPORT_ADDR = \
+		 (secureedge5410_ioport = \
+		 		((secureedge5410_ioport & ~(mask)) | ((val) & (mask)))))
+ #define SECUREEDGE_READ_IOPORT() \
+ 		 ((*SECUREEDGE_IOPORT_ADDR&0x0817) | (secureedge5410_ioport&~0x0817))
+#endif
+
+#endif /* _ASM_SH_IO_SNAPGEAR_H */
diff -Nru a/include/asm-sh/socket.h b/include/asm-sh/socket.h
--- a/include/asm-sh/socket.h	Tue Feb  3 19:45:18 2004
+++ b/include/asm-sh/socket.h	Tue Feb  3 19:45:18 2004
@@ -45,6 +45,8 @@
 
 #define SO_ACCEPTCONN		30
 
+#define SO_PEERSEC		31
+
 /* Nast libc5 fixup - bletch */
 #if defined(__KERNEL__)
 /* Socket types. */
diff -Nru a/include/asm-sh/spinlock.h b/include/asm-sh/spinlock.h
--- a/include/asm-sh/spinlock.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-sh/spinlock.h	Tue Feb  3 19:45:17 2004
@@ -48,8 +48,7 @@
 static inline void _raw_spin_unlock(spinlock_t *lock)
 {
 #ifdef CONFIG_DEBUG_SPINLOCK
-	if (!spin_is_locked(lock))
-		BUG();
+	BUG_ON(!spin_is_locked(lock));
 #endif
 
 	lock->lock = 0;
@@ -70,9 +69,10 @@
 	atomic_t counter;
 } rwlock_t;
 
-#define RW_LOCK_UNLOCKED	(rwlock_t) { { 0 } }
+#define RW_LOCK_BIAS		0x01000000
+#define RW_LOCK_UNLOCKED	(rwlock_t) { { 0 }, { RW_LOCK_BIAS } }
 #define rwlock_init(x)		do { *(x) = RW_LOCK_UNLOCKED; } while (0)
-#define rwlock_is_locked(x)	(*(volatile int *)(x) != 0)
+#define rwlock_is_locked(x)	(atomic_read(&(x)->counter) != RW_LOCK_BIAS)
 
 static inline void _raw_read_lock(rwlock_t *rw)
 {
@@ -102,6 +102,16 @@
 {
 	atomic_set(&rw->counter, 0);
 	_raw_spin_unlock(&rw->lock);
+}
+
+static inline int _raw_write_trylock(rwlock_t *rw)
+{
+	if (atomic_sub_and_test(RW_LOCK_BIAS, &rw->counter))
+		return 1;
+	
+	atomic_add(RW_LOCK_BIAS, &rw->counter);
+
+	return 0;
 }
 
 #endif /* __ASM_SH_SPINLOCK_H */
diff -Nru a/include/asm-sh/system.h b/include/asm-sh/system.h
--- a/include/asm-sh/system.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-sh/system.h	Tue Feb  3 19:45:42 2004
@@ -14,7 +14,7 @@
  */
 
 #define switch_to(prev, next, last) do {				\
- register unsigned long __dummy;					\
+ task_t *__last;							\
  register unsigned long *__ts1 __asm__ ("r1") = &prev->thread.sp;	\
  register unsigned long *__ts2 __asm__ ("r2") = &prev->thread.pc;	\
  register unsigned long *__ts4 __asm__ ("r4") = (unsigned long *)prev;	\
@@ -51,10 +51,11 @@
 		       "mov.l	@r15+, r8\n\t"				\
 		       "lds.l	@r15+, pr\n\t"				\
 		       "ldc.l	@r15+, gbr\n\t"				\
-		       : "=z" (__dummy)					\
+		       : "=z" (__last)					\
 		       : "r" (__ts1), "r" (__ts2), "r" (__ts4), 	\
 			 "r" (__ts5), "r" (__ts6), "r" (__ts7) 		\
 		       : "r3", "t");					\
+	last = __last;							\
 } while (0)
 
 #define nop() __asm__ __volatile__ ("nop")
diff -Nru a/include/asm-sh/systemh/7751systemh.h b/include/asm-sh/systemh/7751systemh.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sh/systemh/7751systemh.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,68 @@
+#ifndef __ASM_SH_SYSTEMH_7751SYSTEMH_H
+#define __ASM_SH_SYSTEMH_7751SYSTEMH_H
+
+/*
+ * linux/include/asm-sh/systemh/7751systemh.h
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * Hitachi SystemH support
+
+ * Modified for 7751 SystemH by
+ * Jonathan Short, 2002.
+ */
+
+/* Box specific addresses.  */
+
+#define PA_ROM		0x00000000	/* EPROM */
+#define PA_ROM_SIZE	0x00400000	/* EPROM size 4M byte */
+#define PA_FROM		0x01000000	/* EPROM */
+#define PA_FROM_SIZE	0x00400000	/* EPROM size 4M byte */
+#define PA_EXT1		0x04000000
+#define PA_EXT1_SIZE	0x04000000
+#define PA_EXT2		0x08000000
+#define PA_EXT2_SIZE	0x04000000
+#define PA_SDRAM	0x0c000000
+#define PA_SDRAM_SIZE	0x04000000
+
+#define PA_EXT4		0x12000000
+#define PA_EXT4_SIZE	0x02000000
+#define PA_EXT5		0x14000000
+#define PA_EXT5_SIZE	0x04000000
+#define PA_PCIC		0x18000000	/* MR-SHPC-01 PCMCIA */
+
+#define PA_DIPSW0	0xb9000000	/* Dip switch 5,6 */
+#define PA_DIPSW1	0xb9000002	/* Dip switch 7,8 */
+#define PA_LED		0xba000000	/* LED */
+#define	PA_BCR		0xbb000000	/* FPGA on the MS7751SE01 */
+
+#define PA_MRSHPC	0xb83fffe0	/* MR-SHPC-01 PCMCIA controler */
+#define PA_MRSHPC_MW1	0xb8400000	/* MR-SHPC-01 memory window base */
+#define PA_MRSHPC_MW2	0xb8500000	/* MR-SHPC-01 attribute window base */
+#define PA_MRSHPC_IO	0xb8600000	/* MR-SHPC-01 I/O window base */
+#define MRSHPC_MODE     (PA_MRSHPC + 4)
+#define MRSHPC_OPTION   (PA_MRSHPC + 6)
+#define MRSHPC_CSR      (PA_MRSHPC + 8)
+#define MRSHPC_ISR      (PA_MRSHPC + 10)
+#define MRSHPC_ICR      (PA_MRSHPC + 12)
+#define MRSHPC_CPWCR    (PA_MRSHPC + 14)
+#define MRSHPC_MW0CR1   (PA_MRSHPC + 16)
+#define MRSHPC_MW1CR1   (PA_MRSHPC + 18)
+#define MRSHPC_IOWCR1   (PA_MRSHPC + 20)
+#define MRSHPC_MW0CR2   (PA_MRSHPC + 22)
+#define MRSHPC_MW1CR2   (PA_MRSHPC + 24)
+#define MRSHPC_IOWCR2   (PA_MRSHPC + 26)
+#define MRSHPC_CDCR     (PA_MRSHPC + 28)
+#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
+
+#define BCR_ILCRA	(PA_BCR + 0)
+#define BCR_ILCRB	(PA_BCR + 2)
+#define BCR_ILCRC	(PA_BCR + 4)
+#define BCR_ILCRD	(PA_BCR + 6)
+#define BCR_ILCRE	(PA_BCR + 8)
+#define BCR_ILCRF	(PA_BCR + 10)
+#define BCR_ILCRG	(PA_BCR + 12)
+
+#define IRQ_79C973	13
+
+#endif  /* __ASM_SH_SYSTEMH_7751SYSTEMH_H */
diff -Nru a/include/asm-sh/systemh/io.h b/include/asm-sh/systemh/io.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sh/systemh/io.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,43 @@
+/*
+ * include/asm-sh/systemh/io.h
+ *
+ * Stupid I/O definitions for SystemH, cloned from SE7751.
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_SH_SYSTEMH_IO_H
+#define __ASM_SH_SYSTEMH_IO_H
+
+extern unsigned char sh7751systemh_inb(unsigned long port);
+extern unsigned short sh7751systemh_inw(unsigned long port);
+extern unsigned int sh7751systemh_inl(unsigned long port);
+
+extern void sh7751systemh_outb(unsigned char value, unsigned long port);
+extern void sh7751systemh_outw(unsigned short value, unsigned long port);
+extern void sh7751systemh_outl(unsigned int value, unsigned long port);
+
+extern unsigned char sh7751systemh_inb_p(unsigned long port);
+extern void sh7751systemh_outb_p(unsigned char value, unsigned long port);
+
+extern void sh7751systemh_insb(unsigned long port, void *addr, unsigned long count);
+extern void sh7751systemh_insw(unsigned long port, void *addr, unsigned long count);
+extern void sh7751systemh_insl(unsigned long port, void *addr, unsigned long count);
+extern void sh7751systemh_outsb(unsigned long port, const void *addr, unsigned long count);
+extern void sh7751systemh_outsw(unsigned long port, const void *addr, unsigned long count);
+extern void sh7751systemh_outsl(unsigned long port, const void *addr, unsigned long count);
+
+extern unsigned char sh7751systemh_readb(unsigned long addr);
+extern unsigned short sh7751systemh_readw(unsigned long addr);
+extern unsigned int sh7751systemh_readl(unsigned long addr);
+extern void sh7751systemh_writeb(unsigned char b, unsigned long addr);
+extern void sh7751systemh_writew(unsigned short b, unsigned long addr);
+extern void sh7751systemh_writel(unsigned int b, unsigned long addr);
+
+extern unsigned long sh7751systemh_isa_port2addr(unsigned long offset);
+
+#endif /* __ASM_SH_SYSTEMH_IO_H */
+
diff -Nru a/include/asm-sh/timex.h b/include/asm-sh/timex.h
--- a/include/asm-sh/timex.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-sh/timex.h	Tue Feb  3 19:45:16 2004
@@ -6,7 +6,7 @@
 #ifndef __ASM_SH_TIMEX_H
 #define __ASM_SH_TIMEX_H
 
-#define CLOCK_TICK_RATE	(current_cpu_data.module_clock/4) /* Underlying HZ */
+#define CLOCK_TICK_RATE		(CONFIG_SH_PCLK_FREQ / 4) /* Underlying HZ */
 #define CLOCK_TICK_FACTOR	20	/* Factor of both 1000000 and CLOCK_TICK_RATE */
 #define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
 	(1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
diff -Nru a/include/asm-sh/uaccess.h b/include/asm-sh/uaccess.h
--- a/include/asm-sh/uaccess.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-sh/uaccess.h	Tue Feb  3 19:45:17 2004
@@ -1,4 +1,4 @@
-/* $Id: uaccess.h,v 1.9 2003/05/06 23:28:51 lethal Exp $
+/* $Id: uaccess.h,v 1.11 2003/10/13 07:21:20 lethal Exp $
  *
  * User space memory access functions
  *
@@ -140,13 +140,13 @@
 }
 #endif /* CONFIG_MMU */
 
-static inline int access_ok(int type, const void *p, unsigned long size)
+static inline int access_ok(int type, const void __user *p, unsigned long size)
 {
 	unsigned long addr = (unsigned long)p;
 	return __access_ok(addr, size);
 }
 
-static inline int verify_area(int type, const void * addr, unsigned long size)
+static inline int verify_area(int type, const void __user * addr, unsigned long size)
 {
 	return access_ok(type,addr,size) ? 0 : -EFAULT;
 }
@@ -171,40 +171,64 @@
  * doing multiple accesses to the same area (the user has to do the
  * checks by hand with "access_ok()")
  */
-#define __put_user(x,ptr) __put_user_nocheck((x),(ptr),sizeof(*(ptr)))
-#define __get_user(x,ptr) __get_user_nocheck((x),(ptr),sizeof(*(ptr)))
+#define __put_user(x,ptr) \
+  __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
+#define __get_user(x,ptr) \
+  __get_user_nocheck((x),(ptr),sizeof(*(ptr)))
 
 struct __large_struct { unsigned long buf[100]; };
 #define __m(x) (*(struct __large_struct *)(x))
 
-#define __get_user_nocheck(x,ptr,size) ({ \
-long __gu_err; \
-__typeof(*(ptr)) __gu_val; \
-long __gu_addr; \
-__asm__("":"=r" (__gu_val)); \
-__gu_addr = (long) (ptr); \
-__asm__("":"=r" (__gu_err)); \
-switch (size) { \
-case 1: __get_user_asm("b"); break; \
-case 2: __get_user_asm("w"); break; \
-case 4: __get_user_asm("l"); break; \
-default: __get_user_unknown(); break; \
-} x = (__typeof__(*(ptr))) __gu_val; __gu_err; })
-
-#define __get_user_check(x,ptr,size)			\
-({ __typeof__(*(ptr)) __val; long __err;		\
- switch(size) {						\
- case 1: __err = __get_user_1(__val, ptr); break;	\
- case 2: __err = __get_user_2(__val, ptr); break;	\
- case 4: __err = __get_user_4(__val, ptr); break;	\
- default: __get_user_unknown(); break;			\
- }							\
- (x) = __val; __err; })
-
-#define __get_user_1(x,ptr) ({			\
-long __gu_err;					\
-__typeof__(*(ptr)) __gu_val;			\
-long __gu_addr = (long) (ptr);			\
+#define __get_user_size(x,ptr,size,retval)			\
+do {								\
+	retval = 0;						\
+	switch (size) {						\
+	case 1:							\
+		__get_user_asm(x, ptr, retval, "b");		\
+		break;						\
+	case 2:							\
+		__get_user_asm(x, ptr, retval, "w");		\
+		break;						\
+	case 4:							\
+		__get_user_asm(x, ptr, retval, "l");		\
+		break;						\
+	default:						\
+		__get_user_unknown();				\
+		break;						\
+	}							\
+} while (0)
+
+#define __get_user_nocheck(x,ptr,size)				\
+({								\
+	long __gu_err, __gu_val;				\
+	__get_user_size(__gu_val, (ptr), (size), __gu_err);	\
+	(x) = (__typeof__(*(ptr)))__gu_val;			\
+	__gu_err;						\
+})
+
+#define __get_user_check(x,ptr,size)				\
+({								\
+	long __gu_err, __gu_val;				\
+	switch (size) {						\
+	case 1:							\
+		__get_user_1(__gu_val, (ptr), __gu_err);	\
+		break;						\
+	case 2:							\
+		__get_user_2(__gu_val, (ptr), __gu_err);	\
+		break;						\
+	case 4:							\
+		__get_user_4(__gu_val, (ptr), __gu_err);	\
+		break;						\
+	default:						\
+		__get_user_unknown();				\
+		break;						\
+	}							\
+								\
+	(x) = (__typeof__(*(ptr)))__gu_val;			\
+	__gu_err;						\
+})
+
+#define __get_user_1(x,addr,err) ({		\
 __asm__("stc	r7_bank, %1\n\t"		\
 	"mov.l	@(8,%1), %1\n\t"		\
 	"and	%2, %1\n\t"			\
@@ -222,15 +246,12 @@
 	".section	__ex_table,\"a\"\n\t"	\
 	".long	1b, 0b\n\t"			\
 	".previous"				\
-	: "=&r" (__gu_err), "=&r" (__gu_val)	\
-	: "r" (__gu_addr)			\
+	: "=&r" (err), "=&r" (x)		\
+	: "r" (addr)				\
 	: "t");					\
-x = (__typeof__(*(ptr))) __gu_val; __gu_err; })
+})
 
-#define __get_user_2(x,ptr) ({			\
-long __gu_err;					\
-__typeof__(*(ptr)) __gu_val;			\
-long __gu_addr = (long) (ptr);			\
+#define __get_user_2(x,addr,err) ({		\
 __asm__("stc	r7_bank, %1\n\t"		\
 	"mov.l	@(8,%1), %1\n\t"		\
 	"and	%2, %1\n\t"			\
@@ -248,15 +269,12 @@
 	".section	__ex_table,\"a\"\n\t"	\
 	".long	1b, 0b\n\t"			\
 	".previous"				\
-	: "=&r" (__gu_err), "=&r" (__gu_val)	\
-	: "r" (__gu_addr)			\
+	: "=&r" (err), "=&r" (x)		\
+	: "r" (addr)				\
 	: "t");					\
-x = (__typeof__(*(ptr))) __gu_val; __gu_err; })
+})
 
-#define __get_user_4(x,ptr) ({			\
-long __gu_err;					\
-__typeof__(*(ptr)) __gu_val;			\
-long __gu_addr = (long) (ptr);			\
+#define __get_user_4(x,addr,err) ({		\
 __asm__("stc	r7_bank, %1\n\t"		\
 	"mov.l	@(8,%1), %1\n\t"		\
 	"and	%2, %1\n\t"			\
@@ -273,12 +291,12 @@
 	".section	__ex_table,\"a\"\n\t"	\
 	".long	1b, 0b\n\t"			\
 	".previous"				\
-	: "=&r" (__gu_err), "=&r" (__gu_val)	\
-	: "r" (__gu_addr)			\
+	: "=&r" (err), "=&r" (x)		\
+	: "r" (addr)				\
 	: "t");					\
-x = (__typeof__(*(ptr))) __gu_val; __gu_err; })
+})
 
-#define __get_user_asm(insn) \
+#define __get_user_asm(x, addr, err, insn) \
 ({ \
 __asm__ __volatile__( \
 	"1:\n\t" \
@@ -296,43 +314,50 @@
 	".section	__ex_table,\"a\"\n\t" \
 	".long	1b, 3b\n\t" \
 	".previous" \
-	:"=&r" (__gu_err), "=&r" (__gu_val) \
-	:"m" (__m(__gu_addr)), "i" (-EFAULT)); })
+	:"=&r" (err), "=&r" (x) \
+	:"m" (__m(addr)), "i" (-EFAULT)); })
 
 extern void __get_user_unknown(void);
 
-#define __put_user_nocheck(x,ptr,size) ({ \
-long __pu_err; \
-__typeof__(*(ptr)) __pu_val; \
-long __pu_addr; \
-__pu_val = (x); \
-__pu_addr = (long) (ptr); \
-__asm__("":"=r" (__pu_err)); \
-switch (size) { \
-case 1: __put_user_asm("b"); break; \
-case 2: __put_user_asm("w"); break; \
-case 4: __put_user_asm("l"); break; \
-case 8: __put_user_u64(__pu_val,__pu_addr,__pu_err); break; \
-default: __put_user_unknown(); break; \
-} __pu_err; })
-
-#define __put_user_check(x,ptr,size) ({ \
-long __pu_err; \
-__typeof__(*(ptr)) __pu_val; \
-long __pu_addr; \
-__pu_val = (x); \
-__pu_addr = (long) (ptr); \
-__asm__("":"=r" (__pu_err)); \
-if (__access_ok(__pu_addr,size)) { \
-switch (size) { \
-case 1: __put_user_asm("b"); break; \
-case 2: __put_user_asm("w"); break; \
-case 4: __put_user_asm("l"); break; \
-case 8: __put_user_u64(__pu_val,__pu_addr,__pu_err); break; \
-default: __put_user_unknown(); break; \
-} } __pu_err; })
+#define __put_user_size(x,ptr,size,retval)		\
+do {							\
+	retval = 0;					\
+	switch (size) {					\
+	case 1:						\
+		__put_user_asm(x, ptr, retval, "b");	\
+		break;					\
+	case 2:						\
+		__put_user_asm(x, ptr, retval, "w");	\
+		break;					\
+	case 4:						\
+		__put_user_asm(x, ptr, retval, "l");	\
+		break;					\
+	case 8:						\
+		__put_user_u64(x, ptr, retval);		\
+		break;					\
+	default:					\
+		__put_user_unknown();			\
+	}						\
+} while (0)
+
+#define __put_user_nocheck(x,ptr,size)			\
+({							\
+	long __pu_err;					\
+	__put_user_size((x),(ptr),(size),__pu_err);	\
+	__pu_err;					\
+})
+
+#define __put_user_check(x,ptr,size)				\
+({								\
+	long __pu_err = -EFAULT;				\
+	__typeof__(*(ptr)) *__pu_addr = (ptr);			\
+								\
+	if (__access_ok((unsigned long)__pu_addr,size))		\
+		__put_user_size((x),__pu_addr,(size),__pu_err);	\
+	__pu_err;						\
+})
 
-#define __put_user_asm(insn) \
+#define __put_user_asm(x, addr, err, insn) \
 ({ \
 __asm__ __volatile__( \
 	"1:\n\t" \
@@ -350,8 +375,8 @@
 	".section	__ex_table,\"a\"\n\t" \
 	".long	1b, 3b\n\t" \
 	".previous" \
-	:"=&r" (__pu_err) \
-	:"r" (__pu_val), "m" (__m(__pu_addr)), "i" (-EFAULT) \
+	:"=&r" (err) \
+	:"r" (x), "m" (__m(addr)), "i" (-EFAULT) \
         :"memory"); })
 
 #if defined(__LITTLE_ENDIAN__)
@@ -449,7 +474,7 @@
 __cl_size; })
 
 static __inline__ int
-__strncpy_from_user(unsigned long __dest, unsigned long __src, int __count)
+__strncpy_from_user(unsigned long __dest, unsigned long __user __src, int __count)
 {
 	__kernel_size_t res;
 	unsigned long __dummy, _d, _s;
@@ -498,7 +523,7 @@
 /*
  * Return the size of a string (including the ending 0!)
  */
-static __inline__ long __strnlen_user(const char *__s, long __n)
+static __inline__ long __strnlen_user(const char __user *__s, long __n)
 {
 	unsigned long res;
 	unsigned long __dummy;
@@ -531,7 +556,7 @@
 	return res;
 }
 
-static __inline__ long strnlen_user(const char *s, long n)
+static __inline__ long strnlen_user(const char __user *s, long n)
 {
 	if (!access_ok(VERIFY_READ, s, n))
 		return 0;
@@ -539,7 +564,7 @@
 		return __strnlen_user(s, n);
 }
 
-static __inline__ long strlen_user(const char *s)
+static __inline__ long strlen_user(const char __user *s)
 {
 	if (!access_ok(VERIFY_READ, s, 0))
 		return 0;
@@ -547,9 +572,24 @@
 		return __strnlen_user(s, ~0UL >> 1);
 }
 
+/*
+ * The exception table consists of pairs of addresses: the first is the
+ * address of an instruction that is allowed to fault, and the second is
+ * the address at which the program should continue.  No registers are
+ * modified, so it is entirely up to the continuation code to figure out
+ * what to do.
+ *
+ * All the routines below use bits of fixup code that are out of line
+ * with the main instruction path.  This means when everything is well,
+ * we don't even have to jump over them.  Further, they do not intrude
+ * on our cache or tlb entries.
+ */
+
 struct exception_table_entry
 {
 	unsigned long insn, fixup;
 };
+
+extern int fixup_exception(struct pt_regs *regs);
 
 #endif /* __ASM_SH_UACCESS_H */
diff -Nru a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h
--- a/include/asm-sh/unistd.h	Tue Feb  3 19:45:41 2004
+++ b/include/asm-sh/unistd.h	Tue Feb  3 19:45:41 2004
@@ -275,8 +275,14 @@
 #define __NR_clock_gettime	(__NR_timer_create+6)
 #define __NR_clock_getres	(__NR_timer_create+7)
 #define __NR_clock_nanosleep	(__NR_timer_create+8)
+#define __NR_statfs64		268
+#define __NR_fstatfs64		269
+#define __NR_tgkill		270
+#define __NR_utimes		271
+#define __NR_fadvise64_64	272
+#define __NR_vserver		273
 
-#define NR_syscalls 268
+#define NR_syscalls 274
 
 /* user-visible error numbers are in the range -1 - -124: see <asm-sh/errno.h> */
 
@@ -435,6 +441,8 @@
  * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
  * but it doesn't work on all toolchains, so we just do it by hand
  */
+#ifndef cond_syscall
 #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall");
+#endif
 
 #endif /* __ASM_SH_UNISTD_H */
diff -Nru a/include/asm-sparc/elf.h b/include/asm-sparc/elf.h
--- a/include/asm-sparc/elf.h	Tue Feb  3 19:45:37 2004
+++ b/include/asm-sparc/elf.h	Tue Feb  3 19:45:37 2004
@@ -8,8 +8,11 @@
 
 #include <linux/config.h>
 #include <asm/ptrace.h>
+
+#ifdef __KERNEL__
 #include <asm/mbus.h>
 #include <asm/uaccess.h>
+#endif
 
 /*
  * Sparc section types
diff -Nru a/include/asm-sparc/highmem.h b/include/asm-sparc/highmem.h
--- a/include/asm-sparc/highmem.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-sparc/highmem.h	Tue Feb  3 19:45:43 2004
@@ -38,10 +38,12 @@
 /*
  * Right now we initialize only a single pte table. It can be extended
  * easily, subsequent pte tables have to be allocated in one physical
- * chunk of RAM.
+ * chunk of RAM.  Currently the simplest way to do this is to align the
+ * pkmap region on a pagetable boundary (4MB).
  */
-#define PKMAP_BASE (SRMMU_NOCACHE_VADDR + (SRMMU_MAX_NOCACHE_PAGES << PAGE_SHIFT))
 #define LAST_PKMAP 1024
+#define PKMAP_SIZE (LAST_PKMAP << PAGE_SHIFT)
+#define PKMAP_BASE SRMMU_PMD_ALIGN_SOFT(SRMMU_NOCACHE_VADDR + (SRMMU_MAX_NOCACHE_PAGES << PAGE_SHIFT))
 
 #define LAST_PKMAP_MASK (LAST_PKMAP - 1)
 #define PKMAP_NR(virt)  ((virt - PKMAP_BASE) >> PAGE_SHIFT)
diff -Nru a/include/asm-sparc/pgtsrmmu.h b/include/asm-sparc/pgtsrmmu.h
--- a/include/asm-sparc/pgtsrmmu.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-sparc/pgtsrmmu.h	Tue Feb  3 19:45:17 2004
@@ -36,6 +36,25 @@
 #define SRMMU_PMD_TABLE_SIZE    0x100 /* 64 entries, 4 bytes a piece */
 #define SRMMU_PGD_TABLE_SIZE    0x400 /* 256 entries, 4 bytes a piece */
 
+/*
+ * To support pagetables in highmem, Linux introduces APIs which
+ * return struct page* and generally manipulate page tables when
+ * they are not mapped into kernel space. Our hardware page tables
+ * are smaller than pages. We lump hardware tabes into big, page sized
+ * software tables.
+ *
+ * PMD_SHIFT determines the size of the area a second-level page table entry
+ * can map, and our pmd_t is 16 times larger than normal.
+ */
+#define SRMMU_PTRS_PER_PTE_SOFT	(PAGE_SIZE/4)	/* 16 hard tables per 4K page */
+#define SRMMU_PTRS_PER_PMD_SOFT	4	/* Each pmd_t contains 16 hard PTPs */
+#define SRMMU_PTE_SZ_SOFT       PAGE_SIZE	/* same as above, in bytes */
+
+#define SRMMU_PMD_SHIFT_SOFT	22
+#define SRMMU_PMD_SIZE_SOFT	(1UL << SRMMU_PMD_SHIFT_SOFT)
+#define SRMMU_PMD_MASK_SOFT	(~(SRMMU_PMD_SIZE_SOFT-1))
+#define SRMMU_PMD_ALIGN_SOFT(addr)  (((addr)+SRMMU_PMD_SIZE_SOFT-1)&SRMMU_PMD_MASK_SOFT)
+
 /* Definition of the values in the ET field of PTD's and PTE's */
 #define SRMMU_ET_MASK         0x3
 #define SRMMU_ET_INVALID      0x0
diff -Nru a/include/asm-sparc/socket.h b/include/asm-sparc/socket.h
--- a/include/asm-sparc/socket.h	Tue Feb  3 19:45:30 2004
+++ b/include/asm-sparc/socket.h	Tue Feb  3 19:45:30 2004
@@ -45,6 +45,8 @@
 #define SO_TIMESTAMP		0x001d
 #define SCM_TIMESTAMP		SO_TIMESTAMP
 
+#define SO_PEERSEC		0x100e
+
 /* Security levels - as per NRL IPv6 - don't actually do anything */
 #define SO_SECURITY_AUTHENTICATION		0x5001
 #define SO_SECURITY_ENCRYPTION_TRANSPORT	0x5002
diff -Nru a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h
--- a/include/asm-sparc64/floppy.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-sparc64/floppy.h	Tue Feb  3 19:45:43 2004
@@ -320,10 +320,9 @@
 
 static void sun_pci_fd_enable_dma(void)
 {
-	if ((NULL == sun_pci_dma_pending.buf) 	||
+	BUG_ON((NULL == sun_pci_dma_pending.buf) 	||
 	    (0	  == sun_pci_dma_pending.len) 	||
-	    (0	  == sun_pci_dma_pending.direction))
-		BUG();
+	    (0	  == sun_pci_dma_pending.direction));
 
 	sun_pci_dma_current.buf = sun_pci_dma_pending.buf;
 	sun_pci_dma_current.len = sun_pci_dma_pending.len;
diff -Nru a/include/asm-sparc64/io.h b/include/asm-sparc64/io.h
--- a/include/asm-sparc64/io.h	Tue Feb  3 19:45:41 2004
+++ b/include/asm-sparc64/io.h	Tue Feb  3 19:45:41 2004
@@ -19,7 +19,7 @@
 #define bus_to_virt bus_to_virt_not_defined_use_pci_map
 
 /* BIO layer definitions. */
-extern unsigned long phys_base;
+extern unsigned long phys_base, kern_base, kern_size;
 #define page_to_phys(page)	((((page) - mem_map) << PAGE_SHIFT)+phys_base)
 #define BIO_VMERGE_BOUNDARY	8192
 
diff -Nru a/include/asm-sparc64/sections.h b/include/asm-sparc64/sections.h
--- a/include/asm-sparc64/sections.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-sparc64/sections.h	Tue Feb  3 19:45:17 2004
@@ -4,4 +4,6 @@
 /* nothing to see, move along */
 #include <asm-generic/sections.h>
 
+extern char _end[], _start[];
+
 #endif
diff -Nru a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h
--- a/include/asm-sparc64/smp.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-sparc64/smp.h	Tue Feb  3 19:45:17 2004
@@ -33,7 +33,7 @@
 extern unsigned char boot_cpu_id;
 
 extern cpumask_t phys_cpu_present_map;
-#define cpu_possible(cpu)	cpu_isset(cpu, phys_cpu_present_map)
+#define cpu_possible_map phys_cpu_present_map
 
 #define cpu_online(cpu)		cpu_isset(cpu, cpu_online_map)
 
diff -Nru a/include/asm-sparc64/socket.h b/include/asm-sparc64/socket.h
--- a/include/asm-sparc64/socket.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-sparc64/socket.h	Tue Feb  3 19:45:17 2004
@@ -45,6 +45,8 @@
 #define SO_TIMESTAMP		0x001d
 #define SCM_TIMESTAMP		SO_TIMESTAMP
 
+#define SO_PEERSEC		0x001e
+
 /* Security levels - as per NRL IPv6 - don't actually do anything */
 #define SO_SECURITY_AUTHENTICATION		0x5001
 #define SO_SECURITY_ENCRYPTION_TRANSPORT	0x5002
diff -Nru a/include/asm-sparc64/tlbflush.h b/include/asm-sparc64/tlbflush.h
--- a/include/asm-sparc64/tlbflush.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-sparc64/tlbflush.h	Tue Feb  3 19:45:34 2004
@@ -90,10 +90,9 @@
 {
 	/* Note the signed type.  */
 	long s = start, e = end, vpte_base;
-	if (s > e)
 		/* Nobody should call us with start below VM hole and end above.
 		   See if it is really true.  */
-		BUG();
+	BUG_ON(s > e);
 #if 0
 	/* Currently free_pgtables guarantees this.  */
 	s &= PMD_MASK;
diff -Nru a/include/asm-um/smp.h b/include/asm-um/smp.h
--- a/include/asm-um/smp.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-um/smp.h	Tue Feb  3 19:45:16 2004
@@ -20,7 +20,7 @@
 #define cpu_online(cpu) cpu_isset(cpu, cpu_online_map)
 
 extern int ncpus;
-#define cpu_possible(cpu) (cpu < ncpus)
+
 
 extern inline void smp_cpus_done(unsigned int maxcpus)
 {
diff -Nru a/include/asm-v850/byteorder.h b/include/asm-v850/byteorder.h
--- a/include/asm-v850/byteorder.h	Tue Feb  3 19:45:37 2004
+++ b/include/asm-v850/byteorder.h	Tue Feb  3 19:45:37 2004
@@ -15,17 +15,18 @@
 #define __V850_BYTEORDER_H__
 
 #include <asm/types.h>
+#include <linux/compiler.h>
 
 #ifdef __GNUC__
 
-static __inline__ __const__ __u32 ___arch__swab32 (__u32 word)
+static __inline__ __attribute_const__ __u32 ___arch__swab32 (__u32 word)
 {
 	__u32 res;
 	__asm__ ("bsw %1, %0" : "=r" (res) : "r" (word));
 	return res;
 }
 
-static __inline__ __const__ __u16 ___arch__swab16 (__u16 half_word)
+static __inline__ __attribute_const__ __u16 ___arch__swab16 (__u16 half_word)
 {
 	__u16 res;
 	__asm__ ("bsh %1, %0" : "=r" (res) : "r" (half_word));
diff -Nru a/include/asm-v850/socket.h b/include/asm-v850/socket.h
--- a/include/asm-v850/socket.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-v850/socket.h	Tue Feb  3 19:45:17 2004
@@ -45,6 +45,8 @@
 
 #define SO_ACCEPTCONN		30
 
+#define SO_PEERSEC		31
+
 /* Nast libc5 fixup - bletch */
 #if defined(__KERNEL__)
 /* Socket types. */
diff -Nru a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h
--- a/include/asm-x86_64/acpi.h	Tue Feb  3 19:45:33 2004
+++ b/include/asm-x86_64/acpi.h	Tue Feb  3 19:45:33 2004
@@ -100,25 +100,26 @@
         :"0"(n_hi), "1"(n_lo))
 
 
-#ifndef CONFIG_ACPI_BOOT
-#define acpi_lapic 0
-#define acpi_ioapic 0
-#else
-#ifdef CONFIG_X86_LOCAL_APIC
+#ifdef CONFIG_ACPI_BOOT
 extern int acpi_lapic;
-#else
-#define acpi_lapic 0
-#endif
-#ifdef CONFIG_X86_IO_APIC
 extern int acpi_ioapic;
-#else
-#define acpi_ioapic 0
-#endif
+extern int acpi_noirq;
 
 /* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */
 #define FIX_ACPI_PAGES 4
 
-#endif /*CONFIG_ACPI_BOOT*/
+#else	/* !CONFIG_ACPI_BOOT */
+#define acpi_lapic 0
+#define acpi_ioapic 0
+#endif /* !CONFIG_ACPI_BOOT */
+
+#ifdef CONFIG_ACPI_PCI
+static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
+extern int acpi_irq_balance_set(char *str);
+#else
+static inline void acpi_noirq_set(void) { }
+static inline int acpi_irq_balance_set(char *str) { return 0; }
+#endif
 
 #ifdef CONFIG_ACPI_SLEEP
 
diff -Nru a/include/asm-x86_64/byteorder.h b/include/asm-x86_64/byteorder.h
--- a/include/asm-x86_64/byteorder.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-x86_64/byteorder.h	Tue Feb  3 19:45:34 2004
@@ -2,16 +2,17 @@
 #define _X86_64_BYTEORDER_H
 
 #include <asm/types.h>
+#include <linux/compiler.h>
 
 #ifdef __GNUC__
 
-static __inline__ __const__ __u64 ___arch__swab64(__u64 x)
+static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 x)
 {
 	__asm__("bswapq %0" : "=r" (x) : "0" (x));
 	return x;
 }
 
-static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
+static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
 {
 	__asm__("bswapl %0" : "=r" (x) : "0" (x));
 	return x;
diff -Nru a/include/asm-x86_64/calling.h b/include/asm-x86_64/calling.h
--- a/include/asm-x86_64/calling.h	Tue Feb  3 19:45:33 2004
+++ b/include/asm-x86_64/calling.h	Tue Feb  3 19:45:33 2004
@@ -33,18 +33,28 @@
 
 	.macro SAVE_ARGS addskip=0,norcx=0 	
 	subq  $9*8+\addskip,%rsp
+	CFI_ADJUST_CFA_OFFSET	9*8+\addskip
 	movq  %rdi,8*8(%rsp) 
+	CFI_OFFSET	rdi,8*8-(9*8+\addskip)
 	movq  %rsi,7*8(%rsp) 
+	CFI_OFFSET	rsi,7*8-(9*8+\addskip)
 	movq  %rdx,6*8(%rsp)
+	CFI_OFFSET	rdx,6*8-(9*8+\addskip)
 	.if \norcx
 	.else
 	movq  %rcx,5*8(%rsp)
+	CFI_OFFSET	rcx,5*8-(9*8+\addskip)
 	.endif
 	movq  %rax,4*8(%rsp) 
+	CFI_OFFSET	rax,4*8-(9*8+\addskip)
 	movq  %r8,3*8(%rsp) 
+	CFI_OFFSET	r8,3*8-(9*8+\addskip)
 	movq  %r9,2*8(%rsp) 
+	CFI_OFFSET	r9,2*8-(9*8+\addskip)
 	movq  %r10,1*8(%rsp) 
+	CFI_OFFSET	r10,1*8-(9*8+\addskip)
 	movq  %r11,(%rsp) 
+	CFI_OFFSET	r11,-(9*8+\addskip)
 	.endm
 
 #define ARG_SKIP 9*8
@@ -69,6 +79,7 @@
 	movq 8*8(%rsp),%rdi
 	.if ARG_SKIP+\addskip > 0
 	addq $ARG_SKIP+\addskip,%rsp
+	CFI_ADJUST_CFA_OFFSET	-(ARG_SKIP+\addskip)
 	.endif
 	.endm	
 
@@ -87,12 +98,19 @@
 #define REST_SKIP 6*8			
 	.macro SAVE_REST
 	subq $REST_SKIP,%rsp
+	CFI_ADJUST_CFA_OFFSET	REST_SKIP
 	movq %rbx,5*8(%rsp) 
+	CFI_OFFSET	rbx,5*8-(REST_SKIP)
 	movq %rbp,4*8(%rsp) 
+	CFI_OFFSET	rbp,4*8-(REST_SKIP)
 	movq %r12,3*8(%rsp) 
+	CFI_OFFSET	r12,3*8-(REST_SKIP)
 	movq %r13,2*8(%rsp) 
+	CFI_OFFSET	r13,2*8-(REST_SKIP)
 	movq %r14,1*8(%rsp) 
+	CFI_OFFSET	r14,1*8-(REST_SKIP)
 	movq %r15,(%rsp) 
+	CFI_OFFSET	r15,0*8-(REST_SKIP)
 	.endm		
 
 	.macro RESTORE_REST
@@ -103,6 +121,7 @@
 	movq 4*8(%rsp),%rbp
 	movq 5*8(%rsp),%rbx
 	addq $REST_SKIP,%rsp
+	CFI_ADJUST_CFA_OFFSET	-(REST_SKIP)
 	.endm
 		
 	.macro SAVE_ALL
diff -Nru a/include/asm-x86_64/desc.h b/include/asm-x86_64/desc.h
--- a/include/asm-x86_64/desc.h	Tue Feb  3 19:45:43 2004
+++ b/include/asm-x86_64/desc.h	Tue Feb  3 19:45:43 2004
@@ -118,6 +118,7 @@
 	d.base1 = PTR_MIDDLE(tss) & 0xFF; 
 	d.type = type;
 	d.p = 1; 
+	d.g = 1;
 	d.limit1 = (size >> 16) & 0xF;
 	d.base2 = (PTR_MIDDLE(tss) >> 8) & 0xFF; 
 	d.base3 = PTR_HIGH(tss); 
diff -Nru a/include/asm-x86_64/dwarf2.h b/include/asm-x86_64/dwarf2.h
--- a/include/asm-x86_64/dwarf2.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-x86_64/dwarf2.h	Tue Feb  3 19:45:16 2004
@@ -14,7 +14,7 @@
    away for older version. 
  */
 
-#ifdef CONFIG_CFI_BINUTILS
+#ifdef CONFIG_DEBUG_INFO
 
 #define CFI_STARTPROC .cfi_startproc
 #define CFI_ENDPROC .cfi_endproc
@@ -27,23 +27,15 @@
 
 #else
 
-#ifdef __ASSEMBLY__
-	.macro nothing
-	.endm
-	.macro nothing1 a
-	.endm
-	.macro nothing2 a,b
-	.endm      
-#endif
-
-#define CFI_STARTPROC nothing
-#define CFI_ENDPROC nothing
-#define CFI_DEF_CFA nothing2
-#define CFI_DEF_CFA_REGISTER nothing1
-#define CFI_DEF_CFA_OFFSET nothing1
-#define CFI_ADJUST_CFA_OFFSET nothing1
-#define CFI_OFFSET nothing2
-#define CFI_REL_OFFSET nothing2
+/* use assembler line comment character # to ignore the arguments. */
+#define CFI_STARTPROC	#
+#define CFI_ENDPROC	#
+#define CFI_DEF_CFA	#
+#define CFI_DEF_CFA_REGISTER	#
+#define CFI_DEF_CFA_OFFSET	#
+#define CFI_ADJUST_CFA_OFFSET	#
+#define CFI_OFFSET	#
+#define CFI_REL_OFFSET	#
 
 #endif
 
diff -Nru a/include/asm-x86_64/floppy.h b/include/asm-x86_64/floppy.h
--- a/include/asm-x86_64/floppy.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-x86_64/floppy.h	Tue Feb  3 19:45:17 2004
@@ -32,7 +32,7 @@
 
 
 #define fd_inb(port)			inb_p(port)
-#define fd_outb(port,value)		outb_p(port,value)
+#define fd_outb(value,port)		outb_p(value,port)
 
 #define fd_request_dma()        CSW._request_dma(FLOPPY_DMA,"floppy")
 #define fd_free_dma()           CSW._free_dma(FLOPPY_DMA)
diff -Nru a/include/asm-x86_64/hpet.h b/include/asm-x86_64/hpet.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-x86_64/hpet.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,59 @@
+#ifndef _ASM_X8664_HPET_H
+#define _ASM_X8664_HPET_H 1
+
+#include <linux/interrupt.h>
+
+/*
+ * Documentation on HPET can be found at:
+ *      http://www.intel.com/ial/home/sp/pcmmspec.htm
+ *      ftp://download.intel.com/ial/home/sp/mmts098.pdf
+ */
+
+#define HPET_MMAP_SIZE	1024
+
+#define HPET_ID		0x000
+#define HPET_PERIOD	0x004
+#define HPET_CFG	0x010
+#define HPET_STATUS	0x020
+#define HPET_COUNTER	0x0f0
+#define HPET_T0_CFG	0x100
+#define HPET_T0_CMP	0x108
+#define HPET_T0_ROUTE	0x110
+#define HPET_T1_CFG	0x120
+#define HPET_T1_CMP	0x128
+#define HPET_T1_ROUTE	0x130
+#define HPET_T2_CFG	0x140
+#define HPET_T2_CMP	0x148
+#define HPET_T2_ROUTE	0x150
+
+#define HPET_ID_VENDOR	0xffff0000
+#define HPET_ID_LEGSUP	0x00008000
+#define HPET_ID_NUMBER	0x00001f00
+#define HPET_ID_REV	0x000000ff
+
+#define HPET_ID_VENDOR_SHIFT	16
+#define HPET_ID_VENDOR_8086	0x8086
+
+#define HPET_CFG_ENABLE	0x001
+#define HPET_CFG_LEGACY	0x002
+
+#define HPET_TN_ENABLE		0x004
+#define HPET_TN_PERIODIC	0x008
+#define HPET_TN_PERIODIC_CAP	0x010
+#define HPET_TN_SETVAL		0x040
+#define HPET_TN_32BIT		0x100
+
+extern int is_hpet_enabled(void);
+extern int hpet_rtc_timer_init(void);
+
+#ifdef CONFIG_HPET_EMULATE_RTC
+extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask);
+extern int hpet_set_rtc_irq_bit(unsigned long bit_mask);
+extern int hpet_set_alarm_time(unsigned char hrs, unsigned char min, unsigned char sec);
+extern int hpet_set_periodic_freq(unsigned long freq);
+extern int hpet_rtc_dropped_irq(void);
+extern int hpet_rtc_timer_init(void);
+extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+#endif /* CONFIG_HPET_EMULATE_RTC */
+
+#endif
diff -Nru a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h
--- a/include/asm-x86_64/hw_irq.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-x86_64/hw_irq.h	Tue Feb  3 19:45:42 2004
@@ -106,8 +106,6 @@
 extern atomic_t irq_err_count;
 extern atomic_t irq_mis_count;
 
-extern char _stext, _etext;
-
 #define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
 
 #define __STR(x) #x
diff -Nru a/include/asm-x86_64/ia32.h b/include/asm-x86_64/ia32.h
--- a/include/asm-x86_64/ia32.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-x86_64/ia32.h	Tue Feb  3 19:45:42 2004
@@ -100,8 +100,11 @@
 
 		/* POSIX.1b timers */
 		struct {
-			unsigned int _timer1;
-			unsigned int _timer2;
+			int _tid;		/* timer id */
+			int _overrun;		/* overrun count */
+			sigval_t32 _sigval;	/* same as below */
+			int _sys_private;	/* not to be passed to user */
+			int _overrun_incr;	/* amount to add to overrun */
 		} _timer;
 
 		/* POSIX.1b signals */
@@ -164,9 +167,12 @@
 
 #ifdef __KERNEL__
 struct user_desc;
+struct siginfo_t;
 int do_get_thread_area(struct thread_struct *t, struct user_desc *u_info);
 int do_set_thread_area(struct thread_struct *t, struct user_desc *u_info);
 int ia32_child_tls(struct task_struct *p, struct pt_regs *childregs);
+int ia32_copy_siginfo_from_user(siginfo_t *to, siginfo_t32 __user *from);
+int ia32_copy_siginfo_to_user(siginfo_t32 __user *to, siginfo_t *from);
 #endif
 
 #endif /* !CONFIG_IA32_SUPPORT */
diff -Nru a/include/asm-x86_64/kdebug.h b/include/asm-x86_64/kdebug.h
--- a/include/asm-x86_64/kdebug.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-x86_64/kdebug.h	Tue Feb  3 19:45:17 2004
@@ -31,6 +31,7 @@
 	DIE_TRAP,
 	DIE_GPF,
 	DIE_CALL,
+	DIE_NMI_IPI,
 }; 
 	
 static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig)
diff -Nru a/include/asm-x86_64/mc146818rtc.h b/include/asm-x86_64/mc146818rtc.h
--- a/include/asm-x86_64/mc146818rtc.h	Tue Feb  3 19:45:29 2004
+++ b/include/asm-x86_64/mc146818rtc.h	Tue Feb  3 19:45:29 2004
@@ -24,11 +24,6 @@
 outb_p((val),RTC_PORT(1)); \
 })
 
-#ifndef CONFIG_HPET_TIMER
 #define RTC_IRQ 8
-#else
-/* Temporary workaround due to IRQ routing problem. */
-#define RTC_IRQ 0
-#endif
 
 #endif /* _ASM_MC146818RTC_H */
diff -Nru a/include/asm-x86_64/pgalloc.h b/include/asm-x86_64/pgalloc.h
--- a/include/asm-x86_64/pgalloc.h	Tue Feb  3 19:45:28 2004
+++ b/include/asm-x86_64/pgalloc.h	Tue Feb  3 19:45:28 2004
@@ -24,8 +24,7 @@
 
 extern __inline__ void pmd_free(pmd_t *pmd)
 {
-	if ((unsigned long)pmd & (PAGE_SIZE-1)) 
-		BUG(); 
+	BUG_ON((unsigned long)pmd & (PAGE_SIZE-1));
 	free_page((unsigned long)pmd);
 }
 
@@ -41,8 +40,7 @@
 
 static inline void pgd_free (pgd_t *pgd)
 {
-	if ((unsigned long)pgd & (PAGE_SIZE-1)) 
-		BUG(); 
+	BUG_ON((unsigned long)pgd & (PAGE_SIZE-1));
 	free_page((unsigned long)pgd);
 }
 
@@ -64,8 +62,7 @@
 
 extern __inline__ void pte_free_kernel(pte_t *pte)
 {
-	if ((unsigned long)pte & (PAGE_SIZE-1))
-		BUG();
+	BUG_ON((unsigned long)pte & (PAGE_SIZE-1));
 	free_page((unsigned long)pte); 
 }
 
diff -Nru a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
--- a/include/asm-x86_64/pgtable.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-x86_64/pgtable.h	Tue Feb  3 19:45:34 2004
@@ -411,4 +411,12 @@
 #define	kc_offset_to_vaddr(o) \
    (((o) & (1UL << (__VIRTUAL_MASK_SHIFT-1))) ? ((o) | (~__VIRTUAL_MASK)) : (o))
 
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
+#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
+#define __HAVE_ARCH_PTEP_SET_WRPROTECT
+#define __HAVE_ARCH_PTEP_MKDIRTY
+#define __HAVE_ARCH_PTE_SAME
+#include <asm-generic/pgtable.h>
+
 #endif /* _X86_64_PGTABLE_H */
diff -Nru a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h
--- a/include/asm-x86_64/processor.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-x86_64/processor.h	Tue Feb  3 19:45:42 2004
@@ -173,7 +173,7 @@
  * space during mmap's.
  */
 #define IA32_PAGE_OFFSET ((current->personality & ADDR_LIMIT_3GB) ? 0xc0000000 : 0xFFFFe000)
-#define TASK_UNMAPPED_32 (IA32_PAGE_OFFSET / 3)
+#define TASK_UNMAPPED_32 (PAGE_ALIGN(IA32_PAGE_OFFSET / 3))
 #define TASK_UNMAPPED_64 PAGE_ALIGN(TASK_SIZE/3) 
 #define TASK_UNMAPPED_BASE	\
 	(test_thread_flag(TIF_IA32) ? TASK_UNMAPPED_32 : TASK_UNMAPPED_64)  
diff -Nru a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h
--- a/include/asm-x86_64/proto.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-x86_64/proto.h	Tue Feb  3 19:45:42 2004
@@ -74,6 +74,8 @@
 
 extern void check_ioapic(void);
 
+extern int unhandled_signal(struct task_struct *tsk, int sig);
+
 extern unsigned long max_mapnr;
 extern unsigned long end_pfn; 
 extern unsigned long table_start, table_end;
diff -Nru a/include/asm-x86_64/ptrace.h b/include/asm-x86_64/ptrace.h
--- a/include/asm-x86_64/ptrace.h	Tue Feb  3 19:45:17 2004
+++ b/include/asm-x86_64/ptrace.h	Tue Feb  3 19:45:17 2004
@@ -6,7 +6,7 @@
 #define R14 8
 #define R13 16
 #define R12 24
-#define RBP 36
+#define RBP 32
 #define RBX 40
 /* arguments: interrupts/non tracing syscalls only save upto here*/
 #define R11 48
diff -Nru a/include/asm-x86_64/scatterlist.h b/include/asm-x86_64/scatterlist.h
--- a/include/asm-x86_64/scatterlist.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-x86_64/scatterlist.h	Tue Feb  3 19:45:42 2004
@@ -6,6 +6,7 @@
     unsigned int	offset;
     unsigned int	length;
     dma_addr_t		dma_address;
+    unsigned int        dma_length;
 };
 
 #define ISA_DMA_THRESHOLD (0x00ffffff)
@@ -16,6 +17,6 @@
  * returns.
  */
 #define sg_dma_address(sg)     ((sg)->dma_address)
-#define sg_dma_len(sg)         ((sg)->length)
+#define sg_dma_len(sg)         ((sg)->dma_length)
 
 #endif 
diff -Nru a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h
--- a/include/asm-x86_64/smp.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-x86_64/smp.h	Tue Feb  3 19:45:16 2004
@@ -57,8 +57,7 @@
  */
 
 extern cpumask_t cpu_callout_map;
-
-#define cpu_possible(cpu) cpu_isset(cpu, cpu_callout_map)
+#define cpu_possible_map cpu_callout_map
 #define cpu_online(cpu) cpu_isset(cpu, cpu_online_map)
 
 static inline int num_booting_cpus(void)
diff -Nru a/include/asm-x86_64/socket.h b/include/asm-x86_64/socket.h
--- a/include/asm-x86_64/socket.h	Tue Feb  3 19:45:16 2004
+++ b/include/asm-x86_64/socket.h	Tue Feb  3 19:45:16 2004
@@ -45,6 +45,8 @@
 
 #define SO_ACCEPTCONN		30
 
+#define SO_PEERSEC             31
+
 /* Nasty libc5 fixup - bletch */
 #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
 /* Socket types. */
diff -Nru a/include/asm-x86_64/spinlock.h b/include/asm-x86_64/spinlock.h
--- a/include/asm-x86_64/spinlock.h	Tue Feb  3 19:45:42 2004
+++ b/include/asm-x86_64/spinlock.h	Tue Feb  3 19:45:42 2004
@@ -70,10 +70,8 @@
 static inline void _raw_spin_unlock(spinlock_t *lock)
 {
 #ifdef CONFIG_DEBUG_SPINLOCK
-	if (lock->magic != SPINLOCK_MAGIC)
-		BUG();
-	if (!spin_is_locked(lock))
-		BUG();
+	BUG_ON(lock->magic != SPINLOCK_MAGIC);
+	BUG_ON(!spin_is_locked(lock));
 #endif
 	__asm__ __volatile__(
 		spin_unlock_string
@@ -91,10 +89,8 @@
 {
 	char oldval = 1;
 #ifdef CONFIG_DEBUG_SPINLOCK
-	if (lock->magic != SPINLOCK_MAGIC)
-		BUG();
-	if (!spin_is_locked(lock))
-		BUG();
+	BUG_ON(lock->magic != SPINLOCK_MAGIC);
+	BUG_ON(!spin_is_locked(lock));
 #endif
 	__asm__ __volatile__(
 		spin_unlock_string
@@ -174,8 +170,7 @@
 static inline void _raw_read_lock(rwlock_t *rw)
 {
 #ifdef CONFIG_DEBUG_SPINLOCK
-	if (rw->magic != RWLOCK_MAGIC)
-		BUG();
+	BUG_ON(rw->magic != RWLOCK_MAGIC);
 #endif
 	__build_read_lock(rw, "__read_lock_failed");
 }
@@ -183,8 +178,7 @@
 static inline void _raw_write_lock(rwlock_t *rw)
 {
 #ifdef CONFIG_DEBUG_SPINLOCK
-	if (rw->magic != RWLOCK_MAGIC)
-		BUG();
+	BUG_ON(rw->magic != RWLOCK_MAGIC);
 #endif
 	__build_write_lock(rw, "__write_lock_failed");
 }
diff -Nru a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h
--- a/include/asm-x86_64/system.h	Tue Feb  3 19:45:41 2004
+++ b/include/asm-x86_64/system.h	Tue Feb  3 19:45:41 2004
@@ -19,62 +19,12 @@
 #define __SAVE(reg,offset) "movq %%" #reg ",(14-" #offset ")*8(%%rsp)\n\t"
 #define __RESTORE(reg,offset) "movq (14-" #offset ")*8(%%rsp),%%" #reg "\n\t"
 
-#ifdef CONFIG_X86_REMOTE_DEBUG
-
-/* full frame for the debug stub */
-/* Should be replaced with a dwarf2 cie/fde description, then gdb could
-   figure it out all by itself. */
-struct save_context_frame { 
-	unsigned long rbp; 
-	unsigned long rbx;
-	unsigned long r11;
-	unsigned long r10;
-	unsigned long r9;
-	unsigned long r8;
-	unsigned long rcx;
-	unsigned long rdx;	
-	unsigned long r15;
-	unsigned long r14;
-	unsigned long r13;
-	unsigned long r12;
-	unsigned long rdi;
-	unsigned long rsi;
-	unsigned long flags;
-}; 
-
-#define SAVE_CONTEXT \
-	"pushfq\n\t"							\
-	"subq $14*8,%%rsp\n\t" 						\
-	__SAVE(rbx, 12) __SAVE(rdi,  1)					\
-	__SAVE(rdx,  6) __SAVE(rcx,  7)					\
-	__SAVE(r8,   8) __SAVE(r9,   9)					\
-	__SAVE(r12,  2) __SAVE(r13,  3)					\
-	__SAVE(r14,  4) __SAVE(r15,  5)					\
-	__SAVE(r10, 10) __SAVE(r11, 11)					\
-	__SAVE(rsi, 0)  __SAVE(rbp, 13) 				\
-
-
-#define RESTORE_CONTEXT \
-	__RESTORE(rbx, 12) __RESTORE(rdi,  1) 					\
-	__RESTORE(rdx,  6) __RESTORE(rcx,  7)					\
-	__RESTORE(r12,  2) __RESTORE(r13,  3)					\
-	__RESTORE(r14,  4) __RESTORE(r15,  5)					\
-	__RESTORE(r10, 10) __RESTORE(r11, 11)					\
-	__RESTORE(r8,   8) __RESTORE(r9,   9)					\
-	__RESTORE(rbp, 13) __RESTORE(rsi, 0) 		   		        \
-	"addq $14*8,%%rsp\n\t" 							\
-	"popfq\n\t"
-
-#define __EXTRA_CLOBBER 
-
-#else
 /* frame pointer must be last for get_wchan */
 #define SAVE_CONTEXT    "pushfq ; pushq %%rbp ; movq %%rsi,%%rbp\n\t"
 #define RESTORE_CONTEXT "movq %%rbp,%%rsi ; popq %%rbp ; popfq\n\t" 
 
 #define __EXTRA_CLOBBER  \
 	,"rcx","rbx","rdx","r8","r9","r10","r11","r12","r13","r14","r15"
-#endif
 
 #define switch_to(prev,next,last) \
 	asm volatile(SAVE_CONTEXT						    \
@@ -321,20 +271,7 @@
 #define local_irq_disable() 	__asm__ __volatile__("cli": : :"memory")
 #define local_irq_enable()	__asm__ __volatile__("sti": : :"memory")
 /* used in the idle loop; sti takes one instruction cycle to complete */
-
-/* Work around BIOS that don't have K8 Errata #93 fixed. */
-#define safe_halt()	      \
-	asm volatile("   sti\n"					\
-		     "1: hlt\n"						\
-		     "2:\n"							\
-		     ".section .fixup,\"ax\"\n"		\
-		     "3: call idle_warning\n"		\
-		     "   jmp 2b\n"					\
-		     ".previous\n"					\
-		     ".section __ex_table,\"a\"\n\t"	\
-		     ".align 8\n\t"					\
-		     ".quad 1b,3b\n"				\
-		     ".previous" ::: "memory")
+#define safe_halt()		__asm__ __volatile__("sti; hlt": : :"memory")
 
 #define irqs_disabled()			\
 ({					\
diff -Nru a/include/asm-x86_64/thread_info.h b/include/asm-x86_64/thread_info.h
--- a/include/asm-x86_64/thread_info.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-x86_64/thread_info.h	Tue Feb  3 19:45:34 2004
@@ -105,6 +105,7 @@
 #define TIF_POLLING_NRFLAG	16	/* true if poll_idle() is polling TIF_NEED_RESCHED */
 #define TIF_IA32		17	/* 32bit process */ 
 #define TIF_FORK		18	/* ret_from_fork */
+#define TIF_ABI_PENDING		19
 
 #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)
 #define _TIF_NOTIFY_RESUME	(1<<TIF_NOTIFY_RESUME)
@@ -115,6 +116,7 @@
 #define _TIF_POLLING_NRFLAG	(1<<TIF_POLLING_NRFLAG)
 #define _TIF_IA32		(1<<TIF_IA32)
 #define _TIF_FORK		(1<<TIF_FORK)
+#define _TIF_ABI_PENDING	(1<<TIF_ABI_PENDING)
 
 #define _TIF_WORK_MASK		0x0000FFFE	/* work to do on interrupt/exception return */
 #define _TIF_ALLWORK_MASK	0x0000FFFF	/* work to do on any return to u-space */
diff -Nru a/include/asm-x86_64/timex.h b/include/asm-x86_64/timex.h
--- a/include/asm-x86_64/timex.h	Tue Feb  3 19:45:29 2004
+++ b/include/asm-x86_64/timex.h	Tue Feb  3 19:45:29 2004
@@ -9,6 +9,7 @@
 #include <linux/config.h>
 #include <asm/msr.h>
 #include <asm/vsyscall.h>
+#include <asm/hpet.h>
 
 #define CLOCK_TICK_RATE	1193182 /* Underlying HZ */
 #define CLOCK_TICK_FACTOR	20	/* Factor of both 1000000 and CLOCK_TICK_RATE */
@@ -29,34 +30,6 @@
 }
 
 extern unsigned int cpu_khz;
-
-/*
- * Documentation on HPET can be found at:
- *      http://www.intel.com/ial/home/sp/pcmmspec.htm
- *      ftp://download.intel.com/ial/home/sp/mmts098.pdf
- */
-
-#define HPET_ID		0x000
-#define HPET_PERIOD	0x004
-#define HPET_CFG	0x010
-#define HPET_STATUS	0x020
-#define HPET_COUNTER	0x0f0
-#define HPET_T0_CFG	0x100
-#define HPET_T0_CMP	0x108
-#define HPET_T0_ROUTE	0x110
-
-#define HPET_ID_VENDOR	0xffff0000
-#define HPET_ID_LEGSUP	0x00008000
-#define HPET_ID_NUMBER	0x00000f00
-#define HPET_ID_REV	0x000000ff
-
-#define HPET_CFG_ENABLE	0x001
-#define HPET_CFG_LEGACY	0x002
-
-#define HPET_T0_ENABLE		0x004
-#define HPET_T0_PERIODIC	0x008
-#define HPET_T0_SETVAL		0x040
-#define HPET_T0_32BIT		0x100
 
 extern struct vxtime_data vxtime;
 
diff -Nru a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
--- a/include/asm-x86_64/unistd.h	Tue Feb  3 19:45:34 2004
+++ b/include/asm-x86_64/unistd.h	Tue Feb  3 19:45:34 2004
@@ -533,6 +533,8 @@
 #define __NR_vserver		236
 __SYSCALL(__NR_vserver, sys_ni_syscall)
 
+/* 237,238,239 reserved for NUMA API */
+
 #define __NR_syscall_max __NR_vserver
 #ifndef __NO_STUBS
 
@@ -694,7 +696,7 @@
 }
 
 extern long sys_exit(int) __attribute__((noreturn));
-extern inline long exit(int error_code)
+extern inline void exit(int error_code)
 {
 	sys_exit(error_code);
 }
diff -Nru a/include/asm-x86_64/vsyscall32.h b/include/asm-x86_64/vsyscall32.h
--- a/include/asm-x86_64/vsyscall32.h	Tue Feb  3 19:45:29 2004
+++ b/include/asm-x86_64/vsyscall32.h	Tue Feb  3 19:45:29 2004
@@ -8,6 +8,6 @@
 
 #define VSYSCALL32_VSYSCALL ((void *)VSYSCALL32_BASE + 0x400) 
 #define VSYSCALL32_SIGRETURN ((void *)VSYSCALL32_BASE + 0x500) 
-#define VSYSCALL32_RTSIGRETURN ((void *)VSYSCALL32_BASE + 0x500) 
+#define VSYSCALL32_RTSIGRETURN ((void *)VSYSCALL32_BASE + 0x600) 
 
 #endif
diff -Nru a/include/linux/apm_bios.h b/include/linux/apm_bios.h
--- a/include/linux/apm_bios.h	Tue Feb  3 19:45:28 2004
+++ b/include/linux/apm_bios.h	Tue Feb  3 19:45:28 2004
@@ -53,6 +53,7 @@
 	int			get_power_status_broken;
 	int			get_power_status_swabinminutes;
 	int			allow_ints;
+	int			forbid_idle;
 	int			realmode_power_off;
 	int			disabled;
 };
diff -Nru a/include/linux/bio.h b/include/linux/bio.h
--- a/include/linux/bio.h	Tue Feb  3 19:45:37 2004
+++ b/include/linux/bio.h	Tue Feb  3 19:45:37 2004
@@ -266,8 +266,7 @@
 	local_irq_save(*flags);
 	addr = (unsigned long) kmap_atomic(bvec->bv_page, KM_BIO_SRC_IRQ);
 
-	if (addr & ~PAGE_MASK)
-		BUG();
+	BUG_ON(addr & ~PAGE_MASK);
 
 	return (char *) addr + bvec->bv_offset;
 }
diff -Nru a/include/linux/bitmap.h b/include/linux/bitmap.h
--- a/include/linux/bitmap.h	Tue Feb  3 19:45:43 2004
+++ b/include/linux/bitmap.h	Tue Feb  3 19:45:43 2004
@@ -10,57 +10,11 @@
 #include <linux/bitops.h>
 #include <linux/string.h>
 
-static inline int bitmap_empty(const unsigned long *bitmap, int bits)
-{
-	int k, lim = bits/BITS_PER_LONG;
-	for (k = 0; k < lim; ++k)
-		if (bitmap[k])
-			return 0;
-
-	if (bits % BITS_PER_LONG)
-		if (bitmap[k] & ((1UL << (bits % BITS_PER_LONG)) - 1))
-			return 0;
-
-	return 1;
-}
-
-static inline int bitmap_full(const unsigned long *bitmap, int bits)
-{
-	int k, lim = bits/BITS_PER_LONG;
-	for (k = 0; k < lim; ++k)
-		if (~bitmap[k])
-			return 0;
-
-	if (bits % BITS_PER_LONG)
-		if (~bitmap[k] & ((1UL << (bits % BITS_PER_LONG)) - 1))
-			return 0;
-
-	return 1;
-}
-
-static inline int bitmap_equal(const unsigned long *bitmap1,
-				unsigned long *bitmap2, int bits)
-{
-	int k, lim = bits/BITS_PER_LONG;;
-	for (k = 0; k < lim; ++k)
-		if (bitmap1[k] != bitmap2[k])
-			return 0;
-
-	if (bits % BITS_PER_LONG)
-		if ((bitmap1[k] ^ bitmap2[k]) &
-				((1UL << (bits % BITS_PER_LONG)) - 1))
-			return 0;
-
-	return 1;
-}
-
-static inline void bitmap_complement(unsigned long *bitmap, int bits)
-{
-	int k;
-
-	for (k = 0; k < BITS_TO_LONGS(bits); ++k)
-		bitmap[k] = ~bitmap[k];
-}
+int bitmap_empty(const unsigned long *bitmap, int bits);
+int bitmap_full(const unsigned long *bitmap, int bits);
+int bitmap_equal(const unsigned long *bitmap1,
+			unsigned long *bitmap2, int bits);
+void bitmap_complement(unsigned long *bitmap, int bits);
 
 static inline void bitmap_clear(unsigned long *bitmap, int bits)
 {
@@ -78,81 +32,15 @@
 	memcpy(dst, src, BITS_TO_LONGS(bits)*sizeof(unsigned long));
 }
 
-static inline void bitmap_shift_right(unsigned long *dst,
-				const unsigned long *src, int shift, int bits)
-{
-	int k;
-	DECLARE_BITMAP(__shr_tmp, bits);
-
-	bitmap_clear(__shr_tmp, bits);
-	for (k = 0; k < bits - shift; ++k)
-		if (test_bit(k + shift, src))
-			set_bit(k, __shr_tmp);
-	bitmap_copy(dst, __shr_tmp, bits);
-}
-
-static inline void bitmap_shift_left(unsigned long *dst,
-				const unsigned long *src, int shift, int bits)
-{
-	int k;
-	DECLARE_BITMAP(__shl_tmp, bits);
-
-	bitmap_clear(__shl_tmp, bits);
-	for (k = bits; k >= shift; --k)
-		if (test_bit(k - shift, src))
-			set_bit(k, __shl_tmp);
-	bitmap_copy(dst, __shl_tmp, bits);
-}
-
-static inline void bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
-				const unsigned long *bitmap2, int bits)
-{
-	int k;
-	int nr = BITS_TO_LONGS(bits);
-
-	for (k = 0; k < nr; k++)
-		dst[k] = bitmap1[k] & bitmap2[k];
-}
-
-static inline void bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
-				const unsigned long *bitmap2, int bits)
-{
-	int k;
-	int nr = BITS_TO_LONGS(bits);
-
-	for (k = 0; k < nr; k++)
-		dst[k] = bitmap1[k] | bitmap2[k];
-}
-
-#if BITS_PER_LONG == 32
-static inline int bitmap_weight(const unsigned long *bitmap, int bits)
-{
-	int k, w = 0, lim = bits/BITS_PER_LONG;
-
-	for (k = 0; k < lim; k++)
-		w += hweight32(bitmap[k]);
-
-	if (bits % BITS_PER_LONG)
-		w += hweight32(bitmap[k] &
-				((1UL << (bits % BITS_PER_LONG)) - 1));
-
-	return w;
-}
-#else
-static inline int bitmap_weight(const unsigned long *bitmap, int bits)
-{
-	int k, w = 0, lim = bits/BITS_PER_LONG;
-
-	for (k = 0; k < lim; k++)
-		w += hweight64(bitmap[k]);
-
-	if (bits % BITS_PER_LONG)
-		w += hweight64(bitmap[k] &
-				((1UL << (bits % BITS_PER_LONG)) - 1));
-
-	return w;
-}
-#endif
+void bitmap_shift_right(unsigned long *dst,
+			const unsigned long *src, int shift, int bits);
+void bitmap_shift_left(unsigned long *dst,
+			const unsigned long *src, int shift, int bits);
+void bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
+			const unsigned long *bitmap2, int bits);
+void bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
+			const unsigned long *bitmap2, int bits);
+int bitmap_weight(const unsigned long *bitmap, int bits);
 
 #endif /* __ASSEMBLY__ */
 
diff -Nru a/include/linux/blkdev.h b/include/linux/blkdev.h
--- a/include/linux/blkdev.h	Tue Feb  3 19:45:17 2004
+++ b/include/linux/blkdev.h	Tue Feb  3 19:45:17 2004
@@ -483,9 +483,9 @@
 }
 #endif /* CONFIG_MMU */
 
-#define rq_for_each_bio(bio, rq)	\
+#define rq_for_each_bio(_bio, rq)	\
 	if ((rq->bio))			\
-		for (bio = (rq)->bio; bio; bio = bio->bi_next)
+		for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next)
 
 struct sec_size {
 	unsigned block_size;
@@ -541,7 +541,7 @@
 
 	list_del_init(&req->queuelist);
 
-	if (req->q)
+	if (req->rl)
 		elv_remove_request(req->q, req);
 }
 
diff -Nru a/include/linux/buffer_head.h b/include/linux/buffer_head.h
--- a/include/linux/buffer_head.h	Tue Feb  3 19:45:16 2004
+++ b/include/linux/buffer_head.h	Tue Feb  3 19:45:16 2004
@@ -125,8 +125,7 @@
 /* If we *know* page->private refers to buffer_heads */
 #define page_buffers(page)					\
 	({							\
-		if (!PagePrivate(page))				\
-			BUG();					\
+		BUG_ON(!PagePrivate(page));		\
 		((struct buffer_head *)(page)->private);	\
 	})
 #define page_has_buffers(page)	PagePrivate(page)
@@ -210,7 +209,7 @@
 #define OSYNC_METADATA	(1<<0)
 #define OSYNC_DATA	(1<<1)
 #define OSYNC_INODE	(1<<2)
-int generic_osync_inode(struct inode *, int);
+int generic_osync_inode(struct inode *, struct address_space *, int);
 
 
 /*
diff -Nru a/include/linux/byteorder/swab.h b/include/linux/byteorder/swab.h
--- a/include/linux/byteorder/swab.h	Tue Feb  3 19:45:43 2004
+++ b/include/linux/byteorder/swab.h	Tue Feb  3 19:45:43 2004
@@ -15,6 +15,8 @@
  *
  */
 
+#include <linux/compiler.h>
+
 /* casts are necessary for constants, because we never know how for sure
  * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
  */
@@ -128,7 +130,7 @@
 #endif /* OPTIMIZE */
 
 
-static __inline__ __const__ __u16 __fswab16(__u16 x)
+static __inline__ __attribute_const__ __u16 __fswab16(__u16 x)
 {
 	return __arch__swab16(x);
 }
@@ -141,7 +143,7 @@
 	__arch__swab16s(addr);
 }
 
-static __inline__ __const__ __u32 __fswab32(__u32 x)
+static __inline__ __attribute_const__ __u32 __fswab32(__u32 x)
 {
 	return __arch__swab32(x);
 }
@@ -155,7 +157,7 @@
 }
 
 #ifdef __BYTEORDER_HAS_U64__
-static __inline__ __const__ __u64 __fswab64(__u64 x)
+static __inline__ __attribute_const__ __u64 __fswab64(__u64 x)
 {
 #  ifdef __SWAB_64_THRU_32__
 	__u32 h = x >> 32;
diff -Nru a/include/linux/cdrom.h b/include/linux/cdrom.h
--- a/include/linux/cdrom.h	Tue Feb  3 19:45:16 2004
+++ b/include/linux/cdrom.h	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,7 @@
  *               1994, 1995   Eberhard Moenkeberg, emoenke@gwdg.de
  *               1996         David van Leeuwen, david@tm.tno.nl
  *               1997, 1998   Erik Andersen, andersee@debian.org
- *               1998-2000    Jens Axboe, axboe@suse.de
+ *               1998-2002    Jens Axboe, axboe@suse.de
  */
  
 #ifndef	_LINUX_CDROM_H
@@ -388,6 +388,9 @@
 #define CDC_DVD_R		0x10000	/* drive can write DVD-R */
 #define CDC_DVD_RAM		0x20000	/* drive can write DVD-RAM */
 #define CDC_MO_DRIVE		0x40000 /* drive is an MO device */
+#define CDC_MRW			0x80000 /* drive can read MRW */
+#define CDC_MRW_W		0x100000 /* drive can write MRW */
+#define CDC_RAM			0x200000 /* ok to open for WRITE */
 
 /* drive status possibilities returned by CDROM_DRIVE_STATUS ioctl */
 #define CDS_NO_INFO		0	/* if not implemented */
@@ -715,92 +718,57 @@
 	__u8 asb[46];
 };
 
-#ifdef __KERNEL__
-#include <linux/fs.h>		/* not really needed, later.. */
-#include <linux/device.h>
-
-struct cdrom_write_settings {
-	unsigned char fpacket;		/* fixed/variable packets */
-	unsigned long packet_size;	/* write out this number of packets */
-	unsigned long nwa;		/* next writeable address */
-	unsigned char writeable;	/* cdrom is writeable */
-};
-
-/* Uniform cdrom data structures for cdrom.c */
-struct cdrom_device_info {
-	struct cdrom_device_ops  *ops;  /* link to device_ops */
-	struct cdrom_device_info *next; /* next device_info for this major */
-	void *handle;		        /* driver-dependent data */
-/* specifications */
-	int mask;                       /* mask of capability: disables them */
-	int speed;			/* maximum speed for reading data */
-	int capacity;			/* number of discs in jukebox */
-/* device-related storage */
-	int options		: 30;	/* options flags */
-	unsigned mc_flags	: 2;	/* media change buffer flags */
-    	int use_count;                  /* number of times device opened */
-    	char name[20];                  /* name of the device type */
-/* per-device flags */
-        __u8 sanyo_slot		: 2;	/* Sanyo 3 CD changer support */
-        __u8 reserved		: 6;	/* not used yet */
-	struct cdrom_write_settings write;
-};
-
-struct cdrom_device_ops {
-/* routines */
-	int (*open) (struct cdrom_device_info *, int);
-	void (*release) (struct cdrom_device_info *);
-	int (*drive_status) (struct cdrom_device_info *, int);
-	int (*media_changed) (struct cdrom_device_info *, int);
-	int (*tray_move) (struct cdrom_device_info *, int);
-	int (*lock_door) (struct cdrom_device_info *, int);
-	int (*select_speed) (struct cdrom_device_info *, int);
-	int (*select_disc) (struct cdrom_device_info *, int);
-	int (*get_last_session) (struct cdrom_device_info *,
-				 struct cdrom_multisession *);
-	int (*get_mcn) (struct cdrom_device_info *,
-			struct cdrom_mcn *);
-	/* hard reset device */
-	int (*reset) (struct cdrom_device_info *);
-	/* play stuff */
-	int (*audio_ioctl) (struct cdrom_device_info *,unsigned int, void *);
-	/* dev-specific */
- 	int (*dev_ioctl) (struct cdrom_device_info *,
-			  unsigned int, unsigned long);
-/* driver specifications */
-	const int capability;   /* capability flags */
-	int n_minors;           /* number of active minor devices */
-	/* handle uniform packets for scsi type devices (scsi,atapi) */
-	int (*generic_packet) (struct cdrom_device_info *,
-			       struct cdrom_generic_command *);
-};
+/*
+ * feature profile
+ */
+#define CDF_MRW		0x28
 
-/* the general block_device operations structure: */
-extern int cdrom_open(struct cdrom_device_info *, struct inode *, struct file *);
-extern int cdrom_release(struct cdrom_device_info *, struct file *);
-extern int cdrom_ioctl(struct cdrom_device_info *, struct inode *, unsigned, unsigned long);
-extern int cdrom_media_changed(struct cdrom_device_info *);
+/*
+ * media status bits
+ */
+#define CDM_MRW_NOTMRW			0
+#define CDM_MRW_BGFORMAT_INACTIVE	1
+#define CDM_MRW_BGFORMAT_ACTIVE		2
+#define CDM_MRW_BGFORMAT_COMPLETE	3
 
-extern int register_cdrom(struct cdrom_device_info *cdi);
-extern int unregister_cdrom(struct cdrom_device_info *cdi);
+/*
+ * mrw address spaces
+ */
+#define MRW_LBA_DMA			0
+#define MRW_LBA_GAA			1
 
-typedef struct {
-    int data;
-    int audio;
-    int cdi;
-    int xa;
-    long error;
-} tracktype;
+/*
+ * mrw mode pages (first is deprecated) -- probed at init time and
+ * cdi->mrw_mode_page is set
+ */
+#define MRW_MODE_PC_PRE1		0x2c
+#define MRW_MODE_PC			0x03
 
-extern int cdrom_get_last_written(struct cdrom_device_info *cdi, long *last_written);
-extern int cdrom_number_of_slots(struct cdrom_device_info *cdi);
-extern int cdrom_mode_select(struct cdrom_device_info *cdi,
-			     struct cdrom_generic_command *cgc);
-extern int cdrom_mode_sense(struct cdrom_device_info *cdi,
-			    struct cdrom_generic_command *cgc,
-			    int page_code, int page_control);
-extern void init_cdrom_command(struct cdrom_generic_command *cgc,
-			       void *buffer, int len, int type);
+struct mrw_feature_desc {
+	__u16 feature_code;
+#if defined(__BIG_ENDIAN_BITFIELD)
+	__u8 reserved1		: 2;
+	__u8 feature_version	: 4;
+	__u8 persistent		: 1;
+	__u8 curr		: 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+	__u8 curr		: 1;
+	__u8 persistent		: 1;
+	__u8 feature_version	: 4;
+	__u8 reserved1		: 2;
+#endif
+	__u8 add_len;
+#if defined(__BIG_ENDIAN_BITFIELD)
+	__u8 reserved2		: 7;
+	__u8 write		: 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+	__u8 write		: 1;
+	__u8 reserved2		: 7;
+#endif
+	__u8 reserved3;
+	__u8 reserved4;
+	__u8 reserved5;
+};
 
 typedef struct {
 	__u16 disc_information_length;
@@ -825,9 +793,13 @@
 	__u8 did_v			: 1;
         __u8 dbc_v			: 1;
         __u8 uru			: 1;
-        __u8 reserved2			: 5;
+        __u8 reserved2			: 2;
+	__u8 dbit			: 1;
+	__u8 mrw_status			: 2;
 #elif defined(__LITTLE_ENDIAN_BITFIELD)
-        __u8 reserved2			: 5;
+	__u8 mrw_status			: 2;
+	__u8 dbit			: 1;
+        __u8 reserved2			: 2;
         __u8 uru			: 1;
         __u8 dbc_v			: 1;
 	__u8 did_v			: 1;
@@ -884,6 +856,106 @@
 	__u32 last_rec_address;
 } track_information;
 
+struct feature_header {
+	__u32 data_len;
+	__u8 reserved1;
+	__u8 reserved2;
+	__u16 curr_profile;
+};
+
+struct mode_page_header {
+	__u16 mode_data_length;
+	__u8 medium_type;
+	__u8 reserved1;
+	__u8 reserved2;
+	__u8 reserved3;
+	__u16 desc_length;
+};
+
+#ifdef __KERNEL__
+#include <linux/fs.h>		/* not really needed, later.. */
+#include <linux/device.h>
+
+/* Uniform cdrom data structures for cdrom.c */
+struct cdrom_device_info {
+	struct cdrom_device_ops  *ops;  /* link to device_ops */
+	struct cdrom_device_info *next; /* next device_info for this major */
+	void *handle;		        /* driver-dependent data */
+/* specifications */
+	int mask;                       /* mask of capability: disables them */
+	int speed;			/* maximum speed for reading data */
+	int capacity;			/* number of discs in jukebox */
+/* device-related storage */
+	int options		: 30;	/* options flags */
+	unsigned mc_flags	: 2;	/* media change buffer flags */
+    	int use_count;                  /* number of times device opened */
+    	char name[20];                  /* name of the device type */
+/* per-device flags */
+        __u8 sanyo_slot		: 2;	/* Sanyo 3 CD changer support */
+        __u8 reserved		: 6;	/* not used yet */
+	int for_data;
+	int (*exit)(struct cdrom_device_info *);
+	int mrw_mode_page;
+};
+
+struct cdrom_device_ops {
+/* routines */
+	int (*open) (struct cdrom_device_info *, int);
+	void (*release) (struct cdrom_device_info *);
+	int (*drive_status) (struct cdrom_device_info *, int);
+	int (*media_changed) (struct cdrom_device_info *, int);
+	int (*tray_move) (struct cdrom_device_info *, int);
+	int (*lock_door) (struct cdrom_device_info *, int);
+	int (*select_speed) (struct cdrom_device_info *, int);
+	int (*select_disc) (struct cdrom_device_info *, int);
+	int (*get_last_session) (struct cdrom_device_info *,
+				 struct cdrom_multisession *);
+	int (*get_mcn) (struct cdrom_device_info *,
+			struct cdrom_mcn *);
+	/* hard reset device */
+	int (*reset) (struct cdrom_device_info *);
+	/* play stuff */
+	int (*audio_ioctl) (struct cdrom_device_info *,unsigned int, void *);
+	/* dev-specific */
+ 	int (*dev_ioctl) (struct cdrom_device_info *,
+			  unsigned int, unsigned long);
+/* driver specifications */
+	const int capability;   /* capability flags */
+	int n_minors;           /* number of active minor devices */
+	/* handle uniform packets for scsi type devices (scsi,atapi) */
+	int (*generic_packet) (struct cdrom_device_info *,
+			       struct cdrom_generic_command *);
+};
+
+/* the general block_device operations structure: */
+extern int cdrom_open(struct cdrom_device_info *cdi, struct inode *ip,
+			struct file *fp);
+extern int cdrom_release(struct cdrom_device_info *cdi, struct file *fp);
+extern int cdrom_ioctl(struct cdrom_device_info *cdi, struct inode *ip,
+		unsigned int cmd, unsigned long arg);
+extern int cdrom_media_changed(struct cdrom_device_info *);
+
+extern int register_cdrom(struct cdrom_device_info *cdi);
+extern int unregister_cdrom(struct cdrom_device_info *cdi);
+
+typedef struct {
+    int data;
+    int audio;
+    int cdi;
+    int xa;
+    long error;
+} tracktype;
+
+extern int cdrom_get_last_written(struct cdrom_device_info *cdi, long *last_written);
+extern int cdrom_number_of_slots(struct cdrom_device_info *cdi);
+extern int cdrom_mode_select(struct cdrom_device_info *cdi,
+			     struct cdrom_generic_command *cgc);
+extern int cdrom_mode_sense(struct cdrom_device_info *cdi,
+			    struct cdrom_generic_command *cgc,
+			    int page_code, int page_control);
+extern void init_cdrom_command(struct cdrom_generic_command *cgc,
+			       void *buffer, int len, int type);
+
 /* The SCSI spec says there could be 256 slots. */
 #define CDROM_MAX_SLOTS	256
 
@@ -934,15 +1006,6 @@
 	mechtype_cartridge_changer  = 5
 } mechtype_t;
 
-struct mode_page_header {
-	__u16 mode_data_length;
-	__u8 medium_type;
-	__u8 reserved1;
-	__u8 reserved2;
-	__u8 reserved3;
-	__u16 desc_length;
-};
-
 typedef struct {
 #if defined(__BIG_ENDIAN_BITFIELD)
 	__u8 ps			: 1;
@@ -1031,6 +1094,41 @@
 	__u8 rpc_scheme;
 	__u8 reserved3;
 } rpc_state_t;
+
+struct event_header {
+	__u16 data_len;
+#if defined(__BIG_ENDIAN_BITFIELD)
+	__u8 nea		: 1;
+	__u8 reserved1		: 4;
+	__u8 notification_class	: 3;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+	__u8 notification_class	: 3;
+	__u8 reserved1		: 4;
+	__u8 nea		: 1;
+#endif
+	__u8 supp_event_class;
+};
+
+struct media_event_desc {
+#if defined(__BIG_ENDIAN_BITFIELD)
+	__u8 reserved1		: 4;
+	__u8 media_event_code	: 4;
+	__u8 reserved2		: 6;
+	__u8 media_present	: 1;
+	__u8 door_open		: 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+	__u8 media_event_code	: 4;
+	__u8 reserved1		: 4;
+	__u8 door_open		: 1;
+	__u8 media_present	: 1;
+	__u8 reserved2		: 6;
+#endif
+	__u8 start_slot;
+	__u8 end_slot;
+};
+
+extern int cdrom_get_media_event(struct cdrom_device_info *cdi, struct media_event_desc *med);
+extern int cdrom_is_mrw(struct cdrom_device_info *cdi, int *write);
 
 #endif  /* End of kernel only stuff */ 
 
diff -Nru a/include/linux/compat.h b/include/linux/compat.h
--- a/include/linux/compat.h	Tue Feb  3 19:45:17 2004
+++ b/include/linux/compat.h	Tue Feb  3 19:45:17 2004
@@ -83,5 +83,10 @@
 	char		d_name[256];
 };
 
+typedef union compat_sigval {
+	compat_int_t	sival_int;
+	compat_uptr_t	sival_ptr;
+} compat_sigval_t;
+
 #endif /* CONFIG_COMPAT */
 #endif /* _LINUX_COMPAT_H */
diff -Nru a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h
--- a/include/linux/compat_ioctl.h	Tue Feb  3 19:45:42 2004
+++ b/include/linux/compat_ioctl.h	Tue Feb  3 19:45:42 2004
@@ -2,6 +2,14 @@
  * compatible types passed or none at all... Please include
  * only stuff that is compatible on *all architectures*.
  */
+#ifndef COMPATIBLE_IOCTL /* pointer to compatible structure or no argument */
+#define COMPATIBLE_IOCTL(cmd)  HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)sys_ioctl)
+#endif
+
+#ifndef ULONG_IOCTL /* argument is an unsigned long integer, not a pointer */
+#define ULONG_IOCTL(cmd)  HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)sys_ioctl)
+#endif
+
 /* Big T */
 COMPATIBLE_IOCTL(TCGETA)
 COMPATIBLE_IOCTL(TCSETA)
@@ -35,18 +43,16 @@
 COMPATIBLE_IOCTL(TIOCOUTQ)
 COMPATIBLE_IOCTL(TIOCSPGRP)
 COMPATIBLE_IOCTL(TIOCGPGRP)
-COMPATIBLE_IOCTL(TIOCSCTTY)
+ULONG_IOCTL(TIOCSCTTY)
 COMPATIBLE_IOCTL(TIOCGPTN)
 COMPATIBLE_IOCTL(TIOCSPTLCK)
 COMPATIBLE_IOCTL(TIOCSERGETLSR)
-#ifdef CONFIG_FB
 /* Big F */
 COMPATIBLE_IOCTL(FBIOGET_VSCREENINFO)
 COMPATIBLE_IOCTL(FBIOPUT_VSCREENINFO)
 COMPATIBLE_IOCTL(FBIOPAN_DISPLAY)
 COMPATIBLE_IOCTL(FBIOGET_CON2FBMAP)
 COMPATIBLE_IOCTL(FBIOPUT_CON2FBMAP)
-#endif
 /* Little f */
 COMPATIBLE_IOCTL(FIOCLEX)
 COMPATIBLE_IOCTL(FIONCLEX)
@@ -68,7 +74,6 @@
 COMPATIBLE_IOCTL(HDIO_DRIVE_CMD)
 COMPATIBLE_IOCTL(HDIO_SET_PIO_MODE)
 COMPATIBLE_IOCTL(HDIO_SET_NICE)
-#ifdef CONFIG_BLK_DEV_FD
 /* 0x02 -- Floppy ioctls */
 COMPATIBLE_IOCTL(FDMSGON)
 COMPATIBLE_IOCTL(FDMSGOFF)
@@ -86,7 +91,6 @@
 COMPATIBLE_IOCTL(FDTWADDLE)
 COMPATIBLE_IOCTL(FDFMTTRK)
 COMPATIBLE_IOCTL(FDRAWCMD)
-#endif
 /* 0x12 */
 COMPATIBLE_IOCTL(BLKROSET)
 COMPATIBLE_IOCTL(BLKROGET)
@@ -94,8 +98,8 @@
 COMPATIBLE_IOCTL(BLKFLSBUF)
 COMPATIBLE_IOCTL(BLKSECTSET)
 COMPATIBLE_IOCTL(BLKSSZGET)
-COMPATIBLE_IOCTL(BLKRASET)
-COMPATIBLE_IOCTL(BLKFRASET)
+ULONG_IOCTL(BLKRASET)
+ULONG_IOCTL(BLKFRASET)
 /* RAID */
 COMPATIBLE_IOCTL(RAID_VERSION)
 COMPATIBLE_IOCTL(GET_ARRAY_INFO)
@@ -104,20 +108,19 @@
 COMPATIBLE_IOCTL(RAID_AUTORUN)
 COMPATIBLE_IOCTL(CLEAR_ARRAY)
 COMPATIBLE_IOCTL(ADD_NEW_DISK)
-COMPATIBLE_IOCTL(HOT_REMOVE_DISK)
+ULONG_IOCTL(HOT_REMOVE_DISK)
 COMPATIBLE_IOCTL(SET_ARRAY_INFO)
 COMPATIBLE_IOCTL(SET_DISK_INFO)
 COMPATIBLE_IOCTL(WRITE_RAID_INFO)
 COMPATIBLE_IOCTL(UNPROTECT_ARRAY)
 COMPATIBLE_IOCTL(PROTECT_ARRAY)
-COMPATIBLE_IOCTL(HOT_ADD_DISK)
-COMPATIBLE_IOCTL(SET_DISK_FAULTY)
+ULONG_IOCTL(HOT_ADD_DISK)
+ULONG_IOCTL(SET_DISK_FAULTY)
 COMPATIBLE_IOCTL(RUN_ARRAY)
-COMPATIBLE_IOCTL(START_ARRAY)
+ULONG_IOCTL(START_ARRAY)
 COMPATIBLE_IOCTL(STOP_ARRAY)
 COMPATIBLE_IOCTL(STOP_ARRAY_RO)
 COMPATIBLE_IOCTL(RESTART_ARRAY_RW)
-#ifdef CONFIG_BLK_DEV_DM
 /* DM */
 #ifdef CONFIG_DM_IOCTL_V4
 COMPATIBLE_IOCTL(DM_VERSION)
@@ -145,21 +148,20 @@
 COMPATIBLE_IOCTL(DM_TARGET_STATUS)
 COMPATIBLE_IOCTL(DM_TARGET_WAIT)
 #endif
-#endif
 /* Big K */
 COMPATIBLE_IOCTL(PIO_FONT)
 COMPATIBLE_IOCTL(GIO_FONT)
-COMPATIBLE_IOCTL(KDSIGACCEPT)
+ULONG_IOCTL(KDSIGACCEPT)
 COMPATIBLE_IOCTL(KDGETKEYCODE)
 COMPATIBLE_IOCTL(KDSETKEYCODE)
-COMPATIBLE_IOCTL(KIOCSOUND)
-COMPATIBLE_IOCTL(KDMKTONE)
+ULONG_IOCTL(KIOCSOUND)
+ULONG_IOCTL(KDMKTONE)
 COMPATIBLE_IOCTL(KDGKBTYPE)
-COMPATIBLE_IOCTL(KDSETMODE)
+ULONG_IOCTL(KDSETMODE)
 COMPATIBLE_IOCTL(KDGETMODE)
-COMPATIBLE_IOCTL(KDSKBMODE)
+ULONG_IOCTL(KDSKBMODE)
 COMPATIBLE_IOCTL(KDGKBMODE)
-COMPATIBLE_IOCTL(KDSKBMETA)
+ULONG_IOCTL(KDSKBMETA)
 COMPATIBLE_IOCTL(KDGKBMETA)
 COMPATIBLE_IOCTL(KDGKBENT)
 COMPATIBLE_IOCTL(KDSKBENT)
@@ -169,9 +171,9 @@
 COMPATIBLE_IOCTL(KDSKBDIACR)
 COMPATIBLE_IOCTL(KDKBDREP)
 COMPATIBLE_IOCTL(KDGKBLED)
-COMPATIBLE_IOCTL(KDSKBLED)
+ULONG_IOCTL(KDSKBLED)
 COMPATIBLE_IOCTL(KDGETLED)
-COMPATIBLE_IOCTL(KDSETLED)
+ULONG_IOCTL(KDSETLED)
 COMPATIBLE_IOCTL(GIO_SCRNMAP)
 COMPATIBLE_IOCTL(PIO_SCRNMAP)
 COMPATIBLE_IOCTL(GIO_UNISCRNMAP)
@@ -190,7 +192,6 @@
 /* Big T */
 COMPATIBLE_IOCTL(TUNSETNOCSUM)
 COMPATIBLE_IOCTL(TUNSETDEBUG)
-COMPATIBLE_IOCTL(TUNSETIFF)
 COMPATIBLE_IOCTL(TUNSETPERSIST)
 COMPATIBLE_IOCTL(TUNSETOWNER)
 /* Big V */
@@ -198,15 +199,14 @@
 COMPATIBLE_IOCTL(VT_GETMODE)
 COMPATIBLE_IOCTL(VT_GETSTATE)
 COMPATIBLE_IOCTL(VT_OPENQRY)
-COMPATIBLE_IOCTL(VT_ACTIVATE)
-COMPATIBLE_IOCTL(VT_WAITACTIVE)
-COMPATIBLE_IOCTL(VT_RELDISP)
-COMPATIBLE_IOCTL(VT_DISALLOCATE)
+ULONG_IOCTL(VT_ACTIVATE)
+ULONG_IOCTL(VT_WAITACTIVE)
+ULONG_IOCTL(VT_RELDISP)
+ULONG_IOCTL(VT_DISALLOCATE)
 COMPATIBLE_IOCTL(VT_RESIZE)
 COMPATIBLE_IOCTL(VT_RESIZEX)
 COMPATIBLE_IOCTL(VT_LOCKSWITCH)
 COMPATIBLE_IOCTL(VT_UNLOCKSWITCH)
-#if defined(CONFIG_VIDEO_DEV) || defined(CONFIG_VIDEO_DEV_MODULE)
 /* Little v */
 /* Little v, the video4linux ioctls (conflict?) */
 COMPATIBLE_IOCTL(VIDIOCGCAP)
@@ -233,7 +233,6 @@
 COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+5, int))
 COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+6, int))
 COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+7, int))
-#endif
 /* Little p (/dev/rtc, /dev/envctrl, etc.) */
 COMPATIBLE_IOCTL(RTC_AIE_ON)
 COMPATIBLE_IOCTL(RTC_AIE_OFF)
@@ -260,8 +259,11 @@
 COMPATIBLE_IOCTL(SIOCSIFLINK)
 COMPATIBLE_IOCTL(SIOCSIFENCAP)
 COMPATIBLE_IOCTL(SIOCGIFENCAP)
+COMPATIBLE_IOCTL(SIOCSIFNAME)
+/* FIXME: not compatible
 COMPATIBLE_IOCTL(SIOCSIFBR)
 COMPATIBLE_IOCTL(SIOCGIFBR)
+*/
 COMPATIBLE_IOCTL(SIOCSARP)
 COMPATIBLE_IOCTL(SIOCGARP)
 COMPATIBLE_IOCTL(SIOCDARP)
@@ -279,7 +281,7 @@
 COMPATIBLE_IOCTL(SG_SET_TIMEOUT)
 COMPATIBLE_IOCTL(SG_GET_TIMEOUT)
 COMPATIBLE_IOCTL(SG_EMULATED_HOST)
-COMPATIBLE_IOCTL(SG_SET_TRANSFORM)
+ULONG_IOCTL(SG_SET_TRANSFORM)
 COMPATIBLE_IOCTL(SG_GET_TRANSFORM)
 COMPATIBLE_IOCTL(SG_SET_RESERVED_SIZE)
 COMPATIBLE_IOCTL(SG_GET_RESERVED_SIZE)
@@ -299,7 +301,6 @@
 COMPATIBLE_IOCTL(SG_GET_REQUEST_TABLE)
 COMPATIBLE_IOCTL(SG_SET_KEEP_ORPHAN)
 COMPATIBLE_IOCTL(SG_GET_KEEP_ORPHAN)
-#if defined(CONFIG_PPP) || defined(CONFIG_PPP_MODULE)
 /* PPP stuff */
 COMPATIBLE_IOCTL(PPPIOCGFLAGS)
 COMPATIBLE_IOCTL(PPPIOCSFLAGS)
@@ -333,7 +334,6 @@
 /* PPPOX */
 COMPATIBLE_IOCTL(PPPOEIOCSFWD)
 COMPATIBLE_IOCTL(PPPOEIOCDFWD)
-#endif
 /* LP */
 COMPATIBLE_IOCTL(LPGETSTATUS)
 /* CDROM stuff */
@@ -348,7 +348,7 @@
 COMPATIBLE_IOCTL(CDROMEJECT)
 COMPATIBLE_IOCTL(CDROMVOLCTRL)
 COMPATIBLE_IOCTL(CDROMSUBCHNL)
-COMPATIBLE_IOCTL(CDROMEJECT_SW)
+ULONG_IOCTL(CDROMEJECT_SW)
 COMPATIBLE_IOCTL(CDROMMULTISESSION)
 COMPATIBLE_IOCTL(CDROM_GET_MCN)
 COMPATIBLE_IOCTL(CDROMRESET)
@@ -356,16 +356,16 @@
 COMPATIBLE_IOCTL(CDROMSEEK)
 COMPATIBLE_IOCTL(CDROMPLAYBLK)
 COMPATIBLE_IOCTL(CDROMCLOSETRAY)
-COMPATIBLE_IOCTL(CDROM_SET_OPTIONS)
-COMPATIBLE_IOCTL(CDROM_CLEAR_OPTIONS)
-COMPATIBLE_IOCTL(CDROM_SELECT_SPEED)
-COMPATIBLE_IOCTL(CDROM_SELECT_DISC)
-COMPATIBLE_IOCTL(CDROM_MEDIA_CHANGED)
-COMPATIBLE_IOCTL(CDROM_DRIVE_STATUS)
+ULONG_IOCTL(CDROM_SET_OPTIONS)
+ULONG_IOCTL(CDROM_CLEAR_OPTIONS)
+ULONG_IOCTL(CDROM_SELECT_SPEED)
+ULONG_IOCTL(CDROM_SELECT_DISC)
+ULONG_IOCTL(CDROM_MEDIA_CHANGED)
+ULONG_IOCTL(CDROM_DRIVE_STATUS)
 COMPATIBLE_IOCTL(CDROM_DISC_STATUS)
 COMPATIBLE_IOCTL(CDROM_CHANGER_NSLOTS)
-COMPATIBLE_IOCTL(CDROM_LOCKDOOR)
-COMPATIBLE_IOCTL(CDROM_DEBUG)
+ULONG_IOCTL(CDROM_LOCKDOOR)
+ULONG_IOCTL(CDROM_DEBUG)
 COMPATIBLE_IOCTL(CDROM_GET_CAPABILITY)
 /* Ignore cdrom.h about these next 5 ioctls, they absolutely do
  * not take a struct cdrom_read, instead they take a struct cdrom_msf
@@ -381,13 +381,12 @@
 COMPATIBLE_IOCTL(DVD_WRITE_STRUCT)
 COMPATIBLE_IOCTL(DVD_AUTH)
 /* Big L */
-COMPATIBLE_IOCTL(LOOP_SET_FD)
+ULONG_IOCTL(LOOP_SET_FD)
 COMPATIBLE_IOCTL(LOOP_CLR_FD)
 COMPATIBLE_IOCTL(LOOP_GET_STATUS64)
 COMPATIBLE_IOCTL(LOOP_SET_STATUS64)
 /* Big A */
 /* sparc only */
-#if defined(CONFIG_SOUND) || defined (CONFIG_SOUND_MODULE)
 /* Big Q for sound/OSS */
 COMPATIBLE_IOCTL(SNDCTL_SEQ_RESET)
 COMPATIBLE_IOCTL(SNDCTL_SEQ_SYNC)
@@ -542,10 +541,9 @@
 COMPATIBLE_IOCTL(SOUND_MIXER_GETLEVELS)
 COMPATIBLE_IOCTL(SOUND_MIXER_SETLEVELS)
 COMPATIBLE_IOCTL(OSS_GETVERSION)
-#endif
 /* AUTOFS */
-COMPATIBLE_IOCTL(AUTOFS_IOC_READY)
-COMPATIBLE_IOCTL(AUTOFS_IOC_FAIL)
+ULONG_IOCTL(AUTOFS_IOC_READY)
+ULONG_IOCTL(AUTOFS_IOC_FAIL)
 COMPATIBLE_IOCTL(AUTOFS_IOC_CATATONIC)
 COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOVER)
 COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE)
@@ -572,7 +570,6 @@
 COMPATIBLE_IOCTL(NCP_IOC_SETCHARSETS)
 COMPATIBLE_IOCTL(NCP_IOC_GETDENTRYTTL)
 COMPATIBLE_IOCTL(NCP_IOC_SETDENTRYTTL)
-#if defined(CONFIG_ATM) || defined(CONFIG_ATM_MODULE)
 /* Little a */
 COMPATIBLE_IOCTL(ATMSIGD_CTRL)
 COMPATIBLE_IOCTL(ATMARPD_CTRL)
@@ -589,7 +586,6 @@
 COMPATIBLE_IOCTL(ATMTCP_REMOVE)
 COMPATIBLE_IOCTL(ATMMPC_CTRL)
 COMPATIBLE_IOCTL(ATMMPC_DATA)
-#endif
 /* Big W */
 /* WIOC_GETSUPPORT not yet implemented -E */
 COMPATIBLE_IOCTL(WDIOC_GETSTATUS)
@@ -604,7 +600,6 @@
 COMPATIBLE_IOCTL(RNDADDENTROPY)
 COMPATIBLE_IOCTL(RNDZAPENTCNT)
 COMPATIBLE_IOCTL(RNDCLEARPOOL)
-#if defined(CONFIG_BT) || defined(CONFIG_BT_MODULE)
 /* Bluetooth ioctls */
 COMPATIBLE_IOCTL(HCIDEVUP)
 COMPATIBLE_IOCTL(HCIDEVDOWN)
@@ -635,8 +630,6 @@
 COMPATIBLE_IOCTL(BNEPCONNDEL)
 COMPATIBLE_IOCTL(BNEPGETCONNLIST)
 COMPATIBLE_IOCTL(BNEPGETCONNINFO)
-#endif
-#ifdef CONFIG_PCI
 /* Misc. */
 COMPATIBLE_IOCTL(0x41545900)		/* ATYIO_CLKR */
 COMPATIBLE_IOCTL(0x41545901)		/* ATYIO_CLKW */
@@ -644,8 +637,6 @@
 COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_IO)
 COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_MEM)
 COMPATIBLE_IOCTL(PCIIOC_WRITE_COMBINE)
-#endif
-#if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
 /* USB */
 COMPATIBLE_IOCTL(USBDEVFS_RESETEP)
 COMPATIBLE_IOCTL(USBDEVFS_SETINTERFACE)
@@ -658,8 +649,6 @@
 COMPATIBLE_IOCTL(USBDEVFS_HUB_PORTINFO)
 COMPATIBLE_IOCTL(USBDEVFS_RESET)
 COMPATIBLE_IOCTL(USBDEVFS_CLEAR_HALT)
-#endif
-#if defined(CONFIG_MTD) || defined(CONFIG_MTD_MODULE)
 /* MTD */
 COMPATIBLE_IOCTL(MEMGETINFO)
 COMPATIBLE_IOCTL(MEMERASE)
@@ -667,16 +656,15 @@
 COMPATIBLE_IOCTL(MEMUNLOCK)
 COMPATIBLE_IOCTL(MEMGETREGIONCOUNT)
 COMPATIBLE_IOCTL(MEMGETREGIONINFO)
-#endif
 /* NBD */
-COMPATIBLE_IOCTL(NBD_SET_SOCK)
-COMPATIBLE_IOCTL(NBD_SET_BLKSIZE)
-COMPATIBLE_IOCTL(NBD_SET_SIZE)
+ULONG_IOCTL(NBD_SET_SOCK)
+ULONG_IOCTL(NBD_SET_BLKSIZE)
+ULONG_IOCTL(NBD_SET_SIZE)
 COMPATIBLE_IOCTL(NBD_DO_IT)
 COMPATIBLE_IOCTL(NBD_CLEAR_SOCK)
 COMPATIBLE_IOCTL(NBD_CLEAR_QUE)
 COMPATIBLE_IOCTL(NBD_PRINT_DEBUG)
-COMPATIBLE_IOCTL(NBD_SET_SIZE_BLOCKS)
+ULONG_IOCTL(NBD_SET_SIZE_BLOCKS)
 COMPATIBLE_IOCTL(NBD_DISCONNECT)
 /* i2c */
 COMPATIBLE_IOCTL(I2C_SLAVE)
@@ -685,3 +673,34 @@
 COMPATIBLE_IOCTL(I2C_PEC)
 COMPATIBLE_IOCTL(I2C_RETRIES)
 COMPATIBLE_IOCTL(I2C_TIMEOUT)
+/* wireless */
+COMPATIBLE_IOCTL(SIOCSIWCOMMIT)
+COMPATIBLE_IOCTL(SIOCGIWNAME)
+COMPATIBLE_IOCTL(SIOCSIWNWID)
+COMPATIBLE_IOCTL(SIOCGIWNWID)
+COMPATIBLE_IOCTL(SIOCSIWFREQ)
+COMPATIBLE_IOCTL(SIOCGIWFREQ)
+COMPATIBLE_IOCTL(SIOCSIWMODE)
+COMPATIBLE_IOCTL(SIOCGIWMODE)
+COMPATIBLE_IOCTL(SIOCSIWSENS)
+COMPATIBLE_IOCTL(SIOCGIWSENS)
+COMPATIBLE_IOCTL(SIOCSIWRANGE)
+COMPATIBLE_IOCTL(SIOCSIWPRIV)
+COMPATIBLE_IOCTL(SIOCGIWPRIV)
+COMPATIBLE_IOCTL(SIOCSIWSTATS)
+COMPATIBLE_IOCTL(SIOCGIWSTATS)
+COMPATIBLE_IOCTL(SIOCSIWAP)
+COMPATIBLE_IOCTL(SIOCGIWAP)
+COMPATIBLE_IOCTL(SIOCSIWSCAN)
+COMPATIBLE_IOCTL(SIOCSIWRATE)
+COMPATIBLE_IOCTL(SIOCGIWRATE)
+COMPATIBLE_IOCTL(SIOCSIWRTS)
+COMPATIBLE_IOCTL(SIOCGIWRTS)
+COMPATIBLE_IOCTL(SIOCSIWFRAG)
+COMPATIBLE_IOCTL(SIOCGIWFRAG)
+COMPATIBLE_IOCTL(SIOCSIWTXPOW)
+COMPATIBLE_IOCTL(SIOCGIWTXPOW)
+COMPATIBLE_IOCTL(SIOCSIWRETRY)
+COMPATIBLE_IOCTL(SIOCGIWRETRY)
+COMPATIBLE_IOCTL(SIOCSIWPOWER)
+COMPATIBLE_IOCTL(SIOCGIWPOWER)
diff -Nru a/include/linux/compiler-gcc+.h b/include/linux/compiler-gcc+.h
--- a/include/linux/compiler-gcc+.h	Tue Feb  3 19:45:42 2004
+++ b/include/linux/compiler-gcc+.h	Tue Feb  3 19:45:42 2004
@@ -12,3 +12,4 @@
 #define __deprecated		__attribute__((deprecated))
 #define __attribute_used__	__attribute__((__used__))
 #define __attribute_pure__	__attribute__((pure))
+#define __attribute_const__	__attribute__((__const__))
diff -Nru a/include/linux/compiler-gcc2.h b/include/linux/compiler-gcc2.h
--- a/include/linux/compiler-gcc2.h	Tue Feb  3 19:45:43 2004
+++ b/include/linux/compiler-gcc2.h	Tue Feb  3 19:45:43 2004
@@ -20,4 +20,5 @@
  */
 #if __GNUC_MINOR__ >= 96
 # define __attribute_pure__	__attribute__((pure))
+# define __attribute_const__	__attribute__((__const__))
 #endif
diff -Nru a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h
--- a/include/linux/compiler-gcc3.h	Tue Feb  3 19:45:16 2004
+++ b/include/linux/compiler-gcc3.h	Tue Feb  3 19:45:16 2004
@@ -20,3 +20,4 @@
 #endif
 
 #define __attribute_pure__	__attribute__((pure))
+#define __attribute_const__	__attribute__((__const__))
diff -Nru a/include/linux/compiler.h b/include/linux/compiler.h
--- a/include/linux/compiler.h	Tue Feb  3 19:45:30 2004
+++ b/include/linux/compiler.h	Tue Feb  3 19:45:30 2004
@@ -76,6 +76,24 @@
 # define __attribute_pure__	/* unimplemented */
 #endif
 
+/*
+ * From the GCC manual:
+ *
+ * Many functions do not examine any values except their arguments,
+ * and have no effects except the return value.  Basically this is
+ * just slightly more strict class than the `pure' attribute above,
+ * since function is not allowed to read global memory.
+ *
+ * Note that a function that has pointer arguments and examines the
+ * data pointed to must _not_ be declared `const'.  Likewise, a
+ * function that calls a non-`const' function usually must not be
+ * `const'.  It does not make sense for a `const' function to return
+ * `void'.
+ */
+#ifndef __attribute_const__
+# define __attribute_const__	/* unimplemented */
+#endif
+
 /* Optimization barrier */
 #ifndef barrier
 # define barrier() __memory_barrier()
diff -Nru a/include/linux/cpu.h b/include/linux/cpu.h
--- a/include/linux/cpu.h	Tue Feb  3 19:45:17 2004
+++ b/include/linux/cpu.h	Tue Feb  3 19:45:17 2004
@@ -37,7 +37,12 @@
 extern void unregister_cpu_notifier(struct notifier_block *nb);
 
 int cpu_up(unsigned int cpu);
+
+#define lock_cpu_hotplug()	down(&cpucontrol)
+#define unlock_cpu_hotplug()	up(&cpucontrol)
+
 #else
+
 static inline int register_cpu_notifier(struct notifier_block *nb)
 {
 	return 0;
@@ -45,6 +50,10 @@
 static inline void unregister_cpu_notifier(struct notifier_block *nb)
 {
 }
+
+#define lock_cpu_hotplug()	do { } while (0)
+#define unlock_cpu_hotplug()		do { } while (0)
+
 #endif /* CONFIG_SMP */
 extern struct sysdev_class cpu_sysdev_class;
 
diff -Nru a/include/linux/cpumask.h b/include/linux/cpumask.h
--- a/include/linux/cpumask.h	Tue Feb  3 19:45:17 2004
+++ b/include/linux/cpumask.h	Tue Feb  3 19:45:17 2004
@@ -8,32 +8,28 @@
 #ifdef CONFIG_SMP
 
 extern cpumask_t cpu_online_map;
+extern cpumask_t cpu_possible_map;
 
 #define num_online_cpus()		cpus_weight(cpu_online_map)
 #define cpu_online(cpu)			cpu_isset(cpu, cpu_online_map)
+#define cpu_possible(cpu)		cpu_isset(cpu, cpu_possible_map)
+
+#define for_each_cpu_mask(cpu, mask)					\
+	for (cpu = first_cpu_const(mk_cpumask_const(mask));		\
+		cpu < NR_CPUS;						\
+		cpu = next_cpu_const(cpu, mk_cpumask_const(mask)))
+
+#define for_each_cpu(cpu) for_each_cpu_mask(cpu, cpu_possible_map)
+#define for_each_online_cpu(cpu) for_each_cpu_mask(cpu, cpu_online_map)
 #else
 #define	cpu_online_map			cpumask_of_cpu(0)
 #define num_online_cpus()		1
 #define cpu_online(cpu)			({ BUG_ON((cpu) != 0); 1; })
-#endif
-
-static inline int next_online_cpu(int cpu, cpumask_t map)
-{
-	do
-		cpu = next_cpu_const(cpu, mk_cpumask_const(map));
-	while (cpu < NR_CPUS && !cpu_online(cpu));
-	return cpu;
-}
+#define cpu_possible(cpu)		({ BUG_ON((cpu) != 0); 1; })
 
-#define for_each_cpu(cpu, map)						\
-	for (cpu = first_cpu_const(mk_cpumask_const(map));		\
-		cpu < NR_CPUS;						\
-		cpu = next_cpu_const(cpu,mk_cpumask_const(map)))
-
-#define for_each_online_cpu(cpu, map)					\
-	for (cpu = first_cpu_const(mk_cpumask_const(map));		\
-		cpu < NR_CPUS;						\
-		cpu = next_online_cpu(cpu,map))
+#define for_each_cpu(cpu) for (cpu = 0; cpu < 1; cpu++)
+#define for_each_online_cpu(cpu) for (cpu = 0; cpu < 1; cpu++)
+#endif
 
 extern int __mask_snprintf_len(char *buf, unsigned int buflen,
 		const unsigned long *maskp, unsigned int maskbytes);
diff -Nru a/include/linux/dcache.h b/include/linux/dcache.h
--- a/include/linux/dcache.h	Tue Feb  3 19:45:43 2004
+++ b/include/linux/dcache.h	Tue Feb  3 19:45:43 2004
@@ -270,8 +270,7 @@
 static inline struct dentry *dget(struct dentry *dentry)
 {
 	if (dentry) {
-		if (!atomic_read(&dentry->d_count))
-			BUG();
+		BUG_ON(!atomic_read(&dentry->d_count));
 		atomic_inc(&dentry->d_count);
 	}
 	return dentry;
diff -Nru a/include/linux/device.h b/include/linux/device.h
--- a/include/linux/device.h	Tue Feb  3 19:45:42 2004
+++ b/include/linux/device.h	Tue Feb  3 19:45:42 2004
@@ -46,6 +46,7 @@
 struct device_driver;
 struct class;
 struct class_device;
+struct class_simple;
 
 struct bus_type {
 	char			* name;
@@ -155,6 +156,7 @@
 			   int num_envp, char *buffer, int buffer_size);
 
 	void	(*release)(struct class_device *dev);
+	void	(*class_release)(struct class *class);
 };
 
 extern int class_register(struct class *);
@@ -246,6 +248,13 @@
 extern int class_interface_register(struct class_interface *);
 extern void class_interface_unregister(struct class_interface *);
 
+/* interface for class simple stuff */
+extern struct class_simple *class_simple_create(struct module *owner, char *name);
+extern void class_simple_destroy(struct class_simple *cs);
+extern struct class_device *class_simple_device_add(struct class_simple *cs, dev_t dev, struct device *device, const char *fmt, ...)
+	__attribute__((format(printf,4,5)));
+extern void class_simple_device_remove(dev_t dev);
+
 
 struct device {
 	struct list_head node;		/* node in sibling list */
@@ -354,6 +363,7 @@
  */
 extern struct device * get_device(struct device * dev);
 extern void put_device(struct device * dev);
+extern struct device *device_find(const char *name, struct bus_type *bus);
 
 
 /* drivers/base/platform.c */
diff -Nru a/include/linux/efi.h b/include/linux/efi.h
--- a/include/linux/efi.h	Tue Feb  3 19:45:42 2004
+++ b/include/linux/efi.h	Tue Feb  3 19:45:42 2004
@@ -297,14 +297,22 @@
 extern void efi_initialize_iomem_resources(struct resource *code_resource,
 					struct resource *data_resource);
 extern efi_status_t phys_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc);
-extern unsigned long inline __init efi_get_time(void);
-extern int inline __init efi_set_rtc_mmss(unsigned long nowtime);
+extern inline unsigned long __init efi_get_time(void);
+extern inline int __init efi_set_rtc_mmss(unsigned long nowtime);
 extern struct efi_memory_map memmap;
 
+/*
+ * We play games with efi_enabled so that the compiler will, if possible, remove
+ * EFI-related code altogether.
+ */
 #ifdef CONFIG_EFI
-extern int efi_enabled;
+# ifdef CONFIG_X86
+   extern int efi_enabled;
+# else
+#  define efi_enabled 1
+# endif
 #else
-#define efi_enabled 0
+# define efi_enabled 0
 #endif
 
 /*
diff -Nru a/include/linux/eventpoll.h b/include/linux/eventpoll.h
--- a/include/linux/eventpoll.h	Tue Feb  3 19:45:17 2004
+++ b/include/linux/eventpoll.h	Tue Feb  3 19:45:17 2004
@@ -22,6 +22,9 @@
 #define EPOLL_CTL_DEL 2
 #define EPOLL_CTL_MOD 3
 
+/* Set the One Shot behaviour for the target file descriptor */
+#define EPOLLONESHOT (1 << 30)
+
 /* Set the Edge Triggered behaviour for the target file descriptor */
 #define EPOLLET (1 << 31)
 
diff -Nru a/include/linux/ext2_fs_sb.h b/include/linux/ext2_fs_sb.h
--- a/include/linux/ext2_fs_sb.h	Tue Feb  3 19:45:42 2004
+++ b/include/linux/ext2_fs_sb.h	Tue Feb  3 19:45:42 2004
@@ -45,6 +45,7 @@
 	int s_desc_per_block_bits;
 	int s_inode_size;
 	int s_first_ino;
+	spinlock_t s_next_gen_lock;
 	u32 s_next_generation;
 	unsigned long s_dir_count;
 	u8 *s_debts;
diff -Nru a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h
--- a/include/linux/ext3_fs_sb.h	Tue Feb  3 19:45:42 2004
+++ b/include/linux/ext3_fs_sb.h	Tue Feb  3 19:45:42 2004
@@ -49,6 +49,7 @@
 	int s_desc_per_block_bits;
 	int s_inode_size;
 	int s_first_ino;
+	spinlock_t s_next_gen_lock;
 	u32 s_next_generation;
 	u32 s_hash_seed[4];
 	int s_def_hash_version;
diff -Nru a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h
--- a/include/linux/ext3_jbd.h	Tue Feb  3 19:45:16 2004
+++ b/include/linux/ext3_jbd.h	Tue Feb  3 19:45:16 2004
@@ -221,13 +221,24 @@
 
 static inline int ext3_should_order_data(struct inode *inode)
 {
-	return (test_opt(inode->i_sb, DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA);
+	if (!S_ISREG(inode->i_mode))
+		return 0;
+	if (EXT3_I(inode)->i_flags & EXT3_JOURNAL_DATA_FL)
+		return 0;
+	if (test_opt(inode->i_sb, DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA)
+		return 1;
+	return 0;
 }
 
 static inline int ext3_should_writeback_data(struct inode *inode)
 {
-	return !ext3_should_journal_data(inode) &&
-			!ext3_should_order_data(inode);
+	if (!S_ISREG(inode->i_mode))
+		return 0;
+	if (EXT3_I(inode)->i_flags & EXT3_JOURNAL_DATA_FL)
+		return 0;
+	if (test_opt(inode->i_sb, DATA_FLAGS) == EXT3_MOUNT_WRITEBACK_DATA)
+		return 1;
+	return 0;
 }
 
 #endif	/* _LINUX_EXT3_JBD_H */
diff -Nru a/include/linux/fs.h b/include/linux/fs.h
--- a/include/linux/fs.h	Tue Feb  3 19:45:17 2004
+++ b/include/linux/fs.h	Tue Feb  3 19:45:17 2004
@@ -353,6 +353,13 @@
 	int			bd_invalidated;
 	struct gendisk *	bd_disk;
 	struct list_head	bd_list;
+	/*
+	 * Private data.  You must have bd_claim'ed the block_device
+	 * to use this.  NOTE:  bd_claim allows an owner to claim
+	 * the same device multiple times, the owner must take special
+	 * care to not mess up bd_private for that case.
+	 */
+	unsigned long		bd_private;
 };
 
 /*
@@ -480,6 +487,8 @@
 	return MAJOR(inode->i_rdev);
 }
 
+extern struct block_device *I_BDEV(struct inode *inode);
+
 struct fown_struct {
 	rwlock_t lock;          /* protects pid, uid, euid fields */
 	int pid;		/* pid or -pgrp where SIGIO should be sent */
@@ -523,9 +532,12 @@
 	/* needed for tty driver, and maybe others */
 	void			*private_data;
 
+#ifdef CONFIG_EPOLL
 	/* Used by fs/eventpoll.c to link all the hooks to this file */
 	struct list_head	f_ep_links;
 	spinlock_t		f_ep_lock;
+#endif /* #ifdef CONFIG_EPOLL */
+	struct address_space	*f_mapping;
 };
 extern spinlock_t files_lock;
 #define file_list_lock() spin_lock(&files_lock);
@@ -1124,11 +1136,9 @@
 extern int register_blkdev(unsigned int, const char *);
 extern int unregister_blkdev(unsigned int, const char *);
 extern struct block_device *bdget(dev_t);
-extern int bd_acquire(struct inode *inode);
 extern void bd_forget(struct inode *inode);
 extern void bdput(struct block_device *);
 extern int blkdev_open(struct inode *, struct file *);
-extern int blkdev_close(struct inode *, struct file *);
 extern struct block_device *open_by_devnum(dev_t, unsigned, int);
 extern struct file_operations def_blk_fops;
 extern struct address_space_operations def_blk_aops;
@@ -1296,8 +1306,7 @@
 extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
 extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
 extern ssize_t generic_file_read(struct file *, char __user *, size_t, loff_t *);
-int generic_write_checks(struct inode *inode, struct file *file,
-			loff_t *pos, size_t *count, int isblk);
+int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk);
 extern ssize_t generic_file_write(struct file *, const char __user *, size_t, loff_t *);
 extern ssize_t generic_file_aio_read(struct kiocb *, char __user *, size_t, loff_t);
 extern ssize_t __generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t *);
@@ -1331,7 +1340,7 @@
 					read_descriptor_t * desc,
 					read_actor_t actor)
 {
-	do_generic_mapping_read(filp->f_dentry->d_inode->i_mapping,
+	do_generic_mapping_read(filp->f_mapping,
 				&filp->f_ra,
 				filp,
 				ppos,
diff -Nru a/include/linux/genhd.h b/include/linux/genhd.h
--- a/include/linux/genhd.h	Tue Feb  3 19:45:17 2004
+++ b/include/linux/genhd.h	Tue Feb  3 19:45:17 2004
@@ -82,7 +82,7 @@
 	int major;			/* major number of driver */
 	int first_minor;
 	int minors;
-	char disk_name[16];		/* name of major driver */
+	char disk_name[32];		/* name of major driver */
 	struct hd_struct **part;	/* [indexed by minor] */
 	struct block_device_operations *fops;
 	struct request_queue *queue;
diff -Nru a/include/linux/highmem.h b/include/linux/highmem.h
--- a/include/linux/highmem.h	Tue Feb  3 19:45:35 2004
+++ b/include/linux/highmem.h	Tue Feb  3 19:45:35 2004
@@ -56,8 +56,7 @@
 {
 	void *kaddr;
 
-	if (offset + size > PAGE_SIZE)
-		BUG();
+	BUG_ON(offset + size > PAGE_SIZE);
 
 	kaddr = kmap_atomic(page, KM_USER0);
 	memset((char *)kaddr + offset, 0, size);
diff -Nru a/include/linux/i2c-id.h b/include/linux/i2c-id.h
--- a/include/linux/i2c-id.h	Tue Feb  3 19:45:16 2004
+++ b/include/linux/i2c-id.h	Tue Feb  3 19:45:16 2004
@@ -154,6 +154,9 @@
 #define I2C_DRIVERID_W83627HF 1038
 #define I2C_DRIVERID_LM85 1039
 #define I2C_DRIVERID_LM83 1040
+#define I2C_DRIVERID_LM90 1042
+#define I2C_DRIVERID_ASB100 1043
+#define I2C_DRIVERID_W83L785TS 1047
 
 /*
  * ---- Adapter types ----------------------------------------------------
diff -Nru a/include/linux/ide.h b/include/linux/ide.h
--- a/include/linux/ide.h	Tue Feb  3 19:45:17 2004
+++ b/include/linux/ide.h	Tue Feb  3 19:45:17 2004
@@ -279,7 +279,7 @@
 		ide_pdc4030,	ide_rz1000,	ide_trm290,
 		ide_cmd646,	ide_cy82c693,	ide_4drives,
 		ide_pmac,	ide_etrax100,	ide_acorn,
-		ide_pc9800
+		ide_pc9800,	ide_forced
 } hwif_chipset_t;
 
 /*
@@ -1231,7 +1231,6 @@
  */
 #ifndef _IDE_C
 extern	ide_hwif_t	ide_hwifs[];		/* master data repository */
-extern int (*ide_probe)(void);
 
 extern ide_devices_t   *idedisk;
 extern ide_devices_t   *idecd;
@@ -1512,64 +1511,6 @@
 int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long);
 int ide_cmd_ioctl(ide_drive_t *, unsigned int, unsigned long);
 int ide_task_ioctl(ide_drive_t *, unsigned int, unsigned long);
-
-#if 0
-
-#define IDEFLOPPY_PC_BUFFER_SIZE        256
-#define IDETAPE_PC_BUFFER_SIZE          256
-#define IDE_PC_BUFFER_SIZE          256
-
-typedef struct ide_packet_command_s {
-		/* Actual packet bytes */
-	u8 c[12];
-		/* On each retry, we increment retries */
-	int retries;
-		/* Error code */
-	int error;
-		/* Bytes to transfer */
-	int request_transfer;
-		/* Bytes actually transferred */
-	int actually_transferred;
-		/* Size of our data buffer */
-	int buffer_size;
-
-	struct buffer_head *bh;
-	u8 *b_data;
-		/* The corresponding request */
-	struct request *rq;
-# if 0
-		/* Scatter gather table */
-	struct scatterlist *sg;
-# endif
-	int b_count;
-		/* Data buffer */
-	u8 *buffer;
-		/* Pointer into the above buffer */
-	u8 *current_position;
-		/* Called when this packet command is completed */
-	ide_startstop_t (*callback) (ide_drive_t *);
-		/* Temporary buffer */
-	u8 pc_buffer[IDE_PC_BUFFER_SIZE];
-		/* Status/Action bit flags: long for set_bit */
-	unsigned long flags;
-} ide_pc_t;
-
-ide-cd orthoginal :-/
-struct packet_command {
-        char *buffer;
-        int buflen;
-        int stat;
-        int quiet;
-        int timeout;
-        struct request_sense *sense;
-        unsigned char c[12];
-};
-
-#endif
-
-#ifdef CONFIG_PKT_TASK_IOCTL
-extern int pkt_taskfile_ioctl(ide_drive_t *, struct inode *, struct file *, unsigned int, unsigned long);
-#endif /* CONFIG_PKT_TASK_IOCTL */
 
 extern void ide_delay_50ms(void);
 extern int system_bus_clock(void);
diff -Nru a/include/linux/input.h b/include/linux/input.h
--- a/include/linux/input.h	Tue Feb  3 19:45:17 2004
+++ b/include/linux/input.h	Tue Feb  3 19:45:17 2004
@@ -189,18 +189,18 @@
 #define KEY_KP3			81
 #define KEY_KP0			82
 #define KEY_KPDOT		83
-#define KEY_103RD		84
-#define KEY_F13			85
+
+#define KEY_ZENKAKUHANKAKU	85
 #define KEY_102ND		86
 #define KEY_F11			87
 #define KEY_F12			88
-#define KEY_F14			89
-#define KEY_F15			90
-#define KEY_F16			91
-#define KEY_F17			92
-#define KEY_F18			93
-#define KEY_F19			94
-#define KEY_F20			95
+#define KEY_RO			89
+#define KEY_KATAKANA		90
+#define KEY_HIRAGANA		91
+#define KEY_HENKAN		92
+#define KEY_KATAKANAHIRAGANA	93
+#define KEY_MUHENKAN		94
+#define KEY_KPJPCOMMA		95
 #define KEY_KPENTER		96
 #define KEY_RIGHTCTRL		97
 #define KEY_KPSLASH		98
@@ -225,11 +225,11 @@
 #define KEY_KPEQUAL		117
 #define KEY_KPPLUSMINUS		118
 #define KEY_PAUSE		119
-#define KEY_F21			120
-#define KEY_F22			121
-#define KEY_F23			122
-#define KEY_F24			123
-#define KEY_KPCOMMA		124
+
+#define KEY_KPCOMMA		121
+#define KEY_HANGUEL		122
+#define KEY_HANJA		123
+#define KEY_YEN			124
 #define KEY_LEFTMETA		125
 #define KEY_RIGHTMETA		126
 #define KEY_COMPOSE		127
@@ -288,24 +288,18 @@
 #define KEY_KPLEFTPAREN		179
 #define KEY_KPRIGHTPAREN	180
 
-#define KEY_INTL1		181
-#define KEY_INTL2		182
-#define KEY_INTL3		183
-#define KEY_INTL4		184
-#define KEY_INTL5		185
-#define KEY_INTL6		186
-#define KEY_INTL7		187
-#define KEY_INTL8		188
-#define KEY_INTL9		189
-#define KEY_LANG1		190
-#define KEY_LANG2		191
-#define KEY_LANG3		192
-#define KEY_LANG4		193
-#define KEY_LANG5		194
-#define KEY_LANG6		195
-#define KEY_LANG7		196
-#define KEY_LANG8		197
-#define KEY_LANG9		198
+#define KEY_F13			183
+#define KEY_F14			184
+#define KEY_F15			185
+#define KEY_F16			186
+#define KEY_F17			187
+#define KEY_F18			188
+#define KEY_F19			189
+#define KEY_F20			190
+#define KEY_F21			191
+#define KEY_F22			192
+#define KEY_F23			193
+#define KEY_F24			194
 
 #define KEY_PLAYCD		200
 #define KEY_PAUSECD		201
@@ -580,6 +574,7 @@
 #define BUS_ISAPNP		0x02
 #define BUS_USB			0x03
 #define BUS_HIL			0x04
+#define BUS_BLUETOOTH		0x05
 
 #define BUS_ISA			0x10
 #define BUS_I8042		0x11
@@ -809,6 +804,7 @@
 	int (*erase_effect)(struct input_dev *dev, int effect_id);
 
 	struct input_handle *grab;
+	struct device *dev;
 
 	struct list_head	h_list;
 	struct list_head	node;
@@ -921,7 +917,7 @@
 #define input_regs(a,b)		do { (a)->regs = (b); } while (0)
 #define input_sync(a)		do { input_event(a, EV_SYN, SYN_REPORT, 0); (a)->regs = NULL; } while (0)
 
-extern struct class input_class;
+extern struct class_simple *input_class;
 
 #endif
 #endif
diff -Nru a/include/linux/ipv6.h b/include/linux/ipv6.h
--- a/include/linux/ipv6.h	Tue Feb  3 19:45:34 2004
+++ b/include/linux/ipv6.h	Tue Feb  3 19:45:34 2004
@@ -143,6 +143,7 @@
 	__s32		regen_max_retry;
 	__s32		max_desync_factor;
 #endif
+	__s32		max_addresses;
 	void		*sysctl;
 };
 
@@ -158,13 +159,12 @@
 	DEVCONF_RTR_SOLICITS,
 	DEVCONF_RTR_SOLICIT_INTERVAL,
 	DEVCONF_RTR_SOLICIT_DELAY,
-#ifdef CONFIG_IPV6_PRIVACY
 	DEVCONF_USE_TEMPADDR,
 	DEVCONF_TEMP_VALID_LFT,
 	DEVCONF_TEMP_PREFERED_LFT,
 	DEVCONF_REGEN_MAX_RETRY,
 	DEVCONF_MAX_DESYNC_FACTOR,
-#endif
+	DEVCONF_MAX_ADDRESSES,
 	DEVCONF_MAX
 };
 
diff -Nru a/include/linux/kernel.h b/include/linux/kernel.h
--- a/include/linux/kernel.h	Tue Feb  3 19:45:16 2004
+++ b/include/linux/kernel.h	Tue Feb  3 19:45:16 2004
@@ -89,6 +89,8 @@
 
 unsigned long int_sqrt(unsigned long);
 
+extern int printk_ratelimit(void);
+
 static inline void console_silent(void)
 {
 	console_loglevel = 0;
diff -Nru a/include/linux/kobject.h b/include/linux/kobject.h
--- a/include/linux/kobject.h	Tue Feb  3 19:45:16 2004
+++ b/include/linux/kobject.h	Tue Feb  3 19:45:16 2004
@@ -56,6 +56,7 @@
 extern struct kobject * kobject_get(struct kobject *);
 extern void kobject_put(struct kobject *);
 
+extern void kobject_hotplug(const char *action, struct kobject *);
 
 struct kobj_type {
 	void (*release)(struct kobject *);
diff -Nru a/include/linux/miscdevice.h b/include/linux/miscdevice.h
--- a/include/linux/miscdevice.h	Tue Feb  3 19:45:29 2004
+++ b/include/linux/miscdevice.h	Tue Feb  3 19:45:29 2004
@@ -36,12 +36,15 @@
 
 #define TUN_MINOR	     200
 
+struct device;
+
 struct miscdevice 
 {
 	int minor;
 	const char *name;
 	struct file_operations *fops;
 	struct list_head list;
+	struct device *dev;
 	char devfs_name[64];
 };
 
diff -Nru a/include/linux/mm.h b/include/linux/mm.h
--- a/include/linux/mm.h	Tue Feb  3 19:45:16 2004
+++ b/include/linux/mm.h	Tue Feb  3 19:45:16 2004
@@ -223,7 +223,6 @@
 		atomic_dec_and_test(&(p)->count);	\
 	})
 
-#define page_count(p)		atomic_read(&(p)->count)
 #define set_page_count(p,v) 	atomic_set(&(p)->count, v)
 #define __put_page(p)		atomic_dec(&(p)->count)
 
@@ -231,6 +230,13 @@
 
 #ifdef CONFIG_HUGETLB_PAGE
 
+static inline int page_count(struct page *p)
+{
+	if (PageCompound(p))
+		p = (struct page *)p->lru.next;
+	return atomic_read(&(p)->count);
+}
+
 static inline void get_page(struct page *page)
 {
 	if (PageCompound(page))
@@ -257,6 +263,8 @@
 
 #else		/* CONFIG_HUGETLB_PAGE */
 
+#define page_count(p)		atomic_read(&(p)->count)
+
 static inline void get_page(struct page *page)
 {
 	atomic_inc(&page->count);
@@ -322,23 +330,33 @@
 /*
  * The zone field is never updated after free_area_init_core()
  * sets it, so none of the operations on it need to be atomic.
- * We'll have up to log2(MAX_NUMNODES * MAX_NR_ZONES) zones
- * total, so we use NODES_SHIFT here to get enough bits.
+ * We'll have up to (MAX_NUMNODES * MAX_NR_ZONES) zones total,
+ * so we use (MAX_NODES_SHIFT + MAX_ZONES_SHIFT) here to get enough bits.
  */
-#define ZONE_SHIFT (BITS_PER_LONG - NODES_SHIFT - MAX_NR_ZONES_SHIFT)
+#define NODEZONE_SHIFT (BITS_PER_LONG - MAX_NODES_SHIFT - MAX_ZONES_SHIFT)
+#define NODEZONE(node, zone)	((node << ZONES_SHIFT) | zone)
+
+static inline unsigned long page_zonenum(struct page *page)
+{
+	return (page->flags >> NODEZONE_SHIFT) & (~(~0UL << ZONES_SHIFT));
+}
+static inline unsigned long page_nodenum(struct page *page)
+{
+	return (page->flags >> (NODEZONE_SHIFT + ZONES_SHIFT));
+}
 
 struct zone;
 extern struct zone *zone_table[];
 
 static inline struct zone *page_zone(struct page *page)
 {
-	return zone_table[page->flags >> ZONE_SHIFT];
+	return zone_table[page->flags >> NODEZONE_SHIFT];
 }
 
-static inline void set_page_zone(struct page *page, unsigned long zone_num)
+static inline void set_page_zone(struct page *page, unsigned long nodezone_num)
 {
-	page->flags &= ~(~0UL << ZONE_SHIFT);
-	page->flags |= zone_num << ZONE_SHIFT;
+	page->flags &= ~(~0UL << NODEZONE_SHIFT);
+	page->flags |= nodezone_num << NODEZONE_SHIFT;
 }
 
 #ifndef CONFIG_DISCONTIGMEM
@@ -622,6 +640,34 @@
 kernel_map_pages(struct page *page, int numpages, int enable)
 {
 }
+#endif
+
+#ifndef CONFIG_ARCH_GATE_AREA
+#ifdef AT_SYSINFO_EHDR
+static inline int in_gate_area(struct task_struct *task, unsigned long addr)
+{
+	if ((addr >= FIXADDR_USER_START) && (addr < FIXADDR_USER_END))
+		return 1;
+	else
+		return 0;
+}
+
+extern struct vm_area_struct gate_vma;
+static inline struct vm_area_struct *get_gate_vma(struct task_struct *tsk)
+{
+	return &gate_vma;
+}
+#else
+static inline int in_gate_area(struct task_struct *task, unsigned long addr)
+{
+	return 0;
+}
+
+static inline struct vm_area_struct *get_gate_vma(struct task_struct *tsk)
+{
+	return NULL;
+}
+#endif
 #endif
 
 #endif /* __KERNEL__ */
diff -Nru a/include/linux/mmzone.h b/include/linux/mmzone.h
--- a/include/linux/mmzone.h	Tue Feb  3 19:45:29 2004
+++ b/include/linux/mmzone.h	Tue Feb  3 19:45:29 2004
@@ -160,12 +160,19 @@
 #define ZONE_NORMAL		1
 #define ZONE_HIGHMEM		2
 
-#define MAX_NR_ZONES		3	/* Sync this with MAX_NR_ZONES_SHIFT */
-#define MAX_NR_ZONES_SHIFT	2	/* ceil(log2(MAX_NR_ZONES)) */
+#define MAX_NR_ZONES		3	/* Sync this with ZONES_SHIFT */
+#define ZONES_SHIFT		2	/* ceil(log2(MAX_NR_ZONES)) */
 
 #define GFP_ZONEMASK	0x03
 
 /*
+ * The "priority" of VM scanning is how much of the queues we will scan in one
+ * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the
+ * queues ("queue_length >> 12") during an aging round.
+ */
+#define DEF_PRIORITY 12
+
+/*
  * One allocation request operates on a zonelist. A zonelist
  * is a list of zones, the first one is the 'goal' of the
  * allocation, the other zones are fallback zones, in decreasing
@@ -303,7 +310,7 @@
 extern struct pglist_data contig_page_data;
 #define NODE_DATA(nid)		(&contig_page_data)
 #define NODE_MEM_MAP(nid)	mem_map
-#define MAX_NODES_SHIFT		0
+#define MAX_NODES_SHIFT		1
 
 #else /* CONFIG_DISCONTIGMEM */
 
@@ -311,7 +318,7 @@
 
 #if BITS_PER_LONG == 32
 /*
- * with 32 bit flags field, page->zone is currently 8 bits.
+ * with 32 bit page->flags field, we reserve 8 bits for node/zone info.
  * there are 3 zones (2 bits) and this leaves 8-2=6 bits for nodes.
  */
 #define MAX_NODES_SHIFT		6
@@ -326,6 +333,13 @@
 
 #if NODES_SHIFT > MAX_NODES_SHIFT
 #error NODES_SHIFT > MAX_NODES_SHIFT
+#endif
+
+/* There are currently 3 zones: DMA, Normal & Highmem, thus we need 2 bits */
+#define MAX_ZONES_SHIFT		2
+
+#if ZONES_SHIFT > MAX_ZONES_SHIFT
+#error ZONES_SHIFT > MAX_ZONES_SHIFT
 #endif
 
 extern DECLARE_BITMAP(node_online_map, MAX_NUMNODES);
diff -Nru a/include/linux/module.h b/include/linux/module.h
--- a/include/linux/module.h	Tue Feb  3 19:45:37 2004
+++ b/include/linux/module.h	Tue Feb  3 19:45:37 2004
@@ -54,12 +54,16 @@
 search_extable(const struct exception_table_entry *first,
 	       const struct exception_table_entry *last,
 	       unsigned long value);
+void sort_extable(struct exception_table_entry *start,
+		  struct exception_table_entry *finish);
+void sort_main_extable(void);
 
 #ifdef MODULE
 #define ___module_cat(a,b) __mod_ ## a ## b
 #define __module_cat(a,b) ___module_cat(a,b)
 #define __MODULE_INFO(tag, name, info)					  \
 static const char __module_cat(name,__LINE__)[]				  \
+  __attribute_used__							  \
   __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info
 
 #define MODULE_GENERIC_TABLE(gtype,name)			\
@@ -142,6 +146,7 @@
 #define __CRC_SYMBOL(sym, sec)					\
 	extern void *__crc_##sym __attribute__((weak));		\
 	static const unsigned long __kcrctab_##sym		\
+	__attribute_used__					\
 	__attribute__((section("__kcrctab" sec), unused))	\
 	= (unsigned long) &__crc_##sym;
 #else
@@ -155,6 +160,7 @@
 	__attribute__((section("__ksymtab_strings")))		\
 	= MODULE_SYMBOL_PREFIX #sym;                    	\
 	static const struct kernel_symbol __ksymtab_##sym	\
+	__attribute_used__					\
 	__attribute__((section("__ksymtab" sec), unused))	\
 	= { (unsigned long)&sym, __kstrtab_##sym }
 
diff -Nru a/include/linux/moduleparam.h b/include/linux/moduleparam.h
--- a/include/linux/moduleparam.h	Tue Feb  3 19:45:17 2004
+++ b/include/linux/moduleparam.h	Tue Feb  3 19:45:17 2004
@@ -52,6 +52,7 @@
 #define __module_param_call(prefix, name, set, get, arg, perm)		\
 	static char __param_str_##name[] __initdata = prefix #name;	\
 	static struct kernel_param const __param_##name			\
+	__attribute_used__						\
     __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
 	= { __param_str_##name, perm, set, get, arg }
 
diff -Nru a/include/linux/net.h b/include/linux/net.h
--- a/include/linux/net.h	Tue Feb  3 19:45:17 2004
+++ b/include/linux/net.h	Tue Feb  3 19:45:17 2004
@@ -120,9 +120,9 @@
 	int		(*getsockopt)(struct socket *sock, int level,
 				      int optname, char __user *optval, int __user *optlen);
 	int		(*sendmsg)   (struct kiocb *iocb, struct socket *sock,
-				      struct msghdr *m, int total_len);
+				      struct msghdr *m, size_t total_len);
 	int		(*recvmsg)   (struct kiocb *iocb, struct socket *sock,
-				      struct msghdr *m, int total_len,
+				      struct msghdr *m, size_t total_len,
 				      int flags);
 	int		(*mmap)	     (struct file *file, struct socket *sock,
 				      struct vm_area_struct * vma);
@@ -151,13 +151,13 @@
 				 struct socket **res);
 extern void	     sock_release(struct socket *sock);
 extern int   	     sock_sendmsg(struct socket *sock, struct msghdr *msg,
-				  int len);
+				  size_t len);
 extern int	     sock_recvmsg(struct socket *sock, struct msghdr *msg,
-				  int size, int flags);
+				  size_t size, int flags);
 extern int	     sock_readv_writev(int type, struct inode *inode,
 				       struct file *file,
 				       const struct iovec *iov, long count,
-				       long size);
+				       size_t size);
 extern int 	     sock_map_fd(struct socket *sock);
 extern struct socket *sockfd_lookup(int fd, int *err);
 #define		     sockfd_put(sock) fput(sock->file)
@@ -216,9 +216,9 @@
 			 char *optval, int optlen), (sock, level, optname, optval, optlen)) \
 SOCKCALL_WRAP(name, getsockopt, (struct socket *sock, int level, int optname, \
 			 char *optval, int *optlen), (sock, level, optname, optval, optlen)) \
-SOCKCALL_WRAP(name, sendmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, int len), \
+SOCKCALL_WRAP(name, sendmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, size_t len), \
 	      (iocb, sock, m, len)) \
-SOCKCALL_WRAP(name, recvmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, int len, int flags), \
+SOCKCALL_WRAP(name, recvmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, size_t len, int flags), \
 	      (iocb, sock, m, len, flags)) \
 SOCKCALL_WRAP(name, mmap, (struct file *file, struct socket *sock, struct vm_area_struct *vma), \
 	      (file, sock, vma)) \
diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h
--- a/include/linux/netdevice.h	Tue Feb  3 19:45:42 2004
+++ b/include/linux/netdevice.h	Tue Feb  3 19:45:42 2004
@@ -831,7 +831,7 @@
 	unsigned long flags;
 
 	local_irq_save(flags);
-	if (!test_bit(__LINK_STATE_RX_SCHED, &dev->state)) BUG();
+	BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
 	list_del(&dev->poll_list);
 	smp_mb__before_clear_bit();
 	clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
@@ -857,7 +857,7 @@
  */
 static inline void __netif_rx_complete(struct net_device *dev)
 {
-	if (!test_bit(__LINK_STATE_RX_SCHED, &dev->state)) BUG();
+	BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
 	list_del(&dev->poll_list);
 	smp_mb__before_clear_bit();
 	clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
diff -Nru a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
--- a/include/linux/nfs_fs.h	Tue Feb  3 19:45:17 2004
+++ b/include/linux/nfs_fs.h	Tue Feb  3 19:45:17 2004
@@ -255,8 +255,7 @@
 	if (file)
 		cred = (struct rpc_cred *)file->private_data;
 #ifdef RPC_DEBUG
-	if (cred && cred->cr_magic != RPCAUTH_CRED_MAGIC)
-		BUG();
+	BUG_ON(cred && cred->cr_magic != RPCAUTH_CRED_MAGIC);
 #endif
 	return cred;
 }
diff -Nru a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
--- a/include/linux/nfsd/nfsfh.h	Tue Feb  3 19:45:33 2004
+++ b/include/linux/nfsd/nfsfh.h	Tue Feb  3 19:45:33 2004
@@ -186,21 +186,8 @@
 /*
  * Shorthand for dprintk()'s
  */
-inline static char * SVCFH_fmt(struct svc_fh *fhp)
-{
-	struct knfsd_fh *fh = &fhp->fh_handle;
-	
-	static char buf[80];
-	sprintf(buf, "%d: %08x %08x %08x %08x %08x %08x",
-		fh->fh_size,
-		fh->fh_base.fh_pad[0],
-		fh->fh_base.fh_pad[1],
-		fh->fh_base.fh_pad[2],
-		fh->fh_base.fh_pad[3],
-		fh->fh_base.fh_pad[4],
-		fh->fh_base.fh_pad[5]);
-	return buf;
-}
+extern char * SVCFH_fmt(struct svc_fh *fhp);
+
 /*
  * Function prototypes
  */
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h	Tue Feb  3 19:45:17 2004
+++ b/include/linux/pci.h	Tue Feb  3 19:45:17 2004
@@ -425,8 +425,8 @@
 	unsigned int	transparent:1;	/* Transparent PCI bridge */
 	unsigned int	multifunction:1;/* Part of multi-function device */
 #ifdef CONFIG_PCI_NAMES
-#define PCI_NAME_SIZE	50
-#define PCI_NAME_HALF	__stringify(20)	/* less than half to handle slop */
+#define PCI_NAME_SIZE	96
+#define PCI_NAME_HALF	__stringify(43)	/* less than half to handle slop */
 	char		pretty_name[PCI_NAME_SIZE];	/* pretty name for users to see */
 #endif
 };
@@ -473,10 +473,12 @@
 
 	char		name[48];
 
-	struct	device	* dev;
+	struct device		*bridge;
+	struct class_device	class_dev;
 };
 
-#define pci_bus_b(n) list_entry(n, struct pci_bus, node)
+#define pci_bus_b(n)	list_entry(n, struct pci_bus, node)
+#define to_pci_bus(n)	container_of(n, struct pci_bus, class_dev)
 
 /*
  * Error values that may be returned by PCI functions.
@@ -585,6 +587,7 @@
 	return pci_scan_bus_parented(NULL, bus, ops, sysdata);
 }
 int pci_scan_slot(struct pci_bus *bus, int devfn);
+struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn);
 void pci_bus_add_devices(struct pci_bus *bus);
 void pci_name_device(struct pci_dev *dev);
 char *pci_class_name(u32 class);
@@ -612,6 +615,8 @@
 struct pci_dev *pci_get_subsys (unsigned int vendor, unsigned int device,
 				unsigned int ss_vendor, unsigned int ss_device,
 				struct pci_dev *from);
+struct pci_dev *pci_get_slot (struct pci_bus *bus, unsigned int devfn);
+
 int pci_bus_read_config_byte (struct pci_bus *bus, unsigned int devfn, int where, u8 *val);
 int pci_bus_read_config_word (struct pci_bus *bus, unsigned int devfn, int where, u16 *val);
 int pci_bus_read_config_dword (struct pci_bus *bus, unsigned int devfn, int where, u32 *val);
@@ -785,26 +790,7 @@
 {
 	int rc = pci_register_driver (drv);
 
-	if (rc > 0)
-		return 0;
-
-	/* iff CONFIG_HOTPLUG and built into kernel, we should
-	 * leave the driver around for future hotplug events.
-	 * For the module case, a hotplug daemon of some sort
-	 * should load a module in response to an insert event. */
-#if defined(CONFIG_HOTPLUG) && !defined(MODULE)
-	if (rc == 0)
-		return 0;
-#else
-	if (rc == 0)
-		rc = -ENODEV;		
-#endif
-
-	/* if we get here, we need to clean up pci driver instance
-	 * and return some sort of error */
-	pci_unregister_driver (drv);
-	
-	return rc;
+	return rc < 0 ? rc : 0;
 }
 
 /*
diff -Nru a/include/linux/pci_ids.h b/include/linux/pci_ids.h
--- a/include/linux/pci_ids.h	Tue Feb  3 19:45:17 2004
+++ b/include/linux/pci_ids.h	Tue Feb  3 19:45:17 2004
@@ -291,6 +291,7 @@
 #define PCI_DEVICE_ID_ATI_RADEON_Ig	0x4967
 /* Radeon RV280 (9200) */
 #define PCI_DEVICE_ID_ATI_RADEON_Y_	0x5960
+#define PCI_DEVICE_ID_ATI_RADEON_Yd	0x5964
 /* Radeon R300 (9500) */
 #define PCI_DEVICE_ID_ATI_RADEON_AD	0x4144
 /* Radeon R300 (9700) */
@@ -325,7 +326,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_RS200_B	0xcbb2
 #define PCI_DEVICE_ID_ATI_RS250		0xcab3
 #define PCI_DEVICE_ID_ATI_RS300_100	0x5830
 #define PCI_DEVICE_ID_ATI_RS300_133	0x5831
@@ -516,6 +517,7 @@
 #define PCI_DEVICE_ID_MATROX_VIA	0x4536
 
 #define PCI_VENDOR_ID_CT		0x102c
+#define PCI_DEVICE_ID_CT_69000		0x00c0
 #define PCI_DEVICE_ID_CT_65545		0x00d8
 #define PCI_DEVICE_ID_CT_65548		0x00dc
 #define PCI_DEVICE_ID_CT_65550		0x00e0
@@ -1443,6 +1445,9 @@
 #define PCI_VENDOR_ID_IKON		0x11d5
 #define PCI_DEVICE_ID_IKON_10115	0x0115
 #define PCI_DEVICE_ID_IKON_10117	0x0117
+
+#define PCI_VENDOR_ID_SEGA		0x11db
+#define PCI_DEVICE_ID_SEGA_BBA		0x1234
 
 #define PCI_VENDOR_ID_ZORAN		0x11de
 #define PCI_DEVICE_ID_ZORAN_36057	0x6057
diff -Nru a/include/linux/proc_fs.h b/include/linux/proc_fs.h
--- a/include/linux/proc_fs.h	Tue Feb  3 19:45:43 2004
+++ b/include/linux/proc_fs.h	Tue Feb  3 19:45:43 2004
@@ -131,8 +131,16 @@
 /*
  * proc_devtree.c
  */
+struct device_node;
 extern void proc_device_tree_init(void);
-
+#ifdef CONFIG_PROC_DEVICETREE
+extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *);
+#else /* !CONFIG_PROC_DEVICETREE */
+static inline void proc_device_tree_add_node(struct device_node *np, struct proc_dir_entry *pde)
+{
+	return;
+}
+#endif /* CONFIG_PROC_DEVICETREE */
 /*
  * proc_rtas.c
  */
diff -Nru a/include/linux/quotaops.h b/include/linux/quotaops.h
--- a/include/linux/quotaops.h	Tue Feb  3 19:45:17 2004
+++ b/include/linux/quotaops.h	Tue Feb  3 19:45:17 2004
@@ -44,8 +44,7 @@
 
 static __inline__ void DQUOT_INIT(struct inode *inode)
 {
-	if (!inode->i_sb)
-		BUG();
+	BUG_ON(!inode->i_sb);
 	if (sb_any_quota_enabled(inode->i_sb) && !IS_NOQUOTA(inode))
 		inode->i_sb->dq_op->initialize(inode, -1);
 }
@@ -53,8 +52,7 @@
 static __inline__ void DQUOT_DROP(struct inode *inode)
 {
 	if (IS_QUOTAINIT(inode)) {
-		if (!inode->i_sb)
-			BUG();
+		BUG_ON(!inode->i_sb);
 		inode->i_sb->dq_op->drop(inode);	/* Ops must be set when there's any quota... */
 	}
 }
diff -Nru a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
--- a/include/linux/raid/md_k.h	Tue Feb  3 19:45:16 2004
+++ b/include/linux/raid/md_k.h	Tue Feb  3 19:45:16 2004
@@ -23,7 +23,8 @@
 #define TRANSLUCENT       5UL
 #define HSM               6UL
 #define MULTIPATH         7UL
-#define MAX_PERSONALITY   8UL
+#define RAID6		  8UL
+#define MAX_PERSONALITY   9UL
 
 #define	LEVEL_MULTIPATH		(-4)
 #define	LEVEL_LINEAR		(-1)
@@ -41,6 +42,7 @@
 		case RAID0:		return 0;
 		case RAID1:		return 1;
 		case RAID5:		return 5;
+		case RAID6:		return 6;
 	}
 	BUG();
 	return MD_RESERVED;
@@ -57,6 +59,7 @@
 		case 1: return RAID1;
 		case 4:
 		case 5: return RAID5;
+		case 6: return RAID6;
 	}
 	return MD_RESERVED;
 }
@@ -187,6 +190,8 @@
 	struct list_head 		disks;
 	int				sb_dirty;
 	int				ro;
+
+	struct gendisk			*gendisk;
 
 	/* Superblock information */
 	int				major_version,
diff -Nru a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h
--- a/include/linux/raid/raid5.h	Tue Feb  3 19:45:41 2004
+++ b/include/linux/raid/raid5.h	Tue Feb  3 19:45:41 2004
@@ -70,7 +70,7 @@
  * that the Uptodate bit is set.  Once they have checked that they may
  * take buffers off the read queue.
  *
- * When a buffer on the write list is committed for write is it copied
+ * When a buffer on the write list is committed for write it is copied
  * into the cache buffer, which is then marked dirty, and moved onto a
  * third list, the written list (bh_written).  Once both the parity
  * block and the cached buffer are successfully written, any buffer on
diff -Nru a/include/linux/rcupdate.h b/include/linux/rcupdate.h
--- a/include/linux/rcupdate.h	Tue Feb  3 19:45:17 2004
+++ b/include/linux/rcupdate.h	Tue Feb  3 19:45:17 2004
@@ -55,7 +55,7 @@
 };
 
 #define RCU_HEAD_INIT(head) \
-		{ list: LIST_HEAD_INIT(head.list), func: NULL, arg: NULL }
+		{ .list = LIST_HEAD_INIT(head.list), .func = NULL, .arg = NULL }
 #define RCU_HEAD(head) struct rcu_head head = RCU_HEAD_INIT(head)
 #define INIT_RCU_HEAD(ptr) do { \
        INIT_LIST_HEAD(&(ptr)->list); (ptr)->func = NULL; (ptr)->arg = NULL; \
diff -Nru a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
--- a/include/linux/rtnetlink.h	Tue Feb  3 19:45:37 2004
+++ b/include/linux/rtnetlink.h	Tue Feb  3 19:45:37 2004
@@ -44,7 +44,10 @@
 #define	RTM_DELTFILTER	(RTM_BASE+29)
 #define	RTM_GETTFILTER	(RTM_BASE+30)
 
-#define	RTM_MAX		(RTM_BASE+31)
+#define RTM_NEWPREFIX	(RTM_BASE+36)
+#define RTM_GETPREFIX	(RTM_BASE+38)
+
+#define	RTM_MAX		(RTM_BASE+39)
 
 /* 
    Generic structure for encapsulation of optional route information.
@@ -459,6 +462,34 @@
 	unsigned	ifi_change;		/* IFF_* change mask */
 };
 
+/********************************************************************
+ *		prefix information 
+ ****/
+
+struct prefixmsg
+{
+	unsigned char	prefix_family;
+	int		prefix_ifindex;
+	unsigned char	prefix_type;
+	unsigned char	prefix_len;
+	unsigned char	prefix_flags;
+};
+
+enum 
+{
+	PREFIX_UNSPEC,
+	PREFIX_ADDRESS,
+	PREFIX_CACHEINFO,
+};
+
+#define PREFIX_MAX	PREFIX_CACHEINFO
+
+struct prefix_cacheinfo
+{
+	__u32	preferred_time;
+	__u32	valid_time;
+};
+
 /* The struct should be in sync with struct net_device_stats */
 struct rtnl_link_stats
 {
@@ -558,9 +589,18 @@
 	IFLA_INET6_CONF,	/* sysctl parameters		*/
 	IFLA_INET6_STATS,	/* statistics			*/
 	IFLA_INET6_MCAST,	/* MC things. What of them?	*/
+	IFLA_INET6_CACHEINFO,	/* time values and max reasm size */
 };
 
-#define IFLA_INET6_MAX	IFLA_INET6_MCAST
+struct ifla_cacheinfo
+{
+	__u32	max_reasm_len;
+	__u32	tstamp;		/* ipv6InterfaceTable updated timestamp */
+	__u32	reachable_time;
+	__u32	retrans_time;
+};
+
+#define IFLA_INET6_MAX	IFLA_INET6_CACHEINFO
 
 /*****************************************************************
  *		Traffic control messages.
@@ -611,9 +651,12 @@
 #define RTMGRP_IPV6_IFADDR	0x100
 #define RTMGRP_IPV6_MROUTE	0x200
 #define RTMGRP_IPV6_ROUTE	0x400
+#define RTMGRP_IPV6_IFINFO	0x800
 
 #define RTMGRP_DECnet_IFADDR    0x1000
 #define RTMGRP_DECnet_ROUTE     0x4000
+
+#define RTMGRP_IPV6_PREFIX	0x20000
 
 /* End of information exported to user level */
 
diff -Nru a/include/linux/sched.h b/include/linux/sched.h
--- a/include/linux/sched.h	Tue Feb  3 19:45:16 2004
+++ b/include/linux/sched.h	Tue Feb  3 19:45:16 2004
@@ -50,7 +50,7 @@
 #define CLONE_SETTLS	0x00080000	/* create a new TLS for the child */
 #define CLONE_PARENT_SETTID	0x00100000	/* set the TID in the parent */
 #define CLONE_CHILD_CLEARTID	0x00200000	/* clear the TID in the child */
-#define CLONE_DETACHED		0x00400000	/* Not used - CLONE_THREAD implies detached uniquely */
+#define CLONE_DETACHED		0x00400000	/* Unused, ignored */
 #define CLONE_UNTRACED		0x00800000	/* set if the tracing process can't force CLONE_PTRACE on this clone */
 #define CLONE_CHILD_SETTID	0x01000000	/* set the TID in the child */
 #define CLONE_STOPPED		0x02000000	/* Start in stopped state */
@@ -579,6 +579,7 @@
  static inline void kick_process(struct task_struct *tsk) { }
 #endif
 extern void FASTCALL(wake_up_forked_process(struct task_struct * tsk));
+extern void FASTCALL(sched_fork(task_t * p));
 extern void FASTCALL(sched_exit(task_t * p));
 
 asmlinkage long sys_wait4(pid_t pid,unsigned int * stat_addr, int options, struct rusage * ru);
diff -Nru a/include/linux/sctp.h b/include/linux/sctp.h
--- a/include/linux/sctp.h	Tue Feb  3 19:45:30 2004
+++ b/include/linux/sctp.h	Tue Feb  3 19:45:30 2004
@@ -439,12 +439,13 @@
 	 * 0x0101          Operation Refused Due to Resource Shortage.
 	 * 0x0102          Request to Delete Source IP Address.
 	 * 0x0103          Association Aborted due to illegal ASCONF-ACK
+	 * 0x0104          Request refused - no authorization.
 	 */
 	SCTP_ERROR_DEL_LAST_IP	= __constant_htons(0x0100),
 	SCTP_ERROR_RSRC_LOW	= __constant_htons(0x0101),
 	SCTP_ERROR_DEL_SRC_IP	= __constant_htons(0x0102),
 	SCTP_ERROR_ASCONF_ACK   = __constant_htons(0x0103),
-
+	SCTP_ERROR_REQ_REFUSED	= __constant_htons(0x0104)
 } sctp_error_t;
 
 
diff -Nru a/include/linux/security.h b/include/linux/security.h
--- a/include/linux/security.h	Tue Feb  3 19:45:34 2004
+++ b/include/linux/security.h	Tue Feb  3 19:45:34 2004
@@ -46,6 +46,8 @@
 extern int cap_bprm_set_security (struct linux_binprm *bprm);
 extern void cap_bprm_compute_creds (struct linux_binprm *bprm);
 extern int cap_bprm_secureexec(struct linux_binprm *bprm);
+extern int cap_inode_setxattr(struct dentry *dentry, char *name, void *value, size_t size, int flags);
+extern int cap_inode_removexattr(struct dentry *dentry, char *name);
 extern int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags);
 extern void cap_task_reparent_to_init (struct task_struct *p);
 extern int cap_syslog (int type);
@@ -757,6 +759,22 @@
  *	incoming sk_buff @skb has been associated with a particular socket, @sk.
  *	@sk contains the sock (not socket) associated with the incoming sk_buff.
  *	@skb contains the incoming network data.
+ * @socket_getpeersec:
+ *	This hook allows the security module to provide peer socket security
+ *	state to userspace via getsockopt SO_GETPEERSEC.
+ *	@sock is the local socket.
+ *	@optval userspace memory where the security state is to be copied.
+ *	@optlen userspace int where the module should copy the actual length
+ *	of the security state.
+ *	@len as input is the maximum length to copy to userspace provided
+ *	by the caller.
+ *	Return 0 if all is well, otherwise, typical getsockopt return
+ *	values.
+ * @sk_alloc_security:
+ *      Allocate and attach a security structure to the sk->sk_security field,
+ *      which is used to copy security attributes between local stream sockets.
+ * @sk_free_security:
+ *	Deallocate security structure.
  *
  * Security hooks affecting all System V IPC operations.
  *
@@ -1183,6 +1201,9 @@
 	int (*socket_setsockopt) (struct socket * sock, int level, int optname);
 	int (*socket_shutdown) (struct socket * sock, int how);
 	int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb);
+	int (*socket_getpeersec) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len);
+	int (*sk_alloc_security) (struct sock *sk, int family, int priority);
+	void (*sk_free_security) (struct sock *sk);
 #endif	/* CONFIG_SECURITY_NETWORK */
 };
 
@@ -2136,7 +2157,7 @@
 static inline int security_inode_setxattr (struct dentry *dentry, char *name,
 					   void *value, size_t size, int flags)
 {
-	return 0;
+	return cap_inode_setxattr(dentry, name, value, size, flags);
 }
 
 static inline void security_inode_post_setxattr (struct dentry *dentry, char *name,
@@ -2155,7 +2176,7 @@
 
 static inline int security_inode_removexattr (struct dentry *dentry, char *name)
 {
-	return 0;
+	return cap_inode_removexattr(dentry, name);
 }
 
 static inline int security_inode_getsecurity(struct dentry *dentry, const char *name, void *buffer, size_t size)
@@ -2564,6 +2585,22 @@
 {
 	return security_ops->socket_sock_rcv_skb (sk, skb);
 }
+
+static inline int security_socket_getpeersec(struct socket *sock, char __user *optval,
+					     int __user *optlen, unsigned len)
+{
+	return security_ops->socket_getpeersec(sock, optval, optlen, len);
+}
+
+static inline int security_sk_alloc(struct sock *sk, int family, int priority)
+{
+	return security_ops->sk_alloc_security(sk, family, priority);
+}
+
+static inline void security_sk_free(struct sock *sk)
+{
+	return security_ops->sk_free_security(sk);
+}
 #else	/* CONFIG_SECURITY_NETWORK */
 static inline int security_unix_stream_connect(struct socket * sock,
 					       struct socket * other, 
@@ -2663,6 +2700,21 @@
 					 struct sk_buff * skb)
 {
 	return 0;
+}
+
+static inline int security_socket_getpeersec(struct socket *sock, char __user *optval,
+					     int __user *optlen, unsigned len)
+{
+	return -ENOPROTOOPT;
+}
+
+static inline int security_sk_alloc(struct sock *sk, int family, int priority)
+{
+	return 0;
+}
+
+static inline void security_sk_free(struct sock *sk)
+{
 }
 #endif	/* CONFIG_SECURITY_NETWORK */
 
diff -Nru a/include/linux/signal.h b/include/linux/signal.h
--- a/include/linux/signal.h	Tue Feb  3 19:45:17 2004
+++ b/include/linux/signal.h	Tue Feb  3 19:45:17 2004
@@ -207,6 +207,7 @@
 	INIT_LIST_HEAD(&sig->list);
 }
 
+extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p);
 extern long do_sigpending(void __user *, unsigned long);
 extern int sigprocmask(int, sigset_t *, sigset_t *);
 
diff -Nru a/include/linux/skbuff.h b/include/linux/skbuff.h
--- a/include/linux/skbuff.h	Tue Feb  3 19:45:29 2004
+++ b/include/linux/skbuff.h	Tue Feb  3 19:45:29 2004
@@ -871,7 +871,7 @@
 	return skb->data;
 }
 
-static inline char *__skb_pull(struct sk_buff *skb, unsigned int len)
+static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len)
 {
 	skb->len -= len;
 	BUG_ON(skb->len < skb->data_len);
@@ -895,7 +895,7 @@
 
 extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta);
 
-static inline char *__pskb_pull(struct sk_buff *skb, unsigned int len)
+static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len)
 {
 	if (len > skb_headlen(skb) &&
 	    !__pskb_pull_tail(skb, len-skb_headlen(skb)))
diff -Nru a/include/linux/smp.h b/include/linux/smp.h
--- a/include/linux/smp.h	Tue Feb  3 19:45:29 2004
+++ b/include/linux/smp.h	Tue Feb  3 19:45:29 2004
@@ -103,7 +103,6 @@
 #define on_each_cpu(func,info,retry,wait)	({ func(info); 0; })
 static inline void smp_send_reschedule(int cpu) { }
 #define num_booting_cpus()			1
-#define cpu_possible(cpu)			({ BUG_ON((cpu) != 0); 1; })
 #define smp_prepare_boot_cpu()			do {} while (0)
 
 #endif /* !SMP */
diff -Nru a/include/linux/smp_lock.h b/include/linux/smp_lock.h
--- a/include/linux/smp_lock.h	Tue Feb  3 19:45:37 2004
+++ b/include/linux/smp_lock.h	Tue Feb  3 19:45:37 2004
@@ -49,8 +49,7 @@
 
 static inline void unlock_kernel(void)
 {
-	if (unlikely(current->lock_depth < 0))
-		BUG();
+	BUG_ON(current->lock_depth < 0);
 	if (likely(--current->lock_depth < 0))
 		put_kernel_lock();
 }
diff -Nru a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
--- a/include/linux/sunrpc/cache.h	Tue Feb  3 19:45:28 2004
+++ b/include/linux/sunrpc/cache.h	Tue Feb  3 19:45:28 2004
@@ -94,6 +94,8 @@
 	/* fields for communication over channel */
 	struct list_head	queue;
 	struct proc_dir_entry	*proc_ent;
+	struct proc_dir_entry   *flush_ent, *channel_ent, *content_ent;
+
 	atomic_t		readers;		/* how many time is /chennel open */
 	time_t			last_close;		/* it no readers, when did last close */
 };
diff -Nru a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
--- a/include/linux/sunrpc/sched.h	Tue Feb  3 19:45:33 2004
+++ b/include/linux/sunrpc/sched.h	Tue Feb  3 19:45:33 2004
@@ -205,7 +205,7 @@
 static __inline__ char *
 rpc_qname(struct rpc_wait_queue *q)
 {
-	return q->name? q->name : "unknown";
+	return ((q && q->name) ? q->name : "unknown");
 }
 #endif
 
diff -Nru a/include/linux/swap.h b/include/linux/swap.h
--- a/include/linux/swap.h	Tue Feb  3 19:45:16 2004
+++ b/include/linux/swap.h	Tue Feb  3 19:45:16 2004
@@ -173,7 +173,7 @@
 extern void swap_setup(void);
 
 /* linux/mm/vmscan.c */
-extern int try_to_free_pages(struct zone *, unsigned int, unsigned int);
+extern int try_to_free_pages(struct zone **, unsigned int, unsigned int);
 extern int shrink_all_memory(int);
 extern int vm_swappiness;
 
diff -Nru a/include/linux/sysctl.h b/include/linux/sysctl.h
--- a/include/linux/sysctl.h	Tue Feb  3 19:45:28 2004
+++ b/include/linux/sysctl.h	Tue Feb  3 19:45:28 2004
@@ -127,6 +127,8 @@
 	KERN_PANIC_ON_OOPS=57,  /* int: whether we will panic on an oops */
 	KERN_HPPA_PWRSW=58,	/* int: hppa soft-power enable */
 	KERN_HPPA_UNALIGNED=59,	/* int: hppa unaligned-trap enable */
+	KERN_PRINTK_RATELIMIT=60, /* int: tune printk ratelimiting */
+	KERN_PRINTK_RATELIMIT_BURST=61,	/* int: tune printk ratelimiting */
 };
 
 
@@ -418,7 +420,8 @@
 	NET_IPV6_TEMP_VALID_LFT=12,
 	NET_IPV6_TEMP_PREFERED_LFT=13,
 	NET_IPV6_REGEN_MAX_RETRY=14,
-	NET_IPV6_MAX_DESYNC_FACTOR=15
+	NET_IPV6_MAX_DESYNC_FACTOR=15,
+	NET_IPV6_MAX_ADDRESSES=16
 };
 
 /* /proc/sys/net/ipv6/icmp */
@@ -577,6 +580,7 @@
 	NET_SCTP_HB_INTERVAL             = 10,
 	NET_SCTP_PRESERVE_ENABLE         = 11,
 	NET_SCTP_MAX_BURST               = 12,
+	NET_SCTP_ADDIP_ENABLE		 = 13,
 };
 
 /* /proc/sys/net/bridge */
@@ -734,6 +738,8 @@
 				void __user *, size_t *);
 extern int proc_dointvec_jiffies(ctl_table *, int, struct file *,
 				 void __user *, size_t *);
+extern int proc_dointvec_userhz_jiffies(ctl_table *, int, struct file *,
+					void __user *, size_t *);
 extern int proc_doulongvec_minmax(ctl_table *, int, struct file *,
 				  void __user *, size_t *);
 extern int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int,
diff -Nru a/include/linux/usb.h b/include/linux/usb.h
--- a/include/linux/usb.h	Tue Feb  3 19:45:17 2004
+++ b/include/linux/usb.h	Tue Feb  3 19:45:17 2004
@@ -856,7 +856,6 @@
 /* wrappers around usb_control_msg() for the most common standard requests */
 extern int usb_get_descriptor(struct usb_device *dev, unsigned char desctype,
 	unsigned char descindex, void *buf, int size);
-extern int usb_get_device_descriptor(struct usb_device *dev);
 extern int usb_get_status(struct usb_device *dev,
 	int type, int target, void *data);
 extern int usb_get_string(struct usb_device *dev,
diff -Nru a/include/linux/videodev.h b/include/linux/videodev.h
--- a/include/linux/videodev.h	Tue Feb  3 19:45:43 2004
+++ b/include/linux/videodev.h	Tue Feb  3 19:45:43 2004
@@ -3,7 +3,6 @@
 
 #include <linux/types.h>
 #include <linux/version.h>
-#include <linux/device.h>
 
 #define HAVE_V4L2 1
 #include <linux/videodev2.h>
@@ -12,6 +11,7 @@
 
 #include <linux/poll.h>
 #include <linux/mm.h>
+#include <linux/device.h>
 
 struct video_device
 {
@@ -429,7 +429,7 @@
 #define VID_HARDWARE_CPIA2	33
 #define VID_HARDWARE_VICAM      34
 #define VID_HARDWARE_SF16FMR2	35
-#define VID_HARDWARE_W9968CF	36	/* W996[87]CF JPEG USB Dual Mode Cam */
+#define VID_HARDWARE_W9968CF    36
 #endif /* __LINUX_VIDEODEV_H */
 
 /*
diff -Nru a/include/linux/videodev2.h b/include/linux/videodev2.h
--- a/include/linux/videodev2.h	Tue Feb  3 19:45:33 2004
+++ b/include/linux/videodev2.h	Tue Feb  3 19:45:33 2004
@@ -13,7 +13,9 @@
  *		Justin Schoeman
  *		et al.
  */
+#ifdef __KERNEL__
 #include <linux/time.h> /* need struct timeval */
+#endif
 
 /*
  *	M I S C E L L A N E O U S
@@ -111,6 +113,14 @@
 	V4L2_COLORSPACE_SRGB          = 8,
 };
 
+enum v4l2_priority {
+	V4L2_PRIORITY_UNSET       = 0,  /* not initialized */
+	V4L2_PRIORITY_BACKGROUND  = 1,
+	V4L2_PRIORITY_INTERACTIVE = 2,
+	V4L2_PRIORITY_RECORD      = 3,
+	V4L2_PRIORITY_DEFAULT     = V4L2_PRIORITY_INTERACTIVE,
+};
+
 struct v4l2_rect {
 	__s32   left;
 	__s32   top;
@@ -144,8 +154,9 @@
 #define V4L2_CAP_VBI_OUTPUT	0x00000020  /* Is a VBI output device */
 #define V4L2_CAP_RDS_CAPTURE	0x00000100  /* RDS data capture */
 
-#define V4L2_CAP_TUNER		0x00010000  /* Has a tuner */
+#define V4L2_CAP_TUNER		0x00010000  /* has a tuner */
 #define V4L2_CAP_AUDIO		0x00020000  /* has audio support */
+#define V4L2_CAP_RADIO		0x00040000  /* is a radio device */
 
 #define V4L2_CAP_READWRITE      0x01000000  /* read/write systemcalls */
 #define V4L2_CAP_ASYNCIO        0x02000000  /* async I/O */
@@ -203,7 +214,7 @@
 #define V4L2_PIX_FMT_MPEG     v4l2_fourcc('M','P','E','G') /* MPEG          */
 
 /*  Vendor-specific formats   */
-#define V4L2_PIX_FMT_WNVA    v4l2_fourcc('W','N','V','A') /* Winnov hw compres */
+#define V4L2_PIX_FMT_WNVA     v4l2_fourcc('W','N','V','A') /* Winnov hw compress */
 
 /*
  *	F O R M A T   E N U M E R A T I O N
@@ -264,6 +275,51 @@
 	__u32	keyframerate;
 	__u32	pframerate;
 	__u32	reserved[5];
+
+/*  what we'll need for MPEG, extracted from some postings on
+    the v4l list (Gert Vervoort, PlasmaJohn).
+
+system stream:
+  - type: elementary stream(ES), packatised elementary stream(s) (PES)
+    program stream(PS), transport stream(TS)
+  - system bitrate
+  - PS packet size (DVD: 2048 bytes, VCD: 2324 bytes)
+  - TS video PID
+  - TS audio PID
+  - TS PCR PID
+  - TS system information tables (PAT, PMT, CAT, NIT and SIT)
+  - (MPEG-1 systems stream vs. MPEG-2 program stream (TS not supported
+    by MPEG-1 systems)
+
+audio:
+  - type: MPEG (+Layer I,II,III), AC-3, LPCM
+  - bitrate
+  - sampling frequency (DVD: 48 Khz, VCD: 44.1 KHz, 32 kHz)
+  - Trick Modes? (ff, rew)
+  - Copyright
+  - Inverse Telecine
+
+video:
+  - picturesize (SIF, 1/2 D1, 2/3 D1, D1) and PAL/NTSC norm can be set
+    through excisting V4L2 controls
+  - noise reduction, parameters encoder specific?
+  - MPEG video version: MPEG-1, MPEG-2
+  - GOP (Group Of Pictures) definition:
+    - N: number of frames per GOP
+    - M: distance between reference (I,P) frames
+    - open/closed GOP
+  - quantiser matrix: inter Q matrix (64 bytes) and intra Q matrix (64 bytes)
+  - quantiser scale: linear or logarithmic
+  - scanning: alternate or zigzag
+  - bitrate mode: CBR (constant bitrate) or VBR (variable bitrate).
+  - target video bitrate for CBR
+  - target video bitrate for VBR
+  - maximum video bitrate for VBR - min. quantiser value for VBR
+  - max. quantiser value for VBR
+  - adaptive quantisation value
+  - return the number of bytes per GOP or bitrate for bitrate monitoring
+
+*/
 };
 #endif
 
@@ -783,22 +839,22 @@
 #define VIDIOC_QUERYBUF		_IOWR ('V',  9, struct v4l2_buffer)
 #define VIDIOC_G_FBUF		_IOR  ('V', 10, struct v4l2_framebuffer)
 #define VIDIOC_S_FBUF		_IOW  ('V', 11, struct v4l2_framebuffer)
-#define VIDIOC_OVERLAY		_IOWR ('V', 14, int)
+#define VIDIOC_OVERLAY		_IOW  ('V', 14, int)
 #define VIDIOC_QBUF		_IOWR ('V', 15, struct v4l2_buffer)
 #define VIDIOC_DQBUF		_IOWR ('V', 17, struct v4l2_buffer)
 #define VIDIOC_STREAMON		_IOW  ('V', 18, int)
 #define VIDIOC_STREAMOFF	_IOW  ('V', 19, int)
 #define VIDIOC_G_PARM		_IOWR ('V', 21, struct v4l2_streamparm)
-#define VIDIOC_S_PARM		_IOW  ('V', 22, struct v4l2_streamparm)
+#define VIDIOC_S_PARM		_IOWR ('V', 22, struct v4l2_streamparm)
 #define VIDIOC_G_STD		_IOR  ('V', 23, v4l2_std_id)
 #define VIDIOC_S_STD		_IOW  ('V', 24, v4l2_std_id)
 #define VIDIOC_ENUMSTD		_IOWR ('V', 25, struct v4l2_standard)
 #define VIDIOC_ENUMINPUT	_IOWR ('V', 26, struct v4l2_input)
 #define VIDIOC_G_CTRL		_IOWR ('V', 27, struct v4l2_control)
-#define VIDIOC_S_CTRL		_IOW  ('V', 28, struct v4l2_control)
+#define VIDIOC_S_CTRL		_IOWR ('V', 28, struct v4l2_control)
 #define VIDIOC_G_TUNER		_IOWR ('V', 29, struct v4l2_tuner)
 #define VIDIOC_S_TUNER		_IOW  ('V', 30, struct v4l2_tuner)
-#define VIDIOC_G_AUDIO		_IOWR ('V', 33, struct v4l2_audio)
+#define VIDIOC_G_AUDIO		_IOR  ('V', 33, struct v4l2_audio)
 #define VIDIOC_S_AUDIO		_IOW  ('V', 34, struct v4l2_audio)
 #define VIDIOC_QUERYCTRL	_IOWR ('V', 36, struct v4l2_queryctrl)
 #define VIDIOC_QUERYMENU	_IOWR ('V', 37, struct v4l2_querymenu)
@@ -807,7 +863,7 @@
 #define VIDIOC_G_OUTPUT		_IOR  ('V', 46, int)
 #define VIDIOC_S_OUTPUT		_IOWR ('V', 47, int)
 #define VIDIOC_ENUMOUTPUT	_IOWR ('V', 48, struct v4l2_output)
-#define VIDIOC_G_AUDOUT		_IOWR ('V', 49, struct v4l2_audioout)
+#define VIDIOC_G_AUDOUT		_IOR  ('V', 49, struct v4l2_audioout)
 #define VIDIOC_S_AUDOUT		_IOW  ('V', 50, struct v4l2_audioout)
 #define VIDIOC_G_MODULATOR	_IOWR ('V', 54, struct v4l2_modulator)
 #define VIDIOC_S_MODULATOR	_IOW  ('V', 55, struct v4l2_modulator)
@@ -820,6 +876,17 @@
 #define VIDIOC_S_JPEGCOMP	_IOW  ('V', 62, struct v4l2_jpegcompression)
 #define VIDIOC_QUERYSTD      	_IOR  ('V', 63, v4l2_std_id)
 #define VIDIOC_TRY_FMT      	_IOWR ('V', 64, struct v4l2_format)
+#define VIDIOC_ENUMAUDIO	_IOWR ('V', 65, struct v4l2_audio)
+#define VIDIOC_ENUMAUDOUT	_IOWR ('V', 66, struct v4l2_audioout)
+#define VIDIOC_G_PRIORITY       _IOR  ('V', 67, enum v4l2_priority)
+#define VIDIOC_S_PRIORITY       _IOW  ('V', 68, enum v4l2_priority)
+
+/* for compatibility, will go away some day */
+#define VIDIOC_OVERLAY_OLD     	_IOWR ('V', 14, int)
+#define VIDIOC_S_PARM_OLD      	_IOW  ('V', 22, struct v4l2_streamparm)
+#define VIDIOC_S_CTRL_OLD      	_IOW  ('V', 28, struct v4l2_control)
+#define VIDIOC_G_AUDIO_OLD     	_IOWR ('V', 33, struct v4l2_audio)
+#define VIDIOC_G_AUDOUT_OLD    	_IOWR ('V', 49, struct v4l2_audioout)
 
 #define BASE_VIDIOC_PRIVATE	192		/* 192-255 are private */
 
@@ -838,16 +905,28 @@
 extern int v4l2_video_std_construct(struct v4l2_standard *vs,
 				    int id, char *name);
 
-/*  Compatibility layer interface  */
-typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
-			   unsigned int cmd, void *arg);
-int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,
-			       int cmd, void *arg, v4l2_kioctl driver_ioctl);
+/* prority handling */
+struct v4l2_prio_state {
+	atomic_t prios[4];
+};
+int v4l2_prio_init(struct v4l2_prio_state *global);
+int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local,
+		     enum v4l2_priority new);
+int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local);
+int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local);
+enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global);
+int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local);
 
 /* names for fancy debug output */
 extern char *v4l2_field_names[];
 extern char *v4l2_type_names[];
 extern char *v4l2_ioctl_names[];
+
+/*  Compatibility layer interface  --  v4l1-compat module */
+typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
+			   unsigned int cmd, void *arg);
+int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,
+			       int cmd, void *arg, v4l2_kioctl driver_ioctl);
 
 #endif /* __KERNEL__ */
 #endif /* __LINUX_VIDEODEV2_H */
diff -Nru a/include/linux/xattr.h b/include/linux/xattr.h
--- a/include/linux/xattr.h	Tue Feb  3 19:45:33 2004
+++ b/include/linux/xattr.h	Tue Feb  3 19:45:33 2004
@@ -12,4 +12,6 @@
 #define XATTR_CREATE	0x1	/* set value, fail if attr already exists */
 #define XATTR_REPLACE	0x2	/* set value, fail if attr does not exist */
 
+#define XATTR_SECURITY_PREFIX	"security."
+
 #endif	/* _LINUX_XATTR_H */
diff -Nru a/include/linux/zorro.h b/include/linux/zorro.h
--- a/include/linux/zorro.h	Tue Feb  3 19:45:16 2004
+++ b/include/linux/zorro.h	Tue Feb  3 19:45:16 2004
@@ -1,7 +1,7 @@
 /*
  *  linux/zorro.h -- Amiga AutoConfig (Zorro) Bus Definitions
  *
- *  Copyright (C) 1995--2000 Geert Uytterhoeven
+ *  Copyright (C) 1995--2003 Geert Uytterhoeven
  *
  *  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
@@ -13,6 +13,9 @@
 
 #ifndef __ASSEMBLY__
 
+#include <linux/device.h>
+
+
     /*
      *  Each Zorro board has a 32-bit ID of the form
      *
@@ -96,17 +99,17 @@
 #define ERTF_MEMLIST	(1<<5)
 
 struct ConfigDev {
-    struct Node 	cd_Node;
-    __u8  		cd_Flags;	/* (read/write) */
-    __u8  		cd_Pad; 	/* reserved */
-    struct ExpansionRom cd_Rom; 	/* copy of board's expansion ROM */
+    struct Node		cd_Node;
+    __u8		cd_Flags;	/* (read/write) */
+    __u8		cd_Pad;		/* reserved */
+    struct ExpansionRom cd_Rom;		/* copy of board's expansion ROM */
     void		*cd_BoardAddr;	/* where in memory the board was placed */
-    __u32 		cd_BoardSize;	/* size of board in bytes */
-    __u16  		cd_SlotAddr;	/* which slot number (PRIVATE) */
-    __u16  		cd_SlotSize;	/* number of slots (PRIVATE) */
+    __u32		cd_BoardSize;	/* size of board in bytes */
+    __u16		cd_SlotAddr;	/* which slot number (PRIVATE) */
+    __u16		cd_SlotSize;	/* number of slots (PRIVATE) */
     void		*cd_Driver;	/* pointer to node of driver */
     struct ConfigDev	*cd_NextCD;	/* linked list of drivers to config */
-    __u32 		cd_Unused[4];	/* for whatever the driver wants */
+    __u32		cd_Unused[4];	/* for whatever the driver wants */
 } __attribute__ ((packed));
 
 #else /* __ASSEMBLY__ */
@@ -157,15 +160,81 @@
 
 #include <asm/zorro.h>
 
+
+    /*
+     *  Zorro devices
+     */
+
 struct zorro_dev {
     struct ExpansionRom rom;
     zorro_id id;
+    struct zorro_driver *driver;	/* which driver has allocated this device */
+    struct device dev;			/* Generic device interface */
     u16 slotaddr;
     u16 slotsize;
     char name[64];
     struct resource resource;
 };
 
+#define	to_zorro_dev(n)	container_of(n, struct zorro_dev, dev)
+
+
+    /*
+     *  Zorro bus
+     */
+
+struct zorro_bus {
+    struct list_head devices;		/* list of devices on this bus */
+    unsigned int num_resources;		/* number of resources */
+    struct resource resources[4];	/* address space routed to this bus */
+    struct device dev;
+    char name[10];
+};
+
+extern struct zorro_bus zorro_bus;	/* single Zorro bus */
+extern struct bus_type zorro_bus_type;
+
+
+    /*
+     *  Zorro device IDs
+     */
+
+struct zorro_device_id {
+	zorro_id id;			/* Device ID or ZORRO_WILDCARD */
+	unsigned long driver_data;	/* Data private to the driver */
+};
+
+
+    /*
+     *  Zorro device drivers
+     */
+
+struct zorro_driver {
+    struct list_head node;
+    char *name;
+    const struct zorro_device_id *id_table;	/* NULL if wants all devices */
+    int (*probe)(struct zorro_dev *z, const struct zorro_device_id *id);	/* New device inserted */
+    void (*remove)(struct zorro_dev *z);	/* Device removed (NULL if not a hot-plug capable driver) */
+    struct device_driver driver;
+};
+
+#define	to_zorro_driver(drv)	container_of(drv, struct zorro_driver, driver)
+
+
+#define zorro_for_each_dev(dev)	\
+	for (dev = &zorro_autocon[0]; dev < zorro_autocon+zorro_num_autocon; dev++)
+
+
+/* New-style probing */
+extern int zorro_register_driver(struct zorro_driver *);
+extern void zorro_unregister_driver(struct zorro_driver *);
+extern const struct zorro_device_id *zorro_match_device(const struct zorro_device_id *ids, const struct zorro_dev *z);
+static inline struct zorro_driver *zorro_dev_driver(const struct zorro_dev *z)
+{
+    return z->driver;
+}
+
+
 extern unsigned int zorro_num_autocon;	/* # of autoconfig devices found */
 extern struct zorro_dev zorro_autocon[ZORRO_NUM_AUTO];
 
@@ -174,17 +243,65 @@
      *  Zorro Functions
      */
 
-extern void zorro_name_device(struct zorro_dev *dev);
-
 extern struct zorro_dev *zorro_find_device(zorro_id id,
 					   struct zorro_dev *from);
 
+#define zorro_resource_start(z)	((z)->resource.start)
+#define zorro_resource_end(z)	((z)->resource.end)
+#define zorro_resource_len(z)	((z)->resource.end-(z)->resource.start+1)
+#define zorro_resource_flags(z)	((z)->resource.flags)
+
 #define zorro_request_device(z, name) \
-    request_mem_region((z)->resource.start, \
-		       (z)->resource.end-(z)->resource.start+1, (name))
+    request_mem_region(zorro_resource_start(z), zorro_resource_len(z), name)
 #define zorro_release_device(z) \
-    release_mem_region((z)->resource.start, \
-		       (z)->resource.end-(z)->resource.start+1)
+    release_mem_region(zorro_resource_start(z), zorro_resource_len(z))
+
+/* Similar to the helpers above, these manipulate per-zorro_dev
+ * driver-specific data.  They are really just a wrapper around
+ * the generic device structure functions of these calls.
+ */
+static inline void *zorro_get_drvdata (struct zorro_dev *z)
+{
+	return dev_get_drvdata(&z->dev);
+}
+
+static inline void zorro_set_drvdata (struct zorro_dev *z, void *data)
+{
+	dev_set_drvdata(&z->dev, data);
+}
+
+
+/*
+ * A helper function which helps ensure correct zorro_driver
+ * setup and cleanup for commonly-encountered hotplug/modular cases
+ *
+ * This MUST stay in a header, as it checks for -DMODULE
+ */
+static inline int zorro_module_init(struct zorro_driver *drv)
+{
+	int rc = zorro_register_driver(drv);
+
+	if (rc > 0)
+		return 0;
+
+	/* iff CONFIG_HOTPLUG and built into kernel, we should
+	 * leave the driver around for future hotplug events.
+	 * For the module case, a hotplug daemon of some sort
+	 * should load a module in response to an insert event. */
+#if defined(CONFIG_HOTPLUG) && !defined(MODULE)
+	if (rc == 0)
+		return 0;
+#else
+	if (rc == 0)
+		rc = -ENODEV;
+#endif
+
+	/* if we get here, we need to clean up Zorro driver instance
+	 * and return some sort of error */
+	zorro_unregister_driver(drv);
+
+	return rc;
+}
 
 
     /*
diff -Nru a/include/media/id.h b/include/media/id.h
--- a/include/media/id.h	Tue Feb  3 19:45:18 2004
+++ b/include/media/id.h	Tue Feb  3 19:45:18 2004
@@ -27,6 +27,9 @@
 #ifndef  I2C_DRIVERID_TDA9874
 # define I2C_DRIVERID_TDA9874 I2C_DRIVERID_EXP0+7
 #endif
+#ifndef  I2C_DRIVERID_SAA6752HS
+# define I2C_DRIVERID_SAA6752HS I2C_DRIVERID_EXP0+8
+#endif
 
 /* algorithms */
 #ifndef I2C_ALGO_SAA7134
diff -Nru a/include/media/ir-common.h b/include/media/ir-common.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/media/ir-common.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,61 @@
+/*
+ * some common structs and functions to handle infrared remotes via
+ * input layer ...
+ *
+ * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/version.h>
+#include <linux/input.h>
+
+
+#define IR_TYPE_RC5     1
+#define IR_TYPE_OTHER  99
+
+#define IR_KEYTAB_TYPE	u32
+#define IR_KEYTAB_SIZE	64  // enougth for rc5, probably need more some day ...
+
+#define IR_KEYCODE(tab,code)	(((unsigned)code < IR_KEYTAB_SIZE) \
+				 ? tab[code] : KEY_RESERVED)
+
+struct ir_input_state {
+	/* configuration */
+	int                ir_type;
+	IR_KEYTAB_TYPE     ir_codes[IR_KEYTAB_SIZE];
+
+	/* key info */
+	u32                ir_raw;      /* raw data */
+	u32                ir_key;      /* ir key code */
+	u32                keycode;     /* linux key code */
+	int                keypressed;  /* current state */
+};
+
+extern IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE];
+extern IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE];
+
+void ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
+		   int ir_type, IR_KEYTAB_TYPE *ir_codes);
+void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir);
+void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir,
+		      u32 ir_key, u32 ir_raw);
+u32  ir_extract_bits(u32 data, u32 mask);
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff -Nru a/include/media/saa7146.h b/include/media/saa7146.h
--- a/include/media/saa7146.h	Tue Feb  3 19:45:16 2004
+++ b/include/media/saa7146.h	Tue Feb  3 19:45:16 2004
@@ -67,6 +67,8 @@
 	dma_addr_t	dma;
 	/* used for offsets for u,v planes for planar capture modes */
 	unsigned long	offset;
+	/* used for custom pagetables (used for example by budget dvb cards) */
+	struct scatterlist *slist;
 };
 
 struct saa7146_pci_extension_data {
diff -Nru a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h
--- a/include/media/saa7146_vv.h	Tue Feb  3 19:45:16 2004
+++ b/include/media/saa7146_vv.h	Tue Feb  3 19:45:16 2004
@@ -26,12 +26,15 @@
 	u32 num_line_byte;
 };
 
+#define FORMAT_BYTE_SWAP	0x1
+#define FORMAT_IS_PLANAR	0x2
+
 struct saa7146_format {
 	char	*name;
-	int   	pixelformat;
+	u32   	pixelformat;
 	u32	trans;
 	u8	depth;
-	int	swap;
+	u8	flags;
 };
 
 struct saa7146_standard
@@ -97,6 +100,8 @@
 	struct videobuf_queue	vbi_q;
 	struct v4l2_vbi_format	vbi_fmt;
 	struct timer_list	vbi_read_timeout;
+
+	unsigned int resources;	/* resource management for device open */
 };
 
 struct saa7146_vv
@@ -136,6 +141,8 @@
 	int 	current_hps_sync;
 
 	struct saa7146_dma	d_clipping;	/* pointer to clipping memory */
+
+	unsigned int resources;	/* resource management for device */
 };
 
 #define SAA7146_EXCLUSIVE	0x1
@@ -149,7 +156,6 @@
 };
 
 /* flags */
-// #define SAA7146_EXT_SWAP_ODD_EVEN	0x1     /* needs odd/even fields swapped */
 #define SAA7146_USE_PORT_B_FOR_VBI	0x2     /* use input port b for vbi hardware bug workaround */
 
 struct saa7146_ext_vv
@@ -171,7 +177,7 @@
 
 struct saa7146_use_ops  {
         void (*init)(struct saa7146_dev *, struct saa7146_vv *);
-        void(*open)(struct saa7146_dev *, struct file *);
+        int(*open)(struct saa7146_dev *, struct file *);
         void (*release)(struct saa7146_dev *, struct file *);
         void (*irq_done)(struct saa7146_dev *, unsigned long status);
 	ssize_t (*read)(struct file *, char *, size_t, loff_t *);
@@ -189,9 +195,10 @@
 int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv);
 int saa7146_vv_release(struct saa7146_dev* dev);
 
-
 /* from saa7146_hlp.c */
-void saa7146_set_overlay(struct saa7146_dev *dev, struct saa7146_fh *fh, int v);
+int saa7146_enable_overlay(struct saa7146_fh *fh);
+void saa7146_disable_overlay(struct saa7146_fh *fh);
+
 void saa7146_set_capture(struct saa7146_dev *dev, struct saa7146_buf *buf, struct saa7146_buf *next);
 void saa7146_write_out_dma(struct saa7146_dev* dev, int which, struct saa7146_video_dma* vdma) ;
 void saa7146_set_hps_source_and_sync(struct saa7146_dev *saa, int source, int sync);
@@ -204,6 +211,16 @@
 
 /* from saa7146_vbi.c */
 extern struct saa7146_use_ops saa7146_vbi_uops;
+
+/* resource management functions */
+int saa7146_res_get(struct saa7146_fh *fh, unsigned int bit);
+int saa7146_res_check(struct saa7146_fh *fh, unsigned int bit);
+int saa7146_res_locked(struct saa7146_dev *dev, unsigned int bit);
+void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits);
+
+#define RESOURCE_DMA1_HPS	0x1
+#define RESOURCE_DMA2_CLP	0x2
+#define RESOURCE_DMA3_BRS	0x4
 
 /* saa7146 source inputs */
 #define SAA7146_HPS_SOURCE_PORT_A	0x00
diff -Nru a/include/media/tuner.h b/include/media/tuner.h
--- a/include/media/tuner.h	Tue Feb  3 19:45:34 2004
+++ b/include/media/tuner.h	Tue Feb  3 19:45:34 2004
@@ -65,14 +65,16 @@
 #define TUNER_PHILIPS_FM1216ME_MK3  38
 #define TUNER_LG_NTSC_NEW_TAPC   39
 #define TUNER_HITACHI_NTSC       40
-
-
+#define TUNER_PHILIPS_PAL_MK     41
+#define TUNER_PHILIPS_ATSC       42
+#define TUNER_PHILIPS_FM1236_MK3  43
 
 #define NOTUNER 0
 #define PAL     1	/* PAL_BG */
 #define PAL_I   2
 #define NTSC    3
 #define SECAM   4
+#define ATSC    5
 
 #define NoTuner 0
 #define Philips 1
diff -Nru a/include/net/addrconf.h b/include/net/addrconf.h
--- a/include/net/addrconf.h	Tue Feb  3 19:45:37 2004
+++ b/include/net/addrconf.h	Tue Feb  3 19:45:37 2004
@@ -15,6 +15,8 @@
 
 #define ADDR_CHECK_FREQUENCY		(120*HZ)
 
+#define IPV6_MAX_ADDRESSES		16
+
 struct prefix_info {
 	__u8			type;
 	__u8			length;
@@ -50,18 +52,16 @@
 extern void			addrconf_init(void);
 extern void			addrconf_cleanup(void);
 
-extern int		        addrconf_notify(struct notifier_block *this, 
-						unsigned long event, 
-						void * data);
-
 extern int			addrconf_add_ifaddr(void *arg);
 extern int			addrconf_del_ifaddr(void *arg);
 extern int			addrconf_set_dstaddr(void *arg);
 
 extern int			ipv6_chk_addr(struct in6_addr *addr,
-					      struct net_device *dev);
+					      struct net_device *dev,
+					      int strict);
 extern struct inet6_ifaddr *	ipv6_get_ifaddr(struct in6_addr *addr,
-						struct net_device *dev);
+						struct net_device *dev,
+						int strict);
 extern int			ipv6_get_saddr(struct dst_entry *dst, 
 					       struct in6_addr *daddr,
 					       struct in6_addr *saddr);
diff -Nru a/include/net/ah.h b/include/net/ah.h
--- a/include/net/ah.h	Tue Feb  3 19:45:17 2004
+++ b/include/net/ah.h	Tue Feb  3 19:45:17 2004
@@ -3,6 +3,9 @@
 
 #include <net/xfrm.h>
 
+/* This is the maximum truncated ICV length that we know of. */
+#define MAX_AH_AUTH_LEN	12
+
 struct ah_data
 {
 	u8			*key;
diff -Nru a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
--- a/include/net/bluetooth/bluetooth.h	Tue Feb  3 19:45:17 2004
+++ b/include/net/bluetooth/bluetooth.h	Tue Feb  3 19:45:17 2004
@@ -47,7 +47,8 @@
 #define BTPROTO_HCI     1
 #define BTPROTO_SCO   	2
 #define BTPROTO_RFCOMM	3
-#define BTPROTO_BNEP    4
+#define BTPROTO_BNEP	4
+#define BTPROTO_CMTP	5
 
 #define SOL_HCI     0
 #define SOL_L2CAP   6
@@ -129,7 +130,7 @@
 struct sock *bt_sock_alloc(struct socket *sock, int proto, int pi_size, int prio);
 void bt_sock_link(struct bt_sock_list *l, struct sock *s);
 void bt_sock_unlink(struct bt_sock_list *l, struct sock *s);
-int  bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, int len, int flags);
+int  bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags);
 uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait);
 int  bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo);
 
diff -Nru a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
--- a/include/net/bluetooth/hci.h	Tue Feb  3 19:45:42 2004
+++ b/include/net/bluetooth/hci.h	Tue Feb  3 19:45:42 2004
@@ -408,6 +408,16 @@
 	__u16    clock_offset;
 } __attribute__ ((packed));
 
+#define HCI_EV_INQUIRY_RESULT_WITH_RSSI	0x22
+struct inquiry_info_with_rssi {
+	bdaddr_t bdaddr;
+	__u8     pscan_rep_mode;
+	__u8     pscan_period_mode;
+	__u8     dev_class[3];
+	__u16    clock_offset;
+	__u8     rssi;
+} __attribute__ ((packed));
+
 #define HCI_EV_CONN_COMPLETE 	0x03
 struct hci_ev_conn_complete {
 	__u8     status;
diff -Nru a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
--- a/include/net/bluetooth/hci_core.h	Tue Feb  3 19:45:28 2004
+++ b/include/net/bluetooth/hci_core.h	Tue Feb  3 19:45:28 2004
@@ -176,6 +176,12 @@
 	c->list = NULL;
 }
 
+static inline int inquiry_cache_empty(struct hci_dev *hdev)
+{
+	struct inquiry_cache *c = &hdev->inq_cache;
+	return (c->list == NULL);
+}
+
 static inline long inquiry_cache_age(struct hci_dev *hdev)
 {
 	struct inquiry_cache *c = &hdev->inq_cache;
@@ -281,10 +287,12 @@
 static inline void hci_conn_put(struct hci_conn *conn)
 {
 	if (atomic_dec_and_test(&conn->refcnt)) {
-		if (conn->type == SCO_LINK)
+		if (conn->type == ACL_LINK) {
+			unsigned long timeo = (conn->out) ?
+				HCI_DISCONN_TIMEOUT : HCI_DISCONN_TIMEOUT * 2;
+			hci_conn_set_timer(conn, timeo);
+		} else
 			hci_conn_set_timer(conn, HZ / 100);
-		else if (conn->out)
-			hci_conn_set_timer(conn, HCI_DISCONN_TIMEOUT);
 	}
 }
 
diff -Nru a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
--- a/include/net/bluetooth/rfcomm.h	Tue Feb  3 19:45:37 2004
+++ b/include/net/bluetooth/rfcomm.h	Tue Feb  3 19:45:37 2004
@@ -167,8 +167,8 @@
 	int              initiator;
 
 	/* Default DLC parameters */
+	int    cfc;
 	uint   mtu;
-	uint   credits;
 
 	struct list_head dlcs;
 };
@@ -190,7 +190,7 @@
 	u8            mscex;
 
 	uint          mtu;
-	uint          credits;
+	uint          cfc;
 	uint          rx_credits;
 	uint          tx_credits;
 
@@ -218,6 +218,11 @@
 #define RFCOMM_MSCEX_TX     1
 #define RFCOMM_MSCEX_RX     2
 #define RFCOMM_MSCEX_OK     (RFCOMM_MSCEX_TX + RFCOMM_MSCEX_RX)
+
+/* CFC states */
+#define RFCOMM_CFC_UNKNOWN  -1
+#define RFCOMM_CFC_DISABLED 0
+#define RFCOMM_CFC_ENABLED  RFCOMM_MAX_CREDITS
 
 extern struct task_struct *rfcomm_thread;
 extern unsigned long rfcomm_event;
diff -Nru a/include/net/flow.h b/include/net/flow.h
--- a/include/net/flow.h	Tue Feb  3 19:45:42 2004
+++ b/include/net/flow.h	Tue Feb  3 19:45:42 2004
@@ -8,6 +8,7 @@
 #define _NET_FLOW_H
 
 #include <linux/in6.h>
+#include <asm/atomic.h>
 
 struct flowi {
 	int	oif;
diff -Nru a/include/net/if_inet6.h b/include/net/if_inet6.h
--- a/include/net/if_inet6.h	Tue Feb  3 19:45:42 2004
+++ b/include/net/if_inet6.h	Tue Feb  3 19:45:42 2004
@@ -25,6 +25,10 @@
 #define IF_RA_RCVD	0x20
 #define IF_RS_SENT	0x10
 
+/* prefix flags */
+#define IF_PREFIX_ONLINK	0x01
+#define IF_PREFIX_AUTOCONF	0x02
+
 #ifdef __KERNEL__
 
 struct inet6_ifaddr 
@@ -183,6 +187,7 @@
 	struct inet6_dev	*next;
 	struct ipv6_devconf	cnf;
 	struct ipv6_devstat	stats;
+	unsigned long		tstamp; /* ipv6InterfaceTable update timestamp */
 };
 
 extern struct ipv6_devconf ipv6_devconf;
diff -Nru a/include/net/inet_common.h b/include/net/inet_common.h
--- a/include/net/inet_common.h	Tue Feb  3 19:45:35 2004
+++ b/include/net/inet_common.h	Tue Feb  3 19:45:35 2004
@@ -23,11 +23,11 @@
 extern int			inet_recvmsg(struct kiocb *iocb,
 					     struct socket *sock, 
 					     struct msghdr *ubuf, 
-					     int size, int flags);
+					     size_t size, int flags);
 extern int			inet_sendmsg(struct kiocb *iocb,
 					     struct socket *sock, 
 					     struct msghdr *msg, 
-					     int size);
+					     size_t size);
 extern int			inet_shutdown(struct socket *sock, int how);
 extern unsigned int		inet_poll(struct file * file, struct socket *sock, struct poll_table_struct *wait);
 extern int			inet_setsockopt(struct socket *sock, int level,
diff -Nru a/include/net/ipv6.h b/include/net/ipv6.h
--- a/include/net/ipv6.h	Tue Feb  3 19:45:41 2004
+++ b/include/net/ipv6.h	Tue Feb  3 19:45:41 2004
@@ -401,11 +401,7 @@
 
 extern void			ipv6_packet_init(void);
 
-extern void			ipv6_netdev_notif_init(void);
-
 extern void			ipv6_packet_cleanup(void);
-
-extern void			ipv6_netdev_notif_cleanup(void);
 
 extern int 			ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len);
 extern void			ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, u16 port,
diff -Nru a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h
--- a/include/net/irda/ircomm_tty.h	Tue Feb  3 19:45:17 2004
+++ b/include/net/irda/ircomm_tty.h	Tue Feb  3 19:45:17 2004
@@ -122,6 +122,9 @@
 void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self);
 
 extern void ircomm_tty_change_speed(struct ircomm_tty_cb *self);
+extern int ircomm_tty_tiocmget(struct tty_struct *tty, struct file *file);
+extern int ircomm_tty_tiocmset(struct tty_struct *tty, struct file *file,
+			       unsigned int set, unsigned int clear);
 extern int ircomm_tty_ioctl(struct tty_struct *tty, struct file *file, 
 			    unsigned int cmd, unsigned long arg);
 extern void ircomm_tty_set_termios(struct tty_struct *tty, 
diff -Nru a/include/net/irda/timer.h b/include/net/irda/timer.h
--- a/include/net/irda/timer.h	Tue Feb  3 19:45:16 2004
+++ b/include/net/irda/timer.h	Tue Feb  3 19:45:16 2004
@@ -40,14 +40,14 @@
 struct lap_cb;
 
 /* 
- *  Timeout definitions, some defined in IrLAP p. 92
+ *  Timeout definitions, some defined in IrLAP 6.13.5 - p. 92
  */
 #define POLL_TIMEOUT        (450*HZ/1000)    /* Must never exceed 500 ms */
 #define FINAL_TIMEOUT       (500*HZ/1000)    /* Must never exceed 500 ms */
 
 /* 
- *  Normally twice of p-timer. Note 3, IrLAP p. 60 suggests at least twice 
- *  duration of the P-timer.
+ *  Normally twice of p-timer. Note 3, IrLAP 6.3.11.2 - p. 60 suggests
+ *  at least twice duration of the P-timer.
  */
 #define WD_TIMEOUT          (POLL_TIMEOUT*2)
 
diff -Nru a/include/net/ndisc.h b/include/net/ndisc.h
--- a/include/net/ndisc.h	Tue Feb  3 19:45:37 2004
+++ b/include/net/ndisc.h	Tue Feb  3 19:45:37 2004
@@ -98,6 +98,17 @@
 
 extern void			igmp6_cleanup(void);
 
+#ifdef CONFIG_SYSCTL
+extern int 			ndisc_ifinfo_sysctl_change(ctl_table *ctl,
+							   int write,
+							   struct file * filp,
+							   void __user *buffer,
+							   size_t *lenp);
+#endif
+
+extern void 			inet6_ifinfo_notify(int event,
+						    struct inet6_dev *idev);
+
 static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, struct in6_addr *addr)
 {
 
diff -Nru a/include/net/neighbour.h b/include/net/neighbour.h
--- a/include/net/neighbour.h	Tue Feb  3 19:45:42 2004
+++ b/include/net/neighbour.h	Tue Feb  3 19:45:42 2004
@@ -47,6 +47,7 @@
 #include <linux/skbuff.h>
 
 #include <linux/err.h>
+#include <linux/sysctl.h>
 
 #define NUD_IN_TIMER	(NUD_INCOMPLETE|NUD_DELAY|NUD_PROBE)
 #define NUD_VALID	(NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE|NUD_PROBE|NUD_STALE|NUD_DELAY)
@@ -206,8 +207,11 @@
 extern int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg);
 extern void neigh_app_ns(struct neighbour *n);
 
-extern int			neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
-						      int p_id, int pdev_id, char *p_name);
+extern int			neigh_sysctl_register(struct net_device *dev, 
+						      struct neigh_parms *p,
+						      int p_id, int pdev_id,
+						      char *p_name,
+						      proc_handler *proc_handler);
 extern void			neigh_sysctl_unregister(struct neigh_parms *p);
 
 /*
diff -Nru a/include/net/sctp/constants.h b/include/net/sctp/constants.h
--- a/include/net/sctp/constants.h	Tue Feb  3 19:45:17 2004
+++ b/include/net/sctp/constants.h	Tue Feb  3 19:45:17 2004
@@ -1,8 +1,8 @@
 /* SCTP kernel reference Implementation
+ * (C) Copyright IBM Corp. 2001, 2003
  * Copyright (c) 1999-2000 Cisco, Inc.
  * Copyright (c) 1999-2001 Motorola, Inc.
  * Copyright (c) 2001 Intel Corp.
- * Copyright (c) 2001-2002 International Business Machines Corp.
  *
  * This file is part of the SCTP kernel reference Implementation
  *
@@ -75,8 +75,6 @@
 #define SCTP_NUM_BASE_CHUNK_TYPES	(SCTP_CID_BASE_MAX + 1)
 #define SCTP_NUM_CHUNK_TYPES		(SCTP_NUM_BASE_CHUNKTYPES + 2)
 
-#define SCTP_CID_ADDIP_MIN		SCTP_CID_ASCONF
-#define SCTP_CID_ADDIP_MAX		SCTP_CID_ASCONF_ACK
 #define SCTP_NUM_ADDIP_CHUNK_TYPES	2
 
 /* These are the different flavours of event.  */
diff -Nru a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
--- a/include/net/sctp/sctp.h	Tue Feb  3 19:45:17 2004
+++ b/include/net/sctp/sctp.h	Tue Feb  3 19:45:17 2004
@@ -115,8 +115,10 @@
 #define SCTP_STATIC static
 #endif
 
-#define MSECS_TO_JIFFIES(msec) (msec * HZ / 1000)
-#define JIFFIES_TO_MSECS(jiff) (jiff * 1000 / HZ)
+#define MSECS_TO_JIFFIES(msec) \
+	(((msec / 1000) * HZ) + ((msec % 1000) * HZ) / 1000)
+#define JIFFIES_TO_MSECS(jiff) \
+	(((jiff / HZ) * 1000) + ((jiff % HZ) * 1000) / HZ)
 
 /*
  * Function declarations.
diff -Nru a/include/net/sctp/sm.h b/include/net/sctp/sm.h
--- a/include/net/sctp/sm.h	Tue Feb  3 19:45:17 2004
+++ b/include/net/sctp/sm.h	Tue Feb  3 19:45:17 2004
@@ -268,15 +268,15 @@
 struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *,
 					      union sctp_addr *,
 					      struct sockaddr *,
-					      int, int);
+					      int, __u16);
 struct sctp_chunk *sctp_make_asconf_set_prim(struct sctp_association *asoc,
 					     union sctp_addr *addr);
-struct sctp_chunk *sctp_make_asconf_ack(struct sctp_association *asoc,
-					int serial, int vparam_len);
-
+struct sctp_chunk *sctp_make_asconf_ack(const struct sctp_association *asoc,
+					__u32 serial, int vparam_len);
 struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
-				       struct sctp_chunk *asconf,
-				       int vparam_len);
+				       struct sctp_chunk *asconf);
+int sctp_process_asconf_ack(struct sctp_association *asoc,
+			    struct sctp_chunk *asconf_ack);
 
 void sctp_chunk_assign_tsn(struct sctp_chunk *);
 void sctp_chunk_assign_ssn(struct sctp_chunk *);
@@ -430,6 +430,21 @@
 {
 	return (((s) == (t)) || (((s) - (t)) & SSN_SIGN_BIT));
 }
+
+/*
+ * ADDIP 3.1.1
+ * The valid range of Serial Number is from 0 to 4294967295 (2**32 - 1). Serial
+ * Numbers wrap back to 0 after reaching 4294967295.
+ */
+enum {
+	ADDIP_SERIAL_SIGN_BIT = (1<<31)
+};
+
+static inline int ADDIP_SERIAL_gte(__u16 s, __u16 t)
+{
+	return (((s) == (t)) || (((t) - (s)) & ADDIP_SERIAL_SIGN_BIT));
+}
+
 
 /* Run sctp_add_cmd() generating a BUG() if there is a failure.  */
 static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj)
diff -Nru a/include/net/sctp/structs.h b/include/net/sctp/structs.h
--- a/include/net/sctp/structs.h	Tue Feb  3 19:45:43 2004
+++ b/include/net/sctp/structs.h	Tue Feb  3 19:45:43 2004
@@ -190,6 +190,9 @@
 	 */
 	struct list_head local_addr_list;
 	spinlock_t local_addr_lock;
+	
+	/* Flag to indicate if addip is enabled. */
+	int addip_enable;
 } sctp_globals;
 
 #define sctp_rto_initial		(sctp_globals.rto_initial)
@@ -217,6 +220,7 @@
 #define sctp_port_hashtable		(sctp_globals.port_hashtable)
 #define sctp_local_addr_list		(sctp_globals.local_addr_list)
 #define sctp_local_addr_lock		(sctp_globals.local_addr_lock)
+#define sctp_addip_enable		(sctp_globals.addip_enable)
 
 /* SCTP Socket type: UDP or TCP style. */
 typedef enum {
@@ -1397,6 +1401,11 @@
 		/* Does peer support ADDIP? */
 		__u8    asconf_capable;
 
+		/* This mask is used to disable sending the ASCONF chunk
+		 * with specified parameter to peer.
+		 */
+		__u16 addip_disabled_mask;
+
 		struct sctp_inithdr i;
 		int cookie_len;
 		void *cookie;
@@ -1708,6 +1717,8 @@
 struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *,
 				     const union sctp_addr *address,
 				     const int gfp);
+void sctp_assoc_del_peer(struct sctp_association *asoc,
+			 const union sctp_addr *addr);
 void sctp_assoc_control_transport(struct sctp_association *,
 				  struct sctp_transport *,
 				  sctp_transport_cmd_t, sctp_sn_error_t);
diff -Nru a/include/net/sock.h b/include/net/sock.h
--- a/include/net/sock.h	Tue Feb  3 19:45:34 2004
+++ b/include/net/sock.h	Tue Feb  3 19:45:34 2004
@@ -246,6 +246,7 @@
 	struct socket		*sk_socket;
 	void			*sk_user_data;
 	struct module		*sk_owner;
+	void			*sk_security;
 	void			(*sk_state_change)(struct sock *sk);
 	void			(*sk_data_ready)(struct sock *sk, int bytes);
 	void			(*sk_write_space)(struct sock *sk);
@@ -304,7 +305,24 @@
 	return 0;
 }
 
-static inline void __sock_put(struct sock *sk);
+/* Grab socket reference count. This operation is valid only
+   when sk is ALREADY grabbed f.e. it is found in hash table
+   or a list and the lookup is made under lock preventing hash table
+   modifications.
+ */
+
+static inline void sock_hold(struct sock *sk)
+{
+	atomic_inc(&sk->sk_refcnt);
+}
+
+/* Ungrab socket in the context, which assumes that socket refcnt
+   cannot hit zero, f.e. it is true in context of any socketcall.
+ */
+static inline void __sock_put(struct sock *sk)
+{
+	atomic_dec(&sk->sk_refcnt);
+}
 
 static __inline__ int sk_del_node_init(struct sock *sk)
 {
@@ -418,10 +436,10 @@
 					int optname, char *optval, 
 					int *option);  	 
 	int			(*sendmsg)(struct kiocb *iocb, struct sock *sk,
-					   struct msghdr *msg, int len);
+					   struct msghdr *msg, size_t len);
 	int			(*recvmsg)(struct kiocb *iocb, struct sock *sk,
 					   struct msghdr *msg,
-					int len, int noblock, int flags, 
+					size_t len, int noblock, int flags, 
 					int *addr_len);
 	int			(*sendpage)(struct sock *sk, struct page *page,
 					int offset, size_t size, int flags);
@@ -455,8 +473,8 @@
 	 * change the ownership of this struct sock, with one not needed
 	 * transient sk_set_owner call.
 	 */
-	if (unlikely(sk->sk_owner != NULL))
-		BUG();
+	BUG_ON(sk->sk_owner != NULL);
+
 	sk->sk_owner = owner;
 	__module_get(owner);
 }
@@ -609,9 +627,9 @@
 extern int			sock_no_setsockopt(struct socket *, int, int,
 						   char *, int);
 extern int                      sock_no_sendmsg(struct kiocb *, struct socket *,
-						struct msghdr *, int);
+						struct msghdr *, size_t);
 extern int                      sock_no_recvmsg(struct kiocb *, struct socket *,
-						struct msghdr *, int, int);
+						struct msghdr *, size_t, int);
 extern int			sock_no_mmap(struct file *file,
 					     struct socket *sock,
 					     struct vm_area_struct *vma);
@@ -721,25 +739,6 @@
  *   BR_NETPROTO_LOCK, so that it has not this race condition. UNIX sockets
  *   use separate SMP lock, so that they are prone too.
  */
-
-/* Grab socket reference count. This operation is valid only
-   when sk is ALREADY grabbed f.e. it is found in hash table
-   or a list and the lookup is made under lock preventing hash table
-   modifications.
- */
-
-static inline void sock_hold(struct sock *sk)
-{
-	atomic_inc(&sk->sk_refcnt);
-}
-
-/* Ungrab socket in the context, which assumes that socket refcnt
-   cannot hit zero, f.e. it is true in context of any socketcall.
- */
-static inline void __sock_put(struct sock *sk)
-{
-	atomic_dec(&sk->sk_refcnt);
-}
 
 /* Ungrab socket and destroy it, if it was the last reference. */
 static inline void sock_put(struct sock *sk)
diff -Nru a/include/net/tcp.h b/include/net/tcp.h
--- a/include/net/tcp.h	Tue Feb  3 19:45:17 2004
+++ b/include/net/tcp.h	Tue Feb  3 19:45:17 2004
@@ -752,7 +752,7 @@
 extern int		    	tcp_v4_tw_remember_stamp(struct tcp_tw_bucket *tw);
 
 extern int			tcp_sendmsg(struct kiocb *iocb, struct sock *sk,
-					    struct msghdr *msg, int size);
+					    struct msghdr *msg, size_t size);
 extern ssize_t			tcp_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags);
 
 extern int			tcp_ioctl(struct sock *sk, 
@@ -846,7 +846,7 @@
 extern void			tcp_set_keepalive(struct sock *sk, int val);
 extern int			tcp_recvmsg(struct kiocb *iocb, struct sock *sk,
 					    struct msghdr *msg,
-					    int len, int nonblock, 
+					    size_t len, int nonblock, 
 					    int flags, int *addr_len);
 
 extern int			tcp_listen_start(struct sock *sk);
@@ -1457,7 +1457,7 @@
 		if (tp->ucopy.memory > sk->sk_rcvbuf) {
 			struct sk_buff *skb1;
 
-			if (sock_owned_by_user(sk)) BUG();
+			BUG_ON(sock_owned_by_user(sk));
 
 			while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) {
 				sk->sk_backlog_rcv(sk, skb1);
diff -Nru a/include/net/udp.h b/include/net/udp.h
--- a/include/net/udp.h	Tue Feb  3 19:45:37 2004
+++ b/include/net/udp.h	Tue Feb  3 19:45:37 2004
@@ -68,7 +68,7 @@
 			    struct sockaddr *usin, int addr_len);
 
 extern int	udp_sendmsg(struct kiocb *iocb, struct sock *sk,
-			    struct msghdr *msg, int len);
+			    struct msghdr *msg, size_t len);
 
 extern int	udp_rcv(struct sk_buff *skb);
 extern int	udp_ioctl(struct sock *sk, int cmd, unsigned long arg);
diff -Nru a/include/pcmcia/cs.h b/include/pcmcia/cs.h
--- a/include/pcmcia/cs.h	Tue Feb  3 19:45:16 2004
+++ b/include/pcmcia/cs.h	Tue Feb  3 19:45:16 2004
@@ -421,12 +421,6 @@
     GetFirstWindow, GetNextWindow, GetMemPage
 };
 
-#ifdef IN_CARD_SERVICES
-extern int CardServices(int func, void *a1, void *a2, void *a3);
-#else
-extern int CardServices(int func, ...);
-#endif
-
 int pcmcia_access_configuration_register(client_handle_t handle, conf_reg_t *reg);
 int pcmcia_bind_device(bind_req_t *req);
 int pcmcia_bind_mtd(mtd_bind_t *req);
diff -Nru a/include/rxrpc/call.h b/include/rxrpc/call.h
--- a/include/rxrpc/call.h	Tue Feb  3 19:45:17 2004
+++ b/include/rxrpc/call.h	Tue Feb  3 19:45:17 2004
@@ -187,8 +187,7 @@
 
 static inline void rxrpc_get_call(struct rxrpc_call *call)
 {
-	if (atomic_read(&call->usage)<=0)
-		BUG();
+	BUG_ON(atomic_read(&call->usage)<=0);
 	atomic_inc(&call->usage);
 	/*printk("rxrpc_get_call(%p{u=%d})\n",(C),atomic_read(&(C)->usage));*/
 }
diff -Nru a/include/rxrpc/connection.h b/include/rxrpc/connection.h
--- a/include/rxrpc/connection.h	Tue Feb  3 19:45:40 2004
+++ b/include/rxrpc/connection.h	Tue Feb  3 19:45:40 2004
@@ -67,8 +67,7 @@
 
 static inline void rxrpc_get_connection(struct rxrpc_connection *conn)
 {
-	if (atomic_read(&conn->usage)<0)
-		BUG();
+	BUG_ON(atomic_read(&conn->usage)<0);
 	atomic_inc(&conn->usage);
 	//printk("rxrpc_get_conn(%p{u=%d})\n",conn,atomic_read(&conn->usage));
 }
diff -Nru a/include/rxrpc/message.h b/include/rxrpc/message.h
--- a/include/rxrpc/message.h	Tue Feb  3 19:45:17 2004
+++ b/include/rxrpc/message.h	Tue Feb  3 19:45:17 2004
@@ -53,8 +53,7 @@
 extern void __rxrpc_put_message(struct rxrpc_message *msg);
 static inline void rxrpc_put_message(struct rxrpc_message *msg)
 {
-	if (atomic_read(&msg->usage)<=0)
-		BUG();
+	BUG_ON(atomic_read(&msg->usage)<=0);
 	if (atomic_dec_and_test(&msg->usage))
 		__rxrpc_put_message(msg);
 }
diff -Nru a/include/rxrpc/peer.h b/include/rxrpc/peer.h
--- a/include/rxrpc/peer.h	Tue Feb  3 19:45:34 2004
+++ b/include/rxrpc/peer.h	Tue Feb  3 19:45:34 2004
@@ -72,8 +72,7 @@
 
 static inline void rxrpc_get_peer(struct rxrpc_peer *peer)
 {
-	if (atomic_read(&peer->usage)<0)
-		BUG();
+	BUG_ON(atomic_read(&peer->usage)<0);
 	atomic_inc(&peer->usage);
 	//printk("rxrpc_get_peer(%p{u=%d})\n",peer,atomic_read(&peer->usage));
 }
diff -Nru a/include/rxrpc/transport.h b/include/rxrpc/transport.h
--- a/include/rxrpc/transport.h	Tue Feb  3 19:45:43 2004
+++ b/include/rxrpc/transport.h	Tue Feb  3 19:45:43 2004
@@ -85,8 +85,7 @@
 
 static inline void rxrpc_get_transport(struct rxrpc_transport *trans)
 {
-	if (atomic_read(&trans->usage) <= 0)
-		BUG();
+	BUG_ON(atomic_read(&trans->usage) <= 0);
 	atomic_inc(&trans->usage);
 	//printk("rxrpc_get_transport(%p{u=%d})\n",
 	//       trans, atomic_read(&trans->usage));
diff -Nru a/include/scsi/scsi.h b/include/scsi/scsi.h
--- a/include/scsi/scsi.h	Tue Feb  3 19:45:43 2004
+++ b/include/scsi/scsi.h	Tue Feb  3 19:45:43 2004
@@ -302,7 +302,7 @@
 #define QUEUED          0x2004
 #define SOFT_ERROR      0x2005
 #define ADD_TO_MLQUEUE  0x2006
-#define TIMEOUT         0x2007
+#define TIMEOUT_ERROR   0x2007
 
 /*
  * Midlevel queue return values.
diff -Nru a/include/sound/core.h b/include/sound/core.h
--- a/include/sound/core.h	Tue Feb  3 19:45:43 2004
+++ b/include/sound/core.h	Tue Feb  3 19:45:43 2004
@@ -160,6 +160,7 @@
 	int shutdown;			/* this card is going down */
 	wait_queue_head_t shutdown_sleep;
 	struct work_struct free_workq;	/* for free in workqueue */
+	struct device *dev;
 
 #ifdef CONFIG_PM
 	int (*set_power_state) (snd_card_t *card, unsigned int state);
diff -Nru a/include/video/kyro.h b/include/video/kyro.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/video/kyro.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,94 @@
+/*
+ *  linux/drivers/video/kyro/kryo.h
+ *
+ *  Copyright (C) 2002 STMicroelectronics
+ *  Copyright (C) 2004 Paul Mundt
+ *
+ * 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.
+ */
+
+#ifndef _KYRO_H
+#define _KYRO_H
+
+struct kyrofb_info {
+	void *regbase;
+
+	u32 HTot;	/* Hor Total Time    */
+	u32 HFP;	/* Hor Front Porch   */
+	u32 HST;	/* Hor Sync Time     */
+	u32 HBP;	/* Hor Back Porch    */
+	s32 HSP;		/* Hor Sync Polarity */
+	u32 VTot;	/* Ver Total Time    */
+	u32 VFP;	/* Ver Front Porch   */
+	u32 VST;	/* Ver Sync Time     */
+	u32 VBP;	/* Ver Back Porch    */
+	s32 VSP;		/* Ver Sync Polarity */
+	u32 XRES;	/* X Resolution      */
+	u32 YRES;	/* Y Resolution      */
+	u32 VFREQ;	/* Ver Frequency     */
+	u32 PIXCLK;	/* Pixel Clock       */
+	u32 HCLK;	/* Hor Clock         */
+
+	/* Usefull to hold depth here for Linux */
+	u8 PIXDEPTH;
+
+#ifdef CONFIG_MTRR
+	int mtrr_handle;
+#endif
+};
+
+extern int kyro_dev_init(void);
+extern void kyro_dev_reset(void);
+
+extern unsigned char *kyro_dev_physical_fb_ptr(void);
+extern unsigned char *kyro_dev_virtual_fb_ptr(void);
+extern void *kyro_dev_physical_regs_ptr(void);
+extern void *kyro_dev_virtual_regs_ptr(void);
+extern unsigned int kyro_dev_fb_size(void);
+extern unsigned int kyro_dev_regs_size(void);
+
+extern int kyro_dev_overlay_create(u32 width, u32 height, int bLinear);
+extern u32 kyro_dev_overlay_offset(void);
+extern int kyro_dev_overlay_viewport_set(u32 x, u32 y, u32 width, u32 height);
+
+/*
+ * benedict.gaster@superh.com
+ * Added the follow IOCTLS for the creation of overlay services...
+ */
+#define KYRO_IOC_MAGIC 'k'
+
+#define KYRO_IOCTL_OVERLAY_CREATE       _IO(KYRO_IOC_MAGIC, 0)
+#define KYRO_IOCTL_OVERLAY_VIEWPORT_SET _IO(KYRO_IOC_MAGIC, 1)
+#define KYRO_IOCTL_SET_VIDEO_MODE       _IO(KYRO_IOC_MAGIC, 2)
+#define KYRO_IOCTL_UVSTRIDE             _IO(KYRO_IOC_MAGIC, 3)
+#define KYRO_IOCTL_OVERLAY_OFFSET       _IO(KYRO_IOC_MAGIC, 4)
+#define KYRO_IOCTL_STRIDE               _IO(KYRO_IOC_MAGIC, 5)
+
+/*
+ * The follow 3 structures are used to pass data from user space into the kernel
+ * for the creation of overlay surfaces and setting the video mode.
+ */
+typedef struct _OVERLAY_CREATE {
+	u32 ulWidth;
+	u32 ulHeight;
+	int bLinear;
+} overlay_create;
+
+typedef struct _OVERLAY_VIEWPORT_SET {
+	u32 xOrgin;
+	u32 yOrgin;
+	u32 xSize;
+	u32 ySize;
+} overlay_viewport_set;
+
+typedef struct _SET_VIDEO_MODE {
+	u32 ulWidth;
+	u32 ulHeight;
+	u32 ulScan;
+	u8 displayDepth;
+	int bLinear;
+} set_video_mode;
+
+#endif /* _KYRO_H */
diff -Nru a/init/main.c b/init/main.c
--- a/init/main.c	Tue Feb  3 19:45:17 2004
+++ b/init/main.c	Tue Feb  3 19:45:17 2004
@@ -105,7 +105,7 @@
 
 extern void time_init(void);
 /* Default late time init is NULL. archs can override this later. */
-void (*late_time_init)(void) = NULL;
+void (*late_time_init)(void);
 extern void softirq_init(void);
 
 static char *execute_command;
@@ -339,7 +339,7 @@
 /* Called by boot processor to activate the rest. */
 static void __init smp_init(void)
 {
-	unsigned int i;
+	unsigned int i, j=0;
 
 	/* FIXME: This should be done in userspace --RR */
 	for (i = 0; i < NR_CPUS; i++) {
@@ -348,11 +348,12 @@
 		if (cpu_possible(i) && !cpu_online(i)) {
 			printk("Bringing up %i\n", i);
 			cpu_up(i);
+			j++;
 		}
 	}
 
 	/* Any cleanup work */
-	printk("CPUS done %u\n", max_cpus);
+	printk("CPUS done %u\n", j);
 	smp_cpus_done(max_cpus);
 #if 0
 	/* Get other processors into their bootup holding patterns. */
@@ -408,6 +409,7 @@
 	parse_args("Booting kernel", command_line, __start___param,
 		   __stop___param - __start___param,
 		   &unknown_bootoption);
+	sort_main_extable();
 	trap_init();
 	rcu_init();
 	init_IRQ();
diff -Nru a/ipc/msg.c b/ipc/msg.c
--- a/ipc/msg.c	Tue Feb  3 19:45:16 2004
+++ b/ipc/msg.c	Tue Feb  3 19:45:16 2004
@@ -557,6 +557,7 @@
 	switch (cmd) {
 	case IPC_SET:
 	{
+		err = -EPERM;
 		if (setbuf.qbytes > msg_ctlmnb && !capable(CAP_SYS_RESOURCE))
 			goto out_unlock_up;
 
diff -Nru a/kernel/cpu.c b/kernel/cpu.c
--- a/kernel/cpu.c	Tue Feb  3 19:45:42 2004
+++ b/kernel/cpu.c	Tue Feb  3 19:45:42 2004
@@ -14,7 +14,7 @@
 /* This protects CPUs going up and down... */
 DECLARE_MUTEX(cpucontrol);
 
-static struct notifier_block *cpu_chain = NULL;
+static struct notifier_block *cpu_chain;
 
 /* Need to know about CPUs going up/down? */
 int register_cpu_notifier(struct notifier_block *nb)
diff -Nru a/kernel/dma.c b/kernel/dma.c
--- a/kernel/dma.c	Tue Feb  3 19:45:17 2004
+++ b/kernel/dma.c	Tue Feb  3 19:45:17 2004
@@ -136,20 +136,7 @@
 
 static int proc_dma_open(struct inode *inode, struct file *file)
 {
-	char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
-	struct seq_file *m;
-	int res;
-
-	if (!buf)
-		return -ENOMEM;
-	res = single_open(file, proc_dma_show, NULL);
-	if (!res) {
-		m = file->private_data;
-		m->buf = buf;
-		m->size = PAGE_SIZE;
-	} else
-		kfree(buf);
-	return res;
+	return single_open(file, proc_dma_show, NULL);
 }
 
 static struct file_operations proc_dma_operations = {
diff -Nru a/kernel/exit.c b/kernel/exit.c
--- a/kernel/exit.c	Tue Feb  3 19:45:42 2004
+++ b/kernel/exit.c	Tue Feb  3 19:45:42 2004
@@ -403,6 +403,8 @@
 	}
 }
 
+EXPORT_SYMBOL(put_files_struct);
+
 static inline void __exit_files(struct task_struct *tsk)
 {
 	struct files_struct * files = tsk->files;
@@ -529,7 +531,8 @@
 	p->self_exec_id++;
 
 	if (p->pdeath_signal)
-		send_group_sig_info(p->pdeath_signal, 0, p);
+		/* We already hold the tasklist_lock here.  */
+		group_send_sig_info(p->pdeath_signal, (void *) 0, p);
 
 	/* Move the child from its dying parent to the new one.  */
 	if (unlikely(traced)) {
diff -Nru a/kernel/extable.c b/kernel/extable.c
--- a/kernel/extable.c	Tue Feb  3 19:45:17 2004
+++ b/kernel/extable.c	Tue Feb  3 19:45:17 2004
@@ -16,11 +16,18 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 #include <linux/module.h>
+#include <linux/init.h>
 #include <asm/uaccess.h>
 #include <asm/sections.h>
 
-extern const struct exception_table_entry __start___ex_table[];
-extern const struct exception_table_entry __stop___ex_table[];
+extern struct exception_table_entry __start___ex_table[];
+extern struct exception_table_entry __stop___ex_table[];
+
+/* Sort the kernel's built-in exception table */
+void __init sort_main_extable(void)
+{
+	sort_extable(__start___ex_table, __stop___ex_table);
+}
 
 /* Given an address, look for it in the exception tables. */
 const struct exception_table_entry *search_exception_tables(unsigned long addr)
diff -Nru a/kernel/fork.c b/kernel/fork.c
--- a/kernel/fork.c	Tue Feb  3 19:45:16 2004
+++ b/kernel/fork.c	Tue Feb  3 19:45:16 2004
@@ -60,10 +60,9 @@
 	int cpu;
 	int total = 0;
 
-	for (cpu = 0; cpu < NR_CPUS; cpu++) {
-		if (cpu_online(cpu))
-			total += per_cpu(process_counts, cpu);
-	}
+	for_each_cpu(cpu)
+		total += per_cpu(process_counts, cpu);
+
 	return total;
 }
 
@@ -316,9 +315,9 @@
 				atomic_dec(&inode->i_writecount);
       
 			/* insert tmp into the share list, just after mpnt */
-			down(&inode->i_mapping->i_shared_sem);
+			down(&file->f_mapping->i_shared_sem);
 			list_add_tail(&tmp->shared, &mpnt->shared);
-			up(&inode->i_mapping->i_shared_sem);
+			up(&file->f_mapping->i_shared_sem);
 		}
 
 		/*
@@ -860,22 +859,6 @@
 	if ((clone_flags & CLONE_SIGHAND) && !(clone_flags & CLONE_VM))
 		return ERR_PTR(-EINVAL);
 
-	/*
-	 * CLONE_DETACHED must match CLONE_THREAD: it's a historical
-	 * thing.
-	 */
-	if (!(clone_flags & CLONE_DETACHED) != !(clone_flags & CLONE_THREAD)) {
-		/* Warn about the old no longer supported case so that we see it */
-		if (clone_flags & CLONE_THREAD) {
-			static int count;
-			if (count < 5) {
-				count++;
-				printk(KERN_WARNING "%s trying to use CLONE_THREAD without CLONE_DETACH\n", current->comm);
-			}
-		}
-		return ERR_PTR(-EINVAL);
-	}
-
 	retval = security_task_create(clone_flags);
 	if (retval)
 		goto fork_out;
@@ -910,23 +893,7 @@
 	if (p->binfmt && !try_module_get(p->binfmt->module))
 		goto bad_fork_cleanup_put_domain;
 
-#ifdef CONFIG_PREEMPT
-	/*
-	 * schedule_tail drops this_rq()->lock so we compensate with a count
-	 * of 1.  Also, we want to start with kernel preemption disabled.
-	 */
-	p->thread_info->preempt_count = 1;
-#endif
 	p->did_exec = 0;
-
-	/*
-	 * We mark the process as running here, but have not actually
-	 * inserted it onto the runqueue yet. This guarantees that
-	 * nobody will actually run it, and a signal or other external
-	 * event cannot wake it up and insert it on the runqueue either.
-	 */
-	p->state = TASK_RUNNING;
-
 	copy_flags(clone_flags, p);
 	if (clone_flags & CLONE_IDLETASK)
 		p->pid = 0;
@@ -942,15 +909,12 @@
 
 	p->proc_dentry = NULL;
 
-	INIT_LIST_HEAD(&p->run_list);
-
 	INIT_LIST_HEAD(&p->children);
 	INIT_LIST_HEAD(&p->sibling);
 	INIT_LIST_HEAD(&p->posix_timers);
 	init_waitqueue_head(&p->wait_chldexit);
 	p->vfork_done = NULL;
 	spin_lock_init(&p->alloc_lock);
-	spin_lock_init(&p->switch_lock);
 	spin_lock_init(&p->proc_lock);
 
 	clear_tsk_thread_flag(p, TIF_SIGPENDING);
@@ -965,7 +929,6 @@
 	p->tty_old_pgrp = 0;
 	p->utime = p->stime = 0;
 	p->cutime = p->cstime = 0;
-	p->array = NULL;
 	p->lock_depth = -1;		/* -1 = no lock */
 	p->start_time = get_jiffies_64();
 	p->security = NULL;
@@ -1014,38 +977,12 @@
 	p->exit_signal = (clone_flags & CLONE_THREAD) ? -1 : (clone_flags & CSIGNAL);
 	p->pdeath_signal = 0;
 
+	/* Perform scheduler related setup */
+	sched_fork(p);
+
 	/*
-	 * Share the timeslice between parent and child, thus the
-	 * total amount of pending timeslices in the system doesn't change,
-	 * resulting in more scheduling fairness.
-	 */
-	local_irq_disable();
-        p->time_slice = (current->time_slice + 1) >> 1;
-	/*
-	 * The remainder of the first timeslice might be recovered by
-	 * the parent if the child exits early enough.
-	 */
-	p->first_time_slice = 1;
-	current->time_slice >>= 1;
-	p->timestamp = sched_clock();
-	if (!current->time_slice) {
-		/*
-	 	 * This case is rare, it happens when the parent has only
-	 	 * a single jiffy left from its timeslice. Taking the
-		 * runqueue lock is not a problem.
-		 */
-		current->time_slice = 1;
-		preempt_disable();
-		scheduler_tick(0, 0);
-		local_irq_enable();
-		preempt_enable();
-	} else
-		local_irq_enable();
-	/*
-	 * Ok, add it to the run-queues and make it
-	 * visible to the rest of the system.
-	 *
-	 * Let it rip!
+	 * Ok, make it visible to the rest of the system.
+	 * We dont wake it up yet.
 	 */
 	p->tgid = p->pid;
 	p->group_leader = p;
diff -Nru a/kernel/futex.c b/kernel/futex.c
--- a/kernel/futex.c	Tue Feb  3 19:45:17 2004
+++ b/kernel/futex.c	Tue Feb  3 19:45:17 2004
@@ -577,6 +577,7 @@
 	filp->f_op = &futex_fops;
 	filp->f_vfsmnt = mntget(futex_mnt);
 	filp->f_dentry = dget(futex_mnt->mnt_root);
+	filp->f_mapping = filp->f_dentry->d_inode->i_mapping;
 
 	if (signal) {
 		int err;
diff -Nru a/kernel/module.c b/kernel/module.c
--- a/kernel/module.c	Tue Feb  3 19:45:34 2004
+++ b/kernel/module.c	Tue Feb  3 19:45:34 2004
@@ -687,8 +687,8 @@
 		goto out;
 	}
 
-	/* Already dying? */
-	if (mod->state == MODULE_STATE_GOING) {
+	/* Doing init or already dying? */
+	if (mod->state != MODULE_STATE_LIVE) {
 		/* FIXME: if (force), slam module count and wake up
                    waiter --RR */
 		DEBUGP("%s already dying\n", mod->name);
@@ -1395,6 +1395,7 @@
 	struct module *mod;
 	long err = 0;
 	void *percpu = NULL, *ptr = NULL; /* Stops spurious gcc warning */
+	struct exception_table_entry *extable;
 
 	DEBUGP("load_module: umod=%p, len=%lu, uargs=%p\n",
 	       umod, len, uargs);
@@ -1420,6 +1421,9 @@
 		goto free_hdr;
 	}
 
+	if (len < hdr->e_shoff + hdr->e_shnum * sizeof(Elf_Shdr))
+		goto truncated;
+
 	/* Convenience variables */
 	sechdrs = (void *)hdr + hdr->e_shoff;
 	secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
@@ -1429,6 +1433,10 @@
 	symindex = strindex = 0;
 
 	for (i = 1; i < hdr->e_shnum; i++) {
+		if (sechdrs[i].sh_type != SHT_NOBITS
+		    && len < sechdrs[i].sh_offset + sechdrs[i].sh_size)
+			goto truncated;
+
 		/* Mark all sections sh_addr with their address in the
 		   temporary image. */
 		sechdrs[i].sh_addr = (size_t)hdr + sechdrs[i].sh_offset;
@@ -1611,10 +1619,6 @@
 	}
 #endif
 
-  	/* Set up exception table */
-	mod->num_exentries = sechdrs[exindex].sh_size / sizeof(*mod->extable);
-	mod->extable = (void *)sechdrs[exindex].sh_addr;
-
 	/* Now do relocations. */
 	for (i = 1; i < hdr->e_shnum; i++) {
 		const char *strtab = (char *)sechdrs[strindex].sh_addr;
@@ -1637,6 +1641,11 @@
 			goto cleanup;
 	}
 
+  	/* Set up and sort exception table */
+	mod->num_exentries = sechdrs[exindex].sh_size / sizeof(*mod->extable);
+	mod->extable = extable = (void *)sechdrs[exindex].sh_addr;
+	sort_extable(extable, extable + mod->num_exentries);
+
 	/* Finally, copy percpu area over. */
 	percpu_modcopy(mod->percpu, (void *)sechdrs[pcpuindex].sh_addr,
 		       sechdrs[pcpuindex].sh_size);
@@ -1692,6 +1701,11 @@
 	vfree(hdr);
 	if (err < 0) return ERR_PTR(err);
 	else return ptr;
+
+ truncated:
+	printk(KERN_ERR "Module len %lu truncated\n", len);
+	err = -ENOEXEC;
+	goto free_hdr;
 }
 
 /* This is where the real work happens */
diff -Nru a/kernel/posix-timers.c b/kernel/posix-timers.c
--- a/kernel/posix-timers.c	Tue Feb  3 19:45:28 2004
+++ b/kernel/posix-timers.c	Tue Feb  3 19:45:28 2004
@@ -574,7 +574,7 @@
  * it is the same as a requeue pending timer WRT to what we should
  * report.
  */
-void inline
+static void
 do_timer_gettime(struct k_itimer *timr, struct itimerspec *cur_setting)
 {
 	unsigned long expires;
diff -Nru a/kernel/power/pmdisk.c b/kernel/power/pmdisk.c
--- a/kernel/power/pmdisk.c	Tue Feb  3 19:45:29 2004
+++ b/kernel/power/pmdisk.c	Tue Feb  3 19:45:29 2004
@@ -28,6 +28,7 @@
 #include <linux/device.h>
 #include <linux/swapops.h>
 #include <linux/bootmem.h>
+#include <linux/utsname.h>
 
 #include <asm/mmu_context.h>
 
diff -Nru a/kernel/printk.c b/kernel/printk.c
--- a/kernel/printk.c	Tue Feb  3 19:45:43 2004
+++ b/kernel/printk.c	Tue Feb  3 19:45:43 2004
@@ -763,3 +763,45 @@
 		tty->driver->write(tty, 0, msg, strlen(msg));
 	return;
 }
+
+/* minimum time in jiffies between messages */
+int printk_ratelimit_jiffies = 5*HZ;
+
+/* number of messages we send before ratelimiting */
+int printk_ratelimit_burst = 10;
+
+/*
+ * printk rate limiting, lifted from the networking subsystem.
+ *
+ * This enforces a rate limit: not more than one kernel message
+ * every printk_ratelimit_jiffies to make a denial-of-service
+ * attack impossible.
+ */
+int printk_ratelimit(void)
+{
+	static spinlock_t ratelimit_lock = SPIN_LOCK_UNLOCKED;
+	static unsigned long toks = 10*5*HZ;
+	static unsigned long last_msg;
+	static int missed;
+	unsigned long flags;
+	unsigned long now = jiffies;
+
+	spin_lock_irqsave(&ratelimit_lock, flags);
+	toks += now - last_msg;
+	last_msg = now;
+	if (toks > (printk_ratelimit_burst * printk_ratelimit_jiffies))
+		toks = printk_ratelimit_burst * printk_ratelimit_jiffies;
+	if (toks >= printk_ratelimit_jiffies) {
+		int lost = missed;
+		missed = 0;
+		toks -= printk_ratelimit_jiffies;
+		spin_unlock_irqrestore(&ratelimit_lock, flags);
+		if (lost)
+			printk(KERN_WARNING "printk: %d messages suppressed.\n", lost);
+		return 1;
+	}
+	missed++;
+	spin_unlock_irqrestore(&ratelimit_lock, flags);
+	return 0;
+}
+EXPORT_SYMBOL(printk_ratelimit);
diff -Nru a/kernel/sched.c b/kernel/sched.c
--- a/kernel/sched.c	Tue Feb  3 19:45:37 2004
+++ b/kernel/sched.c	Tue Feb  3 19:45:37 2004
@@ -79,13 +79,13 @@
  */
 #define MIN_TIMESLICE		( 10 * HZ / 1000)
 #define MAX_TIMESLICE		(200 * HZ / 1000)
-#define ON_RUNQUEUE_WEIGHT	30
-#define CHILD_PENALTY		95
+#define ON_RUNQUEUE_WEIGHT	 30
+#define CHILD_PENALTY		 95
 #define PARENT_PENALTY		100
-#define EXIT_WEIGHT		3
-#define PRIO_BONUS_RATIO	25
+#define EXIT_WEIGHT		  3
+#define PRIO_BONUS_RATIO	 25
 #define MAX_BONUS		(MAX_USER_PRIO * PRIO_BONUS_RATIO / 100)
-#define INTERACTIVE_DELTA	2
+#define INTERACTIVE_DELTA	  2
 #define MAX_SLEEP_AVG		(AVG_TIMESLICE * MAX_BONUS)
 #define STARVATION_LIMIT	(MAX_SLEEP_AVG)
 #define NS_MAX_SLEEP_AVG	(JIFFIES_TO_NS(MAX_SLEEP_AVG))
@@ -143,7 +143,7 @@
 #define TASK_INTERACTIVE(p) \
 	((p)->prio <= (p)->static_prio - DELTA(p))
 
-#define JUST_INTERACTIVE_SLEEP(p) \
+#define INTERACTIVE_SLEEP(p) \
 	(JIFFIES_TO_NS(MAX_SLEEP_AVG * \
 		(MAX_BONUS / 2 + DELTA((p)) + 1) / MAX_BONUS - 1))
 
@@ -168,7 +168,8 @@
  */
 
 #define BASE_TIMESLICE(p) (MIN_TIMESLICE + \
-	((MAX_TIMESLICE - MIN_TIMESLICE) * (MAX_PRIO-1-(p)->static_prio)/(MAX_USER_PRIO - 1)))
+		((MAX_TIMESLICE - MIN_TIMESLICE) * \
+			(MAX_PRIO-1 - (p)->static_prio) / (MAX_USER_PRIO-1)))
 
 static inline unsigned int task_timeslice(task_t *p)
 {
@@ -199,11 +200,11 @@
 struct runqueue {
 	spinlock_t lock;
 	unsigned long nr_running, nr_switches, expired_timestamp,
-			nr_uninterruptible;
+		      nr_uninterruptible, timestamp_last_tick;
 	task_t *curr, *idle;
 	struct mm_struct *prev_mm;
 	prio_array_t *active, *expired, arrays[2];
-	int prev_cpu_load[NR_CPUS];
+	int best_expired_prio, prev_cpu_load[NR_CPUS];
 #ifdef CONFIG_NUMA
 	atomic_t *node_nr_running;
 	int prev_node_load[MAX_NUMNODES];
@@ -225,7 +226,7 @@
  * Default context-switch locking:
  */
 #ifndef prepare_arch_switch
-# define prepare_arch_switch(rq, next)	do { } while(0)
+# define prepare_arch_switch(rq, next)	do { } while (0)
 # define finish_arch_switch(rq, next)	spin_unlock_irq(&(rq)->lock)
 # define task_running(rq, p)		((rq)->curr == (p))
 #endif
@@ -269,9 +270,9 @@
 
 #else /* !CONFIG_NUMA */
 
-# define nr_running_init(rq)   do { } while (0)
-# define nr_running_inc(rq)    do { (rq)->nr_running++; } while (0)
-# define nr_running_dec(rq)    do { (rq)->nr_running--; } while (0)
+# define nr_running_init(rq)	do { } while (0)
+# define nr_running_inc(rq)	do { (rq)->nr_running++; } while (0)
+# define nr_running_dec(rq)	do { (rq)->nr_running--; } while (0)
 
 #endif /* CONFIG_NUMA */
 
@@ -396,7 +397,7 @@
 		 * other processes.
 		 */
 		if (p->mm && p->activated != -1 &&
-			sleep_time > JUST_INTERACTIVE_SLEEP(p)){
+			sleep_time > INTERACTIVE_SLEEP(p)) {
 				p->sleep_avg = JIFFIES_TO_NS(MAX_SLEEP_AVG -
 						AVG_TIMESLICE);
 				if (!HIGH_CREDIT(p))
@@ -413,37 +414,35 @@
 			 * one timeslice worth of sleep avg bonus.
 			 */
 			if (LOW_CREDIT(p) &&
-				sleep_time > JIFFIES_TO_NS(task_timeslice(p)))
-					sleep_time =
-						JIFFIES_TO_NS(task_timeslice(p));
+			    sleep_time > JIFFIES_TO_NS(task_timeslice(p)))
+				sleep_time = JIFFIES_TO_NS(task_timeslice(p));
 
 			/*
 			 * Non high_credit tasks waking from uninterruptible
 			 * sleep are limited in their sleep_avg rise as they
 			 * are likely to be cpu hogs waiting on I/O
 			 */
-			if (p->activated == -1 && !HIGH_CREDIT(p) && p->mm){
-				if (p->sleep_avg >= JUST_INTERACTIVE_SLEEP(p))
+			if (p->activated == -1 && !HIGH_CREDIT(p) && p->mm) {
+				if (p->sleep_avg >= INTERACTIVE_SLEEP(p))
 					sleep_time = 0;
 				else if (p->sleep_avg + sleep_time >=
-					JUST_INTERACTIVE_SLEEP(p)){
-						p->sleep_avg =
-							JUST_INTERACTIVE_SLEEP(p);
-						sleep_time = 0;
-					}
+						INTERACTIVE_SLEEP(p)) {
+					p->sleep_avg = INTERACTIVE_SLEEP(p);
+					sleep_time = 0;
+				}
 			}
 
 			/*
 			 * This code gives a bonus to interactive tasks.
 			 *
 			 * The boost works by updating the 'average sleep time'
-			 * value here, based on ->timestamp. The more time a task
-			 * spends sleeping, the higher the average gets - and the
-			 * higher the priority boost gets as well.
+			 * value here, based on ->timestamp. The more time a
+			 * task spends sleeping, the higher the average gets -
+			 * and the higher the priority boost gets as well.
 			 */
 			p->sleep_avg += sleep_time;
 
-			if (p->sleep_avg > NS_MAX_SLEEP_AVG){
+			if (p->sleep_avg > NS_MAX_SLEEP_AVG) {
 				p->sleep_avg = NS_MAX_SLEEP_AVG;
 				if (!HIGH_CREDIT(p))
 					p->interactive_credit++;
@@ -470,7 +469,7 @@
 	 * This checks to make sure it's not an uninterruptible task
 	 * that is now waking up.
 	 */
-	if (!p->activated){
+	if (!p->activated) {
 		/*
 		 * Tasks which were woken up by interrupts (ie. hw events)
 		 * are most likely of interactive nature. So we give them
@@ -480,13 +479,14 @@
 		 */
 		if (in_interrupt())
 			p->activated = 2;
-		else
-		/*
-		 * Normal first-time wakeups get a credit too for on-runqueue
-		 * time, but it will be weighted down:
-		 */
+		else {
+			/*
+			 * Normal first-time wakeups get a credit too for
+			 * on-runqueue time, but it will be weighted down:
+			 */
 			p->activated = 1;
 		}
+	}
 	p->timestamp = now;
 
 	__activate_task(p, rq);
@@ -540,6 +540,43 @@
 }
 
 #ifdef CONFIG_SMP
+typedef struct {
+	struct list_head list;
+	task_t *task;
+	struct completion done;
+} migration_req_t;
+
+/*
+ * The task's runqueue lock must be held, and the new mask must be valid.
+ * Returns true if you have to wait for migration thread.
+ */
+static int __set_cpus_allowed(task_t *p, cpumask_t new_mask,
+				migration_req_t *req)
+{
+	runqueue_t *rq = task_rq(p);
+
+	p->cpus_allowed = new_mask;
+	/*
+	 * Can the task run on the task's current CPU? If not then
+	 * migrate the thread off to a proper CPU.
+	 */
+	if (cpu_isset(task_cpu(p), new_mask))
+		return 0;
+
+	/*
+	 * If the task is not on a runqueue (and not running), then
+	 * it is sufficient to simply update the task's cpu field.
+	 */
+	if (!p->array && !task_running(rq, p)) {
+		set_task_cpu(p, any_online_cpu(p->cpus_allowed));
+		return 0;
+	}
+
+	init_completion(&req->done);
+	req->task = p;
+	list_add(&req->list, &rq->migration_queue);
+	return 1;
+}
 
 /*
  * wait_task_inactive - wait for a thread to unschedule.
@@ -632,13 +669,14 @@
 			 */
 			if (unlikely(sync && !task_running(rq, p) &&
 				(task_cpu(p) != smp_processor_id()) &&
-				cpu_isset(smp_processor_id(), p->cpus_allowed))) {
+					cpu_isset(smp_processor_id(),
+							p->cpus_allowed))) {
 
 				set_task_cpu(p, smp_processor_id());
 				task_rq_unlock(rq, &flags);
 				goto repeat_lock_task;
 			}
-			if (old_state == TASK_UNINTERRUPTIBLE){
+			if (old_state == TASK_UNINTERRUPTIBLE) {
 				rq->nr_uninterruptible--;
 				/*
 				 * Tasks on involuntary sleep don't earn
@@ -663,7 +701,8 @@
 }
 int wake_up_process(task_t * p)
 {
-	return try_to_wake_up(p, TASK_STOPPED | TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE, 0);
+	return try_to_wake_up(p, TASK_STOPPED |
+		       		 TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE, 0);
 }
 
 EXPORT_SYMBOL(wake_up_process);
@@ -674,6 +713,60 @@
 }
 
 /*
+ * Perform scheduler related setup for a newly forked process p.
+ * p is forked by current.
+ */
+void sched_fork(task_t *p)
+{
+	/*
+	 * We mark the process as running here, but have not actually
+	 * inserted it onto the runqueue yet. This guarantees that
+	 * nobody will actually run it, and a signal or other external
+	 * event cannot wake it up and insert it on the runqueue either.
+	 */
+	p->state = TASK_RUNNING;
+	INIT_LIST_HEAD(&p->run_list);
+	p->array = NULL;
+	spin_lock_init(&p->switch_lock);
+#ifdef CONFIG_PREEMPT
+	/*
+	 * During context-switch we hold precisely one spinlock, which
+	 * schedule_tail drops. (in the common case it's this_rq()->lock,
+	 * but it also can be p->switch_lock.) So we compensate with a count
+	 * of 1. Also, we want to start with kernel preemption disabled.
+	 */
+	p->thread_info->preempt_count = 1;
+#endif
+	/*
+	 * Share the timeslice between parent and child, thus the
+	 * total amount of pending timeslices in the system doesn't change,
+	 * resulting in more scheduling fairness.
+	 */
+	local_irq_disable();
+	p->time_slice = (current->time_slice + 1) >> 1;
+	/*
+	 * The remainder of the first timeslice might be recovered by
+	 * the parent if the child exits early enough.
+	 */
+	p->first_time_slice = 1;
+	current->time_slice >>= 1;
+	p->timestamp = sched_clock();
+	if (!current->time_slice) {
+		/*
+	 	 * This case is rare, it happens when the parent has only
+	 	 * a single jiffy left from its timeslice. Taking the
+		 * runqueue lock is not a problem.
+		 */
+		current->time_slice = 1;
+		preempt_disable();
+		scheduler_tick(0, 0);
+		local_irq_enable();
+		preempt_enable();
+	} else
+		local_irq_enable();
+}
+
+/*
  * wake_up_forked_process - wake up a freshly forked process.
  *
  * This function will do some initial scheduler statistics housekeeping
@@ -800,7 +893,8 @@
  * context_switch - switch to the new MM and the new
  * thread's register state.
  */
-static inline task_t * context_switch(runqueue_t *rq, task_t *prev, task_t *next)
+static inline
+task_t * context_switch(runqueue_t *rq, task_t *prev, task_t *next)
 {
 	struct mm_struct *mm = next->mm;
 	struct mm_struct *oldmm = prev->active_mm;
@@ -845,11 +939,9 @@
 {
 	unsigned long i, sum = 0;
 
-	for (i = 0; i < NR_CPUS; i++) {
-		if (!cpu_online(i))
-			continue;
+	for_each_cpu(i)
 		sum += cpu_rq(i)->nr_uninterruptible;
-	}
+
 	return sum;
 }
 
@@ -857,11 +949,9 @@
 {
 	unsigned long i, sum = 0;
 
-	for (i = 0; i < NR_CPUS; i++) {
-		if (!cpu_online(i))
-			continue;
+	for_each_cpu(i)
 		sum += cpu_rq(i)->nr_switches;
-	}
+
 	return sum;
 }
 
@@ -869,11 +959,9 @@
 {
 	unsigned long i, sum = 0;
 
-	for (i = 0; i < NR_CPUS; ++i) {
-		if (!cpu_online(i))
-			continue;
+	for_each_cpu(i)
 		sum += atomic_read(&cpu_rq(i)->nr_iowait);
-	}
+
 	return sum;
 }
 
@@ -920,16 +1008,34 @@
  */
 static void sched_migrate_task(task_t *p, int dest_cpu)
 {
-	cpumask_t old_mask;
+	runqueue_t *rq;
+	migration_req_t req;
+	unsigned long flags;
+	cpumask_t old_mask, new_mask = cpumask_of_cpu(dest_cpu);
 
+	rq = task_rq_lock(p, &flags);
 	old_mask = p->cpus_allowed;
-	if (!cpu_isset(dest_cpu, old_mask))
-		return;
+	if (!cpu_isset(dest_cpu, old_mask) || !cpu_online(dest_cpu))
+		goto out;
+
 	/* force the process onto the specified CPU */
-	set_cpus_allowed(p, cpumask_of_cpu(dest_cpu));
+	if (__set_cpus_allowed(p, new_mask, &req)) {
+		/* Need to wait for migration thread. */
+		task_rq_unlock(rq, &flags);
+		wake_up_process(rq->migration_thread);
+		wait_for_completion(&req.done);
 
-	/* restore the cpus allowed mask */
-	set_cpus_allowed(p, old_mask);
+		/* If we raced with sys_sched_setaffinity, don't
+		 * restore mask. */
+		rq = task_rq_lock(p, &flags);
+		if (likely(cpus_equal(p->cpus_allowed, new_mask))) {
+			/* Restore old mask: won't need migration
+			 * thread, since current cpu is allowed. */
+			BUG_ON(__set_cpus_allowed(p, old_mask, NULL));
+		}
+	}
+out:
+	task_rq_unlock(rq, &flags);
 }
 
 /*
@@ -948,10 +1054,10 @@
 	minload = 10000000;
 	for_each_node_with_cpus(i) {
 		/*
-		 * Node load is always divided by nr_cpus_node to normalise 
+		 * Node load is always divided by nr_cpus_node to normalise
 		 * load values in case cpu count differs from node to node.
 		 * We first multiply node_nr_running by 10 to get a little
-		 * better resolution.   
+		 * better resolution.
 		 */
 		load = 10 * atomic_read(&node_nr_running[i]) / nr_cpus_node(i);
 		if (load < minload) {
@@ -990,7 +1096,7 @@
  *      load_{t} = load_{t-1}/2 + nr_node_running_{t}
  * This way sudden load peaks are flattened out a bit.
  * Node load is divided by nr_cpus_node() in order to compare nodes
- * of different cpu count but also [first] multiplied by 10 to 
+ * of different cpu count but also [first] multiplied by 10 to
  * provide better resolution.
  */
 static int find_busiest_node(int this_node)
@@ -1028,8 +1134,10 @@
  * this_rq is locked already. Recalculate nr_running if we have to
  * drop the runqueue lock.
  */
-static inline unsigned int double_lock_balance(runqueue_t *this_rq,
-	runqueue_t *busiest, int this_cpu, int idle, unsigned int nr_running)
+static inline
+unsigned int double_lock_balance(runqueue_t *this_rq, runqueue_t *busiest,
+				 int this_cpu, int idle,
+				 unsigned int nr_running)
 {
 	if (unlikely(!spin_trylock(&busiest->lock))) {
 		if (busiest < this_rq) {
@@ -1037,7 +1145,8 @@
 			spin_lock(&busiest->lock);
 			spin_lock(&this_rq->lock);
 			/* Need to recalculate nr_running */
-			if (idle || (this_rq->nr_running > this_rq->prev_cpu_load[this_cpu]))
+			if (idle || (this_rq->nr_running >
+					this_rq->prev_cpu_load[this_cpu]))
 				nr_running = this_rq->nr_running;
 			else
 				nr_running = this_rq->prev_cpu_load[this_cpu];
@@ -1050,7 +1159,9 @@
 /*
  * find_busiest_queue - find the busiest runqueue among the cpus in cpumask.
  */
-static inline runqueue_t *find_busiest_queue(runqueue_t *this_rq, int this_cpu, int idle, int *imbalance, cpumask_t cpumask)
+static inline
+runqueue_t *find_busiest_queue(runqueue_t *this_rq, int this_cpu, int idle,
+			       int *imbalance, cpumask_t cpumask)
 {
 	int nr_running, load, max_load, i;
 	runqueue_t *busiest, *rq_src;
@@ -1113,7 +1224,8 @@
 		goto out;
 	}
 
-	nr_running = double_lock_balance(this_rq, busiest, this_cpu, idle, nr_running);
+	nr_running = double_lock_balance(this_rq, busiest, this_cpu,
+					 idle, nr_running);
 	/*
 	 * Make sure nothing changed since we checked the
 	 * runqueue length.
@@ -1130,13 +1242,17 @@
  * pull_task - move a task from a remote runqueue to the local runqueue.
  * Both runqueues must be locked.
  */
-static inline void pull_task(runqueue_t *src_rq, prio_array_t *src_array, task_t *p, runqueue_t *this_rq, int this_cpu)
+static inline
+void pull_task(runqueue_t *src_rq, prio_array_t *src_array, task_t *p,
+	       runqueue_t *this_rq, int this_cpu)
 {
 	dequeue_task(p, src_array);
 	nr_running_dec(src_rq);
 	set_task_cpu(p, this_cpu);
 	nr_running_inc(this_rq);
 	enqueue_task(p, this_rq->active);
+	p->timestamp = sched_clock() -
+				(src_rq->timestamp_last_tick - p->timestamp);
 	/*
 	 * Note that idle threads have a prio of MAX_PRIO, for this test
 	 * to be always true for them.
@@ -1146,25 +1262,25 @@
 }
 
 /*
- * Previously:
- *
- * #define CAN_MIGRATE_TASK(p,rq,this_cpu)	\
- *	((!idle || (NS_TO_JIFFIES(now - (p)->timestamp) > \
- *		cache_decay_ticks)) && !task_running(rq, p) && \
- *			cpu_isset(this_cpu, (p)->cpus_allowed))
+ * can_migrate_task - may task p from runqueue rq be migrated to this_cpu?
  */
-
-static inline int
-can_migrate_task(task_t *tsk, runqueue_t *rq, int this_cpu, int idle)
+static inline
+int can_migrate_task(task_t *tsk, runqueue_t *rq, int this_cpu, int idle)
 {
-	unsigned long delta = sched_clock() - tsk->timestamp;
+	unsigned long delta = rq->timestamp_last_tick - tsk->timestamp;
 
-	if (!idle && (delta <= JIFFIES_TO_NS(cache_decay_ticks)))
-		return 0;
+	/*
+	 * We do not migrate tasks that are:
+	 * 1) running (obviously), or
+	 * 2) cannot be migrated to this CPU due to cpus_allowed, or
+	 * 3) are cache-hot on their current CPU.
+	 */
 	if (task_running(rq, tsk))
 		return 0;
 	if (!cpu_isset(this_cpu, tsk->cpus_allowed))
 		return 0;
+	if (!idle && (delta <= JIFFIES_TO_NS(cache_decay_ticks)))
+		return 0;
 	return 1;
 }
 
@@ -1184,7 +1300,8 @@
 	struct list_head *head, *curr;
 	task_t *tmp;
 
-	busiest = find_busiest_queue(this_rq, this_cpu, idle, &imbalance, cpumask);
+	busiest = find_busiest_queue(this_rq, this_cpu, idle,
+				     &imbalance, cpumask);
 	if (!busiest)
 		goto out;
 
@@ -1226,13 +1343,6 @@
 skip_queue:
 	tmp = list_entry(curr, task_t, run_list);
 
-	/*
-	 * We do not migrate tasks that are:
-	 * 1) running (obviously), or
-	 * 2) cannot be migrated to this CPU due to cpus_allowed, or
-	 * 3) are cache-hot on their current CPU.
-	 */
-
 	curr = curr->prev;
 
 	if (!can_migrate_task(tmp, busiest, this_cpu, idle)) {
@@ -1242,6 +1352,8 @@
 		goto skip_bitmap;
 	}
 	pull_task(busiest, array, tmp, this_rq, this_cpu);
+
+	/* Only migrate one task if we are idle */
 	if (!idle && --imbalance) {
 		if (curr != head)
 			goto skip_queue;
@@ -1331,7 +1443,7 @@
 }
 #endif
 
-DEFINE_PER_CPU(struct kernel_stat, kstat) = { { 0 } };
+DEFINE_PER_CPU(struct kernel_stat, kstat);
 
 EXPORT_PER_CPU_SYMBOL(kstat);
 
@@ -1342,12 +1454,14 @@
  * interactivity of a task if the first expired task had to wait more
  * than a 'reasonable' amount of time. This deadline timeout is
  * load-dependent, as the frequency of array switched decreases with
- * increasing number of running tasks:
+ * increasing number of running tasks. We also ignore the interactivity
+ * if a better static_prio task has expired:
  */
 #define EXPIRED_STARVING(rq) \
-		(STARVATION_LIMIT && ((rq)->expired_timestamp && \
+	((STARVATION_LIMIT && ((rq)->expired_timestamp && \
 		(jiffies - (rq)->expired_timestamp >= \
-			STARVATION_LIMIT * ((rq)->nr_running) + 1)))
+			STARVATION_LIMIT * ((rq)->nr_running) + 1))) || \
+			((rq)->curr->static_prio > (rq)->best_expired_prio))
 
 /*
  * This function gets called by the timer code, with HZ frequency.
@@ -1363,6 +1477,8 @@
 	runqueue_t *rq = this_rq();
 	task_t *p = current;
 
+	rq->timestamp_last_tick = sched_clock();
+
 	if (rcu_pending(cpu))
 		rcu_check_callbacks(cpu, user_ticks);
 
@@ -1429,6 +1545,8 @@
 			rq->expired_timestamp = jiffies;
 		if (!TASK_INTERACTIVE(p) || EXPIRED_STARVING(rq)) {
 			enqueue_task(p, rq->expired);
+			if (p->static_prio < rq->best_expired_prio)
+				rq->best_expired_prio = p->static_prio;
 		} else
 			enqueue_task(p, rq->active);
 	} else {
@@ -1549,6 +1667,7 @@
 		rq->expired = array;
 		array = rq->active;
 		rq->expired_timestamp = 0;
+		rq->best_expired_prio = MAX_PRIO;
 	}
 
 	idx = sched_find_first_bit(array->bitmap);
@@ -1573,7 +1692,7 @@
 	RCU_qsctr(task_cpu(prev))++;
 
 	prev->sleep_avg -= run_time;
-	if ((long)prev->sleep_avg <= 0){
+	if ((long)prev->sleep_avg <= 0) {
 		prev->sleep_avg = 0;
 		if (!(HIGH_CREDIT(prev) || LOW_CREDIT(prev)))
 			prev->interactive_credit--;
@@ -1650,7 +1769,8 @@
  * started to run but is not in state TASK_RUNNING.  try_to_wake_up() returns
  * zero in this (rare) case, and we handle it by continuing to scan the queue.
  */
-static void __wake_up_common(wait_queue_head_t *q, unsigned int mode, int nr_exclusive, int sync)
+static void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
+			     int nr_exclusive, int sync)
 {
 	struct list_head *tmp, *next;
 
@@ -1727,7 +1847,8 @@
 
 	spin_lock_irqsave(&x->wait.lock, flags);
 	x->done++;
-	__wake_up_common(&x->wait, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 1, 0);
+	__wake_up_common(&x->wait, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE,
+			 1, 0);
 	spin_unlock_irqrestore(&x->wait.lock, flags);
 }
 
@@ -1739,7 +1860,8 @@
 
 	spin_lock_irqsave(&x->wait.lock, flags);
 	x->done += UINT_MAX/2;
-	__wake_up_common(&x->wait, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 0, 0);
+	__wake_up_common(&x->wait, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE,
+			 0, 0);
 	spin_unlock_irqrestore(&x->wait.lock, flags);
 }
 
@@ -1766,9 +1888,9 @@
 
 EXPORT_SYMBOL(wait_for_completion);
 
-#define	SLEEP_ON_VAR				\
-	unsigned long flags;			\
-	wait_queue_t wait;			\
+#define	SLEEP_ON_VAR					\
+	unsigned long flags;				\
+	wait_queue_t wait;				\
 	init_waitqueue_entry(&wait, current);
 
 #define SLEEP_ON_HEAD					\
@@ -1776,9 +1898,9 @@
 	__add_wait_queue(q, &wait);			\
 	spin_unlock(&q->lock);
 
-#define	SLEEP_ON_TAIL						\
-	spin_lock_irq(&q->lock);				\
-	__remove_wait_queue(q, &wait);				\
+#define	SLEEP_ON_TAIL					\
+	spin_lock_irq(&q->lock);			\
+	__remove_wait_queue(q, &wait);			\
 	spin_unlock_irqrestore(&q->lock, flags);
 
 void interruptible_sleep_on(wait_queue_head_t *q)
@@ -1903,9 +2025,9 @@
 	long nice;
 
 	/*
-	 *	Setpriority might change our priority at the same moment.
-	 *	We don't have to worry. Conceptually one call occurs first
-	 *	and we have a single winner.
+	 * Setpriority might change our priority at the same moment.
+	 * We don't have to worry. Conceptually one call occurs first
+	 * and we have a single winner.
 	 */
 	if (increment < 0) {
 		if (!capable(CAP_SYS_NICE))
@@ -2062,7 +2184,7 @@
 		 * our priority decreased, or if we are not currently running on
 		 * this runqueue and our priority is higher than the current's
 		 */
-		if (rq->curr == p) {
+		if (task_running(rq, p)) {
 			if (p->prio > oldprio)
 				resched_task(rq->curr);
 		} else if (p->prio < rq->curr->prio)
@@ -2085,7 +2207,7 @@
  * @param: structure containing the new RT priority.
  */
 asmlinkage long sys_sched_setscheduler(pid_t pid, int policy,
-				      struct sched_param __user *param)
+				       struct sched_param __user *param)
 {
 	return setscheduler(pid, policy, param);
 }
@@ -2392,7 +2514,8 @@
  * this syscall writes the default timeslice value of a given process
  * into the user-space timespec buffer. A value of '0' means infinity.
  */
-asmlinkage long sys_sched_rr_get_interval(pid_t pid, struct timespec __user *interval)
+asmlinkage
+long sys_sched_rr_get_interval(pid_t pid, struct timespec __user *interval)
 {
 	int retval = -EINVAL;
 	struct timespec t;
@@ -2560,12 +2683,6 @@
  * 7) we wake up and the migration is done.
  */
 
-typedef struct {
-	struct list_head list;
-	task_t *task;
-	struct completion done;
-} migration_req_t;
-
 /*
  * Change a given task's CPU affinity. Migrate the thread to a
  * proper CPU and schedule it away if the CPU it's executing on
@@ -2578,40 +2695,26 @@
 int set_cpus_allowed(task_t *p, cpumask_t new_mask)
 {
 	unsigned long flags;
+	int ret = 0;
 	migration_req_t req;
 	runqueue_t *rq;
 
-	if (any_online_cpu(new_mask) == NR_CPUS)
-		return -EINVAL;
-
 	rq = task_rq_lock(p, &flags);
-	p->cpus_allowed = new_mask;
-	/*
-	 * Can the task run on the task's current CPU? If not then
-	 * migrate the thread off to a proper CPU.
-	 */
-	if (cpu_isset(task_cpu(p), new_mask)) {
-		task_rq_unlock(rq, &flags);
-		return 0;
+	if (any_online_cpu(new_mask) == NR_CPUS) {
+		ret = -EINVAL;
+		goto out;
 	}
-	/*
-	 * If the task is not on a runqueue (and not running), then
-	 * it is sufficient to simply update the task's cpu field.
-	 */
-	if (!p->array && !task_running(rq, p)) {
-		set_task_cpu(p, any_online_cpu(p->cpus_allowed));
+
+	if (__set_cpus_allowed(p, new_mask, &req)) {
+		/* Need help from migration thread: drop lock and wait. */
 		task_rq_unlock(rq, &flags);
+		wake_up_process(rq->migration_thread);
+		wait_for_completion(&req.done);
 		return 0;
 	}
-	init_completion(&req.done);
-	req.task = p;
-	list_add(&req.list, &rq->migration_queue);
+out:
 	task_rq_unlock(rq, &flags);
-
-	wake_up_process(rq->migration_thread);
-
-	wait_for_completion(&req.done);
-	return 0;
+	return ret;
 }
 
 EXPORT_SYMBOL_GPL(set_cpus_allowed);
@@ -2636,7 +2739,9 @@
 		if (p->prio < rq_dest->curr->prio)
 			resched_task(rq_dest->curr);
 	}
- out:
+	p->timestamp = rq_dest->timestamp_last_tick;
+
+out:
 	double_rq_unlock(this_rq(), rq_dest);
 	local_irq_restore(flags);
 }
@@ -2705,11 +2810,10 @@
  * migration_call - callback that gets triggered when a CPU is added.
  * Here we can start up the necessary migration thread for the new CPU.
  */
-static int migration_call(struct notifier_block *nfb,
-			  unsigned long action,
+static int migration_call(struct notifier_block *nfb, unsigned long action,
 			  void *hcpu)
 {
-	long cpu = (long) hcpu;
+	long cpu = (long)hcpu;
 	migration_startup_t startup;
 
 	switch (action) {
@@ -2738,7 +2842,8 @@
 	return NOTIFY_OK;
 }
 
-static struct notifier_block migration_notifier = { &migration_call, NULL, 0 };
+static struct notifier_block migration_notifier
+			= { .notifier_call = &migration_call };
 
 __init int migration_init(void)
 {
@@ -2751,7 +2856,6 @@
 
 #endif
 
-#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT)
 /*
  * The 'big kernel lock'
  *
@@ -2761,11 +2865,11 @@
  * been migrated to a proper locking design yet.
  *
  * Don't use in new code.
+ *
+ * Note: spinlock debugging needs this even on !CONFIG_SMP.
  */
 spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
-
 EXPORT_SYMBOL(kernel_flag);
-#endif
 
 static void kstat_init_cpu(int cpu)
 {
@@ -2774,7 +2878,7 @@
 }
 
 static int __devinit kstat_cpu_notify(struct notifier_block *self,
-					unsigned long action, void *hcpu)
+				      unsigned long action, void *hcpu)
 {
 	int cpu = (unsigned long)hcpu;
 	switch(action) {
@@ -2788,13 +2892,14 @@
 }
 
 static struct notifier_block __devinitdata kstat_nb = {
-	.notifier_call  = kstat_cpu_notify,
-	.next           = NULL,
+	.notifier_call	= kstat_cpu_notify,
+	.next		= NULL,
 };
 
-__init static void init_kstat(void) {
+__init static void init_kstat(void)
+{
 	kstat_cpu_notify(&kstat_nb, (unsigned long)CPU_UP_PREPARE,
-			(void *)(long)smp_processor_id());
+			 (void *)(long)smp_processor_id());
 	register_cpu_notifier(&kstat_nb);
 }
 
@@ -2811,6 +2916,8 @@
 		rq = cpu_rq(i);
 		rq->active = rq->arrays;
 		rq->expired = rq->arrays + 1;
+		rq->best_expired_prio = MAX_PRIO;
+
 		spin_lock_init(&rq->lock);
 		INIT_LIST_HEAD(&rq->migration_queue);
 		atomic_set(&rq->nr_iowait, 0);
@@ -2858,7 +2965,7 @@
 		printk(KERN_ERR "Debug: sleeping function called from invalid"
 				" context at %s:%d\n", file, line);
 		printk("in_atomic():%d, irqs_disabled():%d\n",
-				in_atomic(), irqs_disabled());
+			in_atomic(), irqs_disabled());
 		dump_stack();
 	}
 #endif
diff -Nru a/kernel/sys.c b/kernel/sys.c
--- a/kernel/sys.c	Tue Feb  3 19:45:16 2004
+++ b/kernel/sys.c	Tue Feb  3 19:45:16 2004
@@ -249,8 +249,11 @@
 cond_syscall(sys_epoll_create)
 cond_syscall(sys_epoll_ctl)
 cond_syscall(sys_epoll_wait)
+
+/* arch-specific weak syscall entries */
 cond_syscall(sys_pciconfig_read)
 cond_syscall(sys_pciconfig_write)
+cond_syscall(sys_pciconfig_iobase)
 
 static int set_one_prio(struct task_struct *p, int niceval, int error)
 {
diff -Nru a/kernel/sysctl.c b/kernel/sysctl.c
--- a/kernel/sysctl.c	Tue Feb  3 19:45:16 2004
+++ b/kernel/sysctl.c	Tue Feb  3 19:45:16 2004
@@ -37,6 +37,7 @@
 #include <linux/hugetlb.h>
 #include <linux/security.h>
 #include <linux/initrd.h>
+#include <linux/times.h>
 #include <asm/uaccess.h>
 
 #ifdef CONFIG_ROOT_NFS
@@ -60,6 +61,8 @@
 extern int pid_max;
 extern int sysctl_lower_zone_protection;
 extern int min_free_kbytes;
+extern int printk_ratelimit_jiffies;
+extern int printk_ratelimit_burst;
 
 /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
 static int maxolduid = 65535;
@@ -579,6 +582,24 @@
 		.mode		= 0644,
 		.proc_handler	= &proc_dointvec,
 	},
+	{
+		.ctl_name	= KERN_PRINTK_RATELIMIT,
+		.procname	= "printk_ratelimit",
+		.data		= &printk_ratelimit_jiffies,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec_jiffies,
+		.strategy	= &sysctl_jiffies,
+	},
+	{
+		.ctl_name	= KERN_PRINTK_RATELIMIT_BURST,
+		.procname	= "printk_ratelimit_burst",
+		.data		= &printk_ratelimit_burst,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+		.strategy	= &sysctl_jiffies,
+	},
 	{ .ctl_name = 0 }
 };
 
@@ -1050,8 +1071,8 @@
  * cover common cases -
  *
  * proc_dostring(), proc_dointvec(), proc_dointvec_jiffies(),
- * proc_dointvec_minmax(), proc_doulongvec_ms_jiffies_minmax(),
- * proc_doulongvec_minmax()
+ * proc_dointvec_userhz_jiffies(), proc_dointvec_minmax(), 
+ * proc_doulongvec_ms_jiffies_minmax(), proc_doulongvec_minmax()
  *
  * It is the handler's job to read the input buffer from user memory
  * and process it. The handler should return 0 on success.
@@ -1322,19 +1343,36 @@
 	return r;
 }
 
-#define OP_SET	0
-#define OP_AND	1
-#define OP_OR	2
-#define OP_MAX	3
-#define OP_MIN	4
+static int do_proc_dointvec_conv(int *negp, unsigned long *lvalp,
+				 int *valp,
+				 int write, void *data)
+{
+	if (write) {
+		*valp = *negp ? -*lvalp : *lvalp;
+	} else {
+		int val = *valp;
+		if (val < 0) {
+			*negp = -1;
+			*lvalp = (unsigned long)-val;
+		} else {
+			*negp = 0;
+			*lvalp = (unsigned long)val;
+		}
+	}
+	return 0;
+}
 
 static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
-		  void __user *buffer, size_t *lenp, int conv, int op)
+		  void __user *buffer, size_t *lenp, 
+		  int (*conv)(int *negp, unsigned long *lvalp, int *valp,
+			      int write, void *data),
+		  void *data)
 {
+#define TMPBUFLEN 20
 	int *i, vleft, first=1, neg, val;
+	unsigned long lval;
 	size_t left, len;
 	
-	#define TMPBUFLEN 20
 	char buf[TMPBUFLEN], *p;
 	
 	if (!table->data || !table->maxlen || !*lenp ||
@@ -1344,9 +1382,12 @@
 	}
 	
 	i = (int *) table->data;
-	vleft = table->maxlen / sizeof(int);
+	vleft = table->maxlen / sizeof(*i);
 	left = *lenp;
-	
+
+	if (!conv)
+		conv = do_proc_dointvec_conv;
+
 	for (; left && vleft--; i++, first=0) {
 		if (write) {
 			while (left) {
@@ -1362,8 +1403,8 @@
 				break;
 			neg = 0;
 			len = left;
-			if (len > TMPBUFLEN-1)
-				len = TMPBUFLEN-1;
+			if (len > sizeof(buf) - 1)
+				len = sizeof(buf) - 1;
 			if(copy_from_user(buf, buffer, len))
 				return -EFAULT;
 			buf[len] = 0;
@@ -1374,7 +1415,9 @@
 			}
 			if (*p < '0' || *p > '9')
 				break;
-			val = simple_strtoul(p, &p, 0) * conv;
+
+			lval = simple_strtoul(p, &p, 0);
+
 			len = p-buf;
 			if ((len < left) && *p && !isspace(*p))
 				break;
@@ -1382,22 +1425,18 @@
 				val = -val;
 			buffer += len;
 			left -= len;
-			switch(op) {
-			case OP_SET:	*i = val; break;
-			case OP_AND:	*i &= val; break;
-			case OP_OR:	*i |= val; break;
-			case OP_MAX:	if(*i < val)
-						*i = val;
-					break;
-			case OP_MIN:	if(*i > val)
-						*i = val;
-					break;
-			}
+
+			if (conv(&neg, &lval, i, 1, data))
+				break;
 		} else {
 			p = buf;
 			if (!first)
 				*p++ = '\t';
-			sprintf(p, "%d", (*i) / conv);
+	
+			if (conv(&neg, &lval, i, 0, data))
+				break;
+
+			sprintf(p, "%s%lu", neg ? "-" : "", lval);
 			len = strlen(buf);
 			if (len > left)
 				len = left;
@@ -1429,6 +1468,7 @@
 	*lenp -= left;
 	filp->f_pos += *lenp;
 	return 0;
+#undef TMPBUFLEN
 }
 
 /**
@@ -1447,7 +1487,45 @@
 int proc_dointvec(ctl_table *table, int write, struct file *filp,
 		     void __user *buffer, size_t *lenp)
 {
-    return do_proc_dointvec(table,write,filp,buffer,lenp,1,OP_SET);
+    return do_proc_dointvec(table,write,filp,buffer,lenp,
+		    	    NULL,NULL);
+}
+
+#define OP_SET	0
+#define OP_AND	1
+#define OP_OR	2
+#define OP_MAX	3
+#define OP_MIN	4
+
+static int do_proc_dointvec_bset_conv(int *negp, unsigned long *lvalp,
+				      int *valp,
+				      int write, void *data)
+{
+	int op = *(int *)data;
+	if (write) {
+		int val = *negp ? -*lvalp : *lvalp;
+		switch(op) {
+		case OP_SET:	*valp = val; break;
+		case OP_AND:	*valp &= val; break;
+		case OP_OR:	*valp |= val; break;
+		case OP_MAX:	if(*valp < val)
+					*valp = val;
+				break;
+		case OP_MIN:	if(*valp > val)
+				*valp = val;
+				break;
+		}
+	} else {
+		int val = *valp;
+		if (val < 0) {
+			*negp = -1;
+			*lvalp = (unsigned long)-val;
+		} else {
+			*negp = 0;
+			*lvalp = (unsigned long)val;
+		}
+	}
+	return 0;
 }
 
 /*
@@ -1457,11 +1535,44 @@
 int proc_dointvec_bset(ctl_table *table, int write, struct file *filp,
 			void __user *buffer, size_t *lenp)
 {
+	int op;
+
 	if (!capable(CAP_SYS_MODULE)) {
 		return -EPERM;
 	}
-	return do_proc_dointvec(table,write,filp,buffer,lenp,1,
-				(current->pid == 1) ? OP_SET : OP_AND);
+
+	op = (current->pid == 1) ? OP_SET : OP_AND;
+	return do_proc_dointvec(table,write,filp,buffer,lenp,
+				do_proc_dointvec_bset_conv,&op);
+}
+
+struct do_proc_dointvec_minmax_conv_param {
+	int *min;
+	int *max;
+};
+
+static int do_proc_dointvec_minmax_conv(int *negp, unsigned long *lvalp, 
+					int *valp, 
+					int write, void *data)
+{
+	struct do_proc_dointvec_minmax_conv_param *param = data;
+	if (write) {
+		int val = *negp ? -*lvalp : *lvalp;
+		if ((param->min && *param->min > val) ||
+		    (param->max && *param->max < val))
+			return -EINVAL;
+		*valp = val;
+	} else {
+		int val = *valp;
+		if (val < 0) {
+			*negp = -1;
+			*lvalp = (unsigned long)-val;
+		} else {
+			*negp = 0;
+			*lvalp = (unsigned long)val;
+		}
+	}
+	return 0;
 }
 
 /**
@@ -1483,98 +1594,12 @@
 int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp,
 		  void __user *buffer, size_t *lenp)
 {
-	int *i, *min, *max, vleft, first=1, neg, val;
-	size_t len, left;
-	#define TMPBUFLEN 20
-	char buf[TMPBUFLEN], *p;
-	
-	if (!table->data || !table->maxlen || !*lenp ||
-	    (filp->f_pos && !write)) {
-		*lenp = 0;
-		return 0;
-	}
-	
-	i = (int *) table->data;
-	min = (int *) table->extra1;
-	max = (int *) table->extra2;
-	vleft = table->maxlen / sizeof(int);
-	left = *lenp;
-	
-	for (; left && vleft--; i++, min++, max++, first=0) {
-		if (write) {
-			while (left) {
-				char c;
-				if(get_user(c, (char *) buffer))
-					return -EFAULT;
-				if (!isspace(c))
-					break;
-				left--;
-				buffer++;
-			}
-			if (!left)
-				break;
-			neg = 0;
-			len = left;
-			if (len > TMPBUFLEN-1)
-				len = TMPBUFLEN-1;
-			if(copy_from_user(buf, buffer, len))
-				return -EFAULT;
-			buf[len] = 0;
-			p = buf;
-			if (*p == '-' && left > 1) {
-				neg = 1;
-				left--, p++;
-			}
-			if (*p < '0' || *p > '9')
-				break;
-			val = simple_strtoul(p, &p, 0);
-			len = p-buf;
-			if ((len < left) && *p && !isspace(*p))
-				break;
-			if (neg)
-				val = -val;
-			buffer += len;
-			left -= len;
-
-			if ((min && val < *min) || (max && val > *max))
-				continue;
-			*i = val;
-		} else {
-			p = buf;
-			if (!first)
-				*p++ = '\t';
-			sprintf(p, "%d", *i);
-			len = strlen(buf);
-			if (len > left)
-				len = left;
-			if(copy_to_user(buffer, buf, len))
-				return -EFAULT;
-			left -= len;
-			buffer += len;
-		}
-	}
-
-	if (!write && !first && left) {
-		if(put_user('\n', (char *) buffer))
-			return -EFAULT;
-		left--, buffer++;
-	}
-	if (write) {
-		p = (char *) buffer;
-		while (left) {
-			char c;
-			if(get_user(c, p++))
-				return -EFAULT;
-			if (!isspace(c))
-				break;
-			left--;
-		}
-	}
-	if (write && first)
-		return -EINVAL;
-	*lenp -= left;
-	filp->f_pos += *lenp;
-	return 0;
+	struct do_proc_dointvec_minmax_conv_param param = {
+		.min = (int *) table->extra1,
+		.max = (int *) table->extra2,
+	};
+	return do_proc_dointvec(table, write, filp, buffer, lenp,
+				do_proc_dointvec_minmax_conv, &param);
 }
 
 static int do_proc_doulongvec_minmax(ctl_table *table, int write,
@@ -1729,6 +1754,48 @@
 }
 
 
+static int do_proc_dointvec_jiffies_conv(int *negp, unsigned long *lvalp,
+					 int *valp,
+					 int write, void *data)
+{
+	if (write) {
+		*valp = *negp ? -(*lvalp*HZ) : (*lvalp*HZ);
+	} else {
+		int val = *valp;
+		unsigned long lval;
+		if (val < 0) {
+			*negp = -1;
+			lval = (unsigned long)-val;
+		} else {
+			*negp = 0;
+			lval = (unsigned long)val;
+		}
+		*lvalp = lval / HZ;
+	}
+	return 0;
+}
+
+static int do_proc_dointvec_userhz_jiffies_conv(int *negp, unsigned long *lvalp,
+						int *valp,
+						int write, void *data)
+{
+	if (write) {
+		*valp = clock_t_to_jiffies(*negp ? -*lvalp : *lvalp);
+	} else {
+		int val = *valp;
+		unsigned long lval;
+		if (val < 0) {
+			*negp = -1;
+			lval = (unsigned long)-val;
+		} else {
+			*negp = 0;
+			lval = (unsigned long)val;
+		}
+		*lvalp = jiffies_to_clock_t(lval);
+	}
+	return 0;
+}
+
 /**
  * proc_dointvec_jiffies - read a vector of integers as seconds
  * @table: the sysctl table
@@ -1747,7 +1814,30 @@
 int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp,
 			  void __user *buffer, size_t *lenp)
 {
-    return do_proc_dointvec(table,write,filp,buffer,lenp,HZ,OP_SET);
+    return do_proc_dointvec(table,write,filp,buffer,lenp,
+		    	    do_proc_dointvec_jiffies_conv,NULL);
+}
+
+/**
+ * proc_dointvec_userhz_jiffies - read a vector of integers as 1/USER_HZ seconds
+ * @table: the sysctl table
+ * @write: %TRUE if this is a write to the sysctl file
+ * @filp: the file structure
+ * @buffer: the user buffer
+ * @lenp: the size of the user buffer
+ *
+ * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
+ * values from/to the user buffer, treated as an ASCII string. 
+ * The values read are assumed to be in 1/USER_HZ seconds, and 
+ * are converted into jiffies.
+ *
+ * Returns 0 on success.
+ */
+int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp,
+				 void __user *buffer, size_t *lenp)
+{
+    return do_proc_dointvec(table,write,filp,buffer,lenp,
+		    	    do_proc_dointvec_userhz_jiffies_conv,NULL);
 }
 
 #else /* CONFIG_PROC_FS */
@@ -1788,6 +1878,12 @@
 	return -ENOSYS;
 }
 
+int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp,
+		    void *buffer, size_t *lenp)
+{
+	return -ENOSYS;
+}
+
 int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp,
 		    void *buffer, size_t *lenp)
 {
@@ -1975,6 +2071,12 @@
 	return -ENOSYS;
 }
 
+int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp,
+			  void *buffer, size_t *lenp)
+{
+	return -ENOSYS;
+}
+
 int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp,
 		    void __user *buffer, size_t *lenp)
 {
@@ -2007,6 +2109,7 @@
 EXPORT_SYMBOL(proc_dointvec);
 EXPORT_SYMBOL(proc_dointvec_jiffies);
 EXPORT_SYMBOL(proc_dointvec_minmax);
+EXPORT_SYMBOL(proc_dointvec_userhz_jiffies);
 EXPORT_SYMBOL(proc_dostring);
 EXPORT_SYMBOL(proc_doulongvec_minmax);
 EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax);
diff -Nru a/kernel/timer.c b/kernel/timer.c
--- a/kernel/timer.c	Tue Feb  3 19:45:41 2004
+++ b/kernel/timer.c	Tue Feb  3 19:45:41 2004
@@ -332,10 +332,7 @@
 del_again:
 	ret += del_timer(timer);
 
-	for (i = 0; i < NR_CPUS; i++) {
-		if (!cpu_online(i))
-			continue;
-
+	for_each_cpu(i) {
 		base = &per_cpu(tvec_bases, i);
 		if (base->running_timer == timer) {
 			while (base->running_timer == timer) {
diff -Nru a/kernel/workqueue.c b/kernel/workqueue.c
--- a/kernel/workqueue.c	Tue Feb  3 19:45:43 2004
+++ b/kernel/workqueue.c	Tue Feb  3 19:45:43 2004
@@ -14,13 +14,10 @@
  *   Theodore Ts'o <tytso@mit.edu>
  */
 
-#define __KERNEL_SYSCALLS__
-
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/init.h>
-#include <linux/unistd.h>
 #include <linux/signal.h>
 #include <linux/completion.h>
 #include <linux/workqueue.h>
@@ -171,7 +168,6 @@
 	struct k_sigaction sa;
 
 	daemonize("%s/%d", startup->name, cpu);
-	allow_signal(SIGCHLD);
 	current->flags |= PF_IOTHREAD;
 	cwq->thread = current;
 
@@ -180,7 +176,7 @@
 
 	complete(&startup->done);
 
-	/* Install a handler so SIGCLD is delivered */
+	/* SIG_IGN makes children autoreap: see do_notify_parent(). */
 	sa.sa.sa_handler = SIG_IGN;
 	sa.sa.sa_flags = 0;
 	siginitset(&sa.sa.sa_mask, sigmask(SIGCHLD));
@@ -200,14 +196,6 @@
 
 		if (!list_empty(&cwq->worklist))
 			run_workqueue(cwq);
-
-		if (signal_pending(current)) {
-			while (waitpid(-1, NULL, __WALL|WNOHANG) > 0)
-				/* SIGCHLD - auto-reaping */ ;
-
-			/* zap all other signals */
-			flush_signals(current);
-		}
 	}
 	remove_wait_queue(&cwq->more_work, &wait);
 	complete(&cwq->exit);
@@ -366,9 +354,7 @@
 
 	BUG_ON(!keventd_wq);
 
-	for (cpu = 0; cpu < NR_CPUS; cpu++) {
-		if (!cpu_online(cpu))
-			continue;
+	for_each_cpu(cpu) {
 		cwq = keventd_wq->cpu_wq + cpu;
 		if (current == cwq->thread)
 			return 1;
diff -Nru a/lib/Makefile b/lib/Makefile
--- a/lib/Makefile	Tue Feb  3 19:45:16 2004
+++ b/lib/Makefile	Tue Feb  3 19:45:16 2004
@@ -5,7 +5,8 @@
 
 lib-y := errno.o ctype.o string.o vsprintf.o cmdline.o \
 	 bust_spinlocks.o rbtree.o radix-tree.o dump_stack.o \
-	 kobject.o idr.o div64.o parser.o int_sqrt.o mask.o
+	 kobject.o idr.o div64.o parser.o int_sqrt.o mask.o \
+	 bitmap.o extable.o
 
 lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
 lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
diff -Nru a/lib/bitmap.c b/lib/bitmap.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/lib/bitmap.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,141 @@
+#include <linux/bitmap.h>
+#include <linux/module.h>
+
+int bitmap_empty(const unsigned long *bitmap, int bits)
+{
+	int k, lim = bits/BITS_PER_LONG;
+	for (k = 0; k < lim; ++k)
+		if (bitmap[k])
+			return 0;
+
+	if (bits % BITS_PER_LONG)
+		if (bitmap[k] & ((1UL << (bits % BITS_PER_LONG)) - 1))
+			return 0;
+
+	return 1;
+}
+EXPORT_SYMBOL(bitmap_empty);
+
+int bitmap_full(const unsigned long *bitmap, int bits)
+{
+	int k, lim = bits/BITS_PER_LONG;
+	for (k = 0; k < lim; ++k)
+		if (~bitmap[k])
+			return 0;
+
+	if (bits % BITS_PER_LONG)
+		if (~bitmap[k] & ((1UL << (bits % BITS_PER_LONG)) - 1))
+			return 0;
+
+	return 1;
+}
+EXPORT_SYMBOL(bitmap_full);
+
+int bitmap_equal(const unsigned long *bitmap1,
+		unsigned long *bitmap2, int bits)
+{
+	int k, lim = bits/BITS_PER_LONG;;
+	for (k = 0; k < lim; ++k)
+		if (bitmap1[k] != bitmap2[k])
+			return 0;
+
+	if (bits % BITS_PER_LONG)
+		if ((bitmap1[k] ^ bitmap2[k]) &
+				((1UL << (bits % BITS_PER_LONG)) - 1))
+			return 0;
+
+	return 1;
+}
+EXPORT_SYMBOL(bitmap_equal);
+
+void bitmap_complement(unsigned long *bitmap, int bits)
+{
+	int k;
+	int nr = BITS_TO_LONGS(bits);
+
+	for (k = 0; k < nr; ++k)
+		bitmap[k] = ~bitmap[k];
+}
+EXPORT_SYMBOL(bitmap_complement);
+
+void bitmap_shift_right(unsigned long *dst,
+			const unsigned long *src, int shift, int bits)
+{
+	int k;
+	DECLARE_BITMAP(__shr_tmp, bits);
+
+	bitmap_clear(__shr_tmp, bits);
+	for (k = 0; k < bits - shift; ++k)
+		if (test_bit(k + shift, src))
+			set_bit(k, __shr_tmp);
+	bitmap_copy(dst, __shr_tmp, bits);
+}
+EXPORT_SYMBOL(bitmap_shift_right);
+
+void bitmap_shift_left(unsigned long *dst,
+			const unsigned long *src, int shift, int bits)
+{
+	int k;
+	DECLARE_BITMAP(__shl_tmp, bits);
+
+	bitmap_clear(__shl_tmp, bits);
+	for (k = bits; k >= shift; --k)
+		if (test_bit(k - shift, src))
+			set_bit(k, __shl_tmp);
+	bitmap_copy(dst, __shl_tmp, bits);
+}
+EXPORT_SYMBOL(bitmap_shift_left);
+
+void bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
+				const unsigned long *bitmap2, int bits)
+{
+	int k;
+	int nr = BITS_TO_LONGS(bits);
+
+	for (k = 0; k < nr; k++)
+		dst[k] = bitmap1[k] & bitmap2[k];
+}
+EXPORT_SYMBOL(bitmap_and);
+
+void bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
+				const unsigned long *bitmap2, int bits)
+{
+	int k;
+	int nr = BITS_TO_LONGS(bits);
+
+	for (k = 0; k < nr; k++)
+		dst[k] = bitmap1[k] | bitmap2[k];
+}
+EXPORT_SYMBOL(bitmap_or);
+
+#if BITS_PER_LONG == 32
+int bitmap_weight(const unsigned long *bitmap, int bits)
+{
+	int k, w = 0, lim = bits/BITS_PER_LONG;
+
+	for (k = 0; k < lim; k++)
+		w += hweight32(bitmap[k]);
+
+	if (bits % BITS_PER_LONG)
+		w += hweight32(bitmap[k] &
+				((1UL << (bits % BITS_PER_LONG)) - 1));
+
+	return w;
+}
+#else
+int bitmap_weight(const unsigned long *bitmap, int bits)
+{
+	int k, w = 0, lim = bits/BITS_PER_LONG;
+
+	for (k = 0; k < lim; k++)
+		w += hweight64(bitmap[k]);
+
+	if (bits % BITS_PER_LONG)
+		w += hweight64(bitmap[k] &
+				((1UL << (bits % BITS_PER_LONG)) - 1));
+
+	return w;
+}
+#endif
+EXPORT_SYMBOL(bitmap_weight);
+
diff -Nru a/lib/extable.c b/lib/extable.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/lib/extable.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,81 @@
+/*
+ * lib/extable.c
+ * Derived from arch/ppc/mm/extable.c and arch/i386/mm/extable.c.
+ *
+ * Copyright (C) 2004 Paul Mackerras, IBM Corp.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <asm/uaccess.h>
+
+extern struct exception_table_entry __start___ex_table[];
+extern struct exception_table_entry __stop___ex_table[];
+
+#ifndef ARCH_HAS_SORT_EXTABLE
+/*
+ * The exception table needs to be sorted so that the binary
+ * search that we use to find entries in it works properly.
+ * This is used both for the kernel exception table and for
+ * the exception tables of modules that get loaded.
+ */
+void sort_extable(struct exception_table_entry *start,
+		  struct exception_table_entry *finish)
+{
+	struct exception_table_entry el, *p, *q;
+
+	/* insertion sort */
+	for (p = start + 1; p < finish; ++p) {
+		/* start .. p-1 is sorted */
+		if (p[0].insn < p[-1].insn) {
+			/* move element p down to its right place */
+			el = *p;
+			q = p;
+			do {
+				/* el comes before q[-1], move q[-1] up one */
+				q[0] = q[-1];
+				--q;
+			} while (q > start && el.insn < q[-1].insn);
+			*q = el;
+		}
+	}
+}
+#endif
+
+#ifndef ARCH_HAS_SEARCH_EXTABLE
+/*
+ * Search one exception table for an entry corresponding to the
+ * given instruction address, and return the address of the entry,
+ * or NULL if none is found.
+ * We use a binary search, and thus we assume that the table is
+ * already sorted.
+ */
+const struct exception_table_entry *
+search_extable(const struct exception_table_entry *first,
+	       const struct exception_table_entry *last,
+	       unsigned long value)
+{
+	while (first <= last) {
+		const struct exception_table_entry *mid;
+
+		mid = (last - first) / 2 + first;
+		/*
+		 * careful, the distance between entries can be
+		 * larger than 2GB:
+		 */
+		if (mid->insn < value)
+			first = mid + 1;
+		else if (mid->insn > value)
+			last = mid - 1;
+		else
+			return mid;
+        }
+        return NULL;
+}
+#endif
diff -Nru a/lib/kobject.c b/lib/kobject.c
--- a/lib/kobject.c	Tue Feb  3 19:45:42 2004
+++ b/lib/kobject.c	Tue Feb  3 19:45:42 2004
@@ -198,9 +198,24 @@
 	kfree(envp);
 	return;
 }
+
+void kobject_hotplug(const char *action, struct kobject *kobj)
+{
+	struct kobject * top_kobj = kobj;
+
+	/* If this kobj does not belong to a kset,
+	   try to find a parent that does. */
+	if (!top_kobj->kset && top_kobj->parent) {
+		do {
+			top_kobj = top_kobj->parent;
+		} while (!top_kobj->kset && top_kobj->parent);
+	}
+
+	if (top_kobj->kset && top_kobj->kset->hotplug_ops)
+		kset_hotplug(action, top_kobj->kset, kobj);
+}
 #else
-static void kset_hotplug(const char *action, struct kset *kset,
-			 struct kobject *kobj)
+void kobject_hotplug(const char *action, struct kobject *kobj)
 {
 	return;
 }
@@ -248,7 +263,6 @@
 {
 	int error = 0;
 	struct kobject * parent;
-	struct kobject * top_kobj;
 
 	if (!(kobj = kobject_get(kobj)))
 		return -ENOENT;
@@ -277,18 +291,9 @@
 		if (parent)
 			kobject_put(parent);
 	} else {
-		/* If this kobj does not belong to a kset,
-		   try to find a parent that does. */
-		top_kobj = kobj;
-		if (!top_kobj->kset && top_kobj->parent) {
-			do {
-				top_kobj = top_kobj->parent;
-			} while (!top_kobj->kset && top_kobj->parent);
-		}
-	
-		if (top_kobj->kset && top_kobj->kset->hotplug_ops)
-			kset_hotplug("add", top_kobj->kset, kobj);
+		kobject_hotplug("add", kobj);
 	}
+
 	return error;
 }
 
@@ -396,20 +401,7 @@
 
 void kobject_del(struct kobject * kobj)
 {
-	struct kobject * top_kobj;
-
-	/* If this kobj does not belong to a kset,
-	   try to find a parent that does. */
-	top_kobj = kobj;
-	if (!top_kobj->kset && top_kobj->parent) {
-		do {
-			top_kobj = top_kobj->parent;
-		} while (!top_kobj->kset && top_kobj->parent);
-	}
-
-	if (top_kobj->kset && top_kobj->kset->hotplug_ops)
-		kset_hotplug("remove", top_kobj->kset, kobj);
-
+	kobject_hotplug("remove", kobj);
 	sysfs_remove_dir(kobj);
 	unlink(kobj);
 }
@@ -555,7 +547,7 @@
 	down_read(&kset->subsys->rwsem);
 	list_for_each(entry,&kset->list) {
 		struct kobject * k = to_kobj(entry);
-		if (!strcmp(kobject_name(k),name)) {
+		if (kobject_name(k) && (!strcmp(kobject_name(k),name))) {
 			ret = k;
 			break;
 		}
@@ -638,6 +630,7 @@
 EXPORT_SYMBOL(kobject_unregister);
 EXPORT_SYMBOL(kobject_get);
 EXPORT_SYMBOL(kobject_put);
+EXPORT_SYMBOL(kobject_hotplug);
 
 EXPORT_SYMBOL(kset_register);
 EXPORT_SYMBOL(kset_unregister);
diff -Nru a/lib/vsprintf.c b/lib/vsprintf.c
--- a/lib/vsprintf.c	Tue Feb  3 19:45:42 2004
+++ b/lib/vsprintf.c	Tue Feb  3 19:45:42 2004
@@ -254,6 +254,15 @@
 				/* 'z' support added 23/7/1999 S.H.    */
 				/* 'z' changed to 'Z' --davidm 1/25/99 */
 
+	/* Reject out-of-range values early */
+	if (unlikely((int) size < 0)) {
+		/* There can be only one.. */
+		static int warn = 1;
+		WARN_ON(warn);
+		warn = 0;
+		return 0;
+	}
+
 	str = buf;
 	end = buf + size - 1;
 
@@ -498,7 +507,7 @@
  */
 int vsprintf(char *buf, const char *fmt, va_list args)
 {
-	return vsnprintf(buf, 0xFFFFFFFFUL, fmt, args);
+	return vsnprintf(buf, (~0U)>>1, fmt, args);
 }
 
 EXPORT_SYMBOL(vsprintf);
diff -Nru a/mm/fadvise.c b/mm/fadvise.c
--- a/mm/fadvise.c	Tue Feb  3 19:45:17 2004
+++ b/mm/fadvise.c	Tue Feb  3 19:45:17 2004
@@ -23,7 +23,6 @@
 asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
 {
 	struct file *file = fget(fd);
-	struct inode *inode;
 	struct address_space *mapping;
 	struct backing_dev_info *bdi;
 	pgoff_t start_index;
@@ -33,8 +32,7 @@
 	if (!file)
 		return -EBADF;
 
-	inode = file->f_dentry->d_inode;
-	mapping = inode->i_mapping;
+	mapping = file->f_mapping;
 	if (!mapping) {
 		ret = -EINVAL;
 		goto out;
diff -Nru a/mm/filemap.c b/mm/filemap.c
--- a/mm/filemap.c	Tue Feb  3 19:45:17 2004
+++ b/mm/filemap.c	Tue Feb  3 19:45:17 2004
@@ -587,22 +587,13 @@
 			     read_actor_t actor)
 {
 	struct inode *inode = mapping->host;
-	unsigned long index, offset, last;
+	unsigned long index, offset;
 	struct page *cached_page;
 	int error;
 
 	cached_page = NULL;
 	index = *ppos >> PAGE_CACHE_SHIFT;
 	offset = *ppos & ~PAGE_CACHE_MASK;
-	last = (*ppos + desc->count) >> PAGE_CACHE_SHIFT;
-
-	/*
-	 * Let the readahead logic know upfront about all
-	 * the pages we'll need to satisfy this request
-	 */
-	for (; index < last; index++)
-		page_cache_readahead(mapping, ra, filp, index);
-	index = *ppos >> PAGE_CACHE_SHIFT;
 
 	for (;;) {
 		struct page *page;
@@ -621,6 +612,7 @@
 		}
 
 		cond_resched();
+		page_cache_readahead(mapping, ra, filp, index);
 
 		nr = nr - offset;
 find_page:
@@ -812,7 +804,7 @@
 		struct address_space *mapping;
 		struct inode *inode;
 
-		mapping = filp->f_dentry->d_inode->i_mapping;
+		mapping = filp->f_mapping;
 		inode = mapping->host;
 		retval = 0;
 		if (!count)
@@ -944,7 +936,7 @@
 	file = fget(fd);
 	if (file) {
 		if (file->f_mode & FMODE_READ) {
-			struct address_space *mapping = file->f_dentry->d_inode->i_mapping;
+			struct address_space *mapping = file->f_mapping;
 			unsigned long start = offset >> PAGE_CACHE_SHIFT;
 			unsigned long end = (offset + count - 1) >> PAGE_CACHE_SHIFT;
 			unsigned long len = end - start + 1;
@@ -963,7 +955,7 @@
 static int FASTCALL(page_cache_read(struct file * file, unsigned long offset));
 static int page_cache_read(struct file * file, unsigned long offset)
 {
-	struct address_space *mapping = file->f_dentry->d_inode->i_mapping;
+	struct address_space *mapping = file->f_mapping;
 	struct page *page; 
 	int error;
 
@@ -1002,7 +994,7 @@
 {
 	int error;
 	struct file *file = area->vm_file;
-	struct address_space *mapping = file->f_dentry->d_inode->i_mapping;
+	struct address_space *mapping = file->f_mapping;
 	struct file_ra_state *ra = &file->f_ra;
 	struct inode *inode = mapping->host;
 	struct page *page;
@@ -1187,7 +1179,7 @@
 static struct page * filemap_getpage(struct file *file, unsigned long pgoff,
 					int nonblock)
 {
-	struct address_space *mapping = file->f_dentry->d_inode->i_mapping;
+	struct address_space *mapping = file->f_mapping;
 	struct page *page;
 	int error;
 
@@ -1299,7 +1291,7 @@
 			int nonblock)
 {
 	struct file *file = vma->vm_file;
-	struct address_space *mapping = file->f_dentry->d_inode->i_mapping;
+	struct address_space *mapping = file->f_mapping;
 	struct inode *inode = mapping->host;
 	unsigned long size;
 	struct mm_struct *mm = vma->vm_mm;
@@ -1358,7 +1350,7 @@
 
 int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
 {
-	struct address_space *mapping = file->f_dentry->d_inode->i_mapping;
+	struct address_space *mapping = file->f_mapping;
 	struct inode *inode = mapping->host;
 
 	if (!mapping->a_ops->readpage)
@@ -1626,9 +1618,9 @@
  * Returns appropriate error code that caller should return or
  * zero in case that write should be allowed.
  */
-inline int generic_write_checks(struct inode *inode,
-		struct file *file, loff_t *pos, size_t *count, int isblk)
+inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk)
 {
+	struct inode *inode = file->f_mapping->host;
 	unsigned long limit = current->rlim[RLIMIT_FSIZE].rlim_cur;
 
         if (unlikely(*pos < 0))
@@ -1690,7 +1682,7 @@
 			*count = inode->i_sb->s_maxbytes - *pos;
 	} else {
 		loff_t isize;
-		if (bdev_read_only(inode->i_bdev))
+		if (bdev_read_only(I_BDEV(inode)))
 			return -EPERM;
 		isize = i_size_read(inode);
 		if (*pos >= isize) {
@@ -1720,7 +1712,7 @@
 				unsigned long nr_segs, loff_t *ppos)
 {
 	struct file *file = iocb->ki_filp;
-	struct address_space * mapping = file->f_dentry->d_inode->i_mapping;
+	struct address_space * mapping = file->f_mapping;
 	struct address_space_operations *a_ops = mapping->a_ops;
 	size_t ocount;		/* original count */
 	size_t count;		/* after file limit checks */
@@ -1767,7 +1759,7 @@
 	current->backing_dev_info = mapping->backing_dev_info;
 	written = 0;
 
-	err = generic_write_checks(inode, file, &pos, &count, isblk);
+	err = generic_write_checks(file, &pos, &count, isblk);
 	if (err)
 		goto out;
 
@@ -1798,7 +1790,7 @@
 		 * of course not the data as we did direct DMA for the IO.
 		 */
 		if (written >= 0 && file->f_flags & O_SYNC)
-			status = generic_osync_inode(inode, OSYNC_METADATA);
+			status = generic_osync_inode(inode, mapping, OSYNC_METADATA);
 		if (written >= 0 && !is_sync_kiocb(iocb))
 			written = -EIOCBQUEUED;
 		goto out_status;
@@ -1886,7 +1878,7 @@
 	 */
 	if (status >= 0) {
 		if ((file->f_flags & O_SYNC) || IS_SYNC(inode))
-			status = generic_osync_inode(inode,
+			status = generic_osync_inode(inode, mapping,
 					OSYNC_METADATA|OSYNC_DATA);
 	}
 	
@@ -1920,7 +1912,7 @@
 			       size_t count, loff_t pos)
 {
 	struct file *file = iocb->ki_filp;
-	struct inode *inode = file->f_dentry->d_inode->i_mapping->host;
+	struct inode *inode = file->f_mapping->host;
 	ssize_t err;
 	struct iovec local_iov = { .iov_base = (void __user *)buf, .iov_len = count };
 
@@ -1939,7 +1931,7 @@
 ssize_t generic_file_write(struct file *file, const char __user *buf,
 			   size_t count, loff_t *ppos)
 {
-	struct inode	*inode = file->f_dentry->d_inode->i_mapping->host;
+	struct inode	*inode = file->f_mapping->host;
 	ssize_t		err;
 	struct iovec local_iov = { .iov_base = (void __user *)buf, .iov_len = count };
 
@@ -1970,7 +1962,7 @@
 ssize_t generic_file_writev(struct file *file, const struct iovec *iov,
 			unsigned long nr_segs, loff_t * ppos) 
 {
-	struct inode *inode = file->f_dentry->d_inode;
+	struct inode *inode = file->f_mapping->host;
 	ssize_t ret;
 
 	down(&inode->i_sem);
@@ -1986,7 +1978,7 @@
 	loff_t offset, unsigned long nr_segs)
 {
 	struct file *file = iocb->ki_filp;
-	struct address_space *mapping = file->f_dentry->d_inode->i_mapping;
+	struct address_space *mapping = file->f_mapping;
 	ssize_t retval;
 
 	if (mapping->nrpages) {
diff -Nru a/mm/fremap.c b/mm/fremap.c
--- a/mm/fremap.c	Tue Feb  3 19:45:16 2004
+++ b/mm/fremap.c	Tue Feb  3 19:45:16 2004
@@ -19,18 +19,18 @@
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
 
-static inline int zap_pte(struct mm_struct *mm, struct vm_area_struct *vma,
+static inline void zap_pte(struct mm_struct *mm, struct vm_area_struct *vma,
 			unsigned long addr, pte_t *ptep)
 {
 	pte_t pte = *ptep;
 
 	if (pte_none(pte))
-		return 0;
+		return;
 	if (pte_present(pte)) {
 		unsigned long pfn = pte_pfn(pte);
 
 		flush_cache_page(vma, addr);
-		pte = ptep_get_and_clear(ptep);
+		pte = ptep_clear_flush(vma, addr, ptep);
 		if (pfn_valid(pfn)) {
 			struct page *page = pfn_to_page(pfn);
 			if (!PageReserved(page)) {
@@ -41,12 +41,10 @@
 				mm->rss--;
 			}
 		}
-		return 1;
 	} else {
 		if (!pte_file(pte))
 			free_swap_and_cache(pte_to_swp_entry(pte));
 		pte_clear(ptep);
-		return 0;
 	}
 }
 
@@ -57,7 +55,7 @@
 int install_page(struct mm_struct *mm, struct vm_area_struct *vma,
 		unsigned long addr, struct page *page, pgprot_t prot)
 {
-	int err = -ENOMEM, flush;
+	int err = -ENOMEM;
 	pte_t *pte;
 	pgd_t *pgd;
 	pmd_t *pmd;
@@ -78,7 +76,7 @@
 	if (!pte)
 		goto err_unlock;
 
-	flush = zap_pte(mm, vma, addr, pte);
+	zap_pte(mm, vma, addr, pte);
 
 	mm->rss++;
 	flush_icache_page(vma, page);
@@ -86,8 +84,6 @@
 	pte_chain = page_add_rmap(page, pte, pte_chain);
 	pte_val = *pte;
 	pte_unmap(pte);
-	if (flush)
-		flush_tlb_page(vma, addr);
 	update_mmu_cache(vma, addr, pte_val);
 	spin_unlock(&mm->page_table_lock);
 	pte_chain_free(pte_chain);
@@ -109,7 +105,7 @@
 int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma,
 		unsigned long addr, unsigned long pgoff, pgprot_t prot)
 {
-	int err = -ENOMEM, flush;
+	int err = -ENOMEM;
 	pte_t *pte;
 	pgd_t *pgd;
 	pmd_t *pmd;
@@ -126,13 +122,11 @@
 	if (!pte)
 		goto err_unlock;
 
-	flush = zap_pte(mm, vma, addr, pte);
+	zap_pte(mm, vma, addr, pte);
 
 	set_pte(pte, pgoff_to_pte(pgoff));
 	pte_val = *pte;
 	pte_unmap(pte);
-	if (flush)
-		flush_tlb_page(vma, addr);
 	update_mmu_cache(vma, addr, pte_val);
 	spin_unlock(&mm->page_table_lock);
 	return 0;
diff -Nru a/mm/madvise.c b/mm/madvise.c
--- a/mm/madvise.c	Tue Feb  3 19:45:17 2004
+++ b/mm/madvise.c	Tue Feb  3 19:45:17 2004
@@ -65,7 +65,7 @@
 		end = vma->vm_end;
 	end = ((end - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
 
-	force_page_cache_readahead(file->f_dentry->d_inode->i_mapping,
+	force_page_cache_readahead(file->f_mapping,
 			file, start, max_sane_readahead(end - start));
 	return 0;
 }
diff -Nru a/mm/memory.c b/mm/memory.c
--- a/mm/memory.c	Tue Feb  3 19:45:17 2004
+++ b/mm/memory.c	Tue Feb  3 19:45:17 2004
@@ -45,6 +45,7 @@
 #include <linux/pagemap.h>
 #include <linux/rmap-locking.h>
 #include <linux/module.h>
+#include <linux/init.h>
 
 #include <asm/pgalloc.h>
 #include <asm/rmap.h>
@@ -651,14 +652,19 @@
 	pte = *ptep;
 	pte_unmap(ptep);
 	if (pte_present(pte)) {
-		if (!write || (pte_write(pte) && pte_dirty(pte))) {
-			pfn = pte_pfn(pte);
-			if (pfn_valid(pfn)) {
-				struct page *page = pfn_to_page(pfn);
-
-				mark_page_accessed(page);
-				return page;
-			}
+		if (write && !pte_write(pte))
+			goto out;
+		if (write && !pte_dirty(pte)) {
+			struct page *page = pte_page(pte);
+			if (!PageDirty(page))
+				set_page_dirty(page);
+		}
+		pfn = pte_pfn(pte);
+		if (pfn_valid(pfn)) {
+			struct page *page = pfn_to_page(pfn);
+			
+			mark_page_accessed(page);
+			return page;
 		}
 	}
 
@@ -699,25 +705,13 @@
 		struct vm_area_struct *	vma;
 
 		vma = find_extend_vma(mm, start);
-
-#ifdef FIXADDR_USER_START
-		if (!vma &&
-		    start >= FIXADDR_USER_START && start < FIXADDR_USER_END) {
-			static struct vm_area_struct fixmap_vma = {
-				/* Catch users - if there are any valid
-				   ones, we can make this be "&init_mm" or
-				   something.  */
-				.vm_mm = NULL,
-				.vm_start = FIXADDR_USER_START,
-				.vm_end = FIXADDR_USER_END,
-				.vm_page_prot = PAGE_READONLY,
-				.vm_flags = VM_READ | VM_EXEC,
-			};
+		if (!vma && in_gate_area(tsk, start)) {
 			unsigned long pg = start & PAGE_MASK;
+			struct vm_area_struct *gate_vma = get_gate_vma(tsk);
 			pgd_t *pgd;
 			pmd_t *pmd;
 			pte_t *pte;
-			if (write) /* user fixmap pages are read-only */
+			if (write) /* user gate pages are read-only */
 				return i ? : -EFAULT;
 			pgd = pgd_offset_k(pg);
 			if (!pgd)
@@ -733,13 +727,12 @@
 				get_page(pages[i]);
 			}
 			if (vmas)
-				vmas[i] = &fixmap_vma;
+				vmas[i] = gate_vma;
 			i++;
 			start += PAGE_SIZE;
 			len--;
 			continue;
 		}
-#endif
 
 		if (!vma || (pages && (vma->vm_flags & VM_IO))
 				|| !(flags & vma->vm_flags))
@@ -863,6 +856,9 @@
 		address = (address + PGDIR_SIZE) & PGDIR_MASK;
 		dir++;
 	} while (address && (address < end));
+	/*
+	 * Why flush? zeromap_pte_range has a BUG_ON for !pte_none()
+	 */
 	flush_tlb_range(vma, beg, end);
 	spin_unlock(&mm->page_table_lock);
 	return error;
@@ -944,6 +940,9 @@
 		from = (from + PGDIR_SIZE) & PGDIR_MASK;
 		dir++;
 	} while (from && (from < end));
+	/*
+	 * Why flush? remap_pte_range has a BUG_ON for !pte_none()
+	 */
 	flush_tlb_range(vma, beg, end);
 	spin_unlock(&mm->page_table_lock);
 	return error;
@@ -952,28 +951,17 @@
 EXPORT_SYMBOL(remap_page_range);
 
 /*
- * Establish a new mapping:
- *  - flush the old one
- *  - update the page tables
- *  - inform the TLB about the new one
- *
- * We hold the mm semaphore for reading and vma->vm_mm->page_table_lock
- */
-static inline void establish_pte(struct vm_area_struct * vma, unsigned long address, pte_t *page_table, pte_t entry)
-{
-	set_pte(page_table, entry);
-	flush_tlb_page(vma, address);
-	update_mmu_cache(vma, address, entry);
-}
-
-/*
  * We hold the mm semaphore for reading and vma->vm_mm->page_table_lock
  */
 static inline void break_cow(struct vm_area_struct * vma, struct page * new_page, unsigned long address, 
 		pte_t *page_table)
 {
+	pte_t entry;
+
 	flush_cache_page(vma, address);
-	establish_pte(vma, address, page_table, pte_mkwrite(pte_mkdirty(mk_pte(new_page, vma->vm_page_prot))));
+	entry = pte_mkwrite(pte_mkdirty(mk_pte(new_page, vma->vm_page_prot)));
+	ptep_establish(vma, address, page_table, entry);
+	update_mmu_cache(vma, address, entry);
 }
 
 /*
@@ -1002,6 +990,7 @@
 	struct page *old_page, *new_page;
 	unsigned long pfn = pte_pfn(pte);
 	struct pte_chain *pte_chain;
+	pte_t entry;
 
 	if (unlikely(!pfn_valid(pfn))) {
 		/*
@@ -1022,8 +1011,9 @@
 		unlock_page(old_page);
 		if (reuse) {
 			flush_cache_page(vma, address);
-			establish_pte(vma, address, page_table,
-				pte_mkyoung(pte_mkdirty(pte_mkwrite(pte))));
+			entry = pte_mkyoung(pte_mkdirty(pte_mkwrite(pte)));
+			ptep_establish(vma, address, page_table, entry);
+			update_mmu_cache(vma, address, entry);
 			pte_unmap(page_table);
 			spin_unlock(&mm->page_table_lock);
 			return VM_FAULT_MINOR;
@@ -1409,7 +1399,7 @@
 	spin_unlock(&mm->page_table_lock);
 
 	if (vma->vm_file) {
-		mapping = vma->vm_file->f_dentry->d_inode->i_mapping;
+		mapping = vma->vm_file->f_mapping;
 		sequence = atomic_read(&mapping->truncate_count);
 	}
 	smp_rmb();  /* Prevent CPU from reordering lock-free ->nopage() */
@@ -1431,10 +1421,8 @@
 	 */
 	if (write_access && !(vma->vm_flags & VM_SHARED)) {
 		struct page * page = alloc_page(GFP_HIGHUSER);
-		if (!page) {
-			page_cache_release(new_page);
+		if (!page)
 			goto oom;
-		}
 		copy_user_highpage(page, new_page, address);
 		page_cache_release(new_page);
 		lru_cache_add_active(page);
@@ -1491,6 +1479,7 @@
 	spin_unlock(&mm->page_table_lock);
 	goto out;
 oom:
+	page_cache_release(new_page);
 	ret = VM_FAULT_OOM;
 out:
 	pte_chain_free(pte_chain);
@@ -1580,7 +1569,8 @@
 		entry = pte_mkdirty(entry);
 	}
 	entry = pte_mkyoung(entry);
-	establish_pte(vma, address, pte, entry);
+	ptep_establish(vma, address, pte, entry);
+	update_mmu_cache(vma, address, entry);
 	pte_unmap(pte);
 	spin_unlock(&mm->page_table_lock);
 	return VM_FAULT_MINOR;
@@ -1697,3 +1687,18 @@
 }
 
 EXPORT_SYMBOL(vmalloc_to_page);
+
+#if !defined(CONFIG_ARCH_GATE_AREA) && defined(AT_SYSINFO_EHDR)
+struct vm_area_struct gate_vma;
+
+static int __init gate_vma_init(void)
+{
+	gate_vma.vm_mm = NULL;
+	gate_vma.vm_start = FIXADDR_USER_START;
+	gate_vma.vm_end = FIXADDR_USER_END;
+	gate_vma.vm_page_prot = PAGE_READONLY;
+	gate_vma.vm_flags = 0;
+	return 0;
+}
+__initcall(gate_vma_init);
+#endif
diff -Nru a/mm/mincore.c b/mm/mincore.c
--- a/mm/mincore.c	Tue Feb  3 19:45:42 2004
+++ b/mm/mincore.c	Tue Feb  3 19:45:42 2004
@@ -26,7 +26,7 @@
 	unsigned long pgoff)
 {
 	unsigned char present = 0;
-	struct address_space * as = vma->vm_file->f_dentry->d_inode->i_mapping;
+	struct address_space * as = vma->vm_file->f_mapping;
 	struct page * page;
 
 	page = find_get_page(as, pgoff);
diff -Nru a/mm/mmap.c b/mm/mmap.c
--- a/mm/mmap.c	Tue Feb  3 19:45:30 2004
+++ b/mm/mmap.c	Tue Feb  3 19:45:30 2004
@@ -80,11 +80,10 @@
 	struct file *file = vma->vm_file;
 
 	if (file) {
-		struct inode *inode = file->f_dentry->d_inode;
-
-		down(&inode->i_mapping->i_shared_sem);
-		__remove_shared_vm_struct(vma, inode);
-		up(&inode->i_mapping->i_shared_sem);
+		struct address_space *mapping = file->f_mapping;
+		down(&mapping->i_shared_sem);
+		__remove_shared_vm_struct(vma, file->f_dentry->d_inode);
+		up(&mapping->i_shared_sem);
 	}
 }
 
@@ -235,11 +234,10 @@
 
 	file = vma->vm_file;
 	if (file) {
-		struct inode * inode = file->f_dentry->d_inode;
-		struct address_space *mapping = inode->i_mapping;
+		struct address_space *mapping = file->f_mapping;
 
 		if (vma->vm_flags & VM_DENYWRITE)
-			atomic_dec(&inode->i_writecount);
+			atomic_dec(&file->f_dentry->d_inode->i_writecount);
 
 		if (vma->vm_flags & VM_SHARED)
 			list_add_tail(&vma->shared, &mapping->i_mmap_shared);
@@ -265,7 +263,7 @@
 	struct address_space *mapping = NULL;
 
 	if (vma->vm_file)
-		mapping = vma->vm_file->f_dentry->d_inode->i_mapping;
+		mapping = vma->vm_file->f_mapping;
 
 	if (mapping)
 		down(&mapping->i_shared_sem);
@@ -383,7 +381,7 @@
 	if (vm_flags & VM_SPECIAL)
 		return 0;
 
-	i_shared_sem = file ? &inode->i_mapping->i_shared_sem : NULL;
+	i_shared_sem = file ? &file->f_mapping->i_shared_sem : NULL;
 
 	if (!prev) {
 		prev = rb_entry(rb_parent, struct vm_area_struct, vm_rb);
@@ -1207,7 +1205,7 @@
 		new->vm_ops->open(new);
 
 	if (vma->vm_file)
-		 mapping = vma->vm_file->f_dentry->d_inode->i_mapping;
+		 mapping = vma->vm_file->f_mapping;
 
 	if (mapping)
 		down(&mapping->i_shared_sem);
diff -Nru a/mm/mremap.c b/mm/mremap.c
--- a/mm/mremap.c	Tue Feb  3 19:45:28 2004
+++ b/mm/mremap.c	Tue Feb  3 19:45:28 2004
@@ -80,8 +80,8 @@
 }
 
 static int
-copy_one_pte(struct mm_struct *mm, pte_t *src, pte_t *dst,
-		struct pte_chain **pte_chainp)
+copy_one_pte(struct vm_area_struct *vma, unsigned long old_addr,
+	     pte_t *src, pte_t *dst, struct pte_chain **pte_chainp)
 {
 	int error = 0;
 	pte_t pte;
@@ -93,7 +93,7 @@
 	if (!pte_none(*src)) {
 		if (page)
 			page_remove_rmap(page, src);
-		pte = ptep_get_and_clear(src);
+		pte = ptep_clear_flush(vma, old_addr, src);
 		if (!dst) {
 			/* No dest?  We must put it back. */
 			dst = src;
@@ -135,11 +135,15 @@
 		dst = alloc_one_pte_map(mm, new_addr);
 		if (src == NULL)
 			src = get_one_pte_map_nested(mm, old_addr);
-		error = copy_one_pte(mm, src, dst, &pte_chain);
+		error = copy_one_pte(vma, old_addr, src, dst, &pte_chain);
 		pte_unmap_nested(src);
 		pte_unmap(dst);
-	}
-	flush_tlb_page(vma, old_addr);
+	} else
+		/*
+		 * Why do we need this flush ? If there is no pte for
+		 * old_addr, then there must not be a pte for it as well.
+		 */
+		flush_tlb_page(vma, old_addr);
 	spin_unlock(&mm->page_table_lock);
 	pte_chain_free(pte_chain);
 out:
@@ -315,8 +319,12 @@
 	old_len = PAGE_ALIGN(old_len);
 	new_len = PAGE_ALIGN(new_len);
 
-	/* Don't allow the degenerate cases */
-	if (!old_len || !new_len)
+	/*
+	 * We allow a zero old-len as a special case
+	 * for DOS-emu "duplicate shm area" thing. But
+	 * a zero new-len is nonsensical.
+	 */
+	if (!new_len)
 		goto out;
 
 	/* new_addr is only valid if MREMAP_FIXED is specified */
diff -Nru a/mm/msync.c b/mm/msync.c
--- a/mm/msync.c	Tue Feb  3 19:45:17 2004
+++ b/mm/msync.c	Tue Feb  3 19:45:17 2004
@@ -24,17 +24,15 @@
 	unsigned long address, unsigned int flags)
 {
 	pte_t pte = *ptep;
+	unsigned long pfn = pte_pfn(pte);
+	struct page *page;
 
-	if (pte_present(pte) && pte_dirty(pte)) {
-		struct page *page;
-		unsigned long pfn = pte_pfn(pte);
-		if (pfn_valid(pfn)) {
-			page = pfn_to_page(pfn);
-			if (!PageReserved(page) && ptep_test_and_clear_dirty(ptep)) {
-				flush_tlb_page(vma, address);
-				set_page_dirty(page);
-			}
-		}
+	if (pte_present(pte) && pfn_valid(pfn)) {
+		page = pfn_to_page(pfn);
+		if (!PageReserved(page) &&
+		    (ptep_clear_flush_dirty(vma, address, ptep) ||
+		     page_test_and_clear_dirty(page)))
+			set_page_dirty(page);
 	}
 	return 0;
 }
@@ -115,6 +113,10 @@
 		address = (address + PGDIR_SIZE) & PGDIR_MASK;
 		dir++;
 	} while (address && (address < end));
+	/*
+	 * Why flush ? filemap_sync_pte already flushed the tlbs with the
+	 * dirty bits.
+	 */
 	flush_tlb_range(vma, end - size, end);
 
 	spin_unlock(&vma->vm_mm->page_table_lock);
@@ -146,20 +148,20 @@
 		ret = filemap_sync(vma, start, end-start, flags);
 
 		if (!ret && (flags & MS_SYNC)) {
-			struct inode *inode = file->f_dentry->d_inode;
+			struct address_space *mapping = file->f_mapping;
 			int err;
 
-			down(&inode->i_sem);
-			ret = filemap_fdatawrite(inode->i_mapping);
+			down(&mapping->host->i_sem);
+			ret = filemap_fdatawrite(mapping);
 			if (file->f_op && file->f_op->fsync) {
 				err = file->f_op->fsync(file,file->f_dentry,1);
 				if (err && !ret)
 					ret = err;
 			}
-			err = filemap_fdatawait(inode->i_mapping);
+			err = filemap_fdatawait(mapping);
 			if (!ret)
 				ret = err;
-			up(&inode->i_sem);
+			up(&mapping->host->i_sem);
 		}
 	}
 	return ret;
diff -Nru a/mm/nommu.c b/mm/nommu.c
--- a/mm/nommu.c	Tue Feb  3 19:45:41 2004
+++ b/mm/nommu.c	Tue Feb  3 19:45:41 2004
@@ -25,12 +25,12 @@
 #include <asm/tlbflush.h>
 
 void *high_memory;
-struct page *mem_map = NULL;
+struct page *mem_map;
 unsigned long max_mapnr;
 unsigned long num_physpages;
 unsigned long askedalloc, realalloc;
 atomic_t vm_committed_space = ATOMIC_INIT(0);
-int sysctl_overcommit_memory = 0; /* default is heuristic overcommit */
+int sysctl_overcommit_memory; /* default is heuristic overcommit */
 int sysctl_overcommit_ratio = 50; /* default is 50% */
 
 /*
@@ -547,6 +547,11 @@
 }
 
 struct page * follow_page(struct mm_struct *mm, unsigned long addr, int write)
+{
+	return NULL;
+}
+
+struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr)
 {
 	return NULL;
 }
diff -Nru a/mm/page-writeback.c b/mm/page-writeback.c
--- a/mm/page-writeback.c	Tue Feb  3 19:45:34 2004
+++ b/mm/page-writeback.c	Tue Feb  3 19:45:34 2004
@@ -233,6 +233,7 @@
 	}
 	put_cpu_var(ratelimits);
 }
+EXPORT_SYMBOL(balance_dirty_pages_ratelimited);
 
 /*
  * writeback at least _min_pages, and keep writing until the amount of dirty
diff -Nru a/mm/page_alloc.c b/mm/page_alloc.c
--- a/mm/page_alloc.c	Tue Feb  3 19:45:16 2004
+++ b/mm/page_alloc.c	Tue Feb  3 19:45:16 2004
@@ -50,7 +50,7 @@
  * Used by page_zone() to look up the address of the struct zone whose
  * id is encoded in the upper bits of page->flags
  */
-struct zone *zone_table[MAX_NR_ZONES*MAX_NUMNODES];
+struct zone *zone_table[1 << (ZONES_SHIFT + NODES_SHIFT)];
 EXPORT_SYMBOL(zone_table);
 
 static char *zone_names[MAX_NR_ZONES] = { "DMA", "Normal", "HighMem" };
@@ -539,7 +539,7 @@
 {
 	const int wait = gfp_mask & __GFP_WAIT;
 	unsigned long min;
-	struct zone **zones, *classzone;
+	struct zone **zones;
 	struct page *page;
 	struct reclaim_state reclaim_state;
 	struct task_struct *p = current;
@@ -554,8 +554,7 @@
 		cold = 1;
 
 	zones = zonelist->zones;  /* the list of zones suitable for gfp_mask */
-	classzone = zones[0]; 
-	if (classzone == NULL)    /* no zones in the zonelist */
+	if (zones[0] == NULL)     /* no zones in the zonelist */
 		return NULL;
 
 	/* Go through the zonelist once, looking for a zone with enough free */
@@ -630,7 +629,7 @@
 	reclaim_state.reclaimed_slab = 0;
 	p->reclaim_state = &reclaim_state;
 
-	try_to_free_pages(classzone, gfp_mask, order);
+	try_to_free_pages(zones, gfp_mask, order);
 
 	p->reclaim_state = NULL;
 	p->flags &= ~PF_MEMALLOC;
@@ -670,10 +669,11 @@
 	}
 
 nopage:
-	if (!(gfp_mask & __GFP_NOWARN)) {
-		printk("%s: page allocation failure."
+	if (!(gfp_mask & __GFP_NOWARN) && printk_ratelimit()) {
+		printk(KERN_WARNING "%s: page allocation failure."
 			" order:%d, mode:0x%x\n",
 			p->comm, order, gfp_mask);
+		dump_stack();
 	}
 	return NULL;
 got_pg:
@@ -869,14 +869,14 @@
 	while (cpu < NR_CPUS) {
 		unsigned long *in, *out, off;
 
-		if (!cpu_online(cpu)) {
+		if (!cpu_possible(cpu)) {
 			cpu++;
 			continue;
 		}
 
 		in = (unsigned long *)&per_cpu(page_states, cpu);
 		cpu++;
-		if (cpu < NR_CPUS && cpu_online(cpu))
+		if (cpu < NR_CPUS && cpu_possible(cpu))
 			prefetch(&per_cpu(page_states, cpu));
 		out = (unsigned long *)ret;
 		for (off = 0; off < nr; off++)
@@ -1212,7 +1212,7 @@
 	struct page *page;
 
 	for (page = start; page < (start + size); page++) {
-		set_page_zone(page, nid * MAX_NR_ZONES + zone);
+		set_page_zone(page, NODEZONE(nid, zone));
 		set_page_count(page, 0);
 		SetPageReserved(page);
 		INIT_LIST_HEAD(&page->list);
@@ -1253,7 +1253,7 @@
 		unsigned long size, realsize;
 		unsigned long batch;
 
-		zone_table[nid * MAX_NR_ZONES + j] = zone;
+		zone_table[NODEZONE(nid, j)] = zone;
 		realsize = size = zones_size[j];
 		if (zholes_size)
 			realsize -= zholes_size[j];
@@ -1265,6 +1265,8 @@
 		spin_lock_init(&zone->lru_lock);
 		zone->zone_pgdat = pgdat;
 		zone->free_pages = 0;
+
+		zone->temp_priority = zone->prev_priority = DEF_PRIORITY;
 
 		/*
 		 * The per-cpu-pages pools are set to around 1000th of the
diff -Nru a/mm/readahead.c b/mm/readahead.c
--- a/mm/readahead.c	Tue Feb  3 19:45:16 2004
+++ b/mm/readahead.c	Tue Feb  3 19:45:16 2004
@@ -449,12 +449,8 @@
 			  * accessed in the current window, there
 			  * is a high probability that around 'n' pages
 			  * shall be used in the next current window.
-			  *
-			  * To minimize lazy-readahead triggered
-			  * in the next current window, read in
-			  * an extra page.
 			  */
-			ra->next_size = preoffset - ra->start + 2;
+			ra->next_size = preoffset - ra->start + 1;
 		}
 		ra->start = offset;
 		ra->size = ra->next_size;
@@ -474,13 +470,9 @@
 		/*
 		 * This read request is within the current window.  It is time
 		 * to submit I/O for the ahead window while the application is
-		 * about to step into the ahead window.
-		 * Heuristic: Defer reading the ahead window till we hit
-		 * the last page in the current window. (lazy readahead)
-		 * If we read in earlier we run the risk of wasting
-		 * the ahead window.
+		 * crunching through the current window.
 		 */
-		if (ra->ahead_start == 0 && offset == (ra->start + ra->size -1)) {
+		if (ra->ahead_start == 0) {
 			ra->ahead_start = ra->start + ra->size;
 			ra->ahead_size = ra->next_size;
 			actual = do_page_cache_readahead(mapping, filp,
diff -Nru a/mm/rmap.c b/mm/rmap.c
--- a/mm/rmap.c	Tue Feb  3 19:45:42 2004
+++ b/mm/rmap.c	Tue Feb  3 19:45:42 2004
@@ -117,6 +117,9 @@
 	struct pte_chain *pc;
 	int referenced = 0;
 
+	if (page_test_and_clear_young(page))
+		mark_page_accessed(page);
+
 	if (TestClearPageReferenced(page))
 		referenced++;
 
@@ -132,12 +135,10 @@
 		for (pc = page->pte.chain; pc; pc = pte_chain_next(pc)) {
 			int i;
 
-			for (i = NRPTE-1; i >= 0; i--) {
+			for (i = pte_chain_idx(pc); i < NRPTE; i++) {
 				pte_addr_t pte_paddr = pc->ptes[i];
 				pte_t *p;
 
-				if (!pte_paddr)
-					break;
 				p = rmap_ptep_map(pte_paddr);
 				if (ptep_test_and_clear_young(p))
 					referenced++;
@@ -242,7 +243,7 @@
 	} else {
 		struct pte_chain *start = page->pte.chain;
 		struct pte_chain *next;
-		int victim_i = -1;
+		int victim_i = pte_chain_idx(start);
 
 		for (pc = start; pc; pc = next) {
 			int i;
@@ -253,8 +254,6 @@
 			for (i = pte_chain_idx(pc); i < NRPTE; i++) {
 				pte_addr_t pa = pc->ptes[i];
 
-				if (victim_i == -1)
-					victim_i = i;
 				if (pa != pte_paddr)
 					continue;
 				pc->ptes[i] = start->ptes[victim_i];
@@ -271,6 +270,8 @@
 		}
 	}
 out:
+	if (page->pte.direct == 0 && page_test_and_clear_dirty(page))
+		set_page_dirty(page);
 	if (!page_mapped(page))
 		dec_page_state(nr_mapped);
 out_unlock:
@@ -329,8 +330,7 @@
 
 	/* Nuke the page table entry. */
 	flush_cache_page(vma, address);
-	pte = ptep_get_and_clear(ptep);
-	flush_tlb_page(vma, address);
+	pte = ptep_clear_flush(vma, address, ptep);
 
 	if (PageSwapCache(page)) {
 		/*
@@ -386,7 +386,7 @@
 {
 	struct pte_chain *pc, *next_pc, *start;
 	int ret = SWAP_SUCCESS;
-	int victim_i = -1;
+	int victim_i;
 
 	/* This page should not be on the pageout lists. */
 	if (PageReserved(page))
@@ -400,6 +400,8 @@
 	if (PageDirect(page)) {
 		ret = try_to_unmap_one(page, page->pte.direct);
 		if (ret == SWAP_SUCCESS) {
+			if (page_test_and_clear_dirty(page))
+				set_page_dirty(page);
 			page->pte.direct = 0;
 			ClearPageDirect(page);
 		}
@@ -407,6 +409,7 @@
 	}		
 
 	start = page->pte.chain;
+	victim_i = pte_chain_idx(start);
 	for (pc = start; pc; pc = next_pc) {
 		int i;
 
@@ -416,11 +419,6 @@
 		for (i = pte_chain_idx(pc); i < NRPTE; i++) {
 			pte_addr_t pte_paddr = pc->ptes[i];
 
-			if (!pte_paddr)
-				continue;
-			if (victim_i == -1) 
-				victim_i = i;
-
 			switch (try_to_unmap_one(page, pte_paddr)) {
 			case SWAP_SUCCESS:
 				/*
@@ -440,6 +438,9 @@
 				} else {
 					start->next_and_idx++;
 				}
+				if (page->pte.direct == 0 &&
+				    page_test_and_clear_dirty(page))
+					set_page_dirty(page);
 				break;
 			case SWAP_AGAIN:
 				/* Skip this pte, remembering status. */
diff -Nru a/mm/shmem.c b/mm/shmem.c
--- a/mm/shmem.c	Tue Feb  3 19:45:17 2004
+++ b/mm/shmem.c	Tue Feb  3 19:45:17 2004
@@ -1186,7 +1186,7 @@
 	pos = *ppos;
 	written = 0;
 
-	err = generic_write_checks(inode, file, &pos, &count, 0);
+	err = generic_write_checks(file, &pos, &count, 0);
 	if (err || !count)
 		goto out;
 
@@ -1978,6 +1978,7 @@
 	inode->i_nlink = 0;	/* It is unlinked */
 	file->f_vfsmnt = mntget(shm_mnt);
 	file->f_dentry = dentry;
+	file->f_mapping = inode->i_mapping;
 	file->f_op = &shmem_file_operations;
 	file->f_mode = FMODE_WRITE | FMODE_READ;
 	return(file);
diff -Nru a/mm/swapfile.c b/mm/swapfile.c
--- a/mm/swapfile.c	Tue Feb  3 19:45:17 2004
+++ b/mm/swapfile.c	Tue Feb  3 19:45:17 2004
@@ -912,7 +912,7 @@
 	sector_t last_block;
 	int ret;
 
-	inode = sis->swap_file->f_dentry->d_inode;
+	inode = sis->swap_file->f_mapping->host;
 	if (S_ISBLK(inode->i_mode)) {
 		ret = add_swap_extent(sis, 0, sis->max, 0);
 		goto done;
@@ -1031,13 +1031,13 @@
 	if (IS_ERR(victim))
 		goto out;
 
-	mapping = victim->f_dentry->d_inode->i_mapping;
+	mapping = victim->f_mapping;
 	prev = -1;
 	swap_list_lock();
 	for (type = swap_list.head; type >= 0; type = swap_info[type].next) {
 		p = swap_info + type;
 		if ((p->flags & SWP_ACTIVE) == SWP_ACTIVE) {
-			if (p->swap_file->f_dentry->d_inode->i_mapping==mapping)
+			if (p->swap_file->f_mapping == mapping)
 				break;
 		}
 		prev = type;
@@ -1099,13 +1099,12 @@
 	swap_device_unlock(p);
 	swap_list_unlock();
 	vfree(swap_map);
-	if (S_ISBLK(swap_file->f_dentry->d_inode->i_mode)) {
-		struct block_device *bdev;
-		bdev = swap_file->f_dentry->d_inode->i_bdev;
+	if (S_ISBLK(mapping->host->i_mode)) {
+		struct block_device *bdev = I_BDEV(mapping->host);
 		set_blocksize(bdev, p->old_block_size);
 		bd_release(bdev);
 	} else {
-		up(&swap_file->f_dentry->d_inode->i_mapping->host->i_sem);
+		up(&mapping->host->i_sem);
 	}
 	filp_close(swap_file, NULL);
 	err = 0;
@@ -1231,8 +1230,8 @@
 	int swapfilesize;
 	unsigned short *swap_map;
 	struct page *page = NULL;
-	struct inode *inode;
-	struct inode *downed_inode = NULL;
+	struct inode *inode = NULL;
+	int did_down = 0;
 
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
@@ -1279,8 +1278,8 @@
 	}
 
 	p->swap_file = swap_file;
-	inode = swap_file->f_dentry->d_inode;
-	mapping = swap_file->f_dentry->d_inode->i_mapping;
+	mapping = swap_file->f_mapping;
+	inode = mapping->host;
 
 	error = -EBUSY;
 	for (i = 0; i < nr_swapfiles; i++) {
@@ -1288,32 +1287,32 @@
 
 		if (i == type || !q->swap_file)
 			continue;
-		if (mapping == q->swap_file->f_dentry->d_inode->i_mapping)
+		if (mapping == q->swap_file->f_mapping)
 			goto bad_swap;
 	}
 
 	error = -EINVAL;
 	if (S_ISBLK(inode->i_mode)) {
-		bdev = inode->i_bdev;
+		bdev = I_BDEV(inode);
 		error = bd_claim(bdev, sys_swapon);
 		if (error < 0) {
 			bdev = NULL;
 			goto bad_swap;
 		}
 		p->old_block_size = block_size(bdev);
-		error = set_blocksize(inode->i_bdev, PAGE_SIZE);
+		error = set_blocksize(bdev, PAGE_SIZE);
 		if (error < 0)
 			goto bad_swap;
 		p->bdev = bdev;
 	} else if (S_ISREG(inode->i_mode)) {
 		p->bdev = inode->i_sb->s_bdev;
-		downed_inode = mapping->host;
-		down(&downed_inode->i_sem);
+		down(&inode->i_sem);
+		did_down = 1;
 	} else {
 		goto bad_swap;
 	}
 
-	swapfilesize = i_size_read(mapping->host) >> PAGE_SHIFT;
+	swapfilesize = i_size_read(inode) >> PAGE_SHIFT;
 
 	/*
 	 * Read the swap header.
@@ -1465,8 +1464,8 @@
 	}
 	if (name)
 		putname(name);
-	if (error && downed_inode)
-		up(&downed_inode->i_sem);
+	if (error && did_down)
+		up(&inode->i_sem);
 	return error;
 }
 
diff -Nru a/mm/vmscan.c b/mm/vmscan.c
--- a/mm/vmscan.c	Tue Feb  3 19:45:17 2004
+++ b/mm/vmscan.c	Tue Feb  3 19:45:17 2004
@@ -38,13 +38,6 @@
 #include <linux/swapops.h>
 
 /*
- * The "priority" of VM scanning is how much of the queues we will scan in one
- * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the
- * queues ("queue_length >> 12") during an aging round.
- */
-#define DEF_PRIORITY 12
-
-/*
  * From 0 .. 100.  Higher means more swappy.
  */
 int vm_swappiness = 60;
@@ -803,16 +796,15 @@
  * scan then give up on it.
  */
 static int
-shrink_caches(struct zone *classzone, int priority, int *total_scanned,
+shrink_caches(struct zone **zones, int priority, int *total_scanned,
 		int gfp_mask, int nr_pages, struct page_state *ps)
 {
-	struct zone *first_classzone;
-	struct zone *zone;
 	int ret = 0;
+	int i;
 
-	first_classzone = classzone->zone_pgdat->node_zones;
-	for (zone = classzone; zone >= first_classzone; zone--) {
+	for (i = 0; zones[i] != NULL; i++) {
 		int to_reclaim = max(nr_pages, SWAP_CLUSTER_MAX);
+		struct zone *zone = zones[i];
 		int nr_mapped = 0;
 		int max_scan;
 
@@ -855,27 +847,27 @@
  * excessive rotation of the inactive list, which is _supposed_ to be an LRU,
  * yes?
  */
-int try_to_free_pages(struct zone *cz,
+int try_to_free_pages(struct zone **zones,
 		unsigned int gfp_mask, unsigned int order)
 {
 	int priority;
 	int ret = 0;
 	const int nr_pages = SWAP_CLUSTER_MAX;
 	int nr_reclaimed = 0;
-	struct zone *zone;
 	struct reclaim_state *reclaim_state = current->reclaim_state;
+	int i;
 
 	inc_page_state(allocstall);
 
-	for (zone = cz; zone >= cz->zone_pgdat->node_zones; --zone)
-		zone->temp_priority = DEF_PRIORITY;
+	for (i = 0; zones[i] != 0; i++)
+		zones[i]->temp_priority = DEF_PRIORITY;
 
 	for (priority = DEF_PRIORITY; priority >= 0; priority--) {
 		int total_scanned = 0;
 		struct page_state ps;
 
 		get_page_state(&ps);
-		nr_reclaimed += shrink_caches(cz, priority, &total_scanned,
+		nr_reclaimed += shrink_caches(zones, priority, &total_scanned,
 						gfp_mask, nr_pages, &ps);
 		if (nr_reclaimed >= nr_pages) {
 			ret = 1;
@@ -892,7 +884,7 @@
 
 		/* Take a nap, wait for some writeback to complete */
 		blk_congestion_wait(WRITE, HZ/10);
-		if (cz - cz->zone_pgdat->node_zones < ZONE_HIGHMEM) {
+		if (zones[0] - zones[0]->zone_pgdat->node_zones < ZONE_HIGHMEM) {
 			shrink_slab(total_scanned, gfp_mask);
 			if (reclaim_state) {
 				nr_reclaimed += reclaim_state->reclaimed_slab;
@@ -903,8 +895,8 @@
 	if ((gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY))
 		out_of_memory();
 out:
-	for (zone = cz; zone >= cz->zone_pgdat->node_zones; --zone)
-		zone->prev_priority = zone->temp_priority;
+	for (i = 0; zones[i] != 0; i++)
+		zones[i]->prev_priority = zones[i]->temp_priority;
 	return ret;
 }
 
diff -Nru a/net/appletalk/ddp.c b/net/appletalk/ddp.c
--- a/net/appletalk/ddp.c	Tue Feb  3 19:45:43 2004
+++ b/net/appletalk/ddp.c	Tue Feb  3 19:45:43 2004
@@ -1552,7 +1552,7 @@
 }
 
 static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
-			 int len)
+			 size_t len)
 {
 	struct sock *sk = sock->sk;
 	struct atalk_sock *at = at_sk(sk);
@@ -1712,7 +1712,7 @@
 }
 
 static int atalk_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
-			 int size, int flags)
+			 size_t size, int flags)
 {
 	struct sock *sk = sock->sk;
 	struct sockaddr_at *sat = (struct sockaddr_at *)msg->msg_name;
diff -Nru a/net/atm/br2684.c b/net/atm/br2684.c
--- a/net/atm/br2684.c	Tue Feb  3 19:45:17 2004
+++ b/net/atm/br2684.c	Tue Feb  3 19:45:17 2004
@@ -437,6 +437,10 @@
 			dev_kfree_skb(skb);
 			return;
 		}
+
+		/* Strip FCS if present */
+		if (skb->len > 7 && skb->data[7] == 0x01)
+			__skb_trim(skb, skb->len - 4);
 	} else {
 		plen = PADLEN + ETH_HLEN;	/* pad, dstmac,srcmac, ethtype */
 		/* first 2 chars should be 0 */
diff -Nru a/net/atm/clip.c b/net/atm/clip.c
--- a/net/atm/clip.c	Tue Feb  3 19:45:42 2004
+++ b/net/atm/clip.c	Tue Feb  3 19:45:42 2004
@@ -731,8 +731,6 @@
 
 static int atm_init_atmarp(struct atm_vcc *vcc)
 {
-	struct net_device *dev;
-
 	if (atmarpd) return -EADDRINUSE;
 	if (start_timer) {
 		start_timer = 0;
@@ -754,9 +752,6 @@
 		printk(KERN_ERR "register_netdevice_notifier failed\n");
 	if (register_inetaddr_notifier(&clip_inet_notifier))
 		printk(KERN_ERR "register_inetaddr_notifier failed\n");
-	for (dev = clip_devs; dev; dev = PRIV(dev)->next)
-		if (dev->flags & IFF_UP)
-			(void) to_atmarpd(act_up,PRIV(dev)->number,0);
 	return 0;
 }
 
diff -Nru a/net/atm/common.c b/net/atm/common.c
--- a/net/atm/common.c	Tue Feb  3 19:45:43 2004
+++ b/net/atm/common.c	Tue Feb  3 19:45:43 2004
@@ -463,7 +463,7 @@
 
 
 int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
-		int size, int flags)
+		size_t size, int flags)
 {
 	struct sock *sk = sock->sk;
 	struct atm_vcc *vcc;
@@ -476,9 +476,8 @@
 		return -EOPNOTSUPP;
 	vcc = ATM_SD(sock);
 	if (test_bit(ATM_VF_RELEASED,&vcc->flags) ||
-	    test_bit(ATM_VF_CLOSE,&vcc->flags))
-		return -sk->sk_err;
-	if (!test_bit(ATM_VF_READY, &vcc->flags))
+	    test_bit(ATM_VF_CLOSE,&vcc->flags) ||
+	    !test_bit(ATM_VF_READY, &vcc->flags))
 		return 0;
 
 	skb = skb_recv_datagram(sk, flags, flags & MSG_DONTWAIT, &error);
@@ -503,7 +502,7 @@
 
 
 int vcc_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m,
-		int total_len)
+		size_t total_len)
 {
 	struct sock *sk = sock->sk;
 	DEFINE_WAIT(wait);
@@ -530,12 +529,10 @@
 	size = m->msg_iov->iov_len;
 	vcc = ATM_SD(sock);
 	if (test_bit(ATM_VF_RELEASED, &vcc->flags) ||
-	    test_bit(ATM_VF_CLOSE, &vcc->flags)) {
-		error = -sk->sk_err;
-		goto out;
-	}
-	if (!test_bit(ATM_VF_READY, &vcc->flags)) {
+	    test_bit(ATM_VF_CLOSE, &vcc->flags) ||
+	    !test_bit(ATM_VF_READY, &vcc->flags)) {
 		error = -EPIPE;
+		send_sig(SIGPIPE, current, 0);
 		goto out;
 	}
 	if (!size) {
@@ -561,12 +558,10 @@
 			break;
 		}
 		if (test_bit(ATM_VF_RELEASED,&vcc->flags) ||
-		    test_bit(ATM_VF_CLOSE,&vcc->flags)) {
-			error = -sk->sk_err;
-			break;
-		}
-		if (!test_bit(ATM_VF_READY,&vcc->flags)) {
+		    test_bit(ATM_VF_CLOSE,&vcc->flags) ||
+		    !test_bit(ATM_VF_READY,&vcc->flags)) {
 			error = -EPIPE;
+			send_sig(SIGPIPE, current, 0);
 			break;
 		}
 		prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
diff -Nru a/net/atm/common.h b/net/atm/common.h
--- a/net/atm/common.h	Tue Feb  3 19:45:35 2004
+++ b/net/atm/common.h	Tue Feb  3 19:45:35 2004
@@ -14,9 +14,9 @@
 int vcc_release(struct socket *sock);
 int vcc_connect(struct socket *sock, int itf, short vpi, int vci);
 int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
-		int size, int flags);
+		size_t size, int flags);
 int vcc_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m,
-		int total_len);
+		size_t total_len);
 unsigned int vcc_poll(struct file *file, struct socket *sock, poll_table *wait);
 int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
 int vcc_setsockopt(struct socket *sock, int level, int optname, char *optval,
diff -Nru a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
--- a/net/ax25/af_ax25.c	Tue Feb  3 19:45:42 2004
+++ b/net/ax25/af_ax25.c	Tue Feb  3 19:45:42 2004
@@ -1401,7 +1401,7 @@
 }
 
 static int ax25_sendmsg(struct kiocb *iocb, struct socket *sock,
-			struct msghdr *msg, int len)
+			struct msghdr *msg, size_t len)
 {
 	struct sockaddr_ax25 *usax = (struct sockaddr_ax25 *)msg->msg_name;
 	struct sock *sk = sock->sk;
@@ -1410,7 +1410,8 @@
 	ax25_digi dtmp, *dp;
 	unsigned char *asmptr;
 	ax25_cb *ax25;
-	int lv, size, err, addr_len = msg->msg_namelen;
+	size_t size;
+	int lv, err, addr_len = msg->msg_namelen;
 
 	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR)) {
 		return -EINVAL;
@@ -1435,6 +1436,11 @@
 		goto out;
 	}
 
+	if (len > ax25->ax25_dev->dev->mtu) {
+		err = -EMSGSIZE;
+		goto out;
+	}
+		
 	if (usax != NULL) {
 		if (usax->sax25_family != AF_AX25) {
 			err = -EINVAL;
@@ -1520,7 +1526,12 @@
 	SOCK_DEBUG(sk, "AX.25: Appending user data\n");
 
 	/* User data follows immediately after the AX.25 data */
-	memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len);
+	if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) {
+		err = -EFAULT;
+		kfree_skb(skb);
+		goto out;
+	}
+
 	skb->nh.raw = skb->data;
 
 	/* Add the PID if one is not supplied by the user in the skb */
@@ -1580,7 +1591,7 @@
 }
 
 static int ax25_recvmsg(struct kiocb *iocb, struct socket *sock,
-	struct msghdr *msg, int size, int flags)
+	struct msghdr *msg, size_t size, int flags)
 {
 	struct sock *sk = sock->sk;
 	struct sk_buff *skb;
diff -Nru a/net/bluetooth/Kconfig b/net/bluetooth/Kconfig
--- a/net/bluetooth/Kconfig	Tue Feb  3 19:45:41 2004
+++ b/net/bluetooth/Kconfig	Tue Feb  3 19:45:41 2004
@@ -21,6 +21,7 @@
 	     SCO Module (SCO links)
 	     RFCOMM Module (RFCOMM protocol)  
 	     BNEP Module (BNEP protocol)
+	     CMTP Module (CMTP protocol)
 
 	  Say Y here to enable Linux Bluetooth support and to build Bluetooth Core
 	  layer.
@@ -56,6 +57,8 @@
 source "net/bluetooth/rfcomm/Kconfig"
 
 source "net/bluetooth/bnep/Kconfig"
+
+source "net/bluetooth/cmtp/Kconfig"
 
 source "drivers/bluetooth/Kconfig"
 
diff -Nru a/net/bluetooth/Makefile b/net/bluetooth/Makefile
--- a/net/bluetooth/Makefile	Tue Feb  3 19:45:17 2004
+++ b/net/bluetooth/Makefile	Tue Feb  3 19:45:17 2004
@@ -7,5 +7,6 @@
 obj-$(CONFIG_BT_SCO)	+= sco.o
 obj-$(CONFIG_BT_RFCOMM)	+= rfcomm/
 obj-$(CONFIG_BT_BNEP)	+= bnep/
+obj-$(CONFIG_BT_CMTP)	+= cmtp/
 
 bluetooth-objs := af_bluetooth.o hci_core.o hci_conn.o hci_event.o hci_sock.o hci_proc.o lib.o syms.o
diff -Nru a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
--- a/net/bluetooth/af_bluetooth.c	Tue Feb  3 19:45:17 2004
+++ b/net/bluetooth/af_bluetooth.c	Tue Feb  3 19:45:17 2004
@@ -59,7 +59,7 @@
 struct proc_dir_entry *proc_bt;
 
 /* Bluetooth sockets */
-#define BT_MAX_PROTO	5
+#define BT_MAX_PROTO	6
 static struct net_proto_family *bt_proto[BT_MAX_PROTO];
 
 static kmem_cache_t *bt_sock_cache;
@@ -201,12 +201,13 @@
 }
 
 int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
-	struct msghdr *msg, int len, int flags)
+	struct msghdr *msg, size_t len, int flags)
 {
 	int noblock = flags & MSG_DONTWAIT;
 	struct sock *sk = sock->sk;
 	struct sk_buff *skb;
-	int copied, err;
+	size_t copied;
+	int err;
 
 	BT_DBG("sock %p sk %p len %d", sock, sk, len);
 
diff -Nru a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
--- a/net/bluetooth/bnep/core.c	Tue Feb  3 19:45:34 2004
+++ b/net/bluetooth/bnep/core.c	Tue Feb  3 19:45:34 2004
@@ -707,3 +707,4 @@
 MODULE_DESCRIPTION("Bluetooth BNEP ver " VERSION);
 MODULE_AUTHOR("David Libault <david.libault@inventel.fr>, Maxim Krasnyanskiy <maxk@qualcomm.com>");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("bt-proto-4");
diff -Nru a/net/bluetooth/cmtp/Kconfig b/net/bluetooth/cmtp/Kconfig
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/net/bluetooth/cmtp/Kconfig	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,11 @@
+config BT_CMTP
+	tristate "CMTP protocol support"
+	depends on BT && BT_L2CAP && ISDN_CAPI
+	help
+	  CMTP (CAPI Message Transport Protocol) is a transport layer
+	  for CAPI messages. CMTP is required for the Bluetooth Common
+	  ISDN Access Profile.
+
+	  Say Y here to compile CMTP support into the kernel or say M to
+	  compile it as module (cmtp).
+
diff -Nru a/net/bluetooth/cmtp/Makefile b/net/bluetooth/cmtp/Makefile
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/net/bluetooth/cmtp/Makefile	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,7 @@
+#
+# Makefile for the Linux Bluetooth CMTP layer
+#
+
+obj-$(CONFIG_BT_CMTP) += cmtp.o
+
+cmtp-objs := core.o sock.o capi.o
diff -Nru a/net/bluetooth/cmtp/capi.c b/net/bluetooth/cmtp/capi.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/net/bluetooth/cmtp/capi.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,630 @@
+/* 
+   CMTP implementation for Linux Bluetooth stack (BlueZ).
+   Copyright (C) 2002-2003 Marcel Holtmann <marcel@holtmann.org>
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License version 2 as
+   published by the Free Software Foundation;
+
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+   IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
+   CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 
+   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 
+   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 
+   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+   ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 
+   COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 
+   SOFTWARE IS DISCLAIMED.
+*/
+
+#include <linux/config.h>
+#include <linux/module.h>
+
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/major.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/poll.h>
+#include <linux/fcntl.h>
+#include <linux/skbuff.h>
+#include <linux/socket.h>
+#include <linux/ioctl.h>
+#include <linux/file.h>
+#include <net/sock.h>
+
+#include <linux/isdn/capilli.h>
+#include <linux/isdn/capicmd.h>
+#include <linux/isdn/capiutil.h>
+
+#include "cmtp.h"
+
+#ifndef CONFIG_BT_CMTP_DEBUG
+#undef  BT_DBG
+#define BT_DBG(D...)
+#endif
+
+#define CAPI_INTEROPERABILITY		0x20
+
+#define CAPI_INTEROPERABILITY_REQ	CAPICMD(CAPI_INTEROPERABILITY, CAPI_REQ)
+#define CAPI_INTEROPERABILITY_CONF	CAPICMD(CAPI_INTEROPERABILITY, CAPI_CONF)
+#define CAPI_INTEROPERABILITY_IND	CAPICMD(CAPI_INTEROPERABILITY, CAPI_IND)
+#define CAPI_INTEROPERABILITY_RESP	CAPICMD(CAPI_INTEROPERABILITY, CAPI_RESP)
+
+#define CAPI_INTEROPERABILITY_REQ_LEN	(CAPI_MSG_BASELEN + 2)
+#define CAPI_INTEROPERABILITY_CONF_LEN	(CAPI_MSG_BASELEN + 4)
+#define CAPI_INTEROPERABILITY_IND_LEN	(CAPI_MSG_BASELEN + 2)
+#define CAPI_INTEROPERABILITY_RESP_LEN	(CAPI_MSG_BASELEN + 2)
+
+#define CAPI_FUNCTION_REGISTER		0
+#define CAPI_FUNCTION_RELEASE		1
+#define CAPI_FUNCTION_GET_PROFILE	2
+#define CAPI_FUNCTION_GET_MANUFACTURER	3
+#define CAPI_FUNCTION_GET_VERSION	4
+#define CAPI_FUNCTION_GET_SERIAL_NUMBER	5
+#define CAPI_FUNCTION_MANUFACTURER	6
+#define CAPI_FUNCTION_LOOPBACK		7
+
+
+#define CMTP_MSGNUM	1
+#define CMTP_APPLID	2
+#define CMTP_MAPPING	3
+
+static struct cmtp_application *cmtp_application_add(struct cmtp_session *session, __u16 appl)
+{
+	struct cmtp_application *app = kmalloc(sizeof(*app), GFP_KERNEL);
+
+	BT_DBG("session %p application %p appl %d", session, app, appl);
+
+	if (!app)
+		return NULL;
+
+	memset(app, 0, sizeof(*app));
+
+	app->state = BT_OPEN;
+	app->appl = appl;
+
+	list_add_tail(&app->list, &session->applications);
+
+	return app;
+}
+
+static void cmtp_application_del(struct cmtp_session *session, struct cmtp_application *app)
+{
+	BT_DBG("session %p application %p", session, app);
+
+	if (app) {
+		list_del(&app->list);
+		kfree(app);
+	}
+}
+
+static struct cmtp_application *cmtp_application_get(struct cmtp_session *session, int pattern, __u16 value)
+{
+	struct cmtp_application *app;
+	struct list_head *p, *n;
+
+	list_for_each_safe(p, n, &session->applications) {
+		app = list_entry(p, struct cmtp_application, list);
+		switch (pattern) {
+		case CMTP_MSGNUM:
+			if (app->msgnum == value)
+				return app;
+			break;
+		case CMTP_APPLID:
+			if (app->appl == value)
+				return app;
+			break;
+		case CMTP_MAPPING:
+			if (app->mapping == value)
+				return app;
+			break;
+		}
+	}
+
+	return NULL;
+}
+
+static int cmtp_msgnum_get(struct cmtp_session *session)
+{
+	session->msgnum++;
+
+	if ((session->msgnum & 0xff) > 200)
+		session->msgnum = CMTP_INITIAL_MSGNUM + 1;
+
+	return session->msgnum;
+}
+
+
+static void cmtp_send_interopmsg(struct cmtp_session *session,
+					__u8 subcmd, __u16 appl, __u16 msgnum,
+					__u16 function, unsigned char *buf, int len)
+{
+	struct sk_buff *skb;
+	unsigned char *s;
+
+	BT_DBG("session %p subcmd 0x%02x appl %d msgnum %d", session, subcmd, appl, msgnum);
+
+	if (!(skb = alloc_skb(CAPI_MSG_BASELEN + 6 + len, GFP_ATOMIC))) {
+		BT_ERR("Can't allocate memory for interoperability packet");
+		return;
+	}
+
+	s = skb_put(skb, CAPI_MSG_BASELEN + 6 + len);
+
+	capimsg_setu16(s, 0, CAPI_MSG_BASELEN + 6 + len);
+	capimsg_setu16(s, 2, appl);
+	capimsg_setu8 (s, 4, CAPI_INTEROPERABILITY);
+	capimsg_setu8 (s, 5, subcmd);
+	capimsg_setu16(s, 6, msgnum);
+
+	/* Interoperability selector (Bluetooth Device Management) */
+	capimsg_setu16(s, 8, 0x0001);
+
+	capimsg_setu8 (s, 10, 3 + len);
+	capimsg_setu16(s, 11, function);
+	capimsg_setu8 (s, 13, len);
+
+	if (len > 0)
+		memcpy(s + 14, buf, len);
+
+	cmtp_send_capimsg(session, skb);
+}
+
+static void cmtp_recv_interopmsg(struct cmtp_session *session, struct sk_buff *skb)
+{
+	struct capi_ctr *ctrl = &session->ctrl;
+	struct cmtp_application *application;
+	__u16 appl, msgnum, func, info;
+	__u32 controller;
+
+	BT_DBG("session %p skb %p len %d", session, skb, skb->len);
+
+	switch (CAPIMSG_SUBCOMMAND(skb->data)) {
+	case CAPI_CONF:
+		func = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 5);
+		info = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 8);
+
+		switch (func) {
+		case CAPI_FUNCTION_REGISTER:
+			msgnum = CAPIMSG_MSGID(skb->data);
+
+			application = cmtp_application_get(session, CMTP_MSGNUM, msgnum);
+			if (application) {
+				application->state = BT_CONNECTED;
+				application->msgnum = 0;
+				application->mapping = CAPIMSG_APPID(skb->data);
+				wake_up_interruptible(&session->wait);
+			}
+
+			break;
+
+		case CAPI_FUNCTION_RELEASE:
+			appl = CAPIMSG_APPID(skb->data);
+
+			application = cmtp_application_get(session, CMTP_MAPPING, appl);
+			if (application) {
+				application->state = BT_CLOSED;
+				application->msgnum = 0;
+				wake_up_interruptible(&session->wait);
+			}
+
+			break;
+
+		case CAPI_FUNCTION_GET_PROFILE:
+			controller = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 11);
+			msgnum = CAPIMSG_MSGID(skb->data);
+
+			if (!info && (msgnum == CMTP_INITIAL_MSGNUM)) {
+				session->ncontroller = controller;
+				wake_up_interruptible(&session->wait);
+				break;
+			}
+
+			if (!info && ctrl) {
+				memcpy(&ctrl->profile,
+					skb->data + CAPI_MSG_BASELEN + 11,
+					sizeof(capi_profile));
+				session->state = BT_CONNECTED;
+				capi_ctr_ready(ctrl);
+			}
+
+			break;
+
+		case CAPI_FUNCTION_GET_MANUFACTURER:
+			controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 10);
+
+			if (!info && ctrl) {
+				strncpy(ctrl->manu,
+					skb->data + CAPI_MSG_BASELEN + 15,
+					skb->data[CAPI_MSG_BASELEN + 14]);
+			}
+
+			break;
+
+		case CAPI_FUNCTION_GET_VERSION:
+			controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 12);
+
+			if (!info && ctrl) {
+				ctrl->version.majorversion = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 16);
+				ctrl->version.minorversion = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 20);
+				ctrl->version.majormanuversion = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 24);
+				ctrl->version.minormanuversion = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 28);
+			}
+
+			break;
+
+		case CAPI_FUNCTION_GET_SERIAL_NUMBER:
+			controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 12);
+
+			if (!info && ctrl) {
+				memset(ctrl->serial, 0, CAPI_SERIAL_LEN);
+				strncpy(ctrl->serial,
+					skb->data + CAPI_MSG_BASELEN + 17,
+					skb->data[CAPI_MSG_BASELEN + 16]);
+			}
+
+			break;
+		}
+
+		break;
+
+	case CAPI_IND:
+		func = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 3);
+
+		if (func == CAPI_FUNCTION_LOOPBACK) {
+			appl = CAPIMSG_APPID(skb->data);
+			msgnum = CAPIMSG_MSGID(skb->data);
+			cmtp_send_interopmsg(session, CAPI_RESP, appl, msgnum, func,
+						skb->data + CAPI_MSG_BASELEN + 6,
+						skb->data[CAPI_MSG_BASELEN + 5]);
+		}
+
+		break;
+	}
+
+	kfree_skb(skb);
+}
+
+void cmtp_recv_capimsg(struct cmtp_session *session, struct sk_buff *skb)
+{
+	struct capi_ctr *ctrl = &session->ctrl;
+	struct cmtp_application *application;
+	__u16 cmd, appl;
+	__u32 contr;
+
+	BT_DBG("session %p skb %p len %d", session, skb, skb->len);
+
+	if (CAPIMSG_COMMAND(skb->data) == CAPI_INTEROPERABILITY) {
+		cmtp_recv_interopmsg(session, skb);
+		return;
+	}
+
+	if (session->flags & (1 << CMTP_LOOPBACK)) {
+		kfree_skb(skb);
+		return;
+	}
+
+	cmd = CAPICMD(CAPIMSG_COMMAND(skb->data), CAPIMSG_SUBCOMMAND(skb->data));
+	appl = CAPIMSG_APPID(skb->data);
+	contr = CAPIMSG_CONTROL(skb->data);
+
+	application = cmtp_application_get(session, CMTP_MAPPING, appl);
+	if (application) {
+		appl = application->appl;
+		CAPIMSG_SETAPPID(skb->data, appl);
+	} else {
+		BT_ERR("Can't find application with id %d", appl);
+		kfree_skb(skb);
+		return;
+	}
+
+	if ((contr & 0x7f) == 0x01) {
+		contr = (contr & 0xffffff80) | session->num;
+		CAPIMSG_SETCONTROL(skb->data, contr);
+	}
+
+	if (!ctrl) {
+		BT_ERR("Can't find controller %d for message", session->num);
+		kfree_skb(skb);
+		return;
+	}
+
+	capi_ctr_handle_message(ctrl, appl, skb);
+}
+
+void cmtp_send_capimsg(struct cmtp_session *session, struct sk_buff *skb)
+{
+	struct cmtp_scb *scb = (void *) skb->cb;
+
+	BT_DBG("session %p skb %p len %d", session, skb, skb->len);
+
+	scb->id = -1;
+	scb->data = (CAPIMSG_COMMAND(skb->data) == CAPI_DATA_B3);
+
+	skb_queue_tail(&session->transmit, skb);
+
+	cmtp_schedule(session);
+}
+
+
+static int cmtp_load_firmware(struct capi_ctr *ctrl, capiloaddata *data)
+{
+	BT_DBG("ctrl %p data %p", ctrl, data);
+
+	return 0;
+}
+
+static void cmtp_reset_ctr(struct capi_ctr *ctrl)
+{
+	struct cmtp_session *session = ctrl->driverdata;
+
+	BT_DBG("ctrl %p", ctrl);
+
+	capi_ctr_reseted(ctrl);
+
+	atomic_inc(&session->terminate);
+	cmtp_schedule(session);
+}
+
+static void cmtp_register_appl(struct capi_ctr *ctrl, __u16 appl, capi_register_params *rp)
+{
+	DECLARE_WAITQUEUE(wait, current);
+	struct cmtp_session *session = ctrl->driverdata;
+	struct cmtp_application *application;
+	unsigned long timeo = CMTP_INTEROP_TIMEOUT;
+	unsigned char buf[8];
+	int err = 0, nconn, want = rp->level3cnt;
+
+	BT_DBG("ctrl %p appl %d level3cnt %d datablkcnt %d datablklen %d",
+		ctrl, appl, rp->level3cnt, rp->datablkcnt, rp->datablklen);
+
+	application = cmtp_application_add(session, appl);
+	if (!application) {
+		BT_ERR("Can't allocate memory for new application");
+		return;
+	}
+
+	if (want < 0)
+		nconn = ctrl->profile.nbchannel * -want;
+	else
+		nconn = want;
+
+	if (nconn == 0)
+		nconn = ctrl->profile.nbchannel;
+
+	capimsg_setu16(buf, 0, nconn);
+	capimsg_setu16(buf, 2, rp->datablkcnt);
+	capimsg_setu16(buf, 4, rp->datablklen);
+
+	application->state = BT_CONFIG;
+	application->msgnum = cmtp_msgnum_get(session);
+
+	cmtp_send_interopmsg(session, CAPI_REQ, 0x0000, application->msgnum,
+				CAPI_FUNCTION_REGISTER, buf, 6);
+
+	add_wait_queue(&session->wait, &wait);
+	while (1) {
+		set_current_state(TASK_INTERRUPTIBLE);
+
+		if (!timeo) {
+			err = -EAGAIN;
+			break;
+		}
+
+		if (application->state == BT_CLOSED) {
+			err = -application->err;
+			break;
+		}
+
+		if (application->state == BT_CONNECTED)
+			break;
+
+		if (signal_pending(current)) {
+			err = -EINTR;
+			break;
+		}
+
+		timeo = schedule_timeout(timeo);
+	}
+	set_current_state(TASK_RUNNING);
+	remove_wait_queue(&session->wait, &wait);
+
+	if (err) {
+		cmtp_application_del(session, application);
+		return;
+	}
+}
+
+static void cmtp_release_appl(struct capi_ctr *ctrl, __u16 appl)
+{
+	DECLARE_WAITQUEUE(wait, current);
+	struct cmtp_session *session = ctrl->driverdata;
+	struct cmtp_application *application;
+	unsigned long timeo = CMTP_INTEROP_TIMEOUT;
+
+	BT_DBG("ctrl %p appl %d", ctrl, appl);
+
+	application = cmtp_application_get(session, CMTP_APPLID, appl);
+	if (!application) {
+		BT_ERR("Can't find application");
+		return;
+	}
+
+	application->msgnum = cmtp_msgnum_get(session);
+
+	cmtp_send_interopmsg(session, CAPI_REQ, application->mapping, application->msgnum,
+				CAPI_FUNCTION_RELEASE, NULL, 0);
+
+	add_wait_queue(&session->wait, &wait);
+	while (timeo) {
+		set_current_state(TASK_INTERRUPTIBLE);
+
+		if (application->state == BT_CLOSED)
+			break;
+
+		if (signal_pending(current))
+			break;
+
+		timeo = schedule_timeout(timeo);
+	}
+	set_current_state(TASK_RUNNING);
+	remove_wait_queue(&session->wait, &wait);
+
+	cmtp_application_del(session, application);
+}
+
+static u16 cmtp_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
+{
+	struct cmtp_session *session = ctrl->driverdata;
+	struct cmtp_application *application;
+	__u16 appl;
+	__u32 contr;
+
+	BT_DBG("ctrl %p skb %p", ctrl, skb);
+
+	appl = CAPIMSG_APPID(skb->data);
+	contr = CAPIMSG_CONTROL(skb->data);
+
+	application = cmtp_application_get(session, CMTP_APPLID, appl);
+	if ((!application) || (application->state != BT_CONNECTED)) {
+		BT_ERR("Can't find application with id %d", appl);
+		kfree_skb(skb);
+		return CAPI_ILLAPPNR;
+	}
+
+	CAPIMSG_SETAPPID(skb->data, application->mapping);
+
+	if ((contr & 0x7f) == session->num) {
+		contr = (contr & 0xffffff80) | 0x01;
+		CAPIMSG_SETCONTROL(skb->data, contr);
+	}
+
+	cmtp_send_capimsg(session, skb);
+
+	return CAPI_NOERROR;
+}
+
+static char *cmtp_procinfo(struct capi_ctr *ctrl)
+{
+	return "CAPI Message Transport Protocol";
+}
+
+static int cmtp_ctr_read_proc(char *page, char **start, off_t off, int count, int *eof, struct capi_ctr *ctrl)
+{
+	struct cmtp_session *session = ctrl->driverdata;
+	struct cmtp_application *app;
+	struct list_head *p, *n;
+	int len = 0;
+
+	len += sprintf(page + len, "%s\n\n", cmtp_procinfo(ctrl));
+	len += sprintf(page + len, "addr %s\n", session->name);
+	len += sprintf(page + len, "ctrl %d\n", session->num);
+
+	list_for_each_safe(p, n, &session->applications) {
+		app = list_entry(p, struct cmtp_application, list);
+		len += sprintf(page + len, "appl %d -> %d\n", app->appl, app->mapping);
+	}
+
+	if (off + count >= len)
+		*eof = 1;
+
+	if (len < off)
+		return 0;
+
+	*start = page + off;
+
+	return ((count < len - off) ? count : len - off);
+}
+
+
+int cmtp_attach_device(struct cmtp_session *session)
+{
+	DECLARE_WAITQUEUE(wait, current);
+	unsigned long timeo = CMTP_INTEROP_TIMEOUT;
+	unsigned char buf[4];
+
+	BT_DBG("session %p", session);
+
+	capimsg_setu32(buf, 0, 0);
+
+	cmtp_send_interopmsg(session, CAPI_REQ, 0xffff, CMTP_INITIAL_MSGNUM,
+				CAPI_FUNCTION_GET_PROFILE, buf, 4);
+
+	add_wait_queue(&session->wait, &wait);
+	while (timeo) {
+		set_current_state(TASK_INTERRUPTIBLE);
+
+		if (session->ncontroller)
+			break;
+
+		if (signal_pending(current))
+			break;
+
+		timeo = schedule_timeout(timeo);
+	}
+	set_current_state(TASK_RUNNING);
+	remove_wait_queue(&session->wait, &wait);
+
+	BT_INFO("Found %d CAPI controller(s) on device %s", session->ncontroller, session->name);
+
+	if (!timeo)
+		return -ETIMEDOUT;
+
+	if (!session->ncontroller)
+		return -ENODEV;
+
+
+	if (session->ncontroller > 1)
+		BT_INFO("Setting up only CAPI controller 1");
+
+	session->ctrl.owner      = THIS_MODULE;
+	session->ctrl.driverdata = session;
+	strcpy(session->ctrl.name, session->name);
+
+	session->ctrl.driver_name   = "cmtp";
+	session->ctrl.load_firmware = cmtp_load_firmware;
+	session->ctrl.reset_ctr     = cmtp_reset_ctr;
+	session->ctrl.register_appl = cmtp_register_appl;
+	session->ctrl.release_appl  = cmtp_release_appl;
+	session->ctrl.send_message  = cmtp_send_message;
+
+	session->ctrl.procinfo      = cmtp_procinfo;
+	session->ctrl.ctr_read_proc = cmtp_ctr_read_proc;
+
+	if (attach_capi_ctr(&session->ctrl) < 0) {
+		BT_ERR("Can't attach new controller");
+		return -EBUSY;
+	}
+
+	session->num = session->ctrl.cnr;
+
+	BT_DBG("session %p num %d", session, session->num);
+
+	capimsg_setu32(buf, 0, 1);
+
+	cmtp_send_interopmsg(session, CAPI_REQ, 0xffff, cmtp_msgnum_get(session),
+				CAPI_FUNCTION_GET_MANUFACTURER, buf, 4);
+
+	cmtp_send_interopmsg(session, CAPI_REQ, 0xffff, cmtp_msgnum_get(session),
+				CAPI_FUNCTION_GET_VERSION, buf, 4);
+
+	cmtp_send_interopmsg(session, CAPI_REQ, 0xffff, cmtp_msgnum_get(session),
+				CAPI_FUNCTION_GET_SERIAL_NUMBER, buf, 4);
+
+	cmtp_send_interopmsg(session, CAPI_REQ, 0xffff, cmtp_msgnum_get(session),
+				CAPI_FUNCTION_GET_PROFILE, buf, 4);
+
+	return 0;
+}
+
+void cmtp_detach_device(struct cmtp_session *session)
+{
+	BT_DBG("session %p", session);
+
+	detach_capi_ctr(&session->ctrl);
+}
diff -Nru a/net/bluetooth/cmtp/cmtp.h b/net/bluetooth/cmtp/cmtp.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/net/bluetooth/cmtp/cmtp.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,136 @@
+/* 
+   CMTP implementation for Linux Bluetooth stack (BlueZ).
+   Copyright (C) 2002-2003 Marcel Holtmann <marcel@holtmann.org>
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License version 2 as
+   published by the Free Software Foundation;
+
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+   IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
+   CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 
+   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 
+   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 
+   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+   ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 
+   COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 
+   SOFTWARE IS DISCLAIMED.
+*/
+
+#ifndef __CMTP_H
+#define __CMTP_H
+
+#include <linux/types.h>
+#include <net/bluetooth/bluetooth.h>
+
+#define BTNAMSIZ 18
+
+/* CMTP ioctl defines */
+#define CMTPCONNADD	_IOW('C', 200, int)
+#define CMTPCONNDEL	_IOW('C', 201, int)
+#define CMTPGETCONNLIST	_IOR('C', 210, int)
+#define CMTPGETCONNINFO	_IOR('C', 211, int)
+
+#define CMTP_LOOPBACK	0
+
+struct cmtp_connadd_req {
+	int   sock;	// Connected socket
+	__u32 flags;
+};
+
+struct cmtp_conndel_req {
+	bdaddr_t bdaddr;
+	__u32    flags;
+};
+
+struct cmtp_conninfo {
+	bdaddr_t bdaddr;
+	__u32    flags;
+	__u16    state;
+	int      num;
+};
+
+struct cmtp_connlist_req {
+	__u32  cnum;
+	struct cmtp_conninfo *ci;
+};
+
+int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock);
+int cmtp_del_connection(struct cmtp_conndel_req *req);
+int cmtp_get_connlist(struct cmtp_connlist_req *req);
+int cmtp_get_conninfo(struct cmtp_conninfo *ci);
+
+/* CMTP session defines */
+#define CMTP_INTEROP_TIMEOUT	(HZ * 5)
+#define CMTP_INITIAL_MSGNUM	0xff00
+
+struct cmtp_session {
+	struct list_head list;
+
+	struct socket *sock;
+
+	bdaddr_t bdaddr;
+
+	unsigned long state;
+	unsigned long flags;
+
+	uint mtu;
+
+	char name[BTNAMSIZ];
+
+	atomic_t terminate;
+
+	wait_queue_head_t wait;
+
+	int ncontroller;
+	int num;
+	struct capi_ctr ctrl;
+
+	struct list_head applications;
+
+	unsigned long blockids;
+	int msgnum;
+
+	struct sk_buff_head transmit;
+
+	struct sk_buff *reassembly[16];
+};
+
+struct cmtp_application {
+	struct list_head list;
+
+	unsigned long state;
+	int err;
+
+	__u16 appl;
+	__u16 mapping;
+
+	__u16 msgnum;
+};
+
+struct cmtp_scb {
+	int id;
+	int data;
+};
+
+int  cmtp_attach_device(struct cmtp_session *session);
+void cmtp_detach_device(struct cmtp_session *session);
+
+void cmtp_recv_capimsg(struct cmtp_session *session, struct sk_buff *skb);
+void cmtp_send_capimsg(struct cmtp_session *session, struct sk_buff *skb);
+
+static inline void cmtp_schedule(struct cmtp_session *session)
+{
+	struct sock *sk = session->sock->sk;
+
+	wake_up_interruptible(sk->sk_sleep);
+}
+
+/* CMTP init defines */
+int cmtp_init_sockets(void);
+void cmtp_cleanup_sockets(void);
+
+#endif /* __CMTP_H */
diff -Nru a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/net/bluetooth/cmtp/core.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,507 @@
+/* 
+   CMTP implementation for Linux Bluetooth stack (BlueZ).
+   Copyright (C) 2002-2003 Marcel Holtmann <marcel@holtmann.org>
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License version 2 as
+   published by the Free Software Foundation;
+
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+   IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
+   CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 
+   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 
+   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 
+   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+   ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 
+   COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 
+   SOFTWARE IS DISCLAIMED.
+*/
+
+#include <linux/config.h>
+#include <linux/module.h>
+
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/major.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/poll.h>
+#include <linux/fcntl.h>
+#include <linux/skbuff.h>
+#include <linux/socket.h>
+#include <linux/ioctl.h>
+#include <linux/file.h>
+#include <linux/init.h>
+#include <net/sock.h>
+
+#include <linux/isdn/capilli.h>
+
+#include <net/bluetooth/bluetooth.h>
+#include <net/bluetooth/l2cap.h>
+
+#include "cmtp.h"
+
+#ifndef CONFIG_BT_CMTP_DEBUG
+#undef  BT_DBG
+#define BT_DBG(D...)
+#endif
+
+#define VERSION "1.0"
+
+static DECLARE_RWSEM(cmtp_session_sem);
+static LIST_HEAD(cmtp_session_list);
+
+static struct cmtp_session *__cmtp_get_session(bdaddr_t *bdaddr)
+{
+	struct cmtp_session *session;
+	struct list_head *p;
+
+	BT_DBG("");
+
+	list_for_each(p, &cmtp_session_list) {
+		session = list_entry(p, struct cmtp_session, list);
+		if (!bacmp(bdaddr, &session->bdaddr))
+			return session;
+	}
+	return NULL;
+}
+
+static void __cmtp_link_session(struct cmtp_session *session)
+{
+	__module_get(THIS_MODULE);
+	list_add(&session->list, &cmtp_session_list);
+}
+
+static void __cmtp_unlink_session(struct cmtp_session *session)
+{
+	list_del(&session->list);
+	module_put(THIS_MODULE);
+}
+
+static void __cmtp_copy_session(struct cmtp_session *session, struct cmtp_conninfo *ci)
+{
+	bacpy(&ci->bdaddr, &session->bdaddr);
+
+	ci->flags = session->flags;
+	ci->state = session->state;
+
+	ci->num = session->num;
+}
+
+
+static inline int cmtp_alloc_block_id(struct cmtp_session *session)
+{
+	int i, id = -1;
+
+	for (i = 0; i < 16; i++)
+		if (!test_and_set_bit(i, &session->blockids)) {
+			id = i;
+			break;
+		}
+
+	return id;
+}
+
+static inline void cmtp_free_block_id(struct cmtp_session *session, int id)
+{
+	clear_bit(id, &session->blockids);
+}
+
+static inline void cmtp_add_msgpart(struct cmtp_session *session, int id, const unsigned char *buf, int count)
+{
+	struct sk_buff *skb = session->reassembly[id], *nskb;
+	int size;
+
+	BT_DBG("session %p buf %p count %d", session, buf, count);
+
+	size = (skb) ? skb->len + count : count;
+
+	if (!(nskb = alloc_skb(size, GFP_ATOMIC))) {
+		BT_ERR("Can't allocate memory for CAPI message");
+		return;
+	}
+
+	if (skb && (skb->len > 0))
+		memcpy(skb_put(nskb, skb->len), skb->data, skb->len);
+
+	memcpy(skb_put(nskb, count), buf, count);
+
+	session->reassembly[id] = nskb;
+
+	if (skb)
+		kfree_skb(skb);
+}
+
+static inline int cmtp_recv_frame(struct cmtp_session *session, struct sk_buff *skb)
+{
+	__u8 hdr, hdrlen, id;
+	__u16 len;
+
+	BT_DBG("session %p skb %p len %d", session, skb, skb->len);
+
+	while (skb->len > 0) {
+		hdr = skb->data[0];
+
+		switch (hdr & 0xc0) {
+		case 0x40:
+			hdrlen = 2;
+			len = skb->data[1];
+			break;
+		case 0x80:
+			hdrlen = 3;
+			len = skb->data[1] | (skb->data[2] << 8);
+			break;
+		default:
+			hdrlen = 1;
+			len = 0;
+			break;
+		}
+
+		id = (hdr & 0x3c) >> 2;
+
+		BT_DBG("hdr 0x%02x hdrlen %d len %d id %d", hdr, hdrlen, len, id);
+
+		if (hdrlen + len > skb->len) {
+			BT_ERR("Wrong size or header information in CMTP frame");
+			break;
+		}
+
+		if (len == 0) {
+			skb_pull(skb, hdrlen);
+			continue;
+		}
+
+		switch (hdr & 0x03) {
+		case 0x00:
+			cmtp_add_msgpart(session, id, skb->data + hdrlen, len);
+			cmtp_recv_capimsg(session, session->reassembly[id]);
+			session->reassembly[id] = NULL;
+			break;
+		case 0x01:
+			cmtp_add_msgpart(session, id, skb->data + hdrlen, len);
+			break;
+		default:
+			if (session->reassembly[id] != NULL)
+				kfree_skb(session->reassembly[id]);
+			session->reassembly[id] = NULL;
+			break;
+		}
+
+		skb_pull(skb, hdrlen + len);
+	}
+
+	kfree_skb(skb);
+	return 0;
+}
+
+static int cmtp_send_frame(struct cmtp_session *session, unsigned char *data, int len)
+{
+	struct socket *sock = session->sock;
+	struct iovec iv = { data, len };
+	struct msghdr msg;
+
+	BT_DBG("session %p data %p len %d", session, data, len);
+
+	if (!len)
+		return 0;
+
+	memset(&msg, 0, sizeof(msg));
+	msg.msg_iovlen = 1;
+	msg.msg_iov = &iv;
+
+	return sock_sendmsg(sock, &msg, len);
+}
+
+static int cmtp_process_transmit(struct cmtp_session *session)
+{
+	struct sk_buff *skb, *nskb;
+	unsigned char *hdr;
+	unsigned int size, tail;
+
+	BT_DBG("session %p", session);
+
+	if (!(nskb = alloc_skb(session->mtu, GFP_ATOMIC))) {
+		BT_ERR("Can't allocate memory for new frame");
+		return -ENOMEM;
+	}
+
+	while ((skb = skb_dequeue(&session->transmit))) {
+		struct cmtp_scb *scb = (void *) skb->cb;
+
+		if ((tail = (session->mtu - nskb->len)) < 5) {
+			cmtp_send_frame(session, nskb->data, nskb->len);
+			skb_trim(nskb, 0);
+			tail = session->mtu;
+		}
+
+		size = min_t(uint, ((tail < 258) ? (tail - 2) : (tail - 3)), skb->len);
+
+		if ((scb->id < 0) && ((scb->id = cmtp_alloc_block_id(session)) < 0)) {
+			skb_queue_head(&session->transmit, skb);
+			break;
+		}
+
+		if (size < 256) {
+			hdr = skb_put(nskb, 2);
+			hdr[0] = 0x40
+				| ((scb->id << 2) & 0x3c)
+				| ((skb->len == size) ? 0x00 : 0x01);
+			hdr[1] = size;
+		} else {
+			hdr = skb_put(nskb, 3);
+			hdr[0] = 0x80
+				| ((scb->id << 2) & 0x3c)
+				| ((skb->len == size) ? 0x00 : 0x01);
+			hdr[1] = size & 0xff;
+			hdr[2] = size >> 8;
+		}
+
+		memcpy(skb_put(nskb, size), skb->data, size);
+		skb_pull(skb, size);
+
+		if (skb->len > 0) {
+			skb_queue_head(&session->transmit, skb);
+		} else {
+			cmtp_free_block_id(session, scb->id);
+			if (scb->data) {
+				cmtp_send_frame(session, nskb->data, nskb->len);
+				skb_trim(nskb, 0);
+			}
+			kfree_skb(skb);
+		}
+	}
+
+	cmtp_send_frame(session, nskb->data, nskb->len);
+
+	kfree_skb(nskb);
+
+	return skb_queue_len(&session->transmit);
+}
+
+static int cmtp_session(void *arg)
+{
+	struct cmtp_session *session = arg;
+	struct sock *sk = session->sock->sk;
+	struct sk_buff *skb;
+	wait_queue_t wait;
+
+	BT_DBG("session %p", session);
+
+	daemonize("kcmtpd_ctr_%d", session->num);
+	set_user_nice(current, -15);
+	current->flags |= PF_IOTHREAD;
+
+	set_fs(KERNEL_DS);
+
+	init_waitqueue_entry(&wait, current);
+	add_wait_queue(sk->sk_sleep, &wait);
+	while (!atomic_read(&session->terminate)) {
+		set_current_state(TASK_INTERRUPTIBLE);
+
+		if (sk->sk_state != BT_CONNECTED)
+			break;
+
+		while ((skb = skb_dequeue(&sk->sk_receive_queue))) {
+			skb_orphan(skb);
+			cmtp_recv_frame(session, skb);
+		}
+
+		cmtp_process_transmit(session);
+
+		schedule();
+	}
+	set_current_state(TASK_RUNNING);
+	remove_wait_queue(sk->sk_sleep, &wait);
+
+	down_write(&cmtp_session_sem);
+
+	if (!(session->flags & (1 << CMTP_LOOPBACK)))
+		cmtp_detach_device(session);
+
+	fput(session->sock->file);
+
+	__cmtp_unlink_session(session);
+
+	up_write(&cmtp_session_sem);
+
+	kfree(session);
+	return 0;
+}
+
+int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock)
+{
+	struct cmtp_session *session, *s;
+	bdaddr_t src, dst;
+	int i, err;
+
+	BT_DBG("");
+
+	baswap(&src, &bt_sk(sock->sk)->src);
+	baswap(&dst, &bt_sk(sock->sk)->dst);
+
+	session = kmalloc(sizeof(struct cmtp_session), GFP_KERNEL);
+	if (!session) 
+		return -ENOMEM;
+	memset(session, 0, sizeof(struct cmtp_session));
+
+	down_write(&cmtp_session_sem);
+
+	s = __cmtp_get_session(&bt_sk(sock->sk)->dst);
+	if (s && s->state == BT_CONNECTED) {
+		err = -EEXIST;
+		goto failed;
+	}
+
+	bacpy(&session->bdaddr, &bt_sk(sock->sk)->dst);
+
+	session->mtu = min_t(uint, l2cap_pi(sock->sk)->omtu, l2cap_pi(sock->sk)->imtu);
+
+	BT_DBG("mtu %d", session->mtu);
+
+	sprintf(session->name, "%s", batostr(&dst));
+
+	session->sock  = sock;
+	session->state = BT_CONFIG;
+
+	init_waitqueue_head(&session->wait);
+
+	session->msgnum = CMTP_INITIAL_MSGNUM;
+
+	INIT_LIST_HEAD(&session->applications);
+
+	skb_queue_head_init(&session->transmit);
+
+	for (i = 0; i < 16; i++)
+		session->reassembly[i] = NULL;
+
+	session->flags = req->flags;
+
+	__cmtp_link_session(session);
+
+	err = kernel_thread(cmtp_session, session, CLONE_KERNEL);
+	if (err < 0)
+		goto unlink;
+
+	if (!(session->flags & (1 << CMTP_LOOPBACK))) {
+		err = cmtp_attach_device(session);
+		if (err < 0)
+			goto detach;
+	}
+
+	up_write(&cmtp_session_sem);
+	return 0;
+
+detach:
+	cmtp_detach_device(session);
+
+unlink:
+	__cmtp_unlink_session(session);
+
+failed:
+	up_write(&cmtp_session_sem);
+	kfree(session);
+	return err;
+}
+
+int cmtp_del_connection(struct cmtp_conndel_req *req)
+{
+	struct cmtp_session *session;
+	int err = 0;
+
+	BT_DBG("");
+
+	down_read(&cmtp_session_sem);
+
+	session = __cmtp_get_session(&req->bdaddr);
+	if (session) {
+		/* Flush the transmit queue */
+		skb_queue_purge(&session->transmit);
+
+		/* Kill session thread */
+		atomic_inc(&session->terminate);
+		cmtp_schedule(session);
+	} else
+		err = -ENOENT;
+
+	up_read(&cmtp_session_sem);
+	return err;
+}
+
+int cmtp_get_connlist(struct cmtp_connlist_req *req)
+{
+	struct list_head *p;
+	int err = 0, n = 0;
+
+	BT_DBG("");
+
+	down_read(&cmtp_session_sem);
+
+	list_for_each(p, &cmtp_session_list) {
+		struct cmtp_session *session;
+		struct cmtp_conninfo ci;
+
+		session = list_entry(p, struct cmtp_session, list);
+
+		__cmtp_copy_session(session, &ci);
+
+		if (copy_to_user(req->ci, &ci, sizeof(ci))) {
+			err = -EFAULT;
+			break;
+		}
+
+		if (++n >= req->cnum)
+			break;
+
+		req->ci++;
+	}
+	req->cnum = n;
+
+	up_read(&cmtp_session_sem);
+	return err;
+}
+
+int cmtp_get_conninfo(struct cmtp_conninfo *ci)
+{
+	struct cmtp_session *session;
+	int err = 0;
+
+	down_read(&cmtp_session_sem);
+
+	session = __cmtp_get_session(&ci->bdaddr);
+	if (session)
+		__cmtp_copy_session(session, ci);
+	else
+		err = -ENOENT;
+
+	up_read(&cmtp_session_sem);
+	return err;
+}
+
+
+int __init init_cmtp(void)
+{
+	l2cap_load();
+
+	BT_INFO("CMTP (CAPI Emulation) ver %s", VERSION);
+
+	cmtp_init_sockets();
+
+	return 0;
+}
+
+void __exit exit_cmtp(void)
+{
+	cmtp_cleanup_sockets();
+}
+
+module_init(init_cmtp);
+module_exit(exit_cmtp);
+
+MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
+MODULE_DESCRIPTION("Bluetooth CMTP ver " VERSION);
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("bt-proto-5");
diff -Nru a/net/bluetooth/cmtp/sock.c b/net/bluetooth/cmtp/sock.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/net/bluetooth/cmtp/sock.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,199 @@
+/* 
+   CMTP implementation for Linux Bluetooth stack (BlueZ).
+   Copyright (C) 2002-2003 Marcel Holtmann <marcel@holtmann.org>
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License version 2 as
+   published by the Free Software Foundation;
+
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+   IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
+   CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 
+   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 
+   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 
+   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+   ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 
+   COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 
+   SOFTWARE IS DISCLAIMED.
+*/
+
+#include <linux/config.h>
+#include <linux/module.h>
+
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/major.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/poll.h>
+#include <linux/fcntl.h>
+#include <linux/skbuff.h>
+#include <linux/socket.h>
+#include <linux/ioctl.h>
+#include <linux/file.h>
+#include <net/sock.h>
+
+#include <linux/isdn/capilli.h>
+
+#include <asm/system.h>
+#include <asm/uaccess.h>
+
+#include "cmtp.h"
+
+#ifndef CONFIG_BT_CMTP_DEBUG
+#undef  BT_DBG
+#define BT_DBG(D...)
+#endif
+
+static int cmtp_sock_release(struct socket *sock)
+{
+	struct sock *sk = sock->sk;
+
+	BT_DBG("sock %p sk %p", sock, sk);
+
+	if (!sk)
+		return 0;
+
+	sock_orphan(sk);
+	sock_put(sk);
+
+	return 0;
+}
+
+static int cmtp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
+{
+	struct cmtp_connadd_req ca;
+	struct cmtp_conndel_req cd;
+	struct cmtp_connlist_req cl;
+	struct cmtp_conninfo ci;
+	struct socket *nsock;
+	int err;
+
+	BT_DBG("cmd %x arg %lx", cmd, arg);
+
+	switch (cmd) {
+	case CMTPCONNADD:
+		if (!capable(CAP_NET_ADMIN))
+			return -EACCES;
+
+		if (copy_from_user(&ca, (void *) arg, sizeof(ca)))
+			return -EFAULT;
+
+		nsock = sockfd_lookup(ca.sock, &err);
+		if (!nsock)
+			return err;
+
+		if (nsock->sk->sk_state != BT_CONNECTED)
+			return -EBADFD;
+
+		err = cmtp_add_connection(&ca, nsock);
+		if (!err) {
+			if (copy_to_user((void *) arg, &ca, sizeof(ca)))
+				err = -EFAULT;
+		} else
+			fput(nsock->file);
+
+		return err;
+
+	case CMTPCONNDEL:
+		if (!capable(CAP_NET_ADMIN))
+			return -EACCES;
+
+		if (copy_from_user(&cd, (void *) arg, sizeof(cd)))
+			return -EFAULT;
+
+		return cmtp_del_connection(&cd);
+
+	case CMTPGETCONNLIST:
+		if (copy_from_user(&cl, (void *) arg, sizeof(cl)))
+			return -EFAULT;
+
+		if (cl.cnum <= 0)
+			return -EINVAL;
+
+		err = cmtp_get_connlist(&cl);
+		if (!err && copy_to_user((void *) arg, &cl, sizeof(cl)))
+			return -EFAULT;
+
+		return err;
+
+	case CMTPGETCONNINFO:
+		if (copy_from_user(&ci, (void *) arg, sizeof(ci)))
+			return -EFAULT;
+
+		err = cmtp_get_conninfo(&ci);
+		if (!err && copy_to_user((void *) arg, &ci, sizeof(ci)))
+			return -EFAULT;
+
+		return err;
+	}
+
+	return -EINVAL;
+}
+
+static struct proto_ops cmtp_sock_ops = {
+	.family		= PF_BLUETOOTH,
+	.owner		= THIS_MODULE,
+	.release	= cmtp_sock_release,
+	.ioctl		= cmtp_sock_ioctl,
+	.bind		= sock_no_bind,
+	.getname	= sock_no_getname,
+	.sendmsg	= sock_no_sendmsg,
+	.recvmsg	= sock_no_recvmsg,
+	.poll		= sock_no_poll,
+	.listen		= sock_no_listen,
+	.shutdown	= sock_no_shutdown,
+	.setsockopt	= sock_no_setsockopt,
+	.getsockopt	= sock_no_getsockopt,
+	.connect	= sock_no_connect,
+	.socketpair	= sock_no_socketpair,
+	.accept		= sock_no_accept,
+	.mmap		= sock_no_mmap
+};
+
+static int cmtp_sock_create(struct socket *sock, int protocol)
+{
+	struct sock *sk;
+
+	BT_DBG("sock %p", sock);
+
+	if (sock->type != SOCK_RAW)
+		return -ESOCKTNOSUPPORT;
+
+	if (!(sk = bt_sock_alloc(sock, PF_BLUETOOTH, 0, GFP_KERNEL)))
+		return -ENOMEM;
+
+	sk_set_owner(sk, THIS_MODULE);
+
+	sock->ops = &cmtp_sock_ops;
+
+	sock->state = SS_UNCONNECTED;
+
+	sk->sk_destruct = NULL;
+	sk->sk_protocol = protocol;
+
+	return 0;
+}
+
+static struct net_proto_family cmtp_sock_family_ops = {
+	.family	= PF_BLUETOOTH,
+	.owner	= THIS_MODULE,
+	.create	= cmtp_sock_create
+};
+
+int cmtp_init_sockets(void)
+{
+	bt_sock_register(BTPROTO_CMTP, &cmtp_sock_family_ops);
+
+	return 0;
+}
+
+void cmtp_cleanup_sockets(void)
+{
+	if (bt_sock_unregister(BTPROTO_CMTP))
+		BT_ERR("Can't unregister CMTP socket");
+}
diff -Nru a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
--- a/net/bluetooth/hci_conn.c	Tue Feb  3 19:45:43 2004
+++ b/net/bluetooth/hci_conn.c	Tue Feb  3 19:45:43 2004
@@ -71,7 +71,7 @@
 
 	memset(&cp, 0, sizeof(cp));
 	bacpy(&cp.bdaddr, &conn->dst);
-	cp.pscan_rep_mode = 0x01;
+	cp.pscan_rep_mode = 0x02;
 
 	if ((ie = inquiry_cache_lookup(hdev, &conn->dst)) &&
 			inquiry_entry_age(ie) <= INQUIRY_ENTRY_AGE_MAX) {
diff -Nru a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
--- a/net/bluetooth/hci_core.c	Tue Feb  3 19:45:17 2004
+++ b/net/bluetooth/hci_core.c	Tue Feb  3 19:45:17 2004
@@ -406,6 +406,7 @@
 
 	hci_dev_lock_bh(hdev);
 	if (inquiry_cache_age(hdev) > INQUIRY_CACHE_AGE_MAX || 
+					inquiry_cache_empty(hdev) ||
 					ir.flags & IREQ_CACHE_FLUSH) {
 		inquiry_cache_flush(hdev);
 		do_inquiry = 1;
diff -Nru a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
--- a/net/bluetooth/hci_event.c	Tue Feb  3 19:45:16 2004
+++ b/net/bluetooth/hci_event.c	Tue Feb  3 19:45:16 2004
@@ -452,6 +452,29 @@
 	hci_dev_unlock(hdev);
 }
 
+/* Inquiry Result With RSSI */
+static inline void hci_inquiry_result_with_rssi_evt(struct hci_dev *hdev, struct sk_buff *skb)
+{
+	struct inquiry_info_with_rssi *info = (struct inquiry_info_with_rssi *) (skb->data + 1);
+	int num_rsp = *((__u8 *) skb->data);
+
+	BT_DBG("%s num_rsp %d", hdev->name, num_rsp);
+
+	hci_dev_lock(hdev);
+	for (; num_rsp; num_rsp--) {
+		struct inquiry_info tmp;
+		bacpy(&tmp.bdaddr, &info->bdaddr);
+		tmp.pscan_rep_mode    = info->pscan_rep_mode;
+		tmp.pscan_period_mode = info->pscan_period_mode;
+		tmp.pscan_mode        = 0x00;
+		memcpy(tmp.dev_class, &info->dev_class, 3);
+		tmp.clock_offset      = info->clock_offset;
+		info++;
+		inquiry_cache_update(hdev, &tmp);
+	}
+	hci_dev_unlock(hdev);
+}
+
 /* Connect Request */
 static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
 {
@@ -742,6 +765,10 @@
 
 	case HCI_EV_INQUIRY_RESULT:
 		hci_inquiry_result_evt(hdev, skb);
+		break;
+
+	case HCI_EV_INQUIRY_RESULT_WITH_RSSI:
+		hci_inquiry_result_with_rssi_evt(hdev, skb);
 		break;
 
 	case HCI_EV_CONN_REQUEST:
diff -Nru a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
--- a/net/bluetooth/hci_sock.c	Tue Feb  3 19:45:29 2004
+++ b/net/bluetooth/hci_sock.c	Tue Feb  3 19:45:29 2004
@@ -66,20 +66,20 @@
 	/* Packet types */
 	0x10,
 	/* Events */
-	{ 0xd9fe, 0x0 },
+	{ 0x1000d9fe, 0x0000300c },
 	/* Commands */
 	{
 		{ 0x0 },
 		/* OGF_LINK_CTL */
-		{ 0x2a000002, 0x0, 0x0, 0x0  },
+		{ 0xbe000006, 0x00000001, 0x0000, 0x00 },
 		/* OGF_LINK_POLICY */
-		{ 0x1200, 0x0, 0x0, 0x0      },
+		{ 0x00005200, 0x00000000, 0x0000, 0x00 },
 		/* OGF_HOST_CTL */
-		{ 0x80100000, 0x202a, 0x0, 0x0 },
+		{ 0xaab00200, 0x2b402aaa, 0x0154, 0x00 },
 		/* OGF_INFO_PARAM */
-		{ 0x22a, 0x0, 0x0, 0x0       },
+		{ 0x000002be, 0x00000000, 0x0000, 0x00 },
 		/* OGF_STATUS_PARAM */
-		{ 0x2e, 0x0, 0x0, 0x0        }
+		{ 0x000000ea, 0x00000000, 0x0000, 0x00 }
 	}
 };
 
@@ -319,7 +319,8 @@
         	put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, sizeof(skb->stamp), &skb->stamp);
 }
  
-static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, int len, int flags)
+static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock, 
+			    struct msghdr *msg, size_t len, int flags)
 {
 	int noblock = flags & MSG_DONTWAIT;
 	struct sock *sk = sock->sk;
@@ -355,7 +356,8 @@
 	return err ? : copied;
 }
 
-static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, int len)
+static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock, 
+			    struct msghdr *msg, size_t len)
 {
 	struct sock *sk = sock->sk;
 	struct hci_dev *hdev;
@@ -370,9 +372,9 @@
 	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_NOSIGNAL|MSG_ERRQUEUE))
 		return -EINVAL;
 
-	if (len < 4)
+	if (len < 4 || len > HCI_MAX_FRAME_SIZE)
 		return -EINVAL;
-	
+
 	lock_sock(sk);
 
 	if (!(hdev = hci_pi(sk)->hdev)) {
diff -Nru a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
--- a/net/bluetooth/l2cap.c	Tue Feb  3 19:45:34 2004
+++ b/net/bluetooth/l2cap.c	Tue Feb  3 19:45:34 2004
@@ -706,7 +706,8 @@
 	return err;
 }
 
-static int l2cap_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, int len)
+static int l2cap_sock_sendmsg(struct kiocb *iocb, struct socket *sock, 
+			      struct msghdr *msg, size_t len)
 {
 	struct sock *sk = sock->sk;
 	int err = 0;
@@ -2201,3 +2202,4 @@
 MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
 MODULE_DESCRIPTION("Bluetooth L2CAP ver " VERSION);
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("bt-proto-0");
diff -Nru a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
--- a/net/bluetooth/rfcomm/core.c	Tue Feb  3 19:45:16 2004
+++ b/net/bluetooth/rfcomm/core.c	Tue Feb  3 19:45:16 2004
@@ -52,7 +52,7 @@
 #include <net/bluetooth/l2cap.h>
 #include <net/bluetooth/rfcomm.h>
 
-#define VERSION "1.0"
+#define VERSION "1.1"
 
 #ifndef CONFIG_BT_RFCOMM_DEBUG
 #undef  BT_DBG
@@ -207,7 +207,7 @@
 	d->mtu        = RFCOMM_DEFAULT_MTU;
 	d->v24_sig    = RFCOMM_V24_RTC | RFCOMM_V24_RTR | RFCOMM_V24_DV;
 
-	d->credits    = RFCOMM_MAX_CREDITS;
+	d->cfc        = RFCOMM_CFC_DISABLED;
 	d->rx_credits = RFCOMM_DEFAULT_CREDITS;
 }
 
@@ -314,8 +314,8 @@
 	d->state    = BT_CONFIG;
 	rfcomm_dlc_link(s, d);
 
-	d->mtu     = s->mtu;
-	d->credits = s->credits;
+	d->mtu = s->mtu;
+	d->cfc = (s->cfc == RFCOMM_CFC_UNKNOWN) ? 0 : s->cfc;
 
 	if (s->state == BT_CONNECTED)
 		rfcomm_send_pn(s, 1, d);
@@ -415,7 +415,7 @@
 {
 	BT_DBG("dlc %p state %ld", d, d->state);
 
-	if (!d->credits) {
+	if (!d->cfc) {
 		d->v24_sig |= RFCOMM_V24_FC;
 		set_bit(RFCOMM_MSC_PENDING, &d->flags);
 	}
@@ -426,7 +426,7 @@
 {
 	BT_DBG("dlc %p state %ld", d, d->state);
 
-	if (!d->credits) {
+	if (!d->cfc) {
 		d->v24_sig &= ~RFCOMM_V24_FC;
 		set_bit(RFCOMM_MSC_PENDING, &d->flags);
 	}
@@ -479,8 +479,8 @@
 	s->state = state;
 	s->sock  = sock;
 
-	s->mtu     = RFCOMM_DEFAULT_MTU;
-	s->credits = RFCOMM_MAX_CREDITS;
+	s->mtu   = RFCOMM_DEFAULT_MTU;
+	s->cfc   = RFCOMM_CFC_UNKNOWN;
 	
 	list_add(&s->list, &session_list);
 
@@ -752,7 +752,7 @@
 	pn->ack_timer   = 0;
 	pn->max_retrans = 0;
 
-	if (d->credits) {
+	if (s->cfc) {
 		pn->flow_ctrl = cr ? 0xf0 : 0xe0;
 		pn->credits = RFCOMM_DEFAULT_CREDITS;
 	} else {
@@ -1142,28 +1142,22 @@
 
 static int rfcomm_apply_pn(struct rfcomm_dlc *d, int cr, struct rfcomm_pn *pn)
 {
+	struct rfcomm_session *s = d->session;
+
 	BT_DBG("dlc %p state %ld dlci %d mtu %d fc 0x%x credits %d", 
 			d, d->state, d->dlci, pn->mtu, pn->flow_ctrl, pn->credits);
 
-	if (cr) {
-		if (pn->flow_ctrl == 0xf0) {
-			d->tx_credits = pn->credits;
-		} else {
-			set_bit(RFCOMM_TX_THROTTLED, &d->flags);
-			d->credits = 0;
-		}
+	if (pn->flow_ctrl == 0xf0 || pn->flow_ctrl == 0xe0) {
+		d->cfc = s->cfc = RFCOMM_CFC_ENABLED;
+		d->tx_credits = pn->credits;
 	} else {
-		if (pn->flow_ctrl == 0xe0) {
-			d->tx_credits = pn->credits;
-		} else {
-			set_bit(RFCOMM_TX_THROTTLED, &d->flags);
-			d->credits = 0;
-		}
+		d->cfc = s->cfc = RFCOMM_CFC_DISABLED;
+		set_bit(RFCOMM_TX_THROTTLED, &d->flags);
 	}
 
 	d->priority = pn->priority;
 
-	d->mtu = btohs(pn->mtu);
+	d->mtu = s->mtu = btohs(pn->mtu);
 
 	return 0;
 }
@@ -1353,7 +1347,7 @@
 		return 0;
 
 	if (cr) {
-		if (msc->v24_sig & RFCOMM_V24_FC && !d->credits)
+		if (msc->v24_sig & RFCOMM_V24_FC && !d->cfc)
 			set_bit(RFCOMM_TX_THROTTLED, &d->flags);
 		else
 			clear_bit(RFCOMM_TX_THROTTLED, &d->flags);
@@ -1444,7 +1438,7 @@
 		goto drop;
 	}
 
-	if (pf && d->credits) {
+	if (pf && d->cfc) {
 		u8 credits = *(u8 *) skb->data; skb_pull(skb, 1);
 
 		d->tx_credits += credits;
@@ -1549,20 +1543,20 @@
 	struct sk_buff *skb;
 	int err;
 
-	BT_DBG("dlc %p state %ld credits %d rx_credits %d tx_credits %d", 
-			d, d->state, d->credits, d->rx_credits, d->tx_credits);
+	BT_DBG("dlc %p state %ld cfc %d rx_credits %d tx_credits %d", 
+			d, d->state, d->cfc, d->rx_credits, d->tx_credits);
 
 	/* Send pending MSC */
 	if (test_and_clear_bit(RFCOMM_MSC_PENDING, &d->flags))
 		rfcomm_send_msc(d->session, 1, d->dlci, d->v24_sig); 
 	
-	if (d->credits) {
+	if (d->cfc) {
 		/* CFC enabled. 
 		 * Give them some credits */
 		if (!test_bit(RFCOMM_RX_THROTTLED, &d->flags) &&
-			       	d->rx_credits <= (d->credits >> 2)) {
-			rfcomm_send_credits(d->session, d->addr, d->credits - d->rx_credits);
-			d->rx_credits = d->credits;
+			       	d->rx_credits <= (d->cfc >> 2)) {
+			rfcomm_send_credits(d->session, d->addr, d->cfc - d->rx_credits);
+			d->rx_credits = d->cfc;
 		}
 	} else {
 		/* CFC disabled.
@@ -1583,7 +1577,7 @@
 		d->tx_credits--;
 	}
 
-	if (d->credits && !d->tx_credits) {
+	if (d->cfc && !d->tx_credits) {
 		/* We're out of TX credits.
 		 * Set TX_THROTTLED flag to avoid unnesary wakeups by dlc_send. */
 		set_bit(RFCOMM_TX_THROTTLED, &d->flags);
@@ -1655,7 +1649,9 @@
 
 	nsock->type = sock->type;
 	nsock->ops  = sock->ops;
-	
+
+	__module_get(nsock->ops->owner);
+
 	err = sock->ops->accept(sock, nsock, O_NONBLOCK);
 	if (err < 0) {
 		sock_release(nsock);
@@ -1998,3 +1994,4 @@
 MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>, Marcel Holtmann <marcel@holtmann.org>");
 MODULE_DESCRIPTION("Bluetooth RFCOMM ver " VERSION);
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("bt-proto-3");
diff -Nru a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
--- a/net/bluetooth/rfcomm/sock.c	Tue Feb  3 19:45:30 2004
+++ b/net/bluetooth/rfcomm/sock.c	Tue Feb  3 19:45:30 2004
@@ -482,12 +482,12 @@
 }
 
 static int rfcomm_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
-			       struct msghdr *msg, int len)
+			       struct msghdr *msg, size_t len)
 {
 	struct sock *sk = sock->sk;
 	struct rfcomm_dlc *d = rfcomm_pi(sk)->dlc;
 	struct sk_buff *skb;
-	int err, size;
+	int err;
 	int sent = 0;
 
 	if (msg->msg_flags & MSG_OOB)
@@ -501,7 +501,7 @@
 	lock_sock(sk);
 
 	while (len) {
-		size = min_t(uint, len, d->mtu);
+		size_t size = min(len, d->mtu);
 		
 		skb = sock_alloc_send_skb(sk, size + RFCOMM_SKB_RESERVE,
 				msg->msg_flags & MSG_DONTWAIT, &err);
@@ -556,10 +556,11 @@
 }
 
 static int rfcomm_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
-			       struct msghdr *msg, int size, int flags)
+			       struct msghdr *msg, size_t size, int flags)
 {
 	struct sock *sk = sock->sk;
-	int target, err = 0, copied = 0;
+	int err = 0;
+	size_t target, copied = 0;
 	long timeo;
 
 	if (flags & MSG_OOB)
diff -Nru a/net/bluetooth/sco.c b/net/bluetooth/sco.c
--- a/net/bluetooth/sco.c	Tue Feb  3 19:45:17 2004
+++ b/net/bluetooth/sco.c	Tue Feb  3 19:45:17 2004
@@ -630,7 +630,8 @@
 	return 0;
 }
 
-static int sco_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, int len)
+static int sco_sock_sendmsg(struct kiocb *iocb, struct socket *sock, 
+			    struct msghdr *msg, size_t len)
 {
 	struct sock *sk = sock->sk;
 	int err = 0;
@@ -1054,3 +1055,4 @@
 MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
 MODULE_DESCRIPTION("Bluetooth SCO ver " VERSION);
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("bt-proto-2");
diff -Nru a/net/bridge/br_if.c b/net/bridge/br_if.c
--- a/net/bridge/br_if.c	Tue Feb  3 19:45:43 2004
+++ b/net/bridge/br_if.c	Tue Feb  3 19:45:43 2004
@@ -252,12 +252,12 @@
 	struct net_device *dev;
 	int i = 0;
 
-	rtnl_shlock();
+	read_lock(&dev_base_lock);
 	for (dev = dev_base; dev && i < num; dev = dev->next) {
 		if (dev->priv_flags & IFF_EBRIDGE) 
 			indices[i++] = dev->ifindex;
 	}
-	rtnl_shunlock();
+	read_unlock(&dev_base_lock);
 
 	return i;
 }
diff -Nru a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
--- a/net/bridge/br_netfilter.c	Tue Feb  3 19:45:42 2004
+++ b/net/bridge/br_netfilter.c	Tue Feb  3 19:45:42 2004
@@ -435,8 +435,10 @@
 	struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet);
 	struct net_device **d = (struct net_device **)(skb->cb);
 
+#ifdef CONFIG_SYSCTL
 	if (!brnf_call_arptables)
 		return NF_ACCEPT;
+#endif
 
 	if (skb->protocol != __constant_htons(ETH_P_ARP)) {
 		if (!IS_VLAN_ARP)
diff -Nru a/net/core/dev.c b/net/core/dev.c
--- a/net/core/dev.c	Tue Feb  3 19:45:26 2004
+++ b/net/core/dev.c	Tue Feb  3 19:45:26 2004
@@ -621,6 +621,21 @@
 }
 
 /**
+ *	dev_valid_name - check if name is okay for network device
+ *	@name: name string
+ *
+ *	Network device names need to be valid file names to
+ *	to allow sysfs to work
+ */
+int dev_valid_name(const char *name)
+{
+	return !(*name == '\0' 
+		 || !strcmp(name, ".")
+		 || !strcmp(name, "..")
+		 || strchr(name, '/'));
+}
+
+/**
  *	dev_alloc_name - allocate a name for a device
  *	@dev: device
  *	@name: name format string
@@ -660,6 +675,41 @@
 	return -ENFILE;	/* Over 100 of the things .. bail out! */
 }
 
+
+/**
+ *	dev_change_name - change name of a device
+ *	@dev: device
+ *	@name: name (or format string) must be at least IFNAMSIZ
+ *
+ *	Change name of a device, can pass format strings "eth%d".
+ *	for wildcarding.
+ */
+int dev_change_name(struct net_device *dev, char *newname)
+{
+	ASSERT_RTNL();
+
+	if (dev->flags & IFF_UP)
+		return -EBUSY;
+
+	if (!dev_valid_name(newname))
+		return -EINVAL;
+
+	if (strchr(newname, '%')) {
+		int err = dev_alloc_name(dev, newname);
+		if (err < 0)
+			return err;
+		strcpy(newname, dev->name);
+	}
+	else if (__dev_get_by_name(newname))
+		return -EEXIST;
+	else
+		strlcpy(dev->name, newname, IFNAMSIZ);
+
+	class_device_rename(&dev->class_dev, dev->name);
+	notifier_call_chain(&netdev_chain, NETDEV_CHANGENAME, dev);
+	return 0;
+}
+
 /**
  *	dev_alloc - allocate a network device and name
  *	@name: name format string
@@ -946,11 +996,29 @@
  *	The notifier passed is linked into the kernel structures and must
  *	not be reused until it has been unregistered. A negative errno code
  *	is returned on a failure.
+ *
+ * 	When registered all registration and up events are replayed
+ *	to the new notifier to allow device to have a race free 
+ *	view of the network device list.
  */
 
 int register_netdevice_notifier(struct notifier_block *nb)
 {
-	return notifier_chain_register(&netdev_chain, nb);
+	struct net_device *dev;
+	int err;
+
+	rtnl_lock();
+	err = notifier_chain_register(&netdev_chain, nb);
+	if (!err) {
+		for (dev = dev_base; dev; dev = dev->next) {
+			nb->notifier_call(nb, NETDEV_REGISTER, dev);
+
+			if (dev->flags & IFF_UP) 
+				nb->notifier_call(nb, NETDEV_UP, dev);
+		}
+	}
+	rtnl_unlock();
+	return err;
 }
 
 /**
@@ -2341,20 +2409,8 @@
 			return 0;
 
 		case SIOCSIFNAME:
-			if (dev->flags & IFF_UP)
-				return -EBUSY;
 			ifr->ifr_newname[IFNAMSIZ-1] = '\0';
-			if (__dev_get_by_name(ifr->ifr_newname))
-				return -EEXIST;
-			err = class_device_rename(&dev->class_dev, 
-						  ifr->ifr_newname);
-			if (!err) {
-				strlcpy(dev->name, ifr->ifr_newname, IFNAMSIZ);
-
-				notifier_call_chain(&netdev_chain,
-						    NETDEV_CHANGENAME, dev);
-			}
-			return err;
+			return dev_change_name(dev, ifr->ifr_newname);
 
 		/*
 		 *	Unknown or private ioctl
@@ -2487,6 +2543,7 @@
 		 */
 		case SIOCGMIIPHY:
 		case SIOCGMIIREG:
+		case SIOCSIFNAME:
 			if (!capable(CAP_NET_ADMIN))
 				return -EPERM;
 			dev_load(ifr.ifr_name);
@@ -2518,7 +2575,6 @@
 		case SIOCDELMULTI:
 		case SIOCSIFHWBROADCAST:
 		case SIOCSIFTXQLEN:
-		case SIOCSIFNAME:
 		case SIOCSMIIREG:
 		case SIOCBONDENSLAVE:
 		case SIOCBONDRELEASE:
@@ -2667,6 +2723,11 @@
 				ret = -EIO;
 			goto out_err;
 		}
+	}
+ 
+	if (!dev_valid_name(dev->name)) {
+		ret = -EINVAL;
+		goto out_err;
 	}
 
 	dev->ifindex = dev_new_index();
diff -Nru a/net/core/dev_mcast.c b/net/core/dev_mcast.c
--- a/net/core/dev_mcast.c	Tue Feb  3 19:45:17 2004
+++ b/net/core/dev_mcast.c	Tue Feb  3 19:45:17 2004
@@ -41,6 +41,7 @@
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 #include <linux/init.h>
 #include <net/ip.h>
 #include <net/route.h>
@@ -219,59 +220,78 @@
 }
 
 #ifdef CONFIG_PROC_FS
-static int dev_mc_read_proc(char *buffer, char **start, off_t offset,
-			    int length, int *eof, void *data)
+static void *dev_mc_seq_start(struct seq_file *seq, loff_t *pos)
 {
-	off_t pos = 0, begin = 0;
-	struct dev_mc_list *m;
-	int len = 0;
 	struct net_device *dev;
+	loff_t off = 0;
 
 	read_lock(&dev_base_lock);
 	for (dev = dev_base; dev; dev = dev->next) {
-		spin_lock_bh(&dev->xmit_lock);
-		for (m = dev->mc_list; m; m = m->next) {
-			int i;
-
-			len += sprintf(buffer+len,"%-4d %-15s %-5d %-5d ", dev->ifindex,
-				       dev->name, m->dmi_users, m->dmi_gusers);
-
-			for (i = 0; i < m->dmi_addrlen; i++)
-				len += sprintf(buffer+len, "%02x", m->dmi_addr[i]);
-
-			len += sprintf(buffer+len, "\n");
-
-			pos = begin + len;
-			if (pos < offset) {
-				len = 0;
-				begin = pos;
-			}
-			if (pos > offset + length) {
-				spin_unlock_bh(&dev->xmit_lock);
-				goto done;
-			}
-		}
-		spin_unlock_bh(&dev->xmit_lock);
+		if (off++ == *pos) 
+			return dev;
 	}
-	*eof = 1;
+	return NULL;
+}
 
-done:
+static void *dev_mc_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+	struct net_device *dev = v;
+	++*pos;
+	return dev->next;
+}
+
+static void dev_mc_seq_stop(struct seq_file *seq, void *v)
+{
 	read_unlock(&dev_base_lock);
-	*start = buffer + (offset - begin);
-	len -= (offset - begin);
-	if (len > length)
-		len = length;
-	if (len < 0)
-		len = 0;
-	return len;
 }
+
+
+static int dev_mc_seq_show(struct seq_file *seq, void *v)
+{
+	struct dev_mc_list *m;
+	struct net_device *dev = v;
+
+	spin_lock_bh(&dev->xmit_lock);
+	for (m = dev->mc_list; m; m = m->next) {
+		int i;
+
+		seq_printf(seq, "%-4d %-15s %-5d %-5d ", dev->ifindex,
+			   dev->name, m->dmi_users, m->dmi_gusers);
+
+		for (i = 0; i < m->dmi_addrlen; i++)
+			seq_printf(seq, "%02x", m->dmi_addr[i]);
+
+		seq_putc(seq, '\n');
+	}
+	spin_unlock_bh(&dev->xmit_lock);
+	return 0;
+}
+
+static struct seq_operations dev_mc_seq_ops = {
+	.start = dev_mc_seq_start,
+	.next  = dev_mc_seq_next,
+	.stop  = dev_mc_seq_stop,
+	.show  = dev_mc_seq_show,
+};
+
+static int dev_mc_seq_open(struct inode *inode, struct file *file)
+{
+	return seq_open(file, &dev_mc_seq_ops);
+}
+
+static struct file_operations dev_mc_seq_fops = {
+	.owner	 = THIS_MODULE,
+	.open    = dev_mc_seq_open,
+	.read    = seq_read,
+	.llseek  = seq_lseek,
+	.release = seq_release,
+};
+
 #endif
 
 void __init dev_mcast_init(void)
 {
-#ifdef CONFIG_PROC_FS
-	create_proc_read_entry("net/dev_mcast", 0, 0, dev_mc_read_proc, NULL);
-#endif
+	proc_net_fops_create("dev_mcast", 0, &dev_mc_seq_fops);
 }
 
 EXPORT_SYMBOL(dev_mc_add);
diff -Nru a/net/core/dst.c b/net/core/dst.c
--- a/net/core/dst.c	Tue Feb  3 19:45:30 2004
+++ b/net/core/dst.c	Tue Feb  3 19:45:30 2004
@@ -40,7 +40,7 @@
 static void ___dst_free(struct dst_entry * dst);
 
 static struct timer_list dst_gc_timer =
-	TIMER_INITIALIZER(dst_run_gc, 0, DST_GC_MIN);
+	TIMER_INITIALIZER(dst_run_gc, DST_GC_MIN, 0);
 
 static void dst_run_gc(unsigned long dummy)
 {
diff -Nru a/net/core/flow.c b/net/core/flow.c
--- a/net/core/flow.c	Tue Feb  3 19:45:16 2004
+++ b/net/core/flow.c	Tue Feb  3 19:45:16 2004
@@ -66,24 +66,18 @@
 
 struct flow_flush_info {
 	atomic_t cpuleft;
-	cpumask_t cpumap;
 	struct completion completion;
 };
 static DEFINE_PER_CPU(struct tasklet_struct, flow_flush_tasklets) = { NULL };
 
 #define flow_flush_tasklet(cpu) (&per_cpu(flow_flush_tasklets, cpu))
 
-static DECLARE_MUTEX(flow_cache_cpu_sem);
-static cpumask_t flow_cache_cpu_map;
-static unsigned int flow_cache_cpu_count;
-
 static void flow_cache_new_hashrnd(unsigned long arg)
 {
 	int i;
 
-	for (i = 0; i < NR_CPUS; i++)
-		if (cpu_isset(i, flow_cache_cpu_map))
-			flow_hash_rnd_recalc(i) = 1;
+	for_each_cpu(i)
+		flow_hash_rnd_recalc(i) = 1;
 
 	flow_hash_rnd_timer.expires = jiffies + FLOW_HASH_RND_PERIOD;
 	add_timer(&flow_hash_rnd_timer);
@@ -179,7 +173,9 @@
 	cpu = smp_processor_id();
 
 	fle = NULL;
-	if (!cpu_isset(cpu, flow_cache_cpu_map))
+	/* Packet really early in init?  Making flow_cache_init a
+	 * pre-smp initcall would solve this.  --RR */
+	if (!flow_table(cpu))
 		goto nocache;
 
 	if (flow_hash_rnd_recalc(cpu))
@@ -278,8 +274,6 @@
 	struct tasklet_struct *tasklet;
 
 	cpu = smp_processor_id();
-	if (!cpu_isset(cpu, info->cpumap))
-		return;
 
 	tasklet = flow_flush_tasklet(cpu);
 	tasklet->data = (unsigned long)info;
@@ -289,29 +283,23 @@
 void flow_cache_flush(void)
 {
 	struct flow_flush_info info;
-	static DECLARE_MUTEX(flow_flush_sem);
-
-	down(&flow_cache_cpu_sem);
-	info.cpumap = flow_cache_cpu_map;
-	atomic_set(&info.cpuleft, flow_cache_cpu_count);
-	up(&flow_cache_cpu_sem);
 
+	/* Don't want cpus going down or up during this, also protects
+	 * against multiple callers. */
+	lock_cpu_hotplug();
+	atomic_set(&info.cpuleft, num_online_cpus());
 	init_completion(&info.completion);
 
-	down(&flow_flush_sem);
-
 	local_bh_disable();
 	smp_call_function(flow_cache_flush_per_cpu, &info, 1, 0);
-	if (cpu_isset(smp_processor_id(), info.cpumap))
-		flow_cache_flush_tasklet((unsigned long)&info);
+	flow_cache_flush_tasklet((unsigned long)&info);
 	local_bh_enable();
 
 	wait_for_completion(&info.completion);
-
-	up(&flow_flush_sem);
+	unlock_cpu_hotplug();
 }
 
-static int __devinit flow_cache_cpu_prepare(int cpu)
+static void __devinit flow_cache_cpu_prepare(int cpu)
 {
 	struct tasklet_struct *tasklet;
 	unsigned long order;
@@ -324,9 +312,8 @@
 
 	flow_table(cpu) = (struct flow_cache_entry **)
 		__get_free_pages(GFP_KERNEL, order);
-
 	if (!flow_table(cpu))
-		return NOTIFY_BAD;
+		panic("NET: failed to allocate flow cache order %lu\n", order);
 
 	memset(flow_table(cpu), 0, PAGE_SIZE << order);
 
@@ -335,39 +322,8 @@
 
 	tasklet = flow_flush_tasklet(cpu);
 	tasklet_init(tasklet, flow_cache_flush_tasklet, 0);
-
-	return NOTIFY_OK;
-}
-
-static int __devinit flow_cache_cpu_online(int cpu)
-{
-	down(&flow_cache_cpu_sem);
-	cpu_set(cpu, flow_cache_cpu_map);
-	flow_cache_cpu_count++;
-	up(&flow_cache_cpu_sem);
-
-	return NOTIFY_OK;
 }
 
-static int __devinit flow_cache_cpu_notify(struct notifier_block *self,
-					   unsigned long action, void *hcpu)
-{
-	unsigned long cpu = (unsigned long)cpu;
-	switch (action) {
-	case CPU_UP_PREPARE:
-		return flow_cache_cpu_prepare(cpu);
-		break;
-	case CPU_ONLINE:
-		return flow_cache_cpu_online(cpu);
-		break;
-	}
-	return NOTIFY_OK;
-}
-
-static struct notifier_block __devinitdata flow_cache_cpu_nb = {
-	.notifier_call = flow_cache_cpu_notify,
-};
-
 static int __init flow_cache_init(void)
 {
 	int i;
@@ -389,15 +345,8 @@
 	flow_hash_rnd_timer.expires = jiffies + FLOW_HASH_RND_PERIOD;
 	add_timer(&flow_hash_rnd_timer);
 
-	register_cpu_notifier(&flow_cache_cpu_nb);
-	for (i = 0; i < NR_CPUS; i++) {
-		if (!cpu_online(i))
-			continue;
-		if (flow_cache_cpu_prepare(i) == NOTIFY_OK &&
-		    flow_cache_cpu_online(i) == NOTIFY_OK)
-			continue;
-		panic("NET: failed to initialise flow cache hash table\n");
-	}
+	for_each_cpu(i)
+		flow_cache_cpu_prepare(i);
 
 	return 0;
 }
diff -Nru a/net/core/neighbour.c b/net/core/neighbour.c
--- a/net/core/neighbour.c	Tue Feb  3 19:45:16 2004
+++ b/net/core/neighbour.c	Tue Feb  3 19:45:16 2004
@@ -24,6 +24,7 @@
 #ifdef CONFIG_SYSCTL
 #include <linux/sysctl.h>
 #endif
+#include <linux/times.h>
 #include <net/neighbour.h>
 #include <net/dst.h>
 #include <net/sock.h>
@@ -1510,7 +1511,7 @@
 			.procname	= "retrans_time",
 			.maxlen		= sizeof(int),
 			.mode		= 0644,
-			.proc_handler	= &proc_dointvec,
+			.proc_handler	= &proc_dointvec_userhz_jiffies,
 		},
 		{
 			.ctl_name	= NET_NEIGH_REACHABLE_TIME,
@@ -1555,21 +1556,21 @@
 			.procname	= "anycast_delay",
 			.maxlen		= sizeof(int),
 			.mode		= 0644,
-			.proc_handler	= &proc_dointvec,
+			.proc_handler	= &proc_dointvec_userhz_jiffies,
 		},
 		{
 			.ctl_name	= NET_NEIGH_PROXY_DELAY,
 			.procname	= "proxy_delay",
 			.maxlen		= sizeof(int),
 			.mode		= 0644,
-			.proc_handler	= &proc_dointvec,
+			.proc_handler	= &proc_dointvec_userhz_jiffies,
 		},
 		{
 			.ctl_name	= NET_NEIGH_LOCKTIME,
 			.procname	= "locktime",
 			.maxlen		= sizeof(int),
 			.mode		= 0644,
-			.proc_handler	= &proc_dointvec,
+			.proc_handler	= &proc_dointvec_userhz_jiffies,
 		},
 		{
 			.ctl_name	= NET_NEIGH_GC_INTERVAL,
@@ -1629,7 +1630,8 @@
 };
 
 int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
-			  int p_id, int pdev_id, char *p_name)
+			  int p_id, int pdev_id, char *p_name, 
+			  proc_handler *handler)
 {
 	struct neigh_sysctl_table *t = kmalloc(sizeof(*t), GFP_KERNEL);
 	const char *dev_name_source = NULL;
@@ -1643,6 +1645,10 @@
 	t->neigh_vars[1].data  = &p->ucast_probes;
 	t->neigh_vars[2].data  = &p->app_probes;
 	t->neigh_vars[3].data  = &p->retrans_time;
+	if (handler) {
+		t->neigh_vars[3].proc_handler = handler;
+		t->neigh_vars[3].extra1 = dev;
+	}
 	t->neigh_vars[4].data  = &p->base_reachable_time;
 	t->neigh_vars[5].data  = &p->delay_probe_time;
 	t->neigh_vars[6].data  = &p->gc_staletime;
diff -Nru a/net/core/pktgen.c b/net/core/pktgen.c
--- a/net/core/pktgen.c	Tue Feb  3 19:45:34 2004
+++ b/net/core/pktgen.c	Tue Feb  3 19:45:34 2004
@@ -88,7 +88,7 @@
 #define cycles()	((u32)get_cycles())
 
 
-#define VERSION "pktgen version 1.3"
+#define VERSION "pktgen version 1.31"
 static char version[] __initdata = 
   "pktgen.c: v1.3: Packet Generator for packet performance testing.\n";
 
@@ -720,8 +720,18 @@
 
 	{
 		char *p = info->result;
-		__u64 pps = (__u32)(info->sofar * 1000) / ((__u32)(total) / 1000);
-		__u64 bps = pps * 8 * (info->pkt_size + 4); /* take 32bit ethernet CRC into account */
+		__u64 bps, pps = 0;
+
+		if (total > 1000)
+			pps = (__u32)(info->sofar * 1000) / ((__u32)(total) / 1000);
+		else if(total > 100)
+			pps = (__u32)(info->sofar * 10000) / ((__u32)(total) / 100);
+		else if(total > 10)
+			pps = (__u32)(info->sofar * 100000) / ((__u32)(total) / 10);
+		else if(total > 1)
+			pps = (__u32)(info->sofar * 1000000) / (__u32)total;
+
+		bps = pps * 8 * (info->pkt_size + 4); /* take 32bit ethernet CRC into account */
 		p += sprintf(p, "OK: %llu(c%llu+d%llu) usec, %llu (%dbyte,%dfrags) %llupps %lluMb/sec (%llubps)  errors: %llu",
 			     (unsigned long long) total,
 			     (unsigned long long) (total - idle),
diff -Nru a/net/core/sock.c b/net/core/sock.c
--- a/net/core/sock.c	Tue Feb  3 19:45:34 2004
+++ b/net/core/sock.c	Tue Feb  3 19:45:34 2004
@@ -564,6 +564,9 @@
 			v.val = sk->sk_state == TCP_LISTEN;
 			break;
 
+		case SO_PEERSEC:
+			return security_socket_getpeersec(sock, optval, optlen, len);
+
 		default:
 			return(-ENOPROTOOPT);
 	}
@@ -606,6 +609,11 @@
 			sock_lock_init(sk);
 		}
 		sk->sk_slab = slab;
+		
+		if (security_sk_alloc(sk, family, priority)) {
+			kmem_cache_free(slab, sk);
+			sk = NULL;
+		}
 	}
 	return sk;
 }
@@ -628,6 +636,7 @@
 		printk(KERN_DEBUG "%s: optmem leakage (%d bytes) detected.\n",
 		       __FUNCTION__, atomic_read(&sk->sk_omem_alloc));
 
+	security_sk_free(sk);
 	kmem_cache_free(sk->sk_slab, sk);
 	module_put(owner);
 }
@@ -966,13 +975,13 @@
 }
 
 int sock_no_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m,
-		    int flags)
+		    size_t len)
 {
 	return -EOPNOTSUPP;
 }
 
 int sock_no_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m,
-		    int len, int flags)
+		    size_t len, int flags)
 {
 	return -EOPNOTSUPP;
 }
diff -Nru a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
--- a/net/decnet/af_decnet.c	Tue Feb  3 19:45:28 2004
+++ b/net/decnet/af_decnet.c	Tue Feb  3 19:45:28 2004
@@ -1659,13 +1659,13 @@
 
 
 static int dn_recvmsg(struct kiocb *iocb, struct socket *sock,
-	struct msghdr *msg, int size, int flags)
+	struct msghdr *msg, size_t size, int flags)
 {
 	struct sock *sk = sock->sk;
 	struct dn_scp *scp = DN_SK(sk);
 	struct sk_buff_head *queue = &sk->sk_receive_queue;
-	int target = size > 1 ? 1 : 0;
-	int copied = 0;
+	size_t target = size > 1 ? 1 : 0;
+	size_t copied = 0;
 	int rv = 0;
 	struct sk_buff *skb, *nskb;
 	struct dn_skb_cb *cb = NULL;
@@ -1746,7 +1746,7 @@
 	}
 
 	for(skb = queue->next; skb != (struct sk_buff *)queue; skb = nskb) {
-		int chunk = skb->len;
+		unsigned int chunk = skb->len;
 		cb = DN_SKB_CB(skb);
 
 		if ((chunk + copied) > size)
@@ -1888,20 +1888,20 @@
 }
 
 static int dn_sendmsg(struct kiocb *iocb, struct socket *sock,
-	   struct msghdr *msg, int size)
+	   struct msghdr *msg, size_t size)
 {
 	struct sock *sk = sock->sk;
 	struct dn_scp *scp = DN_SK(sk);
-	int mss;
+	size_t mss;
 	struct sk_buff_head *queue = &scp->data_xmit_queue;
 	int flags = msg->msg_flags;
 	int err = 0;
-	int sent = 0;
+	size_t sent = 0;
 	int addr_len = msg->msg_namelen;
 	struct sockaddr_dn *addr = (struct sockaddr_dn *)msg->msg_name;
 	struct sk_buff *skb = NULL;
 	struct dn_skb_cb *cb;
-	int len;
+	size_t len;
 	unsigned char fctype;
 	long timeo = sock_sndtimeo(sk, flags & MSG_DONTWAIT);
 
@@ -2363,17 +2363,16 @@
 	if (!dn_sk_cachep)
 		return -ENOMEM;
 
-	sock_register(&dn_family_ops);
-	dev_add_pack(&dn_dix_packet_type);
-	register_netdevice_notifier(&dn_dev_notifier);
-
-	proc_net_fops_create("decnet", S_IRUGO, &dn_socket_seq_fops);
-
 	dn_neigh_init();
 	dn_dev_init();
 	dn_route_init();
 	dn_fib_init();
 
+	sock_register(&dn_family_ops);
+	dev_add_pack(&dn_dix_packet_type);
+	register_netdevice_notifier(&dn_dev_notifier);
+
+	proc_net_fops_create("decnet", S_IRUGO, &dn_socket_seq_fops);
 	dn_register_sysctl();
 
 	return 0;
diff -Nru a/net/econet/af_econet.c b/net/econet/af_econet.c
--- a/net/econet/af_econet.c	Tue Feb  3 19:45:18 2004
+++ b/net/econet/af_econet.c	Tue Feb  3 19:45:18 2004
@@ -113,11 +113,12 @@
  */
 
 static int econet_recvmsg(struct kiocb *iocb, struct socket *sock,
-			  struct msghdr *msg, int len, int flags)
+			  struct msghdr *msg, size_t len, int flags)
 {
 	struct sock *sk = sock->sk;
 	struct sk_buff *skb;
-	int copied, err;
+	size_t copied;
+	int err;
 
 	msg->msg_namelen = sizeof(struct sockaddr_ec);
 
@@ -246,7 +247,7 @@
  */
 
 static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
-			  struct msghdr *msg, int len)
+			  struct msghdr *msg, size_t len)
 {
 	struct sock *sk = sock->sk;
 	struct sockaddr_ec *saddr=(struct sockaddr_ec *)msg->msg_name;
@@ -307,6 +308,9 @@
 		if (dev == NULL)
 			return -ENETDOWN;
 	}
+
+	if (len + 15 > dev->mtu)
+		return -EMSGSIZE;
 
 	if (dev->type == ARPHRD_ECONET)
 	{
diff -Nru a/net/ipv4/Kconfig b/net/ipv4/Kconfig
--- a/net/ipv4/Kconfig	Tue Feb  3 19:45:35 2004
+++ b/net/ipv4/Kconfig	Tue Feb  3 19:45:35 2004
@@ -90,7 +90,7 @@
 	  destination addresses of packets that pass through it, in a manner
 	  you specify.  General information about Network Address Translation
 	  can be gotten from the document
-	  <http://www.csn.tu-chemnitz.de/~mha/linux-ip-nat/diplom/nat.html>.
+	  <http://www.hasenstein.com/linux-ip-nat/diplom/nat.html>.
 
 config IP_ROUTE_MULTIPATH
 	bool "IP: equal cost multipath"
diff -Nru a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
--- a/net/ipv4/af_inet.c	Tue Feb  3 19:45:17 2004
+++ b/net/ipv4/af_inet.c	Tue Feb  3 19:45:17 2004
@@ -731,7 +731,7 @@
 
 
 int inet_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
-		 int size, int flags)
+		 size_t size, int flags)
 {
 	struct sock *sk = sock->sk;
 	int addr_len = 0;
@@ -746,7 +746,7 @@
 
 
 int inet_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
-		 int size)
+		 size_t size)
 {
 	struct sock *sk = sock->sk;
 
diff -Nru a/net/ipv4/ah4.c b/net/ipv4/ah4.c
--- a/net/ipv4/ah4.c	Tue Feb  3 19:45:42 2004
+++ b/net/ipv4/ah4.c	Tue Feb  3 19:45:42 2004
@@ -199,7 +199,7 @@
 			goto out;
 	}
         {
-		u8 auth_data[ahp->icv_trunc_len];
+		u8 auth_data[MAX_AH_AUTH_LEN];
 		
 		memcpy(auth_data, ah->auth_data, ahp->icv_trunc_len);
 		skb_push(skb, skb->data - skb->nh.raw);
@@ -284,6 +284,8 @@
 	
 	ahp->icv_full_len = aalg_desc->uinfo.auth.icv_fullbits/8;
 	ahp->icv_trunc_len = aalg_desc->uinfo.auth.icv_truncbits/8;
+	
+	BUG_ON(ahp->icv_trunc_len > MAX_AH_AUTH_LEN);
 	
 	ahp->work_icv = kmalloc(ahp->icv_full_len, GFP_KERNEL);
 	if (!ahp->work_icv)
diff -Nru a/net/ipv4/arp.c b/net/ipv4/arp.c
--- a/net/ipv4/arp.c	Tue Feb  3 19:45:41 2004
+++ b/net/ipv4/arp.c	Tue Feb  3 19:45:41 2004
@@ -1122,7 +1122,7 @@
 	arp_proc_init();
 #ifdef CONFIG_SYSCTL
 	neigh_sysctl_register(NULL, &arp_tbl.parms, NET_IPV4,
-			      NET_IPV4_NEIGH, "ipv4");
+			      NET_IPV4_NEIGH, "ipv4", NULL);
 #endif
 	register_netdevice_notifier(&arp_netdev_notifier);
 }
diff -Nru a/net/ipv4/devinet.c b/net/ipv4/devinet.c
--- a/net/ipv4/devinet.c	Tue Feb  3 19:45:17 2004
+++ b/net/ipv4/devinet.c	Tue Feb  3 19:45:17 2004
@@ -155,7 +155,7 @@
 	dev_hold(dev);
 #ifdef CONFIG_SYSCTL
 	neigh_sysctl_register(dev, in_dev->arp_parms, NET_IPV4,
-			      NET_IPV4_NEIGH, "ipv4");
+			      NET_IPV4_NEIGH, "ipv4", NULL);
 #endif
 	write_lock_bh(&inetdev_lock);
 	dev->ip_ptr = in_dev;
@@ -910,7 +910,7 @@
 		devinet_sysctl_unregister(&in_dev->cnf);
 		neigh_sysctl_unregister(in_dev->arp_parms);
 		neigh_sysctl_register(dev, in_dev->arp_parms, NET_IPV4,
-				      NET_IPV4_NEIGH, "ipv4");
+				      NET_IPV4_NEIGH, "ipv4", NULL);
 		devinet_sysctl_register(in_dev, &in_dev->cnf);
 #endif
 		break;
diff -Nru a/net/ipv4/igmp.c b/net/ipv4/igmp.c
--- a/net/ipv4/igmp.c	Tue Feb  3 19:45:42 2004
+++ b/net/ipv4/igmp.c	Tue Feb  3 19:45:42 2004
@@ -1749,11 +1749,10 @@
 			goto done;
 	} else if (pmc->sfmode != omode) {
 		/* allow mode switches for empty-set filters */
+		ip_mc_add_src(in_dev, &mreqs->imr_multiaddr, omode, 0, 0, 0);
 		ip_mc_del_src(in_dev, &mreqs->imr_multiaddr, pmc->sfmode, 0, 
 			0, 0);
 		pmc->sfmode = omode;
-		ip_mc_add_src(in_dev, &mreqs->imr_multiaddr, pmc->sfmode, 0, 
-			0, 0);
 	}
 
 	psl = pmc->sflist;
@@ -2085,16 +2084,19 @@
 	if (im && proto == IPPROTO_IGMP) {
 		rv = 1;
 	} else if (im) {
-		for (psf=im->sources; psf; psf=psf->sf_next) {
-			if (psf->sf_inaddr == src_addr)
-				break;
-		}
-		if (psf)
-			rv = psf->sf_count[MCAST_INCLUDE] ||
-				psf->sf_count[MCAST_EXCLUDE] !=
-				im->sfcount[MCAST_EXCLUDE];
-		else
-			rv = im->sfcount[MCAST_EXCLUDE] != 0;
+		if (src_addr) {
+			for (psf=im->sources; psf; psf=psf->sf_next) {
+				if (psf->sf_inaddr == src_addr)
+					break;
+			}
+			if (psf)
+				rv = psf->sf_count[MCAST_INCLUDE] ||
+					psf->sf_count[MCAST_EXCLUDE] !=
+					im->sfcount[MCAST_EXCLUDE];
+			else
+				rv = im->sfcount[MCAST_EXCLUDE] != 0;
+		} else
+			rv = 1; /* unspecified source; tentatively allow */
 	}
 	read_unlock(&in_dev->lock);
 	return rv;
diff -Nru a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
--- a/net/ipv4/ip_output.c	Tue Feb  3 19:45:42 2004
+++ b/net/ipv4/ip_output.c	Tue Feb  3 19:45:42 2004
@@ -414,6 +414,7 @@
 	to->nfmark = from->nfmark;
 	to->nfcache = from->nfcache;
 	/* Connection association is same as pre-frag packet */
+	nf_conntrack_put(to->nfct);
 	to->nfct = from->nfct;
 	nf_conntrack_get(to->nfct);
 #ifdef CONFIG_BRIDGE_NETFILTER
diff -Nru a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
--- a/net/ipv4/ipcomp.c	Tue Feb  3 19:45:41 2004
+++ b/net/ipv4/ipcomp.c	Tue Feb  3 19:45:41 2004
@@ -294,6 +294,7 @@
 	return t;
 
 error:
+	t->km.state = XFRM_STATE_DEAD;
 	xfrm_state_put(t);
 	t = NULL;
 	goto out;
diff -Nru a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
--- a/net/ipv4/ipmr.c	Tue Feb  3 19:45:18 2004
+++ b/net/ipv4/ipmr.c	Tue Feb  3 19:45:18 2004
@@ -205,6 +205,9 @@
 	dev = alloc_netdev(sizeof(struct net_device_stats), "pimreg",
 			   reg_vif_setup);
 
+	if (dev == NULL)
+		return NULL;
+
 	if (register_netdevice(dev)) {
 		kfree(dev);
 		return NULL;
diff -Nru a/net/ipv4/netfilter/Kconfig b/net/ipv4/netfilter/Kconfig
--- a/net/ipv4/netfilter/Kconfig	Tue Feb  3 19:45:41 2004
+++ b/net/ipv4/netfilter/Kconfig	Tue Feb  3 19:45:41 2004
@@ -529,10 +529,23 @@
 
 config IP_NF_ARPTABLES
 	tristate "ARP tables support"
+	help
+	  arptables is a general, extensible packet identification framework.
+	  The ARP packet filtering and mangling (manipulation)subsystems
+	  use this: say Y or M here if you want to use either of those.
+
+	  To compile it as a module, choose M here.  If unsure, say N.
 
 config IP_NF_ARPFILTER
 	tristate "ARP packet filtering"
 	depends on IP_NF_ARPTABLES
+	help
+	  ARP packet filtering defines a table `filter', which has a series of
+	  rules for simple ARP packet filtering at local input and
+	  local output.  On a bridge, you can also specify filtering rules
+	  for forwarded ARP packets. See the man page for arptables(8).
+
+	  To compile it as a module, choose M here.  If unsure, say N.
 
 config IP_NF_ARP_MANGLE
 	tristate "ARP payload mangling"
diff -Nru a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
--- a/net/ipv4/netfilter/ip_tables.c	Tue Feb  3 19:45:17 2004
+++ b/net/ipv4/netfilter/ip_tables.c	Tue Feb  3 19:45:17 2004
@@ -260,7 +260,7 @@
 	     struct ipt_table *table,
 	     void *userdata)
 {
-	static const char nulldevname[IFNAMSIZ];
+	static const char nulldevname[IFNAMSIZ] __attribute__((aligned(sizeof(long))));
 	u_int16_t offset;
 	struct iphdr *ip;
 	u_int16_t datalen;
diff -Nru a/net/ipv4/raw.c b/net/ipv4/raw.c
--- a/net/ipv4/raw.c	Tue Feb  3 19:45:29 2004
+++ b/net/ipv4/raw.c	Tue Feb  3 19:45:29 2004
@@ -324,7 +324,7 @@
 }
 
 static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
-		       int len)
+		       size_t len)
 {
 	struct inet_opt *inet = inet_sk(sk);
 	struct ipcm_cookie ipc;
@@ -335,17 +335,6 @@
 	u8  tos;
 	int err;
 
-	/* This check is ONLY to check for arithmetic overflow
-	   on integer(!) len. Not more! Real check will be made
-	   in ip_build_xmit --ANK
-
-	   BTW socket.c -> af_*.c -> ... make multiple
-	   invalid conversions size_t -> int. We MUST repair it f.e.
-	   by replacing all of them with size_t and revise all
-	   the places sort of len += sizeof(struct iphdr)
-	   If len was ULONG_MAX-10 it would be cathastrophe  --ANK
-	 */
-
 	err = -EMSGSIZE;
 	if (len < 0 || len > 0xFFFF)
 		goto out;
@@ -523,10 +512,10 @@
  */
 
 int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
-		int len, int noblock, int flags, int *addr_len)
+		size_t len, int noblock, int flags, int *addr_len)
 {
 	struct inet_opt *inet = inet_sk(sk);
-	int copied = 0;
+	size_t copied = 0;
 	int err = -EOPNOTSUPP;
 	struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name;
 	struct sk_buff *skb;
diff -Nru a/net/ipv4/route.c b/net/ipv4/route.c
--- a/net/ipv4/route.c	Tue Feb  3 19:45:43 2004
+++ b/net/ipv4/route.c	Tue Feb  3 19:45:43 2004
@@ -2703,11 +2703,8 @@
 		memcpy(dst, src, length);
 
 		/* Add the other cpus in, one int at a time */
-		for (i = 1; i < NR_CPUS; i++) {
+		for_each_cpu(i) {
 			unsigned int j;
-
-			if (!cpu_online(i))
-				continue;
 
 			src = ((u32 *) IP_RT_ACCT_CPU(i)) + offset;
 
diff -Nru a/net/ipv4/tcp.c b/net/ipv4/tcp.c
--- a/net/ipv4/tcp.c	Tue Feb  3 19:45:17 2004
+++ b/net/ipv4/tcp.c	Tue Feb  3 19:45:17 2004
@@ -1029,7 +1029,7 @@
 }
 
 int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
-		int size)
+		size_t size)
 {
 	struct iovec *iov;
 	struct tcp_opt *tp = tcp_sk(sk);
@@ -1498,7 +1498,7 @@
  */
 
 int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
-		int len, int nonblock, int flags, int *addr_len)
+		size_t len, int nonblock, int flags, int *addr_len)
 {
 	struct tcp_opt *tp = tcp_sk(sk);
 	int copied = 0;
diff -Nru a/net/ipv4/udp.c b/net/ipv4/udp.c
--- a/net/ipv4/udp.c	Tue Feb  3 19:45:17 2004
+++ b/net/ipv4/udp.c	Tue Feb  3 19:45:17 2004
@@ -478,7 +478,7 @@
 }
 
 int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
-		int len)
+		size_t len)
 {
 	struct inet_opt *inet = inet_sk(sk);
 	struct udp_opt *up = udp_sk(sk);
@@ -493,18 +493,7 @@
 	int err;
 	int corkreq = up->corkflag || msg->msg_flags&MSG_MORE;
 
-	/* This check is ONLY to check for arithmetic overflow
-	   on integer(!) len. Not more! Real check will be made
-	   in ip_append_* --ANK
-
-	   BTW socket.c -> af_*.c -> ... make multiple
-	   invalid conversions size_t -> int. We MUST repair it f.e.
-	   by replacing all of them with size_t and revise all
-	   the places sort of len += sizeof(struct iphdr)
-	   If len was ULONG_MAX-10 it would be cathastrophe  --ANK
-	 */
-
-	if (len < 0 || len > 0xFFFF)
+	if (len > 0xFFFF)
 		return -EMSGSIZE;
 
 	/* 
@@ -782,7 +771,7 @@
  */
 
 int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
-		int len, int noblock, int flags, int *addr_len)
+		size_t len, int noblock, int flags, int *addr_len)
 {
 	struct inet_opt *inet = inet_sk(sk);
   	struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name;
diff -Nru a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
--- a/net/ipv6/addrconf.c	Tue Feb  3 19:45:42 2004
+++ b/net/ipv6/addrconf.c	Tue Feb  3 19:45:42 2004
@@ -81,8 +81,6 @@
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 
-#define IPV6_MAX_ADDRESSES 16
-
 /* Set to 3 to get tracing... */
 #define ACONF_DEBUG 2
 
@@ -138,6 +136,8 @@
 static void addrconf_rs_timer(unsigned long data);
 static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa);
 
+static void inet6_prefix_notify(int event, struct inet6_dev *idev, 
+				struct prefix_info *pinfo);
 static int ipv6_chk_same_addr(const struct in6_addr *addr, struct net_device *dev);
 
 static struct notifier_block *inet6addr_chain;
@@ -160,6 +160,7 @@
 	.regen_max_retry	= REGEN_MAX_RETRY,
 	.max_desync_factor	= MAX_DESYNC_FACTOR,
 #endif
+	.max_addresses		= IPV6_MAX_ADDRESSES,
 };
 
 static struct ipv6_devconf ipv6_devconf_dflt = {
@@ -180,6 +181,7 @@
 	.regen_max_retry	= REGEN_MAX_RETRY,
 	.max_desync_factor	= MAX_DESYNC_FACTOR,
 #endif
+	.max_addresses		= IPV6_MAX_ADDRESSES,
 };
 
 /* IPv6 Wildcard Address and Loopback Address defined by RFC2553 */
@@ -373,9 +375,10 @@
 		write_unlock_bh(&addrconf_lock);
 
 		ipv6_mc_init_dev(ndev);
-
+		ndev->tstamp = jiffies;
 #ifdef CONFIG_SYSCTL
-		neigh_sysctl_register(dev, ndev->nd_parms, NET_IPV6, NET_IPV6_NEIGH, "ipv6");
+		neigh_sysctl_register(dev, ndev->nd_parms, NET_IPV6, 
+			NET_IPV6_NEIGH, "ipv6", &ndisc_ifinfo_sysctl_change);
 		addrconf_sysctl_register(ndev, &ndev->cnf);
 #endif
 	}
@@ -630,6 +633,7 @@
 	unsigned long tmp_prefered_lft, tmp_valid_lft;
 	int tmp_plen;
 	int ret = 0;
+	int max_addresses;
 
 	if (ift) {
 		spin_lock_bh(&ift->lock);
@@ -685,9 +689,11 @@
 				 ifp->prefered_lft, 
 				 idev->cnf.temp_prefered_lft - desync_factor / HZ);
 	tmp_plen = ifp->prefix_len;
+	max_addresses = idev->cnf.max_addresses;
 	write_unlock(&idev->lock);
 	spin_unlock_bh(&ifp->lock);
-	ift = ipv6_count_addresses(idev) < IPV6_MAX_ADDRESSES ?
+	ift = !max_addresses ||
+	      ipv6_count_addresses(idev) < max_addresses ? 
 		ipv6_add_addr(idev, &addr, tmp_plen,
 			      ipv6_addr_type(&addr)&IPV6_ADDR_SCOPE_MASK, IFA_F_TEMPORARY) : 0;
 	if (!ift || IS_ERR(ift)) {
@@ -904,7 +910,7 @@
 	return cnt;
 }
 
-int ipv6_chk_addr(struct in6_addr *addr, struct net_device *dev)
+int ipv6_chk_addr(struct in6_addr *addr, struct net_device *dev, int strict)
 {
 	struct inet6_ifaddr * ifp;
 	u8 hash = ipv6_addr_hash(addr);
@@ -914,7 +920,7 @@
 		if (ipv6_addr_cmp(&ifp->addr, addr) == 0 &&
 		    !(ifp->flags&IFA_F_TENTATIVE)) {
 			if (dev == NULL || ifp->idev->dev == dev ||
-			    !(ifp->scope&(IFA_LINK|IFA_HOST)))
+			    !(ifp->scope&(IFA_LINK|IFA_HOST) || strict))
 				break;
 		}
 	}
@@ -939,7 +945,7 @@
 	return ifp != NULL;
 }
 
-struct inet6_ifaddr * ipv6_get_ifaddr(struct in6_addr *addr, struct net_device *dev)
+struct inet6_ifaddr * ipv6_get_ifaddr(struct in6_addr *addr, struct net_device *dev, int strict)
 {
 	struct inet6_ifaddr * ifp;
 	u8 hash = ipv6_addr_hash(addr);
@@ -948,7 +954,7 @@
 	for(ifp = inet6_addr_lst[hash]; ifp; ifp=ifp->lst_next) {
 		if (ipv6_addr_cmp(&ifp->addr, addr) == 0) {
 			if (dev == NULL || ifp->idev->dev == dev ||
-			    !(ifp->scope&(IFA_LINK|IFA_HOST))) {
+			    !(ifp->scope&(IFA_LINK|IFA_HOST) || strict)) {
 				in6_ifa_hold(ifp);
 				break;
 			}
@@ -1332,7 +1338,7 @@
 	 *	2) Configure prefixes with the auto flag set
 	 */
 
-	/* Avoid arithemtic overflow. Really, we could
+	/* Avoid arithmetic overflow. Really, we could
 	   save rt_expires in seconds, likely valid_lft,
 	   but it would require division in fib gc, that it
 	   not good.
@@ -1387,13 +1393,16 @@
 
 ok:
 
-		ifp = ipv6_get_ifaddr(&addr, dev);
+		ifp = ipv6_get_ifaddr(&addr, dev, 1);
 
 		if (ifp == NULL && valid_lft) {
+			int max_addresses = in6_dev->cnf.max_addresses;
+
 			/* Do not allow to create too much of autoconfigured
 			 * addresses; this would be too easy way to crash kernel.
 			 */
-			if (ipv6_count_addresses(in6_dev) < IPV6_MAX_ADDRESSES)
+			if (!max_addresses ||
+			    ipv6_count_addresses(in6_dev) < max_addresses)
 				ifp = ipv6_add_addr(in6_dev, &addr, pinfo->prefix_len,
 						    addr_type&IPV6_ADDR_SCOPE_MASK, 0);
 
@@ -1491,6 +1500,7 @@
 			addrconf_verify(0);
 		}
 	}
+	inet6_prefix_notify(RTM_NEWPREFIX, in6_dev, pinfo);
 	in6_dev_put(in6_dev);
 }
 
@@ -1858,8 +1868,8 @@
 	addrconf_add_mroute(dev);
 }
 
-int addrconf_notify(struct notifier_block *this, unsigned long event, 
-		    void * data)
+static int addrconf_notify(struct notifier_block *this, unsigned long event, 
+			   void * data)
 {
 	struct net_device *dev = (struct net_device *) data;
 	struct inet6_dev *idev = __in6_dev_get(dev);
@@ -1890,6 +1900,8 @@
 				rt6_mtu_change(dev, dev->mtu);
 				idev->cnf.mtu6 = dev->mtu;
 			}
+			idev->tstamp = jiffies;
+			inet6_ifinfo_notify(RTM_NEWLINK, idev);
 			/* If the changed mtu during down is lower than IPV6_MIN_MTU
 			   stop IPv6 on this interface.
 			 */
@@ -1921,7 +1933,7 @@
 		if (idev) {
 			addrconf_sysctl_unregister(&idev->cnf);
 			neigh_sysctl_unregister(idev->nd_parms);
-			neigh_sysctl_register(dev, idev->nd_parms, NET_IPV6, NET_IPV6_NEIGH, "ipv6");
+			neigh_sysctl_register(dev, idev->nd_parms, NET_IPV6, NET_IPV6_NEIGH, "ipv6", &ndisc_ifinfo_sysctl_change);
 			addrconf_sysctl_register(idev, &idev->cnf);
 		}
 #endif
@@ -1931,6 +1943,14 @@
 	return NOTIFY_OK;
 }
 
+/*
+ *	addrconf module should be notified of a device going up
+ */
+static struct notifier_block ipv6_dev_notf = {
+	.notifier_call = addrconf_notify,
+	.priority = 0
+};
+
 static int addrconf_ifdown(struct net_device *dev, int how)
 {
 	struct inet6_dev *idev;
@@ -2023,6 +2043,10 @@
 	else
 		ipv6_mc_down(idev);
 
+	/* Step 5: netlink notification of this interface */
+	idev->tstamp = jiffies;
+	inet6_ifinfo_notify(RTM_NEWLINK, idev);
+	
 	/* Shot the device (if unregistered) */
 
 	if (how == 1) {
@@ -2722,19 +2746,22 @@
 	array[DEVCONF_REGEN_MAX_RETRY] = cnf->regen_max_retry;
 	array[DEVCONF_MAX_DESYNC_FACTOR] = cnf->max_desync_factor;
 #endif
+	array[DEVCONF_MAX_ADDRESSES] = cnf->max_addresses;
 }
 
-static int inet6_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
-			    struct inet6_dev *idev,
-			    int type, u32 pid, u32 seq)
+static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev, 
+			     u32 pid, u32 seq, int event)
 {
+	struct net_device	*dev = idev->dev;
 	__s32			*array = NULL;
 	struct ifinfomsg	*r;
 	struct nlmsghdr 	*nlh;
 	unsigned char		*b = skb->tail;
 	struct rtattr		*subattr;
+	__u32			mtu = dev->mtu;
+	struct ifla_cacheinfo	ci;
 
-	nlh = NLMSG_PUT(skb, pid, seq, type, sizeof(*r));
+	nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*r));
 	if (pid) nlh->nlmsg_flags |= NLM_F_MULTI;
 	r = NLMSG_DATA(nlh);
 	r->ifi_family = AF_INET6;
@@ -2749,6 +2776,13 @@
 
 	RTA_PUT(skb, IFLA_IFNAME, strlen(dev->name)+1, dev->name);
 
+	if (dev->addr_len)
+		RTA_PUT(skb, IFLA_ADDRESS, dev->addr_len, dev->dev_addr);
+
+	RTA_PUT(skb, IFLA_MTU, sizeof(mtu), &mtu);
+	if (dev->ifindex != dev->iflink)
+		RTA_PUT(skb, IFLA_LINK, sizeof(int), &dev->iflink);
+			
 	subattr = (struct rtattr*)skb->tail;
 
 	RTA_PUT(skb, IFLA_PROTINFO, 0, NULL);
@@ -2756,6 +2790,14 @@
 	/* return the device flags */
 	RTA_PUT(skb, IFLA_INET6_FLAGS, sizeof(__u32), &idev->if_flags);
 
+	/* return interface cacheinfo */
+	ci.max_reasm_len = IPV6_MAXPLEN;
+	ci.tstamp = (__u32)(TIME_DELTA(idev->tstamp, INITIAL_JIFFIES) / HZ * 100
+		    + TIME_DELTA(idev->tstamp, INITIAL_JIFFIES) % HZ * 100 / HZ);
+	ci.reachable_time = idev->nd_parms->reachable_time;
+	ci.retrans_time = idev->nd_parms->retrans_time;
+	RTA_PUT(skb, IFLA_INET6_CACHEINFO, sizeof(ci), &ci);
+	
 	/* return the device sysctl params */
 	if ((array = kmalloc(DEVCONF_MAX * sizeof(*array), GFP_ATOMIC)) == NULL)
 		goto rtattr_failure;
@@ -2790,8 +2832,8 @@
 			continue;
 		if ((idev = in6_dev_get(dev)) == NULL)
 			continue;
-		err = inet6_fill_ifinfo(skb, dev, idev, RTM_NEWLINK,
-				NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq);
+		err = inet6_fill_ifinfo(skb, idev, NETLINK_CB(cb->skb).pid, 
+				cb->nlh->nlmsg_seq, RTM_NEWLINK);
 		in6_dev_put(idev);
 		if (err <= 0)
 			break;
@@ -2802,6 +2844,86 @@
 	return skb->len;
 }
 
+void inet6_ifinfo_notify(int event, struct inet6_dev *idev)
+{
+	struct sk_buff *skb;
+	/* 128 bytes ?? */
+	int size = NLMSG_SPACE(sizeof(struct ifinfomsg)+128);
+	
+	skb = alloc_skb(size, GFP_ATOMIC);
+	if (!skb) {
+		netlink_set_err(rtnl, 0, RTMGRP_IPV6_IFINFO, ENOBUFS);
+		return;
+	}
+	if (inet6_fill_ifinfo(skb, idev, 0, 0, event) < 0) {
+		kfree_skb(skb);
+		netlink_set_err(rtnl, 0, RTMGRP_IPV6_IFINFO, EINVAL);
+		return;
+	}
+	NETLINK_CB(skb).dst_groups = RTMGRP_IPV6_IFINFO;
+	netlink_broadcast(rtnl, skb, 0, RTMGRP_IPV6_IFINFO, GFP_ATOMIC);
+}
+
+static int inet6_fill_prefix(struct sk_buff *skb, struct inet6_dev *idev,
+			struct prefix_info *pinfo, u32 pid, u32 seq, int event)
+{
+	struct prefixmsg	*pmsg;
+	struct nlmsghdr 	*nlh;
+	unsigned char		*b = skb->tail;
+	struct prefix_cacheinfo	ci;
+
+	nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*pmsg));
+	
+	if (pid) 
+		nlh->nlmsg_flags |= NLM_F_MULTI;
+	
+	pmsg = NLMSG_DATA(nlh);
+	pmsg->prefix_family = AF_INET6;
+	pmsg->prefix_ifindex = idev->dev->ifindex;
+	pmsg->prefix_len = pinfo->prefix_len;
+	pmsg->prefix_type = pinfo->type;
+	
+	pmsg->prefix_flags = 0;
+	if (pinfo->onlink)
+		pmsg->prefix_flags |= IF_PREFIX_ONLINK;
+	if (pinfo->autoconf)
+		pmsg->prefix_flags |= IF_PREFIX_AUTOCONF;
+
+	RTA_PUT(skb, PREFIX_ADDRESS, sizeof(pinfo->prefix), &pinfo->prefix);
+
+	ci.preferred_time = ntohl(pinfo->prefered);
+	ci.valid_time = ntohl(pinfo->valid);
+	RTA_PUT(skb, PREFIX_CACHEINFO, sizeof(ci), &ci);
+
+	nlh->nlmsg_len = skb->tail - b;
+	return skb->len;
+
+nlmsg_failure:
+rtattr_failure:
+	skb_trim(skb, b - skb->data);
+	return -1;
+}
+
+static void inet6_prefix_notify(int event, struct inet6_dev *idev, 
+			 struct prefix_info *pinfo)
+{
+	struct sk_buff *skb;
+	int size = NLMSG_SPACE(sizeof(struct prefixmsg)+128);
+
+	skb = alloc_skb(size, GFP_ATOMIC);
+	if (!skb) {
+		netlink_set_err(rtnl, 0, RTMGRP_IPV6_PREFIX, ENOBUFS);
+		return;
+	}
+	if (inet6_fill_prefix(skb, idev, pinfo, 0, 0, event) < 0) {
+		kfree_skb(skb);
+		netlink_set_err(rtnl, 0, RTMGRP_IPV6_PREFIX, EINVAL);
+		return;
+	}
+	NETLINK_CB(skb).dst_groups = RTMGRP_IPV6_PREFIX;
+	netlink_broadcast(rtnl, skb, 0, RTMGRP_IPV6_PREFIX, GFP_ATOMIC);
+}
+
 static struct rtnetlink_link inet6_rtnetlink_table[RTM_MAX - RTM_BASE + 1] = {
 	[RTM_GETLINK - RTM_BASE] = { .dumpit	= inet6_dump_ifinfo, },
 	[RTM_NEWADDR - RTM_BASE] = { .doit	= inet6_rtm_newaddr, },
@@ -2830,7 +2952,7 @@
 			if (!ipv6_addr_any(&addr))
 				ipv6_dev_ac_dec(ifp->idev->dev, &addr);
 		}
-		if (!ipv6_chk_addr(&ifp->addr, NULL))
+		if (!ipv6_chk_addr(&ifp->addr, ifp->idev->dev, 1))
 			ip6_rt_addr_del(&ifp->addr, ifp->idev->dev);
 		break;
 	}
@@ -2908,6 +3030,9 @@
 			idev = NULL;
 		*valp = new;
 		addrconf_forward_change(idev);
+
+		if (*valp)
+			rt6_purge_dflt_routers(0);
 	} else
 		*valp = new;
 
@@ -2917,7 +3042,7 @@
 static struct addrconf_sysctl_table
 {
 	struct ctl_table_header *sysctl_header;
-	ctl_table addrconf_vars[16];
+	ctl_table addrconf_vars[17];
 	ctl_table addrconf_dev[2];
 	ctl_table addrconf_conf_dir[2];
 	ctl_table addrconf_proto_dir[2];
@@ -3050,6 +3175,17 @@
 	 		.proc_handler	=	&proc_dointvec,
 		},
 #endif
+		{
+			.ctl_name	=	NET_IPV6_MAX_ADDRESSES,
+			.procname	=	"max_addresses",
+			.data		=	&ipv6_devconf.max_addresses,
+			.maxlen		=	sizeof(int),
+			.mode		=	0644,
+			.proc_handler	=	&proc_dointvec,
+		},
+		{
+			.ctl_name	=	0,	/* sentinel */
+		}
 	},
 	.addrconf_dev = {
 		{
@@ -3058,6 +3194,9 @@
 			.mode		=	0555,
 			.child		=	addrconf_sysctl.addrconf_vars,
 		},
+		{
+			.ctl_name	=	0,	/* sentinel */
+		}
 	},
 	.addrconf_conf_dir = {
 		{
@@ -3066,6 +3205,9 @@
 			.mode		=	0555,
 			.child		=	addrconf_sysctl.addrconf_dev,
 		},
+		{
+			.ctl_name	=	0,	/* sentinel */
+		}
 	},
 	.addrconf_proto_dir = {
 		{
@@ -3074,6 +3216,9 @@
 			.mode		=	0555,
 			.child		=	addrconf_sysctl.addrconf_conf_dir,
 		},
+		{
+			.ctl_name	=	0,	/* sentinel */
+		}
 	},
 	.addrconf_root_dir = {
 		{
@@ -3082,6 +3227,9 @@
 			.mode		=	0555,
 			.child		=	addrconf_sysctl.addrconf_proto_dir,
 		},
+		{
+			.ctl_name	=	0,	/* sentinel */
+		}
 	},
 };
 
@@ -3179,9 +3327,7 @@
 
 void __init addrconf_init(void)
 {
-#ifdef MODULE
-	struct net_device *dev;
-#endif
+	register_netdevice_notifier(&ipv6_dev_notf);
 
 #ifdef CONFIG_IPV6_PRIVACY
 	md5_tfm = crypto_alloc_tfm("md5", 0);
@@ -3190,30 +3336,6 @@
 			"failed to load transform for md5\n");
 #endif
 
-#ifdef MODULE
-	/* This takes sense only during module load. */
-	rtnl_lock();
-	for (dev = dev_base; dev; dev = dev->next) {
-		if (!(dev->flags&IFF_UP))
-			continue;
-
-		switch (dev->type) {
-		case ARPHRD_LOOPBACK:	
-			init_loopback(dev);
-			break;
-		case ARPHRD_ETHER:
-		case ARPHRD_FDDI:
-		case ARPHRD_IEEE802_TR:	
-		case ARPHRD_ARCNET:
-			addrconf_dev_config(dev);
-			break;
-		default:;
-			/* Ignore all other */
-		}
-	}
-	rtnl_unlock();
-#endif
-
 	addrconf_verify(0);
 	rtnetlink_links[PF_INET6] = inet6_rtnetlink_table;
 #ifdef CONFIG_SYSCTL
@@ -3231,6 +3353,8 @@
  	struct inet6_ifaddr *ifa;
 	int i;
 
+	unregister_netdevice_notifier(&ipv6_dev_notf);
+
 	rtnetlink_links[PF_INET6] = NULL;
 #ifdef CONFIG_SYSCTL
 	addrconf_sysctl_unregister(&ipv6_devconf_dflt);
@@ -3284,3 +3408,4 @@
 #endif
 }
 #endif	/* MODULE */
+
diff -Nru a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
--- a/net/ipv6/af_inet6.c	Tue Feb  3 19:45:29 2004
+++ b/net/ipv6/af_inet6.c	Tue Feb  3 19:45:29 2004
@@ -294,6 +294,7 @@
 	__u32 v4addr = 0;
 	unsigned short snum;
 	int addr_type = 0;
+	int err = 0;
 
 	/* If the socket has its own bind function then use it. */
 	if (sk->sk_prot->bind)
@@ -305,24 +306,6 @@
 	if ((addr_type & IPV6_ADDR_MULTICAST) && sock->type == SOCK_STREAM)
 		return -EINVAL;
 
-	/* Check if the address belongs to the host. */
-	if (addr_type == IPV6_ADDR_MAPPED) {
-		v4addr = addr->sin6_addr.s6_addr32[3];
-		if (inet_addr_type(v4addr) != RTN_LOCAL)
-			return -EADDRNOTAVAIL;
-	} else {
-		if (addr_type != IPV6_ADDR_ANY) {
-			/* ipv4 addr of the socket is invalid.  Only the
-			 * unspecified and mapped address have a v4 equivalent.
-			 */
-			v4addr = LOOPBACK4_IPV6;
-			if (!(addr_type & IPV6_ADDR_MULTICAST))	{
-				if (!ipv6_chk_addr(&addr->sin6_addr, NULL))
-					return -EADDRNOTAVAIL;
-			}
-		}
-	}
-
 	snum = ntohs(addr->sin6_port);
 	if (snum && snum < PROT_SOCK && !capable(CAP_NET_BIND_SERVICE))
 		return -EACCES;
@@ -331,23 +314,56 @@
 
 	/* Check these errors (active socket, double bind). */
 	if (sk->sk_state != TCP_CLOSE || inet->num) {
-		release_sock(sk);
-		return -EINVAL;
+		err = -EINVAL;
+		goto out;
 	}
 
-	if (addr_type & IPV6_ADDR_LINKLOCAL) {
-		if (addr_len >= sizeof(struct sockaddr_in6) &&
-		    addr->sin6_scope_id) {
-			/* Override any existing binding, if another one
-			 * is supplied by user.
-			 */
-			sk->sk_bound_dev_if = addr->sin6_scope_id;
+	/* Check if the address belongs to the host. */
+	if (addr_type == IPV6_ADDR_MAPPED) {
+		v4addr = addr->sin6_addr.s6_addr32[3];
+		if (inet_addr_type(v4addr) != RTN_LOCAL) {
+			err = -EADDRNOTAVAIL;
+			goto out;
 		}
+	} else {
+		if (addr_type != IPV6_ADDR_ANY) {
+			struct net_device *dev = NULL;
 
-		/* Binding to link-local address requires an interface */
-		if (!sk->sk_bound_dev_if) {
-			release_sock(sk);
-			return -EINVAL;
+			if (addr_type & IPV6_ADDR_LINKLOCAL) {
+				if (addr_len >= sizeof(struct sockaddr_in6) &&
+				    addr->sin6_scope_id) {
+					/* Override any existing binding, if another one
+					 * is supplied by user.
+					 */
+					sk->sk_bound_dev_if = addr->sin6_scope_id;
+				}
+				
+				/* Binding to link-local address requires an interface */
+				if (!sk->sk_bound_dev_if) {
+					err = -EINVAL;
+					goto out;
+				}
+				dev = dev_get_by_index(sk->sk_bound_dev_if);
+				if (!dev) {
+					err = -ENODEV;
+					goto out;
+				}
+			}
+
+			/* ipv4 addr of the socket is invalid.  Only the
+			 * unspecified and mapped address have a v4 equivalent.
+			 */
+			v4addr = LOOPBACK4_IPV6;
+			if (!(addr_type & IPV6_ADDR_MULTICAST))	{
+				if (!ipv6_chk_addr(&addr->sin6_addr, dev, 0)) {
+					if (dev)
+						dev_put(dev);
+					err = -EADDRNOTAVAIL;
+					goto out;
+				}
+			}
+			if (dev)
+				dev_put(dev);
 		}
 	}
 
@@ -362,8 +378,8 @@
 	/* Make sure we are allowed to bind here. */
 	if (sk->sk_prot->get_port(sk, snum)) {
 		inet_reset_saddr(sk);
-		release_sock(sk);
-		return -EADDRINUSE;
+		err = -EADDRINUSE;
+		goto out;
 	}
 
 	if (addr_type != IPV6_ADDR_ANY)
@@ -373,9 +389,9 @@
 	inet->sport = ntohs(inet->num);
 	inet->dport = 0;
 	inet->daddr = 0;
+out:
 	release_sock(sk);
-
-	return 0;
+	return err;
 }
 
 int inet6_release(struct socket *sock)
@@ -802,7 +818,6 @@
 	if (if6_proc_init())
 		goto proc_if6_fail;
 #endif
-	ipv6_netdev_notif_init();
 	ipv6_packet_init();
 	ip6_route_init();
 	ip6_flowlabel_init();
@@ -869,7 +884,6 @@
 #endif
 	/* Cleanup code parts. */
 	sit_cleanup();
-	ipv6_netdev_notif_cleanup();
 	ip6_flowlabel_cleanup();
 	addrconf_cleanup();
 	ip6_route_cleanup();
diff -Nru a/net/ipv6/ah6.c b/net/ipv6/ah6.c
--- a/net/ipv6/ah6.c	Tue Feb  3 19:45:34 2004
+++ b/net/ipv6/ah6.c	Tue Feb  3 19:45:34 2004
@@ -315,7 +315,7 @@
 	skb->nh.ipv6h->hop_limit   = 0;
 
         {
-		u8 auth_data[ahp->icv_trunc_len];
+		u8 auth_data[MAX_AH_AUTH_LEN];
 
 		memcpy(auth_data, ah->auth_data, ahp->icv_trunc_len);
 		memset(ah->auth_data, 0, ahp->icv_trunc_len);
@@ -419,6 +419,8 @@
 	
 	ahp->icv_full_len = aalg_desc->uinfo.auth.icv_fullbits/8;
 	ahp->icv_trunc_len = aalg_desc->uinfo.auth.icv_truncbits/8;
+	
+	BUG_ON(ahp->icv_trunc_len > MAX_AH_AUTH_LEN);
 	
 	ahp->work_icv = kmalloc(ahp->icv_full_len, GFP_KERNEL);
 	if (!ahp->work_icv)
diff -Nru a/net/ipv6/anycast.c b/net/ipv6/anycast.c
--- a/net/ipv6/anycast.c	Tue Feb  3 19:45:16 2004
+++ b/net/ipv6/anycast.c	Tue Feb  3 19:45:16 2004
@@ -113,7 +113,7 @@
 		return -EPERM;
 	if (ipv6_addr_type(addr) & IPV6_ADDR_MULTICAST)
 		return -EINVAL;
-	if (ipv6_chk_addr(addr, NULL))
+	if (ipv6_chk_addr(addr, NULL, 0))
 		return -EINVAL;
 
 	pac = sock_kmalloc(sk, sizeof(struct ipv6_ac_socklist), GFP_KERNEL);
diff -Nru a/net/ipv6/datagram.c b/net/ipv6/datagram.c
--- a/net/ipv6/datagram.c	Tue Feb  3 19:45:16 2004
+++ b/net/ipv6/datagram.c	Tue Feb  3 19:45:16 2004
@@ -265,6 +265,8 @@
 	int err = 0;
 
 	for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
+		int addr_type;
+		struct net_device *dev = NULL;
 
 		if (cmsg->cmsg_len < sizeof(struct cmsghdr) ||
 		    (unsigned long)(((char*)cmsg - (char*)msg->msg_control)
@@ -291,16 +293,30 @@
 				fl->oif = src_info->ipi6_ifindex;
 			}
 
-			if (!ipv6_addr_any(&src_info->ipi6_addr)) {
-				if (!ipv6_chk_addr(&src_info->ipi6_addr, NULL)) {
-					err = -EINVAL;
-					goto exit_f;
-				}
+			addr_type = ipv6_addr_type(&src_info->ipi6_addr);
 
-				ipv6_addr_copy(&fl->fl6_src,
-					       &src_info->ipi6_addr);
+			if (addr_type == IPV6_ADDR_ANY)
+				break;
+			
+			if (addr_type & IPV6_ADDR_LINKLOCAL) {
+				if (!src_info->ipi6_ifindex)
+					return -EINVAL;
+				else {
+					dev = dev_get_by_index(src_info->ipi6_ifindex);
+					if (!dev)
+						return -ENODEV;
+				}
+			}
+			if (!ipv6_chk_addr(&src_info->ipi6_addr, dev, 0)) {
+				if (dev)
+					dev_put(dev);
+				err = -EINVAL;
+				goto exit_f;
 			}
+			if (dev)
+				dev_put(dev);
 
+			ipv6_addr_copy(&fl->fl6_src, &src_info->ipi6_addr);
 			break;
 
 		case IPV6_FLOWINFO:
diff -Nru a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
--- a/net/ipv6/exthdrs.c	Tue Feb  3 19:45:16 2004
+++ b/net/ipv6/exthdrs.c	Tue Feb  3 19:45:16 2004
@@ -367,7 +367,7 @@
 	   Inverted result:
 	   [ H_prev -> ... -> H1 ] daddr =sender
 
-	   Note, that IP output engine will rewrire this rthdr
+	   Note, that IP output engine will rewrite this rthdr
 	   by rotating it left by one addr.
 	 */
 
diff -Nru a/net/ipv6/icmp.c b/net/ipv6/icmp.c
--- a/net/ipv6/icmp.c	Tue Feb  3 19:45:17 2004
+++ b/net/ipv6/icmp.c	Tue Feb  3 19:45:17 2004
@@ -298,7 +298,7 @@
 	 */
 	addr_type = ipv6_addr_type(&hdr->daddr);
 
-	if (ipv6_chk_addr(&hdr->daddr, skb->dev))
+	if (ipv6_chk_addr(&hdr->daddr, skb->dev, 0))
 		saddr = &hdr->daddr;
 
 	/*
diff -Nru a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
--- a/net/ipv6/ip6_fib.c	Tue Feb  3 19:45:40 2004
+++ b/net/ipv6/ip6_fib.c	Tue Feb  3 19:45:40 2004
@@ -942,7 +942,7 @@
 			}
 			fn = fn->parent;
 		}
-		/* No more references are possiible at this point. */
+		/* No more references are possible at this point. */
 		if (atomic_read(&rt->rt6i_ref) != 1) BUG();
 	}
 
diff -Nru a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
--- a/net/ipv6/ip6_output.c	Tue Feb  3 19:45:16 2004
+++ b/net/ipv6/ip6_output.c	Tue Feb  3 19:45:16 2004
@@ -725,6 +725,7 @@
 {
 	int err = 0;
 
+	*dst = NULL;
 	if (sk) {
 		struct ipv6_pinfo *np = inet6_sk(sk);
 	
diff -Nru a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
--- a/net/ipv6/ip6_tunnel.c	Tue Feb  3 19:45:16 2004
+++ b/net/ipv6/ip6_tunnel.c	Tue Feb  3 19:45:16 2004
@@ -777,10 +777,10 @@
 		if (p->link)
 			ldev = dev_get_by_index(p->link);
 		
-		if ((ltype&IPV6_ADDR_UNICAST) && !ipv6_chk_addr(laddr, ldev))
+		if (ltype&IPV6_ADDR_UNICAST && !ipv6_chk_addr(laddr, ldev, 0))
 			l_ok = 0;
 		
-		if ((rtype&IPV6_ADDR_UNICAST) && ipv6_chk_addr(raddr, NULL))
+		if (rtype&IPV6_ADDR_UNICAST && ipv6_chk_addr(raddr, NULL, 0))
 			r_ok = 0;
 		
 		if (l_ok && r_ok) {
diff -Nru a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
--- a/net/ipv6/ipv6_sockglue.c	Tue Feb  3 19:45:16 2004
+++ b/net/ipv6/ipv6_sockglue.c	Tue Feb  3 19:45:16 2004
@@ -62,14 +62,6 @@
 	.func = ipv6_rcv,
 };
 
-/*
- *	addrconf module should be notified of a device going up
- */
-static struct notifier_block ipv6_dev_notf = {
-	.notifier_call = addrconf_notify,
-	.priority = 0
-};
-
 struct ip6_ra_chain *ip6_ra_chain;
 rwlock_t ip6_ra_lock = RW_LOCK_UNLOCKED;
 
@@ -707,19 +699,9 @@
 	dev_add_pack(&ipv6_packet_type);
 }
 
-void __init ipv6_netdev_notif_init(void)
-{
-	register_netdevice_notifier(&ipv6_dev_notf);
-}
-
 #ifdef MODULE
 void ipv6_packet_cleanup(void)
 {
 	dev_remove_pack(&ipv6_packet_type);
-}
-
-void ipv6_netdev_notif_cleanup(void)
-{
-	unregister_netdevice_notifier(&ipv6_dev_notf);
 }
 #endif
diff -Nru a/net/ipv6/mcast.c b/net/ipv6/mcast.c
--- a/net/ipv6/mcast.c	Tue Feb  3 19:45:41 2004
+++ b/net/ipv6/mcast.c	Tue Feb  3 19:45:41 2004
@@ -372,9 +372,9 @@
 			goto done;
 	} else if (pmc->sfmode != omode) {
 		/* allow mode switches for empty-set filters */
+		ip6_mc_add_src(idev, group, omode, 0, 0, 0);
 		ip6_mc_del_src(idev, group, pmc->sfmode, 0, 0, 0);
 		pmc->sfmode = omode;
-		ip6_mc_del_src(idev, group, pmc->sfmode, 0, 0, 0);
 	}
 
 	psl = pmc->sflist;
@@ -918,20 +918,24 @@
 				break;
 		}
 		if (mc) {
-			struct ip6_sf_list *psf;
+			if (!ipv6_addr_any(src_addr)) {
+				struct ip6_sf_list *psf;
 
-			spin_lock_bh(&mc->mca_lock);
-			for (psf=mc->mca_sources; psf; psf=psf->sf_next) {
-				if (ipv6_addr_cmp(&psf->sf_addr, src_addr) == 0)
-					break;
-			}
-			if (psf)
-				rv = psf->sf_count[MCAST_INCLUDE] ||
-					psf->sf_count[MCAST_EXCLUDE] !=
-					mc->mca_sfcount[MCAST_EXCLUDE];
-			else
-				rv = mc->mca_sfcount[MCAST_EXCLUDE] != 0;
-			spin_unlock_bh(&mc->mca_lock);
+				spin_lock_bh(&mc->mca_lock);
+				for (psf=mc->mca_sources;psf;psf=psf->sf_next) {
+					if (ipv6_addr_cmp(&psf->sf_addr,
+					    src_addr) == 0)
+						break;
+				}
+				if (psf)
+					rv = psf->sf_count[MCAST_INCLUDE] ||
+						psf->sf_count[MCAST_EXCLUDE] !=
+						mc->mca_sfcount[MCAST_EXCLUDE];
+				else
+					rv = mc->mca_sfcount[MCAST_EXCLUDE] !=0;
+				spin_unlock_bh(&mc->mca_lock);
+			} else
+				rv = 1; /* don't filter unspecified source */
 		}
 		read_unlock_bh(&idev->lock);
 		in6_dev_put(idev);
diff -Nru a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
--- a/net/ipv6/ndisc.c	Tue Feb  3 19:45:30 2004
+++ b/net/ipv6/ndisc.c	Tue Feb  3 19:45:30 2004
@@ -434,7 +434,7 @@
 	len = sizeof(struct icmp6hdr) + sizeof(struct in6_addr);
 
 	/* for anycast or proxy, solicited_addr != src_addr */
-	ifp = ipv6_get_ifaddr(solicited_addr, dev);
+	ifp = ipv6_get_ifaddr(solicited_addr, dev, 1);
  	if (ifp) {
 		src_addr = solicited_addr;
 		in6_ifa_put(ifp);
@@ -680,7 +680,7 @@
 	struct in6_addr *target = (struct in6_addr *)&neigh->primary_key;
 	int probes = atomic_read(&neigh->probes);
 
-	if (skb && ipv6_chk_addr(&skb->nh.ipv6h->saddr, dev))
+	if (skb && ipv6_chk_addr(&skb->nh.ipv6h->saddr, dev, 1))
 		saddr = &skb->nh.ipv6h->saddr;
 
 	if ((probes -= neigh->parms->ucast_probes) < 0) {
@@ -758,7 +758,7 @@
 		}
 	}
 
-	if ((ifp = ipv6_get_ifaddr(&msg->target, dev)) != NULL) {
+	if ((ifp = ipv6_get_ifaddr(&msg->target, dev, 1)) != NULL) {
 		if (ifp->flags & IFA_F_TENTATIVE) {
 			/* Address is tentative. If the source
 			   is unspecified address, it is someone
@@ -955,7 +955,7 @@
 			return;
 		}
 	}
-	if ((ifp = ipv6_get_ifaddr(&msg->target, dev))) {
+	if ((ifp = ipv6_get_ifaddr(&msg->target, dev, 1))) {
 		if (ifp->flags & IFA_F_TENTATIVE) {
 			addrconf_dad_failure(ifp);
 			return;
@@ -1115,6 +1115,8 @@
 			if (rtime < HZ/10)
 				rtime = HZ/10;
 			in6_dev->nd_parms->retrans_time = rtime;
+			in6_dev->tstamp = jiffies;
+			inet6_ifinfo_notify(RTM_NEWLINK, in6_dev);
 		}
 
 		rtime = ntohl(ra_msg->reachable_time);
@@ -1128,6 +1130,8 @@
 				in6_dev->nd_parms->base_reachable_time = rtime;
 				in6_dev->nd_parms->gc_staletime = 3 * rtime;
 				in6_dev->nd_parms->reachable_time = neigh_rand_reach_time(rtime);
+				in6_dev->tstamp = jiffies;
+				inet6_ifinfo_notify(RTM_NEWLINK, in6_dev);
 			}
 		}
 	}
@@ -1492,6 +1496,21 @@
 	.notifier_call = ndisc_netdev_event,
 };
 
+#ifdef CONFIG_SYSCTL
+int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * filp, void __user *buffer, size_t *lenp)
+{
+	struct net_device *dev = ctl->extra1;
+	struct inet6_dev *idev;
+
+	if (write && dev && (idev = in6_dev_get(dev)) != NULL) {
+		idev->tstamp = jiffies;
+		inet6_ifinfo_notify(RTM_NEWLINK, idev);
+		in6_dev_put(idev);
+	}
+	return proc_dointvec(ctl, write, filp, buffer, lenp);
+}
+#endif
+
 int __init ndisc_init(struct net_proto_family *ops)
 {
 	struct ipv6_pinfo *np;
@@ -1522,7 +1541,8 @@
 	neigh_table_init(&nd_tbl);
 
 #ifdef CONFIG_SYSCTL
-	neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6, NET_IPV6_NEIGH, "ipv6");
+	neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6, NET_IPV6_NEIGH, 
+			      "ipv6", &ndisc_ifinfo_sysctl_change);
 #endif
 
 	register_netdevice_notifier(&ndisc_netdev_notifier);
diff -Nru a/net/ipv6/raw.c b/net/ipv6/raw.c
--- a/net/ipv6/raw.c	Tue Feb  3 19:45:17 2004
+++ b/net/ipv6/raw.c	Tue Feb  3 19:45:17 2004
@@ -197,31 +197,44 @@
 	if (sk->sk_state != TCP_CLOSE)
 		goto out;
 
-	if (addr_type & IPV6_ADDR_LINKLOCAL) {
-		if (addr_len >= sizeof(struct sockaddr_in6) &&
-		    addr->sin6_scope_id) {
-			/* Override any existing binding, if another one
-			 * is supplied by user.
-			 */
-			sk->sk_bound_dev_if = addr->sin6_scope_id;
-		}
-
-		/* Binding to link-local address requires an interface */
-		if (!sk->sk_bound_dev_if)
-			goto out;
-	}
-
 	/* Check if the address belongs to the host. */
 	if (addr_type != IPV6_ADDR_ANY) {
+		struct net_device *dev = NULL;
+
+		if (addr_type & IPV6_ADDR_LINKLOCAL) {
+			if (addr_len >= sizeof(struct sockaddr_in6) &&
+			    addr->sin6_scope_id) {
+				/* Override any existing binding, if another
+				 * one is supplied by user.
+				 */
+				sk->sk_bound_dev_if = addr->sin6_scope_id;
+			}
+			
+			/* Binding to link-local address requires an interface */
+			if (!sk->sk_bound_dev_if)
+				goto out;
+
+			dev = dev_get_by_index(sk->sk_bound_dev_if);
+			if (!dev) {
+				err = -ENODEV;
+				goto out;
+			}
+		}
+		
 		/* ipv4 addr of the socket is invalid.  Only the
 		 * unpecified and mapped address have a v4 equivalent.
 		 */
 		v4addr = LOOPBACK4_IPV6;
 		if (!(addr_type & IPV6_ADDR_MULTICAST))	{
 			err = -EADDRNOTAVAIL;
-			if (!ipv6_chk_addr(&addr->sin6_addr, NULL))
+			if (!ipv6_chk_addr(&addr->sin6_addr, dev, 0)) {
+				if (dev)
+					dev_put(dev);
 				goto out;
+			}
 		}
+		if (dev)
+			dev_put(dev);
 	}
 
 	inet->rcv_saddr = inet->saddr = v4addr;
@@ -345,13 +358,15 @@
  *	we return it, otherwise we block.
  */
 
-static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, int len,
+static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk,
+		  struct msghdr *msg, size_t len,
 		  int noblock, int flags, int *addr_len)
 {
 	struct ipv6_pinfo *np = inet6_sk(sk);
 	struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)msg->msg_name;
 	struct sk_buff *skb;
-	int copied, err;
+	size_t copied;
+	int err;
 
 	if (flags & MSG_OOB)
 		return -EOPNOTSUPP;
@@ -527,7 +542,8 @@
 	IP6_INC_STATS(Ip6OutDiscards);
 	return err; 
 }
-static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, int len)
+static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
+		   struct msghdr *msg, size_t len)
 {
 	struct ipv6_txoptions opt_space;
 	struct sockaddr_in6 * sin6 = (struct sockaddr_in6 *) msg->msg_name;
diff -Nru a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
--- a/net/ipv6/reassembly.c	Tue Feb  3 19:45:17 2004
+++ b/net/ipv6/reassembly.c	Tue Feb  3 19:45:17 2004
@@ -526,7 +526,7 @@
 		} else {
 			struct sk_buff *free_it = next;
 
-			/* Old fragmnet is completely overridden with
+			/* Old fragment is completely overridden with
 			 * new one drop it.
 			 */
 			next = next->next;
diff -Nru a/net/ipv6/route.c b/net/ipv6/route.c
--- a/net/ipv6/route.c	Tue Feb  3 19:45:35 2004
+++ b/net/ipv6/route.c	Tue Feb  3 19:45:35 2004
@@ -785,7 +785,7 @@
 			/* IPv6 strictly inhibits using not link-local
 			   addresses as nexthop address.
 			   Otherwise, router will not able to send redirects.
-			   It is very good, but in some (rare!) curcumstances
+			   It is very good, but in some (rare!) circumstances
 			   (SIT, PtP, NBMA NOARP links) it is handy to allow
 			   some exceptions. --ANK
 			 */
@@ -1365,10 +1365,10 @@
 	 */
 	/*
 	   If new MTU is less than route PMTU, this new MTU will be the
-	   lowest MTU in the path, update the route PMTU to refect PMTU
+	   lowest MTU in the path, update the route PMTU to reflect PMTU
 	   decreases; if new MTU is greater than route PMTU, and the
 	   old MTU is the lowest MTU in the path, update the route PMTU
-	   to refect the increase. In this case if the other nodes' MTU
+	   to reflect the increase. In this case if the other nodes' MTU
 	   also have the lowest MTU, TOO BIG MESSAGE will be lead to
 	   PMTU discouvery.
 	 */
@@ -1974,6 +1974,7 @@
          	.proc_handler	=	&proc_dointvec_jiffies,
 		.strategy	=	&sysctl_jiffies,
 	},
+	{ .ctl_name = 0 }
 };
 
 #endif
diff -Nru a/net/ipv6/sit.c b/net/ipv6/sit.c
--- a/net/ipv6/sit.c	Tue Feb  3 19:45:42 2004
+++ b/net/ipv6/sit.c	Tue Feb  3 19:45:42 2004
@@ -485,7 +485,8 @@
 					      { .daddr = dst,
 						.saddr = tiph->saddr,
 						.tos = RT_TOS(tos) } },
-				    .oif = tunnel->parms.link };
+				    .oif = tunnel->parms.link,
+				    .proto = IPPROTO_IPV6 };
 		if (ip_route_output_key(&rt, &fl)) {
 			tunnel->stat.tx_carrier_errors++;
 			goto tx_error_icmp;
@@ -757,7 +758,8 @@
 					      { .daddr = iph->daddr,
 						.saddr = iph->saddr,
 						.tos = RT_TOS(iph->tos) } },
-				    .oif = tunnel->parms.link };
+				    .oif = tunnel->parms.link,
+				    .proto = IPPROTO_IPV6 };
 		struct rtable *rt;
 		if (!ip_route_output_key(&rt, &fl)) {
 			tdev = rt->u.dst.dev;
diff -Nru a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
--- a/net/ipv6/tcp_ipv6.c	Tue Feb  3 19:45:29 2004
+++ b/net/ipv6/tcp_ipv6.c	Tue Feb  3 19:45:29 2004
@@ -485,7 +485,7 @@
 
 unique:
 	BUG_TRAP(sk_unhashed(sk));
-	sk_add_node(sk, &head->chain);
+	__sk_add_node(sk, &head->chain);
 	sk->sk_hashent = hash;
 	sock_prot_inc_use(sk->sk_prot);
 	write_unlock_bh(&head->lock);
diff -Nru a/net/ipv6/udp.c b/net/ipv6/udp.c
--- a/net/ipv6/udp.c	Tue Feb  3 19:45:41 2004
+++ b/net/ipv6/udp.c	Tue Feb  3 19:45:41 2004
@@ -366,12 +366,14 @@
  * 	return it, otherwise we block.
  */
 
-static int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, int len,
+static int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk, 
+		  struct msghdr *msg, size_t len,
 		  int noblock, int flags, int *addr_len)
 {
 	struct ipv6_pinfo *np = inet6_sk(sk);
   	struct sk_buff *skb;
-  	int copied, err;
+	size_t copied;
+  	int err;
 
   	if (addr_len)
   		*addr_len=sizeof(struct sockaddr_in6);
@@ -774,7 +776,8 @@
 	return err;
 }
 
-static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, int len)
+static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk, 
+		  struct msghdr *msg, size_t len)
 {
 	struct ipv6_txoptions opt_space;
 	struct udp_opt *up = udp_sk(sk);
@@ -841,7 +844,7 @@
 	/* Rough check on arithmetic overflow,
 	   better check is made in ip6_build_xmit
 	   */
-	if (len < 0 || len > INT_MAX - sizeof(struct udphdr))
+	if (len > INT_MAX - sizeof(struct udphdr))
 		return -EMSGSIZE;
 	
 	if (up->pending) {
diff -Nru a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c
--- a/net/ipx/af_ipx.c	Tue Feb  3 19:45:17 2004
+++ b/net/ipx/af_ipx.c	Tue Feb  3 19:45:17 2004
@@ -1683,7 +1683,7 @@
 }
 
 static int ipx_sendmsg(struct kiocb *iocb, struct socket *sock,
-	struct msghdr *msg, int len)
+	struct msghdr *msg, size_t len)
 {
 	struct sock *sk = sock->sk;
 	struct ipx_opt *ipxs = ipx_sk(sk);
@@ -1698,6 +1698,10 @@
 	if (flags & ~MSG_DONTWAIT)
 		goto out;
 
+	/* Max possible packet size limited by 16 bit pktsize in header */
+	if (len >= 65535 - sizeof(struct ipxhdr))
+		goto out;
+
 	if (usipx) {
 		if (!ipxs->port) {
 			struct sockaddr_ipx uaddr;
@@ -1744,7 +1748,7 @@
 
 
 static int ipx_recvmsg(struct kiocb *iocb, struct socket *sock,
-		struct msghdr *msg, int size, int flags)
+		struct msghdr *msg, size_t size, int flags)
 {
 	struct sock *sk = sock->sk;
 	struct ipx_opt *ipxs = ipx_sk(sk);
diff -Nru a/net/ipx/ipx_route.c b/net/ipx/ipx_route.c
--- a/net/ipx/ipx_route.c	Tue Feb  3 19:45:18 2004
+++ b/net/ipx/ipx_route.c	Tue Feb  3 19:45:18 2004
@@ -169,13 +169,13 @@
  * Route an outgoing frame from a socket.
  */
 int ipxrtr_route_packet(struct sock *sk, struct sockaddr_ipx *usipx,
-			struct iovec *iov, int len, int noblock)
+			struct iovec *iov, size_t len, int noblock)
 {
 	struct sk_buff *skb;
 	struct ipx_opt *ipxs = ipx_sk(sk);
 	struct ipx_interface *intrfc;
 	struct ipxhdr *ipx;
-	int size;
+	size_t size;
 	int ipx_offset;
 	struct ipx_route *rt = NULL;
 	int rc;
diff -Nru a/net/irda/af_irda.c b/net/irda/af_irda.c
--- a/net/irda/af_irda.c	Tue Feb  3 19:45:17 2004
+++ b/net/irda/af_irda.c	Tue Feb  3 19:45:17 2004
@@ -1257,7 +1257,7 @@
  *    fragment the message if necessary
  */
 static int irda_sendmsg(struct kiocb *iocb, struct socket *sock,
-			struct msghdr *msg, int len)
+			struct msghdr *msg, size_t len)
 {
 	struct sock *sk = sock->sk;
 	struct irda_sock *self;
@@ -1307,7 +1307,11 @@
 	skb_reserve(skb, self->max_header_size + 16);
 
 	asmptr = skb->h.raw = skb_put(skb, len);
-	memcpy_fromiovec(asmptr, msg->msg_iov, len);
+	err = memcpy_fromiovec(asmptr, msg->msg_iov, len);
+	if (err) {
+		kfree_skb(skb);
+		return err;
+	}
 
 	/*
 	 * Just send the message to TinyTP, and let it deal with possible
@@ -1329,12 +1333,13 @@
  *    after being read, regardless of how much the user actually read
  */
 static int irda_recvmsg_dgram(struct kiocb *iocb, struct socket *sock,
-			      struct msghdr *msg, int size, int flags)
+			      struct msghdr *msg, size_t size, int flags)
 {
 	struct sock *sk = sock->sk;
 	struct irda_sock *self = irda_sk(sk);
 	struct sk_buff *skb;
-	int copied, err;
+	size_t copied;
+	int err;
 
 	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
@@ -1379,12 +1384,12 @@
  * Function irda_recvmsg_stream (iocb, sock, msg, size, flags)
  */
 static int irda_recvmsg_stream(struct kiocb *iocb, struct socket *sock,
-			       struct msghdr *msg, int size, int flags)
+			       struct msghdr *msg, size_t size, int flags)
 {
 	struct sock *sk = sock->sk;
 	struct irda_sock *self = irda_sk(sk);
 	int noblock = flags & MSG_DONTWAIT;
-	int copied = 0;
+	size_t copied = 0;
 	int target = 1;
 	DECLARE_WAITQUEUE(waitq, current);
 
@@ -1505,7 +1510,7 @@
  *
  */
 static int irda_sendmsg_dgram(struct kiocb *iocb, struct socket *sock,
-			      struct msghdr *msg, int len)
+			      struct msghdr *msg, size_t len)
 {
 	struct sock *sk = sock->sk;
 	struct irda_sock *self;
@@ -1549,7 +1554,11 @@
 
 	IRDA_DEBUG(4, "%s(), appending user data\n", __FUNCTION__);
 	asmptr = skb->h.raw = skb_put(skb, len);
-	memcpy_fromiovec(asmptr, msg->msg_iov, len);
+	err = memcpy_fromiovec(asmptr, msg->msg_iov, len);
+	if (err) {
+		kfree_skb(skb);
+		return err;
+	}
 
 	/*
 	 * Just send the message to TinyTP, and let it deal with possible
@@ -1571,7 +1580,7 @@
  */
 #ifdef CONFIG_IRDA_ULTRA
 static int irda_sendmsg_ultra(struct kiocb *iocb, struct socket *sock,
-			      struct msghdr *msg, int len)
+			      struct msghdr *msg, size_t len)
 {
 	struct sock *sk = sock->sk;
 	struct irda_sock *self;
@@ -1612,7 +1621,11 @@
 
 	IRDA_DEBUG(4, "%s(), appending user data\n", __FUNCTION__);
 	asmptr = skb->h.raw = skb_put(skb, len);
-	memcpy_fromiovec(asmptr, msg->msg_iov, len);
+	err = memcpy_fromiovec(asmptr, msg->msg_iov, len);
+	if (err) {
+		kfree_skb(skb);
+		return err;
+	}
 
 	err = irlmp_connless_data_request(self->lsap, skb);
 	if (err) {
@@ -1890,11 +1903,10 @@
 		case IAS_STRING:
 			/* Should check charset & co */
 			/* Check length */
-			if(ias_opt->attribute.irda_attrib_string.len >
-			   IAS_MAX_STRING) {
-				kfree(ias_opt);
-				return -EINVAL;
-			}
+			/* The length is encoded in a __u8, and
+			 * IAS_MAX_STRING == 256, so there is no way
+			 * userspace can pass us a string too large.
+			 * Jean II */
 			/* NULL terminate the string (avoid troubles) */
 			ias_opt->attribute.irda_attrib_string.string[ias_opt->attribute.irda_attrib_string.len] = '\0';
 			/* Add a string attribute */
diff -Nru a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
--- a/net/irda/ircomm/ircomm_tty.c	Tue Feb  3 19:45:17 2004
+++ b/net/irda/ircomm/ircomm_tty.c	Tue Feb  3 19:45:17 2004
@@ -38,6 +38,7 @@
 #include <linux/termios.h>
 #include <linux/tty.h>
 #include <linux/interrupt.h>
+#include <linux/device.h>		/* for MODULE_ALIAS_CHARDEV_MAJOR */
 
 #include <asm/uaccess.h>
 
@@ -85,7 +86,9 @@
 	.write_room      = ircomm_tty_write_room,
 	.chars_in_buffer = ircomm_tty_chars_in_buffer,
 	.flush_buffer    = ircomm_tty_flush_buffer,
-	.ioctl           = ircomm_tty_ioctl,
+	.ioctl           = ircomm_tty_ioctl,	/* ircomm_tty_ioctl.c */
+	.tiocmget        = ircomm_tty_tiocmget,	/* ircomm_tty_ioctl.c */
+	.tiocmset        = ircomm_tty_tiocmset,	/* ircomm_tty_ioctl.c */
 	.throttle        = ircomm_tty_throttle,
 	.unthrottle      = ircomm_tty_unthrottle,
 	.send_xchar      = ircomm_tty_send_xchar,
@@ -1411,6 +1414,7 @@
 MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no>");
 MODULE_DESCRIPTION("IrCOMM serial TTY driver");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS_CHARDEV_MAJOR(IRCOMM_TTY_MAJOR);
 
 module_init(ircomm_tty_init);
 module_exit(ircomm_tty_cleanup);
diff -Nru a/net/irda/ircomm/ircomm_tty_ioctl.c b/net/irda/ircomm/ircomm_tty_ioctl.c
--- a/net/irda/ircomm/ircomm_tty_ioctl.c	Tue Feb  3 19:45:16 2004
+++ b/net/irda/ircomm/ircomm_tty_ioctl.c	Tue Feb  3 19:45:16 2004
@@ -190,81 +190,62 @@
 }
 
 /*
- * Function ircomm_tty_get_modem_info (self, value)
+ * Function ircomm_tty_tiocmget (tty, file)
  *
  *    
  *
  */
-static int ircomm_tty_get_modem_info(struct ircomm_tty_cb *self, 
-				     unsigned int *value)
+int ircomm_tty_tiocmget(struct tty_struct *tty, struct file *file)
 {
+	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data;
 	unsigned int result;
 
 	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
 
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return -EIO;
+
 	result =  ((self->settings.dte & IRCOMM_RTS) ? TIOCM_RTS : 0)
 		| ((self->settings.dte & IRCOMM_DTR) ? TIOCM_DTR : 0)
 		| ((self->settings.dce & IRCOMM_CD)  ? TIOCM_CAR : 0)
 		| ((self->settings.dce & IRCOMM_RI)  ? TIOCM_RNG : 0)
 		| ((self->settings.dce & IRCOMM_DSR) ? TIOCM_DSR : 0)
 		| ((self->settings.dce & IRCOMM_CTS) ? TIOCM_CTS : 0);
-
-	return put_user(result, value);
+	return result;
 }
 
 /*
- * Function set_modem_info (driver, cmd, value)
+ * Function ircomm_tty_tiocmset (tty, file, set, clear)
  *
  *    
  *
  */
-static int ircomm_tty_set_modem_info(struct ircomm_tty_cb *self, 
-				     unsigned int cmd, unsigned int *value)
+int ircomm_tty_tiocmset(struct tty_struct *tty, struct file *file,
+			unsigned int set, unsigned int clear)
 { 
-	unsigned int arg;
-	__u8 old_rts, old_dtr;
+	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data;
 
 	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
 
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return -EIO;
+
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;);
 
-	if (get_user(arg, value))
-		return -EFAULT;
+	if (set & TIOCM_RTS)
+		self->settings.dte |= IRCOMM_RTS;
+	if (set & TIOCM_DTR)
+		self->settings.dte |= IRCOMM_DTR;
+
+	if (clear & TIOCM_RTS)
+		self->settings.dte &= ~IRCOMM_RTS;
+	if (clear & TIOCM_DTR)
+		self->settings.dte &= ~IRCOMM_DTR;
 
-	old_rts = self->settings.dte & IRCOMM_RTS;
-	old_dtr = self->settings.dte & IRCOMM_DTR;
-
-	switch (cmd) {
-	case TIOCMBIS: 
-		if (arg & TIOCM_RTS) 
-			self->settings.dte |= IRCOMM_RTS;
-		if (arg & TIOCM_DTR)
-			self->settings.dte |= IRCOMM_DTR;
-		break;
-		
-	case TIOCMBIC:
-		if (arg & TIOCM_RTS)
-			self->settings.dte &= ~IRCOMM_RTS;
-		if (arg & TIOCM_DTR)
- 			self->settings.dte &= ~IRCOMM_DTR;
- 		break;
-		
-	case TIOCMSET:
- 		self->settings.dte = 
-			((self->settings.dte & ~(IRCOMM_RTS | IRCOMM_DTR))
-			 | ((arg & TIOCM_RTS) ? IRCOMM_RTS : 0)
-			 | ((arg & TIOCM_DTR) ? IRCOMM_DTR : 0));
-		break;
-		
-	default:
-		return -EINVAL;
-	}
-	
-	if ((self->settings.dte & IRCOMM_RTS) != old_rts)
+	if ((set|clear) & TIOCM_RTS)
 		self->settings.dte |= IRCOMM_DELTA_RTS;
-
-	if ((self->settings.dte & IRCOMM_DTR) != old_dtr)
+	if ((set|clear) & TIOCM_DTR)
 		self->settings.dte |= IRCOMM_DELTA_DTR;
 
 	ircomm_param_request(self, IRCOMM_DTE, TRUE);
@@ -406,14 +387,6 @@
 	}
 
 	switch (cmd) {
-	case TIOCMGET:
-		ret = ircomm_tty_get_modem_info(self, (unsigned int *) arg);
-		break;
-	case TIOCMBIS:
-	case TIOCMBIC:
-	case TIOCMSET:
-		ret = ircomm_tty_set_modem_info(self, cmd, (unsigned int *) arg);
-		break;
 	case TIOCGSERIAL:
 		ret = ircomm_tty_get_serial_info(self, (struct serial_struct *) arg);
 		break;
diff -Nru a/net/irda/irlap_event.c b/net/irda/irlap_event.c
--- a/net/irda/irlap_event.c	Tue Feb  3 19:45:30 2004
+++ b/net/irda/irlap_event.c	Tue Feb  3 19:45:30 2004
@@ -932,6 +932,12 @@
 		/* This frame will actually be sent at the new speed */
 		irlap_send_rr_frame(self, CMD_FRAME);
 
+		/* The timer is set to half the normal timer to quickly
+		 * detect a failure to negociate the new connection
+		 * parameters. IrLAP 6.11.3.2, note 3.
+		 * Note that currently we don't process this failure
+		 * properly, as we should do a quick disconnect.
+		 * Jean II */
 		irlap_start_final_timer(self, self->final_timeout/2);
 		irlap_next_state(self, LAP_NRM_P);
 
@@ -1312,7 +1318,12 @@
 				irlap_resend_rejected_frames(self, CMD_FRAME);
 
 				self->ack_required = FALSE;
-				irlap_start_final_timer(self, self->final_timeout);
+
+				/* Make sure we account for the time
+				 * to transmit our frames. See comemnts
+				 * in irlap_send_data_primary_poll().
+				 * Jean II */
+				irlap_start_final_timer(self, 2 * self->final_timeout);
 
 				/* Keep state, do not move this line */
 				irlap_next_state(self, LAP_NRM_P);
@@ -1352,8 +1363,9 @@
 				/* Resend rejected frames */
 				irlap_resend_rejected_frames(self, CMD_FRAME);
 
-				/* Give peer some time to retransmit! */
-				irlap_start_final_timer(self, self->final_timeout);
+				/* Give peer some time to retransmit! 
+				 * But account for our own Tx. */
+				irlap_start_final_timer(self, 2 * self->final_timeout);
 
 				/* Keep state, do not move this line */
 				irlap_next_state(self, LAP_NRM_P);
@@ -1450,6 +1462,8 @@
 			/* Resend rejected frames */
 			irlap_resend_rejected_frames(self, CMD_FRAME);
 
+			/* Final timer ??? Jean II */
+
 			irlap_next_state(self, LAP_NRM_P);
 		} else if (ret == NR_INVALID) {
 			IRDA_DEBUG(1, "%s(), Received RR with "
@@ -1541,7 +1555,7 @@
 			irlap_send_rr_frame(self, CMD_FRAME);
 		} else
 			irlap_resend_rejected_frames(self, CMD_FRAME);
-		irlap_start_final_timer(self, self->final_timeout);
+		irlap_start_final_timer(self, 2 * self->final_timeout);
 		break;
 	case RECV_SREJ_RSP:
 		irlap_update_nr_received(self, info->nr);
@@ -1550,7 +1564,7 @@
 			irlap_send_rr_frame(self, CMD_FRAME);
 		} else
 			irlap_resend_rejected_frame(self, CMD_FRAME);
-		irlap_start_final_timer(self, self->final_timeout);
+		irlap_start_final_timer(self, 2 * self->final_timeout);
 		break;
 	case RECV_RD_RSP:
 		IRDA_DEBUG(1, "%s(), RECV_RD_RSP\n", __FUNCTION__);
diff -Nru a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c
--- a/net/irda/irlap_frame.c	Tue Feb  3 19:45:17 2004
+++ b/net/irda/irlap_frame.c	Tue Feb  3 19:45:17 2004
@@ -779,6 +779,7 @@
 void irlap_send_data_primary_poll(struct irlap_cb *self, struct sk_buff *skb)
 {
 	struct sk_buff *tx_skb;
+	int transmission_time;
 
 	/* Stop P timer */
 	del_timer(&self->poll_timer);
@@ -829,13 +830,49 @@
 		}
 	}
 
+	/* How much time we took for transmission of all frames.
+	 * We don't know, so let assume we used the full window. Jean II */
+	transmission_time = self->final_timeout;
+
+	/* Reset parameter so that we can fill next window */
 	self->window = self->window_size;
+
 #ifdef CONFIG_IRDA_DYNAMIC_WINDOW
+	/* Remove what we have not used. Just do a prorata of the
+	 * bytes left in window to window capacity.
+	 * See max_line_capacities[][] in qos.c for details. Jean II */
+	transmission_time -= (self->final_timeout * self->bytes_left
+			      / self->line_capacity);
+	IRDA_DEBUG(4, "%s() adjusting transmission_time : ft=%d, bl=%d, lc=%d -> tt=%d\n", __FUNCTION__, self->final_timeout, self->bytes_left, self->line_capacity, transmission_time);
+
 	/* We are allowed to transmit a maximum number of bytes again. */
 	self->bytes_left = self->line_capacity;
 #endif /* CONFIG_IRDA_DYNAMIC_WINDOW */
 
-	irlap_start_final_timer(self, self->final_timeout);
+	/*
+	 * The network layer has a intermediate buffer between IrLAP
+	 * and the IrDA driver which can contain 8 frames. So, even
+	 * though IrLAP is currently sending the *last* frame of the
+	 * tx-window, the driver most likely has only just started
+	 * sending the *first* frame of the same tx-window.
+	 * I.e. we are always at the very begining of or Tx window.
+	 * Now, we are supposed to set the final timer from the end
+	 * of our tx-window to let the other peer reply. So, we need
+	 * to add extra time to compensate for the fact that we
+	 * are really at the start of tx-window, otherwise the final timer
+	 * might expire before he can answer...
+	 * Jean II
+	 */
+	irlap_start_final_timer(self, self->final_timeout + transmission_time);
+
+	/*
+	 * The clever amongst you might ask why we do this adjustement
+	 * only here, and not in all the other cases in irlap_event.c.
+	 * In all those other case, we only send a very short management
+	 * frame (few bytes), so the adjustement would be lost in the
+	 * noise...
+	 * The exception of course is irlap_resend_rejected_frame().
+	 * Jean II */
 }
 
 /*
@@ -1003,7 +1040,7 @@
 	}
 #if 0 /* Not yet */
 	/*
-	 *  We can now fill the window with additinal data frames
+	 *  We can now fill the window with additional data frames
 	 */
 	while (skb_queue_len( &self->txq) > 0) {
 
diff -Nru a/net/key/af_key.c b/net/key/af_key.c
--- a/net/key/af_key.c	Tue Feb  3 19:45:17 2004
+++ b/net/key/af_key.c	Tue Feb  3 19:45:17 2004
@@ -1283,6 +1283,7 @@
 
 static int pfkey_get(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, void **ext_hdrs)
 {
+	__u8 proto;
 	struct sk_buff *out_skb;
 	struct sadb_msg *out_hdr;
 	struct xfrm_state *x;
@@ -1297,6 +1298,7 @@
 		return -ESRCH;
 
 	out_skb = pfkey_xfrm_state2msg(x, 1, 3);
+	proto = x->id.proto;
 	xfrm_state_put(x);
 	if (IS_ERR(out_skb))
 		return  PTR_ERR(out_skb);
@@ -1304,7 +1306,7 @@
 	out_hdr = (struct sadb_msg *) out_skb->data;
 	out_hdr->sadb_msg_version = hdr->sadb_msg_version;
 	out_hdr->sadb_msg_type = SADB_DUMP;
-	out_hdr->sadb_msg_satype = pfkey_proto2satype(x->id.proto);
+	out_hdr->sadb_msg_satype = pfkey_proto2satype(proto);
 	out_hdr->sadb_msg_errno = 0;
 	out_hdr->sadb_msg_reserved = 0;
 	out_hdr->sadb_msg_seq = hdr->sadb_msg_seq;
@@ -2655,7 +2657,7 @@
 }
 
 static int pfkey_sendmsg(struct kiocb *kiocb,
-			 struct socket *sock, struct msghdr *msg, int len)
+			 struct socket *sock, struct msghdr *msg, size_t len)
 {
 	struct sock *sk = sock->sk;
 	struct sk_buff *skb = NULL;
@@ -2697,7 +2699,7 @@
 }
 
 static int pfkey_recvmsg(struct kiocb *kiocb,
-			 struct socket *sock, struct msghdr *msg, int len,
+			 struct socket *sock, struct msghdr *msg, size_t len,
 			 int flags)
 {
 	struct sock *sk = sock->sk;
diff -Nru a/net/llc/af_llc.c b/net/llc/af_llc.c
--- a/net/llc/af_llc.c	Tue Feb  3 19:45:16 2004
+++ b/net/llc/af_llc.c	Tue Feb  3 19:45:16 2004
@@ -671,12 +671,13 @@
  *	Returns non-negative upon success, negative otherwise.
  */
 static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,
-			  struct msghdr *msg, int size, int flags)
+			  struct msghdr *msg, size_t size, int flags)
 {
 	struct sock *sk = sock->sk;
 	struct sockaddr_llc *uaddr = (struct sockaddr_llc *)msg->msg_name;
 	struct sk_buff *skb;
-	int rc = -ENOMEM, copied = 0, timeout;
+	size_t copied = 0;
+	int rc = -ENOMEM, timeout;
 	int noblock = flags & MSG_DONTWAIT;
 
 	dprintk("%s: receiving in %02X from %02X\n", __FUNCTION__,
@@ -725,7 +726,7 @@
  *	Returns non-negative upon success, negative otherwise.
  */
 static int llc_ui_sendmsg(struct kiocb *iocb, struct socket *sock,
-			  struct msghdr *msg, int len)
+			  struct msghdr *msg, size_t len)
 {
 	struct sock *sk = sock->sk;
 	struct llc_opt *llc = llc_sk(sk);
@@ -734,7 +735,8 @@
 	int noblock = flags & MSG_DONTWAIT;
 	struct net_device *dev;
 	struct sk_buff *skb;
-	int rc = -EINVAL, size = 0, copied = 0, hdrlen;
+	size_t size = 0;
+	int rc = -EINVAL, copied = 0, hdrlen;
 
 	dprintk("%s: sending from %02X to %02X\n", __FUNCTION__,
 		llc->laddr.lsap, llc->daddr.lsap);
diff -Nru a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
--- a/net/netlink/af_netlink.c	Tue Feb  3 19:45:26 2004
+++ b/net/netlink/af_netlink.c	Tue Feb  3 19:45:26 2004
@@ -601,7 +601,7 @@
 }
 
 static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
-			   struct msghdr *msg, int len)
+			   struct msghdr *msg, size_t len)
 {
 	struct sock_iocb *siocb = kiocb_to_siocb(kiocb);
 	struct sock *sk = sock->sk;
@@ -641,7 +641,7 @@
 	}
 
 	err = -EMSGSIZE;
-	if ((unsigned)len > sk->sk_sndbuf - 32)
+	if (len > sk->sk_sndbuf - 32)
 		goto out;
 	err = -ENOBUFS;
 	skb = alloc_skb(len, GFP_KERNEL);
@@ -683,7 +683,7 @@
 }
 
 static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock,
-			   struct msghdr *msg, int len,
+			   struct msghdr *msg, size_t len,
 			   int flags)
 {
 	struct sock_iocb *siocb = kiocb_to_siocb(kiocb);
@@ -691,7 +691,7 @@
 	struct sock *sk = sock->sk;
 	struct netlink_opt *nlk = nlk_sk(sk);
 	int noblock = flags&MSG_DONTWAIT;
-	int copied;
+	size_t copied;
 	struct sk_buff *skb;
 	int err;
 
diff -Nru a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
--- a/net/netrom/af_netrom.c	Tue Feb  3 19:45:18 2004
+++ b/net/netrom/af_netrom.c	Tue Feb  3 19:45:18 2004
@@ -1010,7 +1010,7 @@
 }
 
 static int nr_sendmsg(struct kiocb *iocb, struct socket *sock,
-		      struct msghdr *msg, int len)
+		      struct msghdr *msg, size_t len)
 {
 	struct sock *sk = sock->sk;
 	nr_cb *nr = nr_sk(sk);
@@ -1101,7 +1101,12 @@
 	SOCK_DEBUG(sk, "NET/ROM: Appending user data\n");
 
 	/* User data follows immediately after the NET/ROM transport header */
-	memcpy_fromiovec(asmptr, msg->msg_iov, len);
+	if (memcpy_fromiovec(asmptr, msg->msg_iov, len)) {
+		kfree_skb(skb);
+		err = -EFAULT;
+		goto out;
+	}
+
 	SOCK_DEBUG(sk, "NET/ROM: Transmitting buffer\n");
 
 	if (sk->sk_state != TCP_ESTABLISHED) {
@@ -1119,11 +1124,11 @@
 }
 
 static int nr_recvmsg(struct kiocb *iocb, struct socket *sock,
-		      struct msghdr *msg, int size, int flags)
+		      struct msghdr *msg, size_t size, int flags)
 {
 	struct sock *sk = sock->sk;
 	struct sockaddr_ax25 *sax = (struct sockaddr_ax25 *)msg->msg_name;
-	int copied;
+	size_t copied;
 	struct sk_buff *skb;
 	int er;
 
diff -Nru a/net/packet/af_packet.c b/net/packet/af_packet.c
--- a/net/packet/af_packet.c	Tue Feb  3 19:45:33 2004
+++ b/net/packet/af_packet.c	Tue Feb  3 19:45:33 2004
@@ -284,7 +284,7 @@
  */
  
 static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
-			       struct msghdr *msg, int len)
+			       struct msghdr *msg, size_t len)
 {
 	struct sock *sk = sock->sk;
 	struct sockaddr_pkt *saddr=(struct sockaddr_pkt *)msg->msg_name;
@@ -659,7 +659,7 @@
 
 
 static int packet_sendmsg(struct kiocb *iocb, struct socket *sock,
-			  struct msghdr *msg, int len)
+			  struct msghdr *msg, size_t len)
 {
 	struct sock *sk = sock->sk;
 	struct sockaddr_ll *saddr=(struct sockaddr_ll *)msg->msg_name;
@@ -1007,7 +1007,7 @@
  */
 
 static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
-			  struct msghdr *msg, int len, int flags)
+			  struct msghdr *msg, size_t len, int flags)
 {
 	struct sock *sk = sock->sk;
 	struct sk_buff *skb;
@@ -1550,7 +1550,7 @@
 	unsigned long *pg_vec = NULL;
 	struct tpacket_hdr **io_vec = NULL;
 	struct packet_opt *po = pkt_sk(sk);
-	int order = 0;
+	int was_running, num, order = 0;
 	int err = 0;
 
 	if (req->tp_block_nr) {
@@ -1623,10 +1623,13 @@
 
 	/* Detach socket from network */
 	spin_lock(&po->bind_lock);
-	if (po->running) {
+	was_running = po->running;
+	num = po->num;
+	if (was_running) {
 		__dev_remove_pack(&po->prot_hook);
 		po->num = 0;
 		po->running = 0;
+		__sock_put(sk);
 	}
 	spin_unlock(&po->bind_lock);
 		
@@ -1657,8 +1660,12 @@
 	}
 
 	spin_lock(&po->bind_lock);
-	if (po->running)
+	if (was_running && !po->running) {
+		sock_hold(sk);
+		po->running = 1;
+		po->num = num;
 		dev_add_pack(&po->prot_hook);
+	}
 	spin_unlock(&po->bind_lock);
 
 	release_sock(sk);
diff -Nru a/net/rose/af_rose.c b/net/rose/af_rose.c
--- a/net/rose/af_rose.c	Tue Feb  3 19:45:18 2004
+++ b/net/rose/af_rose.c	Tue Feb  3 19:45:18 2004
@@ -1010,7 +1010,7 @@
 }
 
 static int rose_sendmsg(struct kiocb *iocb, struct socket *sock,
-			struct msghdr *msg, int len)
+			struct msghdr *msg, size_t len)
 {
 	struct sock *sk = sock->sk;
 	rose_cb *rose = rose_sk(sk);
@@ -1083,7 +1083,11 @@
 
 	asmptr = skb->h.raw = skb_put(skb, len);
 
-	memcpy_fromiovec(asmptr, msg->msg_iov, len);
+	err = memcpy_fromiovec(asmptr, msg->msg_iov, len);
+	if (err) {
+		kfree_skb(skb);
+		return err;
+	}
 
 	/*
 	 *	If the Q BIT Include socket option is in force, the first
@@ -1133,8 +1137,10 @@
 		frontlen = skb_headroom(skb);
 
 		while (skb->len > 0) {
-			if ((skbn = sock_alloc_send_skb(sk, frontlen + ROSE_PACLEN, 0, &err)) == NULL)
+			if ((skbn = sock_alloc_send_skb(sk, frontlen + ROSE_PACLEN, 0, &err)) == NULL) {
+				kfree_skb(skb);
 				return err;
+			}
 
 			skbn->sk   = sk;
 			skbn->free = 1;
@@ -1159,7 +1165,7 @@
 		}
 
 		skb->free = 1;
-		kfree_skb(skb, FREE_WRITE);
+		kfree_skb(skb);
 	} else {
 		skb_queue_tail(&sk->sk_write_queue, skb);		/* Throw it on the queue */
 	}
@@ -1174,15 +1180,15 @@
 
 
 static int rose_recvmsg(struct kiocb *iocb, struct socket *sock,
-			struct msghdr *msg, int size, int flags)
+			struct msghdr *msg, size_t size, int flags)
 {
 	struct sock *sk = sock->sk;
 	rose_cb *rose = rose_sk(sk);
 	struct sockaddr_rose *srose = (struct sockaddr_rose *)msg->msg_name;
-	int copied, qbit;
+	size_t copied;
 	unsigned char *asmptr;
 	struct sk_buff *skb;
-	int n, er;
+	int n, er, qbit;
 
 	/*
 	 * This works for seqpacket too. The receiver has ordered the queue for
diff -Nru a/net/rxrpc/call.c b/net/rxrpc/call.c
--- a/net/rxrpc/call.c	Tue Feb  3 19:45:41 2004
+++ b/net/rxrpc/call.c	Tue Feb  3 19:45:41 2004
@@ -699,7 +699,7 @@
 
 		timo = rxrpc_call_dfr_ack_timeout + jiffies;
 
-		_debug("START ACKR TIMER for cj=%lu", timo-call->cjif);
+		_debug("START ACKR TIMER for cj=%lu", timo - call->cjif);
 
 		spin_lock(&call->lock);
 		mod_timer(&call->ackr_dfr_timo, timo);
@@ -722,7 +722,8 @@
 
 		/* fill out the appropriate form */
 		ack.bufferSpace	= htons(RXRPC_CALL_ACK_WINDOW_SIZE);
-		ack.maxSkew	= htons(min(call->ackr_high_seq - seq,65535U));
+		ack.maxSkew	= htons(min(call->ackr_high_seq - seq,
+					    65535U));
 		ack.firstPacket	= htonl(call->ackr_win_bot);
 		ack.previousPacket = call->ackr_prev_seq;
 		ack.serial	= hdr->serial;
@@ -825,7 +826,7 @@
 
 	_leave("");
 
-} /* end rxrpc_call_do_timeout() */
+} /* end rxrpc_call_do_stuff() */
 
 /*****************************************************************************/
 /*
@@ -1061,7 +1062,7 @@
 		_debug("Call add packet %d to unreadyq", msg->seq);
 
 		/* insert in seq order */
-		list_for_each(_p,&call->app_unreadyq) {
+		list_for_each(_p, &call->app_unreadyq) {
 			pmsg = list_entry(_p, struct rxrpc_message, link);
 			if (pmsg->seq > msg->seq)
 				break;
@@ -2095,7 +2096,8 @@
 
 		if (msg->hdr.flags & RXRPC_LAST_PACKET) {
 			msg->hdr.flags &= ~RXRPC_MORE_PACKETS;
-			msg->hdr.flags |= RXRPC_REQUEST_ACK;
+			if (call->app_call_state != RXRPC_CSTATE_CLNT_SND_ARGS)
+				msg->hdr.flags |= RXRPC_REQUEST_ACK;
 		}
 		else {
 			msg->hdr.flags |= RXRPC_MORE_PACKETS;
diff -Nru a/net/rxrpc/krxiod.c b/net/rxrpc/krxiod.c
--- a/net/rxrpc/krxiod.c	Tue Feb  3 19:45:16 2004
+++ b/net/rxrpc/krxiod.c	Tue Feb  3 19:45:16 2004
@@ -44,12 +44,6 @@
 
 	daemonize("krxiod");
 
-	/* only certain signals are of interest */
-	spin_lock_irq(&current->sighand->siglock);
-	siginitsetinv(&current->blocked, 0);
-	recalc_sigpending();
-	spin_unlock_irq(&current->sighand->siglock);
-
 	/* loop around waiting for work to do */
 	do {
 		/* wait for work or to be told to exit */
@@ -116,7 +110,7 @@
 
 			if (!list_empty(&rxrpc_krxiod_callq)) {
 				call = list_entry(rxrpc_krxiod_callq.next,
-						   struct rxrpc_call,
+						  struct rxrpc_call,
 						  rcv_krxiodq_lk);
 				list_del_init(&call->rcv_krxiodq_lk);
 				atomic_dec(&rxrpc_krxiod_qcount);
@@ -125,7 +119,7 @@
 				 * away */
 				if (atomic_read(&call->usage) > 0) {
 					_debug("@@@ KRXIOD"
-					       " Begin Attend Call %p",call);
+					       " Begin Attend Call %p", call);
 					rxrpc_get_call(call);
 				}
 				else {
diff -Nru a/net/rxrpc/krxsecd.c b/net/rxrpc/krxsecd.c
--- a/net/rxrpc/krxsecd.c	Tue Feb  3 19:45:17 2004
+++ b/net/rxrpc/krxsecd.c	Tue Feb  3 19:45:17 2004
@@ -57,12 +57,6 @@
 
 	daemonize("krxsecd");
 
-	/* only certain signals are of interest */
-	spin_lock_irq(&current->sighand->siglock);
-	siginitsetinv(&current->blocked, 0);
-	recalc_sigpending();
-	spin_unlock_irq(&current->sighand->siglock);
-
 	/* loop around waiting for work to do */
 	do {
 		/* wait for work or to be told to exit */
diff -Nru a/net/rxrpc/krxtimod.c b/net/rxrpc/krxtimod.c
--- a/net/rxrpc/krxtimod.c	Tue Feb  3 19:45:17 2004
+++ b/net/rxrpc/krxtimod.c	Tue Feb  3 19:45:17 2004
@@ -74,12 +74,6 @@
 
 	complete(&krxtimod_alive);
 
-	/* only certain signals are of interest */
-	spin_lock_irq(&current->sighand->siglock);
-	siginitsetinv(&current->blocked, 0);
-	recalc_sigpending();
-	spin_unlock_irq(&current->sighand->siglock);
-
 	/* loop around looking for things to attend to */
  loop:
 	set_current_state(TASK_INTERRUPTIBLE);
diff -Nru a/net/rxrpc/transport.c b/net/rxrpc/transport.c
--- a/net/rxrpc/transport.c	Tue Feb  3 19:45:34 2004
+++ b/net/rxrpc/transport.c	Tue Feb  3 19:45:34 2004
@@ -130,7 +130,19 @@
 	return 0;
 
  error:
-	rxrpc_put_transport(trans);
+	/* finish cleaning up the transport (not really needed here, but...) */
+	if (trans->socket)
+		trans->socket->ops->shutdown(trans->socket, 2);
+
+	/* close the socket */
+	if (trans->socket) {
+		trans->socket->sk->sk_user_data = NULL;
+		sock_release(trans->socket);
+		trans->socket = NULL;
+	}
+
+	kfree(trans);
+
 
 	_leave(" = %d", ret);
 	return ret;
diff -Nru a/net/sched/sch_teql.c b/net/sched/sch_teql.c
--- a/net/sched/sch_teql.c	Tue Feb  3 19:45:17 2004
+++ b/net/sched/sch_teql.c	Tue Feb  3 19:45:17 2004
@@ -456,7 +456,6 @@
 }
 
 static LIST_HEAD(master_dev_list);
-static spinlock_t master_dev_lock = SPIN_LOCK_UNLOCKED;
 static int max_equalizers = 1;
 MODULE_PARM(max_equalizers, "i");
 MODULE_PARM_DESC(max_equalizers, "Max number of link equalizers");
@@ -475,13 +474,13 @@
 		if (!dev)
 			return -ENOMEM;
 
-		if ((err = register_netdev(dev)))
+		if ((err = register_netdev(dev))) {
+			free_netdev(dev);
 			goto out;
+		}
 
 		master = dev->priv;
-		spin_lock(&master_dev_lock);
 		list_add_tail(&master->master_list, &master_dev_list);
-		spin_unlock(&master_dev_lock);
 	}
  out:
 	return err;
@@ -491,7 +490,6 @@
 {
 	struct teql_master *master, *nxt;
 
-	spin_lock(&master_dev_lock);
 	list_for_each_entry_safe(master, nxt, &master_dev_list, master_list) {
 
 		list_del(&master->master_list);
@@ -500,7 +498,6 @@
 		unregister_netdev(master->dev);
 		free_netdev(master->dev);
 	}
-	spin_unlock(&master_dev_lock);
 }
 
 module_init(teql_init);
diff -Nru a/net/sctp/associola.c b/net/sctp/associola.c
--- a/net/sctp/associola.c	Tue Feb  3 19:45:16 2004
+++ b/net/sctp/associola.c	Tue Feb  3 19:45:16 2004
@@ -362,6 +362,14 @@
 
 	asoc->eyecatcher = 0;
 
+	/* Free any cached ASCONF_ACK chunk. */
+	if (asoc->addip_last_asconf_ack)
+		sctp_chunk_free(asoc->addip_last_asconf_ack);
+
+	/* Free any cached ASCONF chunk. */
+	if (asoc->addip_last_asconf)
+		sctp_chunk_free(asoc->addip_last_asconf);
+
 	sctp_association_put(asoc);
 }
 
@@ -523,6 +531,45 @@
 		asoc->peer.retran_path = peer;
 
 	return peer;
+}
+
+/* Delete a transport address from an association.  */
+void sctp_assoc_del_peer(struct sctp_association *asoc,
+			 const union sctp_addr *addr)
+{
+	struct list_head	*pos;
+	struct list_head	*temp;
+	struct sctp_transport	*peer = NULL;
+	struct sctp_transport	*transport;
+
+	list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
+		transport = list_entry(pos, struct sctp_transport, transports);
+		if (sctp_cmp_addr_exact(addr, &transport->ipaddr)) {
+			peer = transport;
+			list_del(pos);
+			break;
+		}
+	}
+
+	/* The address we want delete is not in the association. */
+	if (!peer)
+		return;
+
+	/* Get the first transport of asoc. */ 
+	pos = asoc->peer.transport_addr_list.next;
+	transport = list_entry(pos, struct sctp_transport, transports);
+
+	/* Update any entries that match the peer to be deleted. */  
+	if (asoc->peer.primary_path == peer)
+		sctp_assoc_set_primary(asoc, transport);
+	if (asoc->peer.active_path == peer)
+		asoc->peer.active_path = transport;
+	if (asoc->peer.retran_path == peer)
+		asoc->peer.retran_path = transport;
+	if (asoc->peer.last_data_from == peer)
+		asoc->peer.last_data_from = transport;
+
+	sctp_transport_free(peer);
 }
 
 /* Lookup a transport by address. */
diff -Nru a/net/sctp/input.c b/net/sctp/input.c
--- a/net/sctp/input.c	Tue Feb  3 19:45:16 2004
+++ b/net/sctp/input.c	Tue Feb  3 19:45:16 2004
@@ -124,16 +124,16 @@
 	/* Pull up the IP and SCTP headers. */
 	__skb_pull(skb, skb->h.raw - skb->data);
 	if (skb->len < sizeof(struct sctphdr))
-		goto bad_packet;
+		goto discard_it;
 	if (sctp_rcv_checksum(skb) < 0)
-		goto bad_packet;
+		goto discard_it;
 
 	skb_pull(skb, sizeof(struct sctphdr));
 
 	family = ipver2af(skb->nh.iph->version);
 	af = sctp_get_af_specific(family);
 	if (unlikely(!af))
-		goto bad_packet;
+		goto discard_it;
 
 	/* Initialize local addresses for lookups. */
 	af->from_skb(&src, skb, 1);
@@ -222,9 +222,6 @@
 		sctp_endpoint_put(ep);
 	sock_put(sk);
 	return ret;
-
-bad_packet:
-	SCTP_INC_STATS(SctpChecksumErrors);
 
 discard_it:
 	kfree_skb(skb);
diff -Nru a/net/sctp/ipv6.c b/net/sctp/ipv6.c
--- a/net/sctp/ipv6.c	Tue Feb  3 19:45:30 2004
+++ b/net/sctp/ipv6.c	Tue Feb  3 19:45:30 2004
@@ -510,7 +510,7 @@
 	if (!(type & IPV6_ADDR_UNICAST))
 		return 0;
 
-	return ipv6_chk_addr(in6, NULL);
+	return ipv6_chk_addr(in6, NULL, 0);
 }
 
 /* This function checks if the address is a valid address to be used for
diff -Nru a/net/sctp/output.c b/net/sctp/output.c
--- a/net/sctp/output.c	Tue Feb  3 19:45:17 2004
+++ b/net/sctp/output.c	Tue Feb  3 19:45:17 2004
@@ -1,7 +1,7 @@
 /* SCTP kernel reference Implementation
+ * (C) Copyright IBM Corp. 2001, 2004
  * Copyright (c) 1999-2000 Cisco, Inc.
  * Copyright (c) 1999-2001 Motorola, Inc.
- * Copyright (c) 2001-2003 International Business Machines, Corp.
  *
  * This file is part of the SCTP kernel reference Implementation
  *
@@ -350,7 +350,6 @@
 	 */
 	SCTP_DEBUG_PRINTK("***sctp_transmit_packet***\n");
 	while ((chunk = (struct sctp_chunk *)__skb_dequeue(&packet->chunks))) {
-
 		if (sctp_chunk_is_data(chunk)) {
 
 			if (!chunk->has_tsn) {
diff -Nru a/net/sctp/outqueue.c b/net/sctp/outqueue.c
--- a/net/sctp/outqueue.c	Tue Feb  3 19:45:17 2004
+++ b/net/sctp/outqueue.c	Tue Feb  3 19:45:17 2004
@@ -150,7 +150,7 @@
 	if (!primary->cacc.cycling_changeover) {
 		if (sctp_cacc_skip_3_1_d(primary, transport, count_of_newacks))
 			return 1;
-		if (sctp_cacc_skip_3_1_f(transport, count_of_newacks));
+		if (sctp_cacc_skip_3_1_f(transport, count_of_newacks))
 			return 1;
 		return 0;
 	}
diff -Nru a/net/sctp/protocol.c b/net/sctp/protocol.c
--- a/net/sctp/protocol.c	Tue Feb  3 19:45:30 2004
+++ b/net/sctp/protocol.c	Tue Feb  3 19:45:30 2004
@@ -1115,6 +1115,9 @@
 			 "(established %d bind %d)\n",
 		sctp_assoc_hashsize, sctp_port_hashsize);
 
+	/* Disable ADDIP by default. */
+	sctp_addip_enable = 0;
+
 	sctp_sysctl_register();
 
 	INIT_LIST_HEAD(&sctp_address_families);
diff -Nru a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
--- a/net/sctp/sm_make_chunk.c	Tue Feb  3 19:45:17 2004
+++ b/net/sctp/sm_make_chunk.c	Tue Feb  3 19:45:17 2004
@@ -1441,6 +1441,7 @@
 
 	retval->next_tsn = retval->c.initial_tsn;
 	retval->ctsn_ack_point = retval->next_tsn - 1;
+	retval->addip_serial = retval->c.initial_tsn;
 
 	/* The INIT stuff will be done by the side effects.  */
 	return retval;
@@ -2035,7 +2036,7 @@
 	if (!retval)
 		return NULL;
 
-	asconf.serial = asoc->addip_serial++;
+	asconf.serial = htonl(asoc->addip_serial++);
 
 	retval->subh.addip_hdr =
 		sctp_addto_chunk(retval, sizeof(asconf), &asconf);
@@ -2073,7 +2074,7 @@
 					      union sctp_addr	      *laddr,
 					      struct sockaddr	      *addrs,
 					      int		      addrcnt,
-					      int		      flags)
+					      __u16		      flags)
 {
 	sctp_addip_param_t	param;
 	struct sctp_chunk	*retval;
@@ -2112,7 +2113,7 @@
 		addr_param_len = af->to_addr_param(addr, &addr_param);
 		param.param_hdr.type = flags;
 		param.param_hdr.length = htons(paramlen + addr_param_len);
-		param.crr_id = htonl(i);
+		param.crr_id = i;
 
 		sctp_addto_chunk(retval, paramlen, &param);
 		sctp_addto_chunk(retval, addr_param_len, &addr_param);
@@ -2185,8 +2186,8 @@
  *
  * Create an ASCONF_ACK chunk with enough space for the parameter responses. 
  */
-struct sctp_chunk *sctp_make_asconf_ack(struct sctp_association	*asoc,
-					int serial, int vparam_len)
+struct sctp_chunk *sctp_make_asconf_ack(const struct sctp_association *asoc,
+					__u32 serial, int vparam_len)
 {
 	sctp_addiphdr_t		asconf;
 	struct sctp_chunk	*retval;
@@ -2197,7 +2198,7 @@
 	if (!retval)
 		return NULL;
 
-	asconf.serial = serial;
+	asconf.serial = htonl(serial);
 
 	retval->subh.addip_hdr =
 		sctp_addto_chunk(retval, sizeof(asconf), &asconf);
@@ -2205,10 +2206,407 @@
 	return retval;
 }
 
+/* Add response parameters to an ASCONF_ACK chunk. */
+static void sctp_add_asconf_response(struct sctp_chunk *chunk, __u32 crr_id,
+			      __u16 err_code, sctp_addip_param_t *asconf_param)
+{
+	sctp_addip_param_t 	ack_param;
+	sctp_errhdr_t		err_param;
+	int			asconf_param_len = 0;
+	int			err_param_len = 0;
+	__u16			response_type;
+
+	if (SCTP_ERROR_NO_ERROR == err_code) {
+		response_type = SCTP_PARAM_SUCCESS_REPORT;
+	} else {
+		response_type = SCTP_PARAM_ERR_CAUSE;
+		err_param_len = sizeof(err_param);
+		if (asconf_param)
+			asconf_param_len =
+				 ntohs(asconf_param->param_hdr.length);
+	}
+
+	/* Add Success Indication or Error Cause Indication parameter. */ 
+	ack_param.param_hdr.type = response_type;
+	ack_param.param_hdr.length = htons(sizeof(ack_param) +
+					   err_param_len +
+					   asconf_param_len);
+	ack_param.crr_id = crr_id;
+	sctp_addto_chunk(chunk, sizeof(ack_param), &ack_param);
+
+	if (SCTP_ERROR_NO_ERROR == err_code)
+		return;
+
+	/* Add Error Cause parameter. */
+	err_param.cause = err_code;
+	err_param.length = htons(err_param_len + asconf_param_len);
+	sctp_addto_chunk(chunk, err_param_len, &err_param);
+
+	/* Add the failed TLV copied from ASCONF chunk. */
+	if (asconf_param)
+		sctp_addto_chunk(chunk, asconf_param_len, asconf_param);
+}
+
+/* Process a asconf parameter. */
+static __u16 sctp_process_asconf_param(struct sctp_association *asoc,
+				       struct sctp_chunk *asconf,
+				       sctp_addip_param_t *asconf_param)
+{
+	struct sctp_transport *peer;
+	struct sctp_af *af;
+	union sctp_addr	addr;
+	struct list_head *pos;
+	union sctp_addr_param *addr_param;
+				 
+	addr_param = (union sctp_addr_param *)
+			((void *)asconf_param + sizeof(sctp_addip_param_t));
+
+	af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type));
+	if (unlikely(!af))
+		return SCTP_ERROR_INV_PARAM;
+
+	af->from_addr_param(&addr, addr_param, asoc->peer.port, 0);
+	switch (asconf_param->param_hdr.type) {
+	case SCTP_PARAM_ADD_IP:
+		/* ADDIP 4.3 D9) If an endpoint receives an ADD IP address
+	 	 * request and does not have the local resources to add this
+	 	 * new address to the association, it MUST return an Error
+	 	 * Cause TLV set to the new error code 'Operation Refused
+	 	 * Due to Resource Shortage'.
+	 	 */
+
+		peer = sctp_assoc_add_peer(asoc, &addr, GFP_ATOMIC);
+		if (!peer)
+			return SCTP_ERROR_RSRC_LOW;
+
+		/* Start the heartbeat timer. */
+		if (!mod_timer(&peer->hb_timer, sctp_transport_timeout(peer)))
+			sctp_transport_hold(peer);
+		break;
+	case SCTP_PARAM_DEL_IP:
+		/* ADDIP 4.3 D7) If a request is received to delete the
+	 	 * last remaining IP address of a peer endpoint, the receiver
+	 	 * MUST send an Error Cause TLV with the error cause set to the
+	 	 * new error code 'Request to Delete Last Remaining IP Address'.
+	 	 */
+		pos = asoc->peer.transport_addr_list.next;
+		if (pos->next == &asoc->peer.transport_addr_list)
+			return SCTP_ERROR_DEL_LAST_IP;
+
+		/* ADDIP 4.3 D8) If a request is received to delete an IP
+		 * address which is also the source address of the IP packet
+		 * which contained the ASCONF chunk, the receiver MUST reject
+		 * this request. To reject the request the receiver MUST send
+		 * an Error Cause TLV set to the new error code 'Request to
+		 * Delete Source IP Address'
+		 */
+		if (sctp_cmp_addr_exact(sctp_source(asconf), &addr))
+			return SCTP_ERROR_DEL_SRC_IP;
+
+		sctp_assoc_del_peer(asoc, &addr);
+		break;
+	case SCTP_PARAM_SET_PRIMARY:
+		peer = sctp_assoc_lookup_paddr(asoc, &addr);
+		if (!peer)
+			return SCTP_ERROR_INV_PARAM;
+
+		sctp_assoc_set_primary(asoc, peer);
+		break;
+	default:
+		return SCTP_ERROR_INV_PARAM;
+		break;
+	}
+
+	return SCTP_ERROR_NO_ERROR;
+}
+
+/* Process an incoming ASCONF chunk with the next expected serial no. and 
+ * return an ASCONF_ACK chunk to be sent in response.
+ */
 struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
-					struct sctp_chunk *asconf,
-					int vparam_len)
+				       struct sctp_chunk *asconf)
 {
-	// FIXME: process asconf chunk
-	return NULL;
+	sctp_addiphdr_t		*hdr;
+	union sctp_addr_param	*addr_param;
+	sctp_addip_param_t	*asconf_param;
+	struct sctp_chunk	*asconf_ack;
+
+	__u16	err_code;
+	int	length = 0;
+	int	chunk_len = asconf->skb->len;
+	__u32	serial;
+	int	all_param_pass = 1;
+
+	hdr = (sctp_addiphdr_t *)asconf->skb->data;
+	serial = ntohl(hdr->serial);
+
+	/* Skip the addiphdr and store a pointer to address parameter.  */ 
+	length = sizeof(sctp_addiphdr_t);
+	addr_param = (union sctp_addr_param *)(asconf->skb->data + length);
+	chunk_len -= length;
+
+	/* Skip the address parameter and store a pointer to the first
+	 * asconf paramter.
+	 */ 
+	length = ntohs(addr_param->v4.param_hdr.length);
+	asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
+	chunk_len -= length;
+
+	/* create an ASCONF_ACK chunk. 
+	 * Based on the definitions of parameters, we know that the size of
+	 * ASCONF_ACK parameters are less than or equal to the twice of ASCONF
+	 * paramters.
+	 */
+	asconf_ack = sctp_make_asconf_ack(asoc, serial, chunk_len * 2);
+	if (!asconf_ack)
+		goto done;
+
+	/* Process the TLVs contained within the ASCONF chunk. */
+	while (chunk_len > 0) {
+		err_code = sctp_process_asconf_param(asoc, asconf,
+						     asconf_param);
+		/* ADDIP 4.1 A7)
+		 * If an error response is received for a TLV parameter,
+		 * all TLVs with no response before the failed TLV are
+		 * considered successful if not reported.  All TLVs after
+		 * the failed response are considered unsuccessful unless
+		 * a specific success indication is present for the parameter.
+		 */
+		if (SCTP_ERROR_NO_ERROR != err_code)
+			all_param_pass = 0;
+
+		if (!all_param_pass)
+			sctp_add_asconf_response(asconf_ack,
+						 asconf_param->crr_id, err_code,
+						 asconf_param);
+
+		/* ADDIP 4.3 D11) When an endpoint receiving an ASCONF to add
+		 * an IP address sends an 'Out of Resource' in its response, it
+		 * MUST also fail any subsequent add or delete requests bundled
+		 * in the ASCONF. 
+		 */
+		if (SCTP_ERROR_RSRC_LOW == err_code)
+			goto done;
+
+		/* Move to the next ASCONF param. */
+		length = ntohs(asconf_param->param_hdr.length);
+		asconf_param = (sctp_addip_param_t *)((void *)asconf_param +
+						      length);
+		chunk_len -= length;
+	}
+	
+done:
+	asoc->peer.addip_serial++;
+
+	/* If we are sending a new ASCONF_ACK hold a reference to it in assoc
+	 * after freeing the reference to old asconf ack if any. 
+	 */
+	if (asconf_ack) {
+		if (asoc->addip_last_asconf_ack)
+			sctp_chunk_free(asoc->addip_last_asconf_ack);
+
+		sctp_chunk_hold(asconf_ack);
+		asoc->addip_last_asconf_ack = asconf_ack;
+	}
+
+	return asconf_ack;
+}
+
+/* Process a asconf parameter that is successfully acked. */
+static int sctp_asconf_param_success(struct sctp_association *asoc,
+				     sctp_addip_param_t *asconf_param)
+{
+	struct sctp_af *af;
+	union sctp_addr	addr;
+	struct sctp_bind_addr *bp = &asoc->base.bind_addr;
+	union sctp_addr_param *addr_param;
+	int retval = 0;
+
+	addr_param = (union sctp_addr_param *)
+			((void *)asconf_param + sizeof(sctp_addip_param_t));
+
+	/* We have checked the packet before, so we do not check again.	*/
+	af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type));
+	af->from_addr_param(&addr, addr_param, bp->port, 0);
+
+	switch (asconf_param->param_hdr.type) {
+	case SCTP_PARAM_ADD_IP:
+		sctp_local_bh_disable();
+		sctp_write_lock(&asoc->base.addr_lock);
+		retval = sctp_add_bind_addr(bp, &addr, GFP_ATOMIC);
+		sctp_write_unlock(&asoc->base.addr_lock);
+		sctp_local_bh_enable();
+		break;
+	case SCTP_PARAM_DEL_IP:
+		sctp_local_bh_disable();
+		sctp_write_lock(&asoc->base.addr_lock);
+		retval = sctp_del_bind_addr(bp, &addr);
+		sctp_write_unlock(&asoc->base.addr_lock);
+		sctp_local_bh_enable();
+		break;
+	default:
+		break;
+	}
+
+	return retval;
+}
+
+/* Get the corresponding ASCONF response error code from the ASCONF_ACK chunk
+ * for the given asconf parameter.  If there is no response for this parameter,
+ * return the error code based on the third argument 'no_err'. 
+ * ADDIP 4.1
+ * A7) If an error response is received for a TLV parameter, all TLVs with no
+ * response before the failed TLV are considered successful if not reported.
+ * All TLVs after the failed response are considered unsuccessful unless a
+ * specific success indication is present for the parameter.
+ */
+static __u16 sctp_get_asconf_response(struct sctp_chunk *asconf_ack,
+				      sctp_addip_param_t *asconf_param,
+				      int no_err)
+{
+	sctp_addip_param_t	*asconf_ack_param;
+	sctp_errhdr_t		*err_param;
+	int			length;
+	int			asconf_ack_len = asconf_ack->skb->len;
+	__u16			err_code;
+
+	if (no_err)
+		err_code = SCTP_ERROR_NO_ERROR;
+	else
+		err_code = SCTP_ERROR_REQ_REFUSED;
+
+	/* Skip the addiphdr from the asconf_ack chunk and store a pointer to
+	 * the first asconf_ack parameter.
+	 */ 
+	length = sizeof(sctp_addiphdr_t);
+	asconf_ack_param = (sctp_addip_param_t *)(asconf_ack->skb->data +
+						  length);
+	asconf_ack_len -= length;
+
+	while (asconf_ack_len > 0) {
+		if (asconf_ack_param->crr_id == asconf_param->crr_id) {
+			switch(asconf_ack_param->param_hdr.type) {
+			case SCTP_PARAM_SUCCESS_REPORT:
+				return SCTP_ERROR_NO_ERROR;
+			case SCTP_PARAM_ERR_CAUSE:
+				length = sizeof(sctp_addip_param_t);
+				err_param = (sctp_errhdr_t *)
+					   ((void *)asconf_ack_param + length);
+				asconf_ack_len -= length;
+				if (asconf_ack_len > 0)
+					return err_param->cause;
+				else
+					return SCTP_ERROR_INV_PARAM;
+				break;
+			default:
+				return SCTP_ERROR_INV_PARAM;
+			}
+		}
+
+		length = ntohs(asconf_ack_param->param_hdr.length);
+		asconf_ack_param = (sctp_addip_param_t *)
+					((void *)asconf_ack_param + length);
+		asconf_ack_len -= length;
+	}
+
+	return err_code;
+}
+
+/* Process an incoming ASCONF_ACK chunk against the cached last ASCONF chunk. */
+int sctp_process_asconf_ack(struct sctp_association *asoc,
+			    struct sctp_chunk *asconf_ack)
+{
+	struct sctp_chunk	*asconf = asoc->addip_last_asconf;
+	union sctp_addr_param	*addr_param;
+	sctp_addip_param_t	*asconf_param;
+	int	length = 0;
+	int	asconf_len = asconf->skb->len;
+	int	all_param_pass = 0;
+	int	no_err = 1;
+	int	retval = 0;
+	__u16	err_code = SCTP_ERROR_NO_ERROR;
+
+	/* Skip the chunkhdr and addiphdr from the last asconf sent and store
+	 * a pointer to address parameter.
+	 */ 
+	length = sizeof(sctp_addip_chunk_t);
+	addr_param = (union sctp_addr_param *)(asconf->skb->data + length);
+	asconf_len -= length;
+
+	/* Skip the address parameter in the last asconf sent and store a
+	 * pointer to the first asconf paramter.
+	 */ 
+	length = ntohs(addr_param->v4.param_hdr.length);
+	asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
+	asconf_len -= length;
+
+	/* ADDIP 4.1
+	 * A8) If there is no response(s) to specific TLV parameter(s), and no
+	 * failures are indicated, then all request(s) are considered
+	 * successful.
+	 */
+	if (asconf_ack->skb->len == sizeof(sctp_addiphdr_t))
+		all_param_pass = 1;
+
+	/* Process the TLVs contained in the last sent ASCONF chunk. */
+	while (asconf_len > 0) {
+		if (all_param_pass)
+			err_code = SCTP_ERROR_NO_ERROR;
+		else {
+			err_code = sctp_get_asconf_response(asconf_ack,
+							    asconf_param,
+							    no_err);
+			if (no_err && (SCTP_ERROR_NO_ERROR != err_code))
+				no_err = 0;
+		}
+
+		switch (err_code) {
+		case SCTP_ERROR_NO_ERROR:
+			retval = sctp_asconf_param_success(asoc, asconf_param);
+			break;
+
+		case SCTP_ERROR_RSRC_LOW:
+			retval = 1;
+			break;
+
+		case SCTP_ERROR_INV_PARAM:
+			/* Disable sending this type of asconf parameter in
+			 * future.
+			 */	
+			asoc->peer.addip_disabled_mask |=
+				asconf_param->param_hdr.type;
+			break;
+
+		case SCTP_ERROR_REQ_REFUSED:
+		case SCTP_ERROR_DEL_LAST_IP:
+		case SCTP_ERROR_DEL_SRC_IP:
+		default:
+			 break;
+		}
+
+		/* Skip the processed asconf parameter and move to the next
+		 * one.
+	 	 */ 
+		length = ntohs(asconf_param->param_hdr.length);
+		asconf_param = (sctp_addip_param_t *)((void *)asconf_param +
+						      length);
+		asconf_len -= length;
+	}
+
+	/* Free the cached last sent asconf chunk. */
+	sctp_chunk_free(asconf);
+	asoc->addip_last_asconf = NULL;
+
+	/* Send the next asconf chunk from the addip chunk queue. */
+	asconf = (struct sctp_chunk *)__skb_dequeue(&asoc->addip_chunks);
+	if (asconf) {
+		/* Hold the chunk until an ASCONF_ACK is received. */
+		sctp_chunk_hold(asconf);
+		if (sctp_primitive_ASCONF(asoc, asconf))
+			sctp_chunk_free(asconf);
+		else
+			asoc->addip_last_asconf = asconf;
+	}
+
+	return retval;
 }
diff -Nru a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
--- a/net/sctp/sm_sideeffect.c	Tue Feb  3 19:45:33 2004
+++ b/net/sctp/sm_sideeffect.c	Tue Feb  3 19:45:33 2004
@@ -1,5 +1,5 @@
 /* SCTP kernel reference Implementation
- * (C) Copyright IBM Corp. 2001, 2003
+ * (C) Copyright IBM Corp. 2001, 2004
  * Copyright (c) 1999 Cisco, Inc.
  * Copyright (c) 1999-2001 Motorola, Inc.
  *
@@ -663,10 +663,11 @@
 	struct sock *sk = asoc->base.sk;
 
 	/* If it is a non-temporary association belonging to a TCP-style
-	 * listening socket, do not free it so that accept() can pick it
-	 * up later.
+	 * listening socket that is not closed, do not free it so that accept() 
+	 * can pick it up later.
 	 */ 
-	if (sctp_style(sk, TCP) && sctp_sstate(sk, LISTENING) && (!asoc->temp))
+	if (sctp_style(sk, TCP) && sctp_sstate(sk, LISTENING) &&
+	    (!asoc->temp) && (sk->sk_shutdown != SHUTDOWN_MASK))
 		return;
 
 	sctp_unhash_established(asoc);
@@ -676,8 +677,8 @@
 /*
  * ADDIP Section 4.1 ASCONF Chunk Procedures
  * A4) Start a T-4 RTO timer, using the RTO value of the selected
- * destination address (normally the primary path; see RFC2960
- * section 6.4 for details).
+ * destination address (we use active path instead of primary path just
+ * because primary path may be inactive. 
  */
 static void sctp_cmd_setup_t4(sctp_cmd_seq_t *cmds,
 				struct sctp_association *asoc,
@@ -685,7 +686,7 @@
 {
 	struct sctp_transport *t;
 
-	t = asoc->peer.primary_path;
+	t = asoc->peer.active_path;
 	asoc->timeouts[SCTP_EVENT_TIMEOUT_T4_RTO] = t->rto;
 	chunk->transport = t;
 }
diff -Nru a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
--- a/net/sctp/sm_statefuns.c	Tue Feb  3 19:45:16 2004
+++ b/net/sctp/sm_statefuns.c	Tue Feb  3 19:45:16 2004
@@ -1,5 +1,5 @@
 /* SCTP kernel reference Implementation
- * (C) Copyright IBM Corp. 2001, 2003
+ * (C) Copyright IBM Corp. 2001, 2004
  * Copyright (c) 1999-2000 Cisco, Inc.
  * Copyright (c) 1999-2001 Motorola, Inc.
  * Copyright (c) 2001-2002 Intel Corp.
@@ -46,6 +46,7 @@
  *    Daisy Chang	    <daisyc@us.ibm.com>
  *    Ardelle Fan	    <ardelle.fan@intel.com>
  *    Ryan Layer	    <rmlayer@us.ibm.com>
+ *    Kevin Gao		    <kevin.gao@intel.com>
  *
  * Any bugs reported given to us we will try to fix... any fixes shared will
  * be incorporated into the next SCTP release.
@@ -3066,19 +3067,57 @@
 	return sctp_sf_shut_8_4_5(ep, NULL, type, arg, commands);
 }
 
-/*
- * ADDIP Section 4.2 Upon reception of an ASCONF Chunk
- * When an endpoint receive an ASCONF Chunk from the remote peer
- * special procedures MAY be needed to identify the association the
- * ASCONF Chunk is associated with. To properly find the association
- * the following procedures should be L1 to L4 and C1 to C5
- */
+/* ADDIP Section 4.2 Upon reception of an ASCONF Chunk.  */
 sctp_disposition_t sctp_sf_do_asconf(const struct sctp_endpoint *ep,
-				const struct sctp_association *asoc,
-				const sctp_subtype_t type, void *arg,
-				sctp_cmd_seq_t *commands)
+				     const struct sctp_association *asoc,
+				     const sctp_subtype_t type, void *arg,
+				     sctp_cmd_seq_t *commands)
 {
-	// FIXME: Handle the ASCONF chunk
+	struct sctp_chunk	*chunk = arg;
+	struct sctp_chunk	*asconf_ack = NULL;
+	sctp_addiphdr_t		*hdr;
+	__u32			serial;
+
+	hdr = (sctp_addiphdr_t *)chunk->skb->data;
+	serial = ntohl(hdr->serial);
+
+	/* ADDIP 4.2 C1) Compare the value of the serial number to the value
+	 * the endpoint stored in a new association variable
+	 * 'Peer-Serial-Number'. 
+	 */
+	if (serial == asoc->peer.addip_serial + 1) {
+   		/* ADDIP 4.2 C2) If the value found in the serial number is
+		 * equal to the ('Peer-Serial-Number' + 1), the endpoint MUST
+		 * do V1-V5.
+		 */
+		asconf_ack = sctp_process_asconf((struct sctp_association *)
+						 asoc, chunk);
+		if (!asconf_ack)
+			return SCTP_DISPOSITION_NOMEM;
+	} else if (serial == asoc->peer.addip_serial) {
+		/* ADDIP 4.2 C3) If the value found in the serial number is
+		 * equal to the value stored in the 'Peer-Serial-Number'
+		 * IMPLEMENTATION NOTE: As an optimization a receiver may wish
+		 * to save the last ASCONF-ACK for some predetermined period of 		 * time and instead of re-processing the ASCONF (with the same
+		 * serial number) it may just re-transmit the ASCONF-ACK.
+		 */
+		if (asoc->addip_last_asconf_ack)
+			asconf_ack = asoc->addip_last_asconf_ack;
+		else
+			return SCTP_DISPOSITION_DISCARD;
+	} else {
+		/* ADDIP 4.2 C4) Otherwise, the ASCONF Chunk is discarded since 
+		 * it must be either a stale packet or from an attacker.
+		 */	
+		return SCTP_DISPOSITION_DISCARD;
+	}
+
+	/* ADDIP 4.2 C5) In both cases C2 and C3 the ASCONF-ACK MUST be sent
+	 * back to the source address contained in the IP header of the ASCONF
+	 * being responded to.
+	 */
+	sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(asconf_ack));
+	
 	return SCTP_DISPOSITION_CONSUME;
 }
 
@@ -3088,12 +3127,81 @@
  * delete IP addresses the D0 to D13 rules should be applied:
  */
 sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep,
-				const struct sctp_association *asoc,
-				const sctp_subtype_t type, void *arg,
-				sctp_cmd_seq_t *commands)
+					 const struct sctp_association *asoc,
+	 				 const sctp_subtype_t type, void *arg,
+					 sctp_cmd_seq_t *commands)
 {
-	// FIXME: Handle the ASCONF-ACK chunk
-	return SCTP_DISPOSITION_CONSUME;
+	struct sctp_chunk	*asconf_ack = arg;
+	struct sctp_chunk	*last_asconf = asoc->addip_last_asconf;
+	struct sctp_chunk	*abort;
+	sctp_addiphdr_t		*addip_hdr;
+	__u32			sent_serial, rcvd_serial;
+
+	addip_hdr = (sctp_addiphdr_t *)asconf_ack->skb->data;
+	rcvd_serial = ntohl(addip_hdr->serial);
+
+	if (last_asconf) {
+		addip_hdr = (sctp_addiphdr_t *)last_asconf->subh.addip_hdr;
+		sent_serial = ntohl(addip_hdr->serial);
+	} else {
+		sent_serial = asoc->addip_serial - 1;
+	}
+
+	/* D0) If an endpoint receives an ASCONF-ACK that is greater than or
+	 * equal to the next serial number to be used but no ASCONF chunk is
+	 * outstanding the endpoint MUST ABORT the association. Note that a
+	 * sequence number is greater than if it is no more than 2^^31-1
+	 * larger than the current sequence number (using serial arithmetic).
+	 */
+	if (ADDIP_SERIAL_gte(rcvd_serial, sent_serial + 1) &&
+	    !(asoc->addip_last_asconf)) {
+		abort = sctp_make_abort(asoc, asconf_ack,
+					sizeof(sctp_errhdr_t));
+		if (abort) {
+			sctp_init_cause(abort, SCTP_ERROR_ASCONF_ACK, NULL, 0);
+			sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
+					SCTP_CHUNK(abort));
+		}
+		/* We are going to ABORT, so we might as well stop
+		 * processing the rest of the chunks in the packet.
+		 */
+		sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
+				SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
+		sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
+		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
+				SCTP_U32(SCTP_ERROR_ASCONF_ACK));
+		SCTP_INC_STATS(SctpAborteds);
+		SCTP_DEC_STATS(SctpCurrEstab);
+		return SCTP_DISPOSITION_ABORT;
+	}
+
+	if ((rcvd_serial == sent_serial) && asoc->addip_last_asconf) {
+		sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
+				SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
+
+		if (!sctp_process_asconf_ack((struct sctp_association *)asoc,
+					     asconf_ack))
+			return SCTP_DISPOSITION_CONSUME;
+
+		abort = sctp_make_abort(asoc, asconf_ack,
+					sizeof(sctp_errhdr_t));
+		if (abort) {
+			sctp_init_cause(abort, SCTP_ERROR_RSRC_LOW, NULL, 0);
+			sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
+					SCTP_CHUNK(abort));
+		}
+		/* We are going to ABORT, so we might as well stop
+		 * processing the rest of the chunks in the packet.
+		 */
+		sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
+		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
+				SCTP_U32(SCTP_ERROR_ASCONF_ACK));
+		SCTP_INC_STATS(SctpAborteds);
+		SCTP_DEC_STATS(SctpCurrEstab);
+		return SCTP_DISPOSITION_ABORT;
+	}
+
+	return SCTP_DISPOSITION_DISCARD;
 }
 
 /*
@@ -4269,7 +4377,7 @@
 
 /*
  * ADDIP Section 4.1 ASCONF CHunk Procedures
- * If the T-4 RTO timer expires the endpoint should do B1 to B5
+ * If the T4 RTO timer expires the endpoint should do B1 to B5
  */
 sctp_disposition_t sctp_sf_t4_timer_expire(
 	const struct sctp_endpoint *ep,
@@ -4278,7 +4386,55 @@
 	void *arg,
 	sctp_cmd_seq_t *commands)
 {
-	// FIXME: need to handle t4 expire
+	struct sctp_chunk *chunk = asoc->addip_last_asconf;
+	struct sctp_transport *transport = chunk->transport;
+
+	/* ADDIP 4.1 B1) Increment the error counters and perform path failure
+	 * detection on the appropriate destination address as defined in
+	 * RFC2960 [5] section 8.1 and 8.2.
+	 */
+	sctp_add_cmd_sf(commands, SCTP_CMD_STRIKE, SCTP_TRANSPORT(transport));
+
+	/* Reconfig T4 timer and transport. */
+	sctp_add_cmd_sf(commands, SCTP_CMD_SETUP_T4, SCTP_CHUNK(chunk));
+
+	/* ADDIP 4.1 B2) Increment the association error counters and perform
+	 * endpoint failure detection on the association as defined in
+	 * RFC2960 [5] section 8.1 and 8.2.
+	 * association error counter is incremented in SCTP_CMD_STRIKE.
+	 */
+	if (asoc->overall_error_count >= asoc->max_retrans) {
+		sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
+				SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
+		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
+				SCTP_U32(SCTP_ERROR_NO_ERROR));
+		SCTP_INC_STATS(SctpAborteds);
+		SCTP_INC_STATS(SctpCurrEstab);
+		return SCTP_DISPOSITION_ABORT;
+	}
+
+	/* ADDIP 4.1 B3) Back-off the destination address RTO value to which
+	 * the ASCONF chunk was sent by doubling the RTO timer value.
+	 * This is done in SCTP_CMD_STRIKE.
+	 */
+
+	/* ADDIP 4.1 B4) Re-transmit the ASCONF Chunk last sent and if possible
+	 * choose an alternate destination address (please refer to RFC2960
+	 * [5] section 6.4.1). An endpoint MUST NOT add new parameters to this
+	 * chunk, it MUST be the same (including its serial number) as the last 
+	 * ASCONF sent.
+	 */
+	sctp_chunk_hold(asoc->addip_last_asconf);
+	sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
+			SCTP_CHUNK(asoc->addip_last_asconf));
+
+	/* ADDIP 4.1 B5) Restart the T-4 RTO timer. Note that if a different
+	 * destination is selected, then the RTO used will be that of the new
+	 * destination address.
+	 */
+	sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART,
+			SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
+
 	return SCTP_DISPOSITION_CONSUME;
 }
 
diff -Nru a/net/sctp/sm_statetable.c b/net/sctp/sm_statetable.c
--- a/net/sctp/sm_statetable.c	Tue Feb  3 19:45:42 2004
+++ b/net/sctp/sm_statetable.c	Tue Feb  3 19:45:42 2004
@@ -1,7 +1,7 @@
 /* SCTP kernel reference Implementation
+ * (C) Copyright IBM Corp. 2001, 2003
  * Copyright (c) 1999-2000 Cisco, Inc.
  * Copyright (c) 1999-2001 Motorola, Inc.
- * Copyright (c) 2001-2003 International Business Machines, Corp.
  * Copyright (c) 2001 Intel Corp.
  * Copyright (c) 2001 Nokia, Inc.
  *
@@ -921,13 +921,15 @@
 	if (state > SCTP_STATE_MAX)
 		return &bug;
 
-	if (cid >= 0 && cid <= SCTP_CID_BASE_MAX) {
+	if (cid >= 0 && cid <= SCTP_CID_BASE_MAX)
 		return &chunk_event_table[cid][state];
-	}
 
-	if (cid >= SCTP_CID_ADDIP_MIN && cid <= SCTP_CID_ADDIP_MAX) {
-		return &addip_chunk_event_table
-			[cid - SCTP_CID_ADDIP_MIN][state];
+	if (sctp_addip_enable) {
+		if (cid == SCTP_CID_ASCONF)
+			return &addip_chunk_event_table[0][state];
+
+		if (cid == SCTP_CID_ASCONF_ACK)
+			return &addip_chunk_event_table[1][state];
 	}
 
 	return &chunk_event_table_unknown[state];
diff -Nru a/net/sctp/socket.c b/net/sctp/socket.c
--- a/net/sctp/socket.c	Tue Feb  3 19:45:43 2004
+++ b/net/sctp/socket.c	Tue Feb  3 19:45:43 2004
@@ -1,5 +1,5 @@
 /* SCTP kernel reference Implementation
- * (C) Copyright IBM Corp. 2001, 2003
+ * (C) Copyright IBM Corp. 2001, 2004
  * Copyright (c) 1999-2000 Cisco, Inc.
  * Copyright (c) 1999-2001 Motorola, Inc.
  * Copyright (c) 2001-2003 Intel Corp.
@@ -90,7 +90,7 @@
 static inline void sctp_set_owner_w(struct sctp_chunk *chunk);
 static void sctp_wfree(struct sk_buff *skb);
 static int sctp_wait_for_sndbuf(struct sctp_association *, long *timeo_p,
-				int msg_len);
+				size_t msg_len);
 static int sctp_wait_for_packet(struct sock * sk, int *err, long *timeo_p);
 static int sctp_wait_for_connect(struct sctp_association *, long *timeo_p);
 static int sctp_wait_for_accept(struct sock *sk, long timeo);
@@ -100,6 +100,8 @@
 static int sctp_bindx_rem(struct sock *, struct sockaddr *, int);
 static int sctp_send_asconf_add_ip(struct sock *, struct sockaddr *, int);
 static int sctp_send_asconf_del_ip(struct sock *, struct sockaddr *, int);
+static int sctp_send_asconf(struct sctp_association *asoc,
+			    struct sctp_chunk *chunk);
 static int sctp_do_bind(struct sock *, union sctp_addr *, int);
 static int sctp_autobind(struct sock *sk);
 static void sctp_sock_migrate(struct sock *, struct sock *,
@@ -150,10 +152,14 @@
 {
 	struct sctp_association *addr_asoc = NULL, *id_asoc = NULL;
 	struct sctp_transport *transport;
+	union sctp_addr *laddr = (union sctp_addr *)addr;
 
+	laddr->v4.sin_port = ntohs(laddr->v4.sin_port);
 	addr_asoc = sctp_endpoint_lookup_assoc(sctp_sk(sk)->ep,
 					       (union sctp_addr *)addr,
 					       &transport);
+	laddr->v4.sin_port = htons(laddr->v4.sin_port);
+
 	if (!addr_asoc)
 		return NULL;
 
@@ -300,6 +306,41 @@
 	return ret;
 }
 
+ /* ADDIP Section 4.1.1 Congestion Control of ASCONF Chunks
+ *
+ * R1) One and only one ASCONF Chunk MAY be in transit and unacknowledged 
+ * at any one time.  If a sender, after sending an ASCONF chunk, decides
+ * it needs to transfer another ASCONF Chunk, it MUST wait until the 
+ * ASCONF-ACK Chunk returns from the previous ASCONF Chunk before sending a
+ * subsequent ASCONF. Note this restriction binds each side, so at any 
+ * time two ASCONF may be in-transit on any given association (one sent 
+ * from each endpoint).
+ */
+static int sctp_send_asconf(struct sctp_association *asoc,
+			    struct sctp_chunk *chunk)
+{
+	int		retval = 0;
+
+	/* If there is an outstanding ASCONF chunk, queue it for later
+	 * transmission.
+	 */	
+	if (asoc->addip_last_asconf) {
+		__skb_queue_tail(&asoc->addip_chunks, (struct sk_buff *)chunk);
+		goto out;	
+	}
+
+	/* Hold the chunk until an ASCONF_ACK is received. */
+	sctp_chunk_hold(chunk);
+	retval = sctp_primitive_ASCONF(asoc, chunk);
+	if (retval)
+		sctp_chunk_free(chunk);
+	else
+		asoc->addip_last_asconf = chunk;
+
+out:
+	return retval;
+}
+
 /* Add a list of addresses as bind addresses to local endpoint or
  * association.
  *
@@ -380,6 +421,9 @@
 	int 				i;
 	int 				retval = 0;
 
+	if (!sctp_addip_enable)
+		return retval;
+
 	sp = sctp_sk(sk);
 	ep = sp->ep;
 
@@ -389,12 +433,15 @@
 	list_for_each(pos, &ep->asocs) {
 		asoc = list_entry(pos, struct sctp_association, asocs);
 
-		if (!sctp_state(asoc, ESTABLISHED))
+		if (!asoc->peer.asconf_capable)
 			continue;
 
-		if (!asoc->peer.asconf_capable)
+		if (asoc->peer.addip_disabled_mask & SCTP_PARAM_ADD_IP)
 			continue;
-		
+
+		if (!sctp_state(asoc, ESTABLISHED))
+			continue;
+
 		/* Check if any address in the packed array of addresses is
 	         * in the bind address list of the association. If so, 
 		 * do not send the asconf chunk to its peer, but continue with 
@@ -409,9 +456,9 @@
 				goto out;
 			}
 
-			if (sctp_assoc_lookup_laddr(asoc, addr))		
+			if (sctp_assoc_lookup_laddr(asoc, addr))
 				break;
-			
+
 			addr_buf += af->sockaddr_len;
 		}
 		if (i < addrcnt)
@@ -433,14 +480,10 @@
 			goto out;
 		}
 
-		retval = sctp_primitive_ASCONF(asoc, chunk);
-		if (retval) {
-			sctp_chunk_free(chunk);
-			goto out;
-		}
+		retval = sctp_send_asconf(asoc, chunk);
 
-		/* FIXME: After sending the add address ASCONF chunk, we 
-		 * cannot append the address to the association's binding 
+		/* FIXME: After sending the add address ASCONF chunk, we
+		 * cannot append the address to the association's binding
 		 * address list, because the new address may be used as the
 		 * source of a message sent to the peer before the ASCONF
 		 * chunk is received by the peer.  So we should wait until
@@ -565,6 +608,9 @@
 	int 			i;
 	int 			retval = 0;
 
+	if (!sctp_addip_enable)
+		return retval;
+
 	sp = sctp_sk(sk);
 	ep = sp->ep;
 
@@ -574,10 +620,13 @@
 	list_for_each(pos, &ep->asocs) {
 		asoc = list_entry(pos, struct sctp_association, asocs);
 
-		if (!sctp_state(asoc, ESTABLISHED))
+		if (!asoc->peer.asconf_capable)
 			continue;
 
-		if (!asoc->peer.asconf_capable)
+		if (asoc->peer.addip_disabled_mask & SCTP_PARAM_DEL_IP)
+			continue;
+
+		if (!sctp_state(asoc, ESTABLISHED))
 			continue;
 
 		/* Check if any address in the packed array of addresses is
@@ -594,9 +643,9 @@
 				goto out;
 			}
 
-			if (!sctp_assoc_lookup_laddr(asoc, laddr))		
+			if (!sctp_assoc_lookup_laddr(asoc, laddr))
 				break;
-			
+
 			addr_buf += af->sockaddr_len;
 		}
 		if (i < addrcnt)
@@ -611,27 +660,23 @@
 		bp = &asoc->base.bind_addr;
 		laddr = sctp_find_unmatch_addr(bp, (union sctp_addr *)addrs,
 					       addrcnt, sp);
-		sctp_read_unlock(&asoc->base.addr_lock);		
+		sctp_read_unlock(&asoc->base.addr_lock);
 		if (!laddr)
 			continue;
 
-		chunk = sctp_make_asconf_update_ip(asoc, laddr, addrs, addrcnt, 
+		chunk = sctp_make_asconf_update_ip(asoc, laddr, addrs, addrcnt,
 						   SCTP_PARAM_DEL_IP);
 		if (!chunk) {
 			retval = -ENOMEM;
 			goto out;
 		}
 
-		retval = sctp_primitive_ASCONF(asoc, chunk);
-		if (retval) {
-			sctp_chunk_free(chunk);
-			goto out;
-		}
+		retval = sctp_send_asconf(asoc, chunk);
 
 		/* FIXME: After sending the delete address ASCONF chunk, we
 		 * cannot remove the addresses from the association's bind
 		 * address list, because there maybe some packet send to
-		 * the delete addresses, so we should wait until ASCONF_ACK 
+		 * the delete addresses, so we should wait until ASCONF_ACK
 		 * packet is received.
 		 */
 	}
@@ -943,7 +988,7 @@
 SCTP_STATIC int sctp_msghdr_parse(const struct msghdr *, sctp_cmsgs_t *);
 
 SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
-			     struct msghdr *msg, int msg_len)
+			     struct msghdr *msg, size_t msg_len)
 {
 	struct sctp_opt *sp;
 	struct sctp_endpoint *ep;
@@ -965,7 +1010,7 @@
 	struct list_head *pos;
 	int msg_flags = msg->msg_flags;
 
-	SCTP_DEBUG_PRINTK("sctp_sendmsg(sk: %p, msg: %p, msg_len: %d)\n",
+	SCTP_DEBUG_PRINTK("sctp_sendmsg(sk: %p, msg: %p, msg_len: %u)\n",
 			  sk, msg, msg_len);
 
 	err = 0;
@@ -1021,7 +1066,7 @@
 		associd = sinfo->sinfo_assoc_id;
 	}
 
-	SCTP_DEBUG_PRINTK("msg_len: %d, sinfo_flags: 0x%x\n",
+	SCTP_DEBUG_PRINTK("msg_len: %u, sinfo_flags: 0x%x\n",
 			  msg_len, sinfo_flags);
 
 	/* MSG_EOF or MSG_ABORT cannot be set on a TCP-style socket. */
@@ -1377,7 +1422,7 @@
 static struct sk_buff *sctp_skb_recv_datagram(struct sock *, int, int, int *);
 
 SCTP_STATIC int sctp_recvmsg(struct kiocb *iocb, struct sock *sk,
-			     struct msghdr *msg, int len, int noblock,
+			     struct msghdr *msg, size_t len, int noblock,
 			     int flags, int *addr_len)
 {
 	struct sctp_ulpevent *event = NULL;
@@ -1920,6 +1965,9 @@
 	sp = sctp_sk(sk);
 	ep = sp->ep;
 
+	if (!sctp_addip_enable)
+		return -EPERM;
+
 	if (optlen != sizeof(struct sctp_setpeerprim))
 		return -EINVAL;
 
@@ -1930,6 +1978,12 @@
 	if (!asoc) 
 		return -EINVAL;
 
+	if (!asoc->peer.asconf_capable)
+		return -EPERM;
+
+	if (asoc->peer.addip_disabled_mask & SCTP_PARAM_SET_PRIMARY)
+		return -EPERM;
+
 	if (!sctp_state(asoc, ESTABLISHED))
 		return -ENOTCONN;
 
@@ -1942,15 +1996,11 @@
 	if (!chunk)
 		return -ENOMEM;
 
-	err = sctp_primitive_ASCONF(asoc, chunk);
-	if (err) {
-		sctp_chunk_free(chunk);
-		return err;
-	}
+	err = sctp_send_asconf(asoc, chunk);
 
 	SCTP_DEBUG_PRINTK("We set peer primary addr primitively.\n");
 
-	return 0;
+	return err;
 }
 
 
@@ -2962,9 +3012,13 @@
 
 	if (!asoc->peer.primary_path)
 		return -ENOTCONN;
-
+	
+	asoc->peer.primary_path->ipaddr.v4.sin_port =
+		htons(asoc->peer.primary_path->ipaddr.v4.sin_port);
 	memcpy(&prim.ssp_addr, &asoc->peer.primary_path->ipaddr,
 	       sizeof(union sctp_addr));
+	asoc->peer.primary_path->ipaddr.v4.sin_port =
+		ntohs(asoc->peer.primary_path->ipaddr.v4.sin_port);
 
 	sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp,
 			(union sctp_addr *)&prim.ssp_addr);
@@ -4157,14 +4211,14 @@
 
 /* Helper function to wait for space in the sndbuf.  */
 static int sctp_wait_for_sndbuf(struct sctp_association *asoc, long *timeo_p,
-				int msg_len)
+				size_t msg_len)
 {
 	struct sock *sk = asoc->base.sk;
 	int err = 0;
 	long current_timeo = *timeo_p;
 	DEFINE_WAIT(wait);
 
-	SCTP_DEBUG_PRINTK("wait_for_sndbuf: asoc=%p, timeo=%ld, msg_len=%d\n",
+	SCTP_DEBUG_PRINTK("wait_for_sndbuf: asoc=%p, timeo=%ld, msg_len=%u\n",
 	                  asoc, (long)(*timeo_p), msg_len);
 
 	/* Increment the association's refcnt.  */
diff -Nru a/net/sctp/sysctl.c b/net/sctp/sysctl.c
--- a/net/sctp/sysctl.c	Tue Feb  3 19:45:17 2004
+++ b/net/sctp/sysctl.c	Tue Feb  3 19:45:17 2004
@@ -162,6 +162,14 @@
 		.mode		= 0644,
 		.proc_handler	= &proc_dointvec
 	},
+	{
+		.ctl_name	= NET_SCTP_ADDIP_ENABLE,
+		.procname	= "addip_enable",
+		.data		= &sctp_addip_enable,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec
+	},
 	{ .ctl_name = 0 }
 };
 
diff -Nru a/net/socket.c b/net/socket.c
--- a/net/socket.c	Tue Feb  3 19:45:17 2004
+++ b/net/socket.c	Tue Feb  3 19:45:17 2004
@@ -394,6 +394,7 @@
 		file->f_dentry->d_op = &sockfs_dentry_operations;
 		d_add(file->f_dentry, SOCK_INODE(sock));
 		file->f_vfsmnt = mntget(sock_mnt);
+		file->f_mapping = file->f_dentry->d_inode->i_mapping;
 
 		sock->file = file;
 		file->f_op = SOCK_INODE(sock)->i_fop = &socket_file_ops;
@@ -523,7 +524,8 @@
 	sock->file=NULL;
 }
 
-static inline int __sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, int size)
+static inline int __sock_sendmsg(struct kiocb *iocb, struct socket *sock, 
+				 struct msghdr *msg, size_t size)
 {
 	struct sock_iocb *si = kiocb_to_siocb(iocb);
 	int err;
@@ -540,7 +542,7 @@
 	return sock->ops->sendmsg(iocb, sock, msg, size);
 }
 
-int sock_sendmsg(struct socket *sock, struct msghdr *msg, int size)
+int sock_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
 {
 	struct kiocb iocb;
 	int ret;
@@ -553,7 +555,8 @@
 }
 
 
-static inline int __sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, int size, int flags)
+static inline int __sock_recvmsg(struct kiocb *iocb, struct socket *sock, 
+				 struct msghdr *msg, size_t size, int flags)
 {
 	int err;
 	struct sock_iocb *si = kiocb_to_siocb(iocb);
@@ -571,7 +574,8 @@
 	return sock->ops->recvmsg(iocb, sock, msg, size, flags);
 }
 
-int sock_recvmsg(struct socket *sock, struct msghdr *msg, int size, int flags)
+int sock_recvmsg(struct socket *sock, struct msghdr *msg, 
+		 size_t size, int flags)
 {
 	struct kiocb iocb;
 	int ret;
@@ -668,7 +672,7 @@
 }
 
 int sock_readv_writev(int type, struct inode * inode, struct file * file,
-		      const struct iovec * iov, long count, long size)
+		      const struct iovec * iov, long count, size_t size)
 {
 	struct msghdr msg;
 	struct socket *sock;
diff -Nru a/net/sunrpc/cache.c b/net/sunrpc/cache.c
--- a/net/sunrpc/cache.c	Tue Feb  3 19:45:29 2004
+++ b/net/sunrpc/cache.c	Tue Feb  3 19:45:29 2004
@@ -175,9 +175,11 @@
 	if (cd->proc_ent) {
 		struct proc_dir_entry *p;
 		cd->proc_ent->owner = THIS_MODULE;
+		cd->channel_ent = cd->content_ent = NULL;
 		
  		p = create_proc_entry("flush", S_IFREG|S_IRUSR|S_IWUSR,
  				      cd->proc_ent);
+		cd->flush_ent =  p;
  		if (p) {
  			p->proc_fops = &cache_flush_operations;
  			p->owner = THIS_MODULE;
@@ -187,6 +189,7 @@
 		if (cd->cache_request || cd->cache_parse) {
 			p = create_proc_entry("channel", S_IFREG|S_IRUSR|S_IWUSR,
 					      cd->proc_ent);
+			cd->channel_ent = p;
 			if (p) {
 				p->proc_fops = &cache_file_operations;
 				p->owner = THIS_MODULE;
@@ -196,6 +199,7 @@
  		if (cd->cache_show) {
  			p = create_proc_entry("content", S_IFREG|S_IRUSR|S_IWUSR,
  					      cd->proc_ent);
+			cd->content_ent = p;
  			if (p) {
  				p->proc_fops = &content_file_operations;
  				p->owner = THIS_MODULE;
@@ -233,6 +237,13 @@
 	write_unlock(&cd->hash_lock);
 	spin_unlock(&cache_list_lock);
 	if (cd->proc_ent) {
+		if (cd->flush_ent)
+			remove_proc_entry("flush", cd->proc_ent);
+		if (cd->channel_ent)
+			remove_proc_entry("channel", cd->proc_ent);
+		if (cd->content_ent)
+			remove_proc_entry("content", cd->proc_ent);
+
 		cd->proc_ent = NULL;
 		remove_proc_entry(cd->name, proc_net_rpc);
 	}
diff -Nru a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c
--- a/net/sunrpc/sysctl.c	Tue Feb  3 19:45:16 2004
+++ b/net/sunrpc/sysctl.c	Tue Feb  3 19:45:16 2004
@@ -81,7 +81,8 @@
 
 		if (left > sizeof(tmpbuf) - 1)
 			return -EINVAL;
-		copy_from_user(tmpbuf, p, left);
+		if (copy_from_user(tmpbuf, p, left))
+			return -EFAULT;
 		tmpbuf[left] = '\0';
 
 		for (p = tmpbuf, value = 0; '0' <= *p && *p <= '9'; p++, left--)
@@ -101,9 +102,11 @@
 		len = sprintf(tmpbuf, "%d", *(unsigned int *) table->data);
 		if (len > left)
 			len = left;
-		__copy_to_user(buffer, tmpbuf, len);
+		if (__copy_to_user(buffer, tmpbuf, len))
+			return -EFAULT;
 		if ((left -= len) > 0) {
-			put_user('\n', (char *)buffer + len);
+			if (put_user('\n', (char *)buffer + len))
+				return -EFAULT;
 			left--;
 		}
 	}
diff -Nru a/net/unix/af_unix.c b/net/unix/af_unix.c
--- a/net/unix/af_unix.c	Tue Feb  3 19:45:30 2004
+++ b/net/unix/af_unix.c	Tue Feb  3 19:45:30 2004
@@ -1176,7 +1176,7 @@
  */
 
 static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
-			      struct msghdr *msg, int len)
+			      struct msghdr *msg, size_t len)
 {
 	struct sock_iocb *siocb = kiocb_to_siocb(kiocb);
 	struct sock *sk = sock->sk;
@@ -1217,7 +1217,7 @@
 		goto out;
 
 	err = -EMSGSIZE;
-	if ((unsigned)len > sk->sk_sndbuf - 32)
+	if (len > sk->sk_sndbuf - 32)
 		goto out;
 
 	skb = sock_alloc_send_skb(sk, len, msg->msg_flags&MSG_DONTWAIT, &err);
@@ -1324,7 +1324,7 @@
 
 		
 static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
-			       struct msghdr *msg, int len)
+			       struct msghdr *msg, size_t len)
 {
 	struct sock_iocb *siocb = kiocb_to_siocb(kiocb);
 	struct sock *sk = sock->sk;
@@ -1447,7 +1447,7 @@
 }
 
 static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock,
-			      struct msghdr *msg, int size,
+			      struct msghdr *msg, size_t size,
 			      int flags)
 {
 	struct sock_iocb *siocb = kiocb_to_siocb(iocb);
@@ -1555,7 +1555,7 @@
 
 
 static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
-			       struct msghdr *msg, int size,
+			       struct msghdr *msg, size_t size,
 			       int flags)
 {
 	struct sock_iocb *siocb = kiocb_to_siocb(iocb);
diff -Nru a/net/x25/af_x25.c b/net/x25/af_x25.c
--- a/net/x25/af_x25.c	Tue Feb  3 19:45:42 2004
+++ b/net/x25/af_x25.c	Tue Feb  3 19:45:42 2004
@@ -910,7 +910,7 @@
 }
 
 static int x25_sendmsg(struct kiocb *iocb, struct socket *sock,
-		       struct msghdr *msg, int len)
+		       struct msghdr *msg, size_t len)
 {
 	struct sock *sk = sock->sk;
 	struct x25_opt *x25 = x25_sk(sk);
@@ -919,7 +919,8 @@
 	struct sk_buff *skb;
 	unsigned char *asmptr;
 	int noblock = msg->msg_flags & MSG_DONTWAIT;
-	int size, qbit = 0, rc = -EINVAL;
+	size_t size;
+	int qbit = 0, rc = -EINVAL;
 
 	if (msg->msg_flags & ~(MSG_DONTWAIT | MSG_OOB | MSG_EOR))
 		goto out;
@@ -1085,13 +1086,14 @@
 
 
 static int x25_recvmsg(struct kiocb *iocb, struct socket *sock,
-		       struct msghdr *msg, int size,
+		       struct msghdr *msg, size_t size,
 		       int flags)
 {
 	struct sock *sk = sock->sk;
 	struct x25_opt *x25 = x25_sk(sk);
 	struct sockaddr_x25 *sx25 = (struct sockaddr_x25 *)msg->msg_name;
-	int copied, qbit;
+	size_t copied;
+	int qbit;
 	struct sk_buff *skb;
 	unsigned char *asmptr;
 	int rc = -ENOTCONN;
@@ -1370,9 +1372,6 @@
 
 static int __init x25_init(void)
 {
-#ifdef MODULE
-	struct net_device *dev;
-#endif /* MODULE */
 	sock_register(&x25_family_ops);
 
 	dev_add_pack(&x25_packet_type);
@@ -1384,23 +1383,7 @@
 #ifdef CONFIG_SYSCTL
 	x25_register_sysctl();
 #endif
-
 	x25_proc_init();
-#ifdef MODULE
-	/*
-	 *	Register any pre existing devices.
-	 */
-	read_lock(&dev_base_lock);
-	for (dev = dev_base; dev; dev = dev->next) {
-		if ((dev->flags & IFF_UP) && (dev->type == ARPHRD_X25
-#if defined(CONFIG_LLC) || defined(CONFIG_LLC_MODULE)
-					   || dev->type == ARPHRD_ETHER
-#endif
-			))
-			x25_link_device_up(dev);
-	}
-	read_unlock(&dev_base_lock);
-#endif /* MODULE */
 	return 0;
 }
 module_init(x25_init);
diff -Nru a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c
--- a/net/xfrm/xfrm_algo.c	Tue Feb  3 19:45:17 2004
+++ b/net/xfrm/xfrm_algo.c	Tue Feb  3 19:45:17 2004
@@ -85,7 +85,7 @@
 
 	.uinfo = {
 		.auth = {
-			.icv_truncbits = 128,
+			.icv_truncbits = 96,
 			.icv_fullbits = 256,
 		}
 	},
diff -Nru a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
--- a/net/xfrm/xfrm_policy.c	Tue Feb  3 19:45:26 2004
+++ b/net/xfrm/xfrm_policy.c	Tue Feb  3 19:45:26 2004
@@ -775,33 +775,32 @@
 
 		if (unlikely(nx<0)) {
 			err = nx;
-			if (err == -EAGAIN) {
-				struct task_struct *tsk = current;
-				DECLARE_WAITQUEUE(wait, tsk);
-				if (!flags)
-					goto error;
+			if (err == -EAGAIN && !flags) {
+				DECLARE_WAITQUEUE(wait, current);
 
-				__set_task_state(tsk, TASK_INTERRUPTIBLE);
 				add_wait_queue(&km_waitq, &wait);
-				err = xfrm_tmpl_resolve(policy, fl, xfrm, family);
-				if (err == -EAGAIN)
-					schedule();
-				__set_task_state(tsk, TASK_RUNNING);
+				set_current_state(TASK_INTERRUPTIBLE);
+				schedule();
+				set_current_state(TASK_RUNNING);
 				remove_wait_queue(&km_waitq, &wait);
 
-				if (err == -EAGAIN && signal_pending(current)) {
+				nx = xfrm_tmpl_resolve(policy, fl, xfrm, family);
+
+				if (nx == -EAGAIN && signal_pending(current)) {
 					err = -ERESTART;
 					goto error;
 				}
-				if (err == -EAGAIN ||
+				if (nx == -EAGAIN ||
 				    genid != atomic_read(&flow_cache_genid)) {
 					xfrm_pol_put(policy);
 					goto restart;
 				}
+				err = nx;
 			}
-			if (err)
+			if (err < 0)
 				goto error;
-		} else if (nx == 0) {
+		}
+		if (nx == 0) {
 			/* Flow passes not transformed. */
 			xfrm_pol_put(policy);
 			return 0;
diff -Nru a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
--- a/net/xfrm/xfrm_user.c	Tue Feb  3 19:45:29 2004
+++ b/net/xfrm/xfrm_user.c	Tue Feb  3 19:45:29 2004
@@ -241,6 +241,7 @@
 	return x;
 
 error:
+	x->km.state = XFRM_STATE_DEAD;
 	xfrm_state_put(x);
 error_no_put:
 	*errp = err;
diff -Nru a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
--- a/scripts/kconfig/mconf.c	Tue Feb  3 19:45:17 2004
+++ b/scripts/kconfig/mconf.c	Tue Feb  3 19:45:17 2004
@@ -800,7 +800,6 @@
 		fprintf(stderr, "\n\n"
 			"Your kernel configuration changes were NOT saved."
 			"\n\n");
-		return 1;
 	}
 
 	return 0;
diff -Nru a/scripts/modpost.c b/scripts/modpost.c
--- a/scripts/modpost.c	Tue Feb  3 19:45:17 2004
+++ b/scripts/modpost.c	Tue Feb  3 19:45:17 2004
@@ -446,6 +446,7 @@
 
 	buf_printf(b, "\n");
 	buf_printf(b, "static const struct modversion_info ____versions[]\n");
+	buf_printf(b, "__attribute_used__\n");
 	buf_printf(b, "__attribute__((section(\"__versions\"))) = {\n");
 
 	for (s = mod->unres; s; s = s->next) {
diff -Nru a/security/Makefile b/security/Makefile
--- a/security/Makefile	Tue Feb  3 19:45:34 2004
+++ b/security/Makefile	Tue Feb  3 19:45:34 2004
@@ -12,8 +12,6 @@
 # Object file lists
 obj-$(CONFIG_SECURITY)			+= security.o dummy.o
 # Must precede capability.o in order to stack properly.
-ifeq ($(CONFIG_SECURITY_SELINUX),y)
-	obj-$(CONFIG_SECURITY_SELINUX)	+= selinux/built-in.o
-endif
+obj-$(CONFIG_SECURITY_SELINUX)		+= selinux/built-in.o
 obj-$(CONFIG_SECURITY_CAPABILITIES)	+= commoncap.o capability.o
 obj-$(CONFIG_SECURITY_ROOTPLUG)		+= commoncap.o root_plug.o
diff -Nru a/security/capability.c b/security/capability.c
--- a/security/capability.c	Tue Feb  3 19:45:17 2004
+++ b/security/capability.c	Tue Feb  3 19:45:17 2004
@@ -39,6 +39,9 @@
 	.bprm_set_security =		cap_bprm_set_security,
 	.bprm_secureexec =		cap_bprm_secureexec,
 
+	.inode_setxattr =		cap_inode_setxattr,
+	.inode_removexattr =		cap_inode_removexattr,
+
 	.task_post_setuid =		cap_task_post_setuid,
 	.task_reparent_to_init =	cap_task_reparent_to_init,
 
diff -Nru a/security/commoncap.c b/security/commoncap.c
--- a/security/commoncap.c	Tue Feb  3 19:45:17 2004
+++ b/security/commoncap.c	Tue Feb  3 19:45:17 2004
@@ -21,6 +21,7 @@
 #include <linux/skbuff.h>
 #include <linux/netlink.h>
 #include <linux/ptrace.h>
+#include <linux/xattr.h>
 
 int cap_capable (struct task_struct *tsk, int cap)
 {
@@ -171,6 +172,25 @@
 		current->egid != current->gid);
 }
 
+int cap_inode_setxattr(struct dentry *dentry, char *name, void *value,
+		       size_t size, int flags)
+{
+	if (!strncmp(name, XATTR_SECURITY_PREFIX,
+		     sizeof(XATTR_SECURITY_PREFIX) - 1)  &&
+	    !capable(CAP_SYS_ADMIN))
+		return -EPERM;
+	return 0;
+}
+
+int cap_inode_removexattr(struct dentry *dentry, char *name)
+{
+	if (!strncmp(name, XATTR_SECURITY_PREFIX,
+		     sizeof(XATTR_SECURITY_PREFIX) - 1)  &&
+	    !capable(CAP_SYS_ADMIN))
+		return -EPERM;
+	return 0;
+}
+
 /* moved from kernel/sys.c. */
 /* 
  * cap_emulate_setxuid() fixes the effective / permitted capabilities of
@@ -344,6 +364,8 @@
 EXPORT_SYMBOL(cap_bprm_set_security);
 EXPORT_SYMBOL(cap_bprm_compute_creds);
 EXPORT_SYMBOL(cap_bprm_secureexec);
+EXPORT_SYMBOL(cap_inode_setxattr);
+EXPORT_SYMBOL(cap_inode_removexattr);
 EXPORT_SYMBOL(cap_task_post_setuid);
 EXPORT_SYMBOL(cap_task_reparent_to_init);
 EXPORT_SYMBOL(cap_syslog);
diff -Nru a/security/dummy.c b/security/dummy.c
--- a/security/dummy.c	Tue Feb  3 19:45:17 2004
+++ b/security/dummy.c	Tue Feb  3 19:45:17 2004
@@ -24,6 +24,7 @@
 #include <linux/skbuff.h>
 #include <linux/netlink.h>
 #include <net/sock.h>
+#include <linux/xattr.h>
 
 static int dummy_ptrace (struct task_struct *parent, struct task_struct *child)
 {
@@ -387,6 +388,10 @@
 static int dummy_inode_setxattr (struct dentry *dentry, char *name, void *value,
 				size_t size, int flags)
 {
+	if (!strncmp(name, XATTR_SECURITY_PREFIX,
+		     sizeof(XATTR_SECURITY_PREFIX) - 1) &&
+	    !capable(CAP_SYS_ADMIN))
+		return -EPERM;
 	return 0;
 }
 
@@ -407,6 +412,10 @@
 
 static int dummy_inode_removexattr (struct dentry *dentry, char *name)
 {
+	if (!strncmp(name, XATTR_SECURITY_PREFIX,
+		     sizeof(XATTR_SECURITY_PREFIX) - 1) &&
+	    !capable(CAP_SYS_ADMIN))
+		return -EPERM;
 	return 0;
 }
 
@@ -793,6 +802,21 @@
 {
 	return 0;
 }
+
+static int dummy_socket_getpeersec(struct socket *sock, char __user *optval,
+				   int __user *optlen, unsigned len)
+{
+	return -ENOPROTOOPT;
+}
+
+static inline int dummy_sk_alloc_security (struct sock *sk, int family, int priority)
+{
+	return 0;
+}
+
+static inline void dummy_sk_free_security (struct sock *sk)
+{
+}
 #endif	/* CONFIG_SECURITY_NETWORK */
 
 static int dummy_register_security (const char *name, struct security_operations *ops)
@@ -969,6 +993,9 @@
 	set_to_dummy_if_null(ops, socket_getsockopt);
 	set_to_dummy_if_null(ops, socket_shutdown);
 	set_to_dummy_if_null(ops, socket_sock_rcv_skb);
+	set_to_dummy_if_null(ops, socket_getpeersec);
+	set_to_dummy_if_null(ops, sk_alloc_security);
+	set_to_dummy_if_null(ops, sk_free_security);
 #endif	/* CONFIG_SECURITY_NETWORK */
 }
 
diff -Nru a/security/selinux/Makefile b/security/selinux/Makefile
--- a/security/selinux/Makefile	Tue Feb  3 19:45:16 2004
+++ b/security/selinux/Makefile	Tue Feb  3 19:45:16 2004
@@ -4,7 +4,9 @@
 
 obj-$(CONFIG_SECURITY_SELINUX) := selinux.o ss/
 
-selinux-objs := avc.o hooks.o selinuxfs.o
+selinux-y := avc.o hooks.o selinuxfs.o
+
+selinux-$(CONFIG_SECURITY_NETWORK) += netif.o
 
 EXTRA_CFLAGS += -Isecurity/selinux/include
 
diff -Nru a/security/selinux/avc.c b/security/selinux/avc.c
--- a/security/selinux/avc.c	Tue Feb  3 19:45:35 2004
+++ b/security/selinux/avc.c	Tue Feb  3 19:45:35 2004
@@ -22,8 +22,6 @@
 #include <linux/un.h>
 #include <net/af_unix.h>
 #include <linux/ip.h>
-#include <linux/udp.h>
-#include <linux/tcp.h>
 #include "avc.h"
 #include "avc_ss.h"
 #include "class_to_string.h"
@@ -575,17 +573,26 @@
 			break;
 		case AVC_AUDIT_DATA_FS:
 			if (a->u.fs.dentry) {
+				struct dentry *dentry = a->u.fs.dentry;
 				if (a->u.fs.mnt) {
-					p = d_path(a->u.fs.dentry,
+					p = d_path(dentry,
 						   a->u.fs.mnt,
 						   avc_audit_buffer,
 						   PAGE_SIZE);
 					if (p)
 						printk(" path=%s", p);
+				} else {
+					printk(" name=%s", dentry->d_name.name);
 				}
-				inode = a->u.fs.dentry->d_inode;
+				inode = dentry->d_inode;
 			} else if (a->u.fs.inode) {
+				struct dentry *dentry;
 				inode = a->u.fs.inode;
+				dentry = d_find_alias(inode);
+				if (dentry) {
+					printk(" name=%s", dentry->d_name.name);
+					dput(dentry);
+				}
 			}
 			if (inode)
 				printk(" dev=%s ino=%ld",
@@ -631,41 +638,12 @@
 					break;
 				}
 			}
-			if (a->u.net.daddr) {
-				printk(" daddr=%d.%d.%d.%d",
-				       NIPQUAD(a->u.net.daddr));
-				if (a->u.net.port)
-					printk(" dest=%d", a->u.net.port);
-			} else if (a->u.net.port)
-				printk(" port=%d", a->u.net.port);
-			if (a->u.net.skb) {
-				struct sk_buff *skb = a->u.net.skb;
-
-				if ((skb->protocol == htons(ETH_P_IP)) &&
-				     skb->nh.iph) {
-					u16 source = 0, dest = 0;
-					u8  protocol = skb->nh.iph->protocol;
-
-
-					if (protocol == IPPROTO_TCP &&
-					    skb->h.th) {
-						source = skb->h.th->source;
-						dest = skb->h.th->dest;
-					}
-					if (protocol == IPPROTO_UDP &&
-					    skb->h.uh) {
-						source = skb->h.uh->source;
-						dest = skb->h.uh->dest;
-					}
+			
+			avc_print_ipv4_addr(a->u.net.saddr, a->u.net.sport,
+			                    "saddr", "src");
+			avc_print_ipv4_addr(a->u.net.daddr, a->u.net.dport,
+			                    "daddr", "dest");
 
-					avc_print_ipv4_addr(skb->nh.iph->saddr,
-					                    source,
-					                    "saddr", "source");
-					avc_print_ipv4_addr(skb->nh.iph->daddr,
-					                    dest,
-					                    "daddr", "dest");
-				}
-			}
 			if (a->u.net.netif)
 				printk(" netif=%s", a->u.net.netif);
 			break;
diff -Nru a/security/selinux/hooks.c b/security/selinux/hooks.c
--- a/security/selinux/hooks.c	Tue Feb  3 19:45:42 2004
+++ b/security/selinux/hooks.c	Tue Feb  3 19:45:42 2004
@@ -16,10 +16,6 @@
  *      as published by the Free Software Foundation.
  */
 
-#define XATTR_SECURITY_PREFIX "security."
-#define XATTR_SELINUX_SUFFIX "selinux"
-#define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX
-
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -44,6 +40,7 @@
 #include <linux/ext2_fs.h>
 #include <linux/proc_fs.h>
 #include <linux/kd.h>
+#include <linux/netfilter_ipv4.h>
 #include <net/icmp.h>
 #include <net/ip.h>		/* for sysctl_local_port_range[] */
 #include <net/tcp.h>		/* struct or_callable used in sock_rcv_skb */
@@ -55,12 +52,17 @@
 #include <linux/netdevice.h>	/* for network interface checks */
 #include <linux/netlink.h>
 #include <linux/tcp.h>
+#include <linux/udp.h>
 #include <linux/quota.h>
 #include <linux/un.h>		/* for Unix socket types */
 #include <net/af_unix.h>	/* for Unix socket types */
 
 #include "avc.h"
 #include "objsec.h"
+#include "netif.h"
+
+#define XATTR_SELINUX_SUFFIX "selinux"
+#define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX
 
 #ifdef CONFIG_SECURITY_SELINUX_DEVELOP
 int selinux_enforcing = 0;
@@ -242,6 +244,39 @@
 	kfree(sbsec);
 }
 
+#ifdef CONFIG_SECURITY_NETWORK
+static int sk_alloc_security(struct sock *sk, int family, int priority)
+{
+	struct sk_security_struct *ssec;
+
+	if (family != PF_UNIX)
+		return 0;
+
+	ssec = kmalloc(sizeof(*ssec), priority);
+	if (!ssec)
+		return -ENOMEM;
+
+	memset(ssec, 0, sizeof(*ssec));
+	ssec->magic = SELINUX_MAGIC;
+	ssec->sk = sk;
+	ssec->peer_sid = SECINITSID_UNLABELED;
+	sk->sk_security = ssec;
+
+	return 0;
+}
+
+static void sk_free_security(struct sock *sk)
+{
+	struct task_security_struct *ssec = sk->sk_security;
+
+	if (sk->sk_family != PF_UNIX || ssec->magic != SELINUX_MAGIC)
+		return;
+
+	sk->sk_security = NULL;
+	kfree(ssec);
+}
+#endif	/* CONFIG_SECURITY_NETWORK */
+
 /* The security server must be initialized before
    any labeling or access decisions can be provided. */
 extern int ss_initialized;
@@ -1516,6 +1551,7 @@
 	u32 sid;
 	struct av_decision avd;
 	struct itimerval itimer;
+	struct rlimit *rlim, *initrlim;
 	int rc, i;
 
 	secondary_ops->bprm_compute_creds(bprm);
@@ -1586,6 +1622,26 @@
 			spin_unlock_irq(&current->sighand->siglock);
 		}
 
+		/* Check whether the new SID can inherit resource limits
+		   from the old SID.  If not, reset all soft limits to
+		   the lower of the current task's hard limit and the init
+		   task's soft limit.  Note that the setting of hard limits 
+		   (even to lower them) can be controlled by the setrlimit 
+		   check. The inclusion of the init task's soft limit into
+	           the computation is to avoid resetting soft limits higher
+		   than the default soft limit for cases where the default
+		   is lower than the hard limit, e.g. RLIMIT_CORE or 
+		   RLIMIT_STACK.*/
+		rc = avc_has_perm(tsec->osid, tsec->sid, SECCLASS_PROCESS,
+				  PROCESS__RLIMITINH, NULL, NULL);
+		if (rc) {
+			for (i = 0; i < RLIM_NLIMITS; i++) {
+				rlim = current->rlim + i;
+				initrlim = init_task.rlim+i;
+				rlim->rlim_cur = min(rlim->rlim_max,initrlim->rlim_cur);
+			}
+		}
+
 		/* Wake up the parent if it is waiting so that it can
 		   recheck wait permission to the new task SID. */
 		wake_up_interruptible(&current->parent->wait_chldexit);
@@ -2222,10 +2278,15 @@
 
 static int selinux_task_setrlimit(unsigned int resource, struct rlimit *new_rlim)
 {
-	/* SELinux does not currently provide a process
-	   resource limit policy based on security contexts.
-	   It does control the use of the CAP_SYS_RESOURCE capability
-	   using the capable hook. */
+	struct rlimit *old_rlim = current->rlim + resource;
+
+	/* Control the ability to change the hard limit (whether
+	   lowering or raising it), so that the hard limit can
+	   later be used as a safe reset point for the soft limit
+	   upon context transitions. See selinux_bprm_compute_creds. */
+	if (old_rlim->rlim_max != new_rlim->rlim_max)
+		return task_has_perm(current, current, PROCESS__SETRLIMIT);
+
 	return 0;
 }
 
@@ -2311,6 +2372,69 @@
 
 #ifdef CONFIG_SECURITY_NETWORK
 
+static void selinux_parse_skb_ipv4(struct sk_buff *skb, struct avc_audit_data *ad)
+{
+	int dlen, ihlen;
+	struct iphdr *iph;
+
+	if (skb->len < sizeof(struct iphdr))
+		goto out;
+	
+	iph = skb->nh.iph;
+	ihlen = iph->ihl * 4;
+	if (ihlen < sizeof(struct iphdr))
+		goto out;
+
+	dlen = skb->len - ihlen;
+	ad->u.net.saddr = iph->saddr;
+	ad->u.net.daddr = iph->daddr;
+
+	switch (iph->protocol) {
+        case IPPROTO_TCP: {
+        	int offset;
+        	struct tcphdr tcph;
+
+        	if (ntohs(iph->frag_off) & IP_OFFSET)
+        		break;
+        		
+		if (dlen < sizeof(tcph))
+			break;
+
+		offset = skb->nh.raw - skb->data + ihlen;
+		if (skb_copy_bits(skb, offset, &tcph, sizeof(tcph)) < 0)
+			break;
+
+		ad->u.net.sport = tcph.source;
+		ad->u.net.dport = tcph.dest;
+		break;
+        }
+        
+        case IPPROTO_UDP: {
+        	int offset;
+        	struct udphdr udph;
+        	
+        	if (ntohs(iph->frag_off) & IP_OFFSET)
+        		break;
+        		
+        	if (dlen < sizeof(udph))
+        		break;
+
+		offset = skb->nh.raw - skb->data + ihlen;
+        	if (skb_copy_bits(skb, offset, &udph, sizeof(udph)) < 0)
+        		break;	
+
+        	ad->u.net.sport = udph.source;
+        	ad->u.net.dport = udph.dest;
+        	break;
+        }
+
+        default:
+        	break;
+        }
+out:
+	return;
+}
+
 /* socket security operations */
 static int socket_has_perm(struct task_struct *task, struct socket *sock,
 			   u32 perms)
@@ -2375,7 +2499,7 @@
 
 	err = socket_has_perm(current, sock, SOCKET__BIND);
 	if (err)
-		return err;
+		goto out;
 
 	/*
 	 * If PF_INET, check name_bind permission for the port.
@@ -2387,7 +2511,7 @@
 		struct sockaddr_in *addr = (struct sockaddr_in *)address;
 		unsigned short snum = ntohs(addr->sin_port);
 		struct sock *sk = sock->sk;
-		u32 sid;
+		u32 sid, node_perm;
 
 		tsec = current->security;
 		isec = SOCK_INODE(sock)->i_security;
@@ -2397,81 +2521,64 @@
 			err = security_port_sid(sk->sk_family, sk->sk_type,
 						sk->sk_protocol, snum, &sid);
 			if (err)
-				return err;
+				goto out;
 			AVC_AUDIT_DATA_INIT(&ad,NET);
-			ad.u.net.port = snum;
+			ad.u.net.sport = htons(snum);
 			err = avc_has_perm(isec->sid, sid,
 					   isec->sclass,
 					   SOCKET__NAME_BIND, NULL, &ad);
 			if (err)
-				return err;
+				goto out;
 		}
+		
+		switch(sk->sk_protocol) {
+		case IPPROTO_TCP:
+			node_perm = TCP_SOCKET__NODE_BIND;
+			break;
+			
+		case IPPROTO_UDP:
+			node_perm = UDP_SOCKET__NODE_BIND;
+			break;
+			
+		default:
+			node_perm = RAWIP_SOCKET__NODE_BIND;
+			break;
+		}
+		
+		err = security_node_sid(PF_INET, &addr->sin_addr.s_addr,
+		                        sizeof(addr->sin_addr.s_addr), &sid);
+		if (err)
+			goto out;
+		
+		AVC_AUDIT_DATA_INIT(&ad,NET);
+		ad.u.net.sport = htons(snum);
+		ad.u.net.saddr = addr->sin_addr.s_addr;
+		err = avc_has_perm(isec->sid, sid,
+		                   isec->sclass, node_perm, NULL, &ad);
+		if (err)
+			goto out;
 	}
-
-	return 0;
+out:
+	return err;
 }
 
 static int selinux_socket_connect(struct socket *sock, struct sockaddr *address, int addrlen)
 {
-	int err;
-	struct sock *sk = sock->sk;
-	struct avc_audit_data ad;
-	struct task_security_struct *tsec;
-	struct inode_security_struct *isec;
-
-	isec = SOCK_INODE(sock)->i_security;
-
-	tsec = current->security;
-
-	AVC_AUDIT_DATA_INIT(&ad, NET);
-	ad.u.net.sk = sk;
-	err = avc_has_perm(tsec->sid, isec->sid, isec->sclass,
-			   SOCKET__CONNECT, &isec->avcr, &ad);
-	if (err)
-		return err;
-
-	return 0;
+	return socket_has_perm(current, sock, SOCKET__CONNECT);
 }
 
 static int selinux_socket_listen(struct socket *sock, int backlog)
 {
-	int err;
-	struct task_security_struct *tsec;
-	struct inode_security_struct *isec;
-	struct avc_audit_data ad;
-
-	tsec = current->security;
-
-	isec = SOCK_INODE(sock)->i_security;
-
-	AVC_AUDIT_DATA_INIT(&ad, NET);
-	ad.u.net.sk = sock->sk;
-
-	err = avc_has_perm(tsec->sid, isec->sid, isec->sclass,
-			   SOCKET__LISTEN, &isec->avcr, &ad);
-	if (err)
-		return err;
-
-	return 0;
+	return socket_has_perm(current, sock, SOCKET__LISTEN);
 }
 
 static int selinux_socket_accept(struct socket *sock, struct socket *newsock)
 {
 	int err;
-	struct task_security_struct *tsec;
 	struct inode_security_struct *isec;
 	struct inode_security_struct *newisec;
-	struct avc_audit_data ad;
 
-	tsec = current->security;
-
-	isec = SOCK_INODE(sock)->i_security;
-
-	AVC_AUDIT_DATA_INIT(&ad, NET);
-	ad.u.net.sk = sock->sk;
-
-	err = avc_has_perm(tsec->sid, isec->sid, isec->sclass,
-			   SOCKET__ACCEPT, &isec->avcr, &ad);
+	err = socket_has_perm(current, sock, SOCKET__ACCEPT);
 	if (err)
 		return err;
 
@@ -2480,6 +2587,7 @@
 		return err;
 	newisec = SOCK_INODE(newsock)->i_security;
 
+	isec = SOCK_INODE(sock)->i_security;
 	newisec->sclass = isec->sclass;
 	newisec->sid = isec->sid;
 
@@ -2489,87 +2597,23 @@
 static int selinux_socket_sendmsg(struct socket *sock, struct msghdr *msg,
  				  int size)
 {
-	struct task_security_struct *tsec;
-	struct inode_security_struct *isec;
-	struct avc_audit_data ad;
-	struct sock *sk;
-	int err;
-
-	isec = SOCK_INODE(sock)->i_security;
-
-	tsec = current->security;
-
-	sk = sock->sk;
-
-	AVC_AUDIT_DATA_INIT(&ad, NET);
-	ad.u.net.sk = sk;
-	err = avc_has_perm(tsec->sid, isec->sid, isec->sclass,
-			   SOCKET__WRITE, &isec->avcr, &ad);
-	if (err)
-		return err;
-
-	return 0;
+	return socket_has_perm(current, sock, SOCKET__WRITE);
 }
 
 static int selinux_socket_recvmsg(struct socket *sock, struct msghdr *msg,
 				  int size, int flags)
 {
-	struct inode_security_struct *isec;
-	struct task_security_struct *tsec;
-	struct avc_audit_data ad;
-	int err;
-
-	isec = SOCK_INODE(sock)->i_security;
-	tsec = current->security;
-
-	AVC_AUDIT_DATA_INIT(&ad,NET);
-	ad.u.net.sk = sock->sk;
-	err = avc_has_perm(tsec->sid, isec->sid, isec->sclass,
-			   SOCKET__READ, &isec->avcr, &ad);
-	if (err)
-		return err;
-
-	return 0;
+	return socket_has_perm(current, sock, SOCKET__READ);
 }
 
 static int selinux_socket_getsockname(struct socket *sock)
 {
-	struct inode_security_struct *isec;
-	struct task_security_struct *tsec;
-	struct avc_audit_data ad;
-	int err;
-
-	tsec = current->security;
-	isec = SOCK_INODE(sock)->i_security;
-
-	AVC_AUDIT_DATA_INIT(&ad,NET);
-	ad.u.net.sk = sock->sk;
-	err = avc_has_perm(tsec->sid, isec->sid, isec->sclass,
-			   SOCKET__GETATTR, &isec->avcr, &ad);
-	if (err)
-		return err;
-
-	return 0;
+	return socket_has_perm(current, sock, SOCKET__GETATTR);
 }
 
 static int selinux_socket_getpeername(struct socket *sock)
 {
-	struct inode_security_struct *isec;
-	struct task_security_struct *tsec;
-	struct avc_audit_data ad;
-	int err;
-
-	tsec = current->security;
-	isec = SOCK_INODE(sock)->i_security;
-
-	AVC_AUDIT_DATA_INIT(&ad,NET);
-	ad.u.net.sk = sock->sk;
-	err = avc_has_perm(tsec->sid, isec->sid, isec->sclass,
-			   SOCKET__GETATTR, &isec->avcr, &ad);
-	if (err)
-		return err;
-
-	return 0;
+	return socket_has_perm(current, sock, SOCKET__GETATTR);
 }
 
 static int selinux_socket_setsockopt(struct socket *sock,int level,int optname)
@@ -2592,6 +2636,7 @@
 					      struct socket *other,
 					      struct sock *newsk)
 {
+	struct sk_security_struct *ssec;
 	struct inode_security_struct *isec;
 	struct inode_security_struct *other_isec;
 	struct avc_audit_data ad;
@@ -2610,6 +2655,14 @@
 	if (err)
 		return err;
 
+	/* connecting socket */
+	ssec = sock->sk->sk_security;
+	ssec->peer_sid = other_isec->sid;
+	
+	/* server child socket */
+	ssec = newsk->sk_security;
+	ssec->peer_sid = isec->sid;
+	
 	return 0;
 }
 
@@ -2637,7 +2690,253 @@
 	return 0;
 }
 
-#endif
+static int selinux_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb)
+{
+	int err = 0;
+	u32 netif_perm, node_perm, node_sid, recv_perm = 0;
+	struct socket *sock;
+	struct inode *inode;
+	struct net_device *dev;
+	struct iphdr *iph;
+	struct sel_netif *netif;
+	struct netif_security_struct *nsec;
+	struct inode_security_struct *isec;
+	struct avc_audit_data ad;
+
+	/* Only IPv4 is supported here at this stage */
+	if (sk->sk_family != PF_INET)
+		goto out;
+
+	sock = sk->sk_socket;
+	
+	/* TCP control messages don't always have a socket. */
+	if (!sock)
+		goto out;
+
+	inode = SOCK_INODE(sock);
+	if (!inode)
+		goto out;
+
+	dev = skb->dev;
+	if (!dev)
+		goto out;
+
+	netif = sel_netif_lookup(dev);
+	if (IS_ERR(netif)) {
+		err = PTR_ERR(netif);
+		goto out;
+	}
+	
+	nsec = &netif->nsec;
+	isec = inode->i_security;
+
+	switch (isec->sclass) {
+	case SECCLASS_UDP_SOCKET:
+		netif_perm = NETIF__UDP_RECV;
+		node_perm = NODE__UDP_RECV;
+		recv_perm = UDP_SOCKET__RECV_MSG;
+		break;
+	
+	case SECCLASS_TCP_SOCKET:
+		netif_perm = NETIF__TCP_RECV;
+		node_perm = NODE__TCP_RECV;
+		recv_perm = TCP_SOCKET__RECV_MSG;
+		break;
+	
+	default:
+		netif_perm = NETIF__RAWIP_RECV;
+		node_perm = NODE__RAWIP_RECV;
+		break;
+	}
+
+	AVC_AUDIT_DATA_INIT(&ad, NET);
+	ad.u.net.netif = dev->name;
+	selinux_parse_skb_ipv4(skb, &ad);
+
+	err = avc_has_perm(isec->sid, nsec->if_sid, SECCLASS_NETIF,
+	                   netif_perm, &nsec->avcr, &ad);
+	sel_netif_put(netif);
+	if (err)
+		goto out;
+	
+	/* Fixme: this lookup is inefficient */
+	iph = skb->nh.iph;
+	err = security_node_sid(PF_INET, &iph->saddr, sizeof(iph->saddr), &node_sid);
+	if (err)
+		goto out;
+	
+	err = avc_has_perm(isec->sid, node_sid, SECCLASS_NODE, node_perm, NULL, &ad);
+
+	if (recv_perm) {
+		u32 port_sid;
+
+		/* Fixme: make this more efficient */
+		err = security_port_sid(sk->sk_family, sk->sk_type,
+		                        sk->sk_protocol, ntohs(ad.u.net.sport),
+		                        &port_sid);
+		if (err)
+			goto out;
+
+		err = avc_has_perm(isec->sid, port_sid, isec->sclass,
+		                   recv_perm, NULL, &ad);
+	}
+
+out:	
+	return err;
+}
+
+static int selinux_socket_getpeersec(struct socket *sock, char __user *optval,
+				     int __user *optlen, unsigned len)
+{
+	int err = 0;
+	char *scontext;
+	u32 scontext_len;
+	struct sk_security_struct *ssec;
+	struct inode_security_struct *isec;
+
+	isec = SOCK_INODE(sock)->i_security;
+	if (isec->sclass != SECCLASS_UNIX_STREAM_SOCKET) {
+		err = -ENOPROTOOPT;
+		goto out;
+	}
+
+	ssec = sock->sk->sk_security;
+	
+	err = security_sid_to_context(ssec->peer_sid, &scontext, &scontext_len);
+	if (err)
+		goto out;
+
+	if (scontext_len > len) {
+		err = -ERANGE;
+		goto out_len;
+	}
+
+	if (copy_to_user(optval, scontext, scontext_len))
+		err = -EFAULT;
+
+out_len:
+	if (put_user(scontext_len, optlen))
+		err = -EFAULT;
+
+	kfree(scontext);
+out:	
+	return err;
+}
+
+static int selinux_sk_alloc_security(struct sock *sk, int family, int priority)
+{
+	return sk_alloc_security(sk, family, priority);
+}
+
+static void selinux_sk_free_security(struct sock *sk)
+{
+	sk_free_security(sk);
+}
+
+#ifdef CONFIG_NETFILTER
+static unsigned int selinux_ip_postroute_last(unsigned int hooknum,
+                                              struct sk_buff **pskb,
+                                              const struct net_device *in,
+                                              const struct net_device *out,
+                                              int (*okfn)(struct sk_buff *))
+{
+	int err = NF_ACCEPT;
+	u32 netif_perm, node_perm, node_sid, send_perm = 0;
+	struct sock *sk;
+	struct socket *sock;
+	struct inode *inode;
+	struct iphdr *iph;
+	struct sel_netif *netif;
+	struct sk_buff *skb = *pskb;
+	struct netif_security_struct *nsec;
+	struct inode_security_struct *isec;
+	struct avc_audit_data ad;
+	struct net_device *dev = (struct net_device *)out;
+	
+	sk = skb->sk;
+	if (!sk)
+		goto out;
+		
+	sock = sk->sk_socket;
+	if (!sock)
+		goto out;
+		
+	inode = SOCK_INODE(sock);
+	if (!inode)
+		goto out;
+
+	netif = sel_netif_lookup(dev);
+	if (IS_ERR(netif)) {
+		err = NF_DROP;
+		goto out;
+	}
+	
+	nsec = &netif->nsec;
+	isec = inode->i_security;
+	
+	switch (isec->sclass) {
+	case SECCLASS_UDP_SOCKET:
+		netif_perm = NETIF__UDP_SEND;
+		node_perm = NODE__UDP_SEND;
+		send_perm = UDP_SOCKET__SEND_MSG;
+		break;
+	
+	case SECCLASS_TCP_SOCKET:
+		netif_perm = NETIF__TCP_SEND;
+		node_perm = NODE__TCP_SEND;
+		send_perm = TCP_SOCKET__SEND_MSG;
+		break;
+	
+	default:
+		netif_perm = NETIF__RAWIP_SEND;
+		node_perm = NODE__RAWIP_SEND;
+		break;
+	}
+
+	AVC_AUDIT_DATA_INIT(&ad, NET);
+	ad.u.net.netif = dev->name;
+	selinux_parse_skb_ipv4(skb, &ad);
+
+	err = avc_has_perm(isec->sid, nsec->if_sid, SECCLASS_NETIF,
+	                   netif_perm, &nsec->avcr, &ad) ? NF_DROP : NF_ACCEPT;
+	sel_netif_put(netif);
+	if (err != NF_ACCEPT)
+		goto out;
+		
+	/* Fixme: this lookup is inefficient */
+	iph = skb->nh.iph;
+	err = security_node_sid(PF_INET, &iph->daddr, sizeof(iph->daddr), &node_sid);
+	if (err)
+		goto out;
+	
+	err = avc_has_perm(isec->sid, node_sid, SECCLASS_NODE,
+	                   node_perm, NULL, &ad) ? NF_DROP : NF_ACCEPT;
+	if (err != NF_ACCEPT)
+		goto out;
+
+	if (send_perm) {
+		u32 port_sid;
+		
+		/* Fixme: make this more efficient */
+		err = security_port_sid(sk->sk_family,
+		                        sk->sk_type,
+		                        sk->sk_protocol,
+		                        ntohs(ad.u.net.dport),
+		                        &port_sid) ? NF_DROP : NF_ACCEPT;
+		if (err != NF_ACCEPT)
+			goto out;
+
+		err = avc_has_perm(isec->sid, port_sid, isec->sclass,
+		                   send_perm, NULL, &ad) ? NF_DROP : NF_ACCEPT;
+	}
+
+out:
+	return err;
+}
+
+#endif	/* CONFIG_NETFILTER */
+
+#endif	/* CONFIG_SECURITY_NETWORK */
 
 static int ipc_alloc_security(struct task_struct *task,
 			      struct kern_ipc_perm *perm,
@@ -3372,6 +3671,10 @@
 	.socket_getsockopt =		selinux_socket_getsockopt,
 	.socket_setsockopt =		selinux_socket_setsockopt,
 	.socket_shutdown =		selinux_socket_shutdown,
+	.socket_sock_rcv_skb =		selinux_socket_sock_rcv_skb,
+	.socket_getpeersec =		selinux_socket_getpeersec,
+	.sk_alloc_security =		selinux_sk_alloc_security,
+	.sk_free_security =		selinux_sk_free_security,
 #endif
 };
 
@@ -3441,3 +3744,33 @@
    all processes and objects when they are created. */
 security_initcall(selinux_init);
 
+#if defined(CONFIG_SECURITY_NETWORK) && defined(CONFIG_NETFILTER)
+
+static struct nf_hook_ops selinux_ip_ops[] = {
+	{ .hook =	selinux_ip_postroute_last,
+	  .owner =	THIS_MODULE,
+	  .pf =		PF_INET, 
+	  .hooknum =	NF_IP_POST_ROUTING, 
+	  .priority =	NF_IP_PRI_SELINUX_LAST, },
+};
+
+static int __init selinux_nf_ip_init(void)
+{
+	int err = 0;
+
+	if (!selinux_enabled)
+		goto out;
+		
+	printk(KERN_INFO "SELinux:  Registering netfilter hooks\n");
+	
+	err = nf_register_hook(&selinux_ip_ops[0]);
+	if (err)
+		panic("SELinux: nf_register_hook 0 error %d\n", err);
+
+out:
+	return err;
+}
+
+__initcall(selinux_nf_ip_init);
+
+#endif /* CONFIG_SECURITY_NETWORK && CONFIG_NETFILTER */
diff -Nru a/security/selinux/include/av_perm_to_string.h b/security/selinux/include/av_perm_to_string.h
--- a/security/selinux/include/av_perm_to_string.h	Tue Feb  3 19:45:41 2004
+++ b/security/selinux/include/av_perm_to_string.h	Tue Feb  3 19:45:41 2004
@@ -46,6 +46,9 @@
    { SECCLASS_UNIX_STREAM_SOCKET, UNIX_STREAM_SOCKET__CONNECTTO, "connectto" },
    { SECCLASS_UNIX_STREAM_SOCKET, UNIX_STREAM_SOCKET__NEWCONN, "newconn" },
    { SECCLASS_UNIX_STREAM_SOCKET, UNIX_STREAM_SOCKET__ACCEPTFROM, "acceptfrom" },
+   { SECCLASS_TCP_SOCKET, TCP_SOCKET__NODE_BIND, "node_bind" },
+   { SECCLASS_UDP_SOCKET, UDP_SOCKET__NODE_BIND, "node_bind" },
+   { SECCLASS_RAWIP_SOCKET, RAWIP_SOCKET__NODE_BIND, "node_bind" },
    { SECCLASS_PROCESS, PROCESS__FORK, "fork" },
    { SECCLASS_PROCESS, PROCESS__TRANSITION, "transition" },
    { SECCLASS_PROCESS, PROCESS__SIGCHLD, "sigchld" },
@@ -67,6 +70,8 @@
    { SECCLASS_PROCESS, PROCESS__SETFSCREATE, "setfscreate" },
    { SECCLASS_PROCESS, PROCESS__NOATSECURE, "noatsecure" },
    { SECCLASS_PROCESS, PROCESS__SIGINH, "siginh" },
+   { SECCLASS_PROCESS, PROCESS__SETRLIMIT, "setrlimit" },
+   { SECCLASS_PROCESS, PROCESS__RLIMITINH, "rlimitinh" },
    { SECCLASS_MSGQ, MSGQ__ENQUEUE, "enqueue" },
    { SECCLASS_MSG, MSG__SEND, "send" },
    { SECCLASS_MSG, MSG__RECEIVE, "receive" },
diff -Nru a/security/selinux/include/av_permissions.h b/security/selinux/include/av_permissions.h
--- a/security/selinux/include/av_permissions.h	Tue Feb  3 19:45:17 2004
+++ b/security/selinux/include/av_permissions.h	Tue Feb  3 19:45:17 2004
@@ -249,6 +249,7 @@
 #define TCP_SOCKET__CONNECTTO                     0x00400000UL
 #define TCP_SOCKET__NEWCONN                       0x00800000UL
 #define TCP_SOCKET__ACCEPTFROM                    0x01000000UL
+#define TCP_SOCKET__NODE_BIND                     0x02000000UL
 
 #define UDP_SOCKET__RELABELTO                     0x00000100UL
 #define UDP_SOCKET__RECV_MSG                      0x00080000UL
@@ -272,6 +273,7 @@
 #define UDP_SOCKET__SEND_MSG                      0x00100000UL
 #define UDP_SOCKET__RECVFROM                      0x00020000UL
 #define UDP_SOCKET__GETATTR                       0x00000010UL
+#define UDP_SOCKET__NODE_BIND                     0x00400000UL
 
 #define RAWIP_SOCKET__RELABELTO                   0x00000100UL
 #define RAWIP_SOCKET__RECV_MSG                    0x00080000UL
@@ -295,6 +297,7 @@
 #define RAWIP_SOCKET__SEND_MSG                    0x00100000UL
 #define RAWIP_SOCKET__RECVFROM                    0x00020000UL
 #define RAWIP_SOCKET__GETATTR                     0x00000010UL
+#define RAWIP_SOCKET__NODE_BIND                   0x00400000UL
 
 #define NODE__TCP_RECV                            0x00000001UL
 #define NODE__TCP_SEND                            0x00000002UL
@@ -451,6 +454,8 @@
 #define PROCESS__SETFSCREATE                      0x00040000UL
 #define PROCESS__NOATSECURE                       0x00080000UL
 #define PROCESS__SIGINH                           0x00100000UL
+#define PROCESS__SETRLIMIT                        0x00200000UL
+#define PROCESS__RLIMITINH                        0x00400000UL
 
 #define IPC__SETATTR                              0x00000008UL
 #define IPC__READ                                 0x00000010UL
diff -Nru a/security/selinux/include/avc.h b/security/selinux/include/avc.h
--- a/security/selinux/include/avc.h	Tue Feb  3 19:45:17 2004
+++ b/security/selinux/include/avc.h	Tue Feb  3 19:45:17 2004
@@ -63,10 +63,11 @@
 		} fs;
 		struct {
 			char *netif;
-			struct sk_buff *skb;
 			struct sock *sk;
-			u16 port;
+			u16 dport;
+			u16 sport;
 			u32 daddr;
+			u32 saddr;
 		} net;
 		int cap;
 		int ipc_id;
diff -Nru a/security/selinux/include/netif.h b/security/selinux/include/netif.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/security/selinux/include/netif.h	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,30 @@
+/*
+ * Network interface table.
+ *
+ * Network interfaces (devices) do not have a security field, so we
+ * maintain a table associating each interface with a SID.
+ *
+ * Author: James Morris <jmorris@redhat.com>
+ *
+ * Copyright (C) 2003 Red Hat, Inc., James Morris <jmorris@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ */
+#ifndef _SELINUX_NETIF_H_
+#define _SELINUX_NETIF_H_
+
+struct sel_netif
+{
+	struct list_head list;
+	atomic_t users;
+	struct netif_security_struct nsec;
+	struct rcu_head rcu_head;
+};
+
+struct sel_netif *sel_netif_lookup(struct net_device *dev);
+void sel_netif_put(struct sel_netif *netif);
+
+#endif	/* _SELINUX_NETIF_H_ */
+
diff -Nru a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h
--- a/security/selinux/include/objsec.h	Tue Feb  3 19:45:17 2004
+++ b/security/selinux/include/objsec.h	Tue Feb  3 19:45:17 2004
@@ -93,6 +93,19 @@
 	unsigned char set;
 };
 
+struct netif_security_struct {
+	struct net_device *dev;		/* back pointer */
+	u32 if_sid;			/* SID for this interface */
+	u32 msg_sid;			/* default SID for messages received on this interface */
+	struct avc_entry_ref avcr;	/* reference to permissions */
+};
+
+struct sk_security_struct {
+	unsigned long magic;		/* magic number for this module */
+	struct sock *sk;		/* back pointer to sk object */
+	u32 peer_sid;			/* SID of peer */
+};
+
 extern int inode_security_set_sid(struct inode *inode, u32 sid);
 
 #endif /* _SELINUX_OBJSEC_H_ */
diff -Nru a/security/selinux/netif.c b/security/selinux/netif.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/security/selinux/netif.c	Tue Feb  3 19:45:43 2004
@@ -0,0 +1,240 @@
+/*
+ * Network interface table.
+ *
+ * Network interfaces (devices) do not have a security field, so we
+ * maintain a table associating each interface with a SID.
+ *
+ * Author: James Morris <jmorris@redhat.com>
+ *
+ * Copyright (C) 2003 Red Hat, Inc., James Morris <jmorris@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ */
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/stddef.h>
+#include <linux/kernel.h>
+#include <linux/list.h>
+#include <linux/notifier.h>
+#include <linux/netdevice.h>
+#include <linux/rcupdate.h>
+
+#include "security.h"
+#include "objsec.h"
+#include "netif.h"
+
+#define SEL_NETIF_HASH_SIZE	64
+#define SEL_NETIF_HASH_MAX	1024
+
+#undef DEBUG
+
+#ifdef DEBUG
+#define DEBUGP printk
+#else
+#define DEBUGP(format, args...)
+#endif
+
+static u32 sel_netif_total;
+static LIST_HEAD(sel_netif_list);
+static spinlock_t sel_netif_lock = SPIN_LOCK_UNLOCKED;
+static struct sel_netif sel_netif_hash[SEL_NETIF_HASH_SIZE];
+
+static inline u32 sel_netif_hasfn(struct net_device *dev)
+{
+	return (dev->ifindex & (SEL_NETIF_HASH_SIZE - 1));
+}
+
+/*
+ * All of the devices should normally fit in the hash, so we optimize
+ * for that case.
+ */
+static struct sel_netif *sel_netif_find(struct net_device *dev)
+{
+	struct list_head *pos;
+	int idx = sel_netif_hasfn(dev);
+
+	__list_for_each_rcu(pos, &sel_netif_hash[idx].list) {
+		struct sel_netif *netif = list_entry(pos,
+		                                     struct sel_netif, list);
+		if (likely(netif->nsec.dev == dev))
+			return netif;
+	}
+	return NULL;
+}
+
+static int sel_netif_insert(struct sel_netif *netif)
+{
+	int idx, ret = 0;
+	
+	if (sel_netif_total >= SEL_NETIF_HASH_MAX) {
+		ret = -ENOSPC;
+		goto out;
+	}
+	
+	idx = sel_netif_hasfn(netif->nsec.dev);
+	list_add_rcu(&netif->list, &sel_netif_hash[idx].list);
+	atomic_set(&netif->users, 1);
+	sel_netif_total++;
+out:
+	return ret;
+}
+
+struct sel_netif *sel_netif_lookup(struct net_device *dev)
+{
+	int ret;
+	struct sel_netif *netif, *new;
+	struct netif_security_struct *nsec;
+
+	rcu_read_lock();
+	netif = sel_netif_find(dev);
+	rcu_read_unlock();
+	
+	if (likely(netif != NULL))
+		goto out_hold;
+	
+	new = kmalloc(sizeof(*new), GFP_ATOMIC);
+	if (!new) {
+		netif = ERR_PTR(-ENOMEM);
+		goto out;
+	}
+	
+	memset(new, 0, sizeof(*new));
+	nsec = &new->nsec;
+
+	ret = security_netif_sid(dev->name, &nsec->if_sid, &nsec->msg_sid);
+	if (ret < 0) {
+		kfree(new);
+		netif = ERR_PTR(ret);
+		goto out;
+	}
+
+	nsec->dev = dev;
+	
+	spin_lock_bh(&sel_netif_lock);
+	
+	netif = sel_netif_find(dev);
+	if (netif) {
+		spin_unlock_bh(&sel_netif_lock);
+		kfree(new);
+		goto out_hold;
+	}
+	
+	sel_netif_insert(new);
+	spin_unlock_bh(&sel_netif_lock);
+	
+	netif = new;
+	
+	DEBUGP("new: ifindex=%u name=%s if_sid=%u msg_sid=%u\n", dev->ifindex, dev->name,
+	        nsec->if_sid, nsec->msg_sid);
+out_hold:
+	atomic_inc(&netif->users);
+out:
+	return netif;
+}
+
+static void sel_netif_free(void *p)
+{
+	struct sel_netif *netif = p;
+	
+	DEBUGP("%s: %s\n", __FUNCTION__, netif->nsec.dev->name);
+	kfree(netif);
+}
+
+static void sel_netif_destroy(struct sel_netif *netif)
+{
+	DEBUGP("%s: %s\n", __FUNCTION__, netif->nsec.dev->name);
+	
+	spin_lock_bh(&sel_netif_lock);
+	list_del_rcu(&netif->list);
+	sel_netif_total--;
+	spin_unlock_bh(&sel_netif_lock);
+
+	call_rcu(&netif->rcu_head, sel_netif_free, netif);
+}
+
+void sel_netif_put(struct sel_netif *netif)
+{
+	if (atomic_dec_and_test(&netif->users))
+		sel_netif_destroy(netif);
+}
+
+static void sel_netif_kill(struct net_device *dev)
+{
+	struct sel_netif *netif;
+	
+	rcu_read_lock();
+	netif = sel_netif_find(dev);
+	rcu_read_unlock();
+
+	/* Drop internal reference */
+	if (netif)
+		sel_netif_put(netif);
+}
+
+static void sel_netif_flush(void)
+{
+	int idx;
+
+	for (idx = 0; idx < SEL_NETIF_HASH_SIZE; idx++) {
+		struct list_head *pos;
+		
+		list_for_each_rcu(pos, &sel_netif_hash[idx].list) {
+			struct sel_netif *netif;
+			
+			netif = list_entry(pos, struct sel_netif, list);
+			if (netif)
+				sel_netif_put(netif);
+		}
+	}
+}
+
+static int sel_netif_avc_callback(u32 event, u32 ssid, u32 tsid,
+                                  u16 class, u32 perms, u32 *retained)
+{
+	if (event == AVC_CALLBACK_RESET) {
+		sel_netif_flush();
+		synchronize_net();
+	}
+	return 0;
+}
+
+static int sel_netif_netdev_notifier_handler(struct notifier_block *this,
+                                             unsigned long event, void *ptr)
+{
+	struct net_device *dev = ptr;
+
+	if (event == NETDEV_DOWN)
+		sel_netif_kill(dev);
+
+	return NOTIFY_DONE;
+}
+
+static struct notifier_block sel_netif_netdev_notifier = {
+	.notifier_call = sel_netif_netdev_notifier_handler,
+};
+
+static __init int sel_netif_init(void)
+{
+	int i, err = 0;
+	
+	if (!selinux_enabled)
+		goto out;
+
+	for (i = 0; i < SEL_NETIF_HASH_SIZE; i++)
+		INIT_LIST_HEAD(&sel_netif_hash[i].list);
+
+	register_netdevice_notifier(&sel_netif_netdev_notifier);
+	
+	err = avc_add_callback(sel_netif_avc_callback, AVC_CALLBACK_RESET,
+	                       SECSID_NULL, SECSID_NULL, SECCLASS_NULL, 0);
+	if (err)
+		panic("avc_add_callback() failed, error %d\n", err);
+
+out:
+	return err;
+}
+
+__initcall(sel_netif_init);
+
diff -Nru a/security/selinux/ss/Makefile b/security/selinux/ss/Makefile
--- a/security/selinux/ss/Makefile	Tue Feb  3 19:45:16 2004
+++ b/security/selinux/ss/Makefile	Tue Feb  3 19:45:16 2004
@@ -5,9 +5,7 @@
 EXTRA_CFLAGS += -Isecurity/selinux/include
 obj-y := ss.o
 
-ss-objs := ebitmap.o hashtab.o symtab.o sidtab.o avtab.o policydb.o services.o
+ss-y := ebitmap.o hashtab.o symtab.o sidtab.o avtab.o policydb.o services.o
 
-ifeq ($(CONFIG_SECURITY_SELINUX_MLS),y)
-ss-objs += mls.o
-endif
+ss-$(CONFIG_SECURITY_SELINUX_MLS) += mls.o
 
diff -Nru a/sound/core/sound.c b/sound/core/sound.c
--- a/sound/core/sound.c	Tue Feb  3 19:45:34 2004
+++ b/sound/core/sound.c	Tue Feb  3 19:45:34 2004
@@ -38,9 +38,7 @@
 static int major = CONFIG_SND_MAJOR;
 int snd_major;
 static int cards_limit = SNDRV_CARDS;
-#ifdef CONFIG_DEVFS_FS
 static int device_mode = S_IFCHR | S_IRUGO | S_IWUGO;
-#endif
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
 MODULE_DESCRIPTION("Advanced Linux Sound Architecture driver for soundcards.");
@@ -66,6 +64,7 @@
 
 static DECLARE_MUTEX(sound_mutex);
 
+extern struct class_simple *sound_class;
 #ifdef CONFIG_KMOD
 
 /**
@@ -203,6 +202,7 @@
 {
 	int minor = snd_kernel_minor(type, card, dev);
 	snd_minor_t *preg;
+	struct device *device = NULL;
 
 	if (minor < 0)
 		return minor;
@@ -221,10 +221,14 @@
 		return -EBUSY;
 	}
 	list_add_tail(&preg->list, &snd_minors_hash[SNDRV_MINOR_CARD(minor)]);
-#ifdef CONFIG_DEVFS_FS
-	if (strncmp(name, "controlC", 8))     /* created in sound.c */
+
+	if (strncmp(name, "controlC", 8)) {	/* created in sound.c */
 		devfs_mk_cdev(MKDEV(major, minor), S_IFCHR | device_mode, "snd/%s", name);
-#endif
+		if (card)
+			device = card->dev;
+		class_simple_device_add(sound_class, MKDEV(major, minor), device, name);
+	}
+
 	up(&sound_mutex);
 	return 0;
 }
@@ -252,10 +256,12 @@
 		up(&sound_mutex);
 		return -EINVAL;
 	}
-#ifdef CONFIG_DEVFS_FS
-	if (strncmp(mptr->name, "controlC", 8))	/* created in sound.c */
+
+	if (strncmp(mptr->name, "controlC", 8)) {	/* created in sound.c */
 		devfs_remove("snd/%s", mptr->name);
-#endif
+		class_simple_device_remove(MKDEV(major, minor));
+	}
+
 	list_del(&mptr->list);
 	up(&sound_mutex);
 	kfree(mptr);
@@ -322,9 +328,7 @@
 
 static int __init alsa_sound_init(void)
 {
-#ifdef CONFIG_DEVFS_FS
 	short controlnum;
-#endif
 #ifdef CONFIG_SND_OSSEMUL
 	int err;
 #endif
@@ -358,10 +362,10 @@
 #ifdef CONFIG_SND_OSSEMUL
 	snd_info_minor_register();
 #endif
-#ifdef CONFIG_DEVFS_FS
-	for (controlnum = 0; controlnum < cards_limit; controlnum++) 
+	for (controlnum = 0; controlnum < cards_limit; controlnum++) {
 		devfs_mk_cdev(MKDEV(major, controlnum<<5), S_IFCHR | device_mode, "snd/controlC%d", controlnum);
-#endif
+		class_simple_device_add(sound_class, MKDEV(major, controlnum<<5), NULL, "controlC%d", controlnum);
+	}
 #ifndef MODULE
 	printk(KERN_INFO "Advanced Linux Sound Architecture Driver Version " CONFIG_SND_VERSION CONFIG_SND_DATE ".\n");
 #endif
@@ -372,8 +376,10 @@
 {
 	short controlnum;
 
-	for (controlnum = 0; controlnum < cards_limit; controlnum++)
+	for (controlnum = 0; controlnum < cards_limit; controlnum++) {
 		devfs_remove("snd/controlC%d", controlnum);
+		class_simple_device_remove(MKDEV(major, controlnum<<5));
+	}
 
 #ifdef CONFIG_SND_OSSEMUL
 	snd_info_minor_unregister();
diff -Nru a/sound/oss/dmabuf.c b/sound/oss/dmabuf.c
--- a/sound/oss/dmabuf.c	Tue Feb  3 19:45:16 2004
+++ b/sound/oss/dmabuf.c	Tue Feb  3 19:45:16 2004
@@ -587,7 +587,6 @@
 		spin_unlock_irqrestore(&dmap->lock,flags);
 		timeout = interruptible_sleep_on_timeout(&adev->in_sleeper,
 							 timeout);
-		spin_lock_irqsave(&dmap->lock,flags);
 		if (!timeout) {
 			/* FIXME: include device name */
 			err = -EIO;
@@ -595,6 +594,7 @@
 			dma_reset_input(dev);
 		} else
 			err = -EINTR;
+		spin_lock_irqsave(&dmap->lock,flags);
 	}
 	spin_unlock_irqrestore(&dmap->lock,flags);
 
diff -Nru a/sound/oss/soundcard.c b/sound/oss/soundcard.c
--- a/sound/oss/soundcard.c	Tue Feb  3 19:45:18 2004
+++ b/sound/oss/soundcard.c	Tue Feb  3 19:45:18 2004
@@ -73,6 +73,7 @@
 
 
 unsigned long seq_time = 0;	/* Time for /dev/sequencer */
+extern struct class_simple *sound_class;
 
 /*
  * Table for configurable mixer volume handling
@@ -569,6 +570,9 @@
 		devfs_mk_cdev(MKDEV(SOUND_MAJOR, dev_list[i].minor),
 				S_IFCHR | dev_list[i].mode,
 				"sound/%s", dev_list[i].name);
+		class_simple_device_add(sound_class, 
+					MKDEV(SOUND_MAJOR, dev_list[i].minor),
+					NULL, "%s", dev_list[i].name);
 
 		if (!dev_list[i].num)
 			continue;
@@ -578,6 +582,10 @@
 						dev_list[i].minor + (j*0x10)),
 					S_IFCHR | dev_list[i].mode,
 					"sound/%s%d", dev_list[i].name, j);
+			class_simple_device_add(sound_class,
+					MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)),
+					NULL,
+					"%s%d", dev_list[i].name, j);
 		}
 	}
 
@@ -593,10 +601,13 @@
 
 	for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) {
 		devfs_remove("sound/%s", dev_list[i].name);
+		class_simple_device_remove(MKDEV(SOUND_MAJOR, dev_list[i].minor));
 		if (!dev_list[i].num)
 			continue;
-		for (j = 1; j < *dev_list[i].num; j++)
+		for (j = 1; j < *dev_list[i].num; j++) {
 			devfs_remove("sound/%s%d", dev_list[i].name, j);
+			class_simple_device_remove(MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)));
+		}
 	}
 	
 	unregister_sound_special(1);
diff -Nru a/sound/oss/trident.c b/sound/oss/trident.c
--- a/sound/oss/trident.c	Tue Feb  3 19:45:35 2004
+++ b/sound/oss/trident.c	Tue Feb  3 19:45:35 2004
@@ -1,5 +1,5 @@
 /*
- *	OSS driver for Linux 2.4.x for
+ *	OSS driver for Linux 2.[46].x for
  *
  *	Trident 4D-Wave
  *	SiS 7018
@@ -37,6 +37,15 @@
  *	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  *  History
+ *  v0.14.10j
+ *  	January 3 2004 Eugene Teo <eugeneteo@eugeneteo.net>
+ *  	minor cleanup to use pr_debug instead of TRDBG since it is already
+ *  	defined in linux/kernel.h.
+ *  v0.14.10i
+ *      December 29 2003 Muli Ben-Yehuda <mulix@mulix.org>
+ *      major cleanup for 2.6, fix a few error patch buglets
+ *      with returning without properly cleaning up first,
+ *      get rid of lock_kernel().
  *  v0.14.10h
  *	Sept 10 2002 Pascal Schmidt <der.eremit@email.de>
  *	added support for ALi 5451 joystick port
@@ -206,7 +215,7 @@
 #include <linux/interrupt.h>
 #include <linux/pm.h>
 #include <linux/gameport.h>
-#include <linux/kernel.h> 
+#include <linux/kernel.h>
 #include <asm/uaccess.h>
 #include <asm/hardirq.h>
 #include <asm/io.h>
@@ -218,29 +227,29 @@
 
 #include "trident.h"
 
-#define DRIVER_VERSION "0.14.10h-2.5"
+#define DRIVER_VERSION "0.14.10j-2.6"
 
 /* magic numbers to protect our data structures */
-#define TRIDENT_CARD_MAGIC	0x5072696E /* "Prin" */
-#define TRIDENT_STATE_MAGIC	0x63657373 /* "cess" */
+#define TRIDENT_CARD_MAGIC	0x5072696E	/* "Prin" */
+#define TRIDENT_STATE_MAGIC	0x63657373	/* "cess" */
 
-#define TRIDENT_DMA_MASK	0x3fffffff /* DMA buffer mask for pci_alloc_consist */
-#define ALI_DMA_MASK		0x7fffffff /* ALI Tridents have 31-bit DMA. Wow. */
+#define TRIDENT_DMA_MASK	0x3fffffff	/* DMA buffer mask for pci_alloc_consist */
+#define ALI_DMA_MASK		0x7fffffff	/* ALI Tridents have 31-bit DMA. Wow. */
 
 #define NR_HW_CH		32
 
 /* maximum number of AC97 codecs connected, AC97 2.0 defined 4, but 7018 and 4D-NX only
    have 2 SDATA_IN lines (currently) */
-#define NR_AC97		2	
+#define NR_AC97		2
 
 /* minor number of /dev/swmodem (temporary, experimental) */
 #define SND_DEV_SWMODEM	7
 
-static const unsigned ali_multi_channels_5_1[] = { 
-	/*ALI_SURR_LEFT_CHANNEL, ALI_SURR_RIGHT_CHANNEL,*/
-	ALI_CENTER_CHANNEL, 
-	ALI_LEF_CHANNEL, 
-	ALI_SURR_LEFT_CHANNEL, 
+static const unsigned ali_multi_channels_5_1[] = {
+	/*ALI_SURR_LEFT_CHANNEL, ALI_SURR_RIGHT_CHANNEL, */
+	ALI_CENTER_CHANNEL,
+	ALI_LEF_CHANNEL,
+	ALI_SURR_LEFT_CHANNEL,
 	ALI_SURR_RIGHT_CHANNEL
 };
 
@@ -257,7 +266,7 @@
 	CYBER5050
 };
 
-static char * card_names[] = {
+static char *card_names[] = {
 	"Trident 4DWave DX",
 	"Trident 4DWave NX",
 	"SiS 7018 PCI Audio",
@@ -265,7 +274,7 @@
 	"Tvia/IGST CyberPro 5050"
 };
 
-static struct pci_device_id trident_pci_tbl [] = {
+static struct pci_device_id trident_pci_tbl[] = {
 	{PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, TRIDENT_4D_DX},
 	{PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX,
@@ -274,12 +283,12 @@
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, SIS_7018},
 	{PCI_VENDOR_ID_ALI, PCI_DEVICE_ID_ALI_5451,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, ALI_5451},
-	{ PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_5050, 
+	{PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_5050,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, CYBER5050},
 	{0,}
 };
 
-MODULE_DEVICE_TABLE (pci, trident_pci_tbl);
+MODULE_DEVICE_TABLE(pci, trident_pci_tbl);
 
 /* "software" or virtual channel, an instance of opened /dev/dsp */
 struct trident_state {
@@ -308,13 +317,14 @@
 		unsigned fragshift;
 
 		/* our buffer acts like a circular ring */
-		unsigned hwptr;		/* where dma last started, updated by update_ptr */
-		unsigned swptr;		/* where driver last clear/filled, updated by read/write */
-		int count;		/* bytes to be comsumed or been generated by dma machine */
+		unsigned hwptr;	/* where dma last started, updated by update_ptr */
+		unsigned swptr;	/* where driver last clear/filled, updated by read/write */
+		int count;	/* bytes to be comsumed or been generated by dma machine */
 		unsigned total_bytes;	/* total bytes dmaed by hardware */
 
-		unsigned error;		/* number of over/underruns */
-		wait_queue_head_t wait;	/* put process on wait queue when no more space in buffer */
+		unsigned error;	/* number of over/underruns */
+                /* put process on wait queue when no more space in buffer */
+		wait_queue_head_t wait;	
 
 		/* redundant, but makes calculations easier */
 		unsigned fragsize;
@@ -329,14 +339,14 @@
 		unsigned ossfragshift;
 		int ossmaxfrags;
 		unsigned subdivision;
-		
+
 	} dmabuf;
 
-	/* 5.1 channels */	
+	/* 5.1 channels */
 	struct trident_state *other_states[4];
 	int multi_channels_adjust_count;
 	unsigned chans_num;
-	unsigned fmt_flag:1;
+	unsigned long fmt_flag;
 	/* Guard against mmap/write/read races */
 	struct semaphore sem;
 
@@ -344,13 +354,15 @@
 
 /* hardware channels */
 struct trident_channel {
-	int  num;	/* channel number */
-	u32 lba;	/* Loop Begine Address, where dma buffer starts */
-	u32 eso;	/* End Sample Offset, wehre dma buffer ends (in the unit of samples) */
-	u32 delta;	/* delta value, sample rate / 48k for playback, 48k/sample rate for recording */
-	u16 attribute;	/* control where PCM data go and come  */
+	int num; /* channel number */
+	u32 lba; /* Loop Begine Address, where dma buffer starts */
+	u32 eso; /* End Sample Offset, wehre dma buffer ends */ 
+	         /* (in the unit of samples) */
+	u32 delta; /* delta value, sample rate / 48k for playback, */
+	           /* 48k/sample rate for recording */
+	u16 attribute; /* control where PCM data go and come  */
 	u16 fm_vol;
-	u32 control;	/* signed/unsigned, 8/16 bits, mono/stereo */
+	u32 control; /* signed/unsigned, 8/16 bits, mono/stereo */
 };
 
 struct trident_pcm_bank_address {
@@ -360,16 +372,14 @@
 	u32 aint_en;
 };
 
-static struct trident_pcm_bank_address bank_a_addrs =
-{
+static struct trident_pcm_bank_address bank_a_addrs = {
 	T4D_START_A,
 	T4D_STOP_A,
 	T4D_AINT_A,
 	T4D_AINTEN_A
 };
 
-static struct trident_pcm_bank_address bank_b_addrs =
-{
+static struct trident_pcm_bank_address bank_b_addrs = {
 	T4D_START_B,
 	T4D_STOP_B,
 	T4D_AINT_B,
@@ -380,7 +390,7 @@
 	/* register addresses to control bank operations */
 	struct trident_pcm_bank_address *addresses;
 	/* each bank has 32 channels */
-	u32 bitmap; /* channel allocation bitmap */
+	u32 bitmap;		/* channel allocation bitmap */
 	struct trident_channel channels[32];
 };
 
@@ -396,16 +406,17 @@
 	/* The trident has a certain amount of cross channel interaction
 	   so we use a single per card lock */
 	spinlock_t lock;
-	
+
 	/* PCI device stuff */
-	struct pci_dev * pci_dev;
+	struct pci_dev *pci_dev;
 	u16 pci_id;
 	u8 revision;
 
 	/* soundcore stuff */
 	int dev_audio;
 
-	/* structures for abstraction of hardware facilities, codecs, banks and channels*/
+	/* structures for abstraction of hardware facilities, codecs, */ 
+	/* banks and channels */
 	struct ac97_codec *ac97_codec[NR_AC97];
 	struct trident_pcm_bank banks[NR_BANKS];
 	struct trident_state *states[NR_HW_CH];
@@ -413,13 +424,13 @@
 	/* hardware resources */
 	unsigned long iobase;
 	u32 irq;
-	
+
 	/* Function support */
-	struct trident_channel *(*alloc_pcm_channel)(struct trident_card *);
-	struct trident_channel *(*alloc_rec_pcm_channel)(struct trident_card *);
-	void (*free_pcm_channel)(struct trident_card *, unsigned int chan);
-	void (*address_interrupt)(struct trident_card *);
-	
+	struct trident_channel *(*alloc_pcm_channel) (struct trident_card *);
+	struct trident_channel *(*alloc_rec_pcm_channel) (struct trident_card *);
+	void (*free_pcm_channel) (struct trident_card *, unsigned int chan);
+	void (*address_interrupt) (struct trident_card *);
+
 	/* Added by Matt Wu 01-05-2001 for spdif in */
 	int multi_channel_use_count;
 	int rec_channel_use_count;
@@ -434,16 +445,20 @@
 	struct gameport gameport;
 };
 
+enum dmabuf_mode {
+	DM_PLAYBACK = 0,
+	DM_RECORD
+};
+
 /* table to map from CHANNELMASK to channel attribute for SiS 7018 */
-static u16 mask2attr [] =
-{
+static u16 mask2attr[] = {
 	PCM_LR, PCM_LR, SURR_LR, CENTER_LFE,
 	HSET, MIC, MODEM_LINE1, MODEM_LINE2,
 	I2S_LR, SPDIF_LR
 };
 
 /* table to map from channel attribute to CHANNELMASK for SiS 7018 */
-static int attr2mask [] = {
+static int attr2mask[] = {
 	DSP_BIND_MODEM1, DSP_BIND_MODEM2, DSP_BIND_FRONT, DSP_BIND_HANDSET,
 	DSP_BIND_I2S, DSP_BIND_CENTER_LFE, DSP_BIND_SURR, DSP_BIND_SPDIF
 };
@@ -462,8 +477,8 @@
 static u16 trident_ac97_get(struct ac97_codec *codec, u8 reg);
 
 static int trident_open_mixdev(struct inode *inode, struct file *file);
-static int trident_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int cmd,
-				unsigned long arg);
+static int trident_ioctl_mixdev(struct inode *inode, struct file *file, 
+				unsigned int cmd, unsigned long arg);
 
 static void ali_ac97_set(struct trident_card *card, int secondary, u8 reg, u16 val);
 static u16 ali_ac97_get(struct trident_card *card, int secondary, u8 reg);
@@ -482,14 +497,13 @@
 static void ali_disable_spdif_in(struct trident_card *card);
 static void ali_disable_special_channel(struct trident_card *card, int ch);
 static void ali_setup_spdif_out(struct trident_card *card, int flag);
-static int ali_write_5_1(struct trident_state *state, const char *buffer,
+static int ali_write_5_1(struct trident_state *state, const char *buffer, 
 			 int cnt_for_multi_channel, unsigned int *copy_count, 
 			 unsigned int *state_cnt);
 static int ali_allocate_other_states_resources(struct trident_state *state, 
 					       int chan_nums);
 static void ali_free_other_states_resources(struct trident_state *state);
 
-
 /* save registers for ALi Power Management */
 static struct ali_saved_registers {
 	unsigned long global_regs[ALI_GLOBAL_REGS];
@@ -503,34 +517,30 @@
         (cnt) -= (offset);	  \
 	(copy_count) += (offset); \
 } while (0)
-	  
 
-#define lock_set_fmt(state) do { \
-        spin_lock_irqsave(&state->card->lock, flags);			\
-	if (state->fmt_flag) {						\
-	       spin_unlock_irqrestore(&state->card->lock, flags);	\
-               return -EFAULT;					        \
-	}								\
-	state->fmt_flag = 1;						\
-	spin_unlock_irqrestore(&state->card->lock, flags);              \
-} while (0)
-				
-#define unlock_set_fmt(state)  do {                             \
-        spin_lock_irqsave(&state->card->lock, flags);		\
-	state->fmt_flag = 0;					\
-	spin_unlock_irqrestore(&state->card->lock, flags);      \
-} while (0)
+static inline int lock_set_fmt(struct trident_state* state)
+{
+	if (test_and_set_bit(0, &state->fmt_flag))
+		return -EFAULT;
+
+	return 0;
+}
 
-static int trident_enable_loop_interrupts(struct trident_card * card)
+static inline void unlock_set_fmt(struct trident_state* state)
+{
+	clear_bit(0, &state->fmt_flag);
+}
+
+static int
+trident_enable_loop_interrupts(struct trident_card *card)
 {
 	u32 global_control;
 
 	global_control = inl(TRID_REG(card, T4D_LFO_GC_CIR));
 
-	switch (card->pci_id)
-	{
+	switch (card->pci_id) {
 	case PCI_DEVICE_ID_SI_7018:
-		global_control |= (ENDLP_IE | MIDLP_IE| BANK_B_EN);
+		global_control |= (ENDLP_IE | MIDLP_IE | BANK_B_EN);
 		break;
 	case PCI_DEVICE_ID_ALI_5451:
 	case PCI_DEVICE_ID_TRIDENT_4DWAVE_DX:
@@ -539,18 +549,19 @@
 		global_control |= (ENDLP_IE | MIDLP_IE);
 		break;
 	default:
-		return FALSE;
+		return 0;
 	}
 
 	outl(global_control, TRID_REG(card, T4D_LFO_GC_CIR));
 
-	TRDBG("trident: Enable Loop Interrupts, globctl = 0x%08X\n",
-	      inl(TRID_REG(card, T4D_LFO_GC_CIR)));
+	pr_debug("trident: Enable Loop Interrupts, globctl = 0x%08X\n",
+		 inl(TRID_REG(card, T4D_LFO_GC_CIR)));
 
-	return (TRUE);
+	return 1;
 }
 
-static int trident_disable_loop_interrupts(struct trident_card * card)
+static int
+trident_disable_loop_interrupts(struct trident_card *card)
 {
 	u32 global_control;
 
@@ -558,13 +569,14 @@
 	global_control &= ~(ENDLP_IE | MIDLP_IE);
 	outl(global_control, TRID_REG(card, T4D_LFO_GC_CIR));
 
-	TRDBG("trident: Disabled Loop Interrupts, globctl = 0x%08X\n",
-	      global_control);
+	pr_debug("trident: Disabled Loop Interrupts, globctl = 0x%08X\n",
+		 global_control);
 
-	return (TRUE);
+	return 1;
 }
 
-static void trident_enable_voice_irq(struct trident_card * card, unsigned int channel)
+static void
+trident_enable_voice_irq(struct trident_card *card, unsigned int channel)
 {
 	unsigned int mask = 1 << (channel & 0x1f);
 	struct trident_pcm_bank *bank = &card->banks[channel >> 5];
@@ -576,32 +588,36 @@
 
 #ifdef DEBUG
 	reg = inl(TRID_REG(card, addr));
-	TRDBG("trident: enabled IRQ on channel %d, %s = 0x%08x(addr:%X)\n",
-	      channel, addr==T4D_AINTEN_B? "AINTEN_B":"AINTEN_A",reg,addr);
-#endif /* DEBUG */ 
+	pr_debug("trident: enabled IRQ on channel %d, %s = 0x%08x(addr:%X)\n",
+		 channel, addr == T4D_AINTEN_B ? "AINTEN_B" : "AINTEN_A",
+		 reg, addr);
+#endif /* DEBUG */
 }
 
-static void trident_disable_voice_irq(struct trident_card * card, unsigned int channel)
+static void
+trident_disable_voice_irq(struct trident_card *card, unsigned int channel)
 {
 	unsigned int mask = 1 << (channel & 0x1f);
 	struct trident_pcm_bank *bank = &card->banks[channel >> 5];
 	u32 reg, addr = bank->addresses->aint_en;
-	
+
 	reg = inl(TRID_REG(card, addr));
 	reg &= ~mask;
 	outl(reg, TRID_REG(card, addr));
-	
+
 	/* Ack the channel in case the interrupt was set before we disable it. */
 	outl(mask, TRID_REG(card, bank->addresses->aint));
 
 #ifdef DEBUG
 	reg = inl(TRID_REG(card, addr));
-	TRDBG("trident: disabled IRQ on channel %d, %s = 0x%08x(addr:%X)\n",
-	      channel, addr==T4D_AINTEN_B? "AINTEN_B":"AINTEN_A",reg,addr);
-#endif /* DEBUG */ 
+	pr_debug("trident: disabled IRQ on channel %d, %s = 0x%08x(addr:%X)\n",
+		 channel, addr == T4D_AINTEN_B ? "AINTEN_B" : "AINTEN_A",
+		 reg, addr);
+#endif /* DEBUG */
 }
 
-static void trident_start_voice(struct trident_card * card, unsigned int channel)
+static void
+trident_start_voice(struct trident_card *card, unsigned int channel)
 {
 	unsigned int mask = 1 << (channel & 0x1f);
 	struct trident_pcm_bank *bank = &card->banks[channel >> 5];
@@ -609,18 +625,20 @@
 
 #ifdef DEBUG
 	u32 reg;
-#endif /* DEBUG */ 
+#endif /* DEBUG */
 
 	outl(mask, TRID_REG(card, addr));
 
-#ifdef DEBUG 
+#ifdef DEBUG
 	reg = inl(TRID_REG(card, addr));
-	TRDBG("trident: start voice on channel %d, %s = 0x%08x(addr:%X)\n",
-	      channel, addr==T4D_START_B? "START_B":"START_A",reg,addr);
-#endif /* DEBUG */ 
+	pr_debug("trident: start voice on channel %d, %s = 0x%08x(addr:%X)\n",
+		 channel, addr == T4D_START_B ? "START_B" : "START_A",
+		 reg, addr);
+#endif /* DEBUG */
 }
 
-static void trident_stop_voice(struct trident_card * card, unsigned int channel)
+static void
+trident_stop_voice(struct trident_card *card, unsigned int channel)
 {
 	unsigned int mask = 1 << (channel & 0x1f);
 	struct trident_pcm_bank *bank = &card->banks[channel >> 5];
@@ -628,38 +646,43 @@
 
 #ifdef DEBUG
 	u32 reg;
-#endif /* DEBUG */ 
+#endif /* DEBUG */
 
 	outl(mask, TRID_REG(card, addr));
 
 #ifdef DEBUG
 	reg = inl(TRID_REG(card, addr));
-	TRDBG("trident: stop voice on channel %d, %s = 0x%08x(addr:%X)\n",
-	      channel, addr==T4D_STOP_B? "STOP_B":"STOP_A",reg,addr);
-#endif /* DEBUG */ 
+	pr_debug("trident: stop voice on channel %d, %s = 0x%08x(addr:%X)\n",
+		 channel, addr == T4D_STOP_B ? "STOP_B" : "STOP_A",
+		 reg, addr);
+#endif /* DEBUG */
 }
 
-static u32 trident_get_interrupt_mask (struct trident_card * card, unsigned int channel)
+static u32
+trident_get_interrupt_mask(struct trident_card *card, unsigned int channel)
 {
 	struct trident_pcm_bank *bank = &card->banks[channel];
 	u32 addr = bank->addresses->aint;
 	return inl(TRID_REG(card, addr));
 }
 
-static int trident_check_channel_interrupt(struct trident_card * card, unsigned int channel)
+static int
+trident_check_channel_interrupt(struct trident_card *card, unsigned int channel)
 {
 	unsigned int mask = 1 << (channel & 0x1f);
-	u32 reg = trident_get_interrupt_mask (card, channel >> 5);
+	u32 reg = trident_get_interrupt_mask(card, channel >> 5);
 
 #ifdef DEBUG
 	if (reg & mask)
-		TRDBG("trident: channel %d has interrupt, %s = 0x%08x\n",
-		      channel,reg==T4D_AINT_B? "AINT_B":"AINT_A", reg);
-#endif /* DEBUG */ 
-	return (reg & mask) ? TRUE : FALSE;
+		pr_debug("trident: channel %d has interrupt, %s = 0x%08x\n",
+			 channel, reg == T4D_AINT_B ? "AINT_B" : "AINT_A",
+			 reg);
+#endif /* DEBUG */
+	return (reg & mask) ? 1 : 0;
 }
 
-static void trident_ack_channel_interrupt(struct trident_card * card, unsigned int channel)
+static void
+trident_ack_channel_interrupt(struct trident_card *card, unsigned int channel)
 {
 	unsigned int mask = 1 << (channel & 0x1f);
 	struct trident_pcm_bank *bank = &card->banks[channel >> 5];
@@ -671,12 +694,13 @@
 
 #ifdef DEBUG
 	reg = inl(TRID_REG(card, T4D_AINT_B));
-	TRDBG("trident: Ack channel %d interrupt, AINT_B = 0x%08x\n",
-	      channel, reg);
-#endif /* DEBUG */ 
+	pr_debug("trident: Ack channel %d interrupt, AINT_B = 0x%08x\n",
+		 channel, reg);
+#endif /* DEBUG */
 }
 
-static struct trident_channel * trident_alloc_pcm_channel(struct trident_card *card)
+static struct trident_channel *
+trident_alloc_pcm_channel(struct trident_card *card)
 {
 	struct trident_pcm_bank *bank;
 	int idx;
@@ -697,28 +721,30 @@
 	return NULL;
 }
 
-static void trident_free_pcm_channel(struct trident_card *card, unsigned int channel)
+static void
+trident_free_pcm_channel(struct trident_card *card, unsigned int channel)
 {
 	int bank;
-        unsigned char b;
+	unsigned char b;
 
 	if (channel < 31 || channel > 63)
 		return;
 
-	if (card->pci_id == PCI_DEVICE_ID_TRIDENT_4DWAVE_DX ||
-            card->pci_id == PCI_DEVICE_ID_TRIDENT_4DWAVE_NX) {
-          b = inb (TRID_REG(card, T4D_REC_CH));
-          if ((b & ~0x80) == channel)
-            outb(0x0, TRID_REG(card, T4D_REC_CH));
-        }
-            
+	if (card->pci_id == PCI_DEVICE_ID_TRIDENT_4DWAVE_DX || 
+	    card->pci_id == PCI_DEVICE_ID_TRIDENT_4DWAVE_NX) {
+		b = inb(TRID_REG(card, T4D_REC_CH));
+		if ((b & ~0x80) == channel)
+			outb(0x0, TRID_REG(card, T4D_REC_CH));
+	}
+
 	bank = channel >> 5;
 	channel = channel & 0x1f;
-        
+
 	card->banks[bank].bitmap &= ~(1 << (channel));
 }
 
-static struct trident_channel * cyber_alloc_pcm_channel(struct trident_card *card)
+static struct trident_channel *
+cyber_alloc_pcm_channel(struct trident_card *card)
 {
 	struct trident_pcm_bank *bank;
 	int idx;
@@ -743,26 +769,30 @@
 	return NULL;
 }
 
-static void cyber_free_pcm_channel(struct trident_card *card, unsigned int channel)
+static void
+cyber_free_pcm_channel(struct trident_card *card, unsigned int channel)
 {
 	if (channel > 31)
 		return;
 	card->banks[BANK_A].bitmap &= ~(1 << (channel));
 }
 
-static inline void cyber_outidx(int port,int idx,int data)
+static inline void
+cyber_outidx(int port, int idx, int data)
 {
-	outb(idx,port);
-	outb(data,port+1);
+	outb(idx, port);
+	outb(data, port + 1);
 }
 
-static inline int cyber_inidx(int port,int idx)
+static inline int
+cyber_inidx(int port, int idx)
 {
-	outb(idx,port);
-	return inb(port+1);
+	outb(idx, port);
+	return inb(port + 1);
 }
 
-static int cyber_init_ritual(struct trident_card *card)
+static int
+cyber_init_ritual(struct trident_card *card)
 {
 	/* some black magic, taken from SDK samples */
 	/* remove this and nothing will work */
@@ -771,47 +801,47 @@
 	unsigned long flags;
 
 	/*
- 	 *	Keep interrupts off for the configure - we don't want to
- 	 *	clash with another cyberpro config event
- 	 */
- 	
-	spin_lock_irqsave(&card->lock, flags); 
+	 *      Keep interrupts off for the configure - we don't want to
+	 *      clash with another cyberpro config event
+	 */
+
+	spin_lock_irqsave(&card->lock, flags);
 	portDat = cyber_inidx(CYBER_PORT_AUDIO, CYBER_IDX_AUDIO_ENABLE);
 	/* enable, if it was disabled */
-	if( (portDat & CYBER_BMSK_AUENZ) != CYBER_BMSK_AUENZ_ENABLE ) {
-		printk(KERN_INFO "cyberpro5050: enabling audio controller\n" );
-		cyber_outidx( CYBER_PORT_AUDIO, CYBER_IDX_AUDIO_ENABLE,
-			portDat | CYBER_BMSK_AUENZ_ENABLE );
+	if ((portDat & CYBER_BMSK_AUENZ) != CYBER_BMSK_AUENZ_ENABLE) {
+		printk(KERN_INFO "cyberpro5050: enabling audio controller\n");
+		cyber_outidx(CYBER_PORT_AUDIO, CYBER_IDX_AUDIO_ENABLE, 
+			     portDat | CYBER_BMSK_AUENZ_ENABLE);
 		/* check again if hardware is enabled now */
 		portDat = cyber_inidx(CYBER_PORT_AUDIO, CYBER_IDX_AUDIO_ENABLE);
 	}
-	if( (portDat & CYBER_BMSK_AUENZ) != CYBER_BMSK_AUENZ_ENABLE )
-	{
-		printk(KERN_ERR "cyberpro5050: initAudioAccess: no success\n" );
+	if ((portDat & CYBER_BMSK_AUENZ) != CYBER_BMSK_AUENZ_ENABLE) {
+		printk(KERN_ERR "cyberpro5050: initAudioAccess: no success\n");
 		ret = -1;
+	} else {
+		cyber_outidx(CYBER_PORT_AUDIO, CYBER_IDX_IRQ_ENABLE, 
+			     CYBER_BMSK_AUDIO_INT_ENABLE);
+		cyber_outidx(CYBER_PORT_AUDIO, 0xbf, 0x01);
+		cyber_outidx(CYBER_PORT_AUDIO, 0xba, 0x20);
+		cyber_outidx(CYBER_PORT_AUDIO, 0xbb, 0x08);
+		cyber_outidx(CYBER_PORT_AUDIO, 0xbf, 0x02);
+		cyber_outidx(CYBER_PORT_AUDIO, 0xb3, 0x06);
+		cyber_outidx(CYBER_PORT_AUDIO, 0xbf, 0x00);
 	}
-	else
-	{
-		cyber_outidx( CYBER_PORT_AUDIO, CYBER_IDX_IRQ_ENABLE, CYBER_BMSK_AUDIO_INT_ENABLE );
-		cyber_outidx( CYBER_PORT_AUDIO, 0xbf, 0x01 );
-		cyber_outidx( CYBER_PORT_AUDIO, 0xba, 0x20 );
-		cyber_outidx( CYBER_PORT_AUDIO, 0xbb, 0x08 );
-		cyber_outidx( CYBER_PORT_AUDIO, 0xbf, 0x02 );
-		cyber_outidx( CYBER_PORT_AUDIO, 0xb3, 0x06 );
-		cyber_outidx( CYBER_PORT_AUDIO, 0xbf, 0x00 );
-	}
-	spin_unlock_irqrestore(&card->lock, flags); 
+	spin_unlock_irqrestore(&card->lock, flags);
 	return ret;
 }
 
 /*  called with spin lock held */
 
-static int trident_load_channel_registers(struct trident_card *card, u32 *data, unsigned int channel)
+static int
+trident_load_channel_registers(struct trident_card *card, u32 * data, 
+			       unsigned int channel)
 {
 	int i;
 
 	if (channel > 63)
-		return FALSE;
+		return 0;
 
 	/* select hardware channel to write */
 	outb(channel, TRID_REG(card, T4D_LFO_GC_CIR));
@@ -821,18 +851,19 @@
 	for (i = 0; i < CHANNEL_REGS; i++) {
 		if (i == 3 && card->pci_id == PCI_DEVICE_ID_ALI_5451)
 			continue;
-		outl(data[i], TRID_REG(card, CHANNEL_START + 4*i));
+		outl(data[i], TRID_REG(card, CHANNEL_START + 4 * i));
 	}
-	if (card->pci_id == PCI_DEVICE_ID_ALI_5451 ||
-		card->pci_id == PCI_DEVICE_ID_INTERG_5050) {
+	if (card->pci_id == PCI_DEVICE_ID_ALI_5451 || 
+	    card->pci_id == PCI_DEVICE_ID_INTERG_5050) {
 		outl(ALI_EMOD_Still, TRID_REG(card, ALI_EBUF1));
 		outl(ALI_EMOD_Still, TRID_REG(card, ALI_EBUF2));
 	}
-	return TRUE;
+	return 1;
 }
 
 /* called with spin lock held */
-static int trident_write_voice_regs(struct trident_state *state)
+static int
+trident_write_voice_regs(struct trident_state *state)
 {
 	unsigned int data[CHANNEL_REGS + 1];
 	struct trident_channel *channel;
@@ -842,37 +873,38 @@
 	data[1] = channel->lba;
 	data[4] = channel->control;
 
-	switch (state->card->pci_id)
-	{
+	switch (state->card->pci_id) {
 	case PCI_DEVICE_ID_ALI_5451:
-		data[0] = 0; /* Current Sample Offset */
+		data[0] = 0;	/* Current Sample Offset */
 		data[2] = (channel->eso << 16) | (channel->delta & 0xffff);
 		data[3] = 0;
-		break;	
+		break;
 	case PCI_DEVICE_ID_SI_7018:
 	case PCI_DEVICE_ID_INTERG_5050:
-		data[0] = 0; /* Current Sample Offset */
+		data[0] = 0;	/* Current Sample Offset */
 		data[2] = (channel->eso << 16) | (channel->delta & 0xffff);
 		data[3] = (channel->attribute << 16) | (channel->fm_vol & 0xffff);
 		break;
 	case PCI_DEVICE_ID_TRIDENT_4DWAVE_DX:
-		data[0] = 0; /* Current Sample Offset */
+		data[0] = 0;	/* Current Sample Offset */
 		data[2] = (channel->eso << 16) | (channel->delta & 0xffff);
 		data[3] = channel->fm_vol & 0xffff;
 		break;
 	case PCI_DEVICE_ID_TRIDENT_4DWAVE_NX:
 		data[0] = (channel->delta << 24);
-		data[2] = ((channel->delta << 16) & 0xff000000) | (channel->eso & 0x00ffffff);
+		data[2] = ((channel->delta << 16) & 0xff000000) | 
+			(channel->eso & 0x00ffffff);
 		data[3] = channel->fm_vol & 0xffff;
 		break;
 	default:
-		return FALSE;
+		return 0;
 	}
 
 	return trident_load_channel_registers(state->card, data, channel->num);
 }
 
-static int compute_rate_play(u32 rate)
+static int
+compute_rate_play(u32 rate)
 {
 	int delta;
 	/* We special case 44100 and 8000 since rounding with the equation
@@ -890,7 +922,8 @@
 	return delta;
 }
 
-static int compute_rate_rec(u32 rate)
+static int
+compute_rate_rec(u32 rate)
 {
 	int delta;
 
@@ -905,9 +938,11 @@
 
 	return delta;
 }
+
 /* set playback sample rate */
-static unsigned int trident_set_dac_rate(struct trident_state * state, unsigned int rate)
-{	
+static unsigned int
+trident_set_dac_rate(struct trident_state *state, unsigned int rate)
+{
 	struct dmabuf *dmabuf = &state->dmabuf;
 
 	if (rate > 48000)
@@ -920,13 +955,14 @@
 
 	trident_write_voice_regs(state);
 
-	TRDBG("trident: called trident_set_dac_rate : rate = %d\n", rate);
+	pr_debug("trident: called trident_set_dac_rate : rate = %d\n", rate);
 
 	return rate;
 }
 
 /* set recording sample rate */
-static unsigned int trident_set_adc_rate(struct trident_state * state, unsigned int rate)
+static unsigned int
+trident_set_adc_rate(struct trident_state *state, unsigned int rate)
 {
 	struct dmabuf *dmabuf = &state->dmabuf;
 
@@ -940,13 +976,14 @@
 
 	trident_write_voice_regs(state);
 
-	TRDBG("trident: called trident_set_adc_rate : rate = %d\n", rate);
+	pr_debug("trident: called trident_set_adc_rate : rate = %d\n", rate);
 
 	return rate;
 }
 
-/* prepare channel attributes for playback */ 
-static void trident_play_setup(struct trident_state *state)
+/* prepare channel attributes for playback */
+static void
+trident_play_setup(struct trident_state *state)
 {
 	struct dmabuf *dmabuf = &state->dmabuf;
 	struct trident_channel *channel = dmabuf->channel;
@@ -960,19 +997,21 @@
 	if (state->card->pci_id != PCI_DEVICE_ID_SI_7018) {
 		channel->attribute = 0;
 		if (state->card->pci_id == PCI_DEVICE_ID_ALI_5451) {
-			if ((channel->num == ALI_SPDIF_IN_CHANNEL) || (channel->num == ALI_PCM_IN_CHANNEL))
+			if ((channel->num == ALI_SPDIF_IN_CHANNEL) || 
+			    (channel->num == ALI_PCM_IN_CHANNEL))
 				ali_disable_special_channel(state->card, channel->num);
-			else if ((inl(TRID_REG(state->card, ALI_GLOBAL_CONTROL)) & ALI_SPDIF_OUT_CH_ENABLE) 
-								&& (channel->num == ALI_SPDIF_OUT_CHANNEL))
-			{
-				ali_set_spdif_out_rate(state->card, state->dmabuf.rate);
+			else if ((inl(TRID_REG(state->card, ALI_GLOBAL_CONTROL)) 
+				  & ALI_SPDIF_OUT_CH_ENABLE)
+				 && (channel->num == ALI_SPDIF_OUT_CHANNEL)) {
+				ali_set_spdif_out_rate(state->card, 
+						       state->dmabuf.rate);
 				state->dmabuf.channel->delta = 0x1000;
 			}
 		}
 	}
 
 	channel->fm_vol = 0x0;
-	
+
 	channel->control = CHANNEL_LOOP;
 	if (dmabuf->fmt & TRIDENT_FMT_16BIT) {
 		/* 16-bits */
@@ -984,18 +1023,19 @@
 		/* stereo */
 		channel->control |= CHANNEL_STEREO;
 
-	TRDBG("trident: trident_play_setup, LBA = 0x%08x, "
-	      "Delta = 0x%08x, ESO = 0x%08x, Control = 0x%08x\n",
-	      channel->lba, channel->delta, channel->eso, channel->control);
+	pr_debug("trident: trident_play_setup, LBA = 0x%08x, Delta = 0x%08x, "
+		 "ESO = 0x%08x, Control = 0x%08x\n", channel->lba,
+		 channel->delta, channel->eso, channel->control);
 
 	trident_write_voice_regs(state);
 }
 
 /* prepare channel attributes for recording */
-static void trident_rec_setup(struct trident_state *state)
+static void
+trident_rec_setup(struct trident_state *state)
 {
 	u16 w;
-	u8  bval;
+	u8 bval;
 
 	struct trident_card *card = state->card;
 	struct dmabuf *dmabuf = &state->dmabuf;
@@ -1003,8 +1043,7 @@
 	unsigned int rate;
 
 	/* Enable AC-97 ADC (capture) */
-	switch (card->pci_id) 
-	{
+	switch (card->pci_id) {
 	case PCI_DEVICE_ID_ALI_5451:
 		ali_enable_special_channel(state);
 		break;
@@ -1032,24 +1071,25 @@
 
 	channel->lba = dmabuf->dma_handle;
 	channel->delta = compute_rate_rec(dmabuf->rate);
-	if ((card->pci_id == PCI_DEVICE_ID_ALI_5451) && (channel->num == ALI_SPDIF_IN_CHANNEL)) {
+	if ((card->pci_id == PCI_DEVICE_ID_ALI_5451) && 
+	    (channel->num == ALI_SPDIF_IN_CHANNEL)) {
 		rate = ali_get_spdif_in_rate(card);
-		if (rate == 0)
-		{
-			printk(KERN_WARNING "trident: ALi 5451 S/PDIF input setup error!\n");
+		if (rate == 0) {
+			printk(KERN_WARNING "trident: ALi 5451 "
+			       "S/PDIF input setup error!\n");
 			rate = 48000;
 		}
-		bval = inb(TRID_REG(card,ALI_SPDIF_CTRL));
-		if (bval & 0x10)
-		{
-			outb(bval,TRID_REG(card,ALI_SPDIF_CTRL));
-			printk(KERN_WARNING "trident: cleared ALi 5451 S/PDIF parity error flag.\n");
+		bval = inb(TRID_REG(card, ALI_SPDIF_CTRL));
+		if (bval & 0x10) {
+			outb(bval, TRID_REG(card, ALI_SPDIF_CTRL));
+			printk(KERN_WARNING "trident: cleared ALi "
+			       "5451 S/PDIF parity error flag.\n");
 		}
 
 		if (rate != 48000)
 			channel->delta = ((rate << 12) / dmabuf->rate) & 0x0000ffff;
 	}
-	
+
 	channel->eso = dmabuf->dmasize >> sample_shift[dmabuf->fmt];
 	channel->eso -= 1;
 
@@ -1058,7 +1098,7 @@
 	}
 
 	channel->fm_vol = 0x0;
-	
+
 	channel->control = CHANNEL_LOOP;
 	if (dmabuf->fmt & TRIDENT_FMT_16BIT) {
 		/* 16-bits */
@@ -1069,17 +1109,18 @@
 	if (dmabuf->fmt & TRIDENT_FMT_STEREO)
 		/* stereo */
 		channel->control |= CHANNEL_STEREO;
-	
-	TRDBG("trident: trident_rec_setup, LBA = 0x%08x, "
-	      "Delat = 0x%08x, ESO = 0x%08x, Control = 0x%08x\n",
-	      channel->lba, channel->delta, channel->eso, channel->control);
+
+	pr_debug("trident: trident_rec_setup, LBA = 0x%08x, Delat = 0x%08x, "
+		 "ESO = 0x%08x, Control = 0x%08x\n", channel->lba,
+		 channel->delta, channel->eso, channel->control);
 
 	trident_write_voice_regs(state);
 }
 
 /* get current playback/recording dma buffer pointer (byte offset from LBA),
    called with spinlock held! */
-static inline unsigned trident_get_dma_addr(struct trident_state *state)
+static inline unsigned
+trident_get_dma_addr(struct trident_state *state)
 {
 	struct dmabuf *dmabuf = &state->dmabuf;
 	u32 cso;
@@ -1089,8 +1130,7 @@
 
 	outb(dmabuf->channel->num, TRID_REG(state->card, T4D_LFO_GC_CIR));
 
-	switch (state->card->pci_id) 
-	{
+	switch (state->card->pci_id) {
 	case PCI_DEVICE_ID_ALI_5451:
 	case PCI_DEVICE_ID_SI_7018:
 	case PCI_DEVICE_ID_TRIDENT_4DWAVE_DX:
@@ -1106,9 +1146,8 @@
 		return 0;
 	}
 
-	
-	TRDBG("trident: trident_get_dma_addr: chip reported channel: %d, "
-	      "cso = 0x%04x\n", dmabuf->channel->num, cso);
+	pr_debug("trident: trident_get_dma_addr: chip reported channel: %d, "
+		 "cso = 0x%04x\n", dmabuf->channel->num, cso);
 
 	/* ESO and CSO are in units of Samples, convert to byte offset */
 	cso <<= sample_shift[dmabuf->fmt];
@@ -1117,7 +1156,8 @@
 }
 
 /* Stop recording (lock held) */
-static inline void __stop_adc(struct trident_state *state)
+static inline void
+__stop_adc(struct trident_state *state)
 {
 	struct dmabuf *dmabuf = &state->dmabuf;
 	unsigned int chan_num = dmabuf->channel->num;
@@ -1128,7 +1168,8 @@
 	trident_disable_voice_irq(card, chan_num);
 }
 
-static void stop_adc(struct trident_state *state)
+static void
+stop_adc(struct trident_state *state)
 {
 	struct trident_card *card = state->card;
 	unsigned long flags;
@@ -1138,7 +1179,8 @@
 	spin_unlock_irqrestore(&card->lock, flags);
 }
 
-static void start_adc(struct trident_state *state)
+static void
+start_adc(struct trident_state *state)
 {
 	struct dmabuf *dmabuf = &state->dmabuf;
 	unsigned int chan_num = dmabuf->channel->num;
@@ -1146,7 +1188,9 @@
 	unsigned long flags;
 
 	spin_lock_irqsave(&card->lock, flags);
-	if ((dmabuf->mapped || dmabuf->count < (signed)dmabuf->dmasize) && dmabuf->ready) {
+	if ((dmabuf->mapped || 
+	     dmabuf->count < (signed) dmabuf->dmasize) && 
+	    dmabuf->ready) {
 		dmabuf->enable |= ADC_RUNNING;
 		trident_enable_voice_irq(card, chan_num);
 		trident_start_voice(card, chan_num);
@@ -1155,7 +1199,8 @@
 }
 
 /* stop playback (lock held) */
-static inline void __stop_dac(struct trident_state *state)
+static inline void
+__stop_dac(struct trident_state *state)
 {
 	struct dmabuf *dmabuf = &state->dmabuf;
 	unsigned int chan_num = dmabuf->channel->num;
@@ -1164,15 +1209,20 @@
 	dmabuf->enable &= ~DAC_RUNNING;
 	trident_stop_voice(card, chan_num);
 	if (state->chans_num == 6) {
-		trident_stop_voice(card, state->other_states[0]->dmabuf.channel->num);
-		trident_stop_voice(card, state->other_states[1]->dmabuf.channel->num);
-		trident_stop_voice(card, state->other_states[2]->dmabuf.channel->num);
-		trident_stop_voice(card, state->other_states[3]->dmabuf.channel->num);
+		trident_stop_voice(card, state->other_states[0]->
+				   dmabuf.channel->num);
+		trident_stop_voice(card, state->other_states[1]->
+				   dmabuf.channel->num);
+		trident_stop_voice(card, state->other_states[2]->
+				   dmabuf.channel->num);
+		trident_stop_voice(card, state->other_states[3]->
+				   dmabuf.channel->num);
 	}
 	trident_disable_voice_irq(card, chan_num);
 }
 
-static void stop_dac(struct trident_state *state)
+static void
+stop_dac(struct trident_state *state)
 {
 	struct trident_card *card = state->card;
 	unsigned long flags;
@@ -1180,9 +1230,10 @@
 	spin_lock_irqsave(&card->lock, flags);
 	__stop_dac(state);
 	spin_unlock_irqrestore(&card->lock, flags);
-}	
+}
 
-static void start_dac(struct trident_state *state)
+static void
+start_dac(struct trident_state *state)
 {
 	struct dmabuf *dmabuf = &state->dmabuf;
 	unsigned int chan_num = dmabuf->channel->num;
@@ -1195,10 +1246,14 @@
 		trident_enable_voice_irq(card, chan_num);
 		trident_start_voice(card, chan_num);
 		if (state->chans_num == 6) {
-			trident_start_voice(card, state->other_states[0]->dmabuf.channel->num);
-			trident_start_voice(card, state->other_states[1]->dmabuf.channel->num);
-			trident_start_voice(card, state->other_states[2]->dmabuf.channel->num);
-			trident_start_voice(card, state->other_states[3]->dmabuf.channel->num);
+			trident_start_voice(card, state->other_states[0]->
+					    dmabuf.channel->num);
+			trident_start_voice(card, state->other_states[1]->
+					    dmabuf.channel->num);
+			trident_start_voice(card, state->other_states[2]->
+					    dmabuf.channel->num);
+			trident_start_voice(card, state->other_states[3]->
+					    dmabuf.channel->num);
 		}
 	}
 	spin_unlock_irqrestore(&card->lock, flags);
@@ -1207,24 +1262,26 @@
 #define DMABUF_DEFAULTORDER (15-PAGE_SHIFT)
 #define DMABUF_MINORDER 1
 
-/* alloc a DMA buffer of with a buffer of this order */ 
-static int alloc_dmabuf(struct dmabuf* dmabuf, struct pci_dev* pci_dev, int order)
+/* alloc a DMA buffer of with a buffer of this order */
+static int
+alloc_dmabuf(struct dmabuf *dmabuf, struct pci_dev *pci_dev, int order)
 {
 	void *rawbuf = NULL;
 	struct page *page, *pend;
 
-	if (!(rawbuf = pci_alloc_consistent(pci_dev, PAGE_SIZE << order,
+	if (!(rawbuf = pci_alloc_consistent(pci_dev, PAGE_SIZE << order, 
 					    &dmabuf->dma_handle)))
 		return -ENOMEM;
 
-	TRDBG("trident: allocated %ld (order = %d) bytes at %p\n",
-	      PAGE_SIZE << order, order, rawbuf);
+	pr_debug("trident: allocated %ld (order = %d) bytes at %p\n",
+		 PAGE_SIZE << order, order, rawbuf);
 
-	dmabuf->ready  = dmabuf->mapped = 0;
+	dmabuf->ready = dmabuf->mapped = 0;
 	dmabuf->rawbuf = rawbuf;
 	dmabuf->buforder = order;
-	
-	/* now mark the pages as reserved; otherwise remap_page_range doesn't do what we want */
+
+	/* now mark the pages as reserved; otherwise */ 
+	/* remap_page_range doesn't do what we want */
 	pend = virt_to_page(rawbuf + (PAGE_SIZE << order) - 1);
 	for (page = virt_to_page(rawbuf); page <= pend; page++)
 		SetPageReserved(page);
@@ -1232,41 +1289,44 @@
 	return 0;
 }
 
-/* allocate the main DMA buffer, playback and recording buffer should be */ 
+/* allocate the main DMA buffer, playback and recording buffer should be */
 /* allocated separately */
-static int alloc_main_dmabuf(struct trident_state *state)
+static int
+alloc_main_dmabuf(struct trident_state *state)
 {
 	struct dmabuf *dmabuf = &state->dmabuf;
 	int order;
-	int ret = -ENOMEM; 
+	int ret = -ENOMEM;
 
 	/* alloc as big a chunk as we can, FIXME: is this necessary ?? */
 	for (order = DMABUF_DEFAULTORDER; order >= DMABUF_MINORDER; order--) {
 		if (!(ret = alloc_dmabuf(dmabuf, state->card->pci_dev, order)))
-			return 0; 
-		/* else try again */ 
+			return 0;
+		/* else try again */
 	}
-	return ret; 
+	return ret;
 }
 
-/* deallocate a DMA buffer */ 
-static void dealloc_dmabuf(struct dmabuf* dmabuf, struct pci_dev* pci_dev)
+/* deallocate a DMA buffer */
+static void
+dealloc_dmabuf(struct dmabuf *dmabuf, struct pci_dev *pci_dev)
 {
 	struct page *page, *pend;
-	
+
 	if (dmabuf->rawbuf) {
 		/* undo marking the pages as reserved */
 		pend = virt_to_page(dmabuf->rawbuf + (PAGE_SIZE << dmabuf->buforder) - 1);
 		for (page = virt_to_page(dmabuf->rawbuf); page <= pend; page++)
 			ClearPageReserved(page);
-		pci_free_consistent(pci_dev, PAGE_SIZE << dmabuf->buforder,
+		pci_free_consistent(pci_dev, PAGE_SIZE << dmabuf->buforder, 
 				    dmabuf->rawbuf, dmabuf->dma_handle);
 		dmabuf->rawbuf = NULL;
 	}
 	dmabuf->mapped = dmabuf->ready = 0;
 }
 
-static int prog_dmabuf(struct trident_state *state, unsigned rec)
+static int
+prog_dmabuf(struct trident_state *state, enum dmabuf_mode rec)
 {
 	struct dmabuf *dmabuf = &state->dmabuf;
 	unsigned bytepersec;
@@ -1274,13 +1334,15 @@
 	unsigned bufsize, dma_nums;
 	unsigned long flags;
 	int ret, i, order;
-	
-	lock_set_fmt(state);
+
+	if ((ret = lock_set_fmt(state)) < 0)
+		return ret;
+
 	if (state->chans_num == 6)
 		dma_nums = 5;
-	else 	
+	else
 		dma_nums = 1;
-	
+
 	for (i = 0; i < dma_nums; i++) {
 		if (i > 0) {
 			s = state->other_states[i - 1];
@@ -1302,19 +1364,22 @@
 					return ret;
 				}
 			} else {
-				ret = -ENOMEM; 
-				if ((order = state->dmabuf.buforder - 1) >= DMABUF_MINORDER) {
-					ret = alloc_dmabuf(dmabuf, state->card->pci_dev, order); 
+				ret = -ENOMEM;
+				order = state->dmabuf.buforder - 1;
+				if (order >= DMABUF_MINORDER) {
+					ret = alloc_dmabuf(dmabuf,
+							   state->card->pci_dev,
+							   order);
 				}
 				if (ret) {
-					/* release the main DMA buffer */ 
-					dealloc_dmabuf(&state->dmabuf, state->card->pci_dev); 
-					/* release the auxiliary DMA buffers */ 
-					for (i-=2; i >= 0; i--)
+					/* release the main DMA buffer */
+					dealloc_dmabuf(&state->dmabuf, state->card->pci_dev);
+					/* release the auxiliary DMA buffers */
+					for (i -= 2; i >= 0; i--)
 						dealloc_dmabuf(&state->other_states[i]->dmabuf, 
-							       state->card->pci_dev); 
+							       state->card->pci_dev);
 					unlock_set_fmt(state);
-					return ret; 
+					return ret;
 				}
 			}
 		}
@@ -1323,12 +1388,12 @@
 		bufsize = PAGE_SIZE << dmabuf->buforder;
 		if (dmabuf->ossfragshift) {
 			if ((1000 << dmabuf->ossfragshift) < bytepersec)
-				dmabuf->fragshift = ld2(bytepersec/1000);
+				dmabuf->fragshift = ld2(bytepersec / 1000);
 			else
 				dmabuf->fragshift = dmabuf->ossfragshift;
 		} else {
 			/* lets hand out reasonable big ass buffers by default */
-			dmabuf->fragshift = (dmabuf->buforder + PAGE_SHIFT -2);
+			dmabuf->fragshift = (dmabuf->buforder + PAGE_SHIFT - 2);
 		}
 		dmabuf->numfrag = bufsize >> dmabuf->fragshift;
 		while (dmabuf->numfrag < 4 && dmabuf->fragshift > 3) {
@@ -1341,29 +1406,41 @@
 		dmabuf->fragsamples = dmabuf->fragsize >> sample_shift[dmabuf->fmt];
 		dmabuf->dmasize = dmabuf->numfrag << dmabuf->fragshift;
 
-		memset(dmabuf->rawbuf, (dmabuf->fmt & TRIDENT_FMT_16BIT) ? 0 : 0x80,
+		memset(dmabuf->rawbuf, (dmabuf->fmt & TRIDENT_FMT_16BIT) ? 0 : 0x80, 
 		       dmabuf->dmasize);
 
 		spin_lock_irqsave(&s->card->lock, flags);
-		if (rec) 
+		if (rec == DM_RECORD)
 			trident_rec_setup(s);
-		else 
+		else /* DM_PLAYBACK */
 			trident_play_setup(s);
-		
+
 		spin_unlock_irqrestore(&s->card->lock, flags);
 
 		/* set the ready flag for the dma buffer */
 		dmabuf->ready = 1;
 
-		TRDBG("trident: prog_dmabuf(%d), sample rate = %d, format = %d, numfrag = %d, "
-		      "fragsize = %d dmasize = %d\n",
-		      dmabuf->channel->num, dmabuf->rate, dmabuf->fmt, dmabuf->numfrag,
-		      dmabuf->fragsize, dmabuf->dmasize);
+		pr_debug("trident: prog_dmabuf(%d), sample rate = %d, "
+			 "format = %d, numfrag = %d, fragsize = %d "
+			 "dmasize = %d\n", dmabuf->channel->num,
+			 dmabuf->rate, dmabuf->fmt, dmabuf->numfrag,
+			 dmabuf->fragsize, dmabuf->dmasize);
 	}
 	unlock_set_fmt(state);
 	return 0;
 }
 
+
+static inline int prog_dmabuf_record(struct trident_state* state)
+{
+	return prog_dmabuf(state, DM_RECORD);
+}
+
+static inline int prog_dmabuf_playback(struct trident_state* state)
+{
+	return prog_dmabuf(state, DM_PLAYBACK);
+}
+
 /* we are doing quantum mechanics here, the buffer can only be empty, half or full filled i.e.
    |------------|------------|   or   |xxxxxxxxxxxx|------------|   or   |xxxxxxxxxxxx|xxxxxxxxxxxx|
    but we almost always get this
@@ -1371,7 +1448,8 @@
    so we have to clear the tail space to "silence"
    |xxxxxx000000|------------|   or   |xxxxxxxxxxxx|xxxxxx000000|
 */
-static void trident_clear_tail(struct trident_state *state)
+static void
+trident_clear_tail(struct trident_state *state)
 {
 	struct dmabuf *dmabuf = &state->dmabuf;
 	unsigned swptr;
@@ -1383,17 +1461,17 @@
 	swptr = dmabuf->swptr;
 	spin_unlock_irqrestore(&state->card->lock, flags);
 
-	if (swptr == 0 || swptr == dmabuf->dmasize / 2 || swptr == dmabuf->dmasize)
+	if (swptr == 0 || swptr == dmabuf->dmasize / 2 || 
+	    swptr == dmabuf->dmasize)
 		return;
 
-	if (swptr < dmabuf->dmasize/2)
-		len = dmabuf->dmasize/2 - swptr;
+	if (swptr < dmabuf->dmasize / 2)
+		len = dmabuf->dmasize / 2 - swptr;
 	else
 		len = dmabuf->dmasize - swptr;
 
 	memset(dmabuf->rawbuf + swptr, silence, len);
-	if(state->card->pci_id != PCI_DEVICE_ID_ALI_5451)
-	{
+	if (state->card->pci_id != PCI_DEVICE_ID_ALI_5451) {
 		spin_lock_irqsave(&state->card->lock, flags);
 		dmabuf->swptr += len;
 		dmabuf->count += len;
@@ -1404,7 +1482,8 @@
 	start_dac(state);
 }
 
-static int drain_dac(struct trident_state *state, int nonblock)
+static int
+drain_dac(struct trident_state *state, int nonblock)
 {
 	DECLARE_WAITQUEUE(wait, current);
 	struct dmabuf *dmabuf = &state->dmabuf;
@@ -1440,19 +1519,16 @@
 
 		/* No matter how much data is left in the buffer, we have to wait until
 		   CSO == ESO/2 or CSO == ESO when address engine interrupts */
-	 	if (state->card->pci_id == PCI_DEVICE_ID_ALI_5451 ||
-		    state->card->pci_id == PCI_DEVICE_ID_INTERG_5050)
-		{	
-			diff = dmabuf->swptr - trident_get_dma_addr(state) + dmabuf->dmasize ;
+		if (state->card->pci_id == PCI_DEVICE_ID_ALI_5451 || 
+		    state->card->pci_id == PCI_DEVICE_ID_INTERG_5050) {
+			diff = dmabuf->swptr - trident_get_dma_addr(state) + dmabuf->dmasize;
 			diff = diff % (dmabuf->dmasize);
-			tmo  = (diff * HZ) / dmabuf->rate;
-		}
-		else
-		{
+			tmo = (diff * HZ) / dmabuf->rate;
+		} else {
 			tmo = (dmabuf->dmasize * HZ) / dmabuf->rate;
 		}
 		tmo >>= sample_shift[dmabuf->fmt];
-		if (!schedule_timeout(tmo ? tmo : 1) && tmo){
+		if (!schedule_timeout(tmo ? tmo : 1) && tmo) {
 			break;
 		}
 	}
@@ -1464,8 +1540,10 @@
 	return 0;
 }
 
-/* update buffer manangement pointers, especially, dmabuf->count and dmabuf->hwptr */
-static void trident_update_ptr(struct trident_state *state)
+/* update buffer manangement pointers, especially, */ 
+/* dmabuf->count and dmabuf->hwptr */
+static void
+trident_update_ptr(struct trident_state *state)
 {
 	struct dmabuf *dmabuf = &state->dmabuf;
 	unsigned hwptr, swptr;
@@ -1484,19 +1562,21 @@
 	if (dmabuf->enable == ADC_RUNNING) {
 		if (dmabuf->mapped) {
 			dmabuf->count -= diff;
-			if (dmabuf->count >= (signed)dmabuf->fragsize)
+			if (dmabuf->count >= (signed) dmabuf->fragsize)
 				wake_up(&dmabuf->wait);
 		} else {
 			dmabuf->count += diff;
 
-			if (dmabuf->count < 0 || dmabuf->count > dmabuf->dmasize) {
-				/* buffer underrun or buffer overrun, we have no way to recover
-				   it here, just stop the machine and let the process force hwptr
-				   and swptr to sync */
+			if (dmabuf->count < 0 || 
+			    dmabuf->count > dmabuf->dmasize) {
+				/* buffer underrun or buffer overrun, */ 
+				/* we have no way to recover it here, just */ 
+				/* stop the machine and let the process */ 
+				/* force hwptr and swptr to sync */
 				__stop_adc(state);
 				dmabuf->error++;
 			}
-			if (dmabuf->count < (signed)dmabuf->dmasize/2)
+			if (dmabuf->count < (signed) dmabuf->dmasize / 2)
 				wake_up(&dmabuf->wait);
 		}
 	}
@@ -1505,19 +1585,19 @@
 	if (dmabuf->enable == DAC_RUNNING) {
 		if (dmabuf->mapped) {
 			dmabuf->count += diff;
-			if (dmabuf->count >= (signed)dmabuf->fragsize)
+			if (dmabuf->count >= (signed) dmabuf->fragsize)
 				wake_up(&dmabuf->wait);
 		} else {
 			dmabuf->count -= diff;
 
-			if (dmabuf->count < 0 || dmabuf->count > dmabuf->dmasize) {
+			if (dmabuf->count < 0 || 
+			    dmabuf->count > dmabuf->dmasize) {
 				/* buffer underrun or buffer overrun, we have no way to recover
 				   it here, just stop the machine and let the process force hwptr
 				   and swptr to sync */
 				__stop_dac(state);
 				dmabuf->error++;
-			}
-			else if (!dmabuf->endcleared) {
+			} else if (!dmabuf->endcleared) {
 				swptr = dmabuf->swptr;
 				silence = (dmabuf->fmt & TRIDENT_FMT_16BIT ? 0 : 0x80);
 				if (dmabuf->update_flag & ALI_ADDRESS_INT_UPDATE) {
@@ -1525,26 +1605,25 @@
 					   According to 1/2 algorithm of Address Engine Interrupt,
 					   check the validation of the data of half dmasize. */
 					half_dmasize = dmabuf->dmasize / 2;
-					if ((diff = hwptr - half_dmasize) < 0 )
+					if ((diff = hwptr - half_dmasize) < 0)
 						diff = hwptr;
 					if ((dmabuf->count + diff) < half_dmasize) {
 						//there is invalid data in the end of half buffer
 						if ((clear_cnt = half_dmasize - swptr) < 0)
 							clear_cnt += half_dmasize;
 						//clear the invalid data
-						memset (dmabuf->rawbuf + swptr,
-							silence, clear_cnt);
+						memset(dmabuf->rawbuf + swptr, silence, clear_cnt);
 						if (state->chans_num == 6) {
-						clear_cnt = clear_cnt / 2;
-						swptr = swptr / 2;
-							memset (state->other_states[0]->dmabuf.rawbuf + swptr,
-								silence, clear_cnt);
-							memset (state->other_states[1]->dmabuf.rawbuf + swptr,
-								silence, clear_cnt);
-							memset (state->other_states[2]->dmabuf.rawbuf + swptr,
-								silence, clear_cnt);
-							memset (state->other_states[3]->dmabuf.rawbuf + swptr,
-								silence, clear_cnt);
+							clear_cnt = clear_cnt / 2;
+							swptr = swptr / 2;
+							memset(state->other_states[0]->dmabuf.rawbuf + swptr, 
+							       silence, clear_cnt);
+							memset(state->other_states[1]->dmabuf.rawbuf + swptr, 
+							       silence, clear_cnt);
+							memset(state->other_states[2]->dmabuf.rawbuf + swptr, 
+							       silence, clear_cnt);
+							memset(state->other_states[3]->dmabuf.rawbuf + swptr, 
+							       silence, clear_cnt);
 						}
 						dmabuf->endcleared = 1;
 					}
@@ -1552,18 +1631,18 @@
 					clear_cnt = dmabuf->fragsize;
 					if ((swptr + clear_cnt) > dmabuf->dmasize)
 						clear_cnt = dmabuf->dmasize - swptr;
-					memset (dmabuf->rawbuf + swptr, silence, clear_cnt);
+					memset(dmabuf->rawbuf + swptr, silence, clear_cnt);
 					if (state->chans_num == 6) {
 						clear_cnt = clear_cnt / 2;
 						swptr = swptr / 2;
-						memset (state->other_states[0]->dmabuf.rawbuf + swptr,
-							silence, clear_cnt);
-						memset (state->other_states[1]->dmabuf.rawbuf + swptr,
-							silence, clear_cnt);
-						memset (state->other_states[2]->dmabuf.rawbuf + swptr,
-							silence, clear_cnt);
-						memset (state->other_states[3]->dmabuf.rawbuf + swptr,
-							silence, clear_cnt);
+						memset(state->other_states[0]->dmabuf.rawbuf + swptr, 
+						       silence, clear_cnt);
+						memset(state->other_states[1]->dmabuf.rawbuf + swptr, 
+						       silence, clear_cnt);
+						memset(state->other_states[2]->dmabuf.rawbuf + swptr, 
+						       silence, clear_cnt);
+						memset(state->other_states[3]->dmabuf.rawbuf + swptr, 
+						       silence, clear_cnt);
 					}
 					dmabuf->endcleared = 1;
 				}
@@ -1571,29 +1650,30 @@
 			/* trident_update_ptr is called by interrupt handler or by process via
 			   ioctl/poll, we only wake up the waiting process when we have more
 			   than 1/2 buffer free (always true for interrupt handler) */
-			if (dmabuf->count < (signed)dmabuf->dmasize/2)
+			if (dmabuf->count < (signed) dmabuf->dmasize / 2)
 				wake_up(&dmabuf->wait);
 		}
 	}
 	dmabuf->update_flag &= ~ALI_ADDRESS_INT_UPDATE;
 }
 
-static void trident_address_interrupt(struct trident_card *card)
+static void
+trident_address_interrupt(struct trident_card *card)
 {
 	int i;
 	struct trident_state *state;
-	unsigned int channel; 
-	
+	unsigned int channel;
+
 	/* Update the pointers for all channels we are running. */
 	/* FIXME: should read interrupt status only once */
 	for (i = 0; i < NR_HW_CH; i++) {
-		channel = 63 - i; 
+		channel = 63 - i;
 		if (trident_check_channel_interrupt(card, channel)) {
 			trident_ack_channel_interrupt(card, channel);
 			if ((state = card->states[i]) != NULL) {
 				trident_update_ptr(state);
 			} else {
-				printk(KERN_WARNING "trident: spurious channel "
+				printk(KERN_WARNING "trident: spurious channel " 
 				       "irq %d.\n", channel);
 				trident_stop_voice(card, channel);
 				trident_disable_voice_irq(card, channel);
@@ -1602,7 +1682,8 @@
 	}
 }
 
-static void ali_hwvol_control(struct trident_card *card, int opt)
+static void
+ali_hwvol_control(struct trident_card *card, int opt)
 {
 	u16 dwTemp, volume[2], mute, diff, *pVol[2];
 
@@ -1610,7 +1691,7 @@
 	mute = dwTemp & 0x8000;
 	volume[0] = dwTemp & 0x001f;
 	volume[1] = (dwTemp & 0x1f00) >> 8;
-	if (volume[0] < volume [1]) {
+	if (volume[0] < volume[1]) {
 		pVol[0] = &volume[0];
 		pVol[1] = &volume[1];
 	} else {
@@ -1619,10 +1700,11 @@
 	}
 	diff = *(pVol[1]) - *(pVol[0]);
 
-	if (opt == 1) {                     // MUTE
+	if (opt == 1) {		// MUTE
 		dwTemp ^= 0x8000;
-		ali_ac97_write(card->ac97_codec[0], 0x02, dwTemp);
-	} else if (opt == 2) {   // Down
+		ali_ac97_write(card->ac97_codec[0], 
+			       0x02, dwTemp);
+	} else if (opt == 2) {	// Down
 		if (mute)
 			return;
 		if (*(pVol[1]) < 0x001f) {
@@ -1632,21 +1714,21 @@
 		dwTemp &= 0xe0e0;
 		dwTemp |= (volume[0]) | (volume[1] << 8);
 		ali_ac97_write(card->ac97_codec[0], 0x02, dwTemp);
-		card->ac97_codec[0]->mixer_state[0] = ((32-volume[0])*25/8) | (((32-volume[1])*25/8) << 8);
-	} else if (opt == 4) {   // Up
+		card->ac97_codec[0]->mixer_state[0] = ((32 - volume[0]) * 25 / 8) | 
+			(((32 - volume[1]) * 25 / 8) << 8);
+	} else if (opt == 4) {	// Up
 		if (mute)
 			return;
-		if (*(pVol[0]) >0) {
+		if (*(pVol[0]) > 0) {
 			(*pVol[0])--;
 			*(pVol[1]) = *(pVol[0]) + diff;
 		}
 		dwTemp &= 0xe0e0;
 		dwTemp |= (volume[0]) | (volume[1] << 8);
 		ali_ac97_write(card->ac97_codec[0], 0x02, dwTemp);
-		card->ac97_codec[0]->mixer_state[0] = ((32-volume[0])*25/8) | (((32-volume[1])*25/8) << 8);
-	} 
-	else 
-	{
+		card->ac97_codec[0]->mixer_state[0] = ((32 - volume[0]) * 25 / 8) | 
+			(((32 - volume[1]) * 25 / 8) << 8);
+	} else {
 		/* Nothing needs doing */
 	}
 }
@@ -1655,12 +1737,13 @@
  *	Re-enable reporting of vol change after 0.1 seconds
  */
 
-static void ali_timeout(unsigned long ptr)
+static void
+ali_timeout(unsigned long ptr)
 {
-	struct trident_card *card = (struct trident_card *)ptr;
+	struct trident_card *card = (struct trident_card *) ptr;
 	u16 temp = 0;
 
-	/* Enable GPIO IRQ (MISCINT bit 18h)*/
+	/* Enable GPIO IRQ (MISCINT bit 18h) */
 	temp = inw(TRID_REG(card, T4D_MISCINT + 2));
 	temp |= 0x0004;
 	outw(temp, TRID_REG(card, T4D_MISCINT + 2));
@@ -1669,62 +1752,65 @@
 /*
  *	Set up the timer to clear the vol change notification
  */
- 
-static void ali_set_timer(struct trident_card *card)
+
+static void
+ali_set_timer(struct trident_card *card)
 {
 	/* Add Timer Routine to Enable GPIO IRQ */
 	del_timer(&card->timer);	/* Never queue twice */
 	card->timer.function = ali_timeout;
 	card->timer.data = (unsigned long) card;
-	card->timer.expires = jiffies + HZ/10;
+	card->timer.expires = jiffies + HZ / 10;
 	add_timer(&card->timer);
 }
 
 /*
  *	Process a GPIO event
  */
- 
-static void ali_queue_task(struct trident_card *card, int opt)
+
+static void
+ali_queue_task(struct trident_card *card, int opt)
 {
 	u16 temp;
 
-	/* Disable GPIO IRQ (MISCINT bit 18h)*/
+	/* Disable GPIO IRQ (MISCINT bit 18h) */
 	temp = inw(TRID_REG(card, T4D_MISCINT + 2));
-	temp &= (u16)(~0x0004);
+	temp &= (u16) (~0x0004);
 	outw(temp, TRID_REG(card, T4D_MISCINT + 2));
 
 	/* Adjust the volume */
 	ali_hwvol_control(card, opt);
-	
+
 	/* Set the timer for 1/10th sec */
 	ali_set_timer(card);
 }
 
-static void cyber_address_interrupt(struct trident_card *card)
+static void
+cyber_address_interrupt(struct trident_card *card)
 {
-	int i,irq_status;
+	int i, irq_status;
 	struct trident_state *state;
-	unsigned int channel; 
+	unsigned int channel;
 
 	/* Update the pointers for all channels we are running. */
 	/* FIXED: read interrupt status only once */
-	irq_status=inl(TRID_REG(card, T4D_AINT_A) );
+	irq_status = inl(TRID_REG(card, T4D_AINT_A));
 
-	TRDBG("cyber_address_interrupt: irq_status 0x%X\n",irq_status);
+	pr_debug("cyber_address_interrupt: irq_status 0x%X\n", irq_status);
 
 	for (i = 0; i < NR_HW_CH; i++) {
-		channel = 31 - i; 
-		if (irq_status & ( 1 << channel) ) {
-			/* clear bit by writing a 1, zeroes are ignored */ 		
-			outl( (1 << channel), TRID_REG(card, T4D_AINT_A));
-		
-			TRDBG("cyber_interrupt: channel %d\n", channel);
+		channel = 31 - i;
+		if (irq_status & (1 << channel)) {
+			/* clear bit by writing a 1, zeroes are ignored */
+			outl((1 << channel), TRID_REG(card, T4D_AINT_A));
+
+			pr_debug("cyber_interrupt: channel %d\n", channel);
 
 			if ((state = card->states[i]) != NULL) {
 				trident_update_ptr(state);
 			} else {
-				printk(KERN_WARNING "cyber5050: spurious "
-				       "channel irq %d.\n", channel); 
+				printk(KERN_WARNING "cyber5050: spurious " 
+				       "channel irq %d.\n", channel);
 				trident_stop_voice(card, channel);
 				trident_disable_voice_irq(card, channel);
 			}
@@ -1732,46 +1818,50 @@
 	}
 }
 
-static irqreturn_t trident_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t
+trident_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	struct trident_card *card = (struct trident_card *)dev_id;
+	struct trident_card *card = (struct trident_card *) dev_id;
 	u32 event;
 	u32 gpio;
 
 	spin_lock(&card->lock);
 	event = inl(TRID_REG(card, T4D_MISCINT));
 
-	TRDBG("trident: trident_interrupt called, MISCINT = 0x%08x\n", event);
+	pr_debug("trident: trident_interrupt called, MISCINT = 0x%08x\n",
+		 event);
 
 	if (event & ADDRESS_IRQ) {
 		card->address_interrupt(card);
 	}
 
-	if(card->pci_id == PCI_DEVICE_ID_ALI_5451)
-	{
+	if (card->pci_id == PCI_DEVICE_ID_ALI_5451) {
 		/* GPIO IRQ (H/W Volume Control) */
 		event = inl(TRID_REG(card, T4D_MISCINT));
-		if (event & (1<<25)) {
+		if (event & (1 << 25)) {
 			gpio = inl(TRID_REG(card, ALI_GPIO));
-			if (!timer_pending(&card->timer)) 
-				ali_queue_task(card, gpio&0x07);
+			if (!timer_pending(&card->timer))
+				ali_queue_task(card, gpio & 0x07);
 		}
 		event = inl(TRID_REG(card, T4D_MISCINT));
-		outl(event | (ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), TRID_REG(card, T4D_MISCINT));
+		outl(event | (ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), 
+		     TRID_REG(card, T4D_MISCINT));
 		spin_unlock(&card->lock);
 		return IRQ_HANDLED;
 	}
 
 	/* manually clear interrupt status, bad hardware design, blame T^2 */
-	outl((ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW),
+	outl((ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), 
 	     TRID_REG(card, T4D_MISCINT));
 	spin_unlock(&card->lock);
 	return IRQ_HANDLED;
 }
 
-/* in this loop, dmabuf.count signifies the amount of data that is waiting to be copied to
-   the user's buffer.  it is filled by the dma machine and drained by this loop. */
-static ssize_t trident_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+/* in this loop, dmabuf.count signifies the amount of data that is waiting */ 
+/* to be copied to the user's buffer.  it is filled by the dma machine and */ 
+/* drained by this loop. */
+static ssize_t
+trident_read(struct file *file, char *buffer, size_t count, loff_t * ppos)
 {
 	struct trident_state *state = (struct trident_state *)file->private_data;
 	struct dmabuf *dmabuf = &state->dmabuf;
@@ -1780,26 +1870,27 @@
 	unsigned swptr;
 	int cnt;
 
-	TRDBG("trident: trident_read called, count = %d\n", count);
+	pr_debug("trident: trident_read called, count = %d\n", count);
 
 	VALIDATE_STATE(state);
 	if (ppos != &file->f_pos)
 		return -ESPIPE;
-		
+
 	if (dmabuf->mapped)
 		return -ENXIO;
 	if (!access_ok(VERIFY_WRITE, buffer, count))
 		return -EFAULT;
-		
+
 	down(&state->sem);
-	if (!dmabuf->ready && (ret = prog_dmabuf(state, 1)))
+	if (!dmabuf->ready && (ret = prog_dmabuf_record(state)))
 		goto out;
 
 	while (count > 0) {
 		spin_lock_irqsave(&state->card->lock, flags);
 		if (dmabuf->count > (signed) dmabuf->dmasize) {
-			/* buffer overrun, we are recovering from sleep_on_timeout,
-			   resync hwptr and swptr, make process flush the buffer */
+			/* buffer overrun, we are recovering from */ 
+			/* sleep_on_timeout, resync hwptr and swptr, */ 
+			/* make process flush the buffer */
 			dmabuf->count = dmabuf->dmasize;
 			dmabuf->swptr = dmabuf->hwptr;
 		}
@@ -1813,17 +1904,19 @@
 			cnt = count;
 		if (cnt <= 0) {
 			unsigned long tmo;
-			/* buffer is empty, start the dma machine and wait for data to be
-			   recorded */
+			/* buffer is empty, start the dma machine and */ 
+			/* wait for data to be recorded */
 			start_adc(state);
 			if (file->f_flags & O_NONBLOCK) {
-				if (!ret) ret = -EAGAIN;
+				if (!ret)
+					ret = -EAGAIN;
 				goto out;
 			}
-			
+
 			up(&state->sem);
-			/* No matter how much space left in the buffer, we have to wait until
-			   CSO == ESO/2 or CSO == ESO when address engine interrupts */
+			/* No matter how much space left in the buffer, */ 
+			/* we have to wait until CSO == ESO/2 or CSO == ESO */ 
+			/* when address engine interrupts */
 			tmo = (dmabuf->dmasize * HZ) / (dmabuf->rate * 2);
 			tmo >>= sample_shift[dmabuf->fmt];
 			/* There are two situations when sleep_on_timeout returns, one is when
@@ -1834,22 +1927,22 @@
 			   which results in a (potential) buffer overrun. And worse, there is
 			   NOTHING we can do to prevent it. */
 			if (!interruptible_sleep_on_timeout(&dmabuf->wait, tmo)) {
-				TRDBG(KERN_ERR "trident: recording schedule timeout, "
-				      "dmasz %u fragsz %u count %i hwptr %u swptr %u\n",
-				      dmabuf->dmasize, dmabuf->fragsize, dmabuf->count,
-				      dmabuf->hwptr, dmabuf->swptr);
+				pr_debug(KERN_ERR "trident: recording schedule timeout, "
+					 "dmasz %u fragsz %u count %i hwptr %u swptr %u\n",
+					 dmabuf->dmasize, dmabuf->fragsize, dmabuf->count,
+					 dmabuf->hwptr, dmabuf->swptr);
 
 				/* a buffer overrun, we delay the recovery until next time the
 				   while loop begin and we REALLY have space to record */
 			}
 			if (signal_pending(current)) {
-				if(!ret) ret = -ERESTARTSYS;
+				if (!ret)
+					ret = -ERESTARTSYS;
 				goto out;
 			}
 			down(&state->sem);
-			if(dmabuf->mapped)
-			{
-				if(!ret)
+			if (dmabuf->mapped) {
+				if (!ret)
 					ret = -ENXIO;
 				goto out;
 			}
@@ -1857,7 +1950,8 @@
 		}
 
 		if (copy_to_user(buffer, dmabuf->rawbuf + swptr, cnt)) {
-			if (!ret) ret = -EFAULT;
+			if (!ret)
+				ret = -EFAULT;
 			goto out;
 		}
 
@@ -1881,7 +1975,8 @@
 /* in this loop, dmabuf.count signifies the amount of data that is waiting to be dma to
    the soundcard.  it is drained by the dma machine and filled by this loop. */
 
-static ssize_t trident_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t
+trident_write(struct file *file, const char *buffer, size_t count, loff_t * ppos)
 {
 	struct trident_state *state = (struct trident_state *)file->private_data;
 	struct dmabuf *dmabuf = &state->dmabuf;
@@ -1891,40 +1986,39 @@
 	int cnt;
 	unsigned int state_cnt;
 	unsigned int copy_count;
+	int lret; /* for lock_set_fmt */
 
-	TRDBG("trident: trident_write called, count = %d\n", count);
+	pr_debug("trident: trident_write called, count = %d\n", count);
 
 	VALIDATE_STATE(state);
 	if (ppos != &file->f_pos)
 		return -ESPIPE;
-	
+
 	/*
-	 *	Guard against an mmap or ioctl while writing
-	 */	
-	 
+	 *      Guard against an mmap or ioctl while writing
+	 */
+
 	down(&state->sem);
-	
-	if (dmabuf->mapped)
-	{
+
+	if (dmabuf->mapped) {
 		ret = -ENXIO;
 		goto out;
 	}
-	if (!dmabuf->ready && (ret = prog_dmabuf(state, 0)))
+	if (!dmabuf->ready && (ret = prog_dmabuf_playback(state)))
 		goto out;
 
-	if (!access_ok(VERIFY_READ, buffer, count))
-	{
-		ret= -EFAULT;
+	if (!access_ok(VERIFY_READ, buffer, count)) {
+		ret = -EFAULT;
 		goto out;
 	}
-	
+
 	ret = 0;
 
 	while (count > 0) {
 		spin_lock_irqsave(&state->card->lock, flags);
 		if (dmabuf->count < 0) {
-			/* buffer underrun, we are recovering from sleep_on_timeout,
-			   resync hwptr and swptr */
+			/* buffer underrun, we are recovering from */ 
+			/* sleep_on_timeout, resync hwptr and swptr */
 			dmabuf->count = 0;
 			dmabuf->swptr = dmabuf->hwptr;
 		}
@@ -1938,56 +2032,68 @@
 			cnt = count;
 		if (cnt <= 0) {
 			unsigned long tmo;
-			/* buffer is full, start the dma machine and wait for data to be
-			   played */
+			/* buffer is full, start the dma machine and */ 
+			/* wait for data to be played */
 			start_dac(state);
 			if (file->f_flags & O_NONBLOCK) {
-				if (!ret) ret = -EAGAIN;
+				if (!ret)
+					ret = -EAGAIN;
 				goto out;
 			}
-			/* No matter how much data left in the buffer, we have to wait until
-			   CSO == ESO/2 or CSO == ESO when address engine interrupts */
+			/* No matter how much data left in the buffer, */ 
+			/* we have to wait until CSO == ESO/2 or CSO == ESO */ 
+			/* when address engine interrupts */
 			lock_set_fmt(state);
 			tmo = (dmabuf->dmasize * HZ) / (dmabuf->rate * 2);
 			tmo >>= sample_shift[dmabuf->fmt];
 			unlock_set_fmt(state);
 			up(&state->sem);
-			
-			/* There are two situations when sleep_on_timeout returns, one is when
-			   the interrupt is serviced correctly and the process is waked up by
-			   ISR ON TIME. Another is when timeout is expired, which means that
-			   either interrupt is NOT serviced correctly (pending interrupt) or it
-			   is TOO LATE for the process to be scheduled to run (scheduler latency)
-			   which results in a (potential) buffer underrun. And worse, there is
-			   NOTHING we can do to prevent it. */
-			if (!interruptible_sleep_on_timeout(&dmabuf->wait, tmo)) {
-				TRDBG(KERN_ERR "trident: playback schedule timeout, "
-				      "dmasz %u fragsz %u count %i hwptr %u swptr %u\n",
-				      dmabuf->dmasize, dmabuf->fragsize, dmabuf->count,
-				      dmabuf->hwptr, dmabuf->swptr);
 
-				/* a buffer underrun, we delay the recovery until next time the
-				   while loop begin and we REALLY have data to play */
+			/* There are two situations when sleep_on_timeout */ 
+			/* returns, one is when the interrupt is serviced */ 
+			/* correctly and the process is waked up by ISR */ 
+			/* ON TIME. Another is when timeout is expired, which */ 
+			/* means that either interrupt is NOT serviced */ 
+			/* correctly (pending interrupt) or it is TOO LATE */ 
+			/* for the process to be scheduled to run */ 
+			/* (scheduler latency) which results in a (potential) */ 
+			/* buffer underrun. And worse, there is NOTHING we */ 
+			/* can do to prevent it. */
+			if (!interruptible_sleep_on_timeout(&dmabuf->wait, tmo)) {
+				pr_debug(KERN_ERR "trident: playback schedule "
+					 "timeout, dmasz %u fragsz %u count %i "
+					 "hwptr %u swptr %u\n", dmabuf->dmasize,
+					 dmabuf->fragsize, dmabuf->count,
+					 dmabuf->hwptr, dmabuf->swptr);
+
+				/* a buffer underrun, we delay the recovery */ 
+				/* until next time the while loop begin and */ 
+				/* we REALLY have data to play */
 			}
 			if (signal_pending(current)) {
-				if (!ret) ret = -ERESTARTSYS;
-				goto out;
+				if (!ret)
+					ret = -ERESTARTSYS;
+				goto out_nolock;
 			}
 			down(&state->sem);
-			if(dmabuf->mapped)
-			{
-				if(!ret)
+			if (dmabuf->mapped) {
+				if (!ret)
 					ret = -ENXIO;
 				goto out;
 			}
 			continue;
 		}
-		lock_set_fmt(state);
+		if ((lret = lock_set_fmt(state)) < 0) {
+			ret = lret;
+			goto out;
+		}
+
 		if (state->chans_num == 6) {
 			copy_count = 0;
 			state_cnt = 0;
-			if (ali_write_5_1(state, buffer, cnt, &copy_count, &state_cnt) == -EFAULT) {
-				if (state_cnt){
+			if (ali_write_5_1(state, buffer, cnt, &copy_count, 
+					  &state_cnt) == -EFAULT) {
+				if (state_cnt) {
 					swptr = (swptr + state_cnt) % dmabuf->dmasize;
 					spin_lock_irqsave(&state->card->lock, flags);
 					dmabuf->swptr = swptr;
@@ -1996,23 +2102,25 @@
 					spin_unlock_irqrestore(&state->card->lock, flags);
 				}
 				ret += copy_count;
-				if (!ret) ret = -EFAULT;
+				if (!ret)
+					ret = -EFAULT;
 				unlock_set_fmt(state);
 				goto out;
 			}
-		}
-		else {
-			if (copy_from_user(dmabuf->rawbuf + swptr, buffer, cnt)) {
-				if (!ret) ret = -EFAULT;
+		} else {
+			if (copy_from_user(dmabuf->rawbuf + swptr, 
+					   buffer, cnt)) {
+				if (!ret)
+					ret = -EFAULT;
 				unlock_set_fmt(state);
 				goto out;
 			}
 			state_cnt = cnt;
 		}
 		unlock_set_fmt(state);
-		
-		swptr = (swptr + state_cnt) % dmabuf->dmasize;		
-		
+
+		swptr = (swptr + state_cnt) % dmabuf->dmasize;
+
 		spin_lock_irqsave(&state->card->lock, flags);
 		dmabuf->swptr = swptr;
 		dmabuf->count += state_cnt;
@@ -2020,18 +2128,19 @@
 		spin_unlock_irqrestore(&state->card->lock, flags);
 
 		count -= cnt;
-		buffer += cnt;	
+		buffer += cnt;
 		ret += cnt;
 		start_dac(state);
 	}
 out:
 	up(&state->sem);
+out_nolock:
 	return ret;
 }
 
-
 /* No kernel lock - we have our own spinlock */
-static unsigned int trident_poll(struct file *file, struct poll_table_struct *wait)
+static unsigned int
+trident_poll(struct file *file, struct poll_table_struct *wait)
 {
 	struct trident_state *state = (struct trident_state *)file->private_data;
 	struct dmabuf *dmabuf = &state->dmabuf;
@@ -2041,23 +2150,21 @@
 	VALIDATE_STATE(state);
 
 	/*
-	 *	Guard against a parallel poll and write causing multiple
-	 *	prog_dmabuf events
+	 *      Guard against a parallel poll and write causing multiple
+	 *      prog_dmabuf events
 	 */
-	 
+
 	down(&state->sem);
 
 	if (file->f_mode & FMODE_WRITE) {
-		if (!dmabuf->ready && prog_dmabuf(state, 0))
-		{
+		if (!dmabuf->ready && prog_dmabuf_playback(state)) {
 			up(&state->sem);
 			return 0;
 		}
 		poll_wait(file, &dmabuf->wait, wait);
 	}
 	if (file->f_mode & FMODE_READ) {
-		if (!dmabuf->ready && prog_dmabuf(state, 1))
-		{
+		if (!dmabuf->ready && prog_dmabuf_record(state)) {
 			up(&state->sem);
 			return 0;
 		}
@@ -2065,19 +2172,20 @@
 	}
 
 	up(&state->sem);
-	
+
 	spin_lock_irqsave(&state->card->lock, flags);
 	trident_update_ptr(state);
 	if (file->f_mode & FMODE_READ) {
-		if (dmabuf->count >= (signed)dmabuf->fragsize)
+		if (dmabuf->count >= (signed) dmabuf->fragsize)
 			mask |= POLLIN | POLLRDNORM;
 	}
 	if (file->f_mode & FMODE_WRITE) {
 		if (dmabuf->mapped) {
-			if (dmabuf->count >= (signed)dmabuf->fragsize)
+			if (dmabuf->count >= (signed) dmabuf->fragsize)
 				mask |= POLLOUT | POLLWRNORM;
 		} else {
-			if ((signed)dmabuf->dmasize >= dmabuf->count + (signed)dmabuf->fragsize)
+			if ((signed) dmabuf->dmasize >= dmabuf->count + 
+			    (signed) dmabuf->fragsize)
 				mask |= POLLOUT | POLLWRNORM;
 		}
 	}
@@ -2086,7 +2194,8 @@
 	return mask;
 }
 
-static int trident_mmap(struct file *file, struct vm_area_struct *vma)
+static int
+trident_mmap(struct file *file, struct vm_area_struct *vma)
 {
 	struct trident_state *state = (struct trident_state *)file->private_data;
 	struct dmabuf *dmabuf = &state->dmabuf;
@@ -2094,20 +2203,19 @@
 	unsigned long size;
 
 	VALIDATE_STATE(state);
-	lock_kernel();
-	
+
 	/*
-	 *	Lock against poll read write or mmap creating buffers. Also lock
-	 *	a read or write against an mmap.
+	 *      Lock against poll read write or mmap creating buffers. Also lock
+	 *      a read or write against an mmap.
 	 */
-	 
+
 	down(&state->sem);
-	
+
 	if (vma->vm_flags & VM_WRITE) {
-		if ((ret = prog_dmabuf(state, 0)) != 0)
+		if ((ret = prog_dmabuf_playback(state)) != 0)
 			goto out;
 	} else if (vma->vm_flags & VM_READ) {
-		if ((ret = prog_dmabuf(state, 1)) != 0)
+		if ((ret = prog_dmabuf_record(state)) != 0)
 			goto out;
 	} else
 		goto out;
@@ -2119,18 +2227,19 @@
 	if (size > (PAGE_SIZE << dmabuf->buforder))
 		goto out;
 	ret = -EAGAIN;
-	if (remap_page_range(vma, vma->vm_start, virt_to_phys(dmabuf->rawbuf),
+	if (remap_page_range(vma, vma->vm_start, virt_to_phys(dmabuf->rawbuf), 
 			     size, vma->vm_page_prot))
 		goto out;
 	dmabuf->mapped = 1;
 	ret = 0;
 out:
 	up(&state->sem);
-	unlock_kernel();
 	return ret;
 }
 
-static int trident_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+static int
+trident_ioctl(struct inode *inode, struct file *file, 
+	      unsigned int cmd, unsigned long arg)
 {
 	struct trident_state *state = (struct trident_state *)file->private_data;
 	struct dmabuf *dmabuf = &state->dmabuf;
@@ -2142,17 +2251,18 @@
 	struct trident_card *card = state->card;
 
 	VALIDATE_STATE(state);
-	mapped = ((file->f_mode & FMODE_WRITE) && dmabuf->mapped) ||
-		((file->f_mode & FMODE_READ) && dmabuf->mapped);
-	TRDBG("trident: trident_ioctl, command = %2d, arg = 0x%08x\n",
-	      _IOC_NR(cmd), arg ? *(int *)arg : 0);
 
-	switch (cmd) 
-	{
+
+	mapped = ((file->f_mode & (FMODE_WRITE | FMODE_READ)) && dmabuf->mapped);
+
+	pr_debug("trident: trident_ioctl, command = %2d, arg = 0x%08x\n",
+		 _IOC_NR(cmd), arg ? *(int *) arg : 0);
+
+	switch (cmd) {
 	case OSS_GETVERSION:
-		ret = put_user(SOUND_VERSION, (int *)arg);
+		ret = put_user(SOUND_VERSION, (int *) arg);
 		break;
-		
+
 	case SNDCTL_DSP_RESET:
 		/* FIXME: spin_lock ? */
 		if (file->f_mode & FMODE_WRITE) {
@@ -2176,9 +2286,8 @@
 			ret = drain_dac(state, file->f_flags & O_NONBLOCK);
 		break;
 
-	case SNDCTL_DSP_SPEED: /* set smaple rate */
-		if (get_user(val, (int *)arg))
-		{
+	case SNDCTL_DSP_SPEED:	/* set smaple rate */
+		if (get_user(val, (int *) arg)) {
 			ret = -EFAULT;
 			break;
 		}
@@ -2198,16 +2307,17 @@
 				spin_unlock_irqrestore(&state->card->lock, flags);
 			}
 		}
-		ret = put_user(dmabuf->rate, (int *)arg);
+		ret = put_user(dmabuf->rate, (int *) arg);
 		break;
 
-	case SNDCTL_DSP_STEREO: /* set stereo or mono channel */
-		if (get_user(val, (int *)arg))
-		{
+	case SNDCTL_DSP_STEREO:	/* set stereo or mono channel */
+		if (get_user(val, (int *) arg)) {
 			ret = -EFAULT;
 			break;
 		}
-		lock_set_fmt(state);
+		if ((ret = lock_set_fmt(state)) < 0)
+			return ret;
+
 		if (file->f_mode & FMODE_WRITE) {
 			stop_dac(state);
 			dmabuf->ready = 0;
@@ -2229,31 +2339,37 @@
 
 	case SNDCTL_DSP_GETBLKSIZE:
 		if (file->f_mode & FMODE_WRITE) {
-			if ((val = prog_dmabuf(state, 0)))
+			if ((val = prog_dmabuf_playback(state)))
 				ret = val;
 			else
-				ret = put_user(dmabuf->fragsize, (int *)arg);
+				ret = put_user(dmabuf->fragsize, (int *) arg);
 			break;
 		}
 		if (file->f_mode & FMODE_READ) {
-			if ((val = prog_dmabuf(state, 1)))
+			if ((val = prog_dmabuf_record(state)))
 				ret = val;
 			else
-				ret = put_user(dmabuf->fragsize, (int *)arg);
+				ret = put_user(dmabuf->fragsize, (int *) arg);
 			break;
 		}
+		/* neither READ nor WRITE? is this even possible? */
+		ret = -EINVAL;
+		break;
+
 
-	case SNDCTL_DSP_GETFMTS: /* Returns a mask of supported sample format*/
-		ret = put_user(AFMT_S16_LE|AFMT_U16_LE|AFMT_S8|AFMT_U8, (int *)arg);
+	case SNDCTL_DSP_GETFMTS: /* Returns a mask of supported sample format */
+		ret = put_user(AFMT_S16_LE | AFMT_U16_LE | AFMT_S8 | 
+			       AFMT_U8, (int *) arg);
 		break;
 
-	case SNDCTL_DSP_SETFMT: /* Select sample format */
-		if (get_user(val, (int *)arg))
-		{
+	case SNDCTL_DSP_SETFMT:	/* Select sample format */
+		if (get_user(val, (int *) arg)) {
 			ret = -EFAULT;
 			break;
 		}
-		lock_set_fmt(state);
+		if ((ret = lock_set_fmt(state)) < 0)
+			return ret;
+
 		if (val != AFMT_QUERY) {
 			if (file->f_mode & FMODE_WRITE) {
 				stop_dac(state);
@@ -2273,39 +2389,38 @@
 			}
 		}
 		unlock_set_fmt(state);
-		ret = put_user((dmabuf->fmt & TRIDENT_FMT_16BIT) ?
-				AFMT_S16_LE : AFMT_U8, (int *)arg);
+		ret = put_user((dmabuf->fmt & TRIDENT_FMT_16BIT) ? AFMT_S16_LE : 
+			       AFMT_U8, (int *) arg);
 		break;
 
 	case SNDCTL_DSP_CHANNELS:
-		if (get_user(val, (int *)arg))
-		{
+		if (get_user(val, (int *) arg)) {
 			ret = -EFAULT;
 			break;
 		}
 		if (val != 0) {
-			lock_set_fmt(state);
+			if ((ret = lock_set_fmt(state)) < 0)
+				return ret;
+
 			if (file->f_mode & FMODE_WRITE) {
 				stop_dac(state);
 				dmabuf->ready = 0;
-								
+
 				//prevent from memory leak
 				if ((state->chans_num > 2) && (state->chans_num != val)) {
 					ali_free_other_states_resources(state);
 					state->chans_num = 1;
 				}
-				
-				if (val >= 2)
-				{
+
+				if (val >= 2) {
 
 					dmabuf->fmt |= TRIDENT_FMT_STEREO;
 					if ((val == 6) && (state->card->pci_id == PCI_DEVICE_ID_ALI_5451)) {
-
-						if( card->rec_channel_use_count > 0 )
-						{
-							printk(KERN_ERR "trident: Record is working on the card!\n");
+						if (card->rec_channel_use_count > 0) {
+							printk(KERN_ERR "trident: Record is "
+							       "working on the card!\n");
 							ret = -EBUSY;
-							unlock_set_fmt(state); 
+							unlock_set_fmt(state);
 							break;
 						}
 
@@ -2321,12 +2436,11 @@
 							unlock_set_fmt(state);
 							break;
 						}
-						state->card->multi_channel_use_count ++;
+						state->card->multi_channel_use_count++;
 						up(&state->card->open_sem);
-					}
-					else val = 2;	/*yield to 2-channels*/
-				}
-				else
+					} else
+						val = 2;	/*yield to 2-channels */
+				} else
 					dmabuf->fmt &= ~TRIDENT_FMT_STEREO;
 				state->chans_num = val;
 			}
@@ -2334,17 +2448,17 @@
 				stop_adc(state);
 				dmabuf->ready = 0;
 				if (val >= 2) {
-					if (!((file->f_mode & FMODE_WRITE) && (val == 6)))
+					if (!((file->f_mode & FMODE_WRITE) && 
+					      (val == 6)))
 						val = 2;
 					dmabuf->fmt |= TRIDENT_FMT_STEREO;
-				}
-				else
+				} else
 					dmabuf->fmt &= ~TRIDENT_FMT_STEREO;
 				state->chans_num = val;
 			}
 			unlock_set_fmt(state);
 		}
-		ret = put_user(val, (int *)arg);
+		ret = put_user(val, (int *) arg);
 		break;
 
 	case SNDCTL_DSP_POST:
@@ -2352,18 +2466,15 @@
 		break;
 
 	case SNDCTL_DSP_SUBDIVIDE:
-		if (dmabuf->subdivision)
-		{
+		if (dmabuf->subdivision) {
 			ret = -EINVAL;
 			break;
 		}
-		if (get_user(val, (int *)arg))
-		{
+		if (get_user(val, (int *) arg)) {
 			ret = -EFAULT;
 			break;
 		}
-		if (val != 1 && val != 2 && val != 4)
-		{
+		if (val != 1 && val != 2 && val != 4) {
 			ret = -EINVAL;
 			break;
 		}
@@ -2371,8 +2482,7 @@
 		break;
 
 	case SNDCTL_DSP_SETFRAGMENT:
-		if (get_user(val, (int *)arg))
-		{
+		if (get_user(val, (int *) arg)) {
 			ret = -EFAULT;
 			break;
 		}
@@ -2389,13 +2499,11 @@
 		break;
 
 	case SNDCTL_DSP_GETOSPACE:
-		if (!(file->f_mode & FMODE_WRITE))
-		{
+		if (!(file->f_mode & FMODE_WRITE)) {
 			ret = -EINVAL;
 			break;
 		}
-		if (!dmabuf->ready && (val = prog_dmabuf(state, 0)) != 0)
-		{ 
+		if (!dmabuf->ready && (val = prog_dmabuf_playback(state)) != 0) {
 			ret = val;
 			break;
 		}
@@ -2406,17 +2514,16 @@
 		abinfo.fragstotal = dmabuf->numfrag;
 		abinfo.fragments = abinfo.bytes >> dmabuf->fragshift;
 		spin_unlock_irqrestore(&state->card->lock, flags);
-		ret = copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		ret = copy_to_user((void *) arg, &abinfo, sizeof (abinfo)) ? 
+			-EFAULT : 0;
 		break;
 
 	case SNDCTL_DSP_GETISPACE:
-		if (!(file->f_mode & FMODE_READ))
-		{
+		if (!(file->f_mode & FMODE_READ)) {
 			ret = -EINVAL;
 			break;
 		}
-		if (!dmabuf->ready && (val = prog_dmabuf(state, 1)) != 0)
-		{
+		if (!dmabuf->ready && (val = prog_dmabuf_record(state)) != 0) {
 			ret = val;
 			break;
 		}
@@ -2427,7 +2534,8 @@
 		abinfo.fragstotal = dmabuf->numfrag;
 		abinfo.fragments = abinfo.bytes >> dmabuf->fragshift;
 		spin_unlock_irqrestore(&state->card->lock, flags);
-		ret = copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		ret = copy_to_user((void *) arg, &abinfo, sizeof (abinfo)) ? 
+			-EFAULT : 0;
 		break;
 
 	case SNDCTL_DSP_NONBLOCK:
@@ -2435,8 +2543,8 @@
 		break;
 
 	case SNDCTL_DSP_GETCAPS:
-		ret = put_user(DSP_CAP_REALTIME|DSP_CAP_TRIGGER|DSP_CAP_MMAP|DSP_CAP_BIND,
-			    (int *)arg);
+		ret = put_user(DSP_CAP_REALTIME | DSP_CAP_TRIGGER | 
+			       DSP_CAP_MMAP | DSP_CAP_BIND, (int *) arg);
 		break;
 
 	case SNDCTL_DSP_GETTRIGGER:
@@ -2445,18 +2553,18 @@
 			val |= PCM_ENABLE_INPUT;
 		if ((file->f_mode & FMODE_WRITE) && dmabuf->enable)
 			val |= PCM_ENABLE_OUTPUT;
-		ret = put_user(val, (int *)arg);
+		ret = put_user(val, (int *) arg);
 		break;
 
 	case SNDCTL_DSP_SETTRIGGER:
-		if (get_user(val, (int *)arg))
-		{
+		if (get_user(val, (int *) arg)) {
 			ret = -EFAULT;
 			break;
 		}
 		if (file->f_mode & FMODE_READ) {
 			if (val & PCM_ENABLE_INPUT) {
-				if (!dmabuf->ready && (ret = prog_dmabuf(state, 1)))
+				if (!dmabuf->ready && 
+				    (ret = prog_dmabuf_record(state)))
 					break;
 				start_adc(state);
 			} else
@@ -2464,7 +2572,8 @@
 		}
 		if (file->f_mode & FMODE_WRITE) {
 			if (val & PCM_ENABLE_OUTPUT) {
-				if (!dmabuf->ready && (ret = prog_dmabuf(state, 0)))
+				if (!dmabuf->ready && 
+				    (ret = prog_dmabuf_playback(state)))
 					break;
 				start_dac(state);
 			} else
@@ -2473,13 +2582,12 @@
 		break;
 
 	case SNDCTL_DSP_GETIPTR:
-		if (!(file->f_mode & FMODE_READ))
-		{
+		if (!(file->f_mode & FMODE_READ)) {
 			ret = -EINVAL;
 			break;
 		}
-		if (!dmabuf->ready && (val = prog_dmabuf(state, 1)) != 0)
-		{
+		if (!dmabuf->ready && (val = prog_dmabuf_record(state))
+		    != 0) {
 			ret = val;
 			break;
 		}
@@ -2489,32 +2597,33 @@
 		cinfo.blocks = dmabuf->count >> dmabuf->fragshift;
 		cinfo.ptr = dmabuf->hwptr;
 		if (dmabuf->mapped)
-			dmabuf->count &= dmabuf->fragsize-1;
+			dmabuf->count &= dmabuf->fragsize - 1;
 		spin_unlock_irqrestore(&state->card->lock, flags);
-		ret = copy_to_user((void *)arg, &cinfo, sizeof(cinfo))?-EFAULT:0;
+		ret = copy_to_user((void *) arg, &cinfo, sizeof (cinfo)) ? 
+			-EFAULT : 0;
 		break;
 
 	case SNDCTL_DSP_GETOPTR:
-		if (!(file->f_mode & FMODE_WRITE))
-		{
+		if (!(file->f_mode & FMODE_WRITE)) {
 			ret = -EINVAL;
 			break;
 		}
-		if (!dmabuf->ready && (val = prog_dmabuf(state, 0)) != 0)
-		{
+		if (!dmabuf->ready && (val = prog_dmabuf_playback(state))
+		    != 0) {
 			ret = val;
 			break;
 		}
-		
+
 		spin_lock_irqsave(&state->card->lock, flags);
 		trident_update_ptr(state);
 		cinfo.bytes = dmabuf->total_bytes;
 		cinfo.blocks = dmabuf->count >> dmabuf->fragshift;
 		cinfo.ptr = dmabuf->hwptr;
 		if (dmabuf->mapped)
-			dmabuf->count &= dmabuf->fragsize-1;
+			dmabuf->count &= dmabuf->fragsize - 1;
 		spin_unlock_irqrestore(&state->card->lock, flags);
-		ret = copy_to_user((void *)arg, &cinfo, sizeof(cinfo))?-EFAULT:0;
+		ret = copy_to_user((void *) arg, &cinfo, sizeof (cinfo)) ? 
+			-EFAULT : 0;
 		break;
 
 	case SNDCTL_DSP_SETDUPLEX:
@@ -2522,13 +2631,11 @@
 		break;
 
 	case SNDCTL_DSP_GETODELAY:
-		if (!(file->f_mode & FMODE_WRITE))
-		{
+		if (!(file->f_mode & FMODE_WRITE)) {
 			ret = -EINVAL;
 			break;
 		}
-		if (!dmabuf->ready && (val = prog_dmabuf(state, 0)) != 0)
-		{
+		if (!dmabuf->ready && (val = prog_dmabuf_playback(state)) != 0) {
 			ret = val;
 			break;
 		}
@@ -2536,37 +2643,35 @@
 		trident_update_ptr(state);
 		val = dmabuf->count;
 		spin_unlock_irqrestore(&state->card->lock, flags);
-		ret = put_user(val, (int *)arg);
+		ret = put_user(val, (int *) arg);
 		break;
 
 	case SOUND_PCM_READ_RATE:
-		ret = put_user(dmabuf->rate, (int *)arg);
+		ret = put_user(dmabuf->rate, (int *) arg);
 		break;
 
 	case SOUND_PCM_READ_CHANNELS:
-		ret = put_user((dmabuf->fmt & TRIDENT_FMT_STEREO) ? 2 : 1,
-				(int *)arg);
+		ret = put_user((dmabuf->fmt & TRIDENT_FMT_STEREO) ? 2 : 1, 
+			       (int *) arg);
 		break;
 
 	case SOUND_PCM_READ_BITS:
-		ret = put_user((dmabuf->fmt & TRIDENT_FMT_16BIT) ?
-				AFMT_S16_LE : AFMT_U8, (int *)arg);
+		ret = put_user((dmabuf->fmt & TRIDENT_FMT_16BIT) ? AFMT_S16_LE : 
+			       AFMT_U8, (int *) arg);
 		break;
 
 	case SNDCTL_DSP_GETCHANNELMASK:
-		ret = put_user(DSP_BIND_FRONT|DSP_BIND_SURR|DSP_BIND_CENTER_LFE,
-				(int *)arg);
+		ret = put_user(DSP_BIND_FRONT | DSP_BIND_SURR | 
+			       DSP_BIND_CENTER_LFE,  (int *) arg);
 		break;
 
 	case SNDCTL_DSP_BIND_CHANNEL:
-		if (state->card->pci_id != PCI_DEVICE_ID_SI_7018)
-		{
+		if (state->card->pci_id != PCI_DEVICE_ID_SI_7018) {
 			ret = -EINVAL;
 			break;
 		}
 
-		if (get_user(val, (int *)arg))
-		{
+		if (get_user(val, (int *) arg)) {
 			ret = -EFAULT;
 			break;
 		}
@@ -2576,12 +2681,14 @@
 		} else {
 			dmabuf->ready = 0;
 			if (file->f_mode & FMODE_READ)
-				dmabuf->channel->attribute = (CHANNEL_REC|SRC_ENABLE);
+				dmabuf->channel->attribute = (CHANNEL_REC | 
+							      SRC_ENABLE);
 			if (file->f_mode & FMODE_WRITE)
-				dmabuf->channel->attribute = (CHANNEL_SPC_PB|SRC_ENABLE);
+				dmabuf->channel->attribute = (CHANNEL_SPC_PB | 
+							      SRC_ENABLE);
 			dmabuf->channel->attribute |= mask2attr[ffs(val)];
 		}
-		ret = put_user(val, (int *)arg);
+		ret = put_user(val, (int *) arg);
 		break;
 
 	case SNDCTL_DSP_MAPINBUF:
@@ -2592,23 +2699,27 @@
 	default:
 		ret = -EINVAL;
 		break;
-		
+
 	}
 	return ret;
 }
 
-static int trident_open(struct inode *inode, struct file *file)
+static int
+trident_open(struct inode *inode, struct file *file)
 {
 	int i = 0;
 	int minor = iminor(inode);
 	struct trident_card *card = devs;
 	struct trident_state *state = NULL;
 	struct dmabuf *dmabuf = NULL;
-	
+
 	/* Added by Matt Wu 01-05-2001 */
-	if(file->f_mode & FMODE_READ)
-	{
-		if(card->pci_id == PCI_DEVICE_ID_ALI_5451) {
+	/* TODO: there's some redundacy here wrt the check below */
+	/* for multi_use_count > 0. Should we return -EBUSY or find */
+	/* a different card? for now, don't break current behaviour */
+	/* -- mulix */
+	if (file->f_mode & FMODE_READ) {
+		if (card->pci_id == PCI_DEVICE_ID_ALI_5451) {
 			if (card->multi_channel_use_count > 0)
 				return -EBUSY;
 		}
@@ -2617,11 +2728,9 @@
 	/* find an available virtual channel (instance of /dev/dsp) */
 	while (card != NULL) {
 		down(&card->open_sem);
-		if(file->f_mode & FMODE_READ)
-		{
+		if (file->f_mode & FMODE_READ) {
 			/* Skip opens on cards that are in 6 channel mode */
-			if (card->multi_channel_use_count > 0)
-			{
+			if (card->multi_channel_use_count > 0) {
 				up(&card->open_sem);
 				card = card->next;
 				continue;
@@ -2629,12 +2738,12 @@
 		}
 		for (i = 0; i < NR_HW_CH; i++) {
 			if (card->states[i] == NULL) {
-				state = card->states[i] = (struct trident_state *)
-					kmalloc(sizeof(struct trident_state), GFP_KERNEL);
+				state = card->states[i] = kmalloc(sizeof(*state), GFP_KERNEL);
 				if (state == NULL) {
+					up(&card->open_sem);
 					return -ENOMEM;
 				}
-				memset(state, 0, sizeof(struct trident_state));
+				memset(state, 0, sizeof(*state));
 				init_MUTEX(&state->sem);
 				dmabuf = &state->dmabuf;
 				goto found_virt;
@@ -2647,15 +2756,15 @@
 	if (!state) {
 		return -ENODEV;
 	}
- found_virt:
+      found_virt:
 	/* found a free virtual channel, allocate hardware channels */
-	if(file->f_mode & FMODE_READ)
+	if (file->f_mode & FMODE_READ)
 		dmabuf->channel = card->alloc_rec_pcm_channel(card);
 	else
 		dmabuf->channel = card->alloc_pcm_channel(card);
-		
+
 	if (dmabuf->channel == NULL) {
-		kfree (card->states[i]);
+		kfree(card->states[i]);
 		card->states[i] = NULL;
 		return -ENODEV;
 	}
@@ -2667,16 +2776,16 @@
 	init_waitqueue_head(&dmabuf->wait);
 	file->private_data = state;
 
-	/* set default sample format. According to OSS Programmer's Guide  /dev/dsp
-	   should be default to unsigned 8-bits, mono, with sample rate 8kHz and
-	   /dev/dspW will accept 16-bits sample */
+	/* set default sample format. According to OSS Programmer's */ 
+	/* Guide  /dev/dsp should be default to unsigned 8-bits, mono, */ 
+	/* with sample rate 8kHz and /dev/dspW will accept 16-bits sample */
 	if (file->f_mode & FMODE_WRITE) {
 		dmabuf->fmt &= ~TRIDENT_FMT_MASK;
 		if ((minor & 0x0f) == SND_DEV_DSP16)
 			dmabuf->fmt |= TRIDENT_FMT_16BIT;
 		dmabuf->ossfragshift = 0;
-		dmabuf->ossmaxfrags  = 0;
-		dmabuf->subdivision  = 0;
+		dmabuf->ossmaxfrags = 0;
+		dmabuf->subdivision = 0;
 		if (card->pci_id == PCI_DEVICE_ID_SI_7018) {
 			/* set default channel attribute to normal playback */
 			dmabuf->channel->attribute = CHANNEL_PB;
@@ -2685,54 +2794,55 @@
 	}
 
 	if (file->f_mode & FMODE_READ) {
-		/* FIXME: Trident 4d can only record in signed 16-bits stereo, 48kHz sample,
-		   to be dealed with in trident_set_adc_rate() ?? */
+		/* FIXME: Trident 4d can only record in signed 16-bits stereo, */ 
+		/* 48kHz sample, to be dealed with in trident_set_adc_rate() ?? */
 		dmabuf->fmt &= ~TRIDENT_FMT_MASK;
 		if ((minor & 0x0f) == SND_DEV_DSP16)
 			dmabuf->fmt |= TRIDENT_FMT_16BIT;
 		dmabuf->ossfragshift = 0;
-		dmabuf->ossmaxfrags  = 0;
-		dmabuf->subdivision  = 0;
+		dmabuf->ossmaxfrags = 0;
+		dmabuf->subdivision = 0;
 		if (card->pci_id == PCI_DEVICE_ID_SI_7018) {
 			/* set default channel attribute to 0x8a80, record from
-			   PCM L/R FIFO and mono = (left + right + 1)/2*/
-			dmabuf->channel->attribute =
-				(CHANNEL_REC|PCM_LR|MONO_MIX);
+			   PCM L/R FIFO and mono = (left + right + 1)/2 */
+			dmabuf->channel->attribute = (CHANNEL_REC | PCM_LR | 
+						      MONO_MIX);
 		}
 		trident_set_adc_rate(state, 8000);
-	
+
 		/* Added by Matt Wu 01-05-2001 */
-		if(card->pci_id == PCI_DEVICE_ID_ALI_5451)
-			card->rec_channel_use_count ++;
+		if (card->pci_id == PCI_DEVICE_ID_ALI_5451)
+			card->rec_channel_use_count++;
 	}
 
 	state->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
 	up(&card->open_sem);
 
-	TRDBG("trident: open virtual channel %d, hard channel %d\n", 
-              state->virt, dmabuf->channel->num);
+	pr_debug("trident: open virtual channel %d, hard channel %d\n",
+		 state->virt, dmabuf->channel->num);
 
 	return 0;
 }
 
-static int trident_release(struct inode *inode, struct file *file)
+static int
+trident_release(struct inode *inode, struct file *file)
 {
 	struct trident_state *state = (struct trident_state *)file->private_data;
 	struct trident_card *card;
 	struct dmabuf *dmabuf;
 
-	lock_kernel();
+	VALIDATE_STATE(state);
+
 	card = state->card;
 	dmabuf = &state->dmabuf;
-	VALIDATE_STATE(state);
 
 	if (file->f_mode & FMODE_WRITE) {
 		trident_clear_tail(state);
 		drain_dac(state, file->f_flags & O_NONBLOCK);
 	}
 
-	TRDBG("trident: closing virtual channel %d, hard channel %d\n", 
-	      state->virt, dmabuf->channel->num);
+	pr_debug("trident: closing virtual channel %d, hard channel %d\n",
+		 state->virt, dmabuf->channel->num);
 
 	/* stop DMA state machine and free DMA buffers/channels */
 	down(&card->open_sem);
@@ -2760,7 +2870,7 @@
 
 		/* Added by Matt Wu */
 		if (card->pci_id == PCI_DEVICE_ID_ALI_5451) {
-			if( card->rec_channel_use_count-- < 0 )
+			if (card->rec_channel_use_count-- < 0)
 				card->rec_channel_use_count = 0;
 		}
 	}
@@ -2770,37 +2880,36 @@
 
 	/* we're covered by the open_sem */
 	up(&card->open_sem);
-	unlock_kernel();
 
 	return 0;
 }
 
-static /*const*/ struct file_operations trident_audio_fops = {
-	.owner		= THIS_MODULE,
-	.llseek		= no_llseek,
-	.read		= trident_read,
-	.write		= trident_write,
-	.poll		= trident_poll,
-	.ioctl		= trident_ioctl,
-	.mmap		= trident_mmap,
-	.open		= trident_open,
-	.release	= trident_release,
+static /*const */ struct file_operations trident_audio_fops = {
+	.owner = THIS_MODULE,
+	.llseek = no_llseek,
+	.read = trident_read,
+	.write = trident_write,
+	.poll = trident_poll,
+	.ioctl = trident_ioctl,
+	.mmap = trident_mmap,
+	.open = trident_open,
+	.release = trident_release,
 };
 
 /* trident specific AC97 functions */
 /* Write AC97 codec registers */
-static void trident_ac97_set(struct ac97_codec *codec, u8 reg, u16 val)
+static void
+trident_ac97_set(struct ac97_codec *codec, u8 reg, u16 val)
 {
 	struct trident_card *card = (struct trident_card *)codec->private_data;
 	unsigned int address, mask, busy;
-	unsigned short count  = 0xffff;
+	unsigned short count = 0xffff;
 	unsigned long flags;
 	u32 data;
 
 	data = ((u32) val) << 16;
 
-	switch (card->pci_id)
-	{
+	switch (card->pci_id) {
 	default:
 	case PCI_DEVICE_ID_SI_7018:
 		address = SI_AC97_WRITE;
@@ -2834,7 +2943,6 @@
 			break;
 	} while (count--);
 
-
 	data |= (mask | (reg & AC97_REG_ADDR));
 
 	if (count == 0) {
@@ -2848,7 +2956,8 @@
 }
 
 /* Read AC97 codec registers */
-static u16 trident_ac97_get(struct ac97_codec *codec, u8 reg)
+static u16
+trident_ac97_get(struct ac97_codec *codec, u8 reg)
 {
 	struct trident_card *card = (struct trident_card *)codec->private_data;
 	unsigned int address, mask, busy;
@@ -2856,8 +2965,7 @@
 	unsigned long flags;
 	u32 data;
 
-	switch (card->pci_id)
-	{
+	switch (card->pci_id) {
 	default:
 	case PCI_DEVICE_ID_SI_7018:
 		address = SI_AC97_READ;
@@ -2905,56 +3013,58 @@
 }
 
 /* rewrite ac97 read and write mixer register by hulei for ALI*/
-static int acquirecodecaccess(struct trident_card *card)
+static int
+acquirecodecaccess(struct trident_card *card)
 {
-	u16 wsemamask=0x6000; /* bit 14..13 */
+	u16 wsemamask = 0x6000;	/* bit 14..13 */
 	u16 wsemabits;
-        u16 wcontrol ;
+	u16 wcontrol;
 	int block = 0;
 	int ncount = 25;
 	while (1) {
-		wcontrol = inw(TRID_REG(card,  ALI_AC97_WRITE));
+		wcontrol = inw(TRID_REG(card, ALI_AC97_WRITE));
 		wsemabits = wcontrol & wsemamask;
-		
-		if (wsemabits==0x4000)
-			return 1; /* 0x4000 is audio ,then success */
+
+		if (wsemabits == 0x4000)
+			return 1;	/* 0x4000 is audio ,then success */
 		if (ncount-- < 0)
 			break;
-		if (wsemabits == 0)
-		{
-		unlock:
-			outl(((u32)(wcontrol & 0x1eff)|0x00004000), TRID_REG(card, ALI_AC97_WRITE));
+		if (wsemabits == 0) {
+		      unlock:
+			outl(((u32) (wcontrol & 0x1eff) | 0x00004000), 
+			     TRID_REG(card, ALI_AC97_WRITE));
 			continue;
 		}
 		udelay(20);
 	}
-	if(!block)
-	{
-		TRDBG("accesscodecsemaphore: try unlock\n");
+	if (!block) {
+		pr_debug("accesscodecsemaphore: try unlock\n");
 		block = 1;
 		goto unlock;
 	}
 	return 0;
 }
 
-static void releasecodecaccess(struct trident_card *card)
-{ 
+static void
+releasecodecaccess(struct trident_card *card)
+{
 	unsigned long wcontrol;
-	wcontrol = inl(TRID_REG(card,  ALI_AC97_WRITE));
+	wcontrol = inl(TRID_REG(card, ALI_AC97_WRITE));
 	outl((wcontrol & 0xffff1eff), TRID_REG(card, ALI_AC97_WRITE));
 }
 
-static int waitforstimertick(struct trident_card *card)
+static int
+waitforstimertick(struct trident_card *card)
 {
 	unsigned long chk1, chk2;
 	unsigned int wcount = 0xffff;
-	chk1 = inl(TRID_REG(card,  ALI_STIMER));
-	
-	while(1) {
-		chk2 = inl(TRID_REG(card,  ALI_STIMER));
-		if( (wcount > 0) && chk1 != chk2)
+	chk1 = inl(TRID_REG(card, ALI_STIMER));
+
+	while (1) {
+		chk2 = inl(TRID_REG(card, ALI_STIMER));
+		if ((wcount > 0) && chk1 != chk2)
 			return 1;
-		if(wcount <= 0)
+		if (wcount <= 0)
 			break;
 		udelay(50);
 	}
@@ -2962,16 +3072,17 @@
 }
 
 /* Read AC97 codec registers for ALi*/
-static u16 ali_ac97_get(struct trident_card *card, int secondary, u8 reg)
+static u16
+ali_ac97_get(struct trident_card *card, int secondary, u8 reg)
 {
 	unsigned int address, mask;
 	unsigned int ncount;
-        unsigned long aud_reg;
+	unsigned long aud_reg;
 	u32 data;
-        u16 wcontrol;
-        unsigned long flags;
+	u16 wcontrol;
+	unsigned long flags;
 
-	if(!card)
+	if (!card)
 		BUG();
 
 	address = ALI_AC97_READ;
@@ -2981,121 +3092,127 @@
 	mask = ALI_AC97_READ_ACTION | ALI_AC97_AUDIO_BUSY;
 	if (secondary)
 		mask |= ALI_AC97_SECONDARY;
-    
-    	spin_lock_irqsave(&card->lock, flags);
-    	
+
+	spin_lock_irqsave(&card->lock, flags);
+
 	if (!acquirecodecaccess(card))
 		printk(KERN_ERR "access codec fail\n");
-	
+
 	wcontrol = inw(TRID_REG(card, ALI_AC97_WRITE));
 	wcontrol &= 0xfe00;
-	wcontrol |= (0x8000|reg);
-	outw(wcontrol,TRID_REG(card,  ALI_AC97_WRITE));
+	wcontrol |= (0x8000 | reg);
+	outw(wcontrol, TRID_REG(card, ALI_AC97_WRITE));
 
 	data = (mask | (reg & AC97_REG_ADDR));
-	
-	if(!waitforstimertick(card)) {
+
+	if (!waitforstimertick(card)) {
 		printk(KERN_ERR "ali_ac97_read: BIT_CLOCK is dead\n");
 		goto releasecodec;
 	}
-	
-	udelay(20);		
-	
-	ncount=10;
-	
-	while(1) {
-		if ((inw(TRID_REG(card,ALI_AC97_WRITE)) & ALI_AC97_BUSY_READ) != 0)
+
+	udelay(20);
+
+	ncount = 10;
+
+	while (1) {
+		if ((inw(TRID_REG(card, ALI_AC97_WRITE)) & ALI_AC97_BUSY_READ) 
+		    != 0)
 			break;
-		if(ncount <=0)
+		if (ncount <= 0)
 			break;
-		if(ncount--==1) {
-			TRDBG("ali_ac97_read :try clear busy flag\n");
-			aud_reg = inl(TRID_REG(card,  ALI_AC97_WRITE));
-			outl((aud_reg & 0xffff7fff), TRID_REG(card, ALI_AC97_WRITE));
+		if (ncount-- == 1) {
+			pr_debug("ali_ac97_read :try clear busy flag\n");
+			aud_reg = inl(TRID_REG(card, ALI_AC97_WRITE));
+			outl((aud_reg & 0xffff7fff), 
+			     TRID_REG(card, ALI_AC97_WRITE));
 		}
 		udelay(10);
 	}
-	
+
 	data = inl(TRID_REG(card, address));
 
 	spin_unlock_irqrestore(&card->lock, flags);
-	
+
 	return ((u16) (data >> 16));
 
- releasecodec: 
+      releasecodec:
 	releasecodecaccess(card);
 	spin_unlock_irqrestore(&card->lock, flags);
 	printk(KERN_ERR "ali_ac97_read: AC97 CODEC read timed out.\n");
 	return 0;
 }
 
-
 /* Write AC97 codec registers for hulei*/
-static void ali_ac97_set(struct trident_card *card, int secondary, u8 reg, u16 val)
+static void
+ali_ac97_set(struct trident_card *card, int secondary, u8 reg, u16 val)
 {
 	unsigned int address, mask;
 	unsigned int ncount;
 	u32 data;
-        u16 wcontrol;
-        unsigned long flags;
-	
+	u16 wcontrol;
+	unsigned long flags;
+
 	data = ((u32) val) << 16;
-	
-	if(!card)
+
+	if (!card)
 		BUG();
-	
+
 	address = ALI_AC97_WRITE;
 	mask = ALI_AC97_WRITE_ACTION | ALI_AC97_AUDIO_BUSY;
 	if (secondary)
 		mask |= ALI_AC97_SECONDARY;
 	if (card->revision == ALI_5451_V02)
 		mask |= ALI_AC97_WRITE_MIXER_REGISTER;
-		
+
 	spin_lock_irqsave(&card->lock, flags);
-        if (!acquirecodecaccess(card))      
+	if (!acquirecodecaccess(card))
 		printk(KERN_ERR "ali_ac97_write: access codec fail\n");
-			
+
 	wcontrol = inw(TRID_REG(card, ALI_AC97_WRITE));
 	wcontrol &= 0xff00;
-	wcontrol |= (0x8100|reg);/* bit 8=1: (ali1535 )reserved /ali1535+ write */
-	outl(( data |wcontrol), TRID_REG(card,ALI_AC97_WRITE ));
+	wcontrol |= (0x8100 | reg); /* bit 8=1: (ali1535 )reserved/ */ 
+	                            /* ali1535+ write */
+	outl((data | wcontrol), TRID_REG(card, ALI_AC97_WRITE));
 
-        if(!waitforstimertick(card)) {
+	if (!waitforstimertick(card)) {
 		printk(KERN_ERR "BIT_CLOCK is dead\n");
 		goto releasecodec;
 	}
-	
-        ncount = 10;
-	while(1) {
+
+	ncount = 10;
+	while (1) {
 		wcontrol = inw(TRID_REG(card, ALI_AC97_WRITE));
-		if(!(wcontrol & 0x8000))
+		if (!(wcontrol & 0x8000))
 			break;
-		if(ncount <= 0)
+		if (ncount <= 0)
 			break;
-		if(ncount-- == 1) {
-			TRDBG("ali_ac97_set :try clear busy flag!!\n");
-			outw(wcontrol & 0x7fff, TRID_REG(card, ALI_AC97_WRITE));
+		if (ncount-- == 1) {
+			pr_debug("ali_ac97_set :try clear busy flag!!\n");
+			outw(wcontrol & 0x7fff, 
+			     TRID_REG(card, ALI_AC97_WRITE));
 		}
 		udelay(10);
 	}
-	
- releasecodec:
+
+      releasecodec:
 	releasecodecaccess(card);
 	spin_unlock_irqrestore(&card->lock, flags);
 	return;
 }
 
-static void ali_enable_special_channel(struct trident_state *stat)
+static void
+ali_enable_special_channel(struct trident_state *stat)
 {
 	struct trident_card *card = stat->card;
 	unsigned long s_channels;
-	
+
 	s_channels = inl(TRID_REG(card, ALI_GLOBAL_CONTROL));
-	s_channels |= (1<<stat->dmabuf.channel->num);
+	s_channels |= (1 << stat->dmabuf.channel->num);
 	outl(s_channels, TRID_REG(card, ALI_GLOBAL_CONTROL));
 }
 
-static u16 ali_ac97_read(struct ac97_codec *codec, u8 reg)
+static u16
+ali_ac97_read(struct ac97_codec *codec, u8 reg)
 {
 	int id;
 	u16 data;
@@ -3104,25 +3221,26 @@
 	/* Added by Matt Wu */
 	if (!codec)
 		BUG();
-		
-	card = (struct trident_card *)codec->private_data;
 
-	if(!card->mixer_regs_ready)
+	card = (struct trident_card *) codec->private_data;
+
+	if (!card->mixer_regs_ready)
 		return ali_ac97_get(card, codec->id, reg);
 
 	/*
-	 *	FIXME: need to stop this caching some registers
+	 *      FIXME: need to stop this caching some registers
 	 */
-	if(codec->id)
+	if (codec->id)
 		id = 1;
 	else
 		id = 0;
 
-	data = card->mixer_regs[reg/2][id];
+	data = card->mixer_regs[reg / 2][id];
 	return data;
 }
 
-static void ali_ac97_write(struct ac97_codec *codec, u8 reg, u16 val)
+static void
+ali_ac97_write(struct ac97_codec *codec, u8 reg, u16 val)
 {
 	int id;
 	struct trident_card *card;
@@ -3130,21 +3248,20 @@
 	/*  Added by Matt Wu */
 	if (!codec)
 		BUG();
-		
-	card = (struct trident_card *)codec->private_data;
 
-	if (!card->mixer_regs_ready)
-	{
+	card = (struct trident_card *) codec->private_data;
+
+	if (!card->mixer_regs_ready) {
 		ali_ac97_set(card, codec->id, reg, val);
 		return;
 	}
 
-	if(codec->id)
+	if (codec->id)
 		id = 1;
 	else
 		id = 0;
 
-	card->mixer_regs[reg/2][id] = val;
+	card->mixer_regs[reg / 2][id] = val;
 	ali_ac97_set(card, codec->id, reg, val);
 }
 
@@ -3153,73 +3270,78 @@
 	ALI_PCM_TO_SPDIF_OUT
 */
 
-static void ali_setup_spdif_out(struct trident_card *card, int flag)
+static void
+ali_setup_spdif_out(struct trident_card *card, int flag)
 {
 	unsigned long spdif;
 	unsigned char ch;
 
-        char temp;
-        struct pci_dev *pci_dev = NULL;
+	char temp;
+	struct pci_dev *pci_dev = NULL;
 
-        pci_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, pci_dev);
-        if (pci_dev == NULL)
-                return;
-        pci_read_config_byte(pci_dev, 0x61, &temp);
-        temp |= 0x40;
-        pci_write_config_byte(pci_dev, 0x61, temp);
-        pci_read_config_byte(pci_dev, 0x7d, &temp);
-        temp |= 0x01;
-        pci_write_config_byte(pci_dev, 0x7d, temp);
-        pci_read_config_byte(pci_dev, 0x7e, &temp);
-        temp &= (~0x20);
-        temp |= 0x10;
-        pci_write_config_byte(pci_dev, 0x7e, temp);
+	pci_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, 
+				  pci_dev);
+	if (pci_dev == NULL)
+		return;
+	pci_read_config_byte(pci_dev, 0x61, &temp);
+	temp |= 0x40;
+	pci_write_config_byte(pci_dev, 0x61, temp);
+	pci_read_config_byte(pci_dev, 0x7d, &temp);
+	temp |= 0x01;
+	pci_write_config_byte(pci_dev, 0x7d, temp);
+	pci_read_config_byte(pci_dev, 0x7e, &temp);
+	temp &= (~0x20);
+	temp |= 0x10;
+	pci_write_config_byte(pci_dev, 0x7e, temp);
 
 	ch = inb(TRID_REG(card, ALI_SCTRL));
 	outb(ch | ALI_SPDIF_OUT_ENABLE, TRID_REG(card, ALI_SCTRL));
 	ch = inb(TRID_REG(card, ALI_SPDIF_CTRL));
 	outb(ch & ALI_SPDIF_OUT_CH_STATUS, TRID_REG(card, ALI_SPDIF_CTRL));
-   
+
 	if (flag & ALI_SPDIF_OUT_TO_SPDIF_OUT) {
-  		spdif = inw(TRID_REG(card, ALI_GLOBAL_CONTROL));
-   		spdif |= ALI_SPDIF_OUT_CH_ENABLE;
-   		spdif &= ALI_SPDIF_OUT_SEL_SPDIF;
-   		outw(spdif, TRID_REG(card, ALI_GLOBAL_CONTROL));
+		spdif = inw(TRID_REG(card, ALI_GLOBAL_CONTROL));
+		spdif |= ALI_SPDIF_OUT_CH_ENABLE;
+		spdif &= ALI_SPDIF_OUT_SEL_SPDIF;
+		outw(spdif, TRID_REG(card, ALI_GLOBAL_CONTROL));
 		spdif = inw(TRID_REG(card, ALI_SPDIF_CS));
 		if (flag & ALI_SPDIF_OUT_NON_PCM)
-   			spdif |= 0x0002;
-		else	spdif &= (~0x0002);
-   		outw(spdif, TRID_REG(card, ALI_SPDIF_CS));
-   	}
-   	else {
-   		spdif = inw(TRID_REG(card, ALI_GLOBAL_CONTROL));
-   		spdif |= ALI_SPDIF_OUT_SEL_PCM;
-   		outw(spdif, TRID_REG(card, ALI_GLOBAL_CONTROL));
-   	}
+			spdif |= 0x0002;
+		else
+			spdif &= (~0x0002);
+		outw(spdif, TRID_REG(card, ALI_SPDIF_CS));
+	} else {
+		spdif = inw(TRID_REG(card, ALI_GLOBAL_CONTROL));
+		spdif |= ALI_SPDIF_OUT_SEL_PCM;
+		outw(spdif, TRID_REG(card, ALI_GLOBAL_CONTROL));
+	}
 }
 
-static void ali_disable_special_channel(struct trident_card *card, int ch)
+static void
+ali_disable_special_channel(struct trident_card *card, int ch)
 {
 	unsigned long sc;
-	
+
 	sc = inl(TRID_REG(card, ALI_GLOBAL_CONTROL));
 	sc &= ~(1 << ch);
 	outl(sc, TRID_REG(card, ALI_GLOBAL_CONTROL));
 }
 
-static void ali_disable_spdif_in(struct trident_card *card)
+static void
+ali_disable_spdif_in(struct trident_card *card)
 {
 	unsigned long spdif;
-	
+
 	spdif = inl(TRID_REG(card, ALI_GLOBAL_CONTROL));
 	spdif &= (~ALI_SPDIF_IN_SUPPORT);
 	outl(spdif, TRID_REG(card, ALI_GLOBAL_CONTROL));
-	
-	ali_disable_special_channel(card, ALI_SPDIF_IN_CHANNEL);	
+
+	ali_disable_special_channel(card, ALI_SPDIF_IN_CHANNEL);
 }
 
-static void ali_setup_spdif_in(struct trident_card *card)
-{	
+static void
+ali_setup_spdif_in(struct trident_card *card)
+{
 	unsigned long spdif;
 
 	//Set SPDIF IN Supported
@@ -3242,93 +3364,93 @@
 */
 }
 
-static void ali_delay(struct trident_card *card,int interval)
+static void
+ali_delay(struct trident_card *card, int interval)
 {
-	unsigned long  begintimer,currenttimer;
+	unsigned long begintimer, currenttimer;
 
-	begintimer   = inl(TRID_REG(card,  ALI_STIMER));
-	currenttimer = inl(TRID_REG(card,  ALI_STIMER));
+	begintimer = inl(TRID_REG(card, ALI_STIMER));
+	currenttimer = inl(TRID_REG(card, ALI_STIMER));
 
 	while (currenttimer < begintimer + interval)
-		currenttimer = inl(TRID_REG(card,  ALI_STIMER));
+		currenttimer = inl(TRID_REG(card, ALI_STIMER));
 }
 
-static void ali_detect_spdif_rate(struct trident_card *card)
+static void
+ali_detect_spdif_rate(struct trident_card *card)
 {
-	u16 wval  = 0;
+	u16 wval = 0;
 	u16 count = 0;
-	u8  bval = 0, R1 = 0, R2 = 0;
+	u8 bval = 0, R1 = 0, R2 = 0;
 
-	bval  = inb(TRID_REG(card,ALI_SPDIF_CTRL));
+	bval = inb(TRID_REG(card, ALI_SPDIF_CTRL));
 	bval |= 0x02;
-	outb(bval,TRID_REG(card,ALI_SPDIF_CTRL));
+	outb(bval, TRID_REG(card, ALI_SPDIF_CTRL));
 
-	bval  = inb(TRID_REG(card,ALI_SPDIF_CTRL + 1));
+	bval = inb(TRID_REG(card, ALI_SPDIF_CTRL + 1));
 	bval |= 0x1F;
-	outb(bval,TRID_REG(card,ALI_SPDIF_CTRL + 1));
+	outb(bval, TRID_REG(card, ALI_SPDIF_CTRL + 1));
 
-	while (((R1 < 0x0B )||(R1 > 0x0E)) && (R1 != 0x12) && count <= 50000)
-	{
-		count ++;
+	while (((R1 < 0x0B) || (R1 > 0x0E)) && (R1 != 0x12) && 
+	       count <= 50000) {
+		count++;
 
 		ali_delay(card, 6);
 
-		bval = inb(TRID_REG(card,ALI_SPDIF_CTRL + 1));
+		bval = inb(TRID_REG(card, ALI_SPDIF_CTRL + 1));
 		R1 = bval & 0x1F;
 	}
 
-	if (count > 50000)
-	{
-		printk(KERN_WARNING "trident: Error in ali_detect_spdif_rate!\n");
+	if (count > 50000) {
+		printk(KERN_WARNING "trident: Error in "
+		       "ali_detect_spdif_rate!\n");
 		return;
 	}
 
 	count = 0;
 
-	while (count <= 50000)
-	{
-		count ++;
+	while (count <= 50000) {
+		count++;
 
 		ali_delay(card, 6);
 
-		bval = inb(TRID_REG(card,ALI_SPDIF_CTRL + 1));
+		bval = inb(TRID_REG(card, ALI_SPDIF_CTRL + 1));
 		R2 = bval & 0x1F;
 
-		if(R2 != R1)
+		if (R2 != R1)
 			R1 = R2;
 		else
 			break;
 	}
 
-	if (count > 50000)
-	{
-		printk(KERN_WARNING "trident: Error in ali_detect_spdif_rate!\n");
+	if (count > 50000) {
+		printk(KERN_WARNING "trident: Error in "
+		       "ali_detect_spdif_rate!\n");
 		return;
 	}
 
-	switch (R2)
-	{
+	switch (R2) {
 	case 0x0b:
 	case 0x0c:
 	case 0x0d:
 	case 0x0e:
-		wval  = inw(TRID_REG(card,ALI_SPDIF_CTRL + 2));
+		wval = inw(TRID_REG(card, ALI_SPDIF_CTRL + 2));
 		wval &= 0xE0F0;
-		wval |= (u16)0x09 << 8 | (u16)0x05;
-		outw(wval,TRID_REG(card,ALI_SPDIF_CTRL + 2));
+		wval |= (u16) 0x09 << 8 | (u16) 0x05;
+		outw(wval, TRID_REG(card, ALI_SPDIF_CTRL + 2));
 
-		bval  = inb(TRID_REG(card,ALI_SPDIF_CS +3)) & 0xF0;
-		outb(bval|0x02,TRID_REG(card,ALI_SPDIF_CS + 3));
+		bval = inb(TRID_REG(card, ALI_SPDIF_CS + 3)) & 0xF0;
+		outb(bval | 0x02, TRID_REG(card, ALI_SPDIF_CS + 3));
 		break;
 
 	case 0x12:
-		wval  = inw(TRID_REG(card,ALI_SPDIF_CTRL + 2));
+		wval = inw(TRID_REG(card, ALI_SPDIF_CTRL + 2));
 		wval &= 0xE0F0;
-		wval |= (u16)0x0E << 8 | (u16)0x08;
-		outw(wval,TRID_REG(card,ALI_SPDIF_CTRL + 2));
+		wval |= (u16) 0x0E << 8 | (u16) 0x08;
+		outw(wval, TRID_REG(card, ALI_SPDIF_CTRL + 2));
 
-		bval  = inb(TRID_REG(card,ALI_SPDIF_CS +3)) & 0xF0;
-		outb(bval|0x03,TRID_REG(card,ALI_SPDIF_CS + 3));
+		bval = inb(TRID_REG(card, ALI_SPDIF_CS + 3)) & 0xF0;
+		outb(bval | 0x03, TRID_REG(card, ALI_SPDIF_CS + 3));
 		break;
 
 	default:
@@ -3337,23 +3459,23 @@
 
 }
 
-static unsigned int ali_get_spdif_in_rate(struct trident_card *card)
+static unsigned int
+ali_get_spdif_in_rate(struct trident_card *card)
 {
-	u32	dwRate = 0;
-	u8	bval = 0;
+	u32 dwRate = 0;
+	u8 bval = 0;
 
 	ali_detect_spdif_rate(card);
 
-	bval  = inb(TRID_REG(card,ALI_SPDIF_CTRL));
+	bval = inb(TRID_REG(card, ALI_SPDIF_CTRL));
 	bval &= 0x7F;
 	bval |= 0x40;
-	outb(bval,TRID_REG(card,ALI_SPDIF_CTRL));
+	outb(bval, TRID_REG(card, ALI_SPDIF_CTRL));
 
-	bval  = inb(TRID_REG(card,ALI_SPDIF_CS + 3));
+	bval = inb(TRID_REG(card, ALI_SPDIF_CS + 3));
 	bval &= 0x0F;
 
-	switch (bval)
-	{
+	switch (bval) {
 	case 0:
 		dwRate = 44100;
 		break;
@@ -3369,24 +3491,27 @@
 	}
 
 	return dwRate;
-	
+
 }
 
-static int ali_close_multi_channels(void)
+static int
+ali_close_multi_channels(void)
 {
 	char temp = 0;
 	struct pci_dev *pci_dev = NULL;
 
-        pci_dev = pci_find_device(PCI_VENDOR_ID_AL,PCI_DEVICE_ID_AL_M1533, pci_dev);
-        if (pci_dev == NULL)
-                return -1;
+	pci_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, 
+				  pci_dev);
+	if (pci_dev == NULL)
+		return -1;
 	pci_read_config_byte(pci_dev, 0x59, &temp);
 	temp &= ~0x80;
 	pci_write_config_byte(pci_dev, 0x59, temp);
-	
-	pci_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, pci_dev);
+
+	pci_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, 
+				  pci_dev);
 	if (pci_dev == NULL)
-                return -1;
+		return -1;
 
 	pci_read_config_byte(pci_dev, 0xB8, &temp);
 	temp &= ~0x20;
@@ -3395,25 +3520,28 @@
 	return 0;
 }
 
-static int ali_setup_multi_channels(struct trident_card *card, int chan_nums)
+static int
+ali_setup_multi_channels(struct trident_card *card, int chan_nums)
 {
 	unsigned long dwValue;
 	char temp = 0;
 	struct pci_dev *pci_dev = NULL;
 
-	pci_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, pci_dev);
+	pci_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, 
+				  pci_dev);
 	if (pci_dev == NULL)
-                return -1;
+		return -1;
 	pci_read_config_byte(pci_dev, 0x59, &temp);
 	temp |= 0x80;
 	pci_write_config_byte(pci_dev, 0x59, temp);
-	
-	pci_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, pci_dev);
- 	if (pci_dev == NULL)
-                return -1;
-	pci_read_config_byte(pci_dev, (int)0xB8, &temp);
+
+	pci_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, 
+				  pci_dev);
+	if (pci_dev == NULL)
+		return -1;
+	pci_read_config_byte(pci_dev, (int) 0xB8, &temp);
 	temp |= 0x20;
-	pci_write_config_byte(pci_dev, (int)0xB8,(u8) temp);
+	pci_write_config_byte(pci_dev, (int) 0xB8, (u8) temp);
 	if (chan_nums == 6) {
 		dwValue = inl(TRID_REG(card, ALI_SCTRL)) | 0x000f0000;
 		outl(dwValue, TRID_REG(card, ALI_SCTRL));
@@ -3424,11 +3552,10 @@
 			ali_ac97_write(card->ac97_codec[0], 0x36, 0);
 			ali_ac97_write(card->ac97_codec[0], 0x38, 0);
 			/*
-			 *	On a board with a single codec you won't get the
-			 *	surround. On other boards configure it.
+			 *      On a board with a single codec you won't get the
+			 *      surround. On other boards configure it.
 			 */
-			if(card->ac97_codec[1]!=NULL)
-			{
+			if (card->ac97_codec[1] != NULL) {
 				ali_ac97_write(card->ac97_codec[1], 0x36, 0);
 				ali_ac97_write(card->ac97_codec[1], 0x38, 0);
 				ali_ac97_write(card->ac97_codec[1], 0x02, 0x0606);
@@ -3441,7 +3568,8 @@
 	return -EINVAL;
 }
 
-static void ali_free_pcm_channel(struct trident_card *card, unsigned int channel)
+static void
+ali_free_pcm_channel(struct trident_card *card, unsigned int channel)
 {
 	int bank;
 
@@ -3454,165 +3582,180 @@
 	card->banks[bank].bitmap &= ~(1 << (channel));
 }
 
-static int ali_allocate_other_states_resources(struct trident_state *state, int chan_nums)
+static int
+ali_allocate_other_states_resources(struct trident_state *state, int chan_nums)
 {
 	struct trident_card *card = state->card;
 	struct trident_state *s;
 	int i, state_count = 0;
 	struct trident_pcm_bank *bank;
 	struct trident_channel *channel;
-	
+	unsigned long num;
+
 	bank = &card->banks[BANK_A];
-	
-	if (chan_nums == 6) {
-		for(i = 0;(i < ALI_CHANNELS) && (state_count != 4); i++) {
-			if (!card->states[i]) {
-				if (!(bank->bitmap & (1 << ali_multi_channels_5_1[state_count]))) {
-					bank->bitmap |= (1 << ali_multi_channels_5_1[state_count]);
-					channel = &bank->channels[ali_multi_channels_5_1[state_count]];
-					channel->num = ali_multi_channels_5_1[state_count];
-				}
-				else {
-					state_count--;
-					for (; state_count >= 0; state_count--) {
-						kfree(state->other_states[state_count]);
-						ali_free_pcm_channel(card, ali_multi_channels_5_1[state_count]);
-					}
-					return -EBUSY;
-				}
-				s = card->states[i] = (struct trident_state *)
-						kmalloc(sizeof(struct trident_state), GFP_KERNEL);
-				if (!s) {
-					ali_free_pcm_channel(card, ali_multi_channels_5_1[state_count]);
-					state_count--;
-					for (; state_count >= 0; state_count--) {						
-						ali_free_pcm_channel(card, ali_multi_channels_5_1[state_count]);
-						kfree(state->other_states[state_count]);
-					}
-					return -ENOMEM;
-				}
-				memset(s, 0, sizeof(struct trident_state));
-				
-				s->dmabuf.channel = channel;
-				s->dmabuf.ossfragshift = s->dmabuf.ossmaxfrags = s->dmabuf.subdivision = 0;
-				init_waitqueue_head(&s->dmabuf.wait);
-				s->magic = card->magic;
-				s->card = card;
-				s->virt = i;
-				ali_enable_special_channel(s);
-				state->other_states[state_count++] = s;
+
+	if (chan_nums != 6)
+		return 0;
+
+	for (i = 0; (i < ALI_CHANNELS) && (state_count != 4); i++) {
+		if (card->states[i])
+			continue;
+
+		num = ali_multi_channels_5_1[state_count];
+		if (!(bank->bitmap & (1 << num))) {
+			bank->bitmap |= 1 << num;
+			channel = &bank->channels[num];
+			channel->num = num;
+		} else {
+			state_count--;
+			for (; state_count >= 0; state_count--) {
+				kfree(state->other_states[state_count]);
+				num = ali_multi_channels_5_1[state_count];
+					ali_free_pcm_channel(card, num);
 			}
+			return -EBUSY;
 		}
-		
-		if (state_count != 4) {
+		s = card->states[i] = kmalloc(sizeof(*state), GFP_KERNEL);
+		if (!s) {
+			num = ali_multi_channels_5_1[state_count];
+			ali_free_pcm_channel(card, num);
 			state_count--;
 			for (; state_count >= 0; state_count--) {
+				num = ali_multi_channels_5_1[state_count];
+				ali_free_pcm_channel(card, num);
 				kfree(state->other_states[state_count]);
-				ali_free_pcm_channel(card, ali_multi_channels_5_1[state_count]);
 			}
-			return -EBUSY;
+			return -ENOMEM;
+		}
+		memset(s, 0, sizeof(*state));
+
+		s->dmabuf.channel = channel;
+		s->dmabuf.ossfragshift = s->dmabuf.ossmaxfrags =
+			s->dmabuf.subdivision = 0;
+		init_waitqueue_head(&s->dmabuf.wait);
+		s->magic = card->magic;
+		s->card = card;
+		s->virt = i;
+		ali_enable_special_channel(s);
+		state->other_states[state_count++] = s;
+	}
+
+	if (state_count != 4) {
+		state_count--;
+		for (; state_count >= 0; state_count--) {
+			kfree(state->other_states[state_count]);
+			num = ali_multi_channels_5_1[state_count];
+			ali_free_pcm_channel(card, num);
 		}
+		return -EBUSY;
 	}
 	return 0;
 }
 
-static void ali_save_regs(struct trident_card *card)
+static void
+ali_save_regs(struct trident_card *card)
 {
 	unsigned long flags;
 	int i, j;
 
-	spin_lock_irqsave(&card->lock, flags); 
+	spin_lock_irqsave(&card->lock, flags);
+
+	ali_registers.global_regs[0x2c] = inl(TRID_REG(card, T4D_MISCINT));
+	//ali_registers.global_regs[0x20] = inl(TRID_REG(card,T4D_START_A));    
+	ali_registers.global_regs[0x21] = inl(TRID_REG(card, T4D_STOP_A));
 
-	ali_registers.global_regs[0x2c] = inl(TRID_REG(card,T4D_MISCINT));
-	//ali_registers.global_regs[0x20] = inl(TRID_REG(card,T4D_START_A));	
-	ali_registers.global_regs[0x21] = inl(TRID_REG(card,T4D_STOP_A));
-	
 	//disable all IRQ bits
 	outl(ALI_DISABLE_ALL_IRQ, TRID_REG(card, T4D_MISCINT));
-	
+
 	for (i = 1; i < ALI_MIXER_REGS; i++)
-		ali_registers.mixer_regs[i] = ali_ac97_read (card->ac97_codec[0], i*2);
-	
-	for (i = 0; i < ALI_GLOBAL_REGS; i++)
-	{	
-		if ((i*4 == T4D_MISCINT) || (i*4 == T4D_STOP_A))
+		ali_registers.mixer_regs[i] = ali_ac97_read(card->ac97_codec[0], 
+							    i * 2);
+
+	for (i = 0; i < ALI_GLOBAL_REGS; i++) {
+		if ((i * 4 == T4D_MISCINT) || (i * 4 == T4D_STOP_A))
 			continue;
-		ali_registers.global_regs[i] = inl(TRID_REG(card, i*4));
+		ali_registers.global_regs[i] = inl(TRID_REG(card, i * 4));
 	}
-	
-	for (i = 0; i < ALI_CHANNELS; i++) 
-	{
-		outb(i,TRID_REG(card, T4D_LFO_GC_CIR));
-		for (j = 0; j < ALI_CHANNEL_REGS; j++) 
-			ali_registers.channel_regs[i][j] = inl(TRID_REG(card, j*4 + 0xe0));
+
+	for (i = 0; i < ALI_CHANNELS; i++) {
+		outb(i, TRID_REG(card, T4D_LFO_GC_CIR));
+		for (j = 0; j < ALI_CHANNEL_REGS; j++)
+			ali_registers.channel_regs[i][j] = inl(TRID_REG(card, 
+									j * 4 + 0xe0));
 	}
 
 	//Stop all HW channel
 	outl(ALI_STOP_ALL_CHANNELS, TRID_REG(card, T4D_STOP_A));
 
-	spin_unlock_irqrestore(&card->lock, flags); 
+	spin_unlock_irqrestore(&card->lock, flags);
 }
 
-static void ali_restore_regs(struct trident_card *card)
+static void
+ali_restore_regs(struct trident_card *card)
 {
 	unsigned long flags;
 	int i, j;
 
-	spin_lock_irqsave(&card->lock, flags); 
-	
+	spin_lock_irqsave(&card->lock, flags);
+
 	for (i = 1; i < ALI_MIXER_REGS; i++)
-		ali_ac97_write(card->ac97_codec[0], i*2, ali_registers.mixer_regs[i]);
-	
-	for (i = 0; i < ALI_CHANNELS; i++) 
-	{
-		outb(i,TRID_REG(card, T4D_LFO_GC_CIR));
-		for (j = 0; j < ALI_CHANNEL_REGS; j++) 
-			outl(ali_registers.channel_regs[i][j], TRID_REG(card, j*4 + 0xe0));
-	}
-	
-	for (i = 0; i < ALI_GLOBAL_REGS; i++)
-	{	
-		if ((i*4 == T4D_MISCINT) || (i*4 == T4D_STOP_A) || (i*4 == T4D_START_A))
+		ali_ac97_write(card->ac97_codec[0], i * 2, 
+			       ali_registers.mixer_regs[i]);
+
+	for (i = 0; i < ALI_CHANNELS; i++) {
+		outb(i, TRID_REG(card, T4D_LFO_GC_CIR));
+		for (j = 0; j < ALI_CHANNEL_REGS; j++)
+			outl(ali_registers.channel_regs[i][j], 
+			     TRID_REG(card, j * 4 + 0xe0));
+	}
+
+	for (i = 0; i < ALI_GLOBAL_REGS; i++) {
+		if ((i * 4 == T4D_MISCINT) || (i * 4 == T4D_STOP_A) || 
+		    (i * 4 == T4D_START_A))
 			continue;
-		outl(ali_registers.global_regs[i], TRID_REG(card, i*4));
+		outl(ali_registers.global_regs[i], TRID_REG(card, i * 4));
 	}
-	
+
 	//start HW channel
-	outl(ali_registers.global_regs[0x20], TRID_REG(card,T4D_START_A));
+	outl(ali_registers.global_regs[0x20], TRID_REG(card, T4D_START_A));
 	//restore IRQ enable bits
-	outl(ali_registers.global_regs[0x2c], TRID_REG(card,T4D_MISCINT));
+	outl(ali_registers.global_regs[0x2c], TRID_REG(card, T4D_MISCINT));
 
-	spin_unlock_irqrestore(&card->lock, flags); 
+	spin_unlock_irqrestore(&card->lock, flags);
 }
 
-static int trident_suspend(struct pci_dev *dev, u32 unused)
+static int
+trident_suspend(struct pci_dev *dev, u32 unused)
 {
-	struct trident_card *card = pci_get_drvdata(dev); 
+	struct trident_card *card = pci_get_drvdata(dev);
 
-	if(card->pci_id == PCI_DEVICE_ID_ALI_5451) {
+	if (card->pci_id == PCI_DEVICE_ID_ALI_5451) {
 		ali_save_regs(card);
 	}
 	return 0;
 }
 
-static int trident_resume(struct pci_dev *dev)
+static int
+trident_resume(struct pci_dev *dev)
 {
-	struct trident_card *card = pci_get_drvdata(dev); 
+	struct trident_card *card = pci_get_drvdata(dev);
 
-	if(card->pci_id == PCI_DEVICE_ID_ALI_5451) {
+	if (card->pci_id == PCI_DEVICE_ID_ALI_5451) {
 		ali_restore_regs(card);
 	}
 	return 0;
 }
 
-static struct trident_channel *ali_alloc_pcm_channel(struct trident_card *card)
+static struct trident_channel *
+ali_alloc_pcm_channel(struct trident_card *card)
 {
 	struct trident_pcm_bank *bank;
 	int idx;
 
 	bank = &card->banks[BANK_A];
-	
-	if (inl(TRID_REG(card, ALI_GLOBAL_CONTROL)) & (ALI_SPDIF_OUT_CH_ENABLE)) {
+
+	if (inl(TRID_REG(card, ALI_GLOBAL_CONTROL)) & 
+	    (ALI_SPDIF_OUT_CH_ENABLE)) {
 		idx = ALI_SPDIF_OUT_CHANNEL;
 		if (!(bank->bitmap & (1 << idx))) {
 			struct trident_channel *channel = &bank->channels[idx];
@@ -3621,8 +3764,9 @@
 			return channel;
 		}
 	}
-	
-	for (idx = ALI_PCM_OUT_CHANNEL_FIRST; idx <= ALI_PCM_OUT_CHANNEL_LAST ; idx++) {
+
+	for (idx = ALI_PCM_OUT_CHANNEL_FIRST; idx <= ALI_PCM_OUT_CHANNEL_LAST; 
+	     idx++) {
 		if (!(bank->bitmap & (1 << idx))) {
 			struct trident_channel *channel = &bank->channels[idx];
 			bank->bitmap |= 1 << idx;
@@ -3632,39 +3776,46 @@
 	}
 
 	/* no more free channels avaliable */
-//	printk(KERN_ERR "ali: no more channels available on Bank A.\n");
+#if 0 
+	printk(KERN_ERR "ali: no more channels available on Bank A.\n");
+#endif /* 0 */ 
 	return NULL;
 }
 
-static struct trident_channel *ali_alloc_rec_pcm_channel(struct trident_card *card)
+static struct trident_channel *
+ali_alloc_rec_pcm_channel(struct trident_card *card)
 {
 	struct trident_pcm_bank *bank;
 	int idx;
-	
+
 	if (inl(TRID_REG(card, ALI_GLOBAL_CONTROL)) & ALI_SPDIF_IN_SUPPORT)
 		idx = ALI_SPDIF_IN_CHANNEL;
-	else	idx = ALI_PCM_IN_CHANNEL;
+	else
+		idx = ALI_PCM_IN_CHANNEL;
 
 	bank = &card->banks[BANK_A];
-	
+
 	if (!(bank->bitmap & (1 << idx))) {
 		struct trident_channel *channel = &bank->channels[idx];
 		bank->bitmap |= 1 << idx;
 		channel->num = idx;
 		return channel;
 	}
-	
+
 	/* no free recordable channels avaliable */
-//	printk(KERN_ERR "ali: no recordable channels available on Bank A.\n");
+#if 0 
+	printk(KERN_ERR "ali: no recordable channels available on Bank A.\n");
+#endif /* 0 */ 
 	return NULL;
 }
 
-static void ali_set_spdif_out_rate(struct trident_card *card, unsigned int rate)
+static void
+ali_set_spdif_out_rate(struct trident_card *card, unsigned int rate)
 {
 	unsigned char ch_st_sel;
 	unsigned short status_rate;
-	
-	switch(rate) {
+
+	switch (rate) {
 	case 44100:
 		status_rate = 0;
 		break;
@@ -3676,28 +3827,30 @@
 		status_rate = 0x200;
 		break;
 	}
-	
-	ch_st_sel = inb(TRID_REG(card, ALI_SPDIF_CTRL)) & ALI_SPDIF_OUT_CH_STATUS;	//select spdif_out
-	
-	ch_st_sel |= 0x80;	//select right
+
+	/* select spdif_out */ 
+	ch_st_sel = inb(TRID_REG(card, ALI_SPDIF_CTRL)) & ALI_SPDIF_OUT_CH_STATUS;
+
+	ch_st_sel |= 0x80;	/* select right */ 
 	outb(ch_st_sel, TRID_REG(card, ALI_SPDIF_CTRL));
 	outb(status_rate | 0x20, TRID_REG(card, ALI_SPDIF_CS + 2));
-	
-	ch_st_sel &= (~0x80);	//select left
+
+	ch_st_sel &= (~0x80);	/* select left */ 
 	outb(ch_st_sel, TRID_REG(card, ALI_SPDIF_CTRL));
 	outw(status_rate | 0x10, TRID_REG(card, ALI_SPDIF_CS + 2));
 }
 
-static void ali_address_interrupt(struct trident_card *card)
+static void
+ali_address_interrupt(struct trident_card *card)
 {
 	int i, channel;
 	struct trident_state *state;
 	u32 mask, channel_mask;
-	
-	mask = trident_get_interrupt_mask (card, 0);
+
+	mask = trident_get_interrupt_mask(card, 0);
 	for (i = 0; i < NR_HW_CH; i++) {
 		if ((state = card->states[i]) == NULL)
-			continue;		
+			continue;
 		channel = state->dmabuf.channel->num;
 		if ((channel_mask = 1 << channel) & mask) {
 			mask &= ~channel_mask;
@@ -3724,37 +3877,41 @@
 depend on a master state's DMA, and changing the counters of the master
 state DMA is protected by a spinlock.
 */
-static int ali_write_5_1(struct trident_state *state,  
-			 const char *buf, int cnt_for_multi_channel, 
-			 unsigned int *copy_count, 
-			 unsigned int *state_cnt)
+static int
+ali_write_5_1(struct trident_state *state, const char *buf, 
+	      int cnt_for_multi_channel, unsigned int *copy_count, 
+	      unsigned int *state_cnt)
 {
-	
+
 	struct dmabuf *dmabuf = &state->dmabuf;
 	struct dmabuf *dmabuf_temp;
 	const char *buffer = buf;
 	unsigned swptr, other_dma_nums, sample_s;
 	unsigned int i, loop;
-	
+
 	other_dma_nums = 4;
 	sample_s = sample_size[dmabuf->fmt] >> 1;
 	swptr = dmabuf->swptr;
 
 	if ((i = state->multi_channels_adjust_count) > 0) {
 		if (i == 1) {
-			if (copy_from_user(dmabuf->rawbuf + swptr, buffer, sample_s))
+			if (copy_from_user(dmabuf->rawbuf + swptr, 
+					   buffer, sample_s))
 				return -EFAULT;
-			seek_offset(swptr, buffer, cnt_for_multi_channel, sample_s, *copy_count);
+			seek_offset(swptr, buffer, cnt_for_multi_channel, 
+				    sample_s, *copy_count);
 			i--;
 			(*state_cnt) += sample_s;
 			state->multi_channels_adjust_count++;
-		}
-		else	i = i - (state->chans_num - other_dma_nums);
+		} else
+			i = i - (state->chans_num - other_dma_nums);
 		for (; (i < other_dma_nums) && (cnt_for_multi_channel > 0); i++) {
 			dmabuf_temp = &state->other_states[i]->dmabuf;
-			if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, buffer, sample_s))
+			if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, 
+					   buffer, sample_s))
 				return -EFAULT;
-			seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, sample_s, *copy_count);
+			seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, 
+				    sample_s, *copy_count);
 		}
 		if (cnt_for_multi_channel == 0)
 			state->multi_channels_adjust_count += i;
@@ -3762,58 +3919,75 @@
 	if (cnt_for_multi_channel > 0) {
 		loop = cnt_for_multi_channel / (state->chans_num * sample_s);
 		for (i = 0; i < loop; i++) {
-			if (copy_from_user(dmabuf->rawbuf + swptr, buffer, sample_s * 2))
+			if (copy_from_user(dmabuf->rawbuf + swptr, buffer, 
+					   sample_s * 2))
 				return -EFAULT;
-			seek_offset(swptr, buffer, cnt_for_multi_channel, sample_s * 2, *copy_count);
+			seek_offset(swptr, buffer, cnt_for_multi_channel, 
+				    sample_s * 2, *copy_count);
 			(*state_cnt) += (sample_s * 2);
-		
+
 			dmabuf_temp = &state->other_states[0]->dmabuf;
-			if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, buffer, sample_s))
+			if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, 
+					   buffer, sample_s))
 				return -EFAULT;
-			seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, sample_s, *copy_count);
-		
+			seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, 
+				    sample_s, *copy_count);
+
 			dmabuf_temp = &state->other_states[1]->dmabuf;
-			if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, buffer, sample_s))
+			if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, 
+					   buffer, sample_s))
 				return -EFAULT;
-			seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, sample_s, *copy_count);
-		
+			seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, 
+				    sample_s, *copy_count);
+
 			dmabuf_temp = &state->other_states[2]->dmabuf;
-			if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, buffer, sample_s))
+			if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, 
+					   buffer, sample_s))
 				return -EFAULT;
-			seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, sample_s, *copy_count);
-				
+			seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, 
+				    sample_s, *copy_count);
+
 			dmabuf_temp = &state->other_states[3]->dmabuf;
-			if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, buffer, sample_s))
+			if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, 
+					   buffer, sample_s))
 				return -EFAULT;
-			seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, sample_s, *copy_count);
+			seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, 
+				    sample_s, *copy_count);
 		}
-		
+
 		if (cnt_for_multi_channel > 0) {
 			state->multi_channels_adjust_count = cnt_for_multi_channel / sample_s;
-			
+
 			if (copy_from_user(dmabuf->rawbuf + swptr, buffer, sample_s))
 				return -EFAULT;
-			seek_offset(swptr, buffer, cnt_for_multi_channel, sample_s, *copy_count);			
+			seek_offset(swptr, buffer, cnt_for_multi_channel, 
+				    sample_s, *copy_count);
 			(*state_cnt) += sample_s;
-			
+
 			if (cnt_for_multi_channel > 0) {
-				if (copy_from_user(dmabuf->rawbuf + swptr, buffer, sample_s))
+				if (copy_from_user(dmabuf->rawbuf + swptr, 
+						   buffer, sample_s))
 					return -EFAULT;
-				seek_offset(swptr, buffer, cnt_for_multi_channel, sample_s, *copy_count);
+				seek_offset(swptr, buffer, cnt_for_multi_channel, 
+					    sample_s, *copy_count);
 				(*state_cnt) += sample_s;
-			
+
 				if (cnt_for_multi_channel > 0) {
-					loop = state->multi_channels_adjust_count - (state->chans_num - other_dma_nums);
+					int diff = state->chans_num - other_dma_nums;
+					loop = state->multi_channels_adjust_count - diff;
 					for (i = 0; i < loop; i++) {
 						dmabuf_temp = &state->other_states[i]->dmabuf;
-						if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, buffer, sample_s))
+						if (copy_from_user(dmabuf_temp->rawbuf + 
+								   dmabuf_temp->swptr, 
+								   buffer, sample_s))
 							return -EFAULT;
-						seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, sample_s, *copy_count);
+						seek_offset(dmabuf_temp->swptr, buffer, 
+							    cnt_for_multi_channel, 
+							    sample_s, *copy_count);
 					}
 				}
 			}
-		}
-		else
+		} else
 			state->multi_channels_adjust_count = 0;
 	}
 	for (i = 0; i < other_dma_nums; i++) {
@@ -3823,15 +3997,16 @@
 	return *state_cnt;
 }
 
-static void ali_free_other_states_resources(struct trident_state *state)
+static void
+ali_free_other_states_resources(struct trident_state *state)
 {
 	int i;
 	struct trident_card *card = state->card;
 	struct trident_state *s;
 	unsigned other_states_count;
-	
-	other_states_count = state->chans_num - 2;	/* except PCM L/R channels*/
-	for ( i = 0; i < other_states_count; i++) {
+
+	other_states_count = state->chans_num - 2; /* except PCM L/R channels */
+	for (i = 0; i < other_states_count; i++) {
 		s = state->other_states[i];
 		dealloc_dmabuf(&s->dmabuf, card->pci_dev);
 		ali_disable_special_channel(s->card, s->dmabuf.channel->num);
@@ -3842,35 +4017,38 @@
 }
 
 struct proc_dir_entry *res;
-static int ali_write_proc(struct file *file, const char *buffer, unsigned long count, void *data)
+static int
+ali_write_proc(struct file *file, const char *buffer, unsigned long count, void *data)
 {
-	struct trident_card *card = (struct trident_card *)data;
+	struct trident_card *card = (struct trident_card *) data;
 	unsigned long flags;
 	char c;
 
-	if (count<0)
+	if (count < 0)
 		return -EINVAL;
 	if (count == 0)
 		return 0;
 	if (get_user(c, buffer))
 		return -EFAULT;
-	
+
 	spin_lock_irqsave(&card->lock, flags);
 	switch (c) {
-	    case '0':
+	case '0':
 		ali_setup_spdif_out(card, ALI_PCM_TO_SPDIF_OUT);
 		ali_disable_special_channel(card, ALI_SPDIF_OUT_CHANNEL);
 		break;
-	    case '1':
-		ali_setup_spdif_out(card, ALI_SPDIF_OUT_TO_SPDIF_OUT|ALI_SPDIF_OUT_PCM);
+	case '1':
+		ali_setup_spdif_out(card, ALI_SPDIF_OUT_TO_SPDIF_OUT | 
+				    ALI_SPDIF_OUT_PCM);
+		break;
+	case '2':
+		ali_setup_spdif_out(card, ALI_SPDIF_OUT_TO_SPDIF_OUT | 
+				    ALI_SPDIF_OUT_NON_PCM);
 		break;
-	    case '2':
-		ali_setup_spdif_out(card, ALI_SPDIF_OUT_TO_SPDIF_OUT|ALI_SPDIF_OUT_NON_PCM);
-		break;
-	    case '3':
+	case '3':
 		ali_disable_spdif_in(card);	//default
 		break;
-	    case '4':
+	case '4':
 		ali_setup_spdif_in(card);
 		break;
 	}
@@ -3880,7 +4058,8 @@
 }
 
 /* OSS /dev/mixer file operation methods */
-static int trident_open_mixdev(struct inode *inode, struct file *file)
+static int
+trident_open_mixdev(struct inode *inode, struct file *file)
 {
 	int i = 0;
 	int minor = iminor(inode);
@@ -3888,45 +4067,47 @@
 
 	for (card = devs; card != NULL; card = card->next)
 		for (i = 0; i < NR_AC97; i++)
-			if (card->ac97_codec[i] != NULL &&
+			if (card->ac97_codec[i] != NULL && 
 			    card->ac97_codec[i]->dev_mixer == minor)
 				goto match;
 
 	if (!card) {
 		return -ENODEV;
 	}
- match:
+      match:
 	file->private_data = card->ac97_codec[i];
 
-
 	return 0;
 }
 
-static int trident_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int cmd,
-				unsigned long arg)
+static int
+trident_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int cmd, 
+		     unsigned long arg)
 {
-	struct ac97_codec *codec = (struct ac97_codec *)file->private_data;
+	struct ac97_codec *codec = (struct ac97_codec *) file->private_data;
 
 	return codec->mixer_ioctl(codec, cmd, arg);
 }
 
-static /*const*/ struct file_operations trident_mixer_fops = {
-	.owner		= THIS_MODULE,
-	.llseek		= no_llseek,
-	.ioctl		= trident_ioctl_mixdev,
-	.open		= trident_open_mixdev,
+static /*const */ struct file_operations trident_mixer_fops = {
+	.owner = THIS_MODULE,
+	.llseek = no_llseek,
+	.ioctl = trident_ioctl_mixdev,
+	.open = trident_open_mixdev,
 };
 
-static int ali_reset_5451(struct trident_card *card)
+static int
+ali_reset_5451(struct trident_card *card)
 {
 	struct pci_dev *pci_dev = NULL;
-	unsigned int   dwVal;
+	unsigned int dwVal;
 	unsigned short wCount, wReg;
 
-	pci_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, pci_dev);
+	pci_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, 
+				  pci_dev);
 	if (pci_dev == NULL)
 		return -1;
-	
+
 	pci_read_config_dword(pci_dev, 0x7c, &dwVal);
 	pci_write_config_dword(pci_dev, 0x7c, dwVal | 0x08000000);
 	udelay(5000);
@@ -3945,10 +4126,12 @@
 	pci_write_config_dword(pci_dev, 0x44, dwVal & 0xfffbffff);
 	udelay(5000);
 
+	/* TODO: recognize if we have a PM capable codec and only do this */
+	/* if the codec is PM capable */
 	wCount = 2000;
-	while(wCount--) {
+	while (wCount--) {
 		wReg = ali_ac97_get(card, 0, AC97_POWER_CONTROL);
-		if((wReg & 0x000f) == 0x000f)
+		if ((wReg & 0x000f) == 0x000f)
 			return 0;
 		udelay(5000);
 	}
@@ -3957,33 +4140,32 @@
 }
 
 /* AC97 codec initialisation. */
-static int __devinit trident_ac97_init(struct trident_card *card)
+static int __devinit
+trident_ac97_init(struct trident_card *card)
 {
 	int num_ac97 = 0;
 	unsigned long ready_2nd = 0;
 	struct ac97_codec *codec;
 	int i = 0;
-	
 
 	/* initialize controller side of AC link, and find out if secondary codes
 	   really exist */
-	switch (card->pci_id)
-	{
+	switch (card->pci_id) {
 	case PCI_DEVICE_ID_ALI_5451:
-		if (ali_reset_5451(card)) 
-		{
-			printk(KERN_ERR "trident_ac97_init: error resetting 5451.\n");
+		if (ali_reset_5451(card)) {
+			printk(KERN_ERR "trident_ac97_init: error "
+			       "resetting 5451.\n");
 			return -1;
 		}
-		outl(0x80000001,TRID_REG(card, ALI_GLOBAL_CONTROL));
-		outl(0x00000000,TRID_REG(card, T4D_AINTEN_A));
-		outl(0xffffffff,TRID_REG(card, T4D_AINT_A));
-		outl(0x00000000,TRID_REG(card, T4D_MUSICVOL_WAVEVOL));
-		outb(0x10,	TRID_REG(card, ALI_MPUR2));
+		outl(0x80000001, TRID_REG(card, ALI_GLOBAL_CONTROL));
+		outl(0x00000000, TRID_REG(card, T4D_AINTEN_A));
+		outl(0xffffffff, TRID_REG(card, T4D_AINT_A));
+		outl(0x00000000, TRID_REG(card, T4D_MUSICVOL_WAVEVOL));
+		outb(0x10, TRID_REG(card, ALI_MPUR2));
 		ready_2nd = inl(TRID_REG(card, ALI_SCTRL));
 		ready_2nd &= 0x3fff;
 		outl(ready_2nd | PCMOUT | 0x8000, TRID_REG(card, ALI_SCTRL));
-		ready_2nd = inl(TRID_REG(card, ALI_SCTRL)); 
+		ready_2nd = inl(TRID_REG(card, ALI_SCTRL));
 		ready_2nd &= SI_AC97_SECONDARY_READY;
 		if (card->revision < ALI_5451_V02)
 			ready_2nd = 0;
@@ -3992,10 +4174,10 @@
 		/* disable AC97 GPIO interrupt */
 		outl(0x00, TRID_REG(card, SI_AC97_GPIO));
 		/* when power up the AC link is in cold reset mode so stop it */
-		outl(PCMOUT|SURROUT|CENTEROUT|LFEOUT|SECONDARY_ID,
+		outl(PCMOUT | SURROUT | CENTEROUT | LFEOUT | SECONDARY_ID, 
 		     TRID_REG(card, SI_SERIAL_INTF_CTRL));
-		/* it take a long time to recover from a cold reset (especially when you have
-		   more than one codec) */
+		/* it take a long time to recover from a cold reset */ 
+		/* (especially when you have more than one codec) */
 		udelay(2000);
 		ready_2nd = inl(TRID_REG(card, SI_SERIAL_INTF_CTRL));
 		ready_2nd &= SI_AC97_SECONDARY_READY;
@@ -4014,10 +4196,10 @@
 		/* disable AC97 GPIO interrupt */
 		outl(0x00, TRID_REG(card, SI_AC97_GPIO));
 		/* when power up, the AC link is in cold reset mode, so stop it */
-		outl(PCMOUT|SURROUT|CENTEROUT|LFEOUT,
+		outl(PCMOUT | SURROUT | CENTEROUT | LFEOUT, 
 		     TRID_REG(card, SI_SERIAL_INTF_CTRL));
-		/* it take a long time to recover from a cold reset (especially when you have
-		   more than one codec) */
+		/* it take a long time to recover from a cold reset (especially */ 
+		/* when you have more than one codec) */
 		udelay(2000);
 		ready_2nd = inl(TRID_REG(card, SI_SERIAL_INTF_CTRL));
 		ready_2nd &= SI_AC97_SECONDARY_READY;
@@ -4028,24 +4210,24 @@
 		if ((codec = ac97_alloc_codec()) == NULL)
 			return -ENOMEM;
 
-		/* initialize some basic codec information, other fields will be filled
-		   in ac97_probe_codec */
+		/* initialize some basic codec information, other fields */ 
+		/* will be filled in ac97_probe_codec */
 		codec->private_data = card;
 		codec->id = num_ac97;
 
 		if (card->pci_id == PCI_DEVICE_ID_ALI_5451) {
 			codec->codec_read = ali_ac97_read;
 			codec->codec_write = ali_ac97_write;
-		}
-		else {
+		} else {
 			codec->codec_read = trident_ac97_get;
 			codec->codec_write = trident_ac97_set;
 		}
-	
+
 		if (ac97_probe_codec(codec) == 0)
 			break;
 
-		if ((codec->dev_mixer = register_sound_mixer(&trident_mixer_fops, -1)) < 0) {
+		codec->dev_mixer = register_sound_mixer(&trident_mixer_fops, -1);
+		if (codec->dev_mixer < 0) {
 			printk(KERN_ERR "trident: couldn't register mixer!\n");
 			ac97_release_codec(codec);
 			break;
@@ -4062,65 +4244,73 @@
 		for (num_ac97 = 0; num_ac97 < NR_AC97; num_ac97++) {
 			if (card->ac97_codec[num_ac97] == NULL)
 				break;
-			for (i=0; i<64;i++)
-				card->mixer_regs[i][num_ac97] = ali_ac97_get(card, num_ac97,i*2);
+			for (i = 0; i < 64; i++) {
+				u16 reg = ali_ac97_get(card, num_ac97, i * 2);
+				card->mixer_regs[i][num_ac97] = reg;
+			}
 		}
 	}
-	return num_ac97+1;
+	return num_ac97 + 1;
 }
 
 /* Gameport functions for the cards ADC gameport */
 
-static unsigned char trident_game_read(struct gameport *gameport)
+static unsigned char
+trident_game_read(struct gameport *gameport)
 {
 	struct trident_card *card = gameport->driver;
 	return inb(TRID_REG(card, T4D_GAME_LEG));
 }
 
-static void trident_game_trigger(struct gameport *gameport)
+static void
+trident_game_trigger(struct gameport *gameport)
 {
 	struct trident_card *card = gameport->driver;
 	outb(0xff, TRID_REG(card, T4D_GAME_LEG));
 }
 
-static int trident_game_cooked_read(struct gameport *gameport, int *axes, int *buttons)
+static int
+trident_game_cooked_read(struct gameport *gameport, int *axes, int *buttons)
 {
-        struct trident_card *card = gameport->driver;
+	struct trident_card *card = gameport->driver;
 	int i;
 
 	*buttons = (~inb(TRID_REG(card, T4D_GAME_LEG)) >> 4) & 0xf;
 
 	for (i = 0; i < 4; i++) {
-		axes[i] = inw(TRID_REG(card, T4D_GAME_AXD) + i * sizeof(u16));
-		if (axes[i] == 0xffff) axes[i] = -1;
+		axes[i] = inw(TRID_REG(card, T4D_GAME_AXD) + i * sizeof (u16));
+		if (axes[i] == 0xffff)
+			axes[i] = -1;
 	}
-        
-        return 0;
+
+	return 0;
 }
 
-static int trident_game_open(struct gameport *gameport, int mode)
+static int
+trident_game_open(struct gameport *gameport, int mode)
 {
 	struct trident_card *card = gameport->driver;
 
 	switch (mode) {
-		case GAMEPORT_MODE_COOKED:
-			outb(0x80, TRID_REG(card, T4D_GAME_CR));
-			wait_ms(20);
-			return 0;
-		case GAMEPORT_MODE_RAW:
-			outb(0x00, TRID_REG(card, T4D_GAME_CR));
-			return 0;
-		default:
-			return -1;
+	case GAMEPORT_MODE_COOKED:
+		outb(0x80, TRID_REG(card, T4D_GAME_CR));
+		wait_ms(20);
+		return 0;
+	case GAMEPORT_MODE_RAW:
+		outb(0x00, TRID_REG(card, T4D_GAME_CR));
+		return 0;
+	default:
+		return -1;
 	}
 
 	return 0;
 }
 
-
-/* install the driver, we do not allocate hardware channel nor DMA buffer now, they are defered 
-   until "ACCESS" time (in prog_dmabuf called by open/read/write/ioctl/mmap) */
-static int __devinit trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id)
+/* install the driver, we do not allocate hardware channel nor DMA buffer */ 
+/* now, they are defered until "ACCESS" time (in prog_dmabuf called by */ 
+/* open/read/write/ioctl/mmap) */
+static int __devinit
+trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id)
 {
 	unsigned long iobase;
 	struct trident_card *card;
@@ -4140,9 +4330,9 @@
 	else
 		dma_mask = TRIDENT_DMA_MASK;
 	if (pci_set_dma_mask(pci_dev, dma_mask)) {
-		printk(KERN_ERR "trident: architecture does not support"
-		       " %s PCI busmaster DMA\n",
-		       pci_dev->device == PCI_DEVICE_ID_ALI_5451 ?
+		printk(KERN_ERR "trident: architecture does not support" 
+		       " %s PCI busmaster DMA\n", 
+		       pci_dev->device == PCI_DEVICE_ID_ALI_5451 ? 
 		       "32-bit" : "30-bit");
 		goto out;
 	}
@@ -4154,17 +4344,17 @@
 		iobase = pci_resource_start(pci_dev, 0);
 
 	if (!request_region(iobase, 256, card_names[pci_id->driver_data])) {
-		printk(KERN_ERR "trident: can't allocate I/O space at 0x%4.4lx\n",
-		       iobase);
+		printk(KERN_ERR "trident: can't allocate I/O space at "
+		       "0x%4.4lx\n", iobase);
 		goto out;
 	}
 
 	rc = -ENOMEM;
-	if ((card = kmalloc(sizeof(struct trident_card), GFP_KERNEL)) == NULL) {
+	if ((card = kmalloc(sizeof(*card), GFP_KERNEL)) == NULL) {
 		printk(KERN_ERR "trident: out of memory\n");
 		goto out_release_region;
 	}
-	memset(card, 0, sizeof(*card));
+	memset(card, 0, sizeof (*card));
 
 	init_timer(&card->timer);
 	card->iobase = iobase;
@@ -4194,15 +4384,15 @@
 
 	pci_set_master(pci_dev);
 
-	printk(KERN_INFO "trident: %s found at IO 0x%04lx, IRQ %d\n",
+	printk(KERN_INFO "trident: %s found at IO 0x%04lx, IRQ %d\n", 
 	       card_names[pci_id->driver_data], card->iobase, card->irq);
 
-	if(card->pci_id == PCI_DEVICE_ID_ALI_5451) {
-		/* ALi channel Management */	
+	if (card->pci_id == PCI_DEVICE_ID_ALI_5451) {
+		/* ALi channel Management */
 		card->alloc_pcm_channel = ali_alloc_pcm_channel;
 		card->alloc_rec_pcm_channel = ali_alloc_rec_pcm_channel;
 		card->free_pcm_channel = ali_free_pcm_channel;
-		
+
 		card->address_interrupt = ali_address_interrupt;
 
 		/* Added by Matt Wu 01-05-2001 for spdif in */
@@ -4210,8 +4400,8 @@
 		card->rec_channel_use_count = 0;
 
 		/* ALi SPDIF OUT function */
-		if(card->revision == ALI_5451_V02) {
-			ali_setup_spdif_out(card, ALI_PCM_TO_SPDIF_OUT);		
+		if (card->revision == ALI_5451_V02) {
+			ali_setup_spdif_out(card, ALI_PCM_TO_SPDIF_OUT);
 			res = create_proc_entry("ALi5451", 0, NULL);
 			if (res) {
 				res->write_proc = ali_write_proc;
@@ -4221,32 +4411,29 @@
 
 		/* Add H/W Volume Control By Matt Wu Jul. 06, 2001 */
 		card->hwvolctl = 0;
-		pci_dev_m1533 = pci_find_device(PCI_VENDOR_ID_AL,PCI_DEVICE_ID_AL_M1533, pci_dev_m1533);
+		pci_dev_m1533 = pci_find_device(PCI_VENDOR_ID_AL, 
+						PCI_DEVICE_ID_AL_M1533, 
+						pci_dev_m1533);
 		rc = -ENODEV;
 		if (pci_dev_m1533 == NULL)
 			goto out_proc_fs;
 		pci_read_config_byte(pci_dev_m1533, 0x63, &bits);
-		if (bits & (1<<5))
+		if (bits & (1 << 5))
 			card->hwvolctl = 1;
-		if (card->hwvolctl) 
-		{
+		if (card->hwvolctl) {
 			/* Clear m1533 pci cfg 78h bit 30 to zero, which makes
 			   GPIO11/12/13 work as ACGP_UP/DOWN/MUTE. */
 			pci_read_config_byte(pci_dev_m1533, 0x7b, &bits);
-			bits &= 0xbf; /*clear bit 6 */
+			bits &= 0xbf;	/*clear bit 6 */
 			pci_write_config_byte(pci_dev_m1533, 0x7b, bits);
 		}
-	}
-	else if(card->pci_id == PCI_DEVICE_ID_INTERG_5050)
-	{
+	} else if (card->pci_id == PCI_DEVICE_ID_INTERG_5050) {
 		card->alloc_pcm_channel = cyber_alloc_pcm_channel;
 		card->alloc_rec_pcm_channel = cyber_alloc_pcm_channel;
 		card->free_pcm_channel = cyber_free_pcm_channel;
 		card->address_interrupt = cyber_address_interrupt;
 		cyber_init_ritual(card);
-	}
-	else
-	{
+	} else {
 		card->alloc_pcm_channel = trident_alloc_pcm_channel;
 		card->alloc_rec_pcm_channel = trident_alloc_pcm_channel;
 		card->free_pcm_channel = trident_free_pcm_channel;
@@ -4255,9 +4442,10 @@
 
 	/* claim our irq */
 	rc = -ENODEV;
-	if (request_irq(card->irq, &trident_interrupt, SA_SHIRQ,
+	if (request_irq(card->irq, &trident_interrupt, SA_SHIRQ, 
 			card_names[pci_id->driver_data], card)) {
-		printk(KERN_ERR "trident: unable to allocate irq %d\n", card->irq);
+		printk(KERN_ERR "trident: unable to allocate irq %d\n", 
+		       card->irq);
 		goto out_proc_fs;
 	}
 	/* register /dev/dsp */
@@ -4271,8 +4459,9 @@
 		/* unregister audio devices */
 		for (i = 0; i < NR_AC97; i++) {
 			if (card->ac97_codec[i] != NULL) {
-				unregister_sound_mixer(card->ac97_codec[i]->dev_mixer);
-				ac97_release_codec(card->ac97_codec[i]);
+				struct ac97_codec* codec = card->ac97_codec[i];
+				unregister_sound_mixer(codec->dev_mixer);
+				ac97_release_codec(codec);
 			}
 		}
 		goto out_unregister_sound_dsp;
@@ -4282,35 +4471,36 @@
 
 	if (card->pci_id == PCI_DEVICE_ID_ALI_5451) {
 		/* Add H/W Volume Control By Matt Wu Jul. 06, 2001 */
-		if(card->hwvolctl) 
-		{
-			/* Enable GPIO IRQ (MISCINT bit 18h)*/
+		if (card->hwvolctl) {
+			/* Enable GPIO IRQ (MISCINT bit 18h) */
 			temp = inw(TRID_REG(card, T4D_MISCINT + 2));
 			temp |= 0x0004;
 			outw(temp, TRID_REG(card, T4D_MISCINT + 2));
 
-			/* Enable H/W Volume Control GLOVAL CONTROL bit 0*/
+			/* Enable H/W Volume Control GLOVAL CONTROL bit 0 */
 			temp = inw(TRID_REG(card, ALI_GLOBAL_CONTROL));
 			temp |= 0x0001;
 			outw(temp, TRID_REG(card, ALI_GLOBAL_CONTROL));
 
 		}
-		if(card->revision == ALI_5451_V02)
+		if (card->revision == ALI_5451_V02)
 			ali_close_multi_channels();
 		/* edited by HMSEO for GT sound */
 #if defined(CONFIG_ALPHA_NAUTILUS) || defined(CONFIG_ALPHA_GENERIC)
 		{
 			u16 ac97_data;
 			extern struct hwrpb_struct *hwrpb;
-		
+
 			if ((hwrpb->sys_type) == 201) {
-				printk(KERN_INFO "trident: Running on Alpha system type Nautilus\n");
+				printk(KERN_INFO "trident: Running on Alpha system "
+				       "type Nautilus\n");
 				ac97_data = ali_ac97_get(card, 0, AC97_POWER_CONTROL);
-				ali_ac97_set(card, 0, AC97_POWER_CONTROL, ac97_data | ALI_EAPD_POWER_DOWN);
+				ali_ac97_set(card, 0, AC97_POWER_CONTROL, 
+					     ac97_data | ALI_EAPD_POWER_DOWN);
 			}
 		}
-#endif /* CONFIG_ALPHA_NAUTILUS || CONFIG_ALPHA_GENERIC */ 
-		/* edited by HMSEO for GT sound*/
+#endif				/* CONFIG_ALPHA_NAUTILUS || CONFIG_ALPHA_GENERIC */
+		/* edited by HMSEO for GT sound */
 	}
 	rc = 0;
 	pci_set_drvdata(pci_dev, card);
@@ -4321,7 +4511,9 @@
 	/* Register gameport */
 	gameport_register_port(&card->gameport);
 
-out:	return rc;
+out:
+	return rc;
+
 out_unregister_sound_dsp:
 	unregister_sound_dsp(card->dev_audio);
 out_free_irq:
@@ -4335,26 +4527,27 @@
 	devs = NULL;
 out_release_region:
 	release_region(iobase, 256);
-	goto out;
+	return rc; 
 }
 
-static void __devexit trident_remove(struct pci_dev *pci_dev)
+static void __devexit
+trident_remove(struct pci_dev *pci_dev)
 {
 	int i;
 	struct trident_card *card = pci_get_drvdata(pci_dev);
 
 	/*
- 	 *	Kill running timers before unload. We can't have them
- 	 *	going off after rmmod!
- 	 */
-	if(card->hwvolctl)
+	 *      Kill running timers before unload. We can't have them
+	 *      going off after rmmod!
+	 */
+	if (card->hwvolctl)
 		del_timer_sync(&card->timer);
-		
+
 	/* ALi S/PDIF and Power Management */
-	if(card->pci_id == PCI_DEVICE_ID_ALI_5451) {
+	if (card->pci_id == PCI_DEVICE_ID_ALI_5451) {
 		ali_setup_spdif_out(card, ALI_PCM_TO_SPDIF_OUT);
-                ali_disable_special_channel(card, ALI_SPDIF_OUT_CHANNEL);
-                ali_disable_spdif_in(card);
+		ali_disable_special_channel(card, ALI_SPDIF_OUT_CHANNEL);
+		ali_disable_spdif_in(card);
 		remove_proc_entry("ALi5451", NULL);
 	}
 
@@ -4381,36 +4574,38 @@
 	pci_set_drvdata(pci_dev, NULL);
 }
 
-MODULE_AUTHOR("Alan Cox, Aaron Holtzman, Ollie Lho, Ching Ling Lee");
-MODULE_DESCRIPTION("Trident 4DWave/SiS 7018/ALi 5451 and Tvia/IGST CyberPro5050 PCI Audio Driver");
+MODULE_AUTHOR("Alan Cox, Aaron Holtzman, Ollie Lho, Ching Ling Lee, Muli Ben-Yehuda");
+MODULE_DESCRIPTION("Trident 4DWave/SiS 7018/ALi 5451 and Tvia/IGST CyberPro5050 PCI "
+		   "Audio Driver");
 MODULE_LICENSE("GPL");
 
-
 #define TRIDENT_MODULE_NAME "trident"
 
 static struct pci_driver trident_pci_driver = {
-	.name		= TRIDENT_MODULE_NAME,
-	.id_table	= trident_pci_tbl,
-	.probe		= trident_probe,
-	.remove		= __devexit_p(trident_remove),
-	.suspend	= trident_suspend,
-	.resume		= trident_resume
+	.name = TRIDENT_MODULE_NAME,
+	.id_table = trident_pci_tbl,
+	.probe = trident_probe,
+	.remove = __devexit_p(trident_remove),
+	.suspend = trident_suspend,
+	.resume = trident_resume
 };
 
-static int __init trident_init_module (void)
+static int __init
+trident_init_module(void)
 {
-	printk(KERN_INFO "Trident 4DWave/SiS 7018/ALi 5451,Tvia CyberPro "
-	       "5050 PCI Audio, version " DRIVER_VERSION ", " 
-	       __TIME__ " " __DATE__ "\n");
+	printk(KERN_INFO "Trident 4DWave/SiS 7018/ALi 5451,Tvia CyberPro " 
+	       "5050 PCI Audio, version " DRIVER_VERSION ", " __TIME__ " " 
+	       __DATE__ "\n");
 
 	if (!pci_register_driver(&trident_pci_driver)) {
 		pci_unregister_driver(&trident_pci_driver);
-                return -ENODEV;
+		return -ENODEV;
 	}
 	return 0;
 }
 
-static void __exit trident_cleanup_module (void)
+static void __exit
+trident_cleanup_module(void)
 {
 	pci_unregister_driver(&trident_pci_driver);
 }
diff -Nru a/sound/oss/trident.h b/sound/oss/trident.h
--- a/sound/oss/trident.h	Tue Feb  3 19:45:16 2004
+++ b/sound/oss/trident.h	Tue Feb  3 19:45:16 2004
@@ -56,11 +56,6 @@
 #define PCI_DEVICE_ID_ALI_1533		0x1533
 #endif
 
-#ifndef FALSE
-#define FALSE 		0
-#define TRUE  		1
-#endif
-
 #define CHANNEL_REGS	5
 #define CHANNEL_START	0xe0   // The first bytes of the contiguous register space.
 
@@ -359,17 +354,5 @@
 		r++;
 	return r;
 }
-
-#ifdef DEBUG
-
-#define TRDBG(msg, args...) do {          \
-        printk(KERN_DEBUG msg , ##args ); \
-} while (0)
-
-#else /* !defined(DEBUG) */ 
-
-#define TRDBG(msg, args...) do { } while (0)
-
-#endif /* DEBUG */ 
 
 #endif /* __TRID4DWAVE_H */
diff -Nru a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
--- a/sound/pci/intel8x0.c	Tue Feb  3 19:45:30 2004
+++ b/sound/pci/intel8x0.c	Tue Feb  3 19:45:30 2004
@@ -2591,6 +2591,7 @@
 			break;
 		}
 	}
+	card->dev = &pci->dev;
 
 	if ((err = snd_intel8x0_create(card, pci, pci_id->driver_data, &chip)) < 0) {
 		snd_card_free(card);
diff -Nru a/sound/pcmcia/vx/vx_entry.c b/sound/pcmcia/vx/vx_entry.c
--- a/sound/pcmcia/vx/vx_entry.c	Tue Feb  3 19:45:16 2004
+++ b/sound/pcmcia/vx/vx_entry.c	Tue Feb  3 19:45:16 2004
@@ -38,9 +38,9 @@
 {
 	if (link->state & DEV_CONFIG) {
 		/* release cs resources */
-		CardServices(ReleaseConfiguration, link->handle);
-		CardServices(ReleaseIO, link->handle, &link->io);
-		CardServices(ReleaseIRQ, link->handle, &link->irq);
+		pcmcia_release_configuration(link->handle);
+		pcmcia_release_io(link->handle, &link->io);
+		pcmcia_release_irq(link->handle, &link->irq);
 		link->state &= ~DEV_CONFIG;
 	}
 }
@@ -58,7 +58,7 @@
 
 	/* Break the link with Card Services */
 	if (link->handle)
-		CardServices(DeregisterClient, link->handle);
+		pcmcia_deregister_client(link->handle);
 
 	hw = vxp->hw_entry;
 	if (hw)
@@ -170,7 +170,7 @@
 	client_reg.Version = 0x0210;
 	client_reg.event_callback_args.client_data = link;
 
-	ret = CardServices(RegisterClient, &link->handle, &client_reg);
+	ret = pcmcia_register_client(&link->handle, &client_reg);
 	if (ret != CS_SUCCESS) {
 		cs_error(link->handle, RegisterClient, ret);
 		snd_vxpocket_detach(hw, link);
@@ -253,8 +253,8 @@
  * configuration callback
  */
 
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
 static void vxpocket_config(dev_link_t *link)
 {
@@ -274,21 +274,21 @@
 	tuple.TupleDataMax = sizeof(buf);
 	tuple.TupleOffset = 0;
 	tuple.DesiredTuple = CISTPL_CONFIG;
-	CS_CHECK(GetFirstTuple, handle, &tuple);
-	CS_CHECK(GetTupleData, handle, &tuple);
-	CS_CHECK(ParseTuple, handle, &tuple, &parse);
+	CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+	CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+	CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
 	link->conf.ConfigBase = parse.config.base;
 	link->conf.ConfigIndex = 1;
 
-	CS_CHECK(GetConfigurationInfo, handle, &conf);
+	CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf));
 	link->conf.Vcc = conf.Vcc;
 
 	/* Configure card */
 	link->state |= DEV_CONFIG;
 
-	CS_CHECK(RequestIO, handle, &link->io);
-	CS_CHECK(RequestIRQ, link->handle, &link->irq);
-	CS_CHECK(RequestConfiguration, link->handle, &link->conf);
+	CS_CHECK(RequestIO, pcmcia_request_io(handle, &link->io));
+	CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));
+	CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));
 
 	if (snd_vxpocket_assign_resources(chip, link->io.BasePort1, link->irq.AssignedIRQ) < 0)
 		goto failed;
@@ -300,9 +300,9 @@
 cs_failed:
 	cs_error(link->handle, last_fn, last_ret);
 failed:
-	CardServices(ReleaseConfiguration, link->handle);
-	CardServices(ReleaseIO, link->handle, &link->io);
-	CardServices(ReleaseIRQ, link->handle, &link->irq);
+	pcmcia_release_configuration(link->handle);
+	pcmcia_release_io(link->handle, &link->io);
+	pcmcia_release_irq(link->handle, &link->irq);
 }
 
 
@@ -339,7 +339,7 @@
 	case CS_EVENT_RESET_PHYSICAL:
 		snd_printdd(KERN_DEBUG "RESET_PHYSICAL\n");
 		if (link->state & DEV_CONFIG)
-			CardServices(ReleaseConfiguration, link->handle);
+			pcmcia_release_configuration(link->handle);
 		break;
 	case CS_EVENT_PM_RESUME:
 		snd_printdd(KERN_DEBUG "RESUME\n");
@@ -350,7 +350,7 @@
 		if (DEV_OK(link)) {
 			//struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip;
 			snd_printdd(KERN_DEBUG "requestconfig...\n");
-			CardServices(RequestConfiguration, link->handle, &link->conf);
+			pcmcia_request_configuration(link->handle, &link->conf);
 			if (chip) {
 				snd_printdd(KERN_DEBUG "calling snd_vx_resume\n");
 				snd_vx_resume(chip);
diff -Nru a/sound/sound_core.c b/sound/sound_core.c
--- a/sound/sound_core.c	Tue Feb  3 19:45:42 2004
+++ b/sound/sound_core.c	Tue Feb  3 19:45:42 2004
@@ -65,6 +65,9 @@
 extern int msnd_pinnacle_init(void);
 #endif
 
+struct class_simple *sound_class;
+EXPORT_SYMBOL(sound_class);
+
 /*
  *	Low level list operator. Scan the ordered list, find a hole and
  *	join into it. Called with the lock asserted
@@ -171,6 +174,8 @@
 
 	devfs_mk_cdev(MKDEV(SOUND_MAJOR, s->unit_minor),
 			S_IFCHR | mode, s->name);
+	class_simple_device_add(sound_class, MKDEV(SOUND_MAJOR, s->unit_minor),
+				NULL, s->name+6);
 	return r;
 
  fail:
@@ -193,6 +198,7 @@
 	spin_unlock(&sound_loader_lock);
 	if (p) {
 		devfs_remove(p->name);
+		class_simple_device_remove(MKDEV(SOUND_MAJOR, p->unit_minor));
 		kfree(p);
 	}
 }
@@ -556,6 +562,7 @@
 	   empty */
 	unregister_chrdev(SOUND_MAJOR, "sound");
 	devfs_remove("sound");
+	class_simple_destroy(sound_class);
 }
 
 static int __init init_soundcore(void)
@@ -565,6 +572,9 @@
 		return -EBUSY;
 	}
 	devfs_mk_dir ("sound");
+	sound_class = class_simple_create(THIS_MODULE, "sound");
+	if (IS_ERR(sound_class))
+		return PTR_ERR(sound_class);
 
 	return 0;
 }
diff -Nru a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
--- a/sound/usb/usbaudio.c	Tue Feb  3 19:45:34 2004
+++ b/sound/usb/usbaudio.c	Tue Feb  3 19:45:34 2004
@@ -33,6 +33,7 @@
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/usb.h>
+#include <linux/usb_ch9.h>
 #include <sound/core.h>
 #include <sound/info.h>
 #include <sound/pcm.h>
@@ -2560,9 +2561,10 @@
 		err = usb_control_msg(dev, usb_sndctrlpipe(dev,0),
 				      0x10, 0x43, 0x0001, 0x000a, NULL, 0, HZ);
 		if (err < 0) snd_printdd("error sending boot message: %d\n", err);
-		err = usb_get_device_descriptor(dev);
+		err = usb_get_descriptor(dev, USB_DT_DEVICE, 0,
+				&dev->descriptor, sizeof(dev->descriptor));
 		config = dev->actconfig;
-		if (err < 0) snd_printdd("error usb_get_device_descriptor: %d\n", err);
+		if (err < 0) snd_printdd("error usb_get_descriptor: %d\n", err);
 		err = usb_reset_configuration(dev);
 		if (err < 0) snd_printdd("error usb_reset_configuration: %d\n", err);
 		snd_printdd("extigy_boot: new boot length = %d\n", get_cfg_desc(config)->wTotalLength);
